summaryrefslogtreecommitdiff
path: root/vendor/modernc.org/sqlite/lib/sqlite_linux_arm.go
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/modernc.org/sqlite/lib/sqlite_linux_arm.go')
-rw-r--r--vendor/modernc.org/sqlite/lib/sqlite_linux_arm.go62651
1 files changed, 32591 insertions, 30060 deletions
diff --git a/vendor/modernc.org/sqlite/lib/sqlite_linux_arm.go b/vendor/modernc.org/sqlite/lib/sqlite_linux_arm.go
index 9c9bd6f2c..5c4506cf1 100644
--- a/vendor/modernc.org/sqlite/lib/sqlite_linux_arm.go
+++ b/vendor/modernc.org/sqlite/lib/sqlite_linux_arm.go
@@ -1,4 +1,4 @@
-// Code generated by 'ccgo -DSQLITE_PRIVATE= -export-defines "" -export-enums "" -export-externs X -export-fields F -export-typedefs "" -pkgname sqlite3 -o lib/sqlite_linux_arm.go -trace-translation-units testdata/sqlite-amalgamation-3360000/sqlite3.c -DNDEBUG -DHAVE_USLEEP -DLONGDOUBLE_TYPE=double -DSQLITE_CORE -DSQLITE_ENABLE_COLUMN_METADATA -DSQLITE_ENABLE_FTS5 -DSQLITE_ENABLE_GEOPOLY -DSQLITE_ENABLE_JSON1 -DSQLITE_ENABLE_MEMORY_MANAGEMENT -DSQLITE_ENABLE_OFFSET_SQL_FUNC -DSQLITE_ENABLE_PREUPDATE_HOOK -DSQLITE_ENABLE_RBU -DSQLITE_ENABLE_RTREE -DSQLITE_ENABLE_SESSION -DSQLITE_ENABLE_SNAPSHOT -DSQLITE_ENABLE_STAT4 -DSQLITE_ENABLE_UNLOCK_NOTIFY -DSQLITE_LIKE_DOESNT_MATCH_BLOBS -DSQLITE_MUTEX_APPDEF=1 -DSQLITE_SOUNDEX -DSQLITE_THREADSAFE=1 -DSQLITE_MUTEX_NOOP -DSQLITE_OS_UNIX=1', DO NOT EDIT.
+// Code generated by 'ccgo -DSQLITE_PRIVATE= -export-defines "" -export-enums "" -export-externs X -export-fields F -export-typedefs "" -pkgname sqlite3 -o lib/sqlite_linux_arm.go -trace-translation-units testdata/sqlite-amalgamation-3370000/sqlite3.c -DNDEBUG -DHAVE_USLEEP -DLONGDOUBLE_TYPE=double -DSQLITE_CORE -DSQLITE_ENABLE_COLUMN_METADATA -DSQLITE_ENABLE_FTS5 -DSQLITE_ENABLE_GEOPOLY -DSQLITE_ENABLE_JSON1 -DSQLITE_ENABLE_MEMORY_MANAGEMENT -DSQLITE_ENABLE_OFFSET_SQL_FUNC -DSQLITE_ENABLE_PREUPDATE_HOOK -DSQLITE_ENABLE_RBU -DSQLITE_ENABLE_RTREE -DSQLITE_ENABLE_SESSION -DSQLITE_ENABLE_SNAPSHOT -DSQLITE_ENABLE_STAT4 -DSQLITE_ENABLE_UNLOCK_NOTIFY -DSQLITE_LIKE_DOESNT_MATCH_BLOBS -DSQLITE_MUTEX_APPDEF=1 -DSQLITE_MUTEX_NOOP -DSQLITE_SOUNDEX -DSQLITE_THREADSAFE=1 -DSQLITE_OS_UNIX=1', DO NOT EDIT.
package sqlite3
@@ -16,6 +16,7 @@ var _ = math.Pi
var _ reflect.Kind
var _ atomic.Value
var _ unsafe.Pointer
+var _ *libc.TLS
var _ types.Size_t
const (
@@ -34,12 +35,11 @@ const (
ADJ_TICK = 0x4000
ADJ_TIMECONST = 0x0020
ALLPERMS = 4095
- ALT_SCHEMA_TABLE = "sqlite_schema"
- ALT_TEMP_SCHEMA_TABLE = "sqlite_temp_schema"
AT_EACCESS = 0x200
AT_EMPTY_PATH = 0x1000
AT_FDCWD = -100
AT_NO_AUTOMOUNT = 0x800
+ AT_RECURSIVE = 0x8000
AT_REMOVEDIR = 0x200
AT_STATX_DONT_SYNC = 0x4000
AT_STATX_FORCE_SYNC = 0x2000
@@ -159,6 +159,7 @@ const (
CMIN = 1
COLFLAG_BUSY = 0x0100
COLFLAG_GENERATED = 0x0060
+ COLFLAG_HASCOLL = 0x0200
COLFLAG_HASTYPE = 0x0004
COLFLAG_HIDDEN = 0x0002
COLFLAG_NOINSERT = 0x0062
@@ -174,6 +175,13 @@ const (
COLNAME_N = 5
COLNAME_NAME = 0
COLNAME_TABLE = 3
+ COLTYPE_ANY = 1
+ COLTYPE_BLOB = 2
+ COLTYPE_CUSTOM = 0
+ COLTYPE_INT = 3
+ COLTYPE_INTEGER = 4
+ COLTYPE_REAL = 5
+ COLTYPE_TEXT = 6
CQUIT = 034
CREPRINT = 18
CRPRNT = 18
@@ -203,8 +211,6 @@ const (
DB_SchemaLoaded = 0x0001
DB_UnresetViews = 0x0002
DEFFILEMODE = 438
- DFLT_SCHEMA_TABLE = "sqlite_master"
- DFLT_TEMP_SCHEMA_TABLE = "sqlite_temp_master"
DIRECT_MODE = 0
DN_ACCESS = 0x00000001
DN_ATTRIB = 0x00000020
@@ -570,6 +576,7 @@ const (
F_OFD_SETLKW = 38
F_OK = 0
F_RDLCK = 0
+ F_SEAL_FUTURE_WRITE = 0x0010
F_SEAL_GROW = 0x0004
F_SEAL_SEAL = 0x0001
F_SEAL_SHRINK = 0x0002
@@ -593,7 +600,7 @@ const (
F_ULOCK = 0
F_UNLCK = 2
F_WRLCK = 1
- GCC_VERSION = 8003000
+ GCC_VERSION = 10002001
GEOPOLY_PI = 3.1415926535897932385
HASHSIZE = 97
HASHTABLE_HASH_1 = 383
@@ -609,7 +616,9 @@ const (
INCRINIT_NORMAL = 0
INCRINIT_ROOT = 2
INCRINIT_TASK = 1
+ INITFLAG_AlterAdd = 0x0003
INITFLAG_AlterDrop = 0x0002
+ INITFLAG_AlterMask = 0x0003
INITFLAG_AlterRename = 0x0001
INLINEFUNC_affinity = 4
INLINEFUNC_coalesce = 0
@@ -671,6 +680,8 @@ const (
JT_RIGHT = 0x0010
KEYINFO_ORDER_BIGNULL = 0x02
KEYINFO_ORDER_DESC = 0x01
+ LEGACY_SCHEMA_TABLE = "sqlite_master"
+ LEGACY_TEMP_SCHEMA_TABLE = "sqlite_temp_master"
LITTLE_ENDIAN = 1234
LM_ID_BASE = 0
LM_ID_NEWLM = -1
@@ -694,6 +705,7 @@ const (
M10d_Any = 1
M10d_No = 2
M10d_Yes = 0
+ MADV_COLD = 20
MADV_DODUMP = 17
MADV_DOFORK = 11
MADV_DONTDUMP = 16
@@ -706,6 +718,7 @@ const (
MADV_MERGEABLE = 12
MADV_NOHUGEPAGE = 15
MADV_NORMAL = 0
+ MADV_PAGEOUT = 21
MADV_RANDOM = 1
MADV_REMOVE = 9
MADV_SEQUENTIAL = 2
@@ -852,26 +865,27 @@ const (
M_SQRT2l = 1.414213562373095048801688724209698079
NB = 3
NCC = 8
- NC_AllowAgg = 0x00001
- NC_AllowWin = 0x04000
- NC_Complex = 0x02000
- NC_FromDDL = 0x40000
- NC_GenCol = 0x00008
- NC_HasAgg = 0x00010
- NC_HasWin = 0x08000
- NC_IdxExpr = 0x00020
- NC_InAggFunc = 0x20000
- NC_IsCheck = 0x00004
- NC_IsDDL = 0x10000
- NC_MinMaxAgg = 0x01000
- NC_NoSelect = 0x80000
- NC_PartIdx = 0x00002
- NC_SelfRef = 0x0002e
- NC_UAggInfo = 0x00100
- NC_UBaseReg = 0x00400
- NC_UEList = 0x00080
- NC_UUpsert = 0x00200
- NC_VarSelect = 0x00040
+ NC_AllowAgg = 0x000001
+ NC_AllowWin = 0x004000
+ NC_Complex = 0x002000
+ NC_FromDDL = 0x040000
+ NC_GenCol = 0x000008
+ NC_HasAgg = 0x000010
+ NC_HasWin = 0x008000
+ NC_IdxExpr = 0x000020
+ NC_InAggFunc = 0x020000
+ NC_IsCheck = 0x000004
+ NC_IsDDL = 0x010000
+ NC_MinMaxAgg = 0x001000
+ NC_NoSelect = 0x080000
+ NC_OrderAgg = 0x8000000
+ NC_PartIdx = 0x000002
+ NC_SelfRef = 0x00002e
+ NC_UAggInfo = 0x000100
+ NC_UBaseReg = 0x000400
+ NC_UEList = 0x000080
+ NC_UUpsert = 0x000200
+ NC_VarSelect = 0x000040
NDEBUG = 1
NN = 1
NOT_WITHIN = 0
@@ -936,186 +950,188 @@ const (
OPFLG_JUMP = 0x01
OPFLG_OUT2 = 0x10
OPFLG_OUT3 = 0x20
- OP_Abortable = 179
+ OP_Abortable = 181
OP_Add = 106
- OP_AddImm = 83
- OP_Affinity = 92
- OP_AggFinal = 161
- OP_AggInverse = 157
- OP_AggStep = 158
- OP_AggStep1 = 159
- OP_AggValue = 160
+ OP_AddImm = 84
+ OP_Affinity = 94
+ OP_AggFinal = 163
+ OP_AggInverse = 159
+ OP_AggStep = 160
+ OP_AggStep1 = 161
+ OP_AggValue = 162
OP_And = 44
OP_AutoCommit = 1
OP_BitAnd = 102
OP_BitNot = 113
OP_BitOr = 103
- OP_Blob = 74
- OP_Cast = 85
+ OP_Blob = 75
+ OP_Cast = 86
OP_Checkpoint = 6
- OP_ChngCntRow = 80
- OP_Clear = 141
- OP_Close = 118
- OP_CollSeq = 82
- OP_Column = 91
- OP_ColumnsUsed = 119
- OP_Compare = 87
+ OP_ChngCntRow = 81
+ OP_Clear = 143
+ OP_Close = 120
+ OP_CollSeq = 83
+ OP_Column = 92
+ OP_ColumnsUsed = 121
+ OP_Compare = 88
OP_Concat = 111
- OP_Copy = 77
- OP_Count = 94
- OP_CreateBtree = 143
- OP_CursorHint = 175
- OP_CursorLock = 163
- OP_CursorUnlock = 164
- OP_DecrJumpZero = 59
- OP_DeferredSeek = 137
- OP_Delete = 126
- OP_Destroy = 140
+ OP_Copy = 78
+ OP_Count = 96
+ OP_CreateBtree = 145
+ OP_CursorHint = 177
+ OP_CursorLock = 165
+ OP_CursorUnlock = 166
+ OP_DecrJumpZero = 60
+ OP_DeferredSeek = 139
+ OP_Delete = 128
+ OP_Destroy = 142
OP_Divide = 109
- OP_DropIndex = 148
- OP_DropTable = 147
- OP_DropTrigger = 149
+ OP_DropIndex = 150
+ OP_DropTable = 149
+ OP_DropTrigger = 151
OP_ElseEq = 58
- OP_EndCoroutine = 66
+ OP_EndCoroutine = 67
OP_Eq = 53
- OP_Expire = 162
- OP_Explain = 178
- OP_FinishSeek = 139
- OP_FkCounter = 154
- OP_FkIfZero = 47
- OP_Found = 30
- OP_Function = 64
+ OP_Expire = 164
+ OP_Explain = 180
+ OP_FinishSeek = 141
+ OP_FkCounter = 156
+ OP_FkIfZero = 48
+ OP_Found = 31
+ OP_Function = 65
OP_Ge = 57
OP_Gosub = 12
OP_Goto = 11
OP_Gt = 54
- OP_Halt = 68
- OP_HaltIfNull = 67
- OP_IdxDelete = 136
- OP_IdxGE = 41
- OP_IdxGT = 39
- OP_IdxInsert = 134
- OP_IdxLE = 38
- OP_IdxLT = 40
- OP_IdxRowid = 138
+ OP_Halt = 69
+ OP_HaltIfNull = 68
+ OP_IdxDelete = 138
+ OP_IdxGE = 42
+ OP_IdxGT = 40
+ OP_IdxInsert = 136
+ OP_IdxLE = 39
+ OP_IdxLT = 41
+ OP_IdxRowid = 140
OP_If = 18
- OP_IfNoHope = 27
+ OP_IfNoHope = 28
OP_IfNot = 20
- OP_IfNotOpen = 26
- OP_IfNotZero = 49
- OP_IfNullRow = 21
- OP_IfPos = 48
- OP_IfSmaller = 34
- OP_IncrVacuum = 60
- OP_Init = 62
+ OP_IfNotOpen = 27
+ OP_IfNotZero = 59
+ OP_IfNullRow = 22
+ OP_IfPos = 49
+ OP_IfSmaller = 35
+ OP_IncrVacuum = 61
+ OP_Init = 63
OP_InitCoroutine = 13
- OP_Insert = 124
- OP_Int64 = 70
- OP_IntCopy = 79
- OP_Integer = 69
- OP_IntegrityCk = 150
+ OP_Insert = 126
+ OP_Int64 = 71
+ OP_IntCopy = 80
+ OP_Integer = 70
+ OP_IntegrityCk = 153
OP_IsNull = 50
- OP_IsTrue = 88
+ OP_IsNullOrType = 21
+ OP_IsTrue = 89
OP_JournalMode = 7
OP_Jump = 16
- OP_Last = 33
+ OP_Last = 34
OP_Le = 55
- OP_LoadAnalysis = 146
+ OP_LoadAnalysis = 148
OP_Lt = 56
- OP_MakeRecord = 93
- OP_MaxPgcnt = 173
- OP_MemMax = 155
- OP_Move = 76
+ OP_MakeRecord = 95
+ OP_MaxPgcnt = 175
+ OP_MemMax = 157
+ OP_Move = 77
OP_Multiply = 108
OP_MustBeInt = 15
OP_Ne = 52
- OP_NewRowid = 123
+ OP_NewRowid = 125
OP_Next = 5
- OP_NoConflict = 28
- OP_Noop = 177
+ OP_NoConflict = 29
+ OP_Noop = 179
OP_Not = 19
- OP_NotExists = 32
- OP_NotFound = 29
+ OP_NotExists = 33
+ OP_NotFound = 30
OP_NotNull = 51
- OP_Null = 72
- OP_NullRow = 132
- OP_Offset = 90
- OP_OffsetLimit = 156
+ OP_Null = 73
+ OP_NullRow = 134
+ OP_Offset = 91
+ OP_OffsetLimit = 158
OP_Once = 17
- OP_OpenAutoindex = 101
- OP_OpenDup = 100
- OP_OpenEphemeral = 112
- OP_OpenPseudo = 117
- OP_OpenRead = 98
- OP_OpenWrite = 99
+ OP_OpenAutoindex = 114
+ OP_OpenDup = 112
+ OP_OpenEphemeral = 115
+ OP_OpenPseudo = 119
+ OP_OpenRead = 100
+ OP_OpenWrite = 101
OP_Or = 43
- OP_Pagecount = 172
- OP_Param = 153
- OP_ParseSchema = 145
- OP_Permutation = 86
+ OP_Pagecount = 174
+ OP_Param = 155
+ OP_ParseSchema = 147
+ OP_Permutation = 87
OP_Prev = 4
- OP_Program = 46
- OP_PureFunc = 63
- OP_ReadCookie = 95
+ OP_Program = 47
+ OP_PureFunc = 64
+ OP_ReadCookie = 97
OP_Real = 152
- OP_RealAffinity = 84
- OP_ReleaseReg = 176
+ OP_RealAffinity = 85
+ OP_ReleaseReg = 178
OP_Remainder = 110
- OP_ReopenIdx = 97
- OP_ResetCount = 127
- OP_ResetSorter = 142
- OP_ResultRow = 81
- OP_Return = 65
- OP_Rewind = 37
- OP_RowCell = 125
- OP_RowData = 130
- OP_RowSetAdd = 151
- OP_RowSetRead = 42
- OP_RowSetTest = 45
- OP_Rowid = 131
- OP_SCopy = 78
+ OP_ReopenIdx = 99
+ OP_ResetCount = 129
+ OP_ResetSorter = 144
+ OP_ResultRow = 82
+ OP_Return = 66
+ OP_Rewind = 38
+ OP_RowCell = 127
+ OP_RowData = 132
+ OP_RowSetAdd = 154
+ OP_RowSetRead = 45
+ OP_RowSetTest = 46
+ OP_Rowid = 133
+ OP_SCopy = 79
OP_Savepoint = 0
- OP_SeekEnd = 133
- OP_SeekGE = 24
- OP_SeekGT = 25
- OP_SeekHit = 121
- OP_SeekLE = 23
- OP_SeekLT = 22
- OP_SeekRowid = 31
- OP_SeekScan = 120
- OP_Sequence = 122
- OP_SequenceTest = 115
- OP_SetCookie = 96
+ OP_SeekEnd = 135
+ OP_SeekGE = 25
+ OP_SeekGT = 26
+ OP_SeekHit = 123
+ OP_SeekLE = 24
+ OP_SeekLT = 23
+ OP_SeekRowid = 32
+ OP_SeekScan = 122
+ OP_Sequence = 124
+ OP_SequenceTest = 118
+ OP_SetCookie = 98
OP_ShiftLeft = 104
OP_ShiftRight = 105
- OP_SoftNull = 73
- OP_Sort = 36
- OP_SorterCompare = 128
- OP_SorterData = 129
- OP_SorterInsert = 135
+ OP_SoftNull = 74
+ OP_Sort = 37
+ OP_SorterCompare = 130
+ OP_SorterData = 131
+ OP_SorterInsert = 137
OP_SorterNext = 3
- OP_SorterOpen = 114
- OP_SorterSort = 35
- OP_SqlExec = 144
- OP_String = 71
+ OP_SorterOpen = 117
+ OP_SorterSort = 36
+ OP_SqlExec = 146
+ OP_String = 72
OP_String8 = 116
OP_Subtract = 107
- OP_TableLock = 165
- OP_Trace = 174
+ OP_TableLock = 167
+ OP_Trace = 176
OP_Transaction = 2
- OP_VBegin = 166
- OP_VColumn = 170
- OP_VCreate = 167
- OP_VDestroy = 168
+ OP_TypeCheck = 93
+ OP_VBegin = 168
+ OP_VColumn = 172
+ OP_VCreate = 169
+ OP_VDestroy = 170
OP_VFilter = 9
- OP_VNext = 61
- OP_VOpen = 169
- OP_VRename = 171
+ OP_VNext = 62
+ OP_VOpen = 171
+ OP_VRename = 173
OP_VUpdate = 10
OP_Vacuum = 8
- OP_Variable = 75
+ OP_Variable = 76
OP_Yield = 14
- OP_ZeroOrNull = 89
+ OP_ZeroOrNull = 90
OS_VXWORKS = 0
O_ACCMODE = 0003
O_APPEND = 02000
@@ -1231,6 +1247,8 @@ const (
POSIX_MADV_RANDOM = 1
POSIX_MADV_SEQUENTIAL = 2
POSIX_MADV_WILLNEED = 3
+ PREFERRED_SCHEMA_TABLE = "sqlite_schema"
+ PREFERRED_TEMP_SCHEMA_TABLE = "sqlite_temp_schema"
PROT_EXEC = 0x4
PROT_GROWSDOWN = 0x01000000
PROT_GROWSUP = 0x02000000
@@ -1282,7 +1300,7 @@ const (
PragTyp_JOURNAL_SIZE_LIMIT = 24
PragTyp_LOCKING_MODE = 26
PragTyp_LOCK_PROXY_FILE = 25
- PragTyp_LOCK_STATUS = 43
+ PragTyp_LOCK_STATUS = 44
PragTyp_MMAP_SIZE = 28
PragTyp_MODULE_LIST = 29
PragTyp_OPTIMIZE = 30
@@ -1292,18 +1310,20 @@ const (
PragTyp_SECURE_DELETE = 33
PragTyp_SHRINK_MEMORY = 34
PragTyp_SOFT_HEAP_LIMIT = 35
- PragTyp_STATS = 44
+ PragTyp_STATS = 45
PragTyp_SYNCHRONOUS = 36
PragTyp_TABLE_INFO = 37
- PragTyp_TEMP_STORE = 38
- PragTyp_TEMP_STORE_DIRECTORY = 39
- PragTyp_THREADS = 40
- PragTyp_WAL_AUTOCHECKPOINT = 41
- PragTyp_WAL_CHECKPOINT = 42
+ PragTyp_TABLE_LIST = 38
+ PragTyp_TEMP_STORE = 39
+ PragTyp_TEMP_STORE_DIRECTORY = 40
+ PragTyp_THREADS = 41
+ PragTyp_WAL_AUTOCHECKPOINT = 42
+ PragTyp_WAL_CHECKPOINT = 43
RAND_MAX = 2147483647
RBU_CREATE_STATE = "CREATE TABLE IF NOT EXISTS %s.rbu_state(k INTEGER PRIMARY KEY, v)"
RBU_DELETE = 2
RBU_ENABLE_DELTA_CKSUM = 0
+ RBU_EXCLUSIVE_CHECKPOINT = "rbu_exclusive_checkpoint"
RBU_IDX_DELETE = 4
RBU_IDX_INSERT = 5
RBU_INSERT = 1
@@ -1408,10 +1428,11 @@ const (
SF_MultiValue = 0x0000400
SF_NestedFrom = 0x0000800
SF_NoopOrderBy = 0x0400000
+ SF_OrderByReqd = 0x8000000
SF_PushDown = 0x1000000
SF_Recursive = 0x0002000
SF_Resolved = 0x0000004
- SF_UpdateFrom = 0x0800000
+ SF_UFSrcCheck = 0x0800000
SF_UsesEphemeral = 0x0000020
SF_Values = 0x0000200
SF_View = 0x0200000
@@ -1510,6 +1531,7 @@ const (
SQLITE_API = 0
SQLITE_APICALL = 0
SQLITE_ASCII = 1
+ SQLITE_ATOMIC_INTRINSICS = 1
SQLITE_ATTACH = 24
SQLITE_AUTH = 23
SQLITE_AUTH_USER = 279
@@ -1582,6 +1604,7 @@ const (
SQLITE_CONSTRAINT = 19
SQLITE_CONSTRAINT_CHECK = 275
SQLITE_CONSTRAINT_COMMITHOOK = 531
+ SQLITE_CONSTRAINT_DATATYPE = 3091
SQLITE_CONSTRAINT_FOREIGNKEY = 787
SQLITE_CONSTRAINT_FUNCTION = 1043
SQLITE_CONSTRAINT_NOTNULL = 1299
@@ -1770,6 +1793,8 @@ const (
SQLITE_FSFLAGS_IS_MSDOS = 0x1
SQLITE_FULL = 13
SQLITE_FUNCTION = 31
+ SQLITE_FUNC_ANYORDER = 0x08000000
+ SQLITE_FUNC_BUILTIN = 0x00800000
SQLITE_FUNC_CASE = 0x0008
SQLITE_FUNC_CONSTANT = 0x0800
SQLITE_FUNC_COUNT = 0x0100
@@ -1906,12 +1931,6 @@ const (
SQLITE_LegacyFileFmt = 0x00000002
SQLITE_LoadExtFunc = 0x00020000
SQLITE_LoadExtension = 0x00010000
- SQLITE_MAGIC_BUSY = 0xf03b7906
- SQLITE_MAGIC_CLOSED = 0x9f3c2d33
- SQLITE_MAGIC_ERROR = 0xb5357930
- SQLITE_MAGIC_OPEN = 0xa029a697
- SQLITE_MAGIC_SICK = 0x4b771290
- SQLITE_MAGIC_ZOMBIE = 0x64cffc7f
SQLITE_MALLOC_SOFT_LIMIT = 1024
SQLITE_MATCH = 0
SQLITE_MAX_ATTACHED = 10
@@ -1962,7 +1981,7 @@ const (
SQLITE_MUTEX_STATIC_VFS1 = 11
SQLITE_MUTEX_STATIC_VFS2 = 12
SQLITE_MUTEX_STATIC_VFS3 = 13
- SQLITE_MX_JUMP_OPCODE = 62
+ SQLITE_MX_JUMP_OPCODE = 63
SQLITE_MinMaxOpt = 0x00010000
SQLITE_NOLFS = 22
SQLITE_NOMATCH = 1
@@ -1982,6 +2001,7 @@ const (
SQLITE_N_BTREE_META = 16
SQLITE_N_KEYWORD = 147
SQLITE_N_LIMIT = 12
+ SQLITE_N_STDTYPE = 6
SQLITE_NoCkptOnClose = 0x00000800
SQLITE_NoSchemaError = 0x08000000
SQLITE_NullCallback = 0x00000100
@@ -1992,6 +2012,7 @@ const (
SQLITE_OPEN_CREATE = 0x00000004
SQLITE_OPEN_DELETEONCLOSE = 0x00000008
SQLITE_OPEN_EXCLUSIVE = 0x00000010
+ SQLITE_OPEN_EXRESCODE = 0x02000000
SQLITE_OPEN_FULLMUTEX = 0x00010000
SQLITE_OPEN_MAIN_DB = 0x00000100
SQLITE_OPEN_MAIN_JOURNAL = 0x00000800
@@ -2014,6 +2035,7 @@ const (
SQLITE_OS_UNIX = 1
SQLITE_OS_WIN = 0
SQLITE_OmitNoopJoin = 0x00000100
+ SQLITE_OmitOrderBy = 0x00040000
SQLITE_OrderByIdxJoin = 0x00000040
SQLITE_PAGER_H = 0
SQLITE_PERM = 3
@@ -2081,11 +2103,17 @@ const (
SQLITE_SHM_UNLOCK = 1
SQLITE_SORTER_PMASZ = 250
SQLITE_SOUNDEX = 1
- SQLITE_SOURCE_ID = "2021-06-18 18:36:39 5c9a6c06871cb9fe42814af9c039eb6da5427a6ec28f187af7ebfb62eafa66e5"
+ SQLITE_SOURCE_ID = "2021-11-27 14:13:22 bd41822c7424d393a30e92ff6cb254d25c26769889c1499a18a0b9339f5d6c8a"
SQLITE_SO_ASC = 0
SQLITE_SO_DESC = 1
SQLITE_SO_UNDEFINED = -1
SQLITE_STAT4_SAMPLES = 24
+ SQLITE_STATE_BUSY = 0x6d
+ SQLITE_STATE_CLOSED = 0xce
+ SQLITE_STATE_ERROR = 0xd5
+ SQLITE_STATE_OPEN = 0x76
+ SQLITE_STATE_SICK = 0xba
+ SQLITE_STATE_ZOMBIE = 0xa7
SQLITE_STATUS_MALLOC_COUNT = 9
SQLITE_STATUS_MALLOC_SIZE = 5
SQLITE_STATUS_MEMORY_USED = 0
@@ -2180,8 +2208,8 @@ const (
SQLITE_UTF8 = 1
SQLITE_VDBEINT_H = 0
SQLITE_VDBE_H = 0
- SQLITE_VERSION = "3.36.0"
- SQLITE_VERSION_NUMBER = 3036000
+ SQLITE_VERSION = "3.37.0"
+ SQLITE_VERSION_NUMBER = 3037000
SQLITE_VTABRISK_High = 2
SQLITE_VTABRISK_Low = 0
SQLITE_VTABRISK_Normal = 1
@@ -2212,26 +2240,30 @@ const (
SRT_Table = 14
SRT_Union = 1
SRT_Upfrom = 15
- STATX_ALL = 0x0fff
- STATX_ATIME = 0x0020
- STATX_ATTR_APPEND = 0x0020
- STATX_ATTR_AUTOMOUNT = 0x1000
- STATX_ATTR_COMPRESSED = 0x0004
- STATX_ATTR_ENCRYPTED = 0x0800
- STATX_ATTR_IMMUTABLE = 0x0010
- STATX_ATTR_NODUMP = 0x0040
- STATX_BASIC_STATS = 0x07ff
- STATX_BLOCKS = 0x0400
- STATX_BTIME = 0x0800
- STATX_CTIME = 0x0080
- STATX_GID = 0x0010
- STATX_INO = 0x0100
- STATX_MODE = 0x0002
- STATX_MTIME = 0x0040
- STATX_NLINK = 0x0004
- STATX_SIZE = 0x0200
- STATX_TYPE = 0x0001
- STATX_UID = 0x0008
+ STATX_ALL = 0x00000fff
+ STATX_ATIME = 0x00000020
+ STATX_ATTR_APPEND = 0x00000020
+ STATX_ATTR_AUTOMOUNT = 0x00001000
+ STATX_ATTR_COMPRESSED = 0x00000004
+ STATX_ATTR_DAX = 0x00200000
+ STATX_ATTR_ENCRYPTED = 0x00000800
+ STATX_ATTR_IMMUTABLE = 0x00000010
+ STATX_ATTR_MOUNT_ROOT = 0x00002000
+ STATX_ATTR_NODUMP = 0x00000040
+ STATX_ATTR_VERITY = 0x00100000
+ STATX_BASIC_STATS = 0x000007ff
+ STATX_BLOCKS = 0x00000400
+ STATX_BTIME = 0x00000800
+ STATX_CTIME = 0x00000080
+ STATX_GID = 0x00000010
+ STATX_INO = 0x00000100
+ STATX_MNT_ID = 0x00001000
+ STATX_MODE = 0x00000002
+ STATX_MTIME = 0x00000040
+ STATX_NLINK = 0x00000004
+ STATX_SIZE = 0x00000200
+ STATX_TYPE = 0x00000001
+ STATX_UID = 0x00000008
STATX__RESERVED = 0x80000000
STAT_GET_NDLT = 4
STAT_GET_NEQ = 2
@@ -2261,6 +2293,7 @@ const (
SYNC_FILE_RANGE_WAIT_AFTER = 4
SYNC_FILE_RANGE_WAIT_BEFORE = 1
SYNC_FILE_RANGE_WRITE = 2
+ SYNC_FILE_RANGE_WRITE_AND_WAIT = 7
S_BLKSIZE = 512
S_IEXEC = 64
S_IFBLK = 24576
@@ -2288,6 +2321,9 @@ const (
S_IXGRP = 8
S_IXOTH = 1
S_IXUSR = 64
+ TABTYP_NORM = 0
+ TABTYP_VIEW = 2
+ TABTYP_VTAB = 1
TCFLSH = 0x540B
TCGETA = 0x5405
TCGETS = 0x5401
@@ -2319,23 +2355,24 @@ const (
TERM_VARSELECT = 0x1000
TERM_VIRTUAL = 0x0002
TERM_VNULL = 0x0080
- TF_Autoincrement = 0x0008
- TF_Ephemeral = 0x4000
- TF_Eponymous = 0x8000
- TF_HasGenerated = 0x0060
- TF_HasHidden = 0x0002
- TF_HasNotNull = 0x0800
- TF_HasPrimaryKey = 0x0004
- TF_HasStat1 = 0x0010
- TF_HasStat4 = 0x2000
- TF_HasStored = 0x0040
- TF_HasVirtual = 0x0020
- TF_NoVisibleRowid = 0x0200
- TF_OOOHidden = 0x0400
- TF_Readonly = 0x0001
- TF_Shadow = 0x1000
- TF_StatsUsed = 0x0100
- TF_WithoutRowid = 0x0080
+ TF_Autoincrement = 0x00000008
+ TF_Ephemeral = 0x00004000
+ TF_Eponymous = 0x00008000
+ TF_HasGenerated = 0x00000060
+ TF_HasHidden = 0x00000002
+ TF_HasNotNull = 0x00000800
+ TF_HasPrimaryKey = 0x00000004
+ TF_HasStat1 = 0x00000010
+ TF_HasStat4 = 0x00002000
+ TF_HasStored = 0x00000040
+ TF_HasVirtual = 0x00000020
+ TF_NoVisibleRowid = 0x00000200
+ TF_OOOHidden = 0x00000400
+ TF_Readonly = 0x00000001
+ TF_Shadow = 0x00001000
+ TF_StatsUsed = 0x00000100
+ TF_Strict = 0x00010000
+ TF_WithoutRowid = 0x00000080
TIMER_ABSTIME = 1
TIMER_END = 0
TIMER_START = 0
@@ -2434,7 +2471,7 @@ const (
TK_COLLATE = 112
TK_COLUMN = 166
TK_COLUMNKW = 60
- TK_COMMA = 26
+ TK_COMMA = 25
TK_COMMIT = 10
TK_CONCAT = 111
TK_CONFLICT = 37
@@ -2584,7 +2621,7 @@ const (
TK_WHERE = 148
TK_WINDOW = 163
TK_WITH = 81
- TK_WITHOUT = 25
+ TK_WITHOUT = 26
TMP_MAX = 238328
TRANS_NONE = 0
TRANS_READ = 1
@@ -2710,39 +2747,43 @@ const (
XN_ROWID = -1
X_OK = 1
YYFALLBACK = 1
- YYNOCODE = 317
+ YYNOCODE = 318
YYNOERRORRECOVERY = 1
- YYNRULE = 398
- YYNRULE_WITH_ACTION = 337
- YYNSTATE = 570
+ YYNRULE = 401
+ YYNRULE_WITH_ACTION = 339
+ YYNSTATE = 572
YYNTOKEN = 184
YYPARSEFREENEVERNULL = 1
YYSTACKDEPTH = 100
YYWILDCARD = 101
- YY_ACCEPT_ACTION = 1224
- YY_ACTTAB_COUNT = 2023
- YY_ERROR_ACTION = 1223
- YY_MAX_REDUCE = 1623
- YY_MAX_SHIFT = 569
- YY_MAX_SHIFTREDUCE = 1222
- YY_MIN_REDUCE = 1226
- YY_MIN_SHIFTREDUCE = 825
- YY_NO_ACTION = 1225
- YY_REDUCE_COUNT = 405
- YY_REDUCE_MAX = 1683
- YY_REDUCE_MIN = -266
- YY_SHIFT_COUNT = 569
- YY_SHIFT_MAX = 2009
+ YY_ACCEPT_ACTION = 1231
+ YY_ACTTAB_COUNT = 2037
+ YY_ERROR_ACTION = 1230
+ YY_MAX_REDUCE = 1633
+ YY_MAX_SHIFT = 571
+ YY_MAX_SHIFTREDUCE = 1229
+ YY_MIN_REDUCE = 1233
+ YY_MIN_SHIFTREDUCE = 829
+ YY_NO_ACTION = 1232
+ YY_REDUCE_COUNT = 406
+ YY_REDUCE_MAX = 1693
+ YY_REDUCE_MIN = -272
+ YY_SHIFT_COUNT = 571
+ YY_SHIFT_MAX = 2014
YY_SHIFT_MIN = 0
X_ALLOCA_H = 1
X_ANSI_STDARG_H_ = 0
X_ANSI_STDDEF_H = 0
X_ASM_GENERIC_ERRNO_BASE_H = 0
X_ASM_GENERIC_ERRNO_H = 0
+ X_ASM_GENERIC_INT_LL64_H = 0
X_ASM_GENERIC_IOCTL_H = 0
+ X_ASM_TYPES_H = 0
X_ASSERT_H = 1
X_ATFILE_SOURCE = 1
X_BITS_BYTESWAP_H = 1
+ X_BITS_ENDIANNESS_H = 1
+ X_BITS_ENDIAN_H = 1
X_BITS_ERRNO_H = 1
X_BITS_FLOATN_COMMON_H = 0
X_BITS_LIBM_SIMD_DECL_STUBS_H = 1
@@ -2752,6 +2793,7 @@ const (
X_BITS_STAT_H = 1
X_BITS_STDINT_INTN_H = 1
X_BITS_STDIO_LIM_H = 1
+ X_BITS_TIME64_H = 1
X_BITS_TIMEX_H = 1
X_BITS_TIME_H = 1
X_BITS_TYPESIZES_H = 1
@@ -2802,6 +2844,7 @@ const (
X_IO_ERR_SEEN = 0x0020
X_IO_USER_LOCK = 0x8000
X_ISOC11_SOURCE = 1
+ X_ISOC2X_SOURCE = 1
X_ISOC95_SOURCE = 1
X_ISOC99_SOURCE = 1
X_LARGEFILE64_SOURCE = 1
@@ -2813,6 +2856,9 @@ const (
X_LFS_ASYNCHRONOUS_IO = 1
X_LFS_LARGEFILE = 1
X_LINUX_IOCTL_H = 0
+ X_LINUX_POSIX_TYPES_H = 0
+ X_LINUX_STAT_H = 0
+ X_LINUX_TYPES_H = 0
X_MATH_H = 1
X_MKNOD_VER = 1
X_MKNOD_VER_LINUX = 1
@@ -2926,6 +2972,7 @@ const (
X_SYS_TIME_H = 1
X_SYS_TTYDEFAULTS_H_ = 0
X_SYS_TYPES_H = 1
+ X_THREAD_MUTEX_INTERNAL_H = 1
X_THREAD_SHARED_TYPES_H = 1
X_TIME_H = 1
X_T_PTRDIFF = 0
@@ -3036,7 +3083,7 @@ const (
// the `_SC_*' symbols for the NAME argument to `sysconf';
// and the `_CS_*' symbols for the NAME argument to `confstr'.
// `sysconf', `pathconf', and `confstr' NAME values. Generic version.
-// Copyright (C) 1993-2018 Free Software Foundation, Inc.
+// Copyright (C) 1993-2020 Free Software Foundation, Inc.
// This file is part of the GNU C Library.
//
// The GNU C Library is free software; you can redistribute it and/or
@@ -3051,7 +3098,7 @@ const (
//
// You should have received a copy of the GNU Lesser General Public
// License along with the GNU C Library; if not, see
-// <http://www.gnu.org/licenses/>.
+// <https://www.gnu.org/licenses/>.
// Values for the NAME argument to `pathconf' and `fpathconf'.
const ( /* confname.h:24:1: */
@@ -3440,16 +3487,11 @@ const ( /* fcntl-linux.h:265:1: */
F_OWNER_GID = 2
)
-// In 4.3bsd-net2, leave these undefined to indicate that size_t, etc.
-// are already defined.
-// BSD/OS 3.1 and FreeBSD [23].x require the MACHINE_ANSI_H check here.
-// NetBSD 5 requires the I386_ANSI_H and X86_64_ANSI_H checks here.
-
// A null pointer constant.
// XPG requires a few symbols from <sys/wait.h> being defined.
// Definitions of flag bits for `waitpid' et al.
-// Copyright (C) 1992-2018 Free Software Foundation, Inc.
+// Copyright (C) 1992-2020 Free Software Foundation, Inc.
// This file is part of the GNU C Library.
//
// The GNU C Library is free software; you can redistribute it and/or
@@ -3464,7 +3506,7 @@ const ( /* fcntl-linux.h:265:1: */
//
// You should have received a copy of the GNU Lesser General Public
// License along with the GNU C Library; if not, see
-// <http://www.gnu.org/licenses/>.
+// <https://www.gnu.org/licenses/>.
// Bits in the third argument to `waitpid'.
@@ -3481,17 +3523,6 @@ const ( /* waitflags.h:52:1: */
P_PGID = 2
)
-// Values for the first argument to `getitimer' and `setitimer'.
-const ( /* time.h:88:1: */
- // Timers run in real time.
- ITIMER_REAL = 0
- // Timers run only when the process is executing.
- ITIMER_VIRTUAL = 1
- // Timers run when the process is executing and when
- // the system is executing on behalf of the process.
- ITIMER_PROF = 2
-)
-
// These are the possible values for the FLAGS argument to `dladdr1'.
// This indicates what extra information is stored at *EXTRA_INFO.
// It may also be zero, in which case the EXTRA_INFO argument is not used.
@@ -3553,7 +3584,7 @@ const ( /* dlfcn.h:128:1: */
//
// Define __FP_LOGB0_IS_MIN and __FP_LOGBNAN_IS_MIN.
-// Copyright (C) 2016-2018 Free Software Foundation, Inc.
+// Copyright (C) 2016-2020 Free Software Foundation, Inc.
// This file is part of the GNU C Library.
//
// The GNU C Library is free software; you can redistribute it and/or
@@ -3568,7 +3599,7 @@ const ( /* dlfcn.h:128:1: */
//
// You should have received a copy of the GNU Lesser General Public
// License along with the GNU C Library; if not, see
-// <http://www.gnu.org/licenses/>.
+// <https://www.gnu.org/licenses/>.
// __FP_LOGB0_IS_MIN is defined to 1 if FP_ILOGB0 is INT_MIN, and 0 if
// it is -INT_MAX. __FP_LOGBNAN_IS_MIN is defined to 1 if FP_ILOGBNAN
@@ -3586,7 +3617,7 @@ const ( /* dlfcn.h:128:1: */
// implemented directly with a hardware multiply-add instructions.
// Define FP_FAST_* macros.
-// Copyright (C) 2016-2018 Free Software Foundation, Inc.
+// Copyright (C) 2016-2020 Free Software Foundation, Inc.
// This file is part of the GNU C Library.
//
// The GNU C Library is free software; you can redistribute it and/or
@@ -3601,7 +3632,7 @@ const ( /* dlfcn.h:128:1: */
//
// You should have received a copy of the GNU Lesser General Public
// License along with the GNU C Library; if not, see
-// <http://www.gnu.org/licenses/>.
+// <https://www.gnu.org/licenses/>.
// The GCC 4.6 compiler will define __FP_FAST_FMA{,F,L} if the fma{,f,l}
// builtins are supported.
@@ -3636,6 +3667,17 @@ const ( /* math.h:853:1: */
FP_NORMAL = 4
)
+// Values for the first argument to `getitimer' and `setitimer'.
+const ( /* time.h:89:1: */
+ // Timers run in real time.
+ ITIMER_REAL = 0
+ // Timers run only when the process is executing.
+ ITIMER_VIRTUAL = 1
+ // Timers run when the process is executing and when
+ // the system is executing on behalf of the process.
+ ITIMER_PROF = 2
+)
+
type Ptrdiff_t = int32 /* <builtin>:3:26 */
type Size_t = uint32 /* <builtin>:9:23 */
@@ -3648,7 +3690,7 @@ type X__float128 = float64 /* <builtin>:47:21 */
// *****************************************************************************
//
// This file is an amalgamation of many separate C source files from SQLite
-// version 3.36.0. By combining all the individual C code files into this
+// version 3.37.0. By combining all the individual C code files into this
// single large file, the entire code can be compiled as a single translation
// unit. This allows many compilers to do optimizations that would not be
// possible if the files were compiled separately. Performance improvements
@@ -3664,68 +3706,6 @@ type X__float128 = float64 /* <builtin>:47:21 */
// if you want a wrapper to interface SQLite with your choice of programming
// language. The code for the "sqlite3" command-line shell is also in a
// separate file. This file contains only code for the core SQLite library.
-//************* Begin file ctime.c ******************************************
-// 2010 February 23
-//
-// The author disclaims copyright to this source code. In place of
-// a legal notice, here is a blessing:
-//
-// May you do good and not evil.
-// May you find forgiveness for yourself and forgive others.
-// May you share freely, never taking more than you give.
-//
-//
-//
-// This file implements routines used to report what compile-time options
-// SQLite was built with.
-
-// Include the configuration header output by 'configure' if we're using the
-// autoconf-based build
-
-// These macros are provided to "stringify" the value of the define
-// for those options in which the value is meaningful.
-
-// Like CTIMEOPT_VAL, but especially for SQLITE_DEFAULT_LOOKASIDE. This
-// option requires a separate macro because legal values contain a single
-// comma. e.g. (-DSQLITE_DEFAULT_LOOKASIDE="100,100")
-
-// An array of names of all compile-time options. This array should
-// be sorted A-Z.
-//
-// This array looks large, but in a typical installation actually uses
-// only a handful of compile-time options, so most times this array is usually
-// rather short and uses little memory space.
-var sqlite3azCompileOpt = [19]uintptr{
-
- // BEGIN CODE GENERATED BY tool/mkctime.tcl
- ts, /* "COMPILER=gcc-8.3..." */
- ts + 19, /* "ENABLE_COLUMN_ME..." */
- ts + 42, /* "ENABLE_FTS5" */
- ts + 54, /* "ENABLE_GEOPOLY" */
- ts + 69, /* "ENABLE_JSON1" */
- ts + 82, /* "ENABLE_MEMORY_MA..." */
- ts + 107, /* "ENABLE_OFFSET_SQ..." */
- ts + 130, /* "ENABLE_PREUPDATE..." */
- ts + 152, /* "ENABLE_RBU" */
- ts + 163, /* "ENABLE_RTREE" */
- ts + 176, /* "ENABLE_SESSION" */
- ts + 191, /* "ENABLE_SNAPSHOT" */
- ts + 207, /* "ENABLE_STAT4" */
- ts + 220, /* "ENABLE_UNLOCK_NO..." */
- ts + 241, /* "LIKE_DOESNT_MATC..." */
- ts + 265, /* "MUTEX_NOOP" */
- ts + 276, /* "SOUNDEX" */
- ts + 284, /* "SYSTEM_MALLOC" */
- ts + 298, /* "THREADSAFE=1" */
- // END CODE GENERATED BY tool/mkctime.tcl
-} /* sqlite3.c:72:19 */
-
-func Xsqlite3CompileOptions(tls *libc.TLS, pnOpt uintptr) uintptr { /* sqlite3.c:804:27: */
- *(*int32)(unsafe.Pointer(pnOpt)) = (int32(uint32(unsafe.Sizeof(sqlite3azCompileOpt)) / uint32(unsafe.Sizeof(uintptr(0)))))
- return uintptr(uintptr(unsafe.Pointer(&sqlite3azCompileOpt)))
-}
-
-//************* End of ctime.c **********************************************
//************* Begin file sqliteInt.h **************************************
// 2001 September 15
//
@@ -3871,6 +3851,11 @@ func Xsqlite3CompileOptions(tls *libc.TLS, pnOpt uintptr) uintptr { /* sqlite3.c
// define is required to maintain binary compatibility with the MSVC runtime
// library in use (e.g. for Windows XP).
+// Optionally #include a user-defined header, whereby compilation options
+// may be set prior to where they take effect, but after platform setup.
+// If SQLITE_CUSTOM_INCLUDE=? is defined, its value names the #include
+// file.
+
// The public SQLite interface. The _FILE_OFFSET_BITS macro must appear
// first in QNX. Also, the _USE_32BIT_TIME_T macro must appear first for
// MinGW.
@@ -3906,7 +3891,7 @@ func Xsqlite3CompileOptions(tls *libc.TLS, pnOpt uintptr) uintptr { /* sqlite3.c
// The makefile makes some minor changes to this file (such as inserting
// the version number) and changes its name to "sqlite3.h" as
// part of the build process.
-// Copyright (C) 1989-2018 Free Software Foundation, Inc.
+// Copyright (C) 1989-2020 Free Software Foundation, Inc.
//
// This file is part of GCC.
//
@@ -3957,7 +3942,30 @@ type Va_list = X__gnuc_va_list /* stdarg.h:99:24 */
// Make sure we can call this stuff from C++.
-// Provide the ability to override linkage features of the interface.
+// Facilitate override of interface linkage and calling conventions.
+// Be aware that these macros may not be used within this particular
+// translation of the amalgamation and its associated header file.
+//
+// The SQLITE_EXTERN and SQLITE_API macros are used to instruct the
+// compiler that the target identifier should have external linkage.
+//
+// The SQLITE_CDECL macro is used to set the calling convention for
+// public functions that accept a variable number of arguments.
+//
+// The SQLITE_APICALL macro is used to set the calling convention for
+// public functions that accept a fixed number of arguments.
+//
+// The SQLITE_STDCALL macro is no longer used and is now deprecated.
+//
+// The SQLITE_CALLBACK macro is used to set the calling convention for
+// function pointers.
+//
+// The SQLITE_SYSAPI macro is used to set the calling convention for
+// functions provided by the operating system.
+//
+// Currently, the SQLITE_CDECL, SQLITE_APICALL, SQLITE_CALLBACK, and
+// SQLITE_SYSAPI macros are used only when building for environments
+// that require non-default calling conventions.
// These no-op macros are used in front of interfaces to mark those
// interfaces as either deprecated or experimental. New applications
@@ -4032,7 +4040,7 @@ type Va_list = X__gnuc_va_list /* stdarg.h:99:24 */
// of the hash might be different from [SQLITE_SOURCE_ID].)^
//
// See also: [sqlite_version()] and [sqlite_source_id()].
-var Xsqlite3_version = *(*[7]uint8)(unsafe.Pointer(ts + 311 /* "3.36.0" */)) /* sqlite3.c:1244:23 */
+var Xsqlite3_version = *(*[7]uint8)(unsafe.Pointer(ts /* "3.37.0" */)) /* sqlite3.c:491:23 */
// CAPI3REF: Database Connection Handle
// KEYWORDS: {database connection} {database connections}
@@ -4077,11 +4085,12 @@ type sqlite3 = struct {
FmTrace U8
FnoSharedCache U8
FnSqlExec U8
- F__ccgo_pad2 [3]byte
+ FeOpenState U8
+ F__ccgo_pad2 [2]byte
FnextPagesize int32
- Fmagic U32
- FnChange int32
- FnTotalChange int32
+ F__ccgo_pad3 [4]byte
+ FnChange I64
+ FnTotalChange I64
FaLimit [12]int32
FnMaxSorterMmap int32
Finit struct {
@@ -4110,6 +4119,9 @@ type sqlite3 = struct {
FxRollbackCallback uintptr
FpUpdateArg uintptr
FxUpdateCallback uintptr
+ FpAutovacPagesArg uintptr
+ FxAutovacDestr uintptr
+ FxAutovacPages uintptr
FpParse uintptr
FpPreUpdateArg uintptr
FxPreUpdateCallback uintptr
@@ -4120,6 +4132,7 @@ type sqlite3 = struct {
FxCollNeeded16 uintptr
FpCollNeededArg uintptr
FpErr uintptr
+ F__ccgo_pad4 [4]byte
Fu1 struct {
F__ccgo_pad1 [0]uint64
FisInterrupted int32
@@ -4145,7 +4158,7 @@ type sqlite3 = struct {
FbusyTimeout int32
FnSavepoint int32
FnStatement int32
- F__ccgo_pad3 [4]byte
+ F__ccgo_pad5 [4]byte
FnDeferredCons I64
FnDeferredImmCons I64
FpnBytesFreed uintptr
@@ -4154,7 +4167,7 @@ type sqlite3 = struct {
FpUnlockArg uintptr
FxUnlockNotify uintptr
FpNextBlocked uintptr
-} /* sqlite3.c:1331:9 */
+} /* sqlite3.c:578:9 */
// CAPI3REF: Database Connection Handle
// KEYWORDS: {database connection} {database connections}
@@ -4168,7 +4181,7 @@ type sqlite3 = struct {
// [sqlite3_prepare_v2()], [sqlite3_create_function()], and
// [sqlite3_busy_timeout()] to name but three) that are methods on an
// sqlite3 object.
-type Sqlite3 = sqlite3 /* sqlite3.c:1331:24 */
+type Sqlite3 = sqlite3 /* sqlite3.c:578:24 */
// CAPI3REF: 64-Bit Integer Types
// KEYWORDS: sqlite_int64 sqlite_uint64
@@ -4184,15 +4197,15 @@ type Sqlite3 = sqlite3 /* sqlite3.c:1331:24 */
// between -9223372036854775808 and +9223372036854775807 inclusive. ^The
// sqlite3_uint64 and sqlite_uint64 types can store integer values
// between 0 and +18446744073709551615 inclusive.
-type Sqlite_int64 = int64 /* sqlite3.c:1360:25 */
-type Sqlite_uint64 = uint64 /* sqlite3.c:1361:34 */
-type Sqlite3_int64 = Sqlite_int64 /* sqlite3.c:1363:22 */
-type Sqlite3_uint64 = Sqlite_uint64 /* sqlite3.c:1364:23 */
+type Sqlite_int64 = int64 /* sqlite3.c:607:25 */
+type Sqlite_uint64 = uint64 /* sqlite3.c:608:34 */
+type Sqlite3_int64 = Sqlite_int64 /* sqlite3.c:610:22 */
+type Sqlite3_uint64 = Sqlite_uint64 /* sqlite3.c:611:23 */
// The type for a callback function.
// This is legacy and deprecated. It is included for historical
// compatibility and is not documented.
-type Sqlite3_callback = uintptr /* sqlite3.c:1420:13 */
+type Sqlite3_callback = uintptr /* sqlite3.c:667:13 */
// CAPI3REF: Result Codes
// KEYWORDS: {result code definitions}
@@ -4227,6 +4240,19 @@ type Sqlite3_callback = uintptr /* sqlite3.c:1420:13 */
// These bit values are intended for use in the
// 3rd parameter to the [sqlite3_open_v2()] interface and
// in the 4th parameter to the [sqlite3_vfs.xOpen] method.
+//
+// Only those flags marked as "Ok for sqlite3_open_v2()" may be
+// used as the third argument to the [sqlite3_open_v2()] interface.
+// The other flags have historically been ignored by sqlite3_open_v2(),
+// though future versions of SQLite might change so that an error is
+// raised if any of the disallowed bits are passed into sqlite3_open_v2().
+// Applications should not depend on the historical behavior.
+//
+// Note in particular that passing the SQLITE_OPEN_EXCLUSIVE flag into
+// [sqlite3_open_v2()] does *not* cause the underlying database file
+// to be opened using O_EXCL. Passing SQLITE_OPEN_EXCLUSIVE into
+// [sqlite3_open_v2()] has historically be a no-op and might become an
+// error in future versions of SQLite.
// Reserved: 0x00F00000
// Legacy compatibility:
@@ -4303,7 +4329,7 @@ type Sqlite3_callback = uintptr /* sqlite3.c:1420:13 */
// for their own use. The pMethods entry is a pointer to an
// [sqlite3_io_methods] object that defines methods for performing
// I/O operations on the open file.
-type sqlite3_file = struct{ FpMethods uintptr } /* sqlite3.c:1331:9 */
+type sqlite3_file = struct{ FpMethods uintptr } /* sqlite3.c:578:9 */
// CAPI3REF: Result Codes
// KEYWORDS: {result code definitions}
@@ -4338,6 +4364,19 @@ type sqlite3_file = struct{ FpMethods uintptr } /* sqlite3.c:1331:9 */
// These bit values are intended for use in the
// 3rd parameter to the [sqlite3_open_v2()] interface and
// in the 4th parameter to the [sqlite3_vfs.xOpen] method.
+//
+// Only those flags marked as "Ok for sqlite3_open_v2()" may be
+// used as the third argument to the [sqlite3_open_v2()] interface.
+// The other flags have historically been ignored by sqlite3_open_v2(),
+// though future versions of SQLite might change so that an error is
+// raised if any of the disallowed bits are passed into sqlite3_open_v2().
+// Applications should not depend on the historical behavior.
+//
+// Note in particular that passing the SQLITE_OPEN_EXCLUSIVE flag into
+// [sqlite3_open_v2()] does *not* cause the underlying database file
+// to be opened using O_EXCL. Passing SQLITE_OPEN_EXCLUSIVE into
+// [sqlite3_open_v2()] has historically be a no-op and might become an
+// error in future versions of SQLite.
// Reserved: 0x00F00000
// Legacy compatibility:
@@ -4414,7 +4453,7 @@ type sqlite3_file = struct{ FpMethods uintptr } /* sqlite3.c:1331:9 */
// for their own use. The pMethods entry is a pointer to an
// [sqlite3_io_methods] object that defines methods for performing
// I/O operations on the open file.
-type Sqlite3_file = sqlite3_file /* sqlite3.c:1766:29 */
+type Sqlite3_file = sqlite3_file /* sqlite3.c:1028:29 */
type sqlite3_io_methods = struct {
FiVersion int32
FxClose uintptr
@@ -4435,7 +4474,7 @@ type sqlite3_io_methods = struct {
FxShmUnmap uintptr
FxFetch uintptr
FxUnfetch uintptr
-} /* sqlite3.c:1331:9 */
+} /* sqlite3.c:578:9 */
// CAPI3REF: OS Interface File Virtual Methods Object
//
@@ -4529,7 +4568,7 @@ type sqlite3_io_methods = struct {
// fails to zero-fill short reads might seem to work. However,
// failure to zero-fill short reads will eventually lead to
// database corruption.
-type Sqlite3_io_methods = sqlite3_io_methods /* sqlite3.c:1865:35 */
+type Sqlite3_io_methods = sqlite3_io_methods /* sqlite3.c:1127:35 */
// CAPI3REF: Loadable Extension Thunk
//
@@ -4791,7 +4830,10 @@ type sqlite3_api_routines = struct {
Ffree_filename uintptr
Fdatabase_file_object uintptr
Ftxn_state uintptr
-} /* sqlite3.c:2298:9 */
+ Fchanges64 uintptr
+ Ftotal_changes64 uintptr
+ Fautovacuum_pages uintptr
+} /* sqlite3.c:1560:9 */
// CAPI3REF: Loadable Extension Thunk
//
@@ -4799,7 +4841,7 @@ type sqlite3_api_routines = struct {
// the third parameter to entry points of [loadable extensions]. This
// structure must be typedefed in order to work around compiler warnings
// on some platforms.
-type Sqlite3_api_routines = sqlite3_api_routines /* sqlite3.c:2298:37 */
+type Sqlite3_api_routines = sqlite3_api_routines /* sqlite3.c:1560:37 */
// CAPI3REF: OS Interface Object
//
@@ -4991,7 +5033,7 @@ type sqlite3_vfs = struct {
FxSetSystemCall uintptr
FxGetSystemCall uintptr
FxNextSystemCall uintptr
-} /* sqlite3.c:1331:9 */
+} /* sqlite3.c:578:9 */
// CAPI3REF: OS Interface Object
//
@@ -5160,8 +5202,8 @@ type sqlite3_vfs = struct {
// or all of these interfaces to be NULL or for their behavior to change
// from one release to the next. Applications must not attempt to access
// any of these methods if the iVersion of the VFS is less than 3.
-type Sqlite3_vfs = sqlite3_vfs /* sqlite3.c:2469:28 */
-type Sqlite3_syscall_ptr = uintptr /* sqlite3.c:2470:14 */
+type Sqlite3_vfs = sqlite3_vfs /* sqlite3.c:1731:28 */
+type Sqlite3_syscall_ptr = uintptr /* sqlite3.c:1732:14 */
// CAPI3REF: Memory Allocation Routines
//
@@ -5233,7 +5275,7 @@ type sqlite3_mem_methods = struct {
FxInit uintptr
FxShutdown uintptr
FpAppData uintptr
-} /* sqlite3.c:2767:9 */
+} /* sqlite3.c:2029:9 */
// CAPI3REF: Memory Allocation Routines
//
@@ -5296,7 +5338,7 @@ type sqlite3_mem_methods = struct {
//
// SQLite will never invoke xInit() more than once without an intervening
// call to xShutdown().
-type Sqlite3_mem_methods = sqlite3_mem_methods /* sqlite3.c:2767:36 */
+type Sqlite3_mem_methods = sqlite3_mem_methods /* sqlite3.c:2029:36 */
// CAPI3REF: Dynamically Typed Value Object
// KEYWORDS: {protected sqlite3_value} {unprotected sqlite3_value}
@@ -5348,7 +5390,7 @@ type sqlite3_value = struct {
FuTemp U32
Fdb uintptr
FxDel uintptr
-} /* sqlite3.c:1331:9 */
+} /* sqlite3.c:578:9 */
// CAPI3REF: Dynamically Typed Value Object
// KEYWORDS: {protected sqlite3_value} {unprotected sqlite3_value}
@@ -5388,7 +5430,7 @@ type sqlite3_value = struct {
// [sqlite3_value_dup()].
// The [sqlite3_value_blob | sqlite3_value_type()] family of
// interfaces require protected sqlite3_value objects.
-type Sqlite3_value = sqlite3_value /* sqlite3.c:5368:30 */
+type Sqlite3_value = sqlite3_value /* sqlite3.c:4660:30 */
// CAPI3REF: SQL Function Context Object
//
@@ -5411,7 +5453,7 @@ type sqlite3_context = struct {
Fargc U8
F__ccgo_pad1 [2]byte
Fargv [1]uintptr
-} /* sqlite3.c:1331:9 */
+} /* sqlite3.c:578:9 */
// CAPI3REF: SQL Function Context Object
//
@@ -5423,7 +5465,7 @@ type sqlite3_context = struct {
// [sqlite3_aggregate_context()], [sqlite3_user_data()],
// [sqlite3_context_db_handle()], [sqlite3_get_auxdata()],
// and/or [sqlite3_set_auxdata()].
-type Sqlite3_context = sqlite3_context /* sqlite3.c:5382:32 */
+type Sqlite3_context = sqlite3_context /* sqlite3.c:4674:32 */
// CAPI3REF: Constants Defining Special Destructor Behavior
//
@@ -5437,7 +5479,7 @@ type Sqlite3_context = sqlite3_context /* sqlite3.c:5382:32 */
//
// The typedef is necessary to work around problems in certain
// C++ compilers.
-type Sqlite3_destructor_type = uintptr /* sqlite3.c:6747:14 */
+type Sqlite3_destructor_type = uintptr /* sqlite3.c:6039:14 */
// The interface to the virtual-table mechanism is currently considered
// to be experimental. The interface might change in incompatible ways.
@@ -5451,7 +5493,7 @@ type sqlite3_vtab = struct {
FpModule uintptr
FnRef int32
FzErrMsg uintptr
-} /* sqlite3.c:1331:9 */
+} /* sqlite3.c:578:9 */
// The interface to the virtual-table mechanism is currently considered
// to be experimental. The interface might change in incompatible ways.
@@ -5461,7 +5503,7 @@ type sqlite3_vtab = struct {
// interface fixed, support it indefinitely, and remove this comment.
// Structures used by the virtual table interface
-type Sqlite3_vtab = sqlite3_vtab /* sqlite3.c:7866:29 */
+type Sqlite3_vtab = sqlite3_vtab /* sqlite3.c:7224:29 */
type sqlite3_index_info = struct {
FnConstraint int32
FaConstraint uintptr
@@ -5478,12 +5520,12 @@ type sqlite3_index_info = struct {
FidxFlags int32
F__ccgo_pad2 [4]byte
FcolUsed Sqlite3_uint64
-} /* sqlite3.c:7867:9 */
+} /* sqlite3.c:7225:9 */
-type Sqlite3_index_info = sqlite3_index_info /* sqlite3.c:7867:35 */
-type sqlite3_vtab_cursor = struct{ FpVtab uintptr } /* sqlite3.c:7868:9 */
+type Sqlite3_index_info = sqlite3_index_info /* sqlite3.c:7225:35 */
+type sqlite3_vtab_cursor = struct{ FpVtab uintptr } /* sqlite3.c:7226:9 */
-type Sqlite3_vtab_cursor = sqlite3_vtab_cursor /* sqlite3.c:7868:36 */
+type Sqlite3_vtab_cursor = sqlite3_vtab_cursor /* sqlite3.c:7226:36 */
type sqlite3_module = struct {
FiVersion int32
FxCreate uintptr
@@ -5509,9 +5551,9 @@ type sqlite3_module = struct {
FxRelease uintptr
FxRollbackTo uintptr
FxShadowName uintptr
-} /* sqlite3.c:1331:9 */
+} /* sqlite3.c:578:9 */
-type Sqlite3_module = sqlite3_module /* sqlite3.c:7869:31 */
+type Sqlite3_module = sqlite3_module /* sqlite3.c:7227:31 */
// CAPI3REF: Virtual Table Indexing Information
// KEYWORDS: sqlite3_index_info
@@ -5619,7 +5661,7 @@ type sqlite3_index_constraint = struct {
Fusable uint8
F__ccgo_pad1 [2]byte
FiTermOffset int32
-} /* sqlite3.c:7867:9 */
+} /* sqlite3.c:7225:9 */
// CAPI3REF: Virtual Table Indexing Information
// KEYWORDS: sqlite3_index_info
@@ -5725,7 +5767,7 @@ type sqlite3_index_orderby = struct {
FiColumn int32
Fdesc uint8
F__ccgo_pad1 [3]byte
-} /* sqlite3.c:7867:9 */
+} /* sqlite3.c:7225:9 */
// CAPI3REF: Virtual Table Indexing Information
// KEYWORDS: sqlite3_index_info
@@ -5831,7 +5873,7 @@ type sqlite3_index_constraint_usage = struct {
FargvIndex int32
Fomit uint8
F__ccgo_pad1 [3]byte
-} /* sqlite3.c:7867:9 */
+} /* sqlite3.c:7225:9 */
// CAPI3REF: Mutex Methods Object
//
@@ -5906,7 +5948,7 @@ type sqlite3_mutex_methods = struct {
FxMutexLeave uintptr
FxMutexHeld uintptr
FxMutexNotheld uintptr
-} /* sqlite3.c:8701:9 */
+} /* sqlite3.c:8059:9 */
// CAPI3REF: Mutex Methods Object
//
@@ -5971,7 +6013,7 @@ type sqlite3_mutex_methods = struct {
// called, but only if the prior call to xMutexInit returned SQLITE_OK.
// If xMutexInit fails in any way, it is expected to clean up after itself
// prior to returning.
-type Sqlite3_mutex_methods = sqlite3_mutex_methods /* sqlite3.c:8701:38 */
+type Sqlite3_mutex_methods = sqlite3_mutex_methods /* sqlite3.c:8059:38 */
// CAPI3REF: Dynamic String Object
// KEYWORDS: {dynamic string}
@@ -5996,7 +6038,7 @@ type sqlite3_str = struct {
FaccError U8
FprintfFlags U8
F__ccgo_pad1 [2]byte
-} /* sqlite3.c:8964:9 */
+} /* sqlite3.c:8322:9 */
// CAPI3REF: Dynamic String Object
// KEYWORDS: {dynamic string}
@@ -6012,7 +6054,7 @@ type sqlite3_str = struct {
// <li> ^The sqlite3_str object is destroyed and the string it created
// is returned using the [sqlite3_str_finish()] interface.
// </ol>
-type Sqlite3_str = sqlite3_str /* sqlite3.c:8964:28 */
+type Sqlite3_str = sqlite3_str /* sqlite3.c:8322:28 */
// CAPI3REF: Custom Page Cache Object
//
@@ -6025,7 +6067,7 @@ type Sqlite3_str = sqlite3_str /* sqlite3.c:8964:28 */
type sqlite3_pcache_page = struct {
FpBuf uintptr
FpExtra uintptr
-} /* sqlite3.c:1331:9 */
+} /* sqlite3.c:578:9 */
// CAPI3REF: Custom Page Cache Object
//
@@ -6035,7 +6077,7 @@ type sqlite3_pcache_page = struct {
// of this object as parameters or as their return value.
//
// See [sqlite3_pcache_methods2] for additional information.
-type Sqlite3_pcache_page = sqlite3_pcache_page /* sqlite3.c:9457:36 */
+type Sqlite3_pcache_page = sqlite3_pcache_page /* sqlite3.c:8815:36 */
// CAPI3REF: Application Defined Page Cache.
// KEYWORDS: {page cache}
@@ -6208,7 +6250,7 @@ type sqlite3_pcache_methods2 = struct {
FxTruncate uintptr
FxDestroy uintptr
FxShrink uintptr
-} /* sqlite3.c:9622:9 */
+} /* sqlite3.c:8980:9 */
// CAPI3REF: Application Defined Page Cache.
// KEYWORDS: {page cache}
@@ -6367,7 +6409,7 @@ type sqlite3_pcache_methods2 = struct {
// free up as much of heap memory as possible. The page cache implementation
// is not obligated to free any memory, but well-behaved implementations should
// do their best.
-type Sqlite3_pcache_methods2 = sqlite3_pcache_methods2 /* sqlite3.c:9622:40 */
+type Sqlite3_pcache_methods2 = sqlite3_pcache_methods2 /* sqlite3.c:8980:40 */
// This is the obsolete pcache_methods object that has now been replaced
// by sqlite3_pcache_methods2. This object is not used by SQLite. It is
@@ -6384,12 +6426,12 @@ type sqlite3_pcache_methods = struct {
FxRekey uintptr
FxTruncate uintptr
FxDestroy uintptr
-} /* sqlite3.c:9645:9 */
+} /* sqlite3.c:9003:9 */
// This is the obsolete pcache_methods object that has now been replaced
// by sqlite3_pcache_methods2. This object is not used by SQLite. It is
// retained in the header file for backwards compatibility only.
-type Sqlite3_pcache_methods = sqlite3_pcache_methods /* sqlite3.c:9645:39 */
+type Sqlite3_pcache_methods = sqlite3_pcache_methods /* sqlite3.c:9003:39 */
// CAPI3REF: Online Backup Object
//
@@ -6412,7 +6454,7 @@ type sqlite3_backup = struct {
FnPagecount Pgno
FisAttached int32
FpNext uintptr
-} /* sqlite3.c:1331:9 */
+} /* sqlite3.c:578:9 */
// CAPI3REF: Online Backup Object
//
@@ -6422,7 +6464,7 @@ type sqlite3_backup = struct {
// [sqlite3_backup_finish()].
//
// See Also: [Using the SQLite Online Backup API]
-type Sqlite3_backup = sqlite3_backup /* sqlite3.c:9671:31 */
+type Sqlite3_backup = sqlite3_backup /* sqlite3.c:9029:31 */
// CAPI3REF: Database Snapshot
// KEYWORDS: {snapshot} {sqlite3_snapshot}
@@ -6442,7 +6484,7 @@ type Sqlite3_backup = sqlite3_backup /* sqlite3.c:9671:31 */
// version of the database file so that it is possible to later open a new read
// transaction that sees that historical version of the database rather than
// the most recent version.
-type sqlite3_snapshot = struct{ Fhidden [48]uint8 } /* sqlite3.c:10712:9 */
+type sqlite3_snapshot = struct{ Fhidden [48]uint8 } /* sqlite3.c:10071:9 */
// CAPI3REF: Database Snapshot
// KEYWORDS: {snapshot} {sqlite3_snapshot}
@@ -6462,7 +6504,7 @@ type sqlite3_snapshot = struct{ Fhidden [48]uint8 } /* sqlite3.c:10712:9 */
// version of the database file so that it is possible to later open a new read
// transaction that sees that historical version of the database rather than
// the most recent version.
-type Sqlite3_snapshot = sqlite3_snapshot /* sqlite3.c:10714:3 */
+type Sqlite3_snapshot = sqlite3_snapshot /* sqlite3.c:10073:3 */
// CAPI3REF: Flags for sqlite3_deserialize()
//
@@ -6505,7 +6547,7 @@ type sqlite3_rtree_geometry = struct {
FaParam uintptr
FpUser uintptr
FxDelUser uintptr
-} /* sqlite3.c:11039:9 */
+} /* sqlite3.c:10402:9 */
// CAPI3REF: Flags for sqlite3_deserialize()
//
@@ -6542,7 +6584,7 @@ type sqlite3_rtree_geometry = struct {
//
//
-type Sqlite3_rtree_geometry = sqlite3_rtree_geometry /* sqlite3.c:11039:39 */
+type Sqlite3_rtree_geometry = sqlite3_rtree_geometry /* sqlite3.c:10402:39 */
type sqlite3_rtree_query_info = struct {
FpContext uintptr
FnParam int32
@@ -6561,13 +6603,13 @@ type sqlite3_rtree_query_info = struct {
FrScore Sqlite3_rtree_dbl
FapSqlParam uintptr
F__ccgo_pad1 [4]byte
-} /* sqlite3.c:11040:9 */
+} /* sqlite3.c:10403:9 */
-type Sqlite3_rtree_query_info = sqlite3_rtree_query_info /* sqlite3.c:11040:41 */
+type Sqlite3_rtree_query_info = sqlite3_rtree_query_info /* sqlite3.c:10403:41 */
// The double-precision datatype used by RTree depends on the
// SQLITE_RTREE_INT_ONLY compile-time option.
-type Sqlite3_rtree_dbl = float64 /* sqlite3.c:11048:18 */
+type Sqlite3_rtree_dbl = float64 /* sqlite3.c:10411:18 */
// Allowed values for sqlite3_rtree_query.eWithin and .eParentWithin.
@@ -6597,7 +6639,7 @@ type sqlite3_session = struct {
FpNext uintptr
FpTable uintptr
Fhook SessionHook
-} /* sqlite3.c:11155:9 */
+} /* sqlite3.c:10518:9 */
// Allowed values for sqlite3_rtree_query.eWithin and .eParentWithin.
@@ -6610,7 +6652,7 @@ type sqlite3_session = struct {
//
// An instance of this object is a [session] that can be used to
// record changes to a database.
-type Sqlite3_session = sqlite3_session /* sqlite3.c:11155:32 */
+type Sqlite3_session = sqlite3_session /* sqlite3.c:10518:32 */
// CAPI3REF: Changeset Iterator Handle
//
@@ -6630,13 +6672,13 @@ type sqlite3_changeset_iter = struct {
FbIndirect int32
FabPK uintptr
FapValue uintptr
-} /* sqlite3.c:11163:9 */
+} /* sqlite3.c:10526:9 */
// CAPI3REF: Changeset Iterator Handle
//
// An instance of this object acts as a cursor for iterating
// over the elements of a [changeset] or [patchset].
-type Sqlite3_changeset_iter = sqlite3_changeset_iter /* sqlite3.c:11163:39 */
+type Sqlite3_changeset_iter = sqlite3_changeset_iter /* sqlite3.c:10526:39 */
// CAPI3REF: Changegroup Handle
//
@@ -6646,13 +6688,13 @@ type sqlite3_changegroup = struct {
Frc int32
FbPatch int32
FpList uintptr
-} /* sqlite3.c:12015:9 */
+} /* sqlite3.c:11378:9 */
// CAPI3REF: Changegroup Handle
//
// A changegroup is an object used to combine two or more
// [changesets] or [patchsets]
-type Sqlite3_changegroup = sqlite3_changegroup /* sqlite3.c:12015:36 */
+type Sqlite3_changegroup = sqlite3_changegroup /* sqlite3.c:11378:36 */
// CAPI3REF: Flags for sqlite3changeset_apply_v2
//
@@ -6854,7 +6896,7 @@ type Sqlite3_changegroup = sqlite3_changegroup /* sqlite3.c:12015:36 */
// <li> The sqlite3_rebaser object is deleted by calling
// sqlite3rebaser_delete().
// </ol>
-type sqlite3_rebaser = struct{ Fgrp Sqlite3_changegroup } /* sqlite3.c:12579:9 */
+type sqlite3_rebaser = struct{ Fgrp Sqlite3_changegroup } /* sqlite3.c:11942:9 */
// CAPI3REF: Flags for sqlite3changeset_apply_v2
//
@@ -7056,7 +7098,7 @@ type sqlite3_rebaser = struct{ Fgrp Sqlite3_changegroup } /* sqlite3.c:12579:9 *
// <li> The sqlite3_rebaser object is deleted by calling
// sqlite3rebaser_delete().
// </ol>
-type Sqlite3_rebaser = sqlite3_rebaser /* sqlite3.c:12579:32 */
+type Sqlite3_rebaser = sqlite3_rebaser /* sqlite3.c:11942:32 */
// CAPI3REF: Values for sqlite3session_config().
@@ -7109,7 +7151,7 @@ type Fts5ExtensionApi1 = struct {
FxPhraseNext uintptr
FxPhraseFirstColumn uintptr
FxPhraseNextColumn uintptr
-} /* sqlite3.c:12895:9 */
+} /* sqlite3.c:12258:9 */
// CAPI3REF: Values for sqlite3session_config().
@@ -7141,22 +7183,22 @@ type Fts5ExtensionApi1 = struct {
// Virtual table implementations may overload SQL functions by implementing
// the sqlite3_module.xFindFunction() method.
-type Fts5ExtensionApi = Fts5ExtensionApi1 /* sqlite3.c:12895:33 */
+type Fts5ExtensionApi = Fts5ExtensionApi1 /* sqlite3.c:12258:33 */
type Fts5PhraseIter1 = struct {
Fa uintptr
Fb uintptr
-} /* sqlite3.c:12897:9 */
+} /* sqlite3.c:12260:9 */
-type Fts5PhraseIter = Fts5PhraseIter1 /* sqlite3.c:12897:31 */
+type Fts5PhraseIter = Fts5PhraseIter1 /* sqlite3.c:12260:31 */
-type Fts5_extension_function = uintptr /* sqlite3.c:12899:14 */
+type Fts5_extension_function = uintptr /* sqlite3.c:12262:14 */
type fts5_tokenizer = struct {
FxCreate uintptr
FxDelete uintptr
FxTokenize uintptr
-} /* sqlite3.c:13358:9 */
+} /* sqlite3.c:12721:9 */
-type Fts5_tokenizer = fts5_tokenizer /* sqlite3.c:13358:31 */
+type Fts5_tokenizer = fts5_tokenizer /* sqlite3.c:12721:31 */
// Flags that may be passed as the third argument to xTokenize()
@@ -7175,7 +7217,7 @@ type fts5_api = struct {
FxCreateTokenizer uintptr
FxFindTokenizer uintptr
FxCreateFunction uintptr
-} /* sqlite3.c:13394:9 */
+} /* sqlite3.c:12757:9 */
// Flags that may be passed as the third argument to xTokenize()
@@ -7189,7 +7231,7 @@ type fts5_api = struct {
// ************************************************************************
//
// FTS5 EXTENSION REGISTRATION API
-type Fts5_api = fts5_api /* sqlite3.c:13394:25 */
+type Fts5_api = fts5_api /* sqlite3.c:12757:25 */
//
// END OF REGISTRATION API
@@ -7419,7 +7461,6 @@ type Fts5_api = fts5_api /* sqlite3.c:13394:25 */
// is significant and used at least once. On switch statements
// where multiple cases go to the same block of code, testcase()
// can insure that all cases are evaluated.
-//
// The TESTONLY macro is used to enclose variable declarations or
// other bits of code that are needed to support the arguments
@@ -7432,6 +7473,9 @@ type Fts5_api = fts5_api /* sqlite3.c:13394:25 */
// "Verification, Validation, and Accreditation". In other words, the
// code within VVA_ONLY() will only run during verification processes.
+// Disable ALWAYS() and NEVER() (make them pass-throughs) for coverage
+// and mutation testing
+
// The ALWAYS and NEVER macros surround boolean expressions which
// are intended to always be true or false, respectively. Such
// expressions could be omitted from the code completely. But they
@@ -7446,19 +7490,6 @@ type Fts5_api = fts5_api /* sqlite3.c:13394:25 */
// be true and false so that the unreachable code they specify will
// not be counted as untested code.
-// The harmless(X) macro indicates that expression X is usually false
-// but can be true without causing any problems, but we don't know of
-// any way to cause X to be true.
-//
-// In debugging and testing builds, this macro will abort if X is ever
-// true. In this way, developers are alerted to a possible test case
-// that causes X to be true. If a harmless macro ever fails, that is
-// an opportunity to change the macro into a testcase() and add a new
-// test case to the test suite.
-//
-// For normal production builds, harmless(X) is a no-op, since it does
-// not matter whether expression X is true or false.
-
// Some conditionals are optimizations only. In other words, if the
// conditionals are replaced with a constant 1 (true) or 0 (false) then
// the correct answer is still obtained, though perhaps not as quickly.
@@ -7480,6 +7511,8 @@ type Fts5_api = fts5_api /* sqlite3.c:13394:25 */
// SQLITE_ENABLE_EXPLAIN_COMMENTS is incompatible with SQLITE_OMIT_EXPLAIN
+// SQLITE_OMIT_VIRTUALTABLE implies SQLITE_OMIT_ALTERTABLE
+
// Return true (non-zero) if the input is an integer that is too large
// to fit in 32-bits. This macro is used inside of various testcase()
// macros to verify that we have tested SQLite for large-file support.
@@ -7511,7 +7544,7 @@ type Hash1 = struct {
Fcount uint32
Ffirst uintptr
Fht uintptr
-} /* sqlite3.c:1331:9 */
+} /* sqlite3.c:578:9 */
//
// END OF REGISTRATION API
@@ -7741,7 +7774,6 @@ type Hash1 = struct {
// is significant and used at least once. On switch statements
// where multiple cases go to the same block of code, testcase()
// can insure that all cases are evaluated.
-//
// The TESTONLY macro is used to enclose variable declarations or
// other bits of code that are needed to support the arguments
@@ -7754,6 +7786,9 @@ type Hash1 = struct {
// "Verification, Validation, and Accreditation". In other words, the
// code within VVA_ONLY() will only run during verification processes.
+// Disable ALWAYS() and NEVER() (make them pass-throughs) for coverage
+// and mutation testing
+
// The ALWAYS and NEVER macros surround boolean expressions which
// are intended to always be true or false, respectively. Such
// expressions could be omitted from the code completely. But they
@@ -7768,19 +7803,6 @@ type Hash1 = struct {
// be true and false so that the unreachable code they specify will
// not be counted as untested code.
-// The harmless(X) macro indicates that expression X is usually false
-// but can be true without causing any problems, but we don't know of
-// any way to cause X to be true.
-//
-// In debugging and testing builds, this macro will abort if X is ever
-// true. In this way, developers are alerted to a possible test case
-// that causes X to be true. If a harmless macro ever fails, that is
-// an opportunity to change the macro into a testcase() and add a new
-// test case to the test suite.
-//
-// For normal production builds, harmless(X) is a no-op, since it does
-// not matter whether expression X is true or false.
-
// Some conditionals are optimizations only. In other words, if the
// conditionals are replaced with a constant 1 (true) or 0 (false) then
// the correct answer is still obtained, though perhaps not as quickly.
@@ -7802,6 +7824,8 @@ type Hash1 = struct {
// SQLITE_ENABLE_EXPLAIN_COMMENTS is incompatible with SQLITE_OMIT_EXPLAIN
+// SQLITE_OMIT_VIRTUALTABLE implies SQLITE_OMIT_ALTERTABLE
+
// Return true (non-zero) if the input is an integer that is too large
// to fit in 32-bits. This macro is used inside of various testcase()
// macros to verify that we have tested SQLite for large-file support.
@@ -7828,15 +7852,15 @@ type Hash1 = struct {
// used in SQLite.
// Forward declarations of structures.
-type Hash = Hash1 /* sqlite3.c:14070:21 */
+type Hash = Hash1 /* sqlite3.c:13430:21 */
type HashElem1 = struct {
Fnext uintptr
Fprev uintptr
Fdata uintptr
FpKey uintptr
-} /* sqlite3.c:1331:9 */
+} /* sqlite3.c:578:9 */
-type HashElem = HashElem1 /* sqlite3.c:14071:25 */
+type HashElem = HashElem1 /* sqlite3.c:13431:25 */
// A complete hash table is an instance of the following structure.
// The internals of this structure are intended to be opaque -- client
@@ -7861,7 +7885,7 @@ type HashElem = HashElem1 /* sqlite3.c:14071:25 */
type _ht = struct {
Fcount uint32
Fchain uintptr
-} /* sqlite3.c:1331:9 */
+} /* sqlite3.c:578:9 */
// Wide character type.
// Locale-writers should change this as necessary to
@@ -7871,14 +7895,9 @@ type _ht = struct {
// Define this type if we are doing the whole job,
// or if we want this type in particular.
-// In 4.3bsd-net2, leave these undefined to indicate that size_t, etc.
-// are already defined.
-// BSD/OS 3.1 and FreeBSD [23].x require the MACHINE_ANSI_H check here.
-// NetBSD 5 requires the I386_ANSI_H and X86_64_ANSI_H checks here.
-
// A null pointer constant.
-// Copyright (C) 1989-2018 Free Software Foundation, Inc.
+// Copyright (C) 1989-2020 Free Software Foundation, Inc.
//
// This file is part of GCC.
//
@@ -7904,7 +7923,7 @@ type _ht = struct {
// ISO C Standard: 7.15 Variable arguments <stdarg.h>
// bits/types.h -- definitions of __*_t types underlying *_t types.
-// Copyright (C) 2002-2018 Free Software Foundation, Inc.
+// Copyright (C) 2002-2020 Free Software Foundation, Inc.
// This file is part of the GNU C Library.
//
// The GNU C Library is free software; you can redistribute it and/or
@@ -7919,11 +7938,11 @@ type _ht = struct {
//
// You should have received a copy of the GNU Lesser General Public
// License along with the GNU C Library; if not, see
-// <http://www.gnu.org/licenses/>.
+// <https://www.gnu.org/licenses/>.
// Never include this file directly; use <sys/types.h> instead.
-// Copyright (C) 1991-2018 Free Software Foundation, Inc.
+// Copyright (C) 1991-2020 Free Software Foundation, Inc.
// This file is part of the GNU C Library.
//
// The GNU C Library is free software; you can redistribute it and/or
@@ -7938,9 +7957,9 @@ type _ht = struct {
//
// You should have received a copy of the GNU Lesser General Public
// License along with the GNU C Library; if not, see
-// <http://www.gnu.org/licenses/>.
+// <https://www.gnu.org/licenses/>.
-// Copyright (C) 1999-2018 Free Software Foundation, Inc.
+// Copyright (C) 1999-2020 Free Software Foundation, Inc.
// This file is part of the GNU C Library.
//
// The GNU C Library is free software; you can redistribute it and/or
@@ -7955,41 +7974,78 @@ type _ht = struct {
//
// You should have received a copy of the GNU Lesser General Public
// License along with the GNU C Library; if not, see
-// <http://www.gnu.org/licenses/>.
+// <https://www.gnu.org/licenses/>.
+
+// Bit size of the time_t type at glibc build time, general case.
+// Copyright (C) 2018-2020 Free Software Foundation, Inc.
+// This file is part of the GNU C Library.
+//
+// The GNU C Library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// The GNU C Library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with the GNU C Library; if not, see
+// <https://www.gnu.org/licenses/>.
+
+// Copyright (C) 1999-2020 Free Software Foundation, Inc.
+// This file is part of the GNU C Library.
+//
+// The GNU C Library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// The GNU C Library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with the GNU C Library; if not, see
+// <https://www.gnu.org/licenses/>.
+
+// Size in bits of the 'time_t' type of the default ABI.
// Convenience types.
-type X__u_char = uint8 /* types.h:30:23 */
-type X__u_short = uint16 /* types.h:31:28 */
-type X__u_int = uint32 /* types.h:32:22 */
-type X__u_long = uint32 /* types.h:33:27 */
+type X__u_char = uint8 /* types.h:31:23 */
+type X__u_short = uint16 /* types.h:32:28 */
+type X__u_int = uint32 /* types.h:33:22 */
+type X__u_long = uint32 /* types.h:34:27 */
// Fixed-size types, underlying types depend on word size and compiler.
-type X__int8_t = int8 /* types.h:36:21 */
-type X__uint8_t = uint8 /* types.h:37:23 */
-type X__int16_t = int16 /* types.h:38:26 */
-type X__uint16_t = uint16 /* types.h:39:28 */
-type X__int32_t = int32 /* types.h:40:20 */
-type X__uint32_t = uint32 /* types.h:41:22 */
-type X__int64_t = int64 /* types.h:46:44 */
-type X__uint64_t = uint64 /* types.h:47:46 */
+type X__int8_t = int8 /* types.h:37:21 */
+type X__uint8_t = uint8 /* types.h:38:23 */
+type X__int16_t = int16 /* types.h:39:26 */
+type X__uint16_t = uint16 /* types.h:40:28 */
+type X__int32_t = int32 /* types.h:41:20 */
+type X__uint32_t = uint32 /* types.h:42:22 */
+type X__int64_t = int64 /* types.h:47:44 */
+type X__uint64_t = uint64 /* types.h:48:46 */
// Smallest types with at least a given width.
-type X__int_least8_t = X__int8_t /* types.h:51:18 */
-type X__uint_least8_t = X__uint8_t /* types.h:52:19 */
-type X__int_least16_t = X__int16_t /* types.h:53:19 */
-type X__uint_least16_t = X__uint16_t /* types.h:54:20 */
-type X__int_least32_t = X__int32_t /* types.h:55:19 */
-type X__uint_least32_t = X__uint32_t /* types.h:56:20 */
-type X__int_least64_t = X__int64_t /* types.h:57:19 */
-type X__uint_least64_t = X__uint64_t /* types.h:58:20 */
+type X__int_least8_t = X__int8_t /* types.h:52:18 */
+type X__uint_least8_t = X__uint8_t /* types.h:53:19 */
+type X__int_least16_t = X__int16_t /* types.h:54:19 */
+type X__uint_least16_t = X__uint16_t /* types.h:55:20 */
+type X__int_least32_t = X__int32_t /* types.h:56:19 */
+type X__uint_least32_t = X__uint32_t /* types.h:57:20 */
+type X__int_least64_t = X__int64_t /* types.h:58:19 */
+type X__uint_least64_t = X__uint64_t /* types.h:59:20 */
// quad_t is also 64 bits.
-type X__quad_t = int64 /* types.h:65:37 */
-type X__u_quad_t = uint64 /* types.h:66:46 */
+type X__quad_t = int64 /* types.h:66:37 */
+type X__u_quad_t = uint64 /* types.h:67:46 */
// Largest integral types.
-type X__intmax_t = int64 /* types.h:74:37 */
-type X__uintmax_t = uint64 /* types.h:75:46 */
+type X__intmax_t = int64 /* types.h:75:37 */
+type X__uintmax_t = uint64 /* types.h:76:46 */
// The machine-dependent file <bits/typesizes.h> defines __*_T_TYPE
// macros for each of the OS types we define below. The definitions
@@ -8001,7 +8057,7 @@ type X__uintmax_t = uint64 /* types.h:75:46 */
// 32 -- "natural" 32-bit type (always int)
// 64 -- "natural" 64-bit type (long or long long)
// LONG32 -- 32-bit type, traditionally long
-// QUAD -- 64-bit type, always long long
+// QUAD -- 64-bit type, traditionally long long
// WORD -- natural type of __WORDSIZE bits (int or long)
// LONGWORD -- type of __WORDSIZE bits, traditionally long
//
@@ -8023,7 +8079,7 @@ type X__uintmax_t = uint64 /* types.h:75:46 */
// We want __extension__ before typedef's that use nonstandard base types
// such as `long long' in C89 mode.
// bits/typesizes.h -- underlying types for *_t. Generic version.
-// Copyright (C) 2002-2018 Free Software Foundation, Inc.
+// Copyright (C) 2002-2020 Free Software Foundation, Inc.
// This file is part of the GNU C Library.
//
// The GNU C Library is free software; you can redistribute it and/or
@@ -8038,86 +8094,113 @@ type X__uintmax_t = uint64 /* types.h:75:46 */
//
// You should have received a copy of the GNU Lesser General Public
// License along with the GNU C Library; if not, see
-// <http://www.gnu.org/licenses/>.
+// <https://www.gnu.org/licenses/>.
// See <bits/types.h> for the meaning of these macros. This file exists so
// that <bits/types.h> need not vary across different GNU platforms.
// Number of descriptors that can fit in an `fd_set'.
-type X__dev_t = X__u_quad_t /* types.h:143:25 */ // Type of device numbers.
-type X__uid_t = uint32 /* types.h:144:25 */ // Type of user identifications.
-type X__gid_t = uint32 /* types.h:145:25 */ // Type of group identifications.
-type X__ino_t = uint32 /* types.h:146:25 */ // Type of file serial numbers.
-type X__ino64_t = X__u_quad_t /* types.h:147:27 */ // Type of file serial numbers (LFS).
-type X__mode_t = uint32 /* types.h:148:26 */ // Type of file attribute bitmasks.
-type X__nlink_t = uint32 /* types.h:149:27 */ // Type of file link counts.
-type X__off_t = int32 /* types.h:150:25 */ // Type of file sizes and offsets.
-type X__off64_t = X__quad_t /* types.h:151:27 */ // Type of file sizes and offsets (LFS).
-type X__pid_t = int32 /* types.h:152:25 */ // Type of process identifications.
-type X__fsid_t = struct{ F__val [2]int32 } /* types.h:153:26 */ // Type of file system IDs.
-type X__clock_t = int32 /* types.h:154:27 */ // Type of CPU usage counts.
-type X__rlim_t = uint32 /* types.h:155:26 */ // Type for resource measurement.
-type X__rlim64_t = X__u_quad_t /* types.h:156:28 */ // Type for resource measurement (LFS).
-type X__id_t = uint32 /* types.h:157:24 */ // General type for IDs.
-type X__time_t = int32 /* types.h:158:26 */ // Seconds since the Epoch.
-type X__useconds_t = uint32 /* types.h:159:30 */ // Count of microseconds.
-type X__suseconds_t = int32 /* types.h:160:31 */ // Signed count of microseconds.
-
-type X__daddr_t = int32 /* types.h:162:27 */ // The type of a disk address.
-type X__key_t = int32 /* types.h:163:25 */ // Type of an IPC key.
+// bits/time64.h -- underlying types for __time64_t. Generic version.
+// Copyright (C) 2018-2020 Free Software Foundation, Inc.
+// This file is part of the GNU C Library.
+//
+// The GNU C Library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// The GNU C Library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with the GNU C Library; if not, see
+// <https://www.gnu.org/licenses/>.
+
+// Define __TIME64_T_TYPE so that it is always a 64-bit type.
+
+// Define a 64-bit time type alongsize the 32-bit one.
+
+type X__dev_t = X__uint64_t /* types.h:145:25 */ // Type of device numbers.
+type X__uid_t = uint32 /* types.h:146:25 */ // Type of user identifications.
+type X__gid_t = uint32 /* types.h:147:25 */ // Type of group identifications.
+type X__ino_t = uint32 /* types.h:148:25 */ // Type of file serial numbers.
+type X__ino64_t = X__uint64_t /* types.h:149:27 */ // Type of file serial numbers (LFS).
+type X__mode_t = uint32 /* types.h:150:26 */ // Type of file attribute bitmasks.
+type X__nlink_t = uint32 /* types.h:151:27 */ // Type of file link counts.
+type X__off_t = int32 /* types.h:152:25 */ // Type of file sizes and offsets.
+type X__off64_t = X__int64_t /* types.h:153:27 */ // Type of file sizes and offsets (LFS).
+type X__pid_t = int32 /* types.h:154:25 */ // Type of process identifications.
+type X__fsid_t = struct{ F__val [2]int32 } /* types.h:155:26 */ // Type of file system IDs.
+type X__clock_t = int32 /* types.h:156:27 */ // Type of CPU usage counts.
+type X__rlim_t = uint32 /* types.h:157:26 */ // Type for resource measurement.
+type X__rlim64_t = X__uint64_t /* types.h:158:28 */ // Type for resource measurement (LFS).
+type X__id_t = uint32 /* types.h:159:24 */ // General type for IDs.
+type X__time_t = int32 /* types.h:160:26 */ // Seconds since the Epoch.
+type X__useconds_t = uint32 /* types.h:161:30 */ // Count of microseconds.
+type X__suseconds_t = int32 /* types.h:162:31 */ // Signed count of microseconds.
+
+type X__daddr_t = int32 /* types.h:164:27 */ // The type of a disk address.
+type X__key_t = int32 /* types.h:165:25 */ // Type of an IPC key.
// Clock ID used in clock and timer functions.
-type X__clockid_t = int32 /* types.h:166:29 */
+type X__clockid_t = int32 /* types.h:168:29 */
// Timer ID returned by `timer_create'.
-type X__timer_t = uintptr /* types.h:169:12 */
+type X__timer_t = uintptr /* types.h:171:12 */
// Type to represent block size.
-type X__blksize_t = int32 /* types.h:172:29 */
+type X__blksize_t = int32 /* types.h:174:29 */
// Types from the Large File Support interface.
// Type to count number of disk blocks.
-type X__blkcnt_t = int32 /* types.h:177:28 */
-type X__blkcnt64_t = X__quad_t /* types.h:178:30 */
+type X__blkcnt_t = int32 /* types.h:179:28 */
+type X__blkcnt64_t = X__int64_t /* types.h:180:30 */
// Type to count file system blocks.
-type X__fsblkcnt_t = uint32 /* types.h:181:30 */
-type X__fsblkcnt64_t = X__u_quad_t /* types.h:182:32 */
+type X__fsblkcnt_t = uint32 /* types.h:183:30 */
+type X__fsblkcnt64_t = X__uint64_t /* types.h:184:32 */
// Type to count file system nodes.
-type X__fsfilcnt_t = uint32 /* types.h:185:30 */
-type X__fsfilcnt64_t = X__u_quad_t /* types.h:186:32 */
+type X__fsfilcnt_t = uint32 /* types.h:187:30 */
+type X__fsfilcnt64_t = X__uint64_t /* types.h:188:32 */
// Type of miscellaneous file system fields.
-type X__fsword_t = int32 /* types.h:189:28 */
+type X__fsword_t = int32 /* types.h:191:28 */
-type X__ssize_t = int32 /* types.h:191:27 */ // Type of a byte count, or error.
+type X__ssize_t = int32 /* types.h:193:27 */ // Type of a byte count, or error.
// Signed long type used in system calls.
-type X__syscall_slong_t = int32 /* types.h:194:33 */
+type X__syscall_slong_t = int32 /* types.h:196:33 */
// Unsigned long type used in system calls.
-type X__syscall_ulong_t = uint32 /* types.h:196:33 */
+type X__syscall_ulong_t = uint32 /* types.h:198:33 */
// These few don't really vary by system, they always correspond
// to one of the other defined types.
-type X__loff_t = X__off64_t /* types.h:200:19 */ // Type of file sizes and offsets (LFS).
-type X__caddr_t = uintptr /* types.h:201:14 */
+type X__loff_t = X__off64_t /* types.h:202:19 */ // Type of file sizes and offsets (LFS).
+type X__caddr_t = uintptr /* types.h:203:14 */
// Duplicates info from stdint.h but this is used in unistd.h.
-type X__intptr_t = int32 /* types.h:204:25 */
+type X__intptr_t = int32 /* types.h:206:25 */
// Duplicate info from sys/socket.h.
-type X__socklen_t = uint32 /* types.h:207:23 */
+type X__socklen_t = uint32 /* types.h:209:23 */
// C99: An integer type that can be accessed as an atomic entity,
// even in the presence of asynchronous interrupts.
// It is not currently necessary for this to be machine-specific.
-type X__sig_atomic_t = int32 /* types.h:212:13 */
+type X__sig_atomic_t = int32 /* types.h:214:13 */
+
+// Seconds since the Epoch, visible to user code when time_t is too
+// narrow only for consistency with the old way of widening too-narrow
+// types. User code should never use __time64_t.
+type X__time64_t = X__int64_t /* types.h:222:28 */
// bits/types.h -- definitions of __*_t types underlying *_t types.
-// Copyright (C) 2002-2018 Free Software Foundation, Inc.
+// Copyright (C) 2002-2020 Free Software Foundation, Inc.
// This file is part of the GNU C Library.
//
// The GNU C Library is free software; you can redistribute it and/or
@@ -8132,7 +8215,7 @@ type X__sig_atomic_t = int32 /* types.h:212:13 */
//
// You should have received a copy of the GNU Lesser General Public
// License along with the GNU C Library; if not, see
-// <http://www.gnu.org/licenses/>.
+// <https://www.gnu.org/licenses/>.
// Never include this file directly; use <sys/types.h> instead.
@@ -8161,7 +8244,7 @@ type _G_fpos_t = struct {
type X__fpos_t = _G_fpos_t /* __fpos_t.h:14:3 */
// bits/types.h -- definitions of __*_t types underlying *_t types.
-// Copyright (C) 2002-2018 Free Software Foundation, Inc.
+// Copyright (C) 2002-2020 Free Software Foundation, Inc.
// This file is part of the GNU C Library.
//
// The GNU C Library is free software; you can redistribute it and/or
@@ -8176,7 +8259,7 @@ type X__fpos_t = _G_fpos_t /* __fpos_t.h:14:3 */
//
// You should have received a copy of the GNU Lesser General Public
// License along with the GNU C Library; if not, see
-// <http://www.gnu.org/licenses/>.
+// <https://www.gnu.org/licenses/>.
// Never include this file directly; use <sys/types.h> instead.
@@ -8189,7 +8272,7 @@ type _G_fpos64_t = struct {
} /* __fpos64_t.h:10:9 */
// bits/types.h -- definitions of __*_t types underlying *_t types.
-// Copyright (C) 2002-2018 Free Software Foundation, Inc.
+// Copyright (C) 2002-2020 Free Software Foundation, Inc.
// This file is part of the GNU C Library.
//
// The GNU C Library is free software; you can redistribute it and/or
@@ -8204,7 +8287,7 @@ type _G_fpos64_t = struct {
//
// You should have received a copy of the GNU Lesser General Public
// License along with the GNU C Library; if not, see
-// <http://www.gnu.org/licenses/>.
+// <https://www.gnu.org/licenses/>.
// Never include this file directly; use <sys/types.h> instead.
@@ -8279,16 +8362,11 @@ type Ssize_t = X__ssize_t /* stdio.h:77:19 */
type Fpos_t = X__fpos64_t /* stdio.h:86:20 */
type Fpos64_t = X__fpos64_t /* stdio.h:89:20 */
-// In 4.3bsd-net2, leave these undefined to indicate that size_t, etc.
-// are already defined.
-// BSD/OS 3.1 and FreeBSD [23].x require the MACHINE_ANSI_H check here.
-// NetBSD 5 requires the I386_ANSI_H and X86_64_ANSI_H checks here.
-
// A null pointer constant.
// XPG requires a few symbols from <sys/wait.h> being defined.
// Definitions of flag bits for `waitpid' et al.
-// Copyright (C) 1992-2018 Free Software Foundation, Inc.
+// Copyright (C) 1992-2020 Free Software Foundation, Inc.
// This file is part of the GNU C Library.
//
// The GNU C Library is free software; you can redistribute it and/or
@@ -8303,7 +8381,7 @@ type Fpos64_t = X__fpos64_t /* stdio.h:89:20 */
//
// You should have received a copy of the GNU Lesser General Public
// License along with the GNU C Library; if not, see
-// <http://www.gnu.org/licenses/>.
+// <https://www.gnu.org/licenses/>.
// Bits in the third argument to `waitpid'.
@@ -8316,7 +8394,7 @@ type Fpos64_t = X__fpos64_t /* stdio.h:89:20 */
type Idtype_t = uint32 /* waitflags.h:57:3 */
// Definitions of status bits for `wait' et al.
-// Copyright (C) 1992-2018 Free Software Foundation, Inc.
+// Copyright (C) 1992-2020 Free Software Foundation, Inc.
// This file is part of the GNU C Library.
//
// The GNU C Library is free software; you can redistribute it and/or
@@ -8331,7 +8409,7 @@ type Idtype_t = uint32 /* waitflags.h:57:3 */
//
// You should have received a copy of the GNU Lesser General Public
// License along with the GNU C Library; if not, see
-// <http://www.gnu.org/licenses/>.
+// <https://www.gnu.org/licenses/>.
// Everything extant so far uses these same bits.
@@ -8358,7 +8436,7 @@ type Idtype_t = uint32 /* waitflags.h:57:3 */
// _FloatN API tests for enablement.
// Macros to control TS 18661-3 glibc features.
-// Copyright (C) 2017-2018 Free Software Foundation, Inc.
+// Copyright (C) 2017-2020 Free Software Foundation, Inc.
// This file is part of the GNU C Library.
//
// The GNU C Library is free software; you can redistribute it and/or
@@ -8373,7 +8451,7 @@ type Idtype_t = uint32 /* waitflags.h:57:3 */
//
// You should have received a copy of the GNU Lesser General Public
// License along with the GNU C Library; if not, see
-// <http://www.gnu.org/licenses/>.
+// <https://www.gnu.org/licenses/>.
// Defined to 1 if the current compiler invocation provides a
// floating-point type with the IEEE 754 binary128 format, and this glibc
@@ -8400,7 +8478,7 @@ type Idtype_t = uint32 /* waitflags.h:57:3 */
// Macros to control TS 18661-3 glibc features where the same
// definitions are appropriate for all platforms.
-// Copyright (C) 2017-2018 Free Software Foundation, Inc.
+// Copyright (C) 2017-2020 Free Software Foundation, Inc.
// This file is part of the GNU C Library.
//
// The GNU C Library is free software; you can redistribute it and/or
@@ -8415,9 +8493,9 @@ type Idtype_t = uint32 /* waitflags.h:57:3 */
//
// You should have received a copy of the GNU Lesser General Public
// License along with the GNU C Library; if not, see
-// <http://www.gnu.org/licenses/>.
+// <https://www.gnu.org/licenses/>.
-// Copyright (C) 1991-2018 Free Software Foundation, Inc.
+// Copyright (C) 1991-2020 Free Software Foundation, Inc.
// This file is part of the GNU C Library.
//
// The GNU C Library is free software; you can redistribute it and/or
@@ -8432,10 +8510,10 @@ type Idtype_t = uint32 /* waitflags.h:57:3 */
//
// You should have received a copy of the GNU Lesser General Public
// License along with the GNU C Library; if not, see
-// <http://www.gnu.org/licenses/>.
+// <https://www.gnu.org/licenses/>.
// Properties of long double type.
-// Copyright (C) 2016-2018 Free Software Foundation, Inc.
+// Copyright (C) 2016-2020 Free Software Foundation, Inc.
// This file is part of the GNU C Library.
//
// The GNU C Library is free software; you can redistribute it and/or
@@ -8450,7 +8528,7 @@ type Idtype_t = uint32 /* waitflags.h:57:3 */
//
// You should have received a copy of the GNU Lesser General Public
// License along with the GNU C Library; if not, see
-// <http://www.gnu.org/licenses/>.
+// <https://www.gnu.org/licenses/>.
// This header is included by <sys/cdefs.h>.
//
@@ -8539,7 +8617,7 @@ type Lldiv_t = struct {
// use as an additional parameter. These are GNU extensions inspired
// by the POSIX.1-2008 extended locale API.
// Definition of locale_t.
-// Copyright (C) 2017-2018 Free Software Foundation, Inc.
+// Copyright (C) 2017-2020 Free Software Foundation, Inc.
// This file is part of the GNU C Library.
//
// The GNU C Library is free software; you can redistribute it and/or
@@ -8554,10 +8632,10 @@ type Lldiv_t = struct {
//
// You should have received a copy of the GNU Lesser General Public
// License along with the GNU C Library; if not, see
-// <http://www.gnu.org/licenses/>.
+// <https://www.gnu.org/licenses/>.
// Definition of struct __locale_struct and __locale_t.
-// Copyright (C) 1997-2018 Free Software Foundation, Inc.
+// Copyright (C) 1997-2020 Free Software Foundation, Inc.
// This file is part of the GNU C Library.
// Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
//
@@ -8573,7 +8651,7 @@ type Lldiv_t = struct {
//
// You should have received a copy of the GNU Lesser General Public
// License along with the GNU C Library; if not, see
-// <http://www.gnu.org/licenses/>.
+// <https://www.gnu.org/licenses/>.
// POSIX.1-2008: the locale_t type, representing a locale context
// (implementation-namespace version). This type should be treated
@@ -8592,7 +8670,7 @@ type X__locale_t = uintptr /* __locale_t.h:42:32 */
type Locale_t = X__locale_t /* locale_t.h:24:20 */
-// Copyright (C) 1991-2018 Free Software Foundation, Inc.
+// Copyright (C) 1991-2020 Free Software Foundation, Inc.
// This file is part of the GNU C Library.
//
// The GNU C Library is free software; you can redistribute it and/or
@@ -8607,11 +8685,11 @@ type Locale_t = X__locale_t /* locale_t.h:24:20 */
//
// You should have received a copy of the GNU Lesser General Public
// License along with the GNU C Library; if not, see
-// <http://www.gnu.org/licenses/>.
+// <https://www.gnu.org/licenses/>.
// POSIX Standard: 2.6 Primitive System Data Types <sys/types.h>
-// Copyright (C) 1991-2018 Free Software Foundation, Inc.
+// Copyright (C) 1991-2020 Free Software Foundation, Inc.
// This file is part of the GNU C Library.
//
// The GNU C Library is free software; you can redistribute it and/or
@@ -8626,10 +8704,10 @@ type Locale_t = X__locale_t /* locale_t.h:24:20 */
//
// You should have received a copy of the GNU Lesser General Public
// License along with the GNU C Library; if not, see
-// <http://www.gnu.org/licenses/>.
+// <https://www.gnu.org/licenses/>.
// bits/types.h -- definitions of __*_t types underlying *_t types.
-// Copyright (C) 2002-2018 Free Software Foundation, Inc.
+// Copyright (C) 2002-2020 Free Software Foundation, Inc.
// This file is part of the GNU C Library.
//
// The GNU C Library is free software; you can redistribute it and/or
@@ -8644,7 +8722,7 @@ type Locale_t = X__locale_t /* locale_t.h:24:20 */
//
// You should have received a copy of the GNU Lesser General Public
// License along with the GNU C Library; if not, see
-// <http://www.gnu.org/licenses/>.
+// <https://www.gnu.org/licenses/>.
// Never include this file directly; use <sys/types.h> instead.
@@ -8680,7 +8758,7 @@ type Caddr_t = X__caddr_t /* types.h:115:19 */
type Key_t = X__key_t /* types.h:121:17 */
// bits/types.h -- definitions of __*_t types underlying *_t types.
-// Copyright (C) 2002-2018 Free Software Foundation, Inc.
+// Copyright (C) 2002-2020 Free Software Foundation, Inc.
// This file is part of the GNU C Library.
//
// The GNU C Library is free software; you can redistribute it and/or
@@ -8695,7 +8773,7 @@ type Key_t = X__key_t /* types.h:121:17 */
//
// You should have received a copy of the GNU Lesser General Public
// License along with the GNU C Library; if not, see
-// <http://www.gnu.org/licenses/>.
+// <https://www.gnu.org/licenses/>.
// Never include this file directly; use <sys/types.h> instead.
@@ -8703,7 +8781,7 @@ type Key_t = X__key_t /* types.h:121:17 */
type Clock_t = X__clock_t /* clock_t.h:7:19 */
// bits/types.h -- definitions of __*_t types underlying *_t types.
-// Copyright (C) 2002-2018 Free Software Foundation, Inc.
+// Copyright (C) 2002-2020 Free Software Foundation, Inc.
// This file is part of the GNU C Library.
//
// The GNU C Library is free software; you can redistribute it and/or
@@ -8718,7 +8796,7 @@ type Clock_t = X__clock_t /* clock_t.h:7:19 */
//
// You should have received a copy of the GNU Lesser General Public
// License along with the GNU C Library; if not, see
-// <http://www.gnu.org/licenses/>.
+// <https://www.gnu.org/licenses/>.
// Never include this file directly; use <sys/types.h> instead.
@@ -8726,7 +8804,7 @@ type Clock_t = X__clock_t /* clock_t.h:7:19 */
type Clockid_t = X__clockid_t /* clockid_t.h:7:21 */
// bits/types.h -- definitions of __*_t types underlying *_t types.
-// Copyright (C) 2002-2018 Free Software Foundation, Inc.
+// Copyright (C) 2002-2020 Free Software Foundation, Inc.
// This file is part of the GNU C Library.
//
// The GNU C Library is free software; you can redistribute it and/or
@@ -8741,7 +8819,7 @@ type Clockid_t = X__clockid_t /* clockid_t.h:7:21 */
//
// You should have received a copy of the GNU Lesser General Public
// License along with the GNU C Library; if not, see
-// <http://www.gnu.org/licenses/>.
+// <https://www.gnu.org/licenses/>.
// Never include this file directly; use <sys/types.h> instead.
@@ -8749,7 +8827,7 @@ type Clockid_t = X__clockid_t /* clockid_t.h:7:21 */
type Time_t = X__time_t /* time_t.h:7:18 */
// bits/types.h -- definitions of __*_t types underlying *_t types.
-// Copyright (C) 2002-2018 Free Software Foundation, Inc.
+// Copyright (C) 2002-2020 Free Software Foundation, Inc.
// This file is part of the GNU C Library.
//
// The GNU C Library is free software; you can redistribute it and/or
@@ -8764,7 +8842,7 @@ type Time_t = X__time_t /* time_t.h:7:18 */
//
// You should have received a copy of the GNU Lesser General Public
// License along with the GNU C Library; if not, see
-// <http://www.gnu.org/licenses/>.
+// <https://www.gnu.org/licenses/>.
// Never include this file directly; use <sys/types.h> instead.
@@ -8774,7 +8852,7 @@ type Timer_t = X__timer_t /* timer_t.h:7:19 */
type Useconds_t = X__useconds_t /* types.h:134:22 */
type Suseconds_t = X__suseconds_t /* types.h:138:23 */
-// Copyright (C) 1989-2018 Free Software Foundation, Inc.
+// Copyright (C) 1989-2020 Free Software Foundation, Inc.
//
// This file is part of GCC.
//
@@ -8806,15 +8884,6 @@ type Suseconds_t = X__suseconds_t /* types.h:138:23 */
// This avoids lossage on SunOS but only if stdtypes.h comes first.
// There's no way to win with the other order! Sun lossage.
-// On 4.3bsd-net2, make sure ansi.h is included, so we have
-// one less case to deal with in the following.
-// On FreeBSD 5, machine/ansi.h does not exist anymore...
-
-// In 4.3bsd-net2, machine/ansi.h defines these symbols, which are
-// defined if the corresponding type is *not* defined.
-// FreeBSD-2.1 defines _MACHINE_ANSI_H_ instead of _ANSI_H_.
-// NetBSD defines _I386_ANSI_H_ and _X86_64_ANSI_H_ instead of _ANSI_H_
-
// Sequent's header files use _PTRDIFF_T_ in some conflicting way.
// Just ignore it.
@@ -8849,11 +8918,6 @@ type Suseconds_t = X__suseconds_t /* types.h:138:23 */
// Define this type if we are doing the whole job,
// or if we want this type in particular.
-// In 4.3bsd-net2, leave these undefined to indicate that size_t, etc.
-// are already defined.
-// BSD/OS 3.1 and FreeBSD [23].x require the MACHINE_ANSI_H check here.
-// NetBSD 5 requires the I386_ANSI_H and X86_64_ANSI_H checks here.
-
// A null pointer constant.
// Old compatibility names for C types.
@@ -8864,7 +8928,7 @@ type Uint = uint32 /* types.h:150:22 */
// These size-specific names are used by some of the inet code.
// Define intN_t types.
-// Copyright (C) 2017-2018 Free Software Foundation, Inc.
+// Copyright (C) 2017-2020 Free Software Foundation, Inc.
// This file is part of the GNU C Library.
//
// The GNU C Library is free software; you can redistribute it and/or
@@ -8879,10 +8943,10 @@ type Uint = uint32 /* types.h:150:22 */
//
// You should have received a copy of the GNU Lesser General Public
// License along with the GNU C Library; if not, see
-// <http://www.gnu.org/licenses/>.
+// <https://www.gnu.org/licenses/>.
// bits/types.h -- definitions of __*_t types underlying *_t types.
-// Copyright (C) 2002-2018 Free Software Foundation, Inc.
+// Copyright (C) 2002-2020 Free Software Foundation, Inc.
// This file is part of the GNU C Library.
//
// The GNU C Library is free software; you can redistribute it and/or
@@ -8897,7 +8961,7 @@ type Uint = uint32 /* types.h:150:22 */
//
// You should have received a copy of the GNU Lesser General Public
// License along with the GNU C Library; if not, see
-// <http://www.gnu.org/licenses/>.
+// <https://www.gnu.org/licenses/>.
// Never include this file directly; use <sys/types.h> instead.
@@ -8906,18 +8970,17 @@ type Int16_t = X__int16_t /* stdint-intn.h:25:19 */
type Int32_t = X__int32_t /* stdint-intn.h:26:19 */
type Int64_t = X__int64_t /* stdint-intn.h:27:19 */
-// For GCC 2.7 and later, we can use specific type-size attributes.
+// These were defined by ISO C without the first `_'.
+type U_int8_t = X__uint8_t /* types.h:158:19 */
+type U_int16_t = X__uint16_t /* types.h:159:20 */
+type U_int32_t = X__uint32_t /* types.h:160:20 */
+type U_int64_t = X__uint64_t /* types.h:161:20 */
-type U_int8_t = uint32 /* types.h:177:1 */
-type U_int16_t = uint32 /* types.h:178:1 */
-type U_int32_t = uint32 /* types.h:179:1 */
-type U_int64_t = uint32 /* types.h:180:1 */
-
-type Register_t = int32 /* types.h:182:13 */
+type Register_t = int32 /* types.h:164:13 */
// It also defines `fd_set' and the FD_* macros for `select'.
// `fd_set' type and related macros, and `select'/`pselect' declarations.
-// Copyright (C) 1996-2018 Free Software Foundation, Inc.
+// Copyright (C) 1996-2020 Free Software Foundation, Inc.
// This file is part of the GNU C Library.
//
// The GNU C Library is free software; you can redistribute it and/or
@@ -8932,11 +8995,11 @@ type Register_t = int32 /* types.h:182:13 */
//
// You should have received a copy of the GNU Lesser General Public
// License along with the GNU C Library; if not, see
-// <http://www.gnu.org/licenses/>.
+// <https://www.gnu.org/licenses/>.
// POSIX 1003.1g: 6.2 Select from File Descriptor Sets <sys/select.h>
-// Copyright (C) 1991-2018 Free Software Foundation, Inc.
+// Copyright (C) 1991-2020 Free Software Foundation, Inc.
// This file is part of the GNU C Library.
//
// The GNU C Library is free software; you can redistribute it and/or
@@ -8951,11 +9014,11 @@ type Register_t = int32 /* types.h:182:13 */
//
// You should have received a copy of the GNU Lesser General Public
// License along with the GNU C Library; if not, see
-// <http://www.gnu.org/licenses/>.
+// <https://www.gnu.org/licenses/>.
// Get definition of needed basic types.
// bits/types.h -- definitions of __*_t types underlying *_t types.
-// Copyright (C) 2002-2018 Free Software Foundation, Inc.
+// Copyright (C) 2002-2020 Free Software Foundation, Inc.
// This file is part of the GNU C Library.
//
// The GNU C Library is free software; you can redistribute it and/or
@@ -8970,12 +9033,12 @@ type Register_t = int32 /* types.h:182:13 */
//
// You should have received a copy of the GNU Lesser General Public
// License along with the GNU C Library; if not, see
-// <http://www.gnu.org/licenses/>.
+// <https://www.gnu.org/licenses/>.
// Never include this file directly; use <sys/types.h> instead.
// Get __FD_* definitions.
-// Copyright (C) 1997-2018 Free Software Foundation, Inc.
+// Copyright (C) 1997-2020 Free Software Foundation, Inc.
// This file is part of the GNU C Library.
//
// The GNU C Library is free software; you can redistribute it and/or
@@ -8990,7 +9053,7 @@ type Register_t = int32 /* types.h:182:13 */
//
// You should have received a copy of the GNU Lesser General Public
// License along with the GNU C Library; if not, see
-// <http://www.gnu.org/licenses/>.
+// <https://www.gnu.org/licenses/>.
// We don't use `memset' because this would require a prototype and
// the array isn't too big.
@@ -9005,7 +9068,7 @@ type Sigset_t = X__sigset_t /* sigset_t.h:7:20 */
// Get definition of timer specification structures.
// bits/types.h -- definitions of __*_t types underlying *_t types.
-// Copyright (C) 2002-2018 Free Software Foundation, Inc.
+// Copyright (C) 2002-2020 Free Software Foundation, Inc.
// This file is part of the GNU C Library.
//
// The GNU C Library is free software; you can redistribute it and/or
@@ -9020,7 +9083,7 @@ type Sigset_t = X__sigset_t /* sigset_t.h:7:20 */
//
// You should have received a copy of the GNU Lesser General Public
// License along with the GNU C Library; if not, see
-// <http://www.gnu.org/licenses/>.
+// <https://www.gnu.org/licenses/>.
// Never include this file directly; use <sys/types.h> instead.
@@ -9034,7 +9097,7 @@ type timeval = struct {
// NB: Include guard matches what <linux/time.h> uses.
// bits/types.h -- definitions of __*_t types underlying *_t types.
-// Copyright (C) 2002-2018 Free Software Foundation, Inc.
+// Copyright (C) 2002-2020 Free Software Foundation, Inc.
// This file is part of the GNU C Library.
//
// The GNU C Library is free software; you can redistribute it and/or
@@ -9049,16 +9112,34 @@ type timeval = struct {
//
// You should have received a copy of the GNU Lesser General Public
// License along with the GNU C Library; if not, see
-// <http://www.gnu.org/licenses/>.
+// <https://www.gnu.org/licenses/>.
// Never include this file directly; use <sys/types.h> instead.
+// Endian macros for string.h functions
+// Copyright (C) 1992-2020 Free Software Foundation, Inc.
+// This file is part of the GNU C Library.
+//
+// The GNU C Library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// The GNU C Library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with the GNU C Library; if not, see
+// <http://www.gnu.org/licenses/>.
+
// POSIX.1b structure for a time value. This is like a `struct timeval' but
// has nanoseconds instead of microseconds.
type timespec = struct {
Ftv_sec X__time_t
Ftv_nsec X__syscall_slong_t
-} /* struct_timespec.h:9:1 */
+} /* struct_timespec.h:10:1 */
// The fd_set member is required to be an array of longs.
type X__fd_mask = int32 /* select.h:49:18 */
@@ -9076,20 +9157,20 @@ type Fd_mask = X__fd_mask /* select.h:77:19 */
// Define some inlines helping to catch common problems.
-type Blksize_t = X__blksize_t /* types.h:202:21 */
+type Blksize_t = X__blksize_t /* types.h:185:21 */
// Types from the Large File Support interface.
-type Blkcnt_t = X__blkcnt64_t /* types.h:222:22 */ // Type to count number of disk blocks.
-type Fsblkcnt_t = X__fsblkcnt64_t /* types.h:226:24 */ // Type to count file system blocks.
-type Fsfilcnt_t = X__fsfilcnt64_t /* types.h:230:24 */ // Type to count file system inodes.
+type Blkcnt_t = X__blkcnt64_t /* types.h:205:22 */ // Type to count number of disk blocks.
+type Fsblkcnt_t = X__fsblkcnt64_t /* types.h:209:24 */ // Type to count file system blocks.
+type Fsfilcnt_t = X__fsfilcnt64_t /* types.h:213:24 */ // Type to count file system inodes.
-type Blkcnt64_t = X__blkcnt64_t /* types.h:236:22 */ // Type to count number of disk blocks.
-type Fsblkcnt64_t = X__fsblkcnt64_t /* types.h:237:24 */ // Type to count file system blocks.
-type Fsfilcnt64_t = X__fsfilcnt64_t /* types.h:238:24 */ // Type to count file system inodes.
+type Blkcnt64_t = X__blkcnt64_t /* types.h:219:22 */ // Type to count number of disk blocks.
+type Fsblkcnt64_t = X__fsblkcnt64_t /* types.h:220:24 */ // Type to count file system blocks.
+type Fsfilcnt64_t = X__fsfilcnt64_t /* types.h:221:24 */ // Type to count file system inodes.
// Now add the thread types.
// Declaration of common pthread types for all architectures.
-// Copyright (C) 2017-2018 Free Software Foundation, Inc.
+// Copyright (C) 2017-2020 Free Software Foundation, Inc.
// This file is part of the GNU C Library.
//
// The GNU C Library is free software; you can redistribute it and/or
@@ -9104,11 +9185,11 @@ type Fsfilcnt64_t = X__fsfilcnt64_t /* types.h:238:24 */ // Type to count file s
//
// You should have received a copy of the GNU Lesser General Public
// License along with the GNU C Library; if not, see
-// <http://www.gnu.org/licenses/>.
+// <https://www.gnu.org/licenses/>.
// For internal mutex and condition variable definitions.
// Common threading primitives definitions for both POSIX and C11.
-// Copyright (C) 2017-2018 Free Software Foundation, Inc.
+// Copyright (C) 2017-2020 Free Software Foundation, Inc.
// This file is part of the GNU C Library.
//
// The GNU C Library is free software; you can redistribute it and/or
@@ -9123,7 +9204,7 @@ type Fsfilcnt64_t = X__fsfilcnt64_t /* types.h:238:24 */ // Type to count file s
//
// You should have received a copy of the GNU Lesser General Public
// License along with the GNU C Library; if not, see
-// <http://www.gnu.org/licenses/>.
+// <https://www.gnu.org/licenses/>.
// Arch-specific definitions. Each architecture must define the following
// macros to define the expected sizes of pthread data types:
@@ -9138,35 +9219,110 @@ type Fsfilcnt64_t = X__fsfilcnt64_t /* types.h:238:24 */ // Type to count file s
// __SIZEOF_PTHREAD_BARRIER_T - size of pthread_barrier_t.
// __SIZEOF_PTHREAD_BARRIERATTR_T - size of pthread_barrierattr_t.
//
-// Also, the following macros must be define for internal pthread_mutex_t
-// struct definitions (struct __pthread_mutex_s):
-//
-// __PTHREAD_COMPAT_PADDING_MID - any additional members after 'kind'
-// and before '__spin' (for 64 bits) or
-// '__nusers' (for 32 bits).
-// __PTHREAD_COMPAT_PADDING_END - any additional members at the end of
-// the internal structure.
-// __PTHREAD_MUTEX_LOCK_ELISION - 1 if the architecture supports lock
-// elision or 0 otherwise.
-// __PTHREAD_MUTEX_NUSERS_AFTER_KIND - control where to put __nusers. The
-// preferred value for new architectures
-// is 0.
-// __PTHREAD_MUTEX_USE_UNION - control whether internal __spins and
-// __list will be place inside a union for
-// linuxthreads compatibility.
-// The preferred value for new architectures
-// is 0.
-//
-// For a new port the preferred values for the required defines are:
-//
-// #define __PTHREAD_COMPAT_PADDING_MID
-// #define __PTHREAD_COMPAT_PADDING_END
-// #define __PTHREAD_MUTEX_LOCK_ELISION 0
-// #define __PTHREAD_MUTEX_NUSERS_AFTER_KIND 0
-// #define __PTHREAD_MUTEX_USE_UNION 0
-//
-// __PTHREAD_MUTEX_LOCK_ELISION can be set to 1 if the hardware plans to
-// eventually support lock elision using transactional memory.
+// The additional macro defines any constraint for the lock alignment
+// inside the thread structures:
+//
+// __LOCK_ALIGNMENT - for internal lock/futex usage.
+//
+// Same idea but for the once locking primitive:
+//
+// __ONCE_ALIGNMENT - for pthread_once_t/once_flag definition.
+
+// Machine-specific pthread type layouts. Generic version.
+// Copyright (C) 2019-2020 Free Software Foundation, Inc.
+//
+// This file is part of the GNU C Library.
+//
+// The GNU C Library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// The GNU C Library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with the GNU C Library; if not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 1999-2020 Free Software Foundation, Inc.
+// This file is part of the GNU C Library.
+//
+// The GNU C Library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// The GNU C Library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with the GNU C Library; if not, see
+// <https://www.gnu.org/licenses/>.
+
+// Common definition of pthread_mutex_t.
+
+type __pthread_internal_list = struct {
+ F__prev uintptr
+ F__next uintptr
+} /* thread-shared-types.h:49:9 */
+
+// Type to count file system inodes.
+
+// Now add the thread types.
+// Declaration of common pthread types for all architectures.
+// Copyright (C) 2017-2020 Free Software Foundation, Inc.
+// This file is part of the GNU C Library.
+//
+// The GNU C Library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// The GNU C Library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with the GNU C Library; if not, see
+// <https://www.gnu.org/licenses/>.
+
+// For internal mutex and condition variable definitions.
+// Common threading primitives definitions for both POSIX and C11.
+// Copyright (C) 2017-2020 Free Software Foundation, Inc.
+// This file is part of the GNU C Library.
+//
+// The GNU C Library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// The GNU C Library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with the GNU C Library; if not, see
+// <https://www.gnu.org/licenses/>.
+
+// Arch-specific definitions. Each architecture must define the following
+// macros to define the expected sizes of pthread data types:
+//
+// __SIZEOF_PTHREAD_ATTR_T - size of pthread_attr_t.
+// __SIZEOF_PTHREAD_MUTEX_T - size of pthread_mutex_t.
+// __SIZEOF_PTHREAD_MUTEXATTR_T - size of pthread_mutexattr_t.
+// __SIZEOF_PTHREAD_COND_T - size of pthread_cond_t.
+// __SIZEOF_PTHREAD_CONDATTR_T - size of pthread_condattr_t.
+// __SIZEOF_PTHREAD_RWLOCK_T - size of pthread_rwlock_t.
+// __SIZEOF_PTHREAD_RWLOCKATTR_T - size of pthread_rwlockattr_t.
+// __SIZEOF_PTHREAD_BARRIER_T - size of pthread_barrier_t.
+// __SIZEOF_PTHREAD_BARRIERATTR_T - size of pthread_barrierattr_t.
//
// The additional macro defines any constraint for the lock alignment
// inside the thread structures:
@@ -9176,11 +9332,27 @@ type Fsfilcnt64_t = X__fsfilcnt64_t /* types.h:238:24 */ // Type to count file s
// Same idea but for the once locking primitive:
//
// __ONCE_ALIGNMENT - for pthread_once_t/once_flag definition.
+
+// Machine-specific pthread type layouts. Generic version.
+// Copyright (C) 2019-2020 Free Software Foundation, Inc.
+//
+// This file is part of the GNU C Library.
+//
+// The GNU C Library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
//
-// And finally the internal pthread_rwlock_t (struct __pthread_rwlock_arch_t)
-// must be defined.
+// The GNU C Library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// Copyright (C) 2002-2018 Free Software Foundation, Inc.
+// You should have received a copy of the GNU Lesser General Public
+// License along with the GNU C Library; if not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 1999-2020 Free Software Foundation, Inc.
// This file is part of the GNU C Library.
//
// The GNU C Library is free software; you can redistribute it and/or
@@ -9194,10 +9366,94 @@ type Fsfilcnt64_t = X__fsfilcnt64_t /* types.h:238:24 */ // Type to count file s
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
-// License along with the GNU C Library. If not, see
+// License along with the GNU C Library; if not, see
+// <https://www.gnu.org/licenses/>.
+
+// Common definition of pthread_mutex_t.
+
+type X__pthread_list_t = __pthread_internal_list /* thread-shared-types.h:53:3 */
+
+type __pthread_internal_slist = struct{ F__next uintptr } /* thread-shared-types.h:55:9 */
+
+type X__pthread_slist_t = __pthread_internal_slist /* thread-shared-types.h:58:3 */
+
+// Arch-specific mutex definitions. A generic implementation is provided
+// by sysdeps/nptl/bits/struct_mutex.h. If required, an architecture
+// can override it by defining:
+//
+// 1. struct __pthread_mutex_s (used on both pthread_mutex_t and mtx_t
+// definition). It should contains at least the internal members
+// defined in the generic version.
+//
+// 2. __LOCK_ALIGNMENT for any extra attribute for internal lock used with
+// atomic operations.
+//
+// 3. The macro __PTHREAD_MUTEX_INITIALIZER used for static initialization.
+// It should initialize the mutex internal flag.
+
+// Default mutex implementation struct definitions.
+// Copyright (C) 2019-2020 Free Software Foundation, Inc.
+// This file is part of the GNU C Library.
+//
+// The GNU C Library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// The GNU C Library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with the GNU C Library; if not, see
+// <http://www.gnu.org/licenses/>.
+
+// Generic struct for both POSIX and C11 mutexes. New ports are expected
+// to use the default layout, however architecture can redefine it to
+// add arch-specific extension (such as lock-elision). The struct have
+// a size of 32 bytes on LP32 and 40 bytes on LP64 architectures.
+
+type __pthread_mutex_s = struct {
+ F__lock int32
+ F__count uint32
+ F__owner int32
+ F__kind int32
+ F__nusers uint32
+ F__20 struct{ F__spins int32 }
+} /* struct_mutex.h:27:1 */
+
+// Arch-sepecific read-write lock definitions. A generic implementation is
+// provided by struct_rwlock.h. If required, an architecture can override it
+// by defining:
+//
+// 1. struct __pthread_rwlock_arch_t (used on pthread_rwlock_t definition).
+// It should contain at least the internal members defined in the
+// generic version.
+//
+// 2. The macro __PTHREAD_RWLOCK_INITIALIZER used for static initialization.
+// It should initialize the rwlock internal type.
+
+// Default read-write lock implementation struct definitions.
+// Copyright (C) 2019-2020 Free Software Foundation, Inc.
+// This file is part of the GNU C Library.
+//
+// The GNU C Library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// The GNU C Library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with the GNU C Library; if not, see
// <http://www.gnu.org/licenses/>.
-// Copyright (C) 1992-2018 Free Software Foundation, Inc.
+// Endian macros for string.h functions
+// Copyright (C) 1992-2020 Free Software Foundation, Inc.
// This file is part of the GNU C Library.
//
// The GNU C Library is free software; you can redistribute it and/or
@@ -9214,7 +9470,10 @@ type Fsfilcnt64_t = X__fsfilcnt64_t /* types.h:238:24 */ // Type to count file s
// License along with the GNU C Library; if not, see
// <http://www.gnu.org/licenses/>.
-// Data structure for mutex handling.
+// Generic struct for both POSIX read-write lock. New ports are expected
+// to use the default layout, however archictetures can redefine it to add
+// arch-specific extensions (such as lock-elision). The struct have a size
+// of 32 bytes on both LP32 and LP64 architectures.
type __pthread_rwlock_arch_t = struct {
F__readers uint32
@@ -9228,27 +9487,7 @@ type __pthread_rwlock_arch_t = struct {
F__pad1 uint8
F__pad2 uint8
F__cur_writer int32
-} /* pthreadtypes-arch.h:43:1 */
-
-// Common definition of pthread_mutex_t.
-
-type __pthread_internal_slist = struct{ F__next uintptr } /* thread-shared-types.h:88:9 */
-
-// Common definition of pthread_mutex_t.
-
-type X__pthread_slist_t = __pthread_internal_slist /* thread-shared-types.h:91:3 */
-
-// Lock elision support.
-// Mutex __spins initializer used by PTHREAD_MUTEX_INITIALIZER.
-
-type __pthread_mutex_s = struct {
- F__lock int32
- F__count uint32
- F__owner int32
- F__kind int32
- F__nusers uint32
- F__20 struct{ F__spins int32 }
-} /* thread-shared-types.h:118:1 */
+} /* struct_rwlock.h:29:1 */
// Common definition of pthread_cond_t.
@@ -9260,7 +9499,7 @@ type __pthread_cond_s = struct {
F__g1_orig_size uint32
F__wrefs uint32
F__g_signals [2]uint32
-} /* thread-shared-types.h:171:1 */
+} /* thread-shared-types.h:92:1 */
// Thread identifiers. The structure of the attribute type is not
// exposed on purpose.
@@ -9347,10 +9586,10 @@ type drand48_data = struct {
} /* stdlib.h:490:1 */
// Shorthand for type of comparison functions.
-type X__compar_fn_t = uintptr /* stdlib.h:805:13 */
+type X__compar_fn_t = uintptr /* stdlib.h:808:13 */
-type Comparison_fn_t = X__compar_fn_t /* stdlib.h:808:23 */
-type X__compar_d_fn_t = uintptr /* stdlib.h:812:13 */
+type Comparison_fn_t = X__compar_fn_t /* stdlib.h:811:23 */
+type X__compar_d_fn_t = uintptr /* stdlib.h:815:13 */
// If this symbol has done its job, get rid of it.
@@ -9367,11 +9606,6 @@ type X__compar_d_fn_t = uintptr /* stdlib.h:812:13 */
// Define this type if we are doing the whole job,
// or if we want this type in particular.
-// In 4.3bsd-net2, leave these undefined to indicate that size_t, etc.
-// are already defined.
-// BSD/OS 3.1 and FreeBSD [23].x require the MACHINE_ANSI_H check here.
-// NetBSD 5 requires the I386_ANSI_H and X86_64_ANSI_H checks here.
-
// A null pointer constant.
// Offset of member MEMBER in a struct of type TYPE.
@@ -9382,7 +9616,7 @@ type X__compar_d_fn_t = uintptr /* stdlib.h:812:13 */
type Max_align_t = struct {
F__max_align_ll int64
F__max_align_ld float64
-} /* stddef.h:437:3 */
+} /* stddef.h:426:3 */
// Use a macro to replace memcpy() if compiled with SQLITE_INLINE_MEMCPY.
// This allows better measurements of where memcpy() is used when running
@@ -9417,7 +9651,7 @@ type Max_align_t = struct {
// number of pages. A negative number N translations means that a buffer
// of -1024*N bytes is allocated and used for as many pages as it will hold.
//
-// The default value of "20" was choosen to minimize the run-time of the
+// The default value of "20" was chosen to minimize the run-time of the
// speedtest1 test program with options: --shrink-memory --reprepare
// Default value for the SQLITE_CONFIG_SORTERREF_SIZE option.
@@ -9441,13 +9675,13 @@ type Max_align_t = struct {
// types can be conveniently redefined at compile-type. Like this:
//
// cc '-DUINTPTR_TYPE=long long int' ...
-type I64 = Sqlite_int64 /* sqlite3.c:14542:22 */ // 8-byte signed integer
-type U64 = Sqlite_uint64 /* sqlite3.c:14543:23 */ // 8-byte unsigned integer
-type U32 = uint32 /* sqlite3.c:14544:21 */ // 4-byte unsigned integer
-type U16 = uint16 /* sqlite3.c:14545:21 */ // 2-byte unsigned integer
-type I16 = int16 /* sqlite3.c:14546:20 */ // 2-byte signed integer
-type U8 = uint8 /* sqlite3.c:14547:20 */ // 1-byte unsigned integer
-type I8 = int8 /* sqlite3.c:14548:19 */ // 1-byte signed integer
+type I64 = Sqlite_int64 /* sqlite3.c:13902:22 */ // 8-byte signed integer
+type U64 = Sqlite_uint64 /* sqlite3.c:13903:23 */ // 8-byte unsigned integer
+type U32 = uint32 /* sqlite3.c:13904:21 */ // 4-byte unsigned integer
+type U16 = uint16 /* sqlite3.c:13905:21 */ // 2-byte unsigned integer
+type I16 = int16 /* sqlite3.c:13906:20 */ // 2-byte signed integer
+type U8 = uint8 /* sqlite3.c:13907:20 */ // 1-byte unsigned integer
+type I8 = int8 /* sqlite3.c:13908:19 */ // 1-byte signed integer
// SQLITE_MAX_U32 is a u64 constant that is the maximum u64 value
// that can be stored in a u32 without loss of data. The value
@@ -9458,7 +9692,7 @@ type I8 = int8 /* sqlite3.c:14548:19 */ // 1-byte signed integer
// table or index. This is an unsigned integer type. For 99.9% of
// the world, a 32-bit integer is sufficient. But a 64-bit integer
// can be used at compile-time if desired.
-type TRowcnt = U32 /* sqlite3.c:14567:14 */ // 32-bit is the default
+type TRowcnt = U32 /* sqlite3.c:13927:14 */ // 32-bit is the default
// Estimated quantities used for query planning are stored as 16-bit
// logarithms. For quantity X, the value stored is 10*log2(X). This
@@ -9481,12 +9715,12 @@ type TRowcnt = U32 /* sqlite3.c:14567:14 */ // 32-bit is the default
// Examples:
//
// 0.5 -> -10 0.1 -> -33 0.0625 -> -40
-type LogEst = int16 /* sqlite3.c:14593:20 */
+type LogEst = int16 /* sqlite3.c:13953:20 */
// Set the SQLITE_PTRSIZE macro to the number of bytes in a pointer
// The uptr type is an unsigned integer large enough to hold a pointer
-type Uptr = U32 /* sqlite3.c:14615:15 */
+type Uptr = U32 /* sqlite3.c:13976:15 */
// An instance of the following structure is used to store the busy-handler
// callback for a given sqlite handle.
@@ -9499,7 +9733,7 @@ type BusyHandler1 = struct {
FxBusyHandler uintptr
FpBusyArg uintptr
FnBusy int32
-} /* sqlite3.c:1331:9 */
+} /* sqlite3.c:578:9 */
// An instance of the following structure is used to store the busy-handler
// callback for a given sqlite handle.
@@ -9508,9 +9742,23 @@ type BusyHandler1 = struct {
// callback for the database handle. Each pager opened via the sqlite
// handle is passed a pointer to sqlite.busyHandler. The busy-handler
// callback is currently invoked only from within pager.c.
-type BusyHandler = BusyHandler1 /* sqlite3.c:14788:28 */
+type BusyHandler = BusyHandler1 /* sqlite3.c:14149:28 */
// Name of table that holds the database schema.
+//
+// The PREFERRED names are used whereever possible. But LEGACY is also
+// used for backwards compatibility.
+//
+// 1. Queries can use either the PREFERRED or the LEGACY names
+// 2. The sqlite3_set_authorizer() callback uses the LEGACY name
+// 3. The PRAGMA table_list statement uses the PREFERRED name
+//
+// The LEGACY names are stored in the internal symbol hash table
+// in support of (2). Names are translated using sqlite3PreferredTableName()
+// for (3). The sqlite3FindTable() function takes care of translating
+// names for (1).
+//
+// Note that "sqlite_temp_schema" can also be called "temp.sqlite_schema".
// The root-page of the schema table.
@@ -9573,9 +9821,23 @@ type AggInfo1 = struct {
FaFunc uintptr
FnFunc int32
FselId U32
-} /* sqlite3.c:1331:9 */
+} /* sqlite3.c:578:9 */
// Name of table that holds the database schema.
+//
+// The PREFERRED names are used whereever possible. But LEGACY is also
+// used for backwards compatibility.
+//
+// 1. Queries can use either the PREFERRED or the LEGACY names
+// 2. The sqlite3_set_authorizer() callback uses the LEGACY name
+// 3. The PRAGMA table_list statement uses the PREFERRED name
+//
+// The LEGACY names are stored in the internal symbol hash table
+// in support of (2). Names are translated using sqlite3PreferredTableName()
+// for (3). The sqlite3FindTable() function takes care of translating
+// names for (1).
+//
+// Note that "sqlite_temp_schema" can also be called "temp.sqlite_schema".
// The root-page of the schema table.
@@ -9622,21 +9884,21 @@ type AggInfo1 = struct {
// cases the parameters are named as per the usual conventions.
// Forward references to structures
-type AggInfo = AggInfo1 /* sqlite3.c:14884:24 */
+type AggInfo = AggInfo1 /* sqlite3.c:14259:24 */
type AuthContext1 = struct {
FzAuthContext uintptr
FpParse uintptr
-} /* sqlite3.c:14885:9 */
+} /* sqlite3.c:14260:9 */
-type AuthContext = AuthContext1 /* sqlite3.c:14885:28 */
+type AuthContext = AuthContext1 /* sqlite3.c:14260:28 */
type AutoincInfo1 = struct {
FpNext uintptr
FpTab uintptr
FiDb int32
FregCtr int32
-} /* sqlite3.c:1331:9 */
+} /* sqlite3.c:578:9 */
-type AutoincInfo = AutoincInfo1 /* sqlite3.c:14886:28 */
+type AutoincInfo = AutoincInfo1 /* sqlite3.c:14261:28 */
type Bitvec1 = struct {
FiSize U32
FnSet U32
@@ -9645,9 +9907,9 @@ type Bitvec1 = struct {
F__ccgo_pad1 [0]uint32
FaBitmap [500]U8
}
-} /* sqlite3.c:1331:9 */
+} /* sqlite3.c:578:9 */
-type Bitvec = Bitvec1 /* sqlite3.c:14887:23 */
+type Bitvec = Bitvec1 /* sqlite3.c:14262:23 */
type CollSeq1 = struct {
FzName uintptr
Fenc U8
@@ -9655,22 +9917,23 @@ type CollSeq1 = struct {
FpUser uintptr
FxCmp uintptr
FxDel uintptr
-} /* sqlite3.c:1331:9 */
+} /* sqlite3.c:578:9 */
-type CollSeq = CollSeq1 /* sqlite3.c:14888:24 */
+type CollSeq = CollSeq1 /* sqlite3.c:14263:24 */
type Column1 = struct {
- FzName uintptr
- FpDflt uintptr
- FzColl uintptr
- FnotNull U8
+ FzCnName uintptr
+ FnotNull uint8 /* unsigned notNull: 4, unsigned eCType: 4 */
+ F__ccgo_pad1 [1]byte
Faffinity uint8
FszEst U8
FhName U8
+ F__ccgo_pad2 [1]byte
+ FiDflt U16
FcolFlags U16
- F__ccgo_pad1 [2]byte
-} /* sqlite3.c:1331:9 */
+ F__ccgo_pad3 [2]byte
+} /* sqlite3.c:578:9 */
-type Column = Column1 /* sqlite3.c:14889:23 */
+type Column = Column1 /* sqlite3.c:14264:23 */
type Cte1 = struct {
FzName uintptr
FpCols uintptr
@@ -9679,9 +9942,9 @@ type Cte1 = struct {
FpUse uintptr
FeM10d U8
F__ccgo_pad1 [3]byte
-} /* sqlite3.c:1331:9 */
+} /* sqlite3.c:578:9 */
-type Cte = Cte1 /* sqlite3.c:14890:20 */
+type Cte = Cte1 /* sqlite3.c:14265:20 */
type CteUse1 = struct {
FnUse int32
FaddrM9e int32
@@ -9690,9 +9953,9 @@ type CteUse1 = struct {
FnRowEst LogEst
FeM10d U8
F__ccgo_pad1 [1]byte
-} /* sqlite3.c:1331:9 */
+} /* sqlite3.c:578:9 */
-type CteUse = CteUse1 /* sqlite3.c:14891:23 */
+type CteUse = CteUse1 /* sqlite3.c:14266:23 */
type Db1 = struct {
FzDbSName uintptr
FpBt uintptr
@@ -9700,9 +9963,9 @@ type Db1 = struct {
FbSyncSet U8
F__ccgo_pad1 [2]byte
FpSchema uintptr
-} /* sqlite3.c:1331:9 */
+} /* sqlite3.c:578:9 */
-type Db = Db1 /* sqlite3.c:14892:19 */
+type Db = Db1 /* sqlite3.c:14267:19 */
type DbFixer1 = struct {
FpParse uintptr
Fw Walker
@@ -9712,9 +9975,9 @@ type DbFixer1 = struct {
FzDb uintptr
FzType uintptr
FpName uintptr
-} /* sqlite3.c:14893:9 */
+} /* sqlite3.c:14268:9 */
-type DbFixer = DbFixer1 /* sqlite3.c:14893:24 */
+type DbFixer = DbFixer1 /* sqlite3.c:14268:24 */
type Schema1 = struct {
Fschema_cookie int32
FiGeneration int32
@@ -9727,9 +9990,9 @@ type Schema1 = struct {
Fenc U8
FschemaFlags U16
Fcache_size int32
-} /* sqlite3.c:1331:9 */
+} /* sqlite3.c:578:9 */
-type Schema = Schema1 /* sqlite3.c:14894:23 */
+type Schema = Schema1 /* sqlite3.c:14269:23 */
type Expr1 = struct {
Fop U8
FaffExpr uint8
@@ -9750,9 +10013,9 @@ type Expr1 = struct {
FpTab uintptr
F__ccgo_pad1 [4]byte
}
-} /* sqlite3.c:1331:9 */
+} /* sqlite3.c:578:9 */
-type Expr = Expr1 /* sqlite3.c:14895:21 */
+type Expr = Expr1 /* sqlite3.c:14270:21 */
type ExprList1 = struct {
FnExpr int32
FnAlloc int32
@@ -9771,9 +10034,9 @@ type ExprList1 = struct {
}
}
}
-} /* sqlite3.c:1331:9 */
+} /* sqlite3.c:578:9 */
-type ExprList = ExprList1 /* sqlite3.c:14896:25 */
+type ExprList = ExprList1 /* sqlite3.c:14271:25 */
type FKey1 = struct {
FpFrom uintptr
FpNextFrom uintptr
@@ -9789,16 +10052,16 @@ type FKey1 = struct {
FiFrom int32
FzCol uintptr
}
-} /* sqlite3.c:1331:9 */
+} /* sqlite3.c:14272:9 */
-type FKey = FKey1 /* sqlite3.c:14897:21 */
+type FKey = FKey1 /* sqlite3.c:14272:21 */
type FuncDestructor1 = struct {
FnRef int32
FxDestroy uintptr
FpUserData uintptr
-} /* sqlite3.c:14898:9 */
+} /* sqlite3.c:14273:9 */
-type FuncDestructor = FuncDestructor1 /* sqlite3.c:14898:31 */
+type FuncDestructor = FuncDestructor1 /* sqlite3.c:14273:31 */
type FuncDef1 = struct {
FnArg I8
F__ccgo_pad1 [3]byte
@@ -9811,18 +10074,18 @@ type FuncDef1 = struct {
FxInverse uintptr
FzName uintptr
Fu struct{ FpHash uintptr }
-} /* sqlite3.c:1331:9 */
+} /* sqlite3.c:578:9 */
-type FuncDef = FuncDef1 /* sqlite3.c:14899:24 */
-type FuncDefHash1 = struct{ Fa [23]uintptr } /* sqlite3.c:14900:9 */
+type FuncDef = FuncDef1 /* sqlite3.c:14274:24 */
+type FuncDefHash1 = struct{ Fa [23]uintptr } /* sqlite3.c:14275:9 */
-type FuncDefHash = FuncDefHash1 /* sqlite3.c:14900:28 */
+type FuncDefHash = FuncDefHash1 /* sqlite3.c:14275:28 */
type IdList1 = struct {
Fa uintptr
FnId int32
-} /* sqlite3.c:1331:9 */
+} /* sqlite3.c:578:9 */
-type IdList = IdList1 /* sqlite3.c:14901:23 */
+type IdList = IdList1 /* sqlite3.c:14276:23 */
type Index1 = struct {
FzName uintptr
FaiColumn uintptr
@@ -9851,18 +10114,18 @@ type Index1 = struct {
FnRowEst0 TRowcnt
F__ccgo_pad3 [4]byte
FcolNotIdxed Bitmask
-} /* sqlite3.c:1331:9 */
+} /* sqlite3.c:578:9 */
-type Index = Index1 /* sqlite3.c:14902:22 */
+type Index = Index1 /* sqlite3.c:14277:22 */
type IndexSample1 = struct {
Fp uintptr
Fn int32
FanEq uintptr
FanLt uintptr
FanDLt uintptr
-} /* sqlite3.c:1331:9 */
+} /* sqlite3.c:578:9 */
-type IndexSample = IndexSample1 /* sqlite3.c:14903:28 */
+type IndexSample = IndexSample1 /* sqlite3.c:14278:28 */
type KeyInfo1 = struct {
FnRef U32
Fenc U8
@@ -9873,9 +10136,9 @@ type KeyInfo1 = struct {
Fdb uintptr
FaSortFlags uintptr
FaColl [1]uintptr
-} /* sqlite3.c:1331:9 */
+} /* sqlite3.c:578:9 */
-type KeyInfo = KeyInfo1 /* sqlite3.c:14905:24 */
+type KeyInfo = KeyInfo1 /* sqlite3.c:14280:24 */
type Lookaside1 = struct {
FbDisable U32
Fsz U16
@@ -9891,12 +10154,12 @@ type Lookaside1 = struct {
FpMiddle uintptr
FpStart uintptr
FpEnd uintptr
-} /* sqlite3.c:1331:9 */
+} /* sqlite3.c:578:9 */
-type Lookaside = Lookaside1 /* sqlite3.c:14906:26 */
-type LookasideSlot1 = struct{ FpNext uintptr } /* sqlite3.c:1331:9 */
+type Lookaside = Lookaside1 /* sqlite3.c:14281:26 */
+type LookasideSlot1 = struct{ FpNext uintptr } /* sqlite3.c:578:9 */
-type LookasideSlot = LookasideSlot1 /* sqlite3.c:14907:30 */
+type LookasideSlot = LookasideSlot1 /* sqlite3.c:14282:30 */
type Module1 = struct {
FpModule uintptr
FzName uintptr
@@ -9904,9 +10167,9 @@ type Module1 = struct {
FpAux uintptr
FxDestroy uintptr
FpEpoTab uintptr
-} /* sqlite3.c:1331:9 */
+} /* sqlite3.c:578:9 */
-type Module = Module1 /* sqlite3.c:14908:23 */
+type Module = Module1 /* sqlite3.c:14283:23 */
type NameContext1 = struct {
FpParse uintptr
FpSrcList uintptr
@@ -9916,9 +10179,9 @@ type NameContext1 = struct {
FnNcErr int32
FncFlags int32
FpWinSelect uintptr
-} /* sqlite3.c:14909:9 */
+} /* sqlite3.c:14284:9 */
-type NameContext = NameContext1 /* sqlite3.c:14909:28 */
+type NameContext = NameContext1 /* sqlite3.c:14284:28 */
type Parse1 = struct {
Fdb uintptr
FzErrMsg uintptr
@@ -9958,7 +10221,6 @@ type Parse1 = struct {
FpAinc uintptr
FpToplevel uintptr
FpTriggerTab uintptr
- FpParentParse uintptr
Fu1 struct{ FaddrCrTab int32 }
FnQueryLoop U32
Foldmask U32
@@ -9991,16 +10253,16 @@ type Parse1 = struct {
FpWith uintptr
FpCleanup uintptr
FpRename uintptr
-} /* sqlite3.c:1331:9 */
+} /* sqlite3.c:578:9 */
-type Parse = Parse1 /* sqlite3.c:14910:22 */
+type Parse = Parse1 /* sqlite3.c:14285:22 */
type ParseCleanup1 = struct {
FpNext uintptr
FpPtr uintptr
FxCleanup uintptr
-} /* sqlite3.c:1331:9 */
+} /* sqlite3.c:578:9 */
-type ParseCleanup = ParseCleanup1 /* sqlite3.c:14911:29 */
+type ParseCleanup = ParseCleanup1 /* sqlite3.c:14286:29 */
type PreUpdate1 = struct {
Fv uintptr
FpCsr uintptr
@@ -10017,23 +10279,23 @@ type PreUpdate1 = struct {
FpTab uintptr
FpPk uintptr
F__ccgo_pad1 [4]byte
-} /* sqlite3.c:1331:9 */
+} /* sqlite3.c:578:9 */
-type PreUpdate = PreUpdate1 /* sqlite3.c:14912:26 */
+type PreUpdate = PreUpdate1 /* sqlite3.c:14287:26 */
type PrintfArguments1 = struct {
FnArg int32
FnUsed int32
FapArg uintptr
-} /* sqlite3.c:14913:9 */
+} /* sqlite3.c:14288:9 */
-type PrintfArguments = PrintfArguments1 /* sqlite3.c:14913:32 */
+type PrintfArguments = PrintfArguments1 /* sqlite3.c:14288:32 */
type RenameToken1 = struct {
Fp uintptr
Ft Token
FpNext uintptr
-} /* sqlite3.c:1331:9 */
+} /* sqlite3.c:578:9 */
-type RenameToken = RenameToken1 /* sqlite3.c:14914:28 */
+type RenameToken = RenameToken1 /* sqlite3.c:14289:28 */
type Returning1 = struct {
FpParse uintptr
FpReturnEL uintptr
@@ -10042,9 +10304,9 @@ type Returning1 = struct {
FiRetCur int32
FnRetCol int32
FiRetReg int32
-} /* sqlite3.c:14915:9 */
+} /* sqlite3.c:14290:9 */
-type Returning = Returning1 /* sqlite3.c:14915:26 */
+type Returning = Returning1 /* sqlite3.c:14290:26 */
type RowSet1 = struct {
FpChunk uintptr
Fdb uintptr
@@ -10055,9 +10317,9 @@ type RowSet1 = struct {
FnFresh U16
FrsFlags U16
FiBatch int32
-} /* sqlite3.c:14916:9 */
+} /* sqlite3.c:14291:9 */
-type RowSet = RowSet1 /* sqlite3.c:14916:23 */
+type RowSet = RowSet1 /* sqlite3.c:14291:23 */
type Savepoint1 = struct {
FzName uintptr
F__ccgo_pad1 [4]byte
@@ -10065,9 +10327,9 @@ type Savepoint1 = struct {
FnDeferredImmCons I64
FpNext uintptr
F__ccgo_pad2 [4]byte
-} /* sqlite3.c:1331:9 */
+} /* sqlite3.c:578:9 */
-type Savepoint = Savepoint1 /* sqlite3.c:14917:26 */
+type Savepoint = Savepoint1 /* sqlite3.c:14292:26 */
type Select1 = struct {
Fop U8
F__ccgo_pad1 [1]byte
@@ -10089,16 +10351,16 @@ type Select1 = struct {
FpWith uintptr
FpWin uintptr
FpWinDefn uintptr
-} /* sqlite3.c:1331:9 */
+} /* sqlite3.c:578:9 */
-type Select = Select1 /* sqlite3.c:14918:23 */
+type Select = Select1 /* sqlite3.c:14293:23 */
type SQLiteThread1 = struct {
FxTask uintptr
FpIn uintptr
FpResult uintptr
-} /* sqlite3.c:14919:9 */
+} /* sqlite3.c:14294:9 */
-type SQLiteThread = SQLiteThread1 /* sqlite3.c:14919:29 */
+type SQLiteThread = SQLiteThread1 /* sqlite3.c:14294:29 */
type SelectDest1 = struct {
FeDest U8
F__ccgo_pad1 [3]byte
@@ -10108,9 +10370,9 @@ type SelectDest1 = struct {
FnSdst int32
FzAffSdst uintptr
FpOrderBy uintptr
-} /* sqlite3.c:14920:9 */
+} /* sqlite3.c:14295:9 */
-type SelectDest = SelectDest1 /* sqlite3.c:14920:27 */
+type SelectDest = SelectDest1 /* sqlite3.c:14295:27 */
type SrcItem1 = struct {
FpSchema uintptr
FzDatabase uintptr
@@ -10134,60 +10396,61 @@ type SrcItem1 = struct {
FcolUsed Bitmask
Fu1 struct{ FzIndexedBy uintptr }
Fu2 struct{ FpIBIndex uintptr }
-} /* sqlite3.c:1331:9 */
+} /* sqlite3.c:578:9 */
-type SrcItem = SrcItem1 /* sqlite3.c:14921:24 */
+type SrcItem = SrcItem1 /* sqlite3.c:14296:24 */
type SrcList1 = struct {
FnSrc int32
FnAlloc U32
Fa [1]SrcItem
-} /* sqlite3.c:1331:9 */
+} /* sqlite3.c:578:9 */
-type SrcList = SrcList1 /* sqlite3.c:14922:24 */
-type StrAccum = sqlite3_str /* sqlite3.c:14923:28 */ // Internal alias for sqlite3_str
+type SrcList = SrcList1 /* sqlite3.c:14297:24 */
+type StrAccum = sqlite3_str /* sqlite3.c:14298:28 */ // Internal alias for sqlite3_str
type Table1 = struct {
- FzName uintptr
- FaCol uintptr
- FpIndex uintptr
- FpSelect uintptr
- FpFKey uintptr
- FzColAff uintptr
- FpCheck uintptr
- Ftnum Pgno
- FnTabRef U32
- FtabFlags U32
- FiPKey I16
- FnCol I16
- FnNVCol I16
- FnRowLogEst LogEst
- FszTabRow LogEst
- FkeyConf U8
- F__ccgo_pad1 [1]byte
- FaddColOffset int32
- FnModuleArg int32
- FazModuleArg uintptr
- FpVTable uintptr
- FpTrigger uintptr
- FpSchema uintptr
-} /* sqlite3.c:1331:9 */
+ FzName uintptr
+ FaCol uintptr
+ FpIndex uintptr
+ FzColAff uintptr
+ FpCheck uintptr
+ Ftnum Pgno
+ FnTabRef U32
+ FtabFlags U32
+ FiPKey I16
+ FnCol I16
+ FnNVCol I16
+ FnRowLogEst LogEst
+ FszTabRow LogEst
+ FkeyConf U8
+ FeTabType U8
+ Fu struct {
+ Ftab struct {
+ FaddColOffset int32
+ FpFKey uintptr
+ FpDfltList uintptr
+ }
+ }
+ FpTrigger uintptr
+ FpSchema uintptr
+} /* sqlite3.c:578:9 */
// Internal alias for sqlite3_str
-type Table = Table1 /* sqlite3.c:14924:22 */
+type Table = Table1 /* sqlite3.c:14299:22 */
type TableLock1 = struct {
FiDb int32
FiTab Pgno
FisWriteLock U8
F__ccgo_pad1 [3]byte
FzLockName uintptr
-} /* sqlite3.c:1331:9 */
+} /* sqlite3.c:578:9 */
-type TableLock = TableLock1 /* sqlite3.c:14925:26 */
+type TableLock = TableLock1 /* sqlite3.c:14300:26 */
type Token1 = struct {
Fz uintptr
Fn uint32
-} /* sqlite3.c:1331:9 */
+} /* sqlite3.c:578:9 */
-type Token = Token1 /* sqlite3.c:14926:22 */
+type Token = Token1 /* sqlite3.c:14301:22 */
type Trigger1 = struct {
FzName uintptr
Ftable uintptr
@@ -10201,18 +10464,18 @@ type Trigger1 = struct {
FpTabSchema uintptr
Fstep_list uintptr
FpNext uintptr
-} /* sqlite3.c:1331:9 */
+} /* sqlite3.c:578:9 */
-type Trigger = Trigger1 /* sqlite3.c:14928:24 */
+type Trigger = Trigger1 /* sqlite3.c:14303:24 */
type TriggerPrg1 = struct {
FpTrigger uintptr
FpNext uintptr
FpProgram uintptr
Forconf int32
FaColmask [2]U32
-} /* sqlite3.c:1331:9 */
+} /* sqlite3.c:578:9 */
-type TriggerPrg = TriggerPrg1 /* sqlite3.c:14929:27 */
+type TriggerPrg = TriggerPrg1 /* sqlite3.c:14304:27 */
type TriggerStep1 = struct {
Fop U8
Forconf U8
@@ -10228,9 +10491,9 @@ type TriggerStep1 = struct {
FzSpan uintptr
FpNext uintptr
FpLast uintptr
-} /* sqlite3.c:1331:9 */
+} /* sqlite3.c:578:9 */
-type TriggerStep = TriggerStep1 /* sqlite3.c:14930:28 */
+type TriggerStep = TriggerStep1 /* sqlite3.c:14305:28 */
type UnpackedRecord1 = struct {
FpKeyInfo uintptr
FaMem uintptr
@@ -10241,9 +10504,9 @@ type UnpackedRecord1 = struct {
Fr2 I8
FeqSeen U8
F__ccgo_pad1 [1]byte
-} /* sqlite3.c:1331:9 */
+} /* sqlite3.c:578:9 */
-type UnpackedRecord = UnpackedRecord1 /* sqlite3.c:14931:31 */
+type UnpackedRecord = UnpackedRecord1 /* sqlite3.c:14306:31 */
type Upsert1 = struct {
FpUpsertTarget uintptr
FpUpsertTargetWhere uintptr
@@ -10258,9 +10521,9 @@ type Upsert1 = struct {
FregData int32
FiDataCur int32
FiIdxCur int32
-} /* sqlite3.c:1331:9 */
+} /* sqlite3.c:578:9 */
-type Upsert = Upsert1 /* sqlite3.c:14932:23 */
+type Upsert = Upsert1 /* sqlite3.c:14307:23 */
type VTable1 = struct {
Fdb uintptr
FpMod uintptr
@@ -10271,17 +10534,17 @@ type VTable1 = struct {
F__ccgo_pad1 [2]byte
FiSavepoint int32
FpNext uintptr
-} /* sqlite3.c:1331:9 */
+} /* sqlite3.c:578:9 */
-type VTable = VTable1 /* sqlite3.c:14933:23 */
+type VTable = VTable1 /* sqlite3.c:14308:23 */
type VtabCtx1 = struct {
FpVTable uintptr
FpTab uintptr
FpPrior uintptr
FbDeclared int32
-} /* sqlite3.c:1331:9 */
+} /* sqlite3.c:578:9 */
-type VtabCtx = VtabCtx1 /* sqlite3.c:14934:24 */
+type VtabCtx = VtabCtx1 /* sqlite3.c:14309:24 */
type Walker1 = struct {
FpParse uintptr
FxExprCallback uintptr
@@ -10291,9 +10554,9 @@ type Walker1 = struct {
FeCode U16
F__ccgo_pad1 [2]byte
Fu struct{ FpNC uintptr }
-} /* sqlite3.c:14893:9 */
+} /* sqlite3.c:14268:9 */
-type Walker = Walker1 /* sqlite3.c:14935:23 */
+type Walker = Walker1 /* sqlite3.c:14310:23 */
type WhereInfo1 = struct {
FpParse uintptr
FpTabList uintptr
@@ -10322,9 +10585,9 @@ type WhereInfo1 = struct {
FsWC WhereClause
FsMaskSet WhereMaskSet
Fa [1]WhereLevel
-} /* sqlite3.c:14936:9 */
+} /* sqlite3.c:14311:9 */
-type WhereInfo = WhereInfo1 /* sqlite3.c:14936:26 */
+type WhereInfo = WhereInfo1 /* sqlite3.c:14311:26 */
type Window1 = struct {
FzName uintptr
FzBase uintptr
@@ -10356,24 +10619,24 @@ type Window1 = struct {
FregEndRowid int32
FbExprArgs U8
F__ccgo_pad2 [3]byte
-} /* sqlite3.c:1331:9 */
+} /* sqlite3.c:578:9 */
-type Window = Window1 /* sqlite3.c:14937:23 */
+type Window = Window1 /* sqlite3.c:14312:23 */
type With1 = struct {
FnCte int32
FbView int32
FpOuter uintptr
Fa [1]Cte
-} /* sqlite3.c:1331:9 */
+} /* sqlite3.c:578:9 */
-type With = With1 /* sqlite3.c:14938:21 */
+type With = With1 /* sqlite3.c:14313:21 */
// The bitmask datatype defined below is used for various optimizations.
//
// Changing this from a 64-bit to a 32-bit type limits the number of
// tables in a join to 32 instead of 64. But it also reduces the size
// of the library by 738 bytes on ix86.
-type Bitmask = U64 /* sqlite3.c:14951:15 */
+type Bitmask = U64 /* sqlite3.c:14326:15 */
// The number of bits in a Bitmask. "BMS" means "BitMask Size".
@@ -10384,7 +10647,7 @@ type Bitmask = U64 /* sqlite3.c:14951:15 */
// variable number associated with that parameter. See the format description
// on the sqlite3VListAdd() routine for more information. A VList is really
// just an array of integers.
-type VList = int32 /* sqlite3.c:14973:13 */
+type VList = int32 /* sqlite3.c:14348:13 */
// Defer sourcing vdbe.h and btree.h until after the "u8" and
// "BusyHandler" typedefs. vdbe.h also requires a few of the opaque
@@ -10411,7 +10674,7 @@ type VList = int32 /* sqlite3.c:14973:13 */
// The type used to represent a page number. The first page in a file
// is called page 1. 0 is used to represent "not a page".
-type Pgno = U32 /* sqlite3.c:15014:13 */
+type Pgno = U32 /* sqlite3.c:14389:13 */
// Each open file is managed by a separate instance of the "Pager" structure.
type Pager1 = struct {
@@ -10428,6 +10691,7 @@ type Pager1 = struct {
FnoLock U8
FreadOnly U8
FmemDb U8
+ FmemVfs U8
FeState U8
FeLock U8
FchangeCountDone U8
@@ -10436,6 +10700,7 @@ type Pager1 = struct {
FsubjInMemory U8
FbUseFetch U8
FhasHeldSharedLock U8
+ F__ccgo_pad1 [3]byte
FdbSize Pgno
FdbOrigSize Pgno
FdbFileSize Pgno
@@ -10448,6 +10713,7 @@ type Pager1 = struct {
Ffd uintptr
Fjfd uintptr
Fsjfd uintptr
+ F__ccgo_pad2 [4]byte
FjournalOff I64
FjournalHdr I64
FpBackup uintptr
@@ -10456,15 +10722,16 @@ type Pager1 = struct {
FiDataVersion U32
FdbFileVers [16]uint8
FnMmapOut int32
- F__ccgo_pad1 [4]byte
+ F__ccgo_pad3 [4]byte
FszMmap Sqlite3_int64
FpMmapFreelist uintptr
FnExtra U16
FnReserve I16
FvfsFlags U32
FsectorSize U32
- FpageSize int32
FmxPgno Pgno
+ F__ccgo_pad4 [4]byte
+ FpageSize I64
FjournalSizeLimit I64
FzFilename uintptr
FzJournal uintptr
@@ -10477,10 +10744,10 @@ type Pager1 = struct {
FpPCache uintptr
FpWal uintptr
FzWal uintptr
-} /* sqlite3.c:1331:9 */
+} /* sqlite3.c:578:9 */
// Each open file is managed by a separate instance of the "Pager" structure.
-type Pager = Pager1 /* sqlite3.c:15019:22 */
+type Pager = Pager1 /* sqlite3.c:14394:22 */
// Handle type for pages.
type PgHdr2 = struct {
@@ -10495,10 +10762,10 @@ type PgHdr2 = struct {
FnRef I16
FpDirtyNext uintptr
FpDirtyPrev uintptr
-} /* sqlite3.c:1331:9 */
+} /* sqlite3.c:578:9 */
// Handle type for pages.
-type DbPage = PgHdr2 /* sqlite3.c:15024:22 */
+type DbPage = PgHdr2 /* sqlite3.c:14399:22 */
// Functions to support testing and debugging.
@@ -10540,7 +10807,7 @@ type Btree1 = struct {
FpNext uintptr
FpPrev uintptr
Flock BtLock
-} /* sqlite3.c:1331:9 */
+} /* sqlite3.c:578:9 */
// Functions to support testing and debugging.
@@ -10569,7 +10836,7 @@ type Btree1 = struct {
// it must be turned on for each database using "PRAGMA auto_vacuum = 1".
// Forward declarations of structure
-type Btree = Btree1 /* sqlite3.c:15267:22 */
+type Btree = Btree1 /* sqlite3.c:14642:22 */
type BtCursor1 = struct {
FeState U8
FcurFlags U8
@@ -10594,9 +10861,9 @@ type BtCursor1 = struct {
FpPage uintptr
FapPage [19]uintptr
F__ccgo_pad3 [4]byte
-} /* sqlite3.c:1331:9 */
+} /* sqlite3.c:578:9 */
-type BtCursor = BtCursor1 /* sqlite3.c:15268:25 */
+type BtCursor = BtCursor1 /* sqlite3.c:14643:25 */
type BtShared1 = struct {
FpPager uintptr
Fdb uintptr
@@ -10630,9 +10897,9 @@ type BtShared1 = struct {
FpWriter uintptr
FpTmpSpace uintptr
FnPreformatSize int32
-} /* sqlite3.c:1331:9 */
+} /* sqlite3.c:578:9 */
-type BtShared = BtShared1 /* sqlite3.c:15269:25 */
+type BtShared = BtShared1 /* sqlite3.c:14644:25 */
type BtreePayload1 = struct {
FpKey uintptr
F__ccgo_pad1 [4]byte
@@ -10644,9 +10911,9 @@ type BtreePayload1 = struct {
FnData int32
FnZero int32
F__ccgo_pad3 [4]byte
-} /* sqlite3.c:15270:9 */
+} /* sqlite3.c:14645:9 */
-type BtreePayload = BtreePayload1 /* sqlite3.c:15270:29 */
+type BtreePayload = BtreePayload1 /* sqlite3.c:14645:29 */
//************* End of btree.h **********************************************
//************* Continuing where we left off in sqliteInt.h *****************
@@ -10685,9 +10952,10 @@ type Vdbe1 = struct {
FcacheCtr U32
Fpc int32
Frc int32
- FnChange int32
- FiStatement int32
F__ccgo_pad2 [4]byte
+ FnChange I64
+ FiStatement int32
+ F__ccgo_pad3 [4]byte
FiCurrentTime I64
FnFkConstraint I64
FnStmtDefCons I64
@@ -10703,16 +10971,16 @@ type Vdbe1 = struct {
FpResultSet uintptr
FzErrMsg uintptr
FpVList uintptr
- F__ccgo_pad3 [4]byte
+ F__ccgo_pad4 [4]byte
FstartTime I64
FnResColumn U16
FerrorAction U8
FminWriteFileFormat U8
FprepFlags U8
FdoingRerun U8
- F__ccgo_pad4 [2]byte
- Fexpired uint16 /* bft expired: 2, bft explain: 2, bft changeCntOn: 1, bft runOnlyOnce: 1, bft usesStmtJournal: 1, bft readOnly: 1, bft bIsReader: 1 */
F__ccgo_pad5 [2]byte
+ Fexpired uint16 /* bft expired: 2, bft explain: 2, bft changeCntOn: 1, bft runOnlyOnce: 1, bft usesStmtJournal: 1, bft readOnly: 1, bft bIsReader: 1 */
+ F__ccgo_pad6 [2]byte
FbtreeMask YDbMask
FlockMask YDbMask
FaCounter [7]U32
@@ -10724,7 +10992,7 @@ type Vdbe1 = struct {
Fexpmask U32
FpProgram uintptr
FpAuxData uintptr
-} /* sqlite3.c:1331:9 */
+} /* sqlite3.c:578:9 */
//************* End of btree.h **********************************************
//************* Continuing where we left off in sqliteInt.h *****************
@@ -10750,11 +11018,11 @@ type Vdbe1 = struct {
// A single VDBE is an opaque structure named "Vdbe". Only routines
// in the source file sqliteVdbe.c are allowed to see the insides
// of this structure.
-type Vdbe = Vdbe1 /* sqlite3.c:15668:21 */
+type Vdbe = Vdbe1 /* sqlite3.c:15047:21 */
// The names of the following types declared in vdbeInt.h are required
// for the VdbeOp definition.
-type Mem = sqlite3_value /* sqlite3.c:15674:30 */
+type Mem = sqlite3_value /* sqlite3.c:15053:30 */
type SubProgram1 = struct {
FaOp uintptr
FnOp int32
@@ -10763,9 +11031,9 @@ type SubProgram1 = struct {
FaOnce uintptr
Ftoken uintptr
FpNext uintptr
-} /* sqlite3.c:1331:9 */
+} /* sqlite3.c:578:9 */
-type SubProgram = SubProgram1 /* sqlite3.c:15675:27 */
+type SubProgram = SubProgram1 /* sqlite3.c:15054:27 */
// A single instruction of the virtual machine has an opcode
// and as many as three operands. The instruction is recorded
@@ -10778,14 +11046,14 @@ type VdbeOp1 = struct {
Fp2 int32
Fp3 int32
Fp4 struct{ Fi int32 }
-} /* sqlite3.c:1331:9 */
+} /* sqlite3.c:578:9 */
// A single instruction of the virtual machine has an opcode
// and as many as three operands. The instruction is recorded
// as an instance of the following structure:
-type p4union = struct{ Fi int32 } /* sqlite3.c:1331:9 */
+type p4union = struct{ Fi int32 } /* sqlite3.c:578:9 */
-type VdbeOp = VdbeOp1 /* sqlite3.c:15721:23 */
+type VdbeOp = VdbeOp1 /* sqlite3.c:15100:23 */
// A smaller version of VdbeOp used for the VdbeAddOpList() function because
// it takes up less space.
@@ -10794,11 +11062,11 @@ type VdbeOpList1 = struct {
Fp1 int8
Fp2 int8
Fp3 int8
-} /* sqlite3.c:15741:1 */
+} /* sqlite3.c:15120:1 */
-type VdbeOpList = VdbeOpList1 /* sqlite3.c:15747:27 */
+type VdbeOpList = VdbeOpList1 /* sqlite3.c:15126:27 */
-type RecordCompare = uintptr /* sqlite3.c:16156:13 */
+type RecordCompare = uintptr /* sqlite3.c:15537:13 */
// Use SQLITE_ENABLE_COMMENTS to enable generation of extra comments on
// each VDBE opcode.
@@ -10863,7 +11131,7 @@ type RecordCompare = uintptr /* sqlite3.c:16156:13 */
// This header file defines the interface that the sqlite page cache
// subsystem.
-type PgHdr = PgHdr2 /* sqlite3.c:16289:22 */
+type PgHdr = PgHdr2 /* sqlite3.c:15670:22 */
type PCache2 = struct {
FpDirty uintptr
FpDirtyTail uintptr
@@ -10879,12 +11147,12 @@ type PCache2 = struct {
FxStress uintptr
FpStress uintptr
FpCache uintptr
-} /* sqlite3.c:1331:9 */
+} /* sqlite3.c:578:9 */
-type PCache = PCache2 /* sqlite3.c:16290:23 */
+type PCache = PCache2 /* sqlite3.c:15671:23 */
// typedef for the authorization callback function.
-type Sqlite3_xauth = uintptr /* sqlite3.c:17058:15 */
+type Sqlite3_xauth = uintptr /* sqlite3.c:16439:15 */
// This is an extra SQLITE_TRACE macro that indicates "legacy" tracing
// in the style of sqlite3_trace()
@@ -10901,7 +11169,7 @@ type sqlite3InitInfo = struct {
ForphanTrigger uint8 /* unsigned orphanTrigger: 1, unsigned imposterTable: 1, unsigned reopenMemdb: 1 */
F__ccgo_pad2 [3]byte
FazInit uintptr
-} /* sqlite3.c:1331:9 */
+} /* sqlite3.c:578:9 */
// Allowed values for Table.tabFlags.
//
@@ -10917,6 +11185,8 @@ type sqlite3InitInfo = struct {
// TF_HasStored == COLFLAG_STORED
// TF_HasHidden == COLFLAG_HIDDEN
+// Allowed values for Table.eTabType
+
// Test to see whether or not a table is a virtual table. This is
// done as a macro so that it will be optimized out when virtual
// table support is omitted from the build.
@@ -10957,7 +11227,7 @@ type sqlite3InitInfo = struct {
type sColMap = struct {
FiFrom int32
FzCol uintptr
-} /* sqlite3.c:1331:9 */
+} /* sqlite3.c:14272:9 */
// An instance of this structure contains information needed to generate
// code for a SELECT that contains aggregate functions.
@@ -10977,7 +11247,7 @@ type AggInfo_col = struct {
FiMem int32
FiColumn I16
FiSorterColumn I16
-} /* sqlite3.c:1331:9 */
+} /* sqlite3.c:578:9 */
// An instance of this structure contains information needed to generate
// code for a SELECT that contains aggregate functions.
@@ -10996,7 +11266,7 @@ type AggInfo_func = struct {
FiMem int32
FiDistinct int32
FiDistAddr int32
-} /* sqlite3.c:1331:9 */
+} /* sqlite3.c:578:9 */
// The datatype ynVar is a signed integer, either 16-bit or 32-bit.
// Usually it is 16-bits. But if SQLITE_MAX_VARIABLE_NUMBER is greater
@@ -11006,7 +11276,7 @@ type AggInfo_func = struct {
// need more than about 10 or 20 variables. But some extreme users want
// to have prepared statements with over 32766 variables, and for them
// the option is available (at compile-time).
-type YnVar = I16 /* sqlite3.c:18212:13 */
+type YnVar = I16 /* sqlite3.c:17651:13 */
// The following are the meanings of bits in the Expr.flags field.
// Value restrictions:
@@ -11019,9 +11289,12 @@ type YnVar = I16 /* sqlite3.c:18212:13 */
// The EP_Propagate mask is a set of properties that automatically propagate
// upwards into parent nodes.
-// These macros can be used to test, set, or clear bits in the
+// Macros can be used to test, set, or clear bits in the
// Expr.flags field.
+// Macros used to ensure that the correct members of unions are accessed
+// in Expr.
+
// Flags for use with Expr.vvaFlags
// The ExprSetVVAProperty() macro is used for Verification, Validation,
@@ -11072,7 +11345,7 @@ type ExprList_item = struct {
FiAlias U16
}
}
-} /* sqlite3.c:1331:9 */
+} /* sqlite3.c:578:9 */
// Allowed values for Expr.a.eEName
@@ -11092,10 +11365,10 @@ type ExprList_item = struct {
type IdList_item = struct {
FzName uintptr
Fidx int32
-} /* sqlite3.c:1331:9 */
+} /* sqlite3.c:578:9 */
// The yDbMask datatype for the bitmask of all attached databases.
-type YDbMask = uint32 /* sqlite3.c:18969:24 */
+type YDbMask = uint32 /* sqlite3.c:18427:24 */
// A pointer to this structure is used to communicate information
// from sqlite3Init and OP_ParseSchema into the sqlite3InitCallback.
@@ -11107,7 +11380,7 @@ type InitData = struct {
FmInitFlags U32
FnInitRow U32
FmxPage Pgno
-} /* sqlite3.c:19327:3 */
+} /* sqlite3.c:18786:3 */
// Allowed values for mInitFlags
@@ -11169,7 +11442,7 @@ type Sqlite3Config = struct {
FszSorterRef U32
FiPrngSeed uint32
F__ccgo_pad3 [4]byte
-} /* sqlite3.c:19356:1 */
+} /* sqlite3.c:18817:1 */
// This macro is used inside of assert() statements to indicate that
// the assert is only valid on a well-formed database. Instead of:
@@ -11187,12 +11460,13 @@ type Sqlite3Config = struct {
// things that are always true for well-formed databases.
// Context pointer passed down through the tree-walk.
-type SrcCount = struct {
- FpSrc uintptr
- FiSrcInner int32
- FnThis int32
- FnOther int32
-} /* sqlite3.c:19454:5 */
+type RefSrcList = struct {
+ Fdb uintptr
+ FpRef uintptr
+ FnExclude I64
+ FaiExclude uintptr
+ F__ccgo_pad1 [4]byte
+} /* sqlite3.c:18916:5 */
// This macro is used inside of assert() statements to indicate that
// the assert is only valid on a well-formed database. Instead of:
@@ -11213,7 +11487,7 @@ type SrcCount = struct {
type IdxCover = struct {
FpIdx uintptr
FiCur int32
-} /* sqlite3.c:19457:5 */
+} /* sqlite3.c:18918:5 */
// This macro is used inside of assert() statements to indicate that
// the assert is only valid on a well-formed database. Instead of:
@@ -11239,7 +11513,7 @@ type IdxExprTrans1 = struct {
FiTabCol int32
FpWInfo uintptr
Fdb uintptr
-} /* sqlite3.c:19458:5 */
+} /* sqlite3.c:18919:5 */
// This macro is used inside of assert() statements to indicate that
// the assert is only valid on a well-formed database. Instead of:
@@ -11263,7 +11537,7 @@ type WindowRewrite1 = struct {
FpSub uintptr
FpTab uintptr
FpSubSelect uintptr
-} /* sqlite3.c:19461:5 */
+} /* sqlite3.c:18922:5 */
// This macro is used inside of assert() statements to indicate that
// the assert is only valid on a well-formed database. Instead of:
@@ -11288,7 +11562,7 @@ type WhereConst1 = struct {
FnChng int32
FbHasAffBlob int32
FapExpr uintptr
-} /* sqlite3.c:19462:5 */
+} /* sqlite3.c:18923:5 */
// This macro is used inside of assert() statements to indicate that
// the assert is only valid on a well-formed database. Instead of:
@@ -11312,9 +11586,137 @@ type RenameCtx1 = struct {
FiCol int32
FpTab uintptr
FzOld uintptr
-} /* sqlite3.c:19463:5 */
+} /* sqlite3.c:18924:5 */
//************* End of sqliteInt.h ******************************************
+//************* Begin file os_common.h **************************************
+// 2004 May 22
+//
+// The author disclaims copyright to this source code. In place of
+// a legal notice, here is a blessing:
+//
+// May you do good and not evil.
+// May you find forgiveness for yourself and forgive others.
+// May you share freely, never taking more than you give.
+//
+//
+//
+// This file contains macros and a little bit of code that is common to
+// all of the platform-specific files (os_*.c) and is #included into those
+// files.
+//
+// This file should be #included by the os_*.c files only. It is not a
+// general purpose header file.
+
+// At least two bugs have slipped in because we changed the MEMORY_DEBUG
+// macro to SQLITE_DEBUG and some older makefiles have not yet made the
+// switch. The following code should catch this problem at compile-time.
+
+// Macros for performance tracing. Normally turned off. Only works
+// on i486 hardware.
+
+// If we compile with the SQLITE_TEST macro set, then the following block
+// of code will give us the ability to simulate a disk I/O error. This
+// is used for testing the I/O recovery logic.
+
+// When testing, keep a count of the number of open files.
+
+//************* End of os_common.h ******************************************
+//************* Begin file ctime.c ******************************************
+// 2010 February 23
+//
+// The author disclaims copyright to this source code. In place of
+// a legal notice, here is a blessing:
+//
+// May you do good and not evil.
+// May you find forgiveness for yourself and forgive others.
+// May you share freely, never taking more than you give.
+//
+//
+//
+// This file implements routines used to report what compile-time options
+// SQLite was built with.
+
+// Include the configuration header output by 'configure' if we're using the
+// autoconf-based build
+
+// These macros are provided to "stringify" the value of the define
+// for those options in which the value is meaningful.
+
+// Like CTIMEOPT_VAL, but especially for SQLITE_DEFAULT_LOOKASIDE. This
+// option requires a separate macro because legal values contain a single
+// comma. e.g. (-DSQLITE_DEFAULT_LOOKASIDE="100,100")
+// #include "sqliteInt.h"
+
+// An array of names of all compile-time options. This array should
+// be sorted A-Z.
+//
+// This array looks large, but in a typical installation actually uses
+// only a handful of compile-time options, so most times this array is usually
+// rather short and uses little memory space.
+var sqlite3azCompileOpt = [51]uintptr{
+
+ // BEGIN CODE GENERATED BY tool/mkctime.tcl
+ ts + 7, /* "ATOMIC_INTRINSIC..." */
+ ts + 27, /* "COMPILER=gcc-10...." */
+ ts + 56, /* "DEFAULT_AUTOVACU..." */
+ ts + 75, /* "DEFAULT_CACHE_SI..." */
+ ts + 100, /* "DEFAULT_FILE_FOR..." */
+ ts + 122, /* "DEFAULT_JOURNAL_..." */
+ ts + 152, /* "DEFAULT_MMAP_SIZ..." */
+ ts + 172, /* "DEFAULT_PAGE_SIZ..." */
+ ts + 195, /* "DEFAULT_PCACHE_I..." */
+ ts + 220, /* "DEFAULT_RECURSIV..." */
+ ts + 247, /* "DEFAULT_SECTOR_S..." */
+ ts + 272, /* "DEFAULT_SYNCHRON..." */
+ ts + 294, /* "DEFAULT_WAL_AUTO..." */
+ ts + 326, /* "DEFAULT_WAL_SYNC..." */
+ ts + 352, /* "DEFAULT_WORKER_T..." */
+ ts + 377, /* "ENABLE_COLUMN_ME..." */
+ ts + 400, /* "ENABLE_FTS5" */
+ ts + 412, /* "ENABLE_GEOPOLY" */
+ ts + 427, /* "ENABLE_JSON1" */
+ ts + 440, /* "ENABLE_MEMORY_MA..." */
+ ts + 465, /* "ENABLE_OFFSET_SQ..." */
+ ts + 488, /* "ENABLE_PREUPDATE..." */
+ ts + 510, /* "ENABLE_RBU" */
+ ts + 521, /* "ENABLE_RTREE" */
+ ts + 534, /* "ENABLE_SESSION" */
+ ts + 549, /* "ENABLE_SNAPSHOT" */
+ ts + 565, /* "ENABLE_STAT4" */
+ ts + 578, /* "ENABLE_UNLOCK_NO..." */
+ ts + 599, /* "LIKE_DOESNT_MATC..." */
+ ts + 623, /* "MALLOC_SOFT_LIMI..." */
+ ts + 646, /* "MAX_ATTACHED=10" */
+ ts + 662, /* "MAX_COLUMN=2000" */
+ ts + 678, /* "MAX_COMPOUND_SEL..." */
+ ts + 702, /* "MAX_DEFAULT_PAGE..." */
+ ts + 729, /* "MAX_EXPR_DEPTH=1..." */
+ ts + 749, /* "MAX_FUNCTION_ARG..." */
+ ts + 770, /* "MAX_LENGTH=10000..." */
+ ts + 792, /* "MAX_LIKE_PATTERN..." */
+ ts + 822, /* "MAX_MMAP_SIZE=0x..." */
+ ts + 847, /* "MAX_PAGE_COUNT=1..." */
+ ts + 873, /* "MAX_PAGE_SIZE=65..." */
+ ts + 893, /* "MAX_SQL_LENGTH=1..." */
+ ts + 919, /* "MAX_TRIGGER_DEPT..." */
+ ts + 942, /* "MAX_VARIABLE_NUM..." */
+ ts + 968, /* "MAX_VDBE_OP=2500..." */
+ ts + 990, /* "MAX_WORKER_THREA..." */
+ ts + 1011, /* "MUTEX_NOOP" */
+ ts + 1022, /* "SOUNDEX" */
+ ts + 1030, /* "SYSTEM_MALLOC" */
+ ts + 1044, /* "TEMP_STORE=1" */
+ ts + 1057, /* "THREADSAFE=1" */
+ // END CODE GENERATED BY tool/mkctime.tcl
+} /* sqlite3.c:20514:19 */
+
+func Xsqlite3CompileOptions(tls *libc.TLS, pnOpt uintptr) uintptr { /* sqlite3.c:21246:27: */
+ *(*int32)(unsafe.Pointer(pnOpt)) = int32(uint32(unsafe.Sizeof(sqlite3azCompileOpt)) / uint32(unsafe.Sizeof(uintptr(0))))
+ return uintptr(uintptr(unsafe.Pointer(&sqlite3azCompileOpt)))
+}
+
+//************* End of ctime.c **********************************************
//************* Begin file global.c *****************************************
// 2008 June 13
//
@@ -11376,10 +11778,10 @@ var Xsqlite3UpperToLower = [274]uint8{
uint8(1), uint8(0), uint8(0), uint8(1), uint8(1), uint8(0), // aLTb[]: Use when compare(A,B) less than zero
uint8(0), uint8(1), uint8(0), uint8(1), uint8(0), uint8(1), // aEQb[]: Use when compare(A,B) equals zero
uint8(1), uint8(0), uint8(1), uint8(0), uint8(0), uint8(1), // aGTb[]: Use when compare(A,B) greater than zero
-} /* sqlite3.c:20818:36 */
-var Xsqlite3aLTb uintptr = 0 /* sqlite3.c:20880:36 */
-var Xsqlite3aEQb uintptr = 0 /* sqlite3.c:20881:36 */
-var Xsqlite3aGTb uintptr = 0 /* sqlite3.c:20882:36 */
+} /* sqlite3.c:21278:36 */
+var Xsqlite3aLTb uintptr = 0 /* sqlite3.c:21340:36 */
+var Xsqlite3aEQb uintptr = 0 /* sqlite3.c:21341:36 */
+var Xsqlite3aGTb uintptr = 0 /* sqlite3.c:21342:36 */
// The following 256 byte lookup table is used to support SQLites built-in
// equivalents to the following standard library functions:
@@ -11443,7 +11845,7 @@ var Xsqlite3CtypeMap = [256]uint8{
uint8(0x40), uint8(0x40), uint8(0x40), uint8(0x40), uint8(0x40), uint8(0x40), uint8(0x40), uint8(0x40), // e8..ef ........
uint8(0x40), uint8(0x40), uint8(0x40), uint8(0x40), uint8(0x40), uint8(0x40), uint8(0x40), uint8(0x40), // f0..f7 ........
uint8(0x40), uint8(0x40), uint8(0x40), uint8(0x40), uint8(0x40), uint8(0x40), uint8(0x40), uint8(0x40), // f8..ff ........
-} /* sqlite3.c:20912:36 */
+} /* sqlite3.c:21372:36 */
// EVIDENCE-OF: R-02982-34736 In order to maintain full backwards
// compatibility for legacy applications, the URI filename capability is
@@ -11489,26 +11891,26 @@ var Xsqlite3CtypeMap = [256]uint8{
// The following singleton contains the global configuration for
// the SQLite library.
var Xsqlite3Config = Sqlite3Config{
- FbMemstat: SQLITE_DEFAULT_MEMSTATUS, // bMemstat
- FbCoreMutex: U8(1), // bCoreMutex
- FbFullMutex: (U8(libc.Bool32(SQLITE_THREADSAFE == 1))), // bOpenUri
- FbUseCis: U8(SQLITE_ALLOW_COVERING_INDEX_SCAN), // bSmallMalloc
- FbExtraSchemaChecks: U8(1), // bExtraSchemaChecks
- FmxStrlen: 0x7ffffffe, // neverCorrupt
- FszLookaside: 1200, FnLookaside: 40, // szLookaside, nLookaside
- FnStmtSpill: (64 * 1024), // szMmap
+ FbMemstat: SQLITE_DEFAULT_MEMSTATUS, // bMemstat
+ FbCoreMutex: U8(1), // bCoreMutex
+ FbFullMutex: U8(libc.Bool32(SQLITE_THREADSAFE == 1)),
+ FbUseCis: U8(SQLITE_ALLOW_COVERING_INDEX_SCAN), // bSmallMalloc
+ FbExtraSchemaChecks: U8(1), // bExtraSchemaChecks
+ FmxStrlen: 0x7ffffffe, // neverCorrupt
+ FszLookaside: 1200, FnLookaside: 40, // szLookaside, nLookaside
+ FnStmtSpill: 64 * 1024,
FmxMmap: int64(SQLITE_MAX_MMAP_SIZE), // szPage
FnPage: SQLITE_DEFAULT_PCACHE_INITSZ, // sharedCacheEnabled
FszPma: U32(SQLITE_SORTER_PMASZ), // pLogArg
FmxMemdbSize: int64(SQLITE_MEMDB_DEFAULT_MAXSIZE), // bLocaltimeFault
FiOnceResetThreshold: 0x7ffffffe, // iOnceResetThreshold
FszSorterRef: U32(SQLITE_DEFAULT_SORTERREF_SIZE), // iPrngSeed
-} /* sqlite3.c:21032:48 */
+} /* sqlite3.c:21492:48 */
// Hash table for global functions - functions common to all
// database connections. After initialization, this table is
// read-only.
-var Xsqlite3BuiltinFunctions FuncDefHash /* sqlite3.c:21093:28: */
+var Xsqlite3BuiltinFunctions FuncDefHash /* sqlite3.c:21553:28: */
// The value of the "pending" byte must be 0x40000000 (1 byte past the
// 1-gibabyte boundary) in a compatible database. SQLite never uses
@@ -11526,21 +11928,61 @@ var Xsqlite3BuiltinFunctions FuncDefHash /* sqlite3.c:21093:28: */
// 0x40000000 results in an incompatible database file format!
// Changing the pending byte during operation will result in undefined
// and incorrect behavior.
-var Xsqlite3PendingByte int32 = 0x40000000 /* sqlite3.c:21122:20 */
+var Xsqlite3PendingByte int32 = 0x40000000 /* sqlite3.c:21594:20 */
// Tracing flags set by SQLITE_TESTCTRL_TRACEFLAGS.
-var Xsqlite3SelectTrace U32 = U32(0) /* sqlite3.c:21128:20 */
-var Xsqlite3WhereTrace U32 = U32(0) /* sqlite3.c:21129:20 */
+var Xsqlite3SelectTrace U32 = U32(0) /* sqlite3.c:21600:20 */
+var Xsqlite3WhereTrace U32 = U32(0) /* sqlite3.c:21601:20 */
// #include "opcodes.h"
// Properties of opcodes. The OPFLG_INITIALIZER macro is
// created by mkopcodeh.awk during compilation. Data is obtained
// from the comments following the "case OP_xxxx:" statements in
// the vdbe.c file.
-var Xsqlite3OpcodeProperty = [180]uint8{ /* 0 */ uint8(0x00), uint8(0x00), uint8(0x00), uint8(0x01), uint8(0x01), uint8(0x01), uint8(0x00), uint8(0x10) /* 8 */, uint8(0x00), uint8(0x01), uint8(0x00), uint8(0x01), uint8(0x01), uint8(0x01), uint8(0x03), uint8(0x03) /* 16 */, uint8(0x01), uint8(0x01), uint8(0x03), uint8(0x12), uint8(0x03), uint8(0x01), uint8(0x09), uint8(0x09) /* 24 */, uint8(0x09), uint8(0x09), uint8(0x01), uint8(0x09), uint8(0x09), uint8(0x09), uint8(0x09), uint8(0x09) /* 32 */, uint8(0x09), uint8(0x01), uint8(0x01), uint8(0x01), uint8(0x01), uint8(0x01), uint8(0x01), uint8(0x01) /* 40 */, uint8(0x01), uint8(0x01), uint8(0x23), uint8(0x26), uint8(0x26), uint8(0x0b), uint8(0x01), uint8(0x01) /* 48 */, uint8(0x03), uint8(0x03), uint8(0x03), uint8(0x03), uint8(0x0b), uint8(0x0b), uint8(0x0b), uint8(0x0b) /* 56 */, uint8(0x0b), uint8(0x0b), uint8(0x01), uint8(0x03), uint8(0x01), uint8(0x01), uint8(0x01), uint8(0x00) /* 64 */, uint8(0x00), uint8(0x02), uint8(0x02), uint8(0x08), uint8(0x00), uint8(0x10), uint8(0x10), uint8(0x10) /* 72 */, uint8(0x10), uint8(0x00), uint8(0x10), uint8(0x10), uint8(0x00), uint8(0x00), uint8(0x10), uint8(0x10) /* 80 */, uint8(0x00), uint8(0x00), uint8(0x00), uint8(0x02), uint8(0x02), uint8(0x02), uint8(0x00), uint8(0x00) /* 88 */, uint8(0x12), uint8(0x1e), uint8(0x20), uint8(0x00), uint8(0x00), uint8(0x00), uint8(0x10), uint8(0x10) /* 96 */, uint8(0x00), uint8(0x00), uint8(0x00), uint8(0x00), uint8(0x00), uint8(0x00), uint8(0x26), uint8(0x26) /* 104 */, uint8(0x26), uint8(0x26), uint8(0x26), uint8(0x26), uint8(0x26), uint8(0x26), uint8(0x26), uint8(0x26) /* 112 */, uint8(0x00), uint8(0x12), uint8(0x00), uint8(0x00), uint8(0x10), uint8(0x00), uint8(0x00), uint8(0x00) /* 120 */, uint8(0x00), uint8(0x00), uint8(0x10), uint8(0x10), uint8(0x00), uint8(0x00), uint8(0x00), uint8(0x00) /* 128 */, uint8(0x00), uint8(0x00), uint8(0x00), uint8(0x10), uint8(0x00), uint8(0x00), uint8(0x04), uint8(0x04) /* 136 */, uint8(0x00), uint8(0x00), uint8(0x10), uint8(0x00), uint8(0x10), uint8(0x00), uint8(0x00), uint8(0x10) /* 144 */, uint8(0x00), uint8(0x00), uint8(0x00), uint8(0x00), uint8(0x00), uint8(0x00), uint8(0x00), uint8(0x06) /* 152 */, uint8(0x10), uint8(0x10), uint8(0x00), uint8(0x04), uint8(0x1a), uint8(0x00), uint8(0x00), uint8(0x00) /* 160 */, uint8(0x00), uint8(0x00), uint8(0x00), uint8(0x00), uint8(0x00), uint8(0x00), uint8(0x00), uint8(0x00) /* 168 */, uint8(0x00), uint8(0x00), uint8(0x00), uint8(0x00), uint8(0x10), uint8(0x10), uint8(0x00), uint8(0x00) /* 176 */, uint8(0x00), uint8(0x00), uint8(0x00), uint8(0x00)} /* sqlite3.c:21138:36 */
+var Xsqlite3OpcodeProperty = [182]uint8{ /* 0 */ uint8(0x00), uint8(0x00), uint8(0x00), uint8(0x01), uint8(0x01), uint8(0x01), uint8(0x00), uint8(0x10) /* 8 */, uint8(0x00), uint8(0x01), uint8(0x00), uint8(0x01), uint8(0x01), uint8(0x01), uint8(0x03), uint8(0x03) /* 16 */, uint8(0x01), uint8(0x01), uint8(0x03), uint8(0x12), uint8(0x03), uint8(0x03), uint8(0x01), uint8(0x09) /* 24 */, uint8(0x09), uint8(0x09), uint8(0x09), uint8(0x01), uint8(0x09), uint8(0x09), uint8(0x09), uint8(0x09) /* 32 */, uint8(0x09), uint8(0x09), uint8(0x01), uint8(0x01), uint8(0x01), uint8(0x01), uint8(0x01), uint8(0x01) /* 40 */, uint8(0x01), uint8(0x01), uint8(0x01), uint8(0x26), uint8(0x26), uint8(0x23), uint8(0x0b), uint8(0x01) /* 48 */, uint8(0x01), uint8(0x03), uint8(0x03), uint8(0x03), uint8(0x0b), uint8(0x0b), uint8(0x0b), uint8(0x0b) /* 56 */, uint8(0x0b), uint8(0x0b), uint8(0x01), uint8(0x03), uint8(0x03), uint8(0x01), uint8(0x01), uint8(0x01) /* 64 */, uint8(0x00), uint8(0x00), uint8(0x02), uint8(0x02), uint8(0x08), uint8(0x00), uint8(0x10), uint8(0x10) /* 72 */, uint8(0x10), uint8(0x10), uint8(0x00), uint8(0x10), uint8(0x10), uint8(0x00), uint8(0x00), uint8(0x10) /* 80 */, uint8(0x10), uint8(0x00), uint8(0x00), uint8(0x00), uint8(0x02), uint8(0x02), uint8(0x02), uint8(0x00) /* 88 */, uint8(0x00), uint8(0x12), uint8(0x1e), uint8(0x20), uint8(0x00), uint8(0x00), uint8(0x00), uint8(0x00) /* 96 */, uint8(0x10), uint8(0x10), uint8(0x00), uint8(0x00), uint8(0x00), uint8(0x00), uint8(0x26), uint8(0x26) /* 104 */, uint8(0x26), uint8(0x26), uint8(0x26), uint8(0x26), uint8(0x26), uint8(0x26), uint8(0x26), uint8(0x26) /* 112 */, uint8(0x00), uint8(0x12), uint8(0x00), uint8(0x00), uint8(0x10), uint8(0x00), uint8(0x00), uint8(0x00) /* 120 */, uint8(0x00), uint8(0x00), uint8(0x00), uint8(0x00), uint8(0x10), uint8(0x10), uint8(0x00), uint8(0x00) /* 128 */, uint8(0x00), uint8(0x00), uint8(0x00), uint8(0x00), uint8(0x00), uint8(0x10), uint8(0x00), uint8(0x00) /* 136 */, uint8(0x04), uint8(0x04), uint8(0x00), uint8(0x00), uint8(0x10), uint8(0x00), uint8(0x10), uint8(0x00) /* 144 */, uint8(0x00), uint8(0x10), uint8(0x00), uint8(0x00), uint8(0x00), uint8(0x00), uint8(0x00), uint8(0x00) /* 152 */, uint8(0x10), uint8(0x00), uint8(0x06), uint8(0x10), uint8(0x00), uint8(0x04), uint8(0x1a), uint8(0x00) /* 160 */, uint8(0x00), uint8(0x00), uint8(0x00), uint8(0x00), uint8(0x00), uint8(0x00), uint8(0x00), uint8(0x00) /* 168 */, uint8(0x00), uint8(0x00), uint8(0x00), uint8(0x00), uint8(0x00), uint8(0x00), uint8(0x10), uint8(0x10) /* 176 */, uint8(0x00), uint8(0x00), uint8(0x00), uint8(0x00), uint8(0x00), uint8(0x00)} /* sqlite3.c:21610:36 */
// Name of the default collating sequence
-var Xsqlite3StrBINARY = *(*[7]uint8)(unsafe.Pointer(ts + 318 /* "BINARY" */)) /* sqlite3.c:21143:27 */
+var Xsqlite3StrBINARY = *(*[7]uint8)(unsafe.Pointer(ts + 1070 /* "BINARY" */)) /* sqlite3.c:21615:27 */
+
+// Standard typenames. These names must match the COLTYPE_* definitions.
+// Adjust the SQLITE_N_STDTYPE value if adding or removing entries.
+//
+// sqlite3StdType[] The actual names of the datatypes.
+//
+// sqlite3StdTypeLen[] The length (in bytes) of each entry
+// in sqlite3StdType[].
+//
+// sqlite3StdTypeAffinity[] The affinity associated with each entry
+// in sqlite3StdType[].
+//
+// sqlite3StdTypeMap[] The type value (as returned from
+// sqlite3_column_type() or sqlite3_value_type())
+// for each entry in sqlite3StdType[].
+var Xsqlite3StdTypeLen = [6]uint8{uint8(3), uint8(4), uint8(3), uint8(7), uint8(4), uint8(4)} /* sqlite3.c:21633:36 */
+var Xsqlite3StdTypeAffinity = [6]uint8{
+ uint8(SQLITE_AFF_NUMERIC),
+ uint8(SQLITE_AFF_BLOB),
+ uint8(SQLITE_AFF_INTEGER),
+ uint8(SQLITE_AFF_INTEGER),
+ uint8(SQLITE_AFF_REAL),
+ uint8(SQLITE_AFF_TEXT),
+} /* sqlite3.c:21634:27 */
+var Xsqlite3StdTypeMap = [6]uint8{
+ uint8(0),
+ uint8(SQLITE_BLOB),
+ uint8(SQLITE_INTEGER),
+ uint8(SQLITE_INTEGER),
+ uint8(SQLITE_FLOAT),
+ uint8(SQLITE_TEXT),
+} /* sqlite3.c:21642:27 */
+var Xsqlite3StdType = [6]uintptr{
+ ts + 1077, /* "ANY" */
+ ts + 1081, /* "BLOB" */
+ ts + 1086, /* "INT" */
+ ts + 1090, /* "INTEGER" */
+ ts + 1098, /* "REAL" */
+ ts + 1103, /* "TEXT" */
+} /* sqlite3.c:21650:27 */
//************* End of global.c *********************************************
//************* Begin file status.c *****************************************
@@ -11585,10 +12027,10 @@ var Xsqlite3StrBINARY = *(*[7]uint8)(unsafe.Pointer(ts + 318 /* "BINARY" */)) /*
// SQL is translated into a sequence of instructions to be
// executed by a virtual machine. Each instruction is an instance
// of the following structure.
-type Op = VdbeOp1 /* sqlite3.c:21210:23 */
+type Op = VdbeOp1 /* sqlite3.c:21724:23 */
// Boolean values
-type Bool = uint32 /* sqlite3.c:21215:18 */
+type Bool = uint32 /* sqlite3.c:21729:18 */
// Opaque type used by code in vdbesort.c
type VdbeSorter1 = struct {
@@ -11611,10 +12053,10 @@ type VdbeSorter1 = struct {
FtypeMask U8
F__ccgo_pad1 [3]byte
FaTask [1]SortSubtask
-} /* sqlite3.c:21218:9 */
+} /* sqlite3.c:21732:9 */
// Opaque type used by code in vdbesort.c
-type VdbeSorter = VdbeSorter1 /* sqlite3.c:21218:27 */
+type VdbeSorter = VdbeSorter1 /* sqlite3.c:21732:27 */
// Elements of the linked list at Vdbe.pAuxData
type AuxData1 = struct {
@@ -11623,10 +12065,10 @@ type AuxData1 = struct {
FpAux uintptr
FxDeleteAux uintptr
FpNextAux uintptr
-} /* sqlite3.c:1331:9 */
+} /* sqlite3.c:578:9 */
// Elements of the linked list at Vdbe.pAuxData
-type AuxData = AuxData1 /* sqlite3.c:21221:24 */
+type AuxData = AuxData1 /* sqlite3.c:21735:24 */
// Types of VDBE cursors
@@ -11668,7 +12110,7 @@ type VdbeCursor1 = struct {
FszRow U32
FaType [1]U32
F__ccgo_pad4 [4]byte
-} /* sqlite3.c:1331:9 */
+} /* sqlite3.c:578:9 */
// Types of VDBE cursors
@@ -11680,7 +12122,7 @@ type VdbeCursor1 = struct {
// * A sorter
// * A virtual table
// * A one-row "pseudotable" stored in a single register
-type VdbeCursor = VdbeCursor1 /* sqlite3.c:21239:27 */
+type VdbeCursor = VdbeCursor1 /* sqlite3.c:21753:27 */
// A value for VdbeCursor.cacheStatus that means the cache is always invalid.
@@ -11720,10 +12162,10 @@ type VdbeFrame1 = struct {
FnMem int32
FnChildMem int32
FnChildCsr int32
- FnChange int32
- FnDbChange int32
F__ccgo_pad1 [4]byte
-} /* sqlite3.c:1331:9 */
+ FnChange I64
+ FnDbChange I64
+} /* sqlite3.c:578:9 */
// A value for VdbeCursor.cacheStatus that means the cache is always invalid.
@@ -11746,7 +12188,7 @@ type VdbeFrame1 = struct {
//
// The currently executing frame is stored in Vdbe.pFrame. Vdbe.pFrame is
// set to NULL if the currently executing frame is the main program.
-type VdbeFrame = VdbeFrame1 /* sqlite3.c:21326:26 */
+type VdbeFrame = VdbeFrame1 /* sqlite3.c:21840:26 */
// Magic number for sanity checking on VdbeFrame objects
@@ -11756,11 +12198,11 @@ type VdbeFrame = VdbeFrame1 /* sqlite3.c:21326:26 */
// Internally, the vdbe manipulates nearly all SQL values as Mem
// structures. Each Mem struct may cache multiple representations (string,
// integer etc.) of the same value.
-type MemValue = struct{ Fr float64 } /* sqlite3.c:1331:9 */
+type MemValue = struct{ Fr float64 } /* sqlite3.c:578:9 */
// A bitfield type for use inside of structures. Always follow with :N where
// N is the number of bits.
-type Bft = uint32 /* sqlite3.c:21509:18 */ // Bit Field Type
+type Bft = uint32 /* sqlite3.c:22023:18 */ // Bit Field Type
// The ScanStatus object holds a single value for the
// sqlite3_stmt_scanstatus() interface.
@@ -11772,13 +12214,13 @@ type ScanStatus1 = struct {
FnEst LogEst
F__ccgo_pad1 [2]byte
FzName uintptr
-} /* sqlite3.c:21514:9 */
+} /* sqlite3.c:22028:9 */
// Bit Field Type
// The ScanStatus object holds a single value for the
// sqlite3_stmt_scanstatus() interface.
-type ScanStatus = ScanStatus1 /* sqlite3.c:21514:27 */
+type ScanStatus = ScanStatus1 /* sqlite3.c:22028:27 */
// The DblquoteStr object holds the text of a double-quoted
// string for a prepared statement. A linked list of these objects
@@ -11789,7 +12231,7 @@ type ScanStatus = ScanStatus1 /* sqlite3.c:21514:27 */
type DblquoteStr1 = struct {
FpNextStr uintptr
Fz [8]uint8
-} /* sqlite3.c:21531:9 */
+} /* sqlite3.c:22045:9 */
// The DblquoteStr object holds the text of a double-quoted
// string for a prepared statement. A linked list of these objects
@@ -11797,20 +12239,20 @@ type DblquoteStr1 = struct {
// When computing a normalized SQL statement for an SQL statement, that
// list is consulted for each double-quoted identifier to see if the
// identifier should really be a string literal.
-type DblquoteStr = DblquoteStr1 /* sqlite3.c:21531:28 */
+type DblquoteStr = DblquoteStr1 /* sqlite3.c:22045:28 */
//************* End of vdbeInt.h ********************************************
//************* Continuing where we left off in status.c ********************
// Variables in which to record status information.
-type Sqlite3StatValueType = U32 /* sqlite3.c:21801:13 */
+type Sqlite3StatValueType = U32 /* sqlite3.c:22320:13 */
type sqlite3StatType = struct {
FnowValue [10]Sqlite3StatValueType
FmxValue [10]Sqlite3StatValueType
-} /* sqlite3.c:21803:9 */
+} /* sqlite3.c:22322:9 */
-type Sqlite3StatType = sqlite3StatType /* sqlite3.c:21803:32 */
-var sqlite3Stat = sqlite3StatType{} /* sqlite3.c:21807:3 */
+type Sqlite3StatType = sqlite3StatType /* sqlite3.c:22322:32 */
+var sqlite3Stat = sqlite3StatType{} /* sqlite3.c:22326:3 */
// Elements of sqlite3Stat[] are protected by either the memory allocator
// mutex, or by the pcache1 mutex. The following array determines which.
@@ -11825,7 +12267,7 @@ var statMutex = [10]uint8{
uint8(1), // SQLITE_STATUS_PAGECACHE_SIZE
uint8(0), // SQLITE_STATUS_SCRATCH_SIZE
uint8(0), // SQLITE_STATUS_MALLOC_COUNT
-} /* sqlite3.c:21813:19 */
+} /* sqlite3.c:22332:19 */
// The "wsdStat" macro will resolve to the status information
// state vector. If writable static data is unsupported on the target,
@@ -11835,9 +12277,9 @@ var statMutex = [10]uint8{
// Return the current value of a status parameter. The caller must
// be holding the appropriate mutex.
-func Xsqlite3StatusValue(tls *libc.TLS, op int32) Sqlite3_int64 { /* sqlite3.c:21845:30: */
+func Xsqlite3StatusValue(tls *libc.TLS, op int32) Sqlite3_int64 { /* sqlite3.c:22364:30: */
- return Sqlite3_int64(*(*Sqlite3StatValueType)(unsafe.Pointer((uintptr(unsafe.Pointer(&sqlite3Stat)) /* &.nowValue */) + uintptr(op)*4)))
+ return Sqlite3_int64(*(*Sqlite3StatValueType)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Stat)) + uintptr(op)*4)))
}
// Add N to the value of a status record. The caller must hold the
@@ -11849,38 +12291,38 @@ func Xsqlite3StatusValue(tls *libc.TLS, op int32) Sqlite3_int64 { /* sqlite3.c:2
//
// The StatusDown() routine lowers the current value by N. The highwater
// mark is unchanged. N must be non-negative for StatusDown().
-func Xsqlite3StatusUp(tls *libc.TLS, op int32, N int32) { /* sqlite3.c:21865:21: */
+func Xsqlite3StatusUp(tls *libc.TLS, op int32, N int32) { /* sqlite3.c:22384:21: */
- *(*Sqlite3StatValueType)(unsafe.Pointer((uintptr(unsafe.Pointer(&sqlite3Stat)) /* &.nowValue */) + uintptr(op)*4)) += (Sqlite3StatValueType(N))
- if *(*Sqlite3StatValueType)(unsafe.Pointer((uintptr(unsafe.Pointer(&sqlite3Stat)) /* &.nowValue */) + uintptr(op)*4)) > *(*Sqlite3StatValueType)(unsafe.Pointer((uintptr(unsafe.Pointer(&sqlite3Stat)) + 40 /* &.mxValue */) + uintptr(op)*4)) {
- *(*Sqlite3StatValueType)(unsafe.Pointer((uintptr(unsafe.Pointer(&sqlite3Stat)) + 40 /* &.mxValue */) + uintptr(op)*4)) = *(*Sqlite3StatValueType)(unsafe.Pointer((uintptr(unsafe.Pointer(&sqlite3Stat)) /* &.nowValue */) + uintptr(op)*4))
+ *(*Sqlite3StatValueType)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Stat)) + uintptr(op)*4)) += Sqlite3StatValueType(N)
+ if *(*Sqlite3StatValueType)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Stat)) + uintptr(op)*4)) > *(*Sqlite3StatValueType)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Stat)) + 40 + uintptr(op)*4)) {
+ *(*Sqlite3StatValueType)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Stat)) + 40 + uintptr(op)*4)) = *(*Sqlite3StatValueType)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Stat)) + uintptr(op)*4))
}
}
-func Xsqlite3StatusDown(tls *libc.TLS, op int32, N int32) { /* sqlite3.c:21876:21: */
+func Xsqlite3StatusDown(tls *libc.TLS, op int32, N int32) { /* sqlite3.c:22395:21: */
- *(*Sqlite3StatValueType)(unsafe.Pointer((uintptr(unsafe.Pointer(&sqlite3Stat)) /* &.nowValue */) + uintptr(op)*4)) -= (Sqlite3StatValueType(N))
+ *(*Sqlite3StatValueType)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Stat)) + uintptr(op)*4)) -= Sqlite3StatValueType(N)
}
// Adjust the highwater mark if necessary.
// The caller must hold the appropriate mutex.
-func Xsqlite3StatusHighwater(tls *libc.TLS, op int32, X int32) { /* sqlite3.c:21890:21: */
+func Xsqlite3StatusHighwater(tls *libc.TLS, op int32, X int32) { /* sqlite3.c:22409:21: */
var newValue Sqlite3StatValueType
newValue = Sqlite3StatValueType(X)
- if newValue > *(*Sqlite3StatValueType)(unsafe.Pointer((uintptr(unsafe.Pointer(&sqlite3Stat)) + 40 /* &.mxValue */) + uintptr(op)*4)) {
- *(*Sqlite3StatValueType)(unsafe.Pointer((uintptr(unsafe.Pointer(&sqlite3Stat)) + 40 /* &.mxValue */) + uintptr(op)*4)) = newValue
+ if newValue > *(*Sqlite3StatValueType)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Stat)) + 40 + uintptr(op)*4)) {
+ *(*Sqlite3StatValueType)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Stat)) + 40 + uintptr(op)*4)) = newValue
}
}
// Query status information.
-func Xsqlite3_status64(tls *libc.TLS, op int32, pCurrent uintptr, pHighwater uintptr, resetFlag int32) int32 { /* sqlite3.c:21910:16: */
+func Xsqlite3_status64(tls *libc.TLS, op int32, pCurrent uintptr, pHighwater uintptr, resetFlag int32) int32 { /* sqlite3.c:22429:16: */
var pMutex uintptr
_ = pMutex
- if (op < 0) || (op >= (int32(uint32(unsafe.Sizeof([10]Sqlite3StatValueType{})) / uint32(unsafe.Sizeof(Sqlite3StatValueType(0)))))) {
- return Xsqlite3MisuseError(tls, 21919)
+ if op < 0 || op >= int32(uint32(unsafe.Sizeof([10]Sqlite3StatValueType{}))/uint32(unsafe.Sizeof(Sqlite3StatValueType(0)))) {
+ return Xsqlite3MisuseError(tls, 22438)
}
if statMutex[op] != 0 {
pMutex = Xsqlite3Pcache1Mutex(tls)
@@ -11888,17 +12330,17 @@ func Xsqlite3_status64(tls *libc.TLS, op int32, pCurrent uintptr, pHighwater uin
pMutex = Xsqlite3MallocMutex(tls)
}
Xsqlite3_mutex_enter(tls, pMutex)
- *(*Sqlite3_int64)(unsafe.Pointer(pCurrent)) = Sqlite3_int64(*(*Sqlite3StatValueType)(unsafe.Pointer((uintptr(unsafe.Pointer(&sqlite3Stat)) /* &.nowValue */) + uintptr(op)*4)))
- *(*Sqlite3_int64)(unsafe.Pointer(pHighwater)) = Sqlite3_int64(*(*Sqlite3StatValueType)(unsafe.Pointer((uintptr(unsafe.Pointer(&sqlite3Stat)) + 40 /* &.mxValue */) + uintptr(op)*4)))
+ *(*Sqlite3_int64)(unsafe.Pointer(pCurrent)) = Sqlite3_int64(*(*Sqlite3StatValueType)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Stat)) + uintptr(op)*4)))
+ *(*Sqlite3_int64)(unsafe.Pointer(pHighwater)) = Sqlite3_int64(*(*Sqlite3StatValueType)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Stat)) + 40 + uintptr(op)*4)))
if resetFlag != 0 {
- *(*Sqlite3StatValueType)(unsafe.Pointer((uintptr(unsafe.Pointer(&sqlite3Stat)) + 40 /* &.mxValue */) + uintptr(op)*4)) = *(*Sqlite3StatValueType)(unsafe.Pointer((uintptr(unsafe.Pointer(&sqlite3Stat)) /* &.nowValue */) + uintptr(op)*4))
+ *(*Sqlite3StatValueType)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Stat)) + 40 + uintptr(op)*4)) = *(*Sqlite3StatValueType)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Stat)) + uintptr(op)*4))
}
Xsqlite3_mutex_leave(tls, pMutex)
_ = pMutex // Prevent warning when SQLITE_THREADSAFE=0
return SQLITE_OK
}
-func Xsqlite3_status(tls *libc.TLS, op int32, pCurrent uintptr, pHighwater uintptr, resetFlag int32) int32 { /* sqlite3.c:21935:16: */
+func Xsqlite3_status(tls *libc.TLS, op int32, pCurrent uintptr, pHighwater uintptr, resetFlag int32) int32 { /* sqlite3.c:22454:16: */
bp := tls.Alloc(16)
defer tls.Free(16)
@@ -11914,7 +12356,7 @@ func Xsqlite3_status(tls *libc.TLS, op int32, pCurrent uintptr, pHighwater uintp
}
// Return the number of LookasideSlot elements on the linked list
-func countLookasideSlots(tls *libc.TLS, p uintptr) U32 { /* sqlite3.c:21952:12: */
+func countLookasideSlots(tls *libc.TLS, p uintptr) U32 { /* sqlite3.c:22471:12: */
var cnt U32 = U32(0)
for p != 0 {
p = (*LookasideSlot)(unsafe.Pointer(p)).FpNext
@@ -11924,19 +12366,19 @@ func countLookasideSlots(tls *libc.TLS, p uintptr) U32 { /* sqlite3.c:21952:12:
}
// Count the number of slots of lookaside memory that are outstanding
-func Xsqlite3LookasideUsed(tls *libc.TLS, db uintptr, pHighwater uintptr) int32 { /* sqlite3.c:21964:20: */
+func Xsqlite3LookasideUsed(tls *libc.TLS, db uintptr, pHighwater uintptr) int32 { /* sqlite3.c:22483:20: */
var nInit U32 = countLookasideSlots(tls, (*Sqlite3)(unsafe.Pointer(db)).Flookaside.FpInit)
var nFree U32 = countLookasideSlots(tls, (*Sqlite3)(unsafe.Pointer(db)).Flookaside.FpFree)
- nInit = nInit + (countLookasideSlots(tls, (*Sqlite3)(unsafe.Pointer(db)).Flookaside.FpSmallInit))
- nFree = nFree + (countLookasideSlots(tls, (*Sqlite3)(unsafe.Pointer(db)).Flookaside.FpSmallFree))
+ nInit = nInit + countLookasideSlots(tls, (*Sqlite3)(unsafe.Pointer(db)).Flookaside.FpSmallInit)
+ nFree = nFree + countLookasideSlots(tls, (*Sqlite3)(unsafe.Pointer(db)).Flookaside.FpSmallFree)
if pHighwater != 0 {
- *(*int32)(unsafe.Pointer(pHighwater)) = (int32((*Sqlite3)(unsafe.Pointer(db)).Flookaside.FnSlot - nInit))
+ *(*int32)(unsafe.Pointer(pHighwater)) = int32((*Sqlite3)(unsafe.Pointer(db)).Flookaside.FnSlot - nInit)
}
- return (int32((*Sqlite3)(unsafe.Pointer(db)).Flookaside.FnSlot - (nInit + nFree)))
+ return int32((*Sqlite3)(unsafe.Pointer(db)).Flookaside.FnSlot - (nInit + nFree))
}
// Query status information for a single database connection
-func Xsqlite3_db_status(tls *libc.TLS, db uintptr, op int32, pCurrent uintptr, pHighwater uintptr, resetFlag int32) int32 { /* sqlite3.c:21978:16: */
+func Xsqlite3_db_status(tls *libc.TLS, db uintptr, op int32, pCurrent uintptr, pHighwater uintptr, resetFlag int32) int32 { /* sqlite3.c:22497:16: */
bp := tls.Alloc(12)
defer tls.Free(12)
@@ -11978,9 +12420,9 @@ func Xsqlite3_db_status(tls *libc.TLS, db uintptr, op int32, pCurrent uintptr, p
{
*(*int32)(unsafe.Pointer(pCurrent)) = 0
- *(*int32)(unsafe.Pointer(pHighwater)) = int32(*(*U32)(unsafe.Pointer((db + 296 /* &.lookaside */ + 16 /* &.anStat */) + uintptr((op-SQLITE_DBSTATUS_LOOKASIDE_HIT))*4)))
+ *(*int32)(unsafe.Pointer(pHighwater)) = int32(*(*U32)(unsafe.Pointer(db + 320 + 16 + uintptr(op-SQLITE_DBSTATUS_LOOKASIDE_HIT)*4)))
if resetFlag != 0 {
- *(*U32)(unsafe.Pointer((db + 296 /* &.lookaside */ + 16 /* &.anStat */) + uintptr((op-SQLITE_DBSTATUS_LOOKASIDE_HIT))*4)) = U32(0)
+ *(*U32)(unsafe.Pointer(db + 320 + 16 + uintptr(op-SQLITE_DBSTATUS_LOOKASIDE_HIT)*4)) = U32(0)
}
break
@@ -12002,9 +12444,9 @@ func Xsqlite3_db_status(tls *libc.TLS, db uintptr, op int32, pCurrent uintptr, p
var pPager uintptr = Xsqlite3BtreePager(tls, pBt)
var nByte int32 = Xsqlite3PagerMemUsed(tls, pPager)
if op == SQLITE_DBSTATUS_CACHE_USED_SHARED {
- nByte = (nByte / Xsqlite3BtreeConnectionCount(tls, pBt))
+ nByte = nByte / Xsqlite3BtreeConnectionCount(tls, pBt)
}
- totalUsed = totalUsed + (nByte)
+ totalUsed = totalUsed + nByte
}
}
Xsqlite3BtreeLeaveAll(tls, db)
@@ -12029,19 +12471,19 @@ func Xsqlite3_db_status(tls *libc.TLS, db uintptr, op int32, pCurrent uintptr, p
if pSchema != uintptr(0) {
var p uintptr
- *(*int32)(unsafe.Pointer(bp /* nByte */)) += int32((uint32((*struct{ f func(*libc.TLS, int32) int32 })(unsafe.Pointer(&struct{ uintptr }{Xsqlite3Config.Fm.FxRoundup})).f(tls, int32(unsafe.Sizeof(HashElem{})))) * ((((*Schema)(unsafe.Pointer(pSchema)).FtblHash.Fcount +
- (*Schema)(unsafe.Pointer(pSchema)).FtrigHash.Fcount) +
- (*Schema)(unsafe.Pointer(pSchema)).FidxHash.Fcount) +
- (*Schema)(unsafe.Pointer(pSchema)).FfkeyHash.Fcount)))
+ *(*int32)(unsafe.Pointer(bp /* nByte */)) += int32(uint32((*struct{ f func(*libc.TLS, int32) int32 })(unsafe.Pointer(&struct{ uintptr }{Xsqlite3Config.Fm.FxRoundup})).f(tls, int32(unsafe.Sizeof(HashElem{})))) * ((*Schema)(unsafe.Pointer(pSchema)).FtblHash.Fcount +
+ (*Schema)(unsafe.Pointer(pSchema)).FtrigHash.Fcount +
+ (*Schema)(unsafe.Pointer(pSchema)).FidxHash.Fcount +
+ (*Schema)(unsafe.Pointer(pSchema)).FfkeyHash.Fcount))
*(*int32)(unsafe.Pointer(bp /* nByte */)) += int32(Xsqlite3_msize(tls, (*Schema)(unsafe.Pointer(pSchema)).FtblHash.Fht))
*(*int32)(unsafe.Pointer(bp /* nByte */)) += int32(Xsqlite3_msize(tls, (*Schema)(unsafe.Pointer(pSchema)).FtrigHash.Fht))
*(*int32)(unsafe.Pointer(bp /* nByte */)) += int32(Xsqlite3_msize(tls, (*Schema)(unsafe.Pointer(pSchema)).FidxHash.Fht))
*(*int32)(unsafe.Pointer(bp /* nByte */)) += int32(Xsqlite3_msize(tls, (*Schema)(unsafe.Pointer(pSchema)).FfkeyHash.Fht))
- for p = (*Hash)(unsafe.Pointer((pSchema + 40 /* &.trigHash */))).Ffirst; p != 0; p = (*HashElem)(unsafe.Pointer(p)).Fnext {
+ for p = (*Hash)(unsafe.Pointer(pSchema + 40)).Ffirst; p != 0; p = (*HashElem)(unsafe.Pointer(p)).Fnext {
Xsqlite3DeleteTrigger(tls, db, (*HashElem)(unsafe.Pointer(p)).Fdata)
}
- for p = (*Hash)(unsafe.Pointer((pSchema + 8 /* &.tblHash */))).Ffirst; p != 0; p = (*HashElem)(unsafe.Pointer(p)).Fnext {
+ for p = (*Hash)(unsafe.Pointer(pSchema + 8)).Ffirst; p != 0; p = (*HashElem)(unsafe.Pointer(p)).Fnext {
Xsqlite3DeleteTable(tls, db, (*HashElem)(unsafe.Pointer(p)).Fdata)
}
}
@@ -12081,7 +12523,7 @@ func Xsqlite3_db_status(tls *libc.TLS, db uintptr, op int32, pCurrent uintptr, p
// pagers the database handle is connected to. *pHighwater is always set
// to zero.
case SQLITE_DBSTATUS_CACHE_SPILL:
- op = (SQLITE_DBSTATUS_CACHE_WRITE + 1)
+ op = SQLITE_DBSTATUS_CACHE_WRITE + 1
fallthrough
case SQLITE_DBSTATUS_CACHE_HIT:
fallthrough
@@ -12112,7 +12554,7 @@ func Xsqlite3_db_status(tls *libc.TLS, db uintptr, op int32, pCurrent uintptr, p
case SQLITE_DBSTATUS_DEFERRED_FKS:
{
*(*int32)(unsafe.Pointer(pHighwater)) = 0 // IMP: R-11967-56545
- *(*int32)(unsafe.Pointer(pCurrent)) = (libc.Bool32(((*Sqlite3)(unsafe.Pointer(db)).FnDeferredImmCons > int64(0)) || ((*Sqlite3)(unsafe.Pointer(db)).FnDeferredCons > int64(0))))
+ *(*int32)(unsafe.Pointer(pCurrent)) = libc.Bool32((*Sqlite3)(unsafe.Pointer(db)).FnDeferredImmCons > int64(0) || (*Sqlite3)(unsafe.Pointer(db)).FnDeferredCons > int64(0))
break
}
@@ -12175,7 +12617,7 @@ func Xsqlite3_db_status(tls *libc.TLS, db uintptr, op int32, pCurrent uintptr, p
// #include "sqliteInt.h"
// #include <stdlib.h>
// #include <assert.h>
-// Copyright (C) 1991-2018 Free Software Foundation, Inc.
+// Copyright (C) 1991-2020 Free Software Foundation, Inc.
// This file is part of the GNU C Library.
//
// The GNU C Library is free software; you can redistribute it and/or
@@ -12190,11 +12632,11 @@ func Xsqlite3_db_status(tls *libc.TLS, db uintptr, op int32, pCurrent uintptr, p
//
// You should have received a copy of the GNU Lesser General Public
// License along with the GNU C Library; if not, see
-// <http://www.gnu.org/licenses/>.
+// <https://www.gnu.org/licenses/>.
// ISO C99 Standard: 7.23 Date and time <time.h>
-// Copyright (C) 1991-2018 Free Software Foundation, Inc.
+// Copyright (C) 1991-2020 Free Software Foundation, Inc.
// This file is part of the GNU C Library.
//
// The GNU C Library is free software; you can redistribute it and/or
@@ -12209,9 +12651,9 @@ func Xsqlite3_db_status(tls *libc.TLS, db uintptr, op int32, pCurrent uintptr, p
//
// You should have received a copy of the GNU Lesser General Public
// License along with the GNU C Library; if not, see
-// <http://www.gnu.org/licenses/>.
+// <https://www.gnu.org/licenses/>.
-// Copyright (C) 1989-2018 Free Software Foundation, Inc.
+// Copyright (C) 1989-2020 Free Software Foundation, Inc.
//
// This file is part of GCC.
//
@@ -12243,15 +12685,6 @@ func Xsqlite3_db_status(tls *libc.TLS, db uintptr, op int32, pCurrent uintptr, p
// This avoids lossage on SunOS but only if stdtypes.h comes first.
// There's no way to win with the other order! Sun lossage.
-// On 4.3bsd-net2, make sure ansi.h is included, so we have
-// one less case to deal with in the following.
-// On FreeBSD 5, machine/ansi.h does not exist anymore...
-
-// In 4.3bsd-net2, machine/ansi.h defines these symbols, which are
-// defined if the corresponding type is *not* defined.
-// FreeBSD-2.1 defines _MACHINE_ANSI_H_ instead of _ANSI_H_.
-// NetBSD defines _I386_ANSI_H_ and _X86_64_ANSI_H_ instead of _ANSI_H_
-
// Sequent's header files use _PTRDIFF_T_ in some conflicting way.
// Just ignore it.
@@ -12288,11 +12721,6 @@ func Xsqlite3_db_status(tls *libc.TLS, db uintptr, op int32, pCurrent uintptr, p
// Define this type if we are doing the whole job,
// or if we want this type in particular.
-// In 4.3bsd-net2, leave these undefined to indicate that size_t, etc.
-// are already defined.
-// BSD/OS 3.1 and FreeBSD [23].x require the MACHINE_ANSI_H check here.
-// NetBSD 5 requires the I386_ANSI_H and X86_64_ANSI_H checks here.
-
// A null pointer constant.
// Offset of member MEMBER in a struct of type TYPE.
@@ -12300,7 +12728,7 @@ func Xsqlite3_db_status(tls *libc.TLS, db uintptr, op int32, pCurrent uintptr, p
// This defines CLOCKS_PER_SEC, which is the number of processor clock
// ticks per second, and possibly a number of other constants.
// System-dependent timing definitions. Linux version.
-// Copyright (C) 1996-2018 Free Software Foundation, Inc.
+// Copyright (C) 1996-2020 Free Software Foundation, Inc.
// This file is part of the GNU C Library.
//
// The GNU C Library is free software; you can redistribute it and/or
@@ -12315,12 +12743,12 @@ func Xsqlite3_db_status(tls *libc.TLS, db uintptr, op int32, pCurrent uintptr, p
//
// You should have received a copy of the GNU Lesser General Public
// License along with the GNU C Library; if not, see
-// <http://www.gnu.org/licenses/>.
+// <https://www.gnu.org/licenses/>.
// Never include this file directly; use <time.h> instead.
// bits/types.h -- definitions of __*_t types underlying *_t types.
-// Copyright (C) 2002-2018 Free Software Foundation, Inc.
+// Copyright (C) 2002-2020 Free Software Foundation, Inc.
// This file is part of the GNU C Library.
//
// The GNU C Library is free software; you can redistribute it and/or
@@ -12335,7 +12763,7 @@ func Xsqlite3_db_status(tls *libc.TLS, db uintptr, op int32, pCurrent uintptr, p
//
// You should have received a copy of the GNU Lesser General Public
// License along with the GNU C Library; if not, see
-// <http://www.gnu.org/licenses/>.
+// <https://www.gnu.org/licenses/>.
// Never include this file directly; use <sys/types.h> instead.
@@ -12360,7 +12788,7 @@ func Xsqlite3_db_status(tls *libc.TLS, db uintptr, op int32, pCurrent uintptr, p
// Flag to indicate time is absolute.
-// Copyright (C) 1995-2018 Free Software Foundation, Inc.
+// Copyright (C) 1995-2020 Free Software Foundation, Inc.
// This file is part of the GNU C Library.
//
// The GNU C Library is free software; you can redistribute it and/or
@@ -12375,10 +12803,10 @@ func Xsqlite3_db_status(tls *libc.TLS, db uintptr, op int32, pCurrent uintptr, p
//
// You should have received a copy of the GNU Lesser General Public
// License along with the GNU C Library; if not, see
-// <http://www.gnu.org/licenses/>.
+// <https://www.gnu.org/licenses/>.
// bits/types.h -- definitions of __*_t types underlying *_t types.
-// Copyright (C) 2002-2018 Free Software Foundation, Inc.
+// Copyright (C) 2002-2020 Free Software Foundation, Inc.
// This file is part of the GNU C Library.
//
// The GNU C Library is free software; you can redistribute it and/or
@@ -12393,7 +12821,7 @@ func Xsqlite3_db_status(tls *libc.TLS, db uintptr, op int32, pCurrent uintptr, p
//
// You should have received a copy of the GNU Lesser General Public
// License along with the GNU C Library; if not, see
-// <http://www.gnu.org/licenses/>.
+// <https://www.gnu.org/licenses/>.
// Never include this file directly; use <sys/types.h> instead.
@@ -12440,7 +12868,7 @@ type timex = struct {
// may also need to be defined by other headers.
// bits/types.h -- definitions of __*_t types underlying *_t types.
-// Copyright (C) 2002-2018 Free Software Foundation, Inc.
+// Copyright (C) 2002-2020 Free Software Foundation, Inc.
// This file is part of the GNU C Library.
//
// The GNU C Library is free software; you can redistribute it and/or
@@ -12455,7 +12883,7 @@ type timex = struct {
//
// You should have received a copy of the GNU Lesser General Public
// License along with the GNU C Library; if not, see
-// <http://www.gnu.org/licenses/>.
+// <https://www.gnu.org/licenses/>.
// Never include this file directly; use <sys/types.h> instead.
@@ -12477,7 +12905,7 @@ type tm = struct {
// NB: Include guard matches what <linux/time.h> uses.
// bits/types.h -- definitions of __*_t types underlying *_t types.
-// Copyright (C) 2002-2018 Free Software Foundation, Inc.
+// Copyright (C) 2002-2020 Free Software Foundation, Inc.
// This file is part of the GNU C Library.
//
// The GNU C Library is free software; you can redistribute it and/or
@@ -12492,7 +12920,7 @@ type tm = struct {
//
// You should have received a copy of the GNU Lesser General Public
// License along with the GNU C Library; if not, see
-// <http://www.gnu.org/licenses/>.
+// <https://www.gnu.org/licenses/>.
// Never include this file directly; use <sys/types.h> instead.
@@ -12532,14 +12960,14 @@ type DateTime1 = struct {
FtzSet uint8
FisError uint8
F__ccgo_pad1 [1]byte
-} /* sqlite3.c:22238:9 */
+} /* sqlite3.c:22757:9 */
// The MSVC CRT on Windows CE may not have a localtime() function.
// So declare a substitute. The substitute function itself is
// defined in "os_win.c".
// A structure for holding a single date and time.
-type DateTime = DateTime1 /* sqlite3.c:22238:25 */
+type DateTime = DateTime1 /* sqlite3.c:22757:25 */
// Convert zDate into one or more integers according to the conversion
// specifier zFormat.
@@ -12566,7 +12994,7 @@ type DateTime = DateTime1 /* sqlite3.c:22238:25 */
// the 2-digit day which is the last integer in the set.
//
// The function returns the number of successful conversions.
-func getDigits(tls *libc.TLS, zDate uintptr, zFormat uintptr, va uintptr) int32 { /* sqlite3.c:22282:12: */
+func getDigits(tls *libc.TLS, zDate uintptr, zFormat uintptr, va uintptr) int32 { /* sqlite3.c:22801:12: */
var ap Va_list
_ = ap
var cnt int32
@@ -12578,29 +13006,29 @@ func getDigits(tls *libc.TLS, zDate uintptr, zFormat uintptr, va uintptr) int32
cnt = 0
ap = va
__1:
- N = (uint8(int32(*(*uint8)(unsafe.Pointer(zFormat))) - '0'))
- min = (uint8(int32(*(*uint8)(unsafe.Pointer(zFormat + 1))) - '0'))
+ N = uint8(int32(*(*uint8)(unsafe.Pointer(zFormat))) - '0')
+ min = uint8(int32(*(*uint8)(unsafe.Pointer(zFormat + 1))) - '0')
val = 0
- max = aMx[(int32(*(*uint8)(unsafe.Pointer(zFormat + 2))) - 'a')]
+ max = aMx[int32(*(*uint8)(unsafe.Pointer(zFormat + 2)))-'a']
nextC = *(*uint8)(unsafe.Pointer(zFormat + 3))
val = 0
__4:
if !(libc.PostDecUint8(&N, 1) != 0) {
goto __5
}
- if !(!((int32(Xsqlite3CtypeMap[uint8(*(*uint8)(unsafe.Pointer(zDate)))]) & 0x04) != 0)) {
+ if !!(int32(Xsqlite3CtypeMap[uint8(*(*uint8)(unsafe.Pointer(zDate)))])&0x04 != 0) {
goto __6
}
goto end_getDigits
__6:
;
- val = (((val * 10) + int32(*(*uint8)(unsafe.Pointer(zDate)))) - '0')
+ val = val*10 + int32(*(*uint8)(unsafe.Pointer(zDate))) - '0'
zDate++
goto __4
__5:
;
- if !(((val < int32(min)) || (val > int32(max))) || ((int32(nextC) != 0) && (int32(nextC) != int32(*(*uint8)(unsafe.Pointer(zDate)))))) {
+ if !(val < int32(min) || val > int32(max) || int32(nextC) != 0 && int32(nextC) != int32(*(*uint8)(unsafe.Pointer(zDate)))) {
goto __7
}
goto end_getDigits
@@ -12623,7 +13051,7 @@ end_getDigits:
return cnt
}
-var aMx = [6]U16{U16(12), U16(14), U16(24), U16(31), U16(59), U16(9999)} /* sqlite3.c:22285:20 */
+var aMx = [6]U16{U16(12), U16(14), U16(24), U16(31), U16(59), U16(9999)} /* sqlite3.c:22804:20 */
// Parse a timezone extension on the end of a date-time.
// The extension is of the form:
@@ -12639,7 +13067,7 @@ var aMx = [6]U16{U16(12), U16(14), U16(24), U16(31), U16(59), U16(9999)} /* sqli
// return non-zero.
//
// A missing specifier is not considered an error.
-func parseTimezone(tls *libc.TLS, zDate uintptr, p uintptr) int32 { /* sqlite3.c:22336:12: */
+func parseTimezone(tls *libc.TLS, zDate uintptr, p uintptr) int32 { /* sqlite3.c:22855:12: */
bp := tls.Alloc(24)
defer tls.Free(24)
@@ -12651,7 +13079,7 @@ func parseTimezone(tls *libc.TLS, zDate uintptr, p uintptr) int32 { /* sqlite3.c
var c int32
sgn = 0
__1:
- if !((int32(Xsqlite3CtypeMap[uint8(*(*uint8)(unsafe.Pointer(zDate)))]) & 0x01) != 0) {
+ if !(int32(Xsqlite3CtypeMap[uint8(*(*uint8)(unsafe.Pointer(zDate)))])&0x01 != 0) {
goto __2
}
zDate++
@@ -12672,14 +13100,14 @@ __3:
sgn = +1
goto __6
__5:
- if !((c == 'Z') || (c == 'z')) {
+ if !(c == 'Z' || c == 'z') {
goto __7
}
zDate++
goto zulu_time
goto __8
__7:
- return (libc.Bool32(c != 0))
+ return libc.Bool32(c != 0)
__8:
;
__6:
@@ -12687,17 +13115,17 @@ __6:
__4:
;
zDate++
- if !(getDigits(tls, zDate, ts+325 /* "20b:20e" */, libc.VaList(bp, bp+16 /* &nHr */, bp+20 /* &nMn */)) != 2) {
+ if !(getDigits(tls, zDate, ts+1108, libc.VaList(bp, bp+16, bp+20)) != 2) {
goto __9
}
return 1
__9:
;
zDate += uintptr(5)
- (*DateTime)(unsafe.Pointer(p)).Ftz = (sgn * (*(*int32)(unsafe.Pointer(bp + 20 /* nMn */)) + (*(*int32)(unsafe.Pointer(bp + 16 /* nHr */)) * 60)))
+ (*DateTime)(unsafe.Pointer(p)).Ftz = sgn * (*(*int32)(unsafe.Pointer(bp + 20)) + *(*int32)(unsafe.Pointer(bp + 16))*60)
zulu_time:
__10:
- if !((int32(Xsqlite3CtypeMap[uint8(*(*uint8)(unsafe.Pointer(zDate)))]) & 0x01) != 0) {
+ if !(int32(Xsqlite3CtypeMap[uint8(*(*uint8)(unsafe.Pointer(zDate)))])&0x01 != 0) {
goto __11
}
zDate++
@@ -12705,7 +13133,7 @@ __10:
__11:
;
(*DateTime)(unsafe.Pointer(p)).FtzSet = uint8(1)
- return (libc.Bool32(int32(*(*uint8)(unsafe.Pointer(zDate))) != 0))
+ return libc.Bool32(int32(*(*uint8)(unsafe.Pointer(zDate))) != 0)
}
// Parse times of the form HH:MM or HH:MM:SS or HH:MM:SS.FFFF.
@@ -12713,7 +13141,7 @@ __11:
// fractional seconds FFFF can be one or more digits.
//
// Return 1 if there is a parsing error and 0 on success.
-func parseHhMmSs(tls *libc.TLS, zDate uintptr, p uintptr) int32 { /* sqlite3.c:22372:12: */
+func parseHhMmSs(tls *libc.TLS, zDate uintptr, p uintptr) int32 { /* sqlite3.c:22891:12: */
bp := tls.Alloc(36)
defer tls.Free(36)
@@ -12724,25 +13152,25 @@ func parseHhMmSs(tls *libc.TLS, zDate uintptr, p uintptr) int32 { /* sqlite3.c:2
// var s int32 at bp+32, 4
var ms float64 = 0.0
- if getDigits(tls, zDate, ts+333 /* "20c:20e" */, libc.VaList(bp, bp+24 /* &h */, bp+28 /* &m */)) != 2 {
+ if getDigits(tls, zDate, ts+1116, libc.VaList(bp, bp+24, bp+28)) != 2 {
return 1
}
zDate += uintptr(5)
if int32(*(*uint8)(unsafe.Pointer(zDate))) == ':' {
zDate++
- if getDigits(tls, zDate, ts+341 /* "20e" */, libc.VaList(bp+16, bp+32 /* &s */)) != 1 {
+ if getDigits(tls, zDate, ts+1124, libc.VaList(bp+16, bp+32)) != 1 {
return 1
}
zDate += uintptr(2)
- if (int32(*(*uint8)(unsafe.Pointer(zDate))) == '.') && ((int32(Xsqlite3CtypeMap[uint8(*(*uint8)(unsafe.Pointer(zDate + 1)))]) & 0x04) != 0) {
+ if int32(*(*uint8)(unsafe.Pointer(zDate))) == '.' && int32(Xsqlite3CtypeMap[uint8(*(*uint8)(unsafe.Pointer(zDate + 1)))])&0x04 != 0 {
var rScale float64 = 1.0
zDate++
- for (int32(Xsqlite3CtypeMap[uint8(*(*uint8)(unsafe.Pointer(zDate)))]) & 0x04) != 0 {
- ms = (((ms * 10.0) + float64(*(*uint8)(unsafe.Pointer(zDate)))) - float64('0'))
- rScale = rScale * (10.0)
+ for int32(Xsqlite3CtypeMap[uint8(*(*uint8)(unsafe.Pointer(zDate)))])&0x04 != 0 {
+ ms = ms*10.0 + float64(*(*uint8)(unsafe.Pointer(zDate))) - float64('0')
+ rScale = rScale * 10.0
zDate++
}
- ms = ms / (rScale)
+ ms = ms / rScale
}
} else {
*(*int32)(unsafe.Pointer(bp + 32 /* s */)) = 0
@@ -12752,7 +13180,7 @@ func parseHhMmSs(tls *libc.TLS, zDate uintptr, p uintptr) int32 { /* sqlite3.c:2
(*DateTime)(unsafe.Pointer(p)).FvalidHMS = uint8(1)
(*DateTime)(unsafe.Pointer(p)).Fh = *(*int32)(unsafe.Pointer(bp + 24 /* h */))
(*DateTime)(unsafe.Pointer(p)).Fm = *(*int32)(unsafe.Pointer(bp + 28 /* m */))
- (*DateTime)(unsafe.Pointer(p)).Fs = (float64(*(*int32)(unsafe.Pointer(bp + 32 /* s */))) + ms)
+ (*DateTime)(unsafe.Pointer(p)).Fs = float64(*(*int32)(unsafe.Pointer(bp + 32))) + ms
if parseTimezone(tls, zDate, p) != 0 {
return 1
}
@@ -12766,7 +13194,7 @@ func parseHhMmSs(tls *libc.TLS, zDate uintptr, p uintptr) int32 { /* sqlite3.c:2
}
// Put the DateTime object into its error state.
-func datetimeError(tls *libc.TLS, p uintptr) { /* sqlite3.c:22412:13: */
+func datetimeError(tls *libc.TLS, p uintptr) { /* sqlite3.c:22931:13: */
libc.Xmemset(tls, p, 0, uint32(unsafe.Sizeof(DateTime{})))
(*DateTime)(unsafe.Pointer(p)).FisError = uint8(1)
}
@@ -12775,7 +13203,7 @@ func datetimeError(tls *libc.TLS, p uintptr) { /* sqlite3.c:22412:13: */
// that the YYYY-MM-DD is according to the Gregorian calendar.
//
// Reference: Meeus page 61
-func computeJD(tls *libc.TLS, p uintptr) { /* sqlite3.c:22423:13: */
+func computeJD(tls *libc.TLS, p uintptr) { /* sqlite3.c:22942:13: */
var Y int32
var M int32
var D int32
@@ -12796,24 +13224,24 @@ func computeJD(tls *libc.TLS, p uintptr) { /* sqlite3.c:22423:13: */
M = 1
D = 1
}
- if ((Y < -4713) || (Y > 9999)) || ((*DateTime)(unsafe.Pointer(p)).FrawS != 0) {
+ if Y < -4713 || Y > 9999 || (*DateTime)(unsafe.Pointer(p)).FrawS != 0 {
datetimeError(tls, p)
return
}
if M <= 2 {
Y--
- M = M + (12)
+ M = M + 12
}
- A = (Y / 100)
- B = ((2 - A) + (A / 4))
- X1 = ((36525 * (Y + 4716)) / 100)
- X2 = ((306001 * (M + 1)) / 10000)
- (*DateTime)(unsafe.Pointer(p)).FiJD = (libc.Int64FromFloat64(((float64(((X1 + X2) + D) + B)) - 1524.5) * float64(86400000)))
+ A = Y / 100
+ B = 2 - A + A/4
+ X1 = 36525 * (Y + 4716) / 100
+ X2 = 306001 * (M + 1) / 10000
+ (*DateTime)(unsafe.Pointer(p)).FiJD = libc.Int64FromFloat64((float64(X1+X2+D+B) - 1524.5) * float64(86400000))
(*DateTime)(unsafe.Pointer(p)).FvalidJD = uint8(1)
if (*DateTime)(unsafe.Pointer(p)).FvalidHMS != 0 {
- *(*Sqlite3_int64)(unsafe.Pointer(p /* &.iJD */)) += ((Sqlite3_int64(((*DateTime)(unsafe.Pointer(p)).Fh * 3600000) + ((*DateTime)(unsafe.Pointer(p)).Fm * 60000))) + (libc.Int64FromFloat64((*DateTime)(unsafe.Pointer(p)).Fs * float64(1000))))
+ *(*Sqlite3_int64)(unsafe.Pointer(p)) += Sqlite3_int64((*DateTime)(unsafe.Pointer(p)).Fh*3600000+(*DateTime)(unsafe.Pointer(p)).Fm*60000) + libc.Int64FromFloat64((*DateTime)(unsafe.Pointer(p)).Fs*float64(1000))
if (*DateTime)(unsafe.Pointer(p)).FvalidTZ != 0 {
- *(*Sqlite3_int64)(unsafe.Pointer(p /* &.iJD */)) -= (Sqlite3_int64((*DateTime)(unsafe.Pointer(p)).Ftz * 60000))
+ *(*Sqlite3_int64)(unsafe.Pointer(p)) -= Sqlite3_int64((*DateTime)(unsafe.Pointer(p)).Ftz * 60000)
(*DateTime)(unsafe.Pointer(p)).FvalidYMD = uint8(0)
(*DateTime)(unsafe.Pointer(p)).FvalidHMS = uint8(0)
(*DateTime)(unsafe.Pointer(p)).FvalidTZ = uint8(0)
@@ -12831,7 +13259,7 @@ func computeJD(tls *libc.TLS, p uintptr) { /* sqlite3.c:22423:13: */
// Write the result into the DateTime structure and return 0
// on success and 1 if the input string is not a well-formed
// date.
-func parseYyyyMmDd(tls *libc.TLS, zDate uintptr, p uintptr) int32 { /* sqlite3.c:22473:12: */
+func parseYyyyMmDd(tls *libc.TLS, zDate uintptr, p uintptr) int32 { /* sqlite3.c:22992:12: */
bp := tls.Alloc(36)
defer tls.Free(36)
@@ -12849,11 +13277,11 @@ func parseYyyyMmDd(tls *libc.TLS, zDate uintptr, p uintptr) int32 { /* sqlite3.c
} else {
neg = 0
}
- if getDigits(tls, zDate, ts+345 /* "40f-21a-21d" */, libc.VaList(bp, bp+24 /* &Y */, bp+28 /* &M */, bp+32 /* &D */)) != 3 {
+ if getDigits(tls, zDate, ts+1128, libc.VaList(bp, bp+24, bp+28, bp+32)) != 3 {
return 1
}
zDate += uintptr(10)
- for ((int32(Xsqlite3CtypeMap[uint8(*(*uint8)(unsafe.Pointer(zDate)))]) & 0x01) != 0) || ('T' == int32(*(*U8)(unsafe.Pointer(zDate)))) {
+ for int32(Xsqlite3CtypeMap[uint8(*(*uint8)(unsafe.Pointer(zDate)))])&0x01 != 0 || 'T' == int32(*(*U8)(unsafe.Pointer(zDate))) {
zDate++
}
if parseHhMmSs(tls, zDate, p) == 0 {
@@ -12882,7 +13310,7 @@ func parseYyyyMmDd(tls *libc.TLS, zDate uintptr, p uintptr) int32 { /* sqlite3.c
// Set the time to the current time reported by the VFS.
//
// Return the number of errors.
-func setDateTimeToCurrent(tls *libc.TLS, context uintptr, p uintptr) int32 { /* sqlite3.c:22510:12: */
+func setDateTimeToCurrent(tls *libc.TLS, context uintptr, p uintptr) int32 { /* sqlite3.c:23029:12: */
(*DateTime)(unsafe.Pointer(p)).FiJD = Xsqlite3StmtCurrentTime(tls, context)
if (*DateTime)(unsafe.Pointer(p)).FiJD > int64(0) {
(*DateTime)(unsafe.Pointer(p)).FvalidJD = uint8(1)
@@ -12897,11 +13325,11 @@ func setDateTimeToCurrent(tls *libc.TLS, context uintptr, p uintptr) int32 { /*
// or the number of seconds since 1970. If the value if r is within
// range of a julian day number, install it as such and set validJD.
// If the value is a valid unix timestamp, put it in p->s and set p->rawS.
-func setRawDateNumber(tls *libc.TLS, p uintptr, r float64) { /* sqlite3.c:22526:13: */
+func setRawDateNumber(tls *libc.TLS, p uintptr, r float64) { /* sqlite3.c:23045:13: */
(*DateTime)(unsafe.Pointer(p)).Fs = r
(*DateTime)(unsafe.Pointer(p)).FrawS = uint8(1)
- if (r >= 0.0) && (r < 5373484.5) {
- (*DateTime)(unsafe.Pointer(p)).FiJD = (libc.Int64FromFloat64((r * 86400000.0) + 0.5))
+ if r >= 0.0 && r < 5373484.5 {
+ (*DateTime)(unsafe.Pointer(p)).FiJD = libc.Int64FromFloat64(r*86400000.0 + 0.5)
(*DateTime)(unsafe.Pointer(p)).FvalidJD = uint8(1)
}
}
@@ -12920,7 +13348,7 @@ func setRawDateNumber(tls *libc.TLS, p uintptr, r float64) { /* sqlite3.c:22526:
// (":SS.FFF") is option. The year and date can be omitted as long
// as there is a time string. The time string can be omitted as long
// as there is a year and date.
-func parseDateOrTime(tls *libc.TLS, context uintptr, zDate uintptr, p uintptr) int32 { /* sqlite3.c:22551:12: */
+func parseDateOrTime(tls *libc.TLS, context uintptr, zDate uintptr, p uintptr) int32 { /* sqlite3.c:23070:12: */
bp := tls.Alloc(8)
defer tls.Free(8)
@@ -12930,9 +13358,9 @@ func parseDateOrTime(tls *libc.TLS, context uintptr, zDate uintptr, p uintptr) i
return 0
} else if parseHhMmSs(tls, zDate, p) == 0 {
return 0
- } else if (Xsqlite3StrICmp(tls, zDate, ts+357 /* "now" */) == 0) && (Xsqlite3NotPureFunc(tls, context) != 0) {
+ } else if Xsqlite3StrICmp(tls, zDate, ts+1140) == 0 && Xsqlite3NotPureFunc(tls, context) != 0 {
return setDateTimeToCurrent(tls, context, p)
- } else if Xsqlite3AtoF(tls, zDate, bp /* &r */, Xsqlite3Strlen30(tls, zDate), uint8(SQLITE_UTF8)) > 0 {
+ } else if Xsqlite3AtoF(tls, zDate, bp, Xsqlite3Strlen30(tls, zDate), uint8(SQLITE_UTF8)) > 0 {
setRawDateNumber(tls, p, *(*float64)(unsafe.Pointer(bp /* r */)))
return 0
}
@@ -12949,12 +13377,12 @@ func parseDateOrTime(tls *libc.TLS, context uintptr, zDate uintptr, p uintptr) i
// Return TRUE if the given julian day number is within range.
//
// The input is the JulianDay times 86400000.
-func validJulianDay(tls *libc.TLS, iJD Sqlite3_int64) int32 { /* sqlite3.c:22584:12: */
- return (libc.Bool32((iJD >= int64(0)) && (iJD <= ((I64((int64(0x1a640))) << 32) | int64(0x1072fdff)))))
+func validJulianDay(tls *libc.TLS, iJD Sqlite3_int64) int32 { /* sqlite3.c:23103:12: */
+ return libc.Bool32(iJD >= int64(0) && iJD <= I64(int64(0x1a640))<<32|int64(0x1072fdff))
}
// Compute the Year, Month, and Day from the julian day number.
-func computeYMD(tls *libc.TLS, p uintptr) { /* sqlite3.c:22591:13: */
+func computeYMD(tls *libc.TLS, p uintptr) { /* sqlite3.c:23110:13: */
var Z int32
var A int32
var B int32
@@ -12973,58 +13401,58 @@ func computeYMD(tls *libc.TLS, p uintptr) { /* sqlite3.c:22591:13: */
datetimeError(tls, p)
return
} else {
- Z = (int32(((*DateTime)(unsafe.Pointer(p)).FiJD + int64(43200000)) / int64(86400000)))
- A = (libc.Int32FromFloat64((float64(Z) - 1867216.25) / 36524.25))
- A = (((Z + 1) + A) - (A / 4))
- B = (A + 1524)
- C = (libc.Int32FromFloat64((float64(B) - 122.1) / 365.25))
- D = ((36525 * (C & 32767)) / 100)
- E = (libc.Int32FromFloat64((float64(B - D)) / 30.6001))
- X1 = (libc.Int32FromFloat64(30.6001 * float64(E)))
- (*DateTime)(unsafe.Pointer(p)).FD = ((B - D) - X1)
+ Z = int32(((*DateTime)(unsafe.Pointer(p)).FiJD + int64(43200000)) / int64(86400000))
+ A = libc.Int32FromFloat64((float64(Z) - 1867216.25) / 36524.25)
+ A = Z + 1 + A - A/4
+ B = A + 1524
+ C = libc.Int32FromFloat64((float64(B) - 122.1) / 365.25)
+ D = 36525 * (C & 32767) / 100
+ E = libc.Int32FromFloat64(float64(B-D) / 30.6001)
+ X1 = libc.Int32FromFloat64(30.6001 * float64(E))
+ (*DateTime)(unsafe.Pointer(p)).FD = B - D - X1
(*DateTime)(unsafe.Pointer(p)).FM = func() int32 {
if E < 14 {
- return (E - 1)
+ return E - 1
}
- return (E - 13)
+ return E - 13
}()
(*DateTime)(unsafe.Pointer(p)).FY = func() int32 {
if (*DateTime)(unsafe.Pointer(p)).FM > 2 {
- return (C - 4716)
+ return C - 4716
}
- return (C - 4715)
+ return C - 4715
}()
}
(*DateTime)(unsafe.Pointer(p)).FvalidYMD = uint8(1)
}
// Compute the Hour, Minute, and Seconds from the julian day number.
-func computeHMS(tls *libc.TLS, p uintptr) { /* sqlite3.c:22620:13: */
+func computeHMS(tls *libc.TLS, p uintptr) { /* sqlite3.c:23139:13: */
var s int32
if (*DateTime)(unsafe.Pointer(p)).FvalidHMS != 0 {
return
}
computeJD(tls, p)
- s = (int32(((*DateTime)(unsafe.Pointer(p)).FiJD + int64(43200000)) % int64(86400000)))
- (*DateTime)(unsafe.Pointer(p)).Fs = (float64(s) / 1000.0)
+ s = int32(((*DateTime)(unsafe.Pointer(p)).FiJD + int64(43200000)) % int64(86400000))
+ (*DateTime)(unsafe.Pointer(p)).Fs = float64(s) / 1000.0
s = libc.Int32FromFloat64((*DateTime)(unsafe.Pointer(p)).Fs)
- *(*float64)(unsafe.Pointer(p + 32 /* &.s */)) -= (float64(s))
- (*DateTime)(unsafe.Pointer(p)).Fh = (s / 3600)
- s = s - ((*DateTime)(unsafe.Pointer(p)).Fh * 3600)
- (*DateTime)(unsafe.Pointer(p)).Fm = (s / 60)
- *(*float64)(unsafe.Pointer(p + 32 /* &.s */)) += (float64(s - ((*DateTime)(unsafe.Pointer(p)).Fm * 60)))
+ *(*float64)(unsafe.Pointer(p + 32)) -= float64(s)
+ (*DateTime)(unsafe.Pointer(p)).Fh = s / 3600
+ s = s - (*DateTime)(unsafe.Pointer(p)).Fh*3600
+ (*DateTime)(unsafe.Pointer(p)).Fm = s / 60
+ *(*float64)(unsafe.Pointer(p + 32)) += float64(s - (*DateTime)(unsafe.Pointer(p)).Fm*60)
(*DateTime)(unsafe.Pointer(p)).FrawS = uint8(0)
(*DateTime)(unsafe.Pointer(p)).FvalidHMS = uint8(1)
}
// Compute both YMD and HMS
-func computeYMD_HMS(tls *libc.TLS, p uintptr) { /* sqlite3.c:22639:13: */
+func computeYMD_HMS(tls *libc.TLS, p uintptr) { /* sqlite3.c:23158:13: */
computeYMD(tls, p)
computeHMS(tls, p)
}
// Clear the YMD and HMS and the TZ
-func clearYMD_HMS_TZ(tls *libc.TLS, p uintptr) { /* sqlite3.c:22647:13: */
+func clearYMD_HMS_TZ(tls *libc.TLS, p uintptr) { /* sqlite3.c:23166:13: */
(*DateTime)(unsafe.Pointer(p)).FvalidYMD = uint8(0)
(*DateTime)(unsafe.Pointer(p)).FvalidHMS = uint8(0)
(*DateTime)(unsafe.Pointer(p)).FvalidTZ = uint8(0)
@@ -13052,7 +13480,7 @@ func clearYMD_HMS_TZ(tls *libc.TLS, p uintptr) { /* sqlite3.c:22647:13: */
// EVIDENCE-OF: R-62172-00036 In this implementation, the standard C
// library function localtime_r() is used to assist in the calculation of
// local time.
-func osLocaltime(tls *libc.TLS, t uintptr, pTm uintptr) int32 { /* sqlite3.c:22685:12: */
+func osLocaltime(tls *libc.TLS, t uintptr, pTm uintptr) int32 { /* sqlite3.c:23204:12: */
var rc int32
var pX uintptr
var mutex uintptr = Xsqlite3MutexAlloc(tls, SQLITE_MUTEX_STATIC_MAIN)
@@ -13065,7 +13493,7 @@ func osLocaltime(tls *libc.TLS, t uintptr, pTm uintptr) int32 { /* sqlite3.c:226
*(*tm)(unsafe.Pointer(pTm)) = *(*tm)(unsafe.Pointer(pX))
}
Xsqlite3_mutex_leave(tls, mutex)
- rc = (libc.Bool32(pX == uintptr(0)))
+ rc = libc.Bool32(pX == uintptr(0))
return rc
}
@@ -13075,7 +13503,7 @@ func osLocaltime(tls *libc.TLS, t uintptr, pTm uintptr) int32 { /* sqlite3.c:226
//
// Or, if an error does occur, set *pRc to SQLITE_ERROR. The returned value
// is undefined in this case.
-func localtimeOffset(tls *libc.TLS, p uintptr, pCtx uintptr, pRc uintptr) Sqlite3_int64 { /* sqlite3.c:22724:22: */
+func localtimeOffset(tls *libc.TLS, p uintptr, pCtx uintptr, pRc uintptr) Sqlite3_int64 { /* sqlite3.c:23243:22: */
bp := tls.Alloc(152)
defer tls.Free(152)
@@ -13092,7 +13520,7 @@ func localtimeOffset(tls *libc.TLS, p uintptr, pCtx uintptr, pRc uintptr) Sqlite
*(*DateTime)(unsafe.Pointer(bp + 48 /* x */)) = *(*DateTime)(unsafe.Pointer(p))
computeYMD_HMS(tls, bp+48 /* &x */)
- if ((*DateTime)(unsafe.Pointer(bp+48 /* &x */)).FY < 1971) || ((*DateTime)(unsafe.Pointer(bp+48 /* &x */)).FY >= 2038) {
+ if (*DateTime)(unsafe.Pointer(bp+48)).FY < 1971 || (*DateTime)(unsafe.Pointer(bp+48)).FY >= 2038 {
// EVIDENCE-OF: R-55269-29598 The localtime_r() C function normally only
// works for years between 1970 and 2037. For dates outside this range,
// SQLite attempts to map the year into an equivalent year within this
@@ -13104,20 +13532,20 @@ func localtimeOffset(tls *libc.TLS, p uintptr, pCtx uintptr, pRc uintptr) Sqlite
(*DateTime)(unsafe.Pointer(bp + 48 /* &x */)).Fm = 0
(*DateTime)(unsafe.Pointer(bp + 48 /* &x */)).Fs = 0.0
} else {
- var s int32 = (libc.Int32FromFloat64((*DateTime)(unsafe.Pointer(bp+48 /* &x */)).Fs + 0.5))
+ var s int32 = libc.Int32FromFloat64((*DateTime)(unsafe.Pointer(bp+48)).Fs + 0.5)
(*DateTime)(unsafe.Pointer(bp + 48 /* &x */)).Fs = float64(s)
}
(*DateTime)(unsafe.Pointer(bp + 48 /* &x */)).Ftz = 0
(*DateTime)(unsafe.Pointer(bp + 48 /* &x */)).FvalidJD = uint8(0)
computeJD(tls, bp+48 /* &x */)
- *(*Time_t)(unsafe.Pointer(bp + 96 /* t */)) = (Time_t(((*DateTime)(unsafe.Pointer(bp+48 /* &x */)).FiJD / int64(1000)) - (int64(21086676) * int64(10000))))
- if osLocaltime(tls, bp+96 /* &t */, bp /* &sLocal */) != 0 {
- Xsqlite3_result_error(tls, pCtx, ts+361 /* "local time unava..." */, -1)
+ *(*Time_t)(unsafe.Pointer(bp + 96 /* t */)) = Time_t((*DateTime)(unsafe.Pointer(bp+48)).FiJD/int64(1000) - int64(21086676)*int64(10000))
+ if osLocaltime(tls, bp+96, bp) != 0 {
+ Xsqlite3_result_error(tls, pCtx, ts+1144 /* "local time unava..." */, -1)
*(*int32)(unsafe.Pointer(pRc)) = SQLITE_ERROR
return int64(0)
}
- (*DateTime)(unsafe.Pointer(bp + 104 /* &y */)).FY = ((*tm)(unsafe.Pointer(bp /* &sLocal */)).Ftm_year + 1900)
- (*DateTime)(unsafe.Pointer(bp + 104 /* &y */)).FM = ((*tm)(unsafe.Pointer(bp /* &sLocal */)).Ftm_mon + 1)
+ (*DateTime)(unsafe.Pointer(bp + 104 /* &y */)).FY = (*tm)(unsafe.Pointer(bp)).Ftm_year + 1900
+ (*DateTime)(unsafe.Pointer(bp + 104 /* &y */)).FM = (*tm)(unsafe.Pointer(bp)).Ftm_mon + 1
(*DateTime)(unsafe.Pointer(bp + 104 /* &y */)).FD = (*tm)(unsafe.Pointer(bp /* &sLocal */)).Ftm_mday
(*DateTime)(unsafe.Pointer(bp + 104 /* &y */)).Fh = (*tm)(unsafe.Pointer(bp /* &sLocal */)).Ftm_hour
(*DateTime)(unsafe.Pointer(bp + 104 /* &y */)).Fm = (*tm)(unsafe.Pointer(bp /* &sLocal */)).Ftm_min
@@ -13130,7 +13558,7 @@ func localtimeOffset(tls *libc.TLS, p uintptr, pCtx uintptr, pRc uintptr) Sqlite
(*DateTime)(unsafe.Pointer(bp + 104 /* &y */)).FisError = uint8(0)
computeJD(tls, bp+104 /* &y */)
*(*int32)(unsafe.Pointer(pRc)) = SQLITE_OK
- return ((*DateTime)(unsafe.Pointer(bp+104 /* &y */)).FiJD - (*DateTime)(unsafe.Pointer(bp+48 /* &x */)).FiJD)
+ return (*DateTime)(unsafe.Pointer(bp+104)).FiJD - (*DateTime)(unsafe.Pointer(bp+48)).FiJD
}
// The following table defines various date transformations of the form
@@ -13147,13 +13575,13 @@ var aXformType = [6]struct {
FrLimit float64
FrXform float64
}{
- {FnName: U8(6), FzName: ts + 384 /* "second" */, FrLimit: 464269060800.0, FrXform: 1000.0},
- {FnName: U8(6), FzName: ts + 391 /* "minute" */, FrLimit: 7737817680.0, FrXform: 60000.0},
- {FnName: U8(4), FzName: ts + 398 /* "hour" */, FrLimit: 128963628.0, FrXform: 3600000.0},
- {FnName: U8(3), FzName: ts + 403 /* "day" */, FrLimit: 5373485.0, FrXform: 86400000.0},
- {FeType: U8(1), FnName: U8(5), FzName: ts + 407 /* "month" */, FrLimit: 176546.0, FrXform: 2592000000.0},
- {FeType: U8(2), FnName: U8(4), FzName: ts + 413 /* "year" */, FrLimit: 14713.0, FrXform: 31536000000.0},
-} /* sqlite3.c:22795:3 */
+ {FnName: U8(6), FzName: ts + 1167 /* "second" */, FrLimit: 464269060800.0, FrXform: 1000.0},
+ {FnName: U8(6), FzName: ts + 1174 /* "minute" */, FrLimit: 7737817680.0, FrXform: 60000.0},
+ {FnName: U8(4), FzName: ts + 1181 /* "hour" */, FrLimit: 128963628.0, FrXform: 3600000.0},
+ {FnName: U8(3), FzName: ts + 1186 /* "day" */, FrLimit: 5373485.0, FrXform: 86400000.0},
+ {FeType: U8(1), FnName: U8(5), FzName: ts + 1190 /* "month" */, FrLimit: 176546.0, FrXform: 2592000000.0},
+ {FeType: U8(2), FnName: U8(4), FzName: ts + 1196 /* "year" */, FrLimit: 14713.0, FrXform: 31536000000.0},
+} /* sqlite3.c:23314:3 */
// Process a modifier to a date-time stamp. The modifiers are
// as follows:
@@ -13177,7 +13605,7 @@ var aXformType = [6]struct {
// is in a system call (i.e. localtime()), then an error message is written
// to context pCtx. If the error is an unrecognized modifier, no error is
// written to pCtx.
-func parseModifier(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, p uintptr) int32 { /* sqlite3.c:22828:12: */
+func parseModifier(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, p uintptr) int32 { /* sqlite3.c:23347:12: */
bp := tls.Alloc(64)
defer tls.Free(64)
@@ -13191,9 +13619,9 @@ func parseModifier(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, p uintptr) i
//
// Assuming the current time value is UTC (a.k.a. GMT), shift it to
// show local time.
- if (Xsqlite3_stricmp(tls, z, ts+418 /* "localtime" */) == 0) && (Xsqlite3NotPureFunc(tls, pCtx) != 0) {
+ if Xsqlite3_stricmp(tls, z, ts+1201) == 0 && Xsqlite3NotPureFunc(tls, pCtx) != 0 {
computeJD(tls, p)
- *(*Sqlite3_int64)(unsafe.Pointer(p /* &.iJD */)) += (localtimeOffset(tls, p, pCtx, bp /* &rc */))
+ *(*Sqlite3_int64)(unsafe.Pointer(p)) += localtimeOffset(tls, p, pCtx, bp)
clearYMD_HMS_TZ(tls, p)
}
break
@@ -13205,24 +13633,24 @@ func parseModifier(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, p uintptr) i
//
// 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, ts+428 /* "unixepoch" */) == 0) && ((*DateTime)(unsafe.Pointer(p)).FrawS != 0) {
- *(*float64)(unsafe.Pointer(bp + 8 /* r */)) = (((*DateTime)(unsafe.Pointer(p)).Fs * 1000.0) + 210866760000000.0)
- if (*(*float64)(unsafe.Pointer(bp + 8 /* r */)) >= 0.0) && (*(*float64)(unsafe.Pointer(bp + 8 /* r */)) < 464269060800000.0) {
+ if Xsqlite3_stricmp(tls, z, ts+1211) == 0 && (*DateTime)(unsafe.Pointer(p)).FrawS != 0 {
+ *(*float64)(unsafe.Pointer(bp + 8 /* r */)) = (*DateTime)(unsafe.Pointer(p)).Fs*1000.0 + 210866760000000.0
+ if *(*float64)(unsafe.Pointer(bp + 8)) >= 0.0 && *(*float64)(unsafe.Pointer(bp + 8)) < 464269060800000.0 {
clearYMD_HMS_TZ(tls, p)
- (*DateTime)(unsafe.Pointer(p)).FiJD = (libc.Int64FromFloat64(*(*float64)(unsafe.Pointer(bp + 8 /* r */)) + 0.5))
+ (*DateTime)(unsafe.Pointer(p)).FiJD = libc.Int64FromFloat64(*(*float64)(unsafe.Pointer(bp + 8)) + 0.5)
(*DateTime)(unsafe.Pointer(p)).FvalidJD = uint8(1)
(*DateTime)(unsafe.Pointer(p)).FrawS = uint8(0)
*(*int32)(unsafe.Pointer(bp /* rc */)) = 0
}
- } else if (Xsqlite3_stricmp(tls, z, ts+438 /* "utc" */) == 0) && (Xsqlite3NotPureFunc(tls, pCtx) != 0) {
+ } else if Xsqlite3_stricmp(tls, z, ts+1221) == 0 && Xsqlite3NotPureFunc(tls, pCtx) != 0 {
if int32((*DateTime)(unsafe.Pointer(p)).FtzSet) == 0 {
var c1 Sqlite3_int64
computeJD(tls, p)
c1 = localtimeOffset(tls, p, pCtx, bp /* &rc */)
- if *(*int32)(unsafe.Pointer(bp /* rc */)) == SQLITE_OK {
- *(*Sqlite3_int64)(unsafe.Pointer(p /* &.iJD */)) -= (c1)
+ if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK {
+ *(*Sqlite3_int64)(unsafe.Pointer(p)) -= c1
clearYMD_HMS_TZ(tls, p)
- *(*Sqlite3_int64)(unsafe.Pointer(p /* &.iJD */)) += (c1 - localtimeOffset(tls, p, pCtx, bp /* &rc */))
+ *(*Sqlite3_int64)(unsafe.Pointer(p)) += c1 - localtimeOffset(tls, p, pCtx, bp)
}
(*DateTime)(unsafe.Pointer(p)).FtzSet = uint8(1)
} else {
@@ -13239,19 +13667,19 @@ func parseModifier(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, p uintptr) i
// Move the date to the same time on the next occurrence of
// weekday N where 0==Sunday, 1==Monday, and so forth. If the
// date is already on the appropriate weekday, this is a no-op.
- if ((((Xsqlite3_strnicmp(tls, z, ts+442 /* "weekday " */, 8) == 0) &&
- (Xsqlite3AtoF(tls, (z+8), bp+8 /* &r */, Xsqlite3Strlen30(tls, (z+8)), uint8(SQLITE_UTF8)) > 0)) &&
- ((float64(libc.AssignInt32(&n, int32(*(*float64)(unsafe.Pointer(bp + 8 /* r */)))))) == *(*float64)(unsafe.Pointer(bp + 8 /* r */)))) && (n >= 0)) && (*(*float64)(unsafe.Pointer(bp + 8 /* r */)) < float64(7)) {
+ if Xsqlite3_strnicmp(tls, z, ts+1225, 8) == 0 &&
+ Xsqlite3AtoF(tls, z+8, bp+8, Xsqlite3Strlen30(tls, z+8), uint8(SQLITE_UTF8)) > 0 &&
+ float64(libc.AssignInt32(&n, int32(*(*float64)(unsafe.Pointer(bp + 8))))) == *(*float64)(unsafe.Pointer(bp + 8)) && n >= 0 && *(*float64)(unsafe.Pointer(bp + 8)) < float64(7) {
var Z Sqlite3_int64
computeYMD_HMS(tls, p)
(*DateTime)(unsafe.Pointer(p)).FvalidTZ = uint8(0)
(*DateTime)(unsafe.Pointer(p)).FvalidJD = uint8(0)
computeJD(tls, p)
- Z = ((((*DateTime)(unsafe.Pointer(p)).FiJD + int64(129600000)) / int64(86400000)) % int64(7))
+ Z = ((*DateTime)(unsafe.Pointer(p)).FiJD + int64(129600000)) / int64(86400000) % int64(7)
if Z > Sqlite3_int64(n) {
- Z = Z - (int64(7))
+ Z = Z - int64(7)
}
- *(*Sqlite3_int64)(unsafe.Pointer(p /* &.iJD */)) += ((Sqlite3_int64(n) - Z) * int64(86400000))
+ *(*Sqlite3_int64)(unsafe.Pointer(p)) += (Sqlite3_int64(n) - Z) * int64(86400000)
clearYMD_HMS_TZ(tls, p)
*(*int32)(unsafe.Pointer(bp /* rc */)) = 0
}
@@ -13264,28 +13692,28 @@ func parseModifier(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, p uintptr) i
//
// Move the date backwards to the beginning of the current day,
// or month or year.
- if Xsqlite3_strnicmp(tls, z, ts+451 /* "start of " */, 9) != 0 {
+ if Xsqlite3_strnicmp(tls, z, ts+1234, 9) != 0 {
break
}
- if (!(int32((*DateTime)(unsafe.Pointer(p)).FvalidJD) != 0) && !(int32((*DateTime)(unsafe.Pointer(p)).FvalidYMD) != 0)) && !(int32((*DateTime)(unsafe.Pointer(p)).FvalidHMS) != 0) {
+ if !(int32((*DateTime)(unsafe.Pointer(p)).FvalidJD) != 0) && !(int32((*DateTime)(unsafe.Pointer(p)).FvalidYMD) != 0) && !(int32((*DateTime)(unsafe.Pointer(p)).FvalidHMS) != 0) {
break
}
z += uintptr(9)
computeYMD(tls, p)
(*DateTime)(unsafe.Pointer(p)).FvalidHMS = uint8(1)
- (*DateTime)(unsafe.Pointer(p)).Fh = libc.AssignPtrInt32(p+24 /* &.m */, 0)
+ (*DateTime)(unsafe.Pointer(p)).Fh = libc.AssignPtrInt32(p+24, 0)
(*DateTime)(unsafe.Pointer(p)).Fs = 0.0
(*DateTime)(unsafe.Pointer(p)).FrawS = uint8(0)
(*DateTime)(unsafe.Pointer(p)).FvalidTZ = uint8(0)
(*DateTime)(unsafe.Pointer(p)).FvalidJD = uint8(0)
- if Xsqlite3_stricmp(tls, z, ts+407 /* "month" */) == 0 {
+ if Xsqlite3_stricmp(tls, z, ts+1190) == 0 {
(*DateTime)(unsafe.Pointer(p)).FD = 1
*(*int32)(unsafe.Pointer(bp /* rc */)) = 0
- } else if Xsqlite3_stricmp(tls, z, ts+413 /* "year" */) == 0 {
+ } else if Xsqlite3_stricmp(tls, z, ts+1196) == 0 {
(*DateTime)(unsafe.Pointer(p)).FM = 1
(*DateTime)(unsafe.Pointer(p)).FD = 1
*(*int32)(unsafe.Pointer(bp /* rc */)) = 0
- } else if Xsqlite3_stricmp(tls, z, ts+403 /* "day" */) == 0 {
+ } else if Xsqlite3_stricmp(tls, z, ts+1186) == 0 {
*(*int32)(unsafe.Pointer(bp /* rc */)) = 0
}
break
@@ -13317,9 +13745,9 @@ func parseModifier(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, p uintptr) i
{
var rRounder float64
var i int32
- for n = 1; ((*(*uint8)(unsafe.Pointer(z + uintptr(n))) != 0) && (int32(*(*uint8)(unsafe.Pointer(z + uintptr(n)))) != ':')) && !((int32(Xsqlite3CtypeMap[uint8(*(*uint8)(unsafe.Pointer(z + uintptr(n))))]) & 0x01) != 0); n++ {
+ for n = 1; *(*uint8)(unsafe.Pointer(z + uintptr(n))) != 0 && int32(*(*uint8)(unsafe.Pointer(z + uintptr(n)))) != ':' && !(int32(Xsqlite3CtypeMap[uint8(*(*uint8)(unsafe.Pointer(z + uintptr(n))))])&0x01 != 0); n++ {
}
- if Xsqlite3AtoF(tls, z, bp+8 /* &r */, n, uint8(SQLITE_UTF8)) <= 0 {
+ if Xsqlite3AtoF(tls, z, bp+8, n, uint8(SQLITE_UTF8)) <= 0 {
*(*int32)(unsafe.Pointer(bp /* rc */)) = 1
break
}
@@ -13332,23 +13760,23 @@ func parseModifier(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, p uintptr) i
// var tx DateTime at bp+16, 48
var day Sqlite3_int64
- if !((int32(Xsqlite3CtypeMap[uint8(*(*uint8)(unsafe.Pointer(z2)))]) & 0x04) != 0) {
+ if !(int32(Xsqlite3CtypeMap[uint8(*(*uint8)(unsafe.Pointer(z2)))])&0x04 != 0) {
z2++
}
libc.Xmemset(tls, bp+16 /* &tx */, 0, uint32(unsafe.Sizeof(DateTime{})))
- if parseHhMmSs(tls, z2, bp+16 /* &tx */) != 0 {
+ if parseHhMmSs(tls, z2, bp+16) != 0 {
break
}
computeJD(tls, bp+16 /* &tx */)
- *(*Sqlite3_int64)(unsafe.Pointer(bp + 16 /* &tx */ /* &.iJD */)) -= (int64(43200000))
- day = ((*DateTime)(unsafe.Pointer(bp+16 /* &tx */)).FiJD / int64(86400000))
- *(*Sqlite3_int64)(unsafe.Pointer(bp + 16 /* &tx */ /* &.iJD */)) -= (day * int64(86400000))
+ *(*Sqlite3_int64)(unsafe.Pointer(bp + 16)) -= int64(43200000)
+ day = (*DateTime)(unsafe.Pointer(bp+16)).FiJD / int64(86400000)
+ *(*Sqlite3_int64)(unsafe.Pointer(bp + 16)) -= day * int64(86400000)
if int32(*(*uint8)(unsafe.Pointer(z))) == '-' {
(*DateTime)(unsafe.Pointer(bp + 16 /* &tx */)).FiJD = -(*DateTime)(unsafe.Pointer(bp + 16 /* &tx */)).FiJD
}
computeJD(tls, p)
clearYMD_HMS_TZ(tls, p)
- *(*Sqlite3_int64)(unsafe.Pointer(p /* &.iJD */)) += ((*DateTime)(unsafe.Pointer(bp + 16 /* &tx */)).FiJD)
+ *(*Sqlite3_int64)(unsafe.Pointer(p)) += (*DateTime)(unsafe.Pointer(bp + 16)).FiJD
*(*int32)(unsafe.Pointer(bp /* rc */)) = 0
break
}
@@ -13356,47 +13784,47 @@ func parseModifier(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, p uintptr) i
// If control reaches this point, it means the transformation is
// one of the forms like "+NNN days".
z += uintptr(n)
- for (int32(Xsqlite3CtypeMap[uint8(*(*uint8)(unsafe.Pointer(z)))]) & 0x01) != 0 {
+ for int32(Xsqlite3CtypeMap[uint8(*(*uint8)(unsafe.Pointer(z)))])&0x01 != 0 {
z++
}
n = Xsqlite3Strlen30(tls, z)
- if (n > 10) || (n < 3) {
+ if n > 10 || n < 3 {
break
}
- if int32(Xsqlite3UpperToLower[U8(*(*uint8)(unsafe.Pointer(z + uintptr((n - 1)))))]) == 's' {
+ if int32(Xsqlite3UpperToLower[U8(*(*uint8)(unsafe.Pointer(z + uintptr(n-1))))]) == 's' {
n--
}
computeJD(tls, p)
*(*int32)(unsafe.Pointer(bp /* rc */)) = 1
- if *(*float64)(unsafe.Pointer(bp + 8 /* r */)) < float64(0) {
+ if *(*float64)(unsafe.Pointer(bp + 8)) < float64(0) {
rRounder = -0.5
} else {
rRounder = +0.5
}
- for i = 0; i < (int32(uint32(unsafe.Sizeof(aXformType)) / uint32(unsafe.Sizeof(struct {
+ for i = 0; i < int32(uint32(unsafe.Sizeof(aXformType))/uint32(unsafe.Sizeof(struct {
FeType U8
FnName U8
F__ccgo_pad1 [2]byte
FzName uintptr
FrLimit float64
FrXform float64
- }{})))); i++ {
- if (((int32(aXformType[i].FnName) == n) &&
- (Xsqlite3_strnicmp(tls, aXformType[i].FzName, z, n) == 0)) &&
- (*(*float64)(unsafe.Pointer(bp + 8 /* r */)) > -aXformType[i].FrLimit)) && (*(*float64)(unsafe.Pointer(bp + 8 /* r */)) < aXformType[i].FrLimit) {
+ }{}))); i++ {
+ if int32(aXformType[i].FnName) == n &&
+ Xsqlite3_strnicmp(tls, aXformType[i].FzName, z, n) == 0 &&
+ *(*float64)(unsafe.Pointer(bp + 8)) > -aXformType[i].FrLimit && *(*float64)(unsafe.Pointer(bp + 8)) < aXformType[i].FrLimit {
switch int32(aXformType[i].FeType) {
case 1:
{ // Special processing to add months
var x int32
computeYMD_HMS(tls, p)
- *(*int32)(unsafe.Pointer(p + 12 /* &.M */)) += (int32(*(*float64)(unsafe.Pointer(bp + 8 /* r */))))
+ *(*int32)(unsafe.Pointer(p + 12)) += int32(*(*float64)(unsafe.Pointer(bp + 8)))
if (*DateTime)(unsafe.Pointer(p)).FM > 0 {
- x = (((*DateTime)(unsafe.Pointer(p)).FM - 1) / 12)
+ x = ((*DateTime)(unsafe.Pointer(p)).FM - 1) / 12
} else {
- x = (((*DateTime)(unsafe.Pointer(p)).FM - 12) / 12)
+ x = ((*DateTime)(unsafe.Pointer(p)).FM - 12) / 12
}
- *(*int32)(unsafe.Pointer(p + 8 /* &.Y */)) += (x)
- *(*int32)(unsafe.Pointer(p + 12 /* &.M */)) -= (x * 12)
+ *(*int32)(unsafe.Pointer(p + 8)) += x
+ *(*int32)(unsafe.Pointer(p + 12)) -= x * 12
(*DateTime)(unsafe.Pointer(p)).FvalidJD = uint8(0)
*(*float64)(unsafe.Pointer(bp + 8 /* r */)) -= float64(int32(*(*float64)(unsafe.Pointer(bp + 8 /* r */))))
break
@@ -13407,7 +13835,7 @@ func parseModifier(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, p uintptr) i
{ // Special processing to add years
var y int32 = int32(*(*float64)(unsafe.Pointer(bp + 8 /* r */)))
computeYMD_HMS(tls, p)
- *(*int32)(unsafe.Pointer(p + 8 /* &.Y */)) += (y)
+ *(*int32)(unsafe.Pointer(p + 8)) += y
(*DateTime)(unsafe.Pointer(p)).FvalidJD = uint8(0)
*(*float64)(unsafe.Pointer(bp + 8 /* r */)) -= float64(int32(*(*float64)(unsafe.Pointer(bp + 8 /* r */))))
break
@@ -13415,7 +13843,7 @@ func parseModifier(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, p uintptr) i
}
}
computeJD(tls, p)
- *(*Sqlite3_int64)(unsafe.Pointer(p /* &.iJD */)) += (libc.Int64FromFloat64((*(*float64)(unsafe.Pointer(bp + 8 /* r */)) * aXformType[i].FrXform) + rRounder))
+ *(*Sqlite3_int64)(unsafe.Pointer(p)) += libc.Int64FromFloat64(*(*float64)(unsafe.Pointer(bp + 8))*aXformType[i].FrXform + rRounder)
*(*int32)(unsafe.Pointer(bp /* rc */)) = 0
break
}
@@ -13440,7 +13868,7 @@ func parseModifier(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, p uintptr) i
//
// If there are zero parameters (if even argv[0] is undefined)
// then assume a default value of "now" for argv[0].
-func isDate(tls *libc.TLS, context uintptr, argc int32, argv uintptr, p uintptr) int32 { /* sqlite3.c:23045:12: */
+func isDate(tls *libc.TLS, context uintptr, argc int32, argv uintptr, p uintptr) int32 { /* sqlite3.c:23564:12: */
var i int32
var n int32
var z uintptr
@@ -13452,24 +13880,24 @@ func isDate(tls *libc.TLS, context uintptr, argc int32, argv uintptr, p uintptr)
}
return setDateTimeToCurrent(tls, context, p)
}
- if ((libc.AssignInt32(&eType, Xsqlite3_value_type(tls, *(*uintptr)(unsafe.Pointer(argv))))) == SQLITE_FLOAT) ||
- (eType == SQLITE_INTEGER) {
+ if libc.AssignInt32(&eType, Xsqlite3_value_type(tls, *(*uintptr)(unsafe.Pointer(argv)))) == SQLITE_FLOAT ||
+ eType == SQLITE_INTEGER {
setRawDateNumber(tls, p, Xsqlite3_value_double(tls, *(*uintptr)(unsafe.Pointer(argv))))
} else {
z = Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv)))
- if !(z != 0) || (parseDateOrTime(tls, context, z, p) != 0) {
+ if !(z != 0) || parseDateOrTime(tls, context, z, p) != 0 {
return 1
}
}
for i = 1; i < argc; i++ {
z = Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*4)))
n = Xsqlite3_value_bytes(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*4)))
- if (z == uintptr(0)) || (parseModifier(tls, context, z, n, p) != 0) {
+ if z == uintptr(0) || parseModifier(tls, context, z, n, p) != 0 {
return 1
}
}
computeJD(tls, p)
- if ((*DateTime)(unsafe.Pointer(p)).FisError != 0) || !(validJulianDay(tls, (*DateTime)(unsafe.Pointer(p)).FiJD) != 0) {
+ if (*DateTime)(unsafe.Pointer(p)).FisError != 0 || !(validJulianDay(tls, (*DateTime)(unsafe.Pointer(p)).FiJD) != 0) {
return 1
}
return 0
@@ -13481,33 +13909,33 @@ func isDate(tls *libc.TLS, context uintptr, argc int32, argv uintptr, p uintptr)
// julianday( TIMESTRING, MOD, MOD, ...)
//
// Return the julian day number of the date specified in the arguments
-func juliandayFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:23089:13: */
+func juliandayFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:23608:13: */
bp := tls.Alloc(48)
defer tls.Free(48)
// var x DateTime at bp, 48
- if isDate(tls, context, argc, argv, bp /* &x */) == 0 {
+ if isDate(tls, context, argc, argv, bp) == 0 {
computeJD(tls, bp /* &x */)
- Xsqlite3_result_double(tls, context, (float64((*DateTime)(unsafe.Pointer(bp /* &x */)).FiJD) / 86400000.0))
+ Xsqlite3_result_double(tls, context, float64((*DateTime)(unsafe.Pointer(bp)).FiJD)/86400000.0)
}
}
// datetime( TIMESTRING, MOD, MOD, ...)
//
// Return YYYY-MM-DD HH:MM:SS
-func datetimeFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:23106:13: */
+func datetimeFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:23625:13: */
bp := tls.Alloc(196)
defer tls.Free(196)
// var x DateTime at bp+48, 48
- if isDate(tls, context, argc, argv, bp+48 /* &x */) == 0 {
+ if isDate(tls, context, argc, argv, bp+48) == 0 {
// var zBuf [100]uint8 at bp+96, 100
computeYMD_HMS(tls, bp+48 /* &x */)
- Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([100]uint8{})), bp+96 /* &zBuf[0] */, ts+461, /* "%04d-%02d-%02d %..." */
- libc.VaList(bp, (*DateTime)(unsafe.Pointer(bp+48 /* &x */)).FY, (*DateTime)(unsafe.Pointer(bp+48 /* &x */)).FM, (*DateTime)(unsafe.Pointer(bp+48 /* &x */)).FD, (*DateTime)(unsafe.Pointer(bp+48 /* &x */)).Fh, (*DateTime)(unsafe.Pointer(bp+48 /* &x */)).Fm, libc.Int32FromFloat64((*DateTime)(unsafe.Pointer(bp+48 /* &x */)).Fs)))
+ Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([100]uint8{})), bp+96 /* &zBuf[0] */, ts+1244, /* "%04d-%02d-%02d %..." */
+ libc.VaList(bp, (*DateTime)(unsafe.Pointer(bp+48 /* &x */)).FY, (*DateTime)(unsafe.Pointer(bp+48 /* &x */)).FM, (*DateTime)(unsafe.Pointer(bp+48 /* &x */)).FD, (*DateTime)(unsafe.Pointer(bp+48 /* &x */)).Fh, (*DateTime)(unsafe.Pointer(bp+48 /* &x */)).Fm, libc.Int32FromFloat64((*DateTime)(unsafe.Pointer(bp+48)).Fs)))
Xsqlite3_result_text(tls, context, bp+96 /* &zBuf[0] */, -1, libc.UintptrFromInt32(-1))
}
}
@@ -13515,17 +13943,17 @@ func datetimeFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /*
// time( TIMESTRING, MOD, MOD, ...)
//
// Return HH:MM:SS
-func timeFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:23126:13: */
+func timeFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:23645:13: */
bp := tls.Alloc(172)
defer tls.Free(172)
// var x DateTime at bp+24, 48
- if isDate(tls, context, argc, argv, bp+24 /* &x */) == 0 {
+ if isDate(tls, context, argc, argv, bp+24) == 0 {
// var zBuf [100]uint8 at bp+72, 100
computeHMS(tls, bp+24 /* &x */)
- Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([100]uint8{})), bp+72 /* &zBuf[0] */, ts+491 /* "%02d:%02d:%02d" */, libc.VaList(bp, (*DateTime)(unsafe.Pointer(bp+24 /* &x */)).Fh, (*DateTime)(unsafe.Pointer(bp+24 /* &x */)).Fm, libc.Int32FromFloat64((*DateTime)(unsafe.Pointer(bp+24 /* &x */)).Fs)))
+ Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([100]uint8{})), bp+72 /* &zBuf[0] */, ts+1274 /* "%02d:%02d:%02d" */, libc.VaList(bp, (*DateTime)(unsafe.Pointer(bp+24 /* &x */)).Fh, (*DateTime)(unsafe.Pointer(bp+24 /* &x */)).Fm, libc.Int32FromFloat64((*DateTime)(unsafe.Pointer(bp+24 /* &x */)).Fs)))
Xsqlite3_result_text(tls, context, bp+72 /* &zBuf[0] */, -1, libc.UintptrFromInt32(-1))
}
}
@@ -13533,17 +13961,17 @@ func timeFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sql
// date( TIMESTRING, MOD, MOD, ...)
//
// Return YYYY-MM-DD
-func dateFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:23145:13: */
+func dateFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:23664:13: */
bp := tls.Alloc(172)
defer tls.Free(172)
// var x DateTime at bp+24, 48
- if isDate(tls, context, argc, argv, bp+24 /* &x */) == 0 {
+ if isDate(tls, context, argc, argv, bp+24) == 0 {
// var zBuf [100]uint8 at bp+72, 100
computeYMD(tls, bp+24 /* &x */)
- Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([100]uint8{})), bp+72 /* &zBuf[0] */, ts+506 /* "%04d-%02d-%02d" */, libc.VaList(bp, (*DateTime)(unsafe.Pointer(bp+24 /* &x */)).FY, (*DateTime)(unsafe.Pointer(bp+24 /* &x */)).FM, (*DateTime)(unsafe.Pointer(bp+24 /* &x */)).FD))
+ Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([100]uint8{})), bp+72 /* &zBuf[0] */, ts+1289 /* "%04d-%02d-%02d" */, libc.VaList(bp, (*DateTime)(unsafe.Pointer(bp+24 /* &x */)).FY, (*DateTime)(unsafe.Pointer(bp+24 /* &x */)).FM, (*DateTime)(unsafe.Pointer(bp+24 /* &x */)).FD))
Xsqlite3_result_text(tls, context, bp+72 /* &zBuf[0] */, -1, libc.UintptrFromInt32(-1))
}
}
@@ -13565,223 +13993,151 @@ func dateFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sql
// %W week of year 00-53
// %Y year 0000-9999
// %% %
-func strftimeFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:23178:13: */
- bp := tls.Alloc(280)
- defer tls.Free(280)
+func strftimeFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:23697:13: */
+ bp := tls.Alloc(208)
+ defer tls.Free(208)
- // var x DateTime at bp+80, 48
+ // var x DateTime at bp+88, 48
- var n U64
var i Size_t
var j Size_t
- var z uintptr
var db uintptr
var zFmt uintptr
- // var zBuf [100]uint8 at bp+128, 100
+ // var sRes Sqlite3_str at bp+136, 24
if argc == 0 {
return
}
zFmt = Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv)))
- if (zFmt == uintptr(0)) || (isDate(tls, context, (argc-1), (argv+uintptr(1)*4), bp+80 /* &x */) != 0) {
+ if zFmt == uintptr(0) || isDate(tls, context, argc-1, argv+uintptr(1)*4, bp+88) != 0 {
return
}
db = Xsqlite3_context_db_handle(tls, context)
- i = Size_t(0)
- n = uint64(1)
-__1:
- if !(*(*uint8)(unsafe.Pointer(zFmt + uintptr(i))) != 0) {
- goto __3
- }
- {
- if int32(*(*uint8)(unsafe.Pointer(zFmt + uintptr(i)))) == '%' {
- switch int32(*(*uint8)(unsafe.Pointer(zFmt + uintptr((i + Size_t(1)))))) {
- case 'd':
- fallthrough
- case 'H':
- fallthrough
- case 'm':
- fallthrough
- case 'M':
- fallthrough
- case 'S':
- fallthrough
- case 'W':
- n++
- fallthrough
- // fall thru
- case 'w':
- fallthrough
- case '%':
- break
- fallthrough
- case 'f':
- n = n + (uint64(8))
+ Xsqlite3StrAccumInit(tls, bp+136 /* &sRes */, uintptr(0), uintptr(0), 0, *(*int32)(unsafe.Pointer(db + 120)))
+
+ computeJD(tls, bp+88 /* &x */)
+ computeYMD_HMS(tls, bp+88 /* &x */)
+ for i = libc.AssignUint32(&j, Size_t(0)); *(*uint8)(unsafe.Pointer(zFmt + uintptr(i))) != 0; i++ {
+ if int32(*(*uint8)(unsafe.Pointer(zFmt + uintptr(i)))) != '%' {
+ continue
+ }
+ if j < i {
+ Xsqlite3_str_append(tls, bp+136 /* &sRes */, zFmt+uintptr(j), int32(i-j))
+ }
+ i++
+ j = i + Size_t(1)
+ switch int32(*(*uint8)(unsafe.Pointer(zFmt + uintptr(i)))) {
+ case 'd':
+ {
+ Xsqlite3_str_appendf(tls, bp+136 /* &sRes */, ts+1304 /* "%02d" */, libc.VaList(bp, (*DateTime)(unsafe.Pointer(bp+88 /* &x */)).FD))
break
- fallthrough
- case 'j':
- n = n + (uint64(3))
+
+ }
+ case 'f':
+ {
+ var s float64 = (*DateTime)(unsafe.Pointer(bp + 88 /* &x */)).Fs
+ if s > 59.999 {
+ s = 59.999
+ }
+ Xsqlite3_str_appendf(tls, bp+136 /* &sRes */, ts+1309 /* "%06.3f" */, libc.VaList(bp+8, s))
break
- fallthrough
- case 'Y':
- n = n + (uint64(8))
+
+ }
+ case 'H':
+ {
+ Xsqlite3_str_appendf(tls, bp+136 /* &sRes */, ts+1304 /* "%02d" */, libc.VaList(bp+16, (*DateTime)(unsafe.Pointer(bp+88 /* &x */)).Fh))
break
- fallthrough
- case 's':
- fallthrough
- case 'J':
- n = n + (uint64(50))
+
+ }
+ case 'W':
+ fallthrough // Fall thru
+ case 'j':
+ {
+ var nDay int32 // Number of days since 1st day of year
+ *(*DateTime)(unsafe.Pointer(bp + 160 /* y */)) = *(*DateTime)(unsafe.Pointer(bp + 88 /* x */))
+ (*DateTime)(unsafe.Pointer(bp + 160 /* &y */)).FvalidJD = uint8(0)
+ (*DateTime)(unsafe.Pointer(bp + 160 /* &y */)).FM = 1
+ (*DateTime)(unsafe.Pointer(bp + 160 /* &y */)).FD = 1
+ computeJD(tls, bp+160 /* &y */)
+ nDay = int32(((*DateTime)(unsafe.Pointer(bp+88)).FiJD - (*DateTime)(unsafe.Pointer(bp+160)).FiJD + int64(43200000)) / int64(86400000))
+ if int32(*(*uint8)(unsafe.Pointer(zFmt + uintptr(i)))) == 'W' {
+ var wd int32 // 0=Monday, 1=Tuesday, ... 6=Sunday
+ wd = int32(((*DateTime)(unsafe.Pointer(bp+88)).FiJD + int64(43200000)) / int64(86400000) % int64(7))
+ Xsqlite3_str_appendf(tls, bp+136 /* &sRes */, ts+1304 /* "%02d" */, libc.VaList(bp+24, (nDay+7-wd)/7))
+ } else {
+ Xsqlite3_str_appendf(tls, bp+136 /* &sRes */, ts+1316 /* "%03d" */, libc.VaList(bp+32, nDay+1))
+ }
break
- fallthrough
- default:
- return // ERROR. return a NULL
+
}
- i++
- }
+ case 'J':
+ {
+ Xsqlite3_str_appendf(tls, bp+136 /* &sRes */, ts+1321 /* "%.16g" */, libc.VaList(bp+40, float64((*DateTime)(unsafe.Pointer(bp+88)).FiJD)/86400000.0))
+ break
- }
- goto __2
-__2:
- i++
- n++
- goto __1
- goto __3
-__3:
- ;
+ }
+ case 'm':
+ {
+ Xsqlite3_str_appendf(tls, bp+136 /* &sRes */, ts+1304 /* "%02d" */, libc.VaList(bp+48, (*DateTime)(unsafe.Pointer(bp+88 /* &x */)).FM))
+ break
- if n < U64(unsafe.Sizeof([100]uint8{})) {
- z = bp + 128 /* &zBuf[0] */
- } else if n > U64(*(*int32)(unsafe.Pointer((db + 112 /* &.aLimit */)))) {
- Xsqlite3_result_error_toobig(tls, context)
- return
- } else {
- z = Xsqlite3DbMallocRawNN(tls, db, uint64(int32(n)))
- if z == uintptr(0) {
- Xsqlite3_result_error_nomem(tls, context)
- return
- }
- }
- computeJD(tls, bp+80 /* &x */)
- computeYMD_HMS(tls, bp+80 /* &x */)
- for i = libc.AssignUint32(&j, Size_t(0)); *(*uint8)(unsafe.Pointer(zFmt + uintptr(i))) != 0; i++ {
- if int32(*(*uint8)(unsafe.Pointer(zFmt + uintptr(i)))) != '%' {
- *(*uint8)(unsafe.Pointer(z + uintptr(libc.PostIncUint32(&j, 1)))) = *(*uint8)(unsafe.Pointer(zFmt + uintptr(i)))
- } else {
- i++
- switch int32(*(*uint8)(unsafe.Pointer(zFmt + uintptr(i)))) {
- case 'd':
- Xsqlite3_snprintf(tls, 3, (z + uintptr(j)), ts+521 /* "%02d" */, libc.VaList(bp, (*DateTime)(unsafe.Pointer(bp+80 /* &x */)).FD))
- j = j + (Size_t(2))
+ }
+ case 'M':
+ {
+ Xsqlite3_str_appendf(tls, bp+136 /* &sRes */, ts+1304 /* "%02d" */, libc.VaList(bp+56, (*DateTime)(unsafe.Pointer(bp+88 /* &x */)).Fm))
break
- fallthrough
- case 'f':
- {
- var s float64 = (*DateTime)(unsafe.Pointer(bp + 80 /* &x */)).Fs
- if s > 59.999 {
- s = 59.999
- }
- Xsqlite3_snprintf(tls, 7, (z + uintptr(j)), ts+526 /* "%06.3f" */, libc.VaList(bp+8, s))
- j = j + (Size_t(Xsqlite3Strlen30(tls, (z + uintptr(j)))))
- break
- }
- fallthrough
- case 'H':
- Xsqlite3_snprintf(tls, 3, (z + uintptr(j)), ts+521 /* "%02d" */, libc.VaList(bp+16, (*DateTime)(unsafe.Pointer(bp+80 /* &x */)).Fh))
- j = j + (Size_t(2))
+ }
+ case 's':
+ {
+ var iS I64 = (*DateTime)(unsafe.Pointer(bp+88)).FiJD/int64(1000) - int64(21086676)*int64(10000)
+ Xsqlite3_str_appendf(tls, bp+136 /* &sRes */, ts+1327 /* "%lld" */, libc.VaList(bp+64, iS))
break
- fallthrough
- case 'W':
- fallthrough // Fall thru
- case 'j':
- {
- var nDay int32 // Number of days since 1st day of year
- *(*DateTime)(unsafe.Pointer(bp + 232 /* y */)) = *(*DateTime)(unsafe.Pointer(bp + 80 /* x */))
- (*DateTime)(unsafe.Pointer(bp + 232 /* &y */)).FvalidJD = uint8(0)
- (*DateTime)(unsafe.Pointer(bp + 232 /* &y */)).FM = 1
- (*DateTime)(unsafe.Pointer(bp + 232 /* &y */)).FD = 1
- computeJD(tls, bp+232 /* &y */)
- nDay = (int32((((*DateTime)(unsafe.Pointer(bp+80 /* &x */)).FiJD - (*DateTime)(unsafe.Pointer(bp+232 /* &y */)).FiJD) + int64(43200000)) / int64(86400000)))
- if int32(*(*uint8)(unsafe.Pointer(zFmt + uintptr(i)))) == 'W' {
- var wd int32 // 0=Monday, 1=Tuesday, ... 6=Sunday
- wd = (int32((((*DateTime)(unsafe.Pointer(bp+80 /* &x */)).FiJD + int64(43200000)) / int64(86400000)) % int64(7)))
- Xsqlite3_snprintf(tls, 3, (z + uintptr(j)), ts+521 /* "%02d" */, libc.VaList(bp+24, (((nDay+7)-wd)/7)))
- j = j + (Size_t(2))
- } else {
- Xsqlite3_snprintf(tls, 4, (z + uintptr(j)), ts+533 /* "%03d" */, libc.VaList(bp+32, (nDay+1)))
- j = j + (Size_t(3))
- }
- break
- }
- fallthrough
- case 'J':
- {
- Xsqlite3_snprintf(tls, 20, (z + uintptr(j)), ts+538 /* "%.16g" */, libc.VaList(bp+40, (float64((*DateTime)(unsafe.Pointer(bp+80 /* &x */)).FiJD)/86400000.0)))
- j = j + (Size_t(Xsqlite3Strlen30(tls, (z + uintptr(j)))))
- break
+ }
+ case 'S':
+ {
+ Xsqlite3_str_appendf(tls, bp+136 /* &sRes */, ts+1304 /* "%02d" */, libc.VaList(bp+72, libc.Int32FromFloat64((*DateTime)(unsafe.Pointer(bp+88 /* &x */)).Fs)))
+ break
- }
- fallthrough
- case 'm':
- Xsqlite3_snprintf(tls, 3, (z + uintptr(j)), ts+521 /* "%02d" */, libc.VaList(bp+48, (*DateTime)(unsafe.Pointer(bp+80 /* &x */)).FM))
- j = j + (Size_t(2))
+ }
+ case 'w':
+ {
+ Xsqlite3_str_appendchar(tls, bp+136 /* &sRes */, 1,
+ uint8(int32(uint8(((*DateTime)(unsafe.Pointer(bp+88)).FiJD+int64(129600000))/int64(86400000)%int64(7)))+'0'))
break
- fallthrough
- case 'M':
- Xsqlite3_snprintf(tls, 3, (z + uintptr(j)), ts+521 /* "%02d" */, libc.VaList(bp+56, (*DateTime)(unsafe.Pointer(bp+80 /* &x */)).Fm))
- j = j + (Size_t(2))
+
+ }
+ case 'Y':
+ {
+ Xsqlite3_str_appendf(tls, bp+136 /* &sRes */, ts+1332 /* "%04d" */, libc.VaList(bp+80, (*DateTime)(unsafe.Pointer(bp+88 /* &x */)).FY))
break
- fallthrough
- case 's':
- {
- var iS I64 = (((*DateTime)(unsafe.Pointer(bp+80 /* &x */)).FiJD / int64(1000)) - (int64(21086676) * int64(10000)))
- Xsqlite3Int64ToText(tls, iS, (z + uintptr(j)))
- j = j + (Size_t(Xsqlite3Strlen30(tls, (z + uintptr(j)))))
- break
- }
- fallthrough
- case 'S':
- Xsqlite3_snprintf(tls, 3, (z + uintptr(j)), ts+521 /* "%02d" */, libc.VaList(bp+64, libc.Int32FromFloat64((*DateTime)(unsafe.Pointer(bp+80 /* &x */)).Fs)))
- j = j + (Size_t(2))
+ }
+ case '%':
+ {
+ Xsqlite3_str_appendchar(tls, bp+136 /* &sRes */, 1, uint8('%'))
break
- fallthrough
- case 'w':
- {
- *(*uint8)(unsafe.Pointer(z + uintptr(libc.PostIncUint32(&j, 1)))) = (uint8(int32((uint8((((*DateTime)(unsafe.Pointer(bp+80 /* &x */)).FiJD + int64(129600000)) / int64(86400000)) % int64(7)))) + '0'))
- break
- }
- fallthrough
- case 'Y':
- {
- Xsqlite3_snprintf(tls, 5, (z + uintptr(j)), ts+544 /* "%04d" */, libc.VaList(bp+72, (*DateTime)(unsafe.Pointer(bp+80 /* &x */)).FY))
- j = j + (Size_t(Xsqlite3Strlen30(tls, (z + uintptr(j)))))
- break
+ }
+ default:
+ {
+ Xsqlite3_str_reset(tls, bp+136 /* &sRes */)
+ return
- }
- fallthrough
- default:
- *(*uint8)(unsafe.Pointer(z + uintptr(libc.PostIncUint32(&j, 1)))) = uint8('%')
- break
}
}
}
- *(*uint8)(unsafe.Pointer(z + uintptr(j))) = uint8(0)
- Xsqlite3_result_text(tls, context, z, -1,
- func() uintptr {
- if z == bp+128 /* zBuf */ {
- return libc.UintptrFromInt32(-1)
- }
- return *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{Xsqlite3OomFault}))
- }())
+ if j < i {
+ Xsqlite3_str_append(tls, bp+136 /* &sRes */, zFmt+uintptr(j), int32(i-j))
+ }
+ Xsqlite3ResultStrAccum(tls, context, bp+136 /* &sRes */)
}
// current_time()
//
// This function returns the same value as time('now').
-func ctimeFunc(tls *libc.TLS, context uintptr, NotUsed int32, NotUsed2 uintptr) { /* sqlite3.c:23316:13: */
+func ctimeFunc(tls *libc.TLS, context uintptr, NotUsed int32, NotUsed2 uintptr) { /* sqlite3.c:23804:13: */
_ = NotUsed
_ = NotUsed2
timeFunc(tls, context, 0, uintptr(0))
@@ -13790,7 +14146,7 @@ func ctimeFunc(tls *libc.TLS, context uintptr, NotUsed int32, NotUsed2 uintptr)
// current_date()
//
// This function returns the same value as date('now').
-func cdateFunc(tls *libc.TLS, context uintptr, NotUsed int32, NotUsed2 uintptr) { /* sqlite3.c:23330:13: */
+func cdateFunc(tls *libc.TLS, context uintptr, NotUsed int32, NotUsed2 uintptr) { /* sqlite3.c:23818:13: */
_ = NotUsed
_ = NotUsed2
dateFunc(tls, context, 0, uintptr(0))
@@ -13799,7 +14155,7 @@ func cdateFunc(tls *libc.TLS, context uintptr, NotUsed int32, NotUsed2 uintptr)
// current_timestamp()
//
// This function returns the same value as datetime('now').
-func ctimestampFunc(tls *libc.TLS, context uintptr, NotUsed int32, NotUsed2 uintptr) { /* sqlite3.c:23344:13: */
+func ctimestampFunc(tls *libc.TLS, context uintptr, NotUsed int32, NotUsed2 uintptr) { /* sqlite3.c:23832:13: */
_ = NotUsed
_ = NotUsed2
datetimeFunc(tls, context, 0, uintptr(0))
@@ -13808,19 +14164,19 @@ func ctimestampFunc(tls *libc.TLS, context uintptr, NotUsed int32, NotUsed2 uint
// This function registered all of the above C functions as SQL
// functions. This should be the only routine in this file with
// external linkage.
-func Xsqlite3RegisterDateTimeFunctions(tls *libc.TLS) { /* sqlite3.c:23404:21: */
- Xsqlite3InsertBuiltinFuncs(tls, uintptr(unsafe.Pointer(&aDateTimeFuncs)), (int32(uint32(unsafe.Sizeof(aDateTimeFuncs)) / uint32(unsafe.Sizeof(FuncDef{})))))
+func Xsqlite3RegisterDateTimeFunctions(tls *libc.TLS) { /* sqlite3.c:23892:21: */
+ Xsqlite3InsertBuiltinFuncs(tls, uintptr(unsafe.Pointer(&aDateTimeFuncs)), int32(uint32(unsafe.Sizeof(aDateTimeFuncs))/uint32(unsafe.Sizeof(FuncDef{}))))
}
var aDateTimeFuncs = [8]FuncDef{
- {FnArg: int8(-1), FfuncFlags: (U32((SQLITE_FUNC_SLOCHNG | SQLITE_UTF8) | SQLITE_FUNC_CONSTANT)), FpUserData: 0, FxSFunc: 0, FzName: ts + 549 /* "julianday" */},
- {FnArg: int8(-1), FfuncFlags: (U32((SQLITE_FUNC_SLOCHNG | SQLITE_UTF8) | SQLITE_FUNC_CONSTANT)), FpUserData: 0, FxSFunc: 0, FzName: ts + 559 /* "date" */},
- {FnArg: int8(-1), FfuncFlags: (U32((SQLITE_FUNC_SLOCHNG | SQLITE_UTF8) | SQLITE_FUNC_CONSTANT)), FpUserData: 0, FxSFunc: 0, FzName: ts + 564 /* "time" */},
- {FnArg: int8(-1), FfuncFlags: (U32((SQLITE_FUNC_SLOCHNG | SQLITE_UTF8) | SQLITE_FUNC_CONSTANT)), FpUserData: 0, FxSFunc: 0, FzName: ts + 569 /* "datetime" */},
- {FnArg: int8(-1), FfuncFlags: (U32((SQLITE_FUNC_SLOCHNG | SQLITE_UTF8) | SQLITE_FUNC_CONSTANT)), FpUserData: 0, FxSFunc: 0, FzName: ts + 578 /* "strftime" */},
- {FfuncFlags: (U32(SQLITE_FUNC_SLOCHNG | SQLITE_UTF8)), FxSFunc: 0, FzName: ts + 587 /* "current_time" */},
- {FfuncFlags: (U32(SQLITE_FUNC_SLOCHNG | SQLITE_UTF8)), FxSFunc: 0, FzName: ts + 600 /* "current_timestam..." */},
- {FfuncFlags: (U32(SQLITE_FUNC_SLOCHNG | SQLITE_UTF8)), FxSFunc: 0, FzName: ts + 618 /* "current_date" */}} /* sqlite3.c:23405:18 */
+ {FnArg: int8(-1), FfuncFlags: U32(SQLITE_FUNC_BUILTIN | SQLITE_FUNC_SLOCHNG | SQLITE_UTF8 | SQLITE_FUNC_CONSTANT), FpUserData: 0, FxSFunc: 0, FzName: ts + 1337 /* "julianday" */},
+ {FnArg: int8(-1), FfuncFlags: U32(SQLITE_FUNC_BUILTIN | SQLITE_FUNC_SLOCHNG | SQLITE_UTF8 | SQLITE_FUNC_CONSTANT), FpUserData: 0, FxSFunc: 0, FzName: ts + 1347 /* "date" */},
+ {FnArg: int8(-1), FfuncFlags: U32(SQLITE_FUNC_BUILTIN | SQLITE_FUNC_SLOCHNG | SQLITE_UTF8 | SQLITE_FUNC_CONSTANT), FpUserData: 0, FxSFunc: 0, FzName: ts + 1352 /* "time" */},
+ {FnArg: int8(-1), FfuncFlags: U32(SQLITE_FUNC_BUILTIN | SQLITE_FUNC_SLOCHNG | SQLITE_UTF8 | SQLITE_FUNC_CONSTANT), FpUserData: 0, FxSFunc: 0, FzName: ts + 1357 /* "datetime" */},
+ {FnArg: int8(-1), FfuncFlags: U32(SQLITE_FUNC_BUILTIN | SQLITE_FUNC_SLOCHNG | SQLITE_UTF8 | SQLITE_FUNC_CONSTANT), FpUserData: 0, FxSFunc: 0, FzName: ts + 1366 /* "strftime" */},
+ {FfuncFlags: U32(SQLITE_FUNC_BUILTIN | SQLITE_FUNC_SLOCHNG | SQLITE_UTF8), FxSFunc: 0, FzName: ts + 1375 /* "current_time" */},
+ {FfuncFlags: U32(SQLITE_FUNC_BUILTIN | SQLITE_FUNC_SLOCHNG | SQLITE_UTF8), FxSFunc: 0, FzName: ts + 1388 /* "current_timestam..." */},
+ {FfuncFlags: U32(SQLITE_FUNC_BUILTIN | SQLITE_FUNC_SLOCHNG | SQLITE_UTF8), FxSFunc: 0, FzName: ts + 1406 /* "current_date" */}} /* sqlite3.c:23893:18 */
//************* End of date.c ***********************************************
//************* Begin file os.c *********************************************
@@ -13872,7 +14228,7 @@ var aDateTimeFuncs = [8]FuncDef{
// of the sqlite3_file object. This is mostly just syntactic sugar. All
// of this would be completely automatic if SQLite were coded using
// C++ instead of plain old C.
-func Xsqlite3OsClose(tls *libc.TLS, pId uintptr) { /* sqlite3.c:23507:21: */
+func Xsqlite3OsClose(tls *libc.TLS, pId uintptr) { /* sqlite3.c:23995:21: */
if (*Sqlite3_file)(unsafe.Pointer(pId)).FpMethods != 0 {
(*struct {
f func(*libc.TLS, uintptr) int32
@@ -13881,27 +14237,27 @@ func Xsqlite3OsClose(tls *libc.TLS, pId uintptr) { /* sqlite3.c:23507:21: */
}
}
-func Xsqlite3OsRead(tls *libc.TLS, id uintptr, pBuf uintptr, amt int32, offset I64) int32 { /* sqlite3.c:23513:20: */
+func Xsqlite3OsRead(tls *libc.TLS, id uintptr, pBuf uintptr, amt int32, offset I64) int32 { /* sqlite3.c:24001:20: */
return (*struct {
f func(*libc.TLS, uintptr, uintptr, int32, Sqlite3_int64) int32
})(unsafe.Pointer(&struct{ uintptr }{(*sqlite3_io_methods)(unsafe.Pointer((*Sqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxRead})).f(tls, id, pBuf, amt, offset)
}
-func Xsqlite3OsWrite(tls *libc.TLS, id uintptr, pBuf uintptr, amt int32, offset I64) int32 { /* sqlite3.c:23517:20: */
+func Xsqlite3OsWrite(tls *libc.TLS, id uintptr, pBuf uintptr, amt int32, offset I64) int32 { /* sqlite3.c:24005:20: */
return (*struct {
f func(*libc.TLS, uintptr, uintptr, int32, Sqlite3_int64) int32
})(unsafe.Pointer(&struct{ uintptr }{(*sqlite3_io_methods)(unsafe.Pointer((*Sqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxWrite})).f(tls, id, pBuf, amt, offset)
}
-func Xsqlite3OsTruncate(tls *libc.TLS, id uintptr, size I64) int32 { /* sqlite3.c:23521:20: */
+func Xsqlite3OsTruncate(tls *libc.TLS, id uintptr, size I64) int32 { /* sqlite3.c:24009:20: */
return (*struct {
f func(*libc.TLS, uintptr, Sqlite3_int64) int32
})(unsafe.Pointer(&struct{ uintptr }{(*sqlite3_io_methods)(unsafe.Pointer((*Sqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxTruncate})).f(tls, id, size)
}
-func Xsqlite3OsSync(tls *libc.TLS, id uintptr, flags int32) int32 { /* sqlite3.c:23524:20: */
+func Xsqlite3OsSync(tls *libc.TLS, id uintptr, flags int32) int32 { /* sqlite3.c:24012:20: */
if flags != 0 {
return (*struct {
@@ -13911,27 +14267,27 @@ func Xsqlite3OsSync(tls *libc.TLS, id uintptr, flags int32) int32 { /* sqlite3.c
return SQLITE_OK
}
-func Xsqlite3OsFileSize(tls *libc.TLS, id uintptr, pSize uintptr) int32 { /* sqlite3.c:23528:20: */
+func Xsqlite3OsFileSize(tls *libc.TLS, id uintptr, pSize uintptr) int32 { /* sqlite3.c:24016:20: */
return (*struct {
f func(*libc.TLS, uintptr, uintptr) int32
})(unsafe.Pointer(&struct{ uintptr }{(*sqlite3_io_methods)(unsafe.Pointer((*Sqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxFileSize})).f(tls, id, pSize)
}
-func Xsqlite3OsLock(tls *libc.TLS, id uintptr, lockType int32) int32 { /* sqlite3.c:23532:20: */
+func Xsqlite3OsLock(tls *libc.TLS, id uintptr, lockType int32) int32 { /* sqlite3.c:24020:20: */
return (*struct {
f func(*libc.TLS, uintptr, int32) int32
})(unsafe.Pointer(&struct{ uintptr }{(*sqlite3_io_methods)(unsafe.Pointer((*Sqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxLock})).f(tls, id, lockType)
}
-func Xsqlite3OsUnlock(tls *libc.TLS, id uintptr, lockType int32) int32 { /* sqlite3.c:23536:20: */
+func Xsqlite3OsUnlock(tls *libc.TLS, id uintptr, lockType int32) int32 { /* sqlite3.c:24024:20: */
return (*struct {
f func(*libc.TLS, uintptr, int32) int32
})(unsafe.Pointer(&struct{ uintptr }{(*sqlite3_io_methods)(unsafe.Pointer((*Sqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxUnlock})).f(tls, id, lockType)
}
-func Xsqlite3OsCheckReservedLock(tls *libc.TLS, id uintptr, pResOut uintptr) int32 { /* sqlite3.c:23539:20: */
+func Xsqlite3OsCheckReservedLock(tls *libc.TLS, id uintptr, pResOut uintptr) int32 { /* sqlite3.c:24027:20: */
return (*struct {
f func(*libc.TLS, uintptr, uintptr) int32
@@ -13944,7 +14300,7 @@ func Xsqlite3OsCheckReservedLock(tls *libc.TLS, id uintptr, pResOut uintptr) int
// really care if the VFS receives and understands the information since it
// is only a hint and can be safely ignored. The sqlite3OsFileControlHint()
// routine has no return value since the return value would be meaningless.
-func Xsqlite3OsFileControl(tls *libc.TLS, id uintptr, op int32, pArg uintptr) int32 { /* sqlite3.c:23552:20: */
+func Xsqlite3OsFileControl(tls *libc.TLS, id uintptr, op int32, pArg uintptr) int32 { /* sqlite3.c:24040:20: */
if (*Sqlite3_file)(unsafe.Pointer(id)).FpMethods == uintptr(0) {
return SQLITE_NOTFOUND
}
@@ -13953,7 +14309,7 @@ func Xsqlite3OsFileControl(tls *libc.TLS, id uintptr, op int32, pArg uintptr) in
})(unsafe.Pointer(&struct{ uintptr }{(*sqlite3_io_methods)(unsafe.Pointer((*Sqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxFileControl})).f(tls, id, op, pArg)
}
-func Xsqlite3OsFileControlHint(tls *libc.TLS, id uintptr, op int32, pArg uintptr) { /* sqlite3.c:23580:21: */
+func Xsqlite3OsFileControlHint(tls *libc.TLS, id uintptr, op int32, pArg uintptr) { /* sqlite3.c:24068:21: */
if (*Sqlite3_file)(unsafe.Pointer(id)).FpMethods != 0 {
(*struct {
f func(*libc.TLS, uintptr, int32, uintptr) int32
@@ -13961,7 +14317,7 @@ func Xsqlite3OsFileControlHint(tls *libc.TLS, id uintptr, op int32, pArg uintptr
}
}
-func Xsqlite3OsSectorSize(tls *libc.TLS, id uintptr) int32 { /* sqlite3.c:23584:20: */
+func Xsqlite3OsSectorSize(tls *libc.TLS, id uintptr) int32 { /* sqlite3.c:24072:20: */
var xSectorSize uintptr = (*sqlite3_io_methods)(unsafe.Pointer((*Sqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxSectorSize
return func() int32 {
if xSectorSize != 0 {
@@ -13973,29 +14329,32 @@ func Xsqlite3OsSectorSize(tls *libc.TLS, id uintptr) int32 { /* sqlite3.c:23584:
}()
}
-func Xsqlite3OsDeviceCharacteristics(tls *libc.TLS, id uintptr) int32 { /* sqlite3.c:23588:20: */
+func Xsqlite3OsDeviceCharacteristics(tls *libc.TLS, id uintptr) int32 { /* sqlite3.c:24076:20: */
+ if (*Sqlite3_file)(unsafe.Pointer(id)).FpMethods == uintptr(0) {
+ return 0
+ }
return (*struct {
f func(*libc.TLS, uintptr) int32
})(unsafe.Pointer(&struct{ uintptr }{(*sqlite3_io_methods)(unsafe.Pointer((*Sqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxDeviceCharacteristics})).f(tls, id)
}
-func Xsqlite3OsShmLock(tls *libc.TLS, id uintptr, offset int32, n int32, flags int32) int32 { /* sqlite3.c:23592:20: */
+func Xsqlite3OsShmLock(tls *libc.TLS, id uintptr, offset int32, n int32, flags int32) int32 { /* sqlite3.c:24081:20: */
return (*struct {
f func(*libc.TLS, uintptr, int32, int32, int32) int32
})(unsafe.Pointer(&struct{ uintptr }{(*sqlite3_io_methods)(unsafe.Pointer((*Sqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxShmLock})).f(tls, id, offset, n, flags)
}
-func Xsqlite3OsShmBarrier(tls *libc.TLS, id uintptr) { /* sqlite3.c:23595:21: */
+func Xsqlite3OsShmBarrier(tls *libc.TLS, id uintptr) { /* sqlite3.c:24084:21: */
(*struct{ f func(*libc.TLS, uintptr) })(unsafe.Pointer(&struct{ uintptr }{(*sqlite3_io_methods)(unsafe.Pointer((*Sqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxShmBarrier})).f(tls, id)
}
-func Xsqlite3OsShmUnmap(tls *libc.TLS, id uintptr, deleteFlag int32) int32 { /* sqlite3.c:23598:20: */
+func Xsqlite3OsShmUnmap(tls *libc.TLS, id uintptr, deleteFlag int32) int32 { /* sqlite3.c:24087:20: */
return (*struct {
f func(*libc.TLS, uintptr, int32) int32
})(unsafe.Pointer(&struct{ uintptr }{(*sqlite3_io_methods)(unsafe.Pointer((*Sqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxShmUnmap})).f(tls, id, deleteFlag)
}
-func Xsqlite3OsShmMap(tls *libc.TLS, id uintptr, iPage int32, pgsz int32, bExtend int32, pp uintptr) int32 { /* sqlite3.c:23601:20: */
+func Xsqlite3OsShmMap(tls *libc.TLS, id uintptr, iPage int32, pgsz int32, bExtend int32, pp uintptr) int32 { /* sqlite3.c:24090:20: */
return (*struct {
f func(*libc.TLS, uintptr, int32, int32, int32, uintptr) int32
@@ -14003,14 +14362,14 @@ func Xsqlite3OsShmMap(tls *libc.TLS, id uintptr, iPage int32, pgsz int32, bExten
}
// The real implementation of xFetch and xUnfetch
-func Xsqlite3OsFetch(tls *libc.TLS, id uintptr, iOff I64, iAmt int32, pp uintptr) int32 { /* sqlite3.c:23615:20: */
+func Xsqlite3OsFetch(tls *libc.TLS, id uintptr, iOff I64, iAmt int32, pp uintptr) int32 { /* sqlite3.c:24104:20: */
return (*struct {
f func(*libc.TLS, uintptr, Sqlite3_int64, int32, uintptr) int32
})(unsafe.Pointer(&struct{ uintptr }{(*sqlite3_io_methods)(unsafe.Pointer((*Sqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxFetch})).f(tls, id, iOff, iAmt, pp)
}
-func Xsqlite3OsUnfetch(tls *libc.TLS, id uintptr, iOff I64, p uintptr) int32 { /* sqlite3.c:23619:20: */
+func Xsqlite3OsUnfetch(tls *libc.TLS, id uintptr, iOff I64, p uintptr) int32 { /* sqlite3.c:24108:20: */
return (*struct {
f func(*libc.TLS, uintptr, Sqlite3_int64, uintptr) int32
})(unsafe.Pointer(&struct{ uintptr }{(*sqlite3_io_methods)(unsafe.Pointer((*Sqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxUnfetch})).f(tls, id, iOff, p)
@@ -14018,7 +14377,7 @@ func Xsqlite3OsUnfetch(tls *libc.TLS, id uintptr, iOff I64, p uintptr) int32 { /
// The next group of routines are convenience wrappers around the
// VFS methods.
-func Xsqlite3OsOpen(tls *libc.TLS, pVfs uintptr, zPath uintptr, pFile uintptr, flags int32, pFlagsOut uintptr) int32 { /* sqlite3.c:23637:20: */
+func Xsqlite3OsOpen(tls *libc.TLS, pVfs uintptr, zPath uintptr, pFile uintptr, flags int32, pFlagsOut uintptr) int32 { /* sqlite3.c:24126:20: */
var rc int32
// 0x87f7f is a mask of SQLITE_OPEN_ flags that are valid to be passed
@@ -14027,12 +14386,12 @@ func Xsqlite3OsOpen(tls *libc.TLS, pVfs uintptr, zPath uintptr, pFile uintptr, f
// reaching the VFS.
rc = (*struct {
f func(*libc.TLS, uintptr, uintptr, uintptr, int32, uintptr) int32
- })(unsafe.Pointer(&struct{ uintptr }{(*Sqlite3_vfs)(unsafe.Pointer(pVfs)).FxOpen})).f(tls, pVfs, zPath, pFile, (flags & 0x1087f7f), pFlagsOut)
+ })(unsafe.Pointer(&struct{ uintptr }{(*Sqlite3_vfs)(unsafe.Pointer(pVfs)).FxOpen})).f(tls, pVfs, zPath, pFile, flags&0x1087f7f, pFlagsOut)
return rc
}
-func Xsqlite3OsDelete(tls *libc.TLS, pVfs uintptr, zPath uintptr, dirSync int32) int32 { /* sqlite3.c:23654:20: */
+func Xsqlite3OsDelete(tls *libc.TLS, pVfs uintptr, zPath uintptr, dirSync int32) int32 { /* sqlite3.c:24143:20: */
if (*Sqlite3_vfs)(unsafe.Pointer(pVfs)).FxDelete != uintptr(0) {
return (*struct {
@@ -14042,14 +14401,14 @@ func Xsqlite3OsDelete(tls *libc.TLS, pVfs uintptr, zPath uintptr, dirSync int32)
return SQLITE_OK
}
-func Xsqlite3OsAccess(tls *libc.TLS, pVfs uintptr, zPath uintptr, flags int32, pResOut uintptr) int32 { /* sqlite3.c:23659:20: */
+func Xsqlite3OsAccess(tls *libc.TLS, pVfs uintptr, zPath uintptr, flags int32, pResOut uintptr) int32 { /* sqlite3.c:24148:20: */
return (*struct {
f func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32
})(unsafe.Pointer(&struct{ uintptr }{(*Sqlite3_vfs)(unsafe.Pointer(pVfs)).FxAccess})).f(tls, pVfs, zPath, flags, pResOut)
}
-func Xsqlite3OsFullPathname(tls *libc.TLS, pVfs uintptr, zPath uintptr, nPathOut int32, zPathOut uintptr) int32 { /* sqlite3.c:23668:20: */
+func Xsqlite3OsFullPathname(tls *libc.TLS, pVfs uintptr, zPath uintptr, nPathOut int32, zPathOut uintptr) int32 { /* sqlite3.c:24157:20: */
*(*uint8)(unsafe.Pointer(zPathOut)) = uint8(0)
return (*struct {
@@ -14057,7 +14416,7 @@ func Xsqlite3OsFullPathname(tls *libc.TLS, pVfs uintptr, zPath uintptr, nPathOut
})(unsafe.Pointer(&struct{ uintptr }{(*Sqlite3_vfs)(unsafe.Pointer(pVfs)).FxFullPathname})).f(tls, pVfs, zPath, nPathOut, zPathOut)
}
-func Xsqlite3OsDlOpen(tls *libc.TLS, pVfs uintptr, zPath uintptr) uintptr { /* sqlite3.c:23679:21: */
+func Xsqlite3OsDlOpen(tls *libc.TLS, pVfs uintptr, zPath uintptr) uintptr { /* sqlite3.c:24168:21: */
// tag-20210611-1
return (*struct {
@@ -14065,31 +14424,31 @@ func Xsqlite3OsDlOpen(tls *libc.TLS, pVfs uintptr, zPath uintptr) uintptr { /* s
})(unsafe.Pointer(&struct{ uintptr }{(*Sqlite3_vfs)(unsafe.Pointer(pVfs)).FxDlOpen})).f(tls, pVfs, zPath)
}
-func Xsqlite3OsDlError(tls *libc.TLS, pVfs uintptr, nByte int32, zBufOut uintptr) { /* sqlite3.c:23684:21: */
+func Xsqlite3OsDlError(tls *libc.TLS, pVfs uintptr, nByte int32, zBufOut uintptr) { /* sqlite3.c:24173:21: */
(*struct {
f func(*libc.TLS, uintptr, int32, uintptr)
})(unsafe.Pointer(&struct{ uintptr }{(*Sqlite3_vfs)(unsafe.Pointer(pVfs)).FxDlError})).f(tls, pVfs, nByte, zBufOut)
}
-func Xsqlite3OsDlSym(tls *libc.TLS, pVfs uintptr, pHdle uintptr, zSym uintptr) uintptr { /* sqlite3.c:23687:21: */
+func Xsqlite3OsDlSym(tls *libc.TLS, pVfs uintptr, pHdle uintptr, zSym uintptr) uintptr { /* sqlite3.c:24176:21: */
return (*struct {
f func(*libc.TLS, uintptr, uintptr, uintptr) uintptr
})(unsafe.Pointer(&struct{ uintptr }{(*Sqlite3_vfs)(unsafe.Pointer(pVfs)).FxDlSym})).f(tls, pVfs, pHdle, zSym)
}
-func Xsqlite3OsDlClose(tls *libc.TLS, pVfs uintptr, pHandle uintptr) { /* sqlite3.c:23690:21: */
+func Xsqlite3OsDlClose(tls *libc.TLS, pVfs uintptr, pHandle uintptr) { /* sqlite3.c:24179:21: */
(*struct {
f func(*libc.TLS, uintptr, uintptr)
})(unsafe.Pointer(&struct{ uintptr }{(*Sqlite3_vfs)(unsafe.Pointer(pVfs)).FxDlClose})).f(tls, pVfs, pHandle)
}
-func Xsqlite3OsRandomness(tls *libc.TLS, pVfs uintptr, nByte int32, zBufOut uintptr) int32 { /* sqlite3.c:23694:20: */
+func Xsqlite3OsRandomness(tls *libc.TLS, pVfs uintptr, nByte int32, zBufOut uintptr) int32 { /* sqlite3.c:24183:20: */
if Xsqlite3Config.FiPrngSeed != 0 {
libc.Xmemset(tls, zBufOut, 0, uint32(nByte))
if nByte > int32(unsafe.Sizeof(uint32(0))) {
nByte = int32(unsafe.Sizeof(uint32(0)))
}
- libc.Xmemcpy(tls, zBufOut, (uintptr(unsafe.Pointer(&Xsqlite3Config)) + 272 /* &.iPrngSeed */), uint32(nByte))
+ libc.Xmemcpy(tls, zBufOut, uintptr(unsafe.Pointer(&Xsqlite3Config))+272, uint32(nByte))
return SQLITE_OK
} else {
return (*struct {
@@ -14100,13 +14459,13 @@ func Xsqlite3OsRandomness(tls *libc.TLS, pVfs uintptr, nByte int32, zBufOut uint
}
-func Xsqlite3OsSleep(tls *libc.TLS, pVfs uintptr, nMicro int32) int32 { /* sqlite3.c:23705:20: */
+func Xsqlite3OsSleep(tls *libc.TLS, pVfs uintptr, nMicro int32) int32 { /* sqlite3.c:24194:20: */
return (*struct {
f func(*libc.TLS, uintptr, int32) int32
})(unsafe.Pointer(&struct{ uintptr }{(*Sqlite3_vfs)(unsafe.Pointer(pVfs)).FxSleep})).f(tls, pVfs, nMicro)
}
-func Xsqlite3OsGetLastError(tls *libc.TLS, pVfs uintptr) int32 { /* sqlite3.c:23708:20: */
+func Xsqlite3OsGetLastError(tls *libc.TLS, pVfs uintptr) int32 { /* sqlite3.c:24197:20: */
if (*Sqlite3_vfs)(unsafe.Pointer(pVfs)).FxGetLastError != 0 {
return (*struct {
f func(*libc.TLS, uintptr, int32, uintptr) int32
@@ -14115,7 +14474,7 @@ func Xsqlite3OsGetLastError(tls *libc.TLS, pVfs uintptr) int32 { /* sqlite3.c:23
return 0
}
-func Xsqlite3OsCurrentTimeInt64(tls *libc.TLS, pVfs uintptr, pTimeOut uintptr) int32 { /* sqlite3.c:23711:20: */
+func Xsqlite3OsCurrentTimeInt64(tls *libc.TLS, pVfs uintptr, pTimeOut uintptr) int32 { /* sqlite3.c:24200:20: */
bp := tls.Alloc(8)
defer tls.Free(8)
@@ -14125,7 +14484,7 @@ func Xsqlite3OsCurrentTimeInt64(tls *libc.TLS, pVfs uintptr, pTimeOut uintptr) i
// (if iVersion is 2 or greater and the function pointer is not NULL) and
// will fall back to xCurrentTime() if xCurrentTimeInt64() is
// unavailable.
- if ((*Sqlite3_vfs)(unsafe.Pointer(pVfs)).FiVersion >= 2) && ((*Sqlite3_vfs)(unsafe.Pointer(pVfs)).FxCurrentTimeInt64 != 0) {
+ if (*Sqlite3_vfs)(unsafe.Pointer(pVfs)).FiVersion >= 2 && (*Sqlite3_vfs)(unsafe.Pointer(pVfs)).FxCurrentTimeInt64 != 0 {
rc = (*struct {
f func(*libc.TLS, uintptr, uintptr) int32
})(unsafe.Pointer(&struct{ uintptr }{(*Sqlite3_vfs)(unsafe.Pointer(pVfs)).FxCurrentTimeInt64})).f(tls, pVfs, pTimeOut)
@@ -14135,12 +14494,12 @@ func Xsqlite3OsCurrentTimeInt64(tls *libc.TLS, pVfs uintptr, pTimeOut uintptr) i
rc = (*struct {
f func(*libc.TLS, uintptr, uintptr) int32
})(unsafe.Pointer(&struct{ uintptr }{(*Sqlite3_vfs)(unsafe.Pointer(pVfs)).FxCurrentTime})).f(tls, pVfs, bp /* &r */)
- *(*Sqlite3_int64)(unsafe.Pointer(pTimeOut)) = (libc.Int64FromFloat64(*(*float64)(unsafe.Pointer(bp /* r */)) * 86400000.0))
+ *(*Sqlite3_int64)(unsafe.Pointer(pTimeOut)) = libc.Int64FromFloat64(*(*float64)(unsafe.Pointer(bp)) * 86400000.0)
}
return rc
}
-func Xsqlite3OsOpenMalloc(tls *libc.TLS, pVfs uintptr, zFile uintptr, ppFile uintptr, flags int32, pOutFlags uintptr) int32 { /* sqlite3.c:23729:20: */
+func Xsqlite3OsOpenMalloc(tls *libc.TLS, pVfs uintptr, zFile uintptr, ppFile uintptr, flags int32, pOutFlags uintptr) int32 { /* sqlite3.c:24218:20: */
var rc int32
var pFile uintptr
pFile = Xsqlite3MallocZero(tls, uint64((*Sqlite3_vfs)(unsafe.Pointer(pVfs)).FszOsFile))
@@ -14148,16 +14507,19 @@ func Xsqlite3OsOpenMalloc(tls *libc.TLS, pVfs uintptr, zFile uintptr, ppFile uin
rc = Xsqlite3OsOpen(tls, pVfs, zFile, pFile, flags, pOutFlags)
if rc != SQLITE_OK {
Xsqlite3_free(tls, pFile)
+ *(*uintptr)(unsafe.Pointer(ppFile)) = uintptr(0)
} else {
*(*uintptr)(unsafe.Pointer(ppFile)) = pFile
}
} else {
+ *(*uintptr)(unsafe.Pointer(ppFile)) = uintptr(0)
rc = SQLITE_NOMEM
}
+
return rc
}
-func Xsqlite3OsCloseFree(tls *libc.TLS, pFile uintptr) { /* sqlite3.c:23751:21: */
+func Xsqlite3OsCloseFree(tls *libc.TLS, pFile uintptr) { /* sqlite3.c:24243:21: */
Xsqlite3OsClose(tls, pFile)
Xsqlite3_free(tls, pFile)
@@ -14167,7 +14529,7 @@ func Xsqlite3OsCloseFree(tls *libc.TLS, pFile uintptr) { /* sqlite3.c:23751:21:
// sqlite3_os_init(). The purpose of the wrapper is to provide the
// ability to simulate a malloc failure, so that the handling of an
// error in sqlite3_os_init() by the upper layers can be tested.
-func Xsqlite3OsInit(tls *libc.TLS) int32 { /* sqlite3.c:23763:20: */
+func Xsqlite3OsInit(tls *libc.TLS) int32 { /* sqlite3.c:24255:20: */
var p uintptr = Xsqlite3_malloc(tls, 10)
if p == uintptr(0) {
return SQLITE_NOMEM
@@ -14177,11 +14539,11 @@ func Xsqlite3OsInit(tls *libc.TLS) int32 { /* sqlite3.c:23763:20: */
}
// The list of all registered VFS implementations.
-var vfsList uintptr = uintptr(0) /* sqlite3.c:23773:20 */
+var vfsList uintptr = uintptr(0) /* sqlite3.c:24265:20 */
// Locate a VFS by name. If no name is given, simply return the
// first VFS on the list.
-func Xsqlite3_vfs_find(tls *libc.TLS, zVfs uintptr) uintptr { /* sqlite3.c:23780:24: */
+func Xsqlite3_vfs_find(tls *libc.TLS, zVfs uintptr) uintptr { /* sqlite3.c:24272:24: */
var pVfs uintptr = uintptr(0)
var mutex uintptr
var rc int32 = Xsqlite3_initialize(tls)
@@ -14203,7 +14565,7 @@ func Xsqlite3_vfs_find(tls *libc.TLS, zVfs uintptr) uintptr { /* sqlite3.c:23780
}
// Unlink a VFS from the linked list
-func vfsUnlink(tls *libc.TLS, pVfs uintptr) { /* sqlite3.c:23804:13: */
+func vfsUnlink(tls *libc.TLS, pVfs uintptr) { /* sqlite3.c:24296:13: */
if pVfs == uintptr(0) {
// No-op
@@ -14211,7 +14573,7 @@ func vfsUnlink(tls *libc.TLS, pVfs uintptr) { /* sqlite3.c:23804:13: */
vfsList = (*Sqlite3_vfs)(unsafe.Pointer(pVfs)).FpNext
} else if vfsList != 0 {
var p uintptr = vfsList
- for ((*Sqlite3_vfs)(unsafe.Pointer(p)).FpNext != 0) && ((*Sqlite3_vfs)(unsafe.Pointer(p)).FpNext != pVfs) {
+ for (*Sqlite3_vfs)(unsafe.Pointer(p)).FpNext != 0 && (*Sqlite3_vfs)(unsafe.Pointer(p)).FpNext != pVfs {
p = (*Sqlite3_vfs)(unsafe.Pointer(p)).FpNext
}
if (*Sqlite3_vfs)(unsafe.Pointer(p)).FpNext == pVfs {
@@ -14223,7 +14585,7 @@ func vfsUnlink(tls *libc.TLS, pVfs uintptr) { /* sqlite3.c:23804:13: */
// Register a VFS with the system. It is harmless to register the same
// VFS multiple times. The new VFS becomes the default if makeDflt is
// true.
-func Xsqlite3_vfs_register(tls *libc.TLS, pVfs uintptr, makeDflt int32) int32 { /* sqlite3.c:23826:16: */
+func Xsqlite3_vfs_register(tls *libc.TLS, pVfs uintptr, makeDflt int32) int32 { /* sqlite3.c:24318:16: */
var mutex uintptr
var rc int32 = Xsqlite3_initialize(tls)
if rc != 0 {
@@ -14233,7 +14595,7 @@ func Xsqlite3_vfs_register(tls *libc.TLS, pVfs uintptr, makeDflt int32) int32 {
mutex = Xsqlite3MutexAlloc(tls, SQLITE_MUTEX_STATIC_MAIN)
Xsqlite3_mutex_enter(tls, mutex)
vfsUnlink(tls, pVfs)
- if (makeDflt != 0) || (vfsList == uintptr(0)) {
+ if makeDflt != 0 || vfsList == uintptr(0) {
(*Sqlite3_vfs)(unsafe.Pointer(pVfs)).FpNext = vfsList
vfsList = pVfs
} else {
@@ -14246,7 +14608,7 @@ func Xsqlite3_vfs_register(tls *libc.TLS, pVfs uintptr, makeDflt int32) int32 {
}
// Unregister a VFS so that it is no longer accessible.
-func Xsqlite3_vfs_unregister(tls *libc.TLS, pVfs uintptr) int32 { /* sqlite3.c:23854:16: */
+func Xsqlite3_vfs_unregister(tls *libc.TLS, pVfs uintptr) int32 { /* sqlite3.c:24346:16: */
var mutex uintptr
var rc int32 = Xsqlite3_initialize(tls)
if rc != 0 {
@@ -14291,7 +14653,7 @@ func Xsqlite3_vfs_unregister(tls *libc.TLS, pVfs uintptr) int32 { /* sqlite3.c:2
type BenignMallocHooks1 = struct {
FxBenignBegin uintptr
FxBenignEnd uintptr
-} /* sqlite3.c:23902:9 */
+} /* sqlite3.c:24394:9 */
//************* End of os.c *************************************************
//************* Begin file fault.c ******************************************
@@ -14322,8 +14684,8 @@ type BenignMallocHooks1 = struct {
// #include "sqliteInt.h"
// Global variables.
-type BenignMallocHooks = BenignMallocHooks1 /* sqlite3.c:23902:34 */
-var sqlite3Hooks = BenignMallocHooks1{} /* sqlite3.c:23906:3 */
+type BenignMallocHooks = BenignMallocHooks1 /* sqlite3.c:24394:34 */
+var sqlite3Hooks = BenignMallocHooks1{} /* sqlite3.c:24398:3 */
// The "wsdHooks" macro will resolve to the appropriate BenignMallocHooks
// structure. If writable static data is unsupported on the target,
@@ -14333,7 +14695,7 @@ var sqlite3Hooks = BenignMallocHooks1{} /* sqlite3.c:23906:3 */
// Register hooks to call when sqlite3BeginBenignMalloc() and
// sqlite3EndBenignMalloc() are called, respectively.
-func Xsqlite3BenignMallocHooks(tls *libc.TLS, xBenignBegin uintptr, xBenignEnd uintptr) { /* sqlite3.c:23928:21: */
+func Xsqlite3BenignMallocHooks(tls *libc.TLS, xBenignBegin uintptr, xBenignEnd uintptr) { /* sqlite3.c:24420:21: */
sqlite3Hooks.FxBenignBegin = xBenignBegin
sqlite3Hooks.FxBenignEnd = xBenignEnd
@@ -14342,14 +14704,14 @@ func Xsqlite3BenignMallocHooks(tls *libc.TLS, xBenignBegin uintptr, xBenignEnd u
// This (sqlite3EndBenignMalloc()) is called by SQLite code to indicate that
// subsequent malloc failures are benign. A call to sqlite3EndBenignMalloc()
// indicates that subsequent malloc failures are non-benign.
-func Xsqlite3BeginBenignMalloc(tls *libc.TLS) { /* sqlite3.c:23942:21: */
+func Xsqlite3BeginBenignMalloc(tls *libc.TLS) { /* sqlite3.c:24434:21: */
if sqlite3Hooks.FxBenignBegin != 0 {
(*struct{ f func(*libc.TLS) })(unsafe.Pointer(&struct{ uintptr }{sqlite3Hooks.FxBenignBegin})).f(tls)
}
}
-func Xsqlite3EndBenignMalloc(tls *libc.TLS) { /* sqlite3.c:23948:21: */
+func Xsqlite3EndBenignMalloc(tls *libc.TLS) { /* sqlite3.c:24440:21: */
if sqlite3Hooks.FxBenignEnd != 0 {
(*struct{ f func(*libc.TLS) })(unsafe.Pointer(&struct{ uintptr }{sqlite3Hooks.FxBenignEnd})).f(tls)
@@ -14447,19 +14809,19 @@ func Xsqlite3EndBenignMalloc(tls *libc.TLS) { /* sqlite3.c:23948:21: */
// For this low-level routine, we are guaranteed that nByte>0 because
// cases of nByte<=0 will be intercepted and dealt with by higher level
// routines.
-func sqlite3MemMalloc(tls *libc.TLS, nByte int32) uintptr { /* sqlite3.c:24148:13: */
+func sqlite3MemMalloc(tls *libc.TLS, nByte int32) uintptr { /* sqlite3.c:24640:13: */
bp := tls.Alloc(8)
defer tls.Free(8)
var p uintptr
- p = libc.Xmalloc(tls, (uint32(nByte + 8)))
+ p = libc.Xmalloc(tls, uint32(nByte+8))
if p != 0 {
*(*Sqlite3_int64)(unsafe.Pointer(p)) = Sqlite3_int64(nByte)
p += 8
} else {
- Xsqlite3_log(tls, SQLITE_NOMEM, ts+631 /* "failed to alloca..." */, libc.VaList(bp, nByte))
+ Xsqlite3_log(tls, SQLITE_NOMEM, ts+1419 /* "failed to alloca..." */, libc.VaList(bp, nByte))
}
return p
}
@@ -14470,7 +14832,7 @@ func sqlite3MemMalloc(tls *libc.TLS, nByte int32) uintptr { /* sqlite3.c:24148:1
// For this low-level routine, we already know that pPrior!=0 since
// cases where pPrior==0 will have been intecepted and dealt with
// by higher-level routines.
-func sqlite3MemFree(tls *libc.TLS, pPrior uintptr) { /* sqlite3.c:24182:13: */
+func sqlite3MemFree(tls *libc.TLS, pPrior uintptr) { /* sqlite3.c:24674:13: */
var p uintptr = pPrior
p -= 8
@@ -14479,7 +14841,7 @@ func sqlite3MemFree(tls *libc.TLS, pPrior uintptr) { /* sqlite3.c:24182:13: */
// Report the allocated size of a prior return from xMalloc()
// or xRealloc().
-func sqlite3MemSize(tls *libc.TLS, pPrior uintptr) int32 { /* sqlite3.c:24197:12: */
+func sqlite3MemSize(tls *libc.TLS, pPrior uintptr) int32 { /* sqlite3.c:24689:12: */
var p uintptr
p = pPrior
@@ -14495,7 +14857,7 @@ func sqlite3MemSize(tls *libc.TLS, pPrior uintptr) int32 { /* sqlite3.c:24197:12
// redirected to xMalloc. Similarly, we know that nByte>0 because
// cases where nByte<=0 will have been intercepted by higher-level
// routines and redirected to xFree.
-func sqlite3MemRealloc(tls *libc.TLS, pPrior uintptr, nByte int32) uintptr { /* sqlite3.c:24220:13: */
+func sqlite3MemRealloc(tls *libc.TLS, pPrior uintptr, nByte int32) uintptr { /* sqlite3.c:24712:13: */
bp := tls.Alloc(16)
defer tls.Free(16)
@@ -14503,32 +14865,32 @@ func sqlite3MemRealloc(tls *libc.TLS, pPrior uintptr, nByte int32) uintptr { /*
// EV: R-46199-30249
p -= 8
- p = libc.Xrealloc(tls, p, (uint32(nByte + 8)))
+ p = libc.Xrealloc(tls, p, uint32(nByte+8))
if p != 0 {
*(*Sqlite3_int64)(unsafe.Pointer(p)) = Sqlite3_int64(nByte)
p += 8
} else {
Xsqlite3_log(tls, SQLITE_NOMEM,
- ts+669, /* "failed memory re..." */
+ ts+1457, /* "failed memory re..." */
libc.VaList(bp, sqlite3MemSize(tls, pPrior), nByte))
}
return p
}
// Round up a request size to the next valid allocation size.
-func sqlite3MemRoundup(tls *libc.TLS, n int32) int32 { /* sqlite3.c:24252:12: */
- return (((n) + 7) & libc.CplInt32(7))
+func sqlite3MemRoundup(tls *libc.TLS, n int32) int32 { /* sqlite3.c:24744:12: */
+ return (n + 7) & libc.CplInt32(7)
}
// Initialize this module.
-func sqlite3MemInit(tls *libc.TLS, NotUsed uintptr) int32 { /* sqlite3.c:24259:12: */
+func sqlite3MemInit(tls *libc.TLS, NotUsed uintptr) int32 { /* sqlite3.c:24751:12: */
_ = NotUsed
return SQLITE_OK
}
// Deinitialize this module.
-func sqlite3MemShutdown(tls *libc.TLS, NotUsed uintptr) { /* sqlite3.c:24286:13: */
+func sqlite3MemShutdown(tls *libc.TLS, NotUsed uintptr) { /* sqlite3.c:24778:13: */
_ = NotUsed
return
}
@@ -14537,7 +14899,7 @@ func sqlite3MemShutdown(tls *libc.TLS, NotUsed uintptr) { /* sqlite3.c:24286:13:
//
// Populate the low-level memory allocation function pointers in
// sqlite3GlobalConfig.m with pointers to the routines in this file.
-func Xsqlite3MemSetDefault(tls *libc.TLS) { /* sqlite3.c:24297:21: */
+func Xsqlite3MemSetDefault(tls *libc.TLS) { /* sqlite3.c:24789:21: */
bp := tls.Alloc(8)
defer tls.Free(8)
@@ -14552,7 +14914,7 @@ var defaultMethods = Sqlite3_mem_methods{
FxRoundup: 0,
FxInit: 0,
FxShutdown: 0,
-} /* sqlite3.c:24298:36 */
+} /* sqlite3.c:24790:36 */
//************* End of mem1.c ***********************************************
//************* Begin file mem2.c *******************************************
@@ -14686,7 +15048,7 @@ var defaultMethods = Sqlite3_mem_methods{
// #include "sqliteInt.h"
// Initialize the mutex system.
-func Xsqlite3MutexInit(tls *libc.TLS) int32 { /* sqlite3.c:26333:20: */
+func Xsqlite3MutexInit(tls *libc.TLS) int32 { /* sqlite3.c:26825:20: */
var rc int32 = SQLITE_OK
if !(int32(Xsqlite3Config.Fmutex.FxMutexAlloc) != 0) {
// If the xMutexAlloc method has not been set, then the user did not
@@ -14694,7 +15056,7 @@ func Xsqlite3MutexInit(tls *libc.TLS) int32 { /* sqlite3.c:26333:20: */
// sqlite3_initialize() being called. This block copies pointers to
// the default implementation into the sqlite3GlobalConfig structure.
var pFrom uintptr
- var pTo uintptr = (uintptr(unsafe.Pointer(&Xsqlite3Config)) + 64 /* &.mutex */)
+ var pTo uintptr = uintptr(unsafe.Pointer(&Xsqlite3Config)) + 64
if Xsqlite3Config.FbCoreMutex != 0 {
pFrom = Xsqlite3DefaultMutex(tls)
@@ -14720,7 +15082,7 @@ func Xsqlite3MutexInit(tls *libc.TLS) int32 { /* sqlite3.c:26333:20: */
// Shutdown the mutex system. This call frees resources allocated by
// sqlite3MutexInit().
-func Xsqlite3MutexEnd(tls *libc.TLS) int32 { /* sqlite3.c:26379:20: */
+func Xsqlite3MutexEnd(tls *libc.TLS) int32 { /* sqlite3.c:26871:20: */
var rc int32 = SQLITE_OK
if Xsqlite3Config.Fmutex.FxMutexEnd != 0 {
rc = (*struct{ f func(*libc.TLS) int32 })(unsafe.Pointer(&struct{ uintptr }{Xsqlite3Config.Fmutex.FxMutexEnd})).f(tls)
@@ -14730,11 +15092,11 @@ func Xsqlite3MutexEnd(tls *libc.TLS) int32 { /* sqlite3.c:26379:20: */
}
// Retrieve a pointer to a static mutex or allocate a new dynamic one.
-func Xsqlite3_mutex_alloc(tls *libc.TLS, id int32) uintptr { /* sqlite3.c:26395:26: */
- if (id <= SQLITE_MUTEX_RECURSIVE) && (Xsqlite3_initialize(tls) != 0) {
+func Xsqlite3_mutex_alloc(tls *libc.TLS, id int32) uintptr { /* sqlite3.c:26887:26: */
+ if id <= SQLITE_MUTEX_RECURSIVE && Xsqlite3_initialize(tls) != 0 {
return uintptr(0)
}
- if (id > SQLITE_MUTEX_RECURSIVE) && (Xsqlite3MutexInit(tls) != 0) {
+ if id > SQLITE_MUTEX_RECURSIVE && Xsqlite3MutexInit(tls) != 0 {
return uintptr(0)
}
@@ -14743,7 +15105,7 @@ func Xsqlite3_mutex_alloc(tls *libc.TLS, id int32) uintptr { /* sqlite3.c:26395:
})(unsafe.Pointer(&struct{ uintptr }{Xsqlite3Config.Fmutex.FxMutexAlloc})).f(tls, id)
}
-func Xsqlite3MutexAlloc(tls *libc.TLS, id int32) uintptr { /* sqlite3.c:26404:30: */
+func Xsqlite3MutexAlloc(tls *libc.TLS, id int32) uintptr { /* sqlite3.c:26896:30: */
if !(int32(Xsqlite3Config.FbCoreMutex) != 0) {
return uintptr(0)
}
@@ -14754,7 +15116,7 @@ func Xsqlite3MutexAlloc(tls *libc.TLS, id int32) uintptr { /* sqlite3.c:26404:30
}
// Free a dynamic mutex.
-func Xsqlite3_mutex_free(tls *libc.TLS, p uintptr) { /* sqlite3.c:26416:17: */
+func Xsqlite3_mutex_free(tls *libc.TLS, p uintptr) { /* sqlite3.c:26908:17: */
if p != 0 {
(*struct{ f func(*libc.TLS, uintptr) })(unsafe.Pointer(&struct{ uintptr }{Xsqlite3Config.Fmutex.FxMutexFree})).f(tls, p)
@@ -14763,7 +15125,7 @@ func Xsqlite3_mutex_free(tls *libc.TLS, p uintptr) { /* sqlite3.c:26416:17: */
// Obtain the mutex p. If some other thread already has the mutex, block
// until it can be obtained.
-func Xsqlite3_mutex_enter(tls *libc.TLS, p uintptr) { /* sqlite3.c:26427:17: */
+func Xsqlite3_mutex_enter(tls *libc.TLS, p uintptr) { /* sqlite3.c:26919:17: */
if p != 0 {
(*struct{ f func(*libc.TLS, uintptr) })(unsafe.Pointer(&struct{ uintptr }{Xsqlite3Config.Fmutex.FxMutexEnter})).f(tls, p)
@@ -14772,7 +15134,7 @@ func Xsqlite3_mutex_enter(tls *libc.TLS, p uintptr) { /* sqlite3.c:26427:17: */
// Obtain the mutex p. If successful, return SQLITE_OK. Otherwise, if another
// thread holds the mutex and it cannot be obtained, return SQLITE_BUSY.
-func Xsqlite3_mutex_try(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:26438:16: */
+func Xsqlite3_mutex_try(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:26930:16: */
var rc int32 = SQLITE_OK
if p != 0 {
@@ -14787,7 +15149,7 @@ func Xsqlite3_mutex_try(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:26438:16:
// entered by the same thread. The behavior is undefined if the mutex
// is not currently entered. If a NULL pointer is passed as an argument
// this function is a no-op.
-func Xsqlite3_mutex_leave(tls *libc.TLS, p uintptr) { /* sqlite3.c:26453:17: */
+func Xsqlite3_mutex_leave(tls *libc.TLS, p uintptr) { /* sqlite3.c:26945:17: */
if p != 0 {
(*struct{ f func(*libc.TLS, uintptr) })(unsafe.Pointer(&struct{ uintptr }{Xsqlite3Config.Fmutex.FxMutexLeave})).f(tls, p)
@@ -14826,40 +15188,40 @@ func Xsqlite3_mutex_leave(tls *libc.TLS, p uintptr) { /* sqlite3.c:26453:17: */
// Stub routines for all mutex methods.
//
// This routines provide no mutual exclusion or error checking.
-func noopMutexInit(tls *libc.TLS) int32 { /* sqlite3.c:26516:12: */
+func noopMutexInit(tls *libc.TLS) int32 { /* sqlite3.c:27008:12: */
return SQLITE_OK
}
-func noopMutexEnd(tls *libc.TLS) int32 { /* sqlite3.c:26517:12: */
+func noopMutexEnd(tls *libc.TLS) int32 { /* sqlite3.c:27009:12: */
return SQLITE_OK
}
-func noopMutexAlloc(tls *libc.TLS, id int32) uintptr { /* sqlite3.c:26518:22: */
+func noopMutexAlloc(tls *libc.TLS, id int32) uintptr { /* sqlite3.c:27010:22: */
_ = id
return uintptr(8)
}
-func noopMutexFree(tls *libc.TLS, p uintptr) { /* sqlite3.c:26522:13: */
+func noopMutexFree(tls *libc.TLS, p uintptr) { /* sqlite3.c:27014:13: */
_ = p
return
}
-func noopMutexEnter(tls *libc.TLS, p uintptr) { /* sqlite3.c:26523:13: */
+func noopMutexEnter(tls *libc.TLS, p uintptr) { /* sqlite3.c:27015:13: */
_ = p
return
}
-func noopMutexTry(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:26524:12: */
+func noopMutexTry(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:27016:12: */
_ = p
return SQLITE_OK
}
-func noopMutexLeave(tls *libc.TLS, p uintptr) { /* sqlite3.c:26528:13: */
+func noopMutexLeave(tls *libc.TLS, p uintptr) { /* sqlite3.c:27020:13: */
_ = p
return
}
-func Xsqlite3NoopMutex(tls *libc.TLS) uintptr { /* sqlite3.c:26530:44: */
+func Xsqlite3NoopMutex(tls *libc.TLS) uintptr { /* sqlite3.c:27022:44: */
return uintptr(unsafe.Pointer(&sMutex))
}
@@ -14872,11 +15234,11 @@ var sMutex = Sqlite3_mutex_methods{
FxMutexEnter: 0,
FxMutexTry: 0,
FxMutexLeave: 0,
-} /* sqlite3.c:26531:38 */
+} /* sqlite3.c:27023:38 */
// If compiled with SQLITE_MUTEX_NOOP, then the no-op mutex implementation
// is used regardless of the run-time threadsafety setting.
-func Xsqlite3DefaultMutex(tls *libc.TLS) uintptr { /* sqlite3.c:26689:44: */
+func Xsqlite3DefaultMutex(tls *libc.TLS) uintptr { /* sqlite3.c:27181:44: */
return Xsqlite3NoopMutex(tls)
}
@@ -14939,7 +15301,7 @@ func Xsqlite3DefaultMutex(tls *libc.TLS) uintptr { /* sqlite3.c:26689:44: */
// Attempt to release up to n bytes of non-essential memory currently
// held by SQLite. An example of non-essential memory is memory used to
// cache database pages that are not currently in use.
-func Xsqlite3_release_memory(tls *libc.TLS, n int32) int32 { /* sqlite3.c:27808:16: */
+func Xsqlite3_release_memory(tls *libc.TLS, n int32) int32 { /* sqlite3.c:28102:16: */
return Xsqlite3PcacheReleaseMemory(tls, n)
}
@@ -14953,22 +15315,22 @@ type Mem0Global = struct {
FhardLimit Sqlite3_int64
FnearlyFull int32
F__ccgo_pad2 [4]byte
-} /* sqlite3.c:27830:19 */
+} /* sqlite3.c:28124:19 */
// Default value of the hard heap limit. 0 means "no limit".
// State information local to the memory allocation subsystem.
-var mem0 = Mem0Global{} /* sqlite3.c:27840:3 */
+var mem0 = Mem0Global{} /* sqlite3.c:28134:3 */
// Return the memory allocator mutex. sqlite3_status() needs it.
-func Xsqlite3MallocMutex(tls *libc.TLS) uintptr { /* sqlite3.c:27847:30: */
+func Xsqlite3MallocMutex(tls *libc.TLS) uintptr { /* sqlite3.c:28141:30: */
return mem0.Fmutex
}
// Deprecated external interface. It used to set an alarm callback
// that was invoked when memory usage grew too large. Now it is a
// no-op.
-func Xsqlite3_memory_alarm(tls *libc.TLS, xCallback uintptr, pArg uintptr, iThreshold Sqlite3_int64) int32 { /* sqlite3.c:27857:16: */
+func Xsqlite3_memory_alarm(tls *libc.TLS, xCallback uintptr, pArg uintptr, iThreshold Sqlite3_int64) int32 { /* sqlite3.c:28151:16: */
_ = xCallback
_ = pArg
_ = iThreshold
@@ -14984,7 +15346,7 @@ func Xsqlite3_memory_alarm(tls *libc.TLS, xCallback uintptr, pArg uintptr, iThre
//
// If the hard heap limit is enabled, then the soft heap limit cannot
// be disabled nor raised above the hard heap limit.
-func Xsqlite3_soft_heap_limit64(tls *libc.TLS, n Sqlite3_int64) Sqlite3_int64 { /* sqlite3.c:27880:26: */
+func Xsqlite3_soft_heap_limit64(tls *libc.TLS, n Sqlite3_int64) Sqlite3_int64 { /* sqlite3.c:28174:26: */
var priorLimit Sqlite3_int64
var excess Sqlite3_int64
var nUsed Sqlite3_int64
@@ -14998,21 +15360,21 @@ func Xsqlite3_soft_heap_limit64(tls *libc.TLS, n Sqlite3_int64) Sqlite3_int64 {
Xsqlite3_mutex_leave(tls, mem0.Fmutex)
return priorLimit
}
- if (mem0.FhardLimit > int64(0)) && ((n > mem0.FhardLimit) || (n == int64(0))) {
+ if mem0.FhardLimit > int64(0) && (n > mem0.FhardLimit || n == int64(0)) {
n = mem0.FhardLimit
}
mem0.FalarmThreshold = n
nUsed = Xsqlite3StatusValue(tls, SQLITE_STATUS_MEMORY_USED)
- libc.AtomicStoreNInt32((uintptr(unsafe.Pointer(&mem0)) + 24 /* &.nearlyFull */), int32((libc.Bool32((n > int64(0)) && (n <= nUsed)))), 0)
+ libc.AtomicStoreNInt32(uintptr(unsafe.Pointer(&mem0))+24, int32(libc.Bool32(n > int64(0) && n <= nUsed)), 0)
Xsqlite3_mutex_leave(tls, mem0.Fmutex)
- excess = (Xsqlite3_memory_used(tls) - n)
+ excess = Xsqlite3_memory_used(tls) - n
if excess > int64(0) {
- Xsqlite3_release_memory(tls, (int32(excess & int64(0x7fffffff))))
+ Xsqlite3_release_memory(tls, int32(excess&int64(0x7fffffff)))
}
return priorLimit
}
-func Xsqlite3_soft_heap_limit(tls *libc.TLS, n int32) { /* sqlite3.c:27905:17: */
+func Xsqlite3_soft_heap_limit(tls *libc.TLS, n int32) { /* sqlite3.c:28199:17: */
if n < 0 {
n = 0
}
@@ -15029,7 +15391,7 @@ func Xsqlite3_soft_heap_limit(tls *libc.TLS, n int32) { /* sqlite3.c:27905:17: *
// Setting the hard heap limit will also activate the soft heap limit
// and constrain the soft heap limit to be no more than the hard heap
// limit.
-func Xsqlite3_hard_heap_limit64(tls *libc.TLS, n Sqlite3_int64) Sqlite3_int64 { /* sqlite3.c:27922:26: */
+func Xsqlite3_hard_heap_limit64(tls *libc.TLS, n Sqlite3_int64) Sqlite3_int64 { /* sqlite3.c:28216:26: */
var priorLimit Sqlite3_int64
var rc int32 = Xsqlite3_initialize(tls)
if rc != 0 {
@@ -15039,7 +15401,7 @@ func Xsqlite3_hard_heap_limit64(tls *libc.TLS, n Sqlite3_int64) Sqlite3_int64 {
priorLimit = mem0.FhardLimit
if n >= int64(0) {
mem0.FhardLimit = n
- if (n < mem0.FalarmThreshold) || (mem0.FalarmThreshold == int64(0)) {
+ if n < mem0.FalarmThreshold || mem0.FalarmThreshold == int64(0) {
mem0.FalarmThreshold = n
}
}
@@ -15048,14 +15410,14 @@ func Xsqlite3_hard_heap_limit64(tls *libc.TLS, n Sqlite3_int64) Sqlite3_int64 {
}
// Initialize the memory allocation subsystem.
-func Xsqlite3MallocInit(tls *libc.TLS) int32 { /* sqlite3.c:27944:20: */
+func Xsqlite3MallocInit(tls *libc.TLS) int32 { /* sqlite3.c:28238:20: */
var rc int32
if Xsqlite3Config.Fm.FxMalloc == uintptr(0) {
Xsqlite3MemSetDefault(tls)
}
mem0.Fmutex = Xsqlite3MutexAlloc(tls, SQLITE_MUTEX_STATIC_MEM)
- if ((Xsqlite3Config.FpPage == uintptr(0)) || (Xsqlite3Config.FszPage < 512)) ||
- (Xsqlite3Config.FnPage <= 0) {
+ if Xsqlite3Config.FpPage == uintptr(0) || Xsqlite3Config.FszPage < 512 ||
+ Xsqlite3Config.FnPage <= 0 {
Xsqlite3Config.FpPage = uintptr(0)
Xsqlite3Config.FszPage = 0
}
@@ -15071,12 +15433,12 @@ func Xsqlite3MallocInit(tls *libc.TLS) int32 { /* sqlite3.c:27944:20: */
// Return true if the heap is currently under memory pressure - in other
// words if the amount of heap used is close to the limit set by
// sqlite3_soft_heap_limit().
-func Xsqlite3HeapNearlyFull(tls *libc.TLS) int32 { /* sqlite3.c:27965:20: */
- return libc.AtomicLoadNInt32((uintptr(unsafe.Pointer(&mem0)) + 24 /* &.nearlyFull */), 0)
+func Xsqlite3HeapNearlyFull(tls *libc.TLS) int32 { /* sqlite3.c:28259:20: */
+ return libc.AtomicLoadNInt32(uintptr(unsafe.Pointer(&mem0))+24, 0)
}
// Deinitialize the memory allocation subsystem.
-func Xsqlite3MallocEnd(tls *libc.TLS) { /* sqlite3.c:27972:21: */
+func Xsqlite3MallocEnd(tls *libc.TLS) { /* sqlite3.c:28266:21: */
if Xsqlite3Config.Fm.FxShutdown != 0 {
(*struct{ f func(*libc.TLS, uintptr) })(unsafe.Pointer(&struct{ uintptr }{Xsqlite3Config.Fm.FxShutdown})).f(tls, Xsqlite3Config.Fm.FpAppData)
}
@@ -15084,7 +15446,7 @@ func Xsqlite3MallocEnd(tls *libc.TLS) { /* sqlite3.c:27972:21: */
}
// Return the amount of memory currently checked out.
-func Xsqlite3_memory_used(tls *libc.TLS) Sqlite3_int64 { /* sqlite3.c:27982:26: */
+func Xsqlite3_memory_used(tls *libc.TLS) Sqlite3_int64 { /* sqlite3.c:28276:26: */
bp := tls.Alloc(16)
defer tls.Free(16)
@@ -15099,7 +15461,7 @@ func Xsqlite3_memory_used(tls *libc.TLS) Sqlite3_int64 { /* sqlite3.c:27982:26:
// Return the maximum amount of memory that has ever been
// checked out since either the beginning of this process
// or since the most recent reset.
-func Xsqlite3_memory_highwater(tls *libc.TLS, resetFlag int32) Sqlite3_int64 { /* sqlite3.c:27993:26: */
+func Xsqlite3_memory_highwater(tls *libc.TLS, resetFlag int32) Sqlite3_int64 { /* sqlite3.c:28287:26: */
bp := tls.Alloc(16)
defer tls.Free(16)
@@ -15112,7 +15474,7 @@ func Xsqlite3_memory_highwater(tls *libc.TLS, resetFlag int32) Sqlite3_int64 { /
}
// Trigger the alarm
-func sqlite3MallocAlarm(tls *libc.TLS, nByte int32) { /* sqlite3.c:28002:13: */
+func sqlite3MallocAlarm(tls *libc.TLS, nByte int32) { /* sqlite3.c:28296:13: */
if mem0.FalarmThreshold <= int64(0) {
return
}
@@ -15123,7 +15485,7 @@ func sqlite3MallocAlarm(tls *libc.TLS, nByte int32) { /* sqlite3.c:28002:13: */
// Do a memory allocation with statistics and alarms. Assume the
// lock is already held.
-func mallocWithAlarm(tls *libc.TLS, n int32, pp uintptr) { /* sqlite3.c:28013:13: */
+func mallocWithAlarm(tls *libc.TLS, n int32, pp uintptr) { /* sqlite3.c:28307:13: */
var p uintptr
var nFull int32
@@ -15137,24 +15499,24 @@ func mallocWithAlarm(tls *libc.TLS, n int32, pp uintptr) { /* sqlite3.c:28013:13
Xsqlite3StatusHighwater(tls, SQLITE_STATUS_MALLOC_SIZE, n)
if mem0.FalarmThreshold > int64(0) {
var nUsed Sqlite3_int64 = Xsqlite3StatusValue(tls, SQLITE_STATUS_MEMORY_USED)
- if nUsed >= (mem0.FalarmThreshold - Sqlite3_int64(nFull)) {
- libc.AtomicStoreNInt32((uintptr(unsafe.Pointer(&mem0)) + 24 /* &.nearlyFull */), int32(1), 0)
+ if nUsed >= mem0.FalarmThreshold-Sqlite3_int64(nFull) {
+ libc.AtomicStoreNInt32(uintptr(unsafe.Pointer(&mem0))+24, int32(1), 0)
sqlite3MallocAlarm(tls, nFull)
if mem0.FhardLimit != 0 {
nUsed = Xsqlite3StatusValue(tls, SQLITE_STATUS_MEMORY_USED)
- if nUsed >= (mem0.FhardLimit - Sqlite3_int64(nFull)) {
+ if nUsed >= mem0.FhardLimit-Sqlite3_int64(nFull) {
*(*uintptr)(unsafe.Pointer(pp)) = uintptr(0)
return
}
}
} else {
- libc.AtomicStoreNInt32((uintptr(unsafe.Pointer(&mem0)) + 24 /* &.nearlyFull */), int32(0), 0)
+ libc.AtomicStoreNInt32(uintptr(unsafe.Pointer(&mem0))+24, int32(0), 0)
}
}
p = (*struct {
f func(*libc.TLS, int32) uintptr
})(unsafe.Pointer(&struct{ uintptr }{Xsqlite3Config.Fm.FxMalloc})).f(tls, nFull)
- if (p == uintptr(0)) && (mem0.FalarmThreshold > int64(0)) {
+ if p == uintptr(0) && mem0.FalarmThreshold > int64(0) {
sqlite3MallocAlarm(tls, nFull)
p = (*struct {
f func(*libc.TLS, int32) uintptr
@@ -15170,13 +15532,13 @@ func mallocWithAlarm(tls *libc.TLS, n int32, pp uintptr) { /* sqlite3.c:28013:13
// Allocate memory. This routine is like sqlite3_malloc() except that it
// assumes the memory subsystem has already been initialized.
-func Xsqlite3Malloc(tls *libc.TLS, n U64) uintptr { /* sqlite3.c:28062:21: */
+func Xsqlite3Malloc(tls *libc.TLS, n U64) uintptr { /* sqlite3.c:28356:21: */
bp := tls.Alloc(4)
defer tls.Free(4)
// var p uintptr at bp, 4
- if (n == uint64(0)) || (n >= uint64(0x7fffff00)) {
+ if n == uint64(0) || n >= uint64(0x7fffff00) {
// A memory allocation of a number of bytes which is near the maximum
// signed integer value might cause an integer overflow inside of the
// xMalloc(). Hence we limit the maximum size to 0x7fffff00, giving
@@ -15199,7 +15561,7 @@ func Xsqlite3Malloc(tls *libc.TLS, n U64) uintptr { /* sqlite3.c:28062:21: */
// This version of the memory allocation is for use by the application.
// First make sure the memory subsystem is initialized, then do the
// allocation.
-func Xsqlite3_malloc(tls *libc.TLS, n int32) uintptr { /* sqlite3.c:28087:17: */
+func Xsqlite3_malloc(tls *libc.TLS, n int32) uintptr { /* sqlite3.c:28381:17: */
if Xsqlite3_initialize(tls) != 0 {
return uintptr(0)
}
@@ -15209,7 +15571,7 @@ func Xsqlite3_malloc(tls *libc.TLS, n int32) uintptr { /* sqlite3.c:28087:17: */
return Xsqlite3Malloc(tls, uint64(n))
}
-func Xsqlite3_malloc64(tls *libc.TLS, n Sqlite3_uint64) uintptr { /* sqlite3.c:28093:17: */
+func Xsqlite3_malloc64(tls *libc.TLS, n Sqlite3_uint64) uintptr { /* sqlite3.c:28387:17: */
if Xsqlite3_initialize(tls) != 0 {
return uintptr(0)
}
@@ -15217,35 +15579,35 @@ func Xsqlite3_malloc64(tls *libc.TLS, n Sqlite3_uint64) uintptr { /* sqlite3.c:2
}
// TRUE if p is a lookaside memory allocation from db
-func isLookaside(tls *libc.TLS, db uintptr, p uintptr) int32 { /* sqlite3.c:28104:12: */
- return (libc.Bool32((Uptr((p)) >= Uptr(((*Sqlite3)(unsafe.Pointer(db)).Flookaside.FpStart))) && (Uptr((p)) < Uptr(((*Sqlite3)(unsafe.Pointer(db)).Flookaside.FpEnd)))))
+func isLookaside(tls *libc.TLS, db uintptr, p uintptr) int32 { /* sqlite3.c:28398:12: */
+ return libc.Bool32(Uptr(p) >= Uptr((*Sqlite3)(unsafe.Pointer(db)).Flookaside.FpStart) && Uptr(p) < Uptr((*Sqlite3)(unsafe.Pointer(db)).Flookaside.FpEnd))
}
// Return the size of a memory allocation previously obtained from
// sqlite3Malloc() or sqlite3_malloc().
-func Xsqlite3MallocSize(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:28115:20: */
+func Xsqlite3MallocSize(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:28409:20: */
return (*struct {
f func(*libc.TLS, uintptr) int32
})(unsafe.Pointer(&struct{ uintptr }{Xsqlite3Config.Fm.FxSize})).f(tls, p)
}
-func lookasideMallocSize(tls *libc.TLS, db uintptr, p uintptr) int32 { /* sqlite3.c:28119:12: */
+func lookasideMallocSize(tls *libc.TLS, db uintptr, p uintptr) int32 { /* sqlite3.c:28413:12: */
if p < (*Sqlite3)(unsafe.Pointer(db)).Flookaside.FpMiddle {
return int32((*Sqlite3)(unsafe.Pointer(db)).Flookaside.FszTrue)
}
return LOOKASIDE_SMALL
}
-func Xsqlite3DbMallocSize(tls *libc.TLS, db uintptr, p uintptr) int32 { /* sqlite3.c:28126:20: */
+func Xsqlite3DbMallocSize(tls *libc.TLS, db uintptr, p uintptr) int32 { /* sqlite3.c:28420:20: */
if db != 0 {
- if (Uptr(p)) < Uptr(((*Sqlite3)(unsafe.Pointer(db)).Flookaside.FpEnd)) {
- if (Uptr(p)) >= Uptr(((*Sqlite3)(unsafe.Pointer(db)).Flookaside.FpMiddle)) {
+ if Uptr(p) < Uptr((*Sqlite3)(unsafe.Pointer(db)).Flookaside.FpEnd) {
+ if Uptr(p) >= Uptr((*Sqlite3)(unsafe.Pointer(db)).Flookaside.FpMiddle) {
return LOOKASIDE_SMALL
}
- if (Uptr(p)) >= Uptr(((*Sqlite3)(unsafe.Pointer(db)).Flookaside.FpStart)) {
+ if Uptr(p) >= Uptr((*Sqlite3)(unsafe.Pointer(db)).Flookaside.FpStart) {
return int32((*Sqlite3)(unsafe.Pointer(db)).Flookaside.FszTrue)
}
@@ -15256,7 +15618,7 @@ func Xsqlite3DbMallocSize(tls *libc.TLS, db uintptr, p uintptr) int32 { /* sqlit
})(unsafe.Pointer(&struct{ uintptr }{Xsqlite3Config.Fm.FxSize})).f(tls, p)
}
-func Xsqlite3_msize(tls *libc.TLS, p uintptr) Sqlite3_uint64 { /* sqlite3.c:28155:27: */
+func Xsqlite3_msize(tls *libc.TLS, p uintptr) Sqlite3_uint64 { /* sqlite3.c:28449:27: */
if p != 0 {
return uint64((*struct {
@@ -15267,7 +15629,7 @@ func Xsqlite3_msize(tls *libc.TLS, p uintptr) Sqlite3_uint64 { /* sqlite3.c:2815
}
// Free memory previously obtained from sqlite3Malloc().
-func Xsqlite3_free(tls *libc.TLS, p uintptr) { /* sqlite3.c:28164:17: */
+func Xsqlite3_free(tls *libc.TLS, p uintptr) { /* sqlite3.c:28458:17: */
if p == uintptr(0) {
return
} // IMP: R-49053-54554
@@ -15285,28 +15647,28 @@ func Xsqlite3_free(tls *libc.TLS, p uintptr) { /* sqlite3.c:28164:17: */
// Add the size of memory allocation "p" to the count in
// *db->pnBytesFreed.
-func measureAllocationSize(tls *libc.TLS, db uintptr, p uintptr) { /* sqlite3.c:28183:29: */
- *(*int32)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FpnBytesFreed)) += (Xsqlite3DbMallocSize(tls, db, p))
+func measureAllocationSize(tls *libc.TLS, db uintptr, p uintptr) { /* sqlite3.c:28477:29: */
+ *(*int32)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FpnBytesFreed)) += Xsqlite3DbMallocSize(tls, db, p)
}
// Free memory that might be associated with a particular database
// connection. Calling sqlite3DbFree(D,X) for X==0 is a harmless no-op.
// The sqlite3DbFreeNN(D,X) version requires that X be non-NULL.
-func Xsqlite3DbFreeNN(tls *libc.TLS, db uintptr, p uintptr) { /* sqlite3.c:28192:21: */
+func Xsqlite3DbFreeNN(tls *libc.TLS, db uintptr, p uintptr) { /* sqlite3.c:28486:21: */
if db != 0 {
if (*Sqlite3)(unsafe.Pointer(db)).FpnBytesFreed != 0 {
measureAllocationSize(tls, db, p)
return
}
- if (Uptr(p)) < Uptr(((*Sqlite3)(unsafe.Pointer(db)).Flookaside.FpEnd)) {
- if (Uptr(p)) >= Uptr(((*Sqlite3)(unsafe.Pointer(db)).Flookaside.FpMiddle)) {
+ if Uptr(p) < Uptr((*Sqlite3)(unsafe.Pointer(db)).Flookaside.FpEnd) {
+ if Uptr(p) >= Uptr((*Sqlite3)(unsafe.Pointer(db)).Flookaside.FpMiddle) {
var pBuf uintptr = p
(*LookasideSlot)(unsafe.Pointer(pBuf)).FpNext = (*Sqlite3)(unsafe.Pointer(db)).Flookaside.FpSmallFree
(*Sqlite3)(unsafe.Pointer(db)).Flookaside.FpSmallFree = pBuf
return
}
- if (Uptr(p)) >= Uptr(((*Sqlite3)(unsafe.Pointer(db)).Flookaside.FpStart)) {
+ if Uptr(p) >= Uptr((*Sqlite3)(unsafe.Pointer(db)).Flookaside.FpStart) {
var pBuf uintptr = p
(*LookasideSlot)(unsafe.Pointer(pBuf)).FpNext = (*Sqlite3)(unsafe.Pointer(db)).Flookaside.FpFree
(*Sqlite3)(unsafe.Pointer(db)).Flookaside.FpFree = pBuf
@@ -15318,7 +15680,7 @@ func Xsqlite3DbFreeNN(tls *libc.TLS, db uintptr, p uintptr) { /* sqlite3.c:28192
Xsqlite3_free(tls, p)
}
-func Xsqlite3DbFree(tls *libc.TLS, db uintptr, p uintptr) { /* sqlite3.c:28229:21: */
+func Xsqlite3DbFree(tls *libc.TLS, db uintptr, p uintptr) { /* sqlite3.c:28523:21: */
if p != 0 {
Xsqlite3DbFreeNN(tls, db, p)
@@ -15326,7 +15688,7 @@ func Xsqlite3DbFree(tls *libc.TLS, db uintptr, p uintptr) { /* sqlite3.c:28229:2
}
// Change the size of an existing memory allocation
-func Xsqlite3Realloc(tls *libc.TLS, pOld uintptr, nBytes U64) uintptr { /* sqlite3.c:28237:21: */
+func Xsqlite3Realloc(tls *libc.TLS, pOld uintptr, nBytes U64) uintptr { /* sqlite3.c:28531:21: */
var nOld int32
var nNew int32
var nDiff int32
@@ -15354,10 +15716,10 @@ func Xsqlite3Realloc(tls *libc.TLS, pOld uintptr, nBytes U64) uintptr { /* sqlit
var nUsed Sqlite3_int64
Xsqlite3_mutex_enter(tls, mem0.Fmutex)
Xsqlite3StatusHighwater(tls, SQLITE_STATUS_MALLOC_SIZE, int32(nBytes))
- nDiff = (nNew - nOld)
- if (nDiff > 0) && ((libc.AssignInt64(&nUsed, Xsqlite3StatusValue(tls, SQLITE_STATUS_MEMORY_USED))) >= (mem0.FalarmThreshold - Sqlite3_int64(nDiff))) {
+ nDiff = nNew - nOld
+ if nDiff > 0 && libc.AssignInt64(&nUsed, Xsqlite3StatusValue(tls, SQLITE_STATUS_MEMORY_USED)) >= mem0.FalarmThreshold-Sqlite3_int64(nDiff) {
sqlite3MallocAlarm(tls, nDiff)
- if (mem0.FhardLimit > int64(0)) && (nUsed >= (mem0.FhardLimit - Sqlite3_int64(nDiff))) {
+ if mem0.FhardLimit > int64(0) && nUsed >= mem0.FhardLimit-Sqlite3_int64(nDiff) {
Xsqlite3_mutex_leave(tls, mem0.Fmutex)
return uintptr(0)
}
@@ -15365,7 +15727,7 @@ func Xsqlite3Realloc(tls *libc.TLS, pOld uintptr, nBytes U64) uintptr { /* sqlit
pNew = (*struct {
f func(*libc.TLS, uintptr, int32) uintptr
})(unsafe.Pointer(&struct{ uintptr }{Xsqlite3Config.Fm.FxRealloc})).f(tls, pOld, nNew)
- if (pNew == uintptr(0)) && (mem0.FalarmThreshold > int64(0)) {
+ if pNew == uintptr(0) && mem0.FalarmThreshold > int64(0) {
sqlite3MallocAlarm(tls, int32(nBytes))
pNew = (*struct {
f func(*libc.TLS, uintptr, int32) uintptr
@@ -15373,7 +15735,7 @@ func Xsqlite3Realloc(tls *libc.TLS, pOld uintptr, nBytes U64) uintptr { /* sqlit
}
if pNew != 0 {
nNew = Xsqlite3MallocSize(tls, pNew)
- Xsqlite3StatusUp(tls, SQLITE_STATUS_MEMORY_USED, (nNew - nOld))
+ Xsqlite3StatusUp(tls, SQLITE_STATUS_MEMORY_USED, nNew-nOld)
}
Xsqlite3_mutex_leave(tls, mem0.Fmutex)
} else {
@@ -15387,7 +15749,7 @@ func Xsqlite3Realloc(tls *libc.TLS, pOld uintptr, nBytes U64) uintptr { /* sqlit
// The public interface to sqlite3Realloc. Make sure that the memory
// subsystem is initialized prior to invoking sqliteRealloc.
-func Xsqlite3_realloc(tls *libc.TLS, pOld uintptr, n int32) uintptr { /* sqlite3.c:28296:17: */
+func Xsqlite3_realloc(tls *libc.TLS, pOld uintptr, n int32) uintptr { /* sqlite3.c:28590:17: */
if Xsqlite3_initialize(tls) != 0 {
return uintptr(0)
}
@@ -15397,7 +15759,7 @@ func Xsqlite3_realloc(tls *libc.TLS, pOld uintptr, n int32) uintptr { /* sqlite3
return Xsqlite3Realloc(tls, pOld, uint64(n))
}
-func Xsqlite3_realloc64(tls *libc.TLS, pOld uintptr, n Sqlite3_uint64) uintptr { /* sqlite3.c:28303:17: */
+func Xsqlite3_realloc64(tls *libc.TLS, pOld uintptr, n Sqlite3_uint64) uintptr { /* sqlite3.c:28597:17: */
if Xsqlite3_initialize(tls) != 0 {
return uintptr(0)
}
@@ -15405,7 +15767,7 @@ func Xsqlite3_realloc64(tls *libc.TLS, pOld uintptr, n Sqlite3_uint64) uintptr {
}
// Allocate and zero memory.
-func Xsqlite3MallocZero(tls *libc.TLS, n U64) uintptr { /* sqlite3.c:28314:21: */
+func Xsqlite3MallocZero(tls *libc.TLS, n U64) uintptr { /* sqlite3.c:28608:21: */
var p uintptr = Xsqlite3Malloc(tls, n)
if p != 0 {
libc.Xmemset(tls, p, 0, Size_t(n))
@@ -15415,7 +15777,7 @@ func Xsqlite3MallocZero(tls *libc.TLS, n U64) uintptr { /* sqlite3.c:28314:21: *
// Allocate and zero memory. If the allocation fails, make
// the mallocFailed flag in the connection pointer.
-func Xsqlite3DbMallocZero(tls *libc.TLS, db uintptr, n U64) uintptr { /* sqlite3.c:28326:21: */
+func Xsqlite3DbMallocZero(tls *libc.TLS, db uintptr, n U64) uintptr { /* sqlite3.c:28620:21: */
var p uintptr
p = Xsqlite3DbMallocRaw(tls, db, n)
@@ -15427,7 +15789,7 @@ func Xsqlite3DbMallocZero(tls *libc.TLS, db uintptr, n U64) uintptr { /* sqlite3
// Finish the work of sqlite3DbMallocRawNN for the unusual and
// slower case when the allocation cannot be fulfilled using lookaside.
-func dbMallocRawFinish(tls *libc.TLS, db uintptr, n U64) uintptr { /* sqlite3.c:28338:29: */
+func dbMallocRawFinish(tls *libc.TLS, db uintptr, n U64) uintptr { /* sqlite3.c:28632:29: */
var p uintptr
p = Xsqlite3Malloc(tls, n)
@@ -15458,7 +15820,7 @@ func dbMallocRawFinish(tls *libc.TLS, db uintptr, n U64) uintptr { /* sqlite3.c:
//
// The sqlite3MallocRawNN() variant guarantees that the "db" parameter is
// not a NULL pointer.
-func Xsqlite3DbMallocRaw(tls *libc.TLS, db uintptr, n U64) uintptr { /* sqlite3.c:28370:21: */
+func Xsqlite3DbMallocRaw(tls *libc.TLS, db uintptr, n U64) uintptr { /* sqlite3.c:28664:21: */
var p uintptr
if db != 0 {
return Xsqlite3DbMallocRawNN(tls, db, n)
@@ -15468,56 +15830,56 @@ func Xsqlite3DbMallocRaw(tls *libc.TLS, db uintptr, n U64) uintptr { /* sqlite3.
return p
}
-func Xsqlite3DbMallocRawNN(tls *libc.TLS, db uintptr, n U64) uintptr { /* sqlite3.c:28377:21: */
+func Xsqlite3DbMallocRawNN(tls *libc.TLS, db uintptr, n U64) uintptr { /* sqlite3.c:28671:21: */
var pBuf uintptr
if n > U64((*Sqlite3)(unsafe.Pointer(db)).Flookaside.Fsz) {
if !(int32((*Sqlite3)(unsafe.Pointer(db)).Flookaside.FbDisable) != 0) {
- *(*U32)(unsafe.Pointer((db + 296 /* &.lookaside */ + 16 /* &.anStat */) + 1*4))++
+ *(*U32)(unsafe.Pointer(db + 320 + 16 + 1*4))++
} else if (*Sqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 {
return uintptr(0)
}
return dbMallocRawFinish(tls, db, n)
}
if n <= uint64(LOOKASIDE_SMALL) {
- if (libc.AssignUintptr(&pBuf, (*Sqlite3)(unsafe.Pointer(db)).Flookaside.FpSmallFree)) != uintptr(0) {
+ if libc.AssignUintptr(&pBuf, (*Sqlite3)(unsafe.Pointer(db)).Flookaside.FpSmallFree) != uintptr(0) {
(*Sqlite3)(unsafe.Pointer(db)).Flookaside.FpSmallFree = (*LookasideSlot)(unsafe.Pointer(pBuf)).FpNext
- *(*U32)(unsafe.Pointer((db + 296 /* &.lookaside */ + 16 /* &.anStat */)))++
+ *(*U32)(unsafe.Pointer(db + 320 + 16))++
return pBuf
- } else if (libc.AssignUintptr(&pBuf, (*Sqlite3)(unsafe.Pointer(db)).Flookaside.FpSmallInit)) != uintptr(0) {
+ } else if libc.AssignUintptr(&pBuf, (*Sqlite3)(unsafe.Pointer(db)).Flookaside.FpSmallInit) != uintptr(0) {
(*Sqlite3)(unsafe.Pointer(db)).Flookaside.FpSmallInit = (*LookasideSlot)(unsafe.Pointer(pBuf)).FpNext
- *(*U32)(unsafe.Pointer((db + 296 /* &.lookaside */ + 16 /* &.anStat */)))++
+ *(*U32)(unsafe.Pointer(db + 320 + 16))++
return pBuf
}
}
- if (libc.AssignUintptr(&pBuf, (*Sqlite3)(unsafe.Pointer(db)).Flookaside.FpFree)) != uintptr(0) {
+ if libc.AssignUintptr(&pBuf, (*Sqlite3)(unsafe.Pointer(db)).Flookaside.FpFree) != uintptr(0) {
(*Sqlite3)(unsafe.Pointer(db)).Flookaside.FpFree = (*LookasideSlot)(unsafe.Pointer(pBuf)).FpNext
- *(*U32)(unsafe.Pointer((db + 296 /* &.lookaside */ + 16 /* &.anStat */)))++
+ *(*U32)(unsafe.Pointer(db + 320 + 16))++
return pBuf
- } else if (libc.AssignUintptr(&pBuf, (*Sqlite3)(unsafe.Pointer(db)).Flookaside.FpInit)) != uintptr(0) {
+ } else if libc.AssignUintptr(&pBuf, (*Sqlite3)(unsafe.Pointer(db)).Flookaside.FpInit) != uintptr(0) {
(*Sqlite3)(unsafe.Pointer(db)).Flookaside.FpInit = (*LookasideSlot)(unsafe.Pointer(pBuf)).FpNext
- *(*U32)(unsafe.Pointer((db + 296 /* &.lookaside */ + 16 /* &.anStat */)))++
+ *(*U32)(unsafe.Pointer(db + 320 + 16))++
return pBuf
} else {
- *(*U32)(unsafe.Pointer((db + 296 /* &.lookaside */ + 16 /* &.anStat */) + 2*4))++
+ *(*U32)(unsafe.Pointer(db + 320 + 16 + 2*4))++
}
return dbMallocRawFinish(tls, db, n)
}
// Resize the block of memory pointed to by p to n bytes. If the
// resize fails, set the mallocFailed flag in the connection object.
-func Xsqlite3DbRealloc(tls *libc.TLS, db uintptr, p uintptr, n U64) uintptr { /* sqlite3.c:28433:21: */
+func Xsqlite3DbRealloc(tls *libc.TLS, db uintptr, p uintptr, n U64) uintptr { /* sqlite3.c:28727:21: */
if p == uintptr(0) {
return Xsqlite3DbMallocRawNN(tls, db, n)
}
- if (Uptr(p)) < Uptr((*Sqlite3)(unsafe.Pointer(db)).Flookaside.FpEnd) {
- if (Uptr(p)) >= Uptr((*Sqlite3)(unsafe.Pointer(db)).Flookaside.FpMiddle) {
+ if Uptr(p) < Uptr((*Sqlite3)(unsafe.Pointer(db)).Flookaside.FpEnd) {
+ if Uptr(p) >= Uptr((*Sqlite3)(unsafe.Pointer(db)).Flookaside.FpMiddle) {
if n <= uint64(LOOKASIDE_SMALL) {
return p
}
- } else if (Uptr(p)) >= Uptr((*Sqlite3)(unsafe.Pointer(db)).Flookaside.FpStart) {
+ } else if Uptr(p) >= Uptr((*Sqlite3)(unsafe.Pointer(db)).Flookaside.FpStart) {
if n <= U64((*Sqlite3)(unsafe.Pointer(db)).Flookaside.FszTrue) {
return p
}
@@ -15526,7 +15888,7 @@ func Xsqlite3DbRealloc(tls *libc.TLS, db uintptr, p uintptr, n U64) uintptr { /*
return dbReallocFinish(tls, db, p, n)
}
-func dbReallocFinish(tls *libc.TLS, db uintptr, p uintptr, n U64) uintptr { /* sqlite3.c:28449:29: */
+func dbReallocFinish(tls *libc.TLS, db uintptr, p uintptr, n U64) uintptr { /* sqlite3.c:28743:29: */
var pNew uintptr = uintptr(0)
if int32((*Sqlite3)(unsafe.Pointer(db)).FmallocFailed) == 0 {
@@ -15550,7 +15912,7 @@ func dbReallocFinish(tls *libc.TLS, db uintptr, p uintptr, n U64) uintptr { /* s
// Attempt to reallocate p. If the reallocation fails, then free p
// and set the mallocFailed flag in the database connection.
-func Xsqlite3DbReallocOrFree(tls *libc.TLS, db uintptr, p uintptr, n U64) uintptr { /* sqlite3.c:28479:21: */
+func Xsqlite3DbReallocOrFree(tls *libc.TLS, db uintptr, p uintptr, n U64) uintptr { /* sqlite3.c:28773:21: */
var pNew uintptr
pNew = Xsqlite3DbRealloc(tls, db, p, n)
if !(pNew != 0) {
@@ -15564,13 +15926,13 @@ func Xsqlite3DbReallocOrFree(tls *libc.TLS, db uintptr, p uintptr, n U64) uintpt
// is because when memory debugging is turned on, these two functions are
// called via macros that record the current file and line number in the
// ThreadData structure.
-func Xsqlite3DbStrDup(tls *libc.TLS, db uintptr, z uintptr) uintptr { /* sqlite3.c:28495:21: */
+func Xsqlite3DbStrDup(tls *libc.TLS, db uintptr, z uintptr) uintptr { /* sqlite3.c:28789:21: */
var zNew uintptr
var n Size_t
if z == uintptr(0) {
return uintptr(0)
}
- n = (libc.Xstrlen(tls, z) + Size_t(1))
+ n = libc.Xstrlen(tls, z) + Size_t(1)
zNew = Xsqlite3DbMallocRaw(tls, db, uint64(n))
if zNew != 0 {
libc.Xmemcpy(tls, zNew, z, n)
@@ -15578,11 +15940,11 @@ func Xsqlite3DbStrDup(tls *libc.TLS, db uintptr, z uintptr) uintptr { /* sqlite3
return zNew
}
-func Xsqlite3DbStrNDup(tls *libc.TLS, db uintptr, z uintptr, n U64) uintptr { /* sqlite3.c:28508:21: */
+func Xsqlite3DbStrNDup(tls *libc.TLS, db uintptr, z uintptr, n U64) uintptr { /* sqlite3.c:28802:21: */
var zNew uintptr
if z != 0 {
- zNew = Xsqlite3DbMallocRawNN(tls, db, (n + uint64(1)))
+ zNew = Xsqlite3DbMallocRawNN(tls, db, n+uint64(1))
} else {
zNew = uintptr(0)
}
@@ -15596,20 +15958,20 @@ func Xsqlite3DbStrNDup(tls *libc.TLS, db uintptr, z uintptr, n U64) uintptr { /*
// The text between zStart and zEnd represents a phrase within a larger
// SQL statement. Make a copy of this phrase in space obtained form
// sqlite3DbMalloc(). Omit leading and trailing whitespace.
-func Xsqlite3DbSpanDup(tls *libc.TLS, db uintptr, zStart uintptr, zEnd uintptr) uintptr { /* sqlite3.c:28526:21: */
+func Xsqlite3DbSpanDup(tls *libc.TLS, db uintptr, zStart uintptr, zEnd uintptr) uintptr { /* sqlite3.c:28820:21: */
var n int32
- for (int32(Xsqlite3CtypeMap[uint8(*(*uint8)(unsafe.Pointer(zStart)))]) & 0x01) != 0 {
+ for int32(Xsqlite3CtypeMap[uint8(*(*uint8)(unsafe.Pointer(zStart)))])&0x01 != 0 {
zStart++
}
- n = ((int32(zEnd) - int32(zStart)) / 1)
- for (n > 0) && ((int32(Xsqlite3CtypeMap[uint8(*(*uint8)(unsafe.Pointer(zStart + uintptr((n - 1)))))]) & 0x01) != 0) {
+ n = (int32(zEnd) - int32(zStart)) / 1
+ for n > 0 && int32(Xsqlite3CtypeMap[uint8(*(*uint8)(unsafe.Pointer(zStart + uintptr(n-1))))])&0x01 != 0 {
n--
}
return Xsqlite3DbStrNDup(tls, db, zStart, uint64(n))
}
// Free any prior content in *pz and replace it with a copy of zNew.
-func Xsqlite3SetString(tls *libc.TLS, pz uintptr, db uintptr, zNew uintptr) { /* sqlite3.c:28537:21: */
+func Xsqlite3SetString(tls *libc.TLS, pz uintptr, db uintptr, zNew uintptr) { /* sqlite3.c:28831:21: */
Xsqlite3DbFree(tls, db, *(*uintptr)(unsafe.Pointer(pz)))
*(*uintptr)(unsafe.Pointer(pz)) = Xsqlite3DbStrDup(tls, db, zNew)
}
@@ -15618,11 +15980,11 @@ func Xsqlite3SetString(tls *libc.TLS, pz uintptr, db uintptr, zNew uintptr) { /*
// has happened. This routine will set db->mallocFailed, and also
// temporarily disable the lookaside memory allocator and interrupt
// any running VDBEs.
-func Xsqlite3OomFault(tls *libc.TLS, db uintptr) { /* sqlite3.c:28548:21: */
- if (int32((*Sqlite3)(unsafe.Pointer(db)).FmallocFailed) == 0) && (int32((*Sqlite3)(unsafe.Pointer(db)).FbBenignMalloc) == 0) {
+func Xsqlite3OomFault(tls *libc.TLS, db uintptr) { /* sqlite3.c:28842:21: */
+ if int32((*Sqlite3)(unsafe.Pointer(db)).FmallocFailed) == 0 && int32((*Sqlite3)(unsafe.Pointer(db)).FbBenignMalloc) == 0 {
(*Sqlite3)(unsafe.Pointer(db)).FmallocFailed = U8(1)
if (*Sqlite3)(unsafe.Pointer(db)).FnVdbeExec > 0 {
- libc.AtomicStoreNInt32((db + 288 /* &.u1 */ /* &.isInterrupted */), int32(1), 0)
+ libc.AtomicStoreNInt32(db+312, int32(1), 0)
}
(*Sqlite3)(unsafe.Pointer(db)).Flookaside.FbDisable++
(*Sqlite3)(unsafe.Pointer(db)).Flookaside.Fsz = U16(0)
@@ -15637,10 +15999,10 @@ func Xsqlite3OomFault(tls *libc.TLS, db uintptr) { /* sqlite3.c:28548:21: */
//
// The memory allocator is not restarted if there are running
// VDBEs.
-func Xsqlite3OomClear(tls *libc.TLS, db uintptr) { /* sqlite3.c:28568:21: */
- if ((*Sqlite3)(unsafe.Pointer(db)).FmallocFailed != 0) && ((*Sqlite3)(unsafe.Pointer(db)).FnVdbeExec == 0) {
+func Xsqlite3OomClear(tls *libc.TLS, db uintptr) { /* sqlite3.c:28862:21: */
+ if (*Sqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 && (*Sqlite3)(unsafe.Pointer(db)).FnVdbeExec == 0 {
(*Sqlite3)(unsafe.Pointer(db)).FmallocFailed = U8(0)
- libc.AtomicStoreNInt32((db + 288 /* &.u1 */ /* &.isInterrupted */), int32(0), 0)
+ libc.AtomicStoreNInt32(db+312, int32(0), 0)
(*Sqlite3)(unsafe.Pointer(db)).Flookaside.FbDisable--
(*Sqlite3)(unsafe.Pointer(db)).Flookaside.Fsz = func() uint16 {
@@ -15653,13 +16015,13 @@ func Xsqlite3OomClear(tls *libc.TLS, db uintptr) { /* sqlite3.c:28568:21: */
}
// Take actions at the end of an API call to deal with error codes.
-func apiHandleError(tls *libc.TLS, db uintptr, rc int32) int32 { /* sqlite3.c:28580:28: */
- if ((*Sqlite3)(unsafe.Pointer(db)).FmallocFailed != 0) || (rc == (SQLITE_IOERR | (int32(12) << 8))) {
+func apiHandleError(tls *libc.TLS, db uintptr, rc int32) int32 { /* sqlite3.c:28874:28: */
+ if (*Sqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 || rc == SQLITE_IOERR|int32(12)<<8 {
Xsqlite3OomClear(tls, db)
Xsqlite3Error(tls, db, SQLITE_NOMEM)
return SQLITE_NOMEM
}
- return (rc & (*Sqlite3)(unsafe.Pointer(db)).FerrMask)
+ return rc & (*Sqlite3)(unsafe.Pointer(db)).FerrMask
}
// This function must be called before exiting any API function (i.e.
@@ -15672,15 +16034,15 @@ func apiHandleError(tls *libc.TLS, db uintptr, rc int32) int32 { /* sqlite3.c:28
//
// If an OOM as occurred, then the connection error-code (the value
// returned by sqlite3_errcode()) is set to SQLITE_NOMEM.
-func Xsqlite3ApiExit(tls *libc.TLS, db uintptr, rc int32) int32 { /* sqlite3.c:28601:20: */
+func Xsqlite3ApiExit(tls *libc.TLS, db uintptr, rc int32) int32 { /* sqlite3.c:28895:20: */
// If the db handle must hold the connection handle mutex here.
// Otherwise the read (and possible write) of db->mallocFailed
// is unsafe, as is the call to sqlite3Error().
- if ((*Sqlite3)(unsafe.Pointer(db)).FmallocFailed != 0) || (rc != 0) {
+ if (*Sqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 || rc != 0 {
return apiHandleError(tls, db, rc)
}
- return (rc & (*Sqlite3)(unsafe.Pointer(db)).FerrMask)
+ return rc & (*Sqlite3)(unsafe.Pointer(db)).FerrMask
}
//************* End of malloc.c *********************************************
@@ -15701,7 +16063,7 @@ func Xsqlite3ApiExit(tls *libc.TLS, db uintptr, rc int32) int32 { /* sqlite3.c:2
// The rest are extensions, not normally found in printf()
// An "etByte" is an 8-bit unsigned value.
-type EtByte = uint8 /* sqlite3.c:28659:23 */
+type EtByte = uint8 /* sqlite3.c:28953:23 */
// Each builtin conversion character (ex: the 'd' in "%d") is described
// by an instance of the following structure
@@ -15712,18 +16074,18 @@ type et_info = struct {
Ftype EtByte
Fcharset EtByte
Fprefix EtByte
-} /* sqlite3.c:28665:9 */
+} /* sqlite3.c:28959:9 */
// Each builtin conversion character (ex: the 'd' in "%d") is described
// by an instance of the following structure
-type Et_info = et_info /* sqlite3.c:28672:3 */
+type Et_info = et_info /* sqlite3.c:28966:3 */
// Allowed values for et_info.flags
// The following table is searched linearly, so it is good to put the
// most frequently used conversion types first.
-var aDigits = *(*[33]uint8)(unsafe.Pointer(ts + 705 /* "0123456789ABCDEF..." */)) /* sqlite3.c:28685:19 */
-var aPrefix = *(*[7]uint8)(unsafe.Pointer(ts + 738 /* "-x0\x00X0" */)) /* sqlite3.c:28686:19 */
+var aDigits = *(*[33]uint8)(unsafe.Pointer(ts + 1493 /* "0123456789ABCDEF..." */)) /* sqlite3.c:28979:19 */
+var aPrefix = *(*[7]uint8)(unsafe.Pointer(ts + 1526 /* "-x0\x00X0" */)) /* sqlite3.c:28980:19 */
var fmtinfo = [23]Et_info{
{Ffmttype: uint8('d'), Fbase: EtByte(10), Fflags: EtByte(1), Ftype: EtByte(EtDECIMAL)},
{Ffmttype: uint8('s'), Fflags: EtByte(4), Ftype: EtByte(EtSTRING)},
@@ -15750,7 +16112,7 @@ var fmtinfo = [23]Et_info{
{Ffmttype: uint8('T'), Ftype: EtByte(EtTOKEN)},
{Ffmttype: uint8('S'), Ftype: EtByte(EtSRCITEM)},
{Ffmttype: uint8('r'), Fbase: EtByte(10), Fflags: EtByte(1), Ftype: EtByte(EtORDINAL)},
-} /* sqlite3.c:28687:22 */
+} /* sqlite3.c:28981:22 */
// Notes:
//
@@ -15761,7 +16123,7 @@ var fmtinfo = [23]Et_info{
var arRound = [10]float64{
5.0e-01, 5.0e-02, 5.0e-03, 5.0e-04, 5.0e-05,
5.0e-06, 5.0e-07, 5.0e-08, 5.0e-09, 5.0e-10,
-} /* sqlite3.c:28724:21 */
+} /* sqlite3.c:29018:21 */
// If SQLITE_OMIT_FLOATING_POINT is defined, then none of the floating point
// conversions will work.
@@ -15776,22 +16138,22 @@ var arRound = [10]float64{
// The counter *cnt is incremented each time. After counter exceeds
// 16 (the number of significant digits in a 64-bit float) '0' is
// always returned.
-func et_getdigit(tls *libc.TLS, val uintptr, cnt uintptr) uint8 { /* sqlite3.c:28747:13: */
+func et_getdigit(tls *libc.TLS, val uintptr, cnt uintptr) uint8 { /* sqlite3.c:29041:13: */
var digit int32
var d float64
- if (*(*int32)(unsafe.Pointer(cnt))) <= 0 {
+ if *(*int32)(unsafe.Pointer(cnt)) <= 0 {
return uint8('0')
}
- (*(*int32)(unsafe.Pointer(cnt)))--
+ *(*int32)(unsafe.Pointer(cnt))--
digit = int32(*(*float64)(unsafe.Pointer(val)))
d = float64(digit)
- digit = digit + ('0')
- *(*float64)(unsafe.Pointer(val)) = ((*(*float64)(unsafe.Pointer(val)) - d) * 10.0)
+ digit = digit + '0'
+ *(*float64)(unsafe.Pointer(val)) = (*(*float64)(unsafe.Pointer(val)) - d) * 10.0
return uint8(digit)
}
// Set the StrAccum object to an error mode.
-func setStrAccumError(tls *libc.TLS, p uintptr, eError U8) { /* sqlite3.c:28763:13: */
+func Xsqlite3StrAccumSetError(tls *libc.TLS, p uintptr, eError U8) { /* sqlite3.c:29057:21: */
(*StrAccum)(unsafe.Pointer(p)).FaccError = eError
if (*StrAccum)(unsafe.Pointer(p)).FmxAlloc != 0 {
@@ -15803,21 +16165,21 @@ func setStrAccumError(tls *libc.TLS, p uintptr, eError U8) { /* sqlite3.c:28763:
}
// Extra argument values from a PrintfArguments object
-func getIntArg(tls *libc.TLS, p uintptr) Sqlite3_int64 { /* sqlite3.c:28773:22: */
+func getIntArg(tls *libc.TLS, p uintptr) Sqlite3_int64 { /* sqlite3.c:29067:22: */
if (*PrintfArguments)(unsafe.Pointer(p)).FnArg <= (*PrintfArguments)(unsafe.Pointer(p)).FnUsed {
return int64(0)
}
return Xsqlite3_value_int64(tls, *(*uintptr)(unsafe.Pointer((*PrintfArguments)(unsafe.Pointer(p)).FapArg + uintptr(libc.PostIncInt32(&(*PrintfArguments)(unsafe.Pointer(p)).FnUsed, 1))*4)))
}
-func getDoubleArg(tls *libc.TLS, p uintptr) float64 { /* sqlite3.c:28777:15: */
+func getDoubleArg(tls *libc.TLS, p uintptr) float64 { /* sqlite3.c:29071:15: */
if (*PrintfArguments)(unsafe.Pointer(p)).FnArg <= (*PrintfArguments)(unsafe.Pointer(p)).FnUsed {
return 0.0
}
return Xsqlite3_value_double(tls, *(*uintptr)(unsafe.Pointer((*PrintfArguments)(unsafe.Pointer(p)).FapArg + uintptr(libc.PostIncInt32(&(*PrintfArguments)(unsafe.Pointer(p)).FnUsed, 1))*4)))
}
-func getTextArg(tls *libc.TLS, p uintptr) uintptr { /* sqlite3.c:28781:13: */
+func getTextArg(tls *libc.TLS, p uintptr) uintptr { /* sqlite3.c:29075:13: */
if (*PrintfArguments)(unsafe.Pointer(p)).FnArg <= (*PrintfArguments)(unsafe.Pointer(p)).FnUsed {
return uintptr(0)
}
@@ -15831,18 +16193,18 @@ func getTextArg(tls *libc.TLS, p uintptr) uintptr { /* sqlite3.c:28781:13: */
// Do the size check before the memory allocation to prevent rogue
// SQL from requesting large allocations using the precision or width
// field of the printf() function.
-func printfTempBuf(tls *libc.TLS, pAccum uintptr, n Sqlite3_int64) uintptr { /* sqlite3.c:28795:13: */
+func printfTempBuf(tls *libc.TLS, pAccum uintptr, n Sqlite3_int64) uintptr { /* sqlite3.c:29089:13: */
var z uintptr
if (*Sqlite3_str)(unsafe.Pointer(pAccum)).FaccError != 0 {
return uintptr(0)
}
- if (n > Sqlite3_int64((*Sqlite3_str)(unsafe.Pointer(pAccum)).FnAlloc)) && (n > Sqlite3_int64((*Sqlite3_str)(unsafe.Pointer(pAccum)).FmxAlloc)) {
- setStrAccumError(tls, pAccum, uint8(SQLITE_TOOBIG))
+ if n > Sqlite3_int64((*Sqlite3_str)(unsafe.Pointer(pAccum)).FnAlloc) && n > Sqlite3_int64((*Sqlite3_str)(unsafe.Pointer(pAccum)).FmxAlloc) {
+ Xsqlite3StrAccumSetError(tls, pAccum, uint8(SQLITE_TOOBIG))
return uintptr(0)
}
z = Xsqlite3DbMallocRaw(tls, (*Sqlite3_str)(unsafe.Pointer(pAccum)).Fdb, uint64(n))
if z == uintptr(0) {
- setStrAccumError(tls, pAccum, uint8(SQLITE_NOMEM))
+ Xsqlite3StrAccumSetError(tls, pAccum, uint8(SQLITE_NOMEM))
}
return z
}
@@ -15853,7 +16215,7 @@ func printfTempBuf(tls *libc.TLS, pAccum uintptr, n Sqlite3_int64) uintptr { /*
// Hard limit on the precision of floating-point conversions.
// Render a string given by "fmt" into the StrAccum object.
-func Xsqlite3_str_vappendf(tls *libc.TLS, pAccum uintptr, fmt uintptr, ap Va_list) { /* sqlite3.c:28828:17: */
+func Xsqlite3_str_vappendf(tls *libc.TLS, pAccum uintptr, fmt uintptr, ap Va_list) { /* sqlite3.c:29122:17: */
bp := tls.Alloc(108)
defer tls.Free(108)
@@ -15937,7 +16299,7 @@ func Xsqlite3_str_vappendf(tls *libc.TLS, pAccum uintptr, fmt uintptr, ap Va_lis
// optimization.
bufpt = uintptr(0)
- if !((int32((*Sqlite3_str)(unsafe.Pointer(pAccum)).FprintfFlags) & SQLITE_PRINTF_SQLFUNC) != 0) {
+ if !(int32((*Sqlite3_str)(unsafe.Pointer(pAccum)).FprintfFlags)&SQLITE_PRINTF_SQLFUNC != 0) {
goto __1
}
pArgList = libc.VaUintptr(&ap)
@@ -15948,7 +16310,7 @@ __1:
__2:
;
__3:
- if !((libc.AssignInt32(&c, int32(*(*uint8)(unsafe.Pointer(fmt))))) != 0) {
+ if !(libc.AssignInt32(&c, int32(*(*uint8)(unsafe.Pointer(fmt)))) != 0) {
goto __5
}
if !(c != '%') {
@@ -15959,13 +16321,13 @@ __7:
fmt++
goto __8
__8:
- if (*(*uint8)(unsafe.Pointer(fmt)) != 0) && (int32(*(*uint8)(unsafe.Pointer(fmt))) != '%') {
+ if *(*uint8)(unsafe.Pointer(fmt)) != 0 && int32(*(*uint8)(unsafe.Pointer(fmt))) != '%' {
goto __7
}
goto __9
__9:
;
- Xsqlite3_str_append(tls, pAccum, bufpt, ((int32(fmt) - int32(bufpt)) / 1))
+ Xsqlite3_str_append(tls, pAccum, bufpt, (int32(fmt)-int32(bufpt))/1)
if !(int32(*(*uint8)(unsafe.Pointer(fmt))) == 0) {
goto __10
}
@@ -15974,10 +16336,10 @@ __10:
;
__6:
;
- if !((libc.AssignInt32(&c, int32(*(*uint8)(unsafe.Pointer(libc.PreIncUintptr(&fmt, 1)))))) == 0) {
+ if !(libc.AssignInt32(&c, int32(*(*uint8)(unsafe.Pointer(libc.PreIncUintptr(&fmt, 1))))) == 0) {
goto __11
}
- Xsqlite3_str_append(tls, pAccum, ts+745 /* "%" */, 1)
+ Xsqlite3_str_append(tls, pAccum, ts+1533 /* "%" */, 1)
goto __5
__11:
;
@@ -16077,18 +16439,18 @@ __30:
__31:
__32:
__33:
- wx = (uint32(c - '0'))
+ wx = uint32(c - '0')
__37:
- if !(((libc.AssignInt32(&c, int32(*(*uint8)(unsafe.Pointer(libc.PreIncUintptr(&fmt, 1)))))) >= '0') && (c <= '9')) {
+ if !(libc.AssignInt32(&c, int32(*(*uint8)(unsafe.Pointer(libc.PreIncUintptr(&fmt, 1))))) >= '0' && c <= '9') {
goto __38
}
- wx = (((wx * uint32(10)) + uint32(c)) - uint32('0'))
+ wx = wx*uint32(10) + uint32(c) - uint32('0')
goto __37
__38:
;
- width = (int32(wx & uint32(0x7fffffff)))
- if !((c != '.') && (c != 'l')) {
+ width = int32(wx & uint32(0x7fffffff))
+ if !(c != '.' && c != 'l') {
goto __39
}
done = EtByte(1)
@@ -16120,7 +16482,7 @@ __42:
}
__43:
;
- if !(((libc.AssignInt32(&c, int32(*(*uint8)(unsafe.Pointer(fmt + 1))))) != '.') && (c != 'l')) {
+ if !(libc.AssignInt32(&c, int32(*(*uint8)(unsafe.Pointer(fmt + 1)))) != '.' && c != 'l') {
goto __44
}
c = int32(*(*uint8)(unsafe.Pointer(libc.PreIncUintptr(&fmt, 1))))
@@ -16158,16 +16520,16 @@ __49:
__45:
px = uint32(0)
__50:
- if !((c >= '0') && (c <= '9')) {
+ if !(c >= '0' && c <= '9') {
goto __51
}
- px = (((px * uint32(10)) + uint32(c)) - uint32('0'))
+ px = px*uint32(10) + uint32(c) - uint32('0')
c = int32(*(*uint8)(unsafe.Pointer(libc.PreIncUintptr(&fmt, 1))))
goto __50
__51:
;
- precision = (int32(px & uint32(0x7fffffff)))
+ precision = int32(px & uint32(0x7fffffff))
__46:
;
if !(c == 'l') {
@@ -16185,7 +16547,7 @@ __15:
;
goto __13
__13:
- if !(done != 0) && ((libc.AssignInt32(&c, int32(*(*uint8)(unsafe.Pointer(libc.PreIncUintptr(&fmt, 1)))))) != 0) {
+ if !(done != 0) && libc.AssignInt32(&c, int32(*(*uint8)(unsafe.Pointer(libc.PreIncUintptr(&fmt, 1))))) != 0 {
goto __12
}
goto __14
@@ -16193,17 +16555,17 @@ __14:
;
// Fetch the info entry for the field
- infop = (uintptr(unsafe.Pointer(&fmtinfo)))
+ infop = uintptr(unsafe.Pointer(&fmtinfo))
xtype = EtByte(EtINVALID)
idx = 0
__54:
- if !(idx < (int32(uint32(unsafe.Sizeof(fmtinfo)) / uint32(unsafe.Sizeof(Et_info{}))))) {
+ if !(idx < int32(uint32(unsafe.Sizeof(fmtinfo))/uint32(unsafe.Sizeof(Et_info{})))) {
goto __56
}
if !(c == int32(fmtinfo[idx].Ffmttype)) {
goto __57
}
- infop = (uintptr(unsafe.Pointer(&fmtinfo)) + uintptr(idx)*6)
+ infop = uintptr(unsafe.Pointer(&fmtinfo)) + uintptr(idx)*6
xtype = (*Et_info)(unsafe.Pointer(infop)).Ftype
goto __56
__57:
@@ -16285,7 +16647,7 @@ __60:
__61:
cThousand = EtByte(0)
__62:
- if !((int32((*Et_info)(unsafe.Pointer(infop)).Fflags) & FLAG_SIGNED) != 0) {
+ if !(int32((*Et_info)(unsafe.Pointer(infop)).Fflags)&FLAG_SIGNED != 0) {
goto __77
}
if !(bArgList != 0) {
@@ -16362,24 +16724,24 @@ __78:
flag_alternateform = EtByte(0)
__93:
;
- if !((flag_zeropad != 0) && (precision < (width - (libc.Bool32(int32(prefix) != 0))))) {
+ if !(flag_zeropad != 0 && precision < width-libc.Bool32(int32(prefix) != 0)) {
goto __94
}
- precision = (width - (libc.Bool32(int32(prefix) != 0)))
+ precision = width - libc.Bool32(int32(prefix) != 0)
__94:
;
- if !(precision < ((SQLITE_PRINT_BUF_SIZE - 10) - (SQLITE_PRINT_BUF_SIZE / 3))) {
+ if !(precision < SQLITE_PRINT_BUF_SIZE-10-SQLITE_PRINT_BUF_SIZE/3) {
goto __95
}
nOut = SQLITE_PRINT_BUF_SIZE
zOut = bp + 8 /* &buf[0] */
goto __96
__95:
- n = (U64(precision) + uint64(10))
+ n = U64(precision) + uint64(10)
if !(cThousand != 0) {
goto __97
}
- n = n + (U64(precision / 3))
+ n = n + U64(precision/3)
__97:
;
zOut = libc.AssignUintptr(&zExtra, printfTempBuf(tls, pAccum, int64(n)))
@@ -16392,27 +16754,27 @@ __98:
nOut = int32(n)
__96:
;
- bufpt = (zOut + uintptr((nOut - 1)))
+ bufpt = zOut + uintptr(nOut-1)
if !(int32(xtype) == EtORDINAL) {
goto __99
}
- x = (int32(longvalue % uint64(10)))
- if !((x >= 4) || (((longvalue / uint64(10)) % uint64(10)) == uint64(1))) {
+ x = int32(longvalue % uint64(10))
+ if !(x >= 4 || longvalue/uint64(10)%uint64(10) == uint64(1)) {
goto __100
}
x = 0
__100:
;
- *(*uint8)(unsafe.Pointer(libc.PreDecUintptr(&bufpt, 1))) = zOrd[((x * 2) + 1)]
- *(*uint8)(unsafe.Pointer(libc.PreDecUintptr(&bufpt, 1))) = zOrd[(x * 2)]
+ *(*uint8)(unsafe.Pointer(libc.PreDecUintptr(&bufpt, 1))) = zOrd[x*2+1]
+ *(*uint8)(unsafe.Pointer(libc.PreDecUintptr(&bufpt, 1))) = zOrd[x*2]
__99:
;
- cset = (uintptr(unsafe.Pointer(&aDigits)) + uintptr((*Et_info)(unsafe.Pointer(infop)).Fcharset))
+ cset = uintptr(unsafe.Pointer(&aDigits)) + uintptr((*Et_info)(unsafe.Pointer(infop)).Fcharset)
base = (*Et_info)(unsafe.Pointer(infop)).Fbase
__101: // Convert to ascii
- *(*uint8)(unsafe.Pointer(libc.PreDecUintptr(&bufpt, 1))) = *(*uint8)(unsafe.Pointer(cset + uintptr((longvalue % Sqlite_uint64(base)))))
- longvalue = (longvalue / Sqlite_uint64(base))
+ *(*uint8)(unsafe.Pointer(libc.PreDecUintptr(&bufpt, 1))) = *(*uint8)(unsafe.Pointer(cset + uintptr(longvalue%Sqlite_uint64(base))))
+ longvalue = longvalue / Sqlite_uint64(base)
goto __102
__102:
if longvalue > uint64(0) {
@@ -16422,7 +16784,7 @@ __102:
__103:
;
- length = ((int32((zOut + uintptr((nOut - 1)))) - int32(bufpt)) / 1)
+ length = (int32(zOut+uintptr(nOut-1)) - int32(bufpt)) / 1
__104:
if !(precision > length) {
goto __105
@@ -16435,15 +16797,15 @@ __105:
if !(cThousand != 0) {
goto __106
}
- nn = ((length - 1) / 3) // Number of "," to insert
- ix = (((length - 1) % 3) + 1)
+ nn = (length - 1) / 3 // Number of "," to insert
+ ix = (length-1)%3 + 1
bufpt -= uintptr(nn)
idx = 0
__107:
if !(nn > 0) {
goto __109
}
- *(*uint8)(unsafe.Pointer(bufpt + uintptr(idx))) = *(*uint8)(unsafe.Pointer(bufpt + uintptr((idx + nn))))
+ *(*uint8)(unsafe.Pointer(bufpt + uintptr(idx))) = *(*uint8)(unsafe.Pointer(bufpt + uintptr(idx+nn)))
ix--
if !(ix == 0) {
goto __110
@@ -16468,12 +16830,12 @@ __106:
*(*uint8)(unsafe.Pointer(libc.PreDecUintptr(&bufpt, 1))) = prefix
__111:
; // Add sign
- if !((flag_alternateform != 0) && ((*Et_info)(unsafe.Pointer(infop)).Fprefix != 0)) {
+ if !(flag_alternateform != 0 && (*Et_info)(unsafe.Pointer(infop)).Fprefix != 0) {
goto __112
}
- pre = (uintptr(unsafe.Pointer(&aPrefix)) + uintptr((*Et_info)(unsafe.Pointer(infop)).Fprefix))
+ pre = uintptr(unsafe.Pointer(&aPrefix)) + uintptr((*Et_info)(unsafe.Pointer(infop)).Fprefix)
__113:
- if !((int32(libc.AssignUint8(&x1, *(*uint8)(unsafe.Pointer(pre))))) != 0) {
+ if !(int32(libc.AssignUint8(&x1, *(*uint8)(unsafe.Pointer(pre)))) != 0) {
goto __115
}
*(*uint8)(unsafe.Pointer(libc.PreDecUintptr(&bufpt, 1))) = x1
@@ -16486,7 +16848,7 @@ __115:
;
__112:
;
- length = ((int32((zOut + uintptr((nOut - 1)))) - int32(bufpt)) / 1)
+ length = (int32(zOut+uintptr(nOut-1)) - int32(bufpt)) / 1
goto __58
__63:
__64:
@@ -16512,7 +16874,7 @@ __118:
precision = SQLITE_FP_PRECISION_LIMIT
__119:
;
- if !(*(*float64)(unsafe.Pointer(bp + 96 /* realvalue */)) < 0.0) {
+ if !(*(*float64)(unsafe.Pointer(bp + 96)) < 0.0) {
goto __120
}
*(*float64)(unsafe.Pointer(bp + 96 /* realvalue */)) = -*(*float64)(unsafe.Pointer(bp + 96 /* realvalue */))
@@ -16522,21 +16884,21 @@ __120:
prefix = uint8(flag_prefix)
__121:
;
- if !((int32(xtype) == EtGENERIC) && (precision > 0)) {
+ if !(int32(xtype) == EtGENERIC && precision > 0) {
goto __122
}
precision--
__122:
;
- idx = (precision & 0xfff)
- rounder = arRound[(idx % 10)]
+ idx = precision & 0xfff
+ rounder = arRound[idx%10]
__123:
if !(idx >= 10) {
goto __124
}
- rounder = rounder * (1.0e-10)
- idx = idx - (10)
+ rounder = rounder * 1.0e-10
+ idx = idx - 10
goto __123
__124:
;
@@ -16545,11 +16907,11 @@ __124:
}
*(*float64)(unsafe.Pointer(bp + 88 /* rx */)) = *(*float64)(unsafe.Pointer(bp + 96 /* realvalue */))
libc.Xmemcpy(tls, bp+80 /* &u */, bp+88 /* &rx */, uint32(unsafe.Sizeof(Sqlite3_uint64(0))))
- ex = (-1023 + (int32((*(*Sqlite3_uint64)(unsafe.Pointer(bp + 80 /* u */)) >> 52) & uint64(0x7ff))))
- if !((precision + (ex / 3)) < 15) {
+ ex = -1023 + int32(*(*Sqlite3_uint64)(unsafe.Pointer(bp + 80))>>52&uint64(0x7ff))
+ if !(precision+ex/3 < 15) {
goto __126
}
- rounder = rounder + (*(*float64)(unsafe.Pointer(bp + 96 /* realvalue */)) * 3e-16)
+ rounder = rounder + *(*float64)(unsafe.Pointer(bp + 96))*3e-16
__126:
;
*(*float64)(unsafe.Pointer(bp + 96 /* realvalue */)) += rounder
@@ -16557,57 +16919,57 @@ __125:
;
// Normalize realvalue to within 10.0 > realvalue >= 1.0
exp = 0
- if !(Xsqlite3IsNaN(tls, *(*float64)(unsafe.Pointer(bp + 96 /* realvalue */))) != 0) {
+ if !(Xsqlite3IsNaN(tls, *(*float64)(unsafe.Pointer(bp + 96))) != 0) {
goto __127
}
- bufpt = ts + 747 /* "NaN" */
+ bufpt = ts + 1535 /* "NaN" */
length = 3
goto __58
__127:
;
- if !(*(*float64)(unsafe.Pointer(bp + 96 /* realvalue */)) > 0.0) {
+ if !(*(*float64)(unsafe.Pointer(bp + 96)) > 0.0) {
goto __128
}
scale = 1.0
__129:
- if !((*(*float64)(unsafe.Pointer(bp + 96 /* realvalue */)) >= (1e100 * scale)) && (exp <= 350)) {
+ if !(*(*float64)(unsafe.Pointer(bp + 96)) >= 1e100*scale && exp <= 350) {
goto __130
}
- scale = scale * (1e100)
- exp = exp + (100)
+ scale = scale * 1e100
+ exp = exp + 100
goto __129
__130:
;
__131:
- if !((*(*float64)(unsafe.Pointer(bp + 96 /* realvalue */)) >= (1e10 * scale)) && (exp <= 350)) {
+ if !(*(*float64)(unsafe.Pointer(bp + 96)) >= 1e10*scale && exp <= 350) {
goto __132
}
- scale = scale * (1e10)
- exp = exp + (10)
+ scale = scale * 1e10
+ exp = exp + 10
goto __131
__132:
;
__133:
- if !((*(*float64)(unsafe.Pointer(bp + 96 /* realvalue */)) >= (10.0 * scale)) && (exp <= 350)) {
+ if !(*(*float64)(unsafe.Pointer(bp + 96)) >= 10.0*scale && exp <= 350) {
goto __134
}
- scale = scale * (10.0)
+ scale = scale * 10.0
exp++
goto __133
__134:
;
*(*float64)(unsafe.Pointer(bp + 96 /* realvalue */)) /= scale
__135:
- if !(*(*float64)(unsafe.Pointer(bp + 96 /* realvalue */)) < 1e-8) {
+ if !(*(*float64)(unsafe.Pointer(bp + 96)) < 1e-8) {
goto __136
}
*(*float64)(unsafe.Pointer(bp + 96 /* realvalue */)) *= 1e8
- exp = exp - (8)
+ exp = exp - 8
goto __135
__136:
;
__137:
- if !(*(*float64)(unsafe.Pointer(bp + 96 /* realvalue */)) < 1.0) {
+ if !(*(*float64)(unsafe.Pointer(bp + 96)) < 1.0) {
goto __138
}
*(*float64)(unsafe.Pointer(bp + 96 /* realvalue */)) *= 10.0
@@ -16620,8 +16982,8 @@ __138:
}
bufpt = bp + 8 /* &buf[0] */
*(*uint8)(unsafe.Pointer(bp + 8 /* &buf[0] */)) = prefix
- libc.Xmemcpy(tls, (bp + 8 /* &buf[0] */ + uintptr((libc.Bool32(int32(prefix) != 0)))), ts+751 /* "Inf" */, uint32(4))
- length = (3 + (libc.Bool32(int32(prefix) != 0)))
+ libc.Xmemcpy(tls, bp+8+uintptr(libc.Bool32(int32(prefix) != 0)), ts+1539 /* "Inf" */, uint32(4))
+ length = 3 + libc.Bool32(int32(prefix) != 0)
goto __58
__139:
;
@@ -16634,7 +16996,7 @@ __128:
goto __140
}
*(*float64)(unsafe.Pointer(bp + 96 /* realvalue */)) += rounder
- if !(*(*float64)(unsafe.Pointer(bp + 96 /* realvalue */)) >= 10.0) {
+ if !(*(*float64)(unsafe.Pointer(bp + 96)) >= 10.0) {
goto __141
}
*(*float64)(unsafe.Pointer(bp + 96 /* realvalue */)) *= 0.1
@@ -16647,13 +17009,13 @@ __140:
goto __142
}
flag_rtz = libc.BoolUint8(!(flag_alternateform != 0))
- if !((exp < -4) || (exp > precision)) {
+ if !(exp < -4 || exp > precision) {
goto __144
}
xtype = EtByte(EtEXP)
goto __145
__144:
- precision = (precision - exp)
+ precision = precision - exp
xtype = EtByte(EtFLOAT)
__145:
;
@@ -16672,12 +17034,12 @@ __146:
__147:
;
// Size of a temporary buffer needed
- szBufNeeded = ((((func() int64 {
- if (e2) > (0) {
+ szBufNeeded = func() int64 {
+ if e2 > 0 {
return int64(e2)
}
return int64(0)
- }()) + I64(precision)) + I64(width)) + int64(15))
+ }() + I64(precision) + I64(width) + int64(15)
if !(szBufNeeded > int64(SQLITE_PRINT_BUF_SIZE)) {
goto __148
}
@@ -16692,13 +17054,13 @@ __148:
;
zOut = bufpt
- *(*int32)(unsafe.Pointer(bp + 104 /* nsd */)) = (16 + (int32(flag_altform2) * 10))
- flag_dp = (EtByte(((func() int32 {
+ *(*int32)(unsafe.Pointer(bp + 104 /* nsd */)) = 16 + int32(flag_altform2)*10
+ flag_dp = EtByte(func() int32 {
if precision > 0 {
return 1
}
return 0
- }()) | int32(flag_alternateform)) | int32(flag_altform2)))
+ }() | int32(flag_alternateform) | int32(flag_altform2))
// The sign in front of the number
if !(prefix != 0) {
goto __150
@@ -16754,7 +17116,7 @@ __159:
;
// Significant digits after the decimal point
__160:
- if !((libc.PostDecInt32(&precision, 1)) > 0) {
+ if !(libc.PostDecInt32(&precision, 1) > 0) {
goto __161
}
*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&bufpt, 1))) = et_getdigit(tls, bp+96 /* &realvalue */, bp+104 /* &nsd */)
@@ -16762,7 +17124,7 @@ __160:
__161:
;
// Remove trailing zeros and the "." if no digits follow the "."
- if !((flag_rtz != 0) && (flag_dp != 0)) {
+ if !(flag_rtz != 0 && flag_dp != 0) {
goto __162
}
__163:
@@ -16808,12 +17170,12 @@ __170:
if !(exp >= 100) {
goto __171
}
- *(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&bufpt, 1))) = (uint8((exp / 100) + '0')) // 100's digit
- exp = exp % (100)
+ *(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&bufpt, 1))) = uint8(exp/100 + '0') // 100's digit
+ exp = exp % 100
__171:
;
- *(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&bufpt, 1))) = (uint8((exp / 10) + '0')) // 10's digit
- *(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&bufpt, 1))) = (uint8((exp % 10) + '0')) // 1's digit
+ *(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&bufpt, 1))) = uint8(exp/10 + '0') // 10's digit
+ *(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&bufpt, 1))) = uint8(exp%10 + '0') // 1's digit
__168:
;
*(*uint8)(unsafe.Pointer(bufpt)) = uint8(0)
@@ -16821,21 +17183,21 @@ __168:
// The converted number is in buf[] and zero terminated. Output it.
// Note that the number is in the usual order, not reversed as with
// integer conversions.
- length = ((int32(bufpt) - int32(zOut)) / 1)
+ length = (int32(bufpt) - int32(zOut)) / 1
bufpt = zOut
// Special case: Add leading zeros if the flag_zeropad flag is
// set and we are not left justified
- if !(((flag_zeropad != 0) && !(flag_leftjustify != 0)) && (length < width)) {
+ if !(flag_zeropad != 0 && !(flag_leftjustify != 0) && length < width) {
goto __172
}
- nPad = (width - length)
+ nPad = width - length
i = width
__173:
if !(i >= nPad) {
goto __175
}
- *(*uint8)(unsafe.Pointer(bufpt + uintptr(i))) = *(*uint8)(unsafe.Pointer(bufpt + uintptr((i - nPad))))
+ *(*uint8)(unsafe.Pointer(bufpt + uintptr(i))) = *(*uint8)(unsafe.Pointer(bufpt + uintptr(i-nPad)))
goto __174
__174:
i--
@@ -16843,7 +17205,7 @@ __174:
goto __175
__175:
;
- i = (libc.Bool32(int32(prefix) != 0))
+ i = libc.Bool32(int32(prefix) != 0)
__176:
if !(libc.PostDecInt32(&nPad, 1) != 0) {
goto __177
@@ -16857,7 +17219,7 @@ __172:
;
goto __58
__66:
- if !(!(bArgList != 0)) {
+ if !!(bArgList != 0) {
goto __178
}
*(*int32)(unsafe.Pointer(libc.VaUintptr(&ap))) = int32((*Sqlite3_str)(unsafe.Pointer(pAccum)).FnChar)
@@ -16880,11 +17242,11 @@ __68:
goto __181
}
*(*uint8)(unsafe.Pointer(bp + 8 /* &buf[0] */)) = uint8(libc.AssignInt32(&c, int32(*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&bufpt, 1))))))
- if !((c & 0xc0) == 0xc0) {
+ if !(c&0xc0 == 0xc0) {
goto __183
}
__184:
- if !((length < 4) && ((int32(*(*uint8)(unsafe.Pointer(bufpt))) & 0xc0) == 0x80)) {
+ if !(length < 4 && int32(*(*uint8)(unsafe.Pointer(bufpt)))&0xc0 == 0x80) {
goto __185
}
*(*uint8)(unsafe.Pointer(bp + 8 /* &buf[0] */ + uintptr(libc.PostIncInt32(&length, 1)))) = *(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&bufpt, 1)))
@@ -16904,31 +17266,31 @@ __179:
if !(ch < uint32(0x00080)) {
goto __186
}
- *(*uint8)(unsafe.Pointer(bp + 8 /* &buf[0] */)) = (uint8(ch & uint32(0xff)))
+ *(*uint8)(unsafe.Pointer(bp + 8 /* &buf[0] */)) = uint8(ch & uint32(0xff))
length = 1
goto __187
__186:
if !(ch < uint32(0x00800)) {
goto __188
}
- *(*uint8)(unsafe.Pointer(bp + 8 /* &buf[0] */)) = (uint8(0xc0 + int32((U8((ch >> 6) & uint32(0x1f))))))
- *(*uint8)(unsafe.Pointer(bp + 8 /* &buf[0] */ + 1)) = (uint8(0x80 + int32((U8(ch & uint32(0x3f))))))
+ *(*uint8)(unsafe.Pointer(bp + 8 /* &buf[0] */)) = uint8(0xc0 + int32(U8(ch>>6&uint32(0x1f))))
+ *(*uint8)(unsafe.Pointer(bp + 8 /* &buf[0] */ + 1)) = uint8(0x80 + int32(U8(ch&uint32(0x3f))))
length = 2
goto __189
__188:
if !(ch < uint32(0x10000)) {
goto __190
}
- *(*uint8)(unsafe.Pointer(bp + 8 /* &buf[0] */)) = (uint8(0xe0 + int32((U8((ch >> 12) & uint32(0x0f))))))
- *(*uint8)(unsafe.Pointer(bp + 8 /* &buf[0] */ + 1)) = (uint8(0x80 + int32((U8((ch >> 6) & uint32(0x3f))))))
- *(*uint8)(unsafe.Pointer(bp + 8 /* &buf[0] */ + 2)) = (uint8(0x80 + int32((U8(ch & uint32(0x3f))))))
+ *(*uint8)(unsafe.Pointer(bp + 8 /* &buf[0] */)) = uint8(0xe0 + int32(U8(ch>>12&uint32(0x0f))))
+ *(*uint8)(unsafe.Pointer(bp + 8 /* &buf[0] */ + 1)) = uint8(0x80 + int32(U8(ch>>6&uint32(0x3f))))
+ *(*uint8)(unsafe.Pointer(bp + 8 /* &buf[0] */ + 2)) = uint8(0x80 + int32(U8(ch&uint32(0x3f))))
length = 3
goto __191
__190:
- *(*uint8)(unsafe.Pointer(bp + 8 /* &buf[0] */)) = (uint8(0xf0 + int32((U8((ch >> 18) & uint32(0x07))))))
- *(*uint8)(unsafe.Pointer(bp + 8 /* &buf[0] */ + 1)) = (uint8(0x80 + int32((U8((ch >> 12) & uint32(0x3f))))))
- *(*uint8)(unsafe.Pointer(bp + 8 /* &buf[0] */ + 2)) = (uint8(0x80 + int32((U8((ch >> 6) & uint32(0x3f))))))
- *(*uint8)(unsafe.Pointer(bp + 8 /* &buf[0] */ + 3)) = (uint8(0x80 + int32((U8(ch & uint32(0x3f))))))
+ *(*uint8)(unsafe.Pointer(bp + 8 /* &buf[0] */)) = uint8(0xf0 + int32(U8(ch>>18&uint32(0x07))))
+ *(*uint8)(unsafe.Pointer(bp + 8 /* &buf[0] */ + 1)) = uint8(0x80 + int32(U8(ch>>12&uint32(0x3f))))
+ *(*uint8)(unsafe.Pointer(bp + 8 /* &buf[0] */ + 2)) = uint8(0x80 + int32(U8(ch>>6&uint32(0x3f))))
+ *(*uint8)(unsafe.Pointer(bp + 8 /* &buf[0] */ + 3)) = uint8(0x80 + int32(U8(ch&uint32(0x3f))))
length = 4
__191:
;
@@ -16942,10 +17304,10 @@ __180:
goto __192
}
width = width - (precision - 1)
- if !((width > 1) && !(flag_leftjustify != 0)) {
+ if !(width > 1 && !(flag_leftjustify != 0)) {
goto __193
}
- Xsqlite3_str_appendchar(tls, pAccum, (width - 1), uint8(' '))
+ Xsqlite3_str_appendchar(tls, pAccum, width-1, uint8(' '))
width = 0
__193:
;
@@ -16977,17 +17339,17 @@ __197:
if !(bufpt == uintptr(0)) {
goto __198
}
- bufpt = ts + 755 /* "" */
+ bufpt = ts + 1543 /* "" */
goto __199
__198:
if !(int32(xtype) == EtDYNSTRING) {
goto __200
}
- if !((((((*Sqlite3_str)(unsafe.Pointer(pAccum)).FnChar == U32(0)) &&
- ((*Sqlite3_str)(unsafe.Pointer(pAccum)).FmxAlloc != 0)) &&
- (width == 0)) &&
- (precision < 0)) &&
- (int32((*Sqlite3_str)(unsafe.Pointer(pAccum)).FaccError) == 0)) {
+ if !((*Sqlite3_str)(unsafe.Pointer(pAccum)).FnChar == U32(0) &&
+ (*Sqlite3_str)(unsafe.Pointer(pAccum)).FmxAlloc != 0 &&
+ width == 0 &&
+ precision < 0 &&
+ int32((*Sqlite3_str)(unsafe.Pointer(pAccum)).FaccError) == 0) {
goto __201
}
// Special optimization for sqlite3_mprintf("%z..."):
@@ -16996,8 +17358,8 @@ __198:
(*Sqlite3_str)(unsafe.Pointer(pAccum)).FzText = bufpt
(*Sqlite3_str)(unsafe.Pointer(pAccum)).FnAlloc = U32(Xsqlite3DbMallocSize(tls, (*Sqlite3_str)(unsafe.Pointer(pAccum)).Fdb, bufpt))
- (*Sqlite3_str)(unsafe.Pointer(pAccum)).FnChar = (U32(0x7fffffff & int32(libc.Xstrlen(tls, bufpt))))
- *(*U8)(unsafe.Pointer(pAccum + 21 /* &.printfFlags */)) |= U8((SQLITE_PRINTF_MALLOCED))
+ (*Sqlite3_str)(unsafe.Pointer(pAccum)).FnChar = U32(0x7fffffff & int32(libc.Xstrlen(tls, bufpt)))
+ *(*U8)(unsafe.Pointer(pAccum + 21)) |= U8(SQLITE_PRINTF_MALLOCED)
length = 0
goto __58
__201:
@@ -17017,14 +17379,14 @@ __199:
// precision characters
z = bufpt
__206:
- if !((libc.PostDecInt32(&precision, 1) > 0) && (*(*uint8)(unsafe.Pointer(z)) != 0)) {
+ if !(libc.PostDecInt32(&precision, 1) > 0 && *(*uint8)(unsafe.Pointer(z)) != 0) {
goto __207
}
- if !((int32(*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&z, 1))))) >= 0xc0) {
+ if !(int32(*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&z, 1)))) >= 0xc0) {
goto __208
}
__209:
- if !((int32(*(*uint8)(unsafe.Pointer(z))) & 0xc0) == 0x80) {
+ if !(int32(*(*uint8)(unsafe.Pointer(z)))&0xc0 == 0x80) {
goto __210
}
z++
@@ -17037,12 +17399,12 @@ __208:
goto __206
__207:
;
- length = ((int32(z) - int32(bufpt)) / 1)
+ length = (int32(z) - int32(bufpt)) / 1
goto __205
__204:
length = 0
__211:
- if !((length < precision) && (*(*uint8)(unsafe.Pointer(bufpt + uintptr(length))) != 0)) {
+ if !(length < precision && *(*uint8)(unsafe.Pointer(bufpt + uintptr(length))) != 0) {
goto __213
}
goto __212
@@ -17056,20 +17418,20 @@ __205:
;
goto __203
__202:
- length = (0x7fffffff & int32(libc.Xstrlen(tls, bufpt)))
+ length = 0x7fffffff & int32(libc.Xstrlen(tls, bufpt))
__203:
;
adjust_width_for_utf8:
- if !((flag_altform2 != 0) && (width > 0)) {
+ if !(flag_altform2 != 0 && width > 0) {
goto __214
}
// Adjust width to account for extra bytes in UTF-8 characters
- ii = (length - 1)
+ ii = length - 1
__215:
if !(ii >= 0) {
goto __216
}
- if !((int32(*(*uint8)(unsafe.Pointer(bufpt + uintptr(libc.PostDecInt32(&ii, 1))))) & 0xc0) == 0x80) {
+ if !(int32(*(*uint8)(unsafe.Pointer(bufpt + uintptr(libc.PostDecInt32(&ii, 1)))))&0xc0 == 0x80) {
goto __217
}
width++
@@ -17100,15 +17462,15 @@ __218:
escarg = libc.VaUintptr(&ap)
__219:
;
- isnull = (libc.Bool32(escarg == uintptr(0)))
+ isnull = libc.Bool32(escarg == uintptr(0))
if !(isnull != 0) {
goto __220
}
escarg = func() uintptr {
if int32(xtype) == EtSQLESCAPE2 {
- return ts + 756 /* "NULL" */
+ return ts + 1544
}
- return ts + 761 /* "(NULL)" */
+ return ts + 1549
}()
__220:
;
@@ -17119,7 +17481,7 @@ __220:
k = precision
i1 = libc.AssignInt32(&n1, 0)
__221:
- if !((k != 0) && ((int32(libc.AssignUint8(&ch1, *(*uint8)(unsafe.Pointer(escarg + uintptr(i1)))))) != 0)) {
+ if !(k != 0 && int32(libc.AssignUint8(&ch1, *(*uint8)(unsafe.Pointer(escarg + uintptr(i1))))) != 0) {
goto __223
}
if !(int32(ch1) == int32(q)) {
@@ -17128,11 +17490,11 @@ __221:
n1++
__224:
;
- if !((flag_altform2 != 0) && ((int32(ch1) & 0xc0) == 0xc0)) {
+ if !(flag_altform2 != 0 && int32(ch1)&0xc0 == 0xc0) {
goto __225
}
__226:
- if !((int32(*(*uint8)(unsafe.Pointer(escarg + uintptr((i1 + 1))))) & 0xc0) == 0x80) {
+ if !(int32(*(*uint8)(unsafe.Pointer(escarg + uintptr(i1+1))))&0xc0 == 0x80) {
goto __227
}
i1++
@@ -17149,7 +17511,7 @@ __222:
goto __223
__223:
;
- needQuote = (libc.Bool32(!(isnull != 0) && (int32(xtype) == EtSQLESCAPE2)))
+ needQuote = libc.Bool32(!(isnull != 0) && int32(xtype) == EtSQLESCAPE2)
n1 = n1 + (i1 + 3)
if !(n1 > SQLITE_PRINT_BUF_SIZE) {
goto __228
@@ -17204,7 +17566,7 @@ __236:
goto adjust_width_for_utf8
__74:
- if !((int32((*Sqlite3_str)(unsafe.Pointer(pAccum)).FprintfFlags) & SQLITE_PRINTF_INTERNAL) == 0) {
+ if !(int32((*Sqlite3_str)(unsafe.Pointer(pAccum)).FprintfFlags)&SQLITE_PRINTF_INTERNAL == 0) {
goto __237
}
return
@@ -17212,7 +17574,7 @@ __237:
;
pToken = libc.VaUintptr(&ap)
- if !((pToken != 0) && ((*Token)(unsafe.Pointer(pToken)).Fn != 0)) {
+ if !(pToken != 0 && (*Token)(unsafe.Pointer(pToken)).Fn != 0) {
goto __238
}
Xsqlite3_str_append(tls, pAccum, (*Token)(unsafe.Pointer(pToken)).Fz, int32((*Token)(unsafe.Pointer(pToken)).Fn))
@@ -17222,7 +17584,7 @@ __238:
goto __58
__75:
- if !((int32((*Sqlite3_str)(unsafe.Pointer(pAccum)).FprintfFlags) & SQLITE_PRINTF_INTERNAL) == 0) {
+ if !(int32((*Sqlite3_str)(unsafe.Pointer(pAccum)).FprintfFlags)&SQLITE_PRINTF_INTERNAL == 0) {
goto __239
}
return
@@ -17230,7 +17592,7 @@ __239:
;
pItem = libc.VaUintptr(&ap)
- if !(((*SrcItem)(unsafe.Pointer(pItem)).FzAlias != 0) && !(flag_altform2 != 0)) {
+ if !((*SrcItem)(unsafe.Pointer(pItem)).FzAlias != 0 && !(flag_altform2 != 0)) {
goto __240
}
Xsqlite3_str_appendall(tls, pAccum, (*SrcItem)(unsafe.Pointer(pItem)).FzAlias)
@@ -17243,7 +17605,7 @@ __240:
goto __244
}
Xsqlite3_str_appendall(tls, pAccum, (*SrcItem)(unsafe.Pointer(pItem)).FzDatabase)
- Xsqlite3_str_append(tls, pAccum, ts+768 /* "." */, 1)
+ Xsqlite3_str_append(tls, pAccum, ts+1556 /* "." */, 1)
__244:
;
Xsqlite3_str_appendall(tls, pAccum, (*SrcItem)(unsafe.Pointer(pItem)).FzName)
@@ -17258,7 +17620,7 @@ __245:
if !((*SrcItem)(unsafe.Pointer(pItem)).FpSelect != 0) {
goto __247
}
- Xsqlite3_str_appendf(tls, pAccum, ts+770 /* "SUBQUERY %u" */, libc.VaList(bp, (*Select)(unsafe.Pointer((*SrcItem)(unsafe.Pointer(pItem)).FpSelect)).FselId))
+ Xsqlite3_str_appendf(tls, pAccum, ts+1558 /* "SUBQUERY %u" */, libc.VaList(bp, (*Select)(unsafe.Pointer((*SrcItem)(unsafe.Pointer(pItem)).FpSelect)).FselId))
__247:
;
__246:
@@ -17282,11 +17644,11 @@ __58:
// at this point. If the "!" flag was present on string conversions
// indicating that width and precision should be expressed in characters,
// then the values have been translated prior to reaching this point.
- width = width - (length)
+ width = width - length
if !(width > 0) {
goto __248
}
- if !(!(flag_leftjustify != 0)) {
+ if !!(flag_leftjustify != 0) {
goto __250
}
Xsqlite3_str_appendchar(tls, pAccum, width, uint8(' '))
@@ -17321,7 +17683,7 @@ __5:
// End for loop over the format string
}
-var zOrd = *(*[9]uint8)(unsafe.Pointer(ts + 782 /* "thstndrd" */)) /* sqlite3.c:29091:29 */
+var zOrd = *(*[9]uint8)(unsafe.Pointer(ts + 1570 /* "thstndrd" */)) /* sqlite3.c:29385:29 */
// End of function
@@ -17330,7 +17692,7 @@ var zOrd = *(*[9]uint8)(unsafe.Pointer(ts + 782 /* "thstndrd" */)) /* sqlite3.c:
//
// Return the number of bytes of text that StrAccum is able to accept
// after the attempted enlargement. The value returned might be zero.
-func sqlite3StrAccumEnlarge(tls *libc.TLS, p uintptr, N int32) int32 { /* sqlite3.c:29534:12: */
+func sqlite3StrAccumEnlarge(tls *libc.TLS, p uintptr, N int32) int32 { /* sqlite3.c:29828:12: */
var zNew uintptr
// Only called if really needed
if (*StrAccum)(unsafe.Pointer(p)).FaccError != 0 {
@@ -17338,25 +17700,25 @@ func sqlite3StrAccumEnlarge(tls *libc.TLS, p uintptr, N int32) int32 { /* sqlite
return 0
}
if (*StrAccum)(unsafe.Pointer(p)).FmxAlloc == U32(0) {
- setStrAccumError(tls, p, uint8(SQLITE_TOOBIG))
- return (int32(((*StrAccum)(unsafe.Pointer(p)).FnAlloc - (*StrAccum)(unsafe.Pointer(p)).FnChar) - U32(1)))
+ Xsqlite3StrAccumSetError(tls, p, uint8(SQLITE_TOOBIG))
+ return int32((*StrAccum)(unsafe.Pointer(p)).FnAlloc - (*StrAccum)(unsafe.Pointer(p)).FnChar - U32(1))
} else {
var zOld uintptr
- if (int32((*StrAccum)(unsafe.Pointer((p))).FprintfFlags) & SQLITE_PRINTF_MALLOCED) != 0 {
+ if int32((*StrAccum)(unsafe.Pointer(p)).FprintfFlags)&SQLITE_PRINTF_MALLOCED != 0 {
zOld = (*StrAccum)(unsafe.Pointer(p)).FzText
} else {
zOld = uintptr(0)
}
var szNew I64 = I64((*StrAccum)(unsafe.Pointer(p)).FnChar)
szNew = szNew + (Sqlite3_int64(N) + int64(1))
- if (szNew + I64((*StrAccum)(unsafe.Pointer(p)).FnChar)) <= I64((*StrAccum)(unsafe.Pointer(p)).FmxAlloc) {
+ if szNew+I64((*StrAccum)(unsafe.Pointer(p)).FnChar) <= I64((*StrAccum)(unsafe.Pointer(p)).FmxAlloc) {
// Force exponential buffer size growth as long as it does not overflow,
// to avoid having to call this routine too often
- szNew = szNew + (I64((*StrAccum)(unsafe.Pointer(p)).FnChar))
+ szNew = szNew + I64((*StrAccum)(unsafe.Pointer(p)).FnChar)
}
if szNew > I64((*StrAccum)(unsafe.Pointer(p)).FmxAlloc) {
Xsqlite3_str_reset(tls, p)
- setStrAccumError(tls, p, uint8(SQLITE_TOOBIG))
+ Xsqlite3StrAccumSetError(tls, p, uint8(SQLITE_TOOBIG))
return 0
} else {
(*StrAccum)(unsafe.Pointer(p)).FnAlloc = U32(int32(szNew))
@@ -17368,15 +17730,15 @@ func sqlite3StrAccumEnlarge(tls *libc.TLS, p uintptr, N int32) int32 { /* sqlite
}
if zNew != 0 {
- if !((int32((*StrAccum)(unsafe.Pointer((p))).FprintfFlags) & SQLITE_PRINTF_MALLOCED) != 0) && ((*StrAccum)(unsafe.Pointer(p)).FnChar > U32(0)) {
+ if !(int32((*StrAccum)(unsafe.Pointer(p)).FprintfFlags)&SQLITE_PRINTF_MALLOCED != 0) && (*StrAccum)(unsafe.Pointer(p)).FnChar > U32(0) {
libc.Xmemcpy(tls, zNew, (*StrAccum)(unsafe.Pointer(p)).FzText, (*StrAccum)(unsafe.Pointer(p)).FnChar)
}
(*StrAccum)(unsafe.Pointer(p)).FzText = zNew
(*StrAccum)(unsafe.Pointer(p)).FnAlloc = U32(Xsqlite3DbMallocSize(tls, (*StrAccum)(unsafe.Pointer(p)).Fdb, zNew))
- *(*U8)(unsafe.Pointer(p + 21 /* &.printfFlags */)) |= U8((SQLITE_PRINTF_MALLOCED))
+ *(*U8)(unsafe.Pointer(p + 21)) |= U8(SQLITE_PRINTF_MALLOCED)
} else {
Xsqlite3_str_reset(tls, p)
- setStrAccumError(tls, p, uint8(SQLITE_NOMEM))
+ Xsqlite3StrAccumSetError(tls, p, uint8(SQLITE_NOMEM))
return 0
}
}
@@ -17384,12 +17746,12 @@ func sqlite3StrAccumEnlarge(tls *libc.TLS, p uintptr, N int32) int32 { /* sqlite
}
// Append N copies of character c to the given string buffer.
-func Xsqlite3_str_appendchar(tls *libc.TLS, p uintptr, N int32, c uint8) { /* sqlite3.c:29584:17: */
+func Xsqlite3_str_appendchar(tls *libc.TLS, p uintptr, N int32, c uint8) { /* sqlite3.c:29878:17: */
- if ((I64((*Sqlite3_str)(unsafe.Pointer(p)).FnChar) + I64(N)) >= I64((*Sqlite3_str)(unsafe.Pointer(p)).FnAlloc)) && ((libc.AssignInt32(&N, sqlite3StrAccumEnlarge(tls, p, N))) <= 0) {
+ if I64((*Sqlite3_str)(unsafe.Pointer(p)).FnChar)+I64(N) >= I64((*Sqlite3_str)(unsafe.Pointer(p)).FnAlloc) && libc.AssignInt32(&N, sqlite3StrAccumEnlarge(tls, p, N)) <= 0 {
return
}
- for (libc.PostDecInt32(&N, 1)) > 0 {
+ for libc.PostDecInt32(&N, 1) > 0 {
*(*uint8)(unsafe.Pointer((*Sqlite3_str)(unsafe.Pointer(p)).FzText + uintptr(libc.PostIncUint32(&(*Sqlite3_str)(unsafe.Pointer(p)).FnChar, 1)))) = c
}
}
@@ -17400,69 +17762,83 @@ func Xsqlite3_str_appendchar(tls *libc.TLS, p uintptr, N int32, c uint8) { /* sq
// This is a helper routine to sqlite3_str_append() that does special-case
// work (enlarging the buffer) using tail recursion, so that the
// sqlite3_str_append() routine can use fast calling semantics.
-func enlargeAndAppend(tls *libc.TLS, p uintptr, z uintptr, N int32) { /* sqlite3.c:29600:29: */
+func enlargeAndAppend(tls *libc.TLS, p uintptr, z uintptr, N int32) { /* sqlite3.c:29894:29: */
N = sqlite3StrAccumEnlarge(tls, p, N)
if N > 0 {
- libc.Xmemcpy(tls, ((*StrAccum)(unsafe.Pointer(p)).FzText + uintptr((*StrAccum)(unsafe.Pointer(p)).FnChar)), z, uint32(N))
- *(*U32)(unsafe.Pointer(p + 16 /* &.nChar */)) += (U32(N))
+ libc.Xmemcpy(tls, (*StrAccum)(unsafe.Pointer(p)).FzText+uintptr((*StrAccum)(unsafe.Pointer(p)).FnChar), z, uint32(N))
+ *(*U32)(unsafe.Pointer(p + 16)) += U32(N)
}
}
// Append N bytes of text from z to the StrAccum object. Increase the
// size of the memory allocation for StrAccum if necessary.
-func Xsqlite3_str_append(tls *libc.TLS, p uintptr, z uintptr, N int32) { /* sqlite3.c:29612:17: */
+func Xsqlite3_str_append(tls *libc.TLS, p uintptr, z uintptr, N int32) { /* sqlite3.c:29906:17: */
- if ((*Sqlite3_str)(unsafe.Pointer(p)).FnChar + U32(N)) >= (*Sqlite3_str)(unsafe.Pointer(p)).FnAlloc {
+ if (*Sqlite3_str)(unsafe.Pointer(p)).FnChar+U32(N) >= (*Sqlite3_str)(unsafe.Pointer(p)).FnAlloc {
enlargeAndAppend(tls, p, z, N)
} else if N != 0 {
- *(*U32)(unsafe.Pointer(p + 16 /* &.nChar */)) += (U32(N))
- libc.Xmemcpy(tls, ((*Sqlite3_str)(unsafe.Pointer(p)).FzText + uintptr(((*Sqlite3_str)(unsafe.Pointer(p)).FnChar - U32(N)))), z, uint32(N))
+ *(*U32)(unsafe.Pointer(p + 16)) += U32(N)
+ libc.Xmemcpy(tls, (*Sqlite3_str)(unsafe.Pointer(p)).FzText+uintptr((*Sqlite3_str)(unsafe.Pointer(p)).FnChar-U32(N)), z, uint32(N))
}
}
// Append the complete text of zero-terminated string z[] to the p string.
-func Xsqlite3_str_appendall(tls *libc.TLS, p uintptr, z uintptr) { /* sqlite3.c:29629:17: */
+func Xsqlite3_str_appendall(tls *libc.TLS, p uintptr, z uintptr) { /* sqlite3.c:29923:17: */
Xsqlite3_str_append(tls, p, z, Xsqlite3Strlen30(tls, z))
}
// Finish off a string by making sure it is zero-terminated.
// Return a pointer to the resulting string. Return a NULL
// pointer if any kind of error was encountered.
-func strAccumFinishRealloc(tls *libc.TLS, p uintptr) uintptr { /* sqlite3.c:29639:29: */
+func strAccumFinishRealloc(tls *libc.TLS, p uintptr) uintptr { /* sqlite3.c:29933:29: */
var zText uintptr
- zText = Xsqlite3DbMallocRaw(tls, (*StrAccum)(unsafe.Pointer(p)).Fdb, (uint64((*StrAccum)(unsafe.Pointer(p)).FnChar + U32(1))))
+ zText = Xsqlite3DbMallocRaw(tls, (*StrAccum)(unsafe.Pointer(p)).Fdb, uint64((*StrAccum)(unsafe.Pointer(p)).FnChar+U32(1)))
if zText != 0 {
- libc.Xmemcpy(tls, zText, (*StrAccum)(unsafe.Pointer(p)).FzText, ((*StrAccum)(unsafe.Pointer(p)).FnChar + U32(1)))
- *(*U8)(unsafe.Pointer(p + 21 /* &.printfFlags */)) |= U8((SQLITE_PRINTF_MALLOCED))
+ libc.Xmemcpy(tls, zText, (*StrAccum)(unsafe.Pointer(p)).FzText, (*StrAccum)(unsafe.Pointer(p)).FnChar+U32(1))
+ *(*U8)(unsafe.Pointer(p + 21)) |= U8(SQLITE_PRINTF_MALLOCED)
} else {
- setStrAccumError(tls, p, uint8(SQLITE_NOMEM))
+ Xsqlite3StrAccumSetError(tls, p, uint8(SQLITE_NOMEM))
}
(*StrAccum)(unsafe.Pointer(p)).FzText = zText
return zText
}
-func Xsqlite3StrAccumFinish(tls *libc.TLS, p uintptr) uintptr { /* sqlite3.c:29652:21: */
+func Xsqlite3StrAccumFinish(tls *libc.TLS, p uintptr) uintptr { /* sqlite3.c:29946:21: */
if (*StrAccum)(unsafe.Pointer(p)).FzText != 0 {
*(*uint8)(unsafe.Pointer((*StrAccum)(unsafe.Pointer(p)).FzText + uintptr((*StrAccum)(unsafe.Pointer(p)).FnChar))) = uint8(0)
- if ((*StrAccum)(unsafe.Pointer(p)).FmxAlloc > U32(0)) && !((int32((*StrAccum)(unsafe.Pointer((p))).FprintfFlags) & SQLITE_PRINTF_MALLOCED) != 0) {
+ if (*StrAccum)(unsafe.Pointer(p)).FmxAlloc > U32(0) && !(int32((*StrAccum)(unsafe.Pointer(p)).FprintfFlags)&SQLITE_PRINTF_MALLOCED != 0) {
return strAccumFinishRealloc(tls, p)
}
}
return (*StrAccum)(unsafe.Pointer(p)).FzText
}
+// Use the content of the StrAccum passed as the second argument
+// as the result of an SQL function.
+func Xsqlite3ResultStrAccum(tls *libc.TLS, pCtx uintptr, p uintptr) { /* sqlite3.c:29960:21: */
+ if (*StrAccum)(unsafe.Pointer(p)).FaccError != 0 {
+ Xsqlite3_result_error_code(tls, pCtx, int32((*StrAccum)(unsafe.Pointer(p)).FaccError))
+ Xsqlite3_str_reset(tls, p)
+ } else if int32((*StrAccum)(unsafe.Pointer(p)).FprintfFlags)&SQLITE_PRINTF_MALLOCED != 0 {
+ Xsqlite3_result_text(tls, pCtx, (*StrAccum)(unsafe.Pointer(p)).FzText, int32((*StrAccum)(unsafe.Pointer(p)).FnChar), *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{Xsqlite3OomFault})))
+ } else {
+ Xsqlite3_result_text(tls, pCtx, ts+1543 /* "" */, 0, uintptr(0))
+ Xsqlite3_str_reset(tls, p)
+ }
+}
+
// This singleton is an sqlite3_str object that is returned if
// sqlite3_malloc() fails to provide space for a real one. This
// sqlite3_str object accepts no new text and always returns
// an SQLITE_NOMEM error.
-var sqlite3OomStr = Sqlite3_str{FaccError: U8(SQLITE_NOMEM)} /* sqlite3.c:29668:20 */
+var sqlite3OomStr = Sqlite3_str{FaccError: U8(SQLITE_NOMEM)} /* sqlite3.c:29978:20 */
// Finalize a string created using sqlite3_str_new().
-func Xsqlite3_str_finish(tls *libc.TLS, p uintptr) uintptr { /* sqlite3.c:29674:17: */
+func Xsqlite3_str_finish(tls *libc.TLS, p uintptr) uintptr { /* sqlite3.c:29984:17: */
var z uintptr
- if (p != uintptr(0)) && (p != uintptr(unsafe.Pointer(&sqlite3OomStr))) {
+ if p != uintptr(0) && p != uintptr(unsafe.Pointer(&sqlite3OomStr)) {
z = Xsqlite3StrAccumFinish(tls, p)
Xsqlite3_free(tls, p)
} else {
@@ -17472,7 +17848,7 @@ func Xsqlite3_str_finish(tls *libc.TLS, p uintptr) uintptr { /* sqlite3.c:29674:
}
// Return any error code associated with p
-func Xsqlite3_str_errcode(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:29686:16: */
+func Xsqlite3_str_errcode(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:29996:16: */
if p != 0 {
return int32((*Sqlite3_str)(unsafe.Pointer(p)).FaccError)
}
@@ -17480,7 +17856,7 @@ func Xsqlite3_str_errcode(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:29686:1
}
// Return the current length of p in bytes
-func Xsqlite3_str_length(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:29691:16: */
+func Xsqlite3_str_length(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:30001:16: */
if p != 0 {
return int32((*Sqlite3_str)(unsafe.Pointer(p)).FnChar)
}
@@ -17488,8 +17864,8 @@ func Xsqlite3_str_length(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:29691:16
}
// Return the current value for p
-func Xsqlite3_str_value(tls *libc.TLS, p uintptr) uintptr { /* sqlite3.c:29696:17: */
- if (p == uintptr(0)) || ((*Sqlite3_str)(unsafe.Pointer(p)).FnChar == U32(0)) {
+func Xsqlite3_str_value(tls *libc.TLS, p uintptr) uintptr { /* sqlite3.c:30006:17: */
+ if p == uintptr(0) || (*Sqlite3_str)(unsafe.Pointer(p)).FnChar == U32(0) {
return uintptr(0)
}
*(*uint8)(unsafe.Pointer((*Sqlite3_str)(unsafe.Pointer(p)).FzText + uintptr((*Sqlite3_str)(unsafe.Pointer(p)).FnChar))) = uint8(0)
@@ -17497,10 +17873,10 @@ func Xsqlite3_str_value(tls *libc.TLS, p uintptr) uintptr { /* sqlite3.c:29696:1
}
// Reset an StrAccum string. Reclaim all malloced memory.
-func Xsqlite3_str_reset(tls *libc.TLS, p uintptr) { /* sqlite3.c:29705:17: */
- if (int32((*StrAccum)(unsafe.Pointer((p))).FprintfFlags) & SQLITE_PRINTF_MALLOCED) != 0 {
+func Xsqlite3_str_reset(tls *libc.TLS, p uintptr) { /* sqlite3.c:30015:17: */
+ if int32((*StrAccum)(unsafe.Pointer(p)).FprintfFlags)&SQLITE_PRINTF_MALLOCED != 0 {
Xsqlite3DbFree(tls, (*StrAccum)(unsafe.Pointer(p)).Fdb, (*StrAccum)(unsafe.Pointer(p)).FzText)
- *(*U8)(unsafe.Pointer(p + 21 /* &.printfFlags */)) &= libc.Uint8FromInt32((libc.CplInt32(SQLITE_PRINTF_MALLOCED)))
+ *(*U8)(unsafe.Pointer(p + 21)) &= libc.Uint8FromInt32(libc.CplInt32(SQLITE_PRINTF_MALLOCED))
}
(*StrAccum)(unsafe.Pointer(p)).FnAlloc = U32(0)
(*StrAccum)(unsafe.Pointer(p)).FnChar = U32(0)
@@ -17519,7 +17895,7 @@ func Xsqlite3_str_reset(tls *libc.TLS, p uintptr) { /* sqlite3.c:29705:17: */
// n then no memory allocations ever occur.
// mx: Maximum number of bytes to accumulate. If mx==0 then no memory
// allocations will ever occur.
-func Xsqlite3StrAccumInit(tls *libc.TLS, p uintptr, db uintptr, zBase uintptr, n int32, mx int32) { /* sqlite3.c:29729:21: */
+func Xsqlite3StrAccumInit(tls *libc.TLS, p uintptr, db uintptr, zBase uintptr, n int32, mx int32) { /* sqlite3.c:30039:21: */
(*StrAccum)(unsafe.Pointer(p)).FzText = zBase
(*StrAccum)(unsafe.Pointer(p)).Fdb = db
(*StrAccum)(unsafe.Pointer(p)).FnAlloc = U32(n)
@@ -17530,13 +17906,13 @@ func Xsqlite3StrAccumInit(tls *libc.TLS, p uintptr, db uintptr, zBase uintptr, n
}
// Allocate and initialize a new dynamic string object
-func Xsqlite3_str_new(tls *libc.TLS, db uintptr) uintptr { /* sqlite3.c:29740:24: */
+func Xsqlite3_str_new(tls *libc.TLS, db uintptr) uintptr { /* sqlite3.c:30050:24: */
var p uintptr = Xsqlite3_malloc64(tls, uint64(unsafe.Sizeof(Sqlite3_str{})))
if p != 0 {
Xsqlite3StrAccumInit(tls, p, uintptr(0), uintptr(0), 0,
func() int32 {
if db != 0 {
- return *(*int32)(unsafe.Pointer((db + 112 /* &.aLimit */)))
+ return *(*int32)(unsafe.Pointer(db + 120))
}
return SQLITE_MAX_LENGTH
}())
@@ -17548,7 +17924,7 @@ func Xsqlite3_str_new(tls *libc.TLS, db uintptr) uintptr { /* sqlite3.c:29740:24
// Print into memory obtained from sqliteMalloc(). Use the internal
// %-conversion extensions.
-func Xsqlite3VMPrintf(tls *libc.TLS, db uintptr, zFormat uintptr, ap Va_list) uintptr { /* sqlite3.c:29755:21: */
+func Xsqlite3VMPrintf(tls *libc.TLS, db uintptr, zFormat uintptr, ap Va_list) uintptr { /* sqlite3.c:30065:21: */
bp := tls.Alloc(94)
defer tls.Free(94)
@@ -17558,11 +17934,11 @@ func Xsqlite3VMPrintf(tls *libc.TLS, db uintptr, zFormat uintptr, ap Va_list) ui
// var acc StrAccum at bp, 24
Xsqlite3StrAccumInit(tls, bp /* &acc */, db, bp+24 /* &zBase[0] */, int32(unsafe.Sizeof([70]uint8{})),
- *(*int32)(unsafe.Pointer((db + 112 /* &.aLimit */))))
+ *(*int32)(unsafe.Pointer(db + 120)))
(*StrAccum)(unsafe.Pointer(bp /* &acc */)).FprintfFlags = U8(SQLITE_PRINTF_INTERNAL)
Xsqlite3_str_vappendf(tls, bp /* &acc */, zFormat, ap)
z = Xsqlite3StrAccumFinish(tls, bp /* &acc */)
- if int32((*StrAccum)(unsafe.Pointer(bp /* &acc */)).FaccError) == SQLITE_NOMEM {
+ if int32((*StrAccum)(unsafe.Pointer(bp)).FaccError) == SQLITE_NOMEM {
Xsqlite3OomFault(tls, db)
}
return z
@@ -17570,7 +17946,7 @@ func Xsqlite3VMPrintf(tls *libc.TLS, db uintptr, zFormat uintptr, ap Va_list) ui
// Print into memory obtained from sqliteMalloc(). Use the internal
// %-conversion extensions.
-func Xsqlite3MPrintf(tls *libc.TLS, db uintptr, zFormat uintptr, va uintptr) uintptr { /* sqlite3.c:29775:21: */
+func Xsqlite3MPrintf(tls *libc.TLS, db uintptr, zFormat uintptr, va uintptr) uintptr { /* sqlite3.c:30085:21: */
var ap Va_list
_ = ap
var z uintptr
@@ -17582,7 +17958,7 @@ func Xsqlite3MPrintf(tls *libc.TLS, db uintptr, zFormat uintptr, va uintptr) uin
// Print into memory obtained from sqlite3_malloc(). Omit the internal
// %-conversion extensions.
-func Xsqlite3_vmprintf(tls *libc.TLS, zFormat uintptr, ap Va_list) uintptr { /* sqlite3.c:29788:17: */
+func Xsqlite3_vmprintf(tls *libc.TLS, zFormat uintptr, ap Va_list) uintptr { /* sqlite3.c:30098:17: */
bp := tls.Alloc(94)
defer tls.Free(94)
@@ -17602,7 +17978,7 @@ func Xsqlite3_vmprintf(tls *libc.TLS, zFormat uintptr, ap Va_list) uintptr { /*
// Print into memory obtained from sqlite3_malloc()(). Omit the internal
// %-conversion extensions.
-func Xsqlite3_mprintf(tls *libc.TLS, zFormat uintptr, va uintptr) uintptr { /* sqlite3.c:29812:17: */
+func Xsqlite3_mprintf(tls *libc.TLS, zFormat uintptr, va uintptr) uintptr { /* sqlite3.c:30122:17: */
var ap Va_list
_ = ap
var z uintptr
@@ -17626,7 +18002,7 @@ func Xsqlite3_mprintf(tls *libc.TLS, zFormat uintptr, va uintptr) uintptr { /* s
// mistake.
//
// sqlite3_vsnprintf() is the varargs version.
-func Xsqlite3_vsnprintf(tls *libc.TLS, n int32, zBuf uintptr, zFormat uintptr, ap Va_list) uintptr { /* sqlite3.c:29837:17: */
+func Xsqlite3_vsnprintf(tls *libc.TLS, n int32, zBuf uintptr, zFormat uintptr, ap Va_list) uintptr { /* sqlite3.c:30147:17: */
bp := tls.Alloc(24)
defer tls.Free(24)
@@ -17641,7 +18017,7 @@ func Xsqlite3_vsnprintf(tls *libc.TLS, n int32, zBuf uintptr, zFormat uintptr, a
return zBuf
}
-func Xsqlite3_snprintf(tls *libc.TLS, n int32, zBuf uintptr, zFormat uintptr, va uintptr) uintptr { /* sqlite3.c:29852:17: */
+func Xsqlite3_snprintf(tls *libc.TLS, n int32, zBuf uintptr, zFormat uintptr, va uintptr) uintptr { /* sqlite3.c:30162:17: */
var z uintptr
var ap Va_list
_ = ap
@@ -17663,7 +18039,7 @@ func Xsqlite3_snprintf(tls *libc.TLS, n int32, zBuf uintptr, zFormat uintptr, va
// certain format characters (%q) or for very large precisions or widths.
// Care must be taken that any sqlite3_log() calls that occur while the
// memory mutex is held do not use these mechanisms.
-func renderLogMsg(tls *libc.TLS, iErrCode int32, zFormat uintptr, ap Va_list) { /* sqlite3.c:29875:13: */
+func renderLogMsg(tls *libc.TLS, iErrCode int32, zFormat uintptr, ap Va_list) { /* sqlite3.c:30185:13: */
bp := tls.Alloc(234)
defer tls.Free(234)
@@ -17681,7 +18057,7 @@ func renderLogMsg(tls *libc.TLS, iErrCode int32, zFormat uintptr, ap Va_list) {
}
// Format and write a message to the log if logging is enabled.
-func Xsqlite3_log(tls *libc.TLS, iErrCode int32, zFormat uintptr, va uintptr) { /* sqlite3.c:29888:17: */
+func Xsqlite3_log(tls *libc.TLS, iErrCode int32, zFormat uintptr, va uintptr) { /* sqlite3.c:30198:17: */
var ap Va_list
_ = ap // Vararg list
if Xsqlite3Config.FxLog != 0 {
@@ -17693,7 +18069,7 @@ func Xsqlite3_log(tls *libc.TLS, iErrCode int32, zFormat uintptr, va uintptr) {
// variable-argument wrapper around sqlite3_str_vappendf(). The bFlags argument
// can contain the bit SQLITE_PRINTF_INTERNAL enable internal formats.
-func Xsqlite3_str_appendf(tls *libc.TLS, p uintptr, zFormat uintptr, va uintptr) { /* sqlite3.c:29929:17: */
+func Xsqlite3_str_appendf(tls *libc.TLS, p uintptr, zFormat uintptr, va uintptr) { /* sqlite3.c:30239:17: */
var ap Va_list
_ = ap
ap = va
@@ -17748,7 +18124,7 @@ type sqlite3PrngType = struct {
Fi uint8
Fj uint8
Fs [256]uint8
-} /* sqlite3.c:30748:19 */
+} /* sqlite3.c:31091:19 */
//************* End of printf.c *********************************************
//************* Begin file treeview.c ***************************************
@@ -17792,10 +18168,10 @@ type sqlite3PrngType = struct {
// All threads share a single random number generator.
// This structure is the current state of the generator.
-var sqlite3Prng sqlite3PrngType /* sqlite3.c:30752:3: */
+var sqlite3Prng sqlite3PrngType /* sqlite3.c:31095:3: */
// Return N random bytes.
-func Xsqlite3_randomness(tls *libc.TLS, N int32, pBuf uintptr) { /* sqlite3.c:30757:17: */
+func Xsqlite3_randomness(tls *libc.TLS, N int32, pBuf uintptr) { /* sqlite3.c:31100:17: */
bp := tls.Alloc(256)
defer tls.Free(256)
@@ -17817,7 +18193,7 @@ func Xsqlite3_randomness(tls *libc.TLS, N int32, pBuf uintptr) { /* sqlite3.c:30
mutex = Xsqlite3MutexAlloc(tls, SQLITE_MUTEX_STATIC_PRNG)
Xsqlite3_mutex_enter(tls, mutex)
- if (N <= 0) || (pBuf == uintptr(0)) {
+ if N <= 0 || pBuf == uintptr(0) {
sqlite3Prng.FisInit = uint8(0)
Xsqlite3_mutex_leave(tls, mutex)
return
@@ -17844,25 +18220,25 @@ func Xsqlite3_randomness(tls *libc.TLS, N int32, pBuf uintptr) { /* sqlite3.c:30
Xsqlite3OsRandomness(tls, pVfs, 256, bp /* &k[0] */)
}
for i = 0; i < 256; i++ {
- *(*uint8)(unsafe.Pointer((uintptr(unsafe.Pointer(&sqlite3Prng)) + 3 /* &.s */) + uintptr(i))) = U8(i)
+ *(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Prng)) + 3 + uintptr(i))) = U8(i)
}
for i = 0; i < 256; i++ {
- *(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Prng)) + 2 /* &.j */)) += uint8((int32(*(*uint8)(unsafe.Pointer((uintptr(unsafe.Pointer(&sqlite3Prng)) + 3 /* &.s */) + uintptr(i)))) + int32(*(*uint8)(unsafe.Pointer(bp /* &k[0] */ + uintptr(i))))))
- t = *(*uint8)(unsafe.Pointer((uintptr(unsafe.Pointer(&sqlite3Prng)) + 3 /* &.s */) + uintptr(sqlite3Prng.Fj)))
- *(*uint8)(unsafe.Pointer((uintptr(unsafe.Pointer(&sqlite3Prng)) + 3 /* &.s */) + uintptr(sqlite3Prng.Fj))) = *(*uint8)(unsafe.Pointer((uintptr(unsafe.Pointer(&sqlite3Prng)) + 3 /* &.s */) + uintptr(i)))
- *(*uint8)(unsafe.Pointer((uintptr(unsafe.Pointer(&sqlite3Prng)) + 3 /* &.s */) + uintptr(i))) = t
+ *(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Prng)) + 2)) += uint8(int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Prng)) + 3 + uintptr(i)))) + int32(*(*uint8)(unsafe.Pointer(bp + uintptr(i)))))
+ t = *(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Prng)) + 3 + uintptr(sqlite3Prng.Fj)))
+ *(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Prng)) + 3 + uintptr(sqlite3Prng.Fj))) = *(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Prng)) + 3 + uintptr(i)))
+ *(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Prng)) + 3 + uintptr(i))) = t
}
sqlite3Prng.FisInit = uint8(1)
}
for ok := true; ok; ok = libc.PreDecInt32(&N, 1) != 0 {
sqlite3Prng.Fi++
- t = *(*uint8)(unsafe.Pointer((uintptr(unsafe.Pointer(&sqlite3Prng)) + 3 /* &.s */) + uintptr(sqlite3Prng.Fi)))
- *(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Prng)) + 2 /* &.j */)) += uint8((int32(t)))
- *(*uint8)(unsafe.Pointer((uintptr(unsafe.Pointer(&sqlite3Prng)) + 3 /* &.s */) + uintptr(sqlite3Prng.Fi))) = *(*uint8)(unsafe.Pointer((uintptr(unsafe.Pointer(&sqlite3Prng)) + 3 /* &.s */) + uintptr(sqlite3Prng.Fj)))
- *(*uint8)(unsafe.Pointer((uintptr(unsafe.Pointer(&sqlite3Prng)) + 3 /* &.s */) + uintptr(sqlite3Prng.Fj))) = t
- t = uint8(int32(t) + (int32(*(*uint8)(unsafe.Pointer((uintptr(unsafe.Pointer(&sqlite3Prng)) + 3 /* &.s */) + uintptr(sqlite3Prng.Fi))))))
- *(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&zBuf, 1))) = *(*uint8)(unsafe.Pointer((uintptr(unsafe.Pointer(&sqlite3Prng)) + 3 /* &.s */) + uintptr(t)))
+ t = *(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Prng)) + 3 + uintptr(sqlite3Prng.Fi)))
+ *(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Prng)) + 2)) += uint8(int32(t))
+ *(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Prng)) + 3 + uintptr(sqlite3Prng.Fi))) = *(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Prng)) + 3 + uintptr(sqlite3Prng.Fj)))
+ *(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Prng)) + 3 + uintptr(sqlite3Prng.Fj))) = t
+ t = uint8(int32(t) + int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Prng)) + 3 + uintptr(sqlite3Prng.Fi)))))
+ *(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&zBuf, 1))) = *(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Prng)) + 3 + uintptr(t)))
}
Xsqlite3_mutex_leave(tls, mutex)
}
@@ -17874,16 +18250,16 @@ func Xsqlite3_randomness(tls *libc.TLS, N int32, pBuf uintptr) { /* sqlite3.c:30
//
// The sqlite3_test_control() interface calls these routines to
// control the PRNG.
-var sqlite3SavedPrng sqlite3PrngType /* sqlite3.c:30848:42: */
+var sqlite3SavedPrng sqlite3PrngType /* sqlite3.c:31191:42: */
-func Xsqlite3PrngSaveState(tls *libc.TLS) { /* sqlite3.c:30849:21: */
+func Xsqlite3PrngSaveState(tls *libc.TLS) { /* sqlite3.c:31192:21: */
libc.Xmemcpy(tls,
uintptr(unsafe.Pointer(&sqlite3SavedPrng)),
uintptr(unsafe.Pointer(&sqlite3Prng)),
uint32(unsafe.Sizeof(sqlite3Prng)))
}
-func Xsqlite3PrngRestoreState(tls *libc.TLS) { /* sqlite3.c:30856:21: */
+func Xsqlite3PrngRestoreState(tls *libc.TLS) { /* sqlite3.c:31199:21: */
libc.Xmemcpy(tls,
uintptr(unsafe.Pointer(&sqlite3Prng)),
uintptr(unsafe.Pointer(&sqlite3SavedPrng)),
@@ -17891,7 +18267,7 @@ func Xsqlite3PrngRestoreState(tls *libc.TLS) { /* sqlite3.c:30856:21: */
}
// Create a new thread
-func Xsqlite3ThreadCreate(tls *libc.TLS, ppThread uintptr, xTask uintptr, pIn uintptr) int32 { /* sqlite3.c:31092:20: */
+func Xsqlite3ThreadCreate(tls *libc.TLS, ppThread uintptr, xTask uintptr, pIn uintptr) int32 { /* sqlite3.c:31435:20: */
var p uintptr
*(*uintptr)(unsafe.Pointer(ppThread)) = uintptr(0)
@@ -17899,7 +18275,7 @@ func Xsqlite3ThreadCreate(tls *libc.TLS, ppThread uintptr, xTask uintptr, pIn ui
if p == uintptr(0) {
return SQLITE_NOMEM
}
- if (((int32(p)) / 17) & 1) != 0 {
+ if int32(p)/17&1 != 0 {
(*SQLiteThread)(unsafe.Pointer(p)).FxTask = xTask
(*SQLiteThread)(unsafe.Pointer(p)).FpIn = pIn
} else {
@@ -17913,7 +18289,7 @@ func Xsqlite3ThreadCreate(tls *libc.TLS, ppThread uintptr, xTask uintptr, pIn ui
}
// Get the results of the thread
-func Xsqlite3ThreadJoin(tls *libc.TLS, p uintptr, ppOut uintptr) int32 { /* sqlite3.c:31116:20: */
+func Xsqlite3ThreadJoin(tls *libc.TLS, p uintptr, ppOut uintptr) int32 { /* sqlite3.c:31459:20: */
if p == uintptr(0) {
return SQLITE_NOMEM
@@ -17982,7 +18358,7 @@ var sqlite3Utf8Trans1 = [64]uint8{
uint8(0x08), uint8(0x09), uint8(0x0a), uint8(0x0b), uint8(0x0c), uint8(0x0d), uint8(0x0e), uint8(0x0f),
uint8(0x00), uint8(0x01), uint8(0x02), uint8(0x03), uint8(0x04), uint8(0x05), uint8(0x06), uint8(0x07),
uint8(0x00), uint8(0x01), uint8(0x02), uint8(0x03), uint8(0x00), uint8(0x01), uint8(0x00), uint8(0x00),
-} /* sqlite3.c:31195:28 */
+} /* sqlite3.c:31538:28 */
// Translate a single UTF-8 character. Return the unicode value.
//
@@ -18009,20 +18385,20 @@ var sqlite3Utf8Trans1 = [64]uint8{
// * This routine accepts over-length UTF8 encodings
// for unicode values 0x80 and greater. It does not change over-length
// encodings to 0xfffd as some systems recommend.
-func Xsqlite3Utf8Read(tls *libc.TLS, pz uintptr) U32 { /* sqlite3.c:31289:20: */
+func Xsqlite3Utf8Read(tls *libc.TLS, pz uintptr) U32 { /* sqlite3.c:31632:20: */
var c uint32
// Same as READ_UTF8() above but without the zTerm parameter.
// For this routine, we assume the UTF8 string is always zero-terminated.
- c = uint32(*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*(*uintptr)(unsafe.Pointer(pz))), 1))))
+ c = uint32(*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&*(*uintptr)(unsafe.Pointer(pz)), 1))))
if c >= uint32(0xc0) {
- c = uint32(sqlite3Utf8Trans1[(c - uint32(0xc0))])
- for (int32(*(*uint8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pz))))) & 0xc0) == 0x80 {
- c = ((c << 6) + (uint32(0x3f & int32(*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*(*uintptr)(unsafe.Pointer(pz))), 1)))))))
+ c = uint32(sqlite3Utf8Trans1[c-uint32(0xc0)])
+ for int32(*(*uint8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pz)))))&0xc0 == 0x80 {
+ c = c<<6 + uint32(0x3f&int32(*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&*(*uintptr)(unsafe.Pointer(pz)), 1)))))
}
- if ((c < uint32(0x80)) ||
- ((c & 0xFFFFF800) == uint32(0xD800))) ||
- ((c & 0xFFFFFFFE) == uint32(0xFFFE)) {
+ if c < uint32(0x80) ||
+ c&0xFFFFF800 == uint32(0xD800) ||
+ c&0xFFFFFFFE == uint32(0xFFFE) {
c = uint32(0xFFFD)
}
}
@@ -18036,7 +18412,7 @@ func Xsqlite3Utf8Read(tls *libc.TLS, pz uintptr) U32 { /* sqlite3.c:31289:20: */
// This routine transforms the internal text encoding used by pMem to
// desiredEnc. It is an error if the string is already of the desired
// encoding, or if *pMem does not contain a string value.
-func Xsqlite3VdbeMemTranslate(tls *libc.TLS, pMem uintptr, desiredEnc U8) int32 { /* sqlite3.c:31325:36: */
+func Xsqlite3VdbeMemTranslate(tls *libc.TLS, pMem uintptr, desiredEnc U8) int32 { /* sqlite3.c:31668:36: */
var len Sqlite3_int64 // Maximum length of output string in bytes
var zOut uintptr // Output buffer
var zIn uintptr // Input iterator
@@ -18051,7 +18427,7 @@ func Xsqlite3VdbeMemTranslate(tls *libc.TLS, pMem uintptr, desiredEnc U8) int32
// If the translation is between UTF-16 little and big endian, then
// all that is required is to swap the byte order. This case is handled
// differently from the others.
- if !((int32((*Mem)(unsafe.Pointer(pMem)).Fenc) != SQLITE_UTF8) && (int32(desiredEnc) != SQLITE_UTF8)) {
+ if !(int32((*Mem)(unsafe.Pointer(pMem)).Fenc) != SQLITE_UTF8 && int32(desiredEnc) != SQLITE_UTF8) {
goto __1
}
rc = Xsqlite3VdbeMemMakeWriteable(tls, pMem)
@@ -18063,13 +18439,13 @@ func Xsqlite3VdbeMemTranslate(tls *libc.TLS, pMem uintptr, desiredEnc U8) int32
__2:
;
zIn = (*Mem)(unsafe.Pointer(pMem)).Fz
- zTerm = (zIn + uintptr(((*Mem)(unsafe.Pointer(pMem)).Fn & libc.CplInt32(1))))
+ zTerm = zIn + uintptr((*Mem)(unsafe.Pointer(pMem)).Fn&libc.CplInt32(1))
__3:
if !(zIn < zTerm) {
goto __4
}
temp = *(*uint8)(unsafe.Pointer(zIn))
- *(*uint8)(unsafe.Pointer(zIn)) = *(*uint8)(unsafe.Pointer((zIn + uintptr(1))))
+ *(*uint8)(unsafe.Pointer(zIn)) = *(*uint8)(unsafe.Pointer(zIn + uintptr(1)))
zIn++
*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&zIn, 1))) = temp
goto __3
@@ -18088,15 +18464,15 @@ __1:
// translating a 2-byte character to a 4-byte UTF-8 character.
// A single byte is required for the output string
// nul-terminator.
- *(*int32)(unsafe.Pointer(pMem + 12 /* &.n */)) &= (libc.CplInt32(1))
- len = ((int64(2) * Sqlite3_int64((*Mem)(unsafe.Pointer(pMem)).Fn)) + int64(1))
+ *(*int32)(unsafe.Pointer(pMem + 12)) &= libc.CplInt32(1)
+ len = int64(2)*Sqlite3_int64((*Mem)(unsafe.Pointer(pMem)).Fn) + int64(1)
goto __6
__5:
// When converting from UTF-8 to UTF-16 the maximum growth is caused
// when a 1-byte UTF-8 character is translated into a 2-byte UTF-16
// character. Two bytes are required in the output buffer for the
// nul-terminator.
- len = ((int64(2) * Sqlite3_int64((*Mem)(unsafe.Pointer(pMem)).Fn)) + int64(2))
+ len = int64(2)*Sqlite3_int64((*Mem)(unsafe.Pointer(pMem)).Fn) + int64(2)
__6:
;
@@ -18106,9 +18482,9 @@ __6:
// Variable zOut is set to point at the output buffer, space obtained
// from sqlite3_malloc().
zIn = (*Mem)(unsafe.Pointer(pMem)).Fz
- zTerm = (zIn + uintptr((*Mem)(unsafe.Pointer(pMem)).Fn))
+ zTerm = zIn + uintptr((*Mem)(unsafe.Pointer(pMem)).Fn)
zOut = Xsqlite3DbMallocRaw(tls, (*Mem)(unsafe.Pointer(pMem)).Fdb, uint64(len))
- if !(!(zOut != 0)) {
+ if !!(zOut != 0) {
goto __7
}
return SQLITE_NOMEM
@@ -18131,16 +18507,16 @@ __12:
if !(c >= uint32(0xc0)) {
goto __14
}
- c = uint32(sqlite3Utf8Trans1[(c - uint32(0xc0))])
+ c = uint32(sqlite3Utf8Trans1[c-uint32(0xc0)])
__15:
- if !((zIn != zTerm) && ((int32(*(*uint8)(unsafe.Pointer(zIn))) & 0xc0) == 0x80)) {
+ if !(zIn != zTerm && int32(*(*uint8)(unsafe.Pointer(zIn)))&0xc0 == 0x80) {
goto __16
}
- c = ((c << 6) + (uint32(0x3f & int32(*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&zIn, 1)))))))
+ c = c<<6 + uint32(0x3f&int32(*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&zIn, 1)))))
goto __15
__16:
;
- if !(((c < uint32(0x80)) || ((c & 0xFFFFF800) == uint32(0xD800))) || ((c & 0xFFFFFFFE) == uint32(0xFFFE))) {
+ if !(c < uint32(0x80) || c&0xFFFFF800 == uint32(0xD800) || c&0xFFFFFFFE == uint32(0xFFFE)) {
goto __17
}
c = uint32(0xFFFD)
@@ -18152,14 +18528,14 @@ __14:
if !(c <= uint32(0xFFFF)) {
goto __18
}
- *(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&z, 1))) = (U8(c & uint32(0x00FF)))
- *(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&z, 1))) = (U8((c >> 8) & uint32(0x00FF)))
+ *(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&z, 1))) = U8(c & uint32(0x00FF))
+ *(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&z, 1))) = U8(c >> 8 & uint32(0x00FF))
goto __19
__18:
- *(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&z, 1))) = (U8(((c >> 10) & uint32(0x003F)) + (((c - uint32(0x10000)) >> 10) & uint32(0x00C0))))
- *(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&z, 1))) = (U8(uint32(0x00D8) + (((c - uint32(0x10000)) >> 18) & uint32(0x03))))
- *(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&z, 1))) = (U8(c & uint32(0x00FF)))
- *(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&z, 1))) = (U8(uint32(0x00DC) + ((c >> 8) & uint32(0x03))))
+ *(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&z, 1))) = U8(c>>10&uint32(0x003F) + (c-uint32(0x10000))>>10&uint32(0x00C0))
+ *(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&z, 1))) = U8(uint32(0x00D8) + (c-uint32(0x10000))>>18&uint32(0x03))
+ *(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&z, 1))) = U8(c & uint32(0x00FF))
+ *(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&z, 1))) = U8(uint32(0x00DC) + c>>8&uint32(0x03))
__19:
;
@@ -18178,16 +18554,16 @@ __20:
if !(c >= uint32(0xc0)) {
goto __22
}
- c = uint32(sqlite3Utf8Trans1[(c - uint32(0xc0))])
+ c = uint32(sqlite3Utf8Trans1[c-uint32(0xc0)])
__23:
- if !((zIn != zTerm) && ((int32(*(*uint8)(unsafe.Pointer(zIn))) & 0xc0) == 0x80)) {
+ if !(zIn != zTerm && int32(*(*uint8)(unsafe.Pointer(zIn)))&0xc0 == 0x80) {
goto __24
}
- c = ((c << 6) + (uint32(0x3f & int32(*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&zIn, 1)))))))
+ c = c<<6 + uint32(0x3f&int32(*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&zIn, 1)))))
goto __23
__24:
;
- if !(((c < uint32(0x80)) || ((c & 0xFFFFF800) == uint32(0xD800))) || ((c & 0xFFFFFFFE) == uint32(0xFFFE))) {
+ if !(c < uint32(0x80) || c&0xFFFFF800 == uint32(0xD800) || c&0xFFFFFFFE == uint32(0xFFFE)) {
goto __25
}
c = uint32(0xFFFD)
@@ -18199,14 +18575,14 @@ __22:
if !(c <= uint32(0xFFFF)) {
goto __26
}
- *(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&z, 1))) = (U8((c >> 8) & uint32(0x00FF)))
- *(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&z, 1))) = (U8(c & uint32(0x00FF)))
+ *(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&z, 1))) = U8(c >> 8 & uint32(0x00FF))
+ *(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&z, 1))) = U8(c & uint32(0x00FF))
goto __27
__26:
- *(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&z, 1))) = (U8(uint32(0x00D8) + (((c - uint32(0x10000)) >> 18) & uint32(0x03))))
- *(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&z, 1))) = (U8(((c >> 10) & uint32(0x003F)) + (((c - uint32(0x10000)) >> 10) & uint32(0x00C0))))
- *(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&z, 1))) = (U8(uint32(0x00DC) + ((c >> 8) & uint32(0x03))))
- *(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&z, 1))) = (U8(c & uint32(0x00FF)))
+ *(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&z, 1))) = U8(uint32(0x00D8) + (c-uint32(0x10000))>>18&uint32(0x03))
+ *(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&z, 1))) = U8(c>>10&uint32(0x003F) + (c-uint32(0x10000))>>10&uint32(0x00C0))
+ *(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&z, 1))) = U8(uint32(0x00DC) + c>>8&uint32(0x03))
+ *(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&z, 1))) = U8(c & uint32(0x00FF))
__27:
;
@@ -18215,7 +18591,7 @@ __21:
;
__11:
;
- (*Mem)(unsafe.Pointer(pMem)).Fn = ((int32(z) - int32(zOut)) / 1)
+ (*Mem)(unsafe.Pointer(pMem)).Fn = (int32(z) - int32(zOut)) / 1
*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&z, 1))) = uint8(0)
goto __9
__8:
@@ -18229,16 +18605,16 @@ __30:
goto __31
}
c = uint32(*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&zIn, 1))))
- c = c + (uint32((int32(*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&zIn, 1))))) << 8))
- if !((c >= uint32(0xd800)) && (c < uint32(0xe000))) {
+ c = c + uint32(int32(*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&zIn, 1))))<<8)
+ if !(c >= uint32(0xd800) && c < uint32(0xe000)) {
goto __32
}
if !(zIn < zTerm) {
goto __33
}
c2 = int32(*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&zIn, 1))))
- c2 = c2 + ((int32(*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&zIn, 1))))) << 8)
- c = (((uint32(c2 & 0x03FF)) + ((c & uint32(0x003F)) << 10)) + (((c & uint32(0x03C0)) + uint32(0x0040)) << 10))
+ c2 = c2 + int32(*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&zIn, 1))))<<8
+ c = uint32(c2&0x03FF) + c&uint32(0x003F)<<10 + (c&uint32(0x03C0)+uint32(0x0040))<<10
__33:
;
__32:
@@ -18246,28 +18622,28 @@ __32:
if !(c < uint32(0x00080)) {
goto __34
}
- *(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&z, 1))) = (U8(c & uint32(0xFF)))
+ *(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&z, 1))) = U8(c & uint32(0xFF))
goto __35
__34:
if !(c < uint32(0x00800)) {
goto __36
}
- *(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&z, 1))) = (uint8(0xC0 + int32((U8((c >> 6) & uint32(0x1F))))))
- *(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&z, 1))) = (uint8(0x80 + int32((U8(c & uint32(0x3F))))))
+ *(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&z, 1))) = uint8(0xC0 + int32(U8(c>>6&uint32(0x1F))))
+ *(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&z, 1))) = uint8(0x80 + int32(U8(c&uint32(0x3F))))
goto __37
__36:
if !(c < uint32(0x10000)) {
goto __38
}
- *(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&z, 1))) = (uint8(0xE0 + int32((U8((c >> 12) & uint32(0x0F))))))
- *(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&z, 1))) = (uint8(0x80 + int32((U8((c >> 6) & uint32(0x3F))))))
- *(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&z, 1))) = (uint8(0x80 + int32((U8(c & uint32(0x3F))))))
+ *(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&z, 1))) = uint8(0xE0 + int32(U8(c>>12&uint32(0x0F))))
+ *(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&z, 1))) = uint8(0x80 + int32(U8(c>>6&uint32(0x3F))))
+ *(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&z, 1))) = uint8(0x80 + int32(U8(c&uint32(0x3F))))
goto __39
__38:
- *(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&z, 1))) = (uint8(0xF0 + int32((U8((c >> 18) & uint32(0x07))))))
- *(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&z, 1))) = (uint8(0x80 + int32((U8((c >> 12) & uint32(0x3F))))))
- *(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&z, 1))) = (uint8(0x80 + int32((U8((c >> 6) & uint32(0x3F))))))
- *(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&z, 1))) = (uint8(0x80 + int32((U8(c & uint32(0x3F))))))
+ *(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&z, 1))) = uint8(0xF0 + int32(U8(c>>18&uint32(0x07))))
+ *(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&z, 1))) = uint8(0x80 + int32(U8(c>>12&uint32(0x3F))))
+ *(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&z, 1))) = uint8(0x80 + int32(U8(c>>6&uint32(0x3F))))
+ *(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&z, 1))) = uint8(0x80 + int32(U8(c&uint32(0x3F))))
__39:
;
__37:
@@ -18285,17 +18661,17 @@ __40:
if !(zIn < zTerm) {
goto __41
}
- c = (uint32((int32(*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&zIn, 1))))) << 8))
- c = c + (uint32(*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&zIn, 1)))))
- if !((c >= uint32(0xd800)) && (c < uint32(0xe000))) {
+ c = uint32(int32(*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&zIn, 1)))) << 8)
+ c = c + uint32(*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&zIn, 1))))
+ if !(c >= uint32(0xd800) && c < uint32(0xe000)) {
goto __42
}
if !(zIn < zTerm) {
goto __43
}
- c21 = ((int32(*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&zIn, 1))))) << 8)
- c21 = c21 + (int32(*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&zIn, 1)))))
- c = (((uint32(c21 & 0x03FF)) + ((c & uint32(0x003F)) << 10)) + (((c & uint32(0x03C0)) + uint32(0x0040)) << 10))
+ c21 = int32(*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&zIn, 1)))) << 8
+ c21 = c21 + int32(*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&zIn, 1))))
+ c = uint32(c21&0x03FF) + c&uint32(0x003F)<<10 + (c&uint32(0x03C0)+uint32(0x0040))<<10
__43:
;
__42:
@@ -18303,28 +18679,28 @@ __42:
if !(c < uint32(0x00080)) {
goto __44
}
- *(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&z, 1))) = (U8(c & uint32(0xFF)))
+ *(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&z, 1))) = U8(c & uint32(0xFF))
goto __45
__44:
if !(c < uint32(0x00800)) {
goto __46
}
- *(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&z, 1))) = (uint8(0xC0 + int32((U8((c >> 6) & uint32(0x1F))))))
- *(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&z, 1))) = (uint8(0x80 + int32((U8(c & uint32(0x3F))))))
+ *(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&z, 1))) = uint8(0xC0 + int32(U8(c>>6&uint32(0x1F))))
+ *(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&z, 1))) = uint8(0x80 + int32(U8(c&uint32(0x3F))))
goto __47
__46:
if !(c < uint32(0x10000)) {
goto __48
}
- *(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&z, 1))) = (uint8(0xE0 + int32((U8((c >> 12) & uint32(0x0F))))))
- *(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&z, 1))) = (uint8(0x80 + int32((U8((c >> 6) & uint32(0x3F))))))
- *(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&z, 1))) = (uint8(0x80 + int32((U8(c & uint32(0x3F))))))
+ *(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&z, 1))) = uint8(0xE0 + int32(U8(c>>12&uint32(0x0F))))
+ *(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&z, 1))) = uint8(0x80 + int32(U8(c>>6&uint32(0x3F))))
+ *(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&z, 1))) = uint8(0x80 + int32(U8(c&uint32(0x3F))))
goto __49
__48:
- *(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&z, 1))) = (uint8(0xF0 + int32((U8((c >> 18) & uint32(0x07))))))
- *(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&z, 1))) = (uint8(0x80 + int32((U8((c >> 12) & uint32(0x3F))))))
- *(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&z, 1))) = (uint8(0x80 + int32((U8((c >> 6) & uint32(0x3F))))))
- *(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&z, 1))) = (uint8(0x80 + int32((U8(c & uint32(0x3F))))))
+ *(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&z, 1))) = uint8(0xF0 + int32(U8(c>>18&uint32(0x07))))
+ *(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&z, 1))) = uint8(0x80 + int32(U8(c>>12&uint32(0x3F))))
+ *(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&z, 1))) = uint8(0x80 + int32(U8(c>>6&uint32(0x3F))))
+ *(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&z, 1))) = uint8(0x80 + int32(U8(c&uint32(0x3F))))
__49:
;
__47:
@@ -18337,12 +18713,12 @@ __41:
;
__29:
;
- (*Mem)(unsafe.Pointer(pMem)).Fn = ((int32(z) - int32(zOut)) / 1)
+ (*Mem)(unsafe.Pointer(pMem)).Fn = (int32(z) - int32(zOut)) / 1
__9:
;
*(*uint8)(unsafe.Pointer(z)) = uint8(0)
- c = (uint32((MEM_Str | MEM_Term) | (int32((*Mem)(unsafe.Pointer(pMem)).Fflags) & (MEM_AffMask | MEM_Subtype))))
+ c = uint32(MEM_Str | MEM_Term | int32((*Mem)(unsafe.Pointer(pMem)).Fflags)&(MEM_AffMask|MEM_Subtype))
Xsqlite3VdbeMemRelease(tls, pMem)
(*Mem)(unsafe.Pointer(pMem)).Fflags = U16(c)
(*Mem)(unsafe.Pointer(pMem)).Fenc = desiredEnc
@@ -18361,17 +18737,17 @@ translate_out:
//
// The allocation (static, dynamic etc.) and encoding of the Mem may be
// changed by this function.
-func Xsqlite3VdbeMemHandleBom(tls *libc.TLS, pMem uintptr) int32 { /* sqlite3.c:31520:20: */
+func Xsqlite3VdbeMemHandleBom(tls *libc.TLS, pMem uintptr) int32 { /* sqlite3.c:31863:20: */
var rc int32 = SQLITE_OK
var bom U8 = U8(0)
if (*Mem)(unsafe.Pointer(pMem)).Fn > 1 {
var b1 U8 = *(*U8)(unsafe.Pointer((*Mem)(unsafe.Pointer(pMem)).Fz))
- var b2 U8 = *(*U8)(unsafe.Pointer((((*Mem)(unsafe.Pointer(pMem)).Fz) + uintptr(1))))
- if (int32(b1) == 0xFE) && (int32(b2) == 0xFF) {
+ var b2 U8 = *(*U8)(unsafe.Pointer((*Mem)(unsafe.Pointer(pMem)).Fz + uintptr(1)))
+ if int32(b1) == 0xFE && int32(b2) == 0xFF {
bom = U8(SQLITE_UTF16BE)
}
- if (int32(b1) == 0xFF) && (int32(b2) == 0xFE) {
+ if int32(b1) == 0xFF && int32(b2) == 0xFE {
bom = U8(SQLITE_UTF16LE)
}
}
@@ -18379,11 +18755,11 @@ func Xsqlite3VdbeMemHandleBom(tls *libc.TLS, pMem uintptr) int32 { /* sqlite3.c:
if bom != 0 {
rc = Xsqlite3VdbeMemMakeWriteable(tls, pMem)
if rc == SQLITE_OK {
- *(*int32)(unsafe.Pointer(pMem + 12 /* &.n */)) -= (2)
- libc.Xmemmove(tls, (*Mem)(unsafe.Pointer(pMem)).Fz, ((*Mem)(unsafe.Pointer(pMem)).Fz + 2), uint32((*Mem)(unsafe.Pointer(pMem)).Fn))
+ *(*int32)(unsafe.Pointer(pMem + 12)) -= 2
+ libc.Xmemmove(tls, (*Mem)(unsafe.Pointer(pMem)).Fz, (*Mem)(unsafe.Pointer(pMem)).Fz+2, uint32((*Mem)(unsafe.Pointer(pMem)).Fn))
*(*uint8)(unsafe.Pointer((*Mem)(unsafe.Pointer(pMem)).Fz + uintptr((*Mem)(unsafe.Pointer(pMem)).Fn))) = uint8(0)
- *(*uint8)(unsafe.Pointer((*Mem)(unsafe.Pointer(pMem)).Fz + uintptr(((*Mem)(unsafe.Pointer(pMem)).Fn + 1)))) = uint8(0)
- *(*U16)(unsafe.Pointer(pMem + 8 /* &.flags */)) |= U16((MEM_Term))
+ *(*uint8)(unsafe.Pointer((*Mem)(unsafe.Pointer(pMem)).Fz + uintptr((*Mem)(unsafe.Pointer(pMem)).Fn+1))) = uint8(0)
+ *(*U16)(unsafe.Pointer(pMem + 8)) |= U16(MEM_Term)
(*Mem)(unsafe.Pointer(pMem)).Fenc = bom
}
}
@@ -18395,20 +18771,20 @@ func Xsqlite3VdbeMemHandleBom(tls *libc.TLS, pMem uintptr) int32 { /* sqlite3.c:
// the first 0x00 byte. If nByte is not less than zero, return the
// number of unicode characters in the first nByte of pZ (or up to
// the first 0x00, whichever comes first).
-func Xsqlite3Utf8CharLen(tls *libc.TLS, zIn uintptr, nByte int32) int32 { /* sqlite3.c:31558:20: */
+func Xsqlite3Utf8CharLen(tls *libc.TLS, zIn uintptr, nByte int32) int32 { /* sqlite3.c:31901:20: */
var r int32 = 0
var z uintptr = zIn
var zTerm uintptr
if nByte >= 0 {
- zTerm = (z + uintptr(nByte))
+ zTerm = z + uintptr(nByte)
} else {
zTerm = libc.UintptrFromInt32(-1)
}
- for (int32(*(*U8)(unsafe.Pointer(z))) != 0) && (z < zTerm) {
+ for int32(*(*U8)(unsafe.Pointer(z))) != 0 && z < zTerm {
{
- if (int32(*(*U8)(unsafe.Pointer(libc.PostIncUintptr(&z, 1))))) >= 0xc0 {
- for (int32(*(*U8)(unsafe.Pointer(z))) & 0xc0) == 0x80 {
+ if int32(*(*U8)(unsafe.Pointer(libc.PostIncUintptr(&z, 1)))) >= 0xc0 {
+ for int32(*(*U8)(unsafe.Pointer(z)))&0xc0 == 0x80 {
z++
}
}
@@ -18427,7 +18803,7 @@ func Xsqlite3Utf8CharLen(tls *libc.TLS, zIn uintptr, nByte int32) int32 { /* sql
// be freed by the calling function.
//
// NULL is returned if there is an allocation error.
-func Xsqlite3Utf16to8(tls *libc.TLS, db uintptr, z uintptr, nByte int32, enc U8) uintptr { /* sqlite3.c:31612:21: */
+func Xsqlite3Utf16to8(tls *libc.TLS, db uintptr, z uintptr, nByte int32, enc U8) uintptr { /* sqlite3.c:31955:21: */
bp := tls.Alloc(40)
defer tls.Free(40)
@@ -18448,7 +18824,7 @@ func Xsqlite3Utf16to8(tls *libc.TLS, db uintptr, z uintptr, nByte int32, enc U8)
// zIn is a UTF-16 encoded unicode string at least nChar characters long.
// Return the number of bytes in the first nChar unicode characters
// in pZ. nChar must be non-negative.
-func Xsqlite3Utf16ByteLen(tls *libc.TLS, zIn uintptr, nChar int32) int32 { /* sqlite3.c:31633:20: */
+func Xsqlite3Utf16ByteLen(tls *libc.TLS, zIn uintptr, nChar int32) int32 { /* sqlite3.c:31976:20: */
var c int32
var z uintptr = zIn
var n int32 = 0
@@ -18459,13 +18835,13 @@ func Xsqlite3Utf16ByteLen(tls *libc.TLS, zIn uintptr, nChar int32) int32 { /* sq
for n < nChar {
c = int32(*(*uint8)(unsafe.Pointer(z)))
z += uintptr(2)
- if (((c >= 0xd8) && (c < 0xdc)) && (int32(*(*uint8)(unsafe.Pointer(z))) >= 0xdc)) && (int32(*(*uint8)(unsafe.Pointer(z))) < 0xe0) {
+ if c >= 0xd8 && c < 0xdc && int32(*(*uint8)(unsafe.Pointer(z))) >= 0xdc && int32(*(*uint8)(unsafe.Pointer(z))) < 0xe0 {
z += uintptr(2)
}
n++
}
- return (((int32(z) - int32(zIn)) / 1) -
- (libc.Bool32(SQLITE_UTF16LE == SQLITE_UTF16LE)))
+ return (int32(z)-int32(zIn))/1 -
+ libc.Bool32(SQLITE_UTF16LE == SQLITE_UTF16LE)
}
//************* End of utf.c ************************************************
@@ -18488,7 +18864,7 @@ func Xsqlite3Utf16ByteLen(tls *libc.TLS, zIn uintptr, nChar int32) int32 { /* sq
// #include "sqliteInt.h"
// #include <stdarg.h>
// Declarations for math functions.
-// Copyright (C) 1991-2018 Free Software Foundation, Inc.
+// Copyright (C) 1991-2020 Free Software Foundation, Inc.
// This file is part of the GNU C Library.
//
// The GNU C Library is free software; you can redistribute it and/or
@@ -18503,12 +18879,12 @@ func Xsqlite3Utf16ByteLen(tls *libc.TLS, zIn uintptr, nChar int32) int32 { /* sq
//
// You should have received a copy of the GNU Lesser General Public
// License along with the GNU C Library; if not, see
-// <http://www.gnu.org/licenses/>.
+// <https://www.gnu.org/licenses/>.
// ISO C99 Standard: 7.12 Mathematics <math.h>
// Handle feature test macros at the start of a header.
-// Copyright (C) 2016-2018 Free Software Foundation, Inc.
+// Copyright (C) 2016-2020 Free Software Foundation, Inc.
// This file is part of the GNU C Library.
//
// The GNU C Library is free software; you can redistribute it and/or
@@ -18523,7 +18899,7 @@ func Xsqlite3Utf16ByteLen(tls *libc.TLS, zIn uintptr, nChar int32) int32 { /* sq
//
// You should have received a copy of the GNU Lesser General Public
// License along with the GNU C Library; if not, see
-// <http://www.gnu.org/licenses/>.
+// <https://www.gnu.org/licenses/>.
// This header is internal to glibc and should not be included outside
// of glibc headers. Headers including it must define
@@ -18533,7 +18909,7 @@ func Xsqlite3Utf16ByteLen(tls *libc.TLS, zIn uintptr, nChar int32) int32 { /* sq
// header is included, not when the first system header is
// included.
-// Copyright (C) 1991-2018 Free Software Foundation, Inc.
+// Copyright (C) 1991-2020 Free Software Foundation, Inc.
// This file is part of the GNU C Library.
//
// The GNU C Library is free software; you can redistribute it and/or
@@ -18548,23 +18924,27 @@ func Xsqlite3Utf16ByteLen(tls *libc.TLS, zIn uintptr, nChar int32) int32 { /* sq
//
// You should have received a copy of the GNU Lesser General Public
// License along with the GNU C Library; if not, see
-// <http://www.gnu.org/licenses/>.
+// <https://www.gnu.org/licenses/>.
// ISO/IEC TR 24731-2:2010 defines the __STDC_WANT_LIB_EXT2__
// macro.
// ISO/IEC TS 18661-1:2014 defines the __STDC_WANT_IEC_60559_BFP_EXT__
-// macro.
+// macro. Most but not all symbols enabled by that macro in TS
+// 18661-1 are enabled unconditionally in C2X; the symbols in Annex F
+// still require that macro in C2X.
// ISO/IEC TS 18661-4:2015 defines the
-// __STDC_WANT_IEC_60559_FUNCS_EXT__ macro.
+// __STDC_WANT_IEC_60559_FUNCS_EXT__ macro. Other than the reduction
+// functions, the symbols from this TS are enabled unconditionally in
+// C2X.
// ISO/IEC TS 18661-3:2015 defines the
// __STDC_WANT_IEC_60559_TYPES_EXT__ macro.
// Get definitions of __intmax_t and __uintmax_t.
// bits/types.h -- definitions of __*_t types underlying *_t types.
-// Copyright (C) 2002-2018 Free Software Foundation, Inc.
+// Copyright (C) 2002-2020 Free Software Foundation, Inc.
// This file is part of the GNU C Library.
//
// The GNU C Library is free software; you can redistribute it and/or
@@ -18579,13 +18959,13 @@ func Xsqlite3Utf16ByteLen(tls *libc.TLS, zIn uintptr, nChar int32) int32 { /* sq
//
// You should have received a copy of the GNU Lesser General Public
// License along with the GNU C Library; if not, see
-// <http://www.gnu.org/licenses/>.
+// <https://www.gnu.org/licenses/>.
// Never include this file directly; use <sys/types.h> instead.
// Get machine-dependent vector math functions declarations.
// Platform-specific SIMD declarations of math functions.
-// Copyright (C) 2014-2018 Free Software Foundation, Inc.
+// Copyright (C) 2014-2020 Free Software Foundation, Inc.
// This file is part of the GNU C Library.
//
// The GNU C Library is free software; you can redistribute it and/or
@@ -18600,13 +18980,13 @@ func Xsqlite3Utf16ByteLen(tls *libc.TLS, zIn uintptr, nChar int32) int32 { /* sq
//
// You should have received a copy of the GNU Lesser General Public
// License along with the GNU C Library; if not, see
-// <http://www.gnu.org/licenses/>.
+// <https://www.gnu.org/licenses/>.
// Get default empty definitions required for __MATHCALL_VEC unfolding.
// Plaform-specific analogue of this header should redefine them with specific
// SIMD declarations.
// Empty definitions required for __MATHCALL_VEC unfolding in mathcalls.h.
-// Copyright (C) 2014-2018 Free Software Foundation, Inc.
+// Copyright (C) 2014-2020 Free Software Foundation, Inc.
// This file is part of the GNU C Library.
//
// The GNU C Library is free software; you can redistribute it and/or
@@ -18621,7 +19001,7 @@ func Xsqlite3Utf16ByteLen(tls *libc.TLS, zIn uintptr, nChar int32) int32 { /* sq
//
// You should have received a copy of the GNU Lesser General Public
// License along with the GNU C Library; if not, see
-// <http://www.gnu.org/licenses/>.
+// <https://www.gnu.org/licenses/>.
// Needed definitions could be generated with:
// for func in $(grep __MATHCALL_VEC math/bits/mathcalls.h | sed -r "s|__MATHCALL_VEC.?\(||; s|,.*||"); do
@@ -18633,7 +19013,7 @@ func Xsqlite3Utf16ByteLen(tls *libc.TLS, zIn uintptr, nChar int32) int32 { /* sq
// Gather machine dependent type support.
// Macros to control TS 18661-3 glibc features.
-// Copyright (C) 2017-2018 Free Software Foundation, Inc.
+// Copyright (C) 2017-2020 Free Software Foundation, Inc.
// This file is part of the GNU C Library.
//
// The GNU C Library is free software; you can redistribute it and/or
@@ -18648,7 +19028,7 @@ func Xsqlite3Utf16ByteLen(tls *libc.TLS, zIn uintptr, nChar int32) int32 { /* sq
//
// You should have received a copy of the GNU Lesser General Public
// License along with the GNU C Library; if not, see
-// <http://www.gnu.org/licenses/>.
+// <https://www.gnu.org/licenses/>.
// Defined to 1 if the current compiler invocation provides a
// floating-point type with the IEEE 754 binary128 format, and this glibc
@@ -18675,7 +19055,7 @@ func Xsqlite3Utf16ByteLen(tls *libc.TLS, zIn uintptr, nChar int32) int32 { /* sq
// Macros to control TS 18661-3 glibc features where the same
// definitions are appropriate for all platforms.
-// Copyright (C) 2017-2018 Free Software Foundation, Inc.
+// Copyright (C) 2017-2020 Free Software Foundation, Inc.
// This file is part of the GNU C Library.
//
// The GNU C Library is free software; you can redistribute it and/or
@@ -18690,7 +19070,7 @@ func Xsqlite3Utf16ByteLen(tls *libc.TLS, zIn uintptr, nChar int32) int32 { /* sq
//
// You should have received a copy of the GNU Lesser General Public
// License along with the GNU C Library; if not, see
-// <http://www.gnu.org/licenses/>.
+// <https://www.gnu.org/licenses/>.
// Value returned on overflow. With IEEE 754 floating point, this is
// +Infinity, otherwise the largest representable positive value.
@@ -18703,7 +19083,7 @@ func Xsqlite3Utf16ByteLen(tls *libc.TLS, zIn uintptr, nChar int32) int32 { /* sq
// Get __GLIBC_FLT_EVAL_METHOD.
// Define __GLIBC_FLT_EVAL_METHOD.
-// Copyright (C) 2016-2018 Free Software Foundation, Inc.
+// Copyright (C) 2016-2020 Free Software Foundation, Inc.
// This file is part of the GNU C Library.
//
// The GNU C Library is free software; you can redistribute it and/or
@@ -18718,7 +19098,7 @@ func Xsqlite3Utf16ByteLen(tls *libc.TLS, zIn uintptr, nChar int32) int32 { /* sq
//
// You should have received a copy of the GNU Lesser General Public
// License along with the GNU C Library; if not, see
-// <http://www.gnu.org/licenses/>.
+// <https://www.gnu.org/licenses/>.
// __GLIBC_FLT_EVAL_METHOD is the value of FLT_EVAL_METHOD used to
// determine the evaluation method typedefs such as float_t and
@@ -18772,7 +19152,7 @@ type Double_t = float64 /* math.h:150:16 */
// nonconforming but it is more useful than leaving it undefined).
// Define iscanonical macro.
-// Copyright (C) 2016-2018 Free Software Foundation, Inc.
+// Copyright (C) 2016-2020 Free Software Foundation, Inc.
// This file is part of the GNU C Library.
//
// The GNU C Library is free software; you can redistribute it and/or
@@ -18787,7 +19167,7 @@ type Double_t = float64 /* math.h:150:16 */
//
// You should have received a copy of the GNU Lesser General Public
// License along with the GNU C Library; if not, see
-// <http://www.gnu.org/licenses/>.
+// <https://www.gnu.org/licenses/>.
// Return nonzero value if X is canonical. By default, we only have
// IEEE interchange binary formats, in which all values are canonical,
@@ -18822,17 +19202,12 @@ type Double_t = float64 /* math.h:150:16 */
// Get machine-dependent inline versions (if there are any).
-// Define special entry points to use when the compiler got told to
-// only expect finite results.
-
// An expression whose type has the widest of the evaluation formats
// of X and Y (which are of floating-point types).
// Return X == Y but raising "invalid" and setting errno if X or Y is
// a NaN.
-// Routine needed to support the testcase() macro.
-
// Calls to sqlite3FaultSim() are used to simulate a failure during testing,
// or to bypass normal error detection during testing in order to let
// execute proceed futher downstream.
@@ -18850,7 +19225,7 @@ type Double_t = float64 /* math.h:150:16 */
// sqlite3FaultSim() instance is being invoked. Each call to sqlite3FaultSim()
// should have a unique code. To prevent legacy testing applications from
// breaking, the codes should not be changed or reused.
-func Xsqlite3FaultSim(tls *libc.TLS, iTest int32) int32 { /* sqlite3.c:31735:20: */
+func Xsqlite3FaultSim(tls *libc.TLS, iTest int32) int32 { /* sqlite3.c:32068:20: */
var xCallback uintptr = Xsqlite3Config.FxTestCallback
if xCallback != 0 {
return (*struct{ f func(*libc.TLS, int32) int32 })(unsafe.Pointer(&struct{ uintptr }{xCallback})).f(tls, iTest)
@@ -18859,15 +19234,21 @@ func Xsqlite3FaultSim(tls *libc.TLS, iTest int32) int32 { /* sqlite3.c:31735:20:
}
// Return true if the floating point value is Not a Number (NaN).
-func Xsqlite3IsNaN(tls *libc.TLS, x float64) int32 { /* sqlite3.c:31745:20: */
+//
+// Use the math library isnan() function if compiled with SQLITE_HAVE_ISNAN.
+// Otherwise, we have our own implementation that works on most systems.
+func Xsqlite3IsNaN(tls *libc.TLS, x float64) int32 { /* sqlite3.c:32081:20: */
bp := tls.Alloc(16)
defer tls.Free(16)
*(*float64)(unsafe.Pointer(bp + 8)) = x
+ var rc int32 // The value return
// var y U64 at bp, 8
libc.Xmemcpy(tls, bp /* &y */, bp+8 /* &x */, uint32(unsafe.Sizeof(U64(0))))
- return (libc.Bool32((((*(*U64)(unsafe.Pointer(bp /* y */))) & (U64((uint64(0x7ff))) << 52)) == (U64((uint64(0x7ff))) << 52)) && (((*(*U64)(unsafe.Pointer(bp /* y */))) & ((U64((uint64(1))) << 52) - uint64(1))) != uint64(0))))
+ rc = libc.Bool32(*(*U64)(unsafe.Pointer(bp))&(U64(uint64(0x7ff))<<52) == U64(uint64(0x7ff))<<52 && *(*U64)(unsafe.Pointer(bp))&(U64(uint64(1))<<52-uint64(1)) != uint64(0))
+
+ return rc
}
// Compute a string length that is limited to what can be stored in
@@ -18876,11 +19257,11 @@ func Xsqlite3IsNaN(tls *libc.TLS, x float64) int32 { /* sqlite3.c:31745:20: */
// The value returned will never be negative. Nor will it ever be greater
// than the actual length of the string. For very long strings (greater
// than 1GiB) the value returned might be less than the true string length.
-func Xsqlite3Strlen30(tls *libc.TLS, z uintptr) int32 { /* sqlite3.c:31760:20: */
+func Xsqlite3Strlen30(tls *libc.TLS, z uintptr) int32 { /* sqlite3.c:32103:20: */
if z == uintptr(0) {
return 0
}
- return (0x3fffffff & int32(libc.Xstrlen(tls, z)))
+ return 0x3fffffff & int32(libc.Xstrlen(tls, z))
}
// Return the declared type of a column. Or return zDflt if the column
@@ -18888,17 +19269,22 @@ func Xsqlite3Strlen30(tls *libc.TLS, z uintptr) int32 { /* sqlite3.c:31760:20: *
//
// The column type is an extra string stored after the zero-terminator on
// the column name if and only if the COLFLAG_HASTYPE flag is set.
-func Xsqlite3ColumnType(tls *libc.TLS, pCol uintptr, zDflt uintptr) uintptr { /* sqlite3.c:31772:21: */
- if (int32((*Column)(unsafe.Pointer(pCol)).FcolFlags) & COLFLAG_HASTYPE) == 0 {
+func Xsqlite3ColumnType(tls *libc.TLS, pCol uintptr, zDflt uintptr) uintptr { /* sqlite3.c:32115:21: */
+ if int32((*Column)(unsafe.Pointer(pCol)).FcolFlags)&COLFLAG_HASTYPE != 0 {
+ return (*Column)(unsafe.Pointer(pCol)).FzCnName + uintptr(libc.Xstrlen(tls, (*Column)(unsafe.Pointer(pCol)).FzCnName)) + uintptr(1)
+ } else if uint32(int32(*(*uint8)(unsafe.Pointer(pCol + 4))&0xf0>>4)) != 0 {
+
+ return Xsqlite3StdType[(int32(*(*uint8)(unsafe.Pointer(pCol + 4))&0xf0>>4)-1)&0xf<<28>>28]
+ } else {
return zDflt
}
- return (((*Column)(unsafe.Pointer(pCol)).FzName + uintptr(libc.Xstrlen(tls, (*Column)(unsafe.Pointer(pCol)).FzName))) + uintptr(1))
+ return uintptr(0)
}
// Helper function for sqlite3Error() - called rarely. Broken out into
// a separate routine to avoid unnecessary register saves on entry to
// sqlite3Error().
-func sqlite3ErrorFinish(tls *libc.TLS, db uintptr, err_code int32) { /* sqlite3.c:31782:30: */
+func sqlite3ErrorFinish(tls *libc.TLS, db uintptr, err_code int32) { /* sqlite3.c:32131:30: */
if (*Sqlite3)(unsafe.Pointer(db)).FpErr != 0 {
Xsqlite3ValueSetNull(tls, (*Sqlite3)(unsafe.Pointer(db)).FpErr)
}
@@ -18908,17 +19294,17 @@ func sqlite3ErrorFinish(tls *libc.TLS, db uintptr, err_code int32) { /* sqlite3.
// Set the current error code to err_code and clear any prior error message.
// Also set iSysErrno (by calling sqlite3System) if the err_code indicates
// that would be appropriate.
-func Xsqlite3Error(tls *libc.TLS, db uintptr, err_code int32) { /* sqlite3.c:31792:21: */
+func Xsqlite3Error(tls *libc.TLS, db uintptr, err_code int32) { /* sqlite3.c:32141:21: */
(*Sqlite3)(unsafe.Pointer(db)).FerrCode = err_code
- if (err_code != 0) || ((*Sqlite3)(unsafe.Pointer(db)).FpErr != 0) {
+ if err_code != 0 || (*Sqlite3)(unsafe.Pointer(db)).FpErr != 0 {
sqlite3ErrorFinish(tls, db, err_code)
}
}
// The equivalent of sqlite3Error(db, SQLITE_OK). Clear the error state
// and error message.
-func Xsqlite3ErrorClear(tls *libc.TLS, db uintptr) { /* sqlite3.c:31802:21: */
+func Xsqlite3ErrorClear(tls *libc.TLS, db uintptr) { /* sqlite3.c:32151:21: */
(*Sqlite3)(unsafe.Pointer(db)).FerrCode = SQLITE_OK
if (*Sqlite3)(unsafe.Pointer(db)).FpErr != 0 {
@@ -18928,12 +19314,12 @@ func Xsqlite3ErrorClear(tls *libc.TLS, db uintptr) { /* sqlite3.c:31802:21: */
// Load the sqlite3.iSysErrno field if that is an appropriate thing
// to do based on the SQLite error code in rc.
-func Xsqlite3SystemError(tls *libc.TLS, db uintptr, rc int32) { /* sqlite3.c:31812:21: */
- if rc == (SQLITE_IOERR | (int32(12) << 8)) {
+func Xsqlite3SystemError(tls *libc.TLS, db uintptr, rc int32) { /* sqlite3.c:32161:21: */
+ if rc == SQLITE_IOERR|int32(12)<<8 {
return
}
- rc = rc & (0xff)
- if (rc == SQLITE_CANTOPEN) || (rc == SQLITE_IOERR) {
+ rc = rc & 0xff
+ if rc == SQLITE_CANTOPEN || rc == SQLITE_IOERR {
(*Sqlite3)(unsafe.Pointer(db)).FiSysErrno = Xsqlite3OsGetLastError(tls, (*Sqlite3)(unsafe.Pointer(db)).FpVfs)
}
}
@@ -18957,13 +19343,13 @@ func Xsqlite3SystemError(tls *libc.TLS, db uintptr, rc int32) { /* sqlite3.c:318
// To clear the most recent error for sqlite handle "db", sqlite3Error
// should be called with err_code set to SQLITE_OK and zFormat set
// to NULL.
-func Xsqlite3ErrorWithMsg(tls *libc.TLS, db uintptr, err_code int32, zFormat uintptr, va uintptr) { /* sqlite3.c:31841:21: */
+func Xsqlite3ErrorWithMsg(tls *libc.TLS, db uintptr, err_code int32, zFormat uintptr, va uintptr) { /* sqlite3.c:32190:21: */
(*Sqlite3)(unsafe.Pointer(db)).FerrCode = err_code
Xsqlite3SystemError(tls, db, err_code)
if zFormat == uintptr(0) {
Xsqlite3Error(tls, db, err_code)
- } else if ((*Sqlite3)(unsafe.Pointer(db)).FpErr != 0) || ((libc.AssignPtrUintptr(db+284 /* &.pErr */, Xsqlite3ValueNew(tls, db))) != uintptr(0)) {
+ } else if (*Sqlite3)(unsafe.Pointer(db)).FpErr != 0 || libc.AssignPtrUintptr(db+304, Xsqlite3ValueNew(tls, db)) != uintptr(0) {
var z uintptr
var ap Va_list
_ = ap
@@ -18989,7 +19375,7 @@ func Xsqlite3ErrorWithMsg(tls *libc.TLS, db uintptr, err_code int32, zFormat uin
// stored by this function into the database handle using sqlite3Error().
// Functions sqlite3Error() or sqlite3ErrorWithMsg() should be used
// during statement execution (sqlite3_step() etc.).
-func Xsqlite3ErrorMsg(tls *libc.TLS, pParse uintptr, zFormat uintptr, va uintptr) { /* sqlite3.c:31874:21: */
+func Xsqlite3ErrorMsg(tls *libc.TLS, pParse uintptr, zFormat uintptr, va uintptr) { /* sqlite3.c:32223:21: */
var zMsg uintptr
var ap Va_list
_ = ap
@@ -19011,9 +19397,9 @@ func Xsqlite3ErrorMsg(tls *libc.TLS, pParse uintptr, zFormat uintptr, va uintptr
// If database connection db is currently parsing SQL, then transfer
// error code errCode to that parser if the parser has not already
// encountered some other kind of error.
-func Xsqlite3ErrorToParser(tls *libc.TLS, db uintptr, errCode int32) int32 { /* sqlite3.c:31897:20: */
+func Xsqlite3ErrorToParser(tls *libc.TLS, db uintptr, errCode int32) int32 { /* sqlite3.c:32246:20: */
var pParse uintptr
- if (db == uintptr(0)) || ((libc.AssignUintptr(&pParse, (*Sqlite3)(unsafe.Pointer(db)).FpParse)) == uintptr(0)) {
+ if db == uintptr(0) || libc.AssignUintptr(&pParse, (*Sqlite3)(unsafe.Pointer(db)).FpParse) == uintptr(0) {
return errCode
}
(*Parse)(unsafe.Pointer(pParse)).Frc = errCode
@@ -19036,7 +19422,7 @@ func Xsqlite3ErrorToParser(tls *libc.TLS, db uintptr, errCode int32) int32 { /*
// 2002-02-14: This routine is extended to remove MS-Access style
// brackets from around identifiers. For example: "[a-b-c]" becomes
// "a-b-c".
-func Xsqlite3Dequote(tls *libc.TLS, z uintptr) { /* sqlite3.c:31922:21: */
+func Xsqlite3Dequote(tls *libc.TLS, z uintptr) { /* sqlite3.c:32271:21: */
var quote uint8
var i int32
var j int32
@@ -19044,7 +19430,7 @@ func Xsqlite3Dequote(tls *libc.TLS, z uintptr) { /* sqlite3.c:31922:21: */
return
}
quote = *(*uint8)(unsafe.Pointer(z))
- if !((int32(Xsqlite3CtypeMap[uint8(quote)]) & 0x80) != 0) {
+ if !(int32(Xsqlite3CtypeMap[uint8(quote)])&0x80 != 0) {
return
}
if int32(quote) == '[' {
@@ -19055,7 +19441,7 @@ func Xsqlite3Dequote(tls *libc.TLS, z uintptr) { /* sqlite3.c:31922:21: */
for ; ; i++ {
if int32(*(*uint8)(unsafe.Pointer(z + uintptr(i)))) == int32(quote) {
- if int32(*(*uint8)(unsafe.Pointer(z + uintptr((i + 1))))) == int32(quote) {
+ if int32(*(*uint8)(unsafe.Pointer(z + uintptr(i+1)))) == int32(quote) {
*(*uint8)(unsafe.Pointer(z + uintptr(libc.PostIncInt32(&j, 1)))) = quote
i++
} else {
@@ -19068,19 +19454,45 @@ func Xsqlite3Dequote(tls *libc.TLS, z uintptr) { /* sqlite3.c:31922:21: */
*(*uint8)(unsafe.Pointer(z + uintptr(j))) = uint8(0)
}
-func Xsqlite3DequoteExpr(tls *libc.TLS, p uintptr) { /* sqlite3.c:31944:21: */
+func Xsqlite3DequoteExpr(tls *libc.TLS, p uintptr) { /* sqlite3.c:32293:21: */
- *(*U32)(unsafe.Pointer(p + 4 /* &.flags */)) |= (func() uint32 {
- if int32(*(*uint8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(p + 8 /* &.u */))))) == '"' {
- return (uint32(EP_Quoted | EP_DblQuoted))
+ *(*U32)(unsafe.Pointer(p + 4)) |= func() uint32 {
+ if int32(*(*uint8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(p + 8))))) == '"' {
+ return uint32(EP_Quoted | EP_DblQuoted)
}
return uint32(EP_Quoted)
- }())
- Xsqlite3Dequote(tls, *(*uintptr)(unsafe.Pointer(p + 8 /* &.u */)))
+ }()
+ Xsqlite3Dequote(tls, *(*uintptr)(unsafe.Pointer(p + 8)))
+}
+
+// If the input token p is quoted, try to adjust the token to remove
+// the quotes. This is not always possible:
+//
+// "abc" -> abc
+// "ab""cd" -> (not possible because of the interior "")
+//
+// Remove the quotes if possible. This is a optimization. The overall
+// system should still return the correct answer even if this routine
+// is always a no-op.
+func Xsqlite3DequoteToken(tls *libc.TLS, p uintptr) { /* sqlite3.c:32311:21: */
+ var i uint32
+ if (*Token)(unsafe.Pointer(p)).Fn < uint32(2) {
+ return
+ }
+ if !(int32(Xsqlite3CtypeMap[uint8(*(*uint8)(unsafe.Pointer((*Token)(unsafe.Pointer(p)).Fz)))])&0x80 != 0) {
+ return
+ }
+ for i = uint32(1); i < (*Token)(unsafe.Pointer(p)).Fn-uint32(1); i++ {
+ if int32(Xsqlite3CtypeMap[uint8(*(*uint8)(unsafe.Pointer((*Token)(unsafe.Pointer(p)).Fz + uintptr(i))))])&0x80 != 0 {
+ return
+ }
+ }
+ *(*uint32)(unsafe.Pointer(p + 4)) -= uint32(2)
+ (*Token)(unsafe.Pointer(p)).Fz++
}
// Generate a Token object from a string
-func Xsqlite3TokenInit(tls *libc.TLS, p uintptr, z uintptr) { /* sqlite3.c:31953:21: */
+func Xsqlite3TokenInit(tls *libc.TLS, p uintptr, z uintptr) { /* sqlite3.c:32325:21: */
(*Token)(unsafe.Pointer(p)).Fz = z
(*Token)(unsafe.Pointer(p)).Fn = uint32(Xsqlite3Strlen30(tls, z))
}
@@ -19095,7 +19507,7 @@ func Xsqlite3TokenInit(tls *libc.TLS, p uintptr, z uintptr) { /* sqlite3.c:31953
// the contents of two buffers containing UTF-8 strings in a
// case-independent fashion, using the same definition of "case
// independence" that SQLite uses internally when comparing identifiers.
-func Xsqlite3_stricmp(tls *libc.TLS, zLeft uintptr, zRight uintptr) int32 { /* sqlite3.c:31971:16: */
+func Xsqlite3_stricmp(tls *libc.TLS, zLeft uintptr, zRight uintptr) int32 { /* sqlite3.c:32343:16: */
if zLeft == uintptr(0) {
if zRight != 0 {
return -1
@@ -19107,7 +19519,7 @@ func Xsqlite3_stricmp(tls *libc.TLS, zLeft uintptr, zRight uintptr) int32 { /* s
return Xsqlite3StrICmp(tls, zLeft, zRight)
}
-func Xsqlite3StrICmp(tls *libc.TLS, zLeft uintptr, zRight uintptr) int32 { /* sqlite3.c:31979:20: */
+func Xsqlite3StrICmp(tls *libc.TLS, zLeft uintptr, zRight uintptr) int32 { /* sqlite3.c:32351:20: */
var a uintptr
var b uintptr
var c int32
@@ -19122,7 +19534,7 @@ func Xsqlite3StrICmp(tls *libc.TLS, zLeft uintptr, zRight uintptr) int32 { /* sq
break
}
} else {
- c = (int32(Xsqlite3UpperToLower[c]) - int32(Xsqlite3UpperToLower[x]))
+ c = int32(Xsqlite3UpperToLower[c]) - int32(Xsqlite3UpperToLower[x])
if c != 0 {
break
}
@@ -19133,7 +19545,7 @@ func Xsqlite3StrICmp(tls *libc.TLS, zLeft uintptr, zRight uintptr) int32 { /* sq
return c
}
-func Xsqlite3_strnicmp(tls *libc.TLS, zLeft uintptr, zRight uintptr, N int32) int32 { /* sqlite3.c:31998:16: */
+func Xsqlite3_strnicmp(tls *libc.TLS, zLeft uintptr, zRight uintptr, N int32) int32 { /* sqlite3.c:32370:16: */
var a uintptr
var b uintptr
if zLeft == uintptr(0) {
@@ -19146,24 +19558,24 @@ func Xsqlite3_strnicmp(tls *libc.TLS, zLeft uintptr, zRight uintptr, N int32) in
}
a = zLeft
b = zRight
- for ((libc.PostDecInt32(&N, 1) > 0) && (int32(*(*uint8)(unsafe.Pointer(a))) != 0)) && (int32(Xsqlite3UpperToLower[*(*uint8)(unsafe.Pointer(a))]) == int32(Xsqlite3UpperToLower[*(*uint8)(unsafe.Pointer(b))])) {
+ for libc.PostDecInt32(&N, 1) > 0 && int32(*(*uint8)(unsafe.Pointer(a))) != 0 && int32(Xsqlite3UpperToLower[*(*uint8)(unsafe.Pointer(a))]) == int32(Xsqlite3UpperToLower[*(*uint8)(unsafe.Pointer(b))]) {
a++
b++
}
if N < 0 {
return 0
}
- return (int32(Xsqlite3UpperToLower[*(*uint8)(unsafe.Pointer(a))]) - int32(Xsqlite3UpperToLower[*(*uint8)(unsafe.Pointer(b))]))
+ return int32(Xsqlite3UpperToLower[*(*uint8)(unsafe.Pointer(a))]) - int32(Xsqlite3UpperToLower[*(*uint8)(unsafe.Pointer(b))])
}
// Compute an 8-bit hash on a string that is insensitive to case differences
-func Xsqlite3StrIHash(tls *libc.TLS, z uintptr) U8 { /* sqlite3.c:32014:19: */
+func Xsqlite3StrIHash(tls *libc.TLS, z uintptr) U8 { /* sqlite3.c:32386:19: */
var h U8 = U8(0)
if z == uintptr(0) {
return U8(0)
}
for *(*uint8)(unsafe.Pointer(z)) != 0 {
- h = U8(int32(h) + (int32(Xsqlite3UpperToLower[uint8(*(*uint8)(unsafe.Pointer(z)))])))
+ h = U8(int32(h) + int32(Xsqlite3UpperToLower[uint8(*(*uint8)(unsafe.Pointer(z)))]))
z++
}
return h
@@ -19173,18 +19585,18 @@ func Xsqlite3StrIHash(tls *libc.TLS, z uintptr) U8 { /* sqlite3.c:32014:19: */
// E==2 results in 100. E==50 results in 1.0e50.
//
// This routine only works for values of E between 1 and 341.
-func sqlite3Pow10(tls *libc.TLS, E int32) float64 { /* sqlite3.c:32030:24: */
+func sqlite3Pow10(tls *libc.TLS, E int32) float64 { /* sqlite3.c:32402:24: */
var x float64 = 10.0
var r float64 = 1.0
for 1 != 0 {
- if (E & 1) != 0 {
- r = r * (x)
+ if E&1 != 0 {
+ r = r * x
}
E >>= 1
if E == 0 {
break
}
- x = x * (x)
+ x = x * x
}
return r
}
@@ -19216,7 +19628,7 @@ func sqlite3Pow10(tls *libc.TLS, E int32) float64 { /* sqlite3.c:32030:24: */
// If some prefix of the input string is a valid number, this routine
// returns FALSE but it still converts the prefix and writes the result
// into *pResult.
-func Xsqlite3AtoF(tls *libc.TLS, z uintptr, pResult uintptr, length int32, enc U8) int32 { /* sqlite3.c:32095:20: */
+func Xsqlite3AtoF(tls *libc.TLS, z uintptr, pResult uintptr, length int32, enc U8) int32 { /* sqlite3.c:32467:20: */
var incr int32
var zEnd uintptr
// sign * significand * (10 ^ (esign * exponent))
@@ -19253,20 +19665,20 @@ __1:
goto __2
}
incr = 1
- zEnd = (z + uintptr(length))
+ zEnd = z + uintptr(length)
goto __3
__2:
incr = 2
- length = length & (libc.CplInt32(1))
+ length = length & libc.CplInt32(1)
- i = (3 - int32(enc))
+ i = 3 - int32(enc)
__4:
- if !((i < length) && (int32(*(*uint8)(unsafe.Pointer(z + uintptr(i)))) == 0)) {
+ if !(i < length && int32(*(*uint8)(unsafe.Pointer(z + uintptr(i)))) == 0) {
goto __6
}
goto __5
__5:
- i = i + (2)
+ i = i + 2
goto __4
goto __6
__6:
@@ -19277,14 +19689,14 @@ __6:
eType = -100
__7:
;
- zEnd = (z + uintptr((i ^ 1)))
- z += (uintptr(int32(enc) & 1))
+ zEnd = z + uintptr(i^1)
+ z += uintptr(int32(enc) & 1)
__3:
;
// skip leading spaces
__8:
- if !((z < zEnd) && ((int32(Xsqlite3CtypeMap[uint8(*(*uint8)(unsafe.Pointer(z)))]) & 0x01) != 0)) {
+ if !(z < zEnd && int32(Xsqlite3CtypeMap[uint8(*(*uint8)(unsafe.Pointer(z)))])&0x01 != 0) {
goto __9
}
z += uintptr(incr)
@@ -19317,19 +19729,19 @@ __12:
// copy max significant digits to significand
__14:
- if !((z < zEnd) && ((int32(Xsqlite3CtypeMap[uint8(*(*uint8)(unsafe.Pointer(z)))]) & 0x04) != 0)) {
+ if !(z < zEnd && int32(Xsqlite3CtypeMap[uint8(*(*uint8)(unsafe.Pointer(z)))])&0x04 != 0) {
goto __15
}
- s = ((s * int64(10)) + (I64(int32(*(*uint8)(unsafe.Pointer(z))) - '0')))
+ s = s*int64(10) + I64(int32(*(*uint8)(unsafe.Pointer(z)))-'0')
z += uintptr(incr)
nDigit++
- if !(s >= (((int64(0xffffffff) | (I64((int64(0x7fffffff))) << 32)) - int64(9)) / int64(10))) {
+ if !(s >= (int64(0xffffffff)|I64(int64(0x7fffffff))<<32-int64(9))/int64(10)) {
goto __16
}
// skip non-significant significand digits
// (increase exponent by d to shift decimal left)
__17:
- if !((z < zEnd) && ((int32(Xsqlite3CtypeMap[uint8(*(*uint8)(unsafe.Pointer(z)))]) & 0x04) != 0)) {
+ if !(z < zEnd && int32(Xsqlite3CtypeMap[uint8(*(*uint8)(unsafe.Pointer(z)))])&0x04 != 0) {
goto __18
}
z += uintptr(incr)
@@ -19358,13 +19770,13 @@ __19:
// copy digits from after decimal to significand
// (decrease exponent by d to shift decimal right)
__21:
- if !((z < zEnd) && ((int32(Xsqlite3CtypeMap[uint8(*(*uint8)(unsafe.Pointer(z)))]) & 0x04) != 0)) {
+ if !(z < zEnd && int32(Xsqlite3CtypeMap[uint8(*(*uint8)(unsafe.Pointer(z)))])&0x04 != 0) {
goto __22
}
- if !(s < (((int64(0xffffffff) | (I64((int64(0x7fffffff))) << 32)) - int64(9)) / int64(10))) {
+ if !(s < (int64(0xffffffff)|I64(int64(0x7fffffff))<<32-int64(9))/int64(10)) {
goto __23
}
- s = ((s * int64(10)) + (I64(int32(*(*uint8)(unsafe.Pointer(z))) - '0')))
+ s = s*int64(10) + I64(int32(*(*uint8)(unsafe.Pointer(z)))-'0')
d--
nDigit++
__23:
@@ -19383,7 +19795,7 @@ __24:
;
// if exponent is present
- if !((int32(*(*uint8)(unsafe.Pointer(z))) == 'e') || (int32(*(*uint8)(unsafe.Pointer(z))) == 'E')) {
+ if !(int32(*(*uint8)(unsafe.Pointer(z))) == 'e' || int32(*(*uint8)(unsafe.Pointer(z))) == 'E') {
goto __25
}
z += uintptr(incr)
@@ -19418,11 +19830,11 @@ __28:
;
// copy digits to exponent
__30:
- if !((z < zEnd) && ((int32(Xsqlite3CtypeMap[uint8(*(*uint8)(unsafe.Pointer(z)))]) & 0x04) != 0)) {
+ if !(z < zEnd && int32(Xsqlite3CtypeMap[uint8(*(*uint8)(unsafe.Pointer(z)))])&0x04 != 0) {
goto __31
}
if e < 10000 {
- e = ((e * 10) + (int32(*(*uint8)(unsafe.Pointer(z))) - '0'))
+ e = e*10 + (int32(*(*uint8)(unsafe.Pointer(z))) - '0')
} else {
e = 10000
}
@@ -19436,7 +19848,7 @@ __25:
// skip trailing spaces
__32:
- if !((z < zEnd) && ((int32(Xsqlite3CtypeMap[uint8(*(*uint8)(unsafe.Pointer(z)))]) & 0x01) != 0)) {
+ if !(z < zEnd && int32(Xsqlite3CtypeMap[uint8(*(*uint8)(unsafe.Pointer(z)))])&0x01 != 0) {
goto __33
}
z += uintptr(incr)
@@ -19446,12 +19858,12 @@ __33:
do_atof_calc:
// adjust exponent by d, and update sign
- e = ((e * esign) + d)
+ e = e*esign + d
if !(e < 0) {
goto __34
}
esign = -1
- e = e * (-1)
+ e = e * -1
goto __35
__34:
esign = 1
@@ -19481,22 +19893,22 @@ __38:
if !(esign > 0) {
goto __40
}
- if !(s >= ((int64(0xffffffff) | (I64((int64(0x7fffffff))) << 32)) / int64(10))) {
+ if !(s >= (int64(0xffffffff)|I64(int64(0x7fffffff))<<32)/int64(10)) {
goto __42
}
goto __39
__42:
; //OPTIMIZATION-IF-FALSE
- s = s * (int64(10))
+ s = s * int64(10)
goto __41
__40:
- if !((s % int64(10)) != int64(0)) {
+ if !(s%int64(10) != int64(0)) {
goto __43
}
goto __39
__43:
; //OPTIMIZATION-IF-FALSE
- s = s / (int64(10))
+ s = s / int64(10)
__41:
;
e--
@@ -19524,16 +19936,16 @@ __44:
if !(e < 342) {
goto __48
} //OPTIMIZATION-IF-TRUE
- scale = sqlite3Pow10(tls, (e - 308))
+ scale = sqlite3Pow10(tls, e-308)
if !(esign < 0) {
goto __50
}
- result = (float64(s) / scale)
- result = result / (1.0e+308)
+ result = float64(s) / scale
+ result = result / 1.0e+308
goto __51
__50:
- result = (float64(s) * scale)
- result = result * (1.0e+308)
+ result = float64(s) * scale
+ result = result * 1.0e+308
__51:
;
goto __49
@@ -19542,10 +19954,10 @@ __48:
if !(esign < 0) {
goto __52
}
- result = (0.0 * float64(s))
+ result = 0.0 * float64(s)
goto __53
__52:
- result = (float64((libc.X__builtin_inff(tls)) * float32(s)))
+ result = float64(libc.X__builtin_inff(tls) * float32(s))
__53:
;
__49:
@@ -19556,10 +19968,10 @@ __46:
if !(esign < 0) {
goto __54
}
- result = (float64(s) / scale1)
+ result = float64(s) / scale1
goto __55
__54:
- result = (float64(s) * scale1)
+ result = float64(s) * scale1
__55:
;
__47:
@@ -19573,13 +19985,13 @@ __37:
*(*float64)(unsafe.Pointer(pResult)) = result
// return true if number and no extra non-whitespace chracters after
- if !((((z == zEnd) && (nDigit > 0)) && (eValid != 0)) && (eType > 0)) {
+ if !(z == zEnd && nDigit > 0 && eValid != 0 && eType > 0) {
goto __56
}
return eType
goto __57
__56:
- if !(((eType >= 2) && ((eType == 3) || (eValid != 0))) && (nDigit > 0)) {
+ if !(eType >= 2 && (eType == 3 || eValid != 0) && nDigit > 0) {
goto __58
}
return -1
@@ -19596,7 +20008,7 @@ __57:
// Render an signed 64-bit integer as text. Store the result in zOut[].
//
// The caller must ensure that zOut[] is at least 21 bytes in size.
-func Xsqlite3Int64ToText(tls *libc.TLS, v I64, zOut uintptr) { /* sqlite3.c:32294:21: */
+func Xsqlite3Int64ToText(tls *libc.TLS, v I64, zOut uintptr) { /* sqlite3.c:32666:21: */
bp := tls.Alloc(22)
defer tls.Free(22)
@@ -19605,24 +20017,24 @@ func Xsqlite3Int64ToText(tls *libc.TLS, v I64, zOut uintptr) { /* sqlite3.c:3229
// var zTemp [22]uint8 at bp, 22
if v < int64(0) {
- if v == ((int64(-1)) - (int64(0xffffffff) | (I64((int64(0x7fffffff))) << 32))) {
- x = (U64((uint64(1))) << 63)
+ if v == int64(-1)-(int64(0xffffffff)|I64(int64(0x7fffffff))<<32) {
+ x = U64(uint64(1)) << 63
} else {
x = U64(-v)
}
} else {
x = U64(v)
}
- i = (int32(uint32(unsafe.Sizeof([22]uint8{})) - uint32(2)))
+ i = int32(uint32(unsafe.Sizeof([22]uint8{})) - uint32(2))
*(*uint8)(unsafe.Pointer(bp /* &zTemp[0] */ + 21)) = uint8(0)
for ok := true; ok; ok = x != 0 {
- *(*uint8)(unsafe.Pointer(bp /* &zTemp[0] */ + uintptr(libc.PostDecInt32(&i, 1)))) = (uint8((x % uint64(10)) + uint64('0')))
- x = (x / uint64(10))
+ *(*uint8)(unsafe.Pointer(bp /* &zTemp[0] */ + uintptr(libc.PostDecInt32(&i, 1)))) = uint8(x%uint64(10) + uint64('0'))
+ x = x / uint64(10)
}
if v < int64(0) {
*(*uint8)(unsafe.Pointer(bp /* &zTemp[0] */ + uintptr(libc.PostDecInt32(&i, 1)))) = uint8('-')
}
- libc.Xmemcpy(tls, zOut, (bp /* &zTemp */ + uintptr((i + 1))), ((uint32(unsafe.Sizeof([22]uint8{})) - uint32(1)) - uint32(i)))
+ libc.Xmemcpy(tls, zOut, bp+uintptr(i+1), uint32(unsafe.Sizeof([22]uint8{}))-uint32(1)-uint32(i))
}
// Compare the 19-character string zNum against the text representation
@@ -19637,16 +20049,16 @@ func Xsqlite3Int64ToText(tls *libc.TLS, v I64, zOut uintptr) { /* sqlite3.c:3229
// compare2pow63("9223372036854775800", 1)
//
// will return -8.
-func compare2pow63(tls *libc.TLS, zNum uintptr, incr int32) int32 { /* sqlite3.c:32327:12: */
+func compare2pow63(tls *libc.TLS, zNum uintptr, incr int32) int32 { /* sqlite3.c:32699:12: */
var c int32 = 0
var i int32
// 012345678901234567
- var pow63 uintptr = ts + 791 /* "9223372036854775..." */
- for i = 0; (c == 0) && (i < 18); i++ {
- c = ((int32(*(*uint8)(unsafe.Pointer(zNum + uintptr((i * incr))))) - int32(*(*uint8)(unsafe.Pointer(pow63 + uintptr(i))))) * 10)
+ var pow63 uintptr = ts + 1579 /* "9223372036854775..." */
+ for i = 0; c == 0 && i < 18; i++ {
+ c = (int32(*(*uint8)(unsafe.Pointer(zNum + uintptr(i*incr)))) - int32(*(*uint8)(unsafe.Pointer(pow63 + uintptr(i))))) * 10
}
if c == 0 {
- c = (int32(*(*uint8)(unsafe.Pointer(zNum + uintptr((18 * incr))))) - '8')
+ c = int32(*(*uint8)(unsafe.Pointer(zNum + uintptr(18*incr)))) - '8'
}
return c
@@ -19666,7 +20078,7 @@ func compare2pow63(tls *libc.TLS, zNum uintptr, incr int32) int32 { /* sqlite3.c
// length is the number of bytes in the string (bytes, not characters).
// The string is not necessarily zero-terminated. The encoding is
// given by enc.
-func Xsqlite3Atoi64(tls *libc.TLS, zNum uintptr, pNum uintptr, length int32, enc U8) int32 { /* sqlite3.c:32360:20: */
+func Xsqlite3Atoi64(tls *libc.TLS, zNum uintptr, pNum uintptr, length int32, enc U8) int32 { /* sqlite3.c:32732:20: */
var incr int32
var u U64 = uint64(0)
var neg int32 = 0 // assume positive
@@ -19675,21 +20087,21 @@ func Xsqlite3Atoi64(tls *libc.TLS, zNum uintptr, pNum uintptr, length int32, enc
var nonNum int32 = 0 // True if input contains UTF16 with high byte non-zero
var rc int32 // Baseline return code
var zStart uintptr
- var zEnd uintptr = (zNum + uintptr(length))
+ var zEnd uintptr = zNum + uintptr(length)
if int32(enc) == SQLITE_UTF8 {
incr = 1
} else {
incr = 2
- length = length & (libc.CplInt32(1))
+ length = length & libc.CplInt32(1)
- for i = (3 - int32(enc)); (i < length) && (int32(*(*uint8)(unsafe.Pointer(zNum + uintptr(i)))) == 0); i = i + (2) {
+ for i = 3 - int32(enc); i < length && int32(*(*uint8)(unsafe.Pointer(zNum + uintptr(i)))) == 0; i = i + 2 {
}
- nonNum = (libc.Bool32(i < length))
- zEnd = (zNum + uintptr((i ^ 1)))
- zNum += (uintptr(int32(enc) & 1))
+ nonNum = libc.Bool32(i < length)
+ zEnd = zNum + uintptr(i^1)
+ zNum += uintptr(int32(enc) & 1)
}
- for (zNum < zEnd) && ((int32(Xsqlite3CtypeMap[uint8(*(*uint8)(unsafe.Pointer(zNum)))]) & 0x01) != 0) {
+ for zNum < zEnd && int32(Xsqlite3CtypeMap[uint8(*(*uint8)(unsafe.Pointer(zNum)))])&0x01 != 0 {
zNum += uintptr(incr)
}
if zNum < zEnd {
@@ -19701,23 +20113,23 @@ func Xsqlite3Atoi64(tls *libc.TLS, zNum uintptr, pNum uintptr, length int32, enc
}
}
zStart = zNum
- for (zNum < zEnd) && (int32(*(*uint8)(unsafe.Pointer(zNum))) == '0') {
+ for zNum < zEnd && int32(*(*uint8)(unsafe.Pointer(zNum))) == '0' {
zNum += uintptr(incr)
} // Skip leading zeros.
- for i = 0; (((zNum + uintptr(i)) < zEnd) && ((libc.AssignInt32(&c, int32(*(*uint8)(unsafe.Pointer(zNum + uintptr(i)))))) >= '0')) && (c <= '9'); i = i + (incr) {
- u = (((u * uint64(10)) + U64(c)) - uint64('0'))
+ for i = 0; zNum+uintptr(i) < zEnd && libc.AssignInt32(&c, int32(*(*uint8)(unsafe.Pointer(zNum + uintptr(i))))) >= '0' && c <= '9'; i = i + incr {
+ u = u*uint64(10) + U64(c) - uint64('0')
}
- if u > (uint64(int64(0xffffffff) | (I64((int64(0x7fffffff))) << 32))) {
+ if u > uint64(int64(0xffffffff)|I64(int64(0x7fffffff))<<32) {
// This test and assignment is needed only to suppress UB warnings
// from clang and -fsanitize=undefined. This test and assignment make
// the code a little larger and slower, and no harm comes from omitting
// them, but we must appaise the undefined-behavior pharisees.
*(*I64)(unsafe.Pointer(pNum)) = func() int64 {
if neg != 0 {
- return ((int64(-1)) - (int64(0xffffffff) | (I64((int64(0x7fffffff))) << 32)))
+ return int64(-1) - (int64(0xffffffff) | I64(int64(0x7fffffff))<<32)
}
- return (int64(0xffffffff) | (I64((int64(0x7fffffff))) << 32))
+ return int64(0xffffffff) | I64(int64(0x7fffffff))<<32
}()
} else if neg != 0 {
*(*I64)(unsafe.Pointer(pNum)) = -I64(u)
@@ -19725,27 +20137,27 @@ func Xsqlite3Atoi64(tls *libc.TLS, zNum uintptr, pNum uintptr, length int32, enc
*(*I64)(unsafe.Pointer(pNum)) = I64(u)
}
rc = 0
- if (i == 0) && (zStart == zNum) { // No digits
+ if i == 0 && zStart == zNum { // No digits
rc = -1
} else if nonNum != 0 { // UTF16 with high-order bytes non-zero
rc = 1
- } else if (zNum + uintptr(i)) < zEnd { // Extra bytes at the end
+ } else if zNum+uintptr(i) < zEnd { // Extra bytes at the end
var jj int32 = i
- for ok := true; ok; ok = ((zNum + uintptr(jj)) < zEnd) {
- if !((int32(Xsqlite3CtypeMap[uint8(*(*uint8)(unsafe.Pointer(zNum + uintptr(jj))))]) & 0x01) != 0) {
+ for ok := true; ok; ok = zNum+uintptr(jj) < zEnd {
+ if !(int32(Xsqlite3CtypeMap[uint8(*(*uint8)(unsafe.Pointer(zNum + uintptr(jj))))])&0x01 != 0) {
rc = 1 // Extra non-space text after the integer
break
}
- jj = jj + (incr)
+ jj = jj + incr
}
}
- if i < (19 * incr) {
+ if i < 19*incr {
// Less than 19 digits, so we know that it fits in 64 bits
return rc
} else {
// zNum is a 19-digit numbers. Compare it against 9223372036854775808.
- if i > (19 * incr) {
+ if i > 19*incr {
c = 1
} else {
c = compare2pow63(tls, zNum, incr)
@@ -19757,9 +20169,9 @@ func Xsqlite3Atoi64(tls *libc.TLS, zNum uintptr, pNum uintptr, length int32, enc
} else {
*(*I64)(unsafe.Pointer(pNum)) = func() int64 {
if neg != 0 {
- return ((int64(-1)) - (int64(0xffffffff) | (I64((int64(0x7fffffff))) << 32)))
+ return int64(-1) - (int64(0xffffffff) | I64(int64(0x7fffffff))<<32)
}
- return (int64(0xffffffff) | (I64((int64(0x7fffffff))) << 32))
+ return int64(0xffffffff) | I64(int64(0x7fffffff))<<32
}()
if c > 0 {
// zNum is greater than 9223372036854775808 so it overflows
@@ -19788,22 +20200,22 @@ func Xsqlite3Atoi64(tls *libc.TLS, zNum uintptr, pNum uintptr, length int32, enc
// 1 Excess text after the integer value
// 2 Integer too large for a 64-bit signed integer or is malformed
// 3 Special case of 9223372036854775808
-func Xsqlite3DecOrHexToI64(tls *libc.TLS, z uintptr, pOut uintptr) int32 { /* sqlite3.c:32463:20: */
+func Xsqlite3DecOrHexToI64(tls *libc.TLS, z uintptr, pOut uintptr) int32 { /* sqlite3.c:32835:20: */
bp := tls.Alloc(8)
defer tls.Free(8)
- if (int32(*(*uint8)(unsafe.Pointer(z))) == '0') &&
- ((int32(*(*uint8)(unsafe.Pointer(z + 1))) == 'x') || (int32(*(*uint8)(unsafe.Pointer(z + 1))) == 'X')) {
+ if int32(*(*uint8)(unsafe.Pointer(z))) == '0' &&
+ (int32(*(*uint8)(unsafe.Pointer(z + 1))) == 'x' || int32(*(*uint8)(unsafe.Pointer(z + 1))) == 'X') {
*(*U64)(unsafe.Pointer(bp /* u */)) = uint64(0)
var i int32
var k int32
for i = 2; int32(*(*uint8)(unsafe.Pointer(z + uintptr(i)))) == '0'; i++ {
}
- for k = i; (int32(Xsqlite3CtypeMap[uint8(*(*uint8)(unsafe.Pointer(z + uintptr(k))))]) & 0x08) != 0; k++ {
- *(*U64)(unsafe.Pointer(bp /* u */)) = ((*(*U64)(unsafe.Pointer(bp /* u */)) * uint64(16)) + U64(Xsqlite3HexToInt(tls, int32(*(*uint8)(unsafe.Pointer(z + uintptr(k)))))))
+ for k = i; int32(Xsqlite3CtypeMap[uint8(*(*uint8)(unsafe.Pointer(z + uintptr(k))))])&0x08 != 0; k++ {
+ *(*U64)(unsafe.Pointer(bp /* u */)) = *(*U64)(unsafe.Pointer(bp))*uint64(16) + U64(Xsqlite3HexToInt(tls, int32(*(*uint8)(unsafe.Pointer(z + uintptr(k))))))
}
libc.Xmemcpy(tls, pOut, bp /* &u */, uint32(8))
- if (int32(*(*uint8)(unsafe.Pointer(z + uintptr(k)))) == 0) && ((k - i) <= 16) {
+ if int32(*(*uint8)(unsafe.Pointer(z + uintptr(k)))) == 0 && k-i <= 16 {
return 0
}
return 2
@@ -19821,7 +20233,7 @@ func Xsqlite3DecOrHexToI64(tls *libc.TLS, z uintptr, pOut uintptr) int32 { /* sq
// Any non-numeric characters that following zNum are ignored.
// This is different from sqlite3Atoi64() which requires the
// input number to be zero-terminated.
-func Xsqlite3GetInt32(tls *libc.TLS, zNum uintptr, pValue uintptr) int32 { /* sqlite3.c:32493:20: */
+func Xsqlite3GetInt32(tls *libc.TLS, zNum uintptr, pValue uintptr) int32 { /* sqlite3.c:32865:20: */
bp := tls.Alloc(4)
defer tls.Free(4)
@@ -19834,32 +20246,32 @@ func Xsqlite3GetInt32(tls *libc.TLS, zNum uintptr, pValue uintptr) int32 { /* sq
zNum++
} else if int32(*(*uint8)(unsafe.Pointer(zNum))) == '+' {
zNum++
- } else if ((int32(*(*uint8)(unsafe.Pointer(zNum))) == '0') &&
- ((int32(*(*uint8)(unsafe.Pointer(zNum + 1))) == 'x') || (int32(*(*uint8)(unsafe.Pointer(zNum + 1))) == 'X'))) &&
- ((int32(Xsqlite3CtypeMap[uint8(*(*uint8)(unsafe.Pointer(zNum + 2)))]) & 0x08) != 0) {
+ } else if int32(*(*uint8)(unsafe.Pointer(zNum))) == '0' &&
+ (int32(*(*uint8)(unsafe.Pointer(zNum + 1))) == 'x' || int32(*(*uint8)(unsafe.Pointer(zNum + 1))) == 'X') &&
+ int32(Xsqlite3CtypeMap[uint8(*(*uint8)(unsafe.Pointer(zNum + 2)))])&0x08 != 0 {
*(*U32)(unsafe.Pointer(bp /* u */)) = U32(0)
zNum += uintptr(2)
for int32(*(*uint8)(unsafe.Pointer(zNum))) == '0' {
zNum++
}
- for i = 0; ((int32(Xsqlite3CtypeMap[uint8(*(*uint8)(unsafe.Pointer(zNum + uintptr(i))))]) & 0x08) != 0) && (i < 8); i++ {
- *(*U32)(unsafe.Pointer(bp /* u */)) = ((*(*U32)(unsafe.Pointer(bp /* u */)) * U32(16)) + U32(Xsqlite3HexToInt(tls, int32(*(*uint8)(unsafe.Pointer(zNum + uintptr(i)))))))
+ for i = 0; int32(Xsqlite3CtypeMap[uint8(*(*uint8)(unsafe.Pointer(zNum + uintptr(i))))])&0x08 != 0 && i < 8; i++ {
+ *(*U32)(unsafe.Pointer(bp /* u */)) = *(*U32)(unsafe.Pointer(bp))*U32(16) + U32(Xsqlite3HexToInt(tls, int32(*(*uint8)(unsafe.Pointer(zNum + uintptr(i))))))
}
- if ((*(*U32)(unsafe.Pointer(bp /* u */)) & 0x80000000) == U32(0)) && ((int32(Xsqlite3CtypeMap[uint8(*(*uint8)(unsafe.Pointer(zNum + uintptr(i))))]) & 0x08) == 0) {
+ if *(*U32)(unsafe.Pointer(bp))&0x80000000 == U32(0) && int32(Xsqlite3CtypeMap[uint8(*(*uint8)(unsafe.Pointer(zNum + uintptr(i))))])&0x08 == 0 {
libc.Xmemcpy(tls, pValue, bp /* &u */, uint32(4))
return 1
} else {
return 0
}
}
- if !((int32(Xsqlite3CtypeMap[uint8(*(*uint8)(unsafe.Pointer(zNum)))]) & 0x04) != 0) {
+ if !(int32(Xsqlite3CtypeMap[uint8(*(*uint8)(unsafe.Pointer(zNum)))])&0x04 != 0) {
return 0
}
for int32(*(*uint8)(unsafe.Pointer(zNum))) == '0' {
zNum++
}
- for i = 0; ((i < 11) && ((libc.AssignInt32(&c, (int32(*(*uint8)(unsafe.Pointer(zNum + uintptr(i)))) - '0'))) >= 0)) && (c <= 9); i++ {
- v = ((v * int64(10)) + Sqlite_int64(c))
+ for i = 0; i < 11 && libc.AssignInt32(&c, int32(*(*uint8)(unsafe.Pointer(zNum + uintptr(i))))-'0') >= 0 && c <= 9; i++ {
+ v = v*int64(10) + Sqlite_int64(c)
}
// The longest decimal representation of a 32 bit integer is 10 digits:
@@ -19871,7 +20283,7 @@ func Xsqlite3GetInt32(tls *libc.TLS, zNum uintptr, pValue uintptr) int32 { /* sq
return 0
}
- if (v - Sqlite_int64(neg)) > int64(2147483647) {
+ if v-Sqlite_int64(neg) > int64(2147483647) {
return 0
}
if neg != 0 {
@@ -19883,7 +20295,7 @@ func Xsqlite3GetInt32(tls *libc.TLS, zNum uintptr, pValue uintptr) int32 { /* sq
// Return a 32-bit integer value extracted from a string. If the
// string is not an integer, just return 0.
-func Xsqlite3Atoi(tls *libc.TLS, z uintptr) int32 { /* sqlite3.c:32552:20: */
+func Xsqlite3Atoi(tls *libc.TLS, z uintptr) int32 { /* sqlite3.c:32924:20: */
bp := tls.Alloc(4)
defer tls.Free(4)
@@ -19896,17 +20308,17 @@ func Xsqlite3Atoi(tls *libc.TLS, z uintptr) int32 { /* sqlite3.c:32552:20: */
// success and false if there is an error.
//
// Only decimal notation is accepted.
-func Xsqlite3GetUInt32(tls *libc.TLS, z uintptr, pI uintptr) int32 { /* sqlite3.c:32564:20: */
+func Xsqlite3GetUInt32(tls *libc.TLS, z uintptr, pI uintptr) int32 { /* sqlite3.c:32936:20: */
var v U64 = uint64(0)
var i int32
- for i = 0; (int32(Xsqlite3CtypeMap[uint8(*(*uint8)(unsafe.Pointer(z + uintptr(i))))]) & 0x04) != 0; i++ {
- v = (((v * uint64(10)) + U64(*(*uint8)(unsafe.Pointer(z + uintptr(i))))) - uint64('0'))
+ for i = 0; int32(Xsqlite3CtypeMap[uint8(*(*uint8)(unsafe.Pointer(z + uintptr(i))))])&0x04 != 0; i++ {
+ v = v*uint64(10) + U64(*(*uint8)(unsafe.Pointer(z + uintptr(i)))) - uint64('0')
if v > uint64(4294967296) {
*(*U32)(unsafe.Pointer(pI)) = U32(0)
return 0
}
}
- if (i == 0) || (int32(*(*uint8)(unsafe.Pointer(z + uintptr(i)))) != 0) {
+ if i == 0 || int32(*(*uint8)(unsafe.Pointer(z + uintptr(i)))) != 0 {
*(*U32)(unsafe.Pointer(pI)) = U32(0)
return 0
}
@@ -19939,7 +20351,7 @@ func Xsqlite3GetUInt32(tls *libc.TLS, z uintptr, pI uintptr) int32 { /* sqlite3.
// for all bytes that have the 8th bit set and one byte with the 8th
// bit clear. Except, if we get to the 9th byte, it stores the full
// 8 bits and is the last byte.
-func putVarint64(tls *libc.TLS, p uintptr, v U64) int32 { /* sqlite3.c:32605:28: */
+func putVarint64(tls *libc.TLS, p uintptr, v U64) int32 { /* sqlite3.c:32977:28: */
bp := tls.Alloc(10)
defer tls.Free(10)
@@ -19948,24 +20360,24 @@ func putVarint64(tls *libc.TLS, p uintptr, v U64) int32 { /* sqlite3.c:32605:28:
var n int32
// var buf [10]U8 at bp, 10
- if (v & (U64((uint64(0xff000000))) << 32)) != 0 {
+ if v&(U64(uint64(0xff000000))<<32) != 0 {
*(*uint8)(unsafe.Pointer(p + 8)) = U8(v)
v >>= 8
for i = 7; i >= 0; i-- {
- *(*uint8)(unsafe.Pointer(p + uintptr(i))) = (U8((v & uint64(0x7f)) | uint64(0x80)))
+ *(*uint8)(unsafe.Pointer(p + uintptr(i))) = U8(v&uint64(0x7f) | uint64(0x80))
v >>= 7
}
return 9
}
n = 0
- for ok := true; ok; ok = (v != uint64(0)) {
- *(*U8)(unsafe.Pointer(bp /* &buf[0] */ + uintptr(libc.PostIncInt32(&n, 1)))) = (U8((v & uint64(0x7f)) | uint64(0x80)))
+ for ok := true; ok; ok = v != uint64(0) {
+ *(*U8)(unsafe.Pointer(bp /* &buf[0] */ + uintptr(libc.PostIncInt32(&n, 1)))) = U8(v&uint64(0x7f) | uint64(0x80))
v >>= 7
}
- *(*U8)(unsafe.Pointer(bp /* &buf */)) &= U8((0x7f))
+ *(*U8)(unsafe.Pointer(bp)) &= U8(0x7f)
i = 0
- j = (n - 1)
+ j = n - 1
__1:
if !(j >= 0) {
goto __3
@@ -19985,14 +20397,14 @@ __3:
return n
}
-func Xsqlite3PutVarint(tls *libc.TLS, p uintptr, v U64) int32 { /* sqlite3.c:32629:20: */
+func Xsqlite3PutVarint(tls *libc.TLS, p uintptr, v U64) int32 { /* sqlite3.c:33001:20: */
if v <= uint64(0x7f) {
- *(*uint8)(unsafe.Pointer(p)) = (uint8(v & uint64(0x7f)))
+ *(*uint8)(unsafe.Pointer(p)) = uint8(v & uint64(0x7f))
return 1
}
if v <= uint64(0x3fff) {
- *(*uint8)(unsafe.Pointer(p)) = (uint8(((v >> 7) & uint64(0x7f)) | uint64(0x80)))
- *(*uint8)(unsafe.Pointer(p + 1)) = (uint8(v & uint64(0x7f)))
+ *(*uint8)(unsafe.Pointer(p)) = uint8(v>>7&uint64(0x7f) | uint64(0x80))
+ *(*uint8)(unsafe.Pointer(p + 1)) = uint8(v & uint64(0x7f))
return 2
}
return putVarint64(tls, p, v)
@@ -20008,48 +20420,48 @@ func Xsqlite3PutVarint(tls *libc.TLS, p uintptr, v U64) int32 { /* sqlite3.c:326
// Read a 64-bit variable-length integer from memory starting at p[0].
// Return the number of bytes read. The value is stored in *v.
-func Xsqlite3GetVarint(tls *libc.TLS, p uintptr, v uintptr) U8 { /* sqlite3.c:32659:19: */
+func Xsqlite3GetVarint(tls *libc.TLS, p uintptr, v uintptr) U8 { /* sqlite3.c:33031:19: */
var a U32
var b U32
var s U32
- if int32(*(*int8)(unsafe.Pointer((p)))) >= 0 {
+ if int32(*(*int8)(unsafe.Pointer(p))) >= 0 {
*(*U64)(unsafe.Pointer(v)) = U64(*(*uint8)(unsafe.Pointer(p)))
return U8(1)
}
- if int32(*(*int8)(unsafe.Pointer((p) + 1))) >= 0 {
- *(*U64)(unsafe.Pointer(v)) = (U64(((U32(int32(*(*uint8)(unsafe.Pointer(p))) & 0x7f)) << 7) | U32(*(*uint8)(unsafe.Pointer(p + 1)))))
+ if int32(*(*int8)(unsafe.Pointer(p + 1))) >= 0 {
+ *(*U64)(unsafe.Pointer(v)) = U64(U32(int32(*(*uint8)(unsafe.Pointer(p)))&0x7f)<<7 | U32(*(*uint8)(unsafe.Pointer(p + 1))))
return U8(2)
}
// Verify that constants are precomputed correctly
- a = ((U32(*(*uint8)(unsafe.Pointer(p)))) << 14)
+ a = U32(*(*uint8)(unsafe.Pointer(p))) << 14
b = U32(*(*uint8)(unsafe.Pointer(p + 1)))
p += uintptr(2)
- a = a | (U32(*(*uint8)(unsafe.Pointer(p))))
+ a = a | U32(*(*uint8)(unsafe.Pointer(p)))
// a: p0<<14 | p2 (unmasked)
- if !((a & U32(0x80)) != 0) {
- a = a & (U32(SLOT_2_0))
- b = b & (U32(0x7f))
- b = (b << 7)
- a = a | (b)
+ if !(a&U32(0x80) != 0) {
+ a = a & U32(SLOT_2_0)
+ b = b & U32(0x7f)
+ b = b << 7
+ a = a | b
*(*U64)(unsafe.Pointer(v)) = U64(a)
return U8(3)
}
// CSE1 from below
- a = a & (U32(SLOT_2_0))
+ a = a & U32(SLOT_2_0)
p++
- b = (b << 14)
- b = b | (U32(*(*uint8)(unsafe.Pointer(p))))
+ b = b << 14
+ b = b | U32(*(*uint8)(unsafe.Pointer(p)))
// b: p1<<14 | p3 (unmasked)
- if !((b & U32(0x80)) != 0) {
- b = b & (U32(SLOT_2_0))
+ if !(b&U32(0x80) != 0) {
+ b = b & U32(SLOT_2_0)
// moved CSE1 up
// a &= (0x7f<<14)|(0x7f);
- a = (a << 7)
- a = a | (b)
+ a = a << 7
+ a = a | b
*(*U64)(unsafe.Pointer(v)) = U64(a)
return U8(4)
}
@@ -20059,95 +20471,95 @@ func Xsqlite3GetVarint(tls *libc.TLS, p uintptr, v uintptr) U8 { /* sqlite3.c:32
// 1:save off p0<<21 | p1<<14 | p2<<7 | p3 (masked)
// moved CSE1 up
// a &= (0x7f<<14)|(0x7f);
- b = b & (U32(SLOT_2_0))
+ b = b & U32(SLOT_2_0)
s = a
// s: p0<<14 | p2 (masked)
p++
- a = (a << 14)
- a = a | (U32(*(*uint8)(unsafe.Pointer(p))))
+ a = a << 14
+ a = a | U32(*(*uint8)(unsafe.Pointer(p)))
// a: p0<<28 | p2<<14 | p4 (unmasked)
- if !((a & U32(0x80)) != 0) {
+ if !(a&U32(0x80) != 0) {
// we can skip these cause they were (effectively) done above
// while calculating s
// a &= (0x7f<<28)|(0x7f<<14)|(0x7f);
// b &= (0x7f<<14)|(0x7f);
- b = (b << 7)
- a = a | (b)
- s = (s >> 18)
- *(*U64)(unsafe.Pointer(v)) = (((U64(s)) << 32) | U64(a))
+ b = b << 7
+ a = a | b
+ s = s >> 18
+ *(*U64)(unsafe.Pointer(v)) = U64(s)<<32 | U64(a)
return U8(5)
}
// 2:save off p0<<21 | p1<<14 | p2<<7 | p3 (masked)
- s = (s << 7)
- s = s | (b)
+ s = s << 7
+ s = s | b
// s: p0<<21 | p1<<14 | p2<<7 | p3 (masked)
p++
- b = (b << 14)
- b = b | (U32(*(*uint8)(unsafe.Pointer(p))))
+ b = b << 14
+ b = b | U32(*(*uint8)(unsafe.Pointer(p)))
// b: p1<<28 | p3<<14 | p5 (unmasked)
- if !((b & U32(0x80)) != 0) {
+ if !(b&U32(0x80) != 0) {
// we can skip this cause it was (effectively) done above in calc'ing s
// b &= (0x7f<<28)|(0x7f<<14)|(0x7f);
- a = a & (U32(SLOT_2_0))
- a = (a << 7)
- a = a | (b)
- s = (s >> 18)
- *(*U64)(unsafe.Pointer(v)) = (((U64(s)) << 32) | U64(a))
+ a = a & U32(SLOT_2_0)
+ a = a << 7
+ a = a | b
+ s = s >> 18
+ *(*U64)(unsafe.Pointer(v)) = U64(s)<<32 | U64(a)
return U8(6)
}
p++
- a = (a << 14)
- a = a | (U32(*(*uint8)(unsafe.Pointer(p))))
+ a = a << 14
+ a = a | U32(*(*uint8)(unsafe.Pointer(p)))
// a: p2<<28 | p4<<14 | p6 (unmasked)
- if !((a & U32(0x80)) != 0) {
- a = a & (SLOT_4_2_0)
- b = b & (U32(SLOT_2_0))
- b = (b << 7)
- a = a | (b)
- s = (s >> 11)
- *(*U64)(unsafe.Pointer(v)) = (((U64(s)) << 32) | U64(a))
+ if !(a&U32(0x80) != 0) {
+ a = a & SLOT_4_2_0
+ b = b & U32(SLOT_2_0)
+ b = b << 7
+ a = a | b
+ s = s >> 11
+ *(*U64)(unsafe.Pointer(v)) = U64(s)<<32 | U64(a)
return U8(7)
}
// CSE2 from below
- a = a & (U32(SLOT_2_0))
+ a = a & U32(SLOT_2_0)
p++
- b = (b << 14)
- b = b | (U32(*(*uint8)(unsafe.Pointer(p))))
+ b = b << 14
+ b = b | U32(*(*uint8)(unsafe.Pointer(p)))
// b: p3<<28 | p5<<14 | p7 (unmasked)
- if !((b & U32(0x80)) != 0) {
- b = b & (SLOT_4_2_0)
+ if !(b&U32(0x80) != 0) {
+ b = b & SLOT_4_2_0
// moved CSE2 up
// a &= (0x7f<<14)|(0x7f);
- a = (a << 7)
- a = a | (b)
- s = (s >> 4)
- *(*U64)(unsafe.Pointer(v)) = (((U64(s)) << 32) | U64(a))
+ a = a << 7
+ a = a | b
+ s = s >> 4
+ *(*U64)(unsafe.Pointer(v)) = U64(s)<<32 | U64(a)
return U8(8)
}
p++
- a = (a << 15)
- a = a | (U32(*(*uint8)(unsafe.Pointer(p))))
+ a = a << 15
+ a = a | U32(*(*uint8)(unsafe.Pointer(p)))
// a: p4<<29 | p6<<15 | p8 (unmasked)
// moved CSE2 up
// a &= (0x7f<<29)|(0x7f<<15)|(0xff);
- b = b & (U32(SLOT_2_0))
- b = (b << 8)
- a = a | (b)
+ b = b & U32(SLOT_2_0)
+ b = b << 8
+ a = a | b
- s = (s << 4)
+ s = s << 4
b = U32(*(*uint8)(unsafe.Pointer(p + libc.UintptrFromInt32(-4))))
- b = b & (U32(0x7f))
- b = (b >> 3)
- s = s | (b)
+ b = b & U32(0x7f)
+ b = b >> 3
+ s = s | b
- *(*U64)(unsafe.Pointer(v)) = (((U64(s)) << 32) | U64(a))
+ *(*U64)(unsafe.Pointer(v)) = U64(s)<<32 | U64(a)
return U8(9)
}
@@ -20161,7 +20573,7 @@ func Xsqlite3GetVarint(tls *libc.TLS, p uintptr, v uintptr) U8 { /* sqlite3.c:32
// A MACRO version, getVarint32, is provided which inlines the
// single-byte case. All code should use the MACRO version as
// this function assumes the single-byte case has already been handled.
-func Xsqlite3GetVarint32(tls *libc.TLS, p uintptr, v uintptr) U8 { /* sqlite3.c:32820:19: */
+func Xsqlite3GetVarint32(tls *libc.TLS, p uintptr, v uintptr) U8 { /* sqlite3.c:33192:19: */
bp := tls.Alloc(8)
defer tls.Free(8)
@@ -20177,25 +20589,25 @@ func Xsqlite3GetVarint32(tls *libc.TLS, p uintptr, v uintptr) U8 { /* sqlite3.c:
p++
b = U32(*(*uint8)(unsafe.Pointer(p)))
// b: p1 (unmasked)
- if !((b & U32(0x80)) != 0) {
+ if !(b&U32(0x80) != 0) {
// Values between 128 and 16383
- a = a & (U32(0x7f))
- a = (a << 7)
- *(*U32)(unsafe.Pointer(v)) = (a | b)
+ a = a & U32(0x7f)
+ a = a << 7
+ *(*U32)(unsafe.Pointer(v)) = a | b
return U8(2)
}
// The 3-byte case
p++
- a = (a << 14)
- a = a | (U32(*(*uint8)(unsafe.Pointer(p))))
+ a = a << 14
+ a = a | U32(*(*uint8)(unsafe.Pointer(p)))
// a: p0<<14 | p2 (unmasked)
- if !((a & U32(0x80)) != 0) {
+ if !(a&U32(0x80) != 0) {
// Values between 16384 and 2097151
- a = a & (U32((int32(0x7f) << 14) | (0x7f)))
- b = b & (U32(0x7f))
- b = (b << 7)
- *(*U32)(unsafe.Pointer(v)) = (a | b)
+ a = a & U32(int32(0x7f)<<14|0x7f)
+ b = b & U32(0x7f)
+ b = b << 7
+ *(*U32)(unsafe.Pointer(v)) = a | b
return U8(3)
}
@@ -20213,9 +20625,9 @@ func Xsqlite3GetVarint32(tls *libc.TLS, p uintptr, v uintptr) U8 { /* sqlite3.c:
var n U8
- n = Xsqlite3GetVarint(tls, (p - uintptr(2)), bp /* &v64 */)
+ n = Xsqlite3GetVarint(tls, p-uintptr(2), bp /* &v64 */)
- if (*(*U64)(unsafe.Pointer(bp /* v64 */)) & ((U64((uint64(1))) << 32) - uint64(1))) != *(*U64)(unsafe.Pointer(bp /* v64 */)) {
+ if *(*U64)(unsafe.Pointer(bp))&(U64(uint64(1))<<32-uint64(1)) != *(*U64)(unsafe.Pointer(bp)) {
*(*U32)(unsafe.Pointer(v)) = 0xffffffff
} else {
*(*U32)(unsafe.Pointer(v)) = U32(*(*U64)(unsafe.Pointer(bp /* v64 */)))
@@ -20229,15 +20641,15 @@ func Xsqlite3GetVarint32(tls *libc.TLS, p uintptr, v uintptr) U8 { /* sqlite3.c:
// Return the number of bytes that will be needed to store the given
// 64-bit integer.
-func Xsqlite3VarintLen(tls *libc.TLS, v U64) int32 { /* sqlite3.c:32942:20: */
+func Xsqlite3VarintLen(tls *libc.TLS, v U64) int32 { /* sqlite3.c:33314:20: */
var i int32
- for i = 1; (libc.AssignShrUint64(&v, int(uint64(7)))) != uint64(0); i++ {
+ for i = 1; libc.AssignShrUint64(&v, int(uint64(7))) != uint64(0); i++ {
}
return i
}
// Read or write a four-byte big-endian integer value.
-func Xsqlite3Get4byte(tls *libc.TLS, p uintptr) U32 { /* sqlite3.c:32952:20: */
+func Xsqlite3Get4byte(tls *libc.TLS, p uintptr) U32 { /* sqlite3.c:33324:20: */
bp := tls.Alloc(4)
defer tls.Free(4)
@@ -20247,7 +20659,7 @@ func Xsqlite3Get4byte(tls *libc.TLS, p uintptr) U32 { /* sqlite3.c:32952:20: */
return libc.X__builtin_bswap32(tls, *(*U32)(unsafe.Pointer(bp /* x */)))
}
-func Xsqlite3Put4byte(tls *libc.TLS, p uintptr, v U32) { /* sqlite3.c:32970:21: */
+func Xsqlite3Put4byte(tls *libc.TLS, p uintptr, v U32) { /* sqlite3.c:33342:21: */
bp := tls.Alloc(4)
defer tls.Free(4)
@@ -20258,27 +20670,27 @@ func Xsqlite3Put4byte(tls *libc.TLS, p uintptr, v U32) { /* sqlite3.c:32970:21:
// Translate a single byte of Hex into an integer.
// This routine only works if h really is a valid hexadecimal
// character: 0..9a..fA..F
-func Xsqlite3HexToInt(tls *libc.TLS, h int32) U8 { /* sqlite3.c:32994:19: */
+func Xsqlite3HexToInt(tls *libc.TLS, h int32) U8 { /* sqlite3.c:33366:19: */
- h = h + (9 * (1 & (h >> 6)))
- return (U8(h & 0xf))
+ h = h + 9*(1&(h>>6))
+ return U8(h & 0xf)
}
// Convert a BLOB literal of the form "x'hhhhhh'" into its binary
// value. Return a pointer to its binary value. Space to hold the
// binary value has been obtained from malloc and must be freed by
// the calling routine.
-func Xsqlite3HexToBlob(tls *libc.TLS, db uintptr, z uintptr, n int32) uintptr { /* sqlite3.c:33012:21: */
+func Xsqlite3HexToBlob(tls *libc.TLS, db uintptr, z uintptr, n int32) uintptr { /* sqlite3.c:33384:21: */
var zBlob uintptr
var i int32
- zBlob = Xsqlite3DbMallocRawNN(tls, db, (uint64((n / 2) + 1)))
+ zBlob = Xsqlite3DbMallocRawNN(tls, db, uint64(n/2+1))
n--
if zBlob != 0 {
- for i = 0; i < n; i = i + (2) {
- *(*uint8)(unsafe.Pointer(zBlob + uintptr((i / 2)))) = (uint8((int32(Xsqlite3HexToInt(tls, int32(*(*uint8)(unsafe.Pointer(z + uintptr(i)))))) << 4) | int32(Xsqlite3HexToInt(tls, int32(*(*uint8)(unsafe.Pointer(z + uintptr((i + 1)))))))))
+ for i = 0; i < n; i = i + 2 {
+ *(*uint8)(unsafe.Pointer(zBlob + uintptr(i/2))) = uint8(int32(Xsqlite3HexToInt(tls, int32(*(*uint8)(unsafe.Pointer(z + uintptr(i))))))<<4 | int32(Xsqlite3HexToInt(tls, int32(*(*uint8)(unsafe.Pointer(z + uintptr(i+1)))))))
}
- *(*uint8)(unsafe.Pointer(zBlob + uintptr((i / 2)))) = uint8(0)
+ *(*uint8)(unsafe.Pointer(zBlob + uintptr(i/2))) = uint8(0)
}
return zBlob
}
@@ -20286,12 +20698,12 @@ func Xsqlite3HexToBlob(tls *libc.TLS, db uintptr, z uintptr, n int32) uintptr {
// Log an error that is an API call on a connection pointer that should
// not have been used. The "type" of connection pointer is given as the
// argument. The zType is a word like "NULL" or "closed" or "invalid".
-func logBadConnection(tls *libc.TLS, zType uintptr) { /* sqlite3.c:33033:13: */
+func logBadConnection(tls *libc.TLS, zType uintptr) { /* sqlite3.c:33405:13: */
bp := tls.Alloc(8)
defer tls.Free(8)
Xsqlite3_log(tls, SQLITE_MISUSE,
- ts+810, /* "API call with %s..." */
+ ts+1598, /* "API call with %s..." */
libc.VaList(bp, zType))
}
@@ -20307,17 +20719,17 @@ func logBadConnection(tls *libc.TLS, zType uintptr) { /* sqlite3.c:33033:13: */
// use. sqlite3SafetyCheckSickOrOk() allows a db pointer that failed to
// open properly and is not fit for general use but which can be
// used as an argument to sqlite3_errmsg() or sqlite3_close().
-func Xsqlite3SafetyCheckOk(tls *libc.TLS, db uintptr) int32 { /* sqlite3.c:33054:20: */
- var magic U32
+func Xsqlite3SafetyCheckOk(tls *libc.TLS, db uintptr) int32 { /* sqlite3.c:33426:20: */
+ var eOpenState U8
if db == uintptr(0) {
- logBadConnection(tls, ts+756 /* "NULL" */)
+ logBadConnection(tls, ts+1544 /* "NULL" */)
return 0
}
- magic = (*Sqlite3)(unsafe.Pointer(db)).Fmagic
- if magic != SQLITE_MAGIC_OPEN {
+ eOpenState = (*Sqlite3)(unsafe.Pointer(db)).FeOpenState
+ if int32(eOpenState) != SQLITE_STATE_OPEN {
if Xsqlite3SafetyCheckSickOrOk(tls, db) != 0 {
- logBadConnection(tls, ts+855 /* "unopened" */)
+ logBadConnection(tls, ts+1643 /* "unopened" */)
}
return 0
} else {
@@ -20326,12 +20738,12 @@ func Xsqlite3SafetyCheckOk(tls *libc.TLS, db uintptr) int32 { /* sqlite3.c:33054
return int32(0)
}
-func Xsqlite3SafetyCheckSickOrOk(tls *libc.TLS, db uintptr) int32 { /* sqlite3.c:33071:20: */
- var magic U32
- magic = (*Sqlite3)(unsafe.Pointer(db)).Fmagic
- if ((magic != U32(SQLITE_MAGIC_SICK)) && (magic != SQLITE_MAGIC_OPEN)) && (magic != SQLITE_MAGIC_BUSY) {
+func Xsqlite3SafetyCheckSickOrOk(tls *libc.TLS, db uintptr) int32 { /* sqlite3.c:33443:20: */
+ var eOpenState U8
+ eOpenState = (*Sqlite3)(unsafe.Pointer(db)).FeOpenState
+ if int32(eOpenState) != SQLITE_STATE_SICK && int32(eOpenState) != SQLITE_STATE_OPEN && int32(eOpenState) != SQLITE_STATE_BUSY {
- logBadConnection(tls, ts+864 /* "invalid" */)
+ logBadConnection(tls, ts+1652 /* "invalid" */)
return 0
} else {
return 1
@@ -20343,21 +20755,21 @@ func Xsqlite3SafetyCheckSickOrOk(tls *libc.TLS, db uintptr) int32 { /* sqlite3.c
// the other 64-bit signed integer at *pA and store the result in *pA.
// Return 0 on success. Or if the operation would have resulted in an
// overflow, leave *pA unchanged and return 1.
-func Xsqlite3AddInt64(tls *libc.TLS, pA uintptr, iB I64) int32 { /* sqlite3.c:33091:20: */
+func Xsqlite3AddInt64(tls *libc.TLS, pA uintptr, iB I64) int32 { /* sqlite3.c:33463:20: */
return libc.X__builtin_add_overflowInt64(tls, *(*I64)(unsafe.Pointer(pA)), iB, pA)
}
-func Xsqlite3SubInt64(tls *libc.TLS, pA uintptr, iB I64) int32 { /* sqlite3.c:33111:20: */
+func Xsqlite3SubInt64(tls *libc.TLS, pA uintptr, iB I64) int32 { /* sqlite3.c:33483:20: */
return libc.X__builtin_sub_overflowInt64(tls, *(*I64)(unsafe.Pointer(pA)), iB, pA)
}
-func Xsqlite3MulInt64(tls *libc.TLS, pA uintptr, iB I64) int32 { /* sqlite3.c:33126:20: */
+func Xsqlite3MulInt64(tls *libc.TLS, pA uintptr, iB I64) int32 { /* sqlite3.c:33498:20: */
return libc.X__builtin_mul_overflowInt64(tls, *(*I64)(unsafe.Pointer(pA)), iB, pA)
}
// Compute the absolute value of a 32-bit signed integer, of possible. Or
// if the integer has a value of -2147483648, return +2147483647
-func Xsqlite3AbsInt32(tls *libc.TLS, x int32) int32 { /* sqlite3.c:33152:20: */
+func Xsqlite3AbsInt32(tls *libc.TLS, x int32) int32 { /* sqlite3.c:33524:20: */
if x >= 0 {
return x
}
@@ -20371,23 +20783,23 @@ func Xsqlite3AbsInt32(tls *libc.TLS, x int32) int32 { /* sqlite3.c:33152:20: */
// not a simple "+" operator because LogEst is stored as a logarithmic
// value.
//
-func Xsqlite3LogEstAdd(tls *libc.TLS, a LogEst, b LogEst) LogEst { /* sqlite3.c:33195:23: */
+func Xsqlite3LogEstAdd(tls *libc.TLS, a LogEst, b LogEst) LogEst { /* sqlite3.c:33567:23: */
if int32(a) >= int32(b) {
- if int32(a) > (int32(b) + 49) {
+ if int32(a) > int32(b)+49 {
return a
}
- if int32(a) > (int32(b) + 31) {
- return (LogEst(int32(a) + 1))
+ if int32(a) > int32(b)+31 {
+ return LogEst(int32(a) + 1)
}
- return (LogEst(int32(a) + int32(x[(int32(a)-int32(b))])))
+ return LogEst(int32(a) + int32(x[int32(a)-int32(b)]))
} else {
- if int32(b) > (int32(a) + 49) {
+ if int32(b) > int32(a)+49 {
return b
}
- if int32(b) > (int32(a) + 31) {
- return (LogEst(int32(b) + 1))
+ if int32(b) > int32(a)+31 {
+ return LogEst(int32(b) + 1)
}
- return (LogEst(int32(b) + int32(x[(int32(b)-int32(a))])))
+ return LogEst(int32(b) + int32(x[int32(b)-int32(a)]))
}
return LogEst(0)
}
@@ -20402,33 +20814,33 @@ var x = [32]uint8{
uint8(4), uint8(4), uint8(4), uint8(4), // 15-18
uint8(3), uint8(3), uint8(3), uint8(3), uint8(3), uint8(3), // 19-24
uint8(2), uint8(2), uint8(2), uint8(2), uint8(2), uint8(2), uint8(2), // 25-31
-} /* sqlite3.c:33196:30 */
+} /* sqlite3.c:33568:30 */
// Convert an integer into a LogEst. In other words, compute an
// approximation for 10*log2(x).
-func Xsqlite3LogEst(tls *libc.TLS, x U64) LogEst { /* sqlite3.c:33222:23: */
+func Xsqlite3LogEst(tls *libc.TLS, x U64) LogEst { /* sqlite3.c:33594:23: */
var y LogEst = int16(40)
if x < uint64(8) {
if x < uint64(2) {
return int16(0)
}
for x < uint64(8) {
- y = int16(int32(y) - (10))
+ y = int16(int32(y) - 10)
x <<= 1
}
} else {
- var i int32 = (60 - libc.X__builtin_clzll(tls, x))
- y = LogEst(int32(y) + (i * 10))
+ var i int32 = 60 - libc.X__builtin_clzll(tls, x)
+ y = LogEst(int32(y) + i*10)
x >>= i
}
- return (LogEst((int32(a[(x&uint64(7))]) + int32(y)) - 10))
+ return LogEst(int32(a[x&uint64(7)]) + int32(y) - 10)
}
-var a = [8]LogEst{int16(0), int16(2), int16(3), int16(5), int16(6), int16(7), int16(8), int16(9)} /* sqlite3.c:33223:17 */
+var a = [8]LogEst{int16(0), int16(2), int16(3), int16(5), int16(6), int16(7), int16(8), int16(9)} /* sqlite3.c:33595:17 */
// Convert a double into a LogEst
// In other words, compute an approximation for 10*log2(x).
-func Xsqlite3LogEstFromDouble(tls *libc.TLS, x float64) LogEst { /* sqlite3.c:33246:23: */
+func Xsqlite3LogEstFromDouble(tls *libc.TLS, x float64) LogEst { /* sqlite3.c:33618:23: */
bp := tls.Alloc(16)
defer tls.Free(16)
*(*float64)(unsafe.Pointer(bp + 8)) = x
@@ -20437,37 +20849,37 @@ func Xsqlite3LogEstFromDouble(tls *libc.TLS, x float64) LogEst { /* sqlite3.c:33
var e LogEst
- if *(*float64)(unsafe.Pointer(bp + 8 /* x */)) <= float64(1) {
+ if *(*float64)(unsafe.Pointer(bp + 8)) <= float64(1) {
return int16(0)
}
- if *(*float64)(unsafe.Pointer(bp + 8 /* x */)) <= float64(2000000000) {
+ if *(*float64)(unsafe.Pointer(bp + 8)) <= float64(2000000000) {
return Xsqlite3LogEst(tls, U64(*(*float64)(unsafe.Pointer(bp + 8 /* x */))))
}
libc.Xmemcpy(tls, bp /* &a */, bp+8 /* &x */, uint32(8))
- e = (LogEst((*(*U64)(unsafe.Pointer(bp /* a */)) >> 52) - uint64(1022)))
- return (LogEst(int32(e) * 10))
+ e = LogEst(*(*U64)(unsafe.Pointer(bp))>>52 - uint64(1022))
+ return LogEst(int32(e) * 10)
}
// Convert a LogEst into an integer.
//
// Note that this routine is only used when one or more of various
// non-standard compile-time options is enabled.
-func Xsqlite3LogEstToInt(tls *libc.TLS, x LogEst) U64 { /* sqlite3.c:33267:20: */
+func Xsqlite3LogEstToInt(tls *libc.TLS, x LogEst) U64 { /* sqlite3.c:33639:20: */
var n U64
- n = (U64(int32(x) % 10))
- x = int16(int32(x) / (10))
+ n = U64(int32(x) % 10)
+ x = int16(int32(x) / 10)
if n >= uint64(5) {
- n = n - (uint64(2))
+ n = n - uint64(2)
} else if n >= uint64(1) {
- n = n - (uint64(1))
+ n = n - uint64(1)
}
// If only SQLITE_ENABLE_STAT4 is on, then the largest input
// possible to this routine is 310, resulting in a maximum x of 31
if int32(x) >= 3 {
- return ((n + uint64(8)) << (int32(x) - 3))
+ return (n + uint64(8)) << (int32(x) - 3)
}
- return ((n + uint64(8)) >> (3 - int32(x)))
+ return (n + uint64(8)) >> (3 - int32(x))
}
// Add a new name/number pair to a VList. This might require that the
@@ -20504,22 +20916,22 @@ func Xsqlite3LogEstToInt(tls *libc.TLS, x LogEst) U64 { /* sqlite3.c:33267:20: *
// VList are taken. When that happens, nAlloc is set to zero as an
// indication that the VList may never again be enlarged, since the
// accompanying realloc() would invalidate the pointers.
-func Xsqlite3VListAdd(tls *libc.TLS, db uintptr, pIn uintptr, zName uintptr, nName int32, iVal int32) uintptr { /* sqlite3.c:33321:22: */
+func Xsqlite3VListAdd(tls *libc.TLS, db uintptr, pIn uintptr, zName uintptr, nName int32, iVal int32) uintptr { /* sqlite3.c:33693:22: */
var nInt int32 // number of sizeof(int) objects needed for zName
var z uintptr // Pointer to where zName will be stored
var i int32 // Index in pIn[] where zName is stored
- nInt = ((nName / 4) + 3)
+ nInt = nName/4 + 3
// Verify ok to add new elements
- if (pIn == uintptr(0)) || ((*(*VList)(unsafe.Pointer(pIn + 1*4)) + nInt) > *(*VList)(unsafe.Pointer(pIn))) {
+ if pIn == uintptr(0) || *(*VList)(unsafe.Pointer(pIn + 1*4))+nInt > *(*VList)(unsafe.Pointer(pIn)) {
// Enlarge the allocation
- var nAlloc Sqlite3_int64 = ((func() int64 {
+ var nAlloc Sqlite3_int64 = func() int64 {
if pIn != 0 {
- return (int64(2) * Sqlite3_int64(*(*VList)(unsafe.Pointer(pIn))))
+ return int64(2) * Sqlite3_int64(*(*VList)(unsafe.Pointer(pIn)))
}
return int64(10)
- }()) + Sqlite3_int64(nInt))
- var pOut uintptr = Xsqlite3DbRealloc(tls, db, pIn, (uint64(nAlloc * Sqlite3_int64(unsafe.Sizeof(int32(0))))))
+ }() + Sqlite3_int64(nInt)
+ var pOut uintptr = Xsqlite3DbRealloc(tls, db, pIn, uint64(nAlloc*Sqlite3_int64(unsafe.Sizeof(int32(0)))))
if pOut == uintptr(0) {
return pIn
}
@@ -20531,9 +20943,9 @@ func Xsqlite3VListAdd(tls *libc.TLS, db uintptr, pIn uintptr, zName uintptr, nNa
}
i = *(*VList)(unsafe.Pointer(pIn + 1*4))
*(*VList)(unsafe.Pointer(pIn + uintptr(i)*4)) = iVal
- *(*VList)(unsafe.Pointer(pIn + uintptr((i+1))*4)) = nInt
- z = (pIn + uintptr((i+2))*4)
- *(*VList)(unsafe.Pointer(pIn + 1*4)) = (i + nInt)
+ *(*VList)(unsafe.Pointer(pIn + uintptr(i+1)*4)) = nInt
+ z = pIn + uintptr(i+2)*4
+ *(*VList)(unsafe.Pointer(pIn + 1*4)) = i + nInt
libc.Xmemcpy(tls, z, zName, uint32(nName))
*(*uint8)(unsafe.Pointer(z + uintptr(nName))) = uint8(0)
@@ -20543,7 +20955,7 @@ func Xsqlite3VListAdd(tls *libc.TLS, db uintptr, pIn uintptr, zName uintptr, nNa
// Return a pointer to the name of a variable in the given VList that
// has the value iVal. Or return a NULL if there is no such variable in
// the list
-func Xsqlite3VListNumToName(tls *libc.TLS, pIn uintptr, iVal int32) uintptr { /* sqlite3.c:33359:27: */
+func Xsqlite3VListNumToName(tls *libc.TLS, pIn uintptr, iVal int32) uintptr { /* sqlite3.c:33731:27: */
var i int32
var mx int32
if pIn == uintptr(0) {
@@ -20551,18 +20963,18 @@ func Xsqlite3VListNumToName(tls *libc.TLS, pIn uintptr, iVal int32) uintptr { /*
}
mx = *(*VList)(unsafe.Pointer(pIn + 1*4))
i = 2
- for ok := true; ok; ok = (i < mx) {
+ for ok := true; ok; ok = i < mx {
if *(*VList)(unsafe.Pointer(pIn + uintptr(i)*4)) == iVal {
- return (pIn + uintptr((i+2))*4)
+ return pIn + uintptr(i+2)*4
}
- i = i + (*(*VList)(unsafe.Pointer(pIn + uintptr((i+1))*4)))
+ i = i + *(*VList)(unsafe.Pointer(pIn + uintptr(i+1)*4))
}
return uintptr(0)
}
// Return the number of the variable named zName, if it is in VList.
// or return 0 if there is no such variable.
-func Xsqlite3VListNameToNum(tls *libc.TLS, pIn uintptr, zName uintptr, nName int32) int32 { /* sqlite3.c:33375:20: */
+func Xsqlite3VListNameToNum(tls *libc.TLS, pIn uintptr, zName uintptr, nName int32) int32 { /* sqlite3.c:33747:20: */
var i int32
var mx int32
if pIn == uintptr(0) {
@@ -20570,12 +20982,12 @@ func Xsqlite3VListNameToNum(tls *libc.TLS, pIn uintptr, zName uintptr, nName int
}
mx = *(*VList)(unsafe.Pointer(pIn + 1*4))
i = 2
- for ok := true; ok; ok = (i < mx) {
- var z uintptr = (pIn + uintptr((i+2))*4)
- if (libc.Xstrncmp(tls, z, zName, uint32(nName)) == 0) && (int32(*(*uint8)(unsafe.Pointer(z + uintptr(nName)))) == 0) {
+ for ok := true; ok; ok = i < mx {
+ var z uintptr = pIn + uintptr(i+2)*4
+ if libc.Xstrncmp(tls, z, zName, uint32(nName)) == 0 && int32(*(*uint8)(unsafe.Pointer(z + uintptr(nName)))) == 0 {
return *(*VList)(unsafe.Pointer(pIn + uintptr(i)*4))
}
- i = i + (*(*VList)(unsafe.Pointer(pIn + uintptr((i+1))*4)))
+ i = i + *(*VList)(unsafe.Pointer(pIn + uintptr(i+1)*4))
}
return 0
}
@@ -20601,7 +21013,7 @@ func Xsqlite3VListNameToNum(tls *libc.TLS, pIn uintptr, zName uintptr, nName int
// fields of the Hash structure.
//
// "pNew" is a pointer to the hash table that is to be initialized.
-func Xsqlite3HashInit(tls *libc.TLS, pNew uintptr) { /* sqlite3.c:33412:21: */
+func Xsqlite3HashInit(tls *libc.TLS, pNew uintptr) { /* sqlite3.c:33784:21: */
(*Hash)(unsafe.Pointer(pNew)).Ffirst = uintptr(0)
(*Hash)(unsafe.Pointer(pNew)).Fcount = uint32(0)
@@ -20612,7 +21024,7 @@ func Xsqlite3HashInit(tls *libc.TLS, pNew uintptr) { /* sqlite3.c:33412:21: */
// Remove all entries from a hash table. Reclaim all memory.
// Call this routine to delete a hash table or to reset a hash table
// to the empty state.
-func Xsqlite3HashClear(tls *libc.TLS, pH uintptr) { /* sqlite3.c:33424:21: */
+func Xsqlite3HashClear(tls *libc.TLS, pH uintptr) { /* sqlite3.c:33796:21: */
var elem uintptr // For looping over all elements of the table
elem = (*Hash)(unsafe.Pointer(pH)).Ffirst
@@ -20629,22 +21041,22 @@ func Xsqlite3HashClear(tls *libc.TLS, pH uintptr) { /* sqlite3.c:33424:21: */
}
// The hashing function.
-func strHash(tls *libc.TLS, z uintptr) uint32 { /* sqlite3.c:33444:21: */
+func strHash(tls *libc.TLS, z uintptr) uint32 { /* sqlite3.c:33816:21: */
var h uint32 = uint32(0)
var c uint8
- for (int32(libc.AssignUint8(&c, uint8(*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&z, 1))))))) != 0 { //OPTIMIZATION-IF-TRUE
+ for int32(libc.AssignUint8(&c, uint8(*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&z, 1)))))) != 0 { //OPTIMIZATION-IF-TRUE
// Knuth multiplicative hashing. (Sorting & Searching, p. 510).
// 0x9e3779b1 is 2654435761 which is the closest prime number to
// (2**32)*golden_ratio, where golden_ratio = (sqrt(5) - 1)/2.
- h = h + (uint32(Xsqlite3UpperToLower[c]))
- h = h * (0x9e3779b1)
+ h = h + uint32(Xsqlite3UpperToLower[c])
+ h = h * 0x9e3779b1
}
return h
}
// Link pNew element into the hash table pH. If pEntry!=0 then also
// insert pNew into the pEntry hash bucket.
-func insertElement(tls *libc.TLS, pH uintptr, pEntry uintptr, pNew uintptr) { /* sqlite3.c:33461:13: */
+func insertElement(tls *libc.TLS, pH uintptr, pEntry uintptr, pNew uintptr) { /* sqlite3.c:33833:13: */
var pHead uintptr // First element already in pEntry
if pEntry != 0 {
if (*_ht)(unsafe.Pointer(pEntry)).Fcount != 0 {
@@ -20681,13 +21093,13 @@ func insertElement(tls *libc.TLS, pH uintptr, pEntry uintptr, pNew uintptr) { /*
// The hash table might fail to resize if sqlite3_malloc() fails or
// if the new size is the same as the prior size.
// Return TRUE if the resize occurs and false if not.
-func rehash(tls *libc.TLS, pH uintptr, new_size uint32) int32 { /* sqlite3.c:33495:12: */
+func rehash(tls *libc.TLS, pH uintptr, new_size uint32) int32 { /* sqlite3.c:33867:12: */
var new_ht uintptr // The new hash table
var elem uintptr
var next_elem uintptr // For looping over existing elements
- if (new_size * uint32(unsafe.Sizeof(_ht{}))) > uint32(SQLITE_MALLOC_SOFT_LIMIT) {
- new_size = (uint32(SQLITE_MALLOC_SOFT_LIMIT) / uint32(unsafe.Sizeof(_ht{})))
+ if new_size*uint32(unsafe.Sizeof(_ht{})) > uint32(SQLITE_MALLOC_SOFT_LIMIT) {
+ new_size = uint32(SQLITE_MALLOC_SOFT_LIMIT) / uint32(unsafe.Sizeof(_ht{}))
}
if new_size == (*Hash)(unsafe.Pointer(pH)).Fhtsize {
return 0
@@ -20701,7 +21113,7 @@ func rehash(tls *libc.TLS, pH uintptr, new_size uint32) int32 { /* sqlite3.c:334
// use the actual amount of space allocated for the hash table (which
// may be larger than the requested amount).
Xsqlite3BeginBenignMalloc(tls)
- new_ht = Xsqlite3Malloc(tls, (uint64(new_size * uint32(unsafe.Sizeof(_ht{})))))
+ new_ht = Xsqlite3Malloc(tls, uint64(new_size*uint32(unsafe.Sizeof(_ht{}))))
Xsqlite3EndBenignMalloc(tls)
if new_ht == uintptr(0) {
@@ -20709,14 +21121,14 @@ func rehash(tls *libc.TLS, pH uintptr, new_size uint32) int32 { /* sqlite3.c:334
}
Xsqlite3_free(tls, (*Hash)(unsafe.Pointer(pH)).Fht)
(*Hash)(unsafe.Pointer(pH)).Fht = new_ht
- (*Hash)(unsafe.Pointer(pH)).Fhtsize = libc.AssignUint32(&new_size, (uint32(Xsqlite3MallocSize(tls, new_ht)) / uint32(unsafe.Sizeof(_ht{}))))
- libc.Xmemset(tls, new_ht, 0, (new_size * uint32(unsafe.Sizeof(_ht{}))))
+ (*Hash)(unsafe.Pointer(pH)).Fhtsize = libc.AssignUint32(&new_size, uint32(Xsqlite3MallocSize(tls, new_ht))/uint32(unsafe.Sizeof(_ht{})))
+ libc.Xmemset(tls, new_ht, 0, new_size*uint32(unsafe.Sizeof(_ht{})))
elem = (*Hash)(unsafe.Pointer(pH)).Ffirst
(*Hash)(unsafe.Pointer(pH)).Ffirst = uintptr(0)
for ; elem != 0; elem = next_elem {
- var h uint32 = (strHash(tls, (*HashElem)(unsafe.Pointer(elem)).FpKey) % new_size)
+ var h uint32 = strHash(tls, (*HashElem)(unsafe.Pointer(elem)).FpKey) % new_size
next_elem = (*HashElem)(unsafe.Pointer(elem)).Fnext
- insertElement(tls, pH, (new_ht + uintptr(h)*8), elem)
+ insertElement(tls, pH, new_ht+uintptr(h)*8, elem)
}
return 1
}
@@ -20725,15 +21137,15 @@ func rehash(tls *libc.TLS, pH uintptr, new_size uint32) int32 { /* sqlite3.c:334
// hash table that matches the given key. If no element is found,
// a pointer to a static null element with HashElem.data==0 is returned.
// If pH is not NULL, then the hash for this key is written to *pH.
-func findElementWithHash(tls *libc.TLS, pH uintptr, pKey uintptr, pHash uintptr) uintptr { /* sqlite3.c:33536:17: */
+func findElementWithHash(tls *libc.TLS, pH uintptr, pKey uintptr, pHash uintptr) uintptr { /* sqlite3.c:33908:17: */
var elem uintptr // Used to loop thru the element list
var count uint32 // Number of elements left to test
var h uint32
if (*Hash)(unsafe.Pointer(pH)).Fht != 0 { //OPTIMIZATION-IF-TRUE
var pEntry uintptr
- h = (strHash(tls, pKey) % (*Hash)(unsafe.Pointer(pH)).Fhtsize)
- pEntry = ((*Hash)(unsafe.Pointer(pH)).Fht + uintptr(h)*8)
+ h = strHash(tls, pKey) % (*Hash)(unsafe.Pointer(pH)).Fhtsize
+ pEntry = (*Hash)(unsafe.Pointer(pH)).Fht + uintptr(h)*8
elem = (*_ht)(unsafe.Pointer(pEntry)).Fchain
count = (*_ht)(unsafe.Pointer(pEntry)).Fcount
} else {
@@ -20754,11 +21166,11 @@ func findElementWithHash(tls *libc.TLS, pH uintptr, pKey uintptr, pHash uintptr)
return uintptr(unsafe.Pointer(&nullElement))
}
-var nullElement = HashElem{} /* sqlite3.c:33544:19 */
+var nullElement = HashElem{} /* sqlite3.c:33916:19 */
// Remove a single entry from the hash table given a pointer to that
// element and a hash on the element's key.
-func removeElementGivenHash(tls *libc.TLS, pH uintptr, elem uintptr, h uint32) { /* sqlite3.c:33571:13: */
+func removeElementGivenHash(tls *libc.TLS, pH uintptr, elem uintptr, h uint32) { /* sqlite3.c:33943:13: */
var pEntry uintptr
if (*HashElem)(unsafe.Pointer(elem)).Fprev != 0 {
(*HashElem)(unsafe.Pointer((*HashElem)(unsafe.Pointer(elem)).Fprev)).Fnext = (*HashElem)(unsafe.Pointer(elem)).Fnext
@@ -20769,7 +21181,7 @@ func removeElementGivenHash(tls *libc.TLS, pH uintptr, elem uintptr, h uint32) {
(*HashElem)(unsafe.Pointer((*HashElem)(unsafe.Pointer(elem)).Fnext)).Fprev = (*HashElem)(unsafe.Pointer(elem)).Fprev
}
if (*Hash)(unsafe.Pointer(pH)).Fht != 0 {
- pEntry = ((*Hash)(unsafe.Pointer(pH)).Fht + uintptr(h)*8)
+ pEntry = (*Hash)(unsafe.Pointer(pH)).Fht + uintptr(h)*8
if (*_ht)(unsafe.Pointer(pEntry)).Fchain == elem {
(*_ht)(unsafe.Pointer(pEntry)).Fchain = (*HashElem)(unsafe.Pointer(elem)).Fnext
}
@@ -20787,7 +21199,7 @@ func removeElementGivenHash(tls *libc.TLS, pH uintptr, elem uintptr, h uint32) {
// Attempt to locate an element of the hash table pH with a key
// that matches pKey. Return the data for this element if it is
// found, or NULL if there is no match.
-func Xsqlite3HashFind(tls *libc.TLS, pH uintptr, pKey uintptr) uintptr { /* sqlite3.c:33606:21: */
+func Xsqlite3HashFind(tls *libc.TLS, pH uintptr, pKey uintptr) uintptr { /* sqlite3.c:33978:21: */
return (*HashElem)(unsafe.Pointer(findElementWithHash(tls, pH, pKey, uintptr(0)))).Fdata
}
@@ -20805,7 +21217,7 @@ func Xsqlite3HashFind(tls *libc.TLS, pH uintptr, pKey uintptr) uintptr { /* sqli
//
// If the "data" parameter to this function is NULL, then the
// element corresponding to "key" is removed from the hash table.
-func Xsqlite3HashInsert(tls *libc.TLS, pH uintptr, pKey uintptr, data uintptr) uintptr { /* sqlite3.c:33626:21: */
+func Xsqlite3HashInsert(tls *libc.TLS, pH uintptr, pKey uintptr, data uintptr) uintptr { /* sqlite3.c:33998:21: */
bp := tls.Alloc(4)
defer tls.Free(4)
@@ -20835,15 +21247,15 @@ func Xsqlite3HashInsert(tls *libc.TLS, pH uintptr, pKey uintptr, data uintptr) u
(*HashElem)(unsafe.Pointer(new_elem)).FpKey = pKey
(*HashElem)(unsafe.Pointer(new_elem)).Fdata = data
(*Hash)(unsafe.Pointer(pH)).Fcount++
- if ((*Hash)(unsafe.Pointer(pH)).Fcount >= uint32(10)) && ((*Hash)(unsafe.Pointer(pH)).Fcount > (uint32(2) * (*Hash)(unsafe.Pointer(pH)).Fhtsize)) {
- if rehash(tls, pH, ((*Hash)(unsafe.Pointer(pH)).Fcount*uint32(2))) != 0 {
+ if (*Hash)(unsafe.Pointer(pH)).Fcount >= uint32(10) && (*Hash)(unsafe.Pointer(pH)).Fcount > uint32(2)*(*Hash)(unsafe.Pointer(pH)).Fhtsize {
+ if rehash(tls, pH, (*Hash)(unsafe.Pointer(pH)).Fcount*uint32(2)) != 0 {
- *(*uint32)(unsafe.Pointer(bp /* h */)) = (strHash(tls, pKey) % (*Hash)(unsafe.Pointer(pH)).Fhtsize)
+ *(*uint32)(unsafe.Pointer(bp /* h */)) = strHash(tls, pKey) % (*Hash)(unsafe.Pointer(pH)).Fhtsize
}
}
insertElement(tls, pH, func() uintptr {
if (*Hash)(unsafe.Pointer(pH)).Fht != 0 {
- return ((*Hash)(unsafe.Pointer(pH)).Fht + uintptr(*(*uint32)(unsafe.Pointer(bp /* h */)))*8)
+ return (*Hash)(unsafe.Pointer(pH)).Fht + uintptr(*(*uint32)(unsafe.Pointer(bp)))*8
}
return uintptr(0)
}(), new_elem)
@@ -20854,192 +21266,194 @@ func Xsqlite3HashInsert(tls *libc.TLS, pH uintptr, pKey uintptr, data uintptr) u
//************* Begin file opcodes.c ****************************************
// Automatically generated. Do not edit
// See the tool/mkopcodec.tcl script for details.
-func Xsqlite3OpcodeName(tls *libc.TLS, i int32) uintptr { /* sqlite3.c:33672:27: */
+func Xsqlite3OpcodeName(tls *libc.TLS, i int32) uintptr { /* sqlite3.c:34044:27: */
return azName[i]
}
-var azName = [180]uintptr{
- /* 0 */ ts + 872, /* "Savepoint" */
- /* 1 */ ts + 882, /* "AutoCommit" */
- /* 2 */ ts + 893, /* "Transaction" */
- /* 3 */ ts + 905, /* "SorterNext" */
- /* 4 */ ts + 916, /* "Prev" */
- /* 5 */ ts + 921, /* "Next" */
- /* 6 */ ts + 926, /* "Checkpoint" */
- /* 7 */ ts + 937, /* "JournalMode" */
- /* 8 */ ts + 949, /* "Vacuum" */
- /* 9 */ ts + 956, /* "VFilter" */
- /* 10 */ ts + 964, /* "VUpdate" */
- /* 11 */ ts + 972, /* "Goto" */
- /* 12 */ ts + 977, /* "Gosub" */
- /* 13 */ ts + 983, /* "InitCoroutine" */
- /* 14 */ ts + 997, /* "Yield" */
- /* 15 */ ts + 1003, /* "MustBeInt" */
- /* 16 */ ts + 1013, /* "Jump" */
- /* 17 */ ts + 1018, /* "Once" */
- /* 18 */ ts + 1023, /* "If" */
- /* 19 */ ts + 1026, /* "Not" */
- /* 20 */ ts + 1030, /* "IfNot" */
- /* 21 */ ts + 1036, /* "IfNullRow" */
- /* 22 */ ts + 1046, /* "SeekLT" */
- /* 23 */ ts + 1053, /* "SeekLE" */
- /* 24 */ ts + 1060, /* "SeekGE" */
- /* 25 */ ts + 1067, /* "SeekGT" */
- /* 26 */ ts + 1074, /* "IfNotOpen" */
- /* 27 */ ts + 1084, /* "IfNoHope" */
- /* 28 */ ts + 1093, /* "NoConflict" */
- /* 29 */ ts + 1104, /* "NotFound" */
- /* 30 */ ts + 1113, /* "Found" */
- /* 31 */ ts + 1119, /* "SeekRowid" */
- /* 32 */ ts + 1129, /* "NotExists" */
- /* 33 */ ts + 1139, /* "Last" */
- /* 34 */ ts + 1144, /* "IfSmaller" */
- /* 35 */ ts + 1154, /* "SorterSort" */
- /* 36 */ ts + 1165, /* "Sort" */
- /* 37 */ ts + 1170, /* "Rewind" */
- /* 38 */ ts + 1177, /* "IdxLE" */
- /* 39 */ ts + 1183, /* "IdxGT" */
- /* 40 */ ts + 1189, /* "IdxLT" */
- /* 41 */ ts + 1195, /* "IdxGE" */
- /* 42 */ ts + 1201, /* "RowSetRead" */
- /* 43 */ ts + 1212, /* "Or" */
- /* 44 */ ts + 1215, /* "And" */
- /* 45 */ ts + 1219, /* "RowSetTest" */
- /* 46 */ ts + 1230, /* "Program" */
- /* 47 */ ts + 1238, /* "FkIfZero" */
- /* 48 */ ts + 1247, /* "IfPos" */
- /* 49 */ ts + 1253, /* "IfNotZero" */
- /* 50 */ ts + 1263, /* "IsNull" */
- /* 51 */ ts + 1270, /* "NotNull" */
- /* 52 */ ts + 1278, /* "Ne" */
- /* 53 */ ts + 1281, /* "Eq" */
- /* 54 */ ts + 1284, /* "Gt" */
- /* 55 */ ts + 1287, /* "Le" */
- /* 56 */ ts + 1290, /* "Lt" */
- /* 57 */ ts + 1293, /* "Ge" */
- /* 58 */ ts + 1296, /* "ElseEq" */
- /* 59 */ ts + 1303, /* "DecrJumpZero" */
- /* 60 */ ts + 1316, /* "IncrVacuum" */
- /* 61 */ ts + 1327, /* "VNext" */
- /* 62 */ ts + 1333, /* "Init" */
- /* 63 */ ts + 1338, /* "PureFunc" */
- /* 64 */ ts + 1347, /* "Function" */
- /* 65 */ ts + 1356, /* "Return" */
- /* 66 */ ts + 1363, /* "EndCoroutine" */
- /* 67 */ ts + 1376, /* "HaltIfNull" */
- /* 68 */ ts + 1387, /* "Halt" */
- /* 69 */ ts + 1392, /* "Integer" */
- /* 70 */ ts + 1400, /* "Int64" */
- /* 71 */ ts + 1406, /* "String" */
- /* 72 */ ts + 1413, /* "Null" */
- /* 73 */ ts + 1418, /* "SoftNull" */
- /* 74 */ ts + 1427, /* "Blob" */
- /* 75 */ ts + 1432, /* "Variable" */
- /* 76 */ ts + 1441, /* "Move" */
- /* 77 */ ts + 1446, /* "Copy" */
- /* 78 */ ts + 1451, /* "SCopy" */
- /* 79 */ ts + 1457, /* "IntCopy" */
- /* 80 */ ts + 1465, /* "ChngCntRow" */
- /* 81 */ ts + 1476, /* "ResultRow" */
- /* 82 */ ts + 1486, /* "CollSeq" */
- /* 83 */ ts + 1494, /* "AddImm" */
- /* 84 */ ts + 1501, /* "RealAffinity" */
- /* 85 */ ts + 1514, /* "Cast" */
- /* 86 */ ts + 1519, /* "Permutation" */
- /* 87 */ ts + 1531, /* "Compare" */
- /* 88 */ ts + 1539, /* "IsTrue" */
- /* 89 */ ts + 1546, /* "ZeroOrNull" */
- /* 90 */ ts + 1557, /* "Offset" */
- /* 91 */ ts + 1564, /* "Column" */
- /* 92 */ ts + 1571, /* "Affinity" */
- /* 93 */ ts + 1580, /* "MakeRecord" */
- /* 94 */ ts + 1591, /* "Count" */
- /* 95 */ ts + 1597, /* "ReadCookie" */
- /* 96 */ ts + 1608, /* "SetCookie" */
- /* 97 */ ts + 1618, /* "ReopenIdx" */
- /* 98 */ ts + 1628, /* "OpenRead" */
- /* 99 */ ts + 1637, /* "OpenWrite" */
- /* 100 */ ts + 1647, /* "OpenDup" */
- /* 101 */ ts + 1655, /* "OpenAutoindex" */
- /* 102 */ ts + 1669, /* "BitAnd" */
- /* 103 */ ts + 1676, /* "BitOr" */
- /* 104 */ ts + 1682, /* "ShiftLeft" */
- /* 105 */ ts + 1692, /* "ShiftRight" */
- /* 106 */ ts + 1703, /* "Add" */
- /* 107 */ ts + 1707, /* "Subtract" */
- /* 108 */ ts + 1716, /* "Multiply" */
- /* 109 */ ts + 1725, /* "Divide" */
- /* 110 */ ts + 1732, /* "Remainder" */
- /* 111 */ ts + 1742, /* "Concat" */
- /* 112 */ ts + 1749, /* "OpenEphemeral" */
- /* 113 */ ts + 1763, /* "BitNot" */
- /* 114 */ ts + 1770, /* "SorterOpen" */
- /* 115 */ ts + 1781, /* "SequenceTest" */
- /* 116 */ ts + 1794, /* "String8" */
- /* 117 */ ts + 1802, /* "OpenPseudo" */
- /* 118 */ ts + 1813, /* "Close" */
- /* 119 */ ts + 1819, /* "ColumnsUsed" */
- /* 120 */ ts + 1831, /* "SeekScan" */
- /* 121 */ ts + 1840, /* "SeekHit" */
- /* 122 */ ts + 1848, /* "Sequence" */
- /* 123 */ ts + 1857, /* "NewRowid" */
- /* 124 */ ts + 1866, /* "Insert" */
- /* 125 */ ts + 1873, /* "RowCell" */
- /* 126 */ ts + 1881, /* "Delete" */
- /* 127 */ ts + 1888, /* "ResetCount" */
- /* 128 */ ts + 1899, /* "SorterCompare" */
- /* 129 */ ts + 1913, /* "SorterData" */
- /* 130 */ ts + 1924, /* "RowData" */
- /* 131 */ ts + 1932, /* "Rowid" */
- /* 132 */ ts + 1938, /* "NullRow" */
- /* 133 */ ts + 1946, /* "SeekEnd" */
- /* 134 */ ts + 1954, /* "IdxInsert" */
- /* 135 */ ts + 1964, /* "SorterInsert" */
- /* 136 */ ts + 1977, /* "IdxDelete" */
- /* 137 */ ts + 1987, /* "DeferredSeek" */
- /* 138 */ ts + 2000, /* "IdxRowid" */
- /* 139 */ ts + 2009, /* "FinishSeek" */
- /* 140 */ ts + 2020, /* "Destroy" */
- /* 141 */ ts + 2028, /* "Clear" */
- /* 142 */ ts + 2034, /* "ResetSorter" */
- /* 143 */ ts + 2046, /* "CreateBtree" */
- /* 144 */ ts + 2058, /* "SqlExec" */
- /* 145 */ ts + 2066, /* "ParseSchema" */
- /* 146 */ ts + 2078, /* "LoadAnalysis" */
- /* 147 */ ts + 2091, /* "DropTable" */
- /* 148 */ ts + 2101, /* "DropIndex" */
- /* 149 */ ts + 2111, /* "DropTrigger" */
- /* 150 */ ts + 2123, /* "IntegrityCk" */
- /* 151 */ ts + 2135, /* "RowSetAdd" */
- /* 152 */ ts + 2145, /* "Real" */
- /* 153 */ ts + 2150, /* "Param" */
- /* 154 */ ts + 2156, /* "FkCounter" */
- /* 155 */ ts + 2166, /* "MemMax" */
- /* 156 */ ts + 2173, /* "OffsetLimit" */
- /* 157 */ ts + 2185, /* "AggInverse" */
- /* 158 */ ts + 2196, /* "AggStep" */
- /* 159 */ ts + 2204, /* "AggStep1" */
- /* 160 */ ts + 2213, /* "AggValue" */
- /* 161 */ ts + 2222, /* "AggFinal" */
- /* 162 */ ts + 2231, /* "Expire" */
- /* 163 */ ts + 2238, /* "CursorLock" */
- /* 164 */ ts + 2249, /* "CursorUnlock" */
- /* 165 */ ts + 2262, /* "TableLock" */
- /* 166 */ ts + 2272, /* "VBegin" */
- /* 167 */ ts + 2279, /* "VCreate" */
- /* 168 */ ts + 2287, /* "VDestroy" */
- /* 169 */ ts + 2296, /* "VOpen" */
- /* 170 */ ts + 2302, /* "VColumn" */
- /* 171 */ ts + 2310, /* "VRename" */
- /* 172 */ ts + 2318, /* "Pagecount" */
- /* 173 */ ts + 2328, /* "MaxPgcnt" */
- /* 174 */ ts + 2337, /* "Trace" */
- /* 175 */ ts + 2343, /* "CursorHint" */
- /* 176 */ ts + 2354, /* "ReleaseReg" */
- /* 177 */ ts + 2365, /* "Noop" */
- /* 178 */ ts + 2370, /* "Explain" */
- /* 179 */ ts + 2378, /* "Abortable" */
-} /* sqlite3.c:33673:20 */
+var azName = [182]uintptr{
+ /* 0 */ ts + 1660, /* "Savepoint" */
+ /* 1 */ ts + 1670, /* "AutoCommit" */
+ /* 2 */ ts + 1681, /* "Transaction" */
+ /* 3 */ ts + 1693, /* "SorterNext" */
+ /* 4 */ ts + 1704, /* "Prev" */
+ /* 5 */ ts + 1709, /* "Next" */
+ /* 6 */ ts + 1714, /* "Checkpoint" */
+ /* 7 */ ts + 1725, /* "JournalMode" */
+ /* 8 */ ts + 1737, /* "Vacuum" */
+ /* 9 */ ts + 1744, /* "VFilter" */
+ /* 10 */ ts + 1752, /* "VUpdate" */
+ /* 11 */ ts + 1760, /* "Goto" */
+ /* 12 */ ts + 1765, /* "Gosub" */
+ /* 13 */ ts + 1771, /* "InitCoroutine" */
+ /* 14 */ ts + 1785, /* "Yield" */
+ /* 15 */ ts + 1791, /* "MustBeInt" */
+ /* 16 */ ts + 1801, /* "Jump" */
+ /* 17 */ ts + 1806, /* "Once" */
+ /* 18 */ ts + 1811, /* "If" */
+ /* 19 */ ts + 1814, /* "Not" */
+ /* 20 */ ts + 1818, /* "IfNot" */
+ /* 21 */ ts + 1824, /* "IsNullOrType" */
+ /* 22 */ ts + 1837, /* "IfNullRow" */
+ /* 23 */ ts + 1847, /* "SeekLT" */
+ /* 24 */ ts + 1854, /* "SeekLE" */
+ /* 25 */ ts + 1861, /* "SeekGE" */
+ /* 26 */ ts + 1868, /* "SeekGT" */
+ /* 27 */ ts + 1875, /* "IfNotOpen" */
+ /* 28 */ ts + 1885, /* "IfNoHope" */
+ /* 29 */ ts + 1894, /* "NoConflict" */
+ /* 30 */ ts + 1905, /* "NotFound" */
+ /* 31 */ ts + 1914, /* "Found" */
+ /* 32 */ ts + 1920, /* "SeekRowid" */
+ /* 33 */ ts + 1930, /* "NotExists" */
+ /* 34 */ ts + 1940, /* "Last" */
+ /* 35 */ ts + 1945, /* "IfSmaller" */
+ /* 36 */ ts + 1955, /* "SorterSort" */
+ /* 37 */ ts + 1966, /* "Sort" */
+ /* 38 */ ts + 1971, /* "Rewind" */
+ /* 39 */ ts + 1978, /* "IdxLE" */
+ /* 40 */ ts + 1984, /* "IdxGT" */
+ /* 41 */ ts + 1990, /* "IdxLT" */
+ /* 42 */ ts + 1996, /* "IdxGE" */
+ /* 43 */ ts + 2002, /* "Or" */
+ /* 44 */ ts + 2005, /* "And" */
+ /* 45 */ ts + 2009, /* "RowSetRead" */
+ /* 46 */ ts + 2020, /* "RowSetTest" */
+ /* 47 */ ts + 2031, /* "Program" */
+ /* 48 */ ts + 2039, /* "FkIfZero" */
+ /* 49 */ ts + 2048, /* "IfPos" */
+ /* 50 */ ts + 2054, /* "IsNull" */
+ /* 51 */ ts + 2061, /* "NotNull" */
+ /* 52 */ ts + 2069, /* "Ne" */
+ /* 53 */ ts + 2072, /* "Eq" */
+ /* 54 */ ts + 2075, /* "Gt" */
+ /* 55 */ ts + 2078, /* "Le" */
+ /* 56 */ ts + 2081, /* "Lt" */
+ /* 57 */ ts + 2084, /* "Ge" */
+ /* 58 */ ts + 2087, /* "ElseEq" */
+ /* 59 */ ts + 2094, /* "IfNotZero" */
+ /* 60 */ ts + 2104, /* "DecrJumpZero" */
+ /* 61 */ ts + 2117, /* "IncrVacuum" */
+ /* 62 */ ts + 2128, /* "VNext" */
+ /* 63 */ ts + 2134, /* "Init" */
+ /* 64 */ ts + 2139, /* "PureFunc" */
+ /* 65 */ ts + 2148, /* "Function" */
+ /* 66 */ ts + 2157, /* "Return" */
+ /* 67 */ ts + 2164, /* "EndCoroutine" */
+ /* 68 */ ts + 2177, /* "HaltIfNull" */
+ /* 69 */ ts + 2188, /* "Halt" */
+ /* 70 */ ts + 2193, /* "Integer" */
+ /* 71 */ ts + 2201, /* "Int64" */
+ /* 72 */ ts + 2207, /* "String" */
+ /* 73 */ ts + 2214, /* "Null" */
+ /* 74 */ ts + 2219, /* "SoftNull" */
+ /* 75 */ ts + 2228, /* "Blob" */
+ /* 76 */ ts + 2233, /* "Variable" */
+ /* 77 */ ts + 2242, /* "Move" */
+ /* 78 */ ts + 2247, /* "Copy" */
+ /* 79 */ ts + 2252, /* "SCopy" */
+ /* 80 */ ts + 2258, /* "IntCopy" */
+ /* 81 */ ts + 2266, /* "ChngCntRow" */
+ /* 82 */ ts + 2277, /* "ResultRow" */
+ /* 83 */ ts + 2287, /* "CollSeq" */
+ /* 84 */ ts + 2295, /* "AddImm" */
+ /* 85 */ ts + 2302, /* "RealAffinity" */
+ /* 86 */ ts + 2315, /* "Cast" */
+ /* 87 */ ts + 2320, /* "Permutation" */
+ /* 88 */ ts + 2332, /* "Compare" */
+ /* 89 */ ts + 2340, /* "IsTrue" */
+ /* 90 */ ts + 2347, /* "ZeroOrNull" */
+ /* 91 */ ts + 2358, /* "Offset" */
+ /* 92 */ ts + 2365, /* "Column" */
+ /* 93 */ ts + 2372, /* "TypeCheck" */
+ /* 94 */ ts + 2382, /* "Affinity" */
+ /* 95 */ ts + 2391, /* "MakeRecord" */
+ /* 96 */ ts + 2402, /* "Count" */
+ /* 97 */ ts + 2408, /* "ReadCookie" */
+ /* 98 */ ts + 2419, /* "SetCookie" */
+ /* 99 */ ts + 2429, /* "ReopenIdx" */
+ /* 100 */ ts + 2439, /* "OpenRead" */
+ /* 101 */ ts + 2448, /* "OpenWrite" */
+ /* 102 */ ts + 2458, /* "BitAnd" */
+ /* 103 */ ts + 2465, /* "BitOr" */
+ /* 104 */ ts + 2471, /* "ShiftLeft" */
+ /* 105 */ ts + 2481, /* "ShiftRight" */
+ /* 106 */ ts + 2492, /* "Add" */
+ /* 107 */ ts + 2496, /* "Subtract" */
+ /* 108 */ ts + 2505, /* "Multiply" */
+ /* 109 */ ts + 2514, /* "Divide" */
+ /* 110 */ ts + 2521, /* "Remainder" */
+ /* 111 */ ts + 2531, /* "Concat" */
+ /* 112 */ ts + 2538, /* "OpenDup" */
+ /* 113 */ ts + 2546, /* "BitNot" */
+ /* 114 */ ts + 2553, /* "OpenAutoindex" */
+ /* 115 */ ts + 2567, /* "OpenEphemeral" */
+ /* 116 */ ts + 2581, /* "String8" */
+ /* 117 */ ts + 2589, /* "SorterOpen" */
+ /* 118 */ ts + 2600, /* "SequenceTest" */
+ /* 119 */ ts + 2613, /* "OpenPseudo" */
+ /* 120 */ ts + 2624, /* "Close" */
+ /* 121 */ ts + 2630, /* "ColumnsUsed" */
+ /* 122 */ ts + 2642, /* "SeekScan" */
+ /* 123 */ ts + 2651, /* "SeekHit" */
+ /* 124 */ ts + 2659, /* "Sequence" */
+ /* 125 */ ts + 2668, /* "NewRowid" */
+ /* 126 */ ts + 2677, /* "Insert" */
+ /* 127 */ ts + 2684, /* "RowCell" */
+ /* 128 */ ts + 2692, /* "Delete" */
+ /* 129 */ ts + 2699, /* "ResetCount" */
+ /* 130 */ ts + 2710, /* "SorterCompare" */
+ /* 131 */ ts + 2724, /* "SorterData" */
+ /* 132 */ ts + 2735, /* "RowData" */
+ /* 133 */ ts + 2743, /* "Rowid" */
+ /* 134 */ ts + 2749, /* "NullRow" */
+ /* 135 */ ts + 2757, /* "SeekEnd" */
+ /* 136 */ ts + 2765, /* "IdxInsert" */
+ /* 137 */ ts + 2775, /* "SorterInsert" */
+ /* 138 */ ts + 2788, /* "IdxDelete" */
+ /* 139 */ ts + 2798, /* "DeferredSeek" */
+ /* 140 */ ts + 2811, /* "IdxRowid" */
+ /* 141 */ ts + 2820, /* "FinishSeek" */
+ /* 142 */ ts + 2831, /* "Destroy" */
+ /* 143 */ ts + 2839, /* "Clear" */
+ /* 144 */ ts + 2845, /* "ResetSorter" */
+ /* 145 */ ts + 2857, /* "CreateBtree" */
+ /* 146 */ ts + 2869, /* "SqlExec" */
+ /* 147 */ ts + 2877, /* "ParseSchema" */
+ /* 148 */ ts + 2889, /* "LoadAnalysis" */
+ /* 149 */ ts + 2902, /* "DropTable" */
+ /* 150 */ ts + 2912, /* "DropIndex" */
+ /* 151 */ ts + 2922, /* "DropTrigger" */
+ /* 152 */ ts + 2934, /* "Real" */
+ /* 153 */ ts + 2939, /* "IntegrityCk" */
+ /* 154 */ ts + 2951, /* "RowSetAdd" */
+ /* 155 */ ts + 2961, /* "Param" */
+ /* 156 */ ts + 2967, /* "FkCounter" */
+ /* 157 */ ts + 2977, /* "MemMax" */
+ /* 158 */ ts + 2984, /* "OffsetLimit" */
+ /* 159 */ ts + 2996, /* "AggInverse" */
+ /* 160 */ ts + 3007, /* "AggStep" */
+ /* 161 */ ts + 3015, /* "AggStep1" */
+ /* 162 */ ts + 3024, /* "AggValue" */
+ /* 163 */ ts + 3033, /* "AggFinal" */
+ /* 164 */ ts + 3042, /* "Expire" */
+ /* 165 */ ts + 3049, /* "CursorLock" */
+ /* 166 */ ts + 3060, /* "CursorUnlock" */
+ /* 167 */ ts + 3073, /* "TableLock" */
+ /* 168 */ ts + 3083, /* "VBegin" */
+ /* 169 */ ts + 3090, /* "VCreate" */
+ /* 170 */ ts + 3098, /* "VDestroy" */
+ /* 171 */ ts + 3107, /* "VOpen" */
+ /* 172 */ ts + 3113, /* "VColumn" */
+ /* 173 */ ts + 3121, /* "VRename" */
+ /* 174 */ ts + 3129, /* "Pagecount" */
+ /* 175 */ ts + 3139, /* "MaxPgcnt" */
+ /* 176 */ ts + 3148, /* "Trace" */
+ /* 177 */ ts + 3154, /* "CursorHint" */
+ /* 178 */ ts + 3165, /* "ReleaseReg" */
+ /* 179 */ ts + 3176, /* "Noop" */
+ /* 180 */ ts + 3181, /* "Explain" */
+ /* 181 */ ts + 3189, /* "Abortable" */
+} /* sqlite3.c:34045:20 */
//************* End of opcodes.c ********************************************
//************* Begin file os_unix.c ****************************************
@@ -21107,7 +21521,7 @@ var azName = [180]uintptr{
// Use pread() and pwrite() if they are available
// standard include files.
-// Copyright (C) 1991-2018 Free Software Foundation, Inc.
+// Copyright (C) 1991-2020 Free Software Foundation, Inc.
// This file is part of the GNU C Library.
//
// The GNU C Library is free software; you can redistribute it and/or
@@ -21122,11 +21536,11 @@ var azName = [180]uintptr{
//
// You should have received a copy of the GNU Lesser General Public
// License along with the GNU C Library; if not, see
-// <http://www.gnu.org/licenses/>.
+// <https://www.gnu.org/licenses/>.
// POSIX Standard: 2.6 Primitive System Data Types <sys/types.h>
-// Copyright (C) 1991-2018 Free Software Foundation, Inc.
+// Copyright (C) 1991-2020 Free Software Foundation, Inc.
// This file is part of the GNU C Library.
//
// The GNU C Library is free software; you can redistribute it and/or
@@ -21141,11 +21555,11 @@ var azName = [180]uintptr{
//
// You should have received a copy of the GNU Lesser General Public
// License along with the GNU C Library; if not, see
-// <http://www.gnu.org/licenses/>.
+// <https://www.gnu.org/licenses/>.
// POSIX Standard: 5.6 File Characteristics <sys/stat.h>
-// Copyright (C) 1991-2018 Free Software Foundation, Inc.
+// Copyright (C) 1991-2020 Free Software Foundation, Inc.
// This file is part of the GNU C Library.
//
// The GNU C Library is free software; you can redistribute it and/or
@@ -21160,10 +21574,10 @@ var azName = [180]uintptr{
//
// You should have received a copy of the GNU Lesser General Public
// License along with the GNU C Library; if not, see
-// <http://www.gnu.org/licenses/>.
+// <https://www.gnu.org/licenses/>.
// bits/types.h -- definitions of __*_t types underlying *_t types.
-// Copyright (C) 2002-2018 Free Software Foundation, Inc.
+// Copyright (C) 2002-2020 Free Software Foundation, Inc.
// This file is part of the GNU C Library.
//
// The GNU C Library is free software; you can redistribute it and/or
@@ -21178,7 +21592,7 @@ var azName = [180]uintptr{
//
// You should have received a copy of the GNU Lesser General Public
// License along with the GNU C Library; if not, see
-// <http://www.gnu.org/licenses/>.
+// <https://www.gnu.org/licenses/>.
// Never include this file directly; use <sys/types.h> instead.
@@ -21187,7 +21601,7 @@ var azName = [180]uintptr{
// The Single Unix specification says that some more types are
// available here.
-// Copyright (C) 1992-2018 Free Software Foundation, Inc.
+// Copyright (C) 1992-2020 Free Software Foundation, Inc.
// This file is part of the GNU C Library.
//
// The GNU C Library is free software; you can redistribute it and/or
@@ -21202,7 +21616,7 @@ var azName = [180]uintptr{
//
// You should have received a copy of the GNU Lesser General Public
// License along with the GNU C Library; if not, see
-// <http://www.gnu.org/licenses/>.
+// <https://www.gnu.org/licenses/>.
// Versions of the `struct stat' data structure.
@@ -21269,8 +21683,8 @@ type stat64 = struct {
Fst_ino X__ino64_t
} /* stat.h:95:1 */
-// statx-related definitions and declarations.
-// Copyright (C) 2018 Free Software Foundation, Inc.
+// statx-related definitions and declarations. Linux version.
+// Copyright (C) 2018-2020 Free Software Foundation, Inc.
// This file is part of the GNU C Library.
//
// The GNU C Library is free software; you can redistribute it and/or
@@ -21285,61 +21699,278 @@ type stat64 = struct {
//
// You should have received a copy of the GNU Lesser General Public
// License along with the GNU C Library; if not, see
-// <http://www.gnu.org/licenses/>.
+// <https://www.gnu.org/licenses/>.
// This interface is based on <linux/stat.h> in Linux.
+// Use the Linux kernel header if available.
+
+// Use "" to work around incorrect macro expansion of the
+// __has_include argument (GCC PR 80005).
+// SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note
+
+// SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note
+
+// SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note
+
+// SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note
+// asm-generic/int-ll64.h
+//
+// Integer declarations for architectures which use "long long"
+// for 64-bit types.
+
+// SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note
+
+// There seems to be no way of detecting this automatically from user
+// space, so 64 bit architectures should override this in their
+// bitsperlong.h. In particular, an architecture that supports
+// both 32 and 64 bit user space must not rely on CONFIG_64BIT
+// to decide it, but rather check a compiler provided macro.
+
+// __xx is ok: it doesn't pollute the POSIX namespace. Use these in the
+// header files exported to user space
+
+type X__s8 = int8 /* int-ll64.h:20:25 */
+type X__u8 = uint8 /* int-ll64.h:21:23 */
+
+type X__s16 = int16 /* int-ll64.h:23:26 */
+type X__u16 = uint16 /* int-ll64.h:24:24 */
+
+type X__s32 = int32 /* int-ll64.h:26:24 */
+type X__u32 = uint32 /* int-ll64.h:27:22 */
+
+type X__s64 = int64 /* int-ll64.h:30:44 */
+type X__u64 = uint64 /* int-ll64.h:31:42 */
+
+// The C99 types uintXX_t that are usually defined in 'stdint.h' are not as
+// unambiguous on ARM as you would expect. For the types below, there is a
+// difference on ARM between GCC built for bare metal ARM, GCC built for glibc
+// and the kernel itself, which results in build errors if you try to build with
+// -ffreestanding and include 'stdint.h' (such as when you include 'arm_neon.h'
+// in order to use NEON intrinsics)
+//
+// As the typedefs for these types in 'stdint.h' are based on builtin defines
+// supplied by GCC, we can tweak these to align with the kernel's idea of those
+// types, so 'linux/types.h' and 'stdint.h' can be safely included from the same
+// source file (provided that -ffreestanding is used).
+//
+// int32_t uint32_t uintptr_t
+// bare metal GCC long unsigned long unsigned int
+// glibc GCC int unsigned int unsigned int
+// kernel int unsigned int unsigned long
+
+// SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note
+
+// SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note
+
+// This allows for 1024 file descriptors: if NR_OPEN is ever grown
+// beyond that you'll have to change this too. But 1024 fd's seem to be
+// enough even for such "real" unices like OSF/1, so hopefully this is
+// one limit that doesn't have to be changed [again].
+//
+// Note that POSIX wants the FD_CLEAR(fd,fdsetp) defines to be in
+// <sys/time.h> (and thus <linux/time.h>) - but this is a more logical
+// place for them. Solved by having dummy defines in <sys/time.h>.
+
+// This macro may have been defined in <gnu/types.h>. But we always
+// use the one here.
+
+type X__kernel_fd_set = struct{ Ffds_bits [32]uint32 } /* posix_types.h:27:3 */
+
+// Type of a signal handler.
+type X__kernel_sighandler_t = uintptr /* posix_types.h:30:14 */
+
+// Type of a SYSV IPC key.
+type X__kernel_key_t = int32 /* posix_types.h:33:13 */
+type X__kernel_mqd_t = int32 /* posix_types.h:34:13 */
+
+// SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note
+// arch/arm/include/asm/posix_types.h
+//
+// Copyright (C) 1996-1998 Russell King.
+//
+// This program is free software; you can redistribute it and/or modify
+// it under the terms of the GNU General Public License version 2 as
+// published by the Free Software Foundation.
+//
+// Changelog:
+// 27-06-1996 RMK Created
+
+// This file is generally used by user-level software, so you need to
+// be a little careful about namespace pollution etc. Also, we cannot
+// assume GCC is being used.
+
+type X__kernel_mode_t = uint16 /* posix_types.h:23:25 */
+
+type X__kernel_ipc_pid_t = uint16 /* posix_types.h:26:25 */
+
+type X__kernel_uid_t = uint16 /* posix_types.h:29:25 */
+type X__kernel_gid_t = uint16 /* posix_types.h:30:25 */
+
+type X__kernel_old_dev_t = uint16 /* posix_types.h:33:25 */
+
+// SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note
+
+// SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note
+// This file is generally used by user-level software, so you need to
+// be a little careful about namespace pollution etc.
+//
+// First the types that are often defined in different ways across
+// architectures, so that you can override them.
+
+type X__kernel_long_t = int32 /* posix_types.h:15:15 */
+type X__kernel_ulong_t = uint32 /* posix_types.h:16:23 */
+
+type X__kernel_ino_t = X__kernel_ulong_t /* posix_types.h:20:26 */
+
+type X__kernel_pid_t = int32 /* posix_types.h:28:14 */
+
+type X__kernel_suseconds_t = X__kernel_long_t /* posix_types.h:41:26 */
+
+type X__kernel_daddr_t = int32 /* posix_types.h:45:14 */
+
+type X__kernel_uid32_t = uint32 /* posix_types.h:49:22 */
+type X__kernel_gid32_t = uint32 /* posix_types.h:50:22 */
+
+type X__kernel_old_uid_t = X__kernel_uid_t /* posix_types.h:54:24 */
+type X__kernel_old_gid_t = X__kernel_gid_t /* posix_types.h:55:24 */
+
+// Most 32 bit architectures use "unsigned int" size_t,
+// and all 64 bit architectures use "unsigned long" size_t.
+type X__kernel_size_t = uint32 /* posix_types.h:68:22 */
+type X__kernel_ssize_t = int32 /* posix_types.h:69:14 */
+type X__kernel_ptrdiff_t = int32 /* posix_types.h:70:14 */
+
+type X__kernel_fsid_t = struct{ Fval [2]int32 } /* posix_types.h:81:3 */
+
+// anything below here should be completely generic
+type X__kernel_off_t = X__kernel_long_t /* posix_types.h:87:25 */
+type X__kernel_loff_t = int64 /* posix_types.h:88:19 */
+type X__kernel_old_time_t = X__kernel_long_t /* posix_types.h:89:25 */
+type X__kernel_time_t = X__kernel_long_t /* posix_types.h:90:25 */
+type X__kernel_time64_t = int64 /* posix_types.h:91:19 */
+type X__kernel_clock_t = X__kernel_long_t /* posix_types.h:92:25 */
+type X__kernel_timer_t = int32 /* posix_types.h:93:14 */
+type X__kernel_clockid_t = int32 /* posix_types.h:94:14 */
+type X__kernel_caddr_t = uintptr /* posix_types.h:95:14 */
+type X__kernel_uid16_t = uint16 /* posix_types.h:96:24 */
+type X__kernel_gid16_t = uint16 /* posix_types.h:97:24 */
+
+// Below are truly Linux-specific types that should never collide with
+// any application/library that wants linux/types.h.
+
+type X__le16 = X__u16 /* types.h:24:25 */
+type X__be16 = X__u16 /* types.h:25:25 */
+type X__le32 = X__u32 /* types.h:26:25 */
+type X__be32 = X__u32 /* types.h:27:25 */
+type X__le64 = X__u64 /* types.h:28:25 */
+type X__be64 = X__u64 /* types.h:29:25 */
+
+type X__sum16 = X__u16 /* types.h:31:25 */
+type X__wsum = X__u32 /* types.h:32:25 */
+
+// aligned_u64 should be used in defining kernel<->userspace ABIs to avoid
+// common 32/64-bit compat problems.
+// 64-bit values align to 4-byte boundaries on x86_32 (and possibly other
+// architectures) and to 8-byte boundaries on 64-bit architectures. The new
+// aligned_64 type enforces 8-byte alignment so that structs containing
+// aligned_64 values have the same alignment on 32-bit and 64-bit architectures.
+// No conversions are necessary between 32-bit user-space and a 64-bit kernel.
+
+type X__poll_t = uint32 /* types.h:47:28 */
+
+// Timestamp structure for the timestamps in struct statx.
+//
+// tv_sec holds the number of seconds before (negative) or after (positive)
+// 00:00:00 1st January 1970 UTC.
+//
+// tv_nsec holds a number of nanoseconds (0..999,999,999) after the tv_sec time.
+//
+// __reserved is held in case we need a yet finer resolution.
type statx_timestamp = struct {
- Ftv_sec X__int64_t
- Ftv_nsec X__uint32_t
- F__statx_timestamp_pad1 [1]X__int32_t
-} /* statx.h:25:1 */
-
-// Warning: The kernel may add additional fields to this struct in the
-// future. Only use this struct for calling the statx function, not
-// for storing data. (Expansion will be controlled by the mask
-// argument of the statx function.)
+ Ftv_sec X__s64
+ Ftv_nsec X__u32
+ F__reserved X__s32
+} /* stat.h:56:1 */
+
+// Structures for the extended file attribute retrieval system call
+// (statx()).
+//
+// The caller passes a mask of what they're specifically interested in as a
+// parameter to statx(). What statx() actually got will be indicated in
+// st_mask upon return.
+//
+// For each bit in the mask argument:
+//
+// - if the datum is not supported:
+//
+// - the bit will be cleared, and
+//
+// - the datum will be set to an appropriate fabricated value if one is
+// available (eg. CIFS can take a default uid and gid), otherwise
+//
+// - the field will be cleared;
+//
+// - otherwise, if explicitly requested:
+//
+// - the datum will be synchronised to the server if AT_STATX_FORCE_SYNC is
+// set or if the datum is considered out of date, and
+//
+// - the field will be filled in and the bit will be set;
+//
+// - otherwise, if not requested, but available in approximate form without any
+// effort, it will be filled in anyway, and the bit will be set upon return
+// (it might not be up to date, however, and no attempt will be made to
+// synchronise the internal state first);
+//
+// - otherwise the field and the bit will be cleared before returning.
+//
+// Items in STATX_BASIC_STATS may be marked unavailable on return, but they
+// will have values installed for compatibility purposes so that stat() and
+// co. can be emulated in userspace.
type statx = struct {
- Fstx_mask X__uint32_t
- Fstx_blksize X__uint32_t
- Fstx_attributes X__uint64_t
- Fstx_nlink X__uint32_t
- Fstx_uid X__uint32_t
- Fstx_gid X__uint32_t
- Fstx_mode X__uint16_t
- F__statx_pad1 [1]X__uint16_t
- Fstx_ino X__uint64_t
- Fstx_size X__uint64_t
- Fstx_blocks X__uint64_t
- Fstx_attributes_mask X__uint64_t
+ Fstx_mask X__u32
+ Fstx_blksize X__u32
+ Fstx_attributes X__u64
+ Fstx_nlink X__u32
+ Fstx_uid X__u32
+ Fstx_gid X__u32
+ Fstx_mode X__u16
+ F__spare0 [1]X__u16
+ Fstx_ino X__u64
+ Fstx_size X__u64
+ Fstx_blocks X__u64
+ Fstx_attributes_mask X__u64
Fstx_atime struct {
- Ftv_sec X__int64_t
- Ftv_nsec X__uint32_t
- F__statx_timestamp_pad1 [1]X__int32_t
+ Ftv_sec X__s64
+ Ftv_nsec X__u32
+ F__reserved X__s32
}
Fstx_btime struct {
- Ftv_sec X__int64_t
- Ftv_nsec X__uint32_t
- F__statx_timestamp_pad1 [1]X__int32_t
+ Ftv_sec X__s64
+ Ftv_nsec X__u32
+ F__reserved X__s32
}
Fstx_ctime struct {
- Ftv_sec X__int64_t
- Ftv_nsec X__uint32_t
- F__statx_timestamp_pad1 [1]X__int32_t
+ Ftv_sec X__s64
+ Ftv_nsec X__u32
+ F__reserved X__s32
}
Fstx_mtime struct {
- Ftv_sec X__int64_t
- Ftv_nsec X__uint32_t
- F__statx_timestamp_pad1 [1]X__int32_t
- }
- Fstx_rdev_major X__uint32_t
- Fstx_rdev_minor X__uint32_t
- Fstx_dev_major X__uint32_t
- Fstx_dev_minor X__uint32_t
- F__statx_pad2 [14]X__uint64_t
-} /* statx.h:36:1 */
-
-// Copyright (C) 1991-2018 Free Software Foundation, Inc.
+ Ftv_sec X__s64
+ Ftv_nsec X__u32
+ F__reserved X__s32
+ }
+ Fstx_rdev_major X__u32
+ Fstx_rdev_minor X__u32
+ Fstx_dev_major X__u32
+ Fstx_dev_minor X__u32
+ Fstx_mnt_id X__u64
+ F__spare2 X__u64
+ F__spare3 [12]X__u64
+} /* stat.h:99:1 */
+
+// Copyright (C) 1991-2020 Free Software Foundation, Inc.
// This file is part of the GNU C Library.
//
// The GNU C Library is free software; you can redistribute it and/or
@@ -21354,11 +21985,11 @@ type statx = struct {
//
// You should have received a copy of the GNU Lesser General Public
// License along with the GNU C Library; if not, see
-// <http://www.gnu.org/licenses/>.
+// <https://www.gnu.org/licenses/>.
// POSIX Standard: 6.5 File Control Operations <fcntl.h>
-// Copyright (C) 1991-2018 Free Software Foundation, Inc.
+// Copyright (C) 1991-2020 Free Software Foundation, Inc.
// This file is part of the GNU C Library.
//
// The GNU C Library is free software; you can redistribute it and/or
@@ -21373,13 +22004,13 @@ type statx = struct {
//
// You should have received a copy of the GNU Lesser General Public
// License along with the GNU C Library; if not, see
-// <http://www.gnu.org/licenses/>.
+// <https://www.gnu.org/licenses/>.
// This must be early so <bits/fcntl.h> can define types winningly.
// Get __mode_t, __dev_t and __off_t .
// bits/types.h -- definitions of __*_t types underlying *_t types.
-// Copyright (C) 2002-2018 Free Software Foundation, Inc.
+// Copyright (C) 2002-2020 Free Software Foundation, Inc.
// This file is part of the GNU C Library.
//
// The GNU C Library is free software; you can redistribute it and/or
@@ -21394,14 +22025,14 @@ type statx = struct {
//
// You should have received a copy of the GNU Lesser General Public
// License along with the GNU C Library; if not, see
-// <http://www.gnu.org/licenses/>.
+// <https://www.gnu.org/licenses/>.
// Never include this file directly; use <sys/types.h> instead.
// Get the definitions of O_*, F_*, FD_*: all the
// numbers and flag bits for `open', `fcntl', et al.
// O_*, F_*, FD_* bit values for Linux.
-// Copyright (C) 1995-2018 Free Software Foundation, Inc.
+// Copyright (C) 1995-2020 Free Software Foundation, Inc.
// This file is part of the GNU C Library.
//
// The GNU C Library is free software; you can redistribute it and/or
@@ -21416,7 +22047,7 @@ type statx = struct {
//
// You should have received a copy of the GNU Lesser General Public
// License along with the GNU C Library. If not, see
-// <http://www.gnu.org/licenses/>.
+// <https://www.gnu.org/licenses/>.
type flock = struct {
Fl_type int16
@@ -21440,7 +22071,7 @@ type flock64 = struct {
// Include generic Linux declarations.
// O_*, F_*, FD_* bit values for Linux.
-// Copyright (C) 2001-2018 Free Software Foundation, Inc.
+// Copyright (C) 2001-2020 Free Software Foundation, Inc.
// This file is part of the GNU C Library.
//
// The GNU C Library is free software; you can redistribute it and/or
@@ -21455,7 +22086,7 @@ type flock64 = struct {
//
// You should have received a copy of the GNU Lesser General Public
// License along with the GNU C Library; if not, see
-// <http://www.gnu.org/licenses/>.
+// <https://www.gnu.org/licenses/>.
// This file contains shared definitions between Linux architectures
// and is included by <bits/fcntl.h> to declare them. The various
@@ -21471,7 +22102,7 @@ type flock64 = struct {
// #include <bits/fcntl-linux.h>
// Define struct iovec.
-// Copyright (C) 1996-2018 Free Software Foundation, Inc.
+// Copyright (C) 1996-2020 Free Software Foundation, Inc.
// This file is part of the GNU C Library.
//
// The GNU C Library is free software; you can redistribute it and/or
@@ -21486,9 +22117,9 @@ type flock64 = struct {
//
// You should have received a copy of the GNU Lesser General Public
// License along with the GNU C Library; if not, see
-// <http://www.gnu.org/licenses/>.
+// <https://www.gnu.org/licenses/>.
-// Copyright (C) 1989-2018 Free Software Foundation, Inc.
+// Copyright (C) 1989-2020 Free Software Foundation, Inc.
//
// This file is part of GCC.
//
@@ -21520,15 +22151,6 @@ type flock64 = struct {
// This avoids lossage on SunOS but only if stdtypes.h comes first.
// There's no way to win with the other order! Sun lossage.
-// On 4.3bsd-net2, make sure ansi.h is included, so we have
-// one less case to deal with in the following.
-// On FreeBSD 5, machine/ansi.h does not exist anymore...
-
-// In 4.3bsd-net2, machine/ansi.h defines these symbols, which are
-// defined if the corresponding type is *not* defined.
-// FreeBSD-2.1 defines _MACHINE_ANSI_H_ instead of _ANSI_H_.
-// NetBSD defines _I386_ANSI_H_ and _X86_64_ANSI_H_ instead of _ANSI_H_
-
// Sequent's header files use _PTRDIFF_T_ in some conflicting way.
// Just ignore it.
@@ -21565,11 +22187,6 @@ type flock64 = struct {
// Define this type if we are doing the whole job,
// or if we want this type in particular.
-// In 4.3bsd-net2, leave these undefined to indicate that size_t, etc.
-// are already defined.
-// BSD/OS 3.1 and FreeBSD [23].x require the MACHINE_ANSI_H check here.
-// NetBSD 5 requires the I386_ANSI_H and X86_64_ANSI_H checks here.
-
// A null pointer constant.
// Offset of member MEMBER in a struct of type TYPE.
@@ -21596,6 +22213,8 @@ type f_owner_ex = struct {
// Advise to `posix_fadvise'.
// Flags for SYNC_FILE_RANGE.
+// SYNC_FILE_RANGE_WRITE_AND_WAIT ensures all pages in the range are
+// written to disk before returning.
// Flags for SPLICE and VMSPLICE.
@@ -21666,11 +22285,11 @@ type file_handle = struct {
F__ccgo_pad1 [0]uint32
Fhandle_bytes uint32
Fhandle_type int32
-} /* fcntl-linux.h:350:1 */
+} /* fcntl-linux.h:357:1 */
// Define some inlines helping to catch common problems.
-// Copyright (C) 1991-2018 Free Software Foundation, Inc.
+// Copyright (C) 1991-2020 Free Software Foundation, Inc.
// This file is part of the GNU C Library.
//
// The GNU C Library is free software; you can redistribute it and/or
@@ -21685,9 +22304,9 @@ type file_handle = struct {
//
// You should have received a copy of the GNU Lesser General Public
// License along with the GNU C Library; if not, see
-// <http://www.gnu.org/licenses/>.
+// <https://www.gnu.org/licenses/>.
-// Copyright (C) 1991-2018 Free Software Foundation, Inc.
+// Copyright (C) 1991-2020 Free Software Foundation, Inc.
// This file is part of the GNU C Library.
//
// The GNU C Library is free software; you can redistribute it and/or
@@ -21702,10 +22321,10 @@ type file_handle = struct {
//
// You should have received a copy of the GNU Lesser General Public
// License along with the GNU C Library; if not, see
-// <http://www.gnu.org/licenses/>.
+// <https://www.gnu.org/licenses/>.
// Get the list of `ioctl' requests and related constants.
-// Copyright (C) 1996-2018 Free Software Foundation, Inc.
+// Copyright (C) 1996-2020 Free Software Foundation, Inc.
// This file is part of the GNU C Library.
//
// The GNU C Library is free software; you can redistribute it and/or
@@ -21720,7 +22339,7 @@ type file_handle = struct {
//
// You should have received a copy of the GNU Lesser General Public
// License along with the GNU C Library; if not, see
-// <http://www.gnu.org/licenses/>.
+// <https://www.gnu.org/licenses/>.
// Use the definitions from the kernel header files.
// SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note
@@ -21805,7 +22424,7 @@ type file_handle = struct {
// Define some types used by `ioctl' requests.
// Structure types for pre-termios terminal ioctls. Linux version.
-// Copyright (C) 1996-2018 Free Software Foundation, Inc.
+// Copyright (C) 1996-2020 Free Software Foundation, Inc.
// This file is part of the GNU C Library.
//
// The GNU C Library is free software; you can redistribute it and/or
@@ -21820,7 +22439,7 @@ type file_handle = struct {
//
// You should have received a copy of the GNU Lesser General Public
// License along with the GNU C Library; if not, see
-// <http://www.gnu.org/licenses/>.
+// <https://www.gnu.org/licenses/>.
// Get definition of constants for use with `ioctl'.
// SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note
@@ -21842,7 +22461,7 @@ type termio = struct {
F__ccgo_pad1 [1]byte
} /* ioctl-types.h:36:1 */
-// Copyright (C) 1991-2018 Free Software Foundation, Inc.
+// Copyright (C) 1991-2020 Free Software Foundation, Inc.
// This file is part of the GNU C Library.
//
// The GNU C Library is free software; you can redistribute it and/or
@@ -21857,11 +22476,11 @@ type termio = struct {
//
// You should have received a copy of the GNU Lesser General Public
// License along with the GNU C Library; if not, see
-// <http://www.gnu.org/licenses/>.
+// <https://www.gnu.org/licenses/>.
// POSIX Standard: 2.10 Symbolic Constants <unistd.h>
-// Copyright (C) 1991-2018 Free Software Foundation, Inc.
+// Copyright (C) 1991-2020 Free Software Foundation, Inc.
// This file is part of the GNU C Library.
//
// The GNU C Library is free software; you can redistribute it and/or
@@ -21876,7 +22495,7 @@ type termio = struct {
//
// You should have received a copy of the GNU Lesser General Public
// License along with the GNU C Library; if not, see
-// <http://www.gnu.org/licenses/>.
+// <https://www.gnu.org/licenses/>.
// These may be used to determine what facilities are present at compile time.
// Their values can be obtained at run time from `sysconf'.
@@ -22002,7 +22621,7 @@ type termio = struct {
//
// Define POSIX options for Linux.
-// Copyright (C) 1996-2018 Free Software Foundation, Inc.
+// Copyright (C) 1996-2020 Free Software Foundation, Inc.
// This file is part of the GNU C Library.
//
// The GNU C Library is free software; you can redistribute it and/or
@@ -22017,13 +22636,16 @@ type termio = struct {
//
// You should have received a copy of the GNU Lesser General Public
// License along with the GNU C Library; see the file COPYING.LIB. If
-// not, see <http://www.gnu.org/licenses/>.
+// not, see <https://www.gnu.org/licenses/>.
// Job control is supported.
// Processes have a saved set-user-ID and a saved set-group-ID.
-// Priority scheduling is supported.
+// Priority scheduling is not supported with the correct semantics,
+// but GNU/Linux applications expect that the corresponding interfaces
+// are available, even though the semantics do not meet the POSIX
+// requirements. See glibc bug 14829.
// Synchronizing file data is supported.
@@ -22126,7 +22748,7 @@ type termio = struct {
// Typed memory objects are not available.
// Get the environment definitions from Unix98.
-// Copyright (C) 1999-2018 Free Software Foundation, Inc.
+// Copyright (C) 1999-2020 Free Software Foundation, Inc.
// This file is part of the GNU C Library.
//
// The GNU C Library is free software; you can redistribute it and/or
@@ -22141,9 +22763,9 @@ type termio = struct {
//
// You should have received a copy of the GNU Lesser General Public
// License along with the GNU C Library; if not, see
-// <http://www.gnu.org/licenses/>.
+// <https://www.gnu.org/licenses/>.
-// Copyright (C) 1999-2018 Free Software Foundation, Inc.
+// Copyright (C) 1999-2020 Free Software Foundation, Inc.
// This file is part of the GNU C Library.
//
// The GNU C Library is free software; you can redistribute it and/or
@@ -22158,7 +22780,7 @@ type termio = struct {
//
// You should have received a copy of the GNU Lesser General Public
// License along with the GNU C Library; if not, see
-// <http://www.gnu.org/licenses/>.
+// <https://www.gnu.org/licenses/>.
// This header should define the following symbols under the described
// situations. A value `1' means that the model is always supported,
@@ -22192,7 +22814,7 @@ type termio = struct {
// All functions that are not declared anywhere else.
// bits/types.h -- definitions of __*_t types underlying *_t types.
-// Copyright (C) 2002-2018 Free Software Foundation, Inc.
+// Copyright (C) 2002-2020 Free Software Foundation, Inc.
// This file is part of the GNU C Library.
//
// The GNU C Library is free software; you can redistribute it and/or
@@ -22207,11 +22829,11 @@ type termio = struct {
//
// You should have received a copy of the GNU Lesser General Public
// License along with the GNU C Library; if not, see
-// <http://www.gnu.org/licenses/>.
+// <https://www.gnu.org/licenses/>.
// Never include this file directly; use <sys/types.h> instead.
-// Copyright (C) 1989-2018 Free Software Foundation, Inc.
+// Copyright (C) 1989-2020 Free Software Foundation, Inc.
//
// This file is part of GCC.
//
@@ -22243,15 +22865,6 @@ type termio = struct {
// This avoids lossage on SunOS but only if stdtypes.h comes first.
// There's no way to win with the other order! Sun lossage.
-// On 4.3bsd-net2, make sure ansi.h is included, so we have
-// one less case to deal with in the following.
-// On FreeBSD 5, machine/ansi.h does not exist anymore...
-
-// In 4.3bsd-net2, machine/ansi.h defines these symbols, which are
-// defined if the corresponding type is *not* defined.
-// FreeBSD-2.1 defines _MACHINE_ANSI_H_ instead of _ANSI_H_.
-// NetBSD defines _I386_ANSI_H_ and _X86_64_ANSI_H_ instead of _ANSI_H_
-
// Sequent's header files use _PTRDIFF_T_ in some conflicting way.
// Just ignore it.
@@ -22288,11 +22901,6 @@ type termio = struct {
// Define this type if we are doing the whole job,
// or if we want this type in particular.
-// In 4.3bsd-net2, leave these undefined to indicate that size_t, etc.
-// are already defined.
-// BSD/OS 3.1 and FreeBSD [23].x require the MACHINE_ANSI_H check here.
-// NetBSD 5 requires the I386_ANSI_H and X86_64_ANSI_H checks here.
-
// A null pointer constant.
// Offset of member MEMBER in a struct of type TYPE.
@@ -22304,10 +22912,8 @@ type Intptr_t = X__intptr_t /* unistd.h:267:20 */
type Socklen_t = X__socklen_t /* unistd.h:274:21 */
-// Define some macros helping to catch buffer overflows.
-
// #include <time.h>
-// Copyright (C) 1991-2018 Free Software Foundation, Inc.
+// Copyright (C) 1991-2020 Free Software Foundation, Inc.
// This file is part of the GNU C Library.
//
// The GNU C Library is free software; you can redistribute it and/or
@@ -22322,9 +22928,9 @@ type Socklen_t = X__socklen_t /* unistd.h:274:21 */
//
// You should have received a copy of the GNU Lesser General Public
// License along with the GNU C Library; if not, see
-// <http://www.gnu.org/licenses/>.
+// <https://www.gnu.org/licenses/>.
-// Copyright (C) 1991-2018 Free Software Foundation, Inc.
+// Copyright (C) 1991-2020 Free Software Foundation, Inc.
// This file is part of the GNU C Library.
//
// The GNU C Library is free software; you can redistribute it and/or
@@ -22339,10 +22945,10 @@ type Socklen_t = X__socklen_t /* unistd.h:274:21 */
//
// You should have received a copy of the GNU Lesser General Public
// License along with the GNU C Library; if not, see
-// <http://www.gnu.org/licenses/>.
+// <https://www.gnu.org/licenses/>.
// bits/types.h -- definitions of __*_t types underlying *_t types.
-// Copyright (C) 2002-2018 Free Software Foundation, Inc.
+// Copyright (C) 2002-2020 Free Software Foundation, Inc.
// This file is part of the GNU C Library.
//
// The GNU C Library is free software; you can redistribute it and/or
@@ -22357,12 +22963,12 @@ type Socklen_t = X__socklen_t /* unistd.h:274:21 */
//
// You should have received a copy of the GNU Lesser General Public
// License along with the GNU C Library; if not, see
-// <http://www.gnu.org/licenses/>.
+// <https://www.gnu.org/licenses/>.
// Never include this file directly; use <sys/types.h> instead.
// `fd_set' type and related macros, and `select'/`pselect' declarations.
-// Copyright (C) 1996-2018 Free Software Foundation, Inc.
+// Copyright (C) 1996-2020 Free Software Foundation, Inc.
// This file is part of the GNU C Library.
//
// The GNU C Library is free software; you can redistribute it and/or
@@ -22377,7 +22983,7 @@ type Socklen_t = X__socklen_t /* unistd.h:274:21 */
//
// You should have received a copy of the GNU Lesser General Public
// License along with the GNU C Library; if not, see
-// <http://www.gnu.org/licenses/>.
+// <https://www.gnu.org/licenses/>.
// POSIX 1003.1g: 6.2 Select from File Descriptor Sets <sys/select.h>
@@ -22390,8 +22996,6 @@ type timezone = struct {
Ftz_dsttime int32
} /* time.h:52:1 */
-type X__timezone_ptr_t = uintptr /* time.h:58:25 */
-
// Type of the second argument to `getitimer' and
// the second and third arguments `setitimer'.
type itimerval = struct {
@@ -22403,14 +23007,14 @@ type itimerval = struct {
Ftv_sec X__time_t
Ftv_usec X__suseconds_t
}
-} /* time.h:104:1 */
+} /* time.h:105:1 */
// Use the nicer parameter type only in GNU mode and not for C++ since the
// strict C++ rules prevent the automatic promotion.
-type X__itimer_which_t = uint32 /* time.h:115:29 */
+type X__itimer_which_t = uint32 /* time.h:116:29 */
// Define error_t.
-// Copyright (C) 1991-2018 Free Software Foundation, Inc.
+// Copyright (C) 1991-2020 Free Software Foundation, Inc.
// This file is part of the GNU C Library.
//
// The GNU C Library is free software; you can redistribute it and/or
@@ -22425,7 +23029,7 @@ type X__itimer_which_t = uint32 /* time.h:115:29 */
//
// You should have received a copy of the GNU Lesser General Public
// License along with the GNU C Library; if not, see
-// <http://www.gnu.org/licenses/>.
+// <https://www.gnu.org/licenses/>.
type Error_t = int32 /* error_t.h:22:13 */
@@ -22468,7 +23072,7 @@ type unixShm = struct {
FsharedMask U16
FexclMask U16
F__ccgo_pad1 [2]byte
-} /* sqlite3.c:34057:9 */
+} /* sqlite3.c:34431:9 */
// Try to determine if gethostuuid() is available based on standard
// macros. This might sometimes compute the wrong value for some
@@ -22501,7 +23105,7 @@ type unixShm = struct {
// a normal expected return code of SQLITE_BUSY or SQLITE_OK
// Forward references
-type UnixShm = unixShm /* sqlite3.c:34057:24 */ // Connection shared memory
+type UnixShm = unixShm /* sqlite3.c:34431:24 */ // Connection shared memory
type unixShmNode = struct {
FpInode uintptr
FpShmMutex uintptr
@@ -22515,10 +23119,10 @@ type unixShmNode = struct {
FnRef int32
FpFirst uintptr
FaLock [8]int32
-} /* sqlite3.c:34057:9 */
+} /* sqlite3.c:34431:9 */
// Connection shared memory
-type UnixShmNode = unixShmNode /* sqlite3.c:34058:28 */ // Shared memory instance
+type UnixShmNode = unixShmNode /* sqlite3.c:34432:28 */ // Shared memory instance
type unixInodeInfo = struct {
FfileId struct {
Fdev Dev_t
@@ -22536,18 +23140,18 @@ type unixInodeInfo = struct {
FpNext uintptr
FpPrev uintptr
F__ccgo_pad2 [4]byte
-} /* sqlite3.c:34057:9 */
+} /* sqlite3.c:34431:9 */
// Shared memory instance
-type UnixInodeInfo = unixInodeInfo /* sqlite3.c:34059:30 */ // An i-node
+type UnixInodeInfo = unixInodeInfo /* sqlite3.c:34433:30 */ // An i-node
type UnixUnusedFd1 = struct {
Ffd int32
Fflags int32
FpNext uintptr
-} /* sqlite3.c:34057:9 */
+} /* sqlite3.c:34431:9 */
// An i-node
-type UnixUnusedFd = UnixUnusedFd1 /* sqlite3.c:34060:29 */
+type UnixUnusedFd = UnixUnusedFd1 /* sqlite3.c:34434:29 */
// The unixFile structure is subclass of sqlite3_file specific to the unix
// VFS implementations.
@@ -22573,55 +23177,21 @@ type unixFile = struct {
FsectorSize int32
FdeviceCharacteristics int32
F__ccgo_pad2 [4]byte
-} /* sqlite3.c:34078:9 */
+} /* sqlite3.c:34452:9 */
// The unixFile structure is subclass of sqlite3_file specific to the unix
// VFS implementations.
-type UnixFile = unixFile /* sqlite3.c:34078:25 */
+type UnixFile = unixFile /* sqlite3.c:34452:25 */
// This variable holds the process id (pid) from when the xRandomness()
// method was called. If xOpen() is called from a different process id,
// indicating that a fork() has occurred, the PRNG will be reset.
-var randomnessPid Pid_t = 0 /* sqlite3.c:34139:14 */
+var randomnessPid Pid_t = 0 /* sqlite3.c:34513:14 */
// Allowed values for the unixFile.ctrlFlags bitmask:
// Include code that is common to all os_*.c files
-//************* Include os_common.h in the middle of os_unix.c **************
-//************* Begin file os_common.h **************************************
-// 2004 May 22
-//
-// The author disclaims copyright to this source code. In place of
-// a legal notice, here is a blessing:
-//
-// May you do good and not evil.
-// May you find forgiveness for yourself and forgive others.
-// May you share freely, never taking more than you give.
-//
-//
-//
-// This file contains macros and a little bit of code that is common to
-// all of the platform-specific files (os_*.c) and is #included into those
-// files.
-//
-// This file should be #included by the os_*.c files only. It is not a
-// general purpose header file.
-
-// At least two bugs have slipped in because we changed the MEMORY_DEBUG
-// macro to SQLITE_DEBUG and some older makefiles have not yet made the
-// switch. The following code should catch this problem at compile-time.
-
-// Macros for performance tracing. Normally turned off. Only works
-// on i486 hardware.
-
-// If we compile with the SQLITE_TEST macro set, then the following block
-// of code will give us the ability to simulate a disk I/O error. This
-// is used for testing the I/O recovery logic.
-
-// When testing, keep a count of the number of open files.
-
-//************* End of os_common.h ******************************************
-//************* Continuing where we left off in os_unix.c *******************
+// #include "os_common.h"
// Define various macros that are missing from some systems.
@@ -22641,7 +23211,7 @@ var randomnessPid Pid_t = 0 /* sqlite3.c:34139:14 */
//
// The safest way to deal with the problem is to always use this wrapper
// which always has the same well-defined interface.
-func posixOpen(tls *libc.TLS, zFile uintptr, flags int32, mode int32) int32 { /* sqlite3.c:34428:12: */
+func posixOpen(tls *libc.TLS, zFile uintptr, flags int32, mode int32) int32 { /* sqlite3.c:34604:12: */
bp := tls.Alloc(8)
defer tls.Free(8)
@@ -22656,93 +23226,93 @@ type unix_syscall = struct {
FzName uintptr
FpCurrent Sqlite3_syscall_ptr
FpDefault Sqlite3_syscall_ptr
-} /* sqlite3.c:34442:8 */
+} /* sqlite3.c:34618:8 */
// Many system calls are accessed through pointer-to-functions so that
// they may be overridden at runtime to facilitate fault injection during
// testing and sandboxing. The following array holds the names and pointers
// to all overrideable system calls.
var aSyscall = [29]unix_syscall{
- {FzName: ts + 2388 /* "open" */, FpCurrent: 0},
+ {FzName: ts + 3199 /* "open" */, FpCurrent: 0},
- {FzName: ts + 2393 /* "close" */, FpCurrent: 0},
+ {FzName: ts + 3204 /* "close" */, FpCurrent: 0},
- {FzName: ts + 2399 /* "access" */, FpCurrent: 0},
+ {FzName: ts + 3210 /* "access" */, FpCurrent: 0},
- {FzName: ts + 2406 /* "getcwd" */, FpCurrent: 0},
+ {FzName: ts + 3217 /* "getcwd" */, FpCurrent: 0},
- {FzName: ts + 2413 /* "stat" */, FpCurrent: 0},
+ {FzName: ts + 3224 /* "stat" */, FpCurrent: 0},
// The DJGPP compiler environment looks mostly like Unix, but it
// lacks the fcntl() system call. So redefine fcntl() to be something
// that always succeeds. This means that locking does not occur under
// DJGPP. But it is DOS - what did you expect?
- {FzName: ts + 2418 /* "fstat" */, FpCurrent: 0},
+ {FzName: ts + 3229 /* "fstat" */, FpCurrent: 0},
- {FzName: ts + 2424 /* "ftruncate" */, FpCurrent: 0},
+ {FzName: ts + 3235 /* "ftruncate" */, FpCurrent: 0},
- {FzName: ts + 2434 /* "fcntl" */, FpCurrent: 0},
+ {FzName: ts + 3245 /* "fcntl" */, FpCurrent: 0},
- {FzName: ts + 2440 /* "read" */, FpCurrent: 0},
+ {FzName: ts + 3251 /* "read" */, FpCurrent: 0},
- {FzName: ts + 2445 /* "pread" */},
+ {FzName: ts + 3256 /* "pread" */},
- {FzName: ts + 2451 /* "pread64" */},
+ {FzName: ts + 3262 /* "pread64" */},
- {FzName: ts + 2459 /* "write" */, FpCurrent: 0},
+ {FzName: ts + 3270 /* "write" */, FpCurrent: 0},
- {FzName: ts + 2465 /* "pwrite" */},
+ {FzName: ts + 3276 /* "pwrite" */},
- {FzName: ts + 2472 /* "pwrite64" */},
+ {FzName: ts + 3283 /* "pwrite64" */},
- {FzName: ts + 2481 /* "fchmod" */, FpCurrent: 0},
+ {FzName: ts + 3292 /* "fchmod" */, FpCurrent: 0},
- {FzName: ts + 2488 /* "fallocate" */},
+ {FzName: ts + 3299 /* "fallocate" */},
- {FzName: ts + 2498 /* "unlink" */, FpCurrent: 0},
+ {FzName: ts + 3309 /* "unlink" */, FpCurrent: 0},
- {FzName: ts + 2505 /* "openDirectory" */, FpCurrent: 0},
+ {FzName: ts + 3316 /* "openDirectory" */, FpCurrent: 0},
- {FzName: ts + 2519 /* "mkdir" */, FpCurrent: 0},
+ {FzName: ts + 3330 /* "mkdir" */, FpCurrent: 0},
- {FzName: ts + 2525 /* "rmdir" */, FpCurrent: 0},
+ {FzName: ts + 3336 /* "rmdir" */, FpCurrent: 0},
- {FzName: ts + 2531 /* "fchown" */, FpCurrent: 0},
+ {FzName: ts + 3342 /* "fchown" */, FpCurrent: 0},
- {FzName: ts + 2538 /* "geteuid" */, FpCurrent: 0},
+ {FzName: ts + 3349 /* "geteuid" */, FpCurrent: 0},
- {FzName: ts + 2546 /* "mmap" */, FpCurrent: 0},
+ {FzName: ts + 3357 /* "mmap" */, FpCurrent: 0},
- {FzName: ts + 2551 /* "munmap" */, FpCurrent: 0},
+ {FzName: ts + 3362 /* "munmap" */, FpCurrent: 0},
- {FzName: ts + 2558 /* "mremap" */, FpCurrent: 0},
+ {FzName: ts + 3369 /* "mremap" */, FpCurrent: 0},
- {FzName: ts + 2565 /* "getpagesize" */, FpCurrent: 0},
+ {FzName: ts + 3376 /* "getpagesize" */, FpCurrent: 0},
- {FzName: ts + 2577 /* "readlink" */, FpCurrent: 0},
+ {FzName: ts + 3388 /* "readlink" */, FpCurrent: 0},
- {FzName: ts + 2586 /* "lstat" */, FpCurrent: 0},
+ {FzName: ts + 3397 /* "lstat" */, FpCurrent: 0},
- {FzName: ts + 2592 /* "ioctl" */},
-} /* sqlite3.c:34446:3 */
+ {FzName: ts + 3403 /* "ioctl" */},
+} /* sqlite3.c:34622:3 */
// End of the overrideable system calls
// On some systems, calls to fchown() will trigger a message in a security
// log if they come from non-root processes. So avoid calling fchown() if
// we are not running as root.
-func robustFchown(tls *libc.TLS, fd int32, uid Uid_t, gid Gid_t) int32 { /* sqlite3.c:34616:12: */
- if (*(*func(*libc.TLS) Uid_t)(unsafe.Pointer((uintptr(unsafe.Pointer(&aSyscall)) + 21*12 + 4 /* &.pCurrent */))))(tls) != 0 {
+func robustFchown(tls *libc.TLS, fd int32, uid Uid_t, gid Gid_t) int32 { /* sqlite3.c:34792:12: */
+ if (*(*func(*libc.TLS) Uid_t)(unsafe.Pointer(uintptr(unsafe.Pointer(&aSyscall)) + 21*12 + 4)))(tls) != 0 {
return 0
}
- return (*(*func(*libc.TLS, int32, Uid_t, Gid_t) int32)(unsafe.Pointer((uintptr(unsafe.Pointer(&aSyscall)) + 20*12 + 4 /* &.pCurrent */))))(tls, fd, uid, gid)
+ return (*(*func(*libc.TLS, int32, Uid_t, Gid_t) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aSyscall)) + 20*12 + 4)))(tls, fd, uid, gid)
}
// This is the xSetSystemCall() method of sqlite3_vfs for all of the
// "unix" VFSes. Return SQLITE_OK opon successfully updating the
// system call pointer, or SQLITE_NOTFOUND if there is no configurable
// system call named zName.
-func unixSetSystemCall(tls *libc.TLS, pNotUsed uintptr, zName uintptr, pNewFunc Sqlite3_syscall_ptr) int32 { /* sqlite3.c:34630:12: */
+func unixSetSystemCall(tls *libc.TLS, pNotUsed uintptr, zName uintptr, pNewFunc Sqlite3_syscall_ptr) int32 { /* sqlite3.c:34806:12: */
var i uint32
var rc int32 = SQLITE_NOTFOUND
@@ -22751,7 +23321,7 @@ func unixSetSystemCall(tls *libc.TLS, pNotUsed uintptr, zName uintptr, pNewFunc
// If no zName is given, restore all system calls to their default
// settings and return NULL
rc = SQLITE_OK
- for i = uint32(0); i < (uint32(unsafe.Sizeof(aSyscall)) / uint32(unsafe.Sizeof(unix_syscall{}))); i++ {
+ for i = uint32(0); i < uint32(unsafe.Sizeof(aSyscall))/uint32(unsafe.Sizeof(unix_syscall{})); i++ {
if aSyscall[i].FpDefault != 0 {
aSyscall[i].FpCurrent = aSyscall[i].FpDefault
}
@@ -22759,7 +23329,7 @@ func unixSetSystemCall(tls *libc.TLS, pNotUsed uintptr, zName uintptr, pNewFunc
} else {
// If zName is specified, operate on only the one system call
// specified.
- for i = uint32(0); i < (uint32(unsafe.Sizeof(aSyscall)) / uint32(unsafe.Sizeof(unix_syscall{}))); i++ {
+ for i = uint32(0); i < uint32(unsafe.Sizeof(aSyscall))/uint32(unsafe.Sizeof(unix_syscall{})); i++ {
if libc.Xstrcmp(tls, zName, aSyscall[i].FzName) == 0 {
if aSyscall[i].FpDefault == uintptr(0) {
aSyscall[i].FpDefault = aSyscall[i].FpCurrent
@@ -22779,11 +23349,11 @@ func unixSetSystemCall(tls *libc.TLS, pNotUsed uintptr, zName uintptr, pNewFunc
// Return the value of a system call. Return NULL if zName is not a
// recognized system call name. NULL is also returned if the system call
// is currently undefined.
-func unixGetSystemCall(tls *libc.TLS, pNotUsed uintptr, zName uintptr) Sqlite3_syscall_ptr { /* sqlite3.c:34673:28: */
+func unixGetSystemCall(tls *libc.TLS, pNotUsed uintptr, zName uintptr) Sqlite3_syscall_ptr { /* sqlite3.c:34849:28: */
var i uint32
_ = pNotUsed
- for i = uint32(0); i < (uint32(unsafe.Sizeof(aSyscall)) / uint32(unsafe.Sizeof(unix_syscall{}))); i++ {
+ for i = uint32(0); i < uint32(unsafe.Sizeof(aSyscall))/uint32(unsafe.Sizeof(unix_syscall{})); i++ {
if libc.Xstrcmp(tls, zName, aSyscall[i].FzName) == 0 {
return aSyscall[i].FpCurrent
}
@@ -22795,18 +23365,18 @@ func unixGetSystemCall(tls *libc.TLS, pNotUsed uintptr, zName uintptr) Sqlite3_s
// then return the name of the first system call. Return NULL if zName
// is the last system call or if zName is not the name of a valid
// system call.
-func unixNextSystemCall(tls *libc.TLS, p uintptr, zName uintptr) uintptr { /* sqlite3.c:34692:19: */
+func unixNextSystemCall(tls *libc.TLS, p uintptr, zName uintptr) uintptr { /* sqlite3.c:34868:19: */
var i int32 = -1
_ = p
if zName != 0 {
- for i = 0; i < ((int32(uint32(unsafe.Sizeof(aSyscall)) / uint32(unsafe.Sizeof(unix_syscall{})))) - 1); i++ {
+ for i = 0; i < int32(uint32(unsafe.Sizeof(aSyscall))/uint32(unsafe.Sizeof(unix_syscall{})))-1; i++ {
if libc.Xstrcmp(tls, zName, aSyscall[i].FzName) == 0 {
break
}
}
}
- for i++; i < (int32(uint32(unsafe.Sizeof(aSyscall)) / uint32(unsafe.Sizeof(unix_syscall{})))); i++ {
+ for i++; i < int32(uint32(unsafe.Sizeof(aSyscall))/uint32(unsafe.Sizeof(unix_syscall{}))); i++ {
if aSyscall[i].FpCurrent != uintptr(0) {
return aSyscall[i].FzName
}
@@ -22833,7 +23403,7 @@ func unixNextSystemCall(tls *libc.TLS, p uintptr, zName uintptr) uintptr { /* sq
// transaction crashes and leaves behind hot journals, then any
// process that is able to write to the database will also be able to
// recover the hot journals.
-func robust_open(tls *libc.TLS, z uintptr, f int32, m Mode_t) int32 { /* sqlite3.c:34733:12: */
+func robust_open(tls *libc.TLS, z uintptr, f int32, m Mode_t) int32 { /* sqlite3.c:34909:12: */
bp := tls.Alloc(120)
defer tls.Free(120)
@@ -22845,9 +23415,9 @@ func robust_open(tls *libc.TLS, z uintptr, f int32, m Mode_t) int32 { /* sqlite3
m2 = uint32(SQLITE_DEFAULT_FILE_PERMISSIONS)
}
for 1 != 0 {
- fd = (*(*func(*libc.TLS, uintptr, int32, int32) int32)(unsafe.Pointer((uintptr(unsafe.Pointer(&aSyscall)) + 4 /* &.pCurrent */))))(tls, z, (f | 02000000), int32(m2))
+ fd = (*(*func(*libc.TLS, uintptr, int32, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aSyscall)) + 4)))(tls, z, f|02000000, int32(m2))
if fd < 0 {
- if (*(*int32)(unsafe.Pointer(libc.X__errno_location(tls)))) == EINTR {
+ if *(*int32)(unsafe.Pointer(libc.X__errno_location(tls))) == EINTR {
continue
}
break
@@ -22855,11 +23425,11 @@ func robust_open(tls *libc.TLS, z uintptr, f int32, m Mode_t) int32 { /* sqlite3
if fd >= SQLITE_MINIMUM_FILE_DESCRIPTOR {
break
}
- (*(*func(*libc.TLS, int32) int32)(unsafe.Pointer((uintptr(unsafe.Pointer(&aSyscall)) + 1*12 + 4 /* &.pCurrent */))))(tls, fd)
+ (*(*func(*libc.TLS, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aSyscall)) + 1*12 + 4)))(tls, fd)
Xsqlite3_log(tls, SQLITE_WARNING,
- ts+2598 /* "attempt to open ..." */, libc.VaList(bp, z, fd))
+ ts+3409 /* "attempt to open ..." */, libc.VaList(bp, z, fd))
fd = -1
- if (*(*func(*libc.TLS, uintptr, int32, int32) int32)(unsafe.Pointer((uintptr(unsafe.Pointer(&aSyscall)) + 4 /* &.pCurrent */))))(tls, ts+2641 /* "/dev/null" */, O_RDONLY, int32(m)) < 0 {
+ if (*(*func(*libc.TLS, uintptr, int32, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aSyscall)) + 4)))(tls, ts+3452, O_RDONLY, int32(m)) < 0 {
break
}
}
@@ -22867,10 +23437,10 @@ func robust_open(tls *libc.TLS, z uintptr, f int32, m Mode_t) int32 { /* sqlite3
if m != Mode_t(0) {
// var statbuf stat at bp+16, 104
- if (((*(*func(*libc.TLS, int32, uintptr) int32)(unsafe.Pointer((uintptr(unsafe.Pointer(&aSyscall)) + 5*12 + 4 /* &.pCurrent */))))(tls, fd, bp+16 /* &statbuf */) == 0) &&
- ((*stat)(unsafe.Pointer(bp+16 /* &statbuf */)).Fst_size == int64(0))) &&
- (((*stat)(unsafe.Pointer(bp+16 /* &statbuf */)).Fst_mode & X__mode_t(0777)) != m) {
- (*(*func(*libc.TLS, int32, Mode_t) int32)(unsafe.Pointer((uintptr(unsafe.Pointer(&aSyscall)) + 14*12 + 4 /* &.pCurrent */))))(tls, fd, m)
+ if (*(*func(*libc.TLS, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aSyscall)) + 5*12 + 4)))(tls, fd, bp+16) == 0 &&
+ (*stat)(unsafe.Pointer(bp+16)).Fst_size == int64(0) &&
+ (*stat)(unsafe.Pointer(bp+16)).Fst_mode&X__mode_t(0777) != m {
+ (*(*func(*libc.TLS, int32, Mode_t) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aSyscall)) + 14*12 + 4)))(tls, fd, m)
}
}
}
@@ -22900,14 +23470,14 @@ func robust_open(tls *libc.TLS, z uintptr, f int32, m Mode_t) int32 { /* sqlite3
// OK: enter(unixBigLock)
// OK: enter(pLockInfo)
// ERROR: enter(pLockInfo), enter(unixBigLock)
-var unixBigLock uintptr = uintptr(0) /* sqlite3.c:34795:22 */
+var unixBigLock uintptr = uintptr(0) /* sqlite3.c:34971:22 */
-func unixEnterMutex(tls *libc.TLS) { /* sqlite3.c:34796:13: */
+func unixEnterMutex(tls *libc.TLS) { /* sqlite3.c:34972:13: */
// Not a recursive mutex
Xsqlite3_mutex_enter(tls, unixBigLock)
}
-func unixLeaveMutex(tls *libc.TLS) { /* sqlite3.c:34800:13: */
+func unixLeaveMutex(tls *libc.TLS) { /* sqlite3.c:34976:13: */
Xsqlite3_mutex_leave(tls, unixBigLock)
}
@@ -22917,10 +23487,10 @@ func unixLeaveMutex(tls *libc.TLS) { /* sqlite3.c:34800:13: */
// All calls to ftruncate() within this file should be made through
// this wrapper. On the Android platform, bypassing the logic below
// could lead to a corrupt database.
-func robust_ftruncate(tls *libc.TLS, h int32, sz Sqlite3_int64) int32 { /* sqlite3.c:34896:12: */
+func robust_ftruncate(tls *libc.TLS, h int32, sz Sqlite3_int64) int32 { /* sqlite3.c:35072:12: */
var rc int32
- for ok := true; ok; ok = ((rc < 0) && ((*(*int32)(unsafe.Pointer(libc.X__errno_location(tls)))) == EINTR)) {
- rc = (*(*func(*libc.TLS, int32, Off_t) int32)(unsafe.Pointer((uintptr(unsafe.Pointer(&aSyscall)) + 6*12 + 4 /* &.pCurrent */))))(tls, h, sz)
+ for ok := true; ok; ok = rc < 0 && *(*int32)(unsafe.Pointer(libc.X__errno_location(tls))) == EINTR {
+ rc = (*(*func(*libc.TLS, int32, Off_t) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aSyscall)) + 6*12 + 4)))(tls, h, sz)
}
return rc
}
@@ -22933,7 +23503,7 @@ func robust_ftruncate(tls *libc.TLS, h int32, sz Sqlite3_int64) int32 { /* sqlit
//
// Errors during initialization of locks, or file system support for locks,
// should handle ENOLCK, ENOTSUP, EOPNOTSUPP separately.
-func sqliteErrorFromPosixError(tls *libc.TLS, posixError int32, sqliteIOErr int32) int32 { /* sqlite3.c:34921:12: */
+func sqliteErrorFromPosixError(tls *libc.TLS, posixError int32, sqliteIOErr int32) int32 { /* sqlite3.c:35097:12: */
switch posixError {
case EACCES:
@@ -22982,7 +23552,7 @@ type vxworksFileId = struct {
FnRef int32
FnName int32
FzCanonicalName uintptr
-} /* sqlite3.c:34963:1 */
+} /* sqlite3.c:35139:1 */
// ************** End of Unique File ID Utility Used By VxWorks ****************
//
@@ -23083,12 +23653,12 @@ type vxworksFileId = struct {
type unixFileId = struct {
Fdev Dev_t
Fino U64
-} /* sqlite3.c:34057:9 */
+} /* sqlite3.c:34431:9 */
// A lists of all unixInodeInfo objects.
//
// Must hold unixBigLock in order to read or write this variable.
-var inodeList uintptr = uintptr(0) /* sqlite3.c:35245:22 */
+var inodeList uintptr = uintptr(0) /* sqlite3.c:35421:22 */
// All unixInodeInfo objects
@@ -23106,7 +23676,7 @@ var inodeList uintptr = uintptr(0) /* sqlite3.c:35245:22 */
// The two subsequent arguments should be the name of the OS function that
// failed (e.g. "unlink", "open") and the associated file-system path,
// if any.
-func unixLogErrorAtLine(tls *libc.TLS, errcode int32, zFunc uintptr, zPath uintptr, iLine int32) int32 { /* sqlite3.c:35280:12: */
+func unixLogErrorAtLine(tls *libc.TLS, errcode int32, zFunc uintptr, zPath uintptr, iLine int32) int32 { /* sqlite3.c:35456:12: */
bp := tls.Alloc(40)
defer tls.Free(40)
@@ -23117,13 +23687,13 @@ func unixLogErrorAtLine(tls *libc.TLS, errcode int32, zFunc uintptr, zPath uintp
// the strerror() function to obtain the human-readable error message
// equivalent to errno. Otherwise, use strerror_r().
// This is a threadsafe build, but strerror_r() is not available.
- zErr = ts + 755 /* "" */
+ zErr = ts + 1543 /* "" */
if zPath == uintptr(0) {
- zPath = ts + 755 /* "" */
+ zPath = ts + 1543 /* "" */
}
Xsqlite3_log(tls, errcode,
- ts+2651, /* "os_unix.c:%d: (%..." */
+ ts+3462, /* "os_unix.c:%d: (%..." */
libc.VaList(bp, iLine, iErrno, zFunc, zPath, zErr))
return errcode
@@ -23140,9 +23710,9 @@ func unixLogErrorAtLine(tls *libc.TLS, errcode int32, zFunc uintptr, zPath uintp
// file descriptor might have already been reused by another thread.
// So we don't even try to recover from an EINTR. Just log the error
// and move on.
-func robust_close(tls *libc.TLS, pFile uintptr, h int32, lineno int32) { /* sqlite3.c:35345:13: */
- if (*(*func(*libc.TLS, int32) int32)(unsafe.Pointer((uintptr(unsafe.Pointer(&aSyscall)) + 1*12 + 4 /* &.pCurrent */))))(tls, h) != 0 {
- unixLogErrorAtLine(tls, (SQLITE_IOERR | (int32(16) << 8)), ts+2393, /* "close" */
+func robust_close(tls *libc.TLS, pFile uintptr, h int32, lineno int32) { /* sqlite3.c:35521:13: */
+ if (*(*func(*libc.TLS, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aSyscall)) + 1*12 + 4)))(tls, h) != 0 {
+ unixLogErrorAtLine(tls, SQLITE_IOERR|int32(16)<<8, ts+3204, /* "close" */
func() uintptr {
if pFile != 0 {
return (*UnixFile)(unsafe.Pointer(pFile)).FzPath
@@ -23154,19 +23724,19 @@ func robust_close(tls *libc.TLS, pFile uintptr, h int32, lineno int32) { /* sqli
// Set the pFile->lastErrno. Do this in a subroutine as that provides
// a convenient place to set a breakpoint.
-func storeLastErrno(tls *libc.TLS, pFile uintptr, error int32) { /* sqlite3.c:35356:13: */
+func storeLastErrno(tls *libc.TLS, pFile uintptr, error int32) { /* sqlite3.c:35532:13: */
(*UnixFile)(unsafe.Pointer(pFile)).FlastErrno = error
}
// Close all file descriptors accumuated in the unixInodeInfo->pUnused list.
-func closePendingFds(tls *libc.TLS, pFile uintptr) { /* sqlite3.c:35363:13: */
+func closePendingFds(tls *libc.TLS, pFile uintptr) { /* sqlite3.c:35539:13: */
var pInode uintptr = (*UnixFile)(unsafe.Pointer(pFile)).FpInode
var p uintptr
var pNext uintptr
for p = (*UnixInodeInfo)(unsafe.Pointer(pInode)).FpUnused; p != 0; p = pNext {
pNext = (*UnixUnusedFd)(unsafe.Pointer(p)).FpNext
- robust_close(tls, pFile, (*UnixUnusedFd)(unsafe.Pointer(p)).Ffd, 35370)
+ robust_close(tls, pFile, (*UnixUnusedFd)(unsafe.Pointer(p)).Ffd, 35546)
Xsqlite3_free(tls, p)
}
(*UnixInodeInfo)(unsafe.Pointer(pInode)).FpUnused = uintptr(0)
@@ -23176,7 +23746,7 @@ func closePendingFds(tls *libc.TLS, pFile uintptr) { /* sqlite3.c:35363:13: */
//
// The global mutex must be held when this routine is called, but the mutex
// on the inode being deleted must NOT be held.
-func releaseInodeInfo(tls *libc.TLS, pFile uintptr) { /* sqlite3.c:35382:13: */
+func releaseInodeInfo(tls *libc.TLS, pFile uintptr) { /* sqlite3.c:35558:13: */
var pInode uintptr = (*UnixFile)(unsafe.Pointer(pFile)).FpInode
if pInode != 0 {
@@ -23210,7 +23780,7 @@ func releaseInodeInfo(tls *libc.TLS, pFile uintptr) { /* sqlite3.c:35382:13: */
// The global mutex must held when calling this routine.
//
// Return an appropriate error code.
-func findInodeInfo(tls *libc.TLS, pFile uintptr, ppInode uintptr) int32 { /* sqlite3.c:35419:12: */
+func findInodeInfo(tls *libc.TLS, pFile uintptr, ppInode uintptr) int32 { /* sqlite3.c:35595:12: */
bp := tls.Alloc(120)
defer tls.Free(120)
@@ -23225,7 +23795,7 @@ func findInodeInfo(tls *libc.TLS, pFile uintptr, ppInode uintptr) int32 { /* sql
// Get low-level information about the file that we can used to
// create a unique name for the file.
fd = (*UnixFile)(unsafe.Pointer(pFile)).Fh
- rc = (*(*func(*libc.TLS, int32, uintptr) int32)(unsafe.Pointer((uintptr(unsafe.Pointer(&aSyscall)) + 5*12 + 4 /* &.pCurrent */))))(tls, fd, bp /* &statbuf */)
+ rc = (*(*func(*libc.TLS, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aSyscall)) + 5*12 + 4)))(tls, fd, bp)
if rc != 0 {
storeLastErrno(tls, pFile, *(*int32)(unsafe.Pointer(libc.X__errno_location(tls))))
return SQLITE_IOERR
@@ -23236,7 +23806,7 @@ func findInodeInfo(tls *libc.TLS, pFile uintptr, ppInode uintptr) int32 { /* sql
(*unixFileId)(unsafe.Pointer(bp + 104 /* &fileId */)).Fino = (*stat)(unsafe.Pointer(bp /* &statbuf */)).Fst_ino
pInode = inodeList
- for (pInode != 0) && (libc.Xmemcmp(tls, bp+104 /* &fileId */, (pInode /* &.fileId */), uint32(unsafe.Sizeof(unixFileId{}))) != 0) {
+ for pInode != 0 && libc.Xmemcmp(tls, bp+104, pInode, uint32(unsafe.Sizeof(unixFileId{}))) != 0 {
pInode = (*UnixInodeInfo)(unsafe.Pointer(pInode)).FpNext
}
if pInode == uintptr(0) {
@@ -23245,7 +23815,7 @@ func findInodeInfo(tls *libc.TLS, pFile uintptr, ppInode uintptr) int32 { /* sql
return SQLITE_NOMEM
}
libc.Xmemset(tls, pInode, 0, uint32(unsafe.Sizeof(UnixInodeInfo{})))
- libc.Xmemcpy(tls, (pInode /* &.fileId */), bp+104 /* &fileId */, uint32(unsafe.Sizeof(unixFileId{})))
+ libc.Xmemcpy(tls, pInode, bp+104 /* &fileId */, uint32(unsafe.Sizeof(unixFileId{})))
if Xsqlite3Config.FbCoreMutex != 0 {
(*UnixInodeInfo)(unsafe.Pointer(pInode)).FpLockMutex = Xsqlite3_mutex_alloc(tls, SQLITE_MUTEX_FAST)
if (*UnixInodeInfo)(unsafe.Pointer(pInode)).FpLockMutex == uintptr(0) {
@@ -23269,14 +23839,14 @@ func findInodeInfo(tls *libc.TLS, pFile uintptr, ppInode uintptr) int32 { /* sql
}
// Return TRUE if pFile has been renamed or unlinked since it was first opened.
-func fileHasMoved(tls *libc.TLS, pFile uintptr) int32 { /* sqlite3.c:35511:12: */
+func fileHasMoved(tls *libc.TLS, pFile uintptr) int32 { /* sqlite3.c:35687:12: */
bp := tls.Alloc(104)
defer tls.Free(104)
// var buf stat at bp, 104
- return (libc.Bool32(((*UnixFile)(unsafe.Pointer(pFile)).FpInode != uintptr(0)) && (((*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer((uintptr(unsafe.Pointer(&aSyscall)) + 4*12 + 4 /* &.pCurrent */))))(tls, (*UnixFile)(unsafe.Pointer(pFile)).FzPath, bp /* &buf */) != 0) ||
- ((*stat)(unsafe.Pointer(bp /* &buf */)).Fst_ino != (*UnixInodeInfo)(unsafe.Pointer((*UnixFile)(unsafe.Pointer(pFile)).FpInode)).FfileId.Fino))))
+ return libc.Bool32((*UnixFile)(unsafe.Pointer(pFile)).FpInode != uintptr(0) && ((*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aSyscall)) + 4*12 + 4)))(tls, (*UnixFile)(unsafe.Pointer(pFile)).FzPath, bp) != 0 ||
+ (*stat)(unsafe.Pointer(bp)).Fst_ino != (*UnixInodeInfo)(unsafe.Pointer((*UnixFile)(unsafe.Pointer(pFile)).FpInode)).FfileId.Fino))
}
// Check a unixFile that is a database. Verify the following:
@@ -23286,7 +23856,7 @@ func fileHasMoved(tls *libc.TLS, pFile uintptr) int32 { /* sqlite3.c:35511:12: *
// (3) The file has not been renamed or unlinked
//
// Issue sqlite3_log(SQLITE_WARNING,...) messages if anything is not right.
-func verifyDbFile(tls *libc.TLS, pFile uintptr) { /* sqlite3.c:35532:13: */
+func verifyDbFile(tls *libc.TLS, pFile uintptr) { /* sqlite3.c:35708:13: */
bp := tls.Alloc(136)
defer tls.Free(136)
@@ -23295,25 +23865,25 @@ func verifyDbFile(tls *libc.TLS, pFile uintptr) { /* sqlite3.c:35532:13: */
var rc int32
// These verifications occurs for the main database only
- if (int32((*UnixFile)(unsafe.Pointer(pFile)).FctrlFlags) & UNIXFILE_NOLOCK) != 0 {
+ if int32((*UnixFile)(unsafe.Pointer(pFile)).FctrlFlags)&UNIXFILE_NOLOCK != 0 {
return
}
- rc = (*(*func(*libc.TLS, int32, uintptr) int32)(unsafe.Pointer((uintptr(unsafe.Pointer(&aSyscall)) + 5*12 + 4 /* &.pCurrent */))))(tls, (*UnixFile)(unsafe.Pointer(pFile)).Fh, bp+32 /* &buf */)
+ rc = (*(*func(*libc.TLS, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aSyscall)) + 5*12 + 4)))(tls, (*UnixFile)(unsafe.Pointer(pFile)).Fh, bp+32)
if rc != 0 {
- Xsqlite3_log(tls, SQLITE_WARNING, ts+2682 /* "cannot fstat db ..." */, libc.VaList(bp, (*UnixFile)(unsafe.Pointer(pFile)).FzPath))
+ Xsqlite3_log(tls, SQLITE_WARNING, ts+3493 /* "cannot fstat db ..." */, libc.VaList(bp, (*UnixFile)(unsafe.Pointer(pFile)).FzPath))
return
}
- if (*stat)(unsafe.Pointer(bp+32 /* &buf */)).Fst_nlink == X__nlink_t(0) {
- Xsqlite3_log(tls, SQLITE_WARNING, ts+2706 /* "file unlinked wh..." */, libc.VaList(bp+8, (*UnixFile)(unsafe.Pointer(pFile)).FzPath))
+ if (*stat)(unsafe.Pointer(bp+32)).Fst_nlink == X__nlink_t(0) {
+ Xsqlite3_log(tls, SQLITE_WARNING, ts+3517 /* "file unlinked wh..." */, libc.VaList(bp+8, (*UnixFile)(unsafe.Pointer(pFile)).FzPath))
return
}
- if (*stat)(unsafe.Pointer(bp+32 /* &buf */)).Fst_nlink > X__nlink_t(1) {
- Xsqlite3_log(tls, SQLITE_WARNING, ts+2735 /* "multiple links t..." */, libc.VaList(bp+16, (*UnixFile)(unsafe.Pointer(pFile)).FzPath))
+ if (*stat)(unsafe.Pointer(bp+32)).Fst_nlink > X__nlink_t(1) {
+ Xsqlite3_log(tls, SQLITE_WARNING, ts+3546 /* "multiple links t..." */, libc.VaList(bp+16, (*UnixFile)(unsafe.Pointer(pFile)).FzPath))
return
}
if fileHasMoved(tls, pFile) != 0 {
- Xsqlite3_log(tls, SQLITE_WARNING, ts+2762 /* "file renamed whi..." */, libc.VaList(bp+24, (*UnixFile)(unsafe.Pointer(pFile)).FzPath))
+ Xsqlite3_log(tls, SQLITE_WARNING, ts+3573 /* "file renamed whi..." */, libc.VaList(bp+24, (*UnixFile)(unsafe.Pointer(pFile)).FzPath))
return
}
}
@@ -23322,7 +23892,7 @@ func verifyDbFile(tls *libc.TLS, pFile uintptr) { /* sqlite3.c:35532:13: */
// file by this or any other process. If such a lock is held, set *pResOut
// to a non-zero value otherwise *pResOut is set to zero. The return value
// is set to SQLITE_OK unless an I/O error occurs during lock checking.
-func unixCheckReservedLock(tls *libc.TLS, id uintptr, pResOut uintptr) int32 { /* sqlite3.c:35565:12: */
+func unixCheckReservedLock(tls *libc.TLS, id uintptr, pResOut uintptr) int32 { /* sqlite3.c:35741:12: */
bp := tls.Alloc(40)
defer tls.Free(40)
@@ -23342,13 +23912,13 @@ func unixCheckReservedLock(tls *libc.TLS, id uintptr, pResOut uintptr) int32 { /
// var lock flock at bp+8, 32
(*flock)(unsafe.Pointer(bp + 8 /* &lock */)).Fl_whence = int16(SEEK_SET)
- (*flock)(unsafe.Pointer(bp + 8 /* &lock */)).Fl_start = (X__off64_t(Xsqlite3PendingByte + 1))
+ (*flock)(unsafe.Pointer(bp + 8 /* &lock */)).Fl_start = X__off64_t(Xsqlite3PendingByte + 1)
(*flock)(unsafe.Pointer(bp + 8 /* &lock */)).Fl_len = int64(1)
(*flock)(unsafe.Pointer(bp + 8 /* &lock */)).Fl_type = int16(F_WRLCK)
- if (*(*func(*libc.TLS, int32, int32, uintptr) int32)(unsafe.Pointer((uintptr(unsafe.Pointer(&aSyscall)) + 7*12 + 4 /* &.pCurrent */))))(tls, (*UnixFile)(unsafe.Pointer(pFile)).Fh, F_GETLK64, libc.VaList(bp, bp+8 /* &lock */)) != 0 {
- rc = (SQLITE_IOERR | (int32(14) << 8))
+ if (*(*func(*libc.TLS, int32, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aSyscall)) + 7*12 + 4)))(tls, (*UnixFile)(unsafe.Pointer(pFile)).Fh, F_GETLK64, libc.VaList(bp, bp+8)) != 0 {
+ rc = SQLITE_IOERR | int32(14)<<8
storeLastErrno(tls, pFile, *(*int32)(unsafe.Pointer(libc.X__errno_location(tls))))
- } else if int32((*flock)(unsafe.Pointer(bp+8 /* &lock */)).Fl_type) != F_UNLCK {
+ } else if int32((*flock)(unsafe.Pointer(bp+8)).Fl_type) != F_UNLCK {
reserved = 1
}
}
@@ -23388,22 +23958,22 @@ func unixCheckReservedLock(tls *libc.TLS, id uintptr, pResOut uintptr) int32 { /
//
// Zero is returned if the call completes successfully, or -1 if a call
// to fcntl() fails. In this case, errno is set appropriately (by fcntl()).
-func unixFileLock(tls *libc.TLS, pFile uintptr, pLock uintptr) int32 { /* sqlite3.c:35666:12: */
+func unixFileLock(tls *libc.TLS, pFile uintptr, pLock uintptr) int32 { /* sqlite3.c:35842:12: */
bp := tls.Alloc(48)
defer tls.Free(48)
var rc int32
var pInode uintptr = (*UnixFile)(unsafe.Pointer(pFile)).FpInode
- if (int32((*UnixFile)(unsafe.Pointer(pFile)).FctrlFlags) & (UNIXFILE_EXCL | UNIXFILE_RDONLY)) == UNIXFILE_EXCL {
+ if int32((*UnixFile)(unsafe.Pointer(pFile)).FctrlFlags)&(UNIXFILE_EXCL|UNIXFILE_RDONLY) == UNIXFILE_EXCL {
if int32((*UnixInodeInfo)(unsafe.Pointer(pInode)).FbProcessLock) == 0 {
// var lock flock at bp+16, 32
(*flock)(unsafe.Pointer(bp + 16 /* &lock */)).Fl_whence = int16(SEEK_SET)
- (*flock)(unsafe.Pointer(bp + 16 /* &lock */)).Fl_start = (X__off64_t(Xsqlite3PendingByte + 2))
+ (*flock)(unsafe.Pointer(bp + 16 /* &lock */)).Fl_start = X__off64_t(Xsqlite3PendingByte + 2)
(*flock)(unsafe.Pointer(bp + 16 /* &lock */)).Fl_len = int64(SHARED_SIZE)
(*flock)(unsafe.Pointer(bp + 16 /* &lock */)).Fl_type = int16(F_WRLCK)
- rc = (*(*func(*libc.TLS, int32, int32, uintptr) int32)(unsafe.Pointer((uintptr(unsafe.Pointer(&aSyscall)) + 7*12 + 4 /* &.pCurrent */))))(tls, (*UnixFile)(unsafe.Pointer(pFile)).Fh, F_SETLK64, libc.VaList(bp, bp+16 /* &lock */))
+ rc = (*(*func(*libc.TLS, int32, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aSyscall)) + 7*12 + 4)))(tls, (*UnixFile)(unsafe.Pointer(pFile)).Fh, F_SETLK64, libc.VaList(bp, bp+16))
if rc < 0 {
return rc
}
@@ -23413,7 +23983,7 @@ func unixFileLock(tls *libc.TLS, pFile uintptr, pLock uintptr) int32 { /* sqlite
rc = 0
}
} else {
- rc = (*(*func(*libc.TLS, int32, int32, uintptr) int32)(unsafe.Pointer((uintptr(unsafe.Pointer(&aSyscall)) + 7*12 + 4 /* &.pCurrent */))))(tls, (*UnixFile)(unsafe.Pointer(pFile)).Fh, F_SETLK64, libc.VaList(bp+8, pLock))
+ rc = (*(*func(*libc.TLS, int32, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aSyscall)) + 7*12 + 4)))(tls, (*UnixFile)(unsafe.Pointer(pFile)).Fh, F_SETLK64, libc.VaList(bp+8, pLock))
}
return rc
}
@@ -23440,7 +24010,7 @@ func unixFileLock(tls *libc.TLS, pFile uintptr, pLock uintptr) int32 { /* sqlite
//
// This routine will only increase a lock. Use the sqlite3OsUnlock()
// routine to lower a locking level.
-func unixLock(tls *libc.TLS, id uintptr, eFileLock int32) int32 { /* sqlite3.c:35716:12: */
+func unixLock(tls *libc.TLS, id uintptr, eFileLock int32) int32 { /* sqlite3.c:35892:12: */
bp := tls.Alloc(32)
defer tls.Free(32)
@@ -23514,7 +24084,7 @@ __1:
// If some thread using this PID has a lock via a different unixFile*
// handle that precludes the requested lock, return BUSY.
- if !((int32((*UnixFile)(unsafe.Pointer(pFile)).FeFileLock) != int32((*UnixInodeInfo)(unsafe.Pointer(pInode)).FeFileLock)) && ((int32((*UnixInodeInfo)(unsafe.Pointer(pInode)).FeFileLock) >= PENDING_LOCK) || (eFileLock > SHARED_LOCK))) {
+ if !(int32((*UnixFile)(unsafe.Pointer(pFile)).FeFileLock) != int32((*UnixInodeInfo)(unsafe.Pointer(pInode)).FeFileLock) && (int32((*UnixInodeInfo)(unsafe.Pointer(pInode)).FeFileLock) >= PENDING_LOCK || eFileLock > SHARED_LOCK)) {
goto __2
}
rc = SQLITE_BUSY
@@ -23525,7 +24095,7 @@ __2:
// If a SHARED lock is requested, and some thread using this PID already
// has a SHARED or RESERVED lock, then increment reference counts and
// return SQLITE_OK.
- if !((eFileLock == SHARED_LOCK) && ((int32((*UnixInodeInfo)(unsafe.Pointer(pInode)).FeFileLock) == SHARED_LOCK) || (int32((*UnixInodeInfo)(unsafe.Pointer(pInode)).FeFileLock) == RESERVED_LOCK))) {
+ if !(eFileLock == SHARED_LOCK && (int32((*UnixInodeInfo)(unsafe.Pointer(pInode)).FeFileLock) == SHARED_LOCK || int32((*UnixInodeInfo)(unsafe.Pointer(pInode)).FeFileLock) == RESERVED_LOCK)) {
goto __3
}
@@ -23541,8 +24111,8 @@ __3:
// be released.
(*flock)(unsafe.Pointer(bp /* &lock */)).Fl_len = int64(1)
(*flock)(unsafe.Pointer(bp /* &lock */)).Fl_whence = int16(SEEK_SET)
- if !((eFileLock == SHARED_LOCK) ||
- ((eFileLock == EXCLUSIVE_LOCK) && (int32((*UnixFile)(unsafe.Pointer(pFile)).FeFileLock) < PENDING_LOCK))) {
+ if !(eFileLock == SHARED_LOCK ||
+ eFileLock == EXCLUSIVE_LOCK && int32((*UnixFile)(unsafe.Pointer(pFile)).FeFileLock) < PENDING_LOCK) {
goto __4
}
(*flock)(unsafe.Pointer(bp /* &lock */)).Fl_type = func() int16 {
@@ -23552,11 +24122,11 @@ __3:
return int16(F_WRLCK)
}()
(*flock)(unsafe.Pointer(bp /* &lock */)).Fl_start = X__off64_t(Xsqlite3PendingByte)
- if !(unixFileLock(tls, pFile, bp /* &lock */) != 0) {
+ if !(unixFileLock(tls, pFile, bp) != 0) {
goto __5
}
tErrno = *(*int32)(unsafe.Pointer(libc.X__errno_location(tls)))
- rc = sqliteErrorFromPosixError(tls, tErrno, (SQLITE_IOERR | (int32(15) << 8)))
+ rc = sqliteErrorFromPosixError(tls, tErrno, SQLITE_IOERR|int32(15)<<8)
if !(rc != SQLITE_BUSY) {
goto __6
}
@@ -23576,13 +24146,13 @@ __4:
}
// Now get the read-lock
- (*flock)(unsafe.Pointer(bp /* &lock */)).Fl_start = (X__off64_t(Xsqlite3PendingByte + 2))
+ (*flock)(unsafe.Pointer(bp /* &lock */)).Fl_start = X__off64_t(Xsqlite3PendingByte + 2)
(*flock)(unsafe.Pointer(bp /* &lock */)).Fl_len = int64(SHARED_SIZE)
- if !(unixFileLock(tls, pFile, bp /* &lock */) != 0) {
+ if !(unixFileLock(tls, pFile, bp) != 0) {
goto __9
}
tErrno = *(*int32)(unsafe.Pointer(libc.X__errno_location(tls)))
- rc = sqliteErrorFromPosixError(tls, tErrno, (SQLITE_IOERR | (int32(15) << 8)))
+ rc = sqliteErrorFromPosixError(tls, tErrno, SQLITE_IOERR|int32(15)<<8)
__9:
;
@@ -23590,12 +24160,12 @@ __9:
(*flock)(unsafe.Pointer(bp /* &lock */)).Fl_start = X__off64_t(Xsqlite3PendingByte)
(*flock)(unsafe.Pointer(bp /* &lock */)).Fl_len = int64(1)
(*flock)(unsafe.Pointer(bp /* &lock */)).Fl_type = int16(F_UNLCK)
- if !((unixFileLock(tls, pFile, bp /* &lock */) != 0) && (rc == SQLITE_OK)) {
+ if !(unixFileLock(tls, pFile, bp) != 0 && rc == SQLITE_OK) {
goto __10
}
// This could happen with a network mount
tErrno = *(*int32)(unsafe.Pointer(libc.X__errno_location(tls)))
- rc = (SQLITE_IOERR | (int32(8) << 8))
+ rc = SQLITE_IOERR | int32(8)<<8
__10:
;
@@ -23618,7 +24188,7 @@ __12:
;
goto __8
__7:
- if !((eFileLock == EXCLUSIVE_LOCK) && ((*UnixInodeInfo)(unsafe.Pointer(pInode)).FnShared > 1)) {
+ if !(eFileLock == EXCLUSIVE_LOCK && (*UnixInodeInfo)(unsafe.Pointer(pInode)).FnShared > 1) {
goto __14
}
// We are trying for an exclusive lock but another thread in this
@@ -23635,20 +24205,20 @@ __14:
if !(eFileLock == RESERVED_LOCK) {
goto __16
}
- (*flock)(unsafe.Pointer(bp /* &lock */)).Fl_start = (X__off64_t(Xsqlite3PendingByte + 1))
+ (*flock)(unsafe.Pointer(bp /* &lock */)).Fl_start = X__off64_t(Xsqlite3PendingByte + 1)
(*flock)(unsafe.Pointer(bp /* &lock */)).Fl_len = int64(1)
goto __17
__16:
- (*flock)(unsafe.Pointer(bp /* &lock */)).Fl_start = (X__off64_t(Xsqlite3PendingByte + 2))
+ (*flock)(unsafe.Pointer(bp /* &lock */)).Fl_start = X__off64_t(Xsqlite3PendingByte + 2)
(*flock)(unsafe.Pointer(bp /* &lock */)).Fl_len = int64(SHARED_SIZE)
__17:
;
- if !(unixFileLock(tls, pFile, bp /* &lock */) != 0) {
+ if !(unixFileLock(tls, pFile, bp) != 0) {
goto __18
}
tErrno = *(*int32)(unsafe.Pointer(libc.X__errno_location(tls)))
- rc = sqliteErrorFromPosixError(tls, tErrno, (SQLITE_IOERR | (int32(15) << 8)))
+ rc = sqliteErrorFromPosixError(tls, tErrno, SQLITE_IOERR|int32(15)<<8)
if !(rc != SQLITE_BUSY) {
goto __19
}
@@ -23687,7 +24257,7 @@ end_lock:
// Add the file descriptor used by file handle pFile to the corresponding
// pUnused list.
-func setPendingFd(tls *libc.TLS, pFile uintptr) { /* sqlite3.c:35943:13: */
+func setPendingFd(tls *libc.TLS, pFile uintptr) { /* sqlite3.c:36119:13: */
var pInode uintptr = (*UnixFile)(unsafe.Pointer(pFile)).FpInode
var p uintptr = (*UnixFile)(unsafe.Pointer(pFile)).FpPreallocatedUnused
@@ -23708,7 +24278,7 @@ func setPendingFd(tls *libc.TLS, pFile uintptr) { /* sqlite3.c:35943:13: */
// set to a read lock, then the other part is simply unlocked. This works
// around a bug in BSD NFS lockd (also seen on MacOSX 10.3+) that fails to
// remove the write lock on a region when a read lock is set.
-func posixUnlock(tls *libc.TLS, id uintptr, eFileLock int32, handleNFSUnlock int32) int32 { /* sqlite3.c:35966:12: */
+func posixUnlock(tls *libc.TLS, id uintptr, eFileLock int32, handleNFSUnlock int32) int32 { /* sqlite3.c:36142:12: */
bp := tls.Alloc(32)
defer tls.Free(32)
@@ -23748,9 +24318,9 @@ __1:
(*flock)(unsafe.Pointer(bp /* &lock */)).Fl_type = int16(F_RDLCK)
(*flock)(unsafe.Pointer(bp /* &lock */)).Fl_whence = int16(SEEK_SET)
- (*flock)(unsafe.Pointer(bp /* &lock */)).Fl_start = (X__off64_t(Xsqlite3PendingByte + 2))
+ (*flock)(unsafe.Pointer(bp /* &lock */)).Fl_start = X__off64_t(Xsqlite3PendingByte + 2)
(*flock)(unsafe.Pointer(bp /* &lock */)).Fl_len = int64(SHARED_SIZE)
- if !(unixFileLock(tls, pFile, bp /* &lock */) != 0) {
+ if !(unixFileLock(tls, pFile, bp) != 0) {
goto __4
}
// In theory, the call to unixFileLock() cannot fail because another
@@ -23759,7 +24329,7 @@ __1:
// protocol. If this happens, return SQLITE_IOERR_RDLOCK. Returning
// SQLITE_BUSY would confuse the upper layer (in practice it causes
// an assert to fail).
- rc = (SQLITE_IOERR | (int32(9) << 8))
+ rc = SQLITE_IOERR | int32(9)<<8
storeLastErrno(tls, pFile, *(*int32)(unsafe.Pointer(libc.X__errno_location(tls))))
goto end_unlock
__4:
@@ -23771,13 +24341,13 @@ __3:
(*flock)(unsafe.Pointer(bp /* &lock */)).Fl_whence = int16(SEEK_SET)
(*flock)(unsafe.Pointer(bp /* &lock */)).Fl_start = X__off64_t(Xsqlite3PendingByte)
(*flock)(unsafe.Pointer(bp /* &lock */)).Fl_len = int64(2)
- if !(unixFileLock(tls, pFile, bp /* &lock */) == 0) {
+ if !(unixFileLock(tls, pFile, bp) == 0) {
goto __5
}
(*UnixInodeInfo)(unsafe.Pointer(pInode)).FeFileLock = uint8(SHARED_LOCK)
goto __6
__5:
- rc = (SQLITE_IOERR | (int32(8) << 8))
+ rc = SQLITE_IOERR | int32(8)<<8
storeLastErrno(tls, pFile, *(*int32)(unsafe.Pointer(libc.X__errno_location(tls))))
goto end_unlock
__6:
@@ -23796,14 +24366,14 @@ __2:
}
(*flock)(unsafe.Pointer(bp /* &lock */)).Fl_type = int16(F_UNLCK)
(*flock)(unsafe.Pointer(bp /* &lock */)).Fl_whence = int16(SEEK_SET)
- (*flock)(unsafe.Pointer(bp /* &lock */)).Fl_start = libc.AssignPtrInt64(bp /* &lock */ +16 /* &.l_len */, int64(0))
- if !(unixFileLock(tls, pFile, bp /* &lock */) == 0) {
+ (*flock)(unsafe.Pointer(bp /* &lock */)).Fl_start = libc.AssignPtrInt64(bp+16, int64(0))
+ if !(unixFileLock(tls, pFile, bp) == 0) {
goto __9
}
(*UnixInodeInfo)(unsafe.Pointer(pInode)).FeFileLock = uint8(NO_LOCK)
goto __10
__9:
- rc = (SQLITE_IOERR | (int32(8) << 8))
+ rc = SQLITE_IOERR | int32(8)<<8
storeLastErrno(tls, pFile, *(*int32)(unsafe.Pointer(libc.X__errno_location(tls))))
(*UnixInodeInfo)(unsafe.Pointer(pInode)).FeFileLock = uint8(NO_LOCK)
(*UnixFile)(unsafe.Pointer(pFile)).FeFileLock = uint8(NO_LOCK)
@@ -23842,7 +24412,7 @@ __12:
//
// If the locking level of the file descriptor is already at or below
// the requested locking level, this routine is a no-op.
-func unixUnlock(tls *libc.TLS, id uintptr, eFileLock int32) int32 { /* sqlite3.c:36126:12: */
+func unixUnlock(tls *libc.TLS, id uintptr, eFileLock int32) int32 { /* sqlite3.c:36302:12: */
return posixUnlock(tls, id, eFileLock, 0)
}
@@ -23855,11 +24425,11 @@ func unixUnlock(tls *libc.TLS, id uintptr, eFileLock int32) int32 { /* sqlite3.c
// It is *not* necessary to hold the mutex when this routine is called,
// even on VxWorks. A mutex will be acquired on VxWorks by the
// vxworksReleaseFileId() routine.
-func closeUnixFile(tls *libc.TLS, id uintptr) int32 { /* sqlite3.c:36148:12: */
+func closeUnixFile(tls *libc.TLS, id uintptr) int32 { /* sqlite3.c:36324:12: */
var pFile uintptr = id
unixUnmapfile(tls, pFile)
if (*UnixFile)(unsafe.Pointer(pFile)).Fh >= 0 {
- robust_close(tls, pFile, (*UnixFile)(unsafe.Pointer(pFile)).Fh, 36154)
+ robust_close(tls, pFile, (*UnixFile)(unsafe.Pointer(pFile)).Fh, 36330)
(*UnixFile)(unsafe.Pointer(pFile)).Fh = -1
}
@@ -23869,7 +24439,7 @@ func closeUnixFile(tls *libc.TLS, id uintptr) int32 { /* sqlite3.c:36148:12: */
}
// Close a file.
-func unixClose(tls *libc.TLS, id uintptr) int32 { /* sqlite3.c:36183:12: */
+func unixClose(tls *libc.TLS, id uintptr) int32 { /* sqlite3.c:36359:12: */
var rc int32 = SQLITE_OK
var pFile uintptr = id
var pInode uintptr = (*UnixFile)(unsafe.Pointer(pFile)).FpInode
@@ -23919,26 +24489,26 @@ func unixClose(tls *libc.TLS, id uintptr) int32 { /* sqlite3.c:36183:12: */
// database connections are accessing the same database file at the same
// time and one or more of those connections are writing.
-func nolockCheckReservedLock(tls *libc.TLS, NotUsed uintptr, pResOut uintptr) int32 { /* sqlite3.c:36235:12: */
+func nolockCheckReservedLock(tls *libc.TLS, NotUsed uintptr, pResOut uintptr) int32 { /* sqlite3.c:36411:12: */
_ = NotUsed
*(*int32)(unsafe.Pointer(pResOut)) = 0
return SQLITE_OK
}
-func nolockLock(tls *libc.TLS, NotUsed uintptr, NotUsed2 int32) int32 { /* sqlite3.c:36240:12: */
+func nolockLock(tls *libc.TLS, NotUsed uintptr, NotUsed2 int32) int32 { /* sqlite3.c:36416:12: */
_ = NotUsed
_ = NotUsed2
return SQLITE_OK
}
-func nolockUnlock(tls *libc.TLS, NotUsed uintptr, NotUsed2 int32) int32 { /* sqlite3.c:36244:12: */
+func nolockUnlock(tls *libc.TLS, NotUsed uintptr, NotUsed2 int32) int32 { /* sqlite3.c:36420:12: */
_ = NotUsed
_ = NotUsed2
return SQLITE_OK
}
// Close the file.
-func nolockClose(tls *libc.TLS, id uintptr) int32 { /* sqlite3.c:36252:12: */
+func nolockClose(tls *libc.TLS, id uintptr) int32 { /* sqlite3.c:36428:12: */
return closeUnixFile(tls, id)
}
@@ -23979,12 +24549,12 @@ func nolockClose(tls *libc.TLS, id uintptr) int32 { /* sqlite3.c:36252:12: */
// In dotfile locking, either a lock exists or it does not. So in this
// variation of CheckReservedLock(), *pResOut is set to true if any lock
// is held on the file and false if the file is unlocked.
-func dotlockCheckReservedLock(tls *libc.TLS, id uintptr, pResOut uintptr) int32 { /* sqlite3.c:36297:12: */
+func dotlockCheckReservedLock(tls *libc.TLS, id uintptr, pResOut uintptr) int32 { /* sqlite3.c:36473:12: */
var rc int32 = SQLITE_OK
var reserved int32 = 0
var pFile uintptr = id
- reserved = (libc.Bool32((*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer((uintptr(unsafe.Pointer(&aSyscall)) + 2*12 + 4 /* &.pCurrent */))))(tls, (*UnixFile)(unsafe.Pointer(pFile)).FlockingContext, 0) == 0))
+ reserved = libc.Bool32((*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aSyscall)) + 2*12 + 4)))(tls, (*UnixFile)(unsafe.Pointer(pFile)).FlockingContext, 0) == 0)
*(*int32)(unsafe.Pointer(pResOut)) = reserved
return rc
@@ -24015,7 +24585,7 @@ func dotlockCheckReservedLock(tls *libc.TLS, id uintptr, pResOut uintptr) int32
//
// With dotfile locking, we really only support state (4): EXCLUSIVE.
// But we track the other locking levels internally.
-func dotlockLock(tls *libc.TLS, id uintptr, eFileLock int32) int32 { /* sqlite3.c:36338:12: */
+func dotlockLock(tls *libc.TLS, id uintptr, eFileLock int32) int32 { /* sqlite3.c:36514:12: */
var pFile uintptr = id
var zLockFile uintptr = (*UnixFile)(unsafe.Pointer(pFile)).FlockingContext
var rc int32 = SQLITE_OK
@@ -24030,14 +24600,14 @@ func dotlockLock(tls *libc.TLS, id uintptr, eFileLock int32) int32 { /* sqlite3.
}
// grab an exclusive lock
- rc = (*(*func(*libc.TLS, uintptr, Mode_t) int32)(unsafe.Pointer((uintptr(unsafe.Pointer(&aSyscall)) + 18*12 + 4 /* &.pCurrent */))))(tls, zLockFile, uint32(0777))
+ rc = (*(*func(*libc.TLS, uintptr, Mode_t) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aSyscall)) + 18*12 + 4)))(tls, zLockFile, uint32(0777))
if rc < 0 {
// failed to open/create the lock directory
var tErrno int32 = *(*int32)(unsafe.Pointer(libc.X__errno_location(tls)))
if EEXIST == tErrno {
rc = SQLITE_BUSY
} else {
- rc = sqliteErrorFromPosixError(tls, tErrno, (SQLITE_IOERR | (int32(15) << 8)))
+ rc = sqliteErrorFromPosixError(tls, tErrno, SQLITE_IOERR|int32(15)<<8)
if rc != SQLITE_BUSY {
storeLastErrno(tls, pFile, tErrno)
}
@@ -24057,7 +24627,7 @@ func dotlockLock(tls *libc.TLS, id uintptr, eFileLock int32) int32 { /* sqlite3.
// the requested locking level, this routine is a no-op.
//
// When the locking level reaches NO_LOCK, delete the lock file.
-func dotlockUnlock(tls *libc.TLS, id uintptr, eFileLock int32) int32 { /* sqlite3.c:36388:12: */
+func dotlockUnlock(tls *libc.TLS, id uintptr, eFileLock int32) int32 { /* sqlite3.c:36564:12: */
var pFile uintptr = id
var zLockFile uintptr = (*UnixFile)(unsafe.Pointer(pFile)).FlockingContext
var rc int32
@@ -24076,13 +24646,13 @@ func dotlockUnlock(tls *libc.TLS, id uintptr, eFileLock int32) int32 { /* sqlite
// To fully unlock the database, delete the lock file
- rc = (*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer((uintptr(unsafe.Pointer(&aSyscall)) + 19*12 + 4 /* &.pCurrent */))))(tls, zLockFile)
+ rc = (*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aSyscall)) + 19*12 + 4)))(tls, zLockFile)
if rc < 0 {
var tErrno int32 = *(*int32)(unsafe.Pointer(libc.X__errno_location(tls)))
if tErrno == ENOENT {
rc = SQLITE_OK
} else {
- rc = (SQLITE_IOERR | (int32(8) << 8))
+ rc = SQLITE_IOERR | int32(8)<<8
storeLastErrno(tls, pFile, tErrno)
}
return rc
@@ -24092,7 +24662,7 @@ func dotlockUnlock(tls *libc.TLS, id uintptr, eFileLock int32) int32 { /* sqlite
}
// Close a file. Make sure the lock has been released before closing.
-func dotlockClose(tls *libc.TLS, id uintptr) int32 { /* sqlite3.c:36431:12: */
+func dotlockClose(tls *libc.TLS, id uintptr) int32 { /* sqlite3.c:36607:12: */
var pFile uintptr = id
dotlockUnlock(tls, id, NO_LOCK)
@@ -24191,24 +24761,24 @@ func dotlockClose(tls *libc.TLS, id uintptr) int32 { /* sqlite3.c:36431:12: */
//
// To avoid stomping the errno value on a failed read the lastErrno value
// is set before returning.
-func seekAndRead(tls *libc.TLS, id uintptr, offset Sqlite3_int64, pBuf uintptr, cnt int32) int32 { /* sqlite3.c:37345:12: */
+func seekAndRead(tls *libc.TLS, id uintptr, offset Sqlite3_int64, pBuf uintptr, cnt int32) int32 { /* sqlite3.c:37521:12: */
var got int32
var prior int32 = 0
var newOffset I64
- for ok := true; ok; ok = (got > 0) {
+ for ok := true; ok; ok = got > 0 {
newOffset = libc.Xlseek(tls, (*UnixFile)(unsafe.Pointer(id)).Fh, offset, SEEK_SET)
if newOffset < int64(0) {
storeLastErrno(tls, id, *(*int32)(unsafe.Pointer(libc.X__errno_location(tls))))
return -1
}
- got = (*(*func(*libc.TLS, int32, uintptr, Size_t) Ssize_t)(unsafe.Pointer((uintptr(unsafe.Pointer(&aSyscall)) + 8*12 + 4 /* &.pCurrent */))))(tls, (*UnixFile)(unsafe.Pointer(id)).Fh, pBuf, uint32(cnt))
+ got = (*(*func(*libc.TLS, int32, uintptr, Size_t) Ssize_t)(unsafe.Pointer(uintptr(unsafe.Pointer(&aSyscall)) + 8*12 + 4)))(tls, (*UnixFile)(unsafe.Pointer(id)).Fh, pBuf, uint32(cnt))
if got == cnt {
break
}
if got < 0 {
- if (*(*int32)(unsafe.Pointer(libc.X__errno_location(tls)))) == EINTR {
+ if *(*int32)(unsafe.Pointer(libc.X__errno_location(tls))) == EINTR {
got = 1
continue
}
@@ -24216,20 +24786,20 @@ func seekAndRead(tls *libc.TLS, id uintptr, offset Sqlite3_int64, pBuf uintptr,
storeLastErrno(tls, id, *(*int32)(unsafe.Pointer(libc.X__errno_location(tls))))
break
} else if got > 0 {
- cnt = cnt - (got)
- offset = offset + (Sqlite3_int64(got))
- prior = prior + (got)
- pBuf = (uintptr(got) + pBuf)
+ cnt = cnt - got
+ offset = offset + Sqlite3_int64(got)
+ prior = prior + got
+ pBuf = uintptr(got) + pBuf
}
}
- return (got + prior)
+ return got + prior
}
// Read data from a file into a buffer. Return SQLITE_OK if all
// bytes were read successfully and SQLITE_IOERR if anything goes
// wrong.
-func unixRead(tls *libc.TLS, id uintptr, pBuf uintptr, amt int32, offset Sqlite3_int64) int32 { /* sqlite3.c:37394:12: */
+func unixRead(tls *libc.TLS, id uintptr, pBuf uintptr, amt int32, offset Sqlite3_int64) int32 { /* sqlite3.c:37570:12: */
var pFile uintptr = id
var got int32
@@ -24239,15 +24809,15 @@ func unixRead(tls *libc.TLS, id uintptr, pBuf uintptr, amt int32, offset Sqlite3
// Deal with as much of this read request as possible by transfering
// data from the memory mapping using memcpy().
if offset < (*UnixFile)(unsafe.Pointer(pFile)).FmmapSize {
- if (offset + Sqlite3_int64(amt)) <= (*UnixFile)(unsafe.Pointer(pFile)).FmmapSize {
- libc.Xmemcpy(tls, pBuf, (((*UnixFile)(unsafe.Pointer(pFile)).FpMapRegion) + uintptr(offset)), uint32(amt))
+ if offset+Sqlite3_int64(amt) <= (*UnixFile)(unsafe.Pointer(pFile)).FmmapSize {
+ libc.Xmemcpy(tls, pBuf, (*UnixFile)(unsafe.Pointer(pFile)).FpMapRegion+uintptr(offset), uint32(amt))
return SQLITE_OK
} else {
- var nCopy int32 = (int32((*UnixFile)(unsafe.Pointer(pFile)).FmmapSize - offset))
- libc.Xmemcpy(tls, pBuf, (((*UnixFile)(unsafe.Pointer(pFile)).FpMapRegion) + uintptr(offset)), uint32(nCopy))
- pBuf = ((pBuf) + uintptr(nCopy))
- amt = amt - (nCopy)
- offset = offset + (Sqlite3_int64(nCopy))
+ var nCopy int32 = int32((*UnixFile)(unsafe.Pointer(pFile)).FmmapSize - offset)
+ libc.Xmemcpy(tls, pBuf, (*UnixFile)(unsafe.Pointer(pFile)).FpMapRegion+uintptr(offset), uint32(nCopy))
+ pBuf = pBuf + uintptr(nCopy)
+ amt = amt - nCopy
+ offset = offset + Sqlite3_int64(nCopy)
}
}
@@ -24267,14 +24837,14 @@ func unixRead(tls *libc.TLS, id uintptr, pBuf uintptr, amt int32, offset Sqlite3
case EIO:
fallthrough
case ENXIO:
- return (SQLITE_IOERR | (int32(33) << 8))
+ return SQLITE_IOERR | int32(33)<<8
}
- return (SQLITE_IOERR | (int32(1) << 8))
+ return SQLITE_IOERR | int32(1)<<8
} else {
storeLastErrno(tls, pFile, 0) // not a system error
// Unread parts of the buffer must be zero-filled
- libc.Xmemset(tls, ((pBuf) + uintptr(got)), 0, (uint32(amt - got)))
- return (SQLITE_IOERR | (int32(2) << 8))
+ libc.Xmemset(tls, pBuf+uintptr(got), 0, uint32(amt-got))
+ return SQLITE_IOERR | int32(2)<<8
}
return int32(0)
}
@@ -24284,19 +24854,19 @@ func unixRead(tls *libc.TLS, id uintptr, pBuf uintptr, amt int32, offset Sqlite3
// pBuf to it. If an error occurs, return -1 and set *piErrno. Otherwise,
// return the actual number of bytes written (which may be less than
// nBuf).
-func seekAndWriteFd(tls *libc.TLS, fd int32, iOff I64, pBuf uintptr, nBuf int32, piErrno uintptr) int32 { /* sqlite3.c:37470:12: */
+func seekAndWriteFd(tls *libc.TLS, fd int32, iOff I64, pBuf uintptr, nBuf int32, piErrno uintptr) int32 { /* sqlite3.c:37646:12: */
var rc int32 = 0 // Value returned by system call
- nBuf = nBuf & (0x1ffff)
+ nBuf = nBuf & 0x1ffff
- for ok := true; ok; ok = ((rc < 0) && ((*(*int32)(unsafe.Pointer(libc.X__errno_location(tls)))) == EINTR)) {
+ for ok := true; ok; ok = rc < 0 && *(*int32)(unsafe.Pointer(libc.X__errno_location(tls))) == EINTR {
var iSeek I64 = libc.Xlseek(tls, fd, iOff, SEEK_SET)
if iSeek < int64(0) {
rc = -1
break
}
- rc = (*(*func(*libc.TLS, int32, uintptr, Size_t) Ssize_t)(unsafe.Pointer((uintptr(unsafe.Pointer(&aSyscall)) + 11*12 + 4 /* &.pCurrent */))))(tls, fd, pBuf, uint32(nBuf))
+ rc = (*(*func(*libc.TLS, int32, uintptr, Size_t) Ssize_t)(unsafe.Pointer(uintptr(unsafe.Pointer(&aSyscall)) + 11*12 + 4)))(tls, fd, pBuf, uint32(nBuf))
}
if rc < 0 {
@@ -24310,29 +24880,29 @@ func seekAndWriteFd(tls *libc.TLS, fd int32, iOff I64, pBuf uintptr, nBuf int32,
//
// To avoid stomping the errno value on a failed write the lastErrno value
// is set before returning.
-func seekAndWrite(tls *libc.TLS, id uintptr, offset I64, pBuf uintptr, cnt int32) int32 { /* sqlite3.c:37516:12: */
- return seekAndWriteFd(tls, (*UnixFile)(unsafe.Pointer(id)).Fh, offset, pBuf, cnt, (id + 20 /* &.lastErrno */))
+func seekAndWrite(tls *libc.TLS, id uintptr, offset I64, pBuf uintptr, cnt int32) int32 { /* sqlite3.c:37692:12: */
+ return seekAndWriteFd(tls, (*UnixFile)(unsafe.Pointer(id)).Fh, offset, pBuf, cnt, id+20)
}
// Write data from a buffer into a file. Return SQLITE_OK on success
// or some other error code on failure.
-func unixWrite(tls *libc.TLS, id uintptr, pBuf uintptr, amt int32, offset Sqlite3_int64) int32 { /* sqlite3.c:37525:12: */
+func unixWrite(tls *libc.TLS, id uintptr, pBuf uintptr, amt int32, offset Sqlite3_int64) int32 { /* sqlite3.c:37701:12: */
var pFile uintptr = id
var wrote int32 = 0
// If this is a database file (not a journal, super-journal or temp
// file), the bytes in the locking range should never be read or written.
- for ((libc.AssignInt32(&wrote, seekAndWrite(tls, pFile, offset, pBuf, amt))) < amt) && (wrote > 0) {
- amt = amt - (wrote)
- offset = offset + (Sqlite3_int64(wrote))
- pBuf = ((pBuf) + uintptr(wrote))
+ for libc.AssignInt32(&wrote, seekAndWrite(tls, pFile, offset, pBuf, amt)) < amt && wrote > 0 {
+ amt = amt - wrote
+ offset = offset + Sqlite3_int64(wrote)
+ pBuf = pBuf + uintptr(wrote)
}
if amt > wrote {
- if (wrote < 0) && ((*UnixFile)(unsafe.Pointer(pFile)).FlastErrno != ENOSPC) {
+ if wrote < 0 && (*UnixFile)(unsafe.Pointer(pFile)).FlastErrno != ENOSPC {
// lastErrno set by seekAndWrite
- return (SQLITE_IOERR | (int32(3) << 8))
+ return SQLITE_IOERR | int32(3)<<8
} else {
storeLastErrno(tls, pFile, 0) // not a system error
return SQLITE_FULL
@@ -24373,7 +24943,7 @@ func unixWrite(tls *libc.TLS, id uintptr, pBuf uintptr, amt int32, offset Sqlite
// as far as SQLite is concerned, an fdatasync() is always adequate.
// So, we always use fdatasync() if it is available, regardless of
// the value of the dataOnly flag.
-func full_fsync(tls *libc.TLS, fd int32, fullSync int32, dataOnly int32) int32 { /* sqlite3.c:37660:12: */
+func full_fsync(tls *libc.TLS, fd int32, fullSync int32, dataOnly int32) int32 { /* sqlite3.c:37836:12: */
var rc int32
// The following "ifdef/elif/else/" block has the same structure as
@@ -24392,7 +24962,7 @@ func full_fsync(tls *libc.TLS, fd int32, fullSync int32, dataOnly int32) int32 {
// coverate testing.
rc = libc.Xfsync(tls, fd)
- if (0 != 0) && (rc != -1) {
+ if 0 != 0 && rc != -1 {
rc = 0
}
return rc
@@ -24419,7 +24989,7 @@ func full_fsync(tls *libc.TLS, fd int32, fullSync int32, dataOnly int32) int32 {
//
// If SQLITE_OK is returned, the caller is responsible for closing
// the file descriptor *pFd using close().
-func openDirectory(tls *libc.TLS, zFilename uintptr, pFd uintptr) int32 { /* sqlite3.c:37756:12: */
+func openDirectory(tls *libc.TLS, zFilename uintptr, pFd uintptr) int32 { /* sqlite3.c:37932:12: */
bp := tls.Alloc(521)
defer tls.Free(521)
@@ -24427,18 +24997,18 @@ func openDirectory(tls *libc.TLS, zFilename uintptr, pFd uintptr) int32 { /* sql
var fd int32 = -1
// var zDirname [513]uint8 at bp+8, 513
- Xsqlite3_snprintf(tls, MAX_PATHNAME, bp+8 /* &zDirname[0] */, ts+2790 /* "%s" */, libc.VaList(bp, zFilename))
- for ii = int32(libc.Xstrlen(tls, bp+8 /* &zDirname[0] */)); (ii > 0) && (int32(*(*uint8)(unsafe.Pointer(bp + 8 /* &zDirname[0] */ + uintptr(ii)))) != '/'); ii-- {
+ Xsqlite3_snprintf(tls, MAX_PATHNAME, bp+8 /* &zDirname[0] */, ts+3601 /* "%s" */, libc.VaList(bp, zFilename))
+ for ii = int32(libc.Xstrlen(tls, bp+8 /* &zDirname[0] */)); ii > 0 && int32(*(*uint8)(unsafe.Pointer(bp + 8 /* &zDirname[0] */ + uintptr(ii)))) != '/'; ii-- {
}
if ii > 0 {
*(*uint8)(unsafe.Pointer(bp + 8 /* &zDirname[0] */ + uintptr(ii))) = uint8(0)
} else {
- if int32(*(*uint8)(unsafe.Pointer(bp + 8 /* &zDirname[0] */))) != '/' {
+ if int32(*(*uint8)(unsafe.Pointer(bp + 8))) != '/' {
*(*uint8)(unsafe.Pointer(bp + 8 /* &zDirname[0] */)) = uint8('.')
}
*(*uint8)(unsafe.Pointer(bp + 8 /* &zDirname[0] */ + 1)) = uint8(0)
}
- fd = robust_open(tls, bp+8 /* &zDirname[0] */, (O_RDONLY | O_BINARY), uint32(0))
+ fd = robust_open(tls, bp+8 /* &zDirname[0] */, O_RDONLY|O_BINARY, uint32(0))
if fd >= 0 {
}
@@ -24446,7 +25016,7 @@ func openDirectory(tls *libc.TLS, zFilename uintptr, pFd uintptr) int32 { /* sql
if fd >= 0 {
return SQLITE_OK
}
- return unixLogErrorAtLine(tls, Xsqlite3CantopenError(tls, 37775), ts+2505 /* "openDirectory" */, bp+8 /* &zDirname[0] */, 37775)
+ return unixLogErrorAtLine(tls, Xsqlite3CantopenError(tls, 37951), ts+3316 /* "openDirectory" */, bp+8 /* &zDirname[0] */, 37951)
}
// Make sure all writes to a particular file are committed to disk.
@@ -24462,15 +25032,15 @@ func openDirectory(tls *libc.TLS, zFilename uintptr, pFd uintptr) int32 { /* sql
// SQLite to access the file will not know that the journal exists (because
// the directory entry for the journal was never created) and the transaction
// will not roll back - possibly leading to database corruption.
-func unixSync(tls *libc.TLS, id uintptr, flags int32) int32 { /* sqlite3.c:37793:12: */
+func unixSync(tls *libc.TLS, id uintptr, flags int32) int32 { /* sqlite3.c:37969:12: */
bp := tls.Alloc(4)
defer tls.Free(4)
var rc int32
var pFile uintptr = id
- var isDataOnly int32 = (flags & SQLITE_SYNC_DATAONLY)
- var isFullsync int32 = (libc.Bool32((flags & 0x0F) == SQLITE_SYNC_FULL))
+ var isDataOnly int32 = flags & SQLITE_SYNC_DATAONLY
+ var isFullsync int32 = libc.Bool32(flags&0x0F == SQLITE_SYNC_FULL)
// Check that one of SQLITE_SYNC_NORMAL or FULL was passed
@@ -24481,30 +25051,30 @@ func unixSync(tls *libc.TLS, id uintptr, flags int32) int32 { /* sqlite3.c:37793
if rc != 0 {
storeLastErrno(tls, pFile, *(*int32)(unsafe.Pointer(libc.X__errno_location(tls))))
- return unixLogErrorAtLine(tls, (SQLITE_IOERR | (int32(4) << 8)), ts+2793 /* "full_fsync" */, (*UnixFile)(unsafe.Pointer(pFile)).FzPath, 37816)
+ return unixLogErrorAtLine(tls, SQLITE_IOERR|int32(4)<<8, ts+3604 /* "full_fsync" */, (*UnixFile)(unsafe.Pointer(pFile)).FzPath, 37992)
}
// Also fsync the directory containing the file if the DIRSYNC flag
// is set. This is a one-time occurrence. Many systems (examples: AIX)
// are unable to fsync a directory, so ignore errors on the fsync.
- if (int32((*UnixFile)(unsafe.Pointer(pFile)).FctrlFlags) & UNIXFILE_DIRSYNC) != 0 {
+ if int32((*UnixFile)(unsafe.Pointer(pFile)).FctrlFlags)&UNIXFILE_DIRSYNC != 0 {
// var dirfd int32 at bp, 4
- rc = (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer((uintptr(unsafe.Pointer(&aSyscall)) + 17*12 + 4 /* &.pCurrent */))))(tls, (*UnixFile)(unsafe.Pointer(pFile)).FzPath, bp /* &dirfd */)
+ rc = (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aSyscall)) + 17*12 + 4)))(tls, (*UnixFile)(unsafe.Pointer(pFile)).FzPath, bp)
if rc == SQLITE_OK {
full_fsync(tls, *(*int32)(unsafe.Pointer(bp /* dirfd */)), 0, 0)
- robust_close(tls, pFile, *(*int32)(unsafe.Pointer(bp /* dirfd */)), 37830)
+ robust_close(tls, pFile, *(*int32)(unsafe.Pointer(bp /* dirfd */)), 38006)
} else {
rc = SQLITE_OK
}
- *(*uint16)(unsafe.Pointer(pFile + 18 /* &.ctrlFlags */)) &= libc.Uint16FromInt32((libc.CplInt32(UNIXFILE_DIRSYNC)))
+ *(*uint16)(unsafe.Pointer(pFile + 18)) &= libc.Uint16FromInt32(libc.CplInt32(UNIXFILE_DIRSYNC))
}
return rc
}
// Truncate an open file to a specified size
-func unixTruncate(tls *libc.TLS, id uintptr, nByte I64) int32 { /* sqlite3.c:37843:12: */
+func unixTruncate(tls *libc.TLS, id uintptr, nByte I64) int32 { /* sqlite3.c:38019:12: */
var pFile uintptr = id
var rc int32
@@ -24513,13 +25083,13 @@ func unixTruncate(tls *libc.TLS, id uintptr, nByte I64) int32 { /* sqlite3.c:378
// actual file size after the operation may be larger than the requested
// size).
if (*UnixFile)(unsafe.Pointer(pFile)).FszChunk > 0 {
- nByte = ((((nByte + I64((*UnixFile)(unsafe.Pointer(pFile)).FszChunk)) - int64(1)) / I64((*UnixFile)(unsafe.Pointer(pFile)).FszChunk)) * I64((*UnixFile)(unsafe.Pointer(pFile)).FszChunk))
+ nByte = (nByte + I64((*UnixFile)(unsafe.Pointer(pFile)).FszChunk) - int64(1)) / I64((*UnixFile)(unsafe.Pointer(pFile)).FszChunk) * I64((*UnixFile)(unsafe.Pointer(pFile)).FszChunk)
}
rc = robust_ftruncate(tls, (*UnixFile)(unsafe.Pointer(pFile)).Fh, nByte)
if rc != 0 {
storeLastErrno(tls, pFile, *(*int32)(unsafe.Pointer(libc.X__errno_location(tls))))
- return unixLogErrorAtLine(tls, (SQLITE_IOERR | (int32(6) << 8)), ts+2424 /* "ftruncate" */, (*UnixFile)(unsafe.Pointer(pFile)).FzPath, 37861)
+ return unixLogErrorAtLine(tls, SQLITE_IOERR|int32(6)<<8, ts+3235 /* "ftruncate" */, (*UnixFile)(unsafe.Pointer(pFile)).FzPath, 38037)
} else {
// If the file was just truncated to a size smaller than the currently
@@ -24535,18 +25105,18 @@ func unixTruncate(tls *libc.TLS, id uintptr, nByte I64) int32 { /* sqlite3.c:378
}
// Determine the current size of a file in bytes
-func unixFileSize(tls *libc.TLS, id uintptr, pSize uintptr) int32 { /* sqlite3.c:37893:12: */
+func unixFileSize(tls *libc.TLS, id uintptr, pSize uintptr) int32 { /* sqlite3.c:38069:12: */
bp := tls.Alloc(104)
defer tls.Free(104)
var rc int32
// var buf stat at bp, 104
- rc = (*(*func(*libc.TLS, int32, uintptr) int32)(unsafe.Pointer((uintptr(unsafe.Pointer(&aSyscall)) + 5*12 + 4 /* &.pCurrent */))))(tls, (*UnixFile)(unsafe.Pointer(id)).Fh, bp /* &buf */)
+ rc = (*(*func(*libc.TLS, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aSyscall)) + 5*12 + 4)))(tls, (*UnixFile)(unsafe.Pointer(id)).Fh, bp)
if rc != 0 {
storeLastErrno(tls, id, *(*int32)(unsafe.Pointer(libc.X__errno_location(tls))))
- return (SQLITE_IOERR | (int32(7) << 8))
+ return SQLITE_IOERR | int32(7)<<8
}
*(*I64)(unsafe.Pointer(pSize)) = (*stat)(unsafe.Pointer(bp /* &buf */)).Fst_size
@@ -24566,7 +25136,7 @@ func unixFileSize(tls *libc.TLS, id uintptr, pSize uintptr) int32 { /* sqlite3.c
// file-control operation. Enlarge the database to nBytes in size
// (rounded up to the next chunk-size). If the database is already
// nBytes or larger, this routine is a no-op.
-func fcntlSizeHint(tls *libc.TLS, pFile uintptr, nByte I64) int32 { /* sqlite3.c:37931:12: */
+func fcntlSizeHint(tls *libc.TLS, pFile uintptr, nByte I64) int32 { /* sqlite3.c:38107:12: */
bp := tls.Alloc(104)
defer tls.Free(104)
@@ -24575,12 +25145,12 @@ func fcntlSizeHint(tls *libc.TLS, pFile uintptr, nByte I64) int32 { /* sqlite3.c
// var buf stat at bp, 104
// Used to hold return values of fstat()
- if (*(*func(*libc.TLS, int32, uintptr) int32)(unsafe.Pointer((uintptr(unsafe.Pointer(&aSyscall)) + 5*12 + 4 /* &.pCurrent */))))(tls, (*UnixFile)(unsafe.Pointer(pFile)).Fh, bp /* &buf */) != 0 {
- return (SQLITE_IOERR | (int32(7) << 8))
+ if (*(*func(*libc.TLS, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aSyscall)) + 5*12 + 4)))(tls, (*UnixFile)(unsafe.Pointer(pFile)).Fh, bp) != 0 {
+ return SQLITE_IOERR | int32(7)<<8
}
- nSize = ((((nByte + I64((*UnixFile)(unsafe.Pointer(pFile)).FszChunk)) - int64(1)) / I64((*UnixFile)(unsafe.Pointer(pFile)).FszChunk)) * I64((*UnixFile)(unsafe.Pointer(pFile)).FszChunk))
- if nSize > (*stat)(unsafe.Pointer(bp /* &buf */)).Fst_size {
+ nSize = (nByte + I64((*UnixFile)(unsafe.Pointer(pFile)).FszChunk) - int64(1)) / I64((*UnixFile)(unsafe.Pointer(pFile)).FszChunk) * I64((*UnixFile)(unsafe.Pointer(pFile)).FszChunk)
+ if nSize > (*stat)(unsafe.Pointer(bp)).Fst_size {
// If the OS does not have posix_fallocate(), fake it. Write a
// single byte to the last byte in each block that falls entirely
@@ -24592,26 +25162,26 @@ func fcntlSizeHint(tls *libc.TLS, pFile uintptr, nByte I64) int32 { /* sqlite3.c
var nWrite int32 = 0 // Number of bytes written by seekAndWrite
var iWrite I64 // Next offset to write to
- iWrite = (((((*stat)(unsafe.Pointer(bp /* &buf */)).Fst_size / X__off64_t(nBlk)) * X__off64_t(nBlk)) + X__off64_t(nBlk)) - int64(1))
+ iWrite = (*stat)(unsafe.Pointer(bp)).Fst_size/X__off64_t(nBlk)*X__off64_t(nBlk) + X__off64_t(nBlk) - int64(1)
- for ; iWrite < ((nSize + I64(nBlk)) - int64(1)); iWrite = iWrite + (I64(nBlk)) {
+ for ; iWrite < nSize+I64(nBlk)-int64(1); iWrite = iWrite + I64(nBlk) {
if iWrite >= nSize {
- iWrite = (nSize - int64(1))
+ iWrite = nSize - int64(1)
}
- nWrite = seekAndWrite(tls, pFile, iWrite, ts+755 /* "" */, 1)
+ nWrite = seekAndWrite(tls, pFile, iWrite, ts+1543 /* "" */, 1)
if nWrite != 1 {
- return (SQLITE_IOERR | (int32(3) << 8))
+ return SQLITE_IOERR | int32(3)<<8
}
}
}
}
- if ((*UnixFile)(unsafe.Pointer(pFile)).FmmapSizeMax > int64(0)) && (nByte > (*UnixFile)(unsafe.Pointer(pFile)).FmmapSize) {
+ if (*UnixFile)(unsafe.Pointer(pFile)).FmmapSizeMax > int64(0) && nByte > (*UnixFile)(unsafe.Pointer(pFile)).FmmapSize {
var rc int32
if (*UnixFile)(unsafe.Pointer(pFile)).FszChunk <= 0 {
if robust_ftruncate(tls, (*UnixFile)(unsafe.Pointer(pFile)).Fh, nByte) != 0 {
storeLastErrno(tls, pFile, *(*int32)(unsafe.Pointer(libc.X__errno_location(tls))))
- return unixLogErrorAtLine(tls, (SQLITE_IOERR | (int32(6) << 8)), ts+2424 /* "ftruncate" */, (*UnixFile)(unsafe.Pointer(pFile)).FzPath, 37982)
+ return unixLogErrorAtLine(tls, SQLITE_IOERR|int32(6)<<8, ts+3235 /* "ftruncate" */, (*UnixFile)(unsafe.Pointer(pFile)).FzPath, 38158)
}
}
@@ -24626,18 +25196,18 @@ func fcntlSizeHint(tls *libc.TLS, pFile uintptr, nByte I64) int32 { /* sqlite3.c
// 1 or 0 depending on whether or not bit mask of pFile->ctrlFlags is set.
//
// If *pArg is 0 or 1, then clear or set the mask bit of pFile->ctrlFlags.
-func unixModeBit(tls *libc.TLS, pFile uintptr, mask uint8, pArg uintptr) { /* sqlite3.c:38000:13: */
+func unixModeBit(tls *libc.TLS, pFile uintptr, mask uint8, pArg uintptr) { /* sqlite3.c:38176:13: */
if *(*int32)(unsafe.Pointer(pArg)) < 0 {
- *(*int32)(unsafe.Pointer(pArg)) = (libc.Bool32((int32((*UnixFile)(unsafe.Pointer(pFile)).FctrlFlags) & int32(mask)) != 0))
- } else if (*(*int32)(unsafe.Pointer(pArg))) == 0 {
- *(*uint16)(unsafe.Pointer(pFile + 18 /* &.ctrlFlags */)) &= uint16((^int32(mask)))
+ *(*int32)(unsafe.Pointer(pArg)) = libc.Bool32(int32((*UnixFile)(unsafe.Pointer(pFile)).FctrlFlags)&int32(mask) != 0)
+ } else if *(*int32)(unsafe.Pointer(pArg)) == 0 {
+ *(*uint16)(unsafe.Pointer(pFile + 18)) &= uint16(^int32(mask))
} else {
- *(*uint16)(unsafe.Pointer(pFile + 18 /* &.ctrlFlags */)) |= uint16((int32(mask)))
+ *(*uint16)(unsafe.Pointer(pFile + 18)) |= uint16(int32(mask))
}
}
// Information and control of an open file handle.
-func unixFileControl(tls *libc.TLS, id uintptr, op int32, pArg uintptr) int32 { /* sqlite3.c:38017:12: */
+func unixFileControl(tls *libc.TLS, id uintptr, op int32, pArg uintptr) int32 { /* sqlite3.c:38195:12: */
bp := tls.Alloc(8)
defer tls.Free(8)
@@ -24685,7 +25255,7 @@ func unixFileControl(tls *libc.TLS, id uintptr, op int32, pArg uintptr) int32 {
}
case SQLITE_FCNTL_VFSNAME:
{
- *(*uintptr)(unsafe.Pointer(pArg)) = Xsqlite3_mprintf(tls, ts+2790 /* "%s" */, libc.VaList(bp, (*Sqlite3_vfs)(unsafe.Pointer((*UnixFile)(unsafe.Pointer(pFile)).FpVfs)).FzName))
+ *(*uintptr)(unsafe.Pointer(pArg)) = Xsqlite3_mprintf(tls, ts+3601 /* "%s" */, libc.VaList(bp, (*Sqlite3_vfs)(unsafe.Pointer((*UnixFile)(unsafe.Pointer(pFile)).FpVfs)).FzName))
return SQLITE_OK
}
@@ -24716,12 +25286,12 @@ func unixFileControl(tls *libc.TLS, id uintptr, op int32, pArg uintptr) int32 {
// The value of newLimit may be eventually cast to (size_t) and passed
// to mmap(). Restrict its value to 2GB if (size_t) is not at least a
// 64-bit type.
- if (newLimit > int64(0)) && (uint32(unsafe.Sizeof(Size_t(0))) < uint32(8)) {
- newLimit = (newLimit & int64(0x7FFFFFFF))
+ if newLimit > int64(0) && uint32(unsafe.Sizeof(Size_t(0))) < uint32(8) {
+ newLimit = newLimit & int64(0x7FFFFFFF)
}
*(*I64)(unsafe.Pointer(pArg)) = (*UnixFile)(unsafe.Pointer(pFile)).FmmapSizeMax
- if ((newLimit >= int64(0)) && (newLimit != (*UnixFile)(unsafe.Pointer(pFile)).FmmapSizeMax)) && ((*UnixFile)(unsafe.Pointer(pFile)).FnFetchOut == 0) {
+ if newLimit >= int64(0) && newLimit != (*UnixFile)(unsafe.Pointer(pFile)).FmmapSizeMax && (*UnixFile)(unsafe.Pointer(pFile)).FnFetchOut == 0 {
(*UnixFile)(unsafe.Pointer(pFile)).FmmapSizeMax = newLimit
if (*UnixFile)(unsafe.Pointer(pFile)).FmmapSize > int64(0) {
unixUnmapfile(tls, pFile)
@@ -24748,13 +25318,13 @@ func unixFileControl(tls *libc.TLS, id uintptr, op int32, pArg uintptr) int32 {
//
// There are two versions of this function. One for QNX and one for all
// other systems.
-func setDeviceCharacteristics(tls *libc.TLS, pFd uintptr) { /* sqlite3.c:38147:13: */
+func setDeviceCharacteristics(tls *libc.TLS, pFd uintptr) { /* sqlite3.c:38330:13: */
if (*UnixFile)(unsafe.Pointer(pFd)).FsectorSize == 0 {
// Set the POWERSAFE_OVERWRITE flag if requested.
- if (int32((*UnixFile)(unsafe.Pointer(pFd)).FctrlFlags) & UNIXFILE_PSOW) != 0 {
- *(*int32)(unsafe.Pointer(pFd + 80 /* &.deviceCharacteristics */)) |= (SQLITE_IOCAP_POWERSAFE_OVERWRITE)
+ if int32((*UnixFile)(unsafe.Pointer(pFd)).FctrlFlags)&UNIXFILE_PSOW != 0 {
+ *(*int32)(unsafe.Pointer(pFd + 80)) |= SQLITE_IOCAP_POWERSAFE_OVERWRITE
}
(*UnixFile)(unsafe.Pointer(pFd)).FsectorSize = SQLITE_DEFAULT_SECTOR_SIZE
@@ -24769,7 +25339,7 @@ func setDeviceCharacteristics(tls *libc.TLS, pFd uintptr) { /* sqlite3.c:38147:1
// if two files are created in the same file-system directory (i.e.
// a database and its journal file) that the sector size will be the
// same for both.
-func unixSectorSize(tls *libc.TLS, id uintptr) int32 { /* sqlite3.c:38254:12: */
+func unixSectorSize(tls *libc.TLS, id uintptr) int32 { /* sqlite3.c:38437:12: */
var pFd uintptr = id
setDeviceCharacteristics(tls, pFd)
return (*UnixFile)(unsafe.Pointer(pFd)).FsectorSize
@@ -24786,7 +25356,7 @@ func unixSectorSize(tls *libc.TLS, id uintptr) int32 { /* sqlite3.c:38254:12: */
// of required I/O for journaling, since a lot of padding is eliminated.
// Hence, while POWERSAFE_OVERWRITE is on by default, there is a file-control
// available to turn it off and URI query parameter available to turn it off.
-func unixDeviceCharacteristics(tls *libc.TLS, id uintptr) int32 { /* sqlite3.c:38273:12: */
+func unixDeviceCharacteristics(tls *libc.TLS, id uintptr) int32 { /* sqlite3.c:38456:12: */
var pFd uintptr = id
setDeviceCharacteristics(tls, pFd)
return (*UnixFile)(unsafe.Pointer(pFd)).FdeviceCharacteristics
@@ -24796,7 +25366,7 @@ func unixDeviceCharacteristics(tls *libc.TLS, id uintptr) int32 { /* sqlite3.c:3
//
// This function should not be called directly by other code in this file.
// Instead, it should be called via macro osGetpagesize().
-func unixGetpagesize(tls *libc.TLS) int32 { /* sqlite3.c:38287:12: */
+func unixGetpagesize(tls *libc.TLS) int32 { /* sqlite3.c:38470:12: */
return int32(libc.Xsysconf(tls, X_SC_PAGESIZE))
}
@@ -24808,7 +25378,7 @@ func unixGetpagesize(tls *libc.TLS) int32 { /* sqlite3.c:38287:12: */
// such transactions, or 0 otherwise. If an error occurs, return an
// SQLite error code. The final value of *piOut is undefined in this
// case.
-func unixFcntlExternalReader(tls *libc.TLS, pFile uintptr, piOut uintptr) int32 { /* sqlite3.c:38386:12: */
+func unixFcntlExternalReader(tls *libc.TLS, pFile uintptr, piOut uintptr) int32 { /* sqlite3.c:38569:12: */
bp := tls.Alloc(40)
defer tls.Free(40)
@@ -24821,14 +25391,14 @@ func unixFcntlExternalReader(tls *libc.TLS, pFile uintptr, piOut uintptr) int32
libc.Xmemset(tls, bp+8 /* &f */, 0, uint32(unsafe.Sizeof(flock{})))
(*flock)(unsafe.Pointer(bp + 8 /* &f */)).Fl_type = int16(F_WRLCK)
(*flock)(unsafe.Pointer(bp + 8 /* &f */)).Fl_whence = int16(SEEK_SET)
- (*flock)(unsafe.Pointer(bp + 8 /* &f */)).Fl_start = (int64(((22 + SQLITE_SHM_NLOCK) * 4) + 3))
- (*flock)(unsafe.Pointer(bp + 8 /* &f */)).Fl_len = (int64(SQLITE_SHM_NLOCK - 3))
+ (*flock)(unsafe.Pointer(bp + 8 /* &f */)).Fl_start = int64((22+SQLITE_SHM_NLOCK)*4 + 3)
+ (*flock)(unsafe.Pointer(bp + 8 /* &f */)).Fl_len = int64(SQLITE_SHM_NLOCK - 3)
Xsqlite3_mutex_enter(tls, (*UnixShmNode)(unsafe.Pointer(pShmNode)).FpShmMutex)
- if (*(*func(*libc.TLS, int32, int32, uintptr) int32)(unsafe.Pointer((uintptr(unsafe.Pointer(&aSyscall)) + 7*12 + 4 /* &.pCurrent */))))(tls, (*UnixShmNode)(unsafe.Pointer(pShmNode)).FhShm, F_GETLK64, libc.VaList(bp, bp+8 /* &f */)) < 0 {
- rc = (SQLITE_IOERR | (int32(15) << 8))
+ if (*(*func(*libc.TLS, int32, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aSyscall)) + 7*12 + 4)))(tls, (*UnixShmNode)(unsafe.Pointer(pShmNode)).FhShm, F_GETLK64, libc.VaList(bp, bp+8)) < 0 {
+ rc = SQLITE_IOERR | int32(15)<<8
} else {
- *(*int32)(unsafe.Pointer(piOut)) = (libc.Bool32(int32((*flock)(unsafe.Pointer(bp+8 /* &f */)).Fl_type) != F_UNLCK))
+ *(*int32)(unsafe.Pointer(piOut)) = libc.Bool32(int32((*flock)(unsafe.Pointer(bp+8)).Fl_type) != F_UNLCK)
}
Xsqlite3_mutex_leave(tls, (*UnixShmNode)(unsafe.Pointer(pShmNode)).FpShmMutex)
}
@@ -24840,7 +25410,7 @@ func unixFcntlExternalReader(tls *libc.TLS, pFile uintptr, piOut uintptr) int32
//
// Locks block if the mask is exactly UNIX_SHM_C and are non-blocking
// otherwise.
-func unixShmSystemLock(tls *libc.TLS, pFile uintptr, lockType int32, ofst int32, n int32) int32 { /* sqlite3.c:38418:12: */
+func unixShmSystemLock(tls *libc.TLS, pFile uintptr, lockType int32, ofst int32, n int32) int32 { /* sqlite3.c:38601:12: */
bp := tls.Alloc(40)
defer tls.Free(40)
@@ -24863,7 +25433,7 @@ func unixShmSystemLock(tls *libc.TLS, pFile uintptr, lockType int32, ofst int32,
(*flock)(unsafe.Pointer(bp + 8 /* &f */)).Fl_whence = int16(SEEK_SET)
(*flock)(unsafe.Pointer(bp + 8 /* &f */)).Fl_start = X__off64_t(ofst)
(*flock)(unsafe.Pointer(bp + 8 /* &f */)).Fl_len = X__off64_t(n)
- res = (*(*func(*libc.TLS, int32, int32, uintptr) int32)(unsafe.Pointer((uintptr(unsafe.Pointer(&aSyscall)) + 7*12 + 4 /* &.pCurrent */))))(tls, (*UnixShmNode)(unsafe.Pointer(pShmNode)).FhShm, F_SETLK64, libc.VaList(bp, bp+8 /* &f */))
+ res = (*(*func(*libc.TLS, int32, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aSyscall)) + 7*12 + 4)))(tls, (*UnixShmNode)(unsafe.Pointer(pShmNode)).FhShm, F_SETLK64, libc.VaList(bp, bp+8))
if res == -1 {
rc = SQLITE_BUSY
}
@@ -24881,38 +25451,38 @@ func unixShmSystemLock(tls *libc.TLS, pFile uintptr, lockType int32, ofst int32,
// Usually, this is 1. The exception seems to be systems that are configured
// to use 64KB pages - in this case each mapping must cover at least two
// shm regions.
-func unixShmRegionPerMap(tls *libc.TLS) int32 { /* sqlite3.c:38503:12: */
- var shmsz int32 = (32 * 1024) // SHM region size
- var pgsz int32 = (*(*func(*libc.TLS) int32)(unsafe.Pointer((uintptr(unsafe.Pointer(&aSyscall)) + 25*12 + 4 /* &.pCurrent */))))(tls) // System page size
+func unixShmRegionPerMap(tls *libc.TLS) int32 { /* sqlite3.c:38686:12: */
+ var shmsz int32 = 32 * 1024 // SHM region size
+ var pgsz int32 = (*(*func(*libc.TLS) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aSyscall)) + 25*12 + 4)))(tls) // System page size
// Page size must be a power of 2
if pgsz < shmsz {
return 1
}
- return (pgsz / shmsz)
+ return pgsz / shmsz
}
// Purge the unixShmNodeList list of all entries with unixShmNode.nRef==0.
//
// This is not a VFS shared-memory method; it is a utility function called
// by VFS shared-memory methods.
-func unixShmPurge(tls *libc.TLS, pFd uintptr) { /* sqlite3.c:38517:13: */
+func unixShmPurge(tls *libc.TLS, pFd uintptr) { /* sqlite3.c:38700:13: */
var p uintptr = (*UnixInodeInfo)(unsafe.Pointer((*UnixFile)(unsafe.Pointer(pFd)).FpInode)).FpShmNode
- if (p != 0) && ((*UnixShmNode)(unsafe.Pointer(p)).FnRef == 0) {
+ if p != 0 && (*UnixShmNode)(unsafe.Pointer(p)).FnRef == 0 {
var nShmPerMap int32 = unixShmRegionPerMap(tls)
var i int32
Xsqlite3_mutex_free(tls, (*UnixShmNode)(unsafe.Pointer(p)).FpShmMutex)
- for i = 0; i < int32((*UnixShmNode)(unsafe.Pointer(p)).FnRegion); i = i + (nShmPerMap) {
+ for i = 0; i < int32((*UnixShmNode)(unsafe.Pointer(p)).FnRegion); i = i + nShmPerMap {
if (*UnixShmNode)(unsafe.Pointer(p)).FhShm >= 0 {
- (*(*func(*libc.TLS, uintptr, Size_t) int32)(unsafe.Pointer((uintptr(unsafe.Pointer(&aSyscall)) + 23*12 + 4 /* &.pCurrent */))))(tls, *(*uintptr)(unsafe.Pointer((*UnixShmNode)(unsafe.Pointer(p)).FapRegion + uintptr(i)*4)), uint32((*UnixShmNode)(unsafe.Pointer(p)).FszRegion))
+ (*(*func(*libc.TLS, uintptr, Size_t) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aSyscall)) + 23*12 + 4)))(tls, *(*uintptr)(unsafe.Pointer((*UnixShmNode)(unsafe.Pointer(p)).FapRegion + uintptr(i)*4)), uint32((*UnixShmNode)(unsafe.Pointer(p)).FszRegion))
} else {
Xsqlite3_free(tls, *(*uintptr)(unsafe.Pointer((*UnixShmNode)(unsafe.Pointer(p)).FapRegion + uintptr(i)*4)))
}
}
Xsqlite3_free(tls, (*UnixShmNode)(unsafe.Pointer(p)).FapRegion)
if (*UnixShmNode)(unsafe.Pointer(p)).FhShm >= 0 {
- robust_close(tls, pFd, (*UnixShmNode)(unsafe.Pointer(p)).FhShm, 38534)
+ robust_close(tls, pFd, (*UnixShmNode)(unsafe.Pointer(p)).FhShm, 38717)
(*UnixShmNode)(unsafe.Pointer(p)).FhShm = -1
}
(*UnixInodeInfo)(unsafe.Pointer((*UnixShmNode)(unsafe.Pointer(p)).FpInode)).FpShmNode = uintptr(0)
@@ -24927,7 +25497,7 @@ func unixShmPurge(tls *libc.TLS, pFd uintptr) { /* sqlite3.c:38517:13: */
// If the DMS cannot be locked because this is a readonly_shm=1
// connection and no other process already holds a lock, return
// SQLITE_READONLY_CANTINIT and set pShmNode->isUnlocked=1.
-func unixLockSharedMemory(tls *libc.TLS, pDbFd uintptr, pShmNode uintptr) int32 { /* sqlite3.c:38551:12: */
+func unixLockSharedMemory(tls *libc.TLS, pDbFd uintptr, pShmNode uintptr) int32 { /* sqlite3.c:38734:12: */
bp := tls.Alloc(40)
defer tls.Free(40)
@@ -24954,33 +25524,33 @@ func unixLockSharedMemory(tls *libc.TLS, pDbFd uintptr, pShmNode uintptr) int32
// And if the *-shm file has been corrupted by a power failure or
// system crash, the database itself may also become corrupt.
(*flock)(unsafe.Pointer(bp + 8 /* &lock */)).Fl_whence = int16(SEEK_SET)
- (*flock)(unsafe.Pointer(bp + 8 /* &lock */)).Fl_start = (int64(((22 + SQLITE_SHM_NLOCK) * 4) + SQLITE_SHM_NLOCK))
+ (*flock)(unsafe.Pointer(bp + 8 /* &lock */)).Fl_start = int64((22+SQLITE_SHM_NLOCK)*4 + SQLITE_SHM_NLOCK)
(*flock)(unsafe.Pointer(bp + 8 /* &lock */)).Fl_len = int64(1)
(*flock)(unsafe.Pointer(bp + 8 /* &lock */)).Fl_type = int16(F_WRLCK)
- if (*(*func(*libc.TLS, int32, int32, uintptr) int32)(unsafe.Pointer((uintptr(unsafe.Pointer(&aSyscall)) + 7*12 + 4 /* &.pCurrent */))))(tls, (*UnixShmNode)(unsafe.Pointer(pShmNode)).FhShm, F_GETLK64, libc.VaList(bp, bp+8 /* &lock */)) != 0 {
- rc = (SQLITE_IOERR | (int32(15) << 8))
- } else if int32((*flock)(unsafe.Pointer(bp+8 /* &lock */)).Fl_type) == F_UNLCK {
+ if (*(*func(*libc.TLS, int32, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aSyscall)) + 7*12 + 4)))(tls, (*UnixShmNode)(unsafe.Pointer(pShmNode)).FhShm, F_GETLK64, libc.VaList(bp, bp+8)) != 0 {
+ rc = SQLITE_IOERR | int32(15)<<8
+ } else if int32((*flock)(unsafe.Pointer(bp+8)).Fl_type) == F_UNLCK {
if (*UnixShmNode)(unsafe.Pointer(pShmNode)).FisReadonly != 0 {
(*UnixShmNode)(unsafe.Pointer(pShmNode)).FisUnlocked = U8(1)
- rc = (SQLITE_READONLY | (int32(5) << 8))
+ rc = SQLITE_READONLY | int32(5)<<8
} else {
- rc = unixShmSystemLock(tls, pDbFd, F_WRLCK, (((22 + SQLITE_SHM_NLOCK) * 4) + SQLITE_SHM_NLOCK), 1)
+ rc = unixShmSystemLock(tls, pDbFd, F_WRLCK, (22+SQLITE_SHM_NLOCK)*4+SQLITE_SHM_NLOCK, 1)
// The first connection to attach must truncate the -shm file. We
// truncate to 3 bytes (an arbitrary small number, less than the
// -shm header size) rather than 0 as a system debugging aid, to
// help detect if a -shm file truncation is legitimate or is the work
// or a rogue process.
- if (rc == SQLITE_OK) && (robust_ftruncate(tls, (*UnixShmNode)(unsafe.Pointer(pShmNode)).FhShm, int64(3)) != 0) {
- rc = unixLogErrorAtLine(tls, (SQLITE_IOERR | (int32(18) << 8)), ts+2424 /* "ftruncate" */, (*UnixShmNode)(unsafe.Pointer(pShmNode)).FzFilename, 38591)
+ if rc == SQLITE_OK && robust_ftruncate(tls, (*UnixShmNode)(unsafe.Pointer(pShmNode)).FhShm, int64(3)) != 0 {
+ rc = unixLogErrorAtLine(tls, SQLITE_IOERR|int32(18)<<8, ts+3235 /* "ftruncate" */, (*UnixShmNode)(unsafe.Pointer(pShmNode)).FzFilename, 38774)
}
}
- } else if int32((*flock)(unsafe.Pointer(bp+8 /* &lock */)).Fl_type) == F_WRLCK {
+ } else if int32((*flock)(unsafe.Pointer(bp+8)).Fl_type) == F_WRLCK {
rc = SQLITE_BUSY
}
if rc == SQLITE_OK {
- rc = unixShmSystemLock(tls, pDbFd, F_RDLCK, (((22 + SQLITE_SHM_NLOCK) * 4) + SQLITE_SHM_NLOCK), 1)
+ rc = unixShmSystemLock(tls, pDbFd, F_RDLCK, (22+SQLITE_SHM_NLOCK)*4+SQLITE_SHM_NLOCK, 1)
}
return rc
}
@@ -25018,7 +25588,7 @@ func unixLockSharedMemory(tls *libc.TLS, pDbFd uintptr, pShmNode uintptr) int32
// that no other processes are able to read or write the database. In
// that case, we do not really need shared memory. No shared memory
// file is created. The shared memory will be simulated with heap memory.
-func unixOpenSharedMemory(tls *libc.TLS, pDbFd uintptr) int32 { /* sqlite3.c:38640:12: */
+func unixOpenSharedMemory(tls *libc.TLS, pDbFd uintptr) int32 { /* sqlite3.c:38823:12: */
bp := tls.Alloc(112)
defer tls.Free(112)
@@ -25058,16 +25628,16 @@ __1:
// Call fstat() to figure out the permissions on the database file. If
// a new *-shm file is created, an attempt will be made to create it
// with the same permissions.
- if !((*(*func(*libc.TLS, int32, uintptr) int32)(unsafe.Pointer((uintptr(unsafe.Pointer(&aSyscall)) + 5*12 + 4 /* &.pCurrent */))))(tls, (*UnixFile)(unsafe.Pointer(pDbFd)).Fh, bp+8 /* &sStat */) != 0) {
+ if !((*(*func(*libc.TLS, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aSyscall)) + 5*12 + 4)))(tls, (*UnixFile)(unsafe.Pointer(pDbFd)).Fh, bp+8) != 0) {
goto __3
}
- rc = (SQLITE_IOERR | (int32(7) << 8))
+ rc = SQLITE_IOERR | int32(7)<<8
goto shm_open_err
__3:
;
- nShmFilename = (6 + int32(libc.Xstrlen(tls, zBasePath)))
- pShmNode = Xsqlite3_malloc64(tls, (uint64(uint32(unsafe.Sizeof(unixShmNode{})) + uint32(nShmFilename))))
+ nShmFilename = 6 + int32(libc.Xstrlen(tls, zBasePath))
+ pShmNode = Xsqlite3_malloc64(tls, uint64(uint32(unsafe.Sizeof(unixShmNode{}))+uint32(nShmFilename)))
if !(pShmNode == uintptr(0)) {
goto __4
}
@@ -25075,9 +25645,9 @@ __3:
goto shm_open_err
__4:
;
- libc.Xmemset(tls, pShmNode, 0, (uint32(unsafe.Sizeof(unixShmNode{})) + uint32(nShmFilename)))
- zShm = libc.AssignPtrUintptr(pShmNode+8 /* &.zFilename */, (pShmNode + 1*68))
- Xsqlite3_snprintf(tls, nShmFilename, zShm, ts+2804 /* "%s-shm" */, libc.VaList(bp, zBasePath))
+ libc.Xmemset(tls, pShmNode, 0, uint32(unsafe.Sizeof(unixShmNode{}))+uint32(nShmFilename))
+ zShm = libc.AssignPtrUintptr(pShmNode+8, pShmNode+1*68)
+ Xsqlite3_snprintf(tls, nShmFilename, zShm, ts+3615 /* "%s-shm" */, libc.VaList(bp, zBasePath))
(*unixShmNode)(unsafe.Pointer(pShmNode)).FhShm = -1
(*UnixInodeInfo)(unsafe.Pointer((*UnixFile)(unsafe.Pointer(pDbFd)).FpInode)).FpShmNode = pShmNode
@@ -25099,22 +25669,22 @@ __5:
if !(int32((*UnixInodeInfo)(unsafe.Pointer(pInode)).FbProcessLock) == 0) {
goto __7
}
- if !(0 == Xsqlite3_uri_boolean(tls, (*UnixFile)(unsafe.Pointer(pDbFd)).FzPath, ts+2811 /* "readonly_shm" */, 0)) {
+ if !(0 == Xsqlite3_uri_boolean(tls, (*UnixFile)(unsafe.Pointer(pDbFd)).FzPath, ts+3622, 0)) {
goto __8
}
- (*unixShmNode)(unsafe.Pointer(pShmNode)).FhShm = robust_open(tls, zShm, ((O_RDWR | O_CREAT) | 0100000),
- ((*stat)(unsafe.Pointer(bp+8 /* &sStat */)).Fst_mode & X__mode_t(0777)))
+ (*unixShmNode)(unsafe.Pointer(pShmNode)).FhShm = robust_open(tls, zShm, O_RDWR|O_CREAT|0100000,
+ (*stat)(unsafe.Pointer(bp+8)).Fst_mode&X__mode_t(0777))
__8:
;
if !((*unixShmNode)(unsafe.Pointer(pShmNode)).FhShm < 0) {
goto __9
}
- (*unixShmNode)(unsafe.Pointer(pShmNode)).FhShm = robust_open(tls, zShm, (O_RDONLY | 0100000),
- ((*stat)(unsafe.Pointer(bp+8 /* &sStat */)).Fst_mode & X__mode_t(0777)))
+ (*unixShmNode)(unsafe.Pointer(pShmNode)).FhShm = robust_open(tls, zShm, O_RDONLY|0100000,
+ (*stat)(unsafe.Pointer(bp+8)).Fst_mode&X__mode_t(0777))
if !((*unixShmNode)(unsafe.Pointer(pShmNode)).FhShm < 0) {
goto __10
}
- rc = unixLogErrorAtLine(tls, Xsqlite3CantopenError(tls, 38716), ts+2388 /* "open" */, zShm, 38716)
+ rc = unixLogErrorAtLine(tls, Xsqlite3CantopenError(tls, 38899), ts+3199 /* "open" */, zShm, 38899)
goto shm_open_err
__10:
;
@@ -25128,7 +25698,7 @@ __9:
robustFchown(tls, (*unixShmNode)(unsafe.Pointer(pShmNode)).FhShm, (*stat)(unsafe.Pointer(bp+8 /* &sStat */)).Fst_uid, (*stat)(unsafe.Pointer(bp+8 /* &sStat */)).Fst_gid)
rc = unixLockSharedMemory(tls, pDbFd, pShmNode)
- if !((rc != SQLITE_OK) && (rc != (SQLITE_READONLY | (int32(5) << 8)))) {
+ if !(rc != SQLITE_OK && rc != SQLITE_READONLY|int32(5)<<8) {
goto __11
}
goto shm_open_err
@@ -25182,7 +25752,7 @@ shm_open_err:
// this call as described above, then it is mapped into this processes
// address space (if it is not already), *pp is set to point to the mapped
// memory and SQLITE_OK returned.
-func unixShmMap(tls *libc.TLS, fd uintptr, iRegion int32, szRegion int32, bExtend int32, pp uintptr) int32 { /* sqlite3.c:38782:12: */
+func unixShmMap(tls *libc.TLS, fd uintptr, iRegion int32, szRegion int32, bExtend int32, pp uintptr) int32 { /* sqlite3.c:38965:12: */
bp := tls.Alloc(108)
defer tls.Free(108)
@@ -25238,12 +25808,12 @@ __3:
;
// Minimum number of regions required to be mapped.
- nReqRegion = (((iRegion + nShmPerMap) / nShmPerMap) * nShmPerMap)
+ nReqRegion = (iRegion + nShmPerMap) / nShmPerMap * nShmPerMap
if !(int32((*UnixShmNode)(unsafe.Pointer(pShmNode)).FnRegion) < nReqRegion) {
goto __5
} // New apRegion[] array
- nByte = (nReqRegion * szRegion) // Used by fstat()
+ nByte = nReqRegion * szRegion // Used by fstat()
(*UnixShmNode)(unsafe.Pointer(pShmNode)).FszRegion = szRegion
@@ -25253,20 +25823,20 @@ __3:
// The requested region is not mapped into this processes address space.
// Check to see if it has been allocated (i.e. if the wal-index file is
// large enough to contain the requested region).
- if !((*(*func(*libc.TLS, int32, uintptr) int32)(unsafe.Pointer((uintptr(unsafe.Pointer(&aSyscall)) + 5*12 + 4 /* &.pCurrent */))))(tls, (*UnixShmNode)(unsafe.Pointer(pShmNode)).FhShm, bp /* &sStat */) != 0) {
+ if !((*(*func(*libc.TLS, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aSyscall)) + 5*12 + 4)))(tls, (*UnixShmNode)(unsafe.Pointer(pShmNode)).FhShm, bp) != 0) {
goto __7
}
- rc = (SQLITE_IOERR | (int32(19) << 8))
+ rc = SQLITE_IOERR | int32(19)<<8
goto shmpage_out
__7:
;
- if !((*stat)(unsafe.Pointer(bp /* &sStat */)).Fst_size < X__off64_t(nByte)) {
+ if !((*stat)(unsafe.Pointer(bp)).Fst_size < X__off64_t(nByte)) {
goto __8
}
// The requested memory region does not exist. If bExtend is set to
// false, exit early. *pp will be set to NULL and SQLITE_OK returned.
- if !(!(bExtend != 0)) {
+ if !!(bExtend != 0) {
goto __9
}
goto shmpage_out
@@ -25275,17 +25845,17 @@ __9:
// Write to the last byte of each newly allocated or extended page
;
- iPg = (int32((*stat)(unsafe.Pointer(bp /* &sStat */)).Fst_size / X__off64_t(pgsz)))
+ iPg = int32((*stat)(unsafe.Pointer(bp)).Fst_size / X__off64_t(pgsz))
__11:
- if !(iPg < (nByte / pgsz)) {
+ if !(iPg < nByte/pgsz) {
goto __13
}
*(*int32)(unsafe.Pointer(bp + 104 /* x */)) = 0
- if !(seekAndWriteFd(tls, (*UnixShmNode)(unsafe.Pointer(pShmNode)).FhShm, (int64(((iPg*pgsz)+pgsz)-1)), ts+755 /* "" */, 1, bp+104 /* &x */) != 1) {
+ if !(seekAndWriteFd(tls, (*UnixShmNode)(unsafe.Pointer(pShmNode)).FhShm, int64(iPg*pgsz+pgsz-1), ts+1543, 1, bp+104) != 1) {
goto __14
}
zFile = (*UnixShmNode)(unsafe.Pointer(pShmNode)).FzFilename
- rc = unixLogErrorAtLine(tls, (SQLITE_IOERR | (int32(19) << 8)), ts+2459 /* "write" */, zFile, 38860)
+ rc = unixLogErrorAtLine(tls, SQLITE_IOERR|int32(19)<<8, ts+3270 /* "write" */, zFile, 39043)
goto shmpage_out
__14:
;
@@ -25305,11 +25875,11 @@ __6:
// Map the requested memory region into this processes address space.
apNew = Xsqlite3_realloc(tls,
- (*UnixShmNode)(unsafe.Pointer(pShmNode)).FapRegion, (int32(uint32(nReqRegion) * uint32(unsafe.Sizeof(uintptr(0))))))
- if !(!(apNew != 0)) {
+ (*UnixShmNode)(unsafe.Pointer(pShmNode)).FapRegion, int32(uint32(nReqRegion)*uint32(unsafe.Sizeof(uintptr(0)))))
+ if !!(apNew != 0) {
goto __15
}
- rc = (SQLITE_IOERR | (int32(12) << 8))
+ rc = SQLITE_IOERR | int32(12)<<8
goto shmpage_out
__15:
;
@@ -25318,22 +25888,22 @@ __16:
if !(int32((*UnixShmNode)(unsafe.Pointer(pShmNode)).FnRegion) < nReqRegion) {
goto __17
}
- nMap = (szRegion * nShmPerMap)
+ nMap = szRegion * nShmPerMap
if !((*UnixShmNode)(unsafe.Pointer(pShmNode)).FhShm >= 0) {
goto __18
}
- pMem = (*(*func(*libc.TLS, uintptr, Size_t, int32, int32, int32, Off_t) uintptr)(unsafe.Pointer((uintptr(unsafe.Pointer(&aSyscall)) + 22*12 + 4 /* &.pCurrent */))))(tls, uintptr(0), uint32(nMap),
+ pMem = (*(*func(*libc.TLS, uintptr, Size_t, int32, int32, int32, Off_t) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aSyscall)) + 22*12 + 4)))(tls, uintptr(0), uint32(nMap),
func() int32 {
if (*UnixShmNode)(unsafe.Pointer(pShmNode)).FisReadonly != 0 {
return PROT_READ
}
- return (PROT_READ | PROT_WRITE)
+ return PROT_READ | PROT_WRITE
}(),
- MAP_SHARED, (*UnixShmNode)(unsafe.Pointer(pShmNode)).FhShm, (I64(szRegion) * I64((*UnixShmNode)(unsafe.Pointer(pShmNode)).FnRegion)))
- if !(pMem == (libc.UintptrFromInt32(-1))) {
+ MAP_SHARED, (*UnixShmNode)(unsafe.Pointer(pShmNode)).FhShm, I64(szRegion)*I64((*UnixShmNode)(unsafe.Pointer(pShmNode)).FnRegion))
+ if !(pMem == libc.UintptrFromInt32(-1)) {
goto __20
}
- rc = unixLogErrorAtLine(tls, (SQLITE_IOERR | (int32(21) << 8)), ts+2546 /* "mmap" */, (*UnixShmNode)(unsafe.Pointer(pShmNode)).FzFilename, 38887)
+ rc = unixLogErrorAtLine(tls, SQLITE_IOERR|int32(21)<<8, ts+3357 /* "mmap" */, (*UnixShmNode)(unsafe.Pointer(pShmNode)).FzFilename, 39070)
goto shmpage_out
__20:
;
@@ -25356,7 +25926,7 @@ __22:
if !(i < nShmPerMap) {
goto __24
}
- *(*uintptr)(unsafe.Pointer((*UnixShmNode)(unsafe.Pointer(pShmNode)).FapRegion + uintptr((int32((*UnixShmNode)(unsafe.Pointer(pShmNode)).FnRegion)+i))*4)) = ((pMem) + uintptr((szRegion * i)))
+ *(*uintptr)(unsafe.Pointer((*UnixShmNode)(unsafe.Pointer(pShmNode)).FapRegion + uintptr(int32((*UnixShmNode)(unsafe.Pointer(pShmNode)).FnRegion)+i)*4)) = pMem + uintptr(szRegion*i)
goto __23
__23:
i++
@@ -25364,7 +25934,7 @@ __23:
goto __24
__24:
;
- *(*U16)(unsafe.Pointer(pShmNode + 20 /* &.nRegion */)) += U16((nShmPerMap))
+ *(*U16)(unsafe.Pointer(pShmNode + 20)) += U16(nShmPerMap)
goto __16
__17:
;
@@ -25381,7 +25951,7 @@ __25:
*(*uintptr)(unsafe.Pointer(pp)) = uintptr(0)
__26:
;
- if !(((*UnixShmNode)(unsafe.Pointer(pShmNode)).FisReadonly != 0) && (rc == SQLITE_OK)) {
+ if !((*UnixShmNode)(unsafe.Pointer(pShmNode)).FisReadonly != 0 && rc == SQLITE_OK) {
goto __27
}
rc = SQLITE_READONLY
@@ -25391,7 +25961,7 @@ __27:
return rc
}
-var pgsz int32 = 4096 /* sqlite3.c:38851:28 */
+var pgsz int32 = 4096 /* sqlite3.c:39034:28 */
// Check that the pShmNode->aLock[] array comports with the locking bitmasks
// held by each client. Return true if it does, or false otherwise. This
@@ -25405,7 +25975,7 @@ var pgsz int32 = 4096 /* sqlite3.c:38851:28 */
// different here than in posix. In xShmLock(), one can go from unlocked
// to shared and back or from unlocked to exclusive and back. But one may
// not go from shared to exclusive or from exclusive to shared.
-func unixShmLock(tls *libc.TLS, fd uintptr, ofst int32, n int32, flags int32) int32 { /* sqlite3.c:38957:12: */
+func unixShmLock(tls *libc.TLS, fd uintptr, ofst int32, n int32, flags int32) int32 { /* sqlite3.c:39140:12: */
var pDbFd uintptr = fd // Connection holding shared memory
var p uintptr = (*UnixFile)(unsafe.Pointer(pDbFd)).FpShm // The shared memory being locked
var pShmNode uintptr = (*UnixShm)(unsafe.Pointer(p)).FpShmNode // The underlying file iNode
@@ -25426,54 +25996,54 @@ func unixShmLock(tls *libc.TLS, fd uintptr, ofst int32, n int32, flags int32) in
//
// It is not permitted to block on the RECOVER lock.
- mask = (U16((int32(1) << (ofst + n)) - (int32(1) << ofst)))
+ mask = U16(int32(1)<<(ofst+n) - int32(1)<<ofst)
Xsqlite3_mutex_enter(tls, (*UnixShmNode)(unsafe.Pointer(pShmNode)).FpShmMutex)
- if (flags & SQLITE_SHM_UNLOCK) != 0 {
- if ((int32((*UnixShm)(unsafe.Pointer(p)).FexclMask) | int32((*UnixShm)(unsafe.Pointer(p)).FsharedMask)) & int32(mask)) != 0 {
+ if flags&SQLITE_SHM_UNLOCK != 0 {
+ if (int32((*UnixShm)(unsafe.Pointer(p)).FexclMask)|int32((*UnixShm)(unsafe.Pointer(p)).FsharedMask))&int32(mask) != 0 {
var ii int32
var bUnlock int32 = 1
- for ii = ofst; ii < (ofst + n); ii++ {
- if *(*int32)(unsafe.Pointer(aLock + uintptr(ii)*4)) > (func() int32 {
- if (int32((*UnixShm)(unsafe.Pointer(p)).FsharedMask) & (int32(1) << ii)) != 0 {
+ for ii = ofst; ii < ofst+n; ii++ {
+ if *(*int32)(unsafe.Pointer(aLock + uintptr(ii)*4)) > func() int32 {
+ if int32((*UnixShm)(unsafe.Pointer(p)).FsharedMask)&(int32(1)<<ii) != 0 {
return 1
}
return 0
- }()) {
+ }() {
bUnlock = 0
}
}
if bUnlock != 0 {
- rc = unixShmSystemLock(tls, pDbFd, F_UNLCK, (ofst + ((22 + SQLITE_SHM_NLOCK) * 4)), n)
+ rc = unixShmSystemLock(tls, pDbFd, F_UNLCK, ofst+(22+SQLITE_SHM_NLOCK)*4, n)
if rc == SQLITE_OK {
- libc.Xmemset(tls, (aLock + uintptr(ofst)*4), 0, (uint32(unsafe.Sizeof(int32(0))) * uint32(n)))
+ libc.Xmemset(tls, aLock+uintptr(ofst)*4, 0, uint32(unsafe.Sizeof(int32(0)))*uint32(n))
}
- } else if (int32((*UnixShm)(unsafe.Pointer(p)).FsharedMask) & (int32(1) << ofst)) != 0 {
+ } else if int32((*UnixShm)(unsafe.Pointer(p)).FsharedMask)&(int32(1)<<ofst) != 0 {
*(*int32)(unsafe.Pointer(aLock + uintptr(ofst)*4))--
}
// Undo the local locks
if rc == SQLITE_OK {
- *(*U16)(unsafe.Pointer(p + 12 /* &.exclMask */)) &= U16((^int32(mask)))
- *(*U16)(unsafe.Pointer(p + 10 /* &.sharedMask */)) &= U16((^int32(mask)))
+ *(*U16)(unsafe.Pointer(p + 12)) &= U16(^int32(mask))
+ *(*U16)(unsafe.Pointer(p + 10)) &= U16(^int32(mask))
}
}
- } else if (flags & SQLITE_SHM_SHARED) != 0 {
+ } else if flags&SQLITE_SHM_SHARED != 0 {
- if (int32((*UnixShm)(unsafe.Pointer(p)).FsharedMask) & int32(mask)) == 0 {
+ if int32((*UnixShm)(unsafe.Pointer(p)).FsharedMask)&int32(mask) == 0 {
if *(*int32)(unsafe.Pointer(aLock + uintptr(ofst)*4)) < 0 {
rc = SQLITE_BUSY
} else if *(*int32)(unsafe.Pointer(aLock + uintptr(ofst)*4)) == 0 {
- rc = unixShmSystemLock(tls, pDbFd, F_RDLCK, (ofst + ((22 + SQLITE_SHM_NLOCK) * 4)), n)
+ rc = unixShmSystemLock(tls, pDbFd, F_RDLCK, ofst+(22+SQLITE_SHM_NLOCK)*4, n)
}
// Get the local shared locks
if rc == SQLITE_OK {
- *(*U16)(unsafe.Pointer(p + 10 /* &.sharedMask */)) |= U16((int32(mask)))
+ *(*U16)(unsafe.Pointer(p + 10)) |= U16(int32(mask))
*(*int32)(unsafe.Pointer(aLock + uintptr(ofst)*4))++
}
}
@@ -25481,9 +26051,9 @@ func unixShmLock(tls *libc.TLS, fd uintptr, ofst int32, n int32, flags int32) in
// Make sure no sibling connections hold locks that will block this
// lock. If any do, return SQLITE_BUSY right away.
var ii int32
- for ii = ofst; ii < (ofst + n); ii++ {
+ for ii = ofst; ii < ofst+n; ii++ {
- if ((int32((*UnixShm)(unsafe.Pointer(p)).FexclMask) & (int32(1) << ii)) == 0) && (*(*int32)(unsafe.Pointer(aLock + uintptr(ii)*4)) != 0) {
+ if int32((*UnixShm)(unsafe.Pointer(p)).FexclMask)&(int32(1)<<ii) == 0 && *(*int32)(unsafe.Pointer(aLock + uintptr(ii)*4)) != 0 {
rc = SQLITE_BUSY
break
}
@@ -25492,11 +26062,11 @@ func unixShmLock(tls *libc.TLS, fd uintptr, ofst int32, n int32, flags int32) in
// Get the exclusive locks at the system level. Then if successful
// also update the in-memory values.
if rc == SQLITE_OK {
- rc = unixShmSystemLock(tls, pDbFd, F_WRLCK, (ofst + ((22 + SQLITE_SHM_NLOCK) * 4)), n)
+ rc = unixShmSystemLock(tls, pDbFd, F_WRLCK, ofst+(22+SQLITE_SHM_NLOCK)*4, n)
if rc == SQLITE_OK {
- *(*U16)(unsafe.Pointer(p + 12 /* &.exclMask */)) |= U16((int32(mask)))
- for ii = ofst; ii < (ofst + n); ii++ {
+ *(*U16)(unsafe.Pointer(p + 12)) |= U16(int32(mask))
+ for ii = ofst; ii < ofst+n; ii++ {
*(*int32)(unsafe.Pointer(aLock + uintptr(ii)*4)) = -1
}
}
@@ -25512,7 +26082,7 @@ func unixShmLock(tls *libc.TLS, fd uintptr, ofst int32, n int32, flags int32) in
//
// All loads and stores begun before the barrier must complete before
// any load or store begun after the barrier.
-func unixShmBarrier(tls *libc.TLS, fd uintptr) { /* sqlite3.c:39089:13: */
+func unixShmBarrier(tls *libc.TLS, fd uintptr) { /* sqlite3.c:39272:13: */
_ = fd
// compiler-defined memory barrier
@@ -25525,7 +26095,7 @@ func unixShmBarrier(tls *libc.TLS, fd uintptr) { /* sqlite3.c:39089:13: */
//
// If there is no shared memory associated with the connection then this
// routine is a harmless no-op.
-func unixShmUnmap(tls *libc.TLS, fd uintptr, deleteFlag int32) int32 { /* sqlite3.c:39108:12: */
+func unixShmUnmap(tls *libc.TLS, fd uintptr, deleteFlag int32) int32 { /* sqlite3.c:39291:12: */
var p uintptr // The connection to be closed
var pShmNode uintptr // The underlying shared-memory file
var pp uintptr // For looping over sibling connections
@@ -25541,7 +26111,7 @@ func unixShmUnmap(tls *libc.TLS, fd uintptr, deleteFlag int32) int32 { /* sqlite
// Remove connection p from the set of connections associated
// with pShmNode
Xsqlite3_mutex_enter(tls, (*UnixShmNode)(unsafe.Pointer(pShmNode)).FpShmMutex)
- for pp = (pShmNode + 32 /* &.pFirst */); (*(*uintptr)(unsafe.Pointer(pp))) != p; pp = (*(*uintptr)(unsafe.Pointer(pp)) + 4 /* &.pNext */) {
+ for pp = pShmNode + 32; *(*uintptr)(unsafe.Pointer(pp)) != p; pp = *(*uintptr)(unsafe.Pointer(pp)) + 4 {
}
*(*uintptr)(unsafe.Pointer(pp)) = (*UnixShm)(unsafe.Pointer(p)).FpNext
@@ -25557,8 +26127,8 @@ func unixShmUnmap(tls *libc.TLS, fd uintptr, deleteFlag int32) int32 { /* sqlite
(*UnixShmNode)(unsafe.Pointer(pShmNode)).FnRef--
if (*UnixShmNode)(unsafe.Pointer(pShmNode)).FnRef == 0 {
- if (deleteFlag != 0) && ((*UnixShmNode)(unsafe.Pointer(pShmNode)).FhShm >= 0) {
- (*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer((uintptr(unsafe.Pointer(&aSyscall)) + 16*12 + 4 /* &.pCurrent */))))(tls, (*UnixShmNode)(unsafe.Pointer(pShmNode)).FzFilename)
+ if deleteFlag != 0 && (*UnixShmNode)(unsafe.Pointer(pShmNode)).FhShm >= 0 {
+ (*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aSyscall)) + 16*12 + 4)))(tls, (*UnixShmNode)(unsafe.Pointer(pShmNode)).FzFilename)
}
unixShmPurge(tls, pDbFd)
}
@@ -25568,10 +26138,10 @@ func unixShmUnmap(tls *libc.TLS, fd uintptr, deleteFlag int32) int32 { /* sqlite
}
// If it is currently memory mapped, unmap file pFd.
-func unixUnmapfile(tls *libc.TLS, pFd uintptr) { /* sqlite3.c:39165:13: */
+func unixUnmapfile(tls *libc.TLS, pFd uintptr) { /* sqlite3.c:39348:13: */
if (*UnixFile)(unsafe.Pointer(pFd)).FpMapRegion != 0 {
- (*(*func(*libc.TLS, uintptr, Size_t) int32)(unsafe.Pointer((uintptr(unsafe.Pointer(&aSyscall)) + 23*12 + 4 /* &.pCurrent */))))(tls, (*UnixFile)(unsafe.Pointer(pFd)).FpMapRegion, uint32((*UnixFile)(unsafe.Pointer(pFd)).FmmapSizeActual))
+ (*(*func(*libc.TLS, uintptr, Size_t) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aSyscall)) + 23*12 + 4)))(tls, (*UnixFile)(unsafe.Pointer(pFd)).FpMapRegion, uint32((*UnixFile)(unsafe.Pointer(pFd)).FmmapSizeActual))
(*UnixFile)(unsafe.Pointer(pFd)).FpMapRegion = uintptr(0)
(*UnixFile)(unsafe.Pointer(pFd)).FmmapSize = int64(0)
(*UnixFile)(unsafe.Pointer(pFd)).FmmapSizeActual = int64(0)
@@ -25591,8 +26161,8 @@ func unixUnmapfile(tls *libc.TLS, pFd uintptr) { /* sqlite3.c:39165:13: */
// the three variables above are zeroed. In this case SQLite should
// continue accessing the database using the xRead() and xWrite()
// methods.
-func unixRemapfile(tls *libc.TLS, pFd uintptr, nNew I64) { /* sqlite3.c:39190:13: */
- var zErr uintptr = ts + 2546 /* "mmap" */
+func unixRemapfile(tls *libc.TLS, pFd uintptr, nNew I64) { /* sqlite3.c:39373:13: */
+ var zErr uintptr = ts + 3357 /* "mmap" */
var h int32 = (*UnixFile)(unsafe.Pointer(pFd)).Fh // File descriptor open on db file
var pOrig uintptr = (*UnixFile)(unsafe.Pointer(pFd)).FpMapRegion // Pointer to current file mapping
var nOrig I64 = (*UnixFile)(unsafe.Pointer(pFd)).FmmapSizeActual // Size of pOrig region in bytes
@@ -25601,31 +26171,31 @@ func unixRemapfile(tls *libc.TLS, pFd uintptr, nNew I64) { /* sqlite3.c:39190:13
if pOrig != 0 {
var nReuse I64 = (*UnixFile)(unsafe.Pointer(pFd)).FmmapSize
- var pReq uintptr = (pOrig + uintptr(nReuse))
+ var pReq uintptr = pOrig + uintptr(nReuse)
// Unmap any pages of the existing mapping that cannot be reused.
if nReuse != nOrig {
- (*(*func(*libc.TLS, uintptr, Size_t) int32)(unsafe.Pointer((uintptr(unsafe.Pointer(&aSyscall)) + 23*12 + 4 /* &.pCurrent */))))(tls, pReq, (uint32(nOrig - nReuse)))
+ (*(*func(*libc.TLS, uintptr, Size_t) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aSyscall)) + 23*12 + 4)))(tls, pReq, uint32(nOrig-nReuse))
}
- pNew = (*(*func(*libc.TLS, uintptr, Size_t, Size_t, int32, uintptr) uintptr)(unsafe.Pointer((uintptr(unsafe.Pointer(&aSyscall)) + 24*12 + 4 /* &.pCurrent */))))(tls, pOrig, uint32(nReuse), uint32(nNew), MREMAP_MAYMOVE, 0)
- zErr = ts + 2558 /* "mremap" */
+ pNew = (*(*func(*libc.TLS, uintptr, Size_t, Size_t, int32, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aSyscall)) + 24*12 + 4)))(tls, pOrig, uint32(nReuse), uint32(nNew), MREMAP_MAYMOVE, 0)
+ zErr = ts + 3369 /* "mremap" */
// The attempt to extend the existing mapping failed. Free it.
- if (pNew == (libc.UintptrFromInt32(-1))) || (pNew == uintptr(0)) {
- (*(*func(*libc.TLS, uintptr, Size_t) int32)(unsafe.Pointer((uintptr(unsafe.Pointer(&aSyscall)) + 23*12 + 4 /* &.pCurrent */))))(tls, pOrig, uint32(nReuse))
+ if pNew == libc.UintptrFromInt32(-1) || pNew == uintptr(0) {
+ (*(*func(*libc.TLS, uintptr, Size_t) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aSyscall)) + 23*12 + 4)))(tls, pOrig, uint32(nReuse))
}
}
// If pNew is still NULL, try to create an entirely new mapping.
if pNew == uintptr(0) {
- pNew = (*(*func(*libc.TLS, uintptr, Size_t, int32, int32, int32, Off_t) uintptr)(unsafe.Pointer((uintptr(unsafe.Pointer(&aSyscall)) + 22*12 + 4 /* &.pCurrent */))))(tls, uintptr(0), uint32(nNew), flags, MAP_SHARED, h, int64(0))
+ pNew = (*(*func(*libc.TLS, uintptr, Size_t, int32, int32, int32, Off_t) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aSyscall)) + 22*12 + 4)))(tls, uintptr(0), uint32(nNew), flags, MAP_SHARED, h, int64(0))
}
- if pNew == (libc.UintptrFromInt32(-1)) {
+ if pNew == libc.UintptrFromInt32(-1) {
pNew = uintptr(0)
nNew = int64(0)
- unixLogErrorAtLine(tls, SQLITE_OK, zErr, (*UnixFile)(unsafe.Pointer(pFd)).FzPath, 39255)
+ unixLogErrorAtLine(tls, SQLITE_OK, zErr, (*UnixFile)(unsafe.Pointer(pFd)).FzPath, 39438)
// If the mmap() above failed, assume that all subsequent mmap() calls
// will probably fail too. Fall back to using xRead/xWrite exclusively
@@ -25633,7 +26203,7 @@ func unixRemapfile(tls *libc.TLS, pFd uintptr, nNew I64) { /* sqlite3.c:39190:13
(*UnixFile)(unsafe.Pointer(pFd)).FmmapSizeMax = int64(0)
}
(*UnixFile)(unsafe.Pointer(pFd)).FpMapRegion = pNew
- (*UnixFile)(unsafe.Pointer(pFd)).FmmapSize = libc.AssignPtrInt64(pFd+56 /* &.mmapSizeActual */, nNew)
+ (*UnixFile)(unsafe.Pointer(pFd)).FmmapSize = libc.AssignPtrInt64(pFd+56, nNew)
}
// Memory map or remap the file opened by file-descriptor pFd (if the file
@@ -25650,7 +26220,7 @@ func unixRemapfile(tls *libc.TLS, pFd uintptr, nNew I64) { /* sqlite3.c:39190:13
// SQLITE_OK is returned if no error occurs (even if the mapping is not
// recreated as a result of outstanding references) or an SQLite error
// code otherwise.
-func unixMapfile(tls *libc.TLS, pFd uintptr, nMap I64) int32 { /* sqlite3.c:39282:12: */
+func unixMapfile(tls *libc.TLS, pFd uintptr, nMap I64) int32 { /* sqlite3.c:39465:12: */
bp := tls.Alloc(104)
defer tls.Free(104)
@@ -25661,8 +26231,8 @@ func unixMapfile(tls *libc.TLS, pFd uintptr, nMap I64) int32 { /* sqlite3.c:3928
if nMap < int64(0) {
// var statbuf stat at bp, 104
// Low-level file information
- if (*(*func(*libc.TLS, int32, uintptr) int32)(unsafe.Pointer((uintptr(unsafe.Pointer(&aSyscall)) + 5*12 + 4 /* &.pCurrent */))))(tls, (*UnixFile)(unsafe.Pointer(pFd)).Fh, bp /* &statbuf */) != 0 {
- return (SQLITE_IOERR | (int32(7) << 8))
+ if (*(*func(*libc.TLS, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aSyscall)) + 5*12 + 4)))(tls, (*UnixFile)(unsafe.Pointer(pFd)).Fh, bp) != 0 {
+ return SQLITE_IOERR | int32(7)<<8
}
nMap = (*stat)(unsafe.Pointer(bp /* &statbuf */)).Fst_size
}
@@ -25687,7 +26257,7 @@ func unixMapfile(tls *libc.TLS, pFd uintptr, nMap I64) int32 { /* sqlite3.c:3928
//
// If this function does return a pointer, the caller must eventually
// release the reference by calling unixUnfetch().
-func unixFetch(tls *libc.TLS, fd uintptr, iOff I64, nAmt int32, pp uintptr) int32 { /* sqlite3.c:39319:12: */
+func unixFetch(tls *libc.TLS, fd uintptr, iOff I64, nAmt int32, pp uintptr) int32 { /* sqlite3.c:39502:12: */
var pFd uintptr = fd // The underlying database file
*(*uintptr)(unsafe.Pointer(pp)) = uintptr(0)
@@ -25698,8 +26268,8 @@ func unixFetch(tls *libc.TLS, fd uintptr, iOff I64, nAmt int32, pp uintptr) int3
return rc
}
}
- if (*UnixFile)(unsafe.Pointer(pFd)).FmmapSize >= (iOff + I64(nAmt)) {
- *(*uintptr)(unsafe.Pointer(pp)) = (((*UnixFile)(unsafe.Pointer(pFd)).FpMapRegion) + uintptr(iOff))
+ if (*UnixFile)(unsafe.Pointer(pFd)).FmmapSize >= iOff+I64(nAmt) {
+ *(*uintptr)(unsafe.Pointer(pp)) = (*UnixFile)(unsafe.Pointer(pFd)).FpMapRegion + uintptr(iOff)
(*UnixFile)(unsafe.Pointer(pFd)).FnFetchOut++
}
}
@@ -25714,7 +26284,7 @@ func unixFetch(tls *libc.TLS, fd uintptr, iOff I64, nAmt int32, pp uintptr) int3
// Or, if the third argument is NULL, then this function is being called
// to inform the VFS layer that, according to POSIX, any existing mapping
// may now be invalid and should be unmapped.
-func unixUnfetch(tls *libc.TLS, fd uintptr, iOff I64, p uintptr) int32 { /* sqlite3.c:39350:12: */
+func unixUnfetch(tls *libc.TLS, fd uintptr, iOff I64, p uintptr) int32 { /* sqlite3.c:39533:12: */
var pFd uintptr = fd // The underlying database file
_ = iOff
@@ -25775,33 +26345,33 @@ func unixUnfetch(tls *libc.TLS, fd uintptr, iOff I64, p uintptr) int32 { /* sqli
// Here are all of the sqlite3_io_methods objects for each of the
// locking strategies. Functions that return pointers to these methods
// are also created.
-var posixIoMethods = Sqlite3_io_methods{FiVersion: 3 /* iVersion */, FxClose: 0 /* xClose */, FxRead: 0 /* xRead */, FxWrite: 0 /* xWrite */, FxTruncate: 0 /* xTruncate */, FxSync: 0 /* xSync */, FxFileSize: 0 /* xFileSize */, FxLock: 0 /* xLock */, FxUnlock: 0 /* xUnlock */, FxCheckReservedLock: 0 /* xCheckReservedLock */, FxFileControl: 0 /* xFileControl */, FxSectorSize: 0 /* xSectorSize */, FxDeviceCharacteristics: 0 /* xDeviceCapabilities */, FxShmMap: 0 /* xShmMap */, FxShmLock: 0 /* xShmLock */, FxShmBarrier: 0 /* xShmBarrier */, FxShmUnmap: 0 /* xShmUnmap */, FxFetch: 0 /* xFetch */, FxUnfetch: 0 /* xUnfetch */} /* sqlite3.c:39452:1 */
+var posixIoMethods = Sqlite3_io_methods{FiVersion: 3 /* iVersion */, FxClose: 0 /* xClose */, FxRead: 0 /* xRead */, FxWrite: 0 /* xWrite */, FxTruncate: 0 /* xTruncate */, FxSync: 0 /* xSync */, FxFileSize: 0 /* xFileSize */, FxLock: 0 /* xLock */, FxUnlock: 0 /* xUnlock */, FxCheckReservedLock: 0 /* xCheckReservedLock */, FxFileControl: 0 /* xFileControl */, FxSectorSize: 0 /* xSectorSize */, FxDeviceCharacteristics: 0 /* xDeviceCapabilities */, FxShmMap: 0 /* xShmMap */, FxShmLock: 0 /* xShmLock */, FxShmBarrier: 0 /* xShmBarrier */, FxShmUnmap: 0 /* xShmUnmap */, FxFetch: 0 /* xFetch */, FxUnfetch: 0 /* xUnfetch */} /* sqlite3.c:39635:1 */
-func posixIoFinderImpl(tls *libc.TLS, z uintptr, p uintptr) uintptr { /* sqlite3.c:39452:1: */
+func posixIoFinderImpl(tls *libc.TLS, z uintptr, p uintptr) uintptr { /* sqlite3.c:39635:1: */
_ = z
_ = p
return uintptr(unsafe.Pointer(&posixIoMethods))
}
-var posixIoFinder uintptr = 0 /* sqlite3.c:39452:1 */
-var nolockIoMethods = Sqlite3_io_methods{FiVersion: 3 /* iVersion */, FxClose: 0 /* xClose */, FxRead: 0 /* xRead */, FxWrite: 0 /* xWrite */, FxTruncate: 0 /* xTruncate */, FxSync: 0 /* xSync */, FxFileSize: 0 /* xFileSize */, FxLock: 0 /* xLock */, FxUnlock: 0 /* xUnlock */, FxCheckReservedLock: 0 /* xCheckReservedLock */, FxFileControl: 0 /* xFileControl */, FxSectorSize: 0 /* xSectorSize */, FxDeviceCharacteristics: 0 /* xShmMap */, FxShmLock: 0 /* xShmLock */, FxShmBarrier: 0 /* xShmBarrier */, FxShmUnmap: 0 /* xShmUnmap */, FxFetch: 0 /* xFetch */, FxUnfetch: 0 /* xUnfetch */} /* sqlite3.c:39462:1 */
+var posixIoFinder uintptr = 0 /* sqlite3.c:39635:1 */
+var nolockIoMethods = Sqlite3_io_methods{FiVersion: 3 /* iVersion */, FxClose: 0 /* xClose */, FxRead: 0 /* xRead */, FxWrite: 0 /* xWrite */, FxTruncate: 0 /* xTruncate */, FxSync: 0 /* xSync */, FxFileSize: 0 /* xFileSize */, FxLock: 0 /* xLock */, FxUnlock: 0 /* xUnlock */, FxCheckReservedLock: 0 /* xCheckReservedLock */, FxFileControl: 0 /* xFileControl */, FxSectorSize: 0 /* xSectorSize */, FxDeviceCharacteristics: 0 /* xShmMap */, FxShmLock: 0 /* xShmLock */, FxShmBarrier: 0 /* xShmBarrier */, FxShmUnmap: 0 /* xShmUnmap */, FxFetch: 0 /* xFetch */, FxUnfetch: 0 /* xUnfetch */} /* sqlite3.c:39645:1 */
-func nolockIoFinderImpl(tls *libc.TLS, z uintptr, p uintptr) uintptr { /* sqlite3.c:39462:1: */
+func nolockIoFinderImpl(tls *libc.TLS, z uintptr, p uintptr) uintptr { /* sqlite3.c:39645:1: */
_ = z
_ = p
return uintptr(unsafe.Pointer(&nolockIoMethods))
}
-var nolockIoFinder uintptr = 0 /* sqlite3.c:39462:1 */
-var dotlockIoMethods = Sqlite3_io_methods{FiVersion: 1 /* iVersion */, FxClose: 0 /* xClose */, FxRead: 0 /* xRead */, FxWrite: 0 /* xWrite */, FxTruncate: 0 /* xTruncate */, FxSync: 0 /* xSync */, FxFileSize: 0 /* xFileSize */, FxLock: 0 /* xLock */, FxUnlock: 0 /* xUnlock */, FxCheckReservedLock: 0 /* xCheckReservedLock */, FxFileControl: 0 /* xFileControl */, FxSectorSize: 0 /* xSectorSize */, FxDeviceCharacteristics: 0 /* xShmMap */, FxShmLock: 0 /* xShmLock */, FxShmBarrier: 0 /* xShmBarrier */, FxShmUnmap: 0 /* xShmUnmap */, FxFetch: 0 /* xFetch */, FxUnfetch: 0 /* xUnfetch */} /* sqlite3.c:39472:1 */
+var nolockIoFinder uintptr = 0 /* sqlite3.c:39645:1 */
+var dotlockIoMethods = Sqlite3_io_methods{FiVersion: 1 /* iVersion */, FxClose: 0 /* xClose */, FxRead: 0 /* xRead */, FxWrite: 0 /* xWrite */, FxTruncate: 0 /* xTruncate */, FxSync: 0 /* xSync */, FxFileSize: 0 /* xFileSize */, FxLock: 0 /* xLock */, FxUnlock: 0 /* xUnlock */, FxCheckReservedLock: 0 /* xCheckReservedLock */, FxFileControl: 0 /* xFileControl */, FxSectorSize: 0 /* xSectorSize */, FxDeviceCharacteristics: 0 /* xShmMap */, FxShmLock: 0 /* xShmLock */, FxShmBarrier: 0 /* xShmBarrier */, FxShmUnmap: 0 /* xShmUnmap */, FxFetch: 0 /* xFetch */, FxUnfetch: 0 /* xUnfetch */} /* sqlite3.c:39655:1 */
-func dotlockIoFinderImpl(tls *libc.TLS, z uintptr, p uintptr) uintptr { /* sqlite3.c:39472:1: */
+func dotlockIoFinderImpl(tls *libc.TLS, z uintptr, p uintptr) uintptr { /* sqlite3.c:39655:1: */
_ = z
_ = p
return uintptr(unsafe.Pointer(&dotlockIoMethods))
}
-var dotlockIoFinder uintptr = 0 /* sqlite3.c:39472:1 */
+var dotlockIoFinder uintptr = 0 /* sqlite3.c:39655:1 */
// The proxy locking method is a "super-method" in the sense that it
// opens secondary file descriptors for the conch and lock files and
@@ -25814,7 +26384,7 @@ var dotlockIoFinder uintptr = 0 /* sqlite3.c:39472:1 */
// nfs lockd on OSX 10.3+ doesn't clear write locks when a read lock is set
// An abstract type for a pointer to an IO method finder function:
-type Finder_type = uintptr /* sqlite3.c:39667:34 */
+type Finder_type = uintptr /* sqlite3.c:39850:34 */
// ***************************************************************************
//
@@ -25824,7 +26394,7 @@ type Finder_type = uintptr /* sqlite3.c:39667:34 */
// sqlite3_vfs object.
// Initialize the contents of the unixFile structure pointed to by pId.
-func fillInUnixFile(tls *libc.TLS, pVfs uintptr, h int32, pId uintptr, zFilename uintptr, ctrlFlags int32) int32 { /* sqlite3.c:39680:12: */
+func fillInUnixFile(tls *libc.TLS, pVfs uintptr, h int32, pId uintptr, zFilename uintptr, ctrlFlags int32) int32 { /* sqlite3.c:39863:12: */
bp := tls.Alloc(8)
defer tls.Free(8)
@@ -25840,19 +26410,19 @@ func fillInUnixFile(tls *libc.TLS, pVfs uintptr, h int32, pId uintptr, zFilename
(*UnixFile)(unsafe.Pointer(pNew)).FctrlFlags = uint16(U8(ctrlFlags))
(*UnixFile)(unsafe.Pointer(pNew)).FmmapSizeMax = Xsqlite3Config.FszMmap
if Xsqlite3_uri_boolean(tls, func() uintptr {
- if (ctrlFlags & UNIXFILE_URI) != 0 {
+ if ctrlFlags&UNIXFILE_URI != 0 {
return zFilename
}
return uintptr(0)
}(),
- ts+2824 /* "psow" */, SQLITE_POWERSAFE_OVERWRITE) != 0 {
- *(*uint16)(unsafe.Pointer(pNew + 18 /* &.ctrlFlags */)) |= uint16((UNIXFILE_PSOW))
+ ts+3635, SQLITE_POWERSAFE_OVERWRITE) != 0 {
+ *(*uint16)(unsafe.Pointer(pNew + 18)) |= uint16(UNIXFILE_PSOW)
}
- if libc.Xstrcmp(tls, (*Sqlite3_vfs)(unsafe.Pointer(pVfs)).FzName, ts+2829 /* "unix-excl" */) == 0 {
- *(*uint16)(unsafe.Pointer(pNew + 18 /* &.ctrlFlags */)) |= uint16((UNIXFILE_EXCL))
+ if libc.Xstrcmp(tls, (*Sqlite3_vfs)(unsafe.Pointer(pVfs)).FzName, ts+3640) == 0 {
+ *(*uint16)(unsafe.Pointer(pNew + 18)) |= uint16(UNIXFILE_EXCL)
}
- if (ctrlFlags & UNIXFILE_NOLOCK) != 0 {
+ if ctrlFlags&UNIXFILE_NOLOCK != 0 {
pLockingStyle = uintptr(unsafe.Pointer(&nolockIoMethods))
} else {
pLockingStyle = (*(**struct {
@@ -25862,7 +26432,7 @@ func fillInUnixFile(tls *libc.TLS, pVfs uintptr, h int32, pId uintptr, zFilename
if pLockingStyle == uintptr(unsafe.Pointer(&posixIoMethods)) {
unixEnterMutex(tls)
- rc = findInodeInfo(tls, pNew, (pNew + 8 /* &.pInode */))
+ rc = findInodeInfo(tls, pNew, pNew+8)
if rc != SQLITE_OK {
// If an error occurred in findInodeInfo(), close the file descriptor
// immediately, before releasing the mutex. findInodeInfo() may fail
@@ -25881,7 +26451,7 @@ func fillInUnixFile(tls *libc.TLS, pVfs uintptr, h int32, pId uintptr, zFilename
// If scenario (a) caused the error then things are not so safe. The
// implicit assumption here is that if fstat() fails, things are in
// such bad shape that dropping a lock or two doesn't matter much.
- robust_close(tls, pNew, h, 39758)
+ robust_close(tls, pNew, h, 39941)
h = -1
}
unixLeaveMutex(tls)
@@ -25891,12 +26461,12 @@ func fillInUnixFile(tls *libc.TLS, pVfs uintptr, h int32, pId uintptr, zFilename
var zLockFile uintptr
var nFilename int32
- nFilename = (int32(libc.Xstrlen(tls, zFilename)) + 6)
+ nFilename = int32(libc.Xstrlen(tls, zFilename)) + 6
zLockFile = Xsqlite3_malloc64(tls, uint64(nFilename))
if zLockFile == uintptr(0) {
rc = SQLITE_NOMEM
} else {
- Xsqlite3_snprintf(tls, nFilename, zLockFile, ts+2839 /* "%s.lock" */, libc.VaList(bp, zFilename))
+ Xsqlite3_snprintf(tls, nFilename, zLockFile, ts+3650 /* "%s.lock" */, libc.VaList(bp, zFilename))
}
(*UnixFile)(unsafe.Pointer(pNew)).FlockingContext = zLockFile
}
@@ -25904,7 +26474,7 @@ func fillInUnixFile(tls *libc.TLS, pVfs uintptr, h int32, pId uintptr, zFilename
storeLastErrno(tls, pNew, 0)
if rc != SQLITE_OK {
if h >= 0 {
- robust_close(tls, pNew, h, 39843)
+ robust_close(tls, pNew, h, 40026)
}
} else {
(*Sqlite3_file)(unsafe.Pointer(pId)).FpMethods = pLockingStyle
@@ -25914,9 +26484,25 @@ func fillInUnixFile(tls *libc.TLS, pVfs uintptr, h int32, pId uintptr, zFilename
return rc
}
+// Directories to consider for temp files.
+var azTempDirs = [6]uintptr{
+ uintptr(0),
+ uintptr(0),
+ ts + 3658, /* "/var/tmp" */
+ ts + 3667, /* "/usr/tmp" */
+ ts + 3676, /* "/tmp" */
+ ts + 1556, /* "." */
+} /* sqlite3.c:40038:19 */
+
+// Initialize first two members of azTempDirs[] array.
+func unixTempFileInit(tls *libc.TLS) { /* sqlite3.c:40050:13: */
+ azTempDirs[0] = libc.Xgetenv(tls, ts+3681 /* "SQLITE_TMPDIR" */)
+ azTempDirs[1] = libc.Xgetenv(tls, ts+3695 /* "TMPDIR" */)
+}
+
// Return the name of a directory in which to put temporary files.
// If no suitable temporary file directory can be found, return NULL.
-func unixTempFileDir(tls *libc.TLS) uintptr { /* sqlite3.c:39856:19: */
+func unixTempFileDir(tls *libc.TLS) uintptr { /* sqlite3.c:40059:19: */
bp := tls.Alloc(104)
defer tls.Free(104)
@@ -25925,40 +26511,25 @@ func unixTempFileDir(tls *libc.TLS) uintptr { /* sqlite3.c:39856:19: */
var zDir uintptr = Xsqlite3_temp_directory
- if !(int32(azDirs[0]) != 0) {
- azDirs[0] = libc.Xgetenv(tls, ts+2847 /* "SQLITE_TMPDIR" */)
- }
- if !(int32(azDirs[1]) != 0) {
- azDirs[1] = libc.Xgetenv(tls, ts+2861 /* "TMPDIR" */)
- }
for 1 != 0 {
- if (((zDir != uintptr(0)) &&
- ((*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer((uintptr(unsafe.Pointer(&aSyscall)) + 4*12 + 4 /* &.pCurrent */))))(tls, zDir, bp /* &buf */) == 0)) &&
- ((((*stat)(unsafe.Pointer(bp /* &buf */)).Fst_mode) & X__mode_t(0170000)) == (X__mode_t(0040000)))) &&
- ((*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer((uintptr(unsafe.Pointer(&aSyscall)) + 2*12 + 4 /* &.pCurrent */))))(tls, zDir, 03) == 0) {
+ if zDir != uintptr(0) &&
+ (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aSyscall)) + 4*12 + 4)))(tls, zDir, bp) == 0 &&
+ (*stat)(unsafe.Pointer(bp)).Fst_mode&X__mode_t(0170000) == X__mode_t(0040000) &&
+ (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aSyscall)) + 2*12 + 4)))(tls, zDir, 03) == 0 {
return zDir
}
- if i >= (uint32(unsafe.Sizeof(azDirs)) / uint32(unsafe.Sizeof(uintptr(0)))) {
+ if i >= uint32(unsafe.Sizeof(azTempDirs))/uint32(unsafe.Sizeof(uintptr(0))) {
break
}
- zDir = azDirs[libc.PostIncUint32(&i, 1)]
+ zDir = azTempDirs[libc.PostIncUint32(&i, 1)]
}
return uintptr(0)
}
-var azDirs = [6]uintptr{
- uintptr(0),
- uintptr(0),
- ts + 2868, /* "/var/tmp" */
- ts + 2877, /* "/usr/tmp" */
- ts + 2886, /* "/tmp" */
- ts + 768, /* "." */
-} /* sqlite3.c:39857:21 */
-
// Create a temporary file name in zBuf. zBuf must be allocated
// by the calling process and must be big enough to hold at least
// pVfs->mxPathname bytes.
-func unixGetTempname(tls *libc.TLS, nBuf int32, zBuf uintptr) int32 { /* sqlite3.c:39890:12: */
+func unixGetTempname(tls *libc.TLS, nBuf int32, zBuf uintptr) int32 { /* sqlite3.c:40083:12: */
bp := tls.Alloc(32)
defer tls.Free(32)
@@ -25972,17 +26543,16 @@ func unixGetTempname(tls *libc.TLS, nBuf int32, zBuf uintptr) int32 { /* sqlite3
zDir = unixTempFileDir(tls)
if zDir == uintptr(0) {
- return (SQLITE_IOERR | (int32(25) << 8))
+ return SQLITE_IOERR | int32(25)<<8
}
- for ok := true; ok; ok = ((*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer((uintptr(unsafe.Pointer(&aSyscall)) + 2*12 + 4 /* &.pCurrent */))))(tls, zBuf, 0) == 0) {
- // var r U64 at bp+24, 8
+ for ok := true; ok; ok = (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aSyscall)) + 2*12 + 4)))(tls, zBuf, 0) == 0 {
Xsqlite3_randomness(tls, int32(unsafe.Sizeof(U64(0))), bp+24 /* &r */)
- *(*uint8)(unsafe.Pointer(zBuf + uintptr((nBuf - 2)))) = uint8(0)
- Xsqlite3_snprintf(tls, nBuf, zBuf, ts+2891, /* "%s/etilqs_%llx%c" */
+ *(*uint8)(unsafe.Pointer(zBuf + uintptr(nBuf-2))) = uint8(0)
+ Xsqlite3_snprintf(tls, nBuf, zBuf, ts+3702, /* "%s/etilqs_%llx%c" */
libc.VaList(bp, zDir, *(*U64)(unsafe.Pointer(bp + 24 /* r */)), 0))
- if (int32(*(*uint8)(unsafe.Pointer(zBuf + uintptr((nBuf - 2))))) != 0) || ((libc.PostIncInt32(&iLimit, 1)) > 10) {
+ if int32(*(*uint8)(unsafe.Pointer(zBuf + uintptr(nBuf-2)))) != 0 || libc.PostIncInt32(&iLimit, 1) > 10 {
return SQLITE_ERROR
}
}
@@ -26003,7 +26573,7 @@ func unixGetTempname(tls *libc.TLS, nBuf int32, zBuf uintptr) int32 { /* sqlite3
//
// If a suitable file descriptor is found, then it is returned. If no
// such file descriptor is located, -1 is returned.
-func findReusableFd(tls *libc.TLS, zPath uintptr, flags int32) uintptr { /* sqlite3.c:39940:21: */
+func findReusableFd(tls *libc.TLS, zPath uintptr, flags int32) uintptr { /* sqlite3.c:40133:21: */
bp := tls.Alloc(104)
defer tls.Free(104)
@@ -26027,12 +26597,12 @@ func findReusableFd(tls *libc.TLS, zPath uintptr, flags int32) uintptr { /* sqli
//
// Even if a subsequent open() call does succeed, the consequences of
// not searching for a reusable file descriptor are not dire.
- if (inodeList != uintptr(0)) && (0 == (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer((uintptr(unsafe.Pointer(&aSyscall)) + 4*12 + 4 /* &.pCurrent */))))(tls, zPath, bp /* &sStat */)) {
+ if inodeList != uintptr(0) && 0 == (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aSyscall)) + 4*12 + 4)))(tls, zPath, bp) {
var pInode uintptr
pInode = inodeList
- for (pInode != 0) && (((*UnixInodeInfo)(unsafe.Pointer(pInode)).FfileId.Fdev != (*stat)(unsafe.Pointer(bp /* &sStat */)).Fst_dev) ||
- ((*UnixInodeInfo)(unsafe.Pointer(pInode)).FfileId.Fino != (*stat)(unsafe.Pointer(bp /* &sStat */)).Fst_ino)) {
+ for pInode != 0 && ((*UnixInodeInfo)(unsafe.Pointer(pInode)).FfileId.Fdev != (*stat)(unsafe.Pointer(bp)).Fst_dev ||
+ (*UnixInodeInfo)(unsafe.Pointer(pInode)).FfileId.Fino != (*stat)(unsafe.Pointer(bp)).Fst_ino) {
pInode = (*UnixInodeInfo)(unsafe.Pointer(pInode)).FpNext
}
if pInode != 0 {
@@ -26040,7 +26610,7 @@ func findReusableFd(tls *libc.TLS, zPath uintptr, flags int32) uintptr { /* sqli
Xsqlite3_mutex_enter(tls, (*UnixInodeInfo)(unsafe.Pointer(pInode)).FpLockMutex)
flags = flags & (SQLITE_OPEN_READONLY | SQLITE_OPEN_READWRITE)
- for pp = (pInode + 32 /* &.pUnused */); (*(*uintptr)(unsafe.Pointer(pp)) != 0) && ((*UnixUnusedFd)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(pp))))).Fflags != flags); pp = (*(*uintptr)(unsafe.Pointer(pp)) + 8 /* &.pNext */) {
+ for pp = pInode + 32; *(*uintptr)(unsafe.Pointer(pp)) != 0 && (*UnixUnusedFd)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pp)))).Fflags != flags; pp = *(*uintptr)(unsafe.Pointer(pp)) + 8 {
}
pUnused = *(*uintptr)(unsafe.Pointer(pp))
if pUnused != 0 {
@@ -26054,19 +26624,19 @@ func findReusableFd(tls *libc.TLS, zPath uintptr, flags int32) uintptr { /* sqli
}
// Find the mode, uid and gid of file zFile.
-func getFileMode(tls *libc.TLS, zFile uintptr, pMode uintptr, pUid uintptr, pGid uintptr) int32 { /* sqlite3.c:39990:12: */
+func getFileMode(tls *libc.TLS, zFile uintptr, pMode uintptr, pUid uintptr, pGid uintptr) int32 { /* sqlite3.c:40183:12: */
bp := tls.Alloc(104)
defer tls.Free(104)
// var sStat stat at bp, 104
// Output of stat() on database file
var rc int32 = SQLITE_OK
- if 0 == (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer((uintptr(unsafe.Pointer(&aSyscall)) + 4*12 + 4 /* &.pCurrent */))))(tls, zFile, bp /* &sStat */) {
- *(*Mode_t)(unsafe.Pointer(pMode)) = ((*stat)(unsafe.Pointer(bp /* &sStat */)).Fst_mode & X__mode_t(0777))
+ if 0 == (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aSyscall)) + 4*12 + 4)))(tls, zFile, bp) {
+ *(*Mode_t)(unsafe.Pointer(pMode)) = (*stat)(unsafe.Pointer(bp)).Fst_mode & X__mode_t(0777)
*(*Uid_t)(unsafe.Pointer(pUid)) = (*stat)(unsafe.Pointer(bp /* &sStat */)).Fst_uid
*(*Gid_t)(unsafe.Pointer(pGid)) = (*stat)(unsafe.Pointer(bp /* &sStat */)).Fst_gid
} else {
- rc = (SQLITE_IOERR | (int32(7) << 8))
+ rc = SQLITE_IOERR | int32(7)<<8
}
return rc
}
@@ -26090,7 +26660,7 @@ func getFileMode(tls *libc.TLS, zFile uintptr, pMode uintptr, pUid uintptr, pGid
// original filename is unavailable. But 8_3_NAMES is only used for
// FAT filesystems and permissions do not matter there, so just use
// the default permissions. In 8_3_NAMES mode, leave *pMode set to zero.
-func findCreateFileMode(tls *libc.TLS, zPath uintptr, flags int32, pMode uintptr, pUid uintptr, pGid uintptr) int32 { /* sqlite3.c:40029:12: */
+func findCreateFileMode(tls *libc.TLS, zPath uintptr, flags int32, pMode uintptr, pUid uintptr, pGid uintptr) int32 { /* sqlite3.c:40222:12: */
bp := tls.Alloc(513)
defer tls.Free(513)
@@ -26098,7 +26668,7 @@ func findCreateFileMode(tls *libc.TLS, zPath uintptr, flags int32, pMode uintptr
*(*Mode_t)(unsafe.Pointer(pMode)) = Mode_t(0)
*(*Uid_t)(unsafe.Pointer(pUid)) = Uid_t(0)
*(*Gid_t)(unsafe.Pointer(pGid)) = Gid_t(0)
- if (flags & (SQLITE_OPEN_WAL | SQLITE_OPEN_MAIN_JOURNAL)) != 0 {
+ if flags&(SQLITE_OPEN_WAL|SQLITE_OPEN_MAIN_JOURNAL) != 0 {
// var zDb [513]uint8 at bp, 513
// Database file path
var nDb int32 // Number of valid bytes in zDb
@@ -26114,13 +26684,13 @@ func findCreateFileMode(tls *libc.TLS, zPath uintptr, flags int32, pMode uintptr
//
// where NN is a decimal number. The NN naming schemes are
// used by the test_multiplex.c module.
- nDb = (Xsqlite3Strlen30(tls, zPath) - 1)
+ nDb = Xsqlite3Strlen30(tls, zPath) - 1
for int32(*(*uint8)(unsafe.Pointer(zPath + uintptr(nDb)))) != '-' {
// In normal operation, the journal file name will always contain
// a '-' character. However in 8+3 filename mode, or if a corrupt
// rollback journal specifies a super-journal with a goofy name, then
// the '-' might be missing.
- if (nDb == 0) || (int32(*(*uint8)(unsafe.Pointer(zPath + uintptr(nDb)))) == '.') {
+ if nDb == 0 || int32(*(*uint8)(unsafe.Pointer(zPath + uintptr(nDb)))) == '.' {
return SQLITE_OK
}
nDb--
@@ -26129,14 +26699,14 @@ func findCreateFileMode(tls *libc.TLS, zPath uintptr, flags int32, pMode uintptr
*(*uint8)(unsafe.Pointer(bp /* &zDb[0] */ + uintptr(nDb))) = uint8(0)
rc = getFileMode(tls, bp /* &zDb[0] */, pMode, pUid, pGid)
- } else if (flags & SQLITE_OPEN_DELETEONCLOSE) != 0 {
+ } else if flags&SQLITE_OPEN_DELETEONCLOSE != 0 {
*(*Mode_t)(unsafe.Pointer(pMode)) = Mode_t(0600)
- } else if (flags & SQLITE_OPEN_URI) != 0 {
+ } else if flags&SQLITE_OPEN_URI != 0 {
// If this is a main database file and the file was opened using a URI
// filename, check for the "modeof" parameter. If present, interpret
// its value as a filename and try to copy the mode, uid and gid from
// that file.
- var z uintptr = Xsqlite3_uri_parameter(tls, zPath, ts+2908 /* "modeof" */)
+ var z uintptr = Xsqlite3_uri_parameter(tls, zPath, ts+3719 /* "modeof" */)
if z != 0 {
rc = getFileMode(tls, z, pMode, pUid, pGid)
}
@@ -26164,7 +26734,7 @@ func findCreateFileMode(tls *libc.TLS, zPath uintptr, flags int32, pMode uintptr
// file handle closed. To achieve the same effect using this new
// interface, add the DELETEONCLOSE flag to those specified above for
// OpenExclusive().
-func unixOpen(tls *libc.TLS, pVfs uintptr, zPath uintptr, pFile uintptr, flags int32, pOutFlags uintptr) int32 { /* sqlite3.c:40106:12: */
+func unixOpen(tls *libc.TLS, pVfs uintptr, zPath uintptr, pFile uintptr, flags int32, pOutFlags uintptr) int32 { /* sqlite3.c:40299:12: */
bp := tls.Alloc(528)
defer tls.Free(528)
@@ -26202,17 +26772,17 @@ func unixOpen(tls *libc.TLS, pVfs uintptr, zPath uintptr, pFile uintptr, flags i
p = pFile
fd = -1
openFlags = 0
- eType = (flags & 0x0FFF00)
+ eType = flags & 0x0FFF00
rc = SQLITE_OK
ctrlFlags = 0
- isExclusive = (flags & SQLITE_OPEN_EXCLUSIVE)
- isDelete = (flags & SQLITE_OPEN_DELETEONCLOSE)
- isCreate = (flags & SQLITE_OPEN_CREATE)
- isReadonly = (flags & SQLITE_OPEN_READONLY)
- isReadWrite = (flags & SQLITE_OPEN_READWRITE)
- isNewJrnl = (libc.Bool32((isCreate != 0) && (((eType == SQLITE_OPEN_SUPER_JOURNAL) ||
- (eType == SQLITE_OPEN_MAIN_JOURNAL)) ||
- (eType == SQLITE_OPEN_WAL))))
+ isExclusive = flags & SQLITE_OPEN_EXCLUSIVE
+ isDelete = flags & SQLITE_OPEN_DELETEONCLOSE
+ isCreate = flags & SQLITE_OPEN_CREATE
+ isReadonly = flags & SQLITE_OPEN_READONLY
+ isReadWrite = flags & SQLITE_OPEN_READWRITE
+ isNewJrnl = libc.Bool32(isCreate != 0 && (eType == SQLITE_OPEN_SUPER_JOURNAL ||
+ eType == SQLITE_OPEN_MAIN_JOURNAL ||
+ eType == SQLITE_OPEN_WAL))
zName = zPath
// Check the following statements are true:
@@ -26251,7 +26821,7 @@ __1:
goto __5
__4:
pUnused = Xsqlite3_malloc64(tls, uint64(unsafe.Sizeof(UnixUnusedFd{})))
- if !(!(pUnused != 0)) {
+ if !!(pUnused != 0) {
goto __6
}
return SQLITE_NOMEM
@@ -26267,7 +26837,7 @@ __5:
goto __3
__2:
- if !(!(zName != 0)) {
+ if !!(zName != 0) {
goto __7
}
// If zName is NULL, the upper layer is requesting a temp file.
@@ -26296,19 +26866,19 @@ __3:
if !(isReadonly != 0) {
goto __9
}
- openFlags = openFlags | (O_RDONLY)
+ openFlags = openFlags | O_RDONLY
__9:
;
if !(isReadWrite != 0) {
goto __10
}
- openFlags = openFlags | (O_RDWR)
+ openFlags = openFlags | O_RDWR
__10:
;
if !(isCreate != 0) {
goto __11
}
- openFlags = openFlags | (O_CREAT)
+ openFlags = openFlags | O_CREAT
__11:
;
if !(isExclusive != 0) {
@@ -26317,7 +26887,7 @@ __11:
openFlags = openFlags | (O_EXCL | 0100000)
__12:
;
- openFlags = openFlags | ((0400000 | O_BINARY) | 0100000)
+ openFlags = openFlags | (0400000 | O_BINARY | 0100000)
if !(fd < 0) {
goto __13
@@ -26335,22 +26905,22 @@ __14:
if !(fd < 0) {
goto __15
}
- if !(((isNewJrnl != 0) && ((*(*int32)(unsafe.Pointer(libc.X__errno_location(tls)))) == EACCES)) && ((*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer((uintptr(unsafe.Pointer(&aSyscall)) + 2*12 + 4 /* &.pCurrent */))))(tls, zName, F_OK) != 0)) {
+ if !(isNewJrnl != 0 && *(*int32)(unsafe.Pointer(libc.X__errno_location(tls))) == EACCES && (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aSyscall)) + 2*12 + 4)))(tls, zName, F_OK) != 0) {
goto __16
}
// If unable to create a journal because the directory is not
// writable, change the error code to indicate that.
- rc = (SQLITE_READONLY | (int32(6) << 8))
+ rc = SQLITE_READONLY | int32(6)<<8
goto __17
__16:
- if !(((*(*int32)(unsafe.Pointer(libc.X__errno_location(tls)))) != EISDIR) && (isReadWrite != 0)) {
+ if !(*(*int32)(unsafe.Pointer(libc.X__errno_location(tls))) != EISDIR && isReadWrite != 0) {
goto __18
}
// Failed to open the file for read/write access. Try read-only.
- flags = flags & (libc.CplInt32((SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE)))
- openFlags = openFlags & (libc.CplInt32((O_RDWR | O_CREAT)))
- flags = flags | (SQLITE_OPEN_READONLY)
- openFlags = openFlags | (O_RDONLY)
+ flags = flags & libc.CplInt32(SQLITE_OPEN_READWRITE|SQLITE_OPEN_CREATE)
+ openFlags = openFlags & libc.CplInt32(O_RDWR|O_CREAT)
+ flags = flags | SQLITE_OPEN_READONLY
+ openFlags = openFlags | O_RDONLY
isReadonly = 1
fd = robust_open(tls, zName, openFlags, *(*Mode_t)(unsafe.Pointer(bp + 516 /* openMode */)))
__18:
@@ -26362,7 +26932,7 @@ __15:
if !(fd < 0) {
goto __19
}
- rc2 = unixLogErrorAtLine(tls, Xsqlite3CantopenError(tls, 40257), ts+2388 /* "open" */, zName, 40257)
+ rc2 = unixLogErrorAtLine(tls, Xsqlite3CantopenError(tls, 40455), ts+3199 /* "open" */, zName, 40455)
if !(rc == SQLITE_OK) {
goto __20
}
@@ -26384,7 +26954,7 @@ __19:
// If openMode==0, then that means uid and gid are not set correctly
// (probably because SQLite is configured to use 8+3 filename mode) and
// in that case we do not want to attempt the chown().
- if !((*(*Mode_t)(unsafe.Pointer(bp + 516 /* openMode */)) != 0) && ((flags & (SQLITE_OPEN_WAL | SQLITE_OPEN_MAIN_JOURNAL)) != 0)) {
+ if !(*(*Mode_t)(unsafe.Pointer(bp + 516)) != 0 && flags&(SQLITE_OPEN_WAL|SQLITE_OPEN_MAIN_JOURNAL) != 0) {
goto __21
}
robustFchown(tls, fd, *(*Uid_t)(unsafe.Pointer(bp + 520 /* uid */)), *(*Gid_t)(unsafe.Pointer(bp + 524 /* gid */)))
@@ -26404,14 +26974,14 @@ __22:
goto __23
}
(*UnixUnusedFd)(unsafe.Pointer((*UnixFile)(unsafe.Pointer(p)).FpPreallocatedUnused)).Ffd = fd
- (*UnixUnusedFd)(unsafe.Pointer((*UnixFile)(unsafe.Pointer(p)).FpPreallocatedUnused)).Fflags = (flags & (SQLITE_OPEN_READONLY | SQLITE_OPEN_READWRITE))
+ (*UnixUnusedFd)(unsafe.Pointer((*UnixFile)(unsafe.Pointer(p)).FpPreallocatedUnused)).Fflags = flags & (SQLITE_OPEN_READONLY | SQLITE_OPEN_READWRITE)
__23:
;
if !(isDelete != 0) {
goto __24
}
- (*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer((uintptr(unsafe.Pointer(&aSyscall)) + 16*12 + 4 /* &.pCurrent */))))(tls, zName)
+ (*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aSyscall)) + 16*12 + 4)))(tls, zName)
__24:
;
@@ -26419,32 +26989,32 @@ __24:
if !(isDelete != 0) {
goto __25
}
- ctrlFlags = ctrlFlags | (UNIXFILE_DELETE)
+ ctrlFlags = ctrlFlags | UNIXFILE_DELETE
__25:
;
if !(isReadonly != 0) {
goto __26
}
- ctrlFlags = ctrlFlags | (UNIXFILE_RDONLY)
+ ctrlFlags = ctrlFlags | UNIXFILE_RDONLY
__26:
;
- noLock = (libc.Bool32(eType != SQLITE_OPEN_MAIN_DB))
+ noLock = libc.Bool32(eType != SQLITE_OPEN_MAIN_DB)
if !(noLock != 0) {
goto __27
}
- ctrlFlags = ctrlFlags | (UNIXFILE_NOLOCK)
+ ctrlFlags = ctrlFlags | UNIXFILE_NOLOCK
__27:
;
if !(isNewJrnl != 0) {
goto __28
}
- ctrlFlags = ctrlFlags | (UNIXFILE_DIRSYNC)
+ ctrlFlags = ctrlFlags | UNIXFILE_DIRSYNC
__28:
;
- if !((flags & SQLITE_OPEN_URI) != 0) {
+ if !(flags&SQLITE_OPEN_URI != 0) {
goto __29
}
- ctrlFlags = ctrlFlags | (UNIXFILE_URI)
+ ctrlFlags = ctrlFlags | UNIXFILE_URI
__29:
;
@@ -26462,30 +27032,30 @@ __30:
// Delete the file at zPath. If the dirSync argument is true, fsync()
// the directory after deleting the file.
-func unixDelete(tls *libc.TLS, NotUsed uintptr, zPath uintptr, dirSync int32) int32 { /* sqlite3.c:40380:12: */
+func unixDelete(tls *libc.TLS, NotUsed uintptr, zPath uintptr, dirSync int32) int32 { /* sqlite3.c:40578:12: */
bp := tls.Alloc(4)
defer tls.Free(4)
var rc int32 = SQLITE_OK
_ = NotUsed
- if (*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer((uintptr(unsafe.Pointer(&aSyscall)) + 16*12 + 4 /* &.pCurrent */))))(tls, zPath) == (-1) {
- if (*(*int32)(unsafe.Pointer(libc.X__errno_location(tls)))) == ENOENT {
- rc = (SQLITE_IOERR | (int32(23) << 8))
+ if (*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aSyscall)) + 16*12 + 4)))(tls, zPath) == -1 {
+ if *(*int32)(unsafe.Pointer(libc.X__errno_location(tls))) == ENOENT {
+ rc = SQLITE_IOERR | int32(23)<<8
} else {
- rc = unixLogErrorAtLine(tls, (SQLITE_IOERR | (int32(10) << 8)), ts+2498 /* "unlink" */, zPath, 40396)
+ rc = unixLogErrorAtLine(tls, SQLITE_IOERR|int32(10)<<8, ts+3309 /* "unlink" */, zPath, 40594)
}
return rc
}
- if (dirSync & 1) != 0 {
+ if dirSync&1 != 0 {
// var fd int32 at bp, 4
- rc = (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer((uintptr(unsafe.Pointer(&aSyscall)) + 17*12 + 4 /* &.pCurrent */))))(tls, zPath, bp /* &fd */)
+ rc = (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aSyscall)) + 17*12 + 4)))(tls, zPath, bp)
if rc == SQLITE_OK {
- if full_fsync(tls, *(*int32)(unsafe.Pointer(bp /* fd */)), 0, 0) != 0 {
- rc = unixLogErrorAtLine(tls, (SQLITE_IOERR | (int32(5) << 8)), ts+2915 /* "fsync" */, zPath, 40406)
+ if full_fsync(tls, *(*int32)(unsafe.Pointer(bp)), 0, 0) != 0 {
+ rc = unixLogErrorAtLine(tls, SQLITE_IOERR|int32(5)<<8, ts+3726 /* "fsync" */, zPath, 40604)
}
- robust_close(tls, uintptr(0), *(*int32)(unsafe.Pointer(bp /* fd */)), 40408)
+ robust_close(tls, uintptr(0), *(*int32)(unsafe.Pointer(bp /* fd */)), 40606)
} else {
rc = SQLITE_OK
@@ -26502,7 +27072,7 @@ func unixDelete(tls *libc.TLS, NotUsed uintptr, zPath uintptr, dirSync int32) in
// SQLITE_ACCESS_READONLY: Return 1 if the file is readable.
//
// Otherwise return 0.
-func unixAccess(tls *libc.TLS, NotUsed uintptr, zPath uintptr, flags int32, pResOut uintptr) int32 { /* sqlite3.c:40428:12: */
+func unixAccess(tls *libc.TLS, NotUsed uintptr, zPath uintptr, flags int32, pResOut uintptr) int32 { /* sqlite3.c:40626:12: */
bp := tls.Alloc(104)
defer tls.Free(104)
@@ -26514,9 +27084,9 @@ func unixAccess(tls *libc.TLS, NotUsed uintptr, zPath uintptr, flags int32, pRes
if flags == SQLITE_ACCESS_EXISTS {
// var buf stat at bp, 104
- *(*int32)(unsafe.Pointer(pResOut)) = (libc.Bool32((0 == (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer((uintptr(unsafe.Pointer(&aSyscall)) + 4*12 + 4 /* &.pCurrent */))))(tls, zPath, bp /* &buf */)) && (!((((*stat)(unsafe.Pointer(bp /* &buf */)).Fst_mode) & X__mode_t(0170000)) == (X__mode_t(0100000))) || ((*stat)(unsafe.Pointer(bp /* &buf */)).Fst_size > int64(0)))))
+ *(*int32)(unsafe.Pointer(pResOut)) = libc.Bool32(0 == (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aSyscall)) + 4*12 + 4)))(tls, zPath, bp) && (!((*stat)(unsafe.Pointer(bp)).Fst_mode&X__mode_t(0170000) == X__mode_t(0100000)) || (*stat)(unsafe.Pointer(bp)).Fst_size > int64(0)))
} else {
- *(*int32)(unsafe.Pointer(pResOut)) = (libc.Bool32((*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer((uintptr(unsafe.Pointer(&aSyscall)) + 2*12 + 4 /* &.pCurrent */))))(tls, zPath, (W_OK|R_OK)) == 0))
+ *(*int32)(unsafe.Pointer(pResOut)) = libc.Bool32((*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aSyscall)) + 2*12 + 4)))(tls, zPath, W_OK|R_OK) == 0)
}
return SQLITE_OK
}
@@ -26524,21 +27094,21 @@ func unixAccess(tls *libc.TLS, NotUsed uintptr, zPath uintptr, flags int32, pRes
// If the last component of the pathname in z[0]..z[j-1] is something
// other than ".." then back it out and return true. If the last
// component is empty or if it is ".." then return false.
-func unixBackupDir(tls *libc.TLS, z uintptr, pJ uintptr) int32 { /* sqlite3.c:40457:12: */
+func unixBackupDir(tls *libc.TLS, z uintptr, pJ uintptr) int32 { /* sqlite3.c:40655:12: */
var j int32 = *(*int32)(unsafe.Pointer(pJ))
var i int32
if j <= 0 {
return 0
}
- for i = (j - 1); (i > 0) && (int32(*(*uint8)(unsafe.Pointer(z + uintptr((i - 1))))) != '/'); i-- {
+ for i = j - 1; i > 0 && int32(*(*uint8)(unsafe.Pointer(z + uintptr(i-1)))) != '/'; i-- {
}
if i == 0 {
return 0
}
- if ((int32(*(*uint8)(unsafe.Pointer(z + uintptr(i)))) == '.') && (i == (j - 2))) && (int32(*(*uint8)(unsafe.Pointer(z + uintptr((i + 1))))) == '.') {
+ if int32(*(*uint8)(unsafe.Pointer(z + uintptr(i)))) == '.' && i == j-2 && int32(*(*uint8)(unsafe.Pointer(z + uintptr(i+1)))) == '.' {
return 0
}
- *(*int32)(unsafe.Pointer(pJ)) = (i - 1)
+ *(*int32)(unsafe.Pointer(pJ)) = i - 1
return 1
}
@@ -26547,7 +27117,7 @@ func unixBackupDir(tls *libc.TLS, z uintptr, pJ uintptr) int32 { /* sqlite3.c:40
//
// Remove all instances of /./
// Remove all isntances of /X/../ for any X
-func mkFullPathname(tls *libc.TLS, zPath uintptr, zOut uintptr, nOut int32) int32 { /* sqlite3.c:40475:12: */
+func mkFullPathname(tls *libc.TLS, zPath uintptr, zOut uintptr, nOut int32) int32 { /* sqlite3.c:40673:12: */
bp := tls.Alloc(12)
defer tls.Free(12)
@@ -26557,25 +27127,25 @@ func mkFullPathname(tls *libc.TLS, zPath uintptr, zOut uintptr, nOut int32) int3
// var j int32 at bp+8, 4
if int32(*(*uint8)(unsafe.Pointer(zPath))) != '/' {
- if (*(*func(*libc.TLS, uintptr, Size_t) uintptr)(unsafe.Pointer((uintptr(unsafe.Pointer(&aSyscall)) + 3*12 + 4 /* &.pCurrent */))))(tls, zOut, (uint32(nOut-2))) == uintptr(0) {
- return unixLogErrorAtLine(tls, Xsqlite3CantopenError(tls, 40485), ts+2406 /* "getcwd" */, zPath, 40485)
+ if (*(*func(*libc.TLS, uintptr, Size_t) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aSyscall)) + 3*12 + 4)))(tls, zOut, uint32(nOut-2)) == uintptr(0) {
+ return unixLogErrorAtLine(tls, Xsqlite3CantopenError(tls, 40683), ts+3217 /* "getcwd" */, zPath, 40683)
}
iOff = Xsqlite3Strlen30(tls, zOut)
*(*uint8)(unsafe.Pointer(zOut + uintptr(libc.PostIncInt32(&iOff, 1)))) = uint8('/')
}
- if ((iOff + nPath) + 1) > nOut {
+ if iOff+nPath+1 > nOut {
// SQLite assumes that xFullPathname() nul-terminates the output buffer
// even if it returns an error.
*(*uint8)(unsafe.Pointer(zOut + uintptr(iOff))) = uint8(0)
- return Xsqlite3CantopenError(tls, 40494)
+ return Xsqlite3CantopenError(tls, 40692)
}
- Xsqlite3_snprintf(tls, (nOut - iOff), (zOut + uintptr(iOff)), ts+2790 /* "%s" */, libc.VaList(bp, zPath))
+ Xsqlite3_snprintf(tls, nOut-iOff, zOut+uintptr(iOff), ts+3601 /* "%s" */, libc.VaList(bp, zPath))
// Remove duplicate '/' characters. Except, two // at the beginning
// of a pathname is allowed since this is important on windows.
for i = libc.AssignPtrInt32(bp+8 /* j */, 1); *(*uint8)(unsafe.Pointer(zOut + uintptr(i))) != 0; i++ {
*(*uint8)(unsafe.Pointer(zOut + uintptr(libc.PostIncInt32(&*(*int32)(unsafe.Pointer(bp + 8 /* j */)), 1)))) = *(*uint8)(unsafe.Pointer(zOut + uintptr(i)))
- for (int32(*(*uint8)(unsafe.Pointer(zOut + uintptr(i)))) == '/') && (int32(*(*uint8)(unsafe.Pointer(zOut + uintptr((i + 1))))) == '/') {
+ for int32(*(*uint8)(unsafe.Pointer(zOut + uintptr(i)))) == '/' && int32(*(*uint8)(unsafe.Pointer(zOut + uintptr(i+1)))) == '/' {
i++
}
}
@@ -26584,27 +27154,27 @@ func mkFullPathname(tls *libc.TLS, zPath uintptr, zOut uintptr, nOut int32) int3
for i = libc.AssignPtrInt32(bp+8 /* j */, 0); *(*uint8)(unsafe.Pointer(zOut + uintptr(i))) != 0; i++ {
if int32(*(*uint8)(unsafe.Pointer(zOut + uintptr(i)))) == '/' {
// Skip over internal "/." directory components
- if (int32(*(*uint8)(unsafe.Pointer(zOut + uintptr((i + 1))))) == '.') && (int32(*(*uint8)(unsafe.Pointer(zOut + uintptr((i + 2))))) == '/') {
- i = i + (1)
+ if int32(*(*uint8)(unsafe.Pointer(zOut + uintptr(i+1)))) == '.' && int32(*(*uint8)(unsafe.Pointer(zOut + uintptr(i+2)))) == '/' {
+ i = i + 1
continue
}
// If this is a "/.." directory component then back out the
// previous term of the directory if it is something other than "..".
- if (((int32(*(*uint8)(unsafe.Pointer(zOut + uintptr((i + 1))))) == '.') &&
- (int32(*(*uint8)(unsafe.Pointer(zOut + uintptr((i + 2))))) == '.')) &&
- (int32(*(*uint8)(unsafe.Pointer(zOut + uintptr((i + 3))))) == '/')) &&
- (unixBackupDir(tls, zOut, bp+8 /* &j */) != 0) {
- i = i + (2)
+ if int32(*(*uint8)(unsafe.Pointer(zOut + uintptr(i+1)))) == '.' &&
+ int32(*(*uint8)(unsafe.Pointer(zOut + uintptr(i+2)))) == '.' &&
+ int32(*(*uint8)(unsafe.Pointer(zOut + uintptr(i+3)))) == '/' &&
+ unixBackupDir(tls, zOut, bp+8) != 0 {
+ i = i + 2
continue
}
}
- if *(*int32)(unsafe.Pointer(bp + 8 /* j */)) >= 0 {
+ if *(*int32)(unsafe.Pointer(bp + 8)) >= 0 {
*(*uint8)(unsafe.Pointer(zOut + uintptr(*(*int32)(unsafe.Pointer(bp + 8 /* j */))))) = *(*uint8)(unsafe.Pointer(zOut + uintptr(i)))
}
*(*int32)(unsafe.Pointer(bp + 8 /* j */))++
}
- if *(*int32)(unsafe.Pointer(bp + 8 /* j */)) == 0 {
+ if *(*int32)(unsafe.Pointer(bp + 8)) == 0 {
*(*uint8)(unsafe.Pointer(zOut + uintptr(libc.PostIncInt32(&*(*int32)(unsafe.Pointer(bp + 8 /* j */)), 1)))) = uint8('/')
}
*(*uint8)(unsafe.Pointer(zOut + uintptr(*(*int32)(unsafe.Pointer(bp + 8 /* j */))))) = uint8(0)
@@ -26618,7 +27188,7 @@ func mkFullPathname(tls *libc.TLS, zPath uintptr, zOut uintptr, nOut int32) int3
// zOut points to a buffer of at least sqlite3_vfs.mxPathname bytes
// (in this case, MAX_PATHNAME bytes). The full-path is written to
// this buffer before returning.
-func unixFullPathname(tls *libc.TLS, pVfs uintptr, zPath uintptr, nOut int32, zOut uintptr) int32 { /* sqlite3.c:40544:12: */
+func unixFullPathname(tls *libc.TLS, pVfs uintptr, zPath uintptr, nOut int32, zOut uintptr) int32 { /* sqlite3.c:40742:12: */
bp := tls.Alloc(104)
defer tls.Free(104)
@@ -26635,19 +27205,19 @@ func unixFullPathname(tls *libc.TLS, pVfs uintptr, zPath uintptr, nOut int32, zO
// function failing. This function could fail if, for example, the
// current working directory has been unlinked.
- for ok := true; ok; ok = (rc == SQLITE_OK) {
+ for ok := true; ok; ok = rc == SQLITE_OK {
// Call stat() on path zIn. Set bLink to true if the path is a symbolic
// link, or false otherwise.
var bLink int32 = 0
// var buf stat at bp, 104
- if (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer((uintptr(unsafe.Pointer(&aSyscall)) + 27*12 + 4 /* &.pCurrent */))))(tls, zIn, bp /* &buf */) != 0 {
- if (*(*int32)(unsafe.Pointer(libc.X__errno_location(tls)))) != ENOENT {
- rc = unixLogErrorAtLine(tls, Xsqlite3CantopenError(tls, 40577), ts+2586 /* "lstat" */, zIn, 40577)
+ if (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aSyscall)) + 27*12 + 4)))(tls, zIn, bp) != 0 {
+ if *(*int32)(unsafe.Pointer(libc.X__errno_location(tls))) != ENOENT {
+ rc = unixLogErrorAtLine(tls, Xsqlite3CantopenError(tls, 40775), ts+3397 /* "lstat" */, zIn, 40775)
}
} else {
- bLink = (libc.Bool32((((*stat)(unsafe.Pointer(bp /* &buf */)).Fst_mode) & X__mode_t(0170000)) == (X__mode_t(0120000))))
+ bLink = libc.Bool32((*stat)(unsafe.Pointer(bp)).Fst_mode&X__mode_t(0170000) == X__mode_t(0120000))
}
if bLink != 0 {
@@ -26658,24 +27228,24 @@ func unixFullPathname(tls *libc.TLS, pVfs uintptr, zPath uintptr, nOut int32, zO
rc = SQLITE_NOMEM
}
} else if nLink >= SQLITE_MAX_SYMLINKS {
- rc = Xsqlite3CantopenError(tls, 40589)
+ rc = Xsqlite3CantopenError(tls, 40787)
}
if rc == SQLITE_OK {
- nByte = (*(*func(*libc.TLS, uintptr, uintptr, Size_t) Ssize_t)(unsafe.Pointer((uintptr(unsafe.Pointer(&aSyscall)) + 26*12 + 4 /* &.pCurrent */))))(tls, zIn, zDel, (uint32(nOut - 1)))
+ nByte = (*(*func(*libc.TLS, uintptr, uintptr, Size_t) Ssize_t)(unsafe.Pointer(uintptr(unsafe.Pointer(&aSyscall)) + 26*12 + 4)))(tls, zIn, zDel, uint32(nOut-1))
if nByte < 0 {
- rc = unixLogErrorAtLine(tls, Xsqlite3CantopenError(tls, 40595), ts+2577 /* "readlink" */, zIn, 40595)
+ rc = unixLogErrorAtLine(tls, Xsqlite3CantopenError(tls, 40793), ts+3388 /* "readlink" */, zIn, 40793)
} else {
if int32(*(*uint8)(unsafe.Pointer(zDel))) != '/' {
var n int32
- for n = Xsqlite3Strlen30(tls, zIn); (n > 0) && (int32(*(*uint8)(unsafe.Pointer(zIn + uintptr((n - 1))))) != '/'); n-- {
+ for n = Xsqlite3Strlen30(tls, zIn); n > 0 && int32(*(*uint8)(unsafe.Pointer(zIn + uintptr(n-1)))) != '/'; n-- {
}
- if ((nByte + n) + 1) > nOut {
- rc = Xsqlite3CantopenError(tls, 40601)
+ if nByte+n+1 > nOut {
+ rc = Xsqlite3CantopenError(tls, 40799)
} else {
- libc.Xmemmove(tls, (zDel + uintptr(n)), zDel, (uint32(nByte + 1)))
+ libc.Xmemmove(tls, zDel+uintptr(n), zDel, uint32(nByte+1))
libc.Xmemcpy(tls, zDel, zIn, uint32(n))
- nByte = nByte + (n)
+ nByte = nByte + n
}
}
*(*uint8)(unsafe.Pointer(zDel + uintptr(nByte))) = uint8(0)
@@ -26685,7 +27255,7 @@ func unixFullPathname(tls *libc.TLS, pVfs uintptr, zPath uintptr, nOut int32, zO
zIn = zDel
}
- if (rc == SQLITE_OK) && (zIn != zOut) {
+ if rc == SQLITE_OK && zIn != zOut {
rc = mkFullPathname(tls, zIn, zOut, nOut)
}
if bLink == 0 {
@@ -26695,8 +27265,8 @@ func unixFullPathname(tls *libc.TLS, pVfs uintptr, zPath uintptr, nOut int32, zO
}
Xsqlite3_free(tls, zDel)
- if (rc == SQLITE_OK) && (nLink != 0) {
- rc = (SQLITE_OK | (int32(2) << 8))
+ if rc == SQLITE_OK && nLink != 0 {
+ rc = SQLITE_OK | int32(2)<<8
}
return rc
}
@@ -26732,14 +27302,18 @@ type Dl_serpath = struct {
// This is the structure that must be passed (by reference) to `dlinfo' for
// the RTLD_DI_SERINFO and RTLD_DI_SERINFOSIZE requests.
type Dl_serinfo = struct {
- Fdls_size Size_t
- Fdls_cnt uint32
- Fdls_serpath [1]Dl_serpath
-} /* dlfcn.h:184:3 */
+ Fdls_size Size_t
+ Fdls_cnt uint32
+ F__8 struct {
+ F__ccgo_pad1 [0]uint32
+ Fdls_serpath [0]Dl_serpath
+ F__ccgo_pad2 [8]byte
+ }
+} /* dlfcn.h:196:3 */
-func unixDlOpen(tls *libc.TLS, NotUsed uintptr, zFilename uintptr) uintptr { /* sqlite3.c:40636:13: */
+func unixDlOpen(tls *libc.TLS, NotUsed uintptr, zFilename uintptr) uintptr { /* sqlite3.c:40834:13: */
_ = NotUsed
- return libc.Xdlopen(tls, zFilename, (RTLD_NOW | RTLD_GLOBAL))
+ return libc.Xdlopen(tls, zFilename, RTLD_NOW|RTLD_GLOBAL)
}
// SQLite calls this function immediately after a call to unixDlSym() or
@@ -26747,7 +27321,7 @@ func unixDlOpen(tls *libc.TLS, NotUsed uintptr, zFilename uintptr) uintptr { /*
// message is available, it is written to zBufOut. If no error message
// is available, zBufOut is left unmodified and SQLite uses a default
// error message.
-func unixDlError(tls *libc.TLS, NotUsed uintptr, nBuf int32, zBufOut uintptr) { /* sqlite3.c:40648:13: */
+func unixDlError(tls *libc.TLS, NotUsed uintptr, nBuf int32, zBufOut uintptr) { /* sqlite3.c:40846:13: */
bp := tls.Alloc(8)
defer tls.Free(8)
@@ -26756,12 +27330,12 @@ func unixDlError(tls *libc.TLS, NotUsed uintptr, nBuf int32, zBufOut uintptr) {
unixEnterMutex(tls)
zErr = libc.Xdlerror(tls)
if zErr != 0 {
- Xsqlite3_snprintf(tls, nBuf, zBufOut, ts+2790 /* "%s" */, libc.VaList(bp, zErr))
+ Xsqlite3_snprintf(tls, nBuf, zBufOut, ts+3601 /* "%s" */, libc.VaList(bp, zErr))
}
unixLeaveMutex(tls)
}
-func unixDlSym(tls *libc.TLS, NotUsed uintptr, p uintptr, zSym uintptr) uintptr { /* sqlite3.c:40658:13: */
+func unixDlSym(tls *libc.TLS, NotUsed uintptr, p uintptr, zSym uintptr) uintptr { /* sqlite3.c:40856:13: */
// GCC with -pedantic-errors says that C90 does not allow a void* to be
// cast into a pointer to a function. And yet the library dlsym() routine
// returns a void* which is really a pointer to a function. So how do we
@@ -26787,13 +27361,13 @@ func unixDlSym(tls *libc.TLS, NotUsed uintptr, p uintptr, zSym uintptr) uintptr
})(unsafe.Pointer(&struct{ uintptr }{x})).f(tls, p, zSym)
}
-func unixDlClose(tls *libc.TLS, NotUsed uintptr, pHandle uintptr) { /* sqlite3.c:40681:13: */
+func unixDlClose(tls *libc.TLS, NotUsed uintptr, pHandle uintptr) { /* sqlite3.c:40879:13: */
_ = NotUsed
libc.Xdlclose(tls, pHandle)
}
// Write nBuf bytes of random data to the supplied buffer zBuf.
-func unixRandomness(tls *libc.TLS, NotUsed uintptr, nBuf int32, zBuf uintptr) int32 { /* sqlite3.c:40695:12: */
+func unixRandomness(tls *libc.TLS, NotUsed uintptr, nBuf int32, zBuf uintptr) int32 { /* sqlite3.c:40893:12: */
bp := tls.Alloc(4)
defer tls.Free(4)
@@ -26815,20 +27389,20 @@ func unixRandomness(tls *libc.TLS, NotUsed uintptr, nBuf int32, zBuf uintptr) in
{
var fd int32
var got int32
- fd = robust_open(tls, ts+2921 /* "/dev/urandom" */, O_RDONLY, uint32(0))
+ fd = robust_open(tls, ts+3732 /* "/dev/urandom" */, O_RDONLY, uint32(0))
if fd < 0 {
// var t Time_t at bp, 4
libc.Xtime(tls, bp /* &t */)
libc.Xmemcpy(tls, zBuf, bp /* &t */, uint32(unsafe.Sizeof(Time_t(0))))
- libc.Xmemcpy(tls, (zBuf + 4), uintptr(unsafe.Pointer(&randomnessPid)), uint32(unsafe.Sizeof(randomnessPid)))
+ libc.Xmemcpy(tls, zBuf+4, uintptr(unsafe.Pointer(&randomnessPid)), uint32(unsafe.Sizeof(randomnessPid)))
- nBuf = (int32(uint32(unsafe.Sizeof(Time_t(0))) + uint32(unsafe.Sizeof(randomnessPid))))
+ nBuf = int32(uint32(unsafe.Sizeof(Time_t(0))) + uint32(unsafe.Sizeof(randomnessPid)))
} else {
- for ok := true; ok; ok = ((got < 0) && ((*(*int32)(unsafe.Pointer(libc.X__errno_location(tls)))) == EINTR)) {
- got = (*(*func(*libc.TLS, int32, uintptr, Size_t) Ssize_t)(unsafe.Pointer((uintptr(unsafe.Pointer(&aSyscall)) + 8*12 + 4 /* &.pCurrent */))))(tls, fd, zBuf, uint32(nBuf))
+ for ok := true; ok; ok = got < 0 && *(*int32)(unsafe.Pointer(libc.X__errno_location(tls))) == EINTR {
+ got = (*(*func(*libc.TLS, int32, uintptr, Size_t) Ssize_t)(unsafe.Pointer(uintptr(unsafe.Pointer(&aSyscall)) + 8*12 + 4)))(tls, fd, zBuf, uint32(nBuf))
}
- robust_close(tls, uintptr(0), fd, 40726)
+ robust_close(tls, uintptr(0), fd, 40924)
}
}
@@ -26841,12 +27415,12 @@ func unixRandomness(tls *libc.TLS, NotUsed uintptr, nBuf int32, zBuf uintptr) in
// requested from the underlying operating system, a number which
// might be greater than or equal to the argument, but not less
// than the argument.
-func unixSleep(tls *libc.TLS, NotUsed uintptr, microseconds int32) int32 { /* sqlite3.c:40742:12: */
+func unixSleep(tls *libc.TLS, NotUsed uintptr, microseconds int32) int32 { /* sqlite3.c:40940:12: */
if microseconds >= 1000000 {
- libc.Xsleep(tls, (uint32(microseconds / 1000000)))
+ libc.Xsleep(tls, uint32(microseconds/1000000))
}
- if (microseconds % 1000000) != 0 {
- libc.Xusleep(tls, (uint32(microseconds % 1000000)))
+ if microseconds%1000000 != 0 {
+ libc.Xusleep(tls, uint32(microseconds%1000000))
}
_ = NotUsed
return microseconds
@@ -26864,7 +27438,7 @@ func unixSleep(tls *libc.TLS, NotUsed uintptr, microseconds int32) int32 { /* sq
//
// On success, return SQLITE_OK. Return SQLITE_ERROR if the time and date
// cannot be found.
-func unixCurrentTimeInt64(tls *libc.TLS, NotUsed uintptr, piNow uintptr) int32 { /* sqlite3.c:40783:12: */
+func unixCurrentTimeInt64(tls *libc.TLS, NotUsed uintptr, piNow uintptr) int32 { /* sqlite3.c:40981:12: */
bp := tls.Alloc(8)
defer tls.Free(8)
@@ -26872,18 +27446,18 @@ func unixCurrentTimeInt64(tls *libc.TLS, NotUsed uintptr, piNow uintptr) int32 {
// var sNow timeval at bp, 8
libc.Xgettimeofday(tls, bp /* &sNow */, uintptr(0)) // Cannot fail given valid arguments
- *(*Sqlite3_int64)(unsafe.Pointer(piNow)) = ((unixEpoch + (int64(1000) * Sqlite3_int64((*timeval)(unsafe.Pointer(bp /* &sNow */)).Ftv_sec))) + (Sqlite3_int64((*timeval)(unsafe.Pointer(bp /* &sNow */)).Ftv_usec / 1000)))
+ *(*Sqlite3_int64)(unsafe.Pointer(piNow)) = unixEpoch + int64(1000)*Sqlite3_int64((*timeval)(unsafe.Pointer(bp)).Ftv_sec) + Sqlite3_int64((*timeval)(unsafe.Pointer(bp)).Ftv_usec/1000)
_ = NotUsed
return rc
}
-var unixEpoch Sqlite3_int64 = (int64(24405875) * int64(8640000)) /* sqlite3.c:40784:30 */
+var unixEpoch Sqlite3_int64 = int64(24405875) * int64(8640000) /* sqlite3.c:40982:30 */
// Find the current time (in Universal Coordinated Time). Write the
// current time and date as a Julian Day number into *prNow and
// return 0. Return 1 if the time and date cannot be found.
-func unixCurrentTime(tls *libc.TLS, NotUsed uintptr, prNow uintptr) int32 { /* sqlite3.c:40815:12: */
+func unixCurrentTime(tls *libc.TLS, NotUsed uintptr, prNow uintptr) int32 { /* sqlite3.c:41013:12: */
bp := tls.Alloc(8)
defer tls.Free(8)
@@ -26891,7 +27465,7 @@ func unixCurrentTime(tls *libc.TLS, NotUsed uintptr, prNow uintptr) int32 { /* s
var rc int32
_ = NotUsed
rc = unixCurrentTimeInt64(tls, uintptr(0), bp /* &i */)
- *(*float64)(unsafe.Pointer(prNow)) = (float64(*(*Sqlite3_int64)(unsafe.Pointer(bp /* i */))) / 86400000.0)
+ *(*float64)(unsafe.Pointer(prNow)) = float64(*(*Sqlite3_int64)(unsafe.Pointer(bp))) / 86400000.0
return rc
}
@@ -26899,7 +27473,7 @@ func unixCurrentTime(tls *libc.TLS, NotUsed uintptr, prNow uintptr) int32 { /* s
// low-level error message when operating-system problems come up
// during SQLite operation. Only the integer return code is currently
// used.
-func unixGetLastError(tls *libc.TLS, NotUsed uintptr, NotUsed2 int32, NotUsed3 uintptr) int32 { /* sqlite3.c:40833:12: */
+func unixGetLastError(tls *libc.TLS, NotUsed uintptr, NotUsed2 int32, NotUsed3 uintptr) int32 { /* sqlite3.c:41031:12: */
_ = NotUsed
_ = NotUsed2
_ = NotUsed3
@@ -27081,15 +27655,15 @@ func unixGetLastError(tls *libc.TLS, NotUsed uintptr, NotUsed2 int32, NotUsed3 u
// single thread. The memory allocation and mutex subsystems have not
// necessarily been initialized when this routine is called, and so they
// should not be used.
-func Xsqlite3_os_init(tls *libc.TLS) int32 { /* sqlite3.c:42038:16: */
+func Xsqlite3_os_init(tls *libc.TLS) int32 { /* sqlite3.c:42236:16: */
var i uint32 // Loop counter
// Double-check that the aSyscall[] array has been constructed
// correctly. See ticket [bb3a86e890c8e96ab]
// Register all VFSes defined in the aVfs[] array
- for i = uint32(0); i < (uint32(unsafe.Sizeof(aVfs)) / uint32(unsafe.Sizeof(Sqlite3_vfs{}))); i++ {
- Xsqlite3_vfs_register(tls, (uintptr(unsafe.Pointer(&aVfs)) + uintptr(i)*88), (libc.Bool32(i == uint32(0))))
+ for i = uint32(0); i < uint32(unsafe.Sizeof(aVfs))/uint32(unsafe.Sizeof(Sqlite3_vfs{})); i++ {
+ Xsqlite3_vfs_register(tls, uintptr(unsafe.Pointer(&aVfs))+uintptr(i)*88, libc.Bool32(i == uint32(0)))
}
unixBigLock = Xsqlite3MutexAlloc(tls, SQLITE_MUTEX_STATIC_VFS1)
@@ -27108,22 +27682,25 @@ func Xsqlite3_os_init(tls *libc.TLS) int32 { /* sqlite3.c:42038:16: */
// DMS UNIX_SHM_BASE+8 128
// Byte offset of the deadman-switch
+ // Initialize temp file dir array.
+ unixTempFileInit(tls)
+
return SQLITE_OK
}
var aVfs = [4]Sqlite3_vfs{
- {FiVersion: 3 /* iVersion */, FszOsFile: int32(unsafe.Sizeof(UnixFile{})) /* szOsFile */, FmxPathname: MAX_PATHNAME /* pNext */, FzName: ts + 2934 /* "unix" */ /* zName */, FpAppData: 0 /* pAppData */, FxOpen: 0 /* xOpen */, FxDelete: 0 /* xDelete */, FxAccess: 0 /* xAccess */, FxFullPathname: 0 /* xFullPathname */, FxDlOpen: 0 /* xDlOpen */, FxDlError: 0 /* xDlError */, FxDlSym: 0 /* xDlSym */, FxDlClose: 0 /* xDlClose */, FxRandomness: 0 /* xRandomness */, FxSleep: 0 /* xSleep */, FxCurrentTime: 0 /* xCurrentTime */, FxGetLastError: 0 /* xGetLastError */, FxCurrentTimeInt64: 0 /* xCurrentTimeInt64 */, FxSetSystemCall: 0 /* xSetSystemCall */, FxGetSystemCall: 0 /* xGetSystemCall */, FxNextSystemCall: 0 /* xNextSystemCall */},
- {FiVersion: 3 /* iVersion */, FszOsFile: int32(unsafe.Sizeof(UnixFile{})) /* szOsFile */, FmxPathname: MAX_PATHNAME /* pNext */, FzName: ts + 2939 /* "unix-none" */ /* zName */, FpAppData: 0 /* pAppData */, FxOpen: 0 /* xOpen */, FxDelete: 0 /* xDelete */, FxAccess: 0 /* xAccess */, FxFullPathname: 0 /* xFullPathname */, FxDlOpen: 0 /* xDlOpen */, FxDlError: 0 /* xDlError */, FxDlSym: 0 /* xDlSym */, FxDlClose: 0 /* xDlClose */, FxRandomness: 0 /* xRandomness */, FxSleep: 0 /* xSleep */, FxCurrentTime: 0 /* xCurrentTime */, FxGetLastError: 0 /* xGetLastError */, FxCurrentTimeInt64: 0 /* xCurrentTimeInt64 */, FxSetSystemCall: 0 /* xSetSystemCall */, FxGetSystemCall: 0 /* xGetSystemCall */, FxNextSystemCall: 0 /* xNextSystemCall */},
- {FiVersion: 3 /* iVersion */, FszOsFile: int32(unsafe.Sizeof(UnixFile{})) /* szOsFile */, FmxPathname: MAX_PATHNAME /* pNext */, FzName: ts + 2949 /* "unix-dotfile" */ /* zName */, FpAppData: 0 /* pAppData */, FxOpen: 0 /* xOpen */, FxDelete: 0 /* xDelete */, FxAccess: 0 /* xAccess */, FxFullPathname: 0 /* xFullPathname */, FxDlOpen: 0 /* xDlOpen */, FxDlError: 0 /* xDlError */, FxDlSym: 0 /* xDlSym */, FxDlClose: 0 /* xDlClose */, FxRandomness: 0 /* xRandomness */, FxSleep: 0 /* xSleep */, FxCurrentTime: 0 /* xCurrentTime */, FxGetLastError: 0 /* xGetLastError */, FxCurrentTimeInt64: 0 /* xCurrentTimeInt64 */, FxSetSystemCall: 0 /* xSetSystemCall */, FxGetSystemCall: 0 /* xGetSystemCall */, FxNextSystemCall: 0 /* xNextSystemCall */},
- {FiVersion: 3 /* iVersion */, FszOsFile: int32(unsafe.Sizeof(UnixFile{})) /* szOsFile */, FmxPathname: MAX_PATHNAME /* pNext */, FzName: ts + 2829 /* "unix-excl" */ /* zName */, FpAppData: 0 /* pAppData */, FxOpen: 0 /* xOpen */, FxDelete: 0 /* xDelete */, FxAccess: 0 /* xAccess */, FxFullPathname: 0 /* xFullPathname */, FxDlOpen: 0 /* xDlOpen */, FxDlError: 0 /* xDlError */, FxDlSym: 0 /* xDlSym */, FxDlClose: 0 /* xDlClose */, FxRandomness: 0 /* xRandomness */, FxSleep: 0 /* xSleep */, FxCurrentTime: 0 /* xCurrentTime */, FxGetLastError: 0 /* xGetLastError */, FxCurrentTimeInt64: 0 /* xCurrentTimeInt64 */, FxSetSystemCall: 0 /* xSetSystemCall */, FxGetSystemCall: 0 /* xGetSystemCall */, FxNextSystemCall: 0 /* xNextSystemCall */},
-} /* sqlite3.c:42091:22 */
+ {FiVersion: 3 /* iVersion */, FszOsFile: int32(unsafe.Sizeof(UnixFile{})) /* szOsFile */, FmxPathname: MAX_PATHNAME /* pNext */, FzName: ts + 3745 /* "unix" */ /* zName */, FpAppData: 0 /* pAppData */, FxOpen: 0 /* xOpen */, FxDelete: 0 /* xDelete */, FxAccess: 0 /* xAccess */, FxFullPathname: 0 /* xFullPathname */, FxDlOpen: 0 /* xDlOpen */, FxDlError: 0 /* xDlError */, FxDlSym: 0 /* xDlSym */, FxDlClose: 0 /* xDlClose */, FxRandomness: 0 /* xRandomness */, FxSleep: 0 /* xSleep */, FxCurrentTime: 0 /* xCurrentTime */, FxGetLastError: 0 /* xGetLastError */, FxCurrentTimeInt64: 0 /* xCurrentTimeInt64 */, FxSetSystemCall: 0 /* xSetSystemCall */, FxGetSystemCall: 0 /* xGetSystemCall */, FxNextSystemCall: 0 /* xNextSystemCall */},
+ {FiVersion: 3 /* iVersion */, FszOsFile: int32(unsafe.Sizeof(UnixFile{})) /* szOsFile */, FmxPathname: MAX_PATHNAME /* pNext */, FzName: ts + 3750 /* "unix-none" */ /* zName */, FpAppData: 0 /* pAppData */, FxOpen: 0 /* xOpen */, FxDelete: 0 /* xDelete */, FxAccess: 0 /* xAccess */, FxFullPathname: 0 /* xFullPathname */, FxDlOpen: 0 /* xDlOpen */, FxDlError: 0 /* xDlError */, FxDlSym: 0 /* xDlSym */, FxDlClose: 0 /* xDlClose */, FxRandomness: 0 /* xRandomness */, FxSleep: 0 /* xSleep */, FxCurrentTime: 0 /* xCurrentTime */, FxGetLastError: 0 /* xGetLastError */, FxCurrentTimeInt64: 0 /* xCurrentTimeInt64 */, FxSetSystemCall: 0 /* xSetSystemCall */, FxGetSystemCall: 0 /* xGetSystemCall */, FxNextSystemCall: 0 /* xNextSystemCall */},
+ {FiVersion: 3 /* iVersion */, FszOsFile: int32(unsafe.Sizeof(UnixFile{})) /* szOsFile */, FmxPathname: MAX_PATHNAME /* pNext */, FzName: ts + 3760 /* "unix-dotfile" */ /* zName */, FpAppData: 0 /* pAppData */, FxOpen: 0 /* xOpen */, FxDelete: 0 /* xDelete */, FxAccess: 0 /* xAccess */, FxFullPathname: 0 /* xFullPathname */, FxDlOpen: 0 /* xDlOpen */, FxDlError: 0 /* xDlError */, FxDlSym: 0 /* xDlSym */, FxDlClose: 0 /* xDlClose */, FxRandomness: 0 /* xRandomness */, FxSleep: 0 /* xSleep */, FxCurrentTime: 0 /* xCurrentTime */, FxGetLastError: 0 /* xGetLastError */, FxCurrentTimeInt64: 0 /* xCurrentTimeInt64 */, FxSetSystemCall: 0 /* xSetSystemCall */, FxGetSystemCall: 0 /* xGetSystemCall */, FxNextSystemCall: 0 /* xNextSystemCall */},
+ {FiVersion: 3 /* iVersion */, FszOsFile: int32(unsafe.Sizeof(UnixFile{})) /* szOsFile */, FmxPathname: MAX_PATHNAME /* pNext */, FzName: ts + 3640 /* "unix-excl" */ /* zName */, FpAppData: 0 /* pAppData */, FxOpen: 0 /* xOpen */, FxDelete: 0 /* xDelete */, FxAccess: 0 /* xAccess */, FxFullPathname: 0 /* xFullPathname */, FxDlOpen: 0 /* xDlOpen */, FxDlError: 0 /* xDlError */, FxDlSym: 0 /* xDlSym */, FxDlClose: 0 /* xDlClose */, FxRandomness: 0 /* xRandomness */, FxSleep: 0 /* xSleep */, FxCurrentTime: 0 /* xCurrentTime */, FxGetLastError: 0 /* xGetLastError */, FxCurrentTimeInt64: 0 /* xCurrentTimeInt64 */, FxSetSystemCall: 0 /* xSetSystemCall */, FxGetSystemCall: 0 /* xGetSystemCall */, FxNextSystemCall: 0 /* xNextSystemCall */},
+} /* sqlite3.c:42289:22 */
// Shutdown the operating system interface.
//
// Some operating systems might need to do some cleanup in this routine,
// to release dynamically allocated objects. But not on unix.
// This routine is a no-op for unix.
-func Xsqlite3_os_end(tls *libc.TLS) int32 { /* sqlite3.c:42157:16: */
+func Xsqlite3_os_end(tls *libc.TLS) int32 { /* sqlite3.c:42358:16: */
unixBigLock = uintptr(0)
return SQLITE_OK
}
@@ -27165,14 +27742,14 @@ func Xsqlite3_os_end(tls *libc.TLS) int32 { /* sqlite3.c:42157:16: */
// #include "sqliteInt.h"
// Forward declaration of objects used by this utility
-type MemVfs = sqlite3_vfs /* sqlite3.c:48545:28 */
+type MemVfs = sqlite3_vfs /* sqlite3.c:48548:28 */
type MemFile1 = struct {
Fbase Sqlite3_file
FpStore uintptr
FeLock int32
-} /* sqlite3.c:48546:9 */
+} /* sqlite3.c:48549:9 */
-type MemFile = MemFile1 /* sqlite3.c:48546:24 */
+type MemFile = MemFile1 /* sqlite3.c:48549:24 */
type MemStore1 = struct {
Fsz Sqlite3_int64
FszAlloc Sqlite3_int64
@@ -27185,9 +27762,9 @@ type MemStore1 = struct {
FnWrLock int32
FnRef int32
FzFName uintptr
-} /* sqlite3.c:48546:9 */
+} /* sqlite3.c:48549:9 */
-type MemStore = MemStore1 /* sqlite3.c:48547:25 */
+type MemStore = MemStore1 /* sqlite3.c:48550:25 */
// File-scope variables for holding the memdb files that are accessible
// to multiple database connections in separate threads.
@@ -27196,18 +27773,18 @@ type MemStore = MemStore1 /* sqlite3.c:48547:25 */
type MemFS = struct {
FnMemStore int32
FapMemStore uintptr
-} /* sqlite3.c:48617:8 */
+} /* sqlite3.c:48620:8 */
// File-scope variables for holding the memdb files that are accessible
// to multiple database connections in separate threads.
//
// Must hold SQLITE_MUTEX_STATIC_VFS1 to access any part of this object.
-var memdb_g MemFS /* sqlite3.c:48620:3: */
+var memdb_g MemFS /* sqlite3.c:48623:3: */
var memdb_vfs = Sqlite3_vfs{
FiVersion: 2, // szOsFile (set when registered)
FmxPathname: 1024, // pNext
- FzName: ts + 2962, /* "memdb" */ // pAppData (set when registered)
+ FzName: ts + 3773, /* "memdb" */ // pAppData (set when registered)
FxOpen: 0, /* memdbDelete, */ // xDelete
FxAccess: 0, // xAccess
FxFullPathname: 0, // xFullPathname
@@ -27219,7 +27796,7 @@ var memdb_vfs = Sqlite3_vfs{
FxSleep: 0, /* memdbCurrentTime, */ // xCurrentTime
FxGetLastError: 0, // xGetLastError
FxCurrentTimeInt64: 0, // xNextSystemCall
-} /* sqlite3.c:48656:20 */
+} /* sqlite3.c:48659:20 */
var memdb_io_methods = Sqlite3_io_methods{
FiVersion: 3, // iVersion
@@ -27235,21 +27812,21 @@ var memdb_io_methods = Sqlite3_io_methods{
FxDeviceCharacteristics: 0, // xShmUnmap
FxFetch: 0, // xFetch
FxUnfetch: 0, // xUnfetch
-} /* sqlite3.c:48681:33 */
+} /* sqlite3.c:48684:33 */
// Enter/leave the mutex on a MemStore
-func memdbEnter(tls *libc.TLS, p uintptr) { /* sqlite3.c:48714:13: */
+func memdbEnter(tls *libc.TLS, p uintptr) { /* sqlite3.c:48717:13: */
Xsqlite3_mutex_enter(tls, (*MemStore)(unsafe.Pointer(p)).FpMutex)
}
-func memdbLeave(tls *libc.TLS, p uintptr) { /* sqlite3.c:48717:13: */
+func memdbLeave(tls *libc.TLS, p uintptr) { /* sqlite3.c:48720:13: */
Xsqlite3_mutex_leave(tls, (*MemStore)(unsafe.Pointer(p)).FpMutex)
}
// Close an memdb-file.
// Free the underlying MemStore object when its refcount drops to zero
// or less.
-func memdbClose(tls *libc.TLS, pFile uintptr) int32 { /* sqlite3.c:48729:12: */
+func memdbClose(tls *libc.TLS, pFile uintptr) int32 { /* sqlite3.c:48732:12: */
var p uintptr = (*MemFile)(unsafe.Pointer(pFile)).FpStore
if (*MemStore)(unsafe.Pointer(p)).FzFName != 0 {
var i int32
@@ -27274,7 +27851,7 @@ func memdbClose(tls *libc.TLS, pFile uintptr) int32 { /* sqlite3.c:48729:12: */
}
(*MemStore)(unsafe.Pointer(p)).FnRef--
if (*MemStore)(unsafe.Pointer(p)).FnRef <= 0 {
- if ((*MemStore)(unsafe.Pointer(p)).FmFlags & uint32(SQLITE_DESERIALIZE_FREEONCLOSE)) != 0 {
+ if (*MemStore)(unsafe.Pointer(p)).FmFlags&uint32(SQLITE_DESERIALIZE_FREEONCLOSE) != 0 {
Xsqlite3_free(tls, (*MemStore)(unsafe.Pointer(p)).FaData)
}
memdbLeave(tls, p)
@@ -27287,38 +27864,38 @@ func memdbClose(tls *libc.TLS, pFile uintptr) int32 { /* sqlite3.c:48729:12: */
}
// Read data from an memdb-file.
-func memdbRead(tls *libc.TLS, pFile uintptr, zBuf uintptr, iAmt int32, iOfst Sqlite_int64) int32 { /* sqlite3.c:48771:12: */
+func memdbRead(tls *libc.TLS, pFile uintptr, zBuf uintptr, iAmt int32, iOfst Sqlite_int64) int32 { /* sqlite3.c:48774:12: */
var p uintptr = (*MemFile)(unsafe.Pointer(pFile)).FpStore
memdbEnter(tls, p)
- if (iOfst + Sqlite_int64(iAmt)) > (*MemStore)(unsafe.Pointer(p)).Fsz {
+ if iOfst+Sqlite_int64(iAmt) > (*MemStore)(unsafe.Pointer(p)).Fsz {
libc.Xmemset(tls, zBuf, 0, uint32(iAmt))
if iOfst < (*MemStore)(unsafe.Pointer(p)).Fsz {
- libc.Xmemcpy(tls, zBuf, ((*MemStore)(unsafe.Pointer(p)).FaData + uintptr(iOfst)), (uint32((*MemStore)(unsafe.Pointer(p)).Fsz - iOfst)))
+ libc.Xmemcpy(tls, zBuf, (*MemStore)(unsafe.Pointer(p)).FaData+uintptr(iOfst), uint32((*MemStore)(unsafe.Pointer(p)).Fsz-iOfst))
}
memdbLeave(tls, p)
- return (SQLITE_IOERR | (int32(2) << 8))
+ return SQLITE_IOERR | int32(2)<<8
}
- libc.Xmemcpy(tls, zBuf, ((*MemStore)(unsafe.Pointer(p)).FaData + uintptr(iOfst)), uint32(iAmt))
+ libc.Xmemcpy(tls, zBuf, (*MemStore)(unsafe.Pointer(p)).FaData+uintptr(iOfst), uint32(iAmt))
memdbLeave(tls, p)
return SQLITE_OK
}
// Try to enlarge the memory allocation to hold at least sz bytes
-func memdbEnlarge(tls *libc.TLS, p uintptr, newSz Sqlite3_int64) int32 { /* sqlite3.c:48793:12: */
+func memdbEnlarge(tls *libc.TLS, p uintptr, newSz Sqlite3_int64) int32 { /* sqlite3.c:48796:12: */
var pNew uintptr
- if (((*MemStore)(unsafe.Pointer(p)).FmFlags & uint32(SQLITE_DESERIALIZE_RESIZEABLE)) == uint32(0)) || ((*MemStore)(unsafe.Pointer(p)).FnMmap > 0) {
+ if (*MemStore)(unsafe.Pointer(p)).FmFlags&uint32(SQLITE_DESERIALIZE_RESIZEABLE) == uint32(0) || (*MemStore)(unsafe.Pointer(p)).FnMmap > 0 {
return SQLITE_FULL
}
if newSz > (*MemStore)(unsafe.Pointer(p)).FszMax {
return SQLITE_FULL
}
- newSz = newSz * (int64(2))
+ newSz = newSz * int64(2)
if newSz > (*MemStore)(unsafe.Pointer(p)).FszMax {
newSz = (*MemStore)(unsafe.Pointer(p)).FszMax
}
pNew = Xsqlite3Realloc(tls, (*MemStore)(unsafe.Pointer(p)).FaData, uint64(newSz))
if pNew == uintptr(0) {
- return (SQLITE_IOERR | (int32(12) << 8))
+ return SQLITE_IOERR | int32(12)<<8
}
(*MemStore)(unsafe.Pointer(p)).FaData = pNew
(*MemStore)(unsafe.Pointer(p)).FszAlloc = newSz
@@ -27326,28 +27903,28 @@ func memdbEnlarge(tls *libc.TLS, p uintptr, newSz Sqlite3_int64) int32 { /* sqli
}
// Write data to an memdb-file.
-func memdbWrite(tls *libc.TLS, pFile uintptr, z uintptr, iAmt int32, iOfst Sqlite_int64) int32 { /* sqlite3.c:48813:12: */
+func memdbWrite(tls *libc.TLS, pFile uintptr, z uintptr, iAmt int32, iOfst Sqlite_int64) int32 { /* sqlite3.c:48816:12: */
var p uintptr = (*MemFile)(unsafe.Pointer(pFile)).FpStore
memdbEnter(tls, p)
- if ((*MemStore)(unsafe.Pointer(p)).FmFlags & uint32(SQLITE_DESERIALIZE_READONLY)) != 0 {
+ if (*MemStore)(unsafe.Pointer(p)).FmFlags&uint32(SQLITE_DESERIALIZE_READONLY) != 0 {
// Can't happen: memdbLock() will return SQLITE_READONLY before
// reaching this point
memdbLeave(tls, p)
- return (SQLITE_IOERR | (int32(3) << 8))
+ return SQLITE_IOERR | int32(3)<<8
}
- if (iOfst + Sqlite_int64(iAmt)) > (*MemStore)(unsafe.Pointer(p)).Fsz {
+ if iOfst+Sqlite_int64(iAmt) > (*MemStore)(unsafe.Pointer(p)).Fsz {
var rc int32
- if ((iOfst + Sqlite_int64(iAmt)) > (*MemStore)(unsafe.Pointer(p)).FszAlloc) &&
- ((libc.AssignInt32(&rc, memdbEnlarge(tls, p, (iOfst+Sqlite_int64(iAmt))))) != SQLITE_OK) {
+ if iOfst+Sqlite_int64(iAmt) > (*MemStore)(unsafe.Pointer(p)).FszAlloc &&
+ libc.AssignInt32(&rc, memdbEnlarge(tls, p, iOfst+Sqlite_int64(iAmt))) != SQLITE_OK {
memdbLeave(tls, p)
return rc
}
if iOfst > (*MemStore)(unsafe.Pointer(p)).Fsz {
- libc.Xmemset(tls, ((*MemStore)(unsafe.Pointer(p)).FaData + uintptr((*MemStore)(unsafe.Pointer(p)).Fsz)), 0, (uint32(iOfst - (*MemStore)(unsafe.Pointer(p)).Fsz)))
+ libc.Xmemset(tls, (*MemStore)(unsafe.Pointer(p)).FaData+uintptr((*MemStore)(unsafe.Pointer(p)).Fsz), 0, uint32(iOfst-(*MemStore)(unsafe.Pointer(p)).Fsz))
}
- (*MemStore)(unsafe.Pointer(p)).Fsz = (iOfst + Sqlite_int64(iAmt))
+ (*MemStore)(unsafe.Pointer(p)).Fsz = iOfst + Sqlite_int64(iAmt)
}
- libc.Xmemcpy(tls, ((*MemStore)(unsafe.Pointer(p)).FaData + uintptr(iOfst)), z, uint32(iAmt))
+ libc.Xmemcpy(tls, (*MemStore)(unsafe.Pointer(p)).FaData+uintptr(iOfst), z, uint32(iAmt))
memdbLeave(tls, p)
return SQLITE_OK
}
@@ -27357,12 +27934,13 @@ func memdbWrite(tls *libc.TLS, pFile uintptr, z uintptr, iAmt int32, iOfst Sqlit
// In rollback mode (which is always the case for memdb, as it does not
// support WAL mode) the truncate() method is only used to reduce
// the size of a file, never to increase the size.
-func memdbTruncate(tls *libc.TLS, pFile uintptr, size Sqlite_int64) int32 { /* sqlite3.c:48850:12: */
+func memdbTruncate(tls *libc.TLS, pFile uintptr, size Sqlite_int64) int32 { /* sqlite3.c:48853:12: */
var p uintptr = (*MemFile)(unsafe.Pointer(pFile)).FpStore
var rc int32 = SQLITE_OK
memdbEnter(tls, p)
if size > (*MemStore)(unsafe.Pointer(p)).Fsz {
- rc = SQLITE_FULL
+ // This can only happen with a corrupt wal mode db
+ rc = SQLITE_CORRUPT
} else {
(*MemStore)(unsafe.Pointer(p)).Fsz = size
}
@@ -27371,14 +27949,14 @@ func memdbTruncate(tls *libc.TLS, pFile uintptr, size Sqlite_int64) int32 { /* s
}
// Sync an memdb-file.
-func memdbSync(tls *libc.TLS, pFile uintptr, flags int32) int32 { /* sqlite3.c:48866:12: */
+func memdbSync(tls *libc.TLS, pFile uintptr, flags int32) int32 { /* sqlite3.c:48870:12: */
_ = pFile
_ = flags
return SQLITE_OK
}
// Return the current file-size of an memdb-file.
-func memdbFileSize(tls *libc.TLS, pFile uintptr, pSize uintptr) int32 { /* sqlite3.c:48875:12: */
+func memdbFileSize(tls *libc.TLS, pFile uintptr, pSize uintptr) int32 { /* sqlite3.c:48879:12: */
var p uintptr = (*MemFile)(unsafe.Pointer(pFile)).FpStore
memdbEnter(tls, p)
*(*Sqlite_int64)(unsafe.Pointer(pSize)) = (*MemStore)(unsafe.Pointer(p)).Fsz
@@ -27387,7 +27965,7 @@ func memdbFileSize(tls *libc.TLS, pFile uintptr, pSize uintptr) int32 { /* sqlit
}
// Lock an memdb-file.
-func memdbLock(tls *libc.TLS, pFile uintptr, eLock int32) int32 { /* sqlite3.c:48886:12: */
+func memdbLock(tls *libc.TLS, pFile uintptr, eLock int32) int32 { /* sqlite3.c:48890:12: */
var pThis uintptr = pFile
var p uintptr = (*MemFile)(unsafe.Pointer(pThis)).FpStore
var rc int32 = SQLITE_OK
@@ -27396,7 +27974,7 @@ func memdbLock(tls *libc.TLS, pFile uintptr, eLock int32) int32 { /* sqlite3.c:4
}
memdbEnter(tls, p)
if eLock > SQLITE_LOCK_SHARED {
- if ((*MemStore)(unsafe.Pointer(p)).FmFlags & uint32(SQLITE_DESERIALIZE_READONLY)) != 0 {
+ if (*MemStore)(unsafe.Pointer(p)).FmFlags&uint32(SQLITE_DESERIALIZE_READONLY) != 0 {
rc = SQLITE_READONLY
} else if (*MemFile)(unsafe.Pointer(pThis)).FeLock <= SQLITE_LOCK_SHARED {
if (*MemStore)(unsafe.Pointer(p)).FnWrLock != 0 {
@@ -27431,7 +28009,7 @@ func memdbLock(tls *libc.TLS, pFile uintptr, eLock int32) int32 { /* sqlite3.c:4
}
// File control method. For custom operations on an memdb-file.
-func memdbFileControl(tls *libc.TLS, pFile uintptr, op int32, pArg uintptr) int32 { /* sqlite3.c:48940:12: */
+func memdbFileControl(tls *libc.TLS, pFile uintptr, op int32, pArg uintptr) int32 { /* sqlite3.c:48944:12: */
bp := tls.Alloc(16)
defer tls.Free(16)
@@ -27439,7 +28017,7 @@ func memdbFileControl(tls *libc.TLS, pFile uintptr, op int32, pArg uintptr) int3
var rc int32 = SQLITE_NOTFOUND
memdbEnter(tls, p)
if op == SQLITE_FCNTL_VFSNAME {
- *(*uintptr)(unsafe.Pointer(pArg)) = Xsqlite3_mprintf(tls, ts+2968 /* "memdb(%p,%lld)" */, libc.VaList(bp, (*MemStore)(unsafe.Pointer(p)).FaData, (*MemStore)(unsafe.Pointer(p)).Fsz))
+ *(*uintptr)(unsafe.Pointer(pArg)) = Xsqlite3_mprintf(tls, ts+3779 /* "memdb(%p,%lld)" */, libc.VaList(bp, (*MemStore)(unsafe.Pointer(p)).FaData, (*MemStore)(unsafe.Pointer(p)).Fsz))
rc = SQLITE_OK
}
if op == SQLITE_FCNTL_SIZE_LIMIT {
@@ -27460,27 +28038,27 @@ func memdbFileControl(tls *libc.TLS, pFile uintptr, op int32, pArg uintptr) int3
}
// Return the device characteristic flags supported by an memdb-file.
-func memdbDeviceCharacteristics(tls *libc.TLS, pFile uintptr) int32 { /* sqlite3.c:48977:12: */
+func memdbDeviceCharacteristics(tls *libc.TLS, pFile uintptr) int32 { /* sqlite3.c:48981:12: */
_ = pFile
- return (((SQLITE_IOCAP_ATOMIC | SQLITE_IOCAP_POWERSAFE_OVERWRITE) | SQLITE_IOCAP_SAFE_APPEND) | SQLITE_IOCAP_SEQUENTIAL)
+ return SQLITE_IOCAP_ATOMIC | SQLITE_IOCAP_POWERSAFE_OVERWRITE | SQLITE_IOCAP_SAFE_APPEND | SQLITE_IOCAP_SEQUENTIAL
}
// Fetch a page of a memory-mapped file
-func memdbFetch(tls *libc.TLS, pFile uintptr, iOfst Sqlite3_int64, iAmt int32, pp uintptr) int32 { /* sqlite3.c:48986:12: */
+func memdbFetch(tls *libc.TLS, pFile uintptr, iOfst Sqlite3_int64, iAmt int32, pp uintptr) int32 { /* sqlite3.c:48990:12: */
var p uintptr = (*MemFile)(unsafe.Pointer(pFile)).FpStore
memdbEnter(tls, p)
- if (iOfst + Sqlite3_int64(iAmt)) > (*MemStore)(unsafe.Pointer(p)).Fsz {
+ if iOfst+Sqlite3_int64(iAmt) > (*MemStore)(unsafe.Pointer(p)).Fsz || (*MemStore)(unsafe.Pointer(p)).FmFlags&uint32(SQLITE_DESERIALIZE_RESIZEABLE) != uint32(0) {
*(*uintptr)(unsafe.Pointer(pp)) = uintptr(0)
} else {
(*MemStore)(unsafe.Pointer(p)).FnMmap++
- *(*uintptr)(unsafe.Pointer(pp)) = ((*MemStore)(unsafe.Pointer(p)).FaData + uintptr(iOfst))
+ *(*uintptr)(unsafe.Pointer(pp)) = (*MemStore)(unsafe.Pointer(p)).FaData + uintptr(iOfst)
}
memdbLeave(tls, p)
return SQLITE_OK
}
// Release a memory-mapped page
-func memdbUnfetch(tls *libc.TLS, pFile uintptr, iOfst Sqlite3_int64, pPage uintptr) int32 { /* sqlite3.c:49005:12: */
+func memdbUnfetch(tls *libc.TLS, pFile uintptr, iOfst Sqlite3_int64, pPage uintptr) int32 { /* sqlite3.c:49009:12: */
var p uintptr = (*MemFile)(unsafe.Pointer(pFile)).FpStore
_ = iOfst
_ = pPage
@@ -27491,18 +28069,15 @@ func memdbUnfetch(tls *libc.TLS, pFile uintptr, iOfst Sqlite3_int64, pPage uintp
}
// Open an mem file handle.
-func memdbOpen(tls *libc.TLS, pVfs uintptr, zName uintptr, pFd uintptr, flags int32, pOutFlags uintptr) int32 { /* sqlite3.c:49018:12: */
+func memdbOpen(tls *libc.TLS, pVfs uintptr, zName uintptr, pFd uintptr, flags int32, pOutFlags uintptr) int32 { /* sqlite3.c:49022:12: */
var pFile uintptr = pFd
var p uintptr = uintptr(0)
var szName int32
- if (flags & SQLITE_OPEN_MAIN_DB) == 0 {
- return (*struct {
- f func(*libc.TLS, uintptr, uintptr, uintptr, int32, uintptr) int32
- })(unsafe.Pointer(&struct{ uintptr }{(*Sqlite3_vfs)(unsafe.Pointer(((*Sqlite3_vfs)(unsafe.Pointer(pVfs)).FpAppData))).FxOpen})).f(tls, (*Sqlite3_vfs)(unsafe.Pointer(pVfs)).FpAppData, zName, pFd, flags, pOutFlags)
- }
- libc.Xmemset(tls, pFile, 0, uint32(unsafe.Sizeof(MemStore{})))
+ _ = pVfs
+
+ libc.Xmemset(tls, pFile, 0, uint32(unsafe.Sizeof(MemFile{})))
szName = Xsqlite3Strlen30(tls, zName)
- if (szName > 1) && (int32(*(*uint8)(unsafe.Pointer(zName))) == '/') {
+ if szName > 1 && int32(*(*uint8)(unsafe.Pointer(zName))) == '/' {
var i int32
var pVfsMutex uintptr = Xsqlite3MutexAlloc(tls, SQLITE_MUTEX_STATIC_VFS1)
Xsqlite3_mutex_enter(tls, pVfsMutex)
@@ -27514,13 +28089,13 @@ func memdbOpen(tls *libc.TLS, pVfs uintptr, zName uintptr, pFd uintptr, flags in
}
if p == uintptr(0) {
var apNew uintptr
- p = Xsqlite3Malloc(tls, (uint64((uint32(unsafe.Sizeof(MemStore{})) + uint32(szName)) + uint32(3))))
+ p = Xsqlite3Malloc(tls, uint64(uint32(unsafe.Sizeof(MemStore{}))+uint32(szName)+uint32(3)))
if p == uintptr(0) {
Xsqlite3_mutex_leave(tls, pVfsMutex)
return SQLITE_NOMEM
}
apNew = Xsqlite3Realloc(tls, memdb_g.FapMemStore,
- (uint64(uint32(unsafe.Sizeof(uintptr(0))) * (uint32(memdb_g.FnMemStore + 1)))))
+ uint64(uint32(unsafe.Sizeof(uintptr(0)))*uint32(memdb_g.FnMemStore+1)))
if apNew == uintptr(0) {
Xsqlite3_free(tls, p)
Xsqlite3_mutex_leave(tls, pVfsMutex)
@@ -27529,10 +28104,10 @@ func memdbOpen(tls *libc.TLS, pVfs uintptr, zName uintptr, pFd uintptr, flags in
*(*uintptr)(unsafe.Pointer(apNew + uintptr(libc.PostIncInt32(&memdb_g.FnMemStore, 1))*4)) = p
memdb_g.FapMemStore = apNew
libc.Xmemset(tls, p, 0, uint32(unsafe.Sizeof(MemStore{})))
- (*MemStore)(unsafe.Pointer(p)).FmFlags = (uint32(SQLITE_DESERIALIZE_RESIZEABLE | SQLITE_DESERIALIZE_FREEONCLOSE))
+ (*MemStore)(unsafe.Pointer(p)).FmFlags = uint32(SQLITE_DESERIALIZE_RESIZEABLE | SQLITE_DESERIALIZE_FREEONCLOSE)
(*MemStore)(unsafe.Pointer(p)).FszMax = Xsqlite3Config.FmxMemdbSize
- (*MemStore)(unsafe.Pointer(p)).FzFName = (p + 1*56)
- libc.Xmemcpy(tls, (*MemStore)(unsafe.Pointer(p)).FzFName, zName, (uint32(szName + 1)))
+ (*MemStore)(unsafe.Pointer(p)).FzFName = p + 1*56
+ libc.Xmemcpy(tls, (*MemStore)(unsafe.Pointer(p)).FzFName, zName, uint32(szName+1))
(*MemStore)(unsafe.Pointer(p)).FpMutex = Xsqlite3_mutex_alloc(tls, SQLITE_MUTEX_FAST)
if (*MemStore)(unsafe.Pointer(p)).FpMutex == uintptr(0) {
memdb_g.FnMemStore--
@@ -27553,12 +28128,13 @@ func memdbOpen(tls *libc.TLS, pVfs uintptr, zName uintptr, pFd uintptr, flags in
return SQLITE_NOMEM
}
libc.Xmemset(tls, p, 0, uint32(unsafe.Sizeof(MemStore{})))
- (*MemStore)(unsafe.Pointer(p)).FmFlags = (uint32(SQLITE_DESERIALIZE_RESIZEABLE | SQLITE_DESERIALIZE_FREEONCLOSE))
+ (*MemStore)(unsafe.Pointer(p)).FmFlags = uint32(SQLITE_DESERIALIZE_RESIZEABLE | SQLITE_DESERIALIZE_FREEONCLOSE)
(*MemStore)(unsafe.Pointer(p)).FszMax = Xsqlite3Config.FmxMemdbSize
}
(*MemFile)(unsafe.Pointer(pFile)).FpStore = p
- // True because flags==SQLITE_OPEN_MAIN_DB
- *(*int32)(unsafe.Pointer(pOutFlags)) = (flags | SQLITE_OPEN_MEMORY)
+ if pOutFlags != uintptr(0) {
+ *(*int32)(unsafe.Pointer(pOutFlags)) = flags | SQLITE_OPEN_MEMORY
+ }
(*Sqlite3_file)(unsafe.Pointer(pFd)).FpMethods = uintptr(unsafe.Pointer(&memdb_io_methods))
memdbLeave(tls, p)
return SQLITE_OK
@@ -27568,7 +28144,7 @@ func memdbOpen(tls *libc.TLS, pVfs uintptr, zName uintptr, pFd uintptr, flags in
// is available, or false otherwise.
//
// With memdb, no files ever exist on disk. So always return false.
-func memdbAccess(tls *libc.TLS, pVfs uintptr, zPath uintptr, flags int32, pResOut uintptr) int32 { /* sqlite3.c:49115:12: */
+func memdbAccess(tls *libc.TLS, pVfs uintptr, zPath uintptr, flags int32, pResOut uintptr) int32 { /* sqlite3.c:49119:12: */
_ = pVfs
_ = zPath
_ = flags
@@ -27579,76 +28155,76 @@ func memdbAccess(tls *libc.TLS, pVfs uintptr, zPath uintptr, flags int32, pResOu
// Populate buffer zOut with the full canonical pathname corresponding
// to the pathname in zPath. zOut is guaranteed to point to a buffer
// of at least (INST_MAX_PATHNAME+1) bytes.
-func memdbFullPathname(tls *libc.TLS, pVfs uintptr, zPath uintptr, nOut int32, zOut uintptr) int32 { /* sqlite3.c:49133:12: */
+func memdbFullPathname(tls *libc.TLS, pVfs uintptr, zPath uintptr, nOut int32, zOut uintptr) int32 { /* sqlite3.c:49137:12: */
bp := tls.Alloc(8)
defer tls.Free(8)
_ = pVfs
- Xsqlite3_snprintf(tls, nOut, zOut, ts+2790 /* "%s" */, libc.VaList(bp, zPath))
+ Xsqlite3_snprintf(tls, nOut, zOut, ts+3601 /* "%s" */, libc.VaList(bp, zPath))
return SQLITE_OK
}
// Open the dynamic library located at zPath and return a handle.
-func memdbDlOpen(tls *libc.TLS, pVfs uintptr, zPath uintptr) uintptr { /* sqlite3.c:49147:13: */
+func memdbDlOpen(tls *libc.TLS, pVfs uintptr, zPath uintptr) uintptr { /* sqlite3.c:49151:13: */
return (*struct {
f func(*libc.TLS, uintptr, uintptr) uintptr
- })(unsafe.Pointer(&struct{ uintptr }{(*Sqlite3_vfs)(unsafe.Pointer(((*Sqlite3_vfs)(unsafe.Pointer(pVfs)).FpAppData))).FxDlOpen})).f(tls, (*Sqlite3_vfs)(unsafe.Pointer(pVfs)).FpAppData, zPath)
+ })(unsafe.Pointer(&struct{ uintptr }{(*Sqlite3_vfs)(unsafe.Pointer((*Sqlite3_vfs)(unsafe.Pointer(pVfs)).FpAppData)).FxDlOpen})).f(tls, (*Sqlite3_vfs)(unsafe.Pointer(pVfs)).FpAppData, zPath)
}
// Populate the buffer zErrMsg (size nByte bytes) with a human readable
// utf-8 string describing the most recent error encountered associated
// with dynamic libraries.
-func memdbDlError(tls *libc.TLS, pVfs uintptr, nByte int32, zErrMsg uintptr) { /* sqlite3.c:49156:13: */
+func memdbDlError(tls *libc.TLS, pVfs uintptr, nByte int32, zErrMsg uintptr) { /* sqlite3.c:49160:13: */
(*struct {
f func(*libc.TLS, uintptr, int32, uintptr)
- })(unsafe.Pointer(&struct{ uintptr }{(*Sqlite3_vfs)(unsafe.Pointer(((*Sqlite3_vfs)(unsafe.Pointer(pVfs)).FpAppData))).FxDlError})).f(tls, (*Sqlite3_vfs)(unsafe.Pointer(pVfs)).FpAppData, nByte, zErrMsg)
+ })(unsafe.Pointer(&struct{ uintptr }{(*Sqlite3_vfs)(unsafe.Pointer((*Sqlite3_vfs)(unsafe.Pointer(pVfs)).FpAppData)).FxDlError})).f(tls, (*Sqlite3_vfs)(unsafe.Pointer(pVfs)).FpAppData, nByte, zErrMsg)
}
// Return a pointer to the symbol zSymbol in the dynamic library pHandle.
-func memdbDlSym(tls *libc.TLS, pVfs uintptr, p uintptr, zSym uintptr) uintptr { /* sqlite3.c:49163:13: */
+func memdbDlSym(tls *libc.TLS, pVfs uintptr, p uintptr, zSym uintptr) uintptr { /* sqlite3.c:49167:13: */
return (*struct {
f func(*libc.TLS, uintptr, uintptr, uintptr) uintptr
- })(unsafe.Pointer(&struct{ uintptr }{(*Sqlite3_vfs)(unsafe.Pointer(((*Sqlite3_vfs)(unsafe.Pointer(pVfs)).FpAppData))).FxDlSym})).f(tls, (*Sqlite3_vfs)(unsafe.Pointer(pVfs)).FpAppData, p, zSym)
+ })(unsafe.Pointer(&struct{ uintptr }{(*Sqlite3_vfs)(unsafe.Pointer((*Sqlite3_vfs)(unsafe.Pointer(pVfs)).FpAppData)).FxDlSym})).f(tls, (*Sqlite3_vfs)(unsafe.Pointer(pVfs)).FpAppData, p, zSym)
}
// Close the dynamic library handle pHandle.
-func memdbDlClose(tls *libc.TLS, pVfs uintptr, pHandle uintptr) { /* sqlite3.c:49170:13: */
+func memdbDlClose(tls *libc.TLS, pVfs uintptr, pHandle uintptr) { /* sqlite3.c:49174:13: */
(*struct {
f func(*libc.TLS, uintptr, uintptr)
- })(unsafe.Pointer(&struct{ uintptr }{(*Sqlite3_vfs)(unsafe.Pointer(((*Sqlite3_vfs)(unsafe.Pointer(pVfs)).FpAppData))).FxDlClose})).f(tls, (*Sqlite3_vfs)(unsafe.Pointer(pVfs)).FpAppData, pHandle)
+ })(unsafe.Pointer(&struct{ uintptr }{(*Sqlite3_vfs)(unsafe.Pointer((*Sqlite3_vfs)(unsafe.Pointer(pVfs)).FpAppData)).FxDlClose})).f(tls, (*Sqlite3_vfs)(unsafe.Pointer(pVfs)).FpAppData, pHandle)
}
// Populate the buffer pointed to by zBufOut with nByte bytes of
// random data.
-func memdbRandomness(tls *libc.TLS, pVfs uintptr, nByte int32, zBufOut uintptr) int32 { /* sqlite3.c:49178:12: */
+func memdbRandomness(tls *libc.TLS, pVfs uintptr, nByte int32, zBufOut uintptr) int32 { /* sqlite3.c:49182:12: */
return (*struct {
f func(*libc.TLS, uintptr, int32, uintptr) int32
- })(unsafe.Pointer(&struct{ uintptr }{(*Sqlite3_vfs)(unsafe.Pointer(((*Sqlite3_vfs)(unsafe.Pointer(pVfs)).FpAppData))).FxRandomness})).f(tls, (*Sqlite3_vfs)(unsafe.Pointer(pVfs)).FpAppData, nByte, zBufOut)
+ })(unsafe.Pointer(&struct{ uintptr }{(*Sqlite3_vfs)(unsafe.Pointer((*Sqlite3_vfs)(unsafe.Pointer(pVfs)).FpAppData)).FxRandomness})).f(tls, (*Sqlite3_vfs)(unsafe.Pointer(pVfs)).FpAppData, nByte, zBufOut)
}
// Sleep for nMicro microseconds. Return the number of microseconds
// actually slept.
-func memdbSleep(tls *libc.TLS, pVfs uintptr, nMicro int32) int32 { /* sqlite3.c:49186:12: */
+func memdbSleep(tls *libc.TLS, pVfs uintptr, nMicro int32) int32 { /* sqlite3.c:49190:12: */
return (*struct {
f func(*libc.TLS, uintptr, int32) int32
- })(unsafe.Pointer(&struct{ uintptr }{(*Sqlite3_vfs)(unsafe.Pointer(((*Sqlite3_vfs)(unsafe.Pointer(pVfs)).FpAppData))).FxSleep})).f(tls, (*Sqlite3_vfs)(unsafe.Pointer(pVfs)).FpAppData, nMicro)
+ })(unsafe.Pointer(&struct{ uintptr }{(*Sqlite3_vfs)(unsafe.Pointer((*Sqlite3_vfs)(unsafe.Pointer(pVfs)).FpAppData)).FxSleep})).f(tls, (*Sqlite3_vfs)(unsafe.Pointer(pVfs)).FpAppData, nMicro)
}
-func memdbGetLastError(tls *libc.TLS, pVfs uintptr, a int32, b uintptr) int32 { /* sqlite3.c:49199:12: */
+func memdbGetLastError(tls *libc.TLS, pVfs uintptr, a int32, b uintptr) int32 { /* sqlite3.c:49203:12: */
return (*struct {
f func(*libc.TLS, uintptr, int32, uintptr) int32
- })(unsafe.Pointer(&struct{ uintptr }{(*Sqlite3_vfs)(unsafe.Pointer(((*Sqlite3_vfs)(unsafe.Pointer(pVfs)).FpAppData))).FxGetLastError})).f(tls, (*Sqlite3_vfs)(unsafe.Pointer(pVfs)).FpAppData, a, b)
+ })(unsafe.Pointer(&struct{ uintptr }{(*Sqlite3_vfs)(unsafe.Pointer((*Sqlite3_vfs)(unsafe.Pointer(pVfs)).FpAppData)).FxGetLastError})).f(tls, (*Sqlite3_vfs)(unsafe.Pointer(pVfs)).FpAppData, a, b)
}
-func memdbCurrentTimeInt64(tls *libc.TLS, pVfs uintptr, p uintptr) int32 { /* sqlite3.c:49202:12: */
+func memdbCurrentTimeInt64(tls *libc.TLS, pVfs uintptr, p uintptr) int32 { /* sqlite3.c:49206:12: */
return (*struct {
f func(*libc.TLS, uintptr, uintptr) int32
- })(unsafe.Pointer(&struct{ uintptr }{(*Sqlite3_vfs)(unsafe.Pointer(((*Sqlite3_vfs)(unsafe.Pointer(pVfs)).FpAppData))).FxCurrentTimeInt64})).f(tls, (*Sqlite3_vfs)(unsafe.Pointer(pVfs)).FpAppData, p)
+ })(unsafe.Pointer(&struct{ uintptr }{(*Sqlite3_vfs)(unsafe.Pointer((*Sqlite3_vfs)(unsafe.Pointer(pVfs)).FpAppData)).FxCurrentTimeInt64})).f(tls, (*Sqlite3_vfs)(unsafe.Pointer(pVfs)).FpAppData, p)
}
// Translate a database connection pointer and schema name into a
// MemFile pointer.
-func memdbFromDbSchema(tls *libc.TLS, db uintptr, zSchema uintptr) uintptr { /* sqlite3.c:49210:16: */
+func memdbFromDbSchema(tls *libc.TLS, db uintptr, zSchema uintptr) uintptr { /* sqlite3.c:49214:16: */
bp := tls.Alloc(4)
defer tls.Free(4)
@@ -27658,7 +28234,7 @@ func memdbFromDbSchema(tls *libc.TLS, db uintptr, zSchema uintptr) uintptr { /*
if rc != 0 {
return uintptr(0)
}
- if (*MemFile)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* p */)))).Fbase.FpMethods != uintptr(unsafe.Pointer(&memdb_io_methods)) {
+ if (*MemFile)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).Fbase.FpMethods != uintptr(unsafe.Pointer(&memdb_io_methods)) {
return uintptr(0)
}
pStore = (*MemFile)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* p */)))).FpStore
@@ -27671,7 +28247,7 @@ func memdbFromDbSchema(tls *libc.TLS, db uintptr, zSchema uintptr) uintptr { /*
}
// Return the serialization of a database
-func Xsqlite3_serialize(tls *libc.TLS, db uintptr, zSchema uintptr, piSize uintptr, mFlags uint32) uintptr { /* sqlite3.c:49226:26: */
+func Xsqlite3_serialize(tls *libc.TLS, db uintptr, zSchema uintptr, piSize uintptr, mFlags uint32) uintptr { /* sqlite3.c:49230:26: */
bp := tls.Alloc(16)
defer tls.Free(16)
@@ -27702,7 +28278,7 @@ func Xsqlite3_serialize(tls *libc.TLS, db uintptr, zSchema uintptr, piSize uintp
if piSize != 0 {
*(*Sqlite3_int64)(unsafe.Pointer(piSize)) = (*MemStore)(unsafe.Pointer(pStore)).Fsz
}
- if (mFlags & uint32(SQLITE_SERIALIZE_NOCOPY)) != 0 {
+ if mFlags&uint32(SQLITE_SERIALIZE_NOCOPY) != 0 {
pOut = (*MemStore)(unsafe.Pointer(pStore)).FaData
} else {
pOut = Xsqlite3_malloc64(tls, uint64((*MemStore)(unsafe.Pointer(pStore)).Fsz))
@@ -27717,7 +28293,7 @@ func Xsqlite3_serialize(tls *libc.TLS, db uintptr, zSchema uintptr, piSize uintp
return uintptr(0)
}
szPage = Xsqlite3BtreeGetPageSize(tls, pBt)
- zSql = Xsqlite3_mprintf(tls, ts+2983 /* "PRAGMA \"%w\".page..." */, libc.VaList(bp, zSchema))
+ zSql = Xsqlite3_mprintf(tls, ts+3794 /* "PRAGMA \"%w\".page..." */, libc.VaList(bp, zSchema))
if zSql != 0 {
rc = Xsqlite3_prepare_v2(tls, db, zSql, -1, bp+8 /* &pStmt */, uintptr(0))
} else {
@@ -27731,11 +28307,11 @@ func Xsqlite3_serialize(tls *libc.TLS, db uintptr, zSchema uintptr, piSize uintp
if rc != SQLITE_ROW {
pOut = uintptr(0)
} else {
- sz = (Xsqlite3_column_int64(tls, *(*uintptr)(unsafe.Pointer(bp + 8 /* pStmt */)), 0) * Sqlite_int64(szPage))
+ sz = Xsqlite3_column_int64(tls, *(*uintptr)(unsafe.Pointer(bp + 8)), 0) * Sqlite_int64(szPage)
if piSize != 0 {
*(*Sqlite3_int64)(unsafe.Pointer(piSize)) = sz
}
- if (mFlags & uint32(SQLITE_SERIALIZE_NOCOPY)) != 0 {
+ if mFlags&uint32(SQLITE_SERIALIZE_NOCOPY) != 0 {
pOut = uintptr(0)
} else {
pOut = Xsqlite3_malloc64(tls, uint64(sz))
@@ -27745,7 +28321,7 @@ func Xsqlite3_serialize(tls *libc.TLS, db uintptr, zSchema uintptr, piSize uintp
var pgno int32
for pgno = 1; pgno <= nPage; pgno++ {
*(*uintptr)(unsafe.Pointer(bp + 12 /* pPage */)) = uintptr(0)
- var pTo uintptr = (pOut + uintptr((Sqlite3_int64(szPage) * (Sqlite3_int64(pgno - 1)))))
+ var pTo uintptr = pOut + uintptr(Sqlite3_int64(szPage)*Sqlite3_int64(pgno-1))
rc = Xsqlite3PagerGet(tls, pPager, uint32(pgno), bp+12 /* &pPage */, 0)
if rc == SQLITE_OK {
libc.Xmemcpy(tls, pTo, Xsqlite3PagerGetData(tls, *(*uintptr)(unsafe.Pointer(bp + 12 /* pPage */))), uint32(szPage))
@@ -27762,7 +28338,7 @@ func Xsqlite3_serialize(tls *libc.TLS, db uintptr, zSchema uintptr, piSize uintp
}
// Convert zSchema to a MemDB and initialize its content.
-func Xsqlite3_deserialize(tls *libc.TLS, db uintptr, zSchema uintptr, pData uintptr, szDb Sqlite3_int64, szBuf Sqlite3_int64, mFlags uint32) int32 { /* sqlite3.c:49307:16: */
+func Xsqlite3_deserialize(tls *libc.TLS, db uintptr, zSchema uintptr, pData uintptr, szDb Sqlite3_int64, szBuf Sqlite3_int64, mFlags uint32) int32 { /* sqlite3.c:49311:16: */
bp := tls.Alloc(12)
defer tls.Free(12)
@@ -27783,14 +28359,15 @@ func Xsqlite3_deserialize(tls *libc.TLS, db uintptr, zSchema uintptr, pData uint
__1:
;
iDb = Xsqlite3FindDbName(tls, db, zSchema)
- if !(iDb < 0) {
+
+ if !(iDb < 2 && iDb != 0) {
goto __2
}
rc = SQLITE_ERROR
goto end_deserialize
__2:
;
- zSql = Xsqlite3_mprintf(tls, ts+3006 /* "ATTACH x AS %Q" */, libc.VaList(bp, zSchema))
+ zSql = Xsqlite3_mprintf(tls, ts+3817 /* "ATTACH x AS %Q" */, libc.VaList(bp, zSchema))
if !(zSql == uintptr(0)) {
goto __3
}
@@ -27808,9 +28385,9 @@ __4:
__5:
;
(*Sqlite3)(unsafe.Pointer(db)).Finit.FiDb = U8(iDb)
- libc.SetBitFieldPtr8Uint32(db+164 /* &.init */ +8 /* &.reopenMemdb */, uint32(1), 2, 0x4)
+ libc.SetBitFieldPtr8Uint32(db+172+8, uint32(1), 2, 0x4)
rc = Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp + 8 /* pStmt */)))
- libc.SetBitFieldPtr8Uint32(db+164 /* &.init */ +8 /* &.reopenMemdb */, uint32(0), 2, 0x4)
+ libc.SetBitFieldPtr8Uint32(db+172+8, uint32(0), 2, 0x4)
if !(rc != SQLITE_DONE) {
goto __6
}
@@ -27844,7 +28421,7 @@ __8:
end_deserialize:
Xsqlite3_finalize(tls, *(*uintptr)(unsafe.Pointer(bp + 8 /* pStmt */)))
- if !((pData != 0) && ((mFlags & uint32(SQLITE_DESERIALIZE_FREEONCLOSE)) != uint32(0))) {
+ if !(pData != 0 && mFlags&uint32(SQLITE_DESERIALIZE_FREEONCLOSE) != uint32(0)) {
goto __10
}
Xsqlite3_free(tls, pData)
@@ -27856,7 +28433,7 @@ __10:
// This routine is called when the extension is loaded.
// Register the new VFS.
-func Xsqlite3MemdbInit(tls *libc.TLS) int32 { /* sqlite3.c:49382:20: */
+func Xsqlite3MemdbInit(tls *libc.TLS) int32 { /* sqlite3.c:49387:20: */
var pLower uintptr = Xsqlite3_vfs_find(tls, uintptr(0))
var sz uint32
if pLower == uintptr(0) {
@@ -27868,7 +28445,7 @@ func Xsqlite3MemdbInit(tls *libc.TLS) int32 { /* sqlite3.c:49382:20: */
// Windows x86 and SQLITE_MAX_MMAP_SIZE=0. We always leave
// it in, to be safe, but it is marked as NO_TEST since there
// is no way to reach it under most builds.
- if (sz < uint32(unsafe.Sizeof(MemFile{}))) {
+ if sz < uint32(unsafe.Sizeof(MemFile{})) {
sz = uint32(unsafe.Sizeof(MemFile{}))
} //NO_TEST
memdb_vfs.FszOsFile = int32(sz)
@@ -27878,7 +28455,7 @@ func Xsqlite3MemdbInit(tls *libc.TLS) int32 { /* sqlite3.c:49382:20: */
// Create a new bitmap object able to handle bits between 0 and iSize,
// inclusive. Return a pointer to the new object. Return NULL if
// malloc fails.
-func Xsqlite3BitvecCreate(tls *libc.TLS, iSize U32) uintptr { /* sqlite3.c:49514:23: */
+func Xsqlite3BitvecCreate(tls *libc.TLS, iSize U32) uintptr { /* sqlite3.c:49519:23: */
var p uintptr
p = Xsqlite3MallocZero(tls, uint64(unsafe.Sizeof(Bitvec{})))
@@ -27891,37 +28468,37 @@ func Xsqlite3BitvecCreate(tls *libc.TLS, iSize U32) uintptr { /* sqlite3.c:49514
// Check to see if the i-th bit is set. Return true or false.
// If p is NULL (if the bitmap has not been created) or if
// i is out of range, then return false.
-func Xsqlite3BitvecTestNotNull(tls *libc.TLS, p uintptr, i U32) int32 { /* sqlite3.c:49529:20: */
+func Xsqlite3BitvecTestNotNull(tls *libc.TLS, p uintptr, i U32) int32 { /* sqlite3.c:49534:20: */
i--
if i >= (*Bitvec)(unsafe.Pointer(p)).FiSize {
return 0
}
for (*Bitvec)(unsafe.Pointer(p)).FiDivisor != 0 {
- var bin U32 = (i / (*Bitvec)(unsafe.Pointer(p)).FiDivisor)
- i = (i % (*Bitvec)(unsafe.Pointer(p)).FiDivisor)
- p = *(*uintptr)(unsafe.Pointer((p + 12 /* &.u */ /* &.apSub */) + uintptr(bin)*4))
+ var bin U32 = i / (*Bitvec)(unsafe.Pointer(p)).FiDivisor
+ i = i % (*Bitvec)(unsafe.Pointer(p)).FiDivisor
+ p = *(*uintptr)(unsafe.Pointer(p + 12 + uintptr(bin)*4))
if !(p != 0) {
return 0
}
}
- if (*Bitvec)(unsafe.Pointer(p)).FiSize <= (((((uint32(BITVEC_SZ) - (uint32(3) * uint32(unsafe.Sizeof(U32(0))))) / uint32(unsafe.Sizeof(uintptr(0)))) * uint32(unsafe.Sizeof(uintptr(0)))) / uint32(unsafe.Sizeof(U8(0)))) * uint32(BITVEC_SZELEM)) {
- return (libc.Bool32((int32(*(*U8)(unsafe.Pointer((p + 12 /* &.u */ /* &.aBitmap */) + uintptr((i / U32(BITVEC_SZELEM)))))) & (int32(1) << (i & (U32(BITVEC_SZELEM - 1))))) != 0))
+ if (*Bitvec)(unsafe.Pointer(p)).FiSize <= (uint32(BITVEC_SZ)-uint32(3)*uint32(unsafe.Sizeof(U32(0))))/uint32(unsafe.Sizeof(uintptr(0)))*uint32(unsafe.Sizeof(uintptr(0)))/uint32(unsafe.Sizeof(U8(0)))*uint32(BITVEC_SZELEM) {
+ return libc.Bool32(int32(*(*U8)(unsafe.Pointer(p + 12 + uintptr(i/U32(BITVEC_SZELEM)))))&(int32(1)<<(i&U32(BITVEC_SZELEM-1))) != 0)
} else {
- var h U32 = (((libc.PostIncUint32(&i, 1)) * U32(1)) % ((((uint32(BITVEC_SZ) - (uint32(3) * uint32(unsafe.Sizeof(U32(0))))) / uint32(unsafe.Sizeof(uintptr(0)))) * uint32(unsafe.Sizeof(uintptr(0)))) / uint32(unsafe.Sizeof(U32(0)))))
- for *(*U32)(unsafe.Pointer((p + 12 /* &.u */ /* &.aHash */) + uintptr(h)*4)) != 0 {
- if *(*U32)(unsafe.Pointer((p + 12 /* &.u */ /* &.aHash */) + uintptr(h)*4)) == i {
+ var h U32 = libc.PostIncUint32(&i, 1) * U32(1) % ((uint32(BITVEC_SZ) - uint32(3)*uint32(unsafe.Sizeof(U32(0)))) / uint32(unsafe.Sizeof(uintptr(0))) * uint32(unsafe.Sizeof(uintptr(0))) / uint32(unsafe.Sizeof(U32(0))))
+ for *(*U32)(unsafe.Pointer(p + 12 + uintptr(h)*4)) != 0 {
+ if *(*U32)(unsafe.Pointer(p + 12 + uintptr(h)*4)) == i {
return 1
}
- h = ((h + U32(1)) % ((((uint32(BITVEC_SZ) - (uint32(3) * uint32(unsafe.Sizeof(U32(0))))) / uint32(unsafe.Sizeof(uintptr(0)))) * uint32(unsafe.Sizeof(uintptr(0)))) / uint32(unsafe.Sizeof(U32(0)))))
+ h = (h + U32(1)) % ((uint32(BITVEC_SZ) - uint32(3)*uint32(unsafe.Sizeof(U32(0)))) / uint32(unsafe.Sizeof(uintptr(0))) * uint32(unsafe.Sizeof(uintptr(0))) / uint32(unsafe.Sizeof(U32(0))))
}
return 0
}
return int32(0)
}
-func Xsqlite3BitvecTest(tls *libc.TLS, p uintptr, i U32) int32 { /* sqlite3.c:49552:20: */
- return (libc.Bool32((p != uintptr(0)) && (Xsqlite3BitvecTestNotNull(tls, p, i) != 0)))
+func Xsqlite3BitvecTest(tls *libc.TLS, p uintptr, i U32) int32 { /* sqlite3.c:49557:20: */
+ return libc.Bool32(p != uintptr(0) && Xsqlite3BitvecTestNotNull(tls, p, i) != 0)
}
// Set the i-th bit. Return 0 on success and an error code if
@@ -27934,7 +28511,7 @@ func Xsqlite3BitvecTest(tls *libc.TLS, p uintptr, i U32) int32 { /* sqlite3.c:49
// The calling function must ensure that p is a valid Bitvec object
// and that the value for "i" is within range of the Bitvec object.
// Otherwise the behavior is undefined.
-func Xsqlite3BitvecSet(tls *libc.TLS, p uintptr, i U32) int32 { /* sqlite3.c:49568:20: */
+func Xsqlite3BitvecSet(tls *libc.TLS, p uintptr, i U32) int32 { /* sqlite3.c:49573:20: */
var h U32
var bin U32
var j uint32
@@ -27949,16 +28526,16 @@ __1:
i--
__2:
- if !(((*Bitvec)(unsafe.Pointer(p)).FiSize > (((((uint32(BITVEC_SZ) - (uint32(3) * uint32(unsafe.Sizeof(U32(0))))) / uint32(unsafe.Sizeof(uintptr(0)))) * uint32(unsafe.Sizeof(uintptr(0)))) / uint32(unsafe.Sizeof(U8(0)))) * uint32(BITVEC_SZELEM))) && ((*Bitvec)(unsafe.Pointer(p)).FiDivisor != 0)) {
+ if !((*Bitvec)(unsafe.Pointer(p)).FiSize > (uint32(BITVEC_SZ)-uint32(3)*uint32(unsafe.Sizeof(U32(0))))/uint32(unsafe.Sizeof(uintptr(0)))*uint32(unsafe.Sizeof(uintptr(0)))/uint32(unsafe.Sizeof(U8(0)))*uint32(BITVEC_SZELEM) && (*Bitvec)(unsafe.Pointer(p)).FiDivisor != 0) {
goto __3
}
- bin = (i / (*Bitvec)(unsafe.Pointer(p)).FiDivisor)
- i = (i % (*Bitvec)(unsafe.Pointer(p)).FiDivisor)
- if !(*(*uintptr)(unsafe.Pointer((p + 12 /* &.u */ /* &.apSub */) + uintptr(bin)*4)) == uintptr(0)) {
+ bin = i / (*Bitvec)(unsafe.Pointer(p)).FiDivisor
+ i = i % (*Bitvec)(unsafe.Pointer(p)).FiDivisor
+ if !(*(*uintptr)(unsafe.Pointer(p + 12 + uintptr(bin)*4)) == uintptr(0)) {
goto __4
}
- *(*uintptr)(unsafe.Pointer((p + 12 /* &.u */ /* &.apSub */) + uintptr(bin)*4)) = Xsqlite3BitvecCreate(tls, (*Bitvec)(unsafe.Pointer(p)).FiDivisor)
- if !(*(*uintptr)(unsafe.Pointer((p + 12 /* &.u */ /* &.apSub */) + uintptr(bin)*4)) == uintptr(0)) {
+ *(*uintptr)(unsafe.Pointer(p + 12 + uintptr(bin)*4)) = Xsqlite3BitvecCreate(tls, (*Bitvec)(unsafe.Pointer(p)).FiDivisor)
+ if !(*(*uintptr)(unsafe.Pointer(p + 12 + uintptr(bin)*4)) == uintptr(0)) {
goto __5
}
return SQLITE_NOMEM
@@ -27966,25 +28543,25 @@ __5:
;
__4:
;
- p = *(*uintptr)(unsafe.Pointer((p + 12 /* &.u */ /* &.apSub */) + uintptr(bin)*4))
+ p = *(*uintptr)(unsafe.Pointer(p + 12 + uintptr(bin)*4))
goto __2
__3:
;
- if !((*Bitvec)(unsafe.Pointer(p)).FiSize <= (((((uint32(BITVEC_SZ) - (uint32(3) * uint32(unsafe.Sizeof(U32(0))))) / uint32(unsafe.Sizeof(uintptr(0)))) * uint32(unsafe.Sizeof(uintptr(0)))) / uint32(unsafe.Sizeof(U8(0)))) * uint32(BITVEC_SZELEM))) {
+ if !((*Bitvec)(unsafe.Pointer(p)).FiSize <= (uint32(BITVEC_SZ)-uint32(3)*uint32(unsafe.Sizeof(U32(0))))/uint32(unsafe.Sizeof(uintptr(0)))*uint32(unsafe.Sizeof(uintptr(0)))/uint32(unsafe.Sizeof(U8(0)))*uint32(BITVEC_SZELEM)) {
goto __6
}
- *(*U8)(unsafe.Pointer((p + 12 /* &.u */ /* &.aBitmap */) + uintptr((i / U32(BITVEC_SZELEM))))) |= U8((int32(1) << (i & (U32(BITVEC_SZELEM - 1)))))
+ *(*U8)(unsafe.Pointer(p + 12 + uintptr(i/U32(BITVEC_SZELEM)))) |= U8(int32(1) << (i & U32(BITVEC_SZELEM-1)))
return SQLITE_OK
__6:
;
- h = (((libc.PostIncUint32(&i, 1)) * U32(1)) % ((((uint32(BITVEC_SZ) - (uint32(3) * uint32(unsafe.Sizeof(U32(0))))) / uint32(unsafe.Sizeof(uintptr(0)))) * uint32(unsafe.Sizeof(uintptr(0)))) / uint32(unsafe.Sizeof(U32(0)))))
+ h = libc.PostIncUint32(&i, 1) * U32(1) % ((uint32(BITVEC_SZ) - uint32(3)*uint32(unsafe.Sizeof(U32(0)))) / uint32(unsafe.Sizeof(uintptr(0))) * uint32(unsafe.Sizeof(uintptr(0))) / uint32(unsafe.Sizeof(U32(0))))
// if there wasn't a hash collision, and this doesn't
// completely fill the hash, then just add it without
// worring about sub-dividing and re-hashing.
- if !(!(int32(*(*U32)(unsafe.Pointer((p + 12 /* &.u */ /* &.aHash */) + uintptr(h)*4))) != 0)) {
+ if !!(int32(*(*U32)(unsafe.Pointer(p + 12 + uintptr(h)*4))) != 0) {
goto __7
}
- if !((*Bitvec)(unsafe.Pointer(p)).FnSet < (((((uint32(BITVEC_SZ) - (uint32(3) * uint32(unsafe.Sizeof(U32(0))))) / uint32(unsafe.Sizeof(uintptr(0)))) * uint32(unsafe.Sizeof(uintptr(0)))) / uint32(unsafe.Sizeof(U32(0)))) - uint32(1))) {
+ if !((*Bitvec)(unsafe.Pointer(p)).FnSet < (uint32(BITVEC_SZ)-uint32(3)*uint32(unsafe.Sizeof(U32(0))))/uint32(unsafe.Sizeof(uintptr(0)))*uint32(unsafe.Sizeof(uintptr(0)))/uint32(unsafe.Sizeof(U32(0)))-uint32(1)) {
goto __8
}
goto bitvec_set_end
@@ -27998,14 +28575,14 @@ __7:
// there was a collision, check to see if it's already
// in hash, if not, try to find a spot for it
__10:
- if !(*(*U32)(unsafe.Pointer((p + 12 /* &.u */ /* &.aHash */) + uintptr(h)*4)) == i) {
+ if !(*(*U32)(unsafe.Pointer(p + 12 + uintptr(h)*4)) == i) {
goto __13
}
return SQLITE_OK
__13:
;
h++
- if !(h >= ((((uint32(BITVEC_SZ) - (uint32(3) * uint32(unsafe.Sizeof(U32(0))))) / uint32(unsafe.Sizeof(uintptr(0)))) * uint32(unsafe.Sizeof(uintptr(0)))) / uint32(unsafe.Sizeof(U32(0))))) {
+ if !(h >= (uint32(BITVEC_SZ)-uint32(3)*uint32(unsafe.Sizeof(U32(0))))/uint32(unsafe.Sizeof(uintptr(0)))*uint32(unsafe.Sizeof(uintptr(0)))/uint32(unsafe.Sizeof(U32(0)))) {
goto __14
}
h = U32(0)
@@ -28013,7 +28590,7 @@ __14:
;
goto __11
__11:
- if *(*U32)(unsafe.Pointer((p + 12 /* &.u */ /* &.aHash */) + uintptr(h)*4)) != 0 {
+ if *(*U32)(unsafe.Pointer(p + 12 + uintptr(h)*4)) != 0 {
goto __10
}
goto __12
@@ -28023,7 +28600,7 @@ __12:
// available free spot. check to see if this is going to
// make our hash too "full".
bitvec_set_rehash:
- if !((*Bitvec)(unsafe.Pointer(p)).FnSet >= (((((uint32(BITVEC_SZ) - (uint32(3) * uint32(unsafe.Sizeof(U32(0))))) / uint32(unsafe.Sizeof(uintptr(0)))) * uint32(unsafe.Sizeof(uintptr(0)))) / uint32(unsafe.Sizeof(U32(0)))) / uint32(2))) {
+ if !((*Bitvec)(unsafe.Pointer(p)).FnSet >= (uint32(BITVEC_SZ)-uint32(3)*uint32(unsafe.Sizeof(U32(0))))/uint32(unsafe.Sizeof(uintptr(0)))*uint32(unsafe.Sizeof(uintptr(0)))/uint32(unsafe.Sizeof(U32(0)))/uint32(2)) {
goto __15
}
aiValues = Xsqlite3DbMallocRaw(tls, uintptr(0), uint64(unsafe.Sizeof([125]U32{})))
@@ -28033,19 +28610,19 @@ bitvec_set_rehash:
return SQLITE_NOMEM
goto __17
__16:
- libc.Xmemcpy(tls, aiValues, p+12 /* &.u */ /* &.aHash */, uint32(unsafe.Sizeof([125]U32{})))
- libc.Xmemset(tls, p+12 /* &.u */ /* &.apSub */, 0, uint32(unsafe.Sizeof([125]uintptr{})))
- (*Bitvec)(unsafe.Pointer(p)).FiDivisor = ((((*Bitvec)(unsafe.Pointer(p)).FiSize + ((((uint32(BITVEC_SZ) - (uint32(3) * uint32(unsafe.Sizeof(U32(0))))) / uint32(unsafe.Sizeof(uintptr(0)))) * uint32(unsafe.Sizeof(uintptr(0)))) / uint32(unsafe.Sizeof(uintptr(0))))) - U32(1)) / ((((uint32(BITVEC_SZ) - (uint32(3) * uint32(unsafe.Sizeof(U32(0))))) / uint32(unsafe.Sizeof(uintptr(0)))) * uint32(unsafe.Sizeof(uintptr(0)))) / uint32(unsafe.Sizeof(uintptr(0)))))
+ libc.Xmemcpy(tls, aiValues, p+12, uint32(unsafe.Sizeof([125]U32{})))
+ libc.Xmemset(tls, p+12, 0, uint32(unsafe.Sizeof([125]uintptr{})))
+ (*Bitvec)(unsafe.Pointer(p)).FiDivisor = ((*Bitvec)(unsafe.Pointer(p)).FiSize + (uint32(BITVEC_SZ)-uint32(3)*uint32(unsafe.Sizeof(U32(0))))/uint32(unsafe.Sizeof(uintptr(0)))*uint32(unsafe.Sizeof(uintptr(0)))/uint32(unsafe.Sizeof(uintptr(0))) - U32(1)) / ((uint32(BITVEC_SZ) - uint32(3)*uint32(unsafe.Sizeof(U32(0)))) / uint32(unsafe.Sizeof(uintptr(0))) * uint32(unsafe.Sizeof(uintptr(0))) / uint32(unsafe.Sizeof(uintptr(0))))
rc = Xsqlite3BitvecSet(tls, p, i)
j = uint32(0)
__18:
- if !(j < ((((uint32(BITVEC_SZ) - (uint32(3) * uint32(unsafe.Sizeof(U32(0))))) / uint32(unsafe.Sizeof(uintptr(0)))) * uint32(unsafe.Sizeof(uintptr(0)))) / uint32(unsafe.Sizeof(U32(0))))) {
+ if !(j < (uint32(BITVEC_SZ)-uint32(3)*uint32(unsafe.Sizeof(U32(0))))/uint32(unsafe.Sizeof(uintptr(0)))*uint32(unsafe.Sizeof(uintptr(0)))/uint32(unsafe.Sizeof(U32(0)))) {
goto __20
}
if !(*(*U32)(unsafe.Pointer(aiValues + uintptr(j)*4)) != 0) {
goto __21
}
- rc = rc | (Xsqlite3BitvecSet(tls, p, *(*U32)(unsafe.Pointer(aiValues + uintptr(j)*4))))
+ rc = rc | Xsqlite3BitvecSet(tls, p, *(*U32)(unsafe.Pointer(aiValues + uintptr(j)*4)))
__21:
;
goto __19
@@ -28063,7 +28640,7 @@ __15:
;
bitvec_set_end:
(*Bitvec)(unsafe.Pointer(p)).FnSet++
- *(*U32)(unsafe.Pointer((p + 12 /* &.u */ /* &.aHash */) + uintptr(h)*4)) = i
+ *(*U32)(unsafe.Pointer(p + 12 + uintptr(h)*4)) = i
return SQLITE_OK
}
@@ -28071,53 +28648,53 @@ bitvec_set_end:
//
// pBuf must be a pointer to at least BITVEC_SZ bytes of temporary storage
// that BitvecClear can use to rebuilt its hash table.
-func Xsqlite3BitvecClear(tls *libc.TLS, p uintptr, i U32, pBuf uintptr) { /* sqlite3.c:49639:21: */
+func Xsqlite3BitvecClear(tls *libc.TLS, p uintptr, i U32, pBuf uintptr) { /* sqlite3.c:49644:21: */
if p == uintptr(0) {
return
}
i--
for (*Bitvec)(unsafe.Pointer(p)).FiDivisor != 0 {
- var bin U32 = (i / (*Bitvec)(unsafe.Pointer(p)).FiDivisor)
- i = (i % (*Bitvec)(unsafe.Pointer(p)).FiDivisor)
- p = *(*uintptr)(unsafe.Pointer((p + 12 /* &.u */ /* &.apSub */) + uintptr(bin)*4))
+ var bin U32 = i / (*Bitvec)(unsafe.Pointer(p)).FiDivisor
+ i = i % (*Bitvec)(unsafe.Pointer(p)).FiDivisor
+ p = *(*uintptr)(unsafe.Pointer(p + 12 + uintptr(bin)*4))
if !(p != 0) {
return
}
}
- if (*Bitvec)(unsafe.Pointer(p)).FiSize <= (((((uint32(BITVEC_SZ) - (uint32(3) * uint32(unsafe.Sizeof(U32(0))))) / uint32(unsafe.Sizeof(uintptr(0)))) * uint32(unsafe.Sizeof(uintptr(0)))) / uint32(unsafe.Sizeof(U8(0)))) * uint32(BITVEC_SZELEM)) {
- *(*U8)(unsafe.Pointer((p + 12 /* &.u */ /* &.aBitmap */) + uintptr((i / U32(BITVEC_SZELEM))))) &= U8((^(int32(1) << (i & (U32(BITVEC_SZELEM - 1))))))
+ if (*Bitvec)(unsafe.Pointer(p)).FiSize <= (uint32(BITVEC_SZ)-uint32(3)*uint32(unsafe.Sizeof(U32(0))))/uint32(unsafe.Sizeof(uintptr(0)))*uint32(unsafe.Sizeof(uintptr(0)))/uint32(unsafe.Sizeof(U8(0)))*uint32(BITVEC_SZELEM) {
+ *(*U8)(unsafe.Pointer(p + 12 + uintptr(i/U32(BITVEC_SZELEM)))) &= U8(^(int32(1) << (i & U32(BITVEC_SZELEM-1))))
} else {
var j uint32
var aiValues uintptr = pBuf
- libc.Xmemcpy(tls, aiValues, p+12 /* &.u */ /* &.aHash */, uint32(unsafe.Sizeof([125]U32{})))
- libc.Xmemset(tls, p+12 /* &.u */ /* &.aHash */, 0, uint32(unsafe.Sizeof([125]U32{})))
+ libc.Xmemcpy(tls, aiValues, p+12, uint32(unsafe.Sizeof([125]U32{})))
+ libc.Xmemset(tls, p+12, 0, uint32(unsafe.Sizeof([125]U32{})))
(*Bitvec)(unsafe.Pointer(p)).FnSet = U32(0)
- for j = uint32(0); j < ((((uint32(BITVEC_SZ) - (uint32(3) * uint32(unsafe.Sizeof(U32(0))))) / uint32(unsafe.Sizeof(uintptr(0)))) * uint32(unsafe.Sizeof(uintptr(0)))) / uint32(unsafe.Sizeof(U32(0)))); j++ {
- if (*(*U32)(unsafe.Pointer(aiValues + uintptr(j)*4)) != 0) && (*(*U32)(unsafe.Pointer(aiValues + uintptr(j)*4)) != (i + U32(1))) {
- var h U32 = (((*(*U32)(unsafe.Pointer(aiValues + uintptr(j)*4)) - U32(1)) * U32(1)) % ((((uint32(BITVEC_SZ) - (uint32(3) * uint32(unsafe.Sizeof(U32(0))))) / uint32(unsafe.Sizeof(uintptr(0)))) * uint32(unsafe.Sizeof(uintptr(0)))) / uint32(unsafe.Sizeof(U32(0)))))
+ for j = uint32(0); j < (uint32(BITVEC_SZ)-uint32(3)*uint32(unsafe.Sizeof(U32(0))))/uint32(unsafe.Sizeof(uintptr(0)))*uint32(unsafe.Sizeof(uintptr(0)))/uint32(unsafe.Sizeof(U32(0))); j++ {
+ if *(*U32)(unsafe.Pointer(aiValues + uintptr(j)*4)) != 0 && *(*U32)(unsafe.Pointer(aiValues + uintptr(j)*4)) != i+U32(1) {
+ var h U32 = (*(*U32)(unsafe.Pointer(aiValues + uintptr(j)*4)) - U32(1)) * U32(1) % ((uint32(BITVEC_SZ) - uint32(3)*uint32(unsafe.Sizeof(U32(0)))) / uint32(unsafe.Sizeof(uintptr(0))) * uint32(unsafe.Sizeof(uintptr(0))) / uint32(unsafe.Sizeof(U32(0))))
(*Bitvec)(unsafe.Pointer(p)).FnSet++
- for *(*U32)(unsafe.Pointer((p + 12 /* &.u */ /* &.aHash */) + uintptr(h)*4)) != 0 {
+ for *(*U32)(unsafe.Pointer(p + 12 + uintptr(h)*4)) != 0 {
h++
- if h >= ((((uint32(BITVEC_SZ) - (uint32(3) * uint32(unsafe.Sizeof(U32(0))))) / uint32(unsafe.Sizeof(uintptr(0)))) * uint32(unsafe.Sizeof(uintptr(0)))) / uint32(unsafe.Sizeof(U32(0)))) {
+ if h >= (uint32(BITVEC_SZ)-uint32(3)*uint32(unsafe.Sizeof(U32(0))))/uint32(unsafe.Sizeof(uintptr(0)))*uint32(unsafe.Sizeof(uintptr(0)))/uint32(unsafe.Sizeof(U32(0))) {
h = U32(0)
}
}
- *(*U32)(unsafe.Pointer((p + 12 /* &.u */ /* &.aHash */) + uintptr(h)*4)) = *(*U32)(unsafe.Pointer(aiValues + uintptr(j)*4))
+ *(*U32)(unsafe.Pointer(p + 12 + uintptr(h)*4)) = *(*U32)(unsafe.Pointer(aiValues + uintptr(j)*4))
}
}
}
}
// Destroy a bitmap object. Reclaim all memory used.
-func Xsqlite3BitvecDestroy(tls *libc.TLS, p uintptr) { /* sqlite3.c:49676:21: */
+func Xsqlite3BitvecDestroy(tls *libc.TLS, p uintptr) { /* sqlite3.c:49681:21: */
if p == uintptr(0) {
return
}
if (*Bitvec)(unsafe.Pointer(p)).FiDivisor != 0 {
var i uint32
- for i = uint32(0); i < ((((uint32(BITVEC_SZ) - (uint32(3) * uint32(unsafe.Sizeof(U32(0))))) / uint32(unsafe.Sizeof(uintptr(0)))) * uint32(unsafe.Sizeof(uintptr(0)))) / uint32(unsafe.Sizeof(uintptr(0)))); i++ {
- Xsqlite3BitvecDestroy(tls, *(*uintptr)(unsafe.Pointer((p + 12 /* &.u */ /* &.apSub */) + uintptr(i)*4)))
+ for i = uint32(0); i < (uint32(BITVEC_SZ)-uint32(3)*uint32(unsafe.Sizeof(U32(0))))/uint32(unsafe.Sizeof(uintptr(0)))*uint32(unsafe.Sizeof(uintptr(0)))/uint32(unsafe.Sizeof(uintptr(0))); i++ {
+ Xsqlite3BitvecDestroy(tls, *(*uintptr)(unsafe.Pointer(p + 12 + uintptr(i)*4)))
}
}
Xsqlite3_free(tls, p)
@@ -28125,7 +28702,7 @@ func Xsqlite3BitvecDestroy(tls *libc.TLS, p uintptr) { /* sqlite3.c:49676:21: */
// Return the value of the iSize parameter specified when Bitvec *p
// was created.
-func Xsqlite3BitvecSize(tls *libc.TLS, p uintptr) U32 { /* sqlite3.c:49691:20: */
+func Xsqlite3BitvecSize(tls *libc.TLS, p uintptr) U32 { /* sqlite3.c:49696:20: */
return (*Bitvec)(unsafe.Pointer(p)).FiSize
}
@@ -28162,7 +28739,7 @@ func Xsqlite3BitvecSize(tls *libc.TLS, p uintptr) U32 { /* sqlite3.c:49691:20: *
// an error is returned. If they are the same, zero is returned.
//
// If a memory allocation error occurs, return -1.
-func Xsqlite3BitvecBuiltinTest(tls *libc.TLS, sz int32, aOp uintptr) int32 { /* sqlite3.c:49736:20: */
+func Xsqlite3BitvecBuiltinTest(tls *libc.TLS, sz int32, aOp uintptr) int32 { /* sqlite3.c:49741:20: */
bp := tls.Alloc(4)
defer tls.Free(4)
@@ -28182,9 +28759,9 @@ func Xsqlite3BitvecBuiltinTest(tls *libc.TLS, sz int32, aOp uintptr) int32 { /*
// Allocate the Bitvec to be tested and a linear array of
// bits to act as the reference
pBitvec = Xsqlite3BitvecCreate(tls, uint32(sz))
- pV = Xsqlite3MallocZero(tls, (uint64(((sz + 7) / 8) + 1)))
+ pV = Xsqlite3MallocZero(tls, uint64((sz+7)/8+1))
pTmpSpace = Xsqlite3_malloc64(tls, uint64(BITVEC_SZ))
- if !(((pBitvec == uintptr(0)) || (pV == uintptr(0))) || (pTmpSpace == uintptr(0))) {
+ if !(pBitvec == uintptr(0) || pV == uintptr(0) || pTmpSpace == uintptr(0)) {
goto __1
}
goto bitvec_end
@@ -28196,9 +28773,9 @@ __1:
Xsqlite3BitvecClear(tls, uintptr(0), uint32(1), pTmpSpace)
// Run the program
- pc = 0
+ pc = libc.AssignPtrInt32(bp /* i */, 0)
__2:
- if !((libc.AssignInt32(&op, *(*int32)(unsafe.Pointer(aOp + uintptr(pc)*4)))) != 0) {
+ if !(libc.AssignInt32(&op, *(*int32)(unsafe.Pointer(aOp + uintptr(pc)*4))) != 0) {
goto __3
}
switch op {
@@ -28220,8 +28797,8 @@ __5:
__6:
__7:
nx = 4
- *(*int32)(unsafe.Pointer(bp /* i */)) = (*(*int32)(unsafe.Pointer(aOp + uintptr((pc+2))*4)) - 1)
- *(*int32)(unsafe.Pointer(aOp + uintptr((pc+2))*4)) += (*(*int32)(unsafe.Pointer(aOp + uintptr((pc+3))*4)))
+ *(*int32)(unsafe.Pointer(bp /* i */)) = *(*int32)(unsafe.Pointer(aOp + uintptr(pc+2)*4)) - 1
+ *(*int32)(unsafe.Pointer(aOp + uintptr(pc+2)*4)) += *(*int32)(unsafe.Pointer(aOp + uintptr(pc+3)*4))
goto __4
__8:
@@ -28233,22 +28810,22 @@ __10:
__4:
;
- if !((libc.PreDecInt32(&*(*int32)(unsafe.Pointer(aOp + uintptr((pc+1))*4)), 1)) > 0) {
+ if !(libc.PreDecInt32(&*(*int32)(unsafe.Pointer(aOp + uintptr(pc+1)*4)), 1) > 0) {
goto __11
}
nx = 0
__11:
;
- pc = pc + (nx)
- *(*int32)(unsafe.Pointer(bp /* i */)) = ((*(*int32)(unsafe.Pointer(bp /* i */)) & 0x7fffffff) % sz)
- if !((op & 1) != 0) {
+ pc = pc + nx
+ *(*int32)(unsafe.Pointer(bp /* i */)) = *(*int32)(unsafe.Pointer(bp)) & 0x7fffffff % sz
+ if !(op&1 != 0) {
goto __12
}
- *(*uint8)(unsafe.Pointer(pV + uintptr(((*(*int32)(unsafe.Pointer(bp /* i */)) + 1) >> 3)))) |= uint8((int32(1) << ((*(*int32)(unsafe.Pointer(bp /* i */)) + 1) & 7)))
+ *(*uint8)(unsafe.Pointer(pV + uintptr((*(*int32)(unsafe.Pointer(bp))+1)>>3))) |= uint8(int32(1) << ((*(*int32)(unsafe.Pointer(bp)) + 1) & 7))
if !(op != 5) {
goto __14
}
- if !(Xsqlite3BitvecSet(tls, pBitvec, (uint32(*(*int32)(unsafe.Pointer(bp /* i */))+1))) != 0) {
+ if !(Xsqlite3BitvecSet(tls, pBitvec, uint32(*(*int32)(unsafe.Pointer(bp))+1)) != 0) {
goto __15
}
goto bitvec_end
@@ -28258,8 +28835,8 @@ __14:
;
goto __13
__12:
- *(*uint8)(unsafe.Pointer(pV + uintptr(((*(*int32)(unsafe.Pointer(bp /* i */)) + 1) >> 3)))) &= uint8((^(int32(1) << ((*(*int32)(unsafe.Pointer(bp /* i */)) + 1) & 7))))
- Xsqlite3BitvecClear(tls, pBitvec, (uint32(*(*int32)(unsafe.Pointer(bp /* i */)) + 1)), pTmpSpace)
+ *(*uint8)(unsafe.Pointer(pV + uintptr((*(*int32)(unsafe.Pointer(bp))+1)>>3))) &= uint8(^(int32(1) << ((*(*int32)(unsafe.Pointer(bp)) + 1) & 7)))
+ Xsqlite3BitvecClear(tls, pBitvec, uint32(*(*int32)(unsafe.Pointer(bp))+1), pTmpSpace)
__13:
;
goto __2
@@ -28270,15 +28847,15 @@ __3:
// Bitvec object. Start with the assumption that they do
// match (rc==0). Change rc to non-zero if a discrepancy
// is found.
- rc = (int32((U32((Xsqlite3BitvecTest(tls, uintptr(0), uint32(0)) + Xsqlite3BitvecTest(tls, pBitvec, (uint32(sz+1)))) +
- Xsqlite3BitvecTest(tls, pBitvec, uint32(0)))) +
- (Xsqlite3BitvecSize(tls, pBitvec) - U32(sz))))
+ rc = int32(U32(Xsqlite3BitvecTest(tls, uintptr(0), uint32(0))+Xsqlite3BitvecTest(tls, pBitvec, uint32(sz+1))+
+ Xsqlite3BitvecTest(tls, pBitvec, uint32(0))) +
+ (Xsqlite3BitvecSize(tls, pBitvec) - U32(sz)))
*(*int32)(unsafe.Pointer(bp /* i */)) = 1
__16:
- if !(*(*int32)(unsafe.Pointer(bp /* i */)) <= sz) {
+ if !(*(*int32)(unsafe.Pointer(bp)) <= sz) {
goto __18
}
- if !((libc.Bool32((int32(*(*uint8)(unsafe.Pointer(pV + uintptr((*(*int32)(unsafe.Pointer(bp /* i */)) >> 3))))) & (int32(1) << (*(*int32)(unsafe.Pointer(bp /* i */)) & 7))) != 0)) != Xsqlite3BitvecTest(tls, pBitvec, uint32(*(*int32)(unsafe.Pointer(bp /* i */))))) {
+ if !(libc.Bool32(int32(*(*uint8)(unsafe.Pointer(pV + uintptr(*(*int32)(unsafe.Pointer(bp))>>3))))&(int32(1)<<(*(*int32)(unsafe.Pointer(bp))&7)) != 0) != Xsqlite3BitvecTest(tls, pBitvec, uint32(*(*int32)(unsafe.Pointer(bp))))) {
goto __19
}
rc = *(*int32)(unsafe.Pointer(bp /* i */))
@@ -28325,10 +28902,10 @@ bitvec_end:
// argument determines what operation to do. The 0x01 bit means first
// remove pPage from the dirty list. The 0x02 means add pPage back to
// the dirty list. Doing both moves pPage to the front of the dirty list.
-func pcacheManageDirtyList(tls *libc.TLS, pPage uintptr, addRemove U8) { /* sqlite3.c:49971:13: */
+func pcacheManageDirtyList(tls *libc.TLS, pPage uintptr, addRemove U8) { /* sqlite3.c:49976:13: */
var p uintptr = (*PgHdr)(unsafe.Pointer(pPage)).FpCache
- if (int32(addRemove) & PCACHE_DIRTYLIST_REMOVE) != 0 {
+ if int32(addRemove)&PCACHE_DIRTYLIST_REMOVE != 0 {
// Update the PCache1.pSynced variable if necessary.
if (*PCache)(unsafe.Pointer(p)).FpSynced == pPage {
@@ -28357,7 +28934,7 @@ func pcacheManageDirtyList(tls *libc.TLS, pPage uintptr, addRemove U8) { /* sqli
}
}
}
- if (int32(addRemove) & PCACHE_DIRTYLIST_ADD) != 0 {
+ if int32(addRemove)&PCACHE_DIRTYLIST_ADD != 0 {
(*PgHdr)(unsafe.Pointer(pPage)).FpDirtyPrev = uintptr(0)
(*PgHdr)(unsafe.Pointer(pPage)).FpDirtyNext = (*PCache)(unsafe.Pointer(p)).FpDirty
if (*PgHdr)(unsafe.Pointer(pPage)).FpDirtyNext != 0 {
@@ -28378,7 +28955,7 @@ func pcacheManageDirtyList(tls *libc.TLS, pPage uintptr, addRemove U8) { /* sqli
// flag set sqlite3PcacheFetchStress() searches through all newer
// entries of the dirty-list for a page with NEED_SYNC clear anyway.
if !(int32((*PCache)(unsafe.Pointer(p)).FpSynced) != 0) &&
- (0 == (int32((*PgHdr)(unsafe.Pointer(pPage)).Fflags) & PGHDR_NEED_SYNC)) {
+ 0 == int32((*PgHdr)(unsafe.Pointer(pPage)).Fflags)&PGHDR_NEED_SYNC {
(*PCache)(unsafe.Pointer(p)).FpSynced = pPage
}
}
@@ -28387,7 +28964,7 @@ func pcacheManageDirtyList(tls *libc.TLS, pPage uintptr, addRemove U8) { /* sqli
// Wrapper around the pluggable caches xUnpin method. If the cache is
// being used for an in-memory database, this function is a no-op.
-func pcacheUnpin(tls *libc.TLS, p uintptr) { /* sqlite3.c:50041:13: */
+func pcacheUnpin(tls *libc.TLS, p uintptr) { /* sqlite3.c:50046:13: */
if (*PCache)(unsafe.Pointer((*PgHdr)(unsafe.Pointer(p)).FpCache)).FbPurgeable != 0 {
(*struct {
@@ -28399,17 +28976,22 @@ func pcacheUnpin(tls *libc.TLS, p uintptr) { /* sqlite3.c:50041:13: */
// Compute the number of pages of cache requested. p->szCache is the
// cache size requested by the "PRAGMA cache_size" statement.
-func numberOfCachePages(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:50053:12: */
+func numberOfCachePages(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:50058:12: */
if (*PCache)(unsafe.Pointer(p)).FszCache >= 0 {
// IMPLEMENTATION-OF: R-42059-47211 If the argument N is positive then the
// suggested cache size is set to N.
return (*PCache)(unsafe.Pointer(p)).FszCache
} else {
+ var n I64
// IMPLEMANTATION-OF: R-59858-46238 If the argument N is negative, then the
// number of cache pages is adjusted to be a number of pages that would
// use approximately abs(N*1024) bytes of memory based on the current
// page size.
- return (int32((int64(-1024) * I64((*PCache)(unsafe.Pointer(p)).FszCache)) / (I64((*PCache)(unsafe.Pointer(p)).FszPage + (*PCache)(unsafe.Pointer(p)).FszExtra))))
+ n = int64(-1024) * I64((*PCache)(unsafe.Pointer(p)).FszCache) / I64((*PCache)(unsafe.Pointer(p)).FszPage+(*PCache)(unsafe.Pointer(p)).FszExtra)
+ if n > int64(1000000000) {
+ n = int64(1000000000)
+ }
+ return int32(n)
}
return int32(0)
}
@@ -28419,7 +29001,7 @@ func numberOfCachePages(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:50053:12:
//
// Initialize and shutdown the page cache subsystem. Neither of these
// functions are threadsafe.
-func Xsqlite3PcacheInitialize(tls *libc.TLS) int32 { /* sqlite3.c:50072:20: */
+func Xsqlite3PcacheInitialize(tls *libc.TLS) int32 { /* sqlite3.c:50080:20: */
if Xsqlite3Config.Fpcache2.FxInit == uintptr(0) {
// IMPLEMENTATION-OF: R-26801-64137 If the xInit() method is NULL, then the
// built-in default page cache is used instead of the application defined
@@ -28432,7 +29014,7 @@ func Xsqlite3PcacheInitialize(tls *libc.TLS) int32 { /* sqlite3.c:50072:20: */
})(unsafe.Pointer(&struct{ uintptr }{Xsqlite3Config.Fpcache2.FxInit})).f(tls, Xsqlite3Config.Fpcache2.FpArg)
}
-func Xsqlite3PcacheShutdown(tls *libc.TLS) { /* sqlite3.c:50082:21: */
+func Xsqlite3PcacheShutdown(tls *libc.TLS) { /* sqlite3.c:50090:21: */
if Xsqlite3Config.Fpcache2.FxShutdown != 0 {
// IMPLEMENTATION-OF: R-26000-56589 The xShutdown() method may be NULL.
(*struct{ f func(*libc.TLS, uintptr) })(unsafe.Pointer(&struct{ uintptr }{Xsqlite3Config.Fpcache2.FxShutdown})).f(tls, Xsqlite3Config.Fpcache2.FpArg)
@@ -28440,7 +29022,7 @@ func Xsqlite3PcacheShutdown(tls *libc.TLS) { /* sqlite3.c:50082:21: */
}
// Return the size in bytes of a PCache object.
-func Xsqlite3PcacheSize(tls *libc.TLS) int32 { /* sqlite3.c:50092:20: */
+func Xsqlite3PcacheSize(tls *libc.TLS) int32 { /* sqlite3.c:50100:20: */
return int32(unsafe.Sizeof(PCache{}))
}
@@ -28454,7 +29036,7 @@ func Xsqlite3PcacheSize(tls *libc.TLS) int32 { /* sqlite3.c:50092:20: */
// but remaining content will be uninitialized. Though it is opaque
// to this module, the extra space really ends up being the MemPage
// structure in the pager.
-func Xsqlite3PcacheOpen(tls *libc.TLS, szPage int32, szExtra int32, bPurgeable int32, xStress uintptr, pStress uintptr, p uintptr) int32 { /* sqlite3.c:50106:20: */
+func Xsqlite3PcacheOpen(tls *libc.TLS, szPage int32, szExtra int32, bPurgeable int32, xStress uintptr, pStress uintptr, p uintptr) int32 { /* sqlite3.c:50114:20: */
libc.Xmemset(tls, p, 0, uint32(unsafe.Sizeof(PCache{})))
(*PCache)(unsafe.Pointer(p)).FszPage = 1
(*PCache)(unsafe.Pointer(p)).FszExtra = szExtra
@@ -28471,14 +29053,14 @@ func Xsqlite3PcacheOpen(tls *libc.TLS, szPage int32, szExtra int32, bPurgeable i
// Change the page size for PCache object. The caller must ensure that there
// are no outstanding page references when this function is called.
-func Xsqlite3PcacheSetPageSize(tls *libc.TLS, pCache uintptr, szPage int32) int32 { /* sqlite3.c:50132:20: */
+func Xsqlite3PcacheSetPageSize(tls *libc.TLS, pCache uintptr, szPage int32) int32 { /* sqlite3.c:50140:20: */
if (*PCache)(unsafe.Pointer(pCache)).FszPage != 0 {
var pNew uintptr
pNew = (*struct {
f func(*libc.TLS, int32, int32, int32) uintptr
})(unsafe.Pointer(&struct{ uintptr }{Xsqlite3Config.Fpcache2.FxCreate})).f(tls,
- szPage, (int32(uint32((*PCache)(unsafe.Pointer(pCache)).FszExtra) + (((uint32(unsafe.Sizeof(PgHdr{}))) + uint32(7)) & libc.Uint32FromInt32(libc.CplInt32(7))))),
+ szPage, int32(uint32((*PCache)(unsafe.Pointer(pCache)).FszExtra)+(uint32(unsafe.Sizeof(PgHdr{}))+uint32(7))&libc.Uint32FromInt32(libc.CplInt32(7))),
int32((*PCache)(unsafe.Pointer(pCache)).FbPurgeable))
if pNew == uintptr(0) {
return SQLITE_NOMEM
@@ -28518,7 +29100,7 @@ func Xsqlite3PcacheSetPageSize(tls *libc.TLS, pCache uintptr, szPage int32) int3
// they can both (usually) operate without having to push values to
// the stack on entry and pop them back off on exit, which saves a
// lot of pushing and popping.
-func Xsqlite3PcacheFetch(tls *libc.TLS, pCache uintptr, pgno Pgno, createFlag int32) uintptr { /* sqlite3.c:50176:36: */
+func Xsqlite3PcacheFetch(tls *libc.TLS, pCache uintptr, pgno Pgno, createFlag int32) uintptr { /* sqlite3.c:50184:36: */
var eCreate int32
var pRes uintptr
@@ -28528,7 +29110,7 @@ func Xsqlite3PcacheFetch(tls *libc.TLS, pCache uintptr, pgno Pgno, createFlag in
// (createFlag==1 AND bPurgeable AND pDirty)
// 2 Allocate a new page even it doing so is difficult.
// (createFlag==1 AND !(bPurgeable AND pDirty)
- eCreate = (createFlag & int32((*PCache)(unsafe.Pointer(pCache)).FeCreate))
+ eCreate = createFlag & int32((*PCache)(unsafe.Pointer(pCache)).FeCreate)
pRes = (*struct {
f func(*libc.TLS, uintptr, uint32, int32) uintptr
@@ -28546,7 +29128,7 @@ func Xsqlite3PcacheFetch(tls *libc.TLS, pCache uintptr, pgno Pgno, createFlag in
// an OOM error.
//
// This routine should be invoked only after sqlite3PcacheFetch() fails.
-func Xsqlite3PcacheFetchStress(tls *libc.TLS, pCache uintptr, pgno Pgno, ppPage uintptr) int32 { /* sqlite3.c:50217:20: */
+func Xsqlite3PcacheFetchStress(tls *libc.TLS, pCache uintptr, pgno Pgno, ppPage uintptr) int32 { /* sqlite3.c:50225:20: */
var pPg uintptr
if int32((*PCache)(unsafe.Pointer(pCache)).FeCreate) == 2 {
return 0
@@ -28562,11 +29144,11 @@ func Xsqlite3PcacheFetchStress(tls *libc.TLS, pCache uintptr, pgno Pgno, ppPage
// flag is currently referenced, then the following may leave pSynced
// set incorrectly (pointing to other than the LRU page with NEED_SYNC
// cleared). This is Ok, as pSynced is just an optimization.
- for pPg = (*PCache)(unsafe.Pointer(pCache)).FpSynced; (pPg != 0) && (((*PgHdr)(unsafe.Pointer(pPg)).FnRef != 0) || ((int32((*PgHdr)(unsafe.Pointer(pPg)).Fflags) & PGHDR_NEED_SYNC) != 0)); pPg = (*PgHdr)(unsafe.Pointer(pPg)).FpDirtyPrev {
+ for pPg = (*PCache)(unsafe.Pointer(pCache)).FpSynced; pPg != 0 && ((*PgHdr)(unsafe.Pointer(pPg)).FnRef != 0 || int32((*PgHdr)(unsafe.Pointer(pPg)).Fflags)&PGHDR_NEED_SYNC != 0); pPg = (*PgHdr)(unsafe.Pointer(pPg)).FpDirtyPrev {
}
(*PCache)(unsafe.Pointer(pCache)).FpSynced = pPg
if !(pPg != 0) {
- for pPg = (*PCache)(unsafe.Pointer(pCache)).FpDirtyTail; (pPg != 0) && ((*PgHdr)(unsafe.Pointer(pPg)).FnRef != 0); pPg = (*PgHdr)(unsafe.Pointer(pPg)).FpDirtyPrev {
+ for pPg = (*PCache)(unsafe.Pointer(pCache)).FpDirtyTail; pPg != 0 && (*PgHdr)(unsafe.Pointer(pPg)).FnRef != 0; pPg = (*PgHdr)(unsafe.Pointer(pPg)).FpDirtyPrev {
}
}
if pPg != 0 {
@@ -28576,7 +29158,7 @@ func Xsqlite3PcacheFetchStress(tls *libc.TLS, pCache uintptr, pgno Pgno, ppPage
f func(*libc.TLS, uintptr, uintptr) int32
})(unsafe.Pointer(&struct{ uintptr }{(*PCache)(unsafe.Pointer(pCache)).FxStress})).f(tls, (*PCache)(unsafe.Pointer(pCache)).FpStress, pPg)
- if (rc != SQLITE_OK) && (rc != SQLITE_BUSY) {
+ if rc != SQLITE_OK && rc != SQLITE_BUSY {
return rc
}
}
@@ -28597,15 +29179,15 @@ func Xsqlite3PcacheFetchStress(tls *libc.TLS, pCache uintptr, pgno Pgno, ppPage
// This routine is broken out into a separate function since it
// requires extra stack manipulation that can be avoided in the common
// case.
-func pcacheFetchFinishWithInit(tls *libc.TLS, pCache uintptr, pgno Pgno, pPage uintptr) uintptr { /* sqlite3.c:50273:30: */
+func pcacheFetchFinishWithInit(tls *libc.TLS, pCache uintptr, pgno Pgno, pPage uintptr) uintptr { /* sqlite3.c:50281:30: */
var pPgHdr uintptr
pPgHdr = (*Sqlite3_pcache_page)(unsafe.Pointer(pPage)).FpExtra
- libc.Xmemset(tls, (pPgHdr + 16 /* &.pDirty */), 0, (uint32(unsafe.Sizeof(PgHdr{})) - (uint32((uintptr(0) + 16 /* &.pDirty */)))))
+ libc.Xmemset(tls, pPgHdr+16, 0, uint32(unsafe.Sizeof(PgHdr{}))-uint32(uintptr(0)+16))
(*PgHdr)(unsafe.Pointer(pPgHdr)).FpPage = pPage
(*PgHdr)(unsafe.Pointer(pPgHdr)).FpData = (*Sqlite3_pcache_page)(unsafe.Pointer(pPage)).FpBuf
- (*PgHdr)(unsafe.Pointer(pPgHdr)).FpExtra = (pPgHdr + 1*40)
+ (*PgHdr)(unsafe.Pointer(pPgHdr)).FpExtra = pPgHdr + 1*40
libc.Xmemset(tls, (*PgHdr)(unsafe.Pointer(pPgHdr)).FpExtra, 0, uint32(8))
(*PgHdr)(unsafe.Pointer(pPgHdr)).FpCache = pCache
(*PgHdr)(unsafe.Pointer(pPgHdr)).Fpgno = pgno
@@ -28617,7 +29199,7 @@ func pcacheFetchFinishWithInit(tls *libc.TLS, pCache uintptr, pgno Pgno, pPage u
// sqlite3PcacheFetch() into an initialized PgHdr object. This routine
// must be called after sqlite3PcacheFetch() in order to get a usable
// result.
-func Xsqlite3PcacheFetchFinish(tls *libc.TLS, pCache uintptr, pgno Pgno, pPage uintptr) uintptr { /* sqlite3.c:50299:22: */
+func Xsqlite3PcacheFetchFinish(tls *libc.TLS, pCache uintptr, pgno Pgno, pPage uintptr) uintptr { /* sqlite3.c:50307:22: */
var pPgHdr uintptr
pPgHdr = (*Sqlite3_pcache_page)(unsafe.Pointer(pPage)).FpExtra
@@ -28633,11 +29215,11 @@ func Xsqlite3PcacheFetchFinish(tls *libc.TLS, pCache uintptr, pgno Pgno, pPage u
// Decrement the reference count on a page. If the page is clean and the
// reference count drops to 0, then it is made eligible for recycling.
-func Xsqlite3PcacheRelease(tls *libc.TLS, p uintptr) { /* sqlite3.c:50322:37: */
+func Xsqlite3PcacheRelease(tls *libc.TLS, p uintptr) { /* sqlite3.c:50330:37: */
(*PCache)(unsafe.Pointer((*PgHdr)(unsafe.Pointer(p)).FpCache)).FnRefSum--
- if (int32(libc.PreDecInt16(&(*PgHdr)(unsafe.Pointer(p)).FnRef, 1))) == 0 {
- if (int32((*PgHdr)(unsafe.Pointer(p)).Fflags) & PGHDR_CLEAN) != 0 {
+ if int32(libc.PreDecInt16(&(*PgHdr)(unsafe.Pointer(p)).FnRef, 1)) == 0 {
+ if int32((*PgHdr)(unsafe.Pointer(p)).Fflags)&PGHDR_CLEAN != 0 {
pcacheUnpin(tls, p)
} else {
pcacheManageDirtyList(tls, p, uint8(PCACHE_DIRTYLIST_FRONT))
@@ -28646,7 +29228,7 @@ func Xsqlite3PcacheRelease(tls *libc.TLS, p uintptr) { /* sqlite3.c:50322:37: */
}
// Increase the reference count of a supplied page by 1.
-func Xsqlite3PcacheRef(tls *libc.TLS, p uintptr) { /* sqlite3.c:50337:21: */
+func Xsqlite3PcacheRef(tls *libc.TLS, p uintptr) { /* sqlite3.c:50345:21: */
(*PgHdr)(unsafe.Pointer(p)).FnRef++
(*PCache)(unsafe.Pointer((*PgHdr)(unsafe.Pointer(p)).FpCache)).FnRefSum++
@@ -28655,9 +29237,9 @@ func Xsqlite3PcacheRef(tls *libc.TLS, p uintptr) { /* sqlite3.c:50337:21: */
// Drop a page from the cache. There must be exactly one reference to the
// page. This function deletes that reference, so after it returns the
// page pointed to by p is invalid.
-func Xsqlite3PcacheDrop(tls *libc.TLS, p uintptr) { /* sqlite3.c:50349:21: */
+func Xsqlite3PcacheDrop(tls *libc.TLS, p uintptr) { /* sqlite3.c:50357:21: */
- if (int32((*PgHdr)(unsafe.Pointer(p)).Fflags) & PGHDR_DIRTY) != 0 {
+ if int32((*PgHdr)(unsafe.Pointer(p)).Fflags)&PGHDR_DIRTY != 0 {
pcacheManageDirtyList(tls, p, uint8(PCACHE_DIRTYLIST_REMOVE))
}
(*PCache)(unsafe.Pointer((*PgHdr)(unsafe.Pointer(p)).FpCache)).FnRefSum--
@@ -28668,12 +29250,12 @@ func Xsqlite3PcacheDrop(tls *libc.TLS, p uintptr) { /* sqlite3.c:50349:21: */
// Make sure the page is marked as dirty. If it isn't dirty already,
// make it so.
-func Xsqlite3PcacheMakeDirty(tls *libc.TLS, p uintptr) { /* sqlite3.c:50363:21: */
+func Xsqlite3PcacheMakeDirty(tls *libc.TLS, p uintptr) { /* sqlite3.c:50371:21: */
- if (int32((*PgHdr)(unsafe.Pointer(p)).Fflags) & (PGHDR_CLEAN | PGHDR_DONT_WRITE)) != 0 { //OPTIMIZATION-IF-FALSE
- *(*U16)(unsafe.Pointer(p + 28 /* &.flags */)) &= libc.Uint16FromInt32((libc.CplInt32(PGHDR_DONT_WRITE)))
- if (int32((*PgHdr)(unsafe.Pointer(p)).Fflags) & PGHDR_CLEAN) != 0 {
- *(*U16)(unsafe.Pointer(p + 28 /* &.flags */)) ^= U16((PGHDR_DIRTY | PGHDR_CLEAN))
+ if int32((*PgHdr)(unsafe.Pointer(p)).Fflags)&(PGHDR_CLEAN|PGHDR_DONT_WRITE) != 0 { //OPTIMIZATION-IF-FALSE
+ *(*U16)(unsafe.Pointer(p + 28)) &= libc.Uint16FromInt32(libc.CplInt32(PGHDR_DONT_WRITE))
+ if int32((*PgHdr)(unsafe.Pointer(p)).Fflags)&PGHDR_CLEAN != 0 {
+ *(*U16)(unsafe.Pointer(p + 28)) ^= U16(PGHDR_DIRTY | PGHDR_CLEAN)
pcacheManageDirtyList(tls, p, uint8(PCACHE_DIRTYLIST_ADD))
}
@@ -28683,11 +29265,11 @@ func Xsqlite3PcacheMakeDirty(tls *libc.TLS, p uintptr) { /* sqlite3.c:50363:21:
// Make sure the page is marked as clean. If it isn't clean already,
// make it so.
-func Xsqlite3PcacheMakeClean(tls *libc.TLS, p uintptr) { /* sqlite3.c:50382:21: */
+func Xsqlite3PcacheMakeClean(tls *libc.TLS, p uintptr) { /* sqlite3.c:50390:21: */
pcacheManageDirtyList(tls, p, uint8(PCACHE_DIRTYLIST_REMOVE))
- *(*U16)(unsafe.Pointer(p + 28 /* &.flags */)) &= libc.Uint16FromInt32((libc.CplInt32(((PGHDR_DIRTY | PGHDR_NEED_SYNC) | PGHDR_WRITEABLE))))
- *(*U16)(unsafe.Pointer(p + 28 /* &.flags */)) |= U16((PGHDR_CLEAN))
+ *(*U16)(unsafe.Pointer(p + 28)) &= libc.Uint16FromInt32(libc.CplInt32(PGHDR_DIRTY | PGHDR_NEED_SYNC | PGHDR_WRITEABLE))
+ *(*U16)(unsafe.Pointer(p + 28)) |= U16(PGHDR_CLEAN)
if int32((*PgHdr)(unsafe.Pointer(p)).FnRef) == 0 {
pcacheUnpin(tls, p)
@@ -28695,42 +29277,42 @@ func Xsqlite3PcacheMakeClean(tls *libc.TLS, p uintptr) { /* sqlite3.c:50382:21:
}
// Make every page in the cache clean.
-func Xsqlite3PcacheCleanAll(tls *libc.TLS, pCache uintptr) { /* sqlite3.c:50399:21: */
+func Xsqlite3PcacheCleanAll(tls *libc.TLS, pCache uintptr) { /* sqlite3.c:50407:21: */
var p uintptr
- for (libc.AssignUintptr(&p, (*PCache)(unsafe.Pointer(pCache)).FpDirty)) != uintptr(0) {
+ for libc.AssignUintptr(&p, (*PCache)(unsafe.Pointer(pCache)).FpDirty) != uintptr(0) {
Xsqlite3PcacheMakeClean(tls, p)
}
}
// Clear the PGHDR_NEED_SYNC and PGHDR_WRITEABLE flag from all dirty pages.
-func Xsqlite3PcacheClearWritable(tls *libc.TLS, pCache uintptr) { /* sqlite3.c:50410:21: */
+func Xsqlite3PcacheClearWritable(tls *libc.TLS, pCache uintptr) { /* sqlite3.c:50418:21: */
var p uintptr
for p = (*PCache)(unsafe.Pointer(pCache)).FpDirty; p != 0; p = (*PgHdr)(unsafe.Pointer(p)).FpDirtyNext {
- *(*U16)(unsafe.Pointer(p + 28 /* &.flags */)) &= libc.Uint16FromInt32((libc.CplInt32((PGHDR_NEED_SYNC | PGHDR_WRITEABLE))))
+ *(*U16)(unsafe.Pointer(p + 28)) &= libc.Uint16FromInt32(libc.CplInt32(PGHDR_NEED_SYNC | PGHDR_WRITEABLE))
}
(*PCache)(unsafe.Pointer(pCache)).FpSynced = (*PCache)(unsafe.Pointer(pCache)).FpDirtyTail
}
// Clear the PGHDR_NEED_SYNC flag from all dirty pages.
-func Xsqlite3PcacheClearSyncFlags(tls *libc.TLS, pCache uintptr) { /* sqlite3.c:50422:21: */
+func Xsqlite3PcacheClearSyncFlags(tls *libc.TLS, pCache uintptr) { /* sqlite3.c:50430:21: */
var p uintptr
for p = (*PCache)(unsafe.Pointer(pCache)).FpDirty; p != 0; p = (*PgHdr)(unsafe.Pointer(p)).FpDirtyNext {
- *(*U16)(unsafe.Pointer(p + 28 /* &.flags */)) &= libc.Uint16FromInt32((libc.CplInt32(PGHDR_NEED_SYNC)))
+ *(*U16)(unsafe.Pointer(p + 28)) &= libc.Uint16FromInt32(libc.CplInt32(PGHDR_NEED_SYNC))
}
(*PCache)(unsafe.Pointer(pCache)).FpSynced = (*PCache)(unsafe.Pointer(pCache)).FpDirtyTail
}
// Change the page number of page p to newPgno.
-func Xsqlite3PcacheMove(tls *libc.TLS, p uintptr, newPgno Pgno) { /* sqlite3.c:50433:21: */
+func Xsqlite3PcacheMove(tls *libc.TLS, p uintptr, newPgno Pgno) { /* sqlite3.c:50441:21: */
var pCache uintptr = (*PgHdr)(unsafe.Pointer(p)).FpCache
(*struct {
f func(*libc.TLS, uintptr, uintptr, uint32, uint32)
})(unsafe.Pointer(&struct{ uintptr }{Xsqlite3Config.Fpcache2.FxRekey})).f(tls, (*PCache)(unsafe.Pointer(pCache)).FpCache, (*PgHdr)(unsafe.Pointer(p)).FpPage, (*PgHdr)(unsafe.Pointer(p)).Fpgno, newPgno)
(*PgHdr)(unsafe.Pointer(p)).Fpgno = newPgno
- if ((int32((*PgHdr)(unsafe.Pointer(p)).Fflags) & PGHDR_DIRTY) != 0) && ((int32((*PgHdr)(unsafe.Pointer(p)).Fflags) & PGHDR_NEED_SYNC) != 0) {
+ if int32((*PgHdr)(unsafe.Pointer(p)).Fflags)&PGHDR_DIRTY != 0 && int32((*PgHdr)(unsafe.Pointer(p)).Fflags)&PGHDR_NEED_SYNC != 0 {
pcacheManageDirtyList(tls, p, uint8(PCACHE_DIRTYLIST_FRONT))
}
}
@@ -28742,7 +29324,7 @@ func Xsqlite3PcacheMove(tls *libc.TLS, p uintptr, newPgno Pgno) { /* sqlite3.c:5
// If there is a reference to page 1 and the pgno parameter passed to this
// function is 0, then the data area associated with page 1 is zeroed, but
// the page object is not dropped.
-func Xsqlite3PcacheTruncate(tls *libc.TLS, pCache uintptr, pgno Pgno) { /* sqlite3.c:50455:21: */
+func Xsqlite3PcacheTruncate(tls *libc.TLS, pCache uintptr, pgno Pgno) { /* sqlite3.c:50463:21: */
if (*PCache)(unsafe.Pointer(pCache)).FpCache != 0 {
var p uintptr
var pNext uintptr
@@ -28758,7 +29340,7 @@ func Xsqlite3PcacheTruncate(tls *libc.TLS, pCache uintptr, pgno Pgno) { /* sqlit
Xsqlite3PcacheMakeClean(tls, p)
}
}
- if (pgno == Pgno(0)) && ((*PCache)(unsafe.Pointer(pCache)).FnRefSum != 0) {
+ if pgno == Pgno(0) && (*PCache)(unsafe.Pointer(pCache)).FnRefSum != 0 {
var pPage1 uintptr
pPage1 = (*struct {
f func(*libc.TLS, uintptr, uint32, int32) uintptr
@@ -28771,24 +29353,24 @@ func Xsqlite3PcacheTruncate(tls *libc.TLS, pCache uintptr, pgno Pgno) { /* sqlit
}
(*struct {
f func(*libc.TLS, uintptr, uint32)
- })(unsafe.Pointer(&struct{ uintptr }{Xsqlite3Config.Fpcache2.FxTruncate})).f(tls, (*PCache)(unsafe.Pointer(pCache)).FpCache, (pgno + Pgno(1)))
+ })(unsafe.Pointer(&struct{ uintptr }{Xsqlite3Config.Fpcache2.FxTruncate})).f(tls, (*PCache)(unsafe.Pointer(pCache)).FpCache, pgno+Pgno(1))
}
}
// Close a cache.
-func Xsqlite3PcacheClose(tls *libc.TLS, pCache uintptr) { /* sqlite3.c:50488:21: */
+func Xsqlite3PcacheClose(tls *libc.TLS, pCache uintptr) { /* sqlite3.c:50496:21: */
(*struct{ f func(*libc.TLS, uintptr) })(unsafe.Pointer(&struct{ uintptr }{Xsqlite3Config.Fpcache2.FxDestroy})).f(tls, (*PCache)(unsafe.Pointer(pCache)).FpCache)
}
// Discard the contents of the cache.
-func Xsqlite3PcacheClear(tls *libc.TLS, pCache uintptr) { /* sqlite3.c:50497:21: */
+func Xsqlite3PcacheClear(tls *libc.TLS, pCache uintptr) { /* sqlite3.c:50505:21: */
Xsqlite3PcacheTruncate(tls, pCache, uint32(0))
}
// Merge two lists of pages connected by pDirty and in pgno order.
// Do not bother fixing the pDirtyPrev pointers.
-func pcacheMergeDirtyList(tls *libc.TLS, pA uintptr, pB uintptr) uintptr { /* sqlite3.c:50505:14: */
+func pcacheMergeDirtyList(tls *libc.TLS, pA uintptr, pB uintptr) uintptr { /* sqlite3.c:50513:14: */
bp := tls.Alloc(40)
defer tls.Free(40)
@@ -28827,7 +29409,7 @@ func pcacheMergeDirtyList(tls *libc.TLS, pA uintptr, pB uintptr) uintptr { /* sq
// there cannot be more than 31 buckets required by the merge sorter.
// One extra bucket is added to catch overflow in case something
// ever changes to make the previous sentence incorrect.
-func pcacheSortDirtyList(tls *libc.TLS, pIn uintptr) uintptr { /* sqlite3.c:50542:14: */
+func pcacheSortDirtyList(tls *libc.TLS, pIn uintptr) uintptr { /* sqlite3.c:50550:14: */
bp := tls.Alloc(128)
defer tls.Free(128)
@@ -28840,8 +29422,8 @@ func pcacheSortDirtyList(tls *libc.TLS, pIn uintptr) uintptr { /* sqlite3.c:5054
p = pIn
pIn = (*PgHdr)(unsafe.Pointer(p)).FpDirty
(*PgHdr)(unsafe.Pointer(p)).FpDirty = uintptr(0)
- for i = 0; i < (N_SORT_BUCKET - 1); i++ {
- if *(*uintptr)(unsafe.Pointer(bp /* &a[0] */ + uintptr(i)*4)) == uintptr(0) {
+ for i = 0; i < N_SORT_BUCKET-1; i++ {
+ if *(*uintptr)(unsafe.Pointer(bp + uintptr(i)*4)) == uintptr(0) {
*(*uintptr)(unsafe.Pointer(bp /* &a[0] */ + uintptr(i)*4)) = p
break
} else {
@@ -28849,7 +29431,7 @@ func pcacheSortDirtyList(tls *libc.TLS, pIn uintptr) uintptr { /* sqlite3.c:5054
*(*uintptr)(unsafe.Pointer(bp /* &a[0] */ + uintptr(i)*4)) = uintptr(0)
}
}
- if i == (N_SORT_BUCKET - 1) {
+ if i == N_SORT_BUCKET-1 {
// To get here, there need to be 2^(N_SORT_BUCKET) elements in
// the input list. But that is impossible.
*(*uintptr)(unsafe.Pointer(bp /* &a[0] */ + uintptr(i)*4)) = pcacheMergeDirtyList(tls, *(*uintptr)(unsafe.Pointer(bp /* &a[0] */ + uintptr(i)*4)), p)
@@ -28857,7 +29439,7 @@ func pcacheSortDirtyList(tls *libc.TLS, pIn uintptr) uintptr { /* sqlite3.c:5054
}
p = *(*uintptr)(unsafe.Pointer(bp /* &a[0] */))
for i = 1; i < N_SORT_BUCKET; i++ {
- if *(*uintptr)(unsafe.Pointer(bp /* &a[0] */ + uintptr(i)*4)) == uintptr(0) {
+ if *(*uintptr)(unsafe.Pointer(bp + uintptr(i)*4)) == uintptr(0) {
continue
}
if p != 0 {
@@ -28870,7 +29452,7 @@ func pcacheSortDirtyList(tls *libc.TLS, pIn uintptr) uintptr { /* sqlite3.c:5054
}
// Return a list of all dirty pages in the cache, sorted by page number.
-func Xsqlite3PcacheDirtyList(tls *libc.TLS, pCache uintptr) uintptr { /* sqlite3.c:50577:22: */
+func Xsqlite3PcacheDirtyList(tls *libc.TLS, pCache uintptr) uintptr { /* sqlite3.c:50585:22: */
var p uintptr
for p = (*PCache)(unsafe.Pointer(pCache)).FpDirty; p != 0; p = (*PgHdr)(unsafe.Pointer(p)).FpDirtyNext {
(*PgHdr)(unsafe.Pointer(p)).FpDirty = (*PgHdr)(unsafe.Pointer(p)).FpDirtyNext
@@ -28882,17 +29464,17 @@ func Xsqlite3PcacheDirtyList(tls *libc.TLS, pCache uintptr) uintptr { /* sqlite3
//
// This is not the total number of pages referenced, but the sum of the
// reference count for all pages.
-func Xsqlite3PcacheRefCount(tls *libc.TLS, pCache uintptr) int32 { /* sqlite3.c:50591:20: */
+func Xsqlite3PcacheRefCount(tls *libc.TLS, pCache uintptr) int32 { /* sqlite3.c:50599:20: */
return (*PCache)(unsafe.Pointer(pCache)).FnRefSum
}
// Return the number of references to the page supplied as an argument.
-func Xsqlite3PcachePageRefcount(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:50598:20: */
+func Xsqlite3PcachePageRefcount(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:50606:20: */
return int32((*PgHdr)(unsafe.Pointer(p)).FnRef)
}
// Return the total number of pages in the cache.
-func Xsqlite3PcachePagecount(tls *libc.TLS, pCache uintptr) int32 { /* sqlite3.c:50605:20: */
+func Xsqlite3PcachePagecount(tls *libc.TLS, pCache uintptr) int32 { /* sqlite3.c:50613:20: */
return (*struct {
f func(*libc.TLS, uintptr) int32
@@ -28900,7 +29482,7 @@ func Xsqlite3PcachePagecount(tls *libc.TLS, pCache uintptr) int32 { /* sqlite3.c
}
// Set the suggested cache-size value.
-func Xsqlite3PcacheSetCachesize(tls *libc.TLS, pCache uintptr, mxPage int32) { /* sqlite3.c:50622:21: */
+func Xsqlite3PcacheSetCachesize(tls *libc.TLS, pCache uintptr, mxPage int32) { /* sqlite3.c:50630:21: */
(*PCache)(unsafe.Pointer(pCache)).FszCache = mxPage
(*struct {
@@ -28912,12 +29494,12 @@ func Xsqlite3PcacheSetCachesize(tls *libc.TLS, pCache uintptr, mxPage int32) { /
// Set the suggested cache-spill value. Make no changes if if the
// argument is zero. Return the effective cache-spill size, which will
// be the larger of the szSpill and szCache.
-func Xsqlite3PcacheSetSpillsize(tls *libc.TLS, p uintptr, mxPage int32) int32 { /* sqlite3.c:50634:20: */
+func Xsqlite3PcacheSetSpillsize(tls *libc.TLS, p uintptr, mxPage int32) int32 { /* sqlite3.c:50642:20: */
var res int32
if mxPage != 0 {
if mxPage < 0 {
- mxPage = (int32((int64(-1024) * I64(mxPage)) / (I64((*PCache)(unsafe.Pointer(p)).FszPage + (*PCache)(unsafe.Pointer(p)).FszExtra))))
+ mxPage = int32(int64(-1024) * I64(mxPage) / I64((*PCache)(unsafe.Pointer(p)).FszPage+(*PCache)(unsafe.Pointer(p)).FszExtra))
}
(*PCache)(unsafe.Pointer(p)).FszSpill = mxPage
}
@@ -28929,20 +29511,20 @@ func Xsqlite3PcacheSetSpillsize(tls *libc.TLS, p uintptr, mxPage int32) int32 {
}
// Free up as much memory as possible from the page cache.
-func Xsqlite3PcacheShrink(tls *libc.TLS, pCache uintptr) { /* sqlite3.c:50651:21: */
+func Xsqlite3PcacheShrink(tls *libc.TLS, pCache uintptr) { /* sqlite3.c:50659:21: */
(*struct{ f func(*libc.TLS, uintptr) })(unsafe.Pointer(&struct{ uintptr }{Xsqlite3Config.Fpcache2.FxShrink})).f(tls, (*PCache)(unsafe.Pointer(pCache)).FpCache)
}
// Return the size of the header added by this middleware layer
// in the page-cache hierarchy.
-func Xsqlite3HeaderSizePcache(tls *libc.TLS) int32 { /* sqlite3.c:50660:20: */
- return (int32(((uint32(unsafe.Sizeof(PgHdr{}))) + uint32(7)) & libc.Uint32FromInt32(libc.CplInt32(7))))
+func Xsqlite3HeaderSizePcache(tls *libc.TLS) int32 { /* sqlite3.c:50668:20: */
+ return int32((uint32(unsafe.Sizeof(PgHdr{})) + uint32(7)) & libc.Uint32FromInt32(libc.CplInt32(7)))
}
// Return the number of dirty pages currently in the cache, as a percentage
// of the configured cache size.
-func Xsqlite3PCachePercentDirty(tls *libc.TLS, pCache uintptr) int32 { /* sqlite3.c:50666:20: */
+func Xsqlite3PCachePercentDirty(tls *libc.TLS, pCache uintptr) int32 { /* sqlite3.c:50674:20: */
var pDirty uintptr
var nDirty int32 = 0
var nCache int32 = numberOfCachePages(tls, pCache)
@@ -28950,7 +29532,7 @@ func Xsqlite3PCachePercentDirty(tls *libc.TLS, pCache uintptr) int32 { /* sqlite
nDirty++
}
if nCache != 0 {
- return (int32((I64(nDirty) * int64(100)) / I64(nCache)))
+ return int32(I64(nDirty) * int64(100) / I64(nCache))
}
return 0
}
@@ -29057,7 +29639,7 @@ type PCache11 = struct {
FapHash uintptr
FpFree uintptr
FpBulk uintptr
-} /* sqlite3.c:50783:9 */
+} /* sqlite3.c:50791:9 */
//************* End of pcache.c *********************************************
//************* Begin file pcache1.c ****************************************
@@ -29143,7 +29725,7 @@ type PCache11 = struct {
// common workloads.
// #include "sqliteInt.h"
-type PCache1 = PCache11 /* sqlite3.c:50783:24 */
+type PCache1 = PCache11 /* sqlite3.c:50791:24 */
type PgHdr11 = struct {
Fpage Sqlite3_pcache_page
FiKey uint32
@@ -29153,12 +29735,12 @@ type PgHdr11 = struct {
FpCache uintptr
FpLruNext uintptr
FpLruPrev uintptr
-} /* sqlite3.c:50783:9 */
+} /* sqlite3.c:50791:9 */
-type PgHdr1 = PgHdr11 /* sqlite3.c:50784:23 */
-type PgFreeslot1 = struct{ FpNext uintptr } /* sqlite3.c:50785:9 */
+type PgHdr1 = PgHdr11 /* sqlite3.c:50792:23 */
+type PgFreeslot1 = struct{ FpNext uintptr } /* sqlite3.c:50793:9 */
-type PgFreeslot = PgFreeslot1 /* sqlite3.c:50785:27 */
+type PgFreeslot = PgFreeslot1 /* sqlite3.c:50793:27 */
type PGroup1 = struct {
Fmutex uintptr
FnMaxPage uint32
@@ -29166,9 +29748,9 @@ type PGroup1 = struct {
FmxPinned uint32
FnPurgeable uint32
Flru PgHdr1
-} /* sqlite3.c:50783:9 */
+} /* sqlite3.c:50791:9 */
-type PGroup = PGroup1 /* sqlite3.c:50786:23 */
+type PGroup = PGroup1 /* sqlite3.c:50794:23 */
// Global data used by this cache.
type PCacheGlobal = struct {
@@ -29185,10 +29767,10 @@ type PCacheGlobal = struct {
FpFree uintptr
FnFreeSlot int32
FbUnderPressure int32
-} /* sqlite3.c:50903:19 */
+} /* sqlite3.c:50911:19 */
// Global data used by this cache.
-var pcache1_g PCacheGlobal /* sqlite3.c:50927:3: */
+var pcache1_g PCacheGlobal /* sqlite3.c:50935:3: */
// All code in this file should access the global structure above via the
// alias "pcache1". This ensures that the WSD emulation is used when
@@ -29206,7 +29788,7 @@ var pcache1_g PCacheGlobal /* sqlite3.c:50927:3: */
//
// This routine is called from sqlite3_initialize() and so it is guaranteed
// to be serialized already. There is no need for further mutexing.
-func Xsqlite3PCacheBufferSetup(tls *libc.TLS, pBuf uintptr, sz int32, n int32) { /* sqlite3.c:50962:21: */
+func Xsqlite3PCacheBufferSetup(tls *libc.TLS, pBuf uintptr, sz int32, n int32) { /* sqlite3.c:50970:21: */
if pcache1_g.FisInit != 0 {
var p uintptr
if pBuf == uintptr(0) {
@@ -29215,14 +29797,14 @@ func Xsqlite3PCacheBufferSetup(tls *libc.TLS, pBuf uintptr, sz int32, n int32) {
if n == 0 {
sz = 0
}
- sz = ((sz) & libc.CplInt32(7))
+ sz = sz & libc.CplInt32(7)
pcache1_g.FszSlot = sz
- pcache1_g.FnSlot = libc.AssignPtrInt32(uintptr(unsafe.Pointer(&pcache1_g))+92 /* &.nFreeSlot */, n)
+ pcache1_g.FnSlot = libc.AssignPtrInt32(uintptr(unsafe.Pointer(&pcache1_g))+92, n)
pcache1_g.FnReserve = func() int32 {
if n > 90 {
return 10
}
- return ((n / 10) + 1)
+ return n/10 + 1
}()
pcache1_g.FpStart = pBuf
pcache1_g.FpFree = uintptr(0)
@@ -29231,7 +29813,7 @@ func Xsqlite3PCacheBufferSetup(tls *libc.TLS, pBuf uintptr, sz int32, n int32) {
p = pBuf
(*PgFreeslot)(unsafe.Pointer(p)).FpNext = pcache1_g.FpFree
pcache1_g.FpFree = p
- pBuf = ((pBuf) + uintptr(sz))
+ pBuf = pBuf + uintptr(sz)
}
pcache1_g.FpEnd = pBuf
}
@@ -29239,7 +29821,7 @@ func Xsqlite3PCacheBufferSetup(tls *libc.TLS, pBuf uintptr, sz int32, n int32) {
// Try to initialize the pCache->pFree and pCache->pBulk fields. Return
// true if pCache->pFree ends up containing one or more free pages.
-func pcache1InitBulk(tls *libc.TLS, pCache uintptr) int32 { /* sqlite3.c:50988:12: */
+func pcache1InitBulk(tls *libc.TLS, pCache uintptr) int32 { /* sqlite3.c:50996:12: */
var szBulk I64
var zBulk uintptr
if pcache1_g.FnInitPage == 0 {
@@ -29251,21 +29833,21 @@ func pcache1InitBulk(tls *libc.TLS, pCache uintptr) int32 { /* sqlite3.c:50988:1
}
Xsqlite3BeginBenignMalloc(tls)
if pcache1_g.FnInitPage > 0 {
- szBulk = (I64((*PCache1)(unsafe.Pointer(pCache)).FszAlloc) * I64(pcache1_g.FnInitPage))
+ szBulk = I64((*PCache1)(unsafe.Pointer(pCache)).FszAlloc) * I64(pcache1_g.FnInitPage)
} else {
- szBulk = (int64(-1024) * I64(pcache1_g.FnInitPage))
+ szBulk = int64(-1024) * I64(pcache1_g.FnInitPage)
}
- if szBulk > (I64((*PCache1)(unsafe.Pointer(pCache)).FszAlloc) * I64((*PCache1)(unsafe.Pointer(pCache)).FnMax)) {
- szBulk = (I64((*PCache1)(unsafe.Pointer(pCache)).FszAlloc) * I64((*PCache1)(unsafe.Pointer(pCache)).FnMax))
+ if szBulk > I64((*PCache1)(unsafe.Pointer(pCache)).FszAlloc)*I64((*PCache1)(unsafe.Pointer(pCache)).FnMax) {
+ szBulk = I64((*PCache1)(unsafe.Pointer(pCache)).FszAlloc) * I64((*PCache1)(unsafe.Pointer(pCache)).FnMax)
}
- zBulk = libc.AssignPtrUintptr(pCache+64 /* &.pBulk */, Xsqlite3Malloc(tls, uint64(szBulk)))
+ zBulk = libc.AssignPtrUintptr(pCache+64, Xsqlite3Malloc(tls, uint64(szBulk)))
Xsqlite3EndBenignMalloc(tls)
if zBulk != 0 {
- var nBulk int32 = (Xsqlite3MallocSize(tls, zBulk) / (*PCache1)(unsafe.Pointer(pCache)).FszAlloc)
+ var nBulk int32 = Xsqlite3MallocSize(tls, zBulk) / (*PCache1)(unsafe.Pointer(pCache)).FszAlloc
for ok := true; ok; ok = libc.PreDecInt32(&nBulk, 1) != 0 {
- var pX uintptr = (zBulk + uintptr((*PCache1)(unsafe.Pointer(pCache)).FszPage))
+ var pX uintptr = zBulk + uintptr((*PCache1)(unsafe.Pointer(pCache)).FszPage)
(*PgHdr1)(unsafe.Pointer(pX)).Fpage.FpBuf = zBulk
- (*PgHdr1)(unsafe.Pointer(pX)).Fpage.FpExtra = (pX + 1*32)
+ (*PgHdr1)(unsafe.Pointer(pX)).Fpage.FpExtra = pX + 1*32
(*PgHdr1)(unsafe.Pointer(pX)).FisBulkLocal = U16(1)
(*PgHdr1)(unsafe.Pointer(pX)).FisAnchor = U16(0)
(*PgHdr1)(unsafe.Pointer(pX)).FpNext = (*PCache1)(unsafe.Pointer(pCache)).FpFree
@@ -29274,7 +29856,7 @@ func pcache1InitBulk(tls *libc.TLS, pCache uintptr) int32 { /* sqlite3.c:50988:1
zBulk += uintptr((*PCache1)(unsafe.Pointer(pCache)).FszAlloc)
}
}
- return (libc.Bool32((*PCache1)(unsafe.Pointer(pCache)).FpFree != uintptr(0)))
+ return libc.Bool32((*PCache1)(unsafe.Pointer(pCache)).FpFree != uintptr(0))
}
// Malloc function used within this file to allocate space from the buffer
@@ -29284,7 +29866,7 @@ func pcache1InitBulk(tls *libc.TLS, pCache uintptr) int32 { /* sqlite3.c:50988:1
//
// Multiple threads can run this routine at the same time. Global variables
// in pcache1 need to be protected via mutex.
-func pcache1Alloc(tls *libc.TLS, nByte int32) uintptr { /* sqlite3.c:51031:13: */
+func pcache1Alloc(tls *libc.TLS, nByte int32) uintptr { /* sqlite3.c:51039:13: */
var p uintptr = uintptr(0)
if nByte <= pcache1_g.FszSlot {
@@ -29293,7 +29875,7 @@ func pcache1Alloc(tls *libc.TLS, nByte int32) uintptr { /* sqlite3.c:51031:13: *
if p != 0 {
pcache1_g.FpFree = (*PgFreeslot)(unsafe.Pointer(pcache1_g.FpFree)).FpNext
pcache1_g.FnFreeSlot--
- pcache1_g.FbUnderPressure = (libc.Bool32(pcache1_g.FnFreeSlot < pcache1_g.FnReserve))
+ pcache1_g.FbUnderPressure = libc.Bool32(pcache1_g.FnFreeSlot < pcache1_g.FnReserve)
Xsqlite3StatusHighwater(tls, SQLITE_STATUS_PAGECACHE_SIZE, nByte)
Xsqlite3StatusUp(tls, SQLITE_STATUS_PAGECACHE_USED, 1)
@@ -29317,11 +29899,11 @@ func pcache1Alloc(tls *libc.TLS, nByte int32) uintptr { /* sqlite3.c:51031:13: *
}
// Free an allocated buffer obtained from pcache1Alloc().
-func pcache1Free(tls *libc.TLS, p uintptr) { /* sqlite3.c:51069:13: */
+func pcache1Free(tls *libc.TLS, p uintptr) { /* sqlite3.c:51077:13: */
if p == uintptr(0) {
return
}
- if (Uptr((p)) >= Uptr((pcache1_g.FpStart))) && (Uptr((p)) < Uptr((pcache1_g.FpEnd))) {
+ if Uptr(p) >= Uptr(pcache1_g.FpStart) && Uptr(p) < Uptr(pcache1_g.FpEnd) {
var pSlot uintptr
Xsqlite3_mutex_enter(tls, pcache1_g.Fmutex)
Xsqlite3StatusDown(tls, SQLITE_STATUS_PAGECACHE_USED, 1)
@@ -29329,7 +29911,7 @@ func pcache1Free(tls *libc.TLS, p uintptr) { /* sqlite3.c:51069:13: */
(*PgFreeslot)(unsafe.Pointer(pSlot)).FpNext = pcache1_g.FpFree
pcache1_g.FpFree = pSlot
pcache1_g.FnFreeSlot++
- pcache1_g.FbUnderPressure = (libc.Bool32(pcache1_g.FnFreeSlot < pcache1_g.FnReserve))
+ pcache1_g.FbUnderPressure = libc.Bool32(pcache1_g.FnFreeSlot < pcache1_g.FnReserve)
Xsqlite3_mutex_leave(tls, pcache1_g.Fmutex)
} else {
@@ -29347,8 +29929,8 @@ func pcache1Free(tls *libc.TLS, p uintptr) { /* sqlite3.c:51069:13: */
}
// Return the size of a pcache allocation
-func pcache1MemSize(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:51102:12: */
- if (p >= pcache1_g.FpStart) && (p < pcache1_g.FpEnd) {
+func pcache1MemSize(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:51110:12: */
+ if p >= pcache1_g.FpStart && p < pcache1_g.FpEnd {
return pcache1_g.FszSlot
} else {
var iSize int32
@@ -29361,11 +29943,11 @@ func pcache1MemSize(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:51102:12: */
}
// Allocate a new page object initially associated with cache pCache.
-func pcache1AllocPage(tls *libc.TLS, pCache uintptr, benignMalloc int32) uintptr { /* sqlite3.c:51119:15: */
+func pcache1AllocPage(tls *libc.TLS, pCache uintptr, benignMalloc int32) uintptr { /* sqlite3.c:51127:15: */
var p uintptr = uintptr(0)
var pPg uintptr
- if ((*PCache1)(unsafe.Pointer(pCache)).FpFree != 0) || (((*PCache1)(unsafe.Pointer(pCache)).FnPage == uint32(0)) && (pcache1InitBulk(tls, pCache) != 0)) {
+ if (*PCache1)(unsafe.Pointer(pCache)).FpFree != 0 || (*PCache1)(unsafe.Pointer(pCache)).FnPage == uint32(0) && pcache1InitBulk(tls, pCache) != 0 {
p = (*PCache1)(unsafe.Pointer(pCache)).FpFree
(*PCache1)(unsafe.Pointer(pCache)).FpFree = (*PgHdr1)(unsafe.Pointer(p)).FpNext
@@ -29387,19 +29969,19 @@ func pcache1AllocPage(tls *libc.TLS, pCache uintptr, benignMalloc int32) uintptr
if pPg == uintptr(0) {
return uintptr(0)
}
- p = ((pPg) + uintptr((*PCache1)(unsafe.Pointer(pCache)).FszPage))
+ p = pPg + uintptr((*PCache1)(unsafe.Pointer(pCache)).FszPage)
(*PgHdr1)(unsafe.Pointer(p)).Fpage.FpBuf = pPg
- (*PgHdr1)(unsafe.Pointer(p)).Fpage.FpExtra = (p + 1*32)
+ (*PgHdr1)(unsafe.Pointer(p)).Fpage.FpExtra = p + 1*32
(*PgHdr1)(unsafe.Pointer(p)).FisBulkLocal = U16(0)
(*PgHdr1)(unsafe.Pointer(p)).FisAnchor = U16(0)
(*PgHdr1)(unsafe.Pointer(p)).FpLruPrev = uintptr(0) // Initializing this saves a valgrind error
}
- (*(*uint32)(unsafe.Pointer((*PCache1)(unsafe.Pointer(pCache)).FpnPurgeable)))++
+ *(*uint32)(unsafe.Pointer((*PCache1)(unsafe.Pointer(pCache)).FpnPurgeable))++
return p
}
// Free a page object allocated by pcache1AllocPage().
-func pcache1FreePage(tls *libc.TLS, p uintptr) { /* sqlite3.c:51171:13: */
+func pcache1FreePage(tls *libc.TLS, p uintptr) { /* sqlite3.c:51179:13: */
var pCache uintptr
pCache = (*PgHdr1)(unsafe.Pointer(p)).FpCache
@@ -29410,19 +29992,19 @@ func pcache1FreePage(tls *libc.TLS, p uintptr) { /* sqlite3.c:51171:13: */
} else {
pcache1Free(tls, (*PgHdr1)(unsafe.Pointer(p)).Fpage.FpBuf)
}
- (*(*uint32)(unsafe.Pointer((*PCache1)(unsafe.Pointer(pCache)).FpnPurgeable)))--
+ *(*uint32)(unsafe.Pointer((*PCache1)(unsafe.Pointer(pCache)).FpnPurgeable))--
}
// Malloc function used by SQLite to obtain space from the buffer configured
// using sqlite3_config(SQLITE_CONFIG_PAGECACHE) option. If no such buffer
// exists, this function falls back to sqlite3Malloc().
-func Xsqlite3PageMalloc(tls *libc.TLS, sz int32) uintptr { /* sqlite3.c:51193:21: */
+func Xsqlite3PageMalloc(tls *libc.TLS, sz int32) uintptr { /* sqlite3.c:51201:21: */
// These allocations are never very large
return pcache1Alloc(tls, sz)
}
// Free an allocated buffer obtained from sqlite3PageMalloc().
-func Xsqlite3PageFree(tls *libc.TLS, p uintptr) { /* sqlite3.c:51201:21: */
+func Xsqlite3PageFree(tls *libc.TLS, p uintptr) { /* sqlite3.c:51209:21: */
pcache1Free(tls, p)
}
@@ -29440,8 +30022,8 @@ func Xsqlite3PageFree(tls *libc.TLS, p uintptr) { /* sqlite3.c:51201:21: */
// under memory pressure, then again it is desirable to avoid
// allocating a new page cache entry in order to avoid stressing
// the heap even further.
-func pcache1UnderMemoryPressure(tls *libc.TLS, pCache uintptr) int32 { /* sqlite3.c:51222:12: */
- if (pcache1_g.FnSlot != 0) && (((*PCache1)(unsafe.Pointer(pCache)).FszPage + (*PCache1)(unsafe.Pointer(pCache)).FszExtra) <= pcache1_g.FszSlot) {
+func pcache1UnderMemoryPressure(tls *libc.TLS, pCache uintptr) int32 { /* sqlite3.c:51230:12: */
+ if pcache1_g.FnSlot != 0 && (*PCache1)(unsafe.Pointer(pCache)).FszPage+(*PCache1)(unsafe.Pointer(pCache)).FszExtra <= pcache1_g.FszSlot {
return pcache1_g.FbUnderPressure
} else {
return Xsqlite3HeapNearlyFull(tls)
@@ -29456,12 +30038,12 @@ func pcache1UnderMemoryPressure(tls *libc.TLS, pCache uintptr) int32 { /* sqlite
// as the first argument.
//
// The PCache mutex must be held when this function is called.
-func pcache1ResizeHash(tls *libc.TLS, p uintptr) { /* sqlite3.c:51239:13: */
+func pcache1ResizeHash(tls *libc.TLS, p uintptr) { /* sqlite3.c:51247:13: */
var apNew uintptr
var nNew uint32
var i uint32
- nNew = ((*PCache1)(unsafe.Pointer(p)).FnHash * uint32(2))
+ nNew = (*PCache1)(unsafe.Pointer(p)).FnHash * uint32(2)
if nNew < uint32(256) {
nNew = uint32(256)
}
@@ -29470,7 +30052,7 @@ func pcache1ResizeHash(tls *libc.TLS, p uintptr) { /* sqlite3.c:51239:13: */
if (*PCache1)(unsafe.Pointer(p)).FnHash != 0 {
Xsqlite3BeginBenignMalloc(tls)
}
- apNew = Xsqlite3MallocZero(tls, (uint64(uint32(unsafe.Sizeof(uintptr(0))) * nNew)))
+ apNew = Xsqlite3MallocZero(tls, uint64(uint32(unsafe.Sizeof(uintptr(0)))*nNew))
if (*PCache1)(unsafe.Pointer(p)).FnHash != 0 {
Xsqlite3EndBenignMalloc(tls)
}
@@ -29479,8 +30061,8 @@ func pcache1ResizeHash(tls *libc.TLS, p uintptr) { /* sqlite3.c:51239:13: */
for i = uint32(0); i < (*PCache1)(unsafe.Pointer(p)).FnHash; i++ {
var pPage uintptr
var pNext uintptr = *(*uintptr)(unsafe.Pointer((*PCache1)(unsafe.Pointer(p)).FapHash + uintptr(i)*4))
- for (libc.AssignUintptr(&pPage, pNext)) != uintptr(0) {
- var h uint32 = ((*PgHdr1)(unsafe.Pointer(pPage)).FiKey % nNew)
+ for libc.AssignUintptr(&pPage, pNext) != uintptr(0) {
+ var h uint32 = (*PgHdr1)(unsafe.Pointer(pPage)).FiKey % nNew
pNext = (*PgHdr1)(unsafe.Pointer(pPage)).FpNext
(*PgHdr1)(unsafe.Pointer(pPage)).FpNext = *(*uintptr)(unsafe.Pointer(apNew + uintptr(h)*4))
*(*uintptr)(unsafe.Pointer(apNew + uintptr(h)*4)) = pPage
@@ -29497,7 +30079,7 @@ func pcache1ResizeHash(tls *libc.TLS, p uintptr) { /* sqlite3.c:51239:13: */
// LRU list, then this function is a no-op.
//
// The PGroup mutex must be held when this function is called.
-func pcache1PinPage(tls *libc.TLS, pPage uintptr) uintptr { /* sqlite3.c:51280:15: */
+func pcache1PinPage(tls *libc.TLS, pPage uintptr) uintptr { /* sqlite3.c:51288:15: */
(*PgHdr1)(unsafe.Pointer((*PgHdr1)(unsafe.Pointer(pPage)).FpLruPrev)).FpLruNext = (*PgHdr1)(unsafe.Pointer(pPage)).FpLruNext
(*PgHdr1)(unsafe.Pointer((*PgHdr1)(unsafe.Pointer(pPage)).FpLruNext)).FpLruPrev = (*PgHdr1)(unsafe.Pointer(pPage)).FpLruPrev
@@ -29514,13 +30096,13 @@ func pcache1PinPage(tls *libc.TLS, pPage uintptr) uintptr { /* sqlite3.c:51280:1
// Also free the page if freePage is true.
//
// The PGroup mutex must be held when this function is called.
-func pcache1RemoveFromHash(tls *libc.TLS, pPage uintptr, freeFlag int32) { /* sqlite3.c:51305:13: */
+func pcache1RemoveFromHash(tls *libc.TLS, pPage uintptr, freeFlag int32) { /* sqlite3.c:51313:13: */
var h uint32
var pCache uintptr = (*PgHdr1)(unsafe.Pointer(pPage)).FpCache
var pp uintptr
- h = ((*PgHdr1)(unsafe.Pointer(pPage)).FiKey % (*PCache1)(unsafe.Pointer(pCache)).FnHash)
- for pp = ((*PCache1)(unsafe.Pointer(pCache)).FapHash + uintptr(h)*4); (*(*uintptr)(unsafe.Pointer(pp))) != pPage; pp = (*(*uintptr)(unsafe.Pointer(pp)) + 16 /* &.pNext */) {
+ h = (*PgHdr1)(unsafe.Pointer(pPage)).FiKey % (*PCache1)(unsafe.Pointer(pCache)).FnHash
+ for pp = (*PCache1)(unsafe.Pointer(pCache)).FapHash + uintptr(h)*4; *(*uintptr)(unsafe.Pointer(pp)) != pPage; pp = *(*uintptr)(unsafe.Pointer(pp)) + 16 {
}
*(*uintptr)(unsafe.Pointer(pp)) = (*PgHdr1)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pp)))).FpNext
@@ -29532,19 +30114,19 @@ func pcache1RemoveFromHash(tls *libc.TLS, pPage uintptr, freeFlag int32) { /* sq
// If there are currently more than nMaxPage pages allocated, try
// to recycle pages to reduce the number allocated to nMaxPage.
-func pcache1EnforceMaxPage(tls *libc.TLS, pCache uintptr) { /* sqlite3.c:51323:13: */
+func pcache1EnforceMaxPage(tls *libc.TLS, pCache uintptr) { /* sqlite3.c:51331:13: */
var pGroup uintptr = (*PCache1)(unsafe.Pointer(pCache)).FpGroup
var p uintptr
- for ((*PGroup)(unsafe.Pointer(pGroup)).FnPurgeable > (*PGroup)(unsafe.Pointer(pGroup)).FnMaxPage) &&
- (int32((*PgHdr1)(unsafe.Pointer((libc.AssignUintptr(&p, (*PGroup)(unsafe.Pointer(pGroup)).Flru.FpLruPrev)))).FisAnchor) == 0) {
+ for (*PGroup)(unsafe.Pointer(pGroup)).FnPurgeable > (*PGroup)(unsafe.Pointer(pGroup)).FnMaxPage &&
+ int32((*PgHdr1)(unsafe.Pointer(libc.AssignUintptr(&p, (*PGroup)(unsafe.Pointer(pGroup)).Flru.FpLruPrev))).FisAnchor) == 0 {
pcache1PinPage(tls, p)
pcache1RemoveFromHash(tls, p, 1)
}
- if ((*PCache1)(unsafe.Pointer(pCache)).FnPage == uint32(0)) && ((*PCache1)(unsafe.Pointer(pCache)).FpBulk != 0) {
+ if (*PCache1)(unsafe.Pointer(pCache)).FnPage == uint32(0) && (*PCache1)(unsafe.Pointer(pCache)).FpBulk != 0 {
Xsqlite3_free(tls, (*PCache1)(unsafe.Pointer(pCache)).FpBulk)
- (*PCache1)(unsafe.Pointer(pCache)).FpBulk = libc.AssignPtrUintptr(pCache+60 /* &.pFree */, uintptr(0))
+ (*PCache1)(unsafe.Pointer(pCache)).FpBulk = libc.AssignPtrUintptr(pCache+60, uintptr(0))
}
}
@@ -29553,46 +30135,46 @@ func pcache1EnforceMaxPage(tls *libc.TLS, pCache uintptr) { /* sqlite3.c:51323:1
// criteria are unpinned before they are discarded.
//
// The PCache mutex must be held when this function is called.
-func pcache1TruncateUnsafe(tls *libc.TLS, pCache uintptr, iLimit uint32) { /* sqlite3.c:51348:13: */
+func pcache1TruncateUnsafe(tls *libc.TLS, pCache uintptr, iLimit uint32) { /* sqlite3.c:51356:13: */
var h uint32
var iStop uint32
- if ((*PCache1)(unsafe.Pointer(pCache)).FiMaxKey - iLimit) < (*PCache1)(unsafe.Pointer(pCache)).FnHash {
+ if (*PCache1)(unsafe.Pointer(pCache)).FiMaxKey-iLimit < (*PCache1)(unsafe.Pointer(pCache)).FnHash {
// If we are just shaving the last few pages off the end of the
// cache, then there is no point in scanning the entire hash table.
// Only scan those hash slots that might contain pages that need to
// be removed.
- h = (iLimit % (*PCache1)(unsafe.Pointer(pCache)).FnHash)
- iStop = ((*PCache1)(unsafe.Pointer(pCache)).FiMaxKey % (*PCache1)(unsafe.Pointer(pCache)).FnHash)
+ h = iLimit % (*PCache1)(unsafe.Pointer(pCache)).FnHash
+ iStop = (*PCache1)(unsafe.Pointer(pCache)).FiMaxKey % (*PCache1)(unsafe.Pointer(pCache)).FnHash
} else {
// This is the general case where many pages are being removed.
// It is necessary to scan the entire hash table
- h = ((*PCache1)(unsafe.Pointer(pCache)).FnHash / uint32(2))
- iStop = (h - uint32(1))
+ h = (*PCache1)(unsafe.Pointer(pCache)).FnHash / uint32(2)
+ iStop = h - uint32(1)
}
for {
var pp uintptr
var pPage uintptr
- pp = ((*PCache1)(unsafe.Pointer(pCache)).FapHash + uintptr(h)*4)
- for (libc.AssignUintptr(&pPage, *(*uintptr)(unsafe.Pointer(pp)))) != uintptr(0) {
+ pp = (*PCache1)(unsafe.Pointer(pCache)).FapHash + uintptr(h)*4
+ for libc.AssignUintptr(&pPage, *(*uintptr)(unsafe.Pointer(pp))) != uintptr(0) {
if (*PgHdr1)(unsafe.Pointer(pPage)).FiKey >= iLimit {
(*PCache1)(unsafe.Pointer(pCache)).FnPage--
*(*uintptr)(unsafe.Pointer(pp)) = (*PgHdr1)(unsafe.Pointer(pPage)).FpNext
- if (*PgHdr1)(unsafe.Pointer((pPage))).FpLruNext != uintptr(0) {
+ if (*PgHdr1)(unsafe.Pointer(pPage)).FpLruNext != uintptr(0) {
pcache1PinPage(tls, pPage)
}
pcache1FreePage(tls, pPage)
} else {
- pp = (pPage + 16 /* &.pNext */)
+ pp = pPage + 16
}
}
if h == iStop {
break
}
- h = ((h + uint32(1)) % (*PCache1)(unsafe.Pointer(pCache)).FnHash)
+ h = (h + uint32(1)) % (*PCache1)(unsafe.Pointer(pCache)).FnHash
}
}
@@ -29601,7 +30183,7 @@ func pcache1TruncateUnsafe(tls *libc.TLS, pCache uintptr, iLimit uint32) { /* sq
//******* sqlite3_pcache Methods *********************************************
// Implementation of the sqlite3_pcache.xInit method.
-func pcache1Init(tls *libc.TLS, NotUsed uintptr) int32 { /* sqlite3.c:51399:12: */
+func pcache1Init(tls *libc.TLS, NotUsed uintptr) int32 { /* sqlite3.c:51407:12: */
_ = NotUsed
libc.Xmemset(tls, uintptr(unsafe.Pointer(&pcache1_g)), 0, uint32(unsafe.Sizeof(pcache1_g)))
@@ -29624,9 +30206,9 @@ func pcache1Init(tls *libc.TLS, NotUsed uintptr) int32 { /* sqlite3.c:51399:12:
pcache1_g.Fgrp.Fmutex = Xsqlite3MutexAlloc(tls, SQLITE_MUTEX_STATIC_LRU)
pcache1_g.Fmutex = Xsqlite3MutexAlloc(tls, SQLITE_MUTEX_STATIC_PMEM)
}
- if ((pcache1_g.FseparateCache != 0) &&
- (Xsqlite3Config.FnPage != 0)) &&
- (Xsqlite3Config.FpPage == uintptr(0)) {
+ if pcache1_g.FseparateCache != 0 &&
+ Xsqlite3Config.FnPage != 0 &&
+ Xsqlite3Config.FpPage == uintptr(0) {
pcache1_g.FnInitPage = Xsqlite3Config.FnPage
} else {
pcache1_g.FnInitPage = 0
@@ -29639,7 +30221,7 @@ func pcache1Init(tls *libc.TLS, NotUsed uintptr) int32 { /* sqlite3.c:51399:12:
// Implementation of the sqlite3_pcache.xShutdown method.
// Note that the static mutex allocated in xInit does
// not need to be freed.
-func pcache1Shutdown(tls *libc.TLS, NotUsed uintptr) { /* sqlite3.c:51452:13: */
+func pcache1Shutdown(tls *libc.TLS, NotUsed uintptr) { /* sqlite3.c:51460:13: */
_ = NotUsed
libc.Xmemset(tls, uintptr(unsafe.Pointer(&pcache1_g)), 0, uint32(unsafe.Sizeof(pcache1_g)))
@@ -29648,29 +30230,29 @@ func pcache1Shutdown(tls *libc.TLS, NotUsed uintptr) { /* sqlite3.c:51452:13: */
// Implementation of the sqlite3_pcache.xCreate method.
//
// Allocate a new cache.
-func pcache1Create(tls *libc.TLS, szPage int32, szExtra int32, bPurgeable int32) uintptr { /* sqlite3.c:51466:23: */
+func pcache1Create(tls *libc.TLS, szPage int32, szExtra int32, bPurgeable int32) uintptr { /* sqlite3.c:51474:23: */
var pCache uintptr // The newly created page cache
var pGroup uintptr // The group the new page cache will belong to
var sz int32 // Bytes of memory required to allocate the new cache
- sz = (int32(uint32(unsafe.Sizeof(PCache1{})) + (uint32(unsafe.Sizeof(PGroup{})) * uint32(pcache1_g.FseparateCache))))
+ sz = int32(uint32(unsafe.Sizeof(PCache1{})) + uint32(unsafe.Sizeof(PGroup{}))*uint32(pcache1_g.FseparateCache))
pCache = Xsqlite3MallocZero(tls, uint64(sz))
if pCache != 0 {
if pcache1_g.FseparateCache != 0 {
- pGroup = (pCache + 1*68)
+ pGroup = pCache + 1*68
(*PGroup)(unsafe.Pointer(pGroup)).FmxPinned = uint32(10)
} else {
- pGroup = (uintptr(unsafe.Pointer(&pcache1_g)) /* &.grp */)
+ pGroup = uintptr(unsafe.Pointer(&pcache1_g))
}
Xsqlite3_mutex_enter(tls, (*PGroup)(unsafe.Pointer(pGroup)).Fmutex)
if int32((*PGroup)(unsafe.Pointer(pGroup)).Flru.FisAnchor) == 0 {
(*PGroup)(unsafe.Pointer(pGroup)).Flru.FisAnchor = U16(1)
- (*PGroup)(unsafe.Pointer(pGroup)).Flru.FpLruPrev = libc.AssignPtrUintptr(pGroup+20 /* &.lru */ +24 /* &.pLruNext */, (pGroup + 20 /* &.lru */))
+ (*PGroup)(unsafe.Pointer(pGroup)).Flru.FpLruPrev = libc.AssignPtrUintptr(pGroup+20+24, pGroup+20)
}
(*PCache1)(unsafe.Pointer(pCache)).FpGroup = pGroup
(*PCache1)(unsafe.Pointer(pCache)).FszPage = szPage
(*PCache1)(unsafe.Pointer(pCache)).FszExtra = szExtra
- (*PCache1)(unsafe.Pointer(pCache)).FszAlloc = (int32((uint32(szPage + szExtra)) + (((uint32(unsafe.Sizeof(PgHdr1{}))) + uint32(7)) & libc.Uint32FromInt32(libc.CplInt32(7)))))
+ (*PCache1)(unsafe.Pointer(pCache)).FszAlloc = int32(uint32(szPage+szExtra) + (uint32(unsafe.Sizeof(PgHdr1{}))+uint32(7))&libc.Uint32FromInt32(libc.CplInt32(7)))
(*PCache1)(unsafe.Pointer(pCache)).FbPurgeable = func() int32 {
if bPurgeable != 0 {
return 1
@@ -29680,11 +30262,11 @@ func pcache1Create(tls *libc.TLS, szPage int32, szExtra int32, bPurgeable int32)
pcache1ResizeHash(tls, pCache)
if bPurgeable != 0 {
(*PCache1)(unsafe.Pointer(pCache)).FnMin = uint32(10)
- *(*uint32)(unsafe.Pointer(pGroup + 8 /* &.nMinPage */)) += ((*PCache1)(unsafe.Pointer(pCache)).FnMin)
- (*PGroup)(unsafe.Pointer(pGroup)).FmxPinned = (((*PGroup)(unsafe.Pointer(pGroup)).FnMaxPage + uint32(10)) - (*PGroup)(unsafe.Pointer(pGroup)).FnMinPage)
- (*PCache1)(unsafe.Pointer(pCache)).FpnPurgeable = (pGroup + 16 /* &.nPurgeable */)
+ *(*uint32)(unsafe.Pointer(pGroup + 8)) += (*PCache1)(unsafe.Pointer(pCache)).FnMin
+ (*PGroup)(unsafe.Pointer(pGroup)).FmxPinned = (*PGroup)(unsafe.Pointer(pGroup)).FnMaxPage + uint32(10) - (*PGroup)(unsafe.Pointer(pGroup)).FnMinPage
+ (*PCache1)(unsafe.Pointer(pCache)).FpnPurgeable = pGroup + 16
} else {
- (*PCache1)(unsafe.Pointer(pCache)).FpnPurgeable = (pCache + 40 /* &.nPurgeableDummy */)
+ (*PCache1)(unsafe.Pointer(pCache)).FpnPurgeable = pCache + 40
}
Xsqlite3_mutex_leave(tls, (*PGroup)(unsafe.Pointer(pGroup)).Fmutex)
if (*PCache1)(unsafe.Pointer(pCache)).FnHash == uint32(0) {
@@ -29698,15 +30280,21 @@ func pcache1Create(tls *libc.TLS, szPage int32, szExtra int32, bPurgeable int32)
// Implementation of the sqlite3_pcache.xCachesize method.
//
// Configure the cache_size limit for a cache.
-func pcache1Cachesize(tls *libc.TLS, p uintptr, nMax int32) { /* sqlite3.c:51516:13: */
+func pcache1Cachesize(tls *libc.TLS, p uintptr, nMax int32) { /* sqlite3.c:51524:13: */
var pCache uintptr = p
+ var n U32
+
if (*PCache1)(unsafe.Pointer(pCache)).FbPurgeable != 0 {
var pGroup uintptr = (*PCache1)(unsafe.Pointer(pCache)).FpGroup
Xsqlite3_mutex_enter(tls, (*PGroup)(unsafe.Pointer(pGroup)).Fmutex)
- *(*uint32)(unsafe.Pointer(pGroup + 4 /* &.nMaxPage */)) += (uint32(nMax) - (*PCache1)(unsafe.Pointer(pCache)).FnMax)
- (*PGroup)(unsafe.Pointer(pGroup)).FmxPinned = (((*PGroup)(unsafe.Pointer(pGroup)).FnMaxPage + uint32(10)) - (*PGroup)(unsafe.Pointer(pGroup)).FnMinPage)
- (*PCache1)(unsafe.Pointer(pCache)).FnMax = uint32(nMax)
- (*PCache1)(unsafe.Pointer(pCache)).Fn90pct = (((*PCache1)(unsafe.Pointer(pCache)).FnMax * uint32(9)) / uint32(10))
+ n = U32(nMax)
+ if n > uint32(0x7fff0000)-(*PGroup)(unsafe.Pointer(pGroup)).FnMaxPage+(*PCache1)(unsafe.Pointer(pCache)).FnMax {
+ n = uint32(0x7fff0000) - (*PGroup)(unsafe.Pointer(pGroup)).FnMaxPage + (*PCache1)(unsafe.Pointer(pCache)).FnMax
+ }
+ *(*uint32)(unsafe.Pointer(pGroup + 4)) += n - (*PCache1)(unsafe.Pointer(pCache)).FnMax
+ (*PGroup)(unsafe.Pointer(pGroup)).FmxPinned = (*PGroup)(unsafe.Pointer(pGroup)).FnMaxPage + uint32(10) - (*PGroup)(unsafe.Pointer(pGroup)).FnMinPage
+ (*PCache1)(unsafe.Pointer(pCache)).FnMax = n
+ (*PCache1)(unsafe.Pointer(pCache)).Fn90pct = (*PCache1)(unsafe.Pointer(pCache)).FnMax * uint32(9) / uint32(10)
pcache1EnforceMaxPage(tls, pCache)
Xsqlite3_mutex_leave(tls, (*PGroup)(unsafe.Pointer(pGroup)).Fmutex)
}
@@ -29715,22 +30303,22 @@ func pcache1Cachesize(tls *libc.TLS, p uintptr, nMax int32) { /* sqlite3.c:51516
// Implementation of the sqlite3_pcache.xShrink method.
//
// Free up as much memory as possible.
-func pcache1Shrink(tls *libc.TLS, p uintptr) { /* sqlite3.c:51535:13: */
+func pcache1Shrink(tls *libc.TLS, p uintptr) { /* sqlite3.c:51549:13: */
var pCache uintptr = p
if (*PCache1)(unsafe.Pointer(pCache)).FbPurgeable != 0 {
var pGroup uintptr = (*PCache1)(unsafe.Pointer(pCache)).FpGroup
- var savedMaxPage int32
+ var savedMaxPage uint32
Xsqlite3_mutex_enter(tls, (*PGroup)(unsafe.Pointer(pGroup)).Fmutex)
- savedMaxPage = int32((*PGroup)(unsafe.Pointer(pGroup)).FnMaxPage)
+ savedMaxPage = (*PGroup)(unsafe.Pointer(pGroup)).FnMaxPage
(*PGroup)(unsafe.Pointer(pGroup)).FnMaxPage = uint32(0)
pcache1EnforceMaxPage(tls, pCache)
- (*PGroup)(unsafe.Pointer(pGroup)).FnMaxPage = uint32(savedMaxPage)
+ (*PGroup)(unsafe.Pointer(pGroup)).FnMaxPage = savedMaxPage
Xsqlite3_mutex_leave(tls, (*PGroup)(unsafe.Pointer(pGroup)).Fmutex)
}
}
// Implementation of the sqlite3_pcache.xPagecount method.
-func pcache1Pagecount(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:51552:12: */
+func pcache1Pagecount(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:51566:12: */
var n int32
var pCache uintptr = p
Xsqlite3_mutex_enter(tls, (*PGroup)(unsafe.Pointer((*PCache1)(unsafe.Pointer(pCache)).FpGroup)).Fmutex)
@@ -29745,18 +30333,18 @@ func pcache1Pagecount(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:51552:12: *
// This steps are broken out into a separate procedure because they are
// usually not needed, and by avoiding the stack initialization required
// for these steps, the main pcache1Fetch() procedure can run faster.
-func pcache1FetchStage2(tls *libc.TLS, pCache uintptr, iKey uint32, createFlag int32) uintptr { /* sqlite3.c:51570:31: */
+func pcache1FetchStage2(tls *libc.TLS, pCache uintptr, iKey uint32, createFlag int32) uintptr { /* sqlite3.c:51584:31: */
var nPinned uint32
var pGroup uintptr = (*PCache1)(unsafe.Pointer(pCache)).FpGroup
var pPage uintptr = uintptr(0)
// Step 3: Abort if createFlag is 1 but the cache is nearly full
- nPinned = ((*PCache1)(unsafe.Pointer(pCache)).FnPage - (*PCache1)(unsafe.Pointer(pCache)).FnRecyclable)
+ nPinned = (*PCache1)(unsafe.Pointer(pCache)).FnPage - (*PCache1)(unsafe.Pointer(pCache)).FnRecyclable
- if (createFlag == 1) && (((nPinned >= (*PGroup)(unsafe.Pointer(pGroup)).FmxPinned) ||
- (nPinned >= (*PCache1)(unsafe.Pointer(pCache)).Fn90pct)) ||
- ((pcache1UnderMemoryPressure(tls, pCache) != 0) && ((*PCache1)(unsafe.Pointer(pCache)).FnRecyclable < nPinned))) {
+ if createFlag == 1 && (nPinned >= (*PGroup)(unsafe.Pointer(pGroup)).FmxPinned ||
+ nPinned >= (*PCache1)(unsafe.Pointer(pCache)).Fn90pct ||
+ pcache1UnderMemoryPressure(tls, pCache) != 0 && (*PCache1)(unsafe.Pointer(pCache)).FnRecyclable < nPinned) {
return uintptr(0)
}
@@ -29765,9 +30353,9 @@ func pcache1FetchStage2(tls *libc.TLS, pCache uintptr, iKey uint32, createFlag i
}
// Step 4. Try to recycle a page.
- if (((*PCache1)(unsafe.Pointer(pCache)).FbPurgeable != 0) &&
- !(int32((*PgHdr1)(unsafe.Pointer((*PGroup)(unsafe.Pointer(pGroup)).Flru.FpLruPrev)).FisAnchor) != 0)) &&
- ((((*PCache1)(unsafe.Pointer(pCache)).FnPage + uint32(1)) >= (*PCache1)(unsafe.Pointer(pCache)).FnMax) || (pcache1UnderMemoryPressure(tls, pCache) != 0)) {
+ if (*PCache1)(unsafe.Pointer(pCache)).FbPurgeable != 0 &&
+ !(int32((*PgHdr1)(unsafe.Pointer((*PGroup)(unsafe.Pointer(pGroup)).Flru.FpLruPrev)).FisAnchor) != 0) &&
+ ((*PCache1)(unsafe.Pointer(pCache)).FnPage+uint32(1) >= (*PCache1)(unsafe.Pointer(pCache)).FnMax || pcache1UnderMemoryPressure(tls, pCache) != 0) {
var pOther uintptr
pPage = (*PGroup)(unsafe.Pointer(pGroup)).Flru.FpLruPrev
@@ -29778,18 +30366,18 @@ func pcache1FetchStage2(tls *libc.TLS, pCache uintptr, iKey uint32, createFlag i
pcache1FreePage(tls, pPage)
pPage = uintptr(0)
} else {
- *(*uint32)(unsafe.Pointer(pGroup + 16 /* &.nPurgeable */)) -= (uint32((*PCache1)(unsafe.Pointer(pOther)).FbPurgeable - (*PCache1)(unsafe.Pointer(pCache)).FbPurgeable))
+ *(*uint32)(unsafe.Pointer(pGroup + 16)) -= uint32((*PCache1)(unsafe.Pointer(pOther)).FbPurgeable - (*PCache1)(unsafe.Pointer(pCache)).FbPurgeable)
}
}
// Step 5. If a usable page buffer has still not been found,
// attempt to allocate a new one.
if !(pPage != 0) {
- pPage = pcache1AllocPage(tls, pCache, (libc.Bool32(createFlag == 1)))
+ pPage = pcache1AllocPage(tls, pCache, libc.Bool32(createFlag == 1))
}
if pPage != 0 {
- var h uint32 = (iKey % (*PCache1)(unsafe.Pointer(pCache)).FnHash)
+ var h uint32 = iKey % (*PCache1)(unsafe.Pointer(pCache)).FnHash
(*PCache1)(unsafe.Pointer(pCache)).FnPage++
(*PgHdr1)(unsafe.Pointer(pPage)).FiKey = iKey
(*PgHdr1)(unsafe.Pointer(pPage)).FpNext = *(*uintptr)(unsafe.Pointer((*PCache1)(unsafe.Pointer(pCache)).FapHash + uintptr(h)*4))
@@ -29863,13 +30451,13 @@ func pcache1FetchStage2(tls *libc.TLS, pCache uintptr, iKey uint32, createFlag i
// the general case. pcache1FetchNoMutex() is a faster implementation for
// the common case where pGroup->mutex is NULL. The pcache1Fetch() wrapper
// invokes the appropriate routine.
-func pcache1FetchNoMutex(tls *libc.TLS, p uintptr, iKey uint32, createFlag int32) uintptr { /* sqlite3.c:51698:15: */
+func pcache1FetchNoMutex(tls *libc.TLS, p uintptr, iKey uint32, createFlag int32) uintptr { /* sqlite3.c:51712:15: */
var pCache uintptr = p
var pPage uintptr = uintptr(0)
// Step 1: Search the hash table for an existing entry.
- pPage = *(*uintptr)(unsafe.Pointer((*PCache1)(unsafe.Pointer(pCache)).FapHash + uintptr((iKey%(*PCache1)(unsafe.Pointer(pCache)).FnHash))*4))
- for (pPage != 0) && ((*PgHdr1)(unsafe.Pointer(pPage)).FiKey != iKey) {
+ pPage = *(*uintptr)(unsafe.Pointer((*PCache1)(unsafe.Pointer(pCache)).FapHash + uintptr(iKey%(*PCache1)(unsafe.Pointer(pCache)).FnHash)*4))
+ for pPage != 0 && (*PgHdr1)(unsafe.Pointer(pPage)).FiKey != iKey {
pPage = (*PgHdr1)(unsafe.Pointer(pPage)).FpNext
}
@@ -29878,7 +30466,7 @@ func pcache1FetchNoMutex(tls *libc.TLS, p uintptr, iKey uint32, createFlag int32
// Otherwise (page not in hash and createFlag!=0) continue with
// subsequent steps to try to create the page.
if pPage != 0 {
- if (*PgHdr1)(unsafe.Pointer((pPage))).FpLruNext != uintptr(0) {
+ if (*PgHdr1)(unsafe.Pointer(pPage)).FpLruNext != uintptr(0) {
return pcache1PinPage(tls, pPage)
} else {
return pPage
@@ -29892,7 +30480,7 @@ func pcache1FetchNoMutex(tls *libc.TLS, p uintptr, iKey uint32, createFlag int32
return uintptr(0)
}
-func pcache1FetchWithMutex(tls *libc.TLS, p uintptr, iKey uint32, createFlag int32) uintptr { /* sqlite3.c:51728:15: */
+func pcache1FetchWithMutex(tls *libc.TLS, p uintptr, iKey uint32, createFlag int32) uintptr { /* sqlite3.c:51742:15: */
var pCache uintptr = p
var pPage uintptr
@@ -29903,7 +30491,7 @@ func pcache1FetchWithMutex(tls *libc.TLS, p uintptr, iKey uint32, createFlag int
return pPage
}
-func pcache1Fetch(tls *libc.TLS, p uintptr, iKey uint32, createFlag int32) uintptr { /* sqlite3.c:51743:28: */
+func pcache1Fetch(tls *libc.TLS, p uintptr, iKey uint32, createFlag int32) uintptr { /* sqlite3.c:51757:28: */
var pCache uintptr = p
if (*PGroup)(unsafe.Pointer((*PCache1)(unsafe.Pointer(pCache)).FpGroup)).Fmutex != 0 {
@@ -29917,7 +30505,7 @@ func pcache1Fetch(tls *libc.TLS, p uintptr, iKey uint32, createFlag int32) uintp
// Implementation of the sqlite3_pcache.xUnpin method.
//
// Mark a page as unpinned (eligible for asynchronous recycling).
-func pcache1Unpin(tls *libc.TLS, p uintptr, pPg uintptr, reuseUnlikely int32) { /* sqlite3.c:51774:13: */
+func pcache1Unpin(tls *libc.TLS, p uintptr, pPg uintptr, reuseUnlikely int32) { /* sqlite3.c:51788:13: */
var pCache uintptr = p
var pPage uintptr = pPg
var pGroup uintptr = (*PCache1)(unsafe.Pointer(pCache)).FpGroup
@@ -29927,13 +30515,13 @@ func pcache1Unpin(tls *libc.TLS, p uintptr, pPg uintptr, reuseUnlikely int32) {
// It is an error to call this function if the page is already
// part of the PGroup LRU list.
- if (reuseUnlikely != 0) || ((*PGroup)(unsafe.Pointer(pGroup)).FnPurgeable > (*PGroup)(unsafe.Pointer(pGroup)).FnMaxPage) {
+ if reuseUnlikely != 0 || (*PGroup)(unsafe.Pointer(pGroup)).FnPurgeable > (*PGroup)(unsafe.Pointer(pGroup)).FnMaxPage {
pcache1RemoveFromHash(tls, pPage, 1)
} else {
// Add the page to the PGroup LRU list.
- var ppFirst uintptr = (pGroup + 20 /* &.lru */ + 24 /* &.pLruNext */)
- (*PgHdr1)(unsafe.Pointer(pPage)).FpLruPrev = (pGroup + 20 /* &.lru */)
- (*PgHdr1)(unsafe.Pointer(libc.AssignPtrUintptr(pPage+24 /* &.pLruNext */, *(*uintptr)(unsafe.Pointer(ppFirst))))).FpLruPrev = pPage
+ var ppFirst uintptr = pGroup + 20 + 24
+ (*PgHdr1)(unsafe.Pointer(pPage)).FpLruPrev = pGroup + 20
+ (*PgHdr1)(unsafe.Pointer(libc.AssignPtrUintptr(pPage+24, *(*uintptr)(unsafe.Pointer(ppFirst))))).FpLruPrev = pPage
*(*uintptr)(unsafe.Pointer(ppFirst)) = pPage
(*PCache1)(unsafe.Pointer(pCache)).FnRecyclable++
}
@@ -29942,7 +30530,7 @@ func pcache1Unpin(tls *libc.TLS, p uintptr, pPg uintptr, reuseUnlikely int32) {
}
// Implementation of the sqlite3_pcache.xRekey method.
-func pcache1Rekey(tls *libc.TLS, p uintptr, pPg uintptr, iOld uint32, iNew uint32) { /* sqlite3.c:51809:13: */
+func pcache1Rekey(tls *libc.TLS, p uintptr, pPg uintptr, iOld uint32, iNew uint32) { /* sqlite3.c:51823:13: */
var pCache uintptr = p
var pPage uintptr = pPg
var pp uintptr
@@ -29950,14 +30538,14 @@ func pcache1Rekey(tls *libc.TLS, p uintptr, pPg uintptr, iOld uint32, iNew uint3
Xsqlite3_mutex_enter(tls, (*PGroup)(unsafe.Pointer((*PCache1)(unsafe.Pointer(pCache)).FpGroup)).Fmutex)
- h = (iOld % (*PCache1)(unsafe.Pointer(pCache)).FnHash)
- pp = ((*PCache1)(unsafe.Pointer(pCache)).FapHash + uintptr(h)*4)
- for (*(*uintptr)(unsafe.Pointer(pp))) != pPage {
- pp = (*(*uintptr)(unsafe.Pointer(pp)) + 16 /* &.pNext */)
+ h = iOld % (*PCache1)(unsafe.Pointer(pCache)).FnHash
+ pp = (*PCache1)(unsafe.Pointer(pCache)).FapHash + uintptr(h)*4
+ for *(*uintptr)(unsafe.Pointer(pp)) != pPage {
+ pp = *(*uintptr)(unsafe.Pointer(pp)) + 16
}
*(*uintptr)(unsafe.Pointer(pp)) = (*PgHdr1)(unsafe.Pointer(pPage)).FpNext
- h = (iNew % (*PCache1)(unsafe.Pointer(pCache)).FnHash)
+ h = iNew % (*PCache1)(unsafe.Pointer(pCache)).FnHash
(*PgHdr1)(unsafe.Pointer(pPage)).FiKey = iNew
(*PgHdr1)(unsafe.Pointer(pPage)).FpNext = *(*uintptr)(unsafe.Pointer((*PCache1)(unsafe.Pointer(pCache)).FapHash + uintptr(h)*4))
*(*uintptr)(unsafe.Pointer((*PCache1)(unsafe.Pointer(pCache)).FapHash + uintptr(h)*4)) = pPage
@@ -29973,12 +30561,12 @@ func pcache1Rekey(tls *libc.TLS, p uintptr, pPg uintptr, iOld uint32, iNew uint3
// Discard all unpinned pages in the cache with a page number equal to
// or greater than parameter iLimit. Any pinned pages with a page number
// equal to or greater than iLimit are implicitly unpinned.
-func pcache1Truncate(tls *libc.TLS, p uintptr, iLimit uint32) { /* sqlite3.c:51849:13: */
+func pcache1Truncate(tls *libc.TLS, p uintptr, iLimit uint32) { /* sqlite3.c:51863:13: */
var pCache uintptr = p
Xsqlite3_mutex_enter(tls, (*PGroup)(unsafe.Pointer((*PCache1)(unsafe.Pointer(pCache)).FpGroup)).Fmutex)
if iLimit <= (*PCache1)(unsafe.Pointer(pCache)).FiMaxKey {
pcache1TruncateUnsafe(tls, pCache, iLimit)
- (*PCache1)(unsafe.Pointer(pCache)).FiMaxKey = (iLimit - uint32(1))
+ (*PCache1)(unsafe.Pointer(pCache)).FiMaxKey = iLimit - uint32(1)
}
Xsqlite3_mutex_leave(tls, (*PGroup)(unsafe.Pointer((*PCache1)(unsafe.Pointer(pCache)).FpGroup)).Fmutex)
}
@@ -29986,7 +30574,7 @@ func pcache1Truncate(tls *libc.TLS, p uintptr, iLimit uint32) { /* sqlite3.c:518
// Implementation of the sqlite3_pcache.xDestroy method.
//
// Destroy a cache allocated using pcache1Create().
-func pcache1Destroy(tls *libc.TLS, p uintptr) { /* sqlite3.c:51864:13: */
+func pcache1Destroy(tls *libc.TLS, p uintptr) { /* sqlite3.c:51878:13: */
var pCache uintptr = p
var pGroup uintptr = (*PCache1)(unsafe.Pointer(pCache)).FpGroup
@@ -29995,10 +30583,10 @@ func pcache1Destroy(tls *libc.TLS, p uintptr) { /* sqlite3.c:51864:13: */
pcache1TruncateUnsafe(tls, pCache, uint32(0))
}
- *(*uint32)(unsafe.Pointer(pGroup + 4 /* &.nMaxPage */)) -= ((*PCache1)(unsafe.Pointer(pCache)).FnMax)
+ *(*uint32)(unsafe.Pointer(pGroup + 4)) -= (*PCache1)(unsafe.Pointer(pCache)).FnMax
- *(*uint32)(unsafe.Pointer(pGroup + 8 /* &.nMinPage */)) -= ((*PCache1)(unsafe.Pointer(pCache)).FnMin)
- (*PGroup)(unsafe.Pointer(pGroup)).FmxPinned = (((*PGroup)(unsafe.Pointer(pGroup)).FnMaxPage + uint32(10)) - (*PGroup)(unsafe.Pointer(pGroup)).FnMinPage)
+ *(*uint32)(unsafe.Pointer(pGroup + 8)) -= (*PCache1)(unsafe.Pointer(pCache)).FnMin
+ (*PGroup)(unsafe.Pointer(pGroup)).FmxPinned = (*PGroup)(unsafe.Pointer(pGroup)).FnMaxPage + uint32(10) - (*PGroup)(unsafe.Pointer(pGroup)).FnMinPage
pcache1EnforceMaxPage(tls, pCache)
Xsqlite3_mutex_leave(tls, (*PGroup)(unsafe.Pointer(pGroup)).Fmutex)
Xsqlite3_free(tls, (*PCache1)(unsafe.Pointer(pCache)).FpBulk)
@@ -30009,7 +30597,7 @@ func pcache1Destroy(tls *libc.TLS, p uintptr) { /* sqlite3.c:51864:13: */
// This function is called during initialization (sqlite3_initialize()) to
// install the default pluggable cache module, assuming the user has not
// already provided an alternative.
-func Xsqlite3PCacheSetDefault(tls *libc.TLS) { /* sqlite3.c:51887:21: */
+func Xsqlite3PCacheSetDefault(tls *libc.TLS) { /* sqlite3.c:51901:21: */
bp := tls.Alloc(8)
defer tls.Free(8)
@@ -30029,16 +30617,16 @@ var defaultMethods1 = Sqlite3_pcache_methods2{
FxTruncate: 0, // xTruncate
FxDestroy: 0, // xDestroy
FxShrink: 0, // xShrink
-} /* sqlite3.c:51888:40 */
+} /* sqlite3.c:51902:40 */
// Return the size of the header on each page of this PCACHE implementation.
-func Xsqlite3HeaderSizePcache1(tls *libc.TLS) int32 { /* sqlite3.c:51909:20: */
- return (int32(((uint32(unsafe.Sizeof(PgHdr1{}))) + uint32(7)) & libc.Uint32FromInt32(libc.CplInt32(7))))
+func Xsqlite3HeaderSizePcache1(tls *libc.TLS) int32 { /* sqlite3.c:51923:20: */
+ return int32((uint32(unsafe.Sizeof(PgHdr1{})) + uint32(7)) & libc.Uint32FromInt32(libc.CplInt32(7)))
}
// Return the global mutex used by this PCACHE implementation. The
// sqlite3_status() routine needs access to this mutex.
-func Xsqlite3Pcache1Mutex(tls *libc.TLS) uintptr { /* sqlite3.c:51915:30: */
+func Xsqlite3Pcache1Mutex(tls *libc.TLS) uintptr { /* sqlite3.c:51929:30: */
return pcache1_g.Fmutex
}
@@ -30049,21 +30637,21 @@ func Xsqlite3Pcache1Mutex(tls *libc.TLS) uintptr { /* sqlite3.c:51915:30: */
// nReq is the number of bytes of memory required. Once this much has
// been released, the function returns. The return value is the total number
// of bytes of memory released.
-func Xsqlite3PcacheReleaseMemory(tls *libc.TLS, nReq int32) int32 { /* sqlite3.c:51929:20: */
+func Xsqlite3PcacheReleaseMemory(tls *libc.TLS, nReq int32) int32 { /* sqlite3.c:51943:20: */
var nFree int32 = 0
if Xsqlite3Config.FpPage == uintptr(0) {
var p uintptr
- Xsqlite3_mutex_enter(tls, (*PGroup)(unsafe.Pointer((uintptr(unsafe.Pointer(&pcache1_g)) /* &.grp */))).Fmutex)
- for (((nReq < 0) || (nFree < nReq)) &&
- ((libc.AssignUintptr(&p, pcache1_g.Fgrp.Flru.FpLruPrev)) != uintptr(0))) &&
- (int32((*PgHdr1)(unsafe.Pointer(p)).FisAnchor) == 0) {
- nFree = nFree + (pcache1MemSize(tls, (*PgHdr1)(unsafe.Pointer(p)).Fpage.FpBuf))
+ Xsqlite3_mutex_enter(tls, (*PGroup)(unsafe.Pointer(uintptr(unsafe.Pointer(&pcache1_g)))).Fmutex)
+ for (nReq < 0 || nFree < nReq) &&
+ libc.AssignUintptr(&p, pcache1_g.Fgrp.Flru.FpLruPrev) != uintptr(0) &&
+ int32((*PgHdr1)(unsafe.Pointer(p)).FisAnchor) == 0 {
+ nFree = nFree + pcache1MemSize(tls, (*PgHdr1)(unsafe.Pointer(p)).Fpage.FpBuf)
pcache1PinPage(tls, p)
pcache1RemoveFromHash(tls, p, 1)
}
- Xsqlite3_mutex_leave(tls, (*PGroup)(unsafe.Pointer((uintptr(unsafe.Pointer(&pcache1_g)) /* &.grp */))).Fmutex)
+ Xsqlite3_mutex_leave(tls, (*PGroup)(unsafe.Pointer(uintptr(unsafe.Pointer(&pcache1_g)))).Fmutex)
}
return nFree
}
@@ -30147,7 +30735,7 @@ type RowSetEntry = struct {
Fv I64
FpRight uintptr
FpLeft uintptr
-} /* sqlite3.c:14916:9 */
+} /* sqlite3.c:14291:9 */
// RowSetEntry objects are allocated in large chunks (instances of the
// following structure) to reduce memory allocation overhead. The
@@ -30161,13 +30749,13 @@ type RowSetChunk = struct {
FpRight uintptr
FpLeft uintptr
}
-} /* sqlite3.c:14916:9 */
+} /* sqlite3.c:14291:9 */
// Allowed values for RowSet.rsFlags
// Allocate a RowSet object. Return NULL if a memory allocation
// error occurs.
-func Xsqlite3RowSetInit(tls *libc.TLS, db uintptr) uintptr { /* sqlite3.c:52109:23: */
+func Xsqlite3RowSetInit(tls *libc.TLS, db uintptr) uintptr { /* sqlite3.c:52123:23: */
var p uintptr = Xsqlite3DbMallocRawNN(tls, db, uint64(unsafe.Sizeof(RowSet{})))
if p != 0 {
var N int32 = Xsqlite3DbMallocSize(tls, db, p)
@@ -30176,8 +30764,8 @@ func Xsqlite3RowSetInit(tls *libc.TLS, db uintptr) uintptr { /* sqlite3.c:52109:
(*RowSet)(unsafe.Pointer(p)).FpEntry = uintptr(0)
(*RowSet)(unsafe.Pointer(p)).FpLast = uintptr(0)
(*RowSet)(unsafe.Pointer(p)).FpForest = uintptr(0)
- (*RowSet)(unsafe.Pointer(p)).FpFresh = (uintptr((((uint32(unsafe.Sizeof(RowSet{}))) + uint32(7)) & libc.Uint32FromInt32(libc.CplInt32(7)))) + p)
- (*RowSet)(unsafe.Pointer(p)).FnFresh = (U16((uint32(N) - (((uint32(unsafe.Sizeof(RowSet{}))) + uint32(7)) & libc.Uint32FromInt32(libc.CplInt32(7)))) / uint32(unsafe.Sizeof(RowSetEntry{}))))
+ (*RowSet)(unsafe.Pointer(p)).FpFresh = uintptr((uint32(unsafe.Sizeof(RowSet{}))+uint32(7))&libc.Uint32FromInt32(libc.CplInt32(7))) + p
+ (*RowSet)(unsafe.Pointer(p)).FnFresh = U16((uint32(N) - (uint32(unsafe.Sizeof(RowSet{}))+uint32(7))&libc.Uint32FromInt32(libc.CplInt32(7))) / uint32(unsafe.Sizeof(RowSetEntry{})))
(*RowSet)(unsafe.Pointer(p)).FrsFlags = U16(ROWSET_SORTED)
(*RowSet)(unsafe.Pointer(p)).FiBatch = 0
}
@@ -30187,7 +30775,7 @@ func Xsqlite3RowSetInit(tls *libc.TLS, db uintptr) uintptr { /* sqlite3.c:52109:
// Deallocate all chunks from a RowSet. This frees all memory that
// the RowSet has allocated over its lifetime. This routine is
// the destructor for the RowSet.
-func Xsqlite3RowSetClear(tls *libc.TLS, pArg uintptr) { /* sqlite3.c:52131:21: */
+func Xsqlite3RowSetClear(tls *libc.TLS, pArg uintptr) { /* sqlite3.c:52145:21: */
var p uintptr = pArg
var pChunk uintptr
var pNextChunk uintptr
@@ -30206,7 +30794,7 @@ func Xsqlite3RowSetClear(tls *libc.TLS, pArg uintptr) { /* sqlite3.c:52131:21: *
// Deallocate all chunks from a RowSet. This frees all memory that
// the RowSet has allocated over its lifetime. This routine is
// the destructor for the RowSet.
-func Xsqlite3RowSetDelete(tls *libc.TLS, pArg uintptr) { /* sqlite3.c:52151:21: */
+func Xsqlite3RowSetDelete(tls *libc.TLS, pArg uintptr) { /* sqlite3.c:52165:21: */
Xsqlite3RowSetClear(tls, pArg)
Xsqlite3DbFree(tls, (*RowSet)(unsafe.Pointer(pArg)).Fdb, pArg)
}
@@ -30217,7 +30805,7 @@ func Xsqlite3RowSetDelete(tls *libc.TLS, pArg uintptr) { /* sqlite3.c:52151:21:
//
// In an OOM situation, the RowSet.db->mallocFailed flag is set and this
// routine returns NULL.
-func rowSetEntryAlloc(tls *libc.TLS, p uintptr) uintptr { /* sqlite3.c:52164:27: */
+func rowSetEntryAlloc(tls *libc.TLS, p uintptr) uintptr { /* sqlite3.c:52178:27: */
if int32((*RowSet)(unsafe.Pointer(p)).FnFresh) == 0 { //OPTIMIZATION-IF-FALSE
// We could allocate a fresh RowSetEntry each time one is needed, but it
@@ -30230,7 +30818,7 @@ func rowSetEntryAlloc(tls *libc.TLS, p uintptr) uintptr { /* sqlite3.c:52164:27:
(*RowSetChunk)(unsafe.Pointer(pNew)).FpNextChunk = (*RowSet)(unsafe.Pointer(p)).FpChunk
(*RowSet)(unsafe.Pointer(p)).FpChunk = pNew
(*RowSet)(unsafe.Pointer(p)).FpFresh = pNew + 8 /* &.aEntry */
- (*RowSet)(unsafe.Pointer(p)).FnFresh = (uint16((uint32(ROWSET_ALLOCATION_SIZE - 8)) / uint32(unsafe.Sizeof(RowSetEntry{}))))
+ (*RowSet)(unsafe.Pointer(p)).FnFresh = uint16(uint32(ROWSET_ALLOCATION_SIZE-8) / uint32(unsafe.Sizeof(RowSetEntry{})))
}
(*RowSet)(unsafe.Pointer(p)).FnFresh--
return libc.PostIncUintptr(&(*RowSet)(unsafe.Pointer(p)).FpFresh, 16)
@@ -30240,7 +30828,7 @@ func rowSetEntryAlloc(tls *libc.TLS, p uintptr) uintptr { /* sqlite3.c:52164:27:
//
// The mallocFailed flag of the database connection is set if a
// memory allocation fails.
-func Xsqlite3RowSetInsert(tls *libc.TLS, p uintptr, rowid I64) { /* sqlite3.c:52189:21: */
+func Xsqlite3RowSetInsert(tls *libc.TLS, p uintptr, rowid I64) { /* sqlite3.c:52203:21: */
var pEntry uintptr // The new entry
var pLast uintptr // The last prior entry
@@ -30257,7 +30845,7 @@ func Xsqlite3RowSetInsert(tls *libc.TLS, p uintptr, rowid I64) { /* sqlite3.c:52
if rowid <= (*RowSetEntry)(unsafe.Pointer(pLast)).Fv { //OPTIMIZATION-IF-FALSE
// Avoid unnecessary sorts by preserving the ROWSET_SORTED flags
// where possible
- *(*U16)(unsafe.Pointer(p + 26 /* &.rsFlags */)) &= libc.Uint16FromInt32((libc.CplInt32(ROWSET_SORTED)))
+ *(*U16)(unsafe.Pointer(p + 26)) &= libc.Uint16FromInt32(libc.CplInt32(ROWSET_SORTED))
}
(*RowSetEntry)(unsafe.Pointer(pLast)).FpRight = pEntry
} else {
@@ -30270,7 +30858,7 @@ func Xsqlite3RowSetInsert(tls *libc.TLS, p uintptr, rowid I64) { /* sqlite3.c:52
//
// The input lists are connected via pRight pointers and are
// assumed to each already be in sorted order.
-func rowSetEntryMerge(tls *libc.TLS, pA uintptr, pB uintptr) uintptr { /* sqlite3.c:52220:27: */
+func rowSetEntryMerge(tls *libc.TLS, pA uintptr, pB uintptr) uintptr { /* sqlite3.c:52234:27: */
bp := tls.Alloc(16)
defer tls.Free(16)
@@ -30284,7 +30872,7 @@ func rowSetEntryMerge(tls *libc.TLS, pA uintptr, pB uintptr) uintptr { /* sqlite
if (*RowSetEntry)(unsafe.Pointer(pA)).Fv <= (*RowSetEntry)(unsafe.Pointer(pB)).Fv {
if (*RowSetEntry)(unsafe.Pointer(pA)).Fv < (*RowSetEntry)(unsafe.Pointer(pB)).Fv {
- pTail = libc.AssignPtrUintptr(pTail+8 /* &.pRight */, pA)
+ pTail = libc.AssignPtrUintptr(pTail+8, pA)
}
pA = (*RowSetEntry)(unsafe.Pointer(pA)).FpRight
if pA == uintptr(0) {
@@ -30292,7 +30880,7 @@ func rowSetEntryMerge(tls *libc.TLS, pA uintptr, pB uintptr) uintptr { /* sqlite
break
}
} else {
- pTail = libc.AssignPtrUintptr(pTail+8 /* &.pRight */, pB)
+ pTail = libc.AssignPtrUintptr(pTail+8, pB)
pB = (*RowSetEntry)(unsafe.Pointer(pB)).FpRight
if pB == uintptr(0) {
(*RowSetEntry)(unsafe.Pointer(pTail)).FpRight = pA
@@ -30305,7 +30893,7 @@ func rowSetEntryMerge(tls *libc.TLS, pA uintptr, pB uintptr) uintptr { /* sqlite
// Sort all elements on the list of RowSetEntry objects into order of
// increasing v.
-func rowSetEntrySort(tls *libc.TLS, pIn uintptr) uintptr { /* sqlite3.c:52255:27: */
+func rowSetEntrySort(tls *libc.TLS, pIn uintptr) uintptr { /* sqlite3.c:52269:27: */
bp := tls.Alloc(160)
defer tls.Free(160)
@@ -30325,8 +30913,8 @@ func rowSetEntrySort(tls *libc.TLS, pIn uintptr) uintptr { /* sqlite3.c:52255:27
pIn = pNext
}
pIn = *(*uintptr)(unsafe.Pointer(bp /* &aBucket[0] */))
- for i = uint32(1); i < (uint32(unsafe.Sizeof([40]uintptr{})) / uint32(unsafe.Sizeof(uintptr(0)))); i++ {
- if *(*uintptr)(unsafe.Pointer(bp /* &aBucket[0] */ + uintptr(i)*4)) == uintptr(0) {
+ for i = uint32(1); i < uint32(unsafe.Sizeof([40]uintptr{}))/uint32(unsafe.Sizeof(uintptr(0))); i++ {
+ if *(*uintptr)(unsafe.Pointer(bp + uintptr(i)*4)) == uintptr(0) {
continue
}
if pIn != 0 {
@@ -30341,7 +30929,7 @@ func rowSetEntrySort(tls *libc.TLS, pIn uintptr) uintptr { /* sqlite3.c:52255:27
// The input, pIn, is a binary tree (or subtree) of RowSetEntry objects.
// Convert this tree into a linked list connected by the pRight pointers
// and return pointers to the first and last elements of the new list.
-func rowSetTreeToList(tls *libc.TLS, pIn uintptr, ppFirst uintptr, ppLast uintptr) { /* sqlite3.c:52284:13: */
+func rowSetTreeToList(tls *libc.TLS, pIn uintptr, ppFirst uintptr, ppLast uintptr) { /* sqlite3.c:52298:13: */
bp := tls.Alloc(4)
defer tls.Free(4)
@@ -30354,7 +30942,7 @@ func rowSetTreeToList(tls *libc.TLS, pIn uintptr, ppFirst uintptr, ppLast uintpt
*(*uintptr)(unsafe.Pointer(ppFirst)) = pIn
}
if (*RowSetEntry)(unsafe.Pointer(pIn)).FpRight != 0 {
- rowSetTreeToList(tls, (*RowSetEntry)(unsafe.Pointer(pIn)).FpRight, (pIn + 8 /* &.pRight */), ppLast)
+ rowSetTreeToList(tls, (*RowSetEntry)(unsafe.Pointer(pIn)).FpRight, pIn+8, ppLast)
} else {
*(*uintptr)(unsafe.Pointer(ppLast)) = pIn
}
@@ -30372,7 +30960,7 @@ func rowSetTreeToList(tls *libc.TLS, pIn uintptr, ppFirst uintptr, ppLast uintpt
// and leave *ppList set to NULL.
//
// Return a pointer to the root of the constructed binary tree.
-func rowSetNDeepTree(tls *libc.TLS, ppList uintptr, iDepth int32) uintptr { /* sqlite3.c:52319:27: */
+func rowSetNDeepTree(tls *libc.TLS, ppList uintptr, iDepth int32) uintptr { /* sqlite3.c:52333:27: */
var p uintptr // Root of the new tree
var pLeft uintptr // Left subtree
if *(*uintptr)(unsafe.Pointer(ppList)) == uintptr(0) { //OPTIMIZATION-IF-TRUE
@@ -30383,7 +30971,7 @@ func rowSetNDeepTree(tls *libc.TLS, ppList uintptr, iDepth int32) uintptr { /* s
// This branch causes a *balanced* tree to be generated. A valid tree
// is still generated without this branch, but the tree is wildly
// unbalanced and inefficient.
- pLeft = rowSetNDeepTree(tls, ppList, (iDepth - 1))
+ pLeft = rowSetNDeepTree(tls, ppList, iDepth-1)
p = *(*uintptr)(unsafe.Pointer(ppList))
if p == uintptr(0) { //OPTIMIZATION-IF-FALSE
// It is safe to always return here, but the resulting tree
@@ -30392,18 +30980,18 @@ func rowSetNDeepTree(tls *libc.TLS, ppList uintptr, iDepth int32) uintptr { /* s
}
(*RowSetEntry)(unsafe.Pointer(p)).FpLeft = pLeft
*(*uintptr)(unsafe.Pointer(ppList)) = (*RowSetEntry)(unsafe.Pointer(p)).FpRight
- (*RowSetEntry)(unsafe.Pointer(p)).FpRight = rowSetNDeepTree(tls, ppList, (iDepth - 1))
+ (*RowSetEntry)(unsafe.Pointer(p)).FpRight = rowSetNDeepTree(tls, ppList, iDepth-1)
} else {
p = *(*uintptr)(unsafe.Pointer(ppList))
*(*uintptr)(unsafe.Pointer(ppList)) = (*RowSetEntry)(unsafe.Pointer(p)).FpRight
- (*RowSetEntry)(unsafe.Pointer(p)).FpLeft = libc.AssignPtrUintptr(p+8 /* &.pRight */, uintptr(0))
+ (*RowSetEntry)(unsafe.Pointer(p)).FpLeft = libc.AssignPtrUintptr(p+8, uintptr(0))
}
return p
}
// Convert a sorted list of elements into a binary tree. Make the tree
// as deep as it needs to be in order to contain the entire list.
-func rowSetListToTree(tls *libc.TLS, pList uintptr) uintptr { /* sqlite3.c:52355:27: */
+func rowSetListToTree(tls *libc.TLS, pList uintptr) uintptr { /* sqlite3.c:52369:27: */
bp := tls.Alloc(4)
defer tls.Free(4)
*(*uintptr)(unsafe.Pointer(bp)) = pList
@@ -30414,7 +31002,7 @@ func rowSetListToTree(tls *libc.TLS, pList uintptr) uintptr { /* sqlite3.c:52355
p = *(*uintptr)(unsafe.Pointer(bp /* pList */))
*(*uintptr)(unsafe.Pointer(bp /* pList */)) = (*RowSetEntry)(unsafe.Pointer(p)).FpRight
- (*RowSetEntry)(unsafe.Pointer(p)).FpLeft = libc.AssignPtrUintptr(p+8 /* &.pRight */, uintptr(0))
+ (*RowSetEntry)(unsafe.Pointer(p)).FpLeft = libc.AssignPtrUintptr(p+8, uintptr(0))
for iDepth = 1; *(*uintptr)(unsafe.Pointer(bp /* pList */)) != 0; iDepth++ {
pLeft = p
p = *(*uintptr)(unsafe.Pointer(bp /* pList */))
@@ -30436,16 +31024,16 @@ func rowSetListToTree(tls *libc.TLS, pList uintptr) uintptr { /* sqlite3.c:52355
// been used. Older versions of RowSet allowed that, but as the
// capability was not used by the code generator, it was removed
// for code economy.
-func Xsqlite3RowSetNext(tls *libc.TLS, p uintptr, pRowid uintptr) int32 { /* sqlite3.c:52387:20: */
+func Xsqlite3RowSetNext(tls *libc.TLS, p uintptr, pRowid uintptr) int32 { /* sqlite3.c:52401:20: */
// Cannot be used with sqlite3RowSetText()
// Merge the forest into a single sorted list on first call
- if (int32((*RowSet)(unsafe.Pointer(p)).FrsFlags) & ROWSET_NEXT) == 0 { //OPTIMIZATION-IF-FALSE
- if (int32((*RowSet)(unsafe.Pointer(p)).FrsFlags) & ROWSET_SORTED) == 0 { //OPTIMIZATION-IF-FALSE
+ if int32((*RowSet)(unsafe.Pointer(p)).FrsFlags)&ROWSET_NEXT == 0 { //OPTIMIZATION-IF-FALSE
+ if int32((*RowSet)(unsafe.Pointer(p)).FrsFlags)&ROWSET_SORTED == 0 { //OPTIMIZATION-IF-FALSE
(*RowSet)(unsafe.Pointer(p)).FpEntry = rowSetEntrySort(tls, (*RowSet)(unsafe.Pointer(p)).FpEntry)
}
- *(*U16)(unsafe.Pointer(p + 26 /* &.rsFlags */)) |= U16((ROWSET_SORTED | ROWSET_NEXT))
+ *(*U16)(unsafe.Pointer(p + 26)) |= U16(ROWSET_SORTED | ROWSET_NEXT)
}
// Return the next entry on the list
@@ -30469,7 +31057,7 @@ func Xsqlite3RowSetNext(tls *libc.TLS, p uintptr, pRowid uintptr) int32 { /* sql
// If this is the first test of a new batch and if there exist entries
// on pRowSet->pEntry, then sort those entries into the forest at
// pRowSet->pForest so that they can be tested.
-func Xsqlite3RowSetTest(tls *libc.TLS, pRowSet uintptr, iBatch int32, iRowid Sqlite3_int64) int32 { /* sqlite3.c:52421:20: */
+func Xsqlite3RowSetTest(tls *libc.TLS, pRowSet uintptr, iBatch int32, iRowid Sqlite3_int64) int32 { /* sqlite3.c:52435:20: */
bp := tls.Alloc(8)
defer tls.Free(8)
@@ -30483,13 +31071,13 @@ func Xsqlite3RowSetTest(tls *libc.TLS, pRowSet uintptr, iBatch int32, iRowid Sql
if iBatch != (*RowSet)(unsafe.Pointer(pRowSet)).FiBatch { //OPTIMIZATION-IF-FALSE
p = (*RowSet)(unsafe.Pointer(pRowSet)).FpEntry
if p != 0 {
- var ppPrevTree uintptr = (pRowSet + 20 /* &.pForest */)
- if (int32((*RowSet)(unsafe.Pointer(pRowSet)).FrsFlags) & ROWSET_SORTED) == 0 { //OPTIMIZATION-IF-FALSE
+ var ppPrevTree uintptr = pRowSet + 20
+ if int32((*RowSet)(unsafe.Pointer(pRowSet)).FrsFlags)&ROWSET_SORTED == 0 { //OPTIMIZATION-IF-FALSE
// Only sort the current set of entries if they need it
p = rowSetEntrySort(tls, p)
}
for pTree = (*RowSet)(unsafe.Pointer(pRowSet)).FpForest; pTree != 0; pTree = (*RowSetEntry)(unsafe.Pointer(pTree)).FpRight {
- ppPrevTree = (pTree + 8 /* &.pRight */)
+ ppPrevTree = pTree + 8
if (*RowSetEntry)(unsafe.Pointer(pTree)).FpLeft == uintptr(0) {
(*RowSetEntry)(unsafe.Pointer(pTree)).FpLeft = rowSetListToTree(tls, p)
break
@@ -30513,7 +31101,7 @@ func Xsqlite3RowSetTest(tls *libc.TLS, pRowSet uintptr, iBatch int32, iRowid Sql
}
(*RowSet)(unsafe.Pointer(pRowSet)).FpEntry = uintptr(0)
(*RowSet)(unsafe.Pointer(pRowSet)).FpLast = uintptr(0)
- *(*U16)(unsafe.Pointer(pRowSet + 26 /* &.rsFlags */)) |= U16((ROWSET_SORTED))
+ *(*U16)(unsafe.Pointer(pRowSet + 26)) |= U16(ROWSET_SORTED)
}
(*RowSet)(unsafe.Pointer(pRowSet)).FiBatch = iBatch
}
@@ -30606,7 +31194,7 @@ type Wal1 = struct {
FzWalName uintptr
FnCkpt U32
FpSnapshot uintptr
-} /* sqlite3.c:1331:9 */
+} /* sqlite3.c:578:9 */
//************* End of rowset.c *********************************************
//************* Begin file pager.c ******************************************
@@ -30652,7 +31240,7 @@ type Wal1 = struct {
// Connection to a write-ahead log (WAL) file.
// There is one object of this type for each pager.
-type Wal = Wal1 /* sqlite3.c:52563:20 */
+type Wal = Wal1 /* sqlite3.c:52577:20 */
//************* End of wal.h ************************************************
//************* Continuing where we left off in pager.c *********************
@@ -31040,7 +31628,7 @@ type PagerSavepoint1 = struct {
FiSubRec Pgno
FbTruncateOnRelease int32
FaWalData [4]U32
-} /* sqlite3.c:1331:9 */
+} /* sqlite3.c:578:9 */
//************* End of wal.h ************************************************
//************* Continuing where we left off in pager.c *********************
@@ -31420,7 +32008,7 @@ type PagerSavepoint1 = struct {
// immediately following the last journal record written into the main
// journal before the journal-header. This is required during savepoint
// rollback (see pagerPlaybackSavepoint()).
-type PagerSavepoint = PagerSavepoint1 /* sqlite3.c:53074:31 */
+type PagerSavepoint = PagerSavepoint1 /* sqlite3.c:53088:31 */
// Indexes for use with Pager.aStat[]. The Pager.aStat[] array contains
// the values accessed by passing SQLITE_DBSTATUS_CACHE_HIT, CACHE_MISS
@@ -31453,11 +32041,11 @@ type PagerSavepoint = PagerSavepoint1 /* sqlite3.c:53074:31 */
// is different for every journal, we minimize that risk.
var aJournalMagic = [8]uint8{
uint8(0xd9), uint8(0xd5), uint8(0x05), uint8(0xf9), uint8(0x20), uint8(0xa1), uint8(0x63), uint8(0xd7),
-} /* sqlite3.c:53395:28 */
+} /* sqlite3.c:53410:28 */
// Set the Pager.xGet method for the appropriate routine used to fetch
// content from the pager.
-func setGetterMethod(tls *libc.TLS, pPager uintptr) { /* sqlite3.c:53688:13: */
+func setGetterMethod(tls *libc.TLS, pPager uintptr) { /* sqlite3.c:53703:13: */
if (*Pager)(unsafe.Pointer(pPager)).FerrCode != 0 {
(*Pager)(unsafe.Pointer(pPager)).FxGet = *(*uintptr)(unsafe.Pointer(&struct {
f func(*libc.TLS, uintptr, Pgno, uintptr, int32) int32
@@ -31480,15 +32068,15 @@ func setGetterMethod(tls *libc.TLS, pPager uintptr) { /* sqlite3.c:53688:13: */
// * The page-number is less than or equal to PagerSavepoint.nOrig, and
// * The bit corresponding to the page-number is not set in
// PagerSavepoint.pInSavepoint.
-func subjRequiresPage(tls *libc.TLS, pPg uintptr) int32 { /* sqlite3.c:53709:12: */
+func subjRequiresPage(tls *libc.TLS, pPg uintptr) int32 { /* sqlite3.c:53724:12: */
var pPager uintptr = (*PgHdr)(unsafe.Pointer(pPg)).FpPager
var p uintptr
var pgno Pgno = (*PgHdr)(unsafe.Pointer(pPg)).Fpgno
var i int32
for i = 0; i < (*Pager)(unsafe.Pointer(pPager)).FnSavepoint; i++ {
- p = ((*Pager)(unsafe.Pointer(pPager)).FaSavepoint + uintptr(i)*48)
- if ((*PagerSavepoint)(unsafe.Pointer(p)).FnOrig >= pgno) && (0 == Xsqlite3BitvecTestNotNull(tls, (*PagerSavepoint)(unsafe.Pointer(p)).FpInSavepoint, pgno)) {
- for i = (i + 1); i < (*Pager)(unsafe.Pointer(pPager)).FnSavepoint; i++ {
+ p = (*Pager)(unsafe.Pointer(pPager)).FaSavepoint + uintptr(i)*48
+ if (*PagerSavepoint)(unsafe.Pointer(p)).FnOrig >= pgno && 0 == Xsqlite3BitvecTestNotNull(tls, (*PagerSavepoint)(unsafe.Pointer(p)).FpInSavepoint, pgno) {
+ for i = i + 1; i < (*Pager)(unsafe.Pointer(pPager)).FnSavepoint; i++ {
(*PagerSavepoint)(unsafe.Pointer((*Pager)(unsafe.Pointer(pPager)).FaSavepoint + uintptr(i)*48)).FbTruncateOnRelease = 0
}
return 1
@@ -31502,7 +32090,7 @@ func subjRequiresPage(tls *libc.TLS, pPg uintptr) int32 { /* sqlite3.c:53709:12:
// error code is something goes wrong.
//
// All values are stored on disk as big-endian.
-func read32bits(tls *libc.TLS, fd uintptr, offset I64, pRes uintptr) int32 { /* sqlite3.c:53742:12: */
+func read32bits(tls *libc.TLS, fd uintptr, offset I64, pRes uintptr) int32 { /* sqlite3.c:53757:12: */
bp := tls.Alloc(4)
defer tls.Free(4)
@@ -31519,7 +32107,7 @@ func read32bits(tls *libc.TLS, fd uintptr, offset I64, pRes uintptr) int32 { /*
// Write a 32-bit integer into the given file descriptor. Return SQLITE_OK
// on success or an error code is something goes wrong.
-func write32bits(tls *libc.TLS, fd uintptr, offset I64, val U32) int32 { /* sqlite3.c:53761:12: */
+func write32bits(tls *libc.TLS, fd uintptr, offset I64, val U32) int32 { /* sqlite3.c:53776:12: */
bp := tls.Alloc(4)
defer tls.Free(4)
@@ -31536,17 +32124,17 @@ func write32bits(tls *libc.TLS, fd uintptr, offset I64, val U32) int32 { /* sqli
// Except, if Pager.eLock is set to UNKNOWN_LOCK when this function is
// called, do not modify it. See the comment above the #define of
// UNKNOWN_LOCK for an explanation of this.
-func pagerUnlockDb(tls *libc.TLS, pPager uintptr, eLock int32) int32 { /* sqlite3.c:53776:12: */
+func pagerUnlockDb(tls *libc.TLS, pPager uintptr, eLock int32) int32 { /* sqlite3.c:53791:12: */
var rc int32 = SQLITE_OK
- if (*Sqlite3_file)(unsafe.Pointer(((*Pager)(unsafe.Pointer(pPager)).Ffd))).FpMethods != uintptr(0) {
+ if (*Sqlite3_file)(unsafe.Pointer((*Pager)(unsafe.Pointer(pPager)).Ffd)).FpMethods != uintptr(0) {
if (*Pager)(unsafe.Pointer(pPager)).FnoLock != 0 {
rc = SQLITE_OK
} else {
rc = Xsqlite3OsUnlock(tls, (*Pager)(unsafe.Pointer(pPager)).Ffd, eLock)
}
- if int32((*Pager)(unsafe.Pointer(pPager)).FeLock) != (EXCLUSIVE_LOCK + 1) {
+ if int32((*Pager)(unsafe.Pointer(pPager)).FeLock) != EXCLUSIVE_LOCK+1 {
(*Pager)(unsafe.Pointer(pPager)).FeLock = U8(eLock)
}
@@ -31563,16 +32151,16 @@ func pagerUnlockDb(tls *libc.TLS, pPager uintptr, eLock int32) int32 { /* sqlite
// called, do not modify it unless the new locking state is EXCLUSIVE_LOCK.
// See the comment above the #define of UNKNOWN_LOCK for an explanation
// of this.
-func pagerLockDb(tls *libc.TLS, pPager uintptr, eLock int32) int32 { /* sqlite3.c:53804:12: */
+func pagerLockDb(tls *libc.TLS, pPager uintptr, eLock int32) int32 { /* sqlite3.c:53819:12: */
var rc int32 = SQLITE_OK
- if (int32((*Pager)(unsafe.Pointer(pPager)).FeLock) < eLock) || (int32((*Pager)(unsafe.Pointer(pPager)).FeLock) == (EXCLUSIVE_LOCK + 1)) {
+ if int32((*Pager)(unsafe.Pointer(pPager)).FeLock) < eLock || int32((*Pager)(unsafe.Pointer(pPager)).FeLock) == EXCLUSIVE_LOCK+1 {
if (*Pager)(unsafe.Pointer(pPager)).FnoLock != 0 {
rc = SQLITE_OK
} else {
rc = Xsqlite3OsLock(tls, (*Pager)(unsafe.Pointer(pPager)).Ffd, eLock)
}
- if (rc == SQLITE_OK) && ((int32((*Pager)(unsafe.Pointer(pPager)).FeLock) != (EXCLUSIVE_LOCK + 1)) || (eLock == EXCLUSIVE_LOCK)) {
+ if rc == SQLITE_OK && (int32((*Pager)(unsafe.Pointer(pPager)).FeLock) != EXCLUSIVE_LOCK+1 || eLock == EXCLUSIVE_LOCK) {
(*Pager)(unsafe.Pointer(pPager)).FeLock = U8(eLock)
}
@@ -31597,7 +32185,7 @@ func pagerLockDb(tls *libc.TLS, pPager uintptr, eLock int32) int32 { /* sqlite3.
// returned in this case.
//
// If neither optimization can be used, 0 is returned.
-func jrnlBufferSize(tls *libc.TLS, pPager uintptr) int32 { /* sqlite3.c:53837:12: */
+func jrnlBufferSize(tls *libc.TLS, pPager uintptr) int32 { /* sqlite3.c:53852:12: */
_ = pPager
@@ -31631,7 +32219,7 @@ func jrnlBufferSize(tls *libc.TLS, pPager uintptr) int32 { /* sqlite3.c:53837:12
//
// If an error occurs while reading from the journal file, an SQLite
// error code is returned.
-func readSuperJournal(tls *libc.TLS, pJrnl uintptr, zSuper uintptr, nSuper U32) int32 { /* sqlite3.c:53942:12: */
+func readSuperJournal(tls *libc.TLS, pJrnl uintptr, zSuper uintptr, nSuper U32) int32 { /* sqlite3.c:53957:12: */
bp := tls.Alloc(24)
defer tls.Free(24)
@@ -31647,16 +32235,16 @@ func readSuperJournal(tls *libc.TLS, pJrnl uintptr, zSuper uintptr, nSuper U32)
// A buffer to hold the magic header
*(*uint8)(unsafe.Pointer(zSuper)) = uint8(0)
- if (((((((((SQLITE_OK != (libc.AssignInt32(&rc, Xsqlite3OsFileSize(tls, pJrnl, bp /* &szJ */)))) ||
- (*(*I64)(unsafe.Pointer(bp /* szJ */)) < int64(16))) ||
- (SQLITE_OK != (libc.AssignInt32(&rc, read32bits(tls, pJrnl, (*(*I64)(unsafe.Pointer(bp /* szJ */))-int64(16)), bp+8 /* &len */))))) ||
- (*(*U32)(unsafe.Pointer(bp + 8 /* len */)) >= nSuper)) ||
- (I64(*(*U32)(unsafe.Pointer(bp + 8 /* len */))) > (*(*I64)(unsafe.Pointer(bp /* szJ */)) - int64(16)))) ||
- (*(*U32)(unsafe.Pointer(bp + 8 /* len */)) == U32(0))) ||
- (SQLITE_OK != (libc.AssignInt32(&rc, read32bits(tls, pJrnl, (*(*I64)(unsafe.Pointer(bp /* szJ */))-int64(12)), bp+12 /* &cksum */))))) ||
- (SQLITE_OK != (libc.AssignInt32(&rc, Xsqlite3OsRead(tls, pJrnl, bp+16 /* &aMagic[0] */, 8, (*(*I64)(unsafe.Pointer(bp /* szJ */))-int64(8))))))) ||
- (libc.Xmemcmp(tls, bp+16 /* &aMagic[0] */, uintptr(unsafe.Pointer(&aJournalMagic)), uint32(8)) != 0)) ||
- (SQLITE_OK != (libc.AssignInt32(&rc, Xsqlite3OsRead(tls, pJrnl, zSuper, int32(*(*U32)(unsafe.Pointer(bp + 8 /* len */))), ((*(*I64)(unsafe.Pointer(bp /* szJ */))-int64(16))-I64(*(*U32)(unsafe.Pointer(bp + 8 /* len */)))))))) {
+ if SQLITE_OK != libc.AssignInt32(&rc, Xsqlite3OsFileSize(tls, pJrnl, bp)) ||
+ *(*I64)(unsafe.Pointer(bp)) < int64(16) ||
+ SQLITE_OK != libc.AssignInt32(&rc, read32bits(tls, pJrnl, *(*I64)(unsafe.Pointer(bp))-int64(16), bp+8)) ||
+ *(*U32)(unsafe.Pointer(bp + 8)) >= nSuper ||
+ I64(*(*U32)(unsafe.Pointer(bp + 8))) > *(*I64)(unsafe.Pointer(bp))-int64(16) ||
+ *(*U32)(unsafe.Pointer(bp + 8)) == U32(0) ||
+ SQLITE_OK != libc.AssignInt32(&rc, read32bits(tls, pJrnl, *(*I64)(unsafe.Pointer(bp))-int64(12), bp+12)) ||
+ SQLITE_OK != libc.AssignInt32(&rc, Xsqlite3OsRead(tls, pJrnl, bp+16, 8, *(*I64)(unsafe.Pointer(bp))-int64(8))) ||
+ libc.Xmemcmp(tls, bp+16, uintptr(unsafe.Pointer(&aJournalMagic)), uint32(8)) != 0 ||
+ SQLITE_OK != libc.AssignInt32(&rc, Xsqlite3OsRead(tls, pJrnl, zSuper, int32(*(*U32)(unsafe.Pointer(bp + 8))), *(*I64)(unsafe.Pointer(bp))-int64(16)-I64(*(*U32)(unsafe.Pointer(bp + 8))))) {
return rc
}
@@ -31664,7 +32252,7 @@ func readSuperJournal(tls *libc.TLS, pJrnl uintptr, zSuper uintptr, nSuper U32)
for u = U32(0); u < *(*U32)(unsafe.Pointer(bp + 8 /* len */)); u++ {
*(*U32)(unsafe.Pointer(bp + 12 /* cksum */)) -= U32(*(*uint8)(unsafe.Pointer(zSuper + uintptr(u))))
}
- if *(*U32)(unsafe.Pointer(bp + 12 /* cksum */)) != 0 {
+ if *(*U32)(unsafe.Pointer(bp + 12)) != 0 {
// If the checksum doesn't add up, then one or more of the disk sectors
// containing the super-journal filename is corrupted. This means
// definitely roll back, so just return SQLITE_OK and report a (nul)
@@ -31672,7 +32260,7 @@ func readSuperJournal(tls *libc.TLS, pJrnl uintptr, zSuper uintptr, nSuper U32)
*(*U32)(unsafe.Pointer(bp + 8 /* len */)) = U32(0)
}
*(*uint8)(unsafe.Pointer(zSuper + uintptr(*(*U32)(unsafe.Pointer(bp + 8 /* len */))))) = uint8(0)
- *(*uint8)(unsafe.Pointer(zSuper + uintptr((*(*U32)(unsafe.Pointer(bp + 8 /* len */)) + U32(1))))) = uint8(0)
+ *(*uint8)(unsafe.Pointer(zSuper + uintptr(*(*U32)(unsafe.Pointer(bp + 8))+U32(1)))) = uint8(0)
return SQLITE_OK
}
@@ -31690,11 +32278,11 @@ func readSuperJournal(tls *libc.TLS, pJrnl uintptr, zSuper uintptr, nSuper U32)
// 100 512
// 2000 2048
//
-func journalHdrOffset(tls *libc.TLS, pPager uintptr) I64 { /* sqlite3.c:53998:12: */
+func journalHdrOffset(tls *libc.TLS, pPager uintptr) I64 { /* sqlite3.c:54013:12: */
var offset I64 = int64(0)
var c I64 = (*Pager)(unsafe.Pointer(pPager)).FjournalOff
if c != 0 {
- offset = ((((c - int64(1)) / (I64((*Pager)(unsafe.Pointer(pPager)).FsectorSize))) + int64(1)) * (I64((*Pager)(unsafe.Pointer(pPager)).FsectorSize)))
+ offset = ((c-int64(1))/I64((*Pager)(unsafe.Pointer(pPager)).FsectorSize) + int64(1)) * I64((*Pager)(unsafe.Pointer(pPager)).FsectorSize)
}
return offset
@@ -31719,7 +32307,7 @@ func journalHdrOffset(tls *libc.TLS, pPager uintptr) I64 { /* sqlite3.c:53998:12
//
// If an IO error occurs, abandon processing and return the IO error code.
// Otherwise, return SQLITE_OK.
-func zeroJournalHdr(tls *libc.TLS, pPager uintptr, doTruncate int32) int32 { /* sqlite3.c:54031:12: */
+func zeroJournalHdr(tls *libc.TLS, pPager uintptr, doTruncate int32) int32 { /* sqlite3.c:54046:12: */
bp := tls.Alloc(8)
defer tls.Free(8)
@@ -31728,13 +32316,13 @@ func zeroJournalHdr(tls *libc.TLS, pPager uintptr, doTruncate int32) int32 { /*
if (*Pager)(unsafe.Pointer(pPager)).FjournalOff != 0 {
var iLimit I64 = (*Pager)(unsafe.Pointer(pPager)).FjournalSizeLimit // Local cache of jsl
- if (doTruncate != 0) || (iLimit == int64(0)) {
+ if doTruncate != 0 || iLimit == int64(0) {
rc = Xsqlite3OsTruncate(tls, (*Pager)(unsafe.Pointer(pPager)).Fjfd, int64(0))
} else {
rc = Xsqlite3OsWrite(tls, (*Pager)(unsafe.Pointer(pPager)).Fjfd, uintptr(unsafe.Pointer(&zeroHdr)), int32(unsafe.Sizeof(zeroHdr)), int64(0))
}
- if (rc == SQLITE_OK) && !(int32((*Pager)(unsafe.Pointer(pPager)).FnoSync) != 0) {
- rc = Xsqlite3OsSync(tls, (*Pager)(unsafe.Pointer(pPager)).Fjfd, (SQLITE_SYNC_DATAONLY | int32((*Pager)(unsafe.Pointer(pPager)).FsyncFlags)))
+ if rc == SQLITE_OK && !(int32((*Pager)(unsafe.Pointer(pPager)).FnoSync) != 0) {
+ rc = Xsqlite3OsSync(tls, (*Pager)(unsafe.Pointer(pPager)).Fjfd, SQLITE_SYNC_DATAONLY|int32((*Pager)(unsafe.Pointer(pPager)).FsyncFlags))
}
// At this point the transaction is committed but the write lock
@@ -31742,11 +32330,11 @@ func zeroJournalHdr(tls *libc.TLS, pPager uintptr, doTruncate int32) int32 { /*
// the persistent journal and the journal file currently consumes more
// space than that limit allows for, truncate it now. There is no need
// to sync the file following this operation.
- if (rc == SQLITE_OK) && (iLimit > int64(0)) {
+ if rc == SQLITE_OK && iLimit > int64(0) {
// var sz I64 at bp, 8
rc = Xsqlite3OsFileSize(tls, (*Pager)(unsafe.Pointer(pPager)).Fjfd, bp /* &sz */)
- if (rc == SQLITE_OK) && (*(*I64)(unsafe.Pointer(bp /* sz */)) > iLimit) {
+ if rc == SQLITE_OK && *(*I64)(unsafe.Pointer(bp)) > iLimit {
rc = Xsqlite3OsTruncate(tls, (*Pager)(unsafe.Pointer(pPager)).Fjfd, iLimit)
}
}
@@ -31754,7 +32342,7 @@ func zeroJournalHdr(tls *libc.TLS, pPager uintptr, doTruncate int32) int32 { /*
return rc
}
-var zeroHdr = [28]uint8{0: uint8(0)} /* sqlite3.c:54042:25 */
+var zeroHdr = [28]uint8{0: uint8(0)} /* sqlite3.c:54057:25 */
// The journal file must be open when this routine is called. A journal
// header (JOURNAL_HDR_SZ bytes) is written into the journal file at the
@@ -31769,7 +32357,7 @@ var zeroHdr = [28]uint8{0: uint8(0)} /* sqlite3.c:54042:25 */
// - 4 bytes: Database page size.
//
// Followed by (JOURNAL_HDR_SZ - 28) bytes of unused space.
-func writeJournalHdr(tls *libc.TLS, pPager uintptr) int32 { /* sqlite3.c:54081:12: */
+func writeJournalHdr(tls *libc.TLS, pPager uintptr) int32 { /* sqlite3.c:54096:12: */
var rc int32 = SQLITE_OK // Return code
var zHeader uintptr = (*Pager)(unsafe.Pointer(pPager)).FpTmpSpace // Temporary space used to build header
var nHeader U32 = U32((*Pager)(unsafe.Pointer(pPager)).FpageSize) // Size of buffer pointed to by zHeader
@@ -31778,7 +32366,7 @@ func writeJournalHdr(tls *libc.TLS, pPager uintptr) int32 { /* sqlite3.c:54081:1
// Journal file must be open.
- if nHeader > ((*Pager)(unsafe.Pointer(pPager)).FsectorSize) {
+ if nHeader > (*Pager)(unsafe.Pointer(pPager)).FsectorSize {
nHeader = (*Pager)(unsafe.Pointer(pPager)).FsectorSize
}
@@ -31791,7 +32379,7 @@ func writeJournalHdr(tls *libc.TLS, pPager uintptr) int32 { /* sqlite3.c:54081:1
}
}
- (*Pager)(unsafe.Pointer(pPager)).FjournalHdr = libc.AssignPtrInt64(pPager+72 /* &.journalOff */, journalHdrOffset(tls, pPager))
+ (*Pager)(unsafe.Pointer(pPager)).FjournalHdr = libc.AssignPtrInt64(pPager+80, journalHdrOffset(tls, pPager))
// Write the nRec Field - the number of page records that follow this
// journal header. Normally, zero is written to this value at this time.
@@ -31812,31 +32400,31 @@ func writeJournalHdr(tls *libc.TLS, pPager uintptr) int32 { /* sqlite3.c:54081:1
// * When the SQLITE_IOCAP_SAFE_APPEND flag is set. This guarantees
// that garbage data is never appended to the journal file.
- if (((*Pager)(unsafe.Pointer(pPager)).FnoSync != 0) || (int32((*Pager)(unsafe.Pointer(pPager)).FjournalMode) == PAGER_JOURNALMODE_MEMORY)) ||
- ((Xsqlite3OsDeviceCharacteristics(tls, (*Pager)(unsafe.Pointer(pPager)).Ffd) & SQLITE_IOCAP_SAFE_APPEND) != 0) {
+ if (*Pager)(unsafe.Pointer(pPager)).FnoSync != 0 || int32((*Pager)(unsafe.Pointer(pPager)).FjournalMode) == PAGER_JOURNALMODE_MEMORY ||
+ Xsqlite3OsDeviceCharacteristics(tls, (*Pager)(unsafe.Pointer(pPager)).Ffd)&SQLITE_IOCAP_SAFE_APPEND != 0 {
libc.Xmemcpy(tls, zHeader, uintptr(unsafe.Pointer(&aJournalMagic)), uint32(unsafe.Sizeof(aJournalMagic)))
- Xsqlite3Put4byte(tls, (zHeader + 8), 0xffffffff)
+ Xsqlite3Put4byte(tls, zHeader+8, 0xffffffff)
} else {
- libc.Xmemset(tls, zHeader, 0, (uint32(unsafe.Sizeof(aJournalMagic)) + uint32(4)))
+ libc.Xmemset(tls, zHeader, 0, uint32(unsafe.Sizeof(aJournalMagic))+uint32(4))
}
// The random check-hash initializer
- Xsqlite3_randomness(tls, int32(unsafe.Sizeof(U32(0))), (pPager + 48 /* &.cksumInit */))
- Xsqlite3Put4byte(tls, (zHeader + 12), (*Pager)(unsafe.Pointer(pPager)).FcksumInit)
+ Xsqlite3_randomness(tls, int32(unsafe.Sizeof(U32(0))), pPager+52)
+ Xsqlite3Put4byte(tls, zHeader+12, (*Pager)(unsafe.Pointer(pPager)).FcksumInit)
// The initial database size
- Xsqlite3Put4byte(tls, (zHeader + 16), (*Pager)(unsafe.Pointer(pPager)).FdbOrigSize)
+ Xsqlite3Put4byte(tls, zHeader+16, (*Pager)(unsafe.Pointer(pPager)).FdbOrigSize)
// The assumed sector size for this process
- Xsqlite3Put4byte(tls, (zHeader + 20), (*Pager)(unsafe.Pointer(pPager)).FsectorSize)
+ Xsqlite3Put4byte(tls, zHeader+20, (*Pager)(unsafe.Pointer(pPager)).FsectorSize)
// The page size
- Xsqlite3Put4byte(tls, (zHeader + 24), uint32((*Pager)(unsafe.Pointer(pPager)).FpageSize))
+ Xsqlite3Put4byte(tls, zHeader+24, uint32((*Pager)(unsafe.Pointer(pPager)).FpageSize))
// Initializing the tail of the buffer is not necessary. Everything
// works find if the following memset() is omitted. But initializing
// the memory prevents valgrind from complaining, so we are willing to
// take the performance hit.
- libc.Xmemset(tls, (zHeader + 28), 0,
- (nHeader - (uint32(unsafe.Sizeof(aJournalMagic)) + uint32(20))))
+ libc.Xmemset(tls, zHeader+28, 0,
+ nHeader-(uint32(unsafe.Sizeof(aJournalMagic))+uint32(20)))
// In theory, it is only necessary to write the 28 bytes that the
// journal header consumes to the journal file here. Then increment the
@@ -31854,11 +32442,11 @@ func writeJournalHdr(tls *libc.TLS, pPager uintptr) int32 { /* sqlite3.c:54081:1
// database page size. Since the zHeader buffer is only Pager.pageSize
// bytes in size, more than one call to sqlite3OsWrite() may be required
// to populate the entire journal header sector.
- for nWrite = U32(0); (rc == SQLITE_OK) && (nWrite < ((*Pager)(unsafe.Pointer(pPager)).FsectorSize)); nWrite = nWrite + (nHeader) {
+ for nWrite = U32(0); rc == SQLITE_OK && nWrite < (*Pager)(unsafe.Pointer(pPager)).FsectorSize; nWrite = nWrite + nHeader {
rc = Xsqlite3OsWrite(tls, (*Pager)(unsafe.Pointer(pPager)).Fjfd, zHeader, int32(nHeader), (*Pager)(unsafe.Pointer(pPager)).FjournalOff)
- *(*I64)(unsafe.Pointer(pPager + 72 /* &.journalOff */)) += (I64(nHeader))
+ *(*I64)(unsafe.Pointer(pPager + 80)) += I64(nHeader)
}
return rc
@@ -31879,7 +32467,7 @@ func writeJournalHdr(tls *libc.TLS, pPager uintptr) int32 { /* sqlite3.c:54081:1
// If the journal header file appears to be corrupted, SQLITE_DONE is
// returned and *pNRec and *PDbSize are undefined. If JOURNAL_HDR_SZ bytes
// cannot be read from the journal file an error code is returned.
-func readJournalHdr(tls *libc.TLS, pPager uintptr, isHot int32, journalSize I64, pNRec uintptr, pDbSize uintptr) int32 { /* sqlite3.c:54199:12: */
+func readJournalHdr(tls *libc.TLS, pPager uintptr, isHot int32, journalSize I64, pNRec uintptr, pDbSize uintptr) int32 { /* sqlite3.c:54214:12: */
bp := tls.Alloc(16)
defer tls.Free(16)
@@ -31894,7 +32482,7 @@ func readJournalHdr(tls *libc.TLS, pPager uintptr, isHot int32, journalSize I64,
// journal file is too small for there to be a header stored at this
// point, return SQLITE_DONE.
(*Pager)(unsafe.Pointer(pPager)).FjournalOff = journalHdrOffset(tls, pPager)
- if ((*Pager)(unsafe.Pointer(pPager)).FjournalOff + (I64((*Pager)(unsafe.Pointer(pPager)).FsectorSize))) > journalSize {
+ if (*Pager)(unsafe.Pointer(pPager)).FjournalOff+I64((*Pager)(unsafe.Pointer(pPager)).FsectorSize) > journalSize {
return SQLITE_DONE
}
iHdrOff = (*Pager)(unsafe.Pointer(pPager)).FjournalOff
@@ -31903,12 +32491,12 @@ func readJournalHdr(tls *libc.TLS, pPager uintptr, isHot int32, journalSize I64,
// the magic string found at the start of each journal header, return
// SQLITE_DONE. If an IO error occurs, return an error code. Otherwise,
// proceed.
- if (isHot != 0) || (iHdrOff != (*Pager)(unsafe.Pointer(pPager)).FjournalHdr) {
+ if isHot != 0 || iHdrOff != (*Pager)(unsafe.Pointer(pPager)).FjournalHdr {
rc = Xsqlite3OsRead(tls, (*Pager)(unsafe.Pointer(pPager)).Fjfd, bp /* &aMagic[0] */, int32(unsafe.Sizeof([8]uint8{})), iHdrOff)
if rc != 0 {
return rc
}
- if libc.Xmemcmp(tls, bp /* &aMagic[0] */, uintptr(unsafe.Pointer(&aJournalMagic)), uint32(unsafe.Sizeof([8]uint8{}))) != 0 {
+ if libc.Xmemcmp(tls, bp, uintptr(unsafe.Pointer(&aJournalMagic)), uint32(unsafe.Sizeof([8]uint8{}))) != 0 {
return SQLITE_DONE
}
}
@@ -31916,9 +32504,9 @@ func readJournalHdr(tls *libc.TLS, pPager uintptr, isHot int32, journalSize I64,
// Read the first three 32-bit fields of the journal header: The nRec
// field, the checksum-initializer and the database size at the start
// of the transaction. Return an error code if anything goes wrong.
- if ((SQLITE_OK != (libc.AssignInt32(&rc, read32bits(tls, (*Pager)(unsafe.Pointer(pPager)).Fjfd, (iHdrOff+int64(8)), pNRec)))) ||
- (SQLITE_OK != (libc.AssignInt32(&rc, read32bits(tls, (*Pager)(unsafe.Pointer(pPager)).Fjfd, (iHdrOff+int64(12)), (pPager+48 /* &.cksumInit */)))))) ||
- (SQLITE_OK != (libc.AssignInt32(&rc, read32bits(tls, (*Pager)(unsafe.Pointer(pPager)).Fjfd, (iHdrOff+int64(16)), pDbSize)))) {
+ if SQLITE_OK != libc.AssignInt32(&rc, read32bits(tls, (*Pager)(unsafe.Pointer(pPager)).Fjfd, iHdrOff+int64(8), pNRec)) ||
+ SQLITE_OK != libc.AssignInt32(&rc, read32bits(tls, (*Pager)(unsafe.Pointer(pPager)).Fjfd, iHdrOff+int64(12), pPager+52)) ||
+ SQLITE_OK != libc.AssignInt32(&rc, read32bits(tls, (*Pager)(unsafe.Pointer(pPager)).Fjfd, iHdrOff+int64(16), pDbSize)) {
return rc
}
@@ -31929,15 +32517,15 @@ func readJournalHdr(tls *libc.TLS, pPager uintptr, isHot int32, journalSize I64,
// Sector-size field of journal header
// Read the page-size and sector-size journal header fields.
- if (SQLITE_OK != (libc.AssignInt32(&rc, read32bits(tls, (*Pager)(unsafe.Pointer(pPager)).Fjfd, (iHdrOff+int64(20)), bp+8 /* &iSectorSize */)))) ||
- (SQLITE_OK != (libc.AssignInt32(&rc, read32bits(tls, (*Pager)(unsafe.Pointer(pPager)).Fjfd, (iHdrOff+int64(24)), bp+12 /* &iPageSize */)))) {
+ if SQLITE_OK != libc.AssignInt32(&rc, read32bits(tls, (*Pager)(unsafe.Pointer(pPager)).Fjfd, iHdrOff+int64(20), bp+8)) ||
+ SQLITE_OK != libc.AssignInt32(&rc, read32bits(tls, (*Pager)(unsafe.Pointer(pPager)).Fjfd, iHdrOff+int64(24), bp+12)) {
return rc
}
// Versions of SQLite prior to 3.5.8 set the page-size field of the
// journal header to zero. In this case, assume that the Pager.pageSize
// variable is already set to the correct page size.
- if *(*U32)(unsafe.Pointer(bp + 12 /* iPageSize */)) == U32(0) {
+ if *(*U32)(unsafe.Pointer(bp + 12)) == U32(0) {
*(*U32)(unsafe.Pointer(bp + 12 /* iPageSize */)) = U32((*Pager)(unsafe.Pointer(pPager)).FpageSize)
}
@@ -31945,9 +32533,9 @@ func readJournalHdr(tls *libc.TLS, pPager uintptr, isHot int32, journalSize I64,
// are within range. To be 'in range', both values need to be a power
// of two greater than or equal to 512 or 32, and not greater than their
// respective compile time maximum limits.
- if (((((*(*U32)(unsafe.Pointer(bp + 12 /* iPageSize */)) < U32(512)) || (*(*U32)(unsafe.Pointer(bp + 8 /* iSectorSize */)) < U32(32))) ||
- (*(*U32)(unsafe.Pointer(bp + 12 /* iPageSize */)) > U32(SQLITE_MAX_PAGE_SIZE))) || (*(*U32)(unsafe.Pointer(bp + 8 /* iSectorSize */)) > U32(MAX_SECTOR_SIZE))) ||
- (((*(*U32)(unsafe.Pointer(bp + 12 /* iPageSize */)) - U32(1)) & *(*U32)(unsafe.Pointer(bp + 12 /* iPageSize */))) != U32(0))) || (((*(*U32)(unsafe.Pointer(bp + 8 /* iSectorSize */)) - U32(1)) & *(*U32)(unsafe.Pointer(bp + 8 /* iSectorSize */))) != U32(0)) {
+ if *(*U32)(unsafe.Pointer(bp + 12)) < U32(512) || *(*U32)(unsafe.Pointer(bp + 8)) < U32(32) ||
+ *(*U32)(unsafe.Pointer(bp + 12)) > U32(SQLITE_MAX_PAGE_SIZE) || *(*U32)(unsafe.Pointer(bp + 8)) > U32(MAX_SECTOR_SIZE) ||
+ (*(*U32)(unsafe.Pointer(bp + 12))-U32(1))&*(*U32)(unsafe.Pointer(bp + 12)) != U32(0) || (*(*U32)(unsafe.Pointer(bp + 8))-U32(1))&*(*U32)(unsafe.Pointer(bp + 8)) != U32(0) {
// If the either the page-size or sector-size in the journal-header is
// invalid, then the process that wrote the journal-header must have
// crashed before the header was synced. In this case stop reading
@@ -31968,7 +32556,7 @@ func readJournalHdr(tls *libc.TLS, pPager uintptr, isHot int32, journalSize I64,
(*Pager)(unsafe.Pointer(pPager)).FsectorSize = *(*U32)(unsafe.Pointer(bp + 8 /* iSectorSize */))
}
- *(*I64)(unsafe.Pointer(pPager + 72 /* &.journalOff */)) += (I64((*Pager)(unsafe.Pointer(pPager)).FsectorSize))
+ *(*I64)(unsafe.Pointer(pPager + 80)) += I64((*Pager)(unsafe.Pointer(pPager)).FsectorSize)
return rc
}
@@ -31989,7 +32577,7 @@ func readJournalHdr(tls *libc.TLS, pPager uintptr, isHot int32, journalSize I64,
//
// If zSuper is a NULL pointer (occurs for a single database transaction),
// this call is a no-op.
-func writeSuperJournal(tls *libc.TLS, pPager uintptr, zSuper uintptr) int32 { /* sqlite3.c:54324:12: */
+func writeSuperJournal(tls *libc.TLS, pPager uintptr, zSuper uintptr) int32 { /* sqlite3.c:54339:12: */
bp := tls.Alloc(8)
defer tls.Free(8)
@@ -32000,16 +32588,16 @@ func writeSuperJournal(tls *libc.TLS, pPager uintptr, zSuper uintptr) int32 { /*
// Size of journal file on disk
var cksum U32 = U32(0) // Checksum of string zSuper
- if (!(zSuper != 0) ||
- (int32((*Pager)(unsafe.Pointer(pPager)).FjournalMode) == PAGER_JOURNALMODE_MEMORY)) ||
- !((*Sqlite3_file)(unsafe.Pointer(((*Pager)(unsafe.Pointer(pPager)).Fjfd))).FpMethods != uintptr(0)) {
+ if !(zSuper != 0) ||
+ int32((*Pager)(unsafe.Pointer(pPager)).FjournalMode) == PAGER_JOURNALMODE_MEMORY ||
+ !((*Sqlite3_file)(unsafe.Pointer((*Pager)(unsafe.Pointer(pPager)).Fjfd)).FpMethods != uintptr(0)) {
return SQLITE_OK
}
(*Pager)(unsafe.Pointer(pPager)).FsetSuper = U8(1)
// Calculate the length in bytes and the checksum of zSuper
for nSuper = 0; *(*uint8)(unsafe.Pointer(zSuper + uintptr(nSuper))) != 0; nSuper++ {
- cksum = cksum + (U32(*(*uint8)(unsafe.Pointer(zSuper + uintptr(nSuper)))))
+ cksum = cksum + U32(*(*uint8)(unsafe.Pointer(zSuper + uintptr(nSuper))))
}
// If in full-sync mode, advance to the next disk sector before writing
@@ -32022,15 +32610,15 @@ func writeSuperJournal(tls *libc.TLS, pPager uintptr, zSuper uintptr) int32 { /*
// Write the super-journal data to the end of the journal file. If
// an error occurs, return the error code to the caller.
- if ((((0 != (libc.AssignInt32(&rc, write32bits(tls, (*Pager)(unsafe.Pointer(pPager)).Fjfd, iHdrOff, (Pgno((Xsqlite3PendingByte/((*Pager)(unsafe.Pointer(pPager)).FpageSize))+1)))))) ||
- (0 != (libc.AssignInt32(&rc, Xsqlite3OsWrite(tls, (*Pager)(unsafe.Pointer(pPager)).Fjfd, zSuper, nSuper, (iHdrOff+int64(4))))))) ||
- (0 != (libc.AssignInt32(&rc, write32bits(tls, (*Pager)(unsafe.Pointer(pPager)).Fjfd, ((iHdrOff+int64(4))+I64(nSuper)), uint32(nSuper)))))) ||
- (0 != (libc.AssignInt32(&rc, write32bits(tls, (*Pager)(unsafe.Pointer(pPager)).Fjfd, (((iHdrOff+int64(4))+I64(nSuper))+int64(4)), cksum))))) ||
- (0 != (libc.AssignInt32(&rc, Xsqlite3OsWrite(tls, (*Pager)(unsafe.Pointer(pPager)).Fjfd, uintptr(unsafe.Pointer(&aJournalMagic)), 8,
- (((iHdrOff+int64(4))+I64(nSuper))+int64(8)))))) {
+ if 0 != libc.AssignInt32(&rc, write32bits(tls, (*Pager)(unsafe.Pointer(pPager)).Fjfd, iHdrOff, Pgno(I64(Xsqlite3PendingByte)/(*Pager)(unsafe.Pointer(pPager)).FpageSize+int64(1)))) ||
+ 0 != libc.AssignInt32(&rc, Xsqlite3OsWrite(tls, (*Pager)(unsafe.Pointer(pPager)).Fjfd, zSuper, nSuper, iHdrOff+int64(4))) ||
+ 0 != libc.AssignInt32(&rc, write32bits(tls, (*Pager)(unsafe.Pointer(pPager)).Fjfd, iHdrOff+int64(4)+I64(nSuper), uint32(nSuper))) ||
+ 0 != libc.AssignInt32(&rc, write32bits(tls, (*Pager)(unsafe.Pointer(pPager)).Fjfd, iHdrOff+int64(4)+I64(nSuper)+int64(4), cksum)) ||
+ 0 != libc.AssignInt32(&rc, Xsqlite3OsWrite(tls, (*Pager)(unsafe.Pointer(pPager)).Fjfd, uintptr(unsafe.Pointer(&aJournalMagic)), 8,
+ iHdrOff+int64(4)+I64(nSuper)+int64(8))) {
return rc
}
- *(*I64)(unsafe.Pointer(pPager + 72 /* &.journalOff */)) += (I64(nSuper + 20))
+ *(*I64)(unsafe.Pointer(pPager + 80)) += I64(nSuper + 20)
// If the pager is in peristent-journal mode, then the physical
// journal-file may extend past the end of the super-journal name
@@ -32041,34 +32629,34 @@ func writeSuperJournal(tls *libc.TLS, pPager uintptr, zSuper uintptr) int32 { /*
//
// Easiest thing to do in this scenario is to truncate the journal
// file to the required size.
- if (SQLITE_OK == (libc.AssignInt32(&rc, Xsqlite3OsFileSize(tls, (*Pager)(unsafe.Pointer(pPager)).Fjfd, bp /* &jrnlSize */)))) &&
- (*(*I64)(unsafe.Pointer(bp /* jrnlSize */)) > (*Pager)(unsafe.Pointer(pPager)).FjournalOff) {
+ if SQLITE_OK == libc.AssignInt32(&rc, Xsqlite3OsFileSize(tls, (*Pager)(unsafe.Pointer(pPager)).Fjfd, bp)) &&
+ *(*I64)(unsafe.Pointer(bp)) > (*Pager)(unsafe.Pointer(pPager)).FjournalOff {
rc = Xsqlite3OsTruncate(tls, (*Pager)(unsafe.Pointer(pPager)).Fjfd, (*Pager)(unsafe.Pointer(pPager)).FjournalOff)
}
return rc
}
// Discard the entire contents of the in-memory page-cache.
-func pager_reset(tls *libc.TLS, pPager uintptr) { /* sqlite3.c:54392:13: */
+func pager_reset(tls *libc.TLS, pPager uintptr) { /* sqlite3.c:54407:13: */
(*Pager)(unsafe.Pointer(pPager)).FiDataVersion++
Xsqlite3BackupRestart(tls, (*Pager)(unsafe.Pointer(pPager)).FpBackup)
Xsqlite3PcacheClear(tls, (*Pager)(unsafe.Pointer(pPager)).FpPCache)
}
// Return the pPager->iDataVersion value
-func Xsqlite3PagerDataVersion(tls *libc.TLS, pPager uintptr) U32 { /* sqlite3.c:54401:20: */
+func Xsqlite3PagerDataVersion(tls *libc.TLS, pPager uintptr) U32 { /* sqlite3.c:54416:20: */
return (*Pager)(unsafe.Pointer(pPager)).FiDataVersion
}
// Free all structures in the Pager.aSavepoint[] array and set both
// Pager.aSavepoint and Pager.nSavepoint to zero. Close the sub-journal
// if it is open and the pager is not in exclusive mode.
-func releaseAllSavepoints(tls *libc.TLS, pPager uintptr) { /* sqlite3.c:54410:13: */
+func releaseAllSavepoints(tls *libc.TLS, pPager uintptr) { /* sqlite3.c:54425:13: */
var ii int32 // Iterator for looping through Pager.aSavepoint
for ii = 0; ii < (*Pager)(unsafe.Pointer(pPager)).FnSavepoint; ii++ {
Xsqlite3BitvecDestroy(tls, (*PagerSavepoint)(unsafe.Pointer((*Pager)(unsafe.Pointer(pPager)).FaSavepoint+uintptr(ii)*48)).FpInSavepoint)
}
- if !(int32((*Pager)(unsafe.Pointer(pPager)).FexclusiveMode) != 0) || (Xsqlite3JournalIsInMemory(tls, (*Pager)(unsafe.Pointer(pPager)).Fsjfd) != 0) {
+ if !(int32((*Pager)(unsafe.Pointer(pPager)).FexclusiveMode) != 0) || Xsqlite3JournalIsInMemory(tls, (*Pager)(unsafe.Pointer(pPager)).Fsjfd) != 0 {
Xsqlite3OsClose(tls, (*Pager)(unsafe.Pointer(pPager)).Fsjfd)
}
Xsqlite3_free(tls, (*Pager)(unsafe.Pointer(pPager)).FaSavepoint)
@@ -32080,14 +32668,14 @@ func releaseAllSavepoints(tls *libc.TLS, pPager uintptr) { /* sqlite3.c:54410:13
// Set the bit number pgno in the PagerSavepoint.pInSavepoint
// bitvecs of all open savepoints. Return SQLITE_OK if successful
// or SQLITE_NOMEM if a malloc failure occurs.
-func addToSavepointBitvecs(tls *libc.TLS, pPager uintptr, pgno Pgno) int32 { /* sqlite3.c:54429:12: */
+func addToSavepointBitvecs(tls *libc.TLS, pPager uintptr, pgno Pgno) int32 { /* sqlite3.c:54444:12: */
var ii int32 // Loop counter
var rc int32 = SQLITE_OK // Result code
for ii = 0; ii < (*Pager)(unsafe.Pointer(pPager)).FnSavepoint; ii++ {
- var p uintptr = ((*Pager)(unsafe.Pointer(pPager)).FaSavepoint + uintptr(ii)*48)
+ var p uintptr = (*Pager)(unsafe.Pointer(pPager)).FaSavepoint + uintptr(ii)*48
if pgno <= (*PagerSavepoint)(unsafe.Pointer(p)).FnOrig {
- rc = rc | (Xsqlite3BitvecSet(tls, (*PagerSavepoint)(unsafe.Pointer(p)).FpInSavepoint, pgno))
+ rc = rc | Xsqlite3BitvecSet(tls, (*PagerSavepoint)(unsafe.Pointer(p)).FpInSavepoint, pgno)
}
}
@@ -32109,20 +32697,20 @@ func addToSavepointBitvecs(tls *libc.TLS, pPager uintptr, pgno Pgno) int32 { /*
// or not, any journal file left in the file-system will be treated
// as a hot-journal and rolled back the next time a read-transaction
// is opened (by this or by any other connection).
-func pager_unlock(tls *libc.TLS, pPager uintptr) { /* sqlite3.c:54461:13: */
+func pager_unlock(tls *libc.TLS, pPager uintptr) { /* sqlite3.c:54476:13: */
Xsqlite3BitvecDestroy(tls, (*Pager)(unsafe.Pointer(pPager)).FpInJournal)
(*Pager)(unsafe.Pointer(pPager)).FpInJournal = uintptr(0)
releaseAllSavepoints(tls, pPager)
- if (*Pager)(unsafe.Pointer((pPager))).FpWal != uintptr(0) {
+ if (*Pager)(unsafe.Pointer(pPager)).FpWal != uintptr(0) {
Xsqlite3WalEndReadTransaction(tls, (*Pager)(unsafe.Pointer(pPager)).FpWal)
(*Pager)(unsafe.Pointer(pPager)).FeState = U8(PAGER_OPEN)
} else if !(int32((*Pager)(unsafe.Pointer(pPager)).FexclusiveMode) != 0) {
var rc int32 // Error code returned by pagerUnlockDb()
var iDc int32
- if (*Sqlite3_file)(unsafe.Pointer(((*Pager)(unsafe.Pointer(pPager)).Ffd))).FpMethods != uintptr(0) {
+ if (*Sqlite3_file)(unsafe.Pointer((*Pager)(unsafe.Pointer(pPager)).Ffd)).FpMethods != uintptr(0) {
iDc = Xsqlite3OsDeviceCharacteristics(tls, (*Pager)(unsafe.Pointer(pPager)).Ffd)
} else {
iDc = 0
@@ -32133,8 +32721,8 @@ func pager_unlock(tls *libc.TLS, pPager uintptr) { /* sqlite3.c:54461:13: */
// another connection with journal_mode=delete might delete the file
// out from under us.
- if (0 == (iDc & SQLITE_IOCAP_UNDELETABLE_WHEN_OPEN)) ||
- (1 != (int32((*Pager)(unsafe.Pointer(pPager)).FjournalMode) & 5)) {
+ if 0 == iDc&SQLITE_IOCAP_UNDELETABLE_WHEN_OPEN ||
+ 1 != int32((*Pager)(unsafe.Pointer(pPager)).FjournalMode)&5 {
Xsqlite3OsClose(tls, (*Pager)(unsafe.Pointer(pPager)).Fjfd)
}
@@ -32143,8 +32731,8 @@ func pager_unlock(tls *libc.TLS, pPager uintptr) { /* sqlite3.c:54461:13: */
// above the #define for UNKNOWN_LOCK for an explanation of why this
// is necessary.
rc = pagerUnlockDb(tls, pPager, NO_LOCK)
- if (rc != SQLITE_OK) && (int32((*Pager)(unsafe.Pointer(pPager)).FeState) == PAGER_ERROR) {
- (*Pager)(unsafe.Pointer(pPager)).FeLock = (U8(EXCLUSIVE_LOCK + 1))
+ if rc != SQLITE_OK && int32((*Pager)(unsafe.Pointer(pPager)).FeState) == PAGER_ERROR {
+ (*Pager)(unsafe.Pointer(pPager)).FeLock = U8(EXCLUSIVE_LOCK + 1)
}
// The pager state may be changed from PAGER_ERROR to PAGER_OPEN here
@@ -32166,7 +32754,7 @@ func pager_unlock(tls *libc.TLS, pPager uintptr) { /* sqlite3.c:54461:13: */
(*Pager)(unsafe.Pointer(pPager)).FeState = U8(PAGER_OPEN)
} else {
(*Pager)(unsafe.Pointer(pPager)).FeState = func() uint8 {
- if (*Sqlite3_file)(unsafe.Pointer(((*Pager)(unsafe.Pointer(pPager)).Fjfd))).FpMethods != uintptr(0) {
+ if (*Sqlite3_file)(unsafe.Pointer((*Pager)(unsafe.Pointer(pPager)).Fjfd)).FpMethods != uintptr(0) {
return uint8(PAGER_OPEN)
}
return uint8(PAGER_READER)
@@ -32201,10 +32789,10 @@ func pager_unlock(tls *libc.TLS, pPager uintptr) { /* sqlite3.c:54461:13: */
// the persistent error occurred, then the rollback journal may need
// to be replayed to restore the contents of the database file (as if
// it were a hot-journal).
-func pager_error(tls *libc.TLS, pPager uintptr, rc int32) int32 { /* sqlite3.c:54558:12: */
- var rc2 int32 = (rc & 0xff)
+func pager_error(tls *libc.TLS, pPager uintptr, rc int32) int32 { /* sqlite3.c:54573:12: */
+ var rc2 int32 = rc & 0xff
- if (rc2 == SQLITE_FULL) || (rc2 == SQLITE_IOERR) {
+ if rc2 == SQLITE_FULL || rc2 == SQLITE_IOERR {
(*Pager)(unsafe.Pointer(pPager)).FerrCode = rc
(*Pager)(unsafe.Pointer(pPager)).FeState = U8(PAGER_ERROR)
setGetterMethod(tls, pPager)
@@ -32226,17 +32814,17 @@ func pager_error(tls *libc.TLS, pPager uintptr, rc int32) int32 { /* sqlite3.c:5
// file has been created already (via a spill on pagerStress()) and
// when the number of dirty pages in memory exceeds 25% of the total
// cache size.
-func pagerFlushOnCommit(tls *libc.TLS, pPager uintptr, bCommit int32) int32 { /* sqlite3.c:54592:12: */
+func pagerFlushOnCommit(tls *libc.TLS, pPager uintptr, bCommit int32) int32 { /* sqlite3.c:54607:12: */
if int32((*Pager)(unsafe.Pointer(pPager)).FtempFile) == 0 {
return 1
}
if !(bCommit != 0) {
return 0
}
- if !((*Sqlite3_file)(unsafe.Pointer(((*Pager)(unsafe.Pointer(pPager)).Ffd))).FpMethods != uintptr(0)) {
+ if !((*Sqlite3_file)(unsafe.Pointer((*Pager)(unsafe.Pointer(pPager)).Ffd)).FpMethods != uintptr(0)) {
return 0
}
- return (libc.Bool32(Xsqlite3PCachePercentDirty(tls, (*Pager)(unsafe.Pointer(pPager)).FpPCache) >= 25))
+ return libc.Bool32(Xsqlite3PCachePercentDirty(tls, (*Pager)(unsafe.Pointer(pPager)).FpPCache) >= 25)
}
// This routine ends a transaction. A transaction is usually ended by
@@ -32290,7 +32878,7 @@ func pagerFlushOnCommit(tls *libc.TLS, pPager uintptr, bCommit int32) int32 { /*
// unlock operation fails as well, then the first error code related
// to the first error encountered (the journal finalization one) is
// returned.
-func pager_end_transaction(tls *libc.TLS, pPager uintptr, hasSuper int32, bCommit int32) int32 { /* sqlite3.c:54652:12: */
+func pager_end_transaction(tls *libc.TLS, pPager uintptr, hasSuper int32, bCommit int32) int32 { /* sqlite3.c:54667:12: */
var rc int32 = SQLITE_OK // Error code from journal finalization operation
var rc2 int32 = SQLITE_OK // Error code from db file unlock operation
@@ -32307,13 +32895,13 @@ func pager_end_transaction(tls *libc.TLS, pPager uintptr, hasSuper int32, bCommi
// read-transaction, this function is called with eState==PAGER_READER
// and eLock==EXCLUSIVE_LOCK when the read-transaction is closed.
- if (int32((*Pager)(unsafe.Pointer(pPager)).FeState) < PAGER_WRITER_LOCKED) && (int32((*Pager)(unsafe.Pointer(pPager)).FeLock) < RESERVED_LOCK) {
+ if int32((*Pager)(unsafe.Pointer(pPager)).FeState) < PAGER_WRITER_LOCKED && int32((*Pager)(unsafe.Pointer(pPager)).FeLock) < RESERVED_LOCK {
return SQLITE_OK
}
releaseAllSavepoints(tls, pPager)
- if (*Sqlite3_file)(unsafe.Pointer(((*Pager)(unsafe.Pointer(pPager)).Fjfd))).FpMethods != uintptr(0) {
+ if (*Sqlite3_file)(unsafe.Pointer((*Pager)(unsafe.Pointer(pPager)).Fjfd)).FpMethods != uintptr(0) {
// Finalize the journal file.
if Xsqlite3JournalIsInMemory(tls, (*Pager)(unsafe.Pointer(pPager)).Fjfd) != 0 {
@@ -32324,7 +32912,7 @@ func pager_end_transaction(tls *libc.TLS, pPager uintptr, hasSuper int32, bCommi
rc = SQLITE_OK
} else {
rc = Xsqlite3OsTruncate(tls, (*Pager)(unsafe.Pointer(pPager)).Fjfd, int64(0))
- if (rc == SQLITE_OK) && ((*Pager)(unsafe.Pointer(pPager)).FfullSync != 0) {
+ if rc == SQLITE_OK && (*Pager)(unsafe.Pointer(pPager)).FfullSync != 0 {
// Make sure the new file size is written into the inode right away.
// Otherwise the journal might resurrect following a power loss and
// cause the last transaction to roll back. See
@@ -32333,9 +32921,9 @@ func pager_end_transaction(tls *libc.TLS, pPager uintptr, hasSuper int32, bCommi
}
}
(*Pager)(unsafe.Pointer(pPager)).FjournalOff = int64(0)
- } else if (int32((*Pager)(unsafe.Pointer(pPager)).FjournalMode) == PAGER_JOURNALMODE_PERSIST) ||
- (((*Pager)(unsafe.Pointer(pPager)).FexclusiveMode != 0) && (int32((*Pager)(unsafe.Pointer(pPager)).FjournalMode) != PAGER_JOURNALMODE_WAL)) {
- rc = zeroJournalHdr(tls, pPager, (libc.Bool32((hasSuper != 0) || ((*Pager)(unsafe.Pointer(pPager)).FtempFile != 0))))
+ } else if int32((*Pager)(unsafe.Pointer(pPager)).FjournalMode) == PAGER_JOURNALMODE_PERSIST ||
+ (*Pager)(unsafe.Pointer(pPager)).FexclusiveMode != 0 && int32((*Pager)(unsafe.Pointer(pPager)).FjournalMode) != PAGER_JOURNALMODE_WAL {
+ rc = zeroJournalHdr(tls, pPager, libc.Bool32(hasSuper != 0 || (*Pager)(unsafe.Pointer(pPager)).FtempFile != 0))
(*Pager)(unsafe.Pointer(pPager)).FjournalOff = int64(0)
} else {
// This branch may be executed with Pager.journalMode==MEMORY if
@@ -32355,7 +32943,7 @@ func pager_end_transaction(tls *libc.TLS, pPager uintptr, hasSuper int32, bCommi
(*Pager)(unsafe.Pointer(pPager)).FpInJournal = uintptr(0)
(*Pager)(unsafe.Pointer(pPager)).FnRec = 0
if rc == SQLITE_OK {
- if ((*Pager)(unsafe.Pointer(pPager)).FmemDb != 0) || (pagerFlushOnCommit(tls, pPager, bCommit) != 0) {
+ if (*Pager)(unsafe.Pointer(pPager)).FmemDb != 0 || pagerFlushOnCommit(tls, pPager, bCommit) != 0 {
Xsqlite3PcacheCleanAll(tls, (*Pager)(unsafe.Pointer(pPager)).FpPCache)
} else {
Xsqlite3PcacheClearWritable(tls, (*Pager)(unsafe.Pointer(pPager)).FpPCache)
@@ -32363,13 +32951,13 @@ func pager_end_transaction(tls *libc.TLS, pPager uintptr, hasSuper int32, bCommi
Xsqlite3PcacheTruncate(tls, (*Pager)(unsafe.Pointer(pPager)).FpPCache, (*Pager)(unsafe.Pointer(pPager)).FdbSize)
}
- if (*Pager)(unsafe.Pointer((pPager))).FpWal != uintptr(0) {
+ if (*Pager)(unsafe.Pointer(pPager)).FpWal != uintptr(0) {
// Drop the WAL write-lock, if any. Also, if the connection was in
// locking_mode=exclusive mode but is no longer, drop the EXCLUSIVE
// lock held on the database file.
rc2 = Xsqlite3WalEndWriteTransaction(tls, (*Pager)(unsafe.Pointer(pPager)).FpWal)
- } else if ((rc == SQLITE_OK) && (bCommit != 0)) && ((*Pager)(unsafe.Pointer(pPager)).FdbFileSize > (*Pager)(unsafe.Pointer(pPager)).FdbSize) {
+ } else if rc == SQLITE_OK && bCommit != 0 && (*Pager)(unsafe.Pointer(pPager)).FdbFileSize > (*Pager)(unsafe.Pointer(pPager)).FdbSize {
// This branch is taken when committing a transaction in rollback-journal
// mode if the database file on disk is larger than the database image.
// At this point the journal has been finalized and the transaction
@@ -32380,7 +32968,7 @@ func pager_end_transaction(tls *libc.TLS, pPager uintptr, hasSuper int32, bCommi
rc = pager_truncate(tls, pPager, (*Pager)(unsafe.Pointer(pPager)).FdbSize)
}
- if (rc == SQLITE_OK) && (bCommit != 0) {
+ if rc == SQLITE_OK && bCommit != 0 {
rc = Xsqlite3OsFileControl(tls, (*Pager)(unsafe.Pointer(pPager)).Ffd, SQLITE_FCNTL_COMMIT_PHASETWO, uintptr(0))
if rc == SQLITE_NOTFOUND {
rc = SQLITE_OK
@@ -32388,7 +32976,7 @@ func pager_end_transaction(tls *libc.TLS, pPager uintptr, hasSuper int32, bCommi
}
if !(int32((*Pager)(unsafe.Pointer(pPager)).FexclusiveMode) != 0) &&
- (!((*Pager)(unsafe.Pointer((pPager))).FpWal != uintptr(0)) || (Xsqlite3WalExclusiveMode(tls, (*Pager)(unsafe.Pointer(pPager)).FpWal, 0) != 0)) {
+ (!((*Pager)(unsafe.Pointer(pPager)).FpWal != uintptr(0)) || Xsqlite3WalExclusiveMode(tls, (*Pager)(unsafe.Pointer(pPager)).FpWal, 0) != 0) {
rc2 = pagerUnlockDb(tls, pPager, SHARED_LOCK)
}
(*Pager)(unsafe.Pointer(pPager)).FeState = U8(PAGER_READER)
@@ -32417,8 +33005,8 @@ func pager_end_transaction(tls *libc.TLS, pPager uintptr, hasSuper int32, bCommi
// malloc error occurs during a rollback, then this will itself cause
// the pager to enter the ERROR state. Which will be cleared by the
// call to pager_unlock(), as described above.
-func pagerUnlockAndRollback(tls *libc.TLS, pPager uintptr) { /* sqlite3.c:54799:13: */
- if (int32((*Pager)(unsafe.Pointer(pPager)).FeState) != PAGER_ERROR) && (int32((*Pager)(unsafe.Pointer(pPager)).FeState) != PAGER_OPEN) {
+func pagerUnlockAndRollback(tls *libc.TLS, pPager uintptr) { /* sqlite3.c:54814:13: */
+ if int32((*Pager)(unsafe.Pointer(pPager)).FeState) != PAGER_ERROR && int32((*Pager)(unsafe.Pointer(pPager)).FeState) != PAGER_OPEN {
if int32((*Pager)(unsafe.Pointer(pPager)).FeState) >= PAGER_WRITER_LOCKED {
Xsqlite3BeginBenignMalloc(tls)
@@ -32449,12 +33037,12 @@ func pagerUnlockAndRollback(tls *libc.TLS, pPager uintptr) { /* sqlite3.c:54799:
// It is much less likely that the two ends of the journal record will be
// correct and the middle be corrupt. Thus, this "checksum" scheme,
// though fast and simple, catches the mostly likely kind of corruption.
-func pager_cksum(tls *libc.TLS, pPager uintptr, aData uintptr) U32 { /* sqlite3.c:54833:12: */
- var cksum U32 = (*Pager)(unsafe.Pointer(pPager)).FcksumInit // Checksum value to return
- var i int32 = ((*Pager)(unsafe.Pointer(pPager)).FpageSize - 200) // Loop counter
+func pager_cksum(tls *libc.TLS, pPager uintptr, aData uintptr) U32 { /* sqlite3.c:54848:12: */
+ var cksum U32 = (*Pager)(unsafe.Pointer(pPager)).FcksumInit // Checksum value to return
+ var i int32 = int32((*Pager)(unsafe.Pointer(pPager)).FpageSize - int64(200)) // Loop counter
for i > 0 {
- cksum = cksum + (U32(*(*U8)(unsafe.Pointer(aData + uintptr(i)))))
- i = i - (200)
+ cksum = cksum + U32(*(*U8)(unsafe.Pointer(aData + uintptr(i))))
+ i = i - 200
}
return cksum
}
@@ -32494,7 +33082,7 @@ func pager_cksum(tls *libc.TLS, pPager uintptr, aData uintptr) U32 { /* sqlite3.
// If this is a savepoint rollback, then memory may have to be dynamically
// allocated by this function. If this is the case and an allocation fails,
// SQLITE_NOMEM is returned.
-func pager_playback_one_page(tls *libc.TLS, pPager uintptr, pOffset uintptr, pDone uintptr, isMainJrnl int32, isSavepnt int32) int32 { /* sqlite3.c:54880:12: */
+func pager_playback_one_page(tls *libc.TLS, pPager uintptr, pOffset uintptr, pDone uintptr, isMainJrnl int32, isSavepnt int32) int32 { /* sqlite3.c:54895:12: */
bp := tls.Alloc(12)
defer tls.Free(12)
@@ -32534,42 +33122,42 @@ func pager_playback_one_page(tls *libc.TLS, pPager uintptr, pOffset uintptr, pDo
if rc != SQLITE_OK {
return rc
}
- rc = Xsqlite3OsRead(tls, jfd, aData, (*Pager)(unsafe.Pointer(pPager)).FpageSize, ((*(*I64)(unsafe.Pointer(pOffset))) + int64(4)))
+ rc = Xsqlite3OsRead(tls, jfd, aData, int32((*Pager)(unsafe.Pointer(pPager)).FpageSize), *(*I64)(unsafe.Pointer(pOffset))+int64(4))
if rc != SQLITE_OK {
return rc
}
- *(*I64)(unsafe.Pointer(pOffset)) += (I64(((*Pager)(unsafe.Pointer(pPager)).FpageSize + 4) + (isMainJrnl * 4)))
+ *(*I64)(unsafe.Pointer(pOffset)) += (*Pager)(unsafe.Pointer(pPager)).FpageSize + int64(4) + I64(isMainJrnl*4)
// Sanity checking on the page. This is more important that I originally
// thought. If a power failure occurs while the journal is being written,
// it could cause invalid data to be written into the journal. We need to
// detect this invalid data (with high probability) and ignore it.
- if (*(*Pgno)(unsafe.Pointer(bp /* pgno */)) == Pgno(0)) || (*(*Pgno)(unsafe.Pointer(bp /* pgno */)) == (Pgno((Xsqlite3PendingByte / ((*Pager)(unsafe.Pointer(pPager)).FpageSize)) + 1))) {
+ if *(*Pgno)(unsafe.Pointer(bp)) == Pgno(0) || *(*Pgno)(unsafe.Pointer(bp)) == Pgno(I64(Xsqlite3PendingByte)/(*Pager)(unsafe.Pointer(pPager)).FpageSize+int64(1)) {
return SQLITE_DONE
}
- if (*(*Pgno)(unsafe.Pointer(bp /* pgno */)) > (*Pager)(unsafe.Pointer(pPager)).FdbSize) || (Xsqlite3BitvecTest(tls, pDone, *(*Pgno)(unsafe.Pointer(bp /* pgno */))) != 0) {
+ if *(*Pgno)(unsafe.Pointer(bp)) > (*Pager)(unsafe.Pointer(pPager)).FdbSize || Xsqlite3BitvecTest(tls, pDone, *(*Pgno)(unsafe.Pointer(bp))) != 0 {
return SQLITE_OK
}
if isMainJrnl != 0 {
- rc = read32bits(tls, jfd, ((*(*I64)(unsafe.Pointer(pOffset))) - int64(4)), bp+4 /* &cksum */)
+ rc = read32bits(tls, jfd, *(*I64)(unsafe.Pointer(pOffset))-int64(4), bp+4 /* &cksum */)
if rc != 0 {
return rc
}
- if !(isSavepnt != 0) && (pager_cksum(tls, pPager, aData) != *(*U32)(unsafe.Pointer(bp + 4 /* cksum */))) {
+ if !(isSavepnt != 0) && pager_cksum(tls, pPager, aData) != *(*U32)(unsafe.Pointer(bp + 4)) {
return SQLITE_DONE
}
}
// If this page has already been played back before during the current
// rollback, then don't bother to play it back again.
- if (pDone != 0) && ((libc.AssignInt32(&rc, Xsqlite3BitvecSet(tls, pDone, *(*Pgno)(unsafe.Pointer(bp /* pgno */))))) != SQLITE_OK) {
+ if pDone != 0 && libc.AssignInt32(&rc, Xsqlite3BitvecSet(tls, pDone, *(*Pgno)(unsafe.Pointer(bp)))) != SQLITE_OK {
return rc
}
// When playing back page 1, restore the nReserve setting
- if (*(*Pgno)(unsafe.Pointer(bp /* pgno */)) == Pgno(1)) && (int32((*Pager)(unsafe.Pointer(pPager)).FnReserve) != int32(*(*U8)(unsafe.Pointer((aData) + 20)))) {
- (*Pager)(unsafe.Pointer(pPager)).FnReserve = I16(*(*U8)(unsafe.Pointer((aData) + 20)))
+ if *(*Pgno)(unsafe.Pointer(bp)) == Pgno(1) && int32((*Pager)(unsafe.Pointer(pPager)).FnReserve) != int32(*(*U8)(unsafe.Pointer(aData + 20))) {
+ (*Pager)(unsafe.Pointer(pPager)).FnReserve = I16(*(*U8)(unsafe.Pointer(aData + 20)))
}
// If the pager is in CACHEMOD state, then there must be a copy of this
@@ -32606,21 +33194,21 @@ func pager_playback_one_page(tls *libc.TLS, pPager uintptr, pOffset uintptr, pDo
// 2008-04-14: When attempting to vacuum a corrupt database file, it
// is possible to fail a statement on a database that does not yet exist.
// Do not attempt to write if database file has never been opened.
- if (*Pager)(unsafe.Pointer((pPager))).FpWal != uintptr(0) {
+ if (*Pager)(unsafe.Pointer(pPager)).FpWal != uintptr(0) {
*(*uintptr)(unsafe.Pointer(bp + 8 /* pPg */)) = uintptr(0)
} else {
*(*uintptr)(unsafe.Pointer(bp + 8 /* pPg */)) = Xsqlite3PagerLookup(tls, pPager, *(*Pgno)(unsafe.Pointer(bp /* pgno */)))
}
if isMainJrnl != 0 {
- isSynced = (libc.Bool32(((*Pager)(unsafe.Pointer(pPager)).FnoSync != 0) || (*(*I64)(unsafe.Pointer(pOffset)) <= (*Pager)(unsafe.Pointer(pPager)).FjournalHdr)))
+ isSynced = libc.Bool32((*Pager)(unsafe.Pointer(pPager)).FnoSync != 0 || *(*I64)(unsafe.Pointer(pOffset)) <= (*Pager)(unsafe.Pointer(pPager)).FjournalHdr)
} else {
- isSynced = (libc.Bool32((*(*uintptr)(unsafe.Pointer(bp + 8 /* pPg */)) == uintptr(0)) || (0 == (int32((*PgHdr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8 /* pPg */)))).Fflags) & PGHDR_NEED_SYNC))))
+ isSynced = libc.Bool32(*(*uintptr)(unsafe.Pointer(bp + 8)) == uintptr(0) || 0 == int32((*PgHdr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)))).Fflags)&PGHDR_NEED_SYNC)
}
- if (((*Sqlite3_file)(unsafe.Pointer(((*Pager)(unsafe.Pointer(pPager)).Ffd))).FpMethods != uintptr(0)) &&
- ((int32((*Pager)(unsafe.Pointer(pPager)).FeState) >= PAGER_WRITER_DBMOD) || (int32((*Pager)(unsafe.Pointer(pPager)).FeState) == PAGER_OPEN))) &&
- (isSynced != 0) {
- var ofst I64 = ((I64(*(*Pgno)(unsafe.Pointer(bp /* pgno */)) - Pgno(1))) * I64((*Pager)(unsafe.Pointer(pPager)).FpageSize))
+ if (*Sqlite3_file)(unsafe.Pointer((*Pager)(unsafe.Pointer(pPager)).Ffd)).FpMethods != uintptr(0) &&
+ (int32((*Pager)(unsafe.Pointer(pPager)).FeState) >= PAGER_WRITER_DBMOD || int32((*Pager)(unsafe.Pointer(pPager)).FeState) == PAGER_OPEN) &&
+ isSynced != 0 {
+ var ofst I64 = I64(*(*Pgno)(unsafe.Pointer(bp))-Pgno(1)) * (*Pager)(unsafe.Pointer(pPager)).FpageSize
// Write the data read from the journal back into the database file.
// This is usually safe even for an encrypted database - as the data
@@ -32628,15 +33216,15 @@ func pager_playback_one_page(tls *libc.TLS, pPager uintptr, pOffset uintptr, pDo
// is if the data was just read from an in-memory sub-journal. In that
// case it must be encrypted here before it is copied into the database
// file.
- rc = Xsqlite3OsWrite(tls, (*Pager)(unsafe.Pointer(pPager)).Ffd, aData, (*Pager)(unsafe.Pointer(pPager)).FpageSize, ofst)
+ rc = Xsqlite3OsWrite(tls, (*Pager)(unsafe.Pointer(pPager)).Ffd, aData, int32((*Pager)(unsafe.Pointer(pPager)).FpageSize), ofst)
- if *(*Pgno)(unsafe.Pointer(bp /* pgno */)) > (*Pager)(unsafe.Pointer(pPager)).FdbFileSize {
+ if *(*Pgno)(unsafe.Pointer(bp)) > (*Pager)(unsafe.Pointer(pPager)).FdbFileSize {
(*Pager)(unsafe.Pointer(pPager)).FdbFileSize = *(*Pgno)(unsafe.Pointer(bp /* pgno */))
}
if (*Pager)(unsafe.Pointer(pPager)).FpBackup != 0 {
Xsqlite3BackupUpdate(tls, (*Pager)(unsafe.Pointer(pPager)).FpBackup, *(*Pgno)(unsafe.Pointer(bp /* pgno */)), aData)
}
- } else if !(isMainJrnl != 0) && (*(*uintptr)(unsafe.Pointer(bp + 8 /* pPg */)) == uintptr(0)) {
+ } else if !(isMainJrnl != 0) && *(*uintptr)(unsafe.Pointer(bp + 8)) == uintptr(0) {
// If this is a rollback of a savepoint and data was not written to
// the database and the page is not in-memory, there is a potential
// problem. When the page is next fetched by the b-tree layer, it
@@ -32653,16 +33241,16 @@ func pager_playback_one_page(tls *libc.TLS, pPager uintptr, pOffset uintptr, pDo
// and if the pager requires a journal-sync, then mark the page as
// requiring a journal-sync before it is written.
- *(*U8)(unsafe.Pointer(pPager + 20 /* &.doNotSpill */)) |= U8((SPILLFLAG_ROLLBACK))
+ *(*U8)(unsafe.Pointer(pPager + 21)) |= U8(SPILLFLAG_ROLLBACK)
rc = Xsqlite3PagerGet(tls, pPager, *(*Pgno)(unsafe.Pointer(bp /* pgno */)), bp+8 /* &pPg */, 1)
- *(*U8)(unsafe.Pointer(pPager + 20 /* &.doNotSpill */)) &= libc.Uint8FromInt32((libc.CplInt32(SPILLFLAG_ROLLBACK)))
+ *(*U8)(unsafe.Pointer(pPager + 21)) &= libc.Uint8FromInt32(libc.CplInt32(SPILLFLAG_ROLLBACK))
if rc != SQLITE_OK {
return rc
}
Xsqlite3PcacheMakeDirty(tls, *(*uintptr)(unsafe.Pointer(bp + 8 /* pPg */)))
}
- if *(*uintptr)(unsafe.Pointer(bp + 8 /* pPg */)) != 0 {
+ if *(*uintptr)(unsafe.Pointer(bp + 8)) != 0 {
// No page should ever be explicitly rolled back that is in use, except
// for page 1 which is held in use in order to keep the lock on the
// database active. However such a page may be rolled back as a result
@@ -32679,8 +33267,8 @@ func pager_playback_one_page(tls *libc.TLS, pPager uintptr, pOffset uintptr, pDo
// If this was page 1, then restore the value of Pager.dbFileVers.
// Do this before any decoding.
- if *(*Pgno)(unsafe.Pointer(bp /* pgno */)) == Pgno(1) {
- libc.Xmemcpy(tls, (pPager + 104 /* &.dbFileVers */), ((pData) + 24), uint32(unsafe.Sizeof([16]uint8{})))
+ if *(*Pgno)(unsafe.Pointer(bp)) == Pgno(1) {
+ libc.Xmemcpy(tls, pPager+112, pData+24, uint32(unsafe.Sizeof([16]uint8{})))
}
Xsqlite3PcacheRelease(tls, *(*uintptr)(unsafe.Pointer(bp + 8 /* pPg */)))
}
@@ -32728,7 +33316,7 @@ func pager_playback_one_page(tls *libc.TLS, pPager uintptr, pOffset uintptr, pDo
// the entire contents of the super-journal file. This could be
// a couple of kilobytes or so - potentially larger than the page
// size.
-func pager_delsuper(tls *libc.TLS, pPager uintptr, zSuper uintptr) int32 { /* sqlite3.c:55127:12: */
+func pager_delsuper(tls *libc.TLS, pPager uintptr, zSuper uintptr) int32 { /* sqlite3.c:55142:12: */
bp := tls.Alloc(12)
defer tls.Free(12)
@@ -32759,17 +33347,17 @@ func pager_delsuper(tls *libc.TLS, pPager uintptr, zSuper uintptr) int32 { /* sq
// Allocate space for both the pJournal and pSuper file descriptors.
// If successful, open the super-journal file for reading.
- pSuper = Xsqlite3MallocZero(tls, (uint64((*Sqlite3_vfs)(unsafe.Pointer(pVfs)).FszOsFile * 2)))
- if !(!(pSuper != 0)) {
+ pSuper = Xsqlite3MallocZero(tls, uint64((*Sqlite3_vfs)(unsafe.Pointer(pVfs)).FszOsFile*2))
+ if !!(pSuper != 0) {
goto __1
}
rc = SQLITE_NOMEM
pJournal = uintptr(0)
goto __2
__1:
- flags = (SQLITE_OPEN_READONLY | SQLITE_OPEN_SUPER_JOURNAL)
+ flags = SQLITE_OPEN_READONLY | SQLITE_OPEN_SUPER_JOURNAL
rc = Xsqlite3OsOpen(tls, pVfs, zSuper, pSuper, flags, uintptr(0))
- pJournal = ((pSuper) + uintptr((*Sqlite3_vfs)(unsafe.Pointer(pVfs)).FszOsFile))
+ pJournal = pSuper + uintptr((*Sqlite3_vfs)(unsafe.Pointer(pVfs)).FszOsFile)
__2:
;
if !(rc != SQLITE_OK) {
@@ -32790,9 +33378,9 @@ __3:
goto delsuper_out
__4:
;
- nSuperPtr = ((*Sqlite3_vfs)(unsafe.Pointer(pVfs)).FmxPathname + 1)
- zFree = Xsqlite3Malloc(tls, (uint64(((int64(4) + *(*I64)(unsafe.Pointer(bp /* nSuperJournal */))) + I64(nSuperPtr)) + int64(2))))
- if !(!(zFree != 0)) {
+ nSuperPtr = (*Sqlite3_vfs)(unsafe.Pointer(pVfs)).FmxPathname + 1
+ zFree = Xsqlite3Malloc(tls, uint64(int64(4)+*(*I64)(unsafe.Pointer(bp))+I64(nSuperPtr)+int64(2)))
+ if !!(zFree != 0) {
goto __5
}
rc = SQLITE_NOMEM
@@ -32800,8 +33388,8 @@ __4:
__5:
;
*(*uint8)(unsafe.Pointer(zFree)) = libc.AssignPtrUint8(zFree+1, libc.AssignPtrUint8(zFree+2, libc.AssignPtrUint8(zFree+3, uint8(0))))
- zSuperJournal = (zFree + 4)
- zSuperPtr = (zSuperJournal + uintptr((*(*I64)(unsafe.Pointer(bp /* nSuperJournal */)) + int64(2))))
+ zSuperJournal = zFree + 4
+ zSuperPtr = zSuperJournal + uintptr(*(*I64)(unsafe.Pointer(bp))+int64(2))
rc = Xsqlite3OsRead(tls, pSuper, zSuperJournal, int32(*(*I64)(unsafe.Pointer(bp /* nSuperJournal */))), int64(0))
if !(rc != SQLITE_OK) {
goto __6
@@ -32810,11 +33398,11 @@ __5:
__6:
;
*(*uint8)(unsafe.Pointer(zSuperJournal + uintptr(*(*I64)(unsafe.Pointer(bp /* nSuperJournal */))))) = uint8(0)
- *(*uint8)(unsafe.Pointer(zSuperJournal + uintptr((*(*I64)(unsafe.Pointer(bp /* nSuperJournal */)) + int64(1))))) = uint8(0)
+ *(*uint8)(unsafe.Pointer(zSuperJournal + uintptr(*(*I64)(unsafe.Pointer(bp))+int64(1)))) = uint8(0)
zJournal = zSuperJournal
__7:
- if !((I64((int32(zJournal) - int32(zSuperJournal)) / 1)) < *(*I64)(unsafe.Pointer(bp /* nSuperJournal */))) {
+ if !(I64((int32(zJournal)-int32(zSuperJournal))/1) < *(*I64)(unsafe.Pointer(bp))) {
goto __8
}
rc = Xsqlite3OsAccess(tls, pVfs, zJournal, SQLITE_ACCESS_EXISTS, bp+8 /* &exists */)
@@ -32824,10 +33412,10 @@ __7:
goto delsuper_out
__9:
;
- if !(*(*int32)(unsafe.Pointer(bp + 8 /* exists */)) != 0) {
+ if !(*(*int32)(unsafe.Pointer(bp + 8)) != 0) {
goto __10
}
- flags1 = (SQLITE_OPEN_READONLY | SQLITE_OPEN_SUPER_JOURNAL)
+ flags1 = SQLITE_OPEN_READONLY | SQLITE_OPEN_SUPER_JOURNAL
rc = Xsqlite3OsOpen(tls, pVfs, zJournal, pJournal, flags1, uintptr(0))
if !(rc != SQLITE_OK) {
goto __11
@@ -32845,7 +33433,7 @@ __11:
__12:
;
- c = (libc.Bool32((int32(*(*uint8)(unsafe.Pointer(zSuperPtr))) != 0) && (libc.Xstrcmp(tls, zSuperPtr, zSuper) == 0)))
+ c = libc.Bool32(int32(*(*uint8)(unsafe.Pointer(zSuperPtr))) != 0 && libc.Xstrcmp(tls, zSuperPtr, zSuper) == 0)
if !(c != 0) {
goto __13
}
@@ -32855,7 +33443,7 @@ __13:
;
__10:
;
- zJournal += (uintptr(Xsqlite3Strlen30(tls, zJournal) + 1))
+ zJournal += uintptr(Xsqlite3Strlen30(tls, zJournal) + 1)
goto __7
__8:
;
@@ -32894,30 +33482,30 @@ __14:
//
// If successful, return SQLITE_OK. If an IO error occurs while modifying
// the database file, return the error code to the caller.
-func pager_truncate(tls *libc.TLS, pPager uintptr, nPage Pgno) int32 { /* sqlite3.c:55245:12: */
+func pager_truncate(tls *libc.TLS, pPager uintptr, nPage Pgno) int32 { /* sqlite3.c:55260:12: */
bp := tls.Alloc(8)
defer tls.Free(8)
var rc int32 = SQLITE_OK
- if ((*Sqlite3_file)(unsafe.Pointer(((*Pager)(unsafe.Pointer(pPager)).Ffd))).FpMethods != uintptr(0)) &&
- ((int32((*Pager)(unsafe.Pointer(pPager)).FeState) >= PAGER_WRITER_DBMOD) || (int32((*Pager)(unsafe.Pointer(pPager)).FeState) == PAGER_OPEN)) {
+ if (*Sqlite3_file)(unsafe.Pointer((*Pager)(unsafe.Pointer(pPager)).Ffd)).FpMethods != uintptr(0) &&
+ (int32((*Pager)(unsafe.Pointer(pPager)).FeState) >= PAGER_WRITER_DBMOD || int32((*Pager)(unsafe.Pointer(pPager)).FeState) == PAGER_OPEN) {
// var currentSize I64 at bp, 8
var newSize I64
- var szPage int32 = (*Pager)(unsafe.Pointer(pPager)).FpageSize
+ var szPage int32 = int32((*Pager)(unsafe.Pointer(pPager)).FpageSize)
// TODO: Is it safe to use Pager.dbFileSize here?
rc = Xsqlite3OsFileSize(tls, (*Pager)(unsafe.Pointer(pPager)).Ffd, bp /* &currentSize */)
- newSize = (I64(szPage) * I64(nPage))
- if (rc == SQLITE_OK) && (*(*I64)(unsafe.Pointer(bp /* currentSize */)) != newSize) {
- if *(*I64)(unsafe.Pointer(bp /* currentSize */)) > newSize {
+ newSize = I64(szPage) * I64(nPage)
+ if rc == SQLITE_OK && *(*I64)(unsafe.Pointer(bp)) != newSize {
+ if *(*I64)(unsafe.Pointer(bp)) > newSize {
rc = Xsqlite3OsTruncate(tls, (*Pager)(unsafe.Pointer(pPager)).Ffd, newSize)
- } else if (*(*I64)(unsafe.Pointer(bp /* currentSize */)) + I64(szPage)) <= newSize {
+ } else if *(*I64)(unsafe.Pointer(bp))+I64(szPage) <= newSize {
var pTmp uintptr = (*Pager)(unsafe.Pointer(pPager)).FpTmpSpace
libc.Xmemset(tls, pTmp, 0, uint32(szPage))
- rc = Xsqlite3OsWrite(tls, (*Pager)(unsafe.Pointer(pPager)).Ffd, pTmp, szPage, (newSize - I64(szPage)))
+ rc = Xsqlite3OsWrite(tls, (*Pager)(unsafe.Pointer(pPager)).Ffd, pTmp, szPage, newSize-I64(szPage))
}
if rc == SQLITE_OK {
(*Pager)(unsafe.Pointer(pPager)).FdbFileSize = nPage
@@ -32929,7 +33517,7 @@ func pager_truncate(tls *libc.TLS, pPager uintptr, nPage Pgno) int32 { /* sqlite
// Return a sanitized version of the sector-size of OS file pFile. The
// return value is guaranteed to lie between 32 and MAX_SECTOR_SIZE.
-func Xsqlite3SectorSize(tls *libc.TLS, pFile uintptr) int32 { /* sqlite3.c:55281:20: */
+func Xsqlite3SectorSize(tls *libc.TLS, pFile uintptr) int32 { /* sqlite3.c:55296:20: */
var iRet int32 = Xsqlite3OsSectorSize(tls, pFile)
if iRet < 32 {
iRet = 512
@@ -32961,10 +33549,10 @@ func Xsqlite3SectorSize(tls *libc.TLS, pFile uintptr) int32 { /* sqlite3.c:55281
// (that is what POWERSAFE_OVERWRITE means), so we minimize the sector
// size. For backwards compatibility of the rollback journal file format,
// we cannot reduce the effective sector size below 512.
-func setSectorSize(tls *libc.TLS, pPager uintptr) { /* sqlite3.c:55315:13: */
+func setSectorSize(tls *libc.TLS, pPager uintptr) { /* sqlite3.c:55330:13: */
- if ((*Pager)(unsafe.Pointer(pPager)).FtempFile != 0) ||
- ((Xsqlite3OsDeviceCharacteristics(tls, (*Pager)(unsafe.Pointer(pPager)).Ffd) & SQLITE_IOCAP_POWERSAFE_OVERWRITE) != 0) {
+ if (*Pager)(unsafe.Pointer(pPager)).FtempFile != 0 ||
+ Xsqlite3OsDeviceCharacteristics(tls, (*Pager)(unsafe.Pointer(pPager)).Ffd)&SQLITE_IOCAP_POWERSAFE_OVERWRITE != 0 {
// Sector size doesn't matter for temporary files. Also, the file
// may not have been opened yet, in which case the OsSectorSize()
// call will segfault.
@@ -33029,7 +33617,7 @@ func setSectorSize(tls *libc.TLS, pPager uintptr) { /* sqlite3.c:55315:13: */
// If the journal really is hot, reset the pager cache prior rolling
// back any content. If the journal is merely persistent, no reset is
// needed.
-func pager_playback(tls *libc.TLS, pPager uintptr, isHot int32) int32 { /* sqlite3.c:55388:12: */
+func pager_playback(tls *libc.TLS, pPager uintptr, isHot int32) int32 { /* sqlite3.c:55403:12: */
bp := tls.Alloc(40)
defer tls.Free(40)
@@ -33077,15 +33665,15 @@ __1:
// mxPathname is 512, which is the same as the minimum allowable value
// for pageSize.
zSuper = (*Pager)(unsafe.Pointer(pPager)).FpTmpSpace
- rc = readSuperJournal(tls, (*Pager)(unsafe.Pointer(pPager)).Fjfd, zSuper, (uint32((*Sqlite3_vfs)(unsafe.Pointer((*Pager)(unsafe.Pointer(pPager)).FpVfs)).FmxPathname + 1)))
- if !((rc == SQLITE_OK) && (*(*uint8)(unsafe.Pointer(zSuper)) != 0)) {
+ rc = readSuperJournal(tls, (*Pager)(unsafe.Pointer(pPager)).Fjfd, zSuper, uint32((*Sqlite3_vfs)(unsafe.Pointer((*Pager)(unsafe.Pointer(pPager)).FpVfs)).FmxPathname+1))
+ if !(rc == SQLITE_OK && *(*uint8)(unsafe.Pointer(zSuper)) != 0) {
goto __2
}
rc = Xsqlite3OsAccess(tls, pVfs, zSuper, SQLITE_ACCESS_EXISTS, bp+24 /* &res */)
__2:
;
zSuper = uintptr(0)
- if !((rc != SQLITE_OK) || !(*(*int32)(unsafe.Pointer(bp + 24 /* res */)) != 0)) {
+ if !(rc != SQLITE_OK || !(*(*int32)(unsafe.Pointer(bp + 24)) != 0)) {
goto __3
}
goto end_playback
@@ -33123,11 +33711,11 @@ __6:
// working in no-sync mode. This means that the rest of the journal
// file consists of pages, there are no more journal headers. Compute
// the value of nRec based on this assumption.
- if !(*(*U32)(unsafe.Pointer(bp + 28 /* nRec */)) == 0xffffffff) {
+ if !(*(*U32)(unsafe.Pointer(bp + 28)) == 0xffffffff) {
goto __8
}
- *(*U32)(unsafe.Pointer(bp + 28 /* nRec */)) = U32((int32((*(*I64)(unsafe.Pointer(bp + 16 /* szJ */)) - (I64((*Pager)(unsafe.Pointer(pPager)).FsectorSize))) / (I64(((*Pager)(unsafe.Pointer(pPager)).FpageSize) + 8)))))
+ *(*U32)(unsafe.Pointer(bp + 28 /* nRec */)) = U32(int32((*(*I64)(unsafe.Pointer(bp + 16)) - I64((*Pager)(unsafe.Pointer(pPager)).FsectorSize)) / ((*Pager)(unsafe.Pointer(pPager)).FpageSize + int64(8))))
__8:
;
@@ -33144,16 +33732,16 @@ __8:
// the journal, it means that the journal might contain additional
// pages that need to be rolled back and that the number of pages
// should be computed based on the journal file size.
- if !(((*(*U32)(unsafe.Pointer(bp + 28 /* nRec */)) == U32(0)) && !(isHot != 0)) && (((*Pager)(unsafe.Pointer(pPager)).FjournalHdr + (I64((*Pager)(unsafe.Pointer(pPager)).FsectorSize))) == (*Pager)(unsafe.Pointer(pPager)).FjournalOff)) {
+ if !(*(*U32)(unsafe.Pointer(bp + 28)) == U32(0) && !(isHot != 0) && (*Pager)(unsafe.Pointer(pPager)).FjournalHdr+I64((*Pager)(unsafe.Pointer(pPager)).FsectorSize) == (*Pager)(unsafe.Pointer(pPager)).FjournalOff) {
goto __9
}
- *(*U32)(unsafe.Pointer(bp + 28 /* nRec */)) = U32((int32((*(*I64)(unsafe.Pointer(bp + 16 /* szJ */)) - (*Pager)(unsafe.Pointer(pPager)).FjournalOff) / (I64(((*Pager)(unsafe.Pointer(pPager)).FpageSize) + 8)))))
+ *(*U32)(unsafe.Pointer(bp + 28 /* nRec */)) = U32(int32((*(*I64)(unsafe.Pointer(bp + 16)) - (*Pager)(unsafe.Pointer(pPager)).FjournalOff) / ((*Pager)(unsafe.Pointer(pPager)).FpageSize + int64(8))))
__9:
;
// If this is the first header read from the journal, truncate the
// database file back to its original size.
- if !((*Pager)(unsafe.Pointer(pPager)).FjournalOff == (I64((*Pager)(unsafe.Pointer(pPager)).FsectorSize))) {
+ if !((*Pager)(unsafe.Pointer(pPager)).FjournalOff == I64((*Pager)(unsafe.Pointer(pPager)).FsectorSize)) {
goto __10
}
rc = pager_truncate(tls, pPager, *(*Pgno)(unsafe.Pointer(bp + 32 /* mxPg */)))
@@ -33171,7 +33759,7 @@ __10:
// database file and/or page cache.
u = U32(0)
__12:
- if !(u < *(*U32)(unsafe.Pointer(bp + 28 /* nRec */))) {
+ if !(u < *(*U32)(unsafe.Pointer(bp + 28))) {
goto __14
}
if !(needPagerReset != 0) {
@@ -33181,7 +33769,7 @@ __12:
needPagerReset = 0
__15:
;
- rc = pager_playback_one_page(tls, pPager, (pPager + 72 /* &.journalOff */), uintptr(0), 1, 0)
+ rc = pager_playback_one_page(tls, pPager, pPager+80, uintptr(0), 1, 0)
if !(rc == SQLITE_OK) {
goto __16
}
@@ -33195,7 +33783,7 @@ __16:
goto __14
goto __19
__18:
- if !(rc == (SQLITE_IOERR | (int32(2) << 8))) {
+ if !(rc == SQLITE_IOERR|int32(2)<<8) {
goto __20
}
// If the journal has been truncated, simply stop reading and
@@ -33259,13 +33847,13 @@ __22:
// This is because it may end up being passed to sqlite3OsOpen(), in
// which case it requires 4 0x00 bytes in memory immediately before
// the filename.
- zSuper = ((*Pager)(unsafe.Pointer(pPager)).FpTmpSpace + 4)
- rc = readSuperJournal(tls, (*Pager)(unsafe.Pointer(pPager)).Fjfd, zSuper, (uint32((*Sqlite3_vfs)(unsafe.Pointer((*Pager)(unsafe.Pointer(pPager)).FpVfs)).FmxPathname + 1)))
+ zSuper = (*Pager)(unsafe.Pointer(pPager)).FpTmpSpace + 4
+ rc = readSuperJournal(tls, (*Pager)(unsafe.Pointer(pPager)).Fjfd, zSuper, uint32((*Sqlite3_vfs)(unsafe.Pointer((*Pager)(unsafe.Pointer(pPager)).FpVfs)).FmxPathname+1))
__23:
;
- if !((rc == SQLITE_OK) &&
- ((int32((*Pager)(unsafe.Pointer(pPager)).FeState) >= PAGER_WRITER_DBMOD) || (int32((*Pager)(unsafe.Pointer(pPager)).FeState) == PAGER_OPEN))) {
+ if !(rc == SQLITE_OK &&
+ (int32((*Pager)(unsafe.Pointer(pPager)).FeState) >= PAGER_WRITER_DBMOD || int32((*Pager)(unsafe.Pointer(pPager)).FeState) == PAGER_OPEN)) {
goto __24
}
rc = Xsqlite3PagerSync(tls, pPager, uintptr(0))
@@ -33274,25 +33862,25 @@ __24:
if !(rc == SQLITE_OK) {
goto __25
}
- rc = pager_end_transaction(tls, pPager, (libc.Bool32(int32(*(*uint8)(unsafe.Pointer(zSuper))) != 0)), 0)
+ rc = pager_end_transaction(tls, pPager, libc.Bool32(int32(*(*uint8)(unsafe.Pointer(zSuper))) != 0), 0)
__25:
;
- if !(((rc == SQLITE_OK) && (*(*uint8)(unsafe.Pointer(zSuper)) != 0)) && (*(*int32)(unsafe.Pointer(bp + 24 /* res */)) != 0)) {
+ if !(rc == SQLITE_OK && *(*uint8)(unsafe.Pointer(zSuper)) != 0 && *(*int32)(unsafe.Pointer(bp + 24)) != 0) {
goto __26
}
// If there was a super-journal and this routine will return success,
// see if it is possible to delete the super-journal.
- libc.Xmemset(tls, (zSuper + libc.UintptrFromInt32(-4)), 0, uint32(4))
+ libc.Xmemset(tls, zSuper+libc.UintptrFromInt32(-4), 0, uint32(4))
rc = pager_delsuper(tls, pPager, zSuper)
__26:
;
- if !((isHot != 0) && (nPlayback != 0)) {
+ if !(isHot != 0 && nPlayback != 0) {
goto __27
}
- Xsqlite3_log(tls, (SQLITE_NOTICE | (int32(2) << 8)), ts+3021, /* "recovered %d pag..." */
+ Xsqlite3_log(tls, SQLITE_NOTICE|int32(2)<<8, ts+3832, /* "recovered %d pag..." */
libc.VaList(bp, nPlayback, (*Pager)(unsafe.Pointer(pPager)).FzJournal))
__27:
;
@@ -33314,7 +33902,7 @@ __27:
//
// If an IO error occurs, then the IO error is returned to the caller.
// Otherwise, SQLITE_OK is returned.
-func readDbPage(tls *libc.TLS, pPg uintptr) int32 { /* sqlite3.c:55605:12: */
+func readDbPage(tls *libc.TLS, pPg uintptr) int32 { /* sqlite3.c:55620:12: */
bp := tls.Alloc(4)
defer tls.Free(4)
@@ -33323,18 +33911,18 @@ func readDbPage(tls *libc.TLS, pPg uintptr) int32 { /* sqlite3.c:55605:12: */
*(*U32)(unsafe.Pointer(bp /* iFrame */)) = U32(0) // Frame of WAL containing pgno
- if (*Pager)(unsafe.Pointer((pPager))).FpWal != uintptr(0) {
+ if (*Pager)(unsafe.Pointer(pPager)).FpWal != uintptr(0) {
rc = Xsqlite3WalFindFrame(tls, (*Pager)(unsafe.Pointer(pPager)).FpWal, (*PgHdr)(unsafe.Pointer(pPg)).Fpgno, bp /* &iFrame */)
if rc != 0 {
return rc
}
}
- if *(*U32)(unsafe.Pointer(bp /* iFrame */)) != 0 {
- rc = Xsqlite3WalReadFrame(tls, (*Pager)(unsafe.Pointer(pPager)).FpWal, *(*U32)(unsafe.Pointer(bp /* iFrame */)), (*Pager)(unsafe.Pointer(pPager)).FpageSize, (*PgHdr)(unsafe.Pointer(pPg)).FpData)
+ if *(*U32)(unsafe.Pointer(bp)) != 0 {
+ rc = Xsqlite3WalReadFrame(tls, (*Pager)(unsafe.Pointer(pPager)).FpWal, *(*U32)(unsafe.Pointer(bp /* iFrame */)), int32((*Pager)(unsafe.Pointer(pPager)).FpageSize), (*PgHdr)(unsafe.Pointer(pPg)).FpData)
} else {
- var iOffset I64 = ((I64((*PgHdr)(unsafe.Pointer(pPg)).Fpgno - Pgno(1))) * I64((*Pager)(unsafe.Pointer(pPager)).FpageSize))
- rc = Xsqlite3OsRead(tls, (*Pager)(unsafe.Pointer(pPager)).Ffd, (*PgHdr)(unsafe.Pointer(pPg)).FpData, (*Pager)(unsafe.Pointer(pPager)).FpageSize, iOffset)
- if rc == (SQLITE_IOERR | (int32(2) << 8)) {
+ var iOffset I64 = I64((*PgHdr)(unsafe.Pointer(pPg)).Fpgno-Pgno(1)) * (*Pager)(unsafe.Pointer(pPager)).FpageSize
+ rc = Xsqlite3OsRead(tls, (*Pager)(unsafe.Pointer(pPager)).Ffd, (*PgHdr)(unsafe.Pointer(pPg)).FpData, int32((*Pager)(unsafe.Pointer(pPager)).FpageSize), iOffset)
+ if rc == SQLITE_IOERR|int32(2)<<8 {
rc = SQLITE_OK
}
}
@@ -33352,10 +33940,10 @@ func readDbPage(tls *libc.TLS, pPg uintptr) int32 { /* sqlite3.c:55605:12: */
// 24..39 of the database are white noise. But the probability of
// white noise equaling 16 bytes of 0xff is vanishingly small so
// we should still be ok.
- libc.Xmemset(tls, pPager+104 /* &.dbFileVers */, 0xff, uint32(unsafe.Sizeof([16]uint8{})))
+ libc.Xmemset(tls, pPager+112, 0xff, uint32(unsafe.Sizeof([16]uint8{})))
} else {
- var dbFileVers uintptr = (((*PgHdr)(unsafe.Pointer(pPg)).FpData) + 24)
- libc.Xmemcpy(tls, (pPager + 104 /* &.dbFileVers */), dbFileVers, uint32(unsafe.Sizeof([16]uint8{})))
+ var dbFileVers uintptr = (*PgHdr)(unsafe.Pointer(pPg)).FpData + 24
+ libc.Xmemcpy(tls, pPager+112, dbFileVers, uint32(unsafe.Sizeof([16]uint8{})))
}
}
@@ -33368,18 +33956,21 @@ func readDbPage(tls *libc.TLS, pPg uintptr) int32 { /* sqlite3.c:55605:12: */
// This is an unconditional update. See also the pager_incr_changecounter()
// routine which only updates the change-counter if the update is actually
// needed, as determined by the pPager->changeCountDone state variable.
-func pager_write_changecounter(tls *libc.TLS, pPg uintptr) { /* sqlite3.c:55668:13: */
+func pager_write_changecounter(tls *libc.TLS, pPg uintptr) { /* sqlite3.c:55683:13: */
var change_counter U32
+ if pPg == uintptr(0) {
+ return
+ }
// Increment the value just read and write it back to byte 24.
- change_counter = (Xsqlite3Get4byte(tls, (*PgHdr)(unsafe.Pointer(pPg)).FpPager+104 /* &.dbFileVers */) + U32(1))
- Xsqlite3Put4byte(tls, (((*PgHdr)(unsafe.Pointer(pPg)).FpData) + uintptr(24)), change_counter)
+ change_counter = Xsqlite3Get4byte(tls, (*PgHdr)(unsafe.Pointer(pPg)).FpPager+112) + U32(1)
+ Xsqlite3Put4byte(tls, (*PgHdr)(unsafe.Pointer(pPg)).FpData+uintptr(24), change_counter)
// Also store the SQLite version number in bytes 96..99 and in
// bytes 92..95 store the change counter for which the version number
// is valid.
- Xsqlite3Put4byte(tls, (((*PgHdr)(unsafe.Pointer(pPg)).FpData) + uintptr(92)), change_counter)
- Xsqlite3Put4byte(tls, (((*PgHdr)(unsafe.Pointer(pPg)).FpData) + uintptr(96)), uint32(SQLITE_VERSION_NUMBER))
+ Xsqlite3Put4byte(tls, (*PgHdr)(unsafe.Pointer(pPg)).FpData+uintptr(92), change_counter)
+ Xsqlite3Put4byte(tls, (*PgHdr)(unsafe.Pointer(pPg)).FpData+uintptr(96), uint32(SQLITE_VERSION_NUMBER))
}
// This function is invoked once for each page that has already been
@@ -33392,7 +33983,7 @@ func pager_write_changecounter(tls *libc.TLS, pPg uintptr) { /* sqlite3.c:55668:
// references, the page content is reloaded from the database. If the
// attempt to reload content from the database is required and fails,
// return an SQLite error code. Otherwise, SQLITE_OK.
-func pagerUndoCallback(tls *libc.TLS, pCtx uintptr, iPg Pgno) int32 { /* sqlite3.c:55695:12: */
+func pagerUndoCallback(tls *libc.TLS, pCtx uintptr, iPg Pgno) int32 { /* sqlite3.c:55711:12: */
var rc int32 = SQLITE_OK
var pPager uintptr = pCtx
var pPg uintptr
@@ -33423,7 +34014,7 @@ func pagerUndoCallback(tls *libc.TLS, pCtx uintptr, iPg Pgno) int32 { /* sqlite3
}
// This function is called to rollback a transaction on a WAL database.
-func pagerRollbackWal(tls *libc.TLS, pPager uintptr) int32 { /* sqlite3.c:55730:12: */
+func pagerRollbackWal(tls *libc.TLS, pPager uintptr) int32 { /* sqlite3.c:55746:12: */
var rc int32 // Return Code
var pList uintptr // List of dirty pages to revert
@@ -33438,7 +34029,7 @@ func pagerRollbackWal(tls *libc.TLS, pPager uintptr) int32 { /* sqlite3.c:55730:
f func(*libc.TLS, uintptr, Pgno) int32
}{pagerUndoCallback})), pPager)
pList = Xsqlite3PcacheDirtyList(tls, (*Pager)(unsafe.Pointer(pPager)).FpPCache)
- for (pList != 0) && (rc == SQLITE_OK) {
+ for pList != 0 && rc == SQLITE_OK {
var pNext uintptr = (*PgHdr)(unsafe.Pointer(pList)).FpDirty
rc = pagerUndoCallback(tls, pPager, (*PgHdr)(unsafe.Pointer(pList)).Fpgno)
pList = pNext
@@ -33454,7 +34045,7 @@ func pagerRollbackWal(tls *libc.TLS, pPager uintptr) int32 { /* sqlite3.c:55730:
//
// The list of pages passed into this routine is always sorted by page number.
// Hence, if page 1 appears anywhere on the list, it will be the first page.
-func pagerWalFrames(tls *libc.TLS, pPager uintptr, pList uintptr, nTruncate Pgno, isCommit int32) int32 { /* sqlite3.c:55762:12: */
+func pagerWalFrames(tls *libc.TLS, pPager uintptr, pList uintptr, nTruncate Pgno, isCommit int32) int32 { /* sqlite3.c:55778:12: */
bp := tls.Alloc(4)
defer tls.Free(4)
*(*uintptr)(unsafe.Pointer(bp)) = pList
@@ -33470,9 +34061,9 @@ func pagerWalFrames(tls *libc.TLS, pPager uintptr, pList uintptr, nTruncate Pgno
// list here.
var ppNext uintptr = bp /* &pList */
nList = 0
- for p = *(*uintptr)(unsafe.Pointer(bp /* pList */)); (libc.AssignPtrUintptr(ppNext, p)) != uintptr(0); p = (*PgHdr)(unsafe.Pointer(p)).FpDirty {
+ for p = *(*uintptr)(unsafe.Pointer(bp /* pList */)); libc.AssignPtrUintptr(ppNext, p) != uintptr(0); p = (*PgHdr)(unsafe.Pointer(p)).FpDirty {
if (*PgHdr)(unsafe.Pointer(p)).Fpgno <= nTruncate {
- ppNext = (p + 16 /* &.pDirty */)
+ ppNext = p + 16
nList++
}
}
@@ -33480,14 +34071,14 @@ func pagerWalFrames(tls *libc.TLS, pPager uintptr, pList uintptr, nTruncate Pgno
} else {
nList = 1
}
- *(*int32)(unsafe.Pointer((pPager + 184 /* &.aStat */) + 2*4)) += (nList)
+ *(*int32)(unsafe.Pointer(pPager + 200 + 2*4)) += nList
- if (*PgHdr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* pList */)))).Fpgno == Pgno(1) {
+ if (*PgHdr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).Fpgno == Pgno(1) {
pager_write_changecounter(tls, *(*uintptr)(unsafe.Pointer(bp /* pList */)))
}
rc = Xsqlite3WalFrames(tls, (*Pager)(unsafe.Pointer(pPager)).FpWal,
- (*Pager)(unsafe.Pointer(pPager)).FpageSize, *(*uintptr)(unsafe.Pointer(bp /* pList */)), nTruncate, isCommit, int32((*Pager)(unsafe.Pointer(pPager)).FwalSyncFlags))
- if (rc == SQLITE_OK) && ((*Pager)(unsafe.Pointer(pPager)).FpBackup != 0) {
+ int32((*Pager)(unsafe.Pointer(pPager)).FpageSize), *(*uintptr)(unsafe.Pointer(bp /* pList */)), nTruncate, isCommit, int32((*Pager)(unsafe.Pointer(pPager)).FwalSyncFlags))
+ if rc == SQLITE_OK && (*Pager)(unsafe.Pointer(pPager)).FpBackup != 0 {
for p = *(*uintptr)(unsafe.Pointer(bp /* pList */)); p != 0; p = (*PgHdr)(unsafe.Pointer(p)).FpDirty {
Xsqlite3BackupUpdate(tls, (*Pager)(unsafe.Pointer(pPager)).FpBackup, (*PgHdr)(unsafe.Pointer(p)).Fpgno, (*PgHdr)(unsafe.Pointer(p)).FpData)
}
@@ -33502,7 +34093,7 @@ func pagerWalFrames(tls *libc.TLS, pPager uintptr, pList uintptr, nTruncate Pgno
// makes a snapshot of the database at the current point in time and preserves
// that snapshot for use by the reader in spite of concurrently changes by
// other writers or checkpointers.
-func pagerBeginReadTransaction(tls *libc.TLS, pPager uintptr) int32 { /* sqlite3.c:55829:12: */
+func pagerBeginReadTransaction(tls *libc.TLS, pPager uintptr) int32 { /* sqlite3.c:55845:12: */
bp := tls.Alloc(4)
defer tls.Free(4)
@@ -33516,7 +34107,7 @@ func pagerBeginReadTransaction(tls *libc.TLS, pPager uintptr) int32 { /* sqlite3
Xsqlite3WalEndReadTransaction(tls, (*Pager)(unsafe.Pointer(pPager)).FpWal)
rc = Xsqlite3WalBeginReadTransaction(tls, (*Pager)(unsafe.Pointer(pPager)).FpWal, bp /* &changed */)
- if (rc != SQLITE_OK) || (*(*int32)(unsafe.Pointer(bp /* changed */)) != 0) {
+ if rc != SQLITE_OK || *(*int32)(unsafe.Pointer(bp)) != 0 {
pager_reset(tls, pPager)
if (*Pager)(unsafe.Pointer(pPager)).FbUseFetch != 0 {
Xsqlite3OsUnfetch(tls, (*Pager)(unsafe.Pointer(pPager)).Ffd, int64(0), uintptr(0))
@@ -33533,7 +34124,7 @@ func pagerBeginReadTransaction(tls *libc.TLS, pPager uintptr) int32 { /* sqlite3
// If no error occurs, SQLITE_OK is returned and the size of the database
// in pages is stored in *pnPage. Otherwise, an error code (perhaps
// SQLITE_IOERR_FSTAT) is returned and *pnPage is left unmodified.
-func pagerPagecount(tls *libc.TLS, pPager uintptr, pnPage uintptr) int32 { /* sqlite3.c:55862:12: */
+func pagerPagecount(tls *libc.TLS, pPager uintptr, pnPage uintptr) int32 { /* sqlite3.c:55878:12: */
bp := tls.Alloc(8)
defer tls.Free(8)
@@ -33551,13 +34142,13 @@ func pagerPagecount(tls *libc.TLS, pPager uintptr, pnPage uintptr) int32 { /* sq
// WAL sub-system, determine the page count based on the size of
// the database file. If the size of the database file is not an
// integer multiple of the page-size, round up the result.
- if (nPage == Pgno(0)) && ((*Sqlite3_file)(unsafe.Pointer(((*Pager)(unsafe.Pointer(pPager)).Ffd))).FpMethods != uintptr(0)) {
+ if nPage == Pgno(0) && (*Sqlite3_file)(unsafe.Pointer((*Pager)(unsafe.Pointer(pPager)).Ffd)).FpMethods != uintptr(0) {
*(*I64)(unsafe.Pointer(bp /* n */)) = int64(0) // Size of db file in bytes
var rc int32 = Xsqlite3OsFileSize(tls, (*Pager)(unsafe.Pointer(pPager)).Ffd, bp /* &n */)
if rc != SQLITE_OK {
return rc
}
- nPage = (Pgno(((*(*I64)(unsafe.Pointer(bp /* n */)) + I64((*Pager)(unsafe.Pointer(pPager)).FpageSize)) - int64(1)) / I64((*Pager)(unsafe.Pointer(pPager)).FpageSize)))
+ nPage = Pgno((*(*I64)(unsafe.Pointer(bp)) + (*Pager)(unsafe.Pointer(pPager)).FpageSize - int64(1)) / (*Pager)(unsafe.Pointer(pPager)).FpageSize)
}
// If the current number of pages in the file is greater than the
@@ -33587,7 +34178,7 @@ func pagerPagecount(tls *libc.TLS, pPager uintptr, pnPage uintptr) int32 { /* sq
// a WAL on a none-empty database, this ensures there is no race condition
// between the xAccess() below and an xDelete() being executed by some
// other connection.
-func pagerOpenWalIfPresent(tls *libc.TLS, pPager uintptr) int32 { /* sqlite3.c:55922:12: */
+func pagerOpenWalIfPresent(tls *libc.TLS, pPager uintptr) int32 { /* sqlite3.c:55938:12: */
bp := tls.Alloc(8)
defer tls.Free(8)
@@ -33599,7 +34190,7 @@ func pagerOpenWalIfPresent(tls *libc.TLS, pPager uintptr) int32 { /* sqlite3.c:5
rc = Xsqlite3OsAccess(tls,
(*Pager)(unsafe.Pointer(pPager)).FpVfs, (*Pager)(unsafe.Pointer(pPager)).FzWal, SQLITE_ACCESS_EXISTS, bp /* &isWal */)
if rc == SQLITE_OK {
- if *(*int32)(unsafe.Pointer(bp /* isWal */)) != 0 {
+ if *(*int32)(unsafe.Pointer(bp)) != 0 {
// var nPage Pgno at bp+4, 4
// Size of the database file
@@ -33607,7 +34198,7 @@ func pagerOpenWalIfPresent(tls *libc.TLS, pPager uintptr) int32 { /* sqlite3.c:5
if rc != 0 {
return rc
}
- if *(*Pgno)(unsafe.Pointer(bp + 4 /* nPage */)) == Pgno(0) {
+ if *(*Pgno)(unsafe.Pointer(bp + 4)) == Pgno(0) {
rc = Xsqlite3OsDelete(tls, (*Pager)(unsafe.Pointer(pPager)).FpVfs, (*Pager)(unsafe.Pointer(pPager)).FzWal, 0)
} else {
@@ -33655,7 +34246,7 @@ func pagerOpenWalIfPresent(tls *libc.TLS, pPager uintptr) int32 { /* sqlite3.c:5
// is reset to the value that it held at the start of the savepoint
// (or transaction). No page with a page-number greater than this value
// is played back. If one is encountered it is simply skipped.
-func pagerPlaybackSavepoint(tls *libc.TLS, pPager uintptr, pSavepoint uintptr) int32 { /* sqlite3.c:55989:12: */
+func pagerPlaybackSavepoint(tls *libc.TLS, pPager uintptr, pSavepoint uintptr) int32 { /* sqlite3.c:56005:12: */
bp := tls.Alloc(16)
defer tls.Free(16)
@@ -33682,7 +34273,7 @@ func pagerPlaybackSavepoint(tls *libc.TLS, pPager uintptr, pSavepoint uintptr) i
}()
(*Pager)(unsafe.Pointer(pPager)).FchangeCountDone = (*Pager)(unsafe.Pointer(pPager)).FtempFile
- if !(pSavepoint != 0) && ((*Pager)(unsafe.Pointer((pPager))).FpWal != uintptr(0)) {
+ if !(pSavepoint != 0) && (*Pager)(unsafe.Pointer(pPager)).FpWal != uintptr(0) {
return pagerRollbackWal(tls, pPager)
}
@@ -33698,15 +34289,15 @@ func pagerPlaybackSavepoint(tls *libc.TLS, pPager uintptr, pSavepoint uintptr) i
// greater than the current database size (pPager->dbSize) but those
// will be skipped automatically. Pages are added to pDone as they
// are played back.
- if (pSavepoint != 0) && !((*Pager)(unsafe.Pointer((pPager))).FpWal != uintptr(0)) {
+ if pSavepoint != 0 && !((*Pager)(unsafe.Pointer(pPager)).FpWal != uintptr(0)) {
if (*PagerSavepoint)(unsafe.Pointer(pSavepoint)).FiHdrOffset != 0 {
iHdrOff = (*PagerSavepoint)(unsafe.Pointer(pSavepoint)).FiHdrOffset
} else {
iHdrOff = szJ
}
(*Pager)(unsafe.Pointer(pPager)).FjournalOff = (*PagerSavepoint)(unsafe.Pointer(pSavepoint)).FiOffset
- for (rc == SQLITE_OK) && ((*Pager)(unsafe.Pointer(pPager)).FjournalOff < iHdrOff) {
- rc = pager_playback_one_page(tls, pPager, (pPager + 72 /* &.journalOff */), pDone, 1, 1)
+ for rc == SQLITE_OK && (*Pager)(unsafe.Pointer(pPager)).FjournalOff < iHdrOff {
+ rc = pager_playback_one_page(tls, pPager, pPager+80, pDone, 1, 1)
}
} else {
@@ -33717,7 +34308,7 @@ func pagerPlaybackSavepoint(tls *libc.TLS, pPager uintptr, pSavepoint uintptr) i
// the first journal header seen and continuing until the effective end
// of the main journal file. Continue to skip out-of-range pages and
// continue adding pages rolled back to pDone.
- for (rc == SQLITE_OK) && ((*Pager)(unsafe.Pointer(pPager)).FjournalOff < szJ) {
+ for rc == SQLITE_OK && (*Pager)(unsafe.Pointer(pPager)).FjournalOff < szJ {
var ii U32 // Loop counter
*(*U32)(unsafe.Pointer(bp /* nJRec */)) = U32(0) // Number of Journal Records
// var dummy U32 at bp+4, 4
@@ -33727,12 +34318,12 @@ func pagerPlaybackSavepoint(tls *libc.TLS, pPager uintptr, pSavepoint uintptr) i
// The "pPager->journalHdr+JOURNAL_HDR_SZ(pPager)==pPager->journalOff"
// test is related to ticket #2565. See the discussion in the
// pager_playback() function for additional information.
- if (*(*U32)(unsafe.Pointer(bp /* nJRec */)) == U32(0)) &&
- (((*Pager)(unsafe.Pointer(pPager)).FjournalHdr + (I64((*Pager)(unsafe.Pointer(pPager)).FsectorSize))) == (*Pager)(unsafe.Pointer(pPager)).FjournalOff) {
- *(*U32)(unsafe.Pointer(bp /* nJRec */)) = (U32((szJ - (*Pager)(unsafe.Pointer(pPager)).FjournalOff) / (I64(((*Pager)(unsafe.Pointer(pPager)).FpageSize) + 8))))
+ if *(*U32)(unsafe.Pointer(bp)) == U32(0) &&
+ (*Pager)(unsafe.Pointer(pPager)).FjournalHdr+I64((*Pager)(unsafe.Pointer(pPager)).FsectorSize) == (*Pager)(unsafe.Pointer(pPager)).FjournalOff {
+ *(*U32)(unsafe.Pointer(bp /* nJRec */)) = U32((szJ - (*Pager)(unsafe.Pointer(pPager)).FjournalOff) / ((*Pager)(unsafe.Pointer(pPager)).FpageSize + int64(8)))
}
- for ii = U32(0); ((rc == SQLITE_OK) && (ii < *(*U32)(unsafe.Pointer(bp /* nJRec */)))) && ((*Pager)(unsafe.Pointer(pPager)).FjournalOff < szJ); ii++ {
- rc = pager_playback_one_page(tls, pPager, (pPager + 72 /* &.journalOff */), pDone, 1, 1)
+ for ii = U32(0); rc == SQLITE_OK && ii < *(*U32)(unsafe.Pointer(bp /* nJRec */)) && (*Pager)(unsafe.Pointer(pPager)).FjournalOff < szJ; ii++ {
+ rc = pager_playback_one_page(tls, pPager, pPager+80, pDone, 1, 1)
}
}
@@ -33742,12 +34333,12 @@ func pagerPlaybackSavepoint(tls *libc.TLS, pPager uintptr, pSavepoint uintptr) i
// will be skipped. Out-of-range pages are also skipped.
if pSavepoint != 0 {
var ii U32 // Loop counter
- *(*I64)(unsafe.Pointer(bp + 8 /* offset */)) = (I64((*PagerSavepoint)(unsafe.Pointer(pSavepoint)).FiSubRec) * (I64(4 + (*Pager)(unsafe.Pointer(pPager)).FpageSize)))
+ *(*I64)(unsafe.Pointer(bp + 8 /* offset */)) = I64((*PagerSavepoint)(unsafe.Pointer(pSavepoint)).FiSubRec) * (int64(4) + (*Pager)(unsafe.Pointer(pPager)).FpageSize)
- if (*Pager)(unsafe.Pointer((pPager))).FpWal != uintptr(0) {
- rc = Xsqlite3WalSavepointUndo(tls, (*Pager)(unsafe.Pointer(pPager)).FpWal, pSavepoint+32 /* &.aWalData */)
+ if (*Pager)(unsafe.Pointer(pPager)).FpWal != uintptr(0) {
+ rc = Xsqlite3WalSavepointUndo(tls, (*Pager)(unsafe.Pointer(pPager)).FpWal, pSavepoint+32)
}
- for ii = (*PagerSavepoint)(unsafe.Pointer(pSavepoint)).FiSubRec; (rc == SQLITE_OK) && (ii < (*Pager)(unsafe.Pointer(pPager)).FnSubRec); ii++ {
+ for ii = (*PagerSavepoint)(unsafe.Pointer(pSavepoint)).FiSubRec; rc == SQLITE_OK && ii < (*Pager)(unsafe.Pointer(pPager)).FnSubRec; ii++ {
rc = pager_playback_one_page(tls, pPager, bp+8 /* &offset */, pDone, 0, 1)
}
@@ -33764,40 +34355,40 @@ func pagerPlaybackSavepoint(tls *libc.TLS, pPager uintptr, pSavepoint uintptr) i
// Change the maximum number of in-memory pages that are allowed
// before attempting to recycle clean and unused pages.
-func Xsqlite3PagerSetCachesize(tls *libc.TLS, pPager uintptr, mxPage int32) { /* sqlite3.c:56101:21: */
+func Xsqlite3PagerSetCachesize(tls *libc.TLS, pPager uintptr, mxPage int32) { /* sqlite3.c:56117:21: */
Xsqlite3PcacheSetCachesize(tls, (*Pager)(unsafe.Pointer(pPager)).FpPCache, mxPage)
}
// Change the maximum number of in-memory pages that are allowed
// before attempting to spill pages to journal.
-func Xsqlite3PagerSetSpillsize(tls *libc.TLS, pPager uintptr, mxPage int32) int32 { /* sqlite3.c:56109:20: */
+func Xsqlite3PagerSetSpillsize(tls *libc.TLS, pPager uintptr, mxPage int32) int32 { /* sqlite3.c:56125:20: */
return Xsqlite3PcacheSetSpillsize(tls, (*Pager)(unsafe.Pointer(pPager)).FpPCache, mxPage)
}
// Invoke SQLITE_FCNTL_MMAP_SIZE based on the current value of szMmap.
-func pagerFixMaplimit(tls *libc.TLS, pPager uintptr) { /* sqlite3.c:56116:13: */
+func pagerFixMaplimit(tls *libc.TLS, pPager uintptr) { /* sqlite3.c:56132:13: */
bp := tls.Alloc(8)
defer tls.Free(8)
var fd uintptr = (*Pager)(unsafe.Pointer(pPager)).Ffd
- if ((*Sqlite3_file)(unsafe.Pointer((fd))).FpMethods != uintptr(0)) && ((*sqlite3_io_methods)(unsafe.Pointer((*Sqlite3_file)(unsafe.Pointer(fd)).FpMethods)).FiVersion >= 3) {
+ if (*Sqlite3_file)(unsafe.Pointer(fd)).FpMethods != uintptr(0) && (*sqlite3_io_methods)(unsafe.Pointer((*Sqlite3_file)(unsafe.Pointer(fd)).FpMethods)).FiVersion >= 3 {
// var sz Sqlite3_int64 at bp, 8
*(*Sqlite3_int64)(unsafe.Pointer(bp /* sz */)) = (*Pager)(unsafe.Pointer(pPager)).FszMmap
- (*Pager)(unsafe.Pointer(pPager)).FbUseFetch = (U8(libc.Bool32(*(*Sqlite3_int64)(unsafe.Pointer(bp /* sz */)) > int64(0))))
+ (*Pager)(unsafe.Pointer(pPager)).FbUseFetch = U8(libc.Bool32(*(*Sqlite3_int64)(unsafe.Pointer(bp)) > int64(0)))
setGetterMethod(tls, pPager)
Xsqlite3OsFileControlHint(tls, (*Pager)(unsafe.Pointer(pPager)).Ffd, SQLITE_FCNTL_MMAP_SIZE, bp /* &sz */)
}
}
// Change the maximum size of any memory mapping made of the database file.
-func Xsqlite3PagerSetMmapLimit(tls *libc.TLS, pPager uintptr, szMmap Sqlite3_int64) { /* sqlite3.c:56132:21: */
+func Xsqlite3PagerSetMmapLimit(tls *libc.TLS, pPager uintptr, szMmap Sqlite3_int64) { /* sqlite3.c:56148:21: */
(*Pager)(unsafe.Pointer(pPager)).FszMmap = szMmap
pagerFixMaplimit(tls, pPager)
}
// Free as much memory as possible from the pager.
-func Xsqlite3PagerShrink(tls *libc.TLS, pPager uintptr) { /* sqlite3.c:56140:21: */
+func Xsqlite3PagerShrink(tls *libc.TLS, pPager uintptr) { /* sqlite3.c:56156:21: */
Xsqlite3PcacheShrink(tls, (*Pager)(unsafe.Pointer(pPager)).FpPCache)
}
@@ -33850,8 +34441,8 @@ func Xsqlite3PagerShrink(tls *libc.TLS, pPager uintptr) { /* sqlite3.c:56140:21:
//
// Numeric values associated with these states are OFF==1, NORMAL=2,
// and FULL=3.
-func Xsqlite3PagerSetFlags(tls *libc.TLS, pPager uintptr, pgFlags uint32) { /* sqlite3.c:56196:21: */
- var level uint32 = (pgFlags & uint32(PAGER_SYNCHRONOUS_MASK))
+func Xsqlite3PagerSetFlags(tls *libc.TLS, pPager uintptr, pgFlags uint32) { /* sqlite3.c:56212:21: */
+ var level uint32 = pgFlags & uint32(PAGER_SYNCHRONOUS_MASK)
if (*Pager)(unsafe.Pointer(pPager)).FtempFile != 0 {
(*Pager)(unsafe.Pointer(pPager)).FnoSync = U8(1)
(*Pager)(unsafe.Pointer(pPager)).FfullSync = U8(0)
@@ -33878,22 +34469,22 @@ func Xsqlite3PagerSetFlags(tls *libc.TLS, pPager uintptr, pgFlags uint32) { /* s
}
if (*Pager)(unsafe.Pointer(pPager)).FnoSync != 0 {
(*Pager)(unsafe.Pointer(pPager)).FsyncFlags = U8(0)
- } else if (pgFlags & uint32(PAGER_FULLFSYNC)) != 0 {
+ } else if pgFlags&uint32(PAGER_FULLFSYNC) != 0 {
(*Pager)(unsafe.Pointer(pPager)).FsyncFlags = U8(SQLITE_SYNC_FULL)
} else {
(*Pager)(unsafe.Pointer(pPager)).FsyncFlags = U8(SQLITE_SYNC_NORMAL)
}
- (*Pager)(unsafe.Pointer(pPager)).FwalSyncFlags = (U8(int32((*Pager)(unsafe.Pointer(pPager)).FsyncFlags) << 2))
+ (*Pager)(unsafe.Pointer(pPager)).FwalSyncFlags = U8(int32((*Pager)(unsafe.Pointer(pPager)).FsyncFlags) << 2)
if (*Pager)(unsafe.Pointer(pPager)).FfullSync != 0 {
- *(*U8)(unsafe.Pointer(pPager + 11 /* &.walSyncFlags */)) |= U8((int32((*Pager)(unsafe.Pointer(pPager)).FsyncFlags)))
+ *(*U8)(unsafe.Pointer(pPager + 11)) |= U8(int32((*Pager)(unsafe.Pointer(pPager)).FsyncFlags))
}
- if ((pgFlags & uint32(PAGER_CKPT_FULLFSYNC)) != 0) && !(int32((*Pager)(unsafe.Pointer(pPager)).FnoSync) != 0) {
- *(*U8)(unsafe.Pointer(pPager + 11 /* &.walSyncFlags */)) |= U8((int32(SQLITE_SYNC_FULL) << 2))
+ if pgFlags&uint32(PAGER_CKPT_FULLFSYNC) != 0 && !(int32((*Pager)(unsafe.Pointer(pPager)).FnoSync) != 0) {
+ *(*U8)(unsafe.Pointer(pPager + 11)) |= U8(int32(SQLITE_SYNC_FULL) << 2)
}
- if (pgFlags & uint32(PAGER_CACHESPILL)) != 0 {
- *(*U8)(unsafe.Pointer(pPager + 20 /* &.doNotSpill */)) &= libc.Uint8FromInt32((libc.CplInt32(SPILLFLAG_OFF)))
+ if pgFlags&uint32(PAGER_CACHESPILL) != 0 {
+ *(*U8)(unsafe.Pointer(pPager + 21)) &= libc.Uint8FromInt32(libc.CplInt32(SPILLFLAG_OFF))
} else {
- *(*U8)(unsafe.Pointer(pPager + 20 /* &.doNotSpill */)) |= U8((SPILLFLAG_OFF))
+ *(*U8)(unsafe.Pointer(pPager + 21)) |= U8(SPILLFLAG_OFF)
}
}
@@ -33914,10 +34505,10 @@ func Xsqlite3PagerSetFlags(tls *libc.TLS, pPager uintptr, pgFlags uint32) { /* s
// SQLITE_OPEN_CREATE
// SQLITE_OPEN_EXCLUSIVE
// SQLITE_OPEN_DELETEONCLOSE
-func pagerOpentemp(tls *libc.TLS, pPager uintptr, pFile uintptr, vfsFlags int32) int32 { /* sqlite3.c:56256:12: */
+func pagerOpentemp(tls *libc.TLS, pPager uintptr, pFile uintptr, vfsFlags int32) int32 { /* sqlite3.c:56272:12: */
var rc int32 // Return code
- vfsFlags = vfsFlags | (((SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE) | SQLITE_OPEN_EXCLUSIVE) | SQLITE_OPEN_DELETEONCLOSE)
+ vfsFlags = vfsFlags | (SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE | SQLITE_OPEN_EXCLUSIVE | SQLITE_OPEN_DELETEONCLOSE)
rc = Xsqlite3OsOpen(tls, (*Pager)(unsafe.Pointer(pPager)).FpVfs, uintptr(0), pFile, vfsFlags, uintptr(0))
return rc
@@ -33942,11 +34533,11 @@ func pagerOpentemp(tls *libc.TLS, pPager uintptr, pFile uintptr, vfsFlags int32)
// If the busy-handler callback returns non-zero, the lock is
// retried. If it returns zero, then the SQLITE_BUSY error is
// returned to the caller of the pager API function.
-func Xsqlite3PagerSetBusyHandler(tls *libc.TLS, pPager uintptr, xBusyHandler uintptr, pBusyHandlerArg uintptr) { /* sqlite3.c:56295:21: */
+func Xsqlite3PagerSetBusyHandler(tls *libc.TLS, pPager uintptr, xBusyHandler uintptr, pBusyHandlerArg uintptr) { /* sqlite3.c:56311:21: */
var ap uintptr
(*Pager)(unsafe.Pointer(pPager)).FxBusyHandler = xBusyHandler
(*Pager)(unsafe.Pointer(pPager)).FpBusyHandlerArg = pBusyHandlerArg
- ap = (pPager + 176 /* &.xBusyHandler */)
+ ap = pPager + 192
Xsqlite3OsFileControlHint(tls, (*Pager)(unsafe.Pointer(pPager)).Ffd, SQLITE_FCNTL_BUSYHANDLER, ap)
}
@@ -33979,7 +34570,7 @@ func Xsqlite3PagerSetBusyHandler(tls *libc.TLS, pPager uintptr, xBusyHandler uin
// conditions above is not true, the pager was in error state when this
// function was called, or because the memory allocation attempt failed,
// then *pPageSize is set to the old, retained page size before returning.
-func Xsqlite3PagerSetPagesize(tls *libc.TLS, pPager uintptr, pPageSize uintptr, nReserve int32) int32 { /* sqlite3.c:56339:20: */
+func Xsqlite3PagerSetPagesize(tls *libc.TLS, pPager uintptr, pPageSize uintptr, nReserve int32) int32 { /* sqlite3.c:56355:20: */
bp := tls.Alloc(8)
defer tls.Free(8)
@@ -33996,23 +34587,23 @@ func Xsqlite3PagerSetPagesize(tls *libc.TLS, pPager uintptr, pPageSize uintptr,
var pageSize U32 = *(*U32)(unsafe.Pointer(pPageSize))
- if ((((int32((*Pager)(unsafe.Pointer(pPager)).FmemDb) == 0) || ((*Pager)(unsafe.Pointer(pPager)).FdbSize == Pgno(0))) &&
- (Xsqlite3PcacheRefCount(tls, (*Pager)(unsafe.Pointer(pPager)).FpPCache) == 0)) &&
- (pageSize != 0)) && (pageSize != U32((*Pager)(unsafe.Pointer(pPager)).FpageSize)) {
+ if (int32((*Pager)(unsafe.Pointer(pPager)).FmemDb) == 0 || (*Pager)(unsafe.Pointer(pPager)).FdbSize == Pgno(0)) &&
+ Xsqlite3PcacheRefCount(tls, (*Pager)(unsafe.Pointer(pPager)).FpPCache) == 0 &&
+ pageSize != 0 && pageSize != U32((*Pager)(unsafe.Pointer(pPager)).FpageSize) {
var pNew uintptr = uintptr(0) // New temp space
*(*I64)(unsafe.Pointer(bp /* nByte */)) = int64(0)
- if (int32((*Pager)(unsafe.Pointer(pPager)).FeState) > PAGER_OPEN) && ((*Sqlite3_file)(unsafe.Pointer(((*Pager)(unsafe.Pointer(pPager)).Ffd))).FpMethods != uintptr(0)) {
+ if int32((*Pager)(unsafe.Pointer(pPager)).FeState) > PAGER_OPEN && (*Sqlite3_file)(unsafe.Pointer((*Pager)(unsafe.Pointer(pPager)).Ffd)).FpMethods != uintptr(0) {
rc = Xsqlite3OsFileSize(tls, (*Pager)(unsafe.Pointer(pPager)).Ffd, bp /* &nByte */)
}
if rc == SQLITE_OK {
// 8 bytes of zeroed overrun space is sufficient so that the b-tree
// cell header parser will never run off the end of the allocation
- pNew = Xsqlite3PageMalloc(tls, (int32(pageSize + U32(8))))
+ pNew = Xsqlite3PageMalloc(tls, int32(pageSize+U32(8)))
if !(pNew != 0) {
rc = SQLITE_NOMEM
} else {
- libc.Xmemset(tls, (pNew + uintptr(pageSize)), 0, uint32(8))
+ libc.Xmemset(tls, pNew+uintptr(pageSize), 0, uint32(8))
}
}
@@ -34023,8 +34614,8 @@ func Xsqlite3PagerSetPagesize(tls *libc.TLS, pPager uintptr, pPageSize uintptr,
if rc == SQLITE_OK {
Xsqlite3PageFree(tls, (*Pager)(unsafe.Pointer(pPager)).FpTmpSpace)
(*Pager)(unsafe.Pointer(pPager)).FpTmpSpace = pNew
- (*Pager)(unsafe.Pointer(pPager)).FdbSize = (Pgno(((*(*I64)(unsafe.Pointer(bp /* nByte */)) + I64(pageSize)) - int64(1)) / I64(pageSize)))
- (*Pager)(unsafe.Pointer(pPager)).FpageSize = int32(pageSize)
+ (*Pager)(unsafe.Pointer(pPager)).FdbSize = Pgno((*(*I64)(unsafe.Pointer(bp)) + I64(pageSize) - int64(1)) / I64(pageSize))
+ (*Pager)(unsafe.Pointer(pPager)).FpageSize = I64(pageSize)
} else {
Xsqlite3PageFree(tls, pNew)
}
@@ -34048,7 +34639,7 @@ func Xsqlite3PagerSetPagesize(tls *libc.TLS, pPager uintptr, pPageSize uintptr,
// during rollback and will be overwritten whenever a rollback
// occurs. But other modules are free to use it too, as long as
// no rollbacks are happening.
-func Xsqlite3PagerTempSpace(tls *libc.TLS, pPager uintptr) uintptr { /* sqlite3.c:56407:21: */
+func Xsqlite3PagerTempSpace(tls *libc.TLS, pPager uintptr) uintptr { /* sqlite3.c:56423:21: */
return (*Pager)(unsafe.Pointer(pPager)).FpTmpSpace
}
@@ -34057,7 +34648,7 @@ func Xsqlite3PagerTempSpace(tls *libc.TLS, pPager uintptr) uintptr { /* sqlite3.
// maximum page count below the current size of the database.
//
// Regardless of mxPage, return the current maximum page count.
-func Xsqlite3PagerMaxPageCount(tls *libc.TLS, pPager uintptr, mxPage Pgno) Pgno { /* sqlite3.c:56418:21: */
+func Xsqlite3PagerMaxPageCount(tls *libc.TLS, pPager uintptr, mxPage Pgno) Pgno { /* sqlite3.c:56434:21: */
if mxPage > Pgno(0) {
(*Pager)(unsafe.Pointer(pPager)).FmxPgno = mxPage
}
@@ -34088,7 +34679,7 @@ func Xsqlite3PagerMaxPageCount(tls *libc.TLS, pPager uintptr, mxPage Pgno) Pgno
// If any IO error apart from SQLITE_IOERR_SHORT_READ is encountered,
// the error code is returned to the caller and the contents of the
// output buffer undefined.
-func Xsqlite3PagerReadFileheader(tls *libc.TLS, pPager uintptr, N int32, pDest uintptr) int32 { /* sqlite3.c:56468:20: */
+func Xsqlite3PagerReadFileheader(tls *libc.TLS, pPager uintptr, N int32, pDest uintptr) int32 { /* sqlite3.c:56484:20: */
var rc int32 = SQLITE_OK
libc.Xmemset(tls, pDest, 0, uint32(N))
@@ -34096,10 +34687,10 @@ func Xsqlite3PagerReadFileheader(tls *libc.TLS, pPager uintptr, N int32, pDest u
// the Pager object. There has not been an opportunity to transition
// to WAL mode yet.
- if (*Sqlite3_file)(unsafe.Pointer(((*Pager)(unsafe.Pointer(pPager)).Ffd))).FpMethods != uintptr(0) {
+ if (*Sqlite3_file)(unsafe.Pointer((*Pager)(unsafe.Pointer(pPager)).Ffd)).FpMethods != uintptr(0) {
rc = Xsqlite3OsRead(tls, (*Pager)(unsafe.Pointer(pPager)).Ffd, pDest, N, int64(0))
- if rc == (SQLITE_IOERR | (int32(2) << 8)) {
+ if rc == SQLITE_IOERR|int32(2)<<8 {
rc = SQLITE_OK
}
}
@@ -34111,7 +34702,7 @@ func Xsqlite3PagerReadFileheader(tls *libc.TLS, pPager uintptr, N int32, pDest u
//
// However, if the file is between 1 and <page-size> bytes in size, then
// this is considered a 1 page file.
-func Xsqlite3PagerPagecount(tls *libc.TLS, pPager uintptr, pnPage uintptr) { /* sqlite3.c:56496:21: */
+func Xsqlite3PagerPagecount(tls *libc.TLS, pPager uintptr, pnPage uintptr) { /* sqlite3.c:56512:21: */
*(*int32)(unsafe.Pointer(pnPage)) = int32((*Pager)(unsafe.Pointer(pPager)).FdbSize)
}
@@ -34128,7 +34719,7 @@ func Xsqlite3PagerPagecount(tls *libc.TLS, pPager uintptr, pnPage uintptr) { /*
// Return SQLITE_OK on success and an error code if we cannot obtain
// the lock. If the lock is obtained successfully, set the Pager.state
// variable to locktype before returning.
-func pager_wait_on_lock(tls *libc.TLS, pPager uintptr, locktype int32) int32 { /* sqlite3.c:56517:12: */
+func pager_wait_on_lock(tls *libc.TLS, pPager uintptr, locktype int32) int32 { /* sqlite3.c:56533:12: */
var rc int32 // Return code
// Check that this is either a no-op (because the requested lock is
@@ -34136,9 +34727,9 @@ func pager_wait_on_lock(tls *libc.TLS, pPager uintptr, locktype int32) int32 { /
// may be invoked during, according to the comment above
// sqlite3PagerSetBusyhandler().
- for ok := true; ok; ok = ((rc == SQLITE_BUSY) && ((*struct {
+ for ok := true; ok; ok = rc == SQLITE_BUSY && (*struct {
f func(*libc.TLS, uintptr) int32
- })(unsafe.Pointer(&struct{ uintptr }{(*Pager)(unsafe.Pointer(pPager)).FxBusyHandler})).f(tls, (*Pager)(unsafe.Pointer(pPager)).FpBusyHandlerArg) != 0)) {
+ })(unsafe.Pointer(&struct{ uintptr }{(*Pager)(unsafe.Pointer(pPager)).FxBusyHandler})).f(tls, (*Pager)(unsafe.Pointer(pPager)).FpBusyHandlerArg) != 0 {
rc = pagerLockDb(tls, pPager, locktype)
}
return rc
@@ -34174,7 +34765,7 @@ func pager_wait_on_lock(tls *libc.TLS, pPager uintptr, locktype int32) int32 { /
// Once this function has been called, the transaction must either be
// rolled back or committed. It is not safe to call this function and
// then continue writing to the database.
-func Xsqlite3PagerTruncateImage(tls *libc.TLS, pPager uintptr, nPage Pgno) { /* sqlite3.c:56581:21: */
+func Xsqlite3PagerTruncateImage(tls *libc.TLS, pPager uintptr, nPage Pgno) { /* sqlite3.c:56597:21: */
(*Pager)(unsafe.Pointer(pPager)).FdbSize = nPage
@@ -34201,13 +34792,13 @@ func Xsqlite3PagerTruncateImage(tls *libc.TLS, pPager uintptr, nPage Pgno) { /*
//
// If everything goes as planned, SQLITE_OK is returned. Otherwise,
// an SQLite error code.
-func pagerSyncHotJournal(tls *libc.TLS, pPager uintptr) int32 { /* sqlite3.c:56613:12: */
+func pagerSyncHotJournal(tls *libc.TLS, pPager uintptr) int32 { /* sqlite3.c:56629:12: */
var rc int32 = SQLITE_OK
if !(int32((*Pager)(unsafe.Pointer(pPager)).FnoSync) != 0) {
rc = Xsqlite3OsSync(tls, (*Pager)(unsafe.Pointer(pPager)).Fjfd, SQLITE_SYNC_NORMAL)
}
if rc == SQLITE_OK {
- rc = Xsqlite3OsFileSize(tls, (*Pager)(unsafe.Pointer(pPager)).Fjfd, (pPager + 80 /* &.journalHdr */))
+ rc = Xsqlite3OsFileSize(tls, (*Pager)(unsafe.Pointer(pPager)).Fjfd, pPager+88)
}
return rc
}
@@ -34220,7 +34811,7 @@ func pagerSyncHotJournal(tls *libc.TLS, pPager uintptr) int32 { /* sqlite3.c:566
//
// Page references obtained by calling this function should be released
// by calling pagerReleaseMapPage().
-func pagerAcquireMapPage(tls *libc.TLS, pPager uintptr, pgno Pgno, pData uintptr, ppPage uintptr) int32 { /* sqlite3.c:56635:12: */
+func pagerAcquireMapPage(tls *libc.TLS, pPager uintptr, pgno Pgno, pData uintptr, ppPage uintptr) int32 { /* sqlite3.c:56651:12: */
var p uintptr // Memory mapped page to return
if (*Pager)(unsafe.Pointer(pPager)).FpMmapFreelist != 0 {
@@ -34230,12 +34821,12 @@ func pagerAcquireMapPage(tls *libc.TLS, pPager uintptr, pgno Pgno, pData uintptr
libc.Xmemset(tls, (*PgHdr)(unsafe.Pointer(p)).FpExtra, 0, uint32(8))
} else {
- *(*uintptr)(unsafe.Pointer(ppPage)) = libc.AssignUintptr(&p, Xsqlite3MallocZero(tls, (uint64(uint32(unsafe.Sizeof(PgHdr{}))+uint32((*Pager)(unsafe.Pointer(pPager)).FnExtra)))))
+ *(*uintptr)(unsafe.Pointer(ppPage)) = libc.AssignUintptr(&p, Xsqlite3MallocZero(tls, uint64(uint32(unsafe.Sizeof(PgHdr{}))+uint32((*Pager)(unsafe.Pointer(pPager)).FnExtra))))
if p == uintptr(0) {
- Xsqlite3OsUnfetch(tls, (*Pager)(unsafe.Pointer(pPager)).Ffd, ((I64(pgno - Pgno(1))) * I64((*Pager)(unsafe.Pointer(pPager)).FpageSize)), pData)
+ Xsqlite3OsUnfetch(tls, (*Pager)(unsafe.Pointer(pPager)).Ffd, I64(pgno-Pgno(1))*(*Pager)(unsafe.Pointer(pPager)).FpageSize, pData)
return SQLITE_NOMEM
}
- (*PgHdr)(unsafe.Pointer(p)).FpExtra = (p + 1*40)
+ (*PgHdr)(unsafe.Pointer(p)).FpExtra = p + 1*40
(*PgHdr)(unsafe.Pointer(p)).Fflags = U16(PGHDR_MMAP)
(*PgHdr)(unsafe.Pointer(p)).FnRef = int16(1)
(*PgHdr)(unsafe.Pointer(p)).FpPager = pPager
@@ -34250,17 +34841,17 @@ func pagerAcquireMapPage(tls *libc.TLS, pPager uintptr, pgno Pgno, pData uintptr
// Release a reference to page pPg. pPg must have been returned by an
// earlier call to pagerAcquireMapPage().
-func pagerReleaseMapPage(tls *libc.TLS, pPg uintptr) { /* sqlite3.c:56679:13: */
+func pagerReleaseMapPage(tls *libc.TLS, pPg uintptr) { /* sqlite3.c:56695:13: */
var pPager uintptr = (*PgHdr)(unsafe.Pointer(pPg)).FpPager
(*Pager)(unsafe.Pointer(pPager)).FnMmapOut--
(*PgHdr)(unsafe.Pointer(pPg)).FpDirty = (*Pager)(unsafe.Pointer(pPager)).FpMmapFreelist
(*Pager)(unsafe.Pointer(pPager)).FpMmapFreelist = pPg
- Xsqlite3OsUnfetch(tls, (*Pager)(unsafe.Pointer(pPager)).Ffd, ((I64((*PgHdr)(unsafe.Pointer(pPg)).Fpgno - Pgno(1))) * I64((*Pager)(unsafe.Pointer(pPager)).FpageSize)), (*PgHdr)(unsafe.Pointer(pPg)).FpData)
+ Xsqlite3OsUnfetch(tls, (*Pager)(unsafe.Pointer(pPager)).Ffd, I64((*PgHdr)(unsafe.Pointer(pPg)).Fpgno-Pgno(1))*(*Pager)(unsafe.Pointer(pPager)).FpageSize, (*PgHdr)(unsafe.Pointer(pPg)).FpData)
}
// Free all PgHdr objects stored in the Pager.pMmapFreelist list.
-func pagerFreeMapHdrs(tls *libc.TLS, pPager uintptr) { /* sqlite3.c:56692:13: */
+func pagerFreeMapHdrs(tls *libc.TLS, pPager uintptr) { /* sqlite3.c:56708:13: */
var p uintptr
var pNext uintptr
for p = (*Pager)(unsafe.Pointer(pPager)).FpMmapFreelist; p != 0; p = pNext {
@@ -34273,7 +34864,7 @@ func pagerFreeMapHdrs(tls *libc.TLS, pPager uintptr) { /* sqlite3.c:56692:13: */
// under the pager. Return SQLITE_OK if the database is still where it ought
// to be on disk. Return non-zero (SQLITE_READONLY_DBMOVED or some other error
// code from sqlite3OsAccess()) if the database has gone missing.
-func databaseIsUnmoved(tls *libc.TLS, pPager uintptr) int32 { /* sqlite3.c:56706:12: */
+func databaseIsUnmoved(tls *libc.TLS, pPager uintptr) int32 { /* sqlite3.c:56722:12: */
bp := tls.Alloc(4)
defer tls.Free(4)
@@ -34293,8 +34884,8 @@ func databaseIsUnmoved(tls *libc.TLS, pPager uintptr) int32 { /* sqlite3.c:56706
// has not been moved. That is the historical behavior of SQLite: prior to
// version 3.8.3, it never checked
rc = SQLITE_OK
- } else if (rc == SQLITE_OK) && (*(*int32)(unsafe.Pointer(bp /* bHasMoved */)) != 0) {
- rc = (SQLITE_READONLY | (int32(4) << 8))
+ } else if rc == SQLITE_OK && *(*int32)(unsafe.Pointer(bp)) != 0 {
+ rc = SQLITE_READONLY | int32(4)<<8
}
return rc
}
@@ -34311,7 +34902,7 @@ func databaseIsUnmoved(tls *libc.TLS, pPager uintptr) int32 { /* sqlite3.c:56706
// is made to roll it back. If an error occurs during the rollback
// a hot journal may be left in the filesystem but no error is returned
// to the caller.
-func Xsqlite3PagerClose(tls *libc.TLS, pPager uintptr, db uintptr) int32 { /* sqlite3.c:56740:20: */
+func Xsqlite3PagerClose(tls *libc.TLS, pPager uintptr, db uintptr) int32 { /* sqlite3.c:56756:20: */
var pTmp uintptr = (*Pager)(unsafe.Pointer(pPager)).FpTmpSpace
Xsqlite3BeginBenignMalloc(tls)
@@ -34321,11 +34912,11 @@ func Xsqlite3PagerClose(tls *libc.TLS, pPager uintptr, db uintptr) int32 { /* sq
{
var a uintptr = uintptr(0)
- if ((db != 0) && (uint64(0) == ((*Sqlite3)(unsafe.Pointer(db)).Fflags & uint64(SQLITE_NoCkptOnClose)))) &&
- (SQLITE_OK == databaseIsUnmoved(tls, pPager)) {
+ if db != 0 && uint64(0) == (*Sqlite3)(unsafe.Pointer(db)).Fflags&uint64(SQLITE_NoCkptOnClose) &&
+ SQLITE_OK == databaseIsUnmoved(tls, pPager) {
a = pTmp
}
- Xsqlite3WalClose(tls, (*Pager)(unsafe.Pointer(pPager)).FpWal, db, int32((*Pager)(unsafe.Pointer(pPager)).FwalSyncFlags), (*Pager)(unsafe.Pointer(pPager)).FpageSize, a)
+ Xsqlite3WalClose(tls, (*Pager)(unsafe.Pointer(pPager)).FpWal, db, int32((*Pager)(unsafe.Pointer(pPager)).FwalSyncFlags), int32((*Pager)(unsafe.Pointer(pPager)).FpageSize), a)
(*Pager)(unsafe.Pointer(pPager)).FpWal = uintptr(0)
}
@@ -34343,7 +34934,7 @@ func Xsqlite3PagerClose(tls *libc.TLS, pPager uintptr, db uintptr) int32 { /* sq
// database and close the journal file without attempting to roll it
// back or finalize it. The next database user will have to do hot-journal
// rollback before accessing the database file.
- if (*Sqlite3_file)(unsafe.Pointer(((*Pager)(unsafe.Pointer(pPager)).Fjfd))).FpMethods != uintptr(0) {
+ if (*Sqlite3_file)(unsafe.Pointer((*Pager)(unsafe.Pointer(pPager)).Fjfd)).FpMethods != uintptr(0) {
pager_error(tls, pPager, pagerSyncHotJournal(tls, pPager))
}
pagerUnlockAndRollback(tls, pPager)
@@ -34360,7 +34951,7 @@ func Xsqlite3PagerClose(tls *libc.TLS, pPager uintptr, db uintptr) int32 { /* sq
}
// Increment the reference count for page pPg.
-func Xsqlite3PagerRef(tls *libc.TLS, pPg uintptr) { /* sqlite3.c:56809:21: */
+func Xsqlite3PagerRef(tls *libc.TLS, pPg uintptr) { /* sqlite3.c:56825:21: */
Xsqlite3PcacheRef(tls, pPg)
}
@@ -34397,7 +34988,7 @@ func Xsqlite3PagerRef(tls *libc.TLS, pPg uintptr) { /* sqlite3.c:56809:21: */
// If successful, this routine clears the PGHDR_NEED_SYNC flag of every
// page currently held in memory before returning SQLITE_OK. If an IO
// error is encountered, then the IO error code is returned to the caller.
-func syncJournal(tls *libc.TLS, pPager uintptr, newHdr int32) int32 { /* sqlite3.c:56848:12: */
+func syncJournal(tls *libc.TLS, pPager uintptr, newHdr int32) int32 { /* sqlite3.c:56864:12: */
bp := tls.Alloc(20)
defer tls.Free(20)
@@ -34410,10 +35001,10 @@ func syncJournal(tls *libc.TLS, pPager uintptr, newHdr int32) int32 { /* sqlite3
if !(int32((*Pager)(unsafe.Pointer(pPager)).FnoSync) != 0) {
- if ((*Sqlite3_file)(unsafe.Pointer(((*Pager)(unsafe.Pointer(pPager)).Fjfd))).FpMethods != uintptr(0)) && (int32((*Pager)(unsafe.Pointer(pPager)).FjournalMode) != PAGER_JOURNALMODE_MEMORY) {
+ if (*Sqlite3_file)(unsafe.Pointer((*Pager)(unsafe.Pointer(pPager)).Fjfd)).FpMethods != uintptr(0) && int32((*Pager)(unsafe.Pointer(pPager)).FjournalMode) != PAGER_JOURNALMODE_MEMORY {
var iDc int32 = Xsqlite3OsDeviceCharacteristics(tls, (*Pager)(unsafe.Pointer(pPager)).Ffd)
- if 0 == (iDc & SQLITE_IOCAP_SAFE_APPEND) {
+ if 0 == iDc&SQLITE_IOCAP_SAFE_APPEND {
// This block deals with an obscure problem. If the last connection
// that wrote to this database was operating in persistent-journal
// mode, then the journal file may at this point actually be larger
@@ -34441,14 +35032,14 @@ func syncJournal(tls *libc.TLS, pPager uintptr, newHdr int32) int32 { /* sqlite3
// var zHeader [12]U8 at bp, 12
libc.Xmemcpy(tls, bp /* &zHeader[0] */, uintptr(unsafe.Pointer(&aJournalMagic)), uint32(unsafe.Sizeof(aJournalMagic)))
- Xsqlite3Put4byte(tls, (bp /* &zHeader */ + 8), uint32((*Pager)(unsafe.Pointer(pPager)).FnRec))
+ Xsqlite3Put4byte(tls, bp+8, uint32((*Pager)(unsafe.Pointer(pPager)).FnRec))
iNextHdrOffset = journalHdrOffset(tls, pPager)
rc = Xsqlite3OsRead(tls, (*Pager)(unsafe.Pointer(pPager)).Fjfd, bp+12 /* &aMagic[0] */, 8, iNextHdrOffset)
- if (rc == SQLITE_OK) && (0 == libc.Xmemcmp(tls, bp+12 /* &aMagic[0] */, uintptr(unsafe.Pointer(&aJournalMagic)), uint32(8))) {
+ if rc == SQLITE_OK && 0 == libc.Xmemcmp(tls, bp+12, uintptr(unsafe.Pointer(&aJournalMagic)), uint32(8)) {
rc = Xsqlite3OsWrite(tls, (*Pager)(unsafe.Pointer(pPager)).Fjfd, uintptr(unsafe.Pointer(&zerobyte)), 1, iNextHdrOffset)
}
- if (rc != SQLITE_OK) && (rc != (SQLITE_IOERR | (int32(2) << 8))) {
+ if rc != SQLITE_OK && rc != SQLITE_IOERR|int32(2)<<8 {
return rc
}
@@ -34462,7 +35053,7 @@ func syncJournal(tls *libc.TLS, pPager uintptr, newHdr int32) int32 { /* sqlite3
// for garbage data to be appended to the file, the nRec field
// is populated with 0xFFFFFFFF when the journal header is written
// and never needs to be updated.
- if ((*Pager)(unsafe.Pointer(pPager)).FfullSync != 0) && (0 == (iDc & SQLITE_IOCAP_SEQUENTIAL)) {
+ if (*Pager)(unsafe.Pointer(pPager)).FfullSync != 0 && 0 == iDc&SQLITE_IOCAP_SEQUENTIAL {
rc = Xsqlite3OsSync(tls, (*Pager)(unsafe.Pointer(pPager)).Fjfd, int32((*Pager)(unsafe.Pointer(pPager)).FsyncFlags))
if rc != SQLITE_OK {
@@ -34476,21 +35067,21 @@ func syncJournal(tls *libc.TLS, pPager uintptr, newHdr int32) int32 { /* sqlite3
return rc
}
}
- if 0 == (iDc & SQLITE_IOCAP_SEQUENTIAL) {
+ if 0 == iDc&SQLITE_IOCAP_SEQUENTIAL {
- rc = Xsqlite3OsSync(tls, (*Pager)(unsafe.Pointer(pPager)).Fjfd, (int32((*Pager)(unsafe.Pointer(pPager)).FsyncFlags) | (func() int32 {
+ rc = Xsqlite3OsSync(tls, (*Pager)(unsafe.Pointer(pPager)).Fjfd, int32((*Pager)(unsafe.Pointer(pPager)).FsyncFlags)|func() int32 {
if int32((*Pager)(unsafe.Pointer(pPager)).FsyncFlags) == SQLITE_SYNC_FULL {
return SQLITE_SYNC_DATAONLY
}
return 0
- }())))
+ }())
if rc != SQLITE_OK {
return rc
}
}
(*Pager)(unsafe.Pointer(pPager)).FjournalHdr = (*Pager)(unsafe.Pointer(pPager)).FjournalOff
- if (newHdr != 0) && (0 == (iDc & SQLITE_IOCAP_SAFE_APPEND)) {
+ if newHdr != 0 && 0 == iDc&SQLITE_IOCAP_SAFE_APPEND {
(*Pager)(unsafe.Pointer(pPager)).FnRec = 0
rc = writeJournalHdr(tls, pPager)
if rc != SQLITE_OK {
@@ -34511,7 +35102,7 @@ func syncJournal(tls *libc.TLS, pPager uintptr, newHdr int32) int32 { /* sqlite3
return SQLITE_OK
}
-var zerobyte U8 = U8(0) /* sqlite3.c:56899:27 */
+var zerobyte U8 = U8(0) /* sqlite3.c:56915:27 */
// The argument is the first in a linked list of dirty pages connected
// by the PgHdr.pDirty pointer. This function writes each one of the
@@ -34543,7 +35134,7 @@ var zerobyte U8 = U8(0) /* sqlite3.c:56899:27 */
// If everything is successful, SQLITE_OK is returned. If an IO error
// occurs, an IO error code is returned. Or, if the EXCLUSIVE lock cannot
// be obtained, SQLITE_BUSY is returned.
-func pager_write_pagelist(tls *libc.TLS, pPager uintptr, pList uintptr) int32 { /* sqlite3.c:56991:12: */
+func pager_write_pagelist(tls *libc.TLS, pPager uintptr, pList uintptr) int32 { /* sqlite3.c:57007:12: */
bp := tls.Alloc(8)
defer tls.Free(8)
@@ -34554,7 +35145,7 @@ func pager_write_pagelist(tls *libc.TLS, pPager uintptr, pList uintptr) int32 {
// If the file is a temp-file has not yet been opened, open it now. It
// is not possible for rc to be other than SQLITE_OK if this branch
// is taken, as pager_wait_on_lock() is a no-op for temp-files.
- if !((*Sqlite3_file)(unsafe.Pointer(((*Pager)(unsafe.Pointer(pPager)).Ffd))).FpMethods != uintptr(0)) {
+ if !((*Sqlite3_file)(unsafe.Pointer((*Pager)(unsafe.Pointer(pPager)).Ffd)).FpMethods != uintptr(0)) {
rc = pagerOpentemp(tls, pPager, (*Pager)(unsafe.Pointer(pPager)).Ffd, int32((*Pager)(unsafe.Pointer(pPager)).FvfsFlags))
}
@@ -34562,15 +35153,15 @@ func pager_write_pagelist(tls *libc.TLS, pPager uintptr, pList uintptr) int32 {
// Before the first write, give the VFS a hint of what the final
// file size will be.
- if ((rc == SQLITE_OK) &&
- ((*Pager)(unsafe.Pointer(pPager)).FdbHintSize < (*Pager)(unsafe.Pointer(pPager)).FdbSize)) &&
- (((*PgHdr)(unsafe.Pointer(pList)).FpDirty != 0) || ((*PgHdr)(unsafe.Pointer(pList)).Fpgno > (*Pager)(unsafe.Pointer(pPager)).FdbHintSize)) {
- *(*Sqlite3_int64)(unsafe.Pointer(bp /* szFile */)) = (Sqlite3_int64((*Pager)(unsafe.Pointer(pPager)).FpageSize) * Sqlite3_int64((*Pager)(unsafe.Pointer(pPager)).FdbSize))
+ if rc == SQLITE_OK &&
+ (*Pager)(unsafe.Pointer(pPager)).FdbHintSize < (*Pager)(unsafe.Pointer(pPager)).FdbSize &&
+ ((*PgHdr)(unsafe.Pointer(pList)).FpDirty != 0 || (*PgHdr)(unsafe.Pointer(pList)).Fpgno > (*Pager)(unsafe.Pointer(pPager)).FdbHintSize) {
+ *(*Sqlite3_int64)(unsafe.Pointer(bp /* szFile */)) = (*Pager)(unsafe.Pointer(pPager)).FpageSize * Sqlite3_int64((*Pager)(unsafe.Pointer(pPager)).FdbSize)
Xsqlite3OsFileControlHint(tls, (*Pager)(unsafe.Pointer(pPager)).Ffd, SQLITE_FCNTL_SIZE_HINT, bp /* &szFile */)
(*Pager)(unsafe.Pointer(pPager)).FdbHintSize = (*Pager)(unsafe.Pointer(pPager)).FdbSize
}
- for (rc == SQLITE_OK) && (pList != 0) {
+ for rc == SQLITE_OK && pList != 0 {
var pgno Pgno = (*PgHdr)(unsafe.Pointer(pList)).Fpgno
// If there are dirty pages in the page cache with page numbers greater
@@ -34580,9 +35171,9 @@ func pager_write_pagelist(tls *libc.TLS, pPager uintptr, pList uintptr) int32 {
//
// Also, do not write out any page that has the PGHDR_DONT_WRITE flag
// set (set by sqlite3PagerDontWrite()).
- if (pgno <= (*Pager)(unsafe.Pointer(pPager)).FdbSize) && (0 == (int32((*PgHdr)(unsafe.Pointer(pList)).Fflags) & PGHDR_DONT_WRITE)) {
- var offset I64 = ((I64(pgno - Pgno(1))) * I64((*Pager)(unsafe.Pointer(pPager)).FpageSize)) // Offset to write
- var pData uintptr // Data to write
+ if pgno <= (*Pager)(unsafe.Pointer(pPager)).FdbSize && 0 == int32((*PgHdr)(unsafe.Pointer(pList)).Fflags)&PGHDR_DONT_WRITE {
+ var offset I64 = I64(pgno-Pgno(1)) * (*Pager)(unsafe.Pointer(pPager)).FpageSize // Offset to write
+ var pData uintptr // Data to write
if (*PgHdr)(unsafe.Pointer(pList)).Fpgno == Pgno(1) {
pager_write_changecounter(tls, pList)
@@ -34591,18 +35182,18 @@ func pager_write_pagelist(tls *libc.TLS, pPager uintptr, pList uintptr) int32 {
pData = (*PgHdr)(unsafe.Pointer(pList)).FpData
// Write out the page data.
- rc = Xsqlite3OsWrite(tls, (*Pager)(unsafe.Pointer(pPager)).Ffd, pData, (*Pager)(unsafe.Pointer(pPager)).FpageSize, offset)
+ rc = Xsqlite3OsWrite(tls, (*Pager)(unsafe.Pointer(pPager)).Ffd, pData, int32((*Pager)(unsafe.Pointer(pPager)).FpageSize), offset)
// If page 1 was just written, update Pager.dbFileVers to match
// the value now stored in the database file. If writing this
// page caused the database file to grow, update dbFileSize.
if pgno == Pgno(1) {
- libc.Xmemcpy(tls, (pPager + 104 /* &.dbFileVers */), (pData + 24), uint32(unsafe.Sizeof([16]uint8{})))
+ libc.Xmemcpy(tls, pPager+112, pData+24, uint32(unsafe.Sizeof([16]uint8{})))
}
if pgno > (*Pager)(unsafe.Pointer(pPager)).FdbFileSize {
(*Pager)(unsafe.Pointer(pPager)).FdbFileSize = pgno
}
- *(*int32)(unsafe.Pointer((pPager + 184 /* &.aStat */) + 2*4))++
+ *(*int32)(unsafe.Pointer(pPager + 200 + 2*4))++
// Update any backup objects copying the contents of this pager.
Xsqlite3BackupUpdate(tls, (*Pager)(unsafe.Pointer(pPager)).FpBackup, pgno, (*PgHdr)(unsafe.Pointer(pList)).FpData)
@@ -34623,14 +35214,14 @@ func pager_write_pagelist(tls *libc.TLS, pPager uintptr, pList uintptr) int32 {
// SQLITE_OK is returned if everything goes according to plan. An
// SQLITE_IOERR_XXX error code is returned if a call to sqlite3OsOpen()
// fails.
-func openSubJournal(tls *libc.TLS, pPager uintptr) int32 { /* sqlite3.c:57082:12: */
+func openSubJournal(tls *libc.TLS, pPager uintptr) int32 { /* sqlite3.c:57098:12: */
var rc int32 = SQLITE_OK
- if !((*Sqlite3_file)(unsafe.Pointer(((*Pager)(unsafe.Pointer(pPager)).Fsjfd))).FpMethods != uintptr(0)) {
- var flags int32 = ((((SQLITE_OPEN_SUBJOURNAL | SQLITE_OPEN_READWRITE) |
- SQLITE_OPEN_CREATE) | SQLITE_OPEN_EXCLUSIVE) |
- SQLITE_OPEN_DELETEONCLOSE)
+ if !((*Sqlite3_file)(unsafe.Pointer((*Pager)(unsafe.Pointer(pPager)).Fsjfd)).FpMethods != uintptr(0)) {
+ var flags int32 = SQLITE_OPEN_SUBJOURNAL | SQLITE_OPEN_READWRITE |
+ SQLITE_OPEN_CREATE | SQLITE_OPEN_EXCLUSIVE |
+ SQLITE_OPEN_DELETEONCLOSE
var nStmtSpill int32 = Xsqlite3Config.FnStmtSpill
- if (int32((*Pager)(unsafe.Pointer(pPager)).FjournalMode) == PAGER_JOURNALMODE_MEMORY) || ((*Pager)(unsafe.Pointer(pPager)).FsubjInMemory != 0) {
+ if int32((*Pager)(unsafe.Pointer(pPager)).FjournalMode) == PAGER_JOURNALMODE_MEMORY || (*Pager)(unsafe.Pointer(pPager)).FsubjInMemory != 0 {
nStmtSpill = -1
}
rc = Xsqlite3JournalOpen(tls, (*Pager)(unsafe.Pointer(pPager)).FpVfs, uintptr(0), (*Pager)(unsafe.Pointer(pPager)).Fsjfd, flags, nStmtSpill)
@@ -34647,7 +35238,7 @@ func openSubJournal(tls *libc.TLS, pPager uintptr) int32 { /* sqlite3.c:57082:12
// error code if the attempt to write to the sub-journal fails, or
// SQLITE_NOMEM if a malloc fails while setting a bit in a savepoint
// bitvec.
-func subjournalPage(tls *libc.TLS, pPg uintptr) int32 { /* sqlite3.c:57108:12: */
+func subjournalPage(tls *libc.TLS, pPg uintptr) int32 { /* sqlite3.c:57124:12: */
var rc int32 = SQLITE_OK
var pPager uintptr = (*PgHdr)(unsafe.Pointer(pPg)).FpPager
if int32((*Pager)(unsafe.Pointer(pPager)).FjournalMode) != PAGER_JOURNALMODE_OFF {
@@ -34660,13 +35251,13 @@ func subjournalPage(tls *libc.TLS, pPg uintptr) int32 { /* sqlite3.c:57108:12: *
// write the journal record into the file.
if rc == SQLITE_OK {
var pData uintptr = (*PgHdr)(unsafe.Pointer(pPg)).FpData
- var offset I64 = (I64((*Pager)(unsafe.Pointer(pPager)).FnSubRec) * (I64(4 + (*Pager)(unsafe.Pointer(pPager)).FpageSize)))
+ var offset I64 = I64((*Pager)(unsafe.Pointer(pPager)).FnSubRec) * (int64(4) + (*Pager)(unsafe.Pointer(pPager)).FpageSize)
var pData2 uintptr
pData2 = pData
rc = write32bits(tls, (*Pager)(unsafe.Pointer(pPager)).Fsjfd, offset, (*PgHdr)(unsafe.Pointer(pPg)).Fpgno)
if rc == SQLITE_OK {
- rc = Xsqlite3OsWrite(tls, (*Pager)(unsafe.Pointer(pPager)).Fsjfd, pData2, (*Pager)(unsafe.Pointer(pPager)).FpageSize, (offset + int64(4)))
+ rc = Xsqlite3OsWrite(tls, (*Pager)(unsafe.Pointer(pPager)).Fsjfd, pData2, int32((*Pager)(unsafe.Pointer(pPager)).FpageSize), offset+int64(4))
}
}
}
@@ -34678,7 +35269,7 @@ func subjournalPage(tls *libc.TLS, pPg uintptr) int32 { /* sqlite3.c:57108:12: *
return rc
}
-func subjournalPageIfRequired(tls *libc.TLS, pPg uintptr) int32 { /* sqlite3.c:57144:12: */
+func subjournalPageIfRequired(tls *libc.TLS, pPg uintptr) int32 { /* sqlite3.c:57160:12: */
if subjRequiresPage(tls, pPg) != 0 {
return subjournalPage(tls, pPg)
} else {
@@ -34704,7 +35295,7 @@ func subjournalPageIfRequired(tls *libc.TLS, pPg uintptr) int32 { /* sqlite3.c:5
// page clean, the IO error code is returned. If the page cannot be
// made clean for some other reason, but no error occurs, then SQLITE_OK
// is returned by sqlite3PcacheMakeClean() is not called.
-func pagerStress(tls *libc.TLS, p uintptr, pPg uintptr) int32 { /* sqlite3.c:57171:12: */
+func pagerStress(tls *libc.TLS, p uintptr, pPg uintptr) int32 { /* sqlite3.c:57187:12: */
var pPager uintptr = p
var rc int32 = SQLITE_OK
@@ -34727,15 +35318,15 @@ func pagerStress(tls *libc.TLS, p uintptr, pPg uintptr) int32 { /* sqlite3.c:571
return SQLITE_OK
}
- if ((*Pager)(unsafe.Pointer(pPager)).FdoNotSpill != 0) &&
- (((int32((*Pager)(unsafe.Pointer(pPager)).FdoNotSpill) & (SPILLFLAG_ROLLBACK | SPILLFLAG_OFF)) != 0) ||
- ((int32((*PgHdr)(unsafe.Pointer(pPg)).Fflags) & PGHDR_NEED_SYNC) != 0)) {
+ if (*Pager)(unsafe.Pointer(pPager)).FdoNotSpill != 0 &&
+ (int32((*Pager)(unsafe.Pointer(pPager)).FdoNotSpill)&(SPILLFLAG_ROLLBACK|SPILLFLAG_OFF) != 0 ||
+ int32((*PgHdr)(unsafe.Pointer(pPg)).Fflags)&PGHDR_NEED_SYNC != 0) {
return SQLITE_OK
}
- *(*int32)(unsafe.Pointer((pPager + 184 /* &.aStat */) + 3*4))++
+ *(*int32)(unsafe.Pointer(pPager + 200 + 3*4))++
(*PgHdr)(unsafe.Pointer(pPg)).FpDirty = uintptr(0)
- if (*Pager)(unsafe.Pointer((pPager))).FpWal != uintptr(0) {
+ if (*Pager)(unsafe.Pointer(pPager)).FpWal != uintptr(0) {
// Write a single frame for this page to the log.
rc = subjournalPageIfRequired(tls, pPg)
if rc == SQLITE_OK {
@@ -34744,8 +35335,8 @@ func pagerStress(tls *libc.TLS, p uintptr, pPg uintptr) int32 { /* sqlite3.c:571
} else {
// Sync the journal file if required.
- if ((int32((*PgHdr)(unsafe.Pointer(pPg)).Fflags) & PGHDR_NEED_SYNC) != 0) ||
- (int32((*Pager)(unsafe.Pointer(pPager)).FeState) == PAGER_WRITER_CACHEMOD) {
+ if int32((*PgHdr)(unsafe.Pointer(pPg)).Fflags)&PGHDR_NEED_SYNC != 0 ||
+ int32((*Pager)(unsafe.Pointer(pPager)).FeState) == PAGER_WRITER_CACHEMOD {
rc = syncJournal(tls, pPager, 1)
}
@@ -34766,12 +35357,12 @@ func pagerStress(tls *libc.TLS, p uintptr, pPg uintptr) int32 { /* sqlite3.c:571
}
// Flush all unreferenced dirty pages to disk.
-func Xsqlite3PagerFlush(tls *libc.TLS, pPager uintptr) int32 { /* sqlite3.c:57248:20: */
+func Xsqlite3PagerFlush(tls *libc.TLS, pPager uintptr) int32 { /* sqlite3.c:57264:20: */
var rc int32 = (*Pager)(unsafe.Pointer(pPager)).FerrCode
if !(int32((*Pager)(unsafe.Pointer(pPager)).FmemDb) != 0) {
var pList uintptr = Xsqlite3PcacheDirtyList(tls, (*Pager)(unsafe.Pointer(pPager)).FpPCache)
- for (rc == SQLITE_OK) && (pList != 0) {
+ for rc == SQLITE_OK && pList != 0 {
var pNext uintptr = (*PgHdr)(unsafe.Pointer(pList)).FpDirty
if int32((*PgHdr)(unsafe.Pointer(pList)).FnRef) == 0 {
rc = pagerStress(tls, pPager, pList)
@@ -34813,11 +35404,12 @@ func Xsqlite3PagerFlush(tls *libc.TLS, pPager uintptr) int32 { /* sqlite3.c:5724
// and error code returned. This function may return SQLITE_NOMEM
// (sqlite3Malloc() is used to allocate memory), SQLITE_CANTOPEN or
// various SQLITE_IO_XXX errors.
-func Xsqlite3PagerOpen(tls *libc.TLS, pVfs uintptr, ppPager uintptr, zFilename uintptr, nExtra int32, flags int32, vfsFlags int32, xReinit uintptr) int32 { /* sqlite3.c:57297:20: */
+func Xsqlite3PagerOpen(tls *libc.TLS, pVfs uintptr, ppPager uintptr, zFilename uintptr, nExtra int32, flags int32, vfsFlags int32, xReinit uintptr) int32 { /* sqlite3.c:57313:20: */
bp := tls.Alloc(12)
defer tls.Free(12)
var pPtr uintptr
+ _ = pPtr
// var pPager uintptr at bp, 4
// Pager object to allocate and return
var rc int32 // Return code
@@ -34846,7 +35438,7 @@ func Xsqlite3PagerOpen(tls *libc.TLS, pVfs uintptr, ppPager uintptr, zFilename u
readOnly = 0
zPathname = uintptr(0)
nPathname = 0
- useJournal = (libc.Bool32((flags & PAGER_OMIT_JOURNAL) == 0))
+ useJournal = libc.Bool32(flags&PAGER_OMIT_JOURNAL == 0)
pcacheSize = Xsqlite3PcacheSize(tls)
*(*U32)(unsafe.Pointer(bp + 8 /* szPageDflt */)) = U32(SQLITE_DEFAULT_PAGE_SIZE)
zUri = uintptr(0)
@@ -34855,16 +35447,16 @@ func Xsqlite3PagerOpen(tls *libc.TLS, pVfs uintptr, ppPager uintptr, zFilename u
// Figure out how much space is required for each journal file-handle
// (there are two of them, the main journal and the sub-journal).
- journalFileSize = (((Xsqlite3JournalSize(tls, pVfs)) + 7) & libc.CplInt32(7))
+ journalFileSize = (Xsqlite3JournalSize(tls, pVfs) + 7) & libc.CplInt32(7)
// Set the output variable to NULL in case an error occurs.
*(*uintptr)(unsafe.Pointer(ppPager)) = uintptr(0)
- if !((flags & PAGER_MEMORY) != 0) {
+ if !(flags&PAGER_MEMORY != 0) {
goto __1
}
memDb = 1
- if !((zFilename != 0) && (*(*uint8)(unsafe.Pointer(zFilename)) != 0)) {
+ if !(zFilename != 0 && *(*uint8)(unsafe.Pointer(zFilename)) != 0) {
goto __2
}
zPathname = Xsqlite3DbStrDup(tls, uintptr(0), zFilename)
@@ -34884,11 +35476,11 @@ __1:
// Compute and store the full pathname in an allocated buffer pointed
// to by zPathname, length nPathname. Or, if this is a temporary file,
// leave both nPathname and zPathname set to 0.
- if !((zFilename != 0) && (*(*uint8)(unsafe.Pointer(zFilename)) != 0)) {
+ if !(zFilename != 0 && *(*uint8)(unsafe.Pointer(zFilename)) != 0) {
goto __4
}
- nPathname = ((*Sqlite3_vfs)(unsafe.Pointer(pVfs)).FmxPathname + 1)
- zPathname = Xsqlite3DbMallocRaw(tls, uintptr(0), (uint64(nPathname * 2)))
+ nPathname = (*Sqlite3_vfs)(unsafe.Pointer(pVfs)).FmxPathname + 1
+ zPathname = Xsqlite3DbMallocRaw(tls, uintptr(0), uint64(nPathname*2))
if !(zPathname == uintptr(0)) {
goto __5
}
@@ -34900,13 +35492,13 @@ __5:
if !(rc != SQLITE_OK) {
goto __6
}
- if !(rc == (SQLITE_OK | (int32(2) << 8))) {
+ if !(rc == SQLITE_OK|int32(2)<<8) {
goto __7
}
- if !((vfsFlags & SQLITE_OPEN_NOFOLLOW) != 0) {
+ if !(vfsFlags&SQLITE_OPEN_NOFOLLOW != 0) {
goto __8
}
- rc = (SQLITE_CANTOPEN | (int32(6) << 8))
+ rc = SQLITE_CANTOPEN | int32(6)<<8
goto __9
__8:
rc = SQLITE_OK
@@ -34917,20 +35509,20 @@ __7:
__6:
;
nPathname = Xsqlite3Strlen30(tls, zPathname)
- z = libc.AssignUintptr(&zUri, (zFilename + uintptr((Xsqlite3Strlen30(tls, zFilename) + 1))))
+ z = libc.AssignUintptr(&zUri, zFilename+uintptr(Xsqlite3Strlen30(tls, zFilename)+1))
__10:
if !(*(*uint8)(unsafe.Pointer(z)) != 0) {
goto __11
}
- z += (uintptr(libc.Xstrlen(tls, z) + Size_t(1)))
- z += (uintptr(libc.Xstrlen(tls, z) + Size_t(1)))
+ z += uintptr(libc.Xstrlen(tls, z) + Size_t(1))
+ z += uintptr(libc.Xstrlen(tls, z) + Size_t(1))
nUri++
goto __10
__11:
;
- nUriByte = ((int32((z + 1)) - int32(zUri)) / 1)
+ nUriByte = (int32(z+1) - int32(zUri)) / 1
- if !((rc == SQLITE_OK) && ((nPathname + 8) > (*Sqlite3_vfs)(unsafe.Pointer(pVfs)).FmxPathname)) {
+ if !(rc == SQLITE_OK && nPathname+8 > (*Sqlite3_vfs)(unsafe.Pointer(pVfs)).FmxPathname) {
goto __12
}
// This branch is taken when the journal path required by
@@ -34938,7 +35530,7 @@ __11:
// bytes in length. This means the database cannot be opened,
// as it will not be possible to open the journal file or even
// check for a hot-journal before reading.
- rc = Xsqlite3CantopenError(tls, 57384)
+ rc = Xsqlite3CantopenError(tls, 57400)
__12:
;
if !(rc != SQLITE_OK) {
@@ -34995,9 +35587,9 @@ __4:
// specific formatting and order of the various filenames, so if the format
// changes here, be sure to change it there as well.
pPtr = Xsqlite3MallocZero(tls,
- (uint64((((((((((((((((((uint32(unsafe.Sizeof(Pager{}))) + uint32(7)) & libc.Uint32FromInt32(libc.CplInt32(7))) + (uint32(((pcacheSize) + 7) & libc.CplInt32(7)))) + (uint32((((*Sqlite3_vfs)(unsafe.Pointer(pVfs)).FszOsFile) + 7) & libc.CplInt32(7)))) + (uint32(journalFileSize * 2))) + uint32(unsafe.Sizeof(uintptr(0)))) + uint32(4)) + uint32(nPathname)) + uint32(1)) + uint32(nUriByte)) + uint32(nPathname)) + uint32(8)) + uint32(1)) + uint32(nPathname)) + uint32(4)) + uint32(1)) + uint32(3))))
+ uint64((uint32(unsafe.Sizeof(Pager{}))+uint32(7))&libc.Uint32FromInt32(libc.CplInt32(7))+uint32((pcacheSize+7)&libc.CplInt32(7))+uint32(((*Sqlite3_vfs)(unsafe.Pointer(pVfs)).FszOsFile+7)&libc.CplInt32(7))+uint32(journalFileSize*2)+uint32(unsafe.Sizeof(uintptr(0)))+uint32(4)+uint32(nPathname)+uint32(1)+uint32(nUriByte)+uint32(nPathname)+uint32(8)+uint32(1)+uint32(nPathname)+uint32(4)+uint32(1)+uint32(3)))
- if !(!(pPtr != 0)) {
+ if !!(pPtr != 0) {
goto __14
}
Xsqlite3DbFree(tls, uintptr(0), zPathname)
@@ -35005,11 +35597,11 @@ __4:
__14:
;
*(*uintptr)(unsafe.Pointer(bp /* pPager */)) = pPtr
- pPtr += (uintptr(((uint32(unsafe.Sizeof(Pager{}))) + uint32(7)) & libc.Uint32FromInt32(libc.CplInt32(7))))
+ pPtr += uintptr((uint32(unsafe.Sizeof(Pager{})) + uint32(7)) & libc.Uint32FromInt32(libc.CplInt32(7)))
(*Pager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* pPager */)))).FpPCache = pPtr
- pPtr += (uintptr(((pcacheSize) + 7) & libc.CplInt32(7)))
+ pPtr += uintptr((pcacheSize + 7) & libc.CplInt32(7))
(*Pager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* pPager */)))).Ffd = pPtr
- pPtr += (uintptr((((*Sqlite3_vfs)(unsafe.Pointer(pVfs)).FszOsFile) + 7) & libc.CplInt32(7)))
+ pPtr += uintptr(((*Sqlite3_vfs)(unsafe.Pointer(pVfs)).FszOsFile + 7) & libc.CplInt32(7))
(*Pager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* pPager */)))).Fsjfd = pPtr
pPtr += uintptr(journalFileSize)
(*Pager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* pPager */)))).Fjfd = pPtr
@@ -35025,7 +35617,7 @@ __14:
goto __15
}
libc.Xmemcpy(tls, pPtr, zPathname, uint32(nPathname))
- pPtr += (uintptr(nPathname + 1))
+ pPtr += uintptr(nPathname + 1)
if !(zUri != 0) {
goto __16
}
@@ -35046,8 +35638,8 @@ __15:
(*Pager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* pPager */)))).FzJournal = pPtr
libc.Xmemcpy(tls, pPtr, zPathname, uint32(nPathname))
pPtr += uintptr(nPathname)
- libc.Xmemcpy(tls, pPtr, ts+3048 /* "-journal" */, uint32(8))
- pPtr += (uintptr(8 + 1))
+ libc.Xmemcpy(tls, pPtr, ts+3859 /* "-journal" */, uint32(8))
+ pPtr += uintptr(8 + 1)
goto __19
__18:
(*Pager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* pPager */)))).FzJournal = uintptr(0)
@@ -35061,13 +35653,14 @@ __19:
(*Pager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* pPager */)))).FzWal = pPtr
libc.Xmemcpy(tls, pPtr, zPathname, uint32(nPathname))
pPtr += uintptr(nPathname)
- libc.Xmemcpy(tls, pPtr, ts+3057 /* "-wal" */, uint32(4))
- pPtr += (uintptr(4 + 1))
+ libc.Xmemcpy(tls, pPtr, ts+3868 /* "-wal" */, uint32(4))
+ pPtr += uintptr(4 + 1)
goto __21
__20:
(*Pager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* pPager */)))).FzWal = uintptr(0)
__21:
;
+ _ = pPtr // Suppress warning about unused pPtr value
if !(nPathname != 0) {
goto __22
@@ -35079,14 +35672,14 @@ __22:
(*Pager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* pPager */)))).FvfsFlags = U32(vfsFlags)
// Open the pager file.
- if !((zFilename != 0) && (*(*uint8)(unsafe.Pointer(zFilename)) != 0)) {
+ if !(zFilename != 0 && *(*uint8)(unsafe.Pointer(zFilename)) != 0) {
goto __23
}
*(*int32)(unsafe.Pointer(bp + 4 /* fout */)) = 0 // VFS flags returned by xOpen()
rc = Xsqlite3OsOpen(tls, pVfs, (*Pager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* pPager */)))).FzFilename, (*Pager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* pPager */)))).Ffd, vfsFlags, bp+4 /* &fout */)
- memJM = (libc.Bool32((*(*int32)(unsafe.Pointer(bp + 4 /* fout */)) & SQLITE_OPEN_MEMORY) != 0))
- readOnly = (libc.Bool32((*(*int32)(unsafe.Pointer(bp + 4 /* fout */)) & SQLITE_OPEN_READONLY) != 0))
+ (*Pager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* pPager */)))).FmemVfs = U8(libc.AssignInt32(&memJM, libc.Bool32(*(*int32)(unsafe.Pointer(bp + 4))&SQLITE_OPEN_MEMORY != 0)))
+ readOnly = libc.Bool32(*(*int32)(unsafe.Pointer(bp + 4))&SQLITE_OPEN_READONLY != 0)
// If the file was successfully opened for read/write access,
// choose a default page size in case we have to create the
@@ -35099,15 +35692,15 @@ __22:
goto __25
}
iDc = Xsqlite3OsDeviceCharacteristics(tls, (*Pager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* pPager */)))).Ffd)
- if !(!(readOnly != 0)) {
+ if !!(readOnly != 0) {
goto __26
}
setSectorSize(tls, *(*uintptr)(unsafe.Pointer(bp /* pPager */)))
- if !(*(*U32)(unsafe.Pointer(bp + 8 /* szPageDflt */)) < (*Pager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* pPager */)))).FsectorSize) {
+ if !(*(*U32)(unsafe.Pointer(bp + 8)) < (*Pager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FsectorSize) {
goto __27
}
- if !((*Pager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* pPager */)))).FsectorSize > U32(SQLITE_MAX_DEFAULT_PAGE_SIZE)) {
+ if !((*Pager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FsectorSize > U32(SQLITE_MAX_DEFAULT_PAGE_SIZE)) {
goto __28
}
*(*U32)(unsafe.Pointer(bp + 8 /* szPageDflt */)) = U32(SQLITE_MAX_DEFAULT_PAGE_SIZE)
@@ -35120,12 +35713,12 @@ __27:
;
__26:
;
- (*Pager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* pPager */)))).FnoLock = U8(Xsqlite3_uri_boolean(tls, (*Pager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* pPager */)))).FzFilename, ts+3062 /* "nolock" */, 0))
- if !(((iDc & SQLITE_IOCAP_IMMUTABLE) != 0) ||
- (Xsqlite3_uri_boolean(tls, (*Pager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* pPager */)))).FzFilename, ts+3069 /* "immutable" */, 0) != 0)) {
+ (*Pager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* pPager */)))).FnoLock = U8(Xsqlite3_uri_boolean(tls, (*Pager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* pPager */)))).FzFilename, ts+3873 /* "nolock" */, 0))
+ if !(iDc&SQLITE_IOCAP_IMMUTABLE != 0 ||
+ Xsqlite3_uri_boolean(tls, (*Pager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FzFilename, ts+3880, 0) != 0) {
goto __30
}
- vfsFlags = vfsFlags | (SQLITE_OPEN_READONLY)
+ vfsFlags = vfsFlags | SQLITE_OPEN_READONLY
goto act_like_temp_file
__30:
;
@@ -35147,7 +35740,7 @@ act_like_temp_file:
(*Pager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* pPager */)))).FeState = U8(PAGER_READER) // Pretend we already have a lock
(*Pager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* pPager */)))).FeLock = U8(EXCLUSIVE_LOCK) // Pretend we are in EXCLUSIVE mode
(*Pager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* pPager */)))).FnoLock = U8(1) // Do no locking
- readOnly = (vfsFlags & SQLITE_OPEN_READONLY)
+ readOnly = vfsFlags & SQLITE_OPEN_READONLY
__24:
;
@@ -35166,7 +35759,7 @@ __31:
if !(rc == SQLITE_OK) {
goto __32
}
- nExtra = (((nExtra) + 7) & libc.CplInt32(7))
+ nExtra = (nExtra + 7) & libc.CplInt32(7)
rc = Xsqlite3PcacheOpen(tls, int32(*(*U32)(unsafe.Pointer(bp + 8 /* szPageDflt */))), nExtra, libc.BoolInt32(!(memDb != 0)),
func() uintptr {
@@ -35209,7 +35802,7 @@ __33:
(*Pager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* pPager */)))).FreadOnly = U8(readOnly)
(*Pager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* pPager */)))).FnoSync = (*Pager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* pPager */)))).FtempFile
- if !((*Pager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* pPager */)))).FnoSync != 0) {
+ if !((*Pager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FnoSync != 0) {
goto __34
}
@@ -35218,7 +35811,7 @@ __34:
(*Pager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* pPager */)))).FfullSync = U8(1)
(*Pager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* pPager */)))).FextraSync = U8(0)
(*Pager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* pPager */)))).FsyncFlags = U8(SQLITE_SYNC_NORMAL)
- (*Pager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* pPager */)))).FwalSyncFlags = (U8(SQLITE_SYNC_NORMAL | (int32(SQLITE_SYNC_NORMAL) << 2)))
+ (*Pager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* pPager */)))).FwalSyncFlags = U8(SQLITE_SYNC_NORMAL | int32(SQLITE_SYNC_NORMAL)<<2)
__35:
;
// pPager->pFirst = 0;
@@ -35228,13 +35821,13 @@ __35:
(*Pager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* pPager */)))).FjournalSizeLimit = int64(-1)
setSectorSize(tls, *(*uintptr)(unsafe.Pointer(bp /* pPager */)))
- if !(!(useJournal != 0)) {
+ if !!(useJournal != 0) {
goto __36
}
(*Pager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* pPager */)))).FjournalMode = U8(PAGER_JOURNALMODE_OFF)
goto __37
__36:
- if !((memDb != 0) || (memJM != 0)) {
+ if !(memDb != 0 || memJM != 0) {
goto __38
}
(*Pager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* pPager */)))).FjournalMode = U8(PAGER_JOURNALMODE_MEMORY)
@@ -35256,12 +35849,12 @@ __37:
// Return the sqlite3_file for the main database given the name
// of the corresonding WAL or Journal name as passed into
// xOpen.
-func Xsqlite3_database_file_object(tls *libc.TLS, zName uintptr) uintptr { /* sqlite3.c:57668:25: */
+func Xsqlite3_database_file_object(tls *libc.TLS, zName uintptr) uintptr { /* sqlite3.c:57685:25: */
var pPager uintptr
- for (((int32(*(*uint8)(unsafe.Pointer(zName + libc.UintptrFromInt32(-1)))) != 0) || (int32(*(*uint8)(unsafe.Pointer(zName + libc.UintptrFromInt32(-2)))) != 0)) || (int32(*(*uint8)(unsafe.Pointer(zName + libc.UintptrFromInt32(-3)))) != 0)) || (int32(*(*uint8)(unsafe.Pointer(zName + libc.UintptrFromInt32(-4)))) != 0) {
+ for int32(*(*uint8)(unsafe.Pointer(zName + libc.UintptrFromInt32(-1)))) != 0 || int32(*(*uint8)(unsafe.Pointer(zName + libc.UintptrFromInt32(-2)))) != 0 || int32(*(*uint8)(unsafe.Pointer(zName + libc.UintptrFromInt32(-3)))) != 0 || int32(*(*uint8)(unsafe.Pointer(zName + libc.UintptrFromInt32(-4)))) != 0 {
zName--
}
- pPager = *(*uintptr)(unsafe.Pointer(((zName - uintptr(4)) - uintptr(uint32(unsafe.Sizeof(uintptr(0)))))))
+ pPager = *(*uintptr)(unsafe.Pointer(zName - uintptr(4) - uintptr(uint32(unsafe.Sizeof(uintptr(0))))))
return (*Pager)(unsafe.Pointer(pPager)).Ffd
}
@@ -35294,20 +35887,20 @@ func Xsqlite3_database_file_object(tls *libc.TLS, zName uintptr) uintptr { /* sq
// set to 0 and SQLITE_OK returned. If an IO error occurs while trying
// to determine whether or not a hot-journal file exists, the IO error
// code is returned and the value of *pExists is undefined.
-func hasHotJournal(tls *libc.TLS, pPager uintptr, pExists uintptr) int32 { /* sqlite3.c:57709:12: */
+func hasHotJournal(tls *libc.TLS, pPager uintptr, pExists uintptr) int32 { /* sqlite3.c:57726:12: */
bp := tls.Alloc(17)
defer tls.Free(17)
var pVfs uintptr = (*Pager)(unsafe.Pointer(pPager)).FpVfs
var rc int32 = SQLITE_OK // Return code
*(*int32)(unsafe.Pointer(bp /* exists */)) = 1 // True if a journal file is present
- var jrnlOpen int32 = libc.BoolInt32(!(!((*Sqlite3_file)(unsafe.Pointer(((*Pager)(unsafe.Pointer(pPager)).Fjfd))).FpMethods != uintptr(0))))
+ var jrnlOpen int32 = libc.BoolInt32(!!((*Sqlite3_file)(unsafe.Pointer((*Pager)(unsafe.Pointer(pPager)).Fjfd)).FpMethods != uintptr(0)))
*(*int32)(unsafe.Pointer(pExists)) = 0
if !(jrnlOpen != 0) {
rc = Xsqlite3OsAccess(tls, pVfs, (*Pager)(unsafe.Pointer(pPager)).FzJournal, SQLITE_ACCESS_EXISTS, bp /* &exists */)
}
- if (rc == SQLITE_OK) && (*(*int32)(unsafe.Pointer(bp /* exists */)) != 0) {
+ if rc == SQLITE_OK && *(*int32)(unsafe.Pointer(bp)) != 0 {
*(*int32)(unsafe.Pointer(bp + 4 /* locked */)) = 0 // True if some process holds a RESERVED lock
// Race condition here: Another process might have been holding the
@@ -35318,7 +35911,7 @@ func hasHotJournal(tls *libc.TLS, pPager uintptr, pExists uintptr) int32 { /* sq
// in fact there is none. This results in a false-positive which will
// be dealt with by the playback routine. Ticket #3883.
rc = Xsqlite3OsCheckReservedLock(tls, (*Pager)(unsafe.Pointer(pPager)).Ffd, bp+4 /* &locked */)
- if (rc == SQLITE_OK) && !(*(*int32)(unsafe.Pointer(bp + 4 /* locked */)) != 0) {
+ if rc == SQLITE_OK && !(*(*int32)(unsafe.Pointer(bp + 4)) != 0) {
// var nPage Pgno at bp+8, 4
// Number of pages in database file
@@ -35331,7 +35924,7 @@ func hasHotJournal(tls *libc.TLS, pPager uintptr, pExists uintptr) int32 { /* sq
// In either case, the journal file can be deleted. However, take care
// not to delete the journal file if it is already open due to
// journal_mode=PERSIST.
- if (*(*Pgno)(unsafe.Pointer(bp + 8 /* nPage */)) == Pgno(0)) && !(jrnlOpen != 0) {
+ if *(*Pgno)(unsafe.Pointer(bp + 8)) == Pgno(0) && !(jrnlOpen != 0) {
Xsqlite3BeginBenignMalloc(tls)
if pagerLockDb(tls, pPager, RESERVED_LOCK) == SQLITE_OK {
Xsqlite3OsDelete(tls, pVfs, (*Pager)(unsafe.Pointer(pPager)).FzJournal, 0)
@@ -35347,19 +35940,19 @@ func hasHotJournal(tls *libc.TLS, pPager uintptr, pExists uintptr) int32 { /* sq
// If there is, then we consider this journal to be hot. If not,
// it can be ignored.
if !(jrnlOpen != 0) {
- *(*int32)(unsafe.Pointer(bp + 12 /* f */)) = (SQLITE_OPEN_READONLY | SQLITE_OPEN_MAIN_JOURNAL)
+ *(*int32)(unsafe.Pointer(bp + 12 /* f */)) = SQLITE_OPEN_READONLY | SQLITE_OPEN_MAIN_JOURNAL
rc = Xsqlite3OsOpen(tls, pVfs, (*Pager)(unsafe.Pointer(pPager)).FzJournal, (*Pager)(unsafe.Pointer(pPager)).Fjfd, *(*int32)(unsafe.Pointer(bp + 12 /* f */)), bp+12 /* &f */)
}
if rc == SQLITE_OK {
*(*U8)(unsafe.Pointer(bp + 16 /* first */)) = U8(0)
rc = Xsqlite3OsRead(tls, (*Pager)(unsafe.Pointer(pPager)).Fjfd, bp+16 /* &first */, 1, int64(0))
- if rc == (SQLITE_IOERR | (int32(2) << 8)) {
+ if rc == SQLITE_IOERR|int32(2)<<8 {
rc = SQLITE_OK
}
if !(jrnlOpen != 0) {
Xsqlite3OsClose(tls, (*Pager)(unsafe.Pointer(pPager)).Fjfd)
}
- *(*int32)(unsafe.Pointer(pExists)) = (libc.Bool32(int32(*(*U8)(unsafe.Pointer(bp + 16 /* first */))) != 0))
+ *(*int32)(unsafe.Pointer(pExists)) = libc.Bool32(int32(*(*U8)(unsafe.Pointer(bp + 16))) != 0)
} else if rc == SQLITE_CANTOPEN {
// If we cannot open the rollback journal file in order to see if
// it has a zero header, that might be due to an I/O error, or
@@ -35405,7 +35998,7 @@ func hasHotJournal(tls *libc.TLS, pPager uintptr, pExists uintptr) int32 { /* sq
// If everything is successful, SQLITE_OK is returned. If an IO error
// occurs while locking the database, checking for a hot-journal file or
// rolling back a journal file, the IO error code is returned.
-func Xsqlite3PagerSharedLock(tls *libc.TLS, pPager uintptr) int32 { /* sqlite3.c:57829:20: */
+func Xsqlite3PagerSharedLock(tls *libc.TLS, pPager uintptr) int32 { /* sqlite3.c:57846:20: */
bp := tls.Alloc(28)
defer tls.Free(28)
@@ -35441,7 +36034,7 @@ func Xsqlite3PagerSharedLock(tls *libc.TLS, pPager uintptr) int32 { /* sqlite3.c
// be OPEN or READER. READER is only possible if the pager is or was in
// exclusive access mode.
- if !(!((*Pager)(unsafe.Pointer((pPager))).FpWal != uintptr(0)) && (int32((*Pager)(unsafe.Pointer(pPager)).FeState) == PAGER_OPEN)) {
+ if !(!((*Pager)(unsafe.Pointer(pPager)).FpWal != uintptr(0)) && int32((*Pager)(unsafe.Pointer(pPager)).FeState) == PAGER_OPEN) {
goto __1
}
*(*int32)(unsafe.Pointer(bp /* bHotJournal */)) = 1 // True if there exists a hot journal-file
@@ -35469,13 +36062,13 @@ __3:
goto failed
__4:
;
- if !(*(*int32)(unsafe.Pointer(bp /* bHotJournal */)) != 0) {
+ if !(*(*int32)(unsafe.Pointer(bp)) != 0) {
goto __5
}
if !((*Pager)(unsafe.Pointer(pPager)).FreadOnly != 0) {
goto __6
}
- rc = (SQLITE_READONLY | (int32(3) << 8))
+ rc = SQLITE_READONLY | int32(3)<<8
goto failed
__6:
;
@@ -35514,24 +36107,24 @@ __7:
// this connection obtained the exclusive lock above. Or, it
// may mean that the pager was in the error-state when this
// function was called and the journal file does not exist.
- if !(!((*Sqlite3_file)(unsafe.Pointer(((*Pager)(unsafe.Pointer(pPager)).Fjfd))).FpMethods != uintptr(0))) {
+ if !!((*Sqlite3_file)(unsafe.Pointer((*Pager)(unsafe.Pointer(pPager)).Fjfd)).FpMethods != uintptr(0)) {
goto __8
}
pVfs = (*Pager)(unsafe.Pointer(pPager)).FpVfs // True if journal file exists
rc = Xsqlite3OsAccess(tls,
pVfs, (*Pager)(unsafe.Pointer(pPager)).FzJournal, SQLITE_ACCESS_EXISTS, bp+4 /* &bExists */)
- if !((rc == SQLITE_OK) && (*(*int32)(unsafe.Pointer(bp + 4 /* bExists */)) != 0)) {
+ if !(rc == SQLITE_OK && *(*int32)(unsafe.Pointer(bp + 4)) != 0) {
goto __9
}
*(*int32)(unsafe.Pointer(bp + 8 /* fout */)) = 0
- f = (SQLITE_OPEN_READWRITE | SQLITE_OPEN_MAIN_JOURNAL)
+ f = SQLITE_OPEN_READWRITE | SQLITE_OPEN_MAIN_JOURNAL
rc = Xsqlite3OsOpen(tls, pVfs, (*Pager)(unsafe.Pointer(pPager)).FzJournal, (*Pager)(unsafe.Pointer(pPager)).Fjfd, f, bp+8 /* &fout */)
- if !((rc == SQLITE_OK) && ((*(*int32)(unsafe.Pointer(bp + 8 /* fout */)) & SQLITE_OPEN_READONLY) != 0)) {
+ if !(rc == SQLITE_OK && *(*int32)(unsafe.Pointer(bp + 8))&SQLITE_OPEN_READONLY != 0) {
goto __10
}
- rc = Xsqlite3CantopenError(tls, 57913)
+ rc = Xsqlite3CantopenError(tls, 57930)
Xsqlite3OsClose(tls, (*Pager)(unsafe.Pointer(pPager)).Fjfd)
__10:
;
@@ -35547,7 +36140,7 @@ __8:
// it back since the process that crashed and left the hot journal
// probably did not sync it and we are required to always sync
// the journal before playing it back.
- if !((*Sqlite3_file)(unsafe.Pointer(((*Pager)(unsafe.Pointer(pPager)).Fjfd))).FpMethods != uintptr(0)) {
+ if !((*Sqlite3_file)(unsafe.Pointer((*Pager)(unsafe.Pointer(pPager)).Fjfd)).FpMethods != uintptr(0)) {
goto __11
}
@@ -35561,7 +36154,7 @@ __13:
;
goto __12
__11:
- if !(!(int32((*Pager)(unsafe.Pointer(pPager)).FexclusiveMode) != 0)) {
+ if !!(int32((*Pager)(unsafe.Pointer(pPager)).FexclusiveMode) != 0) {
goto __14
}
pagerUnlockDb(tls, pPager, SHARED_LOCK)
@@ -35596,7 +36189,7 @@ __15:
__5:
;
- if !(!(int32((*Pager)(unsafe.Pointer(pPager)).FtempFile) != 0) && ((*Pager)(unsafe.Pointer(pPager)).FhasHeldSharedLock != 0)) {
+ if !(!(int32((*Pager)(unsafe.Pointer(pPager)).FtempFile) != 0) && (*Pager)(unsafe.Pointer(pPager)).FhasHeldSharedLock != 0) {
goto __16
}
@@ -35604,7 +36197,7 @@ __5:
if !(rc != SQLITE_OK) {
goto __17
}
- if !(rc != (SQLITE_IOERR | (int32(2) << 8))) {
+ if !(rc != SQLITE_IOERR|int32(2)<<8) {
goto __18
}
goto failed
@@ -35614,7 +36207,7 @@ __18:
__17:
;
- if !(libc.Xmemcmp(tls, pPager+104 /* &.dbFileVers */, bp+12 /* &dbFileVers[0] */, uint32(unsafe.Sizeof([16]uint8{}))) != 0) {
+ if !(libc.Xmemcmp(tls, pPager+112, bp+12, uint32(unsafe.Sizeof([16]uint8{}))) != 0) {
goto __19
}
pager_reset(tls, pPager)
@@ -35643,7 +36236,7 @@ __16:
__1:
;
- if !((*Pager)(unsafe.Pointer((pPager))).FpWal != uintptr(0)) {
+ if !((*Pager)(unsafe.Pointer(pPager)).FpWal != uintptr(0)) {
goto __21
}
@@ -35651,10 +36244,10 @@ __1:
__21:
;
- if !(((int32((*Pager)(unsafe.Pointer(pPager)).FtempFile) == 0) && (int32((*Pager)(unsafe.Pointer(pPager)).FeState) == PAGER_OPEN)) && (rc == SQLITE_OK)) {
+ if !(int32((*Pager)(unsafe.Pointer(pPager)).FtempFile) == 0 && int32((*Pager)(unsafe.Pointer(pPager)).FeState) == PAGER_OPEN && rc == SQLITE_OK) {
goto __22
}
- rc = pagerPagecount(tls, pPager, (pPager + 24 /* &.dbSize */))
+ rc = pagerPagecount(tls, pPager, pPager+28)
__22:
;
@@ -35680,7 +36273,7 @@ __24:
// Except, in locking_mode=EXCLUSIVE when there is nothing to in
// the rollback journal, the unlock is not performed and there is
// nothing to rollback, so this routine is a no-op.
-func pagerUnlockIfUnused(tls *libc.TLS, pPager uintptr) { /* sqlite3.c:58046:13: */
+func pagerUnlockIfUnused(tls *libc.TLS, pPager uintptr) { /* sqlite3.c:58063:13: */
if Xsqlite3PcacheRefCount(tls, (*Pager)(unsafe.Pointer(pPager)).FpPCache) == 0 {
// because page1 is never memory mapped
pagerUnlockAndRollback(tls, pPager)
@@ -35742,7 +36335,7 @@ func pagerUnlockIfUnused(tls *libc.TLS, pPager uintptr) { /* sqlite3.c:58046:13:
// has to go to disk, and could also playback an old journal if necessary.
// Since Lookup() never goes to disk, it never has to deal with locks
// or journal files.
-func getPageNormal(tls *libc.TLS, pPager uintptr, pgno Pgno, ppPage uintptr, flags int32) int32 { /* sqlite3.c:58110:12: */
+func getPageNormal(tls *libc.TLS, pPager uintptr, pgno Pgno, ppPage uintptr, flags int32) int32 { /* sqlite3.c:58127:12: */
bp := tls.Alloc(4)
defer tls.Free(4)
@@ -35755,11 +36348,11 @@ func getPageNormal(tls *libc.TLS, pPager uintptr, pgno Pgno, ppPage uintptr, fla
if !(pgno == Pgno(0)) {
goto __1
}
- return Xsqlite3CorruptError(tls, 58126)
+ return Xsqlite3CorruptError(tls, 58143)
__1:
;
*(*uintptr)(unsafe.Pointer(bp /* pBase */)) = Xsqlite3PcacheFetch(tls, (*Pager)(unsafe.Pointer(pPager)).FpPCache, pgno, 3)
- if !(*(*uintptr)(unsafe.Pointer(bp /* pBase */)) == uintptr(0)) {
+ if !(*(*uintptr)(unsafe.Pointer(bp)) == uintptr(0)) {
goto __2
}
pPg = uintptr(0)
@@ -35770,7 +36363,7 @@ __1:
goto pager_acquire_err
__3:
;
- if !(*(*uintptr)(unsafe.Pointer(bp /* pBase */)) == uintptr(0)) {
+ if !(*(*uintptr)(unsafe.Pointer(bp)) == uintptr(0)) {
goto __4
}
rc = SQLITE_NOMEM
@@ -35781,14 +36374,14 @@ __2:
;
pPg = libc.AssignPtrUintptr(ppPage, Xsqlite3PcacheFetchFinish(tls, (*Pager)(unsafe.Pointer(pPager)).FpPCache, pgno, *(*uintptr)(unsafe.Pointer(bp /* pBase */))))
- noContent = (U8(libc.Bool32((flags & PAGER_GET_NOCONTENT) != 0)))
- if !(((*PgHdr)(unsafe.Pointer(pPg)).FpPager != 0) && !(noContent != 0)) {
+ noContent = U8(libc.Bool32(flags&PAGER_GET_NOCONTENT != 0))
+ if !((*PgHdr)(unsafe.Pointer(pPg)).FpPager != 0 && !(noContent != 0)) {
goto __5
}
// In this case the pcache already contains an initialized copy of
// the page. Return without further ado.
- *(*int32)(unsafe.Pointer((pPager + 184 /* &.aStat */)))++
+ *(*int32)(unsafe.Pointer(pPager + 200))++
return SQLITE_OK
goto __6
@@ -35798,17 +36391,17 @@ __5:
//
// (*) obsolete. Was: maximum page number is 2^31
// (2) Never try to fetch the locking page
- if !(pgno == (Pgno((Xsqlite3PendingByte / ((*Pager)(unsafe.Pointer(pPager)).FpageSize)) + 1))) {
+ if !(pgno == Pgno(I64(Xsqlite3PendingByte)/(*Pager)(unsafe.Pointer(pPager)).FpageSize+int64(1))) {
goto __7
}
- rc = Xsqlite3CorruptError(tls, 58158)
+ rc = Xsqlite3CorruptError(tls, 58175)
goto pager_acquire_err
__7:
;
(*PgHdr)(unsafe.Pointer(pPg)).FpPager = pPager
- if !((!((*Sqlite3_file)(unsafe.Pointer(((*Pager)(unsafe.Pointer(pPager)).Ffd))).FpMethods != uintptr(0)) || ((*Pager)(unsafe.Pointer(pPager)).FdbSize < pgno)) || (noContent != 0)) {
+ if !(!((*Sqlite3_file)(unsafe.Pointer((*Pager)(unsafe.Pointer(pPager)).Ffd)).FpMethods != uintptr(0)) || (*Pager)(unsafe.Pointer(pPager)).FdbSize < pgno || noContent != 0) {
goto __8
}
if !(pgno > (*Pager)(unsafe.Pointer(pPager)).FmxPgno) {
@@ -35844,7 +36437,7 @@ __11:
goto __9
__8:
;
- *(*int32)(unsafe.Pointer((pPager + 184 /* &.aStat */) + 1*4))++
+ *(*int32)(unsafe.Pointer(pPager + 200 + 1*4))++
rc = readDbPage(tls, pPg)
if !(rc != SQLITE_OK) {
goto __13
@@ -35873,7 +36466,7 @@ __14:
}
// The page getter for when memory-mapped I/O is enabled
-func getPageMMap(tls *libc.TLS, pPager uintptr, pgno Pgno, ppPage uintptr, flags int32) int32 { /* sqlite3.c:58212:12: */
+func getPageMMap(tls *libc.TLS, pPager uintptr, pgno Pgno, ppPage uintptr, flags int32) int32 { /* sqlite3.c:58229:12: */
bp := tls.Alloc(12)
defer tls.Free(12)
@@ -35885,38 +36478,38 @@ func getPageMMap(tls *libc.TLS, pPager uintptr, pgno Pgno, ppPage uintptr, flags
// page 1 if there is no write-transaction open or the ACQUIRE_READONLY
// flag was specified by the caller. And so long as the db is not a
// temporary or in-memory database.
- var bMmapOk int32 = (libc.Bool32((pgno > Pgno(1)) &&
- ((int32((*Pager)(unsafe.Pointer(pPager)).FeState) == PAGER_READER) || ((flags & PAGER_GET_READONLY) != 0))))
+ var bMmapOk int32 = libc.Bool32(pgno > Pgno(1) &&
+ (int32((*Pager)(unsafe.Pointer(pPager)).FeState) == PAGER_READER || flags&PAGER_GET_READONLY != 0))
// Optimization note: Adding the "pgno<=1" term before "pgno==0" here
// allows the compiler optimizer to reuse the results of the "pgno>1"
// test in the previous statement, and avoid testing pgno==0 in the
// common case where pgno is large.
- if (pgno <= Pgno(1)) && (pgno == Pgno(0)) {
- return Xsqlite3CorruptError(tls, 58237)
+ if pgno <= Pgno(1) && pgno == Pgno(0) {
+ return Xsqlite3CorruptError(tls, 58254)
}
- if (bMmapOk != 0) && ((*Pager)(unsafe.Pointer((pPager))).FpWal != uintptr(0)) {
+ if bMmapOk != 0 && (*Pager)(unsafe.Pointer(pPager)).FpWal != uintptr(0) {
rc = Xsqlite3WalFindFrame(tls, (*Pager)(unsafe.Pointer(pPager)).FpWal, pgno, bp /* &iFrame */)
if rc != SQLITE_OK {
*(*uintptr)(unsafe.Pointer(ppPage)) = uintptr(0)
return rc
}
}
- if (bMmapOk != 0) && (*(*U32)(unsafe.Pointer(bp /* iFrame */)) == U32(0)) {
+ if bMmapOk != 0 && *(*U32)(unsafe.Pointer(bp)) == U32(0) {
*(*uintptr)(unsafe.Pointer(bp + 4 /* pData */)) = uintptr(0)
rc = Xsqlite3OsFetch(tls, (*Pager)(unsafe.Pointer(pPager)).Ffd,
- ((I64(pgno - Pgno(1))) * I64((*Pager)(unsafe.Pointer(pPager)).FpageSize)), (*Pager)(unsafe.Pointer(pPager)).FpageSize, bp+4 /* &pData */)
- if (rc == SQLITE_OK) && (*(*uintptr)(unsafe.Pointer(bp + 4 /* pData */)) != 0) {
- if (int32((*Pager)(unsafe.Pointer(pPager)).FeState) > PAGER_READER) || ((*Pager)(unsafe.Pointer(pPager)).FtempFile != 0) {
+ I64(pgno-Pgno(1))*(*Pager)(unsafe.Pointer(pPager)).FpageSize, int32((*Pager)(unsafe.Pointer(pPager)).FpageSize), bp+4 /* &pData */)
+ if rc == SQLITE_OK && *(*uintptr)(unsafe.Pointer(bp + 4)) != 0 {
+ if int32((*Pager)(unsafe.Pointer(pPager)).FeState) > PAGER_READER || (*Pager)(unsafe.Pointer(pPager)).FtempFile != 0 {
*(*uintptr)(unsafe.Pointer(bp + 8 /* pPg */)) = Xsqlite3PagerLookup(tls, pPager, pgno)
}
- if *(*uintptr)(unsafe.Pointer(bp + 8 /* pPg */)) == uintptr(0) {
+ if *(*uintptr)(unsafe.Pointer(bp + 8)) == uintptr(0) {
rc = pagerAcquireMapPage(tls, pPager, pgno, *(*uintptr)(unsafe.Pointer(bp + 4 /* pData */)), bp+8 /* &pPg */)
} else {
- Xsqlite3OsUnfetch(tls, (*Pager)(unsafe.Pointer(pPager)).Ffd, ((I64(pgno - Pgno(1))) * I64((*Pager)(unsafe.Pointer(pPager)).FpageSize)), *(*uintptr)(unsafe.Pointer(bp + 4 /* pData */)))
+ Xsqlite3OsUnfetch(tls, (*Pager)(unsafe.Pointer(pPager)).Ffd, I64(pgno-Pgno(1))*(*Pager)(unsafe.Pointer(pPager)).FpageSize, *(*uintptr)(unsafe.Pointer(bp + 4 /* pData */)))
}
- if *(*uintptr)(unsafe.Pointer(bp + 8 /* pPg */)) != 0 {
+ if *(*uintptr)(unsafe.Pointer(bp + 8)) != 0 {
*(*uintptr)(unsafe.Pointer(ppPage)) = *(*uintptr)(unsafe.Pointer(bp + 8 /* pPg */))
return SQLITE_OK
@@ -35931,7 +36524,7 @@ func getPageMMap(tls *libc.TLS, pPager uintptr, pgno Pgno, ppPage uintptr, flags
}
// The page getter method for when the pager is an error state
-func getPageError(tls *libc.TLS, pPager uintptr, pgno Pgno, ppPage uintptr, flags int32) int32 { /* sqlite3.c:58281:12: */
+func getPageError(tls *libc.TLS, pPager uintptr, pgno Pgno, ppPage uintptr, flags int32) int32 { /* sqlite3.c:58298:12: */
_ = pgno
_ = flags
@@ -35940,7 +36533,7 @@ func getPageError(tls *libc.TLS, pPager uintptr, pgno Pgno, ppPage uintptr, flag
}
// Dispatch all page fetch requests to the appropriate getter method.
-func Xsqlite3PagerGet(tls *libc.TLS, pPager uintptr, pgno Pgno, ppPage uintptr, flags int32) int32 { /* sqlite3.c:58297:20: */
+func Xsqlite3PagerGet(tls *libc.TLS, pPager uintptr, pgno Pgno, ppPage uintptr, flags int32) int32 { /* sqlite3.c:58314:20: */
return (*struct {
f func(*libc.TLS, uintptr, Pgno, uintptr, int32) int32
})(unsafe.Pointer(&struct{ uintptr }{(*Pager)(unsafe.Pointer(pPager)).FxGet})).f(tls, pPager, pgno, ppPage, flags)
@@ -35955,7 +36548,7 @@ func Xsqlite3PagerGet(tls *libc.TLS, pPager uintptr, pgno Pgno, ppPage uintptr,
// in the page if the page is not already in cache. This routine
// returns NULL if the page is not in cache or if a disk I/O error
// has ever happened.
-func Xsqlite3PagerLookup(tls *libc.TLS, pPager uintptr, pgno Pgno) uintptr { /* sqlite3.c:58317:23: */
+func Xsqlite3PagerLookup(tls *libc.TLS, pPager uintptr, pgno Pgno) uintptr { /* sqlite3.c:58334:23: */
var pPage uintptr
pPage = Xsqlite3PcacheFetch(tls, (*Pager)(unsafe.Pointer(pPager)).FpPCache, pgno, 0)
@@ -35976,9 +36569,9 @@ func Xsqlite3PagerLookup(tls *libc.TLS, pPager uintptr, pgno Pgno) uintptr { /*
// Use sqlite3PagerUnrefPageOne() to release page1. This latter routine
// checks the total number of outstanding pages and if the number of
// pages reaches zero it drops the database lock.
-func Xsqlite3PagerUnrefNotNull(tls *libc.TLS, pPg uintptr) { /* sqlite3.c:58340:21: */
+func Xsqlite3PagerUnrefNotNull(tls *libc.TLS, pPg uintptr) { /* sqlite3.c:58357:21: */
- if (int32((*DbPage)(unsafe.Pointer(pPg)).Fflags) & PGHDR_MMAP) != 0 {
+ if int32((*DbPage)(unsafe.Pointer(pPg)).Fflags)&PGHDR_MMAP != 0 {
// Page1 is never memory mapped
pagerReleaseMapPage(tls, pPg)
} else {
@@ -35988,13 +36581,13 @@ func Xsqlite3PagerUnrefNotNull(tls *libc.TLS, pPg uintptr) { /* sqlite3.c:58340:
}
-func Xsqlite3PagerUnref(tls *libc.TLS, pPg uintptr) { /* sqlite3.c:58352:21: */
+func Xsqlite3PagerUnref(tls *libc.TLS, pPg uintptr) { /* sqlite3.c:58369:21: */
if pPg != 0 {
Xsqlite3PagerUnrefNotNull(tls, pPg)
}
}
-func Xsqlite3PagerUnrefPageOne(tls *libc.TLS, pPg uintptr) { /* sqlite3.c:58355:21: */
+func Xsqlite3PagerUnrefPageOne(tls *libc.TLS, pPg uintptr) { /* sqlite3.c:58372:21: */
var pPager uintptr
// Page1 is never memory mapped
@@ -36023,7 +36616,7 @@ func Xsqlite3PagerUnrefPageOne(tls *libc.TLS, pPg uintptr) { /* sqlite3.c:58355:
// Return SQLITE_OK if everything is successful. Otherwise, return
// SQLITE_NOMEM if the attempt to allocate Pager.pInJournal fails, or
// an IO error code if opening or writing the journal file fails.
-func pager_open_journal(tls *libc.TLS, pPager uintptr) int32 { /* sqlite3.c:58387:12: */
+func pager_open_journal(tls *libc.TLS, pPager uintptr) int32 { /* sqlite3.c:58404:12: */
var rc int32 = SQLITE_OK // Return code
var pVfs uintptr = (*Pager)(unsafe.Pointer(pPager)).FpVfs // Local cache of vfs pointer
@@ -36034,25 +36627,25 @@ func pager_open_journal(tls *libc.TLS, pPager uintptr) int32 { /* sqlite3.c:5838
return (*Pager)(unsafe.Pointer(pPager)).FerrCode
}
- if !((*Pager)(unsafe.Pointer((pPager))).FpWal != uintptr(0)) && (int32((*Pager)(unsafe.Pointer(pPager)).FjournalMode) != PAGER_JOURNALMODE_OFF) {
+ if !((*Pager)(unsafe.Pointer(pPager)).FpWal != uintptr(0)) && int32((*Pager)(unsafe.Pointer(pPager)).FjournalMode) != PAGER_JOURNALMODE_OFF {
(*Pager)(unsafe.Pointer(pPager)).FpInJournal = Xsqlite3BitvecCreate(tls, (*Pager)(unsafe.Pointer(pPager)).FdbSize)
if (*Pager)(unsafe.Pointer(pPager)).FpInJournal == uintptr(0) {
return SQLITE_NOMEM
}
// Open the journal file if it is not already open.
- if !((*Sqlite3_file)(unsafe.Pointer(((*Pager)(unsafe.Pointer(pPager)).Fjfd))).FpMethods != uintptr(0)) {
+ if !((*Sqlite3_file)(unsafe.Pointer((*Pager)(unsafe.Pointer(pPager)).Fjfd)).FpMethods != uintptr(0)) {
if int32((*Pager)(unsafe.Pointer(pPager)).FjournalMode) == PAGER_JOURNALMODE_MEMORY {
Xsqlite3MemJournalOpen(tls, (*Pager)(unsafe.Pointer(pPager)).Fjfd)
} else {
- var flags int32 = (SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE)
+ var flags int32 = SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE
var nSpill int32
if (*Pager)(unsafe.Pointer(pPager)).FtempFile != 0 {
flags = flags | (SQLITE_OPEN_DELETEONCLOSE | SQLITE_OPEN_TEMP_JOURNAL)
nSpill = Xsqlite3Config.FnStmtSpill
} else {
- flags = flags | (SQLITE_OPEN_MAIN_JOURNAL)
+ flags = flags | SQLITE_OPEN_MAIN_JOURNAL
nSpill = jrnlBufferSize(tls, pPager)
}
@@ -36105,7 +36698,7 @@ func pager_open_journal(tls *libc.TLS, pPager uintptr) int32 { /* sqlite3.c:5838
// sub-journal. If the subjInMemory argument is zero, then any required
// sub-journal is implemented in-memory if pPager is an in-memory database,
// or using a temporary file otherwise.
-func Xsqlite3PagerBegin(tls *libc.TLS, pPager uintptr, exFlag int32, subjInMemory int32) int32 { /* sqlite3.c:58476:20: */
+func Xsqlite3PagerBegin(tls *libc.TLS, pPager uintptr, exFlag int32, subjInMemory int32) int32 { /* sqlite3.c:58493:20: */
var rc int32 = SQLITE_OK
if (*Pager)(unsafe.Pointer(pPager)).FerrCode != 0 {
@@ -36116,10 +36709,10 @@ func Xsqlite3PagerBegin(tls *libc.TLS, pPager uintptr, exFlag int32, subjInMemor
if int32((*Pager)(unsafe.Pointer(pPager)).FeState) == PAGER_READER {
- if (*Pager)(unsafe.Pointer((pPager))).FpWal != uintptr(0) {
+ if (*Pager)(unsafe.Pointer(pPager)).FpWal != uintptr(0) {
// If the pager is configured to use locking_mode=exclusive, and an
// exclusive lock on the database is not already held, obtain it now.
- if ((*Pager)(unsafe.Pointer(pPager)).FexclusiveMode != 0) && (Xsqlite3WalExclusiveMode(tls, (*Pager)(unsafe.Pointer(pPager)).FpWal, -1) != 0) {
+ if (*Pager)(unsafe.Pointer(pPager)).FexclusiveMode != 0 && Xsqlite3WalExclusiveMode(tls, (*Pager)(unsafe.Pointer(pPager)).FpWal, -1) != 0 {
rc = pagerLockDb(tls, pPager, EXCLUSIVE_LOCK)
if rc != SQLITE_OK {
return rc
@@ -36138,7 +36731,7 @@ func Xsqlite3PagerBegin(tls *libc.TLS, pPager uintptr, exFlag int32, subjInMemor
// busy-handler callback can be used when upgrading to the EXCLUSIVE
// lock, but not when obtaining the RESERVED lock.
rc = pagerLockDb(tls, pPager, RESERVED_LOCK)
- if (rc == SQLITE_OK) && (exFlag != 0) {
+ if rc == SQLITE_OK && exFlag != 0 {
rc = pager_wait_on_lock(tls, pPager, EXCLUSIVE_LOCK)
}
}
@@ -36165,7 +36758,7 @@ func Xsqlite3PagerBegin(tls *libc.TLS, pPager uintptr, exFlag int32, subjInMemor
}
// Write page pPg onto the end of the rollback journal.
-func pagerAddPageToRollbackJournal(tls *libc.TLS, pPg uintptr) int32 { /* sqlite3.c:58545:28: */
+func pagerAddPageToRollbackJournal(tls *libc.TLS, pPg uintptr) int32 { /* sqlite3.c:58562:28: */
var pPager uintptr = (*PgHdr)(unsafe.Pointer(pPg)).FpPager
var rc int32
var cksum U32
@@ -36185,27 +36778,27 @@ func pagerAddPageToRollbackJournal(tls *libc.TLS, pPg uintptr) int32 { /* sqlite
// playback_one_page() will think that the page needs to be restored
// in the database file. And if an IO error occurs while doing so,
// then corruption may follow.
- *(*U16)(unsafe.Pointer(pPg + 28 /* &.flags */)) |= U16((PGHDR_NEED_SYNC))
+ *(*U16)(unsafe.Pointer(pPg + 28)) |= U16(PGHDR_NEED_SYNC)
rc = write32bits(tls, (*Pager)(unsafe.Pointer(pPager)).Fjfd, iOff, (*PgHdr)(unsafe.Pointer(pPg)).Fpgno)
if rc != SQLITE_OK {
return rc
}
- rc = Xsqlite3OsWrite(tls, (*Pager)(unsafe.Pointer(pPager)).Fjfd, pData2, (*Pager)(unsafe.Pointer(pPager)).FpageSize, (iOff + int64(4)))
+ rc = Xsqlite3OsWrite(tls, (*Pager)(unsafe.Pointer(pPager)).Fjfd, pData2, int32((*Pager)(unsafe.Pointer(pPager)).FpageSize), iOff+int64(4))
if rc != SQLITE_OK {
return rc
}
- rc = write32bits(tls, (*Pager)(unsafe.Pointer(pPager)).Fjfd, ((iOff + I64((*Pager)(unsafe.Pointer(pPager)).FpageSize)) + int64(4)), cksum)
+ rc = write32bits(tls, (*Pager)(unsafe.Pointer(pPager)).Fjfd, iOff+(*Pager)(unsafe.Pointer(pPager)).FpageSize+int64(4), cksum)
if rc != SQLITE_OK {
return rc
}
- *(*I64)(unsafe.Pointer(pPager + 72 /* &.journalOff */)) += (I64(8 + (*Pager)(unsafe.Pointer(pPager)).FpageSize))
+ *(*I64)(unsafe.Pointer(pPager + 80)) += int64(8) + (*Pager)(unsafe.Pointer(pPager)).FpageSize
(*Pager)(unsafe.Pointer(pPager)).FnRec++
rc = Xsqlite3BitvecSet(tls, (*Pager)(unsafe.Pointer(pPager)).FpInJournal, (*PgHdr)(unsafe.Pointer(pPg)).Fpgno)
- rc = rc | (addToSavepointBitvecs(tls, pPager, (*PgHdr)(unsafe.Pointer(pPg)).Fpgno))
+ rc = rc | addToSavepointBitvecs(tls, pPager, (*PgHdr)(unsafe.Pointer(pPg)).Fpgno)
return rc
}
@@ -36215,7 +36808,7 @@ func pagerAddPageToRollbackJournal(tls *libc.TLS, pPg uintptr) int32 { /* sqlite
// one of the journals, the corresponding bit is set in the
// Pager.pInJournal bitvec and the PagerSavepoint.pInSavepoint bitvecs
// of any open savepoints as appropriate.
-func pager_write(tls *libc.TLS, pPg uintptr) int32 { /* sqlite3.c:58602:12: */
+func pager_write(tls *libc.TLS, pPg uintptr) int32 { /* sqlite3.c:58619:12: */
var pPager uintptr = (*PgHdr)(unsafe.Pointer(pPg)).FpPager
var rc int32 = SQLITE_OK
@@ -36245,8 +36838,8 @@ func pager_write(tls *libc.TLS, pPg uintptr) int32 { /* sqlite3.c:58602:12: */
// to change is in the rollback journal, or if the page is a new page off
// then end of the file, make sure it is marked as PGHDR_NEED_SYNC.
- if ((*Pager)(unsafe.Pointer(pPager)).FpInJournal != uintptr(0)) &&
- (Xsqlite3BitvecTestNotNull(tls, (*Pager)(unsafe.Pointer(pPager)).FpInJournal, (*PgHdr)(unsafe.Pointer(pPg)).Fpgno) == 0) {
+ if (*Pager)(unsafe.Pointer(pPager)).FpInJournal != uintptr(0) &&
+ Xsqlite3BitvecTestNotNull(tls, (*Pager)(unsafe.Pointer(pPager)).FpInJournal, (*PgHdr)(unsafe.Pointer(pPg)).Fpgno) == 0 {
if (*PgHdr)(unsafe.Pointer(pPg)).Fpgno <= (*Pager)(unsafe.Pointer(pPager)).FdbOrigSize {
rc = pagerAddPageToRollbackJournal(tls, pPg)
@@ -36255,7 +36848,7 @@ func pager_write(tls *libc.TLS, pPg uintptr) int32 { /* sqlite3.c:58602:12: */
}
} else {
if int32((*Pager)(unsafe.Pointer(pPager)).FeState) != PAGER_WRITER_DBMOD {
- *(*U16)(unsafe.Pointer(pPg + 28 /* &.flags */)) |= U16((PGHDR_NEED_SYNC))
+ *(*U16)(unsafe.Pointer(pPg + 28)) |= U16(PGHDR_NEED_SYNC)
}
}
@@ -36265,7 +36858,7 @@ func pager_write(tls *libc.TLS, pPg uintptr) int32 { /* sqlite3.c:58602:12: */
// and before writing the page into the rollback journal. Wait until now,
// after the page has been successfully journalled, before setting the
// PGHDR_WRITEABLE bit that indicates that the page can be safely modified.
- *(*U16)(unsafe.Pointer(pPg + 28 /* &.flags */)) |= U16((PGHDR_WRITEABLE))
+ *(*U16)(unsafe.Pointer(pPg + 28)) |= U16(PGHDR_WRITEABLE)
// If the statement journal is open and the page is not in it,
// then write the page into the statement journal.
@@ -36289,7 +36882,7 @@ func pager_write(tls *libc.TLS, pPg uintptr) int32 { /* sqlite3.c:58602:12: */
// Usually, the sector size is less than or equal to the page size, in which
// case pages can be individually written. This routine only runs in the
// exceptional case where the page size is smaller than the sector size.
-func pagerWriteLargeSector(tls *libc.TLS, pPg uintptr) int32 { /* sqlite3.c:58694:28: */
+func pagerWriteLargeSector(tls *libc.TLS, pPg uintptr) int32 { /* sqlite3.c:58711:28: */
bp := tls.Alloc(4)
defer tls.Free(4)
@@ -36300,45 +36893,45 @@ func pagerWriteLargeSector(tls *libc.TLS, pPg uintptr) int32 { /* sqlite3.c:5869
var ii int32 // Loop counter
var needSync int32 = 0 // True if any page has PGHDR_NEED_SYNC
var pPager uintptr = (*PgHdr)(unsafe.Pointer(pPg)).FpPager // The pager that owns pPg
- var nPagePerSector Pgno = ((*Pager)(unsafe.Pointer(pPager)).FsectorSize / U32((*Pager)(unsafe.Pointer(pPager)).FpageSize))
+ var nPagePerSector Pgno = Pgno(I64((*Pager)(unsafe.Pointer(pPager)).FsectorSize) / (*Pager)(unsafe.Pointer(pPager)).FpageSize)
// Set the doNotSpill NOSYNC bit to 1. This is because we cannot allow
// a journal header to be written between the pages journaled by
// this function.
- *(*U8)(unsafe.Pointer(pPager + 20 /* &.doNotSpill */)) |= U8((SPILLFLAG_NOSYNC))
+ *(*U8)(unsafe.Pointer(pPager + 21)) |= U8(SPILLFLAG_NOSYNC)
// This trick assumes that both the page-size and sector-size are
// an integer power of 2. It sets variable pg1 to the identifier
// of the first page of the sector pPg is located on.
- pg1 = ((((*PgHdr)(unsafe.Pointer(pPg)).Fpgno - Pgno(1)) & ^(nPagePerSector - Pgno(1))) + Pgno(1))
+ pg1 = ((*PgHdr)(unsafe.Pointer(pPg)).Fpgno-Pgno(1)) & ^(nPagePerSector-Pgno(1)) + Pgno(1)
nPageCount = (*Pager)(unsafe.Pointer(pPager)).FdbSize
if (*PgHdr)(unsafe.Pointer(pPg)).Fpgno > nPageCount {
- nPage = (int32(((*PgHdr)(unsafe.Pointer(pPg)).Fpgno - pg1) + Pgno(1)))
- } else if ((pg1 + nPagePerSector) - Pgno(1)) > nPageCount {
- nPage = (int32((nPageCount + Pgno(1)) - pg1))
+ nPage = int32((*PgHdr)(unsafe.Pointer(pPg)).Fpgno - pg1 + Pgno(1))
+ } else if pg1+nPagePerSector-Pgno(1) > nPageCount {
+ nPage = int32(nPageCount + Pgno(1) - pg1)
} else {
nPage = int32(nPagePerSector)
}
- for ii = 0; (ii < nPage) && (rc == SQLITE_OK); ii++ {
- var pg Pgno = (pg1 + Pgno(ii))
+ for ii = 0; ii < nPage && rc == SQLITE_OK; ii++ {
+ var pg Pgno = pg1 + Pgno(ii)
// var pPage uintptr at bp, 4
- if (pg == (*PgHdr)(unsafe.Pointer(pPg)).Fpgno) || !(Xsqlite3BitvecTest(tls, (*Pager)(unsafe.Pointer(pPager)).FpInJournal, pg) != 0) {
- if pg != (Pgno((Xsqlite3PendingByte / ((*Pager)(unsafe.Pointer(pPager)).FpageSize)) + 1)) {
+ if pg == (*PgHdr)(unsafe.Pointer(pPg)).Fpgno || !(Xsqlite3BitvecTest(tls, (*Pager)(unsafe.Pointer(pPager)).FpInJournal, pg) != 0) {
+ if pg != Pgno(I64(Xsqlite3PendingByte)/(*Pager)(unsafe.Pointer(pPager)).FpageSize+int64(1)) {
rc = Xsqlite3PagerGet(tls, pPager, pg, bp /* &pPage */, 0)
if rc == SQLITE_OK {
rc = pager_write(tls, *(*uintptr)(unsafe.Pointer(bp /* pPage */)))
- if (int32((*PgHdr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* pPage */)))).Fflags) & PGHDR_NEED_SYNC) != 0 {
+ if int32((*PgHdr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).Fflags)&PGHDR_NEED_SYNC != 0 {
needSync = 1
}
Xsqlite3PagerUnrefNotNull(tls, *(*uintptr)(unsafe.Pointer(bp /* pPage */)))
}
}
- } else if (libc.AssignPtrUintptr(bp /* pPage */, Xsqlite3PagerLookup(tls, pPager, pg))) != uintptr(0) {
- if (int32((*PgHdr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* pPage */)))).Fflags) & PGHDR_NEED_SYNC) != 0 {
+ } else if libc.AssignPtrUintptr(bp, Xsqlite3PagerLookup(tls, pPager, pg)) != uintptr(0) {
+ if int32((*PgHdr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).Fflags)&PGHDR_NEED_SYNC != 0 {
needSync = 1
}
Xsqlite3PagerUnrefNotNull(tls, *(*uintptr)(unsafe.Pointer(bp /* pPage */)))
@@ -36350,18 +36943,18 @@ func pagerWriteLargeSector(tls *libc.TLS, pPg uintptr) int32 { /* sqlite3.c:5869
// writing to any of these nPage pages may damage the others, the
// journal file must contain sync()ed copies of all of them
// before any of them can be written out to the database file.
- if (rc == SQLITE_OK) && (needSync != 0) {
+ if rc == SQLITE_OK && needSync != 0 {
for ii = 0; ii < nPage; ii++ {
- var pPage uintptr = Xsqlite3PagerLookup(tls, pPager, (pg1 + Pgno(ii)))
+ var pPage uintptr = Xsqlite3PagerLookup(tls, pPager, pg1+Pgno(ii))
if pPage != 0 {
- *(*U16)(unsafe.Pointer(pPage + 28 /* &.flags */)) |= U16((PGHDR_NEED_SYNC))
+ *(*U16)(unsafe.Pointer(pPage + 28)) |= U16(PGHDR_NEED_SYNC)
Xsqlite3PagerUnrefNotNull(tls, pPage)
}
}
}
- *(*U8)(unsafe.Pointer(pPager + 20 /* &.doNotSpill */)) &= libc.Uint8FromInt32((libc.CplInt32(SPILLFLAG_NOSYNC)))
+ *(*U8)(unsafe.Pointer(pPager + 21)) &= libc.Uint8FromInt32(libc.CplInt32(SPILLFLAG_NOSYNC))
return rc
}
@@ -36377,10 +36970,10 @@ func pagerWriteLargeSector(tls *libc.TLS, pPg uintptr) int32 { /* sqlite3.c:5869
//
// If an error occurs, SQLITE_NOMEM or an IO error code is returned
// as appropriate. Otherwise, SQLITE_OK.
-func Xsqlite3PagerWrite(tls *libc.TLS, pPg uintptr) int32 { /* sqlite3.c:58788:20: */
+func Xsqlite3PagerWrite(tls *libc.TLS, pPg uintptr) int32 { /* sqlite3.c:58805:20: */
var pPager uintptr = (*PgHdr)(unsafe.Pointer(pPg)).FpPager
- if ((int32((*PgHdr)(unsafe.Pointer(pPg)).Fflags) & PGHDR_WRITEABLE) != 0) && ((*Pager)(unsafe.Pointer(pPager)).FdbSize >= (*PgHdr)(unsafe.Pointer(pPg)).Fpgno) {
+ if int32((*PgHdr)(unsafe.Pointer(pPg)).Fflags)&PGHDR_WRITEABLE != 0 && (*Pager)(unsafe.Pointer(pPager)).FdbSize >= (*PgHdr)(unsafe.Pointer(pPg)).Fpgno {
if (*Pager)(unsafe.Pointer(pPager)).FnSavepoint != 0 {
return subjournalPageIfRequired(tls, pPg)
}
@@ -36418,12 +37011,12 @@ func Xsqlite3PagerWrite(tls *libc.TLS, pPg uintptr) int32 { /* sqlite3.c:58788:2
// memory pressure forces page pPg out of the cache, the data does need
// to be written out to disk so that it may be read back in if the
// current transaction is rolled back.
-func Xsqlite3PagerDontWrite(tls *libc.TLS, pPg uintptr) { /* sqlite3.c:58837:21: */
+func Xsqlite3PagerDontWrite(tls *libc.TLS, pPg uintptr) { /* sqlite3.c:58854:21: */
var pPager uintptr = (*PgHdr)(unsafe.Pointer(pPg)).FpPager
- if (!(int32((*Pager)(unsafe.Pointer(pPager)).FtempFile) != 0) && ((int32((*PgHdr)(unsafe.Pointer(pPg)).Fflags) & PGHDR_DIRTY) != 0)) && ((*Pager)(unsafe.Pointer(pPager)).FnSavepoint == 0) {
+ if !(int32((*Pager)(unsafe.Pointer(pPager)).FtempFile) != 0) && int32((*PgHdr)(unsafe.Pointer(pPg)).Fflags)&PGHDR_DIRTY != 0 && (*Pager)(unsafe.Pointer(pPager)).FnSavepoint == 0 {
- *(*U16)(unsafe.Pointer(pPg + 28 /* &.flags */)) |= U16((PGHDR_DONT_WRITE))
- *(*U16)(unsafe.Pointer(pPg + 28 /* &.flags */)) &= libc.Uint16FromInt32((libc.CplInt32(PGHDR_WRITEABLE)))
+ *(*U16)(unsafe.Pointer(pPg + 28)) |= U16(PGHDR_DONT_WRITE)
+ *(*U16)(unsafe.Pointer(pPg + 28)) &= libc.Uint16FromInt32(libc.CplInt32(PGHDR_WRITEABLE))
}
}
@@ -36448,7 +37041,7 @@ func Xsqlite3PagerDontWrite(tls *libc.TLS, pPg uintptr) { /* sqlite3.c:58837:21:
// if isDirect is non-zero, then the database file is updated directly
// by writing an updated version of page 1 using a call to the
// sqlite3OsWrite() function.
-func pager_incr_changecounter(tls *libc.TLS, pPager uintptr, isDirectMode int32) int32 { /* sqlite3.c:58871:12: */
+func pager_incr_changecounter(tls *libc.TLS, pPager uintptr, isDirectMode int32) int32 { /* sqlite3.c:58888:12: */
bp := tls.Alloc(4)
defer tls.Free(4)
@@ -36466,7 +37059,7 @@ func pager_incr_changecounter(tls *libc.TLS, pPager uintptr, isDirectMode int32)
_ = isDirectMode
- if !(int32((*Pager)(unsafe.Pointer(pPager)).FchangeCountDone) != 0) && ((*Pager)(unsafe.Pointer(pPager)).FdbSize > Pgno(0)) {
+ if !(int32((*Pager)(unsafe.Pointer(pPager)).FchangeCountDone) != 0) && (*Pager)(unsafe.Pointer(pPager)).FdbSize > Pgno(0) {
// var pPgHdr uintptr at bp, 4
// Reference to page 1
@@ -36477,7 +37070,7 @@ func pager_incr_changecounter(tls *libc.TLS, pPager uintptr, isDirectMode int32)
// operating in direct-mode, make page 1 writable. When not in
// direct mode, page 1 is always held in cache and hence the PagerGet()
// above is always successful - hence the ALWAYS on rc==SQLITE_OK.
- if !(0 != 0) && (rc == SQLITE_OK) {
+ if !(0 != 0) && rc == SQLITE_OK {
rc = Xsqlite3PagerWrite(tls, *(*uintptr)(unsafe.Pointer(bp /* pPgHdr */)))
}
@@ -36491,15 +37084,15 @@ func pager_incr_changecounter(tls *libc.TLS, pPager uintptr, isDirectMode int32)
zBuf = (*PgHdr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* pPgHdr */)))).FpData
if rc == SQLITE_OK {
- rc = Xsqlite3OsWrite(tls, (*Pager)(unsafe.Pointer(pPager)).Ffd, zBuf, (*Pager)(unsafe.Pointer(pPager)).FpageSize, int64(0))
- *(*int32)(unsafe.Pointer((pPager + 184 /* &.aStat */) + 2*4))++
+ rc = Xsqlite3OsWrite(tls, (*Pager)(unsafe.Pointer(pPager)).Ffd, zBuf, int32((*Pager)(unsafe.Pointer(pPager)).FpageSize), int64(0))
+ *(*int32)(unsafe.Pointer(pPager + 200 + 2*4))++
}
if rc == SQLITE_OK {
// Update the pager's copy of the change-counter. Otherwise, the
// next time a read transaction is opened the cache will be
// flushed (as the change-counter values will not match).
- var pCopy uintptr = ((zBuf) + 24)
- libc.Xmemcpy(tls, (pPager + 104 /* &.dbFileVers */), pCopy, uint32(unsafe.Sizeof([16]uint8{})))
+ var pCopy uintptr = zBuf + 24
+ libc.Xmemcpy(tls, pPager+112, pCopy, uint32(unsafe.Sizeof([16]uint8{})))
(*Pager)(unsafe.Pointer(pPager)).FchangeCountDone = U8(1)
}
} else {
@@ -36518,14 +37111,14 @@ func pager_incr_changecounter(tls *libc.TLS, pPager uintptr, isDirectMode int32)
//
// If successful, or if called on a pager for which it is a no-op, this
// function returns SQLITE_OK. Otherwise, an IO error code is returned.
-func Xsqlite3PagerSync(tls *libc.TLS, pPager uintptr, zSuper uintptr) int32 { /* sqlite3.c:58954:20: */
+func Xsqlite3PagerSync(tls *libc.TLS, pPager uintptr, zSuper uintptr) int32 { /* sqlite3.c:58971:20: */
var rc int32 = SQLITE_OK
var pArg uintptr = zSuper
rc = Xsqlite3OsFileControl(tls, (*Pager)(unsafe.Pointer(pPager)).Ffd, SQLITE_FCNTL_SYNC, pArg)
if rc == SQLITE_NOTFOUND {
rc = SQLITE_OK
}
- if (rc == SQLITE_OK) && !(int32((*Pager)(unsafe.Pointer(pPager)).FnoSync) != 0) {
+ if rc == SQLITE_OK && !(int32((*Pager)(unsafe.Pointer(pPager)).FnoSync) != 0) {
rc = Xsqlite3OsSync(tls, (*Pager)(unsafe.Pointer(pPager)).Ffd, int32((*Pager)(unsafe.Pointer(pPager)).FsyncFlags))
}
@@ -36541,12 +37134,12 @@ func Xsqlite3PagerSync(tls *libc.TLS, pPager uintptr, zSuper uintptr) int32 { /*
// successful, or the connection is in WAL mode, SQLITE_OK is returned.
// Otherwise, either SQLITE_BUSY or an SQLITE_IOERR_XXX error code is
// returned.
-func Xsqlite3PagerExclusiveLock(tls *libc.TLS, pPager uintptr) int32 { /* sqlite3.c:58977:20: */
+func Xsqlite3PagerExclusiveLock(tls *libc.TLS, pPager uintptr) int32 { /* sqlite3.c:58994:20: */
var rc int32 = (*Pager)(unsafe.Pointer(pPager)).FerrCode
if rc == SQLITE_OK {
- if 0 == (libc.Bool32((*Pager)(unsafe.Pointer((pPager))).FpWal != uintptr(0))) {
+ if 0 == libc.Bool32((*Pager)(unsafe.Pointer(pPager)).FpWal != uintptr(0)) {
rc = pager_wait_on_lock(tls, pPager, EXCLUSIVE_LOCK)
}
}
@@ -36577,7 +37170,7 @@ func Xsqlite3PagerExclusiveLock(tls *libc.TLS, pPager uintptr) int32 { /* sqlite
// is not synced. The caller must call sqlite3PagerSync() directly to
// sync the database file before calling CommitPhaseTwo() to delete the
// journal file in this case.
-func Xsqlite3PagerCommitPhaseOne(tls *libc.TLS, pPager uintptr, zSuper uintptr, noSync int32) int32 { /* sqlite3.c:59019:20: */
+func Xsqlite3PagerCommitPhaseOne(tls *libc.TLS, pPager uintptr, zSuper uintptr, noSync int32) int32 { /* sqlite3.c:59036:20: */
bp := tls.Alloc(4)
defer tls.Free(4)
@@ -36621,7 +37214,7 @@ __3:
Xsqlite3BackupRestart(tls, (*Pager)(unsafe.Pointer(pPager)).FpBackup)
goto __5
__4:
- if !((*Pager)(unsafe.Pointer((pPager))).FpWal != uintptr(0)) {
+ if !((*Pager)(unsafe.Pointer(pPager)).FpWal != uintptr(0)) {
goto __6
}
*(*uintptr)(unsafe.Pointer(bp /* pPageOne */)) = uintptr(0)
@@ -36719,7 +37312,7 @@ __15:
if !((*Pager)(unsafe.Pointer(pPager)).FdbSize > (*Pager)(unsafe.Pointer(pPager)).FdbFileSize) {
goto __16
}
- nNew = ((*Pager)(unsafe.Pointer(pPager)).FdbSize - (Pgno(libc.Bool32((*Pager)(unsafe.Pointer(pPager)).FdbSize == (Pgno((Xsqlite3PendingByte / ((*Pager)(unsafe.Pointer(pPager)).FpageSize)) + 1))))))
+ nNew = (*Pager)(unsafe.Pointer(pPager)).FdbSize - Pgno(libc.Bool32((*Pager)(unsafe.Pointer(pPager)).FdbSize == Pgno(I64(Xsqlite3PendingByte)/(*Pager)(unsafe.Pointer(pPager)).FpageSize+int64(1))))
rc = pager_truncate(tls, pPager, nNew)
if !(rc != SQLITE_OK) {
@@ -36732,7 +37325,7 @@ __16:
;
// Finally, sync the database file.
- if !(!(noSync != 0)) {
+ if !!(noSync != 0) {
goto __18
}
rc = Xsqlite3PagerSync(tls, pPager, zSuper)
@@ -36745,7 +37338,7 @@ __5:
;
commit_phase_one_exit:
- if !((rc == SQLITE_OK) && !((*Pager)(unsafe.Pointer((pPager))).FpWal != uintptr(0))) {
+ if !(rc == SQLITE_OK && !((*Pager)(unsafe.Pointer(pPager)).FpWal != uintptr(0))) {
goto __19
}
(*Pager)(unsafe.Pointer(pPager)).FeState = U8(PAGER_WRITER_FINISHED)
@@ -36767,7 +37360,7 @@ __19:
//
// If an error occurs, an IO error code is returned and the pager
// moves into the error state. Otherwise, SQLITE_OK is returned.
-func Xsqlite3PagerCommitPhaseTwo(tls *libc.TLS, pPager uintptr) int32 { /* sqlite3.c:59249:20: */
+func Xsqlite3PagerCommitPhaseTwo(tls *libc.TLS, pPager uintptr) int32 { /* sqlite3.c:59266:20: */
var rc int32 = SQLITE_OK // Return code
// This routine should not be called if a prior error has occurred.
@@ -36788,9 +37381,9 @@ func Xsqlite3PagerCommitPhaseTwo(tls *libc.TLS, pPager uintptr) int32 { /* sqlit
// to the database file. So there is no need to zero the journal
// header. Since the pager is in exclusive mode, there is no need
// to drop any locks either.
- if ((int32((*Pager)(unsafe.Pointer(pPager)).FeState) == PAGER_WRITER_LOCKED) &&
- ((*Pager)(unsafe.Pointer(pPager)).FexclusiveMode != 0)) &&
- (int32((*Pager)(unsafe.Pointer(pPager)).FjournalMode) == PAGER_JOURNALMODE_PERSIST) {
+ if int32((*Pager)(unsafe.Pointer(pPager)).FeState) == PAGER_WRITER_LOCKED &&
+ (*Pager)(unsafe.Pointer(pPager)).FexclusiveMode != 0 &&
+ int32((*Pager)(unsafe.Pointer(pPager)).FjournalMode) == PAGER_JOURNALMODE_PERSIST {
(*Pager)(unsafe.Pointer(pPager)).FeState = U8(PAGER_READER)
return SQLITE_OK
@@ -36824,7 +37417,7 @@ func Xsqlite3PagerCommitPhaseTwo(tls *libc.TLS, pPager uintptr) int32 { /* sqlit
// current transaction are either expelled from the cache or reverted to
// their pre-transaction state by re-reading data from the database or
// WAL files. The WAL transaction is then closed.
-func Xsqlite3PagerRollback(tls *libc.TLS, pPager uintptr) int32 { /* sqlite3.c:59315:20: */
+func Xsqlite3PagerRollback(tls *libc.TLS, pPager uintptr) int32 { /* sqlite3.c:59332:20: */
var rc int32 = SQLITE_OK // Return code
// PagerRollback() is a no-op if called in READER or OPEN state. If
@@ -36838,17 +37431,17 @@ func Xsqlite3PagerRollback(tls *libc.TLS, pPager uintptr) int32 { /* sqlite3.c:5
return SQLITE_OK
}
- if (*Pager)(unsafe.Pointer((pPager))).FpWal != uintptr(0) {
+ if (*Pager)(unsafe.Pointer(pPager)).FpWal != uintptr(0) {
var rc2 int32
rc = Xsqlite3PagerSavepoint(tls, pPager, SAVEPOINT_ROLLBACK, -1)
rc2 = pager_end_transaction(tls, pPager, int32((*Pager)(unsafe.Pointer(pPager)).FsetSuper), 0)
if rc == SQLITE_OK {
rc = rc2
}
- } else if !((*Sqlite3_file)(unsafe.Pointer(((*Pager)(unsafe.Pointer(pPager)).Fjfd))).FpMethods != uintptr(0)) || (int32((*Pager)(unsafe.Pointer(pPager)).FeState) == PAGER_WRITER_LOCKED) {
+ } else if !((*Sqlite3_file)(unsafe.Pointer((*Pager)(unsafe.Pointer(pPager)).Fjfd)).FpMethods != uintptr(0)) || int32((*Pager)(unsafe.Pointer(pPager)).FeState) == PAGER_WRITER_LOCKED {
var eState int32 = int32((*Pager)(unsafe.Pointer(pPager)).FeState)
rc = pager_end_transaction(tls, pPager, 0, 0)
- if !(int32((*Pager)(unsafe.Pointer(pPager)).FmemDb) != 0) && (eState > PAGER_WRITER_LOCKED) {
+ if !(int32((*Pager)(unsafe.Pointer(pPager)).FmemDb) != 0) && eState > PAGER_WRITER_LOCKED {
// This can happen using journal_mode=off. Move the pager to the error
// state to indicate that the contents of the cache may not be trusted.
// Any active readers will get SQLITE_ABORT.
@@ -36868,22 +37461,22 @@ func Xsqlite3PagerRollback(tls *libc.TLS, pPager uintptr) int32 { /* sqlite3.c:5
// Return TRUE if the database file is opened read-only. Return FALSE
// if the database is (in theory) writable.
-func Xsqlite3PagerIsreadonly(tls *libc.TLS, pPager uintptr) U8 { /* sqlite3.c:59365:19: */
+func Xsqlite3PagerIsreadonly(tls *libc.TLS, pPager uintptr) U8 { /* sqlite3.c:59382:19: */
return (*Pager)(unsafe.Pointer(pPager)).FreadOnly
}
// Return the approximate number of bytes of memory currently
// used by the pager and its associated cache.
-func Xsqlite3PagerMemUsed(tls *libc.TLS, pPager uintptr) int32 { /* sqlite3.c:59382:20: */
- var perPageSize int32 = (int32(((uint32((*Pager)(unsafe.Pointer(pPager)).FpageSize + int32((*Pager)(unsafe.Pointer(pPager)).FnExtra))) + uint32(unsafe.Sizeof(PgHdr{}))) +
- (uint32(5) * uint32(unsafe.Sizeof(uintptr(0))))))
- return (((perPageSize * Xsqlite3PcachePagecount(tls, (*Pager)(unsafe.Pointer(pPager)).FpPCache)) +
+func Xsqlite3PagerMemUsed(tls *libc.TLS, pPager uintptr) int32 { /* sqlite3.c:59399:20: */
+ var perPageSize int32 = int32((*Pager)(unsafe.Pointer(pPager)).FpageSize + I64((*Pager)(unsafe.Pointer(pPager)).FnExtra) +
+ I64(int32(uint32(unsafe.Sizeof(PgHdr{}))+uint32(5)*uint32(unsafe.Sizeof(uintptr(0))))))
+ return int32(I64(perPageSize*Xsqlite3PcachePagecount(tls, (*Pager)(unsafe.Pointer(pPager)).FpPCache)+
Xsqlite3MallocSize(tls, pPager)) +
(*Pager)(unsafe.Pointer(pPager)).FpageSize)
}
// Return the number of references to the specified page.
-func Xsqlite3PagerPageRefcount(tls *libc.TLS, pPage uintptr) int32 { /* sqlite3.c:59393:20: */
+func Xsqlite3PagerPageRefcount(tls *libc.TLS, pPage uintptr) int32 { /* sqlite3.c:59410:20: */
return Xsqlite3PcachePageRefcount(tls, pPage)
}
@@ -36896,18 +37489,18 @@ func Xsqlite3PagerPageRefcount(tls *libc.TLS, pPage uintptr) int32 { /* sqlite3.
// current cache hit or miss count, according to the value of eStat. If the
// reset parameter is non-zero, the cache hit or miss count is zeroed before
// returning.
-func Xsqlite3PagerCacheStat(tls *libc.TLS, pPager uintptr, eStat int32, reset int32, pnVal uintptr) { /* sqlite3.c:59429:21: */
+func Xsqlite3PagerCacheStat(tls *libc.TLS, pPager uintptr, eStat int32, reset int32, pnVal uintptr) { /* sqlite3.c:59446:21: */
- eStat = eStat - (SQLITE_DBSTATUS_CACHE_HIT)
- *(*int32)(unsafe.Pointer(pnVal)) += (*(*int32)(unsafe.Pointer((pPager + 184 /* &.aStat */) + uintptr(eStat)*4)))
+ eStat = eStat - SQLITE_DBSTATUS_CACHE_HIT
+ *(*int32)(unsafe.Pointer(pnVal)) += *(*int32)(unsafe.Pointer(pPager + 200 + uintptr(eStat)*4))
if reset != 0 {
- *(*int32)(unsafe.Pointer((pPager + 184 /* &.aStat */) + uintptr(eStat)*4)) = 0
+ *(*int32)(unsafe.Pointer(pPager + 200 + uintptr(eStat)*4)) = 0
}
}
// Return true if this is an in-memory or temp-file backed pager.
-func Xsqlite3PagerIsMemdb(tls *libc.TLS, pPager uintptr) int32 { /* sqlite3.c:59452:20: */
- return int32((*Pager)(unsafe.Pointer(pPager)).FtempFile)
+func Xsqlite3PagerIsMemdb(tls *libc.TLS, pPager uintptr) int32 { /* sqlite3.c:59469:20: */
+ return libc.Bool32((*Pager)(unsafe.Pointer(pPager)).FtempFile != 0 || (*Pager)(unsafe.Pointer(pPager)).FmemVfs != 0)
}
// Check that there are at least nSavepoint savepoints open. If there are
@@ -36918,7 +37511,7 @@ func Xsqlite3PagerIsMemdb(tls *libc.TLS, pPager uintptr) int32 { /* sqlite3.c:59
// If a memory allocation fails, SQLITE_NOMEM is returned. If an error
// occurs while opening the sub-journal file, then an IO error code is
// returned. Otherwise, SQLITE_OK.
-func pagerOpenSavepoint(tls *libc.TLS, pPager uintptr, nSavepoint int32) int32 { /* sqlite3.c:59466:28: */
+func pagerOpenSavepoint(tls *libc.TLS, pPager uintptr, nSavepoint int32) int32 { /* sqlite3.c:59483:28: */
var rc int32 = SQLITE_OK // Return code
var nCurrent int32 = (*Pager)(unsafe.Pointer(pPager)).FnSavepoint // Current number of savepoints
var ii int32 // Iterator variable
@@ -36928,17 +37521,17 @@ func pagerOpenSavepoint(tls *libc.TLS, pPager uintptr, nSavepoint int32) int32 {
// if the allocation fails. Otherwise, zero the new portion in case a
// malloc failure occurs while populating it in the for(...) loop below.
aNew = Xsqlite3Realloc(tls,
- (*Pager)(unsafe.Pointer(pPager)).FaSavepoint, (uint64(uint32(unsafe.Sizeof(PagerSavepoint{})) * uint32(nSavepoint))))
+ (*Pager)(unsafe.Pointer(pPager)).FaSavepoint, uint64(uint32(unsafe.Sizeof(PagerSavepoint{}))*uint32(nSavepoint)))
if !(aNew != 0) {
return SQLITE_NOMEM
}
- libc.Xmemset(tls, (aNew + uintptr(nCurrent)*48), 0, ((uint32(nSavepoint - nCurrent)) * uint32(unsafe.Sizeof(PagerSavepoint{}))))
+ libc.Xmemset(tls, aNew+uintptr(nCurrent)*48, 0, uint32(nSavepoint-nCurrent)*uint32(unsafe.Sizeof(PagerSavepoint{})))
(*Pager)(unsafe.Pointer(pPager)).FaSavepoint = aNew
// Populate the PagerSavepoint structures just allocated.
for ii = nCurrent; ii < nSavepoint; ii++ {
(*PagerSavepoint)(unsafe.Pointer(aNew + uintptr(ii)*48)).FnOrig = (*Pager)(unsafe.Pointer(pPager)).FdbSize
- if ((*Sqlite3_file)(unsafe.Pointer(((*Pager)(unsafe.Pointer(pPager)).Fjfd))).FpMethods != uintptr(0)) && ((*Pager)(unsafe.Pointer(pPager)).FjournalOff > int64(0)) {
+ if (*Sqlite3_file)(unsafe.Pointer((*Pager)(unsafe.Pointer(pPager)).Fjfd)).FpMethods != uintptr(0) && (*Pager)(unsafe.Pointer(pPager)).FjournalOff > int64(0) {
(*PagerSavepoint)(unsafe.Pointer(aNew + uintptr(ii)*48)).FiOffset = (*Pager)(unsafe.Pointer(pPager)).FjournalOff
} else {
(*PagerSavepoint)(unsafe.Pointer(aNew + uintptr(ii)*48)).FiOffset = I64((*Pager)(unsafe.Pointer(pPager)).FsectorSize)
@@ -36949,18 +37542,18 @@ func pagerOpenSavepoint(tls *libc.TLS, pPager uintptr, nSavepoint int32) int32 {
if !(int32((*PagerSavepoint)(unsafe.Pointer(aNew+uintptr(ii)*48)).FpInSavepoint) != 0) {
return SQLITE_NOMEM
}
- if (*Pager)(unsafe.Pointer((pPager))).FpWal != uintptr(0) {
- Xsqlite3WalSavepoint(tls, (*Pager)(unsafe.Pointer(pPager)).FpWal, aNew+uintptr(ii)*48+32 /* &.aWalData */)
+ if (*Pager)(unsafe.Pointer(pPager)).FpWal != uintptr(0) {
+ Xsqlite3WalSavepoint(tls, (*Pager)(unsafe.Pointer(pPager)).FpWal, aNew+uintptr(ii)*48+32)
}
- (*Pager)(unsafe.Pointer(pPager)).FnSavepoint = (ii + 1)
+ (*Pager)(unsafe.Pointer(pPager)).FnSavepoint = ii + 1
}
return rc
}
-func Xsqlite3PagerOpenSavepoint(tls *libc.TLS, pPager uintptr, nSavepoint int32) int32 { /* sqlite3.c:59512:20: */
+func Xsqlite3PagerOpenSavepoint(tls *libc.TLS, pPager uintptr, nSavepoint int32) int32 { /* sqlite3.c:59529:20: */
- if (nSavepoint > (*Pager)(unsafe.Pointer(pPager)).FnSavepoint) && ((*Pager)(unsafe.Pointer(pPager)).FuseJournal != 0) {
+ if nSavepoint > (*Pager)(unsafe.Pointer(pPager)).FnSavepoint && (*Pager)(unsafe.Pointer(pPager)).FuseJournal != 0 {
return pagerOpenSavepoint(tls, pPager, nSavepoint)
} else {
return SQLITE_OK
@@ -36996,46 +37589,46 @@ func Xsqlite3PagerOpenSavepoint(tls *libc.TLS, pPager uintptr, nSavepoint int32)
// This function may return SQLITE_NOMEM if a memory allocation fails,
// or an IO error code if an IO error occurs while rolling back a
// savepoint. If no errors occur, SQLITE_OK is returned.
-func Xsqlite3PagerSavepoint(tls *libc.TLS, pPager uintptr, op int32, iSavepoint int32) int32 { /* sqlite3.c:59554:20: */
+func Xsqlite3PagerSavepoint(tls *libc.TLS, pPager uintptr, op int32, iSavepoint int32) int32 { /* sqlite3.c:59571:20: */
var rc int32 = (*Pager)(unsafe.Pointer(pPager)).FerrCode
- if (rc == SQLITE_OK) && (iSavepoint < (*Pager)(unsafe.Pointer(pPager)).FnSavepoint) {
+ if rc == SQLITE_OK && iSavepoint < (*Pager)(unsafe.Pointer(pPager)).FnSavepoint {
var ii int32 // Iterator variable
var nNew int32 // Number of remaining savepoints after this op.
// Figure out how many savepoints will still be active after this
// operation. Store this value in nNew. Then free resources associated
// with any savepoints that are destroyed by this operation.
- nNew = (iSavepoint + (func() int32 {
+ nNew = iSavepoint + func() int32 {
if op == SAVEPOINT_RELEASE {
return 0
}
return 1
- }()))
+ }()
for ii = nNew; ii < (*Pager)(unsafe.Pointer(pPager)).FnSavepoint; ii++ {
Xsqlite3BitvecDestroy(tls, (*PagerSavepoint)(unsafe.Pointer((*Pager)(unsafe.Pointer(pPager)).FaSavepoint+uintptr(ii)*48)).FpInSavepoint)
}
(*Pager)(unsafe.Pointer(pPager)).FnSavepoint = nNew
- // If this is a release of the outermost savepoint, truncate
- // the sub-journal to zero bytes in size.
+ // Truncate the sub-journal so that it only includes the parts
+ // that are still in use.
if op == SAVEPOINT_RELEASE {
- var pRel uintptr = ((*Pager)(unsafe.Pointer(pPager)).FaSavepoint + uintptr(nNew)*48)
- if ((*PagerSavepoint)(unsafe.Pointer(pRel)).FbTruncateOnRelease != 0) && ((*Sqlite3_file)(unsafe.Pointer(((*Pager)(unsafe.Pointer(pPager)).Fsjfd))).FpMethods != uintptr(0)) {
+ var pRel uintptr = (*Pager)(unsafe.Pointer(pPager)).FaSavepoint + uintptr(nNew)*48
+ if (*PagerSavepoint)(unsafe.Pointer(pRel)).FbTruncateOnRelease != 0 && (*Sqlite3_file)(unsafe.Pointer((*Pager)(unsafe.Pointer(pPager)).Fsjfd)).FpMethods != uintptr(0) {
// Only truncate if it is an in-memory sub-journal.
if Xsqlite3JournalIsInMemory(tls, (*Pager)(unsafe.Pointer(pPager)).Fsjfd) != 0 {
- var sz I64 = (I64((Pgno((*Pager)(unsafe.Pointer(pPager)).FpageSize + 4)) * (*PagerSavepoint)(unsafe.Pointer(pRel)).FiSubRec))
+ var sz I64 = ((*Pager)(unsafe.Pointer(pPager)).FpageSize + int64(4)) * I64((*PagerSavepoint)(unsafe.Pointer(pRel)).FiSubRec)
rc = Xsqlite3OsTruncate(tls, (*Pager)(unsafe.Pointer(pPager)).Fsjfd, sz)
}
(*Pager)(unsafe.Pointer(pPager)).FnSubRec = (*PagerSavepoint)(unsafe.Pointer(pRel)).FiSubRec
}
- } else if ((*Pager)(unsafe.Pointer((pPager))).FpWal != uintptr(0)) || ((*Sqlite3_file)(unsafe.Pointer(((*Pager)(unsafe.Pointer(pPager)).Fjfd))).FpMethods != uintptr(0)) {
+ } else if (*Pager)(unsafe.Pointer(pPager)).FpWal != uintptr(0) || (*Sqlite3_file)(unsafe.Pointer((*Pager)(unsafe.Pointer(pPager)).Fjfd)).FpMethods != uintptr(0) {
var pSavepoint uintptr
if nNew == 0 {
pSavepoint = uintptr(0)
} else {
- pSavepoint = ((*Pager)(unsafe.Pointer(pPager)).FaSavepoint + uintptr((nNew-1))*48)
+ pSavepoint = (*Pager)(unsafe.Pointer(pPager)).FaSavepoint + uintptr(nNew-1)*48
}
rc = pagerPlaybackSavepoint(tls, pPager, pSavepoint)
@@ -37057,30 +37650,30 @@ func Xsqlite3PagerSavepoint(tls *libc.TLS, pPager uintptr, op int32, iSavepoint
//
// The return value to this routine is always safe to use with
// sqlite3_uri_parameter() and sqlite3_filename_database() and friends.
-func Xsqlite3PagerFilename(tls *libc.TLS, pPager uintptr, nullIfMemDb int32) uintptr { /* sqlite3.c:59635:27: */
- if (nullIfMemDb != 0) && ((*Pager)(unsafe.Pointer(pPager)).FmemDb != 0) {
- return (uintptr(unsafe.Pointer(&zFake)) + 4)
+func Xsqlite3PagerFilename(tls *libc.TLS, pPager uintptr, nullIfMemDb int32) uintptr { /* sqlite3.c:59652:27: */
+ if nullIfMemDb != 0 && (*Pager)(unsafe.Pointer(pPager)).FmemDb != 0 {
+ return uintptr(unsafe.Pointer(&zFake)) + 4
}
return (*Pager)(unsafe.Pointer(pPager)).FzFilename
}
-var zFake = [8]uint8{uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0)} /* sqlite3.c:59636:21 */
+var zFake = [8]uint8{uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0)} /* sqlite3.c:59653:21 */
// Return the VFS structure for the pager.
-func Xsqlite3PagerVfs(tls *libc.TLS, pPager uintptr) uintptr { /* sqlite3.c:59643:28: */
+func Xsqlite3PagerVfs(tls *libc.TLS, pPager uintptr) uintptr { /* sqlite3.c:59660:28: */
return (*Pager)(unsafe.Pointer(pPager)).FpVfs
}
// Return the file handle for the database file associated
// with the pager. This might return NULL if the file has
// not yet been opened.
-func Xsqlite3PagerFile(tls *libc.TLS, pPager uintptr) uintptr { /* sqlite3.c:59652:29: */
+func Xsqlite3PagerFile(tls *libc.TLS, pPager uintptr) uintptr { /* sqlite3.c:59669:29: */
return (*Pager)(unsafe.Pointer(pPager)).Ffd
}
// Return the file handle for the journal file (if it exists).
// This will be either the rollback journal or the WAL file.
-func Xsqlite3PagerJrnlFile(tls *libc.TLS, pPager uintptr) uintptr { /* sqlite3.c:59660:29: */
+func Xsqlite3PagerJrnlFile(tls *libc.TLS, pPager uintptr) uintptr { /* sqlite3.c:59677:29: */
if (*Pager)(unsafe.Pointer(pPager)).FpWal != 0 {
return Xsqlite3WalFile(tls, (*Pager)(unsafe.Pointer(pPager)).FpWal)
}
@@ -37088,7 +37681,7 @@ func Xsqlite3PagerJrnlFile(tls *libc.TLS, pPager uintptr) uintptr { /* sqlite3.c
}
// Return the full pathname of the journal file.
-func Xsqlite3PagerJournalname(tls *libc.TLS, pPager uintptr) uintptr { /* sqlite3.c:59671:27: */
+func Xsqlite3PagerJournalname(tls *libc.TLS, pPager uintptr) uintptr { /* sqlite3.c:59688:27: */
return (*Pager)(unsafe.Pointer(pPager)).FzJournal
}
@@ -37115,7 +37708,7 @@ func Xsqlite3PagerJournalname(tls *libc.TLS, pPager uintptr) uintptr { /* sqlite
//
// This function may return SQLITE_NOMEM or an IO error code if an error
// occurs. Otherwise, it returns SQLITE_OK.
-func Xsqlite3PagerMovepage(tls *libc.TLS, pPager uintptr, pPg uintptr, pgno Pgno, isCommit int32) int32 { /* sqlite3.c:59701:20: */
+func Xsqlite3PagerMovepage(tls *libc.TLS, pPager uintptr, pPg uintptr, pgno Pgno, isCommit int32) int32 { /* sqlite3.c:59718:20: */
bp := tls.Alloc(4)
defer tls.Free(4)
@@ -37151,8 +37744,8 @@ func Xsqlite3PagerMovepage(tls *libc.TLS, pPager uintptr, pPg uintptr, pgno Pgno
// subjournalPage() may need to allocate space to store pPg->pgno into
// one or more savepoint bitvecs. This is the reason this function
// may return SQLITE_NOMEM.
- if ((int32((*DbPage)(unsafe.Pointer(pPg)).Fflags) & PGHDR_DIRTY) != 0) &&
- (SQLITE_OK != (libc.AssignInt32(&rc, subjournalPageIfRequired(tls, pPg)))) {
+ if int32((*DbPage)(unsafe.Pointer(pPg)).Fflags)&PGHDR_DIRTY != 0 &&
+ SQLITE_OK != libc.AssignInt32(&rc, subjournalPageIfRequired(tls, pPg)) {
return rc
}
@@ -37162,7 +37755,7 @@ func Xsqlite3PagerMovepage(tls *libc.TLS, pPager uintptr, pPg uintptr, pgno Pgno
// If the isCommit flag is set, there is no need to remember that
// the journal needs to be sync()ed before database page pPg->pgno
// can be written to. The caller has already promised not to write to it.
- if ((int32((*DbPage)(unsafe.Pointer(pPg)).Fflags) & PGHDR_NEED_SYNC) != 0) && !(isCommit != 0) {
+ if int32((*DbPage)(unsafe.Pointer(pPg)).Fflags)&PGHDR_NEED_SYNC != 0 && !(isCommit != 0) {
needSyncPgno = (*DbPage)(unsafe.Pointer(pPg)).Fpgno
}
@@ -37171,19 +37764,19 @@ func Xsqlite3PagerMovepage(tls *libc.TLS, pPager uintptr, pPg uintptr, pgno Pgno
// from its hash chain. Also, if the PGHDR_NEED_SYNC flag was set for
// page pgno before the 'move' operation, it needs to be retained
// for the page moved there.
- *(*U16)(unsafe.Pointer(pPg + 28 /* &.flags */)) &= libc.Uint16FromInt32((libc.CplInt32(PGHDR_NEED_SYNC)))
+ *(*U16)(unsafe.Pointer(pPg + 28)) &= libc.Uint16FromInt32(libc.CplInt32(PGHDR_NEED_SYNC))
pPgOld = Xsqlite3PagerLookup(tls, pPager, pgno)
if pPgOld != 0 {
if int32((*PgHdr)(unsafe.Pointer(pPgOld)).FnRef) > 1 {
Xsqlite3PagerUnrefNotNull(tls, pPgOld)
- return Xsqlite3CorruptError(tls, 59775)
+ return Xsqlite3CorruptError(tls, 59792)
}
- *(*U16)(unsafe.Pointer(pPg + 28 /* &.flags */)) |= U16((int32((*PgHdr)(unsafe.Pointer(pPgOld)).Fflags) & PGHDR_NEED_SYNC))
+ *(*U16)(unsafe.Pointer(pPg + 28)) |= U16(int32((*PgHdr)(unsafe.Pointer(pPgOld)).Fflags) & PGHDR_NEED_SYNC)
if (*Pager)(unsafe.Pointer(pPager)).FtempFile != 0 {
// Do not discard pages from an in-memory database since we might
// need to rollback later. Just move the page out of the way.
- Xsqlite3PcacheMove(tls, pPgOld, ((*Pager)(unsafe.Pointer(pPager)).FdbSize + Pgno(1)))
+ Xsqlite3PcacheMove(tls, pPgOld, (*Pager)(unsafe.Pointer(pPager)).FdbSize+Pgno(1))
} else {
Xsqlite3PcacheDrop(tls, pPgOld)
}
@@ -37196,7 +37789,7 @@ func Xsqlite3PagerMovepage(tls *libc.TLS, pPager uintptr, pPg uintptr, pgno Pgno
// For an in-memory database, make sure the original page continues
// to exist, in case the transaction needs to roll back. Use pPgOld
// as the original page since it has already been allocated.
- if ((*Pager)(unsafe.Pointer(pPager)).FtempFile != 0) && (pPgOld != 0) {
+ if (*Pager)(unsafe.Pointer(pPager)).FtempFile != 0 && pPgOld != 0 {
Xsqlite3PcacheMove(tls, pPgOld, origPgno)
Xsqlite3PagerUnrefNotNull(tls, pPgOld)
}
@@ -37225,7 +37818,7 @@ func Xsqlite3PagerMovepage(tls *libc.TLS, pPager uintptr, pPg uintptr, pgno Pgno
}
return rc
}
- *(*U16)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* pPgHdr */)) + 28 /* &.flags */)) |= U16((PGHDR_NEED_SYNC))
+ *(*U16)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)) + 28)) |= U16(PGHDR_NEED_SYNC)
Xsqlite3PcacheMakeDirty(tls, *(*uintptr)(unsafe.Pointer(bp /* pPgHdr */)))
Xsqlite3PagerUnrefNotNull(tls, *(*uintptr)(unsafe.Pointer(bp /* pPgHdr */)))
}
@@ -37237,21 +37830,21 @@ func Xsqlite3PagerMovepage(tls *libc.TLS, pPager uintptr, pPg uintptr, pgno Pgno
// with a page number other than iNew. This function changes the page's
// page number to iNew and sets the value of the PgHdr.flags field to
// the value passed as the third parameter.
-func Xsqlite3PagerRekey(tls *libc.TLS, pPg uintptr, iNew Pgno, flags U16) { /* sqlite3.c:59839:21: */
+func Xsqlite3PagerRekey(tls *libc.TLS, pPg uintptr, iNew Pgno, flags U16) { /* sqlite3.c:59856:21: */
(*DbPage)(unsafe.Pointer(pPg)).Fflags = flags
Xsqlite3PcacheMove(tls, pPg, iNew)
}
// Return a pointer to the data for the specified page.
-func Xsqlite3PagerGetData(tls *libc.TLS, pPg uintptr) uintptr { /* sqlite3.c:59848:21: */
+func Xsqlite3PagerGetData(tls *libc.TLS, pPg uintptr) uintptr { /* sqlite3.c:59865:21: */
return (*DbPage)(unsafe.Pointer(pPg)).FpData
}
// Return a pointer to the Pager.nExtra bytes of "extra" space
// allocated along with the specified page.
-func Xsqlite3PagerGetExtra(tls *libc.TLS, pPg uintptr) uintptr { /* sqlite3.c:59857:21: */
+func Xsqlite3PagerGetExtra(tls *libc.TLS, pPg uintptr) uintptr { /* sqlite3.c:59874:21: */
return (*DbPage)(unsafe.Pointer(pPg)).FpExtra
}
@@ -37263,9 +37856,9 @@ func Xsqlite3PagerGetExtra(tls *libc.TLS, pPg uintptr) uintptr { /* sqlite3.c:59
// The returned value is either PAGER_LOCKINGMODE_NORMAL or
// PAGER_LOCKINGMODE_EXCLUSIVE, indicating the current (possibly updated)
// locking-mode.
-func Xsqlite3PagerLockingMode(tls *libc.TLS, pPager uintptr, eMode int32) int32 { /* sqlite3.c:59871:20: */
+func Xsqlite3PagerLockingMode(tls *libc.TLS, pPager uintptr, eMode int32) int32 { /* sqlite3.c:59888:20: */
- if ((eMode >= 0) && !(int32((*Pager)(unsafe.Pointer(pPager)).FtempFile) != 0)) && !(Xsqlite3WalHeapMemory(tls, (*Pager)(unsafe.Pointer(pPager)).FpWal) != 0) {
+ if eMode >= 0 && !(int32((*Pager)(unsafe.Pointer(pPager)).FtempFile) != 0) && !(Xsqlite3WalHeapMemory(tls, (*Pager)(unsafe.Pointer(pPager)).FpWal) != 0) {
(*Pager)(unsafe.Pointer(pPager)).FexclusiveMode = U8(eMode)
}
return int32((*Pager)(unsafe.Pointer(pPager)).FexclusiveMode)
@@ -37289,7 +37882,7 @@ func Xsqlite3PagerLockingMode(tls *libc.TLS, pPager uintptr, eMode int32) int32
// * Temporary databases cannot have _WAL journalmode.
//
// The returned indicate the current (possibly updated) journal-mode.
-func Xsqlite3PagerSetJournalMode(tls *libc.TLS, pPager uintptr, eMode int32) int32 { /* sqlite3.c:59904:20: */
+func Xsqlite3PagerSetJournalMode(tls *libc.TLS, pPager uintptr, eMode int32) int32 { /* sqlite3.c:59921:20: */
var eOld U8 = (*Pager)(unsafe.Pointer(pPager)).FjournalMode // Prior journalmode
// The eMode parameter is always valid
@@ -37302,7 +37895,7 @@ func Xsqlite3PagerSetJournalMode(tls *libc.TLS, pPager uintptr, eMode int32) int
// anything other than MEMORY or OFF
if (*Pager)(unsafe.Pointer(pPager)).FmemDb != 0 {
- if (eMode != PAGER_JOURNALMODE_MEMORY) && (eMode != PAGER_JOURNALMODE_OFF) {
+ if eMode != PAGER_JOURNALMODE_MEMORY && eMode != PAGER_JOURNALMODE_OFF {
eMode = int32(eOld)
}
}
@@ -37317,7 +37910,7 @@ func Xsqlite3PagerSetJournalMode(tls *libc.TLS, pPager uintptr, eMode int32) int
// mode except WAL, unless the pager is in locking_mode=exclusive mode,
// delete the journal file.
- if (!(int32((*Pager)(unsafe.Pointer(pPager)).FexclusiveMode) != 0) && ((int32(eOld) & 5) == 1)) && ((eMode & 1) == 0) {
+ if !(int32((*Pager)(unsafe.Pointer(pPager)).FexclusiveMode) != 0) && int32(eOld)&5 == 1 && eMode&1 == 0 {
// In this case we would like to delete the journal file. If it is
// not possible, then that is not a problem. Deleting the journal file
@@ -37343,7 +37936,7 @@ func Xsqlite3PagerSetJournalMode(tls *libc.TLS, pPager uintptr, eMode int32) int
if rc == SQLITE_OK {
Xsqlite3OsDelete(tls, (*Pager)(unsafe.Pointer(pPager)).FpVfs, (*Pager)(unsafe.Pointer(pPager)).FzJournal, 0)
}
- if (rc == SQLITE_OK) && (state == PAGER_READER) {
+ if rc == SQLITE_OK && state == PAGER_READER {
pagerUnlockDb(tls, pPager, SHARED_LOCK)
} else if state == PAGER_OPEN {
pager_unlock(tls, pPager)
@@ -37360,19 +37953,19 @@ func Xsqlite3PagerSetJournalMode(tls *libc.TLS, pPager uintptr, eMode int32) int
}
// Return the current journal mode.
-func Xsqlite3PagerGetJournalMode(tls *libc.TLS, pPager uintptr) int32 { /* sqlite3.c:59995:20: */
+func Xsqlite3PagerGetJournalMode(tls *libc.TLS, pPager uintptr) int32 { /* sqlite3.c:60012:20: */
return int32((*Pager)(unsafe.Pointer(pPager)).FjournalMode)
}
// Return TRUE if the pager is in a state where it is OK to change the
// journalmode. Journalmode changes can only happen when the database
// is unmodified.
-func Xsqlite3PagerOkToChangeJournalMode(tls *libc.TLS, pPager uintptr) int32 { /* sqlite3.c:60004:20: */
+func Xsqlite3PagerOkToChangeJournalMode(tls *libc.TLS, pPager uintptr) int32 { /* sqlite3.c:60021:20: */
if int32((*Pager)(unsafe.Pointer(pPager)).FeState) >= PAGER_WRITER_CACHEMOD {
return 0
}
- if ((*Sqlite3_file)(unsafe.Pointer(((*Pager)(unsafe.Pointer(pPager)).Fjfd))).FpMethods != uintptr(0)) && ((*Pager)(unsafe.Pointer(pPager)).FjournalOff > int64(0)) {
+ if (*Sqlite3_file)(unsafe.Pointer((*Pager)(unsafe.Pointer(pPager)).Fjfd)).FpMethods != uintptr(0) && (*Pager)(unsafe.Pointer(pPager)).FjournalOff > int64(0) {
return 0
}
return 1
@@ -37382,7 +37975,7 @@ func Xsqlite3PagerOkToChangeJournalMode(tls *libc.TLS, pPager uintptr) int32 { /
//
// Setting the size limit to -1 means no limit is enforced.
// An attempt to set a limit smaller than -1 is a no-op.
-func Xsqlite3PagerJournalSizeLimit(tls *libc.TLS, pPager uintptr, iLimit I64) I64 { /* sqlite3.c:60017:20: */
+func Xsqlite3PagerJournalSizeLimit(tls *libc.TLS, pPager uintptr, iLimit I64) I64 { /* sqlite3.c:60034:20: */
if iLimit >= int64(-1) {
(*Pager)(unsafe.Pointer(pPager)).FjournalSizeLimit = iLimit
Xsqlite3WalLimit(tls, (*Pager)(unsafe.Pointer(pPager)).FpWal, iLimit)
@@ -37394,12 +37987,12 @@ func Xsqlite3PagerJournalSizeLimit(tls *libc.TLS, pPager uintptr, iLimit I64) I6
// in backup.c maintains the content of this variable. This module
// uses it opaquely as an argument to sqlite3BackupRestart() and
// sqlite3BackupUpdate() only.
-func Xsqlite3PagerBackupPtr(tls *libc.TLS, pPager uintptr) uintptr { /* sqlite3.c:60031:31: */
- return (pPager + 88 /* &.pBackup */)
+func Xsqlite3PagerBackupPtr(tls *libc.TLS, pPager uintptr) uintptr { /* sqlite3.c:60048:31: */
+ return pPager + 96
}
// Unless this is an in-memory or temporary database, clear the pager cache.
-func Xsqlite3PagerClearCache(tls *libc.TLS, pPager uintptr) { /* sqlite3.c:60039:21: */
+func Xsqlite3PagerClearCache(tls *libc.TLS, pPager uintptr) { /* sqlite3.c:60056:21: */
if int32((*Pager)(unsafe.Pointer(pPager)).FtempFile) == 0 {
pager_reset(tls, pPager)
@@ -37411,7 +38004,7 @@ func Xsqlite3PagerClearCache(tls *libc.TLS, pPager uintptr) { /* sqlite3.c:60039
// or wal_blocking_checkpoint() API functions.
//
// Parameter eMode is one of SQLITE_CHECKPOINT_PASSIVE, FULL or RESTART.
-func Xsqlite3PagerCheckpoint(tls *libc.TLS, pPager uintptr, db uintptr, eMode int32, pnLog uintptr, pnCkpt uintptr) int32 { /* sqlite3.c:60054:20: */
+func Xsqlite3PagerCheckpoint(tls *libc.TLS, pPager uintptr, db uintptr, eMode int32, pnLog uintptr, pnCkpt uintptr) int32 { /* sqlite3.c:60071:20: */
var rc int32 = SQLITE_OK
if (*Pager)(unsafe.Pointer(pPager)).FpWal != 0 {
rc = Xsqlite3WalCheckpoint(tls, (*Pager)(unsafe.Pointer(pPager)).FpWal, db, eMode,
@@ -37422,29 +38015,29 @@ func Xsqlite3PagerCheckpoint(tls *libc.TLS, pPager uintptr, db uintptr, eMode in
return (*Pager)(unsafe.Pointer(pPager)).FxBusyHandler
}(),
(*Pager)(unsafe.Pointer(pPager)).FpBusyHandlerArg,
- int32((*Pager)(unsafe.Pointer(pPager)).FwalSyncFlags), (*Pager)(unsafe.Pointer(pPager)).FpageSize, (*Pager)(unsafe.Pointer(pPager)).FpTmpSpace,
+ int32((*Pager)(unsafe.Pointer(pPager)).FwalSyncFlags), int32((*Pager)(unsafe.Pointer(pPager)).FpageSize), (*Pager)(unsafe.Pointer(pPager)).FpTmpSpace,
pnLog, pnCkpt)
}
return rc
}
-func Xsqlite3PagerWalCallback(tls *libc.TLS, pPager uintptr) int32 { /* sqlite3.c:60073:20: */
+func Xsqlite3PagerWalCallback(tls *libc.TLS, pPager uintptr) int32 { /* sqlite3.c:60090:20: */
return Xsqlite3WalCallback(tls, (*Pager)(unsafe.Pointer(pPager)).FpWal)
}
// Return true if the underlying VFS for the given pager supports the
// primitives necessary for write-ahead logging.
-func Xsqlite3PagerWalSupported(tls *libc.TLS, pPager uintptr) int32 { /* sqlite3.c:60081:20: */
+func Xsqlite3PagerWalSupported(tls *libc.TLS, pPager uintptr) int32 { /* sqlite3.c:60098:20: */
var pMethods uintptr = (*Sqlite3_file)(unsafe.Pointer((*Pager)(unsafe.Pointer(pPager)).Ffd)).FpMethods
if (*Pager)(unsafe.Pointer(pPager)).FnoLock != 0 {
return 0
}
- return (libc.Bool32(((*Pager)(unsafe.Pointer(pPager)).FexclusiveMode != 0) || (((*Sqlite3_io_methods)(unsafe.Pointer(pMethods)).FiVersion >= 2) && ((*Sqlite3_io_methods)(unsafe.Pointer(pMethods)).FxShmMap != 0))))
+ return libc.Bool32((*Pager)(unsafe.Pointer(pPager)).FexclusiveMode != 0 || (*Sqlite3_io_methods)(unsafe.Pointer(pMethods)).FiVersion >= 2 && (*Sqlite3_io_methods)(unsafe.Pointer(pMethods)).FxShmMap != 0)
}
// Attempt to take an exclusive lock on the database file. If a PENDING lock
// is obtained instead, immediately release it.
-func pagerExclusiveLock(tls *libc.TLS, pPager uintptr) int32 { /* sqlite3.c:60091:12: */
+func pagerExclusiveLock(tls *libc.TLS, pPager uintptr) int32 { /* sqlite3.c:60108:12: */
var rc int32 // Return code
rc = pagerLockDb(tls, pPager, EXCLUSIVE_LOCK)
@@ -37461,7 +38054,7 @@ func pagerExclusiveLock(tls *libc.TLS, pPager uintptr) int32 { /* sqlite3.c:6009
// exclusive-locking mode when this function is called, take an EXCLUSIVE
// lock on the database file and use heap-memory to store the wal-index
// in. Otherwise, use the normal shared-memory.
-func pagerOpenWal(tls *libc.TLS, pPager uintptr) int32 { /* sqlite3.c:60111:12: */
+func pagerOpenWal(tls *libc.TLS, pPager uintptr) int32 { /* sqlite3.c:60128:12: */
var rc int32 = SQLITE_OK
// If the pager is already in exclusive-mode, the WAL module will use
@@ -37477,7 +38070,7 @@ func pagerOpenWal(tls *libc.TLS, pPager uintptr) int32 { /* sqlite3.c:60111:12:
if rc == SQLITE_OK {
rc = Xsqlite3WalOpen(tls, (*Pager)(unsafe.Pointer(pPager)).FpVfs,
(*Pager)(unsafe.Pointer(pPager)).Ffd, (*Pager)(unsafe.Pointer(pPager)).FzWal, int32((*Pager)(unsafe.Pointer(pPager)).FexclusiveMode),
- (*Pager)(unsafe.Pointer(pPager)).FjournalSizeLimit, (pPager + 216 /* &.pWal */))
+ (*Pager)(unsafe.Pointer(pPager)).FjournalSizeLimit, pPager+232)
}
pagerFixMaplimit(tls, pPager)
@@ -37497,7 +38090,7 @@ func pagerOpenWal(tls *libc.TLS, pPager uintptr) int32 { /* sqlite3.c:60111:12:
// If the pager is open on a temp-file (or in-memory database), or if
// the WAL file is already open, set *pbOpen to 1 and return SQLITE_OK
// without doing anything.
-func Xsqlite3PagerOpenWal(tls *libc.TLS, pPager uintptr, pbOpen uintptr) int32 { /* sqlite3.c:60156:20: */
+func Xsqlite3PagerOpenWal(tls *libc.TLS, pPager uintptr, pbOpen uintptr) int32 { /* sqlite3.c:60173:20: */
var rc int32 = SQLITE_OK // Return code
if !(int32((*Pager)(unsafe.Pointer(pPager)).FtempFile) != 0) && !(int32((*Pager)(unsafe.Pointer(pPager)).FpWal) != 0) {
@@ -37527,7 +38120,7 @@ func Xsqlite3PagerOpenWal(tls *libc.TLS, pPager uintptr, pbOpen uintptr) int32 {
// EXCLUSIVE lock on the database file. If this cannot be obtained, an
// error (SQLITE_BUSY) is returned and the log connection is not closed.
// If successful, the EXCLUSIVE lock is not released before returning.
-func Xsqlite3PagerCloseWal(tls *libc.TLS, pPager uintptr, db uintptr) int32 { /* sqlite3.c:60195:20: */
+func Xsqlite3PagerCloseWal(tls *libc.TLS, pPager uintptr, db uintptr) int32 { /* sqlite3.c:60212:20: */
bp := tls.Alloc(4)
defer tls.Free(4)
@@ -37543,21 +38136,21 @@ func Xsqlite3PagerCloseWal(tls *libc.TLS, pPager uintptr, db uintptr) int32 { /*
rc = Xsqlite3OsAccess(tls,
(*Pager)(unsafe.Pointer(pPager)).FpVfs, (*Pager)(unsafe.Pointer(pPager)).FzWal, SQLITE_ACCESS_EXISTS, bp /* &logexists */)
}
- if (rc == SQLITE_OK) && (*(*int32)(unsafe.Pointer(bp /* logexists */)) != 0) {
+ if rc == SQLITE_OK && *(*int32)(unsafe.Pointer(bp)) != 0 {
rc = pagerOpenWal(tls, pPager)
}
}
// Checkpoint and close the log. Because an EXCLUSIVE lock is held on
// the database file, the log and log-summary files will be deleted.
- if (rc == SQLITE_OK) && ((*Pager)(unsafe.Pointer(pPager)).FpWal != 0) {
+ if rc == SQLITE_OK && (*Pager)(unsafe.Pointer(pPager)).FpWal != 0 {
rc = pagerExclusiveLock(tls, pPager)
if rc == SQLITE_OK {
rc = Xsqlite3WalClose(tls, (*Pager)(unsafe.Pointer(pPager)).FpWal, db, int32((*Pager)(unsafe.Pointer(pPager)).FwalSyncFlags),
- (*Pager)(unsafe.Pointer(pPager)).FpageSize, (*Pager)(unsafe.Pointer(pPager)).FpTmpSpace)
+ int32((*Pager)(unsafe.Pointer(pPager)).FpageSize), (*Pager)(unsafe.Pointer(pPager)).FpTmpSpace)
(*Pager)(unsafe.Pointer(pPager)).FpWal = uintptr(0)
pagerFixMaplimit(tls, pPager)
- if (rc != 0) && !(int32((*Pager)(unsafe.Pointer(pPager)).FexclusiveMode) != 0) {
+ if rc != 0 && !(int32((*Pager)(unsafe.Pointer(pPager)).FexclusiveMode) != 0) {
pagerUnlockDb(tls, pPager, SHARED_LOCK)
}
}
@@ -37567,7 +38160,7 @@ func Xsqlite3PagerCloseWal(tls *libc.TLS, pPager uintptr, db uintptr) int32 { /*
// If this is a WAL database, obtain a snapshot handle for the snapshot
// currently open. Otherwise, return an error.
-func Xsqlite3PagerSnapshotGet(tls *libc.TLS, pPager uintptr, ppSnapshot uintptr) int32 { /* sqlite3.c:60264:20: */
+func Xsqlite3PagerSnapshotGet(tls *libc.TLS, pPager uintptr, ppSnapshot uintptr) int32 { /* sqlite3.c:60281:20: */
var rc int32 = SQLITE_ERROR
if (*Pager)(unsafe.Pointer(pPager)).FpWal != 0 {
rc = Xsqlite3WalSnapshotGet(tls, (*Pager)(unsafe.Pointer(pPager)).FpWal, ppSnapshot)
@@ -37578,7 +38171,7 @@ func Xsqlite3PagerSnapshotGet(tls *libc.TLS, pPager uintptr, ppSnapshot uintptr)
// If this is a WAL database, store a pointer to pSnapshot. Next time a
// read transaction is opened, attempt to read from the snapshot it
// identifies. If this is not a WAL database, return an error.
-func Xsqlite3PagerSnapshotOpen(tls *libc.TLS, pPager uintptr, pSnapshot uintptr) int32 { /* sqlite3.c:60277:20: */
+func Xsqlite3PagerSnapshotOpen(tls *libc.TLS, pPager uintptr, pSnapshot uintptr) int32 { /* sqlite3.c:60294:20: */
var rc int32 = SQLITE_OK
if (*Pager)(unsafe.Pointer(pPager)).FpWal != 0 {
Xsqlite3WalSnapshotOpen(tls, (*Pager)(unsafe.Pointer(pPager)).FpWal, pSnapshot)
@@ -37590,7 +38183,7 @@ func Xsqlite3PagerSnapshotOpen(tls *libc.TLS, pPager uintptr, pSnapshot uintptr)
// If this is a WAL database, call sqlite3WalSnapshotRecover(). If this
// is not a WAL database, return an error.
-func Xsqlite3PagerSnapshotRecover(tls *libc.TLS, pPager uintptr) int32 { /* sqlite3.c:60294:20: */
+func Xsqlite3PagerSnapshotRecover(tls *libc.TLS, pPager uintptr) int32 { /* sqlite3.c:60311:20: */
var rc int32
if (*Pager)(unsafe.Pointer(pPager)).FpWal != 0 {
rc = Xsqlite3WalSnapshotRecover(tls, (*Pager)(unsafe.Pointer(pPager)).FpWal)
@@ -37610,7 +38203,7 @@ func Xsqlite3PagerSnapshotRecover(tls *libc.TLS, pPager uintptr) int32 { /* sqli
// the CHECKPOINTER lock cannot be obtained, SQLITE_BUSY. If any error
// occurs (any value other than SQLITE_OK is returned), the CHECKPOINTER
// lock is released before returning.
-func Xsqlite3PagerSnapshotCheck(tls *libc.TLS, pPager uintptr, pSnapshot uintptr) int32 { /* sqlite3.c:60316:20: */
+func Xsqlite3PagerSnapshotCheck(tls *libc.TLS, pPager uintptr, pSnapshot uintptr) int32 { /* sqlite3.c:60333:20: */
var rc int32
if (*Pager)(unsafe.Pointer(pPager)).FpWal != 0 {
rc = Xsqlite3WalSnapshotCheck(tls, (*Pager)(unsafe.Pointer(pPager)).FpWal, pSnapshot)
@@ -37622,7 +38215,7 @@ func Xsqlite3PagerSnapshotCheck(tls *libc.TLS, pPager uintptr, pSnapshot uintptr
// Release a lock obtained by an earlier successful call to
// sqlite3PagerSnapshotCheck().
-func Xsqlite3PagerSnapshotUnlock(tls *libc.TLS, pPager uintptr) { /* sqlite3.c:60330:21: */
+func Xsqlite3PagerSnapshotUnlock(tls *libc.TLS, pPager uintptr) { /* sqlite3.c:60347:21: */
Xsqlite3WalSnapshotUnlock(tls, (*Pager)(unsafe.Pointer(pPager)).FpWal)
}
@@ -37791,7 +38384,10 @@ func Xsqlite3PagerSnapshotUnlock(tls *libc.TLS, pPager uintptr) { /* sqlite3.c:6
// HASHTABLE_NPAGE_ONE frames. The values of HASHTABLE_NPAGE_ONE and
// HASHTABLE_NPAGE are selected so that together the wal-index header and
// first index block are the same size as all other index blocks in the
-// wal-index.
+// wal-index. The values are:
+//
+// HASHTABLE_NPAGE 4096
+// HASHTABLE_NPAGE_ONE 4062
//
// Each index block contains two sections, a page-mapping that contains the
// database page number associated with each wal frame, and a hash-table
@@ -37916,7 +38512,7 @@ type WalIndexHdr1 = struct {
FaFrameCksum [2]U32
FaSalt [2]U32
FaCksum [2]U32
-} /* sqlite3.c:1331:9 */
+} /* sqlite3.c:578:9 */
//************* End of pager.c **********************************************
//************* Begin file wal.c ********************************************
@@ -38082,7 +38678,10 @@ type WalIndexHdr1 = struct {
// HASHTABLE_NPAGE_ONE frames. The values of HASHTABLE_NPAGE_ONE and
// HASHTABLE_NPAGE are selected so that together the wal-index header and
// first index block are the same size as all other index blocks in the
-// wal-index.
+// wal-index. The values are:
+//
+// HASHTABLE_NPAGE 4096
+// HASHTABLE_NPAGE_ONE 4062
//
// Each index block contains two sections, a page-mapping that contains the
// database page number associated with each wal frame, and a hash-table
@@ -38195,7 +38794,7 @@ type WalIndexHdr1 = struct {
// byte.
// Object declarations
-type WalIndexHdr = WalIndexHdr1 /* sqlite3.c:60655:28 */
+type WalIndexHdr = WalIndexHdr1 /* sqlite3.c:60675:28 */
type WalIterator1 = struct {
FiPrior U32
FnSegment int32
@@ -38206,18 +38805,18 @@ type WalIterator1 = struct {
FnEntry int32
FiZero int32
}
-} /* sqlite3.c:60656:9 */
+} /* sqlite3.c:60676:9 */
-type WalIterator = WalIterator1 /* sqlite3.c:60656:28 */
+type WalIterator = WalIterator1 /* sqlite3.c:60676:28 */
type WalCkptInfo1 = struct {
FnBackfill U32
FaReadMark [5]U32
FaLock [8]U8
FnBackfillAttempted U32
FnotUsed0 U32
-} /* sqlite3.c:60657:9 */
+} /* sqlite3.c:60677:9 */
-type WalCkptInfo = WalCkptInfo1 /* sqlite3.c:60657:28 */
+type WalCkptInfo = WalCkptInfo1 /* sqlite3.c:60677:28 */
// Candidate values for Wal.exclusiveMode.
@@ -38225,7 +38824,7 @@ type WalCkptInfo = WalCkptInfo1 /* sqlite3.c:60657:28 */
// Each page of the wal-index mapping contains a hash-table made up of
// an array of HASHTABLE_NSLOT elements of the following type.
-type Ht_slot = U16 /* sqlite3.c:60848:13 */
+type Ht_slot = U16 /* sqlite3.c:60932:13 */
// This structure is used to implement an iterator that loops through
// all frames in the WAL in database page order. Where two or more frames
@@ -38246,7 +38845,7 @@ type WalSegment = struct {
FaPgno uintptr
FnEntry int32
FiZero int32
-} /* sqlite3.c:60656:9 */
+} /* sqlite3.c:60676:9 */
// Define the parameters of the hash tables in the wal-index file. There
// is a hash-table following every HASHTABLE_NPAGE page numbers in the
@@ -38270,44 +38869,48 @@ type WalSegment = struct {
// so. It is safe to enlarge the wal-index if pWal->writeLock is true
// or pWal->exclusiveMode==WAL_HEAPMEMORY_MODE.
//
-// If this call is successful, *ppPage is set to point to the wal-index
-// page and SQLITE_OK is returned. If an error (an OOM or VFS error) occurs,
-// then an SQLite error code is returned and *ppPage is set to 0.
-func walIndexPageRealloc(tls *libc.TLS, pWal uintptr, iPage int32, ppPage uintptr) int32 { /* sqlite3.c:60915:28: */
+// Three possible result scenarios:
+//
+// (1) rc==SQLITE_OK and *ppPage==Requested-Wal-Index-Page
+// (2) rc>=SQLITE_ERROR and *ppPage==NULL
+// (3) rc==SQLITE_OK and *ppPage==NULL // only if iPage==0
+//
+// Scenario (3) can only occur when pWal->writeLock is false and iPage==0
+func walIndexPageRealloc(tls *libc.TLS, pWal uintptr, iPage int32, ppPage uintptr) int32 { /* sqlite3.c:61003:28: */
var rc int32 = SQLITE_OK
// Enlarge the pWal->apWiData[] array if required
if (*Wal)(unsafe.Pointer(pWal)).FnWiData <= iPage {
- var nByte Sqlite3_int64 = (Sqlite3_int64(uint32(unsafe.Sizeof(uintptr(0))) * (uint32(iPage + 1))))
+ var nByte Sqlite3_int64 = Sqlite3_int64(uint32(unsafe.Sizeof(uintptr(0))) * uint32(iPage+1))
var apNew uintptr
libc.AtomicStoreUintptr(&apNew, uintptr(Xsqlite3Realloc(tls, (*Wal)(unsafe.Pointer(pWal)).FapWiData, uint64(nByte))))
if !(apNew != 0) {
*(*uintptr)(unsafe.Pointer(ppPage)) = uintptr(0)
return SQLITE_NOMEM
}
- libc.Xmemset(tls, (apNew + uintptr((*Wal)(unsafe.Pointer(pWal)).FnWiData)*4), 0,
- (uint32(unsafe.Sizeof(uintptr(0))) * (uint32((iPage + 1) - (*Wal)(unsafe.Pointer(pWal)).FnWiData))))
+ libc.Xmemset(tls, apNew+uintptr((*Wal)(unsafe.Pointer(pWal)).FnWiData)*4, 0,
+ uint32(unsafe.Sizeof(uintptr(0)))*uint32(iPage+1-(*Wal)(unsafe.Pointer(pWal)).FnWiData))
(*Wal)(unsafe.Pointer(pWal)).FapWiData = apNew
- (*Wal)(unsafe.Pointer(pWal)).FnWiData = (iPage + 1)
+ (*Wal)(unsafe.Pointer(pWal)).FnWiData = iPage + 1
}
// Request a pointer to the required page from the VFS
if int32((*Wal)(unsafe.Pointer(pWal)).FexclusiveMode) == WAL_HEAPMEMORY_MODE {
- *(*uintptr)(unsafe.Pointer((*Wal)(unsafe.Pointer(pWal)).FapWiData + uintptr(iPage)*4)) = Xsqlite3MallocZero(tls, (uint64((uint32(unsafe.Sizeof(Ht_slot(0))) * (uint32(HASHTABLE_NPAGE * 2))) + (uint32(HASHTABLE_NPAGE) * uint32(unsafe.Sizeof(U32(0)))))))
+ *(*uintptr)(unsafe.Pointer((*Wal)(unsafe.Pointer(pWal)).FapWiData + uintptr(iPage)*4)) = Xsqlite3MallocZero(tls, uint64(uint32(unsafe.Sizeof(Ht_slot(0)))*uint32(HASHTABLE_NPAGE*2)+uint32(HASHTABLE_NPAGE)*uint32(unsafe.Sizeof(U32(0)))))
if !(int32(*(*uintptr)(unsafe.Pointer((*Wal)(unsafe.Pointer(pWal)).FapWiData + uintptr(iPage)*4))) != 0) {
rc = SQLITE_NOMEM
}
} else {
- rc = Xsqlite3OsShmMap(tls, (*Wal)(unsafe.Pointer(pWal)).FpDbFd, iPage, (int32((uint32(unsafe.Sizeof(Ht_slot(0))) * (uint32(HASHTABLE_NPAGE * 2))) + (uint32(HASHTABLE_NPAGE) * uint32(unsafe.Sizeof(U32(0)))))),
- int32((*Wal)(unsafe.Pointer(pWal)).FwriteLock), ((*Wal)(unsafe.Pointer(pWal)).FapWiData + uintptr(iPage)*4))
+ rc = Xsqlite3OsShmMap(tls, (*Wal)(unsafe.Pointer(pWal)).FpDbFd, iPage, int32(uint32(unsafe.Sizeof(Ht_slot(0)))*uint32(HASHTABLE_NPAGE*2)+uint32(HASHTABLE_NPAGE)*uint32(unsafe.Sizeof(U32(0)))),
+ int32((*Wal)(unsafe.Pointer(pWal)).FwriteLock), (*Wal)(unsafe.Pointer(pWal)).FapWiData+uintptr(iPage)*4)
if rc == SQLITE_OK {
- if (iPage > 0) && (Xsqlite3FaultSim(tls, 600) != 0) {
+ if iPage > 0 && Xsqlite3FaultSim(tls, 600) != 0 {
rc = SQLITE_NOMEM
}
- } else if (rc & 0xff) == SQLITE_READONLY {
- *(*U8)(unsafe.Pointer(pWal + 46 /* &.readOnly */)) |= U8((WAL_SHM_RDONLY))
+ } else if rc&0xff == SQLITE_READONLY {
+ *(*U8)(unsafe.Pointer(pWal + 46)) |= U8(WAL_SHM_RDONLY)
if rc == SQLITE_READONLY {
rc = SQLITE_OK
}
@@ -38319,21 +38922,21 @@ func walIndexPageRealloc(tls *libc.TLS, pWal uintptr, iPage int32, ppPage uintpt
return rc
}
-func walIndexPage(tls *libc.TLS, pWal uintptr, iPage int32, ppPage uintptr) int32 { /* sqlite3.c:60962:12: */
- if ((*Wal)(unsafe.Pointer(pWal)).FnWiData <= iPage) || ((libc.AssignPtrUintptr(ppPage, *(*uintptr)(unsafe.Pointer((*Wal)(unsafe.Pointer(pWal)).FapWiData + uintptr(iPage)*4)))) == uintptr(0)) {
+func walIndexPage(tls *libc.TLS, pWal uintptr, iPage int32, ppPage uintptr) int32 { /* sqlite3.c:61052:12: */
+ if (*Wal)(unsafe.Pointer(pWal)).FnWiData <= iPage || libc.AssignPtrUintptr(ppPage, *(*uintptr)(unsafe.Pointer((*Wal)(unsafe.Pointer(pWal)).FapWiData + uintptr(iPage)*4))) == uintptr(0) {
return walIndexPageRealloc(tls, pWal, iPage, ppPage)
}
return SQLITE_OK
}
// Return a pointer to the WalCkptInfo structure in the wal-index.
-func walCkptInfo(tls *libc.TLS, pWal uintptr) uintptr { /* sqlite3.c:60976:29: */
+func walCkptInfo(tls *libc.TLS, pWal uintptr) uintptr { /* sqlite3.c:61066:29: */
- return (*(*uintptr)(unsafe.Pointer((*Wal)(unsafe.Pointer(pWal)).FapWiData)) + 24*4)
+ return *(*uintptr)(unsafe.Pointer((*Wal)(unsafe.Pointer(pWal)).FapWiData)) + 24*4
}
// Return a pointer to the WalIndexHdr structure in the wal-index.
-func walIndexHdr(tls *libc.TLS, pWal uintptr) uintptr { /* sqlite3.c:60984:29: */
+func walIndexHdr(tls *libc.TLS, pWal uintptr) uintptr { /* sqlite3.c:61074:29: */
return *(*uintptr)(unsafe.Pointer((*Wal)(unsafe.Pointer(pWal)).FapWiData))
}
@@ -38351,11 +38954,11 @@ func walIndexHdr(tls *libc.TLS, pWal uintptr) uintptr { /* sqlite3.c:60984:29: *
// The checksum is written back into aOut[] before returning.
//
// nByte must be a positive multiple of 8.
-func walChecksumBytes(tls *libc.TLS, nativeCksum int32, a uintptr, nByte int32, aIn uintptr, aOut uintptr) { /* sqlite3.c:61010:13: */
+func walChecksumBytes(tls *libc.TLS, nativeCksum int32, a uintptr, nByte int32, aIn uintptr, aOut uintptr) { /* sqlite3.c:61100:13: */
var s1 U32
var s2 U32
var aData uintptr = a
- var aEnd uintptr = (a + uintptr(nByte))
+ var aEnd uintptr = a + uintptr(nByte)
if aIn != 0 {
s1 = *(*U32)(unsafe.Pointer(aIn))
@@ -38365,15 +38968,15 @@ func walChecksumBytes(tls *libc.TLS, nativeCksum int32, a uintptr, nByte int32,
}
if nativeCksum != 0 {
- for ok := true; ok; ok = (aData < aEnd) {
+ for ok := true; ok; ok = aData < aEnd {
s1 = s1 + (*(*U32)(unsafe.Pointer(libc.PostIncUintptr(&aData, 4))) + s2)
s2 = s2 + (*(*U32)(unsafe.Pointer(libc.PostIncUintptr(&aData, 4))) + s1)
}
} else {
- for ok1 := true; ok1; ok1 = (aData < aEnd) {
- s1 = s1 + (((((((*(*U32)(unsafe.Pointer(aData))) & U32(0x000000FF)) << 24) + (((*(*U32)(unsafe.Pointer(aData))) & U32(0x0000FF00)) << 8)) + (((*(*U32)(unsafe.Pointer(aData))) & U32(0x00FF0000)) >> 8)) + (((*(*U32)(unsafe.Pointer(aData))) & 0xFF000000) >> 24)) + s2)
- s2 = s2 + (((((((*(*U32)(unsafe.Pointer(aData + 1*4))) & U32(0x000000FF)) << 24) + (((*(*U32)(unsafe.Pointer(aData + 1*4))) & U32(0x0000FF00)) << 8)) + (((*(*U32)(unsafe.Pointer(aData + 1*4))) & U32(0x00FF0000)) >> 8)) + (((*(*U32)(unsafe.Pointer(aData + 1*4))) & 0xFF000000) >> 24)) + s1)
- aData += 4 * (uintptr(2))
+ for ok1 := true; ok1; ok1 = aData < aEnd {
+ s1 = s1 + (*(*U32)(unsafe.Pointer(aData))&U32(0x000000FF)<<24 + *(*U32)(unsafe.Pointer(aData))&U32(0x0000FF00)<<8 + *(*U32)(unsafe.Pointer(aData))&U32(0x00FF0000)>>8 + *(*U32)(unsafe.Pointer(aData))&0xFF000000>>24 + s2)
+ s2 = s2 + (*(*U32)(unsafe.Pointer(aData + 1*4))&U32(0x000000FF)<<24 + *(*U32)(unsafe.Pointer(aData + 1*4))&U32(0x0000FF00)<<8 + *(*U32)(unsafe.Pointer(aData + 1*4))&U32(0x00FF0000)>>8 + *(*U32)(unsafe.Pointer(aData + 1*4))&0xFF000000>>24 + s1)
+ aData += 4 * uintptr(2)
}
}
@@ -38383,7 +38986,7 @@ func walChecksumBytes(tls *libc.TLS, nativeCksum int32, a uintptr, nByte int32,
// If there is the possibility of concurrent access to the SHM file
// from multiple threads and/or processes, then do a memory barrier.
-func walShmBarrier(tls *libc.TLS, pWal uintptr) { /* sqlite3.c:61053:13: */
+func walShmBarrier(tls *libc.TLS, pWal uintptr) { /* sqlite3.c:61143:13: */
if int32((*Wal)(unsafe.Pointer(pWal)).FexclusiveMode) != WAL_HEAPMEMORY_MODE {
Xsqlite3OsShmBarrier(tls, (*Wal)(unsafe.Pointer(pWal)).FpDbFd)
}
@@ -38398,17 +39001,17 @@ func walShmBarrier(tls *libc.TLS, pWal uintptr) { /* sqlite3.c:61053:13: */
// Write the header information in pWal->hdr into the wal-index.
//
// The checksum on pWal->hdr is updated before it is written.
-func walIndexWriteHdr(tls *libc.TLS, pWal uintptr) { /* sqlite3.c:61077:28: */
+func walIndexWriteHdr(tls *libc.TLS, pWal uintptr) { /* sqlite3.c:61167:28: */
var aHdr uintptr = walIndexHdr(tls, pWal)
- var nCksum int32 = int32((uintptr(0) + 40 /* &.aCksum */))
+ var nCksum int32 = int32(uintptr(0) + 40)
(*Wal)(unsafe.Pointer(pWal)).Fhdr.FisInit = U8(1)
(*Wal)(unsafe.Pointer(pWal)).Fhdr.FiVersion = U32(WALINDEX_MAX_VERSION)
- walChecksumBytes(tls, 1, (pWal + 52 /* &.hdr */), nCksum, uintptr(0), pWal+52 /* &.hdr */ +40 /* &.aCksum */)
+ walChecksumBytes(tls, 1, pWal+52, nCksum, uintptr(0), pWal+52+40)
// Possible TSAN false-positive. See tag-20200519-1
- libc.Xmemcpy(tls, (aHdr + 1*48), (pWal + 52 /* &.hdr */), uint32(unsafe.Sizeof(WalIndexHdr{})))
+ libc.Xmemcpy(tls, aHdr+1*48, pWal+52, uint32(unsafe.Sizeof(WalIndexHdr{})))
walShmBarrier(tls, pWal)
- libc.Xmemcpy(tls, (aHdr), (pWal + 52 /* &.hdr */), uint32(unsafe.Sizeof(WalIndexHdr{})))
+ libc.Xmemcpy(tls, aHdr, pWal+52, uint32(unsafe.Sizeof(WalIndexHdr{})))
}
// This function encodes a single frame header and writes it to a buffer
@@ -38422,42 +39025,42 @@ func walIndexWriteHdr(tls *libc.TLS, pWal uintptr) { /* sqlite3.c:61077:28: */
// 12: Salt-2 (copied from the wal-header)
// 16: Checksum-1.
// 20: Checksum-2.
-func walEncodeFrame(tls *libc.TLS, pWal uintptr, iPage U32, nTruncate U32, aData uintptr, aFrame uintptr) { /* sqlite3.c:61104:13: */
- var nativeCksum int32 // True for native byte-order checksums
- var aCksum uintptr = pWal + 52 /* &.hdr */ + 24 /* &.aFrameCksum */
+func walEncodeFrame(tls *libc.TLS, pWal uintptr, iPage U32, nTruncate U32, aData uintptr, aFrame uintptr) { /* sqlite3.c:61194:13: */
+ var nativeCksum int32 // True for native byte-order checksums
+ var aCksum uintptr = pWal + 52 + 24
- Xsqlite3Put4byte(tls, (aFrame), iPage)
- Xsqlite3Put4byte(tls, (aFrame + 4), nTruncate)
+ Xsqlite3Put4byte(tls, aFrame, iPage)
+ Xsqlite3Put4byte(tls, aFrame+4, nTruncate)
if (*Wal)(unsafe.Pointer(pWal)).FiReCksum == U32(0) {
- libc.Xmemcpy(tls, (aFrame + 8), pWal+52 /* &.hdr */ +32 /* &.aSalt */, uint32(8))
+ libc.Xmemcpy(tls, aFrame+8, pWal+52+32, uint32(8))
- nativeCksum = (libc.Bool32(int32((*Wal)(unsafe.Pointer(pWal)).Fhdr.FbigEndCksum) == SQLITE_BIGENDIAN))
+ nativeCksum = libc.Bool32(int32((*Wal)(unsafe.Pointer(pWal)).Fhdr.FbigEndCksum) == SQLITE_BIGENDIAN)
walChecksumBytes(tls, nativeCksum, aFrame, 8, aCksum, aCksum)
walChecksumBytes(tls, nativeCksum, aData, int32((*Wal)(unsafe.Pointer(pWal)).FszPage), aCksum, aCksum)
- Xsqlite3Put4byte(tls, (aFrame + 16), *(*U32)(unsafe.Pointer(aCksum)))
- Xsqlite3Put4byte(tls, (aFrame + 20), *(*U32)(unsafe.Pointer(aCksum + 1*4)))
+ Xsqlite3Put4byte(tls, aFrame+16, *(*U32)(unsafe.Pointer(aCksum)))
+ Xsqlite3Put4byte(tls, aFrame+20, *(*U32)(unsafe.Pointer(aCksum + 1*4)))
} else {
- libc.Xmemset(tls, (aFrame + 8), 0, uint32(16))
+ libc.Xmemset(tls, aFrame+8, 0, uint32(16))
}
}
// Check to see if the frame with header in aFrame[] and content
// in aData[] is valid. If it is a valid frame, fill *piPage and
// *pnTruncate and return true. Return if the frame is not valid.
-func walDecodeFrame(tls *libc.TLS, pWal uintptr, piPage uintptr, pnTruncate uintptr, aData uintptr, aFrame uintptr) int32 { /* sqlite3.c:61135:12: */
- var nativeCksum int32 // True for native byte-order checksums
- var aCksum uintptr = pWal + 52 /* &.hdr */ + 24 /* &.aFrameCksum */
- var pgno U32 // Page number of the frame
+func walDecodeFrame(tls *libc.TLS, pWal uintptr, piPage uintptr, pnTruncate uintptr, aData uintptr, aFrame uintptr) int32 { /* sqlite3.c:61225:12: */
+ var nativeCksum int32 // True for native byte-order checksums
+ var aCksum uintptr = pWal + 52 + 24
+ var pgno U32 // Page number of the frame
// A frame is only valid if the salt values in the frame-header
// match the salt values in the wal-header.
- if libc.Xmemcmp(tls, (pWal+52 /* &.hdr */ +32 /* &.aSalt */), (aFrame+8), uint32(8)) != 0 {
+ if libc.Xmemcmp(tls, pWal+52+32, aFrame+8, uint32(8)) != 0 {
return 0
}
// A frame is only valid if the page number is creater than zero.
- pgno = Xsqlite3Get4byte(tls, (aFrame))
+ pgno = Xsqlite3Get4byte(tls, aFrame)
if pgno == U32(0) {
return 0
}
@@ -38466,11 +39069,11 @@ func walDecodeFrame(tls *libc.TLS, pWal uintptr, piPage uintptr, pnTruncate uint
// all prior frams, the first 16 bytes of this frame-header,
// and the frame-data matches the checksum in the last 8
// bytes of this frame-header.
- nativeCksum = (libc.Bool32(int32((*Wal)(unsafe.Pointer(pWal)).Fhdr.FbigEndCksum) == SQLITE_BIGENDIAN))
+ nativeCksum = libc.Bool32(int32((*Wal)(unsafe.Pointer(pWal)).Fhdr.FbigEndCksum) == SQLITE_BIGENDIAN)
walChecksumBytes(tls, nativeCksum, aFrame, 8, aCksum, aCksum)
walChecksumBytes(tls, nativeCksum, aData, int32((*Wal)(unsafe.Pointer(pWal)).FszPage), aCksum, aCksum)
- if (*(*U32)(unsafe.Pointer(aCksum)) != Xsqlite3Get4byte(tls, (aFrame+16))) ||
- (*(*U32)(unsafe.Pointer(aCksum + 1*4)) != Xsqlite3Get4byte(tls, (aFrame+20))) {
+ if *(*U32)(unsafe.Pointer(aCksum)) != Xsqlite3Get4byte(tls, aFrame+16) ||
+ *(*U32)(unsafe.Pointer(aCksum + 1*4)) != Xsqlite3Get4byte(tls, aFrame+20) {
// Checksum failed.
return 0
}
@@ -38478,7 +39081,7 @@ func walDecodeFrame(tls *libc.TLS, pWal uintptr, piPage uintptr, pnTruncate uint
// If we reach this point, the frame is valid. Return the page number
// and the new database size.
*(*U32)(unsafe.Pointer(piPage)) = pgno
- *(*U32)(unsafe.Pointer(pnTruncate)) = Xsqlite3Get4byte(tls, (aFrame + 4))
+ *(*U32)(unsafe.Pointer(pnTruncate)) = Xsqlite3Get4byte(tls, aFrame+4)
return 1
}
@@ -38487,56 +39090,56 @@ func walDecodeFrame(tls *libc.TLS, pWal uintptr, piPage uintptr, pnTruncate uint
// through the unlocked state first.
//
// In locking_mode=EXCLUSIVE, all of these routines become no-ops.
-func walLockShared(tls *libc.TLS, pWal uintptr, lockIdx int32) int32 { /* sqlite3.c:61214:12: */
+func walLockShared(tls *libc.TLS, pWal uintptr, lockIdx int32) int32 { /* sqlite3.c:61304:12: */
var rc int32
if (*Wal)(unsafe.Pointer(pWal)).FexclusiveMode != 0 {
return SQLITE_OK
}
rc = Xsqlite3OsShmLock(tls, (*Wal)(unsafe.Pointer(pWal)).FpDbFd, lockIdx, 1,
- (SQLITE_SHM_LOCK | SQLITE_SHM_SHARED))
+ SQLITE_SHM_LOCK|SQLITE_SHM_SHARED)
return rc
}
-func walUnlockShared(tls *libc.TLS, pWal uintptr, lockIdx int32) { /* sqlite3.c:61224:13: */
+func walUnlockShared(tls *libc.TLS, pWal uintptr, lockIdx int32) { /* sqlite3.c:61314:13: */
if (*Wal)(unsafe.Pointer(pWal)).FexclusiveMode != 0 {
return
}
Xsqlite3OsShmLock(tls, (*Wal)(unsafe.Pointer(pWal)).FpDbFd, lockIdx, 1,
- (SQLITE_SHM_UNLOCK | SQLITE_SHM_SHARED))
+ SQLITE_SHM_UNLOCK|SQLITE_SHM_SHARED)
}
-func walLockExclusive(tls *libc.TLS, pWal uintptr, lockIdx int32, n int32) int32 { /* sqlite3.c:61230:12: */
+func walLockExclusive(tls *libc.TLS, pWal uintptr, lockIdx int32, n int32) int32 { /* sqlite3.c:61320:12: */
var rc int32
if (*Wal)(unsafe.Pointer(pWal)).FexclusiveMode != 0 {
return SQLITE_OK
}
rc = Xsqlite3OsShmLock(tls, (*Wal)(unsafe.Pointer(pWal)).FpDbFd, lockIdx, n,
- (SQLITE_SHM_LOCK | SQLITE_SHM_EXCLUSIVE))
+ SQLITE_SHM_LOCK|SQLITE_SHM_EXCLUSIVE)
return rc
}
-func walUnlockExclusive(tls *libc.TLS, pWal uintptr, lockIdx int32, n int32) { /* sqlite3.c:61240:13: */
+func walUnlockExclusive(tls *libc.TLS, pWal uintptr, lockIdx int32, n int32) { /* sqlite3.c:61330:13: */
if (*Wal)(unsafe.Pointer(pWal)).FexclusiveMode != 0 {
return
}
Xsqlite3OsShmLock(tls, (*Wal)(unsafe.Pointer(pWal)).FpDbFd, lockIdx, n,
- (SQLITE_SHM_UNLOCK | SQLITE_SHM_EXCLUSIVE))
+ SQLITE_SHM_UNLOCK|SQLITE_SHM_EXCLUSIVE)
}
// Compute a hash on a page number. The resulting hash value must land
// between 0 and (HASHTABLE_NSLOT-1). The walHashNext() function advances
// the hash to the next value in the event of a collision.
-func walHash(tls *libc.TLS, iPage U32) int32 { /* sqlite3.c:61253:12: */
+func walHash(tls *libc.TLS, iPage U32) int32 { /* sqlite3.c:61343:12: */
- return (int32((iPage * U32(HASHTABLE_HASH_1)) & (U32((HASHTABLE_NPAGE * 2) - 1))))
+ return int32(iPage * U32(HASHTABLE_HASH_1) & U32(HASHTABLE_NPAGE*2-1))
}
-func walNextHash(tls *libc.TLS, iPriorHash int32) int32 { /* sqlite3.c:61258:12: */
- return ((iPriorHash + 1) & ((HASHTABLE_NPAGE * 2) - 1))
+func walNextHash(tls *libc.TLS, iPriorHash int32) int32 { /* sqlite3.c:61348:12: */
+ return (iPriorHash + 1) & (HASHTABLE_NPAGE*2 - 1)
}
// An instance of the WalHashLoc object is used to describe the location
@@ -38546,12 +39149,12 @@ type WalHashLoc1 = struct {
FaHash uintptr
FaPgno uintptr
FiZero U32
-} /* sqlite3.c:61267:9 */
+} /* sqlite3.c:61357:9 */
// An instance of the WalHashLoc object is used to describe the location
// of a page hash table in the wal-index. This becomes the return value
// from walHashGet().
-type WalHashLoc = WalHashLoc1 /* sqlite3.c:61267:27 */
+type WalHashLoc = WalHashLoc1 /* sqlite3.c:61357:27 */
// Return pointers to the hash table and page number array stored on
// page iHash of the wal-index. The wal-index is broken into 32KB pages
@@ -38563,22 +39166,23 @@ type WalHashLoc = WalHashLoc1 /* sqlite3.c:61267:27 */
// slot in the hash table is set to N, it refers to frame number
// (pLoc->iZero+N) in the log.
//
-// Finally, set pLoc->aPgno so that pLoc->aPgno[1] is the page number of the
-// first frame indexed by the hash table, frame (pLoc->iZero+1).
-func walHashGet(tls *libc.TLS, pWal uintptr, iHash int32, pLoc uintptr) int32 { /* sqlite3.c:61288:12: */
+// Finally, set pLoc->aPgno so that pLoc->aPgno[0] is the page number of the
+// first frame indexed by the hash table, frame (pLoc->iZero).
+func walHashGet(tls *libc.TLS, pWal uintptr, iHash int32, pLoc uintptr) int32 { /* sqlite3.c:61378:12: */
var rc int32 // Return code
- rc = walIndexPage(tls, pWal, iHash, (pLoc + 4 /* &.aPgno */))
+ rc = walIndexPage(tls, pWal, iHash, pLoc+4)
- if rc == SQLITE_OK {
- (*WalHashLoc)(unsafe.Pointer(pLoc)).FaHash = ((*WalHashLoc)(unsafe.Pointer(pLoc)).FaPgno + 4096*4)
+ if (*WalHashLoc)(unsafe.Pointer(pLoc)).FaPgno != 0 {
+ (*WalHashLoc)(unsafe.Pointer(pLoc)).FaHash = (*WalHashLoc)(unsafe.Pointer(pLoc)).FaPgno + 4096*4
if iHash == 0 {
- (*WalHashLoc)(unsafe.Pointer(pLoc)).FaPgno = ((*WalHashLoc)(unsafe.Pointer(pLoc)).FaPgno + 34*4)
+ (*WalHashLoc)(unsafe.Pointer(pLoc)).FaPgno = (*WalHashLoc)(unsafe.Pointer(pLoc)).FaPgno + 34*4
(*WalHashLoc)(unsafe.Pointer(pLoc)).FiZero = U32(0)
} else {
- (*WalHashLoc)(unsafe.Pointer(pLoc)).FiZero = ((uint32(HASHTABLE_NPAGE) - (((uint32(unsafe.Sizeof(WalIndexHdr{})) * uint32(2)) + uint32(unsafe.Sizeof(WalCkptInfo{}))) / uint32(unsafe.Sizeof(U32(0))))) + (uint32((iHash - 1) * HASHTABLE_NPAGE)))
+ (*WalHashLoc)(unsafe.Pointer(pLoc)).FiZero = uint32(HASHTABLE_NPAGE) - (uint32(unsafe.Sizeof(WalIndexHdr{}))*uint32(2)+uint32(unsafe.Sizeof(WalCkptInfo{})))/uint32(unsafe.Sizeof(U32(0))) + uint32((iHash-1)*HASHTABLE_NPAGE)
}
- (*WalHashLoc)(unsafe.Pointer(pLoc)).FaPgno = ((*WalHashLoc)(unsafe.Pointer(pLoc)).FaPgno + libc.UintptrFromInt32(-1)*4)
+ } else if rc == SQLITE_OK {
+ rc = SQLITE_ERROR
}
return rc
}
@@ -38587,19 +39191,19 @@ func walHashGet(tls *libc.TLS, pWal uintptr, iHash int32, pLoc uintptr) int32 {
// and page-number array that contain entries corresponding to WAL frame
// iFrame. The wal-index is broken up into 32KB pages. Wal-index pages
// are numbered starting from 0.
-func walFramePage(tls *libc.TLS, iFrame U32) int32 { /* sqlite3.c:61317:12: */
- var iHash int32 = (int32((((iFrame + U32(HASHTABLE_NPAGE)) - (uint32(HASHTABLE_NPAGE) - (((uint32(unsafe.Sizeof(WalIndexHdr{})) * uint32(2)) + uint32(unsafe.Sizeof(WalCkptInfo{}))) / uint32(unsafe.Sizeof(U32(0)))))) - U32(1)) / U32(HASHTABLE_NPAGE)))
+func walFramePage(tls *libc.TLS, iFrame U32) int32 { /* sqlite3.c:61408:12: */
+ var iHash int32 = int32((iFrame + U32(HASHTABLE_NPAGE) - (uint32(HASHTABLE_NPAGE) - (uint32(unsafe.Sizeof(WalIndexHdr{}))*uint32(2)+uint32(unsafe.Sizeof(WalCkptInfo{})))/uint32(unsafe.Sizeof(U32(0)))) - U32(1)) / U32(HASHTABLE_NPAGE))
return iHash
}
// Return the page number associated with frame iFrame in this WAL.
-func walFramePgno(tls *libc.TLS, pWal uintptr, iFrame U32) U32 { /* sqlite3.c:61332:12: */
+func walFramePgno(tls *libc.TLS, pWal uintptr, iFrame U32) U32 { /* sqlite3.c:61423:12: */
var iHash int32 = walFramePage(tls, iFrame)
if iHash == 0 {
- return *(*U32)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((*Wal)(unsafe.Pointer(pWal)).FapWiData)) + uintptr((((((uint32(unsafe.Sizeof(WalIndexHdr{}))*uint32(2))+uint32(unsafe.Sizeof(WalCkptInfo{})))/uint32(unsafe.Sizeof(U32(0))))+iFrame)-uint32(1)))*4))
+ return *(*U32)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((*Wal)(unsafe.Pointer(pWal)).FapWiData)) + uintptr((uint32(unsafe.Sizeof(WalIndexHdr{}))*uint32(2)+uint32(unsafe.Sizeof(WalCkptInfo{})))/uint32(unsafe.Sizeof(U32(0)))+iFrame-uint32(1))*4))
}
- return *(*U32)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((*Wal)(unsafe.Pointer(pWal)).FapWiData + uintptr(iHash)*4)) + uintptr((((iFrame-U32(1))-(uint32(HASHTABLE_NPAGE)-(((uint32(unsafe.Sizeof(WalIndexHdr{}))*uint32(2))+uint32(unsafe.Sizeof(WalCkptInfo{})))/uint32(unsafe.Sizeof(U32(0))))))%U32(HASHTABLE_NPAGE)))*4))
+ return *(*U32)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((*Wal)(unsafe.Pointer(pWal)).FapWiData + uintptr(iHash)*4)) + uintptr((iFrame-U32(1)-(uint32(HASHTABLE_NPAGE)-(uint32(unsafe.Sizeof(WalIndexHdr{}))*uint32(2)+uint32(unsafe.Sizeof(WalCkptInfo{})))/uint32(unsafe.Sizeof(U32(0)))))%U32(HASHTABLE_NPAGE))*4))
}
// Remove entries from the hash table that point to WAL slots greater
@@ -38612,7 +39216,7 @@ func walFramePgno(tls *libc.TLS, pWal uintptr, iFrame U32) U32 { /* sqlite3.c:61
// updated. Any later hash tables will be automatically cleared when
// pWal->hdr.mxFrame advances to the point where those hash tables are
// actually needed.
-func walCleanupHash(tls *libc.TLS, pWal uintptr) { /* sqlite3.c:61352:13: */
+func walCleanupHash(tls *libc.TLS, pWal uintptr) { /* sqlite3.c:61443:13: */
bp := tls.Alloc(12)
defer tls.Free(12)
@@ -38637,24 +39241,25 @@ func walCleanupHash(tls *libc.TLS, pWal uintptr) { /* sqlite3.c:61352:13: */
// Zero all hash-table entries that correspond to frame numbers greater
// than pWal->hdr.mxFrame.
- iLimit = (int32((*Wal)(unsafe.Pointer(pWal)).Fhdr.FmxFrame - (*WalHashLoc)(unsafe.Pointer(bp /* &sLoc */)).FiZero))
+ iLimit = int32((*Wal)(unsafe.Pointer(pWal)).Fhdr.FmxFrame - (*WalHashLoc)(unsafe.Pointer(bp)).FiZero)
- for i = 0; i < (HASHTABLE_NPAGE * 2); i++ {
- if int32(*(*Ht_slot)(unsafe.Pointer((*WalHashLoc)(unsafe.Pointer(bp /* &sLoc */)).FaHash + uintptr(i)*2))) > iLimit {
+ for i = 0; i < HASHTABLE_NPAGE*2; i++ {
+ if int32(*(*Ht_slot)(unsafe.Pointer((*WalHashLoc)(unsafe.Pointer(bp)).FaHash + uintptr(i)*2))) > iLimit {
*(*Ht_slot)(unsafe.Pointer((*WalHashLoc)(unsafe.Pointer(bp /* &sLoc */)).FaHash + uintptr(i)*2)) = Ht_slot(0)
}
}
// Zero the entries in the aPgno array that correspond to frames with
// frame numbers greater than pWal->hdr.mxFrame.
- nByte = ((int32((*WalHashLoc)(unsafe.Pointer(bp /* &sLoc */)).FaHash) - int32(((*WalHashLoc)(unsafe.Pointer(bp /* &sLoc */)).FaPgno + uintptr((iLimit+1))*4))) / 1)
- libc.Xmemset(tls, ((*WalHashLoc)(unsafe.Pointer(bp /* &sLoc */)).FaPgno + uintptr((iLimit+1))*4), 0, uint32(nByte))
+ nByte = (int32((*WalHashLoc)(unsafe.Pointer(bp)).FaHash) - int32((*WalHashLoc)(unsafe.Pointer(bp)).FaPgno+uintptr(iLimit)*4)) / 1
+
+ libc.Xmemset(tls, (*WalHashLoc)(unsafe.Pointer(bp)).FaPgno+uintptr(iLimit)*4, 0, uint32(nByte))
}
// Set an entry in the wal-index that will map database page number
// pPage into WAL frame iFrame.
-func walIndexAppend(tls *libc.TLS, pWal uintptr, iFrame U32, iPage U32) int32 { /* sqlite3.c:61413:12: */
+func walIndexAppend(tls *libc.TLS, pWal uintptr, iFrame U32, iPage U32) int32 { /* sqlite3.c:61505:12: */
bp := tls.Alloc(12)
defer tls.Free(12)
@@ -38671,14 +39276,14 @@ func walIndexAppend(tls *libc.TLS, pWal uintptr, iFrame U32, iPage U32) int32 {
var idx int32 // Value to write to hash-table slot
var nCollide int32 // Number of hash collisions
- idx = (int32(iFrame - (*WalHashLoc)(unsafe.Pointer(bp /* &sLoc */)).FiZero))
+ idx = int32(iFrame - (*WalHashLoc)(unsafe.Pointer(bp)).FiZero)
// If this is the first entry to be added to this hash-table, zero the
// entire hash table and aPgno[] array before proceeding.
if idx == 1 {
- var nByte int32 = ((int32(((*WalHashLoc)(unsafe.Pointer(bp /* &sLoc */)).FaHash + 8192*2)) -
- int32(((*WalHashLoc)(unsafe.Pointer(bp /* &sLoc */)).FaPgno + 1*4))) / 1)
- libc.Xmemset(tls, ((*WalHashLoc)(unsafe.Pointer(bp /* &sLoc */)).FaPgno + 1*4), 0, uint32(nByte))
+ var nByte int32 = (int32((*WalHashLoc)(unsafe.Pointer(bp)).FaHash+8192*2) - int32((*WalHashLoc)(unsafe.Pointer(bp)).FaPgno)) / 1
+
+ libc.Xmemset(tls, (*WalHashLoc)(unsafe.Pointer(bp /* &sLoc */)).FaPgno, 0, uint32(nByte))
}
// If the entry in aPgno[] is already set, then the previous writer
@@ -38686,7 +39291,7 @@ func walIndexAppend(tls *libc.TLS, pWal uintptr, iFrame U32, iPage U32) int32 {
// writing one or more dirty pages to the WAL to free up memory).
// Remove the remnants of that writers uncommitted transaction from
// the hash-table before writing any new entries.
- if *(*U32)(unsafe.Pointer((*WalHashLoc)(unsafe.Pointer(bp /* &sLoc */)).FaPgno + uintptr(idx)*4)) != 0 {
+ if *(*U32)(unsafe.Pointer((*WalHashLoc)(unsafe.Pointer(bp)).FaPgno + uintptr(idx-1)*4)) != 0 {
walCleanupHash(tls, pWal)
}
@@ -38694,12 +39299,12 @@ func walIndexAppend(tls *libc.TLS, pWal uintptr, iFrame U32, iPage U32) int32 {
// Write the aPgno[] array entry and the hash-table slot.
nCollide = idx
for iKey = walHash(tls, iPage); *(*Ht_slot)(unsafe.Pointer((*WalHashLoc)(unsafe.Pointer(bp /* &sLoc */)).FaHash + uintptr(iKey)*2)) != 0; iKey = walNextHash(tls, iKey) {
- if (libc.PostDecInt32(&nCollide, 1)) == 0 {
- return Xsqlite3CorruptError(tls, 61453)
+ if libc.PostDecInt32(&nCollide, 1) == 0 {
+ return Xsqlite3CorruptError(tls, 61545)
}
}
- *(*U32)(unsafe.Pointer((*WalHashLoc)(unsafe.Pointer(bp /* &sLoc */)).FaPgno + uintptr(idx)*4)) = iPage
- libc.AtomicStoreNUint16(((*WalHashLoc)(unsafe.Pointer(bp /* &sLoc */)).FaHash + uintptr(iKey)*2), uint16(Ht_slot(idx)), 0)
+ *(*U32)(unsafe.Pointer((*WalHashLoc)(unsafe.Pointer(bp /* &sLoc */)).FaPgno + uintptr(idx-1)*4)) = iPage
+ libc.AtomicStoreNUint16((*WalHashLoc)(unsafe.Pointer(bp)).FaHash+uintptr(iKey)*2, uint16(Ht_slot(idx)), 0)
}
@@ -38714,7 +39319,7 @@ func walIndexAppend(tls *libc.TLS, pWal uintptr, iFrame U32, iPage U32) int32 {
// WAL_RECOVER_LOCK is also held so that other threads will know
// that this thread is running recovery. If unable to establish
// the necessary locks, this routine returns SQLITE_BUSY.
-func walIndexRecover(tls *libc.TLS, pWal uintptr) int32 { /* sqlite3.c:61503:12: */
+func walIndexRecover(tls *libc.TLS, pWal uintptr) int32 { /* sqlite3.c:61594:12: */
bp := tls.Alloc(76)
defer tls.Free(76)
@@ -38758,8 +39363,8 @@ func walIndexRecover(tls *libc.TLS, pWal uintptr) int32 { /* sqlite3.c:61503:12:
// If successful, the same bytes that are locked here are unlocked before
// this function returns.
- iLock = (WAL_ALL_BUT_WRITE + int32((*Wal)(unsafe.Pointer(pWal)).FckptLock))
- rc = walLockExclusive(tls, pWal, iLock, ((3 + (0)) - iLock))
+ iLock = WAL_ALL_BUT_WRITE + int32((*Wal)(unsafe.Pointer(pWal)).FckptLock)
+ rc = walLockExclusive(tls, pWal, iLock, 3+0-iLock)
if !(rc != 0) {
goto __1
}
@@ -38767,7 +39372,7 @@ func walIndexRecover(tls *libc.TLS, pWal uintptr) int32 { /* sqlite3.c:61503:12:
__1:
;
- libc.Xmemset(tls, (pWal + 52 /* &.hdr */), 0, uint32(unsafe.Sizeof(WalIndexHdr{})))
+ libc.Xmemset(tls, pWal+52, 0, uint32(unsafe.Sizeof(WalIndexHdr{})))
rc = Xsqlite3OsFileSize(tls, (*Wal)(unsafe.Pointer(pWal)).FpWalFd, bp+16 /* &nSize */)
if !(rc != SQLITE_OK) {
@@ -38777,7 +39382,7 @@ __1:
__2:
;
- if !(*(*I64)(unsafe.Pointer(bp + 16 /* nSize */)) > int64(WAL_HDRSIZE)) {
+ if !(*(*I64)(unsafe.Pointer(bp + 16)) > int64(WAL_HDRSIZE)) {
goto __3
} // Buffer to load WAL header into
aPrivate = uintptr(0) // Heap copy of *-shm hash being populated
@@ -38796,27 +39401,27 @@ __4:
// SQLITE_MAX_PAGE_SIZE, conclude that the WAL file contains no valid
// data. Similarly, if the 'magic' value is invalid, ignore the whole
// WAL file.
- magic = Xsqlite3Get4byte(tls, (bp + 24 /* &aBuf */))
- szPage = int32(Xsqlite3Get4byte(tls, (bp + 24 /* &aBuf */ + 8)))
- if !(((((magic & 0xFFFFFFFE) != U32(WAL_MAGIC)) ||
- ((szPage & (szPage - 1)) != 0)) ||
- (szPage > SQLITE_MAX_PAGE_SIZE)) ||
- (szPage < 512)) {
+ magic = Xsqlite3Get4byte(tls, bp+24)
+ szPage = int32(Xsqlite3Get4byte(tls, bp+24+8))
+ if !(magic&0xFFFFFFFE != U32(WAL_MAGIC) ||
+ szPage&(szPage-1) != 0 ||
+ szPage > SQLITE_MAX_PAGE_SIZE ||
+ szPage < 512) {
goto __5
}
goto finished
__5:
;
- (*Wal)(unsafe.Pointer(pWal)).Fhdr.FbigEndCksum = (U8(magic & U32(0x00000001)))
+ (*Wal)(unsafe.Pointer(pWal)).Fhdr.FbigEndCksum = U8(magic & U32(0x00000001))
(*Wal)(unsafe.Pointer(pWal)).FszPage = U32(szPage)
- (*Wal)(unsafe.Pointer(pWal)).FnCkpt = Xsqlite3Get4byte(tls, (bp + 24 /* &aBuf */ + 12))
- libc.Xmemcpy(tls, (pWal + 52 /* &.hdr */ + 32 /* &.aSalt */), (bp + 24 /* &aBuf */ + 16), uint32(8))
+ (*Wal)(unsafe.Pointer(pWal)).FnCkpt = Xsqlite3Get4byte(tls, bp+24+12)
+ libc.Xmemcpy(tls, pWal+52+32, bp+24+16, uint32(8))
// Verify that the WAL header checksum is correct
- walChecksumBytes(tls, (libc.Bool32(int32((*Wal)(unsafe.Pointer(pWal)).Fhdr.FbigEndCksum) == SQLITE_BIGENDIAN)),
- bp+24 /* &aBuf[0] */, (WAL_HDRSIZE - (2 * 4)), uintptr(0), pWal+52 /* &.hdr */ +24 /* &.aFrameCksum */)
- if !((*(*U32)(unsafe.Pointer((pWal + 52 /* &.hdr */ + 24 /* &.aFrameCksum */))) != Xsqlite3Get4byte(tls, (bp+24 /* &aBuf */ +24))) ||
- (*(*U32)(unsafe.Pointer((pWal + 52 /* &.hdr */ + 24 /* &.aFrameCksum */) + 1*4)) != Xsqlite3Get4byte(tls, (bp+24 /* &aBuf */ +28)))) {
+ walChecksumBytes(tls, libc.Bool32(int32((*Wal)(unsafe.Pointer(pWal)).Fhdr.FbigEndCksum) == SQLITE_BIGENDIAN),
+ bp+24 /* &aBuf[0] */, WAL_HDRSIZE-2*4, uintptr(0), pWal+52+24)
+ if !(*(*U32)(unsafe.Pointer(pWal + 52 + 24)) != Xsqlite3Get4byte(tls, bp+24+24) ||
+ *(*U32)(unsafe.Pointer(pWal + 52 + 24 + 1*4)) != Xsqlite3Get4byte(tls, bp+24+28)) {
goto __6
}
goto finished
@@ -38825,49 +39430,50 @@ __6:
// Verify that the version number on the WAL format is one that
// are able to understand
- version = Xsqlite3Get4byte(tls, (bp + 24 /* &aBuf */ + 4))
+ version = Xsqlite3Get4byte(tls, bp+24+4)
if !(version != U32(WAL_MAX_VERSION)) {
goto __7
}
- rc = Xsqlite3CantopenError(tls, 61586)
+ rc = Xsqlite3CantopenError(tls, 61677)
goto finished
__7:
;
// Malloc a buffer to read frames into.
- szFrame = (szPage + WAL_FRAME_HDRSIZE)
- aFrame = Xsqlite3_malloc64(tls, (uint64(uint32(szFrame) + ((uint32(unsafe.Sizeof(Ht_slot(0))) * (uint32(HASHTABLE_NPAGE * 2))) + (uint32(HASHTABLE_NPAGE) * uint32(unsafe.Sizeof(U32(0))))))))
- if !(!(aFrame != 0)) {
+ szFrame = szPage + WAL_FRAME_HDRSIZE
+ aFrame = Xsqlite3_malloc64(tls, uint64(uint32(szFrame)+(uint32(unsafe.Sizeof(Ht_slot(0)))*uint32(HASHTABLE_NPAGE*2)+uint32(HASHTABLE_NPAGE)*uint32(unsafe.Sizeof(U32(0))))))
+ if !!(aFrame != 0) {
goto __8
}
rc = SQLITE_NOMEM
goto recovery_error
__8:
;
- aData = (aFrame + 24)
- aPrivate = (aData + uintptr(szPage))
+ aData = aFrame + 24
+ aPrivate = aData + uintptr(szPage)
// Read all frames from the log file.
- iLastFrame = (U32((*(*I64)(unsafe.Pointer(bp + 16 /* nSize */)) - int64(WAL_HDRSIZE)) / I64(szFrame)))
+ iLastFrame = U32((*(*I64)(unsafe.Pointer(bp + 16)) - int64(WAL_HDRSIZE)) / I64(szFrame))
iPg = U32(0)
__9:
if !(iPg <= U32(walFramePage(tls, iLastFrame))) {
goto __11
} // Index of last frame read
iLast = func() uint32 {
- if (iLastFrame) < ((uint32(HASHTABLE_NPAGE) - (((uint32(unsafe.Sizeof(WalIndexHdr{})) * uint32(2)) + uint32(unsafe.Sizeof(WalCkptInfo{}))) / uint32(unsafe.Sizeof(U32(0))))) + (iPg * U32(HASHTABLE_NPAGE))) {
+ if iLastFrame < uint32(HASHTABLE_NPAGE)-(uint32(unsafe.Sizeof(WalIndexHdr{}))*uint32(2)+uint32(unsafe.Sizeof(WalCkptInfo{})))/uint32(unsafe.Sizeof(U32(0)))+iPg*U32(HASHTABLE_NPAGE) {
return iLastFrame
}
- return ((uint32(HASHTABLE_NPAGE) - (((uint32(unsafe.Sizeof(WalIndexHdr{})) * uint32(2)) + uint32(unsafe.Sizeof(WalCkptInfo{}))) / uint32(unsafe.Sizeof(U32(0))))) + (iPg * U32(HASHTABLE_NPAGE)))
+ return uint32(HASHTABLE_NPAGE) - (uint32(unsafe.Sizeof(WalIndexHdr{}))*uint32(2)+uint32(unsafe.Sizeof(WalCkptInfo{})))/uint32(unsafe.Sizeof(U32(0))) + iPg*U32(HASHTABLE_NPAGE)
}()
- iFirst = (uint32(1) + (func() uint32 {
+ iFirst = uint32(1) + func() uint32 {
if iPg == U32(0) {
return uint32(0)
}
- return ((uint32(HASHTABLE_NPAGE) - (((uint32(unsafe.Sizeof(WalIndexHdr{})) * uint32(2)) + uint32(unsafe.Sizeof(WalCkptInfo{}))) / uint32(unsafe.Sizeof(U32(0))))) + ((iPg - U32(1)) * U32(HASHTABLE_NPAGE)))
- }()))
+ return uint32(HASHTABLE_NPAGE) - (uint32(unsafe.Sizeof(WalIndexHdr{}))*uint32(2)+uint32(unsafe.Sizeof(WalCkptInfo{})))/uint32(unsafe.Sizeof(U32(0))) + (iPg-U32(1))*U32(HASHTABLE_NPAGE)
+ }()
rc = walIndexPage(tls, pWal, int32(iPg), bp+56 /* &aShare */)
- if !(rc != 0) {
+
+ if !(*(*uintptr)(unsafe.Pointer(bp + 56)) == uintptr(0)) {
goto __12
}
goto __11
@@ -38880,7 +39486,7 @@ __13:
if !(iFrame <= iLast) {
goto __15
}
- iOffset = (int64(WAL_HDRSIZE) + ((I64((iFrame) - U32(1))) * (I64((szPage) + WAL_FRAME_HDRSIZE)))) // dbsize field from frame header
+ iOffset = int64(WAL_HDRSIZE) + I64(iFrame-U32(1))*I64(szPage+WAL_FRAME_HDRSIZE) // dbsize field from frame header
// Read and decode the next log frame.
rc = Xsqlite3OsRead(tls, (*Wal)(unsafe.Pointer(pWal)).FpWalFd, aFrame, szFrame, iOffset)
@@ -38891,7 +39497,7 @@ __13:
__16:
;
isValid = walDecodeFrame(tls, pWal, bp+60 /* &pgno */, bp+64 /* &nTruncate */, aData, aFrame)
- if !(!(isValid != 0)) {
+ if !!(isValid != 0) {
goto __17
}
goto __15
@@ -38906,15 +39512,15 @@ __18:
;
// If nTruncate is non-zero, this is a commit record.
- if !(*(*U32)(unsafe.Pointer(bp + 64 /* nTruncate */)) != 0) {
+ if !(*(*U32)(unsafe.Pointer(bp + 64)) != 0) {
goto __19
}
(*Wal)(unsafe.Pointer(pWal)).Fhdr.FmxFrame = iFrame
(*Wal)(unsafe.Pointer(pWal)).Fhdr.FnPage = *(*U32)(unsafe.Pointer(bp + 64 /* nTruncate */))
- (*Wal)(unsafe.Pointer(pWal)).Fhdr.FszPage = (U16((szPage & 0xff00) | (szPage >> 16)))
+ (*Wal)(unsafe.Pointer(pWal)).Fhdr.FszPage = U16(szPage&0xff00 | szPage>>16)
- *(*U32)(unsafe.Pointer(bp + 68 /* &aFrameCksum[0] */)) = *(*U32)(unsafe.Pointer((pWal + 52 /* &.hdr */ + 24 /* &.aFrameCksum */)))
- *(*U32)(unsafe.Pointer(bp + 68 /* &aFrameCksum[0] */ + 1*4)) = *(*U32)(unsafe.Pointer((pWal + 52 /* &.hdr */ + 24 /* &.aFrameCksum */) + 1*4))
+ *(*U32)(unsafe.Pointer(bp + 68 /* &aFrameCksum[0] */)) = *(*U32)(unsafe.Pointer(pWal + 52 + 24))
+ *(*U32)(unsafe.Pointer(bp + 68 /* &aFrameCksum[0] */ + 1*4)) = *(*U32)(unsafe.Pointer(pWal + 52 + 24 + 1*4))
__19:
;
goto __14
@@ -38927,11 +39533,11 @@ __15:
*(*uintptr)(unsafe.Pointer((*Wal)(unsafe.Pointer(pWal)).FapWiData + uintptr(iPg)*4)) = *(*uintptr)(unsafe.Pointer(bp + 56 /* aShare */))
nHdr = func() uint32 {
if iPg == U32(0) {
- return ((uint32(unsafe.Sizeof(WalIndexHdr{})) * uint32(2)) + uint32(unsafe.Sizeof(WalCkptInfo{})))
+ return uint32(unsafe.Sizeof(WalIndexHdr{}))*uint32(2) + uint32(unsafe.Sizeof(WalCkptInfo{}))
}
return uint32(0)
}()
- nHdr32 = (nHdr / U32(unsafe.Sizeof(U32(0))))
+ nHdr32 = nHdr / U32(unsafe.Sizeof(U32(0)))
// Memcpy() should work fine here, on all reasonable implementations.
// Technically, memcpy() might change the destination to some
// intermediate value before setting to the final value, and that might
@@ -38939,7 +39545,7 @@ __15:
// do that, according to the spec, but no memcpy() implementation that
// we know of actually does that, which is why we say that memcpy()
// is safe for this. Memcpy() is certainly a lot faster.
- libc.Xmemcpy(tls, (*(*uintptr)(unsafe.Pointer(bp + 56 /* aShare */)) + uintptr(nHdr32)*4), (aPrivate + uintptr(nHdr32)*4), (((uint32(unsafe.Sizeof(Ht_slot(0))) * (uint32(HASHTABLE_NPAGE * 2))) + (uint32(HASHTABLE_NPAGE) * uint32(unsafe.Sizeof(U32(0))))) - nHdr))
+ libc.Xmemcpy(tls, *(*uintptr)(unsafe.Pointer(bp + 56))+uintptr(nHdr32)*4, aPrivate+uintptr(nHdr32)*4, uint32(unsafe.Sizeof(Ht_slot(0)))*uint32(HASHTABLE_NPAGE*2)+uint32(HASHTABLE_NPAGE)*uint32(unsafe.Sizeof(U32(0)))-nHdr)
if !(iFrame <= iLast) {
goto __20
}
@@ -38962,8 +39568,8 @@ finished:
if !(rc == SQLITE_OK) {
goto __21
}
- *(*U32)(unsafe.Pointer((pWal + 52 /* &.hdr */ + 24 /* &.aFrameCksum */))) = *(*U32)(unsafe.Pointer(bp + 68 /* &aFrameCksum[0] */))
- *(*U32)(unsafe.Pointer((pWal + 52 /* &.hdr */ + 24 /* &.aFrameCksum */) + 1*4)) = *(*U32)(unsafe.Pointer(bp + 68 /* &aFrameCksum[0] */ + 1*4))
+ *(*U32)(unsafe.Pointer(pWal + 52 + 24)) = *(*U32)(unsafe.Pointer(bp + 68 /* &aFrameCksum[0] */))
+ *(*U32)(unsafe.Pointer(pWal + 52 + 24 + 1*4)) = *(*U32)(unsafe.Pointer(bp + 68 /* &aFrameCksum[0] */ + 1*4))
walIndexWriteHdr(tls, pWal)
// Reset the checkpoint-header. This is safe because this thread is
@@ -38972,26 +39578,26 @@ finished:
libc.AtomicStoreUintptr(&pInfo, uintptr(walCkptInfo(tls, pWal)))
(*WalCkptInfo)(unsafe.Pointer(pInfo)).FnBackfill = U32(0)
(*WalCkptInfo)(unsafe.Pointer(pInfo)).FnBackfillAttempted = (*Wal)(unsafe.Pointer(pWal)).Fhdr.FmxFrame
- *(*U32)(unsafe.Pointer((pInfo + 4 /* &.aReadMark */))) = U32(0)
+ *(*U32)(unsafe.Pointer(pInfo + 4)) = U32(0)
i = 1
__22:
- if !(i < (SQLITE_SHM_NLOCK - 3)) {
+ if !(i < SQLITE_SHM_NLOCK-3) {
goto __24
}
- rc = walLockExclusive(tls, pWal, (3 + (i)), 1)
+ rc = walLockExclusive(tls, pWal, 3+i, 1)
if !(rc == SQLITE_OK) {
goto __25
}
- if !((i == 1) && ((*Wal)(unsafe.Pointer(pWal)).Fhdr.FmxFrame != 0)) {
+ if !(i == 1 && (*Wal)(unsafe.Pointer(pWal)).Fhdr.FmxFrame != 0) {
goto __27
}
- *(*U32)(unsafe.Pointer((pInfo + 4 /* &.aReadMark */) + uintptr(i)*4)) = (*Wal)(unsafe.Pointer(pWal)).Fhdr.FmxFrame
+ *(*U32)(unsafe.Pointer(pInfo + 4 + uintptr(i)*4)) = (*Wal)(unsafe.Pointer(pWal)).Fhdr.FmxFrame
goto __28
__27:
- *(*U32)(unsafe.Pointer((pInfo + 4 /* &.aReadMark */) + uintptr(i)*4)) = READMARK_NOT_USED
+ *(*U32)(unsafe.Pointer(pInfo + 4 + uintptr(i)*4)) = READMARK_NOT_USED
__28:
;
- walUnlockExclusive(tls, pWal, (3 + (i)), 1)
+ walUnlockExclusive(tls, pWal, 3+i, 1)
goto __26
__25:
if !(rc != SQLITE_BUSY) {
@@ -39017,8 +39623,8 @@ __24:
if !((*Wal)(unsafe.Pointer(pWal)).Fhdr.FnPage != 0) {
goto __30
}
- Xsqlite3_log(tls, (SQLITE_NOTICE | (int32(1) << 8)),
- ts+3079, /* "recovered %d fra..." */
+ Xsqlite3_log(tls, SQLITE_NOTICE|int32(1)<<8,
+ ts+3890, /* "recovered %d fra..." */
libc.VaList(bp, (*Wal)(unsafe.Pointer(pWal)).Fhdr.FmxFrame, (*Wal)(unsafe.Pointer(pWal)).FzWalName))
__30:
;
@@ -39027,13 +39633,13 @@ __21:
recovery_error:
;
- walUnlockExclusive(tls, pWal, iLock, ((3 + (0)) - iLock))
+ walUnlockExclusive(tls, pWal, iLock, 3+0-iLock)
return rc
}
// Close an open wal-index.
-func walIndexClose(tls *libc.TLS, pWal uintptr, isDelete int32) { /* sqlite3.c:61725:13: */
- if (int32((*Wal)(unsafe.Pointer(pWal)).FexclusiveMode) == WAL_HEAPMEMORY_MODE) || ((*Wal)(unsafe.Pointer(pWal)).FbShmUnreliable != 0) {
+func walIndexClose(tls *libc.TLS, pWal uintptr, isDelete int32) { /* sqlite3.c:61817:13: */
+ if int32((*Wal)(unsafe.Pointer(pWal)).FexclusiveMode) == WAL_HEAPMEMORY_MODE || (*Wal)(unsafe.Pointer(pWal)).FbShmUnreliable != 0 {
var i int32
for i = 0; i < (*Wal)(unsafe.Pointer(pWal)).FnWiData; i++ {
Xsqlite3_free(tls, *(*uintptr)(unsafe.Pointer((*Wal)(unsafe.Pointer(pWal)).FapWiData + uintptr(i)*4)))
@@ -39058,7 +39664,7 @@ func walIndexClose(tls *libc.TLS, pWal uintptr, isDelete int32) { /* sqlite3.c:6
// If the log file is successfully opened, SQLITE_OK is returned and
// *ppWal is set to point to a new WAL handle. If an error occurs,
// an SQLite error code is returned and *ppWal is left unmodified.
-func Xsqlite3WalOpen(tls *libc.TLS, pVfs uintptr, pDbFd uintptr, zWalName uintptr, bNoShm int32, mxWalSize I64, ppWal uintptr) int32 { /* sqlite3.c:61753:20: */
+func Xsqlite3WalOpen(tls *libc.TLS, pVfs uintptr, pDbFd uintptr, zWalName uintptr, bNoShm int32, mxWalSize I64, ppWal uintptr) int32 { /* sqlite3.c:61845:20: */
bp := tls.Alloc(4)
defer tls.Free(4)
@@ -39067,6 +39673,15 @@ func Xsqlite3WalOpen(tls *libc.TLS, pVfs uintptr, pDbFd uintptr, zWalName uintpt
// var flags int32 at bp, 4
// Flags passed to OsOpen()
+ // Verify the values of various constants. Any changes to the values
+ // of these constants would result in an incompatible on-disk format
+ // for the -shm file. Any change that causes one of these asserts to
+ // fail is a backward compatibility problem, even if the change otherwise
+ // works.
+ //
+ // This table also serves as a helpful cross-reference when trying to
+ // interpret hex dumps of the -shm file.
+
// In the amalgamation, the os_unix.c and os_win.c source files come before
// this source file. Verify that the #defines of the locking byte offsets
// in os_unix.c and os_win.c agree with the WALINDEX_LOCK_OFFSET value.
@@ -39075,13 +39690,13 @@ func Xsqlite3WalOpen(tls *libc.TLS, pVfs uintptr, pDbFd uintptr, zWalName uintpt
// Allocate an instance of struct Wal to return.
*(*uintptr)(unsafe.Pointer(ppWal)) = uintptr(0)
- pRet = Xsqlite3MallocZero(tls, (uint64(uint32(unsafe.Sizeof(Wal{})) + uint32((*Sqlite3_vfs)(unsafe.Pointer(pVfs)).FszOsFile))))
+ pRet = Xsqlite3MallocZero(tls, uint64(uint32(unsafe.Sizeof(Wal{}))+uint32((*Sqlite3_vfs)(unsafe.Pointer(pVfs)).FszOsFile)))
if !(pRet != 0) {
return SQLITE_NOMEM
}
(*Wal)(unsafe.Pointer(pRet)).FpVfs = pVfs
- (*Wal)(unsafe.Pointer(pRet)).FpWalFd = (pRet + 1*120)
+ (*Wal)(unsafe.Pointer(pRet)).FpWalFd = pRet + 1*120
(*Wal)(unsafe.Pointer(pRet)).FpDbFd = pDbFd
(*Wal)(unsafe.Pointer(pRet)).FreadLock = int16(-1)
(*Wal)(unsafe.Pointer(pRet)).FmxWalSize = mxWalSize
@@ -39096,9 +39711,9 @@ func Xsqlite3WalOpen(tls *libc.TLS, pVfs uintptr, pDbFd uintptr, zWalName uintpt
}()
// Open file handle on the write-ahead log file.
- *(*int32)(unsafe.Pointer(bp /* flags */)) = ((SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE) | SQLITE_OPEN_WAL)
+ *(*int32)(unsafe.Pointer(bp /* flags */)) = SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE | SQLITE_OPEN_WAL
rc = Xsqlite3OsOpen(tls, pVfs, zWalName, (*Wal)(unsafe.Pointer(pRet)).FpWalFd, *(*int32)(unsafe.Pointer(bp /* flags */)), bp /* &flags */)
- if (rc == SQLITE_OK) && ((*(*int32)(unsafe.Pointer(bp /* flags */)) & SQLITE_OPEN_READONLY) != 0) {
+ if rc == SQLITE_OK && *(*int32)(unsafe.Pointer(bp))&SQLITE_OPEN_READONLY != 0 {
(*Wal)(unsafe.Pointer(pRet)).FreadOnly = U8(WAL_RDONLY)
}
@@ -39108,10 +39723,10 @@ func Xsqlite3WalOpen(tls *libc.TLS, pVfs uintptr, pDbFd uintptr, zWalName uintpt
Xsqlite3_free(tls, pRet)
} else {
var iDC int32 = Xsqlite3OsDeviceCharacteristics(tls, pDbFd)
- if (iDC & SQLITE_IOCAP_SEQUENTIAL) != 0 {
+ if iDC&SQLITE_IOCAP_SEQUENTIAL != 0 {
(*Wal)(unsafe.Pointer(pRet)).FsyncHeader = U8(0)
}
- if (iDC & SQLITE_IOCAP_POWERSAFE_OVERWRITE) != 0 {
+ if iDC&SQLITE_IOCAP_POWERSAFE_OVERWRITE != 0 {
(*Wal)(unsafe.Pointer(pRet)).FpadToSectorBoundary = U8(0)
}
*(*uintptr)(unsafe.Pointer(ppWal)) = pRet
@@ -39121,7 +39736,7 @@ func Xsqlite3WalOpen(tls *libc.TLS, pVfs uintptr, pDbFd uintptr, zWalName uintpt
}
// Change the size to which the WAL file is trucated on each reset.
-func Xsqlite3WalLimit(tls *libc.TLS, pWal uintptr, iLimit I64) { /* sqlite3.c:61827:21: */
+func Xsqlite3WalLimit(tls *libc.TLS, pWal uintptr, iLimit I64) { /* sqlite3.c:61948:21: */
if pWal != 0 {
(*Wal)(unsafe.Pointer(pWal)).FmxWalSize = iLimit
}
@@ -39135,21 +39750,21 @@ func Xsqlite3WalLimit(tls *libc.TLS, pWal uintptr, iLimit I64) { /* sqlite3.c:61
//
// Return 0 on success. If there are no pages in the WAL with a page
// number larger than *piPage, then return 1.
-func walIteratorNext(tls *libc.TLS, p uintptr, piPage uintptr, piFrame uintptr) int32 { /* sqlite3.c:61841:12: */
+func walIteratorNext(tls *libc.TLS, p uintptr, piPage uintptr, piFrame uintptr) int32 { /* sqlite3.c:61962:12: */
var iMin U32 // Result pgno must be greater than iMin
var iRet U32 = 0xFFFFFFFF // 0xffffffff is never a valid page number
var i int32 // For looping through segments
iMin = (*WalIterator)(unsafe.Pointer(p)).FiPrior
- for i = ((*WalIterator)(unsafe.Pointer(p)).FnSegment - 1); i >= 0; i-- {
- var pSegment uintptr = ((p + 8 /* &.aSegment */) + uintptr(i)*20)
+ for i = (*WalIterator)(unsafe.Pointer(p)).FnSegment - 1; i >= 0; i-- {
+ var pSegment uintptr = p + 8 + uintptr(i)*20
for (*WalSegment)(unsafe.Pointer(pSegment)).FiNext < (*WalSegment)(unsafe.Pointer(pSegment)).FnEntry {
var iPg U32 = *(*U32)(unsafe.Pointer((*WalSegment)(unsafe.Pointer(pSegment)).FaPgno + uintptr(*(*Ht_slot)(unsafe.Pointer((*WalSegment)(unsafe.Pointer(pSegment)).FaIndex + uintptr((*WalSegment)(unsafe.Pointer(pSegment)).FiNext)*2)))*4))
if iPg > iMin {
if iPg < iRet {
iRet = iPg
- *(*U32)(unsafe.Pointer(piFrame)) = (U32((*WalSegment)(unsafe.Pointer(pSegment)).FiZero + int32(*(*Ht_slot)(unsafe.Pointer((*WalSegment)(unsafe.Pointer(pSegment)).FaIndex + uintptr((*WalSegment)(unsafe.Pointer(pSegment)).FiNext)*2)))))
+ *(*U32)(unsafe.Pointer(piFrame)) = U32((*WalSegment)(unsafe.Pointer(pSegment)).FiZero + int32(*(*Ht_slot)(unsafe.Pointer((*WalSegment)(unsafe.Pointer(pSegment)).FaIndex + uintptr((*WalSegment)(unsafe.Pointer(pSegment)).FiNext)*2))))
}
break
}
@@ -39157,8 +39772,8 @@ func walIteratorNext(tls *libc.TLS, p uintptr, piPage uintptr, piFrame uintptr)
}
}
- *(*U32)(unsafe.Pointer(piPage)) = libc.AssignPtrUint32(p /* &.iPrior */, iRet)
- return (libc.Bool32(iRet == 0xFFFFFFFF))
+ *(*U32)(unsafe.Pointer(piPage)) = libc.AssignPtrUint32(p, iRet)
+ return libc.Bool32(iRet == 0xFFFFFFFF)
}
// This function merges two sorted lists into a single sorted list.
@@ -39182,19 +39797,19 @@ func walIteratorNext(tls *libc.TLS, p uintptr, piPage uintptr, piFrame uintptr)
// aLeft[X]!=aRight[Y] && aContent[aLeft[X]] == aContent[aRight[Y]]
//
// When that happens, omit the aLeft[X] and use the aRight[Y] index.
-func walMerge(tls *libc.TLS, aContent uintptr, aLeft uintptr, nLeft int32, paRight uintptr, pnRight uintptr, aTmp uintptr) { /* sqlite3.c:61894:13: */
+func walMerge(tls *libc.TLS, aContent uintptr, aLeft uintptr, nLeft int32, paRight uintptr, pnRight uintptr, aTmp uintptr) { /* sqlite3.c:62015:13: */
var iLeft int32 = 0 // Current index in aLeft
var iRight int32 = 0 // Current index in aRight
var iOut int32 = 0 // Current index in output buffer
var nRight int32 = *(*int32)(unsafe.Pointer(pnRight))
var aRight uintptr = *(*uintptr)(unsafe.Pointer(paRight))
- for (iRight < nRight) || (iLeft < nLeft) {
+ for iRight < nRight || iLeft < nLeft {
var logpage Ht_slot
var dbpage Pgno
- if (iLeft < nLeft) &&
- ((iRight >= nRight) || (*(*U32)(unsafe.Pointer(aContent + uintptr(*(*Ht_slot)(unsafe.Pointer(aLeft + uintptr(iLeft)*2)))*4)) < *(*U32)(unsafe.Pointer(aContent + uintptr(*(*Ht_slot)(unsafe.Pointer(aRight + uintptr(iRight)*2)))*4)))) {
+ if iLeft < nLeft &&
+ (iRight >= nRight || *(*U32)(unsafe.Pointer(aContent + uintptr(*(*Ht_slot)(unsafe.Pointer(aLeft + uintptr(iLeft)*2)))*4)) < *(*U32)(unsafe.Pointer(aContent + uintptr(*(*Ht_slot)(unsafe.Pointer(aRight + uintptr(iRight)*2)))*4))) {
logpage = *(*Ht_slot)(unsafe.Pointer(aLeft + uintptr(libc.PostIncInt32(&iLeft, 1))*2))
} else {
logpage = *(*Ht_slot)(unsafe.Pointer(aRight + uintptr(libc.PostIncInt32(&iRight, 1))*2))
@@ -39202,7 +39817,7 @@ func walMerge(tls *libc.TLS, aContent uintptr, aLeft uintptr, nLeft int32, paRig
dbpage = *(*U32)(unsafe.Pointer(aContent + uintptr(logpage)*4))
*(*Ht_slot)(unsafe.Pointer(aTmp + uintptr(libc.PostIncInt32(&iOut, 1))*2)) = logpage
- if (iLeft < nLeft) && (*(*U32)(unsafe.Pointer(aContent + uintptr(*(*Ht_slot)(unsafe.Pointer(aLeft + uintptr(iLeft)*2)))*4)) == dbpage) {
+ if iLeft < nLeft && *(*U32)(unsafe.Pointer(aContent + uintptr(*(*Ht_slot)(unsafe.Pointer(aLeft + uintptr(iLeft)*2)))*4)) == dbpage {
iLeft++
}
@@ -39210,7 +39825,7 @@ func walMerge(tls *libc.TLS, aContent uintptr, aLeft uintptr, nLeft int32, paRig
*(*uintptr)(unsafe.Pointer(paRight)) = aLeft
*(*int32)(unsafe.Pointer(pnRight)) = iOut
- libc.Xmemcpy(tls, aLeft, aTmp, (uint32(unsafe.Sizeof(Ht_slot(0))) * uint32(iOut)))
+ libc.Xmemcpy(tls, aLeft, aTmp, uint32(unsafe.Sizeof(Ht_slot(0)))*uint32(iOut))
}
// Sort the elements in list aList using aContent[] as the sort key.
@@ -39228,7 +39843,7 @@ func walMerge(tls *libc.TLS, aContent uintptr, aLeft uintptr, nLeft int32, paRig
//
// Keep the larger of the two values aList[X] and aList[Y] and discard
// the smaller.
-func walMergesort(tls *libc.TLS, aContent uintptr, aBuffer uintptr, aList uintptr, pnList uintptr) { /* sqlite3.c:61951:13: */
+func walMergesort(tls *libc.TLS, aContent uintptr, aBuffer uintptr, aList uintptr, pnList uintptr) { /* sqlite3.c:62072:13: */
bp := tls.Alloc(112)
defer tls.Free(112)
@@ -39244,11 +39859,11 @@ func walMergesort(tls *libc.TLS, aContent uintptr, aBuffer uintptr, aList uintpt
for iList = 0; iList < nList; iList++ {
*(*int32)(unsafe.Pointer(bp + 108 /* nMerge */)) = 1
- *(*uintptr)(unsafe.Pointer(bp + 104 /* aMerge */)) = (aList + uintptr(iList)*2)
- for iSub = U32(0); (iList & (int32(1) << iSub)) != 0; iSub++ {
+ *(*uintptr)(unsafe.Pointer(bp + 104 /* aMerge */)) = aList + uintptr(iList)*2
+ for iSub = U32(0); iList&(int32(1)<<iSub) != 0; iSub++ {
var p uintptr
- p = (bp /* &aSub */ + uintptr(iSub)*8)
+ p = bp + uintptr(iSub)*8
walMerge(tls, aContent, (*Sublist)(unsafe.Pointer(p)).FaList, (*Sublist)(unsafe.Pointer(p)).FnList, bp+104 /* &aMerge */, bp+108 /* &nMerge */, aBuffer)
}
@@ -39256,11 +39871,11 @@ func walMergesort(tls *libc.TLS, aContent uintptr, aBuffer uintptr, aList uintpt
(*Sublist)(unsafe.Pointer(bp /* &aSub */ + uintptr(iSub)*8)).FnList = *(*int32)(unsafe.Pointer(bp + 108 /* nMerge */))
}
- for iSub++; iSub < (U32((int32(uint32(unsafe.Sizeof([13]Sublist{})) / uint32(unsafe.Sizeof(Sublist{})))))); iSub++ {
- if (nList & (int32(1) << iSub)) != 0 {
+ for iSub++; iSub < U32(int32(uint32(unsafe.Sizeof([13]Sublist{}))/uint32(unsafe.Sizeof(Sublist{})))); iSub++ {
+ if nList&(int32(1)<<iSub) != 0 {
var p uintptr
- p = (bp /* &aSub */ + uintptr(iSub)*8)
+ p = bp + uintptr(iSub)*8
walMerge(tls, aContent, (*Sublist)(unsafe.Pointer(p)).FaList, (*Sublist)(unsafe.Pointer(p)).FnList, bp+104 /* &aMerge */, bp+108 /* &nMerge */, aBuffer)
}
@@ -39273,10 +39888,10 @@ func walMergesort(tls *libc.TLS, aContent uintptr, aBuffer uintptr, aList uintpt
type Sublist = struct {
FnList int32
FaList uintptr
-} /* sqlite3.c:61957:3 */
+} /* sqlite3.c:62078:3 */
// Free an iterator allocated by walIteratorInit().
-func walIteratorFree(tls *libc.TLS, p uintptr) { /* sqlite3.c:62014:13: */
+func walIteratorFree(tls *libc.TLS, p uintptr) { /* sqlite3.c:62135:13: */
Xsqlite3_free(tls, p)
}
@@ -39291,7 +39906,7 @@ func walIteratorFree(tls *libc.TLS, p uintptr) { /* sqlite3.c:62014:13: */
//
// The calling routine should invoke walIteratorFree() to destroy the
// WalIterator object when it has finished with it.
-func walIteratorInit(tls *libc.TLS, pWal uintptr, nBackfill U32, pp uintptr) int32 { /* sqlite3.c:62031:12: */
+func walIteratorInit(tls *libc.TLS, pWal uintptr, nBackfill U32, pp uintptr) int32 { /* sqlite3.c:62152:12: */
bp := tls.Alloc(16)
defer tls.Free(16)
@@ -39309,10 +39924,10 @@ func walIteratorInit(tls *libc.TLS, pWal uintptr, nBackfill U32, pp uintptr) int
iLast = (*Wal)(unsafe.Pointer(pWal)).Fhdr.FmxFrame
// Allocate space for the WalIterator object.
- nSegment = (walFramePage(tls, iLast) + 1)
- nByte = (Sqlite3_int64((uint32(unsafe.Sizeof(WalIterator{})) +
- ((uint32(nSegment - 1)) * uint32(unsafe.Sizeof(WalSegment{})))) +
- (iLast * U32(unsafe.Sizeof(Ht_slot(0))))))
+ nSegment = walFramePage(tls, iLast) + 1
+ nByte = Sqlite3_int64(uint32(unsafe.Sizeof(WalIterator{})) +
+ uint32(nSegment-1)*uint32(unsafe.Sizeof(WalSegment{})) +
+ iLast*U32(unsafe.Sizeof(Ht_slot(0))))
p = Xsqlite3_malloc64(tls, uint64(nByte))
if !(p != 0) {
return SQLITE_NOMEM
@@ -39323,17 +39938,17 @@ func walIteratorInit(tls *libc.TLS, pWal uintptr, nBackfill U32, pp uintptr) int
// Allocate temporary space used by the merge-sort routine. This block
// of memory will be freed before this function returns.
aTmp = Xsqlite3_malloc64(tls,
- (uint64(uint32(unsafe.Sizeof(Ht_slot(0))) * (func() uint32 {
+ uint64(uint32(unsafe.Sizeof(Ht_slot(0)))*func() uint32 {
if iLast > U32(HASHTABLE_NPAGE) {
return uint32(HASHTABLE_NPAGE)
}
return iLast
- }()))))
+ }()))
if !(aTmp != 0) {
rc = SQLITE_NOMEM
}
- for i = walFramePage(tls, (nBackfill + U32(1))); (rc == SQLITE_OK) && (i < nSegment); i++ {
+ for i = walFramePage(tls, nBackfill+U32(1)); rc == SQLITE_OK && i < nSegment; i++ {
// var sLoc WalHashLoc at bp, 12
rc = walHashGet(tls, pWal, i, bp /* &sLoc */)
@@ -39343,23 +39958,22 @@ func walIteratorInit(tls *libc.TLS, pWal uintptr, nBackfill U32, pp uintptr) int
// Number of entries in this segment
var aIndex uintptr // Sorted index for this segment
- (*WalHashLoc)(unsafe.Pointer(bp /* &sLoc */)).FaPgno += 4
- if (i + 1) == nSegment {
- *(*int32)(unsafe.Pointer(bp + 12 /* nEntry */)) = (int32(iLast - (*WalHashLoc)(unsafe.Pointer(bp /* &sLoc */)).FiZero))
+ if i+1 == nSegment {
+ *(*int32)(unsafe.Pointer(bp + 12 /* nEntry */)) = int32(iLast - (*WalHashLoc)(unsafe.Pointer(bp)).FiZero)
} else {
- *(*int32)(unsafe.Pointer(bp + 12 /* nEntry */)) = ((int32((*WalHashLoc)(unsafe.Pointer(bp /* &sLoc */)).FaHash) - int32((*WalHashLoc)(unsafe.Pointer(bp /* &sLoc */)).FaPgno)) / 4)
+ *(*int32)(unsafe.Pointer(bp + 12 /* nEntry */)) = (int32((*WalHashLoc)(unsafe.Pointer(bp)).FaHash) - int32((*WalHashLoc)(unsafe.Pointer(bp)).FaPgno)) / 4
}
- aIndex = (((p + 8 /* &.aSegment */) + uintptr((*WalIterator)(unsafe.Pointer(p)).FnSegment)*20) + uintptr((*WalHashLoc)(unsafe.Pointer(bp /* &sLoc */)).FiZero)*2)
+ aIndex = p + 8 + uintptr((*WalIterator)(unsafe.Pointer(p)).FnSegment)*20 + uintptr((*WalHashLoc)(unsafe.Pointer(bp)).FiZero)*2
(*WalHashLoc)(unsafe.Pointer(bp /* &sLoc */)).FiZero++
for j = 0; j < *(*int32)(unsafe.Pointer(bp + 12 /* nEntry */)); j++ {
*(*Ht_slot)(unsafe.Pointer(aIndex + uintptr(j)*2)) = Ht_slot(j)
}
walMergesort(tls, (*WalHashLoc)(unsafe.Pointer(bp /* &sLoc */)).FaPgno, aTmp, aIndex, bp+12 /* &nEntry */)
- (*WalSegment)(unsafe.Pointer((p + 8 /* &.aSegment */) + uintptr(i)*20)).FiZero = int32((*WalHashLoc)(unsafe.Pointer(bp /* &sLoc */)).FiZero)
- (*WalSegment)(unsafe.Pointer((p + 8 /* &.aSegment */) + uintptr(i)*20)).FnEntry = *(*int32)(unsafe.Pointer(bp + 12 /* nEntry */))
- (*WalSegment)(unsafe.Pointer((p + 8 /* &.aSegment */) + uintptr(i)*20)).FaIndex = aIndex
- (*WalSegment)(unsafe.Pointer((p + 8 /* &.aSegment */) + uintptr(i)*20)).FaPgno = (*WalHashLoc)(unsafe.Pointer(bp /* &sLoc */)).FaPgno
+ (*WalSegment)(unsafe.Pointer(p + 8 + uintptr(i)*20)).FiZero = int32((*WalHashLoc)(unsafe.Pointer(bp /* &sLoc */)).FiZero)
+ (*WalSegment)(unsafe.Pointer(p + 8 + uintptr(i)*20)).FnEntry = *(*int32)(unsafe.Pointer(bp + 12 /* nEntry */))
+ (*WalSegment)(unsafe.Pointer(p + 8 + uintptr(i)*20)).FaIndex = aIndex
+ (*WalSegment)(unsafe.Pointer(p + 8 + uintptr(i)*20)).FaPgno = (*WalHashLoc)(unsafe.Pointer(bp /* &sLoc */)).FaPgno
}
}
Xsqlite3_free(tls, aTmp)
@@ -39376,11 +39990,11 @@ func walIteratorInit(tls *libc.TLS, pWal uintptr, nBackfill U32, pp uintptr) int
// n. If the attempt fails and parameter xBusy is not NULL, then it is a
// busy-handler function. Invoke it and retry the lock until either the
// lock is successfully obtained or the busy-handler returns 0.
-func walBusyLock(tls *libc.TLS, pWal uintptr, xBusy uintptr, pBusyArg uintptr, lockIdx int32, n int32) int32 { /* sqlite3.c:62195:12: */
+func walBusyLock(tls *libc.TLS, pWal uintptr, xBusy uintptr, pBusyArg uintptr, lockIdx int32, n int32) int32 { /* sqlite3.c:62315:12: */
var rc int32
- for ok := true; ok; ok = (((xBusy != 0) && (rc == SQLITE_BUSY)) && ((*struct {
+ for ok := true; ok; ok = xBusy != 0 && rc == SQLITE_BUSY && (*struct {
f func(*libc.TLS, uintptr) int32
- })(unsafe.Pointer(&struct{ uintptr }{xBusy})).f(tls, pBusyArg) != 0)) {
+ })(unsafe.Pointer(&struct{ uintptr }{xBusy})).f(tls, pBusyArg) != 0 {
rc = walLockExclusive(tls, pWal, lockIdx, n)
}
return rc
@@ -39388,8 +40002,8 @@ func walBusyLock(tls *libc.TLS, pWal uintptr, xBusy uintptr, pBusyArg uintptr, l
// The cache of the wal-index header must be valid to call this function.
// Return the page-size in bytes used by the database.
-func walPagesize(tls *libc.TLS, pWal uintptr) int32 { /* sqlite3.c:62219:12: */
- return ((int32((*Wal)(unsafe.Pointer(pWal)).Fhdr.FszPage) & 0xfe00) + ((int32((*Wal)(unsafe.Pointer(pWal)).Fhdr.FszPage) & 0x0001) << 16))
+func walPagesize(tls *libc.TLS, pWal uintptr) int32 { /* sqlite3.c:62339:12: */
+ return int32((*Wal)(unsafe.Pointer(pWal)).Fhdr.FszPage)&0xfe00 + int32((*Wal)(unsafe.Pointer(pWal)).Fhdr.FszPage)&0x0001<<16
}
// The following is guaranteed when this function is called:
@@ -39407,24 +40021,24 @@ func walPagesize(tls *libc.TLS, pWal uintptr) int32 { /* sqlite3.c:62219:12: */
// The value of parameter salt1 is used as the aSalt[1] value in the
// new wal-index header. It should be passed a pseudo-random value (i.e.
// one obtained from sqlite3_randomness()).
-func walRestartHdr(tls *libc.TLS, pWal uintptr, salt1 U32) { /* sqlite3.c:62240:13: */
+func walRestartHdr(tls *libc.TLS, pWal uintptr, salt1 U32) { /* sqlite3.c:62360:13: */
bp := tls.Alloc(4)
defer tls.Free(4)
*(*U32)(unsafe.Pointer(bp)) = salt1
var pInfo uintptr = walCkptInfo(tls, pWal)
- var i int32 // Loop counter
- var aSalt uintptr = pWal + 52 /* &.hdr */ + 32 /* &.aSalt */ // Big-endian salt values
+ var i int32 // Loop counter
+ var aSalt uintptr = pWal + 52 + 32 // Big-endian salt values
(*Wal)(unsafe.Pointer(pWal)).FnCkpt++
(*Wal)(unsafe.Pointer(pWal)).Fhdr.FmxFrame = U32(0)
- Xsqlite3Put4byte(tls, (aSalt), (U32(1) + Xsqlite3Get4byte(tls, (aSalt))))
- libc.Xmemcpy(tls, ((pWal + 52 /* &.hdr */ + 32 /* &.aSalt */) + 1*4), bp /* &salt1 */, uint32(4))
+ Xsqlite3Put4byte(tls, aSalt, U32(1)+Xsqlite3Get4byte(tls, aSalt))
+ libc.Xmemcpy(tls, pWal+52+32+1*4, bp /* &salt1 */, uint32(4))
walIndexWriteHdr(tls, pWal)
- libc.AtomicStoreNInt32((pInfo /* &.nBackfill */), int32(0), 0)
+ libc.AtomicStoreNInt32(pInfo, int32(0), 0)
(*WalCkptInfo)(unsafe.Pointer(pInfo)).FnBackfillAttempted = U32(0)
- *(*U32)(unsafe.Pointer((pInfo + 4 /* &.aReadMark */) + 1*4)) = U32(0)
- for i = 2; i < (SQLITE_SHM_NLOCK - 3); i++ {
- *(*U32)(unsafe.Pointer((pInfo + 4 /* &.aReadMark */) + uintptr(i)*4)) = READMARK_NOT_USED
+ *(*U32)(unsafe.Pointer(pInfo + 4 + 1*4)) = U32(0)
+ for i = 2; i < SQLITE_SHM_NLOCK-3; i++ {
+ *(*U32)(unsafe.Pointer(pInfo + 4 + uintptr(i)*4)) = READMARK_NOT_USED
}
}
@@ -39458,7 +40072,7 @@ func walRestartHdr(tls *libc.TLS, pWal uintptr, salt1 U32) { /* sqlite3.c:62240:
// The caller must be holding sufficient locks to ensure that no other
// checkpoint is running (in any other thread or process) at the same
// time.
-func walCheckpoint(tls *libc.TLS, pWal uintptr, db uintptr, eMode int32, xBusy uintptr, pBusyArg uintptr, sync_flags int32, zBuf uintptr) int32 { /* sqlite3.c:62287:12: */
+func walCheckpoint(tls *libc.TLS, pWal uintptr, db uintptr, eMode int32, xBusy uintptr, pBusyArg uintptr, sync_flags int32, zBuf uintptr) int32 { /* sqlite3.c:62407:12: */
bp := tls.Alloc(36)
defer tls.Free(36)
@@ -39507,15 +40121,15 @@ func walCheckpoint(tls *libc.TLS, pWal uintptr, db uintptr, eMode int32, xBusy u
mxPage = (*Wal)(unsafe.Pointer(pWal)).Fhdr.FnPage
i = 1
__2:
- if !(i < (SQLITE_SHM_NLOCK - 3)) {
+ if !(i < SQLITE_SHM_NLOCK-3) {
goto __4
}
- y = U32(libc.AtomicLoadNUint32(((pInfo + 4 /* &.aReadMark */) + uintptr(i)*4), 0))
+ y = U32(libc.AtomicLoadNUint32(pInfo+4+uintptr(i)*4, 0))
if !(mxSafeFrame > y) {
goto __5
}
- rc = walBusyLock(tls, pWal, xBusy, pBusyArg, (3 + (i)), 1)
+ rc = walBusyLock(tls, pWal, xBusy, pBusyArg, 3+i, 1)
if !(rc == SQLITE_OK) {
goto __6
}
@@ -39525,8 +40139,8 @@ __2:
}
return READMARK_NOT_USED
}()
- libc.AtomicStoreNUint32(((pInfo + 4 /* &.aReadMark */) + uintptr(i)*4), uint32(iMark), 0)
- walUnlockExclusive(tls, pWal, (3 + (i)), 1)
+ libc.AtomicStoreNUint32(pInfo+4+uintptr(i)*4, uint32(iMark), 0)
+ walUnlockExclusive(tls, pWal, 3+i, 1)
goto __7
__6:
if !(rc == SQLITE_BUSY) {
@@ -39560,8 +40174,8 @@ __4:
__10:
;
- if !((*(*uintptr)(unsafe.Pointer(bp /* pIter */)) != 0) &&
- ((libc.AssignInt32(&rc, walBusyLock(tls, pWal, xBusy, pBusyArg, (3+(0)), 1))) == SQLITE_OK)) {
+ if !(*(*uintptr)(unsafe.Pointer(bp)) != 0 &&
+ libc.AssignInt32(&rc, walBusyLock(tls, pWal, xBusy, pBusyArg, 3+0, 1)) == SQLITE_OK) {
goto __11
}
nBackfill = (*WalCkptInfo)(unsafe.Pointer(pInfo)).FnBackfill
@@ -39569,27 +40183,27 @@ __10:
(*WalCkptInfo)(unsafe.Pointer(pInfo)).FnBackfillAttempted = mxSafeFrame
// Sync the WAL to disk
- rc = Xsqlite3OsSync(tls, (*Wal)(unsafe.Pointer(pWal)).FpWalFd, (((sync_flags) >> 2) & 0x03))
+ rc = Xsqlite3OsSync(tls, (*Wal)(unsafe.Pointer(pWal)).FpWalFd, sync_flags>>2&0x03)
// If the database may grow as a result of this checkpoint, hint
// about the eventual size of the db file to the VFS layer.
if !(rc == SQLITE_OK) {
goto __12
}
- *(*I64)(unsafe.Pointer(bp + 16 /* nReq */)) = (I64(mxPage) * I64(szPage)) // Current size of database file
+ *(*I64)(unsafe.Pointer(bp + 16 /* nReq */)) = I64(mxPage) * I64(szPage) // Current size of database file
Xsqlite3OsFileControl(tls, (*Wal)(unsafe.Pointer(pWal)).FpDbFd, SQLITE_FCNTL_CKPT_START, uintptr(0))
rc = Xsqlite3OsFileSize(tls, (*Wal)(unsafe.Pointer(pWal)).FpDbFd, bp+8 /* &nSize */)
- if !((rc == SQLITE_OK) && (*(*I64)(unsafe.Pointer(bp + 8 /* nSize */)) < *(*I64)(unsafe.Pointer(bp + 16 /* nReq */)))) {
+ if !(rc == SQLITE_OK && *(*I64)(unsafe.Pointer(bp + 8)) < *(*I64)(unsafe.Pointer(bp + 16))) {
goto __13
}
- if !(((*(*I64)(unsafe.Pointer(bp + 8 /* nSize */)) + int64(65536)) + (I64((*Wal)(unsafe.Pointer(pWal)).Fhdr.FmxFrame) * I64(szPage))) < *(*I64)(unsafe.Pointer(bp + 16 /* nReq */))) {
+ if !(*(*I64)(unsafe.Pointer(bp + 8))+int64(65536)+I64((*Wal)(unsafe.Pointer(pWal)).Fhdr.FmxFrame)*I64(szPage) < *(*I64)(unsafe.Pointer(bp + 16))) {
goto __14
}
// If the size of the final database is larger than the current
// database plus the amount of data in the wal file, plus the
// maximum size of the pending-byte page (65536 bytes), then
// must be corruption somewhere.
- rc = Xsqlite3CorruptError(tls, 62371)
+ rc = Xsqlite3CorruptError(tls, 62491)
goto __15
__14:
Xsqlite3OsFileControlHint(tls, (*Wal)(unsafe.Pointer(pWal)).FpDbFd, SQLITE_FCNTL_SIZE_HINT, bp+16 /* &nReq */)
@@ -39603,11 +40217,11 @@ __12:
// Iterate through the contents of the WAL, copying data to the db file
__16:
- if !((rc == SQLITE_OK) && (0 == walIteratorNext(tls, *(*uintptr)(unsafe.Pointer(bp /* pIter */)), bp+24 /* &iDbpage */, bp+28 /* &iFrame */))) {
+ if !(rc == SQLITE_OK && 0 == walIteratorNext(tls, *(*uintptr)(unsafe.Pointer(bp)), bp+24, bp+28)) {
goto __17
}
- if !(libc.AtomicLoadNInt32((db+288 /* &.u1 */ /* &.isInterrupted */), 0) != 0) {
+ if !(libc.AtomicLoadNInt32(db+312, 0) != 0) {
goto __18
}
if (*Sqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 {
@@ -39618,13 +40232,13 @@ __16:
goto __17
__18:
;
- if !(((*(*U32)(unsafe.Pointer(bp + 28 /* iFrame */)) <= nBackfill) || (*(*U32)(unsafe.Pointer(bp + 28 /* iFrame */)) > mxSafeFrame)) || (*(*U32)(unsafe.Pointer(bp + 24 /* iDbpage */)) > mxPage)) {
+ if !(*(*U32)(unsafe.Pointer(bp + 28)) <= nBackfill || *(*U32)(unsafe.Pointer(bp + 28)) > mxSafeFrame || *(*U32)(unsafe.Pointer(bp + 24)) > mxPage) {
goto __19
}
goto __16
__19:
;
- iOffset = ((int64(WAL_HDRSIZE) + ((I64((*(*U32)(unsafe.Pointer(bp + 28 /* iFrame */))) - U32(1))) * (I64((szPage) + WAL_FRAME_HDRSIZE)))) + int64(WAL_FRAME_HDRSIZE))
+ iOffset = int64(WAL_HDRSIZE) + I64(*(*U32)(unsafe.Pointer(bp + 28))-U32(1))*I64(szPage+WAL_FRAME_HDRSIZE) + int64(WAL_FRAME_HDRSIZE)
// testcase( IS_BIG_INT(iOffset) ); // requires a 4GiB WAL file
rc = Xsqlite3OsRead(tls, (*Wal)(unsafe.Pointer(pWal)).FpWalFd, zBuf, szPage, iOffset)
if !(rc != SQLITE_OK) {
@@ -39633,7 +40247,7 @@ __19:
goto __17
__20:
;
- iOffset = ((I64(*(*U32)(unsafe.Pointer(bp + 24 /* iDbpage */)) - U32(1))) * I64(szPage))
+ iOffset = I64(*(*U32)(unsafe.Pointer(bp + 24))-U32(1)) * I64(szPage)
rc = Xsqlite3OsWrite(tls, (*Wal)(unsafe.Pointer(pWal)).FpDbFd, zBuf, szPage, iOffset)
if !(rc != SQLITE_OK) {
@@ -39654,13 +40268,13 @@ __17:
if !(mxSafeFrame == (*WalIndexHdr)(unsafe.Pointer(walIndexHdr(tls, pWal))).FmxFrame) {
goto __23
}
- szDb = (I64((*Wal)(unsafe.Pointer(pWal)).Fhdr.FnPage) * I64(szPage))
+ szDb = I64((*Wal)(unsafe.Pointer(pWal)).Fhdr.FnPage) * I64(szPage)
rc = Xsqlite3OsTruncate(tls, (*Wal)(unsafe.Pointer(pWal)).FpDbFd, szDb)
if !(rc == SQLITE_OK) {
goto __24
}
- rc = Xsqlite3OsSync(tls, (*Wal)(unsafe.Pointer(pWal)).FpDbFd, (((sync_flags) >> 2) & 0x03))
+ rc = Xsqlite3OsSync(tls, (*Wal)(unsafe.Pointer(pWal)).FpDbFd, sync_flags>>2&0x03)
__24:
;
__23:
@@ -39668,14 +40282,14 @@ __23:
if !(rc == SQLITE_OK) {
goto __25
}
- libc.AtomicStoreNUint32((pInfo /* &.nBackfill */), uint32(mxSafeFrame), 0)
+ libc.AtomicStoreNUint32(pInfo, uint32(mxSafeFrame), 0)
__25:
;
__22:
;
// Release the reader lock held while backfilling
- walUnlockExclusive(tls, pWal, (3 + (0)), 1)
+ walUnlockExclusive(tls, pWal, 3+0, 1)
__11:
;
@@ -39694,7 +40308,7 @@ __1:
// entire wal file has been copied into the database file, then block
// until all readers have finished using the wal file. This ensures that
// the next process to write to the database restarts the wal file.
- if !((rc == SQLITE_OK) && (eMode != SQLITE_CHECKPOINT_PASSIVE)) {
+ if !(rc == SQLITE_OK && eMode != SQLITE_CHECKPOINT_PASSIVE) {
goto __27
}
@@ -39709,7 +40323,7 @@ __28:
}
Xsqlite3_randomness(tls, 4, bp+32 /* &salt1 */)
- rc = walBusyLock(tls, pWal, xBusy, pBusyArg, (3 + (1)), ((SQLITE_SHM_NLOCK - 3) - 1))
+ rc = walBusyLock(tls, pWal, xBusy, pBusyArg, 3+1, SQLITE_SHM_NLOCK-3-1)
if !(rc == SQLITE_OK) {
goto __31
}
@@ -39733,7 +40347,7 @@ __28:
rc = Xsqlite3OsTruncate(tls, (*Wal)(unsafe.Pointer(pWal)).FpWalFd, int64(0))
__32:
;
- walUnlockExclusive(tls, pWal, (3 + (1)), ((SQLITE_SHM_NLOCK - 3) - 1))
+ walUnlockExclusive(tls, pWal, 3+1, SQLITE_SHM_NLOCK-3-1)
__31:
;
__30:
@@ -39750,7 +40364,7 @@ walcheckpoint_out:
// If the WAL file is currently larger than nMax bytes in size, truncate
// it to exactly nMax bytes. If an error occurs while doing so, ignore it.
-func walLimitSize(tls *libc.TLS, pWal uintptr, nMax I64) { /* sqlite3.c:62473:13: */
+func walLimitSize(tls *libc.TLS, pWal uintptr, nMax I64) { /* sqlite3.c:62593:13: */
bp := tls.Alloc(16)
defer tls.Free(16)
@@ -39759,17 +40373,17 @@ func walLimitSize(tls *libc.TLS, pWal uintptr, nMax I64) { /* sqlite3.c:62473:13
var rx int32
Xsqlite3BeginBenignMalloc(tls)
rx = Xsqlite3OsFileSize(tls, (*Wal)(unsafe.Pointer(pWal)).FpWalFd, bp+8 /* &sz */)
- if (rx == SQLITE_OK) && (*(*I64)(unsafe.Pointer(bp + 8 /* sz */)) > nMax) {
+ if rx == SQLITE_OK && *(*I64)(unsafe.Pointer(bp + 8)) > nMax {
rx = Xsqlite3OsTruncate(tls, (*Wal)(unsafe.Pointer(pWal)).FpWalFd, nMax)
}
Xsqlite3EndBenignMalloc(tls)
if rx != 0 {
- Xsqlite3_log(tls, rx, ts+3116 /* "cannot limit WAL..." */, libc.VaList(bp, (*Wal)(unsafe.Pointer(pWal)).FzWalName))
+ Xsqlite3_log(tls, rx, ts+3927 /* "cannot limit WAL..." */, libc.VaList(bp, (*Wal)(unsafe.Pointer(pWal)).FzWalName))
}
}
// Close a connection to a log file.
-func Xsqlite3WalClose(tls *libc.TLS, pWal uintptr, db uintptr, sync_flags int32, nBuf int32, zBuf uintptr) int32 { /* sqlite3.c:62490:20: */
+func Xsqlite3WalClose(tls *libc.TLS, pWal uintptr, db uintptr, sync_flags int32, nBuf int32, zBuf uintptr) int32 { /* sqlite3.c:62610:20: */
bp := tls.Alloc(4)
defer tls.Free(4)
@@ -39784,8 +40398,8 @@ func Xsqlite3WalClose(tls *libc.TLS, pWal uintptr, db uintptr, sync_flags int32,
// the wal and wal-index files.
//
// The EXCLUSIVE lock is not released before returning.
- if (zBuf != uintptr(0)) &&
- (SQLITE_OK == (libc.AssignInt32(&rc, Xsqlite3OsLock(tls, (*Wal)(unsafe.Pointer(pWal)).FpDbFd, SQLITE_LOCK_EXCLUSIVE)))) {
+ if zBuf != uintptr(0) &&
+ SQLITE_OK == libc.AssignInt32(&rc, Xsqlite3OsLock(tls, (*Wal)(unsafe.Pointer(pWal)).FpDbFd, SQLITE_LOCK_EXCLUSIVE)) {
if int32((*Wal)(unsafe.Pointer(pWal)).FexclusiveMode) == WAL_NORMAL_MODE {
(*Wal)(unsafe.Pointer(pWal)).FexclusiveMode = U8(WAL_EXCLUSIVE_MODE)
}
@@ -39795,7 +40409,7 @@ func Xsqlite3WalClose(tls *libc.TLS, pWal uintptr, db uintptr, sync_flags int32,
*(*int32)(unsafe.Pointer(bp /* bPersist */)) = -1
Xsqlite3OsFileControlHint(tls,
(*Wal)(unsafe.Pointer(pWal)).FpDbFd, SQLITE_FCNTL_PERSIST_WAL, bp /* &bPersist */)
- if *(*int32)(unsafe.Pointer(bp /* bPersist */)) != 1 {
+ if *(*int32)(unsafe.Pointer(bp)) != 1 {
// Try to delete the WAL file if the checkpoint completed and
// fsyned (rc==SQLITE_OK) and if we are not in persistent-wal
// mode (!bPersist)
@@ -39841,7 +40455,7 @@ func Xsqlite3WalClose(tls *libc.TLS, pWal uintptr, db uintptr, sync_flags int32,
//
// If the checksum cannot be verified return non-zero. If the header
// is read successfully and the checksum verified, return zero.
-func walIndexTryHdr(tls *libc.TLS, pWal uintptr, pChanged uintptr) int32 { /* sqlite3.c:62571:27: */
+func walIndexTryHdr(tls *libc.TLS, pWal uintptr, pChanged uintptr) int32 { /* sqlite3.c:62691:27: */
bp := tls.Alloc(104)
defer tls.Free(104)
@@ -39871,25 +40485,25 @@ func walIndexTryHdr(tls *libc.TLS, pWal uintptr, pChanged uintptr) int32 { /* sq
// shared among multiple processes and not all mutex implementions work
// reliably in that environment.
libc.AtomicStoreUintptr(&aHdr, uintptr(walIndexHdr(tls, pWal)))
- libc.Xmemcpy(tls, bp /* &h1 */, (aHdr), uint32(unsafe.Sizeof(WalIndexHdr{}))) // Possible TSAN false-positive
+ libc.Xmemcpy(tls, bp /* &h1 */, aHdr, uint32(unsafe.Sizeof(WalIndexHdr{}))) // Possible TSAN false-positive
walShmBarrier(tls, pWal)
- libc.Xmemcpy(tls, bp+48 /* &h2 */, (aHdr + 1*48), uint32(unsafe.Sizeof(WalIndexHdr{})))
+ libc.Xmemcpy(tls, bp+48 /* &h2 */, aHdr+1*48, uint32(unsafe.Sizeof(WalIndexHdr{})))
- if (libc.Xmemcmp(tls, bp /* &h1 */, bp+48 /* &h2 */, uint32(unsafe.Sizeof(WalIndexHdr{}))) != 0) {
+ if libc.Xmemcmp(tls, bp, bp+48, uint32(unsafe.Sizeof(WalIndexHdr{}))) != 0 {
return 1 // Dirty read
}
- if int32((*WalIndexHdr)(unsafe.Pointer(bp /* &h1 */)).FisInit) == 0 {
+ if int32((*WalIndexHdr)(unsafe.Pointer(bp)).FisInit) == 0 {
return 1 // Malformed header - probably all zeros
}
- walChecksumBytes(tls, 1, bp /* &h1 */, (int32(uint32(unsafe.Sizeof(WalIndexHdr{})) - uint32(unsafe.Sizeof([2]U32{})))), uintptr(0), bp+96 /* &aCksum[0] */)
- if (*(*U32)(unsafe.Pointer(bp + 96 /* &aCksum[0] */)) != *(*U32)(unsafe.Pointer((bp /* &h1 */ + 40 /* &.aCksum */)))) || (*(*U32)(unsafe.Pointer(bp + 96 /* &aCksum[0] */ + 1*4)) != *(*U32)(unsafe.Pointer((bp /* &h1 */ + 40 /* &.aCksum */) + 1*4))) {
+ walChecksumBytes(tls, 1, bp /* &h1 */, int32(uint32(unsafe.Sizeof(WalIndexHdr{}))-uint32(unsafe.Sizeof([2]U32{}))), uintptr(0), bp+96 /* &aCksum[0] */)
+ if *(*U32)(unsafe.Pointer(bp + 96)) != *(*U32)(unsafe.Pointer(bp + 40)) || *(*U32)(unsafe.Pointer(bp + 96 + 1*4)) != *(*U32)(unsafe.Pointer(bp + 40 + 1*4)) {
return 1 // Checksum does not match
}
- if libc.Xmemcmp(tls, (pWal+52 /* &.hdr */), bp /* &h1 */, uint32(unsafe.Sizeof(WalIndexHdr{}))) != 0 {
+ if libc.Xmemcmp(tls, pWal+52, bp, uint32(unsafe.Sizeof(WalIndexHdr{}))) != 0 {
*(*int32)(unsafe.Pointer(pChanged)) = 1
- libc.Xmemcpy(tls, (pWal + 52 /* &.hdr */), bp /* &h1 */, uint32(unsafe.Sizeof(WalIndexHdr{})))
- (*Wal)(unsafe.Pointer(pWal)).FszPage = (U32((int32((*Wal)(unsafe.Pointer(pWal)).Fhdr.FszPage) & 0xfe00) + ((int32((*Wal)(unsafe.Pointer(pWal)).Fhdr.FszPage) & 0x0001) << 16)))
+ libc.Xmemcpy(tls, pWal+52, bp /* &h1 */, uint32(unsafe.Sizeof(WalIndexHdr{})))
+ (*Wal)(unsafe.Pointer(pWal)).FszPage = U32(int32((*Wal)(unsafe.Pointer(pWal)).Fhdr.FszPage)&0xfe00 + int32((*Wal)(unsafe.Pointer(pWal)).Fhdr.FszPage)&0x0001<<16)
}
@@ -39910,7 +40524,7 @@ func walIndexTryHdr(tls *libc.TLS, pWal uintptr, pChanged uintptr) int32 { /* sq
//
// If the wal-index header is successfully read, return SQLITE_OK.
// Otherwise an SQLite error code.
-func walIndexReadHdr(tls *libc.TLS, pWal uintptr, pChanged uintptr) int32 { /* sqlite3.c:62641:12: */
+func walIndexReadHdr(tls *libc.TLS, pWal uintptr, pChanged uintptr) int32 { /* sqlite3.c:62761:12: */
bp := tls.Alloc(4)
defer tls.Free(4)
@@ -39925,7 +40539,7 @@ func walIndexReadHdr(tls *libc.TLS, pWal uintptr, pChanged uintptr) int32 { /* s
rc = walIndexPage(tls, pWal, 0, bp /* &page0 */)
if rc != SQLITE_OK {
// READONLY changed to OK in walIndexPage
- if rc == (SQLITE_READONLY | (int32(5) << 8)) {
+ if rc == SQLITE_READONLY|int32(5)<<8 {
// The SQLITE_READONLY_CANTINIT return means that the shared-memory
// was openable but is not writable, and this thread is unable to
// confirm that another write-capable connection has the shared-memory
@@ -39950,7 +40564,7 @@ func walIndexReadHdr(tls *libc.TLS, pWal uintptr, pChanged uintptr) int32 { /* s
// works, but may fail if the wal-index header is corrupt or currently
// being modified by another thread or process.
badHdr = func() int32 {
- if *(*uintptr)(unsafe.Pointer(bp /* page0 */)) != 0 {
+ if *(*uintptr)(unsafe.Pointer(bp)) != 0 {
return walIndexTryHdr(tls, pWal, pChanged)
}
return 1
@@ -39959,16 +40573,16 @@ func walIndexReadHdr(tls *libc.TLS, pWal uintptr, pChanged uintptr) int32 { /* s
// If the first attempt failed, it might have been due to a race
// with a writer. So get a WRITE lock and try again.
if badHdr != 0 {
- if (int32((*Wal)(unsafe.Pointer(pWal)).FbShmUnreliable) == 0) && ((int32((*Wal)(unsafe.Pointer(pWal)).FreadOnly) & WAL_SHM_RDONLY) != 0) {
- if SQLITE_OK == (libc.AssignInt32(&rc, walLockShared(tls, pWal, WAL_WRITE_LOCK))) {
+ if int32((*Wal)(unsafe.Pointer(pWal)).FbShmUnreliable) == 0 && int32((*Wal)(unsafe.Pointer(pWal)).FreadOnly)&WAL_SHM_RDONLY != 0 {
+ if SQLITE_OK == libc.AssignInt32(&rc, walLockShared(tls, pWal, WAL_WRITE_LOCK)) {
walUnlockShared(tls, pWal, WAL_WRITE_LOCK)
- rc = (SQLITE_READONLY | (int32(1) << 8))
+ rc = SQLITE_READONLY | int32(1)<<8
}
} else {
var bWriteLock int32 = int32((*Wal)(unsafe.Pointer(pWal)).FwriteLock)
- if (bWriteLock != 0) || (SQLITE_OK == (libc.AssignInt32(&rc, walLockExclusive(tls, pWal, WAL_WRITE_LOCK, 1)))) {
+ if bWriteLock != 0 || SQLITE_OK == libc.AssignInt32(&rc, walLockExclusive(tls, pWal, WAL_WRITE_LOCK, 1)) {
(*Wal)(unsafe.Pointer(pWal)).FwriteLock = U8(1)
- if SQLITE_OK == (libc.AssignInt32(&rc, walIndexPage(tls, pWal, 0, bp /* &page0 */))) {
+ if SQLITE_OK == libc.AssignInt32(&rc, walIndexPage(tls, pWal, 0, bp)) {
badHdr = walIndexTryHdr(tls, pWal, pChanged)
if badHdr != 0 {
// If the wal-index header is still malformed even while holding
@@ -39989,8 +40603,8 @@ func walIndexReadHdr(tls *libc.TLS, pWal uintptr, pChanged uintptr) int32 { /* s
// If the header is read successfully, check the version number to make
// sure the wal-index was not constructed with some future format that
// this version of SQLite cannot understand.
- if (badHdr == 0) && ((*Wal)(unsafe.Pointer(pWal)).Fhdr.FiVersion != U32(WALINDEX_MAX_VERSION)) {
- rc = Xsqlite3CantopenError(tls, 62720)
+ if badHdr == 0 && (*Wal)(unsafe.Pointer(pWal)).Fhdr.FiVersion != U32(WALINDEX_MAX_VERSION) {
+ rc = Xsqlite3CantopenError(tls, 62840)
}
if (*Wal)(unsafe.Pointer(pWal)).FbShmUnreliable != 0 {
if rc != SQLITE_OK {
@@ -40000,7 +40614,7 @@ func walIndexReadHdr(tls *libc.TLS, pWal uintptr, pChanged uintptr) int32 { /* s
// walIndexRecover() might have returned SHORT_READ if a concurrent
// writer truncated the WAL out from under it. If that happens, it
// indicates that a writer has fixed the SHM file for us, so retry
- if rc == (SQLITE_IOERR | (int32(2) << 8)) {
+ if rc == SQLITE_IOERR|int32(2)<<8 {
rc = -1
}
}
@@ -40035,7 +40649,7 @@ func walIndexReadHdr(tls *libc.TLS, pWal uintptr, pChanged uintptr) int32 { /* s
// beginning (including attempting to map the *-shm file).
//
// If an error occurs, an SQLite error code is returned.
-func walBeginShmUnreliable(tls *libc.TLS, pWal uintptr, pChanged uintptr) int32 { /* sqlite3.c:62765:12: */
+func walBeginShmUnreliable(tls *libc.TLS, pWal uintptr, pChanged uintptr) int32 { /* sqlite3.c:62885:12: */
bp := tls.Alloc(64)
defer tls.Free(64)
@@ -40062,7 +40676,7 @@ func walBeginShmUnreliable(tls *libc.TLS, pWal uintptr, pChanged uintptr) int32
// Take WAL_READ_LOCK(0). This has the effect of preventing any
// writers from running a checkpoint, but does not stop them
// from running recovery.
- rc = walLockShared(tls, pWal, (3 + (0)))
+ rc = walLockShared(tls, pWal, 3+0)
if !(rc != SQLITE_OK) {
goto __1
}
@@ -40098,9 +40712,9 @@ __1:
// even if some external agent does a "chmod" to make the shared-memory
// writable by us, until sqlite3OsShmUnmap() has been called.
// This is a requirement on the VFS implementation.
- rc = Xsqlite3OsShmMap(tls, (*Wal)(unsafe.Pointer(pWal)).FpDbFd, 0, (int32((uint32(unsafe.Sizeof(Ht_slot(0))) * (uint32(HASHTABLE_NPAGE * 2))) + (uint32(HASHTABLE_NPAGE) * uint32(unsafe.Sizeof(U32(0)))))), 0, bp /* &pDummy */)
+ rc = Xsqlite3OsShmMap(tls, (*Wal)(unsafe.Pointer(pWal)).FpDbFd, 0, int32(uint32(unsafe.Sizeof(Ht_slot(0)))*uint32(HASHTABLE_NPAGE*2)+uint32(HASHTABLE_NPAGE)*uint32(unsafe.Sizeof(U32(0)))), 0, bp /* &pDummy */)
// SQLITE_OK not possible for read-only connection
- if !(rc != (SQLITE_READONLY | (int32(5) << 8))) {
+ if !(rc != SQLITE_READONLY|int32(5)<<8) {
goto __3
}
rc = func() int32 {
@@ -40116,7 +40730,7 @@ __3:
// We reach this point only if the real shared-memory is still unreliable.
// Assume the in-memory WAL-index substitute is correct and load it
// into pWal->hdr.
- libc.Xmemcpy(tls, (pWal + 52 /* &.hdr */), walIndexHdr(tls, pWal), uint32(unsafe.Sizeof(WalIndexHdr{})))
+ libc.Xmemcpy(tls, pWal+52, walIndexHdr(tls, pWal), uint32(unsafe.Sizeof(WalIndexHdr{})))
// Make sure some writer hasn't come in and changed the WAL file out
// from under us, then disconnected, while we were not looking.
@@ -40127,7 +40741,7 @@ __3:
goto begin_unreliable_shm_out
__4:
;
- if !(*(*I64)(unsafe.Pointer(bp + 8 /* szWal */)) < int64(WAL_HDRSIZE)) {
+ if !(*(*I64)(unsafe.Pointer(bp + 8)) < int64(WAL_HDRSIZE)) {
goto __5
}
// If the wal file is too small to contain a wal-header and the
@@ -40155,7 +40769,7 @@ __5:
goto begin_unreliable_shm_out
__6:
;
- if !(libc.Xmemcmp(tls, (pWal+52 /* &.hdr */ +32 /* &.aSalt */), (bp+16 /* &aBuf */ +16), uint32(8)) != 0) {
+ if !(libc.Xmemcmp(tls, pWal+52+32, bp+16+16, uint32(8)) != 0) {
goto __7
}
// Some writer has wrapped the WAL file while we were not looking.
@@ -40167,7 +40781,7 @@ __7:
;
// Allocate a buffer to read frames into
- szFrame = (int32((*Wal)(unsafe.Pointer(pWal)).Fhdr.FszPage) + WAL_FRAME_HDRSIZE)
+ szFrame = int32((*Wal)(unsafe.Pointer(pWal)).Fhdr.FszPage) + WAL_FRAME_HDRSIZE
aFrame = Xsqlite3_malloc64(tls, uint64(szFrame))
if !(aFrame == uintptr(0)) {
goto __8
@@ -40176,17 +40790,17 @@ __7:
goto begin_unreliable_shm_out
__8:
;
- aData = (aFrame + 24)
+ aData = aFrame + 24
// Check to see if a complete transaction has been appended to the
// wal file since the heap-memory wal-index was created. If so, the
// heap-memory wal-index is discarded and WAL_RETRY returned to
// the caller.
- *(*U32)(unsafe.Pointer(bp + 48 /* &aSaveCksum[0] */)) = *(*U32)(unsafe.Pointer((pWal + 52 /* &.hdr */ + 24 /* &.aFrameCksum */)))
- *(*U32)(unsafe.Pointer(bp + 48 /* &aSaveCksum[0] */ + 1*4)) = *(*U32)(unsafe.Pointer((pWal + 52 /* &.hdr */ + 24 /* &.aFrameCksum */) + 1*4))
- iOffset = (int64(WAL_HDRSIZE) + ((I64(((*Wal)(unsafe.Pointer(pWal)).Fhdr.FmxFrame + U32(1)) - U32(1))) * (I64((int32((*Wal)(unsafe.Pointer(pWal)).Fhdr.FszPage)) + WAL_FRAME_HDRSIZE))))
+ *(*U32)(unsafe.Pointer(bp + 48 /* &aSaveCksum[0] */)) = *(*U32)(unsafe.Pointer(pWal + 52 + 24))
+ *(*U32)(unsafe.Pointer(bp + 48 /* &aSaveCksum[0] */ + 1*4)) = *(*U32)(unsafe.Pointer(pWal + 52 + 24 + 1*4))
+ iOffset = int64(WAL_HDRSIZE) + I64((*Wal)(unsafe.Pointer(pWal)).Fhdr.FmxFrame+U32(1)-U32(1))*I64(int32((*Wal)(unsafe.Pointer(pWal)).Fhdr.FszPage)+WAL_FRAME_HDRSIZE)
__9:
- if !((iOffset + I64(szFrame)) <= *(*I64)(unsafe.Pointer(bp + 8 /* szWal */))) {
+ if !(iOffset+I64(szFrame) <= *(*I64)(unsafe.Pointer(bp + 8))) {
goto __11
} // dbsize field from frame header
@@ -40198,7 +40812,7 @@ __9:
goto __11
__12:
;
- if !(!(walDecodeFrame(tls, pWal, bp+56 /* &pgno */, bp+60 /* &nTruncate */, aData, aFrame) != 0)) {
+ if !!(walDecodeFrame(tls, pWal, bp+56, bp+60, aData, aFrame) != 0) {
goto __13
}
goto __11
@@ -40208,7 +40822,7 @@ __13:
// If nTruncate is non-zero, then a complete transaction has been
// appended to this wal file. Set rc to WAL_RETRY and break out of
// the loop.
- if !(*(*U32)(unsafe.Pointer(bp + 60 /* nTruncate */)) != 0) {
+ if !(*(*U32)(unsafe.Pointer(bp + 60)) != 0) {
goto __14
}
rc = -1
@@ -40217,13 +40831,13 @@ __14:
;
goto __10
__10:
- iOffset = iOffset + (I64(szFrame))
+ iOffset = iOffset + I64(szFrame)
goto __9
goto __11
__11:
;
- *(*U32)(unsafe.Pointer((pWal + 52 /* &.hdr */ + 24 /* &.aFrameCksum */))) = *(*U32)(unsafe.Pointer(bp + 48 /* &aSaveCksum[0] */))
- *(*U32)(unsafe.Pointer((pWal + 52 /* &.hdr */ + 24 /* &.aFrameCksum */) + 1*4)) = *(*U32)(unsafe.Pointer(bp + 48 /* &aSaveCksum[0] */ + 1*4))
+ *(*U32)(unsafe.Pointer(pWal + 52 + 24)) = *(*U32)(unsafe.Pointer(bp + 48 /* &aSaveCksum[0] */))
+ *(*U32)(unsafe.Pointer(pWal + 52 + 24 + 1*4)) = *(*U32)(unsafe.Pointer(bp + 48 /* &aSaveCksum[0] */ + 1*4))
begin_unreliable_shm_out:
Xsqlite3_free(tls, aFrame)
@@ -40300,7 +40914,7 @@ __15:
// update values of the aReadMark[] array in the header, but if it does
// so it takes care to hold an exclusive lock on the corresponding
// WAL_READ_LOCK() while changing values.
-func walTryBeginRead(tls *libc.TLS, pWal uintptr, pChanged uintptr, useWal int32, cnt int32) int32 { /* sqlite3.c:62960:12: */
+func walTryBeginRead(tls *libc.TLS, pWal uintptr, pChanged uintptr, useWal int32, cnt int32) int32 { /* sqlite3.c:63080:12: */
var pInfo uintptr // Checkpoint information in wal-index
var mxReadMark U32 // Largest aReadMark[] value
var mxI int32 // Index of largest aReadMark[] value
@@ -40335,7 +40949,7 @@ func walTryBeginRead(tls *libc.TLS, pWal uintptr, pChanged uintptr, useWal int32
return SQLITE_PROTOCOL
}
if cnt >= 10 {
- nDelay = (((cnt - 9) * (cnt - 9)) * 39)
+ nDelay = (cnt - 9) * (cnt - 9) * 39
}
Xsqlite3OsSleep(tls, (*Wal)(unsafe.Pointer(pWal)).FpVfs, nDelay)
}
@@ -40361,11 +40975,11 @@ func walTryBeginRead(tls *libc.TLS, pWal uintptr, pChanged uintptr, useWal int32
// code that determines whether or not the shared-memory region
// must be zeroed before the requested page is returned.
rc = -1
- } else if SQLITE_OK == (libc.AssignInt32(&rc, walLockShared(tls, pWal, WAL_RECOVER_LOCK))) {
+ } else if SQLITE_OK == libc.AssignInt32(&rc, walLockShared(tls, pWal, WAL_RECOVER_LOCK)) {
walUnlockShared(tls, pWal, WAL_RECOVER_LOCK)
rc = -1
} else if rc == SQLITE_BUSY {
- rc = (SQLITE_BUSY | (int32(1) << 8))
+ rc = SQLITE_BUSY | int32(1)<<8
}
}
if rc != SQLITE_OK {
@@ -40376,14 +40990,14 @@ func walTryBeginRead(tls *libc.TLS, pWal uintptr, pChanged uintptr, useWal int32
}
libc.AtomicStoreUintptr(&pInfo, uintptr(walCkptInfo(tls, pWal)))
- if (!(useWal != 0) && (U32(libc.AtomicLoadNUint32((pInfo /* &.nBackfill */), 0)) == (*Wal)(unsafe.Pointer(pWal)).Fhdr.FmxFrame)) &&
- (((*Wal)(unsafe.Pointer(pWal)).FpSnapshot == uintptr(0)) || ((*Wal)(unsafe.Pointer(pWal)).Fhdr.FmxFrame == U32(0))) {
+ if !(useWal != 0) && U32(libc.AtomicLoadNUint32(pInfo, 0)) == (*Wal)(unsafe.Pointer(pWal)).Fhdr.FmxFrame &&
+ ((*Wal)(unsafe.Pointer(pWal)).FpSnapshot == uintptr(0) || (*Wal)(unsafe.Pointer(pWal)).Fhdr.FmxFrame == U32(0)) {
// The WAL has been completely backfilled (or it is empty).
// and can be safely ignored.
- rc = walLockShared(tls, pWal, (3 + (0)))
+ rc = walLockShared(tls, pWal, 3+0)
walShmBarrier(tls, pWal)
if rc == SQLITE_OK {
- if libc.Xmemcmp(tls, walIndexHdr(tls, pWal), (pWal+52 /* &.hdr */), uint32(unsafe.Sizeof(WalIndexHdr{}))) != 0 {
+ if libc.Xmemcmp(tls, walIndexHdr(tls, pWal), pWal+52, uint32(unsafe.Sizeof(WalIndexHdr{}))) != 0 {
// It is not safe to allow the reader to continue here if frames
// may have been appended to the log before READ_LOCK(0) was obtained.
// When holding READ_LOCK(0), the reader ignores the entire log file,
@@ -40396,7 +41010,7 @@ func walTryBeginRead(tls *libc.TLS, pWal uintptr, pChanged uintptr, useWal int32
// is obtained, that is not necessarily true. A checkpointer may
// have started to backfill the appended frames but crashed before
// it finished. Leaving a corrupt image in the database file.
- walUnlockShared(tls, pWal, (3 + (0)))
+ walUnlockShared(tls, pWal, 3+0)
return -1
}
(*Wal)(unsafe.Pointer(pWal)).FreadLock = int16(0)
@@ -40413,26 +41027,26 @@ func walTryBeginRead(tls *libc.TLS, pWal uintptr, pChanged uintptr, useWal int32
mxReadMark = U32(0)
mxI = 0
mxFrame = (*Wal)(unsafe.Pointer(pWal)).Fhdr.FmxFrame
- if ((*Wal)(unsafe.Pointer(pWal)).FpSnapshot != 0) && ((*WalIndexHdr)(unsafe.Pointer((*Wal)(unsafe.Pointer(pWal)).FpSnapshot)).FmxFrame < mxFrame) {
+ if (*Wal)(unsafe.Pointer(pWal)).FpSnapshot != 0 && (*WalIndexHdr)(unsafe.Pointer((*Wal)(unsafe.Pointer(pWal)).FpSnapshot)).FmxFrame < mxFrame {
mxFrame = (*WalIndexHdr)(unsafe.Pointer((*Wal)(unsafe.Pointer(pWal)).FpSnapshot)).FmxFrame
}
- for i = 1; i < (SQLITE_SHM_NLOCK - 3); i++ {
- var thisMark U32 = U32(libc.AtomicLoadNUint32(((pInfo + 4 /* &.aReadMark */) + uintptr(i)*4), 0))
- if (mxReadMark <= thisMark) && (thisMark <= mxFrame) {
+ for i = 1; i < SQLITE_SHM_NLOCK-3; i++ {
+ var thisMark U32 = U32(libc.AtomicLoadNUint32(pInfo+4+uintptr(i)*4, 0))
+ if mxReadMark <= thisMark && thisMark <= mxFrame {
mxReadMark = thisMark
mxI = i
}
}
- if ((int32((*Wal)(unsafe.Pointer(pWal)).FreadOnly) & WAL_SHM_RDONLY) == 0) &&
- ((mxReadMark < mxFrame) || (mxI == 0)) {
- for i = 1; i < (SQLITE_SHM_NLOCK - 3); i++ {
- rc = walLockExclusive(tls, pWal, (3 + (i)), 1)
+ if int32((*Wal)(unsafe.Pointer(pWal)).FreadOnly)&WAL_SHM_RDONLY == 0 &&
+ (mxReadMark < mxFrame || mxI == 0) {
+ for i = 1; i < SQLITE_SHM_NLOCK-3; i++ {
+ rc = walLockExclusive(tls, pWal, 3+i, 1)
if rc == SQLITE_OK {
- libc.AtomicStoreNUint32(((pInfo + 4 /* &.aReadMark */) + uintptr(i)*4), uint32(mxFrame), 0)
+ libc.AtomicStoreNUint32(pInfo+4+uintptr(i)*4, uint32(mxFrame), 0)
mxReadMark = mxFrame
mxI = i
- walUnlockExclusive(tls, pWal, (3 + (i)), 1)
+ walUnlockExclusive(tls, pWal, 3+i, 1)
break
} else if rc != SQLITE_BUSY {
return rc
@@ -40444,10 +41058,10 @@ func walTryBeginRead(tls *libc.TLS, pWal uintptr, pChanged uintptr, useWal int32
if rc == SQLITE_BUSY {
return -1
}
- return (SQLITE_READONLY | (int32(5) << 8))
+ return SQLITE_READONLY | int32(5)<<8
}
- rc = walLockShared(tls, pWal, (3 + (mxI)))
+ rc = walLockShared(tls, pWal, 3+mxI)
if rc != 0 {
if rc == SQLITE_BUSY {
return -1
@@ -40487,11 +41101,11 @@ func walTryBeginRead(tls *libc.TLS, pWal uintptr, pChanged uintptr, useWal int32
// that it can read version A from the database file. However, since
// we can guarantee that the checkpointer that set nBackfill could not
// see any pages past pWal->hdr.mxFrame, this problem does not come up.
- (*Wal)(unsafe.Pointer(pWal)).FminFrame = (U32(libc.AtomicLoadNUint32((pInfo /* &.nBackfill */), 0) + 1))
+ (*Wal)(unsafe.Pointer(pWal)).FminFrame = U32(libc.AtomicLoadNUint32(pInfo, 0) + 1)
walShmBarrier(tls, pWal)
- if (U32(libc.AtomicLoadNUint32(((pInfo+4 /* &.aReadMark */)+uintptr(mxI)*4), 0)) != mxReadMark) ||
- (libc.Xmemcmp(tls, walIndexHdr(tls, pWal), (pWal+52 /* &.hdr */), uint32(unsafe.Sizeof(WalIndexHdr{}))) != 0) {
- walUnlockShared(tls, pWal, (3 + (mxI)))
+ if U32(libc.AtomicLoadNUint32(pInfo+4+uintptr(mxI)*4, 0)) != mxReadMark ||
+ libc.Xmemcmp(tls, walIndexHdr(tls, pWal), pWal+52, uint32(unsafe.Sizeof(WalIndexHdr{}))) != 0 {
+ walUnlockShared(tls, pWal, 3+mxI)
return -1
} else {
@@ -40517,7 +41131,7 @@ func walTryBeginRead(tls *libc.TLS, pWal uintptr, pChanged uintptr, useWal int32
// SQLITE_OK is returned if successful, or an SQLite error code if an
// error occurs. It is not an error if nBackfillAttempted cannot be
// decreased at all.
-func Xsqlite3WalSnapshotRecover(tls *libc.TLS, pWal uintptr) int32 { /* sqlite3.c:63190:20: */
+func Xsqlite3WalSnapshotRecover(tls *libc.TLS, pWal uintptr) int32 { /* sqlite3.c:63310:20: */
bp := tls.Alloc(20)
defer tls.Free(20)
@@ -40534,11 +41148,11 @@ func Xsqlite3WalSnapshotRecover(tls *libc.TLS, pWal uintptr) int32 { /* sqlite3.
if rc == SQLITE_OK {
var pBuf1 uintptr = Xsqlite3_malloc(tls, szPage)
var pBuf2 uintptr = Xsqlite3_malloc(tls, szPage)
- if (pBuf1 == uintptr(0)) || (pBuf2 == uintptr(0)) {
+ if pBuf1 == uintptr(0) || pBuf2 == uintptr(0) {
rc = SQLITE_NOMEM
} else {
var i U32 = (*WalCkptInfo)(unsafe.Pointer(pInfo)).FnBackfillAttempted
- for i = (*WalCkptInfo)(unsafe.Pointer(pInfo)).FnBackfillAttempted; i > U32(libc.AtomicLoadNUint32((pInfo /* &.nBackfill */), 0)); i-- {
+ for i = (*WalCkptInfo)(unsafe.Pointer(pInfo)).FnBackfillAttempted; i > U32(libc.AtomicLoadNUint32(pInfo /* &.nBackfill */, 0)); i-- {
// var sLoc WalHashLoc at bp+8, 12
// Hash table location
var pgno U32 // Page number in db file
@@ -40549,23 +41163,24 @@ func Xsqlite3WalSnapshotRecover(tls *libc.TLS, pWal uintptr) int32 { /* sqlite3.
if rc != SQLITE_OK {
break
}
- pgno = *(*U32)(unsafe.Pointer((*WalHashLoc)(unsafe.Pointer(bp+8 /* &sLoc */)).FaPgno + uintptr((i-(*WalHashLoc)(unsafe.Pointer(bp+8 /* &sLoc */)).FiZero))*4))
- iDbOff = ((I64(pgno - U32(1))) * I64(szPage))
- if (iDbOff + I64(szPage)) <= *(*I64)(unsafe.Pointer(bp /* szDb */)) {
- iWalOff = ((int64(WAL_HDRSIZE) + ((I64((i) - U32(1))) * (I64((szPage) + WAL_FRAME_HDRSIZE)))) + int64(WAL_FRAME_HDRSIZE))
+ pgno = *(*U32)(unsafe.Pointer((*WalHashLoc)(unsafe.Pointer(bp+8 /* &sLoc */)).FaPgno + uintptr(i-(*WalHashLoc)(unsafe.Pointer(bp+8)).FiZero-U32(1))*4))
+ iDbOff = I64(pgno-U32(1)) * I64(szPage)
+
+ if iDbOff+I64(szPage) <= *(*I64)(unsafe.Pointer(bp)) {
+ iWalOff = int64(WAL_HDRSIZE) + I64(i-U32(1))*I64(szPage+WAL_FRAME_HDRSIZE) + int64(WAL_FRAME_HDRSIZE)
rc = Xsqlite3OsRead(tls, (*Wal)(unsafe.Pointer(pWal)).FpWalFd, pBuf1, szPage, iWalOff)
if rc == SQLITE_OK {
rc = Xsqlite3OsRead(tls, (*Wal)(unsafe.Pointer(pWal)).FpDbFd, pBuf2, szPage, iDbOff)
}
- if (rc != SQLITE_OK) || (0 == libc.Xmemcmp(tls, pBuf1, pBuf2, uint32(szPage))) {
+ if rc != SQLITE_OK || 0 == libc.Xmemcmp(tls, pBuf1, pBuf2, uint32(szPage)) {
break
}
}
- (*WalCkptInfo)(unsafe.Pointer(pInfo)).FnBackfillAttempted = (i - U32(1))
+ (*WalCkptInfo)(unsafe.Pointer(pInfo)).FnBackfillAttempted = i - U32(1)
}
}
@@ -40590,14 +41205,14 @@ func Xsqlite3WalSnapshotRecover(tls *libc.TLS, pWal uintptr) int32 { /* sqlite3.
// transaction, then *pChanged is set to 1 before returning. The
// Pager layer will use this to know that its cache is stale and
// needs to be flushed.
-func Xsqlite3WalBeginReadTransaction(tls *libc.TLS, pWal uintptr, pChanged uintptr) int32 { /* sqlite3.c:63260:20: */
+func Xsqlite3WalBeginReadTransaction(tls *libc.TLS, pWal uintptr, pChanged uintptr) int32 { /* sqlite3.c:63381:20: */
var rc int32 // Return code
var cnt int32 = 0 // Number of TryBeginRead attempts
var bChanged int32 = 0
var pSnapshot uintptr = (*Wal)(unsafe.Pointer(pWal)).FpSnapshot
if pSnapshot != 0 {
- if (libc.Xmemcmp(tls, pSnapshot, (pWal+52 /* &.hdr */), uint32(unsafe.Sizeof(WalIndexHdr{}))) != 0) {
+ if libc.Xmemcmp(tls, pSnapshot, pWal+52, uint32(unsafe.Sizeof(WalIndexHdr{}))) != 0 {
bChanged = 1
}
@@ -40618,12 +41233,12 @@ func Xsqlite3WalBeginReadTransaction(tls *libc.TLS, pWal uintptr, pChanged uintp
(*Wal)(unsafe.Pointer(pWal)).FckptLock = U8(1)
}
- for ok := true; ok; ok = (rc == (-1)) {
+ for ok := true; ok; ok = rc == -1 {
rc = walTryBeginRead(tls, pWal, pChanged, 0, libc.PreIncInt32(&cnt, 1))
}
if rc == SQLITE_OK {
- if (pSnapshot != 0) && (libc.Xmemcmp(tls, pSnapshot, (pWal+52 /* &.hdr */), uint32(unsafe.Sizeof(WalIndexHdr{}))) != 0) {
+ if pSnapshot != 0 && libc.Xmemcmp(tls, pSnapshot, pWal+52, uint32(unsafe.Sizeof(WalIndexHdr{}))) != 0 {
// At this point the client has a lock on an aReadMark[] slot holding
// a value equal to or smaller than pSnapshot->mxFrame, but pWal->hdr
// is populated with the wal-index header corresponding to the head
@@ -40644,13 +41259,13 @@ func Xsqlite3WalBeginReadTransaction(tls *libc.TLS, pWal uintptr, pChanged uintp
// true, return SQLITE_ERROR_SNAPSHOT. Otherwise, overwrite pWal->hdr
// with *pSnapshot and set *pChanged as appropriate for opening the
// snapshot.
- if !(libc.Xmemcmp(tls, pSnapshot+32 /* &.aSalt */, pWal+52 /* &.hdr */ +32 /* &.aSalt */, uint32(unsafe.Sizeof([2]U32{}))) != 0) &&
- ((*WalIndexHdr)(unsafe.Pointer(pSnapshot)).FmxFrame >= (*WalCkptInfo)(unsafe.Pointer(pInfo)).FnBackfillAttempted) {
+ if !(libc.Xmemcmp(tls, pSnapshot+32, pWal+52+32, uint32(unsafe.Sizeof([2]U32{}))) != 0) &&
+ (*WalIndexHdr)(unsafe.Pointer(pSnapshot)).FmxFrame >= (*WalCkptInfo)(unsafe.Pointer(pInfo)).FnBackfillAttempted {
- libc.Xmemcpy(tls, (pWal + 52 /* &.hdr */), pSnapshot, uint32(unsafe.Sizeof(WalIndexHdr{})))
+ libc.Xmemcpy(tls, pWal+52, pSnapshot, uint32(unsafe.Sizeof(WalIndexHdr{})))
*(*int32)(unsafe.Pointer(pChanged)) = bChanged
} else {
- rc = (SQLITE_ERROR | (int32(3) << 8))
+ rc = SQLITE_ERROR | int32(3)<<8
}
// A client using a non-current snapshot may not ignore any frames
@@ -40678,10 +41293,10 @@ func Xsqlite3WalBeginReadTransaction(tls *libc.TLS, pWal uintptr, pChanged uintp
// Finish with a read transaction. All this does is release the
// read-lock.
-func Xsqlite3WalEndReadTransaction(tls *libc.TLS, pWal uintptr) { /* sqlite3.c:63368:21: */
+func Xsqlite3WalEndReadTransaction(tls *libc.TLS, pWal uintptr) { /* sqlite3.c:63489:21: */
Xsqlite3WalEndWriteTransaction(tls, pWal)
if int32((*Wal)(unsafe.Pointer(pWal)).FreadLock) >= 0 {
- walUnlockShared(tls, pWal, (3 + (int32((*Wal)(unsafe.Pointer(pWal)).FreadLock))))
+ walUnlockShared(tls, pWal, 3+int32((*Wal)(unsafe.Pointer(pWal)).FreadLock))
(*Wal)(unsafe.Pointer(pWal)).FreadLock = int16(-1)
}
}
@@ -40692,7 +41307,7 @@ func Xsqlite3WalEndReadTransaction(tls *libc.TLS, pWal uintptr) { /* sqlite3.c:6
//
// Return SQLITE_OK if successful, or an error code if an error occurs. If an
// error does occur, the final value of *piRead is undefined.
-func Xsqlite3WalFindFrame(tls *libc.TLS, pWal uintptr, pgno Pgno, piRead uintptr) int32 { /* sqlite3.c:63384:20: */
+func Xsqlite3WalFindFrame(tls *libc.TLS, pWal uintptr, pgno Pgno, piRead uintptr) int32 { /* sqlite3.c:63505:20: */
bp := tls.Alloc(12)
defer tls.Free(12)
@@ -40708,7 +41323,7 @@ func Xsqlite3WalFindFrame(tls *libc.TLS, pWal uintptr, pgno Pgno, piRead uintptr
// in this case as an optimization. Likewise, if pWal->readLock==0,
// then the WAL is ignored by the reader so return early, as if the
// WAL were empty.
- if (iLast == U32(0)) || ((int32((*Wal)(unsafe.Pointer(pWal)).FreadLock) == 0) && (int32((*Wal)(unsafe.Pointer(pWal)).FbShmUnreliable) == 0)) {
+ if iLast == U32(0) || int32((*Wal)(unsafe.Pointer(pWal)).FreadLock) == 0 && int32((*Wal)(unsafe.Pointer(pWal)).FbShmUnreliable) == 0 {
*(*U32)(unsafe.Pointer(piRead)) = U32(0)
return SQLITE_OK
}
@@ -40750,16 +41365,16 @@ func Xsqlite3WalFindFrame(tls *libc.TLS, pWal uintptr, pgno Pgno, piRead uintptr
if rc != SQLITE_OK {
return rc
}
- nCollide = (HASHTABLE_NPAGE * 2)
+ nCollide = HASHTABLE_NPAGE * 2
iKey = walHash(tls, pgno)
- for (libc.AssignUint32(&iH, U32(libc.AtomicLoadNUint16(((*WalHashLoc)(unsafe.Pointer(bp /* &sLoc */)).FaHash+uintptr(iKey)*2), 0)))) != U32(0) {
- var iFrame U32 = (iH + (*WalHashLoc)(unsafe.Pointer(bp /* &sLoc */)).FiZero)
- if ((iFrame <= iLast) && (iFrame >= (*Wal)(unsafe.Pointer(pWal)).FminFrame)) && (*(*U32)(unsafe.Pointer((*WalHashLoc)(unsafe.Pointer(bp /* &sLoc */)).FaPgno + uintptr(iH)*4)) == pgno) {
+ for libc.AssignUint32(&iH, U32(libc.AtomicLoadNUint16((*WalHashLoc)(unsafe.Pointer(bp)).FaHash+uintptr(iKey)*2, 0))) != U32(0) {
+ var iFrame U32 = iH + (*WalHashLoc)(unsafe.Pointer(bp)).FiZero
+ if iFrame <= iLast && iFrame >= (*Wal)(unsafe.Pointer(pWal)).FminFrame && *(*U32)(unsafe.Pointer((*WalHashLoc)(unsafe.Pointer(bp)).FaPgno + uintptr(iH-U32(1))*4)) == pgno {
iRead = iFrame
}
- if (libc.PostDecInt32(&nCollide, 1)) == 0 {
- return Xsqlite3CorruptError(tls, 63454)
+ if libc.PostDecInt32(&nCollide, 1) == 0 {
+ return Xsqlite3CorruptError(tls, 63575)
}
iKey = walNextHash(tls, iKey)
}
@@ -40775,13 +41390,13 @@ func Xsqlite3WalFindFrame(tls *libc.TLS, pWal uintptr, pgno Pgno, piRead uintptr
// Read the contents of frame iRead from the wal file into buffer pOut
// (which is nOut bytes in size). Return SQLITE_OK if successful, or an
// error code otherwise.
-func Xsqlite3WalReadFrame(tls *libc.TLS, pWal uintptr, iRead U32, nOut int32, pOut uintptr) int32 { /* sqlite3.c:63488:20: */
+func Xsqlite3WalReadFrame(tls *libc.TLS, pWal uintptr, iRead U32, nOut int32, pOut uintptr) int32 { /* sqlite3.c:63609:20: */
var sz int32
var iOffset I64
sz = int32((*Wal)(unsafe.Pointer(pWal)).Fhdr.FszPage)
- sz = ((sz & 0xfe00) + ((sz & 0x0001) << 16))
+ sz = sz&0xfe00 + sz&0x0001<<16
- iOffset = ((int64(WAL_HDRSIZE) + ((I64((iRead) - U32(1))) * (I64((sz) + WAL_FRAME_HDRSIZE)))) + int64(WAL_FRAME_HDRSIZE))
+ iOffset = int64(WAL_HDRSIZE) + I64(iRead-U32(1))*I64(sz+WAL_FRAME_HDRSIZE) + int64(WAL_FRAME_HDRSIZE)
// testcase( IS_BIG_INT(iOffset) ); // requires a 4GiB WAL
return Xsqlite3OsRead(tls, (*Wal)(unsafe.Pointer(pWal)).FpWalFd, pOut, func() int32 {
if nOut > sz {
@@ -40792,8 +41407,8 @@ func Xsqlite3WalReadFrame(tls *libc.TLS, pWal uintptr, iRead U32, nOut int32, pO
}
// Return the size of the database in pages (or zero, if unknown).
-func Xsqlite3WalDbsize(tls *libc.TLS, pWal uintptr) Pgno { /* sqlite3.c:63508:21: */
- if (pWal != 0) && (int32((*Wal)(unsafe.Pointer(pWal)).FreadLock) >= 0) {
+func Xsqlite3WalDbsize(tls *libc.TLS, pWal uintptr) Pgno { /* sqlite3.c:63629:21: */
+ if pWal != 0 && int32((*Wal)(unsafe.Pointer(pWal)).FreadLock) >= 0 {
return (*Wal)(unsafe.Pointer(pWal)).Fhdr.FnPage
}
return Pgno(0)
@@ -40810,7 +41425,7 @@ func Xsqlite3WalDbsize(tls *libc.TLS, pWal uintptr) Pgno { /* sqlite3.c:63508:21
// returns SQLITE_BUSY in that case and no write transaction is started.
//
// There can only be a single writer active at a time.
-func Xsqlite3WalBeginWriteTransaction(tls *libc.TLS, pWal uintptr) int32 { /* sqlite3.c:63529:20: */
+func Xsqlite3WalBeginWriteTransaction(tls *libc.TLS, pWal uintptr) int32 { /* sqlite3.c:63650:20: */
var rc int32
// Cannot start a write transaction without first holding a read
@@ -40831,10 +41446,10 @@ func Xsqlite3WalBeginWriteTransaction(tls *libc.TLS, pWal uintptr) int32 { /* sq
// If another connection has written to the database file since the
// time the read transaction on this connection was started, then
// the write is disallowed.
- if (libc.Xmemcmp(tls, (pWal+52 /* &.hdr */), walIndexHdr(tls, pWal), uint32(unsafe.Sizeof(WalIndexHdr{}))) != 0) {
+ if libc.Xmemcmp(tls, pWal+52, walIndexHdr(tls, pWal), uint32(unsafe.Sizeof(WalIndexHdr{}))) != 0 {
walUnlockExclusive(tls, pWal, WAL_WRITE_LOCK, 1)
(*Wal)(unsafe.Pointer(pWal)).FwriteLock = U8(0)
- rc = (SQLITE_BUSY | (int32(2) << 8))
+ rc = SQLITE_BUSY | int32(2)<<8
}
return rc
@@ -40842,7 +41457,7 @@ func Xsqlite3WalBeginWriteTransaction(tls *libc.TLS, pWal uintptr) int32 { /* sq
// End a write transaction. The commit has already been done. This
// routine merely releases the lock.
-func Xsqlite3WalEndWriteTransaction(tls *libc.TLS, pWal uintptr) int32 { /* sqlite3.c:63577:20: */
+func Xsqlite3WalEndWriteTransaction(tls *libc.TLS, pWal uintptr) int32 { /* sqlite3.c:63698:20: */
if (*Wal)(unsafe.Pointer(pWal)).FwriteLock != 0 {
walUnlockExclusive(tls, pWal, WAL_WRITE_LOCK, 1)
(*Wal)(unsafe.Pointer(pWal)).FwriteLock = U8(0)
@@ -40862,7 +41477,7 @@ func Xsqlite3WalEndWriteTransaction(tls *libc.TLS, pWal uintptr) int32 { /* sqli
//
// Otherwise, if the callback function does not return an error, this
// function returns SQLITE_OK.
-func Xsqlite3WalUndo(tls *libc.TLS, pWal uintptr, xUndo uintptr, pUndoCtx uintptr) int32 { /* sqlite3.c:63599:20: */
+func Xsqlite3WalUndo(tls *libc.TLS, pWal uintptr, xUndo uintptr, pUndoCtx uintptr) int32 { /* sqlite3.c:63720:20: */
var rc int32 = SQLITE_OK
if (*Wal)(unsafe.Pointer(pWal)).FwriteLock != 0 {
var iMax Pgno = (*Wal)(unsafe.Pointer(pWal)).Fhdr.FmxFrame
@@ -40870,9 +41485,9 @@ func Xsqlite3WalUndo(tls *libc.TLS, pWal uintptr, xUndo uintptr, pUndoCtx uintpt
// Restore the clients cache of the wal-index header to the state it
// was in before the client began writing to the database.
- libc.Xmemcpy(tls, (pWal + 52 /* &.hdr */), walIndexHdr(tls, pWal), uint32(unsafe.Sizeof(WalIndexHdr{})))
+ libc.Xmemcpy(tls, pWal+52, walIndexHdr(tls, pWal), uint32(unsafe.Sizeof(WalIndexHdr{})))
- for iFrame = ((*Wal)(unsafe.Pointer(pWal)).Fhdr.FmxFrame + U32(1)); (rc == SQLITE_OK) && (iFrame <= iMax); iFrame++ {
+ for iFrame = (*Wal)(unsafe.Pointer(pWal)).Fhdr.FmxFrame + U32(1); rc == SQLITE_OK && iFrame <= iMax; iFrame++ {
// This call cannot fail. Unless the page for which the page number
// is passed as the second argument is (a) in the cache and
// (b) has an outstanding reference, then xUndo is either a no-op
@@ -40899,11 +41514,11 @@ func Xsqlite3WalUndo(tls *libc.TLS, pWal uintptr, xUndo uintptr, pUndoCtx uintpt
// values. This function populates the array with values required to
// "rollback" the write position of the WAL handle back to the current
// point in the event of a savepoint rollback (via WalSavepointUndo()).
-func Xsqlite3WalSavepoint(tls *libc.TLS, pWal uintptr, aWalData uintptr) { /* sqlite3.c:63639:21: */
+func Xsqlite3WalSavepoint(tls *libc.TLS, pWal uintptr, aWalData uintptr) { /* sqlite3.c:63760:21: */
*(*U32)(unsafe.Pointer(aWalData)) = (*Wal)(unsafe.Pointer(pWal)).Fhdr.FmxFrame
- *(*U32)(unsafe.Pointer(aWalData + 1*4)) = *(*U32)(unsafe.Pointer((pWal + 52 /* &.hdr */ + 24 /* &.aFrameCksum */)))
- *(*U32)(unsafe.Pointer(aWalData + 2*4)) = *(*U32)(unsafe.Pointer((pWal + 52 /* &.hdr */ + 24 /* &.aFrameCksum */) + 1*4))
+ *(*U32)(unsafe.Pointer(aWalData + 1*4)) = *(*U32)(unsafe.Pointer(pWal + 52 + 24))
+ *(*U32)(unsafe.Pointer(aWalData + 2*4)) = *(*U32)(unsafe.Pointer(pWal + 52 + 24 + 1*4))
*(*U32)(unsafe.Pointer(aWalData + 3*4)) = (*Wal)(unsafe.Pointer(pWal)).FnCkpt
}
@@ -40911,7 +41526,7 @@ func Xsqlite3WalSavepoint(tls *libc.TLS, pWal uintptr, aWalData uintptr) { /* sq
// the values in the aWalData[] array. aWalData must point to an array
// of WAL_SAVEPOINT_NDATA u32 values that has been previously populated
// by a call to WalSavepoint().
-func Xsqlite3WalSavepointUndo(tls *libc.TLS, pWal uintptr, aWalData uintptr) int32 { /* sqlite3.c:63653:20: */
+func Xsqlite3WalSavepointUndo(tls *libc.TLS, pWal uintptr, aWalData uintptr) int32 { /* sqlite3.c:63774:20: */
var rc int32 = SQLITE_OK
if *(*U32)(unsafe.Pointer(aWalData + 3*4)) != (*Wal)(unsafe.Pointer(pWal)).FnCkpt {
@@ -40924,8 +41539,8 @@ func Xsqlite3WalSavepointUndo(tls *libc.TLS, pWal uintptr, aWalData uintptr) int
if *(*U32)(unsafe.Pointer(aWalData)) < (*Wal)(unsafe.Pointer(pWal)).Fhdr.FmxFrame {
(*Wal)(unsafe.Pointer(pWal)).Fhdr.FmxFrame = *(*U32)(unsafe.Pointer(aWalData))
- *(*U32)(unsafe.Pointer((pWal + 52 /* &.hdr */ + 24 /* &.aFrameCksum */))) = *(*U32)(unsafe.Pointer(aWalData + 1*4))
- *(*U32)(unsafe.Pointer((pWal + 52 /* &.hdr */ + 24 /* &.aFrameCksum */) + 1*4)) = *(*U32)(unsafe.Pointer(aWalData + 2*4))
+ *(*U32)(unsafe.Pointer(pWal + 52 + 24)) = *(*U32)(unsafe.Pointer(aWalData + 1*4))
+ *(*U32)(unsafe.Pointer(pWal + 52 + 24 + 1*4)) = *(*U32)(unsafe.Pointer(aWalData + 2*4))
walCleanupHash(tls, pWal)
}
@@ -40942,7 +41557,7 @@ func Xsqlite3WalSavepointUndo(tls *libc.TLS, pWal uintptr, aWalData uintptr) int
// SQLITE_OK is returned if no error is encountered (regardless of whether
// or not pWal->hdr.mxFrame is modified). An SQLite error code is returned
// if an error occurs.
-func walRestartLog(tls *libc.TLS, pWal uintptr) int32 { /* sqlite3.c:63690:12: */
+func walRestartLog(tls *libc.TLS, pWal uintptr) int32 { /* sqlite3.c:63811:12: */
bp := tls.Alloc(8)
defer tls.Free(8)
@@ -40956,7 +41571,7 @@ func walRestartLog(tls *libc.TLS, pWal uintptr) int32 { /* sqlite3.c:63690:12: *
// var salt1 U32 at bp, 4
Xsqlite3_randomness(tls, 4, bp /* &salt1 */)
- rc = walLockExclusive(tls, pWal, (3 + (1)), ((SQLITE_SHM_NLOCK - 3) - 1))
+ rc = walLockExclusive(tls, pWal, 3+1, SQLITE_SHM_NLOCK-3-1)
if rc == SQLITE_OK {
// If all readers are using WAL_READ_LOCK(0) (in other words if no
// readers are currently using the WAL), then the transactions
@@ -40968,15 +41583,15 @@ func walRestartLog(tls *libc.TLS, pWal uintptr) int32 { /* sqlite3.c:63690:12: *
// safe and means there is no special case for sqlite3WalUndo()
// to handle if this transaction is rolled back.
walRestartHdr(tls, pWal, *(*U32)(unsafe.Pointer(bp /* salt1 */)))
- walUnlockExclusive(tls, pWal, (3 + (1)), ((SQLITE_SHM_NLOCK - 3) - 1))
+ walUnlockExclusive(tls, pWal, 3+1, SQLITE_SHM_NLOCK-3-1)
} else if rc != SQLITE_BUSY {
return rc
}
}
- walUnlockShared(tls, pWal, (3 + (0)))
+ walUnlockShared(tls, pWal, 3+0)
(*Wal)(unsafe.Pointer(pWal)).FreadLock = int16(-1)
cnt = 0
- for ok := true; ok; ok = (rc == (-1)) {
+ for ok := true; ok; ok = rc == -1 {
// var notUsed int32 at bp+4, 4
rc = walTryBeginRead(tls, pWal, bp+4 /* &notUsed */, 1, libc.PreIncInt32(&cnt, 1))
@@ -40996,12 +41611,12 @@ type WalWriter1 = struct {
FiSyncPoint Sqlite3_int64
FsyncFlags int32
FszPage int32
-} /* sqlite3.c:63737:9 */
+} /* sqlite3.c:63858:9 */
// Information about the current state of the WAL file and where
// the next fsync should occur - passed from sqlite3WalFrames() into
// walWriteToLog().
-type WalWriter = WalWriter1 /* sqlite3.c:63743:3 */
+type WalWriter = WalWriter1 /* sqlite3.c:63864:3 */
// Write iAmt bytes of content into the WAL file beginning at iOffset.
// Do a sync when crossing the p->iSyncPoint boundary.
@@ -41009,20 +41624,20 @@ type WalWriter = WalWriter1 /* sqlite3.c:63743:3 */
// In other words, if iSyncPoint is in between iOffset and iOffset+iAmt,
// first write the part before iSyncPoint, then sync, then write the
// rest.
-func walWriteToLog(tls *libc.TLS, p uintptr, pContent uintptr, iAmt int32, iOffset Sqlite3_int64) int32 { /* sqlite3.c:63753:12: */
+func walWriteToLog(tls *libc.TLS, p uintptr, pContent uintptr, iAmt int32, iOffset Sqlite3_int64) int32 { /* sqlite3.c:63874:12: */
var rc int32
- if (iOffset < (*WalWriter)(unsafe.Pointer(p)).FiSyncPoint) && ((iOffset + Sqlite3_int64(iAmt)) >= (*WalWriter)(unsafe.Pointer(p)).FiSyncPoint) {
- var iFirstAmt int32 = (int32((*WalWriter)(unsafe.Pointer(p)).FiSyncPoint - iOffset))
+ if iOffset < (*WalWriter)(unsafe.Pointer(p)).FiSyncPoint && iOffset+Sqlite3_int64(iAmt) >= (*WalWriter)(unsafe.Pointer(p)).FiSyncPoint {
+ var iFirstAmt int32 = int32((*WalWriter)(unsafe.Pointer(p)).FiSyncPoint - iOffset)
rc = Xsqlite3OsWrite(tls, (*WalWriter)(unsafe.Pointer(p)).FpFd, pContent, iFirstAmt, iOffset)
if rc != 0 {
return rc
}
- iOffset = iOffset + (Sqlite3_int64(iFirstAmt))
- iAmt = iAmt - (iFirstAmt)
- pContent = (uintptr(iFirstAmt) + pContent)
+ iOffset = iOffset + Sqlite3_int64(iFirstAmt)
+ iAmt = iAmt - iFirstAmt
+ pContent = uintptr(iFirstAmt) + pContent
- rc = Xsqlite3OsSync(tls, (*WalWriter)(unsafe.Pointer(p)).FpFd, (((*WalWriter)(unsafe.Pointer(p)).FsyncFlags) & 0x03))
- if (iAmt == 0) || (rc != 0) {
+ rc = Xsqlite3OsSync(tls, (*WalWriter)(unsafe.Pointer(p)).FpFd, (*WalWriter)(unsafe.Pointer(p)).FsyncFlags&0x03)
+ if iAmt == 0 || rc != 0 {
return rc
}
}
@@ -41031,7 +41646,7 @@ func walWriteToLog(tls *libc.TLS, p uintptr, pContent uintptr, iAmt int32, iOffs
}
// Write out a single frame of the WAL
-func walWriteOneFrame(tls *libc.TLS, p uintptr, pPage uintptr, nTruncate int32, iOffset Sqlite3_int64) int32 { /* sqlite3.c:63778:12: */
+func walWriteOneFrame(tls *libc.TLS, p uintptr, pPage uintptr, nTruncate int32, iOffset Sqlite3_int64) int32 { /* sqlite3.c:63899:12: */
bp := tls.Alloc(24)
defer tls.Free(24)
@@ -41046,7 +41661,7 @@ func walWriteOneFrame(tls *libc.TLS, p uintptr, pPage uintptr, nTruncate int32,
return rc
}
// Write the page data
- rc = walWriteToLog(tls, p, pData, (*WalWriter)(unsafe.Pointer(p)).FszPage, (iOffset + Sqlite3_int64(unsafe.Sizeof([24]U8{}))))
+ rc = walWriteToLog(tls, p, pData, (*WalWriter)(unsafe.Pointer(p)).FszPage, iOffset+Sqlite3_int64(unsafe.Sizeof([24]U8{})))
return rc
}
@@ -41056,7 +41671,7 @@ func walWriteOneFrame(tls *libc.TLS, p uintptr, pPage uintptr, nTruncate int32,
// with the earliest to have been overwritten.
//
// SQLITE_OK is returned if successful, or an SQLite error code otherwise.
-func walRewriteChecksums(tls *libc.TLS, pWal uintptr, iLast U32) int32 { /* sqlite3.c:63804:12: */
+func walRewriteChecksums(tls *libc.TLS, pWal uintptr, iLast U32) int32 { /* sqlite3.c:63925:12: */
bp := tls.Alloc(24)
defer tls.Free(24)
@@ -41068,7 +41683,7 @@ func walRewriteChecksums(tls *libc.TLS, pWal uintptr, iLast U32) int32 { /* sqli
var iRead U32 // Next frame to read from wal file
var iCksumOff I64
- aBuf = Xsqlite3_malloc(tls, (szPage + WAL_FRAME_HDRSIZE))
+ aBuf = Xsqlite3_malloc(tls, szPage+WAL_FRAME_HDRSIZE)
if aBuf == uintptr(0) {
return SQLITE_NOMEM
}
@@ -41082,24 +41697,24 @@ func walRewriteChecksums(tls *libc.TLS, pWal uintptr, iLast U32) int32 { /* sqli
if (*Wal)(unsafe.Pointer(pWal)).FiReCksum == U32(1) {
iCksumOff = int64(24)
} else {
- iCksumOff = ((int64(WAL_HDRSIZE) + ((I64(((*Wal)(unsafe.Pointer(pWal)).FiReCksum - U32(1)) - U32(1))) * (I64((szPage) + WAL_FRAME_HDRSIZE)))) + int64(16))
+ iCksumOff = int64(WAL_HDRSIZE) + I64((*Wal)(unsafe.Pointer(pWal)).FiReCksum-U32(1)-U32(1))*I64(szPage+WAL_FRAME_HDRSIZE) + int64(16)
}
- rc = Xsqlite3OsRead(tls, (*Wal)(unsafe.Pointer(pWal)).FpWalFd, aBuf, (int32(uint32(unsafe.Sizeof(U32(0))) * uint32(2))), iCksumOff)
- *(*U32)(unsafe.Pointer((pWal + 52 /* &.hdr */ + 24 /* &.aFrameCksum */))) = Xsqlite3Get4byte(tls, aBuf)
- *(*U32)(unsafe.Pointer((pWal + 52 /* &.hdr */ + 24 /* &.aFrameCksum */) + 1*4)) = Xsqlite3Get4byte(tls, (aBuf + 4))
+ rc = Xsqlite3OsRead(tls, (*Wal)(unsafe.Pointer(pWal)).FpWalFd, aBuf, int32(uint32(unsafe.Sizeof(U32(0)))*uint32(2)), iCksumOff)
+ *(*U32)(unsafe.Pointer(pWal + 52 + 24)) = Xsqlite3Get4byte(tls, aBuf)
+ *(*U32)(unsafe.Pointer(pWal + 52 + 24 + 1*4)) = Xsqlite3Get4byte(tls, aBuf+4)
iRead = (*Wal)(unsafe.Pointer(pWal)).FiReCksum
(*Wal)(unsafe.Pointer(pWal)).FiReCksum = U32(0)
- for ; (rc == SQLITE_OK) && (iRead <= iLast); iRead++ {
- var iOff I64 = (int64(WAL_HDRSIZE) + ((I64((iRead) - U32(1))) * (I64((szPage) + WAL_FRAME_HDRSIZE))))
- rc = Xsqlite3OsRead(tls, (*Wal)(unsafe.Pointer(pWal)).FpWalFd, aBuf, (szPage + WAL_FRAME_HDRSIZE), iOff)
+ for ; rc == SQLITE_OK && iRead <= iLast; iRead++ {
+ var iOff I64 = int64(WAL_HDRSIZE) + I64(iRead-U32(1))*I64(szPage+WAL_FRAME_HDRSIZE)
+ rc = Xsqlite3OsRead(tls, (*Wal)(unsafe.Pointer(pWal)).FpWalFd, aBuf, szPage+WAL_FRAME_HDRSIZE, iOff)
if rc == SQLITE_OK {
var iPgno U32
var nDbSize U32
iPgno = Xsqlite3Get4byte(tls, aBuf)
- nDbSize = Xsqlite3Get4byte(tls, (aBuf + 4))
+ nDbSize = Xsqlite3Get4byte(tls, aBuf+4)
- walEncodeFrame(tls, pWal, iPgno, nDbSize, (aBuf + 24), bp /* &aFrame[0] */)
+ walEncodeFrame(tls, pWal, iPgno, nDbSize, aBuf+24, bp /* &aFrame[0] */)
rc = Xsqlite3OsWrite(tls, (*Wal)(unsafe.Pointer(pWal)).FpWalFd, bp /* &aFrame[0] */, int32(unsafe.Sizeof([24]U8{})), iOff)
}
}
@@ -41110,7 +41725,7 @@ func walRewriteChecksums(tls *libc.TLS, pWal uintptr, iLast U32) int32 { /* sqli
// Write a set of frames to the log. The caller must hold the write-lock
// on the log file (obtained using sqlite3WalBeginWriteTransaction()).
-func Xsqlite3WalFrames(tls *libc.TLS, pWal uintptr, szPage int32, pList uintptr, nTruncate Pgno, isCommit int32, sync_flags int32) int32 { /* sqlite3.c:63853:20: */
+func Xsqlite3WalFrames(tls *libc.TLS, pWal uintptr, szPage int32, pList uintptr, nTruncate Pgno, isCommit int32, sync_flags int32) int32 { /* sqlite3.c:63974:20: */
bp := tls.Alloc(72)
defer tls.Free(72)
@@ -41130,13 +41745,13 @@ func Xsqlite3WalFrames(tls *libc.TLS, pWal uintptr, szPage int32, pList uintptr,
// nTruncate==0 then this frame set does not complete the transaction.
pLive = walIndexHdr(tls, pWal)
- if (libc.Xmemcmp(tls, (pWal+52 /* &.hdr */), pLive, uint32(unsafe.Sizeof(WalIndexHdr{}))) != 0) {
- iFirst = ((*WalIndexHdr)(unsafe.Pointer(pLive)).FmxFrame + U32(1))
+ if libc.Xmemcmp(tls, pWal+52, pLive, uint32(unsafe.Sizeof(WalIndexHdr{}))) != 0 {
+ iFirst = (*WalIndexHdr)(unsafe.Pointer(pLive)).FmxFrame + U32(1)
}
// See if it is possible to write these frames into the start of the
// log file, instead of appending to it at pWal->hdr.mxFrame.
- if SQLITE_OK != (libc.AssignInt32(&rc, walRestartLog(tls, pWal))) {
+ if SQLITE_OK != libc.AssignInt32(&rc, walRestartLog(tls, pWal)) {
return rc
}
@@ -41150,22 +41765,22 @@ func Xsqlite3WalFrames(tls *libc.TLS, pWal uintptr, szPage int32, pList uintptr,
// var aCksum [2]U32 at bp+32, 8
// Checksum for wal-header
- Xsqlite3Put4byte(tls, (bp /* &aWalHdr */), (uint32(WAL_MAGIC | SQLITE_BIGENDIAN)))
- Xsqlite3Put4byte(tls, (bp /* &aWalHdr */ + 4), uint32(WAL_MAX_VERSION))
- Xsqlite3Put4byte(tls, (bp /* &aWalHdr */ + 8), uint32(szPage))
- Xsqlite3Put4byte(tls, (bp /* &aWalHdr */ + 12), (*Wal)(unsafe.Pointer(pWal)).FnCkpt)
+ Xsqlite3Put4byte(tls, bp, uint32(WAL_MAGIC|SQLITE_BIGENDIAN))
+ Xsqlite3Put4byte(tls, bp+4, uint32(WAL_MAX_VERSION))
+ Xsqlite3Put4byte(tls, bp+8, uint32(szPage))
+ Xsqlite3Put4byte(tls, bp+12, (*Wal)(unsafe.Pointer(pWal)).FnCkpt)
if (*Wal)(unsafe.Pointer(pWal)).FnCkpt == U32(0) {
- Xsqlite3_randomness(tls, 8, pWal+52 /* &.hdr */ +32 /* &.aSalt */)
+ Xsqlite3_randomness(tls, 8, pWal+52+32)
}
- libc.Xmemcpy(tls, (bp /* &aWalHdr */ + 16), pWal+52 /* &.hdr */ +32 /* &.aSalt */, uint32(8))
- walChecksumBytes(tls, 1, bp /* &aWalHdr[0] */, (WAL_HDRSIZE - (2 * 4)), uintptr(0), bp+32 /* &aCksum[0] */)
- Xsqlite3Put4byte(tls, (bp /* &aWalHdr */ + 24), *(*U32)(unsafe.Pointer(bp + 32 /* &aCksum[0] */)))
- Xsqlite3Put4byte(tls, (bp /* &aWalHdr */ + 28), *(*U32)(unsafe.Pointer(bp + 32 /* &aCksum[0] */ + 1*4)))
+ libc.Xmemcpy(tls, bp+16, pWal+52+32, uint32(8))
+ walChecksumBytes(tls, 1, bp /* &aWalHdr[0] */, WAL_HDRSIZE-2*4, uintptr(0), bp+32 /* &aCksum[0] */)
+ Xsqlite3Put4byte(tls, bp+24, *(*U32)(unsafe.Pointer(bp + 32 /* &aCksum[0] */)))
+ Xsqlite3Put4byte(tls, bp+28, *(*U32)(unsafe.Pointer(bp + 32 /* &aCksum[0] */ + 1*4)))
(*Wal)(unsafe.Pointer(pWal)).FszPage = U32(szPage)
(*Wal)(unsafe.Pointer(pWal)).Fhdr.FbigEndCksum = U8(SQLITE_BIGENDIAN)
- *(*U32)(unsafe.Pointer((pWal + 52 /* &.hdr */ + 24 /* &.aFrameCksum */))) = *(*U32)(unsafe.Pointer(bp + 32 /* &aCksum[0] */))
- *(*U32)(unsafe.Pointer((pWal + 52 /* &.hdr */ + 24 /* &.aFrameCksum */) + 1*4)) = *(*U32)(unsafe.Pointer(bp + 32 /* &aCksum[0] */ + 1*4))
+ *(*U32)(unsafe.Pointer(pWal + 52 + 24)) = *(*U32)(unsafe.Pointer(bp + 32 /* &aCksum[0] */))
+ *(*U32)(unsafe.Pointer(pWal + 52 + 24 + 1*4)) = *(*U32)(unsafe.Pointer(bp + 32 /* &aCksum[0] */ + 1*4))
(*Wal)(unsafe.Pointer(pWal)).FtruncateOnCommit = U8(1)
rc = Xsqlite3OsWrite(tls, (*Wal)(unsafe.Pointer(pWal)).FpWalFd, bp /* &aWalHdr[0] */, int32(unsafe.Sizeof([32]U8{})), int64(0))
@@ -41181,7 +41796,7 @@ func Xsqlite3WalFrames(tls *libc.TLS, pWal uintptr, szPage int32, pList uintptr,
//
// https://sqlite.org/src/info/ff5be73dee
if (*Wal)(unsafe.Pointer(pWal)).FsyncHeader != 0 {
- rc = Xsqlite3OsSync(tls, (*Wal)(unsafe.Pointer(pWal)).FpWalFd, (((sync_flags) >> 2) & 0x03))
+ rc = Xsqlite3OsSync(tls, (*Wal)(unsafe.Pointer(pWal)).FpWalFd, sync_flags>>2&0x03)
if rc != 0 {
return rc
}
@@ -41194,8 +41809,8 @@ func Xsqlite3WalFrames(tls *libc.TLS, pWal uintptr, szPage int32, pList uintptr,
(*WalWriter)(unsafe.Pointer(bp + 48 /* &w */)).FiSyncPoint = int64(0)
(*WalWriter)(unsafe.Pointer(bp + 48 /* &w */)).FsyncFlags = sync_flags
(*WalWriter)(unsafe.Pointer(bp + 48 /* &w */)).FszPage = szPage
- iOffset = (int64(WAL_HDRSIZE) + ((I64((iFrame + U32(1)) - U32(1))) * (I64((szPage) + WAL_FRAME_HDRSIZE))))
- szFrame = (szPage + WAL_FRAME_HDRSIZE)
+ iOffset = int64(WAL_HDRSIZE) + I64(iFrame+U32(1)-U32(1))*I64(szPage+WAL_FRAME_HDRSIZE)
+ szFrame = szPage + WAL_FRAME_HDRSIZE
// Write all frames into the log file exactly once
for p = pList; p != 0; p = (*PgHdr)(unsafe.Pointer(p)).FpDirty {
@@ -41205,14 +41820,14 @@ func Xsqlite3WalFrames(tls *libc.TLS, pWal uintptr, szPage int32, pList uintptr,
// the current transaction. If so, overwrite the existing frame and
// set Wal.writeLock to WAL_WRITELOCK_RECKSUM - indicating that
// checksums must be recomputed when the transaction is committed.
- if (iFirst != 0) && (((*PgHdr)(unsafe.Pointer(p)).FpDirty != 0) || (isCommit == 0)) {
+ if iFirst != 0 && ((*PgHdr)(unsafe.Pointer(p)).FpDirty != 0 || isCommit == 0) {
*(*U32)(unsafe.Pointer(bp + 40 /* iWrite */)) = U32(0)
Xsqlite3WalFindFrame(tls, pWal, (*PgHdr)(unsafe.Pointer(p)).Fpgno, bp+40 /* &iWrite */)
- if *(*U32)(unsafe.Pointer(bp + 40 /* iWrite */)) >= iFirst {
- var iOff I64 = ((int64(WAL_HDRSIZE) + ((I64((*(*U32)(unsafe.Pointer(bp + 40 /* iWrite */))) - U32(1))) * (I64((szPage) + WAL_FRAME_HDRSIZE)))) + int64(WAL_FRAME_HDRSIZE))
+ if *(*U32)(unsafe.Pointer(bp + 40)) >= iFirst {
+ var iOff I64 = int64(WAL_HDRSIZE) + I64(*(*U32)(unsafe.Pointer(bp + 40))-U32(1))*I64(szPage+WAL_FRAME_HDRSIZE) + int64(WAL_FRAME_HDRSIZE)
var pData uintptr
- if ((*Wal)(unsafe.Pointer(pWal)).FiReCksum == U32(0)) || (*(*U32)(unsafe.Pointer(bp + 40 /* iWrite */)) < (*Wal)(unsafe.Pointer(pWal)).FiReCksum) {
+ if (*Wal)(unsafe.Pointer(pWal)).FiReCksum == U32(0) || *(*U32)(unsafe.Pointer(bp + 40)) < (*Wal)(unsafe.Pointer(pWal)).FiReCksum {
(*Wal)(unsafe.Pointer(pWal)).FiReCksum = *(*U32)(unsafe.Pointer(bp + 40 /* iWrite */))
}
pData = (*PgHdr)(unsafe.Pointer(p)).FpData
@@ -41220,14 +41835,14 @@ func Xsqlite3WalFrames(tls *libc.TLS, pWal uintptr, szPage int32, pList uintptr,
if rc != 0 {
return rc
}
- *(*U16)(unsafe.Pointer(p + 28 /* &.flags */)) &= libc.Uint16FromInt32((libc.CplInt32(PGHDR_WAL_APPEND)))
+ *(*U16)(unsafe.Pointer(p + 28)) &= libc.Uint16FromInt32(libc.CplInt32(PGHDR_WAL_APPEND))
continue
}
}
iFrame++
- if (isCommit != 0) && ((*PgHdr)(unsafe.Pointer(p)).FpDirty == uintptr(0)) {
+ if isCommit != 0 && (*PgHdr)(unsafe.Pointer(p)).FpDirty == uintptr(0) {
nDbSize = int32(nTruncate)
} else {
nDbSize = 0
@@ -41237,12 +41852,12 @@ func Xsqlite3WalFrames(tls *libc.TLS, pWal uintptr, szPage int32, pList uintptr,
return rc
}
pLast = p
- iOffset = iOffset + (I64(szFrame))
- *(*U16)(unsafe.Pointer(p + 28 /* &.flags */)) |= U16((PGHDR_WAL_APPEND))
+ iOffset = iOffset + I64(szFrame)
+ *(*U16)(unsafe.Pointer(p + 28)) |= U16(PGHDR_WAL_APPEND)
}
// Recalculate checksums within the wal file if required.
- if (isCommit != 0) && ((*Wal)(unsafe.Pointer(pWal)).FiReCksum != 0) {
+ if isCommit != 0 && (*Wal)(unsafe.Pointer(pWal)).FiReCksum != 0 {
rc = walRewriteChecksums(tls, pWal, iFrame)
if rc != 0 {
return rc
@@ -41262,36 +41877,36 @@ func Xsqlite3WalFrames(tls *libc.TLS, pWal uintptr, szPage int32, pList uintptr,
// boundary is crossed. Only the part of the WAL prior to the last
// sector boundary is synced; the part of the last frame that extends
// past the sector boundary is written after the sync.
- if (isCommit != 0) && (((sync_flags) & 0x03) != 0) {
+ if isCommit != 0 && sync_flags&0x03 != 0 {
var bSync int32 = 1
if (*Wal)(unsafe.Pointer(pWal)).FpadToSectorBoundary != 0 {
var sectorSize int32 = Xsqlite3SectorSize(tls, (*Wal)(unsafe.Pointer(pWal)).FpWalFd)
- (*WalWriter)(unsafe.Pointer(bp + 48 /* &w */)).FiSyncPoint = ((((iOffset + I64(sectorSize)) - int64(1)) / I64(sectorSize)) * I64(sectorSize))
- bSync = (libc.Bool32((*WalWriter)(unsafe.Pointer(bp+48 /* &w */)).FiSyncPoint == iOffset))
+ (*WalWriter)(unsafe.Pointer(bp + 48 /* &w */)).FiSyncPoint = (iOffset + I64(sectorSize) - int64(1)) / I64(sectorSize) * I64(sectorSize)
+ bSync = libc.Bool32((*WalWriter)(unsafe.Pointer(bp+48)).FiSyncPoint == iOffset)
- for iOffset < (*WalWriter)(unsafe.Pointer(bp+48 /* &w */)).FiSyncPoint {
+ for iOffset < (*WalWriter)(unsafe.Pointer(bp+48)).FiSyncPoint {
rc = walWriteOneFrame(tls, bp+48 /* &w */, pLast, int32(nTruncate), iOffset)
if rc != 0 {
return rc
}
- iOffset = iOffset + (I64(szFrame))
+ iOffset = iOffset + I64(szFrame)
nExtra++
}
}
if bSync != 0 {
- rc = Xsqlite3OsSync(tls, (*WalWriter)(unsafe.Pointer(bp+48 /* &w */)).FpFd, ((sync_flags) & 0x03))
+ rc = Xsqlite3OsSync(tls, (*WalWriter)(unsafe.Pointer(bp+48 /* &w */)).FpFd, sync_flags&0x03)
}
}
// If this frame set completes the first transaction in the WAL and
// if PRAGMA journal_size_limit is set, then truncate the WAL to the
// journal size limit, if possible.
- if ((isCommit != 0) && ((*Wal)(unsafe.Pointer(pWal)).FtruncateOnCommit != 0)) && ((*Wal)(unsafe.Pointer(pWal)).FmxWalSize >= int64(0)) {
+ if isCommit != 0 && (*Wal)(unsafe.Pointer(pWal)).FtruncateOnCommit != 0 && (*Wal)(unsafe.Pointer(pWal)).FmxWalSize >= int64(0) {
var sz I64 = (*Wal)(unsafe.Pointer(pWal)).FmxWalSize
- if (int64(WAL_HDRSIZE) + ((I64(((iFrame + U32(nExtra)) + U32(1)) - U32(1))) * (I64((szPage) + WAL_FRAME_HDRSIZE)))) > (*Wal)(unsafe.Pointer(pWal)).FmxWalSize {
- sz = (int64(WAL_HDRSIZE) + ((I64(((iFrame + U32(nExtra)) + U32(1)) - U32(1))) * (I64((szPage) + WAL_FRAME_HDRSIZE))))
+ if int64(WAL_HDRSIZE)+I64(iFrame+U32(nExtra)+U32(1)-U32(1))*I64(szPage+WAL_FRAME_HDRSIZE) > (*Wal)(unsafe.Pointer(pWal)).FmxWalSize {
+ sz = int64(WAL_HDRSIZE) + I64(iFrame+U32(nExtra)+U32(1)-U32(1))*I64(szPage+WAL_FRAME_HDRSIZE)
}
walLimitSize(tls, pWal, sz)
(*Wal)(unsafe.Pointer(pWal)).FtruncateOnCommit = U8(0)
@@ -41302,15 +41917,15 @@ func Xsqlite3WalFrames(tls *libc.TLS, pWal uintptr, szPage int32, pList uintptr,
// guarantees that there are no other writers, and no data that may
// be in use by existing readers is being overwritten.
iFrame = (*Wal)(unsafe.Pointer(pWal)).Fhdr.FmxFrame
- for p = pList; (p != 0) && (rc == SQLITE_OK); p = (*PgHdr)(unsafe.Pointer(p)).FpDirty {
- if (int32((*PgHdr)(unsafe.Pointer(p)).Fflags) & PGHDR_WAL_APPEND) == 0 {
+ for p = pList; p != 0 && rc == SQLITE_OK; p = (*PgHdr)(unsafe.Pointer(p)).FpDirty {
+ if int32((*PgHdr)(unsafe.Pointer(p)).Fflags)&PGHDR_WAL_APPEND == 0 {
continue
}
iFrame++
rc = walIndexAppend(tls, pWal, iFrame, (*PgHdr)(unsafe.Pointer(p)).Fpgno)
}
- for (rc == SQLITE_OK) && (nExtra > 0) {
+ for rc == SQLITE_OK && nExtra > 0 {
iFrame++
nExtra--
rc = walIndexAppend(tls, pWal, iFrame, (*PgHdr)(unsafe.Pointer(pLast)).Fpgno)
@@ -41318,7 +41933,7 @@ func Xsqlite3WalFrames(tls *libc.TLS, pWal uintptr, szPage int32, pList uintptr,
if rc == SQLITE_OK {
// Update the private copy of the header.
- (*Wal)(unsafe.Pointer(pWal)).Fhdr.FszPage = (U16((szPage & 0xff00) | (szPage >> 16)))
+ (*Wal)(unsafe.Pointer(pWal)).Fhdr.FszPage = U16(szPage&0xff00 | szPage>>16)
(*Wal)(unsafe.Pointer(pWal)).Fhdr.FmxFrame = iFrame
if isCommit != 0 {
@@ -41343,7 +41958,7 @@ func Xsqlite3WalFrames(tls *libc.TLS, pWal uintptr, szPage int32, pList uintptr,
//
// If parameter xBusy is not NULL, it is a pointer to a busy-handler
// callback. In this case this function runs a blocking checkpoint.
-func Xsqlite3WalCheckpoint(tls *libc.TLS, pWal uintptr, db uintptr, eMode int32, xBusy uintptr, pBusyArg uintptr, sync_flags int32, nBuf int32, zBuf uintptr, pnLog uintptr, pnCkpt uintptr) int32 { /* sqlite3.c:64091:20: */
+func Xsqlite3WalCheckpoint(tls *libc.TLS, pWal uintptr, db uintptr, eMode int32, xBusy uintptr, pBusyArg uintptr, sync_flags int32, nBuf int32, zBuf uintptr, pnLog uintptr, pnCkpt uintptr) int32 { /* sqlite3.c:64212:20: */
bp := tls.Alloc(4)
defer tls.Free(4)
@@ -41399,7 +42014,7 @@ func Xsqlite3WalCheckpoint(tls *libc.TLS, pWal uintptr, db uintptr, eMode int32,
rc = walIndexReadHdr(tls, pWal, bp /* &isChanged */)
- if (*(*int32)(unsafe.Pointer(bp /* isChanged */)) != 0) && ((*sqlite3_io_methods)(unsafe.Pointer((*Sqlite3_file)(unsafe.Pointer((*Wal)(unsafe.Pointer(pWal)).FpDbFd)).FpMethods)).FiVersion >= 3) {
+ if *(*int32)(unsafe.Pointer(bp)) != 0 && (*sqlite3_io_methods)(unsafe.Pointer((*Sqlite3_file)(unsafe.Pointer((*Wal)(unsafe.Pointer(pWal)).FpDbFd)).FpMethods)).FiVersion >= 3 {
Xsqlite3OsUnfetch(tls, (*Wal)(unsafe.Pointer(pWal)).FpDbFd, int64(0), uintptr(0))
}
}
@@ -41407,14 +42022,14 @@ func Xsqlite3WalCheckpoint(tls *libc.TLS, pWal uintptr, db uintptr, eMode int32,
// Copy data from the log to the database file.
if rc == SQLITE_OK {
- if ((*Wal)(unsafe.Pointer(pWal)).Fhdr.FmxFrame != 0) && (walPagesize(tls, pWal) != nBuf) {
- rc = Xsqlite3CorruptError(tls, 64173)
+ if (*Wal)(unsafe.Pointer(pWal)).Fhdr.FmxFrame != 0 && walPagesize(tls, pWal) != nBuf {
+ rc = Xsqlite3CorruptError(tls, 64294)
} else {
rc = walCheckpoint(tls, pWal, db, eMode2, xBusy2, pBusyArg, sync_flags, zBuf)
}
// If no error occurred, set the output variables.
- if (rc == SQLITE_OK) || (rc == SQLITE_BUSY) {
+ if rc == SQLITE_OK || rc == SQLITE_BUSY {
if pnLog != 0 {
*(*int32)(unsafe.Pointer(pnLog)) = int32((*Wal)(unsafe.Pointer(pWal)).Fhdr.FmxFrame)
}
@@ -41424,13 +42039,13 @@ func Xsqlite3WalCheckpoint(tls *libc.TLS, pWal uintptr, db uintptr, eMode int32,
}
}
- if *(*int32)(unsafe.Pointer(bp /* isChanged */)) != 0 {
+ if *(*int32)(unsafe.Pointer(bp)) != 0 {
// If a new wal-index header was loaded before the checkpoint was
// performed, then the pager-cache associated with pWal is now
// out of date. So zero the cached wal-index header to ensure that
// next time the pager opens a snapshot on this database it knows that
// the cache needs to be reset.
- libc.Xmemset(tls, (pWal + 52 /* &.hdr */), 0, uint32(unsafe.Sizeof(WalIndexHdr{})))
+ libc.Xmemset(tls, pWal+52, 0, uint32(unsafe.Sizeof(WalIndexHdr{})))
}
// Release the locks.
@@ -41441,7 +42056,7 @@ func Xsqlite3WalCheckpoint(tls *libc.TLS, pWal uintptr, db uintptr, eMode int32,
}
return func() int32 {
- if (rc == SQLITE_OK) && (eMode != eMode2) {
+ if rc == SQLITE_OK && eMode != eMode2 {
return SQLITE_BUSY
}
return rc
@@ -41452,7 +42067,7 @@ func Xsqlite3WalCheckpoint(tls *libc.TLS, pWal uintptr, db uintptr, eMode int32,
// number of frames in the WAL at the point of the last commit since
// sqlite3WalCallback() was called. If no commits have occurred since
// the last call, then return 0.
-func Xsqlite3WalCallback(tls *libc.TLS, pWal uintptr) int32 { /* sqlite3.c:64216:20: */
+func Xsqlite3WalCallback(tls *libc.TLS, pWal uintptr) int32 { /* sqlite3.c:64337:20: */
var ret U32 = U32(0)
if pWal != 0 {
ret = (*Wal)(unsafe.Pointer(pWal)).FiCallback
@@ -41483,7 +42098,7 @@ func Xsqlite3WalCallback(tls *libc.TLS, pWal uintptr) int32 { /* sqlite3.c:64216
// not actually change anything. The pager uses this to see if it
// should acquire the database exclusive lock prior to invoking
// the op==1 case.
-func Xsqlite3WalExclusiveMode(tls *libc.TLS, pWal uintptr, op int32) int32 { /* sqlite3.c:64249:20: */
+func Xsqlite3WalExclusiveMode(tls *libc.TLS, pWal uintptr, op int32) int32 { /* sqlite3.c:64370:20: */
var rc int32
// pWal->readLock is usually set, but might be -1 if there was a
@@ -41495,21 +42110,21 @@ func Xsqlite3WalExclusiveMode(tls *libc.TLS, pWal uintptr, op int32) int32 { /*
if op == 0 {
if int32((*Wal)(unsafe.Pointer(pWal)).FexclusiveMode) != WAL_NORMAL_MODE {
(*Wal)(unsafe.Pointer(pWal)).FexclusiveMode = U8(WAL_NORMAL_MODE)
- if walLockShared(tls, pWal, (3+(int32((*Wal)(unsafe.Pointer(pWal)).FreadLock)))) != SQLITE_OK {
+ if walLockShared(tls, pWal, 3+int32((*Wal)(unsafe.Pointer(pWal)).FreadLock)) != SQLITE_OK {
(*Wal)(unsafe.Pointer(pWal)).FexclusiveMode = U8(WAL_EXCLUSIVE_MODE)
}
- rc = (libc.Bool32(int32((*Wal)(unsafe.Pointer(pWal)).FexclusiveMode) == WAL_NORMAL_MODE))
+ rc = libc.Bool32(int32((*Wal)(unsafe.Pointer(pWal)).FexclusiveMode) == WAL_NORMAL_MODE)
} else {
// Already in locking_mode=NORMAL
rc = 0
}
} else if op > 0 {
- walUnlockShared(tls, pWal, (3 + (int32((*Wal)(unsafe.Pointer(pWal)).FreadLock))))
+ walUnlockShared(tls, pWal, 3+int32((*Wal)(unsafe.Pointer(pWal)).FreadLock))
(*Wal)(unsafe.Pointer(pWal)).FexclusiveMode = U8(WAL_EXCLUSIVE_MODE)
rc = 1
} else {
- rc = (libc.Bool32(int32((*Wal)(unsafe.Pointer(pWal)).FexclusiveMode) == WAL_NORMAL_MODE))
+ rc = libc.Bool32(int32((*Wal)(unsafe.Pointer(pWal)).FexclusiveMode) == WAL_NORMAL_MODE)
}
return rc
}
@@ -41517,18 +42132,18 @@ func Xsqlite3WalExclusiveMode(tls *libc.TLS, pWal uintptr, op int32) int32 { /*
// Return true if the argument is non-NULL and the WAL module is using
// heap-memory for the wal-index. Otherwise, if the argument is NULL or the
// WAL module is using shared-memory, return false.
-func Xsqlite3WalHeapMemory(tls *libc.TLS, pWal uintptr) int32 { /* sqlite3.c:64291:20: */
- return (libc.Bool32((pWal != 0) && (int32((*Wal)(unsafe.Pointer(pWal)).FexclusiveMode) == WAL_HEAPMEMORY_MODE)))
+func Xsqlite3WalHeapMemory(tls *libc.TLS, pWal uintptr) int32 { /* sqlite3.c:64412:20: */
+ return libc.Bool32(pWal != 0 && int32((*Wal)(unsafe.Pointer(pWal)).FexclusiveMode) == WAL_HEAPMEMORY_MODE)
}
// Create a snapshot object. The content of a snapshot is opaque to
// every other subsystem, so the WAL module can put whatever it needs
// in the object.
-func Xsqlite3WalSnapshotGet(tls *libc.TLS, pWal uintptr, ppSnapshot uintptr) int32 { /* sqlite3.c:64300:20: */
+func Xsqlite3WalSnapshotGet(tls *libc.TLS, pWal uintptr, ppSnapshot uintptr) int32 { /* sqlite3.c:64421:20: */
var rc int32 = SQLITE_OK
var pRet uintptr
- if libc.Xmemcmp(tls, (pWal+52 /* &.hdr */ +24 /* &.aFrameCksum */), uintptr(unsafe.Pointer(&aZero)), uint32(16)) == 0 {
+ if libc.Xmemcmp(tls, pWal+52+24, uintptr(unsafe.Pointer(&aZero)), uint32(16)) == 0 {
*(*uintptr)(unsafe.Pointer(ppSnapshot)) = uintptr(0)
return SQLITE_ERROR
}
@@ -41536,32 +42151,32 @@ func Xsqlite3WalSnapshotGet(tls *libc.TLS, pWal uintptr, ppSnapshot uintptr) int
if pRet == uintptr(0) {
rc = SQLITE_NOMEM
} else {
- libc.Xmemcpy(tls, pRet, (pWal + 52 /* &.hdr */), uint32(unsafe.Sizeof(WalIndexHdr{})))
+ libc.Xmemcpy(tls, pRet, pWal+52, uint32(unsafe.Sizeof(WalIndexHdr{})))
*(*uintptr)(unsafe.Pointer(ppSnapshot)) = pRet
}
return rc
}
-var aZero = [4]U32{U32(0), U32(0), U32(0), U32(0)} /* sqlite3.c:64303:20 */
+var aZero = [4]U32{U32(0), U32(0), U32(0), U32(0)} /* sqlite3.c:64424:20 */
// Try to open on pSnapshot when the next read-transaction starts
-func Xsqlite3WalSnapshotOpen(tls *libc.TLS, pWal uintptr, pSnapshot uintptr) { /* sqlite3.c:64324:21: */
+func Xsqlite3WalSnapshotOpen(tls *libc.TLS, pWal uintptr, pSnapshot uintptr) { /* sqlite3.c:64445:21: */
(*Wal)(unsafe.Pointer(pWal)).FpSnapshot = pSnapshot
}
// Return a +ve value if snapshot p1 is newer than p2. A -ve value if
// p1 is older than p2 and zero if p1 and p2 are the same snapshot.
-func Xsqlite3_snapshot_cmp(tls *libc.TLS, p1 uintptr, p2 uintptr) int32 { /* sqlite3.c:64335:16: */
+func Xsqlite3_snapshot_cmp(tls *libc.TLS, p1 uintptr, p2 uintptr) int32 { /* sqlite3.c:64456:16: */
var pHdr1 uintptr = p1
var pHdr2 uintptr = p2
// aSalt[0] is a copy of the value stored in the wal file header. It
// is incremented each time the wal file is restarted.
- if *(*U32)(unsafe.Pointer((pHdr1 + 32 /* &.aSalt */))) < *(*U32)(unsafe.Pointer((pHdr2 + 32 /* &.aSalt */))) {
+ if *(*U32)(unsafe.Pointer(pHdr1 + 32)) < *(*U32)(unsafe.Pointer(pHdr2 + 32)) {
return -1
}
- if *(*U32)(unsafe.Pointer((pHdr1 + 32 /* &.aSalt */))) > *(*U32)(unsafe.Pointer((pHdr2 + 32 /* &.aSalt */))) {
+ if *(*U32)(unsafe.Pointer(pHdr1 + 32)) > *(*U32)(unsafe.Pointer(pHdr2 + 32)) {
return +1
}
if (*WalIndexHdr)(unsafe.Pointer(pHdr1)).FmxFrame < (*WalIndexHdr)(unsafe.Pointer(pHdr2)).FmxFrame {
@@ -41582,14 +42197,14 @@ func Xsqlite3_snapshot_cmp(tls *libc.TLS, p1 uintptr, p2 uintptr) int32 { /* sql
// the CHECKPOINTER lock cannot be obtained, SQLITE_BUSY. If any error
// occurs (any value other than SQLITE_OK is returned), the CHECKPOINTER
// lock is released before returning.
-func Xsqlite3WalSnapshotCheck(tls *libc.TLS, pWal uintptr, pSnapshot uintptr) int32 { /* sqlite3.c:64359:20: */
+func Xsqlite3WalSnapshotCheck(tls *libc.TLS, pWal uintptr, pSnapshot uintptr) int32 { /* sqlite3.c:64480:20: */
var rc int32
rc = walLockShared(tls, pWal, WAL_CKPT_LOCK)
if rc == SQLITE_OK {
var pNew uintptr = pSnapshot
- if (libc.Xmemcmp(tls, pNew+32 /* &.aSalt */, pWal+52 /* &.hdr */ +32 /* &.aSalt */, uint32(unsafe.Sizeof([2]U32{}))) != 0) ||
- ((*WalIndexHdr)(unsafe.Pointer(pNew)).FmxFrame < (*WalCkptInfo)(unsafe.Pointer(walCkptInfo(tls, pWal))).FnBackfillAttempted) {
- rc = (SQLITE_ERROR | (int32(3) << 8))
+ if libc.Xmemcmp(tls, pNew+32, pWal+52+32, uint32(unsafe.Sizeof([2]U32{}))) != 0 ||
+ (*WalIndexHdr)(unsafe.Pointer(pNew)).FmxFrame < (*WalCkptInfo)(unsafe.Pointer(walCkptInfo(tls, pWal))).FnBackfillAttempted {
+ rc = SQLITE_ERROR | int32(3)<<8
walUnlockShared(tls, pWal, WAL_CKPT_LOCK)
}
}
@@ -41598,13 +42213,13 @@ func Xsqlite3WalSnapshotCheck(tls *libc.TLS, pWal uintptr, pSnapshot uintptr) in
// Release a lock obtained by an earlier successful call to
// sqlite3WalSnapshotCheck().
-func Xsqlite3WalSnapshotUnlock(tls *libc.TLS, pWal uintptr) { /* sqlite3.c:64378:21: */
+func Xsqlite3WalSnapshotUnlock(tls *libc.TLS, pWal uintptr) { /* sqlite3.c:64499:21: */
walUnlockShared(tls, pWal, WAL_CKPT_LOCK)
}
// Return the sqlite3_file object for the WAL file
-func Xsqlite3WalFile(tls *libc.TLS, pWal uintptr) uintptr { /* sqlite3.c:64400:29: */
+func Xsqlite3WalFile(tls *libc.TLS, pWal uintptr) uintptr { /* sqlite3.c:64521:29: */
return (*Wal)(unsafe.Pointer(pWal)).FpWalFd
}
@@ -41853,16 +42468,16 @@ func Xsqlite3WalFile(tls *libc.TLS, pWal uintptr) uintptr { /* sqlite3.c:64400:2
// Forward declarations
type MemPage1 = struct {
FisInit U8
- FbBusy U8
FintKey U8
FintKeyLeaf U8
+ F__ccgo_pad1 [1]byte
Fpgno Pgno
Fleaf U8
FhdrOffset U8
FchildPtrSize U8
Fmax1bytePayload U8
FnOverflow U8
- F__ccgo_pad1 [1]byte
+ F__ccgo_pad2 [1]byte
FmaxLocal U16
FminLocal U16
FcellOffset U16
@@ -41879,7 +42494,7 @@ type MemPage1 = struct {
FpDbPage uintptr
FxCellSize uintptr
FxParseCell uintptr
-} /* sqlite3.c:1331:9 */
+} /* sqlite3.c:578:9 */
//************* End of wal.c ************************************************
//************* Begin file btmutex.c ****************************************
@@ -42124,16 +42739,16 @@ type MemPage1 = struct {
// small cells will be rare, but they are possible.
// Forward declarations
-type MemPage = MemPage1 /* sqlite3.c:64658:24 */
+type MemPage = MemPage1 /* sqlite3.c:64779:24 */
type BtLock1 = struct {
FpBtree uintptr
FiTable Pgno
FeLock U8
F__ccgo_pad1 [3]byte
FpNext uintptr
-} /* sqlite3.c:1331:9 */
+} /* sqlite3.c:578:9 */
-type BtLock = BtLock1 /* sqlite3.c:64659:23 */
+type BtLock = BtLock1 /* sqlite3.c:64780:23 */
type CellInfo1 = struct {
FnKey I64
FpPayload uintptr
@@ -42141,9 +42756,9 @@ type CellInfo1 = struct {
FnLocal U16
FnSize U16
F__ccgo_pad1 [4]byte
-} /* sqlite3.c:1331:9 */
+} /* sqlite3.c:578:9 */
-type CellInfo = CellInfo1 /* sqlite3.c:64660:25 */
+type CellInfo = CellInfo1 /* sqlite3.c:64781:25 */
// Legal values for BtCursor.curFlags
@@ -42253,7 +42868,7 @@ type IntegrityCk1 = struct {
FerrMsg StrAccum
Fheap uintptr
Fdb uintptr
-} /* sqlite3.c:65118:9 */
+} /* sqlite3.c:65238:9 */
// Legal values for BtCursor.curFlags
@@ -42349,7 +42964,7 @@ type IntegrityCk1 = struct {
// the database the corresponding bit is set. This allows integrity-check to
// detect pages that are used twice and orphaned pages (both of which
// indicate corruption).
-type IntegrityCk = IntegrityCk1 /* sqlite3.c:65118:28 */
+type IntegrityCk = IntegrityCk1 /* sqlite3.c:65238:28 */
// Routines to read or write a two- and four-byte big-endian integer values.
@@ -42363,7 +42978,7 @@ type IntegrityCk = IntegrityCk1 /* sqlite3.c:65118:28 */
// Obtain the BtShared mutex associated with B-Tree handle p. Also,
// set BtShared.db to the database handle associated with p and the
// p->locked boolean to true.
-func lockBtreeMutex(tls *libc.TLS, p uintptr) { /* sqlite3.c:65168:13: */
+func lockBtreeMutex(tls *libc.TLS, p uintptr) { /* sqlite3.c:65288:13: */
Xsqlite3_mutex_enter(tls, (*BtShared)(unsafe.Pointer((*Btree)(unsafe.Pointer(p)).FpBt)).Fmutex)
(*BtShared)(unsafe.Pointer((*Btree)(unsafe.Pointer(p)).FpBt)).Fdb = (*Btree)(unsafe.Pointer(p)).Fdb
@@ -42372,7 +42987,7 @@ func lockBtreeMutex(tls *libc.TLS, p uintptr) { /* sqlite3.c:65168:13: */
// Release the BtShared mutex associated with B-Tree handle p and
// clear the p->locked boolean.
-func unlockBtreeMutex(tls *libc.TLS, p uintptr) { /* sqlite3.c:65182:29: */
+func unlockBtreeMutex(tls *libc.TLS, p uintptr) { /* sqlite3.c:65302:29: */
var pBt uintptr = (*Btree)(unsafe.Pointer(p)).FpBt
Xsqlite3_mutex_leave(tls, (*BtShared)(unsafe.Pointer(pBt)).Fmutex)
@@ -42393,7 +43008,7 @@ func unlockBtreeMutex(tls *libc.TLS, p uintptr) { /* sqlite3.c:65182:29: */
// p, then first unlock all of the others on p->pNext, then wait
// for the lock to become available on p, then relock all of the
// subsequent Btrees that desire a lock.
-func Xsqlite3BtreeEnter(tls *libc.TLS, p uintptr) { /* sqlite3.c:65212:21: */
+func Xsqlite3BtreeEnter(tls *libc.TLS, p uintptr) { /* sqlite3.c:65332:21: */
// Some basic sanity checking on the Btree. The list of Btrees
// connected by pNext and pPrev should be in sorted order by
// Btree.pBt value. All elements of the list should belong to
@@ -42421,7 +43036,7 @@ func Xsqlite3BtreeEnter(tls *libc.TLS, p uintptr) { /* sqlite3.c:65212:21: */
// into this routine, we avoid unnecessary stack pointer changes
// and thus help the sqlite3BtreeLock() routine to run much faster
// in the common case.
-func btreeLockCarefully(tls *libc.TLS, p uintptr) { /* sqlite3.c:65246:29: */
+func btreeLockCarefully(tls *libc.TLS, p uintptr) { /* sqlite3.c:65366:29: */
var pLater uintptr
// In most cases, we should be able to acquire the lock we
@@ -42452,7 +43067,7 @@ func btreeLockCarefully(tls *libc.TLS, p uintptr) { /* sqlite3.c:65246:29: */
}
// Exit the recursive mutex on a Btree.
-func Xsqlite3BtreeLeave(tls *libc.TLS, p uintptr) { /* sqlite3.c:65284:21: */
+func Xsqlite3BtreeLeave(tls *libc.TLS, p uintptr) { /* sqlite3.c:65404:21: */
if (*Btree)(unsafe.Pointer(p)).Fsharable != 0 {
@@ -42475,14 +43090,14 @@ func Xsqlite3BtreeLeave(tls *libc.TLS, p uintptr) { /* sqlite3.c:65284:21: */
// to avoid the possibility of deadlock when two threads with
// two or more btrees in common both try to lock all their btrees
// at the same instant.
-func btreeEnterAll(tls *libc.TLS, db uintptr) { /* sqlite3.c:65327:29: */
+func btreeEnterAll(tls *libc.TLS, db uintptr) { /* sqlite3.c:65447:29: */
var i int32
var skipOk int32 = 1
var p uintptr
for i = 0; i < (*Sqlite3)(unsafe.Pointer(db)).FnDb; i++ {
p = (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb + uintptr(i)*16)).FpBt
- if (p != 0) && ((*Btree)(unsafe.Pointer(p)).Fsharable != 0) {
+ if p != 0 && (*Btree)(unsafe.Pointer(p)).Fsharable != 0 {
Xsqlite3BtreeEnter(tls, p)
skipOk = 0
}
@@ -42490,13 +43105,13 @@ func btreeEnterAll(tls *libc.TLS, db uintptr) { /* sqlite3.c:65327:29: */
(*Sqlite3)(unsafe.Pointer(db)).FnoSharedCache = U8(skipOk)
}
-func Xsqlite3BtreeEnterAll(tls *libc.TLS, db uintptr) { /* sqlite3.c:65341:21: */
+func Xsqlite3BtreeEnterAll(tls *libc.TLS, db uintptr) { /* sqlite3.c:65461:21: */
if int32((*Sqlite3)(unsafe.Pointer(db)).FnoSharedCache) == 0 {
btreeEnterAll(tls, db)
}
}
-func btreeLeaveAll(tls *libc.TLS, db uintptr) { /* sqlite3.c:65344:29: */
+func btreeLeaveAll(tls *libc.TLS, db uintptr) { /* sqlite3.c:65464:29: */
var i int32
var p uintptr
@@ -42508,7 +43123,7 @@ func btreeLeaveAll(tls *libc.TLS, db uintptr) { /* sqlite3.c:65344:29: */
}
}
-func Xsqlite3BtreeLeaveAll(tls *libc.TLS, db uintptr) { /* sqlite3.c:65353:21: */
+func Xsqlite3BtreeLeaveAll(tls *libc.TLS, db uintptr) { /* sqlite3.c:65473:21: */
if int32((*Sqlite3)(unsafe.Pointer(db)).FnoSharedCache) == 0 {
btreeLeaveAll(tls, db)
}
@@ -42519,11 +43134,11 @@ func Xsqlite3BtreeLeaveAll(tls *libc.TLS, db uintptr) { /* sqlite3.c:65353:21: *
// These entry points are used by incremental I/O only. Enter() is required
// any time OMIT_SHARED_CACHE is not defined, regardless of whether or not
// the build is threadsafe. Leave() is only required by threadsafe builds.
-func Xsqlite3BtreeEnterCursor(tls *libc.TLS, pCur uintptr) { /* sqlite3.c:65439:21: */
+func Xsqlite3BtreeEnterCursor(tls *libc.TLS, pCur uintptr) { /* sqlite3.c:65559:21: */
Xsqlite3BtreeEnter(tls, (*BtCursor)(unsafe.Pointer(pCur)).FpBtree)
}
-func Xsqlite3BtreeLeaveCursor(tls *libc.TLS, pCur uintptr) { /* sqlite3.c:65443:21: */
+func Xsqlite3BtreeLeaveCursor(tls *libc.TLS, pCur uintptr) { /* sqlite3.c:65563:21: */
Xsqlite3BtreeLeave(tls, (*BtCursor)(unsafe.Pointer(pCur)).FpBtree)
}
@@ -42546,7 +43161,7 @@ func Xsqlite3BtreeLeaveCursor(tls *libc.TLS, pCur uintptr) { /* sqlite3.c:65443:
// The header string that appears at the beginning of every
// SQLite database.
-var zMagicHeader = *(*[16]uint8)(unsafe.Pointer(ts + 3142 /* "SQLite format 3" */)) /* sqlite3.c:65474:19 */
+var zMagicHeader = *(*[16]uint8)(unsafe.Pointer(ts + 3953 /* "SQLite format 3" */)) /* sqlite3.c:65594:19 */
// Set this global variable to 1 to enable tracing using the TRACE
// macro.
@@ -42572,14 +43187,14 @@ var zMagicHeader = *(*[16]uint8)(unsafe.Pointer(ts + 3142 /* "SQLite format 3" *
// test builds.
//
// Access to this variable is protected by SQLITE_MUTEX_STATIC_MAIN.
-var sqlite3SharedCacheList uintptr = uintptr(0) /* sqlite3.c:65529:17 */
+var sqlite3SharedCacheList uintptr = uintptr(0) /* sqlite3.c:65649:17 */
// Enable or disable the shared pager and schema features.
//
// This routine has no effect on existing database connections.
// The shared cache setting effects only future calls to
// sqlite3_open(), sqlite3_open16(), or sqlite3_open_v2().
-func Xsqlite3_enable_shared_cache(tls *libc.TLS, enable int32) int32 { /* sqlite3.c:65541:16: */
+func Xsqlite3_enable_shared_cache(tls *libc.TLS, enable int32) int32 { /* sqlite3.c:65661:16: */
Xsqlite3Config.FsharedCacheEnabled = enable
return SQLITE_OK
}
@@ -42596,7 +43211,7 @@ func Xsqlite3_enable_shared_cache(tls *libc.TLS, enable int32) int32 { /* sqlite
// (READ_LOCK or WRITE_LOCK) on the table with root-page iTab. Return
// SQLITE_OK if the lock may be obtained (by calling
// setSharedCacheTableLock()), or SQLITE_LOCKED if not.
-func querySharedCacheTableLock(tls *libc.TLS, p uintptr, iTab Pgno, eLock U8) int32 { /* sqlite3.c:65740:12: */
+func querySharedCacheTableLock(tls *libc.TLS, p uintptr, iTab Pgno, eLock U8) int32 { /* sqlite3.c:65860:12: */
var pBt uintptr = (*Btree)(unsafe.Pointer(p)).FpBt
var pIter uintptr
@@ -42611,9 +43226,9 @@ func querySharedCacheTableLock(tls *libc.TLS, p uintptr, iTab Pgno, eLock U8) in
// If some other connection is holding an exclusive lock, the
// requested lock may not be obtained.
- if ((*BtShared)(unsafe.Pointer(pBt)).FpWriter != p) && ((int32((*BtShared)(unsafe.Pointer(pBt)).FbtsFlags) & BTS_EXCLUSIVE) != 0) {
+ if (*BtShared)(unsafe.Pointer(pBt)).FpWriter != p && int32((*BtShared)(unsafe.Pointer(pBt)).FbtsFlags)&BTS_EXCLUSIVE != 0 {
Xsqlite3ConnectionBlocked(tls, (*Btree)(unsafe.Pointer(p)).Fdb, (*Btree)(unsafe.Pointer((*BtShared)(unsafe.Pointer(pBt)).FpWriter)).Fdb)
- return (SQLITE_LOCKED | (int32(1) << 8))
+ return SQLITE_LOCKED | int32(1)<<8
}
for pIter = (*BtShared)(unsafe.Pointer(pBt)).FpLock; pIter != 0; pIter = (*BtLock)(unsafe.Pointer(pIter)).FpNext {
@@ -42626,13 +43241,13 @@ func querySharedCacheTableLock(tls *libc.TLS, p uintptr, iTab Pgno, eLock U8) in
// may hold a WRITE_LOCK on any table in this file (since there can
// only be a single writer).
- if (((*BtLock)(unsafe.Pointer(pIter)).FpBtree != p) && ((*BtLock)(unsafe.Pointer(pIter)).FiTable == iTab)) && (int32((*BtLock)(unsafe.Pointer(pIter)).FeLock) != int32(eLock)) {
+ if (*BtLock)(unsafe.Pointer(pIter)).FpBtree != p && (*BtLock)(unsafe.Pointer(pIter)).FiTable == iTab && int32((*BtLock)(unsafe.Pointer(pIter)).FeLock) != int32(eLock) {
Xsqlite3ConnectionBlocked(tls, (*Btree)(unsafe.Pointer(p)).Fdb, (*Btree)(unsafe.Pointer((*BtLock)(unsafe.Pointer(pIter)).FpBtree)).Fdb)
if int32(eLock) == WRITE_LOCK {
- *(*U16)(unsafe.Pointer(pBt + 24 /* &.btsFlags */)) |= U16((BTS_PENDING))
+ *(*U16)(unsafe.Pointer(pBt + 24)) |= U16(BTS_PENDING)
}
- return (SQLITE_LOCKED | (int32(1) << 8))
+ return SQLITE_LOCKED | int32(1)<<8
}
}
return SQLITE_OK
@@ -42653,7 +43268,7 @@ func querySharedCacheTableLock(tls *libc.TLS, p uintptr, iTab Pgno, eLock U8) in
//
// SQLITE_OK is returned if the lock is added successfully. SQLITE_NOMEM
// is returned if a malloc attempt fails.
-func setSharedCacheTableLock(tls *libc.TLS, p uintptr, iTable Pgno, eLock U8) int32 { /* sqlite3.c:65812:12: */
+func setSharedCacheTableLock(tls *libc.TLS, p uintptr, iTable Pgno, eLock U8) int32 { /* sqlite3.c:65932:12: */
var pBt uintptr = (*Btree)(unsafe.Pointer(p)).FpBt
var pLock uintptr = uintptr(0)
var pIter uintptr
@@ -42668,7 +43283,7 @@ func setSharedCacheTableLock(tls *libc.TLS, p uintptr, iTable Pgno, eLock U8) in
// First search the list for an existing lock on this table.
for pIter = (*BtShared)(unsafe.Pointer(pBt)).FpLock; pIter != 0; pIter = (*BtLock)(unsafe.Pointer(pIter)).FpNext {
- if ((*BtLock)(unsafe.Pointer(pIter)).FiTable == iTable) && ((*BtLock)(unsafe.Pointer(pIter)).FpBtree == p) {
+ if (*BtLock)(unsafe.Pointer(pIter)).FiTable == iTable && (*BtLock)(unsafe.Pointer(pIter)).FpBtree == p {
pLock = pIter
break
}
@@ -42704,9 +43319,9 @@ func setSharedCacheTableLock(tls *libc.TLS, p uintptr, iTable Pgno, eLock U8) in
// This function assumes that Btree p has an open read or write
// transaction. If it does not, then the BTS_PENDING flag
// may be incorrectly cleared.
-func clearAllSharedCacheTableLocks(tls *libc.TLS, p uintptr) { /* sqlite3.c:65876:13: */
+func clearAllSharedCacheTableLocks(tls *libc.TLS, p uintptr) { /* sqlite3.c:65996:13: */
var pBt uintptr = (*Btree)(unsafe.Pointer(p)).FpBt
- var ppIter uintptr = (pBt + 76 /* &.pLock */)
+ var ppIter uintptr = pBt + 76
for *(*uintptr)(unsafe.Pointer(ppIter)) != 0 {
var pLock uintptr = *(*uintptr)(unsafe.Pointer(ppIter))
@@ -42718,13 +43333,13 @@ func clearAllSharedCacheTableLocks(tls *libc.TLS, p uintptr) { /* sqlite3.c:6587
Xsqlite3_free(tls, pLock)
}
} else {
- ppIter = (pLock + 12 /* &.pNext */)
+ ppIter = pLock + 12
}
}
if (*BtShared)(unsafe.Pointer(pBt)).FpWriter == p {
(*BtShared)(unsafe.Pointer(pBt)).FpWriter = uintptr(0)
- *(*U16)(unsafe.Pointer(pBt + 24 /* &.btsFlags */)) &= libc.Uint16FromInt32((libc.CplInt32((BTS_EXCLUSIVE | BTS_PENDING))))
+ *(*U16)(unsafe.Pointer(pBt + 24)) &= libc.Uint16FromInt32(libc.CplInt32(BTS_EXCLUSIVE | BTS_PENDING))
} else if (*BtShared)(unsafe.Pointer(pBt)).FnTransaction == 2 {
// This function is called when Btree p is concluding its
// transaction. If there currently exists a writer, and p is not
@@ -42734,17 +43349,17 @@ func clearAllSharedCacheTableLocks(tls *libc.TLS, p uintptr) { /* sqlite3.c:6587
//
// If there is not currently a writer, then BTS_PENDING must
// be zero already. So this next line is harmless in that case.
- *(*U16)(unsafe.Pointer(pBt + 24 /* &.btsFlags */)) &= libc.Uint16FromInt32((libc.CplInt32(BTS_PENDING)))
+ *(*U16)(unsafe.Pointer(pBt + 24)) &= libc.Uint16FromInt32(libc.CplInt32(BTS_PENDING))
}
}
// This function changes all write-locks held by Btree p into read-locks.
-func downgradeAllSharedCacheTableLocks(tls *libc.TLS, p uintptr) { /* sqlite3.c:65920:13: */
+func downgradeAllSharedCacheTableLocks(tls *libc.TLS, p uintptr) { /* sqlite3.c:66040:13: */
var pBt uintptr = (*Btree)(unsafe.Pointer(p)).FpBt
if (*BtShared)(unsafe.Pointer(pBt)).FpWriter == p {
var pLock uintptr
(*BtShared)(unsafe.Pointer(pBt)).FpWriter = uintptr(0)
- *(*U16)(unsafe.Pointer(pBt + 24 /* &.btsFlags */)) &= libc.Uint16FromInt32((libc.CplInt32((BTS_EXCLUSIVE | BTS_PENDING))))
+ *(*U16)(unsafe.Pointer(pBt + 24)) &= libc.Uint16FromInt32(libc.CplInt32(BTS_EXCLUSIVE | BTS_PENDING))
for pLock = (*BtShared)(unsafe.Pointer(pBt)).FpLock; pLock != 0; pLock = (*BtLock)(unsafe.Pointer(pLock)).FpNext {
(*BtLock)(unsafe.Pointer(pLock)).FeLock = U8(READ_LOCK)
@@ -42763,11 +43378,11 @@ func downgradeAllSharedCacheTableLocks(tls *libc.TLS, p uintptr) { /* sqlite3.c:
// Invalidate the overflow page-list cache for all cursors opened
// on the shared btree structure pBt.
-func invalidateAllOverflowCache(tls *libc.TLS, pBt uintptr) { /* sqlite3.c:65973:13: */
+func invalidateAllOverflowCache(tls *libc.TLS, pBt uintptr) { /* sqlite3.c:66093:13: */
var p uintptr
for p = (*BtShared)(unsafe.Pointer(pBt)).FpCursor; p != 0; p = (*BtCursor)(unsafe.Pointer(p)).FpNext {
- *(*U8)(unsafe.Pointer(p + 1 /* &.curFlags */)) &= libc.Uint8FromInt32((libc.CplInt32(BTCF_ValidOvfl)))
+ *(*U8)(unsafe.Pointer(p + 1)) &= libc.Uint8FromInt32(libc.CplInt32(BTCF_ValidOvfl))
}
}
@@ -42782,14 +43397,14 @@ func invalidateAllOverflowCache(tls *libc.TLS, pBt uintptr) { /* sqlite3.c:65973
// Otherwise, if argument isClearTable is false, then the row with
// rowid iRow is being replaced or deleted. In this case invalidate
// only those incrblob cursors open on that specific row.
-func invalidateIncrblobCursors(tls *libc.TLS, pBtree uintptr, pgnoRoot Pgno, iRow I64, isClearTable int32) { /* sqlite3.c:65995:13: */
+func invalidateIncrblobCursors(tls *libc.TLS, pBtree uintptr, pgnoRoot Pgno, iRow I64, isClearTable int32) { /* sqlite3.c:66115:13: */
var p uintptr
(*Btree)(unsafe.Pointer(pBtree)).FhasIncrblobCur = U8(0)
for p = (*BtShared)(unsafe.Pointer((*Btree)(unsafe.Pointer(pBtree)).FpBt)).FpCursor; p != 0; p = (*BtCursor)(unsafe.Pointer(p)).FpNext {
- if (int32((*BtCursor)(unsafe.Pointer(p)).FcurFlags) & BTCF_Incrblob) != 0 {
+ if int32((*BtCursor)(unsafe.Pointer(p)).FcurFlags)&BTCF_Incrblob != 0 {
(*Btree)(unsafe.Pointer(pBtree)).FhasIncrblobCur = U8(1)
- if ((*BtCursor)(unsafe.Pointer(p)).FpgnoRoot == pgnoRoot) && ((isClearTable != 0) || ((*BtCursor)(unsafe.Pointer(p)).Finfo.FnKey == iRow)) {
+ if (*BtCursor)(unsafe.Pointer(p)).FpgnoRoot == pgnoRoot && (isClearTable != 0 || (*BtCursor)(unsafe.Pointer(p)).Finfo.FnKey == iRow) {
(*BtCursor)(unsafe.Pointer(p)).FeState = U8(CURSOR_INVALID)
}
}
@@ -42829,7 +43444,7 @@ func invalidateIncrblobCursors(tls *libc.TLS, pBtree uintptr, pgnoRoot Pgno, iRo
// optimization 2 above is omitted if the corresponding bit is already
// set in BtShared.pHasContent. The contents of the bitvec are cleared
// at the end of every transaction.
-func btreeSetHasContent(tls *libc.TLS, pBt uintptr, pgno Pgno) int32 { /* sqlite3.c:66055:12: */
+func btreeSetHasContent(tls *libc.TLS, pBt uintptr, pgno Pgno) int32 { /* sqlite3.c:66175:12: */
var rc int32 = SQLITE_OK
if !(int32((*BtShared)(unsafe.Pointer(pBt)).FpHasContent) != 0) {
@@ -42838,7 +43453,7 @@ func btreeSetHasContent(tls *libc.TLS, pBt uintptr, pgno Pgno) int32 { /* sqlite
rc = SQLITE_NOMEM
}
}
- if (rc == SQLITE_OK) && (pgno <= Xsqlite3BitvecSize(tls, (*BtShared)(unsafe.Pointer(pBt)).FpHasContent)) {
+ if rc == SQLITE_OK && pgno <= Xsqlite3BitvecSize(tls, (*BtShared)(unsafe.Pointer(pBt)).FpHasContent) {
rc = Xsqlite3BitvecSet(tls, (*BtShared)(unsafe.Pointer(pBt)).FpHasContent, pgno)
}
return rc
@@ -42849,24 +43464,24 @@ func btreeSetHasContent(tls *libc.TLS, pBt uintptr, pgno Pgno) int32 { /* sqlite
// This function is called when a free-list leaf page is removed from the
// free-list for reuse. It returns false if it is safe to retrieve the
// page from the pager layer with the 'no-content' flag set. True otherwise.
-func btreeGetHasContent(tls *libc.TLS, pBt uintptr, pgno Pgno) int32 { /* sqlite3.c:66077:12: */
+func btreeGetHasContent(tls *libc.TLS, pBt uintptr, pgno Pgno) int32 { /* sqlite3.c:66197:12: */
var p uintptr = (*BtShared)(unsafe.Pointer(pBt)).FpHasContent
- return (libc.Bool32((p != 0) && ((pgno > Xsqlite3BitvecSize(tls, p)) || (Xsqlite3BitvecTestNotNull(tls, p, pgno) != 0))))
+ return libc.Bool32(p != 0 && (pgno > Xsqlite3BitvecSize(tls, p) || Xsqlite3BitvecTestNotNull(tls, p, pgno) != 0))
}
// Clear (destroy) the BtShared.pHasContent bitvec. This should be
// invoked at the conclusion of each write-transaction.
-func btreeClearHasContent(tls *libc.TLS, pBt uintptr) { /* sqlite3.c:66086:13: */
+func btreeClearHasContent(tls *libc.TLS, pBt uintptr) { /* sqlite3.c:66206:13: */
Xsqlite3BitvecDestroy(tls, (*BtShared)(unsafe.Pointer(pBt)).FpHasContent)
(*BtShared)(unsafe.Pointer(pBt)).FpHasContent = uintptr(0)
}
// Release all of the apPage[] pages for a cursor.
-func btreeReleaseAllCursorPages(tls *libc.TLS, pCur uintptr) { /* sqlite3.c:66094:13: */
+func btreeReleaseAllCursorPages(tls *libc.TLS, pCur uintptr) { /* sqlite3.c:66214:13: */
var i int32
if int32((*BtCursor)(unsafe.Pointer(pCur)).FiPage) >= 0 {
for i = 0; i < int32((*BtCursor)(unsafe.Pointer(pCur)).FiPage); i++ {
- releasePageNotNull(tls, *(*uintptr)(unsafe.Pointer((pCur + 120 /* &.apPage */) + uintptr(i)*4)))
+ releasePageNotNull(tls, *(*uintptr)(unsafe.Pointer(pCur + 120 + uintptr(i)*4)))
}
releasePageNotNull(tls, (*BtCursor)(unsafe.Pointer(pCur)).FpPage)
(*BtCursor)(unsafe.Pointer(pCur)).FiPage = int8(-1)
@@ -42884,7 +43499,7 @@ func btreeReleaseAllCursorPages(tls *libc.TLS, pCur uintptr) { /* sqlite3.c:6609
// NULL. If the cursor is open on a non-intkey table, then pCur->pKey is
// set to point to a malloced buffer pCur->nKey bytes in size containing
// the key.
-func saveCursorKey(tls *libc.TLS, pCur uintptr) int32 { /* sqlite3.c:66118:12: */
+func saveCursorKey(tls *libc.TLS, pCur uintptr) int32 { /* sqlite3.c:66238:12: */
var rc int32 = SQLITE_OK
if (*BtCursor)(unsafe.Pointer(pCur)).FcurIntKey != 0 {
@@ -42899,11 +43514,11 @@ func saveCursorKey(tls *libc.TLS, pCur uintptr) int32 { /* sqlite3.c:66118:12: *
// below.
var pKey uintptr
(*BtCursor)(unsafe.Pointer(pCur)).FnKey = I64(Xsqlite3BtreePayloadSize(tls, pCur))
- pKey = Xsqlite3Malloc(tls, (uint64(((*BtCursor)(unsafe.Pointer(pCur)).FnKey + int64(9)) + int64(8))))
+ pKey = Xsqlite3Malloc(tls, uint64((*BtCursor)(unsafe.Pointer(pCur)).FnKey+int64(9)+int64(8)))
if pKey != 0 {
rc = Xsqlite3BtreePayload(tls, pCur, uint32(0), uint32(int32((*BtCursor)(unsafe.Pointer(pCur)).FnKey)), pKey)
if rc == SQLITE_OK {
- libc.Xmemset(tls, ((pKey) + uintptr((*BtCursor)(unsafe.Pointer(pCur)).FnKey)), 0, (uint32(9 + 8)))
+ libc.Xmemset(tls, pKey+uintptr((*BtCursor)(unsafe.Pointer(pCur)).FnKey), 0, uint32(9+8))
(*BtCursor)(unsafe.Pointer(pCur)).FpKey = pKey
} else {
Xsqlite3_free(tls, pKey)
@@ -42921,11 +43536,11 @@ func saveCursorKey(tls *libc.TLS, pCur uintptr) int32 { /* sqlite3.c:66118:12: *
//
// The caller must ensure that the cursor is valid (has eState==CURSOR_VALID)
// prior to calling this routine.
-func saveCursorPosition(tls *libc.TLS, pCur uintptr) int32 { /* sqlite3.c:66160:12: */
+func saveCursorPosition(tls *libc.TLS, pCur uintptr) int32 { /* sqlite3.c:66280:12: */
var rc int32
- if (int32((*BtCursor)(unsafe.Pointer(pCur)).FcurFlags) & BTCF_Pinned) != 0 {
- return (SQLITE_CONSTRAINT | (int32(11) << 8))
+ if int32((*BtCursor)(unsafe.Pointer(pCur)).FcurFlags)&BTCF_Pinned != 0 {
+ return SQLITE_CONSTRAINT | int32(11)<<8
}
if int32((*BtCursor)(unsafe.Pointer(pCur)).FeState) == CURSOR_SKIPNEXT {
(*BtCursor)(unsafe.Pointer(pCur)).FeState = U8(CURSOR_VALID)
@@ -42939,7 +43554,7 @@ func saveCursorPosition(tls *libc.TLS, pCur uintptr) int32 { /* sqlite3.c:66160:
(*BtCursor)(unsafe.Pointer(pCur)).FeState = U8(CURSOR_REQUIRESEEK)
}
- *(*U8)(unsafe.Pointer(pCur + 1 /* &.curFlags */)) &= libc.Uint8FromInt32((libc.CplInt32(((BTCF_ValidNKey | BTCF_ValidOvfl) | BTCF_AtLast))))
+ *(*U8)(unsafe.Pointer(pCur + 1)) &= libc.Uint8FromInt32(libc.CplInt32(BTCF_ValidNKey | BTCF_ValidOvfl | BTCF_AtLast))
return rc
}
@@ -42962,11 +43577,11 @@ func saveCursorPosition(tls *libc.TLS, pCur uintptr) int32 { /* sqlite3.c:66160:
// Implementation note: This routine merely checks to see if any cursors
// need to be saved. It calls out to saveCursorsOnList() in the (unusual)
// event that cursors are in need to being saved.
-func saveAllCursors(tls *libc.TLS, pBt uintptr, iRoot Pgno, pExcept uintptr) int32 { /* sqlite3.c:66210:12: */
+func saveAllCursors(tls *libc.TLS, pBt uintptr, iRoot Pgno, pExcept uintptr) int32 { /* sqlite3.c:66330:12: */
var p uintptr
for p = (*BtShared)(unsafe.Pointer(pBt)).FpCursor; p != 0; p = (*BtCursor)(unsafe.Pointer(p)).FpNext {
- if (p != pExcept) && ((Pgno(0) == iRoot) || ((*BtCursor)(unsafe.Pointer(p)).FpgnoRoot == iRoot)) {
+ if p != pExcept && (Pgno(0) == iRoot || (*BtCursor)(unsafe.Pointer(p)).FpgnoRoot == iRoot) {
break
}
}
@@ -42974,7 +43589,7 @@ func saveAllCursors(tls *libc.TLS, pBt uintptr, iRoot Pgno, pExcept uintptr) int
return saveCursorsOnList(tls, p, iRoot, pExcept)
}
if pExcept != 0 {
- *(*U8)(unsafe.Pointer(pExcept + 1 /* &.curFlags */)) &= libc.Uint8FromInt32((libc.CplInt32(BTCF_Multiple)))
+ *(*U8)(unsafe.Pointer(pExcept + 1)) &= libc.Uint8FromInt32(libc.CplInt32(BTCF_Multiple))
}
return SQLITE_OK
}
@@ -42983,10 +43598,10 @@ func saveAllCursors(tls *libc.TLS, pBt uintptr, iRoot Pgno, pExcept uintptr) int
// the cursors if and when a cursor is found that actually requires saving.
// The common case is that no cursors need to be saved, so this routine is
// broken out from its caller to avoid unnecessary stack pointer movement.
-func saveCursorsOnList(tls *libc.TLS, p uintptr, iRoot Pgno, pExcept uintptr) int32 { /* sqlite3.c:66227:28: */
+func saveCursorsOnList(tls *libc.TLS, p uintptr, iRoot Pgno, pExcept uintptr) int32 { /* sqlite3.c:66347:28: */
for ok := true; ok; ok = p != 0 {
- if (p != pExcept) && ((Pgno(0) == iRoot) || ((*BtCursor)(unsafe.Pointer(p)).FpgnoRoot == iRoot)) {
- if (int32((*BtCursor)(unsafe.Pointer(p)).FeState) == CURSOR_VALID) || (int32((*BtCursor)(unsafe.Pointer(p)).FeState) == CURSOR_SKIPNEXT) {
+ if p != pExcept && (Pgno(0) == iRoot || (*BtCursor)(unsafe.Pointer(p)).FpgnoRoot == iRoot) {
+ if int32((*BtCursor)(unsafe.Pointer(p)).FeState) == CURSOR_VALID || int32((*BtCursor)(unsafe.Pointer(p)).FeState) == CURSOR_SKIPNEXT {
var rc int32 = saveCursorPosition(tls, p)
if SQLITE_OK != rc {
return rc
@@ -43002,7 +43617,7 @@ func saveCursorsOnList(tls *libc.TLS, p uintptr, iRoot Pgno, pExcept uintptr) in
}
// Clear the current cursor position.
-func Xsqlite3BtreeClearCursor(tls *libc.TLS, pCur uintptr) { /* sqlite3.c:66252:21: */
+func Xsqlite3BtreeClearCursor(tls *libc.TLS, pCur uintptr) { /* sqlite3.c:66372:21: */
Xsqlite3_free(tls, (*BtCursor)(unsafe.Pointer(pCur)).FpKey)
(*BtCursor)(unsafe.Pointer(pCur)).FpKey = uintptr(0)
@@ -43012,44 +43627,28 @@ func Xsqlite3BtreeClearCursor(tls *libc.TLS, pCur uintptr) { /* sqlite3.c:66252:
// In this version of BtreeMoveto, pKey is a packed index record
// such as is generated by the OP_MakeRecord opcode. Unpack the
// record and then call BtreeMovetoUnpacked() to do the work.
-func btreeMoveto(tls *libc.TLS, pCur uintptr, pKey uintptr, nKey I64, bias int32, pRes uintptr) int32 { /* sqlite3.c:66264:12: */
- var rc int32 // Status code
- var pIdxKey uintptr
- var pKeyInfo uintptr // Unpacked index key
+func btreeMoveto(tls *libc.TLS, pCur uintptr, pKey uintptr, nKey I64, bias int32, pRes uintptr) int32 { /* sqlite3.c:66384:12: */
+ var rc int32 // Status code
+ var pIdxKey uintptr // Unpacked index key
- if !(pKey != 0) {
- goto __1
- }
- pKeyInfo = (*BtCursor)(unsafe.Pointer(pCur)).FpKeyInfo
+ if pKey != 0 {
+ var pKeyInfo uintptr = (*BtCursor)(unsafe.Pointer(pCur)).FpKeyInfo
- pIdxKey = Xsqlite3VdbeAllocUnpackedRecord(tls, pKeyInfo)
- if !(pIdxKey == uintptr(0)) {
- goto __3
- }
- return SQLITE_NOMEM
-__3:
- ;
- Xsqlite3VdbeRecordUnpack(tls, pKeyInfo, int32(nKey), pKey, pIdxKey)
- if !((int32((*UnpackedRecord)(unsafe.Pointer(pIdxKey)).FnField) == 0) || (int32((*UnpackedRecord)(unsafe.Pointer(pIdxKey)).FnField) > int32((*KeyInfo)(unsafe.Pointer(pKeyInfo)).FnAllField))) {
- goto __4
- }
- rc = Xsqlite3CorruptError(tls, 66281)
- goto moveto_done
-__4:
- ;
- goto __2
-__1:
- pIdxKey = uintptr(0)
-__2:
- ;
- rc = Xsqlite3BtreeMovetoUnpacked(tls, pCur, pIdxKey, nKey, bias, pRes)
-moveto_done:
- if !(pIdxKey != 0) {
- goto __5
+ pIdxKey = Xsqlite3VdbeAllocUnpackedRecord(tls, pKeyInfo)
+ if pIdxKey == uintptr(0) {
+ return SQLITE_NOMEM
+ }
+ Xsqlite3VdbeRecordUnpack(tls, pKeyInfo, int32(nKey), pKey, pIdxKey)
+ if int32((*UnpackedRecord)(unsafe.Pointer(pIdxKey)).FnField) == 0 || int32((*UnpackedRecord)(unsafe.Pointer(pIdxKey)).FnField) > int32((*KeyInfo)(unsafe.Pointer(pKeyInfo)).FnAllField) {
+ rc = Xsqlite3CorruptError(tls, 66401)
+ } else {
+ rc = Xsqlite3BtreeIndexMoveto(tls, pCur, pIdxKey, pRes)
+ }
+ Xsqlite3DbFree(tls, (*KeyInfo1)(unsafe.Pointer((*BtCursor)(unsafe.Pointer(pCur)).FpKeyInfo)).Fdb, pIdxKey)
+ } else {
+ pIdxKey = uintptr(0)
+ rc = Xsqlite3BtreeTableMoveto(tls, pCur, nKey, bias, pRes)
}
- Xsqlite3DbFree(tls, (*KeyInfo1)(unsafe.Pointer((*BtCursor)(unsafe.Pointer(pCur)).FpKeyInfo)).Fdb, pIdxKey)
-__5:
- ;
return rc
}
@@ -43058,7 +43657,7 @@ __5:
// saved position info stored by saveCursorPosition(), so there can be
// at most one effective restoreCursorPosition() call after each
// saveCursorPosition().
-func btreeRestoreCursorPosition(tls *libc.TLS, pCur uintptr) int32 { /* sqlite3.c:66302:12: */
+func btreeRestoreCursorPosition(tls *libc.TLS, pCur uintptr) int32 { /* sqlite3.c:66420:12: */
bp := tls.Alloc(4)
defer tls.Free(4)
@@ -43078,10 +43677,10 @@ func btreeRestoreCursorPosition(tls *libc.TLS, pCur uintptr) int32 { /* sqlite3.
Xsqlite3_free(tls, (*BtCursor)(unsafe.Pointer(pCur)).FpKey)
(*BtCursor)(unsafe.Pointer(pCur)).FpKey = uintptr(0)
- if *(*int32)(unsafe.Pointer(bp /* skipNext */)) != 0 {
+ if *(*int32)(unsafe.Pointer(bp)) != 0 {
(*BtCursor)(unsafe.Pointer(pCur)).FskipNext = *(*int32)(unsafe.Pointer(bp /* skipNext */))
}
- if ((*BtCursor)(unsafe.Pointer(pCur)).FskipNext != 0) && (int32((*BtCursor)(unsafe.Pointer(pCur)).FeState) == CURSOR_VALID) {
+ if (*BtCursor)(unsafe.Pointer(pCur)).FskipNext != 0 && int32((*BtCursor)(unsafe.Pointer(pCur)).FeState) == CURSOR_VALID {
(*BtCursor)(unsafe.Pointer(pCur)).FeState = U8(CURSOR_SKIPNEXT)
}
}
@@ -43098,20 +43697,20 @@ func btreeRestoreCursorPosition(tls *libc.TLS, pCur uintptr) int32 { /* sqlite3.
//
// Use the separate sqlite3BtreeCursorRestore() routine to restore a cursor
// back to where it ought to be if this routine returns true.
-func Xsqlite3BtreeCursorHasMoved(tls *libc.TLS, pCur uintptr) int32 { /* sqlite3.c:66345:20: */
+func Xsqlite3BtreeCursorHasMoved(tls *libc.TLS, pCur uintptr) int32 { /* sqlite3.c:66463:20: */
- return (libc.Bool32(CURSOR_VALID != int32(*(*U8)(unsafe.Pointer(pCur)))))
+ return libc.Bool32(CURSOR_VALID != int32(*(*U8)(unsafe.Pointer(pCur))))
}
// Return a pointer to a fake BtCursor object that will always answer
// false to the sqlite3BtreeCursorHasMoved() routine above. The fake
// cursor returned must not be used with any other Btree interface.
-func Xsqlite3BtreeFakeValidCursor(tls *libc.TLS) uintptr { /* sqlite3.c:66358:25: */
+func Xsqlite3BtreeFakeValidCursor(tls *libc.TLS) uintptr { /* sqlite3.c:66476:25: */
return uintptr(unsafe.Pointer(&fakeCursor))
}
-var fakeCursor U8 = U8(CURSOR_VALID) /* sqlite3.c:66359:13 */
+var fakeCursor U8 = U8(CURSOR_VALID) /* sqlite3.c:66477:13 */
// This routine restores a cursor back to its original position after it
// has been moved by some outside activity (such as a btree rebalance or
@@ -43124,7 +43723,7 @@ var fakeCursor U8 = U8(CURSOR_VALID) /* sqlite3.c:66359:13 */
//
// This routine should only be called for a cursor that just returned
// TRUE from sqlite3BtreeCursorHasMoved().
-func Xsqlite3BtreeCursorRestore(tls *libc.TLS, pCur uintptr, pDifferentRow uintptr) int32 { /* sqlite3.c:66377:20: */
+func Xsqlite3BtreeCursorRestore(tls *libc.TLS, pCur uintptr, pDifferentRow uintptr) int32 { /* sqlite3.c:66495:20: */
var rc int32
rc = func() int32 {
@@ -43146,7 +43745,7 @@ func Xsqlite3BtreeCursorRestore(tls *libc.TLS, pCur uintptr, pDifferentRow uintp
}
// Provide flag hints to the cursor.
-func Xsqlite3BtreeCursorHintFlags(tls *libc.TLS, pCur uintptr, x uint32) { /* sqlite3.c:66409:21: */
+func Xsqlite3BtreeCursorHintFlags(tls *libc.TLS, pCur uintptr, x uint32) { /* sqlite3.c:66527:21: */
(*BtCursor)(unsafe.Pointer(pCur)).Fhints = U8(x)
}
@@ -43158,7 +43757,7 @@ func Xsqlite3BtreeCursorHintFlags(tls *libc.TLS, pCur uintptr, x uint32) { /* sq
// Return 0 (not a valid page) for pgno==1 since there is
// no pointer map associated with page 1. The integrity_check logic
// requires that ptrmapPageno(*,1)!=1.
-func ptrmapPageno(tls *libc.TLS, pBt uintptr, pgno Pgno) Pgno { /* sqlite3.c:66425:13: */
+func ptrmapPageno(tls *libc.TLS, pBt uintptr, pgno Pgno) Pgno { /* sqlite3.c:66543:13: */
var nPagesPerMapPage int32
var iPtrMap Pgno
var ret Pgno
@@ -43166,10 +43765,10 @@ func ptrmapPageno(tls *libc.TLS, pBt uintptr, pgno Pgno) Pgno { /* sqlite3.c:664
if pgno < Pgno(2) {
return Pgno(0)
}
- nPagesPerMapPage = (int32(((*BtShared)(unsafe.Pointer(pBt)).FusableSize / U32(5)) + U32(1)))
- iPtrMap = ((pgno - Pgno(2)) / Pgno(nPagesPerMapPage))
- ret = ((iPtrMap * Pgno(nPagesPerMapPage)) + Pgno(2))
- if ret == ((U32(Xsqlite3PendingByte) / ((*BtShared)(unsafe.Pointer(pBt)).FpageSize)) + U32(1)) {
+ nPagesPerMapPage = int32((*BtShared)(unsafe.Pointer(pBt)).FusableSize/U32(5) + U32(1))
+ iPtrMap = (pgno - Pgno(2)) / Pgno(nPagesPerMapPage)
+ ret = iPtrMap*Pgno(nPagesPerMapPage) + Pgno(2)
+ if ret == U32(Xsqlite3PendingByte)/(*BtShared)(unsafe.Pointer(pBt)).FpageSize+U32(1) {
ret++
}
return ret
@@ -43183,7 +43782,7 @@ func ptrmapPageno(tls *libc.TLS, pBt uintptr, pgno Pgno) Pgno { /* sqlite3.c:664
// If *pRC is initially non-zero (non-SQLITE_OK) then this routine is
// a no-op. If an error occurs, the appropriate error code is written
// into *pRC.
-func ptrmapPut(tls *libc.TLS, pBt uintptr, key Pgno, eType U8, parent Pgno, pRC uintptr) { /* sqlite3.c:66449:13: */
+func ptrmapPut(tls *libc.TLS, pBt uintptr, key Pgno, eType U8, parent Pgno, pRC uintptr) { /* sqlite3.c:66567:13: */
bp := tls.Alloc(4)
defer tls.Free(4)
@@ -43206,7 +43805,7 @@ __1:
if !(key == Pgno(0)) {
goto __2
}
- *(*int32)(unsafe.Pointer(pRC)) = Xsqlite3CorruptError(tls, 66464)
+ *(*int32)(unsafe.Pointer(pRC)) = Xsqlite3CorruptError(tls, 66582)
return
__2:
;
@@ -43219,28 +43818,28 @@ __2:
return
__3:
;
- if !(int32(*(*uint8)(unsafe.Pointer((Xsqlite3PagerGetExtra(tls, *(*uintptr)(unsafe.Pointer(bp /* pDbPage */))))))) != 0) {
+ if !(int32(*(*uint8)(unsafe.Pointer(Xsqlite3PagerGetExtra(tls, *(*uintptr)(unsafe.Pointer(bp)))))) != 0) {
goto __4
}
// The first byte of the extra data is the MemPage.isInit byte.
// If that byte is set, it means this page is also being used
// as a btree page.
- *(*int32)(unsafe.Pointer(pRC)) = Xsqlite3CorruptError(tls, 66477)
+ *(*int32)(unsafe.Pointer(pRC)) = Xsqlite3CorruptError(tls, 66595)
goto ptrmap_exit
__4:
;
- offset = (int32(Pgno(5) * ((key - iPtrmap) - Pgno(1))))
+ offset = int32(Pgno(5) * (key - iPtrmap - Pgno(1)))
if !(offset < 0) {
goto __5
}
- *(*int32)(unsafe.Pointer(pRC)) = Xsqlite3CorruptError(tls, 66482)
+ *(*int32)(unsafe.Pointer(pRC)) = Xsqlite3CorruptError(tls, 66600)
goto ptrmap_exit
__5:
;
pPtrmap = Xsqlite3PagerGetData(tls, *(*uintptr)(unsafe.Pointer(bp /* pDbPage */)))
- if !((int32(eType) != int32(*(*U8)(unsafe.Pointer(pPtrmap + uintptr(offset))))) || (Xsqlite3Get4byte(tls, (pPtrmap+uintptr((offset+1)))) != parent)) {
+ if !(int32(eType) != int32(*(*U8)(unsafe.Pointer(pPtrmap + uintptr(offset)))) || Xsqlite3Get4byte(tls, pPtrmap+uintptr(offset+1)) != parent) {
goto __6
}
@@ -43249,7 +43848,7 @@ __5:
goto __7
}
*(*U8)(unsafe.Pointer(pPtrmap + uintptr(offset))) = eType
- Xsqlite3Put4byte(tls, (pPtrmap + uintptr((offset + 1))), parent)
+ Xsqlite3Put4byte(tls, pPtrmap+uintptr(offset+1), parent)
__7:
;
__6:
@@ -43264,7 +43863,7 @@ ptrmap_exit:
// This routine retrieves the pointer map entry for page 'key', writing
// the type and parent page number to *pEType and *pPgno respectively.
// An error code is returned if something goes wrong, otherwise SQLITE_OK.
-func ptrmapGet(tls *libc.TLS, pBt uintptr, key Pgno, pEType uintptr, pPgno uintptr) int32 { /* sqlite3.c:66508:12: */
+func ptrmapGet(tls *libc.TLS, pBt uintptr, key Pgno, pEType uintptr, pPgno uintptr) int32 { /* sqlite3.c:66626:12: */
bp := tls.Alloc(4)
defer tls.Free(4)
@@ -43282,20 +43881,20 @@ func ptrmapGet(tls *libc.TLS, pBt uintptr, key Pgno, pEType uintptr, pPgno uintp
}
pPtrmap = Xsqlite3PagerGetData(tls, *(*uintptr)(unsafe.Pointer(bp /* pDbPage */)))
- offset = (int32(Pgno(5) * ((key - Pgno(iPtrmap)) - Pgno(1))))
+ offset = int32(Pgno(5) * (key - Pgno(iPtrmap) - Pgno(1)))
if offset < 0 {
Xsqlite3PagerUnref(tls, *(*uintptr)(unsafe.Pointer(bp /* pDbPage */)))
- return Xsqlite3CorruptError(tls, 66527)
+ return Xsqlite3CorruptError(tls, 66645)
}
*(*U8)(unsafe.Pointer(pEType)) = *(*U8)(unsafe.Pointer(pPtrmap + uintptr(offset)))
if pPgno != 0 {
- *(*Pgno)(unsafe.Pointer(pPgno)) = Xsqlite3Get4byte(tls, (pPtrmap + uintptr((offset + 1))))
+ *(*Pgno)(unsafe.Pointer(pPgno)) = Xsqlite3Get4byte(tls, pPtrmap+uintptr(offset+1))
}
Xsqlite3PagerUnref(tls, *(*uintptr)(unsafe.Pointer(bp /* pDbPage */)))
- if (int32(*(*U8)(unsafe.Pointer(pEType))) < 1) || (int32(*(*U8)(unsafe.Pointer(pEType))) > 5) {
- return Xsqlite3CorruptError(tls, 66535)
+ if int32(*(*U8)(unsafe.Pointer(pEType))) < 1 || int32(*(*U8)(unsafe.Pointer(pEType))) > 5 {
+ return Xsqlite3CorruptError(tls, 66653)
}
return SQLITE_OK
}
@@ -43313,7 +43912,7 @@ func ptrmapGet(tls *libc.TLS, pBt uintptr, key Pgno, pEType uintptr, pPgno uintp
// btreeParseCellPtrIndex() for the case when the cell does not fit entirely
// on a single B-tree page. Make necessary adjustments to the CellInfo
// structure.
-func btreeParseCellAdjustSizeForOverflow(tls *libc.TLS, pPage uintptr, pCell uintptr, pInfo uintptr) { /* sqlite3.c:66567:29: */
+func btreeParseCellAdjustSizeForOverflow(tls *libc.TLS, pPage uintptr, pCell uintptr, pInfo uintptr) { /* sqlite3.c:66685:29: */
// If the payload will not fit completely on the local page, we have
// to decide how much to store locally and how much to spill onto
// overflow pages. The strategy is to minimize the amount of unused
@@ -43328,19 +43927,19 @@ func btreeParseCellAdjustSizeForOverflow(tls *libc.TLS, pPage uintptr, pCell uin
minLocal = int32((*MemPage)(unsafe.Pointer(pPage)).FminLocal)
maxLocal = int32((*MemPage)(unsafe.Pointer(pPage)).FmaxLocal)
- surplus = (int32(U32(minLocal) + (((*CellInfo)(unsafe.Pointer(pInfo)).FnPayload - U32(minLocal)) % ((*BtShared)(unsafe.Pointer((*MemPage)(unsafe.Pointer(pPage)).FpBt)).FusableSize - U32(4)))))
+ surplus = int32(U32(minLocal) + ((*CellInfo)(unsafe.Pointer(pInfo)).FnPayload-U32(minLocal))%((*BtShared)(unsafe.Pointer((*MemPage)(unsafe.Pointer(pPage)).FpBt)).FusableSize-U32(4)))
if surplus <= maxLocal {
(*CellInfo)(unsafe.Pointer(pInfo)).FnLocal = U16(surplus)
} else {
(*CellInfo)(unsafe.Pointer(pInfo)).FnLocal = U16(minLocal)
}
- (*CellInfo)(unsafe.Pointer(pInfo)).FnSize = (U16(int32((U16((int32(((*CellInfo)(unsafe.Pointer(pInfo)).FpPayload + uintptr((*CellInfo)(unsafe.Pointer(pInfo)).FnLocal))) - int32(pCell)) / 1))) + 4))
+ (*CellInfo)(unsafe.Pointer(pInfo)).FnSize = U16(int32(U16((int32((*CellInfo)(unsafe.Pointer(pInfo)).FpPayload+uintptr((*CellInfo)(unsafe.Pointer(pInfo)).FnLocal))-int32(pCell))/1)) + 4)
}
// Given a record with nPayload bytes of payload stored within btree
// page pPage, return the number of bytes of payload stored locally.
-func btreePayloadToLocal(tls *libc.TLS, pPage uintptr, nPayload I64) int32 { /* sqlite3.c:66602:12: */
+func btreePayloadToLocal(tls *libc.TLS, pPage uintptr, nPayload I64) int32 { /* sqlite3.c:66720:12: */
var maxLocal int32 // Maximum amount of payload held locally
maxLocal = int32((*MemPage)(unsafe.Pointer(pPage)).FmaxLocal)
if nPayload <= I64(maxLocal) {
@@ -43349,7 +43948,7 @@ func btreePayloadToLocal(tls *libc.TLS, pPage uintptr, nPayload I64) int32 { /*
var minLocal int32 // Minimum amount of payload held locally
var surplus int32 // Overflow payload available for local storage
minLocal = int32((*MemPage)(unsafe.Pointer(pPage)).FminLocal)
- surplus = (int32(I64(minLocal) + ((nPayload - I64(minLocal)) % (I64((*BtShared)(unsafe.Pointer((*MemPage)(unsafe.Pointer(pPage)).FpBt)).FusableSize - U32(4))))))
+ surplus = int32(I64(minLocal) + (nPayload-I64(minLocal))%I64((*BtShared)(unsafe.Pointer((*MemPage)(unsafe.Pointer(pPage)).FpBt)).FusableSize-U32(4)))
if surplus <= maxLocal {
return surplus
}
@@ -43370,17 +43969,17 @@ func btreePayloadToLocal(tls *libc.TLS, pPage uintptr, nPayload I64) int32 { /*
// There is also a wrapper function btreeParseCell() that works for
// all MemPage types and that references the cell by index rather than
// by pointer.
-func btreeParseCellPtrNoPayload(tls *libc.TLS, pPage uintptr, pCell uintptr, pInfo uintptr) { /* sqlite3.c:66630:13: */
+func btreeParseCellPtrNoPayload(tls *libc.TLS, pPage uintptr, pCell uintptr, pInfo uintptr) { /* sqlite3.c:66748:13: */
_ = pPage
- (*CellInfo)(unsafe.Pointer(pInfo)).FnSize = (U16(4 + int32(Xsqlite3GetVarint(tls, (pCell+4), (pInfo /* &.nKey */)))))
+ (*CellInfo)(unsafe.Pointer(pInfo)).FnSize = U16(4 + int32(Xsqlite3GetVarint(tls, pCell+4, pInfo)))
(*CellInfo)(unsafe.Pointer(pInfo)).FnPayload = U32(0)
(*CellInfo)(unsafe.Pointer(pInfo)).FnLocal = U16(0)
(*CellInfo)(unsafe.Pointer(pInfo)).FpPayload = uintptr(0)
return
}
-func btreeParseCellPtr(tls *libc.TLS, pPage uintptr, pCell uintptr, pInfo uintptr) { /* sqlite3.c:66647:13: */
+func btreeParseCellPtr(tls *libc.TLS, pPage uintptr, pCell uintptr, pInfo uintptr) { /* sqlite3.c:66765:13: */
bp := tls.Alloc(8)
defer tls.Free(8)
@@ -43398,10 +43997,10 @@ func btreeParseCellPtr(tls *libc.TLS, pPage uintptr, pCell uintptr, pInfo uintpt
// The code is inlined to avoid a function call.
nPayload = U32(*(*U8)(unsafe.Pointer(pIter)))
if nPayload >= U32(0x80) {
- var pEnd uintptr = (pIter + 8)
- nPayload = nPayload & (U32(0x7f))
- for ok := true; ok; ok = (((int32(*(*U8)(unsafe.Pointer(pIter)))) >= 0x80) && (pIter < pEnd)) {
- nPayload = ((nPayload << 7) | (U32(int32(*(*U8)(unsafe.Pointer(libc.PreIncUintptr(&pIter, 1)))) & 0x7f)))
+ var pEnd uintptr = pIter + 8
+ nPayload = nPayload & U32(0x7f)
+ for ok := true; ok; ok = int32(*(*U8)(unsafe.Pointer(pIter))) >= 0x80 && pIter < pEnd {
+ nPayload = nPayload<<7 | U32(int32(*(*U8)(unsafe.Pointer(libc.PreIncUintptr(&pIter, 1))))&0x7f)
}
}
pIter++
@@ -43412,16 +44011,16 @@ func btreeParseCellPtr(tls *libc.TLS, pPage uintptr, pCell uintptr, pInfo uintpt
//
// The code is inlined to avoid a function call.
*(*U64)(unsafe.Pointer(bp /* iKey */)) = U64(*(*U8)(unsafe.Pointer(pIter)))
- if *(*U64)(unsafe.Pointer(bp /* iKey */)) >= uint64(0x80) {
- var pEnd uintptr = (pIter + 7)
+ if *(*U64)(unsafe.Pointer(bp)) >= uint64(0x80) {
+ var pEnd uintptr = pIter + 7
*(*U64)(unsafe.Pointer(bp /* iKey */)) &= uint64(0x7f)
for 1 != 0 {
- *(*U64)(unsafe.Pointer(bp /* iKey */)) = ((*(*U64)(unsafe.Pointer(bp /* iKey */)) << 7) | (U64(int32(*(*U8)(unsafe.Pointer(libc.PreIncUintptr(&pIter, 1)))) & 0x7f)))
- if (int32(*(*U8)(unsafe.Pointer(pIter)))) < 0x80 {
+ *(*U64)(unsafe.Pointer(bp /* iKey */)) = *(*U64)(unsafe.Pointer(bp))<<7 | U64(int32(*(*U8)(unsafe.Pointer(libc.PreIncUintptr(&pIter, 1))))&0x7f)
+ if int32(*(*U8)(unsafe.Pointer(pIter))) < 0x80 {
break
}
if pIter >= pEnd {
- *(*U64)(unsafe.Pointer(bp /* iKey */)) = ((*(*U64)(unsafe.Pointer(bp /* iKey */)) << 8) | U64(*(*U8)(unsafe.Pointer(libc.PreIncUintptr(&pIter, 1)))))
+ *(*U64)(unsafe.Pointer(bp /* iKey */)) = *(*U64)(unsafe.Pointer(bp))<<8 | U64(*(*U8)(unsafe.Pointer(libc.PreIncUintptr(&pIter, 1))))
break
}
}
@@ -43435,7 +44034,7 @@ func btreeParseCellPtr(tls *libc.TLS, pPage uintptr, pCell uintptr, pInfo uintpt
if nPayload <= U32((*MemPage)(unsafe.Pointer(pPage)).FmaxLocal) {
// This is the (easy) common case where the entire payload fits
// on the local page. No overflow is required.
- (*CellInfo)(unsafe.Pointer(pInfo)).FnSize = (U16(nPayload + U32((U16((int32(pIter) - int32(pCell)) / 1)))))
+ (*CellInfo)(unsafe.Pointer(pInfo)).FnSize = U16(nPayload + U32(U16((int32(pIter)-int32(pCell))/1)))
if int32((*CellInfo)(unsafe.Pointer(pInfo)).FnSize) < 4 {
(*CellInfo)(unsafe.Pointer(pInfo)).FnSize = U16(4)
}
@@ -43445,17 +44044,17 @@ func btreeParseCellPtr(tls *libc.TLS, pPage uintptr, pCell uintptr, pInfo uintpt
}
}
-func btreeParseCellPtrIndex(tls *libc.TLS, pPage uintptr, pCell uintptr, pInfo uintptr) { /* sqlite3.c:66715:13: */
+func btreeParseCellPtrIndex(tls *libc.TLS, pPage uintptr, pCell uintptr, pInfo uintptr) { /* sqlite3.c:66833:13: */
var pIter uintptr // For scanning through pCell
var nPayload U32 // Number of bytes of cell payload
- pIter = (pCell + uintptr((*MemPage)(unsafe.Pointer(pPage)).FchildPtrSize))
+ pIter = pCell + uintptr((*MemPage)(unsafe.Pointer(pPage)).FchildPtrSize)
nPayload = U32(*(*U8)(unsafe.Pointer(pIter)))
if nPayload >= U32(0x80) {
- var pEnd uintptr = (pIter + 8)
- nPayload = nPayload & (U32(0x7f))
- for ok := true; ok; ok = ((int32(*(*U8)(unsafe.Pointer(pIter))) >= 0x80) && (pIter < pEnd)) {
- nPayload = ((nPayload << 7) | (U32(int32(*(*U8)(unsafe.Pointer(libc.PreIncUintptr(&pIter, 1)))) & 0x7f)))
+ var pEnd uintptr = pIter + 8
+ nPayload = nPayload & U32(0x7f)
+ for ok := true; ok; ok = int32(*(*U8)(unsafe.Pointer(pIter))) >= 0x80 && pIter < pEnd {
+ nPayload = nPayload<<7 | U32(int32(*(*U8)(unsafe.Pointer(libc.PreIncUintptr(&pIter, 1))))&0x7f)
}
}
pIter++
@@ -43466,7 +44065,7 @@ func btreeParseCellPtrIndex(tls *libc.TLS, pPage uintptr, pCell uintptr, pInfo u
if nPayload <= U32((*MemPage)(unsafe.Pointer(pPage)).FmaxLocal) {
// This is the (easy) common case where the entire payload fits
// on the local page. No overflow is required.
- (*CellInfo)(unsafe.Pointer(pInfo)).FnSize = (U16(nPayload + U32((U16((int32(pIter) - int32(pCell)) / 1)))))
+ (*CellInfo)(unsafe.Pointer(pInfo)).FnSize = U16(nPayload + U32(U16((int32(pIter)-int32(pCell))/1)))
if int32((*CellInfo)(unsafe.Pointer(pInfo)).FnSize) < 4 {
(*CellInfo)(unsafe.Pointer(pInfo)).FnSize = U16(4)
}
@@ -43476,10 +44075,10 @@ func btreeParseCellPtrIndex(tls *libc.TLS, pPage uintptr, pCell uintptr, pInfo u
}
}
-func btreeParseCell(tls *libc.TLS, pPage uintptr, iCell int32, pInfo uintptr) { /* sqlite3.c:66752:13: */
+func btreeParseCell(tls *libc.TLS, pPage uintptr, iCell int32, pInfo uintptr) { /* sqlite3.c:66870:13: */
(*struct {
f func(*libc.TLS, uintptr, uintptr, uintptr)
- })(unsafe.Pointer(&struct{ uintptr }{(*MemPage)(unsafe.Pointer(pPage)).FxParseCell})).f(tls, pPage, ((*MemPage)(unsafe.Pointer((pPage))).FaData + uintptr((int32((*MemPage)(unsafe.Pointer((pPage))).FmaskPage) & int32(libc.X__builtin_bswap16(tls, *(*U16)(unsafe.Pointer(((*MemPage)(unsafe.Pointer((pPage))).FaCellIdx + uintptr((2 * (iCell))))))))))), pInfo)
+ })(unsafe.Pointer(&struct{ uintptr }{(*MemPage)(unsafe.Pointer(pPage)).FxParseCell})).f(tls, pPage, (*MemPage)(unsafe.Pointer(pPage)).FaData+uintptr(int32((*MemPage)(unsafe.Pointer(pPage)).FmaskPage)&int32(libc.X__builtin_bswap16(tls, *(*U16)(unsafe.Pointer((*MemPage)(unsafe.Pointer(pPage)).FaCellIdx + uintptr(2*iCell)))))), pInfo)
}
// The following routines are implementations of the MemPage.xCellSize
@@ -43492,17 +44091,17 @@ func btreeParseCell(tls *libc.TLS, pPage uintptr, iCell int32, pInfo uintptr) {
//
// cellSizePtrNoPayload() => table internal nodes
// cellSizePtr() => all index nodes & table leaf nodes
-func cellSizePtr(tls *libc.TLS, pPage uintptr, pCell uintptr) U16 { /* sqlite3.c:66772:12: */
- var pIter uintptr = (pCell + uintptr((*MemPage)(unsafe.Pointer(pPage)).FchildPtrSize)) // For looping over bytes of pCell
- var pEnd uintptr // End mark for a varint
- var nSize U32 // Size value to return
+func cellSizePtr(tls *libc.TLS, pPage uintptr, pCell uintptr) U16 { /* sqlite3.c:66890:12: */
+ var pIter uintptr = pCell + uintptr((*MemPage)(unsafe.Pointer(pPage)).FchildPtrSize) // For looping over bytes of pCell
+ var pEnd uintptr // End mark for a varint
+ var nSize U32 // Size value to return
nSize = U32(*(*U8)(unsafe.Pointer(pIter)))
if nSize >= U32(0x80) {
- pEnd = (pIter + 8)
- nSize = nSize & (U32(0x7f))
- for ok := true; ok; ok = ((int32(*(*U8)(unsafe.Pointer(pIter))) >= 0x80) && (pIter < pEnd)) {
- nSize = ((nSize << 7) | (U32(int32(*(*U8)(unsafe.Pointer(libc.PreIncUintptr(&pIter, 1)))) & 0x7f)))
+ pEnd = pIter + 8
+ nSize = nSize & U32(0x7f)
+ for ok := true; ok; ok = int32(*(*U8)(unsafe.Pointer(pIter))) >= 0x80 && pIter < pEnd {
+ nSize = nSize<<7 | U32(int32(*(*U8)(unsafe.Pointer(libc.PreIncUintptr(&pIter, 1))))&0x7f)
}
}
pIter++
@@ -43510,47 +44109,47 @@ func cellSizePtr(tls *libc.TLS, pPage uintptr, pCell uintptr) U16 { /* sqlite3.c
// pIter now points at the 64-bit integer key value, a variable length
// integer. The following block moves pIter to point at the first byte
// past the end of the key value.
- pEnd = (pIter + 9)
- for (((int32(*(*U8)(unsafe.Pointer(libc.PostIncUintptr(&pIter, 1))))) & 0x80) != 0) && (pIter < pEnd) {
+ pEnd = pIter + 9
+ for int32(*(*U8)(unsafe.Pointer(libc.PostIncUintptr(&pIter, 1))))&0x80 != 0 && pIter < pEnd {
}
}
if nSize <= U32((*MemPage)(unsafe.Pointer(pPage)).FmaxLocal) {
- nSize = nSize + (U32((int32(pIter) - int32(pCell)) / 1))
+ nSize = nSize + U32((int32(pIter)-int32(pCell))/1)
if nSize < U32(4) {
nSize = U32(4)
}
} else {
var minLocal int32 = int32((*MemPage)(unsafe.Pointer(pPage)).FminLocal)
- nSize = (U32(minLocal) + ((nSize - U32(minLocal)) % ((*BtShared)(unsafe.Pointer((*MemPage)(unsafe.Pointer(pPage)).FpBt)).FusableSize - U32(4))))
+ nSize = U32(minLocal) + (nSize-U32(minLocal))%((*BtShared)(unsafe.Pointer((*MemPage)(unsafe.Pointer(pPage)).FpBt)).FusableSize-U32(4))
if nSize > U32((*MemPage)(unsafe.Pointer(pPage)).FmaxLocal) {
nSize = U32(minLocal)
}
- nSize = nSize + (U32(4 + int32((U16((int32(pIter) - int32(pCell)) / 1)))))
+ nSize = nSize + U32(4+int32(U16((int32(pIter)-int32(pCell))/1)))
}
return U16(nSize)
}
-func cellSizePtrNoPayload(tls *libc.TLS, pPage uintptr, pCell uintptr) U16 { /* sqlite3.c:66820:12: */
- var pIter uintptr = (pCell + uintptr(4)) // For looping over bytes of pCell
- var pEnd uintptr // End mark for a varint
+func cellSizePtrNoPayload(tls *libc.TLS, pPage uintptr, pCell uintptr) U16 { /* sqlite3.c:66938:12: */
+ var pIter uintptr = pCell + uintptr(4) // For looping over bytes of pCell
+ var pEnd uintptr // End mark for a varint
_ = pPage
- pEnd = (pIter + uintptr(9))
- for (((int32(*(*U8)(unsafe.Pointer(libc.PostIncUintptr(&pIter, 1))))) & 0x80) != 0) && (pIter < pEnd) {
+ pEnd = pIter + uintptr(9)
+ for int32(*(*U8)(unsafe.Pointer(libc.PostIncUintptr(&pIter, 1))))&0x80 != 0 && pIter < pEnd {
}
- return (U16((int32(pIter) - int32(pCell)) / 1))
+ return U16((int32(pIter) - int32(pCell)) / 1)
}
// The cell pCell is currently part of page pSrc but will ultimately be part
// of pPage. (pSrc and pPager are often the same.) If pCell contains a
// pointer to an overflow page, insert an entry into the pointer-map for
// the overflow page that will be valid after pCell has been moved to pPage.
-func ptrmapPutOvflPtr(tls *libc.TLS, pPage uintptr, pSrc uintptr, pCell uintptr, pRC uintptr) { /* sqlite3.c:66858:13: */
+func ptrmapPutOvflPtr(tls *libc.TLS, pPage uintptr, pSrc uintptr, pCell uintptr, pRC uintptr) { /* sqlite3.c:66976:13: */
bp := tls.Alloc(24)
defer tls.Free(24)
@@ -43563,14 +44162,14 @@ func ptrmapPutOvflPtr(tls *libc.TLS, pPage uintptr, pSrc uintptr, pCell uintptr,
(*struct {
f func(*libc.TLS, uintptr, uintptr, uintptr)
})(unsafe.Pointer(&struct{ uintptr }{(*MemPage)(unsafe.Pointer(pPage)).FxParseCell})).f(tls, pPage, pCell, bp /* &info */)
- if U32((*CellInfo)(unsafe.Pointer(bp /* &info */)).FnLocal) < (*CellInfo)(unsafe.Pointer(bp /* &info */)).FnPayload {
+ if U32((*CellInfo)(unsafe.Pointer(bp)).FnLocal) < (*CellInfo)(unsafe.Pointer(bp)).FnPayload {
var ovfl Pgno
- if (Uptr(((*MemPage)(unsafe.Pointer(pSrc)).FaDataEnd)) >= Uptr((pCell))) && (Uptr(((*MemPage)(unsafe.Pointer(pSrc)).FaDataEnd)) < Uptr((pCell + uintptr((*CellInfo)(unsafe.Pointer(bp /* &info */)).FnLocal)))) {
+ if Uptr((*MemPage)(unsafe.Pointer(pSrc)).FaDataEnd) >= Uptr(pCell) && Uptr((*MemPage)(unsafe.Pointer(pSrc)).FaDataEnd) < Uptr(pCell+uintptr((*CellInfo)(unsafe.Pointer(bp)).FnLocal)) {
- *(*int32)(unsafe.Pointer(pRC)) = Xsqlite3CorruptError(tls, 66867)
+ *(*int32)(unsafe.Pointer(pRC)) = Xsqlite3CorruptError(tls, 66985)
return
}
- ovfl = Xsqlite3Get4byte(tls, (pCell + uintptr((int32((*CellInfo)(unsafe.Pointer(bp /* &info */)).FnSize) - 4))))
+ ovfl = Xsqlite3Get4byte(tls, pCell+uintptr(int32((*CellInfo)(unsafe.Pointer(bp)).FnSize)-4))
ptrmapPut(tls, (*MemPage)(unsafe.Pointer(pPage)).FpBt, ovfl, uint8(PTRMAP_OVERFLOW1), (*MemPage)(unsafe.Pointer(pPage)).Fpgno, pRC)
}
}
@@ -43585,7 +44184,7 @@ func ptrmapPutOvflPtr(tls *libc.TLS, pPage uintptr, pSrc uintptr, pCell uintptr,
// b-tree page so that there are no freeblocks or fragment bytes, all
// unused bytes are contained in the unallocated space region, and all
// cells are packed tightly at the end of the page.
-func defragmentPage(tls *libc.TLS, pPage uintptr, nMaxFrag int32) int32 { /* sqlite3.c:66889:12: */
+func defragmentPage(tls *libc.TLS, pPage uintptr, nMaxFrag int32) int32 { /* sqlite3.c:67007:12: */
var i int32 // Loop counter
var pc int32 // Address of the i-th cell
var hdr int32 // Offset to the page header
@@ -43615,7 +44214,7 @@ func defragmentPage(tls *libc.TLS, pPage uintptr, nMaxFrag int32) int32 { /* sql
cellOffset = int32((*MemPage)(unsafe.Pointer(pPage)).FcellOffset)
nCell = int32((*MemPage)(unsafe.Pointer(pPage)).FnCell)
- iCellFirst = (cellOffset + (2 * nCell))
+ iCellFirst = cellOffset + 2*nCell
usableSize = int32((*BtShared)(unsafe.Pointer((*MemPage)(unsafe.Pointer(pPage)).FpBt)).FusableSize)
// This block handles pages with two or fewer free blocks and nMaxFrag
@@ -43623,89 +44222,89 @@ func defragmentPage(tls *libc.TLS, pPage uintptr, nMaxFrag int32) int32 { /* sql
// two (or one) blocks of cells using memmove() and add the required
// offsets to each pointer in the cell-pointer array than it is to
// reconstruct the entire page.
- if !(int32(*(*uint8)(unsafe.Pointer(data + uintptr((hdr + 7))))) <= nMaxFrag) {
+ if !(int32(*(*uint8)(unsafe.Pointer(data + uintptr(hdr+7)))) <= nMaxFrag) {
goto __1
}
- iFree = ((int32(*(*uint8)(unsafe.Pointer((data + uintptr((hdr + 1)))))) << 8) | int32(*(*uint8)(unsafe.Pointer((data + uintptr((hdr + 1))) + 1))))
- if !(iFree > (usableSize - 4)) {
+ iFree = int32(*(*uint8)(unsafe.Pointer(data + uintptr(hdr+1))))<<8 | int32(*(*uint8)(unsafe.Pointer(data + uintptr(hdr+1) + 1)))
+ if !(iFree > usableSize-4) {
goto __2
}
- return Xsqlite3CorruptError(tls, 66926)
+ return Xsqlite3CorruptError(tls, 67044)
__2:
;
if !(iFree != 0) {
goto __3
}
- iFree2 = ((int32(*(*uint8)(unsafe.Pointer((data + uintptr(iFree))))) << 8) | int32(*(*uint8)(unsafe.Pointer((data + uintptr(iFree)) + 1))))
- if !(iFree2 > (usableSize - 4)) {
+ iFree2 = int32(*(*uint8)(unsafe.Pointer(data + uintptr(iFree))))<<8 | int32(*(*uint8)(unsafe.Pointer(data + uintptr(iFree) + 1)))
+ if !(iFree2 > usableSize-4) {
goto __4
}
- return Xsqlite3CorruptError(tls, 66929)
+ return Xsqlite3CorruptError(tls, 67047)
__4:
;
- if !((0 == iFree2) || ((int32(*(*uint8)(unsafe.Pointer(data + uintptr(iFree2)))) == 0) && (int32(*(*uint8)(unsafe.Pointer(data + uintptr((iFree2 + 1))))) == 0))) {
+ if !(0 == iFree2 || int32(*(*uint8)(unsafe.Pointer(data + uintptr(iFree2)))) == 0 && int32(*(*uint8)(unsafe.Pointer(data + uintptr(iFree2+1)))) == 0) {
goto __5
}
- pEnd = (data + uintptr((cellOffset + (nCell * 2))))
+ pEnd = data + uintptr(cellOffset+nCell*2)
sz2 = 0
- sz = ((int32(*(*uint8)(unsafe.Pointer((data + uintptr((iFree + 2)))))) << 8) | int32(*(*uint8)(unsafe.Pointer((data + uintptr((iFree + 2))) + 1))))
- top = ((int32(*(*uint8)(unsafe.Pointer((data + uintptr((hdr + 5)))))) << 8) | int32(*(*uint8)(unsafe.Pointer((data + uintptr((hdr + 5))) + 1))))
+ sz = int32(*(*uint8)(unsafe.Pointer(data + uintptr(iFree+2))))<<8 | int32(*(*uint8)(unsafe.Pointer(data + uintptr(iFree+2) + 1)))
+ top = int32(*(*uint8)(unsafe.Pointer(data + uintptr(hdr+5))))<<8 | int32(*(*uint8)(unsafe.Pointer(data + uintptr(hdr+5) + 1)))
if !(top >= iFree) {
goto __6
}
- return Xsqlite3CorruptError(tls, 66937)
+ return Xsqlite3CorruptError(tls, 67055)
__6:
;
if !(iFree2 != 0) {
goto __7
}
- if !((iFree + sz) > iFree2) {
+ if !(iFree+sz > iFree2) {
goto __9
}
- return Xsqlite3CorruptError(tls, 66940)
+ return Xsqlite3CorruptError(tls, 67058)
__9:
;
- sz2 = ((int32(*(*uint8)(unsafe.Pointer((data + uintptr((iFree2 + 2)))))) << 8) | int32(*(*uint8)(unsafe.Pointer((data + uintptr((iFree2 + 2))) + 1))))
- if !((iFree2 + sz2) > usableSize) {
+ sz2 = int32(*(*uint8)(unsafe.Pointer(data + uintptr(iFree2+2))))<<8 | int32(*(*uint8)(unsafe.Pointer(data + uintptr(iFree2+2) + 1)))
+ if !(iFree2+sz2 > usableSize) {
goto __10
}
- return Xsqlite3CorruptError(tls, 66942)
+ return Xsqlite3CorruptError(tls, 67060)
__10:
;
- libc.Xmemmove(tls, (data + uintptr(((iFree + sz) + sz2))), (data + uintptr((iFree + sz))), (uint32(iFree2 - (iFree + sz))))
- sz = sz + (sz2)
+ libc.Xmemmove(tls, data+uintptr(iFree+sz+sz2), data+uintptr(iFree+sz), uint32(iFree2-(iFree+sz)))
+ sz = sz + sz2
goto __8
__7:
- if !((iFree + sz) > usableSize) {
+ if !(iFree+sz > usableSize) {
goto __11
}
- return Xsqlite3CorruptError(tls, 66946)
+ return Xsqlite3CorruptError(tls, 67064)
__11:
;
__8:
;
- cbrk = (top + sz)
+ cbrk = top + sz
- libc.Xmemmove(tls, (data + uintptr(cbrk)), (data + uintptr(top)), (uint32(iFree - top)))
- pAddr = (data + uintptr(cellOffset))
+ libc.Xmemmove(tls, data+uintptr(cbrk), data+uintptr(top), uint32(iFree-top))
+ pAddr = data + uintptr(cellOffset)
__12:
if !(pAddr < pEnd) {
goto __14
}
- pc = ((int32(*(*U8)(unsafe.Pointer((pAddr)))) << 8) | int32(*(*U8)(unsafe.Pointer((pAddr) + 1))))
+ pc = int32(*(*U8)(unsafe.Pointer(pAddr)))<<8 | int32(*(*U8)(unsafe.Pointer(pAddr + 1)))
if !(pc < iFree) {
goto __15
}
- *(*U8)(unsafe.Pointer((pAddr))) = (U8((pc + sz) >> 8))
- *(*U8)(unsafe.Pointer((pAddr) + 1)) = (U8(pc + sz))
+ *(*U8)(unsafe.Pointer(pAddr)) = U8((pc + sz) >> 8)
+ *(*U8)(unsafe.Pointer(pAddr + 1)) = U8(pc + sz)
goto __16
__15:
if !(pc < iFree2) {
goto __17
}
- *(*U8)(unsafe.Pointer((pAddr))) = (U8((pc + sz2) >> 8))
- *(*U8)(unsafe.Pointer((pAddr) + 1)) = (U8(pc + sz2))
+ *(*U8)(unsafe.Pointer(pAddr)) = U8((pc + sz2) >> 8)
+ *(*U8)(unsafe.Pointer(pAddr + 1)) = U8(pc + sz2)
__17:
;
__16:
@@ -43726,38 +44325,38 @@ __1:
;
cbrk = usableSize
- iCellLast = (usableSize - 4)
- iCellStart = ((int32(*(*uint8)(unsafe.Pointer((data + uintptr((hdr + 5)))))) << 8) | int32(*(*uint8)(unsafe.Pointer((data + uintptr((hdr + 5))) + 1))))
+ iCellLast = usableSize - 4
+ iCellStart = int32(*(*uint8)(unsafe.Pointer(data + uintptr(hdr+5))))<<8 | int32(*(*uint8)(unsafe.Pointer(data + uintptr(hdr+5) + 1)))
i = 0
__18:
if !(i < nCell) {
goto __20
} // The i-th cell pointer
- pAddr1 = (data + uintptr((cellOffset + (i * 2))))
- pc = ((int32(*(*U8)(unsafe.Pointer((pAddr1)))) << 8) | int32(*(*U8)(unsafe.Pointer((pAddr1) + 1))))
+ pAddr1 = data + uintptr(cellOffset+i*2)
+ pc = int32(*(*U8)(unsafe.Pointer(pAddr1)))<<8 | int32(*(*U8)(unsafe.Pointer(pAddr1 + 1)))
// These conditions have already been verified in btreeInitPage()
// if PRAGMA cell_size_check=ON.
- if !((pc < iCellStart) || (pc > iCellLast)) {
+ if !(pc < iCellStart || pc > iCellLast) {
goto __21
}
- return Xsqlite3CorruptError(tls, 66975)
+ return Xsqlite3CorruptError(tls, 67093)
__21:
;
size = int32((*struct {
f func(*libc.TLS, uintptr, uintptr) U16
- })(unsafe.Pointer(&struct{ uintptr }{(*MemPage)(unsafe.Pointer(pPage)).FxCellSize})).f(tls, pPage, (src + uintptr(pc))))
- cbrk = cbrk - (size)
- if !((cbrk < iCellStart) || ((pc + size) > usableSize)) {
+ })(unsafe.Pointer(&struct{ uintptr }{(*MemPage)(unsafe.Pointer(pPage)).FxCellSize})).f(tls, pPage, src+uintptr(pc)))
+ cbrk = cbrk - size
+ if !(cbrk < iCellStart || pc+size > usableSize) {
goto __22
}
- return Xsqlite3CorruptError(tls, 66981)
+ return Xsqlite3CorruptError(tls, 67099)
__22:
;
- *(*U8)(unsafe.Pointer((pAddr1))) = (U8((cbrk) >> 8))
- *(*U8)(unsafe.Pointer((pAddr1) + 1)) = U8(cbrk)
+ *(*U8)(unsafe.Pointer(pAddr1)) = U8(cbrk >> 8)
+ *(*U8)(unsafe.Pointer(pAddr1 + 1)) = U8(cbrk)
if !(temp == uintptr(0)) {
goto __23
}
@@ -43768,11 +44367,11 @@ __22:
__24:
;
temp = Xsqlite3PagerTempSpace(tls, (*BtShared)(unsafe.Pointer((*MemPage)(unsafe.Pointer(pPage)).FpBt)).FpPager)
- libc.Xmemcpy(tls, (temp + uintptr(iCellStart)), (data + uintptr(iCellStart)), (uint32(usableSize - iCellStart)))
+ libc.Xmemcpy(tls, temp+uintptr(iCellStart), data+uintptr(iCellStart), uint32(usableSize-iCellStart))
src = temp
__23:
;
- libc.Xmemcpy(tls, (data + uintptr(cbrk)), (src + uintptr(pc)), uint32(size))
+ libc.Xmemcpy(tls, data+uintptr(cbrk), src+uintptr(pc), uint32(size))
goto __19
__19:
i++
@@ -43780,22 +44379,22 @@ __19:
goto __20
__20:
;
- *(*uint8)(unsafe.Pointer(data + uintptr((hdr + 7)))) = uint8(0)
+ *(*uint8)(unsafe.Pointer(data + uintptr(hdr+7))) = uint8(0)
defragment_out:
;
- if !(((int32(*(*uint8)(unsafe.Pointer(data + uintptr((hdr + 7))))) + cbrk) - iCellFirst) != (*MemPage)(unsafe.Pointer(pPage)).FnFree) {
+ if !(int32(*(*uint8)(unsafe.Pointer(data + uintptr(hdr+7))))+cbrk-iCellFirst != (*MemPage)(unsafe.Pointer(pPage)).FnFree) {
goto __25
}
- return Xsqlite3CorruptError(tls, 67000)
+ return Xsqlite3CorruptError(tls, 67118)
__25:
;
- *(*uint8)(unsafe.Pointer((data + uintptr((hdr + 5))))) = (U8((cbrk) >> 8))
- *(*uint8)(unsafe.Pointer((data + uintptr((hdr + 5))) + 1)) = U8(cbrk)
- *(*uint8)(unsafe.Pointer(data + uintptr((hdr + 1)))) = uint8(0)
- *(*uint8)(unsafe.Pointer(data + uintptr((hdr + 2)))) = uint8(0)
- libc.Xmemset(tls, (data + uintptr(iCellFirst)), 0, (uint32(cbrk - iCellFirst)))
+ *(*uint8)(unsafe.Pointer(data + uintptr(hdr+5))) = U8(cbrk >> 8)
+ *(*uint8)(unsafe.Pointer(data + uintptr(hdr+5) + 1)) = U8(cbrk)
+ *(*uint8)(unsafe.Pointer(data + uintptr(hdr+1))) = uint8(0)
+ *(*uint8)(unsafe.Pointer(data + uintptr(hdr+2))) = uint8(0)
+ libc.Xmemset(tls, data+uintptr(iCellFirst), 0, uint32(cbrk-iCellFirst))
return SQLITE_OK
}
@@ -43812,58 +44411,58 @@ __25:
// Slots on the free list that are between 1 and 3 bytes larger than nByte
// will be ignored if adding the extra space to the fragmentation count
// causes the fragmentation count to exceed 60.
-func pageFindSlot(tls *libc.TLS, pPg uintptr, nByte int32, pRc uintptr) uintptr { /* sqlite3.c:67025:11: */
- var hdr int32 = int32((*MemPage)(unsafe.Pointer(pPg)).FhdrOffset) // Offset to page header
- var aData uintptr = (*MemPage)(unsafe.Pointer(pPg)).FaData // Page data
- var iAddr int32 = (hdr + 1) // Address of ptr to pc
- var pc int32 = ((int32(*(*U8)(unsafe.Pointer((aData + uintptr(iAddr))))) << 8) | int32(*(*U8)(unsafe.Pointer((aData + uintptr(iAddr)) + 1)))) // Address of a free slot
- var x int32 // Excess size of the slot
- var maxPC int32 = (int32((*BtShared)(unsafe.Pointer((*MemPage)(unsafe.Pointer(pPg)).FpBt)).FusableSize - U32(nByte))) // Max address for a usable slot
- var size int32 // Size of the free slot
+func pageFindSlot(tls *libc.TLS, pPg uintptr, nByte int32, pRc uintptr) uintptr { /* sqlite3.c:67143:11: */
+ var hdr int32 = int32((*MemPage)(unsafe.Pointer(pPg)).FhdrOffset) // Offset to page header
+ var aData uintptr = (*MemPage)(unsafe.Pointer(pPg)).FaData // Page data
+ var iAddr int32 = hdr + 1 // Address of ptr to pc
+ var pc int32 = int32(*(*U8)(unsafe.Pointer(aData + uintptr(iAddr))))<<8 | int32(*(*U8)(unsafe.Pointer(aData + uintptr(iAddr) + 1))) // Address of a free slot
+ var x int32 // Excess size of the slot
+ var maxPC int32 = int32((*BtShared)(unsafe.Pointer((*MemPage)(unsafe.Pointer(pPg)).FpBt)).FusableSize - U32(nByte)) // Max address for a usable slot
+ var size int32 // Size of the free slot
for pc <= maxPC {
// EVIDENCE-OF: R-22710-53328 The third and fourth bytes of each
// freeblock form a big-endian integer which is the size of the freeblock
// in bytes, including the 4-byte header.
- size = ((int32(*(*U8)(unsafe.Pointer((aData + uintptr((pc + 2)))))) << 8) | int32(*(*U8)(unsafe.Pointer((aData + uintptr((pc + 2))) + 1))))
- if (libc.AssignInt32(&x, (size - nByte))) >= 0 {
+ size = int32(*(*U8)(unsafe.Pointer(aData + uintptr(pc+2))))<<8 | int32(*(*U8)(unsafe.Pointer(aData + uintptr(pc+2) + 1)))
+ if libc.AssignInt32(&x, size-nByte) >= 0 {
if x < 4 {
// EVIDENCE-OF: R-11498-58022 In a well-formed b-tree page, the total
// number of bytes in fragments may not exceed 60.
- if int32(*(*U8)(unsafe.Pointer(aData + uintptr((hdr + 7))))) > 57 {
+ if int32(*(*U8)(unsafe.Pointer(aData + uintptr(hdr+7)))) > 57 {
return uintptr(0)
}
// Remove the slot from the free-list. Update the number of
// fragmented bytes within the page.
- libc.Xmemcpy(tls, (aData + uintptr(iAddr)), (aData + uintptr(pc)), uint32(2))
- *(*U8)(unsafe.Pointer(aData + uintptr((hdr + 7)))) += U8((int32(U8(x))))
- } else if (x + pc) > maxPC {
+ libc.Xmemcpy(tls, aData+uintptr(iAddr), aData+uintptr(pc), uint32(2))
+ *(*U8)(unsafe.Pointer(aData + uintptr(hdr+7))) += U8(int32(U8(x)))
+ } else if x+pc > maxPC {
// This slot extends off the end of the usable part of the page
- *(*int32)(unsafe.Pointer(pRc)) = Xsqlite3CorruptError(tls, 67054)
+ *(*int32)(unsafe.Pointer(pRc)) = Xsqlite3CorruptError(tls, 67172)
return uintptr(0)
} else {
// The slot remains on the free-list. Reduce its size to account
// for the portion used by the new allocation.
- *(*U8)(unsafe.Pointer((aData + uintptr((pc + 2))))) = (U8((x) >> 8))
- *(*U8)(unsafe.Pointer((aData + uintptr((pc + 2))) + 1)) = U8(x)
+ *(*U8)(unsafe.Pointer(aData + uintptr(pc+2))) = U8(x >> 8)
+ *(*U8)(unsafe.Pointer(aData + uintptr(pc+2) + 1)) = U8(x)
}
- return (aData + uintptr((pc + x)))
+ return aData + uintptr(pc+x)
}
iAddr = pc
- pc = ((int32(*(*U8)(unsafe.Pointer((aData + uintptr(pc))))) << 8) | int32(*(*U8)(unsafe.Pointer((aData + uintptr(pc)) + 1))))
- if pc <= (iAddr + size) {
+ pc = int32(*(*U8)(unsafe.Pointer(aData + uintptr(pc))))<<8 | int32(*(*U8)(unsafe.Pointer(aData + uintptr(pc) + 1)))
+ if pc <= iAddr+size {
if pc != 0 {
// The next slot in the chain is not past the end of the current slot
- *(*int32)(unsafe.Pointer(pRc)) = Xsqlite3CorruptError(tls, 67068)
+ *(*int32)(unsafe.Pointer(pRc)) = Xsqlite3CorruptError(tls, 67186)
}
return uintptr(0)
}
}
- if pc > ((maxPC + nByte) - 4) {
+ if pc > maxPC+nByte-4 {
// The free slot chain extends off the end of the page
- *(*int32)(unsafe.Pointer(pRc)) = Xsqlite3CorruptError(tls, 67075)
+ *(*int32)(unsafe.Pointer(pRc)) = Xsqlite3CorruptError(tls, 67193)
}
return uintptr(0)
}
@@ -43879,7 +44478,7 @@ func pageFindSlot(tls *libc.TLS, pPg uintptr, nByte int32, pRc uintptr) uintptr
// the first two bytes past the cell pointer area since presumably this
// allocation is being made in order to insert a new cell, so we will
// also end up needing a new cell pointer.
-func allocateSpace(tls *libc.TLS, pPage uintptr, nByte int32, pIdx uintptr) int32 { /* sqlite3.c:67093:12: */
+func allocateSpace(tls *libc.TLS, pPage uintptr, nByte int32, pIdx uintptr) int32 { /* sqlite3.c:67211:12: */
bp := tls.Alloc(4)
defer tls.Free(4)
@@ -43891,20 +44490,20 @@ func allocateSpace(tls *libc.TLS, pPage uintptr, nByte int32, pIdx uintptr) int3
// Minimum cell size is 4
- gap = (int32((*MemPage)(unsafe.Pointer(pPage)).FcellOffset) + (2 * int32((*MemPage)(unsafe.Pointer(pPage)).FnCell)))
+ gap = int32((*MemPage)(unsafe.Pointer(pPage)).FcellOffset) + 2*int32((*MemPage)(unsafe.Pointer(pPage)).FnCell)
// EVIDENCE-OF: R-29356-02391 If the database uses a 65536-byte page size
// and the reserved space is zero (the usual value for reserved space)
// then the cell content offset of an empty page wants to be 65536.
// However, that integer is too large to be stored in a 2-byte unsigned
// integer, so a value of 0 is used in its place.
- top = ((int32(*(*U8)(unsafe.Pointer((data + uintptr((hdr + 5)))))) << 8) | int32(*(*U8)(unsafe.Pointer((data + uintptr((hdr + 5))) + 1))))
+ top = int32(*(*U8)(unsafe.Pointer(data + uintptr(hdr+5))))<<8 | int32(*(*U8)(unsafe.Pointer(data + uintptr(hdr+5) + 1)))
// by btreeComputeFreeSpace()
if gap > top {
- if (top == 0) && ((*BtShared)(unsafe.Pointer((*MemPage)(unsafe.Pointer(pPage)).FpBt)).FusableSize == U32(65536)) {
+ if top == 0 && (*BtShared)(unsafe.Pointer((*MemPage)(unsafe.Pointer(pPage)).FpBt)).FusableSize == U32(65536) {
top = 65536
} else {
- return Xsqlite3CorruptError(tls, 67122)
+ return Xsqlite3CorruptError(tls, 67240)
}
}
@@ -43912,18 +44511,18 @@ func allocateSpace(tls *libc.TLS, pPage uintptr, nByte int32, pIdx uintptr) int3
// and if the freelist is not empty, then search the
// freelist looking for a slot big enough to satisfy the request.
- if ((*(*U8)(unsafe.Pointer(data + uintptr((hdr + 2)))) != 0) || (*(*U8)(unsafe.Pointer(data + uintptr((hdr + 1)))) != 0)) && ((gap + 2) <= top) {
+ if (*(*U8)(unsafe.Pointer(data + uintptr(hdr+2))) != 0 || *(*U8)(unsafe.Pointer(data + uintptr(hdr+1))) != 0) && gap+2 <= top {
var pSpace uintptr = pageFindSlot(tls, pPage, nByte, bp /* &rc */)
if pSpace != 0 {
var g2 int32
- *(*int32)(unsafe.Pointer(pIdx)) = libc.AssignInt32(&g2, ((int32(pSpace) - int32(data)) / 1))
+ *(*int32)(unsafe.Pointer(pIdx)) = libc.AssignInt32(&g2, (int32(pSpace)-int32(data))/1)
if g2 <= gap {
- return Xsqlite3CorruptError(tls, 67140)
+ return Xsqlite3CorruptError(tls, 67258)
} else {
return SQLITE_OK
}
- } else if *(*int32)(unsafe.Pointer(bp /* rc */)) != 0 {
+ } else if *(*int32)(unsafe.Pointer(bp)) != 0 {
return *(*int32)(unsafe.Pointer(bp /* rc */))
}
}
@@ -43931,18 +44530,18 @@ func allocateSpace(tls *libc.TLS, pPage uintptr, nByte int32, pIdx uintptr) int3
// The request could not be fulfilled using a freelist slot. Check
// to see if defragmentation is necessary.
- if ((gap + 2) + nByte) > top {
+ if gap+2+nByte > top {
*(*int32)(unsafe.Pointer(bp /* rc */)) = defragmentPage(tls, pPage, func() int32 {
- if (4) < ((*MemPage)(unsafe.Pointer(pPage)).FnFree - (2 + nByte)) {
+ if 4 < (*MemPage)(unsafe.Pointer(pPage)).FnFree-(2+nByte) {
return 4
}
- return ((*MemPage)(unsafe.Pointer(pPage)).FnFree - (2 + nByte))
+ return (*MemPage)(unsafe.Pointer(pPage)).FnFree - (2 + nByte)
}())
- if *(*int32)(unsafe.Pointer(bp /* rc */)) != 0 {
+ if *(*int32)(unsafe.Pointer(bp)) != 0 {
return *(*int32)(unsafe.Pointer(bp /* rc */))
}
- top = (((((int32(*(*U8)(unsafe.Pointer((data + uintptr((hdr + 5)))))) << 8) | int32(*(*U8)(unsafe.Pointer((data + uintptr((hdr + 5))) + 1)))) - 1) & 0xffff) + 1)
+ top = (int32(*(*U8)(unsafe.Pointer(data + uintptr(hdr+5))))<<8|int32(*(*U8)(unsafe.Pointer(data + uintptr(hdr+5) + 1)))-1)&0xffff + 1
}
@@ -43951,9 +44550,9 @@ func allocateSpace(tls *libc.TLS, pPage uintptr, nByte int32, pIdx uintptr) int3
// validated the freelist. Given that the freelist is valid, there
// is no way that the allocation can extend off the end of the page.
// The assert() below verifies the previous sentence.
- top = top - (nByte)
- *(*U8)(unsafe.Pointer((data + uintptr((hdr + 5))))) = (U8((top) >> 8))
- *(*U8)(unsafe.Pointer((data + uintptr((hdr + 5))) + 1)) = U8(top)
+ top = top - nByte
+ *(*U8)(unsafe.Pointer(data + uintptr(hdr+5))) = U8(top >> 8)
+ *(*U8)(unsafe.Pointer(data + uintptr(hdr+5) + 1)) = U8(top)
*(*int32)(unsafe.Pointer(pIdx)) = top
return SQLITE_OK
@@ -43970,14 +44569,14 @@ func allocateSpace(tls *libc.TLS, pPage uintptr, nByte int32, pIdx uintptr) int3
// does it detect cells or freeblocks that encrouch into the reserved bytes
// at the end of the page. So do additional corruption checks inside this
// routine and return SQLITE_CORRUPT if any problems are found.
-func freeSpace(tls *libc.TLS, pPage uintptr, iStart U16, iSize U16) int32 { /* sqlite3.c:67189:12: */
+func freeSpace(tls *libc.TLS, pPage uintptr, iStart U16, iSize U16) int32 { /* sqlite3.c:67307:12: */
var iPtr U16 // Address of ptr to next freeblock
var iFreeBlk U16 // Address of the next freeblock
var hdr U8 // Page header size. 0 or 100
var nFrag U8 = U8(0) // Reduction in fragmentation
var iOrigSize U16 = iSize // Original value of iSize
var x U16 // Offset to cell content area
- var iEnd U32 = (U32(int32(iStart) + int32(iSize))) // First byte past the iStart buffer
+ var iEnd U32 = U32(int32(iStart) + int32(iSize)) // First byte past the iStart buffer
var data uintptr = (*MemPage)(unsafe.Pointer(pPage)).FaData // Page content
// Minimum cell size is 4
@@ -43985,21 +44584,21 @@ func freeSpace(tls *libc.TLS, pPage uintptr, iStart U16, iSize U16) int32 { /* s
// The list of freeblocks must be in ascending order. Find the
// spot on the list where iStart should be inserted.
hdr = (*MemPage)(unsafe.Pointer(pPage)).FhdrOffset
- iPtr = (U16(int32(hdr) + 1))
- if (int32(*(*uint8)(unsafe.Pointer(data + uintptr((int32(iPtr) + 1))))) == 0) && (int32(*(*uint8)(unsafe.Pointer(data + uintptr(iPtr)))) == 0) {
+ iPtr = U16(int32(hdr) + 1)
+ if int32(*(*uint8)(unsafe.Pointer(data + uintptr(int32(iPtr)+1)))) == 0 && int32(*(*uint8)(unsafe.Pointer(data + uintptr(iPtr)))) == 0 {
iFreeBlk = U16(0) // Shortcut for the case when the freelist is empty
} else {
- for (int32(libc.AssignUint16(&iFreeBlk, (U16((int32(*(*uint8)(unsafe.Pointer((data + uintptr(iPtr))))) << 8) | int32(*(*uint8)(unsafe.Pointer((data + uintptr(iPtr)) + 1)))))))) < int32(iStart) {
- if int32(iFreeBlk) < (int32(iPtr) + 4) {
+ for int32(libc.AssignUint16(&iFreeBlk, U16(int32(*(*uint8)(unsafe.Pointer(data + uintptr(iPtr))))<<8|int32(*(*uint8)(unsafe.Pointer(data + uintptr(iPtr) + 1)))))) < int32(iStart) {
+ if int32(iFreeBlk) < int32(iPtr)+4 {
if int32(iFreeBlk) == 0 {
break
} // TH3: corrupt082.100
- return Xsqlite3CorruptError(tls, 67218)
+ return Xsqlite3CorruptError(tls, 67336)
}
iPtr = iFreeBlk
}
- if U32(iFreeBlk) > ((*BtShared)(unsafe.Pointer((*MemPage)(unsafe.Pointer(pPage)).FpBt)).FusableSize - U32(4)) { // TH3: corrupt081.100
- return Xsqlite3CorruptError(tls, 67223)
+ if U32(iFreeBlk) > (*BtShared)(unsafe.Pointer((*MemPage)(unsafe.Pointer(pPage)).FpBt)).FusableSize-U32(4) { // TH3: corrupt081.100
+ return Xsqlite3CorruptError(tls, 67341)
}
// At this point:
@@ -44007,68 +44606,68 @@ func freeSpace(tls *libc.TLS, pPage uintptr, iStart U16, iSize U16) int32 { /* s
// iPtr: The address of a pointer to iFreeBlk
//
// Check to see if iFreeBlk should be coalesced onto the end of iStart.
- if (iFreeBlk != 0) && ((iEnd + U32(3)) >= U32(iFreeBlk)) {
- nFrag = (U8(U32(iFreeBlk) - iEnd))
+ if iFreeBlk != 0 && iEnd+U32(3) >= U32(iFreeBlk) {
+ nFrag = U8(U32(iFreeBlk) - iEnd)
if iEnd > U32(iFreeBlk) {
- return Xsqlite3CorruptError(tls, 67235)
+ return Xsqlite3CorruptError(tls, 67353)
}
- iEnd = (U32(int32(iFreeBlk) + ((int32(*(*uint8)(unsafe.Pointer((data + uintptr((int32(iFreeBlk) + 2)))))) << 8) | int32(*(*uint8)(unsafe.Pointer((data + uintptr((int32(iFreeBlk) + 2))) + 1))))))
+ iEnd = U32(int32(iFreeBlk) + (int32(*(*uint8)(unsafe.Pointer(data + uintptr(int32(iFreeBlk)+2))))<<8 | int32(*(*uint8)(unsafe.Pointer(data + uintptr(int32(iFreeBlk)+2) + 1)))))
if iEnd > (*BtShared)(unsafe.Pointer((*MemPage)(unsafe.Pointer(pPage)).FpBt)).FusableSize {
- return Xsqlite3CorruptError(tls, 67238)
+ return Xsqlite3CorruptError(tls, 67356)
}
- iSize = (U16(iEnd - U32(iStart)))
- iFreeBlk = (U16((int32(*(*uint8)(unsafe.Pointer((data + uintptr(iFreeBlk))))) << 8) | int32(*(*uint8)(unsafe.Pointer((data + uintptr(iFreeBlk)) + 1)))))
+ iSize = U16(iEnd - U32(iStart))
+ iFreeBlk = U16(int32(*(*uint8)(unsafe.Pointer(data + uintptr(iFreeBlk))))<<8 | int32(*(*uint8)(unsafe.Pointer(data + uintptr(iFreeBlk) + 1))))
}
// If iPtr is another freeblock (that is, if iPtr is not the freelist
// pointer in the page header) then check to see if iStart should be
// coalesced onto the end of iPtr.
- if int32(iPtr) > (int32(hdr) + 1) {
- var iPtrEnd int32 = (int32(iPtr) + ((int32(*(*uint8)(unsafe.Pointer((data + uintptr((int32(iPtr) + 2)))))) << 8) | int32(*(*uint8)(unsafe.Pointer((data + uintptr((int32(iPtr) + 2))) + 1)))))
- if (iPtrEnd + 3) >= int32(iStart) {
+ if int32(iPtr) > int32(hdr)+1 {
+ var iPtrEnd int32 = int32(iPtr) + (int32(*(*uint8)(unsafe.Pointer(data + uintptr(int32(iPtr)+2))))<<8 | int32(*(*uint8)(unsafe.Pointer(data + uintptr(int32(iPtr)+2) + 1))))
+ if iPtrEnd+3 >= int32(iStart) {
if iPtrEnd > int32(iStart) {
- return Xsqlite3CorruptError(tls, 67251)
+ return Xsqlite3CorruptError(tls, 67369)
}
nFrag = U8(int32(nFrag) + (int32(iStart) - iPtrEnd))
- iSize = (U16(iEnd - U32(iPtr)))
+ iSize = U16(iEnd - U32(iPtr))
iStart = iPtr
}
}
- if int32(nFrag) > int32(*(*uint8)(unsafe.Pointer(data + uintptr((int32(hdr) + 7))))) {
- return Xsqlite3CorruptError(tls, 67257)
+ if int32(nFrag) > int32(*(*uint8)(unsafe.Pointer(data + uintptr(int32(hdr)+7)))) {
+ return Xsqlite3CorruptError(tls, 67375)
}
- *(*uint8)(unsafe.Pointer(data + uintptr((int32(hdr) + 7)))) -= uint8((int32(nFrag)))
+ *(*uint8)(unsafe.Pointer(data + uintptr(int32(hdr)+7))) -= uint8(int32(nFrag))
}
- x = (U16((int32(*(*uint8)(unsafe.Pointer((data + uintptr((int32(hdr) + 5)))))) << 8) | int32(*(*uint8)(unsafe.Pointer((data + uintptr((int32(hdr) + 5))) + 1)))))
+ x = U16(int32(*(*uint8)(unsafe.Pointer(data + uintptr(int32(hdr)+5))))<<8 | int32(*(*uint8)(unsafe.Pointer(data + uintptr(int32(hdr)+5) + 1))))
if int32(iStart) <= int32(x) {
// The new freeblock is at the beginning of the cell content area,
// so just extend the cell content area rather than create another
// freelist entry
if int32(iStart) < int32(x) {
- return Xsqlite3CorruptError(tls, 67265)
+ return Xsqlite3CorruptError(tls, 67383)
}
- if int32(iPtr) != (int32(hdr) + 1) {
- return Xsqlite3CorruptError(tls, 67266)
+ if int32(iPtr) != int32(hdr)+1 {
+ return Xsqlite3CorruptError(tls, 67384)
}
- *(*uint8)(unsafe.Pointer((data + uintptr((int32(hdr) + 1))))) = (U8((int32(iFreeBlk)) >> 8))
- *(*uint8)(unsafe.Pointer((data + uintptr((int32(hdr) + 1))) + 1)) = U8(iFreeBlk)
- *(*uint8)(unsafe.Pointer((data + uintptr((int32(hdr) + 5))))) = (U8((iEnd) >> 8))
- *(*uint8)(unsafe.Pointer((data + uintptr((int32(hdr) + 5))) + 1)) = U8(iEnd)
+ *(*uint8)(unsafe.Pointer(data + uintptr(int32(hdr)+1))) = U8(int32(iFreeBlk) >> 8)
+ *(*uint8)(unsafe.Pointer(data + uintptr(int32(hdr)+1) + 1)) = U8(iFreeBlk)
+ *(*uint8)(unsafe.Pointer(data + uintptr(int32(hdr)+5))) = U8(iEnd >> 8)
+ *(*uint8)(unsafe.Pointer(data + uintptr(int32(hdr)+5) + 1)) = U8(iEnd)
} else {
// Insert the new freeblock into the freelist
- *(*uint8)(unsafe.Pointer((data + uintptr(iPtr)))) = (U8((int32(iStart)) >> 8))
- *(*uint8)(unsafe.Pointer((data + uintptr(iPtr)) + 1)) = U8(iStart)
+ *(*uint8)(unsafe.Pointer(data + uintptr(iPtr))) = U8(int32(iStart) >> 8)
+ *(*uint8)(unsafe.Pointer(data + uintptr(iPtr) + 1)) = U8(iStart)
}
- if (int32((*BtShared)(unsafe.Pointer((*MemPage)(unsafe.Pointer(pPage)).FpBt)).FbtsFlags) & BTS_FAST_SECURE) != 0 {
+ if int32((*BtShared)(unsafe.Pointer((*MemPage)(unsafe.Pointer(pPage)).FpBt)).FbtsFlags)&BTS_FAST_SECURE != 0 {
// Overwrite deleted information with zeros when the secure_delete
// option is enabled
- libc.Xmemset(tls, (data + uintptr(iStart)), 0, uint32(iSize))
+ libc.Xmemset(tls, data+uintptr(iStart), 0, uint32(iSize))
}
- *(*uint8)(unsafe.Pointer((data + uintptr(iStart)))) = (U8((int32(iFreeBlk)) >> 8))
- *(*uint8)(unsafe.Pointer((data + uintptr(iStart)) + 1)) = U8(iFreeBlk)
- *(*uint8)(unsafe.Pointer((data + uintptr((int32(iStart) + 2))))) = (U8((int32(iSize)) >> 8))
- *(*uint8)(unsafe.Pointer((data + uintptr((int32(iStart) + 2))) + 1)) = U8(iSize)
- *(*int32)(unsafe.Pointer(pPage + 20 /* &.nFree */)) += (int32(iOrigSize))
+ *(*uint8)(unsafe.Pointer(data + uintptr(iStart))) = U8(int32(iFreeBlk) >> 8)
+ *(*uint8)(unsafe.Pointer(data + uintptr(iStart) + 1)) = U8(iFreeBlk)
+ *(*uint8)(unsafe.Pointer(data + uintptr(int32(iStart)+2))) = U8(int32(iSize) >> 8)
+ *(*uint8)(unsafe.Pointer(data + uintptr(int32(iStart)+2) + 1)) = U8(iSize)
+ *(*int32)(unsafe.Pointer(pPage + 20)) += int32(iOrigSize)
return SQLITE_OK
}
@@ -44082,17 +44681,17 @@ func freeSpace(tls *libc.TLS, pPage uintptr, iStart U16, iSize U16) int32 { /* s
// PTF_ZERODATA | PTF_LEAF
// PTF_LEAFDATA | PTF_INTKEY
// PTF_LEAFDATA | PTF_INTKEY | PTF_LEAF
-func decodeFlags(tls *libc.TLS, pPage uintptr, flagByte int32) int32 { /* sqlite3.c:67296:12: */
+func decodeFlags(tls *libc.TLS, pPage uintptr, flagByte int32) int32 { /* sqlite3.c:67414:12: */
var pBt uintptr // A copy of pPage->pBt
- (*MemPage)(unsafe.Pointer(pPage)).Fleaf = (U8(flagByte >> 3))
- flagByte = flagByte & (libc.CplInt32(PTF_LEAF))
- (*MemPage)(unsafe.Pointer(pPage)).FchildPtrSize = (U8(4 - (4 * int32((*MemPage)(unsafe.Pointer(pPage)).Fleaf))))
+ (*MemPage)(unsafe.Pointer(pPage)).Fleaf = U8(flagByte >> 3)
+ flagByte = flagByte & libc.CplInt32(PTF_LEAF)
+ (*MemPage)(unsafe.Pointer(pPage)).FchildPtrSize = U8(4 - 4*int32((*MemPage)(unsafe.Pointer(pPage)).Fleaf))
(*MemPage)(unsafe.Pointer(pPage)).FxCellSize = *(*uintptr)(unsafe.Pointer(&struct {
f func(*libc.TLS, uintptr, uintptr) U16
}{cellSizePtr}))
pBt = (*MemPage)(unsafe.Pointer(pPage)).FpBt
- if flagByte == (PTF_LEAFDATA | PTF_INTKEY) {
+ if flagByte == PTF_LEAFDATA|PTF_INTKEY {
// EVIDENCE-OF: R-07291-35328 A value of 5 (0x05) means the page is an
// interior table b-tree page.
@@ -44133,7 +44732,7 @@ func decodeFlags(tls *libc.TLS, pPage uintptr, flagByte int32) int32 { /* sqlite
} else {
// EVIDENCE-OF: R-47608-56469 Any other value for the b-tree page type is
// an error.
- return Xsqlite3CorruptError(tls, 67339)
+ return Xsqlite3CorruptError(tls, 67457)
}
(*MemPage)(unsafe.Pointer(pPage)).Fmax1bytePayload = (*BtShared)(unsafe.Pointer(pBt)).Fmax1bytePayload
return SQLITE_OK
@@ -44141,7 +44740,7 @@ func decodeFlags(tls *libc.TLS, pPage uintptr, flagByte int32) int32 { /* sqlite
// Compute the amount of freespace on the page. In other words, fill
// in the pPage->nFree field.
-func btreeComputeFreeSpace(tls *libc.TLS, pPage uintptr) int32 { /* sqlite3.c:67349:12: */
+func btreeComputeFreeSpace(tls *libc.TLS, pPage uintptr) int32 { /* sqlite3.c:67467:12: */
var pc int32 // Address of a freeblock within pPage->aData[]
var hdr U8 // Offset to beginning of page header
var data uintptr // Equal to pPage->aData
@@ -44157,44 +44756,44 @@ func btreeComputeFreeSpace(tls *libc.TLS, pPage uintptr) int32 { /* sqlite3.c:67
// EVIDENCE-OF: R-58015-48175 The two-byte integer at offset 5 designates
// the start of the cell content area. A zero value for this integer is
// interpreted as 65536.
- top = (((((int32(*(*U8)(unsafe.Pointer((data + uintptr((int32(hdr) + 5)))))) << 8) | int32(*(*U8)(unsafe.Pointer((data + uintptr((int32(hdr) + 5))) + 1)))) - 1) & 0xffff) + 1)
- iCellFirst = (((int32(hdr) + 8) + int32((*MemPage)(unsafe.Pointer(pPage)).FchildPtrSize)) + (2 * int32((*MemPage)(unsafe.Pointer(pPage)).FnCell)))
- iCellLast = (usableSize - 4)
+ top = (int32(*(*U8)(unsafe.Pointer(data + uintptr(int32(hdr)+5))))<<8|int32(*(*U8)(unsafe.Pointer(data + uintptr(int32(hdr)+5) + 1)))-1)&0xffff + 1
+ iCellFirst = int32(hdr) + 8 + int32((*MemPage)(unsafe.Pointer(pPage)).FchildPtrSize) + 2*int32((*MemPage)(unsafe.Pointer(pPage)).FnCell)
+ iCellLast = usableSize - 4
// Compute the total free space on the page
// EVIDENCE-OF: R-23588-34450 The two-byte integer at offset 1 gives the
// start of the first freeblock on the page, or is zero if there are no
// freeblocks.
- pc = ((int32(*(*U8)(unsafe.Pointer((data + uintptr((int32(hdr) + 1)))))) << 8) | int32(*(*U8)(unsafe.Pointer((data + uintptr((int32(hdr) + 1))) + 1))))
- nFree = (int32(*(*U8)(unsafe.Pointer(data + uintptr((int32(hdr) + 7))))) + top) // Init nFree to non-freeblock free space
+ pc = int32(*(*U8)(unsafe.Pointer(data + uintptr(int32(hdr)+1))))<<8 | int32(*(*U8)(unsafe.Pointer(data + uintptr(int32(hdr)+1) + 1)))
+ nFree = int32(*(*U8)(unsafe.Pointer(data + uintptr(int32(hdr)+7)))) + top // Init nFree to non-freeblock free space
if pc > 0 {
var next U32
var size U32
if pc < top {
// EVIDENCE-OF: R-55530-52930 In a well-formed b-tree page, there will
// always be at least one cell before the first freeblock.
- return Xsqlite3CorruptError(tls, 67390)
+ return Xsqlite3CorruptError(tls, 67508)
}
for 1 != 0 {
if pc > iCellLast {
// Freeblock off the end of the page
- return Xsqlite3CorruptError(tls, 67395)
+ return Xsqlite3CorruptError(tls, 67513)
}
- next = (U32((int32(*(*U8)(unsafe.Pointer((data + uintptr(pc))))) << 8) | int32(*(*U8)(unsafe.Pointer((data + uintptr(pc)) + 1)))))
- size = (U32((int32(*(*U8)(unsafe.Pointer((data + uintptr((pc + 2)))))) << 8) | int32(*(*U8)(unsafe.Pointer((data + uintptr((pc + 2))) + 1)))))
- nFree = (int32(U32(nFree) + size))
- if next <= ((U32(pc) + size) + U32(3)) {
+ next = U32(int32(*(*U8)(unsafe.Pointer(data + uintptr(pc))))<<8 | int32(*(*U8)(unsafe.Pointer(data + uintptr(pc) + 1))))
+ size = U32(int32(*(*U8)(unsafe.Pointer(data + uintptr(pc+2))))<<8 | int32(*(*U8)(unsafe.Pointer(data + uintptr(pc+2) + 1))))
+ nFree = int32(U32(nFree) + size)
+ if next <= U32(pc)+size+U32(3) {
break
}
pc = int32(next)
}
if next > U32(0) {
// Freeblock not in ascending order
- return Xsqlite3CorruptError(tls, 67405)
+ return Xsqlite3CorruptError(tls, 67523)
}
- if (U32(pc) + size) > uint32(usableSize) {
+ if U32(pc)+size > uint32(usableSize) {
// Last freeblock extends past page end
- return Xsqlite3CorruptError(tls, 67409)
+ return Xsqlite3CorruptError(tls, 67527)
}
}
@@ -44204,16 +44803,16 @@ func btreeComputeFreeSpace(tls *libc.TLS, pPage uintptr) int32 { /* sqlite3.c:67
// of the page, then the page must be corrupted. This check also
// serves to verify that the offset to the start of the cell-content
// area, according to the page header, lies within the page.
- if (nFree > usableSize) || (nFree < iCellFirst) {
- return Xsqlite3CorruptError(tls, 67421)
+ if nFree > usableSize || nFree < iCellFirst {
+ return Xsqlite3CorruptError(tls, 67539)
}
- (*MemPage)(unsafe.Pointer(pPage)).FnFree = int32((U16(nFree - iCellFirst)))
+ (*MemPage)(unsafe.Pointer(pPage)).FnFree = int32(U16(nFree - iCellFirst))
return SQLITE_OK
}
// Do additional sanity check after btreeInitPage() if
// PRAGMA cell_size_check=ON
-func btreeCellSizeCheck(tls *libc.TLS, pPage uintptr) int32 { /* sqlite3.c:67431:28: */
+func btreeCellSizeCheck(tls *libc.TLS, pPage uintptr) int32 { /* sqlite3.c:67549:28: */
var iCellFirst int32 // First allowable cell or freeblock offset
var iCellLast int32 // Last possible cell or freeblock offset
var i int32 // Index into the cell pointer array
@@ -44223,26 +44822,26 @@ func btreeCellSizeCheck(tls *libc.TLS, pPage uintptr) int32 { /* sqlite3.c:67431
var usableSize int32 // Maximum usable space on the page
var cellOffset int32 // Start of cell content area
- iCellFirst = (int32((*MemPage)(unsafe.Pointer(pPage)).FcellOffset) + (2 * int32((*MemPage)(unsafe.Pointer(pPage)).FnCell)))
+ iCellFirst = int32((*MemPage)(unsafe.Pointer(pPage)).FcellOffset) + 2*int32((*MemPage)(unsafe.Pointer(pPage)).FnCell)
usableSize = int32((*BtShared)(unsafe.Pointer((*MemPage)(unsafe.Pointer(pPage)).FpBt)).FusableSize)
- iCellLast = (usableSize - 4)
+ iCellLast = usableSize - 4
data = (*MemPage)(unsafe.Pointer(pPage)).FaData
cellOffset = int32((*MemPage)(unsafe.Pointer(pPage)).FcellOffset)
if !(int32((*MemPage)(unsafe.Pointer(pPage)).Fleaf) != 0) {
iCellLast--
}
for i = 0; i < int32((*MemPage)(unsafe.Pointer(pPage)).FnCell); i++ {
- pc = int32(libc.X__builtin_bswap16(tls, *(*U16)(unsafe.Pointer((data + uintptr((cellOffset + (i * 2))))))))
+ pc = int32(libc.X__builtin_bswap16(tls, *(*U16)(unsafe.Pointer(data + uintptr(cellOffset+i*2)))))
- if (pc < iCellFirst) || (pc > iCellLast) {
- return Xsqlite3CorruptError(tls, 67452)
+ if pc < iCellFirst || pc > iCellLast {
+ return Xsqlite3CorruptError(tls, 67570)
}
sz = int32((*struct {
f func(*libc.TLS, uintptr, uintptr) U16
- })(unsafe.Pointer(&struct{ uintptr }{(*MemPage)(unsafe.Pointer(pPage)).FxCellSize})).f(tls, pPage, (data + uintptr(pc))))
+ })(unsafe.Pointer(&struct{ uintptr }{(*MemPage)(unsafe.Pointer(pPage)).FxCellSize})).f(tls, pPage, data+uintptr(pc)))
- if (pc + sz) > usableSize {
- return Xsqlite3CorruptError(tls, 67457)
+ if pc+sz > usableSize {
+ return Xsqlite3CorruptError(tls, 67575)
}
}
return SQLITE_OK
@@ -44255,30 +44854,30 @@ func btreeCellSizeCheck(tls *libc.TLS, pPage uintptr) int32 { /* sqlite3.c:67431
// SQLITE_CORRUPT. Note that a return of SQLITE_OK does not
// guarantee that the page is well-formed. It only shows that
// we failed to detect any corruption.
-func btreeInitPage(tls *libc.TLS, pPage uintptr) int32 { /* sqlite3.c:67472:12: */
+func btreeInitPage(tls *libc.TLS, pPage uintptr) int32 { /* sqlite3.c:67590:12: */
var data uintptr // Equal to pPage->aData
var pBt uintptr // The main btree structure
pBt = (*MemPage)(unsafe.Pointer(pPage)).FpBt
- data = ((*MemPage)(unsafe.Pointer(pPage)).FaData + uintptr((*MemPage)(unsafe.Pointer(pPage)).FhdrOffset))
+ data = (*MemPage)(unsafe.Pointer(pPage)).FaData + uintptr((*MemPage)(unsafe.Pointer(pPage)).FhdrOffset)
// EVIDENCE-OF: R-28594-02890 The one-byte flag at offset 0 indicating
// the b-tree page type.
if decodeFlags(tls, pPage, int32(*(*U8)(unsafe.Pointer(data)))) != 0 {
- return Xsqlite3CorruptError(tls, 67489)
+ return Xsqlite3CorruptError(tls, 67607)
}
- (*MemPage)(unsafe.Pointer(pPage)).FmaskPage = (U16((*BtShared)(unsafe.Pointer(pBt)).FpageSize - U32(1)))
+ (*MemPage)(unsafe.Pointer(pPage)).FmaskPage = U16((*BtShared)(unsafe.Pointer(pBt)).FpageSize - U32(1))
(*MemPage)(unsafe.Pointer(pPage)).FnOverflow = U8(0)
- (*MemPage)(unsafe.Pointer(pPage)).FcellOffset = (U16((int32((*MemPage)(unsafe.Pointer(pPage)).FhdrOffset) + 8) + int32((*MemPage)(unsafe.Pointer(pPage)).FchildPtrSize)))
- (*MemPage)(unsafe.Pointer(pPage)).FaCellIdx = ((data + uintptr((*MemPage)(unsafe.Pointer(pPage)).FchildPtrSize)) + uintptr(8))
- (*MemPage)(unsafe.Pointer(pPage)).FaDataEnd = ((*MemPage)(unsafe.Pointer(pPage)).FaData + uintptr((*BtShared)(unsafe.Pointer(pBt)).FusableSize))
- (*MemPage)(unsafe.Pointer(pPage)).FaDataOfst = ((*MemPage)(unsafe.Pointer(pPage)).FaData + uintptr((*MemPage)(unsafe.Pointer(pPage)).FchildPtrSize))
+ (*MemPage)(unsafe.Pointer(pPage)).FcellOffset = U16(int32((*MemPage)(unsafe.Pointer(pPage)).FhdrOffset) + 8 + int32((*MemPage)(unsafe.Pointer(pPage)).FchildPtrSize))
+ (*MemPage)(unsafe.Pointer(pPage)).FaCellIdx = data + uintptr((*MemPage)(unsafe.Pointer(pPage)).FchildPtrSize) + uintptr(8)
+ (*MemPage)(unsafe.Pointer(pPage)).FaDataEnd = (*MemPage)(unsafe.Pointer(pPage)).FaData + uintptr((*BtShared)(unsafe.Pointer(pBt)).FusableSize)
+ (*MemPage)(unsafe.Pointer(pPage)).FaDataOfst = (*MemPage)(unsafe.Pointer(pPage)).FaData + uintptr((*MemPage)(unsafe.Pointer(pPage)).FchildPtrSize)
// EVIDENCE-OF: R-37002-32774 The two-byte integer at offset 3 gives the
// number of cells on the page.
- (*MemPage)(unsafe.Pointer(pPage)).FnCell = (U16((int32(*(*U8)(unsafe.Pointer((data + 3)))) << 8) | int32(*(*U8)(unsafe.Pointer((data + 3) + 1)))))
- if U32((*MemPage)(unsafe.Pointer(pPage)).FnCell) > (((*BtShared)(unsafe.Pointer(pBt)).FpageSize - U32(8)) / U32(6)) {
+ (*MemPage)(unsafe.Pointer(pPage)).FnCell = U16(int32(*(*U8)(unsafe.Pointer(data + 3)))<<8 | int32(*(*U8)(unsafe.Pointer(data + 3 + 1))))
+ if U32((*MemPage)(unsafe.Pointer(pPage)).FnCell) > ((*BtShared)(unsafe.Pointer(pBt)).FpageSize-U32(8))/U32(6) {
// To many cells for a single page. The page must be corrupt
- return Xsqlite3CorruptError(tls, 67503)
+ return Xsqlite3CorruptError(tls, 67621)
}
// EVIDENCE-OF: R-24089-57979 If a page contains no cells (which is only
@@ -44288,7 +44887,7 @@ func btreeInitPage(tls *libc.TLS, pPage uintptr) int32 { /* sqlite3.c:67472:12:
(*MemPage)(unsafe.Pointer(pPage)).FnFree = -1 // Indicate that this value is yet uncomputed
(*MemPage)(unsafe.Pointer(pPage)).FisInit = U8(1)
- if ((*Sqlite3)(unsafe.Pointer((*BtShared)(unsafe.Pointer(pBt)).Fdb)).Fflags & uint64(SQLITE_CellSizeCk)) != 0 {
+ if (*Sqlite3)(unsafe.Pointer((*BtShared)(unsafe.Pointer(pBt)).Fdb)).Fflags&uint64(SQLITE_CellSizeCk) != 0 {
return btreeCellSizeCheck(tls, pPage)
}
return SQLITE_OK
@@ -44296,42 +44895,42 @@ func btreeInitPage(tls *libc.TLS, pPage uintptr) int32 { /* sqlite3.c:67472:12:
// Set up a raw page so that it looks like a database page holding
// no entries.
-func zeroPage(tls *libc.TLS, pPage uintptr, flags int32) { /* sqlite3.c:67525:13: */
+func zeroPage(tls *libc.TLS, pPage uintptr, flags int32) { /* sqlite3.c:67643:13: */
var data uintptr = (*MemPage)(unsafe.Pointer(pPage)).FaData
var pBt uintptr = (*MemPage)(unsafe.Pointer(pPage)).FpBt
var hdr U8 = (*MemPage)(unsafe.Pointer(pPage)).FhdrOffset
var first U16
- if (int32((*BtShared)(unsafe.Pointer(pBt)).FbtsFlags) & BTS_FAST_SECURE) != 0 {
- libc.Xmemset(tls, (data + uintptr(hdr)), 0, ((*BtShared)(unsafe.Pointer(pBt)).FusableSize - U32(hdr)))
+ if int32((*BtShared)(unsafe.Pointer(pBt)).FbtsFlags)&BTS_FAST_SECURE != 0 {
+ libc.Xmemset(tls, data+uintptr(hdr), 0, (*BtShared)(unsafe.Pointer(pBt)).FusableSize-U32(hdr))
}
*(*uint8)(unsafe.Pointer(data + uintptr(hdr))) = uint8(uint8(flags))
- first = (U16(int32(hdr) + (func() int32 {
- if (flags & PTF_LEAF) == 0 {
+ first = U16(int32(hdr) + func() int32 {
+ if flags&PTF_LEAF == 0 {
return 12
}
return 8
- }())))
- libc.Xmemset(tls, (data + uintptr((int32(hdr) + 1))), 0, uint32(4))
- *(*uint8)(unsafe.Pointer(data + uintptr((int32(hdr) + 7)))) = uint8(0)
- *(*uint8)(unsafe.Pointer((data + uintptr((int32(hdr) + 5))))) = (U8(((*BtShared)(unsafe.Pointer(pBt)).FusableSize) >> 8))
- *(*uint8)(unsafe.Pointer((data + uintptr((int32(hdr) + 5))) + 1)) = U8((*BtShared)(unsafe.Pointer(pBt)).FusableSize)
- (*MemPage)(unsafe.Pointer(pPage)).FnFree = int32((U16((*BtShared)(unsafe.Pointer(pBt)).FusableSize - U32(first))))
+ }())
+ libc.Xmemset(tls, data+uintptr(int32(hdr)+1), 0, uint32(4))
+ *(*uint8)(unsafe.Pointer(data + uintptr(int32(hdr)+7))) = uint8(0)
+ *(*uint8)(unsafe.Pointer(data + uintptr(int32(hdr)+5))) = U8((*BtShared)(unsafe.Pointer(pBt)).FusableSize >> 8)
+ *(*uint8)(unsafe.Pointer(data + uintptr(int32(hdr)+5) + 1)) = U8((*BtShared)(unsafe.Pointer(pBt)).FusableSize)
+ (*MemPage)(unsafe.Pointer(pPage)).FnFree = int32(U16((*BtShared)(unsafe.Pointer(pBt)).FusableSize - U32(first)))
decodeFlags(tls, pPage, flags)
(*MemPage)(unsafe.Pointer(pPage)).FcellOffset = first
- (*MemPage)(unsafe.Pointer(pPage)).FaDataEnd = (data + uintptr((*BtShared)(unsafe.Pointer(pBt)).FusableSize))
- (*MemPage)(unsafe.Pointer(pPage)).FaCellIdx = (data + uintptr(first))
- (*MemPage)(unsafe.Pointer(pPage)).FaDataOfst = (data + uintptr((*MemPage)(unsafe.Pointer(pPage)).FchildPtrSize))
+ (*MemPage)(unsafe.Pointer(pPage)).FaDataEnd = data + uintptr((*BtShared)(unsafe.Pointer(pBt)).FusableSize)
+ (*MemPage)(unsafe.Pointer(pPage)).FaCellIdx = data + uintptr(first)
+ (*MemPage)(unsafe.Pointer(pPage)).FaDataOfst = data + uintptr((*MemPage)(unsafe.Pointer(pPage)).FchildPtrSize)
(*MemPage)(unsafe.Pointer(pPage)).FnOverflow = U8(0)
- (*MemPage)(unsafe.Pointer(pPage)).FmaskPage = (U16((*BtShared)(unsafe.Pointer(pBt)).FpageSize - U32(1)))
+ (*MemPage)(unsafe.Pointer(pPage)).FmaskPage = U16((*BtShared)(unsafe.Pointer(pBt)).FpageSize - U32(1))
(*MemPage)(unsafe.Pointer(pPage)).FnCell = U16(0)
(*MemPage)(unsafe.Pointer(pPage)).FisInit = U8(1)
}
// Convert a DbPage obtained from the pager into a MemPage used by
// the btree layer.
-func btreePageFromDbPage(tls *libc.TLS, pDbPage uintptr, pgno Pgno, pBt uintptr) uintptr { /* sqlite3.c:67562:16: */
+func btreePageFromDbPage(tls *libc.TLS, pDbPage uintptr, pgno Pgno, pBt uintptr) uintptr { /* sqlite3.c:67680:16: */
var pPage uintptr = Xsqlite3PagerGetExtra(tls, pDbPage)
if pgno != (*MemPage)(unsafe.Pointer(pPage)).Fpgno {
(*MemPage)(unsafe.Pointer(pPage)).FaData = Xsqlite3PagerGetData(tls, pDbPage)
@@ -44358,7 +44957,7 @@ func btreePageFromDbPage(tls *libc.TLS, pDbPage uintptr, pgno Pgno, pBt uintptr)
// If in the future we call sqlite3PagerWrite() on this page, that
// means we have started to be concerned about content and the disk
// read should occur at that point.
-func btreeGetPage(tls *libc.TLS, pBt uintptr, pgno Pgno, ppPage uintptr, flags int32) int32 { /* sqlite3.c:67586:12: */
+func btreeGetPage(tls *libc.TLS, pBt uintptr, pgno Pgno, ppPage uintptr, flags int32) int32 { /* sqlite3.c:67704:12: */
bp := tls.Alloc(4)
defer tls.Free(4)
@@ -44376,7 +44975,7 @@ func btreeGetPage(tls *libc.TLS, pBt uintptr, pgno Pgno, ppPage uintptr, flags i
// Retrieve a page from the pager cache. If the requested page is not
// already in the pager cache return NULL. Initialize the MemPage.pBt and
// MemPage.aData elements if needed.
-func btreePageLookup(tls *libc.TLS, pBt uintptr, pgno Pgno) uintptr { /* sqlite3.c:67608:16: */
+func btreePageLookup(tls *libc.TLS, pBt uintptr, pgno Pgno) uintptr { /* sqlite3.c:67726:16: */
var pDbPage uintptr
pDbPage = Xsqlite3PagerLookup(tls, (*BtShared)(unsafe.Pointer(pBt)).FpPager, pgno)
@@ -44388,11 +44987,11 @@ func btreePageLookup(tls *libc.TLS, pBt uintptr, pgno Pgno) uintptr { /* sqlite3
// Return the size of the database file in pages. If there is any kind of
// error, return ((unsigned int)-1).
-func btreePagecount(tls *libc.TLS, pBt uintptr) Pgno { /* sqlite3.c:67622:13: */
+func btreePagecount(tls *libc.TLS, pBt uintptr) Pgno { /* sqlite3.c:67740:13: */
return (*BtShared)(unsafe.Pointer(pBt)).FnPage
}
-func Xsqlite3BtreeLastPage(tls *libc.TLS, p uintptr) Pgno { /* sqlite3.c:67625:21: */
+func Xsqlite3BtreeLastPage(tls *libc.TLS, p uintptr) Pgno { /* sqlite3.c:67743:21: */
return btreePagecount(tls, (*Btree)(unsafe.Pointer(p)).FpBt)
}
@@ -44408,7 +45007,7 @@ func Xsqlite3BtreeLastPage(tls *libc.TLS, p uintptr) Pgno { /* sqlite3.c:67625:2
//
// If an error occurs, then *ppPage is undefined. It
// may remain unchanged, or it may be set to an invalid value.
-func getAndInitPage(tls *libc.TLS, pBt uintptr, pgno Pgno, ppPage uintptr, pCur uintptr, bReadOnly int32) int32 { /* sqlite3.c:67643:12: */
+func getAndInitPage(tls *libc.TLS, pBt uintptr, pgno Pgno, ppPage uintptr, pCur uintptr, bReadOnly int32) int32 { /* sqlite3.c:67761:12: */
bp := tls.Alloc(4)
defer tls.Free(4)
@@ -44418,7 +45017,7 @@ func getAndInitPage(tls *libc.TLS, pBt uintptr, pgno Pgno, ppPage uintptr, pCur
if !(pgno > btreePagecount(tls, pBt)) {
goto __1
}
- rc = Xsqlite3CorruptError(tls, 67658)
+ rc = Xsqlite3CorruptError(tls, 67776)
goto getAndInitPage_error1
__1:
;
@@ -44430,7 +45029,7 @@ __1:
__2:
;
*(*uintptr)(unsafe.Pointer(ppPage)) = Xsqlite3PagerGetExtra(tls, *(*uintptr)(unsafe.Pointer(bp /* pDbPage */)))
- if !(int32((*MemPage)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(ppPage))))).FisInit) == 0) {
+ if !(int32((*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(ppPage)))).FisInit) == 0) {
goto __3
}
btreePageFromDbPage(tls, *(*uintptr)(unsafe.Pointer(bp /* pDbPage */)), pgno, pBt)
@@ -44446,10 +45045,10 @@ __3:
// If obtaining a child page for a cursor, we must verify that the page is
// compatible with the root page.
- if !((pCur != 0) && ((int32((*MemPage)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(ppPage))))).FnCell) < 1) || (int32((*MemPage)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(ppPage))))).FintKey) != int32((*BtCursor)(unsafe.Pointer(pCur)).FcurIntKey)))) {
+ if !(pCur != 0 && (int32((*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(ppPage)))).FnCell) < 1 || int32((*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(ppPage)))).FintKey) != int32((*BtCursor)(unsafe.Pointer(pCur)).FcurIntKey))) {
goto __5
}
- rc = Xsqlite3CorruptError(tls, 67679)
+ rc = Xsqlite3CorruptError(tls, 67797)
goto getAndInitPage_error2
__5:
;
@@ -44462,7 +45061,7 @@ getAndInitPage_error1:
goto __6
}
(*BtCursor)(unsafe.Pointer(pCur)).FiPage--
- (*BtCursor)(unsafe.Pointer(pCur)).FpPage = *(*uintptr)(unsafe.Pointer((pCur + 120 /* &.apPage */) + uintptr((*BtCursor)(unsafe.Pointer(pCur)).FiPage)*4))
+ (*BtCursor)(unsafe.Pointer(pCur)).FpPage = *(*uintptr)(unsafe.Pointer(pCur + 120 + uintptr((*BtCursor)(unsafe.Pointer(pCur)).FiPage)*4))
__6:
;
@@ -44473,18 +45072,18 @@ __6:
// call to btreeGetPage.
//
// Page1 is a special case and must be released using releasePageOne().
-func releasePageNotNull(tls *libc.TLS, pPage uintptr) { /* sqlite3.c:67702:13: */
+func releasePageNotNull(tls *libc.TLS, pPage uintptr) { /* sqlite3.c:67820:13: */
Xsqlite3PagerUnrefNotNull(tls, (*MemPage)(unsafe.Pointer(pPage)).FpDbPage)
}
-func releasePage(tls *libc.TLS, pPage uintptr) { /* sqlite3.c:67711:13: */
+func releasePage(tls *libc.TLS, pPage uintptr) { /* sqlite3.c:67829:13: */
if pPage != 0 {
releasePageNotNull(tls, pPage)
}
}
-func releasePageOne(tls *libc.TLS, pPage uintptr) { /* sqlite3.c:67714:13: */
+func releasePageOne(tls *libc.TLS, pPage uintptr) { /* sqlite3.c:67832:13: */
Xsqlite3PagerUnrefPageOne(tls, (*MemPage)(unsafe.Pointer(pPage)).FpDbPage)
}
@@ -44496,13 +45095,13 @@ func releasePageOne(tls *libc.TLS, pPage uintptr) { /* sqlite3.c:67714:13: */
// * If the page is already in use for some other purpose, immediately
// release it and return an SQLITE_CURRUPT error.
// * Make sure the isInit flag is clear
-func btreeGetUnusedPage(tls *libc.TLS, pBt uintptr, pgno Pgno, ppPage uintptr, flags int32) int32 { /* sqlite3.c:67734:12: */
+func btreeGetUnusedPage(tls *libc.TLS, pBt uintptr, pgno Pgno, ppPage uintptr, flags int32) int32 { /* sqlite3.c:67852:12: */
var rc int32 = btreeGetPage(tls, pBt, pgno, ppPage, flags)
if rc == SQLITE_OK {
if Xsqlite3PagerPageRefcount(tls, (*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(ppPage)))).FpDbPage) > 1 {
releasePage(tls, *(*uintptr)(unsafe.Pointer(ppPage)))
*(*uintptr)(unsafe.Pointer(ppPage)) = uintptr(0)
- return Xsqlite3CorruptError(tls, 67745)
+ return Xsqlite3CorruptError(tls, 67863)
}
(*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(ppPage)))).FisInit = U8(0)
} else {
@@ -44517,7 +45116,7 @@ func btreeGetUnusedPage(tls *libc.TLS, pBt uintptr, pgno Pgno, ppPage uintptr, f
//
// This routine needs to reset the extra data section at the end of the
// page to agree with the restored data.
-func pageReinit(tls *libc.TLS, pData uintptr) { /* sqlite3.c:67763:13: */
+func pageReinit(tls *libc.TLS, pData uintptr) { /* sqlite3.c:67881:13: */
var pPage uintptr
pPage = Xsqlite3PagerGetExtra(tls, pData)
@@ -44537,10 +45136,10 @@ func pageReinit(tls *libc.TLS, pData uintptr) { /* sqlite3.c:67763:13: */
}
// Invoke the busy handler for a btree.
-func btreeInvokeBusyHandler(tls *libc.TLS, pArg uintptr) int32 { /* sqlite3.c:67785:12: */
+func btreeInvokeBusyHandler(tls *libc.TLS, pArg uintptr) int32 { /* sqlite3.c:67903:12: */
var pBt uintptr = pArg
- return Xsqlite3InvokeBusyHandler(tls, ((*BtShared)(unsafe.Pointer(pBt)).Fdb + 436 /* &.busyHandler */))
+ return Xsqlite3InvokeBusyHandler(tls, (*BtShared)(unsafe.Pointer(pBt)).Fdb+460)
}
// Open a database file.
@@ -44562,7 +45161,7 @@ func btreeInvokeBusyHandler(tls *libc.TLS, pArg uintptr) int32 { /* sqlite3.c:67
// SQLITE_CONSTRAINT error. We cannot allow two or more BtShared
// objects in the same database connection since doing so will lead
// to problems with locking.
-func Xsqlite3BtreeOpen(tls *libc.TLS, pVfs uintptr, zFilename uintptr, db uintptr, ppBtree uintptr, flags int32, vfsFlags int32) int32 { /* sqlite3.c:67813:20: */
+func Xsqlite3BtreeOpen(tls *libc.TLS, pVfs uintptr, zFilename uintptr, db uintptr, ppBtree uintptr, flags int32, vfsFlags int32) int32 { /* sqlite3.c:67931:20: */
bp := tls.Alloc(100)
defer tls.Free(100)
@@ -44593,10 +45192,10 @@ func Xsqlite3BtreeOpen(tls *libc.TLS, pVfs uintptr, zFilename uintptr, db uintpt
pBt = uintptr(0)
mutexOpen = uintptr(0)
rc = SQLITE_OK
- isTempDb = (libc.Bool32((zFilename == uintptr(0)) || (int32(*(*uint8)(unsafe.Pointer(zFilename))) == 0)))
- isMemdb = (libc.Bool32((((zFilename != 0) && (libc.Xstrcmp(tls, zFilename, ts+3158 /* ":memory:" */) == 0)) ||
- ((isTempDb != 0) && (Xsqlite3TempInMemory(tls, db) != 0))) ||
- ((vfsFlags & SQLITE_OPEN_MEMORY) != 0)))
+ isTempDb = libc.Bool32(zFilename == uintptr(0) || int32(*(*uint8)(unsafe.Pointer(zFilename))) == 0)
+ isMemdb = libc.Bool32(zFilename != 0 && libc.Xstrcmp(tls, zFilename, ts+3969) == 0 ||
+ isTempDb != 0 && Xsqlite3TempInMemory(tls, db) != 0 ||
+ vfsFlags&SQLITE_OPEN_MEMORY != 0)
// flags fit in 8 bits
@@ -44607,17 +45206,17 @@ func Xsqlite3BtreeOpen(tls *libc.TLS, pVfs uintptr, zFilename uintptr, db uintpt
if !(isMemdb != 0) {
goto __1
}
- flags = flags | (BTREE_MEMORY)
+ flags = flags | BTREE_MEMORY
__1:
;
- if !(((vfsFlags & SQLITE_OPEN_MAIN_DB) != 0) && ((isMemdb != 0) || (isTempDb != 0))) {
+ if !(vfsFlags&SQLITE_OPEN_MAIN_DB != 0 && (isMemdb != 0 || isTempDb != 0)) {
goto __2
}
- vfsFlags = ((vfsFlags & libc.CplInt32(SQLITE_OPEN_MAIN_DB)) | SQLITE_OPEN_TEMP_DB)
+ vfsFlags = vfsFlags&libc.CplInt32(SQLITE_OPEN_MAIN_DB) | SQLITE_OPEN_TEMP_DB
__2:
;
p = Xsqlite3MallocZero(tls, uint64(unsafe.Sizeof(Btree{})))
- if !(!(p != 0)) {
+ if !!(p != 0) {
goto __3
}
return SQLITE_NOMEM
@@ -44630,23 +45229,23 @@ __3:
// If this Btree is a candidate for shared cache, try to find an
// existing BtShared object that we can share with
- if !((isTempDb == 0) && ((isMemdb == 0) || ((vfsFlags & SQLITE_OPEN_URI) != 0))) {
+ if !(isTempDb == 0 && (isMemdb == 0 || vfsFlags&SQLITE_OPEN_URI != 0)) {
goto __4
}
- if !((vfsFlags & SQLITE_OPEN_SHAREDCACHE) != 0) {
+ if !(vfsFlags&SQLITE_OPEN_SHAREDCACHE != 0) {
goto __5
}
- nFilename = (Xsqlite3Strlen30(tls, zFilename) + 1)
- nFullPathname = ((*Sqlite3_vfs)(unsafe.Pointer(pVfs)).FmxPathname + 1)
+ nFilename = Xsqlite3Strlen30(tls, zFilename) + 1
+ nFullPathname = (*Sqlite3_vfs)(unsafe.Pointer(pVfs)).FmxPathname + 1
zFullPathname = Xsqlite3Malloc(tls, func() uint64 {
- if (nFullPathname) > (nFilename) {
+ if nFullPathname > nFilename {
return uint64(nFullPathname)
}
return uint64(nFilename)
}())
(*Btree)(unsafe.Pointer(p)).Fsharable = U8(1)
- if !(!(zFullPathname != 0)) {
+ if !!(zFullPathname != 0) {
goto __6
}
Xsqlite3_free(tls, p)
@@ -44664,7 +45263,7 @@ __7:
if !(rc != 0) {
goto __9
}
- if !(rc == (SQLITE_OK | (int32(2) << 8))) {
+ if !(rc == SQLITE_OK|int32(2)<<8) {
goto __10
}
rc = SQLITE_OK
@@ -44689,17 +45288,17 @@ __12:
goto __14
}
- if !((0 == libc.Xstrcmp(tls, zFullPathname, Xsqlite3PagerFilename(tls, (*BtShared)(unsafe.Pointer(pBt)).FpPager, 0))) &&
- (Xsqlite3PagerVfs(tls, (*BtShared)(unsafe.Pointer(pBt)).FpPager) == pVfs)) {
+ if !(0 == libc.Xstrcmp(tls, zFullPathname, Xsqlite3PagerFilename(tls, (*BtShared)(unsafe.Pointer(pBt)).FpPager, 0)) &&
+ Xsqlite3PagerVfs(tls, (*BtShared)(unsafe.Pointer(pBt)).FpPager) == pVfs) {
goto __15
}
- iDb = ((*Sqlite3)(unsafe.Pointer(db)).FnDb - 1)
+ iDb = (*Sqlite3)(unsafe.Pointer(db)).FnDb - 1
__16:
if !(iDb >= 0) {
goto __18
}
pExisting = (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*16)).FpBt
- if !((pExisting != 0) && ((*Btree)(unsafe.Pointer(pExisting)).FpBt == pBt)) {
+ if !(pExisting != 0 && (*Btree)(unsafe.Pointer(pExisting)).FpBt == pBt) {
goto __19
}
Xsqlite3_mutex_leave(tls, mutexShared)
@@ -44749,7 +45348,7 @@ __4:
goto btree_open_out
__21:
;
- rc = Xsqlite3PagerOpen(tls, pVfs, (pBt /* &.pPager */), zFilename,
+ rc = Xsqlite3PagerOpen(tls, pVfs, pBt, zFilename,
int32(unsafe.Sizeof(MemPage{})), flags, vfsFlags, *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{pageReinit})))
if !(rc == SQLITE_OK) {
goto __22
@@ -44776,15 +45375,15 @@ __23:
if !(Xsqlite3PagerIsreadonly(tls, (*BtShared)(unsafe.Pointer(pBt)).FpPager) != 0) {
goto __24
}
- *(*U16)(unsafe.Pointer(pBt + 24 /* &.btsFlags */)) |= U16((BTS_READ_ONLY))
+ *(*U16)(unsafe.Pointer(pBt + 24)) |= U16(BTS_READ_ONLY)
__24:
;
// EVIDENCE-OF: R-51873-39618 The page size for a database file is
// determined by the 2-byte integer located at an offset of 16 bytes from
// the beginning of the database file.
- (*BtShared)(unsafe.Pointer(pBt)).FpageSize = (U32((int32(*(*uint8)(unsafe.Pointer(bp /* &zDbHeader[0] */ + 16))) << 8) | (int32(*(*uint8)(unsafe.Pointer(bp /* &zDbHeader[0] */ + 17))) << 16)))
- if !((((*BtShared)(unsafe.Pointer(pBt)).FpageSize < U32(512)) || ((*BtShared)(unsafe.Pointer(pBt)).FpageSize > U32(SQLITE_MAX_PAGE_SIZE))) ||
- ((((*BtShared)(unsafe.Pointer(pBt)).FpageSize - U32(1)) & (*BtShared)(unsafe.Pointer(pBt)).FpageSize) != U32(0))) {
+ (*BtShared)(unsafe.Pointer(pBt)).FpageSize = U32(int32(*(*uint8)(unsafe.Pointer(bp + 16)))<<8 | int32(*(*uint8)(unsafe.Pointer(bp + 17)))<<16)
+ if !((*BtShared)(unsafe.Pointer(pBt)).FpageSize < U32(512) || (*BtShared)(unsafe.Pointer(pBt)).FpageSize > U32(SQLITE_MAX_PAGE_SIZE) ||
+ ((*BtShared)(unsafe.Pointer(pBt)).FpageSize-U32(1))&(*BtShared)(unsafe.Pointer(pBt)).FpageSize != U32(0)) {
goto __25
}
(*BtShared)(unsafe.Pointer(pBt)).FpageSize = U32(0)
@@ -44793,7 +45392,7 @@ __24:
// SQLITE_DEFAULT_AUTOVACUUM is true. On the other hand, if
// SQLITE_OMIT_MEMORYDB has been defined, then ":memory:" is just a
// regular file-name. In this case the auto-vacuum applies as per normal.
- if !((zFilename != 0) && !(isMemdb != 0)) {
+ if !(zFilename != 0 && !(isMemdb != 0)) {
goto __27
}
(*BtShared)(unsafe.Pointer(pBt)).FautoVacuum = func() uint8 {
@@ -44817,29 +45416,29 @@ __25:
// determined by the one-byte unsigned integer found at an offset of 20
// into the database file header.
nReserve = *(*uint8)(unsafe.Pointer(bp /* &zDbHeader[0] */ + 20))
- *(*U16)(unsafe.Pointer(pBt + 24 /* &.btsFlags */)) |= U16((BTS_PAGESIZE_FIXED))
+ *(*U16)(unsafe.Pointer(pBt + 24)) |= U16(BTS_PAGESIZE_FIXED)
(*BtShared)(unsafe.Pointer(pBt)).FautoVacuum = func() uint8 {
- if Xsqlite3Get4byte(tls, (bp /* &zDbHeader */ +52)) != 0 {
+ if Xsqlite3Get4byte(tls, bp+52) != 0 {
return uint8(1)
}
return uint8(0)
}()
(*BtShared)(unsafe.Pointer(pBt)).FincrVacuum = func() uint8 {
- if Xsqlite3Get4byte(tls, (bp /* &zDbHeader */ +64)) != 0 {
+ if Xsqlite3Get4byte(tls, bp+64) != 0 {
return uint8(1)
}
return uint8(0)
}()
__26:
;
- rc = Xsqlite3PagerSetPagesize(tls, (*BtShared)(unsafe.Pointer(pBt)).FpPager, (pBt + 36 /* &.pageSize */), int32(nReserve))
+ rc = Xsqlite3PagerSetPagesize(tls, (*BtShared)(unsafe.Pointer(pBt)).FpPager, pBt+36, int32(nReserve))
if !(rc != 0) {
goto __28
}
goto btree_open_out
__28:
;
- (*BtShared)(unsafe.Pointer(pBt)).FusableSize = ((*BtShared)(unsafe.Pointer(pBt)).FpageSize - U32(nReserve))
+ (*BtShared)(unsafe.Pointer(pBt)).FusableSize = (*BtShared)(unsafe.Pointer(pBt)).FpageSize - U32(nReserve)
// 8-byte alignment of pageSize
// Add the new BtShared object to the linked list sharable BtShareds.
@@ -44848,7 +45447,7 @@ __28:
goto __29
}
mutexShared1 = Xsqlite3MutexAlloc(tls, SQLITE_MUTEX_STATIC_MAIN)
- if !((1 != 0) && (Xsqlite3Config.FbCoreMutex != 0)) {
+ if !(1 != 0 && Xsqlite3Config.FbCoreMutex != 0) {
goto __30
}
(*BtShared)(unsafe.Pointer(pBt)).Fmutex = Xsqlite3MutexAlloc(tls, SQLITE_MUTEX_FAST)
@@ -44881,7 +45480,7 @@ __33:
if !(i < (*Sqlite3)(unsafe.Pointer(db)).FnDb) {
goto __35
}
- if !(((libc.AssignUintptr(&pSib, (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+uintptr(i)*16)).FpBt)) != uintptr(0)) && ((*Btree)(unsafe.Pointer(pSib)).Fsharable != 0)) {
+ if !(libc.AssignUintptr(&pSib, (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+uintptr(i)*16)).FpBt) != uintptr(0) && (*Btree)(unsafe.Pointer(pSib)).Fsharable != 0) {
goto __36
}
__37:
@@ -44901,7 +45500,7 @@ __38:
goto __40
__39:
__41:
- if !(((*Btree)(unsafe.Pointer(pSib)).FpNext != 0) && (Uptr((*Btree)(unsafe.Pointer((*Btree)(unsafe.Pointer(pSib)).FpNext)).FpBt) < Uptr((*Btree)(unsafe.Pointer(p)).FpBt))) {
+ if !((*Btree)(unsafe.Pointer(pSib)).FpNext != 0 && Uptr((*Btree)(unsafe.Pointer((*Btree)(unsafe.Pointer(pSib)).FpNext)).FpBt) < Uptr((*Btree)(unsafe.Pointer(p)).FpBt)) {
goto __42
}
pSib = (*Btree)(unsafe.Pointer(pSib)).FpNext
@@ -44937,7 +45536,7 @@ btree_open_out:
if !(rc != SQLITE_OK) {
goto __44
}
- if !((pBt != 0) && ((*BtShared)(unsafe.Pointer(pBt)).FpPager != 0)) {
+ if !(pBt != 0 && (*BtShared)(unsafe.Pointer(pBt)).FpPager != 0) {
goto __46
}
Xsqlite3PagerClose(tls, (*BtShared)(unsafe.Pointer(pBt)).FpPager, uintptr(0))
@@ -44963,7 +45562,7 @@ __47:
if !((*Sqlite3_file)(unsafe.Pointer(pFile)).FpMethods != 0) {
goto __48
}
- Xsqlite3OsFileControlHint(tls, pFile, SQLITE_FCNTL_PDB, (pBt + 4 /* &.db */))
+ Xsqlite3OsFileControlHint(tls, pFile, SQLITE_FCNTL_PDB, pBt+4)
__48:
;
__45:
@@ -44983,7 +45582,7 @@ __49:
// remove the BtShared structure from the sharing list. Return
// true if the BtShared.nRef counter reaches zero and return
// false if it is still positive.
-func removeFromSharingList(tls *libc.TLS, pBt uintptr) int32 { /* sqlite3.c:68111:12: */
+func removeFromSharingList(tls *libc.TLS, pBt uintptr) int32 { /* sqlite3.c:68229:12: */
var pMainMtx uintptr
var pList uintptr
var removed int32 = 0
@@ -44996,7 +45595,7 @@ func removeFromSharingList(tls *libc.TLS, pBt uintptr) int32 { /* sqlite3.c:6811
sqlite3SharedCacheList = (*BtShared)(unsafe.Pointer(pBt)).FpNext
} else {
pList = sqlite3SharedCacheList
- for (pList != 0) && ((*BtShared)(unsafe.Pointer(pList)).FpNext != pBt) {
+ for pList != 0 && (*BtShared)(unsafe.Pointer(pList)).FpNext != pBt {
pList = (*BtShared)(unsafe.Pointer(pList)).FpNext
}
if pList != 0 {
@@ -45015,7 +45614,7 @@ func removeFromSharingList(tls *libc.TLS, pBt uintptr) int32 { /* sqlite3.c:6811
// Make sure pBt->pTmpSpace points to an allocation of
// MX_CELL_SIZE(pBt) bytes with a 4-byte prefix for a left-child
// pointer.
-func allocateTempSpace(tls *libc.TLS, pBt uintptr) { /* sqlite3.c:68150:13: */
+func allocateTempSpace(tls *libc.TLS, pBt uintptr) { /* sqlite3.c:68268:13: */
if !(int32((*BtShared)(unsafe.Pointer(pBt)).FpTmpSpace) != 0) {
(*BtShared)(unsafe.Pointer(pBt)).FpTmpSpace = Xsqlite3PageMalloc(tls, int32((*BtShared)(unsafe.Pointer(pBt)).FpageSize))
@@ -45035,22 +45634,22 @@ func allocateTempSpace(tls *libc.TLS, pBt uintptr) { /* sqlite3.c:68150:13: */
// left-child pointer to the beginning of a cell.
if (*BtShared)(unsafe.Pointer(pBt)).FpTmpSpace != 0 {
libc.Xmemset(tls, (*BtShared)(unsafe.Pointer(pBt)).FpTmpSpace, 0, uint32(8))
- *(*uintptr)(unsafe.Pointer(pBt + 84 /* &.pTmpSpace */)) += (uintptr(4))
+ *(*uintptr)(unsafe.Pointer(pBt + 84)) += uintptr(4)
}
}
}
// Free the pBt->pTmpSpace allocation
-func freeTempSpace(tls *libc.TLS, pBt uintptr) { /* sqlite3.c:68179:13: */
+func freeTempSpace(tls *libc.TLS, pBt uintptr) { /* sqlite3.c:68297:13: */
if (*BtShared)(unsafe.Pointer(pBt)).FpTmpSpace != 0 {
- *(*uintptr)(unsafe.Pointer(pBt + 84 /* &.pTmpSpace */)) -= (uintptr(4))
+ *(*uintptr)(unsafe.Pointer(pBt + 84)) -= uintptr(4)
Xsqlite3PageFree(tls, (*BtShared)(unsafe.Pointer(pBt)).FpTmpSpace)
(*BtShared)(unsafe.Pointer(pBt)).FpTmpSpace = uintptr(0)
}
}
// Close an open database and invalidate all cursors.
-func Xsqlite3BtreeClose(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:68190:20: */
+func Xsqlite3BtreeClose(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:68308:20: */
var pBt uintptr = (*Btree)(unsafe.Pointer(p)).FpBt
// Close all cursors opened via this handle.
@@ -45069,14 +45668,14 @@ func Xsqlite3BtreeClose(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:68190:20:
// structure, return now. The remainder of this procedure cleans
// up the shared-btree.
- if !(int32((*Btree)(unsafe.Pointer(p)).Fsharable) != 0) || (removeFromSharingList(tls, pBt) != 0) {
+ if !(int32((*Btree)(unsafe.Pointer(p)).Fsharable) != 0) || removeFromSharingList(tls, pBt) != 0 {
// The pBt is no longer on the sharing list, so we can access
// it without having to hold the mutex.
//
// Clean out and delete the BtShared object.
Xsqlite3PagerClose(tls, (*BtShared)(unsafe.Pointer(pBt)).FpPager, (*Btree)(unsafe.Pointer(p)).Fdb)
- if ((*BtShared)(unsafe.Pointer(pBt)).FxFreeSchema != 0) && ((*BtShared)(unsafe.Pointer(pBt)).FpSchema != 0) {
+ if (*BtShared)(unsafe.Pointer(pBt)).FxFreeSchema != 0 && (*BtShared)(unsafe.Pointer(pBt)).FpSchema != 0 {
(*struct{ f func(*libc.TLS, uintptr) })(unsafe.Pointer(&struct{ uintptr }{(*BtShared)(unsafe.Pointer(pBt)).FxFreeSchema})).f(tls, (*BtShared)(unsafe.Pointer(pBt)).FpSchema)
}
Xsqlite3DbFree(tls, uintptr(0), (*BtShared)(unsafe.Pointer(pBt)).FpSchema)
@@ -45100,7 +45699,7 @@ func Xsqlite3BtreeClose(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:68190:20:
// pages in the cache exceeds this soft limit. But the size of the
// cache is allowed to grow larger than this limit if it contains
// dirty pages or pages still in active use.
-func Xsqlite3BtreeSetCacheSize(tls *libc.TLS, p uintptr, mxPage int32) int32 { /* sqlite3.c:68256:20: */
+func Xsqlite3BtreeSetCacheSize(tls *libc.TLS, p uintptr, mxPage int32) int32 { /* sqlite3.c:68374:20: */
var pBt uintptr = (*Btree)(unsafe.Pointer(p)).FpBt
Xsqlite3BtreeEnter(tls, p)
@@ -45117,7 +45716,7 @@ func Xsqlite3BtreeSetCacheSize(tls *libc.TLS, p uintptr, mxPage int32) int32 { /
// The value returned is the current spill size. If zero is passed
// as an argument, no changes are made to the spill size setting, so
// using mxPage of 0 is a way to query the current spill size.
-func Xsqlite3BtreeSetSpillSize(tls *libc.TLS, p uintptr, mxPage int32) int32 { /* sqlite3.c:68275:20: */
+func Xsqlite3BtreeSetSpillSize(tls *libc.TLS, p uintptr, mxPage int32) int32 { /* sqlite3.c:68393:20: */
var pBt uintptr = (*Btree)(unsafe.Pointer(p)).FpBt
var res int32
@@ -45129,7 +45728,7 @@ func Xsqlite3BtreeSetSpillSize(tls *libc.TLS, p uintptr, mxPage int32) int32 { /
// Change the limit on the amount of the database file that may be
// memory mapped.
-func Xsqlite3BtreeSetMmapLimit(tls *libc.TLS, p uintptr, szMmap Sqlite3_int64) int32 { /* sqlite3.c:68290:20: */
+func Xsqlite3BtreeSetMmapLimit(tls *libc.TLS, p uintptr, szMmap Sqlite3_int64) int32 { /* sqlite3.c:68408:20: */
var pBt uintptr = (*Btree)(unsafe.Pointer(p)).FpBt
Xsqlite3BtreeEnter(tls, p)
@@ -45144,7 +45743,7 @@ func Xsqlite3BtreeSetMmapLimit(tls *libc.TLS, p uintptr, szMmap Sqlite3_int64) i
// there is a high probability of damage) Level 2 is the default. There
// is a very low but non-zero probability of damage. Level 3 reduces the
// probability of damage to near zero but with a write performance reduction.
-func Xsqlite3BtreeSetPagerFlags(tls *libc.TLS, p uintptr, pgFlags uint32) int32 { /* sqlite3.c:68309:20: */
+func Xsqlite3BtreeSetPagerFlags(tls *libc.TLS, p uintptr, pgFlags uint32) int32 { /* sqlite3.c:68427:20: */
var pBt uintptr = (*Btree)(unsafe.Pointer(p)).FpBt
Xsqlite3BtreeEnter(tls, p)
@@ -45171,41 +45770,41 @@ func Xsqlite3BtreeSetPagerFlags(tls *libc.TLS, p uintptr, pgFlags uint32) int32
//
// If the iFix!=0 then the BTS_PAGESIZE_FIXED flag is set so that the page size
// and autovacuum mode can no longer be changed.
-func Xsqlite3BtreeSetPageSize(tls *libc.TLS, p uintptr, pageSize int32, nReserve int32, iFix int32) int32 { /* sqlite3.c:68342:20: */
+func Xsqlite3BtreeSetPageSize(tls *libc.TLS, p uintptr, pageSize int32, nReserve int32, iFix int32) int32 { /* sqlite3.c:68460:20: */
var rc int32 = SQLITE_OK
var x int32
var pBt uintptr = (*Btree)(unsafe.Pointer(p)).FpBt
Xsqlite3BtreeEnter(tls, p)
(*BtShared)(unsafe.Pointer(pBt)).FnReserveWanted = U8(nReserve)
- x = (int32((*BtShared)(unsafe.Pointer(pBt)).FpageSize - (*BtShared)(unsafe.Pointer(pBt)).FusableSize))
+ x = int32((*BtShared)(unsafe.Pointer(pBt)).FpageSize - (*BtShared)(unsafe.Pointer(pBt)).FusableSize)
if nReserve < x {
nReserve = x
}
- if (int32((*BtShared)(unsafe.Pointer(pBt)).FbtsFlags) & BTS_PAGESIZE_FIXED) != 0 {
+ if int32((*BtShared)(unsafe.Pointer(pBt)).FbtsFlags)&BTS_PAGESIZE_FIXED != 0 {
Xsqlite3BtreeLeave(tls, p)
return SQLITE_READONLY
}
- if ((pageSize >= 512) && (pageSize <= SQLITE_MAX_PAGE_SIZE)) && (((pageSize - 1) & pageSize) == 0) {
+ if pageSize >= 512 && pageSize <= SQLITE_MAX_PAGE_SIZE && (pageSize-1)&pageSize == 0 {
- if (nReserve > 32) && (pageSize == 512) {
+ if nReserve > 32 && pageSize == 512 {
pageSize = 1024
}
(*BtShared)(unsafe.Pointer(pBt)).FpageSize = U32(pageSize)
freeTempSpace(tls, pBt)
}
- rc = Xsqlite3PagerSetPagesize(tls, (*BtShared)(unsafe.Pointer(pBt)).FpPager, (pBt + 36 /* &.pageSize */), nReserve)
- (*BtShared)(unsafe.Pointer(pBt)).FusableSize = ((*BtShared)(unsafe.Pointer(pBt)).FpageSize - U32(U16(nReserve)))
+ rc = Xsqlite3PagerSetPagesize(tls, (*BtShared)(unsafe.Pointer(pBt)).FpPager, pBt+36, nReserve)
+ (*BtShared)(unsafe.Pointer(pBt)).FusableSize = (*BtShared)(unsafe.Pointer(pBt)).FpageSize - U32(U16(nReserve))
if iFix != 0 {
- *(*U16)(unsafe.Pointer(pBt + 24 /* &.btsFlags */)) |= U16((BTS_PAGESIZE_FIXED))
+ *(*U16)(unsafe.Pointer(pBt + 24)) |= U16(BTS_PAGESIZE_FIXED)
}
Xsqlite3BtreeLeave(tls, p)
return rc
}
// Return the currently defined page size
-func Xsqlite3BtreeGetPageSize(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:68374:20: */
+func Xsqlite3BtreeGetPageSize(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:68492:20: */
return int32((*BtShared)(unsafe.Pointer((*Btree)(unsafe.Pointer(p)).FpBt)).FpageSize)
}
@@ -45218,10 +45817,10 @@ func Xsqlite3BtreeGetPageSize(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:683
// database handle that owns *p is not. In this case if sqlite3BtreeEnter()
// were to be called, it might collide with some other operation on the
// database handle that owns *p, causing undefined behavior.
-func Xsqlite3BtreeGetReserveNoMutex(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:68389:20: */
+func Xsqlite3BtreeGetReserveNoMutex(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:68507:20: */
var n int32
- n = (int32((*BtShared)(unsafe.Pointer((*Btree)(unsafe.Pointer(p)).FpBt)).FpageSize - (*BtShared)(unsafe.Pointer((*Btree)(unsafe.Pointer(p)).FpBt)).FusableSize))
+ n = int32((*BtShared)(unsafe.Pointer((*Btree)(unsafe.Pointer(p)).FpBt)).FpageSize - (*BtShared)(unsafe.Pointer((*Btree)(unsafe.Pointer(p)).FpBt)).FusableSize)
return n
}
@@ -45232,7 +45831,7 @@ func Xsqlite3BtreeGetReserveNoMutex(tls *libc.TLS, p uintptr) int32 { /* sqlite3
// The value returned is the larger of the current reserve size and
// the latest reserve size requested by SQLITE_FILECTRL_RESERVE_BYTES.
// The amount of reserve can only grow - never shrink.
-func Xsqlite3BtreeGetRequestedReserve(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:68405:20: */
+func Xsqlite3BtreeGetRequestedReserve(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:68523:20: */
var n1 int32
var n2 int32
Xsqlite3BtreeEnter(tls, p)
@@ -45248,7 +45847,7 @@ func Xsqlite3BtreeGetRequestedReserve(tls *libc.TLS, p uintptr) int32 { /* sqlit
// Set the maximum page count for a database if mxPage is positive.
// No changes are made if mxPage is 0 or negative.
// Regardless of the value of mxPage, return the maximum page count.
-func Xsqlite3BtreeMaxPageCount(tls *libc.TLS, p uintptr, mxPage Pgno) Pgno { /* sqlite3.c:68420:21: */
+func Xsqlite3BtreeMaxPageCount(tls *libc.TLS, p uintptr, mxPage Pgno) Pgno { /* sqlite3.c:68538:21: */
var n Pgno
Xsqlite3BtreeEnter(tls, p)
n = Xsqlite3PagerMaxPageCount(tls, (*BtShared)(unsafe.Pointer((*Btree)(unsafe.Pointer(p)).FpBt)).FpPager, mxPage)
@@ -45272,7 +45871,7 @@ func Xsqlite3BtreeMaxPageCount(tls *libc.TLS, p uintptr, mxPage Pgno) Pgno { /*
// With BTS_SECURE_DELETE, operation is like BTS_OVERWRITE with the addition
// that freelist leaf pages are written back into the database, increasing
// the amount of disk I/O.
-func Xsqlite3BtreeSecureDelete(tls *libc.TLS, p uintptr, newFlag int32) int32 { /* sqlite3.c:68446:20: */
+func Xsqlite3BtreeSecureDelete(tls *libc.TLS, p uintptr, newFlag int32) int32 { /* sqlite3.c:68564:20: */
var b int32
if p == uintptr(0) {
return 0
@@ -45280,10 +45879,10 @@ func Xsqlite3BtreeSecureDelete(tls *libc.TLS, p uintptr, newFlag int32) int32 {
Xsqlite3BtreeEnter(tls, p)
if newFlag >= 0 {
- *(*U16)(unsafe.Pointer((*Btree)(unsafe.Pointer(p)).FpBt + 24 /* &.btsFlags */)) &= libc.Uint16FromInt32((libc.CplInt32(BTS_FAST_SECURE)))
- *(*U16)(unsafe.Pointer((*Btree)(unsafe.Pointer(p)).FpBt + 24 /* &.btsFlags */)) |= U16((BTS_SECURE_DELETE * newFlag))
+ *(*U16)(unsafe.Pointer((*Btree)(unsafe.Pointer(p)).FpBt + 24)) &= libc.Uint16FromInt32(libc.CplInt32(BTS_FAST_SECURE))
+ *(*U16)(unsafe.Pointer((*Btree)(unsafe.Pointer(p)).FpBt + 24)) |= U16(BTS_SECURE_DELETE * newFlag)
}
- b = ((int32((*BtShared)(unsafe.Pointer((*Btree)(unsafe.Pointer(p)).FpBt)).FbtsFlags) & BTS_FAST_SECURE) / BTS_SECURE_DELETE)
+ b = int32((*BtShared)(unsafe.Pointer((*Btree)(unsafe.Pointer(p)).FpBt)).FbtsFlags) & BTS_FAST_SECURE / BTS_SECURE_DELETE
Xsqlite3BtreeLeave(tls, p)
return b
}
@@ -45292,18 +45891,18 @@ func Xsqlite3BtreeSecureDelete(tls *libc.TLS, p uintptr, newFlag int32) int32 {
// parameter is non-zero, then auto-vacuum mode is enabled. If zero, it
// is disabled. The default value for the auto-vacuum property is
// determined by the SQLITE_DEFAULT_AUTOVACUUM macro.
-func Xsqlite3BtreeSetAutoVacuum(tls *libc.TLS, p uintptr, autoVacuum int32) int32 { /* sqlite3.c:68467:20: */
+func Xsqlite3BtreeSetAutoVacuum(tls *libc.TLS, p uintptr, autoVacuum int32) int32 { /* sqlite3.c:68585:20: */
var pBt uintptr = (*Btree)(unsafe.Pointer(p)).FpBt
var rc int32 = SQLITE_OK
var av U8 = U8(autoVacuum)
Xsqlite3BtreeEnter(tls, p)
- if ((int32((*BtShared)(unsafe.Pointer(pBt)).FbtsFlags) & BTS_PAGESIZE_FIXED) != 0) && ((func() int32 {
+ if int32((*BtShared)(unsafe.Pointer(pBt)).FbtsFlags)&BTS_PAGESIZE_FIXED != 0 && func() int32 {
if av != 0 {
return 1
}
return 0
- }()) != int32((*BtShared)(unsafe.Pointer(pBt)).FautoVacuum)) {
+ }() != int32((*BtShared)(unsafe.Pointer(pBt)).FautoVacuum) {
rc = SQLITE_READONLY
} else {
(*BtShared)(unsafe.Pointer(pBt)).FautoVacuum = func() uint8 {
@@ -45325,7 +45924,7 @@ func Xsqlite3BtreeSetAutoVacuum(tls *libc.TLS, p uintptr, autoVacuum int32) int3
// Return the value of the 'auto-vacuum' property. If auto-vacuum is
// enabled 1 is returned. Otherwise 0.
-func Xsqlite3BtreeGetAutoVacuum(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:68491:20: */
+func Xsqlite3BtreeGetAutoVacuum(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:68609:20: */
var rc int32
Xsqlite3BtreeEnter(tls, p)
rc = func() int32 {
@@ -45350,7 +45949,7 @@ func Xsqlite3BtreeGetAutoVacuum(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:6
// well-formed database file, then SQLITE_CORRUPT is returned.
// SQLITE_BUSY is returned if the database is locked. SQLITE_NOMEM
// is returned if we run out of memory.
-func lockBtree(tls *libc.TLS, pBt uintptr) int32 { /* sqlite3.c:68547:12: */
+func lockBtree(tls *libc.TLS, pBt uintptr) int32 { /* sqlite3.c:68665:12: */
bp := tls.Alloc(12)
defer tls.Free(12)
@@ -45359,15 +45958,13 @@ func lockBtree(tls *libc.TLS, pBt uintptr) int32 { /* sqlite3.c:68547:12: */
// Page 1 of the database file
var nPage U32 // Number of pages in the database
// var nPageFile U32 at bp+4, 4
- // Number of pages in the database file
- var nPageHeader U32
- _ = nPageHeader
+
// var isOpen int32 at bp+8, 4
var pageSize U32
var usableSize U32
var page1 uintptr
- *(*U32)(unsafe.Pointer(bp + 4 /* nPageFile */)) = U32(0) // Number of pages in the database according to hdr
+ *(*U32)(unsafe.Pointer(bp + 4 /* nPageFile */)) = U32(0) // Number of pages in the database file
rc = Xsqlite3PagerSharedLock(tls, (*BtShared)(unsafe.Pointer(pBt)).FpPager)
if !(rc != SQLITE_OK) {
@@ -45386,15 +45983,15 @@ __2:
// Do some checking to help insure the file we opened really is
// a valid database file.
- nPage = libc.AssignUint32(&nPageHeader, Xsqlite3Get4byte(tls, (uintptr(28)+(*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* pPage1 */)))).FaData)))
+ nPage = Xsqlite3Get4byte(tls, uintptr(28)+(*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FaData)
Xsqlite3PagerPagecount(tls, (*BtShared)(unsafe.Pointer(pBt)).FpPager, bp+4 /* &nPageFile */)
- if !((nPage == U32(0)) || (libc.Xmemcmp(tls, (uintptr(24)+(*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* pPage1 */)))).FaData), (uintptr(92)+(*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* pPage1 */)))).FaData), uint32(4)) != 0)) {
+ if !(nPage == U32(0) || libc.Xmemcmp(tls, uintptr(24)+(*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FaData, uintptr(92)+(*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FaData, uint32(4)) != 0) {
goto __3
}
nPage = *(*U32)(unsafe.Pointer(bp + 4 /* nPageFile */))
__3:
;
- if !(((*Sqlite3)(unsafe.Pointer((*BtShared)(unsafe.Pointer(pBt)).Fdb)).Fflags & uint64(SQLITE_ResetDatabase)) != uint64(0)) {
+ if !((*Sqlite3)(unsafe.Pointer((*BtShared)(unsafe.Pointer(pBt)).Fdb)).Fflags&uint64(SQLITE_ResetDatabase) != uint64(0)) {
goto __4
}
nPage = U32(0)
@@ -45418,7 +46015,7 @@ __6:
if !(int32(*(*U8)(unsafe.Pointer(page1 + 18))) > 2) {
goto __7
}
- *(*U16)(unsafe.Pointer(pBt + 24 /* &.btsFlags */)) |= U16((BTS_READ_ONLY))
+ *(*U16)(unsafe.Pointer(pBt + 24)) |= U16(BTS_READ_ONLY)
__7:
;
if !(int32(*(*U8)(unsafe.Pointer(page1 + 19))) > 2) {
@@ -45428,14 +46025,14 @@ __7:
__8:
;
- // If the write version is set to 2, this database should be accessed
+ // If the read version is set to 2, this database should be accessed
// in WAL mode. If the log is not already open, open it now. Then
// return SQLITE_OK and return without populating BtShared.pPage1.
// The caller detects this and calls this function again. This is
// required as the version of page 1 currently in the page1 buffer
// may not be the latest version - there may be a newer one in the log
// file.
- if !((int32(*(*U8)(unsafe.Pointer(page1 + 19))) == 2) && ((int32((*BtShared)(unsafe.Pointer(pBt)).FbtsFlags) & BTS_NO_WAL) == 0)) {
+ if !(int32(*(*U8)(unsafe.Pointer(page1 + 19))) == 2 && int32((*BtShared)(unsafe.Pointer(pBt)).FbtsFlags)&BTS_NO_WAL == 0) {
goto __9
}
*(*int32)(unsafe.Pointer(bp + 8 /* isOpen */)) = 0
@@ -45447,7 +46044,7 @@ __8:
goto __12
__11:
;
- if !(*(*int32)(unsafe.Pointer(bp + 8 /* isOpen */)) == 0) {
+ if !(*(*int32)(unsafe.Pointer(bp + 8)) == 0) {
goto __13
}
releasePageOne(tls, *(*uintptr)(unsafe.Pointer(bp /* pPage1 */)))
@@ -45468,7 +46065,7 @@ __10:
//
// The original design allowed these amounts to vary, but as of
// version 3.6.0, we require them to be fixed.
- if !(libc.Xmemcmp(tls, (page1+21), ts+3167 /* "@ " */, uint32(3)) != 0) {
+ if !(libc.Xmemcmp(tls, page1+21, ts+3978, uint32(3)) != 0) {
goto __14
}
goto page1_init_failed
@@ -45477,18 +46074,18 @@ __14:
// EVIDENCE-OF: R-51873-39618 The page size for a database file is
// determined by the 2-byte integer located at an offset of 16 bytes from
// the beginning of the database file.
- pageSize = (U32((int32(*(*U8)(unsafe.Pointer(page1 + 16))) << 8) | (int32(*(*U8)(unsafe.Pointer(page1 + 17))) << 16)))
+ pageSize = U32(int32(*(*U8)(unsafe.Pointer(page1 + 16)))<<8 | int32(*(*U8)(unsafe.Pointer(page1 + 17)))<<16)
// EVIDENCE-OF: R-25008-21688 The size of a page is a power of two
// between 512 and 65536 inclusive.
- if !(((((pageSize - U32(1)) & pageSize) != U32(0)) ||
- (pageSize > U32(SQLITE_MAX_PAGE_SIZE))) ||
- (pageSize <= U32(256))) {
+ if !((pageSize-U32(1))&pageSize != U32(0) ||
+ pageSize > U32(SQLITE_MAX_PAGE_SIZE) ||
+ pageSize <= U32(256)) {
goto __15
}
goto page1_init_failed
__15:
;
- *(*U16)(unsafe.Pointer(pBt + 24 /* &.btsFlags */)) |= U16((BTS_PAGESIZE_FIXED))
+ *(*U16)(unsafe.Pointer(pBt + 24)) |= U16(BTS_PAGESIZE_FIXED)
// EVIDENCE-OF: R-59310-51205 The "reserved space" size in the 1-byte
// integer at offset 20 is the number of bytes of space at the end of
@@ -45497,7 +46094,7 @@ __15:
// EVIDENCE-OF: R-37497-42412 The size of the reserved region is
// determined by the one-byte unsigned integer found at an offset of 20
// into the database file header.
- usableSize = (pageSize - U32(*(*U8)(unsafe.Pointer(page1 + 20))))
+ usableSize = pageSize - U32(*(*U8)(unsafe.Pointer(page1 + 20)))
if !(pageSize != (*BtShared)(unsafe.Pointer(pBt)).FpageSize) {
goto __16
}
@@ -45510,15 +46107,15 @@ __15:
(*BtShared)(unsafe.Pointer(pBt)).FusableSize = usableSize
(*BtShared)(unsafe.Pointer(pBt)).FpageSize = pageSize
freeTempSpace(tls, pBt)
- rc = Xsqlite3PagerSetPagesize(tls, (*BtShared)(unsafe.Pointer(pBt)).FpPager, (pBt + 36 /* &.pageSize */),
- (int32(pageSize - usableSize)))
+ rc = Xsqlite3PagerSetPagesize(tls, (*BtShared)(unsafe.Pointer(pBt)).FpPager, pBt+36,
+ int32(pageSize-usableSize))
return rc
__16:
;
- if !((Xsqlite3WritableSchema(tls, (*BtShared)(unsafe.Pointer(pBt)).Fdb) == 0) && (nPage > *(*U32)(unsafe.Pointer(bp + 4 /* nPageFile */)))) {
+ if !(Xsqlite3WritableSchema(tls, (*BtShared)(unsafe.Pointer(pBt)).Fdb) == 0 && nPage > *(*U32)(unsafe.Pointer(bp + 4))) {
goto __17
}
- rc = Xsqlite3CorruptError(tls, 68672)
+ rc = Xsqlite3CorruptError(tls, 68789)
goto page1_init_failed
__17:
;
@@ -45534,13 +46131,13 @@ __18:
(*BtShared)(unsafe.Pointer(pBt)).FpageSize = pageSize
(*BtShared)(unsafe.Pointer(pBt)).FusableSize = usableSize
(*BtShared)(unsafe.Pointer(pBt)).FautoVacuum = func() uint8 {
- if Xsqlite3Get4byte(tls, (page1+52)) != 0 {
+ if Xsqlite3Get4byte(tls, page1+52) != 0 {
return uint8(1)
}
return uint8(0)
}()
(*BtShared)(unsafe.Pointer(pBt)).FincrVacuum = func() uint8 {
- if Xsqlite3Get4byte(tls, (page1+64)) != 0 {
+ if Xsqlite3Get4byte(tls, page1+64) != 0 {
return uint8(1)
}
return uint8(0)
@@ -45560,10 +46157,10 @@ __5:
// So a cell consists of a 2-byte pointer, a header which is as much as
// 17 bytes long, 0 to N bytes of payload, and an optional 4 byte overflow
// page pointer.
- (*BtShared)(unsafe.Pointer(pBt)).FmaxLocal = (U16(((((*BtShared)(unsafe.Pointer(pBt)).FusableSize - U32(12)) * U32(64)) / U32(255)) - U32(23)))
- (*BtShared)(unsafe.Pointer(pBt)).FminLocal = (U16(((((*BtShared)(unsafe.Pointer(pBt)).FusableSize - U32(12)) * U32(32)) / U32(255)) - U32(23)))
- (*BtShared)(unsafe.Pointer(pBt)).FmaxLeaf = (U16((*BtShared)(unsafe.Pointer(pBt)).FusableSize - U32(35)))
- (*BtShared)(unsafe.Pointer(pBt)).FminLeaf = (U16(((((*BtShared)(unsafe.Pointer(pBt)).FusableSize - U32(12)) * U32(32)) / U32(255)) - U32(23)))
+ (*BtShared)(unsafe.Pointer(pBt)).FmaxLocal = U16(((*BtShared)(unsafe.Pointer(pBt)).FusableSize-U32(12))*U32(64)/U32(255) - U32(23))
+ (*BtShared)(unsafe.Pointer(pBt)).FminLocal = U16(((*BtShared)(unsafe.Pointer(pBt)).FusableSize-U32(12))*U32(32)/U32(255) - U32(23))
+ (*BtShared)(unsafe.Pointer(pBt)).FmaxLeaf = U16((*BtShared)(unsafe.Pointer(pBt)).FusableSize - U32(35))
+ (*BtShared)(unsafe.Pointer(pBt)).FminLeaf = U16(((*BtShared)(unsafe.Pointer(pBt)).FusableSize-U32(12))*U32(32)/U32(255) - U32(23))
if !(int32((*BtShared)(unsafe.Pointer(pBt)).FmaxLocal) > 127) {
goto __19
}
@@ -45590,9 +46187,9 @@ page1_init_failed:
// has the effect of releasing the read lock.
//
// If there is a transaction in progress, this routine is a no-op.
-func unlockBtreeIfUnused(tls *libc.TLS, pBt uintptr) { /* sqlite3.c:68754:13: */
+func unlockBtreeIfUnused(tls *libc.TLS, pBt uintptr) { /* sqlite3.c:68871:13: */
- if (int32((*BtShared)(unsafe.Pointer(pBt)).FinTransaction) == TRANS_NONE) && ((*BtShared)(unsafe.Pointer(pBt)).FpPage1 != uintptr(0)) {
+ if int32((*BtShared)(unsafe.Pointer(pBt)).FinTransaction) == TRANS_NONE && (*BtShared)(unsafe.Pointer(pBt)).FpPage1 != uintptr(0) {
var pPage1 uintptr = (*BtShared)(unsafe.Pointer(pBt)).FpPage1
(*BtShared)(unsafe.Pointer(pBt)).FpPage1 = uintptr(0)
@@ -45603,7 +46200,7 @@ func unlockBtreeIfUnused(tls *libc.TLS, pBt uintptr) { /* sqlite3.c:68754:13: */
// If pBt points to an empty file then convert that empty file
// into a new empty database by initializing the first page of
// the database.
-func newDatabase(tls *libc.TLS, pBt uintptr) int32 { /* sqlite3.c:68771:12: */
+func newDatabase(tls *libc.TLS, pBt uintptr) int32 { /* sqlite3.c:68888:12: */
var pP1 uintptr
var data uintptr
var rc int32
@@ -45620,21 +46217,21 @@ func newDatabase(tls *libc.TLS, pBt uintptr) int32 { /* sqlite3.c:68771:12: */
}
libc.Xmemcpy(tls, data, uintptr(unsafe.Pointer(&zMagicHeader)), uint32(unsafe.Sizeof(zMagicHeader)))
- *(*uint8)(unsafe.Pointer(data + 16)) = (U8(((*BtShared)(unsafe.Pointer(pBt)).FpageSize >> 8) & U32(0xff)))
- *(*uint8)(unsafe.Pointer(data + 17)) = (U8(((*BtShared)(unsafe.Pointer(pBt)).FpageSize >> 16) & U32(0xff)))
+ *(*uint8)(unsafe.Pointer(data + 16)) = U8((*BtShared)(unsafe.Pointer(pBt)).FpageSize >> 8 & U32(0xff))
+ *(*uint8)(unsafe.Pointer(data + 17)) = U8((*BtShared)(unsafe.Pointer(pBt)).FpageSize >> 16 & U32(0xff))
*(*uint8)(unsafe.Pointer(data + 18)) = uint8(1)
*(*uint8)(unsafe.Pointer(data + 19)) = uint8(1)
- *(*uint8)(unsafe.Pointer(data + 20)) = (U8((*BtShared)(unsafe.Pointer(pBt)).FpageSize - (*BtShared)(unsafe.Pointer(pBt)).FusableSize))
+ *(*uint8)(unsafe.Pointer(data + 20)) = U8((*BtShared)(unsafe.Pointer(pBt)).FpageSize - (*BtShared)(unsafe.Pointer(pBt)).FusableSize)
*(*uint8)(unsafe.Pointer(data + 21)) = uint8(64)
*(*uint8)(unsafe.Pointer(data + 22)) = uint8(32)
*(*uint8)(unsafe.Pointer(data + 23)) = uint8(32)
- libc.Xmemset(tls, (data + 24), 0, (uint32(100 - 24)))
- zeroPage(tls, pP1, ((PTF_INTKEY | PTF_LEAF) | PTF_LEAFDATA))
- *(*U16)(unsafe.Pointer(pBt + 24 /* &.btsFlags */)) |= U16((BTS_PAGESIZE_FIXED))
+ libc.Xmemset(tls, data+24, 0, uint32(100-24))
+ zeroPage(tls, pP1, PTF_INTKEY|PTF_LEAF|PTF_LEAFDATA)
+ *(*U16)(unsafe.Pointer(pBt + 24)) |= U16(BTS_PAGESIZE_FIXED)
- Xsqlite3Put4byte(tls, (data + 52), uint32((*BtShared)(unsafe.Pointer(pBt)).FautoVacuum))
- Xsqlite3Put4byte(tls, (data + 64), uint32((*BtShared)(unsafe.Pointer(pBt)).FincrVacuum))
+ Xsqlite3Put4byte(tls, data+52, uint32((*BtShared)(unsafe.Pointer(pBt)).FautoVacuum))
+ Xsqlite3Put4byte(tls, data+64, uint32((*BtShared)(unsafe.Pointer(pBt)).FincrVacuum))
(*BtShared)(unsafe.Pointer(pBt)).FnPage = U32(1)
*(*uint8)(unsafe.Pointer(data + 31)) = uint8(1)
return SQLITE_OK
@@ -45643,7 +46240,7 @@ func newDatabase(tls *libc.TLS, pBt uintptr) int32 { /* sqlite3.c:68771:12: */
// Initialize the first page of the database file (creating a database
// consisting of a single page and no schema objects). Return SQLITE_OK
// if successful, or an SQLite error code otherwise.
-func Xsqlite3BtreeNewDb(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:68815:20: */
+func Xsqlite3BtreeNewDb(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:68932:20: */
var rc int32
Xsqlite3BtreeEnter(tls, p)
(*BtShared)(unsafe.Pointer((*Btree)(unsafe.Pointer(p)).FpBt)).FnPage = U32(0)
@@ -45685,7 +46282,7 @@ func Xsqlite3BtreeNewDb(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:68815:20:
// no progress. By returning SQLITE_BUSY and not invoking the busy callback
// when A already has a read lock, we encourage A to give up and let B
// proceed.
-func Xsqlite3BtreeBeginTrans(tls *libc.TLS, p uintptr, wrflag int32, pSchemaVersion uintptr) int32 { /* sqlite3.c:68859:20: */
+func Xsqlite3BtreeBeginTrans(tls *libc.TLS, p uintptr, wrflag int32, pSchemaVersion uintptr) int32 { /* sqlite3.c:68976:20: */
var pBt uintptr
var pPager uintptr
var rc int32
@@ -45701,23 +46298,23 @@ func Xsqlite3BtreeBeginTrans(tls *libc.TLS, p uintptr, wrflag int32, pSchemaVers
// If the btree is already in a write-transaction, or it
// is already in a read-transaction and a read-transaction
// is requested, this is a no-op.
- if !((int32((*Btree)(unsafe.Pointer(p)).FinTrans) == TRANS_WRITE) || ((int32((*Btree)(unsafe.Pointer(p)).FinTrans) == TRANS_READ) && !(wrflag != 0))) {
+ if !(int32((*Btree)(unsafe.Pointer(p)).FinTrans) == TRANS_WRITE || int32((*Btree)(unsafe.Pointer(p)).FinTrans) == TRANS_READ && !(wrflag != 0)) {
goto __1
}
goto trans_begun
__1:
;
- if !((((*Sqlite3)(unsafe.Pointer((*Btree)(unsafe.Pointer(p)).Fdb)).Fflags & uint64(SQLITE_ResetDatabase)) != 0) &&
- (int32(Xsqlite3PagerIsreadonly(tls, pPager)) == 0)) {
+ if !((*Sqlite3)(unsafe.Pointer((*Btree)(unsafe.Pointer(p)).Fdb)).Fflags&uint64(SQLITE_ResetDatabase) != 0 &&
+ int32(Xsqlite3PagerIsreadonly(tls, pPager)) == 0) {
goto __2
}
- *(*U16)(unsafe.Pointer(pBt + 24 /* &.btsFlags */)) &= libc.Uint16FromInt32((libc.CplInt32(BTS_READ_ONLY)))
+ *(*U16)(unsafe.Pointer(pBt + 24)) &= libc.Uint16FromInt32(libc.CplInt32(BTS_READ_ONLY))
__2:
;
// Write transactions are not possible on a read-only database
- if !(((int32((*BtShared)(unsafe.Pointer(pBt)).FbtsFlags) & BTS_READ_ONLY) != 0) && (wrflag != 0)) {
+ if !(int32((*BtShared)(unsafe.Pointer(pBt)).FbtsFlags)&BTS_READ_ONLY != 0 && wrflag != 0) {
goto __3
}
rc = SQLITE_READONLY
@@ -45729,8 +46326,8 @@ __3:
// If another database handle has already opened a write transaction
// on this shared-btree structure and a second write transaction is
// requested, return SQLITE_LOCKED.
- if !(((wrflag != 0) && (int32((*BtShared)(unsafe.Pointer(pBt)).FinTransaction) == TRANS_WRITE)) ||
- ((int32((*BtShared)(unsafe.Pointer(pBt)).FbtsFlags) & BTS_PENDING) != 0)) {
+ if !(wrflag != 0 && int32((*BtShared)(unsafe.Pointer(pBt)).FinTransaction) == TRANS_WRITE ||
+ int32((*BtShared)(unsafe.Pointer(pBt)).FbtsFlags)&BTS_PENDING != 0) {
goto __4
}
pBlock = (*Btree)(unsafe.Pointer((*BtShared)(unsafe.Pointer(pBt)).FpWriter)).Fdb
@@ -45766,7 +46363,7 @@ __5:
goto __11
}
Xsqlite3ConnectionBlocked(tls, (*Btree)(unsafe.Pointer(p)).Fdb, pBlock)
- rc = (SQLITE_LOCKED | (int32(1) << 8))
+ rc = SQLITE_LOCKED | int32(1)<<8
goto trans_begun
__11:
;
@@ -45782,11 +46379,11 @@ __11:
__12:
;
- *(*U16)(unsafe.Pointer(pBt + 24 /* &.btsFlags */)) &= libc.Uint16FromInt32((libc.CplInt32(BTS_INITIALLY_EMPTY)))
+ *(*U16)(unsafe.Pointer(pBt + 24)) &= libc.Uint16FromInt32(libc.CplInt32(BTS_INITIALLY_EMPTY))
if !((*BtShared)(unsafe.Pointer(pBt)).FnPage == U32(0)) {
goto __13
}
- *(*U16)(unsafe.Pointer(pBt + 24 /* &.btsFlags */)) |= U16((BTS_INITIALLY_EMPTY))
+ *(*U16)(unsafe.Pointer(pBt + 24)) |= U16(BTS_INITIALLY_EMPTY)
__13:
;
__14:
@@ -45799,30 +46396,30 @@ __14:
// file is not pBt->pageSize. In this case lockBtree() will update
// pBt->pageSize to the page-size of the file on disk.
__17:
- if !(((*BtShared)(unsafe.Pointer(pBt)).FpPage1 == uintptr(0)) && (SQLITE_OK == (libc.AssignInt32(&rc, lockBtree(tls, pBt))))) {
+ if !((*BtShared)(unsafe.Pointer(pBt)).FpPage1 == uintptr(0) && SQLITE_OK == libc.AssignInt32(&rc, lockBtree(tls, pBt))) {
goto __18
}
goto __17
__18:
;
- if !((rc == SQLITE_OK) && (wrflag != 0)) {
+ if !(rc == SQLITE_OK && wrflag != 0) {
goto __19
}
- if !((int32((*BtShared)(unsafe.Pointer(pBt)).FbtsFlags) & BTS_READ_ONLY) != 0) {
+ if !(int32((*BtShared)(unsafe.Pointer(pBt)).FbtsFlags)&BTS_READ_ONLY != 0) {
goto __20
}
rc = SQLITE_READONLY
goto __21
__20:
- rc = Xsqlite3PagerBegin(tls, pPager, (libc.Bool32(wrflag > 1)), Xsqlite3TempInMemory(tls, (*Btree)(unsafe.Pointer(p)).Fdb))
+ rc = Xsqlite3PagerBegin(tls, pPager, libc.Bool32(wrflag > 1), Xsqlite3TempInMemory(tls, (*Btree)(unsafe.Pointer(p)).Fdb))
if !(rc == SQLITE_OK) {
goto __22
}
rc = newDatabase(tls, pBt)
goto __23
__22:
- if !((rc == (SQLITE_BUSY | (int32(2) << 8))) && (int32((*BtShared)(unsafe.Pointer(pBt)).FinTransaction) == TRANS_NONE)) {
+ if !(rc == SQLITE_BUSY|int32(2)<<8 && int32((*BtShared)(unsafe.Pointer(pBt)).FinTransaction) == TRANS_NONE) {
goto __24
}
// if there was no transaction opened when this function was
@@ -45847,7 +46444,7 @@ __25:
;
goto __15
__15:
- if (((rc & 0xFF) == SQLITE_BUSY) && (int32((*BtShared)(unsafe.Pointer(pBt)).FinTransaction) == TRANS_NONE)) && (btreeInvokeBusyHandler(tls, pBt) != 0) {
+ if rc&0xFF == SQLITE_BUSY && int32((*BtShared)(unsafe.Pointer(pBt)).FinTransaction) == TRANS_NONE && btreeInvokeBusyHandler(tls, pBt) != 0 {
goto __14
}
goto __16
@@ -45867,7 +46464,7 @@ __16:
(*Btree)(unsafe.Pointer(p)).Flock.FeLock = U8(READ_LOCK)
(*Btree)(unsafe.Pointer(p)).Flock.FpNext = (*BtShared)(unsafe.Pointer(pBt)).FpLock
- (*BtShared)(unsafe.Pointer(pBt)).FpLock = (p + 32 /* &.lock */)
+ (*BtShared)(unsafe.Pointer(pBt)).FpLock = p + 32
__28:
;
__27:
@@ -45890,11 +46487,11 @@ __29:
pPage1 = (*BtShared)(unsafe.Pointer(pBt)).FpPage1
(*BtShared)(unsafe.Pointer(pBt)).FpWriter = p
- *(*U16)(unsafe.Pointer(pBt + 24 /* &.btsFlags */)) &= libc.Uint16FromInt32((libc.CplInt32(BTS_EXCLUSIVE)))
+ *(*U16)(unsafe.Pointer(pBt + 24)) &= libc.Uint16FromInt32(libc.CplInt32(BTS_EXCLUSIVE))
if !(wrflag > 1) {
goto __31
}
- *(*U16)(unsafe.Pointer(pBt + 24 /* &.btsFlags */)) |= U16((BTS_EXCLUSIVE))
+ *(*U16)(unsafe.Pointer(pBt + 24)) |= U16(BTS_EXCLUSIVE)
__31:
;
@@ -45903,14 +46500,14 @@ __31:
// this sooner rather than later means the database size can safely
// re-read the database size from page 1 if a savepoint or transaction
// rollback occurs within the transaction.
- if !((*BtShared)(unsafe.Pointer(pBt)).FnPage != Xsqlite3Get4byte(tls, ((*MemPage)(unsafe.Pointer(pPage1)).FaData+28))) {
+ if !((*BtShared)(unsafe.Pointer(pBt)).FnPage != Xsqlite3Get4byte(tls, (*MemPage)(unsafe.Pointer(pPage1)).FaData+28)) {
goto __32
}
rc = Xsqlite3PagerWrite(tls, (*MemPage)(unsafe.Pointer(pPage1)).FpDbPage)
if !(rc == SQLITE_OK) {
goto __33
}
- Xsqlite3Put4byte(tls, ((*MemPage)(unsafe.Pointer(pPage1)).FaData + 28), (*BtShared)(unsafe.Pointer(pBt)).FnPage)
+ Xsqlite3Put4byte(tls, (*MemPage)(unsafe.Pointer(pPage1)).FaData+28, (*BtShared)(unsafe.Pointer(pBt)).FnPage)
__33:
;
__32:
@@ -45927,7 +46524,7 @@ trans_begun:
if !(pSchemaVersion != 0) {
goto __35
}
- *(*int32)(unsafe.Pointer(pSchemaVersion)) = int32(Xsqlite3Get4byte(tls, ((*MemPage)(unsafe.Pointer((*BtShared)(unsafe.Pointer(pBt)).FpPage1)).FaData + 40)))
+ *(*int32)(unsafe.Pointer(pSchemaVersion)) = int32(Xsqlite3Get4byte(tls, (*MemPage)(unsafe.Pointer((*BtShared)(unsafe.Pointer(pBt)).FpPage1)).FaData+40))
__35:
;
if !(wrflag != 0) {
@@ -45949,7 +46546,7 @@ __34:
// Set the pointer-map entries for all children of page pPage. Also, if
// pPage contains cells that point to overflow pages, set the pointer
// map entries for the overflow pages as well.
-func setChildPtrmaps(tls *libc.TLS, pPage uintptr) int32 { /* sqlite3.c:69039:12: */
+func setChildPtrmaps(tls *libc.TLS, pPage uintptr) int32 { /* sqlite3.c:69156:12: */
bp := tls.Alloc(4)
defer tls.Free(4)
@@ -45965,13 +46562,13 @@ func setChildPtrmaps(tls *libc.TLS, pPage uintptr) int32 { /* sqlite3.c:69039:12
} else {
*(*int32)(unsafe.Pointer(bp /* rc */)) = btreeInitPage(tls, pPage)
}
- if *(*int32)(unsafe.Pointer(bp /* rc */)) != SQLITE_OK {
+ if *(*int32)(unsafe.Pointer(bp)) != SQLITE_OK {
return *(*int32)(unsafe.Pointer(bp /* rc */))
}
nCell = int32((*MemPage)(unsafe.Pointer(pPage)).FnCell)
for i = 0; i < nCell; i++ {
- var pCell uintptr = ((*MemPage)(unsafe.Pointer((pPage))).FaData + uintptr((int32((*MemPage)(unsafe.Pointer((pPage))).FmaskPage) & int32(libc.X__builtin_bswap16(tls, *(*U16)(unsafe.Pointer(((*MemPage)(unsafe.Pointer((pPage))).FaCellIdx + uintptr((2 * (i)))))))))))
+ var pCell uintptr = (*MemPage)(unsafe.Pointer(pPage)).FaData + uintptr(int32((*MemPage)(unsafe.Pointer(pPage)).FmaskPage)&int32(libc.X__builtin_bswap16(tls, *(*U16)(unsafe.Pointer((*MemPage)(unsafe.Pointer(pPage)).FaCellIdx + uintptr(2*i))))))
ptrmapPutOvflPtr(tls, pPage, pPage, pCell, bp /* &rc */)
@@ -45982,7 +46579,7 @@ func setChildPtrmaps(tls *libc.TLS, pPage uintptr) int32 { /* sqlite3.c:69039:12
}
if !(int32((*MemPage)(unsafe.Pointer(pPage)).Fleaf) != 0) {
- var childPgno Pgno = Xsqlite3Get4byte(tls, ((*MemPage)(unsafe.Pointer(pPage)).FaData + uintptr((int32((*MemPage)(unsafe.Pointer(pPage)).FhdrOffset) + 8))))
+ var childPgno Pgno = Xsqlite3Get4byte(tls, (*MemPage)(unsafe.Pointer(pPage)).FaData+uintptr(int32((*MemPage)(unsafe.Pointer(pPage)).FhdrOffset)+8))
ptrmapPut(tls, pBt, childPgno, uint8(PTRMAP_BTREE), pgno, bp /* &rc */)
}
@@ -46001,14 +46598,14 @@ func setChildPtrmaps(tls *libc.TLS, pPage uintptr) int32 { /* sqlite3.c:69039:12
//
// PTRMAP_OVERFLOW2: pPage is an overflow-page. The pointer points at the next
// overflow page in the list.
-func modifyPagePointer(tls *libc.TLS, pPage uintptr, iFrom Pgno, iTo Pgno, eType U8) int32 { /* sqlite3.c:69084:12: */
+func modifyPagePointer(tls *libc.TLS, pPage uintptr, iFrom Pgno, iTo Pgno, eType U8) int32 { /* sqlite3.c:69201:12: */
bp := tls.Alloc(24)
defer tls.Free(24)
if int32(eType) == PTRMAP_OVERFLOW2 {
// The pointer is always the first 4 bytes of the page in this case.
if Xsqlite3Get4byte(tls, (*MemPage)(unsafe.Pointer(pPage)).FaData) != iFrom {
- return Xsqlite3CorruptError(tls, 69090)
+ return Xsqlite3CorruptError(tls, 69207)
}
Xsqlite3Put4byte(tls, (*MemPage)(unsafe.Pointer(pPage)).FaData, iTo)
} else {
@@ -46027,19 +46624,19 @@ func modifyPagePointer(tls *libc.TLS, pPage uintptr, iFrom Pgno, iTo Pgno, eType
nCell = int32((*MemPage)(unsafe.Pointer(pPage)).FnCell)
for i = 0; i < nCell; i++ {
- var pCell uintptr = ((*MemPage)(unsafe.Pointer((pPage))).FaData + uintptr((int32((*MemPage)(unsafe.Pointer((pPage))).FmaskPage) & int32(libc.X__builtin_bswap16(tls, *(*U16)(unsafe.Pointer(((*MemPage)(unsafe.Pointer((pPage))).FaCellIdx + uintptr((2 * (i)))))))))))
+ var pCell uintptr = (*MemPage)(unsafe.Pointer(pPage)).FaData + uintptr(int32((*MemPage)(unsafe.Pointer(pPage)).FmaskPage)&int32(libc.X__builtin_bswap16(tls, *(*U16)(unsafe.Pointer((*MemPage)(unsafe.Pointer(pPage)).FaCellIdx + uintptr(2*i))))))
if int32(eType) == PTRMAP_OVERFLOW1 {
// var info CellInfo at bp, 24
(*struct {
f func(*libc.TLS, uintptr, uintptr, uintptr)
})(unsafe.Pointer(&struct{ uintptr }{(*MemPage)(unsafe.Pointer(pPage)).FxParseCell})).f(tls, pPage, pCell, bp /* &info */)
- if U32((*CellInfo)(unsafe.Pointer(bp /* &info */)).FnLocal) < (*CellInfo)(unsafe.Pointer(bp /* &info */)).FnPayload {
- if (pCell + uintptr((*CellInfo)(unsafe.Pointer(bp /* &info */)).FnSize)) > ((*MemPage)(unsafe.Pointer(pPage)).FaData + uintptr((*BtShared)(unsafe.Pointer((*MemPage)(unsafe.Pointer(pPage)).FpBt)).FusableSize)) {
- return Xsqlite3CorruptError(tls, 69109)
+ if U32((*CellInfo)(unsafe.Pointer(bp)).FnLocal) < (*CellInfo)(unsafe.Pointer(bp)).FnPayload {
+ if pCell+uintptr((*CellInfo)(unsafe.Pointer(bp)).FnSize) > (*MemPage)(unsafe.Pointer(pPage)).FaData+uintptr((*BtShared)(unsafe.Pointer((*MemPage)(unsafe.Pointer(pPage)).FpBt)).FusableSize) {
+ return Xsqlite3CorruptError(tls, 69226)
}
- if iFrom == Xsqlite3Get4byte(tls, ((pCell+uintptr((*CellInfo)(unsafe.Pointer(bp /* &info */)).FnSize))-uintptr(4))) {
- Xsqlite3Put4byte(tls, ((pCell + uintptr((*CellInfo)(unsafe.Pointer(bp /* &info */)).FnSize)) - uintptr(4)), iTo)
+ if iFrom == Xsqlite3Get4byte(tls, pCell+uintptr((*CellInfo)(unsafe.Pointer(bp)).FnSize)-uintptr(4)) {
+ Xsqlite3Put4byte(tls, pCell+uintptr((*CellInfo)(unsafe.Pointer(bp)).FnSize)-uintptr(4), iTo)
break
}
}
@@ -46052,10 +46649,10 @@ func modifyPagePointer(tls *libc.TLS, pPage uintptr, iFrom Pgno, iTo Pgno, eType
}
if i == nCell {
- if (int32(eType) != PTRMAP_BTREE) || (Xsqlite3Get4byte(tls, ((*MemPage)(unsafe.Pointer(pPage)).FaData+uintptr((int32((*MemPage)(unsafe.Pointer(pPage)).FhdrOffset)+8)))) != iFrom) {
- return Xsqlite3CorruptError(tls, 69127)
+ if int32(eType) != PTRMAP_BTREE || Xsqlite3Get4byte(tls, (*MemPage)(unsafe.Pointer(pPage)).FaData+uintptr(int32((*MemPage)(unsafe.Pointer(pPage)).FhdrOffset)+8)) != iFrom {
+ return Xsqlite3CorruptError(tls, 69244)
}
- Xsqlite3Put4byte(tls, ((*MemPage)(unsafe.Pointer(pPage)).FaData + uintptr((int32((*MemPage)(unsafe.Pointer(pPage)).FhdrOffset) + 8))), iTo)
+ Xsqlite3Put4byte(tls, (*MemPage)(unsafe.Pointer(pPage)).FaData+uintptr(int32((*MemPage)(unsafe.Pointer(pPage)).FhdrOffset)+8), iTo)
}
}
return SQLITE_OK
@@ -46068,7 +46665,7 @@ func modifyPagePointer(tls *libc.TLS, pPage uintptr, iFrom Pgno, iTo Pgno, eType
// the journal needs to be sync()ed before database page pDbPage->pgno
// can be written to. The caller has already promised not to write to that
// page.
-func relocatePage(tls *libc.TLS, pBt uintptr, pDbPage uintptr, eType U8, iPtrPage Pgno, iFreePage Pgno, isCommit int32) int32 { /* sqlite3.c:69145:12: */
+func relocatePage(tls *libc.TLS, pBt uintptr, pDbPage uintptr, eType U8, iPtrPage Pgno, iFreePage Pgno, isCommit int32) int32 { /* sqlite3.c:69262:12: */
bp := tls.Alloc(8)
defer tls.Free(8)
@@ -46079,13 +46676,13 @@ func relocatePage(tls *libc.TLS, pBt uintptr, pDbPage uintptr, eType U8, iPtrPag
// var rc int32 at bp, 4
if iDbPage < Pgno(3) {
- return Xsqlite3CorruptError(tls, 69162)
+ return Xsqlite3CorruptError(tls, 69279)
}
// Move page iDbPage from its current location to page number iFreePage
*(*int32)(unsafe.Pointer(bp /* rc */)) = Xsqlite3PagerMovepage(tls, pPager, (*MemPage)(unsafe.Pointer(pDbPage)).FpDbPage, iFreePage, isCommit)
- if *(*int32)(unsafe.Pointer(bp /* rc */)) != SQLITE_OK {
+ if *(*int32)(unsafe.Pointer(bp)) != SQLITE_OK {
return *(*int32)(unsafe.Pointer(bp /* rc */))
}
(*MemPage)(unsafe.Pointer(pDbPage)).Fpgno = iFreePage
@@ -46097,16 +46694,16 @@ func relocatePage(tls *libc.TLS, pBt uintptr, pDbPage uintptr, eType U8, iPtrPag
// If pDbPage is an overflow page, then the first 4 bytes may store a
// pointer to a subsequent overflow page. If this is the case, then
// the pointer map needs to be updated for the subsequent overflow page.
- if (int32(eType) == PTRMAP_BTREE) || (int32(eType) == PTRMAP_ROOTPAGE) {
+ if int32(eType) == PTRMAP_BTREE || int32(eType) == PTRMAP_ROOTPAGE {
*(*int32)(unsafe.Pointer(bp /* rc */)) = setChildPtrmaps(tls, pDbPage)
- if *(*int32)(unsafe.Pointer(bp /* rc */)) != SQLITE_OK {
+ if *(*int32)(unsafe.Pointer(bp)) != SQLITE_OK {
return *(*int32)(unsafe.Pointer(bp /* rc */))
}
} else {
var nextOvfl Pgno = Xsqlite3Get4byte(tls, (*MemPage)(unsafe.Pointer(pDbPage)).FaData)
if nextOvfl != Pgno(0) {
ptrmapPut(tls, pBt, nextOvfl, uint8(PTRMAP_OVERFLOW2), iFreePage, bp /* &rc */)
- if *(*int32)(unsafe.Pointer(bp /* rc */)) != SQLITE_OK {
+ if *(*int32)(unsafe.Pointer(bp)) != SQLITE_OK {
return *(*int32)(unsafe.Pointer(bp /* rc */))
}
}
@@ -46117,17 +46714,17 @@ func relocatePage(tls *libc.TLS, pBt uintptr, pDbPage uintptr, eType U8, iPtrPag
// iPtrPage.
if int32(eType) != PTRMAP_ROOTPAGE {
*(*int32)(unsafe.Pointer(bp /* rc */)) = btreeGetPage(tls, pBt, iPtrPage, bp+4 /* &pPtrPage */, 0)
- if *(*int32)(unsafe.Pointer(bp /* rc */)) != SQLITE_OK {
+ if *(*int32)(unsafe.Pointer(bp)) != SQLITE_OK {
return *(*int32)(unsafe.Pointer(bp /* rc */))
}
*(*int32)(unsafe.Pointer(bp /* rc */)) = Xsqlite3PagerWrite(tls, (*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 4 /* pPtrPage */)))).FpDbPage)
- if *(*int32)(unsafe.Pointer(bp /* rc */)) != SQLITE_OK {
+ if *(*int32)(unsafe.Pointer(bp)) != SQLITE_OK {
releasePage(tls, *(*uintptr)(unsafe.Pointer(bp + 4 /* pPtrPage */)))
return *(*int32)(unsafe.Pointer(bp /* rc */))
}
*(*int32)(unsafe.Pointer(bp /* rc */)) = modifyPagePointer(tls, *(*uintptr)(unsafe.Pointer(bp + 4 /* pPtrPage */)), iDbPage, iFreePage, eType)
releasePage(tls, *(*uintptr)(unsafe.Pointer(bp + 4 /* pPtrPage */)))
- if *(*int32)(unsafe.Pointer(bp /* rc */)) == SQLITE_OK {
+ if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK {
ptrmapPut(tls, pBt, iFreePage, eType, iPtrPage, bp /* &rc */)
}
}
@@ -46149,19 +46746,19 @@ func relocatePage(tls *libc.TLS, pBt uintptr, pDbPage uintptr, eType U8, iPtrPag
// caller will keep calling incrVacuumStep() until it returns SQLITE_DONE
// or an error. bCommit is passed true for an auto-vacuum-on-commit
// operation, or false for an incremental vacuum.
-func incrVacuumStep(tls *libc.TLS, pBt uintptr, nFin Pgno, iLastPg Pgno, bCommit int32) int32 { /* sqlite3.c:69239:12: */
+func incrVacuumStep(tls *libc.TLS, pBt uintptr, nFin Pgno, iLastPg Pgno, bCommit int32) int32 { /* sqlite3.c:69356:12: */
bp := tls.Alloc(28)
defer tls.Free(28)
var nFreeList Pgno // Number of pages still on the free-list
var rc int32
- if !(ptrmapPageno(tls, pBt, iLastPg) == (iLastPg)) && (iLastPg != ((U32(Xsqlite3PendingByte) / ((*BtShared)(unsafe.Pointer(pBt)).FpageSize)) + U32(1))) {
+ if !(ptrmapPageno(tls, pBt, iLastPg) == iLastPg) && iLastPg != U32(Xsqlite3PendingByte)/(*BtShared)(unsafe.Pointer(pBt)).FpageSize+U32(1) {
// var eType U8 at bp, 1
// var iPtrPage Pgno at bp+4, 4
- nFreeList = Xsqlite3Get4byte(tls, ((*MemPage)(unsafe.Pointer((*BtShared)(unsafe.Pointer(pBt)).FpPage1)).FaData + 36))
+ nFreeList = Xsqlite3Get4byte(tls, (*MemPage)(unsafe.Pointer((*BtShared)(unsafe.Pointer(pBt)).FpPage1)).FaData+36)
if nFreeList == Pgno(0) {
return SQLITE_DONE
}
@@ -46170,11 +46767,11 @@ func incrVacuumStep(tls *libc.TLS, pBt uintptr, nFin Pgno, iLastPg Pgno, bCommit
if rc != SQLITE_OK {
return rc
}
- if int32(*(*U8)(unsafe.Pointer(bp /* eType */))) == PTRMAP_ROOTPAGE {
- return Xsqlite3CorruptError(tls, 69260)
+ if int32(*(*U8)(unsafe.Pointer(bp))) == PTRMAP_ROOTPAGE {
+ return Xsqlite3CorruptError(tls, 69377)
}
- if int32(*(*U8)(unsafe.Pointer(bp /* eType */))) == PTRMAP_FREEPAGE {
+ if int32(*(*U8)(unsafe.Pointer(bp))) == PTRMAP_FREEPAGE {
if bCommit == 0 {
// Remove the page from the files free-list. This is not required
// if bCommit is non-zero. In that case, the free-list will be
@@ -46214,7 +46811,7 @@ func incrVacuumStep(tls *libc.TLS, pBt uintptr, nFin Pgno, iLastPg Pgno, bCommit
eMode = U8(BTALLOC_LE)
iNear = nFin
}
- for ok := true; ok; ok = ((bCommit != 0) && (*(*Pgno)(unsafe.Pointer(bp + 24 /* iFreePg */)) > nFin)) {
+ for ok := true; ok; ok = bCommit != 0 && *(*Pgno)(unsafe.Pointer(bp + 24)) > nFin {
// var pFreePg uintptr at bp+20, 4
rc = allocateBtreePage(tls, pBt, bp+20 /* &pFreePg */, bp+24 /* &iFreePg */, iNear, eMode)
@@ -46234,7 +46831,7 @@ func incrVacuumStep(tls *libc.TLS, pBt uintptr, nFin Pgno, iLastPg Pgno, bCommit
}
if bCommit == 0 {
- for ok1 := true; ok1; ok1 = ((iLastPg == ((U32(Xsqlite3PendingByte) / ((*BtShared)(unsafe.Pointer(pBt)).FpageSize)) + U32(1))) || (ptrmapPageno(tls, pBt, iLastPg) == (iLastPg))) {
+ for ok1 := true; ok1; ok1 = iLastPg == U32(Xsqlite3PendingByte)/(*BtShared)(unsafe.Pointer(pBt)).FpageSize+U32(1) || ptrmapPageno(tls, pBt, iLastPg) == iLastPg {
iLastPg--
}
(*BtShared)(unsafe.Pointer(pBt)).FbDoTruncate = U8(1)
@@ -46246,18 +46843,18 @@ func incrVacuumStep(tls *libc.TLS, pBt uintptr, nFin Pgno, iLastPg Pgno, bCommit
// The database opened by the first argument is an auto-vacuum database
// nOrig pages in size containing nFree free pages. Return the expected
// size of the database in pages following an auto-vacuum operation.
-func finalDbSize(tls *libc.TLS, pBt uintptr, nOrig Pgno, nFree Pgno) Pgno { /* sqlite3.c:69335:13: */
+func finalDbSize(tls *libc.TLS, pBt uintptr, nOrig Pgno, nFree Pgno) Pgno { /* sqlite3.c:69452:13: */
var nEntry int32 // Number of entries on one ptrmap page
var nPtrmap Pgno // Number of PtrMap pages to be freed
var nFin Pgno // Return value
- nEntry = (int32((*BtShared)(unsafe.Pointer(pBt)).FusableSize / U32(5)))
- nPtrmap = ((((nFree - nOrig) + ptrmapPageno(tls, pBt, nOrig)) + Pgno(nEntry)) / Pgno(nEntry))
- nFin = ((nOrig - nFree) - nPtrmap)
- if (nOrig > ((U32(Xsqlite3PendingByte) / ((*BtShared)(unsafe.Pointer(pBt)).FpageSize)) + U32(1))) && (nFin < ((U32(Xsqlite3PendingByte) / ((*BtShared)(unsafe.Pointer(pBt)).FpageSize)) + U32(1))) {
+ nEntry = int32((*BtShared)(unsafe.Pointer(pBt)).FusableSize / U32(5))
+ nPtrmap = (nFree - nOrig + ptrmapPageno(tls, pBt, nOrig) + Pgno(nEntry)) / Pgno(nEntry)
+ nFin = nOrig - nFree - nPtrmap
+ if nOrig > U32(Xsqlite3PendingByte)/(*BtShared)(unsafe.Pointer(pBt)).FpageSize+U32(1) && nFin < U32(Xsqlite3PendingByte)/(*BtShared)(unsafe.Pointer(pBt)).FpageSize+U32(1) {
nFin--
}
- for (ptrmapPageno(tls, pBt, nFin) == (nFin)) || (nFin == ((U32(Xsqlite3PendingByte) / ((*BtShared)(unsafe.Pointer(pBt)).FpageSize)) + U32(1))) {
+ for ptrmapPageno(tls, pBt, nFin) == nFin || nFin == U32(Xsqlite3PendingByte)/(*BtShared)(unsafe.Pointer(pBt)).FpageSize+U32(1) {
nFin--
}
@@ -46270,7 +46867,7 @@ func finalDbSize(tls *libc.TLS, pBt uintptr, nOrig Pgno, nFree Pgno) Pgno { /* s
// If the incremental vacuum is finished after this function has run,
// SQLITE_DONE is returned. If it is not finished, but no error occurred,
// SQLITE_OK is returned. Otherwise an SQLite error code.
-func Xsqlite3BtreeIncrVacuum(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:69361:20: */
+func Xsqlite3BtreeIncrVacuum(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:69478:20: */
var rc int32
var pBt uintptr = (*Btree)(unsafe.Pointer(p)).FpBt
@@ -46280,11 +46877,11 @@ func Xsqlite3BtreeIncrVacuum(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:6936
rc = SQLITE_DONE
} else {
var nOrig Pgno = btreePagecount(tls, pBt)
- var nFree Pgno = Xsqlite3Get4byte(tls, ((*MemPage)(unsafe.Pointer((*BtShared)(unsafe.Pointer(pBt)).FpPage1)).FaData + 36))
+ var nFree Pgno = Xsqlite3Get4byte(tls, (*MemPage)(unsafe.Pointer((*BtShared)(unsafe.Pointer(pBt)).FpPage1)).FaData+36)
var nFin Pgno = finalDbSize(tls, pBt, nOrig, nFree)
- if (nOrig < nFin) || (nFree >= nOrig) {
- rc = Xsqlite3CorruptError(tls, 69375)
+ if nOrig < nFin || nFree >= nOrig {
+ rc = Xsqlite3CorruptError(tls, 69492)
} else if nFree > Pgno(0) {
rc = saveAllCursors(tls, pBt, uint32(0), uintptr(0))
if rc == SQLITE_OK {
@@ -46293,7 +46890,7 @@ func Xsqlite3BtreeIncrVacuum(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:6936
}
if rc == SQLITE_OK {
rc = Xsqlite3PagerWrite(tls, (*MemPage)(unsafe.Pointer((*BtShared)(unsafe.Pointer(pBt)).FpPage1)).FpDbPage)
- Xsqlite3Put4byte(tls, ((*MemPage)(unsafe.Pointer((*BtShared)(unsafe.Pointer(pBt)).FpPage1)).FaData + 28), (*BtShared)(unsafe.Pointer(pBt)).FnPage)
+ Xsqlite3Put4byte(tls, (*MemPage)(unsafe.Pointer((*BtShared)(unsafe.Pointer(pBt)).FpPage1)).FaData+28, (*BtShared)(unsafe.Pointer(pBt)).FnPage)
}
} else {
rc = SQLITE_DONE
@@ -46305,47 +46902,75 @@ func Xsqlite3BtreeIncrVacuum(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:6936
// This routine is called prior to sqlite3PagerCommit when a transaction
// is committed for an auto-vacuum database.
-//
-// If SQLITE_OK is returned, then *pnTrunc is set to the number of pages
-// the database file should be truncated to during the commit process.
-// i.e. the database has been reorganized so that only the first *pnTrunc
-// pages are in use.
-func autoVacuumCommit(tls *libc.TLS, pBt uintptr) int32 { /* sqlite3.c:69403:12: */
+func autoVacuumCommit(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:69515:12: */
var rc int32 = SQLITE_OK
- var pPager uintptr = (*BtShared)(unsafe.Pointer(pBt)).FpPager
+ var pPager uintptr
+ var pBt uintptr
+ var db uintptr
+
+ pBt = (*Btree)(unsafe.Pointer(p)).FpBt
+ pPager = (*BtShared)(unsafe.Pointer(pBt)).FpPager
invalidateAllOverflowCache(tls, pBt)
if !(int32((*BtShared)(unsafe.Pointer(pBt)).FincrVacuum) != 0) {
var nFin Pgno // Number of pages in database after autovacuuming
var nFree Pgno // Number of pages on the freelist initially
+ var nVac Pgno // Number of pages to vacuum
var iFree Pgno // The next page to be freed
var nOrig Pgno // Database size before freeing
nOrig = btreePagecount(tls, pBt)
- if (ptrmapPageno(tls, pBt, nOrig) == (nOrig)) || (nOrig == ((U32(Xsqlite3PendingByte) / ((*BtShared)(unsafe.Pointer(pBt)).FpageSize)) + U32(1))) {
+ if ptrmapPageno(tls, pBt, nOrig) == nOrig || nOrig == U32(Xsqlite3PendingByte)/(*BtShared)(unsafe.Pointer(pBt)).FpageSize+U32(1) {
// It is not possible to create a database for which the final page
// is either a pointer-map page or the pending-byte page. If one
// is encountered, this indicates corruption.
- return Xsqlite3CorruptError(tls, 69423)
+ return Xsqlite3CorruptError(tls, 69543)
}
- nFree = Xsqlite3Get4byte(tls, ((*MemPage)(unsafe.Pointer((*BtShared)(unsafe.Pointer(pBt)).FpPage1)).FaData + 36))
- nFin = finalDbSize(tls, pBt, nOrig, nFree)
+ nFree = Xsqlite3Get4byte(tls, (*MemPage)(unsafe.Pointer((*BtShared)(unsafe.Pointer(pBt)).FpPage1)).FaData+36)
+ db = (*Btree)(unsafe.Pointer(p)).Fdb
+ if (*Sqlite3)(unsafe.Pointer(db)).FxAutovacPages != 0 {
+ var iDb int32
+ for iDb = 0; iDb < (*Sqlite3)(unsafe.Pointer(db)).FnDb; iDb++ {
+ if (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+uintptr(iDb)*16)).FpBt == p {
+ break
+ }
+ }
+ nVac = (*struct {
+ f func(*libc.TLS, uintptr, uintptr, U32, U32, U32) uint32
+ })(unsafe.Pointer(&struct{ uintptr }{(*Sqlite3)(unsafe.Pointer(db)).FxAutovacPages})).f(tls,
+ (*Sqlite3)(unsafe.Pointer(db)).FpAutovacPagesArg,
+ (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+uintptr(iDb)*16)).FzDbSName,
+ nOrig,
+ nFree,
+ (*BtShared)(unsafe.Pointer(pBt)).FpageSize)
+ if nVac > nFree {
+ nVac = nFree
+ }
+ if nVac == Pgno(0) {
+ return SQLITE_OK
+ }
+ } else {
+ nVac = nFree
+ }
+ nFin = finalDbSize(tls, pBt, nOrig, nVac)
if nFin > nOrig {
- return Xsqlite3CorruptError(tls, 69428)
+ return Xsqlite3CorruptError(tls, 69570)
}
if nFin < nOrig {
rc = saveAllCursors(tls, pBt, uint32(0), uintptr(0))
}
- for iFree = nOrig; (iFree > nFin) && (rc == SQLITE_OK); iFree-- {
- rc = incrVacuumStep(tls, pBt, nFin, iFree, 1)
+ for iFree = nOrig; iFree > nFin && rc == SQLITE_OK; iFree-- {
+ rc = incrVacuumStep(tls, pBt, nFin, iFree, libc.Bool32(nVac == nFree))
}
- if ((rc == SQLITE_DONE) || (rc == SQLITE_OK)) && (nFree > Pgno(0)) {
+ if (rc == SQLITE_DONE || rc == SQLITE_OK) && nFree > Pgno(0) {
rc = Xsqlite3PagerWrite(tls, (*MemPage)(unsafe.Pointer((*BtShared)(unsafe.Pointer(pBt)).FpPage1)).FpDbPage)
- Xsqlite3Put4byte(tls, ((*MemPage)(unsafe.Pointer((*BtShared)(unsafe.Pointer(pBt)).FpPage1)).FaData + 32), uint32(0))
- Xsqlite3Put4byte(tls, ((*MemPage)(unsafe.Pointer((*BtShared)(unsafe.Pointer(pBt)).FpPage1)).FaData + 36), uint32(0))
- Xsqlite3Put4byte(tls, ((*MemPage)(unsafe.Pointer((*BtShared)(unsafe.Pointer(pBt)).FpPage1)).FaData + 28), nFin)
+ if nVac == nFree {
+ Xsqlite3Put4byte(tls, (*MemPage)(unsafe.Pointer((*BtShared)(unsafe.Pointer(pBt)).FpPage1)).FaData+32, uint32(0))
+ Xsqlite3Put4byte(tls, (*MemPage)(unsafe.Pointer((*BtShared)(unsafe.Pointer(pBt)).FpPage1)).FaData+36, uint32(0))
+ }
+ Xsqlite3Put4byte(tls, (*MemPage)(unsafe.Pointer((*BtShared)(unsafe.Pointer(pBt)).FpPage1)).FaData+28, nFin)
(*BtShared)(unsafe.Pointer(pBt)).FbDoTruncate = U8(1)
(*BtShared)(unsafe.Pointer(pBt)).FnPage = nFin
}
@@ -46381,13 +47006,13 @@ func autoVacuumCommit(tls *libc.TLS, pBt uintptr) int32 { /* sqlite3.c:69403:12:
//
// Once this is routine has returned, the only thing required to commit
// the write-transaction for this database file is to delete the journal.
-func Xsqlite3BtreeCommitPhaseOne(tls *libc.TLS, p uintptr, zSuperJrnl uintptr) int32 { /* sqlite3.c:69482:20: */
+func Xsqlite3BtreeCommitPhaseOne(tls *libc.TLS, p uintptr, zSuperJrnl uintptr) int32 { /* sqlite3.c:69626:20: */
var rc int32 = SQLITE_OK
if int32((*Btree)(unsafe.Pointer(p)).FinTrans) == TRANS_WRITE {
var pBt uintptr = (*Btree)(unsafe.Pointer(p)).FpBt
Xsqlite3BtreeEnter(tls, p)
if (*BtShared)(unsafe.Pointer(pBt)).FautoVacuum != 0 {
- rc = autoVacuumCommit(tls, pBt)
+ rc = autoVacuumCommit(tls, p)
if rc != SQLITE_OK {
Xsqlite3BtreeLeave(tls, p)
return rc
@@ -46404,12 +47029,12 @@ func Xsqlite3BtreeCommitPhaseOne(tls *libc.TLS, p uintptr, zSuperJrnl uintptr) i
// This function is called from both BtreeCommitPhaseTwo() and BtreeRollback()
// at the conclusion of a transaction.
-func btreeEndTransaction(tls *libc.TLS, p uintptr) { /* sqlite3.c:69509:13: */
+func btreeEndTransaction(tls *libc.TLS, p uintptr) { /* sqlite3.c:69653:13: */
var pBt uintptr = (*Btree)(unsafe.Pointer(p)).FpBt
var db uintptr = (*Btree)(unsafe.Pointer(p)).Fdb
(*BtShared)(unsafe.Pointer(pBt)).FbDoTruncate = U8(0)
- if (int32((*Btree)(unsafe.Pointer(p)).FinTrans) > TRANS_NONE) && ((*Sqlite3)(unsafe.Pointer(db)).FnVdbeRead > 1) {
+ if int32((*Btree)(unsafe.Pointer(p)).FinTrans) > TRANS_NONE && (*Sqlite3)(unsafe.Pointer(db)).FnVdbeRead > 1 {
// If there are other active statements that belong to this database
// handle, downgrade to a read-only transaction. The other statements
// may still be reading from the database.
@@ -46460,7 +47085,7 @@ func btreeEndTransaction(tls *libc.TLS, p uintptr) { /* sqlite3.c:69509:13: */
//
// This will release the write lock on the database file. If there
// are no active cursors, it also releases the read lock.
-func Xsqlite3BtreeCommitPhaseTwo(tls *libc.TLS, p uintptr, bCleanup int32) int32 { /* sqlite3.c:69571:20: */
+func Xsqlite3BtreeCommitPhaseTwo(tls *libc.TLS, p uintptr, bCleanup int32) int32 { /* sqlite3.c:69715:20: */
if int32((*Btree)(unsafe.Pointer(p)).FinTrans) == TRANS_NONE {
return SQLITE_OK
@@ -46474,7 +47099,7 @@ func Xsqlite3BtreeCommitPhaseTwo(tls *libc.TLS, p uintptr, bCleanup int32) int32
var pBt uintptr = (*Btree)(unsafe.Pointer(p)).FpBt
rc = Xsqlite3PagerCommitPhaseTwo(tls, (*BtShared)(unsafe.Pointer(pBt)).FpPager)
- if (rc != SQLITE_OK) && (bCleanup == 0) {
+ if rc != SQLITE_OK && bCleanup == 0 {
Xsqlite3BtreeLeave(tls, p)
return rc
}
@@ -46489,7 +47114,7 @@ func Xsqlite3BtreeCommitPhaseTwo(tls *libc.TLS, p uintptr, bCleanup int32) int32
}
// Do both phases of a commit.
-func Xsqlite3BtreeCommit(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:69603:20: */
+func Xsqlite3BtreeCommit(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:69747:20: */
var rc int32
Xsqlite3BtreeEnter(tls, p)
rc = Xsqlite3BtreeCommitPhaseOne(tls, p, uintptr(0))
@@ -46524,15 +47149,15 @@ func Xsqlite3BtreeCommit(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:69603:20
//
// SQLITE_OK is returned if successful, or if an error occurs while
// saving a cursor position, an SQLite error code.
-func Xsqlite3BtreeTripAllCursors(tls *libc.TLS, pBtree uintptr, errCode int32, writeOnly int32) int32 { /* sqlite3.c:69640:20: */
+func Xsqlite3BtreeTripAllCursors(tls *libc.TLS, pBtree uintptr, errCode int32, writeOnly int32) int32 { /* sqlite3.c:69784:20: */
var p uintptr
var rc int32 = SQLITE_OK
if pBtree != 0 {
Xsqlite3BtreeEnter(tls, pBtree)
for p = (*BtShared)(unsafe.Pointer((*Btree)(unsafe.Pointer(pBtree)).FpBt)).FpCursor; p != 0; p = (*BtCursor)(unsafe.Pointer(p)).FpNext {
- if (writeOnly != 0) && ((int32((*BtCursor)(unsafe.Pointer(p)).FcurFlags) & BTCF_WriteFlag) == 0) {
- if (int32((*BtCursor)(unsafe.Pointer(p)).FeState) == CURSOR_VALID) || (int32((*BtCursor)(unsafe.Pointer(p)).FeState) == CURSOR_SKIPNEXT) {
+ if writeOnly != 0 && int32((*BtCursor)(unsafe.Pointer(p)).FcurFlags)&BTCF_WriteFlag == 0 {
+ if int32((*BtCursor)(unsafe.Pointer(p)).FeState) == CURSOR_VALID || int32((*BtCursor)(unsafe.Pointer(p)).FeState) == CURSOR_SKIPNEXT {
rc = saveCursorPosition(tls, p)
if rc != SQLITE_OK {
Xsqlite3BtreeTripAllCursors(tls, pBtree, rc, 0)
@@ -46553,13 +47178,13 @@ func Xsqlite3BtreeTripAllCursors(tls *libc.TLS, pBtree uintptr, errCode int32, w
// Set the pBt->nPage field correctly, according to the current
// state of the database. Assume pBt->pPage1 is valid.
-func btreeSetNPage(tls *libc.TLS, pBt uintptr, pPage1 uintptr) { /* sqlite3.c:69672:13: */
+func btreeSetNPage(tls *libc.TLS, pBt uintptr, pPage1 uintptr) { /* sqlite3.c:69816:13: */
bp := tls.Alloc(4)
defer tls.Free(4)
- *(*int32)(unsafe.Pointer(bp /* nPage */)) = int32(Xsqlite3Get4byte(tls, ((*MemPage)(unsafe.Pointer(pPage1)).FaData + 28)))
+ *(*int32)(unsafe.Pointer(bp /* nPage */)) = int32(Xsqlite3Get4byte(tls, (*MemPage)(unsafe.Pointer(pPage1)).FaData+28))
- if *(*int32)(unsafe.Pointer(bp /* nPage */)) == 0 {
+ if *(*int32)(unsafe.Pointer(bp)) == 0 {
Xsqlite3PagerPagecount(tls, (*BtShared)(unsafe.Pointer(pBt)).FpPager, bp /* &nPage */)
}
@@ -46575,7 +47200,7 @@ func btreeSetNPage(tls *libc.TLS, pBt uintptr, pPage1 uintptr) { /* sqlite3.c:69
//
// This will release the write lock on the database file. If there
// are no active cursors, it also releases the read lock.
-func Xsqlite3BtreeRollback(tls *libc.TLS, p uintptr, tripCode int32, writeOnly int32) int32 { /* sqlite3.c:69691:20: */
+func Xsqlite3BtreeRollback(tls *libc.TLS, p uintptr, tripCode int32, writeOnly int32) int32 { /* sqlite3.c:69835:20: */
bp := tls.Alloc(4)
defer tls.Free(4)
@@ -46611,7 +47236,7 @@ func Xsqlite3BtreeRollback(tls *libc.TLS, p uintptr, tripCode int32, writeOnly i
// The rollback may have destroyed the pPage1->aData value. So
// call btreeGetPage() on page 1 again to make
// sure pPage1->aData is set correctly.
- if btreeGetPage(tls, pBt, uint32(1), bp /* &pPage1 */, 0) == SQLITE_OK {
+ if btreeGetPage(tls, pBt, uint32(1), bp, 0) == SQLITE_OK {
btreeSetNPage(tls, pBt, *(*uintptr)(unsafe.Pointer(bp /* pPage1 */)))
releasePageOne(tls, *(*uintptr)(unsafe.Pointer(bp /* pPage1 */)))
}
@@ -46641,7 +47266,7 @@ func Xsqlite3BtreeRollback(tls *libc.TLS, p uintptr, tripCode int32, writeOnly i
// are no active savepoints and no other statement-transactions open,
// iStatement is 1. This anonymous savepoint can be released or rolled back
// using the sqlite3BtreeSavepoint() function.
-func Xsqlite3BtreeBeginStmt(tls *libc.TLS, p uintptr, iStatement int32) int32 { /* sqlite3.c:69756:20: */
+func Xsqlite3BtreeBeginStmt(tls *libc.TLS, p uintptr, iStatement int32) int32 { /* sqlite3.c:69900:20: */
var rc int32
var pBt uintptr = (*Btree)(unsafe.Pointer(p)).FpBt
Xsqlite3BtreeEnter(tls, p)
@@ -46665,9 +47290,9 @@ func Xsqlite3BtreeBeginStmt(tls *libc.TLS, p uintptr, iStatement int32) int32 {
// contents of the entire transaction are rolled back. This is different
// from a normal transaction rollback, as no locks are released and the
// transaction remains open.
-func Xsqlite3BtreeSavepoint(tls *libc.TLS, p uintptr, op int32, iSavepoint int32) int32 { /* sqlite3.c:69787:20: */
+func Xsqlite3BtreeSavepoint(tls *libc.TLS, p uintptr, op int32, iSavepoint int32) int32 { /* sqlite3.c:69931:20: */
var rc int32 = SQLITE_OK
- if (p != 0) && (int32((*Btree)(unsafe.Pointer(p)).FinTrans) == TRANS_WRITE) {
+ if p != 0 && int32((*Btree)(unsafe.Pointer(p)).FinTrans) == TRANS_WRITE {
var pBt uintptr = (*Btree)(unsafe.Pointer(p)).FpBt
Xsqlite3BtreeEnter(tls, p)
@@ -46678,7 +47303,7 @@ func Xsqlite3BtreeSavepoint(tls *libc.TLS, p uintptr, op int32, iSavepoint int32
rc = Xsqlite3PagerSavepoint(tls, (*BtShared)(unsafe.Pointer(pBt)).FpPager, op, iSavepoint)
}
if rc == SQLITE_OK {
- if (iSavepoint < 0) && ((int32((*BtShared)(unsafe.Pointer(pBt)).FbtsFlags) & BTS_INITIALLY_EMPTY) != 0) {
+ if iSavepoint < 0 && int32((*BtShared)(unsafe.Pointer(pBt)).FbtsFlags)&BTS_INITIALLY_EMPTY != 0 {
(*BtShared)(unsafe.Pointer(pBt)).FnPage = U32(0)
}
rc = newDatabase(tls, pBt)
@@ -46733,7 +47358,7 @@ func Xsqlite3BtreeSavepoint(tls *libc.TLS, p uintptr, op int32, iSavepoint int32
//
// It is assumed that the sqlite3BtreeCursorZero() has been called
// on pCur to initialize the memory space prior to invoking this routine.
-func btreeCursor(tls *libc.TLS, p uintptr, iTable Pgno, wrFlag int32, pKeyInfo uintptr, pCur uintptr) int32 { /* sqlite3.c:69858:12: */
+func btreeCursor(tls *libc.TLS, p uintptr, iTable Pgno, wrFlag int32, pKeyInfo uintptr, pCur uintptr) int32 { /* sqlite3.c:70002:12: */
var pBt uintptr = (*Btree)(unsafe.Pointer(p)).FpBt // Shared b-tree handle
var pX uintptr // Looping over other all cursors
@@ -46752,7 +47377,7 @@ func btreeCursor(tls *libc.TLS, p uintptr, iTable Pgno, wrFlag int32, pKeyInfo u
}
if iTable <= Pgno(1) {
if iTable < Pgno(1) {
- return Xsqlite3CorruptError(tls, 69894)
+ return Xsqlite3CorruptError(tls, 70038)
} else if btreePagecount(tls, pBt) == Pgno(0) {
iTable = Pgno(0)
@@ -46782,8 +47407,8 @@ func btreeCursor(tls *libc.TLS, p uintptr, iTable Pgno, wrFlag int32, pKeyInfo u
// cursors *must* have the BTCF_Multiple flag set.
for pX = (*BtShared)(unsafe.Pointer(pBt)).FpCursor; pX != 0; pX = (*BtCursor)(unsafe.Pointer(pX)).FpNext {
if (*BtCursor)(unsafe.Pointer(pX)).FpgnoRoot == iTable {
- *(*U8)(unsafe.Pointer(pX + 1 /* &.curFlags */)) |= U8((BTCF_Multiple))
- *(*U8)(unsafe.Pointer(pCur + 1 /* &.curFlags */)) |= U8((BTCF_Multiple))
+ *(*U8)(unsafe.Pointer(pX + 1)) |= U8(BTCF_Multiple)
+ *(*U8)(unsafe.Pointer(pCur + 1)) |= U8(BTCF_Multiple)
}
}
(*BtCursor)(unsafe.Pointer(pCur)).FpNext = (*BtShared)(unsafe.Pointer(pBt)).FpCursor
@@ -46792,7 +47417,7 @@ func btreeCursor(tls *libc.TLS, p uintptr, iTable Pgno, wrFlag int32, pKeyInfo u
return SQLITE_OK
}
-func btreeCursorWithLock(tls *libc.TLS, p uintptr, iTable Pgno, wrFlag int32, pKeyInfo uintptr, pCur uintptr) int32 { /* sqlite3.c:69923:12: */
+func btreeCursorWithLock(tls *libc.TLS, p uintptr, iTable Pgno, wrFlag int32, pKeyInfo uintptr, pCur uintptr) int32 { /* sqlite3.c:70067:12: */
var rc int32
Xsqlite3BtreeEnter(tls, p)
rc = btreeCursor(tls, p, iTable, wrFlag, pKeyInfo, pCur)
@@ -46800,7 +47425,7 @@ func btreeCursorWithLock(tls *libc.TLS, p uintptr, iTable Pgno, wrFlag int32, pK
return rc
}
-func Xsqlite3BtreeCursor(tls *libc.TLS, p uintptr, iTable Pgno, wrFlag int32, pKeyInfo uintptr, pCur uintptr) int32 { /* sqlite3.c:69936:20: */
+func Xsqlite3BtreeCursor(tls *libc.TLS, p uintptr, iTable Pgno, wrFlag int32, pKeyInfo uintptr, pCur uintptr) int32 { /* sqlite3.c:70080:20: */
if (*Btree)(unsafe.Pointer(p)).Fsharable != 0 {
return btreeCursorWithLock(tls, p, iTable, wrFlag, pKeyInfo, pCur)
} else {
@@ -46815,8 +47440,8 @@ func Xsqlite3BtreeCursor(tls *libc.TLS, p uintptr, iTable Pgno, wrFlag int32, pK
// sufficient storage to hold a cursor. The BtCursor object is opaque
// to users so they cannot do the sizeof() themselves - they must call
// this routine.
-func Xsqlite3BtreeCursorSize(tls *libc.TLS) int32 { /* sqlite3.c:69958:20: */
- return (int32(((uint32(unsafe.Sizeof(BtCursor{}))) + uint32(7)) & libc.Uint32FromInt32(libc.CplInt32(7))))
+func Xsqlite3BtreeCursorSize(tls *libc.TLS) int32 { /* sqlite3.c:70102:20: */
+ return int32((uint32(unsafe.Sizeof(BtCursor{})) + uint32(7)) & libc.Uint32FromInt32(libc.CplInt32(7)))
}
// Initialize memory that will be converted into a BtCursor object.
@@ -46825,13 +47450,13 @@ func Xsqlite3BtreeCursorSize(tls *libc.TLS) int32 { /* sqlite3.c:69958:20: */
// to zero. But it turns out that the apPage[] and aiIdx[] arrays
// do not need to be zeroed and they are large, so we can save a lot
// of run-time by skipping the initialization of those elements.
-func Xsqlite3BtreeCursorZero(tls *libc.TLS, p uintptr) { /* sqlite3.c:69970:21: */
- libc.Xmemset(tls, p, 0, uint32((uintptr(0) + 20 /* &.pBt */)))
+func Xsqlite3BtreeCursorZero(tls *libc.TLS, p uintptr) { /* sqlite3.c:70114:21: */
+ libc.Xmemset(tls, p, 0, uint32(uintptr(0)+20))
}
// Close a cursor. The read lock on the database file is released
// when the last cursor is closed.
-func Xsqlite3BtreeCloseCursor(tls *libc.TLS, pCur uintptr) int32 { /* sqlite3.c:69978:20: */
+func Xsqlite3BtreeCloseCursor(tls *libc.TLS, pCur uintptr) int32 { /* sqlite3.c:70122:20: */
var pBtree uintptr = (*BtCursor)(unsafe.Pointer(pCur)).FpBtree
if pBtree != 0 {
var pBt uintptr = (*BtCursor)(unsafe.Pointer(pCur)).FpBt
@@ -46841,7 +47466,7 @@ func Xsqlite3BtreeCloseCursor(tls *libc.TLS, pCur uintptr) int32 { /* sqlite3.c:
(*BtShared)(unsafe.Pointer(pBt)).FpCursor = (*BtCursor)(unsafe.Pointer(pCur)).FpNext
} else {
var pPrev uintptr = (*BtShared)(unsafe.Pointer(pBt)).FpCursor
- for ok := true; ok; ok = (pPrev != 0) {
+ for ok := true; ok; ok = pPrev != 0 {
if (*BtCursor)(unsafe.Pointer(pPrev)).FpNext == pCur {
(*BtCursor)(unsafe.Pointer(pPrev)).FpNext = (*BtCursor)(unsafe.Pointer(pCur)).FpNext
break
@@ -46853,7 +47478,7 @@ func Xsqlite3BtreeCloseCursor(tls *libc.TLS, pCur uintptr) int32 { /* sqlite3.c:
unlockBtreeIfUnused(tls, pBt)
Xsqlite3_free(tls, (*BtCursor)(unsafe.Pointer(pCur)).FaOverflow)
Xsqlite3_free(tls, (*BtCursor)(unsafe.Pointer(pCur)).FpKey)
- if ((int32((*BtShared)(unsafe.Pointer(pBt)).FopenFlags) & BTREE_SINGLE) != 0) && ((*BtShared)(unsafe.Pointer(pBt)).FpCursor == uintptr(0)) {
+ if int32((*BtShared)(unsafe.Pointer(pBt)).FopenFlags)&BTREE_SINGLE != 0 && (*BtShared)(unsafe.Pointer(pBt)).FpCursor == uintptr(0) {
// Since the BtShared is not sharable, there is no need to
// worry about the missing sqlite3BtreeLeave() call here.
@@ -46872,47 +47497,47 @@ func Xsqlite3BtreeCloseCursor(tls *libc.TLS, pCur uintptr) int32 { /* sqlite3.c:
//
// BtCursor.info is a cache of the information in the current cell.
// Using this cache reduces the number of calls to btreeParseCell().
-func getCellInfo(tls *libc.TLS, pCur uintptr) { /* sqlite3.c:70039:29: */
+func getCellInfo(tls *libc.TLS, pCur uintptr) { /* sqlite3.c:70183:29: */
if int32((*BtCursor)(unsafe.Pointer(pCur)).Finfo.FnSize) == 0 {
- *(*U8)(unsafe.Pointer(pCur + 1 /* &.curFlags */)) |= U8((BTCF_ValidNKey))
- btreeParseCell(tls, (*BtCursor)(unsafe.Pointer(pCur)).FpPage, int32((*BtCursor)(unsafe.Pointer(pCur)).Fix), (pCur + 32 /* &.info */))
+ *(*U8)(unsafe.Pointer(pCur + 1)) |= U8(BTCF_ValidNKey)
+ btreeParseCell(tls, (*BtCursor)(unsafe.Pointer(pCur)).FpPage, int32((*BtCursor)(unsafe.Pointer(pCur)).Fix), pCur+32)
} else {
}
}
-func Xsqlite3BtreeCursorIsValidNN(tls *libc.TLS, pCur uintptr) int32 { /* sqlite3.c:70058:20: */
+func Xsqlite3BtreeCursorIsValidNN(tls *libc.TLS, pCur uintptr) int32 { /* sqlite3.c:70202:20: */
- return (libc.Bool32(int32((*BtCursor)(unsafe.Pointer(pCur)).FeState) == CURSOR_VALID))
+ return libc.Bool32(int32((*BtCursor)(unsafe.Pointer(pCur)).FeState) == CURSOR_VALID)
}
// Return the value of the integer key or "rowid" for a table btree.
// This routine is only valid for a cursor that is pointing into a
// ordinary table btree. If the cursor points to an index btree or
// is invalid, the result of this routine is undefined.
-func Xsqlite3BtreeIntegerKey(tls *libc.TLS, pCur uintptr) I64 { /* sqlite3.c:70069:20: */
+func Xsqlite3BtreeIntegerKey(tls *libc.TLS, pCur uintptr) I64 { /* sqlite3.c:70213:20: */
getCellInfo(tls, pCur)
return (*BtCursor)(unsafe.Pointer(pCur)).Finfo.FnKey
}
// Pin or unpin a cursor.
-func Xsqlite3BtreeCursorPin(tls *libc.TLS, pCur uintptr) { /* sqlite3.c:70080:21: */
+func Xsqlite3BtreeCursorPin(tls *libc.TLS, pCur uintptr) { /* sqlite3.c:70224:21: */
- *(*U8)(unsafe.Pointer(pCur + 1 /* &.curFlags */)) |= U8((BTCF_Pinned))
+ *(*U8)(unsafe.Pointer(pCur + 1)) |= U8(BTCF_Pinned)
}
-func Xsqlite3BtreeCursorUnpin(tls *libc.TLS, pCur uintptr) { /* sqlite3.c:70084:21: */
+func Xsqlite3BtreeCursorUnpin(tls *libc.TLS, pCur uintptr) { /* sqlite3.c:70228:21: */
- *(*U8)(unsafe.Pointer(pCur + 1 /* &.curFlags */)) &= libc.Uint8FromInt32((libc.CplInt32(BTCF_Pinned)))
+ *(*U8)(unsafe.Pointer(pCur + 1)) &= libc.Uint8FromInt32(libc.CplInt32(BTCF_Pinned))
}
// Return the offset into the database file for the start of the
// payload to which the cursor is pointing.
-func Xsqlite3BtreeOffset(tls *libc.TLS, pCur uintptr) I64 { /* sqlite3.c:70094:20: */
+func Xsqlite3BtreeOffset(tls *libc.TLS, pCur uintptr) I64 { /* sqlite3.c:70238:20: */
getCellInfo(tls, pCur)
- return ((I64((*BtShared)(unsafe.Pointer((*BtCursor)(unsafe.Pointer(pCur)).FpBt)).FpageSize) * (I64((*MemPage)(unsafe.Pointer((*BtCursor)(unsafe.Pointer(pCur)).FpPage)).Fpgno) - int64(1))) + (I64((int32((*BtCursor)(unsafe.Pointer(pCur)).Finfo.FpPayload) - int32((*MemPage)(unsafe.Pointer((*BtCursor)(unsafe.Pointer(pCur)).FpPage)).FaData)) / 1)))
+ return I64((*BtShared)(unsafe.Pointer((*BtCursor)(unsafe.Pointer(pCur)).FpBt)).FpageSize)*(I64((*MemPage)(unsafe.Pointer((*BtCursor)(unsafe.Pointer(pCur)).FpPage)).Fpgno)-int64(1)) + I64((int32((*BtCursor)(unsafe.Pointer(pCur)).Finfo.FpPayload)-int32((*MemPage)(unsafe.Pointer((*BtCursor)(unsafe.Pointer(pCur)).FpPage)).FaData))/1)
}
// Return the number of bytes of payload for the entry that pCur is
@@ -46922,7 +47547,7 @@ func Xsqlite3BtreeOffset(tls *libc.TLS, pCur uintptr) I64 { /* sqlite3.c:70094:2
// The caller must guarantee that the cursor is pointing to a non-NULL
// valid entry. In other words, the calling procedure must guarantee
// that the cursor has Cursor.eState==CURSOR_VALID.
-func Xsqlite3BtreePayloadSize(tls *libc.TLS, pCur uintptr) U32 { /* sqlite3.c:70112:20: */
+func Xsqlite3BtreePayloadSize(tls *libc.TLS, pCur uintptr) U32 { /* sqlite3.c:70256:20: */
getCellInfo(tls, pCur)
return (*BtCursor)(unsafe.Pointer(pCur)).Finfo.FnPayload
@@ -46939,9 +47564,9 @@ func Xsqlite3BtreePayloadSize(tls *libc.TLS, pCur uintptr) U32 { /* sqlite3.c:70
//
// The current implementation merely returns the size of the underlying
// database file.
-func Xsqlite3BtreeMaxRecordSize(tls *libc.TLS, pCur uintptr) Sqlite3_int64 { /* sqlite3.c:70132:30: */
+func Xsqlite3BtreeMaxRecordSize(tls *libc.TLS, pCur uintptr) Sqlite3_int64 { /* sqlite3.c:70276:30: */
- return (Sqlite3_int64((*BtShared)(unsafe.Pointer((*BtCursor)(unsafe.Pointer(pCur)).FpBt)).FpageSize) * Sqlite3_int64((*BtShared)(unsafe.Pointer((*BtCursor)(unsafe.Pointer(pCur)).FpBt)).FnPage))
+ return Sqlite3_int64((*BtShared)(unsafe.Pointer((*BtCursor)(unsafe.Pointer(pCur)).FpBt)).FpageSize) * Sqlite3_int64((*BtShared)(unsafe.Pointer((*BtCursor)(unsafe.Pointer(pCur)).FpBt)).FnPage)
}
// Given the page number of an overflow page in the database (parameter
@@ -46961,7 +47586,7 @@ func Xsqlite3BtreeMaxRecordSize(tls *libc.TLS, pCur uintptr) Sqlite3_int64 { /*
// on *ppPage to free the reference. In no reference was obtained (because
// the pointer-map was used to obtain the value for *pPgnoNext), then
// *ppPage is set to zero.
-func getOverflowPage(tls *libc.TLS, pBt uintptr, ovfl Pgno, ppPage uintptr, pPgnoNext uintptr) int32 { /* sqlite3.c:70157:12: */
+func getOverflowPage(tls *libc.TLS, pBt uintptr, ovfl Pgno, ppPage uintptr, pPgnoNext uintptr) int32 { /* sqlite3.c:70301:12: */
bp := tls.Alloc(12)
defer tls.Free(12)
@@ -46977,16 +47602,16 @@ func getOverflowPage(tls *libc.TLS, pBt uintptr, ovfl Pgno, ppPage uintptr, pPgn
if (*BtShared)(unsafe.Pointer(pBt)).FautoVacuum != 0 {
// var pgno Pgno at bp+4, 4
- var iGuess Pgno = (ovfl + Pgno(1))
+ var iGuess Pgno = ovfl + Pgno(1)
// var eType U8 at bp, 1
- for (ptrmapPageno(tls, pBt, iGuess) == (iGuess)) || (iGuess == ((U32(Xsqlite3PendingByte) / ((*BtShared)(unsafe.Pointer(pBt)).FpageSize)) + U32(1))) {
+ for ptrmapPageno(tls, pBt, iGuess) == iGuess || iGuess == U32(Xsqlite3PendingByte)/(*BtShared)(unsafe.Pointer(pBt)).FpageSize+U32(1) {
iGuess++
}
if iGuess <= btreePagecount(tls, pBt) {
rc = ptrmapGet(tls, pBt, iGuess, bp /* &eType */, bp+4 /* &pgno */)
- if ((rc == SQLITE_OK) && (int32(*(*U8)(unsafe.Pointer(bp /* eType */))) == PTRMAP_OVERFLOW2)) && (*(*Pgno)(unsafe.Pointer(bp + 4 /* pgno */)) == ovfl) {
+ if rc == SQLITE_OK && int32(*(*U8)(unsafe.Pointer(bp))) == PTRMAP_OVERFLOW2 && *(*Pgno)(unsafe.Pointer(bp + 4)) == ovfl {
next = iGuess
rc = SQLITE_DONE
}
@@ -47029,7 +47654,7 @@ func getOverflowPage(tls *libc.TLS, pBt uintptr, ovfl Pgno, ppPage uintptr, pPgn
// of data are copied from the buffer pBuf to pPayload.
//
// SQLITE_OK is returned on success, otherwise an error code.
-func copyPayload(tls *libc.TLS, pPayload uintptr, pBuf uintptr, nByte int32, eOp int32, pDbPage uintptr) int32 { /* sqlite3.c:70225:12: */
+func copyPayload(tls *libc.TLS, pPayload uintptr, pBuf uintptr, nByte int32, eOp int32, pDbPage uintptr) int32 { /* sqlite3.c:70369:12: */
if eOp != 0 {
// Copy data from buffer to page (a write operation)
var rc int32 = Xsqlite3PagerWrite(tls, pDbPage)
@@ -47071,7 +47696,7 @@ func copyPayload(tls *libc.TLS, pPayload uintptr, pBuf uintptr, nByte int32, eOp
// * An incremental vacuum,
// * A commit in auto_vacuum="full" mode,
// * Creating a table (may require moving an overflow page).
-func accessPayload(tls *libc.TLS, pCur uintptr, offset U32, amt U32, pBuf uintptr, eOp int32) int32 { /* sqlite3.c:70275:12: */
+func accessPayload(tls *libc.TLS, pCur uintptr, offset U32, amt U32, pBuf uintptr, eOp int32) int32 { /* sqlite3.c:70419:12: */
bp := tls.Alloc(8)
defer tls.Free(8)
@@ -47081,36 +47706,40 @@ func accessPayload(tls *libc.TLS, pCur uintptr, offset U32, amt U32, pBuf uintpt
var pPage uintptr = (*BtCursor)(unsafe.Pointer(pCur)).FpPage // Btree page of current entry
var pBt uintptr = (*BtCursor)(unsafe.Pointer(pCur)).FpBt // Btree this cursor belongs to
+ if int32((*BtCursor)(unsafe.Pointer(pCur)).Fix) >= int32((*MemPage)(unsafe.Pointer(pPage)).FnCell) {
+ return Xsqlite3CorruptError(tls, 70439)
+ }
+
getCellInfo(tls, pCur)
aPayload = (*BtCursor)(unsafe.Pointer(pCur)).Finfo.FpPayload
- if (Uptr((int32(aPayload) - int32((*MemPage)(unsafe.Pointer(pPage)).FaData)) / 1)) > ((*BtShared)(unsafe.Pointer(pBt)).FusableSize - U32((*BtCursor)(unsafe.Pointer(pCur)).Finfo.FnLocal)) {
+ if Uptr((int32(aPayload)-int32((*MemPage)(unsafe.Pointer(pPage)).FaData))/1) > (*BtShared)(unsafe.Pointer(pBt)).FusableSize-U32((*BtCursor)(unsafe.Pointer(pCur)).Finfo.FnLocal) {
// Trying to read or write past the end of the data is an error. The
// conditional above is really:
// &aPayload[pCur->info.nLocal] > &pPage->aData[pBt->usableSize]
// but is recast into its current form to avoid integer overflow problems
- return Xsqlite3CorruptError(tls, 70308)
+ return Xsqlite3CorruptError(tls, 70454)
}
// Check if data must be read/written to/from the btree page itself.
if offset < U32((*BtCursor)(unsafe.Pointer(pCur)).Finfo.FnLocal) {
var a int32 = int32(amt)
- if (U32(a) + offset) > U32((*BtCursor)(unsafe.Pointer(pCur)).Finfo.FnLocal) {
- a = (int32(U32((*BtCursor)(unsafe.Pointer(pCur)).Finfo.FnLocal) - offset))
+ if U32(a)+offset > U32((*BtCursor)(unsafe.Pointer(pCur)).Finfo.FnLocal) {
+ a = int32(U32((*BtCursor)(unsafe.Pointer(pCur)).Finfo.FnLocal) - offset)
}
- rc = copyPayload(tls, (aPayload + uintptr(offset)), pBuf, a, eOp, (*MemPage)(unsafe.Pointer(pPage)).FpDbPage)
+ rc = copyPayload(tls, aPayload+uintptr(offset), pBuf, a, eOp, (*MemPage)(unsafe.Pointer(pPage)).FpDbPage)
offset = U32(0)
pBuf += uintptr(a)
- amt = amt - (U32(a))
+ amt = amt - U32(a)
} else {
- offset = offset - (U32((*BtCursor)(unsafe.Pointer(pCur)).Finfo.FnLocal))
+ offset = offset - U32((*BtCursor)(unsafe.Pointer(pCur)).Finfo.FnLocal)
}
- if (rc == SQLITE_OK) && (amt > U32(0)) {
- var ovflSize U32 = ((*BtShared)(unsafe.Pointer(pBt)).FusableSize - U32(4)) // Bytes content per ovfl page
+ if rc == SQLITE_OK && amt > U32(0) {
+ var ovflSize U32 = (*BtShared)(unsafe.Pointer(pBt)).FusableSize - U32(4) // Bytes content per ovfl page
// var nextPage Pgno at bp, 4
- *(*Pgno)(unsafe.Pointer(bp /* nextPage */)) = Xsqlite3Get4byte(tls, (aPayload + uintptr((*BtCursor)(unsafe.Pointer(pCur)).Finfo.FnLocal)))
+ *(*Pgno)(unsafe.Pointer(bp /* nextPage */)) = Xsqlite3Get4byte(tls, aPayload+uintptr((*BtCursor)(unsafe.Pointer(pCur)).Finfo.FnLocal))
// If the BtCursor.aOverflow[] has not been allocated, allocate it now.
//
@@ -47118,35 +47747,35 @@ func accessPayload(tls *libc.TLS, pCur uintptr, offset U32, amt U32, pBuf uintpt
// in the overflow chain. The page number of the first overflow page is
// stored in aOverflow[0], etc. A value of 0 in the aOverflow[] array
// means "not yet known" (the cache is lazily populated).
- if (int32((*BtCursor)(unsafe.Pointer(pCur)).FcurFlags) & BTCF_ValidOvfl) == 0 {
- var nOvfl int32 = (int32(((((*BtCursor)(unsafe.Pointer(pCur)).Finfo.FnPayload - U32((*BtCursor)(unsafe.Pointer(pCur)).Finfo.FnLocal)) + ovflSize) - U32(1)) / ovflSize))
- if ((*BtCursor)(unsafe.Pointer(pCur)).FaOverflow == uintptr(0)) ||
- ((nOvfl * int32(unsafe.Sizeof(Pgno(0)))) > Xsqlite3MallocSize(tls, (*BtCursor)(unsafe.Pointer(pCur)).FaOverflow)) {
+ if int32((*BtCursor)(unsafe.Pointer(pCur)).FcurFlags)&BTCF_ValidOvfl == 0 {
+ var nOvfl int32 = int32(((*BtCursor)(unsafe.Pointer(pCur)).Finfo.FnPayload - U32((*BtCursor)(unsafe.Pointer(pCur)).Finfo.FnLocal) + ovflSize - U32(1)) / ovflSize)
+ if (*BtCursor)(unsafe.Pointer(pCur)).FaOverflow == uintptr(0) ||
+ nOvfl*int32(unsafe.Sizeof(Pgno(0))) > Xsqlite3MallocSize(tls, (*BtCursor)(unsafe.Pointer(pCur)).FaOverflow) {
var aNew uintptr = Xsqlite3Realloc(tls,
- (*BtCursor)(unsafe.Pointer(pCur)).FaOverflow, (uint64((uint32(nOvfl * 2)) * uint32(unsafe.Sizeof(Pgno(0))))))
+ (*BtCursor)(unsafe.Pointer(pCur)).FaOverflow, uint64(uint32(nOvfl*2)*uint32(unsafe.Sizeof(Pgno(0)))))
if aNew == uintptr(0) {
return SQLITE_NOMEM
} else {
(*BtCursor)(unsafe.Pointer(pCur)).FaOverflow = aNew
}
}
- libc.Xmemset(tls, (*BtCursor)(unsafe.Pointer(pCur)).FaOverflow, 0, (uint32(nOvfl) * uint32(unsafe.Sizeof(Pgno(0)))))
- *(*U8)(unsafe.Pointer(pCur + 1 /* &.curFlags */)) |= U8((BTCF_ValidOvfl))
+ libc.Xmemset(tls, (*BtCursor)(unsafe.Pointer(pCur)).FaOverflow, 0, uint32(nOvfl)*uint32(unsafe.Sizeof(Pgno(0))))
+ *(*U8)(unsafe.Pointer(pCur + 1)) |= U8(BTCF_ValidOvfl)
} else {
// If the overflow page-list cache has been allocated and the
// entry for the first required overflow page is valid, skip
// directly to it.
- if *(*Pgno)(unsafe.Pointer((*BtCursor)(unsafe.Pointer(pCur)).FaOverflow + uintptr((offset/ovflSize))*4)) != 0 {
- iIdx = (int32(offset / ovflSize))
+ if *(*Pgno)(unsafe.Pointer((*BtCursor)(unsafe.Pointer(pCur)).FaOverflow + uintptr(offset/ovflSize)*4)) != 0 {
+ iIdx = int32(offset / ovflSize)
*(*Pgno)(unsafe.Pointer(bp /* nextPage */)) = *(*Pgno)(unsafe.Pointer((*BtCursor)(unsafe.Pointer(pCur)).FaOverflow + uintptr(iIdx)*4))
- offset = (offset % ovflSize)
+ offset = offset % ovflSize
}
}
- for *(*Pgno)(unsafe.Pointer(bp /* nextPage */)) != 0 {
+ for *(*Pgno)(unsafe.Pointer(bp)) != 0 {
// If required, populate the overflow page-list cache.
- if *(*Pgno)(unsafe.Pointer(bp /* nextPage */)) > (*BtShared)(unsafe.Pointer(pBt)).FnPage {
- return Xsqlite3CorruptError(tls, 70370)
+ if *(*Pgno)(unsafe.Pointer(bp)) > (*BtShared)(unsafe.Pointer(pBt)).FnPage {
+ return Xsqlite3CorruptError(tls, 70516)
}
*(*Pgno)(unsafe.Pointer((*BtCursor)(unsafe.Pointer(pCur)).FaOverflow + uintptr(iIdx)*4)) = *(*Pgno)(unsafe.Pointer(bp /* nextPage */))
@@ -47158,18 +47787,18 @@ func accessPayload(tls *libc.TLS, pCur uintptr, offset U32, amt U32, pBuf uintpt
// page-list cache, if any, then fall back to the getOverflowPage()
// function.
- if *(*Pgno)(unsafe.Pointer((*BtCursor)(unsafe.Pointer(pCur)).FaOverflow + uintptr((iIdx+1))*4)) != 0 {
- *(*Pgno)(unsafe.Pointer(bp /* nextPage */)) = *(*Pgno)(unsafe.Pointer((*BtCursor)(unsafe.Pointer(pCur)).FaOverflow + uintptr((iIdx+1))*4))
+ if *(*Pgno)(unsafe.Pointer((*BtCursor)(unsafe.Pointer(pCur)).FaOverflow + uintptr(iIdx+1)*4)) != 0 {
+ *(*Pgno)(unsafe.Pointer(bp /* nextPage */)) = *(*Pgno)(unsafe.Pointer((*BtCursor)(unsafe.Pointer(pCur)).FaOverflow + uintptr(iIdx+1)*4))
} else {
rc = getOverflowPage(tls, pBt, *(*Pgno)(unsafe.Pointer(bp /* nextPage */)), uintptr(0), bp /* &nextPage */)
}
- offset = offset - (ovflSize)
+ offset = offset - ovflSize
} else {
// Need to read this page properly. It contains some of the
// range of data that is being read (eOp==0) or written (eOp!=0).
var a int32 = int32(amt)
- if (U32(a) + offset) > ovflSize {
- a = (int32(ovflSize - offset))
+ if U32(a)+offset > ovflSize {
+ a = int32(ovflSize - offset)
}
{
@@ -47185,13 +47814,13 @@ func accessPayload(tls *libc.TLS, pCur uintptr, offset U32, amt U32, pBuf uintpt
if rc == SQLITE_OK {
aPayload = Xsqlite3PagerGetData(tls, *(*uintptr)(unsafe.Pointer(bp + 4 /* pDbPage */)))
*(*Pgno)(unsafe.Pointer(bp /* nextPage */)) = Xsqlite3Get4byte(tls, aPayload)
- rc = copyPayload(tls, (aPayload + uintptr((offset + U32(4)))), pBuf, a, eOp, *(*uintptr)(unsafe.Pointer(bp + 4 /* pDbPage */)))
+ rc = copyPayload(tls, aPayload+uintptr(offset+U32(4)), pBuf, a, eOp, *(*uintptr)(unsafe.Pointer(bp + 4 /* pDbPage */)))
Xsqlite3PagerUnref(tls, *(*uintptr)(unsafe.Pointer(bp + 4 /* pDbPage */)))
offset = U32(0)
}
}
- amt = amt - (U32(a))
+ amt = amt - U32(a)
if amt == U32(0) {
return rc
}
@@ -47204,9 +47833,9 @@ func accessPayload(tls *libc.TLS, pCur uintptr, offset U32, amt U32, pBuf uintpt
}
}
- if (rc == SQLITE_OK) && (amt > U32(0)) {
+ if rc == SQLITE_OK && amt > U32(0) {
// Overflow chain ends prematurely
- return Xsqlite3CorruptError(tls, 70455)
+ return Xsqlite3CorruptError(tls, 70601)
}
return rc
}
@@ -47226,7 +47855,7 @@ func accessPayload(tls *libc.TLS, pCur uintptr, offset U32, amt U32, pBuf uintpt
// Return SQLITE_OK on success or an error code if anything goes
// wrong. An error is returned if "offset+amt" is larger than
// the available payload.
-func Xsqlite3BtreePayload(tls *libc.TLS, pCur uintptr, offset U32, amt U32, pBuf uintptr) int32 { /* sqlite3.c:70477:20: */
+func Xsqlite3BtreePayload(tls *libc.TLS, pCur uintptr, offset U32, amt U32, pBuf uintptr) int32 { /* sqlite3.c:70623:20: */
return accessPayload(tls, pCur, offset, amt, pBuf, 0)
}
@@ -47234,7 +47863,7 @@ func Xsqlite3BtreePayload(tls *libc.TLS, pCur uintptr, offset U32, amt U32, pBuf
// This variant of sqlite3BtreePayload() works even if the cursor has not
// in the CURSOR_VALID state. It is only used by the sqlite3_blob_read()
// interface.
-func accessPayloadChecked(tls *libc.TLS, pCur uintptr, offset U32, amt U32, pBuf uintptr) int32 { /* sqlite3.c:70491:28: */
+func accessPayloadChecked(tls *libc.TLS, pCur uintptr, offset U32, amt U32, pBuf uintptr) int32 { /* sqlite3.c:70636:28: */
var rc int32
if int32((*BtCursor)(unsafe.Pointer(pCur)).FeState) == CURSOR_INVALID {
return SQLITE_ABORT
@@ -47247,7 +47876,7 @@ func accessPayloadChecked(tls *libc.TLS, pCur uintptr, offset U32, amt U32, pBuf
return accessPayload(tls, pCur, offset, amt, pBuf, 0)
}
-func Xsqlite3BtreePayloadChecked(tls *libc.TLS, pCur uintptr, offset U32, amt U32, pBuf uintptr) int32 { /* sqlite3.c:70505:20: */
+func Xsqlite3BtreePayloadChecked(tls *libc.TLS, pCur uintptr, offset U32, amt U32, pBuf uintptr) int32 { /* sqlite3.c:70650:20: */
if int32((*BtCursor)(unsafe.Pointer(pCur)).FeState) == CURSOR_VALID {
return accessPayload(tls, pCur, offset, amt, pBuf, 0)
@@ -47274,19 +47903,19 @@ func Xsqlite3BtreePayloadChecked(tls *libc.TLS, pCur uintptr, offset U32, amt U3
// The pointer returned by this routine looks directly into the cached
// page of the database. The data might change or move the next time
// any btree routine is called.
-func fetchPayload(tls *libc.TLS, pCur uintptr, pAmt uintptr) uintptr { /* sqlite3.c:70534:19: */
+func fetchPayload(tls *libc.TLS, pCur uintptr, pAmt uintptr) uintptr { /* sqlite3.c:70679:19: */
var amt int32
amt = int32((*BtCursor)(unsafe.Pointer(pCur)).Finfo.FnLocal)
- if amt > ((int32((*MemPage)(unsafe.Pointer((*BtCursor)(unsafe.Pointer(pCur)).FpPage)).FaDataEnd) - int32((*BtCursor)(unsafe.Pointer(pCur)).Finfo.FpPayload)) / 1) {
+ if amt > (int32((*MemPage)(unsafe.Pointer((*BtCursor)(unsafe.Pointer(pCur)).FpPage)).FaDataEnd)-int32((*BtCursor)(unsafe.Pointer(pCur)).Finfo.FpPayload))/1 {
// There is too little space on the page for the expected amount
// of local content. Database must be corrupt.
amt = func() int32 {
- if (0) > ((int32((*MemPage)(unsafe.Pointer((*BtCursor)(unsafe.Pointer(pCur)).FpPage)).FaDataEnd) - int32((*BtCursor)(unsafe.Pointer(pCur)).Finfo.FpPayload)) / 1) {
+ if 0 > (int32((*MemPage)(unsafe.Pointer((*BtCursor)(unsafe.Pointer(pCur)).FpPage)).FaDataEnd)-int32((*BtCursor)(unsafe.Pointer(pCur)).Finfo.FpPayload))/1 {
return 0
}
- return ((int32((*MemPage)(unsafe.Pointer((*BtCursor)(unsafe.Pointer(pCur)).FpPage)).FaDataEnd) - int32((*BtCursor)(unsafe.Pointer(pCur)).Finfo.FpPayload)) / 1)
+ return (int32((*MemPage)(unsafe.Pointer((*BtCursor)(unsafe.Pointer(pCur)).FpPage)).FaDataEnd) - int32((*BtCursor)(unsafe.Pointer(pCur)).Finfo.FpPayload)) / 1
}()
}
*(*U32)(unsafe.Pointer(pAmt)) = U32(amt)
@@ -47305,7 +47934,7 @@ func fetchPayload(tls *libc.TLS, pCur uintptr, pAmt uintptr) uintptr { /* sqlite
//
// These routines is used to get quick access to key and data
// in the common case where no overflow pages are used.
-func Xsqlite3BtreePayloadFetch(tls *libc.TLS, pCur uintptr, pAmt uintptr) uintptr { /* sqlite3.c:70573:27: */
+func Xsqlite3BtreePayloadFetch(tls *libc.TLS, pCur uintptr, pAmt uintptr) uintptr { /* sqlite3.c:70718:27: */
return fetchPayload(tls, pCur, pAmt)
}
@@ -47316,19 +47945,19 @@ func Xsqlite3BtreePayloadFetch(tls *libc.TLS, pCur uintptr, pAmt uintptr) uintpt
// the new child page does not match the flags field of the parent (i.e.
// if an intkey page appears to be the parent of a non-intkey page, or
// vice-versa).
-func moveToChild(tls *libc.TLS, pCur uintptr, newPgno U32) int32 { /* sqlite3.c:70587:12: */
+func moveToChild(tls *libc.TLS, pCur uintptr, newPgno U32) int32 { /* sqlite3.c:70732:12: */
var pBt uintptr = (*BtCursor)(unsafe.Pointer(pCur)).FpBt
- if int32((*BtCursor)(unsafe.Pointer(pCur)).FiPage) >= (BTCURSOR_MAX_DEPTH - 1) {
- return Xsqlite3CorruptError(tls, 70595)
+ if int32((*BtCursor)(unsafe.Pointer(pCur)).FiPage) >= BTCURSOR_MAX_DEPTH-1 {
+ return Xsqlite3CorruptError(tls, 70740)
}
(*BtCursor)(unsafe.Pointer(pCur)).Finfo.FnSize = U16(0)
- *(*U8)(unsafe.Pointer(pCur + 1 /* &.curFlags */)) &= libc.Uint8FromInt32((libc.CplInt32((BTCF_ValidNKey | BTCF_ValidOvfl))))
- *(*U16)(unsafe.Pointer((pCur + 72 /* &.aiIdx */) + uintptr((*BtCursor)(unsafe.Pointer(pCur)).FiPage)*2)) = (*BtCursor)(unsafe.Pointer(pCur)).Fix
- *(*uintptr)(unsafe.Pointer((pCur + 120 /* &.apPage */) + uintptr((*BtCursor)(unsafe.Pointer(pCur)).FiPage)*4)) = (*BtCursor)(unsafe.Pointer(pCur)).FpPage
+ *(*U8)(unsafe.Pointer(pCur + 1)) &= libc.Uint8FromInt32(libc.CplInt32(BTCF_ValidNKey | BTCF_ValidOvfl))
+ *(*U16)(unsafe.Pointer(pCur + 72 + uintptr((*BtCursor)(unsafe.Pointer(pCur)).FiPage)*2)) = (*BtCursor)(unsafe.Pointer(pCur)).Fix
+ *(*uintptr)(unsafe.Pointer(pCur + 120 + uintptr((*BtCursor)(unsafe.Pointer(pCur)).FiPage)*4)) = (*BtCursor)(unsafe.Pointer(pCur)).FpPage
(*BtCursor)(unsafe.Pointer(pCur)).Fix = U16(0)
(*BtCursor)(unsafe.Pointer(pCur)).FiPage++
- return getAndInitPage(tls, pBt, newPgno, (pCur + 116 /* &.pPage */), pCur, int32((*BtCursor)(unsafe.Pointer(pCur)).FcurPagerFlags))
+ return getAndInitPage(tls, pBt, newPgno, pCur+116, pCur, int32((*BtCursor)(unsafe.Pointer(pCur)).FcurPagerFlags))
}
// Move the cursor up to the parent page.
@@ -47337,14 +47966,14 @@ func moveToChild(tls *libc.TLS, pCur uintptr, newPgno U32) int32 { /* sqlite3.c:
// to the page we are coming from. If we are coming from the
// right-most child page then pCur->idx is set to one more than
// the largest cell index.
-func moveToParent(tls *libc.TLS, pCur uintptr) { /* sqlite3.c:70636:13: */
+func moveToParent(tls *libc.TLS, pCur uintptr) { /* sqlite3.c:70781:13: */
var pLeaf uintptr
(*BtCursor)(unsafe.Pointer(pCur)).Finfo.FnSize = U16(0)
- *(*U8)(unsafe.Pointer(pCur + 1 /* &.curFlags */)) &= libc.Uint8FromInt32((libc.CplInt32((BTCF_ValidNKey | BTCF_ValidOvfl))))
- (*BtCursor)(unsafe.Pointer(pCur)).Fix = *(*U16)(unsafe.Pointer((pCur + 72 /* &.aiIdx */) + uintptr((int32((*BtCursor)(unsafe.Pointer(pCur)).FiPage)-1))*2))
+ *(*U8)(unsafe.Pointer(pCur + 1)) &= libc.Uint8FromInt32(libc.CplInt32(BTCF_ValidNKey | BTCF_ValidOvfl))
+ (*BtCursor)(unsafe.Pointer(pCur)).Fix = *(*U16)(unsafe.Pointer(pCur + 72 + uintptr(int32((*BtCursor)(unsafe.Pointer(pCur)).FiPage)-1)*2))
pLeaf = (*BtCursor)(unsafe.Pointer(pCur)).FpPage
- (*BtCursor)(unsafe.Pointer(pCur)).FpPage = *(*uintptr)(unsafe.Pointer((pCur + 120 /* &.apPage */) + uintptr(libc.PreDecInt8(&(*BtCursor)(unsafe.Pointer(pCur)).FiPage, 1))*4))
+ (*BtCursor)(unsafe.Pointer(pCur)).FpPage = *(*uintptr)(unsafe.Pointer(pCur + 120 + uintptr(libc.PreDecInt8(&(*BtCursor)(unsafe.Pointer(pCur)).FiPage, 1))*4))
releasePageNotNull(tls, pLeaf)
}
@@ -47367,7 +47996,7 @@ func moveToParent(tls *libc.TLS, pCur uintptr) { /* sqlite3.c:70636:13: */
// indicating a table b-tree, or if the caller did specify a KeyInfo
// structure the flags byte is set to 0x02 or 0x0A, indicating an index
// b-tree).
-func moveToRoot(tls *libc.TLS, pCur uintptr) int32 { /* sqlite3.c:70677:12: */
+func moveToRoot(tls *libc.TLS, pCur uintptr) int32 { /* sqlite3.c:70822:12: */
var pRoot uintptr
var rc int32
var subpage Pgno
@@ -47384,11 +48013,11 @@ __4:
if !(libc.PreDecInt8(&(*BtCursor)(unsafe.Pointer(pCur)).FiPage, 1) != 0) {
goto __5
}
- releasePageNotNull(tls, *(*uintptr)(unsafe.Pointer((pCur + 120 /* &.apPage */) + uintptr((*BtCursor)(unsafe.Pointer(pCur)).FiPage)*4)))
+ releasePageNotNull(tls, *(*uintptr)(unsafe.Pointer(pCur + 120 + uintptr((*BtCursor)(unsafe.Pointer(pCur)).FiPage)*4)))
goto __4
__5:
;
- (*BtCursor)(unsafe.Pointer(pCur)).FpPage = *(*uintptr)(unsafe.Pointer((pCur + 120 /* &.apPage */)))
+ (*BtCursor)(unsafe.Pointer(pCur)).FpPage = *(*uintptr)(unsafe.Pointer(pCur + 120))
goto skip_init
__3:
;
@@ -47415,7 +48044,7 @@ __9:
Xsqlite3BtreeClearCursor(tls, pCur)
__8:
;
- rc = getAndInitPage(tls, (*Btree)(unsafe.Pointer((*BtCursor)(unsafe.Pointer(pCur)).FpBtree)).FpBt, (*BtCursor)(unsafe.Pointer(pCur)).FpgnoRoot, (pCur + 116 /* &.pPage */),
+ rc = getAndInitPage(tls, (*Btree)(unsafe.Pointer((*BtCursor)(unsafe.Pointer(pCur)).FpBtree)).FpBt, (*BtCursor)(unsafe.Pointer(pCur)).FpgnoRoot, pCur+116,
uintptr(0), int32((*BtCursor)(unsafe.Pointer(pCur)).FcurPagerFlags))
if !(rc != SQLITE_OK) {
goto __10
@@ -47443,17 +48072,17 @@ __2:
// in such a way that page pRoot is linked into a second b-tree table
// (or the freelist).
- if !((int32((*MemPage)(unsafe.Pointer(pRoot)).FisInit) == 0) || ((libc.Bool32((*BtCursor)(unsafe.Pointer(pCur)).FpKeyInfo == uintptr(0))) != int32((*MemPage)(unsafe.Pointer(pRoot)).FintKey))) {
+ if !(int32((*MemPage)(unsafe.Pointer(pRoot)).FisInit) == 0 || libc.Bool32((*BtCursor)(unsafe.Pointer(pCur)).FpKeyInfo == uintptr(0)) != int32((*MemPage)(unsafe.Pointer(pRoot)).FintKey)) {
goto __11
}
- return Xsqlite3CorruptError(tls, 70733)
+ return Xsqlite3CorruptError(tls, 70878)
__11:
;
skip_init:
(*BtCursor)(unsafe.Pointer(pCur)).Fix = U16(0)
(*BtCursor)(unsafe.Pointer(pCur)).Finfo.FnSize = U16(0)
- *(*U8)(unsafe.Pointer(pCur + 1 /* &.curFlags */)) &= libc.Uint8FromInt32((libc.CplInt32(((BTCF_AtLast | BTCF_ValidNKey) | BTCF_ValidOvfl))))
+ *(*U8)(unsafe.Pointer(pCur + 1)) &= libc.Uint8FromInt32(libc.CplInt32(BTCF_AtLast | BTCF_ValidNKey | BTCF_ValidOvfl))
pRoot = (*BtCursor)(unsafe.Pointer(pCur)).FpPage
if !(int32((*MemPage)(unsafe.Pointer(pRoot)).FnCell) > 0) {
@@ -47462,16 +48091,16 @@ skip_init:
(*BtCursor)(unsafe.Pointer(pCur)).FeState = U8(CURSOR_VALID)
goto __13
__12:
- if !(!(int32((*MemPage)(unsafe.Pointer(pRoot)).Fleaf) != 0)) {
+ if !!(int32((*MemPage)(unsafe.Pointer(pRoot)).Fleaf) != 0) {
goto __14
}
if !((*MemPage)(unsafe.Pointer(pRoot)).Fpgno != Pgno(1)) {
goto __16
}
- return Xsqlite3CorruptError(tls, 70746)
+ return Xsqlite3CorruptError(tls, 70891)
__16:
;
- subpage = Xsqlite3Get4byte(tls, ((*MemPage)(unsafe.Pointer(pRoot)).FaData + uintptr((int32((*MemPage)(unsafe.Pointer(pRoot)).FhdrOffset) + 8))))
+ subpage = Xsqlite3Get4byte(tls, (*MemPage)(unsafe.Pointer(pRoot)).FaData+uintptr(int32((*MemPage)(unsafe.Pointer(pRoot)).FhdrOffset)+8))
(*BtCursor)(unsafe.Pointer(pCur)).FeState = U8(CURSOR_VALID)
rc = moveToChild(tls, pCur, subpage)
goto __15
@@ -47490,14 +48119,14 @@ __13:
//
// The left-most leaf is the one with the smallest key - the first
// in ascending order.
-func moveToLeftmost(tls *libc.TLS, pCur uintptr) int32 { /* sqlite3.c:70764:12: */
+func moveToLeftmost(tls *libc.TLS, pCur uintptr) int32 { /* sqlite3.c:70909:12: */
var pgno Pgno
var rc int32 = SQLITE_OK
var pPage uintptr
- for (rc == SQLITE_OK) && !(int32((*MemPage)(unsafe.Pointer(libc.AssignUintptr(&pPage, (*BtCursor)(unsafe.Pointer(pCur)).FpPage))).Fleaf) != 0) {
+ for rc == SQLITE_OK && !(int32((*MemPage)(unsafe.Pointer(libc.AssignUintptr(&pPage, (*BtCursor)(unsafe.Pointer(pCur)).FpPage))).Fleaf) != 0) {
- pgno = Xsqlite3Get4byte(tls, ((*MemPage)(unsafe.Pointer((pPage))).FaData + uintptr((int32((*MemPage)(unsafe.Pointer((pPage))).FmaskPage) & int32(libc.X__builtin_bswap16(tls, *(*U16)(unsafe.Pointer(((*MemPage)(unsafe.Pointer((pPage))).FaCellIdx + uintptr((2 * (int32((*BtCursor)(unsafe.Pointer(pCur)).Fix)))))))))))))
+ pgno = Xsqlite3Get4byte(tls, (*MemPage)(unsafe.Pointer(pPage)).FaData+uintptr(int32((*MemPage)(unsafe.Pointer(pPage)).FmaskPage)&int32(libc.X__builtin_bswap16(tls, *(*U16)(unsafe.Pointer((*MemPage)(unsafe.Pointer(pPage)).FaCellIdx + uintptr(2*int32((*BtCursor)(unsafe.Pointer(pCur)).Fix))))))))
rc = moveToChild(tls, pCur, pgno)
}
return rc
@@ -47511,20 +48140,20 @@ func moveToLeftmost(tls *libc.TLS, pCur uintptr) int32 { /* sqlite3.c:70764:12:
//
// The right-most entry is the one with the largest key - the last
// key in ascending order.
-func moveToRightmost(tls *libc.TLS, pCur uintptr) int32 { /* sqlite3.c:70789:12: */
+func moveToRightmost(tls *libc.TLS, pCur uintptr) int32 { /* sqlite3.c:70934:12: */
var pgno Pgno
var rc int32 = SQLITE_OK
var pPage uintptr = uintptr(0)
for !(int32((*MemPage)(unsafe.Pointer(libc.AssignUintptr(&pPage, (*BtCursor)(unsafe.Pointer(pCur)).FpPage))).Fleaf) != 0) {
- pgno = Xsqlite3Get4byte(tls, ((*MemPage)(unsafe.Pointer(pPage)).FaData + uintptr((int32((*MemPage)(unsafe.Pointer(pPage)).FhdrOffset) + 8))))
+ pgno = Xsqlite3Get4byte(tls, (*MemPage)(unsafe.Pointer(pPage)).FaData+uintptr(int32((*MemPage)(unsafe.Pointer(pPage)).FhdrOffset)+8))
(*BtCursor)(unsafe.Pointer(pCur)).Fix = (*MemPage)(unsafe.Pointer(pPage)).FnCell
rc = moveToChild(tls, pCur, pgno)
if rc != 0 {
return rc
}
}
- (*BtCursor)(unsafe.Pointer(pCur)).Fix = (U16(int32((*MemPage)(unsafe.Pointer(pPage)).FnCell) - 1))
+ (*BtCursor)(unsafe.Pointer(pCur)).Fix = U16(int32((*MemPage)(unsafe.Pointer(pPage)).FnCell) - 1)
return SQLITE_OK
}
@@ -47532,7 +48161,7 @@ func moveToRightmost(tls *libc.TLS, pCur uintptr) int32 { /* sqlite3.c:70789:12:
// Move the cursor to the first entry in the table. Return SQLITE_OK
// on success. Set *pRes to 0 if the cursor actually points to something
// or set *pRes to 1 if the table is empty.
-func Xsqlite3BtreeFirst(tls *libc.TLS, pCur uintptr, pRes uintptr) int32 { /* sqlite3.c:70812:20: */
+func Xsqlite3BtreeFirst(tls *libc.TLS, pCur uintptr, pRes uintptr) int32 { /* sqlite3.c:70957:20: */
var rc int32
rc = moveToRoot(tls, pCur)
@@ -47551,11 +48180,11 @@ func Xsqlite3BtreeFirst(tls *libc.TLS, pCur uintptr, pRes uintptr) int32 { /* sq
// Move the cursor to the last entry in the table. Return SQLITE_OK
// on success. Set *pRes to 0 if the cursor actually points to something
// or set *pRes to 1 if the table is empty.
-func Xsqlite3BtreeLast(tls *libc.TLS, pCur uintptr, pRes uintptr) int32 { /* sqlite3.c:70834:20: */
+func Xsqlite3BtreeLast(tls *libc.TLS, pCur uintptr, pRes uintptr) int32 { /* sqlite3.c:70979:20: */
var rc int32
// If the cursor already points to the last entry, this is a no-op.
- if (CURSOR_VALID == int32((*BtCursor)(unsafe.Pointer(pCur)).FeState)) && ((int32((*BtCursor)(unsafe.Pointer(pCur)).FcurFlags) & BTCF_AtLast) != 0) {
+ if CURSOR_VALID == int32((*BtCursor)(unsafe.Pointer(pCur)).FeState) && int32((*BtCursor)(unsafe.Pointer(pCur)).FcurFlags)&BTCF_AtLast != 0 {
*(*int32)(unsafe.Pointer(pRes)) = 0
return SQLITE_OK
}
@@ -47566,9 +48195,9 @@ func Xsqlite3BtreeLast(tls *libc.TLS, pCur uintptr, pRes uintptr) int32 { /* sql
*(*int32)(unsafe.Pointer(pRes)) = 0
rc = moveToRightmost(tls, pCur)
if rc == SQLITE_OK {
- *(*U8)(unsafe.Pointer(pCur + 1 /* &.curFlags */)) |= U8((BTCF_AtLast))
+ *(*U8)(unsafe.Pointer(pCur + 1)) |= U8(BTCF_AtLast)
} else {
- *(*U8)(unsafe.Pointer(pCur + 1 /* &.curFlags */)) &= libc.Uint8FromInt32((libc.CplInt32(BTCF_AtLast)))
+ *(*U8)(unsafe.Pointer(pCur + 1)) &= libc.Uint8FromInt32(libc.CplInt32(BTCF_AtLast))
}
} else if rc == SQLITE_EMPTY {
@@ -47578,12 +48207,8 @@ func Xsqlite3BtreeLast(tls *libc.TLS, pCur uintptr, pRes uintptr) int32 { /* sql
return rc
}
-// Move the cursor so that it points to an entry near the key
-// specified by pIdxKey or intKey. Return a success code.
-//
-// For INTKEY tables, the intKey parameter is used. pIdxKey
-// must be NULL. For index tables, pIdxKey is used and intKey
-// is ignored.
+// Move the cursor so that it points to an entry in a table (a.k.a INTKEY)
+// table near the key intKey. Return a success code.
//
// If an exact match is not found, then the cursor is always
// left pointing at a leaf page which would hold the entry if it
@@ -47596,38 +48221,21 @@ func Xsqlite3BtreeLast(tls *libc.TLS, pCur uintptr, pRes uintptr) int32 { /* sql
// *pRes is as follows:
//
// *pRes<0 The cursor is left pointing at an entry that
-// is smaller than intKey/pIdxKey or if the table is empty
+// is smaller than intKey or if the table is empty
// and the cursor is therefore left point to nothing.
//
// *pRes==0 The cursor is left pointing at an entry that
-// exactly matches intKey/pIdxKey.
+// exactly matches intKey.
//
// *pRes>0 The cursor is left pointing at an entry that
-// is larger than intKey/pIdxKey.
-//
-// For index tables, the pIdxKey->eqSeen field is set to 1 if there
-// exists an entry in the table that exactly matches pIdxKey.
-func Xsqlite3BtreeMovetoUnpacked(tls *libc.TLS, pCur uintptr, pIdxKey uintptr, intKey I64, biasRight int32, pRes uintptr) int32 { /* sqlite3.c:70906:20: */
+// is larger than intKey.
+func Xsqlite3BtreeTableMoveto(tls *libc.TLS, pCur uintptr, intKey I64, biasRight int32, pRes uintptr) int32 { /* sqlite3.c:71044:20: */
bp := tls.Alloc(8)
defer tls.Free(8)
var rc int32
- var xRecordCompare RecordCompare
// var nCellKey I64 at bp, 8
- // The record flows over onto one or more overflow pages. In
- // this case the whole cell needs to be parsed, a buffer allocated
- // and accessPayload() used to retrieve the record into the
- // buffer before VdbeRecordCompare() can be called.
- //
- // If the record is corrupt, the xRecordCompare routine may read
- // up to two varints past the end of the buffer. An extra 18
- // bytes of padding is allocated at the end of the buffer in
- // case this happens.
- var pCellKey uintptr
- var pCellBody uintptr
- var nOverrun int32
- var nCell int32
var lwr int32
var upr int32
var idx int32
@@ -47638,8 +48246,7 @@ func Xsqlite3BtreeMovetoUnpacked(tls *libc.TLS, pCur uintptr, pIdxKey uintptr, i
// If the cursor is already positioned at the point we are trying
// to move to, then just return without doing any work
- if !(((pIdxKey == uintptr(0)) &&
- (int32((*BtCursor)(unsafe.Pointer(pCur)).FeState) == CURSOR_VALID)) && ((int32((*BtCursor)(unsafe.Pointer(pCur)).FcurFlags) & BTCF_ValidNKey) != 0)) {
+ if !(int32((*BtCursor)(unsafe.Pointer(pCur)).FeState) == CURSOR_VALID && int32((*BtCursor)(unsafe.Pointer(pCur)).FcurFlags)&BTCF_ValidNKey != 0) {
goto __1
}
if !((*BtCursor)(unsafe.Pointer(pCur)).Finfo.FnKey == intKey) {
@@ -47652,7 +48259,7 @@ __2:
if !((*BtCursor)(unsafe.Pointer(pCur)).Finfo.FnKey < intKey) {
goto __3
}
- if !((int32((*BtCursor)(unsafe.Pointer(pCur)).FcurFlags) & BTCF_AtLast) != 0) {
+ if !(int32((*BtCursor)(unsafe.Pointer(pCur)).FcurFlags)&BTCF_AtLast != 0) {
goto __4
}
*(*int32)(unsafe.Pointer(pRes)) = -1
@@ -47663,7 +48270,7 @@ __4:
// try to get there using sqlite3BtreeNext() rather than a full
// binary search. This is an optimization only. The correct answer
// is still obtained without this case, only a little more slowely
- if !(((*BtCursor)(unsafe.Pointer(pCur)).Finfo.FnKey + int64(1)) == intKey) {
+ if !((*BtCursor)(unsafe.Pointer(pCur)).Finfo.FnKey+int64(1) == intKey) {
goto __5
}
*(*int32)(unsafe.Pointer(pRes)) = 0
@@ -47680,14 +48287,11 @@ __8:
;
goto __7
__6:
- if !(rc == SQLITE_DONE) {
+ if !(rc != SQLITE_DONE) {
goto __9
}
- rc = SQLITE_OK
- goto __10
-__9:
return rc
-__10:
+__9:
;
__7:
;
@@ -47698,35 +48302,23 @@ __3:
__1:
;
- if !(pIdxKey != 0) {
- goto __11
- }
- xRecordCompare = Xsqlite3VdbeFindCompare(tls, pIdxKey)
- (*UnpackedRecord)(unsafe.Pointer(pIdxKey)).FerrCode = U8(0)
-
- goto __12
-__11:
- xRecordCompare = uintptr(0) // All keys are integers
-__12:
- ;
-
rc = moveToRoot(tls, pCur)
if !(rc != 0) {
- goto __13
+ goto __10
}
if !(rc == SQLITE_EMPTY) {
- goto __14
+ goto __11
}
*(*int32)(unsafe.Pointer(pRes)) = -1
return SQLITE_OK
-__14:
+__11:
;
return rc
-__13:
+__10:
;
-__15:
+__12:
pPage = (*BtCursor)(unsafe.Pointer(pCur)).FpPage // Pointer to current cell in pPage
// pPage->nCell must be greater than zero. If this is the root-page
@@ -47737,92 +48329,210 @@ __15:
// a moveToChild() or moveToRoot() call would have detected corruption.
lwr = 0
- upr = (int32((*MemPage)(unsafe.Pointer(pPage)).FnCell) - 1)
+ upr = int32((*MemPage)(unsafe.Pointer(pPage)).FnCell) - 1
- idx = (upr >> (1 - biasRight)) // idx = biasRight ? upr : (lwr+upr)/2;
+ idx = upr >> (1 - biasRight) // idx = biasRight ? upr : (lwr+upr)/2;
(*BtCursor)(unsafe.Pointer(pCur)).Fix = U16(idx)
- if !(xRecordCompare == uintptr(0)) {
- goto __18
- }
-__20:
- pCell = ((*MemPage)(unsafe.Pointer((pPage))).FaDataOfst + uintptr((int32((*MemPage)(unsafe.Pointer((pPage))).FmaskPage) & int32(libc.X__builtin_bswap16(tls, *(*U16)(unsafe.Pointer(((*MemPage)(unsafe.Pointer((pPage))).FaCellIdx + uintptr((2 * (idx)))))))))))
+__15:
+ pCell = (*MemPage)(unsafe.Pointer(pPage)).FaDataOfst + uintptr(int32((*MemPage)(unsafe.Pointer(pPage)).FmaskPage)&int32(libc.X__builtin_bswap16(tls, *(*U16)(unsafe.Pointer((*MemPage)(unsafe.Pointer(pPage)).FaCellIdx + uintptr(2*idx))))))
if !((*MemPage)(unsafe.Pointer(pPage)).FintKeyLeaf != 0) {
- goto __23
+ goto __18
}
-__24:
+__19:
if !(0x80 <= int32(*(*U8)(unsafe.Pointer(libc.PostIncUintptr(&pCell, 1))))) {
- goto __25
+ goto __20
}
if !(pCell >= (*MemPage)(unsafe.Pointer(pPage)).FaDataEnd) {
- goto __26
+ goto __21
}
- return Xsqlite3CorruptError(tls, 71013)
-__26:
+ return Xsqlite3CorruptError(tls, 71134)
+__21:
;
- goto __24
-__25:
+ goto __19
+__20:
;
-__23:
+__18:
;
Xsqlite3GetVarint(tls, pCell, bp /* &nCellKey */)
- if !(*(*I64)(unsafe.Pointer(bp /* nCellKey */)) < intKey) {
- goto __27
+ if !(*(*I64)(unsafe.Pointer(bp)) < intKey) {
+ goto __22
}
- lwr = (idx + 1)
+ lwr = idx + 1
if !(lwr > upr) {
- goto __29
+ goto __24
}
c = -1
- goto __22
-__29:
+ goto __17
+__24:
;
- goto __28
-__27:
- if !(*(*I64)(unsafe.Pointer(bp /* nCellKey */)) > intKey) {
- goto __30
+ goto __23
+__22:
+ if !(*(*I64)(unsafe.Pointer(bp)) > intKey) {
+ goto __25
}
- upr = (idx - 1)
+ upr = idx - 1
if !(lwr > upr) {
- goto __32
+ goto __27
}
c = +1
- goto __22
-__32:
+ goto __17
+__27:
;
- goto __31
-__30:
+ goto __26
+__25:
;
(*BtCursor)(unsafe.Pointer(pCur)).Fix = U16(idx)
- if !(!(int32((*MemPage)(unsafe.Pointer(pPage)).Fleaf) != 0)) {
- goto __33
+ if !!(int32((*MemPage)(unsafe.Pointer(pPage)).Fleaf) != 0) {
+ goto __28
}
lwr = idx
- goto moveto_next_layer
- goto __34
-__33:
- *(*U8)(unsafe.Pointer(pCur + 1 /* &.curFlags */)) |= U8((BTCF_ValidNKey))
+ goto moveto_table_next_layer
+ goto __29
+__28:
+ *(*U8)(unsafe.Pointer(pCur + 1)) |= U8(BTCF_ValidNKey)
(*BtCursor)(unsafe.Pointer(pCur)).Finfo.FnKey = *(*I64)(unsafe.Pointer(bp /* nCellKey */))
(*BtCursor)(unsafe.Pointer(pCur)).Finfo.FnSize = U16(0)
*(*int32)(unsafe.Pointer(pRes)) = 0
return SQLITE_OK
-__34:
+__29:
+ ;
+__26:
+ ;
+__23:
+ ;
+
+ idx = (lwr + upr) >> 1 // idx = (lwr+upr)/2;
+ goto __16
+__16:
+ goto __15
+ goto __17
+__17:
+ ;
+
+ if !((*MemPage)(unsafe.Pointer(pPage)).Fleaf != 0) {
+ goto __30
+ }
+
+ (*BtCursor)(unsafe.Pointer(pCur)).Fix = U16(idx)
+ *(*int32)(unsafe.Pointer(pRes)) = c
+ rc = SQLITE_OK
+ goto moveto_table_finish
+__30:
;
+moveto_table_next_layer:
+ if !(lwr >= int32((*MemPage)(unsafe.Pointer(pPage)).FnCell)) {
+ goto __31
+ }
+ chldPg = Xsqlite3Get4byte(tls, (*MemPage)(unsafe.Pointer(pPage)).FaData+uintptr(int32((*MemPage)(unsafe.Pointer(pPage)).FhdrOffset)+8))
+ goto __32
__31:
+ chldPg = Xsqlite3Get4byte(tls, (*MemPage)(unsafe.Pointer(pPage)).FaData+uintptr(int32((*MemPage)(unsafe.Pointer(pPage)).FmaskPage)&int32(libc.X__builtin_bswap16(tls, *(*U16)(unsafe.Pointer((*MemPage)(unsafe.Pointer(pPage)).FaCellIdx + uintptr(2*lwr)))))))
+__32:
;
-__28:
+ (*BtCursor)(unsafe.Pointer(pCur)).Fix = U16(lwr)
+ rc = moveToChild(tls, pCur, chldPg)
+ if !(rc != 0) {
+ goto __33
+ }
+ goto __14
+__33:
+ ;
+ goto __13
+__13:
+ goto __12
+ goto __14
+__14:
;
+moveto_table_finish:
+ (*BtCursor)(unsafe.Pointer(pCur)).Finfo.FnSize = U16(0)
- idx = ((lwr + upr) >> 1) // idx = (lwr+upr)/2;
- goto __21
-__21:
- goto __20
- goto __22
-__22:
+ return rc
+}
+
+// Move the cursor so that it points to an entry in an index table
+// near the key pIdxKey. Return a success code.
+//
+// If an exact match is not found, then the cursor is always
+// left pointing at a leaf page which would hold the entry if it
+// were present. The cursor might point to an entry that comes
+// before or after the key.
+//
+// An integer is written into *pRes which is the result of
+// comparing the key with the entry to which the cursor is
+// pointing. The meaning of the integer written into
+// *pRes is as follows:
+//
+// *pRes<0 The cursor is left pointing at an entry that
+// is smaller than pIdxKey or if the table is empty
+// and the cursor is therefore left point to nothing.
+//
+// *pRes==0 The cursor is left pointing at an entry that
+// exactly matches pIdxKey.
+//
+// *pRes>0 The cursor is left pointing at an entry that
+// is larger than pIdxKey.
+//
+// The pIdxKey->eqSeen field is set to 1 if there
+// exists an entry in the table that exactly matches pIdxKey.
+func Xsqlite3BtreeIndexMoveto(tls *libc.TLS, pCur uintptr, pIdxKey uintptr, pRes uintptr) int32 { /* sqlite3.c:71213:20: */
+ var rc int32
+ var xRecordCompare RecordCompare
+ // The record flows over onto one or more overflow pages. In
+ // this case the whole cell needs to be parsed, a buffer allocated
+ // and accessPayload() used to retrieve the record into the
+ // buffer before VdbeRecordCompare() can be called.
+ //
+ // If the record is corrupt, the xRecordCompare routine may read
+ // up to two varints past the end of the buffer. An extra 18
+ // bytes of padding is allocated at the end of the buffer in
+ // case this happens.
+ var pCellKey uintptr
+ var pCellBody uintptr
+ var nOverrun int32
+ var nCell int32
+ var lwr int32
+ var upr int32
+ var idx int32
+ var c int32
+ var chldPg Pgno
+ var pPage uintptr
+ var pCell uintptr
+
+ xRecordCompare = Xsqlite3VdbeFindCompare(tls, pIdxKey)
+ (*UnpackedRecord)(unsafe.Pointer(pIdxKey)).FerrCode = U8(0)
+
+ rc = moveToRoot(tls, pCur)
+ if !(rc != 0) {
+ goto __1
+ }
+ if !(rc == SQLITE_EMPTY) {
+ goto __2
+ }
+
+ *(*int32)(unsafe.Pointer(pRes)) = -1
+ return SQLITE_OK
+__2:
;
- goto __19
-__18:
-__35: // Size of the pCell cell in bytes
- pCell = ((*MemPage)(unsafe.Pointer((pPage))).FaDataOfst + uintptr((int32((*MemPage)(unsafe.Pointer((pPage))).FmaskPage) & int32(libc.X__builtin_bswap16(tls, *(*U16)(unsafe.Pointer(((*MemPage)(unsafe.Pointer((pPage))).FaCellIdx + uintptr((2 * (idx)))))))))))
+ return rc
+__1:
+ ;
+
+__3:
+ pPage = (*BtCursor)(unsafe.Pointer(pCur)).FpPage // Pointer to current cell in pPage
+
+ // pPage->nCell must be greater than zero. If this is the root-page
+ // the cursor would have been INVALID above and this for(;;) loop
+ // not run. If this is not the root-page, then the moveToChild() routine
+ // would have already detected db corruption. Similarly, pPage must
+ // be the right kind (index or table) of b-tree page. Otherwise
+ // a moveToChild() or moveToRoot() call would have detected corruption.
+
+ lwr = 0
+ upr = int32((*MemPage)(unsafe.Pointer(pPage)).FnCell) - 1
+ idx = upr >> 1 // idx = (lwr+upr)/2;
+ (*BtCursor)(unsafe.Pointer(pCur)).Fix = U16(idx)
+__6: // Size of the pCell cell in bytes
+ pCell = (*MemPage)(unsafe.Pointer(pPage)).FaDataOfst + uintptr(int32((*MemPage)(unsafe.Pointer(pPage)).FmaskPage)&int32(libc.X__builtin_bswap16(tls, *(*U16)(unsafe.Pointer((*MemPage)(unsafe.Pointer(pPage)).FaCellIdx + uintptr(2*idx))))))
// The maximum supported page-size is 65536 bytes. This means that
// the maximum number of record bytes stored on an index B-Tree
@@ -47833,7 +48543,7 @@ __35: // Size of the pCell cell in bytes
// 2 bytes of the cell.
nCell = int32(*(*U8)(unsafe.Pointer(pCell)))
if !(nCell <= int32((*MemPage)(unsafe.Pointer(pPage)).Fmax1bytePayload)) {
- goto __38
+ goto __9
}
// This branch runs if the record-size field of the cell is a
// single byte varint and the record fits entirely on the main
@@ -47841,143 +48551,140 @@ __35: // Size of the pCell cell in bytes
c = (*struct {
f func(*libc.TLS, int32, uintptr, uintptr) int32
- })(unsafe.Pointer(&struct{ uintptr }{xRecordCompare})).f(tls, nCell, (pCell + 1), pIdxKey)
- goto __39
-__38:
- if !(!((int32(*(*U8)(unsafe.Pointer(pCell + 1))) & 0x80) != 0) &&
- ((libc.AssignInt32(&nCell, (((nCell & 0x7f) << 7) + int32(*(*U8)(unsafe.Pointer(pCell + 1)))))) <= int32((*MemPage)(unsafe.Pointer(pPage)).FmaxLocal))) {
- goto __40
+ })(unsafe.Pointer(&struct{ uintptr }{xRecordCompare})).f(tls, nCell, pCell+1, pIdxKey)
+ goto __10
+__9:
+ if !(!(int32(*(*U8)(unsafe.Pointer(pCell + 1)))&0x80 != 0) &&
+ libc.AssignInt32(&nCell, nCell&0x7f<<7+int32(*(*U8)(unsafe.Pointer(pCell + 1)))) <= int32((*MemPage)(unsafe.Pointer(pPage)).FmaxLocal)) {
+ goto __11
}
// The record-size field is a 2 byte varint and the record
// fits entirely on the main b-tree page.
c = (*struct {
f func(*libc.TLS, int32, uintptr, uintptr) int32
- })(unsafe.Pointer(&struct{ uintptr }{xRecordCompare})).f(tls, nCell, (pCell + 2), pIdxKey)
- goto __41
-__40:
- pCellBody = (pCell - uintptr((*MemPage)(unsafe.Pointer(pPage)).FchildPtrSize))
+ })(unsafe.Pointer(&struct{ uintptr }{xRecordCompare})).f(tls, nCell, pCell+2, pIdxKey)
+ goto __12
+__11:
+ pCellBody = pCell - uintptr((*MemPage)(unsafe.Pointer(pPage)).FchildPtrSize)
nOverrun = 18 // Size of the overrun padding
(*struct {
f func(*libc.TLS, uintptr, uintptr, uintptr)
- })(unsafe.Pointer(&struct{ uintptr }{(*MemPage)(unsafe.Pointer(pPage)).FxParseCell})).f(tls, pPage, pCellBody, (pCur + 32 /* &.info */))
+ })(unsafe.Pointer(&struct{ uintptr }{(*MemPage)(unsafe.Pointer(pPage)).FxParseCell})).f(tls, pPage, pCellBody, pCur+32 /* &.info */)
nCell = int32((*BtCursor)(unsafe.Pointer(pCur)).Finfo.FnKey)
// True if key size is 2^32 or more
// Invalid key size: 0x80 0x80 0x00
// Invalid key size: 0x80 0x80 0x01
// Minimum legal index key size
- if !((nCell < 2) || ((U32(nCell) / (*BtShared)(unsafe.Pointer((*BtCursor)(unsafe.Pointer(pCur)).FpBt)).FusableSize) > (*BtShared)(unsafe.Pointer((*BtCursor)(unsafe.Pointer(pCur)).FpBt)).FnPage)) {
- goto __42
+ if !(nCell < 2 || U32(nCell)/(*BtShared)(unsafe.Pointer((*BtCursor)(unsafe.Pointer(pCur)).FpBt)).FusableSize > (*BtShared)(unsafe.Pointer((*BtCursor)(unsafe.Pointer(pCur)).FpBt)).FnPage) {
+ goto __13
}
- rc = Xsqlite3CorruptError(tls, 71088)
- goto moveto_finish
-__42:
+ rc = Xsqlite3CorruptError(tls, 71316)
+ goto moveto_index_finish
+__13:
;
- pCellKey = Xsqlite3Malloc(tls, (uint64(nCell + nOverrun)))
+ pCellKey = Xsqlite3Malloc(tls, uint64(nCell+nOverrun))
if !(pCellKey == uintptr(0)) {
- goto __43
+ goto __14
}
rc = SQLITE_NOMEM
- goto moveto_finish
-__43:
+ goto moveto_index_finish
+__14:
;
(*BtCursor)(unsafe.Pointer(pCur)).Fix = U16(idx)
rc = accessPayload(tls, pCur, uint32(0), uint32(nCell), pCellKey, 0)
- libc.Xmemset(tls, ((pCellKey) + uintptr(nCell)), 0, uint32(nOverrun)) // Fix uninit warnings
- *(*U8)(unsafe.Pointer(pCur + 1 /* &.curFlags */)) &= libc.Uint8FromInt32((libc.CplInt32(BTCF_ValidOvfl)))
+ libc.Xmemset(tls, pCellKey+uintptr(nCell), 0, uint32(nOverrun)) // Fix uninit warnings
+ *(*U8)(unsafe.Pointer(pCur + 1)) &= libc.Uint8FromInt32(libc.CplInt32(BTCF_ValidOvfl))
if !(rc != 0) {
- goto __44
+ goto __15
}
Xsqlite3_free(tls, pCellKey)
- goto moveto_finish
-__44:
+ goto moveto_index_finish
+__15:
;
c = Xsqlite3VdbeRecordCompare(tls, nCell, pCellKey, pIdxKey)
Xsqlite3_free(tls, pCellKey)
-__41:
+__12:
;
-__39:
+__10:
;
if !(c < 0) {
- goto __45
+ goto __16
}
- lwr = (idx + 1)
- goto __46
-__45:
+ lwr = idx + 1
+ goto __17
+__16:
if !(c > 0) {
- goto __47
+ goto __18
}
- upr = (idx - 1)
- goto __48
-__47:
+ upr = idx - 1
+ goto __19
+__18:
;
*(*int32)(unsafe.Pointer(pRes)) = 0
rc = SQLITE_OK
(*BtCursor)(unsafe.Pointer(pCur)).Fix = U16(idx)
if !((*UnpackedRecord)(unsafe.Pointer(pIdxKey)).FerrCode != 0) {
- goto __49
+ goto __20
}
- rc = Xsqlite3CorruptError(tls, 71120)
-__49:
+ rc = Xsqlite3CorruptError(tls, 71348)
+__20:
;
- goto moveto_finish
-__48:
+ goto moveto_index_finish
+__19:
;
-__46:
+__17:
;
if !(lwr > upr) {
- goto __50
+ goto __21
}
- goto __37
-__50:
+ goto __8
+__21:
;
- idx = ((lwr + upr) >> 1) // idx = (lwr+upr)/2
- goto __36
-__36:
- goto __35
- goto __37
-__37:
- ;
-__19:
+ idx = (lwr + upr) >> 1 // idx = (lwr+upr)/2
+ goto __7
+__7:
+ goto __6
+ goto __8
+__8:
;
if !((*MemPage)(unsafe.Pointer(pPage)).Fleaf != 0) {
- goto __51
+ goto __22
}
(*BtCursor)(unsafe.Pointer(pCur)).Fix = U16(idx)
*(*int32)(unsafe.Pointer(pRes)) = c
rc = SQLITE_OK
- goto moveto_finish
-__51:
+ goto moveto_index_finish
+__22:
;
-moveto_next_layer:
if !(lwr >= int32((*MemPage)(unsafe.Pointer(pPage)).FnCell)) {
- goto __52
+ goto __23
}
- chldPg = Xsqlite3Get4byte(tls, ((*MemPage)(unsafe.Pointer(pPage)).FaData + uintptr((int32((*MemPage)(unsafe.Pointer(pPage)).FhdrOffset) + 8))))
- goto __53
-__52:
- chldPg = Xsqlite3Get4byte(tls, ((*MemPage)(unsafe.Pointer((pPage))).FaData + uintptr((int32((*MemPage)(unsafe.Pointer((pPage))).FmaskPage) & int32(libc.X__builtin_bswap16(tls, *(*U16)(unsafe.Pointer(((*MemPage)(unsafe.Pointer((pPage))).FaCellIdx + uintptr((2 * (lwr))))))))))))
-__53:
+ chldPg = Xsqlite3Get4byte(tls, (*MemPage)(unsafe.Pointer(pPage)).FaData+uintptr(int32((*MemPage)(unsafe.Pointer(pPage)).FhdrOffset)+8))
+ goto __24
+__23:
+ chldPg = Xsqlite3Get4byte(tls, (*MemPage)(unsafe.Pointer(pPage)).FaData+uintptr(int32((*MemPage)(unsafe.Pointer(pPage)).FmaskPage)&int32(libc.X__builtin_bswap16(tls, *(*U16)(unsafe.Pointer((*MemPage)(unsafe.Pointer(pPage)).FaCellIdx + uintptr(2*lwr)))))))
+__24:
;
(*BtCursor)(unsafe.Pointer(pCur)).Fix = U16(lwr)
rc = moveToChild(tls, pCur, chldPg)
if !(rc != 0) {
- goto __54
+ goto __25
}
- goto __17
-__54:
+ goto __5
+__25:
;
- goto __16
-__16:
- goto __15
- goto __17
-__17:
+ goto __4
+__4:
+ goto __3
+ goto __5
+__5:
;
-moveto_finish:
+moveto_index_finish:
(*BtCursor)(unsafe.Pointer(pCur)).Finfo.FnSize = U16(0)
return rc
@@ -47988,17 +48695,17 @@ moveto_finish:
// TRUE will be returned after a call to sqlite3BtreeNext() moves
// past the last entry in the table or sqlite3BtreePrev() moves past
// the first entry. TRUE is also returned if the table is empty.
-func Xsqlite3BtreeEof(tls *libc.TLS, pCur uintptr) int32 { /* sqlite3.c:71161:20: */
+func Xsqlite3BtreeEof(tls *libc.TLS, pCur uintptr) int32 { /* sqlite3.c:71387:20: */
// TODO: What if the cursor is in CURSOR_REQUIRESEEK but all table entries
// have been deleted? This API will need to change to return an error code
// as well as the boolean result value.
- return (libc.Bool32(CURSOR_VALID != int32((*BtCursor)(unsafe.Pointer(pCur)).FeState)))
+ return libc.Bool32(CURSOR_VALID != int32((*BtCursor)(unsafe.Pointer(pCur)).FeState))
}
// Return an estimate for the number of rows in the table that pCur is
// pointing to. Return a negative number if no estimate is currently
// available.
-func Xsqlite3BtreeRowCountEst(tls *libc.TLS, pCur uintptr) I64 { /* sqlite3.c:71174:20: */
+func Xsqlite3BtreeRowCountEst(tls *libc.TLS, pCur uintptr) I64 { /* sqlite3.c:71400:20: */
var n I64
var i U8
@@ -48014,7 +48721,7 @@ func Xsqlite3BtreeRowCountEst(tls *libc.TLS, pCur uintptr) I64 { /* sqlite3.c:71
n = I64((*MemPage)(unsafe.Pointer((*BtCursor)(unsafe.Pointer(pCur)).FpPage)).FnCell)
for i = U8(0); int32(i) < int32((*BtCursor)(unsafe.Pointer(pCur)).FiPage); i++ {
- n = n * (I64((*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((pCur + 120 /* &.apPage */) + uintptr(i)*4)))).FnCell))
+ n = n * I64((*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pCur + 120 + uintptr(i)*4)))).FnCell)
}
return n
}
@@ -48037,7 +48744,7 @@ func Xsqlite3BtreeRowCountEst(tls *libc.TLS, pCur uintptr) I64 { /* sqlite3.c:71
// skipped if the SQL index had been a unique index. The F argument
// is a hint to the implement. SQLite btree implementation does not use
// this hint, but COMDB2 does.
-func btreeNext(tls *libc.TLS, pCur uintptr) int32 { /* sqlite3.c:71214:28: */
+func btreeNext(tls *libc.TLS, pCur uintptr) int32 { /* sqlite3.c:71440:28: */
var rc int32
var idx int32
var pPage uintptr
@@ -48066,7 +48773,7 @@ func btreeNext(tls *libc.TLS, pCur uintptr) int32 { /* sqlite3.c:71214:28: */
pPage = (*BtCursor)(unsafe.Pointer(pCur)).FpPage
idx = int32(libc.PreIncUint16(&(*BtCursor)(unsafe.Pointer(pCur)).Fix, 1))
- if !(int32((*MemPage)(unsafe.Pointer(pPage)).FisInit) != 0) || (Xsqlite3FaultSim(tls, 412) != 0) {
+ if !(int32((*MemPage)(unsafe.Pointer(pPage)).FisInit) != 0) || Xsqlite3FaultSim(tls, 412) != 0 {
// The only known way for this to happen is for there to be a
// recursive SQL function that does a DELETE operation as part of a
// SELECT which deletes content out from under an active cursor
@@ -48074,27 +48781,18 @@ func btreeNext(tls *libc.TLS, pCur uintptr) int32 { /* sqlite3.c:71214:28: */
// has pages in common with the table being queried. See TH3
// module cov1/btree78.test testcase 220 (2018-06-08) for an
// example.
- return Xsqlite3CorruptError(tls, 71245)
+ return Xsqlite3CorruptError(tls, 71471)
}
- // If the database file is corrupt, it is possible for the value of idx
- // to be invalid here. This can only occur if a second cursor modifies
- // the page while cursor pCur is holding a reference to it. Which can
- // only happen if the database is corrupt in such a way as to link the
- // page into more than one b-tree structure.
- //
- // Update 2019-12-23: appears to long longer be possible after the
- // addition of anotherValidCursor() condition on balance_deeper().
-
if idx >= int32((*MemPage)(unsafe.Pointer(pPage)).FnCell) {
if !(int32((*MemPage)(unsafe.Pointer(pPage)).Fleaf) != 0) {
- rc = moveToChild(tls, pCur, Xsqlite3Get4byte(tls, ((*MemPage)(unsafe.Pointer(pPage)).FaData+uintptr((int32((*MemPage)(unsafe.Pointer(pPage)).FhdrOffset)+8)))))
+ rc = moveToChild(tls, pCur, Xsqlite3Get4byte(tls, (*MemPage)(unsafe.Pointer(pPage)).FaData+uintptr(int32((*MemPage)(unsafe.Pointer(pPage)).FhdrOffset)+8)))
if rc != 0 {
return rc
}
return moveToLeftmost(tls, pCur)
}
- for ok := true; ok; ok = (int32((*BtCursor)(unsafe.Pointer(pCur)).Fix) >= int32((*MemPage)(unsafe.Pointer(pPage)).FnCell)) {
+ for ok := true; ok; ok = int32((*BtCursor)(unsafe.Pointer(pCur)).Fix) >= int32((*MemPage)(unsafe.Pointer(pPage)).FnCell) {
if int32((*BtCursor)(unsafe.Pointer(pCur)).FiPage) == 0 {
(*BtCursor)(unsafe.Pointer(pCur)).FeState = U8(CURSOR_INVALID)
return SQLITE_DONE
@@ -48116,17 +48814,17 @@ func btreeNext(tls *libc.TLS, pCur uintptr) int32 { /* sqlite3.c:71214:28: */
return int32(0)
}
-func Xsqlite3BtreeNext(tls *libc.TLS, pCur uintptr, flags int32) int32 { /* sqlite3.c:71284:20: */
+func Xsqlite3BtreeNext(tls *libc.TLS, pCur uintptr, flags int32) int32 { /* sqlite3.c:71500:20: */
var pPage uintptr
_ = flags // Used in COMDB2 but not native SQLite
(*BtCursor)(unsafe.Pointer(pCur)).Finfo.FnSize = U16(0)
- *(*U8)(unsafe.Pointer(pCur + 1 /* &.curFlags */)) &= libc.Uint8FromInt32((libc.CplInt32((BTCF_ValidNKey | BTCF_ValidOvfl))))
+ *(*U8)(unsafe.Pointer(pCur + 1)) &= libc.Uint8FromInt32(libc.CplInt32(BTCF_ValidNKey | BTCF_ValidOvfl))
if int32((*BtCursor)(unsafe.Pointer(pCur)).FeState) != CURSOR_VALID {
return btreeNext(tls, pCur)
}
pPage = (*BtCursor)(unsafe.Pointer(pCur)).FpPage
- if (int32(libc.PreIncUint16(&(*BtCursor)(unsafe.Pointer(pCur)).Fix, 1))) >= int32((*MemPage)(unsafe.Pointer(pPage)).FnCell) {
+ if int32(libc.PreIncUint16(&(*BtCursor)(unsafe.Pointer(pCur)).Fix, 1)) >= int32((*MemPage)(unsafe.Pointer(pPage)).FnCell) {
(*BtCursor)(unsafe.Pointer(pCur)).Fix--
return btreeNext(tls, pCur)
}
@@ -48156,7 +48854,7 @@ func Xsqlite3BtreeNext(tls *libc.TLS, pCur uintptr, flags int32) int32 { /* sqli
// skipped if the SQL index had been a unique index. The F argument is a
// hint to the implement. The native SQLite btree implementation does not
// use this hint, but COMDB2 does.
-func btreePrevious(tls *libc.TLS, pCur uintptr) int32 { /* sqlite3.c:71324:28: */
+func btreePrevious(tls *libc.TLS, pCur uintptr) int32 { /* sqlite3.c:71540:28: */
var rc int32
var pPage uintptr
@@ -48185,7 +48883,7 @@ func btreePrevious(tls *libc.TLS, pCur uintptr) int32 { /* sqlite3.c:71324:28: *
if !(int32((*MemPage)(unsafe.Pointer(pPage)).Fleaf) != 0) {
var idx int32 = int32((*BtCursor)(unsafe.Pointer(pCur)).Fix)
- rc = moveToChild(tls, pCur, Xsqlite3Get4byte(tls, ((*MemPage)(unsafe.Pointer((pPage))).FaData+uintptr((int32((*MemPage)(unsafe.Pointer((pPage))).FmaskPage)&int32(libc.X__builtin_bswap16(tls, *(*U16)(unsafe.Pointer(((*MemPage)(unsafe.Pointer((pPage))).FaCellIdx + uintptr((2 * (idx)))))))))))))
+ rc = moveToChild(tls, pCur, Xsqlite3Get4byte(tls, (*MemPage)(unsafe.Pointer(pPage)).FaData+uintptr(int32((*MemPage)(unsafe.Pointer(pPage)).FmaskPage)&int32(libc.X__builtin_bswap16(tls, *(*U16)(unsafe.Pointer((*MemPage)(unsafe.Pointer(pPage)).FaCellIdx + uintptr(2*idx))))))))
if rc != 0 {
return rc
}
@@ -48201,7 +48899,7 @@ func btreePrevious(tls *libc.TLS, pCur uintptr) int32 { /* sqlite3.c:71324:28: *
(*BtCursor)(unsafe.Pointer(pCur)).Fix--
pPage = (*BtCursor)(unsafe.Pointer(pCur)).FpPage
- if ((*MemPage)(unsafe.Pointer(pPage)).FintKey != 0) && !(int32((*MemPage)(unsafe.Pointer(pPage)).Fleaf) != 0) {
+ if (*MemPage)(unsafe.Pointer(pPage)).FintKey != 0 && !(int32((*MemPage)(unsafe.Pointer(pPage)).Fleaf) != 0) {
rc = Xsqlite3BtreePrevious(tls, pCur, 0)
} else {
rc = SQLITE_OK
@@ -48210,14 +48908,14 @@ func btreePrevious(tls *libc.TLS, pCur uintptr) int32 { /* sqlite3.c:71324:28: *
return rc
}
-func Xsqlite3BtreePrevious(tls *libc.TLS, pCur uintptr, flags int32) int32 { /* sqlite3.c:71373:20: */
+func Xsqlite3BtreePrevious(tls *libc.TLS, pCur uintptr, flags int32) int32 { /* sqlite3.c:71589:20: */
_ = flags // Used in COMDB2 but not native SQLite
- *(*U8)(unsafe.Pointer(pCur + 1 /* &.curFlags */)) &= libc.Uint8FromInt32((libc.CplInt32(((BTCF_AtLast | BTCF_ValidOvfl) | BTCF_ValidNKey))))
+ *(*U8)(unsafe.Pointer(pCur + 1)) &= libc.Uint8FromInt32(libc.CplInt32(BTCF_AtLast | BTCF_ValidOvfl | BTCF_ValidNKey))
(*BtCursor)(unsafe.Pointer(pCur)).Finfo.FnSize = U16(0)
- if ((int32((*BtCursor)(unsafe.Pointer(pCur)).FeState) != CURSOR_VALID) ||
- (int32((*BtCursor)(unsafe.Pointer(pCur)).Fix) == 0)) ||
- (int32((*MemPage)(unsafe.Pointer((*BtCursor)(unsafe.Pointer(pCur)).FpPage)).Fleaf) == 0) {
+ if int32((*BtCursor)(unsafe.Pointer(pCur)).FeState) != CURSOR_VALID ||
+ int32((*BtCursor)(unsafe.Pointer(pCur)).Fix) == 0 ||
+ int32((*MemPage)(unsafe.Pointer((*BtCursor)(unsafe.Pointer(pCur)).FpPage)).Fleaf) == 0 {
return btreePrevious(tls, pCur)
}
(*BtCursor)(unsafe.Pointer(pCur)).Fix--
@@ -48244,7 +48942,7 @@ func Xsqlite3BtreePrevious(tls *libc.TLS, pCur uintptr, flags int32) int32 { /*
// eMode is BTALLOC_LT then the page returned will be less than or equal
// to nearby if any such page exists. If eMode is BTALLOC_ANY then there
// are no restrictions on which page is returned.
-func allocateBtreePage(tls *libc.TLS, pBt uintptr, ppPage uintptr, pPgno uintptr, nearby Pgno, eMode U8) int32 { /* sqlite3.c:71411:12: */
+func allocateBtreePage(tls *libc.TLS, pBt uintptr, ppPage uintptr, pPgno uintptr, nearby Pgno, eMode U8) int32 { /* sqlite3.c:71627:12: */
bp := tls.Alloc(16)
defer tls.Free(16)
@@ -48306,12 +49004,12 @@ func allocateBtreePage(tls *libc.TLS, pBt uintptr, ppPage uintptr, pPgno uintptr
mxPage = btreePagecount(tls, pBt)
// EVIDENCE-OF: R-05119-02637 The 4-byte big-endian integer at offset 36
// stores stores the total number of pages on the freelist.
- n = Xsqlite3Get4byte(tls, ((*MemPage)(unsafe.Pointer(pPage1)).FaData + 36))
+ n = Xsqlite3Get4byte(tls, (*MemPage)(unsafe.Pointer(pPage1)).FaData+36)
if !(n >= mxPage) {
goto __1
}
- return Xsqlite3CorruptError(tls, 71435)
+ return Xsqlite3CorruptError(tls, 71651)
__1:
;
if !(n > U32(0)) {
@@ -48337,7 +49035,7 @@ __1:
return rc
__7:
;
- if !(int32(*(*U8)(unsafe.Pointer(bp /* eType */))) == PTRMAP_FREEPAGE) {
+ if !(int32(*(*U8)(unsafe.Pointer(bp))) == PTRMAP_FREEPAGE) {
goto __8
}
searchList = U8(1)
@@ -48365,7 +49063,7 @@ __5:
return rc
__10:
;
- Xsqlite3Put4byte(tls, ((*MemPage)(unsafe.Pointer(pPage1)).FaData + 36), (n - U32(1)))
+ Xsqlite3Put4byte(tls, (*MemPage)(unsafe.Pointer(pPage1)).FaData+36, n-U32(1))
// The code within this loop is run only once if the 'searchList' variable
// is not true. Otherwise, it runs once for each trunk-page on the
@@ -48379,20 +49077,20 @@ __11:
// EVIDENCE-OF: R-01506-11053 The first integer on a freelist trunk page
// is the page number of the next freelist trunk page in the list or
// zero if this is the last freelist trunk page.
- iTrunk = Xsqlite3Get4byte(tls, ((*MemPage)(unsafe.Pointer(pPrevTrunk)).FaData))
+ iTrunk = Xsqlite3Get4byte(tls, (*MemPage)(unsafe.Pointer(pPrevTrunk)).FaData)
goto __15
__14:
// EVIDENCE-OF: R-59841-13798 The 4-byte big-endian integer at offset 32
// stores the page number of the first page of the freelist, or zero if
// the freelist is empty.
- iTrunk = Xsqlite3Get4byte(tls, ((*MemPage)(unsafe.Pointer(pPage1)).FaData + 32))
+ iTrunk = Xsqlite3Get4byte(tls, (*MemPage)(unsafe.Pointer(pPage1)).FaData+32)
__15:
;
- if !((iTrunk > mxPage) || (libc.PostIncUint32(&nSearch, 1) > n)) {
+ if !(iTrunk > mxPage || libc.PostIncUint32(&nSearch, 1) > n) {
goto __16
}
- rc = Xsqlite3CorruptError(tls, 71491)
+ rc = Xsqlite3CorruptError(tls, 71707)
goto __17
__16:
rc = btreeGetUnusedPage(tls, pBt, iTrunk, bp+4 /* &pTrunk */, 0)
@@ -48408,8 +49106,8 @@ __18:
// EVIDENCE-OF: R-13523-04394 The second integer on a freelist trunk page
// is the number of leaf page pointers to follow.
- k = Xsqlite3Get4byte(tls, ((*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 4 /* pTrunk */)))).FaData + 4))
- if !((k == U32(0)) && !(searchList != 0)) {
+ k = Xsqlite3Get4byte(tls, (*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 4)))).FaData+4)
+ if !(k == U32(0) && !(searchList != 0)) {
goto __19
}
// The trunk has no leaves and the list is not being searched.
@@ -48424,22 +49122,22 @@ __18:
__21:
;
*(*Pgno)(unsafe.Pointer(pPgno)) = iTrunk
- libc.Xmemcpy(tls, ((*MemPage)(unsafe.Pointer(pPage1)).FaData + 32), ((*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 4 /* pTrunk */)))).FaData), uint32(4))
+ libc.Xmemcpy(tls, (*MemPage)(unsafe.Pointer(pPage1)).FaData+32, (*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 4)))).FaData, uint32(4))
*(*uintptr)(unsafe.Pointer(ppPage)) = *(*uintptr)(unsafe.Pointer(bp + 4 /* pTrunk */))
*(*uintptr)(unsafe.Pointer(bp + 4 /* pTrunk */)) = uintptr(0)
goto __20
__19:
- if !(k > (((*BtShared)(unsafe.Pointer(pBt)).FusableSize / U32(4)) - U32(2))) {
+ if !(k > (*BtShared)(unsafe.Pointer(pBt)).FusableSize/U32(4)-U32(2)) {
goto __22
}
// Value of k is out of range. Database corruption
- rc = Xsqlite3CorruptError(tls, 71520)
+ rc = Xsqlite3CorruptError(tls, 71736)
goto end_allocate_page
goto __23
__22:
- if !((searchList != 0) &&
- ((nearby == iTrunk) || ((iTrunk < nearby) && (int32(eMode) == BTALLOC_LE)))) {
+ if !(searchList != 0 &&
+ (nearby == iTrunk || iTrunk < nearby && int32(eMode) == BTALLOC_LE)) {
goto __24
}
// The list is being searched and this trunk page is the page
@@ -48457,10 +49155,10 @@ __26:
if !(k == U32(0)) {
goto __27
}
- if !(!(pPrevTrunk != 0)) {
+ if !!(pPrevTrunk != 0) {
goto __29
}
- libc.Xmemcpy(tls, ((*MemPage)(unsafe.Pointer(pPage1)).FaData + 32), ((*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 4 /* pTrunk */)))).FaData), uint32(4))
+ libc.Xmemcpy(tls, (*MemPage)(unsafe.Pointer(pPage1)).FaData+32, (*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 4)))).FaData, uint32(4))
goto __30
__29:
rc = Xsqlite3PagerWrite(tls, (*MemPage)(unsafe.Pointer(pPrevTrunk)).FpDbPage)
@@ -48470,16 +49168,16 @@ __29:
goto end_allocate_page
__31:
;
- libc.Xmemcpy(tls, ((*MemPage)(unsafe.Pointer(pPrevTrunk)).FaData), ((*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 4 /* pTrunk */)))).FaData), uint32(4))
+ libc.Xmemcpy(tls, (*MemPage)(unsafe.Pointer(pPrevTrunk)).FaData, (*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 4)))).FaData, uint32(4))
__30:
;
goto __28
__27:
- iNewTrunk = Xsqlite3Get4byte(tls, ((*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 4 /* pTrunk */)))).FaData + 8))
+ iNewTrunk = Xsqlite3Get4byte(tls, (*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 4)))).FaData+8)
if !(iNewTrunk > mxPage) {
goto __32
}
- rc = Xsqlite3CorruptError(tls, 71554)
+ rc = Xsqlite3CorruptError(tls, 71770)
goto end_allocate_page
__32:
;
@@ -48499,15 +49197,15 @@ __33:
goto end_allocate_page
__34:
;
- libc.Xmemcpy(tls, ((*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8 /* pNewTrunk */)))).FaData), ((*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 4 /* pTrunk */)))).FaData), uint32(4))
- Xsqlite3Put4byte(tls, ((*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8 /* pNewTrunk */)))).FaData + 4), (k - U32(1)))
- libc.Xmemcpy(tls, ((*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8 /* pNewTrunk */)))).FaData + 8), ((*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 4 /* pTrunk */)))).FaData + 12), ((k - U32(1)) * U32(4)))
+ libc.Xmemcpy(tls, (*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)))).FaData, (*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 4)))).FaData, uint32(4))
+ Xsqlite3Put4byte(tls, (*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)))).FaData+4, k-U32(1))
+ libc.Xmemcpy(tls, (*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)))).FaData+8, (*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 4)))).FaData+12, (k-U32(1))*U32(4))
releasePage(tls, *(*uintptr)(unsafe.Pointer(bp + 8 /* pNewTrunk */)))
- if !(!(pPrevTrunk != 0)) {
+ if !!(pPrevTrunk != 0) {
goto __35
}
- Xsqlite3Put4byte(tls, ((*MemPage)(unsafe.Pointer(pPage1)).FaData + 32), iNewTrunk)
+ Xsqlite3Put4byte(tls, (*MemPage)(unsafe.Pointer(pPage1)).FaData+32, iNewTrunk)
goto __36
__35:
rc = Xsqlite3PagerWrite(tls, (*MemPage)(unsafe.Pointer(pPrevTrunk)).FpDbPage)
@@ -48517,7 +49215,7 @@ __35:
goto end_allocate_page
__37:
;
- Xsqlite3Put4byte(tls, ((*MemPage)(unsafe.Pointer(pPrevTrunk)).FaData), iNewTrunk)
+ Xsqlite3Put4byte(tls, (*MemPage)(unsafe.Pointer(pPrevTrunk)).FaData, iNewTrunk)
__36:
;
__28:
@@ -48542,7 +49240,7 @@ __43:
if !(i < k) {
goto __45
}
- iPage = Xsqlite3Get4byte(tls, (aData + uintptr((U32(8) + (i * U32(4))))))
+ iPage = Xsqlite3Get4byte(tls, aData+uintptr(U32(8)+i*U32(4)))
if !(iPage <= nearby) {
goto __46
}
@@ -48559,13 +49257,13 @@ __45:
;
goto __42
__41:
- dist = Xsqlite3AbsInt32(tls, (int32(Xsqlite3Get4byte(tls, (aData+8)) - nearby)))
+ dist = Xsqlite3AbsInt32(tls, int32(Xsqlite3Get4byte(tls, aData+8)-nearby))
i = U32(1)
__47:
if !(i < k) {
goto __49
}
- d2 = Xsqlite3AbsInt32(tls, (int32(Xsqlite3Get4byte(tls, (aData+uintptr((U32(8)+(i*U32(4)))))) - nearby)))
+ d2 = Xsqlite3AbsInt32(tls, int32(Xsqlite3Get4byte(tls, aData+uintptr(U32(8)+i*U32(4)))-nearby))
if !(d2 < dist) {
goto __50
}
@@ -48588,18 +49286,18 @@ __39:
__40:
;
- iPage = Xsqlite3Get4byte(tls, (aData + uintptr((U32(8) + (closest * U32(4))))))
+ iPage = Xsqlite3Get4byte(tls, aData+uintptr(U32(8)+closest*U32(4)))
- if !((iPage > mxPage) || (iPage < Pgno(2))) {
+ if !(iPage > mxPage || iPage < Pgno(2)) {
goto __51
}
- rc = Xsqlite3CorruptError(tls, 71619)
+ rc = Xsqlite3CorruptError(tls, 71835)
goto end_allocate_page
__51:
;
if !(!(searchList != 0) ||
- ((iPage == nearby) || ((iPage < nearby) && (int32(eMode) == BTALLOC_LE)))) {
+ (iPage == nearby || iPage < nearby && int32(eMode) == BTALLOC_LE)) {
goto __52
}
*(*Pgno)(unsafe.Pointer(pPgno)) = iPage
@@ -48611,13 +49309,13 @@ __51:
goto end_allocate_page
__53:
;
- if !(closest < (k - U32(1))) {
+ if !(closest < k-U32(1)) {
goto __54
}
- libc.Xmemcpy(tls, (aData + uintptr((U32(8) + (closest * U32(4))))), (aData + uintptr((U32(4) + (k * U32(4))))), uint32(4))
+ libc.Xmemcpy(tls, aData+uintptr(U32(8)+closest*U32(4)), aData+uintptr(U32(4)+k*U32(4)), uint32(4))
__54:
;
- Xsqlite3Put4byte(tls, (aData + 4), (k - U32(1)))
+ Xsqlite3Put4byte(tls, aData+4, k-U32(1))
if !(btreeGetHasContent(tls, pBt, *(*Pgno)(unsafe.Pointer(pPgno))) != 0) {
noContent = PAGER_GET_NOCONTENT
} else {
@@ -48677,7 +49375,7 @@ __2:
// file on disk. So the effects of disabling the no-content optimization
// here are confined to those pages that lie between the end of the
// database image and the end of the database file.
- if 0 == (int32((*BtShared)(unsafe.Pointer(pBt)).FbDoTruncate)) {
+ if 0 == int32((*BtShared)(unsafe.Pointer(pBt)).FbDoTruncate) {
bNoContent = PAGER_GET_NOCONTENT
} else {
bNoContent = 0
@@ -48691,14 +49389,14 @@ __2:
__57:
;
(*BtShared)(unsafe.Pointer(pBt)).FnPage++
- if !((*BtShared)(unsafe.Pointer(pBt)).FnPage == ((U32(Xsqlite3PendingByte) / ((*BtShared)(unsafe.Pointer(pBt)).FpageSize)) + U32(1))) {
+ if !((*BtShared)(unsafe.Pointer(pBt)).FnPage == U32(Xsqlite3PendingByte)/(*BtShared)(unsafe.Pointer(pBt)).FpageSize+U32(1)) {
goto __58
}
(*BtShared)(unsafe.Pointer(pBt)).FnPage++
__58:
;
- if !(((*BtShared)(unsafe.Pointer(pBt)).FautoVacuum != 0) && (ptrmapPageno(tls, pBt, (*BtShared)(unsafe.Pointer(pBt)).FnPage) == ((*BtShared)(unsafe.Pointer(pBt)).FnPage))) {
+ if !((*BtShared)(unsafe.Pointer(pBt)).FautoVacuum != 0 && ptrmapPageno(tls, pBt, (*BtShared)(unsafe.Pointer(pBt)).FnPage) == (*BtShared)(unsafe.Pointer(pBt)).FnPage) {
goto __59
}
// If *pPgno refers to a pointer-map page, allocate two new pages
@@ -48721,7 +49419,7 @@ __60:
__61:
;
(*BtShared)(unsafe.Pointer(pBt)).FnPage++
- if !((*BtShared)(unsafe.Pointer(pBt)).FnPage == ((U32(Xsqlite3PendingByte) / ((*BtShared)(unsafe.Pointer(pBt)).FpageSize)) + U32(1))) {
+ if !((*BtShared)(unsafe.Pointer(pBt)).FnPage == U32(Xsqlite3PendingByte)/(*BtShared)(unsafe.Pointer(pBt)).FpageSize+U32(1)) {
goto __62
}
(*BtShared)(unsafe.Pointer(pBt)).FnPage++
@@ -48729,7 +49427,7 @@ __62:
;
__59:
;
- Xsqlite3Put4byte(tls, (uintptr(28) + (*MemPage)(unsafe.Pointer((*BtShared)(unsafe.Pointer(pBt)).FpPage1)).FaData), (*BtShared)(unsafe.Pointer(pBt)).FnPage)
+ Xsqlite3Put4byte(tls, uintptr(28)+(*MemPage)(unsafe.Pointer((*BtShared)(unsafe.Pointer(pBt)).FpPage1)).FaData, (*BtShared)(unsafe.Pointer(pBt)).FnPage)
*(*Pgno)(unsafe.Pointer(pPgno)) = (*BtShared)(unsafe.Pointer(pBt)).FnPage
rc = btreeGetUnusedPage(tls, pBt, *(*Pgno)(unsafe.Pointer(pPgno)), ppPage, bNoContent)
@@ -48768,7 +49466,7 @@ end_allocate_page:
//
// If a pointer to a MemPage object is passed as the second argument,
// its reference count is not altered by this function.
-func freePage2(tls *libc.TLS, pBt uintptr, pMemPage uintptr, iPage Pgno) int32 { /* sqlite3.c:71733:12: */
+func freePage2(tls *libc.TLS, pBt uintptr, pMemPage uintptr, iPage Pgno) int32 { /* sqlite3.c:71949:12: */
bp := tls.Alloc(12)
defer tls.Free(12)
@@ -48786,10 +49484,10 @@ func freePage2(tls *libc.TLS, pBt uintptr, pMemPage uintptr, iPage Pgno) int32 {
iTrunk = Pgno(0)
pPage1 = (*BtShared)(unsafe.Pointer(pBt)).FpPage1 // Initial number of pages on free-list
- if !((iPage < Pgno(2)) || (iPage > (*BtShared)(unsafe.Pointer(pBt)).FnPage)) {
+ if !(iPage < Pgno(2) || iPage > (*BtShared)(unsafe.Pointer(pBt)).FnPage) {
goto __1
}
- return Xsqlite3CorruptError(tls, 71746)
+ return Xsqlite3CorruptError(tls, 71962)
__1:
;
if !(pMemPage != 0) {
@@ -48805,22 +49503,22 @@ __3:
// Increment the free page count on pPage1
*(*int32)(unsafe.Pointer(bp + 4 /* rc */)) = Xsqlite3PagerWrite(tls, (*MemPage)(unsafe.Pointer(pPage1)).FpDbPage)
- if !(*(*int32)(unsafe.Pointer(bp + 4 /* rc */)) != 0) {
+ if !(*(*int32)(unsafe.Pointer(bp + 4)) != 0) {
goto __4
}
goto freepage_out
__4:
;
- nFree = Xsqlite3Get4byte(tls, ((*MemPage)(unsafe.Pointer(pPage1)).FaData + 36))
- Xsqlite3Put4byte(tls, ((*MemPage)(unsafe.Pointer(pPage1)).FaData + 36), (nFree + U32(1)))
+ nFree = Xsqlite3Get4byte(tls, (*MemPage)(unsafe.Pointer(pPage1)).FaData+36)
+ Xsqlite3Put4byte(tls, (*MemPage)(unsafe.Pointer(pPage1)).FaData+36, nFree+U32(1))
- if !((int32((*BtShared)(unsafe.Pointer(pBt)).FbtsFlags) & BTS_SECURE_DELETE) != 0) {
+ if !(int32((*BtShared)(unsafe.Pointer(pBt)).FbtsFlags)&BTS_SECURE_DELETE != 0) {
goto __5
}
// If the secure_delete option is enabled, then
// always fully overwrite deleted information with zeros.
- if !((!(*(*uintptr)(unsafe.Pointer(bp /* pPage */)) != 0) && ((libc.AssignPtrInt32(bp+4 /* rc */, btreeGetPage(tls, pBt, iPage, bp /* &pPage */, 0))) != 0)) ||
- ((libc.AssignPtrInt32(bp+4 /* rc */, Xsqlite3PagerWrite(tls, (*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* pPage */)))).FpDbPage))) != 0)) {
+ if !(!(*(*uintptr)(unsafe.Pointer(bp)) != 0) && libc.AssignPtrInt32(bp+4, btreeGetPage(tls, pBt, iPage, bp, 0)) != 0 ||
+ libc.AssignPtrInt32(bp+4, Xsqlite3PagerWrite(tls, (*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FpDbPage)) != 0) {
goto __6
}
goto freepage_out
@@ -48836,7 +49534,7 @@ __5:
goto __7
}
ptrmapPut(tls, pBt, iPage, uint8(PTRMAP_FREEPAGE), uint32(0), bp+4 /* &rc */)
- if !(*(*int32)(unsafe.Pointer(bp + 4 /* rc */)) != 0) {
+ if !(*(*int32)(unsafe.Pointer(bp + 4)) != 0) {
goto __8
}
goto freepage_out
@@ -48855,32 +49553,32 @@ __7:
goto __9
} // Initial number of leaf cells on trunk page
- iTrunk = Xsqlite3Get4byte(tls, ((*MemPage)(unsafe.Pointer(pPage1)).FaData + 32))
+ iTrunk = Xsqlite3Get4byte(tls, (*MemPage)(unsafe.Pointer(pPage1)).FaData+32)
if !(iTrunk > btreePagecount(tls, pBt)) {
goto __10
}
- *(*int32)(unsafe.Pointer(bp + 4 /* rc */)) = Xsqlite3CorruptError(tls, 71793)
+ *(*int32)(unsafe.Pointer(bp + 4 /* rc */)) = Xsqlite3CorruptError(tls, 72009)
goto freepage_out
__10:
;
*(*int32)(unsafe.Pointer(bp + 4 /* rc */)) = btreeGetPage(tls, pBt, iTrunk, bp+8 /* &pTrunk */, 0)
- if !(*(*int32)(unsafe.Pointer(bp + 4 /* rc */)) != SQLITE_OK) {
+ if !(*(*int32)(unsafe.Pointer(bp + 4)) != SQLITE_OK) {
goto __11
}
goto freepage_out
__11:
;
- nLeaf = Xsqlite3Get4byte(tls, ((*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8 /* pTrunk */)))).FaData + 4))
+ nLeaf = Xsqlite3Get4byte(tls, (*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)))).FaData+4)
- if !(nLeaf > (((*BtShared)(unsafe.Pointer(pBt)).FusableSize / U32(4)) - U32(2))) {
+ if !(nLeaf > (*BtShared)(unsafe.Pointer(pBt)).FusableSize/U32(4)-U32(2)) {
goto __12
}
- *(*int32)(unsafe.Pointer(bp + 4 /* rc */)) = Xsqlite3CorruptError(tls, 71804)
+ *(*int32)(unsafe.Pointer(bp + 4 /* rc */)) = Xsqlite3CorruptError(tls, 72020)
goto freepage_out
__12:
;
- if !(nLeaf < (((*BtShared)(unsafe.Pointer(pBt)).FusableSize / U32(4)) - U32(8))) {
+ if !(nLeaf < (*BtShared)(unsafe.Pointer(pBt)).FusableSize/U32(4)-U32(8)) {
goto __13
}
// In this case there is room on the trunk page to insert the page
@@ -48902,12 +49600,12 @@ __12:
// order that database files created by newer versions of SQLite can be
// read by older versions of SQLite.
*(*int32)(unsafe.Pointer(bp + 4 /* rc */)) = Xsqlite3PagerWrite(tls, (*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8 /* pTrunk */)))).FpDbPage)
- if !(*(*int32)(unsafe.Pointer(bp + 4 /* rc */)) == SQLITE_OK) {
+ if !(*(*int32)(unsafe.Pointer(bp + 4)) == SQLITE_OK) {
goto __14
}
- Xsqlite3Put4byte(tls, ((*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8 /* pTrunk */)))).FaData + 4), (nLeaf + U32(1)))
- Xsqlite3Put4byte(tls, ((*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8 /* pTrunk */)))).FaData + uintptr((U32(8) + (nLeaf * U32(4))))), iPage)
- if !((*(*uintptr)(unsafe.Pointer(bp /* pPage */)) != 0) && ((int32((*BtShared)(unsafe.Pointer(pBt)).FbtsFlags) & BTS_SECURE_DELETE) == 0)) {
+ Xsqlite3Put4byte(tls, (*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)))).FaData+4, nLeaf+U32(1))
+ Xsqlite3Put4byte(tls, (*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)))).FaData+uintptr(U32(8)+nLeaf*U32(4)), iPage)
+ if !(*(*uintptr)(unsafe.Pointer(bp)) != 0 && int32((*BtShared)(unsafe.Pointer(pBt)).FbtsFlags)&BTS_SECURE_DELETE == 0) {
goto __15
}
Xsqlite3PagerDontWrite(tls, (*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* pPage */)))).FpDbPage)
@@ -48928,25 +49626,25 @@ __9:
// Possibly because the free-list is empty, or possibly because the
// first trunk in the free-list is full. Either way, the page being freed
// will become the new first trunk page in the free-list.
- if !((*(*uintptr)(unsafe.Pointer(bp /* pPage */)) == uintptr(0)) && (SQLITE_OK != (libc.AssignPtrInt32(bp+4 /* rc */, btreeGetPage(tls, pBt, iPage, bp /* &pPage */, 0))))) {
+ if !(*(*uintptr)(unsafe.Pointer(bp)) == uintptr(0) && SQLITE_OK != libc.AssignPtrInt32(bp+4, btreeGetPage(tls, pBt, iPage, bp, 0))) {
goto __16
}
goto freepage_out
__16:
;
*(*int32)(unsafe.Pointer(bp + 4 /* rc */)) = Xsqlite3PagerWrite(tls, (*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* pPage */)))).FpDbPage)
- if !(*(*int32)(unsafe.Pointer(bp + 4 /* rc */)) != SQLITE_OK) {
+ if !(*(*int32)(unsafe.Pointer(bp + 4)) != SQLITE_OK) {
goto __17
}
goto freepage_out
__17:
;
Xsqlite3Put4byte(tls, (*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* pPage */)))).FaData, iTrunk)
- Xsqlite3Put4byte(tls, ((*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* pPage */)))).FaData + 4), uint32(0))
- Xsqlite3Put4byte(tls, ((*MemPage)(unsafe.Pointer(pPage1)).FaData + 32), iPage)
+ Xsqlite3Put4byte(tls, (*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FaData+4, uint32(0))
+ Xsqlite3Put4byte(tls, (*MemPage)(unsafe.Pointer(pPage1)).FaData+32, iPage)
freepage_out:
- if !(*(*uintptr)(unsafe.Pointer(bp /* pPage */)) != 0) {
+ if !(*(*uintptr)(unsafe.Pointer(bp)) != 0) {
goto __18
}
(*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* pPage */)))).FisInit = U8(0)
@@ -48957,14 +49655,14 @@ __18:
return *(*int32)(unsafe.Pointer(bp + 4 /* rc */))
}
-func freePage(tls *libc.TLS, pPage uintptr, pRC uintptr) { /* sqlite3.c:71867:13: */
- if (*(*int32)(unsafe.Pointer(pRC))) == SQLITE_OK {
+func freePage(tls *libc.TLS, pPage uintptr, pRC uintptr) { /* sqlite3.c:72083:13: */
+ if *(*int32)(unsafe.Pointer(pRC)) == SQLITE_OK {
*(*int32)(unsafe.Pointer(pRC)) = freePage2(tls, (*MemPage)(unsafe.Pointer(pPage)).FpBt, pPage, (*MemPage)(unsafe.Pointer(pPage)).Fpgno)
}
}
// Free the overflow pages associated with the given Cell.
-func clearCellOverflow(tls *libc.TLS, pPage uintptr, pCell uintptr, pInfo uintptr) int32 { /* sqlite3.c:71876:28: */
+func clearCellOverflow(tls *libc.TLS, pPage uintptr, pCell uintptr, pInfo uintptr) int32 { /* sqlite3.c:72092:28: */
bp := tls.Alloc(8)
defer tls.Free(8)
@@ -48974,24 +49672,24 @@ func clearCellOverflow(tls *libc.TLS, pPage uintptr, pCell uintptr, pInfo uintpt
var nOvfl int32
var ovflPageSize U32
- if (pCell + uintptr((*CellInfo)(unsafe.Pointer(pInfo)).FnSize)) > (*MemPage)(unsafe.Pointer(pPage)).FaDataEnd {
+ if pCell+uintptr((*CellInfo)(unsafe.Pointer(pInfo)).FnSize) > (*MemPage)(unsafe.Pointer(pPage)).FaDataEnd {
// Cell extends past end of page
- return Xsqlite3CorruptError(tls, 71893)
+ return Xsqlite3CorruptError(tls, 72109)
}
- ovflPgno = Xsqlite3Get4byte(tls, ((pCell + uintptr((*CellInfo)(unsafe.Pointer(pInfo)).FnSize)) - uintptr(4)))
+ ovflPgno = Xsqlite3Get4byte(tls, pCell+uintptr((*CellInfo)(unsafe.Pointer(pInfo)).FnSize)-uintptr(4))
pBt = (*MemPage)(unsafe.Pointer(pPage)).FpBt
- ovflPageSize = ((*BtShared)(unsafe.Pointer(pBt)).FusableSize - U32(4))
- nOvfl = (int32(((((*CellInfo)(unsafe.Pointer(pInfo)).FnPayload - U32((*CellInfo)(unsafe.Pointer(pInfo)).FnLocal)) + ovflPageSize) - U32(1)) / ovflPageSize))
+ ovflPageSize = (*BtShared)(unsafe.Pointer(pBt)).FusableSize - U32(4)
+ nOvfl = int32(((*CellInfo)(unsafe.Pointer(pInfo)).FnPayload - U32((*CellInfo)(unsafe.Pointer(pInfo)).FnLocal) + ovflPageSize - U32(1)) / ovflPageSize)
for libc.PostDecInt32(&nOvfl, 1) != 0 {
*(*Pgno)(unsafe.Pointer(bp + 4 /* iNext */)) = Pgno(0)
*(*uintptr)(unsafe.Pointer(bp /* pOvfl */)) = uintptr(0)
- if (ovflPgno < Pgno(2)) || (ovflPgno > btreePagecount(tls, pBt)) {
+ if ovflPgno < Pgno(2) || ovflPgno > btreePagecount(tls, pBt) {
// 0 is not a legal page number and page 1 cannot be an
// overflow page. Therefore if ovflPgno<2 or past the end of the
// file the database must be corrupt.
- return Xsqlite3CorruptError(tls, 71910)
+ return Xsqlite3CorruptError(tls, 72126)
}
if nOvfl != 0 {
rc = getOverflowPage(tls, pBt, ovflPgno, bp /* &pOvfl */, bp+4 /* &iNext */)
@@ -49000,8 +49698,8 @@ func clearCellOverflow(tls *libc.TLS, pPage uintptr, pCell uintptr, pInfo uintpt
}
}
- if ((*(*uintptr)(unsafe.Pointer(bp /* pOvfl */)) != 0) || ((libc.AssignPtrUintptr(bp /* pOvfl */, btreePageLookup(tls, pBt, ovflPgno))) != uintptr(0))) &&
- (Xsqlite3PagerPageRefcount(tls, (*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* pOvfl */)))).FpDbPage) != 1) {
+ if (*(*uintptr)(unsafe.Pointer(bp)) != 0 || libc.AssignPtrUintptr(bp, btreePageLookup(tls, pBt, ovflPgno)) != uintptr(0)) &&
+ Xsqlite3PagerPageRefcount(tls, (*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FpDbPage) != 1 {
// There is no reason any cursor should have an outstanding reference
// to an overflow page belonging to a cell that is being deleted/updated.
// So if there exists more than one reference to this page, then it
@@ -49011,12 +49709,12 @@ func clearCellOverflow(tls *libc.TLS, pPage uintptr, pCell uintptr, pInfo uintpt
// enabled. If this 'overflow' page happens to be a page that the
// caller is iterating through or using in some other way, this
// can be problematic.
- rc = Xsqlite3CorruptError(tls, 71930)
+ rc = Xsqlite3CorruptError(tls, 72146)
} else {
rc = freePage2(tls, pBt, *(*uintptr)(unsafe.Pointer(bp /* pOvfl */)), ovflPgno)
}
- if *(*uintptr)(unsafe.Pointer(bp /* pOvfl */)) != 0 {
+ if *(*uintptr)(unsafe.Pointer(bp)) != 0 {
Xsqlite3PagerUnref(tls, (*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* pOvfl */)))).FpDbPage)
}
if rc != 0 {
@@ -49043,7 +49741,7 @@ func clearCellOverflow(tls *libc.TLS, pPage uintptr, pCell uintptr, pInfo uintpt
// area. pCell might point to some temporary storage. The cell will
// be constructed in this temporary area then copied into pPage->aData
// later.
-func fillInCell(tls *libc.TLS, pPage uintptr, pCell uintptr, pX uintptr, pnSize uintptr) int32 { /* sqlite3.c:71971:12: */
+func fillInCell(tls *libc.TLS, pPage uintptr, pCell uintptr, pX uintptr, pnSize uintptr) int32 { /* sqlite3.c:72187:12: */
bp := tls.Alloc(12)
defer tls.Free(12)
@@ -49069,35 +49767,35 @@ func fillInCell(tls *libc.TLS, pPage uintptr, pCell uintptr, pX uintptr, pnSize
// Fill in the header.
nHeader = int32((*MemPage)(unsafe.Pointer(pPage)).FchildPtrSize)
if (*MemPage)(unsafe.Pointer(pPage)).FintKey != 0 {
- nPayload = ((*BtreePayload)(unsafe.Pointer(pX)).FnData + (*BtreePayload)(unsafe.Pointer(pX)).FnZero)
+ nPayload = (*BtreePayload)(unsafe.Pointer(pX)).FnData + (*BtreePayload)(unsafe.Pointer(pX)).FnZero
pSrc = (*BtreePayload)(unsafe.Pointer(pX)).FpData
nSrc = (*BtreePayload)(unsafe.Pointer(pX)).FnData
// fillInCell() only called for leaves
- nHeader = nHeader + (int32(func() uint8 {
- if (U32(nPayload)) < U32(0x80) {
- return uint8(func() int32 { *(*uint8)(unsafe.Pointer((pCell + uintptr(nHeader)))) = uint8(nPayload); return 1 }())
+ nHeader = nHeader + int32(func() uint8 {
+ if U32(nPayload) < U32(0x80) {
+ return uint8(func() int32 { *(*uint8)(unsafe.Pointer(pCell + uintptr(nHeader))) = uint8(nPayload); return 1 }())
}
- return uint8(Xsqlite3PutVarint(tls, (pCell + uintptr(nHeader)), uint64(nPayload)))
- }()))
- nHeader = nHeader + (Xsqlite3PutVarint(tls, (pCell + uintptr(nHeader)), *(*U64)(unsafe.Pointer((pX + 8 /* &.nKey */)))))
+ return uint8(Xsqlite3PutVarint(tls, pCell+uintptr(nHeader), uint64(nPayload)))
+ }())
+ nHeader = nHeader + Xsqlite3PutVarint(tls, pCell+uintptr(nHeader), *(*U64)(unsafe.Pointer(pX + 8)))
} else {
nSrc = libc.AssignInt32(&nPayload, int32((*BtreePayload)(unsafe.Pointer(pX)).FnKey))
pSrc = (*BtreePayload)(unsafe.Pointer(pX)).FpKey
- nHeader = nHeader + (int32(func() uint8 {
- if (U32(nPayload)) < U32(0x80) {
- return uint8(func() int32 { *(*uint8)(unsafe.Pointer((pCell + uintptr(nHeader)))) = uint8(nPayload); return 1 }())
+ nHeader = nHeader + int32(func() uint8 {
+ if U32(nPayload) < U32(0x80) {
+ return uint8(func() int32 { *(*uint8)(unsafe.Pointer(pCell + uintptr(nHeader))) = uint8(nPayload); return 1 }())
}
- return uint8(Xsqlite3PutVarint(tls, (pCell + uintptr(nHeader)), uint64(nPayload)))
- }()))
+ return uint8(Xsqlite3PutVarint(tls, pCell+uintptr(nHeader), uint64(nPayload)))
+ }())
}
// Fill in the payload
- pPayload = (pCell + uintptr(nHeader))
+ pPayload = pCell + uintptr(nHeader)
if nPayload <= int32((*MemPage)(unsafe.Pointer(pPage)).FmaxLocal) {
// This is the common case where everything fits on the btree page
// and no overflow pages are required.
- n = (nHeader + nPayload)
+ n = nHeader + nPayload
if n < 4 {
n = 4
@@ -49105,21 +49803,21 @@ func fillInCell(tls *libc.TLS, pPage uintptr, pCell uintptr, pX uintptr, pnSize
*(*int32)(unsafe.Pointer(pnSize)) = n
libc.Xmemcpy(tls, pPayload, pSrc, uint32(nSrc))
- libc.Xmemset(tls, (pPayload + uintptr(nSrc)), 0, (uint32(nPayload - nSrc)))
+ libc.Xmemset(tls, pPayload+uintptr(nSrc), 0, uint32(nPayload-nSrc))
return SQLITE_OK
}
// If we reach this point, it means that some of the content will need
// to spill onto overflow pages.
mn = int32((*MemPage)(unsafe.Pointer(pPage)).FminLocal)
- n = (int32(U32(mn) + ((U32(nPayload - mn)) % ((*BtShared)(unsafe.Pointer((*MemPage)(unsafe.Pointer(pPage)).FpBt)).FusableSize - U32(4)))))
+ n = int32(U32(mn) + U32(nPayload-mn)%((*BtShared)(unsafe.Pointer((*MemPage)(unsafe.Pointer(pPage)).FpBt)).FusableSize-U32(4)))
if n > int32((*MemPage)(unsafe.Pointer(pPage)).FmaxLocal) {
n = mn
}
spaceLeft = n
- *(*int32)(unsafe.Pointer(pnSize)) = ((n + nHeader) + 4)
- pPrior = (pCell + uintptr((nHeader + n)))
+ *(*int32)(unsafe.Pointer(pnSize)) = n + nHeader + 4
+ pPrior = pCell + uintptr(nHeader+n)
pToRelease = uintptr(0)
*(*Pgno)(unsafe.Pointer(bp + 4 /* pgnoOvfl */)) = Pgno(0)
pBt = (*MemPage)(unsafe.Pointer(pPage)).FpBt
@@ -49157,19 +49855,19 @@ func fillInCell(tls *libc.TLS, pPage uintptr, pCell uintptr, pX uintptr, pnSize
} else {
libc.Xmemset(tls, pPayload, 0, uint32(n))
}
- nPayload = nPayload - (n)
+ nPayload = nPayload - n
if nPayload <= 0 {
break
}
pPayload += uintptr(n)
pSrc += uintptr(n)
- nSrc = nSrc - (n)
- spaceLeft = spaceLeft - (n)
+ nSrc = nSrc - n
+ spaceLeft = spaceLeft - n
if spaceLeft == 0 {
*(*uintptr)(unsafe.Pointer(bp /* pOvfl */)) = uintptr(0)
var pgnoPtrmap Pgno = *(*Pgno)(unsafe.Pointer(bp + 4 /* pgnoOvfl */)) // Overflow page pointer-map entry page
if (*BtShared)(unsafe.Pointer(pBt)).FautoVacuum != 0 {
- for ok := true; ok; ok = ((ptrmapPageno(tls, pBt, *(*Pgno)(unsafe.Pointer(bp + 4 /* pgnoOvfl */))) == (*(*Pgno)(unsafe.Pointer(bp + 4 /* pgnoOvfl */)))) || (*(*Pgno)(unsafe.Pointer(bp + 4 /* pgnoOvfl */)) == ((U32(Xsqlite3PendingByte) / ((*BtShared)(unsafe.Pointer(pBt)).FpageSize)) + U32(1)))) {
+ for ok := true; ok; ok = ptrmapPageno(tls, pBt, *(*Pgno)(unsafe.Pointer(bp + 4))) == *(*Pgno)(unsafe.Pointer(bp + 4)) || *(*Pgno)(unsafe.Pointer(bp + 4)) == U32(Xsqlite3PendingByte)/(*BtShared)(unsafe.Pointer(pBt)).FpageSize+U32(1) {
*(*Pgno)(unsafe.Pointer(bp + 4 /* pgnoOvfl */))++
}
}
@@ -49183,7 +49881,7 @@ func fillInCell(tls *libc.TLS, pPage uintptr, pCell uintptr, pX uintptr, pnSize
// then the optimistic overflow chain processing in clearCell()
// may misinterpret the uninitialized values and delete the
// wrong pages from the database.
- if ((*BtShared)(unsafe.Pointer(pBt)).FautoVacuum != 0) && (*(*int32)(unsafe.Pointer(bp + 8 /* rc */)) == SQLITE_OK) {
+ if (*BtShared)(unsafe.Pointer(pBt)).FautoVacuum != 0 && *(*int32)(unsafe.Pointer(bp + 8)) == SQLITE_OK {
var eType U8 = func() uint8 {
if pgnoPtrmap != 0 {
return uint8(PTRMAP_OVERFLOW2)
@@ -49191,11 +49889,11 @@ func fillInCell(tls *libc.TLS, pPage uintptr, pCell uintptr, pX uintptr, pnSize
return uint8(PTRMAP_OVERFLOW1)
}()
ptrmapPut(tls, pBt, *(*Pgno)(unsafe.Pointer(bp + 4 /* pgnoOvfl */)), eType, pgnoPtrmap, bp+8 /* &rc */)
- if *(*int32)(unsafe.Pointer(bp + 8 /* rc */)) != 0 {
+ if *(*int32)(unsafe.Pointer(bp + 8)) != 0 {
releasePage(tls, *(*uintptr)(unsafe.Pointer(bp /* pOvfl */)))
}
}
- if *(*int32)(unsafe.Pointer(bp + 8 /* rc */)) != 0 {
+ if *(*int32)(unsafe.Pointer(bp + 8)) != 0 {
releasePage(tls, pToRelease)
return *(*int32)(unsafe.Pointer(bp + 8 /* rc */))
}
@@ -49211,8 +49909,8 @@ func fillInCell(tls *libc.TLS, pPage uintptr, pCell uintptr, pX uintptr, pnSize
pToRelease = *(*uintptr)(unsafe.Pointer(bp /* pOvfl */))
pPrior = (*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* pOvfl */)))).FaData
Xsqlite3Put4byte(tls, pPrior, uint32(0))
- pPayload = ((*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* pOvfl */)))).FaData + 4)
- spaceLeft = (int32((*BtShared)(unsafe.Pointer(pBt)).FusableSize - U32(4)))
+ pPayload = (*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FaData + 4
+ spaceLeft = int32((*BtShared)(unsafe.Pointer(pBt)).FusableSize - U32(4))
}
}
releasePage(tls, pToRelease)
@@ -49225,7 +49923,7 @@ func fillInCell(tls *libc.TLS, pPage uintptr, pCell uintptr, pX uintptr, pnSize
// removes the reference to the cell from pPage.
//
// "sz" must be the number of bytes in the cell.
-func dropCell(tls *libc.TLS, pPage uintptr, idx int32, sz int32, pRC uintptr) { /* sqlite3.c:72161:13: */
+func dropCell(tls *libc.TLS, pPage uintptr, idx int32, sz int32, pRC uintptr) { /* sqlite3.c:72377:13: */
var pc U32 // Offset to cell content of cell being deleted
var data uintptr // pPage->aData
var ptr uintptr // Used to move bytes around within data[]
@@ -49237,12 +49935,12 @@ func dropCell(tls *libc.TLS, pPage uintptr, idx int32, sz int32, pRC uintptr) {
}
data = (*MemPage)(unsafe.Pointer(pPage)).FaData
- ptr = ((*MemPage)(unsafe.Pointer(pPage)).FaCellIdx + uintptr((2 * idx)))
- pc = (U32((int32(*(*U8)(unsafe.Pointer((ptr)))) << 8) | int32(*(*U8)(unsafe.Pointer((ptr) + 1)))))
+ ptr = (*MemPage)(unsafe.Pointer(pPage)).FaCellIdx + uintptr(2*idx)
+ pc = U32(int32(*(*U8)(unsafe.Pointer(ptr)))<<8 | int32(*(*U8)(unsafe.Pointer(ptr + 1))))
hdr = int32((*MemPage)(unsafe.Pointer(pPage)).FhdrOffset)
- if (pc + U32(sz)) > (*BtShared)(unsafe.Pointer((*MemPage)(unsafe.Pointer(pPage)).FpBt)).FusableSize {
- *(*int32)(unsafe.Pointer(pRC)) = Xsqlite3CorruptError(tls, 72181)
+ if pc+U32(sz) > (*BtShared)(unsafe.Pointer((*MemPage)(unsafe.Pointer(pPage)).FpBt)).FusableSize {
+ *(*int32)(unsafe.Pointer(pRC)) = Xsqlite3CorruptError(tls, 72397)
return
}
rc = freeSpace(tls, pPage, uint16(pc), uint16(sz))
@@ -49252,17 +49950,17 @@ func dropCell(tls *libc.TLS, pPage uintptr, idx int32, sz int32, pRC uintptr) {
}
(*MemPage)(unsafe.Pointer(pPage)).FnCell--
if int32((*MemPage)(unsafe.Pointer(pPage)).FnCell) == 0 {
- libc.Xmemset(tls, (data + uintptr((hdr + 1))), 0, uint32(4))
- *(*U8)(unsafe.Pointer(data + uintptr((hdr + 7)))) = U8(0)
- *(*U8)(unsafe.Pointer((data + uintptr((hdr + 5))))) = (U8(((*BtShared)(unsafe.Pointer((*MemPage)(unsafe.Pointer(pPage)).FpBt)).FusableSize) >> 8))
- *(*U8)(unsafe.Pointer((data + uintptr((hdr + 5))) + 1)) = U8((*BtShared)(unsafe.Pointer((*MemPage)(unsafe.Pointer(pPage)).FpBt)).FusableSize)
- (*MemPage)(unsafe.Pointer(pPage)).FnFree = (int32((((*BtShared)(unsafe.Pointer((*MemPage)(unsafe.Pointer(pPage)).FpBt)).FusableSize - U32((*MemPage)(unsafe.Pointer(pPage)).FhdrOffset)) -
- U32((*MemPage)(unsafe.Pointer(pPage)).FchildPtrSize)) - U32(8)))
+ libc.Xmemset(tls, data+uintptr(hdr+1), 0, uint32(4))
+ *(*U8)(unsafe.Pointer(data + uintptr(hdr+7))) = U8(0)
+ *(*U8)(unsafe.Pointer(data + uintptr(hdr+5))) = U8((*BtShared)(unsafe.Pointer((*MemPage)(unsafe.Pointer(pPage)).FpBt)).FusableSize >> 8)
+ *(*U8)(unsafe.Pointer(data + uintptr(hdr+5) + 1)) = U8((*BtShared)(unsafe.Pointer((*MemPage)(unsafe.Pointer(pPage)).FpBt)).FusableSize)
+ (*MemPage)(unsafe.Pointer(pPage)).FnFree = int32((*BtShared)(unsafe.Pointer((*MemPage)(unsafe.Pointer(pPage)).FpBt)).FusableSize - U32((*MemPage)(unsafe.Pointer(pPage)).FhdrOffset) -
+ U32((*MemPage)(unsafe.Pointer(pPage)).FchildPtrSize) - U32(8))
} else {
- libc.Xmemmove(tls, ptr, (ptr + uintptr(2)), (uint32(2 * (int32((*MemPage)(unsafe.Pointer(pPage)).FnCell) - idx))))
- *(*U8)(unsafe.Pointer((data + uintptr((hdr + 3))))) = (U8((int32((*MemPage)(unsafe.Pointer(pPage)).FnCell)) >> 8))
- *(*U8)(unsafe.Pointer((data + uintptr((hdr + 3))) + 1)) = U8((*MemPage)(unsafe.Pointer(pPage)).FnCell)
- *(*int32)(unsafe.Pointer(pPage + 20 /* &.nFree */)) += (2)
+ libc.Xmemmove(tls, ptr, ptr+uintptr(2), uint32(2*(int32((*MemPage)(unsafe.Pointer(pPage)).FnCell)-idx)))
+ *(*U8)(unsafe.Pointer(data + uintptr(hdr+3))) = U8(int32((*MemPage)(unsafe.Pointer(pPage)).FnCell) >> 8)
+ *(*U8)(unsafe.Pointer(data + uintptr(hdr+3) + 1)) = U8((*MemPage)(unsafe.Pointer(pPage)).FnCell)
+ *(*int32)(unsafe.Pointer(pPage + 20)) += 2
}
}
@@ -49278,7 +49976,7 @@ func dropCell(tls *libc.TLS, pPage uintptr, idx int32, sz int32, pRC uintptr) {
// pPage->nOverflow is incremented.
//
// *pRC must be SQLITE_OK when this routine is called.
-func insertCell(tls *libc.TLS, pPage uintptr, i int32, pCell uintptr, sz int32, pTemp uintptr, iChild Pgno, pRC uintptr) { /* sqlite3.c:72217:13: */
+func insertCell(tls *libc.TLS, pPage uintptr, i int32, pCell uintptr, sz int32, pTemp uintptr, iChild Pgno, pRC uintptr) { /* sqlite3.c:72433:13: */
bp := tls.Alloc(4)
defer tls.Free(4)
@@ -49287,7 +49985,7 @@ func insertCell(tls *libc.TLS, pPage uintptr, i int32, pCell uintptr, sz int32,
var data uintptr // The content of the whole page
var pIns uintptr // The point in pPage->aCellIdx[] where no cell inserted
- if ((*MemPage)(unsafe.Pointer(pPage)).FnOverflow != 0) || ((sz + 2) > (*MemPage)(unsafe.Pointer(pPage)).FnFree) {
+ if (*MemPage)(unsafe.Pointer(pPage)).FnOverflow != 0 || sz+2 > (*MemPage)(unsafe.Pointer(pPage)).FnFree {
if pTemp != 0 {
libc.Xmemcpy(tls, pTemp, pCell, uint32(sz))
pCell = pTemp
@@ -49300,8 +49998,8 @@ func insertCell(tls *libc.TLS, pPage uintptr, i int32, pCell uintptr, sz int32,
// as a contingency. In other words, never need more than 3 overflow
// slots but 4 are allocated, just to be safe.
- *(*uintptr)(unsafe.Pointer((pPage + 36 /* &.apOvfl */) + uintptr(j)*4)) = pCell
- *(*U16)(unsafe.Pointer((pPage + 28 /* &.aiOvfl */) + uintptr(j)*2)) = U16(i)
+ *(*uintptr)(unsafe.Pointer(pPage + 36 + uintptr(j)*4)) = pCell
+ *(*U16)(unsafe.Pointer(pPage + 28 + uintptr(j)*2)) = U16(i)
// When multiple overflows occur, they are always sequential and in
// sorted order. This invariants arise because multiple overflows can
@@ -49326,26 +50024,26 @@ func insertCell(tls *libc.TLS, pPage uintptr, i int32, pCell uintptr, sz int32,
// The allocateSpace() routine guarantees the following properties
// if it returns successfully
- *(*int32)(unsafe.Pointer(pPage + 20 /* &.nFree */)) -= (int32((U16(2 + sz))))
+ *(*int32)(unsafe.Pointer(pPage + 20)) -= int32(U16(2 + sz))
if iChild != 0 {
// In a corrupt database where an entry in the cell index section of
// a btree page has a value of 3 or less, the pCell value might point
// as many as 4 bytes in front of the start of the aData buffer for
// the source page. Make sure this does not cause problems by not
// reading the first 4 bytes
- libc.Xmemcpy(tls, (data + uintptr((*(*int32)(unsafe.Pointer(bp /* idx */)) + 4))), (pCell + uintptr(4)), (uint32(sz - 4)))
- Xsqlite3Put4byte(tls, (data + uintptr(*(*int32)(unsafe.Pointer(bp /* idx */)))), iChild)
+ libc.Xmemcpy(tls, data+uintptr(*(*int32)(unsafe.Pointer(bp))+4), pCell+uintptr(4), uint32(sz-4))
+ Xsqlite3Put4byte(tls, data+uintptr(*(*int32)(unsafe.Pointer(bp))), iChild)
} else {
- libc.Xmemcpy(tls, (data + uintptr(*(*int32)(unsafe.Pointer(bp /* idx */)))), pCell, uint32(sz))
+ libc.Xmemcpy(tls, data+uintptr(*(*int32)(unsafe.Pointer(bp))), pCell, uint32(sz))
}
- pIns = ((*MemPage)(unsafe.Pointer(pPage)).FaCellIdx + uintptr((i * 2)))
- libc.Xmemmove(tls, (pIns + uintptr(2)), pIns, (uint32(2 * (int32((*MemPage)(unsafe.Pointer(pPage)).FnCell) - i))))
- *(*U8)(unsafe.Pointer((pIns))) = (U8((*(*int32)(unsafe.Pointer(bp /* idx */))) >> 8))
- *(*U8)(unsafe.Pointer((pIns) + 1)) = U8(*(*int32)(unsafe.Pointer(bp /* idx */)))
+ pIns = (*MemPage)(unsafe.Pointer(pPage)).FaCellIdx + uintptr(i*2)
+ libc.Xmemmove(tls, pIns+uintptr(2), pIns, uint32(2*(int32((*MemPage)(unsafe.Pointer(pPage)).FnCell)-i)))
+ *(*U8)(unsafe.Pointer(pIns)) = U8(*(*int32)(unsafe.Pointer(bp)) >> 8)
+ *(*U8)(unsafe.Pointer(pIns + 1)) = U8(*(*int32)(unsafe.Pointer(bp)))
(*MemPage)(unsafe.Pointer(pPage)).FnCell++
// increment the cell count
- if (int32(libc.PreIncUint8(&*(*U8)(unsafe.Pointer(data + uintptr((int32((*MemPage)(unsafe.Pointer(pPage)).FhdrOffset) + 4)))), 1))) == 0 {
- *(*U8)(unsafe.Pointer(data + uintptr((int32((*MemPage)(unsafe.Pointer(pPage)).FhdrOffset) + 3))))++
+ if int32(libc.PreIncUint8(&*(*U8)(unsafe.Pointer(data + uintptr(int32((*MemPage)(unsafe.Pointer(pPage)).FhdrOffset)+4))), 1)) == 0 {
+ *(*U8)(unsafe.Pointer(data + uintptr(int32((*MemPage)(unsafe.Pointer(pPage)).FhdrOffset)+3)))++
}
if (*BtShared)(unsafe.Pointer((*MemPage)(unsafe.Pointer(pPage)).FpBt)).FautoVacuum != 0 {
@@ -49438,7 +50136,7 @@ type CellArray1 = struct {
FszCell uintptr
FapEnd [6]uintptr
FixNx [6]int32
-} /* sqlite3.c:72392:9 */
+} /* sqlite3.c:72608:9 */
// The following parameters determine how many adjacent pages get involved
// in a balancing operation. NN is the number of neighbors on either side
@@ -49515,11 +50213,11 @@ type CellArray1 = struct {
// cases, ixNx[] entries with higher indexes, and the corresponding apEnd[]
// entries, shift down. The end result is that each ixNx[] entry should
// be larger than the previous
-type CellArray = CellArray1 /* sqlite3.c:72392:26 */
+type CellArray = CellArray1 /* sqlite3.c:72608:26 */
// Make sure the cell sizes at idx, idx+1, ..., idx+N-1 have been
// computed.
-func populateCellCache(tls *libc.TLS, p uintptr, idx int32, N int32) { /* sqlite3.c:72406:13: */
+func populateCellCache(tls *libc.TLS, p uintptr, idx int32, N int32) { /* sqlite3.c:72622:13: */
for N > 0 {
@@ -49536,7 +50234,7 @@ func populateCellCache(tls *libc.TLS, p uintptr, idx int32, N int32) { /* sqlite
}
// Return the size of the Nth element of the cell array
-func computeCellSize(tls *libc.TLS, p uintptr, N int32) U16 { /* sqlite3.c:72424:28: */
+func computeCellSize(tls *libc.TLS, p uintptr, N int32) U16 { /* sqlite3.c:72640:28: */
*(*U16)(unsafe.Pointer((*CellArray)(unsafe.Pointer(p)).FszCell + uintptr(N)*2)) = (*struct {
f func(*libc.TLS, uintptr, uintptr) U16
@@ -49544,7 +50242,7 @@ func computeCellSize(tls *libc.TLS, p uintptr, N int32) U16 { /* sqlite3.c:72424
return *(*U16)(unsafe.Pointer((*CellArray)(unsafe.Pointer(p)).FszCell + uintptr(N)*2))
}
-func cachedCellSize(tls *libc.TLS, p uintptr, N int32) U16 { /* sqlite3.c:72430:12: */
+func cachedCellSize(tls *libc.TLS, p uintptr, N int32) U16 { /* sqlite3.c:72646:12: */
if *(*U16)(unsafe.Pointer((*CellArray)(unsafe.Pointer(p)).FszCell + uintptr(N)*2)) != 0 {
return *(*U16)(unsafe.Pointer((*CellArray)(unsafe.Pointer(p)).FszCell + uintptr(N)*2))
@@ -49563,51 +50261,51 @@ func cachedCellSize(tls *libc.TLS, p uintptr, N int32) U16 { /* sqlite3.c:72430:
//
// The MemPage.nFree field is invalidated by this function. It is the
// responsibility of the caller to set it correctly.
-func rebuildPage(tls *libc.TLS, pCArray uintptr, iFirst int32, nCell int32, pPg uintptr) int32 { /* sqlite3.c:72449:12: */
+func rebuildPage(tls *libc.TLS, pCArray uintptr, iFirst int32, nCell int32, pPg uintptr) int32 { /* sqlite3.c:72665:12: */
var hdr int32 = int32((*MemPage)(unsafe.Pointer(pPg)).FhdrOffset) // Offset of header on pPg
var aData uintptr = (*MemPage)(unsafe.Pointer(pPg)).FaData // Pointer to data for pPg
var usableSize int32 = int32((*BtShared)(unsafe.Pointer((*MemPage)(unsafe.Pointer(pPg)).FpBt)).FusableSize)
- var pEnd uintptr = (aData + uintptr(usableSize))
- var i int32 = iFirst // Which cell to copy from pCArray
- var j U32 // Start of cell content area
- var iEnd int32 = (i + nCell) // Loop terminator
+ var pEnd uintptr = aData + uintptr(usableSize)
+ var i int32 = iFirst // Which cell to copy from pCArray
+ var j U32 // Start of cell content area
+ var iEnd int32 = i + nCell // Loop terminator
var pCellptr uintptr = (*MemPage)(unsafe.Pointer(pPg)).FaCellIdx
var pTmp uintptr = Xsqlite3PagerTempSpace(tls, (*BtShared)(unsafe.Pointer((*MemPage)(unsafe.Pointer(pPg)).FpBt)).FpPager)
var pData uintptr
var k int32 // Current slot in pCArray->apEnd[]
var pSrcEnd uintptr // Current pCArray->apEnd[k] value
- j = (U32((int32(*(*U8)(unsafe.Pointer((aData + uintptr((hdr + 5)))))) << 8) | int32(*(*U8)(unsafe.Pointer((aData + uintptr((hdr + 5))) + 1)))))
+ j = U32(int32(*(*U8)(unsafe.Pointer(aData + uintptr(hdr+5))))<<8 | int32(*(*U8)(unsafe.Pointer(aData + uintptr(hdr+5) + 1))))
if j > U32(usableSize) {
j = U32(0)
}
- libc.Xmemcpy(tls, (pTmp + uintptr(j)), (aData + uintptr(j)), (U32(usableSize) - j))
+ libc.Xmemcpy(tls, pTmp+uintptr(j), aData+uintptr(j), U32(usableSize)-j)
- for k = 0; (*(*int32)(unsafe.Pointer((pCArray + 40 /* &.ixNx */) + uintptr(k)*4)) <= i) && (k < (NB * 2)); k++ {
+ for k = 0; *(*int32)(unsafe.Pointer(pCArray + 40 /* &.ixNx */ + uintptr(k)*4)) <= i && k < NB*2; k++ {
}
- pSrcEnd = *(*uintptr)(unsafe.Pointer((pCArray + 16 /* &.apEnd */) + uintptr(k)*4))
+ pSrcEnd = *(*uintptr)(unsafe.Pointer(pCArray + 16 + uintptr(k)*4))
pData = pEnd
for 1 != 0 {
var pCell uintptr = *(*uintptr)(unsafe.Pointer((*CellArray)(unsafe.Pointer(pCArray)).FapCell + uintptr(i)*4))
var sz U16 = *(*U16)(unsafe.Pointer((*CellArray)(unsafe.Pointer(pCArray)).FszCell + uintptr(i)*2))
- if (Uptr((pCell)) >= Uptr((aData + uintptr(j)))) && (Uptr((pCell)) < Uptr((pEnd))) {
- if (Uptr((pCell + uintptr(sz)))) > Uptr(pEnd) {
- return Xsqlite3CorruptError(tls, 72482)
+ if Uptr(pCell) >= Uptr(aData+uintptr(j)) && Uptr(pCell) < Uptr(pEnd) {
+ if Uptr(pCell+uintptr(sz)) > Uptr(pEnd) {
+ return Xsqlite3CorruptError(tls, 72698)
}
- pCell = (pTmp + uintptr(((int32(pCell) - int32(aData)) / 1)))
- } else if (Uptr((pCell + uintptr(sz))) > Uptr(pSrcEnd)) &&
- (Uptr((pCell)) < Uptr(pSrcEnd)) {
- return Xsqlite3CorruptError(tls, 72487)
+ pCell = pTmp + uintptr((int32(pCell)-int32(aData))/1)
+ } else if Uptr(pCell+uintptr(sz)) > Uptr(pSrcEnd) &&
+ Uptr(pCell) < Uptr(pSrcEnd) {
+ return Xsqlite3CorruptError(tls, 72703)
}
pData -= uintptr(sz)
- *(*U8)(unsafe.Pointer((pCellptr))) = (U8(((int32(pData) - int32(aData)) / 1) >> 8))
- *(*U8)(unsafe.Pointer((pCellptr) + 1)) = (U8((int32(pData) - int32(aData)) / 1))
+ *(*U8)(unsafe.Pointer(pCellptr)) = U8((int32(pData) - int32(aData)) / 1 >> 8)
+ *(*U8)(unsafe.Pointer(pCellptr + 1)) = U8((int32(pData) - int32(aData)) / 1)
pCellptr += uintptr(2)
if pData < pCellptr {
- return Xsqlite3CorruptError(tls, 72493)
+ return Xsqlite3CorruptError(tls, 72709)
}
libc.Xmemmove(tls, pData, pCell, uint32(sz))
@@ -49615,9 +50313,9 @@ func rebuildPage(tls *libc.TLS, pCArray uintptr, iFirst int32, nCell int32, pPg
if i >= iEnd {
break
}
- if *(*int32)(unsafe.Pointer((pCArray + 40 /* &.ixNx */) + uintptr(k)*4)) <= i {
+ if *(*int32)(unsafe.Pointer(pCArray + 40 + uintptr(k)*4)) <= i {
k++
- pSrcEnd = *(*uintptr)(unsafe.Pointer((pCArray + 16 /* &.apEnd */) + uintptr(k)*4))
+ pSrcEnd = *(*uintptr)(unsafe.Pointer(pCArray + 16 + uintptr(k)*4))
}
}
@@ -49625,13 +50323,13 @@ func rebuildPage(tls *libc.TLS, pCArray uintptr, iFirst int32, nCell int32, pPg
(*MemPage)(unsafe.Pointer(pPg)).FnCell = U16(nCell)
(*MemPage)(unsafe.Pointer(pPg)).FnOverflow = U8(0)
- *(*U8)(unsafe.Pointer((aData + uintptr((hdr + 1))))) = (U8(int32((0)) >> 8))
- *(*U8)(unsafe.Pointer((aData + uintptr((hdr + 1))) + 1)) = U8(0)
- *(*U8)(unsafe.Pointer((aData + uintptr((hdr + 3))))) = (U8((int32((*MemPage)(unsafe.Pointer(pPg)).FnCell)) >> 8))
- *(*U8)(unsafe.Pointer((aData + uintptr((hdr + 3))) + 1)) = U8((*MemPage)(unsafe.Pointer(pPg)).FnCell)
- *(*U8)(unsafe.Pointer((aData + uintptr((hdr + 5))))) = (U8(((int32(pData) - int32(aData)) / 1) >> 8))
- *(*U8)(unsafe.Pointer((aData + uintptr((hdr + 5))) + 1)) = (U8((int32(pData) - int32(aData)) / 1))
- *(*U8)(unsafe.Pointer(aData + uintptr((hdr + 7)))) = U8(0x00)
+ *(*U8)(unsafe.Pointer(aData + uintptr(hdr+1))) = U8(int32(0) >> 8)
+ *(*U8)(unsafe.Pointer(aData + uintptr(hdr+1) + 1)) = U8(0)
+ *(*U8)(unsafe.Pointer(aData + uintptr(hdr+3))) = U8(int32((*MemPage)(unsafe.Pointer(pPg)).FnCell) >> 8)
+ *(*U8)(unsafe.Pointer(aData + uintptr(hdr+3) + 1)) = U8((*MemPage)(unsafe.Pointer(pPg)).FnCell)
+ *(*U8)(unsafe.Pointer(aData + uintptr(hdr+5))) = U8((int32(pData) - int32(aData)) / 1 >> 8)
+ *(*U8)(unsafe.Pointer(aData + uintptr(hdr+5) + 1)) = U8((int32(pData) - int32(aData)) / 1)
+ *(*U8)(unsafe.Pointer(aData + uintptr(hdr+7))) = U8(0x00)
return SQLITE_OK
}
@@ -49657,23 +50355,23 @@ func rebuildPage(tls *libc.TLS, pCArray uintptr, iFirst int32, nCell int32, pPg
// all cells - not just those inserted by the current call). If the content
// area must be extended to before this point in order to accomodate all
// cells in apCell[], then the cells do not fit and non-zero is returned.
-func pageInsertArray(tls *libc.TLS, pPg uintptr, pBegin uintptr, ppData uintptr, pCellptr uintptr, iFirst int32, nCell int32, pCArray uintptr) int32 { /* sqlite3.c:72539:12: */
+func pageInsertArray(tls *libc.TLS, pPg uintptr, pBegin uintptr, ppData uintptr, pCellptr uintptr, iFirst int32, nCell int32, pCArray uintptr) int32 { /* sqlite3.c:72755:12: */
bp := tls.Alloc(4)
defer tls.Free(4)
var i int32 = iFirst // Loop counter - cell index to insert
var aData uintptr = (*MemPage)(unsafe.Pointer(pPg)).FaData // Complete page
var pData uintptr = *(*uintptr)(unsafe.Pointer(ppData)) // Content area. A subset of aData[]
- var iEnd int32 = (iFirst + nCell) // End of loop. One past last cell to ins
+ var iEnd int32 = iFirst + nCell // End of loop. One past last cell to ins
var k int32 // Current slot in pCArray->apEnd[]
var pEnd uintptr // Maximum extent of cell data
// Never called on page 1
if iEnd <= iFirst {
return 0
}
- for k = 0; (*(*int32)(unsafe.Pointer((pCArray + 40 /* &.ixNx */) + uintptr(k)*4)) <= i) && (k < (NB * 2)); k++ {
+ for k = 0; *(*int32)(unsafe.Pointer(pCArray + 40 /* &.ixNx */ + uintptr(k)*4)) <= i && k < NB*2; k++ {
}
- pEnd = *(*uintptr)(unsafe.Pointer((pCArray + 16 /* &.apEnd */) + uintptr(k)*4))
+ pEnd = *(*uintptr)(unsafe.Pointer(pCArray + 16 + uintptr(k)*4))
for 1 != 0 {
var sz int32
// var rc int32 at bp, 4
@@ -49681,8 +50379,8 @@ func pageInsertArray(tls *libc.TLS, pPg uintptr, pBegin uintptr, ppData uintptr,
var pSlot uintptr
sz = int32(*(*U16)(unsafe.Pointer((*CellArray)(unsafe.Pointer(pCArray)).FszCell + uintptr(i)*2)))
- if ((int32(*(*U8)(unsafe.Pointer(aData + 1))) == 0) && (int32(*(*U8)(unsafe.Pointer(aData + 2))) == 0)) || ((libc.AssignUintptr(&pSlot, pageFindSlot(tls, pPg, sz, bp /* &rc */))) == uintptr(0)) {
- if ((int32(pData) - int32(pBegin)) / 1) < sz {
+ if int32(*(*U8)(unsafe.Pointer(aData + 1))) == 0 && int32(*(*U8)(unsafe.Pointer(aData + 2))) == 0 || libc.AssignUintptr(&pSlot, pageFindSlot(tls, pPg, sz, bp)) == uintptr(0) {
+ if (int32(pData)-int32(pBegin))/1 < sz {
return 1
}
pData -= uintptr(sz)
@@ -49692,23 +50390,23 @@ 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 (Uptr((*(*uintptr)(unsafe.Pointer((*CellArray)(unsafe.Pointer(pCArray)).FapCell + uintptr(i)*4)) + uintptr(sz))) > Uptr(pEnd)) &&
- (Uptr((*(*uintptr)(unsafe.Pointer((*CellArray)(unsafe.Pointer(pCArray)).FapCell + uintptr(i)*4)))) < Uptr(pEnd)) {
+ if Uptr(*(*uintptr)(unsafe.Pointer((*CellArray)(unsafe.Pointer(pCArray)).FapCell + uintptr(i)*4))+uintptr(sz)) > Uptr(pEnd) &&
+ Uptr(*(*uintptr)(unsafe.Pointer((*CellArray)(unsafe.Pointer(pCArray)).FapCell + uintptr(i)*4))) < Uptr(pEnd) {
- Xsqlite3CorruptError(tls, 72578)
+ Xsqlite3CorruptError(tls, 72794)
return 1
}
libc.Xmemmove(tls, pSlot, *(*uintptr)(unsafe.Pointer((*CellArray)(unsafe.Pointer(pCArray)).FapCell + uintptr(i)*4)), uint32(sz))
- *(*U8)(unsafe.Pointer((pCellptr))) = (U8(((int32(pSlot) - int32(aData)) / 1) >> 8))
- *(*U8)(unsafe.Pointer((pCellptr) + 1)) = (U8((int32(pSlot) - int32(aData)) / 1))
+ *(*U8)(unsafe.Pointer(pCellptr)) = U8((int32(pSlot) - int32(aData)) / 1 >> 8)
+ *(*U8)(unsafe.Pointer(pCellptr + 1)) = U8((int32(pSlot) - int32(aData)) / 1)
pCellptr += uintptr(2)
i++
if i >= iEnd {
break
}
- if *(*int32)(unsafe.Pointer((pCArray + 40 /* &.ixNx */) + uintptr(k)*4)) <= i {
+ if *(*int32)(unsafe.Pointer(pCArray + 40 + uintptr(k)*4)) <= i {
k++
- pEnd = *(*uintptr)(unsafe.Pointer((pCArray + 16 /* &.apEnd */) + uintptr(k)*4))
+ pEnd = *(*uintptr)(unsafe.Pointer(pCArray + 16 + uintptr(k)*4))
}
}
*(*uintptr)(unsafe.Pointer(ppData)) = pData
@@ -49722,44 +50420,44 @@ func pageInsertArray(tls *libc.TLS, pPg uintptr, pBegin uintptr, ppData uintptr,
// The cell-pointers and other fields of the page are not updated.
//
// This function returns the total number of cells added to the free-list.
-func pageFreeArray(tls *libc.TLS, pPg uintptr, iFirst int32, nCell int32, pCArray uintptr) int32 { /* sqlite3.c:72604:12: */
+func pageFreeArray(tls *libc.TLS, pPg uintptr, iFirst int32, nCell int32, pCArray uintptr) int32 { /* sqlite3.c:72820:12: */
var aData uintptr = (*MemPage)(unsafe.Pointer(pPg)).FaData
- var pEnd uintptr = (aData + uintptr((*BtShared)(unsafe.Pointer((*MemPage)(unsafe.Pointer(pPg)).FpBt)).FusableSize))
- var pStart uintptr = (aData + uintptr(((int32((*MemPage)(unsafe.Pointer(pPg)).FhdrOffset) + 8) + int32((*MemPage)(unsafe.Pointer(pPg)).FchildPtrSize))))
+ var pEnd uintptr = aData + uintptr((*BtShared)(unsafe.Pointer((*MemPage)(unsafe.Pointer(pPg)).FpBt)).FusableSize)
+ var pStart uintptr = aData + uintptr(int32((*MemPage)(unsafe.Pointer(pPg)).FhdrOffset)+8+int32((*MemPage)(unsafe.Pointer(pPg)).FchildPtrSize))
var nRet int32 = 0
var i int32
- var iEnd int32 = (iFirst + nCell)
+ var iEnd int32 = iFirst + nCell
var pFree uintptr = uintptr(0)
var szFree int32 = 0
for i = iFirst; i < iEnd; i++ {
var pCell uintptr = *(*uintptr)(unsafe.Pointer((*CellArray)(unsafe.Pointer(pCArray)).FapCell + uintptr(i)*4))
- if (Uptr((pCell)) >= Uptr((pStart))) && (Uptr((pCell)) < Uptr((pEnd))) {
+ if Uptr(pCell) >= Uptr(pStart) && Uptr(pCell) < Uptr(pEnd) {
var sz int32
// No need to use cachedCellSize() here. The sizes of all cells that
// are to be freed have already been computing while deciding which
// cells need freeing
sz = int32(*(*U16)(unsafe.Pointer((*CellArray)(unsafe.Pointer(pCArray)).FszCell + uintptr(i)*2)))
- if pFree != (pCell + uintptr(sz)) {
+ if pFree != pCell+uintptr(sz) {
if pFree != 0 {
- freeSpace(tls, pPg, (U16((int32(pFree) - int32(aData)) / 1)), uint16(szFree))
+ freeSpace(tls, pPg, U16((int32(pFree)-int32(aData))/1), uint16(szFree))
}
pFree = pCell
szFree = sz
- if (pFree + uintptr(sz)) > pEnd {
+ if pFree+uintptr(sz) > pEnd {
return 0
}
} else {
pFree = pCell
- szFree = szFree + (sz)
+ szFree = szFree + sz
}
nRet++
}
}
if pFree != 0 {
- freeSpace(tls, pPg, (U16((int32(pFree) - int32(aData)) / 1)), uint16(szFree))
+ freeSpace(tls, pPg, U16((int32(pFree)-int32(aData))/1), uint16(szFree))
}
return nRet
}
@@ -49774,7 +50472,7 @@ func pageFreeArray(tls *libc.TLS, pPg uintptr, iFirst int32, nCell int32, pCArra
//
// The pPg->nFree field is invalid when this function returns. It is the
// responsibility of the caller to set it correctly.
-func editPage(tls *libc.TLS, pPg uintptr, iOld int32, iNew int32, nNew int32, pCArray uintptr) int32 { /* sqlite3.c:72663:12: */
+func editPage(tls *libc.TLS, pPg uintptr, iOld int32, iNew int32, nNew int32, pCArray uintptr) int32 { /* sqlite3.c:72879:12: */
bp := tls.Alloc(4)
defer tls.Free(4)
@@ -49794,125 +50492,131 @@ func editPage(tls *libc.TLS, pPg uintptr, iOld int32, iNew int32, nNew int32, pC
var iCell int32
aData = (*MemPage)(unsafe.Pointer(pPg)).FaData
hdr = int32((*MemPage)(unsafe.Pointer(pPg)).FhdrOffset)
- pBegin = ((*MemPage)(unsafe.Pointer(pPg)).FaCellIdx + uintptr((nNew * 2)))
+ pBegin = (*MemPage)(unsafe.Pointer(pPg)).FaCellIdx + uintptr(nNew*2)
nCell = int32((*MemPage)(unsafe.Pointer(pPg)).FnCell)
- iOldEnd = ((iOld + int32((*MemPage)(unsafe.Pointer(pPg)).FnCell)) + int32((*MemPage)(unsafe.Pointer(pPg)).FnOverflow))
- iNewEnd = (iNew + nNew)
+ iOldEnd = iOld + int32((*MemPage)(unsafe.Pointer(pPg)).FnCell) + int32((*MemPage)(unsafe.Pointer(pPg)).FnOverflow)
+ iNewEnd = iNew + nNew
// Remove cells from the start and end of the page
if !(iOld < iNew) {
goto __1
}
- nShift = pageFreeArray(tls, pPg, iOld, (iNew - iOld), pCArray)
+ nShift = pageFreeArray(tls, pPg, iOld, iNew-iOld, pCArray)
if !(nShift > nCell) {
goto __2
}
- return Xsqlite3CorruptError(tls, 72689)
+ return Xsqlite3CorruptError(tls, 72905)
__2:
;
- libc.Xmemmove(tls, (*MemPage)(unsafe.Pointer(pPg)).FaCellIdx, ((*MemPage)(unsafe.Pointer(pPg)).FaCellIdx + uintptr((nShift * 2))), (uint32(nCell * 2)))
- nCell = nCell - (nShift)
+ libc.Xmemmove(tls, (*MemPage)(unsafe.Pointer(pPg)).FaCellIdx, (*MemPage)(unsafe.Pointer(pPg)).FaCellIdx+uintptr(nShift*2), uint32(nCell*2))
+ nCell = nCell - nShift
__1:
;
if !(iNewEnd < iOldEnd) {
goto __3
}
- nTail = pageFreeArray(tls, pPg, iNewEnd, (iOldEnd - iNewEnd), pCArray)
+ nTail = pageFreeArray(tls, pPg, iNewEnd, iOldEnd-iNewEnd, pCArray)
- nCell = nCell - (nTail)
+ nCell = nCell - nTail
__3:
;
- *(*uintptr)(unsafe.Pointer(bp /* pData */)) = (aData + uintptr((((((int32(*(*U8)(unsafe.Pointer((aData + uintptr((hdr + 5)))))) << 8) | int32(*(*U8)(unsafe.Pointer((aData + uintptr((hdr + 5))) + 1)))) - 1) & 0xffff) + 1)))
- if !(*(*uintptr)(unsafe.Pointer(bp /* pData */)) < pBegin) {
+ *(*uintptr)(unsafe.Pointer(bp /* pData */)) = aData + uintptr((int32(*(*U8)(unsafe.Pointer(aData + uintptr(hdr+5))))<<8|int32(*(*U8)(unsafe.Pointer(aData + uintptr(hdr+5) + 1)))-1)&0xffff+1)
+ if !(*(*uintptr)(unsafe.Pointer(bp)) < pBegin) {
goto __4
}
goto editpage_fail
__4:
;
+ if !(*(*uintptr)(unsafe.Pointer(bp)) > (*MemPage)(unsafe.Pointer(pPg)).FaDataEnd) {
+ goto __5
+ }
+ goto editpage_fail
+__5:
+ ;
// Add cells to the start of the page
if !(iNew < iOld) {
- goto __5
+ goto __6
}
nAdd = func() int32 {
- if (nNew) < (iOld - iNew) {
+ if nNew < iOld-iNew {
return nNew
}
- return (iOld - iNew)
+ return iOld - iNew
}()
pCellptr = (*MemPage)(unsafe.Pointer(pPg)).FaCellIdx
- libc.Xmemmove(tls, (pCellptr + uintptr((nAdd * 2))), pCellptr, (uint32(nCell * 2)))
+ libc.Xmemmove(tls, pCellptr+uintptr(nAdd*2), pCellptr, uint32(nCell*2))
if !(pageInsertArray(tls,
- pPg, pBegin, bp /* &pData */, pCellptr,
+ pPg, pBegin, bp, pCellptr,
iNew, nAdd, pCArray) != 0) {
- goto __6
+ goto __7
}
goto editpage_fail
-__6:
+__7:
;
- nCell = nCell + (nAdd)
-__5:
+ nCell = nCell + nAdd
+__6:
;
// Add any overflow cells
i = 0
-__7:
+__8:
if !(i < int32((*MemPage)(unsafe.Pointer(pPg)).FnOverflow)) {
- goto __9
- }
- iCell = ((iOld + int32(*(*U16)(unsafe.Pointer((pPg + 28 /* &.aiOvfl */) + uintptr(i)*2)))) - iNew)
- if !((iCell >= 0) && (iCell < nNew)) {
goto __10
}
- pCellptr = ((*MemPage)(unsafe.Pointer(pPg)).FaCellIdx + uintptr((iCell * 2)))
- if !(nCell > iCell) {
+ iCell = iOld + int32(*(*U16)(unsafe.Pointer(pPg + 28 + uintptr(i)*2))) - iNew
+ if !(iCell >= 0 && iCell < nNew) {
goto __11
}
- libc.Xmemmove(tls, (pCellptr + 2), pCellptr, (uint32((nCell - iCell) * 2)))
-__11:
+ pCellptr = (*MemPage)(unsafe.Pointer(pPg)).FaCellIdx + uintptr(iCell*2)
+ if !(nCell > iCell) {
+ goto __12
+ }
+ libc.Xmemmove(tls, pCellptr+2, pCellptr, uint32((nCell-iCell)*2))
+__12:
;
nCell++
- cachedCellSize(tls, pCArray, (iCell + iNew))
+ cachedCellSize(tls, pCArray, iCell+iNew)
if !(pageInsertArray(tls,
- pPg, pBegin, bp /* &pData */, pCellptr,
- (iCell+iNew), 1, pCArray) != 0) {
- goto __12
+ pPg, pBegin, bp, pCellptr,
+ iCell+iNew, 1, pCArray) != 0) {
+ goto __13
}
goto editpage_fail
-__12:
+__13:
;
-__10:
+__11:
;
- goto __8
-__8:
- i++
- goto __7
goto __9
__9:
+ i++
+ goto __8
+ goto __10
+__10:
;
// Append cells to the end of the page
- pCellptr = ((*MemPage)(unsafe.Pointer(pPg)).FaCellIdx + uintptr((nCell * 2)))
+ pCellptr = (*MemPage)(unsafe.Pointer(pPg)).FaCellIdx + uintptr(nCell*2)
if !(pageInsertArray(tls,
- pPg, pBegin, bp /* &pData */, pCellptr,
- (iNew+nCell), (nNew-nCell), pCArray) != 0) {
- goto __13
+ pPg, pBegin, bp, pCellptr,
+ iNew+nCell, nNew-nCell, pCArray) != 0) {
+ goto __14
}
goto editpage_fail
-__13:
+__14:
;
(*MemPage)(unsafe.Pointer(pPg)).FnCell = U16(nNew)
(*MemPage)(unsafe.Pointer(pPg)).FnOverflow = U8(0)
- *(*U8)(unsafe.Pointer((aData + uintptr((hdr + 3))))) = (U8((int32((*MemPage)(unsafe.Pointer(pPg)).FnCell)) >> 8))
- *(*U8)(unsafe.Pointer((aData + uintptr((hdr + 3))) + 1)) = U8((*MemPage)(unsafe.Pointer(pPg)).FnCell)
- *(*U8)(unsafe.Pointer((aData + uintptr((hdr + 5))))) = (U8(((int32(*(*uintptr)(unsafe.Pointer(bp /* pData */))) - int32(aData)) / 1) >> 8))
- *(*U8)(unsafe.Pointer((aData + uintptr((hdr + 5))) + 1)) = (U8((int32(*(*uintptr)(unsafe.Pointer(bp /* pData */))) - int32(aData)) / 1))
+ *(*U8)(unsafe.Pointer(aData + uintptr(hdr+3))) = U8(int32((*MemPage)(unsafe.Pointer(pPg)).FnCell) >> 8)
+ *(*U8)(unsafe.Pointer(aData + uintptr(hdr+3) + 1)) = U8((*MemPage)(unsafe.Pointer(pPg)).FnCell)
+ *(*U8)(unsafe.Pointer(aData + uintptr(hdr+5))) = U8((int32(*(*uintptr)(unsafe.Pointer(bp))) - int32(aData)) / 1 >> 8)
+ *(*U8)(unsafe.Pointer(aData + uintptr(hdr+5) + 1)) = U8((int32(*(*uintptr)(unsafe.Pointer(bp))) - int32(aData)) / 1)
return SQLITE_OK
editpage_fail:
@@ -49942,7 +50646,7 @@ editpage_fail:
// byte page number followed by a variable length integer. In other
// words, at most 13 bytes. Hence the pSpace buffer must be at
// least 13 bytes in size.
-func balance_quick(tls *libc.TLS, pParent uintptr, pPage uintptr, pSpace uintptr) int32 { /* sqlite3.c:72791:12: */
+func balance_quick(tls *libc.TLS, pParent uintptr, pPage uintptr, pSpace uintptr) int32 { /* sqlite3.c:73008:12: */
bp := tls.Alloc(84)
defer tls.Free(84)
@@ -49955,7 +50659,7 @@ func balance_quick(tls *libc.TLS, pParent uintptr, pPage uintptr, pSpace uintptr
// Page number of pNew
if int32((*MemPage)(unsafe.Pointer(pPage)).FnCell) == 0 {
- return Xsqlite3CorruptError(tls, 72801)
+ return Xsqlite3CorruptError(tls, 73018)
} // dbfuzz001.test
// Allocate a new page. This page will become the right-sibling of
@@ -49963,29 +50667,29 @@ func balance_quick(tls *libc.TLS, pParent uintptr, pPage uintptr, pSpace uintptr
// may be inserted. If both these operations are successful, proceed.
*(*int32)(unsafe.Pointer(bp + 80 /* rc */)) = allocateBtreePage(tls, pBt, bp /* &pNew */, bp+4 /* &pgnoNew */, uint32(0), uint8(0))
- if *(*int32)(unsafe.Pointer(bp + 80 /* rc */)) == SQLITE_OK {
+ if *(*int32)(unsafe.Pointer(bp + 80)) == SQLITE_OK {
- var pOut uintptr = (pSpace + 4)
- *(*uintptr)(unsafe.Pointer(bp + 8 /* pCell */)) = *(*uintptr)(unsafe.Pointer((pPage + 36 /* &.apOvfl */)))
+ var pOut uintptr = pSpace + 4
+ *(*uintptr)(unsafe.Pointer(bp + 8 /* pCell */)) = *(*uintptr)(unsafe.Pointer(pPage + 36))
*(*U16)(unsafe.Pointer(bp + 12 /* szCell */)) = (*struct {
f func(*libc.TLS, uintptr, uintptr) U16
})(unsafe.Pointer(&struct{ uintptr }{(*MemPage)(unsafe.Pointer(pPage)).FxCellSize})).f(tls, pPage, *(*uintptr)(unsafe.Pointer(bp + 8 /* pCell */)))
var pStop uintptr
// var b CellArray at bp+16, 64
- zeroPage(tls, *(*uintptr)(unsafe.Pointer(bp /* pNew */)), ((PTF_INTKEY | PTF_LEAFDATA) | PTF_LEAF))
+ zeroPage(tls, *(*uintptr)(unsafe.Pointer(bp /* pNew */)), PTF_INTKEY|PTF_LEAFDATA|PTF_LEAF)
(*CellArray)(unsafe.Pointer(bp + 16 /* &b */)).FnCell = 1
(*CellArray)(unsafe.Pointer(bp + 16 /* &b */)).FpRef = pPage
(*CellArray)(unsafe.Pointer(bp + 16 /* &b */)).FapCell = bp + 8 /* &pCell */
(*CellArray)(unsafe.Pointer(bp + 16 /* &b */)).FszCell = bp + 12 /* &szCell */
- *(*uintptr)(unsafe.Pointer((bp + 16 /* &b */ + 16 /* &.apEnd */))) = (*MemPage)(unsafe.Pointer(pPage)).FaDataEnd
- *(*int32)(unsafe.Pointer((bp + 16 /* &b */ + 40 /* &.ixNx */))) = 2
+ *(*uintptr)(unsafe.Pointer(bp + 16 + 16)) = (*MemPage)(unsafe.Pointer(pPage)).FaDataEnd
+ *(*int32)(unsafe.Pointer(bp + 16 + 40)) = 2
*(*int32)(unsafe.Pointer(bp + 80 /* rc */)) = rebuildPage(tls, bp+16 /* &b */, 0, 1, *(*uintptr)(unsafe.Pointer(bp /* pNew */)))
- if *(*int32)(unsafe.Pointer(bp + 80 /* rc */)) != 0 {
+ if *(*int32)(unsafe.Pointer(bp + 80)) != 0 {
releasePage(tls, *(*uintptr)(unsafe.Pointer(bp /* pNew */)))
return *(*int32)(unsafe.Pointer(bp + 80 /* rc */))
}
- (*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* pNew */)))).FnFree = (int32((((*BtShared)(unsafe.Pointer(pBt)).FusableSize - U32((*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* pNew */)))).FcellOffset)) - U32(2)) - U32(*(*U16)(unsafe.Pointer(bp + 12 /* szCell */)))))
+ (*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* pNew */)))).FnFree = int32((*BtShared)(unsafe.Pointer(pBt)).FusableSize - U32((*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FcellOffset) - U32(2) - U32(*(*U16)(unsafe.Pointer(bp + 12))))
// If this is an auto-vacuum database, update the pointer map
// with entries for the new page, and any pointer from the
@@ -49997,7 +50701,7 @@ func balance_quick(tls *libc.TLS, pParent uintptr, pPage uintptr, pSpace uintptr
// rollback, undoing any changes made to the parent page.
if (*BtShared)(unsafe.Pointer(pBt)).FautoVacuum != 0 {
ptrmapPut(tls, pBt, *(*Pgno)(unsafe.Pointer(bp + 4 /* pgnoNew */)), uint8(PTRMAP_BTREE), (*MemPage)(unsafe.Pointer(pParent)).Fpgno, bp+80 /* &rc */)
- if int32(*(*U16)(unsafe.Pointer(bp + 12 /* szCell */))) > int32((*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* pNew */)))).FminLocal) {
+ if int32(*(*U16)(unsafe.Pointer(bp + 12))) > int32((*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FminLocal) {
ptrmapPutOvflPtr(tls, *(*uintptr)(unsafe.Pointer(bp /* pNew */)), *(*uintptr)(unsafe.Pointer(bp /* pNew */)), *(*uintptr)(unsafe.Pointer(bp + 8 /* pCell */)), bp+80 /* &rc */)
}
}
@@ -50014,22 +50718,22 @@ func balance_quick(tls *libc.TLS, pParent uintptr, pPage uintptr, pSpace uintptr
// The first of the while(...) loops below skips over the record-length
// field. The second while(...) loop copies the key value from the
// cell on pPage into the pSpace buffer.
- *(*uintptr)(unsafe.Pointer(bp + 8 /* pCell */)) = ((*MemPage)(unsafe.Pointer((pPage))).FaData + uintptr((int32((*MemPage)(unsafe.Pointer((pPage))).FmaskPage) & int32(libc.X__builtin_bswap16(tls, *(*U16)(unsafe.Pointer(((*MemPage)(unsafe.Pointer((pPage))).FaCellIdx + uintptr((2 * (int32((*MemPage)(unsafe.Pointer(pPage)).FnCell) - 1)))))))))))
- pStop = (*(*uintptr)(unsafe.Pointer(bp + 8 /* pCell */)) + 9)
- for ((int32(*(*U8)(unsafe.Pointer(libc.PostIncUintptr(&*(*uintptr)(unsafe.Pointer(bp + 8 /* pCell */)), 1)))) & 0x80) != 0) && (*(*uintptr)(unsafe.Pointer(bp + 8 /* pCell */)) < pStop) {
+ *(*uintptr)(unsafe.Pointer(bp + 8 /* pCell */)) = (*MemPage)(unsafe.Pointer(pPage)).FaData + uintptr(int32((*MemPage)(unsafe.Pointer(pPage)).FmaskPage)&int32(libc.X__builtin_bswap16(tls, *(*U16)(unsafe.Pointer((*MemPage)(unsafe.Pointer(pPage)).FaCellIdx + uintptr(2*(int32((*MemPage)(unsafe.Pointer(pPage)).FnCell)-1)))))))
+ pStop = *(*uintptr)(unsafe.Pointer(bp + 8)) + 9
+ for int32(*(*U8)(unsafe.Pointer(libc.PostIncUintptr(&*(*uintptr)(unsafe.Pointer(bp + 8)), 1))))&0x80 != 0 && *(*uintptr)(unsafe.Pointer(bp + 8)) < pStop {
}
- pStop = (*(*uintptr)(unsafe.Pointer(bp + 8 /* pCell */)) + 9)
- for (((int32(libc.AssignPtrUint8(libc.PostIncUintptr(&pOut, 1), *(*U8)(unsafe.Pointer(libc.PostIncUintptr(&*(*uintptr)(unsafe.Pointer(bp + 8 /* pCell */)), 1)))))) & 0x80) != 0) && (*(*uintptr)(unsafe.Pointer(bp + 8 /* pCell */)) < pStop) {
+ pStop = *(*uintptr)(unsafe.Pointer(bp + 8)) + 9
+ for int32(libc.AssignPtrUint8(libc.PostIncUintptr(&pOut, 1), *(*U8)(unsafe.Pointer(libc.PostIncUintptr(&*(*uintptr)(unsafe.Pointer(bp + 8)), 1)))))&0x80 != 0 && *(*uintptr)(unsafe.Pointer(bp + 8)) < pStop {
}
// Insert the new divider cell into pParent.
- if *(*int32)(unsafe.Pointer(bp + 80 /* rc */)) == SQLITE_OK {
- insertCell(tls, pParent, int32((*MemPage)(unsafe.Pointer(pParent)).FnCell), pSpace, ((int32(pOut) - int32(pSpace)) / 1),
+ if *(*int32)(unsafe.Pointer(bp + 80)) == SQLITE_OK {
+ insertCell(tls, pParent, int32((*MemPage)(unsafe.Pointer(pParent)).FnCell), pSpace, (int32(pOut)-int32(pSpace))/1,
uintptr(0), (*MemPage)(unsafe.Pointer(pPage)).Fpgno, bp+80 /* &rc */)
}
// Set the right-child pointer of pParent to point to the new page.
- Xsqlite3Put4byte(tls, ((*MemPage)(unsafe.Pointer(pParent)).FaData + uintptr((int32((*MemPage)(unsafe.Pointer(pParent)).FhdrOffset) + 8))), *(*Pgno)(unsafe.Pointer(bp + 4 /* pgnoNew */)))
+ Xsqlite3Put4byte(tls, (*MemPage)(unsafe.Pointer(pParent)).FaData+uintptr(int32((*MemPage)(unsafe.Pointer(pParent)).FhdrOffset)+8), *(*Pgno)(unsafe.Pointer(bp + 4 /* pgnoNew */)))
// Release the reference to the new page.
releasePage(tls, *(*uintptr)(unsafe.Pointer(bp /* pNew */)))
@@ -50053,8 +50757,8 @@ func balance_quick(tls *libc.TLS, pParent uintptr, pPage uintptr, pSpace uintptr
// The performance of this function is not critical. It is only used by
// the balance_shallower() and balance_deeper() procedures, neither of
// which are called often under normal circumstances.
-func copyNodeContent(tls *libc.TLS, pFrom uintptr, pTo uintptr, pRC uintptr) { /* sqlite3.c:72946:13: */
- if (*(*int32)(unsafe.Pointer(pRC))) == SQLITE_OK {
+func copyNodeContent(tls *libc.TLS, pFrom uintptr, pTo uintptr, pRC uintptr) { /* sqlite3.c:73163:13: */
+ if *(*int32)(unsafe.Pointer(pRC)) == SQLITE_OK {
var pBt uintptr = (*MemPage)(unsafe.Pointer(pFrom)).FpBt
var aFrom uintptr = (*MemPage)(unsafe.Pointer(pFrom)).FaData
var aTo uintptr = (*MemPage)(unsafe.Pointer(pTo)).FaData
@@ -50069,9 +50773,9 @@ func copyNodeContent(tls *libc.TLS, pFrom uintptr, pTo uintptr, pRC uintptr) { /
var iData int32
// Copy the b-tree node content from page pFrom to page pTo.
- iData = ((int32(*(*U8)(unsafe.Pointer((aFrom + uintptr((iFromHdr + 5)))))) << 8) | int32(*(*U8)(unsafe.Pointer((aFrom + uintptr((iFromHdr + 5))) + 1))))
- libc.Xmemcpy(tls, (aTo + uintptr(iData)), (aFrom + uintptr(iData)), ((*BtShared)(unsafe.Pointer(pBt)).FusableSize - U32(iData)))
- libc.Xmemcpy(tls, (aTo + uintptr(iToHdr)), (aFrom + uintptr(iFromHdr)), (uint32(int32((*MemPage)(unsafe.Pointer(pFrom)).FcellOffset) + (2 * int32((*MemPage)(unsafe.Pointer(pFrom)).FnCell)))))
+ iData = int32(*(*U8)(unsafe.Pointer(aFrom + uintptr(iFromHdr+5))))<<8 | int32(*(*U8)(unsafe.Pointer(aFrom + uintptr(iFromHdr+5) + 1)))
+ libc.Xmemcpy(tls, aTo+uintptr(iData), aFrom+uintptr(iData), (*BtShared)(unsafe.Pointer(pBt)).FusableSize-U32(iData))
+ libc.Xmemcpy(tls, aTo+uintptr(iToHdr), aFrom+uintptr(iFromHdr), uint32(int32((*MemPage)(unsafe.Pointer(pFrom)).FcellOffset)+2*int32((*MemPage)(unsafe.Pointer(pFrom)).FnCell)))
// Reinitialize page pTo so that the contents of the MemPage structure
// match the new data. The initialization of pTo can actually fail under
@@ -50133,7 +50837,7 @@ func copyNodeContent(tls *libc.TLS, pFrom uintptr, pTo uintptr, pRC uintptr) { /
//
// If aOvflSpace is set to a null pointer, this function returns
// SQLITE_NOMEM.
-func balance_nonroot(tls *libc.TLS, pParent uintptr, iParentIdx int32, aOvflSpace uintptr, isRoot int32, bBulk int32) int32 { /* sqlite3.c:73028:12: */
+func balance_nonroot(tls *libc.TLS, pParent uintptr, iParentIdx int32, aOvflSpace uintptr, isRoot int32, bBulk int32) int32 { /* sqlite3.c:73245:12: */
bp := tls.Alloc(264)
defer tls.Free(264)
@@ -50145,7 +50849,7 @@ func balance_nonroot(tls *libc.TLS, pParent uintptr, iParentIdx int32, aOvflSpac
var j int32
var k int32 // Loop counters
var nxDiv int32 // Next divider slot in pParent->aCell[]
- // var rc int32 at bp+48, 4
+ // var rc int32 at bp+112, 4
// The return code
var leafCorrection U16 // 4 if pPage is a leaf. 0 if not
var leafData int32 // True if pPage is a leaf of a LEAFDATA tree
@@ -50154,18 +50858,18 @@ func balance_nonroot(tls *libc.TLS, pParent uintptr, iParentIdx int32, aOvflSpac
var iSpace1 int32 // First unused byte of aSpace1[]
var iOvflSpace int32 // First unused byte of aOvflSpace[]
var szScratch int32 // Size of scratch memory requested
- // var apOld [3]uintptr at bp+8, 12
+ // var apOld [3]uintptr at bp+72, 12
// pPage and up to two siblings
// var apNew [5]uintptr at bp+156, 20
// pPage and up to NB siblings after balancing
var pRight uintptr // Location in parent of right-sibling pointer
- // var apDiv [2]uintptr at bp+20, 8
+ // var apDiv [2]uintptr at bp+84, 8
// Divider cells in pParent
// var cntNew [5]int32 at bp+136, 20
// Index in b.paCell[] of cell after i-th page
- // var cntOld [5]int32 at bp+52, 20
+ // var cntOld [5]int32 at bp+116, 20
// Old index in b.apCell[]
- // var szNew [5]int32 at bp+28, 20
+ // var szNew [5]int32 at bp+92, 20
// Combined size of cells placed on i-th page
var aSpace1 uintptr // Space for copies of dividers cells
// var pgno Pgno at bp+180, 4
@@ -50178,7 +50882,7 @@ func balance_nonroot(tls *libc.TLS, pParent uintptr, iParentIdx int32, aOvflSpac
// Copy of aPgno[] used for sorting pages
// var aPgFlags [5]U16 at bp+224, 10
// flags field of new pages before shuffling
- // var b CellArray at bp+72, 64
+ // var b CellArray at bp+8, 64
var iOff int32
var sz U16
@@ -50223,13 +50927,12 @@ func balance_nonroot(tls *libc.TLS, pParent uintptr, iParentIdx int32, aOvflSpac
var key U32
nMaxCells = 0
nNew = 0
- *(*int32)(unsafe.Pointer(bp + 48 /* rc */)) = SQLITE_OK
+ *(*int32)(unsafe.Pointer(bp + 112 /* rc */)) = SQLITE_OK
iSpace1 = 0
iOvflSpace = 0 // Parsed information on cells being balanced
libc.Xmemset(tls, bp /* &abDone[0] */, 0, uint32(unsafe.Sizeof([5]U8{})))
- (*CellArray)(unsafe.Pointer(bp + 72 /* &b */)).FnCell = 0
- (*CellArray)(unsafe.Pointer(bp + 72 /* &b */)).FapCell = uintptr(0)
+ libc.Xmemset(tls, bp+8 /* &b */, 0, uint32(unsafe.Sizeof(CellArray{})))
pBt = (*MemPage)(unsafe.Pointer(pParent)).FpBt
// At this point pParent may have at most one overflow cell. And if
@@ -50237,7 +50940,7 @@ func balance_nonroot(tls *libc.TLS, pParent uintptr, iParentIdx int32, aOvflSpac
// index iParentIdx. This scenario comes about when this function
// is called (indirectly) from sqlite3BtreeDelete().
- if !(!(aOvflSpace != 0)) {
+ if !!(aOvflSpace != 0) {
goto __1
}
return SQLITE_NOMEM
@@ -50254,7 +50957,7 @@ __1:
// way, the remainder of the function does not have to deal with any
// overflow cells in the parent page, since if any existed they will
// have already been removed.
- i = (int32((*MemPage)(unsafe.Pointer(pParent)).FnOverflow) + int32((*MemPage)(unsafe.Pointer(pParent)).FnCell))
+ i = int32((*MemPage)(unsafe.Pointer(pParent)).FnOverflow) + int32((*MemPage)(unsafe.Pointer(pParent)).FnCell)
if !(i < 2) {
goto __2
}
@@ -50271,25 +50974,25 @@ __4:
if !(iParentIdx == i) {
goto __6
}
- nxDiv = ((i - 2) + bBulk)
+ nxDiv = i - 2 + bBulk
goto __7
__6:
- nxDiv = (iParentIdx - 1)
+ nxDiv = iParentIdx - 1
__7:
;
__5:
;
- i = (2 - bBulk)
+ i = 2 - bBulk
__3:
;
- nOld = (i + 1)
- if !(((i + nxDiv) - int32((*MemPage)(unsafe.Pointer(pParent)).FnOverflow)) == int32((*MemPage)(unsafe.Pointer(pParent)).FnCell)) {
+ nOld = i + 1
+ if !(i+nxDiv-int32((*MemPage)(unsafe.Pointer(pParent)).FnOverflow) == int32((*MemPage)(unsafe.Pointer(pParent)).FnCell)) {
goto __8
}
- pRight = ((*MemPage)(unsafe.Pointer(pParent)).FaData + uintptr((int32((*MemPage)(unsafe.Pointer(pParent)).FhdrOffset) + 8)))
+ pRight = (*MemPage)(unsafe.Pointer(pParent)).FaData + uintptr(int32((*MemPage)(unsafe.Pointer(pParent)).FhdrOffset)+8)
goto __9
__8:
- pRight = ((*MemPage)(unsafe.Pointer((pParent))).FaData + uintptr((int32((*MemPage)(unsafe.Pointer((pParent))).FmaskPage) & int32(libc.X__builtin_bswap16(tls, *(*U16)(unsafe.Pointer(((*MemPage)(unsafe.Pointer((pParent))).FaCellIdx + uintptr((2 * ((i + nxDiv) - int32((*MemPage)(unsafe.Pointer(pParent)).FnOverflow))))))))))))
+ pRight = (*MemPage)(unsafe.Pointer(pParent)).FaData + uintptr(int32((*MemPage)(unsafe.Pointer(pParent)).FmaskPage)&int32(libc.X__builtin_bswap16(tls, *(*U16)(unsafe.Pointer((*MemPage)(unsafe.Pointer(pParent)).FaCellIdx + uintptr(2*(i+nxDiv-int32((*MemPage)(unsafe.Pointer(pParent)).FnOverflow))))))))
__9:
;
*(*Pgno)(unsafe.Pointer(bp + 180 /* pgno */)) = Xsqlite3Get4byte(tls, pRight)
@@ -50297,55 +51000,56 @@ __10:
if !(1 != 0) {
goto __11
}
- if !(*(*int32)(unsafe.Pointer(bp + 48 /* rc */)) == SQLITE_OK) {
+ if !(*(*int32)(unsafe.Pointer(bp + 112)) == SQLITE_OK) {
goto __12
}
- *(*int32)(unsafe.Pointer(bp + 48 /* rc */)) = getAndInitPage(tls, pBt, *(*Pgno)(unsafe.Pointer(bp + 180 /* pgno */)), (bp + 8 /* &apOld */ + uintptr(i)*4), uintptr(0), 0)
+ *(*int32)(unsafe.Pointer(bp + 112 /* rc */)) = getAndInitPage(tls, pBt, *(*Pgno)(unsafe.Pointer(bp + 180 /* pgno */)), bp+72+uintptr(i)*4, uintptr(0), 0)
__12:
;
- if !(*(*int32)(unsafe.Pointer(bp + 48 /* rc */)) != 0) {
+ if !(*(*int32)(unsafe.Pointer(bp + 112)) != 0) {
goto __13
}
- libc.Xmemset(tls, bp+8 /* &apOld[0] */, 0, ((uint32(i + 1)) * uint32(unsafe.Sizeof(uintptr(0)))))
+ libc.Xmemset(tls, bp+72 /* &apOld[0] */, 0, uint32(i+1)*uint32(unsafe.Sizeof(uintptr(0))))
goto balance_cleanup
__13:
;
- if !((*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8 /* &apOld[0] */ + uintptr(i)*4)))).FnFree < 0) {
+ if !((*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 72 + uintptr(i)*4)))).FnFree < 0) {
goto __14
}
- *(*int32)(unsafe.Pointer(bp + 48 /* rc */)) = btreeComputeFreeSpace(tls, *(*uintptr)(unsafe.Pointer(bp + 8 /* &apOld[0] */ + uintptr(i)*4)))
- if !(*(*int32)(unsafe.Pointer(bp + 48 /* rc */)) != 0) {
+ *(*int32)(unsafe.Pointer(bp + 112 /* rc */)) = btreeComputeFreeSpace(tls, *(*uintptr)(unsafe.Pointer(bp + 72 /* &apOld[0] */ + uintptr(i)*4)))
+ if !(*(*int32)(unsafe.Pointer(bp + 112)) != 0) {
goto __15
}
- libc.Xmemset(tls, bp+8 /* &apOld[0] */, 0, ((uint32(i)) * uint32(unsafe.Sizeof(uintptr(0)))))
+ libc.Xmemset(tls, bp+72 /* &apOld[0] */, 0, uint32(i)*uint32(unsafe.Sizeof(uintptr(0))))
goto balance_cleanup
__15:
;
__14:
;
- if !((libc.PostDecInt32(&i, 1)) == 0) {
+ nMaxCells = nMaxCells + (int32((*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 72 + uintptr(i)*4)))).FnCell) + int32(uint32(unsafe.Sizeof([4]uintptr{}))/uint32(unsafe.Sizeof(uintptr(0)))))
+ if !(libc.PostDecInt32(&i, 1) == 0) {
goto __16
}
goto __11
__16:
;
- if !(((*MemPage)(unsafe.Pointer(pParent)).FnOverflow != 0) && ((i + nxDiv) == int32(*(*U16)(unsafe.Pointer((pParent + 28 /* &.aiOvfl */)))))) {
+ if !((*MemPage)(unsafe.Pointer(pParent)).FnOverflow != 0 && i+nxDiv == int32(*(*U16)(unsafe.Pointer(pParent + 28)))) {
goto __17
}
- *(*uintptr)(unsafe.Pointer(bp + 20 /* &apDiv[0] */ + uintptr(i)*4)) = *(*uintptr)(unsafe.Pointer((pParent + 36 /* &.apOvfl */)))
- *(*Pgno)(unsafe.Pointer(bp + 180 /* pgno */)) = Xsqlite3Get4byte(tls, *(*uintptr)(unsafe.Pointer(bp + 20 /* &apDiv[0] */ + uintptr(i)*4)))
- *(*int32)(unsafe.Pointer(bp + 28 /* &szNew[0] */ + uintptr(i)*4)) = int32((*struct {
+ *(*uintptr)(unsafe.Pointer(bp + 84 /* &apDiv[0] */ + uintptr(i)*4)) = *(*uintptr)(unsafe.Pointer(pParent + 36))
+ *(*Pgno)(unsafe.Pointer(bp + 180 /* pgno */)) = Xsqlite3Get4byte(tls, *(*uintptr)(unsafe.Pointer(bp + 84 /* &apDiv[0] */ + uintptr(i)*4)))
+ *(*int32)(unsafe.Pointer(bp + 92 /* &szNew[0] */ + uintptr(i)*4)) = int32((*struct {
f func(*libc.TLS, uintptr, uintptr) U16
- })(unsafe.Pointer(&struct{ uintptr }{(*MemPage)(unsafe.Pointer(pParent)).FxCellSize})).f(tls, pParent, *(*uintptr)(unsafe.Pointer(bp + 20 /* &apDiv[0] */ + uintptr(i)*4))))
+ })(unsafe.Pointer(&struct{ uintptr }{(*MemPage)(unsafe.Pointer(pParent)).FxCellSize})).f(tls, pParent, *(*uintptr)(unsafe.Pointer(bp + 84 /* &apDiv[0] */ + uintptr(i)*4))))
(*MemPage)(unsafe.Pointer(pParent)).FnOverflow = U8(0)
goto __18
__17:
- *(*uintptr)(unsafe.Pointer(bp + 20 /* &apDiv[0] */ + uintptr(i)*4)) = ((*MemPage)(unsafe.Pointer((pParent))).FaData + uintptr((int32((*MemPage)(unsafe.Pointer((pParent))).FmaskPage) & int32(libc.X__builtin_bswap16(tls, *(*U16)(unsafe.Pointer(((*MemPage)(unsafe.Pointer((pParent))).FaCellIdx + uintptr((2 * ((i + nxDiv) - int32((*MemPage)(unsafe.Pointer(pParent)).FnOverflow))))))))))))
- *(*Pgno)(unsafe.Pointer(bp + 180 /* pgno */)) = Xsqlite3Get4byte(tls, *(*uintptr)(unsafe.Pointer(bp + 20 /* &apDiv[0] */ + uintptr(i)*4)))
- *(*int32)(unsafe.Pointer(bp + 28 /* &szNew[0] */ + uintptr(i)*4)) = int32((*struct {
+ *(*uintptr)(unsafe.Pointer(bp + 84 /* &apDiv[0] */ + uintptr(i)*4)) = (*MemPage)(unsafe.Pointer(pParent)).FaData + uintptr(int32((*MemPage)(unsafe.Pointer(pParent)).FmaskPage)&int32(libc.X__builtin_bswap16(tls, *(*U16)(unsafe.Pointer((*MemPage)(unsafe.Pointer(pParent)).FaCellIdx + uintptr(2*(i+nxDiv-int32((*MemPage)(unsafe.Pointer(pParent)).FnOverflow))))))))
+ *(*Pgno)(unsafe.Pointer(bp + 180 /* pgno */)) = Xsqlite3Get4byte(tls, *(*uintptr)(unsafe.Pointer(bp + 84 /* &apDiv[0] */ + uintptr(i)*4)))
+ *(*int32)(unsafe.Pointer(bp + 92 /* &szNew[0] */ + uintptr(i)*4)) = int32((*struct {
f func(*libc.TLS, uintptr, uintptr) U16
- })(unsafe.Pointer(&struct{ uintptr }{(*MemPage)(unsafe.Pointer(pParent)).FxCellSize})).f(tls, pParent, *(*uintptr)(unsafe.Pointer(bp + 20 /* &apDiv[0] */ + uintptr(i)*4))))
+ })(unsafe.Pointer(&struct{ uintptr }{(*MemPage)(unsafe.Pointer(pParent)).FxCellSize})).f(tls, pParent, *(*uintptr)(unsafe.Pointer(bp + 84 /* &apDiv[0] */ + uintptr(i)*4))))
// Drop the cell from the parent page. apDiv[i] still points to
// the cell within the parent, even though it has been dropped.
@@ -50359,23 +51063,23 @@ __17:
// In this case, temporarily copy the cell into the aOvflSpace[]
// buffer. It will be copied out again as soon as the aSpace[] buffer
// is allocated.
- if !((int32((*BtShared)(unsafe.Pointer(pBt)).FbtsFlags) & BTS_FAST_SECURE) != 0) {
+ if !(int32((*BtShared)(unsafe.Pointer(pBt)).FbtsFlags)&BTS_FAST_SECURE != 0) {
goto __19
}
// If the following if() condition is not true, the db is corrupted.
// The call to dropCell() below will detect this.
- iOff = ((int32(*(*uintptr)(unsafe.Pointer(bp + 20 /* &apDiv[0] */ + uintptr(i)*4)))) - (int32((*MemPage)(unsafe.Pointer(pParent)).FaData)))
- if !((iOff + *(*int32)(unsafe.Pointer(bp + 28 /* &szNew[0] */ + uintptr(i)*4))) <= int32((*BtShared)(unsafe.Pointer(pBt)).FusableSize)) {
+ iOff = int32(*(*uintptr)(unsafe.Pointer(bp + 84 + uintptr(i)*4))) - int32((*MemPage)(unsafe.Pointer(pParent)).FaData)
+ if !(iOff+*(*int32)(unsafe.Pointer(bp + 92 + uintptr(i)*4)) <= int32((*BtShared)(unsafe.Pointer(pBt)).FusableSize)) {
goto __20
}
- libc.Xmemcpy(tls, (aOvflSpace + uintptr(iOff)), *(*uintptr)(unsafe.Pointer(bp + 20 /* &apDiv[0] */ + uintptr(i)*4)), uint32(*(*int32)(unsafe.Pointer(bp + 28 /* &szNew[0] */ + uintptr(i)*4))))
- *(*uintptr)(unsafe.Pointer(bp + 20 /* &apDiv[0] */ + uintptr(i)*4)) = (aOvflSpace + uintptr(((int32(*(*uintptr)(unsafe.Pointer(bp + 20 /* &apDiv[0] */ + uintptr(i)*4))) - int32((*MemPage)(unsafe.Pointer(pParent)).FaData)) / 1)))
+ libc.Xmemcpy(tls, aOvflSpace+uintptr(iOff), *(*uintptr)(unsafe.Pointer(bp + 84 /* &apDiv[0] */ + uintptr(i)*4)), uint32(*(*int32)(unsafe.Pointer(bp + 92 /* &szNew[0] */ + uintptr(i)*4))))
+ *(*uintptr)(unsafe.Pointer(bp + 84 /* &apDiv[0] */ + uintptr(i)*4)) = aOvflSpace + uintptr((int32(*(*uintptr)(unsafe.Pointer(bp + 84 + uintptr(i)*4)))-int32((*MemPage)(unsafe.Pointer(pParent)).FaData))/1)
__20:
;
__19:
;
- dropCell(tls, pParent, ((i + nxDiv) - int32((*MemPage)(unsafe.Pointer(pParent)).FnOverflow)), *(*int32)(unsafe.Pointer(bp + 28 /* &szNew[0] */ + uintptr(i)*4)), bp+48 /* &rc */)
+ dropCell(tls, pParent, i+nxDiv-int32((*MemPage)(unsafe.Pointer(pParent)).FnOverflow), *(*int32)(unsafe.Pointer(bp + 92 /* &szNew[0] */ + uintptr(i)*4)), bp+112 /* &rc */)
__18:
;
goto __10
@@ -50384,24 +51088,23 @@ __11:
// Make nMaxCells a multiple of 4 in order to preserve 8-byte
// alignment
- nMaxCells = (int32(U32(nOld) * ((((*BtShared)(unsafe.Pointer(pBt)).FpageSize - U32(8)) / U32(6)) + (U32((int32(uint32(unsafe.Sizeof([4]uintptr{})) / uint32(unsafe.Sizeof(uintptr(0))))))))))
- nMaxCells = ((nMaxCells + 3) & libc.CplInt32(3))
+ nMaxCells = (nMaxCells + 3) & libc.CplInt32(3)
// Allocate space for memory structures
- szScratch = (int32(((uint32(nMaxCells) * uint32(unsafe.Sizeof(uintptr(0)))) + // b.apCell
- (uint32(nMaxCells) * uint32(unsafe.Sizeof(U16(0))))) + // b.szCell
- (*BtShared)(unsafe.Pointer(pBt)).FpageSize)) // aSpace1
+ szScratch = int32(uint32(nMaxCells)*uint32(unsafe.Sizeof(uintptr(0))) +
+ uint32(nMaxCells)*uint32(unsafe.Sizeof(U16(0))) +
+ (*BtShared)(unsafe.Pointer(pBt)).FpageSize) // aSpace1
- (*CellArray)(unsafe.Pointer(bp + 72 /* &b */)).FapCell = Xsqlite3DbMallocRaw(tls, uintptr(0), uint64(szScratch))
- if !((*CellArray)(unsafe.Pointer(bp+72 /* &b */)).FapCell == uintptr(0)) {
+ (*CellArray)(unsafe.Pointer(bp + 8 /* &b */)).FapCell = Xsqlite3DbMallocRaw(tls, uintptr(0), uint64(szScratch))
+ if !((*CellArray)(unsafe.Pointer(bp+8)).FapCell == uintptr(0)) {
goto __21
}
- *(*int32)(unsafe.Pointer(bp + 48 /* rc */)) = SQLITE_NOMEM
+ *(*int32)(unsafe.Pointer(bp + 112 /* rc */)) = SQLITE_NOMEM
goto balance_cleanup
__21:
;
- (*CellArray)(unsafe.Pointer(bp + 72 /* &b */)).FszCell = ((*CellArray)(unsafe.Pointer(bp+72 /* &b */)).FapCell + uintptr(nMaxCells)*4)
- aSpace1 = ((*CellArray)(unsafe.Pointer(bp+72 /* &b */)).FszCell + uintptr(nMaxCells)*2)
+ (*CellArray)(unsafe.Pointer(bp + 8 /* &b */)).FszCell = (*CellArray)(unsafe.Pointer(bp+8)).FapCell + uintptr(nMaxCells)*4
+ aSpace1 = (*CellArray)(unsafe.Pointer(bp+8)).FszCell + uintptr(nMaxCells)*2
// Load pointers to all cells on sibling pages and the divider cells
// into the local b.apCell[] array. Make copies of the divider cells
@@ -50417,26 +51120,26 @@ __21:
//
// leafCorrection: 4 if pPage is a leaf. 0 if pPage is not a leaf.
// leafData: 1 if pPage holds key+data and pParent holds only keys.
- (*CellArray)(unsafe.Pointer(bp + 72 /* &b */)).FpRef = *(*uintptr)(unsafe.Pointer(bp + 8 /* &apOld[0] */))
- leafCorrection = (U16(int32((*MemPage)(unsafe.Pointer((*CellArray)(unsafe.Pointer(bp+72 /* &b */)).FpRef)).Fleaf) * 4))
- leafData = int32((*MemPage)(unsafe.Pointer((*CellArray)(unsafe.Pointer(bp + 72 /* &b */)).FpRef)).FintKeyLeaf)
+ (*CellArray)(unsafe.Pointer(bp + 8 /* &b */)).FpRef = *(*uintptr)(unsafe.Pointer(bp + 72 /* &apOld[0] */))
+ leafCorrection = U16(int32((*MemPage)(unsafe.Pointer((*CellArray)(unsafe.Pointer(bp+8)).FpRef)).Fleaf) * 4)
+ leafData = int32((*MemPage)(unsafe.Pointer((*CellArray)(unsafe.Pointer(bp + 8 /* &b */)).FpRef)).FintKeyLeaf)
i = 0
__22:
if !(i < nOld) {
goto __24
}
- pOld = *(*uintptr)(unsafe.Pointer(bp + 8 /* &apOld[0] */ + uintptr(i)*4))
+ pOld = *(*uintptr)(unsafe.Pointer(bp + 72 /* &apOld[0] */ + uintptr(i)*4))
limit = int32((*MemPage)(unsafe.Pointer(pOld)).FnCell)
aData = (*MemPage)(unsafe.Pointer(pOld)).FaData
maskPage = (*MemPage)(unsafe.Pointer(pOld)).FmaskPage
- piCell = (aData + uintptr((*MemPage)(unsafe.Pointer(pOld)).FcellOffset))
+ piCell = aData + uintptr((*MemPage)(unsafe.Pointer(pOld)).FcellOffset)
// Verify that all sibling pages are of the same "type" (table-leaf,
// table-interior, index-leaf, or index-interior).
- if !(int32(*(*U8)(unsafe.Pointer((*MemPage)(unsafe.Pointer(pOld)).FaData))) != int32(*(*U8)(unsafe.Pointer((*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8 /* &apOld[0] */)))).FaData)))) {
+ if !(int32(*(*U8)(unsafe.Pointer((*MemPage)(unsafe.Pointer(pOld)).FaData))) != int32(*(*U8)(unsafe.Pointer((*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 72)))).FaData)))) {
goto __25
}
- *(*int32)(unsafe.Pointer(bp + 48 /* rc */)) = Xsqlite3CorruptError(tls, 73225)
+ *(*int32)(unsafe.Pointer(bp + 112 /* rc */)) = Xsqlite3CorruptError(tls, 73441)
goto balance_cleanup
__25:
;
@@ -50457,26 +51160,26 @@ __25:
// offset section of the btree page will be overwritten and we will no
// long be able to find the cells if a pointer to each cell is not saved
// first.
- libc.Xmemset(tls, ((*CellArray)(unsafe.Pointer(bp+72 /* &b */)).FszCell + uintptr((*CellArray)(unsafe.Pointer(bp+72 /* &b */)).FnCell)*2), 0, (uint32(unsafe.Sizeof(U16(0))) * (uint32(limit + int32((*MemPage)(unsafe.Pointer(pOld)).FnOverflow)))))
+ libc.Xmemset(tls, (*CellArray)(unsafe.Pointer(bp+8)).FszCell+uintptr((*CellArray)(unsafe.Pointer(bp+8)).FnCell)*2, 0, uint32(unsafe.Sizeof(U16(0)))*uint32(limit+int32((*MemPage)(unsafe.Pointer(pOld)).FnOverflow)))
if !(int32((*MemPage)(unsafe.Pointer(pOld)).FnOverflow) > 0) {
goto __26
}
- if !(limit < int32(*(*U16)(unsafe.Pointer((pOld + 28 /* &.aiOvfl */))))) {
+ if !(limit < int32(*(*U16)(unsafe.Pointer(pOld + 28)))) {
goto __27
}
- *(*int32)(unsafe.Pointer(bp + 48 /* rc */)) = Xsqlite3CorruptError(tls, 73249)
+ *(*int32)(unsafe.Pointer(bp + 112 /* rc */)) = Xsqlite3CorruptError(tls, 73465)
goto balance_cleanup
__27:
;
- limit = int32(*(*U16)(unsafe.Pointer((pOld + 28 /* &.aiOvfl */))))
+ limit = int32(*(*U16)(unsafe.Pointer(pOld + 28)))
j = 0
__28:
if !(j < limit) {
goto __30
}
- *(*uintptr)(unsafe.Pointer((*CellArray)(unsafe.Pointer(bp+72 /* &b */)).FapCell + uintptr((*CellArray)(unsafe.Pointer(bp+72 /* &b */)).FnCell)*4)) = (aData + uintptr((int32(maskPage) & int32(libc.X__builtin_bswap16(tls, *(*U16)(unsafe.Pointer(piCell)))))))
+ *(*uintptr)(unsafe.Pointer((*CellArray)(unsafe.Pointer(bp+8 /* &b */)).FapCell + uintptr((*CellArray)(unsafe.Pointer(bp+8 /* &b */)).FnCell)*4)) = aData + uintptr(int32(maskPage)&int32(libc.X__builtin_bswap16(tls, *(*U16)(unsafe.Pointer(piCell)))))
piCell += uintptr(2)
- (*CellArray)(unsafe.Pointer(bp+72 /* &b */)).FnCell++
+ (*CellArray)(unsafe.Pointer(bp+8 /* &b */)).FnCell++
goto __29
__29:
j++
@@ -50490,8 +51193,8 @@ __31:
goto __33
}
// NOTE 1
- *(*uintptr)(unsafe.Pointer((*CellArray)(unsafe.Pointer(bp+72 /* &b */)).FapCell + uintptr((*CellArray)(unsafe.Pointer(bp+72 /* &b */)).FnCell)*4)) = *(*uintptr)(unsafe.Pointer((pOld + 36 /* &.apOvfl */) + uintptr(k)*4))
- (*CellArray)(unsafe.Pointer(bp+72 /* &b */)).FnCell++
+ *(*uintptr)(unsafe.Pointer((*CellArray)(unsafe.Pointer(bp+8 /* &b */)).FapCell + uintptr((*CellArray)(unsafe.Pointer(bp+8 /* &b */)).FnCell)*4)) = *(*uintptr)(unsafe.Pointer(pOld + 36 + uintptr(k)*4))
+ (*CellArray)(unsafe.Pointer(bp+8 /* &b */)).FnCell++
goto __32
__32:
k++
@@ -50501,58 +51204,58 @@ __33:
;
__26:
;
- piEnd = ((aData + uintptr((*MemPage)(unsafe.Pointer(pOld)).FcellOffset)) + uintptr((2 * int32((*MemPage)(unsafe.Pointer(pOld)).FnCell))))
+ piEnd = aData + uintptr((*MemPage)(unsafe.Pointer(pOld)).FcellOffset) + uintptr(2*int32((*MemPage)(unsafe.Pointer(pOld)).FnCell))
__34:
if !(piCell < piEnd) {
goto __35
}
- *(*uintptr)(unsafe.Pointer((*CellArray)(unsafe.Pointer(bp+72 /* &b */)).FapCell + uintptr((*CellArray)(unsafe.Pointer(bp+72 /* &b */)).FnCell)*4)) = (aData + uintptr((int32(maskPage) & int32(libc.X__builtin_bswap16(tls, *(*U16)(unsafe.Pointer(piCell)))))))
+ *(*uintptr)(unsafe.Pointer((*CellArray)(unsafe.Pointer(bp+8 /* &b */)).FapCell + uintptr((*CellArray)(unsafe.Pointer(bp+8 /* &b */)).FnCell)*4)) = aData + uintptr(int32(maskPage)&int32(libc.X__builtin_bswap16(tls, *(*U16)(unsafe.Pointer(piCell)))))
piCell += uintptr(2)
- (*CellArray)(unsafe.Pointer(bp+72 /* &b */)).FnCell++
+ (*CellArray)(unsafe.Pointer(bp+8 /* &b */)).FnCell++
goto __34
__35:
;
- *(*int32)(unsafe.Pointer(bp + 52 /* &cntOld[0] */ + uintptr(i)*4)) = (*CellArray)(unsafe.Pointer(bp + 72 /* &b */)).FnCell
- if !((i < (nOld - 1)) && !(leafData != 0)) {
+ *(*int32)(unsafe.Pointer(bp + 116 /* &cntOld[0] */ + uintptr(i)*4)) = (*CellArray)(unsafe.Pointer(bp + 8 /* &b */)).FnCell
+ if !(i < nOld-1 && !(leafData != 0)) {
goto __36
}
- sz = U16(*(*int32)(unsafe.Pointer(bp + 28 /* &szNew[0] */ + uintptr(i)*4)))
+ sz = U16(*(*int32)(unsafe.Pointer(bp + 92 /* &szNew[0] */ + uintptr(i)*4)))
- *(*U16)(unsafe.Pointer((*CellArray)(unsafe.Pointer(bp+72 /* &b */)).FszCell + uintptr((*CellArray)(unsafe.Pointer(bp+72 /* &b */)).FnCell)*2)) = sz
- pTemp = (aSpace1 + uintptr(iSpace1))
- iSpace1 = iSpace1 + (int32(sz))
+ *(*U16)(unsafe.Pointer((*CellArray)(unsafe.Pointer(bp+8 /* &b */)).FszCell + uintptr((*CellArray)(unsafe.Pointer(bp+8 /* &b */)).FnCell)*2)) = sz
+ pTemp = aSpace1 + uintptr(iSpace1)
+ iSpace1 = iSpace1 + int32(sz)
- libc.Xmemcpy(tls, pTemp, *(*uintptr)(unsafe.Pointer(bp + 20 /* &apDiv[0] */ + uintptr(i)*4)), uint32(sz))
- *(*uintptr)(unsafe.Pointer((*CellArray)(unsafe.Pointer(bp+72 /* &b */)).FapCell + uintptr((*CellArray)(unsafe.Pointer(bp+72 /* &b */)).FnCell)*4)) = (pTemp + uintptr(leafCorrection))
+ libc.Xmemcpy(tls, pTemp, *(*uintptr)(unsafe.Pointer(bp + 84 /* &apDiv[0] */ + uintptr(i)*4)), uint32(sz))
+ *(*uintptr)(unsafe.Pointer((*CellArray)(unsafe.Pointer(bp+8 /* &b */)).FapCell + uintptr((*CellArray)(unsafe.Pointer(bp+8 /* &b */)).FnCell)*4)) = pTemp + uintptr(leafCorrection)
- *(*U16)(unsafe.Pointer((*CellArray)(unsafe.Pointer(bp+72 /* &b */)).FszCell + uintptr((*CellArray)(unsafe.Pointer(bp+72 /* &b */)).FnCell)*2)) = (U16(int32(*(*U16)(unsafe.Pointer((*CellArray)(unsafe.Pointer(bp+72 /* &b */)).FszCell + uintptr((*CellArray)(unsafe.Pointer(bp+72 /* &b */)).FnCell)*2))) - int32(leafCorrection)))
- if !(!(int32((*MemPage)(unsafe.Pointer(pOld)).Fleaf) != 0)) {
+ *(*U16)(unsafe.Pointer((*CellArray)(unsafe.Pointer(bp+8 /* &b */)).FszCell + uintptr((*CellArray)(unsafe.Pointer(bp+8 /* &b */)).FnCell)*2)) = U16(int32(*(*U16)(unsafe.Pointer((*CellArray)(unsafe.Pointer(bp+8)).FszCell + uintptr((*CellArray)(unsafe.Pointer(bp+8)).FnCell)*2))) - int32(leafCorrection))
+ if !!(int32((*MemPage)(unsafe.Pointer(pOld)).Fleaf) != 0) {
goto __37
}
// The right pointer of the child page pOld becomes the left
// pointer of the divider cell
- libc.Xmemcpy(tls, *(*uintptr)(unsafe.Pointer((*CellArray)(unsafe.Pointer(bp+72 /* &b */)).FapCell + uintptr((*CellArray)(unsafe.Pointer(bp+72 /* &b */)).FnCell)*4)), ((*MemPage)(unsafe.Pointer(pOld)).FaData + 8), uint32(4))
+ libc.Xmemcpy(tls, *(*uintptr)(unsafe.Pointer((*CellArray)(unsafe.Pointer(bp+8 /* &b */)).FapCell + uintptr((*CellArray)(unsafe.Pointer(bp+8 /* &b */)).FnCell)*4)), (*MemPage)(unsafe.Pointer(pOld)).FaData+8, uint32(4))
goto __38
__37:
;
__39:
- if !(int32(*(*U16)(unsafe.Pointer((*CellArray)(unsafe.Pointer(bp+72 /* &b */)).FszCell + uintptr((*CellArray)(unsafe.Pointer(bp+72 /* &b */)).FnCell)*2))) < 4) {
+ if !(int32(*(*U16)(unsafe.Pointer((*CellArray)(unsafe.Pointer(bp+8)).FszCell + uintptr((*CellArray)(unsafe.Pointer(bp+8)).FnCell)*2))) < 4) {
goto __40
}
// Do not allow any cells smaller than 4 bytes. If a smaller cell
// does exist, pad it with 0x00 bytes.
*(*U8)(unsafe.Pointer(aSpace1 + uintptr(libc.PostIncInt32(&iSpace1, 1)))) = U8(0x00)
- *(*U16)(unsafe.Pointer((*CellArray)(unsafe.Pointer(bp+72 /* &b */)).FszCell + uintptr((*CellArray)(unsafe.Pointer(bp+72 /* &b */)).FnCell)*2))++
+ *(*U16)(unsafe.Pointer((*CellArray)(unsafe.Pointer(bp+8 /* &b */)).FszCell + uintptr((*CellArray)(unsafe.Pointer(bp+8 /* &b */)).FnCell)*2))++
goto __39
__40:
;
__38:
;
- (*CellArray)(unsafe.Pointer(bp+72 /* &b */)).FnCell++
+ (*CellArray)(unsafe.Pointer(bp+8 /* &b */)).FnCell++
__36:
;
goto __23
@@ -50577,39 +51280,39 @@ __24:
// the right of the i-th sibling page.
// usableSpace: Number of bytes of space available on each sibling.
//
- usableSpace = (int32(((*BtShared)(unsafe.Pointer(pBt)).FusableSize - U32(12)) + U32(leafCorrection)))
+ usableSpace = int32((*BtShared)(unsafe.Pointer(pBt)).FusableSize - U32(12) + U32(leafCorrection))
i = libc.AssignInt32(&k, 0)
__41:
if !(i < nOld) {
goto __43
}
- p = *(*uintptr)(unsafe.Pointer(bp + 8 /* &apOld[0] */ + uintptr(i)*4))
- *(*uintptr)(unsafe.Pointer((bp + 72 /* &b */ + 16 /* &.apEnd */) + uintptr(k)*4)) = (*MemPage)(unsafe.Pointer(p)).FaDataEnd
- *(*int32)(unsafe.Pointer((bp + 72 /* &b */ + 40 /* &.ixNx */) + uintptr(k)*4)) = *(*int32)(unsafe.Pointer(bp + 52 /* &cntOld[0] */ + uintptr(i)*4))
- if !((k != 0) && (*(*int32)(unsafe.Pointer((bp + 72 /* &b */ + 40 /* &.ixNx */) + uintptr(k)*4)) == *(*int32)(unsafe.Pointer((bp + 72 /* &b */ + 40 /* &.ixNx */) + uintptr((k-1))*4)))) {
+ p = *(*uintptr)(unsafe.Pointer(bp + 72 /* &apOld[0] */ + uintptr(i)*4))
+ *(*uintptr)(unsafe.Pointer(bp + 8 + 16 + uintptr(k)*4)) = (*MemPage)(unsafe.Pointer(p)).FaDataEnd
+ *(*int32)(unsafe.Pointer(bp + 8 + 40 + uintptr(k)*4)) = *(*int32)(unsafe.Pointer(bp + 116 /* &cntOld[0] */ + uintptr(i)*4))
+ if !(k != 0 && *(*int32)(unsafe.Pointer(bp + 8 + 40 + uintptr(k)*4)) == *(*int32)(unsafe.Pointer(bp + 8 + 40 + uintptr(k-1)*4))) {
goto __44
}
k-- // Omit b.ixNx[] entry for child pages with no cells
__44:
;
- if !(!(leafData != 0)) {
+ if !!(leafData != 0) {
goto __45
}
k++
- *(*uintptr)(unsafe.Pointer((bp + 72 /* &b */ + 16 /* &.apEnd */) + uintptr(k)*4)) = (*MemPage)(unsafe.Pointer(pParent)).FaDataEnd
- *(*int32)(unsafe.Pointer((bp + 72 /* &b */ + 40 /* &.ixNx */) + uintptr(k)*4)) = (*(*int32)(unsafe.Pointer(bp + 52 /* &cntOld[0] */ + uintptr(i)*4)) + 1)
+ *(*uintptr)(unsafe.Pointer(bp + 8 + 16 + uintptr(k)*4)) = (*MemPage)(unsafe.Pointer(pParent)).FaDataEnd
+ *(*int32)(unsafe.Pointer(bp + 8 + 40 + uintptr(k)*4)) = *(*int32)(unsafe.Pointer(bp + 116 + uintptr(i)*4)) + 1
__45:
;
- *(*int32)(unsafe.Pointer(bp + 28 /* &szNew[0] */ + uintptr(i)*4)) = (usableSpace - (*MemPage)(unsafe.Pointer(p)).FnFree)
+ *(*int32)(unsafe.Pointer(bp + 92 /* &szNew[0] */ + uintptr(i)*4)) = usableSpace - (*MemPage)(unsafe.Pointer(p)).FnFree
j = 0
__46:
if !(j < int32((*MemPage)(unsafe.Pointer(p)).FnOverflow)) {
goto __48
}
- *(*int32)(unsafe.Pointer(bp + 28 /* &szNew */ + uintptr(i)*4)) += (2 + int32((*struct {
+ *(*int32)(unsafe.Pointer(bp + 92 + uintptr(i)*4)) += 2 + int32((*struct {
f func(*libc.TLS, uintptr, uintptr) U16
- })(unsafe.Pointer(&struct{ uintptr }{(*MemPage)(unsafe.Pointer(p)).FxCellSize})).f(tls, p, *(*uintptr)(unsafe.Pointer((p + 36 /* &.apOvfl */) + uintptr(j)*4)))))
+ })(unsafe.Pointer(&struct{ uintptr }{(*MemPage)(unsafe.Pointer(p)).FxCellSize})).f(tls, p, *(*uintptr)(unsafe.Pointer(p + 36 + uintptr(j)*4))))
goto __47
__47:
j++
@@ -50617,7 +51320,7 @@ __47:
goto __48
__48:
;
- *(*int32)(unsafe.Pointer(bp + 136 /* &cntNew[0] */ + uintptr(i)*4)) = *(*int32)(unsafe.Pointer(bp + 52 /* &cntOld[0] */ + uintptr(i)*4))
+ *(*int32)(unsafe.Pointer(bp + 136 /* &cntNew[0] */ + uintptr(i)*4)) = *(*int32)(unsafe.Pointer(bp + 116 /* &cntOld[0] */ + uintptr(i)*4))
goto __42
__42:
i++
@@ -50633,33 +51336,33 @@ __49:
goto __51
}
__52:
- if !(*(*int32)(unsafe.Pointer(bp + 28 /* &szNew[0] */ + uintptr(i)*4)) > usableSpace) {
+ if !(*(*int32)(unsafe.Pointer(bp + 92 + uintptr(i)*4)) > usableSpace) {
goto __53
}
- if !((i + 1) >= k) {
+ if !(i+1 >= k) {
goto __54
}
- k = (i + 2)
- if !(k > (NB + 2)) {
+ k = i + 2
+ if !(k > NB+2) {
goto __55
}
- *(*int32)(unsafe.Pointer(bp + 48 /* rc */)) = Xsqlite3CorruptError(tls, 73350)
+ *(*int32)(unsafe.Pointer(bp + 112 /* rc */)) = Xsqlite3CorruptError(tls, 73566)
goto balance_cleanup
__55:
;
- *(*int32)(unsafe.Pointer(bp + 28 /* &szNew[0] */ + uintptr((k-1))*4)) = 0
- *(*int32)(unsafe.Pointer(bp + 136 /* &cntNew[0] */ + uintptr((k-1))*4)) = (*CellArray)(unsafe.Pointer(bp + 72 /* &b */)).FnCell
+ *(*int32)(unsafe.Pointer(bp + 92 /* &szNew[0] */ + uintptr(k-1)*4)) = 0
+ *(*int32)(unsafe.Pointer(bp + 136 /* &cntNew[0] */ + uintptr(k-1)*4)) = (*CellArray)(unsafe.Pointer(bp + 8 /* &b */)).FnCell
__54:
;
- sz1 = (2 + int32(cachedCellSize(tls, bp+72 /* &b */, (*(*int32)(unsafe.Pointer(bp + 136 /* &cntNew[0] */ + uintptr(i)*4))-1))))
- *(*int32)(unsafe.Pointer(bp + 28 /* &szNew */ + uintptr(i)*4)) -= (sz1)
- if !(!(leafData != 0)) {
+ sz1 = 2 + int32(cachedCellSize(tls, bp+8, *(*int32)(unsafe.Pointer(bp + 136 + uintptr(i)*4))-1))
+ *(*int32)(unsafe.Pointer(bp + 92 + uintptr(i)*4)) -= sz1
+ if !!(leafData != 0) {
goto __56
}
- if !(*(*int32)(unsafe.Pointer(bp + 136 /* &cntNew[0] */ + uintptr(i)*4)) < (*CellArray)(unsafe.Pointer(bp+72 /* &b */)).FnCell) {
+ if !(*(*int32)(unsafe.Pointer(bp + 136 + uintptr(i)*4)) < (*CellArray)(unsafe.Pointer(bp+8)).FnCell) {
goto __57
}
- sz1 = (2 + int32(cachedCellSize(tls, bp+72 /* &b */, *(*int32)(unsafe.Pointer(bp + 136 /* &cntNew[0] */ + uintptr(i)*4)))))
+ sz1 = 2 + int32(cachedCellSize(tls, bp+8, *(*int32)(unsafe.Pointer(bp + 136 + uintptr(i)*4))))
goto __58
__57:
sz1 = 0
@@ -50667,31 +51370,31 @@ __58:
;
__56:
;
- *(*int32)(unsafe.Pointer(bp + 28 /* &szNew */ + uintptr((i+1))*4)) += (sz1)
+ *(*int32)(unsafe.Pointer(bp + 92 + uintptr(i+1)*4)) += sz1
*(*int32)(unsafe.Pointer(bp + 136 /* &cntNew[0] */ + uintptr(i)*4))--
goto __52
__53:
;
__59:
- if !(*(*int32)(unsafe.Pointer(bp + 136 /* &cntNew[0] */ + uintptr(i)*4)) < (*CellArray)(unsafe.Pointer(bp+72 /* &b */)).FnCell) {
+ if !(*(*int32)(unsafe.Pointer(bp + 136 + uintptr(i)*4)) < (*CellArray)(unsafe.Pointer(bp+8)).FnCell) {
goto __60
}
- sz1 = (2 + int32(cachedCellSize(tls, bp+72 /* &b */, *(*int32)(unsafe.Pointer(bp + 136 /* &cntNew[0] */ + uintptr(i)*4)))))
- if !((*(*int32)(unsafe.Pointer(bp + 28 /* &szNew[0] */ + uintptr(i)*4)) + sz1) > usableSpace) {
+ sz1 = 2 + int32(cachedCellSize(tls, bp+8, *(*int32)(unsafe.Pointer(bp + 136 + uintptr(i)*4))))
+ if !(*(*int32)(unsafe.Pointer(bp + 92 + uintptr(i)*4))+sz1 > usableSpace) {
goto __61
}
goto __60
__61:
;
- *(*int32)(unsafe.Pointer(bp + 28 /* &szNew */ + uintptr(i)*4)) += (sz1)
+ *(*int32)(unsafe.Pointer(bp + 92 + uintptr(i)*4)) += sz1
*(*int32)(unsafe.Pointer(bp + 136 /* &cntNew[0] */ + uintptr(i)*4))++
- if !(!(leafData != 0)) {
+ if !!(leafData != 0) {
goto __62
}
- if !(*(*int32)(unsafe.Pointer(bp + 136 /* &cntNew[0] */ + uintptr(i)*4)) < (*CellArray)(unsafe.Pointer(bp+72 /* &b */)).FnCell) {
+ if !(*(*int32)(unsafe.Pointer(bp + 136 + uintptr(i)*4)) < (*CellArray)(unsafe.Pointer(bp+8)).FnCell) {
goto __63
}
- sz1 = (2 + int32(cachedCellSize(tls, bp+72 /* &b */, *(*int32)(unsafe.Pointer(bp + 136 /* &cntNew[0] */ + uintptr(i)*4)))))
+ sz1 = 2 + int32(cachedCellSize(tls, bp+8, *(*int32)(unsafe.Pointer(bp + 136 + uintptr(i)*4))))
goto __64
__63:
sz1 = 0
@@ -50699,25 +51402,25 @@ __64:
;
__62:
;
- *(*int32)(unsafe.Pointer(bp + 28 /* &szNew */ + uintptr((i+1))*4)) -= (sz1)
+ *(*int32)(unsafe.Pointer(bp + 92 + uintptr(i+1)*4)) -= sz1
goto __59
__60:
;
- if !(*(*int32)(unsafe.Pointer(bp + 136 /* &cntNew[0] */ + uintptr(i)*4)) >= (*CellArray)(unsafe.Pointer(bp+72 /* &b */)).FnCell) {
+ if !(*(*int32)(unsafe.Pointer(bp + 136 + uintptr(i)*4)) >= (*CellArray)(unsafe.Pointer(bp+8)).FnCell) {
goto __65
}
- k = (i + 1)
+ k = i + 1
goto __66
__65:
- if !(*(*int32)(unsafe.Pointer(bp + 136 /* &cntNew[0] */ + uintptr(i)*4)) <= (func() int32 {
+ if !(*(*int32)(unsafe.Pointer(bp + 136 + uintptr(i)*4)) <= func() int32 {
if i > 0 {
- return *(*int32)(unsafe.Pointer(bp + 136 /* &cntNew[0] */ + uintptr((i-1))*4))
+ return *(*int32)(unsafe.Pointer(bp + 136 + uintptr(i-1)*4))
}
return 0
- }())) {
+ }()) {
goto __67
}
- *(*int32)(unsafe.Pointer(bp + 48 /* rc */)) = Xsqlite3CorruptError(tls, 73383)
+ *(*int32)(unsafe.Pointer(bp + 112 /* rc */)) = Xsqlite3CorruptError(tls, 73599)
goto balance_cleanup
__67:
;
@@ -50740,36 +51443,36 @@ __51:
// This adjustment is more than an optimization. The packing above might
// be so out of balance as to be illegal. For example, the right-most
// sibling might be completely empty. This adjustment is not optional.
- i = (k - 1)
+ i = k - 1
__68:
if !(i > 0) {
goto __70
}
- szRight = *(*int32)(unsafe.Pointer(bp + 28 /* &szNew[0] */ + uintptr(i)*4)) // Size of sibling on the right
- szLeft = *(*int32)(unsafe.Pointer(bp + 28 /* &szNew[0] */ + uintptr((i-1))*4)) // Index of first cell to the left of right sibling
+ szRight = *(*int32)(unsafe.Pointer(bp + 92 /* &szNew[0] */ + uintptr(i)*4)) // Size of sibling on the right
+ szLeft = *(*int32)(unsafe.Pointer(bp + 92 /* &szNew[0] */ + uintptr(i-1)*4)) // Index of first cell to the left of right sibling
- r = (*(*int32)(unsafe.Pointer(bp + 136 /* &cntNew[0] */ + uintptr((i-1))*4)) - 1)
- d = ((r + 1) - leafData)
- cachedCellSize(tls, bp+72 /* &b */, d)
+ r = *(*int32)(unsafe.Pointer(bp + 136 + uintptr(i-1)*4)) - 1
+ d = r + 1 - leafData
+ cachedCellSize(tls, bp+8 /* &b */, d)
__71:
;
- cachedCellSize(tls, bp+72 /* &b */, r)
- if !((szRight != 0) &&
- ((bBulk != 0) || (((szRight + int32(*(*U16)(unsafe.Pointer((*CellArray)(unsafe.Pointer(bp+72 /* &b */)).FszCell + uintptr(d)*2)))) + 2) > (szLeft - (int32(*(*U16)(unsafe.Pointer((*CellArray)(unsafe.Pointer(bp+72 /* &b */)).FszCell + uintptr(r)*2))) + (func() int32 {
- if i == (k - 1) {
+ cachedCellSize(tls, bp+8 /* &b */, r)
+ if !(szRight != 0 &&
+ (bBulk != 0 || szRight+int32(*(*U16)(unsafe.Pointer((*CellArray)(unsafe.Pointer(bp+8)).FszCell + uintptr(d)*2)))+2 > szLeft-(int32(*(*U16)(unsafe.Pointer((*CellArray)(unsafe.Pointer(bp+8)).FszCell + uintptr(r)*2)))+func() int32 {
+ if i == k-1 {
return 0
}
return 2
- }())))))) {
+ }()))) {
goto __74
}
goto __73
__74:
;
- szRight = szRight + (int32(*(*U16)(unsafe.Pointer((*CellArray)(unsafe.Pointer(bp+72 /* &b */)).FszCell + uintptr(d)*2))) + 2)
- szLeft = szLeft - (int32(*(*U16)(unsafe.Pointer((*CellArray)(unsafe.Pointer(bp+72 /* &b */)).FszCell + uintptr(r)*2))) + 2)
- *(*int32)(unsafe.Pointer(bp + 136 /* &cntNew[0] */ + uintptr((i-1))*4)) = r
+ szRight = szRight + (int32(*(*U16)(unsafe.Pointer((*CellArray)(unsafe.Pointer(bp+8)).FszCell + uintptr(d)*2))) + 2)
+ szLeft = szLeft - (int32(*(*U16)(unsafe.Pointer((*CellArray)(unsafe.Pointer(bp+8)).FszCell + uintptr(r)*2))) + 2)
+ *(*int32)(unsafe.Pointer(bp + 136 /* &cntNew[0] */ + uintptr(i-1)*4)) = r
r--
d--
goto __72
@@ -50780,17 +51483,17 @@ __72:
goto __73
__73:
;
- *(*int32)(unsafe.Pointer(bp + 28 /* &szNew[0] */ + uintptr(i)*4)) = szRight
- *(*int32)(unsafe.Pointer(bp + 28 /* &szNew[0] */ + uintptr((i-1))*4)) = szLeft
- if !(*(*int32)(unsafe.Pointer(bp + 136 /* &cntNew[0] */ + uintptr((i-1))*4)) <= (func() int32 {
+ *(*int32)(unsafe.Pointer(bp + 92 /* &szNew[0] */ + uintptr(i)*4)) = szRight
+ *(*int32)(unsafe.Pointer(bp + 92 /* &szNew[0] */ + uintptr(i-1)*4)) = szLeft
+ if !(*(*int32)(unsafe.Pointer(bp + 136 + uintptr(i-1)*4)) <= func() int32 {
if i > 1 {
- return *(*int32)(unsafe.Pointer(bp + 136 /* &cntNew[0] */ + uintptr((i-2))*4))
+ return *(*int32)(unsafe.Pointer(bp + 136 + uintptr(i-2)*4))
}
return 0
- }())) {
+ }()) {
goto __75
}
- *(*int32)(unsafe.Pointer(bp + 48 /* rc */)) = Xsqlite3CorruptError(tls, 73425)
+ *(*int32)(unsafe.Pointer(bp + 112 /* rc */)) = Xsqlite3CorruptError(tls, 73641)
goto balance_cleanup
__75:
;
@@ -50810,7 +51513,7 @@ __70:
// that page.
// Allocate k new pages. Reuse old pages where possible.
- pageFlags = int32(*(*U8)(unsafe.Pointer((*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8 /* &apOld[0] */)))).FaData)))
+ pageFlags = int32(*(*U8)(unsafe.Pointer((*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 72 /* &apOld[0] */)))).FaData)))
i = 0
__76:
if !(i < k) {
@@ -50819,17 +51522,18 @@ __76:
if !(i < nOld) {
goto __79
}
- *(*uintptr)(unsafe.Pointer(bp + 176 /* pNew */)) = libc.AssignPtrUintptr(bp+156 /* &apNew */ +uintptr(i)*4, *(*uintptr)(unsafe.Pointer(bp + 8 /* &apOld[0] */ + uintptr(i)*4)))
- *(*uintptr)(unsafe.Pointer(bp + 8 /* &apOld[0] */ + uintptr(i)*4)) = uintptr(0)
- *(*int32)(unsafe.Pointer(bp + 48 /* rc */)) = Xsqlite3PagerWrite(tls, (*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 176 /* pNew */)))).FpDbPage)
+ *(*uintptr)(unsafe.Pointer(bp + 176 /* pNew */)) = libc.AssignPtrUintptr(bp+156+uintptr(i)*4, *(*uintptr)(unsafe.Pointer(bp + 72 /* &apOld[0] */ + uintptr(i)*4)))
+ *(*uintptr)(unsafe.Pointer(bp + 72 /* &apOld[0] */ + uintptr(i)*4)) = uintptr(0)
+ *(*int32)(unsafe.Pointer(bp + 112 /* rc */)) = Xsqlite3PagerWrite(tls, (*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 176 /* pNew */)))).FpDbPage)
nNew++
- if !(Xsqlite3PagerPageRefcount(tls, (*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 176 /* pNew */)))).FpDbPage) != (1 + (libc.Bool32(i == (iParentIdx - nxDiv))))) {
+ if !(Xsqlite3PagerPageRefcount(tls, (*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 176)))).FpDbPage) != 1+libc.Bool32(i == iParentIdx-nxDiv) &&
+ *(*int32)(unsafe.Pointer(bp + 112)) == SQLITE_OK) {
goto __81
}
- *(*int32)(unsafe.Pointer(bp + 48 /* rc */)) = Xsqlite3CorruptError(tls, 73456)
+ *(*int32)(unsafe.Pointer(bp + 112 /* rc */)) = Xsqlite3CorruptError(tls, 73674)
__81:
;
- if !(*(*int32)(unsafe.Pointer(bp + 48 /* rc */)) != 0) {
+ if !(*(*int32)(unsafe.Pointer(bp + 112)) != 0) {
goto __82
}
goto balance_cleanup
@@ -50838,13 +51542,13 @@ __82:
goto __80
__79:
;
- *(*int32)(unsafe.Pointer(bp + 48 /* rc */)) = allocateBtreePage(tls, pBt, bp+176 /* &pNew */, bp+180 /* &pgno */, func() uint32 {
+ *(*int32)(unsafe.Pointer(bp + 112 /* rc */)) = allocateBtreePage(tls, pBt, bp+176 /* &pNew */, bp+180 /* &pgno */, func() uint32 {
if bBulk != 0 {
return uint32(1)
}
- return *(*Pgno)(unsafe.Pointer(bp + 180 /* pgno */))
+ return *(*Pgno)(unsafe.Pointer(bp + 180))
}(), uint8(0))
- if !(*(*int32)(unsafe.Pointer(bp + 48 /* rc */)) != 0) {
+ if !(*(*int32)(unsafe.Pointer(bp + 112)) != 0) {
goto __83
}
goto balance_cleanup
@@ -50853,14 +51557,14 @@ __83:
zeroPage(tls, *(*uintptr)(unsafe.Pointer(bp + 176 /* pNew */)), pageFlags)
*(*uintptr)(unsafe.Pointer(bp + 156 /* &apNew[0] */ + uintptr(i)*4)) = *(*uintptr)(unsafe.Pointer(bp + 176 /* pNew */))
nNew++
- *(*int32)(unsafe.Pointer(bp + 52 /* &cntOld[0] */ + uintptr(i)*4)) = (*CellArray)(unsafe.Pointer(bp + 72 /* &b */)).FnCell
+ *(*int32)(unsafe.Pointer(bp + 116 /* &cntOld[0] */ + uintptr(i)*4)) = (*CellArray)(unsafe.Pointer(bp + 8 /* &b */)).FnCell
// Set the pointer-map entry for the new sibling page.
if !((*BtShared)(unsafe.Pointer(pBt)).FautoVacuum != 0) {
goto __84
}
- ptrmapPut(tls, pBt, (*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 176 /* pNew */)))).Fpgno, uint8(PTRMAP_BTREE), (*MemPage)(unsafe.Pointer(pParent)).Fpgno, bp+48 /* &rc */)
- if !(*(*int32)(unsafe.Pointer(bp + 48 /* rc */)) != SQLITE_OK) {
+ ptrmapPut(tls, pBt, (*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 176 /* pNew */)))).Fpgno, uint8(PTRMAP_BTREE), (*MemPage)(unsafe.Pointer(pParent)).Fpgno, bp+112 /* &rc */)
+ if !(*(*int32)(unsafe.Pointer(bp + 112)) != SQLITE_OK) {
goto __85
}
goto balance_cleanup
@@ -50893,14 +51597,14 @@ __86:
if !(i < nNew) {
goto __88
}
- *(*Pgno)(unsafe.Pointer(bp + 184 /* &aPgOrder[0] */ + uintptr(i)*4)) = libc.AssignPtrUint32(bp+204 /* &aPgno */ +uintptr(i)*4, (*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 156 /* &apNew[0] */ + uintptr(i)*4)))).Fpgno)
+ *(*Pgno)(unsafe.Pointer(bp + 184 /* &aPgOrder[0] */ + uintptr(i)*4)) = libc.AssignPtrUint32(bp+204+uintptr(i)*4, (*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 156 /* &apNew[0] */ + uintptr(i)*4)))).Fpgno)
*(*U16)(unsafe.Pointer(bp + 224 /* &aPgFlags[0] */ + uintptr(i)*2)) = (*DbPage)(unsafe.Pointer((*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 156 /* &apNew[0] */ + uintptr(i)*4)))).FpDbPage)).Fflags
j = 0
__89:
if !(j < i) {
goto __91
}
- if !(*(*Pgno)(unsafe.Pointer(bp + 204 /* &aPgno[0] */ + uintptr(j)*4)) == *(*Pgno)(unsafe.Pointer(bp + 204 /* &aPgno[0] */ + uintptr(i)*4))) {
+ if !(*(*Pgno)(unsafe.Pointer(bp + 204 + uintptr(j)*4)) == *(*Pgno)(unsafe.Pointer(bp + 204 + uintptr(i)*4))) {
goto __92
}
// This branch is taken if the set of sibling pages somehow contains
@@ -50910,7 +51614,7 @@ __89:
// cache with two separate objects associated with the same
// page number.
- *(*int32)(unsafe.Pointer(bp + 48 /* rc */)) = Xsqlite3CorruptError(tls, 73502)
+ *(*int32)(unsafe.Pointer(bp + 112 /* rc */)) = Xsqlite3CorruptError(tls, 73720)
goto balance_cleanup
__92:
;
@@ -50939,7 +51643,7 @@ __96:
if !(j < nNew) {
goto __98
}
- if !(*(*Pgno)(unsafe.Pointer(bp + 184 /* &aPgOrder[0] */ + uintptr(j)*4)) < *(*Pgno)(unsafe.Pointer(bp + 184 /* &aPgOrder[0] */ + uintptr(iBest)*4))) {
+ if !(*(*Pgno)(unsafe.Pointer(bp + 184 + uintptr(j)*4)) < *(*Pgno)(unsafe.Pointer(bp + 184 + uintptr(iBest)*4))) {
goto __99
}
iBest = j
@@ -50960,7 +51664,7 @@ __98:
if !(iBest > i) {
goto __101
}
- Xsqlite3PagerRekey(tls, (*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 156 /* &apNew[0] */ + uintptr(iBest)*4)))).FpDbPage, (((*BtShared)(unsafe.Pointer(pBt)).FnPage + U32(iBest)) + U32(1)), uint16(0))
+ Xsqlite3PagerRekey(tls, (*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 156 /* &apNew[0] */ + uintptr(iBest)*4)))).FpDbPage, (*BtShared)(unsafe.Pointer(pBt)).FnPage+U32(iBest)+U32(1), uint16(0))
__101:
;
Xsqlite3PagerRekey(tls, (*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 156 /* &apNew[0] */ + uintptr(i)*4)))).FpDbPage, *(*Pgno)(unsafe.Pointer(bp + 180 /* pgno */)), *(*U16)(unsafe.Pointer(bp + 224 /* &aPgFlags[0] */ + uintptr(iBest)*2)))
@@ -50975,21 +51679,21 @@ __94:
__95:
;
- Xsqlite3Put4byte(tls, pRight, (*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 156 /* &apNew[0] */ + uintptr((nNew-1))*4)))).Fpgno)
+ Xsqlite3Put4byte(tls, pRight, (*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 156 /* &apNew[0] */ + uintptr(nNew-1)*4)))).Fpgno)
// If the sibling pages are not leaves, ensure that the right-child pointer
// of the right-most new sibling page is set to the value that was
// originally in the same field of the right-most old sibling page.
- if !(((pageFlags & PTF_LEAF) == 0) && (nOld != nNew)) {
+ if !(pageFlags&PTF_LEAF == 0 && nOld != nNew) {
goto __102
}
pOld1 = *(*uintptr)(unsafe.Pointer(func() uintptr {
if nNew > nOld {
return bp + 156 /* &apNew[0] */
}
- return bp + 8 /* &apOld[0] */
- }() + uintptr((nOld-1))*4))
- libc.Xmemcpy(tls, ((*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 156 /* &apNew[0] */ + uintptr((nNew-1))*4)))).FaData + 8), ((*MemPage)(unsafe.Pointer(pOld1)).FaData + 8), uint32(4))
+ return bp + 72 /* &apOld[0] */
+ }() + uintptr(nOld-1)*4))
+ libc.Xmemcpy(tls, (*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 156 + uintptr(nNew-1)*4)))).FaData+8, (*MemPage)(unsafe.Pointer(pOld1)).FaData+8, uint32(4))
__102:
;
@@ -51012,16 +51716,16 @@ __102:
goto __103
}
pNew1 = libc.AssignUintptr(&pOld2, *(*uintptr)(unsafe.Pointer(bp + 156 /* &apNew[0] */)))
- cntOldNext = (int32((*MemPage)(unsafe.Pointer(pNew1)).FnCell) + int32((*MemPage)(unsafe.Pointer(pNew1)).FnOverflow))
+ cntOldNext = int32((*MemPage)(unsafe.Pointer(pNew1)).FnCell) + int32((*MemPage)(unsafe.Pointer(pNew1)).FnOverflow)
iNew = 0
iOld = 0
i = 0
__104:
- if !(i < (*CellArray)(unsafe.Pointer(bp+72 /* &b */)).FnCell) {
+ if !(i < (*CellArray)(unsafe.Pointer(bp+8)).FnCell) {
goto __106
}
- pCell = *(*uintptr)(unsafe.Pointer((*CellArray)(unsafe.Pointer(bp+72 /* &b */)).FapCell + uintptr(i)*4))
+ pCell = *(*uintptr)(unsafe.Pointer((*CellArray)(unsafe.Pointer(bp+8 /* &b */)).FapCell + uintptr(i)*4))
__107:
if !(i == cntOldNext) {
goto __108
@@ -51031,17 +51735,17 @@ __107:
if iOld < nNew {
pOld2 = *(*uintptr)(unsafe.Pointer(bp + 156 /* &apNew[0] */ + uintptr(iOld)*4))
} else {
- pOld2 = *(*uintptr)(unsafe.Pointer(bp + 8 /* &apOld[0] */ + uintptr(iOld)*4))
+ pOld2 = *(*uintptr)(unsafe.Pointer(bp + 72 /* &apOld[0] */ + uintptr(iOld)*4))
}
- cntOldNext = cntOldNext + ((int32((*MemPage)(unsafe.Pointer(pOld2)).FnCell) + int32((*MemPage)(unsafe.Pointer(pOld2)).FnOverflow)) + libc.BoolInt32(!(leafData != 0)))
+ cntOldNext = cntOldNext + (int32((*MemPage)(unsafe.Pointer(pOld2)).FnCell) + int32((*MemPage)(unsafe.Pointer(pOld2)).FnOverflow) + libc.BoolInt32(!(leafData != 0)))
goto __107
__108:
;
- if !(i == *(*int32)(unsafe.Pointer(bp + 136 /* &cntNew[0] */ + uintptr(iNew)*4))) {
+ if !(i == *(*int32)(unsafe.Pointer(bp + 136 + uintptr(iNew)*4))) {
goto __109
}
pNew1 = *(*uintptr)(unsafe.Pointer(bp + 156 /* &apNew[0] */ + uintptr(libc.PreIncInt32(&iNew, 1))*4))
- if !(!(leafData != 0)) {
+ if !!(leafData != 0) {
goto __110
}
goto __105
@@ -51056,24 +51760,24 @@ __109:
// if sibling page iOld had the same page number as pNew, and if
// pCell really was a part of sibling page iOld (not a divider or
// overflow cell), we can skip updating the pointer map entries.
- if !(((iOld >= nNew) ||
- ((*MemPage)(unsafe.Pointer(pNew1)).Fpgno != *(*Pgno)(unsafe.Pointer(bp + 204 /* &aPgno[0] */ + uintptr(iOld)*4)))) ||
- !((Uptr((pCell)) >= Uptr(((*MemPage)(unsafe.Pointer(pOld2)).FaData))) && (Uptr((pCell)) < Uptr(((*MemPage)(unsafe.Pointer(pOld2)).FaDataEnd))))) {
+ if !(iOld >= nNew ||
+ (*MemPage)(unsafe.Pointer(pNew1)).Fpgno != *(*Pgno)(unsafe.Pointer(bp + 204 + uintptr(iOld)*4)) ||
+ !(Uptr(pCell) >= Uptr((*MemPage)(unsafe.Pointer(pOld2)).FaData) && Uptr(pCell) < Uptr((*MemPage)(unsafe.Pointer(pOld2)).FaDataEnd))) {
goto __111
}
- if !(!(leafCorrection != 0)) {
+ if !!(leafCorrection != 0) {
goto __112
}
- ptrmapPut(tls, pBt, Xsqlite3Get4byte(tls, pCell), uint8(PTRMAP_BTREE), (*MemPage)(unsafe.Pointer(pNew1)).Fpgno, bp+48 /* &rc */)
+ ptrmapPut(tls, pBt, Xsqlite3Get4byte(tls, pCell), uint8(PTRMAP_BTREE), (*MemPage)(unsafe.Pointer(pNew1)).Fpgno, bp+112 /* &rc */)
__112:
;
- if !(int32(cachedCellSize(tls, bp+72 /* &b */, i)) > int32((*MemPage)(unsafe.Pointer(pNew1)).FminLocal)) {
+ if !(int32(cachedCellSize(tls, bp+8, i)) > int32((*MemPage)(unsafe.Pointer(pNew1)).FminLocal)) {
goto __113
}
- ptrmapPutOvflPtr(tls, pNew1, pOld2, pCell, bp+48 /* &rc */)
+ ptrmapPutOvflPtr(tls, pNew1, pOld2, pCell, bp+112 /* &rc */)
__113:
;
- if !(*(*int32)(unsafe.Pointer(bp + 48 /* rc */)) != 0) {
+ if !(*(*int32)(unsafe.Pointer(bp + 112)) != 0) {
goto __114
}
goto balance_cleanup
@@ -51094,19 +51798,19 @@ __103:
// Insert new divider cells into pParent.
i = 0
__115:
- if !(i < (nNew - 1)) {
+ if !(i < nNew-1) {
goto __117
}
pNew2 = *(*uintptr)(unsafe.Pointer(bp + 156 /* &apNew[0] */ + uintptr(i)*4))
j = *(*int32)(unsafe.Pointer(bp + 136 /* &cntNew[0] */ + uintptr(i)*4))
- pCell1 = *(*uintptr)(unsafe.Pointer((*CellArray)(unsafe.Pointer(bp+72 /* &b */)).FapCell + uintptr(j)*4))
- sz2 = (int32(*(*U16)(unsafe.Pointer((*CellArray)(unsafe.Pointer(bp+72 /* &b */)).FszCell + uintptr(j)*2))) + int32(leafCorrection))
- pTemp1 = (aOvflSpace + uintptr(iOvflSpace))
- if !(!(int32((*MemPage)(unsafe.Pointer(pNew2)).Fleaf) != 0)) {
+ pCell1 = *(*uintptr)(unsafe.Pointer((*CellArray)(unsafe.Pointer(bp+8 /* &b */)).FapCell + uintptr(j)*4))
+ sz2 = int32(*(*U16)(unsafe.Pointer((*CellArray)(unsafe.Pointer(bp+8)).FszCell + uintptr(j)*2))) + int32(leafCorrection)
+ pTemp1 = aOvflSpace + uintptr(iOvflSpace)
+ if !!(int32((*MemPage)(unsafe.Pointer(pNew2)).Fleaf) != 0) {
goto __118
}
- libc.Xmemcpy(tls, ((*MemPage)(unsafe.Pointer(pNew2)).FaData + 8), pCell1, uint32(4))
+ libc.Xmemcpy(tls, (*MemPage)(unsafe.Pointer(pNew2)).FaData+8, pCell1, uint32(4))
goto __119
__118:
if !(leafData != 0) {
@@ -51115,9 +51819,9 @@ __118:
j--
(*struct {
f func(*libc.TLS, uintptr, uintptr, uintptr)
- })(unsafe.Pointer(&struct{ uintptr }{(*MemPage)(unsafe.Pointer(pNew2)).FxParseCell})).f(tls, pNew2, *(*uintptr)(unsafe.Pointer((*CellArray)(unsafe.Pointer(bp+72 /* &b */)).FapCell + uintptr(j)*4)), bp+240 /* &info */)
+ })(unsafe.Pointer(&struct{ uintptr }{(*MemPage)(unsafe.Pointer(pNew2)).FxParseCell})).f(tls, pNew2, *(*uintptr)(unsafe.Pointer((*CellArray)(unsafe.Pointer(bp+8 /* &b */)).FapCell + uintptr(j)*4)), bp+240 /* &info */)
pCell1 = pTemp1
- sz2 = (4 + Xsqlite3PutVarint(tls, (pCell1+4), uint64((*CellInfo)(unsafe.Pointer(bp+240 /* &info */)).FnKey)))
+ sz2 = 4 + Xsqlite3PutVarint(tls, pCell1+4, uint64((*CellInfo)(unsafe.Pointer(bp+240)).FnKey))
pTemp1 = uintptr(0)
goto __121
__120:
@@ -51132,7 +51836,7 @@ __120:
// This can only happen for b-trees used to evaluate "IN (SELECT ...)"
// and WITHOUT ROWID tables with exactly one column which is the
// primary key.
- if !(int32(*(*U16)(unsafe.Pointer((*CellArray)(unsafe.Pointer(bp+72 /* &b */)).FszCell + uintptr(j)*2))) == 4) {
+ if !(int32(*(*U16)(unsafe.Pointer((*CellArray)(unsafe.Pointer(bp+8)).FszCell + uintptr(j)*2))) == 4) {
goto __122
}
@@ -51145,11 +51849,11 @@ __121:
;
__119:
;
- iOvflSpace = iOvflSpace + (sz2)
+ iOvflSpace = iOvflSpace + sz2
k = 0
__123:
- if !((*(*int32)(unsafe.Pointer((bp + 72 /* &b */ + 40 /* &.ixNx */) + uintptr(k)*4)) <= i) && (k < (NB * 2))) {
+ if !(*(*int32)(unsafe.Pointer(bp + 8 + 40 + uintptr(k)*4)) <= i && k < NB*2) {
goto __125
}
goto __124
@@ -51159,16 +51863,16 @@ __124:
goto __125
__125:
;
- pSrcEnd = *(*uintptr)(unsafe.Pointer((bp + 72 /* &b */ + 16 /* &.apEnd */) + uintptr(k)*4))
- if !((Uptr((pSrcEnd)) >= Uptr((pCell1))) && (Uptr((pSrcEnd)) < Uptr((pCell1 + uintptr(sz2))))) {
+ pSrcEnd = *(*uintptr)(unsafe.Pointer(bp + 8 + 16 + uintptr(k)*4))
+ if !(Uptr(pSrcEnd) >= Uptr(pCell1) && Uptr(pSrcEnd) < Uptr(pCell1+uintptr(sz2))) {
goto __126
}
- *(*int32)(unsafe.Pointer(bp + 48 /* rc */)) = Xsqlite3CorruptError(tls, 73659)
+ *(*int32)(unsafe.Pointer(bp + 112 /* rc */)) = Xsqlite3CorruptError(tls, 73877)
goto balance_cleanup
__126:
;
- insertCell(tls, pParent, (nxDiv + i), pCell1, sz2, pTemp1, (*MemPage)(unsafe.Pointer(pNew2)).Fpgno, bp+48 /* &rc */)
- if !(*(*int32)(unsafe.Pointer(bp + 48 /* rc */)) != SQLITE_OK) {
+ insertCell(tls, pParent, nxDiv+i, pCell1, sz2, pTemp1, (*MemPage)(unsafe.Pointer(pNew2)).Fpgno, bp+112 /* &rc */)
+ if !(*(*int32)(unsafe.Pointer(bp + 112)) != SQLITE_OK) {
goto __127
}
goto balance_cleanup
@@ -51204,7 +51908,7 @@ __117:
// step. On the upward pass, both conditions are always true, so the
// upwards pass simply processes pages that were missed on the downward
// pass.
- i = (1 - nNew)
+ i = 1 - nNew
__128:
if !(i < nNew) {
goto __130
@@ -51215,14 +51919,14 @@ __128:
iPg = i
}
- if !(*(*U8)(unsafe.Pointer(bp /* &abDone[0] */ + uintptr(iPg))) != 0) {
+ if !(*(*U8)(unsafe.Pointer(bp + uintptr(iPg))) != 0) {
goto __131
}
goto __129
__131:
- ; // Skip pages already processed
- if !((i >= 0) || // On the upwards pass, or...
- (*(*int32)(unsafe.Pointer(bp + 52 /* &cntOld[0] */ + uintptr((iPg-1))*4)) >= *(*int32)(unsafe.Pointer(bp + 136 /* &cntNew[0] */ + uintptr((iPg-1))*4)))) {
+ ; // Skip pages already processed
+ if !(i >= 0 ||
+ *(*int32)(unsafe.Pointer(bp + 116 + uintptr(iPg-1)*4)) >= *(*int32)(unsafe.Pointer(bp + 136 + uintptr(iPg-1)*4))) {
goto __132
}
@@ -51240,24 +51944,24 @@ __131:
goto __134
__133:
if iPg < nOld {
- iOld1 = (*(*int32)(unsafe.Pointer(bp + 52 /* &cntOld[0] */ + uintptr((iPg-1))*4)) + libc.BoolInt32(!(leafData != 0)))
+ iOld1 = *(*int32)(unsafe.Pointer(bp + 116 + uintptr(iPg-1)*4)) + libc.BoolInt32(!(leafData != 0))
} else {
- iOld1 = (*CellArray)(unsafe.Pointer(bp + 72 /* &b */)).FnCell
+ iOld1 = (*CellArray)(unsafe.Pointer(bp + 8 /* &b */)).FnCell
}
- iNew1 = (*(*int32)(unsafe.Pointer(bp + 136 /* &cntNew[0] */ + uintptr((iPg-1))*4)) + libc.BoolInt32(!(leafData != 0)))
- nNewCell = (*(*int32)(unsafe.Pointer(bp + 136 /* &cntNew[0] */ + uintptr(iPg)*4)) - iNew1)
+ iNew1 = *(*int32)(unsafe.Pointer(bp + 136 + uintptr(iPg-1)*4)) + libc.BoolInt32(!(leafData != 0))
+ nNewCell = *(*int32)(unsafe.Pointer(bp + 136 + uintptr(iPg)*4)) - iNew1
__134:
;
- *(*int32)(unsafe.Pointer(bp + 48 /* rc */)) = editPage(tls, *(*uintptr)(unsafe.Pointer(bp + 156 /* &apNew[0] */ + uintptr(iPg)*4)), iOld1, iNew1, nNewCell, bp+72 /* &b */)
- if !(*(*int32)(unsafe.Pointer(bp + 48 /* rc */)) != 0) {
+ *(*int32)(unsafe.Pointer(bp + 112 /* rc */)) = editPage(tls, *(*uintptr)(unsafe.Pointer(bp + 156 /* &apNew[0] */ + uintptr(iPg)*4)), iOld1, iNew1, nNewCell, bp+8 /* &b */)
+ if !(*(*int32)(unsafe.Pointer(bp + 112)) != 0) {
goto __135
}
goto balance_cleanup
__135:
;
*(*U8)(unsafe.Pointer(bp /* &abDone[0] */ + uintptr(iPg)))++
- (*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 156 /* &apNew[0] */ + uintptr(iPg)*4)))).FnFree = (usableSpace - *(*int32)(unsafe.Pointer(bp + 28 /* &szNew[0] */ + uintptr(iPg)*4)))
+ (*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 156 /* &apNew[0] */ + uintptr(iPg)*4)))).FnFree = usableSpace - *(*int32)(unsafe.Pointer(bp + 92 + uintptr(iPg)*4))
__132:
;
@@ -51271,7 +51975,7 @@ __130:
// All pages have been processed exactly once
- if !(((isRoot != 0) && (int32((*MemPage)(unsafe.Pointer(pParent)).FnCell) == 0)) && (int32((*MemPage)(unsafe.Pointer(pParent)).FhdrOffset) <= (*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 156 /* &apNew[0] */)))).FnFree)) {
+ if !(isRoot != 0 && int32((*MemPage)(unsafe.Pointer(pParent)).FnCell) == 0 && int32((*MemPage)(unsafe.Pointer(pParent)).FhdrOffset) <= (*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 156)))).FnFree) {
goto __136
}
// The root page of the b-tree now contains no cells. The only sibling
@@ -51289,13 +51993,13 @@ __130:
// by smaller than the child due to the database header, and so all the
// free space needs to be up front.
- *(*int32)(unsafe.Pointer(bp + 48 /* rc */)) = defragmentPage(tls, *(*uintptr)(unsafe.Pointer(bp + 156 /* &apNew[0] */)), -1)
+ *(*int32)(unsafe.Pointer(bp + 112 /* rc */)) = defragmentPage(tls, *(*uintptr)(unsafe.Pointer(bp + 156 /* &apNew[0] */)), -1)
- copyNodeContent(tls, *(*uintptr)(unsafe.Pointer(bp + 156 /* &apNew[0] */)), pParent, bp+48 /* &rc */)
- freePage(tls, *(*uintptr)(unsafe.Pointer(bp + 156 /* &apNew[0] */)), bp+48 /* &rc */)
+ copyNodeContent(tls, *(*uintptr)(unsafe.Pointer(bp + 156 /* &apNew[0] */)), pParent, bp+112 /* &rc */)
+ freePage(tls, *(*uintptr)(unsafe.Pointer(bp + 156 /* &apNew[0] */)), bp+112 /* &rc */)
goto __137
__136:
- if !(((*BtShared)(unsafe.Pointer(pBt)).FautoVacuum != 0) && !(leafCorrection != 0)) {
+ if !((*BtShared)(unsafe.Pointer(pBt)).FautoVacuum != 0 && !(leafCorrection != 0)) {
goto __138
}
// Fix the pointer map entries associated with the right-child of each
@@ -51306,8 +52010,8 @@ __139:
if !(i < nNew) {
goto __141
}
- key = Xsqlite3Get4byte(tls, ((*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 156 /* &apNew[0] */ + uintptr(i)*4)))).FaData + 8))
- ptrmapPut(tls, pBt, key, uint8(PTRMAP_BTREE), (*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 156 /* &apNew[0] */ + uintptr(i)*4)))).Fpgno, bp+48 /* &rc */)
+ key = Xsqlite3Get4byte(tls, (*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 156 + uintptr(i)*4)))).FaData+8)
+ ptrmapPut(tls, pBt, key, uint8(PTRMAP_BTREE), (*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 156 /* &apNew[0] */ + uintptr(i)*4)))).Fpgno, bp+112 /* &rc */)
goto __140
__140:
i++
@@ -51326,7 +52030,7 @@ __142:
if !(i < nOld) {
goto __144
}
- freePage(tls, *(*uintptr)(unsafe.Pointer(bp + 8 /* &apOld[0] */ + uintptr(i)*4)), bp+48 /* &rc */)
+ freePage(tls, *(*uintptr)(unsafe.Pointer(bp + 72 /* &apOld[0] */ + uintptr(i)*4)), bp+112 /* &rc */)
goto __143
__143:
i++
@@ -51337,13 +52041,13 @@ __144:
// Cleanup before returning.
balance_cleanup:
- Xsqlite3DbFree(tls, uintptr(0), (*CellArray)(unsafe.Pointer(bp+72 /* &b */)).FapCell)
+ Xsqlite3DbFree(tls, uintptr(0), (*CellArray)(unsafe.Pointer(bp+8 /* &b */)).FapCell)
i = 0
__145:
if !(i < nOld) {
goto __147
}
- releasePage(tls, *(*uintptr)(unsafe.Pointer(bp + 8 /* &apOld[0] */ + uintptr(i)*4)))
+ releasePage(tls, *(*uintptr)(unsafe.Pointer(bp + 72 /* &apOld[0] */ + uintptr(i)*4)))
goto __146
__146:
i++
@@ -51365,7 +52069,7 @@ __149:
__150:
;
- return *(*int32)(unsafe.Pointer(bp + 48 /* rc */))
+ return *(*int32)(unsafe.Pointer(bp + 112 /* rc */))
}
// This function is called when the root page of a b-tree structure is
@@ -51385,7 +52089,7 @@ __150:
// page and SQLITE_OK is returned. In this case the caller is required
// to call releasePage() on *ppChild exactly once. If an error occurs,
// an error code is returned and *ppChild is set to 0.
-func balance_deeper(tls *libc.TLS, pRoot uintptr, ppChild uintptr) int32 { /* sqlite3.c:73824:12: */
+func balance_deeper(tls *libc.TLS, pRoot uintptr, ppChild uintptr) int32 { /* sqlite3.c:74042:12: */
bp := tls.Alloc(12)
defer tls.Free(12)
@@ -51399,29 +52103,29 @@ func balance_deeper(tls *libc.TLS, pRoot uintptr, ppChild uintptr) int32 { /* sq
// page that will become the new right-child of pPage. Copy the contents
// of the node stored on pRoot into the new child page.
*(*int32)(unsafe.Pointer(bp + 8 /* rc */)) = Xsqlite3PagerWrite(tls, (*MemPage)(unsafe.Pointer(pRoot)).FpDbPage)
- if *(*int32)(unsafe.Pointer(bp + 8 /* rc */)) == SQLITE_OK {
+ if *(*int32)(unsafe.Pointer(bp + 8)) == SQLITE_OK {
*(*int32)(unsafe.Pointer(bp + 8 /* rc */)) = allocateBtreePage(tls, pBt, bp /* &pChild */, bp+4 /* &pgnoChild */, (*MemPage)(unsafe.Pointer(pRoot)).Fpgno, uint8(0))
copyNodeContent(tls, pRoot, *(*uintptr)(unsafe.Pointer(bp /* pChild */)), bp+8 /* &rc */)
if (*BtShared)(unsafe.Pointer(pBt)).FautoVacuum != 0 {
ptrmapPut(tls, pBt, *(*Pgno)(unsafe.Pointer(bp + 4 /* pgnoChild */)), uint8(PTRMAP_BTREE), (*MemPage)(unsafe.Pointer(pRoot)).Fpgno, bp+8 /* &rc */)
}
}
- if *(*int32)(unsafe.Pointer(bp + 8 /* rc */)) != 0 {
+ if *(*int32)(unsafe.Pointer(bp + 8)) != 0 {
*(*uintptr)(unsafe.Pointer(ppChild)) = uintptr(0)
releasePage(tls, *(*uintptr)(unsafe.Pointer(bp /* pChild */)))
return *(*int32)(unsafe.Pointer(bp + 8 /* rc */))
}
// Copy the overflow cells from pRoot to pChild
- libc.Xmemcpy(tls, *(*uintptr)(unsafe.Pointer(bp /* pChild */))+28 /* &.aiOvfl */, pRoot+28, /* &.aiOvfl */
- (uint32((*MemPage)(unsafe.Pointer(pRoot)).FnOverflow) * uint32(unsafe.Sizeof(U16(0)))))
- libc.Xmemcpy(tls, *(*uintptr)(unsafe.Pointer(bp /* pChild */))+36 /* &.apOvfl */, pRoot+36, /* &.apOvfl */
- (uint32((*MemPage)(unsafe.Pointer(pRoot)).FnOverflow) * uint32(unsafe.Sizeof(uintptr(0)))))
+ libc.Xmemcpy(tls, *(*uintptr)(unsafe.Pointer(bp))+28, pRoot+28,
+ uint32((*MemPage)(unsafe.Pointer(pRoot)).FnOverflow)*uint32(unsafe.Sizeof(U16(0))))
+ libc.Xmemcpy(tls, *(*uintptr)(unsafe.Pointer(bp))+36, pRoot+36,
+ uint32((*MemPage)(unsafe.Pointer(pRoot)).FnOverflow)*uint32(unsafe.Sizeof(uintptr(0))))
(*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* pChild */)))).FnOverflow = (*MemPage)(unsafe.Pointer(pRoot)).FnOverflow
// Zero the contents of pRoot. Then install pChild as the right-child.
- zeroPage(tls, pRoot, (int32(*(*U8)(unsafe.Pointer((*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* pChild */)))).FaData))) & libc.CplInt32(PTF_LEAF)))
- Xsqlite3Put4byte(tls, ((*MemPage)(unsafe.Pointer(pRoot)).FaData + uintptr((int32((*MemPage)(unsafe.Pointer(pRoot)).FhdrOffset) + 8))), *(*Pgno)(unsafe.Pointer(bp + 4 /* pgnoChild */)))
+ zeroPage(tls, pRoot, int32(*(*U8)(unsafe.Pointer((*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FaData)))&libc.CplInt32(PTF_LEAF))
+ Xsqlite3Put4byte(tls, (*MemPage)(unsafe.Pointer(pRoot)).FaData+uintptr(int32((*MemPage)(unsafe.Pointer(pRoot)).FhdrOffset)+8), *(*Pgno)(unsafe.Pointer(bp + 4 /* pgnoChild */)))
*(*uintptr)(unsafe.Pointer(ppChild)) = *(*uintptr)(unsafe.Pointer(bp /* pChild */))
return SQLITE_OK
@@ -51430,19 +52134,19 @@ func balance_deeper(tls *libc.TLS, pRoot uintptr, ppChild uintptr) int32 { /* sq
// Return SQLITE_CORRUPT if any cursor other than pCur is currently valid
// on the same B-tree as pCur.
//
-// This can if a database is corrupt with two or more SQL tables
+// This can occur if a database is corrupt with two or more SQL tables
// pointing to the same b-tree. If an insert occurs on one SQL table
// and causes a BEFORE TRIGGER to do a secondary insert on the other SQL
// table linked to the same b-tree. If the secondary insert causes a
// rebalance, that can change content out from under the cursor on the
// first SQL table, violating invariants on the first insert.
-func anotherValidCursor(tls *libc.TLS, pCur uintptr) int32 { /* sqlite3.c:73882:12: */
+func anotherValidCursor(tls *libc.TLS, pCur uintptr) int32 { /* sqlite3.c:74100:12: */
var pOther uintptr
for pOther = (*BtShared)(unsafe.Pointer((*BtCursor)(unsafe.Pointer(pCur)).FpBt)).FpCursor; pOther != 0; pOther = (*BtCursor)(unsafe.Pointer(pOther)).FpNext {
- if ((pOther != pCur) &&
- (int32((*BtCursor)(unsafe.Pointer(pOther)).FeState) == CURSOR_VALID)) &&
- ((*BtCursor)(unsafe.Pointer(pOther)).FpPage == (*BtCursor)(unsafe.Pointer(pCur)).FpPage) {
- return Xsqlite3CorruptError(tls, 73889)
+ if pOther != pCur &&
+ int32((*BtCursor)(unsafe.Pointer(pOther)).FeState) == CURSOR_VALID &&
+ (*BtCursor)(unsafe.Pointer(pOther)).FpPage == (*BtCursor)(unsafe.Pointer(pCur)).FpPage {
+ return Xsqlite3CorruptError(tls, 74107)
}
}
return SQLITE_OK
@@ -51456,58 +52160,58 @@ func anotherValidCursor(tls *libc.TLS, pCur uintptr) int32 { /* sqlite3.c:73882:
// balance_quick()
// balance_deeper()
// balance_nonroot()
-func balance(tls *libc.TLS, pCur uintptr) int32 { /* sqlite3.c:73905:12: */
+func balance(tls *libc.TLS, pCur uintptr) int32 { /* sqlite3.c:74123:12: */
bp := tls.Alloc(13)
defer tls.Free(13)
var rc int32 = SQLITE_OK
- var nMin int32 = (int32(((*BtShared)(unsafe.Pointer((*BtCursor)(unsafe.Pointer(pCur)).FpBt)).FusableSize * U32(2)) / U32(3)))
+ var nMin int32 = int32((*BtShared)(unsafe.Pointer((*BtCursor)(unsafe.Pointer(pCur)).FpBt)).FusableSize * U32(2) / U32(3))
// var aBalanceQuickSpace [13]U8 at bp, 13
var pFree uintptr = uintptr(0)
- for ok := true; ok; ok = (rc == SQLITE_OK) {
+ for ok := true; ok; ok = rc == SQLITE_OK {
var iPage int32
var pPage uintptr = (*BtCursor)(unsafe.Pointer(pCur)).FpPage
- if ((*MemPage)(unsafe.Pointer(pPage)).FnFree < 0) && (btreeComputeFreeSpace(tls, pPage) != 0) {
+ if (*MemPage)(unsafe.Pointer(pPage)).FnFree < 0 && btreeComputeFreeSpace(tls, pPage) != 0 {
break
}
- if (int32((*MemPage)(unsafe.Pointer(pPage)).FnOverflow) == 0) && ((*MemPage)(unsafe.Pointer(pPage)).FnFree <= nMin) {
+ if int32((*MemPage)(unsafe.Pointer(pPage)).FnOverflow) == 0 && (*MemPage)(unsafe.Pointer(pPage)).FnFree <= nMin {
break
- } else if (libc.AssignInt32(&iPage, int32((*BtCursor)(unsafe.Pointer(pCur)).FiPage))) == 0 {
- if ((*MemPage)(unsafe.Pointer(pPage)).FnOverflow != 0) && ((libc.AssignInt32(&rc, anotherValidCursor(tls, pCur))) == SQLITE_OK) {
+ } else if libc.AssignInt32(&iPage, int32((*BtCursor)(unsafe.Pointer(pCur)).FiPage)) == 0 {
+ if (*MemPage)(unsafe.Pointer(pPage)).FnOverflow != 0 && libc.AssignInt32(&rc, anotherValidCursor(tls, pCur)) == SQLITE_OK {
// The root page of the b-tree is overfull. In this case call the
// balance_deeper() function to create a new child for the root-page
// and copy the current contents of the root-page to it. The
// next iteration of the do-loop will balance the child page.
- rc = balance_deeper(tls, pPage, ((pCur + 120 /* &.apPage */) + 1*4))
+ rc = balance_deeper(tls, pPage, pCur+120+1*4)
if rc == SQLITE_OK {
(*BtCursor)(unsafe.Pointer(pCur)).FiPage = int8(1)
(*BtCursor)(unsafe.Pointer(pCur)).Fix = U16(0)
- *(*U16)(unsafe.Pointer((pCur + 72 /* &.aiIdx */))) = U16(0)
- *(*uintptr)(unsafe.Pointer((pCur + 120 /* &.apPage */))) = pPage
- (*BtCursor)(unsafe.Pointer(pCur)).FpPage = *(*uintptr)(unsafe.Pointer((pCur + 120 /* &.apPage */) + 1*4))
+ *(*U16)(unsafe.Pointer(pCur + 72)) = U16(0)
+ *(*uintptr)(unsafe.Pointer(pCur + 120)) = pPage
+ (*BtCursor)(unsafe.Pointer(pCur)).FpPage = *(*uintptr)(unsafe.Pointer(pCur + 120 + 1*4))
}
} else {
break
}
} else {
- var pParent uintptr = *(*uintptr)(unsafe.Pointer((pCur + 120 /* &.apPage */) + uintptr((iPage-1))*4))
- var iIdx int32 = int32(*(*U16)(unsafe.Pointer((pCur + 72 /* &.aiIdx */) + uintptr((iPage-1))*2)))
+ var pParent uintptr = *(*uintptr)(unsafe.Pointer(pCur + 120 + uintptr(iPage-1)*4))
+ var iIdx int32 = int32(*(*U16)(unsafe.Pointer(pCur + 72 + uintptr(iPage-1)*2)))
rc = Xsqlite3PagerWrite(tls, (*MemPage)(unsafe.Pointer(pParent)).FpDbPage)
- if (rc == SQLITE_OK) && ((*MemPage)(unsafe.Pointer(pParent)).FnFree < 0) {
+ if rc == SQLITE_OK && (*MemPage)(unsafe.Pointer(pParent)).FnFree < 0 {
rc = btreeComputeFreeSpace(tls, pParent)
}
if rc == SQLITE_OK {
- if (((((*MemPage)(unsafe.Pointer(pPage)).FintKeyLeaf != 0) &&
- (int32((*MemPage)(unsafe.Pointer(pPage)).FnOverflow) == 1)) &&
- (int32(*(*U16)(unsafe.Pointer((pPage + 28 /* &.aiOvfl */)))) == int32((*MemPage)(unsafe.Pointer(pPage)).FnCell))) &&
- ((*MemPage)(unsafe.Pointer(pParent)).Fpgno != Pgno(1))) &&
- (int32((*MemPage)(unsafe.Pointer(pParent)).FnCell) == iIdx) {
+ if (*MemPage)(unsafe.Pointer(pPage)).FintKeyLeaf != 0 &&
+ int32((*MemPage)(unsafe.Pointer(pPage)).FnOverflow) == 1 &&
+ int32(*(*U16)(unsafe.Pointer(pPage + 28))) == int32((*MemPage)(unsafe.Pointer(pPage)).FnCell) &&
+ (*MemPage)(unsafe.Pointer(pParent)).Fpgno != Pgno(1) &&
+ int32((*MemPage)(unsafe.Pointer(pParent)).FnCell) == iIdx {
// Call balance_quick() to create a new sibling of pPage on which
// to store the overflow cell. balance_quick() inserts a new cell
// into pParent, which may cause pParent overflow. If this
@@ -51540,8 +52244,8 @@ func balance(tls *libc.TLS, pCur uintptr) int32 { /* sqlite3.c:73905:12: */
// copied either into the body of a database page or into the new
// pSpace buffer passed to the latter call to balance_nonroot().
var pSpace uintptr = Xsqlite3PageMalloc(tls, int32((*BtShared)(unsafe.Pointer((*BtCursor)(unsafe.Pointer(pCur)).FpBt)).FpageSize))
- rc = balance_nonroot(tls, pParent, iIdx, pSpace, (libc.Bool32(iPage == 1)),
- (int32((*BtCursor)(unsafe.Pointer(pCur)).Fhints) & BTREE_BULKLOAD))
+ rc = balance_nonroot(tls, pParent, iIdx, pSpace, libc.Bool32(iPage == 1),
+ int32((*BtCursor)(unsafe.Pointer(pCur)).Fhints)&BTREE_BULKLOAD)
if pFree != 0 {
// If pFree is not NULL, it points to the pSpace buffer used
// by a previous call to balance_nonroot(). Its contents are
@@ -51563,7 +52267,7 @@ func balance(tls *libc.TLS, pCur uintptr) int32 { /* sqlite3.c:73905:12: */
releasePage(tls, pPage)
(*BtCursor)(unsafe.Pointer(pCur)).FiPage--
- (*BtCursor)(unsafe.Pointer(pCur)).FpPage = *(*uintptr)(unsafe.Pointer((pCur + 120 /* &.apPage */) + uintptr((*BtCursor)(unsafe.Pointer(pCur)).FiPage)*4))
+ (*BtCursor)(unsafe.Pointer(pCur)).FpPage = *(*uintptr)(unsafe.Pointer(pCur + 120 + uintptr((*BtCursor)(unsafe.Pointer(pCur)).FiPage)*4))
}
}
@@ -51575,32 +52279,32 @@ func balance(tls *libc.TLS, pCur uintptr) int32 { /* sqlite3.c:73905:12: */
// Overwrite content from pX into pDest. Only do the write if the
// content is different from what is already there.
-func btreeOverwriteContent(tls *libc.TLS, pPage uintptr, pDest uintptr, pX uintptr, iOffset int32, iAmt int32) int32 { /* sqlite3.c:74031:12: */
- var nData int32 = ((*BtreePayload)(unsafe.Pointer(pX)).FnData - iOffset)
+func btreeOverwriteContent(tls *libc.TLS, pPage uintptr, pDest uintptr, pX uintptr, iOffset int32, iAmt int32) int32 { /* sqlite3.c:74249:12: */
+ var nData int32 = (*BtreePayload)(unsafe.Pointer(pX)).FnData - iOffset
if nData <= 0 {
// Overwritting with zeros
var i int32
- for i = 0; (i < iAmt) && (int32(*(*U8)(unsafe.Pointer(pDest + uintptr(i)))) == 0); i++ {
+ for i = 0; i < iAmt && int32(*(*U8)(unsafe.Pointer(pDest + uintptr(i)))) == 0; i++ {
}
if i < iAmt {
var rc int32 = Xsqlite3PagerWrite(tls, (*MemPage)(unsafe.Pointer(pPage)).FpDbPage)
if rc != 0 {
return rc
}
- libc.Xmemset(tls, (pDest + uintptr(i)), 0, (uint32(iAmt - i)))
+ libc.Xmemset(tls, pDest+uintptr(i), 0, uint32(iAmt-i))
}
} else {
if nData < iAmt {
// Mixed read data and zeros at the end. Make a recursive call
// to write the zeros then fall through to write the real data
- var rc int32 = btreeOverwriteContent(tls, pPage, (pDest + uintptr(nData)), pX, (iOffset + nData),
- (iAmt - nData))
+ var rc int32 = btreeOverwriteContent(tls, pPage, pDest+uintptr(nData), pX, iOffset+nData,
+ iAmt-nData)
if rc != 0 {
return rc
}
iAmt = nData
}
- if libc.Xmemcmp(tls, pDest, (((*BtreePayload)(unsafe.Pointer(pX)).FpData)+uintptr(iOffset)), uint32(iAmt)) != 0 {
+ if libc.Xmemcmp(tls, pDest, (*BtreePayload)(unsafe.Pointer(pX)).FpData+uintptr(iOffset), uint32(iAmt)) != 0 {
var rc int32 = Xsqlite3PagerWrite(tls, (*MemPage)(unsafe.Pointer(pPage)).FpDbPage)
if rc != 0 {
return rc
@@ -51609,7 +52313,7 @@ func btreeOverwriteContent(tls *libc.TLS, pPage uintptr, pDest uintptr, pX uintp
// buffers to overlap. This is harmless since the database is already
// corrupt but it does cause valgrind and ASAN warnings. So use
// memmove().
- libc.Xmemmove(tls, pDest, (((*BtreePayload)(unsafe.Pointer(pX)).FpData) + uintptr(iOffset)), uint32(iAmt))
+ libc.Xmemmove(tls, pDest, (*BtreePayload)(unsafe.Pointer(pX)).FpData+uintptr(iOffset), uint32(iAmt))
}
}
return SQLITE_OK
@@ -51617,21 +52321,21 @@ func btreeOverwriteContent(tls *libc.TLS, pPage uintptr, pDest uintptr, pX uintp
// Overwrite the cell that cursor pCur is pointing to with fresh content
// contained in pX.
-func btreeOverwriteCell(tls *libc.TLS, pCur uintptr, pX uintptr) int32 { /* sqlite3.c:74074:12: */
+func btreeOverwriteCell(tls *libc.TLS, pCur uintptr, pX uintptr) int32 { /* sqlite3.c:74292:12: */
bp := tls.Alloc(4)
defer tls.Free(4)
- var iOffset int32 // Next byte of pX->pData to write
- var nTotal int32 = ((*BtreePayload)(unsafe.Pointer(pX)).FnData + (*BtreePayload)(unsafe.Pointer(pX)).FnZero) // Total bytes of to write
- var rc int32 // Return code
- *(*uintptr)(unsafe.Pointer(bp /* pPage */)) = (*BtCursor)(unsafe.Pointer(pCur)).FpPage // Page being written
- var pBt uintptr // Btree
- var ovflPgno Pgno // Next overflow page to write
- var ovflPageSize U32 // Size to write on overflow page
+ var iOffset int32 // Next byte of pX->pData to write
+ var nTotal int32 = (*BtreePayload)(unsafe.Pointer(pX)).FnData + (*BtreePayload)(unsafe.Pointer(pX)).FnZero // Total bytes of to write
+ var rc int32 // Return code
+ *(*uintptr)(unsafe.Pointer(bp /* pPage */)) = (*BtCursor)(unsafe.Pointer(pCur)).FpPage // Page being written
+ var pBt uintptr // Btree
+ var ovflPgno Pgno // Next overflow page to write
+ var ovflPageSize U32 // Size to write on overflow page
- if (((*BtCursor)(unsafe.Pointer(pCur)).Finfo.FpPayload + uintptr((*BtCursor)(unsafe.Pointer(pCur)).Finfo.FnLocal)) > (*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* pPage */)))).FaDataEnd) ||
- ((*BtCursor)(unsafe.Pointer(pCur)).Finfo.FpPayload < ((*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* pPage */)))).FaData + uintptr((*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* pPage */)))).FcellOffset))) {
- return Xsqlite3CorruptError(tls, 74086)
+ if (*BtCursor)(unsafe.Pointer(pCur)).Finfo.FpPayload+uintptr((*BtCursor)(unsafe.Pointer(pCur)).Finfo.FnLocal) > (*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FaDataEnd ||
+ (*BtCursor)(unsafe.Pointer(pCur)).Finfo.FpPayload < (*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FaData+uintptr((*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FcellOffset) {
+ return Xsqlite3CorruptError(tls, 74304)
}
// Overwrite the local portion first
rc = btreeOverwriteContent(tls, *(*uintptr)(unsafe.Pointer(bp /* pPage */)), (*BtCursor)(unsafe.Pointer(pCur)).Finfo.FpPayload, pX,
@@ -51646,30 +52350,30 @@ func btreeOverwriteCell(tls *libc.TLS, pCur uintptr, pX uintptr) int32 { /* sqli
// Now overwrite the overflow pages
iOffset = int32((*BtCursor)(unsafe.Pointer(pCur)).Finfo.FnLocal)
- ovflPgno = Xsqlite3Get4byte(tls, ((*BtCursor)(unsafe.Pointer(pCur)).Finfo.FpPayload + uintptr(iOffset)))
+ ovflPgno = Xsqlite3Get4byte(tls, (*BtCursor)(unsafe.Pointer(pCur)).Finfo.FpPayload+uintptr(iOffset))
pBt = (*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* pPage */)))).FpBt
- ovflPageSize = ((*BtShared)(unsafe.Pointer(pBt)).FusableSize - U32(4))
- for ok := true; ok; ok = (iOffset < nTotal) {
+ ovflPageSize = (*BtShared)(unsafe.Pointer(pBt)).FusableSize - U32(4)
+ for ok := true; ok; ok = iOffset < nTotal {
rc = btreeGetPage(tls, pBt, ovflPgno, bp /* &pPage */, 0)
if rc != 0 {
return rc
}
- if Xsqlite3PagerPageRefcount(tls, (*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* pPage */)))).FpDbPage) != 1 {
- rc = Xsqlite3CorruptError(tls, 74105)
+ if Xsqlite3PagerPageRefcount(tls, (*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FpDbPage) != 1 || (*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FisInit != 0 {
+ rc = Xsqlite3CorruptError(tls, 74323)
} else {
- if (U32(iOffset) + ovflPageSize) < U32(nTotal) {
+ if U32(iOffset)+ovflPageSize < U32(nTotal) {
ovflPgno = Xsqlite3Get4byte(tls, (*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* pPage */)))).FaData)
} else {
- ovflPageSize = (U32(nTotal - iOffset))
+ ovflPageSize = U32(nTotal - iOffset)
}
- rc = btreeOverwriteContent(tls, *(*uintptr)(unsafe.Pointer(bp /* pPage */)), ((*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* pPage */)))).FaData + uintptr(4)), pX,
+ rc = btreeOverwriteContent(tls, *(*uintptr)(unsafe.Pointer(bp /* pPage */)), (*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FaData+uintptr(4), pX,
iOffset, int32(ovflPageSize))
}
Xsqlite3PagerUnref(tls, (*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* pPage */)))).FpDbPage)
if rc != 0 {
return rc
}
- iOffset = int32(U32(iOffset) + (ovflPageSize))
+ iOffset = int32(U32(iOffset) + ovflPageSize)
}
return SQLITE_OK
}
@@ -51702,7 +52406,7 @@ func btreeOverwriteCell(tls *libc.TLS, pCur uintptr, pX uintptr) int32 { /* sqli
// if pX->nMem is non-zero, then pX->aMem contains pointers to the unpacked
// key values and pX->aMem can be used instead of pX->pKey to avoid having
// to decode the key.
-func Xsqlite3BtreeInsert(tls *libc.TLS, pCur uintptr, pX uintptr, flags int32, seekResult int32) int32 { /* sqlite3.c:74153:20: */
+func Xsqlite3BtreeInsert(tls *libc.TLS, pCur uintptr, pX uintptr, flags int32, seekResult int32) int32 { /* sqlite3.c:74371:20: */
bp := tls.Alloc(120)
defer tls.Free(120)
@@ -51756,17 +52460,17 @@ __1:
// that the cursor is already where it needs to be and returns without
// doing any work. To avoid thwarting these optimizations, it is important
// not to clear the cursor here.
- if !((int32((*BtCursor)(unsafe.Pointer(pCur)).FcurFlags) & BTCF_Multiple) != 0) {
+ if !(int32((*BtCursor)(unsafe.Pointer(pCur)).FcurFlags)&BTCF_Multiple != 0) {
goto __2
}
*(*int32)(unsafe.Pointer(bp + 88 /* rc */)) = saveAllCursors(tls, pBt, (*BtCursor)(unsafe.Pointer(pCur)).FpgnoRoot, pCur)
- if !(*(*int32)(unsafe.Pointer(bp + 88 /* rc */)) != 0) {
+ if !(*(*int32)(unsafe.Pointer(bp + 88)) != 0) {
goto __3
}
return *(*int32)(unsafe.Pointer(bp + 88 /* rc */))
__3:
;
- if !((*(*int32)(unsafe.Pointer(bp /* loc */)) != 0) && (int32((*BtCursor)(unsafe.Pointer(pCur)).FiPage) < 0)) {
+ if !(*(*int32)(unsafe.Pointer(bp)) != 0 && int32((*BtCursor)(unsafe.Pointer(pCur)).FiPage) < 0) {
goto __4
}
// This can only happen if the schema is corrupt such that there is more
@@ -51774,7 +52478,7 @@ __3:
// 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 Xsqlite3CorruptError(tls, 74210)
+ return Xsqlite3CorruptError(tls, 74428)
__4:
;
__2:
@@ -51799,14 +52503,14 @@ __7:
// On the other hand, BTREE_SAVEPOSITION==0 does not imply
// that the cursor is not pointing to a row to be overwritten.
// So do a complete check.
- if !(((int32((*BtCursor)(unsafe.Pointer(pCur)).FcurFlags) & BTCF_ValidNKey) != 0) && ((*BtreePayload)(unsafe.Pointer(pX)).FnKey == (*BtCursor)(unsafe.Pointer(pCur)).Finfo.FnKey)) {
+ if !(int32((*BtCursor)(unsafe.Pointer(pCur)).FcurFlags)&BTCF_ValidNKey != 0 && (*BtreePayload)(unsafe.Pointer(pX)).FnKey == (*BtCursor)(unsafe.Pointer(pCur)).Finfo.FnKey) {
goto __8
}
// The cursor is pointing to the entry that is to be
// overwritten
- if !((int32((*BtCursor)(unsafe.Pointer(pCur)).Finfo.FnSize) != 0) &&
- ((*BtCursor)(unsafe.Pointer(pCur)).Finfo.FnPayload == (U32((*BtreePayload)(unsafe.Pointer(pX)).FnData) + U32((*BtreePayload)(unsafe.Pointer(pX)).FnZero)))) {
+ if !(int32((*BtCursor)(unsafe.Pointer(pCur)).Finfo.FnSize) != 0 &&
+ (*BtCursor)(unsafe.Pointer(pCur)).Finfo.FnPayload == U32((*BtreePayload)(unsafe.Pointer(pX)).FnData)+U32((*BtreePayload)(unsafe.Pointer(pX)).FnZero)) {
goto __10
}
// New entry is the same size as the old. Do an overwrite
@@ -51816,14 +52520,15 @@ __10:
goto __9
__8:
- if !(*(*int32)(unsafe.Pointer(bp /* loc */)) == 0) {
+ if !(*(*int32)(unsafe.Pointer(bp)) == 0) {
goto __11
}
// The cursor is *not* pointing to the cell to be overwritten, nor
// to an adjacent cell. Move the cursor so that it is pointing either
// to the cell to be overwritten or an adjacent cell.
- *(*int32)(unsafe.Pointer(bp + 88 /* rc */)) = Xsqlite3BtreeMovetoUnpacked(tls, pCur, uintptr(0), (*BtreePayload)(unsafe.Pointer(pX)).FnKey, (libc.Bool32(flags != 0)), bp /* &loc */)
- if !(*(*int32)(unsafe.Pointer(bp + 88 /* rc */)) != 0) {
+ *(*int32)(unsafe.Pointer(bp + 88 /* rc */)) = Xsqlite3BtreeTableMoveto(tls, pCur, (*BtreePayload)(unsafe.Pointer(pX)).FnKey,
+ libc.Bool32(flags&BTREE_APPEND != 0), bp /* &loc */)
+ if !(*(*int32)(unsafe.Pointer(bp + 88)) != 0) {
goto __12
}
return *(*int32)(unsafe.Pointer(bp + 88 /* rc */))
@@ -51845,7 +52550,7 @@ __5:
// overwritten, or if a new cell is being inserted, if the cursor is
// not pointing to an immediately adjacent cell, then move the cursor
// so that it does.
- if !((*(*int32)(unsafe.Pointer(bp /* loc */)) == 0) && ((flags & BTREE_SAVEPOSITION) == 0)) {
+ if !(*(*int32)(unsafe.Pointer(bp)) == 0 && flags&BTREE_SAVEPOSITION == 0) {
goto __13
}
if !((*BtreePayload)(unsafe.Pointer(pX)).FnMem != 0) {
@@ -51855,17 +52560,15 @@ __5:
(*UnpackedRecord)(unsafe.Pointer(bp + 4 /* &r */)).FaMem = (*BtreePayload)(unsafe.Pointer(pX)).FaMem
(*UnpackedRecord)(unsafe.Pointer(bp + 4 /* &r */)).FnField = (*BtreePayload)(unsafe.Pointer(pX)).FnMem
(*UnpackedRecord)(unsafe.Pointer(bp + 4 /* &r */)).Fdefault_rc = int8(0)
- (*UnpackedRecord)(unsafe.Pointer(bp + 4 /* &r */)).FerrCode = U8(0)
- (*UnpackedRecord)(unsafe.Pointer(bp + 4 /* &r */)).Fr1 = int8(0)
- (*UnpackedRecord)(unsafe.Pointer(bp + 4 /* &r */)).Fr2 = int8(0)
(*UnpackedRecord)(unsafe.Pointer(bp + 4 /* &r */)).FeqSeen = U8(0)
- *(*int32)(unsafe.Pointer(bp + 88 /* rc */)) = Xsqlite3BtreeMovetoUnpacked(tls, pCur, bp+4 /* &r */, int64(0), (libc.Bool32(flags != 0)), bp /* &loc */)
+ *(*int32)(unsafe.Pointer(bp + 88 /* rc */)) = Xsqlite3BtreeIndexMoveto(tls, pCur, bp+4 /* &r */, bp /* &loc */)
goto __15
__14:
- *(*int32)(unsafe.Pointer(bp + 88 /* rc */)) = btreeMoveto(tls, pCur, (*BtreePayload)(unsafe.Pointer(pX)).FpKey, (*BtreePayload)(unsafe.Pointer(pX)).FnKey, (libc.Bool32(flags != 0)), bp /* &loc */)
+ *(*int32)(unsafe.Pointer(bp + 88 /* rc */)) = btreeMoveto(tls, pCur, (*BtreePayload)(unsafe.Pointer(pX)).FpKey, (*BtreePayload)(unsafe.Pointer(pX)).FnKey,
+ libc.Bool32(flags&BTREE_APPEND != 0), bp /* &loc */)
__15:
;
- if !(*(*int32)(unsafe.Pointer(bp + 88 /* rc */)) != 0) {
+ if !(*(*int32)(unsafe.Pointer(bp + 88)) != 0) {
goto __16
}
return *(*int32)(unsafe.Pointer(bp + 88 /* rc */))
@@ -51877,7 +52580,7 @@ __13:
// If the cursor is currently pointing to an entry to be overwritten
// and the new content is the same as as the old, then use the
// overwrite optimization.
- if !(*(*int32)(unsafe.Pointer(bp /* loc */)) == 0) {
+ if !(*(*int32)(unsafe.Pointer(bp)) == 0) {
goto __17
}
getCellInfo(tls, pCur)
@@ -51903,13 +52606,13 @@ __6:
if !(int32((*BtCursor)(unsafe.Pointer(pCur)).FeState) > CURSOR_INVALID) {
goto __20
}
- *(*int32)(unsafe.Pointer(bp + 88 /* rc */)) = Xsqlite3CorruptError(tls, 74311)
+ *(*int32)(unsafe.Pointer(bp + 88 /* rc */)) = Xsqlite3CorruptError(tls, 74528)
goto __21
__20:
*(*int32)(unsafe.Pointer(bp + 88 /* rc */)) = btreeComputeFreeSpace(tls, pPage)
__21:
;
- if !(*(*int32)(unsafe.Pointer(bp + 88 /* rc */)) != 0) {
+ if !(*(*int32)(unsafe.Pointer(bp + 88)) != 0) {
goto __22
}
return *(*int32)(unsafe.Pointer(bp + 88 /* rc */))
@@ -51920,27 +52623,27 @@ __19:
newCell = (*BtShared)(unsafe.Pointer(pBt)).FpTmpSpace
- if !((flags & BTREE_PREFORMAT) != 0) {
+ if !(flags&BTREE_PREFORMAT != 0) {
goto __23
}
*(*int32)(unsafe.Pointer(bp + 88 /* rc */)) = SQLITE_OK
*(*int32)(unsafe.Pointer(bp + 92 /* szNew */)) = (*BtShared)(unsafe.Pointer(pBt)).FnPreformatSize
- if !(*(*int32)(unsafe.Pointer(bp + 92 /* szNew */)) < 4) {
+ if !(*(*int32)(unsafe.Pointer(bp + 92)) < 4) {
goto __25
}
*(*int32)(unsafe.Pointer(bp + 92 /* szNew */)) = 4
__25:
;
- if !(((*BtShared)(unsafe.Pointer(pBt)).FautoVacuum != 0) && (*(*int32)(unsafe.Pointer(bp + 92 /* szNew */)) > int32((*MemPage)(unsafe.Pointer(pPage)).FmaxLocal))) {
+ if !((*BtShared)(unsafe.Pointer(pBt)).FautoVacuum != 0 && *(*int32)(unsafe.Pointer(bp + 92)) > int32((*MemPage)(unsafe.Pointer(pPage)).FmaxLocal)) {
goto __26
}
(*struct {
f func(*libc.TLS, uintptr, uintptr, uintptr)
})(unsafe.Pointer(&struct{ uintptr }{(*MemPage)(unsafe.Pointer(pPage)).FxParseCell})).f(tls, pPage, newCell, bp+64 /* &info */)
- if !((*CellInfo)(unsafe.Pointer(bp+64 /* &info */)).FnPayload != U32((*CellInfo)(unsafe.Pointer(bp+64 /* &info */)).FnLocal)) {
+ if !((*CellInfo)(unsafe.Pointer(bp+64)).FnPayload != U32((*CellInfo)(unsafe.Pointer(bp+64)).FnLocal)) {
goto __27
}
- ovfl = Xsqlite3Get4byte(tls, (newCell + uintptr((*(*int32)(unsafe.Pointer(bp + 92 /* szNew */)) - 4))))
+ ovfl = Xsqlite3Get4byte(tls, newCell+uintptr(*(*int32)(unsafe.Pointer(bp + 92))-4))
ptrmapPut(tls, pBt, ovfl, uint8(PTRMAP_OVERFLOW1), (*MemPage)(unsafe.Pointer(pPage)).Fpgno, bp+88 /* &rc */)
__27:
;
@@ -51951,7 +52654,7 @@ __23:
*(*int32)(unsafe.Pointer(bp + 88 /* rc */)) = fillInCell(tls, pPage, newCell, pX, bp+92 /* &szNew */)
__24:
;
- if !(*(*int32)(unsafe.Pointer(bp + 88 /* rc */)) != 0) {
+ if !(*(*int32)(unsafe.Pointer(bp + 88)) != 0) {
goto __28
}
goto end_insert
@@ -51959,41 +52662,47 @@ __28:
;
idx = int32((*BtCursor)(unsafe.Pointer(pCur)).Fix)
- if !(*(*int32)(unsafe.Pointer(bp /* loc */)) == 0) {
+ if !(*(*int32)(unsafe.Pointer(bp)) == 0) {
goto __29
}
- *(*int32)(unsafe.Pointer(bp + 88 /* rc */)) = Xsqlite3PagerWrite(tls, (*MemPage)(unsafe.Pointer(pPage)).FpDbPage)
- if !(*(*int32)(unsafe.Pointer(bp + 88 /* rc */)) != 0) {
+ if !(idx >= int32((*MemPage)(unsafe.Pointer(pPage)).FnCell)) {
goto __31
}
- goto end_insert
+ return Xsqlite3CorruptError(tls, 74564)
__31:
;
- oldCell = ((*MemPage)(unsafe.Pointer((pPage))).FaData + uintptr((int32((*MemPage)(unsafe.Pointer((pPage))).FmaskPage) & int32(libc.X__builtin_bswap16(tls, *(*U16)(unsafe.Pointer(((*MemPage)(unsafe.Pointer((pPage))).FaCellIdx + uintptr((2 * (idx)))))))))))
- if !(!(int32((*MemPage)(unsafe.Pointer(pPage)).Fleaf) != 0)) {
+ *(*int32)(unsafe.Pointer(bp + 88 /* rc */)) = Xsqlite3PagerWrite(tls, (*MemPage)(unsafe.Pointer(pPage)).FpDbPage)
+ if !(*(*int32)(unsafe.Pointer(bp + 88)) != 0) {
goto __32
}
- libc.Xmemcpy(tls, newCell, oldCell, uint32(4))
+ goto end_insert
__32:
;
+ oldCell = (*MemPage)(unsafe.Pointer(pPage)).FaData + uintptr(int32((*MemPage)(unsafe.Pointer(pPage)).FmaskPage)&int32(libc.X__builtin_bswap16(tls, *(*U16)(unsafe.Pointer((*MemPage)(unsafe.Pointer(pPage)).FaCellIdx + uintptr(2*idx))))))
+ if !!(int32((*MemPage)(unsafe.Pointer(pPage)).Fleaf) != 0) {
+ goto __33
+ }
+ libc.Xmemcpy(tls, newCell, oldCell, uint32(4))
+__33:
+ ;
(*struct {
f func(*libc.TLS, uintptr, uintptr, uintptr)
})(unsafe.Pointer(&struct{ uintptr }{(*MemPage)(unsafe.Pointer(pPage)).FxParseCell})).f(tls, pPage, oldCell, bp+96 /* &info1 */)
if !(U32((*CellInfo)(unsafe.Pointer(bp+96 /* &info1 */)).FnLocal) != (*CellInfo)(unsafe.Pointer(bp+96 /* &info1 */)).FnPayload) {
- goto __33
+ goto __34
}
*(*int32)(unsafe.Pointer(bp + 88 /* rc */)) = clearCellOverflow(tls, pPage, oldCell, bp+96 /* &info1 */)
- goto __34
-__33:
- *(*int32)(unsafe.Pointer(bp + 88 /* rc */)) = SQLITE_OK
+ goto __35
__34:
+ *(*int32)(unsafe.Pointer(bp + 88 /* rc */)) = SQLITE_OK
+__35:
;
- *(*U8)(unsafe.Pointer(pCur + 1 /* &.curFlags */)) &= libc.Uint8FromInt32((libc.CplInt32(BTCF_ValidOvfl)))
- if !(((int32((*CellInfo)(unsafe.Pointer(bp+96 /* &info1 */)).FnSize) == *(*int32)(unsafe.Pointer(bp + 92 /* szNew */))) && (U32((*CellInfo)(unsafe.Pointer(bp+96 /* &info1 */)).FnLocal) == (*CellInfo)(unsafe.Pointer(bp+96 /* &info1 */)).FnPayload)) &&
- (!(int32((*BtShared)(unsafe.Pointer(pBt)).FautoVacuum) != 0) || (*(*int32)(unsafe.Pointer(bp + 92 /* szNew */)) < int32((*MemPage)(unsafe.Pointer(pPage)).FminLocal)))) {
- goto __35
+ *(*U8)(unsafe.Pointer(pCur + 1)) &= libc.Uint8FromInt32(libc.CplInt32(BTCF_ValidOvfl))
+ if !(int32((*CellInfo)(unsafe.Pointer(bp+96)).FnSize) == *(*int32)(unsafe.Pointer(bp + 92)) && U32((*CellInfo)(unsafe.Pointer(bp+96)).FnLocal) == (*CellInfo)(unsafe.Pointer(bp+96)).FnPayload &&
+ (!(int32((*BtShared)(unsafe.Pointer(pBt)).FautoVacuum) != 0) || *(*int32)(unsafe.Pointer(bp + 92)) < int32((*MemPage)(unsafe.Pointer(pPage)).FminLocal))) {
+ goto __36
}
// Overwrite the old cell with the new if they are the same size.
// We could also try to do this if the old cell is smaller, then add
@@ -52005,42 +52714,42 @@ __34:
// new entry uses overflow pages, as the insertCell() call below is
// necessary to add the PTRMAP_OVERFLOW1 pointer-map entry.
// clearCell never fails when nLocal==nPayload
- if !(oldCell < (((*MemPage)(unsafe.Pointer(pPage)).FaData + uintptr((*MemPage)(unsafe.Pointer(pPage)).FhdrOffset)) + uintptr(10))) {
- goto __36
- }
- return Xsqlite3CorruptError(tls, 74371)
-__36:
- ;
- if !((oldCell + uintptr(*(*int32)(unsafe.Pointer(bp + 92 /* szNew */)))) > (*MemPage)(unsafe.Pointer(pPage)).FaDataEnd) {
+ if !(oldCell < (*MemPage)(unsafe.Pointer(pPage)).FaData+uintptr((*MemPage)(unsafe.Pointer(pPage)).FhdrOffset)+uintptr(10)) {
goto __37
}
- return Xsqlite3CorruptError(tls, 74374)
+ return Xsqlite3CorruptError(tls, 74591)
__37:
;
+ if !(oldCell+uintptr(*(*int32)(unsafe.Pointer(bp + 92))) > (*MemPage)(unsafe.Pointer(pPage)).FaDataEnd) {
+ goto __38
+ }
+ return Xsqlite3CorruptError(tls, 74594)
+__38:
+ ;
libc.Xmemcpy(tls, oldCell, newCell, uint32(*(*int32)(unsafe.Pointer(bp + 92 /* szNew */))))
return SQLITE_OK
-__35:
+__36:
;
dropCell(tls, pPage, idx, int32((*CellInfo)(unsafe.Pointer(bp+96 /* &info1 */)).FnSize), bp+88 /* &rc */)
- if !(*(*int32)(unsafe.Pointer(bp + 88 /* rc */)) != 0) {
- goto __38
+ if !(*(*int32)(unsafe.Pointer(bp + 88)) != 0) {
+ goto __39
}
goto end_insert
-__38:
+__39:
;
goto __30
__29:
- if !((*(*int32)(unsafe.Pointer(bp /* loc */)) < 0) && (int32((*MemPage)(unsafe.Pointer(pPage)).FnCell) > 0)) {
- goto __39
+ if !(*(*int32)(unsafe.Pointer(bp)) < 0 && int32((*MemPage)(unsafe.Pointer(pPage)).FnCell) > 0) {
+ goto __40
}
idx = int32(libc.PreIncUint16(&(*BtCursor)(unsafe.Pointer(pCur)).Fix, 1))
- *(*U8)(unsafe.Pointer(pCur + 1 /* &.curFlags */)) &= libc.Uint8FromInt32((libc.CplInt32(BTCF_ValidNKey)))
- goto __40
-__39:
- ;
+ *(*U8)(unsafe.Pointer(pCur + 1)) &= libc.Uint8FromInt32(libc.CplInt32(BTCF_ValidNKey))
+ goto __41
__40:
;
+__41:
+ ;
__30:
;
insertCell(tls, pPage, idx, newCell, *(*int32)(unsafe.Pointer(bp + 92 /* szNew */)), uintptr(0), uint32(0), bp+88 /* &rc */)
@@ -52066,10 +52775,10 @@ __30:
// row without seeking the cursor. This can be a big performance boost.
(*BtCursor)(unsafe.Pointer(pCur)).Finfo.FnSize = U16(0)
if !((*MemPage)(unsafe.Pointer(pPage)).FnOverflow != 0) {
- goto __41
+ goto __42
}
- *(*U8)(unsafe.Pointer(pCur + 1 /* &.curFlags */)) &= libc.Uint8FromInt32((libc.CplInt32(BTCF_ValidNKey)))
+ *(*U8)(unsafe.Pointer(pCur + 1)) &= libc.Uint8FromInt32(libc.CplInt32(BTCF_ValidNKey))
*(*int32)(unsafe.Pointer(bp + 88 /* rc */)) = balance(tls, pCur)
// Must make sure nOverflow is reset to zero even if the balance()
@@ -52078,31 +52787,31 @@ __30:
// from trying to save the current position of the cursor.
(*MemPage)(unsafe.Pointer((*BtCursor)(unsafe.Pointer(pCur)).FpPage)).FnOverflow = U8(0)
(*BtCursor)(unsafe.Pointer(pCur)).FeState = U8(CURSOR_INVALID)
- if !(((flags & BTREE_SAVEPOSITION) != 0) && (*(*int32)(unsafe.Pointer(bp + 88 /* rc */)) == SQLITE_OK)) {
- goto __42
+ if !(flags&BTREE_SAVEPOSITION != 0 && *(*int32)(unsafe.Pointer(bp + 88)) == SQLITE_OK) {
+ goto __43
}
btreeReleaseAllCursorPages(tls, pCur)
if !((*BtCursor)(unsafe.Pointer(pCur)).FpKeyInfo != 0) {
- goto __43
+ goto __44
}
(*BtCursor)(unsafe.Pointer(pCur)).FpKey = Xsqlite3Malloc(tls, uint64((*BtreePayload)(unsafe.Pointer(pX)).FnKey))
if !((*BtCursor)(unsafe.Pointer(pCur)).FpKey == uintptr(0)) {
- goto __44
+ goto __45
}
*(*int32)(unsafe.Pointer(bp + 88 /* rc */)) = SQLITE_NOMEM
- goto __45
-__44:
- libc.Xmemcpy(tls, (*BtCursor)(unsafe.Pointer(pCur)).FpKey, (*BtreePayload)(unsafe.Pointer(pX)).FpKey, uint32((*BtreePayload)(unsafe.Pointer(pX)).FnKey))
+ goto __46
__45:
+ libc.Xmemcpy(tls, (*BtCursor)(unsafe.Pointer(pCur)).FpKey, (*BtreePayload)(unsafe.Pointer(pX)).FpKey, uint32((*BtreePayload)(unsafe.Pointer(pX)).FnKey))
+__46:
;
-__43:
+__44:
;
(*BtCursor)(unsafe.Pointer(pCur)).FeState = U8(CURSOR_REQUIRESEEK)
(*BtCursor)(unsafe.Pointer(pCur)).FnKey = (*BtreePayload)(unsafe.Pointer(pX)).FnKey
-__42:
+__43:
;
-__41:
+__42:
;
end_insert:
@@ -52122,7 +52831,7 @@ end_insert:
// calling sqlite3BtreeInsert() with the BTREE_PREFORMAT flag specified.
//
// SQLITE_OK is returned if successful, or an SQLite error code otherwise.
-func Xsqlite3BtreeTransferRow(tls *libc.TLS, pDest uintptr, pSrc uintptr, iKey I64) int32 { /* sqlite3.c:74460:20: */
+func Xsqlite3BtreeTransferRow(tls *libc.TLS, pDest uintptr, pSrc uintptr, iKey I64) int32 { /* sqlite3.c:74680:20: */
bp := tls.Alloc(16)
defer tls.Free(16)
@@ -52135,7 +52844,7 @@ func Xsqlite3BtreeTransferRow(tls *libc.TLS, pDest uintptr, pSrc uintptr, iKey I
getCellInfo(tls, pSrc)
aOut += uintptr(func() uint8 {
- if ((*BtCursor)(unsafe.Pointer(pSrc)).Finfo.FnPayload) < U32(0x80) {
+ if (*BtCursor)(unsafe.Pointer(pSrc)).Finfo.FnPayload < U32(0x80) {
return uint8(func() int32 {
*(*U8)(unsafe.Pointer(aOut)) = uint8((*BtCursor)(unsafe.Pointer(pSrc)).Finfo.FnPayload)
return 1
@@ -52148,13 +52857,13 @@ func Xsqlite3BtreeTransferRow(tls *libc.TLS, pDest uintptr, pSrc uintptr, iKey I
}
nIn = U32((*BtCursor)(unsafe.Pointer(pSrc)).Finfo.FnLocal)
aIn = (*BtCursor)(unsafe.Pointer(pSrc)).Finfo.FpPayload
- if (aIn + uintptr(nIn)) > (*MemPage)(unsafe.Pointer((*BtCursor)(unsafe.Pointer(pSrc)).FpPage)).FaDataEnd {
- return Xsqlite3CorruptError(tls, 74474)
+ if aIn+uintptr(nIn) > (*MemPage)(unsafe.Pointer((*BtCursor)(unsafe.Pointer(pSrc)).FpPage)).FaDataEnd {
+ return Xsqlite3CorruptError(tls, 74694)
}
nRem = (*BtCursor)(unsafe.Pointer(pSrc)).Finfo.FnPayload
- if (nIn == nRem) && (nIn < U32((*MemPage)(unsafe.Pointer((*BtCursor)(unsafe.Pointer(pDest)).FpPage)).FmaxLocal)) {
+ if nIn == nRem && nIn < U32((*MemPage)(unsafe.Pointer((*BtCursor)(unsafe.Pointer(pDest)).FpPage)).FmaxLocal) {
libc.Xmemcpy(tls, aOut, aIn, nIn)
- (*BtShared)(unsafe.Pointer(pBt)).FnPreformatSize = (int32(nIn + (U32((int32(aOut) - int32((*BtShared)(unsafe.Pointer(pBt)).FpTmpSpace)) / 1))))
+ (*BtShared)(unsafe.Pointer(pBt)).FnPreformatSize = int32(nIn + U32((int32(aOut)-int32((*BtShared)(unsafe.Pointer(pBt)).FpTmpSpace))/1))
} else {
var pSrcPager uintptr = (*BtShared)(unsafe.Pointer((*BtCursor)(unsafe.Pointer(pSrc)).FpBt)).FpPager
var pPgnoOut uintptr = uintptr(0)
@@ -52164,33 +52873,33 @@ func Xsqlite3BtreeTransferRow(tls *libc.TLS, pDest uintptr, pSrc uintptr, iKey I
var nOut U32 // Size of output buffer aOut[]
nOut = U32(btreePayloadToLocal(tls, (*BtCursor)(unsafe.Pointer(pDest)).FpPage, int64((*BtCursor)(unsafe.Pointer(pSrc)).Finfo.FnPayload)))
- (*BtShared)(unsafe.Pointer(pBt)).FnPreformatSize = (int32(nOut + (U32((int32(aOut) - int32((*BtShared)(unsafe.Pointer(pBt)).FpTmpSpace)) / 1))))
+ (*BtShared)(unsafe.Pointer(pBt)).FnPreformatSize = int32(nOut + U32((int32(aOut)-int32((*BtShared)(unsafe.Pointer(pBt)).FpTmpSpace))/1))
if nOut < (*BtCursor)(unsafe.Pointer(pSrc)).Finfo.FnPayload {
- pPgnoOut = (aOut + uintptr(nOut))
- *(*int32)(unsafe.Pointer(pBt + 88 /* &.nPreformatSize */)) += (4)
+ pPgnoOut = aOut + uintptr(nOut)
+ *(*int32)(unsafe.Pointer(pBt + 88)) += 4
}
if nRem > nIn {
- if ((aIn + uintptr(nIn)) + uintptr(4)) > (*MemPage)(unsafe.Pointer((*BtCursor)(unsafe.Pointer(pSrc)).FpPage)).FaDataEnd {
- return Xsqlite3CorruptError(tls, 74497)
+ if aIn+uintptr(nIn)+uintptr(4) > (*MemPage)(unsafe.Pointer((*BtCursor)(unsafe.Pointer(pSrc)).FpPage)).FaDataEnd {
+ return Xsqlite3CorruptError(tls, 74717)
}
- ovflIn = Xsqlite3Get4byte(tls, ((*BtCursor)(unsafe.Pointer(pSrc)).Finfo.FpPayload + uintptr(nIn)))
+ ovflIn = Xsqlite3Get4byte(tls, (*BtCursor)(unsafe.Pointer(pSrc)).Finfo.FpPayload+uintptr(nIn))
}
- for ok := true; ok; ok = ((nRem > U32(0)) && (*(*int32)(unsafe.Pointer(bp + 12 /* rc */)) == SQLITE_OK)) {
- nRem = nRem - (nOut)
- for ok1 := true; ok1; ok1 = ((*(*int32)(unsafe.Pointer(bp + 12 /* rc */)) == SQLITE_OK) && (nOut > U32(0))) {
+ for ok := true; ok; ok = nRem > U32(0) && *(*int32)(unsafe.Pointer(bp + 12)) == SQLITE_OK {
+ nRem = nRem - nOut
+ for ok1 := true; ok1; ok1 = *(*int32)(unsafe.Pointer(bp + 12)) == SQLITE_OK && nOut > U32(0) {
if nIn > U32(0) {
var nCopy int32 = func() int32 {
- if (nOut) < (nIn) {
+ if nOut < nIn {
return int32(nOut)
}
return int32(nIn)
}()
libc.Xmemcpy(tls, aOut, aIn, uint32(nCopy))
- nOut = nOut - (U32(nCopy))
- nIn = nIn - (U32(nCopy))
+ nOut = nOut - U32(nCopy)
+ nIn = nIn - U32(nCopy)
aOut += uintptr(nCopy)
aIn += uintptr(nCopy)
}
@@ -52198,22 +52907,22 @@ func Xsqlite3BtreeTransferRow(tls *libc.TLS, pDest uintptr, pSrc uintptr, iKey I
Xsqlite3PagerUnref(tls, *(*uintptr)(unsafe.Pointer(bp /* pPageIn */)))
*(*uintptr)(unsafe.Pointer(bp /* pPageIn */)) = uintptr(0)
*(*int32)(unsafe.Pointer(bp + 12 /* rc */)) = Xsqlite3PagerGet(tls, pSrcPager, ovflIn, bp /* &pPageIn */, PAGER_GET_READONLY)
- if *(*int32)(unsafe.Pointer(bp + 12 /* rc */)) == SQLITE_OK {
+ if *(*int32)(unsafe.Pointer(bp + 12)) == SQLITE_OK {
aIn = Xsqlite3PagerGetData(tls, *(*uintptr)(unsafe.Pointer(bp /* pPageIn */)))
ovflIn = Xsqlite3Get4byte(tls, aIn)
aIn += uintptr(4)
- nIn = ((*BtShared)(unsafe.Pointer((*BtCursor)(unsafe.Pointer(pSrc)).FpBt)).FusableSize - U32(4))
+ nIn = (*BtShared)(unsafe.Pointer((*BtCursor)(unsafe.Pointer(pSrc)).FpBt)).FusableSize - U32(4)
}
}
}
- if (*(*int32)(unsafe.Pointer(bp + 12 /* rc */)) == SQLITE_OK) && (nRem > U32(0)) {
+ if *(*int32)(unsafe.Pointer(bp + 12)) == SQLITE_OK && nRem > U32(0) && pPgnoOut != 0 {
// var pgnoNew Pgno at bp+8, 4
*(*uintptr)(unsafe.Pointer(bp + 4 /* pNew */)) = uintptr(0)
*(*int32)(unsafe.Pointer(bp + 12 /* rc */)) = allocateBtreePage(tls, pBt, bp+4 /* &pNew */, bp+8 /* &pgnoNew */, uint32(0), uint8(0))
Xsqlite3Put4byte(tls, pPgnoOut, *(*Pgno)(unsafe.Pointer(bp + 8 /* pgnoNew */)))
- if ((*BtShared)(unsafe.Pointer(pBt)).FautoVacuum != 0) && (pPageOut != 0) {
+ if (*BtShared)(unsafe.Pointer(pBt)).FautoVacuum != 0 && pPageOut != 0 {
ptrmapPut(tls, pBt, *(*Pgno)(unsafe.Pointer(bp + 8 /* pgnoNew */)), uint8(PTRMAP_OVERFLOW2), (*MemPage)(unsafe.Pointer(pPageOut)).Fpgno, bp+12 /* &rc */)
}
releasePage(tls, pPageOut)
@@ -52221,10 +52930,10 @@ func Xsqlite3BtreeTransferRow(tls *libc.TLS, pDest uintptr, pSrc uintptr, iKey I
if pPageOut != 0 {
pPgnoOut = (*MemPage)(unsafe.Pointer(pPageOut)).FaData
Xsqlite3Put4byte(tls, pPgnoOut, uint32(0))
- aOut = (pPgnoOut + 4)
+ aOut = pPgnoOut + 4
nOut = func() uint32 {
- if ((*BtShared)(unsafe.Pointer(pBt)).FusableSize - U32(4)) < (nRem) {
- return ((*BtShared)(unsafe.Pointer(pBt)).FusableSize - U32(4))
+ if (*BtShared)(unsafe.Pointer(pBt)).FusableSize-U32(4) < nRem {
+ return (*BtShared)(unsafe.Pointer(pBt)).FusableSize - U32(4)
}
return nRem
}()
@@ -52254,7 +52963,7 @@ func Xsqlite3BtreeTransferRow(tls *libc.TLS, pDest uintptr, pSrc uintptr, iKey I
// operation on non-FORDELETE cursors is tagged with the AUXDELETE flag.
// The BTREE_AUXDELETE bit is a hint that is not used by this implementation,
// but which might be used by alternative storage engines.
-func Xsqlite3BtreeDelete(tls *libc.TLS, pCur uintptr, flags U8) int32 { /* sqlite3.c:74570:20: */
+func Xsqlite3BtreeDelete(tls *libc.TLS, pCur uintptr, flags U8) int32 { /* sqlite3.c:74790:20: */
bp := tls.Alloc(28)
defer tls.Free(28)
@@ -52268,13 +52977,13 @@ func Xsqlite3BtreeDelete(tls *libc.TLS, pCur uintptr, flags U8) int32 { /* sqlit
var iCellDepth int32 // Depth of node containing pCell
// var info CellInfo at bp, 24
// Size of the cell being deleted
- var bSkipnext int32 = 0 // Leaf cursor in SKIPNEXT state
- var bPreserve U8 = (U8(int32(flags) & BTREE_SAVEPOSITION)) // Keep cursor valid
+ var bSkipnext int32 = 0 // Leaf cursor in SKIPNEXT state
+ var bPreserve U8 = U8(int32(flags) & BTREE_SAVEPOSITION) // Keep cursor valid
if int32((*BtCursor)(unsafe.Pointer(pCur)).FeState) == CURSOR_REQUIRESEEK {
*(*int32)(unsafe.Pointer(bp + 24 /* rc */)) = btreeRestoreCursorPosition(tls, pCur)
- if (*(*int32)(unsafe.Pointer(bp + 24 /* rc */)) != 0) || (int32((*BtCursor)(unsafe.Pointer(pCur)).FeState) != CURSOR_VALID) {
+ if *(*int32)(unsafe.Pointer(bp + 24)) != 0 || int32((*BtCursor)(unsafe.Pointer(pCur)).FeState) != CURSOR_VALID {
return *(*int32)(unsafe.Pointer(bp + 24 /* rc */))
}
}
@@ -52282,8 +52991,8 @@ func Xsqlite3BtreeDelete(tls *libc.TLS, pCur uintptr, flags U8) int32 { /* sqlit
iCellDepth = int32((*BtCursor)(unsafe.Pointer(pCur)).FiPage)
iCellIdx = int32((*BtCursor)(unsafe.Pointer(pCur)).Fix)
pPage = (*BtCursor)(unsafe.Pointer(pCur)).FpPage
- pCell = ((*MemPage)(unsafe.Pointer((pPage))).FaData + uintptr((int32((*MemPage)(unsafe.Pointer((pPage))).FmaskPage) & int32(libc.X__builtin_bswap16(tls, *(*U16)(unsafe.Pointer(((*MemPage)(unsafe.Pointer((pPage))).FaCellIdx + uintptr((2 * (iCellIdx)))))))))))
- if ((*MemPage)(unsafe.Pointer(pPage)).FnFree < 0) && (btreeComputeFreeSpace(tls, pPage) != 0) {
+ pCell = (*MemPage)(unsafe.Pointer(pPage)).FaData + uintptr(int32((*MemPage)(unsafe.Pointer(pPage)).FmaskPage)&int32(libc.X__builtin_bswap16(tls, *(*U16)(unsafe.Pointer((*MemPage)(unsafe.Pointer(pPage)).FaCellIdx + uintptr(2*iCellIdx))))))
+ if (*MemPage)(unsafe.Pointer(pPage)).FnFree < 0 && btreeComputeFreeSpace(tls, pPage) != 0 {
return SQLITE_CORRUPT
}
@@ -52297,13 +53006,13 @@ func Xsqlite3BtreeDelete(tls *libc.TLS, pCur uintptr, flags U8) int32 { /* sqlit
// will be left in CURSOR_SKIPNEXT state pointing to the entry immediately
// before or after the deleted entry. In this case set bSkipnext to true.
if bPreserve != 0 {
- if (!(int32((*MemPage)(unsafe.Pointer(pPage)).Fleaf) != 0) ||
- ((((*MemPage)(unsafe.Pointer(pPage)).FnFree + int32(cellSizePtr(tls, pPage, pCell))) + 2) > (int32(((*BtShared)(unsafe.Pointer(pBt)).FusableSize * U32(2)) / U32(3))))) ||
- (int32((*MemPage)(unsafe.Pointer(pPage)).FnCell) == 1) {
+ if !(int32((*MemPage)(unsafe.Pointer(pPage)).Fleaf) != 0) ||
+ (*MemPage)(unsafe.Pointer(pPage)).FnFree+int32(cellSizePtr(tls, pPage, pCell))+2 > int32((*BtShared)(unsafe.Pointer(pBt)).FusableSize*U32(2)/U32(3)) ||
+ int32((*MemPage)(unsafe.Pointer(pPage)).FnCell) == 1 {
// A b-tree rebalance will be required after deleting this entry.
// Save the cursor key.
*(*int32)(unsafe.Pointer(bp + 24 /* rc */)) = saveCursorKey(tls, pCur)
- if *(*int32)(unsafe.Pointer(bp + 24 /* rc */)) != 0 {
+ if *(*int32)(unsafe.Pointer(bp + 24)) != 0 {
return *(*int32)(unsafe.Pointer(bp + 24 /* rc */))
}
} else {
@@ -52321,23 +53030,23 @@ func Xsqlite3BtreeDelete(tls *libc.TLS, pCur uintptr, flags U8) int32 { /* sqlit
if !(int32((*MemPage)(unsafe.Pointer(pPage)).Fleaf) != 0) {
*(*int32)(unsafe.Pointer(bp + 24 /* rc */)) = Xsqlite3BtreePrevious(tls, pCur, 0)
- if *(*int32)(unsafe.Pointer(bp + 24 /* rc */)) != 0 {
+ if *(*int32)(unsafe.Pointer(bp + 24)) != 0 {
return *(*int32)(unsafe.Pointer(bp + 24 /* rc */))
}
}
// Save the positions of any other cursors open on this table before
// making any modifications.
- if (int32((*BtCursor)(unsafe.Pointer(pCur)).FcurFlags) & BTCF_Multiple) != 0 {
+ if int32((*BtCursor)(unsafe.Pointer(pCur)).FcurFlags)&BTCF_Multiple != 0 {
*(*int32)(unsafe.Pointer(bp + 24 /* rc */)) = saveAllCursors(tls, pBt, (*BtCursor)(unsafe.Pointer(pCur)).FpgnoRoot, pCur)
- if *(*int32)(unsafe.Pointer(bp + 24 /* rc */)) != 0 {
+ if *(*int32)(unsafe.Pointer(bp + 24)) != 0 {
return *(*int32)(unsafe.Pointer(bp + 24 /* rc */))
}
}
// If this is a delete operation to remove a row from a table b-tree,
// invalidate any incrblob cursors open on the row being deleted.
- if ((*BtCursor)(unsafe.Pointer(pCur)).FpKeyInfo == uintptr(0)) && ((*Btree)(unsafe.Pointer(p)).FhasIncrblobCur != 0) {
+ if (*BtCursor)(unsafe.Pointer(pCur)).FpKeyInfo == uintptr(0) && (*Btree)(unsafe.Pointer(p)).FhasIncrblobCur != 0 {
invalidateIncrblobCursors(tls, p, (*BtCursor)(unsafe.Pointer(pCur)).FpgnoRoot, (*BtCursor)(unsafe.Pointer(pCur)).Finfo.FnKey, 0)
}
@@ -52345,7 +53054,7 @@ func Xsqlite3BtreeDelete(tls *libc.TLS, pCur uintptr, flags U8) int32 { /* sqlit
// overflow pages associated with the entry and finally remove the cell
// itself from within the page.
*(*int32)(unsafe.Pointer(bp + 24 /* rc */)) = Xsqlite3PagerWrite(tls, (*MemPage)(unsafe.Pointer(pPage)).FpDbPage)
- if *(*int32)(unsafe.Pointer(bp + 24 /* rc */)) != 0 {
+ if *(*int32)(unsafe.Pointer(bp + 24)) != 0 {
return *(*int32)(unsafe.Pointer(bp + 24 /* rc */))
}
(*struct {
@@ -52358,7 +53067,7 @@ func Xsqlite3BtreeDelete(tls *libc.TLS, pCur uintptr, flags U8) int32 { /* sqlit
}
dropCell(tls, pPage, iCellIdx, int32((*CellInfo)(unsafe.Pointer(bp /* &info */)).FnSize), bp+24 /* &rc */)
- if *(*int32)(unsafe.Pointer(bp + 24 /* rc */)) != 0 {
+ if *(*int32)(unsafe.Pointer(bp + 24)) != 0 {
return *(*int32)(unsafe.Pointer(bp + 24 /* rc */))
}
@@ -52375,18 +53084,18 @@ func Xsqlite3BtreeDelete(tls *libc.TLS, pCur uintptr, flags U8) int32 { /* sqlit
if (*MemPage)(unsafe.Pointer(pLeaf)).FnFree < 0 {
*(*int32)(unsafe.Pointer(bp + 24 /* rc */)) = btreeComputeFreeSpace(tls, pLeaf)
- if *(*int32)(unsafe.Pointer(bp + 24 /* rc */)) != 0 {
+ if *(*int32)(unsafe.Pointer(bp + 24)) != 0 {
return *(*int32)(unsafe.Pointer(bp + 24 /* rc */))
}
}
- if iCellDepth < (int32((*BtCursor)(unsafe.Pointer(pCur)).FiPage) - 1) {
- n = (*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((pCur + 120 /* &.apPage */) + uintptr((iCellDepth+1))*4)))).Fpgno
+ if iCellDepth < int32((*BtCursor)(unsafe.Pointer(pCur)).FiPage)-1 {
+ n = (*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pCur + 120 + uintptr(iCellDepth+1)*4)))).Fpgno
} else {
n = (*MemPage)(unsafe.Pointer((*BtCursor)(unsafe.Pointer(pCur)).FpPage)).Fpgno
}
- pCell = ((*MemPage)(unsafe.Pointer((pLeaf))).FaData + uintptr((int32((*MemPage)(unsafe.Pointer((pLeaf))).FmaskPage) & int32(libc.X__builtin_bswap16(tls, *(*U16)(unsafe.Pointer(((*MemPage)(unsafe.Pointer((pLeaf))).FaCellIdx + uintptr((2 * (int32((*MemPage)(unsafe.Pointer(pLeaf)).FnCell) - 1)))))))))))
- if pCell < ((*MemPage)(unsafe.Pointer(pLeaf)).FaData + 4) {
- return Xsqlite3CorruptError(tls, 74681)
+ pCell = (*MemPage)(unsafe.Pointer(pLeaf)).FaData + uintptr(int32((*MemPage)(unsafe.Pointer(pLeaf)).FmaskPage)&int32(libc.X__builtin_bswap16(tls, *(*U16)(unsafe.Pointer((*MemPage)(unsafe.Pointer(pLeaf)).FaCellIdx + uintptr(2*(int32((*MemPage)(unsafe.Pointer(pLeaf)).FnCell)-1)))))))
+ if pCell < (*MemPage)(unsafe.Pointer(pLeaf)).FaData+4 {
+ return Xsqlite3CorruptError(tls, 74901)
}
nCell = int32((*struct {
f func(*libc.TLS, uintptr, uintptr) U16
@@ -52395,11 +53104,11 @@ func Xsqlite3BtreeDelete(tls *libc.TLS, pCur uintptr, flags U8) int32 { /* sqlit
pTmp = (*BtShared)(unsafe.Pointer(pBt)).FpTmpSpace
*(*int32)(unsafe.Pointer(bp + 24 /* rc */)) = Xsqlite3PagerWrite(tls, (*MemPage)(unsafe.Pointer(pLeaf)).FpDbPage)
- if *(*int32)(unsafe.Pointer(bp + 24 /* rc */)) == SQLITE_OK {
- insertCell(tls, pPage, iCellIdx, (pCell - uintptr(4)), (nCell + 4), pTmp, n, bp+24 /* &rc */)
+ if *(*int32)(unsafe.Pointer(bp + 24)) == SQLITE_OK {
+ insertCell(tls, pPage, iCellIdx, pCell-uintptr(4), nCell+4, pTmp, n, bp+24 /* &rc */)
}
- dropCell(tls, pLeaf, (int32((*MemPage)(unsafe.Pointer(pLeaf)).FnCell) - 1), nCell, bp+24 /* &rc */)
- if *(*int32)(unsafe.Pointer(bp + 24 /* rc */)) != 0 {
+ dropCell(tls, pLeaf, int32((*MemPage)(unsafe.Pointer(pLeaf)).FnCell)-1, nCell, bp+24 /* &rc */)
+ if *(*int32)(unsafe.Pointer(bp + 24)) != 0 {
return *(*int32)(unsafe.Pointer(bp + 24 /* rc */))
}
}
@@ -52420,23 +53129,23 @@ func Xsqlite3BtreeDelete(tls *libc.TLS, pCur uintptr, flags U8) int32 { /* sqlit
// walk the cursor up the tree to the internal node and balance it as
// well.
*(*int32)(unsafe.Pointer(bp + 24 /* rc */)) = balance(tls, pCur)
- if (*(*int32)(unsafe.Pointer(bp + 24 /* rc */)) == SQLITE_OK) && (int32((*BtCursor)(unsafe.Pointer(pCur)).FiPage) > iCellDepth) {
+ if *(*int32)(unsafe.Pointer(bp + 24)) == SQLITE_OK && int32((*BtCursor)(unsafe.Pointer(pCur)).FiPage) > iCellDepth {
releasePageNotNull(tls, (*BtCursor)(unsafe.Pointer(pCur)).FpPage)
(*BtCursor)(unsafe.Pointer(pCur)).FiPage--
for int32((*BtCursor)(unsafe.Pointer(pCur)).FiPage) > iCellDepth {
- releasePage(tls, *(*uintptr)(unsafe.Pointer((pCur + 120 /* &.apPage */) + uintptr(libc.PostDecInt8(&(*BtCursor)(unsafe.Pointer(pCur)).FiPage, 1))*4)))
+ releasePage(tls, *(*uintptr)(unsafe.Pointer(pCur + 120 + uintptr(libc.PostDecInt8(&(*BtCursor)(unsafe.Pointer(pCur)).FiPage, 1))*4)))
}
- (*BtCursor)(unsafe.Pointer(pCur)).FpPage = *(*uintptr)(unsafe.Pointer((pCur + 120 /* &.apPage */) + uintptr((*BtCursor)(unsafe.Pointer(pCur)).FiPage)*4))
+ (*BtCursor)(unsafe.Pointer(pCur)).FpPage = *(*uintptr)(unsafe.Pointer(pCur + 120 + uintptr((*BtCursor)(unsafe.Pointer(pCur)).FiPage)*4))
*(*int32)(unsafe.Pointer(bp + 24 /* rc */)) = balance(tls, pCur)
}
- if *(*int32)(unsafe.Pointer(bp + 24 /* rc */)) == SQLITE_OK {
+ if *(*int32)(unsafe.Pointer(bp + 24)) == SQLITE_OK {
if bSkipnext != 0 {
(*BtCursor)(unsafe.Pointer(pCur)).FeState = U8(CURSOR_SKIPNEXT)
if iCellIdx >= int32((*MemPage)(unsafe.Pointer(pPage)).FnCell) {
(*BtCursor)(unsafe.Pointer(pCur)).FskipNext = -1
- (*BtCursor)(unsafe.Pointer(pCur)).Fix = (U16(int32((*MemPage)(unsafe.Pointer(pPage)).FnCell) - 1))
+ (*BtCursor)(unsafe.Pointer(pCur)).Fix = U16(int32((*MemPage)(unsafe.Pointer(pPage)).FnCell) - 1)
} else {
(*BtCursor)(unsafe.Pointer(pCur)).FskipNext = 1
}
@@ -52446,7 +53155,7 @@ func Xsqlite3BtreeDelete(tls *libc.TLS, pCur uintptr, flags U8) int32 { /* sqlit
btreeReleaseAllCursorPages(tls, pCur)
(*BtCursor)(unsafe.Pointer(pCur)).FeState = U8(CURSOR_REQUIRESEEK)
}
- if *(*int32)(unsafe.Pointer(bp + 24 /* rc */)) == SQLITE_EMPTY {
+ if *(*int32)(unsafe.Pointer(bp + 24)) == SQLITE_EMPTY {
*(*int32)(unsafe.Pointer(bp + 24 /* rc */)) = SQLITE_OK
}
}
@@ -52463,7 +53172,7 @@ func Xsqlite3BtreeDelete(tls *libc.TLS, pCur uintptr, flags U8) int32 { /* sqlit
//
// BTREE_INTKEY|BTREE_LEAFDATA Used for SQL tables with rowid keys
// BTREE_ZERODATA Used for SQL indices
-func btreeCreateTable(tls *libc.TLS, p uintptr, piTable uintptr, createTabFlags int32) int32 { /* sqlite3.c:74755:12: */
+func btreeCreateTable(tls *libc.TLS, p uintptr, piTable uintptr, createTabFlags int32) int32 { /* sqlite3.c:74975:12: */
bp := tls.Alloc(28)
defer tls.Free(28)
@@ -52492,14 +53201,14 @@ func btreeCreateTable(tls *libc.TLS, p uintptr, piTable uintptr, createTabFlags
// root page of the new table should go. meta[3] is the largest root-page
// created so far, so the new root-page is (meta[3]+1).
Xsqlite3BtreeGetMeta(tls, p, BTREE_LARGEST_ROOT_PAGE, bp /* &pgnoRoot */)
- if *(*Pgno)(unsafe.Pointer(bp /* pgnoRoot */)) > btreePagecount(tls, pBt) {
- return Xsqlite3CorruptError(tls, 74789)
+ if *(*Pgno)(unsafe.Pointer(bp)) > btreePagecount(tls, pBt) {
+ return Xsqlite3CorruptError(tls, 75009)
}
*(*Pgno)(unsafe.Pointer(bp /* pgnoRoot */))++
// The new root-page may not be allocated on a pointer-map page, or the
// PENDING_BYTE page.
- for (*(*Pgno)(unsafe.Pointer(bp /* pgnoRoot */)) == ptrmapPageno(tls, pBt, *(*Pgno)(unsafe.Pointer(bp /* pgnoRoot */)))) || (*(*Pgno)(unsafe.Pointer(bp /* pgnoRoot */)) == ((U32(Xsqlite3PendingByte) / ((*BtShared)(unsafe.Pointer(pBt)).FpageSize)) + U32(1))) {
+ for *(*Pgno)(unsafe.Pointer(bp)) == ptrmapPageno(tls, pBt, *(*Pgno)(unsafe.Pointer(bp))) || *(*Pgno)(unsafe.Pointer(bp)) == U32(Xsqlite3PendingByte)/(*BtShared)(unsafe.Pointer(pBt)).FpageSize+U32(1) {
*(*Pgno)(unsafe.Pointer(bp /* pgnoRoot */))++
}
@@ -52507,11 +53216,11 @@ func btreeCreateTable(tls *libc.TLS, p uintptr, piTable uintptr, createTabFlags
// be moved to the allocated page (unless the allocated page happens
// to reside at pgnoRoot).
*(*int32)(unsafe.Pointer(bp + 24 /* rc */)) = allocateBtreePage(tls, pBt, bp+4 /* &pPageMove */, bp+8 /* &pgnoMove */, *(*Pgno)(unsafe.Pointer(bp /* pgnoRoot */)), uint8(BTALLOC_EXACT))
- if *(*int32)(unsafe.Pointer(bp + 24 /* rc */)) != SQLITE_OK {
+ if *(*int32)(unsafe.Pointer(bp + 24)) != SQLITE_OK {
return *(*int32)(unsafe.Pointer(bp + 24 /* rc */))
}
- if *(*Pgno)(unsafe.Pointer(bp + 8 /* pgnoMove */)) != *(*Pgno)(unsafe.Pointer(bp /* pgnoRoot */)) {
+ if *(*Pgno)(unsafe.Pointer(bp + 8)) != *(*Pgno)(unsafe.Pointer(bp)) {
// pgnoRoot is the page that will be used for the root-page of
// the new table (assuming an error did not occur). But we were
// allocated pgnoMove. If required (i.e. if it was not allocated
@@ -52525,20 +53234,20 @@ func btreeCreateTable(tls *libc.TLS, p uintptr, piTable uintptr, createTabFlags
// corresponding to page pgnoRoot.
*(*int32)(unsafe.Pointer(bp + 24 /* rc */)) = saveAllCursors(tls, pBt, uint32(0), uintptr(0))
releasePage(tls, *(*uintptr)(unsafe.Pointer(bp + 4 /* pPageMove */)))
- if *(*int32)(unsafe.Pointer(bp + 24 /* rc */)) != SQLITE_OK {
+ if *(*int32)(unsafe.Pointer(bp + 24)) != SQLITE_OK {
return *(*int32)(unsafe.Pointer(bp + 24 /* rc */))
}
// Move the page currently at pgnoRoot to pgnoMove.
*(*int32)(unsafe.Pointer(bp + 24 /* rc */)) = btreeGetPage(tls, pBt, *(*Pgno)(unsafe.Pointer(bp /* pgnoRoot */)), bp+12 /* &pRoot */, 0)
- if *(*int32)(unsafe.Pointer(bp + 24 /* rc */)) != SQLITE_OK {
+ if *(*int32)(unsafe.Pointer(bp + 24)) != SQLITE_OK {
return *(*int32)(unsafe.Pointer(bp + 24 /* rc */))
}
*(*int32)(unsafe.Pointer(bp + 24 /* rc */)) = ptrmapGet(tls, pBt, *(*Pgno)(unsafe.Pointer(bp /* pgnoRoot */)), bp+16 /* &eType */, bp+20 /* &iPtrPage */)
- if (int32(*(*U8)(unsafe.Pointer(bp + 16 /* eType */))) == PTRMAP_ROOTPAGE) || (int32(*(*U8)(unsafe.Pointer(bp + 16 /* eType */))) == PTRMAP_FREEPAGE) {
- *(*int32)(unsafe.Pointer(bp + 24 /* rc */)) = Xsqlite3CorruptError(tls, 74837)
+ if int32(*(*U8)(unsafe.Pointer(bp + 16))) == PTRMAP_ROOTPAGE || int32(*(*U8)(unsafe.Pointer(bp + 16))) == PTRMAP_FREEPAGE {
+ *(*int32)(unsafe.Pointer(bp + 24 /* rc */)) = Xsqlite3CorruptError(tls, 75057)
}
- if *(*int32)(unsafe.Pointer(bp + 24 /* rc */)) != SQLITE_OK {
+ if *(*int32)(unsafe.Pointer(bp + 24)) != SQLITE_OK {
releasePage(tls, *(*uintptr)(unsafe.Pointer(bp + 12 /* pRoot */)))
return *(*int32)(unsafe.Pointer(bp + 24 /* rc */))
}
@@ -52547,15 +53256,15 @@ func btreeCreateTable(tls *libc.TLS, p uintptr, piTable uintptr, createTabFlags
releasePage(tls, *(*uintptr)(unsafe.Pointer(bp + 12 /* pRoot */)))
// Obtain the page at pgnoRoot
- if *(*int32)(unsafe.Pointer(bp + 24 /* rc */)) != SQLITE_OK {
+ if *(*int32)(unsafe.Pointer(bp + 24)) != SQLITE_OK {
return *(*int32)(unsafe.Pointer(bp + 24 /* rc */))
}
*(*int32)(unsafe.Pointer(bp + 24 /* rc */)) = btreeGetPage(tls, pBt, *(*Pgno)(unsafe.Pointer(bp /* pgnoRoot */)), bp+12 /* &pRoot */, 0)
- if *(*int32)(unsafe.Pointer(bp + 24 /* rc */)) != SQLITE_OK {
+ if *(*int32)(unsafe.Pointer(bp + 24)) != SQLITE_OK {
return *(*int32)(unsafe.Pointer(bp + 24 /* rc */))
}
*(*int32)(unsafe.Pointer(bp + 24 /* rc */)) = Xsqlite3PagerWrite(tls, (*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 12 /* pRoot */)))).FpDbPage)
- if *(*int32)(unsafe.Pointer(bp + 24 /* rc */)) != SQLITE_OK {
+ if *(*int32)(unsafe.Pointer(bp + 24)) != SQLITE_OK {
releasePage(tls, *(*uintptr)(unsafe.Pointer(bp + 12 /* pRoot */)))
return *(*int32)(unsafe.Pointer(bp + 24 /* rc */))
}
@@ -52565,7 +53274,7 @@ func btreeCreateTable(tls *libc.TLS, p uintptr, piTable uintptr, createTabFlags
// Update the pointer-map and meta-data with the new root-page number.
ptrmapPut(tls, pBt, *(*Pgno)(unsafe.Pointer(bp /* pgnoRoot */)), uint8(PTRMAP_ROOTPAGE), uint32(0), bp+24 /* &rc */)
- if *(*int32)(unsafe.Pointer(bp + 24 /* rc */)) != 0 {
+ if *(*int32)(unsafe.Pointer(bp + 24)) != 0 {
releasePage(tls, *(*uintptr)(unsafe.Pointer(bp + 12 /* pRoot */)))
return *(*int32)(unsafe.Pointer(bp + 24 /* rc */))
}
@@ -52575,22 +53284,22 @@ func btreeCreateTable(tls *libc.TLS, p uintptr, piTable uintptr, createTabFlags
// freelist count. Hence, the sqlite3BtreeUpdateMeta() call cannot fail.
*(*int32)(unsafe.Pointer(bp + 24 /* rc */)) = Xsqlite3BtreeUpdateMeta(tls, p, 4, *(*Pgno)(unsafe.Pointer(bp /* pgnoRoot */)))
- if *(*int32)(unsafe.Pointer(bp + 24 /* rc */)) != 0 {
+ if *(*int32)(unsafe.Pointer(bp + 24)) != 0 {
releasePage(tls, *(*uintptr)(unsafe.Pointer(bp + 12 /* pRoot */)))
return *(*int32)(unsafe.Pointer(bp + 24 /* rc */))
}
} else {
*(*int32)(unsafe.Pointer(bp + 24 /* rc */)) = allocateBtreePage(tls, pBt, bp+12 /* &pRoot */, bp /* &pgnoRoot */, uint32(1), uint8(0))
- if *(*int32)(unsafe.Pointer(bp + 24 /* rc */)) != 0 {
+ if *(*int32)(unsafe.Pointer(bp + 24)) != 0 {
return *(*int32)(unsafe.Pointer(bp + 24 /* rc */))
}
}
- if (createTabFlags & BTREE_INTKEY) != 0 {
- ptfFlags = ((PTF_INTKEY | PTF_LEAFDATA) | PTF_LEAF)
+ if createTabFlags&BTREE_INTKEY != 0 {
+ ptfFlags = PTF_INTKEY | PTF_LEAFDATA | PTF_LEAF
} else {
- ptfFlags = (PTF_ZERODATA | PTF_LEAF)
+ ptfFlags = PTF_ZERODATA | PTF_LEAF
}
zeroPage(tls, *(*uintptr)(unsafe.Pointer(bp + 12 /* pRoot */)), ptfFlags)
Xsqlite3PagerUnref(tls, (*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 12 /* pRoot */)))).FpDbPage)
@@ -52599,7 +53308,7 @@ func btreeCreateTable(tls *libc.TLS, p uintptr, piTable uintptr, createTabFlags
return SQLITE_OK
}
-func Xsqlite3BtreeCreateTable(tls *libc.TLS, p uintptr, piTable uintptr, flags int32) int32 { /* sqlite3.c:74900:20: */
+func Xsqlite3BtreeCreateTable(tls *libc.TLS, p uintptr, piTable uintptr, flags int32) int32 { /* sqlite3.c:75120:20: */
var rc int32
Xsqlite3BtreeEnter(tls, p)
rc = btreeCreateTable(tls, p, piTable, flags)
@@ -52609,7 +53318,7 @@ func Xsqlite3BtreeCreateTable(tls *libc.TLS, p uintptr, piTable uintptr, flags i
// Erase the given database page and all its children. Return
// the page to the freelist.
-func clearDatabasePage(tls *libc.TLS, pBt uintptr, pgno Pgno, freePageFlag int32, pnChange uintptr) int32 { /* sqlite3.c:74912:12: */
+func clearDatabasePage(tls *libc.TLS, pBt uintptr, pgno Pgno, freePageFlag int32, pnChange uintptr) int32 { /* sqlite3.c:75132:12: */
bp := tls.Alloc(36)
defer tls.Free(36)
@@ -52625,36 +53334,36 @@ func clearDatabasePage(tls *libc.TLS, pBt uintptr, pgno Pgno, freePageFlag int32
if !(pgno > btreePagecount(tls, pBt)) {
goto __1
}
- return Xsqlite3CorruptError(tls, 74927)
+ return Xsqlite3CorruptError(tls, 75147)
__1:
;
*(*int32)(unsafe.Pointer(bp + 32 /* rc */)) = getAndInitPage(tls, pBt, pgno, bp /* &pPage */, uintptr(0), 0)
- if !(*(*int32)(unsafe.Pointer(bp + 32 /* rc */)) != 0) {
+ if !(*(*int32)(unsafe.Pointer(bp + 32)) != 0) {
goto __2
}
return *(*int32)(unsafe.Pointer(bp + 32 /* rc */))
__2:
;
- if !((*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* pPage */)))).FbBusy != 0) {
+ if !(int32((*BtShared)(unsafe.Pointer(pBt)).FopenFlags)&BTREE_SINGLE == 0 &&
+ Xsqlite3PagerPageRefcount(tls, (*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FpDbPage) != 1) {
goto __3
}
- *(*int32)(unsafe.Pointer(bp + 32 /* rc */)) = Xsqlite3CorruptError(tls, 74932)
+ *(*int32)(unsafe.Pointer(bp + 32 /* rc */)) = Xsqlite3CorruptError(tls, 75154)
goto cleardatabasepage_out
__3:
;
- (*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* pPage */)))).FbBusy = U8(1)
hdr = int32((*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* pPage */)))).FhdrOffset)
i = 0
__4:
- if !(i < int32((*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* pPage */)))).FnCell)) {
+ if !(i < int32((*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FnCell)) {
goto __6
}
- pCell = ((*MemPage)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(bp /* pPage */))))).FaData + uintptr((int32((*MemPage)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(bp /* pPage */))))).FmaskPage) & int32(libc.X__builtin_bswap16(tls, *(*U16)(unsafe.Pointer(((*MemPage)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(bp /* pPage */))))).FaCellIdx + uintptr((2 * (i)))))))))))
- if !(!(int32((*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* pPage */)))).Fleaf) != 0)) {
+ pCell = (*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FaData + uintptr(int32((*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FmaskPage)&int32(libc.X__builtin_bswap16(tls, *(*U16)(unsafe.Pointer((*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FaCellIdx + uintptr(2*i))))))
+ if !!(int32((*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).Fleaf) != 0) {
goto __7
}
*(*int32)(unsafe.Pointer(bp + 32 /* rc */)) = clearDatabasePage(tls, pBt, Xsqlite3Get4byte(tls, pCell), 1, pnChange)
- if !(*(*int32)(unsafe.Pointer(bp + 32 /* rc */)) != 0) {
+ if !(*(*int32)(unsafe.Pointer(bp + 32)) != 0) {
goto __8
}
goto cleardatabasepage_out
@@ -52675,7 +53384,7 @@ __9:
__10:
;
- if !(*(*int32)(unsafe.Pointer(bp + 32 /* rc */)) != 0) {
+ if !(*(*int32)(unsafe.Pointer(bp + 32)) != 0) {
goto __11
}
goto cleardatabasepage_out
@@ -52688,42 +53397,47 @@ __5:
goto __6
__6:
;
- if !(!(int32((*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* pPage */)))).Fleaf) != 0)) {
+ if !!(int32((*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).Fleaf) != 0) {
goto __12
}
- *(*int32)(unsafe.Pointer(bp + 32 /* rc */)) = clearDatabasePage(tls, pBt, Xsqlite3Get4byte(tls, ((*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* pPage */)))).FaData+uintptr((hdr+8)))), 1, pnChange)
- if !(*(*int32)(unsafe.Pointer(bp + 32 /* rc */)) != 0) {
+ *(*int32)(unsafe.Pointer(bp + 32 /* rc */)) = clearDatabasePage(tls, pBt, Xsqlite3Get4byte(tls, (*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FaData+uintptr(hdr+8)), 1, pnChange)
+ if !(*(*int32)(unsafe.Pointer(bp + 32)) != 0) {
goto __13
}
goto cleardatabasepage_out
__13:
;
+ if !((*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FintKey != 0) {
+ goto __14
+ }
+ pnChange = uintptr(0)
+__14:
+ ;
__12:
;
if !(pnChange != 0) {
- goto __14
+ goto __15
}
- *(*int32)(unsafe.Pointer(pnChange)) += (int32((*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* pPage */)))).FnCell))
-__14:
+ *(*I64)(unsafe.Pointer(pnChange)) += I64((*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FnCell)
+__15:
;
if !(freePageFlag != 0) {
- goto __15
+ goto __16
}
freePage(tls, *(*uintptr)(unsafe.Pointer(bp /* pPage */)), bp+32 /* &rc */)
- goto __16
-__15:
- if !((libc.AssignPtrInt32(bp+32 /* rc */, Xsqlite3PagerWrite(tls, (*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* pPage */)))).FpDbPage))) == 0) {
- goto __17
+ goto __17
+__16:
+ if !(libc.AssignPtrInt32(bp+32, Xsqlite3PagerWrite(tls, (*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FpDbPage)) == 0) {
+ goto __18
}
- zeroPage(tls, *(*uintptr)(unsafe.Pointer(bp /* pPage */)), (int32(*(*U8)(unsafe.Pointer((*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* pPage */)))).FaData + uintptr(hdr)))) | PTF_LEAF))
-__17:
+ zeroPage(tls, *(*uintptr)(unsafe.Pointer(bp /* pPage */)), int32(*(*U8)(unsafe.Pointer((*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FaData + uintptr(hdr))))|PTF_LEAF)
+__18:
;
-__16:
+__17:
;
cleardatabasepage_out:
- (*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* pPage */)))).FbBusy = U8(0)
releasePage(tls, *(*uintptr)(unsafe.Pointer(bp /* pPage */)))
return *(*int32)(unsafe.Pointer(bp + 32 /* rc */))
}
@@ -52738,7 +53452,7 @@ cleardatabasepage_out:
//
// If pnChange is not NULL, then the integer value pointed to by pnChange
// is incremented by the number of entries in the table.
-func Xsqlite3BtreeClearTable(tls *libc.TLS, p uintptr, iTable int32, pnChange uintptr) int32 { /* sqlite3.c:74978:20: */
+func Xsqlite3BtreeClearTable(tls *libc.TLS, p uintptr, iTable int32, pnChange uintptr) int32 { /* sqlite3.c:75199:20: */
var rc int32
var pBt uintptr = (*Btree)(unsafe.Pointer(p)).FpBt
Xsqlite3BtreeEnter(tls, p)
@@ -52761,7 +53475,7 @@ func Xsqlite3BtreeClearTable(tls *libc.TLS, p uintptr, iTable int32, pnChange ui
// Delete all information from the single table that pCur is open on.
//
// This routine only work for pCur on an ephemeral table.
-func Xsqlite3BtreeClearTableOfCursor(tls *libc.TLS, pCur uintptr) int32 { /* sqlite3.c:75004:20: */
+func Xsqlite3BtreeClearTableOfCursor(tls *libc.TLS, pCur uintptr) int32 { /* sqlite3.c:75225:20: */
return Xsqlite3BtreeClearTable(tls, (*BtCursor)(unsafe.Pointer(pCur)).FpBtree, int32((*BtCursor)(unsafe.Pointer(pCur)).FpgnoRoot), uintptr(0))
}
@@ -52783,7 +53497,7 @@ func Xsqlite3BtreeClearTableOfCursor(tls *libc.TLS, pCur uintptr) int32 { /* sql
// the move. If no page gets moved, *piMoved is set to 0.
// The last root page is recorded in meta[3] and the value of
// meta[3] is updated by this procedure.
-func btreeDropTable(tls *libc.TLS, p uintptr, iTable Pgno, piMoved uintptr) int32 { /* sqlite3.c:75028:12: */
+func btreeDropTable(tls *libc.TLS, p uintptr, iTable Pgno, piMoved uintptr) int32 { /* sqlite3.c:75249:12: */
bp := tls.Alloc(16)
defer tls.Free(16)
@@ -52793,15 +53507,15 @@ func btreeDropTable(tls *libc.TLS, p uintptr, iTable Pgno, piMoved uintptr) int3
var pBt uintptr = (*Btree)(unsafe.Pointer(p)).FpBt
if iTable > btreePagecount(tls, pBt) {
- return Xsqlite3CorruptError(tls, 75037)
+ return Xsqlite3CorruptError(tls, 75258)
}
- *(*int32)(unsafe.Pointer(bp + 8 /* rc */)) = btreeGetPage(tls, pBt, iTable, bp /* &pPage */, 0)
- if *(*int32)(unsafe.Pointer(bp + 8 /* rc */)) != 0 {
+ *(*int32)(unsafe.Pointer(bp + 8 /* rc */)) = Xsqlite3BtreeClearTable(tls, p, int32(iTable), uintptr(0))
+ if *(*int32)(unsafe.Pointer(bp + 8)) != 0 {
return *(*int32)(unsafe.Pointer(bp + 8 /* rc */))
}
- *(*int32)(unsafe.Pointer(bp + 8 /* rc */)) = Xsqlite3BtreeClearTable(tls, p, int32(iTable), uintptr(0))
- if *(*int32)(unsafe.Pointer(bp + 8 /* rc */)) != 0 {
+ *(*int32)(unsafe.Pointer(bp + 8 /* rc */)) = btreeGetPage(tls, pBt, iTable, bp /* &pPage */, 0)
+ if *(*int32)(unsafe.Pointer(bp + 8)) != 0 {
releasePage(tls, *(*uintptr)(unsafe.Pointer(bp /* pPage */)))
return *(*int32)(unsafe.Pointer(bp + 8 /* rc */))
}
@@ -52813,12 +53527,12 @@ func btreeDropTable(tls *libc.TLS, p uintptr, iTable Pgno, piMoved uintptr) int3
Xsqlite3BtreeGetMeta(tls, p, BTREE_LARGEST_ROOT_PAGE, bp+4 /* &maxRootPgno */)
- if iTable == *(*Pgno)(unsafe.Pointer(bp + 4 /* maxRootPgno */)) {
+ if iTable == *(*Pgno)(unsafe.Pointer(bp + 4)) {
// If the table being dropped is the table with the largest root-page
// number in the database, put the root page on the free list.
freePage(tls, *(*uintptr)(unsafe.Pointer(bp /* pPage */)), bp+8 /* &rc */)
releasePage(tls, *(*uintptr)(unsafe.Pointer(bp /* pPage */)))
- if *(*int32)(unsafe.Pointer(bp + 8 /* rc */)) != SQLITE_OK {
+ if *(*int32)(unsafe.Pointer(bp + 8)) != SQLITE_OK {
return *(*int32)(unsafe.Pointer(bp + 8 /* rc */))
}
} else {
@@ -52829,19 +53543,19 @@ func btreeDropTable(tls *libc.TLS, p uintptr, iTable Pgno, piMoved uintptr) int3
releasePage(tls, *(*uintptr)(unsafe.Pointer(bp /* pPage */)))
*(*int32)(unsafe.Pointer(bp + 8 /* rc */)) = btreeGetPage(tls, pBt, *(*Pgno)(unsafe.Pointer(bp + 4 /* maxRootPgno */)), bp+12 /* &pMove */, 0)
- if *(*int32)(unsafe.Pointer(bp + 8 /* rc */)) != SQLITE_OK {
+ if *(*int32)(unsafe.Pointer(bp + 8)) != SQLITE_OK {
return *(*int32)(unsafe.Pointer(bp + 8 /* rc */))
}
*(*int32)(unsafe.Pointer(bp + 8 /* rc */)) = relocatePage(tls, pBt, *(*uintptr)(unsafe.Pointer(bp + 12 /* pMove */)), uint8(PTRMAP_ROOTPAGE), uint32(0), iTable, 0)
releasePage(tls, *(*uintptr)(unsafe.Pointer(bp + 12 /* pMove */)))
- if *(*int32)(unsafe.Pointer(bp + 8 /* rc */)) != SQLITE_OK {
+ if *(*int32)(unsafe.Pointer(bp + 8)) != SQLITE_OK {
return *(*int32)(unsafe.Pointer(bp + 8 /* rc */))
}
*(*uintptr)(unsafe.Pointer(bp + 12 /* pMove */)) = uintptr(0)
*(*int32)(unsafe.Pointer(bp + 8 /* rc */)) = btreeGetPage(tls, pBt, *(*Pgno)(unsafe.Pointer(bp + 4 /* maxRootPgno */)), bp+12 /* &pMove */, 0)
freePage(tls, *(*uintptr)(unsafe.Pointer(bp + 12 /* pMove */)), bp+8 /* &rc */)
releasePage(tls, *(*uintptr)(unsafe.Pointer(bp + 12 /* pMove */)))
- if *(*int32)(unsafe.Pointer(bp + 8 /* rc */)) != SQLITE_OK {
+ if *(*int32)(unsafe.Pointer(bp + 8)) != SQLITE_OK {
return *(*int32)(unsafe.Pointer(bp + 8 /* rc */))
}
*(*int32)(unsafe.Pointer(piMoved)) = int32(*(*Pgno)(unsafe.Pointer(bp + 4 /* maxRootPgno */)))
@@ -52852,8 +53566,8 @@ func btreeDropTable(tls *libc.TLS, p uintptr, iTable Pgno, piMoved uintptr) int3
// be a root-page number, less one again if that is the
// PENDING_BYTE_PAGE.
*(*Pgno)(unsafe.Pointer(bp + 4 /* maxRootPgno */))--
- for (*(*Pgno)(unsafe.Pointer(bp + 4 /* maxRootPgno */)) == ((U32(Xsqlite3PendingByte) / ((*BtShared)(unsafe.Pointer(pBt)).FpageSize)) + U32(1))) ||
- (ptrmapPageno(tls, pBt, *(*Pgno)(unsafe.Pointer(bp + 4 /* maxRootPgno */))) == (*(*Pgno)(unsafe.Pointer(bp + 4 /* maxRootPgno */)))) {
+ for *(*Pgno)(unsafe.Pointer(bp + 4)) == U32(Xsqlite3PendingByte)/(*BtShared)(unsafe.Pointer(pBt)).FpageSize+U32(1) ||
+ ptrmapPageno(tls, pBt, *(*Pgno)(unsafe.Pointer(bp + 4))) == *(*Pgno)(unsafe.Pointer(bp + 4)) {
*(*Pgno)(unsafe.Pointer(bp + 4 /* maxRootPgno */))--
}
@@ -52865,7 +53579,7 @@ func btreeDropTable(tls *libc.TLS, p uintptr, iTable Pgno, piMoved uintptr) int3
return *(*int32)(unsafe.Pointer(bp + 8 /* rc */))
}
-func Xsqlite3BtreeDropTable(tls *libc.TLS, p uintptr, iTable int32, piMoved uintptr) int32 { /* sqlite3.c:75113:20: */
+func Xsqlite3BtreeDropTable(tls *libc.TLS, p uintptr, iTable int32, piMoved uintptr) int32 { /* sqlite3.c:75334:20: */
var rc int32
Xsqlite3BtreeEnter(tls, p)
rc = btreeDropTable(tls, p, uint32(iTable), piMoved)
@@ -52891,15 +53605,15 @@ func Xsqlite3BtreeDropTable(tls *libc.TLS, p uintptr, iTable int32, piMoved uint
// database file. It is a number computed by the pager. But its access
// pattern is the same as header meta values, and so it is convenient to
// read it from this routine.
-func Xsqlite3BtreeGetMeta(tls *libc.TLS, p uintptr, idx int32, pMeta uintptr) { /* sqlite3.c:75142:21: */
+func Xsqlite3BtreeGetMeta(tls *libc.TLS, p uintptr, idx int32, pMeta uintptr) { /* sqlite3.c:75363:21: */
var pBt uintptr = (*Btree)(unsafe.Pointer(p)).FpBt
Xsqlite3BtreeEnter(tls, p)
if idx == BTREE_DATA_VERSION {
- *(*U32)(unsafe.Pointer(pMeta)) = (Xsqlite3PagerDataVersion(tls, (*BtShared)(unsafe.Pointer(pBt)).FpPager) + (*Btree)(unsafe.Pointer(p)).FiBDataVersion)
+ *(*U32)(unsafe.Pointer(pMeta)) = Xsqlite3PagerDataVersion(tls, (*BtShared)(unsafe.Pointer(pBt)).FpPager) + (*Btree)(unsafe.Pointer(p)).FiBDataVersion
} else {
- *(*U32)(unsafe.Pointer(pMeta)) = Xsqlite3Get4byte(tls, ((*MemPage)(unsafe.Pointer((*BtShared)(unsafe.Pointer(pBt)).FpPage1)).FaData + uintptr((36 + (idx * 4)))))
+ *(*U32)(unsafe.Pointer(pMeta)) = Xsqlite3Get4byte(tls, (*MemPage)(unsafe.Pointer((*BtShared)(unsafe.Pointer(pBt)).FpPage1)).FaData+uintptr(36+idx*4))
}
// If auto-vacuum is disabled in this build and this is an auto-vacuum
@@ -52910,7 +53624,7 @@ func Xsqlite3BtreeGetMeta(tls *libc.TLS, p uintptr, idx int32, pMeta uintptr) {
// Write meta-information back into the database. Meta[0] is
// read-only and may not be written.
-func Xsqlite3BtreeUpdateMeta(tls *libc.TLS, p uintptr, idx int32, iMeta U32) int32 { /* sqlite3.c:75172:20: */
+func Xsqlite3BtreeUpdateMeta(tls *libc.TLS, p uintptr, idx int32, iMeta U32) int32 { /* sqlite3.c:75393:20: */
var pBt uintptr = (*Btree)(unsafe.Pointer(p)).FpBt
var pP1 uintptr
var rc int32
@@ -52920,7 +53634,7 @@ func Xsqlite3BtreeUpdateMeta(tls *libc.TLS, p uintptr, idx int32, iMeta U32) int
pP1 = (*MemPage)(unsafe.Pointer((*BtShared)(unsafe.Pointer(pBt)).FpPage1)).FaData
rc = Xsqlite3PagerWrite(tls, (*MemPage)(unsafe.Pointer((*BtShared)(unsafe.Pointer(pBt)).FpPage1)).FpDbPage)
if rc == SQLITE_OK {
- Xsqlite3Put4byte(tls, (pP1 + uintptr((36 + (idx * 4)))), iMeta)
+ Xsqlite3Put4byte(tls, pP1+uintptr(36+idx*4), iMeta)
if idx == BTREE_INCR_VACUUM {
(*BtShared)(unsafe.Pointer(pBt)).FincrVacuum = U8(iMeta)
@@ -52936,7 +53650,7 @@ func Xsqlite3BtreeUpdateMeta(tls *libc.TLS, p uintptr, idx int32, iMeta U32) int
// SQLITE_OK is returned if the operation is successfully executed.
// Otherwise, if an error is encountered (i.e. an IO error or database
// corruption) an SQLite error code is returned.
-func Xsqlite3BtreeCount(tls *libc.TLS, db uintptr, pCur uintptr, pnEntry uintptr) int32 { /* sqlite3.c:75204:20: */
+func Xsqlite3BtreeCount(tls *libc.TLS, db uintptr, pCur uintptr, pnEntry uintptr) int32 { /* sqlite3.c:75425:20: */
var nEntry I64 = int64(0) // Value to return in *pnEntry
var rc int32 // Return code
@@ -52948,7 +53662,7 @@ func Xsqlite3BtreeCount(tls *libc.TLS, db uintptr, pCur uintptr, pnEntry uintptr
// Unless an error occurs, the following loop runs one iteration for each
// page in the B-Tree structure (not including overflow pages).
- for (rc == SQLITE_OK) && !(libc.AtomicLoadNInt32((db+288 /* &.u1 */ /* &.isInterrupted */), 0) != 0) {
+ for rc == SQLITE_OK && !(libc.AtomicLoadNInt32(db+312, 0) != 0) {
var iIdx int32 // Index of child node in parent
var pPage uintptr // Current page of the b-tree
@@ -52956,8 +53670,8 @@ func Xsqlite3BtreeCount(tls *libc.TLS, db uintptr, pCur uintptr, pnEntry uintptr
// this page contains countable entries. Increment the entry counter
// accordingly.
pPage = (*BtCursor)(unsafe.Pointer(pCur)).FpPage
- if ((*MemPage)(unsafe.Pointer(pPage)).Fleaf != 0) || !(int32((*MemPage)(unsafe.Pointer(pPage)).FintKey) != 0) {
- nEntry = nEntry + (I64((*MemPage)(unsafe.Pointer(pPage)).FnCell))
+ if (*MemPage)(unsafe.Pointer(pPage)).Fleaf != 0 || !(int32((*MemPage)(unsafe.Pointer(pPage)).FintKey) != 0) {
+ nEntry = nEntry + I64((*MemPage)(unsafe.Pointer(pPage)).FnCell)
}
// pPage is a leaf node. This loop navigates the cursor so that it
@@ -52970,7 +53684,7 @@ func Xsqlite3BtreeCount(tls *libc.TLS, db uintptr, pCur uintptr, pnEntry uintptr
// If all pages in the tree have been visited, return SQLITE_OK to the
// caller.
if (*MemPage)(unsafe.Pointer(pPage)).Fleaf != 0 {
- for ok := true; ok; ok = (int32((*BtCursor)(unsafe.Pointer(pCur)).Fix) >= int32((*MemPage)(unsafe.Pointer((*BtCursor)(unsafe.Pointer(pCur)).FpPage)).FnCell)) {
+ for ok := true; ok; ok = int32((*BtCursor)(unsafe.Pointer(pCur)).Fix) >= int32((*MemPage)(unsafe.Pointer((*BtCursor)(unsafe.Pointer(pCur)).FpPage)).FnCell) {
if int32((*BtCursor)(unsafe.Pointer(pCur)).FiPage) == 0 {
// All pages of the b-tree have been visited. Return successfully.
*(*I64)(unsafe.Pointer(pnEntry)) = nEntry
@@ -52987,9 +53701,9 @@ func Xsqlite3BtreeCount(tls *libc.TLS, db uintptr, pCur uintptr, pnEntry uintptr
// points at. This is the right-child if (iIdx==pPage->nCell).
iIdx = int32((*BtCursor)(unsafe.Pointer(pCur)).Fix)
if iIdx == int32((*MemPage)(unsafe.Pointer(pPage)).FnCell) {
- rc = moveToChild(tls, pCur, Xsqlite3Get4byte(tls, ((*MemPage)(unsafe.Pointer(pPage)).FaData+uintptr((int32((*MemPage)(unsafe.Pointer(pPage)).FhdrOffset)+8)))))
+ rc = moveToChild(tls, pCur, Xsqlite3Get4byte(tls, (*MemPage)(unsafe.Pointer(pPage)).FaData+uintptr(int32((*MemPage)(unsafe.Pointer(pPage)).FhdrOffset)+8)))
} else {
- rc = moveToChild(tls, pCur, Xsqlite3Get4byte(tls, ((*MemPage)(unsafe.Pointer((pPage))).FaData+uintptr((int32((*MemPage)(unsafe.Pointer((pPage))).FmaskPage)&int32(libc.X__builtin_bswap16(tls, *(*U16)(unsafe.Pointer(((*MemPage)(unsafe.Pointer((pPage))).FaCellIdx + uintptr((2 * (iIdx)))))))))))))
+ rc = moveToChild(tls, pCur, Xsqlite3Get4byte(tls, (*MemPage)(unsafe.Pointer(pPage)).FaData+uintptr(int32((*MemPage)(unsafe.Pointer(pPage)).FmaskPage)&int32(libc.X__builtin_bswap16(tls, *(*U16)(unsafe.Pointer((*MemPage)(unsafe.Pointer(pPage)).FaCellIdx + uintptr(2*iIdx))))))))
}
}
@@ -52999,12 +53713,12 @@ func Xsqlite3BtreeCount(tls *libc.TLS, db uintptr, pCur uintptr, pnEntry uintptr
// Return the pager associated with a BTree. This routine is used for
// testing and debugging only.
-func Xsqlite3BtreePager(tls *libc.TLS, p uintptr) uintptr { /* sqlite3.c:75273:22: */
+func Xsqlite3BtreePager(tls *libc.TLS, p uintptr) uintptr { /* sqlite3.c:75494:22: */
return (*BtShared)(unsafe.Pointer((*Btree)(unsafe.Pointer(p)).FpBt)).FpPager
}
// Append a message to the error message string.
-func checkAppendMsg(tls *libc.TLS, pCheck uintptr, zFormat uintptr, va uintptr) { /* sqlite3.c:75281:13: */
+func checkAppendMsg(tls *libc.TLS, pCheck uintptr, zFormat uintptr, va uintptr) { /* sqlite3.c:75502:13: */
bp := tls.Alloc(16)
defer tls.Free(16)
@@ -53017,12 +53731,12 @@ func checkAppendMsg(tls *libc.TLS, pCheck uintptr, zFormat uintptr, va uintptr)
(*IntegrityCk)(unsafe.Pointer(pCheck)).FnErr++
ap = va
if (*IntegrityCk)(unsafe.Pointer(pCheck)).FerrMsg.FnChar != 0 {
- Xsqlite3_str_append(tls, (pCheck + 40 /* &.errMsg */), ts+3171 /* "\n" */, 1)
+ Xsqlite3_str_append(tls, pCheck+40, ts+3982 /* "\n" */, 1)
}
if (*IntegrityCk)(unsafe.Pointer(pCheck)).FzPfx != 0 {
- Xsqlite3_str_appendf(tls, (pCheck + 40 /* &.errMsg */), (*IntegrityCk)(unsafe.Pointer(pCheck)).FzPfx, libc.VaList(bp, (*IntegrityCk)(unsafe.Pointer(pCheck)).Fv1, (*IntegrityCk)(unsafe.Pointer(pCheck)).Fv2))
+ Xsqlite3_str_appendf(tls, pCheck+40, (*IntegrityCk)(unsafe.Pointer(pCheck)).FzPfx, libc.VaList(bp, (*IntegrityCk)(unsafe.Pointer(pCheck)).Fv1, (*IntegrityCk)(unsafe.Pointer(pCheck)).Fv2))
}
- Xsqlite3_str_vappendf(tls, (pCheck + 40 /* &.errMsg */), zFormat, ap)
+ Xsqlite3_str_vappendf(tls, pCheck+40, zFormat, ap)
_ = ap
if int32((*IntegrityCk)(unsafe.Pointer(pCheck)).FerrMsg.FaccError) == SQLITE_NOMEM {
(*IntegrityCk)(unsafe.Pointer(pCheck)).FbOomFault = 1
@@ -53031,15 +53745,15 @@ func checkAppendMsg(tls *libc.TLS, pCheck uintptr, zFormat uintptr, va uintptr)
// Return non-zero if the bit in the IntegrityCk.aPgRef[] array that
// corresponds to page iPg is already set.
-func getPageReferenced(tls *libc.TLS, pCheck uintptr, iPg Pgno) int32 { /* sqlite3.c:75311:12: */
+func getPageReferenced(tls *libc.TLS, pCheck uintptr, iPg Pgno) int32 { /* sqlite3.c:75532:12: */
- return (int32(*(*U8)(unsafe.Pointer((*IntegrityCk)(unsafe.Pointer(pCheck)).FaPgRef + uintptr((iPg / Pgno(8)))))) & (int32(1) << (iPg & Pgno(0x07))))
+ return int32(*(*U8)(unsafe.Pointer((*IntegrityCk)(unsafe.Pointer(pCheck)).FaPgRef + uintptr(iPg/Pgno(8))))) & (int32(1) << (iPg & Pgno(0x07)))
}
// Set the bit in the IntegrityCk.aPgRef[] array that corresponds to page iPg.
-func setPageReferenced(tls *libc.TLS, pCheck uintptr, iPg Pgno) { /* sqlite3.c:75319:13: */
+func setPageReferenced(tls *libc.TLS, pCheck uintptr, iPg Pgno) { /* sqlite3.c:75540:13: */
- *(*U8)(unsafe.Pointer((*IntegrityCk)(unsafe.Pointer(pCheck)).FaPgRef + uintptr((iPg / Pgno(8))))) |= U8((int32(1) << (iPg & Pgno(0x07))))
+ *(*U8)(unsafe.Pointer((*IntegrityCk)(unsafe.Pointer(pCheck)).FaPgRef + uintptr(iPg/Pgno(8)))) |= U8(int32(1) << (iPg & Pgno(0x07)))
}
// Add 1 to the reference count for page iPage. If this is the second
@@ -53048,19 +53762,19 @@ func setPageReferenced(tls *libc.TLS, pCheck uintptr, iPg Pgno) { /* sqlite3.c:7
// if this is the first reference to the page.
//
// Also check that the page number is in bounds.
-func checkRef(tls *libc.TLS, pCheck uintptr, iPage Pgno) int32 { /* sqlite3.c:75333:12: */
+func checkRef(tls *libc.TLS, pCheck uintptr, iPage Pgno) int32 { /* sqlite3.c:75554:12: */
bp := tls.Alloc(16)
defer tls.Free(16)
- if (iPage > (*IntegrityCk)(unsafe.Pointer(pCheck)).FnPage) || (iPage == Pgno(0)) {
- checkAppendMsg(tls, pCheck, ts+3173 /* "invalid page num..." */, libc.VaList(bp, iPage))
+ if iPage > (*IntegrityCk)(unsafe.Pointer(pCheck)).FnPage || iPage == Pgno(0) {
+ checkAppendMsg(tls, pCheck, ts+3984 /* "invalid page num..." */, libc.VaList(bp, iPage))
return 1
}
if getPageReferenced(tls, pCheck, iPage) != 0 {
- checkAppendMsg(tls, pCheck, ts+3196 /* "2nd reference to..." */, libc.VaList(bp+8, iPage))
+ checkAppendMsg(tls, pCheck, ts+4007 /* "2nd reference to..." */, libc.VaList(bp+8, iPage))
return 1
}
- if libc.AtomicLoadNInt32(((*IntegrityCk)(unsafe.Pointer(pCheck)).Fdb+288 /* &.u1 */ /* &.isInterrupted */), 0) != 0 {
+ if libc.AtomicLoadNInt32((*IntegrityCk)(unsafe.Pointer(pCheck)).Fdb+312, 0) != 0 {
return 1
}
setPageReferenced(tls, pCheck, iPage)
@@ -53070,7 +53784,7 @@ func checkRef(tls *libc.TLS, pCheck uintptr, iPage Pgno) int32 { /* sqlite3.c:75
// Check that the entry in the pointer-map for page iChild maps to
// page iParent, pointer type ptrType. If not, append an error message
// to pCheck.
-func checkPtrmap(tls *libc.TLS, pCheck uintptr, iChild Pgno, eType U8, iParent Pgno) { /* sqlite3.c:75353:13: */
+func checkPtrmap(tls *libc.TLS, pCheck uintptr, iChild Pgno, eType U8, iParent Pgno) { /* sqlite3.c:75574:13: */
bp := tls.Alloc(56)
defer tls.Free(56)
@@ -53081,30 +53795,30 @@ func checkPtrmap(tls *libc.TLS, pCheck uintptr, iChild Pgno, eType U8, iParent P
rc = ptrmapGet(tls, (*IntegrityCk)(unsafe.Pointer(pCheck)).FpBt, iChild, bp+48 /* &ePtrmapType */, bp+52 /* &iPtrmapParent */)
if rc != SQLITE_OK {
- if (rc == SQLITE_NOMEM) || (rc == (SQLITE_IOERR | (int32(12) << 8))) {
+ if rc == SQLITE_NOMEM || rc == SQLITE_IOERR|int32(12)<<8 {
(*IntegrityCk)(unsafe.Pointer(pCheck)).FbOomFault = 1
}
- checkAppendMsg(tls, pCheck, ts+3221 /* "Failed to read p..." */, libc.VaList(bp, iChild))
+ checkAppendMsg(tls, pCheck, ts+4032 /* "Failed to read p..." */, libc.VaList(bp, iChild))
return
}
- if (int32(*(*U8)(unsafe.Pointer(bp + 48 /* ePtrmapType */))) != int32(eType)) || (*(*Pgno)(unsafe.Pointer(bp + 52 /* iPtrmapParent */)) != iParent) {
+ if int32(*(*U8)(unsafe.Pointer(bp + 48))) != int32(eType) || *(*Pgno)(unsafe.Pointer(bp + 52)) != iParent {
checkAppendMsg(tls, pCheck,
- ts+3250, /* "Bad ptr map entr..." */
+ ts+4061, /* "Bad ptr map entr..." */
libc.VaList(bp+8, iChild, int32(eType), iParent, int32(*(*U8)(unsafe.Pointer(bp + 48 /* ePtrmapType */))), *(*Pgno)(unsafe.Pointer(bp + 52 /* iPtrmapParent */))))
}
}
// Check the integrity of the freelist or of an overflow page list.
// Verify that the number of pages on the list is N.
-func checkList(tls *libc.TLS, pCheck uintptr, isFreeList int32, iPage Pgno, N U32) { /* sqlite3.c:75382:13: */
+func checkList(tls *libc.TLS, pCheck uintptr, isFreeList int32, iPage Pgno, N U32) { /* sqlite3.c:75603:13: */
bp := tls.Alloc(44)
defer tls.Free(44)
var i int32
var expected U32 = N
var nErrAtStart int32 = (*IntegrityCk)(unsafe.Pointer(pCheck)).FnErr
- for (iPage != Pgno(0)) && ((*IntegrityCk)(unsafe.Pointer(pCheck)).FmxErr != 0) {
+ for iPage != Pgno(0) && (*IntegrityCk)(unsafe.Pointer(pCheck)).FmxErr != 0 {
// var pOvflPage uintptr at bp+40, 4
var pOvflData uintptr
@@ -53112,35 +53826,35 @@ func checkList(tls *libc.TLS, pCheck uintptr, isFreeList int32, iPage Pgno, N U3
break
}
N--
- if Xsqlite3PagerGet(tls, (*IntegrityCk)(unsafe.Pointer(pCheck)).FpPager, iPage, bp+40 /* &pOvflPage */, 0) != 0 {
- checkAppendMsg(tls, pCheck, ts+3304 /* "failed to get pa..." */, libc.VaList(bp, iPage))
+ if Xsqlite3PagerGet(tls, (*IntegrityCk)(unsafe.Pointer(pCheck)).FpPager, iPage, bp+40, 0) != 0 {
+ checkAppendMsg(tls, pCheck, ts+4115 /* "failed to get pa..." */, libc.VaList(bp, iPage))
break
}
pOvflData = Xsqlite3PagerGetData(tls, *(*uintptr)(unsafe.Pointer(bp + 40 /* pOvflPage */)))
if isFreeList != 0 {
- var n U32 = Xsqlite3Get4byte(tls, (pOvflData + 4))
+ var n U32 = Xsqlite3Get4byte(tls, pOvflData+4)
if (*BtShared)(unsafe.Pointer((*IntegrityCk)(unsafe.Pointer(pCheck)).FpBt)).FautoVacuum != 0 {
checkPtrmap(tls, pCheck, iPage, uint8(PTRMAP_FREEPAGE), uint32(0))
}
- if n > (((*BtShared)(unsafe.Pointer((*IntegrityCk)(unsafe.Pointer(pCheck)).FpBt)).FusableSize / U32(4)) - U32(2)) {
+ if n > (*BtShared)(unsafe.Pointer((*IntegrityCk)(unsafe.Pointer(pCheck)).FpBt)).FusableSize/U32(4)-U32(2) {
checkAppendMsg(tls, pCheck,
- ts+3326 /* "freelist leaf co..." */, libc.VaList(bp+8, iPage))
+ ts+4137 /* "freelist leaf co..." */, libc.VaList(bp+8, iPage))
N--
} else {
for i = 0; i < int32(n); i++ {
- var iFreePage Pgno = Xsqlite3Get4byte(tls, (pOvflData + uintptr((8 + (i * 4)))))
+ var iFreePage Pgno = Xsqlite3Get4byte(tls, pOvflData+uintptr(8+i*4))
if (*BtShared)(unsafe.Pointer((*IntegrityCk)(unsafe.Pointer(pCheck)).FpBt)).FautoVacuum != 0 {
checkPtrmap(tls, pCheck, iFreePage, uint8(PTRMAP_FREEPAGE), uint32(0))
}
checkRef(tls, pCheck, iFreePage)
}
- N = N - (n)
+ N = N - n
}
} else {
// If this database supports auto-vacuum and iPage is not the last
// page in this overflow list, check that the pointer-map entry for
// the following page matches iPage.
- if ((*BtShared)(unsafe.Pointer((*IntegrityCk)(unsafe.Pointer(pCheck)).FpBt)).FautoVacuum != 0) && (N > U32(0)) {
+ if (*BtShared)(unsafe.Pointer((*IntegrityCk)(unsafe.Pointer(pCheck)).FpBt)).FautoVacuum != 0 && N > U32(0) {
i = int32(Xsqlite3Get4byte(tls, pOvflData))
checkPtrmap(tls, pCheck, uint32(i), uint8(PTRMAP_OVERFLOW2), iPage)
}
@@ -53148,16 +53862,16 @@ func checkList(tls *libc.TLS, pCheck uintptr, isFreeList int32, iPage Pgno, N U3
iPage = Xsqlite3Get4byte(tls, pOvflData)
Xsqlite3PagerUnref(tls, *(*uintptr)(unsafe.Pointer(bp + 40 /* pOvflPage */)))
}
- if (N != 0) && (nErrAtStart == (*IntegrityCk)(unsafe.Pointer(pCheck)).FnErr) {
+ if N != 0 && nErrAtStart == (*IntegrityCk)(unsafe.Pointer(pCheck)).FnErr {
checkAppendMsg(tls, pCheck,
- ts+3365, /* "%s is %d but sho..." */
+ ts+4176, /* "%s is %d but sho..." */
libc.VaList(bp+16, func() uintptr {
if isFreeList != 0 {
- return ts + 3391 /* "size" */
+ return ts + 4202 /* "size" */
}
- return ts + 3396 /* "overflow list le..." */
+ return ts + 4207 /* "overflow list le..." */
}(),
- (expected-N), expected))
+ expected-N, expected))
}
}
@@ -53181,11 +53895,11 @@ func checkList(tls *libc.TLS, pCheck uintptr, isFreeList int32, iPage Pgno, N U3
// entry represents the span of a cell or freeblock on a btree page.
// The upper 16 bits are the index of the first byte of a range and the
// lower 16 bits are the index of the last byte of that range.
-func btreeHeapInsert(tls *libc.TLS, aHeap uintptr, x U32) { /* sqlite3.c:75471:13: */
+func btreeHeapInsert(tls *libc.TLS, aHeap uintptr, x U32) { /* sqlite3.c:75692:13: */
var j U32
var i U32 = libc.PreIncUint32(&*(*U32)(unsafe.Pointer(aHeap)), 1)
*(*U32)(unsafe.Pointer(aHeap + uintptr(i)*4)) = x
- for ((libc.AssignUint32(&j, (i / U32(2)))) > U32(0)) && (*(*U32)(unsafe.Pointer(aHeap + uintptr(j)*4)) > *(*U32)(unsafe.Pointer(aHeap + uintptr(i)*4))) {
+ for libc.AssignUint32(&j, i/U32(2)) > U32(0) && *(*U32)(unsafe.Pointer(aHeap + uintptr(j)*4)) > *(*U32)(unsafe.Pointer(aHeap + uintptr(i)*4)) {
x = *(*U32)(unsafe.Pointer(aHeap + uintptr(j)*4))
*(*U32)(unsafe.Pointer(aHeap + uintptr(j)*4)) = *(*U32)(unsafe.Pointer(aHeap + uintptr(i)*4))
*(*U32)(unsafe.Pointer(aHeap + uintptr(i)*4)) = x
@@ -53193,11 +53907,11 @@ func btreeHeapInsert(tls *libc.TLS, aHeap uintptr, x U32) { /* sqlite3.c:75471:1
}
}
-func btreeHeapPull(tls *libc.TLS, aHeap uintptr, pOut uintptr) int32 { /* sqlite3.c:75481:12: */
+func btreeHeapPull(tls *libc.TLS, aHeap uintptr, pOut uintptr) int32 { /* sqlite3.c:75702:12: */
var j U32
var i U32
var x U32
- if (libc.AssignUint32(&x, *(*U32)(unsafe.Pointer(aHeap)))) == U32(0) {
+ if libc.AssignUint32(&x, *(*U32)(unsafe.Pointer(aHeap))) == U32(0) {
return 0
}
*(*U32)(unsafe.Pointer(pOut)) = *(*U32)(unsafe.Pointer(aHeap + 1*4))
@@ -53205,8 +53919,8 @@ func btreeHeapPull(tls *libc.TLS, aHeap uintptr, pOut uintptr) int32 { /* sqlite
*(*U32)(unsafe.Pointer(aHeap + uintptr(x)*4)) = 0xffffffff
*(*U32)(unsafe.Pointer(aHeap))--
i = U32(1)
- for (libc.AssignUint32(&j, (i * U32(2)))) <= *(*U32)(unsafe.Pointer(aHeap)) {
- if *(*U32)(unsafe.Pointer(aHeap + uintptr(j)*4)) > *(*U32)(unsafe.Pointer(aHeap + uintptr((j+U32(1)))*4)) {
+ for libc.AssignUint32(&j, i*U32(2)) <= *(*U32)(unsafe.Pointer(aHeap)) {
+ if *(*U32)(unsafe.Pointer(aHeap + uintptr(j)*4)) > *(*U32)(unsafe.Pointer(aHeap + uintptr(j+U32(1))*4)) {
j++
}
if *(*U32)(unsafe.Pointer(aHeap + uintptr(i)*4)) < *(*U32)(unsafe.Pointer(aHeap + uintptr(j)*4)) {
@@ -53232,7 +53946,7 @@ func btreeHeapPull(tls *libc.TLS, aHeap uintptr, pOut uintptr) int32 { /* sqlite
// 3. Check the integrity of overflow pages.
// 4. Recursively call checkTreePage on all children.
// 5. Verify that the depth of all children is the same.
-func checkTreePage(tls *libc.TLS, pCheck uintptr, iPage Pgno, piMinKey uintptr, maxKey I64) int32 { /* sqlite3.c:75515:12: */
+func checkTreePage(tls *libc.TLS, pCheck uintptr, iPage Pgno, piMinKey uintptr, maxKey I64) int32 { /* sqlite3.c:75736:12: */
bp := tls.Alloc(140)
defer tls.Free(140)
*(*I64)(unsafe.Pointer(bp + 104)) = maxKey
@@ -53299,13 +54013,13 @@ __1:
return 0
__2:
;
- (*IntegrityCk)(unsafe.Pointer(pCheck)).FzPfx = ts + 3417 /* "Page %u: " */
+ (*IntegrityCk)(unsafe.Pointer(pCheck)).FzPfx = ts + 4228 /* "Page %u: " */
(*IntegrityCk)(unsafe.Pointer(pCheck)).Fv1 = iPage
- if !((libc.AssignInt32(&rc, btreeGetPage(tls, pBt, iPage, bp+96 /* &pPage */, 0))) != 0) {
+ if !(libc.AssignInt32(&rc, btreeGetPage(tls, pBt, iPage, bp+96, 0)) != 0) {
goto __3
}
checkAppendMsg(tls, pCheck,
- ts+3427 /* "unable to get th..." */, libc.VaList(bp, rc))
+ ts+4238 /* "unable to get th..." */, libc.VaList(bp, rc))
goto end_of_check
__3:
;
@@ -53314,20 +54028,20 @@ __3:
// btreeInitPage() is executed.
savedIsInit = (*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 96 /* pPage */)))).FisInit
(*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 96 /* pPage */)))).FisInit = U8(0)
- if !((libc.AssignInt32(&rc, btreeInitPage(tls, *(*uintptr)(unsafe.Pointer(bp + 96 /* pPage */))))) != 0) {
+ if !(libc.AssignInt32(&rc, btreeInitPage(tls, *(*uintptr)(unsafe.Pointer(bp + 96)))) != 0) {
goto __4
}
// The only possible error from InitPage
checkAppendMsg(tls, pCheck,
- ts+3465 /* "btreeInitPage() ..." */, libc.VaList(bp+8, rc))
+ ts+4276 /* "btreeInitPage() ..." */, libc.VaList(bp+8, rc))
goto end_of_check
__4:
;
- if !((libc.AssignInt32(&rc, btreeComputeFreeSpace(tls, *(*uintptr)(unsafe.Pointer(bp + 96 /* pPage */))))) != 0) {
+ if !(libc.AssignInt32(&rc, btreeComputeFreeSpace(tls, *(*uintptr)(unsafe.Pointer(bp + 96)))) != 0) {
goto __5
}
- checkAppendMsg(tls, pCheck, ts+3503 /* "free space corru..." */, libc.VaList(bp+16, rc))
+ checkAppendMsg(tls, pCheck, ts+4314 /* "free space corru..." */, libc.VaList(bp+16, rc))
goto end_of_check
__5:
;
@@ -53335,29 +54049,29 @@ __5:
hdr = int32((*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 96 /* pPage */)))).FhdrOffset)
// Set up for cell analysis
- (*IntegrityCk)(unsafe.Pointer(pCheck)).FzPfx = ts + 3525 /* "On tree page %u ..." */
- contentOffset = (U32(((((int32(*(*U8)(unsafe.Pointer((data + uintptr((hdr + 5)))))) << 8) | int32(*(*U8)(unsafe.Pointer((data + uintptr((hdr + 5))) + 1)))) - 1) & 0xffff) + 1))
+ (*IntegrityCk)(unsafe.Pointer(pCheck)).FzPfx = ts + 4336 /* "On tree page %u ..." */
+ contentOffset = U32((int32(*(*U8)(unsafe.Pointer(data + uintptr(hdr+5))))<<8|int32(*(*U8)(unsafe.Pointer(data + uintptr(hdr+5) + 1)))-1)&0xffff + 1)
// Enforced by btreeInitPage()
// EVIDENCE-OF: R-37002-32774 The two-byte integer at offset 3 gives the
// number of cells on the page.
- nCell = ((int32(*(*U8)(unsafe.Pointer((data + uintptr((hdr + 3)))))) << 8) | int32(*(*U8)(unsafe.Pointer((data + uintptr((hdr + 3))) + 1))))
+ nCell = int32(*(*U8)(unsafe.Pointer(data + uintptr(hdr+3))))<<8 | int32(*(*U8)(unsafe.Pointer(data + uintptr(hdr+3) + 1)))
// EVIDENCE-OF: R-23882-45353 The cell pointer array of a b-tree page
// immediately follows the b-tree page header.
- cellStart = ((hdr + 12) - (4 * int32((*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 96 /* pPage */)))).Fleaf)))
+ cellStart = hdr + 12 - 4*int32((*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 96)))).Fleaf)
- pCellIdx = (data + uintptr((cellStart + (2 * (nCell - 1)))))
+ pCellIdx = data + uintptr(cellStart+2*(nCell-1))
- if !(!(int32((*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 96 /* pPage */)))).Fleaf) != 0)) {
+ if !!(int32((*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 96)))).Fleaf) != 0) {
goto __6
}
// Analyze the right-child page of internal pages
- pgno = int32(Xsqlite3Get4byte(tls, (data + uintptr((hdr + 8)))))
+ pgno = int32(Xsqlite3Get4byte(tls, data+uintptr(hdr+8)))
if !((*BtShared)(unsafe.Pointer(pBt)).FautoVacuum != 0) {
goto __8
}
- (*IntegrityCk)(unsafe.Pointer(pCheck)).FzPfx = ts + 3551 /* "On page %u at ri..." */
+ (*IntegrityCk)(unsafe.Pointer(pCheck)).FzPfx = ts + 4362 /* "On page %u at ri..." */
checkPtrmap(tls, pCheck, uint32(pgno), uint8(PTRMAP_BTREE), iPage)
__8:
;
@@ -53374,9 +54088,9 @@ __7:
// EVIDENCE-OF: R-02776-14802 The cell pointer array consists of K 2-byte
// integer offsets to the cell contents.
- i = (nCell - 1)
+ i = nCell - 1
__9:
- if !((i >= 0) && ((*IntegrityCk)(unsafe.Pointer(pCheck)).FmxErr != 0)) {
+ if !(i >= 0 && (*IntegrityCk)(unsafe.Pointer(pCheck)).FmxErr != 0) {
goto __11
}
@@ -53385,41 +54099,41 @@ __9:
pc = U32(libc.X__builtin_bswap16(tls, *(*U16)(unsafe.Pointer(pCellIdx))))
pCellIdx -= uintptr(2)
- if !((pc < contentOffset) || (pc > (usableSize - U32(4)))) {
+ if !(pc < contentOffset || pc > usableSize-U32(4)) {
goto __12
}
- checkAppendMsg(tls, pCheck, ts+3579, /* "Offset %d out of..." */
- libc.VaList(bp+24, pc, contentOffset, (usableSize-U32(4))))
+ checkAppendMsg(tls, pCheck, ts+4390, /* "Offset %d out of..." */
+ libc.VaList(bp+24, pc, contentOffset, usableSize-U32(4)))
doCoverageCheck = 0
goto __10
__12:
;
- pCell = (data + uintptr(pc))
+ pCell = data + uintptr(pc)
(*struct {
f func(*libc.TLS, uintptr, uintptr, uintptr)
})(unsafe.Pointer(&struct{ uintptr }{(*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 96 /* pPage */)))).FxParseCell})).f(tls, *(*uintptr)(unsafe.Pointer(bp + 96 /* pPage */)), pCell, bp+112 /* &info */)
- if !((pc + U32((*CellInfo)(unsafe.Pointer(bp+112 /* &info */)).FnSize)) > usableSize) {
+ if !(pc+U32((*CellInfo)(unsafe.Pointer(bp+112)).FnSize) > usableSize) {
goto __13
}
- checkAppendMsg(tls, pCheck, ts+3609 /* "Extends off end ..." */, 0)
+ checkAppendMsg(tls, pCheck, ts+4420 /* "Extends off end ..." */, 0)
doCoverageCheck = 0
goto __10
__13:
;
// Check for integer primary key out of range
- if !((*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 96 /* pPage */)))).FintKey != 0) {
+ if !((*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 96)))).FintKey != 0) {
goto __14
}
if !(func() int32 {
if keyCanBeEqual != 0 {
- return (libc.Bool32((*CellInfo)(unsafe.Pointer(bp+112 /* &info */)).FnKey > *(*I64)(unsafe.Pointer(bp + 104 /* maxKey */))))
+ return libc.Bool32((*CellInfo)(unsafe.Pointer(bp+112)).FnKey > *(*I64)(unsafe.Pointer(bp + 104)))
}
- return (libc.Bool32((*CellInfo)(unsafe.Pointer(bp+112 /* &info */)).FnKey >= *(*I64)(unsafe.Pointer(bp + 104 /* maxKey */))))
+ return libc.Bool32((*CellInfo)(unsafe.Pointer(bp+112)).FnKey >= *(*I64)(unsafe.Pointer(bp + 104)))
}() != 0) {
goto __15
}
- checkAppendMsg(tls, pCheck, ts+3633 /* "Rowid %lld out o..." */, libc.VaList(bp+48, (*CellInfo)(unsafe.Pointer(bp+112 /* &info */)).FnKey))
+ checkAppendMsg(tls, pCheck, ts+4444 /* "Rowid %lld out o..." */, libc.VaList(bp+48, (*CellInfo)(unsafe.Pointer(bp+112 /* &info */)).FnKey))
__15:
;
*(*I64)(unsafe.Pointer(bp + 104 /* maxKey */)) = (*CellInfo)(unsafe.Pointer(bp + 112 /* &info */)).FnKey
@@ -53428,12 +54142,12 @@ __14:
;
// Check the content overflow list
- if !((*CellInfo)(unsafe.Pointer(bp+112 /* &info */)).FnPayload > U32((*CellInfo)(unsafe.Pointer(bp+112 /* &info */)).FnLocal)) {
+ if !((*CellInfo)(unsafe.Pointer(bp+112)).FnPayload > U32((*CellInfo)(unsafe.Pointer(bp+112)).FnLocal)) {
goto __16
} // First page of the overflow chain
- nPage = (((((*CellInfo)(unsafe.Pointer(bp+112 /* &info */)).FnPayload - U32((*CellInfo)(unsafe.Pointer(bp+112 /* &info */)).FnLocal)) + usableSize) - U32(5)) / (usableSize - U32(4)))
- pgnoOvfl = Xsqlite3Get4byte(tls, (pCell + uintptr((int32((*CellInfo)(unsafe.Pointer(bp+112 /* &info */)).FnSize) - 4))))
+ nPage = ((*CellInfo)(unsafe.Pointer(bp+112)).FnPayload - U32((*CellInfo)(unsafe.Pointer(bp+112)).FnLocal) + usableSize - U32(5)) / (usableSize - U32(4))
+ pgnoOvfl = Xsqlite3Get4byte(tls, pCell+uintptr(int32((*CellInfo)(unsafe.Pointer(bp+112)).FnSize)-4))
if !((*BtShared)(unsafe.Pointer(pBt)).FautoVacuum != 0) {
goto __17
}
@@ -53444,7 +54158,7 @@ __17:
__16:
;
- if !(!(int32((*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 96 /* pPage */)))).Fleaf) != 0)) {
+ if !!(int32((*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 96)))).Fleaf) != 0) {
goto __18
}
// Check sanity of left child page for internal pages
@@ -53460,14 +54174,14 @@ __20:
if !(d2 != depth) {
goto __21
}
- checkAppendMsg(tls, pCheck, ts+3657 /* "Child page depth..." */, 0)
+ checkAppendMsg(tls, pCheck, ts+4468 /* "Child page depth..." */, 0)
depth = d2
__21:
;
goto __19
__18:
// Populate the coverage-checking heap for leaf pages
- btreeHeapInsert(tls, heap, ((pc << 16) | ((pc + U32((*CellInfo)(unsafe.Pointer(bp+112 /* &info */)).FnSize)) - U32(1))))
+ btreeHeapInsert(tls, heap, pc<<16|(pc+U32((*CellInfo)(unsafe.Pointer(bp+112)).FnSize)-U32(1)))
__19:
;
goto __10
@@ -53481,27 +54195,27 @@ __11:
// Check for complete coverage of the page
(*IntegrityCk)(unsafe.Pointer(pCheck)).FzPfx = uintptr(0)
- if !((doCoverageCheck != 0) && ((*IntegrityCk)(unsafe.Pointer(pCheck)).FmxErr > 0)) {
+ if !(doCoverageCheck != 0 && (*IntegrityCk)(unsafe.Pointer(pCheck)).FmxErr > 0) {
goto __22
}
// For leaf pages, the min-heap has already been initialized and the
// cells have already been inserted. But for internal pages, that has
// not yet been done, so do it now
- if !(!(int32((*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 96 /* pPage */)))).Fleaf) != 0)) {
+ if !!(int32((*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 96)))).Fleaf) != 0) {
goto __23
}
heap = (*IntegrityCk)(unsafe.Pointer(pCheck)).Fheap
*(*U32)(unsafe.Pointer(heap)) = U32(0)
- i = (nCell - 1)
+ i = nCell - 1
__24:
if !(i >= 0) {
goto __26
}
- pc = U32(libc.X__builtin_bswap16(tls, *(*U16)(unsafe.Pointer((data + uintptr((cellStart + (i * 2))))))))
+ pc = U32(libc.X__builtin_bswap16(tls, *(*U16)(unsafe.Pointer(data + uintptr(cellStart+i*2)))))
size = U32((*struct {
f func(*libc.TLS, uintptr, uintptr) U16
- })(unsafe.Pointer(&struct{ uintptr }{(*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 96 /* pPage */)))).FxCellSize})).f(tls, *(*uintptr)(unsafe.Pointer(bp + 96 /* pPage */)), (data + uintptr(pc))))
- btreeHeapInsert(tls, heap, ((pc << 16) | ((pc + size) - U32(1))))
+ })(unsafe.Pointer(&struct{ uintptr }{(*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 96 /* pPage */)))).FxCellSize})).f(tls, *(*uintptr)(unsafe.Pointer(bp + 96 /* pPage */)), data+uintptr(pc)))
+ btreeHeapInsert(tls, heap, pc<<16|(pc+size-U32(1)))
goto __25
__25:
i--
@@ -53516,20 +54230,20 @@ __23:
// EVIDENCE-OF: R-20690-50594 The second field of the b-tree page header
// is the offset of the first freeblock, or zero if there are no
// freeblocks on the page.
- i = ((int32(*(*U8)(unsafe.Pointer((data + uintptr((hdr + 1)))))) << 8) | int32(*(*U8)(unsafe.Pointer((data + uintptr((hdr + 1))) + 1))))
+ i = int32(*(*U8)(unsafe.Pointer(data + uintptr(hdr+1))))<<8 | int32(*(*U8)(unsafe.Pointer(data + uintptr(hdr+1) + 1)))
__27:
if !(i > 0) {
goto __28
}
// Enforced by btreeComputeFreeSpace()
- size1 = ((int32(*(*U8)(unsafe.Pointer((data + uintptr((i + 2)))))) << 8) | int32(*(*U8)(unsafe.Pointer((data + uintptr((i + 2))) + 1))))
+ size1 = int32(*(*U8)(unsafe.Pointer(data + uintptr(i+2))))<<8 | int32(*(*U8)(unsafe.Pointer(data + uintptr(i+2) + 1)))
// due to btreeComputeFreeSpace()
- btreeHeapInsert(tls, heap, (((U32(i)) << 16) | (U32((i + size1) - 1))))
+ btreeHeapInsert(tls, heap, U32(i)<<16|U32(i+size1-1))
// EVIDENCE-OF: R-58208-19414 The first 2 bytes of a freeblock are a
// big-endian integer which is the offset in the b-tree page of the next
// freeblock in the chain, or zero if the freeblock is the last on the
// chain.
- j = ((int32(*(*U8)(unsafe.Pointer((data + uintptr(i))))) << 8) | int32(*(*U8)(unsafe.Pointer((data + uintptr(i)) + 1))))
+ j = int32(*(*U8)(unsafe.Pointer(data + uintptr(i))))<<8 | int32(*(*U8)(unsafe.Pointer(data + uintptr(i) + 1)))
// EVIDENCE-OF: R-06866-39125 Freeblocks are always connected in order of
// increasing offset.
// Enforced by btreeComputeFreeSpace()
@@ -53551,44 +54265,44 @@ __28:
// overlap, that means bytes are used multiple times. If there is a gap,
// that gap is added to the fragmentation count.
nFrag = 0
- prev = (contentOffset - U32(1)) // Implied first min-heap entry
+ prev = contentOffset - U32(1) // Implied first min-heap entry
__29:
- if !(btreeHeapPull(tls, heap, bp+136 /* &x */) != 0) {
+ if !(btreeHeapPull(tls, heap, bp+136) != 0) {
goto __30
}
- if !((prev & U32(0xffff)) >= (*(*U32)(unsafe.Pointer(bp + 136 /* x */)) >> 16)) {
+ if !(prev&U32(0xffff) >= *(*U32)(unsafe.Pointer(bp + 136))>>16) {
goto __31
}
checkAppendMsg(tls, pCheck,
- ts+3682 /* "Multiple uses fo..." */, libc.VaList(bp+56, (*(*U32)(unsafe.Pointer(bp + 136 /* x */))>>16), iPage))
+ ts+4493 /* "Multiple uses fo..." */, libc.VaList(bp+56, *(*U32)(unsafe.Pointer(bp + 136))>>16, iPage))
goto __30
goto __32
__31:
- nFrag = int32(U32(nFrag) + (((*(*U32)(unsafe.Pointer(bp + 136 /* x */)) >> 16) - (prev & U32(0xffff))) - U32(1)))
+ nFrag = int32(U32(nFrag) + (*(*U32)(unsafe.Pointer(bp + 136))>>16 - prev&U32(0xffff) - U32(1)))
prev = *(*U32)(unsafe.Pointer(bp + 136 /* x */))
__32:
;
goto __29
__30:
;
- nFrag = int32(U32(nFrag) + ((usableSize - (prev & U32(0xffff))) - U32(1)))
+ nFrag = int32(U32(nFrag) + (usableSize - prev&U32(0xffff) - U32(1)))
// EVIDENCE-OF: R-43263-13491 The total number of bytes in all fragments
// is stored in the fifth field of the b-tree page header.
// EVIDENCE-OF: R-07161-27322 The one-byte integer at offset 7 gives the
// number of fragmented free bytes within the cell content area.
- if !((*(*U32)(unsafe.Pointer(heap)) == U32(0)) && (nFrag != int32(*(*U8)(unsafe.Pointer(data + uintptr((hdr + 7))))))) {
+ if !(*(*U32)(unsafe.Pointer(heap)) == U32(0) && nFrag != int32(*(*U8)(unsafe.Pointer(data + uintptr(hdr+7))))) {
goto __33
}
checkAppendMsg(tls, pCheck,
- ts+3719, /* "Fragmentation of..." */
- libc.VaList(bp+72, nFrag, int32(*(*U8)(unsafe.Pointer(data + uintptr((hdr + 7))))), iPage))
+ ts+4530, /* "Fragmentation of..." */
+ libc.VaList(bp+72, nFrag, int32(*(*U8)(unsafe.Pointer(data + uintptr(hdr+7)))), iPage))
__33:
;
__22:
;
end_of_check:
- if !(!(doCoverageCheck != 0)) {
+ if !!(doCoverageCheck != 0) {
goto __34
}
(*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 96 /* pPage */)))).FisInit = savedIsInit
@@ -53598,7 +54312,7 @@ __34:
(*IntegrityCk)(unsafe.Pointer(pCheck)).FzPfx = saved_zPfx
(*IntegrityCk)(unsafe.Pointer(pCheck)).Fv1 = Pgno(saved_v1)
(*IntegrityCk)(unsafe.Pointer(pCheck)).Fv2 = saved_v2
- return (depth + 1)
+ return depth + 1
}
// This routine does a complete check of the given BTree file. aRoot[] is
@@ -53621,7 +54335,7 @@ __34:
// since obviously it is not possible to know which pages are covered by
// the unverified btrees. Except, if aRoot[1] is 1, then the freelist
// checks are still performed.
-func Xsqlite3BtreeIntegrityCheck(tls *libc.TLS, db uintptr, p uintptr, aRoot uintptr, nRoot int32, mxErr int32, pnErr uintptr) uintptr { /* sqlite3.c:75794:21: */
+func Xsqlite3BtreeIntegrityCheck(tls *libc.TLS, db uintptr, p uintptr, aRoot uintptr, nRoot int32, mxErr int32, pnErr uintptr) uintptr { /* sqlite3.c:76015:21: */
bp := tls.Alloc(216)
defer tls.Free(216)
@@ -53671,17 +54385,17 @@ __1:
(*IntegrityCk)(unsafe.Pointer(bp + 32 /* &sCheck */)).Fv2 = 0
(*IntegrityCk)(unsafe.Pointer(bp + 32 /* &sCheck */)).FaPgRef = uintptr(0)
(*IntegrityCk)(unsafe.Pointer(bp + 32 /* &sCheck */)).Fheap = uintptr(0)
- Xsqlite3StrAccumInit(tls, (bp + 32 /* &sCheck */ + 40 /* &.errMsg */), uintptr(0), bp+104 /* &zErr[0] */, int32(unsafe.Sizeof([100]uint8{})), SQLITE_MAX_LENGTH)
+ Xsqlite3StrAccumInit(tls, bp+32+40, uintptr(0), bp+104 /* &zErr[0] */, int32(unsafe.Sizeof([100]uint8{})), SQLITE_MAX_LENGTH)
(*IntegrityCk)(unsafe.Pointer(bp + 32 /* &sCheck */)).FerrMsg.FprintfFlags = U8(SQLITE_PRINTF_INTERNAL)
- if !((*IntegrityCk)(unsafe.Pointer(bp+32 /* &sCheck */)).FnPage == Pgno(0)) {
+ if !((*IntegrityCk)(unsafe.Pointer(bp+32)).FnPage == Pgno(0)) {
goto __3
}
goto integrity_ck_cleanup
__3:
;
- (*IntegrityCk)(unsafe.Pointer(bp + 32 /* &sCheck */)).FaPgRef = Xsqlite3MallocZero(tls, (uint64(((*IntegrityCk)(unsafe.Pointer(bp+32 /* &sCheck */)).FnPage / Pgno(8)) + Pgno(1))))
- if !(!(int32((*IntegrityCk)(unsafe.Pointer(bp+32 /* &sCheck */)).FaPgRef) != 0)) {
+ (*IntegrityCk)(unsafe.Pointer(bp + 32 /* &sCheck */)).FaPgRef = Xsqlite3MallocZero(tls, uint64((*IntegrityCk)(unsafe.Pointer(bp+32)).FnPage/Pgno(8)+Pgno(1)))
+ if !!(int32((*IntegrityCk)(unsafe.Pointer(bp+32)).FaPgRef) != 0) {
goto __4
}
(*IntegrityCk)(unsafe.Pointer(bp + 32 /* &sCheck */)).FbOomFault = 1
@@ -53689,7 +54403,7 @@ __3:
__4:
;
(*IntegrityCk)(unsafe.Pointer(bp + 32 /* &sCheck */)).Fheap = Xsqlite3PageMalloc(tls, int32((*BtShared)(unsafe.Pointer(pBt)).FpageSize))
- if !((*IntegrityCk)(unsafe.Pointer(bp+32 /* &sCheck */)).Fheap == uintptr(0)) {
+ if !((*IntegrityCk)(unsafe.Pointer(bp+32)).Fheap == uintptr(0)) {
goto __5
}
(*IntegrityCk)(unsafe.Pointer(bp + 32 /* &sCheck */)).FbOomFault = 1
@@ -53697,8 +54411,8 @@ __4:
__5:
;
- i = ((U32(Xsqlite3PendingByte) / ((*BtShared)(unsafe.Pointer(pBt)).FpageSize)) + U32(1))
- if !(i <= (*IntegrityCk)(unsafe.Pointer(bp+32 /* &sCheck */)).FnPage) {
+ i = U32(Xsqlite3PendingByte)/(*BtShared)(unsafe.Pointer(pBt)).FpageSize + U32(1)
+ if !(i <= (*IntegrityCk)(unsafe.Pointer(bp+32)).FnPage) {
goto __6
}
setPageReferenced(tls, bp+32 /* &sCheck */, i)
@@ -53709,15 +54423,15 @@ __6:
if !(bCkFreelist != 0) {
goto __7
}
- (*IntegrityCk)(unsafe.Pointer(bp + 32 /* &sCheck */)).FzPfx = ts + 3771 /* "Main freelist: " */
- checkList(tls, bp+32 /* &sCheck */, 1, Xsqlite3Get4byte(tls, ((*MemPage)(unsafe.Pointer((*BtShared)(unsafe.Pointer(pBt)).FpPage1)).FaData+32)),
- Xsqlite3Get4byte(tls, ((*MemPage)(unsafe.Pointer((*BtShared)(unsafe.Pointer(pBt)).FpPage1)).FaData+36)))
+ (*IntegrityCk)(unsafe.Pointer(bp + 32 /* &sCheck */)).FzPfx = ts + 4582 /* "Main freelist: " */
+ checkList(tls, bp+32 /* &sCheck */, 1, Xsqlite3Get4byte(tls, (*MemPage)(unsafe.Pointer((*BtShared)(unsafe.Pointer(pBt)).FpPage1)).FaData+32),
+ Xsqlite3Get4byte(tls, (*MemPage)(unsafe.Pointer((*BtShared)(unsafe.Pointer(pBt)).FpPage1)).FaData+36))
(*IntegrityCk)(unsafe.Pointer(bp + 32 /* &sCheck */)).FzPfx = uintptr(0)
__7:
;
// Check all the tables.
- if !(!(bPartial != 0)) {
+ if !!(bPartial != 0) {
goto __8
}
if !((*BtShared)(unsafe.Pointer(pBt)).FautoVacuum != 0) {
@@ -53742,22 +54456,22 @@ __12:
goto __13
__13:
;
- mxInHdr = Xsqlite3Get4byte(tls, ((*MemPage)(unsafe.Pointer((*BtShared)(unsafe.Pointer(pBt)).FpPage1)).FaData + 52))
+ mxInHdr = Xsqlite3Get4byte(tls, (*MemPage)(unsafe.Pointer((*BtShared)(unsafe.Pointer(pBt)).FpPage1)).FaData+52)
if !(mx != mxInHdr) {
goto __15
}
checkAppendMsg(tls, bp+32, /* &sCheck */
- ts+3787, /* "max rootpage (%d..." */
+ ts+4598, /* "max rootpage (%d..." */
libc.VaList(bp, mx, mxInHdr))
__15:
;
goto __10
__9:
- if !(Xsqlite3Get4byte(tls, ((*MemPage)(unsafe.Pointer((*BtShared)(unsafe.Pointer(pBt)).FpPage1)).FaData+64)) != U32(0)) {
+ if !(Xsqlite3Get4byte(tls, (*MemPage)(unsafe.Pointer((*BtShared)(unsafe.Pointer(pBt)).FpPage1)).FaData+64) != U32(0)) {
goto __16
}
checkAppendMsg(tls, bp+32, /* &sCheck */
- ts+3832 /* "incremental_vacu..." */, 0)
+ ts+4643 /* "incremental_vacu..." */, 0)
__16:
;
__10:
@@ -53765,10 +54479,10 @@ __10:
__8:
;
- *(*U64)(unsafe.Pointer((*BtShared)(unsafe.Pointer(pBt)).Fdb + 32 /* &.flags */)) &= (libc.CplUint64(uint64(SQLITE_CellSizeCk)))
+ *(*U64)(unsafe.Pointer((*BtShared)(unsafe.Pointer(pBt)).Fdb + 32)) &= libc.CplUint64(uint64(SQLITE_CellSizeCk))
i = Pgno(0)
__17:
- if !((int32(i) < nRoot) && ((*IntegrityCk)(unsafe.Pointer(bp+32 /* &sCheck */)).FmxErr != 0)) {
+ if !(int32(i) < nRoot && (*IntegrityCk)(unsafe.Pointer(bp+32)).FmxErr != 0) {
goto __19
}
if !(*(*Pgno)(unsafe.Pointer(aRoot + uintptr(i)*4)) == Pgno(0)) {
@@ -53777,13 +54491,13 @@ __17:
goto __18
__20:
;
- if !((((*BtShared)(unsafe.Pointer(pBt)).FautoVacuum != 0) && (*(*Pgno)(unsafe.Pointer(aRoot + uintptr(i)*4)) > Pgno(1))) && !(bPartial != 0)) {
+ if !((*BtShared)(unsafe.Pointer(pBt)).FautoVacuum != 0 && *(*Pgno)(unsafe.Pointer(aRoot + uintptr(i)*4)) > Pgno(1) && !(bPartial != 0)) {
goto __21
}
checkPtrmap(tls, bp+32 /* &sCheck */, *(*Pgno)(unsafe.Pointer(aRoot + uintptr(i)*4)), uint8(PTRMAP_ROOTPAGE), uint32(0))
__21:
;
- checkTreePage(tls, bp+32 /* &sCheck */, *(*Pgno)(unsafe.Pointer(aRoot + uintptr(i)*4)), bp+208 /* &notUsed */, (int64(0xffffffff) | (I64((int64(0x7fffffff))) << 32)))
+ checkTreePage(tls, bp+32 /* &sCheck */, *(*Pgno)(unsafe.Pointer(aRoot + uintptr(i)*4)), bp+208 /* &notUsed */, int64(0xffffffff)|I64(int64(0x7fffffff))<<32)
goto __18
__18:
i++
@@ -53794,26 +54508,26 @@ __19:
(*Sqlite3)(unsafe.Pointer((*BtShared)(unsafe.Pointer(pBt)).Fdb)).Fflags = savedDbFlags
// Make sure every page in the file is referenced
- if !(!(bPartial != 0)) {
+ if !!(bPartial != 0) {
goto __22
}
i = Pgno(1)
__23:
- if !((i <= (*IntegrityCk)(unsafe.Pointer(bp+32 /* &sCheck */)).FnPage) && ((*IntegrityCk)(unsafe.Pointer(bp+32 /* &sCheck */)).FmxErr != 0)) {
+ if !(i <= (*IntegrityCk)(unsafe.Pointer(bp+32)).FnPage && (*IntegrityCk)(unsafe.Pointer(bp+32)).FmxErr != 0) {
goto __25
}
// If the database supports auto-vacuum, make sure no tables contain
// references to pointer-map pages.
- if !((getPageReferenced(tls, bp+32 /* &sCheck */, i) == 0) && ((ptrmapPageno(tls, pBt, i) != i) || !(int32((*BtShared)(unsafe.Pointer(pBt)).FautoVacuum) != 0))) {
+ if !(getPageReferenced(tls, bp+32, i) == 0 && (ptrmapPageno(tls, pBt, i) != i || !(int32((*BtShared)(unsafe.Pointer(pBt)).FautoVacuum) != 0))) {
goto __26
}
- checkAppendMsg(tls, bp+32 /* &sCheck */, ts+3887 /* "Page %d is never..." */, libc.VaList(bp+16, i))
+ checkAppendMsg(tls, bp+32 /* &sCheck */, ts+4698 /* "Page %d is never..." */, libc.VaList(bp+16, i))
__26:
;
- if !((getPageReferenced(tls, bp+32 /* &sCheck */, i) != 0) && ((ptrmapPageno(tls, pBt, i) == i) && ((*BtShared)(unsafe.Pointer(pBt)).FautoVacuum != 0))) {
+ if !(getPageReferenced(tls, bp+32, i) != 0 && (ptrmapPageno(tls, pBt, i) == i && (*BtShared)(unsafe.Pointer(pBt)).FautoVacuum != 0)) {
goto __27
}
- checkAppendMsg(tls, bp+32 /* &sCheck */, ts+3909 /* "Pointer map page..." */, libc.VaList(bp+24, i))
+ checkAppendMsg(tls, bp+32 /* &sCheck */, ts+4720 /* "Pointer map page..." */, libc.VaList(bp+24, i))
__27:
;
goto __24
@@ -53830,24 +54544,24 @@ __22:
integrity_ck_cleanup:
Xsqlite3PageFree(tls, (*IntegrityCk)(unsafe.Pointer(bp+32 /* &sCheck */)).Fheap)
Xsqlite3_free(tls, (*IntegrityCk)(unsafe.Pointer(bp+32 /* &sCheck */)).FaPgRef)
- if !((*IntegrityCk)(unsafe.Pointer(bp+32 /* &sCheck */)).FbOomFault != 0) {
+ if !((*IntegrityCk)(unsafe.Pointer(bp+32)).FbOomFault != 0) {
goto __28
}
- Xsqlite3_str_reset(tls, (bp + 32 /* &sCheck */ + 40 /* &.errMsg */))
+ Xsqlite3_str_reset(tls, bp+32+40)
(*IntegrityCk)(unsafe.Pointer(bp+32 /* &sCheck */)).FnErr++
__28:
;
*(*int32)(unsafe.Pointer(pnErr)) = (*IntegrityCk)(unsafe.Pointer(bp + 32 /* &sCheck */)).FnErr
- if !((*IntegrityCk)(unsafe.Pointer(bp+32 /* &sCheck */)).FnErr == 0) {
+ if !((*IntegrityCk)(unsafe.Pointer(bp+32)).FnErr == 0) {
goto __29
}
- Xsqlite3_str_reset(tls, (bp + 32 /* &sCheck */ + 40 /* &.errMsg */))
+ Xsqlite3_str_reset(tls, bp+32+40)
__29:
;
// Make sure this analysis did not leave any unref() pages.
Xsqlite3BtreeLeave(tls, p)
- return Xsqlite3StrAccumFinish(tls, (bp + 32 /* &sCheck */ + 40 /* &.errMsg */))
+ return Xsqlite3StrAccumFinish(tls, bp+32+40)
}
// Return the full pathname of the underlying database file. Return
@@ -53855,7 +54569,7 @@ __29:
//
// The pager filename is invariant as long as the pager is
// open so it is safe to access without the BtShared mutex.
-func Xsqlite3BtreeGetFilename(tls *libc.TLS, p uintptr) uintptr { /* sqlite3.c:75949:27: */
+func Xsqlite3BtreeGetFilename(tls *libc.TLS, p uintptr) uintptr { /* sqlite3.c:76170:27: */
return Xsqlite3PagerFilename(tls, (*BtShared)(unsafe.Pointer((*Btree)(unsafe.Pointer(p)).FpBt)).FpPager, 1)
}
@@ -53866,14 +54580,14 @@ func Xsqlite3BtreeGetFilename(tls *libc.TLS, p uintptr) uintptr { /* sqlite3.c:7
//
// The pager journal filename is invariant as long as the pager is
// open so it is safe to access without the BtShared mutex.
-func Xsqlite3BtreeGetJournalname(tls *libc.TLS, p uintptr) uintptr { /* sqlite3.c:75962:27: */
+func Xsqlite3BtreeGetJournalname(tls *libc.TLS, p uintptr) uintptr { /* sqlite3.c:76183:27: */
return Xsqlite3PagerJournalname(tls, (*BtShared)(unsafe.Pointer((*Btree)(unsafe.Pointer(p)).FpBt)).FpPager)
}
// Return one of SQLITE_TXN_NONE, SQLITE_TXN_READ, or SQLITE_TXN_WRITE
// to describe the current transaction state of Btree p.
-func Xsqlite3BtreeTxnState(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:75971:20: */
+func Xsqlite3BtreeTxnState(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:76192:20: */
if p != 0 {
return int32((*Btree)(unsafe.Pointer(p)).FinTrans)
@@ -53887,7 +54601,7 @@ func Xsqlite3BtreeTxnState(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:75971:
// transaction on the shared-cache the argument Btree is connected to.
//
// Parameter eMode is one of SQLITE_CHECKPOINT_PASSIVE, FULL or RESTART.
-func Xsqlite3BtreeCheckpoint(tls *libc.TLS, p uintptr, eMode int32, pnLog uintptr, pnCkpt uintptr) int32 { /* sqlite3.c:75985:20: */
+func Xsqlite3BtreeCheckpoint(tls *libc.TLS, p uintptr, eMode int32, pnLog uintptr, pnCkpt uintptr) int32 { /* sqlite3.c:76206:20: */
var rc int32 = SQLITE_OK
if p != 0 {
var pBt uintptr = (*Btree)(unsafe.Pointer(p)).FpBt
@@ -53903,9 +54617,9 @@ func Xsqlite3BtreeCheckpoint(tls *libc.TLS, p uintptr, eMode int32, pnLog uintpt
}
// Return true if there is currently a backup running on Btree p.
-func Xsqlite3BtreeIsInBackup(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:76004:20: */
+func Xsqlite3BtreeIsInBackup(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:76225:20: */
- return (libc.Bool32((*Btree)(unsafe.Pointer(p)).FnBackup != 0))
+ return libc.Bool32((*Btree)(unsafe.Pointer(p)).FnBackup != 0)
}
// This function returns a pointer to a blob of memory associated with
@@ -53926,10 +54640,10 @@ func Xsqlite3BtreeIsInBackup(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:7600
// xFree argument when the memory allocation was made is invoked on the
// blob of allocated memory. The xFree function should not call sqlite3_free()
// on the memory, the btree layer does that.
-func Xsqlite3BtreeSchema(tls *libc.TLS, p uintptr, nBytes int32, xFree uintptr) uintptr { /* sqlite3.c:76030:21: */
+func Xsqlite3BtreeSchema(tls *libc.TLS, p uintptr, nBytes int32, xFree uintptr) uintptr { /* sqlite3.c:76251:21: */
var pBt uintptr = (*Btree)(unsafe.Pointer(p)).FpBt
Xsqlite3BtreeEnter(tls, p)
- if !(int32((*BtShared)(unsafe.Pointer(pBt)).FpSchema) != 0) && (nBytes != 0) {
+ if !(int32((*BtShared)(unsafe.Pointer(pBt)).FpSchema) != 0) && nBytes != 0 {
(*BtShared)(unsafe.Pointer(pBt)).FpSchema = Xsqlite3DbMallocZero(tls, uintptr(0), uint64(nBytes))
(*BtShared)(unsafe.Pointer(pBt)).FxFreeSchema = xFree
}
@@ -53940,7 +54654,7 @@ func Xsqlite3BtreeSchema(tls *libc.TLS, p uintptr, nBytes int32, xFree uintptr)
// Return SQLITE_LOCKED_SHAREDCACHE if another user of the same shared
// btree as the argument handle holds an exclusive lock on the
// sqlite_schema table. Otherwise SQLITE_OK.
-func Xsqlite3BtreeSchemaLocked(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:76046:20: */
+func Xsqlite3BtreeSchemaLocked(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:76267:20: */
var rc int32
Xsqlite3BtreeEnter(tls, p)
@@ -53953,11 +54667,11 @@ func Xsqlite3BtreeSchemaLocked(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:76
// Obtain a lock on the table whose root page is iTab. The
// lock is a write lock if isWritelock is true or a read lock
// if it is false.
-func Xsqlite3BtreeLockTable(tls *libc.TLS, p uintptr, iTab int32, isWriteLock U8) int32 { /* sqlite3.c:76063:20: */
+func Xsqlite3BtreeLockTable(tls *libc.TLS, p uintptr, iTab int32, isWriteLock U8) int32 { /* sqlite3.c:76284:20: */
var rc int32 = SQLITE_OK
if (*Btree)(unsafe.Pointer(p)).Fsharable != 0 {
- var lockType U8 = (U8(READ_LOCK + int32(isWriteLock)))
+ var lockType U8 = U8(READ_LOCK + int32(isWriteLock))
Xsqlite3BtreeEnter(tls, p)
rc = querySharedCacheTableLock(tls, p, uint32(iTab), lockType)
@@ -53977,7 +54691,7 @@ func Xsqlite3BtreeLockTable(tls *libc.TLS, p uintptr, iTab int32, isWriteLock U8
// change the length of the data stored. If this function is called with
// parameters that attempt to write past the end of the existing data,
// no modifications are made and SQLITE_CORRUPT is returned.
-func Xsqlite3BtreePutData(tls *libc.TLS, pCsr uintptr, offset U32, amt U32, z uintptr) int32 { /* sqlite3.c:76093:20: */
+func Xsqlite3BtreePutData(tls *libc.TLS, pCsr uintptr, offset U32, amt U32, z uintptr) int32 { /* sqlite3.c:76314:20: */
var rc int32
rc = func() int32 {
@@ -54009,7 +54723,7 @@ func Xsqlite3BtreePutData(tls *libc.TLS, pCsr uintptr, offset U32, amt U32, z ui
// (c) the connection holds a write-lock on the table (if required),
// (d) there are no conflicting read-locks, and
// (e) the cursor points at a valid row of an intKey table.
- if (int32((*BtCursor)(unsafe.Pointer(pCsr)).FcurFlags) & BTCF_WriteFlag) == 0 {
+ if int32((*BtCursor)(unsafe.Pointer(pCsr)).FcurFlags)&BTCF_WriteFlag == 0 {
return SQLITE_READONLY
}
@@ -54017,29 +54731,29 @@ func Xsqlite3BtreePutData(tls *libc.TLS, pCsr uintptr, offset U32, amt U32, z ui
}
// Mark this cursor as an incremental blob cursor.
-func Xsqlite3BtreeIncrblobCursor(tls *libc.TLS, pCur uintptr) { /* sqlite3.c:76141:21: */
- *(*U8)(unsafe.Pointer(pCur + 1 /* &.curFlags */)) |= U8((BTCF_Incrblob))
+func Xsqlite3BtreeIncrblobCursor(tls *libc.TLS, pCur uintptr) { /* sqlite3.c:76362:21: */
+ *(*U8)(unsafe.Pointer(pCur + 1)) |= U8(BTCF_Incrblob)
(*Btree)(unsafe.Pointer((*BtCursor)(unsafe.Pointer(pCur)).FpBtree)).FhasIncrblobCur = U8(1)
}
// Set both the "read version" (single byte at byte offset 18) and
// "write version" (single byte at byte offset 19) fields in the database
// header to iVersion.
-func Xsqlite3BtreeSetVersion(tls *libc.TLS, pBtree uintptr, iVersion int32) int32 { /* sqlite3.c:76152:20: */
+func Xsqlite3BtreeSetVersion(tls *libc.TLS, pBtree uintptr, iVersion int32) int32 { /* sqlite3.c:76373:20: */
var pBt uintptr = (*Btree)(unsafe.Pointer(pBtree)).FpBt
var rc int32 // Return code
// If setting the version fields to 1, do not automatically open the
// WAL connection, even if the version fields are currently set to 2.
- *(*U16)(unsafe.Pointer(pBt + 24 /* &.btsFlags */)) &= libc.Uint16FromInt32((libc.CplInt32(BTS_NO_WAL)))
+ *(*U16)(unsafe.Pointer(pBt + 24)) &= libc.Uint16FromInt32(libc.CplInt32(BTS_NO_WAL))
if iVersion == 1 {
- *(*U16)(unsafe.Pointer(pBt + 24 /* &.btsFlags */)) |= U16((BTS_NO_WAL))
+ *(*U16)(unsafe.Pointer(pBt + 24)) |= U16(BTS_NO_WAL)
}
rc = Xsqlite3BtreeBeginTrans(tls, pBtree, 0, uintptr(0))
if rc == SQLITE_OK {
var aData uintptr = (*MemPage)(unsafe.Pointer((*BtShared)(unsafe.Pointer(pBt)).FpPage1)).FaData
- if (int32(*(*U8)(unsafe.Pointer(aData + 18))) != int32(U8(iVersion))) || (int32(*(*U8)(unsafe.Pointer(aData + 19))) != int32(U8(iVersion))) {
+ if int32(*(*U8)(unsafe.Pointer(aData + 18))) != int32(U8(iVersion)) || int32(*(*U8)(unsafe.Pointer(aData + 19))) != int32(U8(iVersion)) {
rc = Xsqlite3BtreeBeginTrans(tls, pBtree, 2, uintptr(0))
if rc == SQLITE_OK {
rc = Xsqlite3PagerWrite(tls, (*MemPage)(unsafe.Pointer((*BtShared)(unsafe.Pointer(pBt)).FpPage1)).FpDbPage)
@@ -54051,35 +54765,35 @@ func Xsqlite3BtreeSetVersion(tls *libc.TLS, pBtree uintptr, iVersion int32) int3
}
}
- *(*U16)(unsafe.Pointer(pBt + 24 /* &.btsFlags */)) &= libc.Uint16FromInt32((libc.CplInt32(BTS_NO_WAL)))
+ *(*U16)(unsafe.Pointer(pBt + 24)) &= libc.Uint16FromInt32(libc.CplInt32(BTS_NO_WAL))
return rc
}
// Return true if the cursor has a hint specified. This routine is
// only used from within assert() statements
-func Xsqlite3BtreeCursorHasHint(tls *libc.TLS, pCsr uintptr, mask uint32) int32 { /* sqlite3.c:76187:20: */
- return (libc.Bool32((uint32((*BtCursor)(unsafe.Pointer(pCsr)).Fhints) & mask) != uint32(0)))
+func Xsqlite3BtreeCursorHasHint(tls *libc.TLS, pCsr uintptr, mask uint32) int32 { /* sqlite3.c:76408:20: */
+ return libc.Bool32(uint32((*BtCursor)(unsafe.Pointer(pCsr)).Fhints)&mask != uint32(0))
}
// Return true if the given Btree is read-only.
-func Xsqlite3BtreeIsReadonly(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:76194:20: */
- return (libc.Bool32((int32((*BtShared)(unsafe.Pointer((*Btree)(unsafe.Pointer(p)).FpBt)).FbtsFlags) & BTS_READ_ONLY) != 0))
+func Xsqlite3BtreeIsReadonly(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:76415:20: */
+ return libc.Bool32(int32((*BtShared)(unsafe.Pointer((*Btree)(unsafe.Pointer(p)).FpBt)).FbtsFlags)&BTS_READ_ONLY != 0)
}
// Return the size of the header added to each page by this module.
-func Xsqlite3HeaderSizeBtree(tls *libc.TLS) int32 { /* sqlite3.c:76201:20: */
- return (int32(((uint32(unsafe.Sizeof(MemPage{}))) + uint32(7)) & libc.Uint32FromInt32(libc.CplInt32(7))))
+func Xsqlite3HeaderSizeBtree(tls *libc.TLS) int32 { /* sqlite3.c:76422:20: */
+ return int32((uint32(unsafe.Sizeof(MemPage{})) + uint32(7)) & libc.Uint32FromInt32(libc.CplInt32(7)))
}
// Return true if the Btree passed as the only argument is sharable.
-func Xsqlite3BtreeSharable(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:76207:20: */
+func Xsqlite3BtreeSharable(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:76428:20: */
return int32((*Btree)(unsafe.Pointer(p)).Fsharable)
}
// Return the number of connections to the BtShared object accessed by
// the Btree handle passed as the only argument. For private caches
// this is always 1. For shared caches it may be 1 or greater.
-func Xsqlite3BtreeConnectionCount(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:76216:20: */
+func Xsqlite3BtreeConnectionCount(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:76437:20: */
return (*BtShared)(unsafe.Pointer((*Btree)(unsafe.Pointer(p)).FpBt)).FnRef
}
@@ -54119,20 +54833,20 @@ func Xsqlite3BtreeConnectionCount(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c
// If the "temp" database is requested, it may need to be opened by this
// function. If an error occurs while doing so, return 0 and write an
// error message to pErrorDb.
-func findBtree(tls *libc.TLS, pErrorDb uintptr, pDb uintptr, zDb uintptr) uintptr { /* sqlite3.c:76305:14: */
- bp := tls.Alloc(288)
- defer tls.Free(288)
+func findBtree(tls *libc.TLS, pErrorDb uintptr, pDb uintptr, zDb uintptr) uintptr { /* sqlite3.c:76526:14: */
+ bp := tls.Alloc(284)
+ defer tls.Free(284)
var i int32 = Xsqlite3FindDbName(tls, pDb, zDb)
if i == 1 {
- // var sParse Parse at bp+16, 272
+ // var sParse Parse at bp+16, 268
var rc int32 = 0
libc.Xmemset(tls, bp+16 /* &sParse */, 0, uint32(unsafe.Sizeof(Parse{})))
(*Parse)(unsafe.Pointer(bp + 16 /* &sParse */)).Fdb = pDb
- if Xsqlite3OpenTempDatabase(tls, bp+16 /* &sParse */) != 0 {
- Xsqlite3ErrorWithMsg(tls, pErrorDb, (*Parse)(unsafe.Pointer(bp+16 /* &sParse */)).Frc, ts+2790 /* "%s" */, libc.VaList(bp, (*Parse)(unsafe.Pointer(bp+16 /* &sParse */)).FzErrMsg))
+ if Xsqlite3OpenTempDatabase(tls, bp+16) != 0 {
+ Xsqlite3ErrorWithMsg(tls, pErrorDb, (*Parse)(unsafe.Pointer(bp+16 /* &sParse */)).Frc, ts+3601 /* "%s" */, libc.VaList(bp, (*Parse)(unsafe.Pointer(bp+16 /* &sParse */)).FzErrMsg))
rc = SQLITE_ERROR
}
Xsqlite3DbFree(tls, pErrorDb, (*Parse)(unsafe.Pointer(bp+16 /* &sParse */)).FzErrMsg)
@@ -54143,7 +54857,7 @@ func findBtree(tls *libc.TLS, pErrorDb uintptr, pDb uintptr, zDb uintptr) uintpt
}
if i < 0 {
- Xsqlite3ErrorWithMsg(tls, pErrorDb, SQLITE_ERROR, ts+3943 /* "unknown database..." */, libc.VaList(bp+8, zDb))
+ Xsqlite3ErrorWithMsg(tls, pErrorDb, SQLITE_ERROR, ts+4754 /* "unknown database..." */, libc.VaList(bp+8, zDb))
return uintptr(0)
}
@@ -54152,7 +54866,7 @@ func findBtree(tls *libc.TLS, pErrorDb uintptr, pDb uintptr, zDb uintptr) uintpt
// Attempt to set the page size of the destination to match the page size
// of the source.
-func setDestPgsz(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:76336:12: */
+func setDestPgsz(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:76557:12: */
var rc int32
rc = Xsqlite3BtreeSetPageSize(tls, (*Sqlite3_backup)(unsafe.Pointer(p)).FpDest, Xsqlite3BtreeGetPageSize(tls, (*Sqlite3_backup)(unsafe.Pointer(p)).FpSrc), 0, 0)
return rc
@@ -54162,9 +54876,9 @@ func setDestPgsz(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:76336:12: */
// second argument. If there is not, return SQLITE_OK. Otherwise, if there
// is an open read-transaction, return SQLITE_ERROR and leave an error
// message in database handle db.
-func checkReadTransaction(tls *libc.TLS, db uintptr, p uintptr) int32 { /* sqlite3.c:76348:12: */
+func checkReadTransaction(tls *libc.TLS, db uintptr, p uintptr) int32 { /* sqlite3.c:76569:12: */
if Xsqlite3BtreeTxnState(tls, p) != SQLITE_TXN_NONE {
- Xsqlite3ErrorWithMsg(tls, db, SQLITE_ERROR, ts+3963 /* "destination data..." */, 0)
+ Xsqlite3ErrorWithMsg(tls, db, SQLITE_ERROR, ts+4774 /* "destination data..." */, 0)
return SQLITE_ERROR
}
return SQLITE_OK
@@ -54176,7 +54890,7 @@ func checkReadTransaction(tls *libc.TLS, db uintptr, p uintptr) int32 { /* sqlit
//
// If an error occurs, NULL is returned and an error code and error message
// stored in database handle pDestDb.
-func Xsqlite3_backup_init(tls *libc.TLS, pDestDb uintptr, zDestDb uintptr, pSrcDb uintptr, zSrcDb uintptr) uintptr { /* sqlite3.c:76364:27: */
+func Xsqlite3_backup_init(tls *libc.TLS, pDestDb uintptr, zDestDb uintptr, pSrcDb uintptr, zSrcDb uintptr) uintptr { /* sqlite3.c:76585:27: */
var p uintptr // Value to return
// Lock the source database handle. The destination database
@@ -54191,7 +54905,7 @@ func Xsqlite3_backup_init(tls *libc.TLS, pDestDb uintptr, zDestDb uintptr, pSrcD
if pSrcDb == pDestDb {
Xsqlite3ErrorWithMsg(tls,
- pDestDb, SQLITE_ERROR, ts+3994 /* "source and desti..." */, 0)
+ pDestDb, SQLITE_ERROR, ts+4805 /* "source and desti..." */, 0)
p = uintptr(0)
} else {
// Allocate space for a new sqlite3_backup object...
@@ -54213,8 +54927,8 @@ func Xsqlite3_backup_init(tls *libc.TLS, pDestDb uintptr, zDestDb uintptr, pSrcD
(*Sqlite3_backup)(unsafe.Pointer(p)).FiNext = Pgno(1)
(*Sqlite3_backup)(unsafe.Pointer(p)).FisAttached = 0
- if ((uintptr(0) == (*Sqlite3_backup)(unsafe.Pointer(p)).FpSrc) || (uintptr(0) == (*Sqlite3_backup)(unsafe.Pointer(p)).FpDest)) ||
- (checkReadTransaction(tls, pDestDb, (*Sqlite3_backup)(unsafe.Pointer(p)).FpDest) != SQLITE_OK) {
+ if uintptr(0) == (*Sqlite3_backup)(unsafe.Pointer(p)).FpSrc || uintptr(0) == (*Sqlite3_backup)(unsafe.Pointer(p)).FpDest ||
+ checkReadTransaction(tls, pDestDb, (*Sqlite3_backup)(unsafe.Pointer(p)).FpDest) != SQLITE_OK {
// One (or both) of the named databases did not exist or an OOM
// error was hit. Or there is a transaction open on the destination
// database. The error has already been written into the pDestDb
@@ -54236,14 +54950,14 @@ func Xsqlite3_backup_init(tls *libc.TLS, pDestDb uintptr, zDestDb uintptr, pSrcD
// Argument rc is an SQLite error code. Return true if this error is
// considered fatal if encountered during a backup operation. All errors
// are considered fatal except for SQLITE_BUSY and SQLITE_LOCKED.
-func isFatalError(tls *libc.TLS, rc int32) int32 { /* sqlite3.c:76441:12: */
- return (libc.Bool32(((rc != SQLITE_OK) && (rc != SQLITE_BUSY)) && (rc != SQLITE_LOCKED)))
+func isFatalError(tls *libc.TLS, rc int32) int32 { /* sqlite3.c:76662:12: */
+ return libc.Bool32(rc != SQLITE_OK && rc != SQLITE_BUSY && rc != SQLITE_LOCKED)
}
// Parameter zSrcData points to a buffer containing the data for
// page iSrcPg from the source database. Copy this data into the
// destination database.
-func backupOnePage(tls *libc.TLS, p uintptr, iSrcPg Pgno, zSrcData uintptr, bUpdate int32) int32 { /* sqlite3.c:76450:12: */
+func backupOnePage(tls *libc.TLS, p uintptr, iSrcPg Pgno, zSrcData uintptr, bUpdate int32) int32 { /* sqlite3.c:76671:12: */
bp := tls.Alloc(4)
defer tls.Free(4)
@@ -54251,35 +54965,35 @@ func backupOnePage(tls *libc.TLS, p uintptr, iSrcPg Pgno, zSrcData uintptr, bUpd
var nSrcPgsz int32 = Xsqlite3BtreeGetPageSize(tls, (*Sqlite3_backup)(unsafe.Pointer(p)).FpSrc)
var nDestPgsz int32 = Xsqlite3BtreeGetPageSize(tls, (*Sqlite3_backup)(unsafe.Pointer(p)).FpDest)
var nCopy int32 = func() int32 {
- if (nSrcPgsz) < (nDestPgsz) {
+ if nSrcPgsz < nDestPgsz {
return nSrcPgsz
}
return nDestPgsz
}()
- var iEnd I64 = (I64(iSrcPg) * I64(nSrcPgsz))
+ var iEnd I64 = I64(iSrcPg) * I64(nSrcPgsz)
var rc int32 = SQLITE_OK
var iOff I64
// Catch the case where the destination is an in-memory database and the
// page sizes of the source and destination differ.
- if (nSrcPgsz != nDestPgsz) && (Xsqlite3PagerIsMemdb(tls, pDestPager) != 0) {
+ if nSrcPgsz != nDestPgsz && Xsqlite3PagerIsMemdb(tls, pDestPager) != 0 {
rc = SQLITE_READONLY
}
// This loop runs once for each destination page spanned by the source
// page. For each iteration, variable iOff is set to the byte offset
// of the destination page.
- for iOff = (iEnd - I64(nSrcPgsz)); (rc == SQLITE_OK) && (iOff < iEnd); iOff = iOff + (I64(nDestPgsz)) {
+ for iOff = iEnd - I64(nSrcPgsz); rc == SQLITE_OK && iOff < iEnd; iOff = iOff + I64(nDestPgsz) {
*(*uintptr)(unsafe.Pointer(bp /* pDestPg */)) = uintptr(0)
- var iDest Pgno = ((Pgno(iOff / I64(nDestPgsz))) + Pgno(1))
- if iDest == ((U32(Xsqlite3PendingByte) / ((*BtShared)(unsafe.Pointer((*Btree)(unsafe.Pointer((*Sqlite3_backup)(unsafe.Pointer(p)).FpDest)).FpBt)).FpageSize)) + U32(1)) {
+ var iDest Pgno = Pgno(iOff/I64(nDestPgsz)) + Pgno(1)
+ if iDest == U32(Xsqlite3PendingByte)/(*BtShared)(unsafe.Pointer((*Btree)(unsafe.Pointer((*Sqlite3_backup)(unsafe.Pointer(p)).FpDest)).FpBt)).FpageSize+U32(1) {
continue
}
- if (SQLITE_OK == (libc.AssignInt32(&rc, Xsqlite3PagerGet(tls, pDestPager, iDest, bp /* &pDestPg */, 0)))) &&
- (SQLITE_OK == (libc.AssignInt32(&rc, Xsqlite3PagerWrite(tls, *(*uintptr)(unsafe.Pointer(bp /* pDestPg */)))))) {
- var zIn uintptr = (zSrcData + uintptr((iOff % I64(nSrcPgsz))))
+ if SQLITE_OK == libc.AssignInt32(&rc, Xsqlite3PagerGet(tls, pDestPager, iDest, bp, 0)) &&
+ SQLITE_OK == libc.AssignInt32(&rc, Xsqlite3PagerWrite(tls, *(*uintptr)(unsafe.Pointer(bp)))) {
+ var zIn uintptr = zSrcData + uintptr(iOff%I64(nSrcPgsz))
var zDestData uintptr = Xsqlite3PagerGetData(tls, *(*uintptr)(unsafe.Pointer(bp /* pDestPg */)))
- var zOut uintptr = (zDestData + uintptr((iOff % I64(nDestPgsz))))
+ var zOut uintptr = zDestData + uintptr(iOff%I64(nDestPgsz))
// Copy the data from the source page into the destination page.
// Then clear the Btree layer MemPage.isInit flag. Both this module
@@ -54288,9 +55002,9 @@ func backupOnePage(tls *libc.TLS, p uintptr, iSrcPg Pgno, zSrcData uintptr, bUpd
// cached parse of the page). MemPage.isInit is marked
// "MUST BE FIRST" for this purpose.
libc.Xmemcpy(tls, zOut, zIn, uint32(nCopy))
- *(*U8)(unsafe.Pointer((Xsqlite3PagerGetExtra(tls, *(*uintptr)(unsafe.Pointer(bp /* pDestPg */)))))) = U8(0)
- if (iOff == int64(0)) && (bUpdate == 0) {
- Xsqlite3Put4byte(tls, (zOut + 28), Xsqlite3BtreeLastPage(tls, (*Sqlite3_backup)(unsafe.Pointer(p)).FpSrc))
+ *(*U8)(unsafe.Pointer(Xsqlite3PagerGetExtra(tls, *(*uintptr)(unsafe.Pointer(bp))))) = U8(0)
+ if iOff == int64(0) && bUpdate == 0 {
+ Xsqlite3Put4byte(tls, zOut+28, Xsqlite3BtreeLastPage(tls, (*Sqlite3_backup)(unsafe.Pointer(p)).FpSrc))
}
}
Xsqlite3PagerUnref(tls, *(*uintptr)(unsafe.Pointer(bp /* pDestPg */)))
@@ -54305,14 +55019,14 @@ func backupOnePage(tls *libc.TLS, p uintptr, iSrcPg Pgno, zSrcData uintptr, bUpd
//
// Return SQLITE_OK if everything is successful, or an SQLite error
// code if an error occurs.
-func backupTruncateFile(tls *libc.TLS, pFile uintptr, iSize I64) int32 { /* sqlite3.c:76519:12: */
+func backupTruncateFile(tls *libc.TLS, pFile uintptr, iSize I64) int32 { /* sqlite3.c:76740:12: */
bp := tls.Alloc(8)
defer tls.Free(8)
// var iCurrent I64 at bp, 8
var rc int32 = Xsqlite3OsFileSize(tls, pFile, bp /* &iCurrent */)
- if (rc == SQLITE_OK) && (*(*I64)(unsafe.Pointer(bp /* iCurrent */)) > iSize) {
+ if rc == SQLITE_OK && *(*I64)(unsafe.Pointer(bp)) > iSize {
rc = Xsqlite3OsTruncate(tls, pFile, iSize)
}
return rc
@@ -54320,7 +55034,7 @@ func backupTruncateFile(tls *libc.TLS, pFile uintptr, iSize I64) int32 { /* sqli
// Register this backup object with the associated source pager for
// callbacks when pages are changed or the cache invalidated.
-func attachBackupObject(tls *libc.TLS, p uintptr) { /* sqlite3.c:76532:13: */
+func attachBackupObject(tls *libc.TLS, p uintptr) { /* sqlite3.c:76753:13: */
var pp uintptr
pp = Xsqlite3PagerBackupPtr(tls, Xsqlite3BtreePager(tls, (*Sqlite3_backup)(unsafe.Pointer(p)).FpSrc))
@@ -54330,7 +55044,7 @@ func attachBackupObject(tls *libc.TLS, p uintptr) { /* sqlite3.c:76532:13: */
}
// Copy nPage pages from the source b-tree to the destination.
-func Xsqlite3_backup_step(tls *libc.TLS, p uintptr, nPage int32) int32 { /* sqlite3.c:76544:16: */
+func Xsqlite3_backup_step(tls *libc.TLS, p uintptr, nPage int32) int32 { /* sqlite3.c:76765:16: */
bp := tls.Alloc(16)
defer tls.Free(16)
@@ -54355,7 +55069,7 @@ func Xsqlite3_backup_step(tls *libc.TLS, p uintptr, nPage int32) int32 { /* sqli
// If the source pager is currently in a write-transaction, return
// SQLITE_BUSY immediately.
- if ((*Sqlite3_backup)(unsafe.Pointer(p)).FpDestDb != 0) && (int32((*BtShared)(unsafe.Pointer((*Btree)(unsafe.Pointer((*Sqlite3_backup)(unsafe.Pointer(p)).FpSrc)).FpBt)).FinTransaction) == TRANS_WRITE) {
+ if (*Sqlite3_backup)(unsafe.Pointer(p)).FpDestDb != 0 && int32((*BtShared)(unsafe.Pointer((*Btree)(unsafe.Pointer((*Sqlite3_backup)(unsafe.Pointer(p)).FpSrc)).FpBt)).FinTransaction) == TRANS_WRITE {
rc = SQLITE_BUSY
} else {
rc = SQLITE_OK
@@ -54364,7 +55078,7 @@ func Xsqlite3_backup_step(tls *libc.TLS, p uintptr, nPage int32) int32 { /* sqli
// If there is no open read-transaction on the source database, open
// one now. If a transaction is opened here, then it will be closed
// before this function exits.
- if (rc == SQLITE_OK) && (SQLITE_TXN_NONE == Xsqlite3BtreeTxnState(tls, (*Sqlite3_backup)(unsafe.Pointer(p)).FpSrc)) {
+ if rc == SQLITE_OK && SQLITE_TXN_NONE == Xsqlite3BtreeTxnState(tls, (*Sqlite3_backup)(unsafe.Pointer(p)).FpSrc) {
rc = Xsqlite3BtreeBeginTrans(tls, (*Sqlite3_backup)(unsafe.Pointer(p)).FpSrc, 0, uintptr(0))
bCloseTrans = 1
}
@@ -54375,14 +55089,14 @@ func Xsqlite3_backup_step(tls *libc.TLS, p uintptr, nPage int32) int32 { /* sqli
// is especially important on ZipVFS systems, as in that case it is
// not possible to create a database file that uses one page size by
// writing to it with another.
- if (((*Sqlite3_backup)(unsafe.Pointer(p)).FbDestLocked == 0) && (rc == SQLITE_OK)) && (setDestPgsz(tls, p) == SQLITE_NOMEM) {
+ if (*Sqlite3_backup)(unsafe.Pointer(p)).FbDestLocked == 0 && rc == SQLITE_OK && setDestPgsz(tls, p) == SQLITE_NOMEM {
rc = SQLITE_NOMEM
}
// Lock the destination database, if it is not locked already.
- if ((SQLITE_OK == rc) && ((*Sqlite3_backup)(unsafe.Pointer(p)).FbDestLocked == 0)) &&
- (SQLITE_OK == (libc.AssignInt32(&rc, Xsqlite3BtreeBeginTrans(tls, (*Sqlite3_backup)(unsafe.Pointer(p)).FpDest, 2,
- (p+8 /* &.iDestSchema */))))) {
+ if SQLITE_OK == rc && (*Sqlite3_backup)(unsafe.Pointer(p)).FbDestLocked == 0 &&
+ SQLITE_OK == libc.AssignInt32(&rc, Xsqlite3BtreeBeginTrans(tls, (*Sqlite3_backup)(unsafe.Pointer(p)).FpDest, 2,
+ p+8)) {
(*Sqlite3_backup)(unsafe.Pointer(p)).FbDestLocked = 1
}
@@ -54391,7 +55105,7 @@ func Xsqlite3_backup_step(tls *libc.TLS, p uintptr, nPage int32) int32 { /* sqli
pgszSrc = Xsqlite3BtreeGetPageSize(tls, (*Sqlite3_backup)(unsafe.Pointer(p)).FpSrc)
pgszDest = Xsqlite3BtreeGetPageSize(tls, (*Sqlite3_backup)(unsafe.Pointer(p)).FpDest)
destMode = Xsqlite3PagerGetJournalMode(tls, Xsqlite3BtreePager(tls, (*Sqlite3_backup)(unsafe.Pointer(p)).FpDest))
- if ((SQLITE_OK == rc) && (destMode == PAGER_JOURNALMODE_WAL)) && (pgszSrc != pgszDest) {
+ if SQLITE_OK == rc && destMode == PAGER_JOURNALMODE_WAL && pgszSrc != pgszDest {
rc = SQLITE_READONLY
}
@@ -54399,9 +55113,9 @@ func Xsqlite3_backup_step(tls *libc.TLS, p uintptr, nPage int32) int32 { /* sqli
// source pager for the number of pages in the database.
nSrcPage = int32(Xsqlite3BtreeLastPage(tls, (*Sqlite3_backup)(unsafe.Pointer(p)).FpSrc))
- for ii = 0; (((nPage < 0) || (ii < nPage)) && ((*Sqlite3_backup)(unsafe.Pointer(p)).FiNext <= Pgno(nSrcPage))) && !(rc != 0); ii++ {
+ for ii = 0; (nPage < 0 || ii < nPage) && (*Sqlite3_backup)(unsafe.Pointer(p)).FiNext <= Pgno(nSrcPage) && !(rc != 0); ii++ {
var iSrcPg Pgno = (*Sqlite3_backup)(unsafe.Pointer(p)).FiNext // Source page number
- if iSrcPg != ((U32(Xsqlite3PendingByte) / ((*BtShared)(unsafe.Pointer((*Btree)(unsafe.Pointer((*Sqlite3_backup)(unsafe.Pointer(p)).FpSrc)).FpBt)).FpageSize)) + U32(1)) {
+ if iSrcPg != U32(Xsqlite3PendingByte)/(*BtShared)(unsafe.Pointer((*Btree)(unsafe.Pointer((*Sqlite3_backup)(unsafe.Pointer(p)).FpSrc)).FpBt)).FpageSize+U32(1) {
// var pSrcPg uintptr at bp, 4
// Source page object
rc = Xsqlite3PagerGet(tls, pSrcPager, iSrcPg, bp /* &pSrcPg */, PAGER_GET_READONLY)
@@ -54414,7 +55128,7 @@ func Xsqlite3_backup_step(tls *libc.TLS, p uintptr, nPage int32) int32 { /* sqli
}
if rc == SQLITE_OK {
(*Sqlite3_backup)(unsafe.Pointer(p)).FnPagecount = Pgno(nSrcPage)
- (*Sqlite3_backup)(unsafe.Pointer(p)).FnRemaining = ((Pgno(nSrcPage + 1)) - (*Sqlite3_backup)(unsafe.Pointer(p)).FiNext)
+ (*Sqlite3_backup)(unsafe.Pointer(p)).FnRemaining = Pgno(nSrcPage+1) - (*Sqlite3_backup)(unsafe.Pointer(p)).FiNext
if (*Sqlite3_backup)(unsafe.Pointer(p)).FiNext > Pgno(nSrcPage) {
rc = SQLITE_DONE
} else if !((*Sqlite3_backup)(unsafe.Pointer(p)).FisAttached != 0) {
@@ -54431,8 +55145,8 @@ func Xsqlite3_backup_step(tls *libc.TLS, p uintptr, nPage int32) int32 { /* sqli
rc = Xsqlite3BtreeNewDb(tls, (*Sqlite3_backup)(unsafe.Pointer(p)).FpDest)
nSrcPage = 1
}
- if (rc == SQLITE_OK) || (rc == SQLITE_DONE) {
- rc = Xsqlite3BtreeUpdateMeta(tls, (*Sqlite3_backup)(unsafe.Pointer(p)).FpDest, 1, ((*Sqlite3_backup)(unsafe.Pointer(p)).FiDestSchema + U32(1)))
+ if rc == SQLITE_OK || rc == SQLITE_DONE {
+ rc = Xsqlite3BtreeUpdateMeta(tls, (*Sqlite3_backup)(unsafe.Pointer(p)).FpDest, 1, (*Sqlite3_backup)(unsafe.Pointer(p)).FiDestSchema+U32(1))
}
if rc == SQLITE_OK {
if (*Sqlite3_backup)(unsafe.Pointer(p)).FpDestDb != 0 {
@@ -54457,13 +55171,13 @@ func Xsqlite3_backup_step(tls *libc.TLS, p uintptr, nPage int32) int32 { /* sqli
// by the file truncation.
if pgszSrc < pgszDest {
- var ratio int32 = (pgszDest / pgszSrc)
- nDestTruncate = (((nSrcPage + ratio) - 1) / ratio)
- if nDestTruncate == (int32(((U32(Xsqlite3PendingByte) / ((*BtShared)(unsafe.Pointer((*Btree)(unsafe.Pointer((*Sqlite3_backup)(unsafe.Pointer(p)).FpDest)).FpBt)).FpageSize)) + U32(1)))) {
+ var ratio int32 = pgszDest / pgszSrc
+ nDestTruncate = (nSrcPage + ratio - 1) / ratio
+ if nDestTruncate == int32(U32(Xsqlite3PendingByte)/(*BtShared)(unsafe.Pointer((*Btree)(unsafe.Pointer((*Sqlite3_backup)(unsafe.Pointer(p)).FpDest)).FpBt)).FpageSize+U32(1)) {
nDestTruncate--
}
} else {
- nDestTruncate = (nSrcPage * (pgszSrc / pgszDest))
+ nDestTruncate = nSrcPage * (pgszSrc / pgszDest)
}
if pgszSrc < pgszDest {
@@ -54475,7 +55189,7 @@ func Xsqlite3_backup_step(tls *libc.TLS, p uintptr, nPage int32) int32 { /* sqli
// * Data stored on the pages immediately following the
// pending-byte page in the source database may need to be
// copied into the destination database.
- var iSize I64 = (I64(pgszSrc) * I64(nSrcPage))
+ var iSize I64 = I64(pgszSrc) * I64(nSrcPage)
var pFile uintptr = Xsqlite3PagerFile(tls, pDestPager)
var iPg Pgno
// var nDstPage int32 at bp+4, 4
@@ -54490,8 +55204,8 @@ func Xsqlite3_backup_step(tls *libc.TLS, p uintptr, nPage int32) int32 { /* sqli
// occurs, the original database will be reconstructed from the
// journal file.
Xsqlite3PagerPagecount(tls, pDestPager, bp+4 /* &nDstPage */)
- for iPg = Pgno(nDestTruncate); (rc == SQLITE_OK) && (iPg <= Pgno(*(*int32)(unsafe.Pointer(bp + 4 /* nDstPage */)))); iPg++ {
- if iPg != ((U32(Xsqlite3PendingByte) / ((*BtShared)(unsafe.Pointer((*Btree)(unsafe.Pointer((*Sqlite3_backup)(unsafe.Pointer(p)).FpDest)).FpBt)).FpageSize)) + U32(1)) {
+ for iPg = Pgno(nDestTruncate); rc == SQLITE_OK && iPg <= Pgno(*(*int32)(unsafe.Pointer(bp + 4 /* nDstPage */))); iPg++ {
+ if iPg != U32(Xsqlite3PendingByte)/(*BtShared)(unsafe.Pointer((*Btree)(unsafe.Pointer((*Sqlite3_backup)(unsafe.Pointer(p)).FpDest)).FpBt)).FpageSize+U32(1) {
// var pPg uintptr at bp+8, 4
rc = Xsqlite3PagerGet(tls, pDestPager, iPg, bp+8 /* &pPg */, 0)
@@ -54507,14 +55221,14 @@ func Xsqlite3_backup_step(tls *libc.TLS, p uintptr, nPage int32) int32 { /* sqli
// Write the extra pages and truncate the database file as required
iEnd = func() int64 {
- if (I64(Xsqlite3PendingByte + pgszDest)) < (iSize) {
- return (int64(Xsqlite3PendingByte + pgszDest))
+ if I64(Xsqlite3PendingByte+pgszDest) < iSize {
+ return int64(Xsqlite3PendingByte + pgszDest)
}
return iSize
}()
- for iOff = (I64(Xsqlite3PendingByte + pgszSrc)); (rc == SQLITE_OK) && (iOff < iEnd); iOff = iOff + (I64(pgszSrc)) {
+ for iOff = I64(Xsqlite3PendingByte + pgszSrc); rc == SQLITE_OK && iOff < iEnd; iOff = iOff + I64(pgszSrc) {
*(*uintptr)(unsafe.Pointer(bp + 12 /* pSrcPg */)) = uintptr(0)
- var iSrcPg Pgno = (Pgno((iOff / I64(pgszSrc)) + int64(1)))
+ var iSrcPg Pgno = Pgno(iOff/I64(pgszSrc) + int64(1))
rc = Xsqlite3PagerGet(tls, pSrcPager, iSrcPg, bp+12 /* &pSrcPg */, 0)
if rc == SQLITE_OK {
var zData uintptr = Xsqlite3PagerGetData(tls, *(*uintptr)(unsafe.Pointer(bp + 12 /* pSrcPg */)))
@@ -54536,8 +55250,8 @@ func Xsqlite3_backup_step(tls *libc.TLS, p uintptr, nPage int32) int32 { /* sqli
}
// Finish committing the transaction to the destination database.
- if (SQLITE_OK == rc) &&
- (SQLITE_OK == (libc.AssignInt32(&rc, Xsqlite3BtreeCommitPhaseTwo(tls, (*Sqlite3_backup)(unsafe.Pointer(p)).FpDest, 0)))) {
+ if SQLITE_OK == rc &&
+ SQLITE_OK == libc.AssignInt32(&rc, Xsqlite3BtreeCommitPhaseTwo(tls, (*Sqlite3_backup)(unsafe.Pointer(p)).FpDest, 0)) {
rc = SQLITE_DONE
}
}
@@ -54554,7 +55268,7 @@ func Xsqlite3_backup_step(tls *libc.TLS, p uintptr, nPage int32) int32 { /* sqli
}
- if rc == (SQLITE_IOERR | (int32(12) << 8)) {
+ if rc == SQLITE_IOERR|int32(12)<<8 {
rc = SQLITE_NOMEM
}
(*Sqlite3_backup)(unsafe.Pointer(p)).Frc = rc
@@ -54568,7 +55282,7 @@ func Xsqlite3_backup_step(tls *libc.TLS, p uintptr, nPage int32) int32 { /* sqli
}
// Release all resources associated with an sqlite3_backup* handle.
-func Xsqlite3_backup_finish(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:76798:16: */
+func Xsqlite3_backup_finish(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:77019:16: */
var pp uintptr // Ptr to head of pagers backup list
var pSrcDb uintptr // Source database connection
var rc int32 // Value to return
@@ -54592,7 +55306,7 @@ func Xsqlite3_backup_finish(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:76798
pp = Xsqlite3PagerBackupPtr(tls, Xsqlite3BtreePager(tls, (*Sqlite3_backup)(unsafe.Pointer(p)).FpSrc))
for *(*uintptr)(unsafe.Pointer(pp)) != p {
- pp = (*(*uintptr)(unsafe.Pointer(pp)) + 44 /* &.pNext */)
+ pp = *(*uintptr)(unsafe.Pointer(pp)) + 44
}
*(*uintptr)(unsafe.Pointer(pp)) = (*Sqlite3_backup)(unsafe.Pointer(p)).FpNext
@@ -54626,13 +55340,13 @@ func Xsqlite3_backup_finish(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:76798
// Return the number of pages still to be backed up as of the most recent
// call to sqlite3_backup_step().
-func Xsqlite3_backup_remaining(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:76852:16: */
+func Xsqlite3_backup_remaining(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:77073:16: */
return int32((*Sqlite3_backup)(unsafe.Pointer(p)).FnRemaining)
}
// Return the total number of pages in the source database as of the most
// recent call to sqlite3_backup_step().
-func Xsqlite3_backup_pagecount(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:76866:16: */
+func Xsqlite3_backup_pagecount(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:77087:16: */
return int32((*Sqlite3_backup)(unsafe.Pointer(p)).FnPagecount)
}
@@ -54646,11 +55360,11 @@ func Xsqlite3_backup_pagecount(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:76
// It is assumed that the mutex associated with the BtShared object
// corresponding to the source database is held when this function is
// called.
-func backupUpdate(tls *libc.TLS, p uintptr, iPage Pgno, aData uintptr) { /* sqlite3.c:76888:29: */
+func backupUpdate(tls *libc.TLS, p uintptr, iPage Pgno, aData uintptr) { /* sqlite3.c:77109:29: */
- for ok := true; ok; ok = ((libc.AssignUintptr(&p, (*Sqlite3_backup)(unsafe.Pointer(p)).FpNext)) != uintptr(0)) {
+ for ok := true; ok; ok = libc.AssignUintptr(&p, (*Sqlite3_backup)(unsafe.Pointer(p)).FpNext) != uintptr(0) {
- if !(isFatalError(tls, (*Sqlite3_backup)(unsafe.Pointer(p)).Frc) != 0) && (iPage < (*Sqlite3_backup)(unsafe.Pointer(p)).FiNext) {
+ if !(isFatalError(tls, (*Sqlite3_backup)(unsafe.Pointer(p)).Frc) != 0) && iPage < (*Sqlite3_backup)(unsafe.Pointer(p)).FiNext {
// The backup process p has already copied page iPage. But now it
// has been modified by a transaction on the source pager. Copy
// the new data into the backup.
@@ -54667,7 +55381,7 @@ func backupUpdate(tls *libc.TLS, p uintptr, iPage Pgno, aData uintptr) { /* sqli
}
}
-func Xsqlite3BackupUpdate(tls *libc.TLS, pBackup uintptr, iPage Pgno, aData uintptr) { /* sqlite3.c:76913:21: */
+func Xsqlite3BackupUpdate(tls *libc.TLS, pBackup uintptr, iPage Pgno, aData uintptr) { /* sqlite3.c:77134:21: */
if pBackup != 0 {
backupUpdate(tls, pBackup, iPage, aData)
}
@@ -54682,7 +55396,7 @@ func Xsqlite3BackupUpdate(tls *libc.TLS, pBackup uintptr, iPage Pgno, aData uint
// It is assumed that the mutex associated with the BtShared object
// corresponding to the source database is held when this function is
// called.
-func Xsqlite3BackupRestart(tls *libc.TLS, pBackup uintptr) { /* sqlite3.c:76928:21: */
+func Xsqlite3BackupRestart(tls *libc.TLS, pBackup uintptr) { /* sqlite3.c:77149:21: */
var p uintptr // Iterator variable
for p = pBackup; p != 0; p = (*Sqlite3_backup)(unsafe.Pointer(p)).FpNext {
@@ -54696,7 +55410,7 @@ func Xsqlite3BackupRestart(tls *libc.TLS, pBackup uintptr) { /* sqlite3.c:76928:
// The size of file pTo may be reduced by this operation. If anything
// goes wrong, the transaction on pTo is rolled back. If successful, the
// transaction is committed before returning.
-func Xsqlite3BtreeCopyFile(tls *libc.TLS, pTo uintptr, pFrom uintptr) int32 { /* sqlite3.c:76945:20: */
+func Xsqlite3BtreeCopyFile(tls *libc.TLS, pTo uintptr, pFrom uintptr) int32 { /* sqlite3.c:77166:20: */
bp := tls.Alloc(56)
defer tls.Free(56)
@@ -54713,7 +55427,7 @@ func Xsqlite3BtreeCopyFile(tls *libc.TLS, pTo uintptr, pFrom uintptr) int32 { /*
if !((*Sqlite3_file)(unsafe.Pointer(pFd)).FpMethods != 0) {
goto __1
}
- *(*I64)(unsafe.Pointer(bp /* nByte */)) = (I64(Xsqlite3BtreeGetPageSize(tls, pFrom)) * I64(Xsqlite3BtreeLastPage(tls, pFrom)))
+ *(*I64)(unsafe.Pointer(bp /* nByte */)) = I64(Xsqlite3BtreeGetPageSize(tls, pFrom)) * I64(Xsqlite3BtreeLastPage(tls, pFrom))
rc = Xsqlite3OsFileControl(tls, pFd, SQLITE_FCNTL_OVERWRITE, bp /* &nByte */)
if !(rc == SQLITE_NOTFOUND) {
goto __2
@@ -54752,7 +55466,7 @@ __1:
if !(rc == SQLITE_OK) {
goto __4
}
- *(*U16)(unsafe.Pointer((*Btree)(unsafe.Pointer(pTo)).FpBt + 24 /* &.btsFlags */)) &= libc.Uint16FromInt32((libc.CplInt32(BTS_PAGESIZE_FIXED)))
+ *(*U16)(unsafe.Pointer((*Btree)(unsafe.Pointer(pTo)).FpBt + 24)) &= libc.Uint16FromInt32(libc.CplInt32(BTS_PAGESIZE_FIXED))
goto __5
__4:
Xsqlite3PagerClearCache(tls, Xsqlite3BtreePager(tls, (*Sqlite3_backup)(unsafe.Pointer(bp+8 /* &b */)).FpDest))
@@ -54790,27 +55504,27 @@ copy_finished:
// Render a Mem object which is one of MEM_Int, MEM_Real, or MEM_IntReal
// into a buffer.
-func vdbeMemRenderNum(tls *libc.TLS, sz int32, zBuf uintptr, p uintptr) { /* sqlite3.c:77103:13: */
+func vdbeMemRenderNum(tls *libc.TLS, sz int32, zBuf uintptr, p uintptr) { /* sqlite3.c:77324:13: */
bp := tls.Alloc(40)
defer tls.Free(40)
// var acc StrAccum at bp+16, 24
- if (int32((*Mem)(unsafe.Pointer(p)).Fflags) & MEM_Int) != 0 {
+ if int32((*Mem)(unsafe.Pointer(p)).Fflags)&MEM_Int != 0 {
// Work-around for GCC bug
// https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96270
// var x I64 at bp+8, 8
- libc.Xmemcpy(tls, bp+8 /* &x */, (p /* &.u */), (uint32((int32((*Mem)(unsafe.Pointer(p)).Fflags) & MEM_Int) * 2)))
+ libc.Xmemcpy(tls, bp+8 /* &x */, p, uint32(int32((*Mem)(unsafe.Pointer(p)).Fflags)&MEM_Int*2))
Xsqlite3Int64ToText(tls, *(*I64)(unsafe.Pointer(bp + 8 /* x */)), zBuf)
} else {
Xsqlite3StrAccumInit(tls, bp+16 /* &acc */, uintptr(0), zBuf, sz, 0)
- Xsqlite3_str_appendf(tls, bp+16 /* &acc */, ts+4034, /* "%!.15g" */
+ Xsqlite3_str_appendf(tls, bp+16 /* &acc */, ts+4845, /* "%!.15g" */
libc.VaList(bp, func() float64 {
- if (int32((*Mem)(unsafe.Pointer(p)).Fflags) & MEM_IntReal) != 0 {
- return float64(*(*I64)(unsafe.Pointer(p /* &.u */)))
+ if int32((*Mem)(unsafe.Pointer(p)).Fflags)&MEM_IntReal != 0 {
+ return float64(*(*I64)(unsafe.Pointer(p)))
}
- return *(*float64)(unsafe.Pointer(p /* &.u */))
+ return *(*float64)(unsafe.Pointer(p))
}()))
*(*uint8)(unsafe.Pointer(zBuf + uintptr((*StrAccum)(unsafe.Pointer(bp+16 /* &acc */)).FnChar))) = uint8(0) // Fast version of sqlite3StrAccumFinish(&acc)
@@ -54828,10 +55542,10 @@ func vdbeMemRenderNum(tls *libc.TLS, sz int32, zBuf uintptr, p uintptr) { /* sql
// SQLITE_OK is returned if the conversion is successful (or not required).
// SQLITE_NOMEM may be returned if a malloc() fails during conversion
// between formats.
-func Xsqlite3VdbeChangeEncoding(tls *libc.TLS, pMem uintptr, desiredEnc int32) int32 { /* sqlite3.c:77196:20: */
+func Xsqlite3VdbeChangeEncoding(tls *libc.TLS, pMem uintptr, desiredEnc int32) int32 { /* sqlite3.c:77417:20: */
var rc int32
- if !((int32((*Mem)(unsafe.Pointer(pMem)).Fflags) & MEM_Str) != 0) || (int32((*Mem)(unsafe.Pointer(pMem)).Fenc) == desiredEnc) {
+ if !(int32((*Mem)(unsafe.Pointer(pMem)).Fflags)&MEM_Str != 0) || int32((*Mem)(unsafe.Pointer(pMem)).Fenc) == desiredEnc {
return SQLITE_OK
}
@@ -54848,14 +55562,14 @@ func Xsqlite3VdbeChangeEncoding(tls *libc.TLS, pMem uintptr, desiredEnc int32) i
// pMem->z into the new allocation. pMem must be either a string or
// blob if bPreserve is true. If bPreserve is false, any prior content
// in pMem->z is discarded.
-func Xsqlite3VdbeMemGrow(tls *libc.TLS, pMem uintptr, n int32, bPreserve int32) int32 { /* sqlite3.c:77230:36: */
+func Xsqlite3VdbeMemGrow(tls *libc.TLS, pMem uintptr, n int32, bPreserve int32) int32 { /* sqlite3.c:77452:36: */
// If the bPreserve flag is set to true, then the memory cell must already
// contain a valid string or blob value.
- if (((*Mem)(unsafe.Pointer(pMem)).FszMalloc > 0) && (bPreserve != 0)) && ((*Mem)(unsafe.Pointer(pMem)).Fz == (*Mem)(unsafe.Pointer(pMem)).FzMalloc) {
+ if (*Mem)(unsafe.Pointer(pMem)).FszMalloc > 0 && bPreserve != 0 && (*Mem)(unsafe.Pointer(pMem)).Fz == (*Mem)(unsafe.Pointer(pMem)).FzMalloc {
if (*Mem)(unsafe.Pointer(pMem)).Fdb != 0 {
- (*Mem)(unsafe.Pointer(pMem)).Fz = libc.AssignPtrUintptr(pMem+20 /* &.zMalloc */, Xsqlite3DbReallocOrFree(tls, (*Mem)(unsafe.Pointer(pMem)).Fdb, (*Mem)(unsafe.Pointer(pMem)).Fz, uint64(n)))
+ (*Mem)(unsafe.Pointer(pMem)).Fz = libc.AssignPtrUintptr(pMem+20, Xsqlite3DbReallocOrFree(tls, (*Mem)(unsafe.Pointer(pMem)).Fdb, (*Mem)(unsafe.Pointer(pMem)).Fz, uint64(n)))
} else {
(*Mem)(unsafe.Pointer(pMem)).FzMalloc = Xsqlite3Realloc(tls, (*Mem)(unsafe.Pointer(pMem)).Fz, uint64(n))
if (*Mem)(unsafe.Pointer(pMem)).FzMalloc == uintptr(0) {
@@ -54879,17 +55593,17 @@ func Xsqlite3VdbeMemGrow(tls *libc.TLS, pMem uintptr, n int32, bPreserve int32)
(*Mem)(unsafe.Pointer(pMem)).FszMalloc = Xsqlite3DbMallocSize(tls, (*Mem)(unsafe.Pointer(pMem)).Fdb, (*Mem)(unsafe.Pointer(pMem)).FzMalloc)
}
- if (bPreserve != 0) && ((*Mem)(unsafe.Pointer(pMem)).Fz != 0) {
+ if bPreserve != 0 && (*Mem)(unsafe.Pointer(pMem)).Fz != 0 {
libc.Xmemcpy(tls, (*Mem)(unsafe.Pointer(pMem)).FzMalloc, (*Mem)(unsafe.Pointer(pMem)).Fz, uint32((*Mem)(unsafe.Pointer(pMem)).Fn))
}
- if (int32((*Mem)(unsafe.Pointer(pMem)).Fflags) & MEM_Dyn) != 0 {
+ if int32((*Mem)(unsafe.Pointer(pMem)).Fflags)&MEM_Dyn != 0 {
(*struct{ f func(*libc.TLS, uintptr) })(unsafe.Pointer(&struct{ uintptr }{(*Mem)(unsafe.Pointer(pMem)).FxDel})).f(tls, (*Mem)(unsafe.Pointer(pMem)).Fz)
}
(*Mem)(unsafe.Pointer(pMem)).Fz = (*Mem)(unsafe.Pointer(pMem)).FzMalloc
- *(*U16)(unsafe.Pointer(pMem + 8 /* &.flags */)) &= libc.Uint16FromInt32((libc.CplInt32(((MEM_Dyn | MEM_Ephem) | MEM_Static))))
+ *(*U16)(unsafe.Pointer(pMem + 8)) &= libc.Uint16FromInt32(libc.CplInt32(MEM_Dyn | MEM_Ephem | MEM_Static))
return SQLITE_OK
}
@@ -54904,14 +55618,14 @@ func Xsqlite3VdbeMemGrow(tls *libc.TLS, pMem uintptr, n int32, bPreserve int32)
//
// Return SQLITE_OK on success or an error code (probably SQLITE_NOMEM)
// if unable to complete the resizing.
-func Xsqlite3VdbeMemClearAndResize(tls *libc.TLS, pMem uintptr, szNew int32) int32 { /* sqlite3.c:77293:20: */
+func Xsqlite3VdbeMemClearAndResize(tls *libc.TLS, pMem uintptr, szNew int32) int32 { /* sqlite3.c:77515:20: */
if (*Mem)(unsafe.Pointer(pMem)).FszMalloc < szNew {
return Xsqlite3VdbeMemGrow(tls, pMem, szNew, 0)
}
(*Mem)(unsafe.Pointer(pMem)).Fz = (*Mem)(unsafe.Pointer(pMem)).FzMalloc
- *(*U16)(unsafe.Pointer(pMem + 8 /* &.flags */)) &= U16((((MEM_Null | MEM_Int) | MEM_Real) | MEM_IntReal))
+ *(*U16)(unsafe.Pointer(pMem + 8)) &= U16(MEM_Null | MEM_Int | MEM_Real | MEM_IntReal)
return SQLITE_OK
}
@@ -54922,14 +55636,14 @@ func Xsqlite3VdbeMemClearAndResize(tls *libc.TLS, pMem uintptr, szNew int32) int
// to be a double-zero byte at an even byte boundary in order to
// terminate a UTF16 string, even if the initial size of the buffer
// is an odd number of bytes.
-func vdbeMemAddTerminator(tls *libc.TLS, pMem uintptr) int32 { /* sqlite3.c:77314:28: */
- if Xsqlite3VdbeMemGrow(tls, pMem, ((*Mem)(unsafe.Pointer(pMem)).Fn+3), 1) != 0 {
+func vdbeMemAddTerminator(tls *libc.TLS, pMem uintptr) int32 { /* sqlite3.c:77536:28: */
+ if Xsqlite3VdbeMemGrow(tls, pMem, (*Mem)(unsafe.Pointer(pMem)).Fn+3, 1) != 0 {
return SQLITE_NOMEM
}
*(*uint8)(unsafe.Pointer((*Mem)(unsafe.Pointer(pMem)).Fz + uintptr((*Mem)(unsafe.Pointer(pMem)).Fn))) = uint8(0)
- *(*uint8)(unsafe.Pointer((*Mem)(unsafe.Pointer(pMem)).Fz + uintptr(((*Mem)(unsafe.Pointer(pMem)).Fn + 1)))) = uint8(0)
- *(*uint8)(unsafe.Pointer((*Mem)(unsafe.Pointer(pMem)).Fz + uintptr(((*Mem)(unsafe.Pointer(pMem)).Fn + 2)))) = uint8(0)
- *(*U16)(unsafe.Pointer(pMem + 8 /* &.flags */)) |= U16((MEM_Term))
+ *(*uint8)(unsafe.Pointer((*Mem)(unsafe.Pointer(pMem)).Fz + uintptr((*Mem)(unsafe.Pointer(pMem)).Fn+1))) = uint8(0)
+ *(*uint8)(unsafe.Pointer((*Mem)(unsafe.Pointer(pMem)).Fz + uintptr((*Mem)(unsafe.Pointer(pMem)).Fn+2))) = uint8(0)
+ *(*U16)(unsafe.Pointer(pMem + 8)) |= U16(MEM_Term)
return SQLITE_OK
}
@@ -54937,38 +55651,38 @@ func vdbeMemAddTerminator(tls *libc.TLS, pMem uintptr) int32 { /* sqlite3.c:7731
// MEM.zMalloc, where it can be safely written.
//
// Return SQLITE_OK on success or SQLITE_NOMEM if malloc fails.
-func Xsqlite3VdbeMemMakeWriteable(tls *libc.TLS, pMem uintptr) int32 { /* sqlite3.c:77331:20: */
+func Xsqlite3VdbeMemMakeWriteable(tls *libc.TLS, pMem uintptr) int32 { /* sqlite3.c:77553:20: */
- if (int32((*Mem)(unsafe.Pointer(pMem)).Fflags) & (MEM_Str | MEM_Blob)) != 0 {
+ if int32((*Mem)(unsafe.Pointer(pMem)).Fflags)&(MEM_Str|MEM_Blob) != 0 {
if func() int32 {
- if (int32((*Mem)(unsafe.Pointer((pMem))).Fflags) & MEM_Zero) != 0 {
+ if int32((*Mem)(unsafe.Pointer(pMem)).Fflags)&MEM_Zero != 0 {
return Xsqlite3VdbeMemExpandBlob(tls, pMem)
}
return 0
}() != 0 {
return SQLITE_NOMEM
}
- if ((*Mem)(unsafe.Pointer(pMem)).FszMalloc == 0) || ((*Mem)(unsafe.Pointer(pMem)).Fz != (*Mem)(unsafe.Pointer(pMem)).FzMalloc) {
+ if (*Mem)(unsafe.Pointer(pMem)).FszMalloc == 0 || (*Mem)(unsafe.Pointer(pMem)).Fz != (*Mem)(unsafe.Pointer(pMem)).FzMalloc {
var rc int32 = vdbeMemAddTerminator(tls, pMem)
if rc != 0 {
return rc
}
}
}
- *(*U16)(unsafe.Pointer(pMem + 8 /* &.flags */)) &= libc.Uint16FromInt32((libc.CplInt32(MEM_Ephem)))
+ *(*U16)(unsafe.Pointer(pMem + 8)) &= libc.Uint16FromInt32(libc.CplInt32(MEM_Ephem))
return SQLITE_OK
}
// If the given Mem* has a zero-filled tail, turn it into an ordinary
// blob stored in dynamically allocated space.
-func Xsqlite3VdbeMemExpandBlob(tls *libc.TLS, pMem uintptr) int32 { /* sqlite3.c:77354:20: */
+func Xsqlite3VdbeMemExpandBlob(tls *libc.TLS, pMem uintptr) int32 { /* sqlite3.c:77577:20: */
var nByte int32
// Set nByte to the number of bytes required to store the expanded blob.
- nByte = ((*Mem)(unsafe.Pointer(pMem)).Fn + *(*int32)(unsafe.Pointer(pMem /* &.u */)))
+ nByte = (*Mem)(unsafe.Pointer(pMem)).Fn + *(*int32)(unsafe.Pointer(pMem))
if nByte <= 0 {
- if (int32((*Mem)(unsafe.Pointer(pMem)).Fflags) & MEM_Blob) == 0 {
+ if int32((*Mem)(unsafe.Pointer(pMem)).Fflags)&MEM_Blob == 0 {
return SQLITE_OK
}
nByte = 1
@@ -54977,16 +55691,16 @@ func Xsqlite3VdbeMemExpandBlob(tls *libc.TLS, pMem uintptr) int32 { /* sqlite3.c
return SQLITE_NOMEM
}
- libc.Xmemset(tls, ((*Mem)(unsafe.Pointer(pMem)).Fz + uintptr((*Mem)(unsafe.Pointer(pMem)).Fn)), 0, uint32(*(*int32)(unsafe.Pointer(pMem /* &.u */))))
- *(*int32)(unsafe.Pointer(pMem + 12 /* &.n */)) += (*(*int32)(unsafe.Pointer(pMem /* &.u */)))
- *(*U16)(unsafe.Pointer(pMem + 8 /* &.flags */)) &= libc.Uint16FromInt32((libc.CplInt32((MEM_Zero | MEM_Term))))
+ libc.Xmemset(tls, (*Mem)(unsafe.Pointer(pMem)).Fz+uintptr((*Mem)(unsafe.Pointer(pMem)).Fn), 0, uint32(*(*int32)(unsafe.Pointer(pMem))))
+ *(*int32)(unsafe.Pointer(pMem + 12)) += *(*int32)(unsafe.Pointer(pMem))
+ *(*U16)(unsafe.Pointer(pMem + 8)) &= libc.Uint16FromInt32(libc.CplInt32(MEM_Zero | MEM_Term))
return SQLITE_OK
}
// Make sure the given Mem is \u0000 terminated.
-func Xsqlite3VdbeMemNulTerminate(tls *libc.TLS, pMem uintptr) int32 { /* sqlite3.c:77382:20: */
+func Xsqlite3VdbeMemNulTerminate(tls *libc.TLS, pMem uintptr) int32 { /* sqlite3.c:77608:20: */
- if (int32((*Mem)(unsafe.Pointer(pMem)).Fflags) & (MEM_Term | MEM_Str)) != MEM_Str {
+ if int32((*Mem)(unsafe.Pointer(pMem)).Fflags)&(MEM_Term|MEM_Str) != MEM_Str {
return SQLITE_OK // Nothing to do
} else {
return vdbeMemAddTerminator(tls, pMem)
@@ -55006,7 +55720,7 @@ func Xsqlite3VdbeMemNulTerminate(tls *libc.TLS, pMem uintptr) int32 { /* sqlite3
// sqlite3_value_text()), or for ensuring that values to be used as btree
// keys are strings. In the former case a NULL pointer is returned the
// user and the latter is an internal programming error.
-func Xsqlite3VdbeMemStringify(tls *libc.TLS, pMem uintptr, enc U8, bForce U8) int32 { /* sqlite3.c:77407:20: */
+func Xsqlite3VdbeMemStringify(tls *libc.TLS, pMem uintptr, enc U8, bForce U8) int32 { /* sqlite3.c:77634:20: */
var nByte int32 = 32
if Xsqlite3VdbeMemClearAndResize(tls, pMem, nByte) != 0 {
@@ -55016,11 +55730,11 @@ func Xsqlite3VdbeMemStringify(tls *libc.TLS, pMem uintptr, enc U8, bForce U8) in
vdbeMemRenderNum(tls, nByte, (*Mem)(unsafe.Pointer(pMem)).Fz, pMem)
- (*Mem)(unsafe.Pointer(pMem)).Fn = (int32(libc.Xstrlen(tls, (*Mem)(unsafe.Pointer(pMem)).Fz) & Size_t(0x3fffffff)))
+ (*Mem)(unsafe.Pointer(pMem)).Fn = int32(libc.Xstrlen(tls, (*Mem)(unsafe.Pointer(pMem)).Fz) & Size_t(0x3fffffff))
(*Mem)(unsafe.Pointer(pMem)).Fenc = U8(SQLITE_UTF8)
- *(*U16)(unsafe.Pointer(pMem + 8 /* &.flags */)) |= U16((MEM_Str | MEM_Term))
+ *(*U16)(unsafe.Pointer(pMem + 8)) |= U16(MEM_Str | MEM_Term)
if bForce != 0 {
- *(*U16)(unsafe.Pointer(pMem + 8 /* &.flags */)) &= libc.Uint16FromInt32((libc.CplInt32(((MEM_Int | MEM_Real) | MEM_IntReal))))
+ *(*U16)(unsafe.Pointer(pMem + 8)) &= libc.Uint16FromInt32(libc.CplInt32(MEM_Int | MEM_Real | MEM_IntReal))
}
Xsqlite3VdbeChangeEncoding(tls, pMem, int32(enc))
return SQLITE_OK
@@ -55032,7 +55746,7 @@ func Xsqlite3VdbeMemStringify(tls *libc.TLS, pMem uintptr, enc U8, bForce U8) in
//
// Return SQLITE_ERROR if the finalizer reports an error. SQLITE_OK
// otherwise.
-func Xsqlite3VdbeMemFinalize(tls *libc.TLS, pMem uintptr, pFunc uintptr) int32 { /* sqlite3.c:77441:20: */
+func Xsqlite3VdbeMemFinalize(tls *libc.TLS, pMem uintptr, pFunc uintptr) int32 { /* sqlite3.c:77669:20: */
bp := tls.Alloc(72)
defer tls.Free(72)
@@ -55062,7 +55776,7 @@ func Xsqlite3VdbeMemFinalize(tls *libc.TLS, pMem uintptr, pFunc uintptr) int32 {
//
// SQLITE_ERROR is returned if xValue() reports an error. SQLITE_OK
// otherwise.
-func Xsqlite3VdbeMemAggValue(tls *libc.TLS, pAccum uintptr, pOut uintptr, pFunc uintptr) int32 { /* sqlite3.c:77471:20: */
+func Xsqlite3VdbeMemAggValue(tls *libc.TLS, pAccum uintptr, pOut uintptr, pFunc uintptr) int32 { /* sqlite3.c:77700:20: */
bp := tls.Alloc(32)
defer tls.Free(32)
@@ -55084,13 +55798,13 @@ func Xsqlite3VdbeMemAggValue(tls *libc.TLS, pAccum uintptr, pOut uintptr, pFunc
// This is a helper routine for sqlite3VdbeMemSetNull() and
// for sqlite3VdbeMemRelease(). Use those other routines as the
// entry point for releasing Mem resources.
-func vdbeMemClearExternAndSetNull(tls *libc.TLS, p uintptr) { /* sqlite3.c:77496:29: */
+func vdbeMemClearExternAndSetNull(tls *libc.TLS, p uintptr) { /* sqlite3.c:77725:29: */
- if (int32((*Mem)(unsafe.Pointer(p)).Fflags) & MEM_Agg) != 0 {
- Xsqlite3VdbeMemFinalize(tls, p, *(*uintptr)(unsafe.Pointer(p /* &.u */)))
+ if int32((*Mem)(unsafe.Pointer(p)).Fflags)&MEM_Agg != 0 {
+ Xsqlite3VdbeMemFinalize(tls, p, *(*uintptr)(unsafe.Pointer(p)))
}
- if (int32((*Mem)(unsafe.Pointer(p)).Fflags) & MEM_Dyn) != 0 {
+ if int32((*Mem)(unsafe.Pointer(p)).Fflags)&MEM_Dyn != 0 {
(*struct{ f func(*libc.TLS, uintptr) })(unsafe.Pointer(&struct{ uintptr }{(*Mem)(unsafe.Pointer(p)).FxDel})).f(tls, (*Mem)(unsafe.Pointer(p)).Fz)
}
@@ -55103,8 +55817,8 @@ func vdbeMemClearExternAndSetNull(tls *libc.TLS, p uintptr) { /* sqlite3.c:77496
// This is a helper routine invoked by sqlite3VdbeMemRelease() in
// the unusual case where there really is memory in p that needs
// to be freed.
-func vdbeMemClear(tls *libc.TLS, p uintptr) { /* sqlite3.c:77519:29: */
- if (int32((*Mem)(unsafe.Pointer((p))).Fflags) & (MEM_Agg | MEM_Dyn)) != 0 {
+func vdbeMemClear(tls *libc.TLS, p uintptr) { /* sqlite3.c:77748:29: */
+ if int32((*Mem)(unsafe.Pointer(p)).Fflags)&(MEM_Agg|MEM_Dyn) != 0 {
vdbeMemClearExternAndSetNull(tls, p)
}
if (*Mem)(unsafe.Pointer(p)).FszMalloc != 0 {
@@ -55122,9 +55836,9 @@ func vdbeMemClear(tls *libc.TLS, p uintptr) { /* sqlite3.c:77519:29: */
//
// Use sqlite3VdbeMemSetNull() to release just the Mem.xDel space
// prior to inserting new content into the Mem.
-func Xsqlite3VdbeMemRelease(tls *libc.TLS, p uintptr) { /* sqlite3.c:77540:21: */
+func Xsqlite3VdbeMemRelease(tls *libc.TLS, p uintptr) { /* sqlite3.c:77769:21: */
- if ((int32((*Mem)(unsafe.Pointer((p))).Fflags) & (MEM_Agg | MEM_Dyn)) != 0) || ((*Mem)(unsafe.Pointer(p)).FszMalloc != 0) {
+ if int32((*Mem)(unsafe.Pointer(p)).Fflags)&(MEM_Agg|MEM_Dyn) != 0 || (*Mem)(unsafe.Pointer(p)).FszMalloc != 0 {
vdbeMemClear(tls, p)
}
}
@@ -55132,7 +55846,7 @@ func Xsqlite3VdbeMemRelease(tls *libc.TLS, p uintptr) { /* sqlite3.c:77540:21: *
// Convert a 64-bit IEEE double into a 64-bit signed integer.
// If the double is out of range of a 64-bit signed integer then
// return the closest available 64-bit signed integer.
-func doubleToInt64(tls *libc.TLS, r float64) I64 { /* sqlite3.c:77552:28: */
+func doubleToInt64(tls *libc.TLS, r float64) I64 { /* sqlite3.c:77781:28: */
if r <= float64(minInt) {
return minInt
@@ -55144,8 +55858,8 @@ func doubleToInt64(tls *libc.TLS, r float64) I64 { /* sqlite3.c:77552:28: */
return I64(0)
}
-var maxInt I64 = (int64(0xffffffff) | (I64((int64(0x7fffffff))) << 32)) /* sqlite3.c:77564:20 */
-var minInt I64 = ((int64(-1)) - (int64(0xffffffff) | (I64((int64(0x7fffffff))) << 32))) /* sqlite3.c:77565:20 */
+var maxInt I64 = int64(0xffffffff) | I64(int64(0x7fffffff))<<32 /* sqlite3.c:77793:20 */
+var minInt I64 = int64(-1) - (int64(0xffffffff) | I64(int64(0x7fffffff))<<32) /* sqlite3.c:77794:20 */
// Return some kind of integer value which is the best we can do
// at representing the value that *pMem describes as an integer.
@@ -55156,7 +55870,7 @@ var minInt I64 = ((int64(-1)) - (int64(0xffffffff) | (I64((int64(0x7fffffff))) <
// an SQL-NULL value, return 0.
//
// If pMem represents a string value, its encoding might be changed.
-func memIntValue(tls *libc.TLS, pMem uintptr) I64 { /* sqlite3.c:77588:28: */
+func memIntValue(tls *libc.TLS, pMem uintptr) I64 { /* sqlite3.c:77817:28: */
bp := tls.Alloc(8)
defer tls.Free(8)
@@ -55165,16 +55879,16 @@ func memIntValue(tls *libc.TLS, pMem uintptr) I64 { /* sqlite3.c:77588:28: */
return *(*I64)(unsafe.Pointer(bp /* value */))
}
-func Xsqlite3VdbeIntValue(tls *libc.TLS, pMem uintptr) I64 { /* sqlite3.c:77593:20: */
+func Xsqlite3VdbeIntValue(tls *libc.TLS, pMem uintptr) I64 { /* sqlite3.c:77822:20: */
var flags int32
flags = int32((*Mem)(unsafe.Pointer(pMem)).Fflags)
- if (flags & (MEM_Int | MEM_IntReal)) != 0 {
+ if flags&(MEM_Int|MEM_IntReal) != 0 {
- return *(*I64)(unsafe.Pointer(pMem /* &.u */))
- } else if (flags & MEM_Real) != 0 {
- return doubleToInt64(tls, *(*float64)(unsafe.Pointer(pMem /* &.u */)))
- } else if ((flags & (MEM_Str | MEM_Blob)) != 0) && ((*Mem)(unsafe.Pointer(pMem)).Fz != uintptr(0)) {
+ return *(*I64)(unsafe.Pointer(pMem))
+ } else if flags&MEM_Real != 0 {
+ return doubleToInt64(tls, *(*float64)(unsafe.Pointer(pMem)))
+ } else if flags&(MEM_Str|MEM_Blob) != 0 && (*Mem)(unsafe.Pointer(pMem)).Fz != uintptr(0) {
return memIntValue(tls, pMem)
} else {
return int64(0)
@@ -55186,7 +55900,7 @@ func Xsqlite3VdbeIntValue(tls *libc.TLS, pMem uintptr) I64 { /* sqlite3.c:77593:
// double. If pMem is already a double or an integer, return its
// value. If it is a string or blob, try to convert it to a double.
// If it is a NULL, return 0.0.
-func memRealValue(tls *libc.TLS, pMem uintptr) float64 { /* sqlite3.c:77616:31: */
+func memRealValue(tls *libc.TLS, pMem uintptr) float64 { /* sqlite3.c:77846:31: */
bp := tls.Alloc(8)
defer tls.Free(8)
@@ -55196,14 +55910,14 @@ func memRealValue(tls *libc.TLS, pMem uintptr) float64 { /* sqlite3.c:77616:31:
return *(*float64)(unsafe.Pointer(bp /* val */))
}
-func Xsqlite3VdbeRealValue(tls *libc.TLS, pMem uintptr) float64 { /* sqlite3.c:77622:23: */
+func Xsqlite3VdbeRealValue(tls *libc.TLS, pMem uintptr) float64 { /* sqlite3.c:77852:23: */
- if (int32((*Mem)(unsafe.Pointer(pMem)).Fflags) & MEM_Real) != 0 {
- return *(*float64)(unsafe.Pointer(pMem /* &.u */))
- } else if (int32((*Mem)(unsafe.Pointer(pMem)).Fflags) & (MEM_Int | MEM_IntReal)) != 0 {
+ if int32((*Mem)(unsafe.Pointer(pMem)).Fflags)&MEM_Real != 0 {
+ return *(*float64)(unsafe.Pointer(pMem))
+ } else if int32((*Mem)(unsafe.Pointer(pMem)).Fflags)&(MEM_Int|MEM_IntReal) != 0 {
- return float64(*(*I64)(unsafe.Pointer(pMem /* &.u */)))
- } else if (int32((*Mem)(unsafe.Pointer(pMem)).Fflags) & (MEM_Str | MEM_Blob)) != 0 {
+ return float64(*(*I64)(unsafe.Pointer(pMem)))
+ } else if int32((*Mem)(unsafe.Pointer(pMem)).Fflags)&(MEM_Str|MEM_Blob) != 0 {
return memRealValue(tls, pMem)
} else {
// (double)0 In case of SQLITE_OMIT_FLOATING_POINT...
@@ -55214,23 +55928,23 @@ func Xsqlite3VdbeRealValue(tls *libc.TLS, pMem uintptr) float64 { /* sqlite3.c:7
// Return 1 if pMem represents true, and return 0 if pMem represents false.
// Return the value ifNull if pMem is NULL.
-func Xsqlite3VdbeBooleanValue(tls *libc.TLS, pMem uintptr, ifNull int32) int32 { /* sqlite3.c:77642:20: */
+func Xsqlite3VdbeBooleanValue(tls *libc.TLS, pMem uintptr, ifNull int32) int32 { /* sqlite3.c:77873:20: */
- if (int32((*Mem)(unsafe.Pointer(pMem)).Fflags) & (MEM_Int | MEM_IntReal)) != 0 {
- return (libc.Bool32(*(*I64)(unsafe.Pointer(pMem /* &.u */)) != int64(0)))
+ if int32((*Mem)(unsafe.Pointer(pMem)).Fflags)&(MEM_Int|MEM_IntReal) != 0 {
+ return libc.Bool32(*(*I64)(unsafe.Pointer(pMem)) != int64(0))
}
- if (int32((*Mem)(unsafe.Pointer(pMem)).Fflags) & MEM_Null) != 0 {
+ if int32((*Mem)(unsafe.Pointer(pMem)).Fflags)&MEM_Null != 0 {
return ifNull
}
- return (libc.Bool32(Xsqlite3VdbeRealValue(tls, pMem) != 0.0))
+ return libc.Bool32(Xsqlite3VdbeRealValue(tls, pMem) != 0.0)
}
// The MEM structure is already a MEM_Real. Try to also make it a
// MEM_Int if we can.
-func Xsqlite3VdbeIntegerAffinity(tls *libc.TLS, pMem uintptr) { /* sqlite3.c:77653:21: */
+func Xsqlite3VdbeIntegerAffinity(tls *libc.TLS, pMem uintptr) { /* sqlite3.c:77884:21: */
var ix I64
- ix = doubleToInt64(tls, *(*float64)(unsafe.Pointer(pMem /* &.u */)))
+ ix = doubleToInt64(tls, *(*float64)(unsafe.Pointer(pMem)))
// Only mark the value as an integer if
//
@@ -55241,26 +55955,26 @@ func Xsqlite3VdbeIntegerAffinity(tls *libc.TLS, pMem uintptr) { /* sqlite3.c:776
// The second and third terms in the following conditional enforces
// the second condition under the assumption that addition overflow causes
// values to wrap around.
- if ((*(*float64)(unsafe.Pointer(pMem /* &.u */)) == float64(ix)) && (ix > ((int64(-1)) - (int64(0xffffffff) | (I64((int64(0x7fffffff))) << 32))))) && (ix < (int64(0xffffffff) | (I64((int64(0x7fffffff))) << 32))) {
- *(*I64)(unsafe.Pointer(pMem /* &.u */)) = ix
- (*Mem)(unsafe.Pointer(pMem)).Fflags = (U16((int32((*Mem)(unsafe.Pointer((pMem))).Fflags) & libc.CplInt32((MEM_TypeMask | MEM_Zero))) | MEM_Int))
+ if *(*float64)(unsafe.Pointer(pMem)) == float64(ix) && ix > int64(-1)-(int64(0xffffffff)|I64(int64(0x7fffffff))<<32) && ix < int64(0xffffffff)|I64(int64(0x7fffffff))<<32 {
+ *(*I64)(unsafe.Pointer(pMem)) = ix
+ (*Mem)(unsafe.Pointer(pMem)).Fflags = U16(int32((*Mem)(unsafe.Pointer(pMem)).Fflags)&libc.CplInt32(MEM_TypeMask|MEM_Zero) | MEM_Int)
}
}
// Convert pMem to type integer. Invalidate any prior representations.
-func Xsqlite3VdbeMemIntegerify(tls *libc.TLS, pMem uintptr) int32 { /* sqlite3.c:77681:20: */
+func Xsqlite3VdbeMemIntegerify(tls *libc.TLS, pMem uintptr) int32 { /* sqlite3.c:77913:20: */
- *(*I64)(unsafe.Pointer(pMem /* &.u */)) = Xsqlite3VdbeIntValue(tls, pMem)
- (*Mem)(unsafe.Pointer(pMem)).Fflags = (U16((int32((*Mem)(unsafe.Pointer((pMem))).Fflags) & libc.CplInt32((MEM_TypeMask | MEM_Zero))) | MEM_Int))
+ *(*I64)(unsafe.Pointer(pMem)) = Xsqlite3VdbeIntValue(tls, pMem)
+ (*Mem)(unsafe.Pointer(pMem)).Fflags = U16(int32((*Mem)(unsafe.Pointer(pMem)).Fflags)&libc.CplInt32(MEM_TypeMask|MEM_Zero) | MEM_Int)
return SQLITE_OK
}
// Convert pMem so that it is of type MEM_Real.
// Invalidate any prior representations.
-func Xsqlite3VdbeMemRealify(tls *libc.TLS, pMem uintptr) int32 { /* sqlite3.c:77695:20: */
+func Xsqlite3VdbeMemRealify(tls *libc.TLS, pMem uintptr) int32 { /* sqlite3.c:77928:20: */
- *(*float64)(unsafe.Pointer(pMem /* &.u */)) = Xsqlite3VdbeRealValue(tls, pMem)
- (*Mem)(unsafe.Pointer(pMem)).Fflags = (U16((int32((*Mem)(unsafe.Pointer((pMem))).Fflags) & libc.CplInt32((MEM_TypeMask | MEM_Zero))) | MEM_Real))
+ *(*float64)(unsafe.Pointer(pMem)) = Xsqlite3VdbeRealValue(tls, pMem)
+ (*Mem)(unsafe.Pointer(pMem)).Fflags = U16(int32((*Mem)(unsafe.Pointer(pMem)).Fflags)&libc.CplInt32(MEM_TypeMask|MEM_Zero) | MEM_Real)
return SQLITE_OK
}
@@ -55272,15 +55986,15 @@ func Xsqlite3VdbeMemRealify(tls *libc.TLS, pMem uintptr) int32 { /* sqlite3.c:77
// For some versions of GCC on 32-bit machines, if you do the more obvious
// comparison of "r1==(double)i" you sometimes get an answer of false even
// though the r1 and (double)i values are bit-for-bit the same.
-func Xsqlite3RealSameAsInt(tls *libc.TLS, r1 float64, i Sqlite3_int64) int32 { /* sqlite3.c:77713:20: */
+func Xsqlite3RealSameAsInt(tls *libc.TLS, r1 float64, i Sqlite3_int64) int32 { /* sqlite3.c:77947:20: */
bp := tls.Alloc(16)
defer tls.Free(16)
*(*float64)(unsafe.Pointer(bp)) = r1
*(*float64)(unsafe.Pointer(bp + 8 /* r2 */)) = float64(i)
- return (libc.Bool32((*(*float64)(unsafe.Pointer(bp /* r1 */)) == 0.0) ||
- (((libc.Xmemcmp(tls, bp /* &r1 */, bp+8 /* &r2 */, uint32(unsafe.Sizeof(float64(0)))) == 0) &&
- (i >= -2251799813685248)) && (i < 2251799813685248))))
+ return libc.Bool32(*(*float64)(unsafe.Pointer(bp)) == 0.0 ||
+ libc.Xmemcmp(tls, bp, bp+8, uint32(unsafe.Sizeof(float64(0)))) == 0 &&
+ i >= -2251799813685248 && i < 2251799813685248)
}
// Convert pMem so that it has type MEM_Real or MEM_Int.
@@ -55289,25 +56003,25 @@ func Xsqlite3RealSameAsInt(tls *libc.TLS, r1 float64, i Sqlite3_int64) int32 { /
// Every effort is made to force the conversion, even if the input
// is a string that does not look completely like a number. Convert
// as much of the string as we can and ignore the rest.
-func Xsqlite3VdbeMemNumerify(tls *libc.TLS, pMem uintptr) int32 { /* sqlite3.c:77728:20: */
+func Xsqlite3VdbeMemNumerify(tls *libc.TLS, pMem uintptr) int32 { /* sqlite3.c:77962:20: */
bp := tls.Alloc(8)
defer tls.Free(8)
- if (int32((*Mem)(unsafe.Pointer(pMem)).Fflags) & (((MEM_Int | MEM_Real) | MEM_IntReal) | MEM_Null)) == 0 {
+ if int32((*Mem)(unsafe.Pointer(pMem)).Fflags)&(MEM_Int|MEM_Real|MEM_IntReal|MEM_Null) == 0 {
var rc int32
// var ix Sqlite3_int64 at bp, 8
- rc = Xsqlite3AtoF(tls, (*Mem)(unsafe.Pointer(pMem)).Fz, (pMem /* &.u */ /* &.r */), (*Mem)(unsafe.Pointer(pMem)).Fn, (*Mem)(unsafe.Pointer(pMem)).Fenc)
- if (((rc == 0) || (rc == 1)) && (Xsqlite3Atoi64(tls, (*Mem)(unsafe.Pointer(pMem)).Fz, bp /* &ix */, (*Mem)(unsafe.Pointer(pMem)).Fn, (*Mem)(unsafe.Pointer(pMem)).Fenc) <= 1)) ||
- (Xsqlite3RealSameAsInt(tls, *(*float64)(unsafe.Pointer(pMem /* &.u */)), libc.AssignPtrInt64(bp /* ix */, libc.Int64FromFloat64(*(*float64)(unsafe.Pointer(pMem /* &.u */))))) != 0) {
- *(*I64)(unsafe.Pointer(pMem /* &.u */)) = *(*Sqlite3_int64)(unsafe.Pointer(bp /* ix */))
- (*Mem)(unsafe.Pointer(pMem)).Fflags = (U16((int32((*Mem)(unsafe.Pointer((pMem))).Fflags) & libc.CplInt32((MEM_TypeMask | MEM_Zero))) | MEM_Int))
+ rc = Xsqlite3AtoF(tls, (*Mem)(unsafe.Pointer(pMem)).Fz, pMem, (*Mem)(unsafe.Pointer(pMem)).Fn, (*Mem)(unsafe.Pointer(pMem)).Fenc)
+ if (rc == 0 || rc == 1) && Xsqlite3Atoi64(tls, (*Mem)(unsafe.Pointer(pMem)).Fz, bp, (*Mem)(unsafe.Pointer(pMem)).Fn, (*Mem)(unsafe.Pointer(pMem)).Fenc) <= 1 ||
+ Xsqlite3RealSameAsInt(tls, *(*float64)(unsafe.Pointer(pMem)), libc.AssignPtrInt64(bp, libc.Int64FromFloat64(*(*float64)(unsafe.Pointer(pMem))))) != 0 {
+ *(*I64)(unsafe.Pointer(pMem)) = *(*Sqlite3_int64)(unsafe.Pointer(bp /* ix */))
+ (*Mem)(unsafe.Pointer(pMem)).Fflags = U16(int32((*Mem)(unsafe.Pointer(pMem)).Fflags)&libc.CplInt32(MEM_TypeMask|MEM_Zero) | MEM_Int)
} else {
- (*Mem)(unsafe.Pointer(pMem)).Fflags = (U16((int32((*Mem)(unsafe.Pointer((pMem))).Fflags) & libc.CplInt32((MEM_TypeMask | MEM_Zero))) | MEM_Real))
+ (*Mem)(unsafe.Pointer(pMem)).Fflags = U16(int32((*Mem)(unsafe.Pointer(pMem)).Fflags)&libc.CplInt32(MEM_TypeMask|MEM_Zero) | MEM_Real)
}
}
- *(*U16)(unsafe.Pointer(pMem + 8 /* &.flags */)) &= libc.Uint16FromInt32((libc.CplInt32(((MEM_Str | MEM_Blob) | MEM_Zero))))
+ *(*U16)(unsafe.Pointer(pMem + 8)) &= libc.Uint16FromInt32(libc.CplInt32(MEM_Str | MEM_Blob | MEM_Zero))
return SQLITE_OK
}
@@ -55316,21 +56030,21 @@ func Xsqlite3VdbeMemNumerify(tls *libc.TLS, pMem uintptr) int32 { /* sqlite3.c:7
// is forced. In other words, the value is converted into the desired
// affinity even if that results in loss of data. This routine is
// used (for example) to implement the SQL "cast()" operator.
-func Xsqlite3VdbeMemCast(tls *libc.TLS, pMem uintptr, aff U8, encoding U8) int32 { /* sqlite3.c:77760:20: */
- if (int32((*Mem)(unsafe.Pointer(pMem)).Fflags) & MEM_Null) != 0 {
+func Xsqlite3VdbeMemCast(tls *libc.TLS, pMem uintptr, aff U8, encoding U8) int32 { /* sqlite3.c:77995:20: */
+ if int32((*Mem)(unsafe.Pointer(pMem)).Fflags)&MEM_Null != 0 {
return SQLITE_OK
}
switch int32(aff) {
case SQLITE_AFF_BLOB:
{ // Really a cast to BLOB
- if (int32((*Mem)(unsafe.Pointer(pMem)).Fflags) & MEM_Blob) == 0 {
+ if int32((*Mem)(unsafe.Pointer(pMem)).Fflags)&MEM_Blob == 0 {
Xsqlite3ValueApplyAffinity(tls, pMem, uint8(SQLITE_AFF_TEXT), encoding)
- if (int32((*Mem)(unsafe.Pointer(pMem)).Fflags) & MEM_Str) != 0 {
- (*Mem)(unsafe.Pointer(pMem)).Fflags = (U16((int32((*Mem)(unsafe.Pointer((pMem))).Fflags) & libc.CplInt32((MEM_TypeMask | MEM_Zero))) | MEM_Blob))
+ if int32((*Mem)(unsafe.Pointer(pMem)).Fflags)&MEM_Str != 0 {
+ (*Mem)(unsafe.Pointer(pMem)).Fflags = U16(int32((*Mem)(unsafe.Pointer(pMem)).Fflags)&libc.CplInt32(MEM_TypeMask|MEM_Zero) | MEM_Blob)
}
} else {
- *(*U16)(unsafe.Pointer(pMem + 8 /* &.flags */)) &= libc.Uint16FromInt32((libc.CplInt32((MEM_TypeMask & libc.CplInt32(MEM_Blob)))))
+ *(*U16)(unsafe.Pointer(pMem + 8)) &= libc.Uint16FromInt32(libc.CplInt32(MEM_TypeMask & libc.CplInt32(MEM_Blob)))
}
break
@@ -55356,10 +56070,10 @@ func Xsqlite3VdbeMemCast(tls *libc.TLS, pMem uintptr, aff U8, encoding U8) int32
default:
{
- *(*U16)(unsafe.Pointer(pMem + 8 /* &.flags */)) |= U16(((int32((*Mem)(unsafe.Pointer(pMem)).Fflags) & MEM_Blob) >> 3))
+ *(*U16)(unsafe.Pointer(pMem + 8)) |= U16(int32((*Mem)(unsafe.Pointer(pMem)).Fflags) & MEM_Blob >> 3)
Xsqlite3ValueApplyAffinity(tls, pMem, uint8(SQLITE_AFF_TEXT), encoding)
- *(*U16)(unsafe.Pointer(pMem + 8 /* &.flags */)) &= libc.Uint16FromInt32((libc.CplInt32(((((MEM_Int | MEM_Real) | MEM_IntReal) | MEM_Blob) | MEM_Zero))))
+ *(*U16)(unsafe.Pointer(pMem + 8)) &= libc.Uint16FromInt32(libc.CplInt32(MEM_Int | MEM_Real | MEM_IntReal | MEM_Blob | MEM_Zero))
return Xsqlite3VdbeChangeEncoding(tls, pMem, int32(encoding))
}
@@ -55370,7 +56084,7 @@ func Xsqlite3VdbeMemCast(tls *libc.TLS, pMem uintptr, aff U8, encoding U8) int32
// Initialize bulk memory to be a consistent Mem object.
//
// The minimum amount of initialization feasible is performed.
-func Xsqlite3VdbeMemInit(tls *libc.TLS, pMem uintptr, db uintptr, flags U16) { /* sqlite3.c:77803:21: */
+func Xsqlite3VdbeMemInit(tls *libc.TLS, pMem uintptr, db uintptr, flags U16) { /* sqlite3.c:78038:21: */
(*Mem)(unsafe.Pointer(pMem)).Fflags = flags
(*Mem)(unsafe.Pointer(pMem)).Fdb = db
@@ -55387,28 +56101,28 @@ func Xsqlite3VdbeMemInit(tls *libc.TLS, pMem uintptr, db uintptr, flags U16) { /
// Use this routine to reset the Mem prior to insert a new value.
//
// Use sqlite3VdbeMemRelease() to complete erase the Mem prior to abandoning it.
-func Xsqlite3VdbeMemSetNull(tls *libc.TLS, pMem uintptr) { /* sqlite3.c:77823:21: */
- if (int32((*Mem)(unsafe.Pointer((pMem))).Fflags) & (MEM_Agg | MEM_Dyn)) != 0 {
+func Xsqlite3VdbeMemSetNull(tls *libc.TLS, pMem uintptr) { /* sqlite3.c:78058:21: */
+ if int32((*Mem)(unsafe.Pointer(pMem)).Fflags)&(MEM_Agg|MEM_Dyn) != 0 {
vdbeMemClearExternAndSetNull(tls, pMem)
} else {
(*Mem)(unsafe.Pointer(pMem)).Fflags = U16(MEM_Null)
}
}
-func Xsqlite3ValueSetNull(tls *libc.TLS, p uintptr) { /* sqlite3.c:77830:21: */
+func Xsqlite3ValueSetNull(tls *libc.TLS, p uintptr) { /* sqlite3.c:78065:21: */
Xsqlite3VdbeMemSetNull(tls, p)
}
// Delete any previous value and set the value to be a BLOB of length
// n containing all zeros.
-func Xsqlite3VdbeMemSetZeroBlob(tls *libc.TLS, pMem uintptr, n int32) { /* sqlite3.c:77838:21: */
+func Xsqlite3VdbeMemSetZeroBlob(tls *libc.TLS, pMem uintptr, n int32) { /* sqlite3.c:78074:21: */
Xsqlite3VdbeMemRelease(tls, pMem)
- (*Mem)(unsafe.Pointer(pMem)).Fflags = (U16(MEM_Blob | MEM_Zero))
+ (*Mem)(unsafe.Pointer(pMem)).Fflags = U16(MEM_Blob | MEM_Zero)
(*Mem)(unsafe.Pointer(pMem)).Fn = 0
if n < 0 {
n = 0
}
- *(*int32)(unsafe.Pointer(pMem /* &.u */)) = n
+ *(*int32)(unsafe.Pointer(pMem)) = n
(*Mem)(unsafe.Pointer(pMem)).Fenc = U8(SQLITE_UTF8)
(*Mem)(unsafe.Pointer(pMem)).Fz = uintptr(0)
}
@@ -55416,40 +56130,40 @@ func Xsqlite3VdbeMemSetZeroBlob(tls *libc.TLS, pMem uintptr, n int32) { /* sqlit
// The pMem is known to contain content that needs to be destroyed prior
// to a value change. So invoke the destructor, then set the value to
// a 64-bit integer.
-func vdbeReleaseAndSetInt64(tls *libc.TLS, pMem uintptr, val I64) { /* sqlite3.c:77853:29: */
+func vdbeReleaseAndSetInt64(tls *libc.TLS, pMem uintptr, val I64) { /* sqlite3.c:78104:29: */
Xsqlite3VdbeMemSetNull(tls, pMem)
- *(*I64)(unsafe.Pointer(pMem /* &.u */)) = val
+ *(*I64)(unsafe.Pointer(pMem)) = val
(*Mem)(unsafe.Pointer(pMem)).Fflags = U16(MEM_Int)
}
// Delete any previous value and set the value stored in *pMem to val,
// manifest type INTEGER.
-func Xsqlite3VdbeMemSetInt64(tls *libc.TLS, pMem uintptr, val I64) { /* sqlite3.c:77863:21: */
- if (int32((*Mem)(unsafe.Pointer((pMem))).Fflags) & (MEM_Agg | MEM_Dyn)) != 0 {
+func Xsqlite3VdbeMemSetInt64(tls *libc.TLS, pMem uintptr, val I64) { /* sqlite3.c:78114:21: */
+ if int32((*Mem)(unsafe.Pointer(pMem)).Fflags)&(MEM_Agg|MEM_Dyn) != 0 {
vdbeReleaseAndSetInt64(tls, pMem, val)
} else {
- *(*I64)(unsafe.Pointer(pMem /* &.u */)) = val
+ *(*I64)(unsafe.Pointer(pMem)) = val
(*Mem)(unsafe.Pointer(pMem)).Fflags = U16(MEM_Int)
}
}
// A no-op destructor
-func Xsqlite3NoopDestructor(tls *libc.TLS, p uintptr) { /* sqlite3.c:77873:21: */
+func Xsqlite3NoopDestructor(tls *libc.TLS, p uintptr) { /* sqlite3.c:78124:21: */
_ = p
}
// Set the value stored in *pMem should already be a NULL.
// Also store a pointer to go with it.
-func Xsqlite3VdbeMemSetPointer(tls *libc.TLS, pMem uintptr, pPtr uintptr, zPType uintptr, xDestructor uintptr) { /* sqlite3.c:77879:21: */
+func Xsqlite3VdbeMemSetPointer(tls *libc.TLS, pMem uintptr, pPtr uintptr, zPType uintptr, xDestructor uintptr) { /* sqlite3.c:78130:21: */
- *(*uintptr)(unsafe.Pointer(pMem /* &.u */)) = func() uintptr {
+ *(*uintptr)(unsafe.Pointer(pMem)) = func() uintptr {
if zPType != 0 {
return zPType
}
- return ts + 755 /* "" */
+ return ts + 1543 /* "" */
}()
(*Mem)(unsafe.Pointer(pMem)).Fz = pPtr
- (*Mem)(unsafe.Pointer(pMem)).Fflags = (U16(((MEM_Null | MEM_Dyn) | MEM_Subtype) | MEM_Term))
+ (*Mem)(unsafe.Pointer(pMem)).Fflags = U16(MEM_Null | MEM_Dyn | MEM_Subtype | MEM_Term)
(*Mem)(unsafe.Pointer(pMem)).FeSubtype = U8('p')
(*Mem)(unsafe.Pointer(pMem)).FxDel = func() uintptr {
if xDestructor != 0 {
@@ -55461,10 +56175,10 @@ func Xsqlite3VdbeMemSetPointer(tls *libc.TLS, pMem uintptr, pPtr uintptr, zPType
// Delete any previous value and set the value stored in *pMem to val,
// manifest type REAL.
-func Xsqlite3VdbeMemSetDouble(tls *libc.TLS, pMem uintptr, val float64) { /* sqlite3.c:77898:21: */
+func Xsqlite3VdbeMemSetDouble(tls *libc.TLS, pMem uintptr, val float64) { /* sqlite3.c:78149:21: */
Xsqlite3VdbeMemSetNull(tls, pMem)
if !(Xsqlite3IsNaN(tls, val) != 0) {
- *(*float64)(unsafe.Pointer(pMem /* &.u */)) = val
+ *(*float64)(unsafe.Pointer(pMem)) = val
(*Mem)(unsafe.Pointer(pMem)).Fflags = U16(MEM_Real)
}
}
@@ -55474,7 +56188,7 @@ func Xsqlite3VdbeMemSetDouble(tls *libc.TLS, pMem uintptr, val float64) { /* sql
//
// Return SQLITE_OK on success and SQLITE_NOMEM if a memory allocation
// error occurs.
-func Xsqlite3VdbeMemSetRowSet(tls *libc.TLS, pMem uintptr) int32 { /* sqlite3.c:77925:20: */
+func Xsqlite3VdbeMemSetRowSet(tls *libc.TLS, pMem uintptr) int32 { /* sqlite3.c:78176:20: */
var db uintptr = (*Mem)(unsafe.Pointer(pMem)).Fdb
var p uintptr
@@ -55484,21 +56198,21 @@ func Xsqlite3VdbeMemSetRowSet(tls *libc.TLS, pMem uintptr) int32 { /* sqlite3.c:
return SQLITE_NOMEM
}
(*Mem)(unsafe.Pointer(pMem)).Fz = p
- (*Mem)(unsafe.Pointer(pMem)).Fflags = (U16(MEM_Blob | MEM_Dyn))
+ (*Mem)(unsafe.Pointer(pMem)).Fflags = U16(MEM_Blob | MEM_Dyn)
(*Mem)(unsafe.Pointer(pMem)).FxDel = *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{Xsqlite3RowSetDelete}))
return SQLITE_OK
}
// Return true if the Mem object contains a TEXT or BLOB that is
// too large - whose size exceeds SQLITE_MAX_LENGTH.
-func Xsqlite3VdbeMemTooBig(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:77943:20: */
+func Xsqlite3VdbeMemTooBig(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:78194:20: */
- if (int32((*Mem)(unsafe.Pointer(p)).Fflags) & (MEM_Str | MEM_Blob)) != 0 {
+ if int32((*Mem)(unsafe.Pointer(p)).Fflags)&(MEM_Str|MEM_Blob) != 0 {
var n int32 = (*Mem)(unsafe.Pointer(p)).Fn
- if (int32((*Mem)(unsafe.Pointer(p)).Fflags) & MEM_Zero) != 0 {
- n = n + (*(*int32)(unsafe.Pointer(p /* &.u */)))
+ if int32((*Mem)(unsafe.Pointer(p)).Fflags)&MEM_Zero != 0 {
+ n = n + *(*int32)(unsafe.Pointer(p))
}
- return (libc.Bool32(n > *(*int32)(unsafe.Pointer(((*Mem)(unsafe.Pointer(p)).Fdb + 112 /* &.aLimit */)))))
+ return libc.Bool32(n > *(*int32)(unsafe.Pointer((*Mem)(unsafe.Pointer(p)).Fdb + 120)))
}
return 0
}
@@ -55507,39 +56221,39 @@ func Xsqlite3VdbeMemTooBig(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:77943:
// pTo are freed. The pFrom->z field is not duplicated. If
// pFrom->z is used, then pTo->z points to the same thing as pFrom->z
// and flags gets srcType (either MEM_Ephem or MEM_Static).
-func vdbeClrCopy(tls *libc.TLS, pTo uintptr, pFrom uintptr, eType int32) { /* sqlite3.c:77999:29: */
+func vdbeClrCopy(tls *libc.TLS, pTo uintptr, pFrom uintptr, eType int32) { /* sqlite3.c:78250:29: */
vdbeMemClearExternAndSetNull(tls, pTo)
Xsqlite3VdbeMemShallowCopy(tls, pTo, pFrom, eType)
}
-func Xsqlite3VdbeMemShallowCopy(tls *libc.TLS, pTo uintptr, pFrom uintptr, srcType int32) { /* sqlite3.c:78004:21: */
+func Xsqlite3VdbeMemShallowCopy(tls *libc.TLS, pTo uintptr, pFrom uintptr, srcType int32) { /* sqlite3.c:78255:21: */
- if (int32((*Mem)(unsafe.Pointer((pTo))).Fflags) & (MEM_Agg | MEM_Dyn)) != 0 {
+ if int32((*Mem)(unsafe.Pointer(pTo)).Fflags)&(MEM_Agg|MEM_Dyn) != 0 {
vdbeClrCopy(tls, pTo, pFrom, srcType)
return
}
- libc.Xmemcpy(tls, pTo, pFrom, uint32((uintptr(0) + 20 /* &.zMalloc */)))
- if (int32((*Mem)(unsafe.Pointer(pFrom)).Fflags) & MEM_Static) == 0 {
- *(*U16)(unsafe.Pointer(pTo + 8 /* &.flags */)) &= libc.Uint16FromInt32((libc.CplInt32(((MEM_Dyn | MEM_Static) | MEM_Ephem))))
+ libc.Xmemcpy(tls, pTo, pFrom, uint32(uintptr(0)+20))
+ if int32((*Mem)(unsafe.Pointer(pFrom)).Fflags)&MEM_Static == 0 {
+ *(*U16)(unsafe.Pointer(pTo + 8)) &= libc.Uint16FromInt32(libc.CplInt32(MEM_Dyn | MEM_Static | MEM_Ephem))
- *(*U16)(unsafe.Pointer(pTo + 8 /* &.flags */)) |= U16((srcType))
+ *(*U16)(unsafe.Pointer(pTo + 8)) |= U16(srcType)
}
}
// Make a full copy of pFrom into pTo. Prior contents of pTo are
// freed before the copy is made.
-func Xsqlite3VdbeMemCopy(tls *libc.TLS, pTo uintptr, pFrom uintptr) int32 { /* sqlite3.c:78020:20: */
+func Xsqlite3VdbeMemCopy(tls *libc.TLS, pTo uintptr, pFrom uintptr) int32 { /* sqlite3.c:78271:20: */
var rc int32 = SQLITE_OK
- if (int32((*Mem)(unsafe.Pointer((pTo))).Fflags) & (MEM_Agg | MEM_Dyn)) != 0 {
+ if int32((*Mem)(unsafe.Pointer(pTo)).Fflags)&(MEM_Agg|MEM_Dyn) != 0 {
vdbeMemClearExternAndSetNull(tls, pTo)
}
- libc.Xmemcpy(tls, pTo, pFrom, uint32((uintptr(0) + 20 /* &.zMalloc */)))
- *(*U16)(unsafe.Pointer(pTo + 8 /* &.flags */)) &= libc.Uint16FromInt32((libc.CplInt32(MEM_Dyn)))
- if (int32((*Mem)(unsafe.Pointer(pTo)).Fflags) & (MEM_Str | MEM_Blob)) != 0 {
- if 0 == (int32((*Mem)(unsafe.Pointer(pFrom)).Fflags) & MEM_Static) {
- *(*U16)(unsafe.Pointer(pTo + 8 /* &.flags */)) |= U16((MEM_Ephem))
+ libc.Xmemcpy(tls, pTo, pFrom, uint32(uintptr(0)+20))
+ *(*U16)(unsafe.Pointer(pTo + 8)) &= libc.Uint16FromInt32(libc.CplInt32(MEM_Dyn))
+ if int32((*Mem)(unsafe.Pointer(pTo)).Fflags)&(MEM_Str|MEM_Blob) != 0 {
+ if 0 == int32((*Mem)(unsafe.Pointer(pFrom)).Fflags)&MEM_Static {
+ *(*U16)(unsafe.Pointer(pTo + 8)) |= U16(MEM_Ephem)
rc = Xsqlite3VdbeMemMakeWriteable(tls, pTo)
}
}
@@ -55551,7 +56265,7 @@ func Xsqlite3VdbeMemCopy(tls *libc.TLS, pTo uintptr, pFrom uintptr) int32 { /* s
// freed. If pFrom contains ephemeral data, a copy is made.
//
// pFrom contains an SQL NULL when this routine returns.
-func Xsqlite3VdbeMemMove(tls *libc.TLS, pTo uintptr, pFrom uintptr) { /* sqlite3.c:78043:21: */
+func Xsqlite3VdbeMemMove(tls *libc.TLS, pTo uintptr, pFrom uintptr) { /* sqlite3.c:78294:21: */
Xsqlite3VdbeMemRelease(tls, pTo)
libc.Xmemcpy(tls, pTo, pFrom, uint32(unsafe.Sizeof(Mem{})))
@@ -55572,7 +56286,7 @@ func Xsqlite3VdbeMemMove(tls *libc.TLS, pTo uintptr, pFrom uintptr) { /* sqlite3
// stored without allocating memory, then it is. If a memory allocation
// is required to store the string, then value of pMem is unchanged. In
// either case, SQLITE_TOOBIG is returned.
-func Xsqlite3VdbeMemSetStr(tls *libc.TLS, pMem uintptr, z uintptr, n I64, enc U8, xDel uintptr) int32 { /* sqlite3.c:78069:20: */
+func Xsqlite3VdbeMemSetStr(tls *libc.TLS, pMem uintptr, z uintptr, n I64, enc U8, xDel uintptr) int32 { /* sqlite3.c:78320:20: */
var nByte I64 = n // New value for pMem->n
var iLimit int32 // Maximum allowed string or blob size
var flags U16 = U16(0) // New value for pMem->flags
@@ -55584,7 +56298,7 @@ func Xsqlite3VdbeMemSetStr(tls *libc.TLS, pMem uintptr, z uintptr, n I64, enc U8
}
if (*Mem)(unsafe.Pointer(pMem)).Fdb != 0 {
- iLimit = *(*int32)(unsafe.Pointer(((*Mem)(unsafe.Pointer(pMem)).Fdb + 112 /* &.aLimit */)))
+ iLimit = *(*int32)(unsafe.Pointer((*Mem)(unsafe.Pointer(pMem)).Fdb + 120))
} else {
iLimit = SQLITE_MAX_LENGTH
}
@@ -55599,31 +56313,31 @@ func Xsqlite3VdbeMemSetStr(tls *libc.TLS, pMem uintptr, z uintptr, n I64, enc U8
if int32(enc) == SQLITE_UTF8 {
nByte = I64(libc.Xstrlen(tls, z))
} else {
- for nByte = int64(0); (nByte <= I64(iLimit)) && ((int32(*(*uint8)(unsafe.Pointer(z + uintptr(nByte)))) | int32(*(*uint8)(unsafe.Pointer(z + uintptr((nByte + int64(1))))))) != 0); nByte = nByte + (int64(2)) {
+ for nByte = int64(0); nByte <= I64(iLimit) && int32(*(*uint8)(unsafe.Pointer(z + uintptr(nByte))))|int32(*(*uint8)(unsafe.Pointer(z + uintptr(nByte+int64(1))))) != 0; nByte = nByte + int64(2) {
}
}
- flags = U16(int32(flags) | (MEM_Term))
+ flags = U16(int32(flags) | MEM_Term)
}
// The following block sets the new values of Mem.z and Mem.xDel. It
// also sets a flag in local variable "flags" to indicate the memory
// management (one of MEM_Dyn or MEM_Static).
- if xDel == (libc.UintptrFromInt32(-1)) {
+ if xDel == libc.UintptrFromInt32(-1) {
var nAlloc I64 = nByte
- if (int32(flags) & MEM_Term) != 0 {
- nAlloc = nAlloc + (func() int64 {
+ if int32(flags)&MEM_Term != 0 {
+ nAlloc = nAlloc + func() int64 {
if int32(enc) == SQLITE_UTF8 {
return int64(1)
}
return int64(2)
- }())
+ }()
}
if nByte > I64(iLimit) {
return Xsqlite3ErrorToParser(tls, (*Mem)(unsafe.Pointer(pMem)).Fdb, SQLITE_TOOBIG)
}
if Xsqlite3VdbeMemClearAndResize(tls, pMem, func() int32 {
- if (nAlloc) > (int64(32)) {
+ if nAlloc > int64(32) {
return int32(nAlloc)
}
return 32
@@ -55634,21 +56348,21 @@ func Xsqlite3VdbeMemSetStr(tls *libc.TLS, pMem uintptr, z uintptr, n I64, enc U8
} else {
Xsqlite3VdbeMemRelease(tls, pMem)
(*Mem)(unsafe.Pointer(pMem)).Fz = z
- if xDel == (*(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{Xsqlite3OomFault}))) {
+ if xDel == *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{Xsqlite3OomFault})) {
(*Mem)(unsafe.Pointer(pMem)).FzMalloc = (*Mem)(unsafe.Pointer(pMem)).Fz
(*Mem)(unsafe.Pointer(pMem)).FszMalloc = Xsqlite3DbMallocSize(tls, (*Mem)(unsafe.Pointer(pMem)).Fdb, (*Mem)(unsafe.Pointer(pMem)).FzMalloc)
} else {
(*Mem)(unsafe.Pointer(pMem)).FxDel = xDel
- flags = U16(int32(flags) | (func() int32 {
- if xDel == (uintptr(0)) {
+ flags = U16(int32(flags) | func() int32 {
+ if xDel == uintptr(0) {
return MEM_Static
}
return MEM_Dyn
- }()))
+ }())
}
}
- (*Mem)(unsafe.Pointer(pMem)).Fn = (int32(nByte & int64(0x7fffffff)))
+ (*Mem)(unsafe.Pointer(pMem)).Fn = int32(nByte & int64(0x7fffffff))
(*Mem)(unsafe.Pointer(pMem)).Fflags = flags
if enc != 0 {
(*Mem)(unsafe.Pointer(pMem)).Fenc = enc
@@ -55659,7 +56373,7 @@ func Xsqlite3VdbeMemSetStr(tls *libc.TLS, pMem uintptr, z uintptr, n I64, enc U8
(*Mem)(unsafe.Pointer(pMem)).Fenc = (*Sqlite3)(unsafe.Pointer((*Mem)(unsafe.Pointer(pMem)).Fdb)).Fenc
}
- if (int32(enc) > SQLITE_UTF8) && (Xsqlite3VdbeMemHandleBom(tls, pMem) != 0) {
+ if int32(enc) > SQLITE_UTF8 && Xsqlite3VdbeMemHandleBom(tls, pMem) != 0 {
return SQLITE_NOMEM
}
@@ -55683,13 +56397,13 @@ func Xsqlite3VdbeMemSetStr(tls *libc.TLS, pMem uintptr, z uintptr, n I64, enc U8
//
// If this routine fails for any reason (malloc returns NULL or unable
// to read from the disk) then the pMem is left in an inconsistent state.
-func Xsqlite3VdbeMemFromBtree(tls *libc.TLS, pCur uintptr, offset U32, amt U32, pMem uintptr) int32 { /* sqlite3.c:78177:20: */
+func Xsqlite3VdbeMemFromBtree(tls *libc.TLS, pCur uintptr, offset U32, amt U32, pMem uintptr) int32 { /* sqlite3.c:78429:20: */
var rc int32
(*Mem)(unsafe.Pointer(pMem)).Fflags = U16(MEM_Null)
- if Xsqlite3BtreeMaxRecordSize(tls, pCur) < (Sqlite3_int64(offset + amt)) {
- return Xsqlite3CorruptError(tls, 78186)
+ if Xsqlite3BtreeMaxRecordSize(tls, pCur) < Sqlite3_int64(offset+amt) {
+ return Xsqlite3CorruptError(tls, 78438)
}
- if SQLITE_OK == (libc.AssignInt32(&rc, Xsqlite3VdbeMemClearAndResize(tls, pMem, (int32(amt+U32(1)))))) {
+ if SQLITE_OK == libc.AssignInt32(&rc, Xsqlite3VdbeMemClearAndResize(tls, pMem, int32(amt+U32(1)))) {
rc = Xsqlite3BtreePayload(tls, pCur, offset, amt, (*Mem)(unsafe.Pointer(pMem)).Fz)
if rc == SQLITE_OK {
*(*uint8)(unsafe.Pointer((*Mem)(unsafe.Pointer(pMem)).Fz + uintptr(amt))) = uint8(0) // Overrun area used when reading malformed records
@@ -55702,7 +56416,7 @@ func Xsqlite3VdbeMemFromBtree(tls *libc.TLS, pCur uintptr, offset U32, amt U32,
return rc
}
-func Xsqlite3VdbeMemFromBtreeZeroOffset(tls *libc.TLS, pCur uintptr, amt U32, pMem uintptr) int32 { /* sqlite3.c:78200:20: */
+func Xsqlite3VdbeMemFromBtreeZeroOffset(tls *libc.TLS, pCur uintptr, amt U32, pMem uintptr) int32 { /* sqlite3.c:78452:20: */
bp := tls.Alloc(4)
defer tls.Free(4)
@@ -55714,8 +56428,8 @@ func Xsqlite3VdbeMemFromBtreeZeroOffset(tls *libc.TLS, pCur uintptr, amt U32, pM
(*Mem)(unsafe.Pointer(pMem)).Fz = Xsqlite3BtreePayloadFetch(tls, pCur, bp /* &available */)
- if amt <= *(*U32)(unsafe.Pointer(bp /* available */)) {
- (*Mem)(unsafe.Pointer(pMem)).Fflags = (U16(MEM_Blob | MEM_Ephem))
+ if amt <= *(*U32)(unsafe.Pointer(bp)) {
+ (*Mem)(unsafe.Pointer(pMem)).Fflags = U16(MEM_Blob | MEM_Ephem)
(*Mem)(unsafe.Pointer(pMem)).Fn = int32(amt)
} else {
rc = Xsqlite3VdbeMemFromBtree(tls, pCur, uint32(0), amt, pMem)
@@ -55727,22 +56441,22 @@ func Xsqlite3VdbeMemFromBtreeZeroOffset(tls *libc.TLS, pCur uintptr, amt U32, pM
// The pVal argument is known to be a value other than NULL.
// Convert it into a string with encoding enc and return a pointer
// to a zero-terminated version of that string.
-func valueToText(tls *libc.TLS, pVal uintptr, enc U8) uintptr { /* sqlite3.c:78232:35: */
+func valueToText(tls *libc.TLS, pVal uintptr, enc U8) uintptr { /* sqlite3.c:78484:35: */
- if (int32((*Sqlite3_value)(unsafe.Pointer(pVal)).Fflags) & (MEM_Blob | MEM_Str)) != 0 {
+ if int32((*Sqlite3_value)(unsafe.Pointer(pVal)).Fflags)&(MEM_Blob|MEM_Str) != 0 {
if func() int32 {
- if (int32((*Sqlite3_value)(unsafe.Pointer((pVal))).Fflags) & MEM_Zero) != 0 {
+ if int32((*Sqlite3_value)(unsafe.Pointer(pVal)).Fflags)&MEM_Zero != 0 {
return Xsqlite3VdbeMemExpandBlob(tls, pVal)
}
return 0
}() != 0 {
return uintptr(0)
}
- *(*U16)(unsafe.Pointer(pVal + 8 /* &.flags */)) |= U16((MEM_Str))
- if int32((*Sqlite3_value)(unsafe.Pointer(pVal)).Fenc) != (int32(enc) & libc.CplInt32(SQLITE_UTF16_ALIGNED)) {
- Xsqlite3VdbeChangeEncoding(tls, pVal, (int32(enc) & libc.CplInt32(SQLITE_UTF16_ALIGNED)))
+ *(*U16)(unsafe.Pointer(pVal + 8)) |= U16(MEM_Str)
+ if int32((*Sqlite3_value)(unsafe.Pointer(pVal)).Fenc) != int32(enc)&libc.CplInt32(SQLITE_UTF16_ALIGNED) {
+ Xsqlite3VdbeChangeEncoding(tls, pVal, int32(enc)&libc.CplInt32(SQLITE_UTF16_ALIGNED))
}
- if ((int32(enc) & SQLITE_UTF16_ALIGNED) != 0) && (1 == (1 & (int32((*Sqlite3_value)(unsafe.Pointer(pVal)).Fz)))) {
+ if int32(enc)&SQLITE_UTF16_ALIGNED != 0 && 1 == 1&int32((*Sqlite3_value)(unsafe.Pointer(pVal)).Fz) {
if Xsqlite3VdbeMemMakeWriteable(tls, pVal) != SQLITE_OK {
return uintptr(0)
@@ -55754,7 +56468,7 @@ func valueToText(tls *libc.TLS, pVal uintptr, enc U8) uintptr { /* sqlite3.c:782
}
- if int32((*Sqlite3_value)(unsafe.Pointer(pVal)).Fenc) == (int32(enc) & libc.CplInt32(SQLITE_UTF16_ALIGNED)) {
+ if int32((*Sqlite3_value)(unsafe.Pointer(pVal)).Fenc) == int32(enc)&libc.CplInt32(SQLITE_UTF16_ALIGNED) {
return (*Sqlite3_value)(unsafe.Pointer(pVal)).Fz
} else {
@@ -55772,23 +56486,23 @@ func valueToText(tls *libc.TLS, pVal uintptr, enc U8) uintptr { /* sqlite3.c:782
// (2006-02-16:) The enc value can be or-ed with SQLITE_UTF16_ALIGNED.
// If that is the case, then the result must be aligned on an even byte
// boundary.
-func Xsqlite3ValueText(tls *libc.TLS, pVal uintptr, enc U8) uintptr { /* sqlite3.c:78275:27: */
+func Xsqlite3ValueText(tls *libc.TLS, pVal uintptr, enc U8) uintptr { /* sqlite3.c:78527:27: */
if !(pVal != 0) {
return uintptr(0)
}
- if ((int32((*Sqlite3_value)(unsafe.Pointer(pVal)).Fflags) & (MEM_Str | MEM_Term)) == (MEM_Str | MEM_Term)) && (int32((*Sqlite3_value)(unsafe.Pointer(pVal)).Fenc) == int32(enc)) {
+ if int32((*Sqlite3_value)(unsafe.Pointer(pVal)).Fflags)&(MEM_Str|MEM_Term) == MEM_Str|MEM_Term && int32((*Sqlite3_value)(unsafe.Pointer(pVal)).Fenc) == int32(enc) {
return (*Sqlite3_value)(unsafe.Pointer(pVal)).Fz
}
- if (int32((*Sqlite3_value)(unsafe.Pointer(pVal)).Fflags) & MEM_Null) != 0 {
+ if int32((*Sqlite3_value)(unsafe.Pointer(pVal)).Fflags)&MEM_Null != 0 {
return uintptr(0)
}
return valueToText(tls, pVal, enc)
}
// Create a new sqlite3_value object.
-func Xsqlite3ValueNew(tls *libc.TLS, db uintptr) uintptr { /* sqlite3.c:78293:30: */
+func Xsqlite3ValueNew(tls *libc.TLS, db uintptr) uintptr { /* sqlite3.c:78545:30: */
var p uintptr = Xsqlite3DbMallocZero(tls, db, uint64(unsafe.Sizeof(Mem{})))
if p != 0 {
(*Mem)(unsafe.Pointer(p)).Fflags = U16(MEM_Null)
@@ -55804,7 +56518,7 @@ type ValueNewStat4Ctx = struct {
FpIdx uintptr
FppRec uintptr
FiVal int32
-} /* sqlite3.c:78306:1 */
+} /* sqlite3.c:78558:1 */
// Allocate and return a pointer to a new sqlite3_value object. If
// the second argument to this function is NULL, the object is allocated
@@ -55815,7 +56529,7 @@ type ValueNewStat4Ctx = struct {
// already been allocated, allocate the UnpackedRecord structure that
// that function will return to its caller here. Then return a pointer to
// an sqlite3_value within the UnpackedRecord.a[] array.
-func valueNew(tls *libc.TLS, db uintptr, p uintptr) uintptr { /* sqlite3.c:78324:22: */
+func valueNew(tls *libc.TLS, db uintptr, p uintptr) uintptr { /* sqlite3.c:78576:22: */
if p != 0 {
var pRec uintptr = *(*uintptr)(unsafe.Pointer((*ValueNewStat4Ctx)(unsafe.Pointer(p)).FppRec))
@@ -55825,13 +56539,13 @@ func valueNew(tls *libc.TLS, db uintptr, p uintptr) uintptr { /* sqlite3.c:78324
var i int32 // Counter variable
var nCol int32 = int32((*Index)(unsafe.Pointer(pIdx)).FnColumn) // Number of index columns including rowid
- nByte = (int32((uint32(unsafe.Sizeof(Mem{})) * uint32(nCol)) + (((uint32(unsafe.Sizeof(UnpackedRecord{}))) + uint32(7)) & libc.Uint32FromInt32(libc.CplInt32(7)))))
+ nByte = int32(uint32(unsafe.Sizeof(Mem{}))*uint32(nCol) + (uint32(unsafe.Sizeof(UnpackedRecord{}))+uint32(7))&libc.Uint32FromInt32(libc.CplInt32(7)))
pRec = Xsqlite3DbMallocZero(tls, db, uint64(nByte))
if pRec != 0 {
(*UnpackedRecord)(unsafe.Pointer(pRec)).FpKeyInfo = Xsqlite3KeyInfoOfIndex(tls, (*ValueNewStat4Ctx)(unsafe.Pointer(p)).FpParse, pIdx)
if (*UnpackedRecord)(unsafe.Pointer(pRec)).FpKeyInfo != 0 {
- (*UnpackedRecord)(unsafe.Pointer(pRec)).FaMem = (pRec + uintptr((((uint32(unsafe.Sizeof(UnpackedRecord{}))) + uint32(7)) & libc.Uint32FromInt32(libc.CplInt32(7)))))
+ (*UnpackedRecord)(unsafe.Pointer(pRec)).FaMem = pRec + uintptr((uint32(unsafe.Sizeof(UnpackedRecord{}))+uint32(7))&libc.Uint32FromInt32(libc.CplInt32(7)))
for i = 0; i < nCol; i++ {
(*Mem)(unsafe.Pointer((*UnpackedRecord)(unsafe.Pointer(pRec)).FaMem + uintptr(i)*40)).Fflags = U16(MEM_Null)
(*Mem)(unsafe.Pointer((*UnpackedRecord)(unsafe.Pointer(pRec)).FaMem + uintptr(i)*40)).Fdb = db
@@ -55847,8 +56561,8 @@ func valueNew(tls *libc.TLS, db uintptr, p uintptr) uintptr { /* sqlite3.c:78324
*(*uintptr)(unsafe.Pointer((*ValueNewStat4Ctx)(unsafe.Pointer(p)).FppRec)) = pRec
}
- (*UnpackedRecord)(unsafe.Pointer(pRec)).FnField = (U16((*ValueNewStat4Ctx)(unsafe.Pointer(p)).FiVal + 1))
- return ((*UnpackedRecord)(unsafe.Pointer(pRec)).FaMem + uintptr((*ValueNewStat4Ctx)(unsafe.Pointer(p)).FiVal)*40)
+ (*UnpackedRecord)(unsafe.Pointer(pRec)).FnField = U16((*ValueNewStat4Ctx)(unsafe.Pointer(p)).FiVal + 1)
+ return (*UnpackedRecord)(unsafe.Pointer(pRec)).FaMem + uintptr((*ValueNewStat4Ctx)(unsafe.Pointer(p)).FiVal)*40
}
return Xsqlite3ValueNew(tls, db)
}
@@ -55871,7 +56585,7 @@ func valueNew(tls *libc.TLS, db uintptr, p uintptr) uintptr { /* sqlite3.c:78324
// If the conditions above are not met, this function returns SQLITE_OK
// and sets (*ppVal) to NULL. Or, if an error occurs, (*ppVal) is set to
// NULL and an SQLite error code returned.
-func valueFromFunction(tls *libc.TLS, db uintptr, p uintptr, enc U8, aff U8, ppVal uintptr, pCtx uintptr) int32 { /* sqlite3.c:78386:12: */
+func valueFromFunction(tls *libc.TLS, db uintptr, p uintptr, enc U8, aff U8, ppVal uintptr, pCtx uintptr) int32 { /* sqlite3.c:78638:12: */
bp := tls.Alloc(40)
defer tls.Free(40)
@@ -55891,17 +56605,18 @@ func valueFromFunction(tls *libc.TLS, db uintptr, p uintptr, enc U8, aff U8, ppV
rc = SQLITE_OK
pList = uintptr(0) // Iterator variable
- pList = *(*uintptr)(unsafe.Pointer(p + 20 /* &.x */))
+ pList = *(*uintptr)(unsafe.Pointer(p + 20))
if !(pList != 0) {
goto __1
}
nVal = (*ExprList)(unsafe.Pointer(pList)).FnExpr
__1:
;
- pFunc = Xsqlite3FindFunction(tls, db, *(*uintptr)(unsafe.Pointer(p + 8 /* &.u */)), nVal, enc, uint8(0))
- if !((((*FuncDef)(unsafe.Pointer(pFunc)).FfuncFlags & (U32(SQLITE_FUNC_CONSTANT | SQLITE_FUNC_SLOCHNG))) == U32(0)) ||
- (((*FuncDef)(unsafe.Pointer(pFunc)).FfuncFlags & U32(SQLITE_FUNC_NEEDCOLL)) != 0)) {
+ pFunc = Xsqlite3FindFunction(tls, db, *(*uintptr)(unsafe.Pointer(p + 8)), nVal, enc, uint8(0))
+
+ if !((*FuncDef)(unsafe.Pointer(pFunc)).FfuncFlags&U32(SQLITE_FUNC_CONSTANT|SQLITE_FUNC_SLOCHNG) == U32(0) ||
+ (*FuncDef)(unsafe.Pointer(pFunc)).FfuncFlags&U32(SQLITE_FUNC_NEEDCOLL) != 0) {
goto __2
}
return SQLITE_OK
@@ -55911,7 +56626,7 @@ __2:
if !(pList != 0) {
goto __3
}
- apVal = Xsqlite3DbMallocZero(tls, db, (uint64(uint32(unsafe.Sizeof(uintptr(0))) * uint32(nVal))))
+ apVal = Xsqlite3DbMallocZero(tls, db, uint64(uint32(unsafe.Sizeof(uintptr(0)))*uint32(nVal)))
if !(apVal == uintptr(0)) {
goto __4
}
@@ -55924,8 +56639,8 @@ __5:
if !(i < nVal) {
goto __7
}
- rc = Xsqlite3ValueFromExpr(tls, db, (*ExprList_item)(unsafe.Pointer((pList+8 /* &.a */)+uintptr(i)*20)).FpExpr, enc, aff, (apVal + uintptr(i)*4))
- if !((*(*uintptr)(unsafe.Pointer(apVal + uintptr(i)*4)) == uintptr(0)) || (rc != SQLITE_OK)) {
+ rc = Xsqlite3ValueFromExpr(tls, db, (*ExprList_item)(unsafe.Pointer(pList+8+uintptr(i)*20)).FpExpr, enc, aff, apVal+uintptr(i)*4)
+ if !(*(*uintptr)(unsafe.Pointer(apVal + uintptr(i)*4)) == uintptr(0) || rc != SQLITE_OK) {
goto __8
}
goto value_from_function_out
@@ -55956,17 +56671,17 @@ __9:
(*struct {
f func(*libc.TLS, uintptr, int32, uintptr)
})(unsafe.Pointer(&struct{ uintptr }{(*FuncDef)(unsafe.Pointer(pFunc)).FxSFunc})).f(tls, bp+8 /* &ctx */, nVal, apVal)
- if !((*Sqlite3_context)(unsafe.Pointer(bp+8 /* &ctx */)).FisError != 0) {
+ if !((*Sqlite3_context)(unsafe.Pointer(bp+8)).FisError != 0) {
goto __10
}
rc = (*Sqlite3_context)(unsafe.Pointer(bp + 8 /* &ctx */)).FisError
- Xsqlite3ErrorMsg(tls, (*ValueNewStat4Ctx)(unsafe.Pointer(pCtx)).FpParse, ts+2790 /* "%s" */, libc.VaList(bp, Xsqlite3_value_text(tls, pVal)))
+ Xsqlite3ErrorMsg(tls, (*ValueNewStat4Ctx)(unsafe.Pointer(pCtx)).FpParse, ts+3601 /* "%s" */, libc.VaList(bp, Xsqlite3_value_text(tls, pVal)))
goto __11
__10:
Xsqlite3ValueApplyAffinity(tls, pVal, aff, uint8(SQLITE_UTF8))
rc = Xsqlite3VdbeChangeEncoding(tls, pVal, int32(enc))
- if !((rc == SQLITE_OK) && (Xsqlite3VdbeMemTooBig(tls, pVal) != 0)) {
+ if !(rc == SQLITE_OK && Xsqlite3VdbeMemTooBig(tls, pVal) != 0) {
goto __12
}
rc = SQLITE_TOOBIG
@@ -56016,7 +56731,7 @@ __14:
// has been allocated, it is freed before returning. Or, if pCtx is not
// NULL, it is assumed that the caller will free any allocated object
// in all cases.
-func valueFromExpr(tls *libc.TLS, db uintptr, pExpr uintptr, enc U8, affinity U8, ppVal uintptr, pCtx uintptr) int32 { /* sqlite3.c:78480:12: */
+func valueFromExpr(tls *libc.TLS, db uintptr, pExpr uintptr, enc U8, affinity U8, ppVal uintptr, pCtx uintptr) int32 { /* sqlite3.c:78734:12: */
bp := tls.Alloc(20)
defer tls.Free(20)
@@ -56032,11 +56747,11 @@ func valueFromExpr(tls *libc.TLS, db uintptr, pExpr uintptr, enc U8, affinity U8
zVal = uintptr(0)
*(*uintptr)(unsafe.Pointer(bp + 16 /* pVal */)) = uintptr(0)
negInt = 1
- zNeg = ts + 755 /* "" */
+ zNeg = ts + 1543 /* "" */
rc = SQLITE_OK
__1:
- if !(((libc.AssignInt32(&op, int32((*Expr)(unsafe.Pointer(pExpr)).Fop))) == TK_UPLUS) || (op == TK_SPAN)) {
+ if !(libc.AssignInt32(&op, int32((*Expr)(unsafe.Pointer(pExpr)).Fop)) == TK_UPLUS || op == TK_SPAN) {
goto __2
}
pExpr = (*Expr)(unsafe.Pointer(pExpr)).FpLeft
@@ -56058,7 +56773,8 @@ __3:
if !(op == TK_CAST) {
goto __4
}
- aff = U8(Xsqlite3AffinityType(tls, *(*uintptr)(unsafe.Pointer(pExpr + 8 /* &.u */)), uintptr(0)))
+
+ aff = U8(Xsqlite3AffinityType(tls, *(*uintptr)(unsafe.Pointer(pExpr + 8)), uintptr(0)))
rc = valueFromExpr(tls, db, (*Expr)(unsafe.Pointer(pExpr)).FpLeft, enc, aff, ppVal, pCtx)
if !(*(*uintptr)(unsafe.Pointer(ppVal)) != 0) {
@@ -56074,34 +56790,34 @@ __4:
// Handle negative integers in a single step. This is needed in the
// case when the value is -9223372036854775808.
- if !((op == TK_UMINUS) &&
- ((int32((*Expr)(unsafe.Pointer((*Expr)(unsafe.Pointer(pExpr)).FpLeft)).Fop) == TK_INTEGER) || (int32((*Expr)(unsafe.Pointer((*Expr)(unsafe.Pointer(pExpr)).FpLeft)).Fop) == TK_FLOAT))) {
+ if !(op == TK_UMINUS &&
+ (int32((*Expr)(unsafe.Pointer((*Expr)(unsafe.Pointer(pExpr)).FpLeft)).Fop) == TK_INTEGER || int32((*Expr)(unsafe.Pointer((*Expr)(unsafe.Pointer(pExpr)).FpLeft)).Fop) == TK_FLOAT)) {
goto __6
}
pExpr = (*Expr)(unsafe.Pointer(pExpr)).FpLeft
op = int32((*Expr)(unsafe.Pointer(pExpr)).Fop)
negInt = -1
- zNeg = ts + 4041 /* "-" */
+ zNeg = ts + 4852 /* "-" */
__6:
;
- if !(((op == TK_STRING) || (op == TK_FLOAT)) || (op == TK_INTEGER)) {
+ if !(op == TK_STRING || op == TK_FLOAT || op == TK_INTEGER) {
goto __7
}
*(*uintptr)(unsafe.Pointer(bp + 16 /* pVal */)) = valueNew(tls, db, pCtx)
- if !(*(*uintptr)(unsafe.Pointer(bp + 16 /* pVal */)) == uintptr(0)) {
+ if !(*(*uintptr)(unsafe.Pointer(bp + 16)) == uintptr(0)) {
goto __9
}
goto no_mem
__9:
;
- if !(((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_IntValue))) != U32(0)) {
+ if !((*Expr)(unsafe.Pointer(pExpr)).Fflags&U32(EP_IntValue) != U32(0)) {
goto __10
}
- Xsqlite3VdbeMemSetInt64(tls, *(*uintptr)(unsafe.Pointer(bp + 16 /* pVal */)), (I64(*(*int32)(unsafe.Pointer(pExpr + 8 /* &.u */))) * I64(negInt)))
+ Xsqlite3VdbeMemSetInt64(tls, *(*uintptr)(unsafe.Pointer(bp + 16 /* pVal */)), I64(*(*int32)(unsafe.Pointer(pExpr + 8)))*I64(negInt))
goto __11
__10:
- zVal = Xsqlite3MPrintf(tls, db, ts+4043 /* "%s%s" */, libc.VaList(bp, zNeg, *(*uintptr)(unsafe.Pointer(pExpr + 8 /* &.u */))))
+ zVal = Xsqlite3MPrintf(tls, db, ts+4854 /* "%s%s" */, libc.VaList(bp, zNeg, *(*uintptr)(unsafe.Pointer(pExpr + 8))))
if !(zVal == uintptr(0)) {
goto __12
}
@@ -56111,7 +56827,7 @@ __12:
Xsqlite3ValueSetStr(tls, *(*uintptr)(unsafe.Pointer(bp + 16 /* pVal */)), -1, zVal, uint8(SQLITE_UTF8), *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{Xsqlite3OomFault})))
__11:
;
- if !(((op == TK_INTEGER) || (op == TK_FLOAT)) && (int32(affinity) == SQLITE_AFF_BLOB)) {
+ if !((op == TK_INTEGER || op == TK_FLOAT) && int32(affinity) == SQLITE_AFF_BLOB) {
goto __13
}
Xsqlite3ValueApplyAffinity(tls, *(*uintptr)(unsafe.Pointer(bp + 16 /* pVal */)), uint8(SQLITE_AFF_NUMERIC), uint8(SQLITE_UTF8))
@@ -56121,11 +56837,11 @@ __13:
__14:
;
- if !((int32((*Sqlite3_value)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16 /* pVal */)))).Fflags) & ((MEM_Int | MEM_IntReal) | MEM_Real)) != 0) {
+ if !(int32((*Sqlite3_value)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16)))).Fflags)&(MEM_Int|MEM_IntReal|MEM_Real) != 0) {
goto __15
}
- *(*U16)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16 /* pVal */)) + 8 /* &.flags */)) &= libc.Uint16FromInt32((libc.CplInt32(MEM_Str)))
+ *(*U16)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16)) + 8)) &= libc.Uint16FromInt32(libc.CplInt32(MEM_Str))
__15:
;
if !(int32(enc) != SQLITE_UTF8) {
@@ -56140,25 +56856,25 @@ __7:
goto __17
}
// This branch happens for multiple negative signs. Ex: -(-5)
- if !((SQLITE_OK == valueFromExpr(tls, db, (*Expr)(unsafe.Pointer(pExpr)).FpLeft, enc, affinity, bp+16 /* &pVal */, pCtx)) &&
- (*(*uintptr)(unsafe.Pointer(bp + 16 /* pVal */)) != uintptr(0))) {
+ if !(SQLITE_OK == valueFromExpr(tls, db, (*Expr)(unsafe.Pointer(pExpr)).FpLeft, enc, affinity, bp+16, pCtx) &&
+ *(*uintptr)(unsafe.Pointer(bp + 16)) != uintptr(0)) {
goto __19
}
Xsqlite3VdbeMemNumerify(tls, *(*uintptr)(unsafe.Pointer(bp + 16 /* pVal */)))
- if !((int32((*Sqlite3_value)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16 /* pVal */)))).Fflags) & MEM_Real) != 0) {
+ if !(int32((*Sqlite3_value)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16)))).Fflags)&MEM_Real != 0) {
goto __20
}
- *(*float64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16 /* pVal */)) /* &.u */)) = -*(*float64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16 /* pVal */)) /* &.u */))
+ *(*float64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16)))) = -*(*float64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16))))
goto __21
__20:
- if !(*(*I64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16 /* pVal */)) /* &.u */)) == ((int64(-1)) - (int64(0xffffffff) | (I64((int64(0x7fffffff))) << 32)))) {
+ if !(*(*I64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16)))) == int64(-1)-(int64(0xffffffff)|I64(int64(0x7fffffff))<<32)) {
goto __22
}
- *(*float64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16 /* pVal */)) /* &.u */)) = -(float64((int64(-1)) - (int64(0xffffffff) | (I64((int64(0x7fffffff))) << 32))))
- (*Sqlite3_value)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16 /* pVal */)))).Fflags = (U16((int32((*Sqlite3_value)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(bp + 16 /* pVal */))))).Fflags) & libc.CplInt32((MEM_TypeMask | MEM_Zero))) | MEM_Real))
+ *(*float64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16)))) = -float64(int64(-1) - (int64(0xffffffff) | I64(int64(0x7fffffff))<<32))
+ (*Sqlite3_value)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16)))).Fflags = U16(int32((*Sqlite3_value)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16)))).Fflags)&libc.CplInt32(MEM_TypeMask|MEM_Zero) | MEM_Real)
goto __23
__22:
- *(*I64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16 /* pVal */)) /* &.u */)) = -*(*I64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16 /* pVal */)) /* &.u */))
+ *(*I64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16)))) = -*(*I64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16))))
__23:
;
__21:
@@ -56172,7 +56888,7 @@ __17:
goto __24
}
*(*uintptr)(unsafe.Pointer(bp + 16 /* pVal */)) = valueNew(tls, db, pCtx)
- if !(*(*uintptr)(unsafe.Pointer(bp + 16 /* pVal */)) == uintptr(0)) {
+ if !(*(*uintptr)(unsafe.Pointer(bp + 16)) == uintptr(0)) {
goto __26
}
goto no_mem
@@ -56186,20 +56902,20 @@ __24:
}
*(*uintptr)(unsafe.Pointer(bp + 16 /* pVal */)) = valueNew(tls, db, pCtx)
- if !(!(*(*uintptr)(unsafe.Pointer(bp + 16 /* pVal */)) != 0)) {
+ if !!(*(*uintptr)(unsafe.Pointer(bp + 16)) != 0) {
goto __29
}
goto no_mem
__29:
;
- zVal = (*(*uintptr)(unsafe.Pointer(pExpr + 8 /* &.u */)) + 2)
- nVal = (Xsqlite3Strlen30(tls, zVal) - 1)
+ zVal = *(*uintptr)(unsafe.Pointer(pExpr + 8)) + 2
+ nVal = Xsqlite3Strlen30(tls, zVal) - 1
- Xsqlite3VdbeMemSetStr(tls, *(*uintptr)(unsafe.Pointer(bp + 16 /* pVal */)), Xsqlite3HexToBlob(tls, db, zVal, nVal), (int64(nVal / 2)),
+ Xsqlite3VdbeMemSetStr(tls, *(*uintptr)(unsafe.Pointer(bp + 16 /* pVal */)), Xsqlite3HexToBlob(tls, db, zVal, nVal), int64(nVal/2),
uint8(0), *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{Xsqlite3OomFault})))
goto __28
__27:
- if !((op == TK_FUNCTION) && (pCtx != uintptr(0))) {
+ if !(op == TK_FUNCTION && pCtx != uintptr(0)) {
goto __30
}
rc = valueFromFunction(tls, db, pExpr, enc, affinity, bp+16 /* &pVal */, pCtx)
@@ -56208,12 +56924,13 @@ __30:
if !(op == TK_TRUEFALSE) {
goto __32
}
+
*(*uintptr)(unsafe.Pointer(bp + 16 /* pVal */)) = valueNew(tls, db, pCtx)
- if !(*(*uintptr)(unsafe.Pointer(bp + 16 /* pVal */)) != 0) {
+ if !(*(*uintptr)(unsafe.Pointer(bp + 16)) != 0) {
goto __33
}
(*Sqlite3_value)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16 /* pVal */)))).Fflags = U16(MEM_Int)
- *(*I64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16 /* pVal */)) /* &.u */)) = (I64(libc.Bool32(int32(*(*uint8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pExpr + 8 /* &.u */)) + 4))) == 0)))
+ *(*I64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16)))) = I64(libc.Bool32(int32(*(*uint8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pExpr + 8)) + 4))) == 0))
__33:
;
__32:
@@ -56233,7 +56950,7 @@ __8:
return rc
no_mem:
- if !((pCtx == uintptr(0)) || ((*Parse)(unsafe.Pointer((*ValueNewStat4Ctx)(unsafe.Pointer(pCtx)).FpParse)).FnErr == 0)) {
+ if !(pCtx == uintptr(0) || (*Parse)(unsafe.Pointer((*ValueNewStat4Ctx)(unsafe.Pointer(pCtx)).FpParse)).FnErr == 0) {
goto __34
}
Xsqlite3OomFault(tls, db)
@@ -56258,7 +56975,7 @@ __35:
// a pointer written to *ppVal. The caller is responsible for deallocating
// the value by passing it to sqlite3ValueFree() later on. If the expression
// cannot be converted to a value, then *ppVal is set to NULL.
-func Xsqlite3ValueFromExpr(tls *libc.TLS, db uintptr, pExpr uintptr, enc U8, affinity U8, ppVal uintptr) int32 { /* sqlite3.c:78635:20: */
+func Xsqlite3ValueFromExpr(tls *libc.TLS, db uintptr, pExpr uintptr, enc U8, affinity U8, ppVal uintptr) int32 { /* sqlite3.c:78893:20: */
if pExpr != 0 {
return valueFromExpr(tls, db, pExpr, enc, affinity, ppVal, uintptr(0))
}
@@ -56281,7 +56998,7 @@ func Xsqlite3ValueFromExpr(tls *libc.TLS, db uintptr, pExpr uintptr, enc U8, aff
//
// On success, *ppVal is made to point to the extracted value. The caller
// is responsible for ensuring that the value is eventually freed.
-func stat4ValueFromExpr(tls *libc.TLS, pParse uintptr, pExpr uintptr, affinity U8, pAlloc uintptr, ppVal uintptr) int32 { /* sqlite3.c:78664:12: */
+func stat4ValueFromExpr(tls *libc.TLS, pParse uintptr, pExpr uintptr, affinity U8, pAlloc uintptr, ppVal uintptr) int32 { /* sqlite3.c:78922:12: */
bp := tls.Alloc(4)
defer tls.Free(4)
@@ -56294,17 +57011,17 @@ func stat4ValueFromExpr(tls *libc.TLS, pParse uintptr, pExpr uintptr, affinity U
if !(pExpr != 0) {
*(*uintptr)(unsafe.Pointer(bp /* pVal */)) = valueNew(tls, db, pAlloc)
- if *(*uintptr)(unsafe.Pointer(bp /* pVal */)) != 0 {
+ if *(*uintptr)(unsafe.Pointer(bp)) != 0 {
Xsqlite3VdbeMemSetNull(tls, *(*uintptr)(unsafe.Pointer(bp /* pVal */)))
}
- } else if (int32((*Expr)(unsafe.Pointer(pExpr)).Fop) == TK_VARIABLE) && (((*Sqlite3)(unsafe.Pointer(db)).Fflags & uint64(SQLITE_EnableQPSG)) == uint64(0)) {
+ } else if int32((*Expr)(unsafe.Pointer(pExpr)).Fop) == TK_VARIABLE && (*Sqlite3)(unsafe.Pointer(db)).Fflags&uint64(SQLITE_EnableQPSG) == uint64(0) {
var v uintptr
var iBindVar int32 = int32((*Expr)(unsafe.Pointer(pExpr)).FiColumn)
Xsqlite3VdbeSetVarmask(tls, (*Parse)(unsafe.Pointer(pParse)).FpVdbe, iBindVar)
- if (libc.AssignUintptr(&v, (*Parse)(unsafe.Pointer(pParse)).FpReprepare)) != uintptr(0) {
+ if libc.AssignUintptr(&v, (*Parse)(unsafe.Pointer(pParse)).FpReprepare) != uintptr(0) {
*(*uintptr)(unsafe.Pointer(bp /* pVal */)) = valueNew(tls, db, pAlloc)
- if *(*uintptr)(unsafe.Pointer(bp /* pVal */)) != 0 {
- rc = Xsqlite3VdbeMemCopy(tls, *(*uintptr)(unsafe.Pointer(bp /* pVal */)), ((*Vdbe)(unsafe.Pointer(v)).FaVar + uintptr((iBindVar-1))*40))
+ if *(*uintptr)(unsafe.Pointer(bp)) != 0 {
+ rc = Xsqlite3VdbeMemCopy(tls, *(*uintptr)(unsafe.Pointer(bp /* pVal */)), (*Vdbe)(unsafe.Pointer(v)).FaVar+uintptr(iBindVar-1)*40)
Xsqlite3ValueApplyAffinity(tls, *(*uintptr)(unsafe.Pointer(bp /* pVal */)), affinity, (*Sqlite3)(unsafe.Pointer(db)).Fenc)
(*Sqlite3_value)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* pVal */)))).Fdb = (*Parse)(unsafe.Pointer(pParse)).Fdb
}
@@ -56349,14 +57066,14 @@ func stat4ValueFromExpr(tls *libc.TLS, pParse uintptr, pExpr uintptr, affinity U
// Unless an error is encountered, SQLITE_OK is returned. It is not an
// error if a value cannot be extracted from pExpr. If an error does
// occur, an SQLite error code is returned.
-func Xsqlite3Stat4ProbeSetValue(tls *libc.TLS, pParse uintptr, pIdx uintptr, ppRec uintptr, pExpr uintptr, nElem int32, iVal int32, pnExtract uintptr) int32 { /* sqlite3.c:78739:20: */
+func Xsqlite3Stat4ProbeSetValue(tls *libc.TLS, pParse uintptr, pIdx uintptr, ppRec uintptr, pExpr uintptr, nElem int32, iVal int32, pnExtract uintptr) int32 { /* sqlite3.c:78997:20: */
bp := tls.Alloc(20)
defer tls.Free(20)
var rc int32 = SQLITE_OK
var nExtract int32 = 0
- if (pExpr == uintptr(0)) || (int32((*Expr)(unsafe.Pointer(pExpr)).Fop) != TK_SELECT) {
+ if pExpr == uintptr(0) || int32((*Expr)(unsafe.Pointer(pExpr)).Fop) != TK_SELECT {
var i int32
// var alloc ValueNewStat4Ctx at bp, 16
@@ -56372,10 +57089,10 @@ func Xsqlite3Stat4ProbeSetValue(tls *libc.TLS, pParse uintptr, pIdx uintptr, ppR
}
return uintptr(0)
}()
- var aff U8 = U8(Xsqlite3IndexColumnAffinity(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, pIdx, (iVal + i)))
- (*ValueNewStat4Ctx)(unsafe.Pointer(bp /* &alloc */)).FiVal = (iVal + i)
+ var aff U8 = U8(Xsqlite3IndexColumnAffinity(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, pIdx, iVal+i))
+ (*ValueNewStat4Ctx)(unsafe.Pointer(bp /* &alloc */)).FiVal = iVal + i
rc = stat4ValueFromExpr(tls, pParse, pElem, aff, bp /* &alloc */, bp+16 /* &pVal */)
- if !(*(*uintptr)(unsafe.Pointer(bp + 16 /* pVal */)) != 0) {
+ if !(*(*uintptr)(unsafe.Pointer(bp + 16)) != 0) {
break
}
nExtract++
@@ -56394,7 +57111,7 @@ func Xsqlite3Stat4ProbeSetValue(tls *libc.TLS, pParse uintptr, pIdx uintptr, ppR
// (e.g. OOM), return SQLITE_OK and set *ppVal to NULL. Or, if an error
// does occur, return an SQLite error code. The final value of *ppVal
// is undefined in this case.
-func Xsqlite3Stat4ValueFromExpr(tls *libc.TLS, pParse uintptr, pExpr uintptr, affinity U8, ppVal uintptr) int32 { /* sqlite3.c:78784:20: */
+func Xsqlite3Stat4ValueFromExpr(tls *libc.TLS, pParse uintptr, pExpr uintptr, affinity U8, ppVal uintptr) int32 { /* sqlite3.c:79042:20: */
return stat4ValueFromExpr(tls, pParse, pExpr, affinity, uintptr(0), ppVal)
}
@@ -56404,7 +57121,7 @@ func Xsqlite3Stat4ValueFromExpr(tls *libc.TLS, pParse uintptr, pExpr uintptr, af
//
// If *ppVal is initially NULL then the caller is responsible for
// ensuring that the value written into *ppVal is eventually freed.
-func Xsqlite3Stat4Column(tls *libc.TLS, db uintptr, pRec uintptr, nRec int32, iCol int32, ppVal uintptr) int32 { /* sqlite3.c:78801:20: */
+func Xsqlite3Stat4Column(tls *libc.TLS, db uintptr, pRec uintptr, nRec int32, iCol int32, ppVal uintptr) int32 { /* sqlite3.c:79059:20: */
bp := tls.Alloc(8)
defer tls.Free(8)
@@ -56420,37 +57137,34 @@ func Xsqlite3Stat4Column(tls *libc.TLS, db uintptr, pRec uintptr, nRec int32, iC
iHdr = int32(func() uint8 {
if int32(*(*U8)(unsafe.Pointer(a))) < int32(U8(0x80)) {
- return uint8(func() int32 {
- (*(*int32)(unsafe.Pointer(bp /* nHdr */))) = int32(U32(*(*U8)(unsafe.Pointer(a))))
- return 1
- }())
+ return uint8(func() int32 { *(*int32)(unsafe.Pointer(bp)) = int32(U32(*(*U8)(unsafe.Pointer(a)))); return 1 }())
}
- return Xsqlite3GetVarint32(tls, a, bp /* &nHdr */)
+ return Xsqlite3GetVarint32(tls, a, bp)
}())
- if (*(*int32)(unsafe.Pointer(bp /* nHdr */)) > nRec) || (iHdr >= *(*int32)(unsafe.Pointer(bp /* nHdr */))) {
- return Xsqlite3CorruptError(tls, 78819)
+ if *(*int32)(unsafe.Pointer(bp)) > nRec || iHdr >= *(*int32)(unsafe.Pointer(bp)) {
+ return Xsqlite3CorruptError(tls, 79077)
}
iField = *(*int32)(unsafe.Pointer(bp /* nHdr */))
for i = 0; i <= iCol; i++ {
- iHdr = iHdr + (int32(func() uint8 {
- if int32(*(*U8)(unsafe.Pointer((a + uintptr(iHdr))))) < int32(U8(0x80)) {
+ iHdr = iHdr + int32(func() uint8 {
+ if int32(*(*U8)(unsafe.Pointer(a + uintptr(iHdr)))) < int32(U8(0x80)) {
return uint8(func() int32 {
- (*(*U32)(unsafe.Pointer(bp + 4 /* t */))) = U32(*(*U8)(unsafe.Pointer((a + uintptr(iHdr)))))
+ *(*U32)(unsafe.Pointer(bp + 4)) = U32(*(*U8)(unsafe.Pointer(a + uintptr(iHdr))))
return 1
}())
}
- return Xsqlite3GetVarint32(tls, (a + uintptr(iHdr)), bp+4 /* &t */)
- }()))
+ return Xsqlite3GetVarint32(tls, a+uintptr(iHdr), bp+4)
+ }())
- if iHdr > *(*int32)(unsafe.Pointer(bp /* nHdr */)) {
- return Xsqlite3CorruptError(tls, 78825)
+ if iHdr > *(*int32)(unsafe.Pointer(bp)) {
+ return Xsqlite3CorruptError(tls, 79083)
}
szField = int32(Xsqlite3VdbeSerialTypeLen(tls, *(*U32)(unsafe.Pointer(bp + 4 /* t */))))
- iField = iField + (szField)
+ iField = iField + szField
}
if iField > nRec {
- return Xsqlite3CorruptError(tls, 78831)
+ return Xsqlite3CorruptError(tls, 79089)
}
if pMem == uintptr(0) {
pMem = libc.AssignPtrUintptr(ppVal, Xsqlite3ValueNew(tls, db))
@@ -56458,7 +57172,7 @@ func Xsqlite3Stat4Column(tls *libc.TLS, db uintptr, pRec uintptr, nRec int32, iC
return SQLITE_NOMEM
}
}
- Xsqlite3VdbeSerialGet(tls, (a + uintptr((iField - szField))), *(*U32)(unsafe.Pointer(bp + 4 /* t */)), pMem)
+ Xsqlite3VdbeSerialGet(tls, a+uintptr(iField-szField), *(*U32)(unsafe.Pointer(bp + 4 /* t */)), pMem)
(*Mem)(unsafe.Pointer(pMem)).Fenc = (*Sqlite3)(unsafe.Pointer(db)).Fenc
return SQLITE_OK
}
@@ -56466,14 +57180,14 @@ func Xsqlite3Stat4Column(tls *libc.TLS, db uintptr, pRec uintptr, nRec int32, iC
// Unless it is NULL, the argument must be an UnpackedRecord object returned
// by an earlier call to sqlite3Stat4ProbeSetValue(). This call deletes
// the object.
-func Xsqlite3Stat4ProbeFree(tls *libc.TLS, pRec uintptr) { /* sqlite3.c:78846:21: */
+func Xsqlite3Stat4ProbeFree(tls *libc.TLS, pRec uintptr) { /* sqlite3.c:79104:21: */
if pRec != 0 {
var i int32
var nCol int32 = int32((*KeyInfo)(unsafe.Pointer((*UnpackedRecord)(unsafe.Pointer(pRec)).FpKeyInfo)).FnAllField)
var aMem uintptr = (*UnpackedRecord)(unsafe.Pointer(pRec)).FaMem
var db uintptr = (*Mem)(unsafe.Pointer(aMem)).Fdb
for i = 0; i < nCol; i++ {
- Xsqlite3VdbeMemRelease(tls, (aMem + uintptr(i)*40))
+ Xsqlite3VdbeMemRelease(tls, aMem+uintptr(i)*40)
}
Xsqlite3KeyInfoUnref(tls, (*UnpackedRecord)(unsafe.Pointer(pRec)).FpKeyInfo)
Xsqlite3DbFreeNN(tls, db, pRec)
@@ -56481,14 +57195,14 @@ func Xsqlite3Stat4ProbeFree(tls *libc.TLS, pRec uintptr) { /* sqlite3.c:78846:21
}
// Change the string value of an sqlite3_value object
-func Xsqlite3ValueSetStr(tls *libc.TLS, v uintptr, n int32, z uintptr, enc U8, xDel uintptr) { /* sqlite3.c:78864:21: */
+func Xsqlite3ValueSetStr(tls *libc.TLS, v uintptr, n int32, z uintptr, enc U8, xDel uintptr) { /* sqlite3.c:79122:21: */
if v != 0 {
Xsqlite3VdbeMemSetStr(tls, v, z, int64(n), enc, xDel)
}
}
// Free an sqlite3_value object
-func Xsqlite3ValueFree(tls *libc.TLS, v uintptr) { /* sqlite3.c:78877:21: */
+func Xsqlite3ValueFree(tls *libc.TLS, v uintptr) { /* sqlite3.c:79135:21: */
if !(v != 0) {
return
}
@@ -56499,41 +57213,41 @@ func Xsqlite3ValueFree(tls *libc.TLS, v uintptr) { /* sqlite3.c:78877:21: */
// The sqlite3ValueBytes() routine returns the number of bytes in the
// sqlite3_value object assuming that it uses the encoding "enc".
// The valueBytes() routine is a helper function.
-func valueBytes(tls *libc.TLS, pVal uintptr, enc U8) int32 { /* sqlite3.c:78888:28: */
+func valueBytes(tls *libc.TLS, pVal uintptr, enc U8) int32 { /* sqlite3.c:79146:28: */
if valueToText(tls, pVal, enc) != uintptr(0) {
return (*Sqlite3_value)(unsafe.Pointer(pVal)).Fn
}
return 0
}
-func Xsqlite3ValueBytes(tls *libc.TLS, pVal uintptr, enc U8) int32 { /* sqlite3.c:78891:20: */
+func Xsqlite3ValueBytes(tls *libc.TLS, pVal uintptr, enc U8) int32 { /* sqlite3.c:79149:20: */
var p uintptr = pVal
- if ((int32((*Mem)(unsafe.Pointer(p)).Fflags) & MEM_Str) != 0) && (int32((*Sqlite3_value)(unsafe.Pointer(pVal)).Fenc) == int32(enc)) {
+ if int32((*Mem)(unsafe.Pointer(p)).Fflags)&MEM_Str != 0 && int32((*Sqlite3_value)(unsafe.Pointer(pVal)).Fenc) == int32(enc) {
return (*Mem)(unsafe.Pointer(p)).Fn
}
- if (int32((*Mem)(unsafe.Pointer(p)).Fflags) & MEM_Blob) != 0 {
- if (int32((*Mem)(unsafe.Pointer(p)).Fflags) & MEM_Zero) != 0 {
- return ((*Mem)(unsafe.Pointer(p)).Fn + *(*int32)(unsafe.Pointer(p /* &.u */)))
+ if int32((*Mem)(unsafe.Pointer(p)).Fflags)&MEM_Blob != 0 {
+ if int32((*Mem)(unsafe.Pointer(p)).Fflags)&MEM_Zero != 0 {
+ return (*Mem)(unsafe.Pointer(p)).Fn + *(*int32)(unsafe.Pointer(p))
} else {
return (*Mem)(unsafe.Pointer(p)).Fn
}
}
- if (int32((*Mem)(unsafe.Pointer(p)).Fflags) & MEM_Null) != 0 {
+ if int32((*Mem)(unsafe.Pointer(p)).Fflags)&MEM_Null != 0 {
return 0
}
return valueBytes(tls, pVal, enc)
}
// Create a new virtual database engine.
-func Xsqlite3VdbeCreate(tls *libc.TLS, pParse uintptr) uintptr { /* sqlite3.c:78934:21: */
+func Xsqlite3VdbeCreate(tls *libc.TLS, pParse uintptr) uintptr { /* sqlite3.c:79192:21: */
var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb
var p uintptr
p = Xsqlite3DbMallocRawNN(tls, db, uint64(unsafe.Sizeof(Vdbe{})))
if p == uintptr(0) {
return uintptr(0)
}
- libc.Xmemset(tls, (p + 104 /* &.aOp */), 0, (uint32(unsafe.Sizeof(Vdbe{})) - (uint32((uintptr(0) + 104 /* &.aOp */)))))
+ libc.Xmemset(tls, p+112, 0, uint32(unsafe.Sizeof(Vdbe{}))-uint32(uintptr(0)+112))
(*Vdbe)(unsafe.Pointer(p)).Fdb = db
if (*Sqlite3)(unsafe.Pointer(db)).FpVdbe != 0 {
(*Vdbe1)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FpVdbe)).FpPrev = p
@@ -56550,12 +57264,12 @@ func Xsqlite3VdbeCreate(tls *libc.TLS, pParse uintptr) uintptr { /* sqlite3.c:78
}
// Return the Parse object that owns a Vdbe object.
-func Xsqlite3VdbeParser(tls *libc.TLS, p uintptr) uintptr { /* sqlite3.c:78961:22: */
+func Xsqlite3VdbeParser(tls *libc.TLS, p uintptr) uintptr { /* sqlite3.c:79219:22: */
return (*Vdbe)(unsafe.Pointer(p)).FpParse
}
// Change the error string stored in Vdbe.zErrMsg
-func Xsqlite3VdbeError(tls *libc.TLS, p uintptr, zFormat uintptr, va uintptr) { /* sqlite3.c:78968:21: */
+func Xsqlite3VdbeError(tls *libc.TLS, p uintptr, zFormat uintptr, va uintptr) { /* sqlite3.c:79226:21: */
var ap Va_list
_ = ap
Xsqlite3DbFree(tls, (*Vdbe)(unsafe.Pointer(p)).Fdb, (*Vdbe)(unsafe.Pointer(p)).FzErrMsg)
@@ -56565,12 +57279,12 @@ func Xsqlite3VdbeError(tls *libc.TLS, p uintptr, zFormat uintptr, va uintptr) {
}
// Remember the SQL string for a prepared statement.
-func Xsqlite3VdbeSetSql(tls *libc.TLS, p uintptr, z uintptr, n int32, prepFlags U8) { /* sqlite3.c:78979:21: */
+func Xsqlite3VdbeSetSql(tls *libc.TLS, p uintptr, z uintptr, n int32, prepFlags U8) { /* sqlite3.c:79237:21: */
if p == uintptr(0) {
return
}
(*Vdbe)(unsafe.Pointer(p)).FprepFlags = prepFlags
- if (int32(prepFlags) & SQLITE_PREPARE_SAVESQL) == 0 {
+ if int32(prepFlags)&SQLITE_PREPARE_SAVESQL == 0 {
(*Vdbe)(unsafe.Pointer(p)).Fexpmask = U32(0)
}
@@ -56578,7 +57292,7 @@ func Xsqlite3VdbeSetSql(tls *libc.TLS, p uintptr, z uintptr, n int32, prepFlags
}
// Swap all content between two VDBE structures.
-func Xsqlite3VdbeSwap(tls *libc.TLS, pA uintptr, pB uintptr) { /* sqlite3.c:79029:21: */
+func Xsqlite3VdbeSwap(tls *libc.TLS, pA uintptr, pB uintptr) { /* sqlite3.c:79287:21: */
var tmp Vdbe
var pTmp uintptr
var zTmp uintptr
@@ -56597,8 +57311,8 @@ func Xsqlite3VdbeSwap(tls *libc.TLS, pA uintptr, pB uintptr) { /* sqlite3.c:7902
(*Vdbe)(unsafe.Pointer(pB)).FzSql = zTmp
(*Vdbe)(unsafe.Pointer(pB)).Fexpmask = (*Vdbe)(unsafe.Pointer(pA)).Fexpmask
(*Vdbe)(unsafe.Pointer(pB)).FprepFlags = (*Vdbe)(unsafe.Pointer(pA)).FprepFlags
- libc.Xmemcpy(tls, pB+164 /* &.aCounter */, pA+164 /* &.aCounter */, uint32(unsafe.Sizeof([7]U32{})))
- *(*U32)(unsafe.Pointer((pB + 164 /* &.aCounter */) + 5*4))++
+ libc.Xmemcpy(tls, pB+172, pA+172, uint32(unsafe.Sizeof([7]U32{})))
+ *(*U32)(unsafe.Pointer(pB + 172 + 5*4))++
}
// Resize the Vdbe.aOp array so that it is at least nOp elements larger
@@ -56609,7 +57323,7 @@ func Xsqlite3VdbeSwap(tls *libc.TLS, pA uintptr, pB uintptr) { /* sqlite3.c:7902
// SQLITE_NOMEM. In this case Vdbe.aOp and Vdbe.nOpAlloc remain
// unchanged (this is so that any opcodes already allocated can be
// correctly deallocated along with the rest of the Vdbe).
-func growOpArray(tls *libc.TLS, v uintptr, nOp int32) int32 { /* sqlite3.c:79066:12: */
+func growOpArray(tls *libc.TLS, v uintptr, nOp int32) int32 { /* sqlite3.c:79324:12: */
var pNew uintptr
var p uintptr = (*Vdbe)(unsafe.Pointer(v)).FpParse
@@ -56622,22 +57336,22 @@ func growOpArray(tls *libc.TLS, v uintptr, nOp int32) int32 { /* sqlite3.c:79066
// size of the op array or add 1KB of space, whichever is smaller.
var nNew Sqlite3_int64 = func() int64 {
if (*Vdbe)(unsafe.Pointer(v)).FnOpAlloc != 0 {
- return (int64(2) * Sqlite3_int64((*Vdbe)(unsafe.Pointer(v)).FnOpAlloc))
+ return int64(2) * Sqlite3_int64((*Vdbe)(unsafe.Pointer(v)).FnOpAlloc)
}
- return (int64(uint32(1024) / uint32(unsafe.Sizeof(Op{}))))
+ return int64(uint32(1024) / uint32(unsafe.Sizeof(Op{})))
}()
_ = nOp
// Ensure that the size of a VDBE does not grow too large
- if nNew > Sqlite3_int64(*(*int32)(unsafe.Pointer(((*Parse)(unsafe.Pointer(p)).Fdb + 112 /* &.aLimit */) + 5*4))) {
+ if nNew > Sqlite3_int64(*(*int32)(unsafe.Pointer((*Parse)(unsafe.Pointer(p)).Fdb + 120 + 5*4))) {
Xsqlite3OomFault(tls, (*Parse)(unsafe.Pointer(p)).Fdb)
return SQLITE_NOMEM
}
- pNew = Xsqlite3DbRealloc(tls, (*Parse)(unsafe.Pointer(p)).Fdb, (*Vdbe)(unsafe.Pointer(v)).FaOp, (uint64(nNew * Sqlite3_int64(unsafe.Sizeof(Op{})))))
+ pNew = Xsqlite3DbRealloc(tls, (*Parse)(unsafe.Pointer(p)).Fdb, (*Vdbe)(unsafe.Pointer(v)).FaOp, uint64(nNew*Sqlite3_int64(unsafe.Sizeof(Op{}))))
if pNew != 0 {
(*Parse)(unsafe.Pointer(p)).FszOpAlloc = Xsqlite3DbMallocSize(tls, (*Parse)(unsafe.Pointer(p)).Fdb, pNew)
- (*Vdbe)(unsafe.Pointer(v)).FnOpAlloc = (int32(uint32((*Parse)(unsafe.Pointer(p)).FszOpAlloc) / uint32(unsafe.Sizeof(Op{}))))
+ (*Vdbe)(unsafe.Pointer(v)).FnOpAlloc = int32(uint32((*Parse)(unsafe.Pointer(p)).FszOpAlloc) / uint32(unsafe.Sizeof(Op{})))
(*Vdbe)(unsafe.Pointer(v)).FaOp = pNew
}
return func() int32 {
@@ -56662,7 +57376,7 @@ func growOpArray(tls *libc.TLS, v uintptr, nOp int32) int32 { /* sqlite3.c:79066
// Use the sqlite3VdbeResolveLabel() function to fix an address and
// the sqlite3VdbeChangeP4() function to change the value of the P4
// operand.
-func growOp3(tls *libc.TLS, p uintptr, op int32, p1 int32, p2 int32, p3 int32) int32 { /* sqlite3.c:79137:28: */
+func growOp3(tls *libc.TLS, p uintptr, op int32, p1 int32, p2 int32, p3 int32) int32 { /* sqlite3.c:79395:28: */
if growOpArray(tls, p, 1) != 0 {
return 1
@@ -56671,7 +57385,7 @@ func growOp3(tls *libc.TLS, p uintptr, op int32, p1 int32, p2 int32, p3 int32) i
return Xsqlite3VdbeAddOp3(tls, p, op, p1, p2, p3)
}
-func Xsqlite3VdbeAddOp3(tls *libc.TLS, p uintptr, op int32, p1 int32, p2 int32, p3 int32) int32 { /* sqlite3.c:79143:20: */
+func Xsqlite3VdbeAddOp3(tls *libc.TLS, p uintptr, op int32, p1 int32, p2 int32, p3 int32) int32 { /* sqlite3.c:79401:20: */
var i int32
var pOp uintptr
@@ -56680,38 +57394,40 @@ func Xsqlite3VdbeAddOp3(tls *libc.TLS, p uintptr, op int32, p1 int32, p2 int32,
if (*Vdbe)(unsafe.Pointer(p)).FnOpAlloc <= i {
return growOp3(tls, p, op, p1, p2, p3)
}
+
(*Vdbe)(unsafe.Pointer(p)).FnOp++
- pOp = ((*Vdbe)(unsafe.Pointer(p)).FaOp + uintptr(i)*20)
+ pOp = (*Vdbe)(unsafe.Pointer(p)).FaOp + uintptr(i)*20
+
(*VdbeOp)(unsafe.Pointer(pOp)).Fopcode = U8(op)
(*VdbeOp)(unsafe.Pointer(pOp)).Fp5 = U16(0)
(*VdbeOp)(unsafe.Pointer(pOp)).Fp1 = p1
(*VdbeOp)(unsafe.Pointer(pOp)).Fp2 = p2
(*VdbeOp)(unsafe.Pointer(pOp)).Fp3 = p3
- *(*uintptr)(unsafe.Pointer(pOp + 16 /* &.p4 */)) = uintptr(0)
+ *(*uintptr)(unsafe.Pointer(pOp + 16)) = uintptr(0)
(*VdbeOp)(unsafe.Pointer(pOp)).Fp4type = int8(P4_NOTUSED)
return i
}
-func Xsqlite3VdbeAddOp0(tls *libc.TLS, p uintptr, op int32) int32 { /* sqlite3.c:79180:20: */
+func Xsqlite3VdbeAddOp0(tls *libc.TLS, p uintptr, op int32) int32 { /* sqlite3.c:79440:20: */
return Xsqlite3VdbeAddOp3(tls, p, op, 0, 0, 0)
}
-func Xsqlite3VdbeAddOp1(tls *libc.TLS, p uintptr, op int32, p1 int32) int32 { /* sqlite3.c:79183:20: */
+func Xsqlite3VdbeAddOp1(tls *libc.TLS, p uintptr, op int32, p1 int32) int32 { /* sqlite3.c:79443:20: */
return Xsqlite3VdbeAddOp3(tls, p, op, p1, 0, 0)
}
-func Xsqlite3VdbeAddOp2(tls *libc.TLS, p uintptr, op int32, p1 int32, p2 int32) int32 { /* sqlite3.c:79186:20: */
+func Xsqlite3VdbeAddOp2(tls *libc.TLS, p uintptr, op int32, p1 int32, p2 int32) int32 { /* sqlite3.c:79446:20: */
return Xsqlite3VdbeAddOp3(tls, p, op, p1, p2, 0)
}
// Generate code for an unconditional jump to instruction iDest
-func Xsqlite3VdbeGoto(tls *libc.TLS, p uintptr, iDest int32) int32 { /* sqlite3.c:79192:20: */
+func Xsqlite3VdbeGoto(tls *libc.TLS, p uintptr, iDest int32) int32 { /* sqlite3.c:79452:20: */
return Xsqlite3VdbeAddOp3(tls, p, OP_Goto, 0, iDest, 0)
}
// Generate code to cause the string zStr to be loaded into
// register iDest
-func Xsqlite3VdbeLoadString(tls *libc.TLS, p uintptr, iDest int32, zStr uintptr) int32 { /* sqlite3.c:79199:20: */
+func Xsqlite3VdbeLoadString(tls *libc.TLS, p uintptr, iDest int32, zStr uintptr) int32 { /* sqlite3.c:79459:20: */
return Xsqlite3VdbeAddOp4(tls, p, OP_String8, 0, iDest, 0, zStr, 0)
}
@@ -56724,7 +57440,7 @@ func Xsqlite3VdbeLoadString(tls *libc.TLS, p uintptr, iDest int32, zStr uintptr)
//
// If the input string does not end with "X" then an OP_ResultRow instruction
// is generated for the values inserted.
-func Xsqlite3VdbeMultiLoad(tls *libc.TLS, p uintptr, iDest int32, zTypes uintptr, va uintptr) { /* sqlite3.c:79214:21: */
+func Xsqlite3VdbeMultiLoad(tls *libc.TLS, p uintptr, iDest int32, zTypes uintptr, va uintptr) { /* sqlite3.c:79474:21: */
var ap Va_list
_ = ap
var i int32
@@ -56733,7 +57449,7 @@ func Xsqlite3VdbeMultiLoad(tls *libc.TLS, p uintptr, iDest int32, zTypes uintptr
ap = va
i = 0
__1:
- if !((int32(libc.AssignUint8(&c, *(*uint8)(unsafe.Pointer(zTypes + uintptr(i)))))) != 0) {
+ if !(int32(libc.AssignUint8(&c, *(*uint8)(unsafe.Pointer(zTypes + uintptr(i))))) != 0) {
goto __3
}
if !(int32(c) == 's') {
@@ -56745,13 +57461,13 @@ __1:
return OP_Null
}
return OP_String8
- }(), 0, (iDest + i), 0, z, 0)
+ }(), 0, iDest+i, 0, z, 0)
goto __5
__4:
if !(int32(c) == 'i') {
goto __6
}
- Xsqlite3VdbeAddOp2(tls, p, OP_Integer, int32(libc.VaInt32(&ap)), (iDest + i))
+ Xsqlite3VdbeAddOp2(tls, p, OP_Integer, int32(libc.VaInt32(&ap)), iDest+i)
goto __7
__6:
goto skip_op_resultrow
@@ -56772,7 +57488,7 @@ skip_op_resultrow:
}
// Add an opcode that includes the p4 value as a pointer.
-func Xsqlite3VdbeAddOp4(tls *libc.TLS, p uintptr, op int32, p1 int32, p2 int32, p3 int32, zP4 uintptr, p4type int32) int32 { /* sqlite3.c:79237:20: */
+func Xsqlite3VdbeAddOp4(tls *libc.TLS, p uintptr, op int32, p1 int32, p2 int32, p3 int32, zP4 uintptr, p4type int32) int32 { /* sqlite3.c:79497:20: */
var addr int32 = Xsqlite3VdbeAddOp3(tls, p, op, p1, p2, p3)
Xsqlite3VdbeChangeP4(tls, p, addr, zP4, p4type)
return addr
@@ -56786,13 +57502,13 @@ func Xsqlite3VdbeAddOp4(tls *libc.TLS, p uintptr, op int32, p1 int32, p2 int32,
// NC_IdxExpr means called as part of an index expression. NC_PartIdx
// means in the WHERE clause of a partial index. NC_GenCol means called
// while computing a generated column value. 0 is the usual case.
-func Xsqlite3VdbeAddFunctionCall(tls *libc.TLS, pParse uintptr, p1 int32, p2 int32, p3 int32, nArg int32, pFunc uintptr, eCallCtx int32) int32 { /* sqlite3.c:79261:20: */
+func Xsqlite3VdbeAddFunctionCall(tls *libc.TLS, pParse uintptr, p1 int32, p2 int32, p3 int32, nArg int32, pFunc uintptr, eCallCtx int32) int32 { /* sqlite3.c:79521:20: */
var v uintptr = (*Parse)(unsafe.Pointer(pParse)).FpVdbe
var nByte int32
var addr int32
var pCtx uintptr
- nByte = (int32(uint32(unsafe.Sizeof(Sqlite3_context{})) + ((uint32(nArg - 1)) * uint32(unsafe.Sizeof(uintptr(0))))))
+ nByte = int32(uint32(unsafe.Sizeof(Sqlite3_context{})) + uint32(nArg-1)*uint32(unsafe.Sizeof(uintptr(0))))
pCtx = Xsqlite3DbMallocRawNN(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, uint64(nByte))
if pCtx == uintptr(0) {
@@ -56812,13 +57528,13 @@ func Xsqlite3VdbeAddFunctionCall(tls *libc.TLS, pParse uintptr, p1 int32, p2 int
return OP_Function
}(),
p1, p2, p3, pCtx, -16)
- Xsqlite3VdbeChangeP5(tls, v, (uint16(eCallCtx & NC_SelfRef)))
+ Xsqlite3VdbeChangeP5(tls, v, uint16(eCallCtx&NC_SelfRef))
return addr
}
// Add an opcode that includes the p4 value with a P4_INT64 or
// P4_REAL type.
-func Xsqlite3VdbeAddOp4Dup8(tls *libc.TLS, p uintptr, op int32, p1 int32, p2 int32, p3 int32, zP4 uintptr, p4type int32) int32 { /* sqlite3.c:79298:20: */
+func Xsqlite3VdbeAddOp4Dup8(tls *libc.TLS, p uintptr, op int32, p1 int32, p2 int32, p3 int32, zP4 uintptr, p4type int32) int32 { /* sqlite3.c:79558:20: */
var p4copy uintptr = Xsqlite3DbMallocRawNN(tls, Xsqlite3VdbeDb(tls, p), uint64(8))
if p4copy != 0 {
libc.Xmemcpy(tls, p4copy, zP4, uint32(8))
@@ -56828,7 +57544,7 @@ func Xsqlite3VdbeAddOp4Dup8(tls *libc.TLS, p uintptr, op int32, p1 int32, p2 int
// Return the address of the current EXPLAIN QUERY PLAN baseline.
// 0 means "none".
-func Xsqlite3VdbeExplainParent(tls *libc.TLS, pParse uintptr) int32 { /* sqlite3.c:79317:20: */
+func Xsqlite3VdbeExplainParent(tls *libc.TLS, pParse uintptr) int32 { /* sqlite3.c:79577:20: */
var pOp uintptr
if (*Parse)(unsafe.Pointer(pParse)).FaddrExplain == 0 {
return 0
@@ -56844,7 +57560,7 @@ func Xsqlite3VdbeExplainParent(tls *libc.TLS, pParse uintptr) int32 { /* sqlite3
//
// If the bPush flag is true, then make this opcode the parent for
// subsequent Explains until sqlite3VdbeExplainPop() is called.
-func Xsqlite3VdbeExplain(tls *libc.TLS, pParse uintptr, bPush U8, zFmt uintptr, va uintptr) { /* sqlite3.c:79341:21: */
+func Xsqlite3VdbeExplain(tls *libc.TLS, pParse uintptr, bPush U8, zFmt uintptr, va uintptr) { /* sqlite3.c:79601:21: */
// Always include the OP_Explain opcodes if SQLITE_DEBUG is defined.
// But omit them (for performance) during production builds
if int32((*Parse)(unsafe.Pointer(pParse)).Fexplain) == 2 {
@@ -56868,7 +57584,7 @@ func Xsqlite3VdbeExplain(tls *libc.TLS, pParse uintptr, bPush U8, zFmt uintptr,
}
// Pop the EXPLAIN QUERY PLAN stack one level.
-func Xsqlite3VdbeExplainPop(tls *libc.TLS, pParse uintptr) { /* sqlite3.c:79369:21: */
+func Xsqlite3VdbeExplainPop(tls *libc.TLS, pParse uintptr) { /* sqlite3.c:79629:21: */
(*Parse)(unsafe.Pointer(pParse)).FaddrExplain = Xsqlite3VdbeExplainParent(tls, pParse)
}
@@ -56879,7 +57595,7 @@ func Xsqlite3VdbeExplainPop(tls *libc.TLS, pParse uintptr) { /* sqlite3.c:79369:
//
// The zWhere string must have been obtained from sqlite3_malloc().
// This routine will take ownership of the allocated memory.
-func Xsqlite3VdbeAddParseSchemaOp(tls *libc.TLS, p uintptr, iDb int32, zWhere uintptr, p5 U16) { /* sqlite3.c:79383:21: */
+func Xsqlite3VdbeAddParseSchemaOp(tls *libc.TLS, p uintptr, iDb int32, zWhere uintptr, p5 U16) { /* sqlite3.c:79643:21: */
var j int32
Xsqlite3VdbeAddOp4(tls, p, OP_ParseSchema, iDb, 0, 0, zWhere, -7)
Xsqlite3VdbeChangeP5(tls, p, p5)
@@ -56890,18 +57606,18 @@ func Xsqlite3VdbeAddParseSchemaOp(tls *libc.TLS, p uintptr, iDb int32, zWhere ui
}
// Add an opcode that includes the p4 value as an integer.
-func Xsqlite3VdbeAddOp4Int(tls *libc.TLS, p uintptr, op int32, p1 int32, p2 int32, p3 int32, p4 int32) int32 { /* sqlite3.c:79394:20: */
+func Xsqlite3VdbeAddOp4Int(tls *libc.TLS, p uintptr, op int32, p1 int32, p2 int32, p3 int32, p4 int32) int32 { /* sqlite3.c:79654:20: */
var addr int32 = Xsqlite3VdbeAddOp3(tls, p, op, p1, p2, p3)
if int32((*Sqlite3)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).Fdb)).FmallocFailed) == 0 {
- var pOp uintptr = ((*Vdbe)(unsafe.Pointer(p)).FaOp + uintptr(addr)*20)
+ var pOp uintptr = (*Vdbe)(unsafe.Pointer(p)).FaOp + uintptr(addr)*20
(*VdbeOp)(unsafe.Pointer(pOp)).Fp4type = int8(-3)
- *(*int32)(unsafe.Pointer(pOp + 16 /* &.p4 */)) = p4
+ *(*int32)(unsafe.Pointer(pOp + 16)) = p4
}
return addr
}
// Insert the end of a co-routine
-func Xsqlite3VdbeEndCoroutine(tls *libc.TLS, v uintptr, regYield int32) { /* sqlite3.c:79413:21: */
+func Xsqlite3VdbeEndCoroutine(tls *libc.TLS, v uintptr, regYield int32) { /* sqlite3.c:79673:21: */
Xsqlite3VdbeAddOp1(tls, v, OP_EndCoroutine, regYield)
// Clear the temporary register cache, thereby ensuring that each
@@ -56936,17 +57652,17 @@ func Xsqlite3VdbeEndCoroutine(tls *libc.TLS, v uintptr, regYield int32) { /* sql
// been issued. The negative is stored because
// that gives a performance improvement over storing
// the equivalent positive value.
-func Xsqlite3VdbeMakeLabel(tls *libc.TLS, pParse uintptr) int32 { /* sqlite3.c:79451:20: */
+func Xsqlite3VdbeMakeLabel(tls *libc.TLS, pParse uintptr) int32 { /* sqlite3.c:79711:20: */
return libc.PreDecInt32(&(*Parse)(unsafe.Pointer(pParse)).FnLabel, 1)
}
// Resolve label "x" to be the address of the next instruction to
// be inserted. The parameter "x" must have been obtained from
// a prior call to sqlite3VdbeMakeLabel().
-func resizeResolveLabel(tls *libc.TLS, p uintptr, v uintptr, j int32) { /* sqlite3.c:79460:29: */
- var nNewSize int32 = (10 - (*Parse)(unsafe.Pointer(p)).FnLabel)
+func resizeResolveLabel(tls *libc.TLS, p uintptr, v uintptr, j int32) { /* sqlite3.c:79720:29: */
+ var nNewSize int32 = 10 - (*Parse)(unsafe.Pointer(p)).FnLabel
(*Parse)(unsafe.Pointer(p)).FaLabel = Xsqlite3DbReallocOrFree(tls, (*Parse)(unsafe.Pointer(p)).Fdb, (*Parse)(unsafe.Pointer(p)).FaLabel,
- (uint64(uint32(nNewSize) * uint32(unsafe.Sizeof(int32(0))))))
+ uint64(uint32(nNewSize)*uint32(unsafe.Sizeof(int32(0)))))
if (*Parse)(unsafe.Pointer(p)).FaLabel == uintptr(0) {
(*Parse)(unsafe.Pointer(p)).FnLabelAlloc = 0
} else {
@@ -56955,11 +57671,11 @@ func resizeResolveLabel(tls *libc.TLS, p uintptr, v uintptr, j int32) { /* sqlit
}
}
-func Xsqlite3VdbeResolveLabel(tls *libc.TLS, v uintptr, x int32) { /* sqlite3.c:79475:21: */
+func Xsqlite3VdbeResolveLabel(tls *libc.TLS, v uintptr, x int32) { /* sqlite3.c:79735:21: */
var p uintptr = (*Vdbe)(unsafe.Pointer(v)).FpParse
var j int32 = ^x
- if ((*Parse)(unsafe.Pointer(p)).FnLabelAlloc + (*Parse)(unsafe.Pointer(p)).FnLabel) < 0 {
+ if (*Parse)(unsafe.Pointer(p)).FnLabelAlloc+(*Parse)(unsafe.Pointer(p)).FnLabel < 0 {
resizeResolveLabel(tls, p, v, j)
} else {
// Labels may only be resolved once
@@ -56968,13 +57684,13 @@ func Xsqlite3VdbeResolveLabel(tls *libc.TLS, v uintptr, x int32) { /* sqlite3.c:
}
// Mark the VDBE as one that can only be run one time.
-func Xsqlite3VdbeRunOnlyOnce(tls *libc.TLS, p uintptr) { /* sqlite3.c:79497:21: */
- libc.SetBitFieldPtr16Uint32(p+152 /* &.runOnlyOnce */, Bft(1), 5, 0x20)
+func Xsqlite3VdbeRunOnlyOnce(tls *libc.TLS, p uintptr) { /* sqlite3.c:79757:21: */
+ libc.SetBitFieldPtr16Uint32(p+160, Bft(1), 5, 0x20)
}
// Mark the VDBE as one that can only be run multiple times.
-func Xsqlite3VdbeReusable(tls *libc.TLS, p uintptr) { /* sqlite3.c:79504:21: */
- libc.SetBitFieldPtr16Uint32(p+152 /* &.runOnlyOnce */, Bft(0), 5, 0x20)
+func Xsqlite3VdbeReusable(tls *libc.TLS, p uintptr) { /* sqlite3.c:79764:21: */
+ libc.SetBitFieldPtr16Uint32(p+160, Bft(0), 5, 0x20)
}
// This routine is called after all opcodes have been inserted. It loops
@@ -56996,14 +57712,14 @@ func Xsqlite3VdbeReusable(tls *libc.TLS, p uintptr) { /* sqlite3.c:79504:21: */
// This routine will only function correctly if the mkopcodeh.tcl generator
// script numbers the opcodes correctly. Changes to this routine must be
// coordinated with changes to mkopcodeh.tcl.
-func resolveP2Values(tls *libc.TLS, p uintptr, pMaxFuncArgs uintptr) { /* sqlite3.c:79700:13: */
+func resolveP2Values(tls *libc.TLS, p uintptr, pMaxFuncArgs uintptr) { /* sqlite3.c:79960:13: */
var nMaxArgs int32 = *(*int32)(unsafe.Pointer(pMaxFuncArgs))
var pOp uintptr
var pParse uintptr = (*Vdbe)(unsafe.Pointer(p)).FpParse
var aLabel uintptr = (*Parse)(unsafe.Pointer(pParse)).FaLabel
- libc.SetBitFieldPtr16Uint32(p+152 /* &.readOnly */, Bft(1), 7, 0x80)
- libc.SetBitFieldPtr16Uint32(p+152 /* &.bIsReader */, Bft(0), 8, 0x100)
- pOp = ((*Vdbe)(unsafe.Pointer(p)).FaOp + uintptr(((*Vdbe)(unsafe.Pointer(p)).FnOp-1))*20)
+ libc.SetBitFieldPtr16Uint32(p+160, Bft(1), 7, 0x80)
+ libc.SetBitFieldPtr16Uint32(p+160, Bft(0), 8, 0x100)
+ pOp = (*Vdbe)(unsafe.Pointer(p)).FaOp + uintptr((*Vdbe)(unsafe.Pointer(p)).FnOp-1)*20
for 1 != 0 {
// Only JUMP opcodes and the short list of special opcodes in the switch
@@ -57018,7 +57734,7 @@ func resolveP2Values(tls *libc.TLS, p uintptr, pMaxFuncArgs uintptr) { /* sqlite
case OP_Transaction:
{
if (*Op)(unsafe.Pointer(pOp)).Fp2 != 0 {
- libc.SetBitFieldPtr16Uint32(p+152 /* &.readOnly */, Bft(0), 7, 0x80)
+ libc.SetBitFieldPtr16Uint32(p+160, Bft(0), 7, 0x80)
}
}
@@ -57027,7 +57743,7 @@ func resolveP2Values(tls *libc.TLS, p uintptr, pMaxFuncArgs uintptr) { /* sqlite
fallthrough
case OP_Savepoint:
{
- libc.SetBitFieldPtr16Uint32(p+152 /* &.bIsReader */, Bft(1), 8, 0x100)
+ libc.SetBitFieldPtr16Uint32(p+160, Bft(1), 8, 0x100)
break
}
@@ -57038,8 +57754,8 @@ func resolveP2Values(tls *libc.TLS, p uintptr, pMaxFuncArgs uintptr) { /* sqlite
fallthrough
case OP_JournalMode:
{
- libc.SetBitFieldPtr16Uint32(p+152 /* &.readOnly */, Bft(0), 7, 0x80)
- libc.SetBitFieldPtr16Uint32(p+152 /* &.bIsReader */, Bft(1), 8, 0x100)
+ libc.SetBitFieldPtr16Uint32(p+160, Bft(0), 7, 0x80)
+ libc.SetBitFieldPtr16Uint32(p+160, Bft(1), 8, 0x100)
break
}
@@ -57048,7 +57764,7 @@ func resolveP2Values(tls *libc.TLS, p uintptr, pMaxFuncArgs uintptr) { /* sqlite
fallthrough
case OP_SorterNext:
{
- *(*uintptr)(unsafe.Pointer(pOp + 16 /* &.p4 */)) = *(*uintptr)(unsafe.Pointer(&struct {
+ *(*uintptr)(unsafe.Pointer(pOp + 16)) = *(*uintptr)(unsafe.Pointer(&struct {
f func(*libc.TLS, uintptr, int32) int32
}{Xsqlite3BtreeNext}))
(*Op)(unsafe.Pointer(pOp)).Fp4type = int8(-5)
@@ -57062,7 +57778,7 @@ func resolveP2Values(tls *libc.TLS, p uintptr, pMaxFuncArgs uintptr) { /* sqlite
fallthrough
case OP_Prev:
{
- *(*uintptr)(unsafe.Pointer(pOp + 16 /* &.p4 */)) = *(*uintptr)(unsafe.Pointer(&struct {
+ *(*uintptr)(unsafe.Pointer(pOp + 16)) = *(*uintptr)(unsafe.Pointer(&struct {
f func(*libc.TLS, uintptr, int32) int32
}{Xsqlite3BtreePrevious}))
(*Op)(unsafe.Pointer(pOp)).Fp4type = int8(-5)
@@ -57125,7 +57841,7 @@ func resolveP2Values(tls *libc.TLS, p uintptr, pMaxFuncArgs uintptr) { /* sqlite
}
// Return the address of the next instruction to be inserted.
-func Xsqlite3VdbeCurrentAddr(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:79802:20: */
+func Xsqlite3VdbeCurrentAddr(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:80062:20: */
return (*Vdbe)(unsafe.Pointer(p)).FnOp
}
@@ -57156,7 +57872,7 @@ func Xsqlite3VdbeCurrentAddr(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:7980
// array. Also, *pnMaxArg is set to the larger of its current value and
// the number of entries in the Vdbe.apArg[] array required to execute the
// returned program.
-func Xsqlite3VdbeTakeOpArray(tls *libc.TLS, p uintptr, pnOp uintptr, pnMaxArg uintptr) uintptr { /* sqlite3.c:79859:23: */
+func Xsqlite3VdbeTakeOpArray(tls *libc.TLS, p uintptr, pnOp uintptr, pnMaxArg uintptr) uintptr { /* sqlite3.c:80119:23: */
var aOp uintptr = (*Vdbe)(unsafe.Pointer(p)).FaOp
// Check that sqlite3VdbeUsesBtree() was not called on this VM
@@ -57172,15 +57888,15 @@ func Xsqlite3VdbeTakeOpArray(tls *libc.TLS, p uintptr, pnOp uintptr, pnMaxArg ui
//
// Non-zero P2 arguments to jump instructions are automatically adjusted
// so that the jump target is relative to the first operation inserted.
-func Xsqlite3VdbeAddOpList(tls *libc.TLS, p uintptr, nOp int32, aOp uintptr, iLineno int32) uintptr { /* sqlite3.c:79879:23: */
+func Xsqlite3VdbeAddOpList(tls *libc.TLS, p uintptr, nOp int32, aOp uintptr, iLineno int32) uintptr { /* sqlite3.c:80139:23: */
var i int32
var pOut uintptr
var pFirst uintptr
- if (((*Vdbe)(unsafe.Pointer(p)).FnOp + nOp) > (*Vdbe)(unsafe.Pointer(p)).FnOpAlloc) && (growOpArray(tls, p, nOp) != 0) {
+ if (*Vdbe)(unsafe.Pointer(p)).FnOp+nOp > (*Vdbe)(unsafe.Pointer(p)).FnOpAlloc && growOpArray(tls, p, nOp) != 0 {
return uintptr(0)
}
- pFirst = libc.AssignUintptr(&pOut, ((*Vdbe)(unsafe.Pointer(p)).FaOp + uintptr((*Vdbe)(unsafe.Pointer(p)).FnOp)*20))
+ pFirst = libc.AssignUintptr(&pOut, (*Vdbe)(unsafe.Pointer(p)).FaOp+uintptr((*Vdbe)(unsafe.Pointer(p)).FnOp)*20)
i = 0
__1:
if !(i < nOp) {
@@ -57191,12 +57907,12 @@ __1:
(*VdbeOp)(unsafe.Pointer(pOut)).Fp1 = int32((*VdbeOpList)(unsafe.Pointer(aOp)).Fp1)
(*VdbeOp)(unsafe.Pointer(pOut)).Fp2 = int32((*VdbeOpList)(unsafe.Pointer(aOp)).Fp2)
- if ((int32(Xsqlite3OpcodeProperty[(*VdbeOpList)(unsafe.Pointer(aOp)).Fopcode]) & OPFLG_JUMP) != 0) && (int32((*VdbeOpList)(unsafe.Pointer(aOp)).Fp2) > 0) {
- *(*int32)(unsafe.Pointer(pOut + 8 /* &.p2 */)) += ((*Vdbe)(unsafe.Pointer(p)).FnOp)
+ if int32(Xsqlite3OpcodeProperty[(*VdbeOpList)(unsafe.Pointer(aOp)).Fopcode])&OPFLG_JUMP != 0 && int32((*VdbeOpList)(unsafe.Pointer(aOp)).Fp2) > 0 {
+ *(*int32)(unsafe.Pointer(pOut + 8)) += (*Vdbe)(unsafe.Pointer(p)).FnOp
}
(*VdbeOp)(unsafe.Pointer(pOut)).Fp3 = int32((*VdbeOpList)(unsafe.Pointer(aOp)).Fp3)
(*VdbeOp)(unsafe.Pointer(pOut)).Fp4type = int8(P4_NOTUSED)
- *(*uintptr)(unsafe.Pointer(pOut + 16 /* &.p4 */)) = uintptr(0)
+ *(*uintptr)(unsafe.Pointer(pOut + 16)) = uintptr(0)
(*VdbeOp)(unsafe.Pointer(pOut)).Fp5 = U16(0)
_ = iLineno
@@ -57210,38 +57926,38 @@ __2:
goto __3
__3:
;
- *(*int32)(unsafe.Pointer(p + 108 /* &.nOp */)) += (nOp)
+ *(*int32)(unsafe.Pointer(p + 116)) += nOp
return pFirst
}
// Change the value of the opcode, or P1, P2, P3, or P5 operands
// for a specific instruction.
-func Xsqlite3VdbeChangeOpcode(tls *libc.TLS, p uintptr, addr int32, iNewOpcode U8) { /* sqlite3.c:79955:21: */
+func Xsqlite3VdbeChangeOpcode(tls *libc.TLS, p uintptr, addr int32, iNewOpcode U8) { /* sqlite3.c:80215:21: */
(*VdbeOp)(unsafe.Pointer(Xsqlite3VdbeGetOp(tls, p, addr))).Fopcode = iNewOpcode
}
-func Xsqlite3VdbeChangeP1(tls *libc.TLS, p uintptr, addr int32, val int32) { /* sqlite3.c:79958:21: */
+func Xsqlite3VdbeChangeP1(tls *libc.TLS, p uintptr, addr int32, val int32) { /* sqlite3.c:80218:21: */
(*VdbeOp)(unsafe.Pointer(Xsqlite3VdbeGetOp(tls, p, addr))).Fp1 = val
}
-func Xsqlite3VdbeChangeP2(tls *libc.TLS, p uintptr, addr int32, val int32) { /* sqlite3.c:79961:21: */
+func Xsqlite3VdbeChangeP2(tls *libc.TLS, p uintptr, addr int32, val int32) { /* sqlite3.c:80221:21: */
(*VdbeOp)(unsafe.Pointer(Xsqlite3VdbeGetOp(tls, p, addr))).Fp2 = val
}
-func Xsqlite3VdbeChangeP3(tls *libc.TLS, p uintptr, addr int32, val int32) { /* sqlite3.c:79964:21: */
+func Xsqlite3VdbeChangeP3(tls *libc.TLS, p uintptr, addr int32, val int32) { /* sqlite3.c:80224:21: */
(*VdbeOp)(unsafe.Pointer(Xsqlite3VdbeGetOp(tls, p, addr))).Fp3 = val
}
-func Xsqlite3VdbeChangeP5(tls *libc.TLS, p uintptr, p5 U16) { /* sqlite3.c:79967:21: */
+func Xsqlite3VdbeChangeP5(tls *libc.TLS, p uintptr, p5 U16) { /* sqlite3.c:80227:21: */
if (*Vdbe)(unsafe.Pointer(p)).FnOp > 0 {
- (*Op)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FaOp + uintptr(((*Vdbe)(unsafe.Pointer(p)).FnOp-1))*20)).Fp5 = p5
+ (*Op)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FaOp + uintptr((*Vdbe)(unsafe.Pointer(p)).FnOp-1)*20)).Fp5 = p5
}
}
// Change the P2 operand of instruction addr so that it points to
// the address of the next instruction to be coded.
-func Xsqlite3VdbeJumpHere(tls *libc.TLS, p uintptr, addr int32) { /* sqlite3.c:79976:21: */
+func Xsqlite3VdbeJumpHere(tls *libc.TLS, p uintptr, addr int32) { /* sqlite3.c:80236:21: */
Xsqlite3VdbeChangeP2(tls, p, addr, (*Vdbe)(unsafe.Pointer(p)).FnOp)
}
@@ -57256,8 +57972,8 @@ func Xsqlite3VdbeJumpHere(tls *libc.TLS, p uintptr, addr int32) { /* sqlite3.c:7
//
// 7 Once 0 8 0
// 8 ...
-func Xsqlite3VdbeJumpHereOrPopInst(tls *libc.TLS, p uintptr, addr int32) { /* sqlite3.c:79993:21: */
- if addr == ((*Vdbe)(unsafe.Pointer(p)).FnOp - 1) {
+func Xsqlite3VdbeJumpHereOrPopInst(tls *libc.TLS, p uintptr, addr int32) { /* sqlite3.c:80253:21: */
+ if addr == (*Vdbe)(unsafe.Pointer(p)).FnOp-1 {
(*Vdbe)(unsafe.Pointer(p)).FnOp--
} else {
@@ -57267,26 +57983,26 @@ func Xsqlite3VdbeJumpHereOrPopInst(tls *libc.TLS, p uintptr, addr int32) { /* sq
// If the input FuncDef structure is ephemeral, then free it. If
// the FuncDef is not ephermal, then do nothing.
-func freeEphemeralFunction(tls *libc.TLS, db uintptr, pDef uintptr) { /* sqlite3.c:80013:13: */
- if ((*FuncDef)(unsafe.Pointer(pDef)).FfuncFlags & U32(SQLITE_FUNC_EPHEM)) != U32(0) {
+func freeEphemeralFunction(tls *libc.TLS, db uintptr, pDef uintptr) { /* sqlite3.c:80273:13: */
+ if (*FuncDef)(unsafe.Pointer(pDef)).FfuncFlags&U32(SQLITE_FUNC_EPHEM) != U32(0) {
Xsqlite3DbFreeNN(tls, db, pDef)
}
}
// Delete a P4 value if necessary.
-func freeP4Mem(tls *libc.TLS, db uintptr, p uintptr) { /* sqlite3.c:80022:29: */
+func freeP4Mem(tls *libc.TLS, db uintptr, p uintptr) { /* sqlite3.c:80282:29: */
if (*Mem)(unsafe.Pointer(p)).FszMalloc != 0 {
Xsqlite3DbFree(tls, db, (*Mem)(unsafe.Pointer(p)).FzMalloc)
}
Xsqlite3DbFreeNN(tls, db, p)
}
-func freeP4FuncCtx(tls *libc.TLS, db uintptr, p uintptr) { /* sqlite3.c:80026:29: */
+func freeP4FuncCtx(tls *libc.TLS, db uintptr, p uintptr) { /* sqlite3.c:80286:29: */
freeEphemeralFunction(tls, db, (*Sqlite3_context)(unsafe.Pointer(p)).FpFunc)
Xsqlite3DbFreeNN(tls, db, p)
}
-func freeP4(tls *libc.TLS, db uintptr, p4type int32, p4 uintptr) { /* sqlite3.c:80030:13: */
+func freeP4(tls *libc.TLS, db uintptr, p4type int32, p4 uintptr) { /* sqlite3.c:80290:13: */
switch p4type {
case -16:
@@ -57347,12 +58063,12 @@ func freeP4(tls *libc.TLS, db uintptr, p4type int32, p4 uintptr) { /* sqlite3.c:
// Free the space allocated for aOp and any p4 values allocated for the
// opcodes contained within. If aOp is not NULL it is assumed to contain
// nOp entries.
-func vdbeFreeOpArray(tls *libc.TLS, db uintptr, aOp uintptr, nOp int32) { /* sqlite3.c:80079:13: */
+func vdbeFreeOpArray(tls *libc.TLS, db uintptr, aOp uintptr, nOp int32) { /* sqlite3.c:80339:13: */
if aOp != 0 {
var pOp uintptr
- for pOp = (aOp + uintptr((nOp-1))*20); pOp >= aOp; pOp -= 20 {
- if int32((*Op)(unsafe.Pointer(pOp)).Fp4type) <= (-7) {
- freeP4(tls, db, int32((*Op)(unsafe.Pointer(pOp)).Fp4type), *(*uintptr)(unsafe.Pointer(pOp + 16 /* &.p4 */)))
+ for pOp = aOp + uintptr(nOp-1)*20; pOp >= aOp; pOp -= 20 {
+ if int32((*Op)(unsafe.Pointer(pOp)).Fp4type) <= -7 {
+ freeP4(tls, db, int32((*Op)(unsafe.Pointer(pOp)).Fp4type), *(*uintptr)(unsafe.Pointer(pOp + 16)))
}
}
Xsqlite3DbFreeNN(tls, db, aOp)
@@ -57362,36 +58078,36 @@ func vdbeFreeOpArray(tls *libc.TLS, db uintptr, aOp uintptr, nOp int32) { /* sql
// Link the SubProgram object passed as the second argument into the linked
// list at Vdbe.pSubProgram. This list is used to delete all sub-program
// objects when the VM is no longer required.
-func Xsqlite3VdbeLinkSubProgram(tls *libc.TLS, pVdbe uintptr, p uintptr) { /* sqlite3.c:80097:21: */
+func Xsqlite3VdbeLinkSubProgram(tls *libc.TLS, pVdbe uintptr, p uintptr) { /* sqlite3.c:80357:21: */
(*SubProgram)(unsafe.Pointer(p)).FpNext = (*Vdbe)(unsafe.Pointer(pVdbe)).FpProgram
(*Vdbe)(unsafe.Pointer(pVdbe)).FpProgram = p
}
// Return true if the given Vdbe has any SubPrograms.
-func Xsqlite3VdbeHasSubProgram(tls *libc.TLS, pVdbe uintptr) int32 { /* sqlite3.c:80105:20: */
- return (libc.Bool32((*Vdbe)(unsafe.Pointer(pVdbe)).FpProgram != uintptr(0)))
+func Xsqlite3VdbeHasSubProgram(tls *libc.TLS, pVdbe uintptr) int32 { /* sqlite3.c:80365:20: */
+ return libc.Bool32((*Vdbe)(unsafe.Pointer(pVdbe)).FpProgram != uintptr(0))
}
// Change the opcode at addr into OP_Noop
-func Xsqlite3VdbeChangeToNoop(tls *libc.TLS, p uintptr, addr int32) int32 { /* sqlite3.c:80112:20: */
+func Xsqlite3VdbeChangeToNoop(tls *libc.TLS, p uintptr, addr int32) int32 { /* sqlite3.c:80372:20: */
var pOp uintptr
if (*Sqlite3)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).Fdb)).FmallocFailed != 0 {
return 0
}
- pOp = ((*Vdbe)(unsafe.Pointer(p)).FaOp + uintptr(addr)*20)
- freeP4(tls, (*Vdbe)(unsafe.Pointer(p)).Fdb, int32((*VdbeOp)(unsafe.Pointer(pOp)).Fp4type), *(*uintptr)(unsafe.Pointer(pOp + 16 /* &.p4 */)))
+ pOp = (*Vdbe)(unsafe.Pointer(p)).FaOp + uintptr(addr)*20
+ freeP4(tls, (*Vdbe)(unsafe.Pointer(p)).Fdb, int32((*VdbeOp)(unsafe.Pointer(pOp)).Fp4type), *(*uintptr)(unsafe.Pointer(pOp + 16)))
(*VdbeOp)(unsafe.Pointer(pOp)).Fp4type = int8(P4_NOTUSED)
- *(*uintptr)(unsafe.Pointer(pOp + 16 /* &.p4 */)) = uintptr(0)
+ *(*uintptr)(unsafe.Pointer(pOp + 16)) = uintptr(0)
(*VdbeOp)(unsafe.Pointer(pOp)).Fopcode = U8(OP_Noop)
return 1
}
// If the last opcode is "op" and it is not a jump destination,
// then remove it. Return true if and only if an opcode was removed.
-func Xsqlite3VdbeDeletePriorOpcode(tls *libc.TLS, p uintptr, op U8) int32 { /* sqlite3.c:80128:20: */
- if ((*Vdbe)(unsafe.Pointer(p)).FnOp > 0) && (int32((*Op)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FaOp+uintptr(((*Vdbe)(unsafe.Pointer(p)).FnOp-1))*20)).Fopcode) == int32(op)) {
- return Xsqlite3VdbeChangeToNoop(tls, p, ((*Vdbe)(unsafe.Pointer(p)).FnOp - 1))
+func Xsqlite3VdbeDeletePriorOpcode(tls *libc.TLS, p uintptr, op U8) int32 { /* sqlite3.c:80388:20: */
+ if (*Vdbe)(unsafe.Pointer(p)).FnOp > 0 && int32((*Op)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FaOp+uintptr((*Vdbe)(unsafe.Pointer(p)).FnOp-1)*20)).Fopcode) == int32(op) {
+ return Xsqlite3VdbeChangeToNoop(tls, p, (*Vdbe)(unsafe.Pointer(p)).FnOp-1)
} else {
return 0
}
@@ -57413,24 +58129,24 @@ func Xsqlite3VdbeDeletePriorOpcode(tls *libc.TLS, p uintptr, op U8) int32 { /* s
// the Vdbe. In these cases we can just copy the pointer.
//
// If addr<0 then change P4 on the most recently inserted instruction.
-func vdbeChangeP4Full(tls *libc.TLS, p uintptr, pOp uintptr, zP4 uintptr, n int32) { /* sqlite3.c:80188:29: */
+func vdbeChangeP4Full(tls *libc.TLS, p uintptr, pOp uintptr, zP4 uintptr, n int32) { /* sqlite3.c:80448:29: */
if (*Op)(unsafe.Pointer(pOp)).Fp4type != 0 {
- freeP4(tls, (*Vdbe)(unsafe.Pointer(p)).Fdb, int32((*Op)(unsafe.Pointer(pOp)).Fp4type), *(*uintptr)(unsafe.Pointer(pOp + 16 /* &.p4 */)))
+ freeP4(tls, (*Vdbe)(unsafe.Pointer(p)).Fdb, int32((*Op)(unsafe.Pointer(pOp)).Fp4type), *(*uintptr)(unsafe.Pointer(pOp + 16)))
(*Op)(unsafe.Pointer(pOp)).Fp4type = int8(0)
- *(*uintptr)(unsafe.Pointer(pOp + 16 /* &.p4 */)) = uintptr(0)
+ *(*uintptr)(unsafe.Pointer(pOp + 16)) = uintptr(0)
}
if n < 0 {
- Xsqlite3VdbeChangeP4(tls, p, ((int32(pOp) - int32((*Vdbe)(unsafe.Pointer(p)).FaOp)) / 20), zP4, n)
+ Xsqlite3VdbeChangeP4(tls, p, (int32(pOp)-int32((*Vdbe)(unsafe.Pointer(p)).FaOp))/20, zP4, n)
} else {
if n == 0 {
n = Xsqlite3Strlen30(tls, zP4)
}
- *(*uintptr)(unsafe.Pointer(pOp + 16 /* &.p4 */)) = Xsqlite3DbStrNDup(tls, (*Vdbe)(unsafe.Pointer(p)).Fdb, zP4, uint64(n))
+ *(*uintptr)(unsafe.Pointer(pOp + 16)) = Xsqlite3DbStrNDup(tls, (*Vdbe)(unsafe.Pointer(p)).Fdb, zP4, uint64(n))
(*Op)(unsafe.Pointer(pOp)).Fp4type = int8(-7)
}
}
-func Xsqlite3VdbeChangeP4(tls *libc.TLS, p uintptr, addr int32, zP4 uintptr, n int32) { /* sqlite3.c:80207:21: */
+func Xsqlite3VdbeChangeP4(tls *libc.TLS, p uintptr, addr int32, zP4 uintptr, n int32) { /* sqlite3.c:80467:21: */
bp := tls.Alloc(4)
defer tls.Free(4)
*(*uintptr)(unsafe.Pointer(bp)) = zP4
@@ -57441,30 +58157,30 @@ func Xsqlite3VdbeChangeP4(tls *libc.TLS, p uintptr, addr int32, zP4 uintptr, n i
db = (*Vdbe)(unsafe.Pointer(p)).Fdb
if (*Sqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 {
- if n != (-12) {
+ if n != -12 {
freeP4(tls, db, n, *(*uintptr)(unsafe.Pointer(bp /* &zP4 */)))
}
return
}
if addr < 0 {
- addr = ((*Vdbe)(unsafe.Pointer(p)).FnOp - 1)
+ addr = (*Vdbe)(unsafe.Pointer(p)).FnOp - 1
}
- pOp = ((*Vdbe)(unsafe.Pointer(p)).FaOp + uintptr(addr)*20)
- if (n >= 0) || ((*Op)(unsafe.Pointer(pOp)).Fp4type != 0) {
+ pOp = (*Vdbe)(unsafe.Pointer(p)).FaOp + uintptr(addr)*20
+ if n >= 0 || (*Op)(unsafe.Pointer(pOp)).Fp4type != 0 {
vdbeChangeP4Full(tls, p, pOp, *(*uintptr)(unsafe.Pointer(bp /* zP4 */)), n)
return
}
- if n == (-3) {
+ if n == -3 {
// Note: this cast is safe, because the origin data point was an int
// that was cast to a (const char *).
- *(*int32)(unsafe.Pointer(pOp + 16 /* &.p4 */)) = int32(*(*uintptr)(unsafe.Pointer(bp /* zP4 */)))
+ *(*int32)(unsafe.Pointer(pOp + 16)) = int32(*(*uintptr)(unsafe.Pointer(bp)))
(*Op)(unsafe.Pointer(pOp)).Fp4type = int8(-3)
- } else if *(*uintptr)(unsafe.Pointer(bp /* zP4 */)) != uintptr(0) {
+ } else if *(*uintptr)(unsafe.Pointer(bp)) != uintptr(0) {
- *(*uintptr)(unsafe.Pointer(pOp + 16 /* &.p4 */)) = *(*uintptr)(unsafe.Pointer(bp /* zP4 */))
+ *(*uintptr)(unsafe.Pointer(pOp + 16)) = *(*uintptr)(unsafe.Pointer(bp /* zP4 */))
(*Op)(unsafe.Pointer(pOp)).Fp4type = int8(n)
- if n == (-12) {
+ if n == -12 {
Xsqlite3VtabLock(tls, *(*uintptr)(unsafe.Pointer(bp /* zP4 */)))
}
}
@@ -57477,23 +58193,23 @@ func Xsqlite3VdbeChangeP4(tls *libc.TLS, p uintptr, addr int32, zP4 uintptr, n i
// The P4 operand must not have been previously defined. And the new
// P4 must not be P4_INT32. Use sqlite3VdbeChangeP4() in either of
// those cases.
-func Xsqlite3VdbeAppendP4(tls *libc.TLS, p uintptr, pP4 uintptr, n int32) { /* sqlite3.c:80250:21: */
+func Xsqlite3VdbeAppendP4(tls *libc.TLS, p uintptr, pP4 uintptr, n int32) { /* sqlite3.c:80510:21: */
var pOp uintptr
if (*Sqlite3)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).Fdb)).FmallocFailed != 0 {
freeP4(tls, (*Vdbe)(unsafe.Pointer(p)).Fdb, n, pP4)
} else {
- pOp = ((*Vdbe)(unsafe.Pointer(p)).FaOp + uintptr(((*Vdbe)(unsafe.Pointer(p)).FnOp-1))*20)
+ pOp = (*Vdbe)(unsafe.Pointer(p)).FaOp + uintptr((*Vdbe)(unsafe.Pointer(p)).FnOp-1)*20
(*VdbeOp)(unsafe.Pointer(pOp)).Fp4type = int8(n)
- *(*uintptr)(unsafe.Pointer(pOp + 16 /* &.p4 */)) = pP4
+ *(*uintptr)(unsafe.Pointer(pOp + 16)) = pP4
}
}
// Set the P4 on the most recently added opcode to the KeyInfo for the
// index given.
-func Xsqlite3VdbeSetP4KeyInfo(tls *libc.TLS, pParse uintptr, pIdx uintptr) { /* sqlite3.c:80270:21: */
+func Xsqlite3VdbeSetP4KeyInfo(tls *libc.TLS, pParse uintptr, pIdx uintptr) { /* sqlite3.c:80530:21: */
var v uintptr = (*Parse)(unsafe.Pointer(pParse)).FpVdbe
var pKeyInfo uintptr
@@ -57514,25 +58230,25 @@ func Xsqlite3VdbeSetP4KeyInfo(tls *libc.TLS, pParse uintptr, pIdx uintptr) { /*
// this routine is a valid pointer. But because the dummy.opcode is 0,
// dummy will never be written to. This is verified by code inspection and
// by running with Valgrind.
-func Xsqlite3VdbeGetOp(tls *libc.TLS, p uintptr, addr int32) uintptr { /* sqlite3.c:80337:23: */ // Ignore the MSVC warning about no initializer
+func Xsqlite3VdbeGetOp(tls *libc.TLS, p uintptr, addr int32) uintptr { /* sqlite3.c:80597:23: */ // Ignore the MSVC warning about no initializer
if addr < 0 {
- addr = ((*Vdbe)(unsafe.Pointer(p)).FnOp - 1)
+ addr = (*Vdbe)(unsafe.Pointer(p)).FnOp - 1
}
if (*Sqlite3)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).Fdb)).FmallocFailed != 0 {
return uintptr(unsafe.Pointer(&dummy))
} else {
- return ((*Vdbe)(unsafe.Pointer(p)).FaOp + uintptr(addr)*20)
+ return (*Vdbe)(unsafe.Pointer(p)).FaOp + uintptr(addr)*20
}
return uintptr(0)
}
-var dummy VdbeOp /* sqlite3.c:80340:17: */
+var dummy VdbeOp /* sqlite3.c:80600:17: */
// Compute a string that describes the P4 parameter for an opcode.
// Use zTemp for any required temporary buffer space.
-func Xsqlite3VdbeDisplayP4(tls *libc.TLS, db uintptr, pOp uintptr) uintptr { /* sqlite3.c:80540:21: */
+func Xsqlite3VdbeDisplayP4(tls *libc.TLS, db uintptr, pOp uintptr) uintptr { /* sqlite3.c:80801:21: */
bp := tls.Alloc(168)
defer tls.Free(168)
@@ -57544,126 +58260,126 @@ func Xsqlite3VdbeDisplayP4(tls *libc.TLS, db uintptr, pOp uintptr) uintptr { /*
case -9:
{
var j int32
- var pKeyInfo uintptr = *(*uintptr)(unsafe.Pointer(pOp + 16 /* &.p4 */))
+ var pKeyInfo uintptr = *(*uintptr)(unsafe.Pointer(pOp + 16))
- Xsqlite3_str_appendf(tls, bp+144 /* &x */, ts+4048 /* "k(%d" */, libc.VaList(bp, int32((*KeyInfo)(unsafe.Pointer(pKeyInfo)).FnKeyField)))
+ Xsqlite3_str_appendf(tls, bp+144 /* &x */, ts+4859 /* "k(%d" */, libc.VaList(bp, int32((*KeyInfo)(unsafe.Pointer(pKeyInfo)).FnKeyField)))
for j = 0; j < int32((*KeyInfo)(unsafe.Pointer(pKeyInfo)).FnKeyField); j++ {
- var pColl uintptr = *(*uintptr)(unsafe.Pointer((pKeyInfo + 20 /* &.aColl */) + uintptr(j)*4))
+ var pColl uintptr = *(*uintptr)(unsafe.Pointer(pKeyInfo + 20 + uintptr(j)*4))
var zColl uintptr
if pColl != 0 {
zColl = (*CollSeq)(unsafe.Pointer(pColl)).FzName
} else {
- zColl = ts + 755 /* "" */
+ zColl = ts + 1543 /* "" */
}
- if libc.Xstrcmp(tls, zColl, ts+318 /* "BINARY" */) == 0 {
- zColl = ts + 4053 /* "B" */
+ if libc.Xstrcmp(tls, zColl, ts+1070) == 0 {
+ zColl = ts + 4864 /* "B" */
}
- Xsqlite3_str_appendf(tls, bp+144 /* &x */, ts+4055, /* ",%s%s%s" */
+ Xsqlite3_str_appendf(tls, bp+144 /* &x */, ts+4866, /* ",%s%s%s" */
libc.VaList(bp+8, func() uintptr {
- if (int32(*(*U8)(unsafe.Pointer((*KeyInfo)(unsafe.Pointer(pKeyInfo)).FaSortFlags + uintptr(j)))) & KEYINFO_ORDER_DESC) != 0 {
- return ts + 4041 /* "-" */
+ if int32(*(*U8)(unsafe.Pointer((*KeyInfo)(unsafe.Pointer(pKeyInfo)).FaSortFlags + uintptr(j))))&KEYINFO_ORDER_DESC != 0 {
+ return ts + 4852 /* "-" */
}
- return ts + 755 /* "" */
+ return ts + 1543 /* "" */
}(),
func() uintptr {
- if (int32(*(*U8)(unsafe.Pointer((*KeyInfo)(unsafe.Pointer(pKeyInfo)).FaSortFlags + uintptr(j)))) & KEYINFO_ORDER_BIGNULL) != 0 {
- return ts + 4063 /* "N." */
+ if int32(*(*U8)(unsafe.Pointer((*KeyInfo)(unsafe.Pointer(pKeyInfo)).FaSortFlags + uintptr(j))))&KEYINFO_ORDER_BIGNULL != 0 {
+ return ts + 4874 /* "N." */
}
- return ts + 755 /* "" */
+ return ts + 1543 /* "" */
}(),
zColl))
}
- Xsqlite3_str_append(tls, bp+144 /* &x */, ts+4066 /* ")" */, 1)
+ Xsqlite3_str_append(tls, bp+144 /* &x */, ts+4877 /* ")" */, 1)
break
}
case -2:
{
- var pColl uintptr = *(*uintptr)(unsafe.Pointer(pOp + 16 /* &.p4 */))
+ var pColl uintptr = *(*uintptr)(unsafe.Pointer(pOp + 16))
- Xsqlite3_str_appendf(tls, bp+144 /* &x */, ts+4068 /* "%.18s-%s" */, libc.VaList(bp+32, (*CollSeq)(unsafe.Pointer(pColl)).FzName,
+ Xsqlite3_str_appendf(tls, bp+144 /* &x */, ts+4879 /* "%.18s-%s" */, libc.VaList(bp+32, (*CollSeq)(unsafe.Pointer(pColl)).FzName,
encnames[(*CollSeq)(unsafe.Pointer(pColl)).Fenc]))
break
}
case -8:
{
- var pDef uintptr = *(*uintptr)(unsafe.Pointer(pOp + 16 /* &.p4 */))
- Xsqlite3_str_appendf(tls, bp+144 /* &x */, ts+4077 /* "%s(%d)" */, libc.VaList(bp+48, (*FuncDef)(unsafe.Pointer(pDef)).FzName, int32((*FuncDef)(unsafe.Pointer(pDef)).FnArg)))
+ var pDef uintptr = *(*uintptr)(unsafe.Pointer(pOp + 16))
+ Xsqlite3_str_appendf(tls, bp+144 /* &x */, ts+4888 /* "%s(%d)" */, libc.VaList(bp+48, (*FuncDef)(unsafe.Pointer(pDef)).FzName, int32((*FuncDef)(unsafe.Pointer(pDef)).FnArg)))
break
}
case -16:
{
- var pDef uintptr = (*Sqlite3_context)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pOp + 16 /* &.p4 */)))).FpFunc
- Xsqlite3_str_appendf(tls, bp+144 /* &x */, ts+4077 /* "%s(%d)" */, libc.VaList(bp+64, (*FuncDef)(unsafe.Pointer(pDef)).FzName, int32((*FuncDef)(unsafe.Pointer(pDef)).FnArg)))
+ var pDef uintptr = (*Sqlite3_context)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pOp + 16)))).FpFunc
+ Xsqlite3_str_appendf(tls, bp+144 /* &x */, ts+4888 /* "%s(%d)" */, libc.VaList(bp+64, (*FuncDef)(unsafe.Pointer(pDef)).FzName, int32((*FuncDef)(unsafe.Pointer(pDef)).FnArg)))
break
}
case -14:
{
- Xsqlite3_str_appendf(tls, bp+144 /* &x */, ts+4084 /* "%lld" */, libc.VaList(bp+80, *(*I64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pOp + 16 /* &.p4 */))))))
+ Xsqlite3_str_appendf(tls, bp+144 /* &x */, ts+1327 /* "%lld" */, libc.VaList(bp+80, *(*I64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pOp + 16))))))
break
}
case -3:
{
- Xsqlite3_str_appendf(tls, bp+144 /* &x */, ts+4089 /* "%d" */, libc.VaList(bp+88, *(*int32)(unsafe.Pointer(pOp + 16 /* &.p4 */))))
+ Xsqlite3_str_appendf(tls, bp+144 /* &x */, ts+4895 /* "%d" */, libc.VaList(bp+88, *(*int32)(unsafe.Pointer(pOp + 16))))
break
}
case -13:
{
- Xsqlite3_str_appendf(tls, bp+144 /* &x */, ts+538 /* "%.16g" */, libc.VaList(bp+96, *(*float64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pOp + 16 /* &.p4 */))))))
+ Xsqlite3_str_appendf(tls, bp+144 /* &x */, ts+1321 /* "%.16g" */, libc.VaList(bp+96, *(*float64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pOp + 16))))))
break
}
case -11:
{
- var pMem uintptr = *(*uintptr)(unsafe.Pointer(pOp + 16 /* &.p4 */))
- if (int32((*Mem)(unsafe.Pointer(pMem)).Fflags) & MEM_Str) != 0 {
+ var pMem uintptr = *(*uintptr)(unsafe.Pointer(pOp + 16))
+ if int32((*Mem)(unsafe.Pointer(pMem)).Fflags)&MEM_Str != 0 {
zP4 = (*Mem)(unsafe.Pointer(pMem)).Fz
- } else if (int32((*Mem)(unsafe.Pointer(pMem)).Fflags) & (MEM_Int | MEM_IntReal)) != 0 {
- Xsqlite3_str_appendf(tls, bp+144 /* &x */, ts+4084 /* "%lld" */, libc.VaList(bp+104, *(*I64)(unsafe.Pointer(pMem /* &.u */))))
- } else if (int32((*Mem)(unsafe.Pointer(pMem)).Fflags) & MEM_Real) != 0 {
- Xsqlite3_str_appendf(tls, bp+144 /* &x */, ts+538 /* "%.16g" */, libc.VaList(bp+112, *(*float64)(unsafe.Pointer(pMem /* &.u */))))
- } else if (int32((*Mem)(unsafe.Pointer(pMem)).Fflags) & MEM_Null) != 0 {
- zP4 = ts + 756 /* "NULL" */
+ } else if int32((*Mem)(unsafe.Pointer(pMem)).Fflags)&(MEM_Int|MEM_IntReal) != 0 {
+ Xsqlite3_str_appendf(tls, bp+144 /* &x */, ts+1327 /* "%lld" */, libc.VaList(bp+104, *(*I64)(unsafe.Pointer(pMem))))
+ } else if int32((*Mem)(unsafe.Pointer(pMem)).Fflags)&MEM_Real != 0 {
+ Xsqlite3_str_appendf(tls, bp+144 /* &x */, ts+1321 /* "%.16g" */, libc.VaList(bp+112, *(*float64)(unsafe.Pointer(pMem))))
+ } else if int32((*Mem)(unsafe.Pointer(pMem)).Fflags)&MEM_Null != 0 {
+ zP4 = ts + 1544 /* "NULL" */
} else {
- zP4 = ts + 4092 /* "(blob)" */
+ zP4 = ts + 4898 /* "(blob)" */
}
break
}
case -12:
{
- var pVtab uintptr = (*VTable)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pOp + 16 /* &.p4 */)))).FpVtab
- Xsqlite3_str_appendf(tls, bp+144 /* &x */, ts+4099 /* "vtab:%p" */, libc.VaList(bp+120, pVtab))
+ var pVtab uintptr = (*VTable)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pOp + 16)))).FpVtab
+ Xsqlite3_str_appendf(tls, bp+144 /* &x */, ts+4905 /* "vtab:%p" */, libc.VaList(bp+120, pVtab))
break
}
case -15:
{
var i U32
- var ai uintptr = *(*uintptr)(unsafe.Pointer(pOp + 16 /* &.p4 */))
+ var ai uintptr = *(*uintptr)(unsafe.Pointer(pOp + 16))
var n U32 = *(*U32)(unsafe.Pointer(ai)) // The first element of an INTARRAY is always the
// count of the number of elements to follow
for i = U32(1); i <= n; i++ {
- Xsqlite3_str_appendf(tls, bp+144 /* &x */, ts+4107 /* "%c%u" */, libc.VaList(bp+128, func() int32 {
+ Xsqlite3_str_appendf(tls, bp+144 /* &x */, ts+4913 /* "%c%u" */, libc.VaList(bp+128, func() int32 {
if i == U32(1) {
return '['
}
return ','
}(), *(*U32)(unsafe.Pointer(ai + uintptr(i)*4))))
}
- Xsqlite3_str_append(tls, bp+144 /* &x */, ts+4112 /* "]" */, 1)
+ Xsqlite3_str_append(tls, bp+144 /* &x */, ts+4918 /* "]" */, 1)
break
}
case -4:
{
- zP4 = ts + 4114 /* "program" */
+ zP4 = ts + 4920 /* "program" */
break
}
@@ -57676,26 +58392,26 @@ func Xsqlite3VdbeDisplayP4(tls *libc.TLS, db uintptr, pOp uintptr) uintptr { /*
}
case -6:
{
- zP4 = (*Table)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pOp + 16 /* &.p4 */)))).FzName
+ zP4 = (*Table)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pOp + 16)))).FzName
break
}
default:
{
- zP4 = *(*uintptr)(unsafe.Pointer(pOp + 16 /* &.p4 */))
+ zP4 = *(*uintptr)(unsafe.Pointer(pOp + 16))
}
}
if zP4 != 0 {
Xsqlite3_str_appendall(tls, bp+144 /* &x */, zP4)
}
- if (int32((*StrAccum)(unsafe.Pointer(bp+144 /* &x */)).FaccError) & SQLITE_NOMEM) != 0 {
+ if int32((*StrAccum)(unsafe.Pointer(bp+144)).FaccError)&SQLITE_NOMEM != 0 {
Xsqlite3OomFault(tls, db)
}
return Xsqlite3StrAccumFinish(tls, bp+144 /* &x */)
}
-var encnames = [4]uintptr{ts + 4122 /* "?" */, ts + 4124 /* "8" */, ts + 4126 /* "16LE" */, ts + 4131 /* "16BE" */} /* sqlite3.c:80570:25 */
+var encnames = [4]uintptr{ts + 4928 /* "?" */, ts + 4930 /* "8" */, ts + 4932 /* "16LE" */, ts + 4937 /* "16BE" */} /* sqlite3.c:80831:25 */
// Declare to the Vdbe that the BTree object at db->aDb[i] is used.
//
@@ -57703,11 +58419,11 @@ var encnames = [4]uintptr{ts + 4122 /* "?" */, ts + 4124 /* "8" */, ts + 4126 /*
// attached databases that will be use. A mask of these databases
// is maintained in p->btreeMask. The p->lockMask value is the subset of
// p->btreeMask of databases that will require a lock.
-func Xsqlite3VdbeUsesBtree(tls *libc.TLS, p uintptr, i int32) { /* sqlite3.c:80665:21: */
+func Xsqlite3VdbeUsesBtree(tls *libc.TLS, p uintptr, i int32) { /* sqlite3.c:80926:21: */
- *(*YDbMask)(unsafe.Pointer(p + 156 /* &.btreeMask */)) |= (YDbMask((YDbMask(1))) << (i))
- if (i != 1) && (Xsqlite3BtreeSharable(tls, (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).Fdb)).FaDb+uintptr(i)*16)).FpBt) != 0) {
- *(*YDbMask)(unsafe.Pointer(p + 160 /* &.lockMask */)) |= (YDbMask((YDbMask(1))) << (i))
+ *(*YDbMask)(unsafe.Pointer(p + 164)) |= YDbMask(YDbMask(1)) << i
+ if i != 1 && Xsqlite3BtreeSharable(tls, (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).Fdb)).FaDb+uintptr(i)*16)).FpBt) != 0 {
+ *(*YDbMask)(unsafe.Pointer(p + 168)) |= YDbMask(YDbMask(1)) << i
}
}
@@ -57730,26 +58446,26 @@ func Xsqlite3VdbeUsesBtree(tls *libc.TLS, p uintptr, i int32) { /* sqlite3.c:806
// corresponding to btrees that use shared cache. Then the runtime of
// this routine is N*N. But as N is rarely more than 1, this should not
// be a problem.
-func Xsqlite3VdbeEnter(tls *libc.TLS, p uintptr) { /* sqlite3.c:80696:21: */
+func Xsqlite3VdbeEnter(tls *libc.TLS, p uintptr) { /* sqlite3.c:80957:21: */
var i int32
var db uintptr
var aDb uintptr
var nDb int32
- if ((*Vdbe)(unsafe.Pointer(p)).FlockMask) == YDbMask(0) {
+ if (*Vdbe)(unsafe.Pointer(p)).FlockMask == YDbMask(0) {
return
} // The common case
db = (*Vdbe)(unsafe.Pointer(p)).Fdb
aDb = (*Sqlite3)(unsafe.Pointer(db)).FaDb
nDb = (*Sqlite3)(unsafe.Pointer(db)).FnDb
for i = 0; i < nDb; i++ {
- if ((i != 1) && ((((*Vdbe)(unsafe.Pointer(p)).FlockMask) & (YDbMask((YDbMask(1))) << (i))) != YDbMask(0))) && ((*Db)(unsafe.Pointer(aDb+uintptr(i)*16)).FpBt != uintptr(0)) {
+ if i != 1 && (*Vdbe)(unsafe.Pointer(p)).FlockMask&(YDbMask(YDbMask(1))<<i) != YDbMask(0) && (*Db)(unsafe.Pointer(aDb+uintptr(i)*16)).FpBt != uintptr(0) {
Xsqlite3BtreeEnter(tls, (*Db)(unsafe.Pointer(aDb+uintptr(i)*16)).FpBt)
}
}
}
// Unlock all of the btrees previously locked by a call to sqlite3VdbeEnter().
-func vdbeLeave(tls *libc.TLS, p uintptr) { /* sqlite3.c:80717:29: */
+func vdbeLeave(tls *libc.TLS, p uintptr) { /* sqlite3.c:80978:29: */
var i int32
var db uintptr
var aDb uintptr
@@ -57758,22 +58474,22 @@ func vdbeLeave(tls *libc.TLS, p uintptr) { /* sqlite3.c:80717:29: */
aDb = (*Sqlite3)(unsafe.Pointer(db)).FaDb
nDb = (*Sqlite3)(unsafe.Pointer(db)).FnDb
for i = 0; i < nDb; i++ {
- if ((i != 1) && ((((*Vdbe)(unsafe.Pointer(p)).FlockMask) & (YDbMask((YDbMask(1))) << (i))) != YDbMask(0))) && ((*Db)(unsafe.Pointer(aDb+uintptr(i)*16)).FpBt != uintptr(0)) {
+ if i != 1 && (*Vdbe)(unsafe.Pointer(p)).FlockMask&(YDbMask(YDbMask(1))<<i) != YDbMask(0) && (*Db)(unsafe.Pointer(aDb+uintptr(i)*16)).FpBt != uintptr(0) {
Xsqlite3BtreeLeave(tls, (*Db)(unsafe.Pointer(aDb+uintptr(i)*16)).FpBt)
}
}
}
-func Xsqlite3VdbeLeave(tls *libc.TLS, p uintptr) { /* sqlite3.c:80731:21: */
- if ((*Vdbe)(unsafe.Pointer(p)).FlockMask) == YDbMask(0) {
+func Xsqlite3VdbeLeave(tls *libc.TLS, p uintptr) { /* sqlite3.c:80992:21: */
+ if (*Vdbe)(unsafe.Pointer(p)).FlockMask == YDbMask(0) {
return
} // The common case
vdbeLeave(tls, p)
}
// Initialize an array of N Mem element.
-func initMemArray(tls *libc.TLS, p uintptr, N int32, db uintptr, flags U16) { /* sqlite3.c:80773:13: */
- for (libc.PostDecInt32(&N, 1)) > 0 {
+func initMemArray(tls *libc.TLS, p uintptr, N int32, db uintptr, flags U16) { /* sqlite3.c:81034:13: */
+ for libc.PostDecInt32(&N, 1) > 0 {
(*Mem)(unsafe.Pointer(p)).Fdb = db
(*Mem)(unsafe.Pointer(p)).Fflags = flags
(*Mem)(unsafe.Pointer(p)).FszMalloc = 0
@@ -57782,19 +58498,19 @@ func initMemArray(tls *libc.TLS, p uintptr, N int32, db uintptr, flags U16) { /*
}
// Release an array of N Mem elements
-func releaseMemArray(tls *libc.TLS, p uintptr, N int32) { /* sqlite3.c:80788:13: */
- if (p != 0) && (N != 0) {
- var pEnd uintptr = (p + uintptr(N)*40)
+func releaseMemArray(tls *libc.TLS, p uintptr, N int32) { /* sqlite3.c:81049:13: */
+ if p != 0 && N != 0 {
+ var pEnd uintptr = p + uintptr(N)*40
var db uintptr = (*Mem)(unsafe.Pointer(p)).Fdb
if (*Sqlite3)(unsafe.Pointer(db)).FpnBytesFreed != 0 {
- for ok := true; ok; ok = ((libc.PreIncUintptr(&p, 40)) < pEnd) {
+ for ok := true; ok; ok = libc.PreIncUintptr(&p, 40) < pEnd {
if (*Mem)(unsafe.Pointer(p)).FszMalloc != 0 {
Xsqlite3DbFree(tls, db, (*Mem)(unsafe.Pointer(p)).FzMalloc)
}
}
return
}
- for ok1 := true; ok1; ok1 = ((libc.PreIncUintptr(&p, 40)) < pEnd) {
+ for ok1 := true; ok1; ok1 = libc.PreIncUintptr(&p, 40) < pEnd {
// This block is really an inlined version of sqlite3VdbeMemRelease()
// that takes advantage of the fact that the memory cell value is
@@ -57808,7 +58524,8 @@ func releaseMemArray(tls *libc.TLS, p uintptr, N int32) { /* sqlite3.c:80788:13:
// with no indexes using a single prepared INSERT statement, bind()
// and reset(). Inserts are grouped into a transaction.
- if (int32((*Mem)(unsafe.Pointer(p)).Fflags) & (MEM_Agg | MEM_Dyn)) != 0 {
+ if int32((*Mem)(unsafe.Pointer(p)).Fflags)&(MEM_Agg|MEM_Dyn) != 0 {
+
Xsqlite3VdbeMemRelease(tls, p)
} else if (*Mem)(unsafe.Pointer(p)).FszMalloc != 0 {
Xsqlite3DbFreeNN(tls, db, (*Mem)(unsafe.Pointer(p)).FzMalloc)
@@ -57825,7 +58542,7 @@ func releaseMemArray(tls *libc.TLS, p uintptr, N int32) { /* sqlite3.c:80788:13:
//
// This routine does not delete the Frame right away. It merely adds the
// frame to a list of frames to be deleted when the Vdbe halts.
-func Xsqlite3VdbeFrameMemDel(tls *libc.TLS, pArg uintptr) { /* sqlite3.c:80850:21: */
+func Xsqlite3VdbeFrameMemDel(tls *libc.TLS, pArg uintptr) { /* sqlite3.c:81111:21: */
var pFrame uintptr = pArg
(*VdbeFrame)(unsafe.Pointer(pFrame)).FpParent = (*Vdbe)(unsafe.Pointer((*VdbeFrame)(unsafe.Pointer(pFrame)).Fv)).FpDelFrame
@@ -57837,7 +58554,7 @@ func Xsqlite3VdbeFrameMemDel(tls *libc.TLS, pArg uintptr) { /* sqlite3.c:80850:2
//
// Return SQLITE_ROW on success. Return SQLITE_DONE if there are no
// more opcodes to be displayed.
-func Xsqlite3VdbeNextOpcode(tls *libc.TLS, p uintptr, pSub uintptr, eMode int32, piPc uintptr, piAddr uintptr, paOp uintptr) int32 { /* sqlite3.c:80865:20: */
+func Xsqlite3VdbeNextOpcode(tls *libc.TLS, p uintptr, pSub uintptr, eMode int32, piPc uintptr, piAddr uintptr, paOp uintptr) int32 { /* sqlite3.c:81126:20: */
var nRow int32 // Stop when row count reaches this
var nSub int32 = 0 // Number of sub-vdbes seen so far
var apSub uintptr = uintptr(0) // Array of sub-vdbes
@@ -57854,14 +58571,14 @@ func Xsqlite3VdbeNextOpcode(tls *libc.TLS, p uintptr, pSub uintptr, eMode int32,
// encountered, but p->pc will eventually catch up to nRow.
nRow = (*Vdbe)(unsafe.Pointer(p)).FnOp
if pSub != uintptr(0) {
- if (int32((*Mem)(unsafe.Pointer(pSub)).Fflags) & MEM_Blob) != 0 {
+ if int32((*Mem)(unsafe.Pointer(pSub)).Fflags)&MEM_Blob != 0 {
// pSub is initiallly NULL. It is initialized to a BLOB by
// the P4_SUBPROGRAM processing logic below
- nSub = (int32(uint32((*Mem)(unsafe.Pointer(pSub)).Fn) / uint32(unsafe.Sizeof(uintptr(0)))))
+ nSub = int32(uint32((*Mem)(unsafe.Pointer(pSub)).Fn) / uint32(unsafe.Sizeof(uintptr(0))))
apSub = (*Mem)(unsafe.Pointer(pSub)).Fz
}
for i = 0; i < nSub; i++ {
- nRow = nRow + ((*SubProgram)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(apSub + uintptr(i)*4)))).FnOp)
+ nRow = nRow + (*SubProgram)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(apSub + uintptr(i)*4)))).FnOp
}
}
iPc = *(*int32)(unsafe.Pointer(piPc))
@@ -57880,10 +58597,10 @@ func Xsqlite3VdbeNextOpcode(tls *libc.TLS, p uintptr, pSub uintptr, eMode int32,
// We are currently listing subprograms. Figure out which one and
// pick up the appropriate opcode.
var j int32
- i = i - ((*Vdbe)(unsafe.Pointer(p)).FnOp)
+ i = i - (*Vdbe)(unsafe.Pointer(p)).FnOp
for j = 0; i >= (*SubProgram)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(apSub + uintptr(j)*4)))).FnOp; j++ {
- i = i - ((*SubProgram)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(apSub + uintptr(j)*4)))).FnOp)
+ i = i - (*SubProgram)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(apSub + uintptr(j)*4)))).FnOp
}
aOp = (*SubProgram)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(apSub + uintptr(j)*4)))).FaOp
@@ -57893,25 +58610,25 @@ func Xsqlite3VdbeNextOpcode(tls *libc.TLS, p uintptr, pSub uintptr, eMode int32,
// a P4_SUBPROGRAM argument), expand the size of the array of subprograms
// kept in p->aMem[9].z to hold the new program - assuming this subprogram
// has not already been seen.
- if (pSub != uintptr(0)) && (int32((*Op)(unsafe.Pointer(aOp+uintptr(i)*20)).Fp4type) == (-4)) {
- var nByte int32 = (int32((uint32(nSub + 1)) * uint32(unsafe.Sizeof(uintptr(0)))))
+ if pSub != uintptr(0) && int32((*Op)(unsafe.Pointer(aOp+uintptr(i)*20)).Fp4type) == -4 {
+ var nByte int32 = int32(uint32(nSub+1) * uint32(unsafe.Sizeof(uintptr(0))))
var j int32
for j = 0; j < nSub; j++ {
- if *(*uintptr)(unsafe.Pointer(apSub + uintptr(j)*4)) == *(*uintptr)(unsafe.Pointer(aOp + uintptr(i)*20 + 16 /* &.p4 */)) {
+ if *(*uintptr)(unsafe.Pointer(apSub + uintptr(j)*4)) == *(*uintptr)(unsafe.Pointer(aOp + uintptr(i)*20 + 16)) {
break
}
}
if j == nSub {
- (*Vdbe)(unsafe.Pointer(p)).Frc = Xsqlite3VdbeMemGrow(tls, pSub, nByte, (libc.Bool32(nSub != 0)))
+ (*Vdbe)(unsafe.Pointer(p)).Frc = Xsqlite3VdbeMemGrow(tls, pSub, nByte, libc.Bool32(nSub != 0))
if (*Vdbe)(unsafe.Pointer(p)).Frc != SQLITE_OK {
rc = SQLITE_ERROR
break
}
apSub = (*Mem)(unsafe.Pointer(pSub)).Fz
- *(*uintptr)(unsafe.Pointer(apSub + uintptr(libc.PostIncInt32(&nSub, 1))*4)) = *(*uintptr)(unsafe.Pointer(aOp + uintptr(i)*20 + 16 /* &.p4 */))
- (*Mem)(unsafe.Pointer(pSub)).Fflags = (U16((int32((*Mem)(unsafe.Pointer((pSub))).Fflags) & libc.CplInt32((MEM_TypeMask | MEM_Zero))) | MEM_Blob))
- (*Mem)(unsafe.Pointer(pSub)).Fn = (int32(uint32(nSub) * uint32(unsafe.Sizeof(uintptr(0)))))
- nRow = nRow + ((*SubProgram)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(aOp + uintptr(i)*20 + 16 /* &.p4 */)))).FnOp)
+ *(*uintptr)(unsafe.Pointer(apSub + uintptr(libc.PostIncInt32(&nSub, 1))*4)) = *(*uintptr)(unsafe.Pointer(aOp + uintptr(i)*20 + 16))
+ (*Mem)(unsafe.Pointer(pSub)).Fflags = U16(int32((*Mem)(unsafe.Pointer(pSub)).Fflags)&libc.CplInt32(MEM_TypeMask|MEM_Zero) | MEM_Blob)
+ (*Mem)(unsafe.Pointer(pSub)).Fn = int32(uint32(nSub) * uint32(unsafe.Sizeof(uintptr(0))))
+ nRow = nRow + (*SubProgram)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(aOp + uintptr(i)*20 + 16)))).FnOp
}
}
if eMode == 0 {
@@ -57922,7 +58639,7 @@ func Xsqlite3VdbeNextOpcode(tls *libc.TLS, p uintptr, pSub uintptr, eMode int32,
if int32((*Op)(unsafe.Pointer(aOp+uintptr(i)*20)).Fopcode) == OP_Explain {
break
}
- if (int32((*Op)(unsafe.Pointer(aOp+uintptr(i)*20)).Fopcode) == OP_Init) && (iPc > 1) {
+ if int32((*Op)(unsafe.Pointer(aOp+uintptr(i)*20)).Fopcode) == OP_Init && iPc > 1 {
break
}
@@ -57936,16 +58653,16 @@ func Xsqlite3VdbeNextOpcode(tls *libc.TLS, p uintptr, pSub uintptr, eMode int32,
// Delete a VdbeFrame object and its contents. VdbeFrame objects are
// allocated by the OP_Program opcode in sqlite3VdbeExec().
-func Xsqlite3VdbeFrameDelete(tls *libc.TLS, p uintptr) { /* sqlite3.c:80977:21: */
+func Xsqlite3VdbeFrameDelete(tls *libc.TLS, p uintptr) { /* sqlite3.c:81238:21: */
var i int32
- var aMem uintptr = ((p) + 80)
- var apCsr uintptr = (aMem + uintptr((*VdbeFrame)(unsafe.Pointer(p)).FnChildMem)*40)
+ var aMem uintptr = p + 88
+ var apCsr uintptr = aMem + uintptr((*VdbeFrame)(unsafe.Pointer(p)).FnChildMem)*40
for i = 0; i < (*VdbeFrame)(unsafe.Pointer(p)).FnChildCsr; i++ {
Xsqlite3VdbeFreeCursor(tls, (*VdbeFrame)(unsafe.Pointer(p)).Fv, *(*uintptr)(unsafe.Pointer(apCsr + uintptr(i)*4)))
}
releaseMemArray(tls, aMem, (*VdbeFrame)(unsafe.Pointer(p)).FnChildMem)
- Xsqlite3VdbeDeleteAuxData(tls, (*Vdbe)(unsafe.Pointer((*VdbeFrame)(unsafe.Pointer(p)).Fv)).Fdb, (p + 40 /* &.pAuxData */), -1, 0)
+ Xsqlite3VdbeDeleteAuxData(tls, (*Vdbe)(unsafe.Pointer((*VdbeFrame)(unsafe.Pointer(p)).Fv)).Fdb, p+40, -1, 0)
Xsqlite3DbFree(tls, (*Vdbe)(unsafe.Pointer((*VdbeFrame)(unsafe.Pointer(p)).Fv)).Fdb, p)
}
@@ -57965,7 +58682,7 @@ func Xsqlite3VdbeFrameDelete(tls *libc.TLS, p uintptr) { /* sqlite3.c:80977:21:
//
// When p->explain==1, first the main program is listed, then each of
// the trigger subprograms are listed one by one.
-func Xsqlite3VdbeList(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:81009:20: */
+func Xsqlite3VdbeList(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:81270:20: */
bp := tls.Alloc(8)
defer tls.Free(8)
@@ -57973,9 +58690,9 @@ func Xsqlite3VdbeList(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:81009:20: *
var db uintptr = (*Vdbe)(unsafe.Pointer(p)).Fdb // The database connection
// var i int32 at bp, 4
// Loop counter
- var rc int32 = SQLITE_OK // Return code
- var pMem uintptr = ((*Vdbe)(unsafe.Pointer(p)).FaMem + 1*40) // First Mem of result set
- var bListSubprogs int32 = (libc.Bool32(((int32(*(*uint16)(unsafe.Pointer(p + 152 /* &.explain */)) & 0xc >> 2)) == 1) || (((*Sqlite3)(unsafe.Pointer(db)).Fflags & uint64(SQLITE_TriggerEQP)) != uint64(0))))
+ var rc int32 = SQLITE_OK // Return code
+ var pMem uintptr = (*Vdbe)(unsafe.Pointer(p)).FaMem + 1*40 // First Mem of result set
+ var bListSubprogs int32 = libc.Bool32(int32(*(*uint16)(unsafe.Pointer(p + 160))&0xc>>2) == 1 || (*Sqlite3)(unsafe.Pointer(db)).Fflags&uint64(SQLITE_TriggerEQP) != uint64(0))
// var aOp uintptr at bp+4, 4
// Array of opcodes
var pOp uintptr // Current opcode
@@ -57999,39 +58716,39 @@ func Xsqlite3VdbeList(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:81009:20: *
// to trigger subprograms. The VDBE is guaranteed to have at least 9
// cells.
- pSub = ((*Vdbe)(unsafe.Pointer(p)).FaMem + 9*40)
+ pSub = (*Vdbe)(unsafe.Pointer(p)).FaMem + 9*40
} else {
pSub = uintptr(0)
}
// Figure out which opcode is next to display
- rc = Xsqlite3VdbeNextOpcode(tls, p, pSub, (libc.Bool32((int32(*(*uint16)(unsafe.Pointer(p + 152 /* &.explain */)) & 0xc >> 2)) == 2)), (p + 36 /* &.pc */), bp /* &i */, bp+4 /* &aOp */)
+ rc = Xsqlite3VdbeNextOpcode(tls, p, pSub, libc.Bool32(int32(*(*uint16)(unsafe.Pointer(p + 160))&0xc>>2) == 2), p+36, bp /* &i */, bp+4 /* &aOp */)
if rc == SQLITE_OK {
- pOp = (*(*uintptr)(unsafe.Pointer(bp + 4 /* aOp */)) + uintptr(*(*int32)(unsafe.Pointer(bp /* i */)))*20)
- if libc.AtomicLoadNInt32((db+288 /* &.u1 */ /* &.isInterrupted */), 0) != 0 {
+ pOp = *(*uintptr)(unsafe.Pointer(bp + 4)) + uintptr(*(*int32)(unsafe.Pointer(bp)))*20
+ if libc.AtomicLoadNInt32(db+312, 0) != 0 {
(*Vdbe)(unsafe.Pointer(p)).Frc = SQLITE_INTERRUPT
rc = SQLITE_ERROR
Xsqlite3VdbeError(tls, p, Xsqlite3ErrStr(tls, (*Vdbe)(unsafe.Pointer(p)).Frc), 0)
} else {
var zP4 uintptr = Xsqlite3VdbeDisplayP4(tls, db, pOp)
- if (int32(*(*uint16)(unsafe.Pointer(p + 152 /* &.explain */)) & 0xc >> 2)) == 2 {
+ if int32(*(*uint16)(unsafe.Pointer(p + 160))&0xc>>2) == 2 {
Xsqlite3VdbeMemSetInt64(tls, pMem, int64((*Op)(unsafe.Pointer(pOp)).Fp1))
- Xsqlite3VdbeMemSetInt64(tls, (pMem + uintptr(1)*40), int64((*Op)(unsafe.Pointer(pOp)).Fp2))
- Xsqlite3VdbeMemSetInt64(tls, (pMem + uintptr(2)*40), int64((*Op)(unsafe.Pointer(pOp)).Fp3))
- Xsqlite3VdbeMemSetStr(tls, (pMem + uintptr(3)*40), zP4, int64(-1), uint8(SQLITE_UTF8), *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{Xsqlite3_free})))
+ Xsqlite3VdbeMemSetInt64(tls, pMem+uintptr(1)*40, int64((*Op)(unsafe.Pointer(pOp)).Fp2))
+ Xsqlite3VdbeMemSetInt64(tls, pMem+uintptr(2)*40, int64((*Op)(unsafe.Pointer(pOp)).Fp3))
+ Xsqlite3VdbeMemSetStr(tls, pMem+uintptr(3)*40, zP4, int64(-1), uint8(SQLITE_UTF8), *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{Xsqlite3_free})))
(*Vdbe)(unsafe.Pointer(p)).FnResColumn = U16(4)
} else {
- Xsqlite3VdbeMemSetInt64(tls, (pMem + uintptr(0)*40), int64(*(*int32)(unsafe.Pointer(bp /* i */))))
- Xsqlite3VdbeMemSetStr(tls, (pMem + uintptr(1)*40), Xsqlite3OpcodeName(tls, int32((*Op)(unsafe.Pointer(pOp)).Fopcode)),
+ Xsqlite3VdbeMemSetInt64(tls, pMem+uintptr(0)*40, int64(*(*int32)(unsafe.Pointer(bp /* i */))))
+ Xsqlite3VdbeMemSetStr(tls, pMem+uintptr(1)*40, Xsqlite3OpcodeName(tls, int32((*Op)(unsafe.Pointer(pOp)).Fopcode)),
int64(-1), uint8(SQLITE_UTF8), uintptr(0))
- Xsqlite3VdbeMemSetInt64(tls, (pMem + uintptr(2)*40), int64((*Op)(unsafe.Pointer(pOp)).Fp1))
- Xsqlite3VdbeMemSetInt64(tls, (pMem + uintptr(3)*40), int64((*Op)(unsafe.Pointer(pOp)).Fp2))
- Xsqlite3VdbeMemSetInt64(tls, (pMem + uintptr(4)*40), int64((*Op)(unsafe.Pointer(pOp)).Fp3))
+ Xsqlite3VdbeMemSetInt64(tls, pMem+uintptr(2)*40, int64((*Op)(unsafe.Pointer(pOp)).Fp1))
+ Xsqlite3VdbeMemSetInt64(tls, pMem+uintptr(3)*40, int64((*Op)(unsafe.Pointer(pOp)).Fp2))
+ Xsqlite3VdbeMemSetInt64(tls, pMem+uintptr(4)*40, int64((*Op)(unsafe.Pointer(pOp)).Fp3))
// pMem+5 for p4 is done last
- Xsqlite3VdbeMemSetInt64(tls, (pMem + uintptr(6)*40), int64((*Op)(unsafe.Pointer(pOp)).Fp5))
- Xsqlite3VdbeMemSetNull(tls, (pMem + uintptr(7)*40))
- Xsqlite3VdbeMemSetStr(tls, (pMem + uintptr(5)*40), zP4, int64(-1), uint8(SQLITE_UTF8), *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{Xsqlite3_free})))
+ Xsqlite3VdbeMemSetInt64(tls, pMem+uintptr(6)*40, int64((*Op)(unsafe.Pointer(pOp)).Fp5))
+ Xsqlite3VdbeMemSetNull(tls, pMem+uintptr(7)*40)
+ Xsqlite3VdbeMemSetStr(tls, pMem+uintptr(5)*40, zP4, int64(-1), uint8(SQLITE_UTF8), *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{Xsqlite3_free})))
(*Vdbe)(unsafe.Pointer(p)).FnResColumn = U16(8)
}
(*Vdbe)(unsafe.Pointer(p)).FpResultSet = pMem
@@ -58055,7 +58772,7 @@ type ReusableSpace = struct {
F__ccgo_pad1 [4]byte
FnFree Sqlite3_int64
FnNeeded Sqlite3_int64
-} /* sqlite3.c:81154:1 */
+} /* sqlite3.c:81415:1 */
// Try to allocate nByte bytes of 8-byte aligned bulk memory for pBuf
// from the ReusableSpace object. Return a pointer to the allocated
@@ -58070,15 +58787,15 @@ type ReusableSpace = struct {
// This allocator is employed to repurpose unused slots at the end of the
// opcode array of prepared state for other memory needs of the prepared
// statement.
-func allocSpace(tls *libc.TLS, p uintptr, pBuf uintptr, nByte Sqlite3_int64) uintptr { /* sqlite3.c:81174:13: */
+func allocSpace(tls *libc.TLS, p uintptr, pBuf uintptr, nByte Sqlite3_int64) uintptr { /* sqlite3.c:81435:13: */
if pBuf == uintptr(0) {
- nByte = (((nByte) + int64(7)) & int64(libc.CplInt32(7)))
+ nByte = (nByte + int64(7)) & int64(libc.CplInt32(7))
if nByte <= (*ReusableSpace)(unsafe.Pointer(p)).FnFree {
- *(*Sqlite3_int64)(unsafe.Pointer(p + 8 /* &.nFree */)) -= (nByte)
- pBuf = ((*ReusableSpace)(unsafe.Pointer(p)).FpSpace + uintptr((*ReusableSpace)(unsafe.Pointer(p)).FnFree))
+ *(*Sqlite3_int64)(unsafe.Pointer(p + 8)) -= nByte
+ pBuf = (*ReusableSpace)(unsafe.Pointer(p)).FpSpace + uintptr((*ReusableSpace)(unsafe.Pointer(p)).FnFree)
} else {
- *(*Sqlite3_int64)(unsafe.Pointer(p + 16 /* &.nNeeded */)) += (nByte)
+ *(*Sqlite3_int64)(unsafe.Pointer(p + 16)) += nByte
}
}
@@ -58087,7 +58804,7 @@ func allocSpace(tls *libc.TLS, p uintptr, pBuf uintptr, nByte Sqlite3_int64) uin
// Rewind the VDBE back to the beginning in preparation for
// running it.
-func Xsqlite3VdbeRewind(tls *libc.TLS, p uintptr) { /* sqlite3.c:81197:21: */
+func Xsqlite3VdbeRewind(tls *libc.TLS, p uintptr) { /* sqlite3.c:81458:21: */
// There should be at least one opcode.
@@ -58097,7 +58814,7 @@ func Xsqlite3VdbeRewind(tls *libc.TLS, p uintptr) { /* sqlite3.c:81197:21: */
(*Vdbe)(unsafe.Pointer(p)).Fpc = -1
(*Vdbe)(unsafe.Pointer(p)).Frc = SQLITE_OK
(*Vdbe)(unsafe.Pointer(p)).FerrorAction = U8(OE_Abort)
- (*Vdbe)(unsafe.Pointer(p)).FnChange = 0
+ (*Vdbe)(unsafe.Pointer(p)).FnChange = int64(0)
(*Vdbe)(unsafe.Pointer(p)).FcacheCtr = U32(1)
(*Vdbe)(unsafe.Pointer(p)).FminWriteFileFormat = U8(255)
(*Vdbe)(unsafe.Pointer(p)).FiStatement = 0
@@ -58120,7 +58837,7 @@ func Xsqlite3VdbeRewind(tls *libc.TLS, p uintptr) { /* sqlite3.c:81197:21: */
//
// Use the sqlite3VdbeRewind() procedure to restore a virtual machine back
// to its initial state after it has been run.
-func Xsqlite3VdbeMakeReady(tls *libc.TLS, p uintptr, pParse uintptr) { /* sqlite3.c:81250:21: */
+func Xsqlite3VdbeMakeReady(tls *libc.TLS, p uintptr, pParse uintptr) { /* sqlite3.c:81511:21: */
bp := tls.Alloc(32)
defer tls.Free(32)
@@ -58147,21 +58864,21 @@ func Xsqlite3VdbeMakeReady(tls *libc.TLS, p uintptr, pParse uintptr) { /* sqlite
// use aMem[0] which is not otherwise used by the VDBE program. Allocate
// space at the end of aMem[] for cursors 1 and greater.
// See also: allocateCursor().
- nMem = nMem + (nCursor)
- if (nCursor == 0) && (nMem > 0) {
+ nMem = nMem + nCursor
+ if nCursor == 0 && nMem > 0 {
nMem++
} // Space for aMem[0] even if not used
// Figure out how much reusable memory is available at the end of the
// opcode array. This extra memory will be reallocated for other elements
// of the prepared statement.
- n = (int32(((uint32(unsafe.Sizeof(Op{})) * uint32((*Vdbe)(unsafe.Pointer(p)).FnOp)) + uint32(7)) & libc.Uint32FromInt32(libc.CplInt32(7)))) // Bytes of opcode memory used
- (*ReusableSpace)(unsafe.Pointer(bp + 8 /* &x */)).FpSpace = (((*Vdbe)(unsafe.Pointer(p)).FaOp) + uintptr(n)) // Unused opcode memory
+ n = int32((uint32(unsafe.Sizeof(Op{}))*uint32((*Vdbe)(unsafe.Pointer(p)).FnOp) + uint32(7)) & libc.Uint32FromInt32(libc.CplInt32(7))) // Bytes of opcode memory used
+ (*ReusableSpace)(unsafe.Pointer(bp + 8 /* &x */)).FpSpace = (*Vdbe)(unsafe.Pointer(p)).FaOp + uintptr(n) // Unused opcode memory
- (*ReusableSpace)(unsafe.Pointer(bp + 8 /* &x */)).FnFree = (Sqlite3_int64(((*Parse)(unsafe.Pointer(pParse)).FszOpAlloc - n) & libc.CplInt32(7))) // Bytes of unused memory
+ (*ReusableSpace)(unsafe.Pointer(bp + 8 /* &x */)).FnFree = Sqlite3_int64(((*Parse)(unsafe.Pointer(pParse)).FszOpAlloc - n) & libc.CplInt32(7)) // Bytes of unused memory
resolveP2Values(tls, p, bp /* &nArg */)
- libc.SetBitFieldPtr16Uint32(p+152 /* &.usesStmtJournal */, Bft((U8(libc.Bool32(((*Parse)(unsafe.Pointer(pParse)).FisMultiWrite != 0) && ((*Parse)(unsafe.Pointer(pParse)).FmayAbort != 0))))), 6, 0x40)
+ libc.SetBitFieldPtr16Uint32(p+160, Bft(U8(libc.Bool32((*Parse)(unsafe.Pointer(pParse)).FisMultiWrite != 0 && (*Parse)(unsafe.Pointer(pParse)).FmayAbort != 0))), 6, 0x40)
if (*Parse)(unsafe.Pointer(pParse)).Fexplain != 0 {
var iFirst int32
var mx int32
@@ -58169,7 +58886,7 @@ func Xsqlite3VdbeMakeReady(tls *libc.TLS, p uintptr, pParse uintptr) { /* sqlite
if nMem < 10 {
nMem = 10
}
- libc.SetBitFieldPtr16Uint32(p+152 /* &.explain */, Bft((*Parse)(unsafe.Pointer(pParse)).Fexplain), 2, 0xc)
+ libc.SetBitFieldPtr16Uint32(p+160, Bft((*Parse)(unsafe.Pointer(pParse)).Fexplain), 2, 0xc)
if int32((*Parse)(unsafe.Pointer(pParse)).Fexplain) == 2 {
Xsqlite3VdbeSetNumCols(tls, p, 4)
iFirst = 8
@@ -58180,11 +58897,11 @@ func Xsqlite3VdbeMakeReady(tls *libc.TLS, p uintptr, pParse uintptr) { /* sqlite
mx = 8
}
for i = iFirst; i < mx; i++ {
- Xsqlite3VdbeSetColName(tls, p, (i - iFirst), COLNAME_NAME,
+ Xsqlite3VdbeSetColName(tls, p, i-iFirst, COLNAME_NAME,
azColName[i], uintptr(0))
}
}
- libc.SetBitFieldPtr16Uint32(p+152 /* &.expired */, Bft(0), 0, 0x3)
+ libc.SetBitFieldPtr16Uint32(p+160, Bft(0), 0, 0x3)
// Memory for registers, parameters, cursor, etc, is allocated in one or two
// passes. On the first pass, we try to reuse unused memory at the
@@ -58196,18 +58913,18 @@ func Xsqlite3VdbeMakeReady(tls *libc.TLS, p uintptr, pParse uintptr) { /* sqlite
// the leftover memory at the end of the opcode array. This can significantly
// reduce the amount of memory held by a prepared statement.
(*ReusableSpace)(unsafe.Pointer(bp + 8 /* &x */)).FnNeeded = int64(0)
- (*Vdbe)(unsafe.Pointer(p)).FaMem = allocSpace(tls, bp+8 /* &x */, uintptr(0), (int64(uint32(nMem) * uint32(unsafe.Sizeof(Mem{})))))
- (*Vdbe)(unsafe.Pointer(p)).FaVar = allocSpace(tls, bp+8 /* &x */, uintptr(0), (int64(uint32(nVar) * uint32(unsafe.Sizeof(Mem{})))))
- (*Vdbe)(unsafe.Pointer(p)).FapArg = allocSpace(tls, bp+8 /* &x */, uintptr(0), (int64(uint32(*(*int32)(unsafe.Pointer(bp /* nArg */))) * uint32(unsafe.Sizeof(uintptr(0))))))
- (*Vdbe)(unsafe.Pointer(p)).FapCsr = allocSpace(tls, bp+8 /* &x */, uintptr(0), (int64(uint32(nCursor) * uint32(unsafe.Sizeof(uintptr(0))))))
- if (*ReusableSpace)(unsafe.Pointer(bp+8 /* &x */)).FnNeeded != 0 {
- (*ReusableSpace)(unsafe.Pointer(bp + 8 /* &x */)).FpSpace = libc.AssignPtrUintptr(p+196 /* &.pFree */, Xsqlite3DbMallocRawNN(tls, db, uint64((*ReusableSpace)(unsafe.Pointer(bp+8 /* &x */)).FnNeeded)))
+ (*Vdbe)(unsafe.Pointer(p)).FaMem = allocSpace(tls, bp+8 /* &x */, uintptr(0), int64(uint32(nMem)*uint32(unsafe.Sizeof(Mem{}))))
+ (*Vdbe)(unsafe.Pointer(p)).FaVar = allocSpace(tls, bp+8 /* &x */, uintptr(0), int64(uint32(nVar)*uint32(unsafe.Sizeof(Mem{}))))
+ (*Vdbe)(unsafe.Pointer(p)).FapArg = allocSpace(tls, bp+8 /* &x */, uintptr(0), int64(uint32(*(*int32)(unsafe.Pointer(bp)))*uint32(unsafe.Sizeof(uintptr(0)))))
+ (*Vdbe)(unsafe.Pointer(p)).FapCsr = allocSpace(tls, bp+8 /* &x */, uintptr(0), int64(uint32(nCursor)*uint32(unsafe.Sizeof(uintptr(0)))))
+ if (*ReusableSpace)(unsafe.Pointer(bp+8)).FnNeeded != 0 {
+ (*ReusableSpace)(unsafe.Pointer(bp + 8 /* &x */)).FpSpace = libc.AssignPtrUintptr(p+204, Xsqlite3DbMallocRawNN(tls, db, uint64((*ReusableSpace)(unsafe.Pointer(bp+8 /* &x */)).FnNeeded)))
(*ReusableSpace)(unsafe.Pointer(bp + 8 /* &x */)).FnFree = (*ReusableSpace)(unsafe.Pointer(bp + 8 /* &x */)).FnNeeded
if !(int32((*Sqlite3)(unsafe.Pointer(db)).FmallocFailed) != 0) {
- (*Vdbe)(unsafe.Pointer(p)).FaMem = allocSpace(tls, bp+8 /* &x */, (*Vdbe)(unsafe.Pointer(p)).FaMem, (int64(uint32(nMem) * uint32(unsafe.Sizeof(Mem{})))))
- (*Vdbe)(unsafe.Pointer(p)).FaVar = allocSpace(tls, bp+8 /* &x */, (*Vdbe)(unsafe.Pointer(p)).FaVar, (int64(uint32(nVar) * uint32(unsafe.Sizeof(Mem{})))))
- (*Vdbe)(unsafe.Pointer(p)).FapArg = allocSpace(tls, bp+8 /* &x */, (*Vdbe)(unsafe.Pointer(p)).FapArg, (int64(uint32(*(*int32)(unsafe.Pointer(bp /* nArg */))) * uint32(unsafe.Sizeof(uintptr(0))))))
- (*Vdbe)(unsafe.Pointer(p)).FapCsr = allocSpace(tls, bp+8 /* &x */, (*Vdbe)(unsafe.Pointer(p)).FapCsr, (int64(uint32(nCursor) * uint32(unsafe.Sizeof(uintptr(0))))))
+ (*Vdbe)(unsafe.Pointer(p)).FaMem = allocSpace(tls, bp+8 /* &x */, (*Vdbe)(unsafe.Pointer(p)).FaMem, int64(uint32(nMem)*uint32(unsafe.Sizeof(Mem{}))))
+ (*Vdbe)(unsafe.Pointer(p)).FaVar = allocSpace(tls, bp+8 /* &x */, (*Vdbe)(unsafe.Pointer(p)).FaVar, int64(uint32(nVar)*uint32(unsafe.Sizeof(Mem{}))))
+ (*Vdbe)(unsafe.Pointer(p)).FapArg = allocSpace(tls, bp+8 /* &x */, (*Vdbe)(unsafe.Pointer(p)).FapArg, int64(uint32(*(*int32)(unsafe.Pointer(bp)))*uint32(unsafe.Sizeof(uintptr(0)))))
+ (*Vdbe)(unsafe.Pointer(p)).FapCsr = allocSpace(tls, bp+8 /* &x */, (*Vdbe)(unsafe.Pointer(p)).FapCsr, int64(uint32(nCursor)*uint32(unsafe.Sizeof(uintptr(0)))))
}
}
@@ -58221,19 +58938,19 @@ func Xsqlite3VdbeMakeReady(tls *libc.TLS, p uintptr, pParse uintptr) { /* sqlite
initMemArray(tls, (*Vdbe)(unsafe.Pointer(p)).FaVar, nVar, db, uint16(MEM_Null))
(*Vdbe)(unsafe.Pointer(p)).FnMem = nMem
initMemArray(tls, (*Vdbe)(unsafe.Pointer(p)).FaMem, nMem, db, uint16(MEM_Undefined))
- libc.Xmemset(tls, (*Vdbe)(unsafe.Pointer(p)).FapCsr, 0, (uint32(nCursor) * uint32(unsafe.Sizeof(uintptr(0)))))
+ libc.Xmemset(tls, (*Vdbe)(unsafe.Pointer(p)).FapCsr, 0, uint32(nCursor)*uint32(unsafe.Sizeof(uintptr(0))))
}
Xsqlite3VdbeRewind(tls, p)
}
var azColName = [12]uintptr{
- ts + 4136 /* "addr" */, ts + 4141 /* "opcode" */, ts + 4148 /* "p1" */, ts + 4151 /* "p2" */, ts + 4154 /* "p3" */, ts + 4157 /* "p4" */, ts + 4160 /* "p5" */, ts + 4163, /* "comment" */
- ts + 4171 /* "id" */, ts + 4174 /* "parent" */, ts + 4181 /* "notused" */, ts + 4189, /* "detail" */
-} /* sqlite3.c:81298:23 */
+ ts + 4942 /* "addr" */, ts + 4947 /* "opcode" */, ts + 4954 /* "p1" */, ts + 4957 /* "p2" */, ts + 4960 /* "p3" */, ts + 4963 /* "p4" */, ts + 4966 /* "p5" */, ts + 4969, /* "comment" */
+ ts + 4977 /* "id" */, ts + 4980 /* "parent" */, ts + 4987 /* "notused" */, ts + 4995, /* "detail" */
+} /* sqlite3.c:81559:23 */
// Close a VDBE cursor and release all the resources that cursor
// happens to hold.
-func Xsqlite3VdbeFreeCursor(tls *libc.TLS, p uintptr, pCx uintptr) { /* sqlite3.c:81375:21: */
+func Xsqlite3VdbeFreeCursor(tls *libc.TLS, p uintptr, pCx uintptr) { /* sqlite3.c:81636:21: */
if pCx == uintptr(0) {
return
}
@@ -58248,13 +58965,13 @@ func Xsqlite3VdbeFreeCursor(tls *libc.TLS, p uintptr, pCx uintptr) { /* sqlite3.
case CURTYPE_BTREE:
{
- Xsqlite3BtreeCloseCursor(tls, *(*uintptr)(unsafe.Pointer(pCx + 40 /* &.uc */)))
+ Xsqlite3BtreeCloseCursor(tls, *(*uintptr)(unsafe.Pointer(pCx + 40)))
break
}
case CURTYPE_VTAB:
{
- var pVCur uintptr = *(*uintptr)(unsafe.Pointer(pCx + 40 /* &.uc */))
+ var pVCur uintptr = *(*uintptr)(unsafe.Pointer(pCx + 40))
var pModule uintptr = (*Sqlite3_vtab)(unsafe.Pointer((*Sqlite3_vtab_cursor)(unsafe.Pointer(pVCur)).FpVtab)).FpModule
(*Sqlite3_vtab)(unsafe.Pointer((*Sqlite3_vtab_cursor)(unsafe.Pointer(pVCur)).FpVtab)).FnRef--
@@ -58268,7 +58985,7 @@ func Xsqlite3VdbeFreeCursor(tls *libc.TLS, p uintptr, pCx uintptr) { /* sqlite3.
}
// Close all cursors in the current frame.
-func closeCursorsInFrame(tls *libc.TLS, p uintptr) { /* sqlite3.c:81407:13: */
+func closeCursorsInFrame(tls *libc.TLS, p uintptr) { /* sqlite3.c:81668:13: */
if (*Vdbe)(unsafe.Pointer(p)).FapCsr != 0 {
var i int32
for i = 0; i < (*Vdbe)(unsafe.Pointer(p)).FnCursor; i++ {
@@ -58284,7 +59001,7 @@ func closeCursorsInFrame(tls *libc.TLS, p uintptr) { /* sqlite3.c:81407:13: */
// Copy the values stored in the VdbeFrame structure to its Vdbe. This
// is used, for example, when a trigger sub-program is halted to restore
// control to the main program.
-func Xsqlite3VdbeFrameRestore(tls *libc.TLS, pFrame uintptr) int32 { /* sqlite3.c:81425:20: */
+func Xsqlite3VdbeFrameRestore(tls *libc.TLS, pFrame uintptr) int32 { /* sqlite3.c:81686:20: */
var v uintptr = (*VdbeFrame)(unsafe.Pointer(pFrame)).Fv
closeCursorsInFrame(tls, v)
(*Vdbe)(unsafe.Pointer(v)).FaOp = (*VdbeFrame)(unsafe.Pointer(pFrame)).FaOp
@@ -58296,7 +59013,7 @@ func Xsqlite3VdbeFrameRestore(tls *libc.TLS, pFrame uintptr) int32 { /* sqlite3.
(*Sqlite3)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(v)).Fdb)).FlastRowid = (*VdbeFrame)(unsafe.Pointer(pFrame)).FlastRowid
(*Vdbe)(unsafe.Pointer(v)).FnChange = (*VdbeFrame)(unsafe.Pointer(pFrame)).FnChange
(*Sqlite3)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(v)).Fdb)).FnChange = (*VdbeFrame)(unsafe.Pointer(pFrame)).FnDbChange
- Xsqlite3VdbeDeleteAuxData(tls, (*Vdbe)(unsafe.Pointer(v)).Fdb, (v + 220 /* &.pAuxData */), -1, 0)
+ Xsqlite3VdbeDeleteAuxData(tls, (*Vdbe)(unsafe.Pointer(v)).Fdb, v+228, -1, 0)
(*Vdbe)(unsafe.Pointer(v)).FpAuxData = (*VdbeFrame)(unsafe.Pointer(pFrame)).FpAuxData
(*VdbeFrame)(unsafe.Pointer(pFrame)).FpAuxData = uintptr(0)
return (*VdbeFrame)(unsafe.Pointer(pFrame)).Fpc
@@ -58308,7 +59025,7 @@ func Xsqlite3VdbeFrameRestore(tls *libc.TLS, pFrame uintptr) int32 { /* sqlite3.
// cell array. This is necessary as the memory cell array may contain
// pointers to VdbeFrame objects, which may in turn contain pointers to
// open cursors.
-func closeAllCursors(tls *libc.TLS, p uintptr) { /* sqlite3.c:81454:13: */
+func closeAllCursors(tls *libc.TLS, p uintptr) { /* sqlite3.c:81715:13: */
if (*Vdbe)(unsafe.Pointer(p)).FpFrame != 0 {
var pFrame uintptr
for pFrame = (*Vdbe)(unsafe.Pointer(p)).FpFrame; (*VdbeFrame)(unsafe.Pointer(pFrame)).FpParent != 0; pFrame = (*VdbeFrame)(unsafe.Pointer(pFrame)).FpParent {
@@ -58330,7 +59047,7 @@ func closeAllCursors(tls *libc.TLS, p uintptr) { /* sqlite3.c:81454:13: */
// Delete any auxdata allocations made by the VM
if (*Vdbe)(unsafe.Pointer(p)).FpAuxData != 0 {
- Xsqlite3VdbeDeleteAuxData(tls, (*Vdbe)(unsafe.Pointer(p)).Fdb, (p + 220 /* &.pAuxData */), -1, 0)
+ Xsqlite3VdbeDeleteAuxData(tls, (*Vdbe)(unsafe.Pointer(p)).Fdb, p+228, -1, 0)
}
}
@@ -58339,17 +59056,17 @@ func closeAllCursors(tls *libc.TLS, p uintptr) { /* sqlite3.c:81454:13: */
// statement. This is now set at compile time, rather than during
// execution of the vdbe program so that sqlite3_column_count() can
// be called on an SQL statement before sqlite3_step().
-func Xsqlite3VdbeSetNumCols(tls *libc.TLS, p uintptr, nResColumn int32) { /* sqlite3.c:81484:21: */
+func Xsqlite3VdbeSetNumCols(tls *libc.TLS, p uintptr, nResColumn int32) { /* sqlite3.c:81745:21: */
var n int32
var db uintptr = (*Vdbe)(unsafe.Pointer(p)).Fdb
if (*Vdbe)(unsafe.Pointer(p)).FnResColumn != 0 {
- releaseMemArray(tls, (*Vdbe)(unsafe.Pointer(p)).FaColName, (int32((*Vdbe)(unsafe.Pointer(p)).FnResColumn) * COLNAME_N))
+ releaseMemArray(tls, (*Vdbe)(unsafe.Pointer(p)).FaColName, int32((*Vdbe)(unsafe.Pointer(p)).FnResColumn)*COLNAME_N)
Xsqlite3DbFree(tls, db, (*Vdbe)(unsafe.Pointer(p)).FaColName)
}
- n = (nResColumn * COLNAME_N)
+ n = nResColumn * COLNAME_N
(*Vdbe)(unsafe.Pointer(p)).FnResColumn = U16(nResColumn)
- (*Vdbe)(unsafe.Pointer(p)).FaColName = Xsqlite3DbMallocRawNN(tls, db, (uint64(uint32(unsafe.Sizeof(Mem{})) * uint32(n))))
+ (*Vdbe)(unsafe.Pointer(p)).FaColName = Xsqlite3DbMallocRawNN(tls, db, uint64(uint32(unsafe.Sizeof(Mem{}))*uint32(n)))
if (*Vdbe)(unsafe.Pointer(p)).FaColName == uintptr(0) {
return
}
@@ -58364,7 +59081,7 @@ func Xsqlite3VdbeSetNumCols(tls *libc.TLS, p uintptr, nResColumn int32) { /* sql
// The final parameter, xDel, must be one of SQLITE_DYNAMIC, SQLITE_STATIC
// or SQLITE_TRANSIENT. If it is SQLITE_DYNAMIC, then the buffer pointed
// to by zName will be freed by sqlite3DbFree() when the vdbe is destroyed.
-func Xsqlite3VdbeSetColName(tls *libc.TLS, p uintptr, idx int32, var1 int32, zName uintptr, xDel uintptr) int32 { /* sqlite3.c:81509:20: */
+func Xsqlite3VdbeSetColName(tls *libc.TLS, p uintptr, idx int32, var1 int32, zName uintptr, xDel uintptr) int32 { /* sqlite3.c:81770:20: */
var rc int32
var pColName uintptr
@@ -58373,7 +59090,7 @@ func Xsqlite3VdbeSetColName(tls *libc.TLS, p uintptr, idx int32, var1 int32, zNa
return SQLITE_NOMEM
}
- pColName = ((*Vdbe)(unsafe.Pointer(p)).FaColName + uintptr((idx+(var1*int32((*Vdbe)(unsafe.Pointer(p)).FnResColumn))))*40)
+ pColName = (*Vdbe)(unsafe.Pointer(p)).FaColName + uintptr(idx+var1*int32((*Vdbe)(unsafe.Pointer(p)).FnResColumn))*40
rc = Xsqlite3VdbeMemSetStr(tls, pColName, zName, int64(-1), uint8(SQLITE_UTF8), xDel)
return rc
@@ -58383,7 +59100,7 @@ func Xsqlite3VdbeSetColName(tls *libc.TLS, p uintptr, idx int32, var1 int32, zNa
// db. If a transaction is active, commit it. If there is a
// write-transaction spanning more than one database file, this routine
// takes care of the super-journal trickery.
-func vdbeCommit(tls *libc.TLS, db uintptr, p uintptr) int32 { /* sqlite3.c:81537:12: */
+func vdbeCommit(tls *libc.TLS, db uintptr, p uintptr) int32 { /* sqlite3.c:81798:12: */
bp := tls.Alloc(68)
defer tls.Free(68)
@@ -58406,16 +59123,16 @@ func vdbeCommit(tls *libc.TLS, db uintptr, p uintptr) int32 { /* sqlite3.c:81537
// including the temp database. (b) is important because if more than
// one database file has an open write transaction, a super-journal
// file is required for an atomic commit.
- for i = 0; (rc == SQLITE_OK) && (i < (*Sqlite3)(unsafe.Pointer(db)).FnDb); i++ {
+ for i = 0; rc == SQLITE_OK && i < (*Sqlite3)(unsafe.Pointer(db)).FnDb; i++ {
var pBt uintptr = (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb + uintptr(i)*16)).FpBt
if Xsqlite3BtreeTxnState(tls, pBt) == SQLITE_TXN_WRITE {
var pPager uintptr // Pager associated with pBt
needXcommit = 1
Xsqlite3BtreeEnter(tls, pBt)
pPager = Xsqlite3BtreePager(tls, pBt)
- if ((int32((*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+uintptr(i)*16)).Fsafety_level) != PAGER_SYNCHRONOUS_OFF) &&
- (aMJNeeded[Xsqlite3PagerGetJournalMode(tls, pPager)] != 0)) &&
- (Xsqlite3PagerIsMemdb(tls, pPager) == 0) {
+ if int32((*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+uintptr(i)*16)).Fsafety_level) != PAGER_SYNCHRONOUS_OFF &&
+ aMJNeeded[Xsqlite3PagerGetJournalMode(tls, pPager)] != 0 &&
+ Xsqlite3PagerIsMemdb(tls, pPager) == 0 {
nTrans++
}
@@ -58428,12 +59145,12 @@ func vdbeCommit(tls *libc.TLS, db uintptr, p uintptr) int32 { /* sqlite3.c:81537
}
// If there are any write-transactions at all, invoke the commit hook
- if (needXcommit != 0) && ((*Sqlite3)(unsafe.Pointer(db)).FxCommitCallback != 0) {
+ if needXcommit != 0 && (*Sqlite3)(unsafe.Pointer(db)).FxCommitCallback != 0 {
rc = (*struct {
f func(*libc.TLS, uintptr) int32
})(unsafe.Pointer(&struct{ uintptr }{(*Sqlite3)(unsafe.Pointer(db)).FxCommitCallback})).f(tls, (*Sqlite3)(unsafe.Pointer(db)).FpCommitArg)
if rc != 0 {
- return (SQLITE_CONSTRAINT | (int32(2) << 8))
+ return SQLITE_CONSTRAINT | int32(2)<<8
}
}
@@ -58445,9 +59162,9 @@ func vdbeCommit(tls *libc.TLS, db uintptr, p uintptr) int32 { /* sqlite3.c:81537
// string, it means the main database is :memory: or a temp file. In
// that case we do not support atomic multi-file commits, so use the
// simple case then too.
- if (0 == Xsqlite3Strlen30(tls, Xsqlite3BtreeGetFilename(tls, (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb)).FpBt))) ||
- (nTrans <= 1) {
- for i = 0; (rc == SQLITE_OK) && (i < (*Sqlite3)(unsafe.Pointer(db)).FnDb); i++ {
+ if 0 == Xsqlite3Strlen30(tls, Xsqlite3BtreeGetFilename(tls, (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb)).FpBt)) ||
+ nTrans <= 1 {
+ for i = 0; rc == SQLITE_OK && i < (*Sqlite3)(unsafe.Pointer(db)).FnDb; i++ {
var pBt uintptr = (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb + uintptr(i)*16)).FpBt
if pBt != 0 {
rc = Xsqlite3BtreeCommitPhaseOne(tls, pBt, uintptr(0))
@@ -58458,7 +59175,7 @@ func vdbeCommit(tls *libc.TLS, db uintptr, p uintptr) int32 { /* sqlite3.c:81537
// If one of the BtreeCommitPhaseOne() calls fails, this indicates an
// IO error while deleting or truncating a journal file. It is unlikely,
// but could happen. In this case abandon processing and return the error.
- for i = 0; (rc == SQLITE_OK) && (i < (*Sqlite3)(unsafe.Pointer(db)).FnDb); i++ {
+ for i = 0; rc == SQLITE_OK && i < (*Sqlite3)(unsafe.Pointer(db)).FnDb; i++ {
var pBt uintptr = (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb + uintptr(i)*16)).FpBt
if pBt != 0 {
rc = Xsqlite3BtreeCommitPhaseTwo(tls, pBt, 0)
@@ -58480,27 +59197,27 @@ func vdbeCommit(tls *libc.TLS, db uintptr, p uintptr) int32 { /* sqlite3.c:81537
// Select a super-journal file name
nMainFile = Xsqlite3Strlen30(tls, zMainFile)
- zSuper = Xsqlite3MPrintf(tls, db, ts+4196 /* "%.4c%s%.16c" */, libc.VaList(bp, 0, zMainFile, 0))
+ zSuper = Xsqlite3MPrintf(tls, db, ts+5002 /* "%.4c%s%.16c" */, libc.VaList(bp, 0, zMainFile, 0))
if zSuper == uintptr(0) {
return SQLITE_NOMEM
}
zSuper += uintptr(4)
- for ok := true; ok; ok = ((rc == SQLITE_OK) && (*(*int32)(unsafe.Pointer(bp + 60 /* res */)) != 0)) {
+ for ok := true; ok; ok = rc == SQLITE_OK && *(*int32)(unsafe.Pointer(bp + 60)) != 0 {
// var iRandom U32 at bp+56, 4
if retryCount != 0 {
if retryCount > 100 {
- Xsqlite3_log(tls, SQLITE_FULL, ts+4208 /* "MJ delete: %s" */, libc.VaList(bp+24, zSuper))
+ Xsqlite3_log(tls, SQLITE_FULL, ts+5014 /* "MJ delete: %s" */, libc.VaList(bp+24, zSuper))
Xsqlite3OsDelete(tls, pVfs, zSuper, 0)
break
} else if retryCount == 1 {
- Xsqlite3_log(tls, SQLITE_FULL, ts+4222 /* "MJ collide: %s" */, libc.VaList(bp+32, zSuper))
+ Xsqlite3_log(tls, SQLITE_FULL, ts+5028 /* "MJ collide: %s" */, libc.VaList(bp+32, zSuper))
}
}
retryCount++
Xsqlite3_randomness(tls, int32(unsafe.Sizeof(U32(0))), bp+56 /* &iRandom */)
- Xsqlite3_snprintf(tls, 13, (zSuper + uintptr(nMainFile)), ts+4237, /* "-mj%06X9%02X" */
- libc.VaList(bp+40, ((*(*U32)(unsafe.Pointer(bp + 56 /* iRandom */))>>8)&U32(0xffffff)), (*(*U32)(unsafe.Pointer(bp + 56 /* iRandom */))&U32(0xff))))
+ Xsqlite3_snprintf(tls, 13, zSuper+uintptr(nMainFile), ts+5043, /* "-mj%06X9%02X" */
+ libc.VaList(bp+40, *(*U32)(unsafe.Pointer(bp + 56))>>8&U32(0xffffff), *(*U32)(unsafe.Pointer(bp + 56))&U32(0xff)))
// The antipenultimate character of the super-journal name must
// be "9" to avoid name collisions when using 8+3 filenames.
@@ -58509,10 +59226,10 @@ func vdbeCommit(tls *libc.TLS, db uintptr, p uintptr) int32 { /* sqlite3.c:81537
if rc == SQLITE_OK {
// Open the super-journal.
rc = Xsqlite3OsOpenMalloc(tls, pVfs, zSuper, bp+64, /* &pSuperJrnl */
- (((SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE) | SQLITE_OPEN_EXCLUSIVE) | SQLITE_OPEN_SUPER_JOURNAL), uintptr(0))
+ SQLITE_OPEN_READWRITE|SQLITE_OPEN_CREATE|SQLITE_OPEN_EXCLUSIVE|SQLITE_OPEN_SUPER_JOURNAL, uintptr(0))
}
if rc != SQLITE_OK {
- Xsqlite3DbFree(tls, db, (zSuper - uintptr(4)))
+ Xsqlite3DbFree(tls, db, zSuper-uintptr(4))
return rc
}
@@ -58529,12 +59246,12 @@ func vdbeCommit(tls *libc.TLS, db uintptr, p uintptr) int32 { /* sqlite3.c:81537
continue // Ignore TEMP and :memory: databases
}
- rc = Xsqlite3OsWrite(tls, *(*uintptr)(unsafe.Pointer(bp + 64 /* pSuperJrnl */)), zFile, (Xsqlite3Strlen30(tls, zFile) + 1), offset)
- offset = offset + (I64(Xsqlite3Strlen30(tls, zFile) + 1))
+ rc = Xsqlite3OsWrite(tls, *(*uintptr)(unsafe.Pointer(bp + 64 /* pSuperJrnl */)), zFile, Xsqlite3Strlen30(tls, zFile)+1, offset)
+ offset = offset + I64(Xsqlite3Strlen30(tls, zFile)+1)
if rc != SQLITE_OK {
Xsqlite3OsCloseFree(tls, *(*uintptr)(unsafe.Pointer(bp + 64 /* pSuperJrnl */)))
Xsqlite3OsDelete(tls, pVfs, zSuper, 0)
- Xsqlite3DbFree(tls, db, (zSuper - uintptr(4)))
+ Xsqlite3DbFree(tls, db, zSuper-uintptr(4))
return rc
}
}
@@ -58542,11 +59259,11 @@ func vdbeCommit(tls *libc.TLS, db uintptr, p uintptr) int32 { /* sqlite3.c:81537
// Sync the super-journal file. If the IOCAP_SEQUENTIAL device
// flag is set this is not required.
- if (0 == (Xsqlite3OsDeviceCharacteristics(tls, *(*uintptr)(unsafe.Pointer(bp + 64 /* pSuperJrnl */))) & SQLITE_IOCAP_SEQUENTIAL)) &&
- (SQLITE_OK != (libc.AssignInt32(&rc, Xsqlite3OsSync(tls, *(*uintptr)(unsafe.Pointer(bp + 64 /* pSuperJrnl */)), SQLITE_SYNC_NORMAL)))) {
+ if 0 == Xsqlite3OsDeviceCharacteristics(tls, *(*uintptr)(unsafe.Pointer(bp + 64)))&SQLITE_IOCAP_SEQUENTIAL &&
+ SQLITE_OK != libc.AssignInt32(&rc, Xsqlite3OsSync(tls, *(*uintptr)(unsafe.Pointer(bp + 64)), SQLITE_SYNC_NORMAL)) {
Xsqlite3OsCloseFree(tls, *(*uintptr)(unsafe.Pointer(bp + 64 /* pSuperJrnl */)))
Xsqlite3OsDelete(tls, pVfs, zSuper, 0)
- Xsqlite3DbFree(tls, db, (zSuper - uintptr(4)))
+ Xsqlite3DbFree(tls, db, zSuper-uintptr(4))
return rc
}
@@ -58559,7 +59276,7 @@ func vdbeCommit(tls *libc.TLS, db uintptr, p uintptr) int32 { /* sqlite3.c:81537
// super-journal file will be orphaned. But we cannot delete it,
// in case the super-journal file name was written into the journal
// file before the failure occurred.
- for i = 0; (rc == SQLITE_OK) && (i < (*Sqlite3)(unsafe.Pointer(db)).FnDb); i++ {
+ for i = 0; rc == SQLITE_OK && i < (*Sqlite3)(unsafe.Pointer(db)).FnDb; i++ {
var pBt uintptr = (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb + uintptr(i)*16)).FpBt
if pBt != 0 {
rc = Xsqlite3BtreeCommitPhaseOne(tls, pBt, zSuper)
@@ -58568,7 +59285,7 @@ func vdbeCommit(tls *libc.TLS, db uintptr, p uintptr) int32 { /* sqlite3.c:81537
Xsqlite3OsCloseFree(tls, *(*uintptr)(unsafe.Pointer(bp + 64 /* pSuperJrnl */)))
if rc != SQLITE_OK {
- Xsqlite3DbFree(tls, db, (zSuper - uintptr(4)))
+ Xsqlite3DbFree(tls, db, zSuper-uintptr(4))
return rc
}
@@ -58576,7 +59293,7 @@ func vdbeCommit(tls *libc.TLS, db uintptr, p uintptr) int32 { /* sqlite3.c:81537
// doing this the directory is synced again before any individual
// transaction files are deleted.
rc = Xsqlite3OsDelete(tls, pVfs, zSuper, 1)
- Xsqlite3DbFree(tls, db, (zSuper - uintptr(4)))
+ Xsqlite3DbFree(tls, db, zSuper-uintptr(4))
zSuper = uintptr(0)
if rc != 0 {
return rc
@@ -58611,7 +59328,7 @@ var aMJNeeded = [6]U8{
/* TRUNCATE */ U8(1),
/* MEMORY */ U8(0),
/* WAL */ U8(0),
-} /* sqlite3.c:81572:23 */
+} /* sqlite3.c:81833:23 */
// This routine checks that the sqlite3.nVdbeActive count variable
// matches the number of vdbe's in the list sqlite3.pVdbe that are
@@ -58629,11 +59346,11 @@ var aMJNeeded = [6]U8{
//
// If an IO error occurs, an SQLITE_IOERR_XXX error code is returned.
// Otherwise SQLITE_OK.
-func vdbeCloseStatement(tls *libc.TLS, p uintptr, eOp int32) int32 { /* sqlite3.c:81833:28: */
+func vdbeCloseStatement(tls *libc.TLS, p uintptr, eOp int32) int32 { /* sqlite3.c:82094:28: */
var db uintptr = (*Vdbe)(unsafe.Pointer(p)).Fdb
var rc int32 = SQLITE_OK
var i int32
- var iSavepoint int32 = ((*Vdbe)(unsafe.Pointer(p)).FiStatement - 1)
+ var iSavepoint int32 = (*Vdbe)(unsafe.Pointer(p)).FiStatement - 1
for i = 0; i < (*Sqlite3)(unsafe.Pointer(db)).FnDb; i++ {
var rc2 int32 = SQLITE_OK
@@ -58672,8 +59389,8 @@ func vdbeCloseStatement(tls *libc.TLS, p uintptr, eOp int32) int32 { /* sqlite3.
return rc
}
-func Xsqlite3VdbeCloseStatement(tls *libc.TLS, p uintptr, eOp int32) int32 { /* sqlite3.c:81879:20: */
- if ((*Sqlite3)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).Fdb)).FnStatement != 0) && ((*Vdbe)(unsafe.Pointer(p)).FiStatement != 0) {
+func Xsqlite3VdbeCloseStatement(tls *libc.TLS, p uintptr, eOp int32) int32 { /* sqlite3.c:82140:20: */
+ if (*Sqlite3)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).Fdb)).FnStatement != 0 && (*Vdbe)(unsafe.Pointer(p)).FiStatement != 0 {
return vdbeCloseStatement(tls, p, eOp)
}
return SQLITE_OK
@@ -58687,13 +59404,13 @@ func Xsqlite3VdbeCloseStatement(tls *libc.TLS, p uintptr, eOp int32) int32 { /*
// If there are outstanding FK violations and this function returns
// SQLITE_ERROR, set the result of the VM to SQLITE_CONSTRAINT_FOREIGNKEY
// and write an error message to it. Then return SQLITE_ERROR.
-func Xsqlite3VdbeCheckFk(tls *libc.TLS, p uintptr, deferred int32) int32 { /* sqlite3.c:81898:20: */
+func Xsqlite3VdbeCheckFk(tls *libc.TLS, p uintptr, deferred int32) int32 { /* sqlite3.c:82159:20: */
var db uintptr = (*Vdbe)(unsafe.Pointer(p)).Fdb
- if ((deferred != 0) && (((*Sqlite3)(unsafe.Pointer(db)).FnDeferredCons + (*Sqlite3)(unsafe.Pointer(db)).FnDeferredImmCons) > int64(0))) ||
- (!(deferred != 0) && ((*Vdbe)(unsafe.Pointer(p)).FnFkConstraint > int64(0))) {
- (*Vdbe)(unsafe.Pointer(p)).Frc = (SQLITE_CONSTRAINT | (int32(3) << 8))
+ if deferred != 0 && (*Sqlite3)(unsafe.Pointer(db)).FnDeferredCons+(*Sqlite3)(unsafe.Pointer(db)).FnDeferredImmCons > int64(0) ||
+ !(deferred != 0) && (*Vdbe)(unsafe.Pointer(p)).FnFkConstraint > int64(0) {
+ (*Vdbe)(unsafe.Pointer(p)).Frc = SQLITE_CONSTRAINT | int32(3)<<8
(*Vdbe)(unsafe.Pointer(p)).FerrorAction = U8(OE_Abort)
- Xsqlite3VdbeError(tls, p, ts+4250 /* "FOREIGN KEY cons..." */, 0)
+ Xsqlite3VdbeError(tls, p, ts+5056 /* "FOREIGN KEY cons..." */, 0)
return SQLITE_ERROR
}
return SQLITE_OK
@@ -58703,14 +59420,14 @@ func Xsqlite3VdbeCheckFk(tls *libc.TLS, p uintptr, deferred int32) int32 { /* sq
// has made changes and is in autocommit mode, then commit those
// changes. If a rollback is needed, then do the rollback.
//
-// This routine is the only way to move the state of a VM from
-// SQLITE_MAGIC_RUN to SQLITE_MAGIC_HALT. It is harmless to
-// call this on a VM that is in the SQLITE_MAGIC_HALT state.
+// This routine is the only way to move the sqlite3eOpenState of a VM from
+// SQLITE_STATE_RUN to SQLITE_STATE_HALT. It is harmless to
+// call this on a VM that is in the SQLITE_STATE_HALT state.
//
// Return an error code. If the commit could not complete because of
// lock contention, return SQLITE_BUSY. If SQLITE_BUSY is returned, it
// means the close did not happen and needs to be repeated.
-func Xsqlite3VdbeHalt(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:81925:20: */
+func Xsqlite3VdbeHalt(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:82186:20: */
var rc int32 // Used to store transient return codes
var db uintptr = (*Vdbe)(unsafe.Pointer(p)).Fdb
@@ -58739,7 +59456,7 @@ func Xsqlite3VdbeHalt(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:81925:20: *
// No commit or rollback needed if the program never started or if the
// SQL statement does not read or write a database file.
- if ((*Vdbe)(unsafe.Pointer(p)).Fpc >= 0) && ((Bft(int32(*(*uint16)(unsafe.Pointer(p + 152 /* &.bIsReader */)) & 0x100 >> 8))) != 0) {
+ if (*Vdbe)(unsafe.Pointer(p)).Fpc >= 0 && Bft(int32(*(*uint16)(unsafe.Pointer(p + 160))&0x100>>8)) != 0 {
var mrc int32 // Primary error code from p->rc
var eStatementOp int32 = 0
var isSpecialError int32 // Set to true if a 'special' error
@@ -58748,9 +59465,15 @@ func Xsqlite3VdbeHalt(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:81925:20: *
Xsqlite3VdbeEnter(tls, p)
// Check for one of the special errors
- mrc = ((*Vdbe)(unsafe.Pointer(p)).Frc & 0xff)
- isSpecialError = (libc.Bool32((((mrc == SQLITE_NOMEM) || (mrc == SQLITE_IOERR)) ||
- (mrc == SQLITE_INTERRUPT)) || (mrc == SQLITE_FULL)))
+ if (*Vdbe)(unsafe.Pointer(p)).Frc != 0 {
+ mrc = (*Vdbe)(unsafe.Pointer(p)).Frc & 0xff
+ isSpecialError = libc.Bool32(mrc == SQLITE_NOMEM ||
+ mrc == SQLITE_IOERR ||
+ mrc == SQLITE_INTERRUPT ||
+ mrc == SQLITE_FULL)
+ } else {
+ mrc = libc.AssignInt32(&isSpecialError, 0)
+ }
if isSpecialError != 0 {
// If the query was read-only and the error code is SQLITE_INTERRUPT,
// no rollback is necessary. Otherwise, at least a savepoint
@@ -58763,22 +59486,22 @@ func Xsqlite3VdbeHalt(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:81925:20: *
// file as part of an effort to free up cache space (see function
// pagerStress() in pager.c), the rollback is required to restore
// the pager to a consistent state.
- if !((int32(*(*uint16)(unsafe.Pointer(p + 152 /* &.readOnly */)) & 0x80 >> 7)) != 0) || (mrc != SQLITE_INTERRUPT) {
- if ((mrc == SQLITE_NOMEM) || (mrc == SQLITE_FULL)) && ((Bft(int32(*(*uint16)(unsafe.Pointer(p + 152 /* &.usesStmtJournal */)) & 0x40 >> 6))) != 0) {
+ if !(int32(*(*uint16)(unsafe.Pointer(p + 160))&0x80>>7) != 0) || mrc != SQLITE_INTERRUPT {
+ if (mrc == SQLITE_NOMEM || mrc == SQLITE_FULL) && Bft(int32(*(*uint16)(unsafe.Pointer(p + 160))&0x40>>6)) != 0 {
eStatementOp = SAVEPOINT_ROLLBACK
} else {
// We are forced to roll back the active transaction. Before doing
// so, abort any other statements this handle currently has active.
- Xsqlite3RollbackAll(tls, db, (SQLITE_ABORT | (int32(2) << 8)))
+ Xsqlite3RollbackAll(tls, db, SQLITE_ABORT|int32(2)<<8)
Xsqlite3CloseSavepoints(tls, db)
(*Sqlite3)(unsafe.Pointer(db)).FautoCommit = U8(1)
- (*Vdbe)(unsafe.Pointer(p)).FnChange = 0
+ (*Vdbe)(unsafe.Pointer(p)).FnChange = int64(0)
}
}
}
// Check for immediate foreign key violations.
- if ((*Vdbe)(unsafe.Pointer(p)).Frc == SQLITE_OK) || ((int32((*Vdbe)(unsafe.Pointer(p)).FerrorAction) == OE_Fail) && !(isSpecialError != 0)) {
+ if (*Vdbe)(unsafe.Pointer(p)).Frc == SQLITE_OK || int32((*Vdbe)(unsafe.Pointer(p)).FerrorAction) == OE_Fail && !(isSpecialError != 0) {
Xsqlite3VdbeCheckFk(tls, p, 0)
}
@@ -58787,17 +59510,20 @@ func Xsqlite3VdbeHalt(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:81925:20: *
//
// Note: This block also runs if one of the special errors handled
// above has occurred.
- if (!(((*Sqlite3)(unsafe.Pointer((db))).FnVTrans > 0) && ((*Sqlite3)(unsafe.Pointer((db))).FaVTrans == uintptr(0))) &&
- ((*Sqlite3)(unsafe.Pointer(db)).FautoCommit != 0)) &&
- ((*Sqlite3)(unsafe.Pointer(db)).FnVdbeWrite == (libc.Bool32((int32(*(*uint16)(unsafe.Pointer(p + 152 /* &.readOnly */)) & 0x80 >> 7)) == 0))) {
- if ((*Vdbe)(unsafe.Pointer(p)).Frc == SQLITE_OK) || ((int32((*Vdbe)(unsafe.Pointer(p)).FerrorAction) == OE_Fail) && !(isSpecialError != 0)) {
+ if !((*Sqlite3)(unsafe.Pointer(db)).FnVTrans > 0 && (*Sqlite3)(unsafe.Pointer(db)).FaVTrans == uintptr(0)) &&
+ (*Sqlite3)(unsafe.Pointer(db)).FautoCommit != 0 &&
+ (*Sqlite3)(unsafe.Pointer(db)).FnVdbeWrite == libc.Bool32(int32(*(*uint16)(unsafe.Pointer(p + 160))&0x80>>7) == 0) {
+ if (*Vdbe)(unsafe.Pointer(p)).Frc == SQLITE_OK || int32((*Vdbe)(unsafe.Pointer(p)).FerrorAction) == OE_Fail && !(isSpecialError != 0) {
rc = Xsqlite3VdbeCheckFk(tls, p, 1)
if rc != SQLITE_OK {
- if (Bft(int32(*(*uint16)(unsafe.Pointer(p + 152 /* &.readOnly */)) & 0x80 >> 7))) != 0 {
+ if Bft(int32(*(*uint16)(unsafe.Pointer(p + 160))&0x80>>7)) != 0 {
Xsqlite3VdbeLeave(tls, p)
return SQLITE_ERROR
}
- rc = (SQLITE_CONSTRAINT | (int32(3) << 8))
+ rc = SQLITE_CONSTRAINT | int32(3)<<8
+ } else if (*Sqlite3)(unsafe.Pointer(db)).Fflags&(U64(uint64(0x00002))<<32) != 0 {
+ rc = SQLITE_CORRUPT
+ *(*U64)(unsafe.Pointer(db + 32)) &= libc.CplUint64(U64(uint64(0x00002)) << 32)
} else {
// The auto-commit flag is true, the vdbe program was successful
// or hit an 'OR FAIL' constraint and there are no deferred foreign
@@ -58805,34 +59531,34 @@ func Xsqlite3VdbeHalt(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:81925:20: *
// is required.
rc = vdbeCommit(tls, db, p)
}
- if (rc == SQLITE_BUSY) && ((Bft(int32(*(*uint16)(unsafe.Pointer(p + 152 /* &.readOnly */)) & 0x80 >> 7))) != 0) {
+ if rc == SQLITE_BUSY && Bft(int32(*(*uint16)(unsafe.Pointer(p + 160))&0x80>>7)) != 0 {
Xsqlite3VdbeLeave(tls, p)
return SQLITE_BUSY
} else if rc != SQLITE_OK {
(*Vdbe)(unsafe.Pointer(p)).Frc = rc
Xsqlite3RollbackAll(tls, db, SQLITE_OK)
- (*Vdbe)(unsafe.Pointer(p)).FnChange = 0
+ (*Vdbe)(unsafe.Pointer(p)).FnChange = int64(0)
} else {
(*Sqlite3)(unsafe.Pointer(db)).FnDeferredCons = int64(0)
(*Sqlite3)(unsafe.Pointer(db)).FnDeferredImmCons = int64(0)
- *(*U64)(unsafe.Pointer(db + 32 /* &.flags */)) &= (libc.CplUint64(uint64(SQLITE_DeferFKs)))
+ *(*U64)(unsafe.Pointer(db + 32)) &= libc.CplUint64(uint64(SQLITE_DeferFKs))
Xsqlite3CommitInternalChanges(tls, db)
}
} else {
Xsqlite3RollbackAll(tls, db, SQLITE_OK)
- (*Vdbe)(unsafe.Pointer(p)).FnChange = 0
+ (*Vdbe)(unsafe.Pointer(p)).FnChange = int64(0)
}
(*Sqlite3)(unsafe.Pointer(db)).FnStatement = 0
} else if eStatementOp == 0 {
- if ((*Vdbe)(unsafe.Pointer(p)).Frc == SQLITE_OK) || (int32((*Vdbe)(unsafe.Pointer(p)).FerrorAction) == OE_Fail) {
+ if (*Vdbe)(unsafe.Pointer(p)).Frc == SQLITE_OK || int32((*Vdbe)(unsafe.Pointer(p)).FerrorAction) == OE_Fail {
eStatementOp = SAVEPOINT_RELEASE
} else if int32((*Vdbe)(unsafe.Pointer(p)).FerrorAction) == OE_Abort {
eStatementOp = SAVEPOINT_ROLLBACK
} else {
- Xsqlite3RollbackAll(tls, db, (SQLITE_ABORT | (int32(2) << 8)))
+ Xsqlite3RollbackAll(tls, db, SQLITE_ABORT|int32(2)<<8)
Xsqlite3CloseSavepoints(tls, db)
(*Sqlite3)(unsafe.Pointer(db)).FautoCommit = U8(1)
- (*Vdbe)(unsafe.Pointer(p)).FnChange = 0
+ (*Vdbe)(unsafe.Pointer(p)).FnChange = int64(0)
}
}
@@ -58844,27 +59570,27 @@ func Xsqlite3VdbeHalt(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:81925:20: *
if eStatementOp != 0 {
rc = Xsqlite3VdbeCloseStatement(tls, p, eStatementOp)
if rc != 0 {
- if ((*Vdbe)(unsafe.Pointer(p)).Frc == SQLITE_OK) || (((*Vdbe)(unsafe.Pointer(p)).Frc & 0xff) == SQLITE_CONSTRAINT) {
+ if (*Vdbe)(unsafe.Pointer(p)).Frc == SQLITE_OK || (*Vdbe)(unsafe.Pointer(p)).Frc&0xff == SQLITE_CONSTRAINT {
(*Vdbe)(unsafe.Pointer(p)).Frc = rc
Xsqlite3DbFree(tls, db, (*Vdbe)(unsafe.Pointer(p)).FzErrMsg)
(*Vdbe)(unsafe.Pointer(p)).FzErrMsg = uintptr(0)
}
- Xsqlite3RollbackAll(tls, db, (SQLITE_ABORT | (int32(2) << 8)))
+ Xsqlite3RollbackAll(tls, db, SQLITE_ABORT|int32(2)<<8)
Xsqlite3CloseSavepoints(tls, db)
(*Sqlite3)(unsafe.Pointer(db)).FautoCommit = U8(1)
- (*Vdbe)(unsafe.Pointer(p)).FnChange = 0
+ (*Vdbe)(unsafe.Pointer(p)).FnChange = int64(0)
}
}
// If this was an INSERT, UPDATE or DELETE and no statement transaction
// has been rolled back, update the database connection change-counter.
- if (Bft(int32(*(*uint16)(unsafe.Pointer(p + 152 /* &.changeCntOn */)) & 0x10 >> 4))) != 0 {
+ if Bft(int32(*(*uint16)(unsafe.Pointer(p + 160))&0x10>>4)) != 0 {
if eStatementOp != SAVEPOINT_ROLLBACK {
Xsqlite3VdbeSetChanges(tls, db, (*Vdbe)(unsafe.Pointer(p)).FnChange)
} else {
- Xsqlite3VdbeSetChanges(tls, db, 0)
+ Xsqlite3VdbeSetChanges(tls, db, int64(0))
}
- (*Vdbe)(unsafe.Pointer(p)).FnChange = 0
+ (*Vdbe)(unsafe.Pointer(p)).FnChange = int64(0)
}
// Release the locks
@@ -58874,10 +59600,10 @@ func Xsqlite3VdbeHalt(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:81925:20: *
// We have successfully halted and closed the VM. Record this fact.
if (*Vdbe)(unsafe.Pointer(p)).Fpc >= 0 {
(*Sqlite3)(unsafe.Pointer(db)).FnVdbeActive--
- if !((int32(*(*uint16)(unsafe.Pointer(p + 152 /* &.readOnly */)) & 0x80 >> 7)) != 0) {
+ if !(int32(*(*uint16)(unsafe.Pointer(p + 160))&0x80>>7) != 0) {
(*Sqlite3)(unsafe.Pointer(db)).FnVdbeWrite--
}
- if (Bft(int32(*(*uint16)(unsafe.Pointer(p + 152 /* &.bIsReader */)) & 0x100 >> 8))) != 0 {
+ if Bft(int32(*(*uint16)(unsafe.Pointer(p + 160))&0x100>>8)) != 0 {
(*Sqlite3)(unsafe.Pointer(db)).FnVdbeRead--
}
@@ -58905,7 +59631,7 @@ func Xsqlite3VdbeHalt(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:81925:20: *
// Each VDBE holds the result of the most recent sqlite3_step() call
// in p->rc. This routine sets that result back to SQLITE_OK.
-func Xsqlite3VdbeResetStepResult(tls *libc.TLS, p uintptr) { /* sqlite3.c:82126:21: */
+func Xsqlite3VdbeResetStepResult(tls *libc.TLS, p uintptr) { /* sqlite3.c:82396:21: */
(*Vdbe)(unsafe.Pointer(p)).Frc = SQLITE_OK
}
@@ -58915,7 +59641,7 @@ func Xsqlite3VdbeResetStepResult(tls *libc.TLS, p uintptr) { /* sqlite3.c:82126:
//
// This function does not clear the VDBE error code or message, just
// copies them to the database handle.
-func Xsqlite3VdbeTransferError(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:82138:20: */
+func Xsqlite3VdbeTransferError(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:82408:20: */
var db uintptr = (*Vdbe)(unsafe.Pointer(p)).Fdb
var rc int32 = (*Vdbe)(unsafe.Pointer(p)).Frc
if (*Vdbe)(unsafe.Pointer(p)).FzErrMsg != 0 {
@@ -58943,7 +59669,7 @@ func Xsqlite3VdbeTransferError(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:82
// To look at it another way, this routine resets the state of the
// virtual machine from VDBE_MAGIC_RUN or VDBE_MAGIC_HALT back to
// VDBE_MAGIC_INIT.
-func Xsqlite3VdbeReset(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:82187:20: */
+func Xsqlite3VdbeReset(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:82457:20: */
bp := tls.Alloc(8)
defer tls.Free(8)
@@ -58961,21 +59687,21 @@ func Xsqlite3VdbeReset(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:82187:20:
// instructions yet, leave the main database error information unchanged.
if (*Vdbe)(unsafe.Pointer(p)).Fpc >= 0 {
- if ((*Sqlite3)(unsafe.Pointer(db)).FpErr != 0) || ((*Vdbe)(unsafe.Pointer(p)).FzErrMsg != 0) {
+ if (*Sqlite3)(unsafe.Pointer(db)).FpErr != 0 || (*Vdbe)(unsafe.Pointer(p)).FzErrMsg != 0 {
Xsqlite3VdbeTransferError(tls, p)
} else {
(*Sqlite3)(unsafe.Pointer(db)).FerrCode = (*Vdbe)(unsafe.Pointer(p)).Frc
}
- if (Bft(int32(*(*uint16)(unsafe.Pointer(p + 152 /* &.runOnlyOnce */)) & 0x20 >> 5))) != 0 {
- libc.SetBitFieldPtr16Uint32(p+152 /* &.expired */, Bft(1), 0, 0x3)
+ if Bft(int32(*(*uint16)(unsafe.Pointer(p + 160))&0x20>>5)) != 0 {
+ libc.SetBitFieldPtr16Uint32(p+160, Bft(1), 0, 0x3)
}
- } else if ((*Vdbe)(unsafe.Pointer(p)).Frc != 0) && ((Bft(int32(*(*uint16)(unsafe.Pointer(p + 152 /* &.expired */)) & 0x3 >> 0))) != 0) {
+ } else if (*Vdbe)(unsafe.Pointer(p)).Frc != 0 && Bft(int32(*(*uint16)(unsafe.Pointer(p + 160))&0x3>>0)) != 0 {
// The expired flag was set on the VDBE before the first call
// to sqlite3_step(). For consistency (since sqlite3_step() was
// called), set the database error in this case as well.
Xsqlite3ErrorWithMsg(tls, db, (*Vdbe)(unsafe.Pointer(p)).Frc, func() uintptr {
if (*Vdbe)(unsafe.Pointer(p)).FzErrMsg != 0 {
- return ts + 2790 /* "%s" */
+ return ts + 3601 /* "%s" */
}
return uintptr(0)
}(), libc.VaList(bp, (*Vdbe)(unsafe.Pointer(p)).FzErrMsg))
@@ -58990,14 +59716,14 @@ func Xsqlite3VdbeReset(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:82187:20:
// Save profiling information from this VDBE run.
(*Vdbe)(unsafe.Pointer(p)).FiVdbeMagic = U32(VDBE_MAGIC_RESET)
- return ((*Vdbe)(unsafe.Pointer(p)).Frc & (*Sqlite3)(unsafe.Pointer(db)).FerrMask)
+ return (*Vdbe)(unsafe.Pointer(p)).Frc & (*Sqlite3)(unsafe.Pointer(db)).FerrMask
}
// Clean up and delete a VDBE after execution. Return an integer which is
// the result code. Write any error message text into *pzErrMsg.
-func Xsqlite3VdbeFinalize(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:82284:20: */
+func Xsqlite3VdbeFinalize(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:82554:20: */
var rc int32 = SQLITE_OK
- if ((*Vdbe)(unsafe.Pointer(p)).FiVdbeMagic == U32(VDBE_MAGIC_RUN)) || ((*Vdbe)(unsafe.Pointer(p)).FiVdbeMagic == U32(VDBE_MAGIC_HALT)) {
+ if (*Vdbe)(unsafe.Pointer(p)).FiVdbeMagic == U32(VDBE_MAGIC_RUN) || (*Vdbe)(unsafe.Pointer(p)).FiVdbeMagic == U32(VDBE_MAGIC_HALT) {
rc = Xsqlite3VdbeReset(tls, p)
}
@@ -59019,13 +59745,13 @@ func Xsqlite3VdbeFinalize(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:82284:2
//
// * the corresponding bit in argument mask is clear (where the first
// function parameter corresponds to bit 0 etc.).
-func Xsqlite3VdbeDeleteAuxData(tls *libc.TLS, db uintptr, pp uintptr, iOp int32, mask int32) { /* sqlite3.c:82310:21: */
+func Xsqlite3VdbeDeleteAuxData(tls *libc.TLS, db uintptr, pp uintptr, iOp int32, mask int32) { /* sqlite3.c:82580:21: */
for *(*uintptr)(unsafe.Pointer(pp)) != 0 {
var pAux uintptr = *(*uintptr)(unsafe.Pointer(pp))
- if (iOp < 0) ||
- ((((*AuxData)(unsafe.Pointer(pAux)).FiAuxOp == iOp) &&
- ((*AuxData)(unsafe.Pointer(pAux)).FiAuxArg >= 0)) &&
- (((*AuxData)(unsafe.Pointer(pAux)).FiAuxArg > 31) || !((uint32(mask) & (uint32((uint32(1))) << ((*AuxData)(unsafe.Pointer(pAux)).FiAuxArg))) != 0))) {
+ if iOp < 0 ||
+ (*AuxData)(unsafe.Pointer(pAux)).FiAuxOp == iOp &&
+ (*AuxData)(unsafe.Pointer(pAux)).FiAuxArg >= 0 &&
+ ((*AuxData)(unsafe.Pointer(pAux)).FiAuxArg > 31 || !(uint32(mask)&(uint32(uint32(1))<<(*AuxData)(unsafe.Pointer(pAux)).FiAuxArg) != 0)) {
if (*AuxData)(unsafe.Pointer(pAux)).FxDeleteAux != 0 {
(*struct{ f func(*libc.TLS, uintptr) })(unsafe.Pointer(&struct{ uintptr }{(*AuxData)(unsafe.Pointer(pAux)).FxDeleteAux})).f(tls, (*AuxData)(unsafe.Pointer(pAux)).FpAux)
@@ -59033,7 +59759,7 @@ func Xsqlite3VdbeDeleteAuxData(tls *libc.TLS, db uintptr, pp uintptr, iOp int32,
*(*uintptr)(unsafe.Pointer(pp)) = (*AuxData)(unsafe.Pointer(pAux)).FpNextAux
Xsqlite3DbFree(tls, db, pAux)
} else {
- pp = (pAux + 16 /* &.pNextAux */)
+ pp = pAux + 16
}
}
}
@@ -59044,11 +59770,11 @@ func Xsqlite3VdbeDeleteAuxData(tls *libc.TLS, db uintptr, pp uintptr, iOp int32,
// The difference between this function and sqlite3VdbeDelete() is that
// VdbeDelete() also unlinks the Vdbe from the list of VMs associated with
// the database connection and frees the object itself.
-func Xsqlite3VdbeClearObject(tls *libc.TLS, db uintptr, p uintptr) { /* sqlite3.c:82338:21: */
+func Xsqlite3VdbeClearObject(tls *libc.TLS, db uintptr, p uintptr) { /* sqlite3.c:82608:21: */
var pSub uintptr
var pNext uintptr
- releaseMemArray(tls, (*Vdbe)(unsafe.Pointer(p)).FaColName, (int32((*Vdbe)(unsafe.Pointer(p)).FnResColumn) * COLNAME_N))
+ releaseMemArray(tls, (*Vdbe)(unsafe.Pointer(p)).FaColName, int32((*Vdbe)(unsafe.Pointer(p)).FnResColumn)*COLNAME_N)
for pSub = (*Vdbe)(unsafe.Pointer(p)).FpProgram; pSub != 0; pSub = pNext {
pNext = (*SubProgram)(unsafe.Pointer(pSub)).FpNext
vdbeFreeOpArray(tls, db, (*SubProgram)(unsafe.Pointer(pSub)).FaOp, (*SubProgram)(unsafe.Pointer(pSub)).FnOp)
@@ -59065,7 +59791,7 @@ func Xsqlite3VdbeClearObject(tls *libc.TLS, db uintptr, p uintptr) { /* sqlite3.
}
// Delete an entire VDBE.
-func Xsqlite3VdbeDelete(tls *libc.TLS, p uintptr) { /* sqlite3.c:82379:21: */
+func Xsqlite3VdbeDelete(tls *libc.TLS, p uintptr) { /* sqlite3.c:82649:21: */
var db uintptr
db = (*Vdbe)(unsafe.Pointer(p)).Fdb
@@ -59088,7 +59814,7 @@ func Xsqlite3VdbeDelete(tls *libc.TLS, p uintptr) { /* sqlite3.c:82379:21: */
// The cursor "p" has a pending seek operation that has not yet been
// carried out. Seek the cursor now. If an error occurs, return
// the appropriate error code.
-func Xsqlite3VdbeFinishMoveto(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:82405:36: */
+func Xsqlite3VdbeFinishMoveto(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:82675:36: */
bp := tls.Alloc(4)
defer tls.Free(4)
@@ -59096,12 +59822,12 @@ func Xsqlite3VdbeFinishMoveto(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:824
var rc int32
- rc = Xsqlite3BtreeMovetoUnpacked(tls, *(*uintptr)(unsafe.Pointer(p + 40 /* &.uc */)), uintptr(0), (*VdbeCursor)(unsafe.Pointer(p)).FmovetoTarget, 0, bp /* &res */)
+ rc = Xsqlite3BtreeTableMoveto(tls, *(*uintptr)(unsafe.Pointer(p + 40)), (*VdbeCursor)(unsafe.Pointer(p)).FmovetoTarget, 0, bp /* &res */)
if rc != 0 {
return rc
}
- if *(*int32)(unsafe.Pointer(bp /* res */)) != 0 {
- return Xsqlite3CorruptError(tls, 82415)
+ if *(*int32)(unsafe.Pointer(bp)) != 0 {
+ return Xsqlite3CorruptError(tls, 82685)
}
(*VdbeCursor)(unsafe.Pointer(p)).FdeferredMoveto = U8(0)
(*VdbeCursor)(unsafe.Pointer(p)).FcacheStatus = U32(CACHE_STALE)
@@ -59113,7 +59839,7 @@ func Xsqlite3VdbeFinishMoveto(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:824
// rebalanced. Whatever the cause, try to restore "p" to the place it
// is supposed to be pointing. If the row was deleted out from under the
// cursor, set the cursor to point to a NULL row.
-func handleMovedCursor(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:82431:28: */
+func handleMovedCursor(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:82701:28: */
bp := tls.Alloc(4)
defer tls.Free(4)
@@ -59121,9 +59847,9 @@ func handleMovedCursor(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:82431:28:
var rc int32
- rc = Xsqlite3BtreeCursorRestore(tls, *(*uintptr)(unsafe.Pointer(p + 40 /* &.uc */)), bp /* &isDifferentRow */)
+ rc = Xsqlite3BtreeCursorRestore(tls, *(*uintptr)(unsafe.Pointer(p + 40)), bp /* &isDifferentRow */)
(*VdbeCursor)(unsafe.Pointer(p)).FcacheStatus = U32(CACHE_STALE)
- if *(*int32)(unsafe.Pointer(bp /* isDifferentRow */)) != 0 {
+ if *(*int32)(unsafe.Pointer(bp)) != 0 {
(*VdbeCursor)(unsafe.Pointer(p)).FnullRow = U8(1)
}
return rc
@@ -59131,9 +59857,9 @@ func handleMovedCursor(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:82431:28:
// Check to ensure that the cursor is valid. Restore the cursor
// if need be. Return any I/O error from the restore operation.
-func Xsqlite3VdbeCursorRestore(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:82446:20: */
+func Xsqlite3VdbeCursorRestore(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:82716:20: */
- if Xsqlite3BtreeCursorHasMoved(tls, *(*uintptr)(unsafe.Pointer(p + 40 /* &.uc */))) != 0 {
+ if Xsqlite3BtreeCursorHasMoved(tls, *(*uintptr)(unsafe.Pointer(p + 40))) != 0 {
return handleMovedCursor(tls, p)
}
return SQLITE_OK
@@ -59150,20 +59876,20 @@ func Xsqlite3VdbeCursorRestore(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:82
//
// If the cursor is already pointing to the correct row and that row has
// not been deleted out from under the cursor, then this routine is a no-op.
-func Xsqlite3VdbeCursorMoveto(tls *libc.TLS, pp uintptr, piCol uintptr) int32 { /* sqlite3.c:82467:20: */
+func Xsqlite3VdbeCursorMoveto(tls *libc.TLS, pp uintptr, piCol uintptr) int32 { /* sqlite3.c:82737:20: */
var p uintptr = *(*uintptr)(unsafe.Pointer(pp))
if (*VdbeCursor)(unsafe.Pointer(p)).FdeferredMoveto != 0 {
var iMap U32
- if (((*VdbeCursor)(unsafe.Pointer(p)).FaAltMap != 0) && ((libc.AssignUint32(&iMap, *(*U32)(unsafe.Pointer((*VdbeCursor)(unsafe.Pointer(p)).FaAltMap + uintptr((U32(1)+*(*U32)(unsafe.Pointer(piCol))))*4)))) > U32(0))) && !(int32((*VdbeCursor)(unsafe.Pointer(p)).FnullRow) != 0) {
+ if (*VdbeCursor)(unsafe.Pointer(p)).FaAltMap != 0 && libc.AssignUint32(&iMap, *(*U32)(unsafe.Pointer((*VdbeCursor)(unsafe.Pointer(p)).FaAltMap + uintptr(U32(1)+*(*U32)(unsafe.Pointer(piCol)))*4))) > U32(0) && !(int32((*VdbeCursor)(unsafe.Pointer(p)).FnullRow) != 0) {
*(*uintptr)(unsafe.Pointer(pp)) = (*VdbeCursor)(unsafe.Pointer(p)).FpAltCursor
- *(*U32)(unsafe.Pointer(piCol)) = (iMap - U32(1))
+ *(*U32)(unsafe.Pointer(piCol)) = iMap - U32(1)
return SQLITE_OK
}
return Xsqlite3VdbeFinishMoveto(tls, p)
}
- if Xsqlite3BtreeCursorHasMoved(tls, *(*uintptr)(unsafe.Pointer(p + 40 /* &.uc */))) != 0 {
+ if Xsqlite3BtreeCursorHasMoved(tls, *(*uintptr)(unsafe.Pointer(p + 40))) != 0 {
return handleMovedCursor(tls, p)
}
return SQLITE_OK
@@ -59225,12 +59951,12 @@ var sqlite3SmallTypeSizes = [128]U8{
/* 100 */ U8(44), U8(44), U8(45), U8(45), U8(46), U8(46), U8(47), U8(47), U8(48), U8(48),
/* 110 */ U8(49), U8(49), U8(50), U8(50), U8(51), U8(51), U8(52), U8(52), U8(53), U8(53),
/* 120 */ U8(54), U8(54), U8(55), U8(55), U8(56), U8(56), U8(57), U8(57),
-} /* sqlite3.c:82604:17 */
+} /* sqlite3.c:82874:17 */
// Return the length of the data corresponding to the supplied serial-type.
-func Xsqlite3VdbeSerialTypeLen(tls *libc.TLS, serial_type U32) U32 { /* sqlite3.c:82624:20: */
+func Xsqlite3VdbeSerialTypeLen(tls *libc.TLS, serial_type U32) U32 { /* sqlite3.c:82894:20: */
if serial_type >= U32(128) {
- return ((serial_type - U32(12)) / U32(2))
+ return (serial_type - U32(12)) / U32(2)
} else {
return U32(sqlite3SmallTypeSizes[serial_type])
@@ -59238,7 +59964,7 @@ func Xsqlite3VdbeSerialTypeLen(tls *libc.TLS, serial_type U32) U32 { /* sqlite3.
return U32(0)
}
-func Xsqlite3VdbeOneByteSerialTypeLen(tls *libc.TLS, serial_type U8) U8 { /* sqlite3.c:82633:19: */
+func Xsqlite3VdbeOneByteSerialTypeLen(tls *libc.TLS, serial_type U8) U8 { /* sqlite3.c:82903:19: */
return sqlite3SmallTypeSizes[serial_type]
}
@@ -59287,28 +60013,28 @@ func Xsqlite3VdbeOneByteSerialTypeLen(tls *libc.TLS, serial_type U8) U8 { /* sql
// Return the number of bytes actually written into buf[]. The number
// of bytes in the zero-filled tail is included in the return value only
// if those bytes were zeroed in buf[].
-func Xsqlite3VdbeSerialPut(tls *libc.TLS, buf uintptr, pMem uintptr, serial_type U32) U32 { /* sqlite3.c:82704:20: */
+func Xsqlite3VdbeSerialPut(tls *libc.TLS, buf uintptr, pMem uintptr, serial_type U32) U32 { /* sqlite3.c:82974:20: */
bp := tls.Alloc(8)
defer tls.Free(8)
var len U32
// Integer and Real
- if (serial_type <= U32(7)) && (serial_type > U32(0)) {
+ if serial_type <= U32(7) && serial_type > U32(0) {
// var v U64 at bp, 8
var i U32
if serial_type == U32(7) {
- libc.Xmemcpy(tls, bp /* &v */, (pMem /* &.u */ /* &.r */), uint32(unsafe.Sizeof(U64(0))))
+ libc.Xmemcpy(tls, bp /* &v */, pMem, uint32(unsafe.Sizeof(U64(0))))
} else {
- *(*U64)(unsafe.Pointer(bp /* v */)) = U64(*(*I64)(unsafe.Pointer(pMem /* &.u */)))
+ *(*U64)(unsafe.Pointer(bp /* v */)) = U64(*(*I64)(unsafe.Pointer(pMem)))
}
len = libc.AssignUint32(&i, U32(sqlite3SmallTypeSizes[serial_type]))
for ok := true; ok; ok = i != 0 {
- *(*U8)(unsafe.Pointer(buf + uintptr(libc.PreDecUint32(&i, 1)))) = (U8(*(*U64)(unsafe.Pointer(bp /* v */)) & uint64(0xFF)))
+ *(*U8)(unsafe.Pointer(buf + uintptr(libc.PreDecUint32(&i, 1)))) = U8(*(*U64)(unsafe.Pointer(bp)) & uint64(0xFF))
*(*U64)(unsafe.Pointer(bp /* v */)) >>= 8
}
return len
@@ -59338,26 +60064,26 @@ func Xsqlite3VdbeSerialPut(tls *libc.TLS, buf uintptr, pMem uintptr, serial_type
// The few cases that require local variables are broken out into a separate
// routine so that in most cases the overhead of moving the stack pointer
// is avoided.
-func serialGet(tls *libc.TLS, buf uintptr, serial_type U32, pMem uintptr) U32 { /* sqlite3.c:82758:12: */
+func serialGet(tls *libc.TLS, buf uintptr, serial_type U32, pMem uintptr) U32 { /* sqlite3.c:83028:12: */
bp := tls.Alloc(8)
defer tls.Free(8)
- *(*U64)(unsafe.Pointer(bp /* x */)) = (U64((((U32(*(*uint8)(unsafe.Pointer((buf)))) << 24) | (U32(int32(*(*uint8)(unsafe.Pointer((buf) + 1))) << 16))) | (U32(int32(*(*uint8)(unsafe.Pointer((buf) + 2))) << 8))) | U32(*(*uint8)(unsafe.Pointer((buf) + 3)))))
- var y U32 = ((((U32(*(*uint8)(unsafe.Pointer((buf + uintptr(4))))) << 24) | (U32(int32(*(*uint8)(unsafe.Pointer((buf + uintptr(4)) + 1))) << 16))) | (U32(int32(*(*uint8)(unsafe.Pointer((buf + uintptr(4)) + 2))) << 8))) | U32(*(*uint8)(unsafe.Pointer((buf + uintptr(4)) + 3))))
- *(*U64)(unsafe.Pointer(bp /* x */)) = ((*(*U64)(unsafe.Pointer(bp /* x */)) << 32) + U64(y))
+ *(*U64)(unsafe.Pointer(bp /* x */)) = U64(U32(*(*uint8)(unsafe.Pointer(buf)))<<24 | U32(int32(*(*uint8)(unsafe.Pointer(buf + 1)))<<16) | U32(int32(*(*uint8)(unsafe.Pointer(buf + 2)))<<8) | U32(*(*uint8)(unsafe.Pointer(buf + 3))))
+ var y U32 = U32(*(*uint8)(unsafe.Pointer(buf + uintptr(4))))<<24 | U32(int32(*(*uint8)(unsafe.Pointer(buf + uintptr(4) + 1)))<<16) | U32(int32(*(*uint8)(unsafe.Pointer(buf + uintptr(4) + 2)))<<8) | U32(*(*uint8)(unsafe.Pointer(buf + uintptr(4) + 3)))
+ *(*U64)(unsafe.Pointer(bp /* x */)) = *(*U64)(unsafe.Pointer(bp))<<32 + U64(y)
if serial_type == U32(6) {
// EVIDENCE-OF: R-29851-52272 Value is a big-endian 64-bit
// twos-complement integer.
- *(*I64)(unsafe.Pointer(pMem /* &.u */)) = *(*I64)(unsafe.Pointer(bp /* &x */))
+ *(*I64)(unsafe.Pointer(pMem)) = *(*I64)(unsafe.Pointer(bp /* &x */))
(*Mem)(unsafe.Pointer(pMem)).Fflags = U16(MEM_Int)
} else {
// EVIDENCE-OF: R-57343-49114 Value is a big-endian IEEE 754-2008 64-bit
// floating point number.
- libc.Xmemcpy(tls, (pMem /* &.u */ /* &.r */), bp /* &x */, uint32(unsafe.Sizeof(U64(0))))
+ libc.Xmemcpy(tls, pMem, bp /* &x */, uint32(unsafe.Sizeof(U64(0))))
(*Mem)(unsafe.Pointer(pMem)).Fflags = func() uint16 {
- if (((*(*U64)(unsafe.Pointer(bp /* x */))) & (U64((uint64(0x7ff))) << 52)) == (U64((uint64(0x7ff))) << 52)) && (((*(*U64)(unsafe.Pointer(bp /* x */))) & ((U64((uint64(1))) << 52) - uint64(1))) != uint64(0)) {
+ if *(*U64)(unsafe.Pointer(bp))&(U64(uint64(0x7ff))<<52) == U64(uint64(0x7ff))<<52 && *(*U64)(unsafe.Pointer(bp))&(U64(uint64(1))<<52-uint64(1)) != uint64(0) {
return uint16(MEM_Null)
}
return uint16(MEM_Real)
@@ -59366,14 +60092,14 @@ func serialGet(tls *libc.TLS, buf uintptr, serial_type U32, pMem uintptr) U32 {
return U32(8)
}
-func Xsqlite3VdbeSerialGet(tls *libc.TLS, buf uintptr, serial_type U32, pMem uintptr) U32 { /* sqlite3.c:82794:20: */
+func Xsqlite3VdbeSerialGet(tls *libc.TLS, buf uintptr, serial_type U32, pMem uintptr) U32 { /* sqlite3.c:83064:20: */
switch serial_type {
case U32(10):
{ // Internal use only: NULL with virtual table
// UPDATE no-change flag set
- (*Mem)(unsafe.Pointer(pMem)).Fflags = (U16(MEM_Null | MEM_Zero))
+ (*Mem)(unsafe.Pointer(pMem)).Fflags = U16(MEM_Null | MEM_Zero)
(*Mem)(unsafe.Pointer(pMem)).Fn = 0
- *(*int32)(unsafe.Pointer(pMem /* &.u */)) = 0
+ *(*int32)(unsafe.Pointer(pMem)) = 0
break
}
@@ -59390,7 +60116,7 @@ func Xsqlite3VdbeSerialGet(tls *libc.TLS, buf uintptr, serial_type U32, pMem uin
{
// EVIDENCE-OF: R-44885-25196 Value is an 8-bit twos-complement
// integer.
- *(*I64)(unsafe.Pointer(pMem /* &.u */)) = I64(I8(*(*uint8)(unsafe.Pointer((buf)))))
+ *(*I64)(unsafe.Pointer(pMem)) = I64(I8(*(*uint8)(unsafe.Pointer(buf))))
(*Mem)(unsafe.Pointer(pMem)).Fflags = U16(MEM_Int)
return U32(1)
@@ -59400,7 +60126,7 @@ func Xsqlite3VdbeSerialGet(tls *libc.TLS, buf uintptr, serial_type U32, pMem uin
{ // 2-byte signed integer
// EVIDENCE-OF: R-49794-35026 Value is a big-endian 16-bit
// twos-complement integer.
- *(*I64)(unsafe.Pointer(pMem /* &.u */)) = (I64((256 * int32((I8(*(*uint8)(unsafe.Pointer((buf))))))) | int32(*(*uint8)(unsafe.Pointer((buf) + 1)))))
+ *(*I64)(unsafe.Pointer(pMem)) = I64(256*int32(I8(*(*uint8)(unsafe.Pointer(buf)))) | int32(*(*uint8)(unsafe.Pointer(buf + 1))))
(*Mem)(unsafe.Pointer(pMem)).Fflags = U16(MEM_Int)
return U32(2)
@@ -59410,7 +60136,7 @@ func Xsqlite3VdbeSerialGet(tls *libc.TLS, buf uintptr, serial_type U32, pMem uin
{ // 3-byte signed integer
// EVIDENCE-OF: R-37839-54301 Value is a big-endian 24-bit
// twos-complement integer.
- *(*I64)(unsafe.Pointer(pMem /* &.u */)) = (I64(((65536 * int32((I8(*(*uint8)(unsafe.Pointer((buf))))))) | (int32(*(*uint8)(unsafe.Pointer((buf) + 1))) << 8)) | int32(*(*uint8)(unsafe.Pointer((buf) + 2)))))
+ *(*I64)(unsafe.Pointer(pMem)) = I64(65536*int32(I8(*(*uint8)(unsafe.Pointer(buf)))) | int32(*(*uint8)(unsafe.Pointer(buf + 1)))<<8 | int32(*(*uint8)(unsafe.Pointer(buf + 2))))
(*Mem)(unsafe.Pointer(pMem)).Fflags = U16(MEM_Int)
return U32(3)
@@ -59420,7 +60146,7 @@ func Xsqlite3VdbeSerialGet(tls *libc.TLS, buf uintptr, serial_type U32, pMem uin
{ // 4-byte signed integer
// EVIDENCE-OF: R-01849-26079 Value is a big-endian 32-bit
// twos-complement integer.
- *(*I64)(unsafe.Pointer(pMem /* &.u */)) = (I64((((16777216 * int32((I8(*(*uint8)(unsafe.Pointer((buf))))))) | (int32(*(*uint8)(unsafe.Pointer((buf) + 1))) << 16)) | (int32(*(*uint8)(unsafe.Pointer((buf) + 2))) << 8)) | int32(*(*uint8)(unsafe.Pointer((buf) + 3)))))
+ *(*I64)(unsafe.Pointer(pMem)) = I64(16777216*int32(I8(*(*uint8)(unsafe.Pointer(buf)))) | int32(*(*uint8)(unsafe.Pointer(buf + 1)))<<16 | int32(*(*uint8)(unsafe.Pointer(buf + 2)))<<8 | int32(*(*uint8)(unsafe.Pointer(buf + 3))))
(*Mem)(unsafe.Pointer(pMem)).Fflags = U16(MEM_Int)
return U32(4)
@@ -59430,7 +60156,7 @@ func Xsqlite3VdbeSerialGet(tls *libc.TLS, buf uintptr, serial_type U32, pMem uin
{ // 6-byte signed integer
// EVIDENCE-OF: R-50385-09674 Value is a big-endian 48-bit
// twos-complement integer.
- *(*I64)(unsafe.Pointer(pMem /* &.u */)) = ((I64((((U32(*(*uint8)(unsafe.Pointer((buf + uintptr(2))))) << 24) | (U32(int32(*(*uint8)(unsafe.Pointer((buf + uintptr(2)) + 1))) << 16))) | (U32(int32(*(*uint8)(unsafe.Pointer((buf + uintptr(2)) + 2))) << 8))) | U32(*(*uint8)(unsafe.Pointer((buf + uintptr(2)) + 3))))) + ((I64((int64(1))) << 32) * (I64((256 * int32((I8(*(*uint8)(unsafe.Pointer((buf))))))) | int32(*(*uint8)(unsafe.Pointer((buf) + 1)))))))
+ *(*I64)(unsafe.Pointer(pMem)) = I64(U32(*(*uint8)(unsafe.Pointer(buf + uintptr(2))))<<24|U32(int32(*(*uint8)(unsafe.Pointer(buf + uintptr(2) + 1)))<<16)|U32(int32(*(*uint8)(unsafe.Pointer(buf + uintptr(2) + 2)))<<8)|U32(*(*uint8)(unsafe.Pointer(buf + uintptr(2) + 3)))) + I64(int64(1))<<32*I64(256*int32(I8(*(*uint8)(unsafe.Pointer(buf))))|int32(*(*uint8)(unsafe.Pointer(buf + 1))))
(*Mem)(unsafe.Pointer(pMem)).Fflags = U16(MEM_Int)
return U32(6)
@@ -59451,7 +60177,7 @@ func Xsqlite3VdbeSerialGet(tls *libc.TLS, buf uintptr, serial_type U32, pMem uin
{ // Integer 1
// EVIDENCE-OF: R-12976-22893 Value is the integer 0.
// EVIDENCE-OF: R-18143-12121 Value is the integer 1.
- *(*I64)(unsafe.Pointer(pMem /* &.u */)) = (I64(serial_type - U32(8)))
+ *(*I64)(unsafe.Pointer(pMem)) = I64(serial_type - U32(8))
(*Mem)(unsafe.Pointer(pMem)).Fflags = U16(MEM_Int)
return U32(0)
@@ -59459,8 +60185,8 @@ func Xsqlite3VdbeSerialGet(tls *libc.TLS, buf uintptr, serial_type U32, pMem uin
default:
{
(*Mem)(unsafe.Pointer(pMem)).Fz = buf
- (*Mem)(unsafe.Pointer(pMem)).Fn = (int32((serial_type - U32(12)) / U32(2)))
- (*Mem)(unsafe.Pointer(pMem)).Fflags = aFlag[(serial_type & U32(1))]
+ (*Mem)(unsafe.Pointer(pMem)).Fn = int32((serial_type - U32(12)) / U32(2))
+ (*Mem)(unsafe.Pointer(pMem)).Fflags = aFlag[serial_type&U32(1)]
return U32((*Mem)(unsafe.Pointer(pMem)).Fn)
}
@@ -59468,7 +60194,7 @@ func Xsqlite3VdbeSerialGet(tls *libc.TLS, buf uintptr, serial_type U32, pMem uin
return U32(0)
}
-var aFlag = [2]U16{(U16(MEM_Blob | MEM_Ephem)), (U16(MEM_Str | MEM_Ephem))} /* sqlite3.c:82876:24 */
+var aFlag = [2]U16{U16(MEM_Blob | MEM_Ephem), U16(MEM_Str | MEM_Ephem)} /* sqlite3.c:83146:24 */
// This routine is used to allocate sufficient space for an UnpackedRecord
// structure large enough to be used with sqlite3VdbeRecordUnpack() if
@@ -59482,25 +60208,25 @@ var aFlag = [2]U16{(U16(MEM_Blob | MEM_Ephem)), (U16(MEM_Str | MEM_Ephem))} /* s
// before returning.
//
// If an OOM error occurs, NULL is returned.
-func Xsqlite3VdbeAllocUnpackedRecord(tls *libc.TLS, pKeyInfo uintptr) uintptr { /* sqlite3.c:82899:31: */
+func Xsqlite3VdbeAllocUnpackedRecord(tls *libc.TLS, pKeyInfo uintptr) uintptr { /* sqlite3.c:83169:31: */
var p uintptr // Unpacked record to return
var nByte int32 // Number of bytes required for *p
- nByte = (int32((((uint32(unsafe.Sizeof(UnpackedRecord{}))) + uint32(7)) & libc.Uint32FromInt32(libc.CplInt32(7))) + (uint32(unsafe.Sizeof(Mem{})) * (uint32(int32((*KeyInfo)(unsafe.Pointer(pKeyInfo)).FnKeyField) + 1)))))
+ nByte = int32((uint32(unsafe.Sizeof(UnpackedRecord{}))+uint32(7))&libc.Uint32FromInt32(libc.CplInt32(7)) + uint32(unsafe.Sizeof(Mem{}))*uint32(int32((*KeyInfo)(unsafe.Pointer(pKeyInfo)).FnKeyField)+1))
p = Xsqlite3DbMallocRaw(tls, (*KeyInfo)(unsafe.Pointer(pKeyInfo)).Fdb, uint64(nByte))
if !(p != 0) {
return uintptr(0)
}
- (*UnpackedRecord)(unsafe.Pointer(p)).FaMem = ((p) + 16)
+ (*UnpackedRecord)(unsafe.Pointer(p)).FaMem = p + 16
(*UnpackedRecord)(unsafe.Pointer(p)).FpKeyInfo = pKeyInfo
- (*UnpackedRecord)(unsafe.Pointer(p)).FnField = (U16(int32((*KeyInfo)(unsafe.Pointer(pKeyInfo)).FnKeyField) + 1))
+ (*UnpackedRecord)(unsafe.Pointer(p)).FnField = U16(int32((*KeyInfo)(unsafe.Pointer(pKeyInfo)).FnKeyField) + 1)
return p
}
// Given the nKey-byte encoding of a record in pKey[], populate the
// UnpackedRecord structure indicated by the fourth argument with the
// contents of the decoded record.
-func Xsqlite3VdbeRecordUnpack(tls *libc.TLS, pKeyInfo uintptr, nKey int32, pKey uintptr, p uintptr) { /* sqlite3.c:82919:21: */
+func Xsqlite3VdbeRecordUnpack(tls *libc.TLS, pKeyInfo uintptr, nKey int32, pKey uintptr, p uintptr) { /* sqlite3.c:83189:21: */
bp := tls.Alloc(8)
defer tls.Free(8)
@@ -59516,44 +60242,41 @@ func Xsqlite3VdbeRecordUnpack(tls *libc.TLS, pKeyInfo uintptr, nKey int32, pKey
idx = U32(func() uint8 {
if int32(*(*uint8)(unsafe.Pointer(aKey))) < int32(U8(0x80)) {
- return uint8(func() int32 {
- (*(*U32)(unsafe.Pointer(bp /* szHdr */))) = U32(*(*uint8)(unsafe.Pointer(aKey)))
- return 1
- }())
+ return uint8(func() int32 { *(*U32)(unsafe.Pointer(bp)) = U32(*(*uint8)(unsafe.Pointer(aKey))); return 1 }())
}
- return Xsqlite3GetVarint32(tls, aKey, bp /* &szHdr */)
+ return Xsqlite3GetVarint32(tls, aKey, bp)
}())
d = *(*U32)(unsafe.Pointer(bp /* szHdr */))
u = U16(0)
- for (idx < *(*U32)(unsafe.Pointer(bp /* szHdr */))) && (d <= U32(nKey)) {
+ for idx < *(*U32)(unsafe.Pointer(bp)) && d <= U32(nKey) {
// var serial_type U32 at bp+4, 4
- idx = idx + (U32(func() uint8 {
- if int32(*(*uint8)(unsafe.Pointer((aKey + uintptr(idx))))) < int32(U8(0x80)) {
+ idx = idx + U32(func() uint8 {
+ if int32(*(*uint8)(unsafe.Pointer(aKey + uintptr(idx)))) < int32(U8(0x80)) {
return uint8(func() int32 {
- (*(*U32)(unsafe.Pointer(bp + 4 /* serial_type */))) = U32(*(*uint8)(unsafe.Pointer((aKey + uintptr(idx)))))
+ *(*U32)(unsafe.Pointer(bp + 4)) = U32(*(*uint8)(unsafe.Pointer(aKey + uintptr(idx))))
return 1
}())
}
- return Xsqlite3GetVarint32(tls, (aKey + uintptr(idx)), bp+4 /* &serial_type */)
- }()))
+ return Xsqlite3GetVarint32(tls, aKey+uintptr(idx), bp+4)
+ }())
(*Mem)(unsafe.Pointer(pMem)).Fenc = (*KeyInfo)(unsafe.Pointer(pKeyInfo)).Fenc
(*Mem)(unsafe.Pointer(pMem)).Fdb = (*KeyInfo)(unsafe.Pointer(pKeyInfo)).Fdb
// pMem->flags = 0; // sqlite3VdbeSerialGet() will set this for us
(*Mem)(unsafe.Pointer(pMem)).FszMalloc = 0
(*Mem)(unsafe.Pointer(pMem)).Fz = uintptr(0)
- d = d + (Xsqlite3VdbeSerialGet(tls, (aKey + uintptr(d)), *(*U32)(unsafe.Pointer(bp + 4 /* serial_type */)), pMem))
+ d = d + Xsqlite3VdbeSerialGet(tls, aKey+uintptr(d), *(*U32)(unsafe.Pointer(bp + 4)), pMem)
pMem += 40
- if (int32(libc.PreIncUint16(&u, 1))) >= int32((*UnpackedRecord)(unsafe.Pointer(p)).FnField) {
+ if int32(libc.PreIncUint16(&u, 1)) >= int32((*UnpackedRecord)(unsafe.Pointer(p)).FnField) {
break
}
}
- if (d > U32(nKey)) && (u != 0) {
+ if d > U32(nKey) && u != 0 {
// In a corrupt record entry, the last pMem might have been set up using
// uninitialized memory. Overwrite its value with NULL, to prevent
// warnings from MSAN.
- Xsqlite3VdbeMemSetNull(tls, (pMem - uintptr(1)*40))
+ Xsqlite3VdbeMemSetNull(tls, pMem-uintptr(1)*40)
}
(*UnpackedRecord)(unsafe.Pointer(p)).FnField = u
@@ -59563,7 +60286,7 @@ func Xsqlite3VdbeRecordUnpack(tls *libc.TLS, pKeyInfo uintptr, nKey int32, pKey
// using the collation sequence pColl. As usual, return a negative , zero
// or positive value if *pMem1 is less than, equal to or greater than
// *pMem2, respectively. Similar in spirit to "rc = (*pMem1) - (*pMem2);".
-func vdbeCompareMemString(tls *libc.TLS, pMem1 uintptr, pMem2 uintptr, pColl uintptr, prcErr uintptr) int32 { /* sqlite3.c:83114:12: */
+func vdbeCompareMemString(tls *libc.TLS, pMem1 uintptr, pMem2 uintptr, pColl uintptr, prcErr uintptr) int32 { /* sqlite3.c:83384:12: */
bp := tls.Alloc(80)
defer tls.Free(80)
@@ -59587,7 +60310,7 @@ func vdbeCompareMemString(tls *libc.TLS, pMem1 uintptr, pMem2 uintptr, pColl uin
Xsqlite3VdbeMemShallowCopy(tls, bp+40 /* &c2 */, pMem2, MEM_Ephem)
v1 = Xsqlite3ValueText(tls, bp /* &c1 */, (*CollSeq)(unsafe.Pointer(pColl)).Fenc)
v2 = Xsqlite3ValueText(tls, bp+40 /* &c2 */, (*CollSeq)(unsafe.Pointer(pColl)).Fenc)
- if (v1 == uintptr(0)) || (v2 == uintptr(0)) {
+ if v1 == uintptr(0) || v2 == uintptr(0) {
if prcErr != 0 {
*(*U8)(unsafe.Pointer(prcErr)) = U8(SQLITE_NOMEM)
}
@@ -59606,7 +60329,7 @@ func vdbeCompareMemString(tls *libc.TLS, pMem1 uintptr, pMem2 uintptr, pColl uin
// The input pBlob is guaranteed to be a Blob that is not marked
// with MEM_Zero. Return true if it could be a zero-blob.
-func isAllZero(tls *libc.TLS, z uintptr, n int32) int32 { /* sqlite3.c:83151:12: */
+func isAllZero(tls *libc.TLS, z uintptr, n int32) int32 { /* sqlite3.c:83421:12: */
var i int32
for i = 0; i < n; i++ {
if *(*uint8)(unsafe.Pointer(z + uintptr(i))) != 0 {
@@ -59619,7 +60342,7 @@ func isAllZero(tls *libc.TLS, z uintptr, n int32) int32 { /* sqlite3.c:83151:12:
// Compare two blobs. Return negative, zero, or positive if the first
// is less than, equal to, or greater than the second, respectively.
// If one blob is a prefix of the other, then the shorter is the lessor.
-func Xsqlite3BlobCompare(tls *libc.TLS, pB1 uintptr, pB2 uintptr) int32 { /* sqlite3.c:83164:36: */
+func Xsqlite3BlobCompare(tls *libc.TLS, pB1 uintptr, pB2 uintptr) int32 { /* sqlite3.c:83434:36: */
var c int32
var n1 int32 = (*Mem)(unsafe.Pointer(pB1)).Fn
var n2 int32 = (*Mem)(unsafe.Pointer(pB2)).Fn
@@ -59629,19 +60352,19 @@ func Xsqlite3BlobCompare(tls *libc.TLS, pB1 uintptr, pB2 uintptr) int32 { /* sql
// by the OP_MakeRecord opcode, and such Blobs never get passed into
// sqlite3MemCompare().
- if ((int32((*Mem)(unsafe.Pointer(pB1)).Fflags) | int32((*Mem)(unsafe.Pointer(pB2)).Fflags)) & MEM_Zero) != 0 {
- if ((int32((*Mem)(unsafe.Pointer(pB1)).Fflags) & int32((*Mem)(unsafe.Pointer(pB2)).Fflags)) & MEM_Zero) != 0 {
- return (*(*int32)(unsafe.Pointer(pB1 /* &.u */)) - *(*int32)(unsafe.Pointer(pB2 /* &.u */)))
- } else if (int32((*Mem)(unsafe.Pointer(pB1)).Fflags) & MEM_Zero) != 0 {
+ if (int32((*Mem)(unsafe.Pointer(pB1)).Fflags)|int32((*Mem)(unsafe.Pointer(pB2)).Fflags))&MEM_Zero != 0 {
+ if int32((*Mem)(unsafe.Pointer(pB1)).Fflags)&int32((*Mem)(unsafe.Pointer(pB2)).Fflags)&MEM_Zero != 0 {
+ return *(*int32)(unsafe.Pointer(pB1)) - *(*int32)(unsafe.Pointer(pB2))
+ } else if int32((*Mem)(unsafe.Pointer(pB1)).Fflags)&MEM_Zero != 0 {
if !(isAllZero(tls, (*Mem)(unsafe.Pointer(pB2)).Fz, (*Mem)(unsafe.Pointer(pB2)).Fn) != 0) {
return -1
}
- return (*(*int32)(unsafe.Pointer(pB1 /* &.u */)) - n2)
+ return *(*int32)(unsafe.Pointer(pB1)) - n2
} else {
if !(isAllZero(tls, (*Mem)(unsafe.Pointer(pB1)).Fz, (*Mem)(unsafe.Pointer(pB1)).Fn) != 0) {
return +1
}
- return (n1 - *(*int32)(unsafe.Pointer(pB2 /* &.u */)))
+ return n1 - *(*int32)(unsafe.Pointer(pB2))
}
}
c = libc.Xmemcmp(tls, (*Mem)(unsafe.Pointer(pB1)).Fz, (*Mem)(unsafe.Pointer(pB2)).Fz, func() uint32 {
@@ -59653,13 +60376,13 @@ func Xsqlite3BlobCompare(tls *libc.TLS, pB1 uintptr, pB2 uintptr) int32 { /* sql
if c != 0 {
return c
}
- return (n1 - n2)
+ return n1 - n2
}
// Do a comparison between a 64-bit signed integer and a 64-bit floating-point
// number. Return negative, zero, or positive if the first (i64) is less than,
// equal to, or greater than the second (double).
-func sqlite3IntFloatCompare(tls *libc.TLS, i I64, r float64) int32 { /* sqlite3.c:83197:12: */
+func Xsqlite3IntFloatCompare(tls *libc.TLS, i I64, r float64) int32 { /* sqlite3.c:83467:20: */
if uint32(unsafe.Sizeof(float64(0))) > uint32(8) {
var x float64 = float64(i)
@@ -59705,52 +60428,52 @@ func sqlite3IntFloatCompare(tls *libc.TLS, i I64, r float64) int32 { /* sqlite3.
// sequence pColl and finally blob's ordered by memcmp().
//
// Two NULL values are considered equal by this function.
-func Xsqlite3MemCompare(tls *libc.TLS, pMem1 uintptr, pMem2 uintptr, pColl uintptr) int32 { /* sqlite3.c:83230:20: */
+func Xsqlite3MemCompare(tls *libc.TLS, pMem1 uintptr, pMem2 uintptr, pColl uintptr) int32 { /* sqlite3.c:83500:20: */
var f1 int32
var f2 int32
var combined_flags int32
f1 = int32((*Mem)(unsafe.Pointer(pMem1)).Fflags)
f2 = int32((*Mem)(unsafe.Pointer(pMem2)).Fflags)
- combined_flags = (f1 | f2)
+ combined_flags = f1 | f2
// If one value is NULL, it is less than the other. If both values
// are NULL, return 0.
- if (combined_flags & MEM_Null) != 0 {
- return ((f2 & MEM_Null) - (f1 & MEM_Null))
+ if combined_flags&MEM_Null != 0 {
+ return f2&MEM_Null - f1&MEM_Null
}
// At least one of the two values is a number
- if (combined_flags & ((MEM_Int | MEM_Real) | MEM_IntReal)) != 0 {
+ if combined_flags&(MEM_Int|MEM_Real|MEM_IntReal) != 0 {
- if ((f1 & f2) & (MEM_Int | MEM_IntReal)) != 0 {
+ if f1&f2&(MEM_Int|MEM_IntReal) != 0 {
- if *(*I64)(unsafe.Pointer(pMem1 /* &.u */)) < *(*I64)(unsafe.Pointer(pMem2 /* &.u */)) {
+ if *(*I64)(unsafe.Pointer(pMem1)) < *(*I64)(unsafe.Pointer(pMem2)) {
return -1
}
- if *(*I64)(unsafe.Pointer(pMem1 /* &.u */)) > *(*I64)(unsafe.Pointer(pMem2 /* &.u */)) {
+ if *(*I64)(unsafe.Pointer(pMem1)) > *(*I64)(unsafe.Pointer(pMem2)) {
return +1
}
return 0
}
- if ((f1 & f2) & MEM_Real) != 0 {
- if *(*float64)(unsafe.Pointer(pMem1 /* &.u */)) < *(*float64)(unsafe.Pointer(pMem2 /* &.u */)) {
+ if f1&f2&MEM_Real != 0 {
+ if *(*float64)(unsafe.Pointer(pMem1)) < *(*float64)(unsafe.Pointer(pMem2)) {
return -1
}
- if *(*float64)(unsafe.Pointer(pMem1 /* &.u */)) > *(*float64)(unsafe.Pointer(pMem2 /* &.u */)) {
+ if *(*float64)(unsafe.Pointer(pMem1)) > *(*float64)(unsafe.Pointer(pMem2)) {
return +1
}
return 0
}
- if (f1 & (MEM_Int | MEM_IntReal)) != 0 {
+ if f1&(MEM_Int|MEM_IntReal) != 0 {
- if (f2 & MEM_Real) != 0 {
- return sqlite3IntFloatCompare(tls, *(*I64)(unsafe.Pointer(pMem1 /* &.u */)), *(*float64)(unsafe.Pointer(pMem2 /* &.u */)))
- } else if (f2 & (MEM_Int | MEM_IntReal)) != 0 {
- if *(*I64)(unsafe.Pointer(pMem1 /* &.u */)) < *(*I64)(unsafe.Pointer(pMem2 /* &.u */)) {
+ if f2&MEM_Real != 0 {
+ return Xsqlite3IntFloatCompare(tls, *(*I64)(unsafe.Pointer(pMem1)), *(*float64)(unsafe.Pointer(pMem2)))
+ } else if f2&(MEM_Int|MEM_IntReal) != 0 {
+ if *(*I64)(unsafe.Pointer(pMem1)) < *(*I64)(unsafe.Pointer(pMem2)) {
return -1
}
- if *(*I64)(unsafe.Pointer(pMem1 /* &.u */)) > *(*I64)(unsafe.Pointer(pMem2 /* &.u */)) {
+ if *(*I64)(unsafe.Pointer(pMem1)) > *(*I64)(unsafe.Pointer(pMem2)) {
return +1
}
return 0
@@ -59758,10 +60481,10 @@ func Xsqlite3MemCompare(tls *libc.TLS, pMem1 uintptr, pMem2 uintptr, pColl uintp
return -1
}
}
- if (f1 & MEM_Real) != 0 {
- if (f2 & (MEM_Int | MEM_IntReal)) != 0 {
+ if f1&MEM_Real != 0 {
+ if f2&(MEM_Int|MEM_IntReal) != 0 {
- return -sqlite3IntFloatCompare(tls, *(*I64)(unsafe.Pointer(pMem2 /* &.u */)), *(*float64)(unsafe.Pointer(pMem1 /* &.u */)))
+ return -Xsqlite3IntFloatCompare(tls, *(*I64)(unsafe.Pointer(pMem2)), *(*float64)(unsafe.Pointer(pMem1)))
} else {
return -1
}
@@ -59771,11 +60494,11 @@ func Xsqlite3MemCompare(tls *libc.TLS, pMem1 uintptr, pMem2 uintptr, pColl uintp
// If one value is a string and the other is a blob, the string is less.
// If both are strings, compare using the collating functions.
- if (combined_flags & MEM_Str) != 0 {
- if (f1 & MEM_Str) == 0 {
+ if combined_flags&MEM_Str != 0 {
+ if f1&MEM_Str == 0 {
return 1
}
- if (f2 & MEM_Str) == 0 {
+ if f2&MEM_Str == 0 {
return -1
}
@@ -59799,7 +60522,7 @@ func Xsqlite3MemCompare(tls *libc.TLS, pMem1 uintptr, pMem2 uintptr, pColl uintp
// except 7. The second points to a buffer containing an integer value
// serialized according to serial_type. This function deserializes
// and returns the value.
-func vdbeRecordDecodeInt(tls *libc.TLS, serial_type U32, aKey uintptr) I64 { /* sqlite3.c:83329:12: */
+func vdbeRecordDecodeInt(tls *libc.TLS, serial_type U32, aKey uintptr) I64 { /* sqlite3.c:83599:12: */
bp := tls.Alloc(16)
defer tls.Free(16)
@@ -59810,37 +60533,37 @@ func vdbeRecordDecodeInt(tls *libc.TLS, serial_type U32, aKey uintptr) I64 { /*
fallthrough
case U32(1):
- return I64(I8(*(*U8)(unsafe.Pointer((aKey)))))
+ return I64(I8(*(*U8)(unsafe.Pointer(aKey))))
case U32(2):
- return (I64((256 * int32((I8(*(*U8)(unsafe.Pointer((aKey))))))) | int32(*(*U8)(unsafe.Pointer((aKey) + 1)))))
+ return I64(256*int32(I8(*(*U8)(unsafe.Pointer(aKey)))) | int32(*(*U8)(unsafe.Pointer(aKey + 1))))
case U32(3):
- return (I64(((65536 * int32((I8(*(*U8)(unsafe.Pointer((aKey))))))) | (int32(*(*U8)(unsafe.Pointer((aKey) + 1))) << 8)) | int32(*(*U8)(unsafe.Pointer((aKey) + 2)))))
+ return I64(65536*int32(I8(*(*U8)(unsafe.Pointer(aKey)))) | int32(*(*U8)(unsafe.Pointer(aKey + 1)))<<8 | int32(*(*U8)(unsafe.Pointer(aKey + 2))))
case U32(4):
{
- *(*U32)(unsafe.Pointer(bp /* y */)) = ((((U32(*(*U8)(unsafe.Pointer((aKey)))) << 24) | (U32(int32(*(*U8)(unsafe.Pointer((aKey) + 1))) << 16))) | (U32(int32(*(*U8)(unsafe.Pointer((aKey) + 2))) << 8))) | U32(*(*U8)(unsafe.Pointer((aKey) + 3))))
+ *(*U32)(unsafe.Pointer(bp /* y */)) = U32(*(*U8)(unsafe.Pointer(aKey)))<<24 | U32(int32(*(*U8)(unsafe.Pointer(aKey + 1)))<<16) | U32(int32(*(*U8)(unsafe.Pointer(aKey + 2)))<<8) | U32(*(*U8)(unsafe.Pointer(aKey + 3)))
return I64(*(*int32)(unsafe.Pointer(bp /* &y */)))
}
case U32(5):
{
- return ((I64((((U32(*(*U8)(unsafe.Pointer((aKey + uintptr(2))))) << 24) | (U32(int32(*(*U8)(unsafe.Pointer((aKey + uintptr(2)) + 1))) << 16))) | (U32(int32(*(*U8)(unsafe.Pointer((aKey + uintptr(2)) + 2))) << 8))) | U32(*(*U8)(unsafe.Pointer((aKey + uintptr(2)) + 3))))) + ((I64((int64(1))) << 32) * (I64((256 * int32((I8(*(*U8)(unsafe.Pointer((aKey))))))) | int32(*(*U8)(unsafe.Pointer((aKey) + 1)))))))
+ return I64(U32(*(*U8)(unsafe.Pointer(aKey + uintptr(2))))<<24|U32(int32(*(*U8)(unsafe.Pointer(aKey + uintptr(2) + 1)))<<16)|U32(int32(*(*U8)(unsafe.Pointer(aKey + uintptr(2) + 2)))<<8)|U32(*(*U8)(unsafe.Pointer(aKey + uintptr(2) + 3)))) + I64(int64(1))<<32*I64(256*int32(I8(*(*U8)(unsafe.Pointer(aKey))))|int32(*(*U8)(unsafe.Pointer(aKey + 1))))
}
case U32(6):
{
- *(*U64)(unsafe.Pointer(bp + 8 /* x */)) = (U64((((U32(*(*U8)(unsafe.Pointer((aKey)))) << 24) | (U32(int32(*(*U8)(unsafe.Pointer((aKey) + 1))) << 16))) | (U32(int32(*(*U8)(unsafe.Pointer((aKey) + 2))) << 8))) | U32(*(*U8)(unsafe.Pointer((aKey) + 3)))))
+ *(*U64)(unsafe.Pointer(bp + 8 /* x */)) = U64(U32(*(*U8)(unsafe.Pointer(aKey)))<<24 | U32(int32(*(*U8)(unsafe.Pointer(aKey + 1)))<<16) | U32(int32(*(*U8)(unsafe.Pointer(aKey + 2)))<<8) | U32(*(*U8)(unsafe.Pointer(aKey + 3))))
- *(*U64)(unsafe.Pointer(bp + 8 /* x */)) = ((*(*U64)(unsafe.Pointer(bp + 8 /* x */)) << 32) | (U64((((U32(*(*U8)(unsafe.Pointer((aKey + uintptr(4))))) << 24) | (U32(int32(*(*U8)(unsafe.Pointer((aKey + uintptr(4)) + 1))) << 16))) | (U32(int32(*(*U8)(unsafe.Pointer((aKey + uintptr(4)) + 2))) << 8))) | U32(*(*U8)(unsafe.Pointer((aKey + uintptr(4)) + 3))))))
+ *(*U64)(unsafe.Pointer(bp + 8 /* x */)) = *(*U64)(unsafe.Pointer(bp + 8))<<32 | U64(U32(*(*U8)(unsafe.Pointer(aKey + uintptr(4))))<<24|U32(int32(*(*U8)(unsafe.Pointer(aKey + uintptr(4) + 1)))<<16)|U32(int32(*(*U8)(unsafe.Pointer(aKey + uintptr(4) + 2)))<<8)|U32(*(*U8)(unsafe.Pointer(aKey + uintptr(4) + 3))))
return *(*I64)(unsafe.Pointer(bp + 8 /* &x */))
}
}
- return (I64(serial_type - U32(8)))
+ return I64(serial_type - U32(8))
}
// This function compares the two table rows or index records
@@ -59862,7 +60585,7 @@ func vdbeRecordDecodeInt(tls *libc.TLS, serial_type U32, aKey uintptr) I64 { /*
// SQLITE_CORRUPT and return 0. If an OOM error is encountered,
// pPKey2->errCode is set to SQLITE_NOMEM and, if it is not NULL, the
// malloc-failed flag set on database handle (pPKey2->pKeyInfo->db).
-func Xsqlite3VdbeRecordCompareWithSkip(tls *libc.TLS, nKey1 int32, pKey1 uintptr, pPKey2 uintptr, bSkip int32) int32 { /* sqlite3.c:83384:20: */
+func Xsqlite3VdbeRecordCompareWithSkip(tls *libc.TLS, nKey1 int32, pKey1 uintptr, pPKey2 uintptr, bSkip int32) int32 { /* sqlite3.c:83654:20: */
bp := tls.Alloc(52)
defer tls.Free(52)
@@ -59883,165 +60606,159 @@ func Xsqlite3VdbeRecordCompareWithSkip(tls *libc.TLS, nKey1 int32, pKey1 uintptr
if bSkip != 0 {
// var s1 U32 at bp, 4
- idx1 = (U32(1 + int32((func() uint8 {
- if int32(*(*uint8)(unsafe.Pointer((aKey1 + 1)))) < int32(U8(0x80)) {
- return uint8(func() int32 {
- (*(*U32)(unsafe.Pointer(bp /* s1 */))) = U32(*(*uint8)(unsafe.Pointer((aKey1 + 1))))
- return 1
- }())
+ idx1 = U32(1 + int32(func() uint8 {
+ if int32(*(*uint8)(unsafe.Pointer(aKey1 + 1))) < int32(U8(0x80)) {
+ return uint8(func() int32 { *(*U32)(unsafe.Pointer(bp)) = U32(*(*uint8)(unsafe.Pointer(aKey1 + 1))); return 1 }())
}
- return Xsqlite3GetVarint32(tls, (aKey1 + 1), bp /* &s1 */)
- }()))))
+ return Xsqlite3GetVarint32(tls, aKey1+1, bp)
+ }()))
*(*U32)(unsafe.Pointer(bp + 4 /* szHdr1 */)) = U32(*(*uint8)(unsafe.Pointer(aKey1)))
- d1 = (*(*U32)(unsafe.Pointer(bp + 4 /* szHdr1 */)) + Xsqlite3VdbeSerialTypeLen(tls, *(*U32)(unsafe.Pointer(bp /* s1 */))))
+ d1 = *(*U32)(unsafe.Pointer(bp + 4)) + Xsqlite3VdbeSerialTypeLen(tls, *(*U32)(unsafe.Pointer(bp)))
i = 1
pRhs += 40
} else {
idx1 = U32(func() uint8 {
if int32(*(*uint8)(unsafe.Pointer(aKey1))) < int32(U8(0x80)) {
- return uint8(func() int32 {
- (*(*U32)(unsafe.Pointer(bp + 4 /* szHdr1 */))) = U32(*(*uint8)(unsafe.Pointer(aKey1)))
- return 1
- }())
+ return uint8(func() int32 { *(*U32)(unsafe.Pointer(bp + 4)) = U32(*(*uint8)(unsafe.Pointer(aKey1))); return 1 }())
}
- return Xsqlite3GetVarint32(tls, aKey1, bp+4 /* &szHdr1 */)
+ return Xsqlite3GetVarint32(tls, aKey1, bp+4)
}())
d1 = *(*U32)(unsafe.Pointer(bp + 4 /* szHdr1 */))
i = 0
}
if d1 > uint32(nKey1) {
- (*UnpackedRecord)(unsafe.Pointer(pPKey2)).FerrCode = U8(Xsqlite3CorruptError(tls, 83415))
+ (*UnpackedRecord)(unsafe.Pointer(pPKey2)).FerrCode = U8(Xsqlite3CorruptError(tls, 83685))
return 0 // Corruption
}
- for ok := true; ok; ok = ((idx1 < *(*U32)(unsafe.Pointer(bp + 4 /* szHdr1 */))) && (d1 <= uint32(nKey1))) {
+ for ok := true; ok; ok = idx1 < *(*U32)(unsafe.Pointer(bp + 4)) && d1 <= uint32(nKey1) {
// var serial_type U32 at bp+48, 4
// RHS is an integer
- if (int32((*Mem)(unsafe.Pointer(pRhs)).Fflags) & (MEM_Int | MEM_IntReal)) != 0 {
+ if int32((*Mem)(unsafe.Pointer(pRhs)).Fflags)&(MEM_Int|MEM_IntReal) != 0 {
*(*U32)(unsafe.Pointer(bp + 48 /* serial_type */)) = U32(*(*uint8)(unsafe.Pointer(aKey1 + uintptr(idx1))))
- if *(*U32)(unsafe.Pointer(bp + 48 /* serial_type */)) >= U32(10) {
+ if *(*U32)(unsafe.Pointer(bp + 48)) >= U32(10) {
rc = +1
- } else if *(*U32)(unsafe.Pointer(bp + 48 /* serial_type */)) == U32(0) {
+ } else if *(*U32)(unsafe.Pointer(bp + 48)) == U32(0) {
rc = -1
- } else if *(*U32)(unsafe.Pointer(bp + 48 /* serial_type */)) == U32(7) {
- Xsqlite3VdbeSerialGet(tls, (aKey1 + uintptr(d1)), *(*U32)(unsafe.Pointer(bp + 48 /* serial_type */)), bp+8 /* &mem1 */)
- rc = -sqlite3IntFloatCompare(tls, *(*I64)(unsafe.Pointer(pRhs /* &.u */)), *(*float64)(unsafe.Pointer(bp + 8 /* &mem1 */ /* &.u */)))
+ } else if *(*U32)(unsafe.Pointer(bp + 48)) == U32(7) {
+ Xsqlite3VdbeSerialGet(tls, aKey1+uintptr(d1), *(*U32)(unsafe.Pointer(bp + 48 /* serial_type */)), bp+8 /* &mem1 */)
+ rc = -Xsqlite3IntFloatCompare(tls, *(*I64)(unsafe.Pointer(pRhs)), *(*float64)(unsafe.Pointer(bp + 8)))
} else {
- var lhs I64 = vdbeRecordDecodeInt(tls, *(*U32)(unsafe.Pointer(bp + 48 /* serial_type */)), (aKey1 + uintptr(d1)))
- var rhs I64 = *(*I64)(unsafe.Pointer(pRhs /* &.u */))
+ var lhs I64 = vdbeRecordDecodeInt(tls, *(*U32)(unsafe.Pointer(bp + 48 /* serial_type */)), aKey1+uintptr(d1))
+ var rhs I64 = *(*I64)(unsafe.Pointer(pRhs))
if lhs < rhs {
rc = -1
} else if lhs > rhs {
rc = +1
}
}
- } else if (int32((*Mem)(unsafe.Pointer(pRhs)).Fflags) & MEM_Real) != 0 {
+ } else if int32((*Mem)(unsafe.Pointer(pRhs)).Fflags)&MEM_Real != 0 {
*(*U32)(unsafe.Pointer(bp + 48 /* serial_type */)) = U32(*(*uint8)(unsafe.Pointer(aKey1 + uintptr(idx1))))
- if *(*U32)(unsafe.Pointer(bp + 48 /* serial_type */)) >= U32(10) {
+ if *(*U32)(unsafe.Pointer(bp + 48)) >= U32(10) {
// Serial types 12 or greater are strings and blobs (greater than
// numbers). Types 10 and 11 are currently "reserved for future
// use", so it doesn't really matter what the results of comparing
// them to numberic values are.
rc = +1
- } else if *(*U32)(unsafe.Pointer(bp + 48 /* serial_type */)) == U32(0) {
+ } else if *(*U32)(unsafe.Pointer(bp + 48)) == U32(0) {
rc = -1
} else {
- Xsqlite3VdbeSerialGet(tls, (aKey1 + uintptr(d1)), *(*U32)(unsafe.Pointer(bp + 48 /* serial_type */)), bp+8 /* &mem1 */)
- if *(*U32)(unsafe.Pointer(bp + 48 /* serial_type */)) == U32(7) {
- if *(*float64)(unsafe.Pointer(bp + 8 /* &mem1 */ /* &.u */)) < *(*float64)(unsafe.Pointer(pRhs /* &.u */)) {
+ Xsqlite3VdbeSerialGet(tls, aKey1+uintptr(d1), *(*U32)(unsafe.Pointer(bp + 48 /* serial_type */)), bp+8 /* &mem1 */)
+ if *(*U32)(unsafe.Pointer(bp + 48)) == U32(7) {
+ if *(*float64)(unsafe.Pointer(bp + 8)) < *(*float64)(unsafe.Pointer(pRhs)) {
rc = -1
- } else if *(*float64)(unsafe.Pointer(bp + 8 /* &mem1 */ /* &.u */)) > *(*float64)(unsafe.Pointer(pRhs /* &.u */)) {
+ } else if *(*float64)(unsafe.Pointer(bp + 8)) > *(*float64)(unsafe.Pointer(pRhs)) {
rc = +1
}
} else {
- rc = sqlite3IntFloatCompare(tls, *(*I64)(unsafe.Pointer(bp + 8 /* &mem1 */ /* &.u */)), *(*float64)(unsafe.Pointer(pRhs /* &.u */)))
+ rc = Xsqlite3IntFloatCompare(tls, *(*I64)(unsafe.Pointer(bp + 8)), *(*float64)(unsafe.Pointer(pRhs)))
}
}
- } else if (int32((*Mem)(unsafe.Pointer(pRhs)).Fflags) & MEM_Str) != 0 {
- *(*U32)(unsafe.Pointer(bp + 48 /* serial_type */)) = U32(*(*uint8)(unsafe.Pointer((aKey1 + uintptr(idx1)))))
- if *(*U32)(unsafe.Pointer(bp + 48 /* serial_type */)) >= U32(0x80) {
- Xsqlite3GetVarint32(tls, (aKey1 + uintptr(idx1)), bp+48 /* &serial_type */)
+ } else if int32((*Mem)(unsafe.Pointer(pRhs)).Fflags)&MEM_Str != 0 {
+ *(*U32)(unsafe.Pointer(bp + 48 /* serial_type */)) = U32(*(*uint8)(unsafe.Pointer(aKey1 + uintptr(idx1))))
+ if *(*U32)(unsafe.Pointer(bp + 48)) >= U32(0x80) {
+ Xsqlite3GetVarint32(tls, aKey1+uintptr(idx1), bp+48 /* &serial_type */)
}
- if *(*U32)(unsafe.Pointer(bp + 48 /* serial_type */)) < U32(12) {
+ if *(*U32)(unsafe.Pointer(bp + 48)) < U32(12) {
rc = -1
- } else if !((*(*U32)(unsafe.Pointer(bp + 48 /* serial_type */)) & U32(0x01)) != 0) {
+ } else if !(*(*U32)(unsafe.Pointer(bp + 48))&U32(0x01) != 0) {
rc = +1
} else {
- (*Mem)(unsafe.Pointer(bp + 8 /* &mem1 */)).Fn = (int32((*(*U32)(unsafe.Pointer(bp + 48 /* serial_type */)) - U32(12)) / U32(2)))
+ (*Mem)(unsafe.Pointer(bp + 8 /* &mem1 */)).Fn = int32((*(*U32)(unsafe.Pointer(bp + 48)) - U32(12)) / U32(2))
- if ((d1 + U32((*Mem)(unsafe.Pointer(bp+8 /* &mem1 */)).Fn)) > uint32(nKey1)) ||
- (int32((*KeyInfo)(unsafe.Pointer((libc.AssignUintptr(&pKeyInfo, (*UnpackedRecord)(unsafe.Pointer(pPKey2)).FpKeyInfo)))).FnAllField) <= i) {
- (*UnpackedRecord)(unsafe.Pointer(pPKey2)).FerrCode = U8(Xsqlite3CorruptError(tls, 83492))
+ if d1+U32((*Mem)(unsafe.Pointer(bp+8)).Fn) > uint32(nKey1) ||
+ int32((*KeyInfo)(unsafe.Pointer(libc.AssignUintptr(&pKeyInfo, (*UnpackedRecord)(unsafe.Pointer(pPKey2)).FpKeyInfo))).FnAllField) <= i {
+ (*UnpackedRecord)(unsafe.Pointer(pPKey2)).FerrCode = U8(Xsqlite3CorruptError(tls, 83762))
return 0 // Corruption
- } else if *(*uintptr)(unsafe.Pointer((pKeyInfo + 20 /* &.aColl */) + uintptr(i)*4)) != 0 {
+ } else if *(*uintptr)(unsafe.Pointer(pKeyInfo + 20 + uintptr(i)*4)) != 0 {
(*Mem)(unsafe.Pointer(bp + 8 /* &mem1 */)).Fenc = (*KeyInfo)(unsafe.Pointer(pKeyInfo)).Fenc
(*Mem)(unsafe.Pointer(bp + 8 /* &mem1 */)).Fdb = (*KeyInfo)(unsafe.Pointer(pKeyInfo)).Fdb
(*Mem)(unsafe.Pointer(bp + 8 /* &mem1 */)).Fflags = U16(MEM_Str)
- (*Mem)(unsafe.Pointer(bp + 8 /* &mem1 */)).Fz = (aKey1 + uintptr(d1))
+ (*Mem)(unsafe.Pointer(bp + 8 /* &mem1 */)).Fz = aKey1 + uintptr(d1)
rc = vdbeCompareMemString(tls,
- bp+8 /* &mem1 */, pRhs, *(*uintptr)(unsafe.Pointer((pKeyInfo + 20 /* &.aColl */) + uintptr(i)*4)), (pPKey2 + 11 /* &.errCode */))
+ bp+8 /* &mem1 */, pRhs, *(*uintptr)(unsafe.Pointer(pKeyInfo + 20 + uintptr(i)*4)), pPKey2+11)
} else {
var nCmp int32 = func() int32 {
- if ((*Mem)(unsafe.Pointer(bp + 8 /* &mem1 */)).Fn) < ((*Mem)(unsafe.Pointer(pRhs)).Fn) {
- return (*Mem)(unsafe.Pointer(bp + 8 /* &mem1 */)).Fn
+ if (*Mem)(unsafe.Pointer(bp+8)).Fn < (*Mem)(unsafe.Pointer(pRhs)).Fn {
+ return (*Mem)(unsafe.Pointer(bp + 8)).Fn
}
return (*Mem)(unsafe.Pointer(pRhs)).Fn
}()
- rc = libc.Xmemcmp(tls, (aKey1 + uintptr(d1)), (*Mem)(unsafe.Pointer(pRhs)).Fz, uint32(nCmp))
+ rc = libc.Xmemcmp(tls, aKey1+uintptr(d1), (*Mem)(unsafe.Pointer(pRhs)).Fz, uint32(nCmp))
if rc == 0 {
- rc = ((*Mem)(unsafe.Pointer(bp+8 /* &mem1 */)).Fn - (*Mem)(unsafe.Pointer(pRhs)).Fn)
+ rc = (*Mem)(unsafe.Pointer(bp+8)).Fn - (*Mem)(unsafe.Pointer(pRhs)).Fn
}
}
}
- } else if (int32((*Mem)(unsafe.Pointer(pRhs)).Fflags) & MEM_Blob) != 0 {
+ } else if int32((*Mem)(unsafe.Pointer(pRhs)).Fflags)&MEM_Blob != 0 {
- *(*U32)(unsafe.Pointer(bp + 48 /* serial_type */)) = U32(*(*uint8)(unsafe.Pointer((aKey1 + uintptr(idx1)))))
- if *(*U32)(unsafe.Pointer(bp + 48 /* serial_type */)) >= U32(0x80) {
- Xsqlite3GetVarint32(tls, (aKey1 + uintptr(idx1)), bp+48 /* &serial_type */)
+ *(*U32)(unsafe.Pointer(bp + 48 /* serial_type */)) = U32(*(*uint8)(unsafe.Pointer(aKey1 + uintptr(idx1))))
+ if *(*U32)(unsafe.Pointer(bp + 48)) >= U32(0x80) {
+ Xsqlite3GetVarint32(tls, aKey1+uintptr(idx1), bp+48 /* &serial_type */)
}
- if (*(*U32)(unsafe.Pointer(bp + 48 /* serial_type */)) < U32(12)) || ((*(*U32)(unsafe.Pointer(bp + 48 /* serial_type */)) & U32(0x01)) != 0) {
+ if *(*U32)(unsafe.Pointer(bp + 48)) < U32(12) || *(*U32)(unsafe.Pointer(bp + 48))&U32(0x01) != 0 {
rc = -1
} else {
- var nStr int32 = (int32((*(*U32)(unsafe.Pointer(bp + 48 /* serial_type */)) - U32(12)) / U32(2)))
+ var nStr int32 = int32((*(*U32)(unsafe.Pointer(bp + 48)) - U32(12)) / U32(2))
- if (d1 + U32(nStr)) > uint32(nKey1) {
- (*UnpackedRecord)(unsafe.Pointer(pPKey2)).FerrCode = U8(Xsqlite3CorruptError(tls, 83522))
+ if d1+U32(nStr) > uint32(nKey1) {
+ (*UnpackedRecord)(unsafe.Pointer(pPKey2)).FerrCode = U8(Xsqlite3CorruptError(tls, 83792))
return 0 // Corruption
- } else if (int32((*Mem)(unsafe.Pointer(pRhs)).Fflags) & MEM_Zero) != 0 {
- if !(isAllZero(tls, (aKey1+uintptr(d1)), nStr) != 0) {
+ } else if int32((*Mem)(unsafe.Pointer(pRhs)).Fflags)&MEM_Zero != 0 {
+ if !(isAllZero(tls, aKey1+uintptr(d1), nStr) != 0) {
rc = 1
} else {
- rc = (nStr - *(*int32)(unsafe.Pointer(pRhs /* &.u */)))
+ rc = nStr - *(*int32)(unsafe.Pointer(pRhs))
}
} else {
var nCmp int32 = func() int32 {
- if (nStr) < ((*Mem)(unsafe.Pointer(pRhs)).Fn) {
+ if nStr < (*Mem)(unsafe.Pointer(pRhs)).Fn {
return nStr
}
return (*Mem)(unsafe.Pointer(pRhs)).Fn
}()
- rc = libc.Xmemcmp(tls, (aKey1 + uintptr(d1)), (*Mem)(unsafe.Pointer(pRhs)).Fz, uint32(nCmp))
+ rc = libc.Xmemcmp(tls, aKey1+uintptr(d1), (*Mem)(unsafe.Pointer(pRhs)).Fz, uint32(nCmp))
if rc == 0 {
- rc = (nStr - (*Mem)(unsafe.Pointer(pRhs)).Fn)
+ rc = nStr - (*Mem)(unsafe.Pointer(pRhs)).Fn
}
}
}
} else {
*(*U32)(unsafe.Pointer(bp + 48 /* serial_type */)) = U32(*(*uint8)(unsafe.Pointer(aKey1 + uintptr(idx1))))
- rc = (libc.Bool32(*(*U32)(unsafe.Pointer(bp + 48 /* serial_type */)) != U32(0)))
+ rc = libc.Bool32(*(*U32)(unsafe.Pointer(bp + 48)) != U32(0))
}
if rc != 0 {
var sortFlags int32 = int32(*(*U8)(unsafe.Pointer((*KeyInfo)(unsafe.Pointer((*UnpackedRecord)(unsafe.Pointer(pPKey2)).FpKeyInfo)).FaSortFlags + uintptr(i))))
if sortFlags != 0 {
- if ((sortFlags & KEYINFO_ORDER_BIGNULL) == 0) ||
- ((sortFlags & KEYINFO_ORDER_DESC) !=
- (libc.Bool32((*(*U32)(unsafe.Pointer(bp + 48 /* serial_type */)) == U32(0)) || ((int32((*Mem)(unsafe.Pointer(pRhs)).Fflags) & MEM_Null) != 0)))) {
+ if sortFlags&KEYINFO_ORDER_BIGNULL == 0 ||
+ sortFlags&KEYINFO_ORDER_DESC !=
+ libc.Bool32(*(*U32)(unsafe.Pointer(bp + 48)) == U32(0) || int32((*Mem)(unsafe.Pointer(pRhs)).Fflags)&MEM_Null != 0) {
rc = -rc
}
}
@@ -60055,8 +60772,8 @@ func Xsqlite3VdbeRecordCompareWithSkip(tls *libc.TLS, nKey1 int32, pKey1 uintptr
break
}
pRhs += 40
- d1 = d1 + (Xsqlite3VdbeSerialTypeLen(tls, *(*U32)(unsafe.Pointer(bp + 48 /* serial_type */))))
- idx1 = idx1 + (U32(Xsqlite3VarintLen(tls, uint64(*(*U32)(unsafe.Pointer(bp + 48 /* serial_type */))))))
+ d1 = d1 + Xsqlite3VdbeSerialTypeLen(tls, *(*U32)(unsafe.Pointer(bp + 48)))
+ idx1 = idx1 + U32(Xsqlite3VarintLen(tls, uint64(*(*U32)(unsafe.Pointer(bp + 48)))))
}
// No memory allocation is ever used on mem1. Prove this using
@@ -60071,7 +60788,7 @@ func Xsqlite3VdbeRecordCompareWithSkip(tls *libc.TLS, nKey1 int32, pKey1 uintptr
return int32((*UnpackedRecord)(unsafe.Pointer(pPKey2)).Fdefault_rc)
}
-func Xsqlite3VdbeRecordCompare(tls *libc.TLS, nKey1 int32, pKey1 uintptr, pPKey2 uintptr) int32 { /* sqlite3.c:83581:20: */
+func Xsqlite3VdbeRecordCompare(tls *libc.TLS, nKey1 int32, pKey1 uintptr, pPKey2 uintptr) int32 { /* sqlite3.c:83851:20: */
return Xsqlite3VdbeRecordCompareWithSkip(tls, nKey1, pKey1, pPKey2, 0)
}
@@ -60082,12 +60799,12 @@ func Xsqlite3VdbeRecordCompare(tls *libc.TLS, nKey1 int32, pKey1 uintptr, pPKey2
//
// To avoid concerns about buffer overreads, this routine is only used
// on schemas where the maximum valid header size is 63 bytes or less.
-func vdbeRecordCompareInt(tls *libc.TLS, nKey1 int32, pKey1 uintptr, pPKey2 uintptr) int32 { /* sqlite3.c:83598:12: */
+func vdbeRecordCompareInt(tls *libc.TLS, nKey1 int32, pKey1 uintptr, pPKey2 uintptr) int32 { /* sqlite3.c:83868:12: */
bp := tls.Alloc(16)
defer tls.Free(16)
- var aKey uintptr = ((pKey1) + uintptr((int32(*(*U8)(unsafe.Pointer(pKey1))) & 0x3F)))
- var serial_type int32 = int32(*(*U8)(unsafe.Pointer((pKey1) + 1)))
+ var aKey uintptr = pKey1 + uintptr(int32(*(*U8)(unsafe.Pointer(pKey1)))&0x3F)
+ var serial_type int32 = int32(*(*U8)(unsafe.Pointer(pKey1 + 1)))
var res int32
// var y U32 at bp, 4
@@ -60099,28 +60816,28 @@ func vdbeRecordCompareInt(tls *libc.TLS, nKey1 int32, pKey1 uintptr, pPKey2 uint
switch serial_type {
case 1:
{ // 1-byte signed integer
- lhs = I64(I8(*(*U8)(unsafe.Pointer((aKey)))))
+ lhs = I64(I8(*(*U8)(unsafe.Pointer(aKey))))
break
}
case 2:
{ // 2-byte signed integer
- lhs = (I64((256 * int32((I8(*(*U8)(unsafe.Pointer((aKey))))))) | int32(*(*U8)(unsafe.Pointer((aKey) + 1)))))
+ lhs = I64(256*int32(I8(*(*U8)(unsafe.Pointer(aKey)))) | int32(*(*U8)(unsafe.Pointer(aKey + 1))))
break
}
case 3:
{ // 3-byte signed integer
- lhs = (I64(((65536 * int32((I8(*(*U8)(unsafe.Pointer((aKey))))))) | (int32(*(*U8)(unsafe.Pointer((aKey) + 1))) << 8)) | int32(*(*U8)(unsafe.Pointer((aKey) + 2)))))
+ lhs = I64(65536*int32(I8(*(*U8)(unsafe.Pointer(aKey)))) | int32(*(*U8)(unsafe.Pointer(aKey + 1)))<<8 | int32(*(*U8)(unsafe.Pointer(aKey + 2))))
break
}
case 4:
{ // 4-byte signed integer
- *(*U32)(unsafe.Pointer(bp /* y */)) = ((((U32(*(*U8)(unsafe.Pointer((aKey)))) << 24) | (U32(int32(*(*U8)(unsafe.Pointer((aKey) + 1))) << 16))) | (U32(int32(*(*U8)(unsafe.Pointer((aKey) + 2))) << 8))) | U32(*(*U8)(unsafe.Pointer((aKey) + 3))))
+ *(*U32)(unsafe.Pointer(bp /* y */)) = U32(*(*U8)(unsafe.Pointer(aKey)))<<24 | U32(int32(*(*U8)(unsafe.Pointer(aKey + 1)))<<16) | U32(int32(*(*U8)(unsafe.Pointer(aKey + 2)))<<8) | U32(*(*U8)(unsafe.Pointer(aKey + 3)))
lhs = I64(*(*int32)(unsafe.Pointer(bp /* &y */)))
break
@@ -60128,15 +60845,15 @@ func vdbeRecordCompareInt(tls *libc.TLS, nKey1 int32, pKey1 uintptr, pPKey2 uint
}
case 5:
{ // 6-byte signed integer
- lhs = ((I64((((U32(*(*U8)(unsafe.Pointer((aKey + uintptr(2))))) << 24) | (U32(int32(*(*U8)(unsafe.Pointer((aKey + uintptr(2)) + 1))) << 16))) | (U32(int32(*(*U8)(unsafe.Pointer((aKey + uintptr(2)) + 2))) << 8))) | U32(*(*U8)(unsafe.Pointer((aKey + uintptr(2)) + 3))))) + ((I64((int64(1))) << 32) * (I64((256 * int32((I8(*(*U8)(unsafe.Pointer((aKey))))))) | int32(*(*U8)(unsafe.Pointer((aKey) + 1)))))))
+ lhs = I64(U32(*(*U8)(unsafe.Pointer(aKey + uintptr(2))))<<24|U32(int32(*(*U8)(unsafe.Pointer(aKey + uintptr(2) + 1)))<<16)|U32(int32(*(*U8)(unsafe.Pointer(aKey + uintptr(2) + 2)))<<8)|U32(*(*U8)(unsafe.Pointer(aKey + uintptr(2) + 3)))) + I64(int64(1))<<32*I64(256*int32(I8(*(*U8)(unsafe.Pointer(aKey))))|int32(*(*U8)(unsafe.Pointer(aKey + 1))))
break
}
case 6:
{ // 8-byte signed integer
- *(*U64)(unsafe.Pointer(bp + 8 /* x */)) = (U64((((U32(*(*U8)(unsafe.Pointer((aKey)))) << 24) | (U32(int32(*(*U8)(unsafe.Pointer((aKey) + 1))) << 16))) | (U32(int32(*(*U8)(unsafe.Pointer((aKey) + 2))) << 8))) | U32(*(*U8)(unsafe.Pointer((aKey) + 3)))))
- *(*U64)(unsafe.Pointer(bp + 8 /* x */)) = ((*(*U64)(unsafe.Pointer(bp + 8 /* x */)) << 32) | (U64((((U32(*(*U8)(unsafe.Pointer((aKey + uintptr(4))))) << 24) | (U32(int32(*(*U8)(unsafe.Pointer((aKey + uintptr(4)) + 1))) << 16))) | (U32(int32(*(*U8)(unsafe.Pointer((aKey + uintptr(4)) + 2))) << 8))) | U32(*(*U8)(unsafe.Pointer((aKey + uintptr(4)) + 3))))))
+ *(*U64)(unsafe.Pointer(bp + 8 /* x */)) = U64(U32(*(*U8)(unsafe.Pointer(aKey)))<<24 | U32(int32(*(*U8)(unsafe.Pointer(aKey + 1)))<<16) | U32(int32(*(*U8)(unsafe.Pointer(aKey + 2)))<<8) | U32(*(*U8)(unsafe.Pointer(aKey + 3))))
+ *(*U64)(unsafe.Pointer(bp + 8 /* x */)) = *(*U64)(unsafe.Pointer(bp + 8))<<32 | U64(U32(*(*U8)(unsafe.Pointer(aKey + uintptr(4))))<<24|U32(int32(*(*U8)(unsafe.Pointer(aKey + uintptr(4) + 1)))<<16)|U32(int32(*(*U8)(unsafe.Pointer(aKey + uintptr(4) + 2)))<<8)|U32(*(*U8)(unsafe.Pointer(aKey + uintptr(4) + 3))))
lhs = *(*I64)(unsafe.Pointer(bp + 8 /* &x */))
break
@@ -60164,7 +60881,7 @@ func vdbeRecordCompareInt(tls *libc.TLS, nKey1 int32, pKey1 uintptr, pPKey2 uint
return Xsqlite3VdbeRecordCompare(tls, nKey1, pKey1, pPKey2)
}
- v = *(*I64)(unsafe.Pointer((*UnpackedRecord)(unsafe.Pointer(pPKey2)).FaMem /* &.u */))
+ v = *(*I64)(unsafe.Pointer((*UnpackedRecord)(unsafe.Pointer(pPKey2)).FaMem))
if v > lhs {
res = int32((*UnpackedRecord)(unsafe.Pointer(pPKey2)).Fr1)
} else if v < lhs {
@@ -60187,7 +60904,7 @@ func vdbeRecordCompareInt(tls *libc.TLS, nKey1 int32, pKey1 uintptr, pPKey2 uint
// that (a) the first field of pPKey2 is a string, that (b) the first field
// uses the collation sequence BINARY and (c) that the size-of-header varint
// at the start of (pKey1/nKey1) fits in a single byte.
-func vdbeRecordCompareString(tls *libc.TLS, nKey1 int32, pKey1 uintptr, pPKey2 uintptr) int32 { /* sqlite3.c:83692:12: */
+func vdbeRecordCompareString(tls *libc.TLS, nKey1 int32, pKey1 uintptr, pPKey2 uintptr) int32 { /* sqlite3.c:83962:12: */
bp := tls.Alloc(4)
defer tls.Free(4)
@@ -60197,37 +60914,37 @@ func vdbeRecordCompareString(tls *libc.TLS, nKey1 int32, pKey1 uintptr, pPKey2 u
var res int32
*(*int32)(unsafe.Pointer(bp /* serial_type */)) = int32(*(*U8)(unsafe.Pointer(aKey1 + 1)))
- if *(*int32)(unsafe.Pointer(bp /* serial_type */)) >= 0x80 {
- Xsqlite3GetVarint32(tls, (aKey1 + 1), bp /* &serial_type */)
+ if *(*int32)(unsafe.Pointer(bp)) >= 0x80 {
+ Xsqlite3GetVarint32(tls, aKey1+1, bp /* &serial_type */)
}
- if *(*int32)(unsafe.Pointer(bp /* serial_type */)) < 12 {
+ if *(*int32)(unsafe.Pointer(bp)) < 12 {
res = int32((*UnpackedRecord)(unsafe.Pointer(pPKey2)).Fr1) // (pKey1/nKey1) is a number or a null
- } else if !((*(*int32)(unsafe.Pointer(bp /* serial_type */)) & 0x01) != 0) {
+ } else if !(*(*int32)(unsafe.Pointer(bp))&0x01 != 0) {
res = int32((*UnpackedRecord)(unsafe.Pointer(pPKey2)).Fr2) // (pKey1/nKey1) is a blob
} else {
var nCmp int32
var nStr int32
var szHdr int32 = int32(*(*U8)(unsafe.Pointer(aKey1)))
- nStr = ((*(*int32)(unsafe.Pointer(bp /* serial_type */)) - 12) / 2)
- if (szHdr + nStr) > nKey1 {
- (*UnpackedRecord)(unsafe.Pointer(pPKey2)).FerrCode = U8(Xsqlite3CorruptError(tls, 83717))
+ nStr = (*(*int32)(unsafe.Pointer(bp)) - 12) / 2
+ if szHdr+nStr > nKey1 {
+ (*UnpackedRecord)(unsafe.Pointer(pPKey2)).FerrCode = U8(Xsqlite3CorruptError(tls, 83987))
return 0 // Corruption
}
nCmp = func() int32 {
- if ((*Mem)(unsafe.Pointer((*UnpackedRecord)(unsafe.Pointer(pPKey2)).FaMem)).Fn) < (nStr) {
+ if (*Mem)(unsafe.Pointer((*UnpackedRecord)(unsafe.Pointer(pPKey2)).FaMem)).Fn < nStr {
return (*Mem)(unsafe.Pointer((*UnpackedRecord)(unsafe.Pointer(pPKey2)).FaMem)).Fn
}
return nStr
}()
- res = libc.Xmemcmp(tls, (aKey1 + uintptr(szHdr)), (*Mem)(unsafe.Pointer((*UnpackedRecord)(unsafe.Pointer(pPKey2)).FaMem)).Fz, uint32(nCmp))
+ res = libc.Xmemcmp(tls, aKey1+uintptr(szHdr), (*Mem)(unsafe.Pointer((*UnpackedRecord)(unsafe.Pointer(pPKey2)).FaMem)).Fz, uint32(nCmp))
if res > 0 {
res = int32((*UnpackedRecord)(unsafe.Pointer(pPKey2)).Fr2)
} else if res < 0 {
res = int32((*UnpackedRecord)(unsafe.Pointer(pPKey2)).Fr1)
} else {
- res = (nStr - (*Mem)(unsafe.Pointer((*UnpackedRecord)(unsafe.Pointer(pPKey2)).FaMem)).Fn)
+ res = nStr - (*Mem)(unsafe.Pointer((*UnpackedRecord)(unsafe.Pointer(pPKey2)).FaMem)).Fn
if res == 0 {
if int32((*UnpackedRecord)(unsafe.Pointer(pPKey2)).FnField) > 1 {
res = Xsqlite3VdbeRecordCompareWithSkip(tls, nKey1, pKey1, pPKey2, 1)
@@ -60249,7 +60966,7 @@ func vdbeRecordCompareString(tls *libc.TLS, nKey1 int32, pKey1 uintptr, pPKey2 u
// Return a pointer to an sqlite3VdbeRecordCompare() compatible function
// suitable for comparing serialized records to the unpacked record passed
// as the only argument.
-func Xsqlite3VdbeFindCompare(tls *libc.TLS, p uintptr) RecordCompare { /* sqlite3.c:83756:30: */
+func Xsqlite3VdbeFindCompare(tls *libc.TLS, p uintptr) RecordCompare { /* sqlite3.c:84026:30: */
// varintRecordCompareInt() and varintRecordCompareString() both assume
// that the size-of-header varint that occurs at the start of each record
// fits in a single byte (i.e. is 127 or less). varintRecordCompareInt()
@@ -60266,7 +60983,7 @@ func Xsqlite3VdbeFindCompare(tls *libc.TLS, p uintptr) RecordCompare { /* sqlite
if int32((*KeyInfo)(unsafe.Pointer((*UnpackedRecord)(unsafe.Pointer(p)).FpKeyInfo)).FnAllField) <= 13 {
var flags int32 = int32((*Mem)(unsafe.Pointer((*UnpackedRecord)(unsafe.Pointer(p)).FaMem)).Fflags)
if *(*U8)(unsafe.Pointer((*KeyInfo)(unsafe.Pointer((*UnpackedRecord)(unsafe.Pointer(p)).FpKeyInfo)).FaSortFlags)) != 0 {
- if (int32(*(*U8)(unsafe.Pointer((*KeyInfo)(unsafe.Pointer((*UnpackedRecord)(unsafe.Pointer(p)).FpKeyInfo)).FaSortFlags))) & KEYINFO_ORDER_BIGNULL) != 0 {
+ if int32(*(*U8)(unsafe.Pointer((*KeyInfo)(unsafe.Pointer((*UnpackedRecord)(unsafe.Pointer(p)).FpKeyInfo)).FaSortFlags)))&KEYINFO_ORDER_BIGNULL != 0 {
return *(*uintptr)(unsafe.Pointer(&struct {
f func(*libc.TLS, int32, uintptr, uintptr) int32
}{Xsqlite3VdbeRecordCompare}))
@@ -60277,14 +60994,14 @@ func Xsqlite3VdbeFindCompare(tls *libc.TLS, p uintptr) RecordCompare { /* sqlite
(*UnpackedRecord)(unsafe.Pointer(p)).Fr1 = int8(-1)
(*UnpackedRecord)(unsafe.Pointer(p)).Fr2 = int8(1)
}
- if (flags & MEM_Int) != 0 {
+ if flags&MEM_Int != 0 {
return *(*uintptr)(unsafe.Pointer(&struct {
f func(*libc.TLS, int32, uintptr, uintptr) int32
}{vdbeRecordCompareInt}))
}
- if ((flags & (((MEM_Real | MEM_IntReal) | MEM_Null) | MEM_Blob)) == 0) &&
- (*(*uintptr)(unsafe.Pointer(((*UnpackedRecord)(unsafe.Pointer(p)).FpKeyInfo + 20 /* &.aColl */))) == uintptr(0)) {
+ if flags&(MEM_Real|MEM_IntReal|MEM_Null|MEM_Blob) == 0 &&
+ *(*uintptr)(unsafe.Pointer((*UnpackedRecord)(unsafe.Pointer(p)).FpKeyInfo + 20)) == uintptr(0) {
return *(*uintptr)(unsafe.Pointer(&struct {
f func(*libc.TLS, int32, uintptr, uintptr) int32
@@ -60303,7 +61020,7 @@ func Xsqlite3VdbeFindCompare(tls *libc.TLS, p uintptr) RecordCompare { /* sqlite
//
// pCur might be pointing to text obtained from a corrupt database file.
// So the content cannot be trusted. Do appropriate checks on the content.
-func Xsqlite3VdbeIdxRowid(tls *libc.TLS, db uintptr, pCur uintptr, rowid uintptr) int32 { /* sqlite3.c:83807:20: */
+func Xsqlite3VdbeIdxRowid(tls *libc.TLS, db uintptr, pCur uintptr, rowid uintptr) int32 { /* sqlite3.c:84077:20: */
bp := tls.Alloc(88)
defer tls.Free(88)
@@ -60337,15 +61054,15 @@ __1:
;
// The index entry must begin with a header size
- *(*U32)(unsafe.Pointer(bp + 40 /* szHdr */)) = U32(*(*U8)(unsafe.Pointer((*Mem)(unsafe.Pointer(bp /* &m */)).Fz)))
- if !(*(*U32)(unsafe.Pointer(bp + 40 /* szHdr */)) >= U32(0x80)) {
+ *(*U32)(unsafe.Pointer(bp + 40 /* szHdr */)) = U32(*(*U8)(unsafe.Pointer((*Mem)(unsafe.Pointer(bp)).Fz)))
+ if !(*(*U32)(unsafe.Pointer(bp + 40)) >= U32(0x80)) {
goto __2
}
- Xsqlite3GetVarint32(tls, (*Mem)(unsafe.Pointer(bp /* &m */)).Fz, bp+40 /* &szHdr */)
+ Xsqlite3GetVarint32(tls, (*Mem)(unsafe.Pointer(bp)).Fz, bp+40 /* &szHdr */)
__2:
;
- if !((*(*U32)(unsafe.Pointer(bp + 40 /* szHdr */)) < U32(3)) || (*(*U32)(unsafe.Pointer(bp + 40 /* szHdr */)) > uint32((*Mem)(unsafe.Pointer(bp /* &m */)).Fn))) {
+ if !(*(*U32)(unsafe.Pointer(bp + 40)) < U32(3) || *(*U32)(unsafe.Pointer(bp + 40)) > uint32((*Mem)(unsafe.Pointer(bp)).Fn)) {
goto __3
}
goto idx_rowid_corruption
@@ -60354,15 +61071,15 @@ __3:
// The last field of the index should be an integer - the ROWID.
// Verify that the last entry really is an integer.
- *(*U32)(unsafe.Pointer(bp + 44 /* typeRowid */)) = U32(*(*U8)(unsafe.Pointer(((*Mem)(unsafe.Pointer(bp /* &m */)).Fz + uintptr((*(*U32)(unsafe.Pointer(bp + 40 /* szHdr */)) - U32(1)))))))
- if !(*(*U32)(unsafe.Pointer(bp + 44 /* typeRowid */)) >= U32(0x80)) {
+ *(*U32)(unsafe.Pointer(bp + 44 /* typeRowid */)) = U32(*(*U8)(unsafe.Pointer((*Mem)(unsafe.Pointer(bp)).Fz + uintptr(*(*U32)(unsafe.Pointer(bp + 40))-U32(1)))))
+ if !(*(*U32)(unsafe.Pointer(bp + 44)) >= U32(0x80)) {
goto __4
}
- Xsqlite3GetVarint32(tls, ((*Mem)(unsafe.Pointer(bp /* &m */)).Fz + uintptr((*(*U32)(unsafe.Pointer(bp + 40 /* szHdr */)) - U32(1)))), bp+44 /* &typeRowid */)
+ Xsqlite3GetVarint32(tls, (*Mem)(unsafe.Pointer(bp)).Fz+uintptr(*(*U32)(unsafe.Pointer(bp + 40))-U32(1)), bp+44 /* &typeRowid */)
__4:
;
- if !(((*(*U32)(unsafe.Pointer(bp + 44 /* typeRowid */)) < U32(1)) || (*(*U32)(unsafe.Pointer(bp + 44 /* typeRowid */)) > U32(9))) || (*(*U32)(unsafe.Pointer(bp + 44 /* typeRowid */)) == U32(7))) {
+ if !(*(*U32)(unsafe.Pointer(bp + 44)) < U32(1) || *(*U32)(unsafe.Pointer(bp + 44)) > U32(9) || *(*U32)(unsafe.Pointer(bp + 44)) == U32(7)) {
goto __5
}
goto idx_rowid_corruption
@@ -60370,7 +61087,7 @@ __5:
;
lenRowid = U32(sqlite3SmallTypeSizes[*(*U32)(unsafe.Pointer(bp + 44 /* typeRowid */))])
- if !(U32((*Mem)(unsafe.Pointer(bp /* &m */)).Fn) < (*(*U32)(unsafe.Pointer(bp + 40 /* szHdr */)) + lenRowid)) {
+ if !(U32((*Mem)(unsafe.Pointer(bp)).Fn) < *(*U32)(unsafe.Pointer(bp + 40))+lenRowid) {
goto __6
}
goto idx_rowid_corruption
@@ -60378,8 +61095,8 @@ __6:
;
// Fetch the integer off the end of the index record
- Xsqlite3VdbeSerialGet(tls, ((*Mem)(unsafe.Pointer(bp /* &m */)).Fz + uintptr((U32((*Mem)(unsafe.Pointer(bp /* &m */)).Fn) - lenRowid))), *(*U32)(unsafe.Pointer(bp + 44 /* typeRowid */)), bp+48 /* &v */)
- *(*I64)(unsafe.Pointer(rowid)) = *(*I64)(unsafe.Pointer(bp + 48 /* &v */ /* &.u */))
+ Xsqlite3VdbeSerialGet(tls, (*Mem)(unsafe.Pointer(bp)).Fz+uintptr(U32((*Mem)(unsafe.Pointer(bp)).Fn)-lenRowid), *(*U32)(unsafe.Pointer(bp + 44 /* typeRowid */)), bp+48 /* &v */)
+ *(*I64)(unsafe.Pointer(rowid)) = *(*I64)(unsafe.Pointer(bp + 48))
Xsqlite3VdbeMemRelease(tls, bp /* &m */)
return SQLITE_OK
@@ -60388,7 +61105,7 @@ __6:
idx_rowid_corruption:
;
Xsqlite3VdbeMemRelease(tls, bp /* &m */)
- return Xsqlite3CorruptError(tls, 83872)
+ return Xsqlite3CorruptError(tls, 84142)
}
// Compare the key of the index entry that cursor pC is pointing to against
@@ -60400,7 +61117,7 @@ idx_rowid_corruption:
// omits the rowid at the end. The rowid at the end of the index entry
// is ignored as well. Hence, this routine only compares the prefixes
// of the keys prior to the final rowid, not the entire key.
-func Xsqlite3VdbeIdxKeyCompare(tls *libc.TLS, db uintptr, pC uintptr, pUnpacked uintptr, res uintptr) int32 { /* sqlite3.c:83886:20: */
+func Xsqlite3VdbeIdxKeyCompare(tls *libc.TLS, db uintptr, pC uintptr, pUnpacked uintptr, res uintptr) int32 { /* sqlite3.c:84156:20: */
bp := tls.Alloc(40)
defer tls.Free(40)
@@ -60409,14 +61126,14 @@ func Xsqlite3VdbeIdxKeyCompare(tls *libc.TLS, db uintptr, pC uintptr, pUnpacked
var pCur uintptr
// var m Mem at bp, 40
- pCur = *(*uintptr)(unsafe.Pointer(pC + 40 /* &.uc */))
+ pCur = *(*uintptr)(unsafe.Pointer(pC + 40))
nCellKey = I64(Xsqlite3BtreePayloadSize(tls, pCur))
// nCellKey will always be between 0 and 0xffffffff because of the way
// that btreeParseCellPtr() and sqlite3GetVarint32() are implemented
- if (nCellKey <= int64(0)) || (nCellKey > int64(0x7fffffff)) {
+ if nCellKey <= int64(0) || nCellKey > int64(0x7fffffff) {
*(*int32)(unsafe.Pointer(res)) = 0
- return Xsqlite3CorruptError(tls, 83905)
+ return Xsqlite3CorruptError(tls, 84175)
}
Xsqlite3VdbeMemInit(tls, bp /* &m */, db, uint16(0))
rc = Xsqlite3VdbeMemFromBtreeZeroOffset(tls, pCur, U32(nCellKey), bp /* &m */)
@@ -60430,16 +61147,16 @@ func Xsqlite3VdbeIdxKeyCompare(tls *libc.TLS, db uintptr, pC uintptr, pUnpacked
// This routine sets the value to be returned by subsequent calls to
// sqlite3_changes() on the database handle 'db'.
-func Xsqlite3VdbeSetChanges(tls *libc.TLS, db uintptr, nChange int32) { /* sqlite3.c:83921:21: */
+func Xsqlite3VdbeSetChanges(tls *libc.TLS, db uintptr, nChange I64) { /* sqlite3.c:84191:21: */
(*Sqlite3)(unsafe.Pointer(db)).FnChange = nChange
- *(*int32)(unsafe.Pointer(db + 108 /* &.nTotalChange */)) += (nChange)
+ *(*I64)(unsafe.Pointer(db + 112)) += nChange
}
// Set a flag in the vdbe to update the change counter when it is finalised
// or reset.
-func Xsqlite3VdbeCountChanges(tls *libc.TLS, v uintptr) { /* sqlite3.c:83931:21: */
- libc.SetBitFieldPtr16Uint32(v+152 /* &.changeCntOn */, Bft(1), 4, 0x10)
+func Xsqlite3VdbeCountChanges(tls *libc.TLS, v uintptr) { /* sqlite3.c:84201:21: */
+ libc.SetBitFieldPtr16Uint32(v+160, Bft(1), 4, 0x10)
}
// Mark every prepared statement associated with a database connection
@@ -60458,20 +61175,20 @@ func Xsqlite3VdbeCountChanges(tls *libc.TLS, v uintptr) { /* sqlite3.c:83931:21:
// Internally, this function just sets the Vdbe.expired flag on all
// prepared statements. The flag is set to 1 for an immediate expiration
// and set to 2 for an advisory expiration.
-func Xsqlite3ExpirePreparedStatements(tls *libc.TLS, db uintptr, iCode int32) { /* sqlite3.c:83953:21: */
+func Xsqlite3ExpirePreparedStatements(tls *libc.TLS, db uintptr, iCode int32) { /* sqlite3.c:84223:21: */
var p uintptr
for p = (*Sqlite3)(unsafe.Pointer(db)).FpVdbe; p != 0; p = (*Vdbe)(unsafe.Pointer(p)).FpNext {
- libc.SetBitFieldPtr16Uint32(p+152 /* &.expired */, (Bft(iCode + 1)), 0, 0x3)
+ libc.SetBitFieldPtr16Uint32(p+160, Bft(iCode+1), 0, 0x3)
}
}
// Return the database associated with the Vdbe.
-func Xsqlite3VdbeDb(tls *libc.TLS, v uintptr) uintptr { /* sqlite3.c:83963:24: */
+func Xsqlite3VdbeDb(tls *libc.TLS, v uintptr) uintptr { /* sqlite3.c:84233:24: */
return (*Vdbe)(unsafe.Pointer(v)).Fdb
}
// Return the SQLITE_PREPARE flags for a Vdbe.
-func Xsqlite3VdbePrepareFlags(tls *libc.TLS, v uintptr) U8 { /* sqlite3.c:83970:19: */
+func Xsqlite3VdbePrepareFlags(tls *libc.TLS, v uintptr) U8 { /* sqlite3.c:84240:19: */
return (*Vdbe)(unsafe.Pointer(v)).FprepFlags
}
@@ -60481,12 +61198,12 @@ func Xsqlite3VdbePrepareFlags(tls *libc.TLS, v uintptr) U8 { /* sqlite3.c:83970:
// constants) to the value before returning it.
//
// The returned value must be freed by the caller using sqlite3ValueFree().
-func Xsqlite3VdbeGetBoundValue(tls *libc.TLS, v uintptr, iVar int32, aff U8) uintptr { /* sqlite3.c:83982:30: */
+func Xsqlite3VdbeGetBoundValue(tls *libc.TLS, v uintptr, iVar int32, aff U8) uintptr { /* sqlite3.c:84252:30: */
if v != 0 {
- var pMem uintptr = ((*Vdbe)(unsafe.Pointer(v)).FaVar + uintptr((iVar-1))*40)
+ var pMem uintptr = (*Vdbe)(unsafe.Pointer(v)).FaVar + uintptr(iVar-1)*40
- if 0 == (int32((*Mem)(unsafe.Pointer(pMem)).Fflags) & MEM_Null) {
+ if 0 == int32((*Mem)(unsafe.Pointer(pMem)).Fflags)&MEM_Null {
var pRet uintptr = Xsqlite3ValueNew(tls, (*Vdbe)(unsafe.Pointer(v)).Fdb)
if pRet != 0 {
Xsqlite3VdbeMemCopy(tls, pRet, pMem)
@@ -60501,12 +61218,12 @@ func Xsqlite3VdbeGetBoundValue(tls *libc.TLS, v uintptr, iVar int32, aff U8) uin
// Configure SQL variable iVar so that binding a new value to it signals
// to sqlite3_reoptimize() that re-preparing the statement may result
// in a better query plan.
-func Xsqlite3VdbeSetVarmask(tls *libc.TLS, v uintptr, iVar int32) { /* sqlite3.c:84004:21: */
+func Xsqlite3VdbeSetVarmask(tls *libc.TLS, v uintptr, iVar int32) { /* sqlite3.c:84274:21: */
if iVar >= 32 {
- *(*U32)(unsafe.Pointer(v + 212 /* &.expmask */)) |= (0x80000000)
+ *(*U32)(unsafe.Pointer(v + 220)) |= 0x80000000
} else {
- *(*U32)(unsafe.Pointer(v + 212 /* &.expmask */)) |= (U32(U32(1)) << (iVar - 1))
+ *(*U32)(unsafe.Pointer(v + 220)) |= U32(U32(1)) << (iVar - 1)
}
}
@@ -60517,7 +61234,7 @@ func Xsqlite3VdbeSetVarmask(tls *libc.TLS, v uintptr, iVar int32) { /* sqlite3.c
// throw an error if it is given inputs that would make it non-deterministic.
// This routine is invoked by date/time functions that use non-deterministic
// features such as 'now'.
-func Xsqlite3NotPureFunc(tls *libc.TLS, pCtx uintptr) int32 { /* sqlite3.c:84023:20: */
+func Xsqlite3NotPureFunc(tls *libc.TLS, pCtx uintptr) int32 { /* sqlite3.c:84293:20: */
bp := tls.Alloc(16)
defer tls.Free(16)
@@ -60525,18 +61242,18 @@ func Xsqlite3NotPureFunc(tls *libc.TLS, pCtx uintptr) int32 { /* sqlite3.c:84023
if (*Sqlite3_context)(unsafe.Pointer(pCtx)).FpVdbe == uintptr(0) {
return 1
}
- pOp = ((*Vdbe)(unsafe.Pointer((*Sqlite3_context)(unsafe.Pointer(pCtx)).FpVdbe)).FaOp + uintptr((*Sqlite3_context)(unsafe.Pointer(pCtx)).FiOp)*20)
+ pOp = (*Vdbe)(unsafe.Pointer((*Sqlite3_context)(unsafe.Pointer(pCtx)).FpVdbe)).FaOp + uintptr((*Sqlite3_context)(unsafe.Pointer(pCtx)).FiOp)*20
if int32((*VdbeOp)(unsafe.Pointer(pOp)).Fopcode) == OP_PureFunc {
var zContext uintptr
var zMsg uintptr
- if (int32((*VdbeOp)(unsafe.Pointer(pOp)).Fp5) & NC_IsCheck) != 0 {
- zContext = ts + 4280 /* "a CHECK constrai..." */
- } else if (int32((*VdbeOp)(unsafe.Pointer(pOp)).Fp5) & NC_GenCol) != 0 {
- zContext = ts + 4299 /* "a generated colu..." */
+ if int32((*VdbeOp)(unsafe.Pointer(pOp)).Fp5)&NC_IsCheck != 0 {
+ zContext = ts + 5086 /* "a CHECK constrai..." */
+ } else if int32((*VdbeOp)(unsafe.Pointer(pOp)).Fp5)&NC_GenCol != 0 {
+ zContext = ts + 5105 /* "a generated colu..." */
} else {
- zContext = ts + 4318 /* "an index" */
+ zContext = ts + 5124 /* "an index" */
}
- zMsg = Xsqlite3_mprintf(tls, ts+4327, /* "non-deterministi..." */
+ zMsg = Xsqlite3_mprintf(tls, ts+5133, /* "non-deterministi..." */
libc.VaList(bp, (*FuncDef)(unsafe.Pointer((*Sqlite3_context)(unsafe.Pointer(pCtx)).FpFunc)).FzName, zContext))
Xsqlite3_result_error(tls, pCtx, zMsg, -1)
Xsqlite3_free(tls, zMsg)
@@ -60548,7 +61265,7 @@ func Xsqlite3NotPureFunc(tls *libc.TLS, pCtx uintptr) int32 { /* sqlite3.c:84023
// Transfer error message text from an sqlite3_vtab.zErrMsg (text stored
// in memory obtained from sqlite3_malloc) into a Vdbe.zErrMsg (text stored
// in memory obtained from sqlite3DbMalloc).
-func Xsqlite3VtabImportErrmsg(tls *libc.TLS, p uintptr, pVtab uintptr) { /* sqlite3.c:84054:21: */
+func Xsqlite3VtabImportErrmsg(tls *libc.TLS, p uintptr, pVtab uintptr) { /* sqlite3.c:84324:21: */
if (*Sqlite3_vtab)(unsafe.Pointer(pVtab)).FzErrMsg != 0 {
var db uintptr = (*Vdbe)(unsafe.Pointer(p)).Fdb
Xsqlite3DbFree(tls, db, (*Vdbe)(unsafe.Pointer(p)).FzErrMsg)
@@ -60564,11 +61281,11 @@ func Xsqlite3VtabImportErrmsg(tls *libc.TLS, p uintptr, pVtab uintptr) { /* sqli
//
// This function is used to free UnpackedRecord structures allocated by
// the vdbeUnpackRecord() function found in vdbeapi.c.
-func vdbeFreeUnpacked(tls *libc.TLS, db uintptr, nField int32, p uintptr) { /* sqlite3.c:84075:13: */
+func vdbeFreeUnpacked(tls *libc.TLS, db uintptr, nField int32, p uintptr) { /* sqlite3.c:84345:13: */
if p != 0 {
var i int32
for i = 0; i < nField; i++ {
- var pMem uintptr = ((*UnpackedRecord)(unsafe.Pointer(p)).FaMem + uintptr(i)*40)
+ var pMem uintptr = (*UnpackedRecord)(unsafe.Pointer(p)).FaMem + uintptr(i)*40
if (*Mem)(unsafe.Pointer(pMem)).FzMalloc != 0 {
Xsqlite3VdbeMemRelease(tls, pMem)
}
@@ -60581,7 +61298,7 @@ func vdbeFreeUnpacked(tls *libc.TLS, db uintptr, nField int32, p uintptr) { /* s
// then cursor passed as the second argument should point to the row about
// to be update or deleted. If the application calls sqlite3_preupdate_old(),
// the required value will be read from the row the cursor points to.
-func Xsqlite3VdbePreUpdateHook(tls *libc.TLS, v uintptr, pCsr uintptr, op int32, zDb uintptr, pTab uintptr, iKey1 I64, iReg int32, iBlobWrite int32) { /* sqlite3.c:84094:21: */
+func Xsqlite3VdbePreUpdateHook(tls *libc.TLS, v uintptr, pCsr uintptr, op int32, zDb uintptr, pTab uintptr, iKey1 I64, iReg int32, iBlobWrite int32) { /* sqlite3.c:84364:21: */
bp := tls.Alloc(88)
defer tls.Free(88)
@@ -60592,12 +61309,12 @@ func Xsqlite3VdbePreUpdateHook(tls *libc.TLS, v uintptr, pCsr uintptr, op int32,
var zTbl uintptr = (*Table)(unsafe.Pointer(pTab)).FzName
libc.Xmemset(tls, bp /* &preupdate */, 0, uint32(unsafe.Sizeof(PreUpdate{})))
- if (libc.Bool32(((*Table)(unsafe.Pointer((pTab))).FtabFlags & U32(TF_WithoutRowid)) == U32(0))) == 0 {
+ if libc.Bool32((*Table)(unsafe.Pointer(pTab)).FtabFlags&U32(TF_WithoutRowid) == U32(0)) == 0 {
iKey1 = libc.AssignInt64(&iKey2, int64(0))
(*PreUpdate)(unsafe.Pointer(bp /* &preupdate */)).FpPk = Xsqlite3PrimaryKeyIndex(tls, pTab)
} else {
if op == SQLITE_UPDATE {
- iKey2 = *(*I64)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(v)).FaMem + uintptr(iReg)*40 /* &.u */))
+ iKey2 = *(*I64)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(v)).FaMem + uintptr(iReg)*40))
} else {
iKey2 = iKey1
}
@@ -60622,18 +61339,18 @@ func Xsqlite3VdbePreUpdateHook(tls *libc.TLS, v uintptr, pCsr uintptr, op int32,
})(unsafe.Pointer(&struct{ uintptr }{(*Sqlite3)(unsafe.Pointer(db)).FxPreUpdateCallback})).f(tls, (*Sqlite3)(unsafe.Pointer(db)).FpPreUpdateArg, db, op, zDb, zTbl, iKey1, iKey2)
(*Sqlite3)(unsafe.Pointer(db)).FpPreUpdate = uintptr(0)
Xsqlite3DbFree(tls, db, (*PreUpdate)(unsafe.Pointer(bp /* &preupdate */)).FaRecord)
- vdbeFreeUnpacked(tls, db, (int32((*PreUpdate)(unsafe.Pointer(bp /* &preupdate */)).Fkeyinfo.FnKeyField) + 1), (*PreUpdate)(unsafe.Pointer(bp /* &preupdate */)).FpUnpacked)
- vdbeFreeUnpacked(tls, db, (int32((*PreUpdate)(unsafe.Pointer(bp /* &preupdate */)).Fkeyinfo.FnKeyField) + 1), (*PreUpdate)(unsafe.Pointer(bp /* &preupdate */)).FpNewUnpacked)
- if (*PreUpdate)(unsafe.Pointer(bp /* &preupdate */)).FaNew != 0 {
+ vdbeFreeUnpacked(tls, db, int32((*PreUpdate)(unsafe.Pointer(bp)).Fkeyinfo.FnKeyField)+1, (*PreUpdate)(unsafe.Pointer(bp /* &preupdate */)).FpUnpacked)
+ vdbeFreeUnpacked(tls, db, int32((*PreUpdate)(unsafe.Pointer(bp)).Fkeyinfo.FnKeyField)+1, (*PreUpdate)(unsafe.Pointer(bp /* &preupdate */)).FpNewUnpacked)
+ if (*PreUpdate)(unsafe.Pointer(bp)).FaNew != 0 {
var i int32
for i = 0; i < int32((*VdbeCursor)(unsafe.Pointer(pCsr)).FnField); i++ {
- Xsqlite3VdbeMemRelease(tls, ((*PreUpdate)(unsafe.Pointer(bp /* &preupdate */)).FaNew + uintptr(i)*40))
+ Xsqlite3VdbeMemRelease(tls, (*PreUpdate)(unsafe.Pointer(bp)).FaNew+uintptr(i)*40)
}
Xsqlite3DbFreeNN(tls, db, (*PreUpdate)(unsafe.Pointer(bp /* &preupdate */)).FaNew)
}
}
-var fakeSortOrder U8 = U8(0) /* sqlite3.c:84108:19 */
+var fakeSortOrder U8 = U8(0) /* sqlite3.c:84378:19 */
//************* End of vdbeaux.c ********************************************
//************* Begin file vdbeapi.c ****************************************
@@ -60659,17 +61376,17 @@ var fakeSortOrder U8 = U8(0) /* sqlite3.c:84108:19 */
// that sqlite3_prepare() generates. For example, if new functions or
// collating sequences are registered or if an authorizer function is
// added or changed.
-func Xsqlite3_expired(tls *libc.TLS, pStmt uintptr) int32 { /* sqlite3.c:84185:16: */
+func Xsqlite3_expired(tls *libc.TLS, pStmt uintptr) int32 { /* sqlite3.c:84457:16: */
var p uintptr = pStmt
- return (libc.Bool32((p == uintptr(0)) || ((Bft(int32(*(*uint16)(unsafe.Pointer(p + 152 /* &.expired */)) & 0x3 >> 0))) != 0)))
+ return libc.Bool32(p == uintptr(0) || Bft(int32(*(*uint16)(unsafe.Pointer(p + 160))&0x3>>0)) != 0)
}
// Check on a Vdbe to make sure it has not been finalized. Log
// an error and return true if it has been finalized (or is otherwise
// invalid). Return false if it is ok.
-func vdbeSafety(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:84196:12: */
+func vdbeSafety(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:84468:12: */
if (*Vdbe)(unsafe.Pointer(p)).Fdb == uintptr(0) {
- Xsqlite3_log(tls, SQLITE_MISUSE, ts+4363 /* "API called with ..." */, 0)
+ Xsqlite3_log(tls, SQLITE_MISUSE, ts+5169 /* "API called with ..." */, 0)
return 1
} else {
return 0
@@ -60677,9 +61394,9 @@ func vdbeSafety(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:84196:12: */
return int32(0)
}
-func vdbeSafetyNotNull(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:84204:12: */
+func vdbeSafetyNotNull(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:84476:12: */
if p == uintptr(0) {
- Xsqlite3_log(tls, SQLITE_MISUSE, ts+4408 /* "API called with ..." */, 0)
+ Xsqlite3_log(tls, SQLITE_MISUSE, ts+5214 /* "API called with ..." */, 0)
return 1
} else {
return vdbeSafety(tls, p)
@@ -60689,7 +61406,7 @@ func vdbeSafetyNotNull(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:84204:12:
// Invoke the profile callback. This routine is only called if we already
// know that the profile callback is defined and needs to be invoked.
-func invokeProfileCallback(tls *libc.TLS, db uintptr, p uintptr) { /* sqlite3.c:84218:29: */
+func invokeProfileCallback(tls *libc.TLS, db uintptr, p uintptr) { /* sqlite3.c:84490:29: */
bp := tls.Alloc(16)
defer tls.Free(16)
@@ -60698,16 +61415,16 @@ func invokeProfileCallback(tls *libc.TLS, db uintptr, p uintptr) { /* sqlite3.c:
// var iElapse Sqlite3_int64 at bp+8, 8
Xsqlite3OsCurrentTimeInt64(tls, (*Sqlite3)(unsafe.Pointer(db)).FpVfs, bp /* &iNow */)
- *(*Sqlite3_int64)(unsafe.Pointer(bp + 8 /* iElapse */)) = ((*(*Sqlite3_int64)(unsafe.Pointer(bp /* iNow */)) - (*Vdbe)(unsafe.Pointer(p)).FstartTime) * int64(1000000))
+ *(*Sqlite3_int64)(unsafe.Pointer(bp + 8 /* iElapse */)) = (*(*Sqlite3_int64)(unsafe.Pointer(bp)) - (*Vdbe)(unsafe.Pointer(p)).FstartTime) * int64(1000000)
if (*Sqlite3)(unsafe.Pointer(db)).FxProfile != 0 {
(*struct {
f func(*libc.TLS, uintptr, uintptr, U64)
})(unsafe.Pointer(&struct{ uintptr }{(*Sqlite3)(unsafe.Pointer(db)).FxProfile})).f(tls, (*Sqlite3)(unsafe.Pointer(db)).FpProfileArg, (*Vdbe)(unsafe.Pointer(p)).FzSql, uint64(*(*Sqlite3_int64)(unsafe.Pointer(bp + 8 /* iElapse */))))
}
- if (int32((*Sqlite3)(unsafe.Pointer(db)).FmTrace) & SQLITE_TRACE_PROFILE) != 0 {
+ if int32((*Sqlite3)(unsafe.Pointer(db)).FmTrace)&SQLITE_TRACE_PROFILE != 0 {
(*struct {
f func(*libc.TLS, U32, uintptr, uintptr, uintptr) int32
- })(unsafe.Pointer(&struct{ uintptr }{*(*uintptr)(unsafe.Pointer(db + 208 /* &.trace */))})).f(tls, uint32(SQLITE_TRACE_PROFILE), (*Sqlite3)(unsafe.Pointer(db)).FpTraceArg, p, bp+8 /* &iElapse */)
+ })(unsafe.Pointer(&struct{ uintptr }{*(*uintptr)(unsafe.Pointer(db + 216 /* &.trace */))})).f(tls, uint32(SQLITE_TRACE_PROFILE), (*Sqlite3)(unsafe.Pointer(db)).FpTraceArg, p, bp+8 /* &iElapse */)
}
(*Vdbe)(unsafe.Pointer(p)).FstartTime = int64(0)
}
@@ -60722,7 +61439,7 @@ func invokeProfileCallback(tls *libc.TLS, db uintptr, p uintptr) { /* sqlite3.c:
//
// This routine sets the error code and string returned by
// sqlite3_errcode(), sqlite3_errmsg() and sqlite3_errmsg16().
-func Xsqlite3_finalize(tls *libc.TLS, pStmt uintptr) int32 { /* sqlite3.c:84256:16: */
+func Xsqlite3_finalize(tls *libc.TLS, pStmt uintptr) int32 { /* sqlite3.c:84528:16: */
var rc int32
if pStmt == uintptr(0) {
// IMPLEMENTATION-OF: R-57228-12904 Invoking sqlite3_finalize() on a NULL
@@ -60732,10 +61449,10 @@ func Xsqlite3_finalize(tls *libc.TLS, pStmt uintptr) int32 { /* sqlite3.c:84256:
var v uintptr = pStmt
var db uintptr = (*Vdbe)(unsafe.Pointer(v)).Fdb
if vdbeSafety(tls, v) != 0 {
- return Xsqlite3MisuseError(tls, 84265)
+ return Xsqlite3MisuseError(tls, 84537)
}
Xsqlite3_mutex_enter(tls, (*Sqlite3)(unsafe.Pointer(db)).Fmutex)
- if ((*Vdbe)(unsafe.Pointer(v)).FstartTime) > int64(0) {
+ if (*Vdbe)(unsafe.Pointer(v)).FstartTime > int64(0) {
invokeProfileCallback(tls, db, v)
}
@@ -60752,7 +61469,7 @@ func Xsqlite3_finalize(tls *libc.TLS, pStmt uintptr) int32 { /* sqlite3.c:84256:
//
// This routine sets the error code and string returned by
// sqlite3_errcode(), sqlite3_errmsg() and sqlite3_errmsg16().
-func Xsqlite3_reset(tls *libc.TLS, pStmt uintptr) int32 { /* sqlite3.c:84283:16: */
+func Xsqlite3_reset(tls *libc.TLS, pStmt uintptr) int32 { /* sqlite3.c:84555:16: */
var rc int32
if pStmt == uintptr(0) {
rc = SQLITE_OK
@@ -60760,7 +61477,7 @@ func Xsqlite3_reset(tls *libc.TLS, pStmt uintptr) int32 { /* sqlite3.c:84283:16:
var v uintptr = pStmt
var db uintptr = (*Vdbe)(unsafe.Pointer(v)).Fdb
Xsqlite3_mutex_enter(tls, (*Sqlite3)(unsafe.Pointer(db)).Fmutex)
- if ((*Vdbe)(unsafe.Pointer(v)).FstartTime) > int64(0) {
+ if (*Vdbe)(unsafe.Pointer(v)).FstartTime > int64(0) {
invokeProfileCallback(tls, db, v)
}
@@ -60774,19 +61491,19 @@ func Xsqlite3_reset(tls *libc.TLS, pStmt uintptr) int32 { /* sqlite3.c:84283:16:
}
// Set all the parameters in the compiled SQL statement to NULL.
-func Xsqlite3_clear_bindings(tls *libc.TLS, pStmt uintptr) int32 { /* sqlite3.c:84304:16: */
+func Xsqlite3_clear_bindings(tls *libc.TLS, pStmt uintptr) int32 { /* sqlite3.c:84576:16: */
var i int32
var rc int32 = SQLITE_OK
var p uintptr = pStmt
var mutex uintptr = (*Sqlite3)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(pStmt)).Fdb)).Fmutex
Xsqlite3_mutex_enter(tls, mutex)
for i = 0; i < int32((*Vdbe)(unsafe.Pointer(p)).FnVar); i++ {
- Xsqlite3VdbeMemRelease(tls, ((*Vdbe)(unsafe.Pointer(p)).FaVar + uintptr(i)*40))
+ Xsqlite3VdbeMemRelease(tls, (*Vdbe)(unsafe.Pointer(p)).FaVar+uintptr(i)*40)
(*Mem)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FaVar + uintptr(i)*40)).Fflags = U16(MEM_Null)
}
if (*Vdbe)(unsafe.Pointer(p)).Fexpmask != 0 {
- libc.SetBitFieldPtr16Uint32(p+152 /* &.expired */, Bft(1), 0, 0x3)
+ libc.SetBitFieldPtr16Uint32(p+160, Bft(1), 0, 0x3)
}
Xsqlite3_mutex_leave(tls, mutex)
return rc
@@ -60796,19 +61513,19 @@ func Xsqlite3_clear_bindings(tls *libc.TLS, pStmt uintptr) int32 { /* sqlite3.c:
//
// The following routines extract information from a Mem or sqlite3_value
// structure.
-func Xsqlite3_value_blob(tls *libc.TLS, pVal uintptr) uintptr { /* sqlite3.c:84329:23: */
+func Xsqlite3_value_blob(tls *libc.TLS, pVal uintptr) uintptr { /* sqlite3.c:84601:23: */
var p uintptr = pVal
- if (int32((*Mem)(unsafe.Pointer(p)).Fflags) & (MEM_Blob | MEM_Str)) != 0 {
- if (func() int32 {
- if (int32((*Mem)(unsafe.Pointer((p))).Fflags) & MEM_Zero) != 0 {
+ if int32((*Mem)(unsafe.Pointer(p)).Fflags)&(MEM_Blob|MEM_Str) != 0 {
+ if func() int32 {
+ if int32((*Mem)(unsafe.Pointer(p)).Fflags)&MEM_Zero != 0 {
return Xsqlite3VdbeMemExpandBlob(tls, p)
}
return 0
- }()) != SQLITE_OK {
+ }() != SQLITE_OK {
return uintptr(0)
}
- *(*U16)(unsafe.Pointer(p + 8 /* &.flags */)) |= U16((MEM_Blob))
+ *(*U16)(unsafe.Pointer(p + 8)) |= U16(MEM_Blob)
if (*Mem)(unsafe.Pointer(p)).Fn != 0 {
return (*Mem)(unsafe.Pointer(p)).Fz
}
@@ -60819,42 +61536,42 @@ func Xsqlite3_value_blob(tls *libc.TLS, pVal uintptr) uintptr { /* sqlite3.c:843
return uintptr(0)
}
-func Xsqlite3_value_bytes(tls *libc.TLS, pVal uintptr) int32 { /* sqlite3.c:84342:16: */
+func Xsqlite3_value_bytes(tls *libc.TLS, pVal uintptr) int32 { /* sqlite3.c:84614:16: */
return Xsqlite3ValueBytes(tls, pVal, uint8(SQLITE_UTF8))
}
-func Xsqlite3_value_bytes16(tls *libc.TLS, pVal uintptr) int32 { /* sqlite3.c:84345:16: */
+func Xsqlite3_value_bytes16(tls *libc.TLS, pVal uintptr) int32 { /* sqlite3.c:84617:16: */
return Xsqlite3ValueBytes(tls, pVal, uint8(SQLITE_UTF16LE))
}
-func Xsqlite3_value_double(tls *libc.TLS, pVal uintptr) float64 { /* sqlite3.c:84348:19: */
+func Xsqlite3_value_double(tls *libc.TLS, pVal uintptr) float64 { /* sqlite3.c:84620:19: */
return Xsqlite3VdbeRealValue(tls, pVal)
}
-func Xsqlite3_value_int(tls *libc.TLS, pVal uintptr) int32 { /* sqlite3.c:84351:16: */
+func Xsqlite3_value_int(tls *libc.TLS, pVal uintptr) int32 { /* sqlite3.c:84623:16: */
return int32(Xsqlite3VdbeIntValue(tls, pVal))
}
-func Xsqlite3_value_int64(tls *libc.TLS, pVal uintptr) Sqlite_int64 { /* sqlite3.c:84354:25: */
+func Xsqlite3_value_int64(tls *libc.TLS, pVal uintptr) Sqlite_int64 { /* sqlite3.c:84626:25: */
return Xsqlite3VdbeIntValue(tls, pVal)
}
-func Xsqlite3_value_subtype(tls *libc.TLS, pVal uintptr) uint32 { /* sqlite3.c:84357:25: */
+func Xsqlite3_value_subtype(tls *libc.TLS, pVal uintptr) uint32 { /* sqlite3.c:84629:25: */
var pMem uintptr = pVal
return func() uint32 {
- if (int32((*Mem)(unsafe.Pointer(pMem)).Fflags) & MEM_Subtype) != 0 {
+ if int32((*Mem)(unsafe.Pointer(pMem)).Fflags)&MEM_Subtype != 0 {
return uint32((*Mem)(unsafe.Pointer(pMem)).FeSubtype)
}
return uint32(0)
}()
}
-func Xsqlite3_value_pointer(tls *libc.TLS, pVal uintptr, zPType uintptr) uintptr { /* sqlite3.c:84361:17: */
+func Xsqlite3_value_pointer(tls *libc.TLS, pVal uintptr, zPType uintptr) uintptr { /* sqlite3.c:84633:17: */
var p uintptr = pVal
- if ((((int32((*Mem)(unsafe.Pointer(p)).Fflags) & ((MEM_TypeMask | MEM_Term) | MEM_Subtype)) == ((MEM_Null | MEM_Term) | MEM_Subtype)) &&
- (zPType != uintptr(0))) &&
- (int32((*Mem)(unsafe.Pointer(p)).FeSubtype) == 'p')) &&
- (libc.Xstrcmp(tls, *(*uintptr)(unsafe.Pointer(p /* &.u */)), zPType) == 0) {
+ if int32((*Mem)(unsafe.Pointer(p)).Fflags)&(MEM_TypeMask|MEM_Term|MEM_Subtype) == MEM_Null|MEM_Term|MEM_Subtype &&
+ zPType != uintptr(0) &&
+ int32((*Mem)(unsafe.Pointer(p)).FeSubtype) == 'p' &&
+ libc.Xstrcmp(tls, *(*uintptr)(unsafe.Pointer(p)), zPType) == 0 {
return (*Mem)(unsafe.Pointer(p)).Fz
} else {
return uintptr(0)
@@ -60862,27 +61579,27 @@ func Xsqlite3_value_pointer(tls *libc.TLS, pVal uintptr, zPType uintptr) uintptr
return uintptr(0)
}
-func Xsqlite3_value_text(tls *libc.TLS, pVal uintptr) uintptr { /* sqlite3.c:84374:32: */
+func Xsqlite3_value_text(tls *libc.TLS, pVal uintptr) uintptr { /* sqlite3.c:84646:32: */
return Xsqlite3ValueText(tls, pVal, uint8(SQLITE_UTF8))
}
-func Xsqlite3_value_text16(tls *libc.TLS, pVal uintptr) uintptr { /* sqlite3.c:84378:23: */
+func Xsqlite3_value_text16(tls *libc.TLS, pVal uintptr) uintptr { /* sqlite3.c:84650:23: */
return Xsqlite3ValueText(tls, pVal, uint8(SQLITE_UTF16LE))
}
-func Xsqlite3_value_text16be(tls *libc.TLS, pVal uintptr) uintptr { /* sqlite3.c:84381:23: */
+func Xsqlite3_value_text16be(tls *libc.TLS, pVal uintptr) uintptr { /* sqlite3.c:84653:23: */
return Xsqlite3ValueText(tls, pVal, uint8(SQLITE_UTF16BE))
}
-func Xsqlite3_value_text16le(tls *libc.TLS, pVal uintptr) uintptr { /* sqlite3.c:84384:23: */
+func Xsqlite3_value_text16le(tls *libc.TLS, pVal uintptr) uintptr { /* sqlite3.c:84656:23: */
return Xsqlite3ValueText(tls, pVal, uint8(SQLITE_UTF16LE))
}
// EVIDENCE-OF: R-12793-43283 Every value in SQLite has one of five
// fundamental datatypes: 64-bit signed integer 64-bit IEEE floating
// point number string BLOB NULL
-func Xsqlite3_value_type(tls *libc.TLS, pVal uintptr) int32 { /* sqlite3.c:84392:16: */
- return int32(aType[(int32((*Sqlite3_value)(unsafe.Pointer(pVal)).Fflags) & MEM_AffMask)])
+func Xsqlite3_value_type(tls *libc.TLS, pVal uintptr) int32 { /* sqlite3.c:84664:16: */
+ return int32(aType[int32((*Sqlite3_value)(unsafe.Pointer(pVal)).Fflags)&MEM_AffMask])
}
var aType = [64]U8{
@@ -60950,20 +61667,20 @@ var aType = [64]U8{
U8(SQLITE_NULL), // 0x3d (not possible)
U8(SQLITE_FLOAT), // 0x3e (not possible)
U8(SQLITE_NULL), // 0x3f (not possible)
-} /* sqlite3.c:84393:19 */
+} /* sqlite3.c:84665:19 */
// Return true if a parameter to xUpdate represents an unchanged column
-func Xsqlite3_value_nochange(tls *libc.TLS, pVal uintptr) int32 { /* sqlite3.c:84478:16: */
- return (libc.Bool32((int32((*Sqlite3_value)(unsafe.Pointer(pVal)).Fflags) & (MEM_Null | MEM_Zero)) == (MEM_Null | MEM_Zero)))
+func Xsqlite3_value_nochange(tls *libc.TLS, pVal uintptr) int32 { /* sqlite3.c:84750:16: */
+ return libc.Bool32(int32((*Sqlite3_value)(unsafe.Pointer(pVal)).Fflags)&(MEM_Null|MEM_Zero) == MEM_Null|MEM_Zero)
}
// Return true if a parameter value originated from an sqlite3_bind()
-func Xsqlite3_value_frombind(tls *libc.TLS, pVal uintptr) int32 { /* sqlite3.c:84483:16: */
- return (libc.Bool32((int32((*Sqlite3_value)(unsafe.Pointer(pVal)).Fflags) & MEM_FromBind) != 0))
+func Xsqlite3_value_frombind(tls *libc.TLS, pVal uintptr) int32 { /* sqlite3.c:84755:16: */
+ return libc.Bool32(int32((*Sqlite3_value)(unsafe.Pointer(pVal)).Fflags)&MEM_FromBind != 0)
}
// Make a copy of an sqlite3_value object
-func Xsqlite3_value_dup(tls *libc.TLS, pOrig uintptr) uintptr { /* sqlite3.c:84489:26: */
+func Xsqlite3_value_dup(tls *libc.TLS, pOrig uintptr) uintptr { /* sqlite3.c:84761:26: */
var pNew uintptr
if pOrig == uintptr(0) {
return uintptr(0)
@@ -60973,12 +61690,12 @@ func Xsqlite3_value_dup(tls *libc.TLS, pOrig uintptr) uintptr { /* sqlite3.c:844
return uintptr(0)
}
libc.Xmemset(tls, pNew, 0, uint32(unsafe.Sizeof(Sqlite3_value{})))
- libc.Xmemcpy(tls, pNew, pOrig, uint32((uintptr(0) + 20 /* &.zMalloc */)))
- *(*U16)(unsafe.Pointer(pNew + 8 /* &.flags */)) &= libc.Uint16FromInt32((libc.CplInt32(MEM_Dyn)))
+ libc.Xmemcpy(tls, pNew, pOrig, uint32(uintptr(0)+20))
+ *(*U16)(unsafe.Pointer(pNew + 8)) &= libc.Uint16FromInt32(libc.CplInt32(MEM_Dyn))
(*Sqlite3_value)(unsafe.Pointer(pNew)).Fdb = uintptr(0)
- if (int32((*Sqlite3_value)(unsafe.Pointer(pNew)).Fflags) & (MEM_Str | MEM_Blob)) != 0 {
- *(*U16)(unsafe.Pointer(pNew + 8 /* &.flags */)) &= libc.Uint16FromInt32((libc.CplInt32((MEM_Static | MEM_Dyn))))
- *(*U16)(unsafe.Pointer(pNew + 8 /* &.flags */)) |= U16((MEM_Ephem))
+ if int32((*Sqlite3_value)(unsafe.Pointer(pNew)).Fflags)&(MEM_Str|MEM_Blob) != 0 {
+ *(*U16)(unsafe.Pointer(pNew + 8)) &= libc.Uint16FromInt32(libc.CplInt32(MEM_Static | MEM_Dyn))
+ *(*U16)(unsafe.Pointer(pNew + 8)) |= U16(MEM_Ephem)
if Xsqlite3VdbeMemMakeWriteable(tls, pNew) != SQLITE_OK {
Xsqlite3ValueFree(tls, pNew)
pNew = uintptr(0)
@@ -60989,7 +61706,7 @@ func Xsqlite3_value_dup(tls *libc.TLS, pOrig uintptr) uintptr { /* sqlite3.c:844
// Destroy an sqlite3_value object previously obtained from
// sqlite3_value_dup().
-func Xsqlite3_value_free(tls *libc.TLS, pOld uintptr) { /* sqlite3.c:84512:17: */
+func Xsqlite3_value_free(tls *libc.TLS, pOld uintptr) { /* sqlite3.c:84784:17: */
Xsqlite3ValueFree(tls, pOld)
}
@@ -60999,22 +61716,30 @@ func Xsqlite3_value_free(tls *libc.TLS, pOld uintptr) { /* sqlite3.c:84512:17: *
// the function result.
//
// The setStrOrError() function calls sqlite3VdbeMemSetStr() to store the
-// result as a string or blob but if the string or blob is too large, it
-// then sets the error code to SQLITE_TOOBIG
+// result as a string or blob. Appropriate errors are set if the string/blob
+// is too big or if an OOM occurs.
//
// The invokeValueDestructor(P,X) routine invokes destructor function X()
// on value P is not going to be used and need to be destroyed.
-func setResultStrOrError(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, enc U8, xDel uintptr) { /* sqlite3.c:84528:13: */
- if Xsqlite3VdbeMemSetStr(tls, (*Sqlite3_context)(unsafe.Pointer(pCtx)).FpOut, z, int64(n), enc, xDel) == SQLITE_TOOBIG {
- Xsqlite3_result_error_toobig(tls, pCtx)
+func setResultStrOrError(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, enc U8, xDel uintptr) { /* sqlite3.c:84800:13: */
+ var rc int32 = Xsqlite3VdbeMemSetStr(tls, (*Sqlite3_context)(unsafe.Pointer(pCtx)).FpOut, z, int64(n), enc, xDel)
+ if rc != 0 {
+ if rc == SQLITE_TOOBIG {
+ Xsqlite3_result_error_toobig(tls, pCtx)
+ } else {
+ // The only errors possible from sqlite3VdbeMemSetStr are
+ // SQLITE_TOOBIG and SQLITE_NOMEM
+
+ Xsqlite3_result_error_nomem(tls, pCtx)
+ }
}
}
-func invokeValueDestructor(tls *libc.TLS, p uintptr, xDel uintptr, pCtx uintptr) int32 { /* sqlite3.c:84539:12: */
+func invokeValueDestructor(tls *libc.TLS, p uintptr, xDel uintptr, pCtx uintptr) int32 { /* sqlite3.c:84819:12: */
if xDel == uintptr(0) {
// noop
- } else if xDel == (libc.UintptrFromInt32(-1)) {
+ } else if xDel == libc.UintptrFromInt32(-1) {
// noop
} else {
(*struct{ f func(*libc.TLS, uintptr) })(unsafe.Pointer(&struct{ uintptr }{xDel})).f(tls, p)
@@ -61023,12 +61748,12 @@ func invokeValueDestructor(tls *libc.TLS, p uintptr, xDel uintptr, pCtx uintptr)
return SQLITE_TOOBIG
}
-func Xsqlite3_result_blob(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, xDel uintptr) { /* sqlite3.c:84555:17: */
+func Xsqlite3_result_blob(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, xDel uintptr) { /* sqlite3.c:84835:17: */
setResultStrOrError(tls, pCtx, z, n, uint8(0), xDel)
}
-func Xsqlite3_result_blob64(tls *libc.TLS, pCtx uintptr, z uintptr, n Sqlite3_uint64, xDel uintptr) { /* sqlite3.c:84565:17: */
+func Xsqlite3_result_blob64(tls *libc.TLS, pCtx uintptr, z uintptr, n Sqlite3_uint64, xDel uintptr) { /* sqlite3.c:84845:17: */
if n > uint64(0x7fffffff) {
invokeValueDestructor(tls, z, xDel, pCtx)
@@ -61037,39 +61762,39 @@ func Xsqlite3_result_blob64(tls *libc.TLS, pCtx uintptr, z uintptr, n Sqlite3_ui
}
}
-func Xsqlite3_result_double(tls *libc.TLS, pCtx uintptr, rVal float64) { /* sqlite3.c:84579:17: */
+func Xsqlite3_result_double(tls *libc.TLS, pCtx uintptr, rVal float64) { /* sqlite3.c:84859:17: */
Xsqlite3VdbeMemSetDouble(tls, (*Sqlite3_context)(unsafe.Pointer(pCtx)).FpOut, rVal)
}
-func Xsqlite3_result_error(tls *libc.TLS, pCtx uintptr, z uintptr, n int32) { /* sqlite3.c:84583:17: */
+func Xsqlite3_result_error(tls *libc.TLS, pCtx uintptr, z uintptr, n int32) { /* sqlite3.c:84863:17: */
(*Sqlite3_context)(unsafe.Pointer(pCtx)).FisError = SQLITE_ERROR
Xsqlite3VdbeMemSetStr(tls, (*Sqlite3_context)(unsafe.Pointer(pCtx)).FpOut, z, int64(n), uint8(SQLITE_UTF8), libc.UintptrFromInt32(-1))
}
-func Xsqlite3_result_error16(tls *libc.TLS, pCtx uintptr, z uintptr, n int32) { /* sqlite3.c:84589:17: */
+func Xsqlite3_result_error16(tls *libc.TLS, pCtx uintptr, z uintptr, n int32) { /* sqlite3.c:84869:17: */
(*Sqlite3_context)(unsafe.Pointer(pCtx)).FisError = SQLITE_ERROR
Xsqlite3VdbeMemSetStr(tls, (*Sqlite3_context)(unsafe.Pointer(pCtx)).FpOut, z, int64(n), uint8(SQLITE_UTF16LE), libc.UintptrFromInt32(-1))
}
-func Xsqlite3_result_int(tls *libc.TLS, pCtx uintptr, iVal int32) { /* sqlite3.c:84595:17: */
+func Xsqlite3_result_int(tls *libc.TLS, pCtx uintptr, iVal int32) { /* sqlite3.c:84875:17: */
Xsqlite3VdbeMemSetInt64(tls, (*Sqlite3_context)(unsafe.Pointer(pCtx)).FpOut, I64(iVal))
}
-func Xsqlite3_result_int64(tls *libc.TLS, pCtx uintptr, iVal I64) { /* sqlite3.c:84599:17: */
+func Xsqlite3_result_int64(tls *libc.TLS, pCtx uintptr, iVal I64) { /* sqlite3.c:84879:17: */
Xsqlite3VdbeMemSetInt64(tls, (*Sqlite3_context)(unsafe.Pointer(pCtx)).FpOut, iVal)
}
-func Xsqlite3_result_null(tls *libc.TLS, pCtx uintptr) { /* sqlite3.c:84603:17: */
+func Xsqlite3_result_null(tls *libc.TLS, pCtx uintptr) { /* sqlite3.c:84883:17: */
Xsqlite3VdbeMemSetNull(tls, (*Sqlite3_context)(unsafe.Pointer(pCtx)).FpOut)
}
-func Xsqlite3_result_pointer(tls *libc.TLS, pCtx uintptr, pPtr uintptr, zPType uintptr, xDestructor uintptr) { /* sqlite3.c:84607:17: */
+func Xsqlite3_result_pointer(tls *libc.TLS, pCtx uintptr, pPtr uintptr, zPType uintptr, xDestructor uintptr) { /* sqlite3.c:84887:17: */
var pOut uintptr = (*Sqlite3_context)(unsafe.Pointer(pCtx)).FpOut
Xsqlite3VdbeMemRelease(tls, pOut)
@@ -61077,19 +61802,19 @@ func Xsqlite3_result_pointer(tls *libc.TLS, pCtx uintptr, pPtr uintptr, zPType u
Xsqlite3VdbeMemSetPointer(tls, pOut, pPtr, zPType, xDestructor)
}
-func Xsqlite3_result_subtype(tls *libc.TLS, pCtx uintptr, eSubtype uint32) { /* sqlite3.c:84619:17: */
+func Xsqlite3_result_subtype(tls *libc.TLS, pCtx uintptr, eSubtype uint32) { /* sqlite3.c:84899:17: */
var pOut uintptr = (*Sqlite3_context)(unsafe.Pointer(pCtx)).FpOut
- (*Mem)(unsafe.Pointer(pOut)).FeSubtype = (U8(eSubtype & uint32(0xff)))
- *(*U16)(unsafe.Pointer(pOut + 8 /* &.flags */)) |= U16((MEM_Subtype))
+ (*Mem)(unsafe.Pointer(pOut)).FeSubtype = U8(eSubtype & uint32(0xff))
+ *(*U16)(unsafe.Pointer(pOut + 8)) |= U16(MEM_Subtype)
}
-func Xsqlite3_result_text(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, xDel uintptr) { /* sqlite3.c:84625:17: */
+func Xsqlite3_result_text(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, xDel uintptr) { /* sqlite3.c:84905:17: */
setResultStrOrError(tls, pCtx, z, n, uint8(SQLITE_UTF8), xDel)
}
-func Xsqlite3_result_text64(tls *libc.TLS, pCtx uintptr, z uintptr, n Sqlite3_uint64, xDel uintptr, enc uint8) { /* sqlite3.c:84634:17: */
+func Xsqlite3_result_text64(tls *libc.TLS, pCtx uintptr, z uintptr, n Sqlite3_uint64, xDel uintptr, enc uint8) { /* sqlite3.c:84914:17: */
if int32(enc) == SQLITE_UTF16 {
enc = uint8(SQLITE_UTF16LE)
@@ -61101,64 +61826,64 @@ func Xsqlite3_result_text64(tls *libc.TLS, pCtx uintptr, z uintptr, n Sqlite3_ui
}
}
-func Xsqlite3_result_text16(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, xDel uintptr) { /* sqlite3.c:84651:17: */
+func Xsqlite3_result_text16(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, xDel uintptr) { /* sqlite3.c:84931:17: */
setResultStrOrError(tls, pCtx, z, n, uint8(SQLITE_UTF16LE), xDel)
}
-func Xsqlite3_result_text16be(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, xDel uintptr) { /* sqlite3.c:84660:17: */
+func Xsqlite3_result_text16be(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, xDel uintptr) { /* sqlite3.c:84940:17: */
setResultStrOrError(tls, pCtx, z, n, uint8(SQLITE_UTF16BE), xDel)
}
-func Xsqlite3_result_text16le(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, xDel uintptr) { /* sqlite3.c:84669:17: */
+func Xsqlite3_result_text16le(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, xDel uintptr) { /* sqlite3.c:84949:17: */
setResultStrOrError(tls, pCtx, z, n, uint8(SQLITE_UTF16LE), xDel)
}
-func Xsqlite3_result_value(tls *libc.TLS, pCtx uintptr, pValue uintptr) { /* sqlite3.c:84679:17: */
+func Xsqlite3_result_value(tls *libc.TLS, pCtx uintptr, pValue uintptr) { /* sqlite3.c:84959:17: */
Xsqlite3VdbeMemCopy(tls, (*Sqlite3_context)(unsafe.Pointer(pCtx)).FpOut, pValue)
}
-func Xsqlite3_result_zeroblob(tls *libc.TLS, pCtx uintptr, n int32) { /* sqlite3.c:84683:17: */
+func Xsqlite3_result_zeroblob(tls *libc.TLS, pCtx uintptr, n int32) { /* sqlite3.c:84963:17: */
Xsqlite3VdbeMemSetZeroBlob(tls, (*Sqlite3_context)(unsafe.Pointer(pCtx)).FpOut, n)
}
-func Xsqlite3_result_zeroblob64(tls *libc.TLS, pCtx uintptr, n U64) int32 { /* sqlite3.c:84687:16: */
+func Xsqlite3_result_zeroblob64(tls *libc.TLS, pCtx uintptr, n U64) int32 { /* sqlite3.c:84967:16: */
var pOut uintptr = (*Sqlite3_context)(unsafe.Pointer(pCtx)).FpOut
- if n > U64(*(*int32)(unsafe.Pointer(((*Mem)(unsafe.Pointer(pOut)).Fdb + 112 /* &.aLimit */)))) {
+ if n > U64(*(*int32)(unsafe.Pointer((*Mem)(unsafe.Pointer(pOut)).Fdb + 120))) {
return SQLITE_TOOBIG
}
Xsqlite3VdbeMemSetZeroBlob(tls, (*Sqlite3_context)(unsafe.Pointer(pCtx)).FpOut, int32(n))
return SQLITE_OK
}
-func Xsqlite3_result_error_code(tls *libc.TLS, pCtx uintptr, errCode int32) { /* sqlite3.c:84696:17: */
+func Xsqlite3_result_error_code(tls *libc.TLS, pCtx uintptr, errCode int32) { /* sqlite3.c:84980:17: */
(*Sqlite3_context)(unsafe.Pointer(pCtx)).FisError = func() int32 {
if errCode != 0 {
return errCode
}
return -1
}()
- if (int32((*Mem)(unsafe.Pointer((*Sqlite3_context)(unsafe.Pointer(pCtx)).FpOut)).Fflags) & MEM_Null) != 0 {
+ if int32((*Mem)(unsafe.Pointer((*Sqlite3_context)(unsafe.Pointer(pCtx)).FpOut)).Fflags)&MEM_Null != 0 {
Xsqlite3VdbeMemSetStr(tls, (*Sqlite3_context)(unsafe.Pointer(pCtx)).FpOut, Xsqlite3ErrStr(tls, errCode), int64(-1),
uint8(SQLITE_UTF8), uintptr(0))
}
}
// Force an SQLITE_TOOBIG error.
-func Xsqlite3_result_error_toobig(tls *libc.TLS, pCtx uintptr) { /* sqlite3.c:84708:17: */
+func Xsqlite3_result_error_toobig(tls *libc.TLS, pCtx uintptr) { /* sqlite3.c:84992:17: */
(*Sqlite3_context)(unsafe.Pointer(pCtx)).FisError = SQLITE_TOOBIG
- Xsqlite3VdbeMemSetStr(tls, (*Sqlite3_context)(unsafe.Pointer(pCtx)).FpOut, ts+4448 /* "string or blob t..." */, int64(-1),
+ Xsqlite3VdbeMemSetStr(tls, (*Sqlite3_context)(unsafe.Pointer(pCtx)).FpOut, ts+5254 /* "string or blob t..." */, int64(-1),
uint8(SQLITE_UTF8), uintptr(0))
}
// An SQLITE_NOMEM error.
-func Xsqlite3_result_error_nomem(tls *libc.TLS, pCtx uintptr) { /* sqlite3.c:84716:17: */
+func Xsqlite3_result_error_nomem(tls *libc.TLS, pCtx uintptr) { /* sqlite3.c:85000:17: */
Xsqlite3VdbeMemSetNull(tls, (*Sqlite3_context)(unsafe.Pointer(pCtx)).FpOut)
(*Sqlite3_context)(unsafe.Pointer(pCtx)).FisError = SQLITE_NOMEM
@@ -61168,17 +61893,17 @@ func Xsqlite3_result_error_nomem(tls *libc.TLS, pCtx uintptr) { /* sqlite3.c:847
// Force the INT64 value currently stored as the result to be
// a MEM_IntReal value. See the SQLITE_TESTCTRL_RESULT_INTREAL
// test-control.
-func Xsqlite3ResultIntReal(tls *libc.TLS, pCtx uintptr) { /* sqlite3.c:84728:21: */
+func Xsqlite3ResultIntReal(tls *libc.TLS, pCtx uintptr) { /* sqlite3.c:85012:21: */
- if (int32((*Mem)(unsafe.Pointer((*Sqlite3_context)(unsafe.Pointer(pCtx)).FpOut)).Fflags) & MEM_Int) != 0 {
- *(*U16)(unsafe.Pointer((*Sqlite3_context)(unsafe.Pointer(pCtx)).FpOut + 8 /* &.flags */)) &= libc.Uint16FromInt32((libc.CplInt32(MEM_Int)))
- *(*U16)(unsafe.Pointer((*Sqlite3_context)(unsafe.Pointer(pCtx)).FpOut + 8 /* &.flags */)) |= U16((MEM_IntReal))
+ if int32((*Mem)(unsafe.Pointer((*Sqlite3_context)(unsafe.Pointer(pCtx)).FpOut)).Fflags)&MEM_Int != 0 {
+ *(*U16)(unsafe.Pointer((*Sqlite3_context)(unsafe.Pointer(pCtx)).FpOut + 8)) &= libc.Uint16FromInt32(libc.CplInt32(MEM_Int))
+ *(*U16)(unsafe.Pointer((*Sqlite3_context)(unsafe.Pointer(pCtx)).FpOut + 8)) |= U16(MEM_IntReal)
}
}
// This function is called after a transaction has been committed. It
// invokes callbacks registered with sqlite3_wal_hook() as required.
-func doWalCallbacks(tls *libc.TLS, db uintptr) int32 { /* sqlite3.c:84742:12: */
+func doWalCallbacks(tls *libc.TLS, db uintptr) int32 { /* sqlite3.c:85026:12: */
var rc int32 = SQLITE_OK
var i int32
for i = 0; i < (*Sqlite3)(unsafe.Pointer(db)).FnDb; i++ {
@@ -61188,7 +61913,7 @@ func doWalCallbacks(tls *libc.TLS, db uintptr) int32 { /* sqlite3.c:84742:12: */
Xsqlite3BtreeEnter(tls, pBt)
nEntry = Xsqlite3PagerWalCallback(tls, Xsqlite3BtreePager(tls, pBt))
Xsqlite3BtreeLeave(tls, pBt)
- if ((nEntry > 0) && ((*Sqlite3)(unsafe.Pointer(db)).FxWalCallback != 0)) && (rc == SQLITE_OK) {
+ if nEntry > 0 && (*Sqlite3)(unsafe.Pointer(db)).FxWalCallback != 0 && rc == SQLITE_OK {
rc = (*struct {
f func(*libc.TLS, uintptr, uintptr, uintptr, int32) int32
})(unsafe.Pointer(&struct{ uintptr }{(*Sqlite3)(unsafe.Pointer(db)).FxWalCallback})).f(tls, (*Sqlite3)(unsafe.Pointer(db)).FpWalArg, db, (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+uintptr(i)*16)).FzDbSName, nEntry)
@@ -61205,7 +61930,7 @@ func doWalCallbacks(tls *libc.TLS, db uintptr) int32 { /* sqlite3.c:84742:12: */
// API. The only thing omitted is the automatic recompile if a
// schema change has occurred. That detail is handled by the
// outer sqlite3_step() wrapper procedure.
-func sqlite3Step(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:84772:12: */
+func sqlite3Step(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:85056:12: */
var db uintptr
var rc int32
@@ -61241,12 +61966,12 @@ __1:
__2:
;
- if !(((*Vdbe)(unsafe.Pointer(p)).Fpc < 0) && ((Bft(int32(*(*uint16)(unsafe.Pointer(p + 152 /* &.expired */)) & 0x3 >> 0))) != 0)) {
+ if !((*Vdbe)(unsafe.Pointer(p)).Fpc < 0 && Bft(int32(*(*uint16)(unsafe.Pointer(p + 160))&0x3>>0)) != 0) {
goto __3
}
(*Vdbe)(unsafe.Pointer(p)).Frc = SQLITE_SCHEMA
rc = SQLITE_ERROR
- if !((int32((*Vdbe)(unsafe.Pointer(p)).FprepFlags) & SQLITE_PREPARE_SAVESQL) != 0) {
+ if !(int32((*Vdbe)(unsafe.Pointer(p)).FprepFlags)&SQLITE_PREPARE_SAVESQL != 0) {
goto __4
}
// If this statement was prepared using saved SQL and an
@@ -61267,15 +61992,15 @@ __3:
if !((*Sqlite3)(unsafe.Pointer(db)).FnVdbeActive == 0) {
goto __6
}
- libc.AtomicStoreNInt32((db + 288 /* &.u1 */ /* &.isInterrupted */), int32(0), 0)
+ libc.AtomicStoreNInt32(db+312, int32(0), 0)
__6:
;
- if !((((int32((*Sqlite3)(unsafe.Pointer(db)).FmTrace) & (SQLITE_TRACE_PROFILE | SQLITE_TRACE_XPROFILE)) != 0) &&
- !(int32((*Sqlite3)(unsafe.Pointer(db)).Finit.Fbusy) != 0)) && ((*Vdbe)(unsafe.Pointer(p)).FzSql != 0)) {
+ if !(int32((*Sqlite3)(unsafe.Pointer(db)).FmTrace)&(SQLITE_TRACE_PROFILE|SQLITE_TRACE_XPROFILE) != 0 &&
+ !(int32((*Sqlite3)(unsafe.Pointer(db)).Finit.Fbusy) != 0) && (*Vdbe)(unsafe.Pointer(p)).FzSql != 0) {
goto __7
}
- Xsqlite3OsCurrentTimeInt64(tls, (*Sqlite3)(unsafe.Pointer(db)).FpVfs, (p + 136 /* &.startTime */))
+ Xsqlite3OsCurrentTimeInt64(tls, (*Sqlite3)(unsafe.Pointer(db)).FpVfs, p+144)
goto __8
__7:
;
@@ -61283,13 +62008,13 @@ __8:
;
(*Sqlite3)(unsafe.Pointer(db)).FnVdbeActive++
- if !((int32(*(*uint16)(unsafe.Pointer(p + 152 /* &.readOnly */)) & 0x80 >> 7)) == 0) {
+ if !(int32(*(*uint16)(unsafe.Pointer(p + 160))&0x80>>7) == 0) {
goto __9
}
(*Sqlite3)(unsafe.Pointer(db)).FnVdbeWrite++
__9:
;
- if !((Bft(int32(*(*uint16)(unsafe.Pointer(p + 152 /* &.bIsReader */)) & 0x100 >> 8))) != 0) {
+ if !(Bft(int32(*(*uint16)(unsafe.Pointer(p + 160))&0x100>>8)) != 0) {
goto __10
}
(*Sqlite3)(unsafe.Pointer(db)).FnVdbeRead++
@@ -61298,7 +62023,7 @@ __10:
(*Vdbe)(unsafe.Pointer(p)).Fpc = 0
__5:
;
- if !((Bft(int32(*(*uint16)(unsafe.Pointer(p + 152 /* &.explain */)) & 0xc >> 2))) != 0) {
+ if !(Bft(int32(*(*uint16)(unsafe.Pointer(p + 160))&0xc>>2)) != 0) {
goto __11
}
rc = Xsqlite3VdbeList(tls, p)
@@ -61315,14 +62040,14 @@ __12:
goto __13
}
// If the statement completed successfully, invoke the profile callback
- if !(((*Vdbe)(unsafe.Pointer(p)).FstartTime) > int64(0)) {
+ if !((*Vdbe)(unsafe.Pointer(p)).FstartTime > int64(0)) {
goto __14
}
invokeProfileCallback(tls, db, p)
__14:
;
- if !((rc == SQLITE_DONE) && ((*Sqlite3)(unsafe.Pointer(db)).FautoCommit != 0)) {
+ if !(rc == SQLITE_DONE && (*Sqlite3)(unsafe.Pointer(db)).FautoCommit != 0) {
goto __15
}
@@ -61335,7 +62060,7 @@ __17:
;
goto __16
__15:
- if !((rc != SQLITE_DONE) && ((int32((*Vdbe)(unsafe.Pointer(p)).FprepFlags) & SQLITE_PREPARE_SAVESQL) != 0)) {
+ if !(rc != SQLITE_DONE && int32((*Vdbe)(unsafe.Pointer(p)).FprepFlags)&SQLITE_PREPARE_SAVESQL != 0) {
goto __18
}
// If this statement was prepared using saved SQL and an
@@ -61354,7 +62079,7 @@ __13:
goto __19
}
(*Vdbe)(unsafe.Pointer(p)).Frc = SQLITE_NOMEM
- if !((int32((*Vdbe)(unsafe.Pointer(p)).FprepFlags) & SQLITE_PREPARE_SAVESQL) != 0) {
+ if !(int32((*Vdbe)(unsafe.Pointer(p)).FprepFlags)&SQLITE_PREPARE_SAVESQL != 0) {
goto __20
}
rc = (*Vdbe)(unsafe.Pointer(p)).Frc
@@ -61366,26 +62091,26 @@ end_of_step:
// There are only a limited number of result codes allowed from the
// statements prepared using the legacy sqlite3_prepare() interface
;
- return (rc & (*Sqlite3)(unsafe.Pointer(db)).FerrMask)
+ return rc & (*Sqlite3)(unsafe.Pointer(db)).FerrMask
}
// This is the top-level implementation of sqlite3_step(). Call
// sqlite3Step() to do most of the work. If a schema error occurs,
// call sqlite3Reprepare() and try again.
-func Xsqlite3_step(tls *libc.TLS, pStmt uintptr) int32 { /* sqlite3.c:84906:16: */
+func Xsqlite3_step(tls *libc.TLS, pStmt uintptr) int32 { /* sqlite3.c:85190:16: */
var rc int32 = SQLITE_OK // Result from sqlite3Step()
var v uintptr = pStmt // the prepared statement
var cnt int32 = 0 // Counter to prevent infinite loop of reprepares
var db uintptr // The database connection
if vdbeSafetyNotNull(tls, v) != 0 {
- return Xsqlite3MisuseError(tls, 84913)
+ return Xsqlite3MisuseError(tls, 85197)
}
db = (*Vdbe)(unsafe.Pointer(v)).Fdb
Xsqlite3_mutex_enter(tls, (*Sqlite3)(unsafe.Pointer(db)).Fmutex)
(*Vdbe)(unsafe.Pointer(v)).FdoingRerun = U8(0)
- for ((libc.AssignInt32(&rc, sqlite3Step(tls, v))) == SQLITE_SCHEMA) &&
- (libc.PostIncInt32(&cnt, 1) < SQLITE_MAX_SCHEMA_RETRY) {
+ for libc.AssignInt32(&rc, sqlite3Step(tls, v)) == SQLITE_SCHEMA &&
+ libc.PostIncInt32(&cnt, 1) < SQLITE_MAX_SCHEMA_RETRY {
var savedPc int32 = (*Vdbe)(unsafe.Pointer(v)).Fpc
rc = Xsqlite3Reprepare(tls, v)
if rc != SQLITE_OK {
@@ -61419,7 +62144,7 @@ func Xsqlite3_step(tls *libc.TLS, pStmt uintptr) int32 { /* sqlite3.c:84906:16:
// Extract the user data from a sqlite3_context structure and return a
// pointer to it.
-func Xsqlite3_user_data(tls *libc.TLS, p uintptr) uintptr { /* sqlite3.c:84955:17: */
+func Xsqlite3_user_data(tls *libc.TLS, p uintptr) uintptr { /* sqlite3.c:85239:17: */
return (*FuncDef)(unsafe.Pointer((*Sqlite3_context)(unsafe.Pointer(p)).FpFunc)).FpUserData
}
@@ -61432,7 +62157,7 @@ func Xsqlite3_user_data(tls *libc.TLS, p uintptr) uintptr { /* sqlite3.c:84955:1
// parameter) of the sqlite3_create_function() and
// sqlite3_create_function16() routines that originally registered the
// application defined function.
-func Xsqlite3_context_db_handle(tls *libc.TLS, p uintptr) uintptr { /* sqlite3.c:84970:20: */
+func Xsqlite3_context_db_handle(tls *libc.TLS, p uintptr) uintptr { /* sqlite3.c:85254:20: */
return (*Mem)(unsafe.Pointer((*Sqlite3_context)(unsafe.Pointer(p)).FpOut)).Fdb
}
@@ -61449,7 +62174,7 @@ func Xsqlite3_context_db_handle(tls *libc.TLS, p uintptr) uintptr { /* sqlite3.c
// Virtual table implements might use this routine to optimize their
// performance by substituting a NULL result, or some other light-weight
// value, as a signal to the xUpdate routine that the column is unchanged.
-func Xsqlite3_vtab_nochange(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:84989:16: */
+func Xsqlite3_vtab_nochange(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:85273:16: */
return Xsqlite3_value_nochange(tls, (*Sqlite3_context)(unsafe.Pointer(p)).FpOut)
}
@@ -61459,7 +62184,7 @@ func Xsqlite3_vtab_nochange(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:84989
// statement, the exact same time is returned for each invocation regardless
// of the amount of time that elapses between invocations. In other words,
// the time returned is always the time of the first call.
-func Xsqlite3StmtCurrentTime(tls *libc.TLS, p uintptr) Sqlite3_int64 { /* sqlite3.c:85001:30: */
+func Xsqlite3StmtCurrentTime(tls *libc.TLS, p uintptr) Sqlite3_int64 { /* sqlite3.c:85285:30: */
bp := tls.Alloc(8)
defer tls.Free(8)
@@ -61467,7 +62192,7 @@ func Xsqlite3StmtCurrentTime(tls *libc.TLS, p uintptr) Sqlite3_int64 { /* sqlite
*(*Sqlite3_int64)(unsafe.Pointer(bp /* iTime */)) = int64(0)
var piTime uintptr
if (*Sqlite3_context)(unsafe.Pointer(p)).FpVdbe != uintptr(0) {
- piTime = ((*Sqlite3_context)(unsafe.Pointer(p)).FpVdbe + 56 /* &.iCurrentTime */)
+ piTime = (*Sqlite3_context)(unsafe.Pointer(p)).FpVdbe + 64
} else {
piTime = bp /* &iTime */
}
@@ -61482,7 +62207,7 @@ func Xsqlite3StmtCurrentTime(tls *libc.TLS, p uintptr) Sqlite3_int64 { /* sqlite
// Create a new aggregate context for p and return a pointer to
// its pMem->z element.
-func createAggContext(tls *libc.TLS, p uintptr, nByte int32) uintptr { /* sqlite3.c:85021:29: */
+func createAggContext(tls *libc.TLS, p uintptr, nByte int32) uintptr { /* sqlite3.c:85305:29: */
var pMem uintptr = (*Sqlite3_context)(unsafe.Pointer(p)).FpMem
if nByte <= 0 {
@@ -61491,7 +62216,7 @@ func createAggContext(tls *libc.TLS, p uintptr, nByte int32) uintptr { /* sqlite
} else {
Xsqlite3VdbeMemClearAndResize(tls, pMem, nByte)
(*Mem)(unsafe.Pointer(pMem)).Fflags = U16(MEM_Agg)
- *(*uintptr)(unsafe.Pointer(pMem /* &.u */)) = (*Sqlite3_context)(unsafe.Pointer(p)).FpFunc
+ *(*uintptr)(unsafe.Pointer(pMem)) = (*Sqlite3_context)(unsafe.Pointer(p)).FpFunc
if (*Mem)(unsafe.Pointer(pMem)).Fz != 0 {
libc.Xmemset(tls, (*Mem)(unsafe.Pointer(pMem)).Fz, 0, uint32(nByte))
}
@@ -61502,9 +62227,9 @@ func createAggContext(tls *libc.TLS, p uintptr, nByte int32) uintptr { /* sqlite
// Allocate or return the aggregate context for a user function. A new
// context is allocated on the first call. Subsequent calls return the
// same context that was returned on prior calls.
-func Xsqlite3_aggregate_context(tls *libc.TLS, p uintptr, nByte int32) uintptr { /* sqlite3.c:85043:17: */
+func Xsqlite3_aggregate_context(tls *libc.TLS, p uintptr, nByte int32) uintptr { /* sqlite3.c:85327:17: */
- if (int32((*Mem)(unsafe.Pointer((*Sqlite3_context)(unsafe.Pointer(p)).FpMem)).Fflags) & MEM_Agg) == 0 {
+ if int32((*Mem)(unsafe.Pointer((*Sqlite3_context)(unsafe.Pointer(p)).FpMem)).Fflags)&MEM_Agg == 0 {
return createAggContext(tls, p, nByte)
} else {
return (*Mem)(unsafe.Pointer((*Sqlite3_context)(unsafe.Pointer(p)).FpMem)).Fz
@@ -61520,14 +62245,14 @@ func Xsqlite3_aggregate_context(tls *libc.TLS, p uintptr, nByte int32) uintptr {
// Undocumented behavior: If iArg is negative then access a cache of
// auxiliary data pointers that is available to all functions within a
// single prepared statement. The iArg values must match.
-func Xsqlite3_get_auxdata(tls *libc.TLS, pCtx uintptr, iArg int32) uintptr { /* sqlite3.c:85064:17: */
+func Xsqlite3_get_auxdata(tls *libc.TLS, pCtx uintptr, iArg int32) uintptr { /* sqlite3.c:85348:17: */
var pAuxData uintptr
if (*Sqlite3_context)(unsafe.Pointer(pCtx)).FpVdbe == uintptr(0) {
return uintptr(0)
}
for pAuxData = (*Vdbe)(unsafe.Pointer((*Sqlite3_context)(unsafe.Pointer(pCtx)).FpVdbe)).FpAuxData; pAuxData != 0; pAuxData = (*AuxData)(unsafe.Pointer(pAuxData)).FpNextAux {
- if ((*AuxData)(unsafe.Pointer(pAuxData)).FiAuxArg == iArg) && (((*AuxData)(unsafe.Pointer(pAuxData)).FiAuxOp == (*Sqlite3_context)(unsafe.Pointer(pCtx)).FiOp) || (iArg < 0)) {
+ if (*AuxData)(unsafe.Pointer(pAuxData)).FiAuxArg == iArg && ((*AuxData)(unsafe.Pointer(pAuxData)).FiAuxOp == (*Sqlite3_context)(unsafe.Pointer(pCtx)).FiOp || iArg < 0) {
return (*AuxData)(unsafe.Pointer(pAuxData)).FpAux
}
}
@@ -61543,7 +62268,7 @@ func Xsqlite3_get_auxdata(tls *libc.TLS, pCtx uintptr, iArg int32) uintptr { /*
// Undocumented behavior: If iArg is negative then make the data available
// to all functions within the current prepared statement using iArg as an
// access code.
-func Xsqlite3_set_auxdata(tls *libc.TLS, pCtx uintptr, iArg int32, pAux uintptr, xDelete uintptr) { /* sqlite3.c:85092:17: */
+func Xsqlite3_set_auxdata(tls *libc.TLS, pCtx uintptr, iArg int32, pAux uintptr, xDelete uintptr) { /* sqlite3.c:85376:17: */
var pAuxData uintptr
var pVdbe uintptr
pVdbe = (*Sqlite3_context)(unsafe.Pointer(pCtx)).FpVdbe
@@ -61560,7 +62285,7 @@ __2:
if !(pAuxData != 0) {
goto __4
}
- if !(((*AuxData)(unsafe.Pointer(pAuxData)).FiAuxArg == iArg) && (((*AuxData)(unsafe.Pointer(pAuxData)).FiAuxOp == (*Sqlite3_context)(unsafe.Pointer(pCtx)).FiOp) || (iArg < 0))) {
+ if !((*AuxData)(unsafe.Pointer(pAuxData)).FiAuxArg == iArg && ((*AuxData)(unsafe.Pointer(pAuxData)).FiAuxOp == (*Sqlite3_context)(unsafe.Pointer(pCtx)).FiOp || iArg < 0)) {
goto __5
}
goto __4
@@ -61577,7 +62302,7 @@ __4:
goto __6
}
pAuxData = Xsqlite3DbMallocZero(tls, (*Vdbe)(unsafe.Pointer(pVdbe)).Fdb, uint64(unsafe.Sizeof(AuxData{})))
- if !(!(pAuxData != 0)) {
+ if !!(pAuxData != 0) {
goto __8
}
goto failed
@@ -61623,13 +62348,13 @@ __11:
// provide only to avoid breaking legacy code. New aggregate function
// implementations should keep their own counts within their aggregate
// context.
-func Xsqlite3_aggregate_count(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:85145:16: */
+func Xsqlite3_aggregate_count(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:85429:16: */
return (*Mem)(unsafe.Pointer((*Sqlite3_context)(unsafe.Pointer(p)).FpMem)).Fn
}
// Return the number of columns in the result set for the statement pStmt.
-func Xsqlite3_column_count(tls *libc.TLS, pStmt uintptr) int32 { /* sqlite3.c:85154:16: */
+func Xsqlite3_column_count(tls *libc.TLS, pStmt uintptr) int32 { /* sqlite3.c:85438:16: */
var pVm uintptr = pStmt
if pVm != 0 {
return int32((*Vdbe)(unsafe.Pointer(pVm)).FnResColumn)
@@ -61639,28 +62364,28 @@ func Xsqlite3_column_count(tls *libc.TLS, pStmt uintptr) int32 { /* sqlite3.c:85
// Return the number of values available from the current row of the
// currently executing statement pStmt.
-func Xsqlite3_data_count(tls *libc.TLS, pStmt uintptr) int32 { /* sqlite3.c:85163:16: */
+func Xsqlite3_data_count(tls *libc.TLS, pStmt uintptr) int32 { /* sqlite3.c:85447:16: */
var pVm uintptr = pStmt
- if (pVm == uintptr(0)) || ((*Vdbe)(unsafe.Pointer(pVm)).FpResultSet == uintptr(0)) {
+ if pVm == uintptr(0) || (*Vdbe)(unsafe.Pointer(pVm)).FpResultSet == uintptr(0) {
return 0
}
return int32((*Vdbe)(unsafe.Pointer(pVm)).FnResColumn)
}
// Return a pointer to static memory containing an SQL NULL value.
-func columnNullValue(tls *libc.TLS) uintptr { /* sqlite3.c:85172:18: */
+func columnNullValue(tls *libc.TLS) uintptr { /* sqlite3.c:85456:18: */
return uintptr(unsafe.Pointer(&nullMem))
}
var nullMem = Mem{
/* .flags = */ Fflags: U16(MEM_Null),
-} /* sqlite3.c:85182:20 */
+} /* sqlite3.c:85466:20 */
// Check to see if column iCol of the given statement is valid. If
// it is, return a pointer to the Mem for the value of that column.
// If iCol is not valid, return a pointer to a Mem which has a value
// of NULL.
-func columnMem(tls *libc.TLS, pStmt uintptr, i int32) uintptr { /* sqlite3.c:85212:12: */
+func columnMem(tls *libc.TLS, pStmt uintptr, i int32) uintptr { /* sqlite3.c:85496:12: */
var pVm uintptr
var pOut uintptr
@@ -61670,8 +62395,8 @@ func columnMem(tls *libc.TLS, pStmt uintptr, i int32) uintptr { /* sqlite3.c:852
}
Xsqlite3_mutex_enter(tls, (*Sqlite3)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(pVm)).Fdb)).Fmutex)
- if (((*Vdbe)(unsafe.Pointer(pVm)).FpResultSet != uintptr(0)) && (i < int32((*Vdbe)(unsafe.Pointer(pVm)).FnResColumn))) && (i >= 0) {
- pOut = ((*Vdbe)(unsafe.Pointer(pVm)).FpResultSet + uintptr(i)*40)
+ if (*Vdbe)(unsafe.Pointer(pVm)).FpResultSet != uintptr(0) && i < int32((*Vdbe)(unsafe.Pointer(pVm)).FnResColumn) && i >= 0 {
+ pOut = (*Vdbe)(unsafe.Pointer(pVm)).FpResultSet + uintptr(i)*40
} else {
Xsqlite3Error(tls, (*Vdbe)(unsafe.Pointer(pVm)).Fdb, SQLITE_RANGE)
pOut = columnNullValue(tls)
@@ -61695,7 +62420,7 @@ func columnMem(tls *libc.TLS, pStmt uintptr, i int32) uintptr { /* sqlite3.c:852
// sqlite3_column_bytes()
// sqlite3_column_bytes16()
// sqiite3_column_blob()
-func columnMallocFailure(tls *libc.TLS, pStmt uintptr) { /* sqlite3.c:85247:13: */
+func columnMallocFailure(tls *libc.TLS, pStmt uintptr) { /* sqlite3.c:85531:13: */
// If malloc() failed during an encoding conversion within an
// sqlite3_column_XXX API, then set the return code of the statement to
// SQLITE_NOMEM. The next call to _step() (if any) will return SQLITE_ERROR
@@ -61712,7 +62437,7 @@ func columnMallocFailure(tls *libc.TLS, pStmt uintptr) { /* sqlite3.c:85247:13:
//
// The following routines are used to access elements of the current row
// in the result set.
-func Xsqlite3_column_blob(tls *libc.TLS, pStmt uintptr, i int32) uintptr { /* sqlite3.c:85267:23: */
+func Xsqlite3_column_blob(tls *libc.TLS, pStmt uintptr, i int32) uintptr { /* sqlite3.c:85551:23: */
var val uintptr
val = Xsqlite3_value_blob(tls, columnMem(tls, pStmt, i))
// Even though there is no encoding conversion, value_blob() might
@@ -61722,59 +62447,59 @@ func Xsqlite3_column_blob(tls *libc.TLS, pStmt uintptr, i int32) uintptr { /* sq
return val
}
-func Xsqlite3_column_bytes(tls *libc.TLS, pStmt uintptr, i int32) int32 { /* sqlite3.c:85277:16: */
+func Xsqlite3_column_bytes(tls *libc.TLS, pStmt uintptr, i int32) int32 { /* sqlite3.c:85561:16: */
var val int32 = Xsqlite3_value_bytes(tls, columnMem(tls, pStmt, i))
columnMallocFailure(tls, pStmt)
return val
}
-func Xsqlite3_column_bytes16(tls *libc.TLS, pStmt uintptr, i int32) int32 { /* sqlite3.c:85282:16: */
+func Xsqlite3_column_bytes16(tls *libc.TLS, pStmt uintptr, i int32) int32 { /* sqlite3.c:85566:16: */
var val int32 = Xsqlite3_value_bytes16(tls, columnMem(tls, pStmt, i))
columnMallocFailure(tls, pStmt)
return val
}
-func Xsqlite3_column_double(tls *libc.TLS, pStmt uintptr, i int32) float64 { /* sqlite3.c:85287:19: */
+func Xsqlite3_column_double(tls *libc.TLS, pStmt uintptr, i int32) float64 { /* sqlite3.c:85571:19: */
var val float64 = Xsqlite3_value_double(tls, columnMem(tls, pStmt, i))
columnMallocFailure(tls, pStmt)
return val
}
-func Xsqlite3_column_int(tls *libc.TLS, pStmt uintptr, i int32) int32 { /* sqlite3.c:85292:16: */
+func Xsqlite3_column_int(tls *libc.TLS, pStmt uintptr, i int32) int32 { /* sqlite3.c:85576:16: */
var val int32 = Xsqlite3_value_int(tls, columnMem(tls, pStmt, i))
columnMallocFailure(tls, pStmt)
return val
}
-func Xsqlite3_column_int64(tls *libc.TLS, pStmt uintptr, i int32) Sqlite_int64 { /* sqlite3.c:85297:25: */
+func Xsqlite3_column_int64(tls *libc.TLS, pStmt uintptr, i int32) Sqlite_int64 { /* sqlite3.c:85581:25: */
var val Sqlite_int64 = Xsqlite3_value_int64(tls, columnMem(tls, pStmt, i))
columnMallocFailure(tls, pStmt)
return val
}
-func Xsqlite3_column_text(tls *libc.TLS, pStmt uintptr, i int32) uintptr { /* sqlite3.c:85302:32: */
+func Xsqlite3_column_text(tls *libc.TLS, pStmt uintptr, i int32) uintptr { /* sqlite3.c:85586:32: */
var val uintptr = Xsqlite3_value_text(tls, columnMem(tls, pStmt, i))
columnMallocFailure(tls, pStmt)
return val
}
-func Xsqlite3_column_value(tls *libc.TLS, pStmt uintptr, i int32) uintptr { /* sqlite3.c:85307:26: */
+func Xsqlite3_column_value(tls *libc.TLS, pStmt uintptr, i int32) uintptr { /* sqlite3.c:85591:26: */
var pOut uintptr = columnMem(tls, pStmt, i)
- if (int32((*Mem)(unsafe.Pointer(pOut)).Fflags) & MEM_Static) != 0 {
- *(*U16)(unsafe.Pointer(pOut + 8 /* &.flags */)) &= libc.Uint16FromInt32((libc.CplInt32(MEM_Static)))
- *(*U16)(unsafe.Pointer(pOut + 8 /* &.flags */)) |= U16((MEM_Ephem))
+ if int32((*Mem)(unsafe.Pointer(pOut)).Fflags)&MEM_Static != 0 {
+ *(*U16)(unsafe.Pointer(pOut + 8)) &= libc.Uint16FromInt32(libc.CplInt32(MEM_Static))
+ *(*U16)(unsafe.Pointer(pOut + 8)) |= U16(MEM_Ephem)
}
columnMallocFailure(tls, pStmt)
return pOut
}
-func Xsqlite3_column_text16(tls *libc.TLS, pStmt uintptr, i int32) uintptr { /* sqlite3.c:85317:23: */
+func Xsqlite3_column_text16(tls *libc.TLS, pStmt uintptr, i int32) uintptr { /* sqlite3.c:85601:23: */
var val uintptr = Xsqlite3_value_text16(tls, columnMem(tls, pStmt, i))
columnMallocFailure(tls, pStmt)
return val
}
-func Xsqlite3_column_type(tls *libc.TLS, pStmt uintptr, i int32) int32 { /* sqlite3.c:85323:16: */
+func Xsqlite3_column_type(tls *libc.TLS, pStmt uintptr, i int32) int32 { /* sqlite3.c:85607:16: */
var iType int32 = Xsqlite3_value_type(tls, columnMem(tls, pStmt, i))
columnMallocFailure(tls, pStmt)
return iType
@@ -61794,7 +62519,7 @@ func Xsqlite3_column_type(tls *libc.TLS, pStmt uintptr, i int32) int32 { /* sqli
//
// If the result is not a simple column reference (if it is an expression
// or a constant) then useTypes 2, 3, and 4 return NULL.
-func columnName(tls *libc.TLS, pStmt uintptr, N int32, useUtf16 int32, useType int32) uintptr { /* sqlite3.c:85345:19: */
+func columnName(tls *libc.TLS, pStmt uintptr, N int32, useUtf16 int32, useType int32) uintptr { /* sqlite3.c:85629:19: */
var ret uintptr
var p uintptr
var n int32
@@ -61804,14 +62529,14 @@ func columnName(tls *libc.TLS, pStmt uintptr, N int32, useUtf16 int32, useType i
db = (*Vdbe)(unsafe.Pointer(p)).Fdb
n = Xsqlite3_column_count(tls, pStmt)
- if (N < n) && (N >= 0) {
- N = N + (useType * n)
+ if N < n && N >= 0 {
+ N = N + useType*n
Xsqlite3_mutex_enter(tls, (*Sqlite3)(unsafe.Pointer(db)).Fmutex)
if useUtf16 != 0 {
- ret = Xsqlite3_value_text16(tls, ((*Vdbe)(unsafe.Pointer(p)).FaColName + uintptr(N)*40))
+ ret = Xsqlite3_value_text16(tls, (*Vdbe)(unsafe.Pointer(p)).FaColName+uintptr(N)*40)
} else {
- ret = Xsqlite3_value_text(tls, ((*Vdbe)(unsafe.Pointer(p)).FaColName + uintptr(N)*40))
+ ret = Xsqlite3_value_text(tls, (*Vdbe)(unsafe.Pointer(p)).FaColName+uintptr(N)*40)
}
// A malloc may have failed inside of the _text() call. If this
// is the case, clear the mallocFailed flag and return NULL.
@@ -61826,11 +62551,11 @@ func columnName(tls *libc.TLS, pStmt uintptr, N int32, useUtf16 int32, useType i
// Return the name of the Nth column of the result set returned by SQL
// statement pStmt.
-func Xsqlite3_column_name(tls *libc.TLS, pStmt uintptr, N int32) uintptr { /* sqlite3.c:85394:23: */
+func Xsqlite3_column_name(tls *libc.TLS, pStmt uintptr, N int32) uintptr { /* sqlite3.c:85678:23: */
return columnName(tls, pStmt, N, 0, COLNAME_NAME)
}
-func Xsqlite3_column_name16(tls *libc.TLS, pStmt uintptr, N int32) uintptr { /* sqlite3.c:85398:23: */
+func Xsqlite3_column_name16(tls *libc.TLS, pStmt uintptr, N int32) uintptr { /* sqlite3.c:85682:23: */
return columnName(tls, pStmt, N, 1, COLNAME_NAME)
}
@@ -61839,44 +62564,44 @@ func Xsqlite3_column_name16(tls *libc.TLS, pStmt uintptr, N int32) uintptr { /*
// Return the column declaration type (if applicable) of the 'i'th column
// of the result set of SQL statement pStmt.
-func Xsqlite3_column_decltype(tls *libc.TLS, pStmt uintptr, N int32) uintptr { /* sqlite3.c:85417:23: */
+func Xsqlite3_column_decltype(tls *libc.TLS, pStmt uintptr, N int32) uintptr { /* sqlite3.c:85701:23: */
return columnName(tls, pStmt, N, 0, COLNAME_DECLTYPE)
}
-func Xsqlite3_column_decltype16(tls *libc.TLS, pStmt uintptr, N int32) uintptr { /* sqlite3.c:85421:23: */
+func Xsqlite3_column_decltype16(tls *libc.TLS, pStmt uintptr, N int32) uintptr { /* sqlite3.c:85705:23: */
return columnName(tls, pStmt, N, 1, COLNAME_DECLTYPE)
}
// Return the name of the database from which a result column derives.
// NULL is returned if the result column is an expression or constant or
// anything else which is not an unambiguous reference to a database column.
-func Xsqlite3_column_database_name(tls *libc.TLS, pStmt uintptr, N int32) uintptr { /* sqlite3.c:85433:23: */
+func Xsqlite3_column_database_name(tls *libc.TLS, pStmt uintptr, N int32) uintptr { /* sqlite3.c:85717:23: */
return columnName(tls, pStmt, N, 0, COLNAME_DATABASE)
}
-func Xsqlite3_column_database_name16(tls *libc.TLS, pStmt uintptr, N int32) uintptr { /* sqlite3.c:85437:23: */
+func Xsqlite3_column_database_name16(tls *libc.TLS, pStmt uintptr, N int32) uintptr { /* sqlite3.c:85721:23: */
return columnName(tls, pStmt, N, 1, COLNAME_DATABASE)
}
// Return the name of the table from which a result column derives.
// NULL is returned if the result column is an expression or constant or
// anything else which is not an unambiguous reference to a database column.
-func Xsqlite3_column_table_name(tls *libc.TLS, pStmt uintptr, N int32) uintptr { /* sqlite3.c:85447:23: */
+func Xsqlite3_column_table_name(tls *libc.TLS, pStmt uintptr, N int32) uintptr { /* sqlite3.c:85731:23: */
return columnName(tls, pStmt, N, 0, COLNAME_TABLE)
}
-func Xsqlite3_column_table_name16(tls *libc.TLS, pStmt uintptr, N int32) uintptr { /* sqlite3.c:85451:23: */
+func Xsqlite3_column_table_name16(tls *libc.TLS, pStmt uintptr, N int32) uintptr { /* sqlite3.c:85735:23: */
return columnName(tls, pStmt, N, 1, COLNAME_TABLE)
}
// Return the name of the table column from which a result column derives.
// NULL is returned if the result column is an expression or constant or
// anything else which is not an unambiguous reference to a database column.
-func Xsqlite3_column_origin_name(tls *libc.TLS, pStmt uintptr, N int32) uintptr { /* sqlite3.c:85461:23: */
+func Xsqlite3_column_origin_name(tls *libc.TLS, pStmt uintptr, N int32) uintptr { /* sqlite3.c:85745:23: */
return columnName(tls, pStmt, N, 0, COLNAME_COLUMN)
}
-func Xsqlite3_column_origin_name16(tls *libc.TLS, pStmt uintptr, N int32) uintptr { /* sqlite3.c:85465:23: */
+func Xsqlite3_column_origin_name16(tls *libc.TLS, pStmt uintptr, N int32) uintptr { /* sqlite3.c:85749:23: */
return columnName(tls, pStmt, N, 1, COLNAME_COLUMN)
}
@@ -61893,29 +62618,29 @@ func Xsqlite3_column_origin_name16(tls *libc.TLS, pStmt uintptr, N int32) uintpt
//
// The error code stored in database p->db is overwritten with the return
// value in any case.
-func vdbeUnbind(tls *libc.TLS, p uintptr, i int32) int32 { /* sqlite3.c:85487:12: */
+func vdbeUnbind(tls *libc.TLS, p uintptr, i int32) int32 { /* sqlite3.c:85771:12: */
bp := tls.Alloc(8)
defer tls.Free(8)
var pVar uintptr
if vdbeSafetyNotNull(tls, p) != 0 {
- return Xsqlite3MisuseError(tls, 85490)
+ return Xsqlite3MisuseError(tls, 85774)
}
Xsqlite3_mutex_enter(tls, (*Sqlite3)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).Fdb)).Fmutex)
- if ((*Vdbe)(unsafe.Pointer(p)).FiVdbeMagic != U32(VDBE_MAGIC_RUN)) || ((*Vdbe)(unsafe.Pointer(p)).Fpc >= 0) {
+ if (*Vdbe)(unsafe.Pointer(p)).FiVdbeMagic != U32(VDBE_MAGIC_RUN) || (*Vdbe)(unsafe.Pointer(p)).Fpc >= 0 {
Xsqlite3Error(tls, (*Vdbe)(unsafe.Pointer(p)).Fdb, SQLITE_MISUSE)
Xsqlite3_mutex_leave(tls, (*Sqlite3)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).Fdb)).Fmutex)
Xsqlite3_log(tls, SQLITE_MISUSE,
- ts+4471 /* "bind on a busy p..." */, libc.VaList(bp, (*Vdbe)(unsafe.Pointer(p)).FzSql))
- return Xsqlite3MisuseError(tls, 85498)
+ ts+5277 /* "bind on a busy p..." */, libc.VaList(bp, (*Vdbe)(unsafe.Pointer(p)).FzSql))
+ return Xsqlite3MisuseError(tls, 85782)
}
- if (i < 1) || (i > int32((*Vdbe)(unsafe.Pointer(p)).FnVar)) {
+ if i < 1 || i > int32((*Vdbe)(unsafe.Pointer(p)).FnVar) {
Xsqlite3Error(tls, (*Vdbe)(unsafe.Pointer(p)).Fdb, SQLITE_RANGE)
Xsqlite3_mutex_leave(tls, (*Sqlite3)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).Fdb)).Fmutex)
return SQLITE_RANGE
}
i--
- pVar = ((*Vdbe)(unsafe.Pointer(p)).FaVar + uintptr(i)*40)
+ pVar = (*Vdbe)(unsafe.Pointer(p)).FaVar + uintptr(i)*40
Xsqlite3VdbeMemRelease(tls, pVar)
(*Mem)(unsafe.Pointer(pVar)).Fflags = U16(MEM_Null)
(*Sqlite3)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).Fdb)).FerrCode = SQLITE_OK
@@ -61929,19 +62654,19 @@ func vdbeUnbind(tls *libc.TLS, p uintptr, i int32) int32 { /* sqlite3.c:85487:12
// as if there had been a schema change, on the first sqlite3_step() call
// following any change to the bindings of that parameter.
- if ((*Vdbe)(unsafe.Pointer(p)).Fexpmask != U32(0)) && (((*Vdbe)(unsafe.Pointer(p)).Fexpmask & (func() uint32 {
+ if (*Vdbe)(unsafe.Pointer(p)).Fexpmask != U32(0) && (*Vdbe)(unsafe.Pointer(p)).Fexpmask&func() uint32 {
if i >= 31 {
return 0x80000000
}
- return (U32(U32(1)) << i)
- }())) != U32(0)) {
- libc.SetBitFieldPtr16Uint32(p+152 /* &.expired */, Bft(1), 0, 0x3)
+ return U32(U32(1)) << i
+ }() != U32(0) {
+ libc.SetBitFieldPtr16Uint32(p+160, Bft(1), 0, 0x3)
}
return SQLITE_OK
}
// Bind a text or BLOB value.
-func bindText(tls *libc.TLS, pStmt uintptr, i int32, zData uintptr, nData I64, xDel uintptr, encoding U8) int32 { /* sqlite3.c:85530:12: */
+func bindText(tls *libc.TLS, pStmt uintptr, i int32, zData uintptr, nData I64, xDel uintptr, encoding U8) int32 { /* sqlite3.c:85814:12: */
var p uintptr = pStmt
var pVar uintptr
var rc int32
@@ -61949,9 +62674,9 @@ func bindText(tls *libc.TLS, pStmt uintptr, i int32, zData uintptr, nData I64, x
rc = vdbeUnbind(tls, p, i)
if rc == SQLITE_OK {
if zData != uintptr(0) {
- pVar = ((*Vdbe)(unsafe.Pointer(p)).FaVar + uintptr((i-1))*40)
+ pVar = (*Vdbe)(unsafe.Pointer(p)).FaVar + uintptr(i-1)*40
rc = Xsqlite3VdbeMemSetStr(tls, pVar, zData, nData, encoding, xDel)
- if (rc == SQLITE_OK) && (int32(encoding) != 0) {
+ if rc == SQLITE_OK && int32(encoding) != 0 {
rc = Xsqlite3VdbeChangeEncoding(tls, pVar, int32((*Sqlite3)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).Fdb)).Fenc))
}
if rc != 0 {
@@ -61960,49 +62685,49 @@ func bindText(tls *libc.TLS, pStmt uintptr, i int32, zData uintptr, nData I64, x
}
}
Xsqlite3_mutex_leave(tls, (*Sqlite3)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).Fdb)).Fmutex)
- } else if (xDel != (uintptr(0))) && (xDel != (libc.UintptrFromInt32(-1))) {
+ } else if xDel != uintptr(0) && xDel != libc.UintptrFromInt32(-1) {
(*struct{ f func(*libc.TLS, uintptr) })(unsafe.Pointer(&struct{ uintptr }{xDel})).f(tls, zData)
}
return rc
}
// Bind a blob value to an SQL statement variable.
-func Xsqlite3_bind_blob(tls *libc.TLS, pStmt uintptr, i int32, zData uintptr, nData int32, xDel uintptr) int32 { /* sqlite3.c:85566:16: */
+func Xsqlite3_bind_blob(tls *libc.TLS, pStmt uintptr, i int32, zData uintptr, nData int32, xDel uintptr) int32 { /* sqlite3.c:85850:16: */
return bindText(tls, pStmt, i, zData, int64(nData), xDel, uint8(0))
}
-func Xsqlite3_bind_blob64(tls *libc.TLS, pStmt uintptr, i int32, zData uintptr, nData Sqlite3_uint64, xDel uintptr) int32 { /* sqlite3.c:85578:16: */
+func Xsqlite3_bind_blob64(tls *libc.TLS, pStmt uintptr, i int32, zData uintptr, nData Sqlite3_uint64, xDel uintptr) int32 { /* sqlite3.c:85862:16: */
return bindText(tls, pStmt, i, zData, int64(nData), xDel, uint8(0))
}
-func Xsqlite3_bind_double(tls *libc.TLS, pStmt uintptr, i int32, rValue float64) int32 { /* sqlite3.c:85588:16: */
+func Xsqlite3_bind_double(tls *libc.TLS, pStmt uintptr, i int32, rValue float64) int32 { /* sqlite3.c:85872:16: */
var rc int32
var p uintptr = pStmt
rc = vdbeUnbind(tls, p, i)
if rc == SQLITE_OK {
- Xsqlite3VdbeMemSetDouble(tls, ((*Vdbe)(unsafe.Pointer(p)).FaVar + uintptr((i-1))*40), rValue)
+ Xsqlite3VdbeMemSetDouble(tls, (*Vdbe)(unsafe.Pointer(p)).FaVar+uintptr(i-1)*40, rValue)
Xsqlite3_mutex_leave(tls, (*Sqlite3)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).Fdb)).Fmutex)
}
return rc
}
-func Xsqlite3_bind_int(tls *libc.TLS, p uintptr, i int32, iValue int32) int32 { /* sqlite3.c:85598:16: */
+func Xsqlite3_bind_int(tls *libc.TLS, p uintptr, i int32, iValue int32) int32 { /* sqlite3.c:85882:16: */
return Xsqlite3_bind_int64(tls, p, i, I64(iValue))
}
-func Xsqlite3_bind_int64(tls *libc.TLS, pStmt uintptr, i int32, iValue Sqlite_int64) int32 { /* sqlite3.c:85601:16: */
+func Xsqlite3_bind_int64(tls *libc.TLS, pStmt uintptr, i int32, iValue Sqlite_int64) int32 { /* sqlite3.c:85885:16: */
var rc int32
var p uintptr = pStmt
rc = vdbeUnbind(tls, p, i)
if rc == SQLITE_OK {
- Xsqlite3VdbeMemSetInt64(tls, ((*Vdbe)(unsafe.Pointer(p)).FaVar + uintptr((i-1))*40), iValue)
+ Xsqlite3VdbeMemSetInt64(tls, (*Vdbe)(unsafe.Pointer(p)).FaVar+uintptr(i-1)*40, iValue)
Xsqlite3_mutex_leave(tls, (*Sqlite3)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).Fdb)).Fmutex)
}
return rc
}
-func Xsqlite3_bind_null(tls *libc.TLS, pStmt uintptr, i int32) int32 { /* sqlite3.c:85611:16: */
+func Xsqlite3_bind_null(tls *libc.TLS, pStmt uintptr, i int32) int32 { /* sqlite3.c:85895:16: */
var rc int32
var p uintptr = pStmt
rc = vdbeUnbind(tls, p, i)
@@ -62012,12 +62737,12 @@ func Xsqlite3_bind_null(tls *libc.TLS, pStmt uintptr, i int32) int32 { /* sqlite
return rc
}
-func Xsqlite3_bind_pointer(tls *libc.TLS, pStmt uintptr, i int32, pPtr uintptr, zPTtype uintptr, xDestructor uintptr) int32 { /* sqlite3.c:85620:16: */
+func Xsqlite3_bind_pointer(tls *libc.TLS, pStmt uintptr, i int32, pPtr uintptr, zPTtype uintptr, xDestructor uintptr) int32 { /* sqlite3.c:85904:16: */
var rc int32
var p uintptr = pStmt
rc = vdbeUnbind(tls, p, i)
if rc == SQLITE_OK {
- Xsqlite3VdbeMemSetPointer(tls, ((*Vdbe)(unsafe.Pointer(p)).FaVar + uintptr((i-1))*40), pPtr, zPTtype, xDestructor)
+ Xsqlite3VdbeMemSetPointer(tls, (*Vdbe)(unsafe.Pointer(p)).FaVar+uintptr(i-1)*40, pPtr, zPTtype, xDestructor)
Xsqlite3_mutex_leave(tls, (*Sqlite3)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).Fdb)).Fmutex)
} else if xDestructor != 0 {
(*struct{ f func(*libc.TLS, uintptr) })(unsafe.Pointer(&struct{ uintptr }{xDestructor})).f(tls, pPtr)
@@ -62025,11 +62750,11 @@ func Xsqlite3_bind_pointer(tls *libc.TLS, pStmt uintptr, i int32, pPtr uintptr,
return rc
}
-func Xsqlite3_bind_text(tls *libc.TLS, pStmt uintptr, i int32, zData uintptr, nData int32, xDel uintptr) int32 { /* sqlite3.c:85638:16: */
+func Xsqlite3_bind_text(tls *libc.TLS, pStmt uintptr, i int32, zData uintptr, nData int32, xDel uintptr) int32 { /* sqlite3.c:85922:16: */
return bindText(tls, pStmt, i, zData, int64(nData), xDel, uint8(SQLITE_UTF8))
}
-func Xsqlite3_bind_text64(tls *libc.TLS, pStmt uintptr, i int32, zData uintptr, nData Sqlite3_uint64, xDel uintptr, enc uint8) int32 { /* sqlite3.c:85647:16: */
+func Xsqlite3_bind_text64(tls *libc.TLS, pStmt uintptr, i int32, zData uintptr, nData Sqlite3_uint64, xDel uintptr, enc uint8) int32 { /* sqlite3.c:85931:16: */
if int32(enc) == SQLITE_UTF16 {
enc = uint8(SQLITE_UTF16LE)
@@ -62037,29 +62762,29 @@ func Xsqlite3_bind_text64(tls *libc.TLS, pStmt uintptr, i int32, zData uintptr,
return bindText(tls, pStmt, i, zData, int64(nData), xDel, enc)
}
-func Xsqlite3_bind_text16(tls *libc.TLS, pStmt uintptr, i int32, zData uintptr, nData int32, xDel uintptr) int32 { /* sqlite3.c:85660:16: */
+func Xsqlite3_bind_text16(tls *libc.TLS, pStmt uintptr, i int32, zData uintptr, nData int32, xDel uintptr) int32 { /* sqlite3.c:85944:16: */
return bindText(tls, pStmt, i, zData, int64(nData), xDel, uint8(SQLITE_UTF16LE))
}
-func Xsqlite3_bind_value(tls *libc.TLS, pStmt uintptr, i int32, pValue uintptr) int32 { /* sqlite3.c:85670:16: */
+func Xsqlite3_bind_value(tls *libc.TLS, pStmt uintptr, i int32, pValue uintptr) int32 { /* sqlite3.c:85954:16: */
var rc int32
switch Xsqlite3_value_type(tls, pValue) {
case SQLITE_INTEGER:
{
- rc = Xsqlite3_bind_int64(tls, pStmt, i, *(*I64)(unsafe.Pointer(pValue /* &.u */)))
+ rc = Xsqlite3_bind_int64(tls, pStmt, i, *(*I64)(unsafe.Pointer(pValue)))
break
}
case SQLITE_FLOAT:
{
- rc = Xsqlite3_bind_double(tls, pStmt, i, *(*float64)(unsafe.Pointer(pValue /* &.u */)))
+ rc = Xsqlite3_bind_double(tls, pStmt, i, *(*float64)(unsafe.Pointer(pValue)))
break
}
case SQLITE_BLOB:
{
- if (int32((*Sqlite3_value)(unsafe.Pointer(pValue)).Fflags) & MEM_Zero) != 0 {
- rc = Xsqlite3_bind_zeroblob(tls, pStmt, i, *(*int32)(unsafe.Pointer(pValue /* &.u */)))
+ if int32((*Sqlite3_value)(unsafe.Pointer(pValue)).Fflags)&MEM_Zero != 0 {
+ rc = Xsqlite3_bind_zeroblob(tls, pStmt, i, *(*int32)(unsafe.Pointer(pValue)))
} else {
rc = Xsqlite3_bind_blob(tls, pStmt, i, (*Sqlite3_value)(unsafe.Pointer(pValue)).Fz, (*Sqlite3_value)(unsafe.Pointer(pValue)).Fn, libc.UintptrFromInt32(-1))
}
@@ -62083,22 +62808,22 @@ func Xsqlite3_bind_value(tls *libc.TLS, pStmt uintptr, i int32, pValue uintptr)
return rc
}
-func Xsqlite3_bind_zeroblob(tls *libc.TLS, pStmt uintptr, i int32, n int32) int32 { /* sqlite3.c:85701:16: */
+func Xsqlite3_bind_zeroblob(tls *libc.TLS, pStmt uintptr, i int32, n int32) int32 { /* sqlite3.c:85985:16: */
var rc int32
var p uintptr = pStmt
rc = vdbeUnbind(tls, p, i)
if rc == SQLITE_OK {
- Xsqlite3VdbeMemSetZeroBlob(tls, ((*Vdbe)(unsafe.Pointer(p)).FaVar + uintptr((i-1))*40), n)
+ Xsqlite3VdbeMemSetZeroBlob(tls, (*Vdbe)(unsafe.Pointer(p)).FaVar+uintptr(i-1)*40, n)
Xsqlite3_mutex_leave(tls, (*Sqlite3)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).Fdb)).Fmutex)
}
return rc
}
-func Xsqlite3_bind_zeroblob64(tls *libc.TLS, pStmt uintptr, i int32, n Sqlite3_uint64) int32 { /* sqlite3.c:85711:16: */
+func Xsqlite3_bind_zeroblob64(tls *libc.TLS, pStmt uintptr, i int32, n Sqlite3_uint64) int32 { /* sqlite3.c:85999:16: */
var rc int32
var p uintptr = pStmt
Xsqlite3_mutex_enter(tls, (*Sqlite3)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).Fdb)).Fmutex)
- if n > U64(*(*int32)(unsafe.Pointer(((*Vdbe)(unsafe.Pointer(p)).Fdb + 112 /* &.aLimit */)))) {
+ if n > U64(*(*int32)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).Fdb + 120))) {
rc = SQLITE_TOOBIG
} else {
@@ -62111,7 +62836,7 @@ func Xsqlite3_bind_zeroblob64(tls *libc.TLS, pStmt uintptr, i int32, n Sqlite3_u
// Return the number of wildcards that can be potentially bound to.
// This routine is added to support DBD::SQLite.
-func Xsqlite3_bind_parameter_count(tls *libc.TLS, pStmt uintptr) int32 { /* sqlite3.c:85730:16: */
+func Xsqlite3_bind_parameter_count(tls *libc.TLS, pStmt uintptr) int32 { /* sqlite3.c:86018:16: */
var p uintptr = pStmt
if p != 0 {
return int32((*Vdbe)(unsafe.Pointer(p)).FnVar)
@@ -62123,7 +62848,7 @@ func Xsqlite3_bind_parameter_count(tls *libc.TLS, pStmt uintptr) int32 { /* sqli
// is out of range or if the wildcard is unnamed.
//
// The result is always UTF-8.
-func Xsqlite3_bind_parameter_name(tls *libc.TLS, pStmt uintptr, i int32) uintptr { /* sqlite3.c:85741:23: */
+func Xsqlite3_bind_parameter_name(tls *libc.TLS, pStmt uintptr, i int32) uintptr { /* sqlite3.c:86029:23: */
var p uintptr = pStmt
if p == uintptr(0) {
return uintptr(0)
@@ -62134,26 +62859,26 @@ func Xsqlite3_bind_parameter_name(tls *libc.TLS, pStmt uintptr, i int32) uintptr
// Given a wildcard parameter name, return the index of the variable
// with that name. If there is no variable with the given name,
// return 0.
-func Xsqlite3VdbeParameterIndex(tls *libc.TLS, p uintptr, zName uintptr, nName int32) int32 { /* sqlite3.c:85752:20: */
- if (p == uintptr(0)) || (zName == uintptr(0)) {
+func Xsqlite3VdbeParameterIndex(tls *libc.TLS, p uintptr, zName uintptr, nName int32) int32 { /* sqlite3.c:86040:20: */
+ if p == uintptr(0) || zName == uintptr(0) {
return 0
}
return Xsqlite3VListNameToNum(tls, (*Vdbe)(unsafe.Pointer(p)).FpVList, zName, nName)
}
-func Xsqlite3_bind_parameter_index(tls *libc.TLS, pStmt uintptr, zName uintptr) int32 { /* sqlite3.c:85756:16: */
+func Xsqlite3_bind_parameter_index(tls *libc.TLS, pStmt uintptr, zName uintptr) int32 { /* sqlite3.c:86044:16: */
return Xsqlite3VdbeParameterIndex(tls, pStmt, zName, Xsqlite3Strlen30(tls, zName))
}
// Transfer all bindings from the first statement over to the second.
-func Xsqlite3TransferBindings(tls *libc.TLS, pFromStmt uintptr, pToStmt uintptr) int32 { /* sqlite3.c:85763:20: */
+func Xsqlite3TransferBindings(tls *libc.TLS, pFromStmt uintptr, pToStmt uintptr) int32 { /* sqlite3.c:86051:20: */
var pFrom uintptr = pFromStmt
var pTo uintptr = pToStmt
var i int32
Xsqlite3_mutex_enter(tls, (*Sqlite3)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(pTo)).Fdb)).Fmutex)
for i = 0; i < int32((*Vdbe)(unsafe.Pointer(pFrom)).FnVar); i++ {
- Xsqlite3VdbeMemMove(tls, ((*Vdbe)(unsafe.Pointer(pTo)).FaVar + uintptr(i)*40), ((*Vdbe)(unsafe.Pointer(pFrom)).FaVar + uintptr(i)*40))
+ Xsqlite3VdbeMemMove(tls, (*Vdbe)(unsafe.Pointer(pTo)).FaVar+uintptr(i)*40, (*Vdbe)(unsafe.Pointer(pFrom)).FaVar+uintptr(i)*40)
}
Xsqlite3_mutex_leave(tls, (*Sqlite3)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(pTo)).Fdb)).Fmutex)
return SQLITE_OK
@@ -62169,7 +62894,7 @@ func Xsqlite3TransferBindings(tls *libc.TLS, pFromStmt uintptr, pToStmt uintptr)
// If the two statements contain a different number of bindings, then
// an SQLITE_ERROR is returned. Nothing else can go wrong, so otherwise
// SQLITE_OK is returned.
-func Xsqlite3_transfer_bindings(tls *libc.TLS, pFromStmt uintptr, pToStmt uintptr) int32 { /* sqlite3.c:85790:16: */
+func Xsqlite3_transfer_bindings(tls *libc.TLS, pFromStmt uintptr, pToStmt uintptr) int32 { /* sqlite3.c:86078:16: */
var pFrom uintptr = pFromStmt
var pTo uintptr = pToStmt
if int32((*Vdbe)(unsafe.Pointer(pFrom)).FnVar) != int32((*Vdbe)(unsafe.Pointer(pTo)).FnVar) {
@@ -62177,11 +62902,11 @@ func Xsqlite3_transfer_bindings(tls *libc.TLS, pFromStmt uintptr, pToStmt uintpt
}
if (*Vdbe)(unsafe.Pointer(pTo)).Fexpmask != 0 {
- libc.SetBitFieldPtr16Uint32(pTo+152 /* &.expired */, Bft(1), 0, 0x3)
+ libc.SetBitFieldPtr16Uint32(pTo+160, Bft(1), 0, 0x3)
}
if (*Vdbe)(unsafe.Pointer(pFrom)).Fexpmask != 0 {
- libc.SetBitFieldPtr16Uint32(pFrom+152 /* &.expired */, Bft(1), 0, 0x3)
+ libc.SetBitFieldPtr16Uint32(pFrom+160, Bft(1), 0, 0x3)
}
return Xsqlite3TransferBindings(tls, pFromStmt, pToStmt)
}
@@ -62190,7 +62915,7 @@ func Xsqlite3_transfer_bindings(tls *libc.TLS, pFromStmt uintptr, pToStmt uintpt
// in the argument belongs. This is the same database handle that was
// the first argument to the sqlite3_prepare() that was used to create
// the statement in the first place.
-func Xsqlite3_db_handle(tls *libc.TLS, pStmt uintptr) uintptr { /* sqlite3.c:85814:20: */
+func Xsqlite3_db_handle(tls *libc.TLS, pStmt uintptr) uintptr { /* sqlite3.c:86102:20: */
if pStmt != 0 {
return (*Vdbe)(unsafe.Pointer(pStmt)).Fdb
}
@@ -62199,33 +62924,33 @@ func Xsqlite3_db_handle(tls *libc.TLS, pStmt uintptr) uintptr { /* sqlite3.c:858
// Return true if the prepared statement is guaranteed to not modify the
// database.
-func Xsqlite3_stmt_readonly(tls *libc.TLS, pStmt uintptr) int32 { /* sqlite3.c:85822:16: */
+func Xsqlite3_stmt_readonly(tls *libc.TLS, pStmt uintptr) int32 { /* sqlite3.c:86110:16: */
if pStmt != 0 {
- return (int32(*(*uint16)(unsafe.Pointer(pStmt + 152 /* &.readOnly */)) & 0x80 >> 7))
+ return int32(*(*uint16)(unsafe.Pointer(pStmt + 160)) & 0x80 >> 7)
}
return 1
}
// Return 1 if the statement is an EXPLAIN and return 2 if the
// statement is an EXPLAIN QUERY PLAN
-func Xsqlite3_stmt_isexplain(tls *libc.TLS, pStmt uintptr) int32 { /* sqlite3.c:85830:16: */
+func Xsqlite3_stmt_isexplain(tls *libc.TLS, pStmt uintptr) int32 { /* sqlite3.c:86118:16: */
if pStmt != 0 {
- return (int32(*(*uint16)(unsafe.Pointer(pStmt + 152 /* &.explain */)) & 0xc >> 2))
+ return int32(*(*uint16)(unsafe.Pointer(pStmt + 160)) & 0xc >> 2)
}
return 0
}
// Return true if the prepared statement is in need of being reset.
-func Xsqlite3_stmt_busy(tls *libc.TLS, pStmt uintptr) int32 { /* sqlite3.c:85837:16: */
+func Xsqlite3_stmt_busy(tls *libc.TLS, pStmt uintptr) int32 { /* sqlite3.c:86125:16: */
var v uintptr = pStmt
- return (libc.Bool32(((v != uintptr(0)) && ((*Vdbe)(unsafe.Pointer(v)).FiVdbeMagic == U32(VDBE_MAGIC_RUN))) && ((*Vdbe)(unsafe.Pointer(v)).Fpc >= 0)))
+ return libc.Bool32(v != uintptr(0) && (*Vdbe)(unsafe.Pointer(v)).FiVdbeMagic == U32(VDBE_MAGIC_RUN) && (*Vdbe)(unsafe.Pointer(v)).Fpc >= 0)
}
// Return a pointer to the next prepared statement after pStmt associated
// with database connection pDb. If pStmt is NULL, return the first
// prepared statement for the database connection. Return NULL if there
// are no more.
-func Xsqlite3_next_stmt(tls *libc.TLS, pDb uintptr, pStmt uintptr) uintptr { /* sqlite3.c:85848:25: */
+func Xsqlite3_next_stmt(tls *libc.TLS, pDb uintptr, pStmt uintptr) uintptr { /* sqlite3.c:86136:25: */
var pNext uintptr
Xsqlite3_mutex_enter(tls, (*Sqlite3)(unsafe.Pointer(pDb)).Fmutex)
if pStmt == uintptr(0) {
@@ -62238,7 +62963,7 @@ func Xsqlite3_next_stmt(tls *libc.TLS, pDb uintptr, pStmt uintptr) uintptr { /*
}
// Return the value of a status counter for a prepared statement
-func Xsqlite3_stmt_status(tls *libc.TLS, pStmt uintptr, op int32, resetFlag int32) int32 { /* sqlite3.c:85869:16: */
+func Xsqlite3_stmt_status(tls *libc.TLS, pStmt uintptr, op int32, resetFlag int32) int32 { /* sqlite3.c:86157:16: */
bp := tls.Alloc(4)
defer tls.Free(4)
@@ -62255,16 +62980,16 @@ func Xsqlite3_stmt_status(tls *libc.TLS, pStmt uintptr, op int32, resetFlag int3
(*Sqlite3)(unsafe.Pointer(db)).FpnBytesFreed = uintptr(0)
Xsqlite3_mutex_leave(tls, (*Sqlite3)(unsafe.Pointer(db)).Fmutex)
} else {
- *(*U32)(unsafe.Pointer(bp /* v */)) = *(*U32)(unsafe.Pointer((pVdbe + 164 /* &.aCounter */) + uintptr(op)*4))
+ *(*U32)(unsafe.Pointer(bp /* v */)) = *(*U32)(unsafe.Pointer(pVdbe + 172 + uintptr(op)*4))
if resetFlag != 0 {
- *(*U32)(unsafe.Pointer((pVdbe + 164 /* &.aCounter */) + uintptr(op)*4)) = U32(0)
+ *(*U32)(unsafe.Pointer(pVdbe + 172 + uintptr(op)*4)) = U32(0)
}
}
return int32(*(*U32)(unsafe.Pointer(bp /* v */)))
}
// Return the SQL associated with a prepared statement
-func Xsqlite3_sql(tls *libc.TLS, pStmt uintptr) uintptr { /* sqlite3.c:85899:23: */
+func Xsqlite3_sql(tls *libc.TLS, pStmt uintptr) uintptr { /* sqlite3.c:86187:23: */
var p uintptr = pStmt
if p != 0 {
return (*Vdbe)(unsafe.Pointer(p)).FzSql
@@ -62279,7 +63004,7 @@ func Xsqlite3_sql(tls *libc.TLS, pStmt uintptr) uintptr { /* sqlite3.c:85899:23:
//
// The SQLITE_TRACE_SIZE_LIMIT puts an upper bound on the size of
// expanded bound parameters.
-func Xsqlite3_expanded_sql(tls *libc.TLS, pStmt uintptr) uintptr { /* sqlite3.c:85913:17: */
+func Xsqlite3_expanded_sql(tls *libc.TLS, pStmt uintptr) uintptr { /* sqlite3.c:86201:17: */
var z uintptr = uintptr(0)
var zSql uintptr = Xsqlite3_sql(tls, pStmt)
if zSql != 0 {
@@ -62294,12 +63019,12 @@ func Xsqlite3_expanded_sql(tls *libc.TLS, pStmt uintptr) uintptr { /* sqlite3.c:
// Allocate and populate an UnpackedRecord structure based on the serialized
// record in nKey/pKey. Return a pointer to the new UnpackedRecord structure
// if successful, or a NULL pointer if an OOM error is encountered.
-func vdbeUnpackRecord(tls *libc.TLS, pKeyInfo uintptr, nKey int32, pKey uintptr) uintptr { /* sqlite3.c:85951:23: */
+func vdbeUnpackRecord(tls *libc.TLS, pKeyInfo uintptr, nKey int32, pKey uintptr) uintptr { /* sqlite3.c:86239:23: */
var pRet uintptr // Return value
pRet = Xsqlite3VdbeAllocUnpackedRecord(tls, pKeyInfo)
if pRet != 0 {
- libc.Xmemset(tls, (*UnpackedRecord)(unsafe.Pointer(pRet)).FaMem, 0, (uint32(unsafe.Sizeof(Mem{})) * (uint32(int32((*KeyInfo)(unsafe.Pointer(pKeyInfo)).FnKeyField) + 1))))
+ libc.Xmemset(tls, (*UnpackedRecord)(unsafe.Pointer(pRet)).FaMem, 0, uint32(unsafe.Sizeof(Mem{}))*uint32(int32((*KeyInfo)(unsafe.Pointer(pKeyInfo)).FnKeyField)+1))
Xsqlite3VdbeRecordUnpack(tls, pKeyInfo, nKey, pKey, pRet)
}
return pRet
@@ -62307,7 +63032,7 @@ func vdbeUnpackRecord(tls *libc.TLS, pKeyInfo uintptr, nKey int32, pKey uintptr)
// This function is called from within a pre-update callback to retrieve
// a field of the row currently being updated or deleted.
-func Xsqlite3_preupdate_old(tls *libc.TLS, db uintptr, iIdx int32, ppValue uintptr) int32 { /* sqlite3.c:85970:16: */
+func Xsqlite3_preupdate_old(tls *libc.TLS, db uintptr, iIdx int32, ppValue uintptr) int32 { /* sqlite3.c:86258:16: */
var p uintptr
var pMem uintptr
var rc int32
@@ -62318,10 +63043,10 @@ func Xsqlite3_preupdate_old(tls *libc.TLS, db uintptr, iIdx int32, ppValue uintp
// 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) || ((*PreUpdate)(unsafe.Pointer(p)).Fop == SQLITE_INSERT)) {
+ if !(!(p != 0) || (*PreUpdate)(unsafe.Pointer(p)).Fop == SQLITE_INSERT) {
goto __1
}
- rc = Xsqlite3MisuseError(tls, 85978)
+ rc = Xsqlite3MisuseError(tls, 86266)
goto preupdate_old_out
__1:
;
@@ -62331,7 +63056,7 @@ __1:
iIdx = int32(Xsqlite3TableColumnToIndex(tls, (*PreUpdate)(unsafe.Pointer(p)).FpPk, int16(iIdx)))
__2:
;
- if !((iIdx >= int32((*VdbeCursor)(unsafe.Pointer((*PreUpdate)(unsafe.Pointer(p)).FpCsr)).FnField)) || (iIdx < 0)) {
+ if !(iIdx >= int32((*VdbeCursor)(unsafe.Pointer((*PreUpdate)(unsafe.Pointer(p)).FpCsr)).FnField) || iIdx < 0) {
goto __3
}
rc = SQLITE_RANGE
@@ -62344,20 +63069,20 @@ __3:
goto __4
}
- nRec = Xsqlite3BtreePayloadSize(tls, *(*uintptr)(unsafe.Pointer((*PreUpdate)(unsafe.Pointer(p)).FpCsr + 40 /* &.uc */)))
+ nRec = Xsqlite3BtreePayloadSize(tls, *(*uintptr)(unsafe.Pointer((*PreUpdate)(unsafe.Pointer(p)).FpCsr + 40)))
aRec = Xsqlite3DbMallocRaw(tls, db, uint64(nRec))
- if !(!(aRec != 0)) {
+ if !!(aRec != 0) {
goto __5
}
goto preupdate_old_out
__5:
;
- rc = Xsqlite3BtreePayload(tls, *(*uintptr)(unsafe.Pointer((*PreUpdate)(unsafe.Pointer(p)).FpCsr + 40 /* &.uc */)), uint32(0), nRec, aRec)
+ rc = Xsqlite3BtreePayload(tls, *(*uintptr)(unsafe.Pointer((*PreUpdate)(unsafe.Pointer(p)).FpCsr + 40)), uint32(0), nRec, aRec)
if !(rc == SQLITE_OK) {
goto __6
}
- (*PreUpdate)(unsafe.Pointer(p)).FpUnpacked = vdbeUnpackRecord(tls, (p + 16 /* &.keyinfo */), int32(nRec), aRec)
- if !(!(int32((*PreUpdate)(unsafe.Pointer(p)).FpUnpacked) != 0)) {
+ (*PreUpdate)(unsafe.Pointer(p)).FpUnpacked = vdbeUnpackRecord(tls, p+16, int32(nRec), aRec)
+ if !!(int32((*PreUpdate)(unsafe.Pointer(p)).FpUnpacked) != 0) {
goto __7
}
rc = SQLITE_NOMEM
@@ -62376,7 +63101,7 @@ __8:
__4:
;
- pMem = libc.AssignPtrUintptr(ppValue, ((*UnpackedRecord)(unsafe.Pointer((*PreUpdate)(unsafe.Pointer(p)).FpUnpacked)).FaMem + uintptr(iIdx)*40))
+ pMem = libc.AssignPtrUintptr(ppValue, (*UnpackedRecord)(unsafe.Pointer((*PreUpdate)(unsafe.Pointer(p)).FpUnpacked)).FaMem+uintptr(iIdx)*40)
if !(iIdx == int32((*Table)(unsafe.Pointer((*PreUpdate)(unsafe.Pointer(p)).FpTab)).FiPKey)) {
goto __9
}
@@ -62389,10 +63114,10 @@ __9:
*(*uintptr)(unsafe.Pointer(ppValue)) = columnNullValue(tls)
goto __12
__11:
- if !(int32((*Column)(unsafe.Pointer((*Table)(unsafe.Pointer((*PreUpdate)(unsafe.Pointer(p)).FpTab)).FaCol+uintptr(iIdx)*20)).Faffinity) == SQLITE_AFF_REAL) {
+ if !(int32((*Column)(unsafe.Pointer((*Table)(unsafe.Pointer((*PreUpdate)(unsafe.Pointer(p)).FpTab)).FaCol+uintptr(iIdx)*16)).Faffinity) == SQLITE_AFF_REAL) {
goto __13
}
- if !((int32((*Mem)(unsafe.Pointer(pMem)).Fflags) & (MEM_Int | MEM_IntReal)) != 0) {
+ if !(int32((*Mem)(unsafe.Pointer(pMem)).Fflags)&(MEM_Int|MEM_IntReal) != 0) {
goto __14
}
@@ -62413,7 +63138,7 @@ preupdate_old_out:
// This function is called from within a pre-update callback to retrieve
// the number of columns in the row being updated, deleted or inserted.
-func Xsqlite3_preupdate_count(tls *libc.TLS, db uintptr) int32 { /* sqlite3.c:86033:16: */
+func Xsqlite3_preupdate_count(tls *libc.TLS, db uintptr) int32 { /* sqlite3.c:86322:16: */
var p uintptr = (*Sqlite3)(unsafe.Pointer(db)).FpPreUpdate
return func() int32 {
if p != 0 {
@@ -62432,7 +63157,7 @@ func Xsqlite3_preupdate_count(tls *libc.TLS, db uintptr) int32 { /* sqlite3.c:86
//
// For the purposes of the previous paragraph, a foreign key CASCADE, SET NULL
// or SET DEFAULT action is considered a trigger.
-func Xsqlite3_preupdate_depth(tls *libc.TLS, db uintptr) int32 { /* sqlite3.c:86051:16: */
+func Xsqlite3_preupdate_depth(tls *libc.TLS, db uintptr) int32 { /* sqlite3.c:86340:16: */
var p uintptr = (*Sqlite3)(unsafe.Pointer(db)).FpPreUpdate
return func() int32 {
if p != 0 {
@@ -62444,7 +63169,7 @@ func Xsqlite3_preupdate_depth(tls *libc.TLS, db uintptr) int32 { /* sqlite3.c:86
// This function is designed to be called from within a pre-update callback
// only.
-func Xsqlite3_preupdate_blobwrite(tls *libc.TLS, db uintptr) int32 { /* sqlite3.c:86062:16: */
+func Xsqlite3_preupdate_blobwrite(tls *libc.TLS, db uintptr) int32 { /* sqlite3.c:86351:16: */
var p uintptr = (*Sqlite3)(unsafe.Pointer(db)).FpPreUpdate
return func() int32 {
if p != 0 {
@@ -62456,7 +63181,7 @@ func Xsqlite3_preupdate_blobwrite(tls *libc.TLS, db uintptr) int32 { /* sqlite3.
// This function is called from within a pre-update callback to retrieve
// a field of the row currently being updated or inserted.
-func Xsqlite3_preupdate_new(tls *libc.TLS, db uintptr, iIdx int32, ppValue uintptr) int32 { /* sqlite3.c:86073:16: */
+func Xsqlite3_preupdate_new(tls *libc.TLS, db uintptr, iIdx int32, ppValue uintptr) int32 { /* sqlite3.c:86362:16: */
var p uintptr
var rc int32
var pMem uintptr
@@ -62467,20 +63192,20 @@ func Xsqlite3_preupdate_new(tls *libc.TLS, db uintptr, iIdx int32, ppValue uintp
p = (*Sqlite3)(unsafe.Pointer(db)).FpPreUpdate
rc = SQLITE_OK
- if !(!(p != 0) || ((*PreUpdate)(unsafe.Pointer(p)).Fop == SQLITE_DELETE)) {
+ if !(!(p != 0) || (*PreUpdate)(unsafe.Pointer(p)).Fop == SQLITE_DELETE) {
goto __1
}
- rc = Xsqlite3MisuseError(tls, 86079)
+ rc = Xsqlite3MisuseError(tls, 86368)
goto preupdate_new_out
__1:
;
- if !(((*PreUpdate)(unsafe.Pointer(p)).FpPk != 0) && ((*PreUpdate)(unsafe.Pointer(p)).Fop != SQLITE_UPDATE)) {
+ if !((*PreUpdate)(unsafe.Pointer(p)).FpPk != 0 && (*PreUpdate)(unsafe.Pointer(p)).Fop != SQLITE_UPDATE) {
goto __2
}
iIdx = int32(Xsqlite3TableColumnToIndex(tls, (*PreUpdate)(unsafe.Pointer(p)).FpPk, int16(iIdx)))
__2:
;
- if !((iIdx >= int32((*VdbeCursor)(unsafe.Pointer((*PreUpdate)(unsafe.Pointer(p)).FpCsr)).FnField)) || (iIdx < 0)) {
+ if !(iIdx >= int32((*VdbeCursor)(unsafe.Pointer((*PreUpdate)(unsafe.Pointer(p)).FpCsr)).FnField) || iIdx < 0) {
goto __3
}
rc = SQLITE_RANGE
@@ -62494,12 +63219,12 @@ __3:
// For an INSERT, memory cell p->iNewReg contains the serialized record
// that is being inserted. Deserialize it.
pUnpack = (*PreUpdate)(unsafe.Pointer(p)).FpNewUnpacked
- if !(!(pUnpack != 0)) {
+ if !!(pUnpack != 0) {
goto __6
}
- pData = ((*Vdbe)(unsafe.Pointer((*PreUpdate)(unsafe.Pointer(p)).Fv)).FaMem + uintptr((*PreUpdate)(unsafe.Pointer(p)).FiNewReg)*40)
+ pData = (*Vdbe)(unsafe.Pointer((*PreUpdate)(unsafe.Pointer(p)).Fv)).FaMem + uintptr((*PreUpdate)(unsafe.Pointer(p)).FiNewReg)*40
rc = func() int32 {
- if (int32((*Mem)(unsafe.Pointer((pData))).Fflags) & MEM_Zero) != 0 {
+ if int32((*Mem)(unsafe.Pointer(pData)).Fflags)&MEM_Zero != 0 {
return Xsqlite3VdbeMemExpandBlob(tls, pData)
}
return 0
@@ -62510,8 +63235,8 @@ __3:
goto preupdate_new_out
__7:
;
- pUnpack = vdbeUnpackRecord(tls, (p + 16 /* &.keyinfo */), (*Mem)(unsafe.Pointer(pData)).Fn, (*Mem)(unsafe.Pointer(pData)).Fz)
- if !(!(pUnpack != 0)) {
+ pUnpack = vdbeUnpackRecord(tls, p+16, (*Mem)(unsafe.Pointer(pData)).Fn, (*Mem)(unsafe.Pointer(pData)).Fz)
+ if !!(pUnpack != 0) {
goto __8
}
rc = SQLITE_NOMEM
@@ -62521,7 +63246,7 @@ __8:
(*PreUpdate)(unsafe.Pointer(p)).FpNewUnpacked = pUnpack
__6:
;
- pMem = ((*UnpackedRecord)(unsafe.Pointer(pUnpack)).FaMem + uintptr(iIdx)*40)
+ pMem = (*UnpackedRecord)(unsafe.Pointer(pUnpack)).FaMem + uintptr(iIdx)*40
if !(iIdx == int32((*Table)(unsafe.Pointer((*PreUpdate)(unsafe.Pointer(p)).FpTab)).FiPKey)) {
goto __9
}
@@ -62543,11 +63268,11 @@ __4:
// It is not safe to return a pointer to the memory cell itself as the
// caller may modify the value text encoding.
;
- if !(!(int32((*PreUpdate)(unsafe.Pointer(p)).FaNew) != 0)) {
+ if !!(int32((*PreUpdate)(unsafe.Pointer(p)).FaNew) != 0) {
goto __12
}
- (*PreUpdate)(unsafe.Pointer(p)).FaNew = Xsqlite3DbMallocZero(tls, db, (uint64(uint32(unsafe.Sizeof(Mem{})) * uint32((*VdbeCursor)(unsafe.Pointer((*PreUpdate)(unsafe.Pointer(p)).FpCsr)).FnField))))
- if !(!(int32((*PreUpdate)(unsafe.Pointer(p)).FaNew) != 0)) {
+ (*PreUpdate)(unsafe.Pointer(p)).FaNew = Xsqlite3DbMallocZero(tls, db, uint64(uint32(unsafe.Sizeof(Mem{}))*uint32((*VdbeCursor)(unsafe.Pointer((*PreUpdate)(unsafe.Pointer(p)).FpCsr)).FnField)))
+ if !!(int32((*PreUpdate)(unsafe.Pointer(p)).FaNew) != 0) {
goto __13
}
rc = SQLITE_NOMEM
@@ -62557,7 +63282,7 @@ __13:
__12:
;
- pMem = ((*PreUpdate)(unsafe.Pointer(p)).FaNew + uintptr(iIdx)*40)
+ pMem = (*PreUpdate)(unsafe.Pointer(p)).FaNew + uintptr(iIdx)*40
if !(int32((*Mem)(unsafe.Pointer(pMem)).Fflags) == 0) {
goto __14
}
@@ -62567,7 +63292,7 @@ __12:
Xsqlite3VdbeMemSetInt64(tls, pMem, (*PreUpdate)(unsafe.Pointer(p)).FiKey2)
goto __16
__15:
- rc = Xsqlite3VdbeMemCopy(tls, pMem, ((*Vdbe)(unsafe.Pointer((*PreUpdate)(unsafe.Pointer(p)).Fv)).FaMem + uintptr((((*PreUpdate)(unsafe.Pointer(p)).FiNewReg+1)+iIdx))*40))
+ rc = Xsqlite3VdbeMemCopy(tls, pMem, (*Vdbe)(unsafe.Pointer((*PreUpdate)(unsafe.Pointer(p)).Fv)).FaMem+uintptr((*PreUpdate)(unsafe.Pointer(p)).FiNewReg+1+iIdx)*40)
if !(rc != SQLITE_OK) {
goto __17
}
@@ -62611,7 +63336,7 @@ preupdate_new_out:
// bytes in this text up to but excluding the first character in
// a host parameter. If the text contains no host parameters, return
// the total number of bytes in the text.
-func findNextHostParameter(tls *libc.TLS, zSql uintptr, pnToken uintptr) int32 { /* sqlite3.c:86243:12: */
+func findNextHostParameter(tls *libc.TLS, zSql uintptr, pnToken uintptr) int32 { /* sqlite3.c:86532:12: */
bp := tls.Alloc(4)
defer tls.Free(4)
@@ -62624,11 +63349,11 @@ func findNextHostParameter(tls *libc.TLS, zSql uintptr, pnToken uintptr) int32 {
for *(*uint8)(unsafe.Pointer(zSql)) != 0 {
n = Xsqlite3GetToken(tls, zSql, bp /* &tokenType */)
- if *(*int32)(unsafe.Pointer(bp /* tokenType */)) == TK_VARIABLE {
+ if *(*int32)(unsafe.Pointer(bp)) == TK_VARIABLE {
*(*int32)(unsafe.Pointer(pnToken)) = n
break
}
- nTotal = nTotal + (n)
+ nTotal = nTotal + n
zSql += uintptr(n)
}
return nTotal
@@ -62656,109 +63381,106 @@ func findNextHostParameter(tls *libc.TLS, zSql uintptr, pnToken uintptr) int32 {
// statement for the corresponding OP_Variable opcode. Once the host
// parameter index is known, locate the value in p->aVar[]. Then render
// the value as a literal in place of the host parameter name.
-func Xsqlite3VdbeExpandSql(tls *libc.TLS, p uintptr, zRawSql uintptr) uintptr { /* sqlite3.c:86286:21: */
- bp := tls.Alloc(224)
- defer tls.Free(224)
-
- var db uintptr // The database connection
- *(*int32)(unsafe.Pointer(bp + 176 /* idx */)) = 0 // Index of a host parameter
- var nextIndex int32 = 1 // Index of next ? host parameter
- var n int32 // Length of a token prefix
- // var nToken int32 at bp+172, 4
+func Xsqlite3VdbeExpandSql(tls *libc.TLS, p uintptr, zRawSql uintptr) uintptr { /* sqlite3.c:86575:21: */
+ bp := tls.Alloc(120)
+ defer tls.Free(120)
+
+ var db uintptr // The database connection
+ *(*int32)(unsafe.Pointer(bp + 76 /* idx */)) = 0 // Index of a host parameter
+ var nextIndex int32 = 1 // Index of next ? host parameter
+ var n int32 // Length of a token prefix
+ // var nToken int32 at bp+72, 4
// Length of the parameter token
var i int32 // Loop counter
var pVar uintptr // Value of a host parameter
// var out StrAccum at bp+48, 24
// Accumulate the output here
- // var utf8 Mem at bp+184, 40
+ // var utf8 Mem at bp+80, 40
// Used to convert UTF16 into UTF8 for display
- // var zBase [100]uint8 at bp+72, 100
- // Initial working space
db = (*Vdbe)(unsafe.Pointer(p)).Fdb
- Xsqlite3StrAccumInit(tls, bp+48 /* &out */, uintptr(0), bp+72 /* &zBase[0] */, int32(unsafe.Sizeof([100]uint8{})),
- *(*int32)(unsafe.Pointer((db + 112 /* &.aLimit */))))
+ Xsqlite3StrAccumInit(tls, bp+48 /* &out */, uintptr(0), uintptr(0), 0, *(*int32)(unsafe.Pointer(db + 120)))
if (*Sqlite3)(unsafe.Pointer(db)).FnVdbeExec > 1 {
for *(*uint8)(unsafe.Pointer(zRawSql)) != 0 {
var zStart uintptr = zRawSql
- for (int32(*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&zRawSql, 1)))) != '\n') && (*(*uint8)(unsafe.Pointer(zRawSql)) != 0) {
+ for int32(*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&zRawSql, 1)))) != '\n' && *(*uint8)(unsafe.Pointer(zRawSql)) != 0 {
}
- Xsqlite3_str_append(tls, bp+48 /* &out */, ts+4511 /* "-- " */, 3)
+ Xsqlite3_str_append(tls, bp+48 /* &out */, ts+5317 /* "-- " */, 3)
- Xsqlite3_str_append(tls, bp+48 /* &out */, zStart, ((int32(zRawSql) - int32(zStart)) / 1))
+ Xsqlite3_str_append(tls, bp+48 /* &out */, zStart, (int32(zRawSql)-int32(zStart))/1)
}
} else if int32((*Vdbe)(unsafe.Pointer(p)).FnVar) == 0 {
Xsqlite3_str_append(tls, bp+48 /* &out */, zRawSql, Xsqlite3Strlen30(tls, zRawSql))
} else {
for *(*uint8)(unsafe.Pointer(zRawSql)) != 0 {
- n = findNextHostParameter(tls, zRawSql, bp+172 /* &nToken */)
+ n = findNextHostParameter(tls, zRawSql, bp+72 /* &nToken */)
Xsqlite3_str_append(tls, bp+48 /* &out */, zRawSql, n)
zRawSql += uintptr(n)
- if *(*int32)(unsafe.Pointer(bp + 172 /* nToken */)) == 0 {
+ if *(*int32)(unsafe.Pointer(bp + 72)) == 0 {
break
}
if int32(*(*uint8)(unsafe.Pointer(zRawSql))) == '?' {
- if *(*int32)(unsafe.Pointer(bp + 172 /* nToken */)) > 1 {
+ if *(*int32)(unsafe.Pointer(bp + 72)) > 1 {
- Xsqlite3GetInt32(tls, (zRawSql + 1), bp+176 /* &idx */)
+ Xsqlite3GetInt32(tls, zRawSql+1, bp+76 /* &idx */)
} else {
- *(*int32)(unsafe.Pointer(bp + 176 /* idx */)) = nextIndex
+ *(*int32)(unsafe.Pointer(bp + 76 /* idx */)) = nextIndex
}
} else {
- *(*int32)(unsafe.Pointer(bp + 176 /* idx */)) = Xsqlite3VdbeParameterIndex(tls, p, zRawSql, *(*int32)(unsafe.Pointer(bp + 172 /* nToken */)))
+ *(*int32)(unsafe.Pointer(bp + 76 /* idx */)) = Xsqlite3VdbeParameterIndex(tls, p, zRawSql, *(*int32)(unsafe.Pointer(bp + 72 /* nToken */)))
}
- zRawSql += uintptr(*(*int32)(unsafe.Pointer(bp + 172 /* nToken */)))
+ zRawSql += uintptr(*(*int32)(unsafe.Pointer(bp + 72 /* nToken */)))
nextIndex = func() int32 {
- if (*(*int32)(unsafe.Pointer(bp + 176 /* idx */)) + 1) > (nextIndex) {
- return (*(*int32)(unsafe.Pointer(bp + 176 /* idx */)) + 1)
+ if *(*int32)(unsafe.Pointer(bp + 76))+1 > nextIndex {
+ return *(*int32)(unsafe.Pointer(bp + 76)) + 1
}
return nextIndex
}()
- pVar = ((*Vdbe)(unsafe.Pointer(p)).FaVar + uintptr((*(*int32)(unsafe.Pointer(bp + 176 /* idx */))-1))*40)
- if (int32((*Mem)(unsafe.Pointer(pVar)).Fflags) & MEM_Null) != 0 {
- Xsqlite3_str_append(tls, bp+48 /* &out */, ts+756 /* "NULL" */, 4)
- } else if (int32((*Mem)(unsafe.Pointer(pVar)).Fflags) & (MEM_Int | MEM_IntReal)) != 0 {
- Xsqlite3_str_appendf(tls, bp+48 /* &out */, ts+4084 /* "%lld" */, libc.VaList(bp, *(*I64)(unsafe.Pointer(pVar /* &.u */))))
- } else if (int32((*Mem)(unsafe.Pointer(pVar)).Fflags) & MEM_Real) != 0 {
- Xsqlite3_str_appendf(tls, bp+48 /* &out */, ts+4034 /* "%!.15g" */, libc.VaList(bp+8, *(*float64)(unsafe.Pointer(pVar /* &.u */))))
- } else if (int32((*Mem)(unsafe.Pointer(pVar)).Fflags) & MEM_Str) != 0 {
+ pVar = (*Vdbe)(unsafe.Pointer(p)).FaVar + uintptr(*(*int32)(unsafe.Pointer(bp + 76))-1)*40
+ if int32((*Mem)(unsafe.Pointer(pVar)).Fflags)&MEM_Null != 0 {
+ Xsqlite3_str_append(tls, bp+48 /* &out */, ts+1544 /* "NULL" */, 4)
+ } else if int32((*Mem)(unsafe.Pointer(pVar)).Fflags)&(MEM_Int|MEM_IntReal) != 0 {
+ Xsqlite3_str_appendf(tls, bp+48 /* &out */, ts+1327 /* "%lld" */, libc.VaList(bp, *(*I64)(unsafe.Pointer(pVar))))
+ } else if int32((*Mem)(unsafe.Pointer(pVar)).Fflags)&MEM_Real != 0 {
+ Xsqlite3_str_appendf(tls, bp+48 /* &out */, ts+4845 /* "%!.15g" */, libc.VaList(bp+8, *(*float64)(unsafe.Pointer(pVar))))
+ } else if int32((*Mem)(unsafe.Pointer(pVar)).Fflags)&MEM_Str != 0 {
var nOut int32 // Number of bytes of the string text to include in output
var enc U8 = (*Sqlite3)(unsafe.Pointer(db)).Fenc
if int32(enc) != SQLITE_UTF8 {
- libc.Xmemset(tls, bp+184 /* &utf8 */, 0, uint32(unsafe.Sizeof(Mem{})))
- (*Mem)(unsafe.Pointer(bp + 184 /* &utf8 */)).Fdb = db
- Xsqlite3VdbeMemSetStr(tls, bp+184 /* &utf8 */, (*Mem)(unsafe.Pointer(pVar)).Fz, int64((*Mem)(unsafe.Pointer(pVar)).Fn), enc, uintptr(0))
- if SQLITE_NOMEM == Xsqlite3VdbeChangeEncoding(tls, bp+184 /* &utf8 */, SQLITE_UTF8) {
+ libc.Xmemset(tls, bp+80 /* &utf8 */, 0, uint32(unsafe.Sizeof(Mem{})))
+ (*Mem)(unsafe.Pointer(bp + 80 /* &utf8 */)).Fdb = db
+ Xsqlite3VdbeMemSetStr(tls, bp+80 /* &utf8 */, (*Mem)(unsafe.Pointer(pVar)).Fz, int64((*Mem)(unsafe.Pointer(pVar)).Fn), enc, uintptr(0))
+ if SQLITE_NOMEM == Xsqlite3VdbeChangeEncoding(tls, bp+80, SQLITE_UTF8) {
(*StrAccum)(unsafe.Pointer(bp + 48 /* &out */)).FaccError = U8(SQLITE_NOMEM)
(*StrAccum)(unsafe.Pointer(bp + 48 /* &out */)).FnAlloc = U32(0)
}
- pVar = bp + 184 /* &utf8 */
+ pVar = bp + 80 /* &utf8 */
}
nOut = (*Mem)(unsafe.Pointer(pVar)).Fn
- Xsqlite3_str_appendf(tls, bp+48 /* &out */, ts+4515 /* "'%.*q'" */, libc.VaList(bp+16, nOut, (*Mem)(unsafe.Pointer(pVar)).Fz))
+ Xsqlite3_str_appendf(tls, bp+48 /* &out */, ts+5321 /* "'%.*q'" */, libc.VaList(bp+16, nOut, (*Mem)(unsafe.Pointer(pVar)).Fz))
if int32(enc) != SQLITE_UTF8 {
- Xsqlite3VdbeMemRelease(tls, bp+184 /* &utf8 */)
+ Xsqlite3VdbeMemRelease(tls, bp+80 /* &utf8 */)
}
- } else if (int32((*Mem)(unsafe.Pointer(pVar)).Fflags) & MEM_Zero) != 0 {
- Xsqlite3_str_appendf(tls, bp+48 /* &out */, ts+4522 /* "zeroblob(%d)" */, libc.VaList(bp+32, *(*int32)(unsafe.Pointer(pVar /* &.u */))))
+ } else if int32((*Mem)(unsafe.Pointer(pVar)).Fflags)&MEM_Zero != 0 {
+ Xsqlite3_str_appendf(tls, bp+48 /* &out */, ts+5328 /* "zeroblob(%d)" */, libc.VaList(bp+32, *(*int32)(unsafe.Pointer(pVar))))
} else {
var nOut int32 // Number of bytes of the blob to include in output
- Xsqlite3_str_append(tls, bp+48 /* &out */, ts+4535 /* "x'" */, 2)
+ Xsqlite3_str_append(tls, bp+48 /* &out */, ts+5341 /* "x'" */, 2)
nOut = (*Mem)(unsafe.Pointer(pVar)).Fn
for i = 0; i < nOut; i++ {
- Xsqlite3_str_appendf(tls, bp+48 /* &out */, ts+4538 /* "%02x" */, libc.VaList(bp+40, (int32(*(*uint8)(unsafe.Pointer((*Mem)(unsafe.Pointer(pVar)).Fz + uintptr(i))))&0xff)))
+ Xsqlite3_str_appendf(tls, bp+48 /* &out */, ts+5344 /* "%02x" */, libc.VaList(bp+40, int32(*(*uint8)(unsafe.Pointer((*Mem)(unsafe.Pointer(pVar)).Fz + uintptr(i))))&0xff))
}
- Xsqlite3_str_append(tls, bp+48 /* &out */, ts+4543 /* "'" */, 1)
+ Xsqlite3_str_append(tls, bp+48 /* &out */, ts+5349 /* "'" */, 1)
}
}
}
- if (*StrAccum)(unsafe.Pointer(bp+48 /* &out */)).FaccError != 0 {
+ if (*StrAccum)(unsafe.Pointer(bp+48)).FaccError != 0 {
Xsqlite3_str_reset(tls, bp+48 /* &out */)
}
return Xsqlite3StrAccumFinish(tls, bp+48 /* &out */)
@@ -62882,7 +63604,7 @@ func Xsqlite3VdbeExpandSql(tls *libc.TLS, p uintptr, zRawSql uintptr) uintptr {
// Allocate VdbeCursor number iCur. Return a pointer to it. Return NULL
// if we run out of memory.
-func allocateCursor(tls *libc.TLS, p uintptr, iCur int32, nField int32, iDb int32, eCurType U8) uintptr { /* sqlite3.c:86651:19: */
+func allocateCursor(tls *libc.TLS, p uintptr, iCur int32, nField int32, iDb int32, eCurType U8) uintptr { /* sqlite3.c:86938:19: */
// Find the memory cell that will be used to store the blob of memory
// required for this VdbeCursor structure. It is convenient to use a
// vdbe memory cell to manage the memory allocation required for a
@@ -62902,18 +63624,18 @@ func allocateCursor(tls *libc.TLS, p uintptr, iCur int32, nField int32, iDb int3
// Cursor 2 is at Mem[p->nMem-2]. And so forth.
var pMem uintptr
if iCur > 0 {
- pMem = ((*Vdbe)(unsafe.Pointer(p)).FaMem + uintptr(((*Vdbe)(unsafe.Pointer(p)).FnMem-iCur))*40)
+ pMem = (*Vdbe)(unsafe.Pointer(p)).FaMem + uintptr((*Vdbe)(unsafe.Pointer(p)).FnMem-iCur)*40
} else {
pMem = (*Vdbe)(unsafe.Pointer(p)).FaMem
}
var nByte int32
var pCx uintptr = uintptr(0)
- nByte = (int32(((((uint32(unsafe.Sizeof(VdbeCursor{}))) + uint32(7)) & libc.Uint32FromInt32(libc.CplInt32(7))) + ((uint32(2) * uint32(unsafe.Sizeof(U32(0)))) * uint32(nField))) + (func() uint32 {
+ nByte = int32((uint32(unsafe.Sizeof(VdbeCursor{}))+uint32(7))&libc.Uint32FromInt32(libc.CplInt32(7)) + uint32(2)*uint32(unsafe.Sizeof(U32(0)))*uint32(nField) + func() uint32 {
if int32(eCurType) == CURTYPE_BTREE {
return uint32(Xsqlite3BtreeCursorSize(tls))
}
return uint32(0)
- }())))
+ }())
if *(*uintptr)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FapCsr + uintptr(iCur)*4)) != 0 { //OPTIMIZATION-IF-FALSE
Xsqlite3VdbeFreeCursor(tls, p, *(*uintptr)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FapCsr + uintptr(iCur)*4)))
@@ -62929,7 +63651,7 @@ func allocateCursor(tls *libc.TLS, p uintptr, iCur int32, nField int32, iDb int3
if (*Mem)(unsafe.Pointer(pMem)).FszMalloc > 0 {
Xsqlite3DbFreeNN(tls, (*Mem)(unsafe.Pointer(pMem)).Fdb, (*Mem)(unsafe.Pointer(pMem)).FzMalloc)
}
- (*Mem)(unsafe.Pointer(pMem)).Fz = libc.AssignPtrUintptr(pMem+20 /* &.zMalloc */, Xsqlite3DbMallocRaw(tls, (*Mem)(unsafe.Pointer(pMem)).Fdb, uint64(nByte)))
+ (*Mem)(unsafe.Pointer(pMem)).Fz = libc.AssignPtrUintptr(pMem+20, Xsqlite3DbMallocRaw(tls, (*Mem)(unsafe.Pointer(pMem)).Fdb, uint64(nByte)))
if (*Mem)(unsafe.Pointer(pMem)).FzMalloc == uintptr(0) {
(*Mem)(unsafe.Pointer(pMem)).FszMalloc = 0
return uintptr(0)
@@ -62938,14 +63660,14 @@ func allocateCursor(tls *libc.TLS, p uintptr, iCur int32, nField int32, iDb int3
}
*(*uintptr)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FapCsr + uintptr(iCur)*4)) = libc.AssignUintptr(&pCx, (*Mem)(unsafe.Pointer(pMem)).FzMalloc)
- libc.Xmemset(tls, pCx, 0, uint32((uintptr(0) + 36 /* &.pAltCursor */)))
+ libc.Xmemset(tls, pCx, 0, uint32(uintptr(0)+36))
(*VdbeCursor)(unsafe.Pointer(pCx)).FeCurType = eCurType
(*VdbeCursor)(unsafe.Pointer(pCx)).FiDb = I8(iDb)
(*VdbeCursor)(unsafe.Pointer(pCx)).FnField = I16(nField)
- (*VdbeCursor)(unsafe.Pointer(pCx)).FaOffset = ((pCx + 88 /* &.aType */) + uintptr(nField)*4)
+ (*VdbeCursor)(unsafe.Pointer(pCx)).FaOffset = pCx + 88 + uintptr(nField)*4
if int32(eCurType) == CURTYPE_BTREE {
- *(*uintptr)(unsafe.Pointer(pCx + 40 /* &.uc */)) = ((*Mem)(unsafe.Pointer(pMem)).Fz + uintptr(((((uint32(unsafe.Sizeof(VdbeCursor{}))) + uint32(7)) & libc.Uint32FromInt32(libc.CplInt32(7))) + ((uint32(2) * uint32(unsafe.Sizeof(U32(0)))) * uint32(nField)))))
- Xsqlite3BtreeCursorZero(tls, *(*uintptr)(unsafe.Pointer(pCx + 40 /* &.uc */)))
+ *(*uintptr)(unsafe.Pointer(pCx + 40)) = (*Mem)(unsafe.Pointer(pMem)).Fz + uintptr((uint32(unsafe.Sizeof(VdbeCursor{}))+uint32(7))&libc.Uint32FromInt32(libc.CplInt32(7))+uint32(2)*uint32(unsafe.Sizeof(U32(0)))*uint32(nField))
+ Xsqlite3BtreeCursorZero(tls, *(*uintptr)(unsafe.Pointer(pCx + 40)))
}
return pCx
}
@@ -62954,13 +63676,13 @@ func allocateCursor(tls *libc.TLS, p uintptr, iCur int32, nField int32, iDb int3
// floating point value of rValue. Return true and set *piValue to the
// integer value if the string is in range to be an integer. Otherwise,
// return false.
-func alsoAnInt(tls *libc.TLS, pRec uintptr, rValue float64, piValue uintptr) int32 { /* sqlite3.c:86729:12: */
+func alsoAnInt(tls *libc.TLS, pRec uintptr, rValue float64, piValue uintptr) int32 { /* sqlite3.c:87016:12: */
var iValue I64 = I64(rValue)
if Xsqlite3RealSameAsInt(tls, rValue, iValue) != 0 {
*(*I64)(unsafe.Pointer(piValue)) = iValue
return 1
}
- return (libc.Bool32(0 == Xsqlite3Atoi64(tls, (*Mem)(unsafe.Pointer(pRec)).Fz, piValue, (*Mem)(unsafe.Pointer(pRec)).Fn, (*Mem)(unsafe.Pointer(pRec)).Fenc)))
+ return libc.Bool32(0 == Xsqlite3Atoi64(tls, (*Mem)(unsafe.Pointer(pRec)).Fz, piValue, (*Mem)(unsafe.Pointer(pRec)).Fn, (*Mem)(unsafe.Pointer(pRec)).Fenc))
}
// Try to convert a value into a numeric representation if we can
@@ -62976,7 +63698,7 @@ func alsoAnInt(tls *libc.TLS, pRec uintptr, rValue float64, piValue uintptr) int
// If bTryForInt is false, then if the input string contains a decimal
// point or exponential notation, the result is only MEM_Real, even
// if there is an exact integer representation of the quantity.
-func applyNumericAffinity(tls *libc.TLS, pRec uintptr, bTryForInt int32) { /* sqlite3.c:86753:13: */
+func applyNumericAffinity(tls *libc.TLS, pRec uintptr, bTryForInt int32) { /* sqlite3.c:87040:13: */
bp := tls.Alloc(8)
defer tls.Free(8)
@@ -62989,11 +63711,11 @@ func applyNumericAffinity(tls *libc.TLS, pRec uintptr, bTryForInt int32) { /* sq
if rc <= 0 {
return
}
- if (rc == 1) && (alsoAnInt(tls, pRec, *(*float64)(unsafe.Pointer(bp /* rValue */)), (pRec /* &.u */ /* &.i */)) != 0) {
- *(*U16)(unsafe.Pointer(pRec + 8 /* &.flags */)) |= U16((MEM_Int))
+ if rc == 1 && alsoAnInt(tls, pRec, *(*float64)(unsafe.Pointer(bp)), pRec) != 0 {
+ *(*U16)(unsafe.Pointer(pRec + 8)) |= U16(MEM_Int)
} else {
- *(*float64)(unsafe.Pointer(pRec /* &.u */)) = *(*float64)(unsafe.Pointer(bp /* rValue */))
- *(*U16)(unsafe.Pointer(pRec + 8 /* &.flags */)) |= U16((MEM_Real))
+ *(*float64)(unsafe.Pointer(pRec)) = *(*float64)(unsafe.Pointer(bp /* rValue */))
+ *(*U16)(unsafe.Pointer(pRec + 8)) |= U16(MEM_Real)
if bTryForInt != 0 {
Xsqlite3VdbeIntegerAffinity(tls, pRec)
}
@@ -63002,7 +63724,7 @@ func applyNumericAffinity(tls *libc.TLS, pRec uintptr, bTryForInt int32) { /* sq
// string representation after computing a numeric equivalent, because the
// string representation might not be the canonical representation for the
// numeric value. Ticket [343634942dd54ab57b7024] 2018-01-31.
- *(*U16)(unsafe.Pointer(pRec + 8 /* &.flags */)) &= libc.Uint16FromInt32((libc.CplInt32(MEM_Str)))
+ *(*U16)(unsafe.Pointer(pRec + 8)) &= libc.Uint16FromInt32(libc.CplInt32(MEM_Str))
}
// Processing is determine by the affinity parameter:
@@ -63022,12 +63744,12 @@ func applyNumericAffinity(tls *libc.TLS, pRec uintptr, bTryForInt int32) { /* sq
// SQLITE_AFF_BLOB:
// SQLITE_AFF_NONE:
// No-op. pRec is unchanged.
-func applyAffinity(tls *libc.TLS, pRec uintptr, affinity uint8, enc U8) { /* sqlite3.c:86793:13: */
+func applyAffinity(tls *libc.TLS, pRec uintptr, affinity uint8, enc U8) { /* sqlite3.c:87080:13: */
if int32(affinity) >= SQLITE_AFF_NUMERIC {
- if (int32((*Mem)(unsafe.Pointer(pRec)).Fflags) & MEM_Int) == 0 { //OPTIMIZATION-IF-FALSE
- if (int32((*Mem)(unsafe.Pointer(pRec)).Fflags) & MEM_Real) == 0 {
- if (int32((*Mem)(unsafe.Pointer(pRec)).Fflags) & MEM_Str) != 0 {
+ if int32((*Mem)(unsafe.Pointer(pRec)).Fflags)&MEM_Int == 0 { //OPTIMIZATION-IF-FALSE
+ if int32((*Mem)(unsafe.Pointer(pRec)).Fflags)&MEM_Real == 0 {
+ if int32((*Mem)(unsafe.Pointer(pRec)).Fflags)&MEM_Str != 0 {
applyNumericAffinity(tls, pRec, 1)
}
} else {
@@ -63040,13 +63762,13 @@ func applyAffinity(tls *libc.TLS, pRec uintptr, affinity uint8, enc U8) { /* sql
// representation. It would be harmless to repeat the conversion if
// there is already a string rep, but it is pointless to waste those
// CPU cycles.
- if 0 == (int32((*Mem)(unsafe.Pointer(pRec)).Fflags) & MEM_Str) { //OPTIMIZATION-IF-FALSE
- if (int32((*Mem)(unsafe.Pointer(pRec)).Fflags) & ((MEM_Real | MEM_Int) | MEM_IntReal)) != 0 {
+ if 0 == int32((*Mem)(unsafe.Pointer(pRec)).Fflags)&MEM_Str { //OPTIMIZATION-IF-FALSE
+ if int32((*Mem)(unsafe.Pointer(pRec)).Fflags)&(MEM_Real|MEM_Int|MEM_IntReal) != 0 {
Xsqlite3VdbeMemStringify(tls, pRec, enc, uint8(1))
}
}
- *(*U16)(unsafe.Pointer(pRec + 8 /* &.flags */)) &= libc.Uint16FromInt32((libc.CplInt32(((MEM_Real | MEM_Int) | MEM_IntReal))))
+ *(*U16)(unsafe.Pointer(pRec + 8)) &= libc.Uint16FromInt32(libc.CplInt32(MEM_Real | MEM_Int | MEM_IntReal))
}
}
@@ -63054,7 +63776,7 @@ func applyAffinity(tls *libc.TLS, pRec uintptr, affinity uint8, enc U8) { /* sql
// into a numeric representation. Use either INTEGER or REAL whichever
// is appropriate. But only do the conversion if it is possible without
// loss of information and return the revised type of the argument.
-func Xsqlite3_value_numeric_type(tls *libc.TLS, pVal uintptr) int32 { /* sqlite3.c:86832:16: */
+func Xsqlite3_value_numeric_type(tls *libc.TLS, pVal uintptr) int32 { /* sqlite3.c:87119:16: */
var eType int32 = Xsqlite3_value_type(tls, pVal)
if eType == SQLITE_TEXT {
var pMem uintptr = pVal
@@ -63066,7 +63788,7 @@ func Xsqlite3_value_numeric_type(tls *libc.TLS, pVal uintptr) int32 { /* sqlite3
// Exported version of applyAffinity(). This one works on sqlite3_value*,
// not the internal Mem* type.
-func Xsqlite3ValueApplyAffinity(tls *libc.TLS, pVal uintptr, affinity U8, enc U8) { /* sqlite3.c:86846:21: */
+func Xsqlite3ValueApplyAffinity(tls *libc.TLS, pVal uintptr, affinity U8, enc U8) { /* sqlite3.c:87133:21: */
applyAffinity(tls, pVal, uint8(affinity), enc)
}
@@ -63074,7 +63796,7 @@ func Xsqlite3ValueApplyAffinity(tls *libc.TLS, pVal uintptr, affinity U8, enc U8
// interpret as a string if we want to). Compute its corresponding
// numeric type, if has one. Set the pMem->u.r and pMem->u.i fields
// accordingly.
-func computeNumericType(tls *libc.TLS, pMem uintptr) U16 { /* sqlite3.c:86860:28: */
+func computeNumericType(tls *libc.TLS, pMem uintptr) U16 { /* sqlite3.c:87147:28: */
bp := tls.Alloc(8)
defer tls.Free(8)
@@ -63082,24 +63804,24 @@ func computeNumericType(tls *libc.TLS, pMem uintptr) U16 { /* sqlite3.c:86860:28
// var ix Sqlite3_int64 at bp, 8
if func() int32 {
- if (int32((*Mem)(unsafe.Pointer((pMem))).Fflags) & MEM_Zero) != 0 {
+ if int32((*Mem)(unsafe.Pointer(pMem)).Fflags)&MEM_Zero != 0 {
return Xsqlite3VdbeMemExpandBlob(tls, pMem)
}
return 0
}() != 0 {
- *(*I64)(unsafe.Pointer(pMem /* &.u */)) = int64(0)
+ *(*I64)(unsafe.Pointer(pMem)) = int64(0)
return U16(MEM_Int)
}
- rc = Xsqlite3AtoF(tls, (*Mem)(unsafe.Pointer(pMem)).Fz, (pMem /* &.u */ /* &.r */), (*Mem)(unsafe.Pointer(pMem)).Fn, (*Mem)(unsafe.Pointer(pMem)).Fenc)
+ rc = Xsqlite3AtoF(tls, (*Mem)(unsafe.Pointer(pMem)).Fz, pMem, (*Mem)(unsafe.Pointer(pMem)).Fn, (*Mem)(unsafe.Pointer(pMem)).Fenc)
if rc <= 0 {
- if (rc == 0) && (Xsqlite3Atoi64(tls, (*Mem)(unsafe.Pointer(pMem)).Fz, bp /* &ix */, (*Mem)(unsafe.Pointer(pMem)).Fn, (*Mem)(unsafe.Pointer(pMem)).Fenc) <= 1) {
- *(*I64)(unsafe.Pointer(pMem /* &.u */)) = *(*Sqlite3_int64)(unsafe.Pointer(bp /* ix */))
+ if rc == 0 && Xsqlite3Atoi64(tls, (*Mem)(unsafe.Pointer(pMem)).Fz, bp, (*Mem)(unsafe.Pointer(pMem)).Fn, (*Mem)(unsafe.Pointer(pMem)).Fenc) <= 1 {
+ *(*I64)(unsafe.Pointer(pMem)) = *(*Sqlite3_int64)(unsafe.Pointer(bp /* ix */))
return U16(MEM_Int)
} else {
return U16(MEM_Real)
}
- } else if (rc == 1) && (Xsqlite3Atoi64(tls, (*Mem)(unsafe.Pointer(pMem)).Fz, bp /* &ix */, (*Mem)(unsafe.Pointer(pMem)).Fn, (*Mem)(unsafe.Pointer(pMem)).Fenc) == 0) {
- *(*I64)(unsafe.Pointer(pMem /* &.u */)) = *(*Sqlite3_int64)(unsafe.Pointer(bp /* ix */))
+ } else if rc == 1 && Xsqlite3Atoi64(tls, (*Mem)(unsafe.Pointer(pMem)).Fz, bp, (*Mem)(unsafe.Pointer(pMem)).Fn, (*Mem)(unsafe.Pointer(pMem)).Fenc) == 0 {
+ *(*I64)(unsafe.Pointer(pMem)) = *(*Sqlite3_int64)(unsafe.Pointer(bp /* ix */))
return U16(MEM_Int)
}
return U16(MEM_Real)
@@ -63110,12 +63832,12 @@ func computeNumericType(tls *libc.TLS, pMem uintptr) U16 { /* sqlite3.c:86860:28
//
// Unlike applyNumericAffinity(), this routine does not modify pMem->flags.
// But it does set pMem->u.r and pMem->u.i appropriately.
-func numericType(tls *libc.TLS, pMem uintptr) U16 { /* sqlite3.c:86891:12: */
- if (int32((*Mem)(unsafe.Pointer(pMem)).Fflags) & ((MEM_Int | MEM_Real) | MEM_IntReal)) != 0 {
+func numericType(tls *libc.TLS, pMem uintptr) U16 { /* sqlite3.c:87178:12: */
+ if int32((*Mem)(unsafe.Pointer(pMem)).Fflags)&(MEM_Int|MEM_Real|MEM_IntReal) != 0 {
- return (U16(int32((*Mem)(unsafe.Pointer(pMem)).Fflags) & ((MEM_Int | MEM_Real) | MEM_IntReal)))
+ return U16(int32((*Mem)(unsafe.Pointer(pMem)).Fflags) & (MEM_Int | MEM_Real | MEM_IntReal))
}
- if (int32((*Mem)(unsafe.Pointer(pMem)).Fflags) & (MEM_Str | MEM_Blob)) != 0 {
+ if int32((*Mem)(unsafe.Pointer(pMem)).Fflags)&(MEM_Str|MEM_Blob) != 0 {
return computeNumericType(tls, pMem)
}
@@ -63124,18 +63846,18 @@ func numericType(tls *libc.TLS, pMem uintptr) U16 { /* sqlite3.c:86891:12: */
// Return the register of pOp->p2 after first preparing it to be
// overwritten with an integer value.
-func out2PrereleaseWithClear(tls *libc.TLS, pOut uintptr) uintptr { /* sqlite3.c:87155:28: */
+func out2PrereleaseWithClear(tls *libc.TLS, pOut uintptr) uintptr { /* sqlite3.c:87353:28: */
Xsqlite3VdbeMemSetNull(tls, pOut)
(*Mem)(unsafe.Pointer(pOut)).Fflags = U16(MEM_Int)
return pOut
}
-func out2Prerelease(tls *libc.TLS, p uintptr, pOp uintptr) uintptr { /* sqlite3.c:87160:12: */
+func out2Prerelease(tls *libc.TLS, p uintptr, pOp uintptr) uintptr { /* sqlite3.c:87358:12: */
var pOut uintptr
- pOut = ((*Vdbe)(unsafe.Pointer(p)).FaMem + uintptr((*VdbeOp)(unsafe.Pointer(pOp)).Fp2)*40)
+ pOut = (*Vdbe)(unsafe.Pointer(p)).FaMem + uintptr((*VdbeOp)(unsafe.Pointer(pOp)).Fp2)*40
- if (int32((*Mem)(unsafe.Pointer((pOut))).Fflags) & (MEM_Agg | MEM_Dyn)) != 0 { //OPTIMIZATION-IF-FALSE
+ if int32((*Mem)(unsafe.Pointer(pOut)).Fflags)&(MEM_Agg|MEM_Dyn) != 0 { //OPTIMIZATION-IF-FALSE
return out2PrereleaseWithClear(tls, pOut)
} else {
(*Mem)(unsafe.Pointer(pOut)).Fflags = U16(MEM_Int)
@@ -63144,11 +63866,24 @@ func out2Prerelease(tls *libc.TLS, p uintptr, pOp uintptr) uintptr { /* sqlite3.
return uintptr(0)
}
+// Return the symbolic name for the data type of a pMem
+func vdbeMemTypeName(tls *libc.TLS, pMem uintptr) uintptr { /* sqlite3.c:87375:19: */
+ return azTypes[Xsqlite3_value_type(tls, pMem)-1]
+}
+
+var azTypes = [5]uintptr{
+ /* SQLITE_INTEGER */ ts + 1086, /* "INT" */
+ /* SQLITE_FLOAT */ ts + 1098, /* "REAL" */
+ /* SQLITE_TEXT */ ts + 1103, /* "TEXT" */
+ /* SQLITE_BLOB */ ts + 1081, /* "BLOB" */
+ /* SQLITE_NULL */ ts + 1544, /* "NULL" */
+} /* sqlite3.c:87376:21 */
+
// Execute as much of a VDBE program as we can.
// This is the core of sqlite3_step().
-func Xsqlite3VdbeExec(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:87179:20: */
- bp := tls.Alloc(760)
- defer tls.Free(760)
+func Xsqlite3VdbeExec(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:87390:20: */
+ bp := tls.Alloc(800)
+ defer tls.Free(800)
var aOp uintptr // Copy of p->aOp
var pOp uintptr // Current operation
@@ -63185,13 +63920,13 @@ func Xsqlite3VdbeExec(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:87179:20: *
var type1 U16 // Numeric type of left operand
var type2 U16 // Numeric type of right operand
var iA I64 // Integer value of left operand
- // var iB I64 at bp+176, 8
+ // var iB I64 at bp+208, 8
// Integer value of right operand
var rA float64 // Real value of left operand
var rB float64 // same as TK_RSHIFT, in1, in2, out3
- // var iA1 I64 at bp+192, 8
+ // var iA1 I64 at bp+224, 8
- // var uA U64 at bp+184, 8
+ // var uA U64 at bp+216, 8
var iB1 I64
var op U8 // same as TK_GE, jump, in1, in3
@@ -63213,29 +63948,33 @@ func Xsqlite3VdbeExec(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:87179:20: *
var v2 int32 // jump
var iAddr U32 // jump, in1
var c int32 // jump, in1
- var c1 int32 // out3
+ var c1 int32 // jump, in1
+ var doTheJump int32 // out3
var pC uintptr
- // var p22 U32 at bp+204, 4
+ // var p22 U32 at bp+236, 4
// column number to retrieve
- // var pC1 uintptr at bp+200, 4
+ // var pC1 uintptr at bp+232, 4
// The VDBE cursor
var pCrsr uintptr // The BTree cursor
var aOffset uintptr // aOffset[i] is offset to start of data for i-th column
var len int32 // The length of the serialized data for the column
var i2 int32 // Loop counter
var pDest uintptr // Where to write the extracted value
- // var sMem Mem at bp+208, 40
+ // var sMem Mem at bp+240, 40
// For storing the record being decoded
var zData uintptr // Part of the record being decoded
var zHdr uintptr // Next unparsed byte of the header
var zEndHdr uintptr // Pointer to first byte after the header
var offset64 U64 // 64-bit offset
- // var t U32 at bp+248, 4
+ // var t U32 at bp+280, 4
// A type code from the record header
var pReg uintptr
+ var pTab uintptr
+ var aCol uintptr
+ var i3 int32
var zAffinity uintptr
// Figure out whether to use 1, 2, 4, 6 or 8 bytes.
- var i3 I64
+ var i4 I64
var uu U64
var pRec uintptr // The new record
var nData U64 // Number of bytes of data space
@@ -63252,7 +63991,7 @@ func Xsqlite3VdbeExec(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:87179:20: *
var len1 U32 // Length of a field
var zHdr1 uintptr // Where to write next byte of the header
var zPayload uintptr // out2
- // var nEntry I64 at bp+256, 8
+ // var nEntry I64 at bp+288, 8
var pCrsr1 uintptr
var isSchemaChange int32
@@ -63272,9 +64011,9 @@ func Xsqlite3VdbeExec(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:87179:20: *
var desiredAutoCommit int32
var iRollback int32
var pBt uintptr
- // var iMeta int32 at bp+264, 4
+ // var iMeta int32 at bp+296, 4
// out2
- // var iMeta1 int32 at bp+268, 4
+ // var iMeta1 int32 at bp+300, 4
var iDb int32
var iCookie int32
@@ -63294,22 +64033,23 @@ func Xsqlite3VdbeExec(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:87179:20: *
var pCx2 uintptr
var pC2 uintptr
var pCx3 uintptr
+ var c2 int32
var flags31 U16
var newType U16 // jump, in3, group
- // var res1 int32 at bp+272, 4
+ // var res1 int32 at bp+304, 4
// Comparison result
var oc int32 // Opcode
var pC3 uintptr // The cursor to seek
- // var r UnpackedRecord at bp+276, 16
+ // var r UnpackedRecord at bp+308, 16
// The key to seek for
var nField2 int32 // Number of columns or fields in the key
var iKey I64 // The rowid we are to seek to
var eqOnly int32
var pC4 uintptr
- // var res3 int32 at bp+308, 4
+ // var res3 int32 at bp+340, 4
var nStep int32
- // var r1 UnpackedRecord at bp+292, 16
+ // var r1 UnpackedRecord at bp+324, 16
var pC5 uintptr // jump, in3
var pC6 uintptr // jump, in3
@@ -63317,28 +64057,28 @@ func Xsqlite3VdbeExec(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:87179:20: *
var takeJump int32
var ii1 int32
var pC7 uintptr
- // var res4 int32 at bp+328, 4
+ // var res4 int32 at bp+360, 4
var pFree uintptr
var pIdxKey uintptr
- // var r2 UnpackedRecord at bp+312, 16
+ // var r2 UnpackedRecord at bp+344, 16
// If pIn3->u.i does not contain an integer, compute iKey as the
// integer value of pIn3. Jump to P2 if pIn3 cannot be converted
// into an integer without loss of information. Take care to avoid
// changing the datatype of pIn3, however, as it is used by other
// parts of the prepared statement.
- // var x Mem at bp+336, 40
+ // var x Mem at bp+368, 40
// jump, in3
var pC8 uintptr
var pCrsr2 uintptr
- // var res5 int32 at bp+376, 4
+ // var res5 int32 at bp+408, 4
var iKey1 U64 // out2
- // var v I64 at bp+384, 8
+ // var v I64 at bp+416, 8
// The new rowid
var pC9 uintptr // Cursor of table to get the new rowid
- // var res6 int32 at bp+380, 4
+ // var res6 int32 at bp+412, 4
// Result of an sqlite3BtreeLast()
var cnt1 int32 // Counter to limit the number of searches
var pMem1 uintptr // Register holding largest rowid for AUTOINCREMENT
@@ -63348,18 +64088,18 @@ func Xsqlite3VdbeExec(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:87179:20: *
var pC10 uintptr // Cursor to table into which insert is written
var seekResult int32 // Result of prior seek or 0 if no USESEEKRESULT flag
var zDb uintptr // database name - used by the update hook
- var pTab uintptr // Table structure - used by update and pre-update hooks
- // var x1 BtreePayload at bp+392, 40
+ var pTab1 uintptr // Table structure - used by update and pre-update hooks
+ // var x1 BtreePayload at bp+424, 40
var pDest1 uintptr // Cursor to write to
var pSrc uintptr // Cursor to read from
var iKey2 I64
var pC11 uintptr
var zDb1 uintptr
- var pTab1 uintptr
+ var pTab2 uintptr
var opflags int32
var pC12 uintptr
- // var res7 int32 at bp+432, 4
+ // var res7 int32 at bp+464, 4
var nKeyCol int32
var pC13 uintptr
@@ -63367,69 +64107,69 @@ func Xsqlite3VdbeExec(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:87179:20: *
var pCrsr3 uintptr
var n3 U32 // out2
var pC15 uintptr
- // var v3 I64 at bp+440, 8
+ // var v3 I64 at bp+472, 8
var pVtab uintptr
var pModule uintptr
var pC16 uintptr // jump
var pC17 uintptr
var pCrsr4 uintptr
- // var res8 int32 at bp+448, 4
+ // var res8 int32 at bp+480, 4
// jump
var pC18 uintptr
var pCrsr5 uintptr
- // var res9 int32 at bp+452, 4
+ // var res9 int32 at bp+484, 4
var sz I64 // jump
var pC19 uintptr
var pCrsr6 uintptr
- // var res10 int32 at bp+456, 4
+ // var res10 int32 at bp+488, 4
// jump
var pC20 uintptr // in2
var pC21 uintptr
- // var x2 BtreePayload at bp+464, 40
+ // var x2 BtreePayload at bp+496, 40
// in2
var pC22 uintptr
var pC23 uintptr
var pCrsr7 uintptr
- // var res11 int32 at bp+520, 4
+ // var res11 int32 at bp+552, 4
- // var r3 UnpackedRecord at bp+504, 16
+ // var r3 UnpackedRecord at bp+536, 16
// out2
var pC24 uintptr // The P1 index cursor
var pTabCur uintptr // The P2 table cursor (OP_DeferredSeek only)
- // var rowid I64 at bp+528, 8
+ // var rowid I64 at bp+560, 8
var pC25 uintptr
var nCellKey I64
var pCur1 uintptr
- // var m Mem at bp+536, 40
+ // var m Mem at bp+568, 40
// jump
var pC26 uintptr
var res12 int32
- // var r4 UnpackedRecord at bp+576, 16
+ // var r4 UnpackedRecord at bp+608, 16
// out2
- // var iMoved int32 at bp+592, 4
+ // var iMoved int32 at bp+624, 4
var iDb2 int32
- // var nChange int32 at bp+596, 4
+ // var nChange I64 at bp+632, 8
var pC27 uintptr // out2
- // var pgno Pgno at bp+600, 4
+ // var pgno Pgno at bp+640, 4
var pDb2 uintptr
var iDb3 int32
var zSchema uintptr
var zSql uintptr
- // var initData InitData at bp+604, 28
+ // var initData InitData at bp+644, 28
var nRoot int32 // Number of tables to check. (Number of root pages.)
var aRoot uintptr // Array of rootpage numbers for tables to be checked
- // var nErr int32 at bp+632, 4
+ // var nErr int32 at bp+672, 4
// Number of errors reported
var z uintptr // Text of the error report
var pnErr uintptr // jump, in1, out3
- // var val I64 at bp+640, 8
+ // var val I64 at bp+680, 8
// jump, in1, in3
var iSet int32
var exists int32 // jump
@@ -63444,16 +64184,16 @@ func Xsqlite3VdbeExec(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:87179:20: *
var pFrame3 uintptr
var pIn uintptr // in2
var pFrame4 uintptr // in1, out2, in3
- // var x3 I64 at bp+648, 8
+ // var x3 I64 at bp+688, 8
var n4 int32
var pCtx uintptr
- var i4 int32
+ var i5 int32
var pCtx1 uintptr
var pMem3 uintptr
var pMem4 uintptr
- var i5 int32 // Loop counter
- // var aRes [3]int32 at bp+656, 12
+ var i6 int32 // Loop counter
+ // var aRes [3]int32 at bp+696, 12
// Results
var pMem5 uintptr // out2
var pBt1 uintptr // Btree to change journal mode of
@@ -63468,11 +64208,11 @@ func Xsqlite3VdbeExec(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:87179:20: *
var p13 int32
var isWriteLock U8
var pVTab uintptr
- // var sMem1 Mem at bp+672, 40
+ // var sMem1 Mem at bp+712, 40
// For storing the record being decoded
var zTab uintptr
var pCur2 uintptr
- // var pVCur uintptr at bp+712, 4
+ // var pVCur uintptr at bp+752, 4
var pVtab1 uintptr
var pModule1 uintptr // jump
@@ -63485,12 +64225,12 @@ func Xsqlite3VdbeExec(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:87179:20: *
var pVtab2 uintptr
var pCur3 uintptr
var res13 int32
- var i6 int32
+ var i7 int32
var apArg uintptr
var pVtab3 uintptr
var pModule3 uintptr
var pDest2 uintptr
- // var sContext Sqlite3_context at bp+716, 32
+ // var sContext Sqlite3_context at bp+756, 32
var pCur4 uintptr // jump
var pVtab4 uintptr
@@ -63504,18 +64244,18 @@ func Xsqlite3VdbeExec(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:87179:20: *
var pVtab6 uintptr
var pModule5 uintptr
var nArg1 int32
- var i7 int32
- // var rowid1 Sqlite_int64 at bp+752, 8
+ var i8 int32
+ // var rowid1 Sqlite_int64 at bp+792, 8
var apArg1 uintptr
var pX1 uintptr // out2
var newMax uint32
var pBt3 uintptr // group
- var i8 int32
+ var i9 int32
var pCtx2 uintptr
var z2 uintptr
var z3 uintptr // jump
- var i9 int32
+ var i10 int32
var zTrace uintptr
aOp = (*Vdbe)(unsafe.Pointer(p)).FaOp
pOp = aOp
@@ -63537,12 +64277,12 @@ func Xsqlite3VdbeExec(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:87179:20: *
if !((*Sqlite3)(unsafe.Pointer(db)).FxProgress != 0) {
goto __1
}
- iPrior = *(*U32)(unsafe.Pointer((p + 164 /* &.aCounter */) + 4*4))
+ iPrior = *(*U32)(unsafe.Pointer(p + 172 + 4*4))
- nProgressLimit = (U64((*Sqlite3)(unsafe.Pointer(db)).FnProgressOps - (iPrior % (*Sqlite3)(unsafe.Pointer(db)).FnProgressOps)))
+ nProgressLimit = U64((*Sqlite3)(unsafe.Pointer(db)).FnProgressOps - iPrior%(*Sqlite3)(unsafe.Pointer(db)).FnProgressOps)
goto __2
__1:
- nProgressLimit = (uint64(0xffffffff) | (U64((uint64(0xffffffff))) << 32))
+ nProgressLimit = uint64(0xffffffff) | U64(uint64(0xffffffff))<<32
__2:
;
if !((*Vdbe)(unsafe.Pointer(p)).Frc == SQLITE_NOMEM) {
@@ -63560,14 +64300,14 @@ __3:
(*Vdbe)(unsafe.Pointer(p)).FpResultSet = uintptr(0)
(*Sqlite3)(unsafe.Pointer(db)).FbusyHandler.FnBusy = 0
- if !(libc.AtomicLoadNInt32((db+288 /* &.u1 */ /* &.isInterrupted */), 0) != 0) {
+ if !(libc.AtomicLoadNInt32(db+312, 0) != 0) {
goto __4
}
goto abort_due_to_interrupt
__4:
;
- pOp = (aOp + uintptr((*Vdbe)(unsafe.Pointer(p)).Fpc)*20)
+ pOp = aOp + uintptr((*Vdbe)(unsafe.Pointer(p)).Fpc)*20
__5:
if !(1 != 0) {
goto __7
@@ -64309,6 +65049,15 @@ __5:
case OP_IsNull:
goto __65
+ // Opcode: IsNullOrType P1 P2 P3 * *
+ // Synopsis: if typeof(r[P1]) IN (P3,5) goto P2
+ //
+ // Jump to P2 if the value in register P1 is NULL or has a datatype P3.
+ // P3 is an integer which should be one of SQLITE_INTEGER, SQLITE_FLOAT,
+ // SQLITE_BLOB, SQLITE_NULL, or SQLITE_TEXT.
+ case OP_IsNullOrType:
+ goto __66
+
// Opcode: ZeroOrNull P1 P2 P3 * *
// Synopsis: r[P2] = 0 OR NULL
//
@@ -64316,14 +65065,14 @@ __5:
// register P2. If either registers P1 or P3 are NULL then put
// a NULL in register P2.
case OP_ZeroOrNull:
- goto __66
+ goto __67
// Opcode: NotNull P1 P2 * * *
// Synopsis: if r[P1]!=NULL goto P2
//
// Jump to P2 if the value in register P1 is not NULL.
case OP_NotNull:
- goto __67
+ goto __68
// Opcode: IfNullRow P1 P2 P3 * *
// Synopsis: if P1.nullRow then r[P3]=NULL, goto P2
@@ -64333,7 +65082,7 @@ __5:
// If P1 is not on a NULL row, then fall through without making any
// changes.
case OP_IfNullRow:
- goto __68
+ goto __69
// Opcode: Offset P1 P2 P3 * *
// Synopsis: r[P3] = sqlite_offset(P1)
@@ -64350,7 +65099,7 @@ __5:
// This opcode is only available if SQLite is compiled with the
// -DSQLITE_ENABLE_OFFSET_SQL_FUNC option.
case OP_Offset:
- goto __69
+ goto __70
// Opcode: Column P1 P2 P3 P4 P5
// Synopsis: r[P3]=PX
@@ -64372,7 +65121,35 @@ __5:
// or typeof() function, respectively. The loading of large blobs can be
// skipped for length() and all content loading can be skipped for typeof().
case OP_Column:
- goto __70
+ goto __71
+
+ // Opcode: TypeCheck P1 P2 P3 P4 *
+ // Synopsis: typecheck(r[P1@P2])
+ //
+ // Apply affinities to the range of P2 registers beginning with P1.
+ // Take the affinities from the Table object in P4. If any value
+ // cannot be coerced into the correct type, then raise an error.
+ //
+ // This opcode is similar to OP_Affinity except that this opcode
+ // forces the register type to the Table column type. This is used
+ // to implement "strict affinity".
+ //
+ // GENERATED ALWAYS AS ... STATIC columns are only checked if P3
+ // is zero. When P3 is non-zero, no type checking occurs for
+ // static generated columns. Virtual columns are computed at query time
+ // and so they are never checked.
+ //
+ // Preconditions:
+ //
+ // <ul>
+ // <li> P2 should be the number of non-virtual columns in the
+ // table of P4.
+ // <li> Table P4 should be a STRICT table.
+ // </ul>
+ //
+ // If any precondition is false, an assertion fault occurs.
+ case OP_TypeCheck:
+ goto __72
// Opcode: Affinity P1 P2 * P4 *
// Synopsis: affinity(r[P1@P2])
@@ -64383,7 +65160,7 @@ __5:
// string indicates the column affinity that should be used for the N-th
// memory cell in the range.
case OP_Affinity:
- goto __71
+ goto __73
// Opcode: MakeRecord P1 P2 P3 P4 *
// Synopsis: r[P3]=mkrec(r[P1@P2])
@@ -64412,7 +65189,7 @@ __5:
// accept no-change records with serial_type 10. This value is
// only used inside an assert() and does not affect the end result.
case OP_MakeRecord:
- goto __72
+ goto __74
// Opcode: Count P1 P2 p3 * *
// Synopsis: r[P2]=count()
@@ -64424,7 +65201,7 @@ __5:
// every btree page of the table. But if P3 is non-zero, an estimate
// is returned based on the current cursor position.
case OP_Count:
- goto __73
+ goto __75
// Opcode: Savepoint P1 * * P4 *
//
@@ -64433,7 +65210,7 @@ __5:
// To release (commit) an existing savepoint set P1==1 (SAVEPOINT_RELEASE).
// To rollback an existing savepoint set P1==2 (SAVEPOINT_ROLLBACK).
case OP_Savepoint:
- goto __74
+ goto __76
// Opcode: AutoCommit P1 P2 * * *
//
@@ -64444,7 +65221,7 @@ __5:
//
// This instruction causes the VM to halt.
case OP_AutoCommit:
- goto __75
+ goto __77
// Opcode: Transaction P1 P2 P3 P4 P5
//
@@ -64481,7 +65258,7 @@ __5:
// halts. The sqlite3_step() wrapper function might then reprepare the
// statement and rerun it from the beginning.
case OP_Transaction:
- goto __76
+ goto __78
// Opcode: ReadCookie P1 P2 P3 * *
//
@@ -64495,7 +65272,7 @@ __5:
// must be started or there must be an open cursor) before
// executing this instruction.
case OP_ReadCookie:
- goto __77
+ goto __79
// Opcode: SetCookie P1 P2 P3 * P5
//
@@ -64512,7 +65289,7 @@ __5:
// has P5 set to 1, so that the internal schema version will be different
// from the database schema version, resulting in a schema reset.
case OP_SetCookie:
- goto __78
+ goto __80
// Opcode: OpenRead P1 P2 P3 P4 P5
// Synopsis: root=P2 iDb=P3
@@ -64596,13 +65373,13 @@ __5:
//
// See also: OP_OpenRead, OP_ReopenIdx
case OP_ReopenIdx:
- goto __79
+ goto __81
// If the cursor is not currently open or is open on a different
// index, then fall through into OP_OpenRead to force a reopen
case OP_OpenRead:
- goto __80
+ goto __82
case OP_OpenWrite:
- goto __81
+ goto __83
// Opcode: OpenDup P1 P2 * * *
//
@@ -64612,7 +65389,7 @@ __5:
//
// Duplicate ephemeral cursors are used for self-joins of materialized views.
case OP_OpenDup:
- goto __82
+ goto __84
// Opcode: OpenEphemeral P1 P2 P3 P4 P5
// Synopsis: nColumn=P2
@@ -64646,9 +65423,9 @@ __5:
// by this opcode will be used for automatically created transient
// indices in joins.
case OP_OpenAutoindex:
- goto __83
+ goto __85
case OP_OpenEphemeral:
- goto __84
+ goto __86
// Opcode: SorterOpen P1 P2 P3 P4 *
//
@@ -64660,7 +65437,7 @@ __5:
// assume that a stable sort considering the first P3 fields of each
// key is sufficient to produce the required results.
case OP_SorterOpen:
- goto __85
+ goto __87
// Opcode: SequenceTest P1 P2 * * *
// Synopsis: if( cursor[P1].ctr++ ) pc = P2
@@ -64669,7 +65446,7 @@ __5:
// to P2. Regardless of whether or not the jump is taken, increment the
// the sequence value.
case OP_SequenceTest:
- goto __86
+ goto __88
// Opcode: OpenPseudo P1 P2 P3 * *
// Synopsis: P3 columns in r[P2]
@@ -64687,14 +65464,14 @@ __5:
// P3 is the number of fields in the records that will be stored by
// the pseudo-table.
case OP_OpenPseudo:
- goto __87
+ goto __89
// Opcode: Close P1 * * * *
//
// Close a cursor previously opened as P1. If P1 is not
// currently open, this instruction is a no-op.
case OP_Close:
- goto __88
+ goto __90
// Opcode: SeekGE P1 P2 P3 P4 *
// Synopsis: key=r[P3@P4]
@@ -64783,13 +65560,13 @@ __5:
//
// See also: Found, NotFound, SeekGt, SeekGe, SeekLt
case OP_SeekLT:
- goto __89 // jump, in3, group
+ goto __91 // jump, in3, group
case OP_SeekLE:
- goto __90 // jump, in3, group
+ goto __92 // jump, in3, group
case OP_SeekGE:
- goto __91 // jump, in3, group
+ goto __93 // jump, in3, group
case OP_SeekGT:
- goto __92
+ goto __94
// Opcode: SeekScan P1 P2 * * *
// Synopsis: Scan-ahead up to P1 rows
@@ -64837,7 +65614,7 @@ __5:
// row does not exist in the btree) then jump to SeekOP.P2.
// </ol>
case OP_SeekScan:
- goto __93
+ goto __95
// Opcode: SeekHit P1 P2 P3 * *
// Synopsis: set P2<=seekHit<=P3
@@ -64853,14 +65630,14 @@ __5:
//
// P1 must be a valid b-tree cursor.
case OP_SeekHit:
- goto __94
+ goto __96
// Opcode: IfNotOpen P1 P2 * * *
// Synopsis: if( !csr[P1] ) goto P2
//
// If cursor P1 is not open, jump to instruction P2. Otherwise, fall through.
case OP_IfNotOpen:
- goto __95
+ goto __97
// Opcode: Found P1 P2 P3 P4 *
// Synopsis: key=r[P3@P4]
@@ -64949,13 +65726,13 @@ __5:
//
// See also: NotFound, Found, NotExists
case OP_IfNoHope:
- goto __96
+ goto __98
case OP_NoConflict:
- goto __97 // jump, in3
+ goto __99 // jump, in3
case OP_NotFound:
- goto __98 // jump, in3
+ goto __100 // jump, in3
case OP_Found:
- goto __99
+ goto __101
// Opcode: SeekRowid P1 P2 P3 * *
// Synopsis: intkey=r[P3]
@@ -65003,9 +65780,9 @@ __5:
//
// See also: Found, NotFound, NoConflict, SeekRowid
case OP_SeekRowid:
- goto __100
+ goto __102
case OP_NotExists:
- goto __101
+ goto __103
// Opcode: Sequence P1 P2 * * *
// Synopsis: r[P2]=cursor[P1].ctr++
@@ -65015,7 +65792,7 @@ __5:
// The sequence number on the cursor is incremented after this
// instruction.
case OP_Sequence:
- goto __102
+ goto __104
// Opcode: NewRowid P1 P2 P3 * *
// Synopsis: r[P2]=rowid
@@ -65032,7 +65809,7 @@ __5:
// generated record number. This P3 mechanism is used to help implement the
// AUTOINCREMENT feature.
case OP_NewRowid:
- goto __103
+ goto __105
// Opcode: Insert P1 P2 P3 P4 P5
// Synopsis: intkey=r[P3] data=r[P2]
@@ -65071,7 +65848,7 @@ __5:
// This instruction only works on tables. The equivalent instruction
// for indices is OP_IdxInsert.
case OP_Insert:
- goto __104
+ goto __106
// Opcode: RowCell P1 P2 P3 * *
//
@@ -65084,7 +65861,7 @@ __5:
// This opcode must be followed by either an Insert or InsertIdx opcode
// with the OPFLAG_PREFORMAT flag set to complete the insert operation.
case OP_RowCell:
- goto __105
+ goto __107
// Opcode: Delete P1 P2 P3 P4 P5
//
@@ -65121,7 +65898,7 @@ __5:
// of the memory cell that contains the value that the rowid of the row will
// be set to by the update.
case OP_Delete:
- goto __106
+ goto __108
// Opcode: ResetCount * * * * *
//
// The value of the change counter is copied to the database handle
@@ -65129,7 +65906,7 @@ __5:
// Then the VMs internal change counter resets to 0.
// This is used by trigger programs.
case OP_ResetCount:
- goto __107
+ goto __109
// Opcode: SorterCompare P1 P2 P3 P4
// Synopsis: if key(P1)!=trim(r[P3],P4) goto P2
@@ -65146,7 +65923,7 @@ __5:
// Fall through to next instruction if the two records compare equal to
// each other. Jump to P2 if they are different.
case OP_SorterCompare:
- goto __108
+ goto __110
// Opcode: SorterData P1 P2 P3 * *
// Synopsis: r[P2]=data
@@ -65160,7 +65937,7 @@ __5:
// parameter P3. Clearing the P3 column cache as part of this opcode saves
// us from having to issue a separate NullRow instruction to clear that cache.
case OP_SorterData:
- goto __109
+ goto __111
// Opcode: RowData P1 P2 P3 * *
// Synopsis: r[P2]=data
@@ -65190,7 +65967,7 @@ __5:
// The P2 register content is invalidated by opcodes like OP_Function or
// by any use of another cursor pointing to the same table.
case OP_RowData:
- goto __110
+ goto __112
// Opcode: Rowid P1 P2 * * *
// Synopsis: r[P2]=rowid
@@ -65202,7 +65979,7 @@ __5:
// be a separate OP_VRowid opcode for use with virtual tables, but this
// one opcode now works for both table types.
case OP_Rowid:
- goto __111
+ goto __113
// Opcode: NullRow P1 * * * *
//
@@ -65210,7 +65987,7 @@ __5:
// that occur while the cursor is on the null row will always
// write a NULL.
case OP_NullRow:
- goto __112
+ goto __114
// Opcode: SeekEnd P1 * * * *
//
@@ -65233,16 +66010,16 @@ __5:
// from the end toward the beginning. In other words, the cursor is
// configured to use Prev, not Next.
case OP_SeekEnd:
- goto __113
+ goto __115
case OP_Last:
- goto __114
+ goto __116
// Opcode: IfSmaller P1 P2 P3 * *
//
// Estimate the number of rows in the table P1. Jump to P2 if that
// estimate is less than approximately 2**(0.1*P3).
case OP_IfSmaller:
- goto __115
+ goto __117
// Opcode: SorterSort P1 P2 * * *
//
@@ -65264,9 +66041,9 @@ __5:
// regression tests can determine whether or not the optimizer is
// correctly optimizing out sorts.
case OP_SorterSort:
- goto __116 // jump
+ goto __118 // jump
case OP_Sort:
- goto __117
+ goto __119
// Opcode: Rewind P1 P2 * * *
//
// The next use of the Rowid or Column or Next instruction for P1
@@ -65279,7 +66056,7 @@ __5:
// from the beginning toward the end. In other words, the cursor is
// configured to use Next, not Prev.
case OP_Rewind:
- goto __118
+ goto __120
// Opcode: Next P1 P2 P3 P4 P5
//
@@ -65339,11 +66116,11 @@ __5:
// invoked. This opcode advances the cursor to the next sorted
// record, or jumps to P2 if there are no more sorted records.
case OP_SorterNext:
- goto __119
+ goto __121
case OP_Prev:
- goto __120 // jump
+ goto __122 // jump
case OP_Next:
- goto __121
+ goto __123
// Opcode: IdxInsert P1 P2 P3 P4 P5
// Synopsis: key=r[P2]
@@ -65373,7 +66150,7 @@ __5:
// This instruction only works for indices. The equivalent instruction
// for tables is OP_Insert.
case OP_IdxInsert:
- goto __122
+ goto __124
// Opcode: SorterInsert P1 P2 * * *
// Synopsis: key=r[P2]
@@ -65382,7 +66159,7 @@ __5:
// MakeRecord instructions. This opcode writes that key
// into the sorter P1. Data for the entry is nil.
case OP_SorterInsert:
- goto __123
+ goto __125
// Opcode: IdxDelete P1 P2 P3 * P5
// Synopsis: key=r[P2@P3]
@@ -65396,9 +66173,10 @@ __5:
// an UPDATE or DELETE statement and the index entry to be updated
// or deleted is not found. For some uses of IdxDelete
// (example: the EXCEPT operator) it does not matter that no matching
- // entry is found. For those cases, P5 is zero.
+ // entry is found. For those cases, P5 is zero. Also, do not raise
+ // this (self-correcting and non-critical) error if in writable_schema mode.
case OP_IdxDelete:
- goto __124
+ goto __126
// Opcode: DeferredSeek P1 * P3 P4 *
// Synopsis: Move P3 to P1.rowid if needed
@@ -65427,9 +66205,9 @@ __5:
//
// See also: Rowid, MakeRecord.
case OP_DeferredSeek:
- goto __125
+ goto __127
case OP_IdxRowid:
- goto __126
+ goto __128
// Opcode: FinishSeek P1 * * * *
//
@@ -65437,7 +66215,7 @@ __5:
// seek operation now, without further delay. If the cursor seek has
// already occurred, this instruction is a no-op.
case OP_FinishSeek:
- goto __127
+ goto __129
// Opcode: IdxGE P1 P2 P3 P4 *
// Synopsis: key=r[P3@P4]
@@ -65480,13 +66258,13 @@ __5:
// If the P1 index entry is less than or equal to the key value then jump
// to P2. Otherwise fall through to the next instruction.
case OP_IdxLE:
- goto __128 // jump
+ goto __130 // jump
case OP_IdxGT:
- goto __129 // jump
+ goto __131 // jump
case OP_IdxLT:
- goto __130 // jump
+ goto __132 // jump
case OP_IdxGE:
- goto __131
+ goto __133
// Opcode: Destroy P1 P2 P3 * *
//
@@ -65515,7 +66293,7 @@ __5:
//
// See also: Clear
case OP_Destroy:
- goto __132
+ goto __134
// Opcode: Clear P1 P2 P3
//
@@ -65534,7 +66312,7 @@ __5:
//
// See also: Destroy
case OP_Clear:
- goto __133
+ goto __135
// Opcode: ResetSorter P1 * * * *
//
@@ -65544,7 +66322,7 @@ __5:
// This opcode only works for cursors used for sorting and
// opened with OP_OpenEphemeral or OP_SorterOpen.
case OP_ResetSorter:
- goto __134
+ goto __136
// Opcode: CreateBtree P1 P2 P3 * *
// Synopsis: r[P2]=root iDb=P1 flags=P3
@@ -65555,13 +66333,13 @@ __5:
// it must be 2 (BTREE_BLOBKEY) for an index or WITHOUT ROWID table.
// The root page number of the new b-tree is stored in register P2.
case OP_CreateBtree:
- goto __135
+ goto __137
// Opcode: SqlExec * * * P4 *
//
// Run the SQL statement or statements specified in the P4 string.
case OP_SqlExec:
- goto __136
+ goto __138
// Opcode: ParseSchema P1 * * P4 *
//
@@ -65572,7 +66350,7 @@ __5:
// This opcode invokes the parser to create a new virtual machine,
// then runs the new virtual machine. It is thus a re-entrant opcode.
case OP_ParseSchema:
- goto __137
+ goto __139
// Opcode: LoadAnalysis P1 * * * *
//
@@ -65580,7 +66358,7 @@ __5:
// of that table into the internal index hash table. This will cause
// the analysis to be used when preparing all subsequent queries.
case OP_LoadAnalysis:
- goto __138
+ goto __140
// Opcode: DropTable P1 * * P4 *
//
@@ -65590,7 +66368,7 @@ __5:
// the internal representation of the
// schema consistent with what is on disk.
case OP_DropTable:
- goto __139
+ goto __141
// Opcode: DropIndex P1 * * P4 *
//
@@ -65600,7 +66378,7 @@ __5:
// in order to keep the internal representation of the
// schema consistent with what is on disk.
case OP_DropIndex:
- goto __140
+ goto __142
// Opcode: DropTrigger P1 * * P4 *
//
@@ -65610,7 +66388,7 @@ __5:
// the internal representation of the
// schema consistent with what is on disk.
case OP_DropTrigger:
- goto __141
+ goto __143
// Opcode: IntegrityCk P1 P2 P3 P4 P5
//
@@ -65631,7 +66409,7 @@ __5:
//
// This opcode is used to implement the integrity_check pragma.
case OP_IntegrityCk:
- goto __142
+ goto __144
// Opcode: RowSetAdd P1 P2 * * *
// Synopsis: rowset(P1)=r[P2]
@@ -65641,7 +66419,7 @@ __5:
//
// An assertion fails if P2 is not an integer.
case OP_RowSetAdd:
- goto __143
+ goto __145
// Opcode: RowSetRead P1 P2 P3 * *
// Synopsis: r[P3]=rowset(P1)
@@ -65651,7 +66429,7 @@ __5:
// Or, if RowSet object P1 is initially empty, leave P3
// unchanged and jump to instruction P2.
case OP_RowSetRead:
- goto __144
+ goto __146
// Opcode: RowSetTest P1 P2 P3 P4
// Synopsis: if r[P3] in rowset(P1) goto P2
@@ -65676,7 +66454,7 @@ __5:
// previously inserted as part of set X (only if it was previously
// inserted as part of some other set).
case OP_RowSetTest:
- goto __145
+ goto __147
// Opcode: Program P1 P2 P3 P4 P5
//
@@ -65693,7 +66471,7 @@ __5:
//
// If P5 is non-zero, then recursive program invocation is enabled.
case OP_Program:
- goto __146
+ goto __148
// Opcode: Param P1 P2 * * *
//
@@ -65707,7 +66485,7 @@ __5:
// the value of the P1 argument to the value of the P1 argument to the
// calling OP_Program instruction.
case OP_Param:
- goto __147
+ goto __149
// Opcode: FkCounter P1 P2 * * *
// Synopsis: fkctr[P1]+=P2
@@ -65717,7 +66495,7 @@ __5:
// (deferred foreign key constraints). Otherwise, if P1 is zero, the
// statement counter is incremented (immediate foreign key constraints).
case OP_FkCounter:
- goto __148
+ goto __150
// Opcode: FkIfZero P1 P2 * * *
// Synopsis: if fkctr[P1]==0 goto P2
@@ -65731,7 +66509,7 @@ __5:
// zero, the jump is taken if the statement constraint-counter is zero
// (immediate foreign key constraint violations).
case OP_FkIfZero:
- goto __149
+ goto __151
// Opcode: MemMax P1 P2 * * *
// Synopsis: r[P1]=max(r[P1],r[P2])
@@ -65744,7 +66522,7 @@ __5:
// This instruction throws an error if the memory cell is not initially
// an integer.
case OP_MemMax:
- goto __150
+ goto __152
// Opcode: IfPos P1 P2 P3 * *
// Synopsis: if r[P1]>0 then r[P1]-=P3, goto P2
@@ -65756,7 +66534,7 @@ __5:
// If the initial value of register P1 is less than 1, then the
// value is unchanged and control passes through to the next instruction.
case OP_IfPos:
- goto __151
+ goto __153
// Opcode: OffsetLimit P1 P2 P3 * *
// Synopsis: if r[P1]>0 then r[P2]=r[P1]+max(0,r[P3]) else r[P2]=(-1)
@@ -65776,7 +66554,7 @@ __5:
//
// Otherwise, r[P2] is set to the sum of r[P1] and r[P3].
case OP_OffsetLimit:
- goto __152
+ goto __154
// Opcode: IfNotZero P1 P2 * * *
// Synopsis: if r[P1]!=0 then r[P1]--, goto P2
@@ -65786,7 +66564,7 @@ __5:
// If it is non-zero (negative or positive) and then also jump to P2.
// If register P1 is initially zero, leave it unchanged and fall through.
case OP_IfNotZero:
- goto __153
+ goto __155
// Opcode: DecrJumpZero P1 P2 * * *
// Synopsis: if (--r[P1])==0 goto P2
@@ -65794,7 +66572,7 @@ __5:
// Register P1 must hold an integer. Decrement the value in P1
// and jump to P2 if the new value is exactly zero.
case OP_DecrJumpZero:
- goto __154
+ goto __156
// Opcode: AggStep * P2 P3 P4 P5
// Synopsis: accum=r[P3] step(r[P2@P5])
@@ -65833,11 +66611,11 @@ __5:
// sqlite3_context only happens once, instead of on each call to the
// step function.
case OP_AggInverse:
- goto __155
+ goto __157
case OP_AggStep:
- goto __156
+ goto __158
case OP_AggStep1:
- goto __157
+ goto __159
// Opcode: AggFinal P1 P2 * P4 *
// Synopsis: accum=r[P1] N=P2
@@ -65864,9 +66642,9 @@ __5:
// P4 argument is only needed for the case where
// the step function was not previously called.
case OP_AggValue:
- goto __158
+ goto __160
case OP_AggFinal:
- goto __159
+ goto __161
// Opcode: Checkpoint P1 P2 P3 * *
//
@@ -65879,7 +66657,7 @@ __5:
// completes into mem[P3+2]. However on an error, mem[P3+1] and
// mem[P3+2] are initialized to -1.
case OP_Checkpoint:
- goto __160
+ goto __162
// Opcode: JournalMode P1 P2 P3 * *
//
@@ -65892,7 +66670,7 @@ __5:
//
// Write a string containing the final journal-mode to register P2.
case OP_JournalMode:
- goto __161
+ goto __163
// Opcode: Vacuum P1 P2 * * *
//
@@ -65903,7 +66681,7 @@ __5:
// the file into which the result of vacuum should be written. When
// P2 is zero, the vacuum overwrites the original database.
case OP_Vacuum:
- goto __162
+ goto __164
// Opcode: IncrVacuum P1 P2 * * *
//
@@ -65911,7 +66689,7 @@ __5:
// the P1 database. If the vacuum has finished, jump to instruction
// P2. Otherwise, fall through to the next instruction.
case OP_IncrVacuum:
- goto __163
+ goto __165
// Opcode: Expire P1 P2 * * *
//
@@ -65929,21 +66707,21 @@ __5:
// that might help the statement run faster but which does not affect the
// correctness of operation.
case OP_Expire:
- goto __164
+ goto __166
// Opcode: CursorLock P1 * * * *
//
// Lock the btree to which cursor P1 is pointing so that the btree cannot be
// written by an other cursor.
case OP_CursorLock:
- goto __165
+ goto __167
// Opcode: CursorUnlock P1 * * * *
//
// Unlock the btree to which cursor P1 is pointing so that it can be
// written by other cursors.
case OP_CursorUnlock:
- goto __166
+ goto __168
// Opcode: TableLock P1 P2 P3 P4 *
// Synopsis: iDb=P1 root=P2 write=P3
@@ -65960,7 +66738,7 @@ __5:
// P4 contains a pointer to the name of the table being locked. This is only
// used to generate an error message if the lock cannot be obtained.
case OP_TableLock:
- goto __167
+ goto __169
// Opcode: VBegin * * * P4 *
//
@@ -65971,21 +66749,21 @@ __5:
// within a callback to a virtual table xSync() method. If it is, the error
// code will be set to SQLITE_LOCKED.
case OP_VBegin:
- goto __168
+ goto __170
// Opcode: VCreate P1 P2 * * *
//
// P2 is a register that holds the name of a virtual table in database
// P1. Call the xCreate method for that table.
case OP_VCreate:
- goto __169
+ goto __171
// Opcode: VDestroy P1 * * P4 *
//
// P4 is the name of a virtual table in database P1. Call the xDestroy method
// of that table.
case OP_VDestroy:
- goto __170
+ goto __172
// Opcode: VOpen P1 * * P4 *
//
@@ -65993,7 +66771,7 @@ __5:
// P1 is a cursor number. This opcode opens a cursor to the virtual
// table and stores that cursor in P1.
case OP_VOpen:
- goto __171
+ goto __173
// Opcode: VFilter P1 P2 P3 P4 *
// Synopsis: iplan=r[P3] zplan='P4'
@@ -66014,7 +66792,7 @@ __5:
//
// A jump is made to P2 if the result set after filtering would be empty.
case OP_VFilter:
- goto __172
+ goto __174
// Opcode: VColumn P1 P2 P3 * P5
// Synopsis: r[P3]=vcolumn(P2)
@@ -66030,7 +66808,7 @@ __5:
// bits (OPFLAG_LENGTHARG or OPFLAG_TYPEOFARG) but those bits are
// unused by OP_VColumn.
case OP_VColumn:
- goto __173
+ goto __175
// Opcode: VNext P1 P2 * * *
//
@@ -66038,7 +66816,7 @@ __5:
// jump to instruction P2. Or, if the virtual table has reached
// the end of its result set, then fall through to the next instruction.
case OP_VNext:
- goto __174
+ goto __176
// Opcode: VRename P1 * * P4 *
//
@@ -66046,7 +66824,7 @@ __5:
// This opcode invokes the corresponding xRename method. The value
// in register P1 is passed as the zName argument to the xRename method.
case OP_VRename:
- goto __175
+ goto __177
// Opcode: VUpdate P1 P2 P3 P4 P5
// Synopsis: data=r[P3@P2]
@@ -66075,13 +66853,13 @@ __5:
// P5 is the error actions (OE_Replace, OE_Fail, OE_Ignore, etc) to
// apply in the case of a constraint failure on an insert or update.
case OP_VUpdate:
- goto __176
+ goto __178
// Opcode: Pagecount P1 P2 * * *
//
// Write the current number of pages in database P1 to memory cell P2.
case OP_Pagecount:
- goto __177
+ goto __179
// Opcode: MaxPgcnt P1 P2 P3 * *
//
@@ -66091,7 +66869,7 @@ __5:
//
// Store the maximum page count after the change in register P2.
case OP_MaxPgcnt:
- goto __178
+ goto __180
// Opcode: Function P1 P2 P3 P4 *
// Synopsis: r[P3]=func(r[P2@NP])
@@ -66138,9 +66916,9 @@ __5:
//
// See also: AggStep, AggFinal, Function
case OP_PureFunc:
- goto __179 // group
+ goto __181 // group
case OP_Function:
- goto __180
+ goto __182
// Opcode: Trace P1 P2 * P4 *
//
@@ -66166,9 +66944,9 @@ __5:
// If P3 is not zero, then it is an address to jump to if an SQLITE_CORRUPT
// error is encountered.
case OP_Trace:
- goto __181
+ goto __183
case OP_Init:
- goto __182
+ goto __184
// Opcode: Noop * * * * *
//
@@ -66179,7 +66957,7 @@ __5:
// This opcode records information from the optimizer. It is the
// the same as a no-op. This opcodesnever appears in a real VM program.
default:
- goto __183
+ goto __185
}
goto __8
@@ -66233,7 +67011,7 @@ __5:
__9: // jump
jump_to_p2_and_check_for_interrupt:
- pOp = (aOp + uintptr(((*Op)(unsafe.Pointer(pOp)).Fp2-1))*20)
+ pOp = aOp + uintptr((*Op)(unsafe.Pointer(pOp)).Fp2-1)*20
// Opcodes that are used as the bottom of a loop (OP_Next, OP_Prev,
// OP_VNext, or OP_SorterNext) all jump here upon
@@ -66246,35 +67024,35 @@ jump_to_p2_and_check_for_interrupt:
// checks on every opcode. This helps sqlite3_step() to run about 1.5%
// faster according to "valgrind --tool=cachegrind"
check_for_interrupt:
- if !(libc.AtomicLoadNInt32((db+288 /* &.u1 */ /* &.isInterrupted */), 0) != 0) {
- goto __184
+ if !(libc.AtomicLoadNInt32(db+312, 0) != 0) {
+ goto __186
}
goto abort_due_to_interrupt
-__184:
+__186:
;
// Call the progress callback if it is configured and the required number
// of VDBE ops have been executed (either since this invocation of
// sqlite3VdbeExec() or since last time the progress callback was called).
// If the progress callback returns non-zero, exit the virtual machine with
// a return code SQLITE_ABORT.
-__185:
- if !((nVmStep >= nProgressLimit) && ((*Sqlite3)(unsafe.Pointer(db)).FxProgress != uintptr(0))) {
- goto __186
+__187:
+ if !(nVmStep >= nProgressLimit && (*Sqlite3)(unsafe.Pointer(db)).FxProgress != uintptr(0)) {
+ goto __188
}
- nProgressLimit = nProgressLimit + (U64((*Sqlite3)(unsafe.Pointer(db)).FnProgressOps))
+ nProgressLimit = nProgressLimit + U64((*Sqlite3)(unsafe.Pointer(db)).FnProgressOps)
if !((*struct {
f func(*libc.TLS, uintptr) int32
})(unsafe.Pointer(&struct{ uintptr }{(*Sqlite3)(unsafe.Pointer(db)).FxProgress})).f(tls, (*Sqlite3)(unsafe.Pointer(db)).FpProgressArg) != 0) {
- goto __187
+ goto __189
}
- nProgressLimit = (uint64(0xffffffff) | (U64((uint64(0xffffffff))) << 32))
+ nProgressLimit = uint64(0xffffffff) | U64(uint64(0xffffffff))<<32
rc = SQLITE_INTERRUPT
goto abort_due_to_error
-__187:
+__189:
;
- goto __185
-__186:
+ goto __187
+__188:
;
goto __8
@@ -66285,15 +67063,15 @@ __186:
// and then jump to address P2.
__10: // jump
;
- pIn1 = (aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*40)
+ pIn1 = aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*40
(*Mem)(unsafe.Pointer(pIn1)).Fflags = U16(MEM_Int)
- *(*I64)(unsafe.Pointer(pIn1 /* &.u */)) = I64(((int32(pOp) - int32(aOp)) / 20))
+ *(*I64)(unsafe.Pointer(pIn1)) = I64((int32(pOp) - int32(aOp)) / 20)
// Most jump operations do a goto to this spot in order to update
// the pOp pointer.
jump_to_p2:
- pOp = (aOp + uintptr(((*Op)(unsafe.Pointer(pOp)).Fp2-1))*20)
+ pOp = aOp + uintptr((*Op)(unsafe.Pointer(pOp)).Fp2-1)*20
goto __8
// Opcode: Return P1 * * * *
@@ -66301,9 +67079,9 @@ jump_to_p2:
// Jump to the next instruction after the address in register P1. After
// the jump, register P1 becomes undefined.
__11: // in1
- pIn1 = (aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*40)
+ pIn1 = aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*40
- pOp = (aOp + uintptr(*(*I64)(unsafe.Pointer(pIn1 /* &.u */)))*20)
+ pOp = aOp + uintptr(*(*I64)(unsafe.Pointer(pIn1)))*20
(*Mem)(unsafe.Pointer(pIn1)).Fflags = U16(MEM_Undefined)
goto __8
@@ -66320,15 +67098,15 @@ __11: // in1
__12: // jump
;
- pOut = (aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*40)
+ pOut = aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*40
- *(*I64)(unsafe.Pointer(pOut /* &.u */)) = (I64((*Op)(unsafe.Pointer(pOp)).Fp3 - 1))
+ *(*I64)(unsafe.Pointer(pOut)) = I64((*Op)(unsafe.Pointer(pOp)).Fp3 - 1)
(*Mem)(unsafe.Pointer(pOut)).Fflags = U16(MEM_Int)
if !((*Op)(unsafe.Pointer(pOp)).Fp2 != 0) {
- goto __188
+ goto __190
}
goto jump_to_p2
-__188:
+__190:
;
goto __8
@@ -66340,11 +67118,11 @@ __188:
//
// See also: InitCoroutine
__13:
- pIn1 = (aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*40)
+ pIn1 = aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*40
- pCaller = (aOp + uintptr(*(*I64)(unsafe.Pointer(pIn1 /* &.u */)))*20)
+ pCaller = aOp + uintptr(*(*I64)(unsafe.Pointer(pIn1)))*20
- pOp = (aOp + uintptr(((*VdbeOp)(unsafe.Pointer(pCaller)).Fp2-1))*20)
+ pOp = aOp + uintptr((*VdbeOp)(unsafe.Pointer(pCaller)).Fp2-1)*20
(*Mem)(unsafe.Pointer(pIn1)).Fflags = U16(MEM_Undefined)
goto __8
@@ -66361,13 +67139,13 @@ __13:
//
// See also: InitCoroutine
__14:
- pIn1 = (aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*40)
+ pIn1 = aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*40
(*Mem)(unsafe.Pointer(pIn1)).Fflags = U16(MEM_Int)
- pcDest = int32(*(*I64)(unsafe.Pointer(pIn1 /* &.u */)))
- *(*I64)(unsafe.Pointer(pIn1 /* &.u */)) = I64(((int32(pOp) - int32(aOp)) / 20))
+ pcDest = int32(*(*I64)(unsafe.Pointer(pIn1)))
+ *(*I64)(unsafe.Pointer(pIn1)) = I64((int32(pOp) - int32(aOp)) / 20)
- pOp = (aOp + uintptr(pcDest)*20)
+ pOp = aOp + uintptr(pcDest)*20
goto __8
// Opcode: HaltIfNull P1 P2 P3 P4 P5
@@ -66378,12 +67156,12 @@ __14:
// value in register P3 is not NULL, then this routine is a no-op.
// The P5 parameter should be 1.
__15: // in3
- pIn3 = (aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp3)*40)
- if !((int32((*Mem)(unsafe.Pointer(pIn3)).Fflags) & MEM_Null) == 0) {
- goto __189
+ pIn3 = aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp3)*40
+ if !(int32((*Mem)(unsafe.Pointer(pIn3)).Fflags)&MEM_Null == 0) {
+ goto __191
}
goto __8
-__189:
+__191:
;
// Opcode: Halt P1 P2 * P4 P5
@@ -66417,9 +67195,9 @@ __189:
// is the same as executing Halt.
__16:
- pcx = ((int32(pOp) - int32(aOp)) / 20)
- if !(((*Op)(unsafe.Pointer(pOp)).Fp1 == SQLITE_OK) && ((*Vdbe)(unsafe.Pointer(p)).FpFrame != 0)) {
- goto __190
+ pcx = (int32(pOp) - int32(aOp)) / 20
+ if !((*Op)(unsafe.Pointer(pOp)).Fp1 == SQLITE_OK && (*Vdbe)(unsafe.Pointer(p)).FpFrame != 0) {
+ goto __192
}
// Halt the sub-program. Return control to the parent frame.
pFrame = (*Vdbe)(unsafe.Pointer(p)).FpFrame
@@ -66428,56 +67206,56 @@ __16:
Xsqlite3VdbeSetChanges(tls, db, (*Vdbe)(unsafe.Pointer(p)).FnChange)
pcx = Xsqlite3VdbeFrameRestore(tls, pFrame)
if !((*Op)(unsafe.Pointer(pOp)).Fp2 == OE_Ignore) {
- goto __191
+ goto __193
}
// Instruction pcx is the OP_Program that invoked the sub-program
// currently being halted. If the p2 instruction of this OP_Halt
// instruction is set to OE_Ignore, then the sub-program is throwing
// an IGNORE exception. In this case jump to the address specified
// as the p2 of the calling OP_Program.
- pcx = ((*Op)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FaOp+uintptr(pcx)*20)).Fp2 - 1)
-__191:
+ pcx = (*Op)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FaOp+uintptr(pcx)*20)).Fp2 - 1
+__193:
;
aOp = (*Vdbe)(unsafe.Pointer(p)).FaOp
aMem = (*Vdbe)(unsafe.Pointer(p)).FaMem
- pOp = (aOp + uintptr(pcx)*20)
+ pOp = aOp + uintptr(pcx)*20
goto __8
-__190:
+__192:
;
(*Vdbe)(unsafe.Pointer(p)).Frc = (*Op)(unsafe.Pointer(pOp)).Fp1
(*Vdbe)(unsafe.Pointer(p)).FerrorAction = U8((*Op)(unsafe.Pointer(pOp)).Fp2)
(*Vdbe)(unsafe.Pointer(p)).Fpc = pcx
if !((*Vdbe)(unsafe.Pointer(p)).Frc != 0) {
- goto __192
+ goto __194
}
if !((*Op)(unsafe.Pointer(pOp)).Fp5 != 0) {
- goto __193
+ goto __195
}
- Xsqlite3VdbeError(tls, p, ts+4545 /* "%s constraint fa..." */, libc.VaList(bp, azType[(int32((*Op)(unsafe.Pointer(pOp)).Fp5)-1)]))
- if !(*(*uintptr)(unsafe.Pointer(pOp + 16 /* &.p4 */)) != 0) {
- goto __195
+ Xsqlite3VdbeError(tls, p, ts+5351 /* "%s constraint fa..." */, libc.VaList(bp, azType[int32((*Op)(unsafe.Pointer(pOp)).Fp5)-1]))
+ if !(*(*uintptr)(unsafe.Pointer(pOp + 16)) != 0) {
+ goto __197
}
- (*Vdbe)(unsafe.Pointer(p)).FzErrMsg = Xsqlite3MPrintf(tls, db, ts+4566 /* "%z: %s" */, libc.VaList(bp+8, (*Vdbe)(unsafe.Pointer(p)).FzErrMsg, *(*uintptr)(unsafe.Pointer(pOp + 16 /* &.p4 */))))
+ (*Vdbe)(unsafe.Pointer(p)).FzErrMsg = Xsqlite3MPrintf(tls, db, ts+5372 /* "%z: %s" */, libc.VaList(bp+8, (*Vdbe)(unsafe.Pointer(p)).FzErrMsg, *(*uintptr)(unsafe.Pointer(pOp + 16))))
+__197:
+ ;
+ goto __196
__195:
+ Xsqlite3VdbeError(tls, p, ts+3601 /* "%s" */, libc.VaList(bp+24, *(*uintptr)(unsafe.Pointer(pOp + 16))))
+__196:
;
- goto __194
-__193:
- Xsqlite3VdbeError(tls, p, ts+2790 /* "%s" */, libc.VaList(bp+24, *(*uintptr)(unsafe.Pointer(pOp + 16 /* &.p4 */))))
+ Xsqlite3_log(tls, (*Op)(unsafe.Pointer(pOp)).Fp1, ts+5379 /* "abort at %d in [..." */, libc.VaList(bp+32, pcx, (*Vdbe)(unsafe.Pointer(p)).FzSql, (*Vdbe)(unsafe.Pointer(p)).FzErrMsg))
__194:
;
- Xsqlite3_log(tls, (*Op)(unsafe.Pointer(pOp)).Fp1, ts+4573 /* "abort at %d in [..." */, libc.VaList(bp+32, pcx, (*Vdbe)(unsafe.Pointer(p)).FzSql, (*Vdbe)(unsafe.Pointer(p)).FzErrMsg))
-__192:
- ;
rc = Xsqlite3VdbeHalt(tls, p)
if !(rc == SQLITE_BUSY) {
- goto __196
+ goto __198
}
(*Vdbe)(unsafe.Pointer(p)).Frc = SQLITE_BUSY
- goto __197
-__196:
+ goto __199
+__198:
;
if (*Vdbe)(unsafe.Pointer(p)).Frc != 0 {
@@ -66485,7 +67263,7 @@ __196:
} else {
rc = SQLITE_DONE
}
-__197:
+__199:
;
goto vdbe_return
@@ -66495,7 +67273,7 @@ __197:
// The 32-bit integer value P1 is written into register P2.
__17: // out2
pOut = out2Prerelease(tls, p, pOp)
- *(*I64)(unsafe.Pointer(pOut /* &.u */)) = I64((*Op)(unsafe.Pointer(pOp)).Fp1)
+ *(*I64)(unsafe.Pointer(pOut)) = I64((*Op)(unsafe.Pointer(pOp)).Fp1)
goto __8
// Opcode: Int64 * P2 * P4 *
@@ -66506,7 +67284,7 @@ __17: // out2
__18: // out2
pOut = out2Prerelease(tls, p, pOp)
- *(*I64)(unsafe.Pointer(pOut /* &.u */)) = *(*I64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pOp + 16 /* &.p4 */))))
+ *(*I64)(unsafe.Pointer(pOut)) = *(*I64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pOp + 16))))
goto __8
// Opcode: Real * P2 * P4 *
@@ -66518,7 +67296,7 @@ __19: // same as TK_FLOAT, out2
pOut = out2Prerelease(tls, p, pOp)
(*Mem)(unsafe.Pointer(pOut)).Fflags = U16(MEM_Real)
- *(*float64)(unsafe.Pointer(pOut /* &.u */)) = *(*float64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pOp + 16 /* &.p4 */))))
+ *(*float64)(unsafe.Pointer(pOut)) = *(*float64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pOp + 16))))
goto __8
// Opcode: String8 * P2 * P4 *
@@ -66531,44 +67309,44 @@ __19: // same as TK_FLOAT, out2
__20: // same as TK_STRING, out2
;
pOut = out2Prerelease(tls, p, pOp)
- (*Op)(unsafe.Pointer(pOp)).Fp1 = Xsqlite3Strlen30(tls, *(*uintptr)(unsafe.Pointer(pOp + 16 /* &.p4 */)))
+ (*Op)(unsafe.Pointer(pOp)).Fp1 = Xsqlite3Strlen30(tls, *(*uintptr)(unsafe.Pointer(pOp + 16)))
if !(int32(encoding) != SQLITE_UTF8) {
- goto __198
+ goto __200
}
- rc = Xsqlite3VdbeMemSetStr(tls, pOut, *(*uintptr)(unsafe.Pointer(pOp + 16 /* &.p4 */)), int64(-1), uint8(SQLITE_UTF8), uintptr(0))
+ rc = Xsqlite3VdbeMemSetStr(tls, pOut, *(*uintptr)(unsafe.Pointer(pOp + 16)), int64(-1), uint8(SQLITE_UTF8), uintptr(0))
if !(rc != 0) {
- goto __199
+ goto __201
}
goto too_big
-__199:
+__201:
;
if !(SQLITE_OK != Xsqlite3VdbeChangeEncoding(tls, pOut, int32(encoding))) {
- goto __200
+ goto __202
}
goto no_mem
-__200:
+__202:
;
(*Mem)(unsafe.Pointer(pOut)).FszMalloc = 0
- *(*U16)(unsafe.Pointer(pOut + 8 /* &.flags */)) |= U16((MEM_Static))
- if !(int32((*Op)(unsafe.Pointer(pOp)).Fp4type) == (-7)) {
- goto __201
+ *(*U16)(unsafe.Pointer(pOut + 8)) |= U16(MEM_Static)
+ if !(int32((*Op)(unsafe.Pointer(pOp)).Fp4type) == -7) {
+ goto __203
}
- Xsqlite3DbFree(tls, db, *(*uintptr)(unsafe.Pointer(pOp + 16 /* &.p4 */)))
-__201:
+ Xsqlite3DbFree(tls, db, *(*uintptr)(unsafe.Pointer(pOp + 16)))
+__203:
;
(*Op)(unsafe.Pointer(pOp)).Fp4type = int8(-7)
- *(*uintptr)(unsafe.Pointer(pOp + 16 /* &.p4 */)) = (*Mem)(unsafe.Pointer(pOut)).Fz
+ *(*uintptr)(unsafe.Pointer(pOp + 16)) = (*Mem)(unsafe.Pointer(pOut)).Fz
(*Op)(unsafe.Pointer(pOp)).Fp1 = (*Mem)(unsafe.Pointer(pOut)).Fn
-__198:
+__200:
;
- if !((*Op)(unsafe.Pointer(pOp)).Fp1 > *(*int32)(unsafe.Pointer((db + 112 /* &.aLimit */)))) {
- goto __202
+ if !((*Op)(unsafe.Pointer(pOp)).Fp1 > *(*int32)(unsafe.Pointer(db + 120))) {
+ goto __204
}
goto too_big
-__202:
+__204:
;
(*Op)(unsafe.Pointer(pOp)).Fopcode = U8(OP_String)
@@ -66586,8 +67364,8 @@ __202:
__21: // out2
;
pOut = out2Prerelease(tls, p, pOp)
- (*Mem)(unsafe.Pointer(pOut)).Fflags = (U16((MEM_Str | MEM_Static) | MEM_Term))
- (*Mem)(unsafe.Pointer(pOut)).Fz = *(*uintptr)(unsafe.Pointer(pOp + 16 /* &.p4 */))
+ (*Mem)(unsafe.Pointer(pOut)).Fflags = U16(MEM_Str | MEM_Static | MEM_Term)
+ (*Mem)(unsafe.Pointer(pOut)).Fz = *(*uintptr)(unsafe.Pointer(pOp + 16))
(*Mem)(unsafe.Pointer(pOut)).Fn = (*Op)(unsafe.Pointer(pOp)).Fp1
(*Mem)(unsafe.Pointer(pOut)).Fenc = encoding
@@ -66606,18 +67384,18 @@ __21: // out2
// OP_Ne or OP_Eq.
__22:
pOut = out2Prerelease(tls, p, pOp)
- cnt = ((*Op)(unsafe.Pointer(pOp)).Fp3 - (*Op)(unsafe.Pointer(pOp)).Fp2)
+ cnt = (*Op)(unsafe.Pointer(pOp)).Fp3 - (*Op)(unsafe.Pointer(pOp)).Fp2
(*Mem)(unsafe.Pointer(pOut)).Fflags = libc.AssignUint16(&nullFlag, func() uint16 {
if (*Op)(unsafe.Pointer(pOp)).Fp1 != 0 {
- return (uint16(MEM_Null | MEM_Cleared))
+ return uint16(MEM_Null | MEM_Cleared)
}
return uint16(MEM_Null)
}())
(*Mem)(unsafe.Pointer(pOut)).Fn = 0
-__203:
+__205:
if !(cnt > 0) {
- goto __204
+ goto __206
}
pOut += 40
@@ -66625,8 +67403,8 @@ __203:
(*Mem)(unsafe.Pointer(pOut)).Fflags = nullFlag
(*Mem)(unsafe.Pointer(pOut)).Fn = 0
cnt--
- goto __203
-__204:
+ goto __205
+__206:
;
goto __8
@@ -66639,8 +67417,8 @@ __204:
// previously copied using OP_SCopy, the copies will continue to be valid.
__23:
;
- pOut = (aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*40)
- (*Mem)(unsafe.Pointer(pOut)).Fflags = (U16((int32((*Mem)(unsafe.Pointer(pOut)).Fflags) & libc.CplInt32((MEM_Undefined | MEM_AffMask))) | MEM_Null))
+ pOut = aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*40
+ (*Mem)(unsafe.Pointer(pOut)).Fflags = U16(int32((*Mem)(unsafe.Pointer(pOut)).Fflags)&libc.CplInt32(MEM_Undefined|MEM_AffMask) | MEM_Null)
goto __8
// Opcode: Blob P1 P2 * P4 *
@@ -66651,7 +67429,7 @@ __23:
__24: // out2
;
pOut = out2Prerelease(tls, p, pOp)
- Xsqlite3VdbeMemSetStr(tls, pOut, *(*uintptr)(unsafe.Pointer(pOp + 16 /* &.p4 */)), int64((*Op)(unsafe.Pointer(pOp)).Fp1), uint8(0), uintptr(0))
+ Xsqlite3VdbeMemSetStr(tls, pOut, *(*uintptr)(unsafe.Pointer(pOp + 16)), int64((*Op)(unsafe.Pointer(pOp)).Fp1), uint8(0), uintptr(0))
(*Mem)(unsafe.Pointer(pOut)).Fenc = encoding
goto __8
@@ -66667,23 +67445,23 @@ __25: // Value being transferred
;
- pVar = ((*Vdbe)(unsafe.Pointer(p)).FaVar + uintptr(((*Op)(unsafe.Pointer(pOp)).Fp1-1))*40)
+ pVar = (*Vdbe)(unsafe.Pointer(p)).FaVar + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1-1)*40
if !(Xsqlite3VdbeMemTooBig(tls, pVar) != 0) {
- goto __205
+ goto __207
}
goto too_big
-__205:
+__207:
;
- pOut = (aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp2)*40)
- if !((int32((*Mem)(unsafe.Pointer((pOut))).Fflags) & (MEM_Agg | MEM_Dyn)) != 0) {
- goto __206
+ pOut = aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp2)*40
+ if !(int32((*Mem)(unsafe.Pointer(pOut)).Fflags)&(MEM_Agg|MEM_Dyn) != 0) {
+ goto __208
}
Xsqlite3VdbeMemSetNull(tls, pOut)
-__206:
+__208:
;
- libc.Xmemcpy(tls, pOut, pVar, uint32((uintptr(0) + 20 /* &.zMalloc */)))
- *(*U16)(unsafe.Pointer(pOut + 8 /* &.flags */)) &= libc.Uint16FromInt32((libc.CplInt32((MEM_Dyn | MEM_Ephem))))
- *(*U16)(unsafe.Pointer(pOut + 8 /* &.flags */)) |= U16((MEM_Static | MEM_FromBind))
+ libc.Xmemcpy(tls, pOut, pVar, uint32(uintptr(0)+20))
+ *(*U16)(unsafe.Pointer(pOut + 8)) &= libc.Uint16FromInt32(libc.CplInt32(MEM_Dyn | MEM_Ephem))
+ *(*U16)(unsafe.Pointer(pOut + 8)) |= U16(MEM_Static | MEM_FromBind)
goto __8
@@ -66701,28 +67479,28 @@ __26: // Register to copy to
p1 = (*Op)(unsafe.Pointer(pOp)).Fp1
p2 = (*Op)(unsafe.Pointer(pOp)).Fp2
- pIn1 = (aMem + uintptr(p1)*40)
- pOut = (aMem + uintptr(p2)*40)
-__207:
+ pIn1 = aMem + uintptr(p1)*40
+ pOut = aMem + uintptr(p2)*40
+__209:
;
Xsqlite3VdbeMemMove(tls, pOut, pIn1)
- if !(((int32((*Mem)(unsafe.Pointer((pOut))).Fflags) & MEM_Ephem) != 0) && (Xsqlite3VdbeMemMakeWriteable(tls, pOut) != 0)) {
- goto __210
+ if !(int32((*Mem)(unsafe.Pointer(pOut)).Fflags)&MEM_Ephem != 0 && Xsqlite3VdbeMemMakeWriteable(tls, pOut) != 0) {
+ goto __212
}
goto no_mem
-__210:
+__212:
;
pIn1 += 40
pOut += 40
- goto __208
-__208:
+ goto __210
+__210:
if libc.PreDecInt32(&n, 1) != 0 {
- goto __207
+ goto __209
}
- goto __209
-__209:
+ goto __211
+__211:
;
goto __8
@@ -66736,32 +67514,32 @@ __209:
__27:
n1 = (*Op)(unsafe.Pointer(pOp)).Fp3
- pIn1 = (aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*40)
- pOut = (aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp2)*40)
+ pIn1 = aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*40
+ pOut = aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp2)*40
-__211:
+__213:
if !(1 != 0) {
- goto __212
+ goto __214
}
Xsqlite3VdbeMemShallowCopy(tls, pOut, pIn1, MEM_Ephem)
- if !(((int32((*Mem)(unsafe.Pointer((pOut))).Fflags) & MEM_Ephem) != 0) && (Xsqlite3VdbeMemMakeWriteable(tls, pOut) != 0)) {
- goto __213
+ if !(int32((*Mem)(unsafe.Pointer(pOut)).Fflags)&MEM_Ephem != 0 && Xsqlite3VdbeMemMakeWriteable(tls, pOut) != 0) {
+ goto __215
}
goto no_mem
-__213:
+__215:
;
- if !((libc.PostDecInt32(&n1, 1)) == 0) {
- goto __214
+ if !(libc.PostDecInt32(&n1, 1) == 0) {
+ goto __216
}
- goto __212
-__214:
+ goto __214
+__216:
;
pOut += 40
pIn1 += 40
- goto __211
-__212:
+ goto __213
+__214:
;
goto __8
@@ -66778,8 +67556,8 @@ __212:
// during the lifetime of the copy. Use OP_Copy to make a complete
// copy.
__28: // out2
- pIn1 = (aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*40)
- pOut = (aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp2)*40)
+ pIn1 = aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*40
+ pOut = aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp2)*40
Xsqlite3VdbeMemShallowCopy(tls, pOut, pIn1, MEM_Ephem)
goto __8
@@ -66792,10 +67570,10 @@ __28: // out2
// This is an optimized version of SCopy that works only for integer
// values.
__29: // out2
- pIn1 = (aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*40)
+ pIn1 = aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*40
- pOut = (aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp2)*40)
- Xsqlite3VdbeMemSetInt64(tls, pOut, *(*I64)(unsafe.Pointer(pIn1 /* &.u */)))
+ pOut = aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp2)*40
+ Xsqlite3VdbeMemSetInt64(tls, pOut, *(*I64)(unsafe.Pointer(pIn1)))
goto __8
// Opcode: ChngCntRow P1 P2 * * *
@@ -66810,11 +67588,11 @@ __29: // out2
// non-zero. The P2 opcode must be 1.
__30:
;
- if !((libc.AssignInt32(&rc, Xsqlite3VdbeCheckFk(tls, p, 0))) != SQLITE_OK) {
- goto __215
+ if !(libc.AssignInt32(&rc, Xsqlite3VdbeCheckFk(tls, p, 0)) != SQLITE_OK) {
+ goto __217
}
goto abort_due_to_error
-__215:
+__217:
;
// Opcode: ResultRow P1 P2 * * *
@@ -66829,52 +67607,52 @@ __31:
;
// Invalidate all ephemeral cursor row caches
- (*Vdbe)(unsafe.Pointer(p)).FcacheCtr = (((*Vdbe)(unsafe.Pointer(p)).FcacheCtr + U32(2)) | U32(1))
+ (*Vdbe)(unsafe.Pointer(p)).FcacheCtr = (*Vdbe)(unsafe.Pointer(p)).FcacheCtr + U32(2) | U32(1)
// Make sure the results of the current row are \000 terminated
// and have an assigned type. The results are de-ephemeralized as
// a side effect.
- pMem = libc.AssignPtrUintptr(p+120 /* &.pResultSet */, (aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*40))
+ pMem = libc.AssignPtrUintptr(p+128, aMem+uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*40)
i = 0
-__216:
+__218:
if !(i < (*Op)(unsafe.Pointer(pOp)).Fp2) {
- goto __218
+ goto __220
}
- if !(((int32((*Mem)(unsafe.Pointer((pMem + uintptr(i)*40))).Fflags) & MEM_Ephem) != 0) && (Xsqlite3VdbeMemMakeWriteable(tls, (pMem+uintptr(i)*40)) != 0)) {
- goto __219
+ if !(int32((*Mem)(unsafe.Pointer(pMem+uintptr(i)*40)).Fflags)&MEM_Ephem != 0 && Xsqlite3VdbeMemMakeWriteable(tls, pMem+uintptr(i)*40) != 0) {
+ goto __221
}
goto no_mem
-__219:
+__221:
;
- Xsqlite3VdbeMemNulTerminate(tls, (pMem + uintptr(i)*40))
+ Xsqlite3VdbeMemNulTerminate(tls, pMem+uintptr(i)*40)
- goto __217
-__217:
+ goto __219
+__219:
i++
- goto __216
goto __218
-__218:
+ goto __220
+__220:
;
if !((*Sqlite3)(unsafe.Pointer(db)).FmallocFailed != 0) {
- goto __220
+ goto __222
}
goto no_mem
-__220:
+__222:
;
- if !((int32((*Sqlite3)(unsafe.Pointer(db)).FmTrace) & SQLITE_TRACE_ROW) != 0) {
- goto __221
+ if !(int32((*Sqlite3)(unsafe.Pointer(db)).FmTrace)&SQLITE_TRACE_ROW != 0) {
+ goto __223
}
(*struct {
f func(*libc.TLS, U32, uintptr, uintptr, uintptr) int32
- })(unsafe.Pointer(&struct{ uintptr }{*(*uintptr)(unsafe.Pointer(db + 208 /* &.trace */))})).f(tls, uint32(SQLITE_TRACE_ROW), (*Sqlite3)(unsafe.Pointer(db)).FpTraceArg, p, uintptr(0))
-__221:
+ })(unsafe.Pointer(&struct{ uintptr }{*(*uintptr)(unsafe.Pointer(db + 216 /* &.trace */))})).f(tls, uint32(SQLITE_TRACE_ROW), (*Sqlite3)(unsafe.Pointer(db)).FpTraceArg, p, uintptr(0))
+__223:
;
// Return SQLITE_ROW
- (*Vdbe)(unsafe.Pointer(p)).Fpc = (((int32(pOp) - int32(aOp)) / 20) + 1)
+ (*Vdbe)(unsafe.Pointer(p)).Fpc = (int32(pOp)-int32(aOp))/20 + 1
rc = SQLITE_ROW
goto vdbe_return
@@ -66892,101 +67670,101 @@ __221:
// to avoid a memcpy().
__32: // Initial flags for P2
- pIn1 = (aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*40)
- pIn2 = (aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp2)*40)
- pOut = (aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp3)*40)
+ pIn1 = aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*40
+ pIn2 = aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp2)*40
+ pOut = aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp3)*40
flags1 = (*Mem)(unsafe.Pointer(pIn1)).Fflags
- if !(((int32(flags1) | int32((*Mem)(unsafe.Pointer(pIn2)).Fflags)) & MEM_Null) != 0) {
- goto __222
+ if !((int32(flags1)|int32((*Mem)(unsafe.Pointer(pIn2)).Fflags))&MEM_Null != 0) {
+ goto __224
}
Xsqlite3VdbeMemSetNull(tls, pOut)
goto __8
-__222:
+__224:
;
- if !((int32(flags1) & (MEM_Str | MEM_Blob)) == 0) {
- goto __223
+ if !(int32(flags1)&(MEM_Str|MEM_Blob) == 0) {
+ goto __225
}
if !(Xsqlite3VdbeMemStringify(tls, pIn1, encoding, uint8(0)) != 0) {
- goto __225
+ goto __227
}
goto no_mem
-__225:
+__227:
;
- flags1 = (U16(int32((*Mem)(unsafe.Pointer(pIn1)).Fflags) & libc.CplInt32(MEM_Str)))
- goto __224
-__223:
- if !((int32(flags1) & MEM_Zero) != 0) {
- goto __226
+ flags1 = U16(int32((*Mem)(unsafe.Pointer(pIn1)).Fflags) & libc.CplInt32(MEM_Str))
+ goto __226
+__225:
+ if !(int32(flags1)&MEM_Zero != 0) {
+ goto __228
}
if !(Xsqlite3VdbeMemExpandBlob(tls, pIn1) != 0) {
- goto __227
+ goto __229
}
goto no_mem
-__227:
+__229:
;
- flags1 = (U16(int32((*Mem)(unsafe.Pointer(pIn1)).Fflags) & libc.CplInt32(MEM_Str)))
-__226:
+ flags1 = U16(int32((*Mem)(unsafe.Pointer(pIn1)).Fflags) & libc.CplInt32(MEM_Str))
+__228:
;
-__224:
+__226:
;
flags2 = (*Mem)(unsafe.Pointer(pIn2)).Fflags
- if !((int32(flags2) & (MEM_Str | MEM_Blob)) == 0) {
- goto __228
+ if !(int32(flags2)&(MEM_Str|MEM_Blob) == 0) {
+ goto __230
}
if !(Xsqlite3VdbeMemStringify(tls, pIn2, encoding, uint8(0)) != 0) {
- goto __230
+ goto __232
}
goto no_mem
-__230:
+__232:
;
- flags2 = (U16(int32((*Mem)(unsafe.Pointer(pIn2)).Fflags) & libc.CplInt32(MEM_Str)))
- goto __229
-__228:
- if !((int32(flags2) & MEM_Zero) != 0) {
- goto __231
+ flags2 = U16(int32((*Mem)(unsafe.Pointer(pIn2)).Fflags) & libc.CplInt32(MEM_Str))
+ goto __231
+__230:
+ if !(int32(flags2)&MEM_Zero != 0) {
+ goto __233
}
if !(Xsqlite3VdbeMemExpandBlob(tls, pIn2) != 0) {
- goto __232
+ goto __234
}
goto no_mem
-__232:
+__234:
;
- flags2 = (U16(int32((*Mem)(unsafe.Pointer(pIn2)).Fflags) & libc.CplInt32(MEM_Str)))
-__231:
+ flags2 = U16(int32((*Mem)(unsafe.Pointer(pIn2)).Fflags) & libc.CplInt32(MEM_Str))
+__233:
;
-__229:
+__231:
;
- nByte = (I64((*Mem)(unsafe.Pointer(pIn1)).Fn + (*Mem)(unsafe.Pointer(pIn2)).Fn))
- if !(nByte > I64(*(*int32)(unsafe.Pointer((db + 112 /* &.aLimit */))))) {
- goto __233
+ nByte = I64((*Mem)(unsafe.Pointer(pIn1)).Fn + (*Mem)(unsafe.Pointer(pIn2)).Fn)
+ if !(nByte > I64(*(*int32)(unsafe.Pointer(db + 120)))) {
+ goto __235
}
goto too_big
-__233:
+__235:
;
- if !(Xsqlite3VdbeMemGrow(tls, pOut, (int32(nByte)+3), (libc.Bool32(pOut == pIn2))) != 0) {
- goto __234
+ if !(Xsqlite3VdbeMemGrow(tls, pOut, int32(nByte)+3, libc.Bool32(pOut == pIn2)) != 0) {
+ goto __236
}
goto no_mem
-__234:
+__236:
;
- (*Mem)(unsafe.Pointer(pOut)).Fflags = (U16((int32((*Mem)(unsafe.Pointer((pOut))).Fflags) & libc.CplInt32((MEM_TypeMask | MEM_Zero))) | MEM_Str))
+ (*Mem)(unsafe.Pointer(pOut)).Fflags = U16(int32((*Mem)(unsafe.Pointer(pOut)).Fflags)&libc.CplInt32(MEM_TypeMask|MEM_Zero) | MEM_Str)
if !(pOut != pIn2) {
- goto __235
+ goto __237
}
libc.Xmemcpy(tls, (*Mem)(unsafe.Pointer(pOut)).Fz, (*Mem)(unsafe.Pointer(pIn2)).Fz, uint32((*Mem)(unsafe.Pointer(pIn2)).Fn))
(*Mem)(unsafe.Pointer(pIn2)).Fflags = flags2
-__235:
+__237:
;
- libc.Xmemcpy(tls, ((*Mem)(unsafe.Pointer(pOut)).Fz + uintptr((*Mem)(unsafe.Pointer(pIn2)).Fn)), (*Mem)(unsafe.Pointer(pIn1)).Fz, uint32((*Mem)(unsafe.Pointer(pIn1)).Fn))
+ libc.Xmemcpy(tls, (*Mem)(unsafe.Pointer(pOut)).Fz+uintptr((*Mem)(unsafe.Pointer(pIn2)).Fn), (*Mem)(unsafe.Pointer(pIn1)).Fz, uint32((*Mem)(unsafe.Pointer(pIn1)).Fn))
(*Mem)(unsafe.Pointer(pIn1)).Fflags = flags1
*(*uint8)(unsafe.Pointer((*Mem)(unsafe.Pointer(pOut)).Fz + uintptr(nByte))) = uint8(0)
- *(*uint8)(unsafe.Pointer((*Mem)(unsafe.Pointer(pOut)).Fz + uintptr((nByte + int64(1))))) = uint8(0)
- *(*uint8)(unsafe.Pointer((*Mem)(unsafe.Pointer(pOut)).Fz + uintptr((nByte + int64(2))))) = uint8(0)
- *(*U16)(unsafe.Pointer(pOut + 8 /* &.flags */)) |= U16((MEM_Term))
+ *(*uint8)(unsafe.Pointer((*Mem)(unsafe.Pointer(pOut)).Fz + uintptr(nByte+int64(1)))) = uint8(0)
+ *(*uint8)(unsafe.Pointer((*Mem)(unsafe.Pointer(pOut)).Fz + uintptr(nByte+int64(2)))) = uint8(0)
+ *(*U16)(unsafe.Pointer(pOut + 8)) |= U16(MEM_Term)
(*Mem)(unsafe.Pointer(pOut)).Fn = int32(nByte)
(*Mem)(unsafe.Pointer(pOut)).Fenc = encoding
@@ -67031,165 +67809,165 @@ __35: // same as TK_STAR, in1, in2, out3
__36: // same as TK_SLASH, in1, in2, out3
__37: // Real value of right operand
- pIn1 = (aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*40)
+ pIn1 = aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*40
type1 = numericType(tls, pIn1)
- pIn2 = (aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp2)*40)
+ pIn2 = aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp2)*40
type2 = numericType(tls, pIn2)
- pOut = (aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp3)*40)
- flags = (U16(int32((*Mem)(unsafe.Pointer(pIn1)).Fflags) | int32((*Mem)(unsafe.Pointer(pIn2)).Fflags)))
- if !(((int32(type1) & int32(type2)) & MEM_Int) != 0) {
- goto __236
+ pOut = aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp3)*40
+ flags = U16(int32((*Mem)(unsafe.Pointer(pIn1)).Fflags) | int32((*Mem)(unsafe.Pointer(pIn2)).Fflags))
+ if !(int32(type1)&int32(type2)&MEM_Int != 0) {
+ goto __238
}
- iA = *(*I64)(unsafe.Pointer(pIn1 /* &.u */))
- *(*I64)(unsafe.Pointer(bp + 176 /* iB */)) = *(*I64)(unsafe.Pointer(pIn2 /* &.u */))
+ iA = *(*I64)(unsafe.Pointer(pIn1))
+ *(*I64)(unsafe.Pointer(bp + 208 /* iB */)) = *(*I64)(unsafe.Pointer(pIn2))
switch int32((*Op)(unsafe.Pointer(pOp)).Fopcode) {
case OP_Add:
- goto __239
- case OP_Subtract:
- goto __240
- case OP_Multiply:
goto __241
- case OP_Divide:
+ case OP_Subtract:
goto __242
- default:
+ case OP_Multiply:
goto __243
- }
- goto __238
-__239:
- if !(Xsqlite3AddInt64(tls, bp+176 /* &iB */, iA) != 0) {
+ case OP_Divide:
goto __244
- }
- goto fp_math
-__244:
- ;
- goto __238
-__240:
- if !(Xsqlite3SubInt64(tls, bp+176 /* &iB */, iA) != 0) {
+ default:
goto __245
}
- goto fp_math
-__245:
- ;
- goto __238
+ goto __240
__241:
- if !(Xsqlite3MulInt64(tls, bp+176 /* &iB */, iA) != 0) {
+ if !(Xsqlite3AddInt64(tls, bp+208, iA) != 0) {
goto __246
}
goto fp_math
__246:
;
- goto __238
+ goto __240
__242:
- if !(iA == int64(0)) {
+ if !(Xsqlite3SubInt64(tls, bp+208, iA) != 0) {
goto __247
}
- goto arithmetic_result_is_null
+ goto fp_math
__247:
;
- if !((iA == int64(-1)) && (*(*I64)(unsafe.Pointer(bp + 176 /* iB */)) == ((int64(-1)) - (int64(0xffffffff) | (I64((int64(0x7fffffff))) << 32))))) {
+ goto __240
+__243:
+ if !(Xsqlite3MulInt64(tls, bp+208, iA) != 0) {
goto __248
}
goto fp_math
__248:
;
- *(*I64)(unsafe.Pointer(bp + 176 /* iB */)) /= iA
- goto __238
-
-__243:
+ goto __240
+__244:
if !(iA == int64(0)) {
goto __249
}
goto arithmetic_result_is_null
__249:
;
- if !(iA == int64(-1)) {
+ if !(iA == int64(-1) && *(*I64)(unsafe.Pointer(bp + 208)) == int64(-1)-(int64(0xffffffff)|I64(int64(0x7fffffff))<<32)) {
goto __250
}
- iA = int64(1)
+ goto fp_math
__250:
;
- *(*I64)(unsafe.Pointer(bp + 176 /* iB */)) %= iA
- goto __238
+ *(*I64)(unsafe.Pointer(bp + 208 /* iB */)) /= iA
+ goto __240
-__238:
- ;
- *(*I64)(unsafe.Pointer(pOut /* &.u */)) = *(*I64)(unsafe.Pointer(bp + 176 /* iB */))
- (*Mem)(unsafe.Pointer(pOut)).Fflags = (U16((int32((*Mem)(unsafe.Pointer((pOut))).Fflags) & libc.CplInt32((MEM_TypeMask | MEM_Zero))) | MEM_Int))
- goto __237
-__236:
- if !((int32(flags) & MEM_Null) != 0) {
+__245:
+ if !(iA == int64(0)) {
goto __251
}
goto arithmetic_result_is_null
- goto __252
__251:
+ ;
+ if !(iA == int64(-1)) {
+ goto __252
+ }
+ iA = int64(1)
+__252:
+ ;
+ *(*I64)(unsafe.Pointer(bp + 208 /* iB */)) %= iA
+ goto __240
+
+__240:
+ ;
+ *(*I64)(unsafe.Pointer(pOut)) = *(*I64)(unsafe.Pointer(bp + 208 /* iB */))
+ (*Mem)(unsafe.Pointer(pOut)).Fflags = U16(int32((*Mem)(unsafe.Pointer(pOut)).Fflags)&libc.CplInt32(MEM_TypeMask|MEM_Zero) | MEM_Int)
+ goto __239
+__238:
+ if !(int32(flags)&MEM_Null != 0) {
+ goto __253
+ }
+ goto arithmetic_result_is_null
+ goto __254
+__253:
fp_math:
rA = Xsqlite3VdbeRealValue(tls, pIn1)
rB = Xsqlite3VdbeRealValue(tls, pIn2)
switch int32((*Op)(unsafe.Pointer(pOp)).Fopcode) {
case OP_Add:
- goto __254
+ goto __256
case OP_Subtract:
- goto __255
+ goto __257
case OP_Multiply:
- goto __256
+ goto __258
case OP_Divide:
- goto __257
+ goto __259
default:
- goto __258
+ goto __260
}
- goto __253
-__254:
- rB = rB + (rA)
- goto __253
-__255:
- rB = rB - (rA)
- goto __253
+ goto __255
__256:
- rB = rB * (rA)
- goto __253
+ rB = rB + rA
+ goto __255
__257:
+ rB = rB - rA
+ goto __255
+__258:
+ rB = rB * rA
+ goto __255
+__259:
// (double)0 In case of SQLITE_OMIT_FLOATING_POINT...
if !(rA == float64(0)) {
- goto __259
+ goto __261
}
goto arithmetic_result_is_null
-__259:
+__261:
;
- rB = rB / (rA)
- goto __253
+ rB = rB / rA
+ goto __255
-__258:
+__260:
iA = Xsqlite3VdbeIntValue(tls, pIn1)
- *(*I64)(unsafe.Pointer(bp + 176 /* iB */)) = Xsqlite3VdbeIntValue(tls, pIn2)
+ *(*I64)(unsafe.Pointer(bp + 208 /* iB */)) = Xsqlite3VdbeIntValue(tls, pIn2)
if !(iA == int64(0)) {
- goto __260
+ goto __262
}
goto arithmetic_result_is_null
-__260:
+__262:
;
if !(iA == int64(-1)) {
- goto __261
+ goto __263
}
iA = int64(1)
-__261:
+__263:
;
- rB = (float64(*(*I64)(unsafe.Pointer(bp + 176 /* iB */)) % iA))
- goto __253
+ rB = float64(*(*I64)(unsafe.Pointer(bp + 208)) % iA)
+ goto __255
-__253:
+__255:
;
if !(Xsqlite3IsNaN(tls, rB) != 0) {
- goto __262
+ goto __264
}
goto arithmetic_result_is_null
-__262:
+__264:
;
- *(*float64)(unsafe.Pointer(pOut /* &.u */)) = rB
- (*Mem)(unsafe.Pointer(pOut)).Fflags = (U16((int32((*Mem)(unsafe.Pointer((pOut))).Fflags) & libc.CplInt32((MEM_TypeMask | MEM_Zero))) | MEM_Real))
-__252:
+ *(*float64)(unsafe.Pointer(pOut)) = rB
+ (*Mem)(unsafe.Pointer(pOut)).Fflags = U16(int32((*Mem)(unsafe.Pointer(pOut)).Fflags)&libc.CplInt32(MEM_TypeMask|MEM_Zero) | MEM_Real)
+__254:
;
-__237:
+__239:
;
goto __8
@@ -67214,10 +67992,10 @@ arithmetic_result_is_null:
__38:
;
if !((*Op)(unsafe.Pointer(pOp)).Fp1 != 0) {
- goto __263
+ goto __265
}
- Xsqlite3VdbeMemSetInt64(tls, (aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*40), int64(0))
-__263:
+ Xsqlite3VdbeMemSetInt64(tls, aMem+uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*40, int64(0))
+__265:
;
goto __8
@@ -67252,87 +68030,87 @@ __40: // same as TK_BITOR, in1, in2, out3
__41: // same as TK_LSHIFT, in1, in2, out3
__42:
- pIn1 = (aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*40)
- pIn2 = (aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp2)*40)
- pOut = (aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp3)*40)
- if !(((int32((*Mem)(unsafe.Pointer(pIn1)).Fflags) | int32((*Mem)(unsafe.Pointer(pIn2)).Fflags)) & MEM_Null) != 0) {
- goto __264
+ pIn1 = aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*40
+ pIn2 = aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp2)*40
+ pOut = aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp3)*40
+ if !((int32((*Mem)(unsafe.Pointer(pIn1)).Fflags)|int32((*Mem)(unsafe.Pointer(pIn2)).Fflags))&MEM_Null != 0) {
+ goto __266
}
Xsqlite3VdbeMemSetNull(tls, pOut)
goto __8
-__264:
+__266:
;
- *(*I64)(unsafe.Pointer(bp + 192 /* iA1 */)) = Xsqlite3VdbeIntValue(tls, pIn2)
+ *(*I64)(unsafe.Pointer(bp + 224 /* iA1 */)) = Xsqlite3VdbeIntValue(tls, pIn2)
iB1 = Xsqlite3VdbeIntValue(tls, pIn1)
op = (*Op)(unsafe.Pointer(pOp)).Fopcode
if !(int32(op) == OP_BitAnd) {
- goto __265
- }
- *(*I64)(unsafe.Pointer(bp + 192 /* iA1 */)) &= iB1
- goto __266
-__265:
- if !(int32(op) == OP_BitOr) {
goto __267
}
- *(*I64)(unsafe.Pointer(bp + 192 /* iA1 */)) |= iB1
+ *(*I64)(unsafe.Pointer(bp + 224 /* iA1 */)) &= iB1
goto __268
__267:
- if !(iB1 != int64(0)) {
+ if !(int32(op) == OP_BitOr) {
goto __269
}
+ *(*I64)(unsafe.Pointer(bp + 224 /* iA1 */)) |= iB1
+ goto __270
+__269:
+ if !(iB1 != int64(0)) {
+ goto __271
+ }
// If shifting by a negative amount, shift in the other direction
if !(iB1 < int64(0)) {
- goto __270
+ goto __272
}
- op = (U8(((2 * OP_ShiftLeft) + 1) - int32(op)))
- if iB1 > (int64(-64)) {
+ op = U8(2*OP_ShiftLeft + 1 - int32(op))
+ if iB1 > int64(-64) {
iB1 = -iB1
} else {
iB1 = int64(64)
}
-__270:
+__272:
;
if !(iB1 >= int64(64)) {
- goto __271
+ goto __273
}
- if (*(*I64)(unsafe.Pointer(bp + 192 /* iA1 */)) >= int64(0)) || (int32(op) == OP_ShiftLeft) {
- *(*I64)(unsafe.Pointer(bp + 192 /* iA1 */)) = int64(0)
+ if *(*I64)(unsafe.Pointer(bp + 224)) >= int64(0) || int32(op) == OP_ShiftLeft {
+ *(*I64)(unsafe.Pointer(bp + 224 /* iA1 */)) = int64(0)
} else {
- *(*I64)(unsafe.Pointer(bp + 192 /* iA1 */)) = int64(-1)
+ *(*I64)(unsafe.Pointer(bp + 224 /* iA1 */)) = int64(-1)
}
- goto __272
-__271:
- libc.Xmemcpy(tls, bp+184 /* &uA */, bp+192 /* &iA1 */, uint32(unsafe.Sizeof(U64(0))))
- if !(int32(op) == OP_ShiftLeft) {
- goto __273
- }
- *(*U64)(unsafe.Pointer(bp + 184 /* uA */)) <<= iB1
goto __274
__273:
- *(*U64)(unsafe.Pointer(bp + 184 /* uA */)) >>= iB1
- // Sign-extend on a right shift of a negative number
- if !(*(*I64)(unsafe.Pointer(bp + 192 /* iA1 */)) < int64(0)) {
+ libc.Xmemcpy(tls, bp+216 /* &uA */, bp+224 /* &iA1 */, uint32(unsafe.Sizeof(U64(0))))
+ if !(int32(op) == OP_ShiftLeft) {
goto __275
}
- *(*U64)(unsafe.Pointer(bp + 184 /* uA */)) |= (U64(((U64((uint64(0xffffffff))) << 32) | uint64(0xffffffff))) << (int64(64) - iB1))
+ *(*U64)(unsafe.Pointer(bp + 216 /* uA */)) <<= iB1
+ goto __276
__275:
+ *(*U64)(unsafe.Pointer(bp + 216 /* uA */)) >>= iB1
+ // Sign-extend on a right shift of a negative number
+ if !(*(*I64)(unsafe.Pointer(bp + 224)) < int64(0)) {
+ goto __277
+ }
+ *(*U64)(unsafe.Pointer(bp + 216 /* uA */)) |= U64(U64(uint64(0xffffffff))<<32|uint64(0xffffffff)) << (int64(64) - iB1)
+__277:
;
+__276:
+ ;
+ libc.Xmemcpy(tls, bp+224 /* &iA1 */, bp+216 /* &uA */, uint32(unsafe.Sizeof(I64(0))))
__274:
;
- libc.Xmemcpy(tls, bp+192 /* &iA1 */, bp+184 /* &uA */, uint32(unsafe.Sizeof(I64(0))))
-__272:
+__271:
;
-__269:
+__270:
;
__268:
;
-__266:
- ;
- *(*I64)(unsafe.Pointer(pOut /* &.u */)) = *(*I64)(unsafe.Pointer(bp + 192 /* iA1 */))
- (*Mem)(unsafe.Pointer(pOut)).Fflags = (U16((int32((*Mem)(unsafe.Pointer((pOut))).Fflags) & libc.CplInt32((MEM_TypeMask | MEM_Zero))) | MEM_Int))
+ *(*I64)(unsafe.Pointer(pOut)) = *(*I64)(unsafe.Pointer(bp + 224 /* iA1 */))
+ (*Mem)(unsafe.Pointer(pOut)).Fflags = U16(int32((*Mem)(unsafe.Pointer(pOut)).Fflags)&libc.CplInt32(MEM_TypeMask|MEM_Zero) | MEM_Int)
goto __8
// Opcode: AddImm P1 P2 * * *
@@ -67343,10 +68121,10 @@ __266:
//
// To force any register to be an integer, just add 0.
__43: // in1
- pIn1 = (aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*40)
+ pIn1 = aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*40
Xsqlite3VdbeMemIntegerify(tls, pIn1)
- *(*I64)(unsafe.Pointer(pIn1 /* &.u */ /* &.i */)) += (I64((*Op)(unsafe.Pointer(pOp)).Fp2))
+ *(*I64)(unsafe.Pointer(pIn1)) += I64((*Op)(unsafe.Pointer(pOp)).Fp2)
goto __8
// Opcode: MustBeInt P1 P2 * * *
@@ -67356,31 +68134,31 @@ __43: // in1
// without data loss, then jump immediately to P2, or if P2==0
// raise an SQLITE_MISMATCH exception.
__44: // jump, in1
- pIn1 = (aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*40)
- if !((int32((*Mem)(unsafe.Pointer(pIn1)).Fflags) & MEM_Int) == 0) {
- goto __276
+ pIn1 = aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*40
+ if !(int32((*Mem)(unsafe.Pointer(pIn1)).Fflags)&MEM_Int == 0) {
+ goto __278
}
applyAffinity(tls, pIn1, uint8(SQLITE_AFF_NUMERIC), encoding)
- if !((int32((*Mem)(unsafe.Pointer(pIn1)).Fflags) & MEM_Int) == 0) {
- goto __277
+ if !(int32((*Mem)(unsafe.Pointer(pIn1)).Fflags)&MEM_Int == 0) {
+ goto __279
}
if !((*Op)(unsafe.Pointer(pOp)).Fp2 == 0) {
- goto __278
+ goto __280
}
rc = SQLITE_MISMATCH
goto abort_due_to_error
- goto __279
-__278:
+ goto __281
+__280:
goto jump_to_p2
-__279:
+__281:
;
-__277:
+__279:
;
-__276:
+__278:
;
- (*Mem)(unsafe.Pointer(pIn1)).Fflags = (U16((int32((*Mem)(unsafe.Pointer((pIn1))).Fflags) & libc.CplInt32((MEM_TypeMask | MEM_Zero))) | MEM_Int))
+ (*Mem)(unsafe.Pointer(pIn1)).Fflags = U16(int32((*Mem)(unsafe.Pointer(pIn1)).Fflags)&libc.CplInt32(MEM_TypeMask|MEM_Zero) | MEM_Int)
goto __8
// Opcode: RealAffinity P1 * * * *
@@ -67392,14 +68170,14 @@ __276:
// integers, for space efficiency, but after extraction we want them
// to have only a real value.
__45: // in1
- pIn1 = (aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*40)
- if !((int32((*Mem)(unsafe.Pointer(pIn1)).Fflags) & (MEM_Int | MEM_IntReal)) != 0) {
- goto __280
+ pIn1 = aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*40
+ if !(int32((*Mem)(unsafe.Pointer(pIn1)).Fflags)&(MEM_Int|MEM_IntReal) != 0) {
+ goto __282
}
Xsqlite3VdbeMemRealify(tls, pIn1)
-__280:
+__282:
;
goto __8
@@ -67420,26 +68198,26 @@ __280:
__46: // in1
;
- pIn1 = (aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*40)
+ pIn1 = aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*40
rc = func() int32 {
- if (int32((*Mem)(unsafe.Pointer((pIn1))).Fflags) & MEM_Zero) != 0 {
+ if int32((*Mem)(unsafe.Pointer(pIn1)).Fflags)&MEM_Zero != 0 {
return Xsqlite3VdbeMemExpandBlob(tls, pIn1)
}
return 0
}()
if !(rc != 0) {
- goto __281
+ goto __283
}
goto abort_due_to_error
-__281:
+__283:
;
rc = Xsqlite3VdbeMemCast(tls, pIn1, uint8((*Op)(unsafe.Pointer(pOp)).Fp2), encoding)
if !(rc != 0) {
- goto __282
+ goto __284
}
goto abort_due_to_error
-__282:
+__284:
;
goto __8
@@ -67537,162 +68315,162 @@ __50: // same as TK_LE, jump, in1, in3
__51: // same as TK_GT, jump, in1, in3
__52: // Copy of initial value of pIn3->flags
- pIn1 = (aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*40)
- pIn3 = (aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp3)*40)
+ pIn1 = aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*40
+ pIn3 = aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp3)*40
flags11 = (*Mem)(unsafe.Pointer(pIn1)).Fflags
flags3 = (*Mem)(unsafe.Pointer(pIn3)).Fflags
- if !(((int32(flags11) & int32(flags3)) & MEM_Int) != 0) {
- goto __283
+ if !(int32(flags11)&int32(flags3)&MEM_Int != 0) {
+ goto __285
}
// Common case of comparison of two integers
- if !(*(*I64)(unsafe.Pointer(pIn3 /* &.u */)) > *(*I64)(unsafe.Pointer(pIn1 /* &.u */))) {
- goto __284
+ if !(*(*I64)(unsafe.Pointer(pIn3)) > *(*I64)(unsafe.Pointer(pIn1))) {
+ goto __286
}
iCompare = +1
if !(*(*uint8)(unsafe.Pointer(Xsqlite3aGTb + uintptr((*Op)(unsafe.Pointer(pOp)).Fopcode))) != 0) {
- goto __286
+ goto __288
}
goto jump_to_p2
-__286:
+__288:
;
- goto __285
-__284:
- if !(*(*I64)(unsafe.Pointer(pIn3 /* &.u */)) < *(*I64)(unsafe.Pointer(pIn1 /* &.u */))) {
- goto __287
+ goto __287
+__286:
+ if !(*(*I64)(unsafe.Pointer(pIn3)) < *(*I64)(unsafe.Pointer(pIn1))) {
+ goto __289
}
iCompare = -1
if !(*(*uint8)(unsafe.Pointer(Xsqlite3aLTb + uintptr((*Op)(unsafe.Pointer(pOp)).Fopcode))) != 0) {
- goto __289
+ goto __291
}
goto jump_to_p2
-__289:
+__291:
;
- goto __288
-__287:
+ goto __290
+__289:
iCompare = 0
if !(*(*uint8)(unsafe.Pointer(Xsqlite3aEQb + uintptr((*Op)(unsafe.Pointer(pOp)).Fopcode))) != 0) {
- goto __290
+ goto __292
}
goto jump_to_p2
-__290:
+__292:
;
-__288:
+__290:
;
-__285:
+__287:
;
goto __8
-__283:
+__285:
;
- if !(((int32(flags11) | int32(flags3)) & MEM_Null) != 0) {
- goto __291
+ if !((int32(flags11)|int32(flags3))&MEM_Null != 0) {
+ goto __293
}
// One or both operands are NULL
- if !((int32((*Op)(unsafe.Pointer(pOp)).Fp5) & SQLITE_NULLEQ) != 0) {
- goto __293
+ if !(int32((*Op)(unsafe.Pointer(pOp)).Fp5)&SQLITE_NULLEQ != 0) {
+ goto __295
}
// If SQLITE_NULLEQ is set (which will only happen if the operator is
// OP_Eq or OP_Ne) then take the jump or not depending on whether
// or not both operands are null.
- if !((((int32(flags11) & int32(flags3)) & MEM_Null) != 0) &&
- ((int32(flags3) & MEM_Cleared) == 0)) {
- goto __295
+ if !(int32(flags11)&int32(flags3)&MEM_Null != 0 &&
+ int32(flags3)&MEM_Cleared == 0) {
+ goto __297
}
res = 0 // Operands are equal
- goto __296
-__295:
+ goto __298
+__297:
res = func() int32 {
- if (int32(flags3) & MEM_Null) != 0 {
+ if int32(flags3)&MEM_Null != 0 {
return -1
}
return +1
}() // Operands are not equal
-__296:
+__298:
;
- goto __294
-__293:
+ goto __296
+__295:
// SQLITE_NULLEQ is clear and at least one operand is NULL,
// then the result is always NULL.
// The jump is taken if the SQLITE_JUMPIFNULL bit is set.
iCompare = 1 // Operands are not equal
- if !((int32((*Op)(unsafe.Pointer(pOp)).Fp5) & SQLITE_JUMPIFNULL) != 0) {
- goto __297
+ if !(int32((*Op)(unsafe.Pointer(pOp)).Fp5)&SQLITE_JUMPIFNULL != 0) {
+ goto __299
}
goto jump_to_p2
-__297:
+__299:
;
goto __8
-__294:
+__296:
;
- goto __292
-__291:
+ goto __294
+__293:
// Neither operand is NULL and we couldn't do the special high-speed
// integer comparison case. So do a general-case comparison.
- affinity = (uint8(int32((*Op)(unsafe.Pointer(pOp)).Fp5) & SQLITE_AFF_MASK))
+ affinity = uint8(int32((*Op)(unsafe.Pointer(pOp)).Fp5) & SQLITE_AFF_MASK)
if !(int32(affinity) >= SQLITE_AFF_NUMERIC) {
- goto __298
- }
- if !(((int32(flags11) | int32(flags3)) & MEM_Str) != 0) {
goto __300
}
- if !((int32(flags11) & (((MEM_Int | MEM_IntReal) | MEM_Real) | MEM_Str)) == MEM_Str) {
- goto __301
+ if !((int32(flags11)|int32(flags3))&MEM_Str != 0) {
+ goto __302
+ }
+ if !(int32(flags11)&(MEM_Int|MEM_IntReal|MEM_Real|MEM_Str) == MEM_Str) {
+ goto __303
}
applyNumericAffinity(tls, pIn1, 0)
flags3 = (*Mem)(unsafe.Pointer(pIn3)).Fflags
-__301:
+__303:
;
- if !((int32(flags3) & (((MEM_Int | MEM_IntReal) | MEM_Real) | MEM_Str)) == MEM_Str) {
- goto __302
+ if !(int32(flags3)&(MEM_Int|MEM_IntReal|MEM_Real|MEM_Str) == MEM_Str) {
+ goto __304
}
applyNumericAffinity(tls, pIn3, 0)
+__304:
+ ;
__302:
;
+ goto __301
__300:
- ;
- goto __299
-__298:
if !(int32(affinity) == SQLITE_AFF_TEXT) {
- goto __303
+ goto __305
}
- if !(((int32(flags11) & MEM_Str) == 0) && ((int32(flags11) & ((MEM_Int | MEM_Real) | MEM_IntReal)) != 0)) {
- goto __304
+ if !(int32(flags11)&MEM_Str == 0 && int32(flags11)&(MEM_Int|MEM_Real|MEM_IntReal) != 0) {
+ goto __306
}
Xsqlite3VdbeMemStringify(tls, pIn1, encoding, uint8(1))
- flags11 = (U16((int32((*Mem)(unsafe.Pointer(pIn1)).Fflags) & libc.CplInt32(MEM_TypeMask)) | (int32(flags11) & MEM_TypeMask)))
+ flags11 = U16(int32((*Mem)(unsafe.Pointer(pIn1)).Fflags)&libc.CplInt32(MEM_TypeMask) | int32(flags11)&MEM_TypeMask)
if !(pIn1 == pIn3) {
- goto __305
+ goto __307
}
- flags3 = (U16(int32(flags11) | MEM_Str))
-__305:
+ flags3 = U16(int32(flags11) | MEM_Str)
+__307:
;
-__304:
+__306:
;
- if !(((int32(flags3) & MEM_Str) == 0) && ((int32(flags3) & ((MEM_Int | MEM_Real) | MEM_IntReal)) != 0)) {
- goto __306
+ if !(int32(flags3)&MEM_Str == 0 && int32(flags3)&(MEM_Int|MEM_Real|MEM_IntReal) != 0) {
+ goto __308
}
Xsqlite3VdbeMemStringify(tls, pIn3, encoding, uint8(1))
- flags3 = (U16((int32((*Mem)(unsafe.Pointer(pIn3)).Fflags) & libc.CplInt32(MEM_TypeMask)) | (int32(flags3) & MEM_TypeMask)))
-__306:
+ flags3 = U16(int32((*Mem)(unsafe.Pointer(pIn3)).Fflags)&libc.CplInt32(MEM_TypeMask) | int32(flags3)&MEM_TypeMask)
+__308:
;
-__303:
+__305:
;
-__299:
+__301:
;
- res = Xsqlite3MemCompare(tls, pIn3, pIn1, *(*uintptr)(unsafe.Pointer(pOp + 16 /* &.p4 */)))
-__292:
+ res = Xsqlite3MemCompare(tls, pIn3, pIn1, *(*uintptr)(unsafe.Pointer(pOp + 16)))
+__294:
;
// At this point, res is negative, zero, or positive if reg[P1] is
@@ -67703,21 +68481,21 @@ __292:
// order: NE, EQ, GT, LE, LT, GE
if !(res < 0) {
- goto __307
+ goto __309
}
res2 = int32(*(*uint8)(unsafe.Pointer(Xsqlite3aLTb + uintptr((*Op)(unsafe.Pointer(pOp)).Fopcode))))
- goto __308
-__307:
+ goto __310
+__309:
if !(res == 0) {
- goto __309
+ goto __311
}
res2 = int32(*(*uint8)(unsafe.Pointer(Xsqlite3aEQb + uintptr((*Op)(unsafe.Pointer(pOp)).Fopcode))))
- goto __310
-__309:
+ goto __312
+__311:
res2 = int32(*(*uint8)(unsafe.Pointer(Xsqlite3aGTb + uintptr((*Op)(unsafe.Pointer(pOp)).Fopcode))))
-__310:
+__312:
;
-__308:
+__310:
;
iCompare = res
@@ -67728,10 +68506,10 @@ __308:
(*Mem)(unsafe.Pointer(pIn1)).Fflags = flags11
if !(res2 != 0) {
- goto __311
+ goto __313
}
goto jump_to_p2
-__311:
+__313:
;
goto __8
@@ -67750,10 +68528,10 @@ __53: // same as TK_ESCAPE, jump
;
if !(iCompare == 0) {
- goto __312
+ goto __314
}
goto jump_to_p2
-__312:
+__314:
;
goto __8
@@ -67794,27 +68572,27 @@ __54:
// and strings are less than blobs.
__55: // The permutation
- if !((int32((*Op)(unsafe.Pointer(pOp)).Fp5) & OPFLAG_PERMUTE) == 0) {
- goto __313
+ if !(int32((*Op)(unsafe.Pointer(pOp)).Fp5)&OPFLAG_PERMUTE == 0) {
+ goto __315
}
aPermute = uintptr(0)
- goto __314
-__313:
+ goto __316
+__315:
;
- aPermute = (*(*uintptr)(unsafe.Pointer(pOp + libc.UintptrFromInt32(-1)*20 + 16 /* &.p4 */)) + uintptr(1)*4)
+ aPermute = *(*uintptr)(unsafe.Pointer(pOp + libc.UintptrFromInt32(-1)*20 + 16)) + uintptr(1)*4
-__314:
+__316:
;
n2 = (*Op)(unsafe.Pointer(pOp)).Fp3
- pKeyInfo = *(*uintptr)(unsafe.Pointer(pOp + 16 /* &.p4 */))
+ pKeyInfo = *(*uintptr)(unsafe.Pointer(pOp + 16))
p11 = (*Op)(unsafe.Pointer(pOp)).Fp1
p21 = (*Op)(unsafe.Pointer(pOp)).Fp2
i1 = 0
-__315:
+__317:
if !(i1 < n2) {
- goto __317
+ goto __319
}
if aPermute != 0 {
idx = *(*U32)(unsafe.Pointer(aPermute + uintptr(i1)*4))
@@ -67822,34 +68600,34 @@ __315:
idx = U32(i1)
}
- pColl = *(*uintptr)(unsafe.Pointer((pKeyInfo + 20 /* &.aColl */) + uintptr(i1)*4))
- bRev = (int32(*(*U8)(unsafe.Pointer((*KeyInfo)(unsafe.Pointer(pKeyInfo)).FaSortFlags + uintptr(i1)))) & KEYINFO_ORDER_DESC)
- iCompare = Xsqlite3MemCompare(tls, (aMem + uintptr((U32(p11)+idx))*40), (aMem + uintptr((U32(p21)+idx))*40), pColl)
+ pColl = *(*uintptr)(unsafe.Pointer(pKeyInfo + 20 + uintptr(i1)*4))
+ bRev = int32(*(*U8)(unsafe.Pointer((*KeyInfo)(unsafe.Pointer(pKeyInfo)).FaSortFlags + uintptr(i1)))) & KEYINFO_ORDER_DESC
+ iCompare = Xsqlite3MemCompare(tls, aMem+uintptr(U32(p11)+idx)*40, aMem+uintptr(U32(p21)+idx)*40, pColl)
if !(iCompare != 0) {
- goto __318
+ goto __320
}
- if !(((int32(*(*U8)(unsafe.Pointer((*KeyInfo)(unsafe.Pointer(pKeyInfo)).FaSortFlags + uintptr(i1)))) & KEYINFO_ORDER_BIGNULL) != 0) &&
- (((int32((*Mem)(unsafe.Pointer(aMem+uintptr((U32(p11)+idx))*40)).Fflags) & MEM_Null) != 0) || ((int32((*Mem)(unsafe.Pointer(aMem+uintptr((U32(p21)+idx))*40)).Fflags) & MEM_Null) != 0))) {
- goto __319
+ if !(int32(*(*U8)(unsafe.Pointer((*KeyInfo)(unsafe.Pointer(pKeyInfo)).FaSortFlags + uintptr(i1))))&KEYINFO_ORDER_BIGNULL != 0 &&
+ (int32((*Mem)(unsafe.Pointer(aMem+uintptr(U32(p11)+idx)*40)).Fflags)&MEM_Null != 0 || int32((*Mem)(unsafe.Pointer(aMem+uintptr(U32(p21)+idx)*40)).Fflags)&MEM_Null != 0)) {
+ goto __321
}
iCompare = -iCompare
-__319:
+__321:
;
if !(bRev != 0) {
- goto __320
+ goto __322
}
iCompare = -iCompare
+__322:
+ ;
+ goto __319
__320:
;
- goto __317
+ goto __318
__318:
- ;
- goto __316
-__316:
i1++
- goto __315
goto __317
-__317:
+ goto __319
+__319:
;
goto __8
@@ -67860,22 +68638,22 @@ __317:
// equal to, or greater than the P2 vector, respectively.
__56: // jump
if !(iCompare < 0) {
- goto __321
- }
- pOp = (aOp + uintptr(((*Op)(unsafe.Pointer(pOp)).Fp1-1))*20)
- goto __322
-__321:
- if !(iCompare == 0) {
goto __323
}
- pOp = (aOp + uintptr(((*Op)(unsafe.Pointer(pOp)).Fp2-1))*20)
+ pOp = aOp + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1-1)*20
goto __324
__323:
+ if !(iCompare == 0) {
+ goto __325
+ }
+ pOp = aOp + uintptr((*Op)(unsafe.Pointer(pOp)).Fp2-1)*20
+ goto __326
+__325:
;
- pOp = (aOp + uintptr(((*Op)(unsafe.Pointer(pOp)).Fp3-1))*20)
-__324:
+ pOp = aOp + uintptr((*Op)(unsafe.Pointer(pOp)).Fp3-1)*20
+__326:
;
-__322:
+__324:
;
goto __8
@@ -67900,28 +68678,28 @@ __322:
__57: // same as TK_AND, in1, in2, out3
__58: // Right operand: 0==FALSE, 1==TRUE, 2==UNKNOWN or NULL
- v1 = Xsqlite3VdbeBooleanValue(tls, (aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*40), 2)
- v2 = Xsqlite3VdbeBooleanValue(tls, (aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp2)*40), 2)
+ v1 = Xsqlite3VdbeBooleanValue(tls, aMem+uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*40, 2)
+ v2 = Xsqlite3VdbeBooleanValue(tls, aMem+uintptr((*Op)(unsafe.Pointer(pOp)).Fp2)*40, 2)
if !(int32((*Op)(unsafe.Pointer(pOp)).Fopcode) == OP_And) {
- goto __325
- }
- v1 = int32(and_logic[((v1 * 3) + v2)])
- goto __326
-__325:
- v1 = int32(or_logic[((v1 * 3) + v2)])
-__326:
- ;
- pOut = (aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp3)*40)
- if !(v1 == 2) {
goto __327
}
- (*Mem)(unsafe.Pointer(pOut)).Fflags = (U16((int32((*Mem)(unsafe.Pointer((pOut))).Fflags) & libc.CplInt32((MEM_TypeMask | MEM_Zero))) | MEM_Null))
+ v1 = int32(and_logic[v1*3+v2])
goto __328
__327:
- *(*I64)(unsafe.Pointer(pOut /* &.u */)) = I64(v1)
- (*Mem)(unsafe.Pointer(pOut)).Fflags = (U16((int32((*Mem)(unsafe.Pointer((pOut))).Fflags) & libc.CplInt32((MEM_TypeMask | MEM_Zero))) | MEM_Int))
+ v1 = int32(or_logic[v1*3+v2])
__328:
;
+ pOut = aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp3)*40
+ if !(v1 == 2) {
+ goto __329
+ }
+ (*Mem)(unsafe.Pointer(pOut)).Fflags = U16(int32((*Mem)(unsafe.Pointer(pOut)).Fflags)&libc.CplInt32(MEM_TypeMask|MEM_Zero) | MEM_Null)
+ goto __330
+__329:
+ *(*I64)(unsafe.Pointer(pOut)) = I64(v1)
+ (*Mem)(unsafe.Pointer(pOut)).Fflags = U16(int32((*Mem)(unsafe.Pointer(pOut)).Fflags)&libc.CplInt32(MEM_TypeMask|MEM_Zero) | MEM_Int)
+__330:
+ ;
goto __8
// Opcode: IsTrue P1 P2 P3 P4 *
@@ -67946,8 +68724,8 @@ __328:
__59: // in1, out2
;
- Xsqlite3VdbeMemSetInt64(tls, (aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp2)*40),
- (int64(Xsqlite3VdbeBooleanValue(tls, (aMem+uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*40), (*Op)(unsafe.Pointer(pOp)).Fp3) ^ *(*int32)(unsafe.Pointer(pOp + 16 /* &.p4 */)))))
+ Xsqlite3VdbeMemSetInt64(tls, aMem+uintptr((*Op)(unsafe.Pointer(pOp)).Fp2)*40,
+ int64(Xsqlite3VdbeBooleanValue(tls, aMem+uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*40, (*Op)(unsafe.Pointer(pOp)).Fp3)^*(*int32)(unsafe.Pointer(pOp + 16))))
goto __8
// Opcode: Not P1 P2 * * *
@@ -67957,16 +68735,16 @@ __59: // in1, out2
// boolean complement in register P2. If the value in register P1 is
// NULL, then a NULL is stored in P2.
__60: // same as TK_NOT, in1, out2
- pIn1 = (aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*40)
- pOut = (aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp2)*40)
- if !((int32((*Mem)(unsafe.Pointer(pIn1)).Fflags) & MEM_Null) == 0) {
- goto __329
+ pIn1 = aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*40
+ pOut = aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp2)*40
+ if !(int32((*Mem)(unsafe.Pointer(pIn1)).Fflags)&MEM_Null == 0) {
+ goto __331
}
Xsqlite3VdbeMemSetInt64(tls, pOut, libc.BoolInt64(!(Xsqlite3VdbeBooleanValue(tls, pIn1, 0) != 0)))
- goto __330
-__329:
+ goto __332
+__331:
Xsqlite3VdbeMemSetNull(tls, pOut)
-__330:
+__332:
;
goto __8
@@ -67977,15 +68755,15 @@ __330:
// ones-complement of the P1 value into register P2. If P1 holds
// a NULL then store a NULL in P2.
__61: // same as TK_BITNOT, in1, out2
- pIn1 = (aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*40)
- pOut = (aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp2)*40)
+ pIn1 = aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*40
+ pOut = aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp2)*40
Xsqlite3VdbeMemSetNull(tls, pOut)
- if !((int32((*Mem)(unsafe.Pointer(pIn1)).Fflags) & MEM_Null) == 0) {
- goto __331
+ if !(int32((*Mem)(unsafe.Pointer(pIn1)).Fflags)&MEM_Null == 0) {
+ goto __333
}
(*Mem)(unsafe.Pointer(pOut)).Fflags = U16(MEM_Int)
- *(*I64)(unsafe.Pointer(pOut /* &.u */)) = ^Xsqlite3VdbeIntValue(tls, pIn1)
-__331:
+ *(*I64)(unsafe.Pointer(pOut)) = ^Xsqlite3VdbeIntValue(tls, pIn1)
+__333:
;
goto __8
@@ -68008,27 +68786,27 @@ __331:
__62: // Address of this instruction
;
if !((*Vdbe)(unsafe.Pointer(p)).FpFrame != 0) {
- goto __332
- }
- iAddr = U32(((int32(pOp) - int32((*Vdbe)(unsafe.Pointer(p)).FaOp)) / 20))
- if !((int32(*(*U8)(unsafe.Pointer((*VdbeFrame)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FpFrame)).FaOnce + uintptr((iAddr / U32(8)))))) & (int32(1) << (iAddr & U32(7)))) != 0) {
goto __334
}
+ iAddr = U32((int32(pOp) - int32((*Vdbe)(unsafe.Pointer(p)).FaOp)) / 20)
+ if !(int32(*(*U8)(unsafe.Pointer((*VdbeFrame)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FpFrame)).FaOnce + uintptr(iAddr/U32(8)))))&(int32(1)<<(iAddr&U32(7))) != 0) {
+ goto __336
+ }
goto jump_to_p2
-__334:
+__336:
;
- *(*U8)(unsafe.Pointer((*VdbeFrame)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FpFrame)).FaOnce + uintptr((iAddr / U32(8))))) |= U8((int32(1) << (iAddr & U32(7))))
- goto __333
-__332:
+ *(*U8)(unsafe.Pointer((*VdbeFrame)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FpFrame)).FaOnce + uintptr(iAddr/U32(8)))) |= U8(int32(1) << (iAddr & U32(7)))
+ goto __335
+__334:
if !((*Op)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FaOp)).Fp1 == (*Op)(unsafe.Pointer(pOp)).Fp1) {
- goto __335
+ goto __337
}
goto jump_to_p2
-__335:
+__337:
;
-__333:
+__335:
;
(*Op)(unsafe.Pointer(pOp)).Fp1 = (*Op)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FaOp)).Fp1
@@ -68040,13 +68818,13 @@ __333:
// is considered true if it is numeric and non-zero. If the value
// in P1 is NULL then take the jump if and only if P3 is non-zero.
__63:
- c = Xsqlite3VdbeBooleanValue(tls, (aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*40), (*Op)(unsafe.Pointer(pOp)).Fp3)
+ c = Xsqlite3VdbeBooleanValue(tls, aMem+uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*40, (*Op)(unsafe.Pointer(pOp)).Fp3)
if !(c != 0) {
- goto __336
+ goto __338
}
goto jump_to_p2
-__336:
+__338:
;
goto __8
@@ -68056,13 +68834,13 @@ __336:
// is considered false if it has a numeric value of zero. If the value
// in P1 is NULL then take the jump if and only if P3 is non-zero.
__64:
- c1 = libc.BoolInt32(!(Xsqlite3VdbeBooleanValue(tls, (aMem+uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*40), libc.BoolInt32(!((*Op)(unsafe.Pointer(pOp)).Fp3 != 0))) != 0))
+ c1 = libc.BoolInt32(!(Xsqlite3VdbeBooleanValue(tls, aMem+uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*40, libc.BoolInt32(!((*Op)(unsafe.Pointer(pOp)).Fp3 != 0))) != 0))
if !(c1 != 0) {
- goto __337
+ goto __339
}
goto jump_to_p2
-__337:
+__339:
;
goto __8
@@ -68071,13 +68849,31 @@ __337:
//
// Jump to P2 if the value in register P1 is NULL.
__65: // same as TK_ISNULL, jump, in1
- pIn1 = (aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*40)
+ pIn1 = aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*40
- if !((int32((*Mem)(unsafe.Pointer(pIn1)).Fflags) & MEM_Null) != 0) {
- goto __338
+ if !(int32((*Mem)(unsafe.Pointer(pIn1)).Fflags)&MEM_Null != 0) {
+ goto __340
}
goto jump_to_p2
-__338:
+__340:
+ ;
+ goto __8
+
+ // Opcode: IsNullOrType P1 P2 P3 * *
+ // Synopsis: if typeof(r[P1]) IN (P3,5) goto P2
+ //
+ // Jump to P2 if the value in register P1 is NULL or has a datatype P3.
+ // P3 is an integer which should be one of SQLITE_INTEGER, SQLITE_FLOAT,
+ // SQLITE_BLOB, SQLITE_NULL, or SQLITE_TEXT.
+__66:
+ pIn1 = aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*40
+ doTheJump = libc.Bool32(int32((*Mem)(unsafe.Pointer(pIn1)).Fflags)&MEM_Null != 0 || Xsqlite3_value_type(tls, pIn1) == (*Op)(unsafe.Pointer(pOp)).Fp3)
+
+ if !(doTheJump != 0) {
+ goto __341
+ }
+ goto jump_to_p2
+__341:
;
goto __8
@@ -68087,16 +68883,16 @@ __338:
// If all both registers P1 and P3 are NOT NULL, then store a zero in
// register P2. If either registers P1 or P3 are NULL then put
// a NULL in register P2.
-__66: // in1, in2, out2, in3
- if !(((int32((*Mem)(unsafe.Pointer(aMem+uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*40)).Fflags) & MEM_Null) != 0) ||
- ((int32((*Mem)(unsafe.Pointer(aMem+uintptr((*Op)(unsafe.Pointer(pOp)).Fp3)*40)).Fflags) & MEM_Null) != 0)) {
- goto __339
+__67: // in1, in2, out2, in3
+ if !(int32((*Mem)(unsafe.Pointer(aMem+uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*40)).Fflags)&MEM_Null != 0 ||
+ int32((*Mem)(unsafe.Pointer(aMem+uintptr((*Op)(unsafe.Pointer(pOp)).Fp3)*40)).Fflags)&MEM_Null != 0) {
+ goto __342
}
- Xsqlite3VdbeMemSetNull(tls, (aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp2)*40))
- goto __340
-__339:
- Xsqlite3VdbeMemSetInt64(tls, (aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp2)*40), int64(0))
-__340:
+ Xsqlite3VdbeMemSetNull(tls, aMem+uintptr((*Op)(unsafe.Pointer(pOp)).Fp2)*40)
+ goto __343
+__342:
+ Xsqlite3VdbeMemSetInt64(tls, aMem+uintptr((*Op)(unsafe.Pointer(pOp)).Fp2)*40, int64(0))
+__343:
;
goto __8
@@ -68104,14 +68900,14 @@ __340:
// Synopsis: if r[P1]!=NULL goto P2
//
// Jump to P2 if the value in register P1 is not NULL.
-__67: // same as TK_NOTNULL, jump, in1
- pIn1 = (aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*40)
+__68: // same as TK_NOTNULL, jump, in1
+ pIn1 = aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*40
- if !((int32((*Mem)(unsafe.Pointer(pIn1)).Fflags) & MEM_Null) == 0) {
- goto __341
+ if !(int32((*Mem)(unsafe.Pointer(pIn1)).Fflags)&MEM_Null == 0) {
+ goto __344
}
goto jump_to_p2
-__341:
+__344:
;
goto __8
@@ -68122,15 +68918,15 @@ __341:
// If it is, then set register P3 to NULL and jump immediately to P2.
// If P1 is not on a NULL row, then fall through without making any
// changes.
-__68: // jump
+__69: // jump
;
if !((*VdbeCursor)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*4)))).FnullRow != 0) {
- goto __342
+ goto __345
}
- Xsqlite3VdbeMemSetNull(tls, (aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp3)*40))
+ Xsqlite3VdbeMemSetNull(tls, aMem+uintptr((*Op)(unsafe.Pointer(pOp)).Fp3)*40)
goto jump_to_p2
-__342:
+__345:
;
goto __8
@@ -68148,18 +68944,18 @@ __342:
//
// This opcode is only available if SQLite is compiled with the
// -DSQLITE_ENABLE_OFFSET_SQL_FUNC option.
-__69: // The VDBE cursor
+__70: // The VDBE cursor
;
pC = *(*uintptr)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*4))
- pOut = ((*Vdbe)(unsafe.Pointer(p)).FaMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp3)*40)
- if !((pC == uintptr(0)) || (int32((*VdbeCursor)(unsafe.Pointer(pC)).FeCurType) != CURTYPE_BTREE)) {
- goto __343
+ pOut = (*Vdbe)(unsafe.Pointer(p)).FaMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp3)*40
+ if !(pC == uintptr(0) || int32((*VdbeCursor)(unsafe.Pointer(pC)).FeCurType) != CURTYPE_BTREE) {
+ goto __346
}
Xsqlite3VdbeMemSetNull(tls, pOut)
- goto __344
-__343:
- Xsqlite3VdbeMemSetInt64(tls, pOut, Xsqlite3BtreeOffset(tls, *(*uintptr)(unsafe.Pointer(pC + 40 /* &.uc */))))
-__344:
+ goto __347
+__346:
+ Xsqlite3VdbeMemSetInt64(tls, pOut, Xsqlite3BtreeOffset(tls, *(*uintptr)(unsafe.Pointer(pC + 40))))
+__347:
;
goto __8
@@ -68182,87 +68978,87 @@ __344:
// the result is guaranteed to only be used as the argument of a length()
// or typeof() function, respectively. The loading of large blobs can be
// skipped for length() and all content loading can be skipped for typeof().
-__70: // PseudoTable input register
+__71: // PseudoTable input register
;
- *(*uintptr)(unsafe.Pointer(bp + 200 /* pC1 */)) = *(*uintptr)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*4))
+ *(*uintptr)(unsafe.Pointer(bp + 232 /* pC1 */)) = *(*uintptr)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*4))
- *(*U32)(unsafe.Pointer(bp + 204 /* p22 */)) = U32((*Op)(unsafe.Pointer(pOp)).Fp2)
+ *(*U32)(unsafe.Pointer(bp + 236 /* p22 */)) = U32((*Op)(unsafe.Pointer(pOp)).Fp2)
// If the cursor cache is stale (meaning it is not currently point at
// the correct row) then bring it up-to-date by doing the necessary
// B-Tree seek.
- rc = Xsqlite3VdbeCursorMoveto(tls, bp+200 /* &pC1 */, bp+204 /* &p22 */)
+ rc = Xsqlite3VdbeCursorMoveto(tls, bp+232 /* &pC1 */, bp+236 /* &p22 */)
if !(rc != 0) {
- goto __345
+ goto __348
}
goto abort_due_to_error
-__345:
+__348:
;
- pDest = (aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp3)*40)
+ pDest = aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp3)*40
- aOffset = (*VdbeCursor)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 200 /* pC1 */)))).FaOffset
+ aOffset = (*VdbeCursor)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 232 /* pC1 */)))).FaOffset
- if !((*VdbeCursor)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 200 /* pC1 */)))).FcacheStatus != (*Vdbe)(unsafe.Pointer(p)).FcacheCtr) {
- goto __346
+ if !((*VdbeCursor)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 232)))).FcacheStatus != (*Vdbe)(unsafe.Pointer(p)).FcacheCtr) {
+ goto __349
} //OPTIMIZATION-IF-FALSE
- if !((*VdbeCursor)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 200 /* pC1 */)))).FnullRow != 0) {
- goto __347
+ if !((*VdbeCursor)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 232)))).FnullRow != 0) {
+ goto __350
}
- if !(int32((*VdbeCursor)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 200 /* pC1 */)))).FeCurType) == CURTYPE_PSEUDO) {
- goto __349
+ if !(int32((*VdbeCursor)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 232)))).FeCurType) == CURTYPE_PSEUDO) {
+ goto __352
}
// For the special case of as pseudo-cursor, the seekResult field
// identifies the register that holds the record
- pReg = (aMem + uintptr((*VdbeCursor)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 200 /* pC1 */)))).FseekResult)*40)
+ pReg = aMem + uintptr((*VdbeCursor)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 232)))).FseekResult)*40
- (*VdbeCursor)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 200 /* pC1 */)))).FpayloadSize = libc.AssignPtrUint32(*(*uintptr)(unsafe.Pointer(bp + 200 /* pC1 */))+84 /* &.szRow */, U32((*Mem)(unsafe.Pointer(pReg)).Fn))
- (*VdbeCursor)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 200 /* pC1 */)))).FaRow = (*Mem)(unsafe.Pointer(pReg)).Fz
- goto __350
-__349:
+ (*VdbeCursor)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 232 /* pC1 */)))).FpayloadSize = libc.AssignPtrUint32(*(*uintptr)(unsafe.Pointer(bp + 232))+84, U32((*Mem)(unsafe.Pointer(pReg)).Fn))
+ (*VdbeCursor)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 232 /* pC1 */)))).FaRow = (*Mem)(unsafe.Pointer(pReg)).Fz
+ goto __353
+__352:
Xsqlite3VdbeMemSetNull(tls, pDest)
goto op_column_out
-__350:
+__353:
;
- goto __348
-__347:
- pCrsr = *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 200 /* pC1 */)) + 40 /* &.uc */))
+ goto __351
+__350:
+ pCrsr = *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 232)) + 40))
- (*VdbeCursor)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 200 /* pC1 */)))).FpayloadSize = Xsqlite3BtreePayloadSize(tls, pCrsr)
- (*VdbeCursor)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 200 /* pC1 */)))).FaRow = Xsqlite3BtreePayloadFetch(tls, pCrsr, (*(*uintptr)(unsafe.Pointer(bp + 200 /* pC1 */)) + 84 /* &.szRow */))
+ (*VdbeCursor)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 232 /* pC1 */)))).FpayloadSize = Xsqlite3BtreePayloadSize(tls, pCrsr)
+ (*VdbeCursor)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 232 /* pC1 */)))).FaRow = Xsqlite3BtreePayloadFetch(tls, pCrsr, *(*uintptr)(unsafe.Pointer(bp + 232))+84)
// Maximum page size is 64KiB
- if !((*VdbeCursor)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 200 /* pC1 */)))).FpayloadSize > U32(*(*int32)(unsafe.Pointer((db + 112 /* &.aLimit */))))) {
- goto __351
+ if !((*VdbeCursor)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 232)))).FpayloadSize > U32(*(*int32)(unsafe.Pointer(db + 120)))) {
+ goto __354
}
goto too_big
-__351:
+__354:
;
-__348:
+__351:
;
- (*VdbeCursor)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 200 /* pC1 */)))).FcacheStatus = (*Vdbe)(unsafe.Pointer(p)).FcacheCtr
- (*VdbeCursor)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 200 /* pC1 */)))).FiHdrOffset = U32(func() uint8 {
- if int32(*(*U8)(unsafe.Pointer((*VdbeCursor)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 200 /* pC1 */)))).FaRow))) < int32(U8(0x80)) {
+ (*VdbeCursor)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 232 /* pC1 */)))).FcacheStatus = (*Vdbe)(unsafe.Pointer(p)).FcacheCtr
+ (*VdbeCursor)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 232 /* pC1 */)))).FiHdrOffset = U32(func() uint8 {
+ if int32(*(*U8)(unsafe.Pointer((*VdbeCursor)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 232)))).FaRow))) < int32(U8(0x80)) {
return uint8(func() int32 {
- (*(*U32)(unsafe.Pointer(aOffset))) = U32(*(*U8)(unsafe.Pointer((*VdbeCursor)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 200 /* pC1 */)))).FaRow)))
+ *(*U32)(unsafe.Pointer(aOffset)) = U32(*(*U8)(unsafe.Pointer((*VdbeCursor)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 232)))).FaRow)))
return 1
}())
}
- return Xsqlite3GetVarint32(tls, (*VdbeCursor)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 200 /* pC1 */)))).FaRow, (aOffset))
+ return Xsqlite3GetVarint32(tls, (*VdbeCursor)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 232)))).FaRow, aOffset)
}())
- (*VdbeCursor)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 200 /* pC1 */)))).FnHdrParsed = U16(0)
+ (*VdbeCursor)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 232 /* pC1 */)))).FnHdrParsed = U16(0)
- if !((*VdbeCursor)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 200 /* pC1 */)))).FszRow < *(*U32)(unsafe.Pointer(aOffset))) {
- goto __352
+ if !((*VdbeCursor)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 232)))).FszRow < *(*U32)(unsafe.Pointer(aOffset))) {
+ goto __355
} //OPTIMIZATION-IF-FALSE
// pC->aRow does not have to hold the entire row, but it does at least
// need to cover the header of the record. If pC->aRow does not contain
// the complete header, then set it to zero, forcing the header to be
// dynamically allocated.
- (*VdbeCursor)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 200 /* pC1 */)))).FaRow = uintptr(0)
- (*VdbeCursor)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 200 /* pC1 */)))).FszRow = U32(0)
+ (*VdbeCursor)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 232 /* pC1 */)))).FaRow = uintptr(0)
+ (*VdbeCursor)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 232 /* pC1 */)))).FszRow = U32(0)
// Make sure a corrupt database has not given us an oversize header.
// Do this now to avoid an oversize memory allocation.
@@ -68272,14 +69068,14 @@ __348:
// them, respectively. So the maximum header length results from a
// 3-byte type for each of the maximum of 32768 columns plus three
// extra bytes for the header length itself. 32768*3 + 3 = 98307.
- if !((*(*U32)(unsafe.Pointer(aOffset)) > U32(98307)) || (*(*U32)(unsafe.Pointer(aOffset)) > (*VdbeCursor)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 200 /* pC1 */)))).FpayloadSize)) {
- goto __354
+ if !(*(*U32)(unsafe.Pointer(aOffset)) > U32(98307) || *(*U32)(unsafe.Pointer(aOffset)) > (*VdbeCursor)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 232)))).FpayloadSize) {
+ goto __357
}
goto op_column_corrupt
-__354:
+__357:
;
- goto __353
-__352:
+ goto __356
+__355:
// This is an optimization. By skipping over the first few tests
// (ex: pC->nHdrParsed<=p2) in the next section, we achieve a
// measurable performance gain.
@@ -68292,193 +69088,193 @@ __352:
// content area, the "page header" comes after the page content and so
// this overread is harmless. Similar overreads can occur for a corrupt
// database file.
- zData = (*VdbeCursor)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 200 /* pC1 */)))).FaRow
+ zData = (*VdbeCursor)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 232 /* pC1 */)))).FaRow
// Conditional skipped
goto op_column_read_header
-__353:
+__356:
;
-__346:
+__349:
;
// Make sure at least the first p2+1 entries of the header have been
// parsed and valid information is in aOffset[] and pC->aType[].
- if !(U32((*VdbeCursor)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 200 /* pC1 */)))).FnHdrParsed) <= *(*U32)(unsafe.Pointer(bp + 204 /* p22 */))) {
- goto __355
+ if !(U32((*VdbeCursor)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 232)))).FnHdrParsed) <= *(*U32)(unsafe.Pointer(bp + 236))) {
+ goto __358
}
// If there is more header available for parsing in the record, try
// to extract additional fields up through the p2+1-th field
- if !((*VdbeCursor)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 200 /* pC1 */)))).FiHdrOffset < *(*U32)(unsafe.Pointer(aOffset))) {
- goto __357
+ if !((*VdbeCursor)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 232)))).FiHdrOffset < *(*U32)(unsafe.Pointer(aOffset))) {
+ goto __360
}
// Make sure zData points to enough of the record to cover the header.
- if !((*VdbeCursor)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 200 /* pC1 */)))).FaRow == uintptr(0)) {
- goto __359
+ if !((*VdbeCursor)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 232)))).FaRow == uintptr(0)) {
+ goto __362
}
- libc.Xmemset(tls, bp+208 /* &sMem */, 0, uint32(unsafe.Sizeof(Mem{})))
- rc = Xsqlite3VdbeMemFromBtreeZeroOffset(tls, *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 200 /* pC1 */)) + 40 /* &.uc */)), *(*U32)(unsafe.Pointer(aOffset)), bp+208 /* &sMem */)
+ libc.Xmemset(tls, bp+240 /* &sMem */, 0, uint32(unsafe.Sizeof(Mem{})))
+ rc = Xsqlite3VdbeMemFromBtreeZeroOffset(tls, *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 232)) + 40)), *(*U32)(unsafe.Pointer(aOffset)), bp+240 /* &sMem */)
if !(rc != SQLITE_OK) {
- goto __361
+ goto __364
}
goto abort_due_to_error
-__361:
+__364:
;
- zData = (*Mem)(unsafe.Pointer(bp + 208 /* &sMem */)).Fz
- goto __360
-__359:
- zData = (*VdbeCursor)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 200 /* pC1 */)))).FaRow
-__360:
+ zData = (*Mem)(unsafe.Pointer(bp + 240 /* &sMem */)).Fz
+ goto __363
+__362:
+ zData = (*VdbeCursor)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 232 /* pC1 */)))).FaRow
+__363:
;
// Fill in pC->aType[i] and aOffset[i] values through the p2-th field.
op_column_read_header:
- i2 = int32((*VdbeCursor)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 200 /* pC1 */)))).FnHdrParsed)
+ i2 = int32((*VdbeCursor)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 232 /* pC1 */)))).FnHdrParsed)
offset64 = U64(*(*U32)(unsafe.Pointer(aOffset + uintptr(i2)*4)))
- zHdr = (zData + uintptr((*VdbeCursor)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 200 /* pC1 */)))).FiHdrOffset))
- zEndHdr = (zData + uintptr(*(*U32)(unsafe.Pointer(aOffset))))
+ zHdr = zData + uintptr((*VdbeCursor)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 232)))).FiHdrOffset)
+ zEndHdr = zData + uintptr(*(*U32)(unsafe.Pointer(aOffset)))
-__362:
- if !((libc.AssignPtrUint32((*(*uintptr)(unsafe.Pointer(bp + 200 /* pC1 */))+88 /* &.aType */)+uintptr(i2)*4, libc.AssignPtrUint32(bp+248 /* t */, U32(*(*U8)(unsafe.Pointer(zHdr)))))) < U32(0x80)) {
- goto __365
+__365:
+ if !(libc.AssignPtrUint32(*(*uintptr)(unsafe.Pointer(bp + 232))+88+uintptr(i2)*4, libc.AssignPtrUint32(bp+280, U32(*(*U8)(unsafe.Pointer(zHdr))))) < U32(0x80)) {
+ goto __368
}
zHdr++
- offset64 = offset64 + (U64(Xsqlite3VdbeOneByteSerialTypeLen(tls, uint8(*(*U32)(unsafe.Pointer(bp + 248 /* t */))))))
+ offset64 = offset64 + U64(Xsqlite3VdbeOneByteSerialTypeLen(tls, uint8(*(*U32)(unsafe.Pointer(bp + 280)))))
+ goto __369
+__368:
+ zHdr += uintptr(Xsqlite3GetVarint32(tls, zHdr, bp+280 /* &t */))
+ *(*U32)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 232)) + 88 + uintptr(i2)*4)) = *(*U32)(unsafe.Pointer(bp + 280 /* t */))
+ offset64 = offset64 + U64(Xsqlite3VdbeSerialTypeLen(tls, *(*U32)(unsafe.Pointer(bp + 280))))
+__369:
+ ;
+ *(*U32)(unsafe.Pointer(aOffset + uintptr(libc.PreIncInt32(&i2, 1))*4)) = U32(offset64 & uint64(0xffffffff))
goto __366
-__365:
- zHdr += uintptr(Xsqlite3GetVarint32(tls, zHdr, bp+248 /* &t */))
- *(*U32)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(bp + 200 /* pC1 */)) + 88 /* &.aType */) + uintptr(i2)*4)) = *(*U32)(unsafe.Pointer(bp + 248 /* t */))
- offset64 = offset64 + (U64(Xsqlite3VdbeSerialTypeLen(tls, *(*U32)(unsafe.Pointer(bp + 248 /* t */)))))
__366:
- ;
- *(*U32)(unsafe.Pointer(aOffset + uintptr(libc.PreIncInt32(&i2, 1))*4)) = (U32(offset64 & uint64(0xffffffff)))
- goto __363
-__363:
- if (U32(i2) <= *(*U32)(unsafe.Pointer(bp + 204 /* p22 */))) && (zHdr < zEndHdr) {
- goto __362
+ if U32(i2) <= *(*U32)(unsafe.Pointer(bp + 236)) && zHdr < zEndHdr {
+ goto __365
}
- goto __364
-__364:
+ goto __367
+__367:
;
// The record is corrupt if any of the following are true:
// (1) the bytes of the header extend past the declared header size
// (2) the entire header was used but not all data was used
// (3) the end of the data extends beyond the end of the record.
- if !(((zHdr >= zEndHdr) && ((zHdr > zEndHdr) || (offset64 != U64((*VdbeCursor)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 200 /* pC1 */)))).FpayloadSize)))) ||
- (offset64 > U64((*VdbeCursor)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 200 /* pC1 */)))).FpayloadSize))) {
- goto __367
+ if !(zHdr >= zEndHdr && (zHdr > zEndHdr || offset64 != U64((*VdbeCursor)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 232)))).FpayloadSize)) ||
+ offset64 > U64((*VdbeCursor)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 232)))).FpayloadSize)) {
+ goto __370
}
if !(*(*U32)(unsafe.Pointer(aOffset)) == U32(0)) {
- goto __368
+ goto __371
}
i2 = 0
zHdr = zEndHdr
- goto __369
-__368:
- if !((*VdbeCursor)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 200 /* pC1 */)))).FaRow == uintptr(0)) {
- goto __370
+ goto __372
+__371:
+ if !((*VdbeCursor)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 232)))).FaRow == uintptr(0)) {
+ goto __373
}
- Xsqlite3VdbeMemRelease(tls, bp+208 /* &sMem */)
-__370:
+ Xsqlite3VdbeMemRelease(tls, bp+240 /* &sMem */)
+__373:
;
goto op_column_corrupt
-__369:
+__372:
;
-__367:
+__370:
;
- (*VdbeCursor)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 200 /* pC1 */)))).FnHdrParsed = U16(i2)
- (*VdbeCursor)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 200 /* pC1 */)))).FiHdrOffset = (U32((int32(zHdr) - int32(zData)) / 1))
- if !((*VdbeCursor)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 200 /* pC1 */)))).FaRow == uintptr(0)) {
- goto __371
+ (*VdbeCursor)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 232 /* pC1 */)))).FnHdrParsed = U16(i2)
+ (*VdbeCursor)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 232 /* pC1 */)))).FiHdrOffset = U32((int32(zHdr) - int32(zData)) / 1)
+ if !((*VdbeCursor)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 232)))).FaRow == uintptr(0)) {
+ goto __374
}
- Xsqlite3VdbeMemRelease(tls, bp+208 /* &sMem */)
-__371:
+ Xsqlite3VdbeMemRelease(tls, bp+240 /* &sMem */)
+__374:
;
- goto __358
-__357:
- *(*U32)(unsafe.Pointer(bp + 248 /* t */)) = U32(0)
-__358:
+ goto __361
+__360:
+ *(*U32)(unsafe.Pointer(bp + 280 /* t */)) = U32(0)
+__361:
;
// If after trying to extract new entries from the header, nHdrParsed is
// still not up to p2, that means that the record has fewer than p2
// columns. So the result will be either the default value or a NULL.
- if !(U32((*VdbeCursor)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 200 /* pC1 */)))).FnHdrParsed) <= *(*U32)(unsafe.Pointer(bp + 204 /* p22 */))) {
- goto __372
+ if !(U32((*VdbeCursor)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 232)))).FnHdrParsed) <= *(*U32)(unsafe.Pointer(bp + 236))) {
+ goto __375
}
- if !(int32((*Op)(unsafe.Pointer(pOp)).Fp4type) == (-11)) {
- goto __373
+ if !(int32((*Op)(unsafe.Pointer(pOp)).Fp4type) == -11) {
+ goto __376
}
- Xsqlite3VdbeMemShallowCopy(tls, pDest, *(*uintptr)(unsafe.Pointer(pOp + 16 /* &.p4 */)), MEM_Static)
- goto __374
-__373:
+ Xsqlite3VdbeMemShallowCopy(tls, pDest, *(*uintptr)(unsafe.Pointer(pOp + 16)), MEM_Static)
+ goto __377
+__376:
Xsqlite3VdbeMemSetNull(tls, pDest)
-__374:
+__377:
;
goto op_column_out
-__372:
+__375:
;
- goto __356
-__355:
- *(*U32)(unsafe.Pointer(bp + 248 /* t */)) = *(*U32)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(bp + 200 /* pC1 */)) + 88 /* &.aType */) + uintptr(*(*U32)(unsafe.Pointer(bp + 204 /* p22 */)))*4))
-__356:
+ goto __359
+__358:
+ *(*U32)(unsafe.Pointer(bp + 280 /* t */)) = *(*U32)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 232)) + 88 + uintptr(*(*U32)(unsafe.Pointer(bp + 236 /* p22 */)))*4))
+__359:
;
// Extract the content for the p2+1-th column. Control can only
// reach this point if aOffset[p2], aOffset[p2+1], and pC->aType[p2] are
// all valid.
- if !((int32((*Mem)(unsafe.Pointer((pDest))).Fflags) & (MEM_Agg | MEM_Dyn)) != 0) {
- goto __375
+ if !(int32((*Mem)(unsafe.Pointer(pDest)).Fflags)&(MEM_Agg|MEM_Dyn) != 0) {
+ goto __378
}
Xsqlite3VdbeMemSetNull(tls, pDest)
-__375:
+__378:
;
- if !((*VdbeCursor)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 200 /* pC1 */)))).FszRow >= *(*U32)(unsafe.Pointer(aOffset + uintptr((*(*U32)(unsafe.Pointer(bp + 204 /* p22 */))+U32(1)))*4))) {
- goto __376
+ if !((*VdbeCursor)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 232)))).FszRow >= *(*U32)(unsafe.Pointer(aOffset + uintptr(*(*U32)(unsafe.Pointer(bp + 236))+U32(1))*4))) {
+ goto __379
}
// This is the common case where the desired content fits on the original
// page - where the content is not on an overflow page
- zData = ((*VdbeCursor)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 200 /* pC1 */)))).FaRow + uintptr(*(*U32)(unsafe.Pointer(aOffset + uintptr(*(*U32)(unsafe.Pointer(bp + 204 /* p22 */)))*4))))
- if !(*(*U32)(unsafe.Pointer(bp + 248 /* t */)) < U32(12)) {
- goto __378
+ zData = (*VdbeCursor)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 232)))).FaRow + uintptr(*(*U32)(unsafe.Pointer(aOffset + uintptr(*(*U32)(unsafe.Pointer(bp + 236)))*4)))
+ if !(*(*U32)(unsafe.Pointer(bp + 280)) < U32(12)) {
+ goto __381
}
- Xsqlite3VdbeSerialGet(tls, zData, *(*U32)(unsafe.Pointer(bp + 248 /* t */)), pDest)
- goto __379
-__378:
- (*Mem)(unsafe.Pointer(pDest)).Fn = libc.AssignInt32(&len, (int32((*(*U32)(unsafe.Pointer(bp + 248 /* t */)) - U32(12)) / U32(2))))
+ Xsqlite3VdbeSerialGet(tls, zData, *(*U32)(unsafe.Pointer(bp + 280 /* t */)), pDest)
+ goto __382
+__381:
+ (*Mem)(unsafe.Pointer(pDest)).Fn = libc.AssignInt32(&len, int32((*(*U32)(unsafe.Pointer(bp + 280))-U32(12))/U32(2)))
(*Mem)(unsafe.Pointer(pDest)).Fenc = encoding
- if !((*Mem)(unsafe.Pointer(pDest)).FszMalloc < (len + 2)) {
- goto __380
+ if !((*Mem)(unsafe.Pointer(pDest)).FszMalloc < len+2) {
+ goto __383
}
(*Mem)(unsafe.Pointer(pDest)).Fflags = U16(MEM_Null)
- if !(Xsqlite3VdbeMemGrow(tls, pDest, (len+2), 0) != 0) {
- goto __382
+ if !(Xsqlite3VdbeMemGrow(tls, pDest, len+2, 0) != 0) {
+ goto __385
}
goto no_mem
-__382:
+__385:
;
- goto __381
-__380:
+ goto __384
+__383:
(*Mem)(unsafe.Pointer(pDest)).Fz = (*Mem)(unsafe.Pointer(pDest)).FzMalloc
-__381:
+__384:
;
libc.Xmemcpy(tls, (*Mem)(unsafe.Pointer(pDest)).Fz, zData, uint32(len))
*(*uint8)(unsafe.Pointer((*Mem)(unsafe.Pointer(pDest)).Fz + uintptr(len))) = uint8(0)
- *(*uint8)(unsafe.Pointer((*Mem)(unsafe.Pointer(pDest)).Fz + uintptr((len + 1)))) = uint8(0)
- (*Mem)(unsafe.Pointer(pDest)).Fflags = aFlag1[(*(*U32)(unsafe.Pointer(bp + 248 /* t */)) & U32(1))]
-__379:
+ *(*uint8)(unsafe.Pointer((*Mem)(unsafe.Pointer(pDest)).Fz + uintptr(len+1))) = uint8(0)
+ (*Mem)(unsafe.Pointer(pDest)).Fflags = aFlag1[*(*U32)(unsafe.Pointer(bp + 280))&U32(1)]
+__382:
;
- goto __377
-__376:
+ goto __380
+__379:
(*Mem)(unsafe.Pointer(pDest)).Fenc = encoding
// This branch happens only when content is on overflow pages
- if !((((int32((*Op)(unsafe.Pointer(pOp)).Fp5) & (OPFLAG_LENGTHARG | OPFLAG_TYPEOFARG)) != 0) &&
- (((*(*U32)(unsafe.Pointer(bp + 248 /* t */)) >= U32(12)) && ((*(*U32)(unsafe.Pointer(bp + 248 /* t */)) & U32(1)) == U32(0))) || ((int32((*Op)(unsafe.Pointer(pOp)).Fp5) & OPFLAG_TYPEOFARG) != 0))) ||
- ((libc.AssignInt32(&len, int32(Xsqlite3VdbeSerialTypeLen(tls, *(*U32)(unsafe.Pointer(bp + 248 /* t */)))))) == 0)) {
- goto __383
+ if !(int32((*Op)(unsafe.Pointer(pOp)).Fp5)&(OPFLAG_LENGTHARG|OPFLAG_TYPEOFARG) != 0 &&
+ (*(*U32)(unsafe.Pointer(bp + 280)) >= U32(12) && *(*U32)(unsafe.Pointer(bp + 280))&U32(1) == U32(0) || int32((*Op)(unsafe.Pointer(pOp)).Fp5)&OPFLAG_TYPEOFARG != 0) ||
+ libc.AssignInt32(&len, int32(Xsqlite3VdbeSerialTypeLen(tls, *(*U32)(unsafe.Pointer(bp + 280))))) == 0) {
+ goto __386
}
// Content is irrelevant for
// 1. the typeof() function,
@@ -68492,21 +69288,21 @@ __376:
// read more. Use the global constant sqlite3CtypeMap[] as the array,
// as that array is 256 bytes long (plenty for VdbeMemPrettyPrint())
// and it begins with a bunch of zeros.
- Xsqlite3VdbeSerialGet(tls, uintptr(uintptr(unsafe.Pointer(&Xsqlite3CtypeMap))), *(*U32)(unsafe.Pointer(bp + 248 /* t */)), pDest)
- goto __384
-__383:
- rc = Xsqlite3VdbeMemFromBtree(tls, *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 200 /* pC1 */)) + 40 /* &.uc */)), *(*U32)(unsafe.Pointer(aOffset + uintptr(*(*U32)(unsafe.Pointer(bp + 204 /* p22 */)))*4)), uint32(len), pDest)
+ Xsqlite3VdbeSerialGet(tls, uintptr(uintptr(unsafe.Pointer(&Xsqlite3CtypeMap))), *(*U32)(unsafe.Pointer(bp + 280 /* t */)), pDest)
+ goto __387
+__386:
+ rc = Xsqlite3VdbeMemFromBtree(tls, *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 232)) + 40)), *(*U32)(unsafe.Pointer(aOffset + uintptr(*(*U32)(unsafe.Pointer(bp + 236 /* p22 */)))*4)), uint32(len), pDest)
if !(rc != SQLITE_OK) {
- goto __385
+ goto __388
}
goto abort_due_to_error
-__385:
+__388:
;
- Xsqlite3VdbeSerialGet(tls, (*Mem)(unsafe.Pointer(pDest)).Fz, *(*U32)(unsafe.Pointer(bp + 248 /* t */)), pDest)
- *(*U16)(unsafe.Pointer(pDest + 8 /* &.flags */)) &= libc.Uint16FromInt32((libc.CplInt32(MEM_Ephem)))
-__384:
+ Xsqlite3VdbeSerialGet(tls, (*Mem)(unsafe.Pointer(pDest)).Fz, *(*U32)(unsafe.Pointer(bp + 280 /* t */)), pDest)
+ *(*U16)(unsafe.Pointer(pDest + 8)) &= libc.Uint16FromInt32(libc.CplInt32(MEM_Ephem))
+__387:
;
-__377:
+__380:
;
op_column_out:
@@ -68516,16 +69312,178 @@ op_column_out:
op_column_corrupt:
if !((*Op)(unsafe.Pointer(aOp)).Fp3 > 0) {
- goto __386
+ goto __389
}
- pOp = (aOp + uintptr(((*Op)(unsafe.Pointer(aOp)).Fp3-1))*20)
+ pOp = aOp + uintptr((*Op)(unsafe.Pointer(aOp)).Fp3-1)*20
goto __8
- goto __387
-__386:
- rc = Xsqlite3CorruptError(tls, 89368)
+ goto __390
+__389:
+ rc = Xsqlite3CorruptError(tls, 89595)
goto abort_due_to_error
-__387:
+__390:
+ ;
+
+ // Opcode: TypeCheck P1 P2 P3 P4 *
+ // Synopsis: typecheck(r[P1@P2])
+ //
+ // Apply affinities to the range of P2 registers beginning with P1.
+ // Take the affinities from the Table object in P4. If any value
+ // cannot be coerced into the correct type, then raise an error.
+ //
+ // This opcode is similar to OP_Affinity except that this opcode
+ // forces the register type to the Table column type. This is used
+ // to implement "strict affinity".
+ //
+ // GENERATED ALWAYS AS ... STATIC columns are only checked if P3
+ // is zero. When P3 is non-zero, no type checking occurs for
+ // static generated columns. Virtual columns are computed at query time
+ // and so they are never checked.
+ //
+ // Preconditions:
+ //
+ // <ul>
+ // <li> P2 should be the number of non-virtual columns in the
+ // table of P4.
+ // <li> Table P4 should be a STRICT table.
+ // </ul>
+ //
+ // If any precondition is false, an assertion fault occurs.
+__72:
+ ;
+ pTab = *(*uintptr)(unsafe.Pointer(pOp + 16))
+
+ aCol = (*Table)(unsafe.Pointer(pTab)).FaCol
+ pIn1 = aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*40
+ i3 = 0
+__391:
+ if !(i3 < int32((*Table)(unsafe.Pointer(pTab)).FnCol)) {
+ goto __393
+ }
+ if !(int32((*Column)(unsafe.Pointer(aCol+uintptr(i3)*16)).FcolFlags)&COLFLAG_GENERATED != 0) {
+ goto __394
+ }
+ if !(int32((*Column)(unsafe.Pointer(aCol+uintptr(i3)*16)).FcolFlags)&COLFLAG_VIRTUAL != 0) {
+ goto __395
+ }
+ goto __392
+__395:
+ ;
+ if !((*Op)(unsafe.Pointer(pOp)).Fp3 != 0) {
+ goto __396
+ }
+ pIn1 += 40
+ goto __392
+__396:
+ ;
+__394:
+ ;
+
+ applyAffinity(tls, pIn1, (*Column)(unsafe.Pointer(aCol+uintptr(i3)*16)).Faffinity, encoding)
+ if !(int32((*Mem)(unsafe.Pointer(pIn1)).Fflags)&MEM_Null == 0) {
+ goto __397
+ }
+ switch int32(*(*uint8)(unsafe.Pointer(aCol + uintptr(i3)*16 + 4)) & 0xf0 >> 4) {
+ case COLTYPE_BLOB:
+ goto __399
+ case COLTYPE_INTEGER:
+ goto __400
+ case COLTYPE_INT:
+ goto __401
+ case COLTYPE_TEXT:
+ goto __402
+ case COLTYPE_REAL:
+ goto __403
+ default:
+ goto __404
+ }
+ goto __398
+__399:
+ if !(int32((*Mem)(unsafe.Pointer(pIn1)).Fflags)&MEM_Blob == 0) {
+ goto __405
+ }
+ goto vdbe_type_error
+__405:
+ ;
+ goto __398
+
+__400:
+__401:
+ if !(int32((*Mem)(unsafe.Pointer(pIn1)).Fflags)&MEM_Int == 0) {
+ goto __406
+ }
+ goto vdbe_type_error
+__406:
;
+ goto __398
+
+__402:
+ if !(int32((*Mem)(unsafe.Pointer(pIn1)).Fflags)&MEM_Str == 0) {
+ goto __407
+ }
+ goto vdbe_type_error
+__407:
+ ;
+ goto __398
+
+__403:
+ if !(int32((*Mem)(unsafe.Pointer(pIn1)).Fflags)&MEM_Int != 0) {
+ goto __408
+ }
+ // When applying REAL affinity, if the result is still an MEM_Int
+ // that will fit in 6 bytes, then change the type to MEM_IntReal
+ // so that we keep the high-resolution integer value but know that
+ // the type really wants to be REAL.
+
+ if !(*(*I64)(unsafe.Pointer(pIn1)) <= 140737488355327 && *(*I64)(unsafe.Pointer(pIn1)) >= -140737488355328) {
+ goto __410
+ }
+ *(*U16)(unsafe.Pointer(pIn1 + 8)) |= U16(MEM_IntReal)
+ *(*U16)(unsafe.Pointer(pIn1 + 8)) &= libc.Uint16FromInt32(libc.CplInt32(MEM_Int))
+ goto __411
+__410:
+ *(*float64)(unsafe.Pointer(pIn1)) = float64(*(*I64)(unsafe.Pointer(pIn1)))
+ *(*U16)(unsafe.Pointer(pIn1 + 8)) |= U16(MEM_Real)
+ *(*U16)(unsafe.Pointer(pIn1 + 8)) &= libc.Uint16FromInt32(libc.CplInt32(MEM_Int))
+__411:
+ ;
+ goto __409
+__408:
+ if !(int32((*Mem)(unsafe.Pointer(pIn1)).Fflags)&MEM_Real == 0) {
+ goto __412
+ }
+ goto vdbe_type_error
+__412:
+ ;
+__409:
+ ;
+ goto __398
+
+__404:
+ // COLTYPE_ANY. Accept anything.
+ goto __398
+
+__398:
+ ;
+__397:
+ ;
+
+ pIn1 += 40
+ goto __392
+__392:
+ i3++
+ goto __391
+ goto __393
+__393:
+ ;
+
+ goto __8
+
+vdbe_type_error:
+ Xsqlite3VdbeError(tls, p, ts+5403, /* "cannot store %s ..." */
+ libc.VaList(bp+56, vdbeMemTypeName(tls, pIn1), Xsqlite3StdType[(int32(*(*uint8)(unsafe.Pointer(aCol + uintptr(i3)*16 + 4))&0xf0>>4)-1)&0xf<<28>>28],
+ (*Table)(unsafe.Pointer(pTab)).FzName, (*Column)(unsafe.Pointer(aCol+uintptr(i3)*16)).FzCnName))
+ rc = SQLITE_CONSTRAINT | int32(12)<<8
+ goto abort_due_to_error
// Opcode: Affinity P1 P2 * P4 *
// Synopsis: affinity(r[P1@P2])
@@ -68535,50 +69493,50 @@ __387:
// P4 is a string that is P2 characters long. The N-th character of the
// string indicates the column affinity that should be used for the N-th
// memory cell in the range.
-__71: // The affinity to be applied
+__73: // The affinity to be applied
- zAffinity = *(*uintptr)(unsafe.Pointer(pOp + 16 /* &.p4 */))
+ zAffinity = *(*uintptr)(unsafe.Pointer(pOp + 16))
- pIn1 = (aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*40)
-__388:
+ pIn1 = aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*40
+__413:
if !(1 != 0) {
- goto __389
+ goto __414
}
applyAffinity(tls, pIn1, *(*uint8)(unsafe.Pointer(zAffinity)), encoding)
- if !((int32(*(*uint8)(unsafe.Pointer(zAffinity))) == SQLITE_AFF_REAL) && ((int32((*Mem)(unsafe.Pointer(pIn1)).Fflags) & MEM_Int) != 0)) {
- goto __390
+ if !(int32(*(*uint8)(unsafe.Pointer(zAffinity))) == SQLITE_AFF_REAL && int32((*Mem)(unsafe.Pointer(pIn1)).Fflags)&MEM_Int != 0) {
+ goto __415
}
// When applying REAL affinity, if the result is still an MEM_Int
// that will fit in 6 bytes, then change the type to MEM_IntReal
// so that we keep the high-resolution integer value but know that
// the type really wants to be REAL.
- if !((*(*I64)(unsafe.Pointer(pIn1 /* &.u */)) <= 140737488355327) && (*(*I64)(unsafe.Pointer(pIn1 /* &.u */)) >= -140737488355328)) {
- goto __391
+ if !(*(*I64)(unsafe.Pointer(pIn1)) <= 140737488355327 && *(*I64)(unsafe.Pointer(pIn1)) >= -140737488355328) {
+ goto __416
}
- *(*U16)(unsafe.Pointer(pIn1 + 8 /* &.flags */)) |= U16((MEM_IntReal))
- *(*U16)(unsafe.Pointer(pIn1 + 8 /* &.flags */)) &= libc.Uint16FromInt32((libc.CplInt32(MEM_Int)))
- goto __392
-__391:
- *(*float64)(unsafe.Pointer(pIn1 /* &.u */)) = float64(*(*I64)(unsafe.Pointer(pIn1 /* &.u */)))
- *(*U16)(unsafe.Pointer(pIn1 + 8 /* &.flags */)) |= U16((MEM_Real))
- *(*U16)(unsafe.Pointer(pIn1 + 8 /* &.flags */)) &= libc.Uint16FromInt32((libc.CplInt32(MEM_Int)))
-__392:
+ *(*U16)(unsafe.Pointer(pIn1 + 8)) |= U16(MEM_IntReal)
+ *(*U16)(unsafe.Pointer(pIn1 + 8)) &= libc.Uint16FromInt32(libc.CplInt32(MEM_Int))
+ goto __417
+__416:
+ *(*float64)(unsafe.Pointer(pIn1)) = float64(*(*I64)(unsafe.Pointer(pIn1)))
+ *(*U16)(unsafe.Pointer(pIn1 + 8)) |= U16(MEM_Real)
+ *(*U16)(unsafe.Pointer(pIn1 + 8)) &= libc.Uint16FromInt32(libc.CplInt32(MEM_Int))
+__417:
;
-__390:
+__415:
;
zAffinity++
if !(int32(*(*uint8)(unsafe.Pointer(zAffinity))) == 0) {
- goto __393
+ goto __418
}
- goto __389
-__393:
+ goto __414
+__418:
;
pIn1 += 40
- goto __388
-__389:
+ goto __413
+__414:
;
goto __8
@@ -68608,7 +69566,7 @@ __389:
// OPFLAG_NOCHNG_MAGIC if the OP_MakeRecord opcode is allowed to
// accept no-change records with serial_type 10. This value is
// only used inside an assert() and does not affect the end result.
-__72: // Where to write next byte of the payload
+__74: // Where to write next byte of the payload
// Assuming the record contains N fields, the record format looks
// like this:
@@ -68628,45 +69586,45 @@ __72: // Where to write next byte of the payload
nHdr = 0 // Number of bytes of header space
nZero = int64(0) // Number of zero bytes at the end of the record
nField = (*Op)(unsafe.Pointer(pOp)).Fp1
- zAffinity1 = *(*uintptr)(unsafe.Pointer(pOp + 16 /* &.p4 */))
+ zAffinity1 = *(*uintptr)(unsafe.Pointer(pOp + 16))
- pData0 = (aMem + uintptr(nField)*40)
+ pData0 = aMem + uintptr(nField)*40
nField = (*Op)(unsafe.Pointer(pOp)).Fp2
- pLast = (pData0 + uintptr((nField-1))*40)
+ pLast = pData0 + uintptr(nField-1)*40
file_format = int32((*Vdbe)(unsafe.Pointer(p)).FminWriteFileFormat)
// Identify the output register
- pOut = (aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp3)*40)
+ pOut = aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp3)*40
// Apply the requested affinity to all inputs
if !(zAffinity1 != 0) {
- goto __394
+ goto __419
}
pRec = pData0
-__395:
+__420:
applyAffinity(tls, pRec, *(*uint8)(unsafe.Pointer(zAffinity1)), encoding)
- if !((int32(*(*uint8)(unsafe.Pointer(zAffinity1))) == SQLITE_AFF_REAL) && ((int32((*Mem)(unsafe.Pointer(pRec)).Fflags) & MEM_Int) != 0)) {
- goto __398
+ if !(int32(*(*uint8)(unsafe.Pointer(zAffinity1))) == SQLITE_AFF_REAL && int32((*Mem)(unsafe.Pointer(pRec)).Fflags)&MEM_Int != 0) {
+ goto __423
}
- *(*U16)(unsafe.Pointer(pRec + 8 /* &.flags */)) |= U16((MEM_IntReal))
- *(*U16)(unsafe.Pointer(pRec + 8 /* &.flags */)) &= libc.Uint16FromInt32((libc.CplInt32(MEM_Int)))
-__398:
+ *(*U16)(unsafe.Pointer(pRec + 8)) |= U16(MEM_IntReal)
+ *(*U16)(unsafe.Pointer(pRec + 8)) &= libc.Uint16FromInt32(libc.CplInt32(MEM_Int))
+__423:
;
zAffinity1++
pRec += 40
- goto __396
-__396:
+ goto __421
+__421:
if *(*uint8)(unsafe.Pointer(zAffinity1)) != 0 {
- goto __395
+ goto __420
}
- goto __397
-__397:
+ goto __422
+__422:
;
-__394:
+__419:
;
// Loop through the elements that will make up the record to figure
@@ -68695,13 +69653,13 @@ __394:
// nData Number of bytes of data space needed for the record
// nZero Zero bytes at the end of the record
pRec = pLast
-__399:
+__424:
;
- if !((int32((*Mem)(unsafe.Pointer(pRec)).Fflags) & MEM_Null) != 0) {
- goto __402
+ if !(int32((*Mem)(unsafe.Pointer(pRec)).Fflags)&MEM_Null != 0) {
+ goto __427
}
- if !((int32((*Mem)(unsafe.Pointer(pRec)).Fflags) & MEM_Zero) != 0) {
- goto __404
+ if !(int32((*Mem)(unsafe.Pointer(pRec)).Fflags)&MEM_Zero != 0) {
+ goto __429
}
// Values with MEM_Null and MEM_Zero are created by xColumn virtual
// table methods that never invoke sqlite3_result_xxxxx() while
@@ -68711,158 +69669,158 @@ __399:
// a true sqlite3_value_nochange().
(*Mem)(unsafe.Pointer(pRec)).FuTemp = U32(10)
- goto __405
-__404:
+ goto __430
+__429:
(*Mem)(unsafe.Pointer(pRec)).FuTemp = U32(0)
-__405:
+__430:
;
nHdr++
- goto __403
-__402:
- if !((int32((*Mem)(unsafe.Pointer(pRec)).Fflags) & (MEM_Int | MEM_IntReal)) != 0) {
- goto __406
+ goto __428
+__427:
+ if !(int32((*Mem)(unsafe.Pointer(pRec)).Fflags)&(MEM_Int|MEM_IntReal) != 0) {
+ goto __431
}
// Figure out whether to use 1, 2, 4, 6 or 8 bytes.
- i3 = *(*I64)(unsafe.Pointer(pRec /* &.u */))
+ i4 = *(*I64)(unsafe.Pointer(pRec))
- if !(i3 < int64(0)) {
- goto __408
+ if !(i4 < int64(0)) {
+ goto __433
}
- uu = U64(^i3)
- goto __409
-__408:
- uu = U64(i3)
-__409:
+ uu = U64(^i4)
+ goto __434
+__433:
+ uu = U64(i4)
+__434:
;
nHdr++
if !(uu <= uint64(127)) {
- goto __410
+ goto __435
}
- if !(((i3 & int64(1)) == i3) && (file_format >= 4)) {
- goto __412
+ if !(i4&int64(1) == i4 && file_format >= 4) {
+ goto __437
}
- (*Mem)(unsafe.Pointer(pRec)).FuTemp = (U32(8) + U32(uu))
- goto __413
-__412:
+ (*Mem)(unsafe.Pointer(pRec)).FuTemp = U32(8) + U32(uu)
+ goto __438
+__437:
nData++
(*Mem)(unsafe.Pointer(pRec)).FuTemp = U32(1)
-__413:
+__438:
;
- goto __411
-__410:
+ goto __436
+__435:
if !(uu <= uint64(32767)) {
- goto __414
+ goto __439
}
- nData = nData + (uint64(2))
+ nData = nData + uint64(2)
(*Mem)(unsafe.Pointer(pRec)).FuTemp = U32(2)
- goto __415
-__414:
+ goto __440
+__439:
if !(uu <= uint64(8388607)) {
- goto __416
+ goto __441
}
- nData = nData + (uint64(3))
+ nData = nData + uint64(3)
(*Mem)(unsafe.Pointer(pRec)).FuTemp = U32(3)
- goto __417
-__416:
+ goto __442
+__441:
if !(uu <= uint64(2147483647)) {
- goto __418
+ goto __443
}
- nData = nData + (uint64(4))
+ nData = nData + uint64(4)
(*Mem)(unsafe.Pointer(pRec)).FuTemp = U32(4)
- goto __419
-__418:
+ goto __444
+__443:
if !(uu <= uint64(140737488355327)) {
- goto __420
+ goto __445
}
- nData = nData + (uint64(6))
+ nData = nData + uint64(6)
(*Mem)(unsafe.Pointer(pRec)).FuTemp = U32(5)
- goto __421
-__420:
- nData = nData + (uint64(8))
- if !((int32((*Mem)(unsafe.Pointer(pRec)).Fflags) & MEM_IntReal) != 0) {
- goto __422
+ goto __446
+__445:
+ nData = nData + uint64(8)
+ if !(int32((*Mem)(unsafe.Pointer(pRec)).Fflags)&MEM_IntReal != 0) {
+ goto __447
}
// If the value is IntReal and is going to take up 8 bytes to store
// as an integer, then we might as well make it an 8-byte floating
// point value
- *(*float64)(unsafe.Pointer(pRec /* &.u */)) = float64(*(*I64)(unsafe.Pointer(pRec /* &.u */)))
- *(*U16)(unsafe.Pointer(pRec + 8 /* &.flags */)) &= libc.Uint16FromInt32((libc.CplInt32(MEM_IntReal)))
- *(*U16)(unsafe.Pointer(pRec + 8 /* &.flags */)) |= U16((MEM_Real))
+ *(*float64)(unsafe.Pointer(pRec)) = float64(*(*I64)(unsafe.Pointer(pRec)))
+ *(*U16)(unsafe.Pointer(pRec + 8)) &= libc.Uint16FromInt32(libc.CplInt32(MEM_IntReal))
+ *(*U16)(unsafe.Pointer(pRec + 8)) |= U16(MEM_Real)
(*Mem)(unsafe.Pointer(pRec)).FuTemp = U32(7)
- goto __423
-__422:
+ goto __448
+__447:
(*Mem)(unsafe.Pointer(pRec)).FuTemp = U32(6)
-__423:
+__448:
;
-__421:
+__446:
;
-__419:
+__444:
;
-__417:
+__442:
;
-__415:
+__440:
;
-__411:
+__436:
;
- goto __407
-__406:
- if !((int32((*Mem)(unsafe.Pointer(pRec)).Fflags) & MEM_Real) != 0) {
- goto __424
+ goto __432
+__431:
+ if !(int32((*Mem)(unsafe.Pointer(pRec)).Fflags)&MEM_Real != 0) {
+ goto __449
}
nHdr++
- nData = nData + (uint64(8))
+ nData = nData + uint64(8)
(*Mem)(unsafe.Pointer(pRec)).FuTemp = U32(7)
- goto __425
-__424:
+ goto __450
+__449:
;
len1 = U32((*Mem)(unsafe.Pointer(pRec)).Fn)
- serial_type = (((len1 * U32(2)) + U32(12)) + (U32(libc.Bool32((int32((*Mem)(unsafe.Pointer(pRec)).Fflags) & MEM_Str) != 0))))
- if !((int32((*Mem)(unsafe.Pointer(pRec)).Fflags) & MEM_Zero) != 0) {
- goto __426
+ serial_type = len1*U32(2) + U32(12) + U32(libc.Bool32(int32((*Mem)(unsafe.Pointer(pRec)).Fflags)&MEM_Str != 0))
+ if !(int32((*Mem)(unsafe.Pointer(pRec)).Fflags)&MEM_Zero != 0) {
+ goto __451
}
- serial_type = serial_type + (U32(*(*int32)(unsafe.Pointer(pRec /* &.u */)) * 2))
+ serial_type = serial_type + U32(*(*int32)(unsafe.Pointer(pRec))*2)
if !(nData != 0) {
- goto __427
+ goto __452
}
if !(Xsqlite3VdbeMemExpandBlob(tls, pRec) != 0) {
- goto __429
+ goto __454
}
goto no_mem
-__429:
+__454:
;
- len1 = len1 + (U32(*(*int32)(unsafe.Pointer(pRec /* &.u */))))
- goto __428
-__427:
- nZero = nZero + (I64(*(*int32)(unsafe.Pointer(pRec /* &.u */))))
-__428:
+ len1 = len1 + U32(*(*int32)(unsafe.Pointer(pRec)))
+ goto __453
+__452:
+ nZero = nZero + I64(*(*int32)(unsafe.Pointer(pRec)))
+__453:
;
-__426:
+__451:
;
- nData = nData + (U64(len1))
- nHdr = nHdr + (Xsqlite3VarintLen(tls, uint64(serial_type)))
+ nData = nData + U64(len1)
+ nHdr = nHdr + Xsqlite3VarintLen(tls, uint64(serial_type))
(*Mem)(unsafe.Pointer(pRec)).FuTemp = serial_type
-__425:
+__450:
;
-__407:
+__432:
;
-__403:
+__428:
;
if !(pRec == pData0) {
- goto __430
+ goto __455
}
- goto __401
-__430:
+ goto __426
+__455:
;
pRec -= 40
- goto __400
-__400:
+ goto __425
+__425:
if 1 != 0 {
- goto __399
+ goto __424
}
- goto __401
-__401:
+ goto __426
+__426:
;
// EVIDENCE-OF: R-22564-11647 The header begins with a single varint
@@ -68871,81 +69829,81 @@ __401:
// itself.
if !(nHdr <= 126) {
- goto __431
+ goto __456
}
// The common case
- nHdr = nHdr + (1)
- goto __432
-__431:
+ nHdr = nHdr + 1
+ goto __457
+__456:
// Rare case of a really large header
nVarint = Xsqlite3VarintLen(tls, uint64(nHdr))
- nHdr = nHdr + (nVarint)
+ nHdr = nHdr + nVarint
if !(nVarint < Xsqlite3VarintLen(tls, uint64(nHdr))) {
- goto __433
+ goto __458
}
nHdr++
-__433:
+__458:
;
-__432:
+__457:
;
- nByte1 = (I64(U64(nHdr) + nData))
+ nByte1 = I64(U64(nHdr) + nData)
// Make sure the output register has a buffer large enough to store
// the new record. The output register (pOp->p3) is not allowed to
// be one of the input registers (because the following call to
// sqlite3VdbeMemClearAndResize() could clobber the value before it is used).
- if !((nByte1 + nZero) <= I64((*Mem)(unsafe.Pointer(pOut)).FszMalloc)) {
- goto __434
+ if !(nByte1+nZero <= I64((*Mem)(unsafe.Pointer(pOut)).FszMalloc)) {
+ goto __459
}
// The output register is already large enough to hold the record.
// No error checks or buffer enlargement is required
(*Mem)(unsafe.Pointer(pOut)).Fz = (*Mem)(unsafe.Pointer(pOut)).FzMalloc
- goto __435
-__434:
+ goto __460
+__459:
// Need to make sure that the output is not too big and then enlarge
// the output register to hold the full result
- if !((nByte1 + nZero) > I64(*(*int32)(unsafe.Pointer((db + 112 /* &.aLimit */))))) {
- goto __436
+ if !(nByte1+nZero > I64(*(*int32)(unsafe.Pointer(db + 120)))) {
+ goto __461
}
goto too_big
-__436:
+__461:
;
if !(Xsqlite3VdbeMemClearAndResize(tls, pOut, int32(nByte1)) != 0) {
- goto __437
+ goto __462
}
goto no_mem
-__437:
+__462:
;
-__435:
+__460:
;
(*Mem)(unsafe.Pointer(pOut)).Fn = int32(nByte1)
(*Mem)(unsafe.Pointer(pOut)).Fflags = U16(MEM_Blob)
if !(nZero != 0) {
- goto __438
+ goto __463
}
- *(*int32)(unsafe.Pointer(pOut /* &.u */)) = int32(nZero)
- *(*U16)(unsafe.Pointer(pOut + 8 /* &.flags */)) |= U16((MEM_Zero))
-__438:
+ *(*int32)(unsafe.Pointer(pOut)) = int32(nZero)
+ *(*U16)(unsafe.Pointer(pOut + 8)) |= U16(MEM_Zero)
+__463:
;
zHdr1 = (*Mem)(unsafe.Pointer(pOut)).Fz
- zPayload = (zHdr1 + uintptr(nHdr))
+ zPayload = zHdr1 + uintptr(nHdr)
// Write the record
zHdr1 += uintptr(func() uint8 {
- if (U32(nHdr)) < U32(0x80) {
+ if U32(nHdr) < U32(0x80) {
return uint8(func() int32 { *(*U8)(unsafe.Pointer(zHdr1)) = uint8(nHdr); return 1 }())
}
return uint8(Xsqlite3PutVarint(tls, zHdr1, uint64(nHdr)))
}())
pRec = pData0
-__439:
+__464:
serial_type = (*Mem)(unsafe.Pointer(pRec)).FuTemp
// EVIDENCE-OF: R-06529-47362 Following the size varint are one or more
// additional varints, one per column.
zHdr1 += uintptr(func() uint8 {
- if (serial_type) < U32(0x80) {
+ if serial_type < U32(0x80) {
return uint8(func() int32 { *(*U8)(unsafe.Pointer(zHdr1)) = uint8(serial_type); return 1 }())
}
return uint8(Xsqlite3PutVarint(tls, zHdr1, uint64(serial_type)))
@@ -68953,13 +69911,13 @@ __439:
// EVIDENCE-OF: R-64536-51728 The values for each column in the record
// immediately follow the header.
zPayload += uintptr(Xsqlite3VdbeSerialPut(tls, zPayload, pRec, serial_type)) // content
- goto __440
-__440:
- if (libc.PreIncUintptr(&pRec, 40)) <= pLast {
- goto __439
+ goto __465
+__465:
+ if libc.PreIncUintptr(&pRec, 40) <= pLast {
+ goto __464
}
- goto __441
-__441:
+ goto __466
+__466:
;
goto __8
@@ -68973,28 +69931,28 @@ __441:
// If P3==0, then an exact count is obtained, which involves visiting
// every btree page of the table. But if P3 is non-zero, an estimate
// is returned based on the current cursor position.
-__73:
+__75:
;
- pCrsr1 = *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*4)) + 40 /* &.uc */))
+ pCrsr1 = *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*4)) + 40))
if !((*Op)(unsafe.Pointer(pOp)).Fp3 != 0) {
- goto __442
+ goto __467
}
- *(*I64)(unsafe.Pointer(bp + 256 /* nEntry */)) = Xsqlite3BtreeRowCountEst(tls, pCrsr1)
- goto __443
-__442:
- *(*I64)(unsafe.Pointer(bp + 256 /* nEntry */)) = int64(0) // Not needed. Only used to silence a warning.
- rc = Xsqlite3BtreeCount(tls, db, pCrsr1, bp+256 /* &nEntry */)
+ *(*I64)(unsafe.Pointer(bp + 288 /* nEntry */)) = Xsqlite3BtreeRowCountEst(tls, pCrsr1)
+ goto __468
+__467:
+ *(*I64)(unsafe.Pointer(bp + 288 /* nEntry */)) = int64(0) // Not needed. Only used to silence a warning.
+ rc = Xsqlite3BtreeCount(tls, db, pCrsr1, bp+288 /* &nEntry */)
if !(rc != 0) {
- goto __444
+ goto __469
}
goto abort_due_to_error
-__444:
+__469:
;
-__443:
+__468:
;
pOut = out2Prerelease(tls, p, pOp)
- *(*I64)(unsafe.Pointer(pOut /* &.u */)) = *(*I64)(unsafe.Pointer(bp + 256 /* nEntry */))
+ *(*I64)(unsafe.Pointer(pOut)) = *(*I64)(unsafe.Pointer(bp + 288 /* nEntry */))
goto check_for_interrupt
// Opcode: Savepoint P1 * * P4 *
@@ -69003,26 +69961,26 @@ __443:
// on the value of P1. To open a new savepoint set P1==0 (SAVEPOINT_BEGIN).
// To release (commit) an existing savepoint set P1==1 (SAVEPOINT_RELEASE).
// To rollback an existing savepoint set P1==2 (SAVEPOINT_ROLLBACK).
-__74:
+__76:
p12 = (*Op)(unsafe.Pointer(pOp)).Fp1
- zName = *(*uintptr)(unsafe.Pointer(pOp + 16 /* &.p4 */))
+ zName = *(*uintptr)(unsafe.Pointer(pOp + 16))
// Assert that the p1 parameter is valid. Also that if there is no open
// transaction, then there cannot be any savepoints.
if !(p12 == SAVEPOINT_BEGIN) {
- goto __445
+ goto __470
}
if !((*Sqlite3)(unsafe.Pointer(db)).FnVdbeWrite > 0) {
- goto __447
+ goto __472
}
// A new savepoint cannot be created if there are active write
// statements (i.e. open read/write incremental blob handles).
- Xsqlite3VdbeError(tls, p, ts+4597 /* "cannot open save..." */, 0)
+ Xsqlite3VdbeError(tls, p, ts+5444 /* "cannot open save..." */, 0)
rc = SQLITE_BUSY
- goto __448
-__447:
+ goto __473
+__472:
nName = Xsqlite3Strlen30(tls, zName)
// This call is Ok even if this savepoint is actually a transaction
@@ -69031,33 +69989,33 @@ __447:
// that the db->aVTrans[] array is empty.
rc = Xsqlite3VtabSavepoint(tls, db, SAVEPOINT_BEGIN,
- ((*Sqlite3)(unsafe.Pointer(db)).FnStatement + (*Sqlite3)(unsafe.Pointer(db)).FnSavepoint))
+ (*Sqlite3)(unsafe.Pointer(db)).FnStatement+(*Sqlite3)(unsafe.Pointer(db)).FnSavepoint)
if !(rc != SQLITE_OK) {
- goto __449
+ goto __474
}
goto abort_due_to_error
-__449:
+__474:
;
// Create a new savepoint structure.
- pNew = Xsqlite3DbMallocRawNN(tls, db, (uint64((uint32(unsafe.Sizeof(Savepoint{})) + uint32(nName)) + uint32(1))))
+ pNew = Xsqlite3DbMallocRawNN(tls, db, uint64(uint32(unsafe.Sizeof(Savepoint{}))+uint32(nName)+uint32(1)))
if !(pNew != 0) {
- goto __450
+ goto __475
}
- (*Savepoint)(unsafe.Pointer(pNew)).FzName = (pNew + 1*32)
- libc.Xmemcpy(tls, (*Savepoint)(unsafe.Pointer(pNew)).FzName, zName, (uint32(nName + 1)))
+ (*Savepoint)(unsafe.Pointer(pNew)).FzName = pNew + 1*32
+ libc.Xmemcpy(tls, (*Savepoint)(unsafe.Pointer(pNew)).FzName, zName, uint32(nName+1))
// If there is no open transaction, then mark this as a special
// "transaction savepoint".
if !((*Sqlite3)(unsafe.Pointer(db)).FautoCommit != 0) {
- goto __451
+ goto __476
}
(*Sqlite3)(unsafe.Pointer(db)).FautoCommit = U8(0)
(*Sqlite3)(unsafe.Pointer(db)).FisTransactionSavepoint = U8(1)
- goto __452
-__451:
+ goto __477
+__476:
(*Sqlite3)(unsafe.Pointer(db)).FnSavepoint++
-__452:
+__477:
;
// Link the new savepoint into the database handle's list.
@@ -69065,163 +70023,163 @@ __452:
(*Sqlite3)(unsafe.Pointer(db)).FpSavepoint = pNew
(*Savepoint)(unsafe.Pointer(pNew)).FnDeferredCons = (*Sqlite3)(unsafe.Pointer(db)).FnDeferredCons
(*Savepoint)(unsafe.Pointer(pNew)).FnDeferredImmCons = (*Sqlite3)(unsafe.Pointer(db)).FnDeferredImmCons
-__450:
+__475:
;
-__448:
+__473:
;
- goto __446
-__445:
+ goto __471
+__470:
;
iSavepoint = 0
// Find the named savepoint. If there is no such savepoint, then an
// an error is returned to the user.
pSavepoint = (*Sqlite3)(unsafe.Pointer(db)).FpSavepoint
-__453:
- if !((pSavepoint != 0) && (Xsqlite3StrICmp(tls, (*Savepoint)(unsafe.Pointer(pSavepoint)).FzName, zName) != 0)) {
- goto __455
+__478:
+ if !(pSavepoint != 0 && Xsqlite3StrICmp(tls, (*Savepoint)(unsafe.Pointer(pSavepoint)).FzName, zName) != 0) {
+ goto __480
}
iSavepoint++
- goto __454
-__454:
+ goto __479
+__479:
pSavepoint = (*Savepoint)(unsafe.Pointer(pSavepoint)).FpNext
- goto __453
- goto __455
-__455:
+ goto __478
+ goto __480
+__480:
;
- if !(!(pSavepoint != 0)) {
- goto __456
+ if !!(pSavepoint != 0) {
+ goto __481
}
- Xsqlite3VdbeError(tls, p, ts+4648 /* "no such savepoin..." */, libc.VaList(bp+56, zName))
+ Xsqlite3VdbeError(tls, p, ts+5495 /* "no such savepoin..." */, libc.VaList(bp+88, zName))
rc = SQLITE_ERROR
- goto __457
-__456:
- if !(((*Sqlite3)(unsafe.Pointer(db)).FnVdbeWrite > 0) && (p12 == SAVEPOINT_RELEASE)) {
- goto __458
+ goto __482
+__481:
+ if !((*Sqlite3)(unsafe.Pointer(db)).FnVdbeWrite > 0 && p12 == SAVEPOINT_RELEASE) {
+ goto __483
}
// It is not possible to release (commit) a savepoint if there are
// active write statements.
Xsqlite3VdbeError(tls, p,
- ts+4670 /* "cannot release s..." */, 0)
+ ts+5517 /* "cannot release s..." */, 0)
rc = SQLITE_BUSY
- goto __459
-__458:
+ goto __484
+__483:
// Determine whether or not this is a transaction savepoint. If so,
// and this is a RELEASE command, then the current transaction
// is committed.
- isTransaction = (libc.Bool32(((*Savepoint)(unsafe.Pointer(pSavepoint)).FpNext == uintptr(0)) && ((*Sqlite3)(unsafe.Pointer(db)).FisTransactionSavepoint != 0)))
- if !((isTransaction != 0) && (p12 == SAVEPOINT_RELEASE)) {
- goto __460
+ isTransaction = libc.Bool32((*Savepoint)(unsafe.Pointer(pSavepoint)).FpNext == uintptr(0) && (*Sqlite3)(unsafe.Pointer(db)).FisTransactionSavepoint != 0)
+ if !(isTransaction != 0 && p12 == SAVEPOINT_RELEASE) {
+ goto __485
}
- if !((libc.AssignInt32(&rc, Xsqlite3VdbeCheckFk(tls, p, 1))) != SQLITE_OK) {
- goto __462
+ if !(libc.AssignInt32(&rc, Xsqlite3VdbeCheckFk(tls, p, 1)) != SQLITE_OK) {
+ goto __487
}
goto vdbe_return
-__462:
+__487:
;
(*Sqlite3)(unsafe.Pointer(db)).FautoCommit = U8(1)
if !(Xsqlite3VdbeHalt(tls, p) == SQLITE_BUSY) {
- goto __463
+ goto __488
}
- (*Vdbe)(unsafe.Pointer(p)).Fpc = ((int32(pOp) - int32(aOp)) / 20)
+ (*Vdbe)(unsafe.Pointer(p)).Fpc = (int32(pOp) - int32(aOp)) / 20
(*Sqlite3)(unsafe.Pointer(db)).FautoCommit = U8(0)
(*Vdbe)(unsafe.Pointer(p)).Frc = libc.AssignInt32(&rc, SQLITE_BUSY)
goto vdbe_return
-__463:
+__488:
;
rc = (*Vdbe)(unsafe.Pointer(p)).Frc
if !(rc != 0) {
- goto __464
+ goto __489
}
(*Sqlite3)(unsafe.Pointer(db)).FautoCommit = U8(0)
- goto __465
-__464:
+ goto __490
+__489:
(*Sqlite3)(unsafe.Pointer(db)).FisTransactionSavepoint = U8(0)
-__465:
+__490:
;
- goto __461
-__460:
- iSavepoint = (((*Sqlite3)(unsafe.Pointer(db)).FnSavepoint - iSavepoint) - 1)
+ goto __486
+__485:
+ iSavepoint = (*Sqlite3)(unsafe.Pointer(db)).FnSavepoint - iSavepoint - 1
if !(p12 == SAVEPOINT_ROLLBACK) {
- goto __466
+ goto __491
}
- isSchemaChange = (libc.Bool32(((*Sqlite3)(unsafe.Pointer(db)).FmDbFlags & U32(DBFLAG_SchemaChange)) != U32(0)))
+ isSchemaChange = libc.Bool32((*Sqlite3)(unsafe.Pointer(db)).FmDbFlags&U32(DBFLAG_SchemaChange) != U32(0))
ii = 0
-__468:
+__493:
if !(ii < (*Sqlite3)(unsafe.Pointer(db)).FnDb) {
- goto __470
+ goto __495
}
rc = Xsqlite3BtreeTripAllCursors(tls, (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+uintptr(ii)*16)).FpBt,
- (SQLITE_ABORT | (int32(2) << 8)),
- (libc.Bool32(isSchemaChange == 0)))
+ SQLITE_ABORT|int32(2)<<8,
+ libc.Bool32(isSchemaChange == 0))
if !(rc != SQLITE_OK) {
- goto __471
+ goto __496
}
goto abort_due_to_error
-__471:
+__496:
;
- goto __469
-__469:
+ goto __494
+__494:
ii++
- goto __468
- goto __470
-__470:
+ goto __493
+ goto __495
+__495:
;
- goto __467
-__466:
+ goto __492
+__491:
;
isSchemaChange = 0
-__467:
+__492:
;
ii = 0
-__472:
+__497:
if !(ii < (*Sqlite3)(unsafe.Pointer(db)).FnDb) {
- goto __474
+ goto __499
}
rc = Xsqlite3BtreeSavepoint(tls, (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+uintptr(ii)*16)).FpBt, p12, iSavepoint)
if !(rc != SQLITE_OK) {
- goto __475
+ goto __500
}
goto abort_due_to_error
-__475:
+__500:
;
- goto __473
-__473:
+ goto __498
+__498:
ii++
- goto __472
- goto __474
-__474:
+ goto __497
+ goto __499
+__499:
;
if !(isSchemaChange != 0) {
- goto __476
+ goto __501
}
Xsqlite3ExpirePreparedStatements(tls, db, 0)
Xsqlite3ResetAllSchemasOfConnection(tls, db)
- *(*U32)(unsafe.Pointer(db + 24 /* &.mDbFlags */)) |= (U32(DBFLAG_SchemaChange))
-__476:
+ *(*U32)(unsafe.Pointer(db + 24)) |= U32(DBFLAG_SchemaChange)
+__501:
;
-__461:
+__486:
;
if !(rc != 0) {
- goto __477
+ goto __502
}
goto abort_due_to_error
-__477:
+__502:
;
// Regardless of whether this is a RELEASE or ROLLBACK, destroy all
// savepoints nested inside of the savepoint being operated on.
-__478:
+__503:
if !((*Sqlite3)(unsafe.Pointer(db)).FpSavepoint != pSavepoint) {
- goto __479
+ goto __504
}
pTmp = (*Sqlite3)(unsafe.Pointer(db)).FpSavepoint
(*Sqlite3)(unsafe.Pointer(db)).FpSavepoint = (*Savepoint)(unsafe.Pointer(pTmp)).FpNext
Xsqlite3DbFree(tls, db, pTmp)
(*Sqlite3)(unsafe.Pointer(db)).FnSavepoint--
- goto __478
-__479:
+ goto __503
+__504:
;
// If it is a RELEASE, then destroy the savepoint being operated on
@@ -69229,48 +70187,48 @@ __479:
// constraint violations present in the database to the value stored
// when the savepoint was created.
if !(p12 == SAVEPOINT_RELEASE) {
- goto __480
+ goto __505
}
(*Sqlite3)(unsafe.Pointer(db)).FpSavepoint = (*Savepoint)(unsafe.Pointer(pSavepoint)).FpNext
Xsqlite3DbFree(tls, db, pSavepoint)
- if !(!(isTransaction != 0)) {
- goto __482
+ if !!(isTransaction != 0) {
+ goto __507
}
(*Sqlite3)(unsafe.Pointer(db)).FnSavepoint--
-__482:
+__507:
;
- goto __481
-__480:
+ goto __506
+__505:
;
(*Sqlite3)(unsafe.Pointer(db)).FnDeferredCons = (*Savepoint)(unsafe.Pointer(pSavepoint)).FnDeferredCons
(*Sqlite3)(unsafe.Pointer(db)).FnDeferredImmCons = (*Savepoint)(unsafe.Pointer(pSavepoint)).FnDeferredImmCons
-__481:
+__506:
;
- if !(!(isTransaction != 0) || (p12 == SAVEPOINT_ROLLBACK)) {
- goto __483
+ if !(!(isTransaction != 0) || p12 == SAVEPOINT_ROLLBACK) {
+ goto __508
}
rc = Xsqlite3VtabSavepoint(tls, db, p12, iSavepoint)
if !(rc != SQLITE_OK) {
- goto __484
+ goto __509
}
goto abort_due_to_error
-__484:
+__509:
;
-__483:
+__508:
;
-__459:
+__484:
;
-__457:
+__482:
;
-__446:
+__471:
;
if !(rc != 0) {
- goto __485
+ goto __510
}
goto abort_due_to_error
-__485:
+__510:
;
goto __8
@@ -69283,7 +70241,7 @@ __485:
// there are active writing VMs or active VMs that use shared cache.
//
// This instruction causes the VM to halt.
-__75:
+__77:
desiredAutoCommit = (*Op)(unsafe.Pointer(pOp)).Fp1
iRollback = (*Op)(unsafe.Pointer(pOp)).Fp2
@@ -69291,78 +70249,78 @@ __75:
// At least this one VM is active
if !(desiredAutoCommit != int32((*Sqlite3)(unsafe.Pointer(db)).FautoCommit)) {
- goto __486
+ goto __511
}
if !(iRollback != 0) {
- goto __488
+ goto __513
}
- Xsqlite3RollbackAll(tls, db, (SQLITE_ABORT | (int32(2) << 8)))
+ Xsqlite3RollbackAll(tls, db, SQLITE_ABORT|int32(2)<<8)
(*Sqlite3)(unsafe.Pointer(db)).FautoCommit = U8(1)
- goto __489
-__488:
- if !((desiredAutoCommit != 0) && ((*Sqlite3)(unsafe.Pointer(db)).FnVdbeWrite > 0)) {
- goto __490
+ goto __514
+__513:
+ if !(desiredAutoCommit != 0 && (*Sqlite3)(unsafe.Pointer(db)).FnVdbeWrite > 0) {
+ goto __515
}
// If this instruction implements a COMMIT and other VMs are writing
// return an error indicating that the other VMs must complete first.
Xsqlite3VdbeError(tls, p,
- ts+4724 /* "cannot commit tr..." */, 0)
+ ts+5571 /* "cannot commit tr..." */, 0)
rc = SQLITE_BUSY
goto abort_due_to_error
- goto __491
-__490:
- if !((libc.AssignInt32(&rc, Xsqlite3VdbeCheckFk(tls, p, 1))) != SQLITE_OK) {
- goto __492
+ goto __516
+__515:
+ if !(libc.AssignInt32(&rc, Xsqlite3VdbeCheckFk(tls, p, 1)) != SQLITE_OK) {
+ goto __517
}
goto vdbe_return
- goto __493
-__492:
+ goto __518
+__517:
(*Sqlite3)(unsafe.Pointer(db)).FautoCommit = U8(desiredAutoCommit)
-__493:
+__518:
;
-__491:
+__516:
;
-__489:
+__514:
;
if !(Xsqlite3VdbeHalt(tls, p) == SQLITE_BUSY) {
- goto __494
+ goto __519
}
- (*Vdbe)(unsafe.Pointer(p)).Fpc = ((int32(pOp) - int32(aOp)) / 20)
- (*Sqlite3)(unsafe.Pointer(db)).FautoCommit = (U8(1 - desiredAutoCommit))
+ (*Vdbe)(unsafe.Pointer(p)).Fpc = (int32(pOp) - int32(aOp)) / 20
+ (*Sqlite3)(unsafe.Pointer(db)).FautoCommit = U8(1 - desiredAutoCommit)
(*Vdbe)(unsafe.Pointer(p)).Frc = libc.AssignInt32(&rc, SQLITE_BUSY)
goto vdbe_return
-__494:
+__519:
;
Xsqlite3CloseSavepoints(tls, db)
if !((*Vdbe)(unsafe.Pointer(p)).Frc == SQLITE_OK) {
- goto __495
+ goto __520
}
rc = SQLITE_DONE
- goto __496
-__495:
+ goto __521
+__520:
rc = SQLITE_ERROR
-__496:
+__521:
;
goto vdbe_return
- goto __487
-__486:
+ goto __512
+__511:
Xsqlite3VdbeError(tls, p,
func() uintptr {
if !(desiredAutoCommit != 0) {
- return ts + 4779 /* "cannot start a t..." */
+ return ts + 5626 /* "cannot start a t..." */
}
return func() uintptr {
if iRollback != 0 {
- return ts + 4827 /* "cannot rollback ..." */
+ return ts + 5674 /* "cannot rollback ..." */
}
- return ts + 4870 /* "cannot commit - ..." */
+ return ts + 5717 /* "cannot commit - ..." */
}()
}(), 0)
rc = SQLITE_ERROR
goto abort_due_to_error
-__487:
+__512:
;
/*NOTREACHED*/
@@ -69400,59 +70358,70 @@ __487:
// generation counter, then an SQLITE_SCHEMA error is raised and execution
// halts. The sqlite3_step() wrapper function might then reprepare the
// statement and rerun it from the beginning.
-__76:
- *(*int32)(unsafe.Pointer(bp + 264 /* iMeta */)) = 0
+__78:
+ *(*int32)(unsafe.Pointer(bp + 296 /* iMeta */)) = 0
- if !(((*Op)(unsafe.Pointer(pOp)).Fp2 != 0) && (((*Sqlite3)(unsafe.Pointer(db)).Fflags & uint64(SQLITE_QueryOnly)) != uint64(0))) {
- goto __497
+ if !((*Op)(unsafe.Pointer(pOp)).Fp2 != 0 && (*Sqlite3)(unsafe.Pointer(db)).Fflags&(uint64(SQLITE_QueryOnly)|U64(uint64(0x00002))<<32) != uint64(0)) {
+ goto __522
+ }
+ if !((*Sqlite3)(unsafe.Pointer(db)).Fflags&uint64(SQLITE_QueryOnly) != 0) {
+ goto __523
}
+ // Writes prohibited by the "PRAGMA query_only=TRUE" statement
rc = SQLITE_READONLY
+ goto __524
+__523:
+ // Writes prohibited due to a prior SQLITE_CORRUPT in the current
+ // transaction
+ rc = SQLITE_CORRUPT
+__524:
+ ;
goto abort_due_to_error
-__497:
+__522:
;
pBt = (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*16)).FpBt
if !(pBt != 0) {
- goto __498
+ goto __525
}
- rc = Xsqlite3BtreeBeginTrans(tls, pBt, (*Op)(unsafe.Pointer(pOp)).Fp2, bp+264 /* &iMeta */)
+ rc = Xsqlite3BtreeBeginTrans(tls, pBt, (*Op)(unsafe.Pointer(pOp)).Fp2, bp+296 /* &iMeta */)
if !(rc != SQLITE_OK) {
- goto __499
+ goto __526
}
- if !((rc & 0xff) == SQLITE_BUSY) {
- goto __500
+ if !(rc&0xff == SQLITE_BUSY) {
+ goto __527
}
- (*Vdbe)(unsafe.Pointer(p)).Fpc = ((int32(pOp) - int32(aOp)) / 20)
+ (*Vdbe)(unsafe.Pointer(p)).Fpc = (int32(pOp) - int32(aOp)) / 20
(*Vdbe)(unsafe.Pointer(p)).Frc = rc
goto vdbe_return
-__500:
+__527:
;
goto abort_due_to_error
-__499:
+__526:
;
- if !((((Bft(int32(*(*uint16)(unsafe.Pointer(p + 152 /* &.usesStmtJournal */)) & 0x40 >> 6))) != 0) &&
- ((*Op)(unsafe.Pointer(pOp)).Fp2 != 0)) &&
- ((int32((*Sqlite3)(unsafe.Pointer(db)).FautoCommit) == 0) || ((*Sqlite3)(unsafe.Pointer(db)).FnVdbeRead > 1))) {
- goto __501
+ if !(Bft(int32(*(*uint16)(unsafe.Pointer(p + 160))&0x40>>6)) != 0 &&
+ (*Op)(unsafe.Pointer(pOp)).Fp2 != 0 &&
+ (int32((*Sqlite3)(unsafe.Pointer(db)).FautoCommit) == 0 || (*Sqlite3)(unsafe.Pointer(db)).FnVdbeRead > 1)) {
+ goto __528
}
if !((*Vdbe)(unsafe.Pointer(p)).FiStatement == 0) {
- goto __502
+ goto __529
}
(*Sqlite3)(unsafe.Pointer(db)).FnStatement++
- (*Vdbe)(unsafe.Pointer(p)).FiStatement = ((*Sqlite3)(unsafe.Pointer(db)).FnSavepoint + (*Sqlite3)(unsafe.Pointer(db)).FnStatement)
-__502:
+ (*Vdbe)(unsafe.Pointer(p)).FiStatement = (*Sqlite3)(unsafe.Pointer(db)).FnSavepoint + (*Sqlite3)(unsafe.Pointer(db)).FnStatement
+__529:
;
- rc = Xsqlite3VtabSavepoint(tls, db, SAVEPOINT_BEGIN, ((*Vdbe)(unsafe.Pointer(p)).FiStatement - 1))
+ rc = Xsqlite3VtabSavepoint(tls, db, SAVEPOINT_BEGIN, (*Vdbe)(unsafe.Pointer(p)).FiStatement-1)
if !(rc == SQLITE_OK) {
- goto __503
+ goto __530
}
rc = Xsqlite3BtreeBeginStmt(tls, pBt, (*Vdbe)(unsafe.Pointer(p)).FiStatement)
-__503:
+__530:
;
// Store the current value of the database handles deferred constraint
@@ -69460,21 +70429,22 @@ __503:
// the value of this counter needs to be restored too.
(*Vdbe)(unsafe.Pointer(p)).FnStmtDefCons = (*Sqlite3)(unsafe.Pointer(db)).FnDeferredCons
(*Vdbe)(unsafe.Pointer(p)).FnStmtDefImmCons = (*Sqlite3)(unsafe.Pointer(db)).FnDeferredImmCons
-__501:
+__528:
;
-__498:
+__525:
;
- if !(((*Op)(unsafe.Pointer(pOp)).Fp5 != 0) &&
- ((*(*int32)(unsafe.Pointer(bp + 264 /* iMeta */)) != (*Op)(unsafe.Pointer(pOp)).Fp3) ||
- ((*Schema)(unsafe.Pointer((*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*16)).FpSchema)).FiGeneration != *(*int32)(unsafe.Pointer(pOp + 16 /* &.p4 */))))) {
- goto __504
+ if !(rc == SQLITE_OK &&
+ (*Op)(unsafe.Pointer(pOp)).Fp5 != 0 &&
+ (*(*int32)(unsafe.Pointer(bp + 296)) != (*Op)(unsafe.Pointer(pOp)).Fp3 ||
+ (*Schema)(unsafe.Pointer((*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*16)).FpSchema)).FiGeneration != *(*int32)(unsafe.Pointer(pOp + 16)))) {
+ goto __531
}
// IMPLEMENTATION-OF: R-03189-51135 As each SQL statement runs, the schema
// version is checked to ensure that the schema has not changed since the
// SQL statement was prepared.
Xsqlite3DbFree(tls, db, (*Vdbe)(unsafe.Pointer(p)).FzErrMsg)
- (*Vdbe)(unsafe.Pointer(p)).FzErrMsg = Xsqlite3DbStrDup(tls, db, ts+4911 /* "database schema ..." */)
+ (*Vdbe)(unsafe.Pointer(p)).FzErrMsg = Xsqlite3DbStrDup(tls, db, ts+5758 /* "database schema ..." */)
// If the schema-cookie from the database file matches the cookie
// stored with the in-memory representation of the schema, do
// not reload the schema from the database file.
@@ -69487,21 +70457,21 @@ __498:
// v-table would have to be ready for the sqlite3_vtab structure itself
// to be invalidated whenever sqlite3_step() is called from within
// a v-table method.
- if !((*Schema)(unsafe.Pointer((*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*16)).FpSchema)).Fschema_cookie != *(*int32)(unsafe.Pointer(bp + 264 /* iMeta */))) {
- goto __505
+ if !((*Schema)(unsafe.Pointer((*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*16)).FpSchema)).Fschema_cookie != *(*int32)(unsafe.Pointer(bp + 296))) {
+ goto __532
}
Xsqlite3ResetOneSchema(tls, db, (*Op)(unsafe.Pointer(pOp)).Fp1)
-__505:
+__532:
;
- libc.SetBitFieldPtr16Uint32(p+152 /* &.expired */, Bft(1), 0, 0x3)
+ libc.SetBitFieldPtr16Uint32(p+160, Bft(1), 0, 0x3)
rc = SQLITE_SCHEMA
-__504:
+__531:
;
if !(rc != 0) {
- goto __506
+ goto __533
}
goto abort_due_to_error
-__506:
+__533:
;
goto __8
@@ -69516,14 +70486,14 @@ __506:
// There must be a read-lock on the database (either a transaction
// must be started or there must be an open cursor) before
// executing this instruction.
-__77:
+__79:
;
iDb = (*Op)(unsafe.Pointer(pOp)).Fp1
iCookie = (*Op)(unsafe.Pointer(pOp)).Fp3
- Xsqlite3BtreeGetMeta(tls, (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+uintptr(iDb)*16)).FpBt, iCookie, bp+268 /* &iMeta1 */)
+ Xsqlite3BtreeGetMeta(tls, (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+uintptr(iDb)*16)).FpBt, iCookie, bp+300 /* &iMeta1 */)
pOut = out2Prerelease(tls, p, pOp)
- *(*I64)(unsafe.Pointer(pOut /* &.u */)) = I64(*(*int32)(unsafe.Pointer(bp + 268 /* iMeta1 */)))
+ *(*I64)(unsafe.Pointer(pOut)) = I64(*(*int32)(unsafe.Pointer(bp + 300 /* iMeta1 */)))
goto __8
// Opcode: SetCookie P1 P2 P3 * P5
@@ -69540,44 +70510,44 @@ __77:
// schema version is set to P3-P5. The "PRAGMA schema_version=N" statement
// has P5 set to 1, so that the internal schema version will be different
// from the database schema version, resulting in a schema reset.
-__78:
+__80:
;
- pDb = ((*Sqlite3)(unsafe.Pointer(db)).FaDb + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*16)
+ pDb = (*Sqlite3)(unsafe.Pointer(db)).FaDb + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*16
// See note about index shifting on OP_ReadCookie
rc = Xsqlite3BtreeUpdateMeta(tls, (*Db)(unsafe.Pointer(pDb)).FpBt, (*Op)(unsafe.Pointer(pOp)).Fp2, uint32((*Op)(unsafe.Pointer(pOp)).Fp3))
if !((*Op)(unsafe.Pointer(pOp)).Fp2 == BTREE_SCHEMA_VERSION) {
- goto __507
+ goto __534
}
// When the schema cookie changes, record the new cookie internally
- (*Schema)(unsafe.Pointer((*Db)(unsafe.Pointer(pDb)).FpSchema)).Fschema_cookie = ((*Op)(unsafe.Pointer(pOp)).Fp3 - int32((*Op)(unsafe.Pointer(pOp)).Fp5))
- *(*U32)(unsafe.Pointer(db + 24 /* &.mDbFlags */)) |= (U32(DBFLAG_SchemaChange))
- goto __508
-__507:
+ (*Schema)(unsafe.Pointer((*Db)(unsafe.Pointer(pDb)).FpSchema)).Fschema_cookie = (*Op)(unsafe.Pointer(pOp)).Fp3 - int32((*Op)(unsafe.Pointer(pOp)).Fp5)
+ *(*U32)(unsafe.Pointer(db + 24)) |= U32(DBFLAG_SchemaChange)
+ goto __535
+__534:
if !((*Op)(unsafe.Pointer(pOp)).Fp2 == BTREE_FILE_FORMAT) {
- goto __509
+ goto __536
}
// Record changes in the file format
(*Schema)(unsafe.Pointer((*Db)(unsafe.Pointer(pDb)).FpSchema)).Ffile_format = U8((*Op)(unsafe.Pointer(pOp)).Fp3)
-__509:
+__536:
;
-__508:
+__535:
;
if !((*Op)(unsafe.Pointer(pOp)).Fp1 == 1) {
- goto __510
+ goto __537
}
// Invalidate all prepared statements whenever the TEMP database
// schema is changed. Ticket #1644
Xsqlite3ExpirePreparedStatements(tls, db, 0)
- libc.SetBitFieldPtr16Uint32(p+152 /* &.expired */, Bft(0), 0, 0x3)
-__510:
+ libc.SetBitFieldPtr16Uint32(p+160, Bft(0), 0, 0x3)
+__537:
;
if !(rc != 0) {
- goto __511
+ goto __538
}
goto abort_due_to_error
-__511:
+__538:
;
goto __8
@@ -69662,29 +70632,31 @@ __511:
// in read/write mode.
//
// See also: OP_OpenRead, OP_ReopenIdx
-__79:
+__81:
;
pCur = *(*uintptr)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*4))
- if !((pCur != 0) && ((*VdbeCursor)(unsafe.Pointer(pCur)).FpgnoRoot == U32((*Op)(unsafe.Pointer(pOp)).Fp2))) {
- goto __512
+ if !(pCur != 0 && (*VdbeCursor)(unsafe.Pointer(pCur)).FpgnoRoot == U32((*Op)(unsafe.Pointer(pOp)).Fp2)) {
+ goto __539
}
// Guaranteed by the code generator
+
+ Xsqlite3BtreeClearCursor(tls, *(*uintptr)(unsafe.Pointer(pCur + 40)))
goto open_cursor_set_hints
-__512:
+__539:
;
// If the cursor is not currently open or is open on a different
// index, then fall through into OP_OpenRead to force a reopen
-__80:
-__81:
+__82:
+__83:
;
- if !((int32(*(*uint16)(unsafe.Pointer(p + 152 /* &.expired */)) & 0x3 >> 0)) == 1) {
- goto __513
+ if !(int32(*(*uint16)(unsafe.Pointer(p + 160))&0x3>>0) == 1) {
+ goto __540
}
- rc = (SQLITE_ABORT | (int32(2) << 8))
+ rc = SQLITE_ABORT | int32(2)<<8
goto abort_due_to_error
-__513:
+__540:
;
nField1 = 0
@@ -69692,87 +70664,87 @@ __513:
p23 = U32((*Op)(unsafe.Pointer(pOp)).Fp2)
iDb1 = (*Op)(unsafe.Pointer(pOp)).Fp3
- pDb1 = ((*Sqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb1)*16)
+ pDb1 = (*Sqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb1)*16
pX = (*Db)(unsafe.Pointer(pDb1)).FpBt
if !(int32((*Op)(unsafe.Pointer(pOp)).Fopcode) == OP_OpenWrite) {
- goto __514
+ goto __541
}
- wrFlag = (BTREE_WRCSR | (int32((*Op)(unsafe.Pointer(pOp)).Fp5) & OPFLAG_FORDELETE))
+ wrFlag = BTREE_WRCSR | int32((*Op)(unsafe.Pointer(pOp)).Fp5)&OPFLAG_FORDELETE
if !(int32((*Schema)(unsafe.Pointer((*Db)(unsafe.Pointer(pDb1)).FpSchema)).Ffile_format) < int32((*Vdbe)(unsafe.Pointer(p)).FminWriteFileFormat)) {
- goto __516
+ goto __543
}
(*Vdbe)(unsafe.Pointer(p)).FminWriteFileFormat = (*Schema)(unsafe.Pointer((*Db)(unsafe.Pointer(pDb1)).FpSchema)).Ffile_format
-__516:
+__543:
;
- goto __515
-__514:
+ goto __542
+__541:
wrFlag = 0
-__515:
+__542:
;
- if !((int32((*Op)(unsafe.Pointer(pOp)).Fp5) & OPFLAG_P2ISREG) != 0) {
- goto __517
+ if !(int32((*Op)(unsafe.Pointer(pOp)).Fp5)&OPFLAG_P2ISREG != 0) {
+ goto __544
}
- pIn2 = (aMem + uintptr(p23)*40)
+ pIn2 = aMem + uintptr(p23)*40
Xsqlite3VdbeMemIntegerify(tls, pIn2)
- p23 = U32(int32(*(*I64)(unsafe.Pointer(pIn2 /* &.u */))))
+ p23 = U32(int32(*(*I64)(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.
-__517:
+__544:
;
- if !(int32((*Op)(unsafe.Pointer(pOp)).Fp4type) == (-9)) {
- goto __518
+ if !(int32((*Op)(unsafe.Pointer(pOp)).Fp4type) == -9) {
+ goto __545
}
- pKeyInfo1 = *(*uintptr)(unsafe.Pointer(pOp + 16 /* &.p4 */))
+ pKeyInfo1 = *(*uintptr)(unsafe.Pointer(pOp + 16))
nField1 = int32((*KeyInfo)(unsafe.Pointer(pKeyInfo1)).FnAllField)
- goto __519
-__518:
- if !(int32((*Op)(unsafe.Pointer(pOp)).Fp4type) == (-3)) {
- goto __520
+ goto __546
+__545:
+ if !(int32((*Op)(unsafe.Pointer(pOp)).Fp4type) == -3) {
+ goto __547
}
- nField1 = *(*int32)(unsafe.Pointer(pOp + 16 /* &.p4 */))
-__520:
+ nField1 = *(*int32)(unsafe.Pointer(pOp + 16))
+__547:
;
-__519:
+__546:
;
// Table with INTEGER PRIMARY KEY and nothing else
pCur = allocateCursor(tls, p, (*Op)(unsafe.Pointer(pOp)).Fp1, nField1, iDb1, uint8(CURTYPE_BTREE))
if !(pCur == uintptr(0)) {
- goto __521
+ goto __548
}
goto no_mem
-__521:
+__548:
;
(*VdbeCursor)(unsafe.Pointer(pCur)).FnullRow = U8(1)
- libc.SetBitFieldPtr8Uint32(pCur+8 /* &.isOrdered */, Bool(1), 2, 0x4)
+ libc.SetBitFieldPtr8Uint32(pCur+8, Bool(1), 2, 0x4)
(*VdbeCursor)(unsafe.Pointer(pCur)).FpgnoRoot = p23
- rc = Xsqlite3BtreeCursor(tls, pX, p23, wrFlag, pKeyInfo1, *(*uintptr)(unsafe.Pointer(pCur + 40 /* &.uc */)))
+ rc = Xsqlite3BtreeCursor(tls, pX, p23, wrFlag, pKeyInfo1, *(*uintptr)(unsafe.Pointer(pCur + 40)))
(*VdbeCursor)(unsafe.Pointer(pCur)).FpKeyInfo = pKeyInfo1
// Set the VdbeCursor.isTable variable. Previous versions of
// SQLite used to check if the root-page flags were sane at this point
// and report database corruption if they were not, but this check has
// since moved into the btree layer.
- (*VdbeCursor)(unsafe.Pointer(pCur)).FisTable = (U8(libc.Bool32(int32((*Op)(unsafe.Pointer(pOp)).Fp4type) != (-9))))
+ (*VdbeCursor)(unsafe.Pointer(pCur)).FisTable = U8(libc.Bool32(int32((*Op)(unsafe.Pointer(pOp)).Fp4type) != -9))
open_cursor_set_hints:
;
- Xsqlite3BtreeCursorHintFlags(tls, *(*uintptr)(unsafe.Pointer(pCur + 40 /* &.uc */)),
- (uint32(int32((*Op)(unsafe.Pointer(pOp)).Fp5) & (OPFLAG_BULKCSR | OPFLAG_SEEKEQ))))
+ Xsqlite3BtreeCursorHintFlags(tls, *(*uintptr)(unsafe.Pointer(pCur + 40)),
+ uint32(int32((*Op)(unsafe.Pointer(pOp)).Fp5)&(OPFLAG_BULKCSR|OPFLAG_SEEKEQ)))
if !(rc != 0) {
- goto __522
+ goto __549
}
goto abort_due_to_error
-__522:
+__549:
;
goto __8
@@ -69783,7 +70755,7 @@ __522:
// opcode. Only ephemeral cursors may be duplicated.
//
// Duplicate ephemeral cursors are used for self-joins of materialized views.
-__82: // The new cursor
+__84: // The new cursor
pOrig = *(*uintptr)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*Op)(unsafe.Pointer(pOp)).Fp2)*4))
@@ -69791,22 +70763,22 @@ __82: // The new cursor
pCx = allocateCursor(tls, p, (*Op)(unsafe.Pointer(pOp)).Fp1, int32((*VdbeCursor)(unsafe.Pointer(pOrig)).FnField), -1, uint8(CURTYPE_BTREE))
if !(pCx == uintptr(0)) {
- goto __523
+ goto __550
}
goto no_mem
-__523:
+__550:
;
(*VdbeCursor)(unsafe.Pointer(pCx)).FnullRow = U8(1)
- libc.SetBitFieldPtr8Uint32(pCx+8 /* &.isEphemeral */, Bool(1), 0, 0x1)
+ libc.SetBitFieldPtr8Uint32(pCx+8, Bool(1), 0, 0x1)
(*VdbeCursor)(unsafe.Pointer(pCx)).FpKeyInfo = (*VdbeCursor)(unsafe.Pointer(pOrig)).FpKeyInfo
(*VdbeCursor)(unsafe.Pointer(pCx)).FisTable = (*VdbeCursor)(unsafe.Pointer(pOrig)).FisTable
(*VdbeCursor)(unsafe.Pointer(pCx)).FpgnoRoot = (*VdbeCursor)(unsafe.Pointer(pOrig)).FpgnoRoot
- libc.SetBitFieldPtr8Uint32(pCx+8 /* &.isOrdered */, (Bool(int32(*(*uint8)(unsafe.Pointer(pOrig + 8 /* &.isOrdered */)) & 0x4 >> 2))), 2, 0x4)
+ libc.SetBitFieldPtr8Uint32(pCx+8, Bool(int32(*(*uint8)(unsafe.Pointer(pOrig + 8))&0x4>>2)), 2, 0x4)
(*VdbeCursor)(unsafe.Pointer(pCx)).FpBtx = (*VdbeCursor)(unsafe.Pointer(pOrig)).FpBtx
- libc.SetBitFieldPtr8Uint32(pCx+8 /* &.hasBeenDuped */, Bool(1), 3, 0x8)
- libc.SetBitFieldPtr8Uint32(pOrig+8 /* &.hasBeenDuped */, Bool(1), 3, 0x8)
+ libc.SetBitFieldPtr8Uint32(pCx+8, Bool(1), 3, 0x8)
+ libc.SetBitFieldPtr8Uint32(pOrig+8, Bool(1), 3, 0x8)
rc = Xsqlite3BtreeCursor(tls, (*VdbeCursor)(unsafe.Pointer(pCx)).FpBtx, (*VdbeCursor)(unsafe.Pointer(pCx)).FpgnoRoot, BTREE_WRCSR,
- (*VdbeCursor)(unsafe.Pointer(pCx)).FpKeyInfo, *(*uintptr)(unsafe.Pointer(pCx + 40 /* &.uc */)))
+ (*VdbeCursor)(unsafe.Pointer(pCx)).FpKeyInfo, *(*uintptr)(unsafe.Pointer(pCx + 40)))
// The sqlite3BtreeCursor() routine can only fail for the first cursor
// opened for a database. Since there is already an open cursor when this
// opcode is run, the sqlite3BtreeCursor() cannot fail
@@ -69844,24 +70816,24 @@ __523:
// different name to distinguish its use. Tables created using
// by this opcode will be used for automatically created transient
// indices in joins.
-__83:
-__84:
+__85:
+__86:
;
if !((*Op)(unsafe.Pointer(pOp)).Fp3 > 0) {
- goto __524
+ goto __551
}
// Make register reg[P3] into a value that can be used as the data
// form sqlite3BtreeInsert() where the length of the data is zero.
// Only used when number of columns is zero
(*Mem)(unsafe.Pointer(aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp3)*40)).Fn = 0
- (*Mem)(unsafe.Pointer(aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp3)*40)).Fz = ts + 755 /* "" */
-__524:
+ (*Mem)(unsafe.Pointer(aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp3)*40)).Fz = ts + 1543 /* "" */
+__551:
;
pCx1 = *(*uintptr)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*4))
- if !((pCx1 != 0) && !((int32(*(*uint8)(unsafe.Pointer(pCx1 + 8 /* &.hasBeenDuped */)) & 0x8 >> 3)) != 0)) {
- goto __525
+ if !(pCx1 != 0 && !(int32(*(*uint8)(unsafe.Pointer(pCx1 + 8))&0x8>>3) != 0) && (*Op)(unsafe.Pointer(pOp)).Fp2 <= int32((*VdbeCursor)(unsafe.Pointer(pCx1)).FnField)) {
+ goto __552
}
// If the ephermeral table is already open and has no duplicates from
// OP_OpenDup, then erase all existing content so that the table is
@@ -69870,71 +70842,71 @@ __524:
(*VdbeCursor)(unsafe.Pointer(pCx1)).FseqCount = int64(0)
(*VdbeCursor)(unsafe.Pointer(pCx1)).FcacheStatus = U32(CACHE_STALE)
rc = Xsqlite3BtreeClearTable(tls, (*VdbeCursor)(unsafe.Pointer(pCx1)).FpBtx, int32((*VdbeCursor)(unsafe.Pointer(pCx1)).FpgnoRoot), uintptr(0))
- goto __526
-__525:
+ goto __553
+__552:
pCx1 = allocateCursor(tls, p, (*Op)(unsafe.Pointer(pOp)).Fp1, (*Op)(unsafe.Pointer(pOp)).Fp2, -1, uint8(CURTYPE_BTREE))
if !(pCx1 == uintptr(0)) {
- goto __527
+ goto __554
}
goto no_mem
-__527:
+__554:
;
- libc.SetBitFieldPtr8Uint32(pCx1+8 /* &.isEphemeral */, Bool(1), 0, 0x1)
- rc = Xsqlite3BtreeOpen(tls, (*Sqlite3)(unsafe.Pointer(db)).FpVfs, uintptr(0), db, (pCx1 + 12 /* &.pBtx */),
- ((BTREE_OMIT_JOURNAL | BTREE_SINGLE) | int32((*Op)(unsafe.Pointer(pOp)).Fp5)),
+ libc.SetBitFieldPtr8Uint32(pCx1+8, Bool(1), 0, 0x1)
+ rc = Xsqlite3BtreeOpen(tls, (*Sqlite3)(unsafe.Pointer(db)).FpVfs, uintptr(0), db, pCx1+12,
+ BTREE_OMIT_JOURNAL|BTREE_SINGLE|int32((*Op)(unsafe.Pointer(pOp)).Fp5),
vfsFlags)
if !(rc == SQLITE_OK) {
- goto __528
+ goto __555
}
rc = Xsqlite3BtreeBeginTrans(tls, (*VdbeCursor)(unsafe.Pointer(pCx1)).FpBtx, 1, uintptr(0))
if !(rc == SQLITE_OK) {
- goto __529
+ goto __556
}
// If a transient index is required, create it by calling
// sqlite3BtreeCreateTable() with the BTREE_BLOBKEY flag before
// opening it. If a transient table is required, just use the
// automatically created table with root-page 1 (an BLOB_INTKEY table).
- if !((libc.AssignPtrUintptr(pCx1+44 /* &.pKeyInfo */, libc.AssignUintptr(&pKeyInfo2, *(*uintptr)(unsafe.Pointer(pOp + 16 /* &.p4 */))))) != uintptr(0)) {
- goto __530
+ if !(libc.AssignPtrUintptr(pCx1+44, libc.AssignUintptr(&pKeyInfo2, *(*uintptr)(unsafe.Pointer(pOp + 16)))) != uintptr(0)) {
+ goto __557
}
- rc = Xsqlite3BtreeCreateTable(tls, (*VdbeCursor)(unsafe.Pointer(pCx1)).FpBtx, (pCx1 + 52 /* &.pgnoRoot */),
- (BTREE_BLOBKEY | int32((*Op)(unsafe.Pointer(pOp)).Fp5)))
+ rc = Xsqlite3BtreeCreateTable(tls, (*VdbeCursor)(unsafe.Pointer(pCx1)).FpBtx, pCx1+52,
+ BTREE_BLOBKEY|int32((*Op)(unsafe.Pointer(pOp)).Fp5))
if !(rc == SQLITE_OK) {
- goto __532
+ goto __559
}
rc = Xsqlite3BtreeCursor(tls, (*VdbeCursor)(unsafe.Pointer(pCx1)).FpBtx, (*VdbeCursor)(unsafe.Pointer(pCx1)).FpgnoRoot, BTREE_WRCSR,
- pKeyInfo2, *(*uintptr)(unsafe.Pointer(pCx1 + 40 /* &.uc */)))
-__532:
+ pKeyInfo2, *(*uintptr)(unsafe.Pointer(pCx1 + 40)))
+__559:
;
(*VdbeCursor)(unsafe.Pointer(pCx1)).FisTable = U8(0)
- goto __531
-__530:
+ goto __558
+__557:
(*VdbeCursor)(unsafe.Pointer(pCx1)).FpgnoRoot = Pgno(SCHEMA_ROOT)
rc = Xsqlite3BtreeCursor(tls, (*VdbeCursor)(unsafe.Pointer(pCx1)).FpBtx, uint32(SCHEMA_ROOT), BTREE_WRCSR,
- uintptr(0), *(*uintptr)(unsafe.Pointer(pCx1 + 40 /* &.uc */)))
+ uintptr(0), *(*uintptr)(unsafe.Pointer(pCx1 + 40)))
(*VdbeCursor)(unsafe.Pointer(pCx1)).FisTable = U8(1)
-__531:
+__558:
;
-__529:
+__556:
;
- libc.SetBitFieldPtr8Uint32(pCx1+8 /* &.isOrdered */, (Bool(libc.Bool32(int32((*Op)(unsafe.Pointer(pOp)).Fp5) != BTREE_UNORDERED))), 2, 0x4)
+ libc.SetBitFieldPtr8Uint32(pCx1+8, Bool(libc.Bool32(int32((*Op)(unsafe.Pointer(pOp)).Fp5) != BTREE_UNORDERED)), 2, 0x4)
if !(rc != 0) {
- goto __533
+ goto __560
}
Xsqlite3BtreeClose(tls, (*VdbeCursor)(unsafe.Pointer(pCx1)).FpBtx)
-__533:
+__560:
;
-__528:
+__555:
;
-__526:
+__553:
;
if !(rc != 0) {
- goto __534
+ goto __561
}
goto abort_due_to_error
-__534:
+__561:
;
(*VdbeCursor)(unsafe.Pointer(pCx1)).FnullRow = U8(1)
goto __8
@@ -69948,24 +70920,24 @@ __534:
// If argument P3 is non-zero, then it indicates that the sorter may
// assume that a stable sort considering the first P3 fields of each
// key is sufficient to produce the required results.
-__85:
+__87:
;
pCx2 = allocateCursor(tls, p, (*Op)(unsafe.Pointer(pOp)).Fp1, (*Op)(unsafe.Pointer(pOp)).Fp2, -1, uint8(CURTYPE_SORTER))
if !(pCx2 == uintptr(0)) {
- goto __535
+ goto __562
}
goto no_mem
-__535:
+__562:
;
- (*VdbeCursor)(unsafe.Pointer(pCx2)).FpKeyInfo = *(*uintptr)(unsafe.Pointer(pOp + 16 /* &.p4 */))
+ (*VdbeCursor)(unsafe.Pointer(pCx2)).FpKeyInfo = *(*uintptr)(unsafe.Pointer(pOp + 16))
rc = Xsqlite3VdbeSorterInit(tls, db, (*Op)(unsafe.Pointer(pOp)).Fp3, pCx2)
if !(rc != 0) {
- goto __536
+ goto __563
}
goto abort_due_to_error
-__536:
+__563:
;
goto __8
@@ -69975,15 +70947,15 @@ __536:
// P1 is a sorter cursor. If the sequence counter is currently zero, jump
// to P2. Regardless of whether or not the jump is taken, increment the
// the sequence value.
-__86:
+__88:
;
pC2 = *(*uintptr)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*4))
- if !((libc.PostIncInt64(&(*VdbeCursor)(unsafe.Pointer(pC2)).FseqCount, 1)) == int64(0)) {
- goto __537
+ if !(libc.PostIncInt64(&(*VdbeCursor)(unsafe.Pointer(pC2)).FseqCount, 1) == int64(0)) {
+ goto __564
}
goto jump_to_p2
-__537:
+__564:
;
goto __8
@@ -70002,15 +70974,15 @@ __537:
//
// P3 is the number of fields in the records that will be stored by
// the pseudo-table.
-__87:
+__89:
;
pCx3 = allocateCursor(tls, p, (*Op)(unsafe.Pointer(pOp)).Fp1, (*Op)(unsafe.Pointer(pOp)).Fp3, -1, uint8(CURTYPE_PSEUDO))
if !(pCx3 == uintptr(0)) {
- goto __538
+ goto __565
}
goto no_mem
-__538:
+__565:
;
(*VdbeCursor)(unsafe.Pointer(pCx3)).FnullRow = U8(1)
(*VdbeCursor)(unsafe.Pointer(pCx3)).FseekResult = (*Op)(unsafe.Pointer(pOp)).Fp2
@@ -70019,7 +70991,7 @@ __538:
// can be safely passed to sqlite3VdbeCursorMoveto(). This avoids a test
// for pCx->eCurType==CURTYPE_BTREE inside of sqlite3VdbeCursorMoveto()
// which is a performance optimization
- *(*uintptr)(unsafe.Pointer(pCx3 + 40 /* &.uc */)) = Xsqlite3BtreeFakeValidCursor(tls)
+ *(*uintptr)(unsafe.Pointer(pCx3 + 40)) = Xsqlite3BtreeFakeValidCursor(tls)
goto __8
@@ -70027,7 +70999,7 @@ __538:
//
// Close a cursor previously opened as P1. If P1 is not
// currently open, this instruction is a no-op.
-__88:
+__90:
;
Xsqlite3VdbeFreeCursor(tls, p, *(*uintptr)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*4)))
*(*uintptr)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*4)) = uintptr(0)
@@ -70119,10 +71091,10 @@ __88:
// is an equality search.
//
// See also: Found, NotFound, SeekGt, SeekGe, SeekLt
-__89: // jump, in3, group
-__90: // jump, in3, group
__91: // jump, in3, group
-__92: // Only interested in == results
+__92: // jump, in3, group
+__93: // jump, in3, group
+__94: // Only interested in == results
;
@@ -70135,20 +71107,20 @@ __92: // Only interested in == results
(*VdbeCursor)(unsafe.Pointer(pC3)).FdeferredMoveto = U8(0)
(*VdbeCursor)(unsafe.Pointer(pC3)).FcacheStatus = U32(CACHE_STALE)
if !((*VdbeCursor)(unsafe.Pointer(pC3)).FisTable != 0) {
- goto __539
+ goto __566
}
// The OPFLAG_SEEKEQ/BTREE_SEEK_EQ flag is only set on index cursors
// The input value in P3 might be of any type: integer, real, string,
// blob, or NULL. But it needs to be an integer before we can do
// the seek, so convert it.
- pIn3 = (aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp3)*40)
+ pIn3 = aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp3)*40
flags31 = (*Mem)(unsafe.Pointer(pIn3)).Fflags
- if !((int32(flags31) & (((MEM_Int | MEM_Real) | MEM_IntReal) | MEM_Str)) == MEM_Str) {
- goto __541
+ if !(int32(flags31)&(MEM_Int|MEM_Real|MEM_IntReal|MEM_Str) == MEM_Str) {
+ goto __568
}
applyNumericAffinity(tls, pIn3, 0)
-__541:
+__568:
;
iKey = Xsqlite3VdbeIntValue(tls, pIn3) // Get the integer key value
newType = (*Mem)(unsafe.Pointer(pIn3)).Fflags // Record the type after applying numeric affinity
@@ -70156,31 +71128,32 @@ __541:
// If the P3 value could not be converted into an integer without
// loss of information, then special processing is required...
- if !((int32(newType) & (MEM_Int | MEM_IntReal)) == 0) {
- goto __542
+ if !(int32(newType)&(MEM_Int|MEM_IntReal) == 0) {
+ goto __569
}
- if !((int32(newType) & MEM_Real) == 0) {
- goto __543
+ if !(int32(newType)&MEM_Real == 0) {
+ goto __570
}
- if !(((int32(newType) & MEM_Null) != 0) || (oc >= OP_SeekGE)) {
- goto __545
+ if !(int32(newType)&MEM_Null != 0 || oc >= OP_SeekGE) {
+ goto __571
}
goto jump_to_p2
- goto __546
-__545:
- rc = Xsqlite3BtreeLast(tls, *(*uintptr)(unsafe.Pointer(pC3 + 40 /* &.uc */)), bp+272 /* &res1 */)
+ goto __572
+__571:
+ rc = Xsqlite3BtreeLast(tls, *(*uintptr)(unsafe.Pointer(pC3 + 40)), bp+304 /* &res1 */)
if !(rc != SQLITE_OK) {
- goto __547
+ goto __573
}
goto abort_due_to_error
-__547:
+__573:
;
goto seek_not_found
-__546:
+__572:
;
- goto __544
-__543:
+__570:
+ ;
+ c2 = Xsqlite3IntFloatCompare(tls, iKey, *(*float64)(unsafe.Pointer(pIn3)))
// If the approximation iKey is larger than the actual real search
// term, substitute >= for > and < for <=. e.g. if the search term
@@ -70188,62 +71161,60 @@ __543:
//
// (x > 4.9) -> (x >= 5)
// (x <= 4.9) -> (x < 5)
- if !(*(*float64)(unsafe.Pointer(pIn3 /* &.u */)) < float64(iKey)) {
- goto __548
+ if !(c2 > 0) {
+ goto __574
}
- if !((oc & 0x0001) == (OP_SeekGT & 0x0001)) {
- goto __550
+ if !(oc&0x0001 == OP_SeekGT&0x0001) {
+ goto __576
}
oc--
-__550:
+__576:
;
- goto __549
-__548:
- if !(*(*float64)(unsafe.Pointer(pIn3 /* &.u */)) > float64(iKey)) {
- goto __551
+ goto __575
+__574:
+ if !(c2 < 0) {
+ goto __577
}
- if !((oc & 0x0001) == (OP_SeekLT & 0x0001)) {
- goto __552
+ if !(oc&0x0001 == OP_SeekLT&0x0001) {
+ goto __578
}
oc++
-__552:
- ;
-__551:
+__578:
;
-__549:
+__577:
;
-__544:
+__575:
;
-__542:
+__569:
;
- rc = Xsqlite3BtreeMovetoUnpacked(tls, *(*uintptr)(unsafe.Pointer(pC3 + 40 /* &.uc */)), uintptr(0), int64(U64(iKey)), 0, bp+272 /* &res1 */)
+ rc = Xsqlite3BtreeTableMoveto(tls, *(*uintptr)(unsafe.Pointer(pC3 + 40)), int64(U64(iKey)), 0, bp+304 /* &res1 */)
(*VdbeCursor)(unsafe.Pointer(pC3)).FmovetoTarget = iKey // Used by OP_Delete
if !(rc != SQLITE_OK) {
- goto __553
+ goto __579
}
goto abort_due_to_error
-__553:
+__579:
;
- goto __540
-__539:
+ goto __567
+__566:
// For a cursor with the OPFLAG_SEEKEQ/BTREE_SEEK_EQ hint, only the
// OP_SeekGE and OP_SeekLE opcodes are allowed, and these must be
// immediately followed by an OP_IdxGT or OP_IdxLT opcode, respectively,
// with the same key.
- if !(Xsqlite3BtreeCursorHasHint(tls, *(*uintptr)(unsafe.Pointer(pC3 + 40 /* &.uc */)), uint32(BTREE_SEEK_EQ)) != 0) {
- goto __554
+ if !(Xsqlite3BtreeCursorHasHint(tls, *(*uintptr)(unsafe.Pointer(pC3 + 40)), uint32(BTREE_SEEK_EQ)) != 0) {
+ goto __580
}
eqOnly = 1
-__554:
+__580:
;
- nField2 = *(*int32)(unsafe.Pointer(pOp + 16 /* &.p4 */))
+ nField2 = *(*int32)(unsafe.Pointer(pOp + 16))
- (*UnpackedRecord)(unsafe.Pointer(bp + 276 /* &r */)).FpKeyInfo = (*VdbeCursor)(unsafe.Pointer(pC3)).FpKeyInfo
- (*UnpackedRecord)(unsafe.Pointer(bp + 276 /* &r */)).FnField = U16(nField2)
+ (*UnpackedRecord)(unsafe.Pointer(bp + 308 /* &r */)).FpKeyInfo = (*VdbeCursor)(unsafe.Pointer(pC3)).FpKeyInfo
+ (*UnpackedRecord)(unsafe.Pointer(bp + 308 /* &r */)).FnField = U16(nField2)
// The next line of code computes as follows, only faster:
// if( oc==OP_SeekGT || oc==OP_SeekLE ){
@@ -70251,108 +71222,108 @@ __554:
// }else{
// r.default_rc = +1;
// }
- (*UnpackedRecord)(unsafe.Pointer(bp + 276 /* &r */)).Fdefault_rc = func() int8 {
- if (1 & (oc - OP_SeekLT)) != 0 {
+ (*UnpackedRecord)(unsafe.Pointer(bp + 308 /* &r */)).Fdefault_rc = func() int8 {
+ if 1&(oc-OP_SeekLT) != 0 {
return int8(-1)
}
return +int8(1)
}()
- (*UnpackedRecord)(unsafe.Pointer(bp + 276 /* &r */)).FaMem = (aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp3)*40)
- (*UnpackedRecord)(unsafe.Pointer(bp + 276 /* &r */)).FeqSeen = U8(0)
- rc = Xsqlite3BtreeMovetoUnpacked(tls, *(*uintptr)(unsafe.Pointer(pC3 + 40 /* &.uc */)), bp+276 /* &r */, int64(0), 0, bp+272 /* &res1 */)
+ (*UnpackedRecord)(unsafe.Pointer(bp + 308 /* &r */)).FaMem = aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp3)*40
+ (*UnpackedRecord)(unsafe.Pointer(bp + 308 /* &r */)).FeqSeen = U8(0)
+ rc = Xsqlite3BtreeIndexMoveto(tls, *(*uintptr)(unsafe.Pointer(pC3 + 40)), bp+308 /* &r */, bp+304 /* &res1 */)
if !(rc != SQLITE_OK) {
- goto __555
+ goto __581
}
goto abort_due_to_error
-__555:
+__581:
;
- if !((eqOnly != 0) && (int32((*UnpackedRecord)(unsafe.Pointer(bp+276 /* &r */)).FeqSeen) == 0)) {
- goto __556
+ if !(eqOnly != 0 && int32((*UnpackedRecord)(unsafe.Pointer(bp+308)).FeqSeen) == 0) {
+ goto __582
}
goto seek_not_found
-__556:
+__582:
;
-__540:
+__567:
;
if !(oc >= OP_SeekGE) {
- goto __557
+ goto __583
}
- if !((*(*int32)(unsafe.Pointer(bp + 272 /* res1 */)) < 0) || ((*(*int32)(unsafe.Pointer(bp + 272 /* res1 */)) == 0) && (oc == OP_SeekGT))) {
- goto __559
+ if !(*(*int32)(unsafe.Pointer(bp + 304)) < 0 || *(*int32)(unsafe.Pointer(bp + 304)) == 0 && oc == OP_SeekGT) {
+ goto __585
}
- *(*int32)(unsafe.Pointer(bp + 272 /* res1 */)) = 0
- rc = Xsqlite3BtreeNext(tls, *(*uintptr)(unsafe.Pointer(pC3 + 40 /* &.uc */)), 0)
+ *(*int32)(unsafe.Pointer(bp + 304 /* res1 */)) = 0
+ rc = Xsqlite3BtreeNext(tls, *(*uintptr)(unsafe.Pointer(pC3 + 40)), 0)
if !(rc != SQLITE_OK) {
- goto __561
+ goto __587
}
if !(rc == SQLITE_DONE) {
- goto __562
+ goto __588
}
rc = SQLITE_OK
- *(*int32)(unsafe.Pointer(bp + 272 /* res1 */)) = 1
- goto __563
-__562:
+ *(*int32)(unsafe.Pointer(bp + 304 /* res1 */)) = 1
+ goto __589
+__588:
goto abort_due_to_error
-__563:
+__589:
;
-__561:
+__587:
;
- goto __560
-__559:
- *(*int32)(unsafe.Pointer(bp + 272 /* res1 */)) = 0
-__560:
+ goto __586
+__585:
+ *(*int32)(unsafe.Pointer(bp + 304 /* res1 */)) = 0
+__586:
;
- goto __558
-__557:
+ goto __584
+__583:
;
- if !((*(*int32)(unsafe.Pointer(bp + 272 /* res1 */)) > 0) || ((*(*int32)(unsafe.Pointer(bp + 272 /* res1 */)) == 0) && (oc == OP_SeekLT))) {
- goto __564
+ if !(*(*int32)(unsafe.Pointer(bp + 304)) > 0 || *(*int32)(unsafe.Pointer(bp + 304)) == 0 && oc == OP_SeekLT) {
+ goto __590
}
- *(*int32)(unsafe.Pointer(bp + 272 /* res1 */)) = 0
- rc = Xsqlite3BtreePrevious(tls, *(*uintptr)(unsafe.Pointer(pC3 + 40 /* &.uc */)), 0)
+ *(*int32)(unsafe.Pointer(bp + 304 /* res1 */)) = 0
+ rc = Xsqlite3BtreePrevious(tls, *(*uintptr)(unsafe.Pointer(pC3 + 40)), 0)
if !(rc != SQLITE_OK) {
- goto __566
+ goto __592
}
if !(rc == SQLITE_DONE) {
- goto __567
+ goto __593
}
rc = SQLITE_OK
- *(*int32)(unsafe.Pointer(bp + 272 /* res1 */)) = 1
- goto __568
-__567:
+ *(*int32)(unsafe.Pointer(bp + 304 /* res1 */)) = 1
+ goto __594
+__593:
goto abort_due_to_error
-__568:
+__594:
;
-__566:
+__592:
;
- goto __565
-__564:
+ goto __591
+__590:
// res might be negative because the table is empty. Check to
// see if this is the case.
- *(*int32)(unsafe.Pointer(bp + 272 /* res1 */)) = Xsqlite3BtreeEof(tls, *(*uintptr)(unsafe.Pointer(pC3 + 40 /* &.uc */)))
-__565:
+ *(*int32)(unsafe.Pointer(bp + 304 /* res1 */)) = Xsqlite3BtreeEof(tls, *(*uintptr)(unsafe.Pointer(pC3 + 40)))
+__591:
;
-__558:
+__584:
;
seek_not_found:
;
- if !(*(*int32)(unsafe.Pointer(bp + 272 /* res1 */)) != 0) {
- goto __569
+ if !(*(*int32)(unsafe.Pointer(bp + 304)) != 0) {
+ goto __595
}
goto jump_to_p2
- goto __570
-__569:
+ goto __596
+__595:
if !(eqOnly != 0) {
- goto __571
+ goto __597
}
pOp += 20 // Skip the OP_IdxLt or OP_IdxGT that follows
-__571:
+__597:
;
-__570:
+__596:
;
goto __8
@@ -70401,7 +71372,7 @@ __570:
// <li> If the cursor ends up past the target row (indicating the the target
// row does not exist in the btree) then jump to SeekOP.P2.
// </ol>
-__93:
+__95:
;
// pOp->p2 points to the first instruction past the OP_IdxGT that
@@ -70409,73 +71380,73 @@ __93:
pC4 = *(*uintptr)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*Op)(unsafe.Pointer(pOp+1*20)).Fp1)*4))
- if !(!(Xsqlite3BtreeCursorIsValidNN(tls, *(*uintptr)(unsafe.Pointer(pC4 + 40 /* &.uc */))) != 0)) {
- goto __572
+ if !!(Xsqlite3BtreeCursorIsValidNN(tls, *(*uintptr)(unsafe.Pointer(pC4 + 40))) != 0) {
+ goto __598
}
goto __8
-__572:
+__598:
;
nStep = (*Op)(unsafe.Pointer(pOp)).Fp1
- (*UnpackedRecord)(unsafe.Pointer(bp + 292 /* &r1 */)).FpKeyInfo = (*VdbeCursor)(unsafe.Pointer(pC4)).FpKeyInfo
- (*UnpackedRecord)(unsafe.Pointer(bp + 292 /* &r1 */)).FnField = U16(*(*int32)(unsafe.Pointer(pOp + 1*20 + 16 /* &.p4 */)))
- (*UnpackedRecord)(unsafe.Pointer(bp + 292 /* &r1 */)).Fdefault_rc = int8(0)
- (*UnpackedRecord)(unsafe.Pointer(bp + 292 /* &r1 */)).FaMem = (aMem + uintptr((*Op)(unsafe.Pointer(pOp+1*20)).Fp3)*40)
- *(*int32)(unsafe.Pointer(bp + 308 /* res3 */)) = 0 // Not needed. Only used to silence a warning.
-__573:
+ (*UnpackedRecord)(unsafe.Pointer(bp + 324 /* &r1 */)).FpKeyInfo = (*VdbeCursor)(unsafe.Pointer(pC4)).FpKeyInfo
+ (*UnpackedRecord)(unsafe.Pointer(bp + 324 /* &r1 */)).FnField = U16(*(*int32)(unsafe.Pointer(pOp + 1*20 + 16)))
+ (*UnpackedRecord)(unsafe.Pointer(bp + 324 /* &r1 */)).Fdefault_rc = int8(0)
+ (*UnpackedRecord)(unsafe.Pointer(bp + 324 /* &r1 */)).FaMem = aMem + uintptr((*Op)(unsafe.Pointer(pOp+1*20)).Fp3)*40
+ *(*int32)(unsafe.Pointer(bp + 340 /* res3 */)) = 0 // Not needed. Only used to silence a warning.
+__599:
if !(1 != 0) {
- goto __574
+ goto __600
}
- rc = Xsqlite3VdbeIdxKeyCompare(tls, db, pC4, bp+292 /* &r1 */, bp+308 /* &res3 */)
+ rc = Xsqlite3VdbeIdxKeyCompare(tls, db, pC4, bp+324 /* &r1 */, bp+340 /* &res3 */)
if !(rc != 0) {
- goto __575
+ goto __601
}
goto abort_due_to_error
-__575:
+__601:
;
- if !(*(*int32)(unsafe.Pointer(bp + 308 /* res3 */)) > 0) {
- goto __576
+ if !(*(*int32)(unsafe.Pointer(bp + 340)) > 0) {
+ goto __602
}
seekscan_search_fail:
;
pOp += 20
goto jump_to_p2
-__576:
+__602:
;
- if !(*(*int32)(unsafe.Pointer(bp + 308 /* res3 */)) == 0) {
- goto __577
+ if !(*(*int32)(unsafe.Pointer(bp + 340)) == 0) {
+ goto __603
}
goto jump_to_p2
- goto __574
-__577:
+ goto __600
+__603:
;
if !(nStep <= 0) {
- goto __578
+ goto __604
}
- goto __574
-__578:
+ goto __600
+__604:
;
nStep--
- rc = Xsqlite3BtreeNext(tls, *(*uintptr)(unsafe.Pointer(pC4 + 40 /* &.uc */)), 0)
+ rc = Xsqlite3BtreeNext(tls, *(*uintptr)(unsafe.Pointer(pC4 + 40)), 0)
if !(rc != 0) {
- goto __579
+ goto __605
}
if !(rc == SQLITE_DONE) {
- goto __580
+ goto __606
}
rc = SQLITE_OK
goto seekscan_search_fail
- goto __581
-__580:
+ goto __607
+__606:
goto abort_due_to_error
-__581:
+__607:
;
-__579:
+__605:
;
- goto __573
-__574:
+ goto __599
+__600:
;
goto __8
@@ -70493,23 +71464,23 @@ __574:
// early, thus saving work. This is part of the IN-early-out optimization.
//
// P1 must be a valid b-tree cursor.
-__94:
+__96:
;
pC5 = *(*uintptr)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*4))
if !(int32((*VdbeCursor)(unsafe.Pointer(pC5)).FseekHit) < (*Op)(unsafe.Pointer(pOp)).Fp2) {
- goto __582
+ goto __608
}
(*VdbeCursor)(unsafe.Pointer(pC5)).FseekHit = U16((*Op)(unsafe.Pointer(pOp)).Fp2)
- goto __583
-__582:
+ goto __609
+__608:
if !(int32((*VdbeCursor)(unsafe.Pointer(pC5)).FseekHit) > (*Op)(unsafe.Pointer(pOp)).Fp3) {
- goto __584
+ goto __610
}
(*VdbeCursor)(unsafe.Pointer(pC5)).FseekHit = U16((*Op)(unsafe.Pointer(pOp)).Fp3)
-__584:
+__610:
;
-__583:
+__609:
;
goto __8
@@ -70517,14 +71488,14 @@ __583:
// Synopsis: if( !csr[P1] ) goto P2
//
// If cursor P1 is not open, jump to instruction P2. Otherwise, fall through.
-__95: // jump
+__97: // jump
;
- if !(!(int32(*(*uintptr)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*4))) != 0)) {
- goto __585
+ if !!(int32(*(*uintptr)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*4))) != 0) {
+ goto __611
}
goto jump_to_p2_and_check_for_interrupt
-__585:
+__611:
;
goto __8
@@ -70614,133 +71585,133 @@ __585:
// opcodes do not work after this operation.
//
// See also: NotFound, Found, NotExists
-__96:
+__98:
;
pC6 = *(*uintptr)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*4))
- if !(int32((*VdbeCursor)(unsafe.Pointer(pC6)).FseekHit) >= *(*int32)(unsafe.Pointer(pOp + 16 /* &.p4 */))) {
- goto __586
+ if !(int32((*VdbeCursor)(unsafe.Pointer(pC6)).FseekHit) >= *(*int32)(unsafe.Pointer(pOp + 16))) {
+ goto __612
}
goto __8
-__586:
+__612:
;
-__97: // jump, in3
-__98: // jump, in3
-__99:
+__99: // jump, in3
+__100: // jump, in3
+__101:
;
pC7 = *(*uintptr)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*4))
- pIn3 = (aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp3)*40)
+ pIn3 = aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp3)*40
- if !(*(*int32)(unsafe.Pointer(pOp + 16 /* &.p4 */)) > 0) {
- goto __587
+ if !(*(*int32)(unsafe.Pointer(pOp + 16)) > 0) {
+ goto __613
}
- (*UnpackedRecord)(unsafe.Pointer(bp + 312 /* &r2 */)).FpKeyInfo = (*VdbeCursor)(unsafe.Pointer(pC7)).FpKeyInfo
- (*UnpackedRecord)(unsafe.Pointer(bp + 312 /* &r2 */)).FnField = U16(*(*int32)(unsafe.Pointer(pOp + 16 /* &.p4 */)))
- (*UnpackedRecord)(unsafe.Pointer(bp + 312 /* &r2 */)).FaMem = pIn3
- pIdxKey = bp + 312 /* &r2 */
+ (*UnpackedRecord)(unsafe.Pointer(bp + 344 /* &r2 */)).FpKeyInfo = (*VdbeCursor)(unsafe.Pointer(pC7)).FpKeyInfo
+ (*UnpackedRecord)(unsafe.Pointer(bp + 344 /* &r2 */)).FnField = U16(*(*int32)(unsafe.Pointer(pOp + 16)))
+ (*UnpackedRecord)(unsafe.Pointer(bp + 344 /* &r2 */)).FaMem = pIn3
+ pIdxKey = bp + 344 /* &r2 */
pFree = uintptr(0)
- goto __588
-__587:
+ goto __614
+__613:
;
rc = func() int32 {
- if (int32((*Mem)(unsafe.Pointer((pIn3))).Fflags) & MEM_Zero) != 0 {
+ if int32((*Mem)(unsafe.Pointer(pIn3)).Fflags)&MEM_Zero != 0 {
return Xsqlite3VdbeMemExpandBlob(tls, pIn3)
}
return 0
}()
if !(rc != 0) {
- goto __589
+ goto __615
}
goto no_mem
-__589:
+__615:
;
pFree = libc.AssignUintptr(&pIdxKey, Xsqlite3VdbeAllocUnpackedRecord(tls, (*VdbeCursor)(unsafe.Pointer(pC7)).FpKeyInfo))
if !(pIdxKey == uintptr(0)) {
- goto __590
+ goto __616
}
goto no_mem
-__590:
+__616:
;
Xsqlite3VdbeRecordUnpack(tls, (*VdbeCursor)(unsafe.Pointer(pC7)).FpKeyInfo, (*Mem)(unsafe.Pointer(pIn3)).Fn, (*Mem)(unsafe.Pointer(pIn3)).Fz, pIdxKey)
-__588:
+__614:
;
(*UnpackedRecord)(unsafe.Pointer(pIdxKey)).Fdefault_rc = int8(0)
takeJump = 0
if !(int32((*Op)(unsafe.Pointer(pOp)).Fopcode) == OP_NoConflict) {
- goto __591
+ goto __617
}
// For the OP_NoConflict opcode, take the jump if any of the
// input fields are NULL, since any key with a NULL will not
// conflict
ii1 = 0
-__592:
+__618:
if !(ii1 < int32((*UnpackedRecord)(unsafe.Pointer(pIdxKey)).FnField)) {
- goto __594
+ goto __620
}
- if !((int32((*Mem)(unsafe.Pointer((*UnpackedRecord)(unsafe.Pointer(pIdxKey)).FaMem+uintptr(ii1)*40)).Fflags) & MEM_Null) != 0) {
- goto __595
+ if !(int32((*Mem)(unsafe.Pointer((*UnpackedRecord)(unsafe.Pointer(pIdxKey)).FaMem+uintptr(ii1)*40)).Fflags)&MEM_Null != 0) {
+ goto __621
}
takeJump = 1
- goto __594
-__595:
+ goto __620
+__621:
;
- goto __593
-__593:
+ goto __619
+__619:
ii1++
- goto __592
- goto __594
-__594:
+ goto __618
+ goto __620
+__620:
;
-__591:
+__617:
;
- rc = Xsqlite3BtreeMovetoUnpacked(tls, *(*uintptr)(unsafe.Pointer(pC7 + 40 /* &.uc */)), pIdxKey, int64(0), 0, bp+328 /* &res4 */)
+ rc = Xsqlite3BtreeIndexMoveto(tls, *(*uintptr)(unsafe.Pointer(pC7 + 40)), pIdxKey, bp+360 /* &res4 */)
if !(pFree != 0) {
- goto __596
+ goto __622
}
Xsqlite3DbFreeNN(tls, db, pFree)
-__596:
+__622:
;
if !(rc != SQLITE_OK) {
- goto __597
+ goto __623
}
goto abort_due_to_error
-__597:
+__623:
;
- (*VdbeCursor)(unsafe.Pointer(pC7)).FseekResult = *(*int32)(unsafe.Pointer(bp + 328 /* res4 */))
- alreadyExists = (libc.Bool32(*(*int32)(unsafe.Pointer(bp + 328 /* res4 */)) == 0))
- (*VdbeCursor)(unsafe.Pointer(pC7)).FnullRow = (U8(1 - alreadyExists))
+ (*VdbeCursor)(unsafe.Pointer(pC7)).FseekResult = *(*int32)(unsafe.Pointer(bp + 360 /* res4 */))
+ alreadyExists = libc.Bool32(*(*int32)(unsafe.Pointer(bp + 360)) == 0)
+ (*VdbeCursor)(unsafe.Pointer(pC7)).FnullRow = U8(1 - alreadyExists)
(*VdbeCursor)(unsafe.Pointer(pC7)).FdeferredMoveto = U8(0)
(*VdbeCursor)(unsafe.Pointer(pC7)).FcacheStatus = U32(CACHE_STALE)
if !(int32((*Op)(unsafe.Pointer(pOp)).Fopcode) == OP_Found) {
- goto __598
+ goto __624
}
if !(alreadyExists != 0) {
- goto __600
+ goto __626
}
goto jump_to_p2
-__600:
+__626:
;
- goto __599
-__598:
+ goto __625
+__624:
;
- if !((takeJump != 0) || !(alreadyExists != 0)) {
- goto __601
+ if !(takeJump != 0 || !(alreadyExists != 0)) {
+ goto __627
}
goto jump_to_p2
-__601:
+__627:
;
if !(int32((*Op)(unsafe.Pointer(pOp)).Fopcode) == OP_IfNoHope) {
- goto __602
+ goto __628
}
- (*VdbeCursor)(unsafe.Pointer(pC7)).FseekHit = U16(*(*int32)(unsafe.Pointer(pOp + 16 /* &.p4 */)))
-__602:
+ (*VdbeCursor)(unsafe.Pointer(pC7)).FseekHit = U16(*(*int32)(unsafe.Pointer(pOp + 16)))
+__628:
;
-__599:
+__625:
;
goto __8
@@ -70789,68 +71760,68 @@ __599:
// not work following this opcode.
//
// See also: Found, NotFound, NoConflict, SeekRowid
-__100:
+__102:
- pIn3 = (aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp3)*40)
+ pIn3 = aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp3)*40
- if !((int32((*Mem)(unsafe.Pointer(pIn3)).Fflags) & (MEM_Int | MEM_IntReal)) == 0) {
- goto __603
+ if !(int32((*Mem)(unsafe.Pointer(pIn3)).Fflags)&(MEM_Int|MEM_IntReal) == 0) {
+ goto __629
}
// If pIn3->u.i does not contain an integer, compute iKey as the
// integer value of pIn3. Jump to P2 if pIn3 cannot be converted
// into an integer without loss of information. Take care to avoid
// changing the datatype of pIn3, however, as it is used by other
// parts of the prepared statement.
- *(*Mem)(unsafe.Pointer(bp + 336 /* x */)) = *(*Mem)(unsafe.Pointer(pIn3))
- applyAffinity(tls, bp+336 /* &x */, uint8(SQLITE_AFF_NUMERIC), encoding)
- if !((int32((*Mem)(unsafe.Pointer(bp+336 /* &x */)).Fflags) & MEM_Int) == 0) {
- goto __604
+ *(*Mem)(unsafe.Pointer(bp + 368 /* x */)) = *(*Mem)(unsafe.Pointer(pIn3))
+ applyAffinity(tls, bp+368 /* &x */, uint8(SQLITE_AFF_NUMERIC), encoding)
+ if !(int32((*Mem)(unsafe.Pointer(bp+368)).Fflags)&MEM_Int == 0) {
+ goto __630
}
goto jump_to_p2
-__604:
+__630:
;
- iKey1 = U64(*(*I64)(unsafe.Pointer(bp + 336 /* &x */ /* &.u */)))
+ iKey1 = U64(*(*I64)(unsafe.Pointer(bp + 368)))
goto notExistsWithKey
-__603:
+__629:
;
-__101: // jump, in3
- pIn3 = (aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp3)*40)
+__103: // jump, in3
+ pIn3 = aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp3)*40
- iKey1 = U64(*(*I64)(unsafe.Pointer(pIn3 /* &.u */)))
+ iKey1 = U64(*(*I64)(unsafe.Pointer(pIn3)))
notExistsWithKey:
pC8 = *(*uintptr)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*4))
- pCrsr2 = *(*uintptr)(unsafe.Pointer(pC8 + 40 /* &.uc */))
+ pCrsr2 = *(*uintptr)(unsafe.Pointer(pC8 + 40))
- *(*int32)(unsafe.Pointer(bp + 376 /* res5 */)) = 0
- rc = Xsqlite3BtreeMovetoUnpacked(tls, pCrsr2, uintptr(0), int64(iKey1), 0, bp+376 /* &res5 */)
+ *(*int32)(unsafe.Pointer(bp + 408 /* res5 */)) = 0
+ rc = Xsqlite3BtreeTableMoveto(tls, pCrsr2, int64(iKey1), 0, bp+408 /* &res5 */)
(*VdbeCursor)(unsafe.Pointer(pC8)).FmovetoTarget = I64(iKey1) // Used by OP_Delete
(*VdbeCursor)(unsafe.Pointer(pC8)).FnullRow = U8(0)
(*VdbeCursor)(unsafe.Pointer(pC8)).FcacheStatus = U32(CACHE_STALE)
(*VdbeCursor)(unsafe.Pointer(pC8)).FdeferredMoveto = U8(0)
- (*VdbeCursor)(unsafe.Pointer(pC8)).FseekResult = *(*int32)(unsafe.Pointer(bp + 376 /* res5 */))
- if !(*(*int32)(unsafe.Pointer(bp + 376 /* res5 */)) != 0) {
- goto __605
+ (*VdbeCursor)(unsafe.Pointer(pC8)).FseekResult = *(*int32)(unsafe.Pointer(bp + 408 /* res5 */))
+ if !(*(*int32)(unsafe.Pointer(bp + 408)) != 0) {
+ goto __631
}
if !((*Op)(unsafe.Pointer(pOp)).Fp2 == 0) {
- goto __606
+ goto __632
}
- rc = Xsqlite3CorruptError(tls, 91396)
- goto __607
-__606:
+ rc = Xsqlite3CorruptError(tls, 91738)
+ goto __633
+__632:
goto jump_to_p2
-__607:
+__633:
;
-__605:
+__631:
;
if !(rc != 0) {
- goto __608
+ goto __634
}
goto abort_due_to_error
-__608:
+__634:
;
goto __8
@@ -70861,11 +71832,11 @@ __608:
// Write the sequence number into register P2.
// The sequence number on the cursor is incremented after this
// instruction.
-__102: // out2
+__104: // out2
;
pOut = out2Prerelease(tls, p, pOp)
- *(*I64)(unsafe.Pointer(pOut /* &.u */)) = libc.PostIncInt64(&(*VdbeCursor)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*4)))).FseqCount, 1)
+ *(*I64)(unsafe.Pointer(pOut)) = libc.PostIncInt64(&(*VdbeCursor)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*4)))).FseqCount, 1)
goto __8
// Opcode: NewRowid P1 P2 P3 * *
@@ -70882,10 +71853,10 @@ __102: // out2
// an SQLITE_FULL error is generated. The P3 register is updated with the '
// generated record number. This P3 mechanism is used to help implement the
// AUTOINCREMENT feature.
-__103: // Root frame of VDBE
+__105: // Root frame of VDBE
- *(*I64)(unsafe.Pointer(bp + 384 /* v */)) = int64(0)
- *(*int32)(unsafe.Pointer(bp + 380 /* res6 */)) = 0
+ *(*I64)(unsafe.Pointer(bp + 416 /* v */)) = int64(0)
+ *(*int32)(unsafe.Pointer(bp + 412 /* res6 */)) = 0
pOut = out2Prerelease(tls, p, pOp)
pC9 = *(*uintptr)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*4))
@@ -70907,90 +71878,90 @@ __103: // Root frame of VDBE
// Others complain about 0x7ffffffffffffffffLL. The following macro seems
// to provide the constant while making all compilers happy.
- if !(!((int32(*(*uint8)(unsafe.Pointer(pC9 + 8 /* &.useRandomRowid */)) & 0x2 >> 1)) != 0)) {
- goto __609
+ if !!(int32(*(*uint8)(unsafe.Pointer(pC9 + 8))&0x2>>1) != 0) {
+ goto __635
}
- rc = Xsqlite3BtreeLast(tls, *(*uintptr)(unsafe.Pointer(pC9 + 40 /* &.uc */)), bp+380 /* &res6 */)
+ rc = Xsqlite3BtreeLast(tls, *(*uintptr)(unsafe.Pointer(pC9 + 40)), bp+412 /* &res6 */)
if !(rc != SQLITE_OK) {
- goto __610
+ goto __636
}
goto abort_due_to_error
-__610:
+__636:
;
- if !(*(*int32)(unsafe.Pointer(bp + 380 /* res6 */)) != 0) {
- goto __611
+ if !(*(*int32)(unsafe.Pointer(bp + 412)) != 0) {
+ goto __637
}
- *(*I64)(unsafe.Pointer(bp + 384 /* v */)) = int64(1) // IMP: R-61914-48074
- goto __612
-__611:
+ *(*I64)(unsafe.Pointer(bp + 416 /* v */)) = int64(1) // IMP: R-61914-48074
+ goto __638
+__637:
;
- *(*I64)(unsafe.Pointer(bp + 384 /* v */)) = Xsqlite3BtreeIntegerKey(tls, *(*uintptr)(unsafe.Pointer(pC9 + 40 /* &.uc */)))
- if !(*(*I64)(unsafe.Pointer(bp + 384 /* v */)) >= (int64((U64((uint64(0x7fffffff))) << 32) | uint64(0xffffffff)))) {
- goto __613
+ *(*I64)(unsafe.Pointer(bp + 416 /* v */)) = Xsqlite3BtreeIntegerKey(tls, *(*uintptr)(unsafe.Pointer(pC9 + 40)))
+ if !(*(*I64)(unsafe.Pointer(bp + 416)) >= int64(U64(uint64(0x7fffffff))<<32|uint64(0xffffffff))) {
+ goto __639
}
- libc.SetBitFieldPtr8Uint32(pC9+8 /* &.useRandomRowid */, Bool(1), 1, 0x2)
- goto __614
-__613:
- *(*I64)(unsafe.Pointer(bp + 384 /* v */))++ // IMP: R-29538-34987
-__614:
+ libc.SetBitFieldPtr8Uint32(pC9+8, Bool(1), 1, 0x2)
+ goto __640
+__639:
+ *(*I64)(unsafe.Pointer(bp + 416 /* v */))++ // IMP: R-29538-34987
+__640:
;
-__612:
+__638:
;
-__609:
+__635:
;
if !((*Op)(unsafe.Pointer(pOp)).Fp3 != 0) {
- goto __615
+ goto __641
}
// Assert that P3 is a valid memory cell.
if !((*Vdbe)(unsafe.Pointer(p)).FpFrame != 0) {
- goto __616
+ goto __642
}
pFrame1 = (*Vdbe)(unsafe.Pointer(p)).FpFrame
-__618:
+__644:
if !((*VdbeFrame)(unsafe.Pointer(pFrame1)).FpParent != 0) {
- goto __620
+ goto __646
}
- goto __619
-__619:
+ goto __645
+__645:
pFrame1 = (*VdbeFrame)(unsafe.Pointer(pFrame1)).FpParent
- goto __618
- goto __620
-__620:
+ goto __644
+ goto __646
+__646:
;
// Assert that P3 is a valid memory cell.
- pMem1 = ((*VdbeFrame)(unsafe.Pointer(pFrame1)).FaMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp3)*40)
- goto __617
-__616:
+ pMem1 = (*VdbeFrame)(unsafe.Pointer(pFrame1)).FaMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp3)*40
+ goto __643
+__642:
// Assert that P3 is a valid memory cell.
;
- pMem1 = (aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp3)*40)
+ pMem1 = aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp3)*40
-__617:
+__643:
;
Xsqlite3VdbeMemIntegerify(tls, pMem1)
// mem(P3) holds an integer
- if !((*(*I64)(unsafe.Pointer(pMem1 /* &.u */)) == (int64((U64((uint64(0x7fffffff))) << 32) | uint64(0xffffffff)))) || ((Bool(int32(*(*uint8)(unsafe.Pointer(pC9 + 8 /* &.useRandomRowid */)) & 0x2 >> 1))) != 0)) {
- goto __621
+ if !(*(*I64)(unsafe.Pointer(pMem1)) == int64(U64(uint64(0x7fffffff))<<32|uint64(0xffffffff)) || Bool(int32(*(*uint8)(unsafe.Pointer(pC9 + 8))&0x2>>1)) != 0) {
+ goto __647
}
rc = SQLITE_FULL // IMP: R-17817-00630
goto abort_due_to_error
-__621:
+__647:
;
- if !(*(*I64)(unsafe.Pointer(bp + 384 /* v */)) < (*(*I64)(unsafe.Pointer(pMem1 /* &.u */)) + int64(1))) {
- goto __622
+ if !(*(*I64)(unsafe.Pointer(bp + 416)) < *(*I64)(unsafe.Pointer(pMem1))+int64(1)) {
+ goto __648
}
- *(*I64)(unsafe.Pointer(bp + 384 /* v */)) = (*(*I64)(unsafe.Pointer(pMem1 /* &.u */)) + int64(1))
-__622:
+ *(*I64)(unsafe.Pointer(bp + 416 /* v */)) = *(*I64)(unsafe.Pointer(pMem1)) + int64(1)
+__648:
;
- *(*I64)(unsafe.Pointer(pMem1 /* &.u */)) = *(*I64)(unsafe.Pointer(bp + 384 /* v */))
-__615:
+ *(*I64)(unsafe.Pointer(pMem1)) = *(*I64)(unsafe.Pointer(bp + 416 /* v */))
+__641:
;
- if !((Bool(int32(*(*uint8)(unsafe.Pointer(pC9 + 8 /* &.useRandomRowid */)) & 0x2 >> 1))) != 0) {
- goto __623
+ if !(Bool(int32(*(*uint8)(unsafe.Pointer(pC9 + 8))&0x2>>1)) != 0) {
+ goto __649
}
// IMPLEMENTATION-OF: R-07677-41881 If the largest ROWID is equal to the
// largest possible integer (9223372036854775807) then the database
@@ -70999,41 +71970,41 @@ __615:
// We cannot be in random rowid mode if this is
// an AUTOINCREMENT table.
cnt1 = 0
-__624:
- Xsqlite3_randomness(tls, int32(unsafe.Sizeof(I64(0))), bp+384 /* &v */)
- *(*I64)(unsafe.Pointer(bp + 384 /* v */)) &= (I64((int64((U64((uint64(0x7fffffff))) << 32) | uint64(0xffffffff)))) >> 1)
- *(*I64)(unsafe.Pointer(bp + 384 /* v */))++ // Ensure that v is greater than zero
- goto __625
-__625:
- if (((libc.AssignInt32(&rc, Xsqlite3BtreeMovetoUnpacked(tls, *(*uintptr)(unsafe.Pointer(pC9 + 40 /* &.uc */)), uintptr(0), int64(U64(*(*I64)(unsafe.Pointer(bp + 384 /* v */)))),
- 0, bp+380 /* &res6 */))) == SQLITE_OK) &&
- (*(*int32)(unsafe.Pointer(bp + 380 /* res6 */)) == 0)) &&
- (libc.PreIncInt32(&cnt1, 1) < 100) {
- goto __624
+__650:
+ Xsqlite3_randomness(tls, int32(unsafe.Sizeof(I64(0))), bp+416 /* &v */)
+ *(*I64)(unsafe.Pointer(bp + 416 /* v */)) &= I64(int64(U64(uint64(0x7fffffff))<<32|uint64(0xffffffff))) >> 1
+ *(*I64)(unsafe.Pointer(bp + 416 /* v */))++ // Ensure that v is greater than zero
+ goto __651
+__651:
+ if libc.AssignInt32(&rc, Xsqlite3BtreeTableMoveto(tls, *(*uintptr)(unsafe.Pointer(pC9 + 40)), int64(U64(*(*I64)(unsafe.Pointer(bp + 416)))),
+ 0, bp+412)) == SQLITE_OK &&
+ *(*int32)(unsafe.Pointer(bp + 412)) == 0 &&
+ libc.PreIncInt32(&cnt1, 1) < 100 {
+ goto __650
}
- goto __626
-__626:
+ goto __652
+__652:
;
if !(rc != 0) {
- goto __627
+ goto __653
}
goto abort_due_to_error
-__627:
+__653:
;
- if !(*(*int32)(unsafe.Pointer(bp + 380 /* res6 */)) == 0) {
- goto __628
+ if !(*(*int32)(unsafe.Pointer(bp + 412)) == 0) {
+ goto __654
}
rc = SQLITE_FULL // IMP: R-38219-53002
goto abort_due_to_error
-__628:
+__654:
;
// EV: R-40812-03570
-__623:
+__649:
;
(*VdbeCursor)(unsafe.Pointer(pC9)).FdeferredMoveto = U8(0)
(*VdbeCursor)(unsafe.Pointer(pC9)).FcacheStatus = U32(CACHE_STALE)
- *(*I64)(unsafe.Pointer(pOut /* &.u */)) = *(*I64)(unsafe.Pointer(bp + 384 /* v */))
+ *(*I64)(unsafe.Pointer(pOut)) = *(*I64)(unsafe.Pointer(bp + 416 /* v */))
goto __8
// Opcode: Insert P1 P2 P3 P4 P5
@@ -71072,115 +72043,115 @@ __623:
//
// This instruction only works on tables. The equivalent instruction
// for indices is OP_IdxInsert.
-__104: // Payload to be inserted
+__106: // Payload to be inserted
- pData = (aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp2)*40)
+ pData = aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp2)*40
pC10 = *(*uintptr)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*4))
- pKey = (aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp3)*40)
+ pKey = aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp3)*40
- (*BtreePayload)(unsafe.Pointer(bp + 392 /* &x1 */)).FnKey = *(*I64)(unsafe.Pointer(pKey /* &.u */))
+ (*BtreePayload)(unsafe.Pointer(bp + 424 /* &x1 */)).FnKey = *(*I64)(unsafe.Pointer(pKey))
- if !((int32((*Op)(unsafe.Pointer(pOp)).Fp4type) == (-6)) && (((*Sqlite3)(unsafe.Pointer((db))).FxPreUpdateCallback != 0) || ((*Sqlite3)(unsafe.Pointer((db))).FxUpdateCallback != 0))) {
- goto __629
+ if !(int32((*Op)(unsafe.Pointer(pOp)).Fp4type) == -6 && ((*Sqlite3)(unsafe.Pointer(db)).FxPreUpdateCallback != 0 || (*Sqlite3)(unsafe.Pointer(db)).FxUpdateCallback != 0)) {
+ goto __655
}
zDb = (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb + uintptr((*VdbeCursor)(unsafe.Pointer(pC10)).FiDb)*16)).FzDbSName
- pTab = *(*uintptr)(unsafe.Pointer(pOp + 16 /* &.p4 */))
+ pTab1 = *(*uintptr)(unsafe.Pointer(pOp + 16))
- goto __630
-__629:
- pTab = uintptr(0)
- zDb = uintptr(0) // Not needed. Silence a compiler warning.
-__630:
+ goto __656
+__655:
+ pTab1 = uintptr(0)
+ zDb = uintptr(0)
+__656:
;
// Invoke the pre-update hook, if any
- if !(pTab != 0) {
- goto __631
+ if !(pTab1 != 0) {
+ goto __657
}
- if !(((*Sqlite3)(unsafe.Pointer(db)).FxPreUpdateCallback != 0) && !((int32((*Op)(unsafe.Pointer(pOp)).Fp5) & OPFLAG_ISUPDATE) != 0)) {
- goto __632
+ if !((*Sqlite3)(unsafe.Pointer(db)).FxPreUpdateCallback != 0 && !(int32((*Op)(unsafe.Pointer(pOp)).Fp5)&OPFLAG_ISUPDATE != 0)) {
+ goto __658
}
- Xsqlite3VdbePreUpdateHook(tls, p, pC10, SQLITE_INSERT, zDb, pTab, (*BtreePayload)(unsafe.Pointer(bp+392 /* &x1 */)).FnKey, (*Op)(unsafe.Pointer(pOp)).Fp2, -1)
-__632:
+ Xsqlite3VdbePreUpdateHook(tls, p, pC10, SQLITE_INSERT, zDb, pTab1, (*BtreePayload)(unsafe.Pointer(bp+424 /* &x1 */)).FnKey, (*Op)(unsafe.Pointer(pOp)).Fp2, -1)
+__658:
;
- if !(((*Sqlite3)(unsafe.Pointer(db)).FxUpdateCallback == uintptr(0)) || ((*Table)(unsafe.Pointer(pTab)).FaCol == uintptr(0))) {
- goto __633
+ if !((*Sqlite3)(unsafe.Pointer(db)).FxUpdateCallback == uintptr(0) || (*Table)(unsafe.Pointer(pTab1)).FaCol == uintptr(0)) {
+ goto __659
}
// Prevent post-update hook from running in cases when it should not
- pTab = uintptr(0)
-__633:
+ pTab1 = uintptr(0)
+__659:
;
-__631:
+__657:
;
- if !((int32((*Op)(unsafe.Pointer(pOp)).Fp5) & OPFLAG_ISNOOP) != 0) {
- goto __634
+ if !(int32((*Op)(unsafe.Pointer(pOp)).Fp5)&OPFLAG_ISNOOP != 0) {
+ goto __660
}
goto __8
-__634:
+__660:
;
- if !((int32((*Op)(unsafe.Pointer(pOp)).Fp5) & OPFLAG_NCHANGE) != 0) {
- goto __635
+ if !(int32((*Op)(unsafe.Pointer(pOp)).Fp5)&OPFLAG_NCHANGE != 0) {
+ goto __661
}
(*Vdbe)(unsafe.Pointer(p)).FnChange++
-__635:
+__661:
;
- if !((int32((*Op)(unsafe.Pointer(pOp)).Fp5) & OPFLAG_LASTROWID) != 0) {
- goto __636
+ if !(int32((*Op)(unsafe.Pointer(pOp)).Fp5)&OPFLAG_LASTROWID != 0) {
+ goto __662
}
- (*Sqlite3)(unsafe.Pointer(db)).FlastRowid = (*BtreePayload)(unsafe.Pointer(bp + 392 /* &x1 */)).FnKey
-__636:
+ (*Sqlite3)(unsafe.Pointer(db)).FlastRowid = (*BtreePayload)(unsafe.Pointer(bp + 424 /* &x1 */)).FnKey
+__662:
;
- (*BtreePayload)(unsafe.Pointer(bp + 392 /* &x1 */)).FpData = (*Mem)(unsafe.Pointer(pData)).Fz
- (*BtreePayload)(unsafe.Pointer(bp + 392 /* &x1 */)).FnData = (*Mem)(unsafe.Pointer(pData)).Fn
+ (*BtreePayload)(unsafe.Pointer(bp + 424 /* &x1 */)).FpData = (*Mem)(unsafe.Pointer(pData)).Fz
+ (*BtreePayload)(unsafe.Pointer(bp + 424 /* &x1 */)).FnData = (*Mem)(unsafe.Pointer(pData)).Fn
seekResult = func() int32 {
- if (int32((*Op)(unsafe.Pointer(pOp)).Fp5) & OPFLAG_USESEEKRESULT) != 0 {
+ if int32((*Op)(unsafe.Pointer(pOp)).Fp5)&OPFLAG_USESEEKRESULT != 0 {
return (*VdbeCursor)(unsafe.Pointer(pC10)).FseekResult
}
return 0
}()
- if !((int32((*Mem)(unsafe.Pointer(pData)).Fflags) & MEM_Zero) != 0) {
- goto __637
+ if !(int32((*Mem)(unsafe.Pointer(pData)).Fflags)&MEM_Zero != 0) {
+ goto __663
}
- (*BtreePayload)(unsafe.Pointer(bp + 392 /* &x1 */)).FnZero = *(*int32)(unsafe.Pointer(pData /* &.u */))
- goto __638
-__637:
- (*BtreePayload)(unsafe.Pointer(bp + 392 /* &x1 */)).FnZero = 0
-__638:
+ (*BtreePayload)(unsafe.Pointer(bp + 424 /* &x1 */)).FnZero = *(*int32)(unsafe.Pointer(pData))
+ goto __664
+__663:
+ (*BtreePayload)(unsafe.Pointer(bp + 424 /* &x1 */)).FnZero = 0
+__664:
;
- (*BtreePayload)(unsafe.Pointer(bp + 392 /* &x1 */)).FpKey = uintptr(0)
- rc = Xsqlite3BtreeInsert(tls, *(*uintptr)(unsafe.Pointer(pC10 + 40 /* &.uc */)), bp+392, /* &x1 */
- (int32((*Op)(unsafe.Pointer(pOp)).Fp5) & ((OPFLAG_APPEND | OPFLAG_SAVEPOSITION) | OPFLAG_PREFORMAT)),
+ (*BtreePayload)(unsafe.Pointer(bp + 424 /* &x1 */)).FpKey = uintptr(0)
+ rc = Xsqlite3BtreeInsert(tls, *(*uintptr)(unsafe.Pointer(pC10 + 40)), bp+424, /* &x1 */
+ int32((*Op)(unsafe.Pointer(pOp)).Fp5)&(OPFLAG_APPEND|OPFLAG_SAVEPOSITION|OPFLAG_PREFORMAT),
seekResult)
(*VdbeCursor)(unsafe.Pointer(pC10)).FdeferredMoveto = U8(0)
(*VdbeCursor)(unsafe.Pointer(pC10)).FcacheStatus = U32(CACHE_STALE)
// Invoke the update-hook if required.
if !(rc != 0) {
- goto __639
+ goto __665
}
goto abort_due_to_error
-__639:
+__665:
;
- if !(pTab != 0) {
- goto __640
+ if !(pTab1 != 0) {
+ goto __666
}
(*struct {
f func(*libc.TLS, uintptr, int32, uintptr, uintptr, Sqlite_int64)
})(unsafe.Pointer(&struct{ uintptr }{(*Sqlite3)(unsafe.Pointer(db)).FxUpdateCallback})).f(tls, (*Sqlite3)(unsafe.Pointer(db)).FpUpdateArg,
func() int32 {
- if (int32((*Op)(unsafe.Pointer(pOp)).Fp5) & OPFLAG_ISUPDATE) != 0 {
+ if int32((*Op)(unsafe.Pointer(pOp)).Fp5)&OPFLAG_ISUPDATE != 0 {
return SQLITE_UPDATE
}
return SQLITE_INSERT
}(),
- zDb, (*Table)(unsafe.Pointer(pTab)).FzName, (*BtreePayload)(unsafe.Pointer(bp+392 /* &x1 */)).FnKey)
-__640:
+ zDb, (*Table)(unsafe.Pointer(pTab1)).FzName, (*BtreePayload)(unsafe.Pointer(bp+424 /* &x1 */)).FnKey)
+__666:
;
goto __8
@@ -71194,22 +72165,22 @@ __640:
//
// This opcode must be followed by either an Insert or InsertIdx opcode
// with the OPFLAG_PREFORMAT flag set to complete the insert operation.
-__105: // Rowid value to insert with
+__107: // Rowid value to insert with
;
pDest1 = *(*uintptr)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*4))
pSrc = *(*uintptr)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*Op)(unsafe.Pointer(pOp)).Fp2)*4))
if (*Op)(unsafe.Pointer(pOp)).Fp3 != 0 {
- iKey2 = *(*I64)(unsafe.Pointer(aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp3)*40 /* &.u */))
+ iKey2 = *(*I64)(unsafe.Pointer(aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp3)*40))
} else {
iKey2 = int64(0)
}
- rc = Xsqlite3BtreeTransferRow(tls, *(*uintptr)(unsafe.Pointer(pDest1 + 40 /* &.uc */)), *(*uintptr)(unsafe.Pointer(pSrc + 40 /* &.uc */)), iKey2)
+ rc = Xsqlite3BtreeTransferRow(tls, *(*uintptr)(unsafe.Pointer(pDest1 + 40)), *(*uintptr)(unsafe.Pointer(pSrc + 40)), iKey2)
if !(rc != SQLITE_OK) {
- goto __641
+ goto __667
}
goto abort_due_to_error
-__641:
+__667:
;
goto __8
@@ -71247,7 +72218,7 @@ __641:
// If the OPFLAG_ISUPDATE flag is set in P2, then P3 contains the address
// of the memory cell that contains the value that the rowid of the row will
// be set to by the update.
-__106:
+__108:
opflags = (*Op)(unsafe.Pointer(pOp)).Fp2
@@ -71258,76 +72229,77 @@ __106:
// of p4.pTab. Finally, if p5 is true, indicating that this cursor was
// last moved with OP_Next or OP_Prev, not Seek or NotFound, set
// VdbeCursor.movetoTarget to the current rowid.
- if !((int32((*Op)(unsafe.Pointer(pOp)).Fp4type) == (-6)) && (((*Sqlite3)(unsafe.Pointer((db))).FxPreUpdateCallback != 0) || ((*Sqlite3)(unsafe.Pointer((db))).FxUpdateCallback != 0))) {
- goto __642
+ if !(int32((*Op)(unsafe.Pointer(pOp)).Fp4type) == -6 && ((*Sqlite3)(unsafe.Pointer(db)).FxPreUpdateCallback != 0 || (*Sqlite3)(unsafe.Pointer(db)).FxUpdateCallback != 0)) {
+ goto __668
}
zDb1 = (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb + uintptr((*VdbeCursor)(unsafe.Pointer(pC11)).FiDb)*16)).FzDbSName
- pTab1 = *(*uintptr)(unsafe.Pointer(pOp + 16 /* &.p4 */))
- if !(((int32((*Op)(unsafe.Pointer(pOp)).Fp5) & OPFLAG_SAVEPOSITION) != 0) && ((*VdbeCursor)(unsafe.Pointer(pC11)).FisTable != 0)) {
- goto __644
+ pTab2 = *(*uintptr)(unsafe.Pointer(pOp + 16))
+ if !(int32((*Op)(unsafe.Pointer(pOp)).Fp5)&OPFLAG_SAVEPOSITION != 0 && (*VdbeCursor)(unsafe.Pointer(pC11)).FisTable != 0) {
+ goto __670
}
- (*VdbeCursor)(unsafe.Pointer(pC11)).FmovetoTarget = Xsqlite3BtreeIntegerKey(tls, *(*uintptr)(unsafe.Pointer(pC11 + 40 /* &.uc */)))
-__644:
+ (*VdbeCursor)(unsafe.Pointer(pC11)).FmovetoTarget = Xsqlite3BtreeIntegerKey(tls, *(*uintptr)(unsafe.Pointer(pC11 + 40)))
+__670:
;
- goto __643
-__642:
- zDb1 = uintptr(0) // Not needed. Silence a compiler warning.
- pTab1 = uintptr(0) // Not needed. Silence a compiler warning.
-__643:
+ goto __669
+__668:
+ zDb1 = uintptr(0)
+ pTab2 = uintptr(0)
+__669:
;
// Invoke the pre-update-hook if required.
- if !(((*Sqlite3)(unsafe.Pointer(db)).FxPreUpdateCallback != 0) && (*(*uintptr)(unsafe.Pointer(pOp + 16 /* &.p4 */)) != 0)) {
- goto __645
+
+ if !((*Sqlite3)(unsafe.Pointer(db)).FxPreUpdateCallback != 0 && pTab2 != 0) {
+ goto __671
}
Xsqlite3VdbePreUpdateHook(tls, p, pC11,
func() int32 {
- if (opflags & OPFLAG_ISUPDATE) != 0 {
+ if opflags&OPFLAG_ISUPDATE != 0 {
return SQLITE_UPDATE
}
return SQLITE_DELETE
}(),
- zDb1, pTab1, (*VdbeCursor)(unsafe.Pointer(pC11)).FmovetoTarget,
+ zDb1, pTab2, (*VdbeCursor)(unsafe.Pointer(pC11)).FmovetoTarget,
(*Op)(unsafe.Pointer(pOp)).Fp3, -1)
-__645:
+__671:
;
- if !((opflags & OPFLAG_ISNOOP) != 0) {
- goto __646
+ if !(opflags&OPFLAG_ISNOOP != 0) {
+ goto __672
}
goto __8
-__646:
+__672:
;
// Only flags that can be set are SAVEPOISTION and AUXDELETE
- rc = Xsqlite3BtreeDelete(tls, *(*uintptr)(unsafe.Pointer(pC11 + 40 /* &.uc */)), uint8((*Op)(unsafe.Pointer(pOp)).Fp5))
+ rc = Xsqlite3BtreeDelete(tls, *(*uintptr)(unsafe.Pointer(pC11 + 40)), uint8((*Op)(unsafe.Pointer(pOp)).Fp5))
(*VdbeCursor)(unsafe.Pointer(pC11)).FcacheStatus = U32(CACHE_STALE)
(*VdbeCursor)(unsafe.Pointer(pC11)).FseekResult = 0
if !(rc != 0) {
- goto __647
+ goto __673
}
goto abort_due_to_error
-__647:
+__673:
;
// Invoke the update-hook if required.
- if !((opflags & OPFLAG_NCHANGE) != 0) {
- goto __648
+ if !(opflags&OPFLAG_NCHANGE != 0) {
+ goto __674
}
(*Vdbe)(unsafe.Pointer(p)).FnChange++
- if !(((*Sqlite3)(unsafe.Pointer(db)).FxUpdateCallback != 0) && (((*Table)(unsafe.Pointer((pTab1))).FtabFlags & U32(TF_WithoutRowid)) == U32(0))) {
- goto __649
+ if !((*Sqlite3)(unsafe.Pointer(db)).FxUpdateCallback != 0 && pTab2 != uintptr(0) && (*Table)(unsafe.Pointer(pTab2)).FtabFlags&U32(TF_WithoutRowid) == U32(0)) {
+ goto __675
}
(*struct {
f func(*libc.TLS, uintptr, int32, uintptr, uintptr, Sqlite_int64)
- })(unsafe.Pointer(&struct{ uintptr }{(*Sqlite3)(unsafe.Pointer(db)).FxUpdateCallback})).f(tls, (*Sqlite3)(unsafe.Pointer(db)).FpUpdateArg, SQLITE_DELETE, zDb1, (*Table)(unsafe.Pointer(pTab1)).FzName,
+ })(unsafe.Pointer(&struct{ uintptr }{(*Sqlite3)(unsafe.Pointer(db)).FxUpdateCallback})).f(tls, (*Sqlite3)(unsafe.Pointer(db)).FpUpdateArg, SQLITE_DELETE, zDb1, (*Table)(unsafe.Pointer(pTab2)).FzName,
(*VdbeCursor)(unsafe.Pointer(pC11)).FmovetoTarget)
-__649:
+__675:
;
-__648:
+__674:
;
goto __8
@@ -71338,9 +72310,9 @@ __648:
// change counter (returned by subsequent calls to sqlite3_changes()).
// Then the VMs internal change counter resets to 0.
// This is used by trigger programs.
-__107:
+__109:
Xsqlite3VdbeSetChanges(tls, db, (*Vdbe)(unsafe.Pointer(p)).FnChange)
- (*Vdbe)(unsafe.Pointer(p)).FnChange = 0
+ (*Vdbe)(unsafe.Pointer(p)).FnChange = int64(0)
goto __8
// Opcode: SorterCompare P1 P2 P3 P4
@@ -71357,26 +72329,26 @@ __107:
//
// Fall through to next instruction if the two records compare equal to
// each other. Jump to P2 if they are different.
-__108:
+__110:
pC12 = *(*uintptr)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*4))
- pIn3 = (aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp3)*40)
- nKeyCol = *(*int32)(unsafe.Pointer(pOp + 16 /* &.p4 */))
- *(*int32)(unsafe.Pointer(bp + 432 /* res7 */)) = 0
- rc = Xsqlite3VdbeSorterCompare(tls, pC12, pIn3, nKeyCol, bp+432 /* &res7 */)
+ pIn3 = aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp3)*40
+ nKeyCol = *(*int32)(unsafe.Pointer(pOp + 16))
+ *(*int32)(unsafe.Pointer(bp + 464 /* res7 */)) = 0
+ rc = Xsqlite3VdbeSorterCompare(tls, pC12, pIn3, nKeyCol, bp+464 /* &res7 */)
if !(rc != 0) {
- goto __650
+ goto __676
}
goto abort_due_to_error
-__650:
+__676:
;
- if !(*(*int32)(unsafe.Pointer(bp + 432 /* res7 */)) != 0) {
- goto __651
+ if !(*(*int32)(unsafe.Pointer(bp + 464)) != 0) {
+ goto __677
}
goto jump_to_p2
-__651:
+__677:
;
goto __8
@@ -71391,18 +72363,18 @@ __651:
// OpenPseudo. That pseudo-table cursor is the one that is identified by
// parameter P3. Clearing the P3 column cache as part of this opcode saves
// us from having to issue a separate NullRow instruction to clear that cache.
-__109:
+__111:
- pOut = (aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp2)*40)
+ pOut = aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp2)*40
pC13 = *(*uintptr)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*4))
rc = Xsqlite3VdbeSorterRowkey(tls, pC13, pOut)
if !(rc != 0) {
- goto __652
+ goto __678
}
goto abort_due_to_error
-__652:
+__678:
;
(*VdbeCursor)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*Op)(unsafe.Pointer(pOp)).Fp3)*4)))).FcacheStatus = U32(CACHE_STALE)
goto __8
@@ -71434,13 +72406,13 @@ __652:
// in OP_Result and any OP_Result will invalidate the P2 register content.
// The P2 register content is invalidated by opcodes like OP_Function or
// by any use of another cursor pointing to the same table.
-__110:
+__112:
pOut = out2Prerelease(tls, p, pOp)
pC14 = *(*uintptr)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*4))
- pCrsr3 = *(*uintptr)(unsafe.Pointer(pC14 + 40 /* &.uc */))
+ pCrsr3 = *(*uintptr)(unsafe.Pointer(pC14 + 40))
// The OP_RowData opcodes always follow OP_NotExists or
// OP_SeekRowid or OP_Rewind/Op_Next with no intervening instructions
@@ -71451,30 +72423,30 @@ __110:
// sqlite3VdbeCursorMoveto().
n3 = Xsqlite3BtreePayloadSize(tls, pCrsr3)
- if !(n3 > U32(*(*int32)(unsafe.Pointer((db + 112 /* &.aLimit */))))) {
- goto __653
+ if !(n3 > U32(*(*int32)(unsafe.Pointer(db + 120)))) {
+ goto __679
}
goto too_big
-__653:
+__679:
;
rc = Xsqlite3VdbeMemFromBtreeZeroOffset(tls, pCrsr3, n3, pOut)
if !(rc != 0) {
- goto __654
+ goto __680
}
goto abort_due_to_error
-__654:
+__680:
;
- if !(!((*Op)(unsafe.Pointer(pOp)).Fp3 != 0)) {
- goto __655
+ if !!((*Op)(unsafe.Pointer(pOp)).Fp3 != 0) {
+ goto __681
}
- if !(((int32((*Mem)(unsafe.Pointer((pOut))).Fflags) & MEM_Ephem) != 0) && (Xsqlite3VdbeMemMakeWriteable(tls, pOut) != 0)) {
- goto __656
+ if !(int32((*Mem)(unsafe.Pointer(pOut)).Fflags)&MEM_Ephem != 0 && Xsqlite3VdbeMemMakeWriteable(tls, pOut) != 0) {
+ goto __682
}
goto no_mem
-__656:
+__682:
;
-__655:
+__681:
;
goto __8
@@ -71488,68 +72460,68 @@ __655:
// P1 can be either an ordinary table or a virtual table. There used to
// be a separate OP_VRowid opcode for use with virtual tables, but this
// one opcode now works for both table types.
-__111:
+__113:
pOut = out2Prerelease(tls, p, pOp)
pC15 = *(*uintptr)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*4))
if !((*VdbeCursor)(unsafe.Pointer(pC15)).FnullRow != 0) {
- goto __657
+ goto __683
}
(*Mem)(unsafe.Pointer(pOut)).Fflags = U16(MEM_Null)
goto __8
- goto __658
-__657:
+ goto __684
+__683:
if !((*VdbeCursor)(unsafe.Pointer(pC15)).FdeferredMoveto != 0) {
- goto __659
+ goto __685
}
- *(*I64)(unsafe.Pointer(bp + 440 /* v3 */)) = (*VdbeCursor)(unsafe.Pointer(pC15)).FmovetoTarget
- goto __660
-__659:
+ *(*I64)(unsafe.Pointer(bp + 472 /* v3 */)) = (*VdbeCursor)(unsafe.Pointer(pC15)).FmovetoTarget
+ goto __686
+__685:
if !(int32((*VdbeCursor)(unsafe.Pointer(pC15)).FeCurType) == CURTYPE_VTAB) {
- goto __661
+ goto __687
}
- pVtab = (*Sqlite3_vtab_cursor)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pC15 + 40 /* &.uc */)))).FpVtab
+ pVtab = (*Sqlite3_vtab_cursor)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pC15 + 40)))).FpVtab
pModule = (*Sqlite3_vtab)(unsafe.Pointer(pVtab)).FpModule
rc = (*struct {
f func(*libc.TLS, uintptr, uintptr) int32
- })(unsafe.Pointer(&struct{ uintptr }{(*Sqlite3_module)(unsafe.Pointer(pModule)).FxRowid})).f(tls, *(*uintptr)(unsafe.Pointer(pC15 + 40 /* &.uc */)), bp+440 /* &v3 */)
+ })(unsafe.Pointer(&struct{ uintptr }{(*Sqlite3_module)(unsafe.Pointer(pModule)).FxRowid})).f(tls, *(*uintptr)(unsafe.Pointer(pC15 + 40 /* &.uc */)), bp+472 /* &v3 */)
Xsqlite3VtabImportErrmsg(tls, p, pVtab)
if !(rc != 0) {
- goto __663
+ goto __689
}
goto abort_due_to_error
-__663:
+__689:
;
- goto __662
-__661:
+ goto __688
+__687:
;
rc = Xsqlite3VdbeCursorRestore(tls, pC15)
if !(rc != 0) {
- goto __664
+ goto __690
}
goto abort_due_to_error
-__664:
+__690:
;
if !((*VdbeCursor)(unsafe.Pointer(pC15)).FnullRow != 0) {
- goto __665
+ goto __691
}
(*Mem)(unsafe.Pointer(pOut)).Fflags = U16(MEM_Null)
goto __8
-__665:
+__691:
;
- *(*I64)(unsafe.Pointer(bp + 440 /* v3 */)) = Xsqlite3BtreeIntegerKey(tls, *(*uintptr)(unsafe.Pointer(pC15 + 40 /* &.uc */)))
-__662:
+ *(*I64)(unsafe.Pointer(bp + 472 /* v3 */)) = Xsqlite3BtreeIntegerKey(tls, *(*uintptr)(unsafe.Pointer(pC15 + 40)))
+__688:
;
-__660:
+__686:
;
-__658:
+__684:
;
- *(*I64)(unsafe.Pointer(pOut /* &.u */)) = *(*I64)(unsafe.Pointer(bp + 440 /* v3 */))
+ *(*I64)(unsafe.Pointer(pOut)) = *(*I64)(unsafe.Pointer(bp + 472 /* v3 */))
goto __8
// Opcode: NullRow P1 * * * *
@@ -71557,18 +72529,18 @@ __658:
// Move the cursor P1 to a null row. Any OP_Column operations
// that occur while the cursor is on the null row will always
// write a NULL.
-__112:
+__114:
;
pC16 = *(*uintptr)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*4))
(*VdbeCursor)(unsafe.Pointer(pC16)).FnullRow = U8(1)
(*VdbeCursor)(unsafe.Pointer(pC16)).FcacheStatus = U32(CACHE_STALE)
if !(int32((*VdbeCursor)(unsafe.Pointer(pC16)).FeCurType) == CURTYPE_BTREE) {
- goto __666
+ goto __692
}
- Xsqlite3BtreeClearCursor(tls, *(*uintptr)(unsafe.Pointer(pC16 + 40 /* &.uc */)))
-__666:
+ Xsqlite3BtreeClearCursor(tls, *(*uintptr)(unsafe.Pointer(pC16 + 40)))
+__692:
;
goto __8
@@ -71592,48 +72564,48 @@ __666:
// This opcode leaves the cursor configured to move in reverse order,
// from the end toward the beginning. In other words, the cursor is
// configured to use Prev, not Next.
-__113:
-__114:
+__115:
+__116:
;
pC17 = *(*uintptr)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*4))
- pCrsr4 = *(*uintptr)(unsafe.Pointer(pC17 + 40 /* &.uc */))
- *(*int32)(unsafe.Pointer(bp + 448 /* res8 */)) = 0
+ pCrsr4 = *(*uintptr)(unsafe.Pointer(pC17 + 40))
+ *(*int32)(unsafe.Pointer(bp + 480 /* res8 */)) = 0
if !(int32((*Op)(unsafe.Pointer(pOp)).Fopcode) == OP_SeekEnd) {
- goto __667
+ goto __693
}
(*VdbeCursor)(unsafe.Pointer(pC17)).FseekResult = -1
if !(Xsqlite3BtreeCursorIsValidNN(tls, pCrsr4) != 0) {
- goto __668
+ goto __694
}
goto __8
-__668:
+__694:
;
-__667:
+__693:
;
- rc = Xsqlite3BtreeLast(tls, pCrsr4, bp+448 /* &res8 */)
- (*VdbeCursor)(unsafe.Pointer(pC17)).FnullRow = U8(*(*int32)(unsafe.Pointer(bp + 448 /* res8 */)))
+ rc = Xsqlite3BtreeLast(tls, pCrsr4, bp+480 /* &res8 */)
+ (*VdbeCursor)(unsafe.Pointer(pC17)).FnullRow = U8(*(*int32)(unsafe.Pointer(bp + 480 /* res8 */)))
(*VdbeCursor)(unsafe.Pointer(pC17)).FdeferredMoveto = U8(0)
(*VdbeCursor)(unsafe.Pointer(pC17)).FcacheStatus = U32(CACHE_STALE)
if !(rc != 0) {
- goto __669
+ goto __695
}
goto abort_due_to_error
-__669:
+__695:
;
if !((*Op)(unsafe.Pointer(pOp)).Fp2 > 0) {
- goto __670
+ goto __696
}
- if !(*(*int32)(unsafe.Pointer(bp + 448 /* res8 */)) != 0) {
- goto __671
+ if !(*(*int32)(unsafe.Pointer(bp + 480)) != 0) {
+ goto __697
}
goto jump_to_p2
-__671:
+__697:
;
-__670:
+__696:
;
goto __8
@@ -71641,37 +72613,37 @@ __670:
//
// Estimate the number of rows in the table P1. Jump to P2 if that
// estimate is less than approximately 2**(0.1*P3).
-__115:
+__117:
;
pC18 = *(*uintptr)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*4))
- pCrsr5 = *(*uintptr)(unsafe.Pointer(pC18 + 40 /* &.uc */))
+ pCrsr5 = *(*uintptr)(unsafe.Pointer(pC18 + 40))
- rc = Xsqlite3BtreeFirst(tls, pCrsr5, bp+452 /* &res9 */)
+ rc = Xsqlite3BtreeFirst(tls, pCrsr5, bp+484 /* &res9 */)
if !(rc != 0) {
- goto __672
+ goto __698
}
goto abort_due_to_error
-__672:
+__698:
;
- if !(*(*int32)(unsafe.Pointer(bp + 452 /* res9 */)) == 0) {
- goto __673
+ if !(*(*int32)(unsafe.Pointer(bp + 484)) == 0) {
+ goto __699
}
sz = Xsqlite3BtreeRowCountEst(tls, pCrsr5)
- if !((sz >= int64(0)) && (int32(Xsqlite3LogEst(tls, U64(sz))) < (*Op)(unsafe.Pointer(pOp)).Fp3)) {
- goto __674
+ if !(sz >= int64(0) && int32(Xsqlite3LogEst(tls, U64(sz))) < (*Op)(unsafe.Pointer(pOp)).Fp3) {
+ goto __700
}
- *(*int32)(unsafe.Pointer(bp + 452 /* res9 */)) = 1
-__674:
+ *(*int32)(unsafe.Pointer(bp + 484 /* res9 */)) = 1
+__700:
;
-__673:
+__699:
;
- if !(*(*int32)(unsafe.Pointer(bp + 452 /* res9 */)) != 0) {
- goto __675
+ if !(*(*int32)(unsafe.Pointer(bp + 484)) != 0) {
+ goto __701
}
goto jump_to_p2
-__675:
+__701:
;
goto __8
@@ -71694,9 +72666,9 @@ __675:
// rewinding so that the global variable will be incremented and
// regression tests can determine whether or not the optimizer is
// correctly optimizing out sorts.
-__116: // jump
-__117: // jump
- *(*U32)(unsafe.Pointer((p + 164 /* &.aCounter */) + 2*4))++
+__118: // jump
+__119: // jump
+ *(*U32)(unsafe.Pointer(p + 172 + 2*4))++
// Opcode: Rewind P1 P2 * * *
//
@@ -71709,39 +72681,39 @@ __117: // jump
// This opcode leaves the cursor configured to move in forward order,
// from the beginning toward the end. In other words, the cursor is
// configured to use Next, not Prev.
-__118:
+__120:
;
pC19 = *(*uintptr)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*4))
- *(*int32)(unsafe.Pointer(bp + 456 /* res10 */)) = 1
- if !(int32((*VdbeCursor)(unsafe.Pointer((pC19))).FeCurType) == CURTYPE_SORTER) {
- goto __676
+ *(*int32)(unsafe.Pointer(bp + 488 /* res10 */)) = 1
+ if !(int32((*VdbeCursor)(unsafe.Pointer(pC19)).FeCurType) == CURTYPE_SORTER) {
+ goto __702
}
- rc = Xsqlite3VdbeSorterRewind(tls, pC19, bp+456 /* &res10 */)
- goto __677
-__676:
+ rc = Xsqlite3VdbeSorterRewind(tls, pC19, bp+488 /* &res10 */)
+ goto __703
+__702:
;
- pCrsr6 = *(*uintptr)(unsafe.Pointer(pC19 + 40 /* &.uc */))
+ pCrsr6 = *(*uintptr)(unsafe.Pointer(pC19 + 40))
- rc = Xsqlite3BtreeFirst(tls, pCrsr6, bp+456 /* &res10 */)
+ rc = Xsqlite3BtreeFirst(tls, pCrsr6, bp+488 /* &res10 */)
(*VdbeCursor)(unsafe.Pointer(pC19)).FdeferredMoveto = U8(0)
(*VdbeCursor)(unsafe.Pointer(pC19)).FcacheStatus = U32(CACHE_STALE)
-__677:
+__703:
;
if !(rc != 0) {
- goto __678
+ goto __704
}
goto abort_due_to_error
-__678:
+__704:
;
- (*VdbeCursor)(unsafe.Pointer(pC19)).FnullRow = U8(*(*int32)(unsafe.Pointer(bp + 456 /* res10 */)))
+ (*VdbeCursor)(unsafe.Pointer(pC19)).FnullRow = U8(*(*int32)(unsafe.Pointer(bp + 488 /* res10 */)))
- if !(*(*int32)(unsafe.Pointer(bp + 456 /* res10 */)) != 0) {
- goto __679
+ if !(*(*int32)(unsafe.Pointer(bp + 488)) != 0) {
+ goto __705
}
goto jump_to_p2
-__679:
+__705:
;
goto __8
@@ -71802,14 +72774,14 @@ __679:
// sorter object for which the OP_SorterSort opcode has been
// invoked. This opcode advances the cursor to the next sorted
// record, or jumps to P2 if there are no more sorted records.
-__119:
+__121:
pC20 = *(*uintptr)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*4))
rc = Xsqlite3VdbeSorterNext(tls, db, pC20)
goto next_tail
-__120: // jump
-__121: // jump
+__122: // jump
+__123: // jump
;
pC20 = *(*uintptr)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*4))
@@ -71824,18 +72796,18 @@ next_tail:
(*VdbeCursor)(unsafe.Pointer(pC20)).FcacheStatus = U32(CACHE_STALE)
if !(rc == SQLITE_OK) {
- goto __680
+ goto __706
}
(*VdbeCursor)(unsafe.Pointer(pC20)).FnullRow = U8(0)
- *(*U32)(unsafe.Pointer((p + 164 /* &.aCounter */) + uintptr((*Op)(unsafe.Pointer(pOp)).Fp5)*4))++
+ *(*U32)(unsafe.Pointer(p + 172 + uintptr((*Op)(unsafe.Pointer(pOp)).Fp5)*4))++
goto jump_to_p2_and_check_for_interrupt
-__680:
+__706:
;
if !(rc != SQLITE_DONE) {
- goto __681
+ goto __707
}
goto abort_due_to_error
-__681:
+__707:
;
rc = SQLITE_OK
(*VdbeCursor)(unsafe.Pointer(pC20)).FnullRow = U8(1)
@@ -71868,39 +72840,39 @@ __681:
//
// This instruction only works for indices. The equivalent instruction
// for tables is OP_Insert.
-__122:
+__124:
;
pC21 = *(*uintptr)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*4))
- pIn2 = (aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp2)*40)
+ pIn2 = aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp2)*40
- if !((int32((*Op)(unsafe.Pointer(pOp)).Fp5) & OPFLAG_NCHANGE) != 0) {
- goto __682
+ if !(int32((*Op)(unsafe.Pointer(pOp)).Fp5)&OPFLAG_NCHANGE != 0) {
+ goto __708
}
(*Vdbe)(unsafe.Pointer(p)).FnChange++
-__682:
+__708:
;
rc = func() int32 {
- if (int32((*Mem)(unsafe.Pointer((pIn2))).Fflags) & MEM_Zero) != 0 {
+ if int32((*Mem)(unsafe.Pointer(pIn2)).Fflags)&MEM_Zero != 0 {
return Xsqlite3VdbeMemExpandBlob(tls, pIn2)
}
return 0
}()
if !(rc != 0) {
- goto __683
+ goto __709
}
goto abort_due_to_error
-__683:
+__709:
;
- (*BtreePayload)(unsafe.Pointer(bp + 464 /* &x2 */)).FnKey = Sqlite3_int64((*Mem)(unsafe.Pointer(pIn2)).Fn)
- (*BtreePayload)(unsafe.Pointer(bp + 464 /* &x2 */)).FpKey = (*Mem)(unsafe.Pointer(pIn2)).Fz
- (*BtreePayload)(unsafe.Pointer(bp + 464 /* &x2 */)).FaMem = (aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp3)*40)
- (*BtreePayload)(unsafe.Pointer(bp + 464 /* &x2 */)).FnMem = U16(*(*int32)(unsafe.Pointer(pOp + 16 /* &.p4 */)))
- rc = Xsqlite3BtreeInsert(tls, *(*uintptr)(unsafe.Pointer(pC21 + 40 /* &.uc */)), bp+464, /* &x2 */
- (int32((*Op)(unsafe.Pointer(pOp)).Fp5) & ((OPFLAG_APPEND | OPFLAG_SAVEPOSITION) | OPFLAG_PREFORMAT)),
+ (*BtreePayload)(unsafe.Pointer(bp + 496 /* &x2 */)).FnKey = Sqlite3_int64((*Mem)(unsafe.Pointer(pIn2)).Fn)
+ (*BtreePayload)(unsafe.Pointer(bp + 496 /* &x2 */)).FpKey = (*Mem)(unsafe.Pointer(pIn2)).Fz
+ (*BtreePayload)(unsafe.Pointer(bp + 496 /* &x2 */)).FaMem = aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp3)*40
+ (*BtreePayload)(unsafe.Pointer(bp + 496 /* &x2 */)).FnMem = U16(*(*int32)(unsafe.Pointer(pOp + 16)))
+ rc = Xsqlite3BtreeInsert(tls, *(*uintptr)(unsafe.Pointer(pC21 + 40)), bp+496, /* &x2 */
+ int32((*Op)(unsafe.Pointer(pOp)).Fp5)&(OPFLAG_APPEND|OPFLAG_SAVEPOSITION|OPFLAG_PREFORMAT),
func() int32 {
- if (int32((*Op)(unsafe.Pointer(pOp)).Fp5) & OPFLAG_USESEEKRESULT) != 0 {
+ if int32((*Op)(unsafe.Pointer(pOp)).Fp5)&OPFLAG_USESEEKRESULT != 0 {
return (*VdbeCursor)(unsafe.Pointer(pC21)).FseekResult
}
return 0
@@ -71908,10 +72880,10 @@ __683:
(*VdbeCursor)(unsafe.Pointer(pC21)).FcacheStatus = U32(CACHE_STALE)
if !(rc != 0) {
- goto __684
+ goto __710
}
goto abort_due_to_error
-__684:
+__710:
;
goto __8
@@ -71921,30 +72893,30 @@ __684:
// Register P2 holds an SQL index key made using the
// MakeRecord instructions. This opcode writes that key
// into the sorter P1. Data for the entry is nil.
-__123:
+__125:
;
pC22 = *(*uintptr)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*4))
- pIn2 = (aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp2)*40)
+ pIn2 = aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp2)*40
rc = func() int32 {
- if (int32((*Mem)(unsafe.Pointer((pIn2))).Fflags) & MEM_Zero) != 0 {
+ if int32((*Mem)(unsafe.Pointer(pIn2)).Fflags)&MEM_Zero != 0 {
return Xsqlite3VdbeMemExpandBlob(tls, pIn2)
}
return 0
}()
if !(rc != 0) {
- goto __685
+ goto __711
}
goto abort_due_to_error
-__685:
+__711:
;
rc = Xsqlite3VdbeSorterWrite(tls, pC22, pIn2)
if !(rc != 0) {
- goto __686
+ goto __712
}
goto abort_due_to_error
-__686:
+__712:
;
goto __8
@@ -71960,45 +72932,46 @@ __686:
// an UPDATE or DELETE statement and the index entry to be updated
// or deleted is not found. For some uses of IdxDelete
// (example: the EXCEPT operator) it does not matter that no matching
- // entry is found. For those cases, P5 is zero.
-__124:
+ // entry is found. For those cases, P5 is zero. Also, do not raise
+ // this (self-correcting and non-critical) error if in writable_schema mode.
+__126:
;
pC23 = *(*uintptr)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*4))
- pCrsr7 = *(*uintptr)(unsafe.Pointer(pC23 + 40 /* &.uc */))
+ pCrsr7 = *(*uintptr)(unsafe.Pointer(pC23 + 40))
- (*UnpackedRecord)(unsafe.Pointer(bp + 504 /* &r3 */)).FpKeyInfo = (*VdbeCursor)(unsafe.Pointer(pC23)).FpKeyInfo
- (*UnpackedRecord)(unsafe.Pointer(bp + 504 /* &r3 */)).FnField = U16((*Op)(unsafe.Pointer(pOp)).Fp3)
- (*UnpackedRecord)(unsafe.Pointer(bp + 504 /* &r3 */)).Fdefault_rc = int8(0)
- (*UnpackedRecord)(unsafe.Pointer(bp + 504 /* &r3 */)).FaMem = (aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp2)*40)
- rc = Xsqlite3BtreeMovetoUnpacked(tls, pCrsr7, bp+504 /* &r3 */, int64(0), 0, bp+520 /* &res11 */)
+ (*UnpackedRecord)(unsafe.Pointer(bp + 536 /* &r3 */)).FpKeyInfo = (*VdbeCursor)(unsafe.Pointer(pC23)).FpKeyInfo
+ (*UnpackedRecord)(unsafe.Pointer(bp + 536 /* &r3 */)).FnField = U16((*Op)(unsafe.Pointer(pOp)).Fp3)
+ (*UnpackedRecord)(unsafe.Pointer(bp + 536 /* &r3 */)).Fdefault_rc = int8(0)
+ (*UnpackedRecord)(unsafe.Pointer(bp + 536 /* &r3 */)).FaMem = aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp2)*40
+ rc = Xsqlite3BtreeIndexMoveto(tls, pCrsr7, bp+536 /* &r3 */, bp+552 /* &res11 */)
if !(rc != 0) {
- goto __687
+ goto __713
}
goto abort_due_to_error
-__687:
+__713:
;
- if !(*(*int32)(unsafe.Pointer(bp + 520 /* res11 */)) == 0) {
- goto __688
+ if !(*(*int32)(unsafe.Pointer(bp + 552)) == 0) {
+ goto __714
}
rc = Xsqlite3BtreeDelete(tls, pCrsr7, uint8(BTREE_AUXDELETE))
if !(rc != 0) {
- goto __690
+ goto __716
}
goto abort_due_to_error
-__690:
+__716:
;
- goto __689
-__688:
- if !((*Op)(unsafe.Pointer(pOp)).Fp5 != 0) {
- goto __691
+ goto __715
+__714:
+ if !((*Op)(unsafe.Pointer(pOp)).Fp5 != 0 && !(Xsqlite3WritableSchema(tls, db) != 0)) {
+ goto __717
}
- rc = Xsqlite3ReportError(tls, (SQLITE_CORRUPT | (int32(3) << 8)), 92446, ts+4939 /* "index corruption" */)
+ rc = Xsqlite3ReportError(tls, SQLITE_CORRUPT|int32(3)<<8, 92790, ts+5786 /* "index corruption" */)
goto abort_due_to_error
-__691:
+__717:
;
-__689:
+__715:
;
(*VdbeCursor)(unsafe.Pointer(pC23)).FcacheStatus = U32(CACHE_STALE)
@@ -72031,8 +73004,8 @@ __689:
// the rowid of the table entry to which this index entry points.
//
// See also: Rowid, MakeRecord.
-__125:
-__126: // Rowid that P1 current points to
+__127:
+__128: // Rowid that P1 current points to
;
pC24 = *(*uintptr)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*4))
@@ -72045,47 +73018,47 @@ __126: // Rowid that P1 current points to
// out from under the cursor. That will never happens for an IdxRowid
// or Seek opcode
if !(rc != SQLITE_OK) {
- goto __692
+ goto __718
}
goto abort_due_to_error
-__692:
+__718:
;
- if !(!(int32((*VdbeCursor)(unsafe.Pointer(pC24)).FnullRow) != 0)) {
- goto __693
+ if !!(int32((*VdbeCursor)(unsafe.Pointer(pC24)).FnullRow) != 0) {
+ goto __719
}
- *(*I64)(unsafe.Pointer(bp + 528 /* rowid */)) = int64(0) // Not needed. Only used to silence a warning.
- rc = Xsqlite3VdbeIdxRowid(tls, db, *(*uintptr)(unsafe.Pointer(pC24 + 40 /* &.uc */)), bp+528 /* &rowid */)
+ *(*I64)(unsafe.Pointer(bp + 560 /* rowid */)) = int64(0) // Not needed. Only used to silence a warning.
+ rc = Xsqlite3VdbeIdxRowid(tls, db, *(*uintptr)(unsafe.Pointer(pC24 + 40)), bp+560 /* &rowid */)
if !(rc != SQLITE_OK) {
- goto __695
+ goto __721
}
goto abort_due_to_error
-__695:
+__721:
;
if !(int32((*Op)(unsafe.Pointer(pOp)).Fopcode) == OP_DeferredSeek) {
- goto __696
+ goto __722
}
pTabCur = *(*uintptr)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*Op)(unsafe.Pointer(pOp)).Fp3)*4))
(*VdbeCursor)(unsafe.Pointer(pTabCur)).FnullRow = U8(0)
- (*VdbeCursor)(unsafe.Pointer(pTabCur)).FmovetoTarget = *(*I64)(unsafe.Pointer(bp + 528 /* rowid */))
+ (*VdbeCursor)(unsafe.Pointer(pTabCur)).FmovetoTarget = *(*I64)(unsafe.Pointer(bp + 560 /* rowid */))
(*VdbeCursor)(unsafe.Pointer(pTabCur)).FdeferredMoveto = U8(1)
- (*VdbeCursor)(unsafe.Pointer(pTabCur)).FaAltMap = *(*uintptr)(unsafe.Pointer(pOp + 16 /* &.p4 */))
+ (*VdbeCursor)(unsafe.Pointer(pTabCur)).FaAltMap = *(*uintptr)(unsafe.Pointer(pOp + 16))
(*VdbeCursor)(unsafe.Pointer(pTabCur)).FpAltCursor = pC24
- goto __697
-__696:
+ goto __723
+__722:
pOut = out2Prerelease(tls, p, pOp)
- *(*I64)(unsafe.Pointer(pOut /* &.u */)) = *(*I64)(unsafe.Pointer(bp + 528 /* rowid */))
-__697:
+ *(*I64)(unsafe.Pointer(pOut)) = *(*I64)(unsafe.Pointer(bp + 560 /* rowid */))
+__723:
;
- goto __694
-__693:
+ goto __720
+__719:
;
- Xsqlite3VdbeMemSetNull(tls, (aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp2)*40))
-__694:
+ Xsqlite3VdbeMemSetNull(tls, aMem+uintptr((*Op)(unsafe.Pointer(pOp)).Fp2)*40)
+__720:
;
goto __8
@@ -72094,21 +73067,21 @@ __694:
// If cursor P1 was previously moved via OP_DeferredSeek, complete that
// seek operation now, without further delay. If the cursor seek has
// already occurred, this instruction is a no-op.
-__127: // The P1 index cursor
+__129: // The P1 index cursor
;
pC25 = *(*uintptr)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*4))
if !((*VdbeCursor)(unsafe.Pointer(pC25)).FdeferredMoveto != 0) {
- goto __698
+ goto __724
}
rc = Xsqlite3VdbeFinishMoveto(tls, pC25)
if !(rc != 0) {
- goto __699
+ goto __725
}
goto abort_due_to_error
-__699:
+__725:
;
-__698:
+__724:
;
goto __8
@@ -72152,74 +73125,74 @@ __698:
//
// If the P1 index entry is less than or equal to the key value then jump
// to P2. Otherwise fall through to the next instruction.
-__128: // jump
-__129: // jump
__130: // jump
-__131:
+__131: // jump
+__132: // jump
+__133:
;
pC26 = *(*uintptr)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*4))
- (*UnpackedRecord)(unsafe.Pointer(bp + 576 /* &r4 */)).FpKeyInfo = (*VdbeCursor)(unsafe.Pointer(pC26)).FpKeyInfo
- (*UnpackedRecord)(unsafe.Pointer(bp + 576 /* &r4 */)).FnField = U16(*(*int32)(unsafe.Pointer(pOp + 16 /* &.p4 */)))
+ (*UnpackedRecord)(unsafe.Pointer(bp + 608 /* &r4 */)).FpKeyInfo = (*VdbeCursor)(unsafe.Pointer(pC26)).FpKeyInfo
+ (*UnpackedRecord)(unsafe.Pointer(bp + 608 /* &r4 */)).FnField = U16(*(*int32)(unsafe.Pointer(pOp + 16)))
if !(int32((*Op)(unsafe.Pointer(pOp)).Fopcode) < OP_IdxLT) {
- goto __700
+ goto __726
}
- (*UnpackedRecord)(unsafe.Pointer(bp + 576 /* &r4 */)).Fdefault_rc = int8(-1)
- goto __701
-__700:
+ (*UnpackedRecord)(unsafe.Pointer(bp + 608 /* &r4 */)).Fdefault_rc = int8(-1)
+ goto __727
+__726:
;
- (*UnpackedRecord)(unsafe.Pointer(bp + 576 /* &r4 */)).Fdefault_rc = int8(0)
-__701:
+ (*UnpackedRecord)(unsafe.Pointer(bp + 608 /* &r4 */)).Fdefault_rc = int8(0)
+__727:
;
- (*UnpackedRecord)(unsafe.Pointer(bp + 576 /* &r4 */)).FaMem = (aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp3)*40)
+ (*UnpackedRecord)(unsafe.Pointer(bp + 608 /* &r4 */)).FaMem = aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp3)*40
/* Inlined version of sqlite3VdbeIdxKeyCompare() */
nCellKey = int64(0)
- pCur1 = *(*uintptr)(unsafe.Pointer(pC26 + 40 /* &.uc */))
+ pCur1 = *(*uintptr)(unsafe.Pointer(pC26 + 40))
nCellKey = I64(Xsqlite3BtreePayloadSize(tls, pCur1))
// nCellKey will always be between 0 and 0xffffffff because of the way
// that btreeParseCellPtr() and sqlite3GetVarint32() are implemented
- if !((nCellKey <= int64(0)) || (nCellKey > int64(0x7fffffff))) {
- goto __702
+ if !(nCellKey <= int64(0) || nCellKey > int64(0x7fffffff)) {
+ goto __728
}
- rc = Xsqlite3CorruptError(tls, 92650)
+ rc = Xsqlite3CorruptError(tls, 92994)
goto abort_due_to_error
-__702:
+__728:
;
- Xsqlite3VdbeMemInit(tls, bp+536 /* &m */, db, uint16(0))
- rc = Xsqlite3VdbeMemFromBtreeZeroOffset(tls, pCur1, U32(nCellKey), bp+536 /* &m */)
+ Xsqlite3VdbeMemInit(tls, bp+568 /* &m */, db, uint16(0))
+ rc = Xsqlite3VdbeMemFromBtreeZeroOffset(tls, pCur1, U32(nCellKey), bp+568 /* &m */)
if !(rc != 0) {
- goto __703
+ goto __729
}
goto abort_due_to_error
-__703:
+__729:
;
- res12 = Xsqlite3VdbeRecordCompareWithSkip(tls, (*Mem)(unsafe.Pointer(bp+536 /* &m */)).Fn, (*Mem)(unsafe.Pointer(bp+536 /* &m */)).Fz, bp+576 /* &r4 */, 0)
- Xsqlite3VdbeMemRelease(tls, bp+536 /* &m */)
+ res12 = Xsqlite3VdbeRecordCompareWithSkip(tls, (*Mem)(unsafe.Pointer(bp+568 /* &m */)).Fn, (*Mem)(unsafe.Pointer(bp+568 /* &m */)).Fz, bp+608 /* &r4 */, 0)
+ Xsqlite3VdbeMemRelease(tls, bp+568 /* &m */)
// End of inlined sqlite3VdbeIdxKeyCompare()
- if !((int32((*Op)(unsafe.Pointer(pOp)).Fopcode) & 1) == (OP_IdxLT & 1)) {
- goto __704
+ if !(int32((*Op)(unsafe.Pointer(pOp)).Fopcode)&1 == OP_IdxLT&1) {
+ goto __730
}
res12 = -res12
- goto __705
-__704:
+ goto __731
+__730:
;
res12++
-__705:
+__731:
;
if !(res12 > 0) {
- goto __706
+ goto __732
}
goto jump_to_p2
-__706:
+__732:
;
goto __8
@@ -72249,41 +73222,41 @@ __706:
// and non-autovacuum modes.
//
// See also: Clear
-__132:
+__134:
;
pOut = out2Prerelease(tls, p, pOp)
(*Mem)(unsafe.Pointer(pOut)).Fflags = U16(MEM_Null)
- if !((*Sqlite3)(unsafe.Pointer(db)).FnVdbeRead > ((*Sqlite3)(unsafe.Pointer(db)).FnVDestroy + 1)) {
- goto __707
+ if !((*Sqlite3)(unsafe.Pointer(db)).FnVdbeRead > (*Sqlite3)(unsafe.Pointer(db)).FnVDestroy+1) {
+ goto __733
}
rc = SQLITE_LOCKED
(*Vdbe)(unsafe.Pointer(p)).FerrorAction = U8(OE_Abort)
goto abort_due_to_error
- goto __708
-__707:
+ goto __734
+__733:
iDb2 = (*Op)(unsafe.Pointer(pOp)).Fp3
- *(*int32)(unsafe.Pointer(bp + 592 /* iMoved */)) = 0 // Not needed. Only to silence a warning.
- rc = Xsqlite3BtreeDropTable(tls, (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+uintptr(iDb2)*16)).FpBt, (*Op)(unsafe.Pointer(pOp)).Fp1, bp+592 /* &iMoved */)
+ *(*int32)(unsafe.Pointer(bp + 624 /* iMoved */)) = 0 // Not needed. Only to silence a warning.
+ rc = Xsqlite3BtreeDropTable(tls, (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+uintptr(iDb2)*16)).FpBt, (*Op)(unsafe.Pointer(pOp)).Fp1, bp+624 /* &iMoved */)
(*Mem)(unsafe.Pointer(pOut)).Fflags = U16(MEM_Int)
- *(*I64)(unsafe.Pointer(pOut /* &.u */)) = I64(*(*int32)(unsafe.Pointer(bp + 592 /* iMoved */)))
+ *(*I64)(unsafe.Pointer(pOut)) = I64(*(*int32)(unsafe.Pointer(bp + 624 /* iMoved */)))
if !(rc != 0) {
- goto __709
+ goto __735
}
goto abort_due_to_error
-__709:
+__735:
;
- if !(*(*int32)(unsafe.Pointer(bp + 592 /* iMoved */)) != 0) {
- goto __710
+ if !(*(*int32)(unsafe.Pointer(bp + 624)) != 0) {
+ goto __736
}
- Xsqlite3RootPageMoved(tls, db, iDb2, uint32(*(*int32)(unsafe.Pointer(bp + 592 /* iMoved */))), uint32((*Op)(unsafe.Pointer(pOp)).Fp1))
+ Xsqlite3RootPageMoved(tls, db, iDb2, uint32(*(*int32)(unsafe.Pointer(bp + 624 /* iMoved */))), uint32((*Op)(unsafe.Pointer(pOp)).Fp1))
// All OP_Destroy operations occur on the same btree
- resetSchemaOnFault = (U8(iDb2 + 1))
-__710:
+ resetSchemaOnFault = U8(iDb2 + 1)
+__736:
;
-__708:
+__734:
;
goto __8
@@ -72303,29 +73276,29 @@ __708:
// by the number of rows in the table being cleared.
//
// See also: Destroy
-__133:
+__135:
;
- *(*int32)(unsafe.Pointer(bp + 596 /* nChange */)) = 0
+ *(*I64)(unsafe.Pointer(bp + 632 /* nChange */)) = int64(0)
- rc = Xsqlite3BtreeClearTable(tls, (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+uintptr((*Op)(unsafe.Pointer(pOp)).Fp2)*16)).FpBt, int32(U32((*Op)(unsafe.Pointer(pOp)).Fp1)), bp+596 /* &nChange */)
+ rc = Xsqlite3BtreeClearTable(tls, (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+uintptr((*Op)(unsafe.Pointer(pOp)).Fp2)*16)).FpBt, int32(U32((*Op)(unsafe.Pointer(pOp)).Fp1)), bp+632 /* &nChange */)
if !((*Op)(unsafe.Pointer(pOp)).Fp3 != 0) {
- goto __711
+ goto __737
}
- *(*int32)(unsafe.Pointer(p + 44 /* &.nChange */)) += (*(*int32)(unsafe.Pointer(bp + 596 /* nChange */)))
+ *(*I64)(unsafe.Pointer(p + 48)) += *(*I64)(unsafe.Pointer(bp + 632))
if !((*Op)(unsafe.Pointer(pOp)).Fp3 > 0) {
- goto __712
+ goto __738
}
- *(*I64)(unsafe.Pointer(aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp3)*40 /* &.u */ /* &.i */)) += (I64(*(*int32)(unsafe.Pointer(bp + 596 /* nChange */))))
-__712:
+ *(*I64)(unsafe.Pointer(aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp3)*40)) += *(*I64)(unsafe.Pointer(bp + 632))
+__738:
;
-__711:
+__737:
;
if !(rc != 0) {
- goto __713
+ goto __739
}
goto abort_due_to_error
-__713:
+__739:
;
goto __8
@@ -72336,26 +73309,26 @@ __713:
//
// This opcode only works for cursors used for sorting and
// opened with OP_OpenEphemeral or OP_SorterOpen.
-__134:
+__136:
;
pC27 = *(*uintptr)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*4))
- if !(int32((*VdbeCursor)(unsafe.Pointer((pC27))).FeCurType) == CURTYPE_SORTER) {
- goto __714
+ if !(int32((*VdbeCursor)(unsafe.Pointer(pC27)).FeCurType) == CURTYPE_SORTER) {
+ goto __740
}
- Xsqlite3VdbeSorterReset(tls, db, *(*uintptr)(unsafe.Pointer(pC27 + 40 /* &.uc */)))
- goto __715
-__714:
+ Xsqlite3VdbeSorterReset(tls, db, *(*uintptr)(unsafe.Pointer(pC27 + 40)))
+ goto __741
+__740:
;
- rc = Xsqlite3BtreeClearTableOfCursor(tls, *(*uintptr)(unsafe.Pointer(pC27 + 40 /* &.uc */)))
+ rc = Xsqlite3BtreeClearTableOfCursor(tls, *(*uintptr)(unsafe.Pointer(pC27 + 40)))
if !(rc != 0) {
- goto __716
+ goto __742
}
goto abort_due_to_error
-__716:
+__742:
;
-__715:
+__741:
;
goto __8
@@ -72367,36 +73340,36 @@ __715:
// P1>1. The P3 argument must be 1 (BTREE_INTKEY) for a rowid table
// it must be 2 (BTREE_BLOBKEY) for an index or WITHOUT ROWID table.
// The root page number of the new b-tree is stored in register P2.
-__135:
+__137:
;
pOut = out2Prerelease(tls, p, pOp)
- *(*Pgno)(unsafe.Pointer(bp + 600 /* pgno */)) = Pgno(0)
+ *(*Pgno)(unsafe.Pointer(bp + 640 /* pgno */)) = Pgno(0)
- pDb2 = ((*Sqlite3)(unsafe.Pointer(db)).FaDb + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*16)
+ pDb2 = (*Sqlite3)(unsafe.Pointer(db)).FaDb + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*16
- rc = Xsqlite3BtreeCreateTable(tls, (*Db)(unsafe.Pointer(pDb2)).FpBt, bp+600 /* &pgno */, (*Op)(unsafe.Pointer(pOp)).Fp3)
+ rc = Xsqlite3BtreeCreateTable(tls, (*Db)(unsafe.Pointer(pDb2)).FpBt, bp+640 /* &pgno */, (*Op)(unsafe.Pointer(pOp)).Fp3)
if !(rc != 0) {
- goto __717
+ goto __743
}
goto abort_due_to_error
-__717:
+__743:
;
- *(*I64)(unsafe.Pointer(pOut /* &.u */)) = I64(*(*Pgno)(unsafe.Pointer(bp + 600 /* pgno */)))
+ *(*I64)(unsafe.Pointer(pOut)) = I64(*(*Pgno)(unsafe.Pointer(bp + 640 /* pgno */)))
goto __8
// Opcode: SqlExec * * * P4 *
//
// Run the SQL statement or statements specified in the P4 string.
-__136:
+__138:
;
(*Sqlite3)(unsafe.Pointer(db)).FnSqlExec++
- rc = Xsqlite3_exec(tls, db, *(*uintptr)(unsafe.Pointer(pOp + 16 /* &.p4 */)), uintptr(0), uintptr(0), uintptr(0))
+ rc = Xsqlite3_exec(tls, db, *(*uintptr)(unsafe.Pointer(pOp + 16)), uintptr(0), uintptr(0), uintptr(0))
(*Sqlite3)(unsafe.Pointer(db)).FnSqlExec--
if !(rc != 0) {
- goto __718
+ goto __744
}
goto abort_due_to_error
-__718:
+__744:
;
goto __8
@@ -72408,7 +73381,7 @@ __718:
//
// This opcode invokes the parser to create a new virtual machine,
// then runs the new virtual machine. It is thus a re-entrant opcode.
-__137:
+__139:
// Any prepared statement that invokes this opcode will hold mutexes
// on every btree. This is a prerequisite for invoking
@@ -72416,73 +73389,73 @@ __137:
iDb3 = (*Op)(unsafe.Pointer(pOp)).Fp1
- if !(*(*uintptr)(unsafe.Pointer(pOp + 16 /* &.p4 */)) == uintptr(0)) {
- goto __719
+ if !(*(*uintptr)(unsafe.Pointer(pOp + 16)) == uintptr(0)) {
+ goto __745
}
Xsqlite3SchemaClear(tls, (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+uintptr(iDb3)*16)).FpSchema)
- *(*U32)(unsafe.Pointer(db + 24 /* &.mDbFlags */)) &= (libc.Uint32FromInt32(libc.CplInt32(DBFLAG_SchemaKnownOk)))
- rc = Xsqlite3InitOne(tls, db, iDb3, (p + 124 /* &.zErrMsg */), uint32((*Op)(unsafe.Pointer(pOp)).Fp5))
- *(*U32)(unsafe.Pointer(db + 24 /* &.mDbFlags */)) |= (U32(DBFLAG_SchemaChange))
- libc.SetBitFieldPtr16Uint32(p+152 /* &.expired */, Bft(0), 0, 0x3)
- goto __720
-__719:
+ *(*U32)(unsafe.Pointer(db + 24)) &= libc.Uint32FromInt32(libc.CplInt32(DBFLAG_SchemaKnownOk))
+ rc = Xsqlite3InitOne(tls, db, iDb3, p+132, uint32((*Op)(unsafe.Pointer(pOp)).Fp5))
+ *(*U32)(unsafe.Pointer(db + 24)) |= U32(DBFLAG_SchemaChange)
+ libc.SetBitFieldPtr16Uint32(p+160, Bft(0), 0, 0x3)
+ goto __746
+__745:
- zSchema = ts + 4956 /* "sqlite_master" */
- (*InitData)(unsafe.Pointer(bp + 604 /* &initData */)).Fdb = db
- (*InitData)(unsafe.Pointer(bp + 604 /* &initData */)).FiDb = iDb3
- (*InitData)(unsafe.Pointer(bp + 604 /* &initData */)).FpzErrMsg = (p + 124 /* &.zErrMsg */)
- (*InitData)(unsafe.Pointer(bp + 604 /* &initData */)).FmInitFlags = U32(0)
- (*InitData)(unsafe.Pointer(bp + 604 /* &initData */)).FmxPage = Xsqlite3BtreeLastPage(tls, (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+uintptr(iDb3)*16)).FpBt)
+ zSchema = ts + 5803 /* "sqlite_master" */
+ (*InitData)(unsafe.Pointer(bp + 644 /* &initData */)).Fdb = db
+ (*InitData)(unsafe.Pointer(bp + 644 /* &initData */)).FiDb = iDb3
+ (*InitData)(unsafe.Pointer(bp + 644 /* &initData */)).FpzErrMsg = p + 132
+ (*InitData)(unsafe.Pointer(bp + 644 /* &initData */)).FmInitFlags = U32(0)
+ (*InitData)(unsafe.Pointer(bp + 644 /* &initData */)).FmxPage = Xsqlite3BtreeLastPage(tls, (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+uintptr(iDb3)*16)).FpBt)
zSql = Xsqlite3MPrintf(tls, db,
- ts+4970, /* "SELECT*FROM\"%w\"...." */
- libc.VaList(bp+64, (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+uintptr(iDb3)*16)).FzDbSName, zSchema, *(*uintptr)(unsafe.Pointer(pOp + 16 /* &.p4 */))))
+ ts+5817, /* "SELECT*FROM\"%w\"...." */
+ libc.VaList(bp+96, (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+uintptr(iDb3)*16)).FzDbSName, zSchema, *(*uintptr)(unsafe.Pointer(pOp + 16))))
if !(zSql == uintptr(0)) {
- goto __721
+ goto __747
}
rc = SQLITE_NOMEM
- goto __722
-__721:
+ goto __748
+__747:
;
(*Sqlite3)(unsafe.Pointer(db)).Finit.Fbusy = U8(1)
- (*InitData)(unsafe.Pointer(bp + 604 /* &initData */)).Frc = SQLITE_OK
- (*InitData)(unsafe.Pointer(bp + 604 /* &initData */)).FnInitRow = U32(0)
+ (*InitData)(unsafe.Pointer(bp + 644 /* &initData */)).Frc = SQLITE_OK
+ (*InitData)(unsafe.Pointer(bp + 644 /* &initData */)).FnInitRow = U32(0)
rc = Xsqlite3_exec(tls, db, zSql, *(*uintptr)(unsafe.Pointer(&struct {
f func(*libc.TLS, uintptr, int32, uintptr, uintptr) int32
- }{Xsqlite3InitCallback})), bp+604 /* &initData */, uintptr(0))
+ }{Xsqlite3InitCallback})), bp+644 /* &initData */, uintptr(0))
if !(rc == SQLITE_OK) {
- goto __723
+ goto __749
}
- rc = (*InitData)(unsafe.Pointer(bp + 604 /* &initData */)).Frc
-__723:
+ rc = (*InitData)(unsafe.Pointer(bp + 644 /* &initData */)).Frc
+__749:
;
- if !((rc == SQLITE_OK) && ((*InitData)(unsafe.Pointer(bp+604 /* &initData */)).FnInitRow == U32(0))) {
- goto __724
+ if !(rc == SQLITE_OK && (*InitData)(unsafe.Pointer(bp+644)).FnInitRow == U32(0)) {
+ goto __750
}
// The OP_ParseSchema opcode with a non-NULL P4 argument should parse
// at least one SQL statement. Any less than that indicates that
// the sqlite_schema table is corrupt.
- rc = Xsqlite3CorruptError(tls, 92902)
-__724:
+ rc = Xsqlite3CorruptError(tls, 93246)
+__750:
;
Xsqlite3DbFreeNN(tls, db, zSql)
(*Sqlite3)(unsafe.Pointer(db)).Finit.Fbusy = U8(0)
-__722:
+__748:
;
-__720:
+__746:
;
if !(rc != 0) {
- goto __725
+ goto __751
}
Xsqlite3ResetAllSchemasOfConnection(tls, db)
if !(rc == SQLITE_NOMEM) {
- goto __726
+ goto __752
}
goto no_mem
-__726:
+__752:
;
goto abort_due_to_error
-__725:
+__751:
;
goto __8
@@ -72491,14 +73464,14 @@ __725:
// Read the sqlite_stat1 table for database P1 and load the content
// of that table into the internal index hash table. This will cause
// the analysis to be used when preparing all subsequent queries.
-__138:
+__140:
;
rc = Xsqlite3AnalysisLoad(tls, db, (*Op)(unsafe.Pointer(pOp)).Fp1)
if !(rc != 0) {
- goto __727
+ goto __753
}
goto abort_due_to_error
-__727:
+__753:
;
goto __8
@@ -72509,9 +73482,9 @@ __727:
// is dropped from disk (using the Destroy opcode) in order to keep
// the internal representation of the
// schema consistent with what is on disk.
-__139:
+__141:
;
- Xsqlite3UnlinkAndDeleteTable(tls, db, (*Op)(unsafe.Pointer(pOp)).Fp1, *(*uintptr)(unsafe.Pointer(pOp + 16 /* &.p4 */)))
+ Xsqlite3UnlinkAndDeleteTable(tls, db, (*Op)(unsafe.Pointer(pOp)).Fp1, *(*uintptr)(unsafe.Pointer(pOp + 16)))
goto __8
// Opcode: DropIndex P1 * * P4 *
@@ -72521,9 +73494,9 @@ __139:
// is dropped from disk (using the Destroy opcode)
// in order to keep the internal representation of the
// schema consistent with what is on disk.
-__140:
+__142:
;
- Xsqlite3UnlinkAndDeleteIndex(tls, db, (*Op)(unsafe.Pointer(pOp)).Fp1, *(*uintptr)(unsafe.Pointer(pOp + 16 /* &.p4 */)))
+ Xsqlite3UnlinkAndDeleteIndex(tls, db, (*Op)(unsafe.Pointer(pOp)).Fp1, *(*uintptr)(unsafe.Pointer(pOp + 16)))
goto __8
// Opcode: DropTrigger P1 * * P4 *
@@ -72533,9 +73506,9 @@ __140:
// is dropped from disk (using the Destroy opcode) in order to keep
// the internal representation of the
// schema consistent with what is on disk.
-__141:
+__143:
;
- Xsqlite3UnlinkAndDeleteTrigger(tls, db, (*Op)(unsafe.Pointer(pOp)).Fp1, *(*uintptr)(unsafe.Pointer(pOp + 16 /* &.p4 */)))
+ Xsqlite3UnlinkAndDeleteTrigger(tls, db, (*Op)(unsafe.Pointer(pOp)).Fp1, *(*uintptr)(unsafe.Pointer(pOp + 16)))
goto __8
// Opcode: IntegrityCk P1 P2 P3 P4 P5
@@ -72556,36 +73529,36 @@ __141:
// file, not the main database file.
//
// This opcode is used to implement the integrity_check pragma.
-__142: // Register keeping track of errors remaining
+__144: // Register keeping track of errors remaining
;
nRoot = (*Op)(unsafe.Pointer(pOp)).Fp2
- aRoot = *(*uintptr)(unsafe.Pointer(pOp + 16 /* &.p4 */))
+ aRoot = *(*uintptr)(unsafe.Pointer(pOp + 16))
- pnErr = (aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp3)*40)
+ pnErr = aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp3)*40
- pIn1 = (aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*40)
+ pIn1 = aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*40
- z = Xsqlite3BtreeIntegrityCheck(tls, db, (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+uintptr((*Op)(unsafe.Pointer(pOp)).Fp5)*16)).FpBt, (aRoot + 1*4), nRoot,
- (int32(*(*I64)(unsafe.Pointer(pnErr /* &.u */))) + 1), bp+632 /* &nErr */)
+ z = Xsqlite3BtreeIntegrityCheck(tls, db, (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+uintptr((*Op)(unsafe.Pointer(pOp)).Fp5)*16)).FpBt, aRoot+1*4, nRoot,
+ int32(*(*I64)(unsafe.Pointer(pnErr)))+1, bp+672 /* &nErr */)
Xsqlite3VdbeMemSetNull(tls, pIn1)
- if !(*(*int32)(unsafe.Pointer(bp + 632 /* nErr */)) == 0) {
- goto __728
+ if !(*(*int32)(unsafe.Pointer(bp + 672)) == 0) {
+ goto __754
}
- goto __729
-__728:
+ goto __755
+__754:
if !(z == uintptr(0)) {
- goto __730
+ goto __756
}
goto no_mem
- goto __731
-__730:
- *(*I64)(unsafe.Pointer(pnErr /* &.u */ /* &.i */)) -= (I64(*(*int32)(unsafe.Pointer(bp + 632 /* nErr */)) - 1))
+ goto __757
+__756:
+ *(*I64)(unsafe.Pointer(pnErr)) -= I64(*(*int32)(unsafe.Pointer(bp + 672)) - 1)
Xsqlite3VdbeMemSetStr(tls, pIn1, z, int64(-1), uint8(SQLITE_UTF8), *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{Xsqlite3_free})))
-__731:
+__757:
;
-__729:
+__755:
;
Xsqlite3VdbeChangeEncoding(tls, pIn1, int32(encoding))
@@ -72598,23 +73571,23 @@ __729:
// held in register P1.
//
// An assertion fails if P2 is not an integer.
-__143: // in1, in2
- pIn1 = (aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*40)
- pIn2 = (aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp2)*40)
+__145: // in1, in2
+ pIn1 = aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*40
+ pIn2 = aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp2)*40
- if !((int32((*Mem)(unsafe.Pointer(pIn1)).Fflags) & MEM_Blob) == 0) {
- goto __732
+ if !(int32((*Mem)(unsafe.Pointer(pIn1)).Fflags)&MEM_Blob == 0) {
+ goto __758
}
if !(Xsqlite3VdbeMemSetRowSet(tls, pIn1) != 0) {
- goto __733
+ goto __759
}
goto no_mem
-__733:
+__759:
;
-__732:
+__758:
;
- Xsqlite3RowSetInsert(tls, (*Mem)(unsafe.Pointer(pIn1)).Fz, *(*I64)(unsafe.Pointer(pIn2 /* &.u */)))
+ Xsqlite3RowSetInsert(tls, (*Mem)(unsafe.Pointer(pIn1)).Fz, *(*I64)(unsafe.Pointer(pIn2)))
goto __8
// Opcode: RowSetRead P1 P2 P3 * *
@@ -72624,24 +73597,24 @@ __732:
// and put that value into register P3.
// Or, if RowSet object P1 is initially empty, leave P3
// unchanged and jump to instruction P2.
-__144:
+__146:
- pIn1 = (aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*40)
+ pIn1 = aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*40
- if !(((int32((*Mem)(unsafe.Pointer(pIn1)).Fflags) & MEM_Blob) == 0) ||
- (Xsqlite3RowSetNext(tls, (*Mem)(unsafe.Pointer(pIn1)).Fz, bp+640 /* &val */) == 0)) {
- goto __734
+ if !(int32((*Mem)(unsafe.Pointer(pIn1)).Fflags)&MEM_Blob == 0 ||
+ Xsqlite3RowSetNext(tls, (*Mem)(unsafe.Pointer(pIn1)).Fz, bp+680) == 0) {
+ goto __760
}
// The boolean index is empty
Xsqlite3VdbeMemSetNull(tls, pIn1)
goto jump_to_p2_and_check_for_interrupt
- goto __735
-__734:
+ goto __761
+__760:
// A value was pulled from the index
;
- Xsqlite3VdbeMemSetInt64(tls, (aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp3)*40), *(*I64)(unsafe.Pointer(bp + 640 /* val */)))
-__735:
+ Xsqlite3VdbeMemSetInt64(tls, aMem+uintptr((*Op)(unsafe.Pointer(pOp)).Fp3)*40, *(*I64)(unsafe.Pointer(bp + 680 /* val */)))
+__761:
;
goto check_for_interrupt
@@ -72667,44 +73640,44 @@ __735:
// inserted, there is no need to search to see if the same value was
// previously inserted as part of set X (only if it was previously
// inserted as part of some other set).
-__145:
+__147:
- pIn1 = (aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*40)
- pIn3 = (aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp3)*40)
- iSet = *(*int32)(unsafe.Pointer(pOp + 16 /* &.p4 */))
+ pIn1 = aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*40
+ pIn3 = aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp3)*40
+ iSet = *(*int32)(unsafe.Pointer(pOp + 16))
// If there is anything other than a rowset object in memory cell P1,
// delete it now and initialize P1 with an empty rowset
- if !((int32((*Mem)(unsafe.Pointer(pIn1)).Fflags) & MEM_Blob) == 0) {
- goto __736
+ if !(int32((*Mem)(unsafe.Pointer(pIn1)).Fflags)&MEM_Blob == 0) {
+ goto __762
}
if !(Xsqlite3VdbeMemSetRowSet(tls, pIn1) != 0) {
- goto __737
+ goto __763
}
goto no_mem
-__737:
+__763:
;
-__736:
+__762:
;
if !(iSet != 0) {
- goto __738
+ goto __764
}
- exists = Xsqlite3RowSetTest(tls, (*Mem)(unsafe.Pointer(pIn1)).Fz, iSet, *(*I64)(unsafe.Pointer(pIn3 /* &.u */)))
+ exists = Xsqlite3RowSetTest(tls, (*Mem)(unsafe.Pointer(pIn1)).Fz, iSet, *(*I64)(unsafe.Pointer(pIn3)))
if !(exists != 0) {
- goto __739
+ goto __765
}
goto jump_to_p2
-__739:
+__765:
;
-__738:
+__764:
;
if !(iSet >= 0) {
- goto __740
+ goto __766
}
- Xsqlite3RowSetInsert(tls, (*Mem)(unsafe.Pointer(pIn1)).Fz, *(*I64)(unsafe.Pointer(pIn3 /* &.u */)))
-__740:
+ Xsqlite3RowSetInsert(tls, (*Mem)(unsafe.Pointer(pIn1)).Fz, *(*I64)(unsafe.Pointer(pIn3)))
+__766:
;
goto __8
@@ -72722,10 +73695,10 @@ __740:
// P4 is a pointer to the VM containing the trigger program.
//
// If P5 is non-zero, then recursive program invocation is enabled.
-__146: // Token identifying trigger
+__148: // Token identifying trigger
- pProgram = *(*uintptr)(unsafe.Pointer(pOp + 16 /* &.p4 */))
- pRt = (aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp3)*40)
+ pProgram = *(*uintptr)(unsafe.Pointer(pOp + 16))
+ pRt = aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp3)*40
// If the p5 flag is clear, then recursive invocation of triggers is
// disabled for backwards compatibility (p5 is set if this sub-program
@@ -72739,71 +73712,71 @@ __146: // Token identifying trigger
// single trigger all have the same value for the SubProgram.token
// variable.
if !((*Op)(unsafe.Pointer(pOp)).Fp5 != 0) {
- goto __741
+ goto __767
}
t1 = (*SubProgram)(unsafe.Pointer(pProgram)).Ftoken
pFrame2 = (*Vdbe)(unsafe.Pointer(p)).FpFrame
-__742:
- if !((pFrame2 != 0) && ((*VdbeFrame)(unsafe.Pointer(pFrame2)).Ftoken != t1)) {
- goto __744
+__768:
+ if !(pFrame2 != 0 && (*VdbeFrame)(unsafe.Pointer(pFrame2)).Ftoken != t1) {
+ goto __770
}
- goto __743
-__743:
+ goto __769
+__769:
pFrame2 = (*VdbeFrame)(unsafe.Pointer(pFrame2)).FpParent
- goto __742
- goto __744
-__744:
+ goto __768
+ goto __770
+__770:
;
if !(pFrame2 != 0) {
- goto __745
+ goto __771
}
goto __8
-__745:
+__771:
;
-__741:
+__767:
;
- if !((*Vdbe)(unsafe.Pointer(p)).FnFrame >= *(*int32)(unsafe.Pointer((db + 112 /* &.aLimit */) + 10*4))) {
- goto __746
+ if !((*Vdbe)(unsafe.Pointer(p)).FnFrame >= *(*int32)(unsafe.Pointer(db + 120 + 10*4))) {
+ goto __772
}
rc = SQLITE_ERROR
- Xsqlite3VdbeError(tls, p, ts+5013 /* "too many levels ..." */, 0)
+ Xsqlite3VdbeError(tls, p, ts+5860 /* "too many levels ..." */, 0)
goto abort_due_to_error
-__746:
+__772:
;
// Register pRt is used to store the memory required to save the state
// of the current program, and the memory required at runtime to execute
// the trigger program. If this trigger has been fired before, then pRt
// is already allocated. Otherwise, it must be initialized.
- if !((int32((*Mem)(unsafe.Pointer(pRt)).Fflags) & MEM_Blob) == 0) {
- goto __747
+ if !(int32((*Mem)(unsafe.Pointer(pRt)).Fflags)&MEM_Blob == 0) {
+ goto __773
}
// SubProgram.nMem is set to the number of memory cells used by the
// program stored in SubProgram.aOp. As well as these, one memory
// cell is required for each cursor used by the program. Set local
// variable nMem (and later, VdbeFrame.nChildMem) to this value.
- nMem = ((*SubProgram)(unsafe.Pointer(pProgram)).FnMem + (*SubProgram)(unsafe.Pointer(pProgram)).FnCsr)
+ nMem = (*SubProgram)(unsafe.Pointer(pProgram)).FnMem + (*SubProgram)(unsafe.Pointer(pProgram)).FnCsr
if !((*SubProgram)(unsafe.Pointer(pProgram)).FnCsr == 0) {
- goto __749
+ goto __775
}
nMem++
-__749:
+__775:
;
- nByte2 = (int32((((((uint32(unsafe.Sizeof(VdbeFrame{}))) + uint32(7)) & libc.Uint32FromInt32(libc.CplInt32(7))) +
- (uint32(nMem) * uint32(unsafe.Sizeof(Mem{})))) +
- (uint32((*SubProgram)(unsafe.Pointer(pProgram)).FnCsr) * uint32(unsafe.Sizeof(uintptr(0))))) +
- (uint32(((*SubProgram)(unsafe.Pointer(pProgram)).FnOp + 7) / 8))))
+ nByte2 = int32((uint32(unsafe.Sizeof(VdbeFrame{}))+uint32(7))&libc.Uint32FromInt32(libc.CplInt32(7)) +
+ uint32(nMem)*uint32(unsafe.Sizeof(Mem{})) +
+ uint32((*SubProgram)(unsafe.Pointer(pProgram)).FnCsr)*uint32(unsafe.Sizeof(uintptr(0))) +
+ uint32(((*SubProgram)(unsafe.Pointer(pProgram)).FnOp+7)/8))
pFrame2 = Xsqlite3DbMallocZero(tls, db, uint64(nByte2))
- if !(!(pFrame2 != 0)) {
- goto __750
+ if !!(pFrame2 != 0) {
+ goto __776
}
goto no_mem
-__750:
+__776:
;
Xsqlite3VdbeMemRelease(tls, pRt)
- (*Mem)(unsafe.Pointer(pRt)).Fflags = (U16(MEM_Blob | MEM_Dyn))
+ (*Mem)(unsafe.Pointer(pRt)).Fflags = U16(MEM_Blob | MEM_Dyn)
(*Mem)(unsafe.Pointer(pRt)).Fz = pFrame2
(*Mem)(unsafe.Pointer(pRt)).Fn = nByte2
(*Mem)(unsafe.Pointer(pRt)).FxDel = *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{Xsqlite3VdbeFrameMemDel}))
@@ -72811,7 +73784,7 @@ __750:
(*VdbeFrame)(unsafe.Pointer(pFrame2)).Fv = p
(*VdbeFrame)(unsafe.Pointer(pFrame2)).FnChildMem = nMem
(*VdbeFrame)(unsafe.Pointer(pFrame2)).FnChildCsr = (*SubProgram)(unsafe.Pointer(pProgram)).FnCsr
- (*VdbeFrame)(unsafe.Pointer(pFrame2)).Fpc = ((int32(pOp) - int32(aOp)) / 20)
+ (*VdbeFrame)(unsafe.Pointer(pFrame2)).Fpc = (int32(pOp) - int32(aOp)) / 20
(*VdbeFrame)(unsafe.Pointer(pFrame2)).FaMem = (*Vdbe)(unsafe.Pointer(p)).FaMem
(*VdbeFrame)(unsafe.Pointer(pFrame2)).FnMem = (*Vdbe)(unsafe.Pointer(p)).FnMem
(*VdbeFrame)(unsafe.Pointer(pFrame2)).FapCsr = (*Vdbe)(unsafe.Pointer(p)).FapCsr
@@ -72820,26 +73793,26 @@ __750:
(*VdbeFrame)(unsafe.Pointer(pFrame2)).FnOp = (*Vdbe)(unsafe.Pointer(p)).FnOp
(*VdbeFrame)(unsafe.Pointer(pFrame2)).Ftoken = (*SubProgram)(unsafe.Pointer(pProgram)).Ftoken
- pEnd = (((pFrame2) + 80) + uintptr((*VdbeFrame)(unsafe.Pointer(pFrame2)).FnChildMem)*40)
- pMem2 = ((pFrame2) + 80)
-__751:
+ pEnd = pFrame2 + 88 + uintptr((*VdbeFrame)(unsafe.Pointer(pFrame2)).FnChildMem)*40
+ pMem2 = pFrame2 + 88
+__777:
if !(pMem2 != pEnd) {
- goto __753
+ goto __779
}
(*Mem)(unsafe.Pointer(pMem2)).Fflags = U16(MEM_Undefined)
(*Mem)(unsafe.Pointer(pMem2)).Fdb = db
- goto __752
-__752:
+ goto __778
+__778:
pMem2 += 40
- goto __751
- goto __753
-__753:
+ goto __777
+ goto __779
+__779:
;
- goto __748
-__747:
+ goto __774
+__773:
pFrame2 = (*Mem)(unsafe.Pointer(pRt)).Fz
-__748:
+__774:
;
(*Vdbe)(unsafe.Pointer(p)).FnFrame++
@@ -72850,17 +73823,17 @@ __748:
(*VdbeFrame)(unsafe.Pointer(pFrame2)).FpAuxData = (*Vdbe)(unsafe.Pointer(p)).FpAuxData
(*Vdbe)(unsafe.Pointer(p)).FpAuxData = uintptr(0)
- (*Vdbe)(unsafe.Pointer(p)).FnChange = 0
+ (*Vdbe)(unsafe.Pointer(p)).FnChange = int64(0)
(*Vdbe)(unsafe.Pointer(p)).FpFrame = pFrame2
- (*Vdbe)(unsafe.Pointer(p)).FaMem = libc.AssignUintptr(&aMem, ((pFrame2) + 80))
+ (*Vdbe)(unsafe.Pointer(p)).FaMem = libc.AssignUintptr(&aMem, pFrame2+88)
(*Vdbe)(unsafe.Pointer(p)).FnMem = (*VdbeFrame)(unsafe.Pointer(pFrame2)).FnChildMem
(*Vdbe)(unsafe.Pointer(p)).FnCursor = int32(U16((*VdbeFrame)(unsafe.Pointer(pFrame2)).FnChildCsr))
- (*Vdbe)(unsafe.Pointer(p)).FapCsr = (aMem + uintptr((*Vdbe)(unsafe.Pointer(p)).FnMem)*40)
- (*VdbeFrame)(unsafe.Pointer(pFrame2)).FaOnce = ((*Vdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*SubProgram)(unsafe.Pointer(pProgram)).FnCsr)*4)
- libc.Xmemset(tls, (*VdbeFrame)(unsafe.Pointer(pFrame2)).FaOnce, 0, (uint32(((*SubProgram)(unsafe.Pointer(pProgram)).FnOp + 7) / 8)))
+ (*Vdbe)(unsafe.Pointer(p)).FapCsr = aMem + uintptr((*Vdbe)(unsafe.Pointer(p)).FnMem)*40
+ (*VdbeFrame)(unsafe.Pointer(pFrame2)).FaOnce = (*Vdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*SubProgram)(unsafe.Pointer(pProgram)).FnCsr)*4
+ libc.Xmemset(tls, (*VdbeFrame)(unsafe.Pointer(pFrame2)).FaOnce, 0, uint32(((*SubProgram)(unsafe.Pointer(pProgram)).FnOp+7)/8))
(*Vdbe)(unsafe.Pointer(p)).FaOp = libc.AssignUintptr(&aOp, (*SubProgram)(unsafe.Pointer(pProgram)).FaOp)
(*Vdbe)(unsafe.Pointer(p)).FnOp = (*SubProgram)(unsafe.Pointer(pProgram)).FnOp
- pOp = (aOp + libc.UintptrFromInt32(-1)*20)
+ pOp = aOp + libc.UintptrFromInt32(-1)*20
goto check_for_interrupt
// Opcode: Param P1 P2 * * *
@@ -72874,10 +73847,10 @@ __748:
// The address of the cell in the parent frame is determined by adding
// the value of the P1 argument to the value of the P1 argument to the
// calling OP_Program instruction.
-__147:
+__149:
pOut = out2Prerelease(tls, p, pOp)
pFrame3 = (*Vdbe)(unsafe.Pointer(p)).FpFrame
- pIn = ((*VdbeFrame)(unsafe.Pointer(pFrame3)).FaMem + uintptr(((*Op)(unsafe.Pointer(pOp)).Fp1+(*Op)(unsafe.Pointer((*VdbeFrame)(unsafe.Pointer(pFrame3)).FaOp+uintptr((*VdbeFrame)(unsafe.Pointer(pFrame3)).Fpc)*20)).Fp1))*40)
+ pIn = (*VdbeFrame)(unsafe.Pointer(pFrame3)).FaMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1+(*Op)(unsafe.Pointer((*VdbeFrame)(unsafe.Pointer(pFrame3)).FaOp+uintptr((*VdbeFrame)(unsafe.Pointer(pFrame3)).Fpc)*20)).Fp1)*40
Xsqlite3VdbeMemShallowCopy(tls, pOut, pIn, MEM_Ephem)
goto __8
@@ -72888,23 +73861,23 @@ __147:
// If P1 is non-zero, the database constraint counter is incremented
// (deferred foreign key constraints). Otherwise, if P1 is zero, the
// statement counter is incremented (immediate foreign key constraints).
-__148:
- if !(((*Sqlite3)(unsafe.Pointer(db)).Fflags & uint64(SQLITE_DeferFKs)) != 0) {
- goto __754
+__150:
+ if !((*Sqlite3)(unsafe.Pointer(db)).Fflags&uint64(SQLITE_DeferFKs) != 0) {
+ goto __780
}
- *(*I64)(unsafe.Pointer(db + 512 /* &.nDeferredImmCons */)) += (I64((*Op)(unsafe.Pointer(pOp)).Fp2))
- goto __755
-__754:
+ *(*I64)(unsafe.Pointer(db + 536)) += I64((*Op)(unsafe.Pointer(pOp)).Fp2)
+ goto __781
+__780:
if !((*Op)(unsafe.Pointer(pOp)).Fp1 != 0) {
- goto __756
+ goto __782
}
- *(*I64)(unsafe.Pointer(db + 504 /* &.nDeferredCons */)) += (I64((*Op)(unsafe.Pointer(pOp)).Fp2))
- goto __757
-__756:
- *(*I64)(unsafe.Pointer(p + 64 /* &.nFkConstraint */)) += (I64((*Op)(unsafe.Pointer(pOp)).Fp2))
-__757:
+ *(*I64)(unsafe.Pointer(db + 528)) += I64((*Op)(unsafe.Pointer(pOp)).Fp2)
+ goto __783
+__782:
+ *(*I64)(unsafe.Pointer(p + 72)) += I64((*Op)(unsafe.Pointer(pOp)).Fp2)
+__783:
;
-__755:
+__781:
;
goto __8
@@ -72919,27 +73892,27 @@ __755:
// is zero (the one that counts deferred constraint violations). If P1 is
// zero, the jump is taken if the statement constraint-counter is zero
// (immediate foreign key constraint violations).
-__149: // jump
+__151: // jump
if !((*Op)(unsafe.Pointer(pOp)).Fp1 != 0) {
- goto __758
+ goto __784
}
- if !(((*Sqlite3)(unsafe.Pointer(db)).FnDeferredCons == int64(0)) && ((*Sqlite3)(unsafe.Pointer(db)).FnDeferredImmCons == int64(0))) {
- goto __760
+ if !((*Sqlite3)(unsafe.Pointer(db)).FnDeferredCons == int64(0) && (*Sqlite3)(unsafe.Pointer(db)).FnDeferredImmCons == int64(0)) {
+ goto __786
}
goto jump_to_p2
-__760:
+__786:
;
- goto __759
-__758:
+ goto __785
+__784:
;
- if !(((*Vdbe)(unsafe.Pointer(p)).FnFkConstraint == int64(0)) && ((*Sqlite3)(unsafe.Pointer(db)).FnDeferredImmCons == int64(0))) {
- goto __761
+ if !((*Vdbe)(unsafe.Pointer(p)).FnFkConstraint == int64(0) && (*Sqlite3)(unsafe.Pointer(db)).FnDeferredImmCons == int64(0)) {
+ goto __787
}
goto jump_to_p2
-__761:
+__787:
;
-__759:
+__785:
;
goto __8
@@ -72953,37 +73926,37 @@ __759:
//
// This instruction throws an error if the memory cell is not initially
// an integer.
-__150:
+__152:
if !((*Vdbe)(unsafe.Pointer(p)).FpFrame != 0) {
- goto __762
+ goto __788
}
pFrame4 = (*Vdbe)(unsafe.Pointer(p)).FpFrame
-__764:
+__790:
if !((*VdbeFrame)(unsafe.Pointer(pFrame4)).FpParent != 0) {
- goto __766
+ goto __792
}
- goto __765
-__765:
+ goto __791
+__791:
pFrame4 = (*VdbeFrame)(unsafe.Pointer(pFrame4)).FpParent
- goto __764
- goto __766
-__766:
+ goto __790
+ goto __792
+__792:
;
- pIn1 = ((*VdbeFrame)(unsafe.Pointer(pFrame4)).FaMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*40)
- goto __763
-__762:
- pIn1 = (aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*40)
-__763:
+ pIn1 = (*VdbeFrame)(unsafe.Pointer(pFrame4)).FaMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*40
+ goto __789
+__788:
+ pIn1 = aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*40
+__789:
;
Xsqlite3VdbeMemIntegerify(tls, pIn1)
- pIn2 = (aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp2)*40)
+ pIn2 = aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp2)*40
Xsqlite3VdbeMemIntegerify(tls, pIn2)
- if !(*(*I64)(unsafe.Pointer(pIn1 /* &.u */)) < *(*I64)(unsafe.Pointer(pIn2 /* &.u */))) {
- goto __767
+ if !(*(*I64)(unsafe.Pointer(pIn1)) < *(*I64)(unsafe.Pointer(pIn2))) {
+ goto __793
}
- *(*I64)(unsafe.Pointer(pIn1 /* &.u */)) = *(*I64)(unsafe.Pointer(pIn2 /* &.u */))
-__767:
+ *(*I64)(unsafe.Pointer(pIn1)) = *(*I64)(unsafe.Pointer(pIn2))
+__793:
;
goto __8
@@ -72996,15 +73969,15 @@ __767:
//
// If the initial value of register P1 is less than 1, then the
// value is unchanged and control passes through to the next instruction.
-__151: // jump, in1
- pIn1 = (aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*40)
+__153: // jump, in1
+ pIn1 = aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*40
- if !(*(*I64)(unsafe.Pointer(pIn1 /* &.u */)) > int64(0)) {
- goto __768
+ if !(*(*I64)(unsafe.Pointer(pIn1)) > int64(0)) {
+ goto __794
}
- *(*I64)(unsafe.Pointer(pIn1 /* &.u */ /* &.i */)) -= (I64((*Op)(unsafe.Pointer(pOp)).Fp3))
+ *(*I64)(unsafe.Pointer(pIn1)) -= I64((*Op)(unsafe.Pointer(pOp)).Fp3)
goto jump_to_p2
-__768:
+__794:
;
goto __8
@@ -73025,19 +73998,19 @@ __768:
// and r[P2] is set to -1.
//
// Otherwise, r[P2] is set to the sum of r[P1] and r[P3].
-__152:
- pIn1 = (aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*40)
- pIn3 = (aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp3)*40)
+__154:
+ pIn1 = aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*40
+ pIn3 = aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp3)*40
pOut = out2Prerelease(tls, p, pOp)
- *(*I64)(unsafe.Pointer(bp + 648 /* x3 */)) = *(*I64)(unsafe.Pointer(pIn1 /* &.u */))
- if !((*(*I64)(unsafe.Pointer(bp + 648 /* x3 */)) <= int64(0)) || (Xsqlite3AddInt64(tls, bp+648 /* &x3 */, func() int64 {
- if *(*I64)(unsafe.Pointer(pIn3 /* &.u */)) > int64(0) {
- return *(*I64)(unsafe.Pointer(pIn3 /* &.u */))
+ *(*I64)(unsafe.Pointer(bp + 688 /* x3 */)) = *(*I64)(unsafe.Pointer(pIn1))
+ if !(*(*I64)(unsafe.Pointer(bp + 688)) <= int64(0) || Xsqlite3AddInt64(tls, bp+688, func() int64 {
+ if *(*I64)(unsafe.Pointer(pIn3)) > int64(0) {
+ return *(*I64)(unsafe.Pointer(pIn3))
}
return int64(0)
- }()) != 0)) {
- goto __769
+ }()) != 0) {
+ goto __795
}
// If the LIMIT is less than or equal to zero, loop forever. This
// is documented. But also, if the LIMIT+OFFSET exceeds 2^63 then
@@ -73046,11 +74019,11 @@ __152:
// per second (far exceeding the capabilities of any current hardware)
// it would take nearly 300 years to actually reach the limit. So
// looping forever is a reasonable approximation.
- *(*I64)(unsafe.Pointer(pOut /* &.u */)) = int64(-1)
- goto __770
-__769:
- *(*I64)(unsafe.Pointer(pOut /* &.u */)) = *(*I64)(unsafe.Pointer(bp + 648 /* x3 */))
-__770:
+ *(*I64)(unsafe.Pointer(pOut)) = int64(-1)
+ goto __796
+__795:
+ *(*I64)(unsafe.Pointer(pOut)) = *(*I64)(unsafe.Pointer(bp + 688 /* x3 */))
+__796:
;
goto __8
@@ -73061,20 +74034,20 @@ __770:
// initially greater than zero, then decrement the value in register P1.
// If it is non-zero (negative or positive) and then also jump to P2.
// If register P1 is initially zero, leave it unchanged and fall through.
-__153: // jump, in1
- pIn1 = (aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*40)
+__155: // jump, in1
+ pIn1 = aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*40
- if !(*(*I64)(unsafe.Pointer(pIn1 /* &.u */)) != 0) {
- goto __771
+ if !(*(*I64)(unsafe.Pointer(pIn1)) != 0) {
+ goto __797
}
- if !(*(*I64)(unsafe.Pointer(pIn1 /* &.u */)) > int64(0)) {
- goto __772
+ if !(*(*I64)(unsafe.Pointer(pIn1)) > int64(0)) {
+ goto __798
}
- *(*I64)(unsafe.Pointer(pIn1 /* &.u */))--
-__772:
+ *(*I64)(unsafe.Pointer(pIn1))--
+__798:
;
goto jump_to_p2
-__771:
+__797:
;
goto __8
@@ -73083,21 +74056,21 @@ __771:
//
// Register P1 must hold an integer. Decrement the value in P1
// and jump to P2 if the new value is exactly zero.
-__154: // jump, in1
- pIn1 = (aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*40)
+__156: // jump, in1
+ pIn1 = aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*40
- if !(*(*I64)(unsafe.Pointer(pIn1 /* &.u */)) > ((int64(-1)) - (int64(0xffffffff) | (I64((int64(0x7fffffff))) << 32)))) {
- goto __773
+ if !(*(*I64)(unsafe.Pointer(pIn1)) > int64(-1)-(int64(0xffffffff)|I64(int64(0x7fffffff))<<32)) {
+ goto __799
}
- *(*I64)(unsafe.Pointer(pIn1 /* &.u */))--
-__773:
+ *(*I64)(unsafe.Pointer(pIn1))--
+__799:
;
- if !(*(*I64)(unsafe.Pointer(pIn1 /* &.u */)) == int64(0)) {
- goto __774
+ if !(*(*I64)(unsafe.Pointer(pIn1)) == int64(0)) {
+ goto __800
}
goto jump_to_p2
-__774:
+__800:
;
goto __8
@@ -73137,113 +74110,113 @@ __774:
// the opcode is changed. In this way, the initialization of the
// sqlite3_context only happens once, instead of on each call to the
// step function.
-__155:
-__156:
+__157:
+__158:
;
n4 = int32((*Op)(unsafe.Pointer(pOp)).Fp5)
- pCtx = Xsqlite3DbMallocRawNN(tls, db, (uint64((uint32(n4) * uint32(unsafe.Sizeof(uintptr(0)))) + ((uint32(unsafe.Sizeof(Sqlite3_context{})) + uint32(unsafe.Sizeof(Mem{}))) - uint32(unsafe.Sizeof(uintptr(0)))))))
+ pCtx = Xsqlite3DbMallocRawNN(tls, db, uint64(uint32(n4)*uint32(unsafe.Sizeof(uintptr(0)))+(uint32(unsafe.Sizeof(Sqlite3_context{}))+uint32(unsafe.Sizeof(Mem{}))-uint32(unsafe.Sizeof(uintptr(0))))))
if !(pCtx == uintptr(0)) {
- goto __775
+ goto __801
}
goto no_mem
-__775:
+__801:
;
(*Sqlite3_context)(unsafe.Pointer(pCtx)).FpMem = uintptr(0)
- (*Sqlite3_context)(unsafe.Pointer(pCtx)).FpOut = ((pCtx + 28 /* &.argv */) + uintptr(n4)*4)
+ (*Sqlite3_context)(unsafe.Pointer(pCtx)).FpOut = pCtx + 28 + uintptr(n4)*4
Xsqlite3VdbeMemInit(tls, (*Sqlite3_context)(unsafe.Pointer(pCtx)).FpOut, db, uint16(MEM_Null))
- (*Sqlite3_context)(unsafe.Pointer(pCtx)).FpFunc = *(*uintptr)(unsafe.Pointer(pOp + 16 /* &.p4 */))
- (*Sqlite3_context)(unsafe.Pointer(pCtx)).FiOp = ((int32(pOp) - int32(aOp)) / 20)
+ (*Sqlite3_context)(unsafe.Pointer(pCtx)).FpFunc = *(*uintptr)(unsafe.Pointer(pOp + 16))
+ (*Sqlite3_context)(unsafe.Pointer(pCtx)).FiOp = (int32(pOp) - int32(aOp)) / 20
(*Sqlite3_context)(unsafe.Pointer(pCtx)).FpVdbe = p
(*Sqlite3_context)(unsafe.Pointer(pCtx)).FskipFlag = U8(0)
(*Sqlite3_context)(unsafe.Pointer(pCtx)).FisError = 0
(*Sqlite3_context)(unsafe.Pointer(pCtx)).Fargc = U8(n4)
(*Op)(unsafe.Pointer(pOp)).Fp4type = int8(-16)
- *(*uintptr)(unsafe.Pointer(pOp + 16 /* &.p4 */)) = pCtx
+ *(*uintptr)(unsafe.Pointer(pOp + 16)) = pCtx
// OP_AggInverse must have P1==1 and OP_AggStep must have P1==0
(*Op)(unsafe.Pointer(pOp)).Fopcode = U8(OP_AggStep1)
-__157:
+__159:
;
- pCtx1 = *(*uintptr)(unsafe.Pointer(pOp + 16 /* &.p4 */))
- pMem3 = (aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp3)*40)
+ pCtx1 = *(*uintptr)(unsafe.Pointer(pOp + 16))
+ pMem3 = aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp3)*40
// If this function is inside of a trigger, the register array in aMem[]
// might change from one evaluation to the next. The next block of code
// checks to see if the register array has changed, and if so it
// reinitializes the relavant parts of the sqlite3_context object
if !((*Sqlite3_context)(unsafe.Pointer(pCtx1)).FpMem != pMem3) {
- goto __776
+ goto __802
}
(*Sqlite3_context)(unsafe.Pointer(pCtx1)).FpMem = pMem3
- i4 = (int32((*Sqlite3_context)(unsafe.Pointer(pCtx1)).Fargc) - 1)
-__777:
- if !(i4 >= 0) {
- goto __779
+ i5 = int32((*Sqlite3_context)(unsafe.Pointer(pCtx1)).Fargc) - 1
+__803:
+ if !(i5 >= 0) {
+ goto __805
}
- *(*uintptr)(unsafe.Pointer((pCtx1 + 28 /* &.argv */) + uintptr(i4)*4)) = (aMem + uintptr(((*Op)(unsafe.Pointer(pOp)).Fp2+i4))*40)
- goto __778
-__778:
- i4--
- goto __777
- goto __779
-__779:
+ *(*uintptr)(unsafe.Pointer(pCtx1 + 28 + uintptr(i5)*4)) = aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp2+i5)*40
+ goto __804
+__804:
+ i5--
+ goto __803
+ goto __805
+__805:
;
-__776:
+__802:
;
(*Mem)(unsafe.Pointer(pMem3)).Fn++
if !((*Op)(unsafe.Pointer(pOp)).Fp1 != 0) {
- goto __780
+ goto __806
}
(*struct {
f func(*libc.TLS, uintptr, int32, uintptr)
})(unsafe.Pointer(&struct{ uintptr }{(*FuncDef)(unsafe.Pointer((*Sqlite3_context)(unsafe.Pointer(pCtx1)).FpFunc)).FxInverse})).f(tls, pCtx1, int32((*Sqlite3_context)(unsafe.Pointer(pCtx1)).Fargc), pCtx1+28 /* &.argv */)
- goto __781
-__780:
+ goto __807
+__806:
(*struct {
f func(*libc.TLS, uintptr, int32, uintptr)
})(unsafe.Pointer(&struct{ uintptr }{(*FuncDef)(unsafe.Pointer((*Sqlite3_context)(unsafe.Pointer(pCtx1)).FpFunc)).FxSFunc})).f(tls, pCtx1, int32((*Sqlite3_context)(unsafe.Pointer(pCtx1)).Fargc), pCtx1+28 /* &.argv */)
-__781:
+__807:
; // IMP: R-24505-23230
if !((*Sqlite3_context)(unsafe.Pointer(pCtx1)).FisError != 0) {
- goto __782
+ goto __808
}
if !((*Sqlite3_context)(unsafe.Pointer(pCtx1)).FisError > 0) {
- goto __783
+ goto __809
}
- Xsqlite3VdbeError(tls, p, ts+2790 /* "%s" */, libc.VaList(bp+88, Xsqlite3_value_text(tls, (*Sqlite3_context)(unsafe.Pointer(pCtx1)).FpOut)))
+ Xsqlite3VdbeError(tls, p, ts+3601 /* "%s" */, libc.VaList(bp+120, Xsqlite3_value_text(tls, (*Sqlite3_context)(unsafe.Pointer(pCtx1)).FpOut)))
rc = (*Sqlite3_context)(unsafe.Pointer(pCtx1)).FisError
-__783:
+__809:
;
if !((*Sqlite3_context)(unsafe.Pointer(pCtx1)).FskipFlag != 0) {
- goto __784
+ goto __810
}
- i4 = (*Op)(unsafe.Pointer(pOp + libc.UintptrFromInt32(-1)*20)).Fp1
- if !(i4 != 0) {
- goto __785
+ i5 = (*Op)(unsafe.Pointer(pOp + libc.UintptrFromInt32(-1)*20)).Fp1
+ if !(i5 != 0) {
+ goto __811
}
- Xsqlite3VdbeMemSetInt64(tls, (aMem + uintptr(i4)*40), int64(1))
-__785:
+ Xsqlite3VdbeMemSetInt64(tls, aMem+uintptr(i5)*40, int64(1))
+__811:
;
(*Sqlite3_context)(unsafe.Pointer(pCtx1)).FskipFlag = U8(0)
-__784:
+__810:
;
Xsqlite3VdbeMemRelease(tls, (*Sqlite3_context)(unsafe.Pointer(pCtx1)).FpOut)
(*Mem)(unsafe.Pointer((*Sqlite3_context)(unsafe.Pointer(pCtx1)).FpOut)).Fflags = U16(MEM_Null)
(*Sqlite3_context)(unsafe.Pointer(pCtx1)).FisError = 0
if !(rc != 0) {
- goto __786
+ goto __812
}
goto abort_due_to_error
-__786:
+__812:
;
-__782:
+__808:
;
goto __8
@@ -73272,39 +74245,39 @@ __782:
// functions that can take varying numbers of arguments. The
// P4 argument is only needed for the case where
// the step function was not previously called.
-__158:
-__159:
+__160:
+__161:
;
- pMem4 = (aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*40)
+ pMem4 = aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*40
if !((*Op)(unsafe.Pointer(pOp)).Fp3 != 0) {
- goto __787
+ goto __813
}
- rc = Xsqlite3VdbeMemAggValue(tls, pMem4, (aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp3)*40), *(*uintptr)(unsafe.Pointer(pOp + 16 /* &.p4 */)))
- pMem4 = (aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp3)*40)
- goto __788
-__787:
+ rc = Xsqlite3VdbeMemAggValue(tls, pMem4, aMem+uintptr((*Op)(unsafe.Pointer(pOp)).Fp3)*40, *(*uintptr)(unsafe.Pointer(pOp + 16)))
+ pMem4 = aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp3)*40
+ goto __814
+__813:
- rc = Xsqlite3VdbeMemFinalize(tls, pMem4, *(*uintptr)(unsafe.Pointer(pOp + 16 /* &.p4 */)))
-__788:
+ rc = Xsqlite3VdbeMemFinalize(tls, pMem4, *(*uintptr)(unsafe.Pointer(pOp + 16)))
+__814:
;
if !(rc != 0) {
- goto __789
+ goto __815
}
- Xsqlite3VdbeError(tls, p, ts+2790 /* "%s" */, libc.VaList(bp+96, Xsqlite3_value_text(tls, pMem4)))
+ Xsqlite3VdbeError(tls, p, ts+3601 /* "%s" */, libc.VaList(bp+128, Xsqlite3_value_text(tls, pMem4)))
goto abort_due_to_error
-__789:
+__815:
;
Xsqlite3VdbeChangeEncoding(tls, pMem4, int32(encoding))
if !(Xsqlite3VdbeMemTooBig(tls, pMem4) != 0) {
- goto __790
+ goto __816
}
goto too_big
-__790:
+__816:
;
goto __8
@@ -73318,40 +74291,40 @@ __790:
// in the WAL that have been checkpointed after the checkpoint
// completes into mem[P3+2]. However on an error, mem[P3+1] and
// mem[P3+2] are initialized to -1.
-__160: // Write results here
+__162: // Write results here
;
- *(*int32)(unsafe.Pointer(bp + 656 /* &aRes[0] */)) = 0
- *(*int32)(unsafe.Pointer(bp + 656 /* &aRes[0] */ + 1*4)) = libc.AssignPtrInt32(bp+656 /* &aRes */ +2*4, -1)
+ *(*int32)(unsafe.Pointer(bp + 696 /* &aRes[0] */)) = 0
+ *(*int32)(unsafe.Pointer(bp + 696 /* &aRes[0] */ + 1*4)) = libc.AssignPtrInt32(bp+696+2*4, -1)
- rc = Xsqlite3Checkpoint(tls, db, (*Op)(unsafe.Pointer(pOp)).Fp1, (*Op)(unsafe.Pointer(pOp)).Fp2, (bp + 656 /* &aRes */ + 1*4), (bp + 656 /* &aRes */ + 2*4))
+ rc = Xsqlite3Checkpoint(tls, db, (*Op)(unsafe.Pointer(pOp)).Fp1, (*Op)(unsafe.Pointer(pOp)).Fp2, bp+696+1*4, bp+696+2*4)
if !(rc != 0) {
- goto __791
+ goto __817
}
if !(rc != SQLITE_BUSY) {
- goto __792
+ goto __818
}
goto abort_due_to_error
-__792:
+__818:
;
rc = SQLITE_OK
- *(*int32)(unsafe.Pointer(bp + 656 /* &aRes[0] */)) = 1
-__791:
+ *(*int32)(unsafe.Pointer(bp + 696 /* &aRes[0] */)) = 1
+__817:
;
- i5 = 0
- pMem5 = (aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp3)*40)
-__793:
- if !(i5 < 3) {
- goto __795
+ i6 = 0
+ pMem5 = aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp3)*40
+__819:
+ if !(i6 < 3) {
+ goto __821
}
- Xsqlite3VdbeMemSetInt64(tls, pMem5, I64(*(*int32)(unsafe.Pointer(bp + 656 /* &aRes[0] */ + uintptr(i5)*4))))
- goto __794
-__794:
- i5++
+ Xsqlite3VdbeMemSetInt64(tls, pMem5, I64(*(*int32)(unsafe.Pointer(bp + 696 /* &aRes[0] */ + uintptr(i6)*4))))
+ goto __820
+__820:
+ i6++
pMem5 += 40
- goto __793
- goto __795
-__795:
+ goto __819
+ goto __821
+__821:
;
goto __8
@@ -73365,7 +74338,7 @@ __795:
// If changing into or out of WAL mode the procedure is more complicated.
//
// Write a string containing the final journal-mode to register P2.
-__161: // Name of database file for pPager
+__163: // Name of database file for pPager
pOut = out2Prerelease(tls, p, pOp)
eNew = (*Op)(unsafe.Pointer(pOp)).Fp3
@@ -73373,55 +74346,55 @@ __161: // Name of database file for pPager
pBt1 = (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*16)).FpBt
pPager = Xsqlite3BtreePager(tls, pBt1)
eOld = Xsqlite3PagerGetJournalMode(tls, pPager)
- if !(eNew == (-1)) {
- goto __796
+ if !(eNew == -1) {
+ goto __822
}
eNew = eOld
-__796:
+__822:
;
- if !(!(Xsqlite3PagerOkToChangeJournalMode(tls, pPager) != 0)) {
- goto __797
+ if !!(Xsqlite3PagerOkToChangeJournalMode(tls, pPager) != 0) {
+ goto __823
}
eNew = eOld
-__797:
+__823:
;
zFilename = Xsqlite3PagerFilename(tls, pPager, 1)
// Do not allow a transition to journal_mode=WAL for a database
// in temporary storage or if the VFS does not support shared memory
- if !((eNew == PAGER_JOURNALMODE_WAL) &&
- ((Xsqlite3Strlen30(tls, zFilename) == 0) || // Temp file
+ if !(eNew == PAGER_JOURNALMODE_WAL &&
+ (Xsqlite3Strlen30(tls, zFilename) == 0 ||
!(Xsqlite3PagerWalSupported(tls, pPager) != 0))) {
- goto __798
+ goto __824
}
eNew = eOld
-__798:
+__824:
;
- if !((eNew != eOld) &&
- ((eOld == PAGER_JOURNALMODE_WAL) || (eNew == PAGER_JOURNALMODE_WAL))) {
- goto __799
+ if !(eNew != eOld &&
+ (eOld == PAGER_JOURNALMODE_WAL || eNew == PAGER_JOURNALMODE_WAL)) {
+ goto __825
}
- if !(!(int32((*Sqlite3)(unsafe.Pointer(db)).FautoCommit) != 0) || ((*Sqlite3)(unsafe.Pointer(db)).FnVdbeRead > 1)) {
- goto __800
+ if !(!(int32((*Sqlite3)(unsafe.Pointer(db)).FautoCommit) != 0) || (*Sqlite3)(unsafe.Pointer(db)).FnVdbeRead > 1) {
+ goto __826
}
rc = SQLITE_ERROR
Xsqlite3VdbeError(tls, p,
- ts+5050, /* "cannot change %s..." */
- libc.VaList(bp+104, func() uintptr {
+ ts+5897, /* "cannot change %s..." */
+ libc.VaList(bp+136, func() uintptr {
if eNew == PAGER_JOURNALMODE_WAL {
- return ts + 5102 /* "into" */
+ return ts + 5949 /* "into" */
}
- return ts + 5107 /* "out of" */
+ return ts + 5954 /* "out of" */
}()))
goto abort_due_to_error
- goto __801
-__800:
+ goto __827
+__826:
if !(eOld == PAGER_JOURNALMODE_WAL) {
- goto __802
+ goto __828
}
// If leaving WAL mode, close the log file. If successful, the call
// to PagerCloseWal() checkpoints and deletes the write-ahead-log
@@ -73429,29 +74402,29 @@ __800:
// after a successful return.
rc = Xsqlite3PagerCloseWal(tls, pPager, db)
if !(rc == SQLITE_OK) {
- goto __804
+ goto __830
}
Xsqlite3PagerSetJournalMode(tls, pPager, eNew)
-__804:
+__830:
;
- goto __803
-__802:
+ goto __829
+__828:
if !(eOld == PAGER_JOURNALMODE_MEMORY) {
- goto __805
+ goto __831
}
// Cannot transition directly from MEMORY to WAL. Use mode OFF
// as an intermediate
Xsqlite3PagerSetJournalMode(tls, pPager, PAGER_JOURNALMODE_OFF)
-__805:
+__831:
;
-__803:
+__829:
;
// Open a transaction on the database file. Regardless of the journal
// mode, this transaction always uses a rollback journal.
if !(rc == SQLITE_OK) {
- goto __806
+ goto __832
}
rc = Xsqlite3BtreeSetVersion(tls, pBt1, func() int32 {
if eNew == PAGER_JOURNALMODE_WAL {
@@ -73459,31 +74432,31 @@ __803:
}
return 1
}())
-__806:
+__832:
;
-__801:
+__827:
;
-__799:
+__825:
;
if !(rc != 0) {
- goto __807
+ goto __833
}
eNew = eOld
-__807:
+__833:
;
eNew = Xsqlite3PagerSetJournalMode(tls, pPager, eNew)
- (*Mem)(unsafe.Pointer(pOut)).Fflags = (U16((MEM_Str | MEM_Static) | MEM_Term))
+ (*Mem)(unsafe.Pointer(pOut)).Fflags = U16(MEM_Str | MEM_Static | MEM_Term)
(*Mem)(unsafe.Pointer(pOut)).Fz = Xsqlite3JournalModename(tls, eNew)
(*Mem)(unsafe.Pointer(pOut)).Fn = Xsqlite3Strlen30(tls, (*Mem)(unsafe.Pointer(pOut)).Fz)
(*Mem)(unsafe.Pointer(pOut)).Fenc = U8(SQLITE_UTF8)
Xsqlite3VdbeChangeEncoding(tls, pOut, int32(encoding))
if !(rc != 0) {
- goto __808
+ goto __834
}
goto abort_due_to_error
-__808:
+__834:
;
goto __8
@@ -73495,20 +74468,20 @@ __808:
// If P2 is not zero, then it is a register holding a string which is
// the file into which the result of vacuum should be written. When
// P2 is zero, the vacuum overwrites the original database.
-__162:
+__164:
;
- rc = Xsqlite3RunVacuum(tls, (p + 124 /* &.zErrMsg */), db, (*Op)(unsafe.Pointer(pOp)).Fp1,
+ rc = Xsqlite3RunVacuum(tls, p+132, db, (*Op)(unsafe.Pointer(pOp)).Fp1,
func() uintptr {
if (*Op)(unsafe.Pointer(pOp)).Fp2 != 0 {
- return (aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp2)*40)
+ return aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp2)*40
}
return uintptr(0)
}())
if !(rc != 0) {
- goto __809
+ goto __835
}
goto abort_due_to_error
-__809:
+__835:
;
goto __8
@@ -73517,24 +74490,24 @@ __809:
// Perform a single step of the incremental vacuum procedure on
// the P1 database. If the vacuum has finished, jump to instruction
// P2. Otherwise, fall through to the next instruction.
-__163:
+__165:
;
pBt2 = (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*16)).FpBt
rc = Xsqlite3BtreeIncrVacuum(tls, pBt2)
if !(rc != 0) {
- goto __810
+ goto __836
}
if !(rc != SQLITE_DONE) {
- goto __811
+ goto __837
}
goto abort_due_to_error
-__811:
+__837:
;
rc = SQLITE_OK
goto jump_to_p2
-__810:
+__836:
;
goto __8
@@ -73553,16 +74526,16 @@ __810:
// The P2==1 case occurs when a CREATE INDEX or similar schema change happens
// that might help the statement run faster but which does not affect the
// correctness of operation.
-__164:
+__166:
;
- if !(!((*Op)(unsafe.Pointer(pOp)).Fp1 != 0)) {
- goto __812
+ if !!((*Op)(unsafe.Pointer(pOp)).Fp1 != 0) {
+ goto __838
}
Xsqlite3ExpirePreparedStatements(tls, db, (*Op)(unsafe.Pointer(pOp)).Fp2)
- goto __813
-__812:
- libc.SetBitFieldPtr16Uint32(p+152 /* &.expired */, (Bft((*Op)(unsafe.Pointer(pOp)).Fp2 + 1)), 0, 0x3)
-__813:
+ goto __839
+__838:
+ libc.SetBitFieldPtr16Uint32(p+160, Bft((*Op)(unsafe.Pointer(pOp)).Fp2+1), 0, 0x3)
+__839:
;
goto __8
@@ -73570,22 +74543,22 @@ __813:
//
// Lock the btree to which cursor P1 is pointing so that the btree cannot be
// written by an other cursor.
-__165:
+__167:
;
pC28 = *(*uintptr)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*4))
- Xsqlite3BtreeCursorPin(tls, *(*uintptr)(unsafe.Pointer(pC28 + 40 /* &.uc */)))
+ Xsqlite3BtreeCursorPin(tls, *(*uintptr)(unsafe.Pointer(pC28 + 40)))
goto __8
// Opcode: CursorUnlock P1 * * * *
//
// Unlock the btree to which cursor P1 is pointing so that it can be
// written by other cursors.
-__166:
+__168:
;
pC29 = *(*uintptr)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*4))
- Xsqlite3BtreeCursorUnpin(tls, *(*uintptr)(unsafe.Pointer(pC29 + 40 /* &.uc */)))
+ Xsqlite3BtreeCursorUnpin(tls, *(*uintptr)(unsafe.Pointer(pC29 + 40)))
goto __8
// Opcode: TableLock P1 P2 P3 P4 *
@@ -73602,28 +74575,28 @@ __166:
//
// P4 contains a pointer to the name of the table being locked. This is only
// used to generate an error message if the lock cannot be obtained.
-__167:
+__169:
isWriteLock = U8((*Op)(unsafe.Pointer(pOp)).Fp3)
- if !((isWriteLock != 0) || (uint64(0) == ((*Sqlite3)(unsafe.Pointer(db)).Fflags & uint64(SQLITE_ReadUncommit)))) {
- goto __814
+ if !(isWriteLock != 0 || uint64(0) == (*Sqlite3)(unsafe.Pointer(db)).Fflags&uint64(SQLITE_ReadUncommit)) {
+ goto __840
}
p13 = (*Op)(unsafe.Pointer(pOp)).Fp1
rc = Xsqlite3BtreeLockTable(tls, (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+uintptr(p13)*16)).FpBt, (*Op)(unsafe.Pointer(pOp)).Fp2, isWriteLock)
if !(rc != 0) {
- goto __815
+ goto __841
}
- if !((rc & 0xFF) == SQLITE_LOCKED) {
- goto __816
+ if !(rc&0xFF == SQLITE_LOCKED) {
+ goto __842
}
- z1 = *(*uintptr)(unsafe.Pointer(pOp + 16 /* &.p4 */))
- Xsqlite3VdbeError(tls, p, ts+5114 /* "database table i..." */, libc.VaList(bp+112, z1))
-__816:
+ z1 = *(*uintptr)(unsafe.Pointer(pOp + 16))
+ Xsqlite3VdbeError(tls, p, ts+5961 /* "database table i..." */, libc.VaList(bp+144, z1))
+__842:
;
goto abort_due_to_error
-__815:
+__841:
;
-__814:
+__840:
;
goto __8
@@ -73635,20 +74608,20 @@ __814:
// Also, whether or not P4 is set, check that this is not being called from
// within a callback to a virtual table xSync() method. If it is, the error
// code will be set to SQLITE_LOCKED.
-__168:
- pVTab = *(*uintptr)(unsafe.Pointer(pOp + 16 /* &.p4 */))
+__170:
+ pVTab = *(*uintptr)(unsafe.Pointer(pOp + 16))
rc = Xsqlite3VtabBegin(tls, db, pVTab)
if !(pVTab != 0) {
- goto __817
+ goto __843
}
Xsqlite3VtabImportErrmsg(tls, p, (*VTable)(unsafe.Pointer(pVTab)).FpVtab)
-__817:
+__843:
;
if !(rc != 0) {
- goto __818
+ goto __844
}
goto abort_due_to_error
-__818:
+__844:
;
goto __8
@@ -73656,29 +74629,29 @@ __818:
//
// P2 is a register that holds the name of a virtual table in database
// P1. Call the xCreate method for that table.
-__169: // Name of the virtual table
+__171: // Name of the virtual table
- libc.Xmemset(tls, bp+672 /* &sMem1 */, 0, uint32(unsafe.Sizeof(Mem{})))
- (*Mem)(unsafe.Pointer(bp + 672 /* &sMem1 */)).Fdb = db
+ libc.Xmemset(tls, bp+712 /* &sMem1 */, 0, uint32(unsafe.Sizeof(Mem{})))
+ (*Mem)(unsafe.Pointer(bp + 712 /* &sMem1 */)).Fdb = db
// Because P2 is always a static string, it is impossible for the
// sqlite3VdbeMemCopy() to fail
- rc = Xsqlite3VdbeMemCopy(tls, bp+672 /* &sMem1 */, (aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp2)*40))
+ rc = Xsqlite3VdbeMemCopy(tls, bp+712 /* &sMem1 */, aMem+uintptr((*Op)(unsafe.Pointer(pOp)).Fp2)*40)
- zTab = Xsqlite3_value_text(tls, bp+672 /* &sMem1 */)
+ zTab = Xsqlite3_value_text(tls, bp+712 /* &sMem1 */)
if !(zTab != 0) {
- goto __819
+ goto __845
}
- rc = Xsqlite3VtabCallCreate(tls, db, (*Op)(unsafe.Pointer(pOp)).Fp1, zTab, (p + 124 /* &.zErrMsg */))
-__819:
+ rc = Xsqlite3VtabCallCreate(tls, db, (*Op)(unsafe.Pointer(pOp)).Fp1, zTab, p+132)
+__845:
;
- Xsqlite3VdbeMemRelease(tls, bp+672 /* &sMem1 */)
+ Xsqlite3VdbeMemRelease(tls, bp+712 /* &sMem1 */)
if !(rc != 0) {
- goto __820
+ goto __846
}
goto abort_due_to_error
-__820:
+__846:
;
goto __8
@@ -73686,16 +74659,16 @@ __820:
//
// P4 is the name of a virtual table in database P1. Call the xDestroy method
// of that table.
-__170:
+__172:
(*Sqlite3)(unsafe.Pointer(db)).FnVDestroy++
- rc = Xsqlite3VtabCallDestroy(tls, db, (*Op)(unsafe.Pointer(pOp)).Fp1, *(*uintptr)(unsafe.Pointer(pOp + 16 /* &.p4 */)))
+ rc = Xsqlite3VtabCallDestroy(tls, db, (*Op)(unsafe.Pointer(pOp)).Fp1, *(*uintptr)(unsafe.Pointer(pOp + 16)))
(*Sqlite3)(unsafe.Pointer(db)).FnVDestroy--
if !(rc != 0) {
- goto __821
+ goto __847
}
goto abort_due_to_error
-__821:
+__847:
;
goto __8
@@ -73704,48 +74677,48 @@ __821:
// P4 is a pointer to a virtual table object, an sqlite3_vtab structure.
// P1 is a cursor number. This opcode opens a cursor to the virtual
// table and stores that cursor in P1.
-__171:
+__173:
;
pCur2 = uintptr(0)
- *(*uintptr)(unsafe.Pointer(bp + 712 /* pVCur */)) = uintptr(0)
- pVtab1 = (*VTable)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pOp + 16 /* &.p4 */)))).FpVtab
- if !((pVtab1 == uintptr(0)) || ((*Sqlite3_vtab)(unsafe.Pointer(pVtab1)).FpModule == uintptr(0))) {
- goto __822
+ *(*uintptr)(unsafe.Pointer(bp + 752 /* pVCur */)) = uintptr(0)
+ pVtab1 = (*VTable)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pOp + 16)))).FpVtab
+ if !(pVtab1 == uintptr(0) || (*Sqlite3_vtab)(unsafe.Pointer(pVtab1)).FpModule == uintptr(0)) {
+ goto __848
}
rc = SQLITE_LOCKED
goto abort_due_to_error
-__822:
+__848:
;
pModule1 = (*Sqlite3_vtab)(unsafe.Pointer(pVtab1)).FpModule
rc = (*struct {
f func(*libc.TLS, uintptr, uintptr) int32
- })(unsafe.Pointer(&struct{ uintptr }{(*Sqlite3_module)(unsafe.Pointer(pModule1)).FxOpen})).f(tls, pVtab1, bp+712 /* &pVCur */)
+ })(unsafe.Pointer(&struct{ uintptr }{(*Sqlite3_module)(unsafe.Pointer(pModule1)).FxOpen})).f(tls, pVtab1, bp+752 /* &pVCur */)
Xsqlite3VtabImportErrmsg(tls, p, pVtab1)
if !(rc != 0) {
- goto __823
+ goto __849
}
goto abort_due_to_error
-__823:
+__849:
;
// Initialize sqlite3_vtab_cursor base class
- (*Sqlite3_vtab_cursor)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 712 /* pVCur */)))).FpVtab = pVtab1
+ (*Sqlite3_vtab_cursor)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 752 /* pVCur */)))).FpVtab = pVtab1
// Initialize vdbe cursor object
pCur2 = allocateCursor(tls, p, (*Op)(unsafe.Pointer(pOp)).Fp1, 0, -1, uint8(CURTYPE_VTAB))
if !(pCur2 != 0) {
- goto __824
+ goto __850
}
- *(*uintptr)(unsafe.Pointer(pCur2 + 40 /* &.uc */)) = *(*uintptr)(unsafe.Pointer(bp + 712 /* pVCur */))
+ *(*uintptr)(unsafe.Pointer(pCur2 + 40)) = *(*uintptr)(unsafe.Pointer(bp + 752 /* pVCur */))
(*Sqlite3_vtab)(unsafe.Pointer(pVtab1)).FnRef++
- goto __825
-__824:
+ goto __851
+__850:
;
(*struct {
f func(*libc.TLS, uintptr) int32
- })(unsafe.Pointer(&struct{ uintptr }{(*Sqlite3_module)(unsafe.Pointer(pModule1)).FxClose})).f(tls, *(*uintptr)(unsafe.Pointer(bp + 712 /* pVCur */)))
+ })(unsafe.Pointer(&struct{ uintptr }{(*Sqlite3_module)(unsafe.Pointer(pModule1)).FxClose})).f(tls, *(*uintptr)(unsafe.Pointer(bp + 752 /* pVCur */)))
goto no_mem
-__825:
+__851:
;
goto __8
@@ -73767,46 +74740,45 @@ __825:
// xFilter as argv. Register P3+2 becomes argv[0] when passed to xFilter.
//
// A jump is made to P2 if the result set after filtering would be empty.
-__172:
+__174:
- pQuery = (aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp3)*40)
- pArgc = (pQuery + 1*40)
+ pQuery = aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp3)*40
+ pArgc = pQuery + 1*40
pCur3 = *(*uintptr)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*4))
- pVCur1 = *(*uintptr)(unsafe.Pointer(pCur3 + 40 /* &.uc */))
+ pVCur1 = *(*uintptr)(unsafe.Pointer(pCur3 + 40))
pVtab2 = (*Sqlite3_vtab_cursor)(unsafe.Pointer(pVCur1)).FpVtab
pModule2 = (*Sqlite3_vtab)(unsafe.Pointer(pVtab2)).FpModule
// Grab the index number and argc parameters
- nArg = int32(*(*I64)(unsafe.Pointer(pArgc /* &.u */)))
- iQuery = int32(*(*I64)(unsafe.Pointer(pQuery /* &.u */)))
+ nArg = int32(*(*I64)(unsafe.Pointer(pArgc)))
+ iQuery = int32(*(*I64)(unsafe.Pointer(pQuery)))
// Invoke the xFilter method
- res13 = 0
apArg = (*Vdbe)(unsafe.Pointer(p)).FapArg
- i6 = 0
-__826:
- if !(i6 < nArg) {
- goto __828
+ i7 = 0
+__852:
+ if !(i7 < nArg) {
+ goto __854
}
- *(*uintptr)(unsafe.Pointer(apArg + uintptr(i6)*4)) = (pArgc + uintptr((i6+1))*40)
- goto __827
-__827:
- i6++
- goto __826
- goto __828
-__828:
+ *(*uintptr)(unsafe.Pointer(apArg + uintptr(i7)*4)) = pArgc + uintptr(i7+1)*40
+ goto __853
+__853:
+ i7++
+ goto __852
+ goto __854
+__854:
;
rc = (*struct {
f func(*libc.TLS, uintptr, int32, uintptr, int32, uintptr) int32
})(unsafe.Pointer(&struct{ uintptr }{(*Sqlite3_module)(unsafe.Pointer(pModule2)).FxFilter})).f(tls, pVCur1, iQuery, *(*uintptr)(unsafe.Pointer(pOp + 16 /* &.p4 */)), nArg, apArg)
Xsqlite3VtabImportErrmsg(tls, p, pVtab2)
if !(rc != 0) {
- goto __829
+ goto __855
}
goto abort_due_to_error
-__829:
+__855:
;
res13 = (*struct {
f func(*libc.TLS, uintptr) int32
@@ -73814,10 +74786,10 @@ __829:
(*VdbeCursor)(unsafe.Pointer(pCur3)).FnullRow = U8(0)
if !(res13 != 0) {
- goto __830
+ goto __856
}
goto jump_to_p2
-__830:
+__856:
;
goto __8
@@ -73834,60 +74806,60 @@ __830:
// table implementation. The P5 column might also contain other
// bits (OPFLAG_LENGTHARG or OPFLAG_TYPEOFARG) but those bits are
// unused by OP_VColumn.
-__173:
+__175:
pCur4 = *(*uintptr)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*4))
- pDest2 = (aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp3)*40)
+ pDest2 = aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp3)*40
if !((*VdbeCursor)(unsafe.Pointer(pCur4)).FnullRow != 0) {
- goto __831
+ goto __857
}
Xsqlite3VdbeMemSetNull(tls, pDest2)
goto __8
-__831:
+__857:
;
- pVtab3 = (*Sqlite3_vtab_cursor)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pCur4 + 40 /* &.uc */)))).FpVtab
+ pVtab3 = (*Sqlite3_vtab_cursor)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pCur4 + 40)))).FpVtab
pModule3 = (*Sqlite3_vtab)(unsafe.Pointer(pVtab3)).FpModule
- libc.Xmemset(tls, bp+716 /* &sContext */, 0, uint32(unsafe.Sizeof(Sqlite3_context{})))
- (*Sqlite3_context)(unsafe.Pointer(bp + 716 /* &sContext */)).FpOut = pDest2
+ libc.Xmemset(tls, bp+756 /* &sContext */, 0, uint32(unsafe.Sizeof(Sqlite3_context{})))
+ (*Sqlite3_context)(unsafe.Pointer(bp + 756 /* &sContext */)).FpOut = pDest2
- if !((int32((*Op)(unsafe.Pointer(pOp)).Fp5) & OPFLAG_NOCHNG) != 0) {
- goto __832
+ if !(int32((*Op)(unsafe.Pointer(pOp)).Fp5)&OPFLAG_NOCHNG != 0) {
+ goto __858
}
Xsqlite3VdbeMemSetNull(tls, pDest2)
- (*Mem)(unsafe.Pointer(pDest2)).Fflags = (U16(MEM_Null | MEM_Zero))
- *(*int32)(unsafe.Pointer(pDest2 /* &.u */)) = 0
- goto __833
-__832:
- (*Mem)(unsafe.Pointer(pDest2)).Fflags = (U16((int32((*Mem)(unsafe.Pointer((pDest2))).Fflags) & libc.CplInt32((MEM_TypeMask | MEM_Zero))) | MEM_Null))
-__833:
+ (*Mem)(unsafe.Pointer(pDest2)).Fflags = U16(MEM_Null | MEM_Zero)
+ *(*int32)(unsafe.Pointer(pDest2)) = 0
+ goto __859
+__858:
+ (*Mem)(unsafe.Pointer(pDest2)).Fflags = U16(int32((*Mem)(unsafe.Pointer(pDest2)).Fflags)&libc.CplInt32(MEM_TypeMask|MEM_Zero) | MEM_Null)
+__859:
;
rc = (*struct {
f func(*libc.TLS, uintptr, uintptr, int32) int32
- })(unsafe.Pointer(&struct{ uintptr }{(*Sqlite3_module)(unsafe.Pointer(pModule3)).FxColumn})).f(tls, *(*uintptr)(unsafe.Pointer(pCur4 + 40 /* &.uc */)), bp+716 /* &sContext */, (*Op)(unsafe.Pointer(pOp)).Fp2)
+ })(unsafe.Pointer(&struct{ uintptr }{(*Sqlite3_module)(unsafe.Pointer(pModule3)).FxColumn})).f(tls, *(*uintptr)(unsafe.Pointer(pCur4 + 40 /* &.uc */)), bp+756 /* &sContext */, (*Op)(unsafe.Pointer(pOp)).Fp2)
Xsqlite3VtabImportErrmsg(tls, p, pVtab3)
- if !((*Sqlite3_context)(unsafe.Pointer(bp+716 /* &sContext */)).FisError > 0) {
- goto __834
+ if !((*Sqlite3_context)(unsafe.Pointer(bp+756)).FisError > 0) {
+ goto __860
}
- Xsqlite3VdbeError(tls, p, ts+2790 /* "%s" */, libc.VaList(bp+120, Xsqlite3_value_text(tls, pDest2)))
- rc = (*Sqlite3_context)(unsafe.Pointer(bp + 716 /* &sContext */)).FisError
-__834:
+ Xsqlite3VdbeError(tls, p, ts+3601 /* "%s" */, libc.VaList(bp+152, Xsqlite3_value_text(tls, pDest2)))
+ rc = (*Sqlite3_context)(unsafe.Pointer(bp + 756 /* &sContext */)).FisError
+__860:
;
Xsqlite3VdbeChangeEncoding(tls, pDest2, int32(encoding))
if !(Xsqlite3VdbeMemTooBig(tls, pDest2) != 0) {
- goto __835
+ goto __861
}
goto too_big
-__835:
+__861:
;
if !(rc != 0) {
- goto __836
+ goto __862
}
goto abort_due_to_error
-__836:
+__862:
;
goto __8
@@ -73896,18 +74868,17 @@ __836:
// Advance virtual table P1 to the next row in its result set and
// jump to instruction P2. Or, if the virtual table has reached
// the end of its result set, then fall through to the next instruction.
-__174:
+__176:
- res14 = 0
pCur5 = *(*uintptr)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*4))
if !((*VdbeCursor)(unsafe.Pointer(pCur5)).FnullRow != 0) {
- goto __837
+ goto __863
}
goto __8
-__837:
+__863:
;
- pVtab4 = (*Sqlite3_vtab_cursor)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pCur5 + 40 /* &.uc */)))).FpVtab
+ pVtab4 = (*Sqlite3_vtab_cursor)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pCur5 + 40)))).FpVtab
pModule4 = (*Sqlite3_vtab)(unsafe.Pointer(pVtab4)).FpModule
// Invoke the xNext() method of the module. There is no way for the
@@ -73920,21 +74891,21 @@ __837:
})(unsafe.Pointer(&struct{ uintptr }{(*Sqlite3_module)(unsafe.Pointer(pModule4)).FxNext})).f(tls, *(*uintptr)(unsafe.Pointer(pCur5 + 40 /* &.uc */)))
Xsqlite3VtabImportErrmsg(tls, p, pVtab4)
if !(rc != 0) {
- goto __838
+ goto __864
}
goto abort_due_to_error
-__838:
+__864:
;
res14 = (*struct {
f func(*libc.TLS, uintptr) int32
})(unsafe.Pointer(&struct{ uintptr }{(*Sqlite3_module)(unsafe.Pointer(pModule4)).FxEof})).f(tls, *(*uintptr)(unsafe.Pointer(pCur5 + 40 /* &.uc */)))
- if !(!(res14 != 0)) {
- goto __839
+ if !!(res14 != 0) {
+ goto __865
}
// If there is data, jump to P2
goto jump_to_p2_and_check_for_interrupt
-__839:
+__865:
;
goto check_for_interrupt
@@ -73943,36 +74914,36 @@ __839:
// P4 is a pointer to a virtual table object, an sqlite3_vtab structure.
// This opcode invokes the corresponding xRename method. The value
// in register P1 is passed as the zName argument to the xRename method.
-__175:
+__177:
- isLegacy = (int32((*Sqlite3)(unsafe.Pointer(db)).Fflags & uint64(SQLITE_LegacyAlter)))
- *(*U64)(unsafe.Pointer(db + 32 /* &.flags */)) |= (uint64(SQLITE_LegacyAlter))
- pVtab5 = (*VTable)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pOp + 16 /* &.p4 */)))).FpVtab
- pName = (aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*40)
+ isLegacy = int32((*Sqlite3)(unsafe.Pointer(db)).Fflags & uint64(SQLITE_LegacyAlter))
+ *(*U64)(unsafe.Pointer(db + 32)) |= uint64(SQLITE_LegacyAlter)
+ pVtab5 = (*VTable)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pOp + 16)))).FpVtab
+ pName = aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*40
rc = Xsqlite3VdbeChangeEncoding(tls, pName, SQLITE_UTF8)
if !(rc != 0) {
- goto __840
+ goto __866
}
goto abort_due_to_error
-__840:
+__866:
;
rc = (*struct {
f func(*libc.TLS, uintptr, uintptr) int32
})(unsafe.Pointer(&struct{ uintptr }{(*Sqlite3_module)(unsafe.Pointer((*Sqlite3_vtab)(unsafe.Pointer(pVtab5)).FpModule)).FxRename})).f(tls, pVtab5, (*Mem)(unsafe.Pointer(pName)).Fz)
if !(isLegacy == 0) {
- goto __841
+ goto __867
}
- *(*U64)(unsafe.Pointer(db + 32 /* &.flags */)) &= (libc.CplUint64(uint64(SQLITE_LegacyAlter)))
-__841:
+ *(*U64)(unsafe.Pointer(db + 32)) &= libc.CplUint64(uint64(SQLITE_LegacyAlter))
+__867:
;
Xsqlite3VtabImportErrmsg(tls, p, pVtab5)
- libc.SetBitFieldPtr16Uint32(p+152 /* &.expired */, Bft(0), 0, 0x3)
+ libc.SetBitFieldPtr16Uint32(p+160, Bft(0), 0, 0x3)
if !(rc != 0) {
- goto __842
+ goto __868
}
goto abort_due_to_error
-__842:
+__868:
;
goto __8
@@ -74002,99 +74973,99 @@ __842:
//
// P5 is the error actions (OE_Replace, OE_Fail, OE_Ignore, etc) to
// apply in the case of a constraint failure on an insert or update.
-__176:
- ;
+__178:
+ *(*Sqlite_int64)(unsafe.Pointer(bp + 792 /* rowid1 */)) = int64(0)
if !((*Sqlite3)(unsafe.Pointer(db)).FmallocFailed != 0) {
- goto __843
+ goto __869
}
goto no_mem
-__843:
+__869:
;
- pVtab6 = (*VTable)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pOp + 16 /* &.p4 */)))).FpVtab
- if !((pVtab6 == uintptr(0)) || ((*Sqlite3_vtab)(unsafe.Pointer(pVtab6)).FpModule == uintptr(0))) {
- goto __844
+ pVtab6 = (*VTable)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pOp + 16)))).FpVtab
+ if !(pVtab6 == uintptr(0) || (*Sqlite3_vtab)(unsafe.Pointer(pVtab6)).FpModule == uintptr(0)) {
+ goto __870
}
rc = SQLITE_LOCKED
goto abort_due_to_error
-__844:
+__870:
;
pModule5 = (*Sqlite3_vtab)(unsafe.Pointer(pVtab6)).FpModule
nArg1 = (*Op)(unsafe.Pointer(pOp)).Fp2
if !((*Sqlite3_module)(unsafe.Pointer(pModule5)).FxUpdate != 0) {
- goto __845
+ goto __871
}
vtabOnConflict = (*Sqlite3)(unsafe.Pointer(db)).FvtabOnConflict
apArg1 = (*Vdbe)(unsafe.Pointer(p)).FapArg
- pX1 = (aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp3)*40)
- i7 = 0
-__846:
- if !(i7 < nArg1) {
- goto __848
+ pX1 = aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp3)*40
+ i8 = 0
+__872:
+ if !(i8 < nArg1) {
+ goto __874
}
- *(*uintptr)(unsafe.Pointer(apArg1 + uintptr(i7)*4)) = pX1
+ *(*uintptr)(unsafe.Pointer(apArg1 + uintptr(i8)*4)) = pX1
pX1 += 40
- goto __847
-__847:
- i7++
- goto __846
- goto __848
-__848:
+ goto __873
+__873:
+ i8++
+ goto __872
+ goto __874
+__874:
;
(*Sqlite3)(unsafe.Pointer(db)).FvtabOnConflict = U8((*Op)(unsafe.Pointer(pOp)).Fp5)
rc = (*struct {
f func(*libc.TLS, uintptr, int32, uintptr, uintptr) int32
- })(unsafe.Pointer(&struct{ uintptr }{(*Sqlite3_module)(unsafe.Pointer(pModule5)).FxUpdate})).f(tls, pVtab6, nArg1, apArg1, bp+752 /* &rowid1 */)
+ })(unsafe.Pointer(&struct{ uintptr }{(*Sqlite3_module)(unsafe.Pointer(pModule5)).FxUpdate})).f(tls, pVtab6, nArg1, apArg1, bp+792 /* &rowid1 */)
(*Sqlite3)(unsafe.Pointer(db)).FvtabOnConflict = vtabOnConflict
Xsqlite3VtabImportErrmsg(tls, p, pVtab6)
- if !((rc == SQLITE_OK) && ((*Op)(unsafe.Pointer(pOp)).Fp1 != 0)) {
- goto __849
+ if !(rc == SQLITE_OK && (*Op)(unsafe.Pointer(pOp)).Fp1 != 0) {
+ goto __875
}
- (*Sqlite3)(unsafe.Pointer(db)).FlastRowid = *(*Sqlite_int64)(unsafe.Pointer(bp + 752 /* rowid1 */))
-__849:
+ (*Sqlite3)(unsafe.Pointer(db)).FlastRowid = *(*Sqlite_int64)(unsafe.Pointer(bp + 792 /* rowid1 */))
+__875:
;
- if !(((rc & 0xff) == SQLITE_CONSTRAINT) && ((*VTable)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pOp + 16 /* &.p4 */)))).FbConstraint != 0)) {
- goto __850
+ if !(rc&0xff == SQLITE_CONSTRAINT && (*VTable)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pOp + 16)))).FbConstraint != 0) {
+ goto __876
}
if !(int32((*Op)(unsafe.Pointer(pOp)).Fp5) == OE_Ignore) {
- goto __852
+ goto __878
}
rc = SQLITE_OK
- goto __853
-__852:
+ goto __879
+__878:
(*Vdbe)(unsafe.Pointer(p)).FerrorAction = func() uint8 {
if int32((*Op)(unsafe.Pointer(pOp)).Fp5) == OE_Replace {
return uint8(OE_Abort)
}
return uint8((*Op)(unsafe.Pointer(pOp)).Fp5)
}()
-__853:
+__879:
;
- goto __851
-__850:
+ goto __877
+__876:
(*Vdbe)(unsafe.Pointer(p)).FnChange++
-__851:
+__877:
;
if !(rc != 0) {
- goto __854
+ goto __880
}
goto abort_due_to_error
-__854:
+__880:
;
-__845:
+__871:
;
goto __8
// Opcode: Pagecount P1 P2 * * *
//
// Write the current number of pages in database P1 to memory cell P2.
-__177: // out2
+__179: // out2
pOut = out2Prerelease(tls, p, pOp)
- *(*I64)(unsafe.Pointer(pOut /* &.u */)) = I64(Xsqlite3BtreeLastPage(tls, (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*16)).FpBt))
+ *(*I64)(unsafe.Pointer(pOut)) = I64(Xsqlite3BtreeLastPage(tls, (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*16)).FpBt))
goto __8
// Opcode: MaxPgcnt P1 P2 P3 * *
@@ -74104,24 +75075,24 @@ __177: // out2
// do not change the maximum page count value if P3==0.
//
// Store the maximum page count after the change in register P2.
-__178:
+__180:
pOut = out2Prerelease(tls, p, pOp)
pBt3 = (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*16)).FpBt
newMax = uint32(0)
if !((*Op)(unsafe.Pointer(pOp)).Fp3 != 0) {
- goto __855
+ goto __881
}
newMax = Xsqlite3BtreeLastPage(tls, pBt3)
if !(newMax < uint32((*Op)(unsafe.Pointer(pOp)).Fp3)) {
- goto __856
+ goto __882
}
newMax = uint32((*Op)(unsafe.Pointer(pOp)).Fp3)
-__856:
+__882:
;
-__855:
+__881:
;
- *(*I64)(unsafe.Pointer(pOut /* &.u */)) = I64(Xsqlite3BtreeMaxPageCount(tls, pBt3, newMax))
+ *(*I64)(unsafe.Pointer(pOut)) = I64(Xsqlite3BtreeMaxPageCount(tls, pBt3, newMax))
goto __8
// Opcode: Function P1 P2 P3 P4 *
@@ -74168,38 +75139,38 @@ __855:
// if they were, they throw an error.
//
// See also: AggStep, AggFinal, Function
-__179: // group
-__180:
+__181: // group
+__182:
;
- pCtx2 = *(*uintptr)(unsafe.Pointer(pOp + 16 /* &.p4 */))
+ pCtx2 = *(*uintptr)(unsafe.Pointer(pOp + 16))
// If this function is inside of a trigger, the register array in aMem[]
// might change from one evaluation to the next. The next block of code
// checks to see if the register array has changed, and if so it
// reinitializes the relavant parts of the sqlite3_context object
- pOut = (aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp3)*40)
+ pOut = aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp3)*40
if !((*Sqlite3_context)(unsafe.Pointer(pCtx2)).FpOut != pOut) {
- goto __857
+ goto __883
}
(*Sqlite3_context)(unsafe.Pointer(pCtx2)).FpVdbe = p
(*Sqlite3_context)(unsafe.Pointer(pCtx2)).FpOut = pOut
- i8 = (int32((*Sqlite3_context)(unsafe.Pointer(pCtx2)).Fargc) - 1)
-__858:
- if !(i8 >= 0) {
- goto __860
+ i9 = int32((*Sqlite3_context)(unsafe.Pointer(pCtx2)).Fargc) - 1
+__884:
+ if !(i9 >= 0) {
+ goto __886
}
- *(*uintptr)(unsafe.Pointer((pCtx2 + 28 /* &.argv */) + uintptr(i8)*4)) = (aMem + uintptr(((*Op)(unsafe.Pointer(pOp)).Fp2+i8))*40)
- goto __859
-__859:
- i8--
- goto __858
- goto __860
-__860:
+ *(*uintptr)(unsafe.Pointer(pCtx2 + 28 + uintptr(i9)*4)) = aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp2+i9)*40
+ goto __885
+__885:
+ i9--
+ goto __884
+ goto __886
+__886:
;
-__857:
+__883:
;
- (*Mem)(unsafe.Pointer(pOut)).Fflags = (U16((int32((*Mem)(unsafe.Pointer((pOut))).Fflags) & libc.CplInt32((MEM_TypeMask | MEM_Zero))) | MEM_Null))
+ (*Mem)(unsafe.Pointer(pOut)).Fflags = U16(int32((*Mem)(unsafe.Pointer(pOut)).Fflags)&libc.CplInt32(MEM_TypeMask|MEM_Zero) | MEM_Null)
(*struct {
f func(*libc.TLS, uintptr, int32, uintptr)
@@ -74207,38 +75178,38 @@ __857:
// If the function returned an error, throw an exception
if !((*Sqlite3_context)(unsafe.Pointer(pCtx2)).FisError != 0) {
- goto __861
+ goto __887
}
if !((*Sqlite3_context)(unsafe.Pointer(pCtx2)).FisError > 0) {
- goto __862
+ goto __888
}
- Xsqlite3VdbeError(tls, p, ts+2790 /* "%s" */, libc.VaList(bp+128, Xsqlite3_value_text(tls, pOut)))
+ Xsqlite3VdbeError(tls, p, ts+3601 /* "%s" */, libc.VaList(bp+160, Xsqlite3_value_text(tls, pOut)))
rc = (*Sqlite3_context)(unsafe.Pointer(pCtx2)).FisError
-__862:
+__888:
;
- Xsqlite3VdbeDeleteAuxData(tls, db, (p + 220 /* &.pAuxData */), (*Sqlite3_context)(unsafe.Pointer(pCtx2)).FiOp, (*Op)(unsafe.Pointer(pOp)).Fp1)
+ Xsqlite3VdbeDeleteAuxData(tls, db, p+228, (*Sqlite3_context)(unsafe.Pointer(pCtx2)).FiOp, (*Op)(unsafe.Pointer(pOp)).Fp1)
(*Sqlite3_context)(unsafe.Pointer(pCtx2)).FisError = 0
if !(rc != 0) {
- goto __863
+ goto __889
}
goto abort_due_to_error
-__863:
+__889:
;
-__861:
+__887:
;
// Copy the result of the function into register P3
- if !((int32((*Mem)(unsafe.Pointer(pOut)).Fflags) & (MEM_Str | MEM_Blob)) != 0) {
- goto __864
+ if !(int32((*Mem)(unsafe.Pointer(pOut)).Fflags)&(MEM_Str|MEM_Blob) != 0) {
+ goto __890
}
Xsqlite3VdbeChangeEncoding(tls, pOut, int32(encoding))
if !(Xsqlite3VdbeMemTooBig(tls, pOut) != 0) {
- goto __865
+ goto __891
}
goto too_big
-__865:
+__891:
;
-__864:
+__890:
;
goto __8
@@ -74266,8 +75237,8 @@ __864:
//
// If P3 is not zero, then it is an address to jump to if an SQLITE_CORRUPT
// error is encountered.
-__181:
-__182:
+__183:
+__184:
// If the P4 argument is not NULL, then it must be an SQL comment string.
// The "--" string is broken up to prevent false-positives with srcck1.c.
@@ -74281,78 +75252,78 @@ __182:
// OP_Init is always instruction 0
- if !((((int32((*Sqlite3)(unsafe.Pointer(db)).FmTrace) & (SQLITE_TRACE_STMT | SQLITE_TRACE_LEGACY)) != 0) &&
- !(int32((*Vdbe)(unsafe.Pointer(p)).FdoingRerun) != 0)) &&
- ((libc.AssignUintptr(&zTrace, func() uintptr {
- if *(*uintptr)(unsafe.Pointer(pOp + 16 /* &.p4 */)) != 0 {
- return *(*uintptr)(unsafe.Pointer(pOp + 16 /* &.p4 */))
+ if !(int32((*Sqlite3)(unsafe.Pointer(db)).FmTrace)&(SQLITE_TRACE_STMT|SQLITE_TRACE_LEGACY) != 0 &&
+ !(int32((*Vdbe)(unsafe.Pointer(p)).FdoingRerun) != 0) &&
+ libc.AssignUintptr(&zTrace, func() uintptr {
+ if *(*uintptr)(unsafe.Pointer(pOp + 16)) != 0 {
+ return *(*uintptr)(unsafe.Pointer(pOp + 16))
}
return (*Vdbe)(unsafe.Pointer(p)).FzSql
- }())) != uintptr(0))) {
- goto __866
+ }()) != uintptr(0)) {
+ goto __892
}
- if !((int32((*Sqlite3)(unsafe.Pointer(db)).FmTrace) & SQLITE_TRACE_LEGACY) != 0) {
- goto __867
+ if !(int32((*Sqlite3)(unsafe.Pointer(db)).FmTrace)&SQLITE_TRACE_LEGACY != 0) {
+ goto __893
}
z2 = Xsqlite3VdbeExpandSql(tls, p, zTrace)
(*struct {
f func(*libc.TLS, uintptr, uintptr)
- })(unsafe.Pointer(&struct{ uintptr }{*(*uintptr)(unsafe.Pointer(db + 208 /* &.trace */))})).f(tls, (*Sqlite3)(unsafe.Pointer(db)).FpTraceArg, z2)
+ })(unsafe.Pointer(&struct{ uintptr }{*(*uintptr)(unsafe.Pointer(db + 216 /* &.trace */))})).f(tls, (*Sqlite3)(unsafe.Pointer(db)).FpTraceArg, z2)
Xsqlite3_free(tls, z2)
- goto __868
-__867:
+ goto __894
+__893:
if !((*Sqlite3)(unsafe.Pointer(db)).FnVdbeExec > 1) {
- goto __869
+ goto __895
}
- z3 = Xsqlite3MPrintf(tls, db, ts+5143 /* "-- %s" */, libc.VaList(bp+136, zTrace))
+ z3 = Xsqlite3MPrintf(tls, db, ts+5990 /* "-- %s" */, libc.VaList(bp+168, zTrace))
(*struct {
f func(*libc.TLS, U32, uintptr, uintptr, uintptr) int32
- })(unsafe.Pointer(&struct{ uintptr }{*(*uintptr)(unsafe.Pointer(db + 208 /* &.trace */))})).f(tls, uint32(SQLITE_TRACE_STMT), (*Sqlite3)(unsafe.Pointer(db)).FpTraceArg, p, z3)
+ })(unsafe.Pointer(&struct{ uintptr }{*(*uintptr)(unsafe.Pointer(db + 216 /* &.trace */))})).f(tls, uint32(SQLITE_TRACE_STMT), (*Sqlite3)(unsafe.Pointer(db)).FpTraceArg, p, z3)
Xsqlite3DbFree(tls, db, z3)
- goto __870
-__869:
+ goto __896
+__895:
(*struct {
f func(*libc.TLS, U32, uintptr, uintptr, uintptr) int32
- })(unsafe.Pointer(&struct{ uintptr }{*(*uintptr)(unsafe.Pointer(db + 208 /* &.trace */))})).f(tls, uint32(SQLITE_TRACE_STMT), (*Sqlite3)(unsafe.Pointer(db)).FpTraceArg, p, zTrace)
-__870:
+ })(unsafe.Pointer(&struct{ uintptr }{*(*uintptr)(unsafe.Pointer(db + 216 /* &.trace */))})).f(tls, uint32(SQLITE_TRACE_STMT), (*Sqlite3)(unsafe.Pointer(db)).FpTraceArg, p, zTrace)
+__896:
;
-__868:
+__894:
;
-__866:
+__892:
;
if !((*Op)(unsafe.Pointer(pOp)).Fp1 >= Xsqlite3Config.FiOnceResetThreshold) {
- goto __871
+ goto __897
}
if !(int32((*Op)(unsafe.Pointer(pOp)).Fopcode) == OP_Trace) {
- goto __872
+ goto __898
}
goto __8
-__872:
+__898:
;
- i9 = 1
-__873:
- if !(i9 < (*Vdbe)(unsafe.Pointer(p)).FnOp) {
- goto __875
+ i10 = 1
+__899:
+ if !(i10 < (*Vdbe)(unsafe.Pointer(p)).FnOp) {
+ goto __901
}
- if !(int32((*Op)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FaOp+uintptr(i9)*20)).Fopcode) == OP_Once) {
- goto __876
+ if !(int32((*Op)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FaOp+uintptr(i10)*20)).Fopcode) == OP_Once) {
+ goto __902
}
- (*Op)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FaOp + uintptr(i9)*20)).Fp1 = 0
-__876:
+ (*Op)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FaOp + uintptr(i10)*20)).Fp1 = 0
+__902:
;
- goto __874
-__874:
- i9++
- goto __873
- goto __875
-__875:
+ goto __900
+__900:
+ i10++
+ goto __899
+ goto __901
+__901:
;
(*Op)(unsafe.Pointer(pOp)).Fp1 = 0
-__871:
+__897:
;
(*Op)(unsafe.Pointer(pOp)).Fp1++
- *(*U32)(unsafe.Pointer((p + 164 /* &.aCounter */) + 6*4))++
+ *(*U32)(unsafe.Pointer(p + 172 + 6*4))++
goto jump_to_p2
// Opcode: Noop * * * * *
@@ -74363,7 +75334,7 @@ __871:
// 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.
-__183: // This is really OP_Noop, OP_Explain
+__185: // This is really OP_Noop, OP_Explain
;
goto __8
@@ -74394,69 +75365,75 @@ __7:
// an error of some kind.
abort_due_to_error:
if !((*Sqlite3)(unsafe.Pointer(db)).FmallocFailed != 0) {
- goto __877
+ goto __903
}
rc = SQLITE_NOMEM
- goto __878
-__877:
- if !(rc == (SQLITE_IOERR | (int32(33) << 8))) {
- goto __879
+ goto __904
+__903:
+ if !(rc == SQLITE_IOERR|int32(33)<<8) {
+ goto __905
}
- rc = Xsqlite3CorruptError(tls, 94739)
-__879:
+ rc = Xsqlite3CorruptError(tls, 95084)
+__905:
;
-__878:
+__904:
;
- if !(((*Vdbe)(unsafe.Pointer(p)).FzErrMsg == uintptr(0)) && (rc != (SQLITE_IOERR | (int32(12) << 8)))) {
- goto __880
+ if !((*Vdbe)(unsafe.Pointer(p)).FzErrMsg == uintptr(0) && rc != SQLITE_IOERR|int32(12)<<8) {
+ goto __906
}
- Xsqlite3VdbeError(tls, p, ts+2790 /* "%s" */, libc.VaList(bp+144, Xsqlite3ErrStr(tls, rc)))
-__880:
+ Xsqlite3VdbeError(tls, p, ts+3601 /* "%s" */, libc.VaList(bp+176, Xsqlite3ErrStr(tls, rc)))
+__906:
;
(*Vdbe)(unsafe.Pointer(p)).Frc = rc
Xsqlite3SystemError(tls, db, rc)
- Xsqlite3_log(tls, rc, ts+5149, /* "statement aborts..." */
- libc.VaList(bp+152, ((int32(pOp)-int32(aOp))/20), (*Vdbe)(unsafe.Pointer(p)).FzSql, (*Vdbe)(unsafe.Pointer(p)).FzErrMsg))
+ Xsqlite3_log(tls, rc, ts+5996, /* "statement aborts..." */
+ libc.VaList(bp+184, (int32(pOp)-int32(aOp))/20, (*Vdbe)(unsafe.Pointer(p)).FzSql, (*Vdbe)(unsafe.Pointer(p)).FzErrMsg))
Xsqlite3VdbeHalt(tls, p)
- if !(rc == (SQLITE_IOERR | (int32(12) << 8))) {
- goto __881
+ if !(rc == SQLITE_IOERR|int32(12)<<8) {
+ goto __907
}
Xsqlite3OomFault(tls, db)
-__881:
+__907:
+ ;
+ if !(rc == SQLITE_CORRUPT && int32((*Sqlite3)(unsafe.Pointer(db)).FautoCommit) == 0) {
+ goto __908
+ }
+ *(*U64)(unsafe.Pointer(db + 32)) |= U64(uint64(0x00002)) << 32
+__908:
;
rc = SQLITE_ERROR
if !(int32(resetSchemaOnFault) > 0) {
- goto __882
+ goto __909
}
- Xsqlite3ResetOneSchema(tls, db, (int32(resetSchemaOnFault) - 1))
-__882:
+ Xsqlite3ResetOneSchema(tls, db, int32(resetSchemaOnFault)-1)
+__909:
;
// This is the only way out of this procedure. We have to
// release the mutexes on btrees that were acquired at the
// top.
vdbe_return:
-__883:
- if !((nVmStep >= nProgressLimit) && ((*Sqlite3)(unsafe.Pointer(db)).FxProgress != uintptr(0))) {
- goto __884
+__910:
+ if !(nVmStep >= nProgressLimit && (*Sqlite3)(unsafe.Pointer(db)).FxProgress != uintptr(0)) {
+ goto __911
}
- nProgressLimit = nProgressLimit + (U64((*Sqlite3)(unsafe.Pointer(db)).FnProgressOps))
+ nProgressLimit = nProgressLimit + U64((*Sqlite3)(unsafe.Pointer(db)).FnProgressOps)
if !((*struct {
f func(*libc.TLS, uintptr) int32
})(unsafe.Pointer(&struct{ uintptr }{(*Sqlite3)(unsafe.Pointer(db)).FxProgress})).f(tls, (*Sqlite3)(unsafe.Pointer(db)).FpProgressArg) != 0) {
- goto __885
+ goto __912
}
- nProgressLimit = (uint64(0xffffffff) | (U64((uint64(0xffffffff))) << 32))
+ nProgressLimit = uint64(0xffffffff) | U64(uint64(0xffffffff))<<32
rc = SQLITE_INTERRUPT
goto abort_due_to_error
-__885:
+__912:
;
- goto __883
-__884:
+ goto __910
+__911:
;
- *(*U32)(unsafe.Pointer((p + 164 /* &.aCounter */) + 4*4)) += (U32(int32(nVmStep)))
+ *(*U32)(unsafe.Pointer(p + 172 + 4*4)) += U32(int32(nVmStep))
Xsqlite3VdbeLeave(tls, p)
return rc
@@ -74464,14 +75441,14 @@ __884:
// Jump to here if a string or blob larger than SQLITE_MAX_LENGTH
// is encountered.
too_big:
- Xsqlite3VdbeError(tls, p, ts+4448 /* "string or blob t..." */, 0)
+ Xsqlite3VdbeError(tls, p, ts+5254 /* "string or blob t..." */, 0)
rc = SQLITE_TOOBIG
goto abort_due_to_error
// Jump to here if a malloc() fails.
no_mem:
Xsqlite3OomFault(tls, db)
- Xsqlite3VdbeError(tls, p, ts+5181 /* "out of memory" */, 0)
+ Xsqlite3VdbeError(tls, p, ts+6028 /* "out of memory" */, 0)
rc = SQLITE_NOMEM
goto abort_due_to_error
@@ -74484,12 +75461,12 @@ abort_due_to_interrupt:
return int32(0)
}
-var azType = [4]uintptr{ts + 5195 /* "NOT NULL" */, ts + 5204 /* "UNIQUE" */, ts + 5211, /* "CHECK" */
- ts + 5217 /* "FOREIGN KEY" */} /* sqlite3.c:87624:25 */
-var and_logic = [9]uint8{uint8(0), uint8(0), uint8(0), uint8(0), uint8(1), uint8(2), uint8(0), uint8(2), uint8(2)} /* sqlite3.c:88844:32 */
-var or_logic = [9]uint8{uint8(0), uint8(1), uint8(2), uint8(1), uint8(1), uint8(1), uint8(2), uint8(1), uint8(2)} /* sqlite3.c:88847:32 */
-var aFlag1 = [2]U16{U16(MEM_Blob), (U16(MEM_Str | MEM_Term))} /* sqlite3.c:89315:24 */
-var vfsFlags int32 = ((((SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE) | SQLITE_OPEN_EXCLUSIVE) | SQLITE_OPEN_DELETEONCLOSE) | SQLITE_OPEN_TRANSIENT_DB) /* sqlite3.c:90453:20 */
+var azType = [4]uintptr{ts + 6042 /* "NOT NULL" */, ts + 6051 /* "UNIQUE" */, ts + 6058, /* "CHECK" */
+ ts + 6064 /* "FOREIGN KEY" */} /* sqlite3.c:87835:25 */
+var and_logic = [9]uint8{uint8(0), uint8(0), uint8(0), uint8(0), uint8(1), uint8(2), uint8(0), uint8(2), uint8(2)} /* sqlite3.c:89055:32 */
+var or_logic = [9]uint8{uint8(0), uint8(1), uint8(2), uint8(1), uint8(1), uint8(1), uint8(2), uint8(1), uint8(2)} /* sqlite3.c:89058:32 */
+var aFlag1 = [2]U16{U16(MEM_Blob), U16(MEM_Str | MEM_Term)} /* sqlite3.c:89542:24 */
+var vfsFlags int32 = SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE | SQLITE_OPEN_EXCLUSIVE | SQLITE_OPEN_DELETEONCLOSE | SQLITE_OPEN_TRANSIENT_DB /* sqlite3.c:90793:20 */
//************* End of vdbe.c ***********************************************
//************* Begin file vdbeblob.c ***************************************
@@ -74520,7 +75497,7 @@ type Incrblob1 = struct {
Fdb uintptr
FzDb uintptr
FpTab uintptr
-} /* sqlite3.c:94829:9 */
+} /* sqlite3.c:95189:9 */
//************* End of vdbe.c ***********************************************
//************* Begin file vdbeblob.c ***************************************
@@ -74541,7 +75518,7 @@ type Incrblob1 = struct {
// #include "vdbeInt.h"
// Valid sqlite3_blob* handles point to Incrblob structures.
-type Incrblob = Incrblob1 /* sqlite3.c:94829:25 */
+type Incrblob = Incrblob1 /* sqlite3.c:95189:25 */
// This function is used by both blob_open() and blob_reopen(). It seeks
// the b-tree cursor associated with blob handle p to point to row iRow.
@@ -74558,7 +75535,7 @@ type Incrblob = Incrblob1 /* sqlite3.c:94829:25 */
// If an error does occur, then the b-tree cursor is closed. All subsequent
// calls to sqlite3_blob_read(), blob_write() or blob_reopen() will
// immediately return SQLITE_ABORT.
-func blobSeekToRow(tls *libc.TLS, p uintptr, iRow Sqlite3_int64, pzErr uintptr) int32 { /* sqlite3.c:94859:12: */
+func blobSeekToRow(tls *libc.TLS, p uintptr, iRow Sqlite3_int64, pzErr uintptr) int32 { /* sqlite3.c:95219:12: */
bp := tls.Alloc(24)
defer tls.Free(24)
@@ -74569,7 +75546,7 @@ func blobSeekToRow(tls *libc.TLS, p uintptr, iRow Sqlite3_int64, pzErr uintptr)
// Set the value of register r[1] in the SQL statement to integer iRow.
// This is done directly as a performance optimization
(*Mem)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(v)).FaMem + 1*40)).Fflags = U16(MEM_Int)
- *(*I64)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(v)).FaMem + 1*40 /* &.u */)) = iRow
+ *(*I64)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(v)).FaMem + 1*40)) = iRow
// If the statement has been run before (and is paused at the OP_ResultRow)
// then back it up to the point where it does the OP_NotExists. This could
@@ -74585,32 +75562,33 @@ func blobSeekToRow(tls *libc.TLS, p uintptr, iRow Sqlite3_int64, pzErr uintptr)
if rc == SQLITE_ROW {
var pC uintptr = *(*uintptr)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(v)).FapCsr))
var type1 U32
+
if int32((*VdbeCursor)(unsafe.Pointer(pC)).FnHdrParsed) > int32((*Incrblob)(unsafe.Pointer(p)).FiCol) {
- type1 = *(*U32)(unsafe.Pointer((pC + 88 /* &.aType */) + uintptr((*Incrblob)(unsafe.Pointer(p)).FiCol)*4))
+ type1 = *(*U32)(unsafe.Pointer(pC + 88 + uintptr((*Incrblob)(unsafe.Pointer(p)).FiCol)*4))
} else {
type1 = uint32(0)
}
if type1 < U32(12) {
- zErr = Xsqlite3MPrintf(tls, (*Incrblob)(unsafe.Pointer(p)).Fdb, ts+5229, /* "cannot open valu..." */
+ zErr = Xsqlite3MPrintf(tls, (*Incrblob)(unsafe.Pointer(p)).Fdb, ts+6076, /* "cannot open valu..." */
libc.VaList(bp, func() uintptr {
if type1 == U32(0) {
- return ts + 5258 /* "null" */
+ return ts + 6105 /* "null" */
}
return func() uintptr {
if type1 == U32(7) {
- return ts + 5263 /* "real" */
+ return ts + 6110 /* "real" */
}
- return ts + 5268 /* "integer" */
+ return ts + 6115 /* "integer" */
}()
}()))
rc = SQLITE_ERROR
Xsqlite3_finalize(tls, (*Incrblob)(unsafe.Pointer(p)).FpStmt)
(*Incrblob)(unsafe.Pointer(p)).FpStmt = uintptr(0)
} else {
- (*Incrblob)(unsafe.Pointer(p)).FiOffset = int32(*(*U32)(unsafe.Pointer((pC + 88 /* &.aType */) + uintptr((int32((*Incrblob)(unsafe.Pointer(p)).FiCol)+int32((*VdbeCursor)(unsafe.Pointer(pC)).FnField)))*4)))
+ (*Incrblob)(unsafe.Pointer(p)).FiOffset = int32(*(*U32)(unsafe.Pointer(pC + 88 + uintptr(int32((*Incrblob)(unsafe.Pointer(p)).FiCol)+int32((*VdbeCursor)(unsafe.Pointer(pC)).FnField))*4)))
(*Incrblob)(unsafe.Pointer(p)).FnByte = int32(Xsqlite3VdbeSerialTypeLen(tls, type1))
- (*Incrblob)(unsafe.Pointer(p)).FpCsr = *(*uintptr)(unsafe.Pointer(pC + 40 /* &.uc */))
+ (*Incrblob)(unsafe.Pointer(p)).FpCsr = *(*uintptr)(unsafe.Pointer(pC + 40))
Xsqlite3BtreeIncrblobCursor(tls, (*Incrblob)(unsafe.Pointer(p)).FpCsr)
}
}
@@ -74621,10 +75599,10 @@ func blobSeekToRow(tls *libc.TLS, p uintptr, iRow Sqlite3_int64, pzErr uintptr)
rc = Xsqlite3_finalize(tls, (*Incrblob)(unsafe.Pointer(p)).FpStmt)
(*Incrblob)(unsafe.Pointer(p)).FpStmt = uintptr(0)
if rc == SQLITE_OK {
- zErr = Xsqlite3MPrintf(tls, (*Incrblob)(unsafe.Pointer(p)).Fdb, ts+5276 /* "no such rowid: %..." */, libc.VaList(bp+8, iRow))
+ zErr = Xsqlite3MPrintf(tls, (*Incrblob)(unsafe.Pointer(p)).Fdb, ts+6123 /* "no such rowid: %..." */, libc.VaList(bp+8, iRow))
rc = SQLITE_ERROR
} else {
- zErr = Xsqlite3MPrintf(tls, (*Incrblob)(unsafe.Pointer(p)).Fdb, ts+2790 /* "%s" */, libc.VaList(bp+16, Xsqlite3_errmsg(tls, (*Incrblob)(unsafe.Pointer(p)).Fdb)))
+ zErr = Xsqlite3MPrintf(tls, (*Incrblob)(unsafe.Pointer(p)).Fdb, ts+3601 /* "%s" */, libc.VaList(bp+16, Xsqlite3_errmsg(tls, (*Incrblob)(unsafe.Pointer(p)).Fdb)))
}
}
@@ -74633,18 +75611,18 @@ func blobSeekToRow(tls *libc.TLS, p uintptr, iRow Sqlite3_int64, pzErr uintptr)
}
// Open a blob handle.
-func Xsqlite3_blob_open(tls *libc.TLS, db uintptr, zDb uintptr, zTable uintptr, zColumn uintptr, iRow Sqlite_int64, wrFlag int32, ppBlob uintptr) int32 { /* sqlite3.c:94924:16: */
- bp := tls.Alloc(324)
- defer tls.Free(324)
+func Xsqlite3_blob_open(tls *libc.TLS, db uintptr, zDb uintptr, zTable uintptr, zColumn uintptr, iRow Sqlite_int64, wrFlag int32, ppBlob uintptr) int32 { /* sqlite3.c:95287:16: */
+ bp := tls.Alloc(320)
+ defer tls.Free(320)
var nAttempt int32
var iCol int32 // Index of zColumn in row-record
var rc int32
- // var zErr uintptr at bp+320, 4
+ // var zErr uintptr at bp+316, 4
var pTab uintptr
var pBlob uintptr
- // var sParse Parse at bp+48, 272
+ // var sParse Parse at bp+48, 268
var j int32
// Check that the column is not part of an FK child key definition. It
@@ -74660,58 +75638,58 @@ func Xsqlite3_blob_open(tls *libc.TLS, db uintptr, zDb uintptr, zTable uintptr,
var aOp uintptr
nAttempt = 0
rc = SQLITE_OK
- *(*uintptr)(unsafe.Pointer(bp + 320 /* zErr */)) = uintptr(0)
+ *(*uintptr)(unsafe.Pointer(bp + 316 /* zErr */)) = uintptr(0)
pBlob = uintptr(0)
*(*uintptr)(unsafe.Pointer(ppBlob)) = uintptr(0)
- wrFlag = libc.BoolInt32(!(!(wrFlag != 0))) // wrFlag = (wrFlag ? 1 : 0);
+ wrFlag = libc.BoolInt32(!!(wrFlag != 0)) // wrFlag = (wrFlag ? 1 : 0);
Xsqlite3_mutex_enter(tls, (*Sqlite3)(unsafe.Pointer(db)).Fmutex)
pBlob = Xsqlite3DbMallocZero(tls, db, uint64(unsafe.Sizeof(Incrblob{})))
__1:
libc.Xmemset(tls, bp+48 /* &sParse */, 0, uint32(unsafe.Sizeof(Parse{})))
- if !(!(pBlob != 0)) {
+ if !!(pBlob != 0) {
goto __4
}
goto blob_open_out
__4:
;
(*Parse)(unsafe.Pointer(bp + 48 /* &sParse */)).Fdb = db
- Xsqlite3DbFree(tls, db, *(*uintptr)(unsafe.Pointer(bp + 320 /* zErr */)))
- *(*uintptr)(unsafe.Pointer(bp + 320 /* zErr */)) = uintptr(0)
+ Xsqlite3DbFree(tls, db, *(*uintptr)(unsafe.Pointer(bp + 316 /* zErr */)))
+ *(*uintptr)(unsafe.Pointer(bp + 316 /* zErr */)) = uintptr(0)
Xsqlite3BtreeEnterAll(tls, db)
pTab = Xsqlite3LocateTable(tls, bp+48 /* &sParse */, uint32(0), zTable, zDb)
- if !((pTab != 0) && ((*Table)(unsafe.Pointer(pTab)).FnModuleArg != 0)) {
+ if !(pTab != 0 && int32((*Table)(unsafe.Pointer(pTab)).FeTabType) == TABTYP_VTAB) {
goto __5
}
pTab = uintptr(0)
- Xsqlite3ErrorMsg(tls, bp+48 /* &sParse */, ts+5296 /* "cannot open virt..." */, libc.VaList(bp, zTable))
+ Xsqlite3ErrorMsg(tls, bp+48 /* &sParse */, ts+6143 /* "cannot open virt..." */, libc.VaList(bp, zTable))
__5:
;
- if !((pTab != 0) && !(((*Table)(unsafe.Pointer((pTab))).FtabFlags & U32(TF_WithoutRowid)) == U32(0))) {
+ if !(pTab != 0 && !((*Table)(unsafe.Pointer(pTab)).FtabFlags&U32(TF_WithoutRowid) == U32(0))) {
goto __6
}
pTab = uintptr(0)
- Xsqlite3ErrorMsg(tls, bp+48 /* &sParse */, ts+5326 /* "cannot open tabl..." */, libc.VaList(bp+8, zTable))
+ Xsqlite3ErrorMsg(tls, bp+48 /* &sParse */, ts+6173 /* "cannot open tabl..." */, libc.VaList(bp+8, zTable))
__6:
;
- if !((pTab != 0) && ((*Table)(unsafe.Pointer(pTab)).FpSelect != 0)) {
+ if !(pTab != 0 && int32((*Table)(unsafe.Pointer(pTab)).FeTabType) == TABTYP_VIEW) {
goto __7
}
pTab = uintptr(0)
- Xsqlite3ErrorMsg(tls, bp+48 /* &sParse */, ts+5362 /* "cannot open view..." */, libc.VaList(bp+16, zTable))
+ Xsqlite3ErrorMsg(tls, bp+48 /* &sParse */, ts+6209 /* "cannot open view..." */, libc.VaList(bp+16, zTable))
__7:
;
- if !(!(pTab != 0)) {
+ if !!(pTab != 0) {
goto __8
}
- if !((*Parse)(unsafe.Pointer(bp+48 /* &sParse */)).FzErrMsg != 0) {
+ if !((*Parse)(unsafe.Pointer(bp+48)).FzErrMsg != 0) {
goto __9
}
- Xsqlite3DbFree(tls, db, *(*uintptr)(unsafe.Pointer(bp + 320 /* zErr */)))
- *(*uintptr)(unsafe.Pointer(bp + 320 /* zErr */)) = (*Parse)(unsafe.Pointer(bp + 48 /* &sParse */)).FzErrMsg
+ Xsqlite3DbFree(tls, db, *(*uintptr)(unsafe.Pointer(bp + 316 /* zErr */)))
+ *(*uintptr)(unsafe.Pointer(bp + 316 /* zErr */)) = (*Parse)(unsafe.Pointer(bp + 48 /* &sParse */)).FzErrMsg
(*Parse)(unsafe.Pointer(bp + 48 /* &sParse */)).FzErrMsg = uintptr(0)
__9:
;
@@ -74729,7 +75707,7 @@ __10:
if !(iCol < int32((*Table)(unsafe.Pointer(pTab)).FnCol)) {
goto __12
}
- if !(Xsqlite3StrICmp(tls, (*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FaCol+uintptr(iCol)*20)).FzName, zColumn) == 0) {
+ if !(Xsqlite3StrICmp(tls, (*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FaCol+uintptr(iCol)*16)).FzCnName, zColumn) == 0) {
goto __13
}
goto __12
@@ -74745,8 +75723,8 @@ __12:
if !(iCol == int32((*Table)(unsafe.Pointer(pTab)).FnCol)) {
goto __14
}
- Xsqlite3DbFree(tls, db, *(*uintptr)(unsafe.Pointer(bp + 320 /* zErr */)))
- *(*uintptr)(unsafe.Pointer(bp + 320 /* zErr */)) = Xsqlite3MPrintf(tls, db, ts+5383 /* "no such column: ..." */, libc.VaList(bp+24, zColumn))
+ Xsqlite3DbFree(tls, db, *(*uintptr)(unsafe.Pointer(bp + 316 /* zErr */)))
+ *(*uintptr)(unsafe.Pointer(bp + 316 /* zErr */)) = Xsqlite3MPrintf(tls, db, ts+6230 /* "no such column: ..." */, libc.VaList(bp+24, zColumn))
rc = SQLITE_ERROR
Xsqlite3BtreeLeaveAll(tls, db)
goto blob_open_out
@@ -74759,10 +75737,11 @@ __14:
goto __15
}
zFault = uintptr(0)
- if !(((*Sqlite3)(unsafe.Pointer(db)).Fflags & uint64(SQLITE_ForeignKeys)) != 0) {
+ if !((*Sqlite3)(unsafe.Pointer(db)).Fflags&uint64(SQLITE_ForeignKeys) != 0) {
goto __16
}
- pFKey = (*Table)(unsafe.Pointer(pTab)).FpFKey
+
+ pFKey = *(*uintptr)(unsafe.Pointer(pTab + 44 + 4 /* &.pFKey */))
__17:
if !(pFKey != 0) {
goto __19
@@ -74772,10 +75751,10 @@ __20:
if !(j < (*FKey)(unsafe.Pointer(pFKey)).FnCol) {
goto __22
}
- if !((*sColMap)(unsafe.Pointer((pFKey+36 /* &.aCol */)+uintptr(j)*8)).FiFrom == iCol) {
+ if !((*sColMap)(unsafe.Pointer(pFKey+36+uintptr(j)*8)).FiFrom == iCol) {
goto __23
}
- zFault = ts + 5404 /* "foreign key" */
+ zFault = ts + 6251 /* "foreign key" */
__23:
;
goto __21
@@ -74805,10 +75784,10 @@ __27:
goto __29
}
// FIXME: Be smarter about indexes that use expressions
- if !((int32(*(*I16)(unsafe.Pointer((*Index)(unsafe.Pointer(pIdx)).FaiColumn + uintptr(j1)*2))) == iCol) || (int32(*(*I16)(unsafe.Pointer((*Index)(unsafe.Pointer(pIdx)).FaiColumn + uintptr(j1)*2))) == (-2))) {
+ if !(int32(*(*I16)(unsafe.Pointer((*Index)(unsafe.Pointer(pIdx)).FaiColumn + uintptr(j1)*2))) == iCol || int32(*(*I16)(unsafe.Pointer((*Index)(unsafe.Pointer(pIdx)).FaiColumn + uintptr(j1)*2))) == -2) {
goto __30
}
- zFault = ts + 5416 /* "indexed" */
+ zFault = ts + 6263 /* "indexed" */
__30:
;
goto __28
@@ -74828,8 +75807,8 @@ __26:
if !(zFault != 0) {
goto __31
}
- Xsqlite3DbFree(tls, db, *(*uintptr)(unsafe.Pointer(bp + 320 /* zErr */)))
- *(*uintptr)(unsafe.Pointer(bp + 320 /* zErr */)) = Xsqlite3MPrintf(tls, db, ts+5424 /* "cannot open %s c..." */, libc.VaList(bp+32, zFault))
+ Xsqlite3DbFree(tls, db, *(*uintptr)(unsafe.Pointer(bp + 316 /* zErr */)))
+ *(*uintptr)(unsafe.Pointer(bp + 316 /* zErr */)) = Xsqlite3MPrintf(tls, db, ts+6271 /* "cannot open %s c..." */, libc.VaList(bp+32, zFault))
rc = SQLITE_ERROR
Xsqlite3BtreeLeaveAll(tls, db)
goto blob_open_out
@@ -74851,7 +75830,7 @@ __15:
(*Schema)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FpSchema)).FiGeneration)
Xsqlite3VdbeChangeP5(tls, v, uint16(1))
- aOp = Xsqlite3VdbeAddOpList(tls, v, (int32(uint32(unsafe.Sizeof(openBlob)) / uint32(unsafe.Sizeof(VdbeOpList{})))), uintptr(unsafe.Pointer(&openBlob)), iLn)
+ aOp = Xsqlite3VdbeAddOpList(tls, v, int32(uint32(unsafe.Sizeof(openBlob))/uint32(unsafe.Sizeof(VdbeOpList{}))), uintptr(unsafe.Pointer(&openBlob)), iLn)
// Make sure a mutex is held on the table to be accessed
Xsqlite3VdbeUsesBtree(tls, v, iDb)
@@ -74889,7 +75868,7 @@ __35:
// we can invoke OP_Column to fill in the vdbe cursors type
// and offset cache without causing any IO.
(*VdbeOp)(unsafe.Pointer(aOp + 1*20)).Fp4type = int8(-3)
- *(*int32)(unsafe.Pointer(aOp + 1*20 + 16 /* &.p4 */)) = (int32((*Table)(unsafe.Pointer(pTab)).FnCol) + 1)
+ *(*int32)(unsafe.Pointer(aOp + 1*20 + 16)) = int32((*Table)(unsafe.Pointer(pTab)).FnCol) + 1
(*VdbeOp)(unsafe.Pointer(aOp + 3*20)).Fp2 = int32((*Table)(unsafe.Pointer(pTab)).FnCol)
(*Parse)(unsafe.Pointer(bp + 48 /* &sParse */)).FnVar = int16(0)
@@ -74910,10 +75889,10 @@ __32:
goto blob_open_out
__36:
;
- rc = blobSeekToRow(tls, pBlob, iRow, bp+320 /* &zErr */)
+ rc = blobSeekToRow(tls, pBlob, iRow, bp+316 /* &zErr */)
goto __2
__2:
- if ((libc.PreIncInt32(&nAttempt, 1)) < SQLITE_MAX_SCHEMA_RETRY) && (rc == SQLITE_SCHEMA) {
+ if libc.PreIncInt32(&nAttempt, 1) < SQLITE_MAX_SCHEMA_RETRY && rc == SQLITE_SCHEMA {
goto __1
}
goto __3
@@ -74921,13 +75900,13 @@ __3:
;
blob_open_out:
- if !((rc == SQLITE_OK) && (int32((*Sqlite3)(unsafe.Pointer(db)).FmallocFailed) == 0)) {
+ if !(rc == SQLITE_OK && int32((*Sqlite3)(unsafe.Pointer(db)).FmallocFailed) == 0) {
goto __37
}
*(*uintptr)(unsafe.Pointer(ppBlob)) = pBlob
goto __38
__37:
- if !((pBlob != 0) && ((*Incrblob)(unsafe.Pointer(pBlob)).FpStmt != 0)) {
+ if !(pBlob != 0 && (*Incrblob)(unsafe.Pointer(pBlob)).FpStmt != 0) {
goto __39
}
Xsqlite3VdbeFinalize(tls, (*Incrblob)(unsafe.Pointer(pBlob)).FpStmt)
@@ -74937,19 +75916,19 @@ __39:
__38:
;
Xsqlite3ErrorWithMsg(tls, db, rc, func() uintptr {
- if *(*uintptr)(unsafe.Pointer(bp + 320 /* zErr */)) != 0 {
- return ts + 2790 /* "%s" */
+ if *(*uintptr)(unsafe.Pointer(bp + 316)) != 0 {
+ return ts + 3601 /* "%s" */
}
return uintptr(0)
- }(), libc.VaList(bp+40, *(*uintptr)(unsafe.Pointer(bp + 320 /* zErr */))))
- Xsqlite3DbFree(tls, db, *(*uintptr)(unsafe.Pointer(bp + 320 /* zErr */)))
+ }(), libc.VaList(bp+40, *(*uintptr)(unsafe.Pointer(bp + 316 /* zErr */))))
+ Xsqlite3DbFree(tls, db, *(*uintptr)(unsafe.Pointer(bp + 316 /* zErr */)))
Xsqlite3ParserReset(tls, bp+48 /* &sParse */)
rc = Xsqlite3ApiExit(tls, db, rc)
Xsqlite3_mutex_leave(tls, (*Sqlite3)(unsafe.Pointer(db)).Fmutex)
return rc
}
-var iLn int32 = 0 /* sqlite3.c:95067:24 */
+var iLn int32 = 0 /* sqlite3.c:95431:24 */
var openBlob = [6]VdbeOpList{
{Fopcode: U8(OP_TableLock)}, // 0: Acquire a read or write lock
{Fopcode: U8(OP_OpenRead)}, // 1: Open a cursor
@@ -74958,11 +75937,11 @@ var openBlob = [6]VdbeOpList{
{Fopcode: U8(OP_Column), Fp3: int8(1)}, // 3
{Fopcode: U8(OP_ResultRow), Fp1: int8(1)}, // 4
{Fopcode: U8(OP_Halt)}, // 5
-} /* sqlite3.c:95068:31 */
+} /* sqlite3.c:95432:31 */
// Close a blob handle that was previously created using
// sqlite3_blob_open().
-func Xsqlite3_blob_close(tls *libc.TLS, pBlob uintptr) int32 { /* sqlite3.c:95157:16: */
+func Xsqlite3_blob_close(tls *libc.TLS, pBlob uintptr) int32 { /* sqlite3.c:95521:16: */
var p uintptr = pBlob
var rc int32
var db uintptr
@@ -74981,20 +75960,20 @@ func Xsqlite3_blob_close(tls *libc.TLS, pBlob uintptr) int32 { /* sqlite3.c:9515
}
// Perform a read or write operation on a blob
-func blobReadWrite(tls *libc.TLS, pBlob uintptr, z uintptr, n int32, iOffset int32, xCall uintptr) int32 { /* sqlite3.c:95178:12: */
+func blobReadWrite(tls *libc.TLS, pBlob uintptr, z uintptr, n int32, iOffset int32, xCall uintptr) int32 { /* sqlite3.c:95542:12: */
var rc int32
var p uintptr = pBlob
var v uintptr
var db uintptr
if p == uintptr(0) {
- return Xsqlite3MisuseError(tls, 95190)
+ return Xsqlite3MisuseError(tls, 95554)
}
db = (*Incrblob)(unsafe.Pointer(p)).Fdb
Xsqlite3_mutex_enter(tls, (*Sqlite3)(unsafe.Pointer(db)).Fmutex)
v = (*Incrblob)(unsafe.Pointer(p)).FpStmt
- if ((n < 0) || (iOffset < 0)) || ((Sqlite3_int64(iOffset) + Sqlite3_int64(n)) > Sqlite3_int64((*Incrblob)(unsafe.Pointer(p)).FnByte)) {
+ if n < 0 || iOffset < 0 || Sqlite3_int64(iOffset)+Sqlite3_int64(n) > Sqlite3_int64((*Incrblob)(unsafe.Pointer(p)).FnByte) {
// Request is out of range. Return a transient error.
rc = SQLITE_ERROR
} else if v == uintptr(0) {
@@ -75007,9 +75986,9 @@ func blobReadWrite(tls *libc.TLS, pBlob uintptr, z uintptr, n int32, iOffset int
Xsqlite3BtreeEnterCursor(tls, (*Incrblob)(unsafe.Pointer(p)).FpCsr)
- if (xCall == *(*uintptr)(unsafe.Pointer(&struct {
+ if xCall == *(*uintptr)(unsafe.Pointer(&struct {
f func(*libc.TLS, uintptr, U32, U32, uintptr) int32
- }{Xsqlite3BtreePutData}))) && ((*Sqlite3)(unsafe.Pointer(db)).FxPreUpdateCallback != 0) {
+ }{Xsqlite3BtreePutData})) && (*Sqlite3)(unsafe.Pointer(db)).FxPreUpdateCallback != 0 {
// If a pre-update hook is registered and this is a write cursor,
// invoke it here.
//
@@ -75024,13 +76003,14 @@ func blobReadWrite(tls *libc.TLS, pBlob uintptr, z uintptr, n int32, iOffset int
// anyhow.
var iKey Sqlite3_int64
iKey = Xsqlite3BtreeIntegerKey(tls, (*Incrblob)(unsafe.Pointer(p)).FpCsr)
+
Xsqlite3VdbePreUpdateHook(tls,
v, *(*uintptr)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(v)).FapCsr)), SQLITE_DELETE, (*Incrblob)(unsafe.Pointer(p)).FzDb, (*Incrblob)(unsafe.Pointer(p)).FpTab, iKey, -1, int32((*Incrblob)(unsafe.Pointer(p)).FiCol))
}
rc = (*struct {
f func(*libc.TLS, uintptr, U32, U32, uintptr) int32
- })(unsafe.Pointer(&struct{ uintptr }{xCall})).f(tls, (*Incrblob)(unsafe.Pointer(p)).FpCsr, (uint32(iOffset + (*Incrblob)(unsafe.Pointer(p)).FiOffset)), uint32(n), z)
+ })(unsafe.Pointer(&struct{ uintptr }{xCall})).f(tls, (*Incrblob)(unsafe.Pointer(p)).FpCsr, uint32(iOffset+(*Incrblob)(unsafe.Pointer(p)).FiOffset), uint32(n), z)
Xsqlite3BtreeLeaveCursor(tls, (*Incrblob)(unsafe.Pointer(p)).FpCsr)
if rc == SQLITE_ABORT {
Xsqlite3VdbeFinalize(tls, v)
@@ -75046,14 +76026,14 @@ func blobReadWrite(tls *libc.TLS, pBlob uintptr, z uintptr, n int32, iOffset int
}
// Read data from a blob handle.
-func Xsqlite3_blob_read(tls *libc.TLS, pBlob uintptr, z uintptr, n int32, iOffset int32) int32 { /* sqlite3.c:95251:16: */
+func Xsqlite3_blob_read(tls *libc.TLS, pBlob uintptr, z uintptr, n int32, iOffset int32) int32 { /* sqlite3.c:95617:16: */
return blobReadWrite(tls, pBlob, z, n, iOffset, *(*uintptr)(unsafe.Pointer(&struct {
f func(*libc.TLS, uintptr, U32, U32, uintptr) int32
}{Xsqlite3BtreePayloadChecked})))
}
// Write data to a blob handle.
-func Xsqlite3_blob_write(tls *libc.TLS, pBlob uintptr, z uintptr, n int32, iOffset int32) int32 { /* sqlite3.c:95258:16: */
+func Xsqlite3_blob_write(tls *libc.TLS, pBlob uintptr, z uintptr, n int32, iOffset int32) int32 { /* sqlite3.c:95624:16: */
return blobReadWrite(tls, pBlob, z, n, iOffset, *(*uintptr)(unsafe.Pointer(&struct {
f func(*libc.TLS, uintptr, U32, U32, uintptr) int32
}{Xsqlite3BtreePutData})))
@@ -75063,9 +76043,9 @@ func Xsqlite3_blob_write(tls *libc.TLS, pBlob uintptr, z uintptr, n int32, iOffs
//
// The Incrblob.nByte field is fixed for the lifetime of the Incrblob
// so no mutex is required for access.
-func Xsqlite3_blob_bytes(tls *libc.TLS, pBlob uintptr) int32 { /* sqlite3.c:95268:16: */
+func Xsqlite3_blob_bytes(tls *libc.TLS, pBlob uintptr) int32 { /* sqlite3.c:95634:16: */
var p uintptr = pBlob
- if (p != 0) && ((*Incrblob)(unsafe.Pointer(p)).FpStmt != 0) {
+ if p != 0 && (*Incrblob)(unsafe.Pointer(p)).FpStmt != 0 {
return (*Incrblob)(unsafe.Pointer(p)).FnByte
}
return 0
@@ -75079,7 +76059,7 @@ func Xsqlite3_blob_bytes(tls *libc.TLS, pBlob uintptr) int32 { /* sqlite3.c:9526
// database handle error code and message set. If this happens, then all
// subsequent calls to sqlite3_blob_xxx() functions (except blob_close())
// immediately return SQLITE_ABORT.
-func Xsqlite3_blob_reopen(tls *libc.TLS, pBlob uintptr, iRow Sqlite3_int64) int32 { /* sqlite3.c:95283:16: */
+func Xsqlite3_blob_reopen(tls *libc.TLS, pBlob uintptr, iRow Sqlite3_int64) int32 { /* sqlite3.c:95649:16: */
bp := tls.Alloc(12)
defer tls.Free(12)
@@ -75088,7 +76068,7 @@ func Xsqlite3_blob_reopen(tls *libc.TLS, pBlob uintptr, iRow Sqlite3_int64) int3
var db uintptr
if p == uintptr(0) {
- return Xsqlite3MisuseError(tls, 95288)
+ return Xsqlite3MisuseError(tls, 95654)
}
db = (*Incrblob)(unsafe.Pointer(p)).Fdb
Xsqlite3_mutex_enter(tls, (*Sqlite3)(unsafe.Pointer(db)).Fmutex)
@@ -75104,8 +76084,8 @@ func Xsqlite3_blob_reopen(tls *libc.TLS, pBlob uintptr, iRow Sqlite3_int64) int3
rc = blobSeekToRow(tls, p, iRow, bp+8 /* &zErr */)
if rc != SQLITE_OK {
Xsqlite3ErrorWithMsg(tls, db, rc, func() uintptr {
- if *(*uintptr)(unsafe.Pointer(bp + 8 /* zErr */)) != 0 {
- return ts + 2790 /* "%s" */
+ if *(*uintptr)(unsafe.Pointer(bp + 8)) != 0 {
+ return ts + 3601 /* "%s" */
}
return uintptr(0)
}(), libc.VaList(bp, *(*uintptr)(unsafe.Pointer(bp + 8 /* zErr */))))
@@ -75274,7 +76254,7 @@ type MergeEngine1 = struct {
FpTask uintptr
FaTree uintptr
FaReadr uintptr
-} /* sqlite3.c:21218:9 */
+} /* sqlite3.c:21732:9 */
//************* End of vdbeblob.c *******************************************
//************* Begin file vdbesort.c ***************************************
@@ -75425,7 +76405,7 @@ type MergeEngine1 = struct {
// overflows. 512MiB.
// Private objects used by the sorter
-type MergeEngine = MergeEngine1 /* sqlite3.c:95477:28 */ // Merge PMAs together
+type MergeEngine = MergeEngine1 /* sqlite3.c:95843:28 */ // Merge PMAs together
type PmaReader1 = struct {
FiReadOff I64
FiEof I64
@@ -75439,10 +76419,10 @@ type PmaReader1 = struct {
FaMap uintptr
FpIncr uintptr
F__ccgo_pad1 [4]byte
-} /* sqlite3.c:21218:9 */
+} /* sqlite3.c:21732:9 */
// Merge PMAs together
-type PmaReader = PmaReader1 /* sqlite3.c:95478:26 */ // Incrementally read one PMA
+type PmaReader = PmaReader1 /* sqlite3.c:95844:26 */ // Incrementally read one PMA
type PmaWriter1 = struct {
FeFWErr int32
FaBuffer uintptr
@@ -75453,17 +76433,17 @@ type PmaWriter1 = struct {
FiWriteOff I64
FpFd uintptr
F__ccgo_pad2 [4]byte
-} /* sqlite3.c:95479:9 */
+} /* sqlite3.c:95845:9 */
// Incrementally read one PMA
-type PmaWriter = PmaWriter1 /* sqlite3.c:95479:26 */ // Incrementally write one PMA
+type PmaWriter = PmaWriter1 /* sqlite3.c:95845:26 */ // Incrementally write one PMA
type SorterRecord1 = struct {
FnVal int32
Fu struct{ FpNext uintptr }
-} /* sqlite3.c:21218:9 */
+} /* sqlite3.c:21732:9 */
// Incrementally write one PMA
-type SorterRecord = SorterRecord1 /* sqlite3.c:95480:29 */ // A record being sorted
+type SorterRecord = SorterRecord1 /* sqlite3.c:95846:29 */ // A record being sorted
type SortSubtask1 = struct {
FpThread uintptr
FbDone int32
@@ -75475,26 +76455,26 @@ type SortSubtask1 = struct {
F__ccgo_pad1 [4]byte
Ffile SorterFile
Ffile2 SorterFile
-} /* sqlite3.c:21218:9 */
+} /* sqlite3.c:21732:9 */
// A record being sorted
-type SortSubtask = SortSubtask1 /* sqlite3.c:95481:28 */ // A sub-task in the sort process
+type SortSubtask = SortSubtask1 /* sqlite3.c:95847:28 */ // A sub-task in the sort process
type SorterFile1 = struct {
FpFd uintptr
F__ccgo_pad1 [4]byte
FiEof I64
-} /* sqlite3.c:21218:9 */
+} /* sqlite3.c:21732:9 */
// A sub-task in the sort process
-type SorterFile = SorterFile1 /* sqlite3.c:95482:27 */ // Temporary file object wrapper
+type SorterFile = SorterFile1 /* sqlite3.c:95848:27 */ // Temporary file object wrapper
type SorterList1 = struct {
FpList uintptr
FaMemory uintptr
FszPMA int32
-} /* sqlite3.c:21218:9 */
+} /* sqlite3.c:21732:9 */
// Temporary file object wrapper
-type SorterList = SorterList1 /* sqlite3.c:95483:27 */ // In-memory list of records
+type SorterList = SorterList1 /* sqlite3.c:95849:27 */ // In-memory list of records
type IncrMerger1 = struct {
FpTask uintptr
FpMerger uintptr
@@ -75504,10 +76484,10 @@ type IncrMerger1 = struct {
FbUseThread int32
F__ccgo_pad1 [4]byte
FaFile [2]SorterFile
-} /* sqlite3.c:21218:9 */
+} /* sqlite3.c:21732:9 */
// In-memory list of records
-type IncrMerger = IncrMerger1 /* sqlite3.c:95484:27 */
+type IncrMerger = IncrMerger1 /* sqlite3.c:95850:27 */
// This object represents a single thread of control in a sort operation.
// Exactly VdbeSorter.nTask instances of this object are allocated
@@ -75538,11 +76518,11 @@ type IncrMerger = IncrMerger1 /* sqlite3.c:95484:27 */
// In both cases, the effects of the main thread seeing (bDone==0) even
// after the thread has finished are not dire. So we don't worry about
// memory barriers and such here.
-type SorterCompare = uintptr /* sqlite3.c:95611:13 */
+type SorterCompare = uintptr /* sqlite3.c:95977:13 */
// Free all memory belonging to the PmaReader object passed as the
// argument. All structure fields are set to zero before returning.
-func vdbePmaReaderClear(tls *libc.TLS, pReadr uintptr) { /* sqlite3.c:95786:13: */
+func vdbePmaReaderClear(tls *libc.TLS, pReadr uintptr) { /* sqlite3.c:96152:13: */
Xsqlite3_free(tls, (*PmaReader)(unsafe.Pointer(pReadr)).FaAlloc)
Xsqlite3_free(tls, (*PmaReader)(unsafe.Pointer(pReadr)).FaBuffer)
if (*PmaReader)(unsafe.Pointer(pReadr)).FaMap != 0 {
@@ -75559,7 +76539,7 @@ func vdbePmaReaderClear(tls *libc.TLS, pReadr uintptr) { /* sqlite3.c:95786:13:
//
// The buffer returned in *ppOut is only valid until the
// next call to this function.
-func vdbePmaReadBlob(tls *libc.TLS, p uintptr, nByte int32, ppOut uintptr) int32 { /* sqlite3.c:95803:12: */
+func vdbePmaReadBlob(tls *libc.TLS, p uintptr, nByte int32, ppOut uintptr) int32 { /* sqlite3.c:96169:12: */
bp := tls.Alloc(4)
defer tls.Free(4)
@@ -75567,24 +76547,24 @@ func vdbePmaReadBlob(tls *libc.TLS, p uintptr, nByte int32, ppOut uintptr) int32
var nAvail int32 // Bytes of data available in buffer
if (*PmaReader)(unsafe.Pointer(p)).FaMap != 0 {
- *(*uintptr)(unsafe.Pointer(ppOut)) = ((*PmaReader)(unsafe.Pointer(p)).FaMap + uintptr((*PmaReader)(unsafe.Pointer(p)).FiReadOff))
- *(*I64)(unsafe.Pointer(p /* &.iReadOff */)) += (I64(nByte))
+ *(*uintptr)(unsafe.Pointer(ppOut)) = (*PmaReader)(unsafe.Pointer(p)).FaMap + uintptr((*PmaReader)(unsafe.Pointer(p)).FiReadOff)
+ *(*I64)(unsafe.Pointer(p)) += I64(nByte)
return SQLITE_OK
}
// If there is no more data to be read from the buffer, read the next
// p->nBuffer bytes of data from the file into it. Or, if there are less
// than p->nBuffer bytes remaining in the PMA, read all remaining data.
- iBuf = (int32((*PmaReader)(unsafe.Pointer(p)).FiReadOff % I64((*PmaReader)(unsafe.Pointer(p)).FnBuffer)))
+ iBuf = int32((*PmaReader)(unsafe.Pointer(p)).FiReadOff % I64((*PmaReader)(unsafe.Pointer(p)).FnBuffer))
if iBuf == 0 {
var nRead int32 // Bytes to read from disk
var rc int32 // sqlite3OsRead() return code
// Determine how many bytes of data to read.
- if ((*PmaReader)(unsafe.Pointer(p)).FiEof - (*PmaReader)(unsafe.Pointer(p)).FiReadOff) > I64((*PmaReader)(unsafe.Pointer(p)).FnBuffer) {
+ if (*PmaReader)(unsafe.Pointer(p)).FiEof-(*PmaReader)(unsafe.Pointer(p)).FiReadOff > I64((*PmaReader)(unsafe.Pointer(p)).FnBuffer) {
nRead = (*PmaReader)(unsafe.Pointer(p)).FnBuffer
} else {
- nRead = (int32((*PmaReader)(unsafe.Pointer(p)).FiEof - (*PmaReader)(unsafe.Pointer(p)).FiReadOff))
+ nRead = int32((*PmaReader)(unsafe.Pointer(p)).FiEof - (*PmaReader)(unsafe.Pointer(p)).FiReadOff)
}
// Readr data from the file. Return early if an error occurs.
@@ -75594,14 +76574,14 @@ func vdbePmaReadBlob(tls *libc.TLS, p uintptr, nByte int32, ppOut uintptr) int32
return rc
}
}
- nAvail = ((*PmaReader)(unsafe.Pointer(p)).FnBuffer - iBuf)
+ nAvail = (*PmaReader)(unsafe.Pointer(p)).FnBuffer - iBuf
if nByte <= nAvail {
// The requested data is available in the in-memory buffer. In this
// case there is no need to make a copy of the data, just return a
// pointer into the buffer to the caller.
- *(*uintptr)(unsafe.Pointer(ppOut)) = ((*PmaReader)(unsafe.Pointer(p)).FaBuffer + uintptr(iBuf))
- *(*I64)(unsafe.Pointer(p /* &.iReadOff */)) += (I64(nByte))
+ *(*uintptr)(unsafe.Pointer(ppOut)) = (*PmaReader)(unsafe.Pointer(p)).FaBuffer + uintptr(iBuf)
+ *(*I64)(unsafe.Pointer(p)) += I64(nByte)
} else {
// The requested data is not all available in the in-memory buffer.
// In this case, allocate space at p->aAlloc[] to copy the requested
@@ -75612,13 +76592,13 @@ func vdbePmaReadBlob(tls *libc.TLS, p uintptr, nByte int32, ppOut uintptr) int32
if (*PmaReader)(unsafe.Pointer(p)).FnAlloc < nByte {
var aNew uintptr
var nNew Sqlite3_int64 = func() int64 {
- if (int64(128)) > (int64(2) * Sqlite3_int64((*PmaReader)(unsafe.Pointer(p)).FnAlloc)) {
+ if int64(128) > int64(2)*Sqlite3_int64((*PmaReader)(unsafe.Pointer(p)).FnAlloc) {
return int64(128)
}
- return (int64(2) * Sqlite3_int64((*PmaReader)(unsafe.Pointer(p)).FnAlloc))
+ return int64(2) * Sqlite3_int64((*PmaReader)(unsafe.Pointer(p)).FnAlloc)
}()
for Sqlite3_int64(nByte) > nNew {
- nNew = (nNew * int64(2))
+ nNew = nNew * int64(2)
}
aNew = Xsqlite3Realloc(tls, (*PmaReader)(unsafe.Pointer(p)).FaAlloc, uint64(nNew))
if !(aNew != 0) {
@@ -75630,9 +76610,9 @@ func vdbePmaReadBlob(tls *libc.TLS, p uintptr, nByte int32, ppOut uintptr) int32
// Copy as much data as is available in the buffer into the start of
// p->aAlloc[].
- libc.Xmemcpy(tls, (*PmaReader)(unsafe.Pointer(p)).FaAlloc, ((*PmaReader)(unsafe.Pointer(p)).FaBuffer + uintptr(iBuf)), uint32(nAvail))
- *(*I64)(unsafe.Pointer(p /* &.iReadOff */)) += (I64(nAvail))
- nRem = (nByte - nAvail)
+ libc.Xmemcpy(tls, (*PmaReader)(unsafe.Pointer(p)).FaAlloc, (*PmaReader)(unsafe.Pointer(p)).FaBuffer+uintptr(iBuf), uint32(nAvail))
+ *(*I64)(unsafe.Pointer(p)) += I64(nAvail)
+ nRem = nByte - nAvail
// The following loop copies up to p->nBuffer bytes per iteration into
// the p->aAlloc[] buffer.
@@ -75651,8 +76631,8 @@ func vdbePmaReadBlob(tls *libc.TLS, p uintptr, nByte int32, ppOut uintptr) int32
return rc
}
- libc.Xmemcpy(tls, ((*PmaReader)(unsafe.Pointer(p)).FaAlloc + uintptr((nByte - nRem))), *(*uintptr)(unsafe.Pointer(bp /* aNext */)), uint32(nCopy))
- nRem = nRem - (nCopy)
+ libc.Xmemcpy(tls, (*PmaReader)(unsafe.Pointer(p)).FaAlloc+uintptr(nByte-nRem), *(*uintptr)(unsafe.Pointer(bp /* aNext */)), uint32(nCopy))
+ nRem = nRem - nCopy
}
*(*uintptr)(unsafe.Pointer(ppOut)) = (*PmaReader)(unsafe.Pointer(p)).FaAlloc
@@ -75663,18 +76643,18 @@ func vdbePmaReadBlob(tls *libc.TLS, p uintptr, nByte int32, ppOut uintptr) int32
// Read a varint from the stream of data accessed by p. Set *pnOut to
// the value read.
-func vdbePmaReadVarint(tls *libc.TLS, p uintptr, pnOut uintptr) int32 { /* sqlite3.c:95897:12: */
+func vdbePmaReadVarint(tls *libc.TLS, p uintptr, pnOut uintptr) int32 { /* sqlite3.c:96263:12: */
bp := tls.Alloc(20)
defer tls.Free(20)
var iBuf int32
if (*PmaReader)(unsafe.Pointer(p)).FaMap != 0 {
- *(*I64)(unsafe.Pointer(p /* &.iReadOff */)) += (I64(Xsqlite3GetVarint(tls, ((*PmaReader)(unsafe.Pointer(p)).FaMap + uintptr((*PmaReader)(unsafe.Pointer(p)).FiReadOff)), pnOut)))
+ *(*I64)(unsafe.Pointer(p)) += I64(Xsqlite3GetVarint(tls, (*PmaReader)(unsafe.Pointer(p)).FaMap+uintptr((*PmaReader)(unsafe.Pointer(p)).FiReadOff), pnOut))
} else {
- iBuf = (int32((*PmaReader)(unsafe.Pointer(p)).FiReadOff % I64((*PmaReader)(unsafe.Pointer(p)).FnBuffer)))
- if (iBuf != 0) && (((*PmaReader)(unsafe.Pointer(p)).FnBuffer - iBuf) >= 9) {
- *(*I64)(unsafe.Pointer(p /* &.iReadOff */)) += (I64(Xsqlite3GetVarint(tls, ((*PmaReader)(unsafe.Pointer(p)).FaBuffer + uintptr(iBuf)), pnOut)))
+ iBuf = int32((*PmaReader)(unsafe.Pointer(p)).FiReadOff % I64((*PmaReader)(unsafe.Pointer(p)).FnBuffer))
+ if iBuf != 0 && (*PmaReader)(unsafe.Pointer(p)).FnBuffer-iBuf >= 9 {
+ *(*I64)(unsafe.Pointer(p)) += I64(Xsqlite3GetVarint(tls, (*PmaReader)(unsafe.Pointer(p)).FaBuffer+uintptr(iBuf), pnOut))
} else {
// var aVarint [16]U8 at bp+4, 16
@@ -75682,12 +76662,12 @@ func vdbePmaReadVarint(tls *libc.TLS, p uintptr, pnOut uintptr) int32 { /* sqlit
var i int32 = 0
var rc int32
- for ok := true; ok; ok = ((int32(*(*U8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* a */))))) & 0x80) != 0) {
+ for ok := true; ok; ok = int32(*(*U8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))))&0x80 != 0 {
rc = vdbePmaReadBlob(tls, p, 1, bp /* &a */)
if rc != 0 {
return rc
}
- *(*U8)(unsafe.Pointer(bp + 4 /* &aVarint[0] */ + uintptr(((libc.PostIncInt32(&i, 1)) & 0xf)))) = *(*U8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* a */))))
+ *(*U8)(unsafe.Pointer(bp + 4 /* &aVarint[0] */ + uintptr(libc.PostIncInt32(&i, 1)&0xf))) = *(*U8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* a */))))
}
Xsqlite3GetVarint(tls, bp+4 /* &aVarint[0] */, pnOut)
}
@@ -75703,9 +76683,9 @@ func vdbePmaReadVarint(tls *libc.TLS, p uintptr, pnOut uintptr) int32 { /* sqlit
//
// Or, if an error occurs, return an SQLite error code. The final value of
// *pp is undefined in this case.
-func vdbeSorterMapFile(tls *libc.TLS, pTask uintptr, pFile uintptr, pp uintptr) int32 { /* sqlite3.c:95930:12: */
+func vdbeSorterMapFile(tls *libc.TLS, pTask uintptr, pFile uintptr, pp uintptr) int32 { /* sqlite3.c:96296:12: */
var rc int32 = SQLITE_OK
- if (*SorterFile)(unsafe.Pointer(pFile)).FiEof <= (I64((*Sqlite3)(unsafe.Pointer((*VdbeSorter)(unsafe.Pointer((*SortSubtask)(unsafe.Pointer(pTask)).FpSorter)).Fdb)).FnMaxSorterMmap)) {
+ if (*SorterFile)(unsafe.Pointer(pFile)).FiEof <= I64((*Sqlite3)(unsafe.Pointer((*VdbeSorter)(unsafe.Pointer((*SortSubtask)(unsafe.Pointer(pTask)).FpSorter)).Fdb)).FnMaxSorterMmap) {
var pFd uintptr = (*SorterFile)(unsafe.Pointer(pFile)).FpFd
if (*sqlite3_io_methods)(unsafe.Pointer((*Sqlite3_file)(unsafe.Pointer(pFd)).FpMethods)).FiVersion >= 3 {
rc = Xsqlite3OsFetch(tls, pFd, int64(0), int32((*SorterFile)(unsafe.Pointer(pFile)).FiEof), pp)
@@ -75718,11 +76698,11 @@ func vdbeSorterMapFile(tls *libc.TLS, pTask uintptr, pFile uintptr, pp uintptr)
// Attach PmaReader pReadr to file pFile (if it is not already attached to
// that file) and seek it to offset iOff within the file. Return SQLITE_OK
// if successful, or an SQLite error code if an error occurs.
-func vdbePmaReaderSeek(tls *libc.TLS, pTask uintptr, pReadr uintptr, pFile uintptr, iOff I64) int32 { /* sqlite3.c:95947:12: */
+func vdbePmaReaderSeek(tls *libc.TLS, pTask uintptr, pReadr uintptr, pFile uintptr, iOff I64) int32 { /* sqlite3.c:96313:12: */
var rc int32 = SQLITE_OK
if Xsqlite3FaultSim(tls, 201) != 0 {
- return (SQLITE_IOERR | (int32(1) << 8))
+ return SQLITE_IOERR | int32(1)<<8
}
if (*PmaReader)(unsafe.Pointer(pReadr)).FaMap != 0 {
Xsqlite3OsUnfetch(tls, (*PmaReader)(unsafe.Pointer(pReadr)).FpFd, int64(0), (*PmaReader)(unsafe.Pointer(pReadr)).FaMap)
@@ -75732,10 +76712,10 @@ func vdbePmaReaderSeek(tls *libc.TLS, pTask uintptr, pReadr uintptr, pFile uintp
(*PmaReader)(unsafe.Pointer(pReadr)).FiEof = (*SorterFile)(unsafe.Pointer(pFile)).FiEof
(*PmaReader)(unsafe.Pointer(pReadr)).FpFd = (*SorterFile)(unsafe.Pointer(pFile)).FpFd
- rc = vdbeSorterMapFile(tls, pTask, pFile, (pReadr + 44 /* &.aMap */))
- if (rc == SQLITE_OK) && ((*PmaReader)(unsafe.Pointer(pReadr)).FaMap == uintptr(0)) {
+ rc = vdbeSorterMapFile(tls, pTask, pFile, pReadr+44)
+ if rc == SQLITE_OK && (*PmaReader)(unsafe.Pointer(pReadr)).FaMap == uintptr(0) {
var pgsz int32 = (*VdbeSorter)(unsafe.Pointer((*SortSubtask)(unsafe.Pointer(pTask)).FpSorter)).Fpgsz
- var iBuf int32 = (int32((*PmaReader)(unsafe.Pointer(pReadr)).FiReadOff % I64(pgsz)))
+ var iBuf int32 = int32((*PmaReader)(unsafe.Pointer(pReadr)).FiReadOff % I64(pgsz))
if (*PmaReader)(unsafe.Pointer(pReadr)).FaBuffer == uintptr(0) {
(*PmaReader)(unsafe.Pointer(pReadr)).FaBuffer = Xsqlite3Malloc(tls, uint64(pgsz))
if (*PmaReader)(unsafe.Pointer(pReadr)).FaBuffer == uintptr(0) {
@@ -75743,13 +76723,13 @@ func vdbePmaReaderSeek(tls *libc.TLS, pTask uintptr, pReadr uintptr, pFile uintp
}
(*PmaReader)(unsafe.Pointer(pReadr)).FnBuffer = pgsz
}
- if (rc == SQLITE_OK) && (iBuf != 0) {
- var nRead int32 = (pgsz - iBuf)
- if ((*PmaReader)(unsafe.Pointer(pReadr)).FiReadOff + I64(nRead)) > (*PmaReader)(unsafe.Pointer(pReadr)).FiEof {
- nRead = (int32((*PmaReader)(unsafe.Pointer(pReadr)).FiEof - (*PmaReader)(unsafe.Pointer(pReadr)).FiReadOff))
+ if rc == SQLITE_OK && iBuf != 0 {
+ var nRead int32 = pgsz - iBuf
+ if (*PmaReader)(unsafe.Pointer(pReadr)).FiReadOff+I64(nRead) > (*PmaReader)(unsafe.Pointer(pReadr)).FiEof {
+ nRead = int32((*PmaReader)(unsafe.Pointer(pReadr)).FiEof - (*PmaReader)(unsafe.Pointer(pReadr)).FiReadOff)
}
rc = Xsqlite3OsRead(tls,
- (*PmaReader)(unsafe.Pointer(pReadr)).FpFd, ((*PmaReader)(unsafe.Pointer(pReadr)).FaBuffer + uintptr(iBuf)), nRead, (*PmaReader)(unsafe.Pointer(pReadr)).FiReadOff)
+ (*PmaReader)(unsafe.Pointer(pReadr)).FpFd, (*PmaReader)(unsafe.Pointer(pReadr)).FaBuffer+uintptr(iBuf), nRead, (*PmaReader)(unsafe.Pointer(pReadr)).FiReadOff)
}
}
@@ -75759,7 +76739,7 @@ func vdbePmaReaderSeek(tls *libc.TLS, pTask uintptr, pReadr uintptr, pFile uintp
// Advance PmaReader pReadr to the next key in its PMA. Return SQLITE_OK if
// no error occurs, or an SQLite error code if one does.
-func vdbePmaReaderNext(tls *libc.TLS, pReadr uintptr) int32 { /* sqlite3.c:95994:12: */
+func vdbePmaReaderNext(tls *libc.TLS, pReadr uintptr) int32 { /* sqlite3.c:96360:12: */
bp := tls.Alloc(8)
defer tls.Free(8)
@@ -75771,9 +76751,9 @@ func vdbePmaReaderNext(tls *libc.TLS, pReadr uintptr) int32 { /* sqlite3.c:95994
var bEof int32 = 1
if pIncr != 0 {
rc = vdbeIncrSwap(tls, pIncr)
- if (rc == SQLITE_OK) && ((*IncrMerger)(unsafe.Pointer(pIncr)).FbEof == 0) {
+ if rc == SQLITE_OK && (*IncrMerger)(unsafe.Pointer(pIncr)).FbEof == 0 {
rc = vdbePmaReaderSeek(tls,
- (*IncrMerger)(unsafe.Pointer(pIncr)).FpTask, pReadr, (pIncr + 32 /* &.aFile */), (*IncrMerger)(unsafe.Pointer(pIncr)).FiStartOff)
+ (*IncrMerger)(unsafe.Pointer(pIncr)).FpTask, pReadr, pIncr+32, (*IncrMerger)(unsafe.Pointer(pIncr)).FiStartOff)
bEof = 0
}
}
@@ -75791,7 +76771,7 @@ func vdbePmaReaderNext(tls *libc.TLS, pReadr uintptr) int32 { /* sqlite3.c:95994
}
if rc == SQLITE_OK {
(*PmaReader)(unsafe.Pointer(pReadr)).FnKey = int32(*(*U64)(unsafe.Pointer(bp /* nRec */)))
- rc = vdbePmaReadBlob(tls, pReadr, int32(*(*U64)(unsafe.Pointer(bp /* nRec */))), (pReadr + 32 /* &.aKey */))
+ rc = vdbePmaReadBlob(tls, pReadr, int32(*(*U64)(unsafe.Pointer(bp /* nRec */))), pReadr+32)
}
@@ -75805,7 +76785,7 @@ func vdbePmaReaderNext(tls *libc.TLS, pReadr uintptr) int32 { /* sqlite3.c:95994
//
// If the pnByte parameter is NULL, then it is assumed that the file
// contains a single PMA, and that that PMA omits the initial length varint.
-func vdbePmaReaderInit(tls *libc.TLS, pTask uintptr, pFile uintptr, iStart I64, pReadr uintptr, pnByte uintptr) int32 { /* sqlite3.c:96041:12: */
+func vdbePmaReaderInit(tls *libc.TLS, pTask uintptr, pFile uintptr, iStart I64, pReadr uintptr, pnByte uintptr) int32 { /* sqlite3.c:96407:12: */
bp := tls.Alloc(8)
defer tls.Free(8)
@@ -75815,8 +76795,8 @@ func vdbePmaReaderInit(tls *libc.TLS, pTask uintptr, pFile uintptr, iStart I64,
if rc == SQLITE_OK {
*(*U64)(unsafe.Pointer(bp /* nByte */)) = uint64(0) // Size of PMA in bytes
rc = vdbePmaReadVarint(tls, pReadr, bp /* &nByte */)
- (*PmaReader)(unsafe.Pointer(pReadr)).FiEof = (I64(U64((*PmaReader)(unsafe.Pointer(pReadr)).FiReadOff) + *(*U64)(unsafe.Pointer(bp /* nByte */))))
- *(*I64)(unsafe.Pointer(pnByte)) += I64((*(*U64)(unsafe.Pointer(bp /* nByte */))))
+ (*PmaReader)(unsafe.Pointer(pReadr)).FiEof = I64(U64((*PmaReader)(unsafe.Pointer(pReadr)).FiReadOff) + *(*U64)(unsafe.Pointer(bp)))
+ *(*I64)(unsafe.Pointer(pnByte)) += I64(*(*U64)(unsafe.Pointer(bp)))
}
if rc == SQLITE_OK {
@@ -75828,7 +76808,7 @@ func vdbePmaReaderInit(tls *libc.TLS, pTask uintptr, pFile uintptr, iStart I64,
// A version of vdbeSorterCompare() that assumes that it has already been
// determined that the first field of key1 is equal to the first field of
// key2.
-func vdbeSorterCompareTail(tls *libc.TLS, pTask uintptr, pbKey2Cached uintptr, pKey1 uintptr, nKey1 int32, pKey2 uintptr, nKey2 int32) int32 { /* sqlite3.c:96074:12: */
+func vdbeSorterCompareTail(tls *libc.TLS, pTask uintptr, pbKey2Cached uintptr, pKey1 uintptr, nKey1 int32, pKey2 uintptr, nKey2 int32) int32 { /* sqlite3.c:96440:12: */
var r2 uintptr = (*SortSubtask)(unsafe.Pointer(pTask)).FpUnpacked
if *(*int32)(unsafe.Pointer(pbKey2Cached)) == 0 {
Xsqlite3VdbeRecordUnpack(tls, (*VdbeSorter)(unsafe.Pointer((*SortSubtask)(unsafe.Pointer(pTask)).FpSorter)).FpKeyInfo, nKey2, pKey2, r2)
@@ -75848,7 +76828,7 @@ func vdbeSorterCompareTail(tls *libc.TLS, pTask uintptr, pbKey2Cached uintptr, p
//
// If an OOM error is encountered, (pTask->pUnpacked->error_rc) is set
// to SQLITE_NOMEM.
-func vdbeSorterCompare(tls *libc.TLS, pTask uintptr, pbKey2Cached uintptr, pKey1 uintptr, nKey1 int32, pKey2 uintptr, nKey2 int32) int32 { /* sqlite3.c:96101:12: */
+func vdbeSorterCompare(tls *libc.TLS, pTask uintptr, pbKey2Cached uintptr, pKey1 uintptr, nKey1 int32, pKey2 uintptr, nKey2 int32) int32 { /* sqlite3.c:96467:12: */
var r2 uintptr = (*SortSubtask)(unsafe.Pointer(pTask)).FpUnpacked
if !(*(*int32)(unsafe.Pointer(pbKey2Cached)) != 0) {
Xsqlite3VdbeRecordUnpack(tls, (*VdbeSorter)(unsafe.Pointer((*SortSubtask)(unsafe.Pointer(pTask)).FpSorter)).FpKeyInfo, nKey2, pKey2, r2)
@@ -75860,14 +76840,14 @@ func vdbeSorterCompare(tls *libc.TLS, pTask uintptr, pbKey2Cached uintptr, pKey1
// A specially optimized version of vdbeSorterCompare() that assumes that
// the first field of each key is a TEXT value and that the collation
// sequence to compare them with is BINARY.
-func vdbeSorterCompareText(tls *libc.TLS, pTask uintptr, pbKey2Cached uintptr, pKey1 uintptr, nKey1 int32, pKey2 uintptr, nKey2 int32) int32 { /* sqlite3.c:96120:12: */
+func vdbeSorterCompareText(tls *libc.TLS, pTask uintptr, pbKey2Cached uintptr, pKey1 uintptr, nKey1 int32, pKey2 uintptr, nKey2 int32) int32 { /* sqlite3.c:96486:12: */
bp := tls.Alloc(8)
defer tls.Free(8)
var p1 uintptr = pKey1
var p2 uintptr = pKey2
- var v1 uintptr = (p1 + uintptr(*(*U8)(unsafe.Pointer(p1)))) // Pointer to value 1
- var v2 uintptr = (p2 + uintptr(*(*U8)(unsafe.Pointer(p2)))) // Pointer to value 2
+ var v1 uintptr = p1 + uintptr(*(*U8)(unsafe.Pointer(p1))) // Pointer to value 1
+ var v2 uintptr = p2 + uintptr(*(*U8)(unsafe.Pointer(p2))) // Pointer to value 2
// var n1 int32 at bp, 4
@@ -75875,22 +76855,22 @@ func vdbeSorterCompareText(tls *libc.TLS, pTask uintptr, pbKey2Cached uintptr, p
var res int32
- *(*int32)(unsafe.Pointer(bp /* n1 */)) = int32(U32(*(*U8)(unsafe.Pointer((p1 + 1)))))
- if *(*int32)(unsafe.Pointer(bp /* n1 */)) >= 0x80 {
- Xsqlite3GetVarint32(tls, (p1 + 1), bp /* &n1 */)
+ *(*int32)(unsafe.Pointer(bp /* n1 */)) = int32(U32(*(*U8)(unsafe.Pointer(p1 + 1))))
+ if *(*int32)(unsafe.Pointer(bp)) >= 0x80 {
+ Xsqlite3GetVarint32(tls, p1+1, bp /* &n1 */)
}
- *(*int32)(unsafe.Pointer(bp + 4 /* n2 */)) = int32(U32(*(*U8)(unsafe.Pointer((p2 + 1)))))
- if *(*int32)(unsafe.Pointer(bp + 4 /* n2 */)) >= 0x80 {
- Xsqlite3GetVarint32(tls, (p2 + 1), bp+4 /* &n2 */)
+ *(*int32)(unsafe.Pointer(bp + 4 /* n2 */)) = int32(U32(*(*U8)(unsafe.Pointer(p2 + 1))))
+ if *(*int32)(unsafe.Pointer(bp + 4)) >= 0x80 {
+ Xsqlite3GetVarint32(tls, p2+1, bp+4 /* &n2 */)
}
- res = libc.Xmemcmp(tls, v1, v2, (uint32(((func() int32 {
- if (*(*int32)(unsafe.Pointer(bp /* n1 */))) < (*(*int32)(unsafe.Pointer(bp + 4 /* n2 */))) {
- return *(*int32)(unsafe.Pointer(bp /* n1 */))
+ res = libc.Xmemcmp(tls, v1, v2, uint32((func() int32 {
+ if *(*int32)(unsafe.Pointer(bp)) < *(*int32)(unsafe.Pointer(bp + 4)) {
+ return *(*int32)(unsafe.Pointer(bp))
}
- return *(*int32)(unsafe.Pointer(bp + 4 /* n2 */))
- }()) - 13) / 2)))
+ return *(*int32)(unsafe.Pointer(bp + 4))
+ }()-13)/2))
if res == 0 {
- res = (*(*int32)(unsafe.Pointer(bp /* n1 */)) - *(*int32)(unsafe.Pointer(bp + 4 /* n2 */)))
+ res = *(*int32)(unsafe.Pointer(bp)) - *(*int32)(unsafe.Pointer(bp + 4))
}
if res == 0 {
@@ -75901,7 +76881,7 @@ func vdbeSorterCompareText(tls *libc.TLS, pTask uintptr, pbKey2Cached uintptr, p
} else {
if *(*U8)(unsafe.Pointer((*KeyInfo)(unsafe.Pointer((*VdbeSorter)(unsafe.Pointer((*SortSubtask)(unsafe.Pointer(pTask)).FpSorter)).FpKeyInfo)).FaSortFlags)) != 0 {
- res = (res * -1)
+ res = res * -1
}
}
@@ -75910,23 +76890,23 @@ func vdbeSorterCompareText(tls *libc.TLS, pTask uintptr, pbKey2Cached uintptr, p
// A specially optimized version of vdbeSorterCompare() that assumes that
// the first field of each key is an INTEGER value.
-func vdbeSorterCompareInt(tls *libc.TLS, pTask uintptr, pbKey2Cached uintptr, pKey1 uintptr, nKey1 int32, pKey2 uintptr, nKey2 int32) int32 { /* sqlite3.c:96162:12: */
+func vdbeSorterCompareInt(tls *libc.TLS, pTask uintptr, pbKey2Cached uintptr, pKey1 uintptr, nKey1 int32, pKey2 uintptr, nKey2 int32) int32 { /* sqlite3.c:96528:12: */
var p1 uintptr = pKey1
var p2 uintptr = pKey2
- var s1 int32 = int32(*(*U8)(unsafe.Pointer(p1 + 1))) // Left hand serial type
- var s2 int32 = int32(*(*U8)(unsafe.Pointer(p2 + 1))) // Right hand serial type
- var v1 uintptr = (p1 + uintptr(*(*U8)(unsafe.Pointer(p1)))) // Pointer to value 1
- var v2 uintptr = (p2 + uintptr(*(*U8)(unsafe.Pointer(p2)))) // Pointer to value 2
- var res int32 // Return value
+ var s1 int32 = int32(*(*U8)(unsafe.Pointer(p1 + 1))) // Left hand serial type
+ var s2 int32 = int32(*(*U8)(unsafe.Pointer(p2 + 1))) // Right hand serial type
+ var v1 uintptr = p1 + uintptr(*(*U8)(unsafe.Pointer(p1))) // Pointer to value 1
+ var v2 uintptr = p2 + uintptr(*(*U8)(unsafe.Pointer(p2))) // Pointer to value 2
+ var res int32 // Return value
if s1 == s2 {
var n U8 = aLen[s1]
var i int32
res = 0
for i = 0; i < int32(n); i++ {
- if (libc.AssignInt32(&res, (int32(*(*U8)(unsafe.Pointer(v1 + uintptr(i)))) - int32(*(*U8)(unsafe.Pointer(v2 + uintptr(i))))))) != 0 {
- if ((int32(*(*U8)(unsafe.Pointer(v1))) ^ int32(*(*U8)(unsafe.Pointer(v2)))) & 0x80) != 0 {
- if (int32(*(*U8)(unsafe.Pointer(v1))) & 0x80) != 0 {
+ if libc.AssignInt32(&res, int32(*(*U8)(unsafe.Pointer(v1 + uintptr(i))))-int32(*(*U8)(unsafe.Pointer(v2 + uintptr(i))))) != 0 {
+ if (int32(*(*U8)(unsafe.Pointer(v1)))^int32(*(*U8)(unsafe.Pointer(v2))))&0x80 != 0 {
+ if int32(*(*U8)(unsafe.Pointer(v1)))&0x80 != 0 {
res = -1
} else {
res = +1
@@ -75935,23 +76915,23 @@ func vdbeSorterCompareInt(tls *libc.TLS, pTask uintptr, pbKey2Cached uintptr, pK
break
}
}
- } else if (s1 > 7) && (s2 > 7) {
- res = (s1 - s2)
+ } else if s1 > 7 && s2 > 7 {
+ res = s1 - s2
} else {
if s2 > 7 {
res = +1
} else if s1 > 7 {
res = -1
} else {
- res = (s1 - s2)
+ res = s1 - s2
}
if res > 0 {
- if (int32(*(*U8)(unsafe.Pointer(v1))) & 0x80) != 0 {
+ if int32(*(*U8)(unsafe.Pointer(v1)))&0x80 != 0 {
res = -1
}
} else {
- if (int32(*(*U8)(unsafe.Pointer(v2))) & 0x80) != 0 {
+ if int32(*(*U8)(unsafe.Pointer(v2)))&0x80 != 0 {
res = +1
}
}
@@ -75964,13 +76944,13 @@ func vdbeSorterCompareInt(tls *libc.TLS, pTask uintptr, pbKey2Cached uintptr, pK
}
} else if *(*U8)(unsafe.Pointer((*KeyInfo)(unsafe.Pointer((*VdbeSorter)(unsafe.Pointer((*SortSubtask)(unsafe.Pointer(pTask)).FpSorter)).FpKeyInfo)).FaSortFlags)) != 0 {
- res = (res * -1)
+ res = res * -1
}
return res
}
-var aLen = [10]U8{U8(0), U8(1), U8(2), U8(3), U8(4), U8(6), U8(8), U8(0), U8(0), U8(0)} /* sqlite3.c:96181:21 */
+var aLen = [10]U8{U8(0), U8(1), U8(2), U8(3), U8(4), U8(6), U8(8), U8(0), U8(0), U8(0)} /* sqlite3.c:96547:21 */
// Initialize the temporary index cursor just opened as a sorter cursor.
//
@@ -75989,7 +76969,7 @@ var aLen = [10]U8{U8(0), U8(1), U8(2), U8(3), U8(4), U8(6), U8(8), U8(0), U8(0),
// mode, but not in multi-threaded mode.
//
// SQLITE_OK is returned if successful, or an SQLite error code otherwise.
-func Xsqlite3VdbeSorterInit(tls *libc.TLS, db uintptr, nField int32, pCsr uintptr) int32 { /* sqlite3.c:96245:20: */
+func Xsqlite3VdbeSorterInit(tls *libc.TLS, db uintptr, nField int32, pCsr uintptr) int32 { /* sqlite3.c:96611:20: */
var pgsz int32 // Page size of main database
var i int32 // Used to iterate through aTask[]
var pSorter uintptr // The new sorter
@@ -76000,63 +76980,63 @@ func Xsqlite3VdbeSorterInit(tls *libc.TLS, db uintptr, nField int32, pCsr uintpt
var nWorker int32
// Initialize the upper limit on the number of worker threads
- if (Xsqlite3TempInMemory(tls, db) != 0) || (int32(Xsqlite3Config.FbCoreMutex) == 0) {
+ if Xsqlite3TempInMemory(tls, db) != 0 || int32(Xsqlite3Config.FbCoreMutex) == 0 {
nWorker = 0
} else {
- nWorker = *(*int32)(unsafe.Pointer((db + 112 /* &.aLimit */) + 11*4))
+ nWorker = *(*int32)(unsafe.Pointer(db + 120 + 11*4))
}
// Do not allow the total number of threads (main thread + all workers)
// to exceed the maximum merge count
- szKeyInfo = (int32(uint32(unsafe.Sizeof(KeyInfo{})) + ((uint32(int32((*KeyInfo)(unsafe.Pointer((*VdbeCursor)(unsafe.Pointer(pCsr)).FpKeyInfo)).FnKeyField) - 1)) * uint32(unsafe.Sizeof(uintptr(0))))))
- sz = (int32(uint32(unsafe.Sizeof(VdbeSorter{})) + (uint32(nWorker) * uint32(unsafe.Sizeof(SortSubtask{})))))
+ szKeyInfo = int32(uint32(unsafe.Sizeof(KeyInfo{})) + uint32(int32((*KeyInfo)(unsafe.Pointer((*VdbeCursor)(unsafe.Pointer(pCsr)).FpKeyInfo)).FnKeyField)-1)*uint32(unsafe.Sizeof(uintptr(0))))
+ sz = int32(uint32(unsafe.Sizeof(VdbeSorter{})) + uint32(nWorker)*uint32(unsafe.Sizeof(SortSubtask{})))
- pSorter = Xsqlite3DbMallocZero(tls, db, (uint64(sz + szKeyInfo)))
- *(*uintptr)(unsafe.Pointer(pCsr + 40 /* &.uc */)) = pSorter
+ pSorter = Xsqlite3DbMallocZero(tls, db, uint64(sz+szKeyInfo))
+ *(*uintptr)(unsafe.Pointer(pCsr + 40)) = pSorter
if pSorter == uintptr(0) {
rc = SQLITE_NOMEM
} else {
var pBt uintptr = (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb)).FpBt
- (*VdbeSorter)(unsafe.Pointer(pSorter)).FpKeyInfo = libc.AssignUintptr(&pKeyInfo, (pSorter + uintptr(sz)))
+ (*VdbeSorter)(unsafe.Pointer(pSorter)).FpKeyInfo = libc.AssignUintptr(&pKeyInfo, pSorter+uintptr(sz))
libc.Xmemcpy(tls, pKeyInfo, (*VdbeCursor)(unsafe.Pointer(pCsr)).FpKeyInfo, uint32(szKeyInfo))
(*KeyInfo)(unsafe.Pointer(pKeyInfo)).Fdb = uintptr(0)
- if (nField != 0) && (nWorker == 0) {
+ if nField != 0 && nWorker == 0 {
(*KeyInfo)(unsafe.Pointer(pKeyInfo)).FnKeyField = U16(nField)
}
Xsqlite3BtreeEnter(tls, pBt)
(*VdbeSorter)(unsafe.Pointer(pSorter)).Fpgsz = libc.AssignInt32(&pgsz, Xsqlite3BtreeGetPageSize(tls, pBt))
Xsqlite3BtreeLeave(tls, pBt)
- (*VdbeSorter)(unsafe.Pointer(pSorter)).FnTask = (U8(nWorker + 1))
- (*VdbeSorter)(unsafe.Pointer(pSorter)).FiPrev = (U8(nWorker - 1))
- (*VdbeSorter)(unsafe.Pointer(pSorter)).FbUseThreads = (U8(libc.Bool32(int32((*VdbeSorter)(unsafe.Pointer(pSorter)).FnTask) > 1)))
+ (*VdbeSorter)(unsafe.Pointer(pSorter)).FnTask = U8(nWorker + 1)
+ (*VdbeSorter)(unsafe.Pointer(pSorter)).FiPrev = U8(nWorker - 1)
+ (*VdbeSorter)(unsafe.Pointer(pSorter)).FbUseThreads = U8(libc.Bool32(int32((*VdbeSorter)(unsafe.Pointer(pSorter)).FnTask) > 1))
(*VdbeSorter)(unsafe.Pointer(pSorter)).Fdb = db
for i = 0; i < int32((*VdbeSorter)(unsafe.Pointer(pSorter)).FnTask); i++ {
- var pTask uintptr = ((pSorter + 64 /* &.aTask */) + uintptr(i)*72)
+ var pTask uintptr = pSorter + 64 + uintptr(i)*72
(*SortSubtask)(unsafe.Pointer(pTask)).FpSorter = pSorter
}
if !(Xsqlite3TempInMemory(tls, db) != 0) {
var mxCache I64 // Cache size in bytes
var szPma U32 = Xsqlite3Config.FszPma
- (*VdbeSorter)(unsafe.Pointer(pSorter)).FmnPmaSize = (int32(szPma * U32(pgsz)))
+ (*VdbeSorter)(unsafe.Pointer(pSorter)).FmnPmaSize = int32(szPma * U32(pgsz))
mxCache = I64((*Schema)(unsafe.Pointer((*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb)).FpSchema)).Fcache_size)
if mxCache < int64(0) {
// A negative cache-size value C indicates that the cache is abs(C)
// KiB in size.
- mxCache = (mxCache * int64(-1024))
+ mxCache = mxCache * int64(-1024)
} else {
- mxCache = (mxCache * I64(pgsz))
+ mxCache = mxCache * I64(pgsz)
}
mxCache = func() int64 {
- if (mxCache) < (int64(int32(1) << 29)) {
+ if mxCache < int64(int32(1)<<29) {
return mxCache
}
- return (int64(int32(1) << 29))
+ return int64(int32(1) << 29)
}()
(*VdbeSorter)(unsafe.Pointer(pSorter)).FmxPmaSize = func() int32 {
- if ((*VdbeSorter)(unsafe.Pointer(pSorter)).FmnPmaSize) > (int32(mxCache)) {
+ if (*VdbeSorter)(unsafe.Pointer(pSorter)).FmnPmaSize > int32(mxCache) {
return (*VdbeSorter)(unsafe.Pointer(pSorter)).FmnPmaSize
}
return int32(mxCache)
@@ -76074,10 +77054,10 @@ func Xsqlite3VdbeSorterInit(tls *libc.TLS, db uintptr, nField int32, pCsr uintpt
}
}
- if ((int32((*KeyInfo)(unsafe.Pointer(pKeyInfo)).FnAllField) < 13) &&
- ((*(*uintptr)(unsafe.Pointer((pKeyInfo + 20 /* &.aColl */))) == uintptr(0)) || (*(*uintptr)(unsafe.Pointer((pKeyInfo + 20 /* &.aColl */))) == (*Sqlite3)(unsafe.Pointer(db)).FpDfltColl))) &&
- ((int32(*(*U8)(unsafe.Pointer((*KeyInfo)(unsafe.Pointer(pKeyInfo)).FaSortFlags))) & KEYINFO_ORDER_BIGNULL) == 0) {
- (*VdbeSorter)(unsafe.Pointer(pSorter)).FtypeMask = (U8(SORTER_TYPE_INTEGER | SORTER_TYPE_TEXT))
+ if int32((*KeyInfo)(unsafe.Pointer(pKeyInfo)).FnAllField) < 13 &&
+ (*(*uintptr)(unsafe.Pointer(pKeyInfo + 20)) == uintptr(0) || *(*uintptr)(unsafe.Pointer(pKeyInfo + 20)) == (*Sqlite3)(unsafe.Pointer(db)).FpDfltColl) &&
+ int32(*(*U8)(unsafe.Pointer((*KeyInfo)(unsafe.Pointer(pKeyInfo)).FaSortFlags)))&KEYINFO_ORDER_BIGNULL == 0 {
+ (*VdbeSorter)(unsafe.Pointer(pSorter)).FtypeMask = U8(SORTER_TYPE_INTEGER | SORTER_TYPE_TEXT)
}
}
@@ -76085,18 +77065,18 @@ func Xsqlite3VdbeSorterInit(tls *libc.TLS, db uintptr, nField int32, pCsr uintpt
}
// Free the list of sorted records starting at pRecord.
-func vdbeSorterRecordFree(tls *libc.TLS, db uintptr, pRecord uintptr) { /* sqlite3.c:96350:13: */
+func vdbeSorterRecordFree(tls *libc.TLS, db uintptr, pRecord uintptr) { /* sqlite3.c:96716:13: */
var p uintptr
var pNext uintptr
for p = pRecord; p != 0; p = pNext {
- pNext = *(*uintptr)(unsafe.Pointer(p + 4 /* &.u */))
+ pNext = *(*uintptr)(unsafe.Pointer(p + 4))
Xsqlite3DbFree(tls, db, p)
}
}
// Free all resources owned by the object indicated by argument pTask. All
// fields of *pTask are zeroed before returning.
-func vdbeSortSubtaskCleanup(tls *libc.TLS, db uintptr, pTask uintptr) { /* sqlite3.c:96363:13: */
+func vdbeSortSubtaskCleanup(tls *libc.TLS, db uintptr, pTask uintptr) { /* sqlite3.c:96729:13: */
Xsqlite3DbFree(tls, db, (*SortSubtask)(unsafe.Pointer(pTask)).FpUnpacked)
// pTask->list.aMemory can only be non-zero if it was handed memory
// from the main thread. That only occurs SQLITE_MAX_WORKER_THREADS>0
@@ -76116,7 +77096,7 @@ func vdbeSortSubtaskCleanup(tls *libc.TLS, db uintptr, pTask uintptr) { /* sqlit
}
// Join thread pTask->thread.
-func vdbeSorterJoinThread(tls *libc.TLS, pTask uintptr) int32 { /* sqlite3.c:96429:12: */
+func vdbeSorterJoinThread(tls *libc.TLS, pTask uintptr) int32 { /* sqlite3.c:96795:12: */
bp := tls.Alloc(4)
defer tls.Free(4)
@@ -76126,7 +77106,7 @@ func vdbeSorterJoinThread(tls *libc.TLS, pTask uintptr) int32 { /* sqlite3.c:964
Xsqlite3ThreadJoin(tls, (*SortSubtask)(unsafe.Pointer(pTask)).FpThread, bp /* &pRet */)
- rc = int32(*(*uintptr)(unsafe.Pointer(bp /* pRet */)))
+ rc = int32(*(*uintptr)(unsafe.Pointer(bp)))
(*SortSubtask)(unsafe.Pointer(pTask)).FbDone = 0
(*SortSubtask)(unsafe.Pointer(pTask)).FpThread = uintptr(0)
@@ -76135,14 +77115,14 @@ func vdbeSorterJoinThread(tls *libc.TLS, pTask uintptr) int32 { /* sqlite3.c:964
}
// Launch a background thread to run xTask(pIn).
-func vdbeSorterCreateThread(tls *libc.TLS, pTask uintptr, xTask uintptr, pIn uintptr) int32 { /* sqlite3.c:96450:12: */
+func vdbeSorterCreateThread(tls *libc.TLS, pTask uintptr, xTask uintptr, pIn uintptr) int32 { /* sqlite3.c:96816:12: */
- return Xsqlite3ThreadCreate(tls, (pTask /* &.pThread */), xTask, pIn)
+ return Xsqlite3ThreadCreate(tls, pTask, xTask, pIn)
}
// Join all outstanding threads launched by SorterWrite() to create
// level-0 PMAs.
-func vdbeSorterJoinAll(tls *libc.TLS, pSorter uintptr, rcin int32) int32 { /* sqlite3.c:96463:12: */
+func vdbeSorterJoinAll(tls *libc.TLS, pSorter uintptr, rcin int32) int32 { /* sqlite3.c:96829:12: */
var rc int32 = rcin
var i int32
@@ -76153,8 +77133,8 @@ func vdbeSorterJoinAll(tls *libc.TLS, pSorter uintptr, rcin int32) int32 { /* sq
// is currently attempt to join one of the other threads. To avoid a race
// condition where this thread also attempts to join the same object, join
// thread pSorter->aTask[pSorter->nTask-1].pThread first.
- for i = (int32((*VdbeSorter)(unsafe.Pointer(pSorter)).FnTask) - 1); i >= 0; i-- {
- var pTask uintptr = ((pSorter + 64 /* &.aTask */) + uintptr(i)*72)
+ for i = int32((*VdbeSorter)(unsafe.Pointer(pSorter)).FnTask) - 1; i >= 0; i-- {
+ var pTask uintptr = pSorter + 64 + uintptr(i)*72
var rc2 int32 = vdbeSorterJoinThread(tls, pTask)
if rc == SQLITE_OK {
rc = rc2
@@ -76168,15 +77148,15 @@ func vdbeSorterJoinAll(tls *libc.TLS, pSorter uintptr, rcin int32) int32 { /* sq
//
// nReader is automatically rounded up to the next power of two.
// nReader may not exceed SORTER_MAX_MERGE_COUNT even after rounding up.
-func vdbeMergeEngineNew(tls *libc.TLS, nReader int32) uintptr { /* sqlite3.c:96493:20: */
+func vdbeMergeEngineNew(tls *libc.TLS, nReader int32) uintptr { /* sqlite3.c:96859:20: */
var N int32 = 2 // Smallest power of two >= nReader
var nByte int32 // Total bytes of space to allocate
var pNew uintptr // Pointer to allocated object to return
for N < nReader {
- N = N + (N)
+ N = N + N
}
- nByte = (int32(uint32(unsafe.Sizeof(MergeEngine{})) + (uint32(N) * (uint32(unsafe.Sizeof(int32(0))) + uint32(unsafe.Sizeof(PmaReader{}))))))
+ nByte = int32(uint32(unsafe.Sizeof(MergeEngine{})) + uint32(N)*(uint32(unsafe.Sizeof(int32(0)))+uint32(unsafe.Sizeof(PmaReader{}))))
if Xsqlite3FaultSim(tls, 100) != 0 {
pNew = uintptr(0)
@@ -76186,18 +77166,18 @@ func vdbeMergeEngineNew(tls *libc.TLS, nReader int32) uintptr { /* sqlite3.c:964
if pNew != 0 {
(*MergeEngine)(unsafe.Pointer(pNew)).FnTree = N
(*MergeEngine)(unsafe.Pointer(pNew)).FpTask = uintptr(0)
- (*MergeEngine)(unsafe.Pointer(pNew)).FaReadr = (pNew + 1*16)
- (*MergeEngine)(unsafe.Pointer(pNew)).FaTree = ((*MergeEngine)(unsafe.Pointer(pNew)).FaReadr + uintptr(N)*56)
+ (*MergeEngine)(unsafe.Pointer(pNew)).FaReadr = pNew + 1*16
+ (*MergeEngine)(unsafe.Pointer(pNew)).FaTree = (*MergeEngine)(unsafe.Pointer(pNew)).FaReadr + uintptr(N)*56
}
return pNew
}
// Free the MergeEngine object passed as the only argument.
-func vdbeMergeEngineFree(tls *libc.TLS, pMerger uintptr) { /* sqlite3.c:96516:13: */
+func vdbeMergeEngineFree(tls *libc.TLS, pMerger uintptr) { /* sqlite3.c:96882:13: */
var i int32
if pMerger != 0 {
for i = 0; i < (*MergeEngine)(unsafe.Pointer(pMerger)).FnTree; i++ {
- vdbePmaReaderClear(tls, ((*MergeEngine)(unsafe.Pointer(pMerger)).FaReadr + uintptr(i)*56))
+ vdbePmaReaderClear(tls, (*MergeEngine)(unsafe.Pointer(pMerger)).FaReadr+uintptr(i)*56)
}
}
Xsqlite3_free(tls, pMerger)
@@ -76205,15 +77185,15 @@ func vdbeMergeEngineFree(tls *libc.TLS, pMerger uintptr) { /* sqlite3.c:96516:13
// Free all resources associated with the IncrMerger object indicated by
// the first argument.
-func vdbeIncrFree(tls *libc.TLS, pIncr uintptr) { /* sqlite3.c:96530:13: */
+func vdbeIncrFree(tls *libc.TLS, pIncr uintptr) { /* sqlite3.c:96896:13: */
if pIncr != 0 {
if (*IncrMerger)(unsafe.Pointer(pIncr)).FbUseThread != 0 {
vdbeSorterJoinThread(tls, (*IncrMerger)(unsafe.Pointer(pIncr)).FpTask)
- if (*SorterFile)(unsafe.Pointer((pIncr + 32 /* &.aFile */))).FpFd != 0 {
- Xsqlite3OsCloseFree(tls, (*SorterFile)(unsafe.Pointer((pIncr + 32 /* &.aFile */))).FpFd)
+ if (*SorterFile)(unsafe.Pointer(pIncr+32)).FpFd != 0 {
+ Xsqlite3OsCloseFree(tls, (*SorterFile)(unsafe.Pointer(pIncr+32)).FpFd)
}
- if (*SorterFile)(unsafe.Pointer((pIncr+32 /* &.aFile */)+1*16)).FpFd != 0 {
- Xsqlite3OsCloseFree(tls, (*SorterFile)(unsafe.Pointer((pIncr+32 /* &.aFile */)+1*16)).FpFd)
+ if (*SorterFile)(unsafe.Pointer(pIncr+32+1*16)).FpFd != 0 {
+ Xsqlite3OsCloseFree(tls, (*SorterFile)(unsafe.Pointer(pIncr+32+1*16)).FpFd)
}
}
vdbeMergeEngineFree(tls, (*IncrMerger)(unsafe.Pointer(pIncr)).FpMerger)
@@ -76222,7 +77202,7 @@ func vdbeIncrFree(tls *libc.TLS, pIncr uintptr) { /* sqlite3.c:96530:13: */
}
// Reset a sorting cursor back to its original empty state.
-func Xsqlite3VdbeSorterReset(tls *libc.TLS, db uintptr, pSorter uintptr) { /* sqlite3.c:96547:21: */
+func Xsqlite3VdbeSorterReset(tls *libc.TLS, db uintptr, pSorter uintptr) { /* sqlite3.c:96913:21: */
var i int32
vdbeSorterJoinAll(tls, pSorter, SQLITE_OK)
@@ -76234,7 +77214,7 @@ func Xsqlite3VdbeSorterReset(tls *libc.TLS, db uintptr, pSorter uintptr) { /* sq
vdbeMergeEngineFree(tls, (*VdbeSorter)(unsafe.Pointer(pSorter)).FpMerger)
(*VdbeSorter)(unsafe.Pointer(pSorter)).FpMerger = uintptr(0)
for i = 0; i < int32((*VdbeSorter)(unsafe.Pointer(pSorter)).FnTask); i++ {
- var pTask uintptr = ((pSorter + 64 /* &.aTask */) + uintptr(i)*72)
+ var pTask uintptr = pSorter + 64 + uintptr(i)*72
vdbeSortSubtaskCleanup(tls, db, pTask)
(*SortSubtask)(unsafe.Pointer(pTask)).FpSorter = pSorter
}
@@ -76251,15 +77231,15 @@ func Xsqlite3VdbeSorterReset(tls *libc.TLS, db uintptr, pSorter uintptr) { /* sq
}
// Free any cursor components allocated by sqlite3VdbeSorterXXX routines.
-func Xsqlite3VdbeSorterClose(tls *libc.TLS, db uintptr, pCsr uintptr) { /* sqlite3.c:96580:21: */
+func Xsqlite3VdbeSorterClose(tls *libc.TLS, db uintptr, pCsr uintptr) { /* sqlite3.c:96946:21: */
var pSorter uintptr
- pSorter = *(*uintptr)(unsafe.Pointer(pCsr + 40 /* &.uc */))
+ pSorter = *(*uintptr)(unsafe.Pointer(pCsr + 40))
if pSorter != 0 {
Xsqlite3VdbeSorterReset(tls, db, pSorter)
Xsqlite3_free(tls, (*VdbeSorter)(unsafe.Pointer(pSorter)).Flist.FaMemory)
Xsqlite3DbFree(tls, db, pSorter)
- *(*uintptr)(unsafe.Pointer(pCsr + 40 /* &.uc */)) = uintptr(0)
+ *(*uintptr)(unsafe.Pointer(pCsr + 40)) = uintptr(0)
}
}
@@ -76270,36 +77250,38 @@ func Xsqlite3VdbeSorterClose(tls *libc.TLS, db uintptr, pCsr uintptr) { /* sqlit
//
// Whether or not the file does end up memory mapped of course depends on
// the specific VFS implementation.
-func vdbeSorterExtendFile(tls *libc.TLS, db uintptr, pFd uintptr, nByte I64) { /* sqlite3.c:96602:13: */
+func vdbeSorterExtendFile(tls *libc.TLS, db uintptr, pFd uintptr, nByte I64) { /* sqlite3.c:96968:13: */
bp := tls.Alloc(20)
defer tls.Free(20)
*(*I64)(unsafe.Pointer(bp + 8)) = nByte
- if (*(*I64)(unsafe.Pointer(bp + 8 /* nByte */)) <= (I64((*Sqlite3)(unsafe.Pointer(db)).FnMaxSorterMmap))) && ((*sqlite3_io_methods)(unsafe.Pointer((*Sqlite3_file)(unsafe.Pointer(pFd)).FpMethods)).FiVersion >= 3) {
+ if *(*I64)(unsafe.Pointer(bp + 8)) <= I64((*Sqlite3)(unsafe.Pointer(db)).FnMaxSorterMmap) && (*sqlite3_io_methods)(unsafe.Pointer((*Sqlite3_file)(unsafe.Pointer(pFd)).FpMethods)).FiVersion >= 3 {
*(*uintptr)(unsafe.Pointer(bp + 16 /* p */)) = uintptr(0)
- *(*int32)(unsafe.Pointer(bp /* chunksize */)) = (4 * 1024)
+ *(*int32)(unsafe.Pointer(bp /* chunksize */)) = 4 * 1024
Xsqlite3OsFileControlHint(tls, pFd, SQLITE_FCNTL_CHUNK_SIZE, bp /* &chunksize */)
Xsqlite3OsFileControlHint(tls, pFd, SQLITE_FCNTL_SIZE_HINT, bp+8 /* &nByte */)
Xsqlite3OsFetch(tls, pFd, int64(0), int32(*(*I64)(unsafe.Pointer(bp + 8 /* nByte */))), bp+16 /* &p */)
- Xsqlite3OsUnfetch(tls, pFd, int64(0), *(*uintptr)(unsafe.Pointer(bp + 16 /* p */)))
+ if *(*uintptr)(unsafe.Pointer(bp + 16)) != 0 {
+ Xsqlite3OsUnfetch(tls, pFd, int64(0), *(*uintptr)(unsafe.Pointer(bp + 16 /* p */)))
+ }
}
}
// Allocate space for a file-handle and open a temporary file. If successful,
// set *ppFd to point to the malloc'd file-handle and return SQLITE_OK.
// Otherwise, set *ppFd to 0 and return an SQLite error code.
-func vdbeSorterOpenTempFile(tls *libc.TLS, db uintptr, nExtend I64, ppFd uintptr) int32 { /* sqlite3.c:96621:12: */
+func vdbeSorterOpenTempFile(tls *libc.TLS, db uintptr, nExtend I64, ppFd uintptr) int32 { /* sqlite3.c:96987:12: */
bp := tls.Alloc(16)
defer tls.Free(16)
// var rc int32 at bp, 4
if Xsqlite3FaultSim(tls, 202) != 0 {
- return (SQLITE_IOERR | (int32(13) << 8))
+ return SQLITE_IOERR | int32(13)<<8
}
*(*int32)(unsafe.Pointer(bp /* rc */)) = Xsqlite3OsOpenMalloc(tls, (*Sqlite3)(unsafe.Pointer(db)).FpVfs, uintptr(0), ppFd,
- ((((SQLITE_OPEN_TEMP_JOURNAL | SQLITE_OPEN_READWRITE) | SQLITE_OPEN_CREATE) | SQLITE_OPEN_EXCLUSIVE) | SQLITE_OPEN_DELETEONCLOSE), bp /* &rc */)
- if *(*int32)(unsafe.Pointer(bp /* rc */)) == SQLITE_OK {
+ SQLITE_OPEN_TEMP_JOURNAL|SQLITE_OPEN_READWRITE|SQLITE_OPEN_CREATE|SQLITE_OPEN_EXCLUSIVE|SQLITE_OPEN_DELETEONCLOSE, bp /* &rc */)
+ if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK {
*(*I64)(unsafe.Pointer(bp + 8 /* max */)) = int64(SQLITE_MAX_MMAP_SIZE)
Xsqlite3OsFileControlHint(tls, *(*uintptr)(unsafe.Pointer(ppFd)), SQLITE_FCNTL_MMAP_SIZE, bp+8 /* &max */)
if nExtend > int64(0) {
@@ -76312,7 +77294,7 @@ func vdbeSorterOpenTempFile(tls *libc.TLS, db uintptr, nExtend I64, ppFd uintptr
// If it has not already been allocated, allocate the UnpackedRecord
// structure at pTask->pUnpacked. Return SQLITE_OK if successful (or
// if no allocation was required), or SQLITE_NOMEM otherwise.
-func vdbeSortAllocUnpacked(tls *libc.TLS, pTask uintptr) int32 { /* sqlite3.c:96648:12: */
+func vdbeSortAllocUnpacked(tls *libc.TLS, pTask uintptr) int32 { /* sqlite3.c:97014:12: */
if (*SortSubtask)(unsafe.Pointer(pTask)).FpUnpacked == uintptr(0) {
(*SortSubtask)(unsafe.Pointer(pTask)).FpUnpacked = Xsqlite3VdbeAllocUnpackedRecord(tls, (*VdbeSorter)(unsafe.Pointer((*SortSubtask)(unsafe.Pointer(pTask)).FpSorter)).FpKeyInfo)
if (*SortSubtask)(unsafe.Pointer(pTask)).FpUnpacked == uintptr(0) {
@@ -76325,7 +77307,7 @@ func vdbeSortAllocUnpacked(tls *libc.TLS, pTask uintptr) int32 { /* sqlite3.c:96
}
// Merge the two sorted lists p1 and p2 into a single list.
-func vdbeSorterMerge(tls *libc.TLS, pTask uintptr, p1 uintptr, p2 uintptr) uintptr { /* sqlite3.c:96662:21: */
+func vdbeSorterMerge(tls *libc.TLS, pTask uintptr, p1 uintptr, p2 uintptr) uintptr { /* sqlite3.c:97028:21: */
bp := tls.Alloc(8)
defer tls.Free(8)
@@ -76338,20 +77320,20 @@ func vdbeSorterMerge(tls *libc.TLS, pTask uintptr, p1 uintptr, p2 uintptr) uintp
res = (*struct {
f func(*libc.TLS, uintptr, uintptr, uintptr, int32, uintptr, int32) int32
})(unsafe.Pointer(&struct{ uintptr }{(*SortSubtask)(unsafe.Pointer(pTask)).FxCompare})).f(tls,
- pTask, bp+4 /* &bCached */, ((p1) + uintptr(1)*8), (*SorterRecord)(unsafe.Pointer(p1)).FnVal, ((p2) + uintptr(1)*8), (*SorterRecord)(unsafe.Pointer(p2)).FnVal)
+ pTask, bp+4 /* &bCached */, p1+uintptr(1)*8, (*SorterRecord)(unsafe.Pointer(p1)).FnVal, p2+uintptr(1)*8, (*SorterRecord)(unsafe.Pointer(p2)).FnVal)
if res <= 0 {
*(*uintptr)(unsafe.Pointer(pp)) = p1
- pp = (p1 + 4 /* &.u */ /* &.pNext */)
- p1 = *(*uintptr)(unsafe.Pointer(p1 + 4 /* &.u */))
+ pp = p1 + 4
+ p1 = *(*uintptr)(unsafe.Pointer(p1 + 4))
if p1 == uintptr(0) {
*(*uintptr)(unsafe.Pointer(pp)) = p2
break
}
} else {
*(*uintptr)(unsafe.Pointer(pp)) = p2
- pp = (p2 + 4 /* &.u */ /* &.pNext */)
- p2 = *(*uintptr)(unsafe.Pointer(p2 + 4 /* &.u */))
+ pp = p2 + 4
+ p2 = *(*uintptr)(unsafe.Pointer(p2 + 4))
*(*int32)(unsafe.Pointer(bp + 4 /* bCached */)) = 0
if p2 == uintptr(0) {
*(*uintptr)(unsafe.Pointer(pp)) = p1
@@ -76364,7 +77346,7 @@ func vdbeSorterMerge(tls *libc.TLS, pTask uintptr, p1 uintptr, p2 uintptr) uintp
// Return the SorterCompare function to compare values collected by the
// sorter object passed as the only argument.
-func vdbeSorterGetCompare(tls *libc.TLS, p uintptr) SorterCompare { /* sqlite3.c:96704:22: */
+func vdbeSorterGetCompare(tls *libc.TLS, p uintptr) SorterCompare { /* sqlite3.c:97070:22: */
if int32((*VdbeSorter)(unsafe.Pointer(p)).FtypeMask) == SORTER_TYPE_INTEGER {
return *(*uintptr)(unsafe.Pointer(&struct {
f func(*libc.TLS, uintptr, uintptr, uintptr, int32, uintptr, int32) int32
@@ -76382,7 +77364,7 @@ func vdbeSorterGetCompare(tls *libc.TLS, p uintptr) SorterCompare { /* sqlite3.c
// Sort the linked list of records headed at pTask->pList. Return
// SQLITE_OK if successful, or an SQLite error code (i.e. SQLITE_NOMEM) if
// an error occurs.
-func vdbeSorterSort(tls *libc.TLS, pTask uintptr, pList uintptr) int32 { /* sqlite3.c:96718:12: */
+func vdbeSorterSort(tls *libc.TLS, pTask uintptr, pList uintptr) int32 { /* sqlite3.c:97084:12: */
bp := tls.Alloc(256)
defer tls.Free(256)
@@ -76407,13 +77389,13 @@ func vdbeSorterSort(tls *libc.TLS, pTask uintptr, pList uintptr) int32 { /* sqli
pNext = uintptr(0)
} else {
- pNext = ((*SorterList)(unsafe.Pointer(pList)).FaMemory + uintptr(*(*int32)(unsafe.Pointer(p + 4 /* &.u */))))
+ pNext = (*SorterList)(unsafe.Pointer(pList)).FaMemory + uintptr(*(*int32)(unsafe.Pointer(p + 4)))
}
} else {
- pNext = *(*uintptr)(unsafe.Pointer(p + 4 /* &.u */))
+ pNext = *(*uintptr)(unsafe.Pointer(p + 4))
}
- *(*uintptr)(unsafe.Pointer(p + 4 /* &.u */)) = uintptr(0)
+ *(*uintptr)(unsafe.Pointer(p + 4)) = uintptr(0)
for i = 0; *(*uintptr)(unsafe.Pointer(bp /* &aSlot[0] */ + uintptr(i)*4)) != 0; i++ {
p = vdbeSorterMerge(tls, pTask, p, *(*uintptr)(unsafe.Pointer(bp /* &aSlot[0] */ + uintptr(i)*4)))
*(*uintptr)(unsafe.Pointer(bp /* &aSlot[0] */ + uintptr(i)*4)) = uintptr(0)
@@ -76423,8 +77405,8 @@ func vdbeSorterSort(tls *libc.TLS, pTask uintptr, pList uintptr) int32 { /* sqli
}
p = uintptr(0)
- for i = 0; i < (int32(uint32(unsafe.Sizeof([64]uintptr{})) / uint32(unsafe.Sizeof(uintptr(0))))); i++ {
- if *(*uintptr)(unsafe.Pointer(bp /* &aSlot[0] */ + uintptr(i)*4)) == uintptr(0) {
+ for i = 0; i < int32(uint32(unsafe.Sizeof([64]uintptr{}))/uint32(unsafe.Sizeof(uintptr(0)))); i++ {
+ if *(*uintptr)(unsafe.Pointer(bp + uintptr(i)*4)) == uintptr(0) {
continue
}
if p != 0 {
@@ -76439,14 +77421,14 @@ func vdbeSorterSort(tls *libc.TLS, pTask uintptr, pList uintptr) int32 { /* sqli
}
// Initialize a PMA-writer object.
-func vdbePmaWriterInit(tls *libc.TLS, pFd uintptr, p uintptr, nBuf int32, iStart I64) { /* sqlite3.c:96769:13: */
+func vdbePmaWriterInit(tls *libc.TLS, pFd uintptr, p uintptr, nBuf int32, iStart I64) { /* sqlite3.c:97135:13: */
libc.Xmemset(tls, p, 0, uint32(unsafe.Sizeof(PmaWriter{})))
(*PmaWriter)(unsafe.Pointer(p)).FaBuffer = Xsqlite3Malloc(tls, uint64(nBuf))
if !(int32((*PmaWriter)(unsafe.Pointer(p)).FaBuffer) != 0) {
(*PmaWriter)(unsafe.Pointer(p)).FeFWErr = SQLITE_NOMEM
} else {
- (*PmaWriter)(unsafe.Pointer(p)).FiBufEnd = libc.AssignPtrInt32(p+12 /* &.iBufStart */, (int32(iStart % I64(nBuf))))
- (*PmaWriter)(unsafe.Pointer(p)).FiWriteOff = (iStart - I64((*PmaWriter)(unsafe.Pointer(p)).FiBufStart))
+ (*PmaWriter)(unsafe.Pointer(p)).FiBufEnd = libc.AssignPtrInt32(p+12, int32(iStart%I64(nBuf)))
+ (*PmaWriter)(unsafe.Pointer(p)).FiWriteOff = iStart - I64((*PmaWriter)(unsafe.Pointer(p)).FiBufStart)
(*PmaWriter)(unsafe.Pointer(p)).FnBuffer = nBuf
(*PmaWriter)(unsafe.Pointer(p)).FpFd = pFd
}
@@ -76454,25 +77436,25 @@ func vdbePmaWriterInit(tls *libc.TLS, pFd uintptr, p uintptr, nBuf int32, iStart
// Write nData bytes of data to the PMA. Return SQLITE_OK
// if successful, or an SQLite error code if an error occurs.
-func vdbePmaWriteBlob(tls *libc.TLS, p uintptr, pData uintptr, nData int32) { /* sqlite3.c:96791:13: */
+func vdbePmaWriteBlob(tls *libc.TLS, p uintptr, pData uintptr, nData int32) { /* sqlite3.c:97157:13: */
var nRem int32 = nData
- for (nRem > 0) && ((*PmaWriter)(unsafe.Pointer(p)).FeFWErr == 0) {
+ for nRem > 0 && (*PmaWriter)(unsafe.Pointer(p)).FeFWErr == 0 {
var nCopy int32 = nRem
- if nCopy > ((*PmaWriter)(unsafe.Pointer(p)).FnBuffer - (*PmaWriter)(unsafe.Pointer(p)).FiBufEnd) {
- nCopy = ((*PmaWriter)(unsafe.Pointer(p)).FnBuffer - (*PmaWriter)(unsafe.Pointer(p)).FiBufEnd)
+ if nCopy > (*PmaWriter)(unsafe.Pointer(p)).FnBuffer-(*PmaWriter)(unsafe.Pointer(p)).FiBufEnd {
+ nCopy = (*PmaWriter)(unsafe.Pointer(p)).FnBuffer - (*PmaWriter)(unsafe.Pointer(p)).FiBufEnd
}
- libc.Xmemcpy(tls, ((*PmaWriter)(unsafe.Pointer(p)).FaBuffer + uintptr((*PmaWriter)(unsafe.Pointer(p)).FiBufEnd)), (pData + uintptr((nData - nRem))), uint32(nCopy))
- *(*int32)(unsafe.Pointer(p + 16 /* &.iBufEnd */)) += (nCopy)
+ libc.Xmemcpy(tls, (*PmaWriter)(unsafe.Pointer(p)).FaBuffer+uintptr((*PmaWriter)(unsafe.Pointer(p)).FiBufEnd), pData+uintptr(nData-nRem), uint32(nCopy))
+ *(*int32)(unsafe.Pointer(p + 16)) += nCopy
if (*PmaWriter)(unsafe.Pointer(p)).FiBufEnd == (*PmaWriter)(unsafe.Pointer(p)).FnBuffer {
(*PmaWriter)(unsafe.Pointer(p)).FeFWErr = Xsqlite3OsWrite(tls, (*PmaWriter)(unsafe.Pointer(p)).FpFd,
- ((*PmaWriter)(unsafe.Pointer(p)).FaBuffer + uintptr((*PmaWriter)(unsafe.Pointer(p)).FiBufStart)), ((*PmaWriter)(unsafe.Pointer(p)).FiBufEnd - (*PmaWriter)(unsafe.Pointer(p)).FiBufStart),
- ((*PmaWriter)(unsafe.Pointer(p)).FiWriteOff + I64((*PmaWriter)(unsafe.Pointer(p)).FiBufStart)))
- (*PmaWriter)(unsafe.Pointer(p)).FiBufStart = libc.AssignPtrInt32(p+16 /* &.iBufEnd */, 0)
- *(*I64)(unsafe.Pointer(p + 24 /* &.iWriteOff */)) += (I64((*PmaWriter)(unsafe.Pointer(p)).FnBuffer))
+ (*PmaWriter)(unsafe.Pointer(p)).FaBuffer+uintptr((*PmaWriter)(unsafe.Pointer(p)).FiBufStart), (*PmaWriter)(unsafe.Pointer(p)).FiBufEnd-(*PmaWriter)(unsafe.Pointer(p)).FiBufStart,
+ (*PmaWriter)(unsafe.Pointer(p)).FiWriteOff+I64((*PmaWriter)(unsafe.Pointer(p)).FiBufStart))
+ (*PmaWriter)(unsafe.Pointer(p)).FiBufStart = libc.AssignPtrInt32(p+16, 0)
+ *(*I64)(unsafe.Pointer(p + 24)) += I64((*PmaWriter)(unsafe.Pointer(p)).FnBuffer)
}
- nRem = nRem - (nCopy)
+ nRem = nRem - nCopy
}
}
@@ -76483,14 +77465,14 @@ func vdbePmaWriteBlob(tls *libc.TLS, p uintptr, pData uintptr, nData int32) { /*
//
// Before returning, set *piEof to the offset immediately following the
// last byte written to the file.
-func vdbePmaWriterFinish(tls *libc.TLS, p uintptr, piEof uintptr) int32 { /* sqlite3.c:96824:12: */
+func vdbePmaWriterFinish(tls *libc.TLS, p uintptr, piEof uintptr) int32 { /* sqlite3.c:97190:12: */
var rc int32
- if (((*PmaWriter)(unsafe.Pointer(p)).FeFWErr == 0) && ((*PmaWriter)(unsafe.Pointer(p)).FaBuffer != 0)) && ((*PmaWriter)(unsafe.Pointer(p)).FiBufEnd > (*PmaWriter)(unsafe.Pointer(p)).FiBufStart) {
+ if (*PmaWriter)(unsafe.Pointer(p)).FeFWErr == 0 && (*PmaWriter)(unsafe.Pointer(p)).FaBuffer != 0 && (*PmaWriter)(unsafe.Pointer(p)).FiBufEnd > (*PmaWriter)(unsafe.Pointer(p)).FiBufStart {
(*PmaWriter)(unsafe.Pointer(p)).FeFWErr = Xsqlite3OsWrite(tls, (*PmaWriter)(unsafe.Pointer(p)).FpFd,
- ((*PmaWriter)(unsafe.Pointer(p)).FaBuffer + uintptr((*PmaWriter)(unsafe.Pointer(p)).FiBufStart)), ((*PmaWriter)(unsafe.Pointer(p)).FiBufEnd - (*PmaWriter)(unsafe.Pointer(p)).FiBufStart),
- ((*PmaWriter)(unsafe.Pointer(p)).FiWriteOff + I64((*PmaWriter)(unsafe.Pointer(p)).FiBufStart)))
+ (*PmaWriter)(unsafe.Pointer(p)).FaBuffer+uintptr((*PmaWriter)(unsafe.Pointer(p)).FiBufStart), (*PmaWriter)(unsafe.Pointer(p)).FiBufEnd-(*PmaWriter)(unsafe.Pointer(p)).FiBufStart,
+ (*PmaWriter)(unsafe.Pointer(p)).FiWriteOff+I64((*PmaWriter)(unsafe.Pointer(p)).FiBufStart))
}
- *(*I64)(unsafe.Pointer(piEof)) = ((*PmaWriter)(unsafe.Pointer(p)).FiWriteOff + I64((*PmaWriter)(unsafe.Pointer(p)).FiBufEnd))
+ *(*I64)(unsafe.Pointer(piEof)) = (*PmaWriter)(unsafe.Pointer(p)).FiWriteOff + I64((*PmaWriter)(unsafe.Pointer(p)).FiBufEnd)
Xsqlite3_free(tls, (*PmaWriter)(unsafe.Pointer(p)).FaBuffer)
rc = (*PmaWriter)(unsafe.Pointer(p)).FeFWErr
libc.Xmemset(tls, p, 0, uint32(unsafe.Sizeof(PmaWriter{})))
@@ -76499,7 +77481,7 @@ func vdbePmaWriterFinish(tls *libc.TLS, p uintptr, piEof uintptr) int32 { /* sql
// Write value iVal encoded as a varint to the PMA. Return
// SQLITE_OK if successful, or an SQLite error code if an error occurs.
-func vdbePmaWriteVarint(tls *libc.TLS, p uintptr, iVal U64) { /* sqlite3.c:96843:13: */
+func vdbePmaWriteVarint(tls *libc.TLS, p uintptr, iVal U64) { /* sqlite3.c:97209:13: */
bp := tls.Alloc(10)
defer tls.Free(10)
@@ -76522,7 +77504,7 @@ func vdbePmaWriteVarint(tls *libc.TLS, p uintptr, iVal U64) { /* sqlite3.c:96843
// * One or more records packed end-to-end in order of ascending keys.
// Each record consists of a varint followed by a blob of data (the
// key). The varint is the number of bytes in the blob of data.
-func vdbeSorterListToPMA(tls *libc.TLS, pTask uintptr, pList uintptr) int32 { /* sqlite3.c:96864:12: */
+func vdbeSorterListToPMA(tls *libc.TLS, pTask uintptr, pList uintptr) int32 { /* sqlite3.c:97230:12: */
bp := tls.Alloc(40)
defer tls.Free(40)
@@ -76535,13 +77517,13 @@ func vdbeSorterListToPMA(tls *libc.TLS, pTask uintptr, pList uintptr) int32 { /*
// If the first temporary PMA file has not been opened, open it now.
if (*SortSubtask)(unsafe.Pointer(pTask)).Ffile.FpFd == uintptr(0) {
- rc = vdbeSorterOpenTempFile(tls, db, int64(0), (pTask + 40 /* &.file */ /* &.pFd */))
+ rc = vdbeSorterOpenTempFile(tls, db, int64(0), pTask+40)
}
// Try to get the file to memory map
if rc == SQLITE_OK {
- vdbeSorterExtendFile(tls, db, (*SortSubtask)(unsafe.Pointer(pTask)).Ffile.FpFd, (((*SortSubtask)(unsafe.Pointer(pTask)).Ffile.FiEof + I64((*SorterList)(unsafe.Pointer(pList)).FszPMA)) + int64(9)))
+ vdbeSorterExtendFile(tls, db, (*SortSubtask)(unsafe.Pointer(pTask)).Ffile.FpFd, (*SortSubtask)(unsafe.Pointer(pTask)).Ffile.FiEof+I64((*SorterList)(unsafe.Pointer(pList)).FszPMA)+int64(9))
}
// Sort the list
@@ -76558,15 +77540,15 @@ func vdbeSorterListToPMA(tls *libc.TLS, pTask uintptr, pList uintptr) int32 { /*
(*SortSubtask)(unsafe.Pointer(pTask)).FnPMA++
vdbePmaWriteVarint(tls, bp /* &writer */, uint64((*SorterList)(unsafe.Pointer(pList)).FszPMA))
for p = (*SorterList)(unsafe.Pointer(pList)).FpList; p != 0; p = pNext {
- pNext = *(*uintptr)(unsafe.Pointer(p + 4 /* &.u */))
+ pNext = *(*uintptr)(unsafe.Pointer(p + 4))
vdbePmaWriteVarint(tls, bp /* &writer */, uint64((*SorterRecord)(unsafe.Pointer(p)).FnVal))
- vdbePmaWriteBlob(tls, bp /* &writer */, ((p) + uintptr(1)*8), (*SorterRecord)(unsafe.Pointer(p)).FnVal)
+ vdbePmaWriteBlob(tls, bp /* &writer */, p+uintptr(1)*8, (*SorterRecord)(unsafe.Pointer(p)).FnVal)
if (*SorterList)(unsafe.Pointer(pList)).FaMemory == uintptr(0) {
Xsqlite3_free(tls, p)
}
}
(*SorterList)(unsafe.Pointer(pList)).FpList = p
- rc = vdbePmaWriterFinish(tls, bp /* &writer */, (pTask + 40 /* &.file */ + 8 /* &.iEof */))
+ rc = vdbePmaWriterFinish(tls, bp /* &writer */, pTask+40+8)
}
return rc
@@ -76577,7 +77559,7 @@ func vdbeSorterListToPMA(tls *libc.TLS, pTask uintptr, pList uintptr) int32 { /*
// the MergeEngine has reached the end of all its inputs.
//
// Return SQLITE_OK if successful or an error code if an error occurs.
-func vdbeMergeEngineStep(tls *libc.TLS, pMerger uintptr, pbEof uintptr) int32 { /* sqlite3.c:96928:12: */
+func vdbeMergeEngineStep(tls *libc.TLS, pMerger uintptr, pbEof uintptr) int32 { /* sqlite3.c:97294:12: */
bp := tls.Alloc(4)
defer tls.Free(4)
@@ -76586,7 +77568,7 @@ func vdbeMergeEngineStep(tls *libc.TLS, pMerger uintptr, pbEof uintptr) int32 {
var pTask uintptr = (*MergeEngine)(unsafe.Pointer(pMerger)).FpTask
// Advance the current PmaReader
- rc = vdbePmaReaderNext(tls, ((*MergeEngine)(unsafe.Pointer(pMerger)).FaReadr + uintptr(iPrev)*56))
+ rc = vdbePmaReaderNext(tls, (*MergeEngine)(unsafe.Pointer(pMerger)).FaReadr+uintptr(iPrev)*56)
// Update contents of aTree[]
if rc == SQLITE_OK {
@@ -76597,10 +77579,10 @@ func vdbeMergeEngineStep(tls *libc.TLS, pMerger uintptr, pbEof uintptr) int32 {
// Find the first two PmaReaders to compare. The one that was just
// advanced (iPrev) and the one next to it in the array.
- pReadr1 = ((*MergeEngine)(unsafe.Pointer(pMerger)).FaReadr + uintptr((iPrev&0xFFFE))*56)
- pReadr2 = ((*MergeEngine)(unsafe.Pointer(pMerger)).FaReadr + uintptr((iPrev|0x0001))*56)
+ pReadr1 = (*MergeEngine)(unsafe.Pointer(pMerger)).FaReadr + uintptr(iPrev&0xFFFE)*56
+ pReadr2 = (*MergeEngine)(unsafe.Pointer(pMerger)).FaReadr + uintptr(iPrev|0x0001)*56
- for i = (((*MergeEngine)(unsafe.Pointer(pMerger)).FnTree + iPrev) / 2); i > 0; i = (i / 2) {
+ for i = ((*MergeEngine)(unsafe.Pointer(pMerger)).FnTree + iPrev) / 2; i > 0; i = i / 2 {
// Compare pReadr1 and pReadr2. Store the result in variable iRes.
var iRes int32
if (*PmaReader)(unsafe.Pointer(pReadr1)).FpFd == uintptr(0) {
@@ -76629,19 +77611,19 @@ func vdbeMergeEngineStep(tls *libc.TLS, pMerger uintptr, pbEof uintptr) int32 {
// PMA should be considered smaller. The VdbeSorter.aReadr[] array
// is sorted from oldest to newest, so pReadr1 contains older values
// than pReadr2 iff (pReadr1<pReadr2).
- if (iRes < 0) || ((iRes == 0) && (pReadr1 < pReadr2)) {
- *(*int32)(unsafe.Pointer((*MergeEngine)(unsafe.Pointer(pMerger)).FaTree + uintptr(i)*4)) = ((int32(pReadr1) - int32((*MergeEngine)(unsafe.Pointer(pMerger)).FaReadr)) / 56)
- pReadr2 = ((*MergeEngine)(unsafe.Pointer(pMerger)).FaReadr + uintptr(*(*int32)(unsafe.Pointer((*MergeEngine)(unsafe.Pointer(pMerger)).FaTree + uintptr((i^0x0001))*4)))*56)
+ if iRes < 0 || iRes == 0 && pReadr1 < pReadr2 {
+ *(*int32)(unsafe.Pointer((*MergeEngine)(unsafe.Pointer(pMerger)).FaTree + uintptr(i)*4)) = (int32(pReadr1) - int32((*MergeEngine)(unsafe.Pointer(pMerger)).FaReadr)) / 56
+ pReadr2 = (*MergeEngine)(unsafe.Pointer(pMerger)).FaReadr + uintptr(*(*int32)(unsafe.Pointer((*MergeEngine)(unsafe.Pointer(pMerger)).FaTree + uintptr(i^0x0001)*4)))*56
*(*int32)(unsafe.Pointer(bp /* bCached */)) = 0
} else {
if (*PmaReader)(unsafe.Pointer(pReadr1)).FpFd != 0 {
*(*int32)(unsafe.Pointer(bp /* bCached */)) = 0
}
- *(*int32)(unsafe.Pointer((*MergeEngine)(unsafe.Pointer(pMerger)).FaTree + uintptr(i)*4)) = ((int32(pReadr2) - int32((*MergeEngine)(unsafe.Pointer(pMerger)).FaReadr)) / 56)
- pReadr1 = ((*MergeEngine)(unsafe.Pointer(pMerger)).FaReadr + uintptr(*(*int32)(unsafe.Pointer((*MergeEngine)(unsafe.Pointer(pMerger)).FaTree + uintptr((i^0x0001))*4)))*56)
+ *(*int32)(unsafe.Pointer((*MergeEngine)(unsafe.Pointer(pMerger)).FaTree + uintptr(i)*4)) = (int32(pReadr2) - int32((*MergeEngine)(unsafe.Pointer(pMerger)).FaReadr)) / 56
+ pReadr1 = (*MergeEngine)(unsafe.Pointer(pMerger)).FaReadr + uintptr(*(*int32)(unsafe.Pointer((*MergeEngine)(unsafe.Pointer(pMerger)).FaTree + uintptr(i^0x0001)*4)))*56
}
}
- *(*int32)(unsafe.Pointer(pbEof)) = (libc.Bool32((*PmaReader)(unsafe.Pointer((*MergeEngine)(unsafe.Pointer(pMerger)).FaReadr+uintptr(*(*int32)(unsafe.Pointer((*MergeEngine)(unsafe.Pointer(pMerger)).FaTree + 1*4)))*56)).FpFd == uintptr(0)))
+ *(*int32)(unsafe.Pointer(pbEof)) = libc.Bool32((*PmaReader)(unsafe.Pointer((*MergeEngine)(unsafe.Pointer(pMerger)).FaReadr+uintptr(*(*int32)(unsafe.Pointer((*MergeEngine)(unsafe.Pointer(pMerger)).FaTree + 1*4)))*56)).FpFd == uintptr(0))
}
return func() int32 {
@@ -76653,22 +77635,22 @@ func vdbeMergeEngineStep(tls *libc.TLS, pMerger uintptr, pbEof uintptr) int32 {
}
// The main routine for background threads that write level-0 PMAs.
-func vdbeSorterFlushThread(tls *libc.TLS, pCtx uintptr) uintptr { /* sqlite3.c:96999:13: */
+func vdbeSorterFlushThread(tls *libc.TLS, pCtx uintptr) uintptr { /* sqlite3.c:97365:13: */
var pTask uintptr = pCtx
var rc int32 // Return code
- rc = vdbeSorterListToPMA(tls, pTask, (pTask + 16 /* &.list */))
+ rc = vdbeSorterListToPMA(tls, pTask, pTask+16)
(*SortSubtask)(unsafe.Pointer(pTask)).FbDone = 1
return uintptr(rc)
}
// Flush the current contents of VdbeSorter.list to a new PMA, possibly
// using a background thread.
-func vdbeSorterFlushPMA(tls *libc.TLS, pSorter uintptr) int32 { /* sqlite3.c:97013:12: */
+func vdbeSorterFlushPMA(tls *libc.TLS, pSorter uintptr) int32 { /* sqlite3.c:97379:12: */
var rc int32 = SQLITE_OK
var i int32
var pTask uintptr = uintptr(0) // Thread context used to create new PMA
- var nWorker int32 = (int32((*VdbeSorter)(unsafe.Pointer(pSorter)).FnTask) - 1)
+ var nWorker int32 = int32((*VdbeSorter)(unsafe.Pointer(pSorter)).FnTask) - 1
// Set the flag to indicate that at least one PMA has been written.
// Or will be, anyhow.
@@ -76683,12 +77665,12 @@ func vdbeSorterFlushPMA(tls *libc.TLS, pSorter uintptr) int32 { /* sqlite3.c:970
// sub-tasks are prefered as they use background threads - the final
// sub-task uses the main thread.
for i = 0; i < nWorker; i++ {
- var iTest int32 = (((int32((*VdbeSorter)(unsafe.Pointer(pSorter)).FiPrev) + i) + 1) % nWorker)
- pTask = ((pSorter + 64 /* &.aTask */) + uintptr(iTest)*72)
+ var iTest int32 = (int32((*VdbeSorter)(unsafe.Pointer(pSorter)).FiPrev) + i + 1) % nWorker
+ pTask = pSorter + 64 + uintptr(iTest)*72
if (*SortSubtask)(unsafe.Pointer(pTask)).FbDone != 0 {
rc = vdbeSorterJoinThread(tls, pTask)
}
- if (rc != SQLITE_OK) || ((*SortSubtask)(unsafe.Pointer(pTask)).FpThread == uintptr(0)) {
+ if rc != SQLITE_OK || (*SortSubtask)(unsafe.Pointer(pTask)).FpThread == uintptr(0) {
break
}
}
@@ -76696,7 +77678,7 @@ func vdbeSorterFlushPMA(tls *libc.TLS, pSorter uintptr) int32 { /* sqlite3.c:970
if rc == SQLITE_OK {
if i == nWorker {
// Use the foreground thread for this operation
- rc = vdbeSorterListToPMA(tls, ((pSorter + 64 /* &.aTask */) + uintptr(nWorker)*72), (pSorter + 36 /* &.list */))
+ rc = vdbeSorterListToPMA(tls, pSorter+64+uintptr(nWorker)*72, pSorter+36)
} else {
// Launch a background thread for this operation
var aMem uintptr
@@ -76704,7 +77686,7 @@ func vdbeSorterFlushPMA(tls *libc.TLS, pSorter uintptr) int32 { /* sqlite3.c:970
aMem = (*SortSubtask)(unsafe.Pointer(pTask)).Flist.FaMemory
pCtx = pTask
- (*VdbeSorter)(unsafe.Pointer(pSorter)).FiPrev = (U8(int32((pTask - (pSorter + 64 /* &.aTask */)) / 72)))
+ (*VdbeSorter)(unsafe.Pointer(pSorter)).FiPrev = U8(int32((pTask - (pSorter + 64)) / 72))
(*SortSubtask)(unsafe.Pointer(pTask)).Flist = (*VdbeSorter)(unsafe.Pointer(pSorter)).Flist
(*VdbeSorter)(unsafe.Pointer(pSorter)).Flist.FpList = uintptr(0)
(*VdbeSorter)(unsafe.Pointer(pSorter)).Flist.FszPMA = 0
@@ -76728,7 +77710,7 @@ func vdbeSorterFlushPMA(tls *libc.TLS, pSorter uintptr) int32 { /* sqlite3.c:970
}
// Add a record to the sorter.
-func Xsqlite3VdbeSorterWrite(tls *libc.TLS, pCsr uintptr, pVal uintptr) int32 { /* sqlite3.c:97083:20: */
+func Xsqlite3VdbeSorterWrite(tls *libc.TLS, pCsr uintptr, pVal uintptr) int32 { /* sqlite3.c:97449:20: */
bp := tls.Alloc(4)
defer tls.Free(4)
@@ -76741,15 +77723,15 @@ func Xsqlite3VdbeSorterWrite(tls *libc.TLS, pCsr uintptr, pVal uintptr) int32 {
// var t int32 at bp, 4
// serial type of first record field
- pSorter = *(*uintptr)(unsafe.Pointer(pCsr + 40 /* &.uc */))
- *(*int32)(unsafe.Pointer(bp /* t */)) = int32(U32(*(*U8)(unsafe.Pointer(((*Mem)(unsafe.Pointer(pVal)).Fz + 1)))))
- if *(*int32)(unsafe.Pointer(bp /* t */)) >= 0x80 {
- Xsqlite3GetVarint32(tls, ((*Mem)(unsafe.Pointer(pVal)).Fz + 1), bp /* &t */)
+ pSorter = *(*uintptr)(unsafe.Pointer(pCsr + 40))
+ *(*int32)(unsafe.Pointer(bp /* t */)) = int32(U32(*(*U8)(unsafe.Pointer((*Mem)(unsafe.Pointer(pVal)).Fz + 1))))
+ if *(*int32)(unsafe.Pointer(bp)) >= 0x80 {
+ Xsqlite3GetVarint32(tls, (*Mem)(unsafe.Pointer(pVal)).Fz+1, bp /* &t */)
}
- if ((*(*int32)(unsafe.Pointer(bp /* t */)) > 0) && (*(*int32)(unsafe.Pointer(bp /* t */)) < 10)) && (*(*int32)(unsafe.Pointer(bp /* t */)) != 7) {
- *(*U8)(unsafe.Pointer(pSorter + 60 /* &.typeMask */)) &= U8((SORTER_TYPE_INTEGER))
- } else if (*(*int32)(unsafe.Pointer(bp /* t */)) > 10) && ((*(*int32)(unsafe.Pointer(bp /* t */)) & 0x01) != 0) {
- *(*U8)(unsafe.Pointer(pSorter + 60 /* &.typeMask */)) &= U8((SORTER_TYPE_TEXT))
+ if *(*int32)(unsafe.Pointer(bp)) > 0 && *(*int32)(unsafe.Pointer(bp)) < 10 && *(*int32)(unsafe.Pointer(bp)) != 7 {
+ *(*U8)(unsafe.Pointer(pSorter + 60)) &= U8(SORTER_TYPE_INTEGER)
+ } else if *(*int32)(unsafe.Pointer(bp)) > 10 && *(*int32)(unsafe.Pointer(bp))&0x01 != 0 {
+ *(*U8)(unsafe.Pointer(pSorter + 60)) &= U8(SORTER_TYPE_TEXT)
} else {
(*VdbeSorter)(unsafe.Pointer(pSorter)).FtypeMask = U8(0)
}
@@ -76769,14 +77751,14 @@ func Xsqlite3VdbeSorterWrite(tls *libc.TLS, pCsr uintptr, pVal uintptr) int32 {
//
// * The total memory allocated for the in-memory list is greater
// than (page-size * 10) and sqlite3HeapNearlyFull() returns true.
- nReq = (int32(uint32((*Mem)(unsafe.Pointer(pVal)).Fn) + uint32(unsafe.Sizeof(SorterRecord{}))))
- nPMA = ((*Mem)(unsafe.Pointer(pVal)).Fn + Xsqlite3VarintLen(tls, uint64((*Mem)(unsafe.Pointer(pVal)).Fn)))
+ nReq = int32(uint32((*Mem)(unsafe.Pointer(pVal)).Fn) + uint32(unsafe.Sizeof(SorterRecord{})))
+ nPMA = (*Mem)(unsafe.Pointer(pVal)).Fn + Xsqlite3VarintLen(tls, uint64((*Mem)(unsafe.Pointer(pVal)).Fn))
if (*VdbeSorter)(unsafe.Pointer(pSorter)).FmxPmaSize != 0 {
if (*VdbeSorter)(unsafe.Pointer(pSorter)).Flist.FaMemory != 0 {
- bFlush = (libc.Bool32(((*VdbeSorter)(unsafe.Pointer(pSorter)).FiMemory != 0) && (((*VdbeSorter)(unsafe.Pointer(pSorter)).FiMemory + nReq) > (*VdbeSorter)(unsafe.Pointer(pSorter)).FmxPmaSize)))
+ bFlush = libc.Bool32((*VdbeSorter)(unsafe.Pointer(pSorter)).FiMemory != 0 && (*VdbeSorter)(unsafe.Pointer(pSorter)).FiMemory+nReq > (*VdbeSorter)(unsafe.Pointer(pSorter)).FmxPmaSize)
} else {
- bFlush = (libc.Bool32(((*VdbeSorter)(unsafe.Pointer(pSorter)).Flist.FszPMA > (*VdbeSorter)(unsafe.Pointer(pSorter)).FmxPmaSize) ||
- (((*VdbeSorter)(unsafe.Pointer(pSorter)).Flist.FszPMA > (*VdbeSorter)(unsafe.Pointer(pSorter)).FmnPmaSize) && (Xsqlite3HeapNearlyFull(tls) != 0))))
+ bFlush = libc.Bool32((*VdbeSorter)(unsafe.Pointer(pSorter)).Flist.FszPMA > (*VdbeSorter)(unsafe.Pointer(pSorter)).FmxPmaSize ||
+ (*VdbeSorter)(unsafe.Pointer(pSorter)).Flist.FszPMA > (*VdbeSorter)(unsafe.Pointer(pSorter)).FmnPmaSize && Xsqlite3HeapNearlyFull(tls) != 0)
}
if bFlush != 0 {
rc = vdbeSorterFlushPMA(tls, pSorter)
@@ -76786,23 +77768,23 @@ func Xsqlite3VdbeSorterWrite(tls *libc.TLS, pCsr uintptr, pVal uintptr) int32 {
}
}
- *(*int32)(unsafe.Pointer(pSorter + 36 /* &.list */ + 8 /* &.szPMA */)) += (nPMA)
+ *(*int32)(unsafe.Pointer(pSorter + 36 + 8)) += nPMA
if nPMA > (*VdbeSorter)(unsafe.Pointer(pSorter)).FmxKeysize {
(*VdbeSorter)(unsafe.Pointer(pSorter)).FmxKeysize = nPMA
}
if (*VdbeSorter)(unsafe.Pointer(pSorter)).Flist.FaMemory != 0 {
- var nMin int32 = ((*VdbeSorter)(unsafe.Pointer(pSorter)).FiMemory + nReq)
+ var nMin int32 = (*VdbeSorter)(unsafe.Pointer(pSorter)).FiMemory + nReq
if nMin > (*VdbeSorter)(unsafe.Pointer(pSorter)).FnMemory {
var aNew uintptr
- var nNew Sqlite3_int64 = (int64(2) * Sqlite3_int64((*VdbeSorter)(unsafe.Pointer(pSorter)).FnMemory))
+ var nNew Sqlite3_int64 = int64(2) * Sqlite3_int64((*VdbeSorter)(unsafe.Pointer(pSorter)).FnMemory)
var iListOff int32 = -1
if (*VdbeSorter)(unsafe.Pointer(pSorter)).Flist.FpList != 0 {
- iListOff = ((int32((*VdbeSorter)(unsafe.Pointer(pSorter)).Flist.FpList) - int32((*VdbeSorter)(unsafe.Pointer(pSorter)).Flist.FaMemory)) / 1)
+ iListOff = (int32((*VdbeSorter)(unsafe.Pointer(pSorter)).Flist.FpList) - int32((*VdbeSorter)(unsafe.Pointer(pSorter)).Flist.FaMemory)) / 1
}
for nNew < Sqlite3_int64(nMin) {
- nNew = (nNew * int64(2))
+ nNew = nNew * int64(2)
}
if nNew > Sqlite3_int64((*VdbeSorter)(unsafe.Pointer(pSorter)).FmxPmaSize) {
nNew = Sqlite3_int64((*VdbeSorter)(unsafe.Pointer(pSorter)).FmxPmaSize)
@@ -76815,26 +77797,26 @@ func Xsqlite3VdbeSorterWrite(tls *libc.TLS, pCsr uintptr, pVal uintptr) int32 {
return SQLITE_NOMEM
}
if iListOff >= 0 {
- (*VdbeSorter)(unsafe.Pointer(pSorter)).Flist.FpList = (aNew + uintptr(iListOff))
+ (*VdbeSorter)(unsafe.Pointer(pSorter)).Flist.FpList = aNew + uintptr(iListOff)
}
(*VdbeSorter)(unsafe.Pointer(pSorter)).Flist.FaMemory = aNew
(*VdbeSorter)(unsafe.Pointer(pSorter)).FnMemory = int32(nNew)
}
- pNew = ((*VdbeSorter)(unsafe.Pointer(pSorter)).Flist.FaMemory + uintptr((*VdbeSorter)(unsafe.Pointer(pSorter)).FiMemory))
- *(*int32)(unsafe.Pointer(pSorter + 48 /* &.iMemory */)) += (((nReq) + 7) & libc.CplInt32(7))
+ pNew = (*VdbeSorter)(unsafe.Pointer(pSorter)).Flist.FaMemory + uintptr((*VdbeSorter)(unsafe.Pointer(pSorter)).FiMemory)
+ *(*int32)(unsafe.Pointer(pSorter + 48)) += (nReq + 7) & libc.CplInt32(7)
if (*VdbeSorter)(unsafe.Pointer(pSorter)).Flist.FpList != 0 {
- *(*int32)(unsafe.Pointer(pNew + 4 /* &.u */)) = ((int32(((*VdbeSorter)(unsafe.Pointer(pSorter)).Flist.FpList)) - int32((*VdbeSorter)(unsafe.Pointer(pSorter)).Flist.FaMemory)) / 1)
+ *(*int32)(unsafe.Pointer(pNew + 4)) = (int32((*VdbeSorter)(unsafe.Pointer(pSorter)).Flist.FpList) - int32((*VdbeSorter)(unsafe.Pointer(pSorter)).Flist.FaMemory)) / 1
}
} else {
pNew = Xsqlite3Malloc(tls, uint64(nReq))
if pNew == uintptr(0) {
return SQLITE_NOMEM
}
- *(*uintptr)(unsafe.Pointer(pNew + 4 /* &.u */)) = (*VdbeSorter)(unsafe.Pointer(pSorter)).Flist.FpList
+ *(*uintptr)(unsafe.Pointer(pNew + 4)) = (*VdbeSorter)(unsafe.Pointer(pSorter)).Flist.FpList
}
- libc.Xmemcpy(tls, ((pNew) + uintptr(1)*8), (*Mem)(unsafe.Pointer(pVal)).Fz, uint32((*Mem)(unsafe.Pointer(pVal)).Fn))
+ libc.Xmemcpy(tls, pNew+uintptr(1)*8, (*Mem)(unsafe.Pointer(pVal)).Fz, uint32((*Mem)(unsafe.Pointer(pVal)).Fn))
(*SorterRecord)(unsafe.Pointer(pNew)).FnVal = (*Mem)(unsafe.Pointer(pVal)).Fn
(*VdbeSorter)(unsafe.Pointer(pSorter)).Flist.FpList = pNew
@@ -76844,14 +77826,14 @@ func Xsqlite3VdbeSorterWrite(tls *libc.TLS, pCsr uintptr, pVal uintptr) int32 {
// Read keys from pIncr->pMerger and populate pIncr->aFile[1]. The format
// of the data stored in aFile[1] is the same as that used by regular PMAs,
// except that the number-of-bytes varint is omitted from the start.
-func vdbeIncrPopulate(tls *libc.TLS, pIncr uintptr) int32 { /* sqlite3.c:97195:12: */
+func vdbeIncrPopulate(tls *libc.TLS, pIncr uintptr) int32 { /* sqlite3.c:97561:12: */
bp := tls.Alloc(44)
defer tls.Free(44)
var rc int32 = SQLITE_OK
var rc2 int32
var iStart I64 = (*IncrMerger)(unsafe.Pointer(pIncr)).FiStartOff
- var pOut uintptr = ((pIncr + 32 /* &.aFile */) + 1*16)
+ var pOut uintptr = pIncr + 32 + 1*16
var pTask uintptr = (*IncrMerger)(unsafe.Pointer(pIncr)).FpTask
var pMerger uintptr = (*IncrMerger)(unsafe.Pointer(pIncr)).FpMerger
// var writer PmaWriter at bp, 40
@@ -76860,16 +77842,16 @@ func vdbeIncrPopulate(tls *libc.TLS, pIncr uintptr) int32 { /* sqlite3.c:97195:1
for rc == SQLITE_OK {
// var dummy int32 at bp+40, 4
- var pReader uintptr = ((*MergeEngine)(unsafe.Pointer(pMerger)).FaReadr + uintptr(*(*int32)(unsafe.Pointer((*MergeEngine)(unsafe.Pointer(pMerger)).FaTree + 1*4)))*56)
+ var pReader uintptr = (*MergeEngine)(unsafe.Pointer(pMerger)).FaReadr + uintptr(*(*int32)(unsafe.Pointer((*MergeEngine)(unsafe.Pointer(pMerger)).FaTree + 1*4)))*56
var nKey int32 = (*PmaReader)(unsafe.Pointer(pReader)).FnKey
- var iEof I64 = ((*PmaWriter)(unsafe.Pointer(bp /* &writer */)).FiWriteOff + I64((*PmaWriter)(unsafe.Pointer(bp /* &writer */)).FiBufEnd))
+ var iEof I64 = (*PmaWriter)(unsafe.Pointer(bp)).FiWriteOff + I64((*PmaWriter)(unsafe.Pointer(bp)).FiBufEnd)
// Check if the output file is full or if the input has been exhausted.
// In either case exit the loop.
if (*PmaReader)(unsafe.Pointer(pReader)).FpFd == uintptr(0) {
break
}
- if ((iEof + I64(nKey)) + I64(Xsqlite3VarintLen(tls, uint64(nKey)))) > (iStart + I64((*IncrMerger)(unsafe.Pointer(pIncr)).FmxSz)) {
+ if iEof+I64(nKey)+I64(Xsqlite3VarintLen(tls, uint64(nKey))) > iStart+I64((*IncrMerger)(unsafe.Pointer(pIncr)).FmxSz) {
break
}
@@ -76880,7 +77862,7 @@ func vdbeIncrPopulate(tls *libc.TLS, pIncr uintptr) int32 { /* sqlite3.c:97195:1
rc = vdbeMergeEngineStep(tls, (*IncrMerger)(unsafe.Pointer(pIncr)).FpMerger, bp+40 /* &dummy */)
}
- rc2 = vdbePmaWriterFinish(tls, bp /* &writer */, (pOut + 8 /* &.iEof */))
+ rc2 = vdbePmaWriterFinish(tls, bp /* &writer */, pOut+8)
if rc == SQLITE_OK {
rc = rc2
}
@@ -76890,7 +77872,7 @@ func vdbeIncrPopulate(tls *libc.TLS, pIncr uintptr) int32 { /* sqlite3.c:97195:1
// The main routine for background threads that populate aFile[1] of
// multi-threaded IncrMerger objects.
-func vdbeIncrPopulateThread(tls *libc.TLS, pCtx uintptr) uintptr { /* sqlite3.c:97237:13: */
+func vdbeIncrPopulateThread(tls *libc.TLS, pCtx uintptr) uintptr { /* sqlite3.c:97603:13: */
var pIncr uintptr = pCtx
var pRet uintptr = uintptr(vdbeIncrPopulate(tls, pIncr))
(*SortSubtask)(unsafe.Pointer((*IncrMerger)(unsafe.Pointer(pIncr)).FpTask)).FbDone = 1
@@ -76898,7 +77880,7 @@ func vdbeIncrPopulateThread(tls *libc.TLS, pCtx uintptr) uintptr { /* sqlite3.c:
}
// Launch a background thread to populate aFile[1] of pIncr.
-func vdbeIncrBgPopulate(tls *libc.TLS, pIncr uintptr) int32 { /* sqlite3.c:97247:12: */
+func vdbeIncrBgPopulate(tls *libc.TLS, pIncr uintptr) int32 { /* sqlite3.c:97613:12: */
var p uintptr = pIncr
return vdbeSorterCreateThread(tls, (*IncrMerger)(unsafe.Pointer(pIncr)).FpTask, *(*uintptr)(unsafe.Pointer(&struct {
@@ -76921,20 +77903,20 @@ func vdbeIncrBgPopulate(tls *libc.TLS, pIncr uintptr) int32 { /* sqlite3.c:97247
// to populate the new aFile[1].
//
// SQLITE_OK is returned on success, or an SQLite error code otherwise.
-func vdbeIncrSwap(tls *libc.TLS, pIncr uintptr) int32 { /* sqlite3.c:97271:12: */
+func vdbeIncrSwap(tls *libc.TLS, pIncr uintptr) int32 { /* sqlite3.c:97637:12: */
var rc int32 = SQLITE_OK
if (*IncrMerger)(unsafe.Pointer(pIncr)).FbUseThread != 0 {
rc = vdbeSorterJoinThread(tls, (*IncrMerger)(unsafe.Pointer(pIncr)).FpTask)
if rc == SQLITE_OK {
- var f0 = *(*SorterFile)(unsafe.Pointer((pIncr + 32 /* &.aFile */)))
- *(*SorterFile)(unsafe.Pointer((pIncr + 32 /* &.aFile */))) = *(*SorterFile)(unsafe.Pointer((pIncr + 32 /* &.aFile */) + 1*16))
- *(*SorterFile)(unsafe.Pointer((pIncr + 32 /* &.aFile */) + 1*16)) = f0
+ var f0 = *(*SorterFile)(unsafe.Pointer(pIncr + 32))
+ *(*SorterFile)(unsafe.Pointer(pIncr + 32)) = *(*SorterFile)(unsafe.Pointer(pIncr + 32 + 1*16))
+ *(*SorterFile)(unsafe.Pointer(pIncr + 32 + 1*16)) = f0
}
if rc == SQLITE_OK {
- if (*SorterFile)(unsafe.Pointer((pIncr + 32 /* &.aFile */))).FiEof == (*IncrMerger)(unsafe.Pointer(pIncr)).FiStartOff {
+ if (*SorterFile)(unsafe.Pointer(pIncr+32)).FiEof == (*IncrMerger)(unsafe.Pointer(pIncr)).FiStartOff {
(*IncrMerger)(unsafe.Pointer(pIncr)).FbEof = 1
} else {
rc = vdbeIncrBgPopulate(tls, pIncr)
@@ -76942,8 +77924,8 @@ func vdbeIncrSwap(tls *libc.TLS, pIncr uintptr) int32 { /* sqlite3.c:97271:12: *
}
} else {
rc = vdbeIncrPopulate(tls, pIncr)
- *(*SorterFile)(unsafe.Pointer((pIncr + 32 /* &.aFile */))) = *(*SorterFile)(unsafe.Pointer((pIncr + 32 /* &.aFile */) + 1*16))
- if (*SorterFile)(unsafe.Pointer((pIncr + 32 /* &.aFile */))).FiEof == (*IncrMerger)(unsafe.Pointer(pIncr)).FiStartOff {
+ *(*SorterFile)(unsafe.Pointer(pIncr + 32)) = *(*SorterFile)(unsafe.Pointer(pIncr + 32 + 1*16))
+ if (*SorterFile)(unsafe.Pointer(pIncr+32)).FiEof == (*IncrMerger)(unsafe.Pointer(pIncr)).FiStartOff {
(*IncrMerger)(unsafe.Pointer(pIncr)).FbEof = 1
}
}
@@ -76955,7 +77937,7 @@ func vdbeIncrSwap(tls *libc.TLS, pIncr uintptr) int32 { /* sqlite3.c:97271:12: *
//
// If an OOM condition is encountered, return NULL. In this case free the
// pMerger argument before returning.
-func vdbeIncrMergerNew(tls *libc.TLS, pTask uintptr, pMerger uintptr, ppOut uintptr) int32 { /* sqlite3.c:97310:12: */
+func vdbeIncrMergerNew(tls *libc.TLS, pTask uintptr, pMerger uintptr, ppOut uintptr) int32 { /* sqlite3.c:97676:12: */
var rc int32 = SQLITE_OK
var pIncr uintptr = libc.AssignPtrUintptr(ppOut, func() uintptr {
if Xsqlite3FaultSim(tls, 100) != 0 {
@@ -76967,29 +77949,30 @@ func vdbeIncrMergerNew(tls *libc.TLS, pTask uintptr, pMerger uintptr, ppOut uint
(*IncrMerger)(unsafe.Pointer(pIncr)).FpMerger = pMerger
(*IncrMerger)(unsafe.Pointer(pIncr)).FpTask = pTask
(*IncrMerger)(unsafe.Pointer(pIncr)).FmxSz = func() int32 {
- if ((*VdbeSorter)(unsafe.Pointer((*SortSubtask)(unsafe.Pointer(pTask)).FpSorter)).FmxKeysize + 9) > ((*VdbeSorter)(unsafe.Pointer((*SortSubtask)(unsafe.Pointer(pTask)).FpSorter)).FmxPmaSize / 2) {
- return ((*VdbeSorter)(unsafe.Pointer((*SortSubtask)(unsafe.Pointer(pTask)).FpSorter)).FmxKeysize + 9)
+ if (*VdbeSorter)(unsafe.Pointer((*SortSubtask)(unsafe.Pointer(pTask)).FpSorter)).FmxKeysize+9 > (*VdbeSorter)(unsafe.Pointer((*SortSubtask)(unsafe.Pointer(pTask)).FpSorter)).FmxPmaSize/2 {
+ return (*VdbeSorter)(unsafe.Pointer((*SortSubtask)(unsafe.Pointer(pTask)).FpSorter)).FmxKeysize + 9
}
- return ((*VdbeSorter)(unsafe.Pointer((*SortSubtask)(unsafe.Pointer(pTask)).FpSorter)).FmxPmaSize / 2)
+ return (*VdbeSorter)(unsafe.Pointer((*SortSubtask)(unsafe.Pointer(pTask)).FpSorter)).FmxPmaSize / 2
}()
- *(*I64)(unsafe.Pointer(pTask + 56 /* &.file2 */ + 8 /* &.iEof */)) += (I64((*IncrMerger)(unsafe.Pointer(pIncr)).FmxSz))
+ *(*I64)(unsafe.Pointer(pTask + 56 + 8)) += I64((*IncrMerger)(unsafe.Pointer(pIncr)).FmxSz)
} else {
vdbeMergeEngineFree(tls, pMerger)
rc = SQLITE_NOMEM
}
+
return rc
}
// Set the "use-threads" flag on object pIncr.
-func vdbeIncrMergerSetThreads(tls *libc.TLS, pIncr uintptr) { /* sqlite3.c:97334:13: */
+func vdbeIncrMergerSetThreads(tls *libc.TLS, pIncr uintptr) { /* sqlite3.c:97701:13: */
(*IncrMerger)(unsafe.Pointer(pIncr)).FbUseThread = 1
- *(*I64)(unsafe.Pointer((*IncrMerger)(unsafe.Pointer(pIncr)).FpTask + 56 /* &.file2 */ + 8 /* &.iEof */)) -= (I64((*IncrMerger)(unsafe.Pointer(pIncr)).FmxSz))
+ *(*I64)(unsafe.Pointer((*IncrMerger)(unsafe.Pointer(pIncr)).FpTask + 56 + 8)) -= I64((*IncrMerger)(unsafe.Pointer(pIncr)).FmxSz)
}
// Recompute pMerger->aTree[iOut] by comparing the next keys on the
// two PmaReaders that feed that entry. Neither of the PmaReaders
// are advanced. This routine merely does the comparison.
-func vdbeMergeEngineCompare(tls *libc.TLS, pMerger uintptr, iOut int32) { /* sqlite3.c:97347:13: */
+func vdbeMergeEngineCompare(tls *libc.TLS, pMerger uintptr, iOut int32) { /* sqlite3.c:97714:13: */
bp := tls.Alloc(4)
defer tls.Free(4)
@@ -76999,16 +77982,16 @@ func vdbeMergeEngineCompare(tls *libc.TLS, pMerger uintptr, iOut int32) { /* sql
var p1 uintptr
var p2 uintptr
- if iOut >= ((*MergeEngine)(unsafe.Pointer(pMerger)).FnTree / 2) {
- i1 = ((iOut - ((*MergeEngine)(unsafe.Pointer(pMerger)).FnTree / 2)) * 2)
- i2 = (i1 + 1)
+ if iOut >= (*MergeEngine)(unsafe.Pointer(pMerger)).FnTree/2 {
+ i1 = (iOut - (*MergeEngine)(unsafe.Pointer(pMerger)).FnTree/2) * 2
+ i2 = i1 + 1
} else {
- i1 = *(*int32)(unsafe.Pointer((*MergeEngine)(unsafe.Pointer(pMerger)).FaTree + uintptr((iOut*2))*4))
- i2 = *(*int32)(unsafe.Pointer((*MergeEngine)(unsafe.Pointer(pMerger)).FaTree + uintptr(((iOut*2)+1))*4))
+ i1 = *(*int32)(unsafe.Pointer((*MergeEngine)(unsafe.Pointer(pMerger)).FaTree + uintptr(iOut*2)*4))
+ i2 = *(*int32)(unsafe.Pointer((*MergeEngine)(unsafe.Pointer(pMerger)).FaTree + uintptr(iOut*2+1)*4))
}
- p1 = ((*MergeEngine)(unsafe.Pointer(pMerger)).FaReadr + uintptr(i1)*56)
- p2 = ((*MergeEngine)(unsafe.Pointer(pMerger)).FaReadr + uintptr(i2)*56)
+ p1 = (*MergeEngine)(unsafe.Pointer(pMerger)).FaReadr + uintptr(i1)*56
+ p2 = (*MergeEngine)(unsafe.Pointer(pMerger)).FaReadr + uintptr(i2)*56
if (*PmaReader)(unsafe.Pointer(p1)).FpFd == uintptr(0) {
iRes = i2
@@ -77049,7 +78032,7 @@ func vdbeMergeEngineCompare(tls *libc.TLS, pMerger uintptr, iOut int32) { /* sql
// to pMerger.
//
// SQLITE_OK is returned if successful, or an SQLite error code otherwise.
-func vdbeMergeEngineInit(tls *libc.TLS, pTask uintptr, pMerger uintptr, eMode int32) int32 { /* sqlite3.c:97429:12: */
+func vdbeMergeEngineInit(tls *libc.TLS, pTask uintptr, pMerger uintptr, eMode int32) int32 { /* sqlite3.c:97796:12: */
var rc int32 = SQLITE_OK // Return code
var i int32 // For looping over PmaReader objects
var nTree int32 // Number of subtrees to merge
@@ -77065,7 +78048,7 @@ func vdbeMergeEngineInit(tls *libc.TLS, pTask uintptr, pMerger uintptr, eMode in
nTree = (*MergeEngine)(unsafe.Pointer(pMerger)).FnTree
for i = 0; i < nTree; i++ {
- if (SQLITE_MAX_WORKER_THREADS > 0) && (eMode == INCRINIT_ROOT) {
+ if SQLITE_MAX_WORKER_THREADS > 0 && eMode == INCRINIT_ROOT {
// PmaReaders should be normally initialized in order, as if they are
// reading from the same temp file this makes for more linear file IO.
// However, in the INCRINIT_ROOT case, if PmaReader aReadr[nTask-1] is
@@ -77073,16 +78056,16 @@ func vdbeMergeEngineInit(tls *libc.TLS, pTask uintptr, pMerger uintptr, eMode in
// the main thread to fill its buffer. So calling PmaReaderNext()
// on this PmaReader before any of the multi-threaded PmaReaders takes
// better advantage of multi-processor hardware.
- rc = vdbePmaReaderNext(tls, ((*MergeEngine)(unsafe.Pointer(pMerger)).FaReadr + uintptr(((nTree-i)-1))*56))
+ rc = vdbePmaReaderNext(tls, (*MergeEngine)(unsafe.Pointer(pMerger)).FaReadr+uintptr(nTree-i-1)*56)
} else {
- rc = vdbePmaReaderIncrInit(tls, ((*MergeEngine)(unsafe.Pointer(pMerger)).FaReadr + uintptr(i)*56), INCRINIT_NORMAL)
+ rc = vdbePmaReaderIncrInit(tls, (*MergeEngine)(unsafe.Pointer(pMerger)).FaReadr+uintptr(i)*56, INCRINIT_NORMAL)
}
if rc != SQLITE_OK {
return rc
}
}
- for i = ((*MergeEngine)(unsafe.Pointer(pMerger)).FnTree - 1); i > 0; i-- {
+ for i = (*MergeEngine)(unsafe.Pointer(pMerger)).FnTree - 1; i > 0; i-- {
vdbeMergeEngineCompare(tls, pMerger, i)
}
return int32((*UnpackedRecord)(unsafe.Pointer((*SortSubtask)(unsafe.Pointer(pTask)).FpUnpacked)).FerrCode)
@@ -77119,7 +78102,7 @@ func vdbeMergeEngineInit(tls *libc.TLS, pTask uintptr, pMerger uintptr, eMode in
// the current PmaReader set to point to the first key in its range.
//
// SQLITE_OK is returned if successful, or an SQLite error code otherwise.
-func vdbePmaReaderIncrMergeInit(tls *libc.TLS, pReadr uintptr, eMode int32) int32 { /* sqlite3.c:97505:12: */
+func vdbePmaReaderIncrMergeInit(tls *libc.TLS, pReadr uintptr, eMode int32) int32 { /* sqlite3.c:97872:12: */
var rc int32 = SQLITE_OK
var pIncr uintptr = (*PmaReader)(unsafe.Pointer(pReadr)).FpIncr
var pTask uintptr = (*IncrMerger)(unsafe.Pointer(pIncr)).FpTask
@@ -77135,25 +78118,25 @@ func vdbePmaReaderIncrMergeInit(tls *libc.TLS, pReadr uintptr, eMode int32) int3
if rc == SQLITE_OK {
var mxSz int32 = (*IncrMerger)(unsafe.Pointer(pIncr)).FmxSz
if (*IncrMerger)(unsafe.Pointer(pIncr)).FbUseThread != 0 {
- rc = vdbeSorterOpenTempFile(tls, db, int64(mxSz), (pIncr + 32 /* &.aFile */) /* &.pFd */)
+ rc = vdbeSorterOpenTempFile(tls, db, int64(mxSz), pIncr+32)
if rc == SQLITE_OK {
- rc = vdbeSorterOpenTempFile(tls, db, int64(mxSz), ((pIncr + 32 /* &.aFile */) + 1*16 /* &.pFd */))
+ rc = vdbeSorterOpenTempFile(tls, db, int64(mxSz), pIncr+32+1*16)
}
} else {
if (*SortSubtask)(unsafe.Pointer(pTask)).Ffile2.FpFd == uintptr(0) {
- rc = vdbeSorterOpenTempFile(tls, db, (*SortSubtask)(unsafe.Pointer(pTask)).Ffile2.FiEof, (pTask + 56 /* &.file2 */ /* &.pFd */))
+ rc = vdbeSorterOpenTempFile(tls, db, (*SortSubtask)(unsafe.Pointer(pTask)).Ffile2.FiEof, pTask+56)
(*SortSubtask)(unsafe.Pointer(pTask)).Ffile2.FiEof = int64(0)
}
if rc == SQLITE_OK {
- (*SorterFile)(unsafe.Pointer((pIncr + 32 /* &.aFile */) + 1*16)).FpFd = (*SortSubtask)(unsafe.Pointer(pTask)).Ffile2.FpFd
+ (*SorterFile)(unsafe.Pointer(pIncr + 32 + 1*16)).FpFd = (*SortSubtask)(unsafe.Pointer(pTask)).Ffile2.FpFd
(*IncrMerger)(unsafe.Pointer(pIncr)).FiStartOff = (*SortSubtask)(unsafe.Pointer(pTask)).Ffile2.FiEof
- *(*I64)(unsafe.Pointer(pTask + 56 /* &.file2 */ + 8 /* &.iEof */)) += (I64(mxSz))
+ *(*I64)(unsafe.Pointer(pTask + 56 + 8)) += I64(mxSz)
}
}
}
- if (rc == SQLITE_OK) && ((*IncrMerger)(unsafe.Pointer(pIncr)).FbUseThread != 0) {
+ if rc == SQLITE_OK && (*IncrMerger)(unsafe.Pointer(pIncr)).FbUseThread != 0 {
// Use the current thread to populate aFile[1], even though this
// PmaReader is multi-threaded. If this is an INCRINIT_TASK object,
// then this function is already running in background thread
@@ -77167,7 +78150,7 @@ func vdbePmaReaderIncrMergeInit(tls *libc.TLS, pReadr uintptr, eMode int32) int3
rc = vdbeIncrPopulate(tls, pIncr)
}
- if (rc == SQLITE_OK) && ((SQLITE_MAX_WORKER_THREADS == 0) || (eMode != INCRINIT_TASK)) {
+ if rc == SQLITE_OK && (SQLITE_MAX_WORKER_THREADS == 0 || eMode != INCRINIT_TASK) {
rc = vdbePmaReaderNext(tls, pReadr)
}
@@ -77176,7 +78159,7 @@ func vdbePmaReaderIncrMergeInit(tls *libc.TLS, pReadr uintptr, eMode int32) int3
// The main routine for vdbePmaReaderIncrMergeInit() operations run in
// background threads.
-func vdbePmaReaderBgIncrInit(tls *libc.TLS, pCtx uintptr) uintptr { /* sqlite3.c:97572:13: */
+func vdbePmaReaderBgIncrInit(tls *libc.TLS, pCtx uintptr) uintptr { /* sqlite3.c:97939:13: */
var pReader uintptr = pCtx
var pRet uintptr = uintptr(vdbePmaReaderIncrMergeInit(tls, pReader, INCRINIT_TASK))
(*SortSubtask)(unsafe.Pointer((*IncrMerger)(unsafe.Pointer((*PmaReader)(unsafe.Pointer(pReader)).FpIncr)).FpTask)).FbDone = 1
@@ -77192,7 +78175,7 @@ func vdbePmaReaderBgIncrInit(tls *libc.TLS, pCtx uintptr) uintptr { /* sqlite3.c
// then a background thread is launched to call vdbePmaReaderIncrMergeInit().
// Or, if the IncrMerger is single threaded, the same function is called
// using the current thread.
-func vdbePmaReaderIncrInit(tls *libc.TLS, pReadr uintptr, eMode int32) int32 { /* sqlite3.c:97593:12: */
+func vdbePmaReaderIncrInit(tls *libc.TLS, pReadr uintptr, eMode int32) int32 { /* sqlite3.c:97960:12: */
var pIncr uintptr = (*PmaReader)(unsafe.Pointer(pReadr)).FpIncr // Incremental merger
var rc int32 = SQLITE_OK // Return code
if pIncr != 0 {
@@ -77219,7 +78202,7 @@ func vdbePmaReaderIncrInit(tls *libc.TLS, pReadr uintptr, eMode int32) int32 { /
// set to the offset immediately following the last byte of the last
// PMA before returning. If an error does occur, then the final value of
// *piOffset is undefined.
-func vdbeMergeEngineLevel0(tls *libc.TLS, pTask uintptr, nPMA int32, piOffset uintptr, ppOut uintptr) int32 { /* sqlite3.c:97623:12: */
+func vdbeMergeEngineLevel0(tls *libc.TLS, pTask uintptr, nPMA int32, piOffset uintptr, ppOut uintptr) int32 { /* sqlite3.c:97990:12: */
bp := tls.Alloc(8)
defer tls.Free(8)
@@ -77233,10 +78216,10 @@ func vdbeMergeEngineLevel0(tls *libc.TLS, pTask uintptr, nPMA int32, piOffset ui
rc = SQLITE_NOMEM
}
- for i = 0; (i < nPMA) && (rc == SQLITE_OK); i++ {
+ for i = 0; i < nPMA && rc == SQLITE_OK; i++ {
*(*I64)(unsafe.Pointer(bp /* nDummy */)) = int64(0)
- var pReadr uintptr = ((*MergeEngine)(unsafe.Pointer(pNew)).FaReadr + uintptr(i)*56)
- rc = vdbePmaReaderInit(tls, pTask, (pTask + 40 /* &.file */), iOff, pReadr, bp /* &nDummy */)
+ var pReadr uintptr = (*MergeEngine)(unsafe.Pointer(pNew)).FaReadr + uintptr(i)*56
+ rc = vdbePmaReaderInit(tls, pTask, pTask+40, iOff, pReadr, bp /* &nDummy */)
iOff = (*PmaReader)(unsafe.Pointer(pReadr)).FiEof
}
@@ -77256,11 +78239,11 @@ func vdbeMergeEngineLevel0(tls *libc.TLS, pTask uintptr, nPMA int32, piOffset ui
// nPMA<=16 -> TreeDepth() == 0
// nPMA<=256 -> TreeDepth() == 1
// nPMA<=65536 -> TreeDepth() == 2
-func vdbeSorterTreeDepth(tls *libc.TLS, nPMA int32) int32 { /* sqlite3.c:97662:12: */
+func vdbeSorterTreeDepth(tls *libc.TLS, nPMA int32) int32 { /* sqlite3.c:98029:12: */
var nDepth int32 = 0
var nDiv I64 = int64(SORTER_MAX_MERGE_COUNT)
for nDiv < I64(nPMA) {
- nDiv = (nDiv * int64(SORTER_MAX_MERGE_COUNT))
+ nDiv = nDiv * int64(SORTER_MAX_MERGE_COUNT)
nDepth++
}
return nDepth
@@ -77272,7 +78255,7 @@ func vdbeSorterTreeDepth(tls *libc.TLS, nPMA int32) int32 { /* sqlite3.c:97662:1
//
// If successful, SQLITE_OK is returned. If an error occurs, an SQLite error
// code is returned and pLeaf is freed.
-func vdbeSorterAddToTree(tls *libc.TLS, pTask uintptr, nDepth int32, iSeq int32, pRoot uintptr, pLeaf uintptr) int32 { /* sqlite3.c:97680:12: */
+func vdbeSorterAddToTree(tls *libc.TLS, pTask uintptr, nDepth int32, iSeq int32, pRoot uintptr, pLeaf uintptr) int32 { /* sqlite3.c:98047:12: */
bp := tls.Alloc(4)
defer tls.Free(4)
@@ -77285,29 +78268,29 @@ func vdbeSorterAddToTree(tls *libc.TLS, pTask uintptr, nDepth int32, iSeq int32,
rc = vdbeIncrMergerNew(tls, pTask, pLeaf, bp /* &pIncr */)
for i = 1; i < nDepth; i++ {
- nDiv = (nDiv * SORTER_MAX_MERGE_COUNT)
+ nDiv = nDiv * SORTER_MAX_MERGE_COUNT
}
- for i = 1; (i < nDepth) && (rc == SQLITE_OK); i++ {
- var iIter int32 = ((iSeq / nDiv) % SORTER_MAX_MERGE_COUNT)
- var pReadr uintptr = ((*MergeEngine)(unsafe.Pointer(p)).FaReadr + uintptr(iIter)*56)
+ for i = 1; i < nDepth && rc == SQLITE_OK; i++ {
+ var iIter int32 = iSeq / nDiv % SORTER_MAX_MERGE_COUNT
+ var pReadr uintptr = (*MergeEngine)(unsafe.Pointer(p)).FaReadr + uintptr(iIter)*56
if (*PmaReader)(unsafe.Pointer(pReadr)).FpIncr == uintptr(0) {
var pNew uintptr = vdbeMergeEngineNew(tls, SORTER_MAX_MERGE_COUNT)
if pNew == uintptr(0) {
rc = SQLITE_NOMEM
} else {
- rc = vdbeIncrMergerNew(tls, pTask, pNew, (pReadr + 48 /* &.pIncr */))
+ rc = vdbeIncrMergerNew(tls, pTask, pNew, pReadr+48)
}
}
if rc == SQLITE_OK {
p = (*IncrMerger)(unsafe.Pointer((*PmaReader)(unsafe.Pointer(pReadr)).FpIncr)).FpMerger
- nDiv = (nDiv / SORTER_MAX_MERGE_COUNT)
+ nDiv = nDiv / SORTER_MAX_MERGE_COUNT
}
}
if rc == SQLITE_OK {
- (*PmaReader)(unsafe.Pointer((*MergeEngine)(unsafe.Pointer(p)).FaReadr + uintptr((iSeq%SORTER_MAX_MERGE_COUNT))*56)).FpIncr = *(*uintptr)(unsafe.Pointer(bp /* pIncr */))
+ (*PmaReader)(unsafe.Pointer((*MergeEngine)(unsafe.Pointer(p)).FaReadr + uintptr(iSeq%SORTER_MAX_MERGE_COUNT)*56)).FpIncr = *(*uintptr)(unsafe.Pointer(bp /* pIncr */))
} else {
vdbeIncrFree(tls, *(*uintptr)(unsafe.Pointer(bp /* pIncr */)))
}
@@ -77323,7 +78306,7 @@ func vdbeSorterAddToTree(tls *libc.TLS, pTask uintptr, nDepth int32, iSeq int32,
// MergeEngine object at the root of the tree before returning. Or, if an
// error occurs, an SQLite error code is returned and the final value
// of *ppOut is undefined.
-func vdbeSorterMergeTreeBuild(tls *libc.TLS, pSorter uintptr, ppOut uintptr) int32 { /* sqlite3.c:97736:12: */
+func vdbeSorterMergeTreeBuild(tls *libc.TLS, pSorter uintptr, ppOut uintptr) int32 { /* sqlite3.c:98103:12: */
bp := tls.Alloc(16)
defer tls.Free(16)
@@ -77342,10 +78325,10 @@ func vdbeSorterMergeTreeBuild(tls *libc.TLS, pSorter uintptr, ppOut uintptr) int
}
}
- for iTask = 0; (rc == SQLITE_OK) && (iTask < int32((*VdbeSorter)(unsafe.Pointer(pSorter)).FnTask)); iTask++ {
- var pTask uintptr = ((pSorter + 64 /* &.aTask */) + uintptr(iTask)*72)
+ for iTask = 0; rc == SQLITE_OK && iTask < int32((*VdbeSorter)(unsafe.Pointer(pSorter)).FnTask); iTask++ {
+ var pTask uintptr = pSorter + 64 + uintptr(iTask)*72
- if (SQLITE_MAX_WORKER_THREADS == 0) || ((*SortSubtask)(unsafe.Pointer(pTask)).FnPMA != 0) {
+ if SQLITE_MAX_WORKER_THREADS == 0 || (*SortSubtask)(unsafe.Pointer(pTask)).FnPMA != 0 {
*(*uintptr)(unsafe.Pointer(bp + 8 /* pRoot */)) = uintptr(0) // Root node of tree for this task
var nDepth int32 = vdbeSorterTreeDepth(tls, (*SortSubtask)(unsafe.Pointer(pTask)).FnPMA)
*(*I64)(unsafe.Pointer(bp /* iReadOff */)) = int64(0)
@@ -77356,16 +78339,16 @@ func vdbeSorterMergeTreeBuild(tls *libc.TLS, pSorter uintptr, ppOut uintptr) int
var i int32
var iSeq int32 = 0
*(*uintptr)(unsafe.Pointer(bp + 8 /* pRoot */)) = vdbeMergeEngineNew(tls, SORTER_MAX_MERGE_COUNT)
- if *(*uintptr)(unsafe.Pointer(bp + 8 /* pRoot */)) == uintptr(0) {
+ if *(*uintptr)(unsafe.Pointer(bp + 8)) == uintptr(0) {
rc = SQLITE_NOMEM
}
- for i = 0; (i < (*SortSubtask)(unsafe.Pointer(pTask)).FnPMA) && (rc == SQLITE_OK); i = i + (SORTER_MAX_MERGE_COUNT) {
+ for i = 0; i < (*SortSubtask)(unsafe.Pointer(pTask)).FnPMA && rc == SQLITE_OK; i = i + SORTER_MAX_MERGE_COUNT {
*(*uintptr)(unsafe.Pointer(bp + 12 /* pMerger */)) = uintptr(0) // New level-0 PMA merger
var nReader int32 // Number of level-0 PMAs to merge
nReader = func() int32 {
- if ((*SortSubtask)(unsafe.Pointer(pTask)).FnPMA - i) < (SORTER_MAX_MERGE_COUNT) {
- return ((*SortSubtask)(unsafe.Pointer(pTask)).FnPMA - i)
+ if (*SortSubtask)(unsafe.Pointer(pTask)).FnPMA-i < SORTER_MAX_MERGE_COUNT {
+ return (*SortSubtask)(unsafe.Pointer(pTask)).FnPMA - i
}
return SORTER_MAX_MERGE_COUNT
}()
@@ -77378,7 +78361,7 @@ func vdbeSorterMergeTreeBuild(tls *libc.TLS, pSorter uintptr, ppOut uintptr) int
if rc == SQLITE_OK {
if pMain != uintptr(0) {
- rc = vdbeIncrMergerNew(tls, pTask, *(*uintptr)(unsafe.Pointer(bp + 8 /* pRoot */)), ((*MergeEngine)(unsafe.Pointer(pMain)).FaReadr + uintptr(iTask)*56 + 48 /* &.pIncr */))
+ rc = vdbeIncrMergerNew(tls, pTask, *(*uintptr)(unsafe.Pointer(bp + 8 /* pRoot */)), (*MergeEngine)(unsafe.Pointer(pMain)).FaReadr+uintptr(iTask)*56+48)
} else {
pMain = *(*uintptr)(unsafe.Pointer(bp + 8 /* pRoot */))
@@ -77404,18 +78387,18 @@ func vdbeSorterMergeTreeBuild(tls *libc.TLS, pSorter uintptr, ppOut uintptr) int
// all records stored in the sorter.
//
// SQLITE_OK is returned if successful, or an SQLite error code otherwise.
-func vdbeSorterSetupMerge(tls *libc.TLS, pSorter uintptr) int32 { /* sqlite3.c:97815:12: */
+func vdbeSorterSetupMerge(tls *libc.TLS, pSorter uintptr) int32 { /* sqlite3.c:98182:12: */
bp := tls.Alloc(4)
defer tls.Free(4)
var rc int32 // Return code
- var pTask0 uintptr = (pSorter + 64 /* &.aTask */)
+ var pTask0 uintptr = pSorter + 64
*(*uintptr)(unsafe.Pointer(bp /* pMain */)) = uintptr(0)
var db uintptr = (*VdbeSorter)(unsafe.Pointer((*SortSubtask)(unsafe.Pointer(pTask0)).FpSorter)).Fdb
var i int32
var xCompare SorterCompare = vdbeSorterGetCompare(tls, pSorter)
for i = 0; i < int32((*VdbeSorter)(unsafe.Pointer(pSorter)).FnTask); i++ {
- (*SortSubtask)(unsafe.Pointer((pSorter + 64 /* &.aTask */) + uintptr(i)*72)).FxCompare = xCompare
+ (*SortSubtask)(unsafe.Pointer(pSorter + 64 + uintptr(i)*72)).FxCompare = xCompare
}
rc = vdbeSorterMergeTreeBuild(tls, pSorter, bp /* &pMain */)
@@ -77424,7 +78407,7 @@ func vdbeSorterSetupMerge(tls *libc.TLS, pSorter uintptr) int32 { /* sqlite3.c:9
if (*VdbeSorter)(unsafe.Pointer(pSorter)).FbUseThreads != 0 {
var iTask int32
var pReadr uintptr = uintptr(0)
- var pLast uintptr = ((pSorter + 64 /* &.aTask */) + uintptr((int32((*VdbeSorter)(unsafe.Pointer(pSorter)).FnTask)-1))*72)
+ var pLast uintptr = pSorter + 64 + uintptr(int32((*VdbeSorter)(unsafe.Pointer(pSorter)).FnTask)-1)*72
rc = vdbeSortAllocUnpacked(tls, pLast)
if rc == SQLITE_OK {
pReadr = Xsqlite3DbMallocZero(tls, db, uint64(unsafe.Sizeof(PmaReader{})))
@@ -77434,17 +78417,17 @@ func vdbeSorterSetupMerge(tls *libc.TLS, pSorter uintptr) int32 { /* sqlite3.c:9
}
}
if rc == SQLITE_OK {
- rc = vdbeIncrMergerNew(tls, pLast, *(*uintptr)(unsafe.Pointer(bp /* pMain */)), (pReadr + 48 /* &.pIncr */))
+ rc = vdbeIncrMergerNew(tls, pLast, *(*uintptr)(unsafe.Pointer(bp /* pMain */)), pReadr+48)
if rc == SQLITE_OK {
vdbeIncrMergerSetThreads(tls, (*PmaReader)(unsafe.Pointer(pReadr)).FpIncr)
- for iTask = 0; iTask < (int32((*VdbeSorter)(unsafe.Pointer(pSorter)).FnTask) - 1); iTask++ {
+ for iTask = 0; iTask < int32((*VdbeSorter)(unsafe.Pointer(pSorter)).FnTask)-1; iTask++ {
var pIncr uintptr
- if libc.AssignUintptr(&pIncr, (*PmaReader)(unsafe.Pointer((*MergeEngine)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* pMain */)))).FaReadr+uintptr(iTask)*56)).FpIncr) != 0 {
+ if libc.AssignUintptr(&pIncr, (*PmaReader)(unsafe.Pointer((*MergeEngine)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FaReadr+uintptr(iTask)*56)).FpIncr) != 0 {
vdbeIncrMergerSetThreads(tls, pIncr)
}
}
- for iTask = 0; (rc == SQLITE_OK) && (iTask < int32((*VdbeSorter)(unsafe.Pointer(pSorter)).FnTask)); iTask++ {
+ for iTask = 0; rc == SQLITE_OK && iTask < int32((*VdbeSorter)(unsafe.Pointer(pSorter)).FnTask); iTask++ {
// Check that:
//
// a) The incremental merge object is configured to use the
@@ -77453,7 +78436,7 @@ func vdbeSorterSetupMerge(tls *libc.TLS, pSorter uintptr) int32 { /* sqlite3.c:9
// in single-threaded mode. This is important, as the
// root merge (INCRINIT_ROOT) will be using the same task
// object.
- var p uintptr = ((*MergeEngine)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* pMain */)))).FaReadr + uintptr(iTask)*56)
+ var p uintptr = (*MergeEngine)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FaReadr + uintptr(iTask)*56
rc = vdbePmaReaderIncrInit(tls, p, INCRINIT_TASK)
}
@@ -77479,11 +78462,11 @@ func vdbeSorterSetupMerge(tls *libc.TLS, pSorter uintptr) int32 { /* sqlite3.c:9
// Once the sorter has been populated by calls to sqlite3VdbeSorterWrite,
// this function is called to prepare for iterating through the records
// in sorted order.
-func Xsqlite3VdbeSorterRewind(tls *libc.TLS, pCsr uintptr, pbEof uintptr) int32 { /* sqlite3.c:97897:20: */
+func Xsqlite3VdbeSorterRewind(tls *libc.TLS, pCsr uintptr, pbEof uintptr) int32 { /* sqlite3.c:98264:20: */
var pSorter uintptr
var rc int32 = SQLITE_OK // Return code
- pSorter = *(*uintptr)(unsafe.Pointer(pCsr + 40 /* &.uc */))
+ pSorter = *(*uintptr)(unsafe.Pointer(pCsr + 40))
// If no data has been written to disk, then do not do so now. Instead,
// sort the VdbeSorter.pRecord list. The vdbe layer will read data directly
@@ -77491,7 +78474,7 @@ func Xsqlite3VdbeSorterRewind(tls *libc.TLS, pCsr uintptr, pbEof uintptr) int32
if int32((*VdbeSorter)(unsafe.Pointer(pSorter)).FbUsePMA) == 0 {
if (*VdbeSorter)(unsafe.Pointer(pSorter)).Flist.FpList != 0 {
*(*int32)(unsafe.Pointer(pbEof)) = 0
- rc = vdbeSorterSort(tls, (pSorter + 64 /* &.aTask */), (pSorter + 36 /* &.list */))
+ rc = vdbeSorterSort(tls, pSorter+64, pSorter+36)
} else {
*(*int32)(unsafe.Pointer(pbEof)) = 1
}
@@ -77524,34 +78507,34 @@ func Xsqlite3VdbeSorterRewind(tls *libc.TLS, pCsr uintptr, pbEof uintptr) int32
// SQLITE_OK success
// SQLITE_DONE end of data
// otherwise some kind of error.
-func Xsqlite3VdbeSorterNext(tls *libc.TLS, db uintptr, pCsr uintptr) int32 { /* sqlite3.c:97949:20: */
+func Xsqlite3VdbeSorterNext(tls *libc.TLS, db uintptr, pCsr uintptr) int32 { /* sqlite3.c:98316:20: */
bp := tls.Alloc(4)
defer tls.Free(4)
var pSorter uintptr
var rc int32 // Return code
- pSorter = *(*uintptr)(unsafe.Pointer(pCsr + 40 /* &.uc */))
+ pSorter = *(*uintptr)(unsafe.Pointer(pCsr + 40))
if (*VdbeSorter)(unsafe.Pointer(pSorter)).FbUsePMA != 0 {
if (*VdbeSorter)(unsafe.Pointer(pSorter)).FbUseThreads != 0 {
rc = vdbePmaReaderNext(tls, (*VdbeSorter)(unsafe.Pointer(pSorter)).FpReader)
- if (rc == SQLITE_OK) && ((*PmaReader)(unsafe.Pointer((*VdbeSorter)(unsafe.Pointer(pSorter)).FpReader)).FpFd == uintptr(0)) {
+ if rc == SQLITE_OK && (*PmaReader)(unsafe.Pointer((*VdbeSorter)(unsafe.Pointer(pSorter)).FpReader)).FpFd == uintptr(0) {
rc = SQLITE_DONE
}
} else {
*(*int32)(unsafe.Pointer(bp /* res */)) = 0
rc = vdbeMergeEngineStep(tls, (*VdbeSorter)(unsafe.Pointer(pSorter)).FpMerger, bp /* &res */)
- if (rc == SQLITE_OK) && (*(*int32)(unsafe.Pointer(bp /* res */)) != 0) {
+ if rc == SQLITE_OK && *(*int32)(unsafe.Pointer(bp)) != 0 {
rc = SQLITE_DONE
}
}
} else {
var pFree uintptr = (*VdbeSorter)(unsafe.Pointer(pSorter)).Flist.FpList
- (*VdbeSorter)(unsafe.Pointer(pSorter)).Flist.FpList = *(*uintptr)(unsafe.Pointer(pFree + 4 /* &.u */))
- *(*uintptr)(unsafe.Pointer(pFree + 4 /* &.u */)) = uintptr(0)
+ (*VdbeSorter)(unsafe.Pointer(pSorter)).Flist.FpList = *(*uintptr)(unsafe.Pointer(pFree + 4))
+ *(*uintptr)(unsafe.Pointer(pFree + 4)) = uintptr(0)
if (*VdbeSorter)(unsafe.Pointer(pSorter)).Flist.FaMemory == uintptr(0) {
vdbeSorterRecordFree(tls, db, pFree)
}
@@ -77566,26 +78549,26 @@ func Xsqlite3VdbeSorterNext(tls *libc.TLS, db uintptr, pCsr uintptr) int32 { /*
// Return a pointer to a buffer owned by the sorter that contains the
// current key.
-func vdbeSorterRowkey(tls *libc.TLS, pSorter uintptr, pnKey uintptr) uintptr { /* sqlite3.c:97987:13: */
+func vdbeSorterRowkey(tls *libc.TLS, pSorter uintptr, pnKey uintptr) uintptr { /* sqlite3.c:98354:13: */
var pKey uintptr
if (*VdbeSorter)(unsafe.Pointer(pSorter)).FbUsePMA != 0 {
var pReader uintptr
if (*VdbeSorter)(unsafe.Pointer(pSorter)).FbUseThreads != 0 {
pReader = (*VdbeSorter)(unsafe.Pointer(pSorter)).FpReader
} else {
- pReader = ((*MergeEngine)(unsafe.Pointer((*VdbeSorter)(unsafe.Pointer(pSorter)).FpMerger)).FaReadr + uintptr(*(*int32)(unsafe.Pointer((*MergeEngine)(unsafe.Pointer((*VdbeSorter)(unsafe.Pointer(pSorter)).FpMerger)).FaTree + 1*4)))*56)
+ pReader = (*MergeEngine)(unsafe.Pointer((*VdbeSorter)(unsafe.Pointer(pSorter)).FpMerger)).FaReadr + uintptr(*(*int32)(unsafe.Pointer((*MergeEngine)(unsafe.Pointer((*VdbeSorter)(unsafe.Pointer(pSorter)).FpMerger)).FaTree + 1*4)))*56
}
*(*int32)(unsafe.Pointer(pnKey)) = (*PmaReader)(unsafe.Pointer(pReader)).FnKey
pKey = (*PmaReader)(unsafe.Pointer(pReader)).FaKey
} else {
*(*int32)(unsafe.Pointer(pnKey)) = (*SorterRecord)(unsafe.Pointer((*VdbeSorter)(unsafe.Pointer(pSorter)).Flist.FpList)).FnVal
- pKey = (((*VdbeSorter)(unsafe.Pointer(pSorter)).Flist.FpList) + uintptr(1)*8)
+ pKey = (*VdbeSorter)(unsafe.Pointer(pSorter)).Flist.FpList + uintptr(1)*8
}
return pKey
}
// Copy the current sorter key into the memory cell pOut.
-func Xsqlite3VdbeSorterRowkey(tls *libc.TLS, pCsr uintptr, pOut uintptr) int32 { /* sqlite3.c:98014:20: */
+func Xsqlite3VdbeSorterRowkey(tls *libc.TLS, pCsr uintptr, pOut uintptr) int32 { /* sqlite3.c:98381:20: */
bp := tls.Alloc(4)
defer tls.Free(4)
@@ -77594,13 +78577,13 @@ func Xsqlite3VdbeSorterRowkey(tls *libc.TLS, pCsr uintptr, pOut uintptr) int32 {
// var nKey int32 at bp, 4
// Sorter key to copy into pOut
- pSorter = *(*uintptr)(unsafe.Pointer(pCsr + 40 /* &.uc */))
+ pSorter = *(*uintptr)(unsafe.Pointer(pCsr + 40))
pKey = vdbeSorterRowkey(tls, pSorter, bp /* &nKey */)
- if Xsqlite3VdbeMemClearAndResize(tls, pOut, *(*int32)(unsafe.Pointer(bp /* nKey */))) != 0 {
+ if Xsqlite3VdbeMemClearAndResize(tls, pOut, *(*int32)(unsafe.Pointer(bp))) != 0 {
return SQLITE_NOMEM
}
(*Mem)(unsafe.Pointer(pOut)).Fn = *(*int32)(unsafe.Pointer(bp /* nKey */))
- (*Mem)(unsafe.Pointer(pOut)).Fflags = (U16((int32((*Mem)(unsafe.Pointer((pOut))).Fflags) & libc.CplInt32((MEM_TypeMask | MEM_Zero))) | MEM_Blob))
+ (*Mem)(unsafe.Pointer(pOut)).Fflags = U16(int32((*Mem)(unsafe.Pointer(pOut)).Fflags)&libc.CplInt32(MEM_TypeMask|MEM_Zero) | MEM_Blob)
libc.Xmemcpy(tls, (*Mem)(unsafe.Pointer(pOut)).Fz, pKey, uint32(*(*int32)(unsafe.Pointer(bp /* nKey */))))
return SQLITE_OK
@@ -77620,7 +78603,7 @@ func Xsqlite3VdbeSorterRowkey(tls *libc.TLS, pCsr uintptr, pOut uintptr) int32 {
//
// This routine forms the core of the OP_SorterCompare opcode, which in
// turn is used to verify uniqueness when constructing a UNIQUE INDEX.
-func Xsqlite3VdbeSorterCompare(tls *libc.TLS, pCsr uintptr, pVal uintptr, nKeyCol int32, pRes uintptr) int32 { /* sqlite3.c:98047:20: */
+func Xsqlite3VdbeSorterCompare(tls *libc.TLS, pCsr uintptr, pVal uintptr, nKeyCol int32, pRes uintptr) int32 { /* sqlite3.c:98414:20: */
bp := tls.Alloc(4)
defer tls.Free(4)
@@ -77632,11 +78615,11 @@ func Xsqlite3VdbeSorterCompare(tls *libc.TLS, pCsr uintptr, pVal uintptr, nKeyCo
// var nKey int32 at bp, 4
// Sorter key to compare pVal with
- pSorter = *(*uintptr)(unsafe.Pointer(pCsr + 40 /* &.uc */))
+ pSorter = *(*uintptr)(unsafe.Pointer(pCsr + 40))
r2 = (*VdbeSorter)(unsafe.Pointer(pSorter)).FpUnpacked
pKeyInfo = (*VdbeCursor)(unsafe.Pointer(pCsr)).FpKeyInfo
if r2 == uintptr(0) {
- r2 = libc.AssignPtrUintptr(pSorter+32 /* &.pUnpacked */, Xsqlite3VdbeAllocUnpackedRecord(tls, pKeyInfo))
+ r2 = libc.AssignPtrUintptr(pSorter+32, Xsqlite3VdbeAllocUnpackedRecord(tls, pKeyInfo))
if r2 == uintptr(0) {
return SQLITE_NOMEM
}
@@ -77646,7 +78629,7 @@ func Xsqlite3VdbeSorterCompare(tls *libc.TLS, pCsr uintptr, pVal uintptr, nKeyCo
pKey = vdbeSorterRowkey(tls, pSorter, bp /* &nKey */)
Xsqlite3VdbeRecordUnpack(tls, pKeyInfo, *(*int32)(unsafe.Pointer(bp /* nKey */)), pKey, r2)
for i = 0; i < nKeyCol; i++ {
- if (int32((*Mem)(unsafe.Pointer((*UnpackedRecord)(unsafe.Pointer(r2)).FaMem+uintptr(i)*40)).Fflags) & MEM_Null) != 0 {
+ if int32((*Mem)(unsafe.Pointer((*UnpackedRecord)(unsafe.Pointer(r2)).FaMem+uintptr(i)*40)).Fflags)&MEM_Null != 0 {
*(*int32)(unsafe.Pointer(pRes)) = -1
return SQLITE_OK
}
@@ -77712,7 +78695,7 @@ type MemJournal1 = struct {
FpVfs uintptr
FzJournal uintptr
F__ccgo_pad1 [4]byte
-} /* sqlite3.c:98540:9 */
+} /* sqlite3.c:98907:9 */
//************* End of vdbesort.c *******************************************
//************* Begin file vdbevtab.c ***************************************
@@ -77759,61 +78742,61 @@ type MemJournal1 = struct {
// #include "sqliteInt.h"
// Forward references to internal structures
-type MemJournal = MemJournal1 /* sqlite3.c:98540:27 */
+type MemJournal = MemJournal1 /* sqlite3.c:98907:27 */
type FilePoint1 = struct {
FiOffset Sqlite3_int64
FpChunk uintptr
F__ccgo_pad1 [4]byte
-} /* sqlite3.c:98540:9 */
+} /* sqlite3.c:98907:9 */
-type FilePoint = FilePoint1 /* sqlite3.c:98541:26 */
+type FilePoint = FilePoint1 /* sqlite3.c:98908:26 */
type FileChunk1 = struct {
FpNext uintptr
FzChunk [8]U8
-} /* sqlite3.c:98540:9 */
+} /* sqlite3.c:98907:9 */
-type FileChunk = FileChunk1 /* sqlite3.c:98542:26 */
+type FileChunk = FileChunk1 /* sqlite3.c:98909:26 */
// Read data from the in-memory journal file. This is the implementation
// of the sqlite3_vfs.xRead method.
-func memjrnlRead(tls *libc.TLS, pJfd uintptr, zBuf uintptr, iAmt int32, iOfst Sqlite_int64) int32 { /* sqlite3.c:98597:12: */
+func memjrnlRead(tls *libc.TLS, pJfd uintptr, zBuf uintptr, iAmt int32, iOfst Sqlite_int64) int32 { /* sqlite3.c:98964:12: */
var p uintptr = pJfd
var zOut uintptr = zBuf
var nRead int32 = iAmt
var iChunkOffset int32
var pChunk uintptr
- if (Sqlite_int64(iAmt) + iOfst) > (*MemJournal)(unsafe.Pointer(p)).Fendpoint.FiOffset {
- return (SQLITE_IOERR | (int32(2) << 8))
+ if Sqlite_int64(iAmt)+iOfst > (*MemJournal)(unsafe.Pointer(p)).Fendpoint.FiOffset {
+ return SQLITE_IOERR | int32(2)<<8
}
- if ((*MemJournal)(unsafe.Pointer(p)).Freadpoint.FiOffset != iOfst) || (iOfst == int64(0)) {
+ if (*MemJournal)(unsafe.Pointer(p)).Freadpoint.FiOffset != iOfst || iOfst == int64(0) {
var iOff Sqlite3_int64 = int64(0)
- for pChunk = (*MemJournal)(unsafe.Pointer(p)).FpFirst; (pChunk != 0) && ((iOff + Sqlite3_int64((*MemJournal)(unsafe.Pointer(p)).FnChunkSize)) <= iOfst); pChunk = (*FileChunk)(unsafe.Pointer(pChunk)).FpNext {
- iOff = iOff + (Sqlite3_int64((*MemJournal)(unsafe.Pointer(p)).FnChunkSize))
+ for pChunk = (*MemJournal)(unsafe.Pointer(p)).FpFirst; pChunk != 0 && iOff+Sqlite3_int64((*MemJournal)(unsafe.Pointer(p)).FnChunkSize) <= iOfst; pChunk = (*FileChunk)(unsafe.Pointer(pChunk)).FpNext {
+ iOff = iOff + Sqlite3_int64((*MemJournal)(unsafe.Pointer(p)).FnChunkSize)
}
} else {
pChunk = (*MemJournal)(unsafe.Pointer(p)).Freadpoint.FpChunk
}
- iChunkOffset = (int32(iOfst % Sqlite_int64((*MemJournal)(unsafe.Pointer(p)).FnChunkSize)))
- for ok := true; ok; ok = (((nRead >= 0) && ((libc.AssignUintptr(&pChunk, (*FileChunk)(unsafe.Pointer(pChunk)).FpNext)) != uintptr(0))) && (nRead > 0)) {
- var iSpace int32 = ((*MemJournal)(unsafe.Pointer(p)).FnChunkSize - iChunkOffset)
+ iChunkOffset = int32(iOfst % Sqlite_int64((*MemJournal)(unsafe.Pointer(p)).FnChunkSize))
+ for ok := true; ok; ok = nRead >= 0 && libc.AssignUintptr(&pChunk, (*FileChunk)(unsafe.Pointer(pChunk)).FpNext) != uintptr(0) && nRead > 0 {
+ var iSpace int32 = (*MemJournal)(unsafe.Pointer(p)).FnChunkSize - iChunkOffset
var nCopy int32 = func() int32 {
- if (nRead) < ((*MemJournal)(unsafe.Pointer(p)).FnChunkSize - iChunkOffset) {
+ if nRead < (*MemJournal)(unsafe.Pointer(p)).FnChunkSize-iChunkOffset {
return nRead
}
- return ((*MemJournal)(unsafe.Pointer(p)).FnChunkSize - iChunkOffset)
+ return (*MemJournal)(unsafe.Pointer(p)).FnChunkSize - iChunkOffset
}()
- libc.Xmemcpy(tls, zOut, (pChunk + 4 /* &.zChunk */ + uintptr(iChunkOffset)), uint32(nCopy))
+ libc.Xmemcpy(tls, zOut, pChunk+4+uintptr(iChunkOffset), uint32(nCopy))
zOut += uintptr(nCopy)
- nRead = nRead - (iSpace)
+ nRead = nRead - iSpace
iChunkOffset = 0
}
(*MemJournal)(unsafe.Pointer(p)).Freadpoint.FiOffset = func() int64 {
if pChunk != 0 {
- return (iOfst + Sqlite_int64(iAmt))
+ return iOfst + Sqlite_int64(iAmt)
}
return int64(0)
}()
@@ -77823,7 +78806,7 @@ func memjrnlRead(tls *libc.TLS, pJfd uintptr, zBuf uintptr, iAmt int32, iOfst Sq
}
// Free the list of FileChunk structures headed at MemJournal.pFirst.
-func memjrnlFreeChunks(tls *libc.TLS, pFirst uintptr) { /* sqlite3.c:98644:13: */
+func memjrnlFreeChunks(tls *libc.TLS, pFirst uintptr) { /* sqlite3.c:99011:13: */
var pIter uintptr
var pNext uintptr
for pIter = pFirst; pIter != 0; pIter = pNext {
@@ -77833,7 +78816,7 @@ func memjrnlFreeChunks(tls *libc.TLS, pFirst uintptr) { /* sqlite3.c:98644:13: *
}
// Flush the contents of memory to a real file on disk.
-func memjrnlCreateFile(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:98656:12: */
+func memjrnlCreateFile(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:99023:12: */
var rc int32
var pReal uintptr = p
var copy = *(*MemJournal)(unsafe.Pointer(p))
@@ -77845,14 +78828,14 @@ func memjrnlCreateFile(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:98656:12:
var iOff I64 = int64(0)
var pIter uintptr
for pIter = copy.FpFirst; pIter != 0; pIter = (*FileChunk)(unsafe.Pointer(pIter)).FpNext {
- if (iOff + I64(nChunk)) > copy.Fendpoint.FiOffset {
- nChunk = (int32(copy.Fendpoint.FiOffset - iOff))
+ if iOff+I64(nChunk) > copy.Fendpoint.FiOffset {
+ nChunk = int32(copy.Fendpoint.FiOffset - iOff)
}
rc = Xsqlite3OsWrite(tls, pReal, pIter+4 /* &.zChunk */, nChunk, iOff)
if rc != 0 {
break
}
- iOff = iOff + (I64(nChunk))
+ iOff = iOff + I64(nChunk)
}
if rc == SQLITE_OK {
// No error has occurred. Free the in-memory buffers.
@@ -77871,14 +78854,14 @@ func memjrnlCreateFile(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:98656:12:
}
// Write data to the file.
-func memjrnlWrite(tls *libc.TLS, pJfd uintptr, zBuf uintptr, iAmt int32, iOfst Sqlite_int64) int32 { /* sqlite3.c:98695:12: */
+func memjrnlWrite(tls *libc.TLS, pJfd uintptr, zBuf uintptr, iAmt int32, iOfst Sqlite_int64) int32 { /* sqlite3.c:99062:12: */
var p uintptr = pJfd
var nWrite int32 = iAmt
var zWrite uintptr = zBuf
// If the file should be created now, create it and write the new data
// into the file on disk.
- if ((*MemJournal)(unsafe.Pointer(p)).FnSpill > 0) && ((Sqlite_int64(iAmt) + iOfst) > Sqlite_int64((*MemJournal)(unsafe.Pointer(p)).FnSpill)) {
+ if (*MemJournal)(unsafe.Pointer(p)).FnSpill > 0 && Sqlite_int64(iAmt)+iOfst > Sqlite_int64((*MemJournal)(unsafe.Pointer(p)).FnSpill) {
var rc int32 = memjrnlCreateFile(tls, p)
if rc == SQLITE_OK {
rc = Xsqlite3OsWrite(tls, pJfd, zBuf, iAmt, iOfst)
@@ -77894,19 +78877,19 @@ func memjrnlWrite(tls *libc.TLS, pJfd uintptr, zBuf uintptr, iAmt int32, iOfst S
{
for nWrite > 0 {
var pChunk uintptr = (*MemJournal)(unsafe.Pointer(p)).Fendpoint.FpChunk
- var iChunkOffset int32 = (int32((*MemJournal)(unsafe.Pointer(p)).Fendpoint.FiOffset % Sqlite3_int64((*MemJournal)(unsafe.Pointer(p)).FnChunkSize)))
+ var iChunkOffset int32 = int32((*MemJournal)(unsafe.Pointer(p)).Fendpoint.FiOffset % Sqlite3_int64((*MemJournal)(unsafe.Pointer(p)).FnChunkSize))
var iSpace int32 = func() int32 {
- if (nWrite) < ((*MemJournal)(unsafe.Pointer(p)).FnChunkSize - iChunkOffset) {
+ if nWrite < (*MemJournal)(unsafe.Pointer(p)).FnChunkSize-iChunkOffset {
return nWrite
}
- return ((*MemJournal)(unsafe.Pointer(p)).FnChunkSize - iChunkOffset)
+ return (*MemJournal)(unsafe.Pointer(p)).FnChunkSize - iChunkOffset
}()
if iChunkOffset == 0 {
// New chunk is required to extend the file.
- var pNew uintptr = Xsqlite3_malloc(tls, (int32(uint32(unsafe.Sizeof(FileChunk{})) + (uint32(((*MemJournal)(unsafe.Pointer(p)).FnChunkSize) - 8)))))
+ var pNew uintptr = Xsqlite3_malloc(tls, int32(uint32(unsafe.Sizeof(FileChunk{}))+uint32((*MemJournal)(unsafe.Pointer(p)).FnChunkSize-8)))
if !(pNew != 0) {
- return (SQLITE_IOERR | (int32(12) << 8))
+ return SQLITE_IOERR | int32(12)<<8
}
(*FileChunk)(unsafe.Pointer(pNew)).FpNext = uintptr(0)
if pChunk != 0 {
@@ -77919,10 +78902,10 @@ func memjrnlWrite(tls *libc.TLS, pJfd uintptr, zBuf uintptr, iAmt int32, iOfst S
(*MemJournal)(unsafe.Pointer(p)).Fendpoint.FpChunk = pNew
}
- libc.Xmemcpy(tls, ((*MemJournal)(unsafe.Pointer(p)).Fendpoint.FpChunk + 4 /* &.zChunk */ + uintptr(iChunkOffset)), zWrite, uint32(iSpace))
+ libc.Xmemcpy(tls, (*MemJournal)(unsafe.Pointer(p)).Fendpoint.FpChunk+4+uintptr(iChunkOffset), zWrite, uint32(iSpace))
zWrite += uintptr(iSpace)
- nWrite = nWrite - (iSpace)
- *(*Sqlite3_int64)(unsafe.Pointer(p + 16 /* &.endpoint */ /* &.iOffset */)) += (Sqlite3_int64(iSpace))
+ nWrite = nWrite - iSpace
+ *(*Sqlite3_int64)(unsafe.Pointer(p + 16)) += Sqlite3_int64(iSpace)
}
}
@@ -77932,7 +78915,7 @@ func memjrnlWrite(tls *libc.TLS, pJfd uintptr, zBuf uintptr, iAmt int32, iOfst S
}
// Truncate the in-memory file.
-func memjrnlTruncate(tls *libc.TLS, pJfd uintptr, size Sqlite_int64) int32 { /* sqlite3.c:98769:12: */
+func memjrnlTruncate(tls *libc.TLS, pJfd uintptr, size Sqlite_int64) int32 { /* sqlite3.c:99136:12: */
var p uintptr = pJfd
if size < (*MemJournal)(unsafe.Pointer(p)).Fendpoint.FiOffset {
@@ -77942,8 +78925,8 @@ func memjrnlTruncate(tls *libc.TLS, pJfd uintptr, size Sqlite_int64) int32 { /*
(*MemJournal)(unsafe.Pointer(p)).FpFirst = uintptr(0)
} else {
var iOff I64 = I64((*MemJournal)(unsafe.Pointer(p)).FnChunkSize)
- for pIter = (*MemJournal)(unsafe.Pointer(p)).FpFirst; (pIter != 0) && (iOff <= size); pIter = (*FileChunk)(unsafe.Pointer(pIter)).FpNext {
- iOff = iOff + (I64((*MemJournal)(unsafe.Pointer(p)).FnChunkSize))
+ for pIter = (*MemJournal)(unsafe.Pointer(p)).FpFirst; pIter != 0 && iOff <= size; pIter = (*FileChunk)(unsafe.Pointer(pIter)).FpNext {
+ iOff = iOff + I64((*MemJournal)(unsafe.Pointer(p)).FnChunkSize)
}
if pIter != 0 {
memjrnlFreeChunks(tls, (*FileChunk)(unsafe.Pointer(pIter)).FpNext)
@@ -77960,7 +78943,7 @@ func memjrnlTruncate(tls *libc.TLS, pJfd uintptr, size Sqlite_int64) int32 { /*
}
// Close the file.
-func memjrnlClose(tls *libc.TLS, pJfd uintptr) int32 { /* sqlite3.c:98799:12: */
+func memjrnlClose(tls *libc.TLS, pJfd uintptr) int32 { /* sqlite3.c:99166:12: */
var p uintptr = pJfd
memjrnlFreeChunks(tls, (*MemJournal)(unsafe.Pointer(p)).FpFirst)
return SQLITE_OK
@@ -77970,14 +78953,14 @@ func memjrnlClose(tls *libc.TLS, pJfd uintptr) int32 { /* sqlite3.c:98799:12: */
//
// If the real file has been created, call its xSync method. Otherwise,
// syncing an in-memory journal is a no-op.
-func memjrnlSync(tls *libc.TLS, pJfd uintptr, flags int32) int32 { /* sqlite3.c:98811:12: */
+func memjrnlSync(tls *libc.TLS, pJfd uintptr, flags int32) int32 { /* sqlite3.c:99178:12: */
_ = pJfd
_ = flags
return SQLITE_OK
}
// Query the size of the file in bytes.
-func memjrnlFileSize(tls *libc.TLS, pJfd uintptr, pSize uintptr) int32 { /* sqlite3.c:98819:12: */
+func memjrnlFileSize(tls *libc.TLS, pJfd uintptr, pSize uintptr) int32 { /* sqlite3.c:99186:12: */
var p uintptr = pJfd
*(*Sqlite_int64)(unsafe.Pointer(pSize)) = (*MemJournal)(unsafe.Pointer(p)).Fendpoint.FiOffset
return SQLITE_OK
@@ -77992,7 +78975,7 @@ var sMemJournalMethods = sqlite3_io_methods{
FxTruncate: 0, // xTruncate
FxSync: 0, // xSync
FxFileSize: 0, // xUnfetch
-} /* sqlite3.c:98828:40 */
+} /* sqlite3.c:99195:40 */
// Open a journal file.
//
@@ -78004,7 +78987,7 @@ var sMemJournalMethods = sqlite3_io_methods{
// but may be flushed to disk later on. In this case the journal file is
// flushed to disk either when it grows larger than nSpill bytes in size,
// or when sqlite3JournalCreate() is called.
-func Xsqlite3JournalOpen(tls *libc.TLS, pVfs uintptr, zName uintptr, pJfd uintptr, flags int32, nSpill int32) int32 { /* sqlite3.c:98862:20: */
+func Xsqlite3JournalOpen(tls *libc.TLS, pVfs uintptr, zName uintptr, pJfd uintptr, flags int32, nSpill int32) int32 { /* sqlite3.c:99229:20: */
var p uintptr = pJfd
// Zero the file-handle object. If nSpill was passed zero, initialize
@@ -78019,7 +79002,7 @@ func Xsqlite3JournalOpen(tls *libc.TLS, pVfs uintptr, zName uintptr, pJfd uintpt
if nSpill > 0 {
(*MemJournal)(unsafe.Pointer(p)).FnChunkSize = nSpill
} else {
- (*MemJournal)(unsafe.Pointer(p)).FnChunkSize = (int32((uint32(8 + MEMJOURNAL_DFLT_FILECHUNKSIZE)) - uint32(unsafe.Sizeof(FileChunk{}))))
+ (*MemJournal)(unsafe.Pointer(p)).FnChunkSize = int32(uint32(8+MEMJOURNAL_DFLT_FILECHUNKSIZE) - uint32(unsafe.Sizeof(FileChunk{})))
}
@@ -78032,22 +79015,22 @@ func Xsqlite3JournalOpen(tls *libc.TLS, pVfs uintptr, zName uintptr, pJfd uintpt
}
// Open an in-memory journal file.
-func Xsqlite3MemJournalOpen(tls *libc.TLS, pJfd uintptr) { /* sqlite3.c:98898:21: */
+func Xsqlite3MemJournalOpen(tls *libc.TLS, pJfd uintptr) { /* sqlite3.c:99265:21: */
Xsqlite3JournalOpen(tls, uintptr(0), uintptr(0), pJfd, 0, -1)
}
// The file-handle passed as the only argument is open on a journal file.
// Return true if this "journal file" is currently stored in heap memory,
// or false otherwise.
-func Xsqlite3JournalIsInMemory(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:98937:20: */
- return (libc.Bool32((*Sqlite3_file)(unsafe.Pointer(p)).FpMethods == uintptr(unsafe.Pointer(&sMemJournalMethods))))
+func Xsqlite3JournalIsInMemory(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:99304:20: */
+ return libc.Bool32((*Sqlite3_file)(unsafe.Pointer(p)).FpMethods == uintptr(unsafe.Pointer(&sMemJournalMethods)))
}
// Return the number of bytes required to store a JournalFile that uses vfs
// pVfs to create the underlying on-disk files.
-func Xsqlite3JournalSize(tls *libc.TLS, pVfs uintptr) int32 { /* sqlite3.c:98945:20: */
+func Xsqlite3JournalSize(tls *libc.TLS, pVfs uintptr) int32 { /* sqlite3.c:99312:20: */
return func() int32 {
- if ((*Sqlite3_vfs)(unsafe.Pointer(pVfs)).FszOsFile) > (int32(unsafe.Sizeof(MemJournal{}))) {
+ if (*Sqlite3_vfs)(unsafe.Pointer(pVfs)).FszOsFile > int32(unsafe.Sizeof(MemJournal{})) {
return (*Sqlite3_vfs)(unsafe.Pointer(pVfs)).FszOsFile
}
return int32(unsafe.Sizeof(MemJournal{}))
@@ -78074,7 +79057,7 @@ func Xsqlite3JournalSize(tls *libc.TLS, pVfs uintptr) int32 { /* sqlite3.c:98945
// Walk all expressions linked into the list of Window objects passed
// as the second argument.
-func walkWindowList(tls *libc.TLS, pWalker uintptr, pList uintptr, bOneOnly int32) int32 { /* sqlite3.c:98975:12: */
+func walkWindowList(tls *libc.TLS, pWalker uintptr, pList uintptr, bOneOnly int32) int32 { /* sqlite3.c:99342:12: */
var pWin uintptr
for pWin = pList; pWin != 0; pWin = (*Window)(unsafe.Pointer(pWin)).FpNextWin {
var rc int32
@@ -78122,7 +79105,7 @@ func walkWindowList(tls *libc.TLS, pWalker uintptr, pList uintptr, bOneOnly int3
//
// The return value from this routine is WRC_Abort to abandon the tree walk
// and WRC_Continue to continue.
-func walkExpr(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 { /* sqlite3.c:99014:28: */
+func walkExpr(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 { /* sqlite3.c:99381:28: */
var rc int32
for 1 != 0 {
@@ -78130,30 +79113,30 @@ func walkExpr(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 { /* sqlite3.
f func(*libc.TLS, uintptr, uintptr) int32
})(unsafe.Pointer(&struct{ uintptr }{(*Walker)(unsafe.Pointer(pWalker)).FxExprCallback})).f(tls, pWalker, pExpr)
if rc != 0 {
- return (rc & WRC_Abort)
+ return rc & WRC_Abort
}
- if !(((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_TokenOnly | EP_Leaf))) != U32(0)) {
+ if !((*Expr)(unsafe.Pointer(pExpr)).Fflags&U32(EP_TokenOnly|EP_Leaf) != U32(0)) {
- if ((*Expr)(unsafe.Pointer(pExpr)).FpLeft != 0) && (walkExpr(tls, pWalker, (*Expr)(unsafe.Pointer(pExpr)).FpLeft) != 0) {
+ if (*Expr)(unsafe.Pointer(pExpr)).FpLeft != 0 && walkExpr(tls, pWalker, (*Expr)(unsafe.Pointer(pExpr)).FpLeft) != 0 {
return WRC_Abort
}
if (*Expr)(unsafe.Pointer(pExpr)).FpRight != 0 {
pExpr = (*Expr)(unsafe.Pointer(pExpr)).FpRight
continue
- } else if ((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_xIsSelect))) != U32(0) {
+ } else if (*Expr)(unsafe.Pointer(pExpr)).Fflags&U32(EP_xIsSelect) != U32(0) {
- if Xsqlite3WalkSelect(tls, pWalker, *(*uintptr)(unsafe.Pointer(pExpr + 20 /* &.x */))) != 0 {
+ if Xsqlite3WalkSelect(tls, pWalker, *(*uintptr)(unsafe.Pointer(pExpr + 20))) != 0 {
return WRC_Abort
}
} else {
- if *(*uintptr)(unsafe.Pointer(pExpr + 20 /* &.x */)) != 0 {
- if Xsqlite3WalkExprList(tls, pWalker, *(*uintptr)(unsafe.Pointer(pExpr + 20 /* &.x */))) != 0 {
+ if *(*uintptr)(unsafe.Pointer(pExpr + 20)) != 0 {
+ if Xsqlite3WalkExprList(tls, pWalker, *(*uintptr)(unsafe.Pointer(pExpr + 20))) != 0 {
return WRC_Abort
}
}
- if ((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_WinFunc))) != U32(0) {
- if walkWindowList(tls, pWalker, *(*uintptr)(unsafe.Pointer(pExpr + 44 /* &.y */)), 1) != 0 {
+ if (*Expr)(unsafe.Pointer(pExpr)).Fflags&U32(EP_WinFunc) != U32(0) {
+ if walkWindowList(tls, pWalker, *(*uintptr)(unsafe.Pointer(pExpr + 44)), 1) != 0 {
return WRC_Abort
}
}
@@ -78164,7 +79147,7 @@ func walkExpr(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 { /* sqlite3.
return WRC_Continue
}
-func Xsqlite3WalkExpr(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 { /* sqlite3.c:99046:20: */
+func Xsqlite3WalkExpr(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 { /* sqlite3.c:99413:20: */
if pExpr != 0 {
return walkExpr(tls, pWalker, pExpr)
}
@@ -78173,7 +79156,7 @@ func Xsqlite3WalkExpr(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 { /*
// Call sqlite3WalkExpr() for every expression in list p or until
// an abort request is seen.
-func Xsqlite3WalkExprList(tls *libc.TLS, pWalker uintptr, p uintptr) int32 { /* sqlite3.c:99054:20: */
+func Xsqlite3WalkExprList(tls *libc.TLS, pWalker uintptr, p uintptr) int32 { /* sqlite3.c:99421:20: */
var i int32
var pItem uintptr
if p != 0 {
@@ -78202,7 +79185,7 @@ func Xsqlite3WalkExprList(tls *libc.TLS, pWalker uintptr, p uintptr) int32 { /*
// This is a no-op callback for Walker->xSelectCallback2. If this
// callback is set, then the Select->pWinDefn list is traversed.
-func Xsqlite3WalkWinDefnDummyCallback(tls *libc.TLS, pWalker uintptr, p uintptr) { /* sqlite3.c:99069:21: */
+func Xsqlite3WalkWinDefnDummyCallback(tls *libc.TLS, pWalker uintptr, p uintptr) { /* sqlite3.c:99436:21: */
_ = pWalker
_ = p
// No-op
@@ -78212,7 +79195,7 @@ func Xsqlite3WalkWinDefnDummyCallback(tls *libc.TLS, pWalker uintptr, p uintptr)
// not invoke the SELECT callback on p, but do (of course) invoke
// any expr callbacks and SELECT callbacks that come from subqueries.
// Return WRC_Abort or WRC_Continue.
-func Xsqlite3WalkSelectExpr(tls *libc.TLS, pWalker uintptr, p uintptr) int32 { /* sqlite3.c:99081:20: */
+func Xsqlite3WalkSelectExpr(tls *libc.TLS, pWalker uintptr, p uintptr) int32 { /* sqlite3.c:99448:20: */
if Xsqlite3WalkExprList(tls, pWalker, (*Select)(unsafe.Pointer(p)).FpEList) != 0 {
return WRC_Abort
}
@@ -78233,13 +79216,13 @@ func Xsqlite3WalkSelectExpr(tls *libc.TLS, pWalker uintptr, p uintptr) int32 { /
}
if (*Select)(unsafe.Pointer(p)).FpWinDefn != 0 {
var pParse uintptr
- if (((*Walker)(unsafe.Pointer(pWalker)).FxSelectCallback2 == *(*uintptr)(unsafe.Pointer(&struct {
+ if (*Walker)(unsafe.Pointer(pWalker)).FxSelectCallback2 == *(*uintptr)(unsafe.Pointer(&struct {
f func(*libc.TLS, uintptr, uintptr)
- }{Xsqlite3WalkWinDefnDummyCallback}))) ||
- (((libc.AssignUintptr(&pParse, (*Walker)(unsafe.Pointer(pWalker)).FpParse)) != uintptr(0)) && (int32((*Parse)(unsafe.Pointer(pParse)).FeParseMode) >= PARSE_MODE_RENAME))) ||
- ((*Walker)(unsafe.Pointer(pWalker)).FxSelectCallback2 == *(*uintptr)(unsafe.Pointer(&struct {
+ }{Xsqlite3WalkWinDefnDummyCallback})) ||
+ libc.AssignUintptr(&pParse, (*Walker)(unsafe.Pointer(pWalker)).FpParse) != uintptr(0) && int32((*Parse)(unsafe.Pointer(pParse)).FeParseMode) >= PARSE_MODE_RENAME ||
+ (*Walker)(unsafe.Pointer(pWalker)).FxSelectCallback2 == *(*uintptr)(unsafe.Pointer(&struct {
f func(*libc.TLS, uintptr, uintptr)
- }{Xsqlite3SelectPopWith}))) {
+ }{Xsqlite3SelectPopWith})) {
// The following may return WRC_Abort if there are unresolvable
// symbols (e.g. a table that does not exist) in a window definition.
var rc int32 = walkWindowList(tls, pWalker, (*Select)(unsafe.Pointer(p)).FpWinDefn, 0)
@@ -78254,7 +79237,7 @@ func Xsqlite3WalkSelectExpr(tls *libc.TLS, pWalker uintptr, p uintptr) int32 { /
// callback on p, but do invoke it on each FROM clause subquery
// and on any subqueries further down in the tree. Return
// WRC_Abort or WRC_Continue;
-func Xsqlite3WalkSelectFrom(tls *libc.TLS, pWalker uintptr, p uintptr) int32 { /* sqlite3.c:99114:20: */
+func Xsqlite3WalkSelectFrom(tls *libc.TLS, pWalker uintptr, p uintptr) int32 { /* sqlite3.c:99481:20: */
var pSrc uintptr
var i int32
var pItem uintptr
@@ -78268,11 +79251,11 @@ func Xsqlite3WalkSelectFrom(tls *libc.TLS, pWalker uintptr, p uintptr) int32 { /
goto __3
}
{
- if ((*SrcItem)(unsafe.Pointer(pItem)).FpSelect != 0) && (Xsqlite3WalkSelect(tls, pWalker, (*SrcItem)(unsafe.Pointer(pItem)).FpSelect) != 0) {
+ if (*SrcItem)(unsafe.Pointer(pItem)).FpSelect != 0 && Xsqlite3WalkSelect(tls, pWalker, (*SrcItem)(unsafe.Pointer(pItem)).FpSelect) != 0 {
return WRC_Abort
}
- if ((uint32(int32(*(*uint16)(unsafe.Pointer((pItem + 36 /* &.fg */) + 4 /* &.isTabFunc */)) & 0x4 >> 2))) != 0) &&
- (Xsqlite3WalkExprList(tls, pWalker, *(*uintptr)(unsafe.Pointer(pItem + 64 /* &.u1 */))) != 0) {
+ if uint32(int32(*(*uint16)(unsafe.Pointer(pItem + 36 + 4))&0x4>>2)) != 0 &&
+ Xsqlite3WalkExprList(tls, pWalker, *(*uintptr)(unsafe.Pointer(pItem + 64))) != 0 {
return WRC_Abort
}
@@ -78303,7 +79286,7 @@ func Xsqlite3WalkSelectFrom(tls *libc.TLS, pWalker uintptr, p uintptr) int32 { /
//
// If the Walker does not have an xSelectCallback() then this routine
// is a no-op returning WRC_Continue.
-func Xsqlite3WalkSelect(tls *libc.TLS, pWalker uintptr, p uintptr) int32 { /* sqlite3.c:99152:20: */
+func Xsqlite3WalkSelect(tls *libc.TLS, pWalker uintptr, p uintptr) int32 { /* sqlite3.c:99519:20: */
var rc int32
if p == uintptr(0) {
return WRC_Continue
@@ -78311,15 +79294,15 @@ func Xsqlite3WalkSelect(tls *libc.TLS, pWalker uintptr, p uintptr) int32 { /* sq
if (*Walker)(unsafe.Pointer(pWalker)).FxSelectCallback == uintptr(0) {
return WRC_Continue
}
- for ok := true; ok; ok = (p != uintptr(0)) {
+ for ok := true; ok; ok = p != uintptr(0) {
rc = (*struct {
f func(*libc.TLS, uintptr, uintptr) int32
})(unsafe.Pointer(&struct{ uintptr }{(*Walker)(unsafe.Pointer(pWalker)).FxSelectCallback})).f(tls, pWalker, p)
if rc != 0 {
- return (rc & WRC_Abort)
+ return rc & WRC_Abort
}
- if (Xsqlite3WalkSelectExpr(tls, pWalker, p) != 0) ||
- (Xsqlite3WalkSelectFrom(tls, pWalker, p) != 0) {
+ if Xsqlite3WalkSelectExpr(tls, pWalker, p) != 0 ||
+ Xsqlite3WalkSelectFrom(tls, pWalker, p) != 0 {
return WRC_Abort
}
if (*Walker)(unsafe.Pointer(pWalker)).FxSelectCallback2 != 0 {
@@ -78334,13 +79317,13 @@ func Xsqlite3WalkSelect(tls *libc.TLS, pWalker uintptr, p uintptr) int32 { /* sq
// Increase the walkerDepth when entering a subquery, and
// descrease when leaving the subquery.
-func Xsqlite3WalkerDepthIncrease(tls *libc.TLS, pWalker uintptr, pSelect uintptr) int32 { /* sqlite3.c:99175:20: */
+func Xsqlite3WalkerDepthIncrease(tls *libc.TLS, pWalker uintptr, pSelect uintptr) int32 { /* sqlite3.c:99542:20: */
_ = pSelect
(*Walker)(unsafe.Pointer(pWalker)).FwalkerDepth++
return WRC_Continue
}
-func Xsqlite3WalkerDepthDecrease(tls *libc.TLS, pWalker uintptr, pSelect uintptr) { /* sqlite3.c:99180:21: */
+func Xsqlite3WalkerDepthDecrease(tls *libc.TLS, pWalker uintptr, pSelect uintptr) { /* sqlite3.c:99547:21: */
_ = pSelect
(*Walker)(unsafe.Pointer(pWalker)).FwalkerDepth--
}
@@ -78352,7 +79335,7 @@ func Xsqlite3WalkerDepthDecrease(tls *libc.TLS, pWalker uintptr, pSelect uintptr
// when this routine is used for Walker.xExprCallback then
// Walker.xSelectCallback is set to do something useful for every
// subquery in the parser tree.
-func Xsqlite3ExprWalkNoop(tls *libc.TLS, NotUsed uintptr, NotUsed2 uintptr) int32 { /* sqlite3.c:99195:20: */
+func Xsqlite3ExprWalkNoop(tls *libc.TLS, NotUsed uintptr, NotUsed2 uintptr) int32 { /* sqlite3.c:99562:20: */
_ = NotUsed
_ = NotUsed2
return WRC_Continue
@@ -78360,7 +79343,7 @@ func Xsqlite3ExprWalkNoop(tls *libc.TLS, NotUsed uintptr, NotUsed2 uintptr) int3
// No-op routine for the parse-tree walker for SELECT statements.
// subquery in the parser tree.
-func Xsqlite3SelectWalkNoop(tls *libc.TLS, NotUsed uintptr, NotUsed2 uintptr) int32 { /* sqlite3.c:99204:20: */
+func Xsqlite3SelectWalkNoop(tls *libc.TLS, NotUsed uintptr, NotUsed2 uintptr) int32 { /* sqlite3.c:99571:20: */
_ = NotUsed
_ = NotUsed2
return WRC_Continue
@@ -78395,14 +79378,14 @@ func Xsqlite3SelectWalkNoop(tls *libc.TLS, NotUsed uintptr, NotUsed2 uintptr) in
// is a helper function - a callback for the tree walker.
//
// See also the sqlite3WindowExtraAggFuncDepth() routine in window.c
-func incrAggDepth(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 { /* sqlite3.c:99245:12: */
+func incrAggDepth(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 { /* sqlite3.c:99612:12: */
if int32((*Expr)(unsafe.Pointer(pExpr)).Fop) == TK_AGG_FUNCTION {
- *(*U8)(unsafe.Pointer(pExpr + 2 /* &.op2 */)) += U8((*(*int32)(unsafe.Pointer(pWalker + 24 /* &.u */))))
+ *(*U8)(unsafe.Pointer(pExpr + 2)) += U8(*(*int32)(unsafe.Pointer(pWalker + 24)))
}
return WRC_Continue
}
-func incrAggFunctionDepth(tls *libc.TLS, pExpr uintptr, N int32) { /* sqlite3.c:99249:13: */
+func incrAggFunctionDepth(tls *libc.TLS, pExpr uintptr, N int32) { /* sqlite3.c:99616:13: */
bp := tls.Alloc(28)
defer tls.Free(28)
@@ -78413,7 +79396,7 @@ func incrAggFunctionDepth(tls *libc.TLS, pExpr uintptr, N int32) { /* sqlite3.c:
(*Walker)(unsafe.Pointer(bp /* &w */)).FxExprCallback = *(*uintptr)(unsafe.Pointer(&struct {
f func(*libc.TLS, uintptr, uintptr) int32
}{incrAggDepth}))
- *(*int32)(unsafe.Pointer(bp /* &w */ + 24 /* &.u */)) = N
+ *(*int32)(unsafe.Pointer(bp + 24)) = N
Xsqlite3WalkExpr(tls, bp /* &w */, pExpr)
}
}
@@ -78435,12 +79418,12 @@ func incrAggFunctionDepth(tls *libc.TLS, pExpr uintptr, N int32) { /* sqlite3.c:
// zero but it might be more if the alias is contained within a subquery
// of the original expression. The Expr.op2 field of TK_AGG_FUNCTION
// structures must be increased by the nSubquery amount.
-func resolveAlias(tls *libc.TLS, pParse uintptr, pEList uintptr, iCol int32, pExpr uintptr, nSubquery int32) { /* sqlite3.c:99278:13: */
+func resolveAlias(tls *libc.TLS, pParse uintptr, pEList uintptr, iCol int32, pExpr uintptr, nSubquery int32) { /* sqlite3.c:99645:13: */
var pOrig uintptr // The iCol-th column of the result set
var pDup uintptr // Copy of pOrig
var db uintptr // The database connection
- pOrig = (*ExprList_item)(unsafe.Pointer((pEList + 8 /* &.a */) + uintptr(iCol)*20)).FpExpr
+ pOrig = (*ExprList_item)(unsafe.Pointer(pEList + 8 + uintptr(iCol)*20)).FpExpr
db = (*Parse)(unsafe.Pointer(pParse)).Fdb
pDup = Xsqlite3ExprDup(tls, db, pOrig, 0)
@@ -78450,7 +79433,8 @@ func resolveAlias(tls *libc.TLS, pParse uintptr, pEList uintptr, iCol int32, pEx
} else {
incrAggFunctionDepth(tls, pDup, nSubquery)
if int32((*Expr)(unsafe.Pointer(pExpr)).Fop) == TK_COLLATE {
- pDup = Xsqlite3ExprAddCollateString(tls, pParse, pDup, *(*uintptr)(unsafe.Pointer(pExpr + 8 /* &.u */)))
+
+ pDup = Xsqlite3ExprAddCollateString(tls, pParse, pDup, *(*uintptr)(unsafe.Pointer(pExpr + 8)))
}
// Before calling sqlite3ExprDelete(), set the EP_Static flag. This
@@ -78459,17 +79443,17 @@ func resolveAlias(tls *libc.TLS, pParse uintptr, pEList uintptr, iCol int32, pEx
// The pExpr->u.zToken might point into memory that will be freed by the
// sqlite3DbFree(db, pDup) on the last line of this block, so be sure to
// make a copy of the token before doing the sqlite3DbFree().
- *(*U32)(unsafe.Pointer(pExpr + 4 /* &.flags */)) |= (U32(EP_Static))
+ *(*U32)(unsafe.Pointer(pExpr + 4)) |= U32(EP_Static)
Xsqlite3ExprDelete(tls, db, pExpr)
libc.Xmemcpy(tls, pExpr, pDup, uint32(unsafe.Sizeof(Expr{})))
- if !(((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_IntValue))) != U32(0)) && (*(*uintptr)(unsafe.Pointer(pExpr + 8 /* &.u */)) != uintptr(0)) {
+ if !((*Expr)(unsafe.Pointer(pExpr)).Fflags&U32(EP_IntValue) != U32(0)) && *(*uintptr)(unsafe.Pointer(pExpr + 8)) != uintptr(0) {
- *(*uintptr)(unsafe.Pointer(pExpr + 8 /* &.u */)) = Xsqlite3DbStrDup(tls, db, *(*uintptr)(unsafe.Pointer(pExpr + 8 /* &.u */)))
- *(*U32)(unsafe.Pointer(pExpr + 4 /* &.flags */)) |= (U32(EP_MemToken))
+ *(*uintptr)(unsafe.Pointer(pExpr + 8)) = Xsqlite3DbStrDup(tls, db, *(*uintptr)(unsafe.Pointer(pExpr + 8)))
+ *(*U32)(unsafe.Pointer(pExpr + 4)) |= U32(EP_MemToken)
}
- if ((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_WinFunc))) != U32(0) {
- if *(*uintptr)(unsafe.Pointer(pExpr + 44 /* &.y */)) != uintptr(0) {
- (*Window)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pExpr + 44 /* &.y */)))).FpOwner = pExpr
+ if (*Expr)(unsafe.Pointer(pExpr)).Fflags&U32(EP_WinFunc) != U32(0) {
+ if *(*uintptr)(unsafe.Pointer(pExpr + 44)) != uintptr(0) {
+ (*Window)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pExpr + 44)))).FpOwner = pExpr
}
}
Xsqlite3DbFree(tls, db, pDup)
@@ -78480,7 +79464,7 @@ func resolveAlias(tls *libc.TLS, pParse uintptr, pEList uintptr, iCol int32, pEx
//
// Return FALSE if the USING clause is NULL or if it does not contain
// zCol.
-func nameInUsingClause(tls *libc.TLS, pUsing uintptr, zCol uintptr) int32 { /* sqlite3.c:99334:12: */
+func nameInUsingClause(tls *libc.TLS, pUsing uintptr, zCol uintptr) int32 { /* sqlite3.c:99702:12: */
if pUsing != 0 {
var k int32
for k = 0; k < (*IdList)(unsafe.Pointer(pUsing)).FnId; k++ {
@@ -78497,71 +79481,72 @@ func nameInUsingClause(tls *libc.TLS, pUsing uintptr, zCol uintptr) int32 { /* s
// Check to see if the zSpan given to this routine matches the zDb, zTab,
// and zCol. If any of zDb, zTab, and zCol are NULL then those fields will
// match anything.
-func Xsqlite3MatchEName(tls *libc.TLS, pItem uintptr, zCol uintptr, zTab uintptr, zDb uintptr) int32 { /* sqlite3.c:99351:20: */
+func Xsqlite3MatchEName(tls *libc.TLS, pItem uintptr, zCol uintptr, zTab uintptr, zDb uintptr) int32 { /* sqlite3.c:99719:20: */
var n int32
var zSpan uintptr
- if (int32(*(*uint8)(unsafe.Pointer(pItem + 12 /* &.eEName */)) & 0x3 >> 0)) != ENAME_TAB {
+ if int32(*(*uint8)(unsafe.Pointer(pItem + 12))&0x3>>0) != ENAME_TAB {
return 0
}
zSpan = (*ExprList_item)(unsafe.Pointer(pItem)).FzEName
- for n = 0; (*(*uint8)(unsafe.Pointer(zSpan + uintptr(n))) != 0) && (int32(*(*uint8)(unsafe.Pointer(zSpan + uintptr(n)))) != '.'); n++ {
+ for n = 0; *(*uint8)(unsafe.Pointer(zSpan + uintptr(n))) != 0 && int32(*(*uint8)(unsafe.Pointer(zSpan + uintptr(n)))) != '.'; n++ {
}
- if (zDb != 0) && ((Xsqlite3_strnicmp(tls, zSpan, zDb, n) != 0) || (int32(*(*uint8)(unsafe.Pointer(zDb + uintptr(n)))) != 0)) {
+ if zDb != 0 && (Xsqlite3_strnicmp(tls, zSpan, zDb, n) != 0 || int32(*(*uint8)(unsafe.Pointer(zDb + uintptr(n)))) != 0) {
return 0
}
- zSpan += (uintptr(n + 1))
- for n = 0; (*(*uint8)(unsafe.Pointer(zSpan + uintptr(n))) != 0) && (int32(*(*uint8)(unsafe.Pointer(zSpan + uintptr(n)))) != '.'); n++ {
+ zSpan += uintptr(n + 1)
+ for n = 0; *(*uint8)(unsafe.Pointer(zSpan + uintptr(n))) != 0 && int32(*(*uint8)(unsafe.Pointer(zSpan + uintptr(n)))) != '.'; n++ {
}
- if (zTab != 0) && ((Xsqlite3_strnicmp(tls, zSpan, zTab, n) != 0) || (int32(*(*uint8)(unsafe.Pointer(zTab + uintptr(n)))) != 0)) {
+ if zTab != 0 && (Xsqlite3_strnicmp(tls, zSpan, zTab, n) != 0 || int32(*(*uint8)(unsafe.Pointer(zTab + uintptr(n)))) != 0) {
return 0
}
- zSpan += (uintptr(n + 1))
- if (zCol != 0) && (Xsqlite3StrICmp(tls, zSpan, zCol) != 0) {
+ zSpan += uintptr(n + 1)
+ if zCol != 0 && Xsqlite3StrICmp(tls, zSpan, zCol) != 0 {
return 0
}
return 1
}
// Return TRUE if the double-quoted string mis-feature should be supported.
-func areDoubleQuotedStringsEnabled(tls *libc.TLS, db uintptr, pTopNC uintptr) int32 { /* sqlite3.c:99380:12: */
+func areDoubleQuotedStringsEnabled(tls *libc.TLS, db uintptr, pTopNC uintptr) int32 { /* sqlite3.c:99748:12: */
if (*Sqlite3)(unsafe.Pointer(db)).Finit.Fbusy != 0 {
return 1
} // Always support for legacy schemas
- if ((*NameContext)(unsafe.Pointer(pTopNC)).FncFlags & NC_IsDDL) != 0 {
+ if (*NameContext)(unsafe.Pointer(pTopNC)).FncFlags&NC_IsDDL != 0 {
// Currently parsing a DDL statement
- if (Xsqlite3WritableSchema(tls, db) != 0) && (((*Sqlite3)(unsafe.Pointer(db)).Fflags & uint64(SQLITE_DqsDML)) != uint64(0)) {
+ if Xsqlite3WritableSchema(tls, db) != 0 && (*Sqlite3)(unsafe.Pointer(db)).Fflags&uint64(SQLITE_DqsDML) != uint64(0) {
return 1
}
- return (libc.Bool32(((*Sqlite3)(unsafe.Pointer(db)).Fflags & uint64(SQLITE_DqsDDL)) != uint64(0)))
+ return libc.Bool32((*Sqlite3)(unsafe.Pointer(db)).Fflags&uint64(SQLITE_DqsDDL) != uint64(0))
} else {
// Currently parsing a DML statement
- return (libc.Bool32(((*Sqlite3)(unsafe.Pointer(db)).Fflags & uint64(SQLITE_DqsDML)) != uint64(0)))
+ return libc.Bool32((*Sqlite3)(unsafe.Pointer(db)).Fflags&uint64(SQLITE_DqsDML) != uint64(0))
}
return int32(0)
}
// The argument is guaranteed to be a non-NULL Expr node of type TK_COLUMN.
// return the appropriate colUsed mask.
-func Xsqlite3ExprColUsed(tls *libc.TLS, pExpr uintptr) Bitmask { /* sqlite3.c:99398:24: */
+func Xsqlite3ExprColUsed(tls *libc.TLS, pExpr uintptr) Bitmask { /* sqlite3.c:99766:24: */
var n int32
var pExTab uintptr
n = int32((*Expr)(unsafe.Pointer(pExpr)).FiColumn)
- pExTab = *(*uintptr)(unsafe.Pointer(pExpr + 44 /* &.y */))
- if (((*Table)(unsafe.Pointer(pExTab)).FtabFlags & U32(TF_HasGenerated)) != U32(0)) &&
- ((int32((*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pExTab)).FaCol+uintptr(n)*20)).FcolFlags) & COLFLAG_GENERATED) != 0) {
+ pExTab = *(*uintptr)(unsafe.Pointer(pExpr + 44))
+
+ if (*Table)(unsafe.Pointer(pExTab)).FtabFlags&U32(TF_HasGenerated) != U32(0) &&
+ int32((*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pExTab)).FaCol+uintptr(n)*16)).FcolFlags)&COLFLAG_GENERATED != 0 {
- if int32((*Table)(unsafe.Pointer(pExTab)).FnCol) >= (int32(uint32(unsafe.Sizeof(Bitmask(0))) * uint32(8))) {
+ if int32((*Table)(unsafe.Pointer(pExTab)).FnCol) >= int32(uint32(unsafe.Sizeof(Bitmask(0)))*uint32(8)) {
return libc.Uint64(libc.Uint64FromInt32(-1))
}
- return ((Bitmask((uint64(1))) << (int32((*Table)(unsafe.Pointer(pExTab)).FnCol))) - uint64(1))
+ return Bitmask(uint64(1))<<int32((*Table)(unsafe.Pointer(pExTab)).FnCol) - uint64(1)
} else {
- if n >= (int32(uint32(unsafe.Sizeof(Bitmask(0))) * uint32(8))) {
- n = ((int32(uint32(unsafe.Sizeof(Bitmask(0))) * uint32(8))) - 1)
+ if n >= int32(uint32(unsafe.Sizeof(Bitmask(0)))*uint32(8)) {
+ n = int32(uint32(unsafe.Sizeof(Bitmask(0)))*uint32(8)) - 1
}
- return (Bitmask((uint64(1))) << n)
+ return Bitmask(uint64(1)) << n
}
return Bitmask(0)
}
@@ -78591,7 +79576,7 @@ func Xsqlite3ExprColUsed(tls *libc.TLS, pExpr uintptr) Bitmask { /* sqlite3.c:99
//
// If the name cannot be resolved unambiguously, leave an error message
// in pParse and return WRC_Abort. Return WRC_Prune on success.
-func lookupName(tls *libc.TLS, pParse uintptr, zDb uintptr, zTab uintptr, zCol uintptr, pNC uintptr, pExpr uintptr) int32 { /* sqlite3.c:99446:12: */
+func lookupName(tls *libc.TLS, pParse uintptr, zDb uintptr, zTab uintptr, zCol uintptr, pNC uintptr, pExpr uintptr) int32 { /* sqlite3.c:99815:12: */
bp := tls.Alloc(96)
defer tls.Free(96)
@@ -78643,7 +79628,7 @@ func lookupName(tls *libc.TLS, pParse uintptr, zDb uintptr, zTab uintptr, zCol u
goto __1
}
- if !(((*NameContext)(unsafe.Pointer(pNC)).FncFlags & (NC_PartIdx | NC_IsCheck)) != 0) {
+ if !((*NameContext)(unsafe.Pointer(pNC)).FncFlags&(NC_PartIdx|NC_IsCheck) != 0) {
goto __2
}
// Silently ignore database qualifiers inside CHECK constraints and
@@ -78673,7 +79658,7 @@ __5:
goto __6
__6:
;
- if !((i == (*Sqlite3)(unsafe.Pointer(db)).FnDb) && (Xsqlite3StrICmp(tls, ts+5458 /* "main" */, zDb) == 0)) {
+ if !(i == (*Sqlite3)(unsafe.Pointer(db)).FnDb && Xsqlite3StrICmp(tls, ts+6305, zDb) == 0) {
goto __8
}
// This branch is taken when the main database has been renamed
@@ -78703,7 +79688,7 @@ __13:
}
pTab = (*SrcItem)(unsafe.Pointer(pItem)).FpTab
- if !(((*SrcItem)(unsafe.Pointer(pItem)).FpSelect != 0) && (((*Select)(unsafe.Pointer((*SrcItem)(unsafe.Pointer(pItem)).FpSelect)).FselFlags & U32(SF_NestedFrom)) != U32(0))) {
+ if !((*SrcItem)(unsafe.Pointer(pItem)).FpSelect != 0 && (*Select)(unsafe.Pointer((*SrcItem)(unsafe.Pointer(pItem)).FpSelect)).FselFlags&U32(SF_NestedFrom) != U32(0)) {
goto __16
}
hit = 0
@@ -78713,7 +79698,7 @@ __17:
if !(j < (*ExprList)(unsafe.Pointer(pEList)).FnExpr) {
goto __19
}
- if !(Xsqlite3MatchEName(tls, ((pEList+8 /* &.a */)+uintptr(j)*20), zCol, zTab, zDb) != 0) {
+ if !(Xsqlite3MatchEName(tls, pEList+8+uintptr(j)*20, zCol, zTab, zDb) != 0) {
goto __20
}
cnt++
@@ -78730,7 +79715,7 @@ __18:
goto __19
__19:
;
- if !((hit != 0) || (zTab == uintptr(0))) {
+ if !(hit != 0 || zTab == uintptr(0)) {
goto __21
}
goto __14
@@ -78738,7 +79723,7 @@ __21:
;
__16:
;
- if !((zDb != 0) && ((*Table)(unsafe.Pointer(pTab)).FpSchema != pSchema)) {
+ if !(zDb != 0 && (*Table)(unsafe.Pointer(pTab)).FpSchema != pSchema) {
goto __22
}
goto __14
@@ -78759,49 +79744,45 @@ __22:
goto __14
__24:
;
- if !((int32((*Parse)(unsafe.Pointer(pParse)).FeParseMode) >= PARSE_MODE_RENAME) && ((*SrcItem)(unsafe.Pointer(pItem)).FzAlias != 0)) {
+
+ if !(int32((*Parse)(unsafe.Pointer(pParse)).FeParseMode) >= PARSE_MODE_RENAME && (*SrcItem)(unsafe.Pointer(pItem)).FzAlias != 0) {
goto __25
}
- Xsqlite3RenameTokenRemap(tls, pParse, uintptr(0), (pExpr + 44 /* &.y */ /* &.pTab */))
+ Xsqlite3RenameTokenRemap(tls, pParse, uintptr(0), pExpr+44)
__25:
;
__23:
;
- if !(0 == (libc.PostIncInt32(&cntTab, 1))) {
- goto __26
- }
- pMatch = pItem
-__26:
- ;
hCol = Xsqlite3StrIHash(tls, zCol)
j = 0
pCol = (*Table)(unsafe.Pointer(pTab)).FaCol
-__27:
+__26:
if !(j < int32((*Table)(unsafe.Pointer(pTab)).FnCol)) {
- goto __29
+ goto __28
}
- if !((int32((*Column)(unsafe.Pointer(pCol)).FhName) == int32(hCol)) && (Xsqlite3StrICmp(tls, (*Column)(unsafe.Pointer(pCol)).FzName, zCol) == 0)) {
- goto __30
+ if !(int32((*Column)(unsafe.Pointer(pCol)).FhName) == int32(hCol) &&
+ Xsqlite3StrICmp(tls, (*Column)(unsafe.Pointer(pCol)).FzCnName, zCol) == 0) {
+ goto __29
}
// If there has been exactly one prior match and this match
// is for the right-hand table of a NATURAL JOIN or is in a
// USING clause, then skip this match.
if !(cnt == 1) {
- goto __31
+ goto __30
}
- if !((int32((*SrcItem)(unsafe.Pointer(pItem)).Ffg.Fjointype) & JT_NATURAL) != 0) {
- goto __32
+ if !(int32((*SrcItem)(unsafe.Pointer(pItem)).Ffg.Fjointype)&JT_NATURAL != 0) {
+ goto __31
}
- goto __28
-__32:
+ goto __27
+__31:
;
if !(nameInUsingClause(tls, (*SrcItem)(unsafe.Pointer(pItem)).FpUsing, zCol) != 0) {
- goto __33
+ goto __32
}
- goto __28
-__33:
+ goto __27
+__32:
;
-__31:
+__30:
;
cnt++
pMatch = pItem
@@ -78812,16 +79793,23 @@ __31:
}
return I16(j)
}()
- goto __29
-__30:
+ goto __28
+__29:
;
+ goto __27
+__27:
+ j++
+ pCol += 16
+ goto __26
goto __28
__28:
- j++
- pCol += 20
- goto __27
- goto __29
-__29:
+ ;
+ if !(0 == cnt && (*Table)(unsafe.Pointer(pTab)).FtabFlags&U32(TF_NoVisibleRowid) == U32(0)) {
+ goto __33
+ }
+ cntTab++
+ pMatch = pItem
+__33:
;
goto __14
__14:
@@ -78835,16 +79823,17 @@ __15:
goto __34
}
(*Expr)(unsafe.Pointer(pExpr)).FiTable = (*SrcItem)(unsafe.Pointer(pMatch)).FiCursor
- *(*uintptr)(unsafe.Pointer(pExpr + 44 /* &.y */)) = (*SrcItem)(unsafe.Pointer(pMatch)).FpTab
+
+ *(*uintptr)(unsafe.Pointer(pExpr + 44)) = (*SrcItem)(unsafe.Pointer(pMatch)).FpTab
// RIGHT JOIN not (yet) supported
- if !((int32((*SrcItem)(unsafe.Pointer(pMatch)).Ffg.Fjointype) & JT_LEFT) != 0) {
+ if !(int32((*SrcItem)(unsafe.Pointer(pMatch)).Ffg.Fjointype)&JT_LEFT != 0) {
goto __35
}
- *(*U32)(unsafe.Pointer(pExpr + 4 /* &.flags */)) |= (U32(EP_CanBeNull))
+ *(*U32)(unsafe.Pointer(pExpr + 4)) |= U32(EP_CanBeNull)
__35:
;
- pSchema = (*Table)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pExpr + 44 /* &.y */)))).FpSchema
+ pSchema = (*Table)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pExpr + 44)))).FpSchema
__34:
;
__12:
@@ -78854,7 +79843,7 @@ __12:
// it is a new.* or old.* trigger argument reference. Or
// maybe it is an excluded.* from an upsert. Or maybe it is
// a reference in the RETURNING clause to a table being modified.
- if !((cnt == 0) && (zDb == uintptr(0))) {
+ if !(cnt == 0 && zDb == uintptr(0)) {
goto __36
}
pTab = uintptr(0)
@@ -78866,24 +79855,24 @@ __12:
if !((*Parse)(unsafe.Pointer(pParse)).FbReturning != 0) {
goto __38
}
- if !((((*NameContext)(unsafe.Pointer(pNC)).FncFlags & NC_UBaseReg) != 0) &&
- ((zTab == uintptr(0)) || (Xsqlite3StrICmp(tls, zTab, (*Table)(unsafe.Pointer((*Parse)(unsafe.Pointer(pParse)).FpTriggerTab)).FzName) == 0))) {
+ if !((*NameContext)(unsafe.Pointer(pNC)).FncFlags&NC_UBaseReg != 0 &&
+ (zTab == uintptr(0) || Xsqlite3StrICmp(tls, zTab, (*Table)(unsafe.Pointer((*Parse)(unsafe.Pointer(pParse)).FpTriggerTab)).FzName) == 0)) {
goto __40
}
- (*Expr)(unsafe.Pointer(pExpr)).FiTable = (libc.Bool32(op != TK_DELETE))
+ (*Expr)(unsafe.Pointer(pExpr)).FiTable = libc.Bool32(op != TK_DELETE)
pTab = (*Parse)(unsafe.Pointer(pParse)).FpTriggerTab
__40:
;
goto __39
__38:
- if !(((op != TK_DELETE) && (zTab != 0)) && (Xsqlite3StrICmp(tls, ts+5463 /* "new" */, zTab) == 0)) {
+ if !(op != TK_DELETE && zTab != 0 && Xsqlite3StrICmp(tls, ts+6310, zTab) == 0) {
goto __41
}
(*Expr)(unsafe.Pointer(pExpr)).FiTable = 1
pTab = (*Parse)(unsafe.Pointer(pParse)).FpTriggerTab
goto __42
__41:
- if !(((op != TK_INSERT) && (zTab != 0)) && (Xsqlite3StrICmp(tls, ts+5467 /* "old" */, zTab) == 0)) {
+ if !(op != TK_INSERT && zTab != 0 && Xsqlite3StrICmp(tls, ts+6314, zTab) == 0) {
goto __43
}
(*Expr)(unsafe.Pointer(pExpr)).FiTable = 0
@@ -78896,14 +79885,14 @@ __39:
;
__37:
;
- if !((((*NameContext)(unsafe.Pointer(pNC)).FncFlags & NC_UUpsert) != 0) && (zTab != uintptr(0))) {
+ if !((*NameContext)(unsafe.Pointer(pNC)).FncFlags&NC_UUpsert != 0 && zTab != uintptr(0)) {
goto __44
}
- pUpsert = *(*uintptr)(unsafe.Pointer(pNC + 8 /* &.uNC */))
- if !((pUpsert != 0) && (Xsqlite3StrICmp(tls, ts+5471 /* "excluded" */, zTab) == 0)) {
+ pUpsert = *(*uintptr)(unsafe.Pointer(pNC + 8))
+ if !(pUpsert != 0 && Xsqlite3StrICmp(tls, ts+6318, zTab) == 0) {
goto __45
}
- pTab = (*SrcItem)(unsafe.Pointer(((*Upsert)(unsafe.Pointer(pUpsert)).FpUpsertSrc + 8 /* &.a */))).FpTab
+ pTab = (*SrcItem)(unsafe.Pointer((*Upsert)(unsafe.Pointer(pUpsert)).FpUpsertSrc + 8)).FpTab
(*Expr)(unsafe.Pointer(pExpr)).FiTable = EXCLUDED_TABLE_NUMBER
__45:
;
@@ -78922,7 +79911,8 @@ __47:
if !(iCol < int32((*Table)(unsafe.Pointer(pTab)).FnCol)) {
goto __49
}
- if !((int32((*Column)(unsafe.Pointer(pCol)).FhName) == int32(hCol1)) && (Xsqlite3StrICmp(tls, (*Column)(unsafe.Pointer(pCol)).FzName, zCol) == 0)) {
+ if !(int32((*Column)(unsafe.Pointer(pCol)).FhName) == int32(hCol1) &&
+ Xsqlite3StrICmp(tls, (*Column)(unsafe.Pointer(pCol)).FzCnName, zCol) == 0) {
goto __50
}
if !(iCol == int32((*Table)(unsafe.Pointer(pTab)).FiPKey)) {
@@ -78937,12 +79927,12 @@ __50:
goto __48
__48:
iCol++
- pCol += 20
+ pCol += 16
goto __47
goto __49
__49:
;
- if !(((iCol >= int32((*Table)(unsafe.Pointer(pTab)).FnCol)) && (Xsqlite3IsRowid(tls, zCol) != 0)) && (((*Table)(unsafe.Pointer((pTab))).FtabFlags & U32(TF_NoVisibleRowid)) == U32(0))) {
+ if !(iCol >= int32((*Table)(unsafe.Pointer(pTab)).FnCol) && Xsqlite3IsRowid(tls, zCol) != 0 && (*Table)(unsafe.Pointer(pTab)).FtabFlags&U32(TF_NoVisibleRowid) == U32(0)) {
goto __52
}
// IMP: R-51414-32910
@@ -78962,23 +79952,23 @@ __52:
goto __56
}
(*Expr)(unsafe.Pointer(pExpr)).FiColumn = YnVar(iCol)
- *(*uintptr)(unsafe.Pointer(pExpr + 44 /* &.y */)) = pTab
+ *(*uintptr)(unsafe.Pointer(pExpr + 44)) = pTab
eNewExprOp = TK_COLUMN
goto __57
__56:
- (*Expr)(unsafe.Pointer(pExpr)).FiTable = ((*Upsert)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pNC + 8 /* &.uNC */)))).FregData + int32(Xsqlite3TableColumnToStorage(tls, pTab, int16(iCol))))
+ (*Expr)(unsafe.Pointer(pExpr)).FiTable = (*Upsert)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pNC + 8)))).FregData + int32(Xsqlite3TableColumnToStorage(tls, pTab, int16(iCol)))
eNewExprOp = TK_REGISTER
__57:
;
goto __55
__54:
-
- *(*uintptr)(unsafe.Pointer(pExpr + 44 /* &.y */)) = pTab
+ ;
+ *(*uintptr)(unsafe.Pointer(pExpr + 44)) = pTab
if !((*Parse)(unsafe.Pointer(pParse)).FbReturning != 0) {
goto __58
}
eNewExprOp = TK_REGISTER
- (*Expr)(unsafe.Pointer(pExpr)).FiTable = (((*(*int32)(unsafe.Pointer(pNC + 8 /* &.uNC */)) + ((int32((*Table)(unsafe.Pointer(pTab)).FnCol) + 1) * (*Expr)(unsafe.Pointer(pExpr)).FiTable)) + int32(Xsqlite3TableColumnToStorage(tls, pTab, int16(iCol)))) + 1)
+ (*Expr)(unsafe.Pointer(pExpr)).FiTable = *(*int32)(unsafe.Pointer(pNC + 8)) + (int32((*Table)(unsafe.Pointer(pTab)).FnCol)+1)*(*Expr)(unsafe.Pointer(pExpr)).FiTable + int32(Xsqlite3TableColumnToStorage(tls, pTab, int16(iCol))) + 1
goto __59
__58:
(*Expr)(unsafe.Pointer(pExpr)).FiColumn = I16(iCol)
@@ -78993,22 +79983,22 @@ __60:
goto __62
}
- *(*U32)(unsafe.Pointer(pParse + 136 /* &.oldmask */)) |= (func() uint32 {
+ *(*U32)(unsafe.Pointer(pParse + 132)) |= func() uint32 {
if iCol >= 32 {
return 0xffffffff
}
- return (U32((U32(1))) << iCol)
- }())
+ return U32(U32(1)) << iCol
+ }()
goto __63
__62:
;
- *(*U32)(unsafe.Pointer(pParse + 140 /* &.newmask */)) |= (func() uint32 {
+ *(*U32)(unsafe.Pointer(pParse + 136)) |= func() uint32 {
if iCol >= 32 {
return 0xffffffff
}
- return (U32((U32(1))) << iCol)
- }())
+ return U32(U32(1)) << iCol
+ }()
__63:
;
__61:
@@ -79025,12 +80015,12 @@ __36:
;
// Perhaps the name is a reference to the ROWID
- if !((((((cnt == 0) &&
- (cntTab == 1)) &&
- (pMatch != 0)) &&
- (((*NameContext)(unsafe.Pointer(pNC)).FncFlags & (NC_IdxExpr | NC_GenCol)) == 0)) &&
- (Xsqlite3IsRowid(tls, zCol) != 0)) &&
- (((*Table)(unsafe.Pointer(((*SrcItem)(unsafe.Pointer(pMatch)).FpTab))).FtabFlags & U32(TF_NoVisibleRowid)) == U32(0))) {
+ if !(cnt == 0 &&
+ cntTab == 1 &&
+ pMatch != 0 &&
+ (*NameContext)(unsafe.Pointer(pNC)).FncFlags&(NC_IdxExpr|NC_GenCol) == 0 &&
+ Xsqlite3IsRowid(tls, zCol) != 0 &&
+ (*Table)(unsafe.Pointer((*SrcItem)(unsafe.Pointer(pMatch)).FpTab)).FtabFlags&U32(TF_NoVisibleRowid) == U32(0)) {
goto __64
}
cnt = 1
@@ -79055,44 +80045,44 @@ __64:
// clause is not standard SQL. This is a (goofy) SQLite extension, that
// is supported for backwards compatibility only. Hence, we issue a warning
// on sqlite3_log() whenever the capability is used.
- if !(((cnt == 0) &&
- (((*NameContext)(unsafe.Pointer(pNC)).FncFlags & NC_UEList) != 0)) &&
- (zTab == uintptr(0))) {
+ if !(cnt == 0 &&
+ (*NameContext)(unsafe.Pointer(pNC)).FncFlags&NC_UEList != 0 &&
+ zTab == uintptr(0)) {
goto __65
}
- pEList = *(*uintptr)(unsafe.Pointer(pNC + 8 /* &.uNC */))
+ pEList = *(*uintptr)(unsafe.Pointer(pNC + 8))
j = 0
__66:
if !(j < (*ExprList)(unsafe.Pointer(pEList)).FnExpr) {
goto __68
}
- zAs = (*ExprList_item)(unsafe.Pointer((pEList + 8 /* &.a */) + uintptr(j)*20)).FzEName
- if !(((int32(*(*uint8)(unsafe.Pointer(((pEList + 8 /* &.a */) + uintptr(j)*20) + 12 /* &.eEName */)) & 0x3 >> 0)) == ENAME_NAME) &&
- (Xsqlite3_stricmp(tls, zAs, zCol) == 0)) {
+ zAs = (*ExprList_item)(unsafe.Pointer(pEList + 8 + uintptr(j)*20)).FzEName
+ if !(int32(*(*uint8)(unsafe.Pointer(pEList + 8 + uintptr(j)*20 + 12))&0x3>>0) == ENAME_NAME &&
+ Xsqlite3_stricmp(tls, zAs, zCol) == 0) {
goto __69
}
- pOrig = (*ExprList_item)(unsafe.Pointer((pEList + 8 /* &.a */) + uintptr(j)*20)).FpExpr
- if !((((*NameContext)(unsafe.Pointer(pNC)).FncFlags & NC_AllowAgg) == 0) && (((*Expr)(unsafe.Pointer((pOrig))).Fflags & (U32(EP_Agg))) != U32(0))) {
+ pOrig = (*ExprList_item)(unsafe.Pointer(pEList + 8 + uintptr(j)*20)).FpExpr
+ if !((*NameContext)(unsafe.Pointer(pNC)).FncFlags&NC_AllowAgg == 0 && (*Expr)(unsafe.Pointer(pOrig)).Fflags&U32(EP_Agg) != U32(0)) {
goto __70
}
- Xsqlite3ErrorMsg(tls, pParse, ts+5480 /* "misuse of aliase..." */, libc.VaList(bp, zAs))
+ Xsqlite3ErrorMsg(tls, pParse, ts+6327 /* "misuse of aliase..." */, libc.VaList(bp, zAs))
return WRC_Abort
__70:
;
- if !((((*Expr)(unsafe.Pointer((pOrig))).Fflags & (U32(EP_Win))) != U32(0)) &&
- ((((*NameContext)(unsafe.Pointer(pNC)).FncFlags & NC_AllowWin) == 0) || (pNC != pTopNC))) {
+ if !((*Expr)(unsafe.Pointer(pOrig)).Fflags&U32(EP_Win) != U32(0) &&
+ ((*NameContext)(unsafe.Pointer(pNC)).FncFlags&NC_AllowWin == 0 || pNC != pTopNC)) {
goto __71
}
- Xsqlite3ErrorMsg(tls, pParse, ts+5511 /* "misuse of aliase..." */, libc.VaList(bp+8, zAs))
+ Xsqlite3ErrorMsg(tls, pParse, ts+6358 /* "misuse of aliase..." */, libc.VaList(bp+8, zAs))
return WRC_Abort
__71:
;
if !(Xsqlite3ExprVectorSize(tls, pOrig) != 1) {
goto __72
}
- Xsqlite3ErrorMsg(tls, pParse, ts+5548 /* "row value misuse..." */, 0)
+ Xsqlite3ErrorMsg(tls, pParse, ts+6395 /* "row value misuse..." */, 0)
return WRC_Abort
__72:
;
@@ -79146,12 +80136,12 @@ __11:
//
// Because no reference was made to outer contexts, the pNC->nRef
// fields are not changed in any context.
- if !((cnt == 0) && (zTab == uintptr(0))) {
+ if !(cnt == 0 && zTab == uintptr(0)) {
goto __75
}
- if !((((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_DblQuoted))) != U32(0)) &&
- (areDoubleQuotedStringsEnabled(tls, db, pTopNC) != 0)) {
+ if !((*Expr)(unsafe.Pointer(pExpr)).Fflags&U32(EP_DblQuoted) != U32(0) &&
+ areDoubleQuotedStringsEnabled(tls, db, pTopNC) != 0) {
goto __76
}
// If a double-quoted identifier does not match any known column name,
@@ -79168,9 +80158,12 @@ __11:
// a huge amount of legacy SQL that uses it. So for now, we just
// issue a warning.
Xsqlite3_log(tls, SQLITE_WARNING,
- ts+5566 /* "double-quoted st..." */, libc.VaList(bp+16, zCol))
+ ts+6413 /* "double-quoted st..." */, libc.VaList(bp+16, zCol))
(*Expr)(unsafe.Pointer(pExpr)).Fop = U8(TK_STRING)
- *(*uintptr)(unsafe.Pointer(pExpr + 44 /* &.y */)) = uintptr(0)
+ libc.Xmemset(tls, pExpr+44, 0, uint32(unsafe.Sizeof(struct {
+ FpTab uintptr
+ F__ccgo_pad1 [4]byte
+ }{})))
return WRC_Prune
__76:
;
@@ -79189,23 +80182,23 @@ __75:
goto __78
}
if cnt == 0 {
- zErr = ts + 5601 /* "no such column" */
+ zErr = ts + 6448 /* "no such column" */
} else {
- zErr = ts + 5616 /* "ambiguous column..." */
+ zErr = ts + 6463 /* "ambiguous column..." */
}
if !(zDb != 0) {
goto __79
}
- Xsqlite3ErrorMsg(tls, pParse, ts+5638 /* "%s: %s.%s.%s" */, libc.VaList(bp+24, zErr, zDb, zTab, zCol))
+ Xsqlite3ErrorMsg(tls, pParse, ts+6485 /* "%s: %s.%s.%s" */, libc.VaList(bp+24, zErr, zDb, zTab, zCol))
goto __80
__79:
if !(zTab != 0) {
goto __81
}
- Xsqlite3ErrorMsg(tls, pParse, ts+5651 /* "%s: %s.%s" */, libc.VaList(bp+56, zErr, zTab, zCol))
+ Xsqlite3ErrorMsg(tls, pParse, ts+6498 /* "%s: %s.%s" */, libc.VaList(bp+56, zErr, zTab, zCol))
goto __82
__81:
- Xsqlite3ErrorMsg(tls, pParse, ts+5661 /* "%s: %s" */, libc.VaList(bp+80, zErr, zCol))
+ Xsqlite3ErrorMsg(tls, pParse, ts+6508 /* "%s: %s" */, libc.VaList(bp+80, zErr, zCol))
__82:
;
__80:
@@ -79228,15 +80221,15 @@ __78:
//
// If a generated column is referenced, set bits for every column
// of the table.
- if !((int32((*Expr)(unsafe.Pointer(pExpr)).FiColumn) >= 0) && (pMatch != uintptr(0))) {
+ if !(int32((*Expr)(unsafe.Pointer(pExpr)).FiColumn) >= 0 && pMatch != uintptr(0)) {
goto __83
}
- *(*Bitmask)(unsafe.Pointer(pMatch + 56 /* &.colUsed */)) |= (Xsqlite3ExprColUsed(tls, pExpr))
+ *(*Bitmask)(unsafe.Pointer(pMatch + 56)) |= Xsqlite3ExprColUsed(tls, pExpr)
__83:
;
// Clean up and return
- if !(!(((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_TokenOnly | EP_Leaf))) != U32(0))) {
+ if !!((*Expr)(unsafe.Pointer(pExpr)).Fflags&U32(EP_TokenOnly|EP_Leaf) != U32(0)) {
goto __84
}
Xsqlite3ExprDelete(tls, db, (*Expr)(unsafe.Pointer(pExpr)).FpLeft)
@@ -79246,14 +80239,14 @@ __83:
__84:
;
(*Expr)(unsafe.Pointer(pExpr)).Fop = U8(eNewExprOp)
- *(*U32)(unsafe.Pointer(pExpr + 4 /* &.flags */)) |= (U32(EP_Leaf))
+ *(*U32)(unsafe.Pointer(pExpr + 4)) |= U32(EP_Leaf)
lookupname_end:
if !(cnt == 1) {
goto __85
}
- if !(((*Sqlite3)(unsafe.Pointer((*Parse)(unsafe.Pointer(pParse)).Fdb)).FxAuth != 0) &&
- ((int32((*Expr)(unsafe.Pointer(pExpr)).Fop) == TK_COLUMN) || (int32((*Expr)(unsafe.Pointer(pExpr)).Fop) == TK_TRIGGER))) {
+ if !((*Sqlite3)(unsafe.Pointer((*Parse)(unsafe.Pointer(pParse)).Fdb)).FxAuth != 0 &&
+ (int32((*Expr)(unsafe.Pointer(pExpr)).Fop) == TK_COLUMN || int32((*Expr)(unsafe.Pointer(pExpr)).Fop) == TK_TRIGGER)) {
goto __87
}
Xsqlite3AuthRead(tls, pParse, pExpr, pSchema, (*NameContext)(unsafe.Pointer(pNC)).FpSrcList)
@@ -79288,33 +80281,35 @@ __86:
// Allocate and return a pointer to an expression to load the column iCol
// from datasource iSrc in SrcList pSrc.
-func Xsqlite3CreateColumnExpr(tls *libc.TLS, db uintptr, pSrc uintptr, iSrc int32, iCol int32) uintptr { /* sqlite3.c:99880:21: */
+func Xsqlite3CreateColumnExpr(tls *libc.TLS, db uintptr, pSrc uintptr, iSrc int32, iCol int32) uintptr { /* sqlite3.c:100258:21: */
var p uintptr = Xsqlite3ExprAlloc(tls, db, TK_COLUMN, uintptr(0), 0)
if p != 0 {
- var pItem uintptr = ((pSrc + 8 /* &.a */) + uintptr(iSrc)*72)
- var pTab uintptr = libc.AssignPtrUintptr(p+44 /* &.y */ /* &.pTab */, (*SrcItem)(unsafe.Pointer(pItem)).FpTab)
+ var pItem uintptr = pSrc + 8 + uintptr(iSrc)*72
+ var pTab uintptr
+
+ pTab = libc.AssignPtrUintptr(p+44, (*SrcItem)(unsafe.Pointer(pItem)).FpTab)
(*Expr)(unsafe.Pointer(p)).FiTable = (*SrcItem)(unsafe.Pointer(pItem)).FiCursor
- if int32((*Table)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(p + 44 /* &.y */)))).FiPKey) == iCol {
+ if int32((*Table)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(p + 44)))).FiPKey) == iCol {
(*Expr)(unsafe.Pointer(p)).FiColumn = int16(-1)
} else {
(*Expr)(unsafe.Pointer(p)).FiColumn = YnVar(iCol)
- if (((*Table)(unsafe.Pointer(pTab)).FtabFlags & U32(TF_HasGenerated)) != U32(0)) &&
- ((int32((*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FaCol+uintptr(iCol)*20)).FcolFlags) & COLFLAG_GENERATED) != 0) {
+ if (*Table)(unsafe.Pointer(pTab)).FtabFlags&U32(TF_HasGenerated) != U32(0) &&
+ int32((*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FaCol+uintptr(iCol)*16)).FcolFlags)&COLFLAG_GENERATED != 0 {
(*SrcItem)(unsafe.Pointer(pItem)).FcolUsed = func() uint64 {
if int32((*Table)(unsafe.Pointer(pTab)).FnCol) >= 64 {
return libc.Uint64(libc.Uint64FromInt32(-1))
}
- return ((Bitmask((uint64(1))) << (int32((*Table)(unsafe.Pointer(pTab)).FnCol))) - uint64(1))
+ return Bitmask(uint64(1))<<int32((*Table)(unsafe.Pointer(pTab)).FnCol) - uint64(1)
}()
} else {
- *(*Bitmask)(unsafe.Pointer(pItem + 56 /* &.colUsed */)) |= (Bitmask((uint64(1))) << (func() int32 {
- if iCol >= (int32(uint32(unsafe.Sizeof(Bitmask(0))) * uint32(8))) {
- return ((int32(uint32(unsafe.Sizeof(Bitmask(0))) * uint32(8))) - 1)
+ *(*Bitmask)(unsafe.Pointer(pItem + 56)) |= Bitmask(uint64(1)) << func() int32 {
+ if iCol >= int32(uint32(unsafe.Sizeof(Bitmask(0)))*uint32(8)) {
+ return int32(uint32(unsafe.Sizeof(Bitmask(0)))*uint32(8)) - 1
}
return iCol
- }()))
+ }()
}
}
}
@@ -79335,19 +80330,19 @@ func Xsqlite3CreateColumnExpr(tls *libc.TLS, db uintptr, pSrc uintptr, iSrc int3
// As an optimization, since the conditional is almost always false
// (because errors are rare), the conditional is moved outside of the
// function call using a macro.
-func notValidImpl(tls *libc.TLS, pParse uintptr, pNC uintptr, zMsg uintptr, pExpr uintptr) { /* sqlite3.c:99922:13: */
+func notValidImpl(tls *libc.TLS, pParse uintptr, pNC uintptr, zMsg uintptr, pExpr uintptr) { /* sqlite3.c:100302:13: */
bp := tls.Alloc(16)
defer tls.Free(16)
- var zIn uintptr = ts + 5668 /* "partial index WH..." */
- if ((*NameContext)(unsafe.Pointer(pNC)).FncFlags & NC_IdxExpr) != 0 {
- zIn = ts + 5696 /* "index expression..." */
- } else if ((*NameContext)(unsafe.Pointer(pNC)).FncFlags & NC_IsCheck) != 0 {
- zIn = ts + 5714 /* "CHECK constraint..." */
- } else if ((*NameContext)(unsafe.Pointer(pNC)).FncFlags & NC_GenCol) != 0 {
- zIn = ts + 5732 /* "generated column..." */
+ var zIn uintptr = ts + 6515 /* "partial index WH..." */
+ if (*NameContext)(unsafe.Pointer(pNC)).FncFlags&NC_IdxExpr != 0 {
+ zIn = ts + 6543 /* "index expression..." */
+ } else if (*NameContext)(unsafe.Pointer(pNC)).FncFlags&NC_IsCheck != 0 {
+ zIn = ts + 6561 /* "CHECK constraint..." */
+ } else if (*NameContext)(unsafe.Pointer(pNC)).FncFlags&NC_GenCol != 0 {
+ zIn = ts + 6579 /* "generated column..." */
}
- Xsqlite3ErrorMsg(tls, pParse, ts+5750 /* "%s prohibited in..." */, libc.VaList(bp, zMsg, zIn))
+ Xsqlite3ErrorMsg(tls, pParse, ts+6597 /* "%s prohibited in..." */, libc.VaList(bp, zMsg, zIn))
if pExpr != 0 {
(*Expr)(unsafe.Pointer(pExpr)).Fop = U8(TK_NULL)
}
@@ -79356,7 +80351,7 @@ func notValidImpl(tls *libc.TLS, pParse uintptr, pNC uintptr, zMsg uintptr, pExp
// Expression p should encode a floating point value between 1.0 and 0.0.
// Return 1024 times this value. Or return -1 if p is not a floating point
// value between 1.0 and 0.0.
-func exprProbability(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:99948:12: */
+func exprProbability(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:100328:12: */
bp := tls.Alloc(8)
defer tls.Free(8)
@@ -79364,12 +80359,13 @@ func exprProbability(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:99948:12: */
if int32((*Expr)(unsafe.Pointer(p)).Fop) != TK_FLOAT {
return -1
}
- Xsqlite3AtoF(tls, *(*uintptr)(unsafe.Pointer(p + 8 /* &.u */)), bp /* &r */, Xsqlite3Strlen30(tls, *(*uintptr)(unsafe.Pointer(p + 8 /* &.u */))), uint8(SQLITE_UTF8))
- if *(*float64)(unsafe.Pointer(bp /* r */)) > 1.0 {
+ Xsqlite3AtoF(tls, *(*uintptr)(unsafe.Pointer(p + 8)), bp /* &r */, Xsqlite3Strlen30(tls, *(*uintptr)(unsafe.Pointer(p + 8))), uint8(SQLITE_UTF8))
+
+ if *(*float64)(unsafe.Pointer(bp)) > 1.0 {
return -1
}
- return (libc.Int32FromFloat64(*(*float64)(unsafe.Pointer(bp /* r */)) * 134217728.0))
+ return libc.Int32FromFloat64(*(*float64)(unsafe.Pointer(bp)) * 134217728.0)
}
// This routine is callback for sqlite3WalkExpr().
@@ -79381,14 +80377,14 @@ func exprProbability(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:99948:12: */
// This routine also does error checking and name resolution for
// function names. The operator for aggregate functions is changed
// to TK_AGG_FUNCTION.
-func resolveExprStep(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 { /* sqlite3.c:99968:12: */
+func resolveExprStep(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 { /* sqlite3.c:100349:12: */
bp := tls.Alloc(128)
defer tls.Free(128)
var pNC uintptr
var pParse uintptr
- pNC = *(*uintptr)(unsafe.Pointer(pWalker + 24 /* &.u */))
+ pNC = *(*uintptr)(unsafe.Pointer(pWalker + 24))
pParse = (*NameContext)(unsafe.Pointer(pNC)).FpParse
@@ -79405,7 +80401,8 @@ func resolveExprStep(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 { /* s
pItem = pSrcList + 8 /* &.a */
(*Expr)(unsafe.Pointer(pExpr)).Fop = U8(TK_COLUMN)
- *(*uintptr)(unsafe.Pointer(pExpr + 44 /* &.y */)) = (*SrcItem)(unsafe.Pointer(pItem)).FpTab
+
+ *(*uintptr)(unsafe.Pointer(pExpr + 44)) = (*SrcItem)(unsafe.Pointer(pItem)).FpTab
(*Expr)(unsafe.Pointer(pExpr)).FiTable = (*SrcItem)(unsafe.Pointer(pItem)).FiCursor
(*Expr)(unsafe.Pointer(pExpr)).FiColumn--
(*Expr)(unsafe.Pointer(pExpr)).FaffExpr = uint8(SQLITE_AFF_INTEGER)
@@ -79437,7 +80434,7 @@ func resolveExprStep(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 { /* s
i = 0
p = pNC
__1:
- if !((p != 0) && (i < (int32(uint32(unsafe.Sizeof([8]int32{})) / uint32(unsafe.Sizeof(int32(0))))))) {
+ if !(p != 0 && i < int32(uint32(unsafe.Sizeof([8]int32{}))/uint32(unsafe.Sizeof(int32(0))))) {
goto __3
}
{
@@ -79453,19 +80450,20 @@ func resolveExprStep(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 { /* s
__3:
;
Xsqlite3WalkExpr(tls, pWalker, (*Expr)(unsafe.Pointer(pExpr)).FpLeft)
- if (0 == Xsqlite3ExprCanBeNull(tls, (*Expr)(unsafe.Pointer(pExpr)).FpLeft)) && !(int32((*Parse)(unsafe.Pointer(pParse)).FeParseMode) >= PARSE_MODE_RENAME) {
+ if 0 == Xsqlite3ExprCanBeNull(tls, (*Expr)(unsafe.Pointer(pExpr)).FpLeft) && !(int32((*Parse)(unsafe.Pointer(pParse)).FeParseMode) >= PARSE_MODE_RENAME) {
+
if int32((*Expr)(unsafe.Pointer(pExpr)).Fop) == TK_NOTNULL {
- *(*uintptr)(unsafe.Pointer(pExpr + 8 /* &.u */)) = ts + 5770 /* "true" */
- *(*U32)(unsafe.Pointer(pExpr + 4 /* &.flags */)) |= (U32(EP_IsTrue))
+ *(*uintptr)(unsafe.Pointer(pExpr + 8)) = ts + 6617 /* "true" */
+ *(*U32)(unsafe.Pointer(pExpr + 4)) |= U32(EP_IsTrue)
} else {
- *(*uintptr)(unsafe.Pointer(pExpr + 8 /* &.u */)) = ts + 5775 /* "false" */
- *(*U32)(unsafe.Pointer(pExpr + 4 /* &.flags */)) |= (U32(EP_IsFalse))
+ *(*uintptr)(unsafe.Pointer(pExpr + 8)) = ts + 6622 /* "false" */
+ *(*U32)(unsafe.Pointer(pExpr + 4)) |= U32(EP_IsFalse)
}
(*Expr)(unsafe.Pointer(pExpr)).Fop = U8(TK_TRUEFALSE)
i = 0
p = pNC
__4:
- if !((p != 0) && (i < (int32(uint32(unsafe.Sizeof([8]int32{})) / uint32(unsafe.Sizeof(int32(0))))))) {
+ if !(p != 0 && i < int32(uint32(unsafe.Sizeof([8]int32{}))/uint32(unsafe.Sizeof(int32(0))))) {
goto __6
}
{
@@ -79506,12 +80504,13 @@ func resolveExprStep(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 { /* s
if int32((*Expr)(unsafe.Pointer(pExpr)).Fop) == TK_ID {
zDb = uintptr(0)
zTable = uintptr(0)
- zColumn = *(*uintptr)(unsafe.Pointer(pExpr + 8 /* &.u */))
+
+ zColumn = *(*uintptr)(unsafe.Pointer(pExpr + 8))
} else {
var pLeft uintptr = (*Expr)(unsafe.Pointer(pExpr)).FpLeft
- if ((*NameContext)(unsafe.Pointer((pNC))).FncFlags & (NC_IdxExpr | NC_GenCol)) != 0 {
- notValidImpl(tls, pParse, pNC, ts+5781 /* "the \".\" operator" */, uintptr(0))
+ if (*NameContext)(unsafe.Pointer(pNC)).FncFlags&(NC_IdxExpr|NC_GenCol) != 0 {
+ notValidImpl(tls, pParse, pNC, ts+6628 /* "the \".\" operator" */, uintptr(0))
}
pRight = (*Expr)(unsafe.Pointer(pExpr)).FpRight
@@ -79519,15 +80518,17 @@ func resolveExprStep(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 { /* s
zDb = uintptr(0)
} else {
- zDb = *(*uintptr)(unsafe.Pointer(pLeft + 8 /* &.u */))
+ zDb = *(*uintptr)(unsafe.Pointer(pLeft + 8))
pLeft = (*Expr)(unsafe.Pointer(pRight)).FpLeft
pRight = (*Expr)(unsafe.Pointer(pRight)).FpRight
}
- zTable = *(*uintptr)(unsafe.Pointer(pLeft + 8 /* &.u */))
- zColumn = *(*uintptr)(unsafe.Pointer(pRight + 8 /* &.u */))
+
+ zTable = *(*uintptr)(unsafe.Pointer(pLeft + 8))
+ zColumn = *(*uintptr)(unsafe.Pointer(pRight + 8))
+
if int32((*Parse)(unsafe.Pointer(pParse)).FeParseMode) >= PARSE_MODE_RENAME {
Xsqlite3RenameTokenRemap(tls, pParse, pExpr, pRight)
- Xsqlite3RenameTokenRemap(tls, pParse, (pExpr + 44 /* &.y */ /* &.pTab */), pLeft)
+ Xsqlite3RenameTokenRemap(tls, pParse, pExpr+44, pLeft)
}
}
return lookupName(tls, pParse, zDb, zTable, zColumn, pNC, pExpr)
@@ -79537,7 +80538,7 @@ func resolveExprStep(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 { /* s
// Resolve function names
case TK_FUNCTION:
{
- var pList uintptr = *(*uintptr)(unsafe.Pointer(pExpr + 20 /* &.x */)) // The argument list
+ var pList uintptr = *(*uintptr)(unsafe.Pointer(pExpr + 20)) // The argument list
var n int32
if pList != 0 {
n = (*ExprList)(unsafe.Pointer(pList)).FnExpr
@@ -79551,15 +80552,15 @@ func resolveExprStep(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 { /* s
var zId uintptr // The function name.
var pDef uintptr // Information about the function
var enc U8 = (*Sqlite3)(unsafe.Pointer((*Parse)(unsafe.Pointer(pParse)).Fdb)).Fenc // The database encoding
- var savedAllowFlags int32 = ((*NameContext)(unsafe.Pointer(pNC)).FncFlags & (NC_AllowAgg | NC_AllowWin))
+ var savedAllowFlags int32 = (*NameContext)(unsafe.Pointer(pNC)).FncFlags & (NC_AllowAgg | NC_AllowWin)
var pWin uintptr = func() uintptr {
- if (((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_WinFunc))) != U32(0)) && (int32((*Window)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pExpr + 44 /* &.y */)))).FeFrmType) != TK_FILTER) {
- return *(*uintptr)(unsafe.Pointer(pExpr + 44 /* &.y */))
+ if (*Expr)(unsafe.Pointer(pExpr)).Fflags&U32(EP_WinFunc) != U32(0) && int32((*Window)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pExpr + 44)))).FeFrmType) != TK_FILTER {
+ return *(*uintptr)(unsafe.Pointer(pExpr + 44))
}
return uintptr(0)
}()
- zId = *(*uintptr)(unsafe.Pointer(pExpr + 8 /* &.u */))
+ zId = *(*uintptr)(unsafe.Pointer(pExpr + 8))
nId = Xsqlite3Strlen30(tls, zId)
pDef = Xsqlite3FindFunction(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, zId, n, enc, uint8(0))
if pDef == uintptr(0) {
@@ -79570,15 +80571,15 @@ func resolveExprStep(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 { /* s
wrong_num_args = 1
}
} else {
- is_agg = (libc.Bool32((*FuncDef)(unsafe.Pointer(pDef)).FxFinalize != uintptr(0)))
- if ((*FuncDef)(unsafe.Pointer(pDef)).FfuncFlags & U32(SQLITE_FUNC_UNLIKELY)) != 0 {
- *(*U32)(unsafe.Pointer(pExpr + 4 /* &.flags */)) |= (U32(EP_Unlikely))
+ is_agg = libc.Bool32((*FuncDef)(unsafe.Pointer(pDef)).FxFinalize != uintptr(0))
+ if (*FuncDef)(unsafe.Pointer(pDef)).FfuncFlags&U32(SQLITE_FUNC_UNLIKELY) != 0 {
+ *(*U32)(unsafe.Pointer(pExpr + 4)) |= U32(EP_Unlikely)
if n == 2 {
- (*Expr)(unsafe.Pointer(pExpr)).FiTable = exprProbability(tls, (*ExprList_item)(unsafe.Pointer((pList+8 /* &.a */)+1*20)).FpExpr)
+ (*Expr)(unsafe.Pointer(pExpr)).FiTable = exprProbability(tls, (*ExprList_item)(unsafe.Pointer(pList+8+1*20)).FpExpr)
if (*Expr)(unsafe.Pointer(pExpr)).FiTable < 0 {
Xsqlite3ErrorMsg(tls, pParse,
- ts+5798 /* "second argument ..." */, 0)
+ ts+6645 /* "second argument ..." */, 0)
(*NameContext)(unsafe.Pointer(pNC)).FnNcErr++
}
} else {
@@ -79603,7 +80604,7 @@ func resolveExprStep(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 { /* s
var auth int32 = Xsqlite3AuthCheck(tls, pParse, SQLITE_FUNCTION, uintptr(0), (*FuncDef)(unsafe.Pointer(pDef)).FzName, uintptr(0))
if auth != SQLITE_OK {
if auth == SQLITE_DENY {
- Xsqlite3ErrorMsg(tls, pParse, ts+5869, /* "not authorized t..." */
+ Xsqlite3ErrorMsg(tls, pParse, ts+6716, /* "not authorized t..." */
libc.VaList(bp, (*FuncDef)(unsafe.Pointer(pDef)).FzName))
(*NameContext)(unsafe.Pointer(pNC)).FnNcErr++
}
@@ -79612,74 +80613,74 @@ func resolveExprStep(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 { /* s
}
}
- if ((*FuncDef)(unsafe.Pointer(pDef)).FfuncFlags & (U32(SQLITE_FUNC_CONSTANT | SQLITE_FUNC_SLOCHNG))) != 0 {
+ if (*FuncDef)(unsafe.Pointer(pDef)).FfuncFlags&U32(SQLITE_FUNC_CONSTANT|SQLITE_FUNC_SLOCHNG) != 0 {
// For the purposes of the EP_ConstFunc flag, date and time
// functions and other functions that change slowly are considered
// constant because they are constant for the duration of one query.
// This allows them to be factored out of inner loops.
- *(*U32)(unsafe.Pointer(pExpr + 4 /* &.flags */)) |= (U32(EP_ConstFunc))
+ *(*U32)(unsafe.Pointer(pExpr + 4)) |= U32(EP_ConstFunc)
}
- if ((*FuncDef)(unsafe.Pointer(pDef)).FfuncFlags & U32(SQLITE_FUNC_CONSTANT)) == U32(0) {
+ if (*FuncDef)(unsafe.Pointer(pDef)).FfuncFlags&U32(SQLITE_FUNC_CONSTANT) == U32(0) {
// Clearly non-deterministic functions like random(), but also
// date/time functions that use 'now', and other functions like
// sqlite_version() that might change over time cannot be used
// in an index or generated column. Curiously, they can be used
// in a CHECK constraint. SQLServer, MySQL, and PostgreSQL all
// all this.
- if ((*NameContext)(unsafe.Pointer((pNC))).FncFlags & ((NC_IdxExpr | NC_PartIdx) | NC_GenCol)) != 0 {
- notValidImpl(tls, pParse, pNC, ts+5904 /* "non-deterministi..." */, uintptr(0))
+ if (*NameContext)(unsafe.Pointer(pNC)).FncFlags&(NC_IdxExpr|NC_PartIdx|NC_GenCol) != 0 {
+ notValidImpl(tls, pParse, pNC, ts+6751 /* "non-deterministi..." */, uintptr(0))
}
} else {
// Must fit in 8 bits
- (*Expr)(unsafe.Pointer(pExpr)).Fop2 = (U8((*NameContext)(unsafe.Pointer(pNC)).FncFlags & NC_SelfRef))
- if ((*NameContext)(unsafe.Pointer(pNC)).FncFlags & NC_FromDDL) != 0 {
- *(*U32)(unsafe.Pointer(pExpr + 4 /* &.flags */)) |= (U32(EP_FromDDL))
+ (*Expr)(unsafe.Pointer(pExpr)).Fop2 = U8((*NameContext)(unsafe.Pointer(pNC)).FncFlags & NC_SelfRef)
+ if (*NameContext)(unsafe.Pointer(pNC)).FncFlags&NC_FromDDL != 0 {
+ *(*U32)(unsafe.Pointer(pExpr + 4)) |= U32(EP_FromDDL)
}
}
- if ((((*FuncDef)(unsafe.Pointer(pDef)).FfuncFlags & U32(SQLITE_FUNC_INTERNAL)) != U32(0)) &&
- (int32((*Parse)(unsafe.Pointer(pParse)).Fnested) == 0)) &&
- (((*Sqlite3)(unsafe.Pointer((*Parse)(unsafe.Pointer(pParse)).Fdb)).FmDbFlags & U32(DBFLAG_InternalFunc)) == U32(0)) {
+ if (*FuncDef)(unsafe.Pointer(pDef)).FfuncFlags&U32(SQLITE_FUNC_INTERNAL) != U32(0) &&
+ int32((*Parse)(unsafe.Pointer(pParse)).Fnested) == 0 &&
+ (*Sqlite3)(unsafe.Pointer((*Parse)(unsafe.Pointer(pParse)).Fdb)).FmDbFlags&U32(DBFLAG_InternalFunc) == U32(0) {
// Internal-use-only functions are disallowed unless the
// SQL is being compiled using sqlite3NestedParse() or
// the SQLITE_TESTCTRL_INTERNAL_FUNCTIONS test-control has be
// used to activate internal functionsn for testing purposes
no_such_func = 1
pDef = uintptr(0)
- } else if (((*FuncDef)(unsafe.Pointer(pDef)).FfuncFlags & (U32(SQLITE_FUNC_DIRECT | SQLITE_FUNC_UNSAFE))) != U32(0)) &&
+ } else if (*FuncDef)(unsafe.Pointer(pDef)).FfuncFlags&U32(SQLITE_FUNC_DIRECT|SQLITE_FUNC_UNSAFE) != U32(0) &&
!(int32((*Parse)(unsafe.Pointer(pParse)).FeParseMode) >= PARSE_MODE_RENAME) {
Xsqlite3ExprFunctionUsable(tls, pParse, pExpr, pDef)
}
}
- if 0 == (libc.Bool32(int32((*Parse)(unsafe.Pointer(pParse)).FeParseMode) >= PARSE_MODE_RENAME)) {
+ if 0 == libc.Bool32(int32((*Parse)(unsafe.Pointer(pParse)).FeParseMode) >= PARSE_MODE_RENAME) {
- if ((pDef != 0) && ((*FuncDef)(unsafe.Pointer(pDef)).FxValue == uintptr(0))) && (pWin != 0) {
+ if pDef != 0 && (*FuncDef)(unsafe.Pointer(pDef)).FxValue == uintptr(0) && pWin != 0 {
Xsqlite3ErrorMsg(tls, pParse,
- ts+5932 /* "%.*s() may not b..." */, libc.VaList(bp+8, nId, zId))
+ ts+6779 /* "%.*s() may not b..." */, libc.VaList(bp+8, nId, zId))
(*NameContext)(unsafe.Pointer(pNC)).FnNcErr++
- } else if (((is_agg != 0) && (((*NameContext)(unsafe.Pointer(pNC)).FncFlags & NC_AllowAgg) == 0)) ||
- (((is_agg != 0) && (((*FuncDef)(unsafe.Pointer(pDef)).FfuncFlags & U32(SQLITE_FUNC_WINDOW)) != 0)) && !(pWin != 0))) ||
- (((is_agg != 0) && (pWin != 0)) && (((*NameContext)(unsafe.Pointer(pNC)).FncFlags & NC_AllowWin) == 0)) {
+ } else if is_agg != 0 && (*NameContext)(unsafe.Pointer(pNC)).FncFlags&NC_AllowAgg == 0 ||
+ is_agg != 0 && (*FuncDef)(unsafe.Pointer(pDef)).FfuncFlags&U32(SQLITE_FUNC_WINDOW) != 0 && !(pWin != 0) ||
+ is_agg != 0 && pWin != 0 && (*NameContext)(unsafe.Pointer(pNC)).FncFlags&NC_AllowWin == 0 {
var zType uintptr
- if (((*FuncDef)(unsafe.Pointer(pDef)).FfuncFlags & U32(SQLITE_FUNC_WINDOW)) != 0) || (pWin != 0) {
- zType = ts + 5976 /* "window" */
+ if (*FuncDef)(unsafe.Pointer(pDef)).FfuncFlags&U32(SQLITE_FUNC_WINDOW) != 0 || pWin != 0 {
+ zType = ts + 6823 /* "window" */
} else {
- zType = ts + 5983 /* "aggregate" */
+ zType = ts + 6830 /* "aggregate" */
}
- Xsqlite3ErrorMsg(tls, pParse, ts+5993 /* "misuse of %s fun..." */, libc.VaList(bp+24, zType, nId, zId))
+ Xsqlite3ErrorMsg(tls, pParse, ts+6840 /* "misuse of %s fun..." */, libc.VaList(bp+24, zType, nId, zId))
(*NameContext)(unsafe.Pointer(pNC)).FnNcErr++
is_agg = 0
- } else if (no_such_func != 0) && (int32((*Sqlite3)(unsafe.Pointer((*Parse)(unsafe.Pointer(pParse)).Fdb)).Finit.Fbusy) == 0) {
- Xsqlite3ErrorMsg(tls, pParse, ts+6022 /* "no such function..." */, libc.VaList(bp+48, nId, zId))
+ } else if no_such_func != 0 && int32((*Sqlite3)(unsafe.Pointer((*Parse)(unsafe.Pointer(pParse)).Fdb)).Finit.Fbusy) == 0 {
+ Xsqlite3ErrorMsg(tls, pParse, ts+6869 /* "no such function..." */, libc.VaList(bp+48, nId, zId))
(*NameContext)(unsafe.Pointer(pNC)).FnNcErr++
} else if wrong_num_args != 0 {
- Xsqlite3ErrorMsg(tls, pParse, ts+6045, /* "wrong number of ..." */
+ Xsqlite3ErrorMsg(tls, pParse, ts+6892, /* "wrong number of ..." */
libc.VaList(bp+64, nId, zId))
(*NameContext)(unsafe.Pointer(pNC)).FnNcErr++
- } else if (is_agg == 0) && (((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_WinFunc))) != U32(0)) {
+ } else if is_agg == 0 && (*Expr)(unsafe.Pointer(pExpr)).Fflags&U32(EP_WinFunc) != U32(0) {
Xsqlite3ErrorMsg(tls, pParse,
- ts+6090, /* "FILTER may not b..." */
+ ts+6937, /* "FILTER may not b..." */
libc.VaList(bp+80, nId, zId))
(*NameContext)(unsafe.Pointer(pNC)).FnNcErr++
}
@@ -79687,14 +80688,14 @@ func resolveExprStep(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 { /* s
// Window functions may not be arguments of aggregate functions.
// Or arguments of other window functions. But aggregate functions
// may be arguments for window functions.
- *(*int32)(unsafe.Pointer(pNC + 24 /* &.ncFlags */)) &= (^(NC_AllowWin | (func() int32 {
+ *(*int32)(unsafe.Pointer(pNC + 24)) &= ^(NC_AllowWin | func() int32 {
if !(pWin != 0) {
return NC_AllowAgg
}
return 0
- }())))
+ }())
}
- } else if ((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_WinFunc))) != U32(0) {
+ } else if (*Expr)(unsafe.Pointer(pExpr)).Fflags&U32(EP_WinFunc) != U32(0) {
is_agg = 1
}
Xsqlite3WalkExprList(tls, pWalker, pList)
@@ -79702,7 +80703,7 @@ func resolveExprStep(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 { /* s
if pWin != 0 {
var pSel uintptr = (*NameContext)(unsafe.Pointer(pNC)).FpWinSelect
- if (libc.Bool32(int32((*Parse)(unsafe.Pointer(pParse)).FeParseMode) >= PARSE_MODE_RENAME)) == 0 {
+ if libc.Bool32(int32((*Parse)(unsafe.Pointer(pParse)).FeParseMode) >= PARSE_MODE_RENAME) == 0 {
Xsqlite3WindowUpdate(tls, pParse, func() uintptr {
if pSel != 0 {
return (*Select)(unsafe.Pointer(pSel)).FpWinDefn
@@ -79717,26 +80718,29 @@ func resolveExprStep(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 { /* s
Xsqlite3WalkExprList(tls, pWalker, (*Window)(unsafe.Pointer(pWin)).FpOrderBy)
Xsqlite3WalkExpr(tls, pWalker, (*Window)(unsafe.Pointer(pWin)).FpFilter)
Xsqlite3WindowLink(tls, pSel, pWin)
- *(*int32)(unsafe.Pointer(pNC + 24 /* &.ncFlags */)) |= (NC_HasWin)
+ *(*int32)(unsafe.Pointer(pNC + 24)) |= NC_HasWin
} else {
- var pNC2 uintptr = pNC
+ var pNC2 uintptr // For looping up thru outer contexts
(*Expr)(unsafe.Pointer(pExpr)).Fop = U8(TK_AGG_FUNCTION)
(*Expr)(unsafe.Pointer(pExpr)).Fop2 = U8(0)
- if ((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_WinFunc))) != U32(0) {
- Xsqlite3WalkExpr(tls, pWalker, (*Window)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pExpr + 44 /* &.y */)))).FpFilter)
+ if (*Expr)(unsafe.Pointer(pExpr)).Fflags&U32(EP_WinFunc) != U32(0) {
+ Xsqlite3WalkExpr(tls, pWalker, (*Window)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pExpr + 44)))).FpFilter)
}
- for (pNC2 != 0) && !(Xsqlite3FunctionUsesThisSrc(tls, pExpr, (*NameContext)(unsafe.Pointer(pNC2)).FpSrcList) != 0) {
+ pNC2 = pNC
+ for pNC2 != 0 &&
+ Xsqlite3ReferencesSrcList(tls, pParse, pExpr, (*NameContext)(unsafe.Pointer(pNC2)).FpSrcList) == 0 {
(*Expr)(unsafe.Pointer(pExpr)).Fop2++
pNC2 = (*NameContext)(unsafe.Pointer(pNC2)).FpNext
}
- if (pNC2 != 0) && (pDef != 0) {
-
- *(*int32)(unsafe.Pointer(pNC2 + 24 /* &.ncFlags */)) |= int32((U32(NC_HasAgg) | ((*FuncDef)(unsafe.Pointer(pDef)).FfuncFlags & U32(SQLITE_FUNC_MINMAX))))
+ if pNC2 != 0 && pDef != 0 {
+ *(*int32)(unsafe.Pointer(pNC2 + 24)) |= int32(U32(NC_HasAgg) |
+ ((*FuncDef)(unsafe.Pointer(pDef)).FfuncFlags^U32(SQLITE_FUNC_ANYORDER))&
+ U32(SQLITE_FUNC_MINMAX|SQLITE_FUNC_ANYORDER))
}
}
- *(*int32)(unsafe.Pointer(pNC + 24 /* &.ncFlags */)) |= (savedAllowFlags)
+ *(*int32)(unsafe.Pointer(pNC + 24)) |= savedAllowFlags
}
// FIX ME: Compute pExpr->affinity based on the expected return
// type of the function
@@ -79750,18 +80754,18 @@ func resolveExprStep(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 { /* s
case TK_IN:
{
- if ((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_xIsSelect))) != U32(0) {
+ if (*Expr)(unsafe.Pointer(pExpr)).Fflags&U32(EP_xIsSelect) != U32(0) {
var nRef int32 = (*NameContext)(unsafe.Pointer(pNC)).FnRef
- if ((*NameContext)(unsafe.Pointer((pNC))).FncFlags & (((NC_IsCheck | NC_PartIdx) | NC_IdxExpr) | NC_GenCol)) != 0 {
- notValidImpl(tls, pParse, pNC, ts+6139 /* "subqueries" */, pExpr)
+ if (*NameContext)(unsafe.Pointer(pNC)).FncFlags&NC_SelfRef != 0 {
+ notValidImpl(tls, pParse, pNC, ts+6986 /* "subqueries" */, pExpr)
+ } else {
+ Xsqlite3WalkSelect(tls, pWalker, *(*uintptr)(unsafe.Pointer(pExpr + 20)))
}
- Xsqlite3WalkSelect(tls, pWalker, *(*uintptr)(unsafe.Pointer(pExpr + 20 /* &.x */)))
-
if nRef != (*NameContext)(unsafe.Pointer(pNC)).FnRef {
- *(*U32)(unsafe.Pointer(pExpr + 4 /* &.flags */)) |= (U32(EP_VarSelect))
- *(*int32)(unsafe.Pointer(pNC + 24 /* &.ncFlags */)) |= (NC_VarSelect)
+ *(*U32)(unsafe.Pointer(pExpr + 4)) |= U32(EP_VarSelect)
+ *(*int32)(unsafe.Pointer(pNC + 24)) |= NC_VarSelect
}
}
break
@@ -79770,8 +80774,8 @@ func resolveExprStep(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 { /* s
case TK_VARIABLE:
{
- if ((*NameContext)(unsafe.Pointer((pNC))).FncFlags & (((NC_IsCheck | NC_PartIdx) | NC_IdxExpr) | NC_GenCol)) != 0 {
- notValidImpl(tls, pParse, pNC, ts+6150 /* "parameters" */, pExpr)
+ if (*NameContext)(unsafe.Pointer(pNC)).FncFlags&(NC_IsCheck|NC_PartIdx|NC_IdxExpr|NC_GenCol) != 0 {
+ notValidImpl(tls, pParse, pNC, ts+6997 /* "parameters" */, pExpr)
}
break
@@ -79785,7 +80789,7 @@ func resolveExprStep(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 { /* s
// Handle special cases of "x IS TRUE", "x IS FALSE", "x IS NOT TRUE",
// and "x IS NOT FALSE".
- if (pRight != 0) && ((int32((*Expr)(unsafe.Pointer(pRight)).Fop) == TK_ID) || (int32((*Expr)(unsafe.Pointer(pRight)).Fop) == TK_TRUEFALSE)) {
+ if pRight != 0 && (int32((*Expr)(unsafe.Pointer(pRight)).Fop) == TK_ID || int32((*Expr)(unsafe.Pointer(pRight)).Fop) == TK_TRUEFALSE) {
var rc int32 = resolveExprStep(tls, pWalker, pRight)
if rc == WRC_Abort {
return WRC_Abort
@@ -79821,9 +80825,10 @@ func resolveExprStep(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 { /* s
nLeft = Xsqlite3ExprVectorSize(tls, (*Expr)(unsafe.Pointer(pExpr)).FpLeft)
if int32((*Expr)(unsafe.Pointer(pExpr)).Fop) == TK_BETWEEN {
- nRight = Xsqlite3ExprVectorSize(tls, (*ExprList_item)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(pExpr + 20 /* &.x */)) + 8 /* &.a */))).FpExpr)
+
+ nRight = Xsqlite3ExprVectorSize(tls, (*ExprList_item)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pExpr + 20))+8)).FpExpr)
if nRight == nLeft {
- nRight = Xsqlite3ExprVectorSize(tls, (*ExprList_item)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(pExpr + 20 /* &.x */))+8 /* &.a */)+1*20)).FpExpr)
+ nRight = Xsqlite3ExprVectorSize(tls, (*ExprList_item)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pExpr + 20))+8+1*20)).FpExpr)
}
} else {
@@ -79831,13 +80836,13 @@ func resolveExprStep(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 { /* s
}
if nLeft != nRight {
- Xsqlite3ErrorMsg(tls, pParse, ts+5548 /* "row value misuse..." */, 0)
+ Xsqlite3ErrorMsg(tls, pParse, ts+6395 /* "row value misuse..." */, 0)
}
break
}
}
- if ((*Parse)(unsafe.Pointer(pParse)).FnErr != 0) || ((*Sqlite3)(unsafe.Pointer((*Parse)(unsafe.Pointer(pParse)).Fdb)).FmallocFailed != 0) {
+ if (*Parse)(unsafe.Pointer(pParse)).FnErr != 0 || (*Sqlite3)(unsafe.Pointer((*Parse)(unsafe.Pointer(pParse)).Fdb)).FmallocFailed != 0 {
return WRC_Abort
}
return WRC_Continue
@@ -79853,17 +80858,19 @@ func resolveExprStep(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 { /* s
// return 0.
//
// pEList has been resolved. pE has not.
-func resolveAsName(tls *libc.TLS, pParse uintptr, pEList uintptr, pE uintptr) int32 { /* sqlite3.c:100410:12: */
+func resolveAsName(tls *libc.TLS, pParse uintptr, pEList uintptr, pE uintptr) int32 { /* sqlite3.c:100807:12: */
var i int32 // Loop counter
_ = pParse
if int32((*Expr)(unsafe.Pointer(pE)).Fop) == TK_ID {
- var zCol uintptr = *(*uintptr)(unsafe.Pointer(pE + 8 /* &.u */))
+ var zCol uintptr
+
+ zCol = *(*uintptr)(unsafe.Pointer(pE + 8))
for i = 0; i < (*ExprList)(unsafe.Pointer(pEList)).FnExpr; i++ {
- if ((int32(*(*uint8)(unsafe.Pointer(((pEList + 8 /* &.a */) + uintptr(i)*20) + 12 /* &.eEName */)) & 0x3 >> 0)) == ENAME_NAME) &&
- (Xsqlite3_stricmp(tls, (*ExprList_item)(unsafe.Pointer((pEList+8 /* &.a */)+uintptr(i)*20)).FzEName, zCol) == 0) {
- return (i + 1)
+ if int32(*(*uint8)(unsafe.Pointer(pEList + 8 + uintptr(i)*20 + 12))&0x3>>0) == ENAME_NAME &&
+ Xsqlite3_stricmp(tls, (*ExprList_item)(unsafe.Pointer(pEList+8+uintptr(i)*20)).FzEName, zCol) == 0 {
+ return i + 1
}
}
}
@@ -79886,7 +80893,7 @@ func resolveAsName(tls *libc.TLS, pParse uintptr, pEList uintptr, pE uintptr) in
// the column.
//
// If there is no match, return 0. Return -1 if an error occurs.
-func resolveOrderByTermToExprList(tls *libc.TLS, pParse uintptr, pSelect uintptr, pE uintptr) int32 { /* sqlite3.c:100450:12: */
+func resolveOrderByTermToExprList(tls *libc.TLS, pParse uintptr, pSelect uintptr, pE uintptr) int32 { /* sqlite3.c:100849:12: */
bp := tls.Alloc(32)
defer tls.Free(32)
@@ -79904,8 +80911,8 @@ func resolveOrderByTermToExprList(tls *libc.TLS, pParse uintptr, pSelect uintptr
libc.Xmemset(tls, bp /* &nc */, 0, uint32(unsafe.Sizeof(NameContext{})))
(*NameContext)(unsafe.Pointer(bp /* &nc */)).FpParse = pParse
(*NameContext)(unsafe.Pointer(bp /* &nc */)).FpSrcList = (*Select)(unsafe.Pointer(pSelect)).FpSrc
- *(*uintptr)(unsafe.Pointer(bp /* &nc */ + 8 /* &.uNC */)) = pEList
- (*NameContext)(unsafe.Pointer(bp /* &nc */)).FncFlags = ((NC_AllowAgg | NC_UEList) | NC_NoSelect)
+ *(*uintptr)(unsafe.Pointer(bp + 8)) = pEList
+ (*NameContext)(unsafe.Pointer(bp /* &nc */)).FncFlags = NC_AllowAgg | NC_UEList | NC_NoSelect
(*NameContext)(unsafe.Pointer(bp /* &nc */)).FnNcErr = 0
db = (*Parse)(unsafe.Pointer(pParse)).Fdb
savedSuppErr = (*Sqlite3)(unsafe.Pointer(db)).FsuppressErr
@@ -79920,8 +80927,8 @@ func resolveOrderByTermToExprList(tls *libc.TLS, pParse uintptr, pSelect uintptr
// in the result set. Return an 1-based index of the matching
// result-set entry.
for i = 0; i < (*ExprList)(unsafe.Pointer(pEList)).FnExpr; i++ {
- if Xsqlite3ExprCompare(tls, uintptr(0), (*ExprList_item)(unsafe.Pointer((pEList+8 /* &.a */)+uintptr(i)*20)).FpExpr, pE, -1) < 2 {
- return (i + 1)
+ if Xsqlite3ExprCompare(tls, uintptr(0), (*ExprList_item)(unsafe.Pointer(pEList+8+uintptr(i)*20)).FpExpr, pE, -1) < 2 {
+ return i + 1
}
}
@@ -79930,13 +80937,13 @@ func resolveOrderByTermToExprList(tls *libc.TLS, pParse uintptr, pSelect uintptr
}
// Generate an ORDER BY or GROUP BY term out-of-range error.
-func resolveOutOfRangeError(tls *libc.TLS, pParse uintptr, zType uintptr, i int32, mx int32) { /* sqlite3.c:100497:13: */
+func resolveOutOfRangeError(tls *libc.TLS, pParse uintptr, zType uintptr, i int32, mx int32) { /* sqlite3.c:100896:13: */
bp := tls.Alloc(24)
defer tls.Free(24)
Xsqlite3ErrorMsg(tls, pParse,
- ts+6161 /* "%r %s BY term ou..." */, libc.VaList(bp, i, zType, mx))
+ ts+7008 /* "%r %s BY term ou..." */, libc.VaList(bp, i, zType, mx))
}
// Analyze the ORDER BY clause in a compound SELECT statement. Modify
@@ -79952,7 +80959,7 @@ func resolveOutOfRangeError(tls *libc.TLS, pParse uintptr, zType uintptr, i int3
// the integer column number.
//
// Return the number of errors seen.
-func resolveCompoundOrderBy(tls *libc.TLS, pParse uintptr, pSelect uintptr) int32 { /* sqlite3.c:100523:12: */
+func resolveCompoundOrderBy(tls *libc.TLS, pParse uintptr, pSelect uintptr) int32 { /* sqlite3.c:100922:12: */
bp := tls.Alloc(12)
defer tls.Free(12)
@@ -79967,19 +80974,19 @@ func resolveCompoundOrderBy(tls *libc.TLS, pParse uintptr, pSelect uintptr) int3
return 0
}
db = (*Parse)(unsafe.Pointer(pParse)).Fdb
- if (*ExprList)(unsafe.Pointer(pOrderBy)).FnExpr > *(*int32)(unsafe.Pointer((db + 112 /* &.aLimit */) + 2*4)) {
- Xsqlite3ErrorMsg(tls, pParse, ts+6217 /* "too many terms i..." */, 0)
+ if (*ExprList)(unsafe.Pointer(pOrderBy)).FnExpr > *(*int32)(unsafe.Pointer(db + 120 + 2*4)) {
+ Xsqlite3ErrorMsg(tls, pParse, ts+7064 /* "too many terms i..." */, 0)
return 1
}
for i = 0; i < (*ExprList)(unsafe.Pointer(pOrderBy)).FnExpr; i++ {
- libc.SetBitFieldPtr8Uint32((pOrderBy+8 /* &.a */)+uintptr(i)*20+12 /* &.done */, uint32(0), 2, 0x4)
+ libc.SetBitFieldPtr8Uint32(pOrderBy+8+uintptr(i)*20+12, uint32(0), 2, 0x4)
}
(*Select)(unsafe.Pointer(pSelect)).FpNext = uintptr(0)
for (*Select)(unsafe.Pointer(pSelect)).FpPrior != 0 {
(*Select)(unsafe.Pointer((*Select)(unsafe.Pointer(pSelect)).FpPrior)).FpNext = pSelect
pSelect = (*Select)(unsafe.Pointer(pSelect)).FpPrior
}
- for (pSelect != 0) && (moreToDo != 0) {
+ for pSelect != 0 && moreToDo != 0 {
var pItem uintptr
moreToDo = 0
pEList = (*Select)(unsafe.Pointer(pSelect)).FpEList
@@ -79994,21 +81001,21 @@ func resolveCompoundOrderBy(tls *libc.TLS, pParse uintptr, pSelect uintptr) int3
*(*int32)(unsafe.Pointer(bp + 8 /* iCol */)) = -1
var pE uintptr
var pDup uintptr
- if (uint32(int32(*(*uint8)(unsafe.Pointer(pItem + 12 /* &.done */)) & 0x4 >> 2))) != 0 {
+ if uint32(int32(*(*uint8)(unsafe.Pointer(pItem + 12))&0x4>>2)) != 0 {
goto __2
}
pE = Xsqlite3ExprSkipCollateAndLikely(tls, (*ExprList_item)(unsafe.Pointer(pItem)).FpExpr)
if pE == uintptr(0) {
goto __2
}
- if Xsqlite3ExprIsInteger(tls, pE, bp+8 /* &iCol */) != 0 {
- if (*(*int32)(unsafe.Pointer(bp + 8 /* iCol */)) <= 0) || (*(*int32)(unsafe.Pointer(bp + 8 /* iCol */)) > (*ExprList)(unsafe.Pointer(pEList)).FnExpr) {
- resolveOutOfRangeError(tls, pParse, ts+6251 /* "ORDER" */, (i + 1), (*ExprList)(unsafe.Pointer(pEList)).FnExpr)
+ if Xsqlite3ExprIsInteger(tls, pE, bp+8) != 0 {
+ if *(*int32)(unsafe.Pointer(bp + 8)) <= 0 || *(*int32)(unsafe.Pointer(bp + 8)) > (*ExprList)(unsafe.Pointer(pEList)).FnExpr {
+ resolveOutOfRangeError(tls, pParse, ts+7098 /* "ORDER" */, i+1, (*ExprList)(unsafe.Pointer(pEList)).FnExpr)
return 1
}
} else {
*(*int32)(unsafe.Pointer(bp + 8 /* iCol */)) = resolveAsName(tls, pParse, pEList, pE)
- if *(*int32)(unsafe.Pointer(bp + 8 /* iCol */)) == 0 {
+ if *(*int32)(unsafe.Pointer(bp + 8)) == 0 {
// Now test if expression pE matches one of the values returned
// by pSelect. In the usual case this is done by duplicating the
// expression, resolving any symbols in it, and then comparing
@@ -80024,14 +81031,14 @@ func resolveCompoundOrderBy(tls *libc.TLS, pParse uintptr, pSelect uintptr) int3
if !(int32((*Sqlite3)(unsafe.Pointer(db)).FmallocFailed) != 0) {
*(*int32)(unsafe.Pointer(bp + 8 /* iCol */)) = resolveOrderByTermToExprList(tls, pParse, pSelect, pDup)
- if (int32((*Parse)(unsafe.Pointer(pParse)).FeParseMode) >= PARSE_MODE_RENAME) && (*(*int32)(unsafe.Pointer(bp + 8 /* iCol */)) > 0) {
+ if int32((*Parse)(unsafe.Pointer(pParse)).FeParseMode) >= PARSE_MODE_RENAME && *(*int32)(unsafe.Pointer(bp + 8)) > 0 {
resolveOrderByTermToExprList(tls, pParse, pSelect, pE)
}
}
Xsqlite3ExprDelete(tls, db, pDup)
}
}
- if *(*int32)(unsafe.Pointer(bp + 8 /* iCol */)) > 0 {
+ if *(*int32)(unsafe.Pointer(bp + 8)) > 0 {
// Convert the ORDER BY term into an integer column number iCol,
// taking care to preserve the COLLATE clause if it exists.
if !(int32((*Parse)(unsafe.Pointer(pParse)).FeParseMode) >= PARSE_MODE_RENAME) {
@@ -80039,8 +81046,8 @@ func resolveCompoundOrderBy(tls *libc.TLS, pParse uintptr, pSelect uintptr) int3
if pNew == uintptr(0) {
return 1
}
- *(*U32)(unsafe.Pointer(pNew + 4 /* &.flags */)) |= (U32(EP_IntValue))
- *(*int32)(unsafe.Pointer(pNew + 8 /* &.u */)) = *(*int32)(unsafe.Pointer(bp + 8 /* iCol */))
+ *(*U32)(unsafe.Pointer(pNew + 4)) |= U32(EP_IntValue)
+ *(*int32)(unsafe.Pointer(pNew + 8)) = *(*int32)(unsafe.Pointer(bp + 8 /* iCol */))
if (*ExprList_item)(unsafe.Pointer(pItem)).FpExpr == pE {
(*ExprList_item)(unsafe.Pointer(pItem)).FpExpr = pNew
} else {
@@ -80053,9 +81060,9 @@ func resolveCompoundOrderBy(tls *libc.TLS, pParse uintptr, pSelect uintptr) int3
(*Expr)(unsafe.Pointer(pParent)).FpLeft = pNew
}
Xsqlite3ExprDelete(tls, db, pE)
- *(*U16)(unsafe.Pointer(pItem + 16 /* &.u */ /* &.x */ /* &.iOrderByCol */)) = U16(*(*int32)(unsafe.Pointer(bp + 8 /* iCol */)))
+ *(*U16)(unsafe.Pointer(pItem + 16)) = U16(*(*int32)(unsafe.Pointer(bp + 8 /* iCol */)))
}
- libc.SetBitFieldPtr8Uint32(pItem+12 /* &.done */, uint32(1), 2, 0x4)
+ libc.SetBitFieldPtr8Uint32(pItem+12, uint32(1), 2, 0x4)
} else {
moreToDo = 1
}
@@ -80072,9 +81079,9 @@ func resolveCompoundOrderBy(tls *libc.TLS, pParse uintptr, pSelect uintptr) int3
pSelect = (*Select)(unsafe.Pointer(pSelect)).FpNext
}
for i = 0; i < (*ExprList)(unsafe.Pointer(pOrderBy)).FnExpr; i++ {
- if (int32(*(*uint8)(unsafe.Pointer(((pOrderBy + 8 /* &.a */) + uintptr(i)*20) + 12 /* &.done */)) & 0x4 >> 2)) == 0 {
+ if int32(*(*uint8)(unsafe.Pointer(pOrderBy + 8 + uintptr(i)*20 + 12))&0x4>>2) == 0 {
Xsqlite3ErrorMsg(tls, pParse,
- ts+6257 /* "%r ORDER BY term..." */, libc.VaList(bp, (i+1)))
+ ts+7104 /* "%r ORDER BY term..." */, libc.VaList(bp, i+1))
return 1
}
}
@@ -80089,7 +81096,7 @@ func resolveCompoundOrderBy(tls *libc.TLS, pParse uintptr, pSelect uintptr) int3
//
// If any errors are detected, add an error message to pParse and
// return non-zero. Return zero if no errors are seen.
-func Xsqlite3ResolveOrderGroupBy(tls *libc.TLS, pParse uintptr, pSelect uintptr, pOrderBy uintptr, zType uintptr) int32 { /* sqlite3.c:100636:20: */
+func Xsqlite3ResolveOrderGroupBy(tls *libc.TLS, pParse uintptr, pSelect uintptr, pOrderBy uintptr, zType uintptr) int32 { /* sqlite3.c:101035:20: */
bp := tls.Alloc(8)
defer tls.Free(8)
@@ -80098,11 +81105,11 @@ func Xsqlite3ResolveOrderGroupBy(tls *libc.TLS, pParse uintptr, pSelect uintptr,
var pEList uintptr
var pItem uintptr
- if ((pOrderBy == uintptr(0)) || ((*Sqlite3)(unsafe.Pointer((*Parse)(unsafe.Pointer(pParse)).Fdb)).FmallocFailed != 0)) || (int32((*Parse)(unsafe.Pointer(pParse)).FeParseMode) >= PARSE_MODE_RENAME) {
+ if pOrderBy == uintptr(0) || (*Sqlite3)(unsafe.Pointer((*Parse)(unsafe.Pointer(pParse)).Fdb)).FmallocFailed != 0 || int32((*Parse)(unsafe.Pointer(pParse)).FeParseMode) >= PARSE_MODE_RENAME {
return 0
}
- if (*ExprList)(unsafe.Pointer(pOrderBy)).FnExpr > *(*int32)(unsafe.Pointer((db + 112 /* &.aLimit */) + 2*4)) {
- Xsqlite3ErrorMsg(tls, pParse, ts+6318 /* "too many terms i..." */, libc.VaList(bp, zType))
+ if (*ExprList)(unsafe.Pointer(pOrderBy)).FnExpr > *(*int32)(unsafe.Pointer(db + 120 + 2*4)) {
+ Xsqlite3ErrorMsg(tls, pParse, ts+7165 /* "too many terms i..." */, libc.VaList(bp, zType))
return 1
}
pEList = (*Select)(unsafe.Pointer(pSelect)).FpEList
@@ -80114,12 +81121,12 @@ __1:
goto __3
}
{
- if *(*U16)(unsafe.Pointer(pItem + 16 /* &.u */ /* &.x */ /* &.iOrderByCol */)) != 0 {
- if int32(*(*U16)(unsafe.Pointer((pItem + 16 /* &.u */ /* &.x */) /* &.iOrderByCol */))) > (*ExprList)(unsafe.Pointer(pEList)).FnExpr {
- resolveOutOfRangeError(tls, pParse, zType, (i + 1), (*ExprList)(unsafe.Pointer(pEList)).FnExpr)
+ if *(*U16)(unsafe.Pointer(pItem + 16)) != 0 {
+ if int32(*(*U16)(unsafe.Pointer(pItem + 16))) > (*ExprList)(unsafe.Pointer(pEList)).FnExpr {
+ resolveOutOfRangeError(tls, pParse, zType, i+1, (*ExprList)(unsafe.Pointer(pEList)).FnExpr)
return 1
}
- resolveAlias(tls, pParse, pEList, (int32(*(*U16)(unsafe.Pointer((pItem + 16 /* &.u */ /* &.x */) /* &.iOrderByCol */))) - 1), (*ExprList_item)(unsafe.Pointer(pItem)).FpExpr, 0)
+ resolveAlias(tls, pParse, pEList, int32(*(*U16)(unsafe.Pointer(pItem + 16)))-1, (*ExprList_item)(unsafe.Pointer(pItem)).FpExpr, 0)
}
}
@@ -80135,10 +81142,10 @@ __3:
}
// Walker callback for windowRemoveExprFromSelect().
-func resolveRemoveWindowsCb(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 { /* sqlite3.c:100670:12: */
+func resolveRemoveWindowsCb(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 { /* sqlite3.c:101069:12: */
_ = pWalker
- if ((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_WinFunc))) != U32(0) {
- var pWin uintptr = *(*uintptr)(unsafe.Pointer(pExpr + 44 /* &.y */))
+ if (*Expr)(unsafe.Pointer(pExpr)).Fflags&U32(EP_WinFunc) != U32(0) {
+ var pWin uintptr = *(*uintptr)(unsafe.Pointer(pExpr + 44))
Xsqlite3WindowUnlinkFromSelect(tls, pWin)
}
return WRC_Continue
@@ -80146,7 +81153,7 @@ func resolveRemoveWindowsCb(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32
// Remove any Window objects owned by the expression pExpr from the
// Select.pWin list of Select object pSelect.
-func windowRemoveExprFromSelect(tls *libc.TLS, pSelect uintptr, pExpr uintptr) { /* sqlite3.c:100683:13: */
+func windowRemoveExprFromSelect(tls *libc.TLS, pSelect uintptr, pExpr uintptr) { /* sqlite3.c:101082:13: */
bp := tls.Alloc(28)
defer tls.Free(28)
@@ -80157,7 +81164,7 @@ func windowRemoveExprFromSelect(tls *libc.TLS, pSelect uintptr, pExpr uintptr) {
(*Walker)(unsafe.Pointer(bp /* &sWalker */)).FxExprCallback = *(*uintptr)(unsafe.Pointer(&struct {
f func(*libc.TLS, uintptr, uintptr) int32
}{resolveRemoveWindowsCb}))
- *(*uintptr)(unsafe.Pointer(bp /* &sWalker */ + 24 /* &.u */)) = pSelect
+ *(*uintptr)(unsafe.Pointer(bp + 24)) = pSelect
Xsqlite3WalkExpr(tls, bp /* &sWalker */, pExpr)
}
}
@@ -80178,7 +81185,7 @@ func windowRemoveExprFromSelect(tls *libc.TLS, pSelect uintptr, pExpr uintptr) {
// This routine returns the number of errors. If errors occur, then
// an appropriate error message might be left in pParse. (OOM errors
// excepted.)
-func resolveOrderGroupBy(tls *libc.TLS, pNC uintptr, pSelect uintptr, pOrderBy uintptr, zType uintptr) int32 { /* sqlite3.c:100714:12: */
+func resolveOrderGroupBy(tls *libc.TLS, pNC uintptr, pSelect uintptr, pOrderBy uintptr, zType uintptr) int32 { /* sqlite3.c:101113:12: */
bp := tls.Alloc(4)
defer tls.Free(4)
@@ -80206,39 +81213,39 @@ __1:
}
if int32(*(*uint8)(unsafe.Pointer(zType))) != 'G' {
*(*int32)(unsafe.Pointer(bp /* iCol */)) = resolveAsName(tls, pParse, (*Select)(unsafe.Pointer(pSelect)).FpEList, pE2)
- if *(*int32)(unsafe.Pointer(bp /* iCol */)) > 0 {
+ if *(*int32)(unsafe.Pointer(bp)) > 0 {
// If an AS-name match is found, mark this ORDER BY column as being
// a copy of the iCol-th result-set column. The subsequent call to
// sqlite3ResolveOrderGroupBy() will convert the expression to a
// copy of the iCol-th result-set expression.
- *(*U16)(unsafe.Pointer(pItem + 16 /* &.u */ /* &.x */ /* &.iOrderByCol */)) = U16(*(*int32)(unsafe.Pointer(bp /* iCol */)))
+ *(*U16)(unsafe.Pointer(pItem + 16)) = U16(*(*int32)(unsafe.Pointer(bp /* iCol */)))
goto __2
}
}
- if Xsqlite3ExprIsInteger(tls, pE2, bp /* &iCol */) != 0 {
+ if Xsqlite3ExprIsInteger(tls, pE2, bp) != 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
- if (*(*int32)(unsafe.Pointer(bp /* iCol */)) < 1) || (*(*int32)(unsafe.Pointer(bp /* iCol */)) > 0xffff) {
- resolveOutOfRangeError(tls, pParse, zType, (i + 1), nResult)
+ if *(*int32)(unsafe.Pointer(bp)) < 1 || *(*int32)(unsafe.Pointer(bp)) > 0xffff {
+ resolveOutOfRangeError(tls, pParse, zType, i+1, nResult)
return 1
}
- *(*U16)(unsafe.Pointer(pItem + 16 /* &.u */ /* &.x */ /* &.iOrderByCol */)) = U16(*(*int32)(unsafe.Pointer(bp /* iCol */)))
+ *(*U16)(unsafe.Pointer(pItem + 16)) = U16(*(*int32)(unsafe.Pointer(bp /* iCol */)))
goto __2
}
// Otherwise, treat the ORDER BY term as an ordinary expression
- *(*U16)(unsafe.Pointer(pItem + 16 /* &.u */ /* &.x */ /* &.iOrderByCol */)) = U16(0)
+ *(*U16)(unsafe.Pointer(pItem + 16)) = U16(0)
if Xsqlite3ResolveExprNames(tls, pNC, pE) != 0 {
return 1
}
for j = 0; j < (*ExprList)(unsafe.Pointer((*Select)(unsafe.Pointer(pSelect)).FpEList)).FnExpr; j++ {
- if Xsqlite3ExprCompare(tls, uintptr(0), pE, (*ExprList_item)(unsafe.Pointer(((*Select)(unsafe.Pointer(pSelect)).FpEList+8 /* &.a */)+uintptr(j)*20)).FpExpr, -1) == 0 {
+ if Xsqlite3ExprCompare(tls, uintptr(0), pE, (*ExprList_item)(unsafe.Pointer((*Select)(unsafe.Pointer(pSelect)).FpEList+8+uintptr(j)*20)).FpExpr, -1) == 0 {
// Since this expresion is being changed into a reference
// to an identical expression in the result set, remove all Window
// objects belonging to the expression from the Select.pWin list.
windowRemoveExprFromSelect(tls, pSelect, pE)
- *(*U16)(unsafe.Pointer(pItem + 16 /* &.u */ /* &.x */ /* &.iOrderByCol */)) = (U16(j + 1))
+ *(*U16)(unsafe.Pointer(pItem + 16)) = U16(j + 1)
}
}
@@ -80255,7 +81262,7 @@ __3:
}
// Resolve names in the SELECT statement p and all of its descendants.
-func resolveSelectStep(tls *libc.TLS, pWalker uintptr, p uintptr) int32 { /* sqlite3.c:100777:12: */
+func resolveSelectStep(tls *libc.TLS, pWalker uintptr, p uintptr) int32 { /* sqlite3.c:101176:12: */
bp := tls.Alloc(32)
defer tls.Free(32)
@@ -80270,10 +81277,10 @@ func resolveSelectStep(tls *libc.TLS, pWalker uintptr, p uintptr) int32 { /* sql
var pLeftmost uintptr // Left-most of SELECT of a compound
var db uintptr // Database connection
- if ((*Select)(unsafe.Pointer(p)).FselFlags & U32(SF_Resolved)) != 0 {
+ if (*Select)(unsafe.Pointer(p)).FselFlags&U32(SF_Resolved) != 0 {
return WRC_Prune
}
- pOuterNC = *(*uintptr)(unsafe.Pointer(pWalker + 24 /* &.u */))
+ pOuterNC = *(*uintptr)(unsafe.Pointer(pWalker + 24))
pParse = (*Walker)(unsafe.Pointer(pWalker)).FpParse
db = (*Parse)(unsafe.Pointer(pParse)).Fdb
@@ -80284,28 +81291,28 @@ func resolveSelectStep(tls *libc.TLS, pWalker uintptr, p uintptr) int32 { /* sql
// sqlite3SelectPrep() do all of the processing for this SELECT.
// sqlite3SelectPrep() will invoke both sqlite3SelectExpand() and
// this routine in the correct order.
- if ((*Select)(unsafe.Pointer(p)).FselFlags & U32(SF_Expanded)) == U32(0) {
+ if (*Select)(unsafe.Pointer(p)).FselFlags&U32(SF_Expanded) == U32(0) {
Xsqlite3SelectPrep(tls, pParse, p, pOuterNC)
- if ((*Parse)(unsafe.Pointer(pParse)).FnErr != 0) || ((*Sqlite3)(unsafe.Pointer(db)).FmallocFailed != 0) {
+ if (*Parse)(unsafe.Pointer(pParse)).FnErr != 0 || (*Sqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 {
return WRC_Abort
}
return WRC_Prune
}
- isCompound = (libc.Bool32((*Select)(unsafe.Pointer(p)).FpPrior != uintptr(0)))
+ isCompound = libc.Bool32((*Select)(unsafe.Pointer(p)).FpPrior != uintptr(0))
nCompound = 0
pLeftmost = p
for p != 0 {
// SF_Resolved not set if errors suppressed
- *(*U32)(unsafe.Pointer(p + 4 /* &.selFlags */)) |= (U32(SF_Resolved))
+ *(*U32)(unsafe.Pointer(p + 4)) |= U32(SF_Resolved)
// Resolve the expressions in the LIMIT and OFFSET clauses. These
// are not allowed to refer to any names, so pass an empty NameContext.
libc.Xmemset(tls, bp /* &sNC */, 0, uint32(unsafe.Sizeof(NameContext{})))
(*NameContext)(unsafe.Pointer(bp /* &sNC */)).FpParse = pParse
(*NameContext)(unsafe.Pointer(bp /* &sNC */)).FpWinSelect = p
- if Xsqlite3ResolveExprNames(tls, bp /* &sNC */, (*Select)(unsafe.Pointer(p)).FpLimit) != 0 {
+ if Xsqlite3ResolveExprNames(tls, bp, (*Select)(unsafe.Pointer(p)).FpLimit) != 0 {
return WRC_Abort
}
@@ -80315,17 +81322,17 @@ func resolveSelectStep(tls *libc.TLS, pWalker uintptr, p uintptr) int32 { /* sql
// as if it were part of the sub-query, not the parent. This block
// moves the pOrderBy down to the sub-query. It will be moved back
// after the names have been resolved.
- if ((*Select)(unsafe.Pointer(p)).FselFlags & U32(SF_Converted)) != 0 {
- var pSub uintptr = (*SrcItem)(unsafe.Pointer(((*Select)(unsafe.Pointer(p)).FpSrc + 8 /* &.a */))).FpSelect
+ if (*Select)(unsafe.Pointer(p)).FselFlags&U32(SF_Converted) != 0 {
+ var pSub uintptr = (*SrcItem)(unsafe.Pointer((*Select)(unsafe.Pointer(p)).FpSrc + 8)).FpSelect
(*Select)(unsafe.Pointer(pSub)).FpOrderBy = (*Select)(unsafe.Pointer(p)).FpOrderBy
(*Select)(unsafe.Pointer(p)).FpOrderBy = uintptr(0)
}
- // Recursively resolve names in all subqueries
+ // Recursively resolve names in all subqueries in the FROM clause
for i = 0; i < (*SrcList)(unsafe.Pointer((*Select)(unsafe.Pointer(p)).FpSrc)).FnSrc; i++ {
- var pItem uintptr = (((*Select)(unsafe.Pointer(p)).FpSrc + 8 /* &.a */) + uintptr(i)*72)
- if ((*SrcItem)(unsafe.Pointer(pItem)).FpSelect != 0) && (((*Select)(unsafe.Pointer((*SrcItem)(unsafe.Pointer(pItem)).FpSelect)).FselFlags & U32(SF_Resolved)) == U32(0)) {
+ var pItem uintptr = (*Select)(unsafe.Pointer(p)).FpSrc + 8 + uintptr(i)*72
+ if (*SrcItem)(unsafe.Pointer(pItem)).FpSelect != 0 && (*Select)(unsafe.Pointer((*SrcItem)(unsafe.Pointer(pItem)).FpSelect)).FselFlags&U32(SF_Resolved) == U32(0) {
var nRef int32
if pOuterNC != 0 {
nRef = (*NameContext)(unsafe.Pointer(pOuterNC)).FnRef
@@ -80339,7 +81346,7 @@ func resolveSelectStep(tls *libc.TLS, pWalker uintptr, p uintptr) int32 { /* sql
}
Xsqlite3ResolveSelectNames(tls, pParse, (*SrcItem)(unsafe.Pointer(pItem)).FpSelect, pOuterNC)
(*Parse)(unsafe.Pointer(pParse)).FzAuthContext = zSavedContext
- if ((*Parse)(unsafe.Pointer(pParse)).FnErr != 0) || ((*Sqlite3)(unsafe.Pointer(db)).FmallocFailed != 0) {
+ if (*Parse)(unsafe.Pointer(pParse)).FnErr != 0 || (*Sqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 {
return WRC_Abort
}
@@ -80351,32 +81358,32 @@ func resolveSelectStep(tls *libc.TLS, pWalker uintptr, p uintptr) int32 { /* sql
// context containing the column when it resolves a name.
if pOuterNC != 0 {
- libc.SetBitFieldPtr16Uint32(pItem+36 /* &.fg */ +4 /* &.isCorrelated */, (uint32(libc.Bool32((*NameContext)(unsafe.Pointer(pOuterNC)).FnRef > nRef))), 3, 0x8)
+ libc.SetBitFieldPtr16Uint32(pItem+36+4, uint32(libc.Bool32((*NameContext)(unsafe.Pointer(pOuterNC)).FnRef > nRef)), 3, 0x8)
}
}
}
// Set up the local name-context to pass to sqlite3ResolveExprNames() to
// resolve the result-set expression list.
- (*NameContext)(unsafe.Pointer(bp /* &sNC */)).FncFlags = (NC_AllowAgg | NC_AllowWin)
+ (*NameContext)(unsafe.Pointer(bp /* &sNC */)).FncFlags = NC_AllowAgg | NC_AllowWin
(*NameContext)(unsafe.Pointer(bp /* &sNC */)).FpSrcList = (*Select)(unsafe.Pointer(p)).FpSrc
(*NameContext)(unsafe.Pointer(bp /* &sNC */)).FpNext = pOuterNC
// Resolve names in the result set.
- if Xsqlite3ResolveExprListNames(tls, bp /* &sNC */, (*Select)(unsafe.Pointer(p)).FpEList) != 0 {
+ if Xsqlite3ResolveExprListNames(tls, bp, (*Select)(unsafe.Pointer(p)).FpEList) != 0 {
return WRC_Abort
}
- *(*int32)(unsafe.Pointer(bp /* &sNC */ + 24 /* &.ncFlags */)) &= (libc.CplInt32(NC_AllowWin))
+ *(*int32)(unsafe.Pointer(bp + 24)) &= libc.CplInt32(NC_AllowWin)
// If there are no aggregate functions in the result-set, and no GROUP BY
// expression, do not allow aggregates in any of the other expressions.
pGroupBy = (*Select)(unsafe.Pointer(p)).FpGroupBy
- if (pGroupBy != 0) || (((*NameContext)(unsafe.Pointer(bp /* &sNC */)).FncFlags & NC_HasAgg) != 0) {
+ if pGroupBy != 0 || (*NameContext)(unsafe.Pointer(bp)).FncFlags&NC_HasAgg != 0 {
- *(*U32)(unsafe.Pointer(p + 4 /* &.selFlags */)) |= (U32(SF_Aggregate | ((*NameContext)(unsafe.Pointer(bp /* &sNC */)).FncFlags & NC_MinMaxAgg)))
+ *(*U32)(unsafe.Pointer(p + 4)) |= U32(SF_Aggregate | (*NameContext)(unsafe.Pointer(bp)).FncFlags&(NC_MinMaxAgg|NC_OrderAgg))
} else {
- *(*int32)(unsafe.Pointer(bp /* &sNC */ + 24 /* &.ncFlags */)) &= (libc.CplInt32(NC_AllowAgg))
+ *(*int32)(unsafe.Pointer(bp + 24)) &= libc.CplInt32(NC_AllowAgg)
}
// Add the output column list to the name-context before parsing the
@@ -80387,26 +81394,26 @@ func resolveSelectStep(tls *libc.TLS, pWalker uintptr, p uintptr) int32 { /* sql
// Minor point: If this is the case, then the expression will be
// re-evaluated for each reference to it.
- *(*uintptr)(unsafe.Pointer(bp /* &sNC */ + 8 /* &.uNC */)) = (*Select)(unsafe.Pointer(p)).FpEList
- *(*int32)(unsafe.Pointer(bp /* &sNC */ + 24 /* &.ncFlags */)) |= (NC_UEList)
+ *(*uintptr)(unsafe.Pointer(bp + 8)) = (*Select)(unsafe.Pointer(p)).FpEList
+ *(*int32)(unsafe.Pointer(bp + 24)) |= NC_UEList
if (*Select)(unsafe.Pointer(p)).FpHaving != 0 {
if !(pGroupBy != 0) {
- Xsqlite3ErrorMsg(tls, pParse, ts+6349 /* "a GROUP BY claus..." */, 0)
+ Xsqlite3ErrorMsg(tls, pParse, ts+7196 /* "a GROUP BY claus..." */, 0)
return WRC_Abort
}
- if Xsqlite3ResolveExprNames(tls, bp /* &sNC */, (*Select)(unsafe.Pointer(p)).FpHaving) != 0 {
+ if Xsqlite3ResolveExprNames(tls, bp, (*Select)(unsafe.Pointer(p)).FpHaving) != 0 {
return WRC_Abort
}
}
- if Xsqlite3ResolveExprNames(tls, bp /* &sNC */, (*Select)(unsafe.Pointer(p)).FpWhere) != 0 {
+ if Xsqlite3ResolveExprNames(tls, bp, (*Select)(unsafe.Pointer(p)).FpWhere) != 0 {
return WRC_Abort
}
// Resolve names in table-valued-function arguments
for i = 0; i < (*SrcList)(unsafe.Pointer((*Select)(unsafe.Pointer(p)).FpSrc)).FnSrc; i++ {
- var pItem uintptr = (((*Select)(unsafe.Pointer(p)).FpSrc + 8 /* &.a */) + uintptr(i)*72)
- if ((uint32(int32(*(*uint16)(unsafe.Pointer((pItem + 36 /* &.fg */) + 4 /* &.isTabFunc */)) & 0x4 >> 2))) != 0) &&
- (Xsqlite3ResolveExprListNames(tls, bp /* &sNC */, *(*uintptr)(unsafe.Pointer(pItem + 64 /* &.u1 */))) != 0) {
+ var pItem uintptr = (*Select)(unsafe.Pointer(p)).FpSrc + 8 + uintptr(i)*72
+ if uint32(int32(*(*uint16)(unsafe.Pointer(pItem + 36 + 4))&0x4>>2)) != 0 &&
+ Xsqlite3ResolveExprListNames(tls, bp, *(*uintptr)(unsafe.Pointer(pItem + 64))) != 0 {
return WRC_Abort
}
}
@@ -80414,8 +81421,8 @@ func resolveSelectStep(tls *libc.TLS, pWalker uintptr, p uintptr) int32 { /* sql
if int32((*Parse)(unsafe.Pointer(pParse)).FeParseMode) >= PARSE_MODE_RENAME {
var pWin uintptr
for pWin = (*Select)(unsafe.Pointer(p)).FpWinDefn; pWin != 0; pWin = (*Window)(unsafe.Pointer(pWin)).FpNextWin {
- if (Xsqlite3ResolveExprListNames(tls, bp /* &sNC */, (*Window)(unsafe.Pointer(pWin)).FpOrderBy) != 0) ||
- (Xsqlite3ResolveExprListNames(tls, bp /* &sNC */, (*Window)(unsafe.Pointer(pWin)).FpPartition) != 0) {
+ if Xsqlite3ResolveExprListNames(tls, bp, (*Window)(unsafe.Pointer(pWin)).FpOrderBy) != 0 ||
+ Xsqlite3ResolveExprListNames(tls, bp, (*Window)(unsafe.Pointer(pWin)).FpPartition) != 0 {
return WRC_Abort
}
}
@@ -80424,15 +81431,15 @@ func resolveSelectStep(tls *libc.TLS, pWalker uintptr, p uintptr) int32 { /* sql
// The ORDER BY and GROUP BY clauses may not refer to terms in
// outer queries
(*NameContext)(unsafe.Pointer(bp /* &sNC */)).FpNext = uintptr(0)
- *(*int32)(unsafe.Pointer(bp /* &sNC */ + 24 /* &.ncFlags */)) |= (NC_AllowAgg | NC_AllowWin)
+ *(*int32)(unsafe.Pointer(bp + 24)) |= NC_AllowAgg | NC_AllowWin
// If this is a converted compound query, move the ORDER BY clause from
// the sub-query back to the parent query. At this point each term
// within the ORDER BY clause has been transformed to an integer value.
// These integers will be replaced by copies of the corresponding result
// set expressions by the call to resolveOrderGroupBy() below.
- if ((*Select)(unsafe.Pointer(p)).FselFlags & U32(SF_Converted)) != 0 {
- var pSub uintptr = (*SrcItem)(unsafe.Pointer(((*Select)(unsafe.Pointer(p)).FpSrc + 8 /* &.a */))).FpSelect
+ if (*Select)(unsafe.Pointer(p)).FselFlags&U32(SF_Converted) != 0 {
+ var pSub uintptr = (*SrcItem)(unsafe.Pointer((*Select)(unsafe.Pointer(p)).FpSrc + 8)).FpSelect
(*Select)(unsafe.Pointer(p)).FpOrderBy = (*Select)(unsafe.Pointer(pSub)).FpOrderBy
(*Select)(unsafe.Pointer(pSub)).FpOrderBy = uintptr(0)
}
@@ -80446,22 +81453,22 @@ func resolveSelectStep(tls *libc.TLS, pWalker uintptr, p uintptr) int32 { /* sql
// than the right-most term, then that is a syntax error. But the error
// 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 (((*Select)(unsafe.Pointer(p)).FpOrderBy != uintptr(0)) &&
- (isCompound <= nCompound)) && // Defer right-most ORDER BY of a compound
- (resolveOrderGroupBy(tls, bp /* &sNC */, p, (*Select)(unsafe.Pointer(p)).FpOrderBy, ts+6251 /* "ORDER" */) != 0) {
+ if (*Select)(unsafe.Pointer(p)).FpOrderBy != uintptr(0) &&
+ isCompound <= nCompound &&
+ resolveOrderGroupBy(tls, bp, p, (*Select)(unsafe.Pointer(p)).FpOrderBy, ts+7098) != 0 {
return WRC_Abort
}
if (*Sqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 {
return WRC_Abort
}
- *(*int32)(unsafe.Pointer(bp /* &sNC */ + 24 /* &.ncFlags */)) &= (libc.CplInt32(NC_AllowWin))
+ *(*int32)(unsafe.Pointer(bp + 24)) &= libc.CplInt32(NC_AllowWin)
// Resolve the GROUP BY clause. At the same time, make sure
// the GROUP BY clause does not contain aggregate functions.
if pGroupBy != 0 {
var pItem uintptr
- if (resolveOrderGroupBy(tls, bp /* &sNC */, p, pGroupBy, ts+6393 /* "GROUP" */) != 0) || ((*Sqlite3)(unsafe.Pointer(db)).FmallocFailed != 0) {
+ if resolveOrderGroupBy(tls, bp, p, pGroupBy, ts+7240) != 0 || (*Sqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 {
return WRC_Abort
}
i = 0
@@ -80471,9 +81478,9 @@ func resolveSelectStep(tls *libc.TLS, pWalker uintptr, p uintptr) int32 { /* sql
goto __3
}
{
- if ((*Expr)(unsafe.Pointer(((*ExprList_item)(unsafe.Pointer(pItem)).FpExpr))).Fflags & (U32(EP_Agg))) != U32(0) {
+ if (*Expr)(unsafe.Pointer((*ExprList_item)(unsafe.Pointer(pItem)).FpExpr)).Fflags&U32(EP_Agg) != U32(0) {
Xsqlite3ErrorMsg(tls, pParse,
- ts+6399 /* "aggregate functi..." */, 0)
+ ts+7246 /* "aggregate functi..." */, 0)
return WRC_Abort
}
@@ -80489,7 +81496,7 @@ func resolveSelectStep(tls *libc.TLS, pWalker uintptr, p uintptr) int32 { /* sql
// If this is part of a compound SELECT, check that it has the right
// number of expressions in the select list.
- if ((*Select)(unsafe.Pointer(p)).FpNext != 0) && ((*ExprList)(unsafe.Pointer((*Select)(unsafe.Pointer(p)).FpEList)).FnExpr != (*ExprList)(unsafe.Pointer((*Select)(unsafe.Pointer((*Select)(unsafe.Pointer(p)).FpNext)).FpEList)).FnExpr) {
+ if (*Select)(unsafe.Pointer(p)).FpNext != 0 && (*ExprList)(unsafe.Pointer((*Select)(unsafe.Pointer(p)).FpEList)).FnExpr != (*ExprList)(unsafe.Pointer((*Select)(unsafe.Pointer((*Select)(unsafe.Pointer(p)).FpNext)).FpEList)).FnExpr {
Xsqlite3SelectWrongNumTermsError(tls, pParse, (*Select)(unsafe.Pointer(p)).FpNext)
return WRC_Abort
}
@@ -80501,7 +81508,7 @@ func resolveSelectStep(tls *libc.TLS, pWalker uintptr, p uintptr) int32 { /* sql
// Resolve the ORDER BY on a compound SELECT after all terms of
// the compound have been resolved.
- if (isCompound != 0) && (resolveCompoundOrderBy(tls, pParse, pLeftmost) != 0) {
+ if isCompound != 0 && resolveCompoundOrderBy(tls, pParse, pLeftmost) != 0 {
return WRC_Abort
}
@@ -80554,7 +81561,7 @@ func resolveSelectStep(tls *libc.TLS, pWalker uintptr, p uintptr) int32 { /* sql
//
// An error message is left in pParse if anything is amiss. The number
// if errors is returned.
-func Xsqlite3ResolveExprNames(tls *libc.TLS, pNC uintptr, pExpr uintptr) int32 { /* sqlite3.c:101063:20: */
+func Xsqlite3ResolveExprNames(tls *libc.TLS, pNC uintptr, pExpr uintptr) int32 { /* sqlite3.c:101463:20: */
bp := tls.Alloc(28)
defer tls.Free(28)
@@ -80564,14 +81571,14 @@ func Xsqlite3ResolveExprNames(tls *libc.TLS, pNC uintptr, pExpr uintptr) int32 {
if pExpr == uintptr(0) {
return SQLITE_OK
}
- savedHasAgg = ((*NameContext)(unsafe.Pointer(pNC)).FncFlags & ((NC_HasAgg | NC_MinMaxAgg) | NC_HasWin))
- *(*int32)(unsafe.Pointer(pNC + 24 /* &.ncFlags */)) &= (libc.CplInt32(((NC_HasAgg | NC_MinMaxAgg) | NC_HasWin)))
+ savedHasAgg = (*NameContext)(unsafe.Pointer(pNC)).FncFlags & (NC_HasAgg | NC_MinMaxAgg | NC_HasWin | NC_OrderAgg)
+ *(*int32)(unsafe.Pointer(pNC + 24)) &= libc.CplInt32(NC_HasAgg | NC_MinMaxAgg | NC_HasWin | NC_OrderAgg)
(*Walker)(unsafe.Pointer(bp /* &w */)).FpParse = (*NameContext)(unsafe.Pointer(pNC)).FpParse
(*Walker)(unsafe.Pointer(bp /* &w */)).FxExprCallback = *(*uintptr)(unsafe.Pointer(&struct {
f func(*libc.TLS, uintptr, uintptr) int32
}{resolveExprStep}))
(*Walker)(unsafe.Pointer(bp /* &w */)).FxSelectCallback = func() uintptr {
- if ((*NameContext)(unsafe.Pointer(pNC)).FncFlags & NC_NoSelect) != 0 {
+ if (*NameContext)(unsafe.Pointer(pNC)).FncFlags&NC_NoSelect != 0 {
return uintptr(0)
}
return *(*uintptr)(unsafe.Pointer(&struct {
@@ -80579,23 +81586,23 @@ func Xsqlite3ResolveExprNames(tls *libc.TLS, pNC uintptr, pExpr uintptr) int32 {
}{resolveSelectStep}))
}()
(*Walker)(unsafe.Pointer(bp /* &w */)).FxSelectCallback2 = uintptr(0)
- *(*uintptr)(unsafe.Pointer(bp /* &w */ + 24 /* &.u */)) = pNC
- *(*int32)(unsafe.Pointer((*Walker)(unsafe.Pointer(bp /* &w */)).FpParse + 208 /* &.nHeight */)) += ((*Expr)(unsafe.Pointer(pExpr)).FnHeight)
- if Xsqlite3ExprCheckHeight(tls, (*Walker)(unsafe.Pointer(bp /* &w */)).FpParse, (*Parse)(unsafe.Pointer((*Walker)(unsafe.Pointer(bp /* &w */)).FpParse)).FnHeight) != 0 {
+ *(*uintptr)(unsafe.Pointer(bp + 24)) = pNC
+ *(*int32)(unsafe.Pointer((*Walker)(unsafe.Pointer(bp)).FpParse + 204)) += (*Expr)(unsafe.Pointer(pExpr)).FnHeight
+ if Xsqlite3ExprCheckHeight(tls, (*Walker)(unsafe.Pointer(bp)).FpParse, (*Parse)(unsafe.Pointer((*Walker)(unsafe.Pointer(bp)).FpParse)).FnHeight) != 0 {
return SQLITE_ERROR
}
Xsqlite3WalkExpr(tls, bp /* &w */, pExpr)
- *(*int32)(unsafe.Pointer((*Walker)(unsafe.Pointer(bp /* &w */)).FpParse + 208 /* &.nHeight */)) -= ((*Expr)(unsafe.Pointer(pExpr)).FnHeight)
+ *(*int32)(unsafe.Pointer((*Walker)(unsafe.Pointer(bp)).FpParse + 204)) -= (*Expr)(unsafe.Pointer(pExpr)).FnHeight
- *(*U32)(unsafe.Pointer(pExpr + 4 /* &.flags */)) |= (U32((*NameContext)(unsafe.Pointer(pNC)).FncFlags & (NC_HasAgg | NC_HasWin)))
- *(*int32)(unsafe.Pointer(pNC + 24 /* &.ncFlags */)) |= (savedHasAgg)
- return (libc.Bool32(((*NameContext)(unsafe.Pointer(pNC)).FnNcErr > 0) || ((*Parse)(unsafe.Pointer((*Walker)(unsafe.Pointer(bp /* &w */)).FpParse)).FnErr > 0)))
+ *(*U32)(unsafe.Pointer(pExpr + 4)) |= U32((*NameContext)(unsafe.Pointer(pNC)).FncFlags & (NC_HasAgg | NC_HasWin))
+ *(*int32)(unsafe.Pointer(pNC + 24)) |= savedHasAgg
+ return libc.Bool32((*NameContext)(unsafe.Pointer(pNC)).FnNcErr > 0 || (*Parse)(unsafe.Pointer((*Walker)(unsafe.Pointer(bp)).FpParse)).FnErr > 0)
}
// Resolve all names for all expression in an expression list. This is
// just like sqlite3ResolveExprNames() except that it works for an expression
// list rather than a single expression.
-func Xsqlite3ResolveExprListNames(tls *libc.TLS, pNC uintptr, pList uintptr) int32 { /* sqlite3.c:101102:20: */
+func Xsqlite3ResolveExprListNames(tls *libc.TLS, pNC uintptr, pList uintptr) int32 { /* sqlite3.c:101502:20: */
bp := tls.Alloc(28)
defer tls.Free(28)
@@ -80614,31 +81621,31 @@ func Xsqlite3ResolveExprListNames(tls *libc.TLS, pNC uintptr, pList uintptr) int
f func(*libc.TLS, uintptr, uintptr) int32
}{resolveSelectStep}))
(*Walker)(unsafe.Pointer(bp /* &w */)).FxSelectCallback2 = uintptr(0)
- *(*uintptr)(unsafe.Pointer(bp /* &w */ + 24 /* &.u */)) = pNC
- savedHasAgg = ((*NameContext)(unsafe.Pointer(pNC)).FncFlags & ((NC_HasAgg | NC_MinMaxAgg) | NC_HasWin))
- *(*int32)(unsafe.Pointer(pNC + 24 /* &.ncFlags */)) &= (libc.CplInt32(((NC_HasAgg | NC_MinMaxAgg) | NC_HasWin)))
+ *(*uintptr)(unsafe.Pointer(bp + 24)) = pNC
+ savedHasAgg = (*NameContext)(unsafe.Pointer(pNC)).FncFlags & (NC_HasAgg | NC_MinMaxAgg | NC_HasWin | NC_OrderAgg)
+ *(*int32)(unsafe.Pointer(pNC + 24)) &= libc.CplInt32(NC_HasAgg | NC_MinMaxAgg | NC_HasWin | NC_OrderAgg)
for i = 0; i < (*ExprList)(unsafe.Pointer(pList)).FnExpr; i++ {
- var pExpr uintptr = (*ExprList_item)(unsafe.Pointer((pList + 8 /* &.a */) + uintptr(i)*20)).FpExpr
+ var pExpr uintptr = (*ExprList_item)(unsafe.Pointer(pList + 8 + uintptr(i)*20)).FpExpr
if pExpr == uintptr(0) {
continue
}
- *(*int32)(unsafe.Pointer((*Walker)(unsafe.Pointer(bp /* &w */)).FpParse + 208 /* &.nHeight */)) += ((*Expr)(unsafe.Pointer(pExpr)).FnHeight)
- if Xsqlite3ExprCheckHeight(tls, (*Walker)(unsafe.Pointer(bp /* &w */)).FpParse, (*Parse)(unsafe.Pointer((*Walker)(unsafe.Pointer(bp /* &w */)).FpParse)).FnHeight) != 0 {
+ *(*int32)(unsafe.Pointer((*Walker)(unsafe.Pointer(bp)).FpParse + 204)) += (*Expr)(unsafe.Pointer(pExpr)).FnHeight
+ if Xsqlite3ExprCheckHeight(tls, (*Walker)(unsafe.Pointer(bp)).FpParse, (*Parse)(unsafe.Pointer((*Walker)(unsafe.Pointer(bp)).FpParse)).FnHeight) != 0 {
return WRC_Abort
}
Xsqlite3WalkExpr(tls, bp /* &w */, pExpr)
- *(*int32)(unsafe.Pointer((*Walker)(unsafe.Pointer(bp /* &w */)).FpParse + 208 /* &.nHeight */)) -= ((*Expr)(unsafe.Pointer(pExpr)).FnHeight)
+ *(*int32)(unsafe.Pointer((*Walker)(unsafe.Pointer(bp)).FpParse + 204)) -= (*Expr)(unsafe.Pointer(pExpr)).FnHeight
- if ((*NameContext)(unsafe.Pointer(pNC)).FncFlags & ((NC_HasAgg | NC_MinMaxAgg) | NC_HasWin)) != 0 {
- *(*U32)(unsafe.Pointer(pExpr + 4 /* &.flags */)) |= (U32((*NameContext)(unsafe.Pointer(pNC)).FncFlags & (NC_HasAgg | NC_HasWin)))
- savedHasAgg = savedHasAgg | ((*NameContext)(unsafe.Pointer(pNC)).FncFlags & ((NC_HasAgg | NC_MinMaxAgg) | NC_HasWin))
- *(*int32)(unsafe.Pointer(pNC + 24 /* &.ncFlags */)) &= (libc.CplInt32(((NC_HasAgg | NC_MinMaxAgg) | NC_HasWin)))
+ if (*NameContext)(unsafe.Pointer(pNC)).FncFlags&(NC_HasAgg|NC_MinMaxAgg|NC_HasWin|NC_OrderAgg) != 0 {
+ *(*U32)(unsafe.Pointer(pExpr + 4)) |= U32((*NameContext)(unsafe.Pointer(pNC)).FncFlags & (NC_HasAgg | NC_HasWin))
+ savedHasAgg = savedHasAgg | (*NameContext)(unsafe.Pointer(pNC)).FncFlags&(NC_HasAgg|NC_MinMaxAgg|NC_HasWin|NC_OrderAgg)
+ *(*int32)(unsafe.Pointer(pNC + 24)) &= libc.CplInt32(NC_HasAgg | NC_MinMaxAgg | NC_HasWin | NC_OrderAgg)
}
- if (*Parse)(unsafe.Pointer((*Walker)(unsafe.Pointer(bp /* &w */)).FpParse)).FnErr > 0 {
+ if (*Parse)(unsafe.Pointer((*Walker)(unsafe.Pointer(bp)).FpParse)).FnErr > 0 {
return WRC_Abort
}
}
- *(*int32)(unsafe.Pointer(pNC + 24 /* &.ncFlags */)) |= (savedHasAgg)
+ *(*int32)(unsafe.Pointer(pNC + 24)) |= savedHasAgg
return WRC_Continue
}
@@ -80652,7 +81659,7 @@ func Xsqlite3ResolveExprListNames(tls *libc.TLS, pNC uintptr, pList uintptr) int
//
// All SELECT statements should have been expanded using
// sqlite3SelectExpand() prior to invoking this routine.
-func Xsqlite3ResolveSelectNames(tls *libc.TLS, pParse uintptr, p uintptr, pOuterNC uintptr) { /* sqlite3.c:101157:21: */
+func Xsqlite3ResolveSelectNames(tls *libc.TLS, pParse uintptr, p uintptr, pOuterNC uintptr) { /* sqlite3.c:101558:21: */
bp := tls.Alloc(28)
defer tls.Free(28)
@@ -80666,7 +81673,7 @@ func Xsqlite3ResolveSelectNames(tls *libc.TLS, pParse uintptr, p uintptr, pOuter
}{resolveSelectStep}))
(*Walker)(unsafe.Pointer(bp /* &w */)).FxSelectCallback2 = uintptr(0)
(*Walker)(unsafe.Pointer(bp /* &w */)).FpParse = pParse
- *(*uintptr)(unsafe.Pointer(bp /* &w */ + 24 /* &.u */)) = pOuterNC
+ *(*uintptr)(unsafe.Pointer(bp + 24)) = pOuterNC
Xsqlite3WalkSelect(tls, bp /* &w */, p)
}
@@ -80686,7 +81693,7 @@ func Xsqlite3ResolveSelectNames(tls *libc.TLS, pParse uintptr, p uintptr, pOuter
// set to the column number. In case (4), TK_COLUMN nodes cause an error.
//
// Any errors cause an error message to be set in pParse.
-func Xsqlite3ResolveSelfReference(tls *libc.TLS, pParse uintptr, pTab uintptr, type1 int32, pExpr uintptr, pList uintptr) int32 { /* sqlite3.c:101191:20: */
+func Xsqlite3ResolveSelfReference(tls *libc.TLS, pParse uintptr, pTab uintptr, type1 int32, pExpr uintptr, pList uintptr) int32 { /* sqlite3.c:101592:20: */
bp := tls.Alloc(112)
defer tls.Free(112)
@@ -80700,19 +81707,19 @@ func Xsqlite3ResolveSelfReference(tls *libc.TLS, pParse uintptr, pTab uintptr, t
libc.Xmemset(tls, bp+32 /* &sSrc */, 0, uint32(unsafe.Sizeof(SrcList{})))
if pTab != 0 {
(*SrcList)(unsafe.Pointer(bp + 32 /* &sSrc */)).FnSrc = 1
- (*SrcItem)(unsafe.Pointer((bp + 32 /* &sSrc */ + 8 /* &.a */))).FzName = (*Table)(unsafe.Pointer(pTab)).FzName
- (*SrcItem)(unsafe.Pointer((bp + 32 /* &sSrc */ + 8 /* &.a */))).FpTab = pTab
- (*SrcItem)(unsafe.Pointer((bp + 32 /* &sSrc */ + 8 /* &.a */))).FiCursor = -1
+ (*SrcItem)(unsafe.Pointer(bp + 32 + 8)).FzName = (*Table)(unsafe.Pointer(pTab)).FzName
+ (*SrcItem)(unsafe.Pointer(bp + 32 + 8)).FpTab = pTab
+ (*SrcItem)(unsafe.Pointer(bp + 32 + 8)).FiCursor = -1
if (*Table)(unsafe.Pointer(pTab)).FpSchema != (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer((*Parse)(unsafe.Pointer(pParse)).Fdb)).FaDb+1*16)).FpSchema {
// Cause EP_FromDDL to be set on TK_FUNCTION nodes of non-TEMP
// schema elements
- type1 = type1 | (NC_FromDDL)
+ type1 = type1 | NC_FromDDL
}
}
(*NameContext)(unsafe.Pointer(bp /* &sNC */)).FpParse = pParse
(*NameContext)(unsafe.Pointer(bp /* &sNC */)).FpSrcList = bp + 32 /* &sSrc */
- (*NameContext)(unsafe.Pointer(bp /* &sNC */)).FncFlags = (type1 | NC_IsDDL)
- if (libc.AssignInt32(&rc, Xsqlite3ResolveExprNames(tls, bp /* &sNC */, pExpr))) != SQLITE_OK {
+ (*NameContext)(unsafe.Pointer(bp /* &sNC */)).FncFlags = type1 | NC_IsDDL
+ if libc.AssignInt32(&rc, Xsqlite3ResolveExprNames(tls, bp, pExpr)) != SQLITE_OK {
return rc
}
if pList != 0 {
@@ -80722,12 +81729,11 @@ func Xsqlite3ResolveSelfReference(tls *libc.TLS, pParse uintptr, pTab uintptr, t
}
// Return the affinity character for a single column of a table.
-func Xsqlite3TableColumnAffinity(tls *libc.TLS, pTab uintptr, iCol int32) uint8 { /* sqlite3.c:101251:21: */
-
- if iCol >= 0 {
- return (*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FaCol + uintptr(iCol)*20)).Faffinity
+func Xsqlite3TableColumnAffinity(tls *libc.TLS, pTab uintptr, iCol int32) uint8 { /* sqlite3.c:101652:21: */
+ if iCol < 0 || iCol >= int32((*Table)(unsafe.Pointer(pTab)).FnCol) {
+ return uint8(SQLITE_AFF_INTEGER)
}
- return uint8(SQLITE_AFF_INTEGER)
+ return (*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FaCol + uintptr(iCol)*16)).Faffinity
}
// Return the 'affinity' of the expression pExpr if any.
@@ -80744,9 +81750,9 @@ func Xsqlite3TableColumnAffinity(tls *libc.TLS, pTab uintptr, iCol int32) uint8
// SELECT * FROM t1 WHERE a;
// SELECT a AS b FROM t1 WHERE b;
// SELECT * FROM t1 WHERE (select a from t1);
-func Xsqlite3ExprAffinity(tls *libc.TLS, pExpr uintptr) uint8 { /* sqlite3.c:101272:21: */
+func Xsqlite3ExprAffinity(tls *libc.TLS, pExpr uintptr) uint8 { /* sqlite3.c:101673:21: */
var op int32
- for ((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_Skip | EP_IfNullRow))) != U32(0) {
+ for (*Expr)(unsafe.Pointer(pExpr)).Fflags&U32(EP_Skip|EP_IfNullRow) != U32(0) {
pExpr = (*Expr)(unsafe.Pointer(pExpr)).FpLeft
@@ -80755,24 +81761,28 @@ func Xsqlite3ExprAffinity(tls *libc.TLS, pExpr uintptr) uint8 { /* sqlite3.c:101
if op == TK_REGISTER {
op = int32((*Expr)(unsafe.Pointer(pExpr)).Fop2)
}
- if ((op == TK_COLUMN) || (op == TK_AGG_COLUMN)) && (*(*uintptr)(unsafe.Pointer(pExpr + 44 /* &.y */)) != 0) {
- return Xsqlite3TableColumnAffinity(tls, *(*uintptr)(unsafe.Pointer(pExpr + 44 /* &.y */)), int32((*Expr)(unsafe.Pointer(pExpr)).FiColumn))
+ if op == TK_COLUMN || op == TK_AGG_COLUMN {
+
+ if *(*uintptr)(unsafe.Pointer(pExpr + 44)) != 0 {
+ return Xsqlite3TableColumnAffinity(tls, *(*uintptr)(unsafe.Pointer(pExpr + 44)), int32((*Expr)(unsafe.Pointer(pExpr)).FiColumn))
+ }
}
if op == TK_SELECT {
- return Xsqlite3ExprAffinity(tls, (*ExprList_item)(unsafe.Pointer(((*Select)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pExpr + 20 /* &.x */)))).FpEList + 8 /* &.a */))).FpExpr)
+ return Xsqlite3ExprAffinity(tls, (*ExprList_item)(unsafe.Pointer((*Select)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pExpr + 20)))).FpEList+8)).FpExpr)
}
if op == TK_CAST {
- return Xsqlite3AffinityType(tls, *(*uintptr)(unsafe.Pointer(pExpr + 8 /* &.u */)), uintptr(0))
+ return Xsqlite3AffinityType(tls, *(*uintptr)(unsafe.Pointer(pExpr + 8)), uintptr(0))
}
if op == TK_SELECT_COLUMN {
return Xsqlite3ExprAffinity(tls,
- (*ExprList_item)(unsafe.Pointer(((*Select)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((*Expr)(unsafe.Pointer(pExpr)).FpLeft + 20 /* &.x */)))).FpEList+8 /* &.a */)+uintptr((*Expr)(unsafe.Pointer(pExpr)).FiColumn)*20)).FpExpr)
+ (*ExprList_item)(unsafe.Pointer((*Select)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((*Expr)(unsafe.Pointer(pExpr)).FpLeft + 20)))).FpEList+8+uintptr((*Expr)(unsafe.Pointer(pExpr)).FiColumn)*20)).FpExpr)
}
if op == TK_VECTOR {
- return Xsqlite3ExprAffinity(tls, (*ExprList_item)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(pExpr + 20 /* &.x */)) + 8 /* &.a */))).FpExpr)
+
+ return Xsqlite3ExprAffinity(tls, (*ExprList_item)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pExpr + 20))+8)).FpExpr)
}
return (*Expr)(unsafe.Pointer(pExpr)).FaffExpr
}
@@ -80783,19 +81793,19 @@ func Xsqlite3ExprAffinity(tls *libc.TLS, pExpr uintptr) uint8 { /* sqlite3.c:101
//
// If a memory allocation error occurs, that fact is recorded in pParse->db
// and the pExpr parameter is returned unchanged.
-func Xsqlite3ExprAddCollateToken(tls *libc.TLS, pParse uintptr, pExpr uintptr, pCollName uintptr, dequote int32) uintptr { /* sqlite3.c:101319:21: */
+func Xsqlite3ExprAddCollateToken(tls *libc.TLS, pParse uintptr, pExpr uintptr, pCollName uintptr, dequote int32) uintptr { /* sqlite3.c:101726:21: */
if (*Token)(unsafe.Pointer(pCollName)).Fn > uint32(0) {
var pNew uintptr = Xsqlite3ExprAlloc(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, TK_COLLATE, pCollName, dequote)
if pNew != 0 {
(*Expr)(unsafe.Pointer(pNew)).FpLeft = pExpr
- *(*U32)(unsafe.Pointer(pNew + 4 /* &.flags */)) |= (U32(EP_Collate | EP_Skip))
+ *(*U32)(unsafe.Pointer(pNew + 4)) |= U32(EP_Collate | EP_Skip)
pExpr = pNew
}
}
return pExpr
}
-func Xsqlite3ExprAddCollateString(tls *libc.TLS, pParse uintptr, pExpr uintptr, zC uintptr) uintptr { /* sqlite3.c:101335:21: */
+func Xsqlite3ExprAddCollateString(tls *libc.TLS, pParse uintptr, pExpr uintptr, zC uintptr) uintptr { /* sqlite3.c:101742:21: */
bp := tls.Alloc(8)
defer tls.Free(8)
@@ -80806,8 +81816,8 @@ func Xsqlite3ExprAddCollateString(tls *libc.TLS, pParse uintptr, pExpr uintptr,
}
// Skip over any TK_COLLATE operators.
-func Xsqlite3ExprSkipCollate(tls *libc.TLS, pExpr uintptr) uintptr { /* sqlite3.c:101345:21: */
- for (pExpr != 0) && (((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_Skip))) != U32(0)) {
+func Xsqlite3ExprSkipCollate(tls *libc.TLS, pExpr uintptr) uintptr { /* sqlite3.c:101756:21: */
+ for pExpr != 0 && (*Expr)(unsafe.Pointer(pExpr)).Fflags&U32(EP_Skip) != U32(0) {
pExpr = (*Expr)(unsafe.Pointer(pExpr)).FpLeft
}
@@ -80817,11 +81827,11 @@ func Xsqlite3ExprSkipCollate(tls *libc.TLS, pExpr uintptr) uintptr { /* sqlite3.
// Skip over any TK_COLLATE operators and/or any unlikely()
// or likelihood() or likely() functions at the root of an
// expression.
-func Xsqlite3ExprSkipCollateAndLikely(tls *libc.TLS, pExpr uintptr) uintptr { /* sqlite3.c:101358:21: */
- for (pExpr != 0) && (((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_Skip | EP_Unlikely))) != U32(0)) {
- if ((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_Unlikely))) != U32(0) {
+func Xsqlite3ExprSkipCollateAndLikely(tls *libc.TLS, pExpr uintptr) uintptr { /* sqlite3.c:101769:21: */
+ for pExpr != 0 && (*Expr)(unsafe.Pointer(pExpr)).Fflags&U32(EP_Skip|EP_Unlikely) != U32(0) {
+ if (*Expr)(unsafe.Pointer(pExpr)).Fflags&U32(EP_Unlikely) != U32(0) {
- pExpr = (*ExprList_item)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(pExpr + 20 /* &.x */)) + 8 /* &.a */))).FpExpr
+ pExpr = (*ExprList_item)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pExpr + 20)) + 8)).FpExpr
} else {
pExpr = (*Expr)(unsafe.Pointer(pExpr)).FpLeft
@@ -80842,7 +81852,7 @@ func Xsqlite3ExprSkipCollateAndLikely(tls *libc.TLS, pExpr uintptr) uintptr { /*
// or by the presence of a column with a defined collating sequence.
// COLLATE operators take first precedence. Left operands take
// precedence over right operands.
-func Xsqlite3ExprCollSeq(tls *libc.TLS, pParse uintptr, pExpr uintptr) uintptr { /* sqlite3.c:101387:24: */
+func Xsqlite3ExprCollSeq(tls *libc.TLS, pParse uintptr, pExpr uintptr) uintptr { /* sqlite3.c:101798:24: */
var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb
var pColl uintptr = uintptr(0)
var p uintptr = pExpr
@@ -80851,43 +81861,45 @@ func Xsqlite3ExprCollSeq(tls *libc.TLS, pParse uintptr, pExpr uintptr) uintptr {
if op == TK_REGISTER {
op = int32((*Expr)(unsafe.Pointer(p)).Fop2)
}
- if (((op == TK_AGG_COLUMN) || (op == TK_COLUMN)) || (op == TK_TRIGGER)) &&
- (*(*uintptr)(unsafe.Pointer(p + 44 /* &.y */)) != uintptr(0)) {
- // op==TK_REGISTER && p->y.pTab!=0 happens when pExpr was originally
- // a TK_COLUMN but was previously evaluated and cached in a register
- var j int32 = int32((*Expr)(unsafe.Pointer(p)).FiColumn)
- if j >= 0 {
- var zColl uintptr = (*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(p + 44 /* &.y */)))).FaCol + uintptr(j)*20)).FzColl
- pColl = Xsqlite3FindCollSeq(tls, db, (*Sqlite3)(unsafe.Pointer(db)).Fenc, zColl, 0)
+ if op == TK_AGG_COLUMN || op == TK_COLUMN || op == TK_TRIGGER {
+
+ if *(*uintptr)(unsafe.Pointer(p + 44)) != uintptr(0) {
+ // op==TK_REGISTER && p->y.pTab!=0 happens when pExpr was originally
+ // a TK_COLUMN but was previously evaluated and cached in a register
+ var j int32 = int32((*Expr)(unsafe.Pointer(p)).FiColumn)
+ if j >= 0 {
+ var zColl uintptr = Xsqlite3ColumnColl(tls, (*Table)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(p + 44)))).FaCol+uintptr(j)*16)
+ pColl = Xsqlite3FindCollSeq(tls, db, (*Sqlite3)(unsafe.Pointer(db)).Fenc, zColl, 0)
+ }
+ break
}
- break
}
- if (op == TK_CAST) || (op == TK_UPLUS) {
+ if op == TK_CAST || op == TK_UPLUS {
p = (*Expr)(unsafe.Pointer(p)).FpLeft
continue
}
if op == TK_VECTOR {
- p = (*ExprList_item)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(p + 20 /* &.x */)) + 8 /* &.a */))).FpExpr
+
+ p = (*ExprList_item)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(p + 20)) + 8)).FpExpr
continue
}
if op == TK_COLLATE {
- pColl = Xsqlite3GetCollSeq(tls, pParse, (*Sqlite3)(unsafe.Pointer(db)).Fenc, uintptr(0), *(*uintptr)(unsafe.Pointer(p + 8 /* &.u */)))
+
+ pColl = Xsqlite3GetCollSeq(tls, pParse, (*Sqlite3)(unsafe.Pointer(db)).Fenc, uintptr(0), *(*uintptr)(unsafe.Pointer(p + 8)))
break
}
- if ((*Expr)(unsafe.Pointer(p)).Fflags & U32(EP_Collate)) != 0 {
- if ((*Expr)(unsafe.Pointer(p)).FpLeft != 0) && (((*Expr)(unsafe.Pointer((*Expr)(unsafe.Pointer(p)).FpLeft)).Fflags & U32(EP_Collate)) != U32(0)) {
+ if (*Expr)(unsafe.Pointer(p)).Fflags&U32(EP_Collate) != 0 {
+ if (*Expr)(unsafe.Pointer(p)).FpLeft != 0 && (*Expr)(unsafe.Pointer((*Expr)(unsafe.Pointer(p)).FpLeft)).Fflags&U32(EP_Collate) != U32(0) {
p = (*Expr)(unsafe.Pointer(p)).FpLeft
} else {
var pNext uintptr = (*Expr)(unsafe.Pointer(p)).FpRight
// The Expr.x union is never used at the same time as Expr.pRight
- if ((*(*uintptr)(unsafe.Pointer(p + 20 /* &.x */)) != uintptr(0)) &&
- !(int32((*Sqlite3)(unsafe.Pointer(db)).FmallocFailed) != 0)) &&
- (!(((*Expr)(unsafe.Pointer((p))).Fflags & (U32(EP_xIsSelect))) != U32(0))) {
+ if *(*uintptr)(unsafe.Pointer(p + 20)) != uintptr(0) && !(int32((*Sqlite3)(unsafe.Pointer(db)).FmallocFailed) != 0) {
var i int32
for i = 0; i < (*ExprList)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(p + 20 /* &.x */)))).FnExpr; i++ {
- if ((*Expr)(unsafe.Pointer(((*ExprList_item)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(p + 20 /* &.x */)) + 8 /* &.a */) + uintptr(i)*20)).FpExpr))).Fflags & (U32(EP_Collate))) != U32(0) {
- pNext = (*ExprList_item)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(p + 20 /* &.x */)) + 8 /* &.a */) + uintptr(i)*20)).FpExpr
+ if (*Expr)(unsafe.Pointer((*ExprList_item)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(p + 20))+8+uintptr(i)*20)).FpExpr)).Fflags&U32(EP_Collate) != U32(0) {
+ pNext = (*ExprList_item)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(p + 20)) + 8 + uintptr(i)*20)).FpExpr
break
}
}
@@ -80912,7 +81924,7 @@ func Xsqlite3ExprCollSeq(tls *libc.TLS, pParse uintptr, pExpr uintptr) uintptr {
//
// The sqlite3ExprCollSeq() routine works the same except that it
// returns NULL if there is no defined collation.
-func Xsqlite3ExprNNCollSeq(tls *libc.TLS, pParse uintptr, pExpr uintptr) uintptr { /* sqlite3.c:101459:24: */
+func Xsqlite3ExprNNCollSeq(tls *libc.TLS, pParse uintptr, pExpr uintptr) uintptr { /* sqlite3.c:101871:24: */
var p uintptr = Xsqlite3ExprCollSeq(tls, pParse, pExpr)
if p == uintptr(0) {
p = (*Sqlite3)(unsafe.Pointer((*Parse)(unsafe.Pointer(pParse)).Fdb)).FpDfltColl
@@ -80922,21 +81934,21 @@ func Xsqlite3ExprNNCollSeq(tls *libc.TLS, pParse uintptr, pExpr uintptr) uintptr
}
// Return TRUE if the two expressions have equivalent collating sequences.
-func Xsqlite3ExprCollSeqMatch(tls *libc.TLS, pParse uintptr, pE1 uintptr, pE2 uintptr) int32 { /* sqlite3.c:101469:20: */
+func Xsqlite3ExprCollSeqMatch(tls *libc.TLS, pParse uintptr, pE1 uintptr, pE2 uintptr) int32 { /* sqlite3.c:101881:20: */
var pColl1 uintptr = Xsqlite3ExprNNCollSeq(tls, pParse, pE1)
var pColl2 uintptr = Xsqlite3ExprNNCollSeq(tls, pParse, pE2)
- return (libc.Bool32(Xsqlite3StrICmp(tls, (*CollSeq)(unsafe.Pointer(pColl1)).FzName, (*CollSeq)(unsafe.Pointer(pColl2)).FzName) == 0))
+ return libc.Bool32(Xsqlite3StrICmp(tls, (*CollSeq)(unsafe.Pointer(pColl1)).FzName, (*CollSeq)(unsafe.Pointer(pColl2)).FzName) == 0)
}
// pExpr is an operand of a comparison operator. aff2 is the
// type affinity of the other operand. This routine returns the
// type affinity that should be used for the comparison operator.
-func Xsqlite3CompareAffinity(tls *libc.TLS, pExpr uintptr, aff2 uint8) uint8 { /* sqlite3.c:101480:21: */
+func Xsqlite3CompareAffinity(tls *libc.TLS, pExpr uintptr, aff2 uint8) uint8 { /* sqlite3.c:101892:21: */
var aff1 uint8 = Xsqlite3ExprAffinity(tls, pExpr)
- if (int32(aff1) > SQLITE_AFF_NONE) && (int32(aff2) > SQLITE_AFF_NONE) {
+ if int32(aff1) > SQLITE_AFF_NONE && int32(aff2) > SQLITE_AFF_NONE {
// Both sides of the comparison are columns. If one has numeric
// affinity, use that. Otherwise use no affinity.
- if ((int32(aff1)) >= SQLITE_AFF_NUMERIC) || ((int32(aff2)) >= SQLITE_AFF_NUMERIC) {
+ if int32(aff1) >= SQLITE_AFF_NUMERIC || int32(aff2) >= SQLITE_AFF_NUMERIC {
return uint8(SQLITE_AFF_NUMERIC)
} else {
return uint8(SQLITE_AFF_BLOB)
@@ -80944,26 +81956,26 @@ func Xsqlite3CompareAffinity(tls *libc.TLS, pExpr uintptr, aff2 uint8) uint8 { /
} else {
// One side is a column, the other is not. Use the columns affinity.
- return (uint8((func() int32 {
+ return uint8(func() int32 {
if int32(aff1) <= SQLITE_AFF_NONE {
return int32(aff2)
}
return int32(aff1)
- }()) | SQLITE_AFF_NONE))
+ }() | SQLITE_AFF_NONE)
}
return uint8(0)
}
// pExpr is a comparison operator. Return the type affinity that should
// be applied to both operands prior to doing the comparison.
-func comparisonAffinity(tls *libc.TLS, pExpr uintptr) uint8 { /* sqlite3.c:101502:13: */
+func comparisonAffinity(tls *libc.TLS, pExpr uintptr) uint8 { /* sqlite3.c:101914:13: */
var aff uint8
aff = Xsqlite3ExprAffinity(tls, (*Expr)(unsafe.Pointer(pExpr)).FpLeft)
if (*Expr)(unsafe.Pointer(pExpr)).FpRight != 0 {
aff = Xsqlite3CompareAffinity(tls, (*Expr)(unsafe.Pointer(pExpr)).FpRight, aff)
- } else if ((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_xIsSelect))) != U32(0) {
- aff = Xsqlite3CompareAffinity(tls, (*ExprList_item)(unsafe.Pointer(((*Select)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pExpr + 20 /* &.x */)))).FpEList + 8 /* &.a */))).FpExpr, aff)
+ } else if (*Expr)(unsafe.Pointer(pExpr)).Fflags&U32(EP_xIsSelect) != U32(0) {
+ aff = Xsqlite3CompareAffinity(tls, (*ExprList_item)(unsafe.Pointer((*Select)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pExpr + 20)))).FpEList+8)).FpExpr, aff)
} else if int32(aff) == 0 {
aff = uint8(SQLITE_AFF_BLOB)
}
@@ -80974,22 +81986,22 @@ func comparisonAffinity(tls *libc.TLS, pExpr uintptr) uint8 { /* sqlite3.c:10150
// idx_affinity is the affinity of an indexed column. Return true
// if the index with affinity idx_affinity may be used to implement
// the comparison in pExpr.
-func Xsqlite3IndexAffinityOk(tls *libc.TLS, pExpr uintptr, idx_affinity uint8) int32 { /* sqlite3.c:101525:20: */
+func Xsqlite3IndexAffinityOk(tls *libc.TLS, pExpr uintptr, idx_affinity uint8) int32 { /* sqlite3.c:101937:20: */
var aff uint8 = comparisonAffinity(tls, pExpr)
if int32(aff) < SQLITE_AFF_TEXT {
return 1
}
if int32(aff) == SQLITE_AFF_TEXT {
- return (libc.Bool32(int32(idx_affinity) == SQLITE_AFF_TEXT))
+ return libc.Bool32(int32(idx_affinity) == SQLITE_AFF_TEXT)
}
- return (libc.Bool32((int32(idx_affinity)) >= SQLITE_AFF_NUMERIC))
+ return libc.Bool32(int32(idx_affinity) >= SQLITE_AFF_NUMERIC)
}
// Return the P5 value that should be used for a binary comparison
// opcode (OP_Eq, OP_Ge etc.) used to compare pExpr1 and pExpr2.
-func binaryCompareP5(tls *libc.TLS, pExpr1 uintptr, pExpr2 uintptr, jumpIfNull int32) U8 { /* sqlite3.c:101540:11: */
+func binaryCompareP5(tls *libc.TLS, pExpr1 uintptr, pExpr2 uintptr, jumpIfNull int32) U8 { /* sqlite3.c:101952:11: */
var aff U8 = U8(Xsqlite3ExprAffinity(tls, pExpr2))
- aff = (U8(int32(U8(Xsqlite3CompareAffinity(tls, pExpr1, uint8(aff)))) | int32(U8(jumpIfNull))))
+ aff = U8(int32(U8(Xsqlite3CompareAffinity(tls, pExpr1, uint8(aff)))) | int32(U8(jumpIfNull)))
return aff
}
@@ -81003,12 +82015,12 @@ func binaryCompareP5(tls *libc.TLS, pExpr1 uintptr, pExpr2 uintptr, jumpIfNull i
//
// Argument pRight (but not pLeft) may be a null pointer. In this case,
// it is not considered.
-func Xsqlite3BinaryCompareCollSeq(tls *libc.TLS, pParse uintptr, pLeft uintptr, pRight uintptr) uintptr { /* sqlite3.c:101562:24: */
+func Xsqlite3BinaryCompareCollSeq(tls *libc.TLS, pParse uintptr, pLeft uintptr, pRight uintptr) uintptr { /* sqlite3.c:101974:24: */
var pColl uintptr
- if ((*Expr)(unsafe.Pointer(pLeft)).Fflags & U32(EP_Collate)) != 0 {
+ if (*Expr)(unsafe.Pointer(pLeft)).Fflags&U32(EP_Collate) != 0 {
pColl = Xsqlite3ExprCollSeq(tls, pParse, pLeft)
- } else if (pRight != 0) && (((*Expr)(unsafe.Pointer(pRight)).Fflags & U32(EP_Collate)) != U32(0)) {
+ } else if pRight != 0 && (*Expr)(unsafe.Pointer(pRight)).Fflags&U32(EP_Collate) != U32(0) {
pColl = Xsqlite3ExprCollSeq(tls, pParse, pRight)
} else {
pColl = Xsqlite3ExprCollSeq(tls, pParse, pLeft)
@@ -81026,8 +82038,8 @@ func Xsqlite3BinaryCompareCollSeq(tls *libc.TLS, pParse uintptr, pLeft uintptr,
// However, if the OP_Commuted flag is set, then the order of the operands
// is reversed in the sqlite3BinaryCompareCollSeq() call so that the
// correct collating sequence is found.
-func Xsqlite3ExprCompareCollSeq(tls *libc.TLS, pParse uintptr, p uintptr) uintptr { /* sqlite3.c:101590:24: */
- if ((*Expr)(unsafe.Pointer((p))).Fflags & (U32(EP_Commuted))) != U32(0) {
+func Xsqlite3ExprCompareCollSeq(tls *libc.TLS, pParse uintptr, p uintptr) uintptr { /* sqlite3.c:102002:24: */
+ if (*Expr)(unsafe.Pointer(p)).Fflags&U32(EP_Commuted) != U32(0) {
return Xsqlite3BinaryCompareCollSeq(tls, pParse, (*Expr)(unsafe.Pointer(p)).FpRight, (*Expr)(unsafe.Pointer(p)).FpLeft)
} else {
return Xsqlite3BinaryCompareCollSeq(tls, pParse, (*Expr)(unsafe.Pointer(p)).FpLeft, (*Expr)(unsafe.Pointer(p)).FpRight)
@@ -81036,7 +82048,7 @@ func Xsqlite3ExprCompareCollSeq(tls *libc.TLS, pParse uintptr, p uintptr) uintpt
}
// Generate code for a comparison operator.
-func codeCompare(tls *libc.TLS, pParse uintptr, pLeft uintptr, pRight uintptr, opcode int32, in1 int32, in2 int32, dest int32, jumpIfNull int32, isCommuted int32) int32 { /* sqlite3.c:101601:12: */
+func codeCompare(tls *libc.TLS, pParse uintptr, pLeft uintptr, pRight uintptr, opcode int32, in1 int32, in2 int32, dest int32, jumpIfNull int32, isCommuted int32) int32 { /* sqlite3.c:102013:12: */
var p5 int32
var addr int32
var p4 uintptr
@@ -81063,23 +82075,25 @@ func codeCompare(tls *libc.TLS, pParse uintptr, pLeft uintptr, pRight uintptr, o
// parser will not generate a TK_VECTOR with fewer than two entries.
// But a TK_SELECT might be either a vector or a scalar. It is only
// considered a vector if it has two or more result columns.
-func Xsqlite3ExprIsVector(tls *libc.TLS, pExpr uintptr) int32 { /* sqlite3.c:101637:20: */
- return (libc.Bool32(Xsqlite3ExprVectorSize(tls, pExpr) > 1))
+func Xsqlite3ExprIsVector(tls *libc.TLS, pExpr uintptr) int32 { /* sqlite3.c:102049:20: */
+ return libc.Bool32(Xsqlite3ExprVectorSize(tls, pExpr) > 1)
}
// If the expression passed as the only argument is of type TK_VECTOR
// return the number of expressions in the vector. Or, if the expression
// is a sub-select, return the number of columns in the sub-select. For
// any other type of expression, return 1.
-func Xsqlite3ExprVectorSize(tls *libc.TLS, pExpr uintptr) int32 { /* sqlite3.c:101647:20: */
+func Xsqlite3ExprVectorSize(tls *libc.TLS, pExpr uintptr) int32 { /* sqlite3.c:102059:20: */
var op U8 = (*Expr)(unsafe.Pointer(pExpr)).Fop
if int32(op) == TK_REGISTER {
op = (*Expr)(unsafe.Pointer(pExpr)).Fop2
}
if int32(op) == TK_VECTOR {
- return (*ExprList)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pExpr + 20 /* &.x */)))).FnExpr
+
+ return (*ExprList)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pExpr + 20)))).FnExpr
} else if int32(op) == TK_SELECT {
- return (*ExprList)(unsafe.Pointer((*Select)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pExpr + 20 /* &.x */)))).FpEList)).FnExpr
+
+ return (*ExprList)(unsafe.Pointer((*Select)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pExpr + 20)))).FpEList)).FnExpr
} else {
return 1
}
@@ -81099,14 +82113,16 @@ func Xsqlite3ExprVectorSize(tls *libc.TLS, pExpr uintptr) int32 { /* sqlite3.c:1
// just the expression for the i-th term of the result set, and may
// not be ready for evaluation because the table cursor has not yet
// been positioned.
-func Xsqlite3VectorFieldSubexpr(tls *libc.TLS, pVector uintptr, i int32) uintptr { /* sqlite3.c:101674:21: */
+func Xsqlite3VectorFieldSubexpr(tls *libc.TLS, pVector uintptr, i int32) uintptr { /* sqlite3.c:102088:21: */
if Xsqlite3ExprIsVector(tls, pVector) != 0 {
- if (int32((*Expr)(unsafe.Pointer(pVector)).Fop) == TK_SELECT) || (int32((*Expr)(unsafe.Pointer(pVector)).Fop2) == TK_SELECT) {
- return (*ExprList_item)(unsafe.Pointer(((*Select)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pVector + 20 /* &.x */)))).FpEList + 8 /* &.a */) + uintptr(i)*20)).FpExpr
+ if int32((*Expr)(unsafe.Pointer(pVector)).Fop) == TK_SELECT || int32((*Expr)(unsafe.Pointer(pVector)).Fop2) == TK_SELECT {
+
+ return (*ExprList_item)(unsafe.Pointer((*Select)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pVector + 20)))).FpEList + 8 + uintptr(i)*20)).FpExpr
} else {
- return (*ExprList_item)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(pVector + 20 /* &.x */)) + 8 /* &.a */) + uintptr(i)*20)).FpExpr
+
+ return (*ExprList_item)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pVector + 20)) + 8 + uintptr(i)*20)).FpExpr
}
}
return pVector
@@ -81131,7 +82147,7 @@ func Xsqlite3VectorFieldSubexpr(tls *libc.TLS, pVector uintptr, i int32) uintptr
// A trick to cause a TK_SELECT pVector to be deleted together with
// the returned Expr object is to attach the pVector to the pRight field
// of the returned TK_SELECT_COLUMN Expr object.
-func Xsqlite3ExprForVectorField(tls *libc.TLS, pParse uintptr, pVector uintptr, iField int32) uintptr { /* sqlite3.c:101708:21: */
+func Xsqlite3ExprForVectorField(tls *libc.TLS, pParse uintptr, pVector uintptr, iField int32, nField int32) uintptr { /* sqlite3.c:102124:21: */
var pRet uintptr
if int32((*Expr)(unsafe.Pointer(pVector)).Fop) == TK_SELECT {
@@ -81152,16 +82168,23 @@ func Xsqlite3ExprForVectorField(tls *libc.TLS, pParse uintptr, pVector uintptr,
// will own the pVector.
pRet = Xsqlite3PExpr(tls, pParse, TK_SELECT_COLUMN, uintptr(0), uintptr(0))
if pRet != 0 {
+ (*Expr)(unsafe.Pointer(pRet)).FiTable = nField
(*Expr)(unsafe.Pointer(pRet)).FiColumn = YnVar(iField)
(*Expr)(unsafe.Pointer(pRet)).FpLeft = pVector
}
-
} else {
if int32((*Expr)(unsafe.Pointer(pVector)).Fop) == TK_VECTOR {
- pVector = (*ExprList_item)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(pVector + 20 /* &.x */)) + 8 /* &.a */) + uintptr(iField)*20)).FpExpr
+ var ppVector uintptr
+
+ ppVector = *(*uintptr)(unsafe.Pointer(pVector + 20)) + 8 + uintptr(iField)*20
+ pVector = *(*uintptr)(unsafe.Pointer(ppVector))
+ if int32((*Parse)(unsafe.Pointer(pParse)).FeParseMode) >= PARSE_MODE_RENAME {
+ // This must be a vector UPDATE inside a trigger
+ *(*uintptr)(unsafe.Pointer(ppVector)) = uintptr(0)
+ return pVector
+ }
}
pRet = Xsqlite3ExprDup(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, pVector, 0)
- Xsqlite3RenameTokenRemap(tls, pParse, pRet, pVector)
}
return pRet
}
@@ -81172,7 +82195,7 @@ func Xsqlite3ExprForVectorField(tls *libc.TLS, pParse uintptr, pVector uintptr,
// of registers in which the result is stored).
//
// If pExpr is not a TK_SELECT expression, return 0.
-func exprCodeSubselect(tls *libc.TLS, pParse uintptr, pExpr uintptr) int32 { /* sqlite3.c:101754:12: */
+func exprCodeSubselect(tls *libc.TLS, pParse uintptr, pExpr uintptr) int32 { /* sqlite3.c:102180:12: */
var reg int32 = 0
if int32((*Expr)(unsafe.Pointer(pExpr)).Fop) == TK_SELECT {
reg = Xsqlite3CodeSubselect(tls, pParse, pExpr)
@@ -81196,19 +82219,21 @@ func exprCodeSubselect(tls *libc.TLS, pParse uintptr, pExpr uintptr) int32 { /*
//
// Before returning, output parameter (*ppExpr) is set to point to the
// Expr object corresponding to element iElem of the vector.
-func exprVectorRegister(tls *libc.TLS, pParse uintptr, pVector uintptr, iField int32, regSelect int32, ppExpr uintptr, pRegFree uintptr) int32 { /* sqlite3.c:101782:12: */
+func exprVectorRegister(tls *libc.TLS, pParse uintptr, pVector uintptr, iField int32, regSelect int32, ppExpr uintptr, pRegFree uintptr) int32 { /* sqlite3.c:102208:12: */
var op U8 = (*Expr)(unsafe.Pointer(pVector)).Fop
if int32(op) == TK_REGISTER {
*(*uintptr)(unsafe.Pointer(ppExpr)) = Xsqlite3VectorFieldSubexpr(tls, pVector, iField)
- return ((*Expr)(unsafe.Pointer(pVector)).FiTable + iField)
+ return (*Expr)(unsafe.Pointer(pVector)).FiTable + iField
}
if int32(op) == TK_SELECT {
- *(*uintptr)(unsafe.Pointer(ppExpr)) = (*ExprList_item)(unsafe.Pointer(((*Select)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pVector + 20 /* &.x */)))).FpEList + 8 /* &.a */) + uintptr(iField)*20)).FpExpr
- return (regSelect + iField)
+
+ *(*uintptr)(unsafe.Pointer(ppExpr)) = (*ExprList_item)(unsafe.Pointer((*Select)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pVector + 20)))).FpEList + 8 + uintptr(iField)*20)).FpExpr
+ return regSelect + iField
}
if int32(op) == TK_VECTOR {
- *(*uintptr)(unsafe.Pointer(ppExpr)) = (*ExprList_item)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(pVector + 20 /* &.x */)) + 8 /* &.a */) + uintptr(iField)*20)).FpExpr
+
+ *(*uintptr)(unsafe.Pointer(ppExpr)) = (*ExprList_item)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pVector + 20)) + 8 + uintptr(iField)*20)).FpExpr
return Xsqlite3ExprCodeTemp(tls, pParse, *(*uintptr)(unsafe.Pointer(ppExpr)), pRegFree)
}
return 0
@@ -81223,7 +82248,7 @@ func exprVectorRegister(tls *libc.TLS, pParse uintptr, pVector uintptr, iField i
// if pExpr->op==TK_IS: op==TK_EQ and p5==SQLITE_NULLEQ
// if pExpr->op==TK_ISNOT: op==TK_NE and p5==SQLITE_NULLEQ
// otherwise: op==pExpr->op and p5==0
-func codeVectorCompare(tls *libc.TLS, pParse uintptr, pExpr uintptr, dest int32, op U8, p5 U8) { /* sqlite3.c:101818:13: */
+func codeVectorCompare(tls *libc.TLS, pParse uintptr, pExpr uintptr, dest int32, op U8, p5 U8) { /* sqlite3.c:102246:13: */
bp := tls.Alloc(16)
defer tls.Free(16)
@@ -81237,13 +82262,13 @@ func codeVectorCompare(tls *libc.TLS, pParse uintptr, pExpr uintptr, dest int32,
var opx U8 = op
var addrCmp int32 = 0
var addrDone int32 = Xsqlite3VdbeMakeLabel(tls, pParse)
- var isCommuted int32 = (libc.Bool32(((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_Commuted))) != U32(0)))
+ var isCommuted int32 = libc.Bool32((*Expr)(unsafe.Pointer(pExpr)).Fflags&U32(EP_Commuted) != U32(0))
if (*Parse)(unsafe.Pointer(pParse)).FnErr != 0 {
return
}
if nLeft != Xsqlite3ExprVectorSize(tls, pRight) {
- Xsqlite3ErrorMsg(tls, pParse, ts+5548 /* "row value misuse..." */, 0)
+ Xsqlite3ErrorMsg(tls, pParse, ts+6395 /* "row value misuse..." */, 0)
return
}
@@ -81279,7 +82304,7 @@ func codeVectorCompare(tls *libc.TLS, pParse uintptr, pExpr uintptr, dest int32,
Xsqlite3ReleaseTempReg(tls, pParse, *(*int32)(unsafe.Pointer(bp + 4 /* regFree1 */)))
Xsqlite3ReleaseTempReg(tls, pParse, *(*int32)(unsafe.Pointer(bp + 12 /* regFree2 */)))
- if ((int32(opx) == TK_LT) || (int32(opx) == TK_GT)) && (i < (nLeft - 1)) {
+ if (int32(opx) == TK_LT || int32(opx) == TK_GT) && i < nLeft-1 {
addrCmp = Xsqlite3VdbeAddOp0(tls, v, OP_ElseEq)
}
@@ -81288,7 +82313,7 @@ func codeVectorCompare(tls *libc.TLS, pParse uintptr, pExpr uintptr, dest int32,
} else {
Xsqlite3VdbeAddOp3(tls, v, OP_ZeroOrNull, r1, dest, r2)
}
- if i == (nLeft - 1) {
+ if i == nLeft-1 {
break
}
if int32(opx) == TK_EQ {
@@ -81296,7 +82321,7 @@ func codeVectorCompare(tls *libc.TLS, pParse uintptr, pExpr uintptr, dest int32,
} else {
Xsqlite3VdbeAddOp2(tls, v, OP_Goto, 0, addrDone)
- if i == (nLeft - 2) {
+ if i == nLeft-2 {
opx = op
}
}
@@ -81311,15 +82336,15 @@ func codeVectorCompare(tls *libc.TLS, pParse uintptr, pExpr uintptr, dest int32,
// Check that argument nHeight is less than or equal to the maximum
// expression depth allowed. If it is not, leave an error message in
// pParse.
-func Xsqlite3ExprCheckHeight(tls *libc.TLS, pParse uintptr, nHeight int32) int32 { /* sqlite3.c:101913:20: */
+func Xsqlite3ExprCheckHeight(tls *libc.TLS, pParse uintptr, nHeight int32) int32 { /* sqlite3.c:102341:20: */
bp := tls.Alloc(8)
defer tls.Free(8)
var rc int32 = SQLITE_OK
- var mxHeight int32 = *(*int32)(unsafe.Pointer(((*Parse)(unsafe.Pointer(pParse)).Fdb + 112 /* &.aLimit */) + 3*4))
+ var mxHeight int32 = *(*int32)(unsafe.Pointer((*Parse)(unsafe.Pointer(pParse)).Fdb + 120 + 3*4))
if nHeight > mxHeight {
Xsqlite3ErrorMsg(tls, pParse,
- ts+6458 /* "Expression tree ..." */, libc.VaList(bp, mxHeight))
+ ts+7305 /* "Expression tree ..." */, libc.VaList(bp, mxHeight))
rc = SQLITE_ERROR
}
return rc
@@ -81333,7 +82358,7 @@ func Xsqlite3ExprCheckHeight(tls *libc.TLS, pParse uintptr, nHeight int32) int32
// If this maximum height is greater than the current value pointed
// to by pnHeight, the second parameter, then set *pnHeight to that
// value.
-func heightOfExpr(tls *libc.TLS, p uintptr, pnHeight uintptr) { /* sqlite3.c:101934:13: */
+func heightOfExpr(tls *libc.TLS, p uintptr, pnHeight uintptr) { /* sqlite3.c:102362:13: */
if p != 0 {
if (*Expr)(unsafe.Pointer(p)).FnHeight > *(*int32)(unsafe.Pointer(pnHeight)) {
*(*int32)(unsafe.Pointer(pnHeight)) = (*Expr)(unsafe.Pointer(p)).FnHeight
@@ -81341,16 +82366,16 @@ func heightOfExpr(tls *libc.TLS, p uintptr, pnHeight uintptr) { /* sqlite3.c:101
}
}
-func heightOfExprList(tls *libc.TLS, p uintptr, pnHeight uintptr) { /* sqlite3.c:101941:13: */
+func heightOfExprList(tls *libc.TLS, p uintptr, pnHeight uintptr) { /* sqlite3.c:102369:13: */
if p != 0 {
var i int32
for i = 0; i < (*ExprList)(unsafe.Pointer(p)).FnExpr; i++ {
- heightOfExpr(tls, (*ExprList_item)(unsafe.Pointer((p+8 /* &.a */)+uintptr(i)*20)).FpExpr, pnHeight)
+ heightOfExpr(tls, (*ExprList_item)(unsafe.Pointer(p+8+uintptr(i)*20)).FpExpr, pnHeight)
}
}
}
-func heightOfSelect(tls *libc.TLS, pSelect uintptr, pnHeight uintptr) { /* sqlite3.c:101949:13: */
+func heightOfSelect(tls *libc.TLS, pSelect uintptr, pnHeight uintptr) { /* sqlite3.c:102377:13: */
var p uintptr
for p = pSelect; p != 0; p = (*Select)(unsafe.Pointer(p)).FpPrior {
heightOfExpr(tls, (*Select)(unsafe.Pointer(p)).FpWhere, pnHeight)
@@ -81370,20 +82395,20 @@ func heightOfSelect(tls *libc.TLS, pSelect uintptr, pnHeight uintptr) { /* sqlit
//
// Also propagate EP_Propagate flags up from Expr.x.pList to Expr.flags,
// if appropriate.
-func exprSetHeight(tls *libc.TLS, p uintptr) { /* sqlite3.c:101971:13: */
+func exprSetHeight(tls *libc.TLS, p uintptr) { /* sqlite3.c:102399:13: */
bp := tls.Alloc(4)
defer tls.Free(4)
*(*int32)(unsafe.Pointer(bp /* nHeight */)) = 0
heightOfExpr(tls, (*Expr)(unsafe.Pointer(p)).FpLeft, bp /* &nHeight */)
heightOfExpr(tls, (*Expr)(unsafe.Pointer(p)).FpRight, bp /* &nHeight */)
- if ((*Expr)(unsafe.Pointer((p))).Fflags & (U32(EP_xIsSelect))) != U32(0) {
- heightOfSelect(tls, *(*uintptr)(unsafe.Pointer(p + 20 /* &.x */)), bp /* &nHeight */)
- } else if *(*uintptr)(unsafe.Pointer(p + 20 /* &.x */)) != 0 {
- heightOfExprList(tls, *(*uintptr)(unsafe.Pointer(p + 20 /* &.x */)), bp /* &nHeight */)
- *(*U32)(unsafe.Pointer(p + 4 /* &.flags */)) |= ((U32((EP_Collate | EP_Subquery) | EP_HasFunc)) & Xsqlite3ExprListFlags(tls, *(*uintptr)(unsafe.Pointer(p + 20 /* &.x */))))
+ if (*Expr)(unsafe.Pointer(p)).Fflags&U32(EP_xIsSelect) != U32(0) {
+ heightOfSelect(tls, *(*uintptr)(unsafe.Pointer(p + 20)), bp /* &nHeight */)
+ } else if *(*uintptr)(unsafe.Pointer(p + 20)) != 0 {
+ heightOfExprList(tls, *(*uintptr)(unsafe.Pointer(p + 20)), bp /* &nHeight */)
+ *(*U32)(unsafe.Pointer(p + 4)) |= U32(EP_Collate|EP_Subquery|EP_HasFunc) & Xsqlite3ExprListFlags(tls, *(*uintptr)(unsafe.Pointer(p + 20)))
}
- (*Expr)(unsafe.Pointer(p)).FnHeight = (*(*int32)(unsafe.Pointer(bp /* nHeight */)) + 1)
+ (*Expr)(unsafe.Pointer(p)).FnHeight = *(*int32)(unsafe.Pointer(bp)) + 1
}
// Set the Expr.nHeight variable using the exprSetHeight() function. If
@@ -81392,7 +82417,7 @@ func exprSetHeight(tls *libc.TLS, p uintptr) { /* sqlite3.c:101971:13: */
//
// Also propagate all EP_Propagate flags from the Expr.x.pList into
// Expr.flags.
-func Xsqlite3ExprSetHeightAndFlags(tls *libc.TLS, pParse uintptr, p uintptr) { /* sqlite3.c:101992:21: */
+func Xsqlite3ExprSetHeightAndFlags(tls *libc.TLS, pParse uintptr, p uintptr) { /* sqlite3.c:102420:21: */
if (*Parse)(unsafe.Pointer(pParse)).FnErr != 0 {
return
}
@@ -81402,7 +82427,7 @@ func Xsqlite3ExprSetHeightAndFlags(tls *libc.TLS, pParse uintptr, p uintptr) { /
// Return the maximum height of any expression tree referenced
// by the select statement passed as an argument.
-func Xsqlite3SelectExprHeight(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:102002:20: */
+func Xsqlite3SelectExprHeight(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:102430:20: */
bp := tls.Alloc(4)
defer tls.Free(4)
@@ -81429,7 +82454,7 @@ func Xsqlite3SelectExprHeight(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:102
// stored in u.zToken. Instead, the integer values is written
// into u.iValue and the EP_IntValue flag is set. No extra storage
// is allocated to hold the integer text and the dequote flag is ignored.
-func Xsqlite3ExprAlloc(tls *libc.TLS, db uintptr, op int32, pToken uintptr, dequote int32) uintptr { /* sqlite3.c:102041:21: */
+func Xsqlite3ExprAlloc(tls *libc.TLS, db uintptr, op int32, pToken uintptr, dequote int32) uintptr { /* sqlite3.c:102469:21: */
bp := tls.Alloc(4)
defer tls.Free(4)
@@ -81438,34 +82463,34 @@ func Xsqlite3ExprAlloc(tls *libc.TLS, db uintptr, op int32, pToken uintptr, dequ
*(*int32)(unsafe.Pointer(bp /* iValue */)) = 0
if pToken != 0 {
- if ((op != TK_INTEGER) || ((*Token)(unsafe.Pointer(pToken)).Fz == uintptr(0))) ||
- (Xsqlite3GetInt32(tls, (*Token)(unsafe.Pointer(pToken)).Fz, bp /* &iValue */) == 0) {
- nExtra = (int32((*Token)(unsafe.Pointer(pToken)).Fn + uint32(1)))
+ if op != TK_INTEGER || (*Token)(unsafe.Pointer(pToken)).Fz == uintptr(0) ||
+ Xsqlite3GetInt32(tls, (*Token)(unsafe.Pointer(pToken)).Fz, bp) == 0 {
+ nExtra = int32((*Token)(unsafe.Pointer(pToken)).Fn + uint32(1))
}
}
- pNew = Xsqlite3DbMallocRawNN(tls, db, (uint64(uint32(unsafe.Sizeof(Expr{})) + uint32(nExtra))))
+ pNew = Xsqlite3DbMallocRawNN(tls, db, uint64(uint32(unsafe.Sizeof(Expr{}))+uint32(nExtra)))
if pNew != 0 {
libc.Xmemset(tls, pNew, 0, uint32(unsafe.Sizeof(Expr{})))
(*Expr)(unsafe.Pointer(pNew)).Fop = U8(op)
(*Expr)(unsafe.Pointer(pNew)).FiAgg = int16(-1)
if pToken != 0 {
if nExtra == 0 {
- *(*U32)(unsafe.Pointer(pNew + 4 /* &.flags */)) |= (U32((EP_IntValue | EP_Leaf) | (func() int32 {
- if *(*int32)(unsafe.Pointer(bp /* iValue */)) != 0 {
+ *(*U32)(unsafe.Pointer(pNew + 4)) |= U32(EP_IntValue | EP_Leaf | func() int32 {
+ if *(*int32)(unsafe.Pointer(bp)) != 0 {
return EP_IsTrue
}
return EP_IsFalse
- }())))
- *(*int32)(unsafe.Pointer(pNew + 8 /* &.u */)) = *(*int32)(unsafe.Pointer(bp /* iValue */))
+ }())
+ *(*int32)(unsafe.Pointer(pNew + 8)) = *(*int32)(unsafe.Pointer(bp /* iValue */))
} else {
- *(*uintptr)(unsafe.Pointer(pNew + 8 /* &.u */)) = (pNew + 1*52)
+ *(*uintptr)(unsafe.Pointer(pNew + 8)) = pNew + 1*52
if (*Token)(unsafe.Pointer(pToken)).Fn != 0 {
- libc.Xmemcpy(tls, *(*uintptr)(unsafe.Pointer(pNew + 8 /* &.u */)), (*Token)(unsafe.Pointer(pToken)).Fz, (*Token)(unsafe.Pointer(pToken)).Fn)
+ libc.Xmemcpy(tls, *(*uintptr)(unsafe.Pointer(pNew + 8)), (*Token)(unsafe.Pointer(pToken)).Fz, (*Token)(unsafe.Pointer(pToken)).Fn)
}
- *(*uint8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pNew + 8 /* &.u */)) + uintptr((*Token)(unsafe.Pointer(pToken)).Fn))) = uint8(0)
- if (dequote != 0) && ((int32(Xsqlite3CtypeMap[uint8(*(*uint8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pNew + 8 /* &.u */)))))]) & 0x80) != 0) {
+ *(*uint8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pNew + 8)) + uintptr((*Token)(unsafe.Pointer(pToken)).Fn))) = uint8(0)
+ if dequote != 0 && int32(Xsqlite3CtypeMap[uint8(*(*uint8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pNew + 8)))))])&0x80 != 0 {
Xsqlite3DequoteExpr(tls, pNew)
}
}
@@ -81477,7 +82502,7 @@ func Xsqlite3ExprAlloc(tls *libc.TLS, db uintptr, op int32, pToken uintptr, dequ
// Allocate a new expression node from a zero-terminated token that has
// already been dequoted.
-func Xsqlite3Expr(tls *libc.TLS, db uintptr, op int32, zToken uintptr) uintptr { /* sqlite3.c:102089:21: */
+func Xsqlite3Expr(tls *libc.TLS, db uintptr, op int32, zToken uintptr) uintptr { /* sqlite3.c:102517:21: */
bp := tls.Alloc(8)
defer tls.Free(8)
@@ -81492,7 +82517,7 @@ func Xsqlite3Expr(tls *libc.TLS, db uintptr, op int32, zToken uintptr) uintptr {
//
// If pRoot==NULL that means that a memory allocation error has occurred.
// In that case, delete the subtrees pLeft and pRight.
-func Xsqlite3ExprAttachSubtrees(tls *libc.TLS, db uintptr, pRoot uintptr, pLeft uintptr, pRight uintptr) { /* sqlite3.c:102106:21: */
+func Xsqlite3ExprAttachSubtrees(tls *libc.TLS, db uintptr, pRoot uintptr, pLeft uintptr, pRight uintptr) { /* sqlite3.c:102534:21: */
if pRoot == uintptr(0) {
Xsqlite3ExprDelete(tls, db, pLeft)
@@ -81500,11 +82525,11 @@ func Xsqlite3ExprAttachSubtrees(tls *libc.TLS, db uintptr, pRoot uintptr, pLeft
} else {
if pRight != 0 {
(*Expr)(unsafe.Pointer(pRoot)).FpRight = pRight
- *(*U32)(unsafe.Pointer(pRoot + 4 /* &.flags */)) |= ((U32((EP_Collate | EP_Subquery) | EP_HasFunc)) & (*Expr)(unsafe.Pointer(pRight)).Fflags)
+ *(*U32)(unsafe.Pointer(pRoot + 4)) |= U32(EP_Collate|EP_Subquery|EP_HasFunc) & (*Expr)(unsafe.Pointer(pRight)).Fflags
}
if pLeft != 0 {
(*Expr)(unsafe.Pointer(pRoot)).FpLeft = pLeft
- *(*U32)(unsafe.Pointer(pRoot + 4 /* &.flags */)) |= ((U32((EP_Collate | EP_Subquery) | EP_HasFunc)) & (*Expr)(unsafe.Pointer(pLeft)).Fflags)
+ *(*U32)(unsafe.Pointer(pRoot + 4)) |= U32(EP_Collate|EP_Subquery|EP_HasFunc) & (*Expr)(unsafe.Pointer(pLeft)).Fflags
}
exprSetHeight(tls, pRoot)
}
@@ -81515,12 +82540,12 @@ func Xsqlite3ExprAttachSubtrees(tls *libc.TLS, db uintptr, pRoot uintptr, pLeft
// One or both of the subtrees can be NULL. Return a pointer to the new
// Expr node. Or, if an OOM error occurs, set pParse->db->mallocFailed,
// free the subtrees and return NULL.
-func Xsqlite3PExpr(tls *libc.TLS, pParse uintptr, op int32, pLeft uintptr, pRight uintptr) uintptr { /* sqlite3.c:102136:21: */
+func Xsqlite3PExpr(tls *libc.TLS, pParse uintptr, op int32, pLeft uintptr, pRight uintptr) uintptr { /* sqlite3.c:102564:21: */
var p uintptr
p = Xsqlite3DbMallocRawNN(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, uint64(unsafe.Sizeof(Expr{})))
if p != 0 {
libc.Xmemset(tls, p, 0, uint32(unsafe.Sizeof(Expr{})))
- (*Expr)(unsafe.Pointer(p)).Fop = (U8(op & 0xff))
+ (*Expr)(unsafe.Pointer(p)).Fop = U8(op & 0xff)
(*Expr)(unsafe.Pointer(p)).FiAgg = int16(-1)
Xsqlite3ExprAttachSubtrees(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, p, pLeft, pRight)
Xsqlite3ExprCheckHeight(tls, pParse, (*Expr)(unsafe.Pointer(p)).FnHeight)
@@ -81533,10 +82558,10 @@ func Xsqlite3PExpr(tls *libc.TLS, pParse uintptr, op int32, pLeft uintptr, pRigh
// Add pSelect to the Expr.x.pSelect field. Or, if pExpr is NULL (due
// do a memory allocation failure) then delete the pSelect object.
-func Xsqlite3PExprAddSelect(tls *libc.TLS, pParse uintptr, pExpr uintptr, pSelect uintptr) { /* sqlite3.c:102161:21: */
+func Xsqlite3PExprAddSelect(tls *libc.TLS, pParse uintptr, pExpr uintptr, pSelect uintptr) { /* sqlite3.c:102589:21: */
if pExpr != 0 {
- *(*uintptr)(unsafe.Pointer(pExpr + 20 /* &.x */)) = pSelect
- *(*U32)(unsafe.Pointer(pExpr + 4 /* &.flags */)) |= (U32(EP_xIsSelect | EP_Subquery))
+ *(*uintptr)(unsafe.Pointer(pExpr + 20)) = pSelect
+ *(*U32)(unsafe.Pointer(pExpr + 4)) |= U32(EP_xIsSelect | EP_Subquery)
Xsqlite3ExprSetHeightAndFlags(tls, pParse, pExpr)
} else {
@@ -81544,23 +82569,86 @@ func Xsqlite3PExprAddSelect(tls *libc.TLS, pParse uintptr, pExpr uintptr, pSelec
}
}
+// Expression list pEList is a list of vector values. This function
+// converts the contents of pEList to a VALUES(...) Select statement
+// returning 1 row for each element of the list. For example, the
+// expression list:
+//
+// ( (1,2), (3,4) (5,6) )
+//
+// is translated to the equivalent of:
+//
+// VALUES(1,2), (3,4), (5,6)
+//
+// Each of the vector values in pEList must contain exactly nElem terms.
+// If a list element that is not a vector or does not contain nElem terms,
+// an error message is left in pParse.
+//
+// This is used as part of processing IN(...) expressions with a list
+// of vectors on the RHS. e.g. "... IN ((1,2), (3,4), (5,6))".
+func Xsqlite3ExprListToValues(tls *libc.TLS, pParse uintptr, nElem int32, pEList uintptr) uintptr { /* sqlite3.c:102619:23: */
+ bp := tls.Alloc(24)
+ defer tls.Free(24)
+
+ var ii int32
+ var pRet uintptr = uintptr(0)
+
+ for ii = 0; ii < (*ExprList)(unsafe.Pointer(pEList)).FnExpr; ii++ {
+ var pSel uintptr
+ var pExpr uintptr = (*ExprList_item)(unsafe.Pointer(pEList + 8 + uintptr(ii)*20)).FpExpr
+ var nExprElem int32
+ if int32((*Expr)(unsafe.Pointer(pExpr)).Fop) == TK_VECTOR {
+
+ nExprElem = (*ExprList)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pExpr + 20)))).FnExpr
+ } else {
+ nExprElem = 1
+ }
+ if nExprElem != nElem {
+ Xsqlite3ErrorMsg(tls, pParse, ts+7353, /* "IN(...) element ..." */
+ libc.VaList(bp, nExprElem, func() uintptr {
+ if nExprElem > 1 {
+ return ts + 7397 /* "s" */
+ }
+ return ts + 1543 /* "" */
+ }(), nElem))
+ break
+ }
+
+ pSel = Xsqlite3SelectNew(tls, pParse, *(*uintptr)(unsafe.Pointer(pExpr + 20)), uintptr(0), uintptr(0), uintptr(0), uintptr(0), uintptr(0), uint32(SF_Values), uintptr(0))
+ *(*uintptr)(unsafe.Pointer(pExpr + 20)) = uintptr(0)
+ if pSel != 0 {
+ if pRet != 0 {
+ (*Select)(unsafe.Pointer(pSel)).Fop = U8(TK_ALL)
+ (*Select)(unsafe.Pointer(pSel)).FpPrior = pRet
+ }
+ pRet = pSel
+ }
+ }
+
+ if pRet != 0 && (*Select)(unsafe.Pointer(pRet)).FpPrior != 0 {
+ *(*U32)(unsafe.Pointer(pRet + 4)) |= U32(SF_MultiValue)
+ }
+ Xsqlite3ExprListDelete(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, pEList)
+ return pRet
+}
+
// Join two expressions using an AND operator. If either expression is
// NULL, then just return the other expression.
//
// If one side or the other of the AND is known to be false, then instead
// of returning an AND expression, just return a constant expression with
// a value of false.
-func Xsqlite3ExprAnd(tls *libc.TLS, pParse uintptr, pLeft uintptr, pRight uintptr) uintptr { /* sqlite3.c:102181:21: */
+func Xsqlite3ExprAnd(tls *libc.TLS, pParse uintptr, pLeft uintptr, pRight uintptr) uintptr { /* sqlite3.c:102666:21: */
var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb
if pLeft == uintptr(0) {
return pRight
} else if pRight == uintptr(0) {
return pLeft
- } else if ((((*Expr)(unsafe.Pointer((pLeft))).Fflags & (U32(EP_FromJoin | EP_IsFalse))) == U32(EP_IsFalse)) || (((*Expr)(unsafe.Pointer((pRight))).Fflags & (U32(EP_FromJoin | EP_IsFalse))) == U32(EP_IsFalse))) &&
+ } else if ((*Expr)(unsafe.Pointer(pLeft)).Fflags&U32(EP_FromJoin|EP_IsFalse) == U32(EP_IsFalse) || (*Expr)(unsafe.Pointer(pRight)).Fflags&U32(EP_FromJoin|EP_IsFalse) == U32(EP_IsFalse)) &&
!(int32((*Parse)(unsafe.Pointer(pParse)).FeParseMode) >= PARSE_MODE_RENAME) {
Xsqlite3ExprDeferredDelete(tls, pParse, pLeft)
Xsqlite3ExprDeferredDelete(tls, pParse, pRight)
- return Xsqlite3Expr(tls, db, TK_INTEGER, ts+6506 /* "0" */)
+ return Xsqlite3Expr(tls, db, TK_INTEGER, ts+7399 /* "0" */)
} else {
return Xsqlite3PExpr(tls, pParse, TK_AND, pLeft, pRight)
}
@@ -81569,7 +82657,7 @@ func Xsqlite3ExprAnd(tls *libc.TLS, pParse uintptr, pLeft uintptr, pRight uintpt
// Construct a new expression node for a function with multiple
// arguments.
-func Xsqlite3ExprFunction(tls *libc.TLS, pParse uintptr, pList uintptr, pToken uintptr, eDistinct int32) uintptr { /* sqlite3.c:102202:21: */
+func Xsqlite3ExprFunction(tls *libc.TLS, pParse uintptr, pList uintptr, pToken uintptr, eDistinct int32) uintptr { /* sqlite3.c:102687:21: */
bp := tls.Alloc(8)
defer tls.Free(8)
@@ -81581,15 +82669,17 @@ func Xsqlite3ExprFunction(tls *libc.TLS, pParse uintptr, pList uintptr, pToken u
Xsqlite3ExprListDelete(tls, db, pList) // Avoid memory leak when malloc fails
return uintptr(0)
}
- if (pList != 0) && ((*ExprList)(unsafe.Pointer(pList)).FnExpr > *(*int32)(unsafe.Pointer(((*Parse)(unsafe.Pointer(pParse)).Fdb + 112 /* &.aLimit */) + 6*4))) {
- Xsqlite3ErrorMsg(tls, pParse, ts+6508 /* "too many argumen..." */, libc.VaList(bp, pToken))
+ if pList != 0 &&
+ (*ExprList)(unsafe.Pointer(pList)).FnExpr > *(*int32)(unsafe.Pointer((*Parse)(unsafe.Pointer(pParse)).Fdb + 120 + 6*4)) &&
+ !(int32((*Parse)(unsafe.Pointer(pParse)).Fnested) != 0) {
+ Xsqlite3ErrorMsg(tls, pParse, ts+7401 /* "too many argumen..." */, libc.VaList(bp, pToken))
}
- *(*uintptr)(unsafe.Pointer(pNew + 20 /* &.x */)) = pList
- *(*U32)(unsafe.Pointer(pNew + 4 /* &.flags */)) |= (U32(EP_HasFunc))
+ *(*uintptr)(unsafe.Pointer(pNew + 20)) = pList
+ *(*U32)(unsafe.Pointer(pNew + 4)) |= U32(EP_HasFunc)
Xsqlite3ExprSetHeightAndFlags(tls, pParse, pNew)
if eDistinct == SF_Distinct {
- *(*U32)(unsafe.Pointer(pNew + 4 /* &.flags */)) |= (U32(EP_Distinct))
+ *(*U32)(unsafe.Pointer(pNew + 4)) |= U32(EP_Distinct)
}
return pNew
}
@@ -81603,20 +82693,20 @@ func Xsqlite3ExprFunction(tls *libc.TLS, pParse uintptr, pList uintptr, pToken u
// top-level SQL
//
// If the function is not usable, create an error.
-func Xsqlite3ExprFunctionUsable(tls *libc.TLS, pParse uintptr, pExpr uintptr, pDef uintptr) { /* sqlite3.c:102238:21: */
+func Xsqlite3ExprFunctionUsable(tls *libc.TLS, pParse uintptr, pExpr uintptr, pDef uintptr) { /* sqlite3.c:102726:21: */
bp := tls.Alloc(8)
defer tls.Free(8)
- if ((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_FromDDL))) != U32(0) {
- if (((*FuncDef)(unsafe.Pointer(pDef)).FfuncFlags & U32(SQLITE_FUNC_DIRECT)) != U32(0)) ||
- (((*Sqlite3)(unsafe.Pointer((*Parse)(unsafe.Pointer(pParse)).Fdb)).Fflags & uint64(SQLITE_TrustedSchema)) == uint64(0)) {
+ if (*Expr)(unsafe.Pointer(pExpr)).Fflags&U32(EP_FromDDL) != U32(0) {
+ if (*FuncDef)(unsafe.Pointer(pDef)).FfuncFlags&U32(SQLITE_FUNC_DIRECT) != U32(0) ||
+ (*Sqlite3)(unsafe.Pointer((*Parse)(unsafe.Pointer(pParse)).Fdb)).Fflags&uint64(SQLITE_TrustedSchema) == uint64(0) {
// Functions prohibited in triggers and views if:
// (1) tagged with SQLITE_DIRECTONLY
// (2) not tagged with SQLITE_INNOCUOUS (which means it
// is tagged with SQLITE_FUNC_UNSAFE) and
// SQLITE_DBCONFIG_TRUSTED_SCHEMA is off (meaning
// that the schema is possibly tainted).
- Xsqlite3ErrorMsg(tls, pParse, ts+6542 /* "unsafe use of %s..." */, libc.VaList(bp, (*FuncDef)(unsafe.Pointer(pDef)).FzName))
+ Xsqlite3ErrorMsg(tls, pParse, ts+7435 /* "unsafe use of %s..." */, libc.VaList(bp, (*FuncDef)(unsafe.Pointer(pDef)).FzName))
}
}
}
@@ -81635,7 +82725,7 @@ func Xsqlite3ExprFunctionUsable(tls *libc.TLS, pParse uintptr, pExpr uintptr, pD
// as the previous instance of the same wildcard. Or if this is the first
// instance of the wildcard, the next sequential variable number is
// assigned.
-func Xsqlite3ExprAssignVarNumber(tls *libc.TLS, pParse uintptr, pExpr uintptr, n U32) { /* sqlite3.c:102277:21: */
+func Xsqlite3ExprAssignVarNumber(tls *libc.TLS, pParse uintptr, pExpr uintptr, n U32) { /* sqlite3.c:102765:21: */
bp := tls.Alloc(16)
defer tls.Free(16)
@@ -81647,7 +82737,7 @@ func Xsqlite3ExprAssignVarNumber(tls *libc.TLS, pParse uintptr, pExpr uintptr, n
return
}
- z = *(*uintptr)(unsafe.Pointer(pExpr + 8 /* &.u */))
+ z = *(*uintptr)(unsafe.Pointer(pExpr + 8))
if int32(*(*uint8)(unsafe.Pointer(z + 1))) == 0 {
// Wildcard of the form "?". Assign the next variable number
@@ -81662,15 +82752,15 @@ func Xsqlite3ExprAssignVarNumber(tls *libc.TLS, pParse uintptr, pExpr uintptr, n
var bOk int32
if n == U32(2) { //OPTIMIZATION-IF-TRUE
- *(*I64)(unsafe.Pointer(bp + 8 /* i */)) = (I64(int32(*(*uint8)(unsafe.Pointer(z + 1))) - '0')) // The common case of ?N for a single digit N
+ *(*I64)(unsafe.Pointer(bp + 8 /* i */)) = I64(int32(*(*uint8)(unsafe.Pointer(z + 1))) - '0') // The common case of ?N for a single digit N
bOk = 1
} else {
- bOk = (libc.Bool32(0 == Xsqlite3Atoi64(tls, (z+1), bp+8 /* &i */, (int32(n-U32(1))), uint8(SQLITE_UTF8))))
+ bOk = libc.Bool32(0 == Xsqlite3Atoi64(tls, z+1, bp+8, int32(n-U32(1)), uint8(SQLITE_UTF8)))
}
- if ((bOk == 0) || (*(*I64)(unsafe.Pointer(bp + 8 /* i */)) < int64(1))) || (*(*I64)(unsafe.Pointer(bp + 8 /* i */)) > I64(*(*int32)(unsafe.Pointer((db + 112 /* &.aLimit */) + 9*4)))) {
- Xsqlite3ErrorMsg(tls, pParse, ts+6561, /* "variable number ..." */
- libc.VaList(bp, *(*int32)(unsafe.Pointer((db + 112 /* &.aLimit */) + 9*4))))
+ if bOk == 0 || *(*I64)(unsafe.Pointer(bp + 8)) < int64(1) || *(*I64)(unsafe.Pointer(bp + 8)) > I64(*(*int32)(unsafe.Pointer(db + 120 + 9*4))) {
+ Xsqlite3ErrorMsg(tls, pParse, ts+7454, /* "variable number ..." */
+ libc.VaList(bp, *(*int32)(unsafe.Pointer(db + 120 + 9*4))))
return
}
x = YnVar(*(*I64)(unsafe.Pointer(bp + 8 /* i */)))
@@ -81695,44 +82785,43 @@ func Xsqlite3ExprAssignVarNumber(tls *libc.TLS, pParse uintptr, pExpr uintptr, n
}
}
(*Expr)(unsafe.Pointer(pExpr)).FiColumn = x
- if int32(x) > *(*int32)(unsafe.Pointer((db + 112 /* &.aLimit */) + 9*4)) {
- Xsqlite3ErrorMsg(tls, pParse, ts+6604 /* "too many SQL var..." */, 0)
+ if int32(x) > *(*int32)(unsafe.Pointer(db + 120 + 9*4)) {
+ Xsqlite3ErrorMsg(tls, pParse, ts+7497 /* "too many SQL var..." */, 0)
}
}
// Recursively delete an expression tree.
-func sqlite3ExprDeleteNN(tls *libc.TLS, db uintptr, p uintptr) { /* sqlite3.c:102345:29: */
-
- // Sanity check: Assert that the IntValue is non-negative if it exists
+func sqlite3ExprDeleteNN(tls *libc.TLS, db uintptr, p uintptr) { /* sqlite3.c:102833:29: */
- if !(((*Expr)(unsafe.Pointer((p))).Fflags & (U32(EP_TokenOnly | EP_Leaf))) != U32(0)) {
+ if !((*Expr)(unsafe.Pointer(p)).Fflags&U32(EP_TokenOnly|EP_Leaf) != U32(0)) {
// The Expr.x union is never used at the same time as Expr.pRight
- if ((*Expr)(unsafe.Pointer(p)).FpLeft != 0) && (int32((*Expr)(unsafe.Pointer(p)).Fop) != TK_SELECT_COLUMN) {
+ if (*Expr)(unsafe.Pointer(p)).FpLeft != 0 && int32((*Expr)(unsafe.Pointer(p)).Fop) != TK_SELECT_COLUMN {
sqlite3ExprDeleteNN(tls, db, (*Expr)(unsafe.Pointer(p)).FpLeft)
}
if (*Expr)(unsafe.Pointer(p)).FpRight != 0 {
sqlite3ExprDeleteNN(tls, db, (*Expr)(unsafe.Pointer(p)).FpRight)
- } else if ((*Expr)(unsafe.Pointer((p))).Fflags & (U32(EP_xIsSelect))) != U32(0) {
+ } else if (*Expr)(unsafe.Pointer(p)).Fflags&U32(EP_xIsSelect) != U32(0) {
- Xsqlite3SelectDelete(tls, db, *(*uintptr)(unsafe.Pointer(p + 20 /* &.x */)))
+ Xsqlite3SelectDelete(tls, db, *(*uintptr)(unsafe.Pointer(p + 20)))
} else {
- Xsqlite3ExprListDelete(tls, db, *(*uintptr)(unsafe.Pointer(p + 20 /* &.x */)))
- if ((*Expr)(unsafe.Pointer((p))).Fflags & (U32(EP_WinFunc))) != U32(0) {
- Xsqlite3WindowDelete(tls, db, *(*uintptr)(unsafe.Pointer(p + 44 /* &.y */)))
+ Xsqlite3ExprListDelete(tls, db, *(*uintptr)(unsafe.Pointer(p + 20)))
+ if (*Expr)(unsafe.Pointer(p)).Fflags&U32(EP_WinFunc) != U32(0) {
+ Xsqlite3WindowDelete(tls, db, *(*uintptr)(unsafe.Pointer(p + 44)))
}
}
}
- if ((*Expr)(unsafe.Pointer((p))).Fflags & (U32(EP_MemToken))) != U32(0) {
- Xsqlite3DbFree(tls, db, *(*uintptr)(unsafe.Pointer(p + 8 /* &.u */)))
+ if (*Expr)(unsafe.Pointer(p)).Fflags&U32(EP_MemToken) != U32(0) {
+
+ Xsqlite3DbFree(tls, db, *(*uintptr)(unsafe.Pointer(p + 8)))
}
- if !(((*Expr)(unsafe.Pointer((p))).Fflags & (U32(EP_Static))) != U32(0)) {
+ if !((*Expr)(unsafe.Pointer(p)).Fflags&U32(EP_Static) != U32(0)) {
Xsqlite3DbFreeNN(tls, db, p)
}
}
-func Xsqlite3ExprDelete(tls *libc.TLS, db uintptr, p uintptr) { /* sqlite3.c:102384:21: */
+func Xsqlite3ExprDelete(tls *libc.TLS, db uintptr, p uintptr) { /* sqlite3.c:102874:21: */
if p != 0 {
sqlite3ExprDeleteNN(tls, db, p)
}
@@ -81746,13 +82835,13 @@ func Xsqlite3ExprDelete(tls *libc.TLS, db uintptr, p uintptr) { /* sqlite3.c:102
//
// The deferred delete is (currently) implemented by adding the
// pExpr to the pParse->pConstExpr list with a register number of 0.
-func Xsqlite3ExprDeferredDelete(tls *libc.TLS, pParse uintptr, pExpr uintptr) { /* sqlite3.c:102399:21: */
+func Xsqlite3ExprDeferredDelete(tls *libc.TLS, pParse uintptr, pExpr uintptr) { /* sqlite3.c:102889:21: */
(*Parse)(unsafe.Pointer(pParse)).FpConstExpr = Xsqlite3ExprListAppend(tls, pParse, (*Parse)(unsafe.Pointer(pParse)).FpConstExpr, pExpr)
}
// Invoke sqlite3RenameExprUnmap() and sqlite3ExprDelete() on the
// expression.
-func Xsqlite3ExprUnmapAndDelete(tls *libc.TLS, pParse uintptr, p uintptr) { /* sqlite3.c:102407:21: */
+func Xsqlite3ExprUnmapAndDelete(tls *libc.TLS, pParse uintptr, p uintptr) { /* sqlite3.c:102897:21: */
if p != 0 {
if int32((*Parse)(unsafe.Pointer(pParse)).FeParseMode) >= PARSE_MODE_RENAME {
Xsqlite3RenameExprUnmap(tls, pParse, p)
@@ -81764,12 +82853,12 @@ func Xsqlite3ExprUnmapAndDelete(tls *libc.TLS, pParse uintptr, p uintptr) { /* s
// Return the number of bytes allocated for the expression structure
// passed as the first argument. This is always one of EXPR_FULLSIZE,
// EXPR_REDUCEDSIZE or EXPR_TOKENONLYSIZE.
-func exprStructSize(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:102421:12: */
- if ((*Expr)(unsafe.Pointer((p))).Fflags & (U32(EP_TokenOnly))) != U32(0) {
- return int32((uintptr(0) + 12 /* &.pLeft */))
+func exprStructSize(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:102911:12: */
+ if (*Expr)(unsafe.Pointer(p)).Fflags&U32(EP_TokenOnly) != U32(0) {
+ return int32(uintptr(0) + 12)
}
- if ((*Expr)(unsafe.Pointer((p))).Fflags & (U32(EP_Reduced))) != U32(0) {
- return int32((uintptr(0) + 28 /* &.iTable */))
+ if (*Expr)(unsafe.Pointer(p)).Fflags&U32(EP_Reduced) != U32(0) {
+ return int32(uintptr(0) + 28)
}
return int32(unsafe.Sizeof(Expr{}))
}
@@ -81806,20 +82895,20 @@ func exprStructSize(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:102421:12: */
// to reduce a pristine expression tree from the parser. The implementation
// of dupedExprStructSize() contain multiple assert() statements that attempt
// to enforce this constraint.
-func dupedExprStructSize(tls *libc.TLS, p uintptr, flags int32) int32 { /* sqlite3.c:102461:12: */
+func dupedExprStructSize(tls *libc.TLS, p uintptr, flags int32) int32 { /* sqlite3.c:102951:12: */
var nSize int32
// Only one flag value allowed
- if ((0 == flags) || (int32((*Expr)(unsafe.Pointer(p)).Fop) == TK_SELECT_COLUMN)) ||
- (((*Expr)(unsafe.Pointer((p))).Fflags & (U32(EP_WinFunc))) != U32(0)) {
+ if 0 == flags || int32((*Expr)(unsafe.Pointer(p)).Fop) == TK_SELECT_COLUMN ||
+ (*Expr)(unsafe.Pointer(p)).Fflags&U32(EP_WinFunc) != U32(0) {
nSize = int32(unsafe.Sizeof(Expr{}))
} else {
- if ((*Expr)(unsafe.Pointer(p)).FpLeft != 0) || (*(*uintptr)(unsafe.Pointer(p + 20 /* &.x */)) != 0) {
- nSize = (int32((uint32((uintptr(0) + 28 /* &.iTable */))) | uint32(EP_Reduced)))
+ if (*Expr)(unsafe.Pointer(p)).FpLeft != 0 || *(*uintptr)(unsafe.Pointer(p + 20)) != 0 {
+ nSize = int32(uint32(uintptr(0)+28) | uint32(EP_Reduced))
} else {
- nSize = (int32((uint32((uintptr(0) + 12 /* &.pLeft */))) | uint32(EP_TokenOnly)))
+ nSize = int32(uint32(uintptr(0)+12) | uint32(EP_TokenOnly))
}
}
return nSize
@@ -81828,12 +82917,12 @@ func dupedExprStructSize(tls *libc.TLS, p uintptr, flags int32) int32 { /* sqlit
// This function returns the space in bytes required to store the copy
// of the Expr structure and a copy of the Expr.u.zToken string (if that
// string is defined.)
-func dupedExprNodeSize(tls *libc.TLS, p uintptr, flags int32) int32 { /* sqlite3.c:102492:12: */
- var nByte int32 = (dupedExprStructSize(tls, p, flags) & 0xfff)
- if !(((*Expr)(unsafe.Pointer((p))).Fflags & (U32(EP_IntValue))) != U32(0)) && (*(*uintptr)(unsafe.Pointer(p + 8 /* &.u */)) != 0) {
- nByte = int32(Size_t(nByte) + ((libc.Xstrlen(tls, *(*uintptr)(unsafe.Pointer(p + 8 /* &.u */))) & Size_t(0x3fffffff)) + Size_t(1)))
+func dupedExprNodeSize(tls *libc.TLS, p uintptr, flags int32) int32 { /* sqlite3.c:102982:12: */
+ var nByte int32 = dupedExprStructSize(tls, p, flags) & 0xfff
+ if !((*Expr)(unsafe.Pointer(p)).Fflags&U32(EP_IntValue) != U32(0)) && *(*uintptr)(unsafe.Pointer(p + 8)) != 0 {
+ nByte = int32(Size_t(nByte) + (libc.Xstrlen(tls, *(*uintptr)(unsafe.Pointer(p + 8)))&Size_t(0x3fffffff) + Size_t(1)))
}
- return (((nByte) + 7) & libc.CplInt32(7))
+ return (nByte + 7) & libc.CplInt32(7)
}
// Return the number of bytes required to create a duplicate of the
@@ -81847,11 +82936,11 @@ func dupedExprNodeSize(tls *libc.TLS, p uintptr, flags int32) int32 { /* sqlite3
// space to duplicate all Expr nodes in the tree formed by Expr.pLeft
// and Expr.pRight variables (but not for any structures pointed to or
// descended from the Expr.x.pList or Expr.x.pSelect variables).
-func dupedExprSize(tls *libc.TLS, p uintptr, flags int32) int32 { /* sqlite3.c:102513:12: */
+func dupedExprSize(tls *libc.TLS, p uintptr, flags int32) int32 { /* sqlite3.c:103003:12: */
var nByte int32 = 0
if p != 0 {
nByte = dupedExprNodeSize(tls, p, flags)
- if (flags & EXPRDUP_REDUCE) != 0 {
+ if flags&EXPRDUP_REDUCE != 0 {
nByte = nByte + (dupedExprSize(tls, (*Expr)(unsafe.Pointer(p)).FpLeft, flags) + dupedExprSize(tls, (*Expr)(unsafe.Pointer(p)).FpRight, flags))
}
}
@@ -81864,7 +82953,7 @@ func dupedExprSize(tls *libc.TLS, p uintptr, flags int32) int32 { /* sqlite3.c:1
// (if applicable), and the copies of the p->pLeft and p->pRight expressions,
// if any. Before returning, *pzBuffer is set to the first byte past the
// portion of the buffer copied into by this function.
-func exprDup(tls *libc.TLS, db uintptr, p uintptr, dupFlags int32, pzBuffer uintptr) uintptr { /* sqlite3.c:102532:13: */
+func exprDup(tls *libc.TLS, db uintptr, p uintptr, dupFlags int32, pzBuffer uintptr) uintptr { /* sqlite3.c:103022:13: */
bp := tls.Alloc(4)
defer tls.Free(4)
@@ -81890,10 +82979,10 @@ func exprDup(tls *libc.TLS, db uintptr, p uintptr, dupFlags int32, pzBuffer uint
// EXPR_TOKENONLYSIZE. nToken is set to the number of bytes consumed
// by the copy of the p->u.zToken string (if any).
var nStructSize uint32 = uint32(dupedExprStructSize(tls, p, dupFlags))
- var nNewSize int32 = (int32(nStructSize & uint32(0xfff)))
+ var nNewSize int32 = int32(nStructSize & uint32(0xfff))
var nToken int32
- if !(((*Expr)(unsafe.Pointer((p))).Fflags & (U32(EP_IntValue))) != U32(0)) && (*(*uintptr)(unsafe.Pointer(p + 8 /* &.u */)) != 0) {
- nToken = (Xsqlite3Strlen30(tls, *(*uintptr)(unsafe.Pointer(p + 8 /* &.u */))) + 1)
+ if !((*Expr)(unsafe.Pointer(p)).Fflags&U32(EP_IntValue) != U32(0)) && *(*uintptr)(unsafe.Pointer(p + 8)) != 0 {
+ nToken = Xsqlite3Strlen30(tls, *(*uintptr)(unsafe.Pointer(p + 8))) + 1
} else {
nToken = 0
}
@@ -81903,15 +82992,15 @@ func exprDup(tls *libc.TLS, db uintptr, p uintptr, dupFlags int32, pzBuffer uint
} else {
var nSize U32 = U32(exprStructSize(tls, p))
libc.Xmemcpy(tls, *(*uintptr)(unsafe.Pointer(bp /* zAlloc */)), p, nSize)
- if (nSize < U32(unsafe.Sizeof(Expr{}))) {
- libc.Xmemset(tls, (*(*uintptr)(unsafe.Pointer(bp /* zAlloc */)) + uintptr(nSize)), 0, (uint32(unsafe.Sizeof(Expr{})) - nSize))
+ if nSize < U32(unsafe.Sizeof(Expr{})) {
+ libc.Xmemset(tls, *(*uintptr)(unsafe.Pointer(bp))+uintptr(nSize), 0, uint32(unsafe.Sizeof(Expr{}))-nSize)
}
}
// Set the EP_Reduced, EP_TokenOnly, and EP_Static flags appropriately.
- *(*U32)(unsafe.Pointer(pNew + 4 /* &.flags */)) &= (libc.Uint32FromInt32(libc.CplInt32((((EP_Reduced | EP_TokenOnly) | EP_Static) | EP_MemToken))))
- *(*U32)(unsafe.Pointer(pNew + 4 /* &.flags */)) |= (nStructSize & (uint32(EP_Reduced | EP_TokenOnly)))
- *(*U32)(unsafe.Pointer(pNew + 4 /* &.flags */)) |= (staticFlag)
+ *(*U32)(unsafe.Pointer(pNew + 4)) &= libc.Uint32FromInt32(libc.CplInt32(EP_Reduced | EP_TokenOnly | EP_Static | EP_MemToken))
+ *(*U32)(unsafe.Pointer(pNew + 4)) |= nStructSize & uint32(EP_Reduced|EP_TokenOnly)
+ *(*U32)(unsafe.Pointer(pNew + 4)) |= staticFlag
if dupFlags != 0 {
@@ -81919,23 +83008,23 @@ func exprDup(tls *libc.TLS, db uintptr, p uintptr, dupFlags int32, pzBuffer uint
// Copy the p->u.zToken string, if any.
if nToken != 0 {
- var zToken uintptr = libc.AssignPtrUintptr(pNew+8 /* &.u */ /* &.zToken */, (*(*uintptr)(unsafe.Pointer(bp /* zAlloc */)) + uintptr(nNewSize)))
- libc.Xmemcpy(tls, zToken, *(*uintptr)(unsafe.Pointer(p + 8 /* &.u */)), uint32(nToken))
+ var zToken uintptr = libc.AssignPtrUintptr(pNew+8, *(*uintptr)(unsafe.Pointer(bp))+uintptr(nNewSize))
+ libc.Xmemcpy(tls, zToken, *(*uintptr)(unsafe.Pointer(p + 8)), uint32(nToken))
}
- if U32(0) == (((*Expr)(unsafe.Pointer(p)).Fflags | (*Expr)(unsafe.Pointer(pNew)).Fflags) & (U32(EP_TokenOnly | EP_Leaf))) {
+ if U32(0) == ((*Expr)(unsafe.Pointer(p)).Fflags|(*Expr)(unsafe.Pointer(pNew)).Fflags)&U32(EP_TokenOnly|EP_Leaf) {
// Fill in the pNew->x.pSelect or pNew->x.pList member.
- if ((*Expr)(unsafe.Pointer((p))).Fflags & (U32(EP_xIsSelect))) != U32(0) {
- *(*uintptr)(unsafe.Pointer(pNew + 20 /* &.x */)) = Xsqlite3SelectDup(tls, db, *(*uintptr)(unsafe.Pointer(p + 20 /* &.x */)), dupFlags)
+ if (*Expr)(unsafe.Pointer(p)).Fflags&U32(EP_xIsSelect) != U32(0) {
+ *(*uintptr)(unsafe.Pointer(pNew + 20)) = Xsqlite3SelectDup(tls, db, *(*uintptr)(unsafe.Pointer(p + 20)), dupFlags)
} else {
- *(*uintptr)(unsafe.Pointer(pNew + 20 /* &.x */)) = Xsqlite3ExprListDup(tls, db, *(*uintptr)(unsafe.Pointer(p + 20 /* &.x */)), dupFlags)
+ *(*uintptr)(unsafe.Pointer(pNew + 20)) = Xsqlite3ExprListDup(tls, db, *(*uintptr)(unsafe.Pointer(p + 20)), dupFlags)
}
}
// Fill in pNew->pLeft and pNew->pRight.
- if ((*Expr)(unsafe.Pointer((pNew))).Fflags & (U32((EP_Reduced | EP_TokenOnly) | EP_WinFunc))) != U32(0) {
+ if (*Expr)(unsafe.Pointer(pNew)).Fflags&U32(EP_Reduced|EP_TokenOnly|EP_WinFunc) != U32(0) {
*(*uintptr)(unsafe.Pointer(bp /* zAlloc */)) += uintptr(dupedExprNodeSize(tls, p, dupFlags))
- if !(((*Expr)(unsafe.Pointer((pNew))).Fflags & (U32(EP_TokenOnly | EP_Leaf))) != U32(0)) {
+ if !((*Expr)(unsafe.Pointer(pNew)).Fflags&U32(EP_TokenOnly|EP_Leaf) != U32(0)) {
(*Expr)(unsafe.Pointer(pNew)).FpLeft = func() uintptr {
if (*Expr)(unsafe.Pointer(p)).FpLeft != 0 {
return exprDup(tls, db, (*Expr)(unsafe.Pointer(p)).FpLeft, EXPRDUP_REDUCE, bp /* &zAlloc */)
@@ -81949,15 +83038,15 @@ func exprDup(tls *libc.TLS, db uintptr, p uintptr, dupFlags int32, pzBuffer uint
return uintptr(0)
}()
}
- if ((*Expr)(unsafe.Pointer((p))).Fflags & (U32(EP_WinFunc))) != U32(0) {
- *(*uintptr)(unsafe.Pointer(pNew + 44 /* &.y */)) = Xsqlite3WindowDup(tls, db, pNew, *(*uintptr)(unsafe.Pointer(p + 44 /* &.y */)))
+ if (*Expr)(unsafe.Pointer(p)).Fflags&U32(EP_WinFunc) != U32(0) {
+ *(*uintptr)(unsafe.Pointer(pNew + 44)) = Xsqlite3WindowDup(tls, db, pNew, *(*uintptr)(unsafe.Pointer(p + 44)))
}
if pzBuffer != 0 {
*(*uintptr)(unsafe.Pointer(pzBuffer)) = *(*uintptr)(unsafe.Pointer(bp /* zAlloc */))
}
} else {
- if !(((*Expr)(unsafe.Pointer((p))).Fflags & (U32(EP_TokenOnly | EP_Leaf))) != U32(0)) {
+ if !((*Expr)(unsafe.Pointer(p)).Fflags&U32(EP_TokenOnly|EP_Leaf) != U32(0)) {
if int32((*Expr)(unsafe.Pointer(pNew)).Fop) == TK_SELECT_COLUMN {
(*Expr)(unsafe.Pointer(pNew)).FpLeft = (*Expr)(unsafe.Pointer(p)).FpLeft
@@ -81974,18 +83063,18 @@ func exprDup(tls *libc.TLS, db uintptr, p uintptr, dupFlags int32, pzBuffer uint
// Create and return a deep copy of the object passed as the second
// argument. If an OOM condition is encountered, NULL is returned
// and the db->mallocFailed flag set.
-func Xsqlite3WithDup(tls *libc.TLS, db uintptr, p uintptr) uintptr { /* sqlite3.c:102643:21: */
+func Xsqlite3WithDup(tls *libc.TLS, db uintptr, p uintptr) uintptr { /* sqlite3.c:103132:21: */
var pRet uintptr = uintptr(0)
if p != 0 {
- var nByte Sqlite3_int64 = (Sqlite3_int64(uint32(unsafe.Sizeof(With{})) + (uint32(unsafe.Sizeof(Cte{})) * (uint32((*With)(unsafe.Pointer(p)).FnCte - 1)))))
+ var nByte Sqlite3_int64 = Sqlite3_int64(uint32(unsafe.Sizeof(With{})) + uint32(unsafe.Sizeof(Cte{}))*uint32((*With)(unsafe.Pointer(p)).FnCte-1))
pRet = Xsqlite3DbMallocZero(tls, db, uint64(nByte))
if pRet != 0 {
var i int32
(*With)(unsafe.Pointer(pRet)).FnCte = (*With)(unsafe.Pointer(p)).FnCte
for i = 0; i < (*With)(unsafe.Pointer(p)).FnCte; i++ {
- (*Cte)(unsafe.Pointer((pRet + 12 /* &.a */) + uintptr(i)*24)).FpSelect = Xsqlite3SelectDup(tls, db, (*Cte)(unsafe.Pointer((p+12 /* &.a */)+uintptr(i)*24)).FpSelect, 0)
- (*Cte)(unsafe.Pointer((pRet + 12 /* &.a */) + uintptr(i)*24)).FpCols = Xsqlite3ExprListDup(tls, db, (*Cte)(unsafe.Pointer((p+12 /* &.a */)+uintptr(i)*24)).FpCols, 0)
- (*Cte)(unsafe.Pointer((pRet + 12 /* &.a */) + uintptr(i)*24)).FzName = Xsqlite3DbStrDup(tls, db, (*Cte)(unsafe.Pointer((p+12 /* &.a */)+uintptr(i)*24)).FzName)
+ (*Cte)(unsafe.Pointer(pRet + 12 + uintptr(i)*24)).FpSelect = Xsqlite3SelectDup(tls, db, (*Cte)(unsafe.Pointer(p+12+uintptr(i)*24)).FpSelect, 0)
+ (*Cte)(unsafe.Pointer(pRet + 12 + uintptr(i)*24)).FpCols = Xsqlite3ExprListDup(tls, db, (*Cte)(unsafe.Pointer(p+12+uintptr(i)*24)).FpCols, 0)
+ (*Cte)(unsafe.Pointer(pRet + 12 + uintptr(i)*24)).FzName = Xsqlite3DbStrDup(tls, db, (*Cte)(unsafe.Pointer(p+12+uintptr(i)*24)).FzName)
}
}
}
@@ -81996,24 +83085,24 @@ func Xsqlite3WithDup(tls *libc.TLS, db uintptr, p uintptr) uintptr { /* sqlite3.
// gatherSelectWindowsCallback() are used to scan all the expressions
// an a newly duplicated SELECT statement and gather all of the Window
// objects found there, assembling them onto the linked list at Select->pWin.
-func gatherSelectWindowsCallback(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 { /* sqlite3.c:102671:12: */
- if (int32((*Expr)(unsafe.Pointer(pExpr)).Fop) == TK_FUNCTION) && (((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_WinFunc))) != U32(0)) {
- var pSelect uintptr = *(*uintptr)(unsafe.Pointer(pWalker + 24 /* &.u */))
- var pWin uintptr = *(*uintptr)(unsafe.Pointer(pExpr + 44 /* &.y */))
+func gatherSelectWindowsCallback(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 { /* sqlite3.c:103160:12: */
+ if int32((*Expr)(unsafe.Pointer(pExpr)).Fop) == TK_FUNCTION && (*Expr)(unsafe.Pointer(pExpr)).Fflags&U32(EP_WinFunc) != U32(0) {
+ var pSelect uintptr = *(*uintptr)(unsafe.Pointer(pWalker + 24))
+ var pWin uintptr = *(*uintptr)(unsafe.Pointer(pExpr + 44))
Xsqlite3WindowLink(tls, pSelect, pWin)
}
return WRC_Continue
}
-func gatherSelectWindowsSelectCallback(tls *libc.TLS, pWalker uintptr, p uintptr) int32 { /* sqlite3.c:102682:12: */
- if p == *(*uintptr)(unsafe.Pointer(pWalker + 24 /* &.u */)) {
+func gatherSelectWindowsSelectCallback(tls *libc.TLS, pWalker uintptr, p uintptr) int32 { /* sqlite3.c:103171:12: */
+ if p == *(*uintptr)(unsafe.Pointer(pWalker + 24)) {
return WRC_Continue
}
return WRC_Prune
}
-func gatherSelectWindows(tls *libc.TLS, p uintptr) { /* sqlite3.c:102685:13: */
+func gatherSelectWindows(tls *libc.TLS, p uintptr) { /* sqlite3.c:103174:13: */
bp := tls.Alloc(28)
defer tls.Free(28)
@@ -82027,7 +83116,7 @@ func gatherSelectWindows(tls *libc.TLS, p uintptr) { /* sqlite3.c:102685:13: */
}{gatherSelectWindowsSelectCallback}))
(*Walker)(unsafe.Pointer(bp /* &w */)).FxSelectCallback2 = uintptr(0)
(*Walker)(unsafe.Pointer(bp /* &w */)).FpParse = uintptr(0)
- *(*uintptr)(unsafe.Pointer(bp /* &w */ + 24 /* &.u */)) = p
+ *(*uintptr)(unsafe.Pointer(bp + 24)) = p
Xsqlite3WalkSelect(tls, bp /* &w */, p)
}
@@ -82046,7 +83135,7 @@ func gatherSelectWindows(tls *libc.TLS, p uintptr) { /* sqlite3.c:102685:13: */
// If the EXPRDUP_REDUCE flag is set, then the structure returned is a
// truncated version of the usual Expr structure that will be stored as
// part of the in-memory representation of the database schema.
-func Xsqlite3ExprDup(tls *libc.TLS, db uintptr, p uintptr, flags int32) uintptr { /* sqlite3.c:102714:21: */
+func Xsqlite3ExprDup(tls *libc.TLS, db uintptr, p uintptr, flags int32) uintptr { /* sqlite3.c:103203:21: */
if p != 0 {
return exprDup(tls, db, p, flags, uintptr(0))
@@ -82054,12 +83143,13 @@ func Xsqlite3ExprDup(tls *libc.TLS, db uintptr, p uintptr, flags int32) uintptr
return uintptr(0)
}
-func Xsqlite3ExprListDup(tls *libc.TLS, db uintptr, p uintptr, flags int32) uintptr { /* sqlite3.c:102718:25: */
+func Xsqlite3ExprListDup(tls *libc.TLS, db uintptr, p uintptr, flags int32) uintptr { /* sqlite3.c:103207:25: */
var pNew uintptr
var pItem uintptr
var pOldItem uintptr
var i int32
- var pPriorSelectCol uintptr = uintptr(0)
+ var pPriorSelectColOld uintptr = uintptr(0)
+ var pPriorSelectColNew uintptr = uintptr(0)
if p == uintptr(0) {
return uintptr(0)
@@ -82081,24 +83171,28 @@ __1:
var pOldExpr uintptr = (*ExprList_item)(unsafe.Pointer(pOldItem)).FpExpr
var pNewExpr uintptr
(*ExprList_item)(unsafe.Pointer(pItem)).FpExpr = Xsqlite3ExprDup(tls, db, pOldExpr, flags)
- if ((pOldExpr != 0) &&
- (int32((*Expr)(unsafe.Pointer(pOldExpr)).Fop) == TK_SELECT_COLUMN)) &&
- ((libc.AssignUintptr(&pNewExpr, (*ExprList_item)(unsafe.Pointer(pItem)).FpExpr)) != uintptr(0)) {
-
- if int32((*Expr)(unsafe.Pointer(pNewExpr)).FiColumn) == 0 {
-
- pPriorSelectCol = libc.AssignPtrUintptr(pNewExpr+12 /* &.pLeft */, (*Expr)(unsafe.Pointer(pNewExpr)).FpRight)
+ if pOldExpr != 0 &&
+ int32((*Expr)(unsafe.Pointer(pOldExpr)).Fop) == TK_SELECT_COLUMN &&
+ libc.AssignUintptr(&pNewExpr, (*ExprList_item)(unsafe.Pointer(pItem)).FpExpr) != uintptr(0) {
+ if (*Expr)(unsafe.Pointer(pNewExpr)).FpRight != 0 {
+ pPriorSelectColOld = (*Expr)(unsafe.Pointer(pOldExpr)).FpRight
+ pPriorSelectColNew = (*Expr)(unsafe.Pointer(pNewExpr)).FpRight
+ (*Expr)(unsafe.Pointer(pNewExpr)).FpLeft = (*Expr)(unsafe.Pointer(pNewExpr)).FpRight
} else {
-
- (*Expr)(unsafe.Pointer(pNewExpr)).FpLeft = pPriorSelectCol
+ if (*Expr)(unsafe.Pointer(pOldExpr)).FpLeft != pPriorSelectColOld {
+ pPriorSelectColOld = (*Expr)(unsafe.Pointer(pOldExpr)).FpLeft
+ pPriorSelectColNew = Xsqlite3ExprDup(tls, db, pPriorSelectColOld, flags)
+ (*Expr)(unsafe.Pointer(pNewExpr)).FpRight = pPriorSelectColNew
+ }
+ (*Expr)(unsafe.Pointer(pNewExpr)).FpLeft = pPriorSelectColNew
}
}
(*ExprList_item)(unsafe.Pointer(pItem)).FzEName = Xsqlite3DbStrDup(tls, db, (*ExprList_item)(unsafe.Pointer(pOldItem)).FzEName)
(*ExprList_item)(unsafe.Pointer(pItem)).FsortFlags = (*ExprList_item)(unsafe.Pointer(pOldItem)).FsortFlags
- libc.SetBitFieldPtr8Uint32(pItem+12 /* &.eEName */, (uint32(int32(*(*uint8)(unsafe.Pointer(pOldItem + 12 /* &.eEName */)) & 0x3 >> 0))), 0, 0x3)
- libc.SetBitFieldPtr8Uint32(pItem+12 /* &.done */, uint32(0), 2, 0x4)
- libc.SetBitFieldPtr8Uint32(pItem+12 /* &.bNulls */, (uint32(int32(*(*uint8)(unsafe.Pointer(pOldItem + 12 /* &.bNulls */)) & 0x20 >> 5))), 5, 0x20)
- libc.SetBitFieldPtr8Uint32(pItem+12 /* &.bSorterRef */, (uint32(int32(*(*uint8)(unsafe.Pointer(pOldItem + 12 /* &.bSorterRef */)) & 0x10 >> 4))), 4, 0x10)
+ libc.SetBitFieldPtr8Uint32(pItem+12, uint32(int32(*(*uint8)(unsafe.Pointer(pOldItem + 12))&0x3>>0)), 0, 0x3)
+ libc.SetBitFieldPtr8Uint32(pItem+12, uint32(0), 2, 0x4)
+ libc.SetBitFieldPtr8Uint32(pItem+12, uint32(int32(*(*uint8)(unsafe.Pointer(pOldItem + 12))&0x20>>5)), 5, 0x20)
+ libc.SetBitFieldPtr8Uint32(pItem+12, uint32(int32(*(*uint8)(unsafe.Pointer(pOldItem + 12))&0x10>>4)), 4, 0x10)
(*ExprList_item)(unsafe.Pointer(pItem)).Fu = (*ExprList_item)(unsafe.Pointer(pOldItem)).Fu
}
@@ -82118,7 +83212,7 @@ __3:
// the build, then none of the following routines, except for
// sqlite3SelectDup(), can be called. sqlite3SelectDup() is sometimes
// called with a NULL argument.
-func Xsqlite3SrcListDup(tls *libc.TLS, db uintptr, p uintptr, flags int32) uintptr { /* sqlite3.c:102771:24: */
+func Xsqlite3SrcListDup(tls *libc.TLS, db uintptr, p uintptr, flags int32) uintptr { /* sqlite3.c:103262:24: */
var pNew uintptr
var i int32
var nByte int32
@@ -82126,20 +83220,20 @@ func Xsqlite3SrcListDup(tls *libc.TLS, db uintptr, p uintptr, flags int32) uintp
if p == uintptr(0) {
return uintptr(0)
}
- nByte = (int32(uint32(unsafe.Sizeof(SrcList{})) + (func() uint32 {
+ nByte = int32(uint32(unsafe.Sizeof(SrcList{})) + func() uint32 {
if (*SrcList)(unsafe.Pointer(p)).FnSrc > 0 {
- return (uint32(unsafe.Sizeof(SrcItem{})) * (uint32((*SrcList)(unsafe.Pointer(p)).FnSrc - 1)))
+ return uint32(unsafe.Sizeof(SrcItem{})) * uint32((*SrcList)(unsafe.Pointer(p)).FnSrc-1)
}
return uint32(0)
- }())))
+ }())
pNew = Xsqlite3DbMallocRawNN(tls, db, uint64(nByte))
if pNew == uintptr(0) {
return uintptr(0)
}
- (*SrcList)(unsafe.Pointer(pNew)).FnSrc = int32(libc.AssignPtrUint32(pNew+4 /* &.nAlloc */, U32((*SrcList)(unsafe.Pointer(p)).FnSrc)))
+ (*SrcList)(unsafe.Pointer(pNew)).FnSrc = int32(libc.AssignPtrUint32(pNew+4, U32((*SrcList)(unsafe.Pointer(p)).FnSrc)))
for i = 0; i < (*SrcList)(unsafe.Pointer(p)).FnSrc; i++ {
- var pNewItem uintptr = ((pNew + 8 /* &.a */) + uintptr(i)*72)
- var pOldItem uintptr = ((p + 8 /* &.a */) + uintptr(i)*72)
+ var pNewItem uintptr = pNew + 8 + uintptr(i)*72
+ var pOldItem uintptr = p + 8 + uintptr(i)*72
var pTab uintptr
(*SrcItem)(unsafe.Pointer(pNewItem)).FpSchema = (*SrcItem)(unsafe.Pointer(pOldItem)).FpSchema
(*SrcItem)(unsafe.Pointer(pNewItem)).FzDatabase = Xsqlite3DbStrDup(tls, db, (*SrcItem)(unsafe.Pointer(pOldItem)).FzDatabase)
@@ -82149,17 +83243,17 @@ func Xsqlite3SrcListDup(tls *libc.TLS, db uintptr, p uintptr, flags int32) uintp
(*SrcItem)(unsafe.Pointer(pNewItem)).FiCursor = (*SrcItem)(unsafe.Pointer(pOldItem)).FiCursor
(*SrcItem)(unsafe.Pointer(pNewItem)).FaddrFillSub = (*SrcItem)(unsafe.Pointer(pOldItem)).FaddrFillSub
(*SrcItem)(unsafe.Pointer(pNewItem)).FregReturn = (*SrcItem)(unsafe.Pointer(pOldItem)).FregReturn
- if (uint32(int32(*(*uint16)(unsafe.Pointer(pNewItem + 36 /* &.fg */ + 4 /* &.isIndexedBy */)) & 0x2 >> 1))) != 0 {
- *(*uintptr)(unsafe.Pointer(pNewItem + 64 /* &.u1 */)) = Xsqlite3DbStrDup(tls, db, *(*uintptr)(unsafe.Pointer(pOldItem + 64 /* &.u1 */)))
+ if uint32(int32(*(*uint16)(unsafe.Pointer(pNewItem + 36 + 4))&0x2>>1)) != 0 {
+ *(*uintptr)(unsafe.Pointer(pNewItem + 64)) = Xsqlite3DbStrDup(tls, db, *(*uintptr)(unsafe.Pointer(pOldItem + 64)))
}
(*SrcItem)(unsafe.Pointer(pNewItem)).Fu2 = (*SrcItem)(unsafe.Pointer(pOldItem)).Fu2
- if (uint32(int32(*(*uint16)(unsafe.Pointer(pNewItem + 36 /* &.fg */ + 4 /* &.isCte */)) & 0x80 >> 7))) != 0 {
- (*CteUse)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pNewItem + 68 /* &.u2 */)))).FnUse++
+ if uint32(int32(*(*uint16)(unsafe.Pointer(pNewItem + 36 + 4))&0x80>>7)) != 0 {
+ (*CteUse)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pNewItem + 68)))).FnUse++
}
- if (uint32(int32(*(*uint16)(unsafe.Pointer(pNewItem + 36 /* &.fg */ + 4 /* &.isTabFunc */)) & 0x4 >> 2))) != 0 {
- *(*uintptr)(unsafe.Pointer(pNewItem + 64 /* &.u1 */)) = Xsqlite3ExprListDup(tls, db, *(*uintptr)(unsafe.Pointer(pOldItem + 64 /* &.u1 */)), flags)
+ if uint32(int32(*(*uint16)(unsafe.Pointer(pNewItem + 36 + 4))&0x4>>2)) != 0 {
+ *(*uintptr)(unsafe.Pointer(pNewItem + 64)) = Xsqlite3ExprListDup(tls, db, *(*uintptr)(unsafe.Pointer(pOldItem + 64)), flags)
}
- pTab = libc.AssignPtrUintptr(pNewItem+16 /* &.pTab */, (*SrcItem)(unsafe.Pointer(pOldItem)).FpTab)
+ pTab = libc.AssignPtrUintptr(pNewItem+16, (*SrcItem)(unsafe.Pointer(pOldItem)).FpTab)
if pTab != 0 {
(*Table)(unsafe.Pointer(pTab)).FnTabRef++
}
@@ -82171,7 +83265,7 @@ func Xsqlite3SrcListDup(tls *libc.TLS, db uintptr, p uintptr, flags int32) uintp
return pNew
}
-func Xsqlite3IdListDup(tls *libc.TLS, db uintptr, p uintptr) uintptr { /* sqlite3.c:102815:23: */
+func Xsqlite3IdListDup(tls *libc.TLS, db uintptr, p uintptr) uintptr { /* sqlite3.c:103306:23: */
var pNew uintptr
var i int32
@@ -82183,7 +83277,7 @@ func Xsqlite3IdListDup(tls *libc.TLS, db uintptr, p uintptr) uintptr { /* sqlite
return uintptr(0)
}
(*IdList)(unsafe.Pointer(pNew)).FnId = (*IdList)(unsafe.Pointer(p)).FnId
- (*IdList)(unsafe.Pointer(pNew)).Fa = Xsqlite3DbMallocRawNN(tls, db, (uint64(uint32((*IdList)(unsafe.Pointer(p)).FnId) * uint32(unsafe.Sizeof(IdList_item{})))))
+ (*IdList)(unsafe.Pointer(pNew)).Fa = Xsqlite3DbMallocRawNN(tls, db, uint64(uint32((*IdList)(unsafe.Pointer(p)).FnId)*uint32(unsafe.Sizeof(IdList_item{}))))
if (*IdList)(unsafe.Pointer(pNew)).Fa == uintptr(0) {
Xsqlite3DbFreeNN(tls, db, pNew)
return uintptr(0)
@@ -82192,15 +83286,15 @@ func Xsqlite3IdListDup(tls *libc.TLS, db uintptr, p uintptr) uintptr { /* sqlite
// necessarily a power of two, sqlite3IdListAppend() may not be called
// on the duplicate created by this function.
for i = 0; i < (*IdList)(unsafe.Pointer(p)).FnId; i++ {
- var pNewItem uintptr = ((*IdList)(unsafe.Pointer(pNew)).Fa + uintptr(i)*8)
- var pOldItem uintptr = ((*IdList)(unsafe.Pointer(p)).Fa + uintptr(i)*8)
+ var pNewItem uintptr = (*IdList)(unsafe.Pointer(pNew)).Fa + uintptr(i)*8
+ var pOldItem uintptr = (*IdList)(unsafe.Pointer(p)).Fa + uintptr(i)*8
(*IdList_item)(unsafe.Pointer(pNewItem)).FzName = Xsqlite3DbStrDup(tls, db, (*IdList_item)(unsafe.Pointer(pOldItem)).FzName)
(*IdList_item)(unsafe.Pointer(pNewItem)).Fidx = (*IdList_item)(unsafe.Pointer(pOldItem)).Fidx
}
return pNew
}
-func Xsqlite3SelectDup(tls *libc.TLS, db uintptr, pDup uintptr, flags int32) uintptr { /* sqlite3.c:102839:23: */
+func Xsqlite3SelectDup(tls *libc.TLS, db uintptr, pDup uintptr, flags int32) uintptr { /* sqlite3.c:103330:23: */
bp := tls.Alloc(4)
defer tls.Free(4)
@@ -82226,14 +83320,14 @@ func Xsqlite3SelectDup(tls *libc.TLS, db uintptr, pDup uintptr, flags int32) uin
(*Select)(unsafe.Pointer(pNew)).FpLimit = Xsqlite3ExprDup(tls, db, (*Select)(unsafe.Pointer(p)).FpLimit, flags)
(*Select)(unsafe.Pointer(pNew)).FiLimit = 0
(*Select)(unsafe.Pointer(pNew)).FiOffset = 0
- (*Select)(unsafe.Pointer(pNew)).FselFlags = ((*Select)(unsafe.Pointer(p)).FselFlags & libc.Uint32FromInt32(libc.CplInt32(SF_UsesEphemeral)))
- *(*int32)(unsafe.Pointer((pNew + 20 /* &.addrOpenEphm */))) = -1
- *(*int32)(unsafe.Pointer((pNew + 20 /* &.addrOpenEphm */) + 1*4)) = -1
+ (*Select)(unsafe.Pointer(pNew)).FselFlags = (*Select)(unsafe.Pointer(p)).FselFlags & libc.Uint32FromInt32(libc.CplInt32(SF_UsesEphemeral))
+ *(*int32)(unsafe.Pointer(pNew + 20)) = -1
+ *(*int32)(unsafe.Pointer(pNew + 20 + 1*4)) = -1
(*Select)(unsafe.Pointer(pNew)).FnSelectRow = (*Select)(unsafe.Pointer(p)).FnSelectRow
(*Select)(unsafe.Pointer(pNew)).FpWith = Xsqlite3WithDup(tls, db, (*Select)(unsafe.Pointer(p)).FpWith)
(*Select)(unsafe.Pointer(pNew)).FpWin = uintptr(0)
(*Select)(unsafe.Pointer(pNew)).FpWinDefn = Xsqlite3WindowListDup(tls, db, (*Select)(unsafe.Pointer(p)).FpWinDefn)
- if ((*Select)(unsafe.Pointer(p)).FpWin != 0) && (int32((*Sqlite3)(unsafe.Pointer(db)).FmallocFailed) == 0) {
+ if (*Select)(unsafe.Pointer(p)).FpWin != 0 && int32((*Sqlite3)(unsafe.Pointer(db)).FmallocFailed) == 0 {
gatherSelectWindows(tls, pNew)
}
(*Select)(unsafe.Pointer(pNew)).FselId = (*Select)(unsafe.Pointer(p)).FselId
@@ -82246,7 +83340,7 @@ func Xsqlite3SelectDup(tls *libc.TLS, db uintptr, pDup uintptr, flags int32) uin
break
}
*(*uintptr)(unsafe.Pointer(pp)) = pNew
- pp = (pNew + 52 /* &.pPrior */)
+ pp = pNew + 52
pNext = pNew
}
@@ -82266,31 +83360,31 @@ func Xsqlite3SelectDup(tls *libc.TLS, db uintptr, pDup uintptr, flags int32) uin
// If a memory allocation error occurs, the entire list is freed and
// NULL is returned. If non-NULL is returned, then it is guaranteed
// that the new entry was successfully appended.
-var zeroItem = ExprList_item{} /* sqlite3.c:102910:35 */
+var zeroItem = ExprList_item{} /* sqlite3.c:103401:35 */
-func Xsqlite3ExprListAppendNew(tls *libc.TLS, db uintptr, pExpr uintptr) uintptr { /* sqlite3.c:102911:41: */
+func Xsqlite3ExprListAppendNew(tls *libc.TLS, db uintptr, pExpr uintptr) uintptr { /* sqlite3.c:103402:41: */
var pItem uintptr
var pList uintptr
- pList = Xsqlite3DbMallocRawNN(tls, db, (uint64(uint32(unsafe.Sizeof(ExprList{})) + (uint32(unsafe.Sizeof(ExprList_item{})) * uint32(4)))))
+ pList = Xsqlite3DbMallocRawNN(tls, db, uint64(uint32(unsafe.Sizeof(ExprList{}))+uint32(unsafe.Sizeof(ExprList_item{}))*uint32(4)))
if pList == uintptr(0) {
Xsqlite3ExprDelete(tls, db, pExpr)
return uintptr(0)
}
(*ExprList)(unsafe.Pointer(pList)).FnAlloc = 4
(*ExprList)(unsafe.Pointer(pList)).FnExpr = 1
- pItem = (pList + 8 /* &.a */)
+ pItem = pList + 8
*(*ExprList_item)(unsafe.Pointer(pItem)) = zeroItem
(*ExprList_item)(unsafe.Pointer(pItem)).FpExpr = pExpr
return pList
}
-func Xsqlite3ExprListAppendGrow(tls *libc.TLS, db uintptr, pList uintptr, pExpr uintptr) uintptr { /* sqlite3.c:102930:41: */
+func Xsqlite3ExprListAppendGrow(tls *libc.TLS, db uintptr, pList uintptr, pExpr uintptr) uintptr { /* sqlite3.c:103421:41: */
var pItem uintptr
var pNew uintptr
- *(*int32)(unsafe.Pointer(pList + 4 /* &.nAlloc */)) *= (2)
+ *(*int32)(unsafe.Pointer(pList + 4)) *= 2
pNew = Xsqlite3DbRealloc(tls, db, pList,
- (uint64(uint32(unsafe.Sizeof(ExprList{})) + ((uint32((*ExprList)(unsafe.Pointer(pList)).FnAlloc - 1)) * uint32(unsafe.Sizeof(ExprList_item{}))))))
+ uint64(uint32(unsafe.Sizeof(ExprList{}))+uint32((*ExprList)(unsafe.Pointer(pList)).FnAlloc-1)*uint32(unsafe.Sizeof(ExprList_item{}))))
if pNew == uintptr(0) {
Xsqlite3ExprListDelete(tls, db, pList)
Xsqlite3ExprDelete(tls, db, pExpr)
@@ -82298,21 +83392,21 @@ func Xsqlite3ExprListAppendGrow(tls *libc.TLS, db uintptr, pList uintptr, pExpr
} else {
pList = pNew
}
- pItem = ((pList + 8 /* &.a */) + uintptr(libc.PostIncInt32(&(*ExprList)(unsafe.Pointer(pList)).FnExpr, 1))*20)
+ pItem = pList + 8 + uintptr(libc.PostIncInt32(&(*ExprList)(unsafe.Pointer(pList)).FnExpr, 1))*20
*(*ExprList_item)(unsafe.Pointer(pItem)) = zeroItem
(*ExprList_item)(unsafe.Pointer(pItem)).FpExpr = pExpr
return pList
}
-func Xsqlite3ExprListAppend(tls *libc.TLS, pParse uintptr, pList uintptr, pExpr uintptr) uintptr { /* sqlite3.c:102952:25: */
+func Xsqlite3ExprListAppend(tls *libc.TLS, pParse uintptr, pList uintptr, pExpr uintptr) uintptr { /* sqlite3.c:103443:25: */
var pItem uintptr
if pList == uintptr(0) {
return Xsqlite3ExprListAppendNew(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, pExpr)
}
- if (*ExprList)(unsafe.Pointer(pList)).FnAlloc < ((*ExprList)(unsafe.Pointer(pList)).FnExpr + 1) {
+ if (*ExprList)(unsafe.Pointer(pList)).FnAlloc < (*ExprList)(unsafe.Pointer(pList)).FnExpr+1 {
return Xsqlite3ExprListAppendGrow(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, pList, pExpr)
}
- pItem = ((pList + 8 /* &.a */) + uintptr(libc.PostIncInt32(&(*ExprList)(unsafe.Pointer(pList)).FnExpr, 1))*20)
+ pItem = pList + 8 + uintptr(libc.PostIncInt32(&(*ExprList)(unsafe.Pointer(pList)).FnExpr, 1))*20
*(*ExprList_item)(unsafe.Pointer(pItem)) = zeroItem
(*ExprList_item)(unsafe.Pointer(pItem)).FpExpr = pExpr
return pList
@@ -82327,7 +83421,7 @@ func Xsqlite3ExprListAppend(tls *libc.TLS, pParse uintptr, pList uintptr, pExpr
// For each term of the vector assignment, append new entries to the
// expression list pList. In the case of a subquery on the RHS, append
// TK_SELECT_COLUMN expressions.
-func Xsqlite3ExprListAppendVector(tls *libc.TLS, pParse uintptr, pList uintptr, pColumns uintptr, pExpr uintptr) uintptr { /* sqlite3.c:102981:25: */
+func Xsqlite3ExprListAppendVector(tls *libc.TLS, pParse uintptr, pList uintptr, pColumns uintptr, pExpr uintptr) uintptr { /* sqlite3.c:103472:25: */
bp := tls.Alloc(16)
defer tls.Free(16)
@@ -82362,10 +83456,10 @@ __2:
// the size of the RHS and LHS match. But if the RHS is a SELECT,
// wildcards ("*") in the result set of the SELECT must be expanded before
// we can do the size check, so defer the size check until code generation.
- if !((int32((*Expr)(unsafe.Pointer(pExpr)).Fop) != TK_SELECT) && ((*IdList)(unsafe.Pointer(pColumns)).FnId != (libc.AssignInt32(&n, Xsqlite3ExprVectorSize(tls, pExpr))))) {
+ if !(int32((*Expr)(unsafe.Pointer(pExpr)).Fop) != TK_SELECT && (*IdList)(unsafe.Pointer(pColumns)).FnId != libc.AssignInt32(&n, Xsqlite3ExprVectorSize(tls, pExpr))) {
goto __3
}
- Xsqlite3ErrorMsg(tls, pParse, ts+6627, /* "%d columns assig..." */
+ Xsqlite3ErrorMsg(tls, pParse, ts+7520, /* "%d columns assig..." */
libc.VaList(bp, (*IdList)(unsafe.Pointer(pColumns)).FnId, n))
goto vector_append_error
__3:
@@ -82376,7 +83470,7 @@ __4:
if !(i < (*IdList)(unsafe.Pointer(pColumns)).FnId) {
goto __6
}
- pSubExpr = Xsqlite3ExprForVectorField(tls, pParse, pExpr, i)
+ pSubExpr = Xsqlite3ExprForVectorField(tls, pParse, pExpr, i, (*IdList)(unsafe.Pointer(pColumns)).FnId)
if !(pSubExpr == uintptr(0)) {
goto __7
@@ -82384,13 +83478,12 @@ __4:
goto __5
__7:
;
- (*Expr)(unsafe.Pointer(pSubExpr)).FiTable = (*IdList)(unsafe.Pointer(pColumns)).FnId
pList = Xsqlite3ExprListAppend(tls, pParse, pList, pSubExpr)
if !(pList != 0) {
goto __8
}
- (*ExprList_item)(unsafe.Pointer((pList + 8 /* &.a */) + uintptr(((*ExprList)(unsafe.Pointer(pList)).FnExpr-1))*20)).FzEName = (*IdList_item)(unsafe.Pointer((*IdList)(unsafe.Pointer(pColumns)).Fa + uintptr(i)*8)).FzName
+ (*ExprList_item)(unsafe.Pointer(pList + 8 + uintptr((*ExprList)(unsafe.Pointer(pList)).FnExpr-1)*20)).FzEName = (*IdList_item)(unsafe.Pointer((*IdList)(unsafe.Pointer(pColumns)).Fa + uintptr(i)*8)).FzName
(*IdList_item)(unsafe.Pointer((*IdList)(unsafe.Pointer(pColumns)).Fa + uintptr(i)*8)).FzName = uintptr(0)
__8:
;
@@ -82402,10 +83495,10 @@ __5:
__6:
;
- if !((!(int32((*Sqlite3)(unsafe.Pointer(db)).FmallocFailed) != 0) && (int32((*Expr)(unsafe.Pointer(pExpr)).Fop) == TK_SELECT)) && (pList != uintptr(0))) {
+ if !(!(int32((*Sqlite3)(unsafe.Pointer(db)).FmallocFailed) != 0) && int32((*Expr)(unsafe.Pointer(pExpr)).Fop) == TK_SELECT && pList != uintptr(0)) {
goto __9
}
- pFirst = (*ExprList_item)(unsafe.Pointer((pList + 8 /* &.a */) + uintptr(iFirst)*20)).FpExpr
+ pFirst = (*ExprList_item)(unsafe.Pointer(pList + 8 + uintptr(iFirst)*20)).FpExpr
// Store the SELECT statement in pRight so it will be deleted when
// sqlite3ExprListDelete() is called
@@ -82425,13 +83518,13 @@ vector_append_error:
}
// Set the sort order for the last element on the given ExprList.
-func Xsqlite3ExprListSetSortOrder(tls *libc.TLS, p uintptr, iSortOrder int32, eNulls int32) { /* sqlite3.c:103045:21: */
+func Xsqlite3ExprListSetSortOrder(tls *libc.TLS, p uintptr, iSortOrder int32, eNulls int32) { /* sqlite3.c:103534:21: */
var pItem uintptr
if p == uintptr(0) {
return
}
- pItem = ((p + 8 /* &.a */) + uintptr(((*ExprList)(unsafe.Pointer(p)).FnExpr-1))*20)
+ pItem = p + 8 + uintptr((*ExprList)(unsafe.Pointer(p)).FnExpr-1)*20
if iSortOrder == -1 {
iSortOrder = SQLITE_SO_ASC
@@ -82439,9 +83532,9 @@ func Xsqlite3ExprListSetSortOrder(tls *libc.TLS, p uintptr, iSortOrder int32, eN
(*ExprList_item)(unsafe.Pointer(pItem)).FsortFlags = U8(iSortOrder)
if eNulls != -1 {
- libc.SetBitFieldPtr8Uint32(pItem+12 /* &.bNulls */, uint32(1), 5, 0x20)
+ libc.SetBitFieldPtr8Uint32(pItem+12, uint32(1), 5, 0x20)
if iSortOrder != eNulls {
- *(*U8)(unsafe.Pointer(pItem + 8 /* &.sortFlags */)) |= U8((KEYINFO_ORDER_BIGNULL))
+ *(*U8)(unsafe.Pointer(pItem + 8)) |= U8(KEYINFO_ORDER_BIGNULL)
}
}
}
@@ -82452,12 +83545,12 @@ func Xsqlite3ExprListSetSortOrder(tls *libc.TLS, p uintptr, iSortOrder int32, eN
// pList might be NULL following an OOM error. But pName should never be
// NULL. If a memory allocation fails, the pParse->db->mallocFailed flag
// is set.
-func Xsqlite3ExprListSetName(tls *libc.TLS, pParse uintptr, pList uintptr, pName uintptr, dequote int32) { /* sqlite3.c:103083:21: */
+func Xsqlite3ExprListSetName(tls *libc.TLS, pParse uintptr, pList uintptr, pName uintptr, dequote int32) { /* sqlite3.c:103572:21: */
if pList != 0 {
var pItem uintptr
- pItem = ((pList + 8 /* &.a */) + uintptr(((*ExprList)(unsafe.Pointer(pList)).FnExpr-1))*20)
+ pItem = pList + 8 + uintptr((*ExprList)(unsafe.Pointer(pList)).FnExpr-1)*20
(*ExprList_item)(unsafe.Pointer(pItem)).FzEName = Xsqlite3DbStrNDup(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, (*Token)(unsafe.Pointer(pName)).Fz, uint64((*Token)(unsafe.Pointer(pName)).Fn))
if dequote != 0 {
@@ -82478,38 +83571,38 @@ func Xsqlite3ExprListSetName(tls *libc.TLS, pParse uintptr, pList uintptr, pName
// pList might be NULL following an OOM error. But pSpan should never be
// NULL. If a memory allocation fails, the pParse->db->mallocFailed flag
// is set.
-func Xsqlite3ExprListSetSpan(tls *libc.TLS, pParse uintptr, pList uintptr, zStart uintptr, zEnd uintptr) { /* sqlite3.c:103118:21: */
+func Xsqlite3ExprListSetSpan(tls *libc.TLS, pParse uintptr, pList uintptr, zStart uintptr, zEnd uintptr) { /* sqlite3.c:103607:21: */
var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb
if pList != 0 {
- var pItem uintptr = ((pList + 8 /* &.a */) + uintptr(((*ExprList)(unsafe.Pointer(pList)).FnExpr-1))*20)
+ var pItem uintptr = pList + 8 + uintptr((*ExprList)(unsafe.Pointer(pList)).FnExpr-1)*20
if (*ExprList_item)(unsafe.Pointer(pItem)).FzEName == uintptr(0) {
(*ExprList_item)(unsafe.Pointer(pItem)).FzEName = Xsqlite3DbSpanDup(tls, db, zStart, zEnd)
- libc.SetBitFieldPtr8Uint32(pItem+12 /* &.eEName */, uint32(ENAME_SPAN), 0, 0x3)
+ libc.SetBitFieldPtr8Uint32(pItem+12, uint32(ENAME_SPAN), 0, 0x3)
}
}
}
// If the expression list pEList contains more than iLimit elements,
// leave an error message in pParse.
-func Xsqlite3ExprListCheckLength(tls *libc.TLS, pParse uintptr, pEList uintptr, zObject uintptr) { /* sqlite3.c:103140:21: */
+func Xsqlite3ExprListCheckLength(tls *libc.TLS, pParse uintptr, pEList uintptr, zObject uintptr) { /* sqlite3.c:103629:21: */
bp := tls.Alloc(8)
defer tls.Free(8)
- var mx int32 = *(*int32)(unsafe.Pointer(((*Parse)(unsafe.Pointer(pParse)).Fdb + 112 /* &.aLimit */) + 2*4))
+ var mx int32 = *(*int32)(unsafe.Pointer((*Parse)(unsafe.Pointer(pParse)).Fdb + 120 + 2*4))
- if (pEList != 0) && ((*ExprList)(unsafe.Pointer(pEList)).FnExpr > mx) {
- Xsqlite3ErrorMsg(tls, pParse, ts+6657 /* "too many columns..." */, libc.VaList(bp, zObject))
+ if pEList != 0 && (*ExprList)(unsafe.Pointer(pEList)).FnExpr > mx {
+ Xsqlite3ErrorMsg(tls, pParse, ts+7550 /* "too many columns..." */, libc.VaList(bp, zObject))
}
}
// Delete an entire expression list.
-func exprListDeleteNN(tls *libc.TLS, db uintptr, pList uintptr) { /* sqlite3.c:103156:29: */
+func exprListDeleteNN(tls *libc.TLS, db uintptr, pList uintptr) { /* sqlite3.c:103645:29: */
var i int32 = (*ExprList)(unsafe.Pointer(pList)).FnExpr
var pItem uintptr = pList + 8 /* &.a */
- for ok := true; ok; ok = (libc.PreDecInt32(&i, 1) > 0) {
+ for ok := true; ok; ok = libc.PreDecInt32(&i, 1) > 0 {
Xsqlite3ExprDelete(tls, db, (*ExprList_item)(unsafe.Pointer(pItem)).FpExpr)
Xsqlite3DbFree(tls, db, (*ExprList_item)(unsafe.Pointer(pItem)).FzEName)
pItem += 20
@@ -82517,7 +83610,7 @@ func exprListDeleteNN(tls *libc.TLS, db uintptr, pList uintptr) { /* sqlite3.c:1
Xsqlite3DbFreeNN(tls, db, pList)
}
-func Xsqlite3ExprListDelete(tls *libc.TLS, db uintptr, pList uintptr) { /* sqlite3.c:103167:21: */
+func Xsqlite3ExprListDelete(tls *libc.TLS, db uintptr, pList uintptr) { /* sqlite3.c:103656:21: */
if pList != 0 {
exprListDeleteNN(tls, db, pList)
}
@@ -82525,14 +83618,14 @@ func Xsqlite3ExprListDelete(tls *libc.TLS, db uintptr, pList uintptr) { /* sqlit
// Return the bitwise-OR of all Expr.flags fields in the given
// ExprList.
-func Xsqlite3ExprListFlags(tls *libc.TLS, pList uintptr) U32 { /* sqlite3.c:103175:20: */
+func Xsqlite3ExprListFlags(tls *libc.TLS, pList uintptr) U32 { /* sqlite3.c:103664:20: */
var i int32
var m U32 = U32(0)
for i = 0; i < (*ExprList)(unsafe.Pointer(pList)).FnExpr; i++ {
- var pExpr uintptr = (*ExprList_item)(unsafe.Pointer((pList + 8 /* &.a */) + uintptr(i)*20)).FpExpr
+ var pExpr uintptr = (*ExprList_item)(unsafe.Pointer(pList + 8 + uintptr(i)*20)).FpExpr
- m = m | ((*Expr)(unsafe.Pointer(pExpr)).Fflags)
+ m = m | (*Expr)(unsafe.Pointer(pExpr)).Fflags
}
return m
}
@@ -82542,7 +83635,7 @@ func Xsqlite3ExprListFlags(tls *libc.TLS, pList uintptr) U32 { /* sqlite3.c:1031
// pWalker->eCode to zero and abort.
//
// This callback is used by multiple expression walkers.
-func Xsqlite3SelectWalkFail(tls *libc.TLS, pWalker uintptr, NotUsed uintptr) int32 { /* sqlite3.c:103194:20: */
+func Xsqlite3SelectWalkFail(tls *libc.TLS, pWalker uintptr, NotUsed uintptr) int32 { /* sqlite3.c:103683:20: */
_ = NotUsed
(*Walker)(unsafe.Pointer(pWalker)).FeCode = U16(0)
return WRC_Abort
@@ -82554,11 +83647,11 @@ func Xsqlite3SelectWalkFail(tls *libc.TLS, pWalker uintptr, NotUsed uintptr) int
// "true" EP_IsTrue
// "false" EP_IsFalse
// anything else 0
-func Xsqlite3IsTrueOrFalse(tls *libc.TLS, zIn uintptr) U32 { /* sqlite3.c:103208:20: */
- if Xsqlite3StrICmp(tls, zIn, ts+5770 /* "true" */) == 0 {
+func Xsqlite3IsTrueOrFalse(tls *libc.TLS, zIn uintptr) U32 { /* sqlite3.c:103697:20: */
+ if Xsqlite3StrICmp(tls, zIn, ts+6617) == 0 {
return U32(EP_IsTrue)
}
- if Xsqlite3StrICmp(tls, zIn, ts+5775 /* "false" */) == 0 {
+ if Xsqlite3StrICmp(tls, zIn, ts+6622) == 0 {
return U32(EP_IsFalse)
}
return U32(0)
@@ -82567,13 +83660,13 @@ func Xsqlite3IsTrueOrFalse(tls *libc.TLS, zIn uintptr) U32 { /* sqlite3.c:103208
// If the input expression is an ID with the name "true" or "false"
// then convert it into an TK_TRUEFALSE term. Return non-zero if
// the conversion happened, and zero if the expression is unaltered.
-func Xsqlite3ExprIdToTrueFalse(tls *libc.TLS, pExpr uintptr) int32 { /* sqlite3.c:103220:20: */
+func Xsqlite3ExprIdToTrueFalse(tls *libc.TLS, pExpr uintptr) int32 { /* sqlite3.c:103709:20: */
var v U32
- if !(((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_Quoted))) != U32(0)) &&
- ((libc.AssignUint32(&v, Xsqlite3IsTrueOrFalse(tls, *(*uintptr)(unsafe.Pointer(pExpr + 8 /* &.u */))))) != U32(0)) {
+ if !((*Expr)(unsafe.Pointer(pExpr)).Fflags&U32(EP_Quoted|EP_IntValue) != U32(0)) &&
+ libc.AssignUint32(&v, Xsqlite3IsTrueOrFalse(tls, *(*uintptr)(unsafe.Pointer(pExpr + 8)))) != U32(0) {
(*Expr)(unsafe.Pointer(pExpr)).Fop = U8(TK_TRUEFALSE)
- *(*U32)(unsafe.Pointer(pExpr + 4 /* &.flags */)) |= (v)
+ *(*U32)(unsafe.Pointer(pExpr + 4)) |= v
return 1
}
return 0
@@ -82581,10 +83674,10 @@ func Xsqlite3ExprIdToTrueFalse(tls *libc.TLS, pExpr uintptr) int32 { /* sqlite3.
// The argument must be a TK_TRUEFALSE Expr node. Return 1 if it is TRUE
// and 0 if it is FALSE.
-func Xsqlite3ExprTruthValue(tls *libc.TLS, pExpr uintptr) int32 { /* sqlite3.c:103237:20: */
+func Xsqlite3ExprTruthValue(tls *libc.TLS, pExpr uintptr) int32 { /* sqlite3.c:103726:20: */
pExpr = Xsqlite3ExprSkipCollate(tls, pExpr)
- return (libc.Bool32(int32(*(*uint8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pExpr + 8 /* &.u */)) + 4))) == 0))
+ return libc.Bool32(int32(*(*uint8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pExpr + 8)) + 4))) == 0)
}
// If pExpr is an AND or OR expression, try to simplify it by eliminating
@@ -82598,18 +83691,18 @@ func Xsqlite3ExprTruthValue(tls *libc.TLS, pExpr uintptr) int32 { /* sqlite3.c:1
// (x<10) AND (y=22 OR false) => (x<10) AND (y=22)
// (x<10) AND (y=22 OR true) => (x<10)
// (y=22) OR true => true
-func Xsqlite3ExprSimplifiedAndOr(tls *libc.TLS, pExpr uintptr) uintptr { /* sqlite3.c:103258:21: */
+func Xsqlite3ExprSimplifiedAndOr(tls *libc.TLS, pExpr uintptr) uintptr { /* sqlite3.c:103748:21: */
- if (int32((*Expr)(unsafe.Pointer(pExpr)).Fop) == TK_AND) || (int32((*Expr)(unsafe.Pointer(pExpr)).Fop) == TK_OR) {
+ if int32((*Expr)(unsafe.Pointer(pExpr)).Fop) == TK_AND || int32((*Expr)(unsafe.Pointer(pExpr)).Fop) == TK_OR {
var pRight uintptr = Xsqlite3ExprSimplifiedAndOr(tls, (*Expr)(unsafe.Pointer(pExpr)).FpRight)
var pLeft uintptr = Xsqlite3ExprSimplifiedAndOr(tls, (*Expr)(unsafe.Pointer(pExpr)).FpLeft)
- if (((*Expr)(unsafe.Pointer((pLeft))).Fflags & (U32(EP_FromJoin | EP_IsTrue))) == U32(EP_IsTrue)) || (((*Expr)(unsafe.Pointer((pRight))).Fflags & (U32(EP_FromJoin | EP_IsFalse))) == U32(EP_IsFalse)) {
+ if (*Expr)(unsafe.Pointer(pLeft)).Fflags&U32(EP_FromJoin|EP_IsTrue) == U32(EP_IsTrue) || (*Expr)(unsafe.Pointer(pRight)).Fflags&U32(EP_FromJoin|EP_IsFalse) == U32(EP_IsFalse) {
if int32((*Expr)(unsafe.Pointer(pExpr)).Fop) == TK_AND {
pExpr = pRight
} else {
pExpr = pLeft
}
- } else if (((*Expr)(unsafe.Pointer((pRight))).Fflags & (U32(EP_FromJoin | EP_IsTrue))) == U32(EP_IsTrue)) || (((*Expr)(unsafe.Pointer((pLeft))).Fflags & (U32(EP_FromJoin | EP_IsFalse))) == U32(EP_IsFalse)) {
+ } else if (*Expr)(unsafe.Pointer(pRight)).Fflags&U32(EP_FromJoin|EP_IsTrue) == U32(EP_IsTrue) || (*Expr)(unsafe.Pointer(pLeft)).Fflags&U32(EP_FromJoin|EP_IsFalse) == U32(EP_IsFalse) {
if int32((*Expr)(unsafe.Pointer(pExpr)).Fop) == TK_AND {
pExpr = pLeft
} else {
@@ -82644,12 +83737,12 @@ func Xsqlite3ExprSimplifiedAndOr(tls *libc.TLS, pExpr uintptr) uintptr { /* sqli
// contain a bound parameter because they were generated by older versions
// of SQLite to be parsed by newer versions of SQLite without raising a
// malformed schema error.
-func exprNodeIsConstant(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 { /* sqlite3.c:103299:12: */
+func exprNodeIsConstant(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 { /* sqlite3.c:103789:12: */
// If pWalker->eCode is 2 then any term of the expression that comes from
// the ON or USING clauses of a left join disqualifies the expression
// from being considered constant.
- if (int32((*Walker)(unsafe.Pointer(pWalker)).FeCode) == 2) && (((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_FromJoin))) != U32(0)) {
+ if int32((*Walker)(unsafe.Pointer(pWalker)).FeCode) == 2 && (*Expr)(unsafe.Pointer(pExpr)).Fflags&U32(EP_FromJoin) != U32(0) {
(*Walker)(unsafe.Pointer(pWalker)).FeCode = U16(0)
return WRC_Abort
}
@@ -82659,10 +83752,10 @@ func exprNodeIsConstant(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 { /
// and either pWalker->eCode==4 or 5 or the function has the
// SQLITE_FUNC_CONST flag.
case TK_FUNCTION:
- if ((int32((*Walker)(unsafe.Pointer(pWalker)).FeCode) >= 4) || (((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_ConstFunc))) != U32(0))) &&
- !(((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_WinFunc))) != U32(0)) {
+ if (int32((*Walker)(unsafe.Pointer(pWalker)).FeCode) >= 4 || (*Expr)(unsafe.Pointer(pExpr)).Fflags&U32(EP_ConstFunc) != U32(0)) &&
+ !((*Expr)(unsafe.Pointer(pExpr)).Fflags&U32(EP_WinFunc) != U32(0)) {
if int32((*Walker)(unsafe.Pointer(pWalker)).FeCode) == 5 {
- *(*U32)(unsafe.Pointer(pExpr + 4 /* &.flags */)) |= (U32(EP_FromDDL))
+ *(*U32)(unsafe.Pointer(pExpr + 4)) |= U32(EP_FromDDL)
}
return WRC_Continue
} else {
@@ -82683,10 +83776,10 @@ func exprNodeIsConstant(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 { /
fallthrough
case TK_AGG_COLUMN:
- if (((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_FixedCol))) != U32(0)) && (int32((*Walker)(unsafe.Pointer(pWalker)).FeCode) != 2) {
+ if (*Expr)(unsafe.Pointer(pExpr)).Fflags&U32(EP_FixedCol) != U32(0) && int32((*Walker)(unsafe.Pointer(pWalker)).FeCode) != 2 {
return WRC_Continue
}
- if (int32((*Walker)(unsafe.Pointer(pWalker)).FeCode) == 3) && ((*Expr)(unsafe.Pointer(pExpr)).FiTable == *(*int32)(unsafe.Pointer(pWalker + 24 /* &.u */))) {
+ if int32((*Walker)(unsafe.Pointer(pWalker)).FeCode) == 3 && (*Expr)(unsafe.Pointer(pExpr)).FiTable == *(*int32)(unsafe.Pointer(pWalker + 24)) {
return WRC_Continue
}
fallthrough
@@ -82719,7 +83812,7 @@ func exprNodeIsConstant(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 { /
return int32(0)
}
-func exprIsConst(tls *libc.TLS, p uintptr, initFlag int32, iCur int32) int32 { /* sqlite3.c:103371:12: */
+func exprIsConst(tls *libc.TLS, p uintptr, initFlag int32, iCur int32) int32 { /* sqlite3.c:103861:12: */
bp := tls.Alloc(28)
defer tls.Free(28)
@@ -82732,7 +83825,7 @@ func exprIsConst(tls *libc.TLS, p uintptr, initFlag int32, iCur int32) int32 { /
(*Walker)(unsafe.Pointer(bp /* &w */)).FxSelectCallback = *(*uintptr)(unsafe.Pointer(&struct {
f func(*libc.TLS, uintptr, uintptr) int32
}{Xsqlite3SelectWalkFail}))
- *(*int32)(unsafe.Pointer(bp /* &w */ + 24 /* &.u */)) = iCur
+ *(*int32)(unsafe.Pointer(bp + 24)) = iCur
Xsqlite3WalkExpr(tls, bp /* &w */, p)
return int32((*Walker)(unsafe.Pointer(bp /* &w */)).FeCode)
}
@@ -82743,7 +83836,7 @@ func exprIsConst(tls *libc.TLS, p uintptr, initFlag int32, iCur int32) int32 { /
// For the purposes of this function, a double-quoted string (ex: "abc")
// is considered a variable but a single-quoted string (ex: 'abc') is
// a constant.
-func Xsqlite3ExprIsConstant(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:103392:20: */
+func Xsqlite3ExprIsConstant(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:103882:20: */
return exprIsConst(tls, p, 1, 0)
}
@@ -82758,7 +83851,7 @@ func Xsqlite3ExprIsConstant(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:10339
// When this routine returns true, it indicates that the expression
// can be added to the pParse->pConstExpr list and evaluated once when
// the prepared statement starts up. See sqlite3ExprCodeRunJustOnce().
-func Xsqlite3ExprIsConstantNotJoin(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:103409:20: */
+func Xsqlite3ExprIsConstantNotJoin(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:103899:20: */
return exprIsConst(tls, p, 2, 0)
}
@@ -82766,19 +83859,19 @@ func Xsqlite3ExprIsConstantNotJoin(tls *libc.TLS, p uintptr) int32 { /* sqlite3.
// for any single row of the table with cursor iCur. In other words, the
// expression must not refer to any non-deterministic function nor any
// table other than iCur.
-func Xsqlite3ExprIsTableConstant(tls *libc.TLS, p uintptr, iCur int32) int32 { /* sqlite3.c:103419:20: */
+func Xsqlite3ExprIsTableConstant(tls *libc.TLS, p uintptr, iCur int32) int32 { /* sqlite3.c:103909:20: */
return exprIsConst(tls, p, 3, iCur)
}
// sqlite3WalkExpr() callback used by sqlite3ExprIsConstantOrGroupBy().
-func exprNodeIsConstantOrGroupBy(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 { /* sqlite3.c:103427:12: */
- var pGroupBy uintptr = *(*uintptr)(unsafe.Pointer(pWalker + 24 /* &.u */))
+func exprNodeIsConstantOrGroupBy(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 { /* sqlite3.c:103917:12: */
+ var pGroupBy uintptr = *(*uintptr)(unsafe.Pointer(pWalker + 24))
var i int32
// Check if pExpr is identical to any GROUP BY term. If so, consider
// it constant.
for i = 0; i < (*ExprList)(unsafe.Pointer(pGroupBy)).FnExpr; i++ {
- var p uintptr = (*ExprList_item)(unsafe.Pointer((pGroupBy + 8 /* &.a */) + uintptr(i)*20)).FpExpr
+ var p uintptr = (*ExprList_item)(unsafe.Pointer(pGroupBy + 8 + uintptr(i)*20)).FpExpr
if Xsqlite3ExprCompare(tls, uintptr(0), pExpr, p, -1) < 2 {
var pColl uintptr = Xsqlite3ExprNNCollSeq(tls, (*Walker)(unsafe.Pointer(pWalker)).FpParse, p)
if Xsqlite3IsBinary(tls, pColl) != 0 {
@@ -82788,7 +83881,7 @@ func exprNodeIsConstantOrGroupBy(tls *libc.TLS, pWalker uintptr, pExpr uintptr)
}
// Check if pExpr is a sub-select. If so, consider it variable.
- if ((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_xIsSelect))) != U32(0) {
+ if (*Expr)(unsafe.Pointer(pExpr)).Fflags&U32(EP_xIsSelect) != U32(0) {
(*Walker)(unsafe.Pointer(pWalker)).FeCode = U16(0)
return WRC_Abort
}
@@ -82813,7 +83906,7 @@ func exprNodeIsConstantOrGroupBy(tls *libc.TLS, pWalker uintptr, pExpr uintptr)
// alternative collating sequences are uncommon, and this is only an
// optimization, so we take the easy way out and simply require the
// GROUP BY to use the BINARY collating sequence.
-func Xsqlite3ExprIsConstantOrGroupBy(tls *libc.TLS, pParse uintptr, p uintptr, pGroupBy uintptr) int32 { /* sqlite3.c:103471:20: */
+func Xsqlite3ExprIsConstantOrGroupBy(tls *libc.TLS, pParse uintptr, p uintptr, pGroupBy uintptr) int32 { /* sqlite3.c:103961:20: */
bp := tls.Alloc(28)
defer tls.Free(28)
@@ -82824,7 +83917,7 @@ func Xsqlite3ExprIsConstantOrGroupBy(tls *libc.TLS, pParse uintptr, p uintptr, p
f func(*libc.TLS, uintptr, uintptr) int32
}{exprNodeIsConstantOrGroupBy}))
(*Walker)(unsafe.Pointer(bp /* &w */)).FxSelectCallback = uintptr(0)
- *(*uintptr)(unsafe.Pointer(bp /* &w */ + 24 /* &.u */)) = pGroupBy
+ *(*uintptr)(unsafe.Pointer(bp + 24)) = pGroupBy
(*Walker)(unsafe.Pointer(bp /* &w */)).FpParse = pParse
Xsqlite3WalkExpr(tls, bp /* &w */, p)
return int32((*Walker)(unsafe.Pointer(bp /* &w */)).FeCode)
@@ -82849,16 +83942,16 @@ func Xsqlite3ExprIsConstantOrGroupBy(tls *libc.TLS, pParse uintptr, p uintptr, p
// For the purposes of this function, a double-quoted string (ex: "abc")
// is considered a variable but a single-quoted string (ex: 'abc') is
// a constant.
-func Xsqlite3ExprIsConstantOrFunction(tls *libc.TLS, p uintptr, isInit U8) int32 { /* sqlite3.c:103503:20: */
+func Xsqlite3ExprIsConstantOrFunction(tls *libc.TLS, p uintptr, isInit U8) int32 { /* sqlite3.c:103993:20: */
- return exprIsConst(tls, p, (4 + int32(isInit)), 0)
+ return exprIsConst(tls, p, 4+int32(isInit), 0)
}
// If the expression p codes a constant integer that is small enough
// to fit in a 32-bit integer, return 1 and put the value of the integer
// in *pValue. If the expression is not an integer or if it is too big
// to fit in a signed 32-bit integer, return 0 and leave *pValue unchanged.
-func Xsqlite3ExprIsInteger(tls *libc.TLS, p uintptr, pValue uintptr) int32 { /* sqlite3.c:103532:20: */
+func Xsqlite3ExprIsInteger(tls *libc.TLS, p uintptr, pValue uintptr) int32 { /* sqlite3.c:104022:20: */
bp := tls.Alloc(4)
defer tls.Free(4)
@@ -82870,8 +83963,8 @@ func Xsqlite3ExprIsInteger(tls *libc.TLS, p uintptr, pValue uintptr) int32 { /*
// If an expression is an integer literal that fits in a signed 32-bit
// integer, then the EP_IntValue flag will have already been set
- if ((*Expr)(unsafe.Pointer(p)).Fflags & U32(EP_IntValue)) != 0 {
- *(*int32)(unsafe.Pointer(pValue)) = *(*int32)(unsafe.Pointer(p + 8 /* &.u */))
+ if (*Expr)(unsafe.Pointer(p)).Fflags&U32(EP_IntValue) != 0 {
+ *(*int32)(unsafe.Pointer(pValue)) = *(*int32)(unsafe.Pointer(p + 8))
return 1
}
switch int32((*Expr)(unsafe.Pointer(p)).Fop) {
@@ -82883,9 +83976,8 @@ func Xsqlite3ExprIsInteger(tls *libc.TLS, p uintptr, pValue uintptr) int32 { /*
}
case TK_UMINUS:
{
- // var v int32 at bp, 4
-
- if Xsqlite3ExprIsInteger(tls, (*Expr)(unsafe.Pointer(p)).FpLeft, bp /* &v */) != 0 {
+ *(*int32)(unsafe.Pointer(bp /* v */)) = 0
+ if Xsqlite3ExprIsInteger(tls, (*Expr)(unsafe.Pointer(p)).FpLeft, bp) != 0 {
*(*int32)(unsafe.Pointer(pValue)) = -*(*int32)(unsafe.Pointer(bp /* v */))
rc = 1
@@ -82911,10 +84003,10 @@ func Xsqlite3ExprIsInteger(tls *libc.TLS, p uintptr, pValue uintptr) int32 { /*
// hand, a false negative (returning FALSE when the result could be NULL)
// will likely result in an incorrect answer. So when in doubt, return
// TRUE.
-func Xsqlite3ExprCanBeNull(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:103578:20: */
+func Xsqlite3ExprCanBeNull(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:104068:20: */
var op U8
- for (int32((*Expr)(unsafe.Pointer(p)).Fop) == TK_UPLUS) || (int32((*Expr)(unsafe.Pointer(p)).Fop) == TK_UMINUS) {
+ for int32((*Expr)(unsafe.Pointer(p)).Fop) == TK_UPLUS || int32((*Expr)(unsafe.Pointer(p)).Fop) == TK_UMINUS {
p = (*Expr)(unsafe.Pointer(p)).FpLeft
}
@@ -82932,9 +84024,10 @@ func Xsqlite3ExprCanBeNull(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:103578
case TK_BLOB:
return 0
case TK_COLUMN:
- return (libc.Bool32(((((*Expr)(unsafe.Pointer((p))).Fflags & (U32(EP_CanBeNull))) != U32(0)) || (*(*uintptr)(unsafe.Pointer(p + 44 /* &.y */)) == uintptr(0))) || (((int32((*Expr)(unsafe.Pointer(p)).FiColumn) >= 0) &&
- ((*Table)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(p + 44 /* &.y */)))).FaCol != uintptr(0))) && // Defense against OOM problems
- (int32((*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(p + 44 /* &.y */)))).FaCol+uintptr((*Expr)(unsafe.Pointer(p)).FiColumn)*20)).FnotNull) == 0))))
+
+ return libc.Bool32((*Expr)(unsafe.Pointer(p)).Fflags&U32(EP_CanBeNull) != U32(0) || *(*uintptr)(unsafe.Pointer(p + 44)) == uintptr(0) || int32((*Expr)(unsafe.Pointer(p)).FiColumn) >= 0 &&
+ (*Table)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(p + 44)))).FaCol != uintptr(0) &&
+ int32(*(*uint8)(unsafe.Pointer((*Table)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(p + 44)))).FaCol + uintptr((*Expr)(unsafe.Pointer(p)).FiColumn)*16 + 4))&0xf>>0) == 0)
default:
return 1
}
@@ -82949,13 +84042,13 @@ func Xsqlite3ExprCanBeNull(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:103578
// can be omitted. When in doubt return FALSE. A false negative
// is harmless. A false positive, however, can result in the wrong
// answer.
-func Xsqlite3ExprNeedsNoAffinityChange(tls *libc.TLS, p uintptr, aff uint8) int32 { /* sqlite3.c:103614:20: */
+func Xsqlite3ExprNeedsNoAffinityChange(tls *libc.TLS, p uintptr, aff uint8) int32 { /* sqlite3.c:104105:20: */
var op U8
var unaryMinus int32 = 0
if int32(aff) == SQLITE_AFF_BLOB {
return 1
}
- for (int32((*Expr)(unsafe.Pointer(p)).Fop) == TK_UPLUS) || (int32((*Expr)(unsafe.Pointer(p)).Fop) == TK_UMINUS) {
+ for int32((*Expr)(unsafe.Pointer(p)).Fop) == TK_UPLUS || int32((*Expr)(unsafe.Pointer(p)).Fop) == TK_UMINUS {
if int32((*Expr)(unsafe.Pointer(p)).Fop) == TK_UMINUS {
unaryMinus = 1
}
@@ -82968,17 +84061,17 @@ func Xsqlite3ExprNeedsNoAffinityChange(tls *libc.TLS, p uintptr, aff uint8) int3
switch int32(op) {
case TK_INTEGER:
{
- return (libc.Bool32(int32(aff) >= SQLITE_AFF_NUMERIC))
+ return libc.Bool32(int32(aff) >= SQLITE_AFF_NUMERIC)
}
case TK_FLOAT:
{
- return (libc.Bool32(int32(aff) >= SQLITE_AFF_NUMERIC))
+ return libc.Bool32(int32(aff) >= SQLITE_AFF_NUMERIC)
}
case TK_STRING:
{
- return (libc.Bool32(!(unaryMinus != 0) && (int32(aff) == SQLITE_AFF_TEXT)))
+ return libc.Bool32(!(unaryMinus != 0) && int32(aff) == SQLITE_AFF_TEXT)
}
case TK_BLOB:
@@ -82989,7 +84082,7 @@ func Xsqlite3ExprNeedsNoAffinityChange(tls *libc.TLS, p uintptr, aff uint8) int3
case TK_COLUMN:
{
// p cannot be part of a CHECK constraint
- return (libc.Bool32((int32(aff) >= SQLITE_AFF_NUMERIC) && (int32((*Expr)(unsafe.Pointer(p)).FiColumn) < 0)))
+ return libc.Bool32(int32(aff) >= SQLITE_AFF_NUMERIC && int32((*Expr)(unsafe.Pointer(p)).FiColumn) < 0)
}
default:
@@ -83002,14 +84095,14 @@ func Xsqlite3ExprNeedsNoAffinityChange(tls *libc.TLS, p uintptr, aff uint8) int3
}
// Return TRUE if the given string is a row-id column name.
-func Xsqlite3IsRowid(tls *libc.TLS, z uintptr) int32 { /* sqlite3.c:103650:20: */
- if Xsqlite3StrICmp(tls, z, ts+6680 /* "_ROWID_" */) == 0 {
+func Xsqlite3IsRowid(tls *libc.TLS, z uintptr) int32 { /* sqlite3.c:104141:20: */
+ if Xsqlite3StrICmp(tls, z, ts+7573) == 0 {
return 1
}
- if Xsqlite3StrICmp(tls, z, ts+6688 /* "ROWID" */) == 0 {
+ if Xsqlite3StrICmp(tls, z, ts+7581) == 0 {
return 1
}
- if Xsqlite3StrICmp(tls, z, ts+6694 /* "OID" */) == 0 {
+ if Xsqlite3StrICmp(tls, z, ts+7587) == 0 {
return 1
}
return 0
@@ -83020,23 +84113,23 @@ func Xsqlite3IsRowid(tls *libc.TLS, z uintptr) int32 { /* sqlite3.c:103650:20: *
// a pointer to the SELECT statement. If pX is not a SELECT statement,
// or if the SELECT statement needs to be manifested into a transient
// table, then return NULL.
-func isCandidateForInOpt(tls *libc.TLS, pX uintptr) uintptr { /* sqlite3.c:103665:15: */
+func isCandidateForInOpt(tls *libc.TLS, pX uintptr) uintptr { /* sqlite3.c:104156:15: */
var p uintptr
var pSrc uintptr
var pEList uintptr
var pTab uintptr
var i int32
- if !(((*Expr)(unsafe.Pointer((pX))).Fflags & (U32(EP_xIsSelect))) != U32(0)) {
+ if !((*Expr)(unsafe.Pointer(pX)).Fflags&U32(EP_xIsSelect) != U32(0)) {
return uintptr(0)
} // Not a subquery
- if ((*Expr)(unsafe.Pointer((pX))).Fflags & (U32(EP_VarSelect))) != U32(0) {
+ if (*Expr)(unsafe.Pointer(pX)).Fflags&U32(EP_VarSelect) != U32(0) {
return uintptr(0)
} // Correlated subq
- p = *(*uintptr)(unsafe.Pointer(pX + 20 /* &.x */))
+ p = *(*uintptr)(unsafe.Pointer(pX + 20))
if (*Select)(unsafe.Pointer(p)).FpPrior != 0 {
return uintptr(0)
} // Not a compound SELECT
- if ((*Select)(unsafe.Pointer(p)).FselFlags & (U32(SF_Distinct | SF_Aggregate))) != 0 {
+ if (*Select)(unsafe.Pointer(p)).FselFlags&U32(SF_Distinct|SF_Aggregate) != 0 {
return uintptr(0) // No DISTINCT keyword and no aggregate functions
}
@@ -83052,20 +84145,20 @@ func isCandidateForInOpt(tls *libc.TLS, pX uintptr) uintptr { /* sqlite3.c:10366
if (*SrcList)(unsafe.Pointer(pSrc)).FnSrc != 1 {
return uintptr(0)
} // Single term in FROM clause
- if (*SrcItem)(unsafe.Pointer((pSrc + 8 /* &.a */))).FpSelect != 0 {
+ if (*SrcItem)(unsafe.Pointer(pSrc+8)).FpSelect != 0 {
return uintptr(0)
} // FROM is not a subquery or view
- pTab = (*SrcItem)(unsafe.Pointer((pSrc + 8 /* &.a */))).FpTab
+ pTab = (*SrcItem)(unsafe.Pointer(pSrc + 8)).FpTab
// FROM clause is not a view
- if (*Table)(unsafe.Pointer(pTab)).FnModuleArg != 0 {
+ if int32((*Table)(unsafe.Pointer(pTab)).FeTabType) == TABTYP_VTAB {
return uintptr(0)
} // FROM clause not a virtual table
pEList = (*Select)(unsafe.Pointer(p)).FpEList
// All SELECT results must be columns.
for i = 0; i < (*ExprList)(unsafe.Pointer(pEList)).FnExpr; i++ {
- var pRes uintptr = (*ExprList_item)(unsafe.Pointer((pEList + 8 /* &.a */) + uintptr(i)*20)).FpExpr
+ var pRes uintptr = (*ExprList_item)(unsafe.Pointer(pEList + 8 + uintptr(i)*20)).FpExpr
if int32((*Expr)(unsafe.Pointer(pRes)).Fop) != TK_COLUMN {
return uintptr(0)
}
@@ -83078,7 +84171,7 @@ func isCandidateForInOpt(tls *libc.TLS, pX uintptr) uintptr { /* sqlite3.c:10366
// it contains any NULL entries. Cause the register at regHasNull to be set
// to a non-NULL value if iCur contains no NULLs. Cause register regHasNull
// to be set to NULL if iCur contains one or more NULL values.
-func sqlite3SetHasNullFlag(tls *libc.TLS, v uintptr, iCur int32, regHasNull int32) { /* sqlite3.c:103710:13: */
+func sqlite3SetHasNullFlag(tls *libc.TLS, v uintptr, iCur int32, regHasNull int32) { /* sqlite3.c:104201:13: */
var addr1 int32
Xsqlite3VdbeAddOp2(tls, v, OP_Integer, 0, regHasNull)
addr1 = Xsqlite3VdbeAddOp1(tls, v, OP_Rewind, iCur)
@@ -83090,7 +84183,7 @@ func sqlite3SetHasNullFlag(tls *libc.TLS, v uintptr, iCur int32, regHasNull int3
// The argument is an IN operator with a list (not a subquery) on the
// right-hand side. Return TRUE if that list is constant.
-func sqlite3InRhsIsConstant(tls *libc.TLS, pIn uintptr) int32 { /* sqlite3.c:103727:12: */
+func sqlite3InRhsIsConstant(tls *libc.TLS, pIn uintptr) int32 { /* sqlite3.c:104218:12: */
var pLHS uintptr
var res int32
@@ -83179,7 +84272,7 @@ func sqlite3InRhsIsConstant(tls *libc.TLS, pIn uintptr) int32 { /* sqlite3.c:103
// CREATE INDEX i1 ON t1(b, c, a);
//
// then aiMap[] is populated with {2, 0, 1}.
-func Xsqlite3FindInIndex(tls *libc.TLS, pParse uintptr, pX uintptr, inFlags U32, prRhsHasNull uintptr, aiMap uintptr, piTab uintptr) int32 { /* sqlite3.c:103820:20: */
+func Xsqlite3FindInIndex(tls *libc.TLS, pParse uintptr, pX uintptr, inFlags U32, prRhsHasNull uintptr, aiMap uintptr, piTab uintptr) int32 { /* sqlite3.c:104311:20: */
bp := tls.Alloc(16)
defer tls.Free(16)
@@ -83189,18 +84282,18 @@ func Xsqlite3FindInIndex(tls *libc.TLS, pParse uintptr, pX uintptr, inFlags U32,
var mustBeUnique int32 // True if RHS must be unique
var v uintptr = Xsqlite3GetVdbe(tls, pParse) // Virtual machine being coded
- mustBeUnique = (libc.Bool32((inFlags & U32(IN_INDEX_LOOP)) != U32(0)))
+ mustBeUnique = libc.Bool32(inFlags&U32(IN_INDEX_LOOP) != U32(0))
// If the RHS of this IN(...) operator is a SELECT, and if it matters
// whether or not the SELECT result contains NULL values, check whether
// or not NULL is actually possible (it may not be, for example, due
// to NOT NULL constraints in the schema). If no NULL values are possible,
// set prRhsHasNull to 0 before continuing.
- if (prRhsHasNull != 0) && (((*Expr)(unsafe.Pointer(pX)).Fflags & U32(EP_xIsSelect)) != 0) {
+ if prRhsHasNull != 0 && (*Expr)(unsafe.Pointer(pX)).Fflags&U32(EP_xIsSelect) != U32(0) {
var i int32
- var pEList uintptr = (*Select)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pX + 20 /* &.x */)))).FpEList
+ var pEList uintptr = (*Select)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pX + 20)))).FpEList
for i = 0; i < (*ExprList)(unsafe.Pointer(pEList)).FnExpr; i++ {
- if Xsqlite3ExprCanBeNull(tls, (*ExprList_item)(unsafe.Pointer((pEList+8 /* &.a */)+uintptr(i)*20)).FpExpr) != 0 {
+ if Xsqlite3ExprCanBeNull(tls, (*ExprList_item)(unsafe.Pointer(pEList+8+uintptr(i)*20)).FpExpr) != 0 {
break
}
}
@@ -83212,7 +84305,7 @@ func Xsqlite3FindInIndex(tls *libc.TLS, pParse uintptr, pX uintptr, inFlags U32,
// Check to see if an existing table or index can be used to
// satisfy the query. This is preferable to generating a new
// ephemeral table.
- if ((*Parse)(unsafe.Pointer(pParse)).FnErr == 0) && ((libc.AssignUintptr(&p, isCandidateForInOpt(tls, pX))) != uintptr(0)) {
+ if (*Parse)(unsafe.Pointer(pParse)).FnErr == 0 && libc.AssignUintptr(&p, isCandidateForInOpt(tls, pX)) != uintptr(0) {
var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb // Database connection
var pTab uintptr // Table <table>.
var iDb int32 // Database idx for pTab
@@ -83222,7 +84315,7 @@ func Xsqlite3FindInIndex(tls *libc.TLS, pParse uintptr, pX uintptr, inFlags U32,
// Because of isCandidateForInOpt(p)
// Because of isCandidateForInOpt(p)
// Because of isCandidateForInOpt(p)
- pTab = (*SrcItem)(unsafe.Pointer(((*Select)(unsafe.Pointer(p)).FpSrc + 8 /* &.a */))).FpTab
+ pTab = (*SrcItem)(unsafe.Pointer((*Select)(unsafe.Pointer(p)).FpSrc + 8)).FpTab
// Code an OP_Transaction and OP_TableLock for <table>.
iDb = Xsqlite3SchemaToIndex(tls, db, (*Table)(unsafe.Pointer(pTab)).FpSchema)
@@ -83231,13 +84324,13 @@ func Xsqlite3FindInIndex(tls *libc.TLS, pParse uintptr, pX uintptr, inFlags U32,
Xsqlite3TableLock(tls, pParse, iDb, (*Table)(unsafe.Pointer(pTab)).Ftnum, uint8(0), (*Table)(unsafe.Pointer(pTab)).FzName)
// sqlite3GetVdbe() has always been previously called
- if (nExpr == 1) && (int32((*Expr)(unsafe.Pointer((*ExprList_item)(unsafe.Pointer((pEList + 8 /* &.a */))).FpExpr)).FiColumn) < 0) {
+ if nExpr == 1 && int32((*Expr)(unsafe.Pointer((*ExprList_item)(unsafe.Pointer(pEList+8)).FpExpr)).FiColumn) < 0 {
// The "x IN (SELECT rowid FROM table)" case
var iAddr int32 = Xsqlite3VdbeAddOp0(tls, v, OP_Once)
Xsqlite3OpenTable(tls, pParse, iTab, iDb, pTab, OP_OpenRead)
eType = IN_INDEX_ROWID
- Xsqlite3VdbeExplain(tls, pParse, uint8(0), ts+6698 /* "USING ROWID SEAR..." */, libc.VaList(bp, (*Table)(unsafe.Pointer(pTab)).FzName))
+ Xsqlite3VdbeExplain(tls, pParse, uint8(0), ts+7591 /* "USING ROWID SEAR..." */, libc.VaList(bp, (*Table)(unsafe.Pointer(pTab)).FzName))
Xsqlite3VdbeJumpHere(tls, v, iAddr)
} else {
var pIdx uintptr // Iterator variable
@@ -83248,9 +84341,9 @@ func Xsqlite3FindInIndex(tls *libc.TLS, pParse uintptr, pX uintptr, inFlags U32,
// comparison is the same as the affinity of each column in table
// on the RHS of the IN operator. If it not, it is not possible to
// use any index of the RHS table.
- for i = 0; (i < nExpr) && (affinity_ok != 0); i++ {
+ for i = 0; i < nExpr && affinity_ok != 0; i++ {
var pLhs uintptr = Xsqlite3VectorFieldSubexpr(tls, (*Expr)(unsafe.Pointer(pX)).FpLeft, i)
- var iCol int32 = int32((*Expr)(unsafe.Pointer((*ExprList_item)(unsafe.Pointer((pEList + 8 /* &.a */) + uintptr(i)*20)).FpExpr)).FiColumn)
+ var iCol int32 = int32((*Expr)(unsafe.Pointer((*ExprList_item)(unsafe.Pointer(pEList + 8 + uintptr(i)*20)).FpExpr)).FiColumn)
var idxaff uint8 = Xsqlite3TableColumnAffinity(tls, pTab, iCol) // RHS table
var cmpaff uint8 = Xsqlite3CompareAffinity(tls, pLhs, idxaff)
@@ -83267,13 +84360,13 @@ func Xsqlite3FindInIndex(tls *libc.TLS, pParse uintptr, pX uintptr, inFlags U32,
break
fallthrough
default:
- affinity_ok = (libc.Bool32((int32(idxaff)) >= SQLITE_AFF_NUMERIC))
+ affinity_ok = libc.Bool32(int32(idxaff) >= SQLITE_AFF_NUMERIC)
}
}
if affinity_ok != 0 {
// Search for an existing index that will work for this IN operator
- for pIdx = (*Table)(unsafe.Pointer(pTab)).FpIndex; (pIdx != 0) && (eType == 0); pIdx = (*Index)(unsafe.Pointer(pIdx)).FpNext {
+ for pIdx = (*Table)(unsafe.Pointer(pTab)).FpIndex; pIdx != 0 && eType == 0; pIdx = (*Index)(unsafe.Pointer(pIdx)).FpNext {
var colUsed Bitmask // Columns of the index used
var mCol Bitmask // Mask for the current column
if int32((*Index)(unsafe.Pointer(pIdx)).FnColumn) < nExpr {
@@ -83285,12 +84378,12 @@ func Xsqlite3FindInIndex(tls *libc.TLS, pParse uintptr, pX uintptr, inFlags U32,
// Maximum nColumn is BMS-2, not BMS-1, so that we can compute
// BITMASK(nExpr) without overflowing
- if int32((*Index)(unsafe.Pointer(pIdx)).FnColumn) >= ((int32(uint32(unsafe.Sizeof(Bitmask(0))) * uint32(8))) - 1) {
+ if int32((*Index)(unsafe.Pointer(pIdx)).FnColumn) >= int32(uint32(unsafe.Sizeof(Bitmask(0)))*uint32(8))-1 {
continue
}
if mustBeUnique != 0 {
- if (int32((*Index)(unsafe.Pointer(pIdx)).FnKeyCol) > nExpr) ||
- ((int32((*Index)(unsafe.Pointer(pIdx)).FnColumn) > nExpr) && !(int32((*Index)(unsafe.Pointer((pIdx))).FonError) != OE_None)) {
+ if int32((*Index)(unsafe.Pointer(pIdx)).FnKeyCol) > nExpr ||
+ int32((*Index)(unsafe.Pointer(pIdx)).FnColumn) > nExpr && !(int32((*Index)(unsafe.Pointer(pIdx)).FonError) != OE_None) {
continue // This index is not unique over the IN RHS columns
}
}
@@ -83298,7 +84391,7 @@ func Xsqlite3FindInIndex(tls *libc.TLS, pParse uintptr, pX uintptr, inFlags U32,
colUsed = uint64(0) // Columns of index used so far
for i = 0; i < nExpr; i++ {
var pLhs uintptr = Xsqlite3VectorFieldSubexpr(tls, (*Expr)(unsafe.Pointer(pX)).FpLeft, i)
- var pRhs uintptr = (*ExprList_item)(unsafe.Pointer((pEList + 8 /* &.a */) + uintptr(i)*20)).FpExpr
+ var pRhs uintptr = (*ExprList_item)(unsafe.Pointer(pEList + 8 + uintptr(i)*20)).FpExpr
var pReq uintptr = Xsqlite3BinaryCompareCollSeq(tls, pParse, pLhs, pRhs)
var j int32
@@ -83307,7 +84400,7 @@ func Xsqlite3FindInIndex(tls *libc.TLS, pParse uintptr, pX uintptr, inFlags U32,
continue
}
- if (pReq != uintptr(0)) && (Xsqlite3StrICmp(tls, (*CollSeq)(unsafe.Pointer(pReq)).FzName, *(*uintptr)(unsafe.Pointer((*Index)(unsafe.Pointer(pIdx)).FazColl + uintptr(j)*4))) != 0) {
+ if pReq != uintptr(0) && Xsqlite3StrICmp(tls, (*CollSeq)(unsafe.Pointer(pReq)).FzName, *(*uintptr)(unsafe.Pointer((*Index)(unsafe.Pointer(pIdx)).FazColl + uintptr(j)*4))) != 0 {
continue
}
break
@@ -83315,24 +84408,24 @@ func Xsqlite3FindInIndex(tls *libc.TLS, pParse uintptr, pX uintptr, inFlags U32,
if j == nExpr {
break
}
- mCol = (Bitmask((uint64(1))) << (j))
- if (mCol & colUsed) != 0 {
+ mCol = Bitmask(uint64(1)) << j
+ if mCol&colUsed != 0 {
break
} // Each column used only once
- colUsed = colUsed | (mCol)
+ colUsed = colUsed | mCol
if aiMap != 0 {
*(*int32)(unsafe.Pointer(aiMap + uintptr(i)*4)) = j
}
}
- if colUsed == ((Bitmask((uint64(1))) << (nExpr)) - uint64(1)) {
+ if colUsed == Bitmask(uint64(1))<<nExpr-uint64(1) {
// If we reach this point, that means the index pIdx is usable
var iAddr int32 = Xsqlite3VdbeAddOp0(tls, v, OP_Once)
- Xsqlite3VdbeExplain(tls, pParse, uint8(0), ts+6745 /* "USING INDEX %s F..." */, libc.VaList(bp+8, (*Index)(unsafe.Pointer(pIdx)).FzName))
+ Xsqlite3VdbeExplain(tls, pParse, uint8(0), ts+7638 /* "USING INDEX %s F..." */, libc.VaList(bp+8, (*Index)(unsafe.Pointer(pIdx)).FzName))
Xsqlite3VdbeAddOp3(tls, v, OP_OpenRead, iTab, int32((*Index)(unsafe.Pointer(pIdx)).Ftnum), iDb)
Xsqlite3VdbeSetP4KeyInfo(tls, pParse, pIdx)
- eType = (IN_INDEX_INDEX_ASC + int32(*(*U8)(unsafe.Pointer((*Index)(unsafe.Pointer(pIdx)).FaSortOrder))))
+ eType = IN_INDEX_INDEX_ASC + int32(*(*U8)(unsafe.Pointer((*Index)(unsafe.Pointer(pIdx)).FaSortOrder)))
if prRhsHasNull != 0 {
*(*int32)(unsafe.Pointer(prRhsHasNull)) = libc.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1)
@@ -83353,10 +84446,10 @@ func Xsqlite3FindInIndex(tls *libc.TLS, pParse uintptr, pX uintptr, inFlags U32,
// and the RHS is not constant or has two or fewer terms,
// then it is not worth creating an ephemeral table to evaluate
// the IN operator so return IN_INDEX_NOOP.
- if (((eType == 0) &&
- ((inFlags & U32(IN_INDEX_NOOP_OK)) != 0)) &&
- !(((*Expr)(unsafe.Pointer((pX))).Fflags & (U32(EP_xIsSelect))) != U32(0))) &&
- (!(sqlite3InRhsIsConstant(tls, pX) != 0) || ((*ExprList)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pX + 20 /* &.x */)))).FnExpr <= 2)) {
+ if eType == 0 &&
+ inFlags&U32(IN_INDEX_NOOP_OK) != 0 &&
+ (*Expr)(unsafe.Pointer(pX)).Fflags&U32(EP_xIsSelect) == U32(0) &&
+ (!(sqlite3InRhsIsConstant(tls, pX) != 0) || (*ExprList)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pX + 20)))).FnExpr <= 2) {
eType = IN_INDEX_NOOP
}
@@ -83366,7 +84459,7 @@ func Xsqlite3FindInIndex(tls *libc.TLS, pParse uintptr, pX uintptr, inFlags U32,
var savedNQueryLoop U32 = (*Parse)(unsafe.Pointer(pParse)).FnQueryLoop
var rMayHaveNull int32 = 0
eType = IN_INDEX_EPH
- if (inFlags & U32(IN_INDEX_LOOP)) != 0 {
+ if inFlags&U32(IN_INDEX_LOOP) != 0 {
(*Parse)(unsafe.Pointer(pParse)).FnQueryLoop = U32(0)
} else if prRhsHasNull != 0 {
*(*int32)(unsafe.Pointer(prRhsHasNull)) = libc.AssignInt32(&rMayHaveNull, libc.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1))
@@ -83379,7 +84472,7 @@ func Xsqlite3FindInIndex(tls *libc.TLS, pParse uintptr, pX uintptr, inFlags U32,
(*Parse)(unsafe.Pointer(pParse)).FnQueryLoop = savedNQueryLoop
}
- if ((aiMap != 0) && (eType != IN_INDEX_INDEX_ASC)) && (eType != IN_INDEX_INDEX_DESC) {
+ if aiMap != 0 && eType != IN_INDEX_INDEX_ASC && eType != IN_INDEX_INDEX_DESC {
var i int32
var n int32
n = Xsqlite3ExprVectorSize(tls, (*Expr)(unsafe.Pointer(pX)).FpLeft)
@@ -83397,25 +84490,25 @@ func Xsqlite3FindInIndex(tls *libc.TLS, pParse uintptr, pX uintptr, inFlags U32,
//
// It is the responsibility of the caller to ensure that the returned
// string is eventually freed using sqlite3DbFree().
-func exprINAffinity(tls *libc.TLS, pParse uintptr, pExpr uintptr) uintptr { /* sqlite3.c:104043:13: */
+func exprINAffinity(tls *libc.TLS, pParse uintptr, pExpr uintptr) uintptr { /* sqlite3.c:104535:13: */
var pLeft uintptr = (*Expr)(unsafe.Pointer(pExpr)).FpLeft
var nVal int32 = Xsqlite3ExprVectorSize(tls, pLeft)
var pSelect uintptr
- if ((*Expr)(unsafe.Pointer(pExpr)).Fflags & U32(EP_xIsSelect)) != 0 {
- pSelect = *(*uintptr)(unsafe.Pointer(pExpr + 20 /* &.x */))
+ if (*Expr)(unsafe.Pointer(pExpr)).Fflags&U32(EP_xIsSelect) != U32(0) {
+ pSelect = *(*uintptr)(unsafe.Pointer(pExpr + 20))
} else {
pSelect = uintptr(0)
}
var zRet uintptr
- zRet = Xsqlite3DbMallocRaw(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, (uint64(nVal + 1)))
+ zRet = Xsqlite3DbMallocRaw(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, uint64(nVal+1))
if zRet != 0 {
var i int32
for i = 0; i < nVal; i++ {
var pA uintptr = Xsqlite3VectorFieldSubexpr(tls, pLeft, i)
var a uint8 = Xsqlite3ExprAffinity(tls, pA)
if pSelect != 0 {
- *(*uint8)(unsafe.Pointer(zRet + uintptr(i))) = Xsqlite3CompareAffinity(tls, (*ExprList_item)(unsafe.Pointer(((*Select)(unsafe.Pointer(pSelect)).FpEList+8 /* &.a */)+uintptr(i)*20)).FpExpr, a)
+ *(*uint8)(unsafe.Pointer(zRet + uintptr(i))) = Xsqlite3CompareAffinity(tls, (*ExprList_item)(unsafe.Pointer((*Select)(unsafe.Pointer(pSelect)).FpEList+8+uintptr(i)*20)).FpExpr, a)
} else {
*(*uint8)(unsafe.Pointer(zRet + uintptr(i))) = a
}
@@ -83429,12 +84522,12 @@ func exprINAffinity(tls *libc.TLS, pParse uintptr, pExpr uintptr) uintptr { /* s
// message of the form:
//
// "sub-select returns N columns - expected M"
-func Xsqlite3SubselectError(tls *libc.TLS, pParse uintptr, nActual int32, nExpect int32) { /* sqlite3.c:104075:21: */
+func Xsqlite3SubselectError(tls *libc.TLS, pParse uintptr, nActual int32, nExpect int32) { /* sqlite3.c:104567:21: */
bp := tls.Alloc(16)
defer tls.Free(16)
if (*Parse)(unsafe.Pointer(pParse)).FnErr == 0 {
- var zFmt uintptr = ts + 6776 /* "sub-select retur..." */
+ var zFmt uintptr = ts + 7669 /* "sub-select retur..." */
Xsqlite3ErrorMsg(tls, pParse, zFmt, libc.VaList(bp, nActual, nExpect))
}
}
@@ -83448,11 +84541,11 @@ func Xsqlite3SubselectError(tls *libc.TLS, pParse uintptr, nActual int32, nExpec
// Or, if it is a regular scalar vector:
//
// "row value misused"
-func Xsqlite3VectorErrorMsg(tls *libc.TLS, pParse uintptr, pExpr uintptr) { /* sqlite3.c:104094:21: */
- if ((*Expr)(unsafe.Pointer(pExpr)).Fflags & U32(EP_xIsSelect)) != 0 {
- Xsqlite3SubselectError(tls, pParse, (*ExprList)(unsafe.Pointer((*Select)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pExpr + 20 /* &.x */)))).FpEList)).FnExpr, 1)
+func Xsqlite3VectorErrorMsg(tls *libc.TLS, pParse uintptr, pExpr uintptr) { /* sqlite3.c:104586:21: */
+ if (*Expr)(unsafe.Pointer(pExpr)).Fflags&U32(EP_xIsSelect) != U32(0) {
+ Xsqlite3SubselectError(tls, pParse, (*ExprList)(unsafe.Pointer((*Select)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pExpr + 20)))).FpEList)).FnExpr, 1)
} else {
- Xsqlite3ErrorMsg(tls, pParse, ts+5548 /* "row value misuse..." */, 0)
+ Xsqlite3ErrorMsg(tls, pParse, ts+6395 /* "row value misuse..." */, 0)
}
}
@@ -83476,7 +84569,7 @@ func Xsqlite3VectorErrorMsg(tls *libc.TLS, pParse uintptr, pExpr uintptr) { /* s
// if either column has NUMERIC or INTEGER affinity. If neither
// 'x' nor the SELECT... statement are columns, then numeric affinity
// is used.
-func Xsqlite3CodeRhsOfIN(tls *libc.TLS, pParse uintptr, pExpr uintptr, iTab int32) { /* sqlite3.c:104128:21: */
+func Xsqlite3CodeRhsOfIN(tls *libc.TLS, pParse uintptr, pExpr uintptr, iTab int32) { /* sqlite3.c:104620:21: */
bp := tls.Alloc(53)
defer tls.Free(53)
@@ -83498,27 +84591,29 @@ func Xsqlite3CodeRhsOfIN(tls *libc.TLS, pParse uintptr, pExpr uintptr, iTab int3
//
// If all of the above are false, then we can compute the RHS just once
// and reuse it many names.
- if !(((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_VarSelect))) != U32(0)) && ((*Parse)(unsafe.Pointer(pParse)).FiSelfTab == 0) {
+ if !((*Expr)(unsafe.Pointer(pExpr)).Fflags&U32(EP_VarSelect) != U32(0)) && (*Parse)(unsafe.Pointer(pParse)).FiSelfTab == 0 {
// Reuse of the RHS is allowed
// If this routine has already been coded, but the previous code
// might not have been invoked yet, so invoke it now as a subroutine.
- if ((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_Subrtn))) != U32(0) {
+ if (*Expr)(unsafe.Pointer(pExpr)).Fflags&U32(EP_Subrtn) != U32(0) {
addrOnce = Xsqlite3VdbeAddOp0(tls, v, OP_Once)
- if ((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_xIsSelect))) != U32(0) {
- Xsqlite3VdbeExplain(tls, pParse, uint8(0), ts+6820 /* "REUSE LIST SUBQU..." */, libc.VaList(bp, (*Select)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pExpr + 20 /* &.x */)))).FselId))
+ if (*Expr)(unsafe.Pointer(pExpr)).Fflags&U32(EP_xIsSelect) != U32(0) {
+ Xsqlite3VdbeExplain(tls, pParse, uint8(0), ts+7713 /* "REUSE LIST SUBQU..." */, libc.VaList(bp, (*Select)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pExpr + 20)))).FselId))
}
- Xsqlite3VdbeAddOp2(tls, v, OP_Gosub, *(*int32)(unsafe.Pointer(pExpr + 44 /* &.y */ /* &.sub */ + 4 /* &.regReturn */)),
- *(*int32)(unsafe.Pointer(pExpr + 44 /* &.y */ /* &.sub */ /* &.iAddr */)))
+
+ Xsqlite3VdbeAddOp2(tls, v, OP_Gosub, *(*int32)(unsafe.Pointer(pExpr + 44 + 4 /* &.regReturn */)),
+ *(*int32)(unsafe.Pointer(pExpr + 44)))
Xsqlite3VdbeAddOp2(tls, v, OP_OpenDup, iTab, (*Expr)(unsafe.Pointer(pExpr)).FiTable)
Xsqlite3VdbeJumpHere(tls, v, addrOnce)
return
}
// Begin coding the subroutine
- *(*U32)(unsafe.Pointer(pExpr + 4 /* &.flags */)) |= (U32(EP_Subrtn))
- *(*int32)(unsafe.Pointer(pExpr + 44 /* &.y */ /* &.sub */ + 4 /* &.regReturn */)) = libc.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1)
- *(*int32)(unsafe.Pointer(pExpr + 44 /* &.y */ /* &.sub */ /* &.iAddr */)) = (Xsqlite3VdbeAddOp2(tls, v, OP_Integer, 0, *(*int32)(unsafe.Pointer(pExpr + 44 /* &.y */ /* &.sub */ + 4 /* &.regReturn */))) + 1)
+ *(*U32)(unsafe.Pointer(pExpr + 4)) |= U32(EP_Subrtn)
+
+ *(*int32)(unsafe.Pointer(pExpr + 44 + 4 /* &.regReturn */)) = libc.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1)
+ *(*int32)(unsafe.Pointer(pExpr + 44)) = Xsqlite3VdbeAddOp2(tls, v, OP_Integer, 0, *(*int32)(unsafe.Pointer(pExpr + 44 + 4))) + 1
addrOnce = Xsqlite3VdbeAddOp0(tls, v, OP_Once)
}
@@ -83533,19 +84628,19 @@ func Xsqlite3CodeRhsOfIN(tls *libc.TLS, pParse uintptr, pExpr uintptr, iTab int3
addr = Xsqlite3VdbeAddOp2(tls, v, OP_OpenEphemeral, (*Expr)(unsafe.Pointer(pExpr)).FiTable, nVal)
pKeyInfo = Xsqlite3KeyInfoAlloc(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, nVal, 1)
- if ((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_xIsSelect))) != U32(0) {
+ if (*Expr)(unsafe.Pointer(pExpr)).Fflags&U32(EP_xIsSelect) != U32(0) {
// Case 1: expr IN (SELECT ...)
//
// Generate code to write the results of the select into the temporary
// table allocated and opened above.
- var pSelect uintptr = *(*uintptr)(unsafe.Pointer(pExpr + 20 /* &.x */))
+ var pSelect uintptr = *(*uintptr)(unsafe.Pointer(pExpr + 20))
var pEList uintptr = (*Select)(unsafe.Pointer(pSelect)).FpEList
- Xsqlite3VdbeExplain(tls, pParse, uint8(1), ts+6843 /* "%sLIST SUBQUERY ..." */, libc.VaList(bp+8, func() uintptr {
+ Xsqlite3VdbeExplain(tls, pParse, uint8(1), ts+7736 /* "%sLIST SUBQUERY ..." */, libc.VaList(bp+8, func() uintptr {
if addrOnce != 0 {
- return ts + 755 /* "" */
+ return ts + 1543 /* "" */
}
- return ts + 6862 /* "CORRELATED " */
+ return ts + 7755 /* "CORRELATED " */
}(), (*Select)(unsafe.Pointer(pSelect)).FselId))
// If the LHS and RHS of the IN operator do not match, that
// error will have been caught long before we reach this point.
@@ -83576,11 +84671,11 @@ func Xsqlite3CodeRhsOfIN(tls *libc.TLS, pParse uintptr, pExpr uintptr, iTab int3
for i = 0; i < nVal; i++ {
var p uintptr = Xsqlite3VectorFieldSubexpr(tls, pLeft, i)
- *(*uintptr)(unsafe.Pointer((pKeyInfo + 20 /* &.aColl */) + uintptr(i)*4)) = Xsqlite3BinaryCompareCollSeq(tls,
- pParse, p, (*ExprList_item)(unsafe.Pointer((pEList+8 /* &.a */)+uintptr(i)*20)).FpExpr)
+ *(*uintptr)(unsafe.Pointer(pKeyInfo + 20 + uintptr(i)*4)) = Xsqlite3BinaryCompareCollSeq(tls,
+ pParse, p, (*ExprList_item)(unsafe.Pointer(pEList+8+uintptr(i)*20)).FpExpr)
}
}
- } else if *(*uintptr)(unsafe.Pointer(pExpr + 20 /* &.x */)) != uintptr(0) {
+ } else if *(*uintptr)(unsafe.Pointer(pExpr + 20)) != uintptr(0) {
// Case 2: expr IN (exprlist)
//
// For each expression, build an index key from the evaluation and
@@ -83590,19 +84685,19 @@ func Xsqlite3CodeRhsOfIN(tls *libc.TLS, pParse uintptr, pExpr uintptr, iTab int3
// var affinity uint8 at bp+52, 1
// Affinity of the LHS of the IN
var i int32
- var pList uintptr = *(*uintptr)(unsafe.Pointer(pExpr + 20 /* &.x */))
+ var pList uintptr = *(*uintptr)(unsafe.Pointer(pExpr + 20))
var pItem uintptr
var r1 int32
var r2 int32
*(*uint8)(unsafe.Pointer(bp + 52 /* affinity */)) = Xsqlite3ExprAffinity(tls, pLeft)
- if int32(*(*uint8)(unsafe.Pointer(bp + 52 /* affinity */))) <= SQLITE_AFF_NONE {
+ if int32(*(*uint8)(unsafe.Pointer(bp + 52))) <= SQLITE_AFF_NONE {
*(*uint8)(unsafe.Pointer(bp + 52 /* affinity */)) = uint8(SQLITE_AFF_BLOB)
- } else if int32(*(*uint8)(unsafe.Pointer(bp + 52 /* affinity */))) == SQLITE_AFF_REAL {
+ } else if int32(*(*uint8)(unsafe.Pointer(bp + 52))) == SQLITE_AFF_REAL {
*(*uint8)(unsafe.Pointer(bp + 52 /* affinity */)) = uint8(SQLITE_AFF_NUMERIC)
}
if pKeyInfo != 0 {
- *(*uintptr)(unsafe.Pointer((pKeyInfo + 20 /* &.aColl */))) = Xsqlite3ExprCollSeq(tls, pParse, (*Expr)(unsafe.Pointer(pExpr)).FpLeft)
+ *(*uintptr)(unsafe.Pointer(pKeyInfo + 20)) = Xsqlite3ExprCollSeq(tls, pParse, (*Expr)(unsafe.Pointer(pExpr)).FpLeft)
}
// Loop through each expression in <exprlist>.
@@ -83621,9 +84716,9 @@ func Xsqlite3CodeRhsOfIN(tls *libc.TLS, pParse uintptr, pExpr uintptr, iTab int3
// disable the test that was generated above that makes sure
// this code only executes once. Because for a non-constant
// expression we need to rerun this code each time.
- if (addrOnce != 0) && !(Xsqlite3ExprIsConstant(tls, pE2) != 0) {
+ if addrOnce != 0 && !(Xsqlite3ExprIsConstant(tls, pE2) != 0) {
Xsqlite3VdbeChangeToNoop(tls, v, addrOnce)
- *(*U32)(unsafe.Pointer(pExpr + 4 /* &.flags */)) &= (libc.Uint32FromInt32(libc.CplInt32(EP_Subrtn)))
+ *(*U32)(unsafe.Pointer(pExpr + 4)) &= libc.Uint32FromInt32(libc.CplInt32(EP_Subrtn))
addrOnce = 0
}
@@ -83650,8 +84745,9 @@ func Xsqlite3CodeRhsOfIN(tls *libc.TLS, pParse uintptr, pExpr uintptr, iTab int3
if addrOnce != 0 {
Xsqlite3VdbeJumpHere(tls, v, addrOnce)
// Subroutine return
- Xsqlite3VdbeAddOp1(tls, v, OP_Return, *(*int32)(unsafe.Pointer(pExpr + 44 /* &.y */ /* &.sub */ + 4 /* &.regReturn */)))
- Xsqlite3VdbeChangeP1(tls, v, (*(*int32)(unsafe.Pointer((pExpr + 44 /* &.y */ /* &.sub */) /* &.iAddr */)) - 1), (Xsqlite3VdbeCurrentAddr(tls, v) - 1))
+
+ Xsqlite3VdbeAddOp1(tls, v, OP_Return, *(*int32)(unsafe.Pointer(pExpr + 44 + 4 /* &.regReturn */)))
+ Xsqlite3VdbeChangeP1(tls, v, *(*int32)(unsafe.Pointer(pExpr + 44))-1, Xsqlite3VdbeCurrentAddr(tls, v)-1)
Xsqlite3ClearTempRegCache(tls, pParse)
}
}
@@ -83668,7 +84764,7 @@ func Xsqlite3CodeRhsOfIN(tls *libc.TLS, pParse uintptr, pExpr uintptr, iTab int3
// the result is stored in a contiguous array of registers and the
// return value is the register of the left-most result column.
// Return 0 if an error occurs.
-func Xsqlite3CodeSubselect(tls *libc.TLS, pParse uintptr, pExpr uintptr) int32 { /* sqlite3.c:104320:20: */
+func Xsqlite3CodeSubselect(tls *libc.TLS, pParse uintptr, pExpr uintptr) int32 { /* sqlite3.c:104815:20: */
bp := tls.Alloc(52)
defer tls.Free(52)
@@ -83686,21 +84782,23 @@ func Xsqlite3CodeSubselect(tls *libc.TLS, pParse uintptr, pExpr uintptr) int32 {
return 0
}
- pSel = *(*uintptr)(unsafe.Pointer(pExpr + 20 /* &.x */))
+ pSel = *(*uintptr)(unsafe.Pointer(pExpr + 20))
// If this routine has already been coded, then invoke it as a
// subroutine.
- if ((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_Subrtn))) != U32(0) {
- Xsqlite3VdbeExplain(tls, pParse, uint8(0), ts+6874 /* "REUSE SUBQUERY %..." */, libc.VaList(bp, (*Select)(unsafe.Pointer(pSel)).FselId))
- Xsqlite3VdbeAddOp2(tls, v, OP_Gosub, *(*int32)(unsafe.Pointer(pExpr + 44 /* &.y */ /* &.sub */ + 4 /* &.regReturn */)),
- *(*int32)(unsafe.Pointer(pExpr + 44 /* &.y */ /* &.sub */ /* &.iAddr */)))
+ if (*Expr)(unsafe.Pointer(pExpr)).Fflags&U32(EP_Subrtn) != U32(0) {
+ Xsqlite3VdbeExplain(tls, pParse, uint8(0), ts+7767 /* "REUSE SUBQUERY %..." */, libc.VaList(bp, (*Select)(unsafe.Pointer(pSel)).FselId))
+
+ Xsqlite3VdbeAddOp2(tls, v, OP_Gosub, *(*int32)(unsafe.Pointer(pExpr + 44 + 4 /* &.regReturn */)),
+ *(*int32)(unsafe.Pointer(pExpr + 44)))
return (*Expr)(unsafe.Pointer(pExpr)).FiTable
}
// Begin coding the subroutine
- *(*U32)(unsafe.Pointer(pExpr + 4 /* &.flags */)) |= (U32(EP_Subrtn))
- *(*int32)(unsafe.Pointer(pExpr + 44 /* &.y */ /* &.sub */ + 4 /* &.regReturn */)) = libc.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1)
- *(*int32)(unsafe.Pointer(pExpr + 44 /* &.y */ /* &.sub */ /* &.iAddr */)) = (Xsqlite3VdbeAddOp2(tls, v, OP_Integer, 0, *(*int32)(unsafe.Pointer(pExpr + 44 /* &.y */ /* &.sub */ + 4 /* &.regReturn */))) + 1)
+
+ *(*U32)(unsafe.Pointer(pExpr + 4)) |= U32(EP_Subrtn)
+ *(*int32)(unsafe.Pointer(pExpr + 44 + 4 /* &.regReturn */)) = libc.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1)
+ *(*int32)(unsafe.Pointer(pExpr + 44)) = Xsqlite3VdbeAddOp2(tls, v, OP_Integer, 0, *(*int32)(unsafe.Pointer(pExpr + 44 + 4))) + 1
// The evaluation of the EXISTS/SELECT must be repeated every time it
// is encountered if any of the following is true:
@@ -83711,7 +84809,7 @@ func Xsqlite3CodeSubselect(tls *libc.TLS, pParse uintptr, pExpr uintptr) int32 {
//
// If all of the above are false, then we can run this code just once
// save the results, and reuse the same result on subsequent invocations.
- if !(((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_VarSelect))) != U32(0)) {
+ if !((*Expr)(unsafe.Pointer(pExpr)).Fflags&U32(EP_VarSelect) != U32(0)) {
addrOnce = Xsqlite3VdbeAddOp0(tls, v, OP_Once)
}
@@ -83724,24 +84822,24 @@ func Xsqlite3CodeSubselect(tls *libc.TLS, pParse uintptr, pExpr uintptr) int32 {
//
// In both cases, the query is augmented with "LIMIT 1". Any
// preexisting limit is discarded in place of the new LIMIT 1.
- Xsqlite3VdbeExplain(tls, pParse, uint8(1), ts+6892 /* "%sSCALAR SUBQUER..." */, libc.VaList(bp+8, func() uintptr {
+ Xsqlite3VdbeExplain(tls, pParse, uint8(1), ts+7785 /* "%sSCALAR SUBQUER..." */, libc.VaList(bp+8, func() uintptr {
if addrOnce != 0 {
- return ts + 755 /* "" */
+ return ts + 1543 /* "" */
}
- return ts + 6862 /* "CORRELATED " */
+ return ts + 7755 /* "CORRELATED " */
}(), (*Select)(unsafe.Pointer(pSel)).FselId))
if int32((*Expr)(unsafe.Pointer(pExpr)).Fop) == TK_SELECT {
nReg = (*ExprList)(unsafe.Pointer((*Select)(unsafe.Pointer(pSel)).FpEList)).FnExpr
} else {
nReg = 1
}
- Xsqlite3SelectDestInit(tls, bp+24 /* &dest */, 0, ((*Parse)(unsafe.Pointer(pParse)).FnMem + 1))
- *(*int32)(unsafe.Pointer(pParse + 44 /* &.nMem */)) += (nReg)
+ Xsqlite3SelectDestInit(tls, bp+24 /* &dest */, 0, (*Parse)(unsafe.Pointer(pParse)).FnMem+1)
+ *(*int32)(unsafe.Pointer(pParse + 44)) += nReg
if int32((*Expr)(unsafe.Pointer(pExpr)).Fop) == TK_SELECT {
(*SelectDest)(unsafe.Pointer(bp + 24 /* &dest */)).FeDest = U8(SRT_Mem)
(*SelectDest)(unsafe.Pointer(bp + 24 /* &dest */)).FiSdst = (*SelectDest)(unsafe.Pointer(bp + 24 /* &dest */)).FiSDParm
(*SelectDest)(unsafe.Pointer(bp + 24 /* &dest */)).FnSdst = nReg
- Xsqlite3VdbeAddOp3(tls, v, OP_Null, 0, (*SelectDest)(unsafe.Pointer(bp+24 /* &dest */)).FiSDParm, (((*SelectDest)(unsafe.Pointer(bp+24 /* &dest */)).FiSDParm + nReg) - 1))
+ Xsqlite3VdbeAddOp3(tls, v, OP_Null, 0, (*SelectDest)(unsafe.Pointer(bp+24 /* &dest */)).FiSDParm, (*SelectDest)(unsafe.Pointer(bp+24)).FiSDParm+nReg-1)
} else {
(*SelectDest)(unsafe.Pointer(bp + 24 /* &dest */)).FeDest = U8(SRT_Exists)
@@ -83752,7 +84850,7 @@ func Xsqlite3CodeSubselect(tls *libc.TLS, pParse uintptr, pExpr uintptr) int32 {
// The subquery already has a limit. If the pre-existing limit is X
// then make the new limit X<>0 so that the new limit is either 1 or 0
var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb
- pLimit = Xsqlite3Expr(tls, db, TK_INTEGER, ts+6506 /* "0" */)
+ pLimit = Xsqlite3Expr(tls, db, TK_INTEGER, ts+7399 /* "0" */)
if pLimit != 0 {
(*Expr)(unsafe.Pointer(pLimit)).FaffExpr = uint8(SQLITE_AFF_NUMERIC)
pLimit = Xsqlite3PExpr(tls, pParse, TK_NE,
@@ -83762,11 +84860,11 @@ func Xsqlite3CodeSubselect(tls *libc.TLS, pParse uintptr, pExpr uintptr) int32 {
(*Expr)(unsafe.Pointer((*Select)(unsafe.Pointer(pSel)).FpLimit)).FpLeft = pLimit
} else {
// If there is no pre-existing limit add a limit of 1
- pLimit = Xsqlite3Expr(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, TK_INTEGER, ts+6913 /* "1" */)
+ pLimit = Xsqlite3Expr(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, TK_INTEGER, ts+7806 /* "1" */)
(*Select)(unsafe.Pointer(pSel)).FpLimit = Xsqlite3PExpr(tls, pParse, TK_LIMIT, pLimit, uintptr(0))
}
(*Select)(unsafe.Pointer(pSel)).FiLimit = 0
- if Xsqlite3Select(tls, pParse, pSel, bp+24 /* &dest */) != 0 {
+ if Xsqlite3Select(tls, pParse, pSel, bp+24) != 0 {
if (*Parse)(unsafe.Pointer(pParse)).FnErr != 0 {
(*Expr)(unsafe.Pointer(pExpr)).Fop2 = (*Expr)(unsafe.Pointer(pExpr)).Fop
(*Expr)(unsafe.Pointer(pExpr)).Fop = U8(TK_ERROR)
@@ -83780,8 +84878,9 @@ func Xsqlite3CodeSubselect(tls *libc.TLS, pParse uintptr, pExpr uintptr) int32 {
}
// Subroutine return
- Xsqlite3VdbeAddOp1(tls, v, OP_Return, *(*int32)(unsafe.Pointer(pExpr + 44 /* &.y */ /* &.sub */ + 4 /* &.regReturn */)))
- Xsqlite3VdbeChangeP1(tls, v, (*(*int32)(unsafe.Pointer((pExpr + 44 /* &.y */ /* &.sub */) /* &.iAddr */)) - 1), (Xsqlite3VdbeCurrentAddr(tls, v) - 1))
+
+ Xsqlite3VdbeAddOp1(tls, v, OP_Return, *(*int32)(unsafe.Pointer(pExpr + 44 + 4 /* &.regReturn */)))
+ Xsqlite3VdbeChangeP1(tls, v, *(*int32)(unsafe.Pointer(pExpr + 44))-1, Xsqlite3VdbeCurrentAddr(tls, v)-1)
Xsqlite3ClearTempRegCache(tls, pParse)
return rReg
}
@@ -83790,11 +84889,11 @@ func Xsqlite3CodeSubselect(tls *libc.TLS, pParse uintptr, pExpr uintptr) int32 {
// sub-select on the RHS of the IN() operator has the same number of
// columns as the vector on the LHS. Or, if the RHS of the IN() is not
// a sub-query, that the LHS is a vector of size 1.
-func Xsqlite3ExprCheckIN(tls *libc.TLS, pParse uintptr, pIn uintptr) int32 { /* sqlite3.c:104440:20: */
+func Xsqlite3ExprCheckIN(tls *libc.TLS, pParse uintptr, pIn uintptr) int32 { /* sqlite3.c:104939:20: */
var nVector int32 = Xsqlite3ExprVectorSize(tls, (*Expr)(unsafe.Pointer(pIn)).FpLeft)
- if (((*Expr)(unsafe.Pointer(pIn)).Fflags & U32(EP_xIsSelect)) != U32(0)) && !(int32((*Sqlite3)(unsafe.Pointer((*Parse)(unsafe.Pointer(pParse)).Fdb)).FmallocFailed) != 0) {
- if nVector != (*ExprList)(unsafe.Pointer((*Select)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pIn + 20 /* &.x */)))).FpEList)).FnExpr {
- Xsqlite3SubselectError(tls, pParse, (*ExprList)(unsafe.Pointer((*Select)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pIn + 20 /* &.x */)))).FpEList)).FnExpr, nVector)
+ if (*Expr)(unsafe.Pointer(pIn)).Fflags&U32(EP_xIsSelect) != U32(0) && !(int32((*Sqlite3)(unsafe.Pointer((*Parse)(unsafe.Pointer(pParse)).Fdb)).FmallocFailed) != 0) {
+ if nVector != (*ExprList)(unsafe.Pointer((*Select)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pIn + 20)))).FpEList)).FnExpr {
+ Xsqlite3SubselectError(tls, pParse, (*ExprList)(unsafe.Pointer((*Select)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pIn + 20)))).FpEList)).FnExpr, nVector)
return 1
}
} else if nVector != 1 {
@@ -83827,7 +84926,7 @@ func Xsqlite3ExprCheckIN(tls *libc.TLS, pParse uintptr, pIn uintptr) int32 { /*
//
// See the separate in-operator.md documentation file in the canonical
// SQLite source tree for additional information.
-func sqlite3ExprCodeIN(tls *libc.TLS, pParse uintptr, pExpr uintptr, destIfFalse int32, destIfNull int32) { /* sqlite3.c:104481:13: */
+func sqlite3ExprCodeIN(tls *libc.TLS, pParse uintptr, pExpr uintptr, destIfFalse int32, destIfNull int32) { /* sqlite3.c:104980:13: */
bp := tls.Alloc(16)
defer tls.Free(16)
@@ -83883,7 +84982,7 @@ __1:
zAff = exprINAffinity(tls, pParse, pExpr)
nVector = Xsqlite3ExprVectorSize(tls, (*Expr)(unsafe.Pointer(pExpr)).FpLeft)
aiMap = Xsqlite3DbMallocZero(tls,
- (*Parse)(unsafe.Pointer(pParse)).Fdb, (uint64((uint32(nVector) * (uint32(unsafe.Sizeof(int32(0))) + uint32(unsafe.Sizeof(uint8(0))))) + uint32(1))))
+ (*Parse)(unsafe.Pointer(pParse)).Fdb, uint64(uint32(nVector)*(uint32(unsafe.Sizeof(int32(0)))+uint32(unsafe.Sizeof(uint8(0))))+uint32(1)))
if !((*Sqlite3)(unsafe.Pointer((*Parse)(unsafe.Pointer(pParse)).Fdb)).FmallocFailed != 0) {
goto __2
}
@@ -83899,7 +84998,7 @@ __2:
// OOM detected prior to this routine
eType = Xsqlite3FindInIndex(tls, pParse, pExpr,
- (uint32(IN_INDEX_MEMBERSHIP | IN_INDEX_NOOP_OK)),
+ uint32(IN_INDEX_MEMBERSHIP|IN_INDEX_NOOP_OK),
func() uintptr {
if destIfFalse == destIfNull {
return uintptr(0)
@@ -83926,7 +85025,7 @@ __2:
(*Parse)(unsafe.Pointer(pParse)).FokConstFactor = okConstFactor
i = 0
__3:
- if !((i < nVector) && (*(*int32)(unsafe.Pointer(aiMap + uintptr(i)*4)) == i)) {
+ if !(i < nVector && *(*int32)(unsafe.Pointer(aiMap + uintptr(i)*4)) == i) {
goto __5
}
goto __4
@@ -83950,7 +85049,7 @@ __8:
if !(i < nVector) {
goto __10
}
- Xsqlite3VdbeAddOp3(tls, v, OP_Copy, (rLhsOrig + i), (rLhs + *(*int32)(unsafe.Pointer(aiMap + uintptr(i)*4))), 0)
+ Xsqlite3VdbeAddOp3(tls, v, OP_Copy, rLhsOrig+i, rLhs+*(*int32)(unsafe.Pointer(aiMap + uintptr(i)*4)), 0)
goto __9
__9:
i++
@@ -83969,11 +85068,11 @@ __7:
if !(eType == IN_INDEX_NOOP) {
goto __11
}
- pList = *(*uintptr)(unsafe.Pointer(pExpr + 20 /* &.x */))
- pColl = Xsqlite3ExprCollSeq(tls, pParse, (*Expr)(unsafe.Pointer(pExpr)).FpLeft)
labelOk = Xsqlite3VdbeMakeLabel(tls, pParse)
regCkNull = 0
+ pList = *(*uintptr)(unsafe.Pointer(pExpr + 20))
+ pColl = Xsqlite3ExprCollSeq(tls, pParse, (*Expr)(unsafe.Pointer(pExpr)).FpLeft)
if !(destIfNull != destIfFalse) {
goto __12
}
@@ -83986,15 +85085,15 @@ __13:
if !(ii < (*ExprList)(unsafe.Pointer(pList)).FnExpr) {
goto __15
}
- r2 = Xsqlite3ExprCodeTemp(tls, pParse, (*ExprList_item)(unsafe.Pointer((pList+8 /* &.a */)+uintptr(ii)*20)).FpExpr, bp+12 /* &regToFree */)
- if !((regCkNull != 0) && (Xsqlite3ExprCanBeNull(tls, (*ExprList_item)(unsafe.Pointer((pList+8 /* &.a */)+uintptr(ii)*20)).FpExpr) != 0)) {
+ r2 = Xsqlite3ExprCodeTemp(tls, pParse, (*ExprList_item)(unsafe.Pointer(pList+8+uintptr(ii)*20)).FpExpr, bp+12 /* &regToFree */)
+ if !(regCkNull != 0 && Xsqlite3ExprCanBeNull(tls, (*ExprList_item)(unsafe.Pointer(pList+8+uintptr(ii)*20)).FpExpr) != 0) {
goto __16
}
Xsqlite3VdbeAddOp3(tls, v, OP_BitAnd, regCkNull, r2, regCkNull)
__16:
;
Xsqlite3ReleaseTempReg(tls, pParse, *(*int32)(unsafe.Pointer(bp + 12 /* regToFree */)))
- if !((ii < ((*ExprList)(unsafe.Pointer(pList)).FnExpr - 1)) || (destIfNull != destIfFalse)) {
+ if !(ii < (*ExprList)(unsafe.Pointer(pList)).FnExpr-1 || destIfNull != destIfFalse) {
goto __17
}
if rLhs != r2 {
@@ -84017,7 +85116,7 @@ __17:
Xsqlite3VdbeAddOp4(tls, v, op1, rLhs, destIfFalse, r2,
pColl, -2)
- Xsqlite3VdbeChangeP5(tls, v, (uint16(int32(*(*uint8)(unsafe.Pointer(zAff))) | SQLITE_JUMPIFNULL)))
+ Xsqlite3VdbeChangeP5(tls, v, uint16(int32(*(*uint8)(unsafe.Pointer(zAff)))|SQLITE_JUMPIFNULL))
__18:
;
goto __14
@@ -84073,7 +85172,7 @@ __26:
if !(Xsqlite3ExprCanBeNull(tls, p) != 0) {
goto __27
}
- Xsqlite3VdbeAddOp2(tls, v, OP_IsNull, (rLhs + i), destStep2)
+ Xsqlite3VdbeAddOp2(tls, v, OP_IsNull, rLhs+i, destStep2)
__27:
;
@@ -84117,7 +85216,7 @@ __29:
// Step 4. If the RHS is known to be non-NULL and we did not find
// an match on the search above, then the result must be FALSE.
- if !((*(*int32)(unsafe.Pointer(bp /* rRhsHasNull */)) != 0) && (nVector == 1)) {
+ if !(*(*int32)(unsafe.Pointer(bp)) != 0 && nVector == 1) {
goto __31
}
Xsqlite3VdbeAddOp2(tls, v, OP_NotNull, *(*int32)(unsafe.Pointer(bp /* rRhsHasNull */)), destIfFalse)
@@ -84168,7 +85267,7 @@ __36:
p1 = Xsqlite3VectorFieldSubexpr(tls, pLeft, i)
pColl1 = Xsqlite3ExprCollSeq(tls, pParse, p1)
Xsqlite3VdbeAddOp3(tls, v, OP_Column, *(*int32)(unsafe.Pointer(bp + 4 /* iTab */)), i, r3)
- Xsqlite3VdbeAddOp4(tls, v, OP_Ne, (rLhs + i), destNotNull, r3,
+ Xsqlite3VdbeAddOp4(tls, v, OP_Ne, rLhs+i, destNotNull, r3,
pColl1, -2)
Xsqlite3ReleaseTempReg(tls, pParse, r3)
@@ -84184,7 +85283,7 @@ __38:
goto __39
}
Xsqlite3VdbeResolveLabel(tls, v, destNotNull)
- Xsqlite3VdbeAddOp2(tls, v, OP_Next, *(*int32)(unsafe.Pointer(bp + 4 /* iTab */)), (addrTop + 1))
+ Xsqlite3VdbeAddOp2(tls, v, OP_Next, *(*int32)(unsafe.Pointer(bp + 4 /* iTab */)), addrTop+1)
// Step 7: If we reach this point, we know that the result must
// be false.
@@ -84214,7 +85313,7 @@ sqlite3ExprCodeIN_oom_error:
// The z[] string will probably not be zero-terminated. But the
// z[n] character is guaranteed to be something that does not look
// like the continuation of the number.
-func codeReal(tls *libc.TLS, v uintptr, z uintptr, negateFlag int32, iMem int32) { /* sqlite3.c:104738:13: */
+func codeReal(tls *libc.TLS, v uintptr, z uintptr, negateFlag int32, iMem int32) { /* sqlite3.c:105239:13: */
bp := tls.Alloc(8)
defer tls.Free(8)
@@ -84234,13 +85333,13 @@ func codeReal(tls *libc.TLS, v uintptr, z uintptr, negateFlag int32, iMem int32)
// text z[0..n-1] into register iMem.
//
// Expr.u.zToken is always UTF8 and zero-terminated.
-func codeInteger(tls *libc.TLS, pParse uintptr, pExpr uintptr, negFlag int32, iMem int32) { /* sqlite3.c:104756:13: */
+func codeInteger(tls *libc.TLS, pParse uintptr, pExpr uintptr, negFlag int32, iMem int32) { /* sqlite3.c:105257:13: */
bp := tls.Alloc(24)
defer tls.Free(24)
var v uintptr = (*Parse)(unsafe.Pointer(pParse)).FpVdbe
- if ((*Expr)(unsafe.Pointer(pExpr)).Fflags & U32(EP_IntValue)) != 0 {
- var i int32 = *(*int32)(unsafe.Pointer(pExpr + 8 /* &.u */))
+ if (*Expr)(unsafe.Pointer(pExpr)).Fflags&U32(EP_IntValue) != 0 {
+ var i int32 = *(*int32)(unsafe.Pointer(pExpr + 8))
if negFlag != 0 {
i = -i
@@ -84250,16 +85349,16 @@ func codeInteger(tls *libc.TLS, pParse uintptr, pExpr uintptr, negFlag int32, iM
var c int32
// var value I64 at bp+16, 8
- var z uintptr = *(*uintptr)(unsafe.Pointer(pExpr + 8 /* &.u */))
+ var z uintptr = *(*uintptr)(unsafe.Pointer(pExpr + 8))
c = Xsqlite3DecOrHexToI64(tls, z, bp+16 /* &value */)
- if (((c == 3) && !(negFlag != 0)) || (c == 2)) || ((negFlag != 0) && (*(*I64)(unsafe.Pointer(bp + 16 /* value */)) == ((int64(-1)) - (int64(0xffffffff) | (I64((int64(0x7fffffff))) << 32))))) {
- if Xsqlite3_strnicmp(tls, z, ts+6915 /* "0x" */, 2) == 0 {
- Xsqlite3ErrorMsg(tls, pParse, ts+6918 /* "hex literal too ..." */, libc.VaList(bp, func() uintptr {
+ if c == 3 && !(negFlag != 0) || c == 2 || negFlag != 0 && *(*I64)(unsafe.Pointer(bp + 16)) == int64(-1)-(int64(0xffffffff)|I64(int64(0x7fffffff))<<32) {
+ if Xsqlite3_strnicmp(tls, z, ts+7808, 2) == 0 {
+ Xsqlite3ErrorMsg(tls, pParse, ts+7811 /* "hex literal too ..." */, libc.VaList(bp, func() uintptr {
if negFlag != 0 {
- return ts + 4041 /* "-" */
+ return ts + 4852 /* "-" */
}
- return ts + 755 /* "" */
+ return ts + 1543 /* "" */
}(), z))
} else {
codeReal(tls, v, z, negFlag, iMem)
@@ -84267,7 +85366,7 @@ func codeInteger(tls *libc.TLS, pParse uintptr, pExpr uintptr, negFlag int32, iM
} else {
if negFlag != 0 {
if c == 3 {
- *(*I64)(unsafe.Pointer(bp + 16 /* value */)) = ((int64(-1)) - (int64(0xffffffff) | (I64((int64(0x7fffffff))) << 32)))
+ *(*I64)(unsafe.Pointer(bp + 16 /* value */)) = int64(-1) - (int64(0xffffffff) | I64(int64(0x7fffffff))<<32)
} else {
*(*I64)(unsafe.Pointer(bp + 16 /* value */)) = -*(*I64)(unsafe.Pointer(bp + 16 /* value */))
}
@@ -84279,12 +85378,12 @@ func codeInteger(tls *libc.TLS, pParse uintptr, pExpr uintptr, negFlag int32, iM
// Generate code that will load into register regOut a value that is
// appropriate for the iIdxCol-th column of index pIdx.
-func Xsqlite3ExprCodeLoadIndexColumn(tls *libc.TLS, pParse uintptr, pIdx uintptr, iTabCur int32, iIdxCol int32, regOut int32) { /* sqlite3.c:104793:21: */
+func Xsqlite3ExprCodeLoadIndexColumn(tls *libc.TLS, pParse uintptr, pIdx uintptr, iTabCur int32, iIdxCol int32, regOut int32) { /* sqlite3.c:105294:21: */
var iTabCol I16 = *(*I16)(unsafe.Pointer((*Index)(unsafe.Pointer(pIdx)).FaiColumn + uintptr(iIdxCol)*2))
- if int32(iTabCol) == (-2) {
+ if int32(iTabCol) == -2 {
- (*Parse)(unsafe.Pointer(pParse)).FiSelfTab = (iTabCur + 1)
- Xsqlite3ExprCodeCopy(tls, pParse, (*ExprList_item)(unsafe.Pointer(((*Index)(unsafe.Pointer(pIdx)).FaColExpr+8 /* &.a */)+uintptr(iIdxCol)*20)).FpExpr, regOut)
+ (*Parse)(unsafe.Pointer(pParse)).FiSelfTab = iTabCur + 1
+ Xsqlite3ExprCodeCopy(tls, pParse, (*ExprList_item)(unsafe.Pointer((*Index)(unsafe.Pointer(pIdx)).FaColExpr+8+uintptr(iIdxCol)*20)).FpExpr, regOut)
(*Parse)(unsafe.Pointer(pParse)).FiSelfTab = 0
} else {
Xsqlite3ExprCodeGetColumnOfTable(tls, (*Parse)(unsafe.Pointer(pParse)).FpVdbe, (*Index)(unsafe.Pointer(pIdx)).FpTable, iTabCur,
@@ -84294,18 +85393,18 @@ func Xsqlite3ExprCodeLoadIndexColumn(tls *libc.TLS, pParse uintptr, pIdx uintptr
// Generate code that will compute the value of generated column pCol
// and store the result in register regOut
-func Xsqlite3ExprCodeGeneratedColumn(tls *libc.TLS, pParse uintptr, pCol uintptr, regOut int32) { /* sqlite3.c:104818:21: */
+func Xsqlite3ExprCodeGeneratedColumn(tls *libc.TLS, pParse uintptr, pTab uintptr, pCol uintptr, regOut int32) { /* sqlite3.c:105319:21: */
var iAddr int32
var v uintptr = (*Parse)(unsafe.Pointer(pParse)).FpVdbe
if (*Parse)(unsafe.Pointer(pParse)).FiSelfTab > 0 {
- iAddr = Xsqlite3VdbeAddOp3(tls, v, OP_IfNullRow, ((*Parse)(unsafe.Pointer(pParse)).FiSelfTab - 1), 0, regOut)
+ iAddr = Xsqlite3VdbeAddOp3(tls, v, OP_IfNullRow, (*Parse)(unsafe.Pointer(pParse)).FiSelfTab-1, 0, regOut)
} else {
iAddr = 0
}
- Xsqlite3ExprCodeCopy(tls, pParse, (*Column)(unsafe.Pointer(pCol)).FpDflt, regOut)
+ Xsqlite3ExprCodeCopy(tls, pParse, Xsqlite3ColumnExpr(tls, pTab, pCol), regOut)
if int32((*Column)(unsafe.Pointer(pCol)).Faffinity) >= SQLITE_AFF_TEXT {
- Xsqlite3VdbeAddOp4(tls, v, OP_Affinity, regOut, 1, 0, (pCol + 13 /* &.affinity */), 1)
+ Xsqlite3VdbeAddOp4(tls, v, OP_Affinity, regOut, 1, 0, pCol+6, 1)
}
if iAddr != 0 {
Xsqlite3VdbeJumpHere(tls, v, iAddr)
@@ -84313,7 +85412,7 @@ func Xsqlite3ExprCodeGeneratedColumn(tls *libc.TLS, pParse uintptr, pCol uintptr
}
// Generate code to extract the value of the iCol-th column of a table.
-func Xsqlite3ExprCodeGetColumnOfTable(tls *libc.TLS, v uintptr, pTab uintptr, iTabCur int32, iCol int32, regOut int32) { /* sqlite3.c:104843:21: */
+func Xsqlite3ExprCodeGetColumnOfTable(tls *libc.TLS, v uintptr, pTab uintptr, iTabCur int32, iCol int32, regOut int32) { /* sqlite3.c:105345:21: */
bp := tls.Alloc(8)
defer tls.Free(8)
@@ -84323,28 +85422,29 @@ func Xsqlite3ExprCodeGetColumnOfTable(tls *libc.TLS, v uintptr, pTab uintptr, iT
Xsqlite3VdbeAddOp3(tls, v, OP_Column, iTabCur, iCol, regOut)
return
}
- if (iCol < 0) || (iCol == int32((*Table)(unsafe.Pointer(pTab)).FiPKey)) {
+ if iCol < 0 || iCol == int32((*Table)(unsafe.Pointer(pTab)).FiPKey) {
Xsqlite3VdbeAddOp2(tls, v, OP_Rowid, iTabCur, regOut)
} else {
var op int32
var x int32
- if (*Table)(unsafe.Pointer(pTab)).FnModuleArg != 0 {
+ if int32((*Table)(unsafe.Pointer(pTab)).FeTabType) == TABTYP_VTAB {
op = OP_VColumn
x = iCol
- } else if (int32((*Column)(unsafe.Pointer((libc.AssignUintptr(&pCol, ((*Table)(unsafe.Pointer(pTab)).FaCol + uintptr(iCol)*20))))).FcolFlags) & COLFLAG_VIRTUAL) != 0 {
+ } else if int32((*Column)(unsafe.Pointer(libc.AssignUintptr(&pCol, (*Table)(unsafe.Pointer(pTab)).FaCol+uintptr(iCol)*16))).FcolFlags)&COLFLAG_VIRTUAL != 0 {
var pParse uintptr = Xsqlite3VdbeParser(tls, v)
- if (int32((*Column)(unsafe.Pointer(pCol)).FcolFlags) & COLFLAG_BUSY) != 0 {
- Xsqlite3ErrorMsg(tls, pParse, ts+6944 /* "generated column..." */, libc.VaList(bp, (*Column)(unsafe.Pointer(pCol)).FzName))
+ if int32((*Column)(unsafe.Pointer(pCol)).FcolFlags)&COLFLAG_BUSY != 0 {
+ Xsqlite3ErrorMsg(tls, pParse, ts+7837, /* "generated column..." */
+ libc.VaList(bp, (*Column)(unsafe.Pointer(pCol)).FzCnName))
} else {
var savedSelfTab int32 = (*Parse)(unsafe.Pointer(pParse)).FiSelfTab
- *(*U16)(unsafe.Pointer(pCol + 16 /* &.colFlags */)) |= U16((COLFLAG_BUSY))
- (*Parse)(unsafe.Pointer(pParse)).FiSelfTab = (iTabCur + 1)
- Xsqlite3ExprCodeGeneratedColumn(tls, pParse, pCol, regOut)
+ *(*U16)(unsafe.Pointer(pCol + 12)) |= U16(COLFLAG_BUSY)
+ (*Parse)(unsafe.Pointer(pParse)).FiSelfTab = iTabCur + 1
+ Xsqlite3ExprCodeGeneratedColumn(tls, pParse, pTab, pCol, regOut)
(*Parse)(unsafe.Pointer(pParse)).FiSelfTab = savedSelfTab
- *(*U16)(unsafe.Pointer(pCol + 16 /* &.colFlags */)) &= libc.Uint16FromInt32((libc.CplInt32(COLFLAG_BUSY)))
+ *(*U16)(unsafe.Pointer(pCol + 12)) &= libc.Uint16FromInt32(libc.CplInt32(COLFLAG_BUSY))
}
return
- } else if !(((*Table)(unsafe.Pointer((pTab))).FtabFlags & U32(TF_WithoutRowid)) == U32(0)) {
+ } else if !((*Table)(unsafe.Pointer(pTab)).FtabFlags&U32(TF_WithoutRowid) == U32(0)) {
x = int32(Xsqlite3TableColumnToIndex(tls, Xsqlite3PrimaryKeyIndex(tls, pTab), int16(iCol)))
op = OP_Column
@@ -84363,7 +85463,7 @@ func Xsqlite3ExprCodeGetColumnOfTable(tls *libc.TLS, v uintptr, pTab uintptr, iT
//
// There must be an open cursor to pTab in iTable when this routine
// is called. If iColumn<0 then code is generated that extracts the rowid.
-func Xsqlite3ExprCodeGetColumn(tls *libc.TLS, pParse uintptr, pTab uintptr, iColumn int32, iTable int32, iReg int32, p5 U8) int32 { /* sqlite3.c:104900:20: */
+func Xsqlite3ExprCodeGetColumn(tls *libc.TLS, pParse uintptr, pTab uintptr, iColumn int32, iTable int32, iReg int32, p5 U8) int32 { /* sqlite3.c:105403:20: */
Xsqlite3ExprCodeGetColumnOfTable(tls, (*Parse)(unsafe.Pointer(pParse)).FpVdbe, pTab, iTable, iColumn, iReg)
if p5 != 0 {
@@ -84377,14 +85477,14 @@ func Xsqlite3ExprCodeGetColumn(tls *libc.TLS, pParse uintptr, pTab uintptr, iCol
// Generate code to move content from registers iFrom...iFrom+nReg-1
// over to iTo..iTo+nReg-1.
-func Xsqlite3ExprCodeMove(tls *libc.TLS, pParse uintptr, iFrom int32, iTo int32, nReg int32) { /* sqlite3.c:104921:21: */
+func Xsqlite3ExprCodeMove(tls *libc.TLS, pParse uintptr, iFrom int32, iTo int32, nReg int32) { /* sqlite3.c:105424:21: */
Xsqlite3VdbeAddOp3(tls, (*Parse)(unsafe.Pointer(pParse)).FpVdbe, OP_Move, iFrom, iTo, nReg)
}
// Convert a scalar expression node to a TK_REGISTER referencing
// register iReg. The caller must ensure that iReg already contains
// the correct value for the expression.
-func exprToRegister(tls *libc.TLS, pExpr uintptr, iReg int32) { /* sqlite3.c:104930:13: */
+func exprToRegister(tls *libc.TLS, pExpr uintptr, iReg int32) { /* sqlite3.c:105433:13: */
var p uintptr = Xsqlite3ExprSkipCollateAndLikely(tls, pExpr)
if p == uintptr(0) {
return
@@ -84392,7 +85492,7 @@ func exprToRegister(tls *libc.TLS, pExpr uintptr, iReg int32) { /* sqlite3.c:104
(*Expr)(unsafe.Pointer(p)).Fop2 = (*Expr)(unsafe.Pointer(p)).Fop
(*Expr)(unsafe.Pointer(p)).Fop = U8(TK_REGISTER)
(*Expr)(unsafe.Pointer(p)).FiTable = iReg
- *(*U32)(unsafe.Pointer(p + 4 /* &.flags */)) &= (libc.Uint32FromInt32(libc.CplInt32(EP_Skip)))
+ *(*U32)(unsafe.Pointer(p + 4)) &= libc.Uint32FromInt32(libc.CplInt32(EP_Skip))
}
// Evaluate an expression (either a vector or a scalar expression) and store
@@ -84403,7 +85503,7 @@ func exprToRegister(tls *libc.TLS, pExpr uintptr, iReg int32) { /* sqlite3.c:104
// that register number into *piFreeable. If the returned result register
// is not a temporary or if the expression is a vector set *piFreeable
// to 0.
-func exprCodeVector(tls *libc.TLS, pParse uintptr, p uintptr, piFreeable uintptr) int32 { /* sqlite3.c:104949:12: */
+func exprCodeVector(tls *libc.TLS, pParse uintptr, p uintptr, piFreeable uintptr) int32 { /* sqlite3.c:105452:12: */
var iResult int32
var nResult int32 = Xsqlite3ExprVectorSize(tls, p)
if nResult == 1 {
@@ -84414,10 +85514,11 @@ func exprCodeVector(tls *libc.TLS, pParse uintptr, p uintptr, piFreeable uintptr
iResult = Xsqlite3CodeSubselect(tls, pParse, p)
} else {
var i int32
- iResult = ((*Parse)(unsafe.Pointer(pParse)).FnMem + 1)
- *(*int32)(unsafe.Pointer(pParse + 44 /* &.nMem */)) += (nResult)
+ iResult = (*Parse)(unsafe.Pointer(pParse)).FnMem + 1
+ *(*int32)(unsafe.Pointer(pParse + 44)) += nResult
+
for i = 0; i < nResult; i++ {
- Xsqlite3ExprCodeFactorable(tls, pParse, (*ExprList_item)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(p + 20 /* &.x */))+8 /* &.a */)+uintptr(i)*20)).FpExpr, (i + iResult))
+ Xsqlite3ExprCodeFactorable(tls, pParse, (*ExprList_item)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(p + 20))+8+uintptr(i)*20)).FpExpr, i+iResult)
}
}
}
@@ -84426,7 +85527,7 @@ func exprCodeVector(tls *libc.TLS, pParse uintptr, p uintptr, piFreeable uintptr
// If the last opcode is a OP_Copy, then set the do-not-merge flag (p5)
// so that a subsequent copy will not be merged into this one.
-func setDoNotMergeFlagOnCopy(tls *libc.TLS, v uintptr) { /* sqlite3.c:104978:13: */
+func setDoNotMergeFlagOnCopy(tls *libc.TLS, v uintptr) { /* sqlite3.c:105482:13: */
if int32((*VdbeOp)(unsafe.Pointer(Xsqlite3VdbeGetOp(tls, v, -1))).Fopcode) == OP_Copy {
Xsqlite3VdbeChangeP5(tls, v, uint16(1)) // Tag trailing OP_Copy as not mergable
}
@@ -84434,9 +85535,9 @@ func setDoNotMergeFlagOnCopy(tls *libc.TLS, v uintptr) { /* sqlite3.c:104978:13:
// Generate code to implement special SQL functions that are implemented
// in-line rather than by using the usual callbacks.
-func exprCodeInlineFunction(tls *libc.TLS, pParse uintptr, pFarg uintptr, iFuncId int32, target int32) int32 { /* sqlite3.c:104988:12: */
- bp := tls.Alloc(52)
- defer tls.Free(52)
+func exprCodeInlineFunction(tls *libc.TLS, pParse uintptr, pFarg uintptr, iFuncId int32, target int32) int32 { /* sqlite3.c:105492:12: */
+ bp := tls.Alloc(72)
+ defer tls.Free(72)
var nFarg int32
var v uintptr = (*Parse)(unsafe.Pointer(pParse)).FpVdbe
@@ -84452,11 +85553,11 @@ func exprCodeInlineFunction(tls *libc.TLS, pParse uintptr, pFarg uintptr, iFuncI
var endCoalesce int32 = Xsqlite3VdbeMakeLabel(tls, pParse)
var i int32
- Xsqlite3ExprCode(tls, pParse, (*ExprList_item)(unsafe.Pointer((pFarg + 8 /* &.a */))).FpExpr, target)
+ Xsqlite3ExprCode(tls, pParse, (*ExprList_item)(unsafe.Pointer(pFarg+8)).FpExpr, target)
for i = 1; i < nFarg; i++ {
Xsqlite3VdbeAddOp2(tls, v, OP_NotNull, target, endCoalesce)
- Xsqlite3ExprCode(tls, pParse, (*ExprList_item)(unsafe.Pointer((pFarg+8 /* &.a */)+uintptr(i)*20)).FpExpr, target)
+ Xsqlite3ExprCode(tls, pParse, (*ExprList_item)(unsafe.Pointer(pFarg+8+uintptr(i)*20)).FpExpr, target)
}
setDoNotMergeFlagOnCopy(tls, v)
Xsqlite3VdbeResolveLabel(tls, v, endCoalesce)
@@ -84469,7 +85570,7 @@ func exprCodeInlineFunction(tls *libc.TLS, pParse uintptr, pFarg uintptr, iFuncI
libc.Xmemset(tls, bp /* &caseExpr */, 0, uint32(unsafe.Sizeof(Expr{})))
(*Expr)(unsafe.Pointer(bp /* &caseExpr */)).Fop = U8(TK_CASE)
- *(*uintptr)(unsafe.Pointer(bp /* &caseExpr */ + 20 /* &.x */)) = pFarg
+ *(*uintptr)(unsafe.Pointer(bp + 20)) = pFarg
return Xsqlite3ExprCodeTarget(tls, pParse, bp /* &caseExpr */, target)
}
@@ -84479,7 +85580,7 @@ func exprCodeInlineFunction(tls *libc.TLS, pParse uintptr, pFarg uintptr, iFuncI
// The UNLIKELY() function is a no-op. The result is the value
// of the first argument.
- target = Xsqlite3ExprCodeTarget(tls, pParse, (*ExprList_item)(unsafe.Pointer((pFarg + 8 /* &.a */))).FpExpr, target)
+ target = Xsqlite3ExprCodeTarget(tls, pParse, (*ExprList_item)(unsafe.Pointer(pFarg+8)).FpExpr, target)
break
}
@@ -84493,7 +85594,7 @@ func exprCodeInlineFunction(tls *libc.TLS, pParse uintptr, pFarg uintptr, iFuncI
// Compare two expressions using sqlite3ExprCompare()
Xsqlite3VdbeAddOp2(tls, v, OP_Integer,
- Xsqlite3ExprCompare(tls, uintptr(0), (*ExprList_item)(unsafe.Pointer((pFarg+8 /* &.a */))).FpExpr, (*ExprList_item)(unsafe.Pointer((pFarg+8 /* &.a */)+1*20)).FpExpr, -1),
+ Xsqlite3ExprCompare(tls, uintptr(0), (*ExprList_item)(unsafe.Pointer(pFarg+8)).FpExpr, (*ExprList_item)(unsafe.Pointer(pFarg+8+1*20)).FpExpr, -1),
target)
break
@@ -84504,7 +85605,7 @@ func exprCodeInlineFunction(tls *libc.TLS, pParse uintptr, pFarg uintptr, iFuncI
// Compare two expressions using sqlite3ExprImpliesExpr()
Xsqlite3VdbeAddOp2(tls, v, OP_Integer,
- Xsqlite3ExprImpliesExpr(tls, pParse, (*ExprList_item)(unsafe.Pointer((pFarg+8 /* &.a */))).FpExpr, (*ExprList_item)(unsafe.Pointer((pFarg+8 /* &.a */)+1*20)).FpExpr, -1),
+ Xsqlite3ExprImpliesExpr(tls, pParse, (*ExprList_item)(unsafe.Pointer(pFarg+8)).FpExpr, (*ExprList_item)(unsafe.Pointer(pFarg+8+1*20)).FpExpr, -1),
target)
break
@@ -84515,10 +85616,10 @@ func exprCodeInlineFunction(tls *libc.TLS, pParse uintptr, pFarg uintptr, iFuncI
// REsult of sqlite3ExprImpliesNonNullRow()
var pA1 uintptr
- pA1 = (*ExprList_item)(unsafe.Pointer((pFarg + 8 /* &.a */) + 1*20)).FpExpr
+ pA1 = (*ExprList_item)(unsafe.Pointer(pFarg + 8 + 1*20)).FpExpr
if int32((*Expr)(unsafe.Pointer(pA1)).Fop) == TK_COLUMN {
Xsqlite3VdbeAddOp2(tls, v, OP_Integer,
- Xsqlite3ExprImpliesNonNullRow(tls, (*ExprList_item)(unsafe.Pointer((pFarg+8 /* &.a */))).FpExpr, (*Expr)(unsafe.Pointer(pA1)).FiTable),
+ Xsqlite3ExprImpliesNonNullRow(tls, (*ExprList_item)(unsafe.Pointer(pFarg+8)).FpExpr, (*Expr)(unsafe.Pointer(pA1)).FiTable),
target)
} else {
Xsqlite3VdbeAddOp2(tls, v, OP_Null, 0, target)
@@ -84527,6 +85628,25 @@ func exprCodeInlineFunction(tls *libc.TLS, pParse uintptr, pFarg uintptr, iFuncI
}
+ case INLINEFUNC_affinity:
+ {
+ // The AFFINITY() function evaluates to a string that describes
+ // the type affinity of the argument. This is used for testing of
+ // the SQLite type logic.
+ *(*[5]uintptr)(unsafe.Pointer(bp + 52 /* azAff */)) = [5]uintptr{ts + 7867 /* "blob" */, ts + 7872 /* "text" */, ts + 7877 /* "numeric" */, ts + 6115 /* "integer" */, ts + 6110 /* "real" */}
+ var aff uint8
+
+ aff = Xsqlite3ExprAffinity(tls, (*ExprList_item)(unsafe.Pointer(pFarg+8)).FpExpr)
+ Xsqlite3VdbeLoadString(tls, v, target,
+ func() uintptr {
+ if int32(aff) <= SQLITE_AFF_NONE {
+ return ts + 7885 /* "none" */
+ }
+ return *(*uintptr)(unsafe.Pointer(bp + 52 /* &azAff[0] */ + uintptr(int32(aff)-SQLITE_AFF_BLOB)*4))
+ }())
+ break
+
+ }
}
return target
}
@@ -84540,7 +85660,7 @@ func exprCodeInlineFunction(tls *libc.TLS, pParse uintptr, pFarg uintptr, iFuncI
// register if it is convenient to do so. The calling function
// must check the return code and move the results to the desired
// register.
-func Xsqlite3ExprCodeTarget(tls *libc.TLS, pParse uintptr, pExpr uintptr, target int32) int32 { /* sqlite3.c:105104:20: */
+func Xsqlite3ExprCodeTarget(tls *libc.TLS, pParse uintptr, pExpr uintptr, target int32) int32 { /* sqlite3.c:105608:20: */
bp := tls.Alloc(152)
defer tls.Free(152)
@@ -84808,8 +85928,8 @@ __2:
__4:
pAggInfo = (*Expr)(unsafe.Pointer(pExpr)).FpAggInfo
- pCol = ((*AggInfo)(unsafe.Pointer(pAggInfo)).FaCol + uintptr((*Expr)(unsafe.Pointer(pExpr)).FiAgg)*20)
- if !(!(int32((*AggInfo)(unsafe.Pointer(pAggInfo)).FdirectMode) != 0)) {
+ pCol = (*AggInfo)(unsafe.Pointer(pAggInfo)).FaCol + uintptr((*Expr)(unsafe.Pointer(pExpr)).FiAgg)*20
+ if !!(int32((*AggInfo)(unsafe.Pointer(pAggInfo)).FdirectMode) != 0) {
goto __56
}
@@ -84829,7 +85949,7 @@ __56:
goto __60
__59:
;
- if !(int32((*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FaCol+uintptr((*AggInfo_col)(unsafe.Pointer(pCol)).FiColumn)*20)).Faffinity) == SQLITE_AFF_REAL) {
+ if !(int32((*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FaCol+uintptr((*AggInfo_col)(unsafe.Pointer(pCol)).FiColumn)*16)).Faffinity) == SQLITE_AFF_REAL) {
goto __61
}
Xsqlite3VdbeAddOp1(tls, v, OP_RealAffinity, target)
@@ -84845,14 +85965,15 @@ __57:
__5:
iTab = (*Expr)(unsafe.Pointer(pExpr)).FiTable
- if !(((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_FixedCol))) != U32(0)) {
+ if !((*Expr)(unsafe.Pointer(pExpr)).Fflags&U32(EP_FixedCol) != U32(0)) {
goto __62
}
iReg = Xsqlite3ExprCodeTarget(tls, pParse, (*Expr)(unsafe.Pointer(pExpr)).FpLeft, target)
- if !(*(*uintptr)(unsafe.Pointer(pExpr + 44 /* &.y */)) != 0) {
+
+ if !(*(*uintptr)(unsafe.Pointer(pExpr + 44)) != 0) {
goto __63
}
- aff = int32(Xsqlite3TableColumnAffinity(tls, *(*uintptr)(unsafe.Pointer(pExpr + 44 /* &.y */)), int32((*Expr)(unsafe.Pointer(pExpr)).FiColumn)))
+ aff = int32(Xsqlite3TableColumnAffinity(tls, *(*uintptr)(unsafe.Pointer(pExpr + 44)), int32((*Expr)(unsafe.Pointer(pExpr)).FiColumn)))
goto __64
__63:
aff = int32((*Expr)(unsafe.Pointer(pExpr)).FaffExpr)
@@ -84863,7 +85984,7 @@ __64:
}
Xsqlite3VdbeAddOp4(tls, v, OP_Affinity, iReg, 1, 0,
- (uintptr(unsafe.Pointer(&zAff)) + uintptr(((aff - 'B') * 2))), -1)
+ uintptr(unsafe.Pointer(&zAff))+uintptr((aff-'B')*2), -1)
__65:
;
return iReg
@@ -84875,37 +85996,38 @@ __62:
if !((*Parse)(unsafe.Pointer(pParse)).FiSelfTab < 0) {
goto __67
}
- pTab1 = *(*uintptr)(unsafe.Pointer(pExpr + 44 /* &.y */))
iCol = int32((*Expr)(unsafe.Pointer(pExpr)).FiColumn)
+ pTab1 = *(*uintptr)(unsafe.Pointer(pExpr + 44))
+
if !(iCol < 0) {
goto __69
}
- return (-1 - (*Parse)(unsafe.Pointer(pParse)).FiSelfTab)
+ return -1 - (*Parse)(unsafe.Pointer(pParse)).FiSelfTab
__69:
;
- pCol1 = ((*Table)(unsafe.Pointer(pTab1)).FaCol + uintptr(iCol)*20)
+ pCol1 = (*Table)(unsafe.Pointer(pTab1)).FaCol + uintptr(iCol)*16
- iSrc = (int32(Xsqlite3TableColumnToStorage(tls, pTab1, int16(iCol))) - (*Parse)(unsafe.Pointer(pParse)).FiSelfTab)
- if !((int32((*Column)(unsafe.Pointer(pCol1)).FcolFlags) & COLFLAG_GENERATED) != 0) {
+ iSrc = int32(Xsqlite3TableColumnToStorage(tls, pTab1, int16(iCol))) - (*Parse)(unsafe.Pointer(pParse)).FiSelfTab
+ if !(int32((*Column)(unsafe.Pointer(pCol1)).FcolFlags)&COLFLAG_GENERATED != 0) {
goto __70
}
- if !((int32((*Column)(unsafe.Pointer(pCol1)).FcolFlags) & COLFLAG_BUSY) != 0) {
+ if !(int32((*Column)(unsafe.Pointer(pCol1)).FcolFlags)&COLFLAG_BUSY != 0) {
goto __72
}
- Xsqlite3ErrorMsg(tls, pParse, ts+6944, /* "generated column..." */
- libc.VaList(bp, (*Column)(unsafe.Pointer(pCol1)).FzName))
+ Xsqlite3ErrorMsg(tls, pParse, ts+7837, /* "generated column..." */
+ libc.VaList(bp, (*Column)(unsafe.Pointer(pCol1)).FzCnName))
return 0
__72:
;
- *(*U16)(unsafe.Pointer(pCol1 + 16 /* &.colFlags */)) |= U16((COLFLAG_BUSY))
- if !((int32((*Column)(unsafe.Pointer(pCol1)).FcolFlags) & COLFLAG_NOTAVAIL) != 0) {
+ *(*U16)(unsafe.Pointer(pCol1 + 12)) |= U16(COLFLAG_BUSY)
+ if !(int32((*Column)(unsafe.Pointer(pCol1)).FcolFlags)&COLFLAG_NOTAVAIL != 0) {
goto __73
}
- Xsqlite3ExprCodeGeneratedColumn(tls, pParse, pCol1, iSrc)
+ Xsqlite3ExprCodeGeneratedColumn(tls, pParse, pTab1, pCol1, iSrc)
__73:
;
- *(*U16)(unsafe.Pointer(pCol1 + 16 /* &.colFlags */)) &= libc.Uint16FromInt32((libc.CplInt32((COLFLAG_BUSY | COLFLAG_NOTAVAIL))))
+ *(*U16)(unsafe.Pointer(pCol1 + 12)) &= libc.Uint16FromInt32(libc.CplInt32(COLFLAG_BUSY | COLFLAG_NOTAVAIL))
return iSrc
goto __71
__70:
@@ -84926,15 +86048,16 @@ __71:
__67:
// Coding an expression that is part of an index where column names
// in the index refer to the table to which the index belongs
- iTab = ((*Parse)(unsafe.Pointer(pParse)).FiSelfTab - 1)
+ iTab = (*Parse)(unsafe.Pointer(pParse)).FiSelfTab - 1
__68:
;
__66:
;
- iReg = Xsqlite3ExprCodeGetColumn(tls, pParse, *(*uintptr)(unsafe.Pointer(pExpr + 44 /* &.y */)),
+
+ iReg = Xsqlite3ExprCodeGetColumn(tls, pParse, *(*uintptr)(unsafe.Pointer(pExpr + 44)),
int32((*Expr)(unsafe.Pointer(pExpr)).FiColumn), iTab, target,
(*Expr)(unsafe.Pointer(pExpr)).Fop2)
- if !((*(*uintptr)(unsafe.Pointer(pExpr + 44 /* &.y */)) == uintptr(0)) && (int32((*Expr)(unsafe.Pointer(pExpr)).FaffExpr) == SQLITE_AFF_REAL)) {
+ if !(*(*uintptr)(unsafe.Pointer(pExpr + 44)) == uintptr(0) && int32((*Expr)(unsafe.Pointer(pExpr)).FaffExpr) == SQLITE_AFF_REAL) {
goto __76
}
Xsqlite3VdbeAddOp1(tls, v, OP_RealAffinity, iReg)
@@ -84952,12 +86075,12 @@ __7:
__8:
;
- codeReal(tls, v, *(*uintptr)(unsafe.Pointer(pExpr + 8 /* &.u */)), 0, target)
+ codeReal(tls, v, *(*uintptr)(unsafe.Pointer(pExpr + 8)), 0, target)
return target
__9:
;
- Xsqlite3VdbeLoadString(tls, v, target, *(*uintptr)(unsafe.Pointer(pExpr + 8 /* &.u */)))
+ Xsqlite3VdbeLoadString(tls, v, target, *(*uintptr)(unsafe.Pointer(pExpr + 8)))
return target
__10:
@@ -84972,18 +86095,18 @@ __10:
__11:
;
- z = (*(*uintptr)(unsafe.Pointer(pExpr + 8 /* &.u */)) + 2)
- n = (Xsqlite3Strlen30(tls, z) - 1)
+ z = *(*uintptr)(unsafe.Pointer(pExpr + 8)) + 2
+ n = Xsqlite3Strlen30(tls, z) - 1
zBlob = Xsqlite3HexToBlob(tls, Xsqlite3VdbeDb(tls, v), z, n)
- Xsqlite3VdbeAddOp4(tls, v, OP_Blob, (n / 2), target, 0, zBlob, -7)
+ Xsqlite3VdbeAddOp4(tls, v, OP_Blob, n/2, target, 0, zBlob, -7)
return target
__12:
;
Xsqlite3VdbeAddOp2(tls, v, OP_Variable, int32((*Expr)(unsafe.Pointer(pExpr)).FiColumn), target)
- if !(int32(*(*uint8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pExpr + 8 /* &.u */)) + 1))) != 0) {
+ if !(int32(*(*uint8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pExpr + 8)) + 1))) != 0) {
goto __77
}
z1 = Xsqlite3VListNumToName(tls, (*Parse)(unsafe.Pointer(pParse)).FpVList, int32((*Expr)(unsafe.Pointer(pExpr)).FiColumn))
@@ -85007,8 +86130,9 @@ __14:
inReg = target
__78:
;
+
Xsqlite3VdbeAddOp2(tls, v, OP_Cast, target,
- int32(Xsqlite3AffinityType(tls, *(*uintptr)(unsafe.Pointer(pExpr + 8 /* &.u */)), uintptr(0))))
+ int32(Xsqlite3AffinityType(tls, *(*uintptr)(unsafe.Pointer(pExpr + 8)), uintptr(0))))
return inReg
__15:
@@ -85037,8 +86161,8 @@ __79:
r2 = Xsqlite3ExprCodeTemp(tls, pParse, (*Expr)(unsafe.Pointer(pExpr)).FpRight, bp+44 /* &regFree2 */)
Xsqlite3VdbeAddOp2(tls, v, OP_Integer, 1, inReg)
codeCompare(tls, pParse, pLeft, (*Expr)(unsafe.Pointer(pExpr)).FpRight, op, r1, r2,
- (Xsqlite3VdbeCurrentAddr(tls, v) + 2), p5,
- (libc.Bool32(((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_Commuted))) != U32(0))))
+ Xsqlite3VdbeCurrentAddr(tls, v)+2, p5,
+ libc.Bool32((*Expr)(unsafe.Pointer(pExpr)).Fflags&U32(EP_Commuted) != U32(0)))
if !(p5 == SQLITE_NULLEQ) {
goto __81
@@ -85088,13 +86212,13 @@ __83:
goto __85
}
- codeReal(tls, v, *(*uintptr)(unsafe.Pointer(pLeft1 + 8 /* &.u */)), 1, target)
+ codeReal(tls, v, *(*uintptr)(unsafe.Pointer(pLeft1 + 8)), 1, target)
return target
goto __86
__85:
(*Expr)(unsafe.Pointer(bp + 48 /* &tempX */)).Fop = U8(TK_INTEGER)
- (*Expr)(unsafe.Pointer(bp + 48 /* &tempX */)).Fflags = (U32(EP_IntValue | EP_TokenOnly))
- *(*int32)(unsafe.Pointer(bp + 48 /* &tempX */ + 8 /* &.u */)) = 0
+ (*Expr)(unsafe.Pointer(bp + 48 /* &tempX */)).Fflags = U32(EP_IntValue | EP_TokenOnly)
+ *(*int32)(unsafe.Pointer(bp + 48 + 8)) = 0
r1 = Xsqlite3ExprCodeTemp(tls, pParse, bp+48 /* &tempX */, bp+40 /* &regFree1 */)
r2 = Xsqlite3ExprCodeTemp(tls, pParse, (*Expr)(unsafe.Pointer(pExpr)).FpLeft, bp+44 /* &regFree2 */)
@@ -85119,9 +86243,9 @@ __38: // IS TRUE or IS FALSE
r1 = Xsqlite3ExprCodeTemp(tls, pParse, (*Expr)(unsafe.Pointer(pExpr)).FpLeft, bp+40 /* &regFree1 */)
isTrue = Xsqlite3ExprTruthValue(tls, (*Expr)(unsafe.Pointer(pExpr)).FpRight)
- bNormal = (libc.Bool32(int32((*Expr)(unsafe.Pointer(pExpr)).Fop2) == TK_IS))
+ bNormal = libc.Bool32(int32((*Expr)(unsafe.Pointer(pExpr)).Fop2) == TK_IS)
- Xsqlite3VdbeAddOp4Int(tls, v, OP_IsTrue, r1, inReg, libc.BoolInt32(!(isTrue != 0)), (isTrue ^ bNormal))
+ Xsqlite3VdbeAddOp4Int(tls, v, OP_IsTrue, r1, inReg, libc.BoolInt32(!(isTrue != 0)), isTrue^bNormal)
goto __3
__39:
@@ -85139,13 +86263,13 @@ __40:
__41:
pInfo = (*Expr)(unsafe.Pointer(pExpr)).FpAggInfo
- if !(((pInfo == uintptr(0)) ||
- (int32((*Expr)(unsafe.Pointer(pExpr)).FiAgg) < 0)) ||
- (int32((*Expr)(unsafe.Pointer(pExpr)).FiAgg) >= (*AggInfo)(unsafe.Pointer(pInfo)).FnFunc)) {
+ if !(pInfo == uintptr(0) ||
+ int32((*Expr)(unsafe.Pointer(pExpr)).FiAgg) < 0 ||
+ int32((*Expr)(unsafe.Pointer(pExpr)).FiAgg) >= (*AggInfo)(unsafe.Pointer(pInfo)).FnFunc) {
goto __87
}
- Xsqlite3ErrorMsg(tls, pParse, ts+6974 /* "misuse of aggreg..." */, libc.VaList(bp+8, *(*uintptr)(unsafe.Pointer(pExpr + 8 /* &.u */))))
+ Xsqlite3ErrorMsg(tls, pParse, ts+7890 /* "misuse of aggreg..." */, libc.VaList(bp+8, *(*uintptr)(unsafe.Pointer(pExpr + 8))))
goto __88
__87:
return (*AggInfo_func)(unsafe.Pointer((*AggInfo)(unsafe.Pointer(pInfo)).FaFunc + uintptr((*Expr)(unsafe.Pointer(pExpr)).FiAgg)*20)).FiMem
@@ -85159,14 +86283,14 @@ __42: // The function name
enc = (*Sqlite3)(unsafe.Pointer(db)).Fenc // The text encoding used by this database
pColl = uintptr(0) // A collating sequence
- if !(((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_WinFunc))) != U32(0)) {
+ if !((*Expr)(unsafe.Pointer(pExpr)).Fflags&U32(EP_WinFunc) != U32(0)) {
goto __89
}
- return (*Window)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pExpr + 44 /* &.y */)))).FregResult
+ return (*Window)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pExpr + 44)))).FregResult
__89:
;
- if !(((*Parse)(unsafe.Pointer(pParse)).FokConstFactor != 0) && (Xsqlite3ExprIsConstantNotJoin(tls, pExpr) != 0)) {
+ if !((*Parse)(unsafe.Pointer(pParse)).FokConstFactor != 0 && Xsqlite3ExprIsConstantNotJoin(tls, pExpr) != 0) {
goto __90
}
// SQL functions can be expensive. So try to avoid running them
@@ -85175,23 +86299,23 @@ __89:
__90:
;
- pFarg = *(*uintptr)(unsafe.Pointer(pExpr + 20 /* &.x */))
+ pFarg = *(*uintptr)(unsafe.Pointer(pExpr + 20))
if pFarg != 0 {
nFarg = (*ExprList)(unsafe.Pointer(pFarg)).FnExpr
} else {
nFarg = 0
}
- zId = *(*uintptr)(unsafe.Pointer(pExpr + 8 /* &.u */))
+ zId = *(*uintptr)(unsafe.Pointer(pExpr + 8))
pDef = Xsqlite3FindFunction(tls, db, zId, nFarg, enc, uint8(0))
- if !((pDef == uintptr(0)) || ((*FuncDef)(unsafe.Pointer(pDef)).FxFinalize != uintptr(0))) {
+ if !(pDef == uintptr(0) || (*FuncDef)(unsafe.Pointer(pDef)).FxFinalize != uintptr(0)) {
goto __91
}
- Xsqlite3ErrorMsg(tls, pParse, ts+7000 /* "unknown function..." */, libc.VaList(bp+16, zId))
+ Xsqlite3ErrorMsg(tls, pParse, ts+7916 /* "unknown function..." */, libc.VaList(bp+16, zId))
goto __3
__91:
;
- if !(((*FuncDef)(unsafe.Pointer(pDef)).FfuncFlags & U32(SQLITE_FUNC_INLINE)) != 0) {
+ if !((*FuncDef)(unsafe.Pointer(pDef)).FfuncFlags&U32(SQLITE_FUNC_INLINE) != 0) {
goto __92
}
@@ -85199,7 +86323,7 @@ __91:
int32((*FuncDef)(unsafe.Pointer(pDef)).FpUserData), target)
goto __93
__92:
- if !(((*FuncDef)(unsafe.Pointer(pDef)).FfuncFlags & (U32(SQLITE_FUNC_DIRECT | SQLITE_FUNC_UNSAFE))) != 0) {
+ if !((*FuncDef)(unsafe.Pointer(pDef)).FfuncFlags&U32(SQLITE_FUNC_DIRECT|SQLITE_FUNC_UNSAFE) != 0) {
goto __94
}
Xsqlite3ExprFunctionUsable(tls, pParse, pExpr, pDef)
@@ -85213,17 +86337,17 @@ __95:
if !(i < nFarg) {
goto __97
}
- if !((i < 32) && (Xsqlite3ExprIsConstant(tls, (*ExprList_item)(unsafe.Pointer((pFarg+8 /* &.a */)+uintptr(i)*20)).FpExpr) != 0)) {
+ if !(i < 32 && Xsqlite3ExprIsConstant(tls, (*ExprList_item)(unsafe.Pointer(pFarg+8+uintptr(i)*20)).FpExpr) != 0) {
goto __98
}
- constMask = constMask | (uint32((uint32(1))) << (i))
+ constMask = constMask | uint32(uint32(1))<<i
__98:
;
- if !((((*FuncDef)(unsafe.Pointer(pDef)).FfuncFlags & U32(SQLITE_FUNC_NEEDCOLL)) != U32(0)) && !(pColl != 0)) {
+ if !((*FuncDef)(unsafe.Pointer(pDef)).FfuncFlags&U32(SQLITE_FUNC_NEEDCOLL) != U32(0) && !(pColl != 0)) {
goto __99
}
- pColl = Xsqlite3ExprCollSeq(tls, pParse, (*ExprList_item)(unsafe.Pointer((pFarg+8 /* &.a */)+uintptr(i)*20)).FpExpr)
+ pColl = Xsqlite3ExprCollSeq(tls, pParse, (*ExprList_item)(unsafe.Pointer(pFarg+8+uintptr(i)*20)).FpExpr)
__99:
;
goto __96
@@ -85239,8 +86363,8 @@ __97:
if !(constMask != 0) {
goto __102
}
- r1 = ((*Parse)(unsafe.Pointer(pParse)).FnMem + 1)
- *(*int32)(unsafe.Pointer(pParse + 44 /* &.nMem */)) += (nFarg)
+ r1 = (*Parse)(unsafe.Pointer(pParse)).FnMem + 1
+ *(*int32)(unsafe.Pointer(pParse + 44)) += nFarg
goto __103
__102:
r1 = Xsqlite3GetTempRange(tls, pParse, nFarg)
@@ -85251,23 +86375,23 @@ __103:
// set the P5 parameter to the OP_Column opcode to OPFLAG_LENGTHARG
// or OPFLAG_TYPEOFARG respectively, to avoid unnecessary data
// loading.
- if !(((*FuncDef)(unsafe.Pointer(pDef)).FfuncFlags & (U32(SQLITE_FUNC_LENGTH | SQLITE_FUNC_TYPEOF))) != U32(0)) {
+ if !((*FuncDef)(unsafe.Pointer(pDef)).FfuncFlags&U32(SQLITE_FUNC_LENGTH|SQLITE_FUNC_TYPEOF) != U32(0)) {
goto __104
}
- exprOp = (*Expr)(unsafe.Pointer((*ExprList_item)(unsafe.Pointer((pFarg + 8 /* &.a */))).FpExpr)).Fop
- if !((int32(exprOp) == TK_COLUMN) || (int32(exprOp) == TK_AGG_COLUMN)) {
+ exprOp = (*Expr)(unsafe.Pointer((*ExprList_item)(unsafe.Pointer(pFarg + 8)).FpExpr)).Fop
+ if !(int32(exprOp) == TK_COLUMN || int32(exprOp) == TK_AGG_COLUMN) {
goto __105
}
- (*Expr)(unsafe.Pointer((*ExprList_item)(unsafe.Pointer((pFarg + 8 /* &.a */))).FpExpr)).Fop2 = (U8((*FuncDef)(unsafe.Pointer(pDef)).FfuncFlags & (U32(OPFLAG_LENGTHARG | OPFLAG_TYPEOFARG))))
+ (*Expr)(unsafe.Pointer((*ExprList_item)(unsafe.Pointer(pFarg + 8)).FpExpr)).Fop2 = U8((*FuncDef)(unsafe.Pointer(pDef)).FfuncFlags & U32(OPFLAG_LENGTHARG|OPFLAG_TYPEOFARG))
__105:
;
__104:
;
Xsqlite3ExprCodeExprList(tls, pParse, pFarg, r1, 0,
- (uint8(SQLITE_ECEL_DUP | SQLITE_ECEL_FACTOR)))
+ uint8(SQLITE_ECEL_DUP|SQLITE_ECEL_FACTOR))
goto __101
__100:
r1 = 0
@@ -85284,24 +86408,24 @@ __101:
// function. The expression "A glob B" is equivalent to
// "glob(B,A). We want to use the A in "A glob B" to test
// for function overloading. But we use the B term in "glob(B,A)".
- if !((nFarg >= 2) && (((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_InfixFunc))) != U32(0))) {
+ if !(nFarg >= 2 && (*Expr)(unsafe.Pointer(pExpr)).Fflags&U32(EP_InfixFunc) != U32(0)) {
goto __106
}
- pDef = Xsqlite3VtabOverloadFunction(tls, db, pDef, nFarg, (*ExprList_item)(unsafe.Pointer((pFarg+8 /* &.a */)+1*20)).FpExpr)
+ pDef = Xsqlite3VtabOverloadFunction(tls, db, pDef, nFarg, (*ExprList_item)(unsafe.Pointer(pFarg+8+1*20)).FpExpr)
goto __107
__106:
if !(nFarg > 0) {
goto __108
}
- pDef = Xsqlite3VtabOverloadFunction(tls, db, pDef, nFarg, (*ExprList_item)(unsafe.Pointer((pFarg + 8 /* &.a */))).FpExpr)
+ pDef = Xsqlite3VtabOverloadFunction(tls, db, pDef, nFarg, (*ExprList_item)(unsafe.Pointer(pFarg+8)).FpExpr)
__108:
;
__107:
;
- if !(((*FuncDef)(unsafe.Pointer(pDef)).FfuncFlags & U32(SQLITE_FUNC_NEEDCOLL)) != 0) {
+ if !((*FuncDef)(unsafe.Pointer(pDef)).FfuncFlags&U32(SQLITE_FUNC_NEEDCOLL) != 0) {
goto __109
}
- if !(!(pColl != 0)) {
+ if !!(pColl != 0) {
goto __110
}
pColl = (*Sqlite3)(unsafe.Pointer(db)).FpDfltColl
@@ -85310,10 +86434,10 @@ __110:
Xsqlite3VdbeAddOp4(tls, v, OP_CollSeq, 0, 0, 0, pColl, -2)
__109:
;
- if !(((*FuncDef)(unsafe.Pointer(pDef)).FfuncFlags & U32(SQLITE_FUNC_OFFSET)) != 0) {
+ if !((*FuncDef)(unsafe.Pointer(pDef)).FfuncFlags&U32(SQLITE_FUNC_OFFSET) != U32(0) && pFarg != uintptr(0)) {
goto __111
}
- pArg = (*ExprList_item)(unsafe.Pointer((pFarg + 8 /* &.a */))).FpExpr
+ pArg = (*ExprList_item)(unsafe.Pointer(pFarg + 8)).FpExpr
if !(int32((*Expr)(unsafe.Pointer(pArg)).Fop) == TK_COLUMN) {
goto __113
}
@@ -85356,7 +86480,9 @@ __44:
return 0
goto __119
__118:
- if !((op == TK_SELECT) && ((libc.AssignInt32(&nCol, (*ExprList)(unsafe.Pointer((*Select)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pExpr + 20 /* &.x */)))).FpEList)).FnExpr)) != 1)) {
+ if !(op == TK_SELECT &&
+ (*Expr)(unsafe.Pointer(pExpr)).Fflags&U32(EP_xIsSelect) != U32(0) &&
+ libc.AssignInt32(&nCol, (*ExprList)(unsafe.Pointer((*Select)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pExpr + 20)))).FpEList)).FnExpr) != 1) {
goto __120
}
Xsqlite3SubselectError(tls, pParse, nCol, 1)
@@ -85377,15 +86503,15 @@ __45:
__122:
;
- if !(((*Expr)(unsafe.Pointer(pExpr)).FiTable != 0) &&
- ((*Expr)(unsafe.Pointer(pExpr)).FiTable != (libc.AssignInt32(&n1, Xsqlite3ExprVectorSize(tls, (*Expr)(unsafe.Pointer(pExpr)).FpLeft))))) {
+ n1 = Xsqlite3ExprVectorSize(tls, (*Expr)(unsafe.Pointer(pExpr)).FpLeft)
+ if !((*Expr)(unsafe.Pointer(pExpr)).FiTable != n1) {
goto __123
}
- Xsqlite3ErrorMsg(tls, pParse, ts+6627, /* "%d columns assig..." */
+ Xsqlite3ErrorMsg(tls, pParse, ts+7520, /* "%d columns assig..." */
libc.VaList(bp+24, (*Expr)(unsafe.Pointer(pExpr)).FiTable, n1))
__123:
;
- return ((*Expr)(unsafe.Pointer((*Expr)(unsafe.Pointer(pExpr)).FpLeft)).FiTable + int32((*Expr)(unsafe.Pointer(pExpr)).FiColumn))
+ return (*Expr)(unsafe.Pointer((*Expr)(unsafe.Pointer(pExpr)).FpLeft)).FiTable + int32((*Expr)(unsafe.Pointer(pExpr)).FiColumn)
__46:
destIfFalse = Xsqlite3VdbeMakeLabel(tls, pParse)
@@ -85418,34 +86544,11 @@ __50:
goto expr_code_doover // 2018-04-28: Prevent deep recursion. OSSFuzz.
__51:
- // If the opcode is TK_TRIGGER, then the expression is a reference
- // to a column in the new.* or old.* pseudo-tables available to
- // trigger programs. In this case Expr.iTable is set to 1 for the
- // new.* pseudo-table, or 0 for the old.* pseudo-table. Expr.iColumn
- // is set to the column of the pseudo-table to read, or to -1 to
- // read the rowid field.
- //
- // The expression is implemented using an OP_Param opcode. The p1
- // parameter is set to 0 for an old.rowid reference, or to (i+1)
- // to reference another column of the old.* pseudo-table, where
- // i is the index of the column. For a new.rowid reference, p1 is
- // set to (n+1), where n is the number of columns in each pseudo-table.
- // For a reference to any other column in the new.* pseudo-table, p1
- // is set to (n+2+i), where n and i are as defined previously. For
- // example, if the table on which triggers are being fired is
- // declared as:
- //
- // CREATE TABLE t1(a, b);
- //
- // Then p1 is interpreted as follows:
- //
- // p1==0 -> old.rowid p1==3 -> new.rowid
- // p1==1 -> old.a p1==4 -> new.a
- // p1==2 -> old.b p1==5 -> new.b
- pTab2 = *(*uintptr)(unsafe.Pointer(pExpr + 44 /* &.y */))
+ ;
+ pTab2 = *(*uintptr)(unsafe.Pointer(pExpr + 44))
iCol1 = int32((*Expr)(unsafe.Pointer(pExpr)).FiColumn)
- p1 = ((((*Expr)(unsafe.Pointer(pExpr)).FiTable * (int32((*Table)(unsafe.Pointer(pTab2)).FnCol) + 1)) + 1) +
- int32(Xsqlite3TableColumnToStorage(tls, pTab2, int16(iCol1))))
+ p1 = (*Expr)(unsafe.Pointer(pExpr)).FiTable*(int32((*Table)(unsafe.Pointer(pTab2)).FnCol)+1) + 1 +
+ int32(Xsqlite3TableColumnToStorage(tls, pTab2, int16(iCol1)))
Xsqlite3VdbeAddOp2(tls, v, OP_Param, p1, target)
@@ -85454,7 +86557,7 @@ __51:
//
// EVIDENCE-OF: R-60985-57662 SQLite will convert the value back to
// floating point when extracting it from the record.
- if !((iCol1 >= 0) && (int32((*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab2)).FaCol+uintptr(iCol1)*20)).Faffinity) == SQLITE_AFF_REAL)) {
+ if !(iCol1 >= 0 && int32((*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab2)).FaCol+uintptr(iCol1)*16)).Faffinity) == SQLITE_AFF_REAL) {
goto __124
}
Xsqlite3VdbeAddOp1(tls, v, OP_RealAffinity, target)
@@ -85463,7 +86566,7 @@ __124:
goto __3
__52:
- Xsqlite3ErrorMsg(tls, pParse, ts+5548 /* "row value misuse..." */, 0)
+ Xsqlite3ErrorMsg(tls, pParse, ts+6395 /* "row value misuse..." */, 0)
goto __3
// TK_IF_NULL_ROW Expr nodes are inserted ahead of expressions
@@ -85509,11 +86612,11 @@ __54: // The X expression
pDel = uintptr(0)
db1 = (*Parse)(unsafe.Pointer(pParse)).Fdb
- pEList = *(*uintptr)(unsafe.Pointer(pExpr + 20 /* &.x */))
+ pEList = *(*uintptr)(unsafe.Pointer(pExpr + 20))
aListelem = pEList + 8 /* &.a */
nExpr = (*ExprList)(unsafe.Pointer(pEList)).FnExpr
endLabel = Xsqlite3VdbeMakeLabel(tls, pParse)
- if !((libc.AssignUintptr(&pX, (*Expr)(unsafe.Pointer(pExpr)).FpLeft)) != uintptr(0)) {
+ if !(libc.AssignUintptr(&pX, (*Expr)(unsafe.Pointer(pExpr)).FpLeft) != uintptr(0)) {
goto __125
}
pDel = Xsqlite3ExprDup(tls, db1, pX, 0)
@@ -85540,7 +86643,7 @@ __125:
;
i1 = 0
__127:
- if !(i1 < (nExpr - 1)) {
+ if !(i1 < nExpr-1) {
goto __129
}
if !(pX != 0) {
@@ -85557,20 +86660,20 @@ __131:
Xsqlite3ExprIfFalse(tls, pParse, pTest, nextCase, SQLITE_JUMPIFNULL)
- Xsqlite3ExprCode(tls, pParse, (*ExprList_item)(unsafe.Pointer(aListelem+uintptr((i1+1))*20)).FpExpr, target)
+ Xsqlite3ExprCode(tls, pParse, (*ExprList_item)(unsafe.Pointer(aListelem+uintptr(i1+1)*20)).FpExpr, target)
Xsqlite3VdbeGoto(tls, v, endLabel)
Xsqlite3VdbeResolveLabel(tls, v, nextCase)
goto __128
__128:
- i1 = (i1 + 2)
+ i1 = i1 + 2
goto __127
goto __129
__129:
;
- if !((nExpr & 1) != 0) {
+ if !(nExpr&1 != 0) {
goto __132
}
- Xsqlite3ExprCode(tls, pParse, (*ExprList_item)(unsafe.Pointer((pEList+8 /* &.a */)+uintptr((nExpr-1))*20)).FpExpr, target)
+ Xsqlite3ExprCode(tls, pParse, (*ExprList_item)(unsafe.Pointer(pEList+8+uintptr(nExpr-1)*20)).FpExpr, target)
goto __133
__132:
Xsqlite3VdbeAddOp2(tls, v, OP_Null, 0, target)
@@ -85587,7 +86690,7 @@ __55:
goto __134
}
Xsqlite3ErrorMsg(tls, pParse,
- ts+7023 /* "RAISE() may only..." */, 0)
+ ts+7939 /* "RAISE() may only..." */, 0)
return 0
__134:
;
@@ -85602,18 +86705,18 @@ __135:
goto __136
}
Xsqlite3VdbeAddOp4(tls,
- v, OP_Halt, SQLITE_OK, OE_Ignore, 0, *(*uintptr)(unsafe.Pointer(pExpr + 8 /* &.u */)), 0)
+ v, OP_Halt, SQLITE_OK, OE_Ignore, 0, *(*uintptr)(unsafe.Pointer(pExpr + 8)), 0)
goto __137
__136:
Xsqlite3HaltConstraint(tls, pParse,
func() int32 {
if (*Parse)(unsafe.Pointer(pParse)).FpTriggerTab != 0 {
- return (SQLITE_CONSTRAINT | (int32(7) << 8))
+ return SQLITE_CONSTRAINT | int32(7)<<8
}
return SQLITE_ERROR
}(),
- int32((*Expr)(unsafe.Pointer(pExpr)).FaffExpr), *(*uintptr)(unsafe.Pointer(pExpr + 8 /* &.u */)), int8(0), uint8(0))
+ int32((*Expr)(unsafe.Pointer(pExpr)).FaffExpr), *(*uintptr)(unsafe.Pointer(pExpr + 8)), int8(0), uint8(0))
__137:
;
@@ -85626,7 +86729,7 @@ __3:
return inReg
}
-var zAff = *(*[8]uint8)(unsafe.Pointer(ts + 7073 /* "B\x00C\x00D\x00E" */)) /* sqlite3.c:105169:29 */
+var zAff = *(*[8]uint8)(unsafe.Pointer(ts + 7989 /* "B\x00C\x00D\x00E" */)) /* sqlite3.c:105675:29 */
// Generate code that will evaluate expression pExpr just one time
// per prepared statement execution.
@@ -85643,11 +86746,11 @@ var zAff = *(*[8]uint8)(unsafe.Pointer(ts + 7073 /* "B\x00C\x00D\x00E" */)) /* s
// code to the same register, if they do not contain function calls and hence
// are factored out into the initialization section at the end of the
// prepared statement.
-func Xsqlite3ExprCodeRunJustOnce(tls *libc.TLS, pParse uintptr, pExpr uintptr, regDest int32) int32 { /* sqlite3.c:105866:20: */
+func Xsqlite3ExprCodeRunJustOnce(tls *libc.TLS, pParse uintptr, pExpr uintptr, regDest int32) int32 { /* sqlite3.c:106382:20: */
var p uintptr
p = (*Parse)(unsafe.Pointer(pParse)).FpConstExpr
- if (regDest < 0) && (p != 0) {
+ if regDest < 0 && p != 0 {
var pItem uintptr
var i int32
pItem = p + 8 /* &.a */
@@ -85657,8 +86760,8 @@ func Xsqlite3ExprCodeRunJustOnce(tls *libc.TLS, pParse uintptr, pExpr uintptr, r
goto __3
}
{
- if ((uint32(int32(*(*uint8)(unsafe.Pointer(pItem + 12 /* &.reusable */)) & 0x8 >> 3))) != 0) && (Xsqlite3ExprCompare(tls, uintptr(0), (*ExprList_item)(unsafe.Pointer(pItem)).FpExpr, pExpr, -1) == 0) {
- return *(*int32)(unsafe.Pointer(pItem + 16 /* &.u */))
+ if uint32(int32(*(*uint8)(unsafe.Pointer(pItem + 12))&0x8>>3)) != 0 && Xsqlite3ExprCompare(tls, uintptr(0), (*ExprList_item)(unsafe.Pointer(pItem)).FpExpr, pExpr, -1) == 0 {
+ return *(*int32)(unsafe.Pointer(pItem + 16))
}
}
@@ -85671,7 +86774,7 @@ func Xsqlite3ExprCodeRunJustOnce(tls *libc.TLS, pParse uintptr, pExpr uintptr, r
__3:
}
pExpr = Xsqlite3ExprDup(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, pExpr, 0)
- if (pExpr != uintptr(0)) && (((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_HasFunc))) != U32(0)) {
+ if pExpr != uintptr(0) && (*Expr)(unsafe.Pointer(pExpr)).Fflags&U32(EP_HasFunc) != U32(0) {
var v uintptr = (*Parse)(unsafe.Pointer(pParse)).FpVdbe
var addr int32
@@ -85689,12 +86792,12 @@ func Xsqlite3ExprCodeRunJustOnce(tls *libc.TLS, pParse uintptr, pExpr uintptr, r
} else {
p = Xsqlite3ExprListAppend(tls, pParse, p, pExpr)
if p != 0 {
- var pItem uintptr = ((p + 8 /* &.a */) + uintptr(((*ExprList)(unsafe.Pointer(p)).FnExpr-1))*20)
- libc.SetBitFieldPtr8Uint32(pItem+12 /* &.reusable */, (uint32(libc.Bool32(regDest < 0))), 3, 0x8)
+ var pItem uintptr = p + 8 + uintptr((*ExprList)(unsafe.Pointer(p)).FnExpr-1)*20
+ libc.SetBitFieldPtr8Uint32(pItem+12, uint32(libc.Bool32(regDest < 0)), 3, 0x8)
if regDest < 0 {
regDest = libc.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1)
}
- *(*int32)(unsafe.Pointer(pItem + 16 /* &.u */)) = regDest
+ *(*int32)(unsafe.Pointer(pItem + 16)) = regDest
}
(*Parse)(unsafe.Pointer(pParse)).FpConstExpr = p
}
@@ -85712,13 +86815,13 @@ func Xsqlite3ExprCodeRunJustOnce(tls *libc.TLS, pParse uintptr, pExpr uintptr, r
// If pExpr is a constant, then this routine might generate this
// code to fill the register in the initialization section of the
// VDBE program, in order to factor it out of the evaluation loop.
-func Xsqlite3ExprCodeTemp(tls *libc.TLS, pParse uintptr, pExpr uintptr, pReg uintptr) int32 { /* sqlite3.c:105923:20: */
+func Xsqlite3ExprCodeTemp(tls *libc.TLS, pParse uintptr, pExpr uintptr, pReg uintptr) int32 { /* sqlite3.c:106439:20: */
var r2 int32
pExpr = Xsqlite3ExprSkipCollateAndLikely(tls, pExpr)
- if ((((*Parse)(unsafe.Pointer(pParse)).FokConstFactor != 0) &&
- (pExpr != uintptr(0))) &&
- (int32((*Expr)(unsafe.Pointer(pExpr)).Fop) != TK_REGISTER)) &&
- (Xsqlite3ExprIsConstantNotJoin(tls, pExpr) != 0) {
+ if (*Parse)(unsafe.Pointer(pParse)).FokConstFactor != 0 &&
+ pExpr != uintptr(0) &&
+ int32((*Expr)(unsafe.Pointer(pExpr)).Fop) != TK_REGISTER &&
+ Xsqlite3ExprIsConstantNotJoin(tls, pExpr) != 0 {
*(*int32)(unsafe.Pointer(pReg)) = 0
r2 = Xsqlite3ExprCodeRunJustOnce(tls, pParse, pExpr, -1)
} else {
@@ -85737,7 +86840,7 @@ func Xsqlite3ExprCodeTemp(tls *libc.TLS, pParse uintptr, pExpr uintptr, pReg uin
// Generate code that will evaluate expression pExpr and store the
// results in register target. The results are guaranteed to appear
// in register target.
-func Xsqlite3ExprCode(tls *libc.TLS, pParse uintptr, pExpr uintptr, target int32) { /* sqlite3.c:105951:21: */
+func Xsqlite3ExprCode(tls *libc.TLS, pParse uintptr, pExpr uintptr, target int32) { /* sqlite3.c:106467:21: */
var inReg int32
if (*Parse)(unsafe.Pointer(pParse)).FpVdbe == uintptr(0) {
@@ -85746,7 +86849,7 @@ func Xsqlite3ExprCode(tls *libc.TLS, pParse uintptr, pExpr uintptr, target int32
inReg = Xsqlite3ExprCodeTarget(tls, pParse, pExpr, target)
if inReg != target {
var op U8
- if ((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_Subquery))) != U32(0) {
+ if pExpr != 0 && (*Expr)(unsafe.Pointer(pExpr)).Fflags&U32(EP_Subquery) != U32(0) {
op = U8(OP_Copy)
} else {
op = U8(OP_SCopy)
@@ -85758,7 +86861,7 @@ func Xsqlite3ExprCode(tls *libc.TLS, pParse uintptr, pExpr uintptr, target int32
// Make a transient copy of expression pExpr and then code it using
// sqlite3ExprCode(). This routine works just like sqlite3ExprCode()
// except that the input expression is guaranteed to be unchanged.
-func Xsqlite3ExprCodeCopy(tls *libc.TLS, pParse uintptr, pExpr uintptr, target int32) { /* sqlite3.c:105975:21: */
+func Xsqlite3ExprCodeCopy(tls *libc.TLS, pParse uintptr, pExpr uintptr, target int32) { /* sqlite3.c:106491:21: */
var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb
pExpr = Xsqlite3ExprDup(tls, db, pExpr, 0)
if !(int32((*Sqlite3)(unsafe.Pointer(db)).FmallocFailed) != 0) {
@@ -85771,8 +86874,8 @@ func Xsqlite3ExprCodeCopy(tls *libc.TLS, pParse uintptr, pExpr uintptr, target i
// results in register target. The results are guaranteed to appear
// in register target. If the expression is constant, then this routine
// might choose to code the expression at initialization time.
-func Xsqlite3ExprCodeFactorable(tls *libc.TLS, pParse uintptr, pExpr uintptr, target int32) { /* sqlite3.c:105988:21: */
- if ((*Parse)(unsafe.Pointer(pParse)).FokConstFactor != 0) && (Xsqlite3ExprIsConstantNotJoin(tls, pExpr) != 0) {
+func Xsqlite3ExprCodeFactorable(tls *libc.TLS, pParse uintptr, pExpr uintptr, target int32) { /* sqlite3.c:106504:21: */
+ if (*Parse)(unsafe.Pointer(pParse)).FokConstFactor != 0 && Xsqlite3ExprIsConstantNotJoin(tls, pExpr) != 0 {
Xsqlite3ExprCodeRunJustOnce(tls, pParse, pExpr, target)
} else {
Xsqlite3ExprCodeCopy(tls, pParse, pExpr, target)
@@ -85797,13 +86900,13 @@ func Xsqlite3ExprCodeFactorable(tls *libc.TLS, pParse uintptr, pExpr uintptr, ta
// in registers at srcReg, and so the value can be copied from there.
// If SQLITE_ECEL_OMITREF is also set, then the values with u.x.iOrderByCol>0
// are simply omitted rather than being copied from srcReg.
-func Xsqlite3ExprCodeExprList(tls *libc.TLS, pParse uintptr, pList uintptr, target int32, srcReg int32, flags U8) int32 { /* sqlite3.c:106016:20: */
+func Xsqlite3ExprCodeExprList(tls *libc.TLS, pParse uintptr, pList uintptr, target int32, srcReg int32, flags U8) int32 { /* sqlite3.c:106532:20: */
var pItem uintptr
var i int32
var j int32
var n int32
var copyOp U8
- if (int32(flags) & SQLITE_ECEL_DUP) != 0 {
+ if int32(flags)&SQLITE_ECEL_DUP != 0 {
copyOp = uint8(OP_Copy)
} else {
copyOp = uint8(OP_SCopy)
@@ -85813,7 +86916,7 @@ func Xsqlite3ExprCodeExprList(tls *libc.TLS, pParse uintptr, pList uintptr, targ
// Never gets this far otherwise
n = (*ExprList)(unsafe.Pointer(pList)).FnExpr
if !(int32((*Parse)(unsafe.Pointer(pParse)).FokConstFactor) != 0) {
- flags = libc.Uint8FromInt32(int32(flags) & (libc.CplInt32(SQLITE_ECEL_FACTOR)))
+ flags = libc.Uint8FromInt32(int32(flags) & libc.CplInt32(SQLITE_ECEL_FACTOR))
}
pItem = pList + 8 /* &.a */
i = 0
@@ -85823,28 +86926,28 @@ __1:
}
{
var pExpr uintptr = (*ExprList_item)(unsafe.Pointer(pItem)).FpExpr
- if ((int32(flags) & SQLITE_ECEL_REF) != 0) && ((libc.AssignInt32(&j, int32(*(*U16)(unsafe.Pointer(pItem + 16 /* &.u */ /* &.x */ /* &.iOrderByCol */))))) > 0) {
- if (int32(flags) & SQLITE_ECEL_OMITREF) != 0 {
+ if int32(flags)&SQLITE_ECEL_REF != 0 && libc.AssignInt32(&j, int32(*(*U16)(unsafe.Pointer(pItem + 16)))) > 0 {
+ if int32(flags)&SQLITE_ECEL_OMITREF != 0 {
i--
n--
} else {
- Xsqlite3VdbeAddOp2(tls, v, int32(copyOp), ((j + srcReg) - 1), (target + i))
+ Xsqlite3VdbeAddOp2(tls, v, int32(copyOp), j+srcReg-1, target+i)
}
- } else if ((int32(flags) & SQLITE_ECEL_FACTOR) != 0) &&
- (Xsqlite3ExprIsConstantNotJoin(tls, pExpr) != 0) {
- Xsqlite3ExprCodeRunJustOnce(tls, pParse, pExpr, (target + i))
+ } else if int32(flags)&SQLITE_ECEL_FACTOR != 0 &&
+ Xsqlite3ExprIsConstantNotJoin(tls, pExpr) != 0 {
+ Xsqlite3ExprCodeRunJustOnce(tls, pParse, pExpr, target+i)
} else {
- var inReg int32 = Xsqlite3ExprCodeTarget(tls, pParse, pExpr, (target + i))
- if inReg != (target + i) {
+ var inReg int32 = Xsqlite3ExprCodeTarget(tls, pParse, pExpr, target+i)
+ if inReg != target+i {
var pOp uintptr
- if ((((int32(copyOp) == OP_Copy) &&
- (int32((*VdbeOp)(unsafe.Pointer((libc.AssignUintptr(&pOp, Xsqlite3VdbeGetOp(tls, v, -1))))).Fopcode) == OP_Copy)) &&
- ((((*VdbeOp)(unsafe.Pointer(pOp)).Fp1 + (*VdbeOp)(unsafe.Pointer(pOp)).Fp3) + 1) == inReg)) &&
- ((((*VdbeOp)(unsafe.Pointer(pOp)).Fp2 + (*VdbeOp)(unsafe.Pointer(pOp)).Fp3) + 1) == (target + i))) &&
- (int32((*VdbeOp)(unsafe.Pointer(pOp)).Fp5) == 0) {
+ if int32(copyOp) == OP_Copy &&
+ int32((*VdbeOp)(unsafe.Pointer(libc.AssignUintptr(&pOp, Xsqlite3VdbeGetOp(tls, v, -1)))).Fopcode) == OP_Copy &&
+ (*VdbeOp)(unsafe.Pointer(pOp)).Fp1+(*VdbeOp)(unsafe.Pointer(pOp)).Fp3+1 == inReg &&
+ (*VdbeOp)(unsafe.Pointer(pOp)).Fp2+(*VdbeOp)(unsafe.Pointer(pOp)).Fp3+1 == target+i &&
+ int32((*VdbeOp)(unsafe.Pointer(pOp)).Fp5) == 0 {
(*VdbeOp)(unsafe.Pointer(pOp)).Fp3++
} else {
- Xsqlite3VdbeAddOp2(tls, v, int32(copyOp), inReg, (target + i))
+ Xsqlite3VdbeAddOp2(tls, v, int32(copyOp), inReg, target+i)
}
}
}
@@ -85879,7 +86982,7 @@ __3:
// sqlite3ExprIfFalse: Jump to dest if false
//
// The jumpIfNull parameter is ignored if xJumpIf is NULL.
-func exprCodeBetween(tls *libc.TLS, pParse uintptr, pExpr uintptr, dest int32, xJump uintptr, jumpIfNull int32) { /* sqlite3.c:106091:13: */
+func exprCodeBetween(tls *libc.TLS, pParse uintptr, pExpr uintptr, dest int32, xJump uintptr, jumpIfNull int32) { /* sqlite3.c:106607:13: */
bp := tls.Alloc(160)
defer tls.Free(160)
@@ -85904,10 +87007,10 @@ func exprCodeBetween(tls *libc.TLS, pParse uintptr, pExpr uintptr, dest int32, x
(*Expr)(unsafe.Pointer(bp + 104 /* &exprAnd */)).FpRight = bp + 52 /* &compRight */
(*Expr)(unsafe.Pointer(bp /* &compLeft */)).Fop = U8(TK_GE)
(*Expr)(unsafe.Pointer(bp /* &compLeft */)).FpLeft = pDel
- (*Expr)(unsafe.Pointer(bp /* &compLeft */)).FpRight = (*ExprList_item)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(pExpr + 20 /* &.x */)) + 8 /* &.a */))).FpExpr
+ (*Expr)(unsafe.Pointer(bp /* &compLeft */)).FpRight = (*ExprList_item)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pExpr + 20)) + 8)).FpExpr
(*Expr)(unsafe.Pointer(bp + 52 /* &compRight */)).Fop = U8(TK_LE)
(*Expr)(unsafe.Pointer(bp + 52 /* &compRight */)).FpLeft = pDel
- (*Expr)(unsafe.Pointer(bp + 52 /* &compRight */)).FpRight = (*ExprList_item)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(pExpr + 20 /* &.x */)) + 8 /* &.a */) + 1*20)).FpExpr
+ (*Expr)(unsafe.Pointer(bp + 52 /* &compRight */)).FpRight = (*ExprList_item)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pExpr + 20)) + 8 + 1*20)).FpExpr
exprToRegister(tls, pDel, exprCodeVector(tls, pParse, pDel, bp+156 /* &regFree1 */))
if xJump != 0 {
(*struct {
@@ -85919,7 +87022,7 @@ func exprCodeBetween(tls *libc.TLS, pParse uintptr, pExpr uintptr, dest int32, x
// it into the Parse.pConstExpr list. We should use a new bit for this,
// for clarity, but we are out of bits in the Expr.flags field so we
// have to reuse the EP_FromJoin bit. Bummer.
- *(*U32)(unsafe.Pointer(pDel + 4 /* &.flags */)) |= (U32(EP_FromJoin))
+ *(*U32)(unsafe.Pointer(pDel + 4)) |= U32(EP_FromJoin)
Xsqlite3ExprCodeTarget(tls, pParse, bp+104 /* &exprAnd */, dest)
}
Xsqlite3ReleaseTempReg(tls, pParse, *(*int32)(unsafe.Pointer(bp + 156 /* regFree1 */)))
@@ -85942,7 +87045,7 @@ func exprCodeBetween(tls *libc.TLS, pParse uintptr, pExpr uintptr, dest int32, x
// operation. Special comments in vdbe.c and the mkopcodeh.awk script in
// the make process cause these values to align. Assert()s in the code
// below verify that the numbers are aligned correctly.
-func Xsqlite3ExprIfTrue(tls *libc.TLS, pParse uintptr, pExpr uintptr, dest int32, jumpIfNull int32) { /* sqlite3.c:106163:21: */
+func Xsqlite3ExprIfTrue(tls *libc.TLS, pParse uintptr, pExpr uintptr, dest int32, jumpIfNull int32) { /* sqlite3.c:106679:21: */
bp := tls.Alloc(8)
defer tls.Free(8)
@@ -86031,7 +87134,7 @@ __21:
d2 = Xsqlite3VdbeMakeLabel(tls, pParse)
Xsqlite3ExprIfFalse(tls, pParse, (*Expr)(unsafe.Pointer(pExpr)).FpLeft, d2,
- (jumpIfNull ^ SQLITE_JUMPIFNULL))
+ jumpIfNull^SQLITE_JUMPIFNULL)
Xsqlite3ExprIfTrue(tls, pParse, (*Expr)(unsafe.Pointer(pExpr)).FpRight, dest, jumpIfNull)
Xsqlite3VdbeResolveLabel(tls, v, d2)
goto __24
@@ -86052,10 +87155,10 @@ __6:
__7: // IS TRUE or IS NOT TRUE
;
- isNot = (libc.Bool32(int32((*Expr)(unsafe.Pointer(pExpr)).Fop2) == TK_ISNOT))
+ isNot = libc.Bool32(int32((*Expr)(unsafe.Pointer(pExpr)).Fop2) == TK_ISNOT)
isTrue = Xsqlite3ExprTruthValue(tls, (*Expr)(unsafe.Pointer(pExpr)).FpRight)
- if !((isTrue ^ isNot) != 0) {
+ if !(isTrue^isNot != 0) {
goto __25
}
Xsqlite3ExprIfTrue(tls, pParse, (*Expr)(unsafe.Pointer(pExpr)).FpLeft, dest,
@@ -86104,7 +87207,7 @@ __27:
r1 = Xsqlite3ExprCodeTemp(tls, pParse, (*Expr)(unsafe.Pointer(pExpr)).FpLeft, bp /* &regFree1 */)
r2 = Xsqlite3ExprCodeTemp(tls, pParse, (*Expr)(unsafe.Pointer(pExpr)).FpRight, bp+4 /* &regFree2 */)
codeCompare(tls, pParse, (*Expr)(unsafe.Pointer(pExpr)).FpLeft, (*Expr)(unsafe.Pointer(pExpr)).FpRight, op,
- r1, r2, dest, jumpIfNull, (libc.Bool32(((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_Commuted))) != U32(0))))
+ r1, r2, dest, jumpIfNull, libc.Bool32((*Expr)(unsafe.Pointer(pExpr)).Fflags&U32(EP_Commuted) != U32(0)))
goto __3
@@ -86138,20 +87241,20 @@ __19:
__20:
default_expr:
- if !(((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_FromJoin | EP_IsTrue))) == U32(EP_IsTrue)) {
+ if !((*Expr)(unsafe.Pointer(pExpr)).Fflags&U32(EP_FromJoin|EP_IsTrue) == U32(EP_IsTrue)) {
goto __28
}
Xsqlite3VdbeGoto(tls, v, dest)
goto __29
__28:
- if !(((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_FromJoin | EP_IsFalse))) == U32(EP_IsFalse)) {
+ if !((*Expr)(unsafe.Pointer(pExpr)).Fflags&U32(EP_FromJoin|EP_IsFalse) == U32(EP_IsFalse)) {
goto __30
}
// No-op
goto __31
__30:
r1 = Xsqlite3ExprCodeTemp(tls, pParse, pExpr, bp /* &regFree1 */)
- Xsqlite3VdbeAddOp3(tls, v, OP_If, r1, dest, (libc.Bool32(jumpIfNull != 0)))
+ Xsqlite3VdbeAddOp3(tls, v, OP_If, r1, dest, libc.Bool32(jumpIfNull != 0))
__31:
;
@@ -86172,7 +87275,7 @@ __3:
// If the expression evaluates to NULL (neither true nor false) then
// jump if jumpIfNull is SQLITE_JUMPIFNULL or fall through if jumpIfNull
// is 0.
-func Xsqlite3ExprIfFalse(tls *libc.TLS, pParse uintptr, pExpr uintptr, dest int32, jumpIfNull int32) { /* sqlite3.c:106305:21: */
+func Xsqlite3ExprIfFalse(tls *libc.TLS, pParse uintptr, pExpr uintptr, dest int32, jumpIfNull int32) { /* sqlite3.c:106821:21: */
bp := tls.Alloc(8)
defer tls.Free(8)
@@ -86224,7 +87327,7 @@ __2:
// The value of TK_ and OP_ constants are arranged such that we
// can compute the mapping above using the following expression.
// Assert()s verify that the computation is correct.
- op = (((int32((*Expr)(unsafe.Pointer(pExpr)).Fop) + (TK_ISNULL & 1)) ^ 1) - (TK_ISNULL & 1))
+ op = int32((*Expr)(unsafe.Pointer(pExpr)).Fop) + TK_ISNULL&1 ^ 1 - TK_ISNULL&1
// Verify correct alignment of TK_ and OP_ constants
@@ -86285,7 +87388,7 @@ __23:
d2 = Xsqlite3VdbeMakeLabel(tls, pParse)
Xsqlite3ExprIfTrue(tls, pParse, (*Expr)(unsafe.Pointer(pExpr)).FpLeft, d2,
- (jumpIfNull ^ SQLITE_JUMPIFNULL))
+ jumpIfNull^SQLITE_JUMPIFNULL)
Xsqlite3ExprIfFalse(tls, pParse, (*Expr)(unsafe.Pointer(pExpr)).FpRight, dest, jumpIfNull)
Xsqlite3VdbeResolveLabel(tls, v, d2)
__24:
@@ -86301,10 +87404,10 @@ __6:
__7: // IS TRUE or IS NOT TRUE
;
- isNot = (libc.Bool32(int32((*Expr)(unsafe.Pointer(pExpr)).Fop2) == TK_ISNOT))
+ isNot = libc.Bool32(int32((*Expr)(unsafe.Pointer(pExpr)).Fop2) == TK_ISNOT)
isTrue = Xsqlite3ExprTruthValue(tls, (*Expr)(unsafe.Pointer(pExpr)).FpRight)
- if !((isTrue ^ isNot) != 0) {
+ if !(isTrue^isNot != 0) {
goto __25
}
// IS TRUE and IS NOT FALSE
@@ -86356,7 +87459,7 @@ __27:
r1 = Xsqlite3ExprCodeTemp(tls, pParse, (*Expr)(unsafe.Pointer(pExpr)).FpLeft, bp /* &regFree1 */)
r2 = Xsqlite3ExprCodeTemp(tls, pParse, (*Expr)(unsafe.Pointer(pExpr)).FpRight, bp+4 /* &regFree2 */)
codeCompare(tls, pParse, (*Expr)(unsafe.Pointer(pExpr)).FpLeft, (*Expr)(unsafe.Pointer(pExpr)).FpRight, op,
- r1, r2, dest, jumpIfNull, (libc.Bool32(((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_Commuted))) != U32(0))))
+ r1, r2, dest, jumpIfNull, libc.Bool32((*Expr)(unsafe.Pointer(pExpr)).Fflags&U32(EP_Commuted) != U32(0)))
goto __3
@@ -86390,20 +87493,20 @@ __29:
__20:
default_expr:
- if !(((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_FromJoin | EP_IsFalse))) == U32(EP_IsFalse)) {
+ if !((*Expr)(unsafe.Pointer(pExpr)).Fflags&U32(EP_FromJoin|EP_IsFalse) == U32(EP_IsFalse)) {
goto __30
}
Xsqlite3VdbeGoto(tls, v, dest)
goto __31
__30:
- if !(((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_FromJoin | EP_IsTrue))) == U32(EP_IsTrue)) {
+ if !((*Expr)(unsafe.Pointer(pExpr)).Fflags&U32(EP_FromJoin|EP_IsTrue) == U32(EP_IsTrue)) {
goto __32
}
// no-op
goto __33
__32:
r1 = Xsqlite3ExprCodeTemp(tls, pParse, pExpr, bp /* &regFree1 */)
- Xsqlite3VdbeAddOp3(tls, v, OP_IfNot, r1, dest, (libc.Bool32(jumpIfNull != 0)))
+ Xsqlite3VdbeAddOp3(tls, v, OP_IfNot, r1, dest, libc.Bool32(jumpIfNull != 0))
__33:
;
@@ -86420,7 +87523,7 @@ __3:
// Like sqlite3ExprIfFalse() except that a copy is made of pExpr before
// code generation, and that copy is deleted after code generation. This
// ensures that the original pExpr is unchanged.
-func Xsqlite3ExprIfFalseDup(tls *libc.TLS, pParse uintptr, pExpr uintptr, dest int32, jumpIfNull int32) { /* sqlite3.c:106477:21: */
+func Xsqlite3ExprIfFalseDup(tls *libc.TLS, pParse uintptr, pExpr uintptr, dest int32, jumpIfNull int32) { /* sqlite3.c:106993:21: */
var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb
var pCopy uintptr = Xsqlite3ExprDup(tls, db, pExpr, 0)
if int32((*Sqlite3)(unsafe.Pointer(db)).FmallocFailed) == 0 {
@@ -86440,7 +87543,7 @@ func Xsqlite3ExprIfFalseDup(tls *libc.TLS, pParse uintptr, pExpr uintptr, dest i
// same as that currently bound to variable pVar, non-zero is returned.
// Otherwise, if the values are not the same or if pExpr is not a simple
// SQL value, zero is returned.
-func exprCompareVariable(tls *libc.TLS, pParse uintptr, pVar uintptr, pExpr uintptr) int32 { /* sqlite3.c:106499:12: */
+func exprCompareVariable(tls *libc.TLS, pParse uintptr, pVar uintptr, pExpr uintptr) int32 { /* sqlite3.c:107015:12: */
bp := tls.Alloc(4)
defer tls.Free(4)
@@ -86450,7 +87553,7 @@ func exprCompareVariable(tls *libc.TLS, pParse uintptr, pVar uintptr, pExpr uint
*(*uintptr)(unsafe.Pointer(bp /* pR */)) = uintptr(0)
Xsqlite3ValueFromExpr(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, pExpr, uint8(SQLITE_UTF8), uint8(SQLITE_AFF_BLOB), bp /* &pR */)
- if *(*uintptr)(unsafe.Pointer(bp /* pR */)) != 0 {
+ if *(*uintptr)(unsafe.Pointer(bp)) != 0 {
iVar = int32((*Expr)(unsafe.Pointer(pVar)).FiColumn)
Xsqlite3VdbeSetVarmask(tls, (*Parse)(unsafe.Pointer(pParse)).FpVdbe, iVar)
pL = Xsqlite3VdbeGetBoundValue(tls, (*Parse)(unsafe.Pointer(pParse)).FpReprepare, iVar, uint8(SQLITE_AFF_BLOB))
@@ -86458,7 +87561,7 @@ func exprCompareVariable(tls *libc.TLS, pParse uintptr, pVar uintptr, pExpr uint
if Xsqlite3_value_type(tls, pL) == SQLITE_TEXT {
Xsqlite3_value_text(tls, pL) // Make sure the encoding is UTF-8
}
- res = (libc.Bool32(0 == Xsqlite3MemCompare(tls, pL, *(*uintptr)(unsafe.Pointer(bp /* pR */)), uintptr(0))))
+ res = libc.Bool32(0 == Xsqlite3MemCompare(tls, pL, *(*uintptr)(unsafe.Pointer(bp)), uintptr(0)))
}
Xsqlite3ValueFree(tls, *(*uintptr)(unsafe.Pointer(bp /* pR */)))
Xsqlite3ValueFree(tls, pL)
@@ -86494,85 +87597,89 @@ func exprCompareVariable(tls *libc.TLS, pParse uintptr, pVar uintptr, pExpr uint
// If pParse is NULL (the normal case) then any TK_VARIABLE term in
// Argument pParse should normally be NULL. If it is not NULL and pA or
// pB causes a return value of 2.
-func Xsqlite3ExprCompare(tls *libc.TLS, pParse uintptr, pA uintptr, pB uintptr, iTab int32) int32 { /* sqlite3.c:106551:20: */
+func Xsqlite3ExprCompare(tls *libc.TLS, pParse uintptr, pA uintptr, pB uintptr, iTab int32) int32 { /* sqlite3.c:107071:20: */
var combinedFlags U32
- if (pA == uintptr(0)) || (pB == uintptr(0)) {
+ if pA == uintptr(0) || pB == uintptr(0) {
if pB == pA {
return 0
}
return 2
}
- if ((pParse != 0) && (int32((*Expr)(unsafe.Pointer(pA)).Fop) == TK_VARIABLE)) && (exprCompareVariable(tls, pParse, pA, pB) != 0) {
+ if pParse != 0 && int32((*Expr)(unsafe.Pointer(pA)).Fop) == TK_VARIABLE && exprCompareVariable(tls, pParse, pA, pB) != 0 {
return 0
}
- combinedFlags = ((*Expr)(unsafe.Pointer(pA)).Fflags | (*Expr)(unsafe.Pointer(pB)).Fflags)
- if (combinedFlags & U32(EP_IntValue)) != 0 {
- if ((((*Expr)(unsafe.Pointer(pA)).Fflags & (*Expr)(unsafe.Pointer(pB)).Fflags) & U32(EP_IntValue)) != U32(0)) && (*(*int32)(unsafe.Pointer(pA + 8 /* &.u */)) == *(*int32)(unsafe.Pointer(pB + 8 /* &.u */))) {
+ combinedFlags = (*Expr)(unsafe.Pointer(pA)).Fflags | (*Expr)(unsafe.Pointer(pB)).Fflags
+ if combinedFlags&U32(EP_IntValue) != 0 {
+ if (*Expr)(unsafe.Pointer(pA)).Fflags&(*Expr)(unsafe.Pointer(pB)).Fflags&U32(EP_IntValue) != U32(0) && *(*int32)(unsafe.Pointer(pA + 8)) == *(*int32)(unsafe.Pointer(pB + 8)) {
return 0
}
return 2
}
- if (int32((*Expr)(unsafe.Pointer(pA)).Fop) != int32((*Expr)(unsafe.Pointer(pB)).Fop)) || (int32((*Expr)(unsafe.Pointer(pA)).Fop) == TK_RAISE) {
- if (int32((*Expr)(unsafe.Pointer(pA)).Fop) == TK_COLLATE) && (Xsqlite3ExprCompare(tls, pParse, (*Expr)(unsafe.Pointer(pA)).FpLeft, pB, iTab) < 2) {
+ if int32((*Expr)(unsafe.Pointer(pA)).Fop) != int32((*Expr)(unsafe.Pointer(pB)).Fop) || int32((*Expr)(unsafe.Pointer(pA)).Fop) == TK_RAISE {
+ if int32((*Expr)(unsafe.Pointer(pA)).Fop) == TK_COLLATE && Xsqlite3ExprCompare(tls, pParse, (*Expr)(unsafe.Pointer(pA)).FpLeft, pB, iTab) < 2 {
return 1
}
- if (int32((*Expr)(unsafe.Pointer(pB)).Fop) == TK_COLLATE) && (Xsqlite3ExprCompare(tls, pParse, pA, (*Expr)(unsafe.Pointer(pB)).FpLeft, iTab) < 2) {
+ if int32((*Expr)(unsafe.Pointer(pB)).Fop) == TK_COLLATE && Xsqlite3ExprCompare(tls, pParse, pA, (*Expr)(unsafe.Pointer(pB)).FpLeft, iTab) < 2 {
return 1
}
return 2
}
- if ((int32((*Expr)(unsafe.Pointer(pA)).Fop) != TK_COLUMN) && (int32((*Expr)(unsafe.Pointer(pA)).Fop) != TK_AGG_COLUMN)) && (*(*uintptr)(unsafe.Pointer(pA + 8 /* &.u */)) != 0) {
- if (int32((*Expr)(unsafe.Pointer(pA)).Fop) == TK_FUNCTION) || (int32((*Expr)(unsafe.Pointer(pA)).Fop) == TK_AGG_FUNCTION) {
- if Xsqlite3StrICmp(tls, *(*uintptr)(unsafe.Pointer(pA + 8 /* &.u */)), *(*uintptr)(unsafe.Pointer(pB + 8 /* &.u */))) != 0 {
+
+ if *(*uintptr)(unsafe.Pointer(pA + 8)) != 0 {
+ if int32((*Expr)(unsafe.Pointer(pA)).Fop) == TK_FUNCTION || int32((*Expr)(unsafe.Pointer(pA)).Fop) == TK_AGG_FUNCTION {
+ if Xsqlite3StrICmp(tls, *(*uintptr)(unsafe.Pointer(pA + 8)), *(*uintptr)(unsafe.Pointer(pB + 8))) != 0 {
return 2
}
- if (libc.Bool32(((*Expr)(unsafe.Pointer((pA))).Fflags & (U32(EP_WinFunc))) != U32(0))) != (libc.Bool32(((*Expr)(unsafe.Pointer((pB))).Fflags & (U32(EP_WinFunc))) != U32(0))) {
+ if libc.Bool32((*Expr)(unsafe.Pointer(pA)).Fflags&U32(EP_WinFunc) != U32(0)) != libc.Bool32((*Expr)(unsafe.Pointer(pB)).Fflags&U32(EP_WinFunc) != U32(0)) {
return 2
}
- if ((*Expr)(unsafe.Pointer((pA))).Fflags & (U32(EP_WinFunc))) != U32(0) {
- if Xsqlite3WindowCompare(tls, pParse, *(*uintptr)(unsafe.Pointer(pA + 44 /* &.y */)), *(*uintptr)(unsafe.Pointer(pB + 44 /* &.y */)), 1) != 0 {
+ if (*Expr)(unsafe.Pointer(pA)).Fflags&U32(EP_WinFunc) != U32(0) {
+ if Xsqlite3WindowCompare(tls, pParse, *(*uintptr)(unsafe.Pointer(pA + 44)), *(*uintptr)(unsafe.Pointer(pB + 44)), 1) != 0 {
return 2
}
}
} else if int32((*Expr)(unsafe.Pointer(pA)).Fop) == TK_NULL {
return 0
} else if int32((*Expr)(unsafe.Pointer(pA)).Fop) == TK_COLLATE {
- if Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(pA + 8 /* &.u */)), *(*uintptr)(unsafe.Pointer(pB + 8 /* &.u */))) != 0 {
+ if Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(pA + 8)), *(*uintptr)(unsafe.Pointer(pB + 8))) != 0 {
return 2
}
- } else if (*(*uintptr)(unsafe.Pointer(pB + 8 /* &.u */)) != uintptr(0)) && (libc.Xstrcmp(tls, *(*uintptr)(unsafe.Pointer(pA + 8 /* &.u */)), *(*uintptr)(unsafe.Pointer(pB + 8 /* &.u */))) != 0) {
+ } else if *(*uintptr)(unsafe.Pointer(pB + 8)) != uintptr(0) &&
+ int32((*Expr)(unsafe.Pointer(pA)).Fop) != TK_COLUMN &&
+ int32((*Expr)(unsafe.Pointer(pA)).Fop) != TK_AGG_COLUMN &&
+ libc.Xstrcmp(tls, *(*uintptr)(unsafe.Pointer(pA + 8)), *(*uintptr)(unsafe.Pointer(pB + 8))) != 0 {
return 2
}
}
- if ((*Expr)(unsafe.Pointer(pA)).Fflags & (U32(EP_Distinct | EP_Commuted))) !=
- ((*Expr)(unsafe.Pointer(pB)).Fflags & (U32(EP_Distinct | EP_Commuted))) {
+ if (*Expr)(unsafe.Pointer(pA)).Fflags&U32(EP_Distinct|EP_Commuted) !=
+ (*Expr)(unsafe.Pointer(pB)).Fflags&U32(EP_Distinct|EP_Commuted) {
return 2
}
- if (combinedFlags & U32(EP_TokenOnly)) == U32(0) {
- if (combinedFlags & U32(EP_xIsSelect)) != 0 {
+ if combinedFlags&U32(EP_TokenOnly) == U32(0) {
+ if combinedFlags&U32(EP_xIsSelect) != 0 {
return 2
}
- if ((combinedFlags & U32(EP_FixedCol)) == U32(0)) &&
- (Xsqlite3ExprCompare(tls, pParse, (*Expr)(unsafe.Pointer(pA)).FpLeft, (*Expr)(unsafe.Pointer(pB)).FpLeft, iTab) != 0) {
+ if combinedFlags&U32(EP_FixedCol) == U32(0) &&
+ Xsqlite3ExprCompare(tls, pParse, (*Expr)(unsafe.Pointer(pA)).FpLeft, (*Expr)(unsafe.Pointer(pB)).FpLeft, iTab) != 0 {
return 2
}
if Xsqlite3ExprCompare(tls, pParse, (*Expr)(unsafe.Pointer(pA)).FpRight, (*Expr)(unsafe.Pointer(pB)).FpRight, iTab) != 0 {
return 2
}
- if Xsqlite3ExprListCompare(tls, *(*uintptr)(unsafe.Pointer(pA + 20 /* &.x */)), *(*uintptr)(unsafe.Pointer(pB + 20 /* &.x */)), iTab) != 0 {
+ if Xsqlite3ExprListCompare(tls, *(*uintptr)(unsafe.Pointer(pA + 20)), *(*uintptr)(unsafe.Pointer(pB + 20)), iTab) != 0 {
return 2
}
- if ((int32((*Expr)(unsafe.Pointer(pA)).Fop) != TK_STRING) &&
- (int32((*Expr)(unsafe.Pointer(pA)).Fop) != TK_TRUEFALSE)) &&
- ((combinedFlags & U32(EP_Reduced)) == U32(0)) {
+ if int32((*Expr)(unsafe.Pointer(pA)).Fop) != TK_STRING &&
+ int32((*Expr)(unsafe.Pointer(pA)).Fop) != TK_TRUEFALSE &&
+ combinedFlags&U32(EP_Reduced) == U32(0) {
if int32((*Expr)(unsafe.Pointer(pA)).FiColumn) != int32((*Expr)(unsafe.Pointer(pB)).FiColumn) {
return 2
}
- if (int32((*Expr)(unsafe.Pointer(pA)).Fop2) != int32((*Expr)(unsafe.Pointer(pB)).Fop2)) && (int32((*Expr)(unsafe.Pointer(pA)).Fop) == TK_TRUTH) {
+ if int32((*Expr)(unsafe.Pointer(pA)).Fop2) != int32((*Expr)(unsafe.Pointer(pB)).Fop2) && int32((*Expr)(unsafe.Pointer(pA)).Fop) == TK_TRUTH {
return 2
}
- if ((int32((*Expr)(unsafe.Pointer(pA)).Fop) != TK_IN) && ((*Expr)(unsafe.Pointer(pA)).FiTable != (*Expr)(unsafe.Pointer(pB)).FiTable)) && ((*Expr)(unsafe.Pointer(pA)).FiTable != iTab) {
+ if int32((*Expr)(unsafe.Pointer(pA)).Fop) != TK_IN && (*Expr)(unsafe.Pointer(pA)).FiTable != (*Expr)(unsafe.Pointer(pB)).FiTable && (*Expr)(unsafe.Pointer(pA)).FiTable != iTab {
return 2
}
}
@@ -86594,12 +87701,12 @@ func Xsqlite3ExprCompare(tls *libc.TLS, pParse uintptr, pA uintptr, pB uintptr,
//
// Two NULL pointers are considered to be the same. But a NULL pointer
// always differs from a non-NULL pointer.
-func Xsqlite3ExprListCompare(tls *libc.TLS, pA uintptr, pB uintptr, iTab int32) int32 { /* sqlite3.c:106635:20: */
+func Xsqlite3ExprListCompare(tls *libc.TLS, pA uintptr, pB uintptr, iTab int32) int32 { /* sqlite3.c:107167:20: */
var i int32
- if (pA == uintptr(0)) && (pB == uintptr(0)) {
+ if pA == uintptr(0) && pB == uintptr(0) {
return 0
}
- if (pA == uintptr(0)) || (pB == uintptr(0)) {
+ if pA == uintptr(0) || pB == uintptr(0) {
return 1
}
if (*ExprList)(unsafe.Pointer(pA)).FnExpr != (*ExprList)(unsafe.Pointer(pB)).FnExpr {
@@ -86607,9 +87714,9 @@ func Xsqlite3ExprListCompare(tls *libc.TLS, pA uintptr, pB uintptr, iTab int32)
}
for i = 0; i < (*ExprList)(unsafe.Pointer(pA)).FnExpr; i++ {
var res int32
- var pExprA uintptr = (*ExprList_item)(unsafe.Pointer((pA + 8 /* &.a */) + uintptr(i)*20)).FpExpr
- var pExprB uintptr = (*ExprList_item)(unsafe.Pointer((pB + 8 /* &.a */) + uintptr(i)*20)).FpExpr
- if int32((*ExprList_item)(unsafe.Pointer((pA+8 /* &.a */)+uintptr(i)*20)).FsortFlags) != int32((*ExprList_item)(unsafe.Pointer((pB+8 /* &.a */)+uintptr(i)*20)).FsortFlags) {
+ var pExprA uintptr = (*ExprList_item)(unsafe.Pointer(pA + 8 + uintptr(i)*20)).FpExpr
+ var pExprB uintptr = (*ExprList_item)(unsafe.Pointer(pB + 8 + uintptr(i)*20)).FpExpr
+ if int32((*ExprList_item)(unsafe.Pointer(pA+8+uintptr(i)*20)).FsortFlags) != int32((*ExprList_item)(unsafe.Pointer(pB+8+uintptr(i)*20)).FsortFlags) {
return 1
}
if libc.AssignInt32(&res, Xsqlite3ExprCompare(tls, uintptr(0), pExprA, pExprB, iTab)) != 0 {
@@ -86621,7 +87728,7 @@ func Xsqlite3ExprListCompare(tls *libc.TLS, pA uintptr, pB uintptr, iTab int32)
// Like sqlite3ExprCompare() except COLLATE operators at the top-level
// are ignored.
-func Xsqlite3ExprCompareSkip(tls *libc.TLS, pA uintptr, pB uintptr, iTab int32) int32 { /* sqlite3.c:106654:20: */
+func Xsqlite3ExprCompareSkip(tls *libc.TLS, pA uintptr, pB uintptr, iTab int32) int32 { /* sqlite3.c:107186:20: */
return Xsqlite3ExprCompare(tls, uintptr(0),
Xsqlite3ExprSkipCollateAndLikely(tls, pA),
Xsqlite3ExprSkipCollateAndLikely(tls, pB),
@@ -86632,15 +87739,15 @@ func Xsqlite3ExprCompareSkip(tls *libc.TLS, pA uintptr, pB uintptr, iTab int32)
//
// Or if seenNot is true, return non-zero if Expr p can only be
// non-NULL if pNN is not NULL
-func exprImpliesNotNull(tls *libc.TLS, pParse uintptr, p uintptr, pNN uintptr, iTab int32, seenNot int32) int32 { /* sqlite3.c:106667:12: */
+func exprImpliesNotNull(tls *libc.TLS, pParse uintptr, p uintptr, pNN uintptr, iTab int32, seenNot int32) int32 { /* sqlite3.c:107199:12: */
if Xsqlite3ExprCompare(tls, pParse, p, pNN, iTab) == 0 {
- return (libc.Bool32(int32((*Expr)(unsafe.Pointer(pNN)).Fop) != TK_NULL))
+ return libc.Bool32(int32((*Expr)(unsafe.Pointer(pNN)).Fop) != TK_NULL)
}
switch int32((*Expr)(unsafe.Pointer(p)).Fop) {
case TK_IN:
{
- if (seenNot != 0) && (((*Expr)(unsafe.Pointer((p))).Fflags & (U32(EP_xIsSelect))) != U32(0)) {
+ if seenNot != 0 && (*Expr)(unsafe.Pointer(p)).Fflags&U32(EP_xIsSelect) != U32(0) {
return 0
}
@@ -86649,13 +87756,15 @@ func exprImpliesNotNull(tls *libc.TLS, pParse uintptr, p uintptr, pNN uintptr, i
}
case TK_BETWEEN:
{
- var pList uintptr = *(*uintptr)(unsafe.Pointer(p + 20 /* &.x */))
+ var pList uintptr
+
+ pList = *(*uintptr)(unsafe.Pointer(p + 20))
if seenNot != 0 {
return 0
}
- if (exprImpliesNotNull(tls, pParse, (*ExprList_item)(unsafe.Pointer((pList+8 /* &.a */))).FpExpr, pNN, iTab, 1) != 0) ||
- (exprImpliesNotNull(tls, pParse, (*ExprList_item)(unsafe.Pointer((pList+8 /* &.a */)+1*20)).FpExpr, pNN, iTab, 1) != 0) {
+ if exprImpliesNotNull(tls, pParse, (*ExprList_item)(unsafe.Pointer(pList+8)).FpExpr, pNN, iTab, 1) != 0 ||
+ exprImpliesNotNull(tls, pParse, (*ExprList_item)(unsafe.Pointer(pList+8+1*20)).FpExpr, pNN, iTab, 1) != 0 {
return 1
}
return exprImpliesNotNull(tls, pParse, (*Expr)(unsafe.Pointer(p)).FpLeft, pNN, iTab, 1)
@@ -86756,17 +87865,17 @@ func exprImpliesNotNull(tls *libc.TLS, pParse uintptr, p uintptr, pNN uintptr, i
// When in doubt, return false. Returning true might give a performance
// improvement. Returning false might cause a performance reduction, but
// it will always give the correct answer and is hence always safe.
-func Xsqlite3ExprImpliesExpr(tls *libc.TLS, pParse uintptr, pE1 uintptr, pE2 uintptr, iTab int32) int32 { /* sqlite3.c:106763:20: */
+func Xsqlite3ExprImpliesExpr(tls *libc.TLS, pParse uintptr, pE1 uintptr, pE2 uintptr, iTab int32) int32 { /* sqlite3.c:107296:20: */
if Xsqlite3ExprCompare(tls, pParse, pE1, pE2, iTab) == 0 {
return 1
}
- if (int32((*Expr)(unsafe.Pointer(pE2)).Fop) == TK_OR) &&
- ((Xsqlite3ExprImpliesExpr(tls, pParse, pE1, (*Expr)(unsafe.Pointer(pE2)).FpLeft, iTab) != 0) ||
- (Xsqlite3ExprImpliesExpr(tls, pParse, pE1, (*Expr)(unsafe.Pointer(pE2)).FpRight, iTab) != 0)) {
+ if int32((*Expr)(unsafe.Pointer(pE2)).Fop) == TK_OR &&
+ (Xsqlite3ExprImpliesExpr(tls, pParse, pE1, (*Expr)(unsafe.Pointer(pE2)).FpLeft, iTab) != 0 ||
+ Xsqlite3ExprImpliesExpr(tls, pParse, pE1, (*Expr)(unsafe.Pointer(pE2)).FpRight, iTab) != 0) {
return 1
}
- if (int32((*Expr)(unsafe.Pointer(pE2)).Fop) == TK_NOTNULL) &&
- (exprImpliesNotNull(tls, pParse, pE1, (*Expr)(unsafe.Pointer(pE2)).FpLeft, iTab, 0) != 0) {
+ if int32((*Expr)(unsafe.Pointer(pE2)).Fop) == TK_NOTNULL &&
+ exprImpliesNotNull(tls, pParse, pE1, (*Expr)(unsafe.Pointer(pE2)).FpLeft, iTab, 0) != 0 {
return 1
}
return 0
@@ -86779,9 +87888,9 @@ func Xsqlite3ExprImpliesExpr(tls *libc.TLS, pParse uintptr, pE1 uintptr, pE2 uin
// This routine controls an optimization. False positives (setting
// pWalker->eCode to 1 when it should not be) are deadly, but false-negatives
// (never setting pWalker->eCode) is a harmless missed optimization.
-func impliesNotNullRow(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 { /* sqlite3.c:106790:12: */
+func impliesNotNullRow(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 { /* sqlite3.c:107328:12: */
- if ((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_FromJoin))) != U32(0) {
+ if (*Expr)(unsafe.Pointer(pExpr)).Fflags&U32(EP_FromJoin) != U32(0) {
return WRC_Prune
}
switch int32((*Expr)(unsafe.Pointer(pExpr)).Fop) {
@@ -86807,7 +87916,7 @@ func impliesNotNullRow(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 { /*
return WRC_Prune
case TK_COLUMN:
- if *(*int32)(unsafe.Pointer(pWalker + 24 /* &.u */)) == (*Expr)(unsafe.Pointer(pExpr)).FiTable {
+ if *(*int32)(unsafe.Pointer(pWalker + 24)) == (*Expr)(unsafe.Pointer(pExpr)).FiTable {
(*Walker)(unsafe.Pointer(pWalker)).FeCode = U16(1)
return WRC_Abort
}
@@ -86850,10 +87959,13 @@ func impliesNotNullRow(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 { /*
// The y.pTab=0 assignment in wherecode.c always happens after the
// impliesNotNullRow() test
- if (((int32((*Expr)(unsafe.Pointer(pLeft)).Fop) == TK_COLUMN) && (*(*uintptr)(unsafe.Pointer(pLeft + 44 /* &.y */)) != uintptr(0))) &&
- ((*Table)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pLeft + 44 /* &.y */)))).FnModuleArg != 0)) ||
- (((int32((*Expr)(unsafe.Pointer(pRight)).Fop) == TK_COLUMN) && (*(*uintptr)(unsafe.Pointer(pRight + 44 /* &.y */)) != uintptr(0))) &&
- ((*Table)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pRight + 44 /* &.y */)))).FnModuleArg != 0)) {
+
+ if int32((*Expr)(unsafe.Pointer(pLeft)).Fop) == TK_COLUMN &&
+ *(*uintptr)(unsafe.Pointer(pLeft + 44)) != uintptr(0) &&
+ int32((*Table)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pLeft + 44)))).FeTabType) == TABTYP_VTAB ||
+ int32((*Expr)(unsafe.Pointer(pRight)).Fop) == TK_COLUMN &&
+ *(*uintptr)(unsafe.Pointer(pRight + 44)) != uintptr(0) &&
+ int32((*Table)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pRight + 44)))).FeTabType) == TABTYP_VTAB {
return WRC_Prune
}
@@ -86885,7 +87997,7 @@ func impliesNotNullRow(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 { /*
// clause requires that some column of the right table of the LEFT JOIN
// be non-NULL, then the LEFT JOIN can be safely converted into an
// ordinary join.
-func Xsqlite3ExprImpliesNonNullRow(tls *libc.TLS, p uintptr, iTab int32) int32 { /* sqlite3.c:106895:20: */
+func Xsqlite3ExprImpliesNonNullRow(tls *libc.TLS, p uintptr, iTab int32) int32 { /* sqlite3.c:107437:20: */
bp := tls.Alloc(28)
defer tls.Free(28)
@@ -86911,7 +88023,7 @@ func Xsqlite3ExprImpliesNonNullRow(tls *libc.TLS, p uintptr, iTab int32) int32 {
(*Walker)(unsafe.Pointer(bp /* &w */)).FxSelectCallback = uintptr(0)
(*Walker)(unsafe.Pointer(bp /* &w */)).FxSelectCallback2 = uintptr(0)
(*Walker)(unsafe.Pointer(bp /* &w */)).FeCode = U16(0)
- *(*int32)(unsafe.Pointer(bp /* &w */ + 24 /* &.u */)) = iTab
+ *(*int32)(unsafe.Pointer(bp + 24)) = iTab
Xsqlite3WalkExpr(tls, bp /* &w */, p)
return int32((*Walker)(unsafe.Pointer(bp /* &w */)).FeCode)
}
@@ -86919,10 +88031,10 @@ func Xsqlite3ExprImpliesNonNullRow(tls *libc.TLS, p uintptr, iTab int32) int32 {
// Check to see if there are references to columns in table
// pWalker->u.pIdxCover->iCur can be satisfied using the index
// pWalker->u.pIdxCover->pIdx.
-func exprIdxCover(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 { /* sqlite3.c:106933:12: */
- if ((int32((*Expr)(unsafe.Pointer(pExpr)).Fop) == TK_COLUMN) &&
- ((*Expr)(unsafe.Pointer(pExpr)).FiTable == (*IdxCover)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pWalker + 24 /* &.u */)))).FiCur)) &&
- (int32(Xsqlite3TableColumnToIndex(tls, (*IdxCover)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pWalker + 24 /* &.u */)))).FpIdx, (*Expr)(unsafe.Pointer(pExpr)).FiColumn)) < 0) {
+func exprIdxCover(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 { /* sqlite3.c:107475:12: */
+ if int32((*Expr)(unsafe.Pointer(pExpr)).Fop) == TK_COLUMN &&
+ (*Expr)(unsafe.Pointer(pExpr)).FiTable == (*IdxCover)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pWalker + 24)))).FiCur &&
+ int32(Xsqlite3TableColumnToIndex(tls, (*IdxCover)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pWalker + 24)))).FpIdx, (*Expr)(unsafe.Pointer(pExpr)).FiColumn)) < 0 {
(*Walker)(unsafe.Pointer(pWalker)).FeCode = U16(1)
return WRC_Abort
}
@@ -86937,7 +88049,7 @@ func exprIdxCover(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 { /* sqli
// An index covering an expression means that the expression can be
// evaluated using only the index and without having to lookup the
// corresponding table entry.
-func Xsqlite3ExprCoveredByIndex(tls *libc.TLS, pExpr uintptr, iCur int32, pIdx uintptr) int32 { /* sqlite3.c:106954:20: */
+func Xsqlite3ExprCoveredByIndex(tls *libc.TLS, pExpr uintptr, iCur int32, pIdx uintptr) int32 { /* sqlite3.c:107496:20: */
bp := tls.Alloc(36)
defer tls.Free(36)
@@ -86951,35 +88063,77 @@ func Xsqlite3ExprCoveredByIndex(tls *libc.TLS, pExpr uintptr, iCur int32, pIdx u
(*Walker)(unsafe.Pointer(bp /* &w */)).FxExprCallback = *(*uintptr)(unsafe.Pointer(&struct {
f func(*libc.TLS, uintptr, uintptr) int32
}{exprIdxCover}))
- *(*uintptr)(unsafe.Pointer(bp /* &w */ + 24 /* &.u */)) = bp + 28 /* &xcov */
+ *(*uintptr)(unsafe.Pointer(bp + 24)) = bp + 28 /* &xcov */
Xsqlite3WalkExpr(tls, bp /* &w */, pExpr)
- return libc.BoolInt32(!((*Walker)(unsafe.Pointer(bp /* &w */)).FeCode != 0))
+ return libc.BoolInt32(!((*Walker)(unsafe.Pointer(bp)).FeCode != 0))
}
-// xSelect callback for sqlite3FunctionUsesThisSrc(). If this is the first
-// SELECT with a FROM clause encountered during this iteration, set
-// SrcCount.iSrcInner to the cursor number of the leftmost object in
-// the FROM cause.
-func selectSrcCount(tls *libc.TLS, pWalker uintptr, pSel uintptr) int32 { /* sqlite3.c:106990:12: */
- var p uintptr = *(*uintptr)(unsafe.Pointer(pWalker + 24 /* &.u */))
- if (((*SrcCount)(unsafe.Pointer(p)).FiSrcInner == 0x7FFFFFFF) && ((*Select)(unsafe.Pointer(pSel)).FpSrc != 0)) && ((*SrcList)(unsafe.Pointer((*Select)(unsafe.Pointer(pSel)).FpSrc)).FnSrc != 0) {
- (*SrcCount)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pWalker + 24 /* &.u */)))).FiSrcInner = (*SrcItem)(unsafe.Pointer(((*Select)(unsafe.Pointer(pSel)).FpSrc + 8 /* &.a */))).FiCursor
+// Walker SELECT callbacks for sqlite3ReferencesSrcList().
+//
+// When entering a new subquery on the pExpr argument, add all FROM clause
+// entries for that subquery to the exclude list.
+//
+// When leaving the subquery, remove those entries from the exclude list.
+func selectRefEnter(tls *libc.TLS, pWalker uintptr, pSelect uintptr) int32 { /* sqlite3.c:107531:12: */
+ var p uintptr = *(*uintptr)(unsafe.Pointer(pWalker + 24))
+ var pSrc uintptr = (*Select)(unsafe.Pointer(pSelect)).FpSrc
+ var i I64
+ var j I64
+ var piNew uintptr
+ if (*SrcList)(unsafe.Pointer(pSrc)).FnSrc == 0 {
+ return WRC_Continue
+ }
+ j = (*RefSrcList)(unsafe.Pointer(p)).FnExclude
+ *(*I64)(unsafe.Pointer(p + 8)) += I64((*SrcList)(unsafe.Pointer(pSrc)).FnSrc)
+ piNew = Xsqlite3DbRealloc(tls, (*RefSrcList)(unsafe.Pointer(p)).Fdb, (*RefSrcList)(unsafe.Pointer(p)).FaiExclude, uint64((*RefSrcList)(unsafe.Pointer(p)).FnExclude*I64(unsafe.Sizeof(int32(0)))))
+ if piNew == uintptr(0) {
+ (*RefSrcList)(unsafe.Pointer(p)).FnExclude = int64(0)
+ return WRC_Abort
+ } else {
+ (*RefSrcList)(unsafe.Pointer(p)).FaiExclude = piNew
+ }
+ i = int64(0)
+__1:
+ if !(i < I64((*SrcList)(unsafe.Pointer(pSrc)).FnSrc)) {
+ goto __3
+ }
+ {
+ *(*int32)(unsafe.Pointer((*RefSrcList)(unsafe.Pointer(p)).FaiExclude + uintptr(j)*4)) = (*SrcItem)(unsafe.Pointer(pSrc + 8 + uintptr(i)*72)).FiCursor
+
}
+ goto __2
+__2:
+ i++
+ j++
+ goto __1
+ goto __3
+__3:
+ ;
return WRC_Continue
}
-// Count the number of references to columns.
-func exprSrcCount(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 { /* sqlite3.c:107001:12: */
- // There was once a NEVER() on the second term on the grounds that
- // sqlite3FunctionUsesThisSrc() was always called before
- // sqlite3ExprAnalyzeAggregates() and so the TK_COLUMNs have not yet
- // been converted into TK_AGG_COLUMN. But this is no longer true due
- // to window functions - sqlite3WindowRewrite() may now indirectly call
- // FunctionUsesThisSrc() when creating a new sub-select.
- if (int32((*Expr)(unsafe.Pointer(pExpr)).Fop) == TK_COLUMN) || (int32((*Expr)(unsafe.Pointer(pExpr)).Fop) == TK_AGG_COLUMN) {
+func selectRefLeave(tls *libc.TLS, pWalker uintptr, pSelect uintptr) { /* sqlite3.c:107551:13: */
+ var p uintptr = *(*uintptr)(unsafe.Pointer(pWalker + 24))
+ var pSrc uintptr = (*Select)(unsafe.Pointer(pSelect)).FpSrc
+ if (*RefSrcList)(unsafe.Pointer(p)).FnExclude != 0 {
+
+ *(*I64)(unsafe.Pointer(p + 8)) -= I64((*SrcList)(unsafe.Pointer(pSrc)).FnSrc)
+ }
+}
+
+// This is the Walker EXPR callback for sqlite3ReferencesSrcList().
+//
+// Set the 0x01 bit of pWalker->eCode if there is a reference to any
+// of the tables shown in RefSrcList.pRef.
+//
+// Set the 0x02 bit of pWalker->eCode if there is a reference to a
+// table is in neither RefSrcList.pRef nor RefSrcList.aiExclude.
+func exprRefToSrcList(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 { /* sqlite3.c:107568:12: */
+ if int32((*Expr)(unsafe.Pointer(pExpr)).Fop) == TK_COLUMN ||
+ int32((*Expr)(unsafe.Pointer(pExpr)).Fop) == TK_AGG_COLUMN {
var i int32
- var p uintptr = *(*uintptr)(unsafe.Pointer(pWalker + 24 /* &.u */))
- var pSrc uintptr = (*SrcCount)(unsafe.Pointer(p)).FpSrc
+ var p uintptr = *(*uintptr)(unsafe.Pointer(pWalker + 24))
+ var pSrc uintptr = (*RefSrcList)(unsafe.Pointer(p)).FpRef
var nSrc int32
if pSrc != 0 {
nSrc = (*SrcList)(unsafe.Pointer(pSrc)).FnSrc
@@ -86987,56 +88141,69 @@ func exprSrcCount(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 { /* sqli
nSrc = 0
}
for i = 0; i < nSrc; i++ {
- if (*Expr)(unsafe.Pointer(pExpr)).FiTable == (*SrcItem)(unsafe.Pointer((pSrc+8 /* &.a */)+uintptr(i)*72)).FiCursor {
- break
+ if (*Expr)(unsafe.Pointer(pExpr)).FiTable == (*SrcItem)(unsafe.Pointer(pSrc+8+uintptr(i)*72)).FiCursor {
+ *(*U16)(unsafe.Pointer(pWalker + 20)) |= U16(1)
+ return WRC_Continue
}
}
- if i < nSrc {
- (*SrcCount)(unsafe.Pointer(p)).FnThis++
- } else if (*Expr)(unsafe.Pointer(pExpr)).FiTable < (*SrcCount)(unsafe.Pointer(p)).FiSrcInner {
- // In a well-formed parse tree (no name resolution errors),
- // TK_COLUMN nodes with smaller Expr.iTable values are in an
- // outer context. Those are the only ones to count as "other"
- (*SrcCount)(unsafe.Pointer(p)).FnOther++
+ for i = 0; I64(i) < (*RefSrcList)(unsafe.Pointer(p)).FnExclude && *(*int32)(unsafe.Pointer((*RefSrcList)(unsafe.Pointer(p)).FaiExclude + uintptr(i)*4)) != (*Expr)(unsafe.Pointer(pExpr)).FiTable; i++ {
+ }
+ if I64(i) >= (*RefSrcList)(unsafe.Pointer(p)).FnExclude {
+ *(*U16)(unsafe.Pointer(pWalker + 20)) |= U16(2)
}
}
return WRC_Continue
}
-// Determine if any of the arguments to the pExpr Function reference
-// pSrcList. Return true if they do. Also return true if the function
-// has no arguments or has only constant arguments. Return false if pExpr
-// references columns but not columns of tables found in pSrcList.
-func Xsqlite3FunctionUsesThisSrc(tls *libc.TLS, pExpr uintptr, pSrcList uintptr) int32 { /* sqlite3.c:107034:20: */
- bp := tls.Alloc(44)
- defer tls.Free(44)
+// Check to see if pExpr references any tables in pSrcList.
+// Possible return values:
+//
+// 1 pExpr does references a table in pSrcList.
+//
+// 0 pExpr references some table that is not defined in either
+// pSrcList or in subqueries of pExpr itself.
+//
+// -1 pExpr only references no tables at all, or it only
+// references tables defined in subqueries of pExpr itself.
+//
+// As currently used, pExpr is always an aggregate function call. That
+// fact is exploited for efficiency.
+func Xsqlite3ReferencesSrcList(tls *libc.TLS, pParse uintptr, pExpr uintptr, pSrcList uintptr) int32 { /* sqlite3.c:107605:20: */
+ bp := tls.Alloc(56)
+ defer tls.Free(56)
// var w Walker at bp, 28
- // var cnt SrcCount at bp+28, 16
+ // var x RefSrcList at bp+32, 24
libc.Xmemset(tls, bp /* &w */, 0, uint32(unsafe.Sizeof(Walker{})))
+ libc.Xmemset(tls, bp+32 /* &x */, 0, uint32(unsafe.Sizeof(RefSrcList{})))
(*Walker)(unsafe.Pointer(bp /* &w */)).FxExprCallback = *(*uintptr)(unsafe.Pointer(&struct {
f func(*libc.TLS, uintptr, uintptr) int32
- }{exprSrcCount}))
+ }{exprRefToSrcList}))
(*Walker)(unsafe.Pointer(bp /* &w */)).FxSelectCallback = *(*uintptr)(unsafe.Pointer(&struct {
f func(*libc.TLS, uintptr, uintptr) int32
- }{selectSrcCount}))
- *(*uintptr)(unsafe.Pointer(bp /* &w */ + 24 /* &.u */)) = bp + 28 /* &cnt */
- (*SrcCount)(unsafe.Pointer(bp + 28 /* &cnt */)).FpSrc = pSrcList
- (*SrcCount)(unsafe.Pointer(bp + 28 /* &cnt */)).FiSrcInner = func() int32 {
- if (pSrcList != 0) && ((*SrcList)(unsafe.Pointer(pSrcList)).FnSrc != 0) {
- return (*SrcItem)(unsafe.Pointer((pSrcList + 8 /* &.a */))).FiCursor
- }
- return 0x7FFFFFFF
- }()
- (*SrcCount)(unsafe.Pointer(bp + 28 /* &cnt */)).FnThis = 0
- (*SrcCount)(unsafe.Pointer(bp + 28 /* &cnt */)).FnOther = 0
- Xsqlite3WalkExprList(tls, bp /* &w */, *(*uintptr)(unsafe.Pointer(pExpr + 20 /* &.x */)))
- if ((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_WinFunc))) != U32(0) {
- Xsqlite3WalkExpr(tls, bp /* &w */, (*Window)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pExpr + 44 /* &.y */)))).FpFilter)
+ }{selectRefEnter}))
+ (*Walker)(unsafe.Pointer(bp /* &w */)).FxSelectCallback2 = *(*uintptr)(unsafe.Pointer(&struct {
+ f func(*libc.TLS, uintptr, uintptr)
+ }{selectRefLeave}))
+ *(*uintptr)(unsafe.Pointer(bp + 24)) = bp + 32 /* &x */
+ (*RefSrcList)(unsafe.Pointer(bp + 32 /* &x */)).Fdb = (*Parse)(unsafe.Pointer(pParse)).Fdb
+ (*RefSrcList)(unsafe.Pointer(bp + 32 /* &x */)).FpRef = pSrcList
+
+ Xsqlite3WalkExprList(tls, bp /* &w */, *(*uintptr)(unsafe.Pointer(pExpr + 20)))
+ if (*Expr)(unsafe.Pointer(pExpr)).Fflags&U32(EP_WinFunc) != U32(0) {
+ Xsqlite3WalkExpr(tls, bp /* &w */, (*Window)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pExpr + 44)))).FpFilter)
+ }
+ Xsqlite3DbFree(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, (*RefSrcList)(unsafe.Pointer(bp+32 /* &x */)).FaiExclude)
+ if int32((*Walker)(unsafe.Pointer(bp)).FeCode)&0x01 != 0 {
+ return 1
+ } else if (*Walker)(unsafe.Pointer(bp)).FeCode != 0 {
+ return 0
+ } else {
+ return -1
}
- return (libc.Bool32(((*SrcCount)(unsafe.Pointer(bp+28 /* &cnt */)).FnThis > 0) || ((*SrcCount)(unsafe.Pointer(bp+28 /* &cnt */)).FnOther == 0)))
+ return int32(0)
}
// This is a Walker expression node callback.
@@ -87050,9 +88217,9 @@ func Xsqlite3FunctionUsesThisSrc(tls *libc.TLS, pExpr uintptr, pSrcList uintptr)
// This will cause the expression to be deleted automatically when the
// Parse object is destroyed, but the zero register number means that it
// will not generate any code in the preamble.
-func agginfoPersistExprCb(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 { /* sqlite3.c:107068:12: */
- if (!(((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_TokenOnly | EP_Reduced))) != U32(0))) &&
- ((*Expr)(unsafe.Pointer(pExpr)).FpAggInfo != uintptr(0)) {
+func agginfoPersistExprCb(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 { /* sqlite3.c:107647:12: */
+ if !((*Expr)(unsafe.Pointer(pExpr)).Fflags&U32(EP_TokenOnly|EP_Reduced) != U32(0)) &&
+ (*Expr)(unsafe.Pointer(pExpr)).FpAggInfo != uintptr(0) {
var pAggInfo uintptr = (*Expr)(unsafe.Pointer(pExpr)).FpAggInfo
var iAgg int32 = int32((*Expr)(unsafe.Pointer(pExpr)).FiAgg)
var pParse uintptr = (*Walker)(unsafe.Pointer(pWalker)).FpParse
@@ -87083,7 +88250,7 @@ func agginfoPersistExprCb(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 {
// Initialize a Walker object so that will persist AggInfo entries referenced
// by the tree that is walked.
-func Xsqlite3AggInfoPersistWalkerInit(tls *libc.TLS, pWalker uintptr, pParse uintptr) { /* sqlite3.c:107104:21: */
+func Xsqlite3AggInfoPersistWalkerInit(tls *libc.TLS, pWalker uintptr, pParse uintptr) { /* sqlite3.c:107683:21: */
libc.Xmemset(tls, pWalker, 0, uint32(unsafe.Sizeof(Walker{})))
(*Walker)(unsafe.Pointer(pWalker)).FpParse = pParse
(*Walker)(unsafe.Pointer(pWalker)).FxExprCallback = *(*uintptr)(unsafe.Pointer(&struct {
@@ -87096,7 +88263,7 @@ func Xsqlite3AggInfoPersistWalkerInit(tls *libc.TLS, pWalker uintptr, pParse uin
// Add a new element to the pAggInfo->aCol[] array. Return the index of
// the new element. Return a negative number if malloc fails.
-func addAggInfoColumn(tls *libc.TLS, db uintptr, pInfo uintptr) int32 { /* sqlite3.c:107115:12: */
+func addAggInfoColumn(tls *libc.TLS, db uintptr, pInfo uintptr) int32 { /* sqlite3.c:107694:12: */
bp := tls.Alloc(4)
defer tls.Free(4)
@@ -87106,14 +88273,14 @@ func addAggInfoColumn(tls *libc.TLS, db uintptr, pInfo uintptr) int32 { /* sqlit
db,
(*AggInfo)(unsafe.Pointer(pInfo)).FaCol,
int32(unsafe.Sizeof(AggInfo_col{})),
- (pInfo + 32 /* &.nColumn */),
+ pInfo+32,
bp /* &i */)
return *(*int32)(unsafe.Pointer(bp /* i */))
}
// Add a new element to the pAggInfo->aFunc[] array. Return the index of
// the new element. Return a negative number if malloc fails.
-func addAggInfoFunc(tls *libc.TLS, db uintptr, pInfo uintptr) int32 { /* sqlite3.c:107131:12: */
+func addAggInfoFunc(tls *libc.TLS, db uintptr, pInfo uintptr) int32 { /* sqlite3.c:107710:12: */
bp := tls.Alloc(4)
defer tls.Free(4)
@@ -87123,7 +88290,7 @@ func addAggInfoFunc(tls *libc.TLS, db uintptr, pInfo uintptr) int32 { /* sqlite3
db,
(*AggInfo)(unsafe.Pointer(pInfo)).FaFunc,
int32(unsafe.Sizeof(AggInfo_func{})),
- (pInfo + 44 /* &.nFunc */),
+ pInfo+44,
bp /* &i */)
return *(*int32)(unsafe.Pointer(bp /* i */))
}
@@ -87131,12 +88298,12 @@ func addAggInfoFunc(tls *libc.TLS, db uintptr, pInfo uintptr) int32 { /* sqlite3
// This is the xExprCallback for a tree walker. It is used to
// implement sqlite3ExprAnalyzeAggregates(). See sqlite3ExprAnalyzeAggregates
// for additional information.
-func analyzeAggregate(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 { /* sqlite3.c:107148:12: */
+func analyzeAggregate(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 { /* sqlite3.c:107727:12: */
var i int32
- var pNC uintptr = *(*uintptr)(unsafe.Pointer(pWalker + 24 /* &.u */))
+ var pNC uintptr = *(*uintptr)(unsafe.Pointer(pWalker + 24))
var pParse uintptr = (*NameContext)(unsafe.Pointer(pNC)).FpParse
var pSrcList uintptr = (*NameContext)(unsafe.Pointer(pNC)).FpSrcList
- var pAggInfo uintptr = *(*uintptr)(unsafe.Pointer(pNC + 8 /* &.uNC */))
+ var pAggInfo uintptr = *(*uintptr)(unsafe.Pointer(pNC + 8))
switch int32((*Expr)(unsafe.Pointer(pExpr)).Fop) {
case TK_AGG_COLUMN:
@@ -87170,7 +88337,7 @@ func analyzeAggregate(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 { /*
goto __6
}
{
- if ((*AggInfo_col)(unsafe.Pointer(pCol)).FiTable == (*Expr)(unsafe.Pointer(pExpr)).FiTable) && (int32((*AggInfo_col)(unsafe.Pointer(pCol)).FiColumn) == int32((*Expr)(unsafe.Pointer(pExpr)).FiColumn)) {
+ if (*AggInfo_col)(unsafe.Pointer(pCol)).FiTable == (*Expr)(unsafe.Pointer(pExpr)).FiTable && int32((*AggInfo_col)(unsafe.Pointer(pCol)).FiColumn) == int32((*Expr)(unsafe.Pointer(pExpr)).FiColumn) {
goto __6
}
@@ -87183,10 +88350,11 @@ func analyzeAggregate(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 { /*
goto __6
__6:
;
- if (k >= (*AggInfo)(unsafe.Pointer(pAggInfo)).FnColumn) &&
- ((libc.AssignInt32(&k, addAggInfoColumn(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, pAggInfo))) >= 0) {
- pCol = ((*AggInfo)(unsafe.Pointer(pAggInfo)).FaCol + uintptr(k)*20)
- (*AggInfo_col)(unsafe.Pointer(pCol)).FpTab = *(*uintptr)(unsafe.Pointer(pExpr + 44 /* &.y */))
+ if k >= (*AggInfo)(unsafe.Pointer(pAggInfo)).FnColumn &&
+ libc.AssignInt32(&k, addAggInfoColumn(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, pAggInfo)) >= 0 {
+ pCol = (*AggInfo)(unsafe.Pointer(pAggInfo)).FaCol + uintptr(k)*20
+
+ (*AggInfo_col)(unsafe.Pointer(pCol)).FpTab = *(*uintptr)(unsafe.Pointer(pExpr + 44))
(*AggInfo_col)(unsafe.Pointer(pCol)).FiTable = (*Expr)(unsafe.Pointer(pExpr)).FiTable
(*AggInfo_col)(unsafe.Pointer(pCol)).FiColumn = (*Expr)(unsafe.Pointer(pExpr)).FiColumn
(*AggInfo_col)(unsafe.Pointer(pCol)).FiMem = libc.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1)
@@ -87205,7 +88373,7 @@ func analyzeAggregate(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 { /*
}
{
var pE uintptr = (*ExprList_item)(unsafe.Pointer(pTerm)).FpExpr
- if ((int32((*Expr)(unsafe.Pointer(pE)).Fop) == TK_COLUMN) && ((*Expr)(unsafe.Pointer(pE)).FiTable == (*Expr)(unsafe.Pointer(pExpr)).FiTable)) && (int32((*Expr)(unsafe.Pointer(pE)).FiColumn) == int32((*Expr)(unsafe.Pointer(pExpr)).FiColumn)) {
+ if int32((*Expr)(unsafe.Pointer(pE)).Fop) == TK_COLUMN && (*Expr)(unsafe.Pointer(pE)).FiTable == (*Expr)(unsafe.Pointer(pExpr)).FiTable && int32((*Expr)(unsafe.Pointer(pE)).FiColumn) == int32((*Expr)(unsafe.Pointer(pExpr)).FiColumn) {
(*AggInfo_col)(unsafe.Pointer(pCol)).FiSorterColumn = I16(j)
goto __9
}
@@ -87248,8 +88416,8 @@ func analyzeAggregate(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 { /*
}
case TK_AGG_FUNCTION:
{
- if (((*NameContext)(unsafe.Pointer(pNC)).FncFlags & NC_InAggFunc) == 0) &&
- ((*Walker)(unsafe.Pointer(pWalker)).FwalkerDepth == int32((*Expr)(unsafe.Pointer(pExpr)).Fop2)) {
+ if (*NameContext)(unsafe.Pointer(pNC)).FncFlags&NC_InAggFunc == 0 &&
+ (*Walker)(unsafe.Pointer(pWalker)).FwalkerDepth == int32((*Expr)(unsafe.Pointer(pExpr)).Fop2) {
// Check to see if pExpr is a duplicate of another aggregate
// function that is already in the pAggInfo structure
var pItem uintptr = (*AggInfo)(unsafe.Pointer(pAggInfo)).FaFunc
@@ -87281,19 +88449,19 @@ func analyzeAggregate(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 { /*
i = addAggInfoFunc(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, pAggInfo)
if i >= 0 {
- pItem = ((*AggInfo)(unsafe.Pointer(pAggInfo)).FaFunc + uintptr(i)*20)
+ pItem = (*AggInfo)(unsafe.Pointer(pAggInfo)).FaFunc + uintptr(i)*20
(*AggInfo_func)(unsafe.Pointer(pItem)).FpFExpr = pExpr
(*AggInfo_func)(unsafe.Pointer(pItem)).FiMem = libc.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1)
(*AggInfo_func)(unsafe.Pointer(pItem)).FpFunc = Xsqlite3FindFunction(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb,
- *(*uintptr)(unsafe.Pointer(pExpr + 8 /* &.u */)),
+ *(*uintptr)(unsafe.Pointer(pExpr + 8)),
func() int32 {
- if *(*uintptr)(unsafe.Pointer(pExpr + 20 /* &.x */)) != 0 {
- return (*ExprList)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pExpr + 20 /* &.x */)))).FnExpr
+ if *(*uintptr)(unsafe.Pointer(pExpr + 20)) != 0 {
+ return (*ExprList)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pExpr + 20)))).FnExpr
}
return 0
}(), enc, uint8(0))
- if ((*Expr)(unsafe.Pointer(pExpr)).Fflags & U32(EP_Distinct)) != 0 {
+ if (*Expr)(unsafe.Pointer(pExpr)).Fflags&U32(EP_Distinct) != 0 {
(*AggInfo_func)(unsafe.Pointer(pItem)).FiDistinct = libc.PostIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnTab, 1)
} else {
(*AggInfo_func)(unsafe.Pointer(pItem)).FiDistinct = -1
@@ -87321,7 +88489,7 @@ func analyzeAggregate(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 { /*
//
// This routine should only be called after the expression has been
// analyzed by sqlite3ResolveExprNames().
-func Xsqlite3ExprAnalyzeAggregates(tls *libc.TLS, pNC uintptr, pExpr uintptr) { /* sqlite3.c:107285:21: */
+func Xsqlite3ExprAnalyzeAggregates(tls *libc.TLS, pNC uintptr, pExpr uintptr) { /* sqlite3.c:107865:21: */
bp := tls.Alloc(28)
defer tls.Free(28)
@@ -87337,7 +88505,7 @@ func Xsqlite3ExprAnalyzeAggregates(tls *libc.TLS, pNC uintptr, pExpr uintptr) {
f func(*libc.TLS, uintptr, uintptr)
}{Xsqlite3WalkerDepthDecrease}))
(*Walker)(unsafe.Pointer(bp /* &w */)).FwalkerDepth = 0
- *(*uintptr)(unsafe.Pointer(bp /* &w */ + 24 /* &.u */)) = pNC
+ *(*uintptr)(unsafe.Pointer(bp + 24)) = pNC
(*Walker)(unsafe.Pointer(bp /* &w */)).FpParse = uintptr(0)
Xsqlite3WalkExpr(tls, bp /* &w */, pExpr)
@@ -87347,7 +88515,7 @@ func Xsqlite3ExprAnalyzeAggregates(tls *libc.TLS, pNC uintptr, pExpr uintptr) {
// expression list. Return the number of errors.
//
// If an error is found, the analysis is cut short.
-func Xsqlite3ExprAnalyzeAggList(tls *libc.TLS, pNC uintptr, pList uintptr) { /* sqlite3.c:107303:21: */
+func Xsqlite3ExprAnalyzeAggList(tls *libc.TLS, pNC uintptr, pList uintptr) { /* sqlite3.c:107883:21: */
var pItem uintptr
var i int32
if pList != 0 {
@@ -87372,26 +88540,26 @@ func Xsqlite3ExprAnalyzeAggList(tls *libc.TLS, pNC uintptr, pList uintptr) { /*
}
// Allocate a single new register for use to hold some intermediate result.
-func Xsqlite3GetTempReg(tls *libc.TLS, pParse uintptr) int32 { /* sqlite3.c:107316:20: */
+func Xsqlite3GetTempReg(tls *libc.TLS, pParse uintptr) int32 { /* sqlite3.c:107896:20: */
if int32((*Parse)(unsafe.Pointer(pParse)).FnTempReg) == 0 {
return libc.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1)
}
- return *(*int32)(unsafe.Pointer((pParse + 148 /* &.aTempReg */) + uintptr(libc.PreDecUint8(&(*Parse)(unsafe.Pointer(pParse)).FnTempReg, 1))*4))
+ return *(*int32)(unsafe.Pointer(pParse + 144 + uintptr(libc.PreDecUint8(&(*Parse)(unsafe.Pointer(pParse)).FnTempReg, 1))*4))
}
// Deallocate a register, making available for reuse for some other
// purpose.
-func Xsqlite3ReleaseTempReg(tls *libc.TLS, pParse uintptr, iReg int32) { /* sqlite3.c:107327:21: */
+func Xsqlite3ReleaseTempReg(tls *libc.TLS, pParse uintptr, iReg int32) { /* sqlite3.c:107907:21: */
if iReg != 0 {
- if int32((*Parse)(unsafe.Pointer(pParse)).FnTempReg) < (int32(uint32(unsafe.Sizeof([8]int32{})) / uint32(unsafe.Sizeof(int32(0))))) {
- *(*int32)(unsafe.Pointer((pParse + 148 /* &.aTempReg */) + uintptr(libc.PostIncUint8(&(*Parse)(unsafe.Pointer(pParse)).FnTempReg, 1))*4)) = iReg
+ if int32((*Parse)(unsafe.Pointer(pParse)).FnTempReg) < int32(uint32(unsafe.Sizeof([8]int32{}))/uint32(unsafe.Sizeof(int32(0)))) {
+ *(*int32)(unsafe.Pointer(pParse + 144 + uintptr(libc.PostIncUint8(&(*Parse)(unsafe.Pointer(pParse)).FnTempReg, 1))*4)) = iReg
}
}
}
// Allocate or deallocate a block of nReg consecutive registers.
-func Xsqlite3GetTempRange(tls *libc.TLS, pParse uintptr, nReg int32) int32 { /* sqlite3.c:107339:20: */
+func Xsqlite3GetTempRange(tls *libc.TLS, pParse uintptr, nReg int32) int32 { /* sqlite3.c:107919:20: */
var i int32
var n int32
if nReg == 1 {
@@ -87400,16 +88568,16 @@ func Xsqlite3GetTempRange(tls *libc.TLS, pParse uintptr, nReg int32) int32 { /*
i = (*Parse)(unsafe.Pointer(pParse)).FiRangeReg
n = (*Parse)(unsafe.Pointer(pParse)).FnRangeReg
if nReg <= n {
- *(*int32)(unsafe.Pointer(pParse + 32 /* &.iRangeReg */)) += (nReg)
- *(*int32)(unsafe.Pointer(pParse + 28 /* &.nRangeReg */)) -= (nReg)
+ *(*int32)(unsafe.Pointer(pParse + 32)) += nReg
+ *(*int32)(unsafe.Pointer(pParse + 28)) -= nReg
} else {
- i = ((*Parse)(unsafe.Pointer(pParse)).FnMem + 1)
- *(*int32)(unsafe.Pointer(pParse + 44 /* &.nMem */)) += (nReg)
+ i = (*Parse)(unsafe.Pointer(pParse)).FnMem + 1
+ *(*int32)(unsafe.Pointer(pParse + 44)) += nReg
}
return i
}
-func Xsqlite3ReleaseTempRange(tls *libc.TLS, pParse uintptr, iReg int32, nReg int32) { /* sqlite3.c:107353:21: */
+func Xsqlite3ReleaseTempRange(tls *libc.TLS, pParse uintptr, iReg int32, nReg int32) { /* sqlite3.c:107933:21: */
if nReg == 1 {
Xsqlite3ReleaseTempReg(tls, pParse, iReg)
return
@@ -87427,7 +88595,7 @@ func Xsqlite3ReleaseTempRange(tls *libc.TLS, pParse uintptr, iReg int32, nReg in
// that might be invoked from other parts of the code, to ensure that
// the sub/co-routine does not use registers in common with the code that
// invokes the sub/co-routine.
-func Xsqlite3ClearTempRegCache(tls *libc.TLS, pParse uintptr) { /* sqlite3.c:107373:21: */
+func Xsqlite3ClearTempRegCache(tls *libc.TLS, pParse uintptr) { /* sqlite3.c:107953:21: */
(*Parse)(unsafe.Pointer(pParse)).FnTempReg = U8(0)
(*Parse)(unsafe.Pointer(pParse)).FnRangeReg = 0
}
@@ -87461,15 +88629,15 @@ func Xsqlite3ClearTempRegCache(tls *libc.TLS, pParse uintptr) { /* sqlite3.c:107
// in pParse->zErr (system tables may not be altered) and returns non-zero.
//
// Or, if zName is not a system table, zero is returned.
-func isAlterableTable(tls *libc.TLS, pParse uintptr, pTab uintptr) int32 { /* sqlite3.c:107433:12: */
+func isAlterableTable(tls *libc.TLS, pParse uintptr, pTab uintptr) int32 { /* sqlite3.c:108013:12: */
bp := tls.Alloc(8)
defer tls.Free(8)
- if ((0 == Xsqlite3_strnicmp(tls, (*Table)(unsafe.Pointer(pTab)).FzName, ts+7081 /* "sqlite_" */, 7)) ||
- (((*Table)(unsafe.Pointer(pTab)).FtabFlags & U32(TF_Eponymous)) != U32(0))) ||
- ((((*Table)(unsafe.Pointer(pTab)).FtabFlags & U32(TF_Shadow)) != U32(0)) &&
- (Xsqlite3ReadOnlyShadowTables(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb) != 0)) {
- Xsqlite3ErrorMsg(tls, pParse, ts+7089 /* "table %s may not..." */, libc.VaList(bp, (*Table)(unsafe.Pointer(pTab)).FzName))
+ if 0 == Xsqlite3_strnicmp(tls, (*Table)(unsafe.Pointer(pTab)).FzName, ts+7997, 7) ||
+ (*Table)(unsafe.Pointer(pTab)).FtabFlags&U32(TF_Eponymous) != U32(0) ||
+ (*Table)(unsafe.Pointer(pTab)).FtabFlags&U32(TF_Shadow) != U32(0) &&
+ Xsqlite3ReadOnlyShadowTables(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb) != 0 {
+ Xsqlite3ErrorMsg(tls, pParse, ts+8005 /* "table %s may not..." */, libc.VaList(bp, (*Table)(unsafe.Pointer(pTab)).FzName))
return 1
}
return 0
@@ -87480,21 +88648,21 @@ func isAlterableTable(tls *libc.TLS, pParse uintptr, pTab uintptr) int32 { /* sq
// called at the end of the generation of an ALTER TABLE ... RENAME ...
// statement to ensure that the operation has not rendered any schema
// objects unusable.
-func renameTestSchema(tls *libc.TLS, pParse uintptr, zDb uintptr, bTemp int32, zWhen uintptr, bNoDQS int32) { /* sqlite3.c:107455:13: */
+func renameTestSchema(tls *libc.TLS, pParse uintptr, zDb uintptr, bTemp int32, zWhen uintptr, bNoDQS int32) { /* sqlite3.c:108035:13: */
bp := tls.Alloc(64)
defer tls.Free(64)
(*Parse)(unsafe.Pointer(pParse)).FcolNamesSet = U8(1)
Xsqlite3NestedParse(tls, pParse,
- ts+7117, /* "SELECT 1 FROM \"%..." */
+ ts+8033, /* "SELECT 1 FROM \"%..." */
libc.VaList(bp, zDb,
zDb, bTemp, zWhen, bNoDQS))
if bTemp == 0 {
Xsqlite3NestedParse(tls, pParse,
- ts+7292, /* "SELECT 1 FROM te..." */
+ ts+8208, /* "SELECT 1 FROM te..." */
libc.VaList(bp+40, zDb, zWhen, bNoDQS))
}
}
@@ -87504,23 +88672,23 @@ func renameTestSchema(tls *libc.TLS, pParse uintptr, zDb uintptr, bTemp int32, z
// database zDb with their single-quoted equivalents. If argument bTemp is
// not true, similarly update all SQL statements in the sqlite_schema table
// of the temp db.
-func renameFixQuotes(tls *libc.TLS, pParse uintptr, zDb uintptr, bTemp int32) { /* sqlite3.c:107492:13: */
+func renameFixQuotes(tls *libc.TLS, pParse uintptr, zDb uintptr, bTemp int32) { /* sqlite3.c:108072:13: */
bp := tls.Alloc(16)
defer tls.Free(16)
Xsqlite3NestedParse(tls, pParse,
- ts+7466 /* "UPDATE \"%w\".sqli..." */, libc.VaList(bp, zDb, zDb))
+ ts+8382 /* "UPDATE \"%w\".sqli..." */, libc.VaList(bp, zDb, zDb))
if bTemp == 0 {
Xsqlite3NestedParse(tls, pParse,
- ts+7613 /* "UPDATE temp.sqli..." */, 0)
+ ts+8529 /* "UPDATE temp.sqli..." */, 0)
}
}
// Generate code to reload the schema for database iDb. And, if iDb!=1, for
// the temp database as well.
-func renameReloadSchema(tls *libc.TLS, pParse uintptr, iDb int32, p5 U16) { /* sqlite3.c:107513:13: */
+func renameReloadSchema(tls *libc.TLS, pParse uintptr, iDb int32, p5 U16) { /* sqlite3.c:108093:13: */
var v uintptr = (*Parse)(unsafe.Pointer(pParse)).FpVdbe
if v != 0 {
Xsqlite3ChangeCookie(tls, pParse, iDb)
@@ -87533,7 +88701,7 @@ func renameReloadSchema(tls *libc.TLS, pParse uintptr, iDb int32, p5 U16) { /* s
// Generate code to implement the "ALTER TABLE xxx RENAME TO yyy"
// command.
-func Xsqlite3AlterRenameTable(tls *libc.TLS, pParse uintptr, pSrc uintptr, pName uintptr) { /* sqlite3.c:107526:21: */
+func Xsqlite3AlterRenameTable(tls *libc.TLS, pParse uintptr, pSrc uintptr, pName uintptr) { /* sqlite3.c:108106:21: */
bp := tls.Alloc(184)
defer tls.Free(184)
@@ -87545,14 +88713,12 @@ func Xsqlite3AlterRenameTable(tls *libc.TLS, pParse uintptr, pSrc uintptr, pName
var nTabName int32 // Number of UTF-8 characters in zTabName
var zTabName uintptr // Original name of the table
var v uintptr
- var pVTab uintptr // Non-zero if this is a v-tab with an xRename()
- var savedDbFlags U32
+ var pVTab uintptr
var i int32
zName = uintptr(0)
db = (*Parse)(unsafe.Pointer(pParse)).Fdb
- pVTab = uintptr(0) // Saved value of db->mDbFlags
+ pVTab = uintptr(0) // Non-zero if this is a v-tab with an xRename()
- savedDbFlags = (*Sqlite3)(unsafe.Pointer(db)).FmDbFlags
if !((*Sqlite3)(unsafe.Pointer(db)).FmallocFailed != 0) {
goto __1
}
@@ -87560,8 +88726,8 @@ func Xsqlite3AlterRenameTable(tls *libc.TLS, pParse uintptr, pSrc uintptr, pName
__1:
;
- pTab = Xsqlite3LocateTableItem(tls, pParse, uint32(0), (pSrc + 8 /* &.a */))
- if !(!(pTab != 0)) {
+ pTab = Xsqlite3LocateTableItem(tls, pParse, uint32(0), pSrc+8)
+ if !!(pTab != 0) {
goto __2
}
goto exit_rename_table
@@ -87569,11 +88735,10 @@ __2:
;
iDb = Xsqlite3SchemaToIndex(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, (*Table)(unsafe.Pointer(pTab)).FpSchema)
zDb = (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*16)).FzDbSName
- *(*U32)(unsafe.Pointer(db + 24 /* &.mDbFlags */)) |= (U32(DBFLAG_PreferBuiltin))
// Get a NULL terminated version of the new table name.
zName = Xsqlite3NameFromToken(tls, db, pName)
- if !(!(zName != 0)) {
+ if !!(zName != 0) {
goto __3
}
goto exit_rename_table
@@ -87582,13 +88747,13 @@ __3:
// Check that a table or index named 'zName' does not already exist
// in database iDb. If so, this is an error.
- if !(((Xsqlite3FindTable(tls, db, zName, zDb) != 0) ||
- (Xsqlite3FindIndex(tls, db, zName, zDb) != 0)) ||
- (Xsqlite3IsShadowTableOf(tls, db, pTab, zName) != 0)) {
+ if !(Xsqlite3FindTable(tls, db, zName, zDb) != 0 ||
+ Xsqlite3FindIndex(tls, db, zName, zDb) != 0 ||
+ Xsqlite3IsShadowTableOf(tls, db, pTab, zName) != 0) {
goto __4
}
Xsqlite3ErrorMsg(tls, pParse,
- ts+7764 /* "there is already..." */, libc.VaList(bp, zName))
+ ts+8680 /* "there is already..." */, libc.VaList(bp, zName))
goto exit_rename_table
__4:
;
@@ -87601,17 +88766,17 @@ __4:
goto exit_rename_table
__5:
;
- if !(SQLITE_OK != Xsqlite3CheckObjectName(tls, pParse, zName, ts+7823 /* "table" */, zName)) {
+ if !(SQLITE_OK != Xsqlite3CheckObjectName(tls, pParse, zName, ts+8739, zName)) {
goto __6
}
goto exit_rename_table
__6:
;
- if !((*Table)(unsafe.Pointer(pTab)).FpSelect != 0) {
+ if !(int32((*Table)(unsafe.Pointer(pTab)).FeTabType) == TABTYP_VIEW) {
goto __7
}
- Xsqlite3ErrorMsg(tls, pParse, ts+7829 /* "view %s may not ..." */, libc.VaList(bp+8, (*Table)(unsafe.Pointer(pTab)).FzName))
+ Xsqlite3ErrorMsg(tls, pParse, ts+8745 /* "view %s may not ..." */, libc.VaList(bp+8, (*Table)(unsafe.Pointer(pTab)).FzName))
goto exit_rename_table
__7:
;
@@ -87630,7 +88795,7 @@ __8:
goto exit_rename_table
__9:
;
- if !((*Table)(unsafe.Pointer(pTab)).FnModuleArg != 0) {
+ if !(int32((*Table)(unsafe.Pointer(pTab)).FeTabType) == TABTYP_VTAB) {
goto __10
}
pVTab = Xsqlite3GetVTable(tls, db, pTab)
@@ -87664,24 +88829,24 @@ __12:
// the schema to use the new table name.
Xsqlite3NestedParse(tls, pParse,
- ts+7856 /* "UPDATE \"%w\".sqli..." */, libc.VaList(bp+16, zDb, zDb, zTabName, zName, (libc.Bool32(iDb == 1)), zTabName))
+ ts+8772 /* "UPDATE \"%w\".sqli..." */, libc.VaList(bp+16, zDb, zDb, zTabName, zName, libc.Bool32(iDb == 1), zTabName))
// Update the tbl_name and name columns of the sqlite_schema table
// as required.
Xsqlite3NestedParse(tls, pParse,
- ts+8040, /* "UPDATE %Q.sqlite..." */
+ ts+8956, /* "UPDATE %Q.sqlite..." */
libc.VaList(bp+64, zDb,
zName, zName, zName,
nTabName, zTabName))
// If the sqlite_sequence table exists in this database, then update
// it with the new table name.
- if !(Xsqlite3FindTable(tls, db, ts+8345 /* "sqlite_sequence" */, zDb) != 0) {
+ if !(Xsqlite3FindTable(tls, db, ts+9261, zDb) != 0) {
goto __13
}
Xsqlite3NestedParse(tls, pParse,
- ts+8361, /* "UPDATE \"%w\".sqli..." */
+ ts+9277, /* "UPDATE \"%w\".sqli..." */
libc.VaList(bp+112, zDb, zName, (*Table)(unsafe.Pointer(pTab)).FzName))
__13:
;
@@ -87694,7 +88859,7 @@ __13:
}
Xsqlite3NestedParse(tls, pParse,
- ts+8419 /* "UPDATE sqlite_te..." */, libc.VaList(bp+136, zDb, zTabName, zName, zTabName, zDb, zName))
+ ts+9335 /* "UPDATE sqlite_te..." */, libc.VaList(bp+136, zDb, zTabName, zName, zTabName, zDb, zName))
__14:
;
@@ -87712,22 +88877,21 @@ __15:
;
renameReloadSchema(tls, pParse, iDb, uint16(INITFLAG_AlterRename))
- renameTestSchema(tls, pParse, zDb, (libc.Bool32(iDb == 1)), ts+8684 /* "after rename" */, 0)
+ renameTestSchema(tls, pParse, zDb, libc.Bool32(iDb == 1), ts+9600 /* "after rename" */, 0)
exit_rename_table:
Xsqlite3SrcListDelete(tls, db, pSrc)
Xsqlite3DbFree(tls, db, zName)
- (*Sqlite3)(unsafe.Pointer(db)).FmDbFlags = savedDbFlags
}
// Write code that will raise an error if the table described by
// zDb and zTab is not empty.
-func sqlite3ErrorIfNotEmpty(tls *libc.TLS, pParse uintptr, zDb uintptr, zTab uintptr, zErr uintptr) { /* sqlite3.c:107699:13: */
+func sqlite3ErrorIfNotEmpty(tls *libc.TLS, pParse uintptr, zDb uintptr, zTab uintptr, zErr uintptr) { /* sqlite3.c:108275:13: */
bp := tls.Alloc(24)
defer tls.Free(24)
Xsqlite3NestedParse(tls, pParse,
- ts+8697, /* "SELECT raise(ABO..." */
+ ts+9613, /* "SELECT raise(ABO..." */
libc.VaList(bp, zErr, zDb, zTab))
}
@@ -87737,9 +88901,9 @@ func sqlite3ErrorIfNotEmpty(tls *libc.TLS, pParse uintptr, zDb uintptr, zTab uin
//
// The Table structure pParse->pNewTable was extended to include
// the new column during parsing.
-func Xsqlite3AlterFinishAddColumn(tls *libc.TLS, pParse uintptr, pColDef uintptr) { /* sqlite3.c:107719:21: */
- bp := tls.Alloc(44)
- defer tls.Free(44)
+func Xsqlite3AlterFinishAddColumn(tls *libc.TLS, pParse uintptr, pColDef uintptr) { /* sqlite3.c:108295:21: */
+ bp := tls.Alloc(60)
+ defer tls.Free(60)
var pNew uintptr // Copy of pParse->pNewTable
var pTab uintptr // Table being altered
@@ -87754,16 +88918,16 @@ func Xsqlite3AlterFinishAddColumn(tls *libc.TLS, pParse uintptr, pColDef uintptr
var r1 int32 // Temporary registers
db = (*Parse)(unsafe.Pointer(pParse)).Fdb
- if ((*Parse)(unsafe.Pointer(pParse)).FnErr != 0) || ((*Sqlite3)(unsafe.Pointer(db)).FmallocFailed != 0) {
+ if (*Parse)(unsafe.Pointer(pParse)).FnErr != 0 || (*Sqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 {
return
}
pNew = (*Parse)(unsafe.Pointer(pParse)).FpNewTable
iDb = Xsqlite3SchemaToIndex(tls, db, (*Table)(unsafe.Pointer(pNew)).FpSchema)
zDb = (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*16)).FzDbSName
- zTab = ((*Table)(unsafe.Pointer(pNew)).FzName + 16) // Skip the "sqlite_altertab_" prefix on the name
- pCol = ((*Table)(unsafe.Pointer(pNew)).FaCol + uintptr((int32((*Table)(unsafe.Pointer(pNew)).FnCol)-1))*20)
- pDflt = (*Column)(unsafe.Pointer(pCol)).FpDflt
+ zTab = (*Table)(unsafe.Pointer(pNew)).FzName + 16 // Skip the "sqlite_altertab_" prefix on the name
+ pCol = (*Table)(unsafe.Pointer(pNew)).FaCol + uintptr(int32((*Table)(unsafe.Pointer(pNew)).FnCol)-1)*16
+ pDflt = Xsqlite3ColumnExpr(tls, pNew, pCol)
pTab = Xsqlite3FindTable(tls, db, zTab, zDb)
// Invoke the authorization callback.
@@ -87774,90 +88938,98 @@ func Xsqlite3AlterFinishAddColumn(tls *libc.TLS, pParse uintptr, pColDef uintptr
// Check that the new column is not specified as PRIMARY KEY or UNIQUE.
// If there is a NOT NULL constraint, then the default value for the
// column must not be NULL.
- if (int32((*Column)(unsafe.Pointer(pCol)).FcolFlags) & COLFLAG_PRIMKEY) != 0 {
- Xsqlite3ErrorMsg(tls, pParse, ts+8735 /* "Cannot add a PRI..." */, 0)
+ if int32((*Column)(unsafe.Pointer(pCol)).FcolFlags)&COLFLAG_PRIMKEY != 0 {
+ Xsqlite3ErrorMsg(tls, pParse, ts+9651 /* "Cannot add a PRI..." */, 0)
return
}
if (*Table)(unsafe.Pointer(pNew)).FpIndex != 0 {
Xsqlite3ErrorMsg(tls, pParse,
- ts+8767 /* "Cannot add a UNI..." */, 0)
+ ts+9683 /* "Cannot add a UNI..." */, 0)
return
}
- if (int32((*Column)(unsafe.Pointer(pCol)).FcolFlags) & COLFLAG_GENERATED) == 0 {
+ if int32((*Column)(unsafe.Pointer(pCol)).FcolFlags)&COLFLAG_GENERATED == 0 {
// If the default value for the new column was specified with a
// literal NULL, then set pDflt to 0. This simplifies checking
// for an SQL NULL default below.
- if (pDflt != 0) && (int32((*Expr)(unsafe.Pointer((*Expr)(unsafe.Pointer(pDflt)).FpLeft)).Fop) == TK_NULL) {
+ if pDflt != 0 && int32((*Expr)(unsafe.Pointer((*Expr)(unsafe.Pointer(pDflt)).FpLeft)).Fop) == TK_NULL {
pDflt = uintptr(0)
}
- if ((((*Sqlite3)(unsafe.Pointer(db)).Fflags & uint64(SQLITE_ForeignKeys)) != 0) && ((*Table)(unsafe.Pointer(pNew)).FpFKey != 0)) && (pDflt != 0) {
+
+ if (*Sqlite3)(unsafe.Pointer(db)).Fflags&uint64(SQLITE_ForeignKeys) != 0 && *(*uintptr)(unsafe.Pointer(pNew + 44 + 4)) != 0 && pDflt != 0 {
sqlite3ErrorIfNotEmpty(tls, pParse, zDb, zTab,
- ts+8794 /* "Cannot add a REF..." */)
+ ts+9710 /* "Cannot add a REF..." */)
}
- if ((*Column)(unsafe.Pointer(pCol)).FnotNull != 0) && !(pDflt != 0) {
+ if uint32(int32(*(*uint8)(unsafe.Pointer(pCol + 4))&0xf>>0)) != 0 && !(pDflt != 0) {
sqlite3ErrorIfNotEmpty(tls, pParse, zDb, zTab,
- ts+8853 /* "Cannot add a NOT..." */)
+ ts+9769 /* "Cannot add a NOT..." */)
}
// Ensure the default expression is something that sqlite3ValueFromExpr()
// can handle (i.e. not CURRENT_TIME etc.)
if pDflt != 0 {
- *(*uintptr)(unsafe.Pointer(bp + 40 /* pVal */)) = uintptr(0)
+ *(*uintptr)(unsafe.Pointer(bp + 56 /* pVal */)) = uintptr(0)
var rc int32
- rc = Xsqlite3ValueFromExpr(tls, db, pDflt, uint8(SQLITE_UTF8), uint8(SQLITE_AFF_BLOB), bp+40 /* &pVal */)
+ rc = Xsqlite3ValueFromExpr(tls, db, pDflt, uint8(SQLITE_UTF8), uint8(SQLITE_AFF_BLOB), bp+56 /* &pVal */)
if rc != SQLITE_OK {
return
}
- if !(*(*uintptr)(unsafe.Pointer(bp + 40 /* pVal */)) != 0) {
+ if !(*(*uintptr)(unsafe.Pointer(bp + 56)) != 0) {
sqlite3ErrorIfNotEmpty(tls, pParse, zDb, zTab,
- ts+8906 /* "Cannot add a col..." */)
+ ts+9822 /* "Cannot add a col..." */)
}
- Xsqlite3ValueFree(tls, *(*uintptr)(unsafe.Pointer(bp + 40 /* pVal */)))
+ Xsqlite3ValueFree(tls, *(*uintptr)(unsafe.Pointer(bp + 56 /* pVal */)))
}
- } else if (int32((*Column)(unsafe.Pointer(pCol)).FcolFlags) & COLFLAG_STORED) != 0 {
- sqlite3ErrorIfNotEmpty(tls, pParse, zDb, zTab, ts+8952 /* "cannot add a STO..." */)
+ } else if int32((*Column)(unsafe.Pointer(pCol)).FcolFlags)&COLFLAG_STORED != 0 {
+ sqlite3ErrorIfNotEmpty(tls, pParse, zDb, zTab, ts+9868 /* "cannot add a STO..." */)
}
// Modify the CREATE TABLE statement.
zCol = Xsqlite3DbStrNDup(tls, db, (*Token)(unsafe.Pointer(pColDef)).Fz, uint64((*Token)(unsafe.Pointer(pColDef)).Fn))
if zCol != 0 {
- var zEnd uintptr = (zCol + uintptr(((*Token)(unsafe.Pointer(pColDef)).Fn - uint32(1))))
- var savedDbFlags U32 = (*Sqlite3)(unsafe.Pointer(db)).FmDbFlags
- for (zEnd > zCol) && ((int32(*(*uint8)(unsafe.Pointer(zEnd))) == ';') || ((int32(Xsqlite3CtypeMap[uint8(*(*uint8)(unsafe.Pointer(zEnd)))]) & 0x01) != 0)) {
+ var zEnd uintptr = zCol + uintptr((*Token)(unsafe.Pointer(pColDef)).Fn-uint32(1))
+ for zEnd > zCol && (int32(*(*uint8)(unsafe.Pointer(zEnd))) == ';' || int32(Xsqlite3CtypeMap[uint8(*(*uint8)(unsafe.Pointer(zEnd)))])&0x01 != 0) {
*(*uint8)(unsafe.Pointer(libc.PostDecUintptr(&zEnd, 1))) = uint8(0)
}
- *(*U32)(unsafe.Pointer(db + 24 /* &.mDbFlags */)) |= (U32(DBFLAG_PreferBuiltin))
// substr() operations on characters, but addColOffset is in bytes. So we
// have to use printf() to translate between these units:
+
Xsqlite3NestedParse(tls, pParse,
- ts+8979, /* "UPDATE \"%w\".sqli..." */
- libc.VaList(bp, zDb, (*Table)(unsafe.Pointer(pNew)).FaddColOffset, zCol, (*Table)(unsafe.Pointer(pNew)).FaddColOffset,
+ ts+9895, /* "UPDATE \"%w\".sqli..." */
+ libc.VaList(bp, zDb, *(*int32)(unsafe.Pointer(pNew + 44)), zCol, *(*int32)(unsafe.Pointer(pNew + 44)),
zTab))
Xsqlite3DbFree(tls, db, zCol)
- (*Sqlite3)(unsafe.Pointer(db)).FmDbFlags = savedDbFlags
}
- // Make sure the schema version is at least 3. But do not upgrade
- // from less than 3 to 4, as that will corrupt any preexisting DESC
- // index.
v = Xsqlite3GetVdbe(tls, pParse)
if v != 0 {
+ // Make sure the schema version is at least 3. But do not upgrade
+ // from less than 3 to 4, as that will corrupt any preexisting DESC
+ // index.
r1 = Xsqlite3GetTempReg(tls, pParse)
Xsqlite3VdbeAddOp3(tls, v, OP_ReadCookie, iDb, r1, BTREE_FILE_FORMAT)
Xsqlite3VdbeUsesBtree(tls, v, iDb)
Xsqlite3VdbeAddOp2(tls, v, OP_AddImm, r1, -2)
- Xsqlite3VdbeAddOp2(tls, v, OP_IfPos, r1, (Xsqlite3VdbeCurrentAddr(tls, v) + 2))
+ Xsqlite3VdbeAddOp2(tls, v, OP_IfPos, r1, Xsqlite3VdbeCurrentAddr(tls, v)+2)
Xsqlite3VdbeAddOp3(tls, v, OP_SetCookie, iDb, BTREE_FILE_FORMAT, 3)
Xsqlite3ReleaseTempReg(tls, pParse, r1)
- }
- // Reload the table definition
- renameReloadSchema(tls, pParse, iDb, uint16(INITFLAG_AlterRename))
+ // Reload the table definition
+ renameReloadSchema(tls, pParse, iDb, uint16(INITFLAG_AlterAdd))
+
+ // Verify that constraints are still satisfied
+ if (*Table)(unsafe.Pointer(pNew)).FpCheck != uintptr(0) ||
+ uint32(int32(*(*uint8)(unsafe.Pointer(pCol + 4))&0xf>>0)) != 0 && int32((*Column)(unsafe.Pointer(pCol)).FcolFlags)&COLFLAG_GENERATED != 0 {
+ Xsqlite3NestedParse(tls, pParse,
+
+ ts+10041, /* "SELECT CASE WHEN..." */
+ libc.VaList(bp+40, zTab, zDb))
+ }
+ }
}
// This function is called by the parser after the table-name in
@@ -87873,7 +89045,7 @@ func Xsqlite3AlterFinishAddColumn(tls *libc.TLS, pParse uintptr, pColDef uintptr
//
// Routine sqlite3AlterFinishAddColumn() will be called to complete
// coding the "ALTER TABLE ... ADD" statement.
-func Xsqlite3AlterBeginAddColumn(tls *libc.TLS, pParse uintptr, pSrc uintptr) { /* sqlite3.c:107867:21: */
+func Xsqlite3AlterBeginAddColumn(tls *libc.TLS, pParse uintptr, pSrc uintptr) { /* sqlite3.c:108458:21: */
bp := tls.Alloc(8)
defer tls.Free(8)
@@ -87894,27 +89066,27 @@ func Xsqlite3AlterBeginAddColumn(tls *libc.TLS, pParse uintptr, pSrc uintptr) {
goto exit_begin_add_column
__1:
;
- pTab = Xsqlite3LocateTableItem(tls, pParse, uint32(0), (pSrc + 8 /* &.a */))
- if !(!(pTab != 0)) {
+ pTab = Xsqlite3LocateTableItem(tls, pParse, uint32(0), pSrc+8)
+ if !!(pTab != 0) {
goto __2
}
goto exit_begin_add_column
__2:
;
- if !((*Table)(unsafe.Pointer(pTab)).FnModuleArg != 0) {
+ if !(int32((*Table)(unsafe.Pointer(pTab)).FeTabType) == TABTYP_VTAB) {
goto __3
}
- Xsqlite3ErrorMsg(tls, pParse, ts+9125 /* "virtual tables m..." */, 0)
+ Xsqlite3ErrorMsg(tls, pParse, ts+10275 /* "virtual tables m..." */, 0)
goto exit_begin_add_column
__3:
;
// Make sure this is not an attempt to ALTER a view.
- if !((*Table)(unsafe.Pointer(pTab)).FpSelect != 0) {
+ if !(int32((*Table)(unsafe.Pointer(pTab)).FeTabType) == TABTYP_VIEW) {
goto __4
}
- Xsqlite3ErrorMsg(tls, pParse, ts+9159 /* "Cannot add a col..." */, 0)
+ Xsqlite3ErrorMsg(tls, pParse, ts+10309 /* "Cannot add a col..." */, 0)
goto exit_begin_add_column
__4:
;
@@ -87936,7 +89108,7 @@ __5:
// table because user table are not allowed to have the "sqlite_"
// prefix on their name.
pNew = Xsqlite3DbMallocZero(tls, db, uint64(unsafe.Sizeof(Table{})))
- if !(!(pNew != 0)) {
+ if !!(pNew != 0) {
goto __6
}
goto exit_begin_add_column
@@ -87946,10 +89118,10 @@ __6:
(*Table)(unsafe.Pointer(pNew)).FnTabRef = U32(1)
(*Table)(unsafe.Pointer(pNew)).FnCol = (*Table)(unsafe.Pointer(pTab)).FnCol
- nAlloc = ((((int32((*Table)(unsafe.Pointer(pNew)).FnCol) - 1) / 8) * 8) + 8)
+ nAlloc = (int32((*Table)(unsafe.Pointer(pNew)).FnCol)-1)/8*8 + 8
- (*Table)(unsafe.Pointer(pNew)).FaCol = Xsqlite3DbMallocZero(tls, db, (uint64(uint32(unsafe.Sizeof(Column{})) * uint32(nAlloc))))
- (*Table)(unsafe.Pointer(pNew)).FzName = Xsqlite3MPrintf(tls, db, ts+9189 /* "sqlite_altertab_..." */, libc.VaList(bp, (*Table)(unsafe.Pointer(pTab)).FzName))
+ (*Table)(unsafe.Pointer(pNew)).FaCol = Xsqlite3DbMallocZero(tls, db, uint64(uint32(unsafe.Sizeof(Column{}))*uint32(nAlloc)))
+ (*Table)(unsafe.Pointer(pNew)).FzName = Xsqlite3MPrintf(tls, db, ts+10339 /* "sqlite_altertab_..." */, libc.VaList(bp, (*Table)(unsafe.Pointer(pTab)).FzName))
if !(!(int32((*Table)(unsafe.Pointer(pNew)).FaCol) != 0) || !(int32((*Table)(unsafe.Pointer(pNew)).FzName) != 0)) {
goto __7
}
@@ -87957,17 +89129,15 @@ __6:
goto exit_begin_add_column
__7:
;
- libc.Xmemcpy(tls, (*Table)(unsafe.Pointer(pNew)).FaCol, (*Table)(unsafe.Pointer(pTab)).FaCol, (uint32(unsafe.Sizeof(Column{})) * uint32((*Table)(unsafe.Pointer(pNew)).FnCol)))
+ libc.Xmemcpy(tls, (*Table)(unsafe.Pointer(pNew)).FaCol, (*Table)(unsafe.Pointer(pTab)).FaCol, uint32(unsafe.Sizeof(Column{}))*uint32((*Table)(unsafe.Pointer(pNew)).FnCol))
i = 0
__8:
if !(i < int32((*Table)(unsafe.Pointer(pNew)).FnCol)) {
goto __10
}
- pCol = ((*Table)(unsafe.Pointer(pNew)).FaCol + uintptr(i)*20)
- (*Column)(unsafe.Pointer(pCol)).FzName = Xsqlite3DbStrDup(tls, db, (*Column)(unsafe.Pointer(pCol)).FzName)
- (*Column)(unsafe.Pointer(pCol)).FhName = Xsqlite3StrIHash(tls, (*Column)(unsafe.Pointer(pCol)).FzName)
- (*Column)(unsafe.Pointer(pCol)).FzColl = uintptr(0)
- (*Column)(unsafe.Pointer(pCol)).FpDflt = uintptr(0)
+ pCol = (*Table)(unsafe.Pointer(pNew)).FaCol + uintptr(i)*16
+ (*Column)(unsafe.Pointer(pCol)).FzCnName = Xsqlite3DbStrDup(tls, db, (*Column)(unsafe.Pointer(pCol)).FzCnName)
+ (*Column)(unsafe.Pointer(pCol)).FhName = Xsqlite3StrIHash(tls, (*Column)(unsafe.Pointer(pCol)).FzCnName)
goto __9
__9:
i++
@@ -87975,8 +89145,10 @@ __9:
goto __10
__10:
;
+
+ *(*uintptr)(unsafe.Pointer(pNew + 44 + 8 /* &.pDfltList */)) = Xsqlite3ExprListDup(tls, db, *(*uintptr)(unsafe.Pointer(pTab + 44 + 8 /* &.pDfltList */)), 0)
(*Table)(unsafe.Pointer(pNew)).FpSchema = (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*16)).FpSchema
- (*Table)(unsafe.Pointer(pNew)).FaddColOffset = (*Table)(unsafe.Pointer(pTab)).FaddColOffset
+ *(*int32)(unsafe.Pointer(pNew + 44)) = *(*int32)(unsafe.Pointer(pTab + 44))
(*Table)(unsafe.Pointer(pNew)).FnTabRef = U32(1)
exit_begin_add_column:
@@ -87990,24 +89162,24 @@ exit_begin_add_column:
// it loads an error message into pParse and returns non-zero.
//
// Or, if pTab is not a view or virtual table, zero is returned.
-func isRealTable(tls *libc.TLS, pParse uintptr, pTab uintptr, bDrop int32) int32 { /* sqlite3.c:107949:12: */
+func isRealTable(tls *libc.TLS, pParse uintptr, pTab uintptr, bDrop int32) int32 { /* sqlite3.c:108541:12: */
bp := tls.Alloc(24)
defer tls.Free(24)
var zType uintptr = uintptr(0)
- if (*Table)(unsafe.Pointer(pTab)).FpSelect != 0 {
- zType = ts + 9208 /* "view" */
+ if int32((*Table)(unsafe.Pointer(pTab)).FeTabType) == TABTYP_VIEW {
+ zType = ts + 10358 /* "view" */
}
- if (*Table)(unsafe.Pointer(pTab)).FnModuleArg != 0 {
- zType = ts + 9213 /* "virtual table" */
+ if int32((*Table)(unsafe.Pointer(pTab)).FeTabType) == TABTYP_VTAB {
+ zType = ts + 10363 /* "virtual table" */
}
if zType != 0 {
- Xsqlite3ErrorMsg(tls, pParse, ts+9227, /* "cannot %s %s \"%s..." */
+ Xsqlite3ErrorMsg(tls, pParse, ts+10377, /* "cannot %s %s \"%s..." */
libc.VaList(bp, func() uintptr {
if bDrop != 0 {
- return ts + 9245 /* "drop column from" */
+ return ts + 10395 /* "drop column from" */
}
- return ts + 9262 /* "rename columns o..." */
+ return ts + 10412 /* "rename columns o..." */
}(),
zType, (*Table)(unsafe.Pointer(pTab)).FzName))
return 1
@@ -88018,7 +89190,7 @@ func isRealTable(tls *libc.TLS, pParse uintptr, pTab uintptr, bDrop int32) int32
// Handles the following parser reduction:
//
// cmd ::= ALTER TABLE pSrc RENAME COLUMN pOld TO pNew
-func Xsqlite3AlterRenameColumn(tls *libc.TLS, pParse uintptr, pSrc uintptr, pOld uintptr, pNew uintptr) { /* sqlite3.c:107979:21: */
+func Xsqlite3AlterRenameColumn(tls *libc.TLS, pParse uintptr, pSrc uintptr, pOld uintptr, pNew uintptr) { /* sqlite3.c:108571:21: */
bp := tls.Alloc(112)
defer tls.Free(112)
@@ -88035,8 +89207,8 @@ func Xsqlite3AlterRenameColumn(tls *libc.TLS, pParse uintptr, pSrc uintptr, pOld
zNew = uintptr(0) // True to quote the new name
// Locate the table to be altered
- pTab = Xsqlite3LocateTableItem(tls, pParse, uint32(0), (pSrc + 8 /* &.a */))
- if !(!(pTab != 0)) {
+ pTab = Xsqlite3LocateTableItem(tls, pParse, uint32(0), pSrc+8)
+ if !!(pTab != 0) {
goto __1
}
goto exit_rename_column
@@ -88073,7 +89245,7 @@ __4:
// Make sure the old name really is a column name in the table to be
// altered. Set iCol to be the index of the column being renamed
zOld = Xsqlite3NameFromToken(tls, db, pOld)
- if !(!(zOld != 0)) {
+ if !!(zOld != 0) {
goto __5
}
goto exit_rename_column
@@ -88084,7 +89256,7 @@ __6:
if !(iCol < int32((*Table)(unsafe.Pointer(pTab)).FnCol)) {
goto __8
}
- if !(0 == Xsqlite3StrICmp(tls, (*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FaCol+uintptr(iCol)*20)).FzName, zOld)) {
+ if !(0 == Xsqlite3StrICmp(tls, (*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FaCol+uintptr(iCol)*16)).FzCnName, zOld)) {
goto __9
}
goto __8
@@ -88100,43 +89272,43 @@ __8:
if !(iCol == int32((*Table)(unsafe.Pointer(pTab)).FnCol)) {
goto __10
}
- Xsqlite3ErrorMsg(tls, pParse, ts+5383 /* "no such column: ..." */, libc.VaList(bp, zOld))
+ Xsqlite3ErrorMsg(tls, pParse, ts+6230 /* "no such column: ..." */, libc.VaList(bp, zOld))
goto exit_rename_column
__10:
;
// Ensure the schema contains no double-quoted strings
- renameTestSchema(tls, pParse, zDb, (libc.Bool32(iSchema == 1)), ts+755 /* "" */, 0)
- renameFixQuotes(tls, pParse, zDb, (libc.Bool32(iSchema == 1)))
+ renameTestSchema(tls, pParse, zDb, libc.Bool32(iSchema == 1), ts+1543 /* "" */, 0)
+ renameFixQuotes(tls, pParse, zDb, libc.Bool32(iSchema == 1))
// Do the rename operation using a recursive UPDATE statement that
// uses the sqlite_rename_column() SQL function to compute the new
// CREATE statement text for the sqlite_schema table.
Xsqlite3MayAbort(tls, pParse)
zNew = Xsqlite3NameFromToken(tls, db, pNew)
- if !(!(zNew != 0)) {
+ if !!(zNew != 0) {
goto __11
}
goto exit_rename_column
__11:
;
- bQuote = (int32(Xsqlite3CtypeMap[uint8(*(*uint8)(unsafe.Pointer((*Token)(unsafe.Pointer(pNew)).Fz)))]) & 0x80)
+ bQuote = int32(Xsqlite3CtypeMap[uint8(*(*uint8)(unsafe.Pointer((*Token)(unsafe.Pointer(pNew)).Fz)))]) & 0x80
Xsqlite3NestedParse(tls, pParse,
- ts+9280, /* "UPDATE \"%w\".sqli..." */
+ ts+10430, /* "UPDATE \"%w\".sqli..." */
libc.VaList(bp+8, zDb,
- zDb, (*Table)(unsafe.Pointer(pTab)).FzName, iCol, zNew, bQuote, (libc.Bool32(iSchema == 1)),
+ zDb, (*Table)(unsafe.Pointer(pTab)).FzName, iCol, zNew, bQuote, libc.Bool32(iSchema == 1),
(*Table)(unsafe.Pointer(pTab)).FzName))
Xsqlite3NestedParse(tls, pParse,
- ts+9498, /* "UPDATE temp.sqli..." */
+ ts+10612, /* "UPDATE temp.sqli..." */
libc.VaList(bp+72, zDb, (*Table)(unsafe.Pointer(pTab)).FzName, iCol, zNew, bQuote))
// Drop and reload the database schema.
renameReloadSchema(tls, pParse, iSchema, uint16(INITFLAG_AlterRename))
- renameTestSchema(tls, pParse, zDb, (libc.Bool32(iSchema == 1)), ts+8684 /* "after rename" */, 1)
+ renameTestSchema(tls, pParse, zDb, libc.Bool32(iSchema == 1), ts+9600 /* "after rename" */, 1)
exit_rename_column:
Xsqlite3SrcListDelete(tls, db, pSrc)
@@ -88147,7 +89319,7 @@ exit_rename_column:
// The context of an ALTER TABLE RENAME COLUMN operation that gets passed
// down into the Walker.
-type RenameCtx = RenameCtx1 /* sqlite3.c:108095:26 */
+type RenameCtx = RenameCtx1 /* sqlite3.c:108686:26 */
// Remember that the parser tree element pPtr was created using
// the token pToken.
@@ -88159,7 +89331,7 @@ type RenameCtx = RenameCtx1 /* sqlite3.c:108095:26 */
// The pPtr argument is returned so that this routine can be used
// with tail recursion in tokenExpr() routine, for a small performance
// improvement.
-func Xsqlite3RenameTokenMap(tls *libc.TLS, pParse uintptr, pPtr uintptr, pToken uintptr) uintptr { /* sqlite3.c:108156:21: */
+func Xsqlite3RenameTokenMap(tls *libc.TLS, pParse uintptr, pPtr uintptr, pToken uintptr) uintptr { /* sqlite3.c:108747:27: */
var pNew uintptr
if int32((*Parse)(unsafe.Pointer(pParse)).FeParseMode) != PARSE_MODE_UNMAP {
@@ -88178,7 +89350,7 @@ func Xsqlite3RenameTokenMap(tls *libc.TLS, pParse uintptr, pPtr uintptr, pToken
// It is assumed that there is already a RenameToken object associated
// with parse tree element pFrom. This function remaps the associated token
// to parse tree element pTo.
-func Xsqlite3RenameTokenRemap(tls *libc.TLS, pParse uintptr, pTo uintptr, pFrom uintptr) { /* sqlite3.c:108178:21: */
+func Xsqlite3RenameTokenRemap(tls *libc.TLS, pParse uintptr, pTo uintptr, pFrom uintptr) { /* sqlite3.c:108773:21: */
var p uintptr
for p = (*Parse)(unsafe.Pointer(pParse)).FpRename; p != 0; p = (*RenameToken)(unsafe.Pointer(p)).FpNext {
@@ -88190,15 +89362,18 @@ func Xsqlite3RenameTokenRemap(tls *libc.TLS, pParse uintptr, pTo uintptr, pFrom
}
// Walker callback used by sqlite3RenameExprUnmap().
-func renameUnmapExprCb(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 { /* sqlite3.c:108192:12: */
+func renameUnmapExprCb(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 { /* sqlite3.c:108787:12: */
var pParse uintptr = (*Walker)(unsafe.Pointer(pWalker)).FpParse
Xsqlite3RenameTokenRemap(tls, pParse, uintptr(0), pExpr)
+ if (*Expr)(unsafe.Pointer(pExpr)).Fflags&U32(EP_WinFunc|EP_Subrtn) == U32(0) {
+ Xsqlite3RenameTokenRemap(tls, pParse, uintptr(0), pExpr+44)
+ }
return WRC_Continue
}
// Iterate through the Select objects that are part of WITH clauses attached
// to select statement pSelect.
-func renameWalkWith(tls *libc.TLS, pWalker uintptr, pSelect uintptr) { /* sqlite3.c:108202:13: */
+func renameWalkWith(tls *libc.TLS, pWalker uintptr, pSelect uintptr) { /* sqlite3.c:108800:13: */
bp := tls.Alloc(32)
defer tls.Free(32)
@@ -88208,7 +89383,7 @@ func renameWalkWith(tls *libc.TLS, pWalker uintptr, pSelect uintptr) { /* sqlite
var i int32
var pCopy uintptr = uintptr(0)
- if ((*Select)(unsafe.Pointer((*Cte)(unsafe.Pointer((pWith + 12 /* &.a */))).FpSelect)).FselFlags & U32(SF_Expanded)) == U32(0) {
+ if (*Select)(unsafe.Pointer((*Cte)(unsafe.Pointer(pWith+12)).FpSelect)).FselFlags&U32(SF_Expanded) == U32(0) {
// Push a copy of the With object onto the with-stack. We use a copy
// here as the original will be expanded and resolved (flags SF_Expanded
// and SF_Resolved) below. And the parser code that uses the with-stack
@@ -88218,7 +89393,7 @@ func renameWalkWith(tls *libc.TLS, pWalker uintptr, pSelect uintptr) { /* sqlite
pCopy = Xsqlite3WithPush(tls, pParse, pCopy, uint8(1))
}
for i = 0; i < (*With)(unsafe.Pointer(pWith)).FnCte; i++ {
- var p uintptr = (*Cte)(unsafe.Pointer((pWith + 12 /* &.a */) + uintptr(i)*24)).FpSelect
+ var p uintptr = (*Cte)(unsafe.Pointer(pWith + 12 + uintptr(i)*24)).FpSelect
// var sNC NameContext at bp, 32
libc.Xmemset(tls, bp /* &sNC */, 0, uint32(unsafe.Sizeof(NameContext{})))
@@ -88226,17 +89401,20 @@ func renameWalkWith(tls *libc.TLS, pWalker uintptr, pSelect uintptr) { /* sqlite
if pCopy != 0 {
Xsqlite3SelectPrep(tls, (*NameContext)(unsafe.Pointer(bp /* &sNC */)).FpParse, p, bp /* &sNC */)
}
+ if (*Sqlite3)(unsafe.Pointer((*Parse)(unsafe.Pointer((*NameContext)(unsafe.Pointer(bp)).FpParse)).Fdb)).FmallocFailed != 0 {
+ return
+ }
Xsqlite3WalkSelect(tls, pWalker, p)
- Xsqlite3RenameExprlistUnmap(tls, pParse, (*Cte)(unsafe.Pointer((pWith+12 /* &.a */)+uintptr(i)*24)).FpCols)
+ Xsqlite3RenameExprlistUnmap(tls, pParse, (*Cte)(unsafe.Pointer(pWith+12+uintptr(i)*24)).FpCols)
}
- if (pCopy != 0) && ((*Parse)(unsafe.Pointer(pParse)).FpWith == pCopy) {
+ if pCopy != 0 && (*Parse)(unsafe.Pointer(pParse)).FpWith == pCopy {
(*Parse)(unsafe.Pointer(pParse)).FpWith = (*With)(unsafe.Pointer(pCopy)).FpOuter
}
}
}
// Unmap all tokens in the IdList object passed as the second argument.
-func unmapColumnIdlistNames(tls *libc.TLS, pParse uintptr, pIdList uintptr) { /* sqlite3.c:108236:13: */
+func unmapColumnIdlistNames(tls *libc.TLS, pParse uintptr, pIdList uintptr) { /* sqlite3.c:108835:13: */
if pIdList != 0 {
var ii int32
for ii = 0; ii < (*IdList)(unsafe.Pointer(pIdList)).FnId; ii++ {
@@ -88246,32 +89424,30 @@ func unmapColumnIdlistNames(tls *libc.TLS, pParse uintptr, pIdList uintptr) { /*
}
// Walker callback used by sqlite3RenameExprUnmap().
-func renameUnmapSelectCb(tls *libc.TLS, pWalker uintptr, p uintptr) int32 { /* sqlite3.c:108251:12: */
+func renameUnmapSelectCb(tls *libc.TLS, pWalker uintptr, p uintptr) int32 { /* sqlite3.c:108850:12: */
var pParse uintptr = (*Walker)(unsafe.Pointer(pWalker)).FpParse
var i int32
if (*Parse)(unsafe.Pointer(pParse)).FnErr != 0 {
return WRC_Abort
}
- if ((*Select)(unsafe.Pointer(p)).FselFlags & (U32(SF_View | SF_CopyCte))) != 0 {
+ if (*Select)(unsafe.Pointer(p)).FselFlags&U32(SF_View|SF_CopyCte) != 0 {
return WRC_Prune
}
if (*Select)(unsafe.Pointer(p)).FpEList != 0 {
var pList uintptr = (*Select)(unsafe.Pointer(p)).FpEList
for i = 0; i < (*ExprList)(unsafe.Pointer(pList)).FnExpr; i++ {
- if ((*ExprList_item)(unsafe.Pointer((pList+8 /* &.a */)+uintptr(i)*20)).FzEName != 0) && ((int32(*(*uint8)(unsafe.Pointer(((pList + 8 /* &.a */) + uintptr(i)*20) + 12 /* &.eEName */)) & 0x3 >> 0)) == ENAME_NAME) {
- Xsqlite3RenameTokenRemap(tls, pParse, uintptr(0), (*ExprList_item)(unsafe.Pointer((pList+8 /* &.a */)+uintptr(i)*20)).FzEName)
+ if (*ExprList_item)(unsafe.Pointer(pList+8+uintptr(i)*20)).FzEName != 0 && int32(*(*uint8)(unsafe.Pointer(pList + 8 + uintptr(i)*20 + 12))&0x3>>0) == ENAME_NAME {
+ Xsqlite3RenameTokenRemap(tls, pParse, uintptr(0), (*ExprList_item)(unsafe.Pointer(pList+8+uintptr(i)*20)).FzEName)
}
}
}
if (*Select)(unsafe.Pointer(p)).FpSrc != 0 { // Every Select as a SrcList, even if it is empty
var pSrc uintptr = (*Select)(unsafe.Pointer(p)).FpSrc
for i = 0; i < (*SrcList)(unsafe.Pointer(pSrc)).FnSrc; i++ {
- Xsqlite3RenameTokenRemap(tls, pParse, uintptr(0), (*SrcItem)(unsafe.Pointer((pSrc+8 /* &.a */)+uintptr(i)*72)).FzName)
- if Xsqlite3WalkExpr(tls, pWalker, (*SrcItem)(unsafe.Pointer((pSrc+8 /* &.a */)+uintptr(i)*72)).FpOn) != 0 {
- return WRC_Abort
- }
- unmapColumnIdlistNames(tls, pParse, (*SrcItem)(unsafe.Pointer((pSrc+8 /* &.a */)+uintptr(i)*72)).FpUsing)
+ Xsqlite3RenameTokenRemap(tls, pParse, uintptr(0), (*SrcItem)(unsafe.Pointer(pSrc+8+uintptr(i)*72)).FzName)
+ Xsqlite3WalkExpr(tls, pWalker, (*SrcItem)(unsafe.Pointer(pSrc+8+uintptr(i)*72)).FpOn)
+ unmapColumnIdlistNames(tls, pParse, (*SrcItem)(unsafe.Pointer(pSrc+8+uintptr(i)*72)).FpUsing)
}
}
@@ -88280,7 +89456,7 @@ func renameUnmapSelectCb(tls *libc.TLS, pWalker uintptr, p uintptr) int32 { /* s
}
// Remove all nodes that are part of expression pExpr from the rename list.
-func Xsqlite3RenameExprUnmap(tls *libc.TLS, pParse uintptr, pExpr uintptr) { /* sqlite3.c:108284:21: */
+func Xsqlite3RenameExprUnmap(tls *libc.TLS, pParse uintptr, pExpr uintptr) { /* sqlite3.c:108883:21: */
bp := tls.Alloc(28)
defer tls.Free(28)
@@ -88302,7 +89478,7 @@ func Xsqlite3RenameExprUnmap(tls *libc.TLS, pParse uintptr, pExpr uintptr) { /*
// Remove all nodes that are part of expression-list pEList from the
// rename list.
-func Xsqlite3RenameExprlistUnmap(tls *libc.TLS, pParse uintptr, pEList uintptr) { /* sqlite3.c:108300:21: */
+func Xsqlite3RenameExprlistUnmap(tls *libc.TLS, pParse uintptr, pEList uintptr) { /* sqlite3.c:108899:21: */
bp := tls.Alloc(28)
defer tls.Free(28)
@@ -88317,15 +89493,15 @@ func Xsqlite3RenameExprlistUnmap(tls *libc.TLS, pParse uintptr, pEList uintptr)
}{renameUnmapExprCb}))
Xsqlite3WalkExprList(tls, bp /* &sWalker */, pEList)
for i = 0; i < (*ExprList)(unsafe.Pointer(pEList)).FnExpr; i++ {
- if (int32(*(*uint8)(unsafe.Pointer(((pEList + 8 /* &.a */) + uintptr(i)*20) + 12 /* &.eEName */)) & 0x3 >> 0)) == ENAME_NAME {
- Xsqlite3RenameTokenRemap(tls, pParse, uintptr(0), (*ExprList_item)(unsafe.Pointer((pEList+8 /* &.a */)+uintptr(i)*20)).FzEName)
+ if int32(*(*uint8)(unsafe.Pointer(pEList + 8 + uintptr(i)*20 + 12))&0x3>>0) == ENAME_NAME {
+ Xsqlite3RenameTokenRemap(tls, pParse, uintptr(0), (*ExprList_item)(unsafe.Pointer(pEList+8+uintptr(i)*20)).FzEName)
}
}
}
}
// Free the list of RenameToken objects given in the second argument
-func renameTokenFree(tls *libc.TLS, db uintptr, pToken uintptr) { /* sqlite3.c:108319:13: */
+func renameTokenFree(tls *libc.TLS, db uintptr, pToken uintptr) { /* sqlite3.c:108918:13: */
var pNext uintptr
var p uintptr
for p = pToken; p != 0; p = pNext {
@@ -88341,13 +89517,13 @@ func renameTokenFree(tls *libc.TLS, db uintptr, pToken uintptr) { /* sqlite3.c:1
// If the second argument passed to this function is not NULL and a matching
// RenameToken object is found, remove it from the Parse object and add it to
// the list maintained by the RenameCtx object.
-func renameTokenFind(tls *libc.TLS, pParse uintptr, pCtx uintptr, pPtr uintptr) uintptr { /* sqlite3.c:108337:20: */
+func renameTokenFind(tls *libc.TLS, pParse uintptr, pCtx uintptr, pPtr uintptr) uintptr { /* sqlite3.c:108936:20: */
var pp uintptr
if pPtr == uintptr(0) {
return uintptr(0)
}
- for pp = (pParse + 268 /* &.pRename */); *(*uintptr)(unsafe.Pointer(pp)) != 0; pp = (*(*uintptr)(unsafe.Pointer(pp)) + 12 /* &.pNext */) {
- if (*RenameToken)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(pp))))).Fp == pPtr {
+ for pp = pParse + 264; *(*uintptr)(unsafe.Pointer(pp)) != 0; pp = *(*uintptr)(unsafe.Pointer(pp)) + 12 {
+ if (*RenameToken)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pp)))).Fp == pPtr {
var pToken uintptr = *(*uintptr)(unsafe.Pointer(pp))
if pCtx != 0 {
*(*uintptr)(unsafe.Pointer(pp)) = (*RenameToken)(unsafe.Pointer(pToken)).FpNext
@@ -88364,8 +89540,8 @@ func renameTokenFind(tls *libc.TLS, pParse uintptr, pCtx uintptr, pPtr uintptr)
// This is a Walker select callback. It does nothing. It is only required
// because without a dummy callback, sqlite3WalkExpr() and similar do not
// descend into sub-select statements.
-func renameColumnSelectCb(tls *libc.TLS, pWalker uintptr, p uintptr) int32 { /* sqlite3.c:108366:12: */
- if ((*Select)(unsafe.Pointer(p)).FselFlags & (U32(SF_View | SF_CopyCte))) != 0 {
+func renameColumnSelectCb(tls *libc.TLS, pWalker uintptr, p uintptr) int32 { /* sqlite3.c:108965:12: */
+ if (*Select)(unsafe.Pointer(p)).FselFlags&U32(SF_View|SF_CopyCte) != 0 {
return WRC_Prune
}
@@ -88380,15 +89556,16 @@ func renameColumnSelectCb(tls *libc.TLS, pWalker uintptr, p uintptr) int32 { /*
// ALTER TABLE statement. If it is, then attach its associated
// RenameToken object to the list of RenameToken objects being
// constructed in RenameCtx object at pWalker->u.pRename.
-func renameColumnExprCb(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 { /* sqlite3.c:108385:12: */
- var p uintptr = *(*uintptr)(unsafe.Pointer(pWalker + 24 /* &.u */))
- if ((int32((*Expr)(unsafe.Pointer(pExpr)).Fop) == TK_TRIGGER) &&
- (int32((*Expr)(unsafe.Pointer(pExpr)).FiColumn) == (*RenameCtx)(unsafe.Pointer(p)).FiCol)) &&
- ((*Parse)(unsafe.Pointer((*Walker)(unsafe.Pointer(pWalker)).FpParse)).FpTriggerTab == (*RenameCtx)(unsafe.Pointer(p)).FpTab) {
+func renameColumnExprCb(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 { /* sqlite3.c:108984:12: */
+ var p uintptr = *(*uintptr)(unsafe.Pointer(pWalker + 24))
+ if int32((*Expr)(unsafe.Pointer(pExpr)).Fop) == TK_TRIGGER &&
+ int32((*Expr)(unsafe.Pointer(pExpr)).FiColumn) == (*RenameCtx)(unsafe.Pointer(p)).FiCol &&
+ (*Parse)(unsafe.Pointer((*Walker)(unsafe.Pointer(pWalker)).FpParse)).FpTriggerTab == (*RenameCtx)(unsafe.Pointer(p)).FpTab {
renameTokenFind(tls, (*Walker)(unsafe.Pointer(pWalker)).FpParse, p, pExpr)
- } else if ((int32((*Expr)(unsafe.Pointer(pExpr)).Fop) == TK_COLUMN) &&
- (int32((*Expr)(unsafe.Pointer(pExpr)).FiColumn) == (*RenameCtx)(unsafe.Pointer(p)).FiCol)) &&
- ((*RenameCtx)(unsafe.Pointer(p)).FpTab == *(*uintptr)(unsafe.Pointer(pExpr + 44 /* &.y */))) {
+ } else if int32((*Expr)(unsafe.Pointer(pExpr)).Fop) == TK_COLUMN &&
+ int32((*Expr)(unsafe.Pointer(pExpr)).FiColumn) == (*RenameCtx)(unsafe.Pointer(p)).FiCol &&
+ (*Expr)(unsafe.Pointer(pExpr)).Fflags&U32(EP_WinFunc|EP_Subrtn) == U32(0) &&
+ (*RenameCtx)(unsafe.Pointer(p)).FpTab == *(*uintptr)(unsafe.Pointer(pExpr + 44)) {
renameTokenFind(tls, (*Walker)(unsafe.Pointer(pWalker)).FpParse, p, pExpr)
}
return WRC_Continue
@@ -88401,7 +89578,7 @@ func renameColumnExprCb(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 { /
// the input SQL is parsed from left to right. Repeated calls to this routine
// return all column name tokens in the order that they are encountered
// in the SQL statement.
-func renameColumnTokenNext(tls *libc.TLS, pCtx uintptr) uintptr { /* sqlite3.c:108410:20: */
+func renameColumnTokenNext(tls *libc.TLS, pCtx uintptr) uintptr { /* sqlite3.c:109010:20: */
var pBest uintptr = (*RenameCtx)(unsafe.Pointer(pCtx)).FpList
var pToken uintptr
var pp uintptr
@@ -88411,7 +89588,7 @@ func renameColumnTokenNext(tls *libc.TLS, pCtx uintptr) uintptr { /* sqlite3.c:1
pBest = pToken
}
}
- for pp = (pCtx /* &.pList */); *(*uintptr)(unsafe.Pointer(pp)) != pBest; pp = (*(*uintptr)(unsafe.Pointer(pp)) + 12 /* &.pNext */) {
+ for pp = pCtx; *(*uintptr)(unsafe.Pointer(pp)) != pBest; pp = *(*uintptr)(unsafe.Pointer(pp)) + 12 {
}
*(*uintptr)(unsafe.Pointer(pp)) = (*RenameToken)(unsafe.Pointer(pBest)).FpNext
@@ -88423,7 +89600,7 @@ func renameColumnTokenNext(tls *libc.TLS, pCtx uintptr) uintptr { /* sqlite3.c:1
// ALTER TABLE RENAME COLUMN program. The error message emitted by the
// sub-routine is currently stored in pParse->zErrMsg. This function
// adds context to the error message and then stores it in pCtx.
-func renameColumnParseError(tls *libc.TLS, pCtx uintptr, zWhen uintptr, pType uintptr, pObject uintptr, pParse uintptr) { /* sqlite3.c:108431:13: */
+func renameColumnParseError(tls *libc.TLS, pCtx uintptr, zWhen uintptr, pType uintptr, pObject uintptr, pParse uintptr) { /* sqlite3.c:109031:13: */
bp := tls.Alloc(40)
defer tls.Free(40)
@@ -88431,12 +89608,12 @@ func renameColumnParseError(tls *libc.TLS, pCtx uintptr, zWhen uintptr, pType ui
var zN uintptr = Xsqlite3_value_text(tls, pObject)
var zErr uintptr
- zErr = Xsqlite3_mprintf(tls, ts+9629, /* "error in %s %s%s..." */
+ zErr = Xsqlite3_mprintf(tls, ts+10743, /* "error in %s %s%s..." */
libc.VaList(bp, zT, zN, func() uintptr {
if *(*uint8)(unsafe.Pointer(zWhen)) != 0 {
- return ts + 9652 /* " " */
+ return ts + 10766 /* " " */
}
- return ts + 755 /* "" */
+ return ts + 1543 /* "" */
}(), zWhen,
(*Parse)(unsafe.Pointer(pParse)).FzErrMsg))
Xsqlite3_result_error(tls, pCtx, zErr, -1)
@@ -88447,14 +89624,14 @@ func renameColumnParseError(tls *libc.TLS, pCtx uintptr, zWhen uintptr, pType ui
// pEList->a[i].zName) that matches the string in zOld, extract the
// corresponding rename-token from Parse object pParse and add it
// to the RenameCtx pCtx.
-func renameColumnElistNames(tls *libc.TLS, pParse uintptr, pCtx uintptr, pEList uintptr, zOld uintptr) { /* sqlite3.c:108456:13: */
+func renameColumnElistNames(tls *libc.TLS, pParse uintptr, pCtx uintptr, pEList uintptr, zOld uintptr) { /* sqlite3.c:109056:13: */
if pEList != 0 {
var i int32
for i = 0; i < (*ExprList)(unsafe.Pointer(pEList)).FnExpr; i++ {
- var zName uintptr = (*ExprList_item)(unsafe.Pointer((pEList + 8 /* &.a */) + uintptr(i)*20)).FzEName
- if (((int32(*(*uint8)(unsafe.Pointer(((pEList + 8 /* &.a */) + uintptr(i)*20) + 12 /* &.eEName */)) & 0x3 >> 0)) == ENAME_NAME) &&
- (zName != uintptr(0))) &&
- (0 == Xsqlite3_stricmp(tls, zName, zOld)) {
+ var zName uintptr = (*ExprList_item)(unsafe.Pointer(pEList + 8 + uintptr(i)*20)).FzEName
+ if int32(*(*uint8)(unsafe.Pointer(pEList + 8 + uintptr(i)*20 + 12))&0x3>>0) == ENAME_NAME &&
+ zName != uintptr(0) &&
+ 0 == Xsqlite3_stricmp(tls, zName, zOld) {
renameTokenFind(tls, pParse, pCtx, zName)
}
}
@@ -88464,7 +89641,7 @@ func renameColumnElistNames(tls *libc.TLS, pParse uintptr, pCtx uintptr, pEList
// For each name in the the id-list pIdList (i.e. each pIdList->a[i].zName)
// that matches the string in zOld, extract the corresponding rename-token
// from Parse object pParse and add it to the RenameCtx pCtx.
-func renameColumnIdlistNames(tls *libc.TLS, pParse uintptr, pCtx uintptr, pIdList uintptr, zOld uintptr) { /* sqlite3.c:108481:13: */
+func renameColumnIdlistNames(tls *libc.TLS, pParse uintptr, pCtx uintptr, pIdList uintptr, zOld uintptr) { /* sqlite3.c:109081:13: */
if pIdList != 0 {
var i int32
for i = 0; i < (*IdList)(unsafe.Pointer(pIdList)).FnId; i++ {
@@ -88478,7 +89655,7 @@ func renameColumnIdlistNames(tls *libc.TLS, pParse uintptr, pCtx uintptr, pIdLis
// Parse the SQL statement zSql using Parse object (*p). The Parse object
// is initialized by this function before it is used.
-func renameParseSql(tls *libc.TLS, p uintptr, zDb uintptr, db uintptr, zSql uintptr, bTemp int32) int32 { /* sqlite3.c:108503:12: */
+func renameParseSql(tls *libc.TLS, p uintptr, zDb uintptr, db uintptr, zSql uintptr, bTemp int32) int32 { /* sqlite3.c:109103:12: */
bp := tls.Alloc(4)
defer tls.Free(4)
@@ -88509,9 +89686,9 @@ func renameParseSql(tls *libc.TLS, p uintptr, zDb uintptr, db uintptr, zSql uint
if (*Sqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 {
rc = SQLITE_NOMEM
}
- if (((rc == SQLITE_OK) &&
- ((*Parse)(unsafe.Pointer(p)).FpNewTable == uintptr(0))) && ((*Parse)(unsafe.Pointer(p)).FpNewIndex == uintptr(0))) && ((*Parse)(unsafe.Pointer(p)).FpNewTrigger == uintptr(0)) {
- rc = Xsqlite3CorruptError(tls, 108530)
+ if rc == SQLITE_OK &&
+ (*Parse)(unsafe.Pointer(p)).FpNewTable == uintptr(0) && (*Parse)(unsafe.Pointer(p)).FpNewIndex == uintptr(0) && (*Parse)(unsafe.Pointer(p)).FpNewTrigger == uintptr(0) {
+ rc = Xsqlite3CorruptError(tls, 109130)
}
(*Sqlite3)(unsafe.Pointer(db)).Finit.FiDb = U8(0)
@@ -88525,7 +89702,7 @@ func renameParseSql(tls *libc.TLS, p uintptr, zDb uintptr, db uintptr, zSql uint
//
// Or, if an error occurs (i.e. an OOM condition), an error is left in
// pCtx and an SQLite error code returned.
-func renameEditSql(tls *libc.TLS, pCtx uintptr, pRename uintptr, zSql uintptr, zNew uintptr, bQuote int32) int32 { /* sqlite3.c:108558:12: */
+func renameEditSql(tls *libc.TLS, pCtx uintptr, pRename uintptr, zSql uintptr, zNew uintptr, bQuote int32) int32 { /* sqlite3.c:109158:12: */
bp := tls.Alloc(24)
defer tls.Free(24)
@@ -88545,19 +89722,19 @@ func renameEditSql(tls *libc.TLS, pCtx uintptr, pRename uintptr, zSql uintptr, z
// ALTER TABLE statement was quoted (bQuote==1), then set zNew to
// point to zQuot so that all substitutions are made using the
// quoted version of the new column name.
- zQuot = Xsqlite3MPrintf(tls, db, ts+9654 /* "\"%w\" " */, libc.VaList(bp, zNew))
+ zQuot = Xsqlite3MPrintf(tls, db, ts+10768 /* "\"%w\" " */, libc.VaList(bp, zNew))
if zQuot == uintptr(0) {
return SQLITE_NOMEM
} else {
- nQuot = (I64(Xsqlite3Strlen30(tls, zQuot) - 1))
+ nQuot = I64(Xsqlite3Strlen30(tls, zQuot) - 1)
}
- zOut = Xsqlite3DbMallocZero(tls, db, (uint64((nSql + (I64((*RenameCtx)(unsafe.Pointer(pRename)).FnList) * nQuot)) + int64(1))))
+ zOut = Xsqlite3DbMallocZero(tls, db, uint64(nSql+I64((*RenameCtx)(unsafe.Pointer(pRename)).FnList)*nQuot+int64(1)))
} else {
- zOut = Xsqlite3DbMallocZero(tls, db, (uint64(((nSql * int64(2)) + int64(1)) * int64(3))))
+ zOut = Xsqlite3DbMallocZero(tls, db, uint64((nSql*int64(2)+int64(1))*int64(3)))
if zOut != 0 {
- zBuf1 = (zOut + uintptr(((nSql * int64(2)) + int64(1))))
- zBuf2 = (zOut + uintptr(((nSql * int64(4)) + int64(2))))
+ zBuf1 = zOut + uintptr(nSql*int64(2)+int64(1))
+ zBuf2 = zOut + uintptr(nSql*int64(4)+int64(2))
}
}
@@ -88575,7 +89752,7 @@ func renameEditSql(tls *libc.TLS, pCtx uintptr, pRename uintptr, zSql uintptr, z
var pBest uintptr = renameColumnTokenNext(tls, pRename)
if zNew != 0 {
- if (bQuote == 0) && (Xsqlite3IsIdChar(tls, uint8(*(*uint8)(unsafe.Pointer((*RenameToken)(unsafe.Pointer(pBest)).Ft.Fz)))) != 0) {
+ if bQuote == 0 && Xsqlite3IsIdChar(tls, uint8(*(*uint8)(unsafe.Pointer((*RenameToken)(unsafe.Pointer(pBest)).Ft.Fz)))) != 0 {
nReplace = U32(nNew)
zReplace = zNew
} else {
@@ -88595,25 +89772,25 @@ func renameEditSql(tls *libc.TLS, pCtx uintptr, pRename uintptr, zSql uintptr, z
libc.Xmemcpy(tls, zBuf1, (*RenameToken)(unsafe.Pointer(pBest)).Ft.Fz, (*RenameToken)(unsafe.Pointer(pBest)).Ft.Fn)
*(*uint8)(unsafe.Pointer(zBuf1 + uintptr((*RenameToken)(unsafe.Pointer(pBest)).Ft.Fn))) = uint8(0)
Xsqlite3Dequote(tls, zBuf1)
- Xsqlite3_snprintf(tls, (int32(nSql * int64(2))), zBuf2, ts+9660 /* "%Q%s" */, libc.VaList(bp+8, zBuf1,
+ Xsqlite3_snprintf(tls, int32(nSql*int64(2)), zBuf2, ts+10774 /* "%Q%s" */, libc.VaList(bp+8, zBuf1,
func() uintptr {
if int32(*(*uint8)(unsafe.Pointer((*RenameToken)(unsafe.Pointer(pBest)).Ft.Fz + uintptr((*RenameToken)(unsafe.Pointer(pBest)).Ft.Fn)))) == '\'' {
- return ts + 9652 /* " " */
+ return ts + 10766 /* " " */
}
- return ts + 755 /* "" */
+ return ts + 1543 /* "" */
}()))
zReplace = zBuf2
nReplace = U32(Xsqlite3Strlen30(tls, zReplace))
}
- iOff = ((int32((*RenameToken)(unsafe.Pointer(pBest)).Ft.Fz) - int32(zSql)) / 1)
+ iOff = (int32((*RenameToken)(unsafe.Pointer(pBest)).Ft.Fz) - int32(zSql)) / 1
if (*RenameToken)(unsafe.Pointer(pBest)).Ft.Fn != nReplace {
- libc.Xmemmove(tls, (zOut + uintptr((U32(iOff) + nReplace))), (zOut + uintptr((uint32(iOff) + (*RenameToken)(unsafe.Pointer(pBest)).Ft.Fn))),
- (uint32(nOut) - (uint32(iOff) + (*RenameToken)(unsafe.Pointer(pBest)).Ft.Fn)))
+ libc.Xmemmove(tls, zOut+uintptr(U32(iOff)+nReplace), zOut+uintptr(uint32(iOff)+(*RenameToken)(unsafe.Pointer(pBest)).Ft.Fn),
+ uint32(nOut)-(uint32(iOff)+(*RenameToken)(unsafe.Pointer(pBest)).Ft.Fn))
nOut = int32(U32(nOut) + (nReplace - (*RenameToken)(unsafe.Pointer(pBest)).Ft.Fn))
*(*uint8)(unsafe.Pointer(zOut + uintptr(nOut))) = uint8(0)
}
- libc.Xmemcpy(tls, (zOut + uintptr(iOff)), zReplace, nReplace)
+ libc.Xmemcpy(tls, zOut+uintptr(iOff), zReplace, nReplace)
Xsqlite3DbFree(tls, db, pBest)
}
@@ -88631,7 +89808,7 @@ func renameEditSql(tls *libc.TLS, pCtx uintptr, pRename uintptr, zSql uintptr, z
// it was read from the schema of database zDb. Return SQLITE_OK if
// successful. Otherwise, return an SQLite error code and leave an error
// message in the Parse object.
-func renameResolveTrigger(tls *libc.TLS, pParse uintptr) int32 { /* sqlite3.c:108665:12: */
+func renameResolveTrigger(tls *libc.TLS, pParse uintptr) int32 { /* sqlite3.c:109265:12: */
bp := tls.Alloc(32)
defer tls.Free(32)
@@ -88655,29 +89832,29 @@ func renameResolveTrigger(tls *libc.TLS, pParse uintptr) int32 { /* sqlite3.c:10
}
// Resolve symbols in WHEN clause
- if (rc == SQLITE_OK) && ((*Trigger)(unsafe.Pointer(pNew)).FpWhen != 0) {
+ if rc == SQLITE_OK && (*Trigger)(unsafe.Pointer(pNew)).FpWhen != 0 {
rc = Xsqlite3ResolveExprNames(tls, bp /* &sNC */, (*Trigger)(unsafe.Pointer(pNew)).FpWhen)
}
- for pStep = (*Trigger)(unsafe.Pointer(pNew)).Fstep_list; (rc == SQLITE_OK) && (pStep != 0); pStep = (*TriggerStep)(unsafe.Pointer(pStep)).FpNext {
+ for pStep = (*Trigger)(unsafe.Pointer(pNew)).Fstep_list; rc == SQLITE_OK && pStep != 0; pStep = (*TriggerStep)(unsafe.Pointer(pStep)).FpNext {
if (*TriggerStep)(unsafe.Pointer(pStep)).FpSelect != 0 {
Xsqlite3SelectPrep(tls, pParse, (*TriggerStep)(unsafe.Pointer(pStep)).FpSelect, bp /* &sNC */)
if (*Parse)(unsafe.Pointer(pParse)).FnErr != 0 {
rc = (*Parse)(unsafe.Pointer(pParse)).Frc
}
}
- if (rc == SQLITE_OK) && ((*TriggerStep)(unsafe.Pointer(pStep)).FzTarget != 0) {
+ if rc == SQLITE_OK && (*TriggerStep)(unsafe.Pointer(pStep)).FzTarget != 0 {
var pSrc uintptr = Xsqlite3TriggerStepSrc(tls, pParse, pStep)
if pSrc != 0 {
var i int32
- for i = 0; (i < (*SrcList)(unsafe.Pointer(pSrc)).FnSrc) && (rc == SQLITE_OK); i++ {
- var p uintptr = ((pSrc + 8 /* &.a */) + uintptr(i)*72)
+ for i = 0; i < (*SrcList)(unsafe.Pointer(pSrc)).FnSrc && rc == SQLITE_OK; i++ {
+ var p uintptr = pSrc + 8 + uintptr(i)*72
(*SrcItem)(unsafe.Pointer(p)).FiCursor = libc.PostIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnTab, 1)
if (*SrcItem)(unsafe.Pointer(p)).FpSelect != 0 {
Xsqlite3SelectPrep(tls, pParse, (*SrcItem)(unsafe.Pointer(p)).FpSelect, uintptr(0))
Xsqlite3ExpandSubquery(tls, pParse, p)
- Xsqlite3SelectPrep(tls, pParse, (*SrcItem)(unsafe.Pointer(((*TriggerStep)(unsafe.Pointer(pStep)).FpFrom+8 /* &.a */)+uintptr((i-1))*72)).FpSelect, uintptr(0))
+ Xsqlite3SelectPrep(tls, pParse, (*SrcItem)(unsafe.Pointer((*TriggerStep)(unsafe.Pointer(pStep)).FpFrom+8+uintptr(i-1)*72)).FpSelect, uintptr(0))
} else {
(*SrcItem)(unsafe.Pointer(p)).FpTab = Xsqlite3LocateTableItem(tls, pParse, uint32(0), p)
if (*SrcItem)(unsafe.Pointer(p)).FpTab == uintptr(0) {
@@ -88688,18 +89865,21 @@ func renameResolveTrigger(tls *libc.TLS, pParse uintptr) int32 { /* sqlite3.c:10
}
}
}
+ if rc == SQLITE_OK && (*Sqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 {
+ rc = SQLITE_NOMEM
+ }
(*NameContext)(unsafe.Pointer(bp /* &sNC */)).FpSrcList = pSrc
- if (rc == SQLITE_OK) && ((*TriggerStep)(unsafe.Pointer(pStep)).FpWhere != 0) {
+ if rc == SQLITE_OK && (*TriggerStep)(unsafe.Pointer(pStep)).FpWhere != 0 {
rc = Xsqlite3ResolveExprNames(tls, bp /* &sNC */, (*TriggerStep)(unsafe.Pointer(pStep)).FpWhere)
}
if rc == SQLITE_OK {
rc = Xsqlite3ResolveExprListNames(tls, bp /* &sNC */, (*TriggerStep)(unsafe.Pointer(pStep)).FpExprList)
}
- if ((*TriggerStep)(unsafe.Pointer(pStep)).FpUpsert != 0) && (rc == SQLITE_OK) {
+ if (*TriggerStep)(unsafe.Pointer(pStep)).FpUpsert != 0 && rc == SQLITE_OK {
var pUpsert uintptr = (*TriggerStep)(unsafe.Pointer(pStep)).FpUpsert
(*Upsert)(unsafe.Pointer(pUpsert)).FpUpsertSrc = pSrc
- *(*uintptr)(unsafe.Pointer(bp /* &sNC */ + 8 /* &.uNC */)) = pUpsert
+ *(*uintptr)(unsafe.Pointer(bp + 8)) = pUpsert
(*NameContext)(unsafe.Pointer(bp /* &sNC */)).FncFlags = NC_UUpsert
rc = Xsqlite3ResolveExprListNames(tls, bp /* &sNC */, (*Upsert)(unsafe.Pointer(pUpsert)).FpUpsertTarget)
if rc == SQLITE_OK {
@@ -88726,7 +89906,7 @@ func renameResolveTrigger(tls *libc.TLS, pParse uintptr) int32 { /* sqlite3.c:10
// Invoke sqlite3WalkExpr() or sqlite3WalkSelect() on all Select or Expr
// objects that are part of the trigger passed as the second argument.
-func renameWalkTrigger(tls *libc.TLS, pWalker uintptr, pTrigger uintptr) { /* sqlite3.c:108758:13: */
+func renameWalkTrigger(tls *libc.TLS, pWalker uintptr, pTrigger uintptr) { /* sqlite3.c:109361:13: */
var pStep uintptr
// Find tokens to edit in WHEN clause
@@ -88747,7 +89927,7 @@ func renameWalkTrigger(tls *libc.TLS, pWalker uintptr, pTrigger uintptr) { /* sq
if (*TriggerStep)(unsafe.Pointer(pStep)).FpFrom != 0 {
var i int32
for i = 0; i < (*SrcList)(unsafe.Pointer((*TriggerStep)(unsafe.Pointer(pStep)).FpFrom)).FnSrc; i++ {
- Xsqlite3WalkSelect(tls, pWalker, (*SrcItem)(unsafe.Pointer(((*TriggerStep)(unsafe.Pointer(pStep)).FpFrom+8 /* &.a */)+uintptr(i)*72)).FpSelect)
+ Xsqlite3WalkSelect(tls, pWalker, (*SrcItem)(unsafe.Pointer((*TriggerStep)(unsafe.Pointer(pStep)).FpFrom+8+uintptr(i)*72)).FpSelect)
}
}
}
@@ -88755,14 +89935,14 @@ func renameWalkTrigger(tls *libc.TLS, pWalker uintptr, pTrigger uintptr) { /* sq
// Free the contents of Parse object (*pParse). Do not free the memory
// occupied by the Parse object itself.
-func renameParseCleanup(tls *libc.TLS, pParse uintptr) { /* sqlite3.c:108789:13: */
+func renameParseCleanup(tls *libc.TLS, pParse uintptr) { /* sqlite3.c:109392:13: */
var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb
var pIdx uintptr
if (*Parse)(unsafe.Pointer(pParse)).FpVdbe != 0 {
Xsqlite3VdbeFinalize(tls, (*Parse)(unsafe.Pointer(pParse)).FpVdbe)
}
Xsqlite3DeleteTable(tls, db, (*Parse)(unsafe.Pointer(pParse)).FpNewTable)
- for (libc.AssignUintptr(&pIdx, (*Parse)(unsafe.Pointer(pParse)).FpNewIndex)) != uintptr(0) {
+ for libc.AssignUintptr(&pIdx, (*Parse)(unsafe.Pointer(pParse)).FpNewIndex) != uintptr(0) {
(*Parse)(unsafe.Pointer(pParse)).FpNewIndex = (*Index)(unsafe.Pointer(pIdx)).FpNext
Xsqlite3FreeIndex(tls, db, pIdx)
}
@@ -88793,9 +89973,9 @@ func renameParseCleanup(tls *libc.TLS, pParse uintptr) { /* sqlite3.c:108789:13:
// This function is used internally by the ALTER TABLE RENAME COLUMN command.
// It is only accessible to SQL created using sqlite3NestedParse(). It is
// not reachable from ordinary SQL passed into sqlite3_prepare().
-func renameColumnFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintptr) { /* sqlite3.c:108829:13: */
- bp := tls.Alloc(320)
- defer tls.Free(320)
+func renameColumnFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintptr) { /* sqlite3.c:109432:13: */
+ bp := tls.Alloc(316)
+ defer tls.Free(316)
var db uintptr
// var sCtx RenameCtx at bp, 20
@@ -88809,18 +89989,19 @@ func renameColumnFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintpt
var bTemp int32
var zOld uintptr
var rc int32
- // var sParse Parse at bp+20, 272
+ // var sParse Parse at bp+20, 268
- // var sWalker Walker at bp+292, 28
+ // var sWalker Walker at bp+288, 28
var pIdx uintptr
var i int32
var pTab uintptr
var xAuth Sqlite3_xauth
+ var pSelect uintptr
+ var pExpr uintptr
// A regular table
var bFKOnly int32
var pFKey uintptr
- var pSelect uintptr
var pUpsertSet uintptr
var pTarget uintptr
// A trigger
@@ -88862,14 +90043,14 @@ __4:
;
Xsqlite3BtreeEnterAll(tls, db)
pTab = Xsqlite3FindTable(tls, db, zTable, zDb)
- if !((pTab == uintptr(0)) || (iCol >= int32((*Table)(unsafe.Pointer(pTab)).FnCol))) {
+ if !(pTab == uintptr(0) || iCol >= int32((*Table)(unsafe.Pointer(pTab)).FnCol)) {
goto __5
}
Xsqlite3BtreeLeaveAll(tls, db)
return
__5:
;
- zOld = (*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FaCol + uintptr(iCol)*20)).FzName
+ zOld = (*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FaCol + uintptr(iCol)*16)).FzCnName
libc.Xmemset(tls, bp /* &sCtx */, 0, uint32(unsafe.Sizeof(RenameCtx{})))
(*RenameCtx)(unsafe.Pointer(bp /* &sCtx */)).FiCol = func() int32 {
if iCol == int32((*Table)(unsafe.Pointer(pTab)).FiPKey) {
@@ -88882,15 +90063,15 @@ __5:
rc = renameParseSql(tls, bp+20 /* &sParse */, zDb, db, zSql, bTemp)
// Find tokens that need to be replaced.
- libc.Xmemset(tls, bp+292 /* &sWalker */, 0, uint32(unsafe.Sizeof(Walker{})))
- (*Walker)(unsafe.Pointer(bp + 292 /* &sWalker */)).FpParse = bp + 20 /* &sParse */
- (*Walker)(unsafe.Pointer(bp + 292 /* &sWalker */)).FxExprCallback = *(*uintptr)(unsafe.Pointer(&struct {
+ libc.Xmemset(tls, bp+288 /* &sWalker */, 0, uint32(unsafe.Sizeof(Walker{})))
+ (*Walker)(unsafe.Pointer(bp + 288 /* &sWalker */)).FpParse = bp + 20 /* &sParse */
+ (*Walker)(unsafe.Pointer(bp + 288 /* &sWalker */)).FxExprCallback = *(*uintptr)(unsafe.Pointer(&struct {
f func(*libc.TLS, uintptr, uintptr) int32
}{renameColumnExprCb}))
- (*Walker)(unsafe.Pointer(bp + 292 /* &sWalker */)).FxSelectCallback = *(*uintptr)(unsafe.Pointer(&struct {
+ (*Walker)(unsafe.Pointer(bp + 288 /* &sWalker */)).FxSelectCallback = *(*uintptr)(unsafe.Pointer(&struct {
f func(*libc.TLS, uintptr, uintptr) int32
}{renameColumnSelectCb}))
- *(*uintptr)(unsafe.Pointer(bp + 292 /* &sWalker */ + 24 /* &.u */)) = bp /* &sCtx */
+ *(*uintptr)(unsafe.Pointer(bp + 288 + 24)) = bp /* &sCtx */
(*RenameCtx)(unsafe.Pointer(bp /* &sCtx */)).FpTab = pTab
if !(rc != SQLITE_OK) {
@@ -88899,26 +90080,26 @@ __5:
goto renameColumnFunc_done
__6:
;
- if !((*Parse)(unsafe.Pointer(bp+20 /* &sParse */)).FpNewTable != 0) {
+ if !((*Parse)(unsafe.Pointer(bp+20)).FpNewTable != 0) {
goto __7
}
- pSelect = (*Table)(unsafe.Pointer((*Parse)(unsafe.Pointer(bp + 20 /* &sParse */)).FpNewTable)).FpSelect
- if !(pSelect != 0) {
+ if !(int32((*Table)(unsafe.Pointer((*Parse)(unsafe.Pointer(bp+20)).FpNewTable)).FeTabType) == TABTYP_VIEW) {
goto __9
}
- *(*U32)(unsafe.Pointer(pSelect + 4 /* &.selFlags */)) &= (libc.Uint32FromInt32(libc.CplInt32(SF_View)))
+ pSelect = *(*uintptr)(unsafe.Pointer((*Parse)(unsafe.Pointer(bp+20)).FpNewTable + 44))
+ *(*U32)(unsafe.Pointer(pSelect + 4)) &= libc.Uint32FromInt32(libc.CplInt32(SF_View))
(*Parse)(unsafe.Pointer(bp + 20 /* &sParse */)).Frc = SQLITE_OK
Xsqlite3SelectPrep(tls, bp+20 /* &sParse */, pSelect, uintptr(0))
rc = func() int32 {
if (*Sqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 {
return SQLITE_NOMEM
}
- return (*Parse)(unsafe.Pointer(bp + 20 /* &sParse */)).Frc
+ return (*Parse)(unsafe.Pointer(bp + 20)).Frc
}()
if !(rc == SQLITE_OK) {
goto __11
}
- Xsqlite3WalkSelect(tls, bp+292 /* &sWalker */, pSelect)
+ Xsqlite3WalkSelect(tls, bp+288 /* &sWalker */, pSelect)
__11:
;
if !(rc != SQLITE_OK) {
@@ -88929,169 +90110,175 @@ __12:
;
goto __10
__9:
+ if !(int32((*Table)(unsafe.Pointer((*Parse)(unsafe.Pointer(bp+20)).FpNewTable)).FeTabType) == TABTYP_NORM) {
+ goto __13
+ }
// A regular table
bFKOnly = Xsqlite3_stricmp(tls, zTable, (*Table)(unsafe.Pointer((*Parse)(unsafe.Pointer(bp+20 /* &sParse */)).FpNewTable)).FzName)
-
(*RenameCtx)(unsafe.Pointer(bp /* &sCtx */)).FpTab = (*Parse)(unsafe.Pointer(bp + 20 /* &sParse */)).FpNewTable
if !(bFKOnly == 0) {
- goto __13
- }
- if !(iCol < int32((*Table)(unsafe.Pointer((*Parse)(unsafe.Pointer(bp+20 /* &sParse */)).FpNewTable)).FnCol)) {
goto __14
}
- renameTokenFind(tls,
- bp+20 /* &sParse */, bp /* &sCtx */, (*Column)(unsafe.Pointer((*Table)(unsafe.Pointer((*Parse)(unsafe.Pointer(bp+20 /* &sParse */)).FpNewTable)).FaCol+uintptr(iCol)*20)).FzName)
-__14:
- ;
- if !((*RenameCtx)(unsafe.Pointer(bp /* &sCtx */)).FiCol < 0) {
+ if !(iCol < int32((*Table)(unsafe.Pointer((*Parse)(unsafe.Pointer(bp+20)).FpNewTable)).FnCol)) {
goto __15
}
- renameTokenFind(tls, bp+20 /* &sParse */, bp /* &sCtx */, ((*Parse)(unsafe.Pointer(bp+20 /* &sParse */)).FpNewTable + 40 /* &.iPKey */))
+ renameTokenFind(tls,
+ bp+20 /* &sParse */, bp /* &sCtx */, (*Column)(unsafe.Pointer((*Table)(unsafe.Pointer((*Parse)(unsafe.Pointer(bp+20 /* &sParse */)).FpNewTable)).FaCol+uintptr(iCol)*16)).FzCnName)
__15:
;
- Xsqlite3WalkExprList(tls, bp+292 /* &sWalker */, (*Table)(unsafe.Pointer((*Parse)(unsafe.Pointer(bp+20 /* &sParse */)).FpNewTable)).FpCheck)
- pIdx = (*Table)(unsafe.Pointer((*Parse)(unsafe.Pointer(bp + 20 /* &sParse */)).FpNewTable)).FpIndex
+ if !((*RenameCtx)(unsafe.Pointer(bp)).FiCol < 0) {
+ goto __16
+ }
+ renameTokenFind(tls, bp+20 /* &sParse */, bp /* &sCtx */, (*Parse)(unsafe.Pointer(bp+20)).FpNewTable+32)
__16:
+ ;
+ Xsqlite3WalkExprList(tls, bp+288 /* &sWalker */, (*Table)(unsafe.Pointer((*Parse)(unsafe.Pointer(bp+20 /* &sParse */)).FpNewTable)).FpCheck)
+ pIdx = (*Table)(unsafe.Pointer((*Parse)(unsafe.Pointer(bp + 20 /* &sParse */)).FpNewTable)).FpIndex
+__17:
if !(pIdx != 0) {
- goto __18
+ goto __19
}
- Xsqlite3WalkExprList(tls, bp+292 /* &sWalker */, (*Index)(unsafe.Pointer(pIdx)).FaColExpr)
- goto __17
-__17:
- pIdx = (*Index)(unsafe.Pointer(pIdx)).FpNext
- goto __16
+ Xsqlite3WalkExprList(tls, bp+288 /* &sWalker */, (*Index)(unsafe.Pointer(pIdx)).FaColExpr)
goto __18
__18:
+ pIdx = (*Index)(unsafe.Pointer(pIdx)).FpNext
+ goto __17
+ goto __19
+__19:
;
pIdx = (*Parse)(unsafe.Pointer(bp + 20 /* &sParse */)).FpNewIndex
-__19:
+__20:
if !(pIdx != 0) {
- goto __21
+ goto __22
}
- Xsqlite3WalkExprList(tls, bp+292 /* &sWalker */, (*Index)(unsafe.Pointer(pIdx)).FaColExpr)
- goto __20
-__20:
- pIdx = (*Index)(unsafe.Pointer(pIdx)).FpNext
- goto __19
+ Xsqlite3WalkExprList(tls, bp+288 /* &sWalker */, (*Index)(unsafe.Pointer(pIdx)).FaColExpr)
goto __21
__21:
+ pIdx = (*Index)(unsafe.Pointer(pIdx)).FpNext
+ goto __20
+ goto __22
+__22:
;
i = 0
-__22:
- if !(i < int32((*Table)(unsafe.Pointer((*Parse)(unsafe.Pointer(bp+20 /* &sParse */)).FpNewTable)).FnCol)) {
- goto __24
- }
- Xsqlite3WalkExpr(tls, bp+292 /* &sWalker */, (*Column)(unsafe.Pointer((*Table)(unsafe.Pointer((*Parse)(unsafe.Pointer(bp+20 /* &sParse */)).FpNewTable)).FaCol+uintptr(i)*20)).FpDflt)
- goto __23
__23:
- i++
- goto __22
+ if !(i < int32((*Table)(unsafe.Pointer((*Parse)(unsafe.Pointer(bp+20)).FpNewTable)).FnCol)) {
+ goto __25
+ }
+ pExpr = Xsqlite3ColumnExpr(tls, (*Parse)(unsafe.Pointer(bp+20 /* &sParse */)).FpNewTable,
+ (*Table)(unsafe.Pointer((*Parse)(unsafe.Pointer(bp+20)).FpNewTable)).FaCol+uintptr(i)*16)
+ Xsqlite3WalkExpr(tls, bp+288 /* &sWalker */, pExpr)
goto __24
__24:
+ i++
+ goto __23
+ goto __25
+__25:
;
-__13:
+__14:
;
- pFKey = (*Table)(unsafe.Pointer((*Parse)(unsafe.Pointer(bp + 20 /* &sParse */)).FpNewTable)).FpFKey
-__25:
+ pFKey = *(*uintptr)(unsafe.Pointer((*Parse)(unsafe.Pointer(bp+20)).FpNewTable + 44 + 4 /* &.pFKey */))
+__26:
if !(pFKey != 0) {
- goto __27
+ goto __28
}
i = 0
-__28:
+__29:
if !(i < (*FKey)(unsafe.Pointer(pFKey)).FnCol) {
- goto __30
- }
- if !((bFKOnly == 0) && ((*sColMap)(unsafe.Pointer((pFKey+36 /* &.aCol */)+uintptr(i)*8)).FiFrom == iCol)) {
goto __31
}
- renameTokenFind(tls, bp+20 /* &sParse */, bp /* &sCtx */, ((pFKey + 36 /* &.aCol */) + uintptr(i)*8))
-__31:
- ;
- if !((0 == Xsqlite3_stricmp(tls, (*FKey)(unsafe.Pointer(pFKey)).FzTo, zTable)) &&
- (0 == Xsqlite3_stricmp(tls, (*sColMap)(unsafe.Pointer((pFKey+36 /* &.aCol */)+uintptr(i)*8)).FzCol, zOld))) {
+ if !(bFKOnly == 0 && (*sColMap)(unsafe.Pointer(pFKey+36+uintptr(i)*8)).FiFrom == iCol) {
goto __32
}
- renameTokenFind(tls, bp+20 /* &sParse */, bp /* &sCtx */, (*sColMap)(unsafe.Pointer((pFKey+36 /* &.aCol */)+uintptr(i)*8)).FzCol)
+ renameTokenFind(tls, bp+20 /* &sParse */, bp /* &sCtx */, pFKey+36+uintptr(i)*8)
__32:
;
- goto __29
-__29:
- i++
- goto __28
+ if !(0 == Xsqlite3_stricmp(tls, (*FKey)(unsafe.Pointer(pFKey)).FzTo, zTable) &&
+ 0 == Xsqlite3_stricmp(tls, (*sColMap)(unsafe.Pointer(pFKey+36+uintptr(i)*8)).FzCol, zOld)) {
+ goto __33
+ }
+ renameTokenFind(tls, bp+20 /* &sParse */, bp /* &sCtx */, (*sColMap)(unsafe.Pointer(pFKey+36+uintptr(i)*8)).FzCol)
+__33:
+ ;
goto __30
__30:
+ i++
+ goto __29
+ goto __31
+__31:
;
- goto __26
-__26:
- pFKey = (*FKey)(unsafe.Pointer(pFKey)).FpNextFrom
- goto __25
goto __27
__27:
+ pFKey = (*FKey)(unsafe.Pointer(pFKey)).FpNextFrom
+ goto __26
+ goto __28
+__28:
+ ;
+__13:
;
__10:
;
goto __8
__7:
- if !((*Parse)(unsafe.Pointer(bp+20 /* &sParse */)).FpNewIndex != 0) {
- goto __33
+ if !((*Parse)(unsafe.Pointer(bp+20)).FpNewIndex != 0) {
+ goto __34
}
- Xsqlite3WalkExprList(tls, bp+292 /* &sWalker */, (*Index)(unsafe.Pointer((*Parse)(unsafe.Pointer(bp+20 /* &sParse */)).FpNewIndex)).FaColExpr)
- Xsqlite3WalkExpr(tls, bp+292 /* &sWalker */, (*Index)(unsafe.Pointer((*Parse)(unsafe.Pointer(bp+20 /* &sParse */)).FpNewIndex)).FpPartIdxWhere)
- goto __34
-__33:
+ Xsqlite3WalkExprList(tls, bp+288 /* &sWalker */, (*Index)(unsafe.Pointer((*Parse)(unsafe.Pointer(bp+20 /* &sParse */)).FpNewIndex)).FaColExpr)
+ Xsqlite3WalkExpr(tls, bp+288 /* &sWalker */, (*Index)(unsafe.Pointer((*Parse)(unsafe.Pointer(bp+20 /* &sParse */)).FpNewIndex)).FpPartIdxWhere)
+ goto __35
+__34:
rc = renameResolveTrigger(tls, bp+20 /* &sParse */)
if !(rc != SQLITE_OK) {
- goto __35
+ goto __36
}
goto renameColumnFunc_done
-__35:
+__36:
;
pStep = (*Trigger)(unsafe.Pointer((*Parse)(unsafe.Pointer(bp + 20 /* &sParse */)).FpNewTrigger)).Fstep_list
-__36:
+__37:
if !(pStep != 0) {
- goto __38
+ goto __39
}
if !((*TriggerStep)(unsafe.Pointer(pStep)).FzTarget != 0) {
- goto __39
+ goto __40
}
pTarget = Xsqlite3LocateTable(tls, bp+20 /* &sParse */, uint32(0), (*TriggerStep)(unsafe.Pointer(pStep)).FzTarget, zDb)
if !(pTarget == pTab) {
- goto __40
+ goto __41
}
if !((*TriggerStep)(unsafe.Pointer(pStep)).FpUpsert != 0) {
- goto __41
+ goto __42
}
pUpsertSet = (*Upsert)(unsafe.Pointer((*TriggerStep)(unsafe.Pointer(pStep)).FpUpsert)).FpUpsertSet
renameColumnElistNames(tls, bp+20 /* &sParse */, bp /* &sCtx */, pUpsertSet, zOld)
-__41:
+__42:
;
renameColumnIdlistNames(tls, bp+20 /* &sParse */, bp /* &sCtx */, (*TriggerStep)(unsafe.Pointer(pStep)).FpIdList, zOld)
renameColumnElistNames(tls, bp+20 /* &sParse */, bp /* &sCtx */, (*TriggerStep)(unsafe.Pointer(pStep)).FpExprList, zOld)
-__40:
+__41:
;
-__39:
+__40:
;
- goto __37
-__37:
- pStep = (*TriggerStep)(unsafe.Pointer(pStep)).FpNext
- goto __36
goto __38
__38:
+ pStep = (*TriggerStep)(unsafe.Pointer(pStep)).FpNext
+ goto __37
+ goto __39
+__39:
;
// Find tokens to edit in UPDATE OF clause
- if !((*Parse)(unsafe.Pointer(bp+20 /* &sParse */)).FpTriggerTab == pTab) {
- goto __42
+ if !((*Parse)(unsafe.Pointer(bp+20)).FpTriggerTab == pTab) {
+ goto __43
}
renameColumnIdlistNames(tls, bp+20 /* &sParse */, bp /* &sCtx */, (*Trigger)(unsafe.Pointer((*Parse)(unsafe.Pointer(bp+20 /* &sParse */)).FpNewTrigger)).FpColumns, zOld)
-__42:
+__43:
;
// Find tokens to edit in various expressions and selects
- renameWalkTrigger(tls, bp+292 /* &sWalker */, (*Parse)(unsafe.Pointer(bp+20 /* &sParse */)).FpNewTrigger)
-__34:
+ renameWalkTrigger(tls, bp+288 /* &sWalker */, (*Parse)(unsafe.Pointer(bp+20 /* &sParse */)).FpNewTrigger)
+__35:
;
__8:
;
@@ -89100,18 +90287,18 @@ __8:
renameColumnFunc_done:
if !(rc != SQLITE_OK) {
- goto __43
- }
- if !((*Parse)(unsafe.Pointer(bp+20 /* &sParse */)).FzErrMsg != 0) {
goto __44
}
- renameColumnParseError(tls, context, ts+755 /* "" */, *(*uintptr)(unsafe.Pointer(argv + 1*4)), *(*uintptr)(unsafe.Pointer(argv + 2*4)), bp+20 /* &sParse */)
- goto __45
-__44:
- Xsqlite3_result_error_code(tls, context, rc)
+ if !((*Parse)(unsafe.Pointer(bp+20)).FzErrMsg != 0) {
+ goto __45
+ }
+ renameColumnParseError(tls, context, ts+1543 /* "" */, *(*uintptr)(unsafe.Pointer(argv + 1*4)), *(*uintptr)(unsafe.Pointer(argv + 2*4)), bp+20 /* &sParse */)
+ goto __46
__45:
+ Xsqlite3_result_error_code(tls, context, rc)
+__46:
;
-__43:
+__44:
;
renameParseCleanup(tls, bp+20 /* &sParse */)
@@ -89121,20 +90308,22 @@ __43:
}
// Walker expression callback used by "RENAME TABLE".
-func renameTableExprCb(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 { /* sqlite3.c:108992:12: */
- var p uintptr = *(*uintptr)(unsafe.Pointer(pWalker + 24 /* &.u */))
- if (int32((*Expr)(unsafe.Pointer(pExpr)).Fop) == TK_COLUMN) && ((*RenameCtx)(unsafe.Pointer(p)).FpTab == *(*uintptr)(unsafe.Pointer(pExpr + 44 /* &.y */))) {
- renameTokenFind(tls, (*Walker)(unsafe.Pointer(pWalker)).FpParse, p, (pExpr + 44 /* &.y */ /* &.pTab */))
+func renameTableExprCb(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 { /* sqlite3.c:109597:12: */
+ var p uintptr = *(*uintptr)(unsafe.Pointer(pWalker + 24))
+ if int32((*Expr)(unsafe.Pointer(pExpr)).Fop) == TK_COLUMN &&
+ (*Expr)(unsafe.Pointer(pExpr)).Fflags&U32(EP_WinFunc|EP_Subrtn) == U32(0) &&
+ (*RenameCtx)(unsafe.Pointer(p)).FpTab == *(*uintptr)(unsafe.Pointer(pExpr + 44)) {
+ renameTokenFind(tls, (*Walker)(unsafe.Pointer(pWalker)).FpParse, p, pExpr+44)
}
return WRC_Continue
}
// Walker select callback used by "RENAME TABLE".
-func renameTableSelectCb(tls *libc.TLS, pWalker uintptr, pSelect uintptr) int32 { /* sqlite3.c:109003:12: */
+func renameTableSelectCb(tls *libc.TLS, pWalker uintptr, pSelect uintptr) int32 { /* sqlite3.c:109611:12: */
var i int32
- var p uintptr = *(*uintptr)(unsafe.Pointer(pWalker + 24 /* &.u */))
+ var p uintptr = *(*uintptr)(unsafe.Pointer(pWalker + 24))
var pSrc uintptr = (*Select)(unsafe.Pointer(pSelect)).FpSrc
- if ((*Select)(unsafe.Pointer(pSelect)).FselFlags & (U32(SF_View | SF_CopyCte))) != 0 {
+ if (*Select)(unsafe.Pointer(pSelect)).FselFlags&U32(SF_View|SF_CopyCte) != 0 {
return WRC_Prune
}
@@ -89143,7 +90332,7 @@ func renameTableSelectCb(tls *libc.TLS, pWalker uintptr, pSelect uintptr) int32
return WRC_Abort
}
for i = 0; i < (*SrcList)(unsafe.Pointer(pSrc)).FnSrc; i++ {
- var pItem uintptr = ((pSrc + 8 /* &.a */) + uintptr(i)*72)
+ var pItem uintptr = pSrc + 8 + uintptr(i)*72
if (*SrcItem)(unsafe.Pointer(pItem)).FpTab == (*RenameCtx)(unsafe.Pointer(p)).FpTab {
renameTokenFind(tls, (*Walker)(unsafe.Pointer(pWalker)).FpParse, p, (*SrcItem)(unsafe.Pointer(pItem)).FzName)
}
@@ -89170,9 +90359,9 @@ func renameTableSelectCb(tls *libc.TLS, pWalker uintptr, pSelect uintptr) int32
//
// sqlite_rename_table('main', 'CREATE TABLE t1(a REFERENCES t2)','t2','t3',0)
// -> 'CREATE TABLE t1(a REFERENCES t3)'
-func renameTableFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintptr) { /* sqlite3.c:109047:13: */
- bp := tls.Alloc(352)
- defer tls.Free(352)
+func renameTableFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintptr) { /* sqlite3.c:109655:13: */
+ bp := tls.Alloc(348)
+ defer tls.Free(348)
var db uintptr = Xsqlite3_context_db_handle(tls, context)
var zDb uintptr = Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv)))
@@ -89182,8 +90371,8 @@ func renameTableFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintptr
var bTemp int32 = Xsqlite3_value_int(tls, *(*uintptr)(unsafe.Pointer(argv + 6*4)))
_ = NotUsed
- if ((zInput != 0) && (zOld != 0)) && (zNew != 0) {
- // var sParse Parse at bp+48, 272
+ if zInput != 0 && zOld != 0 && zNew != 0 {
+ // var sParse Parse at bp+48, 268
var rc int32
var bQuote int32 = 1
@@ -89206,36 +90395,38 @@ func renameTableFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintptr
(*Walker)(unsafe.Pointer(bp + 20 /* &sWalker */)).FxSelectCallback = *(*uintptr)(unsafe.Pointer(&struct {
f func(*libc.TLS, uintptr, uintptr) int32
}{renameTableSelectCb}))
- *(*uintptr)(unsafe.Pointer(bp + 20 /* &sWalker */ + 24 /* &.u */)) = bp /* &sCtx */
+ *(*uintptr)(unsafe.Pointer(bp + 20 + 24)) = bp /* &sCtx */
rc = renameParseSql(tls, bp+48 /* &sParse */, zDb, db, zInput, bTemp)
if rc == SQLITE_OK {
- var isLegacy int32 = (int32((*Sqlite3)(unsafe.Pointer(db)).Fflags & uint64(SQLITE_LegacyAlter)))
- if (*Parse)(unsafe.Pointer(bp+48 /* &sParse */)).FpNewTable != 0 {
+ var isLegacy int32 = int32((*Sqlite3)(unsafe.Pointer(db)).Fflags & uint64(SQLITE_LegacyAlter))
+ if (*Parse)(unsafe.Pointer(bp+48)).FpNewTable != 0 {
var pTab uintptr = (*Parse)(unsafe.Pointer(bp + 48 /* &sParse */)).FpNewTable
- if (*Table)(unsafe.Pointer(pTab)).FpSelect != 0 {
+ if int32((*Table)(unsafe.Pointer(pTab)).FeTabType) == TABTYP_VIEW {
if isLegacy == 0 {
- var pSelect uintptr = (*Table)(unsafe.Pointer(pTab)).FpSelect
- // var sNC NameContext at bp+320, 32
+ var pSelect uintptr = *(*uintptr)(unsafe.Pointer(pTab + 44))
+ // var sNC NameContext at bp+316, 32
- libc.Xmemset(tls, bp+320 /* &sNC */, 0, uint32(unsafe.Sizeof(NameContext{})))
- (*NameContext)(unsafe.Pointer(bp + 320 /* &sNC */)).FpParse = bp + 48 /* &sParse */
+ libc.Xmemset(tls, bp+316 /* &sNC */, 0, uint32(unsafe.Sizeof(NameContext{})))
+ (*NameContext)(unsafe.Pointer(bp + 316 /* &sNC */)).FpParse = bp + 48 /* &sParse */
- *(*U32)(unsafe.Pointer(pSelect + 4 /* &.selFlags */)) &= (libc.Uint32FromInt32(libc.CplInt32(SF_View)))
- Xsqlite3SelectPrep(tls, bp+48 /* &sParse */, (*Table)(unsafe.Pointer(pTab)).FpSelect, bp+320 /* &sNC */)
- if (*Parse)(unsafe.Pointer(bp+48 /* &sParse */)).FnErr != 0 {
+ *(*U32)(unsafe.Pointer(pSelect + 4)) &= libc.Uint32FromInt32(libc.CplInt32(SF_View))
+ Xsqlite3SelectPrep(tls, bp+48 /* &sParse */, *(*uintptr)(unsafe.Pointer(pTab + 44)), bp+316 /* &sNC */)
+ if (*Parse)(unsafe.Pointer(bp+48)).FnErr != 0 {
rc = (*Parse)(unsafe.Pointer(bp + 48 /* &sParse */)).Frc
} else {
- Xsqlite3WalkSelect(tls, bp+20 /* &sWalker */, (*Table)(unsafe.Pointer(pTab)).FpSelect)
+ Xsqlite3WalkSelect(tls, bp+20 /* &sWalker */, *(*uintptr)(unsafe.Pointer(pTab + 44)))
}
}
} else {
// Modify any FK definitions to point to the new table.
- if (isLegacy == 0) || (((*Sqlite3)(unsafe.Pointer(db)).Fflags & uint64(SQLITE_ForeignKeys)) != 0) {
+ if (isLegacy == 0 || (*Sqlite3)(unsafe.Pointer(db)).Fflags&uint64(SQLITE_ForeignKeys) != 0) &&
+ !(int32((*Table)(unsafe.Pointer(pTab)).FeTabType) == TABTYP_VTAB) {
var pFKey uintptr
- for pFKey = (*Table)(unsafe.Pointer(pTab)).FpFKey; pFKey != 0; pFKey = (*FKey)(unsafe.Pointer(pFKey)).FpNextFrom {
+
+ for pFKey = *(*uintptr)(unsafe.Pointer(pTab + 44 + 4 /* &.pFKey */)); pFKey != 0; pFKey = (*FKey)(unsafe.Pointer(pFKey)).FpNextFrom {
if Xsqlite3_stricmp(tls, (*FKey)(unsafe.Pointer(pFKey)).FzTo, zOld) == 0 {
renameTokenFind(tls, bp+48 /* &sParse */, bp /* &sCtx */, (*FKey)(unsafe.Pointer(pFKey)).FzTo)
}
@@ -89253,7 +90444,7 @@ func renameTableFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintptr
renameTokenFind(tls, bp+48 /* &sParse */, bp /* &sCtx */, (*Table)(unsafe.Pointer(pTab)).FzName)
}
}
- } else if (*Parse)(unsafe.Pointer(bp+48 /* &sParse */)).FpNewIndex != 0 {
+ } else if (*Parse)(unsafe.Pointer(bp+48)).FpNewIndex != 0 {
renameTokenFind(tls, bp+48 /* &sParse */, bp /* &sCtx */, (*Index)(unsafe.Pointer((*Parse)(unsafe.Pointer(bp+48 /* &sParse */)).FpNewIndex)).FzName)
if isLegacy == 0 {
Xsqlite3WalkExpr(tls, bp+20 /* &sWalker */, (*Index)(unsafe.Pointer((*Parse)(unsafe.Pointer(bp+48 /* &sParse */)).FpNewIndex)).FpPartIdxWhere)
@@ -89261,8 +90452,8 @@ func renameTableFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintptr
} else {
var pTrigger uintptr = (*Parse)(unsafe.Pointer(bp + 48 /* &sParse */)).FpNewTrigger
var pStep uintptr
- if (0 == Xsqlite3_stricmp(tls, (*Trigger)(unsafe.Pointer((*Parse)(unsafe.Pointer(bp+48 /* &sParse */)).FpNewTrigger)).Ftable, zOld)) &&
- ((*Table)(unsafe.Pointer((*RenameCtx)(unsafe.Pointer(bp /* &sCtx */)).FpTab)).FpSchema == (*Trigger)(unsafe.Pointer(pTrigger)).FpTabSchema) {
+ if 0 == Xsqlite3_stricmp(tls, (*Trigger)(unsafe.Pointer((*Parse)(unsafe.Pointer(bp+48)).FpNewTrigger)).Ftable, zOld) &&
+ (*Table)(unsafe.Pointer((*RenameCtx)(unsafe.Pointer(bp)).FpTab)).FpSchema == (*Trigger)(unsafe.Pointer(pTrigger)).FpTabSchema {
renameTokenFind(tls, bp+48 /* &sParse */, bp /* &sCtx */, (*Trigger)(unsafe.Pointer((*Parse)(unsafe.Pointer(bp+48 /* &sParse */)).FpNewTrigger)).Ftable)
}
@@ -89271,7 +90462,7 @@ func renameTableFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintptr
if rc == SQLITE_OK {
renameWalkTrigger(tls, bp+20 /* &sWalker */, pTrigger)
for pStep = (*Trigger)(unsafe.Pointer(pTrigger)).Fstep_list; pStep != 0; pStep = (*TriggerStep)(unsafe.Pointer(pStep)).FpNext {
- if ((*TriggerStep)(unsafe.Pointer(pStep)).FzTarget != 0) && (0 == Xsqlite3_stricmp(tls, (*TriggerStep)(unsafe.Pointer(pStep)).FzTarget, zOld)) {
+ if (*TriggerStep)(unsafe.Pointer(pStep)).FzTarget != 0 && 0 == Xsqlite3_stricmp(tls, (*TriggerStep)(unsafe.Pointer(pStep)).FzTarget, zOld) {
renameTokenFind(tls, bp+48 /* &sParse */, bp /* &sCtx */, (*TriggerStep)(unsafe.Pointer(pStep)).FzTarget)
}
}
@@ -89284,8 +90475,8 @@ func renameTableFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintptr
rc = renameEditSql(tls, context, bp /* &sCtx */, zInput, zNew, bQuote)
}
if rc != SQLITE_OK {
- if (*Parse)(unsafe.Pointer(bp+48 /* &sParse */)).FzErrMsg != 0 {
- renameColumnParseError(tls, context, ts+755 /* "" */, *(*uintptr)(unsafe.Pointer(argv + 1*4)), *(*uintptr)(unsafe.Pointer(argv + 2*4)), bp+48 /* &sParse */)
+ if (*Parse)(unsafe.Pointer(bp+48)).FzErrMsg != 0 {
+ renameColumnParseError(tls, context, ts+1543 /* "" */, *(*uintptr)(unsafe.Pointer(argv + 1*4)), *(*uintptr)(unsafe.Pointer(argv + 2*4)), bp+48 /* &sParse */)
} else {
Xsqlite3_result_error_code(tls, context, rc)
}
@@ -89300,9 +90491,9 @@ func renameTableFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintptr
return
}
-func renameQuotefixExprCb(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 { /* sqlite3.c:109185:12: */
- if (int32((*Expr)(unsafe.Pointer(pExpr)).Fop) == TK_STRING) && (((*Expr)(unsafe.Pointer(pExpr)).Fflags & U32(EP_DblQuoted)) != 0) {
- renameTokenFind(tls, (*Walker)(unsafe.Pointer(pWalker)).FpParse, *(*uintptr)(unsafe.Pointer(pWalker + 24 /* &.u */)), pExpr)
+func renameQuotefixExprCb(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 { /* sqlite3.c:109796:12: */
+ if int32((*Expr)(unsafe.Pointer(pExpr)).Fop) == TK_STRING && (*Expr)(unsafe.Pointer(pExpr)).Fflags&U32(EP_DblQuoted) != 0 {
+ renameTokenFind(tls, (*Walker)(unsafe.Pointer(pWalker)).FpParse, *(*uintptr)(unsafe.Pointer(pWalker + 24)), pExpr)
}
return WRC_Continue
}
@@ -89328,9 +90519,9 @@ func renameQuotefixExprCb(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 {
// returns the string:
//
// CREATE VIEW v1 AS SELECT "a", 'string' FROM t1
-func renameQuotefixFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintptr) { /* sqlite3.c:109215:13: */
- bp := tls.Alloc(320)
- defer tls.Free(320)
+func renameQuotefixFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintptr) { /* sqlite3.c:109826:13: */
+ bp := tls.Alloc(316)
+ defer tls.Free(316)
var db uintptr = Xsqlite3_context_db_handle(tls, context)
var zDb uintptr = Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv)))
@@ -89342,65 +90533,67 @@ func renameQuotefixFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uint
Xsqlite3BtreeEnterAll(tls, db)
_ = NotUsed
- if (zDb != 0) && (zInput != 0) {
+ if zDb != 0 && zInput != 0 {
var rc int32
- // var sParse Parse at bp, 272
+ // var sParse Parse at bp, 268
rc = renameParseSql(tls, bp /* &sParse */, zDb, db, zInput, 0)
if rc == SQLITE_OK {
- // var sCtx RenameCtx at bp+272, 20
+ // var sCtx RenameCtx at bp+268, 20
- // var sWalker Walker at bp+292, 28
+ // var sWalker Walker at bp+288, 28
// Walker to find tokens that need to be replaced.
- libc.Xmemset(tls, bp+272 /* &sCtx */, 0, uint32(unsafe.Sizeof(RenameCtx{})))
- libc.Xmemset(tls, bp+292 /* &sWalker */, 0, uint32(unsafe.Sizeof(Walker{})))
- (*Walker)(unsafe.Pointer(bp + 292 /* &sWalker */)).FpParse = bp /* &sParse */
- (*Walker)(unsafe.Pointer(bp + 292 /* &sWalker */)).FxExprCallback = *(*uintptr)(unsafe.Pointer(&struct {
+ libc.Xmemset(tls, bp+268 /* &sCtx */, 0, uint32(unsafe.Sizeof(RenameCtx{})))
+ libc.Xmemset(tls, bp+288 /* &sWalker */, 0, uint32(unsafe.Sizeof(Walker{})))
+ (*Walker)(unsafe.Pointer(bp + 288 /* &sWalker */)).FpParse = bp /* &sParse */
+ (*Walker)(unsafe.Pointer(bp + 288 /* &sWalker */)).FxExprCallback = *(*uintptr)(unsafe.Pointer(&struct {
f func(*libc.TLS, uintptr, uintptr) int32
}{renameQuotefixExprCb}))
- (*Walker)(unsafe.Pointer(bp + 292 /* &sWalker */)).FxSelectCallback = *(*uintptr)(unsafe.Pointer(&struct {
+ (*Walker)(unsafe.Pointer(bp + 288 /* &sWalker */)).FxSelectCallback = *(*uintptr)(unsafe.Pointer(&struct {
f func(*libc.TLS, uintptr, uintptr) int32
}{renameColumnSelectCb}))
- *(*uintptr)(unsafe.Pointer(bp + 292 /* &sWalker */ + 24 /* &.u */)) = bp + 272 /* &sCtx */
+ *(*uintptr)(unsafe.Pointer(bp + 288 + 24)) = bp + 268 /* &sCtx */
- if (*Parse)(unsafe.Pointer(bp /* &sParse */)).FpNewTable != 0 {
- var pSelect uintptr = (*Table)(unsafe.Pointer((*Parse)(unsafe.Pointer(bp /* &sParse */)).FpNewTable)).FpSelect
- if pSelect != 0 {
- *(*U32)(unsafe.Pointer(pSelect + 4 /* &.selFlags */)) &= (libc.Uint32FromInt32(libc.CplInt32(SF_View)))
+ if (*Parse)(unsafe.Pointer(bp)).FpNewTable != 0 {
+ if int32((*Table)(unsafe.Pointer((*Parse)(unsafe.Pointer(bp)).FpNewTable)).FeTabType) == TABTYP_VIEW {
+ var pSelect uintptr = *(*uintptr)(unsafe.Pointer((*Parse)(unsafe.Pointer(bp)).FpNewTable + 44))
+ *(*U32)(unsafe.Pointer(pSelect + 4)) &= libc.Uint32FromInt32(libc.CplInt32(SF_View))
(*Parse)(unsafe.Pointer(bp /* &sParse */)).Frc = SQLITE_OK
Xsqlite3SelectPrep(tls, bp /* &sParse */, pSelect, uintptr(0))
rc = func() int32 {
if (*Sqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 {
return SQLITE_NOMEM
}
- return (*Parse)(unsafe.Pointer(bp /* &sParse */)).Frc
+ return (*Parse)(unsafe.Pointer(bp)).Frc
}()
if rc == SQLITE_OK {
- Xsqlite3WalkSelect(tls, bp+292 /* &sWalker */, pSelect)
+ Xsqlite3WalkSelect(tls, bp+288 /* &sWalker */, pSelect)
}
} else {
var i int32
- Xsqlite3WalkExprList(tls, bp+292 /* &sWalker */, (*Table)(unsafe.Pointer((*Parse)(unsafe.Pointer(bp /* &sParse */)).FpNewTable)).FpCheck)
+ Xsqlite3WalkExprList(tls, bp+288 /* &sWalker */, (*Table)(unsafe.Pointer((*Parse)(unsafe.Pointer(bp /* &sParse */)).FpNewTable)).FpCheck)
for i = 0; i < int32((*Table)(unsafe.Pointer((*Parse)(unsafe.Pointer(bp /* &sParse */)).FpNewTable)).FnCol); i++ {
- Xsqlite3WalkExpr(tls, bp+292 /* &sWalker */, (*Column)(unsafe.Pointer((*Table)(unsafe.Pointer((*Parse)(unsafe.Pointer(bp /* &sParse */)).FpNewTable)).FaCol+uintptr(i)*20)).FpDflt)
+ Xsqlite3WalkExpr(tls, bp+288, /* &sWalker */
+ Xsqlite3ColumnExpr(tls, (*Parse)(unsafe.Pointer(bp /* &sParse */)).FpNewTable,
+ (*Table)(unsafe.Pointer((*Parse)(unsafe.Pointer(bp)).FpNewTable)).FaCol+uintptr(i)*16))
}
}
- } else if (*Parse)(unsafe.Pointer(bp /* &sParse */)).FpNewIndex != 0 {
- Xsqlite3WalkExprList(tls, bp+292 /* &sWalker */, (*Index)(unsafe.Pointer((*Parse)(unsafe.Pointer(bp /* &sParse */)).FpNewIndex)).FaColExpr)
- Xsqlite3WalkExpr(tls, bp+292 /* &sWalker */, (*Index)(unsafe.Pointer((*Parse)(unsafe.Pointer(bp /* &sParse */)).FpNewIndex)).FpPartIdxWhere)
+ } else if (*Parse)(unsafe.Pointer(bp)).FpNewIndex != 0 {
+ Xsqlite3WalkExprList(tls, bp+288 /* &sWalker */, (*Index)(unsafe.Pointer((*Parse)(unsafe.Pointer(bp /* &sParse */)).FpNewIndex)).FaColExpr)
+ Xsqlite3WalkExpr(tls, bp+288 /* &sWalker */, (*Index)(unsafe.Pointer((*Parse)(unsafe.Pointer(bp /* &sParse */)).FpNewIndex)).FpPartIdxWhere)
} else {
rc = renameResolveTrigger(tls, bp /* &sParse */)
if rc == SQLITE_OK {
- renameWalkTrigger(tls, bp+292 /* &sWalker */, (*Parse)(unsafe.Pointer(bp /* &sParse */)).FpNewTrigger)
+ renameWalkTrigger(tls, bp+288 /* &sWalker */, (*Parse)(unsafe.Pointer(bp /* &sParse */)).FpNewTrigger)
}
}
if rc == SQLITE_OK {
- rc = renameEditSql(tls, context, bp+272 /* &sCtx */, zInput, uintptr(0), 0)
+ rc = renameEditSql(tls, context, bp+268 /* &sCtx */, zInput, uintptr(0), 0)
}
- renameTokenFree(tls, db, (*RenameCtx)(unsafe.Pointer(bp+272 /* &sCtx */)).FpList)
+ renameTokenFree(tls, db, (*RenameCtx)(unsafe.Pointer(bp+268 /* &sCtx */)).FpList)
}
if rc != SQLITE_OK {
Xsqlite3_result_error_code(tls, context, rc)
@@ -89432,15 +90625,15 @@ func renameQuotefixFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uint
//
// * the SQL argument creates a trigger, and
// * the table that the trigger is attached to is in database zDb.
-func renameTableTest(tls *libc.TLS, context uintptr, NotUsed int32, argv uintptr) { /* sqlite3.c:109319:13: */
- bp := tls.Alloc(304)
- defer tls.Free(304)
+func renameTableTest(tls *libc.TLS, context uintptr, NotUsed int32, argv uintptr) { /* sqlite3.c:109932:13: */
+ bp := tls.Alloc(300)
+ defer tls.Free(300)
var db uintptr = Xsqlite3_context_db_handle(tls, context)
var zDb uintptr = Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv)))
var zInput uintptr = Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv + 1*4)))
var bTemp int32 = Xsqlite3_value_int(tls, *(*uintptr)(unsafe.Pointer(argv + 4*4)))
- var isLegacy int32 = (int32((*Sqlite3)(unsafe.Pointer(db)).Fflags & uint64(SQLITE_LegacyAlter)))
+ var isLegacy int32 = int32((*Sqlite3)(unsafe.Pointer(db)).Fflags & uint64(SQLITE_LegacyAlter))
var zWhen uintptr = Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv + 5*4)))
var bNoDQS int32 = Xsqlite3_value_int(tls, *(*uintptr)(unsafe.Pointer(argv + 6*4)))
@@ -89449,27 +90642,27 @@ func renameTableTest(tls *libc.TLS, context uintptr, NotUsed int32, argv uintptr
_ = NotUsed
- if (zDb != 0) && (zInput != 0) {
+ if zDb != 0 && zInput != 0 {
var rc int32
- // var sParse Parse at bp, 272
+ // var sParse Parse at bp, 268
var flags int32 = int32((*Sqlite3)(unsafe.Pointer(db)).Fflags)
if bNoDQS != 0 {
- *(*U64)(unsafe.Pointer(db + 32 /* &.flags */)) &= (libc.Uint64FromInt32(libc.CplInt32((SQLITE_DqsDML | SQLITE_DqsDDL))))
+ *(*U64)(unsafe.Pointer(db + 32)) &= libc.Uint64FromInt32(libc.CplInt32(SQLITE_DqsDML | SQLITE_DqsDDL))
}
rc = renameParseSql(tls, bp /* &sParse */, zDb, db, zInput, bTemp)
- *(*U64)(unsafe.Pointer(db + 32 /* &.flags */)) |= (U64(flags & (SQLITE_DqsDML | SQLITE_DqsDDL)))
+ *(*U64)(unsafe.Pointer(db + 32)) |= U64(flags & (SQLITE_DqsDML | SQLITE_DqsDDL))
if rc == SQLITE_OK {
- if ((isLegacy == 0) && ((*Parse)(unsafe.Pointer(bp /* &sParse */)).FpNewTable != 0)) && ((*Table)(unsafe.Pointer((*Parse)(unsafe.Pointer(bp /* &sParse */)).FpNewTable)).FpSelect != 0) {
- // var sNC NameContext at bp+272, 32
+ if isLegacy == 0 && (*Parse)(unsafe.Pointer(bp)).FpNewTable != 0 && int32((*Table)(unsafe.Pointer((*Parse)(unsafe.Pointer(bp)).FpNewTable)).FeTabType) == TABTYP_VIEW {
+ // var sNC NameContext at bp+268, 32
- libc.Xmemset(tls, bp+272 /* &sNC */, 0, uint32(unsafe.Sizeof(NameContext{})))
- (*NameContext)(unsafe.Pointer(bp + 272 /* &sNC */)).FpParse = bp /* &sParse */
- Xsqlite3SelectPrep(tls, bp /* &sParse */, (*Table)(unsafe.Pointer((*Parse)(unsafe.Pointer(bp /* &sParse */)).FpNewTable)).FpSelect, bp+272 /* &sNC */)
- if (*Parse)(unsafe.Pointer(bp /* &sParse */)).FnErr != 0 {
+ libc.Xmemset(tls, bp+268 /* &sNC */, 0, uint32(unsafe.Sizeof(NameContext{})))
+ (*NameContext)(unsafe.Pointer(bp + 268 /* &sNC */)).FpParse = bp /* &sParse */
+ Xsqlite3SelectPrep(tls, bp /* &sParse */, *(*uintptr)(unsafe.Pointer((*Parse)(unsafe.Pointer(bp)).FpNewTable + 44)), bp+268 /* &sNC */)
+ if (*Parse)(unsafe.Pointer(bp)).FnErr != 0 {
rc = (*Parse)(unsafe.Pointer(bp /* &sParse */)).Frc
}
- } else if (*Parse)(unsafe.Pointer(bp /* &sParse */)).FpNewTrigger != 0 {
+ } else if (*Parse)(unsafe.Pointer(bp)).FpNewTrigger != 0 {
if isLegacy == 0 {
rc = renameResolveTrigger(tls, bp /* &sParse */)
}
@@ -89483,7 +90676,7 @@ func renameTableTest(tls *libc.TLS, context uintptr, NotUsed int32, argv uintptr
}
}
- if (rc != SQLITE_OK) && (zWhen != 0) {
+ if rc != SQLITE_OK && zWhen != 0 {
renameColumnParseError(tls, context, zWhen, *(*uintptr)(unsafe.Pointer(argv + 2*4)), *(*uintptr)(unsafe.Pointer(argv + 3*4)), bp /* &sParse */)
}
renameParseCleanup(tls, bp /* &sParse */)
@@ -89502,9 +90695,9 @@ func renameTableTest(tls *libc.TLS, context uintptr, NotUsed int32, argv uintptr
//
// The value returned is a string containing the CREATE TABLE statement
// with column argv[2] removed.
-func dropColumnFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintptr) { /* sqlite3.c:109390:13: */
- bp := tls.Alloc(296)
- defer tls.Free(296)
+func dropColumnFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintptr) { /* sqlite3.c:110003:13: */
+ bp := tls.Alloc(292)
+ defer tls.Free(292)
var db uintptr
var iSchema int32
@@ -89512,7 +90705,7 @@ func dropColumnFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintptr)
var iCol int32
var zDb uintptr
var rc int32
- // var sParse Parse at bp+24, 272
+ // var sParse Parse at bp+24, 268
var pCol uintptr
var pTab uintptr
@@ -89530,7 +90723,7 @@ func dropColumnFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintptr)
(*Sqlite3)(unsafe.Pointer(db)).FxAuth = uintptr(0)
_ = NotUsed
- rc = renameParseSql(tls, bp+24 /* &sParse */, zDb, db, zSql, (libc.Bool32(iSchema == 1)))
+ rc = renameParseSql(tls, bp+24 /* &sParse */, zDb, db, zSql, libc.Bool32(iSchema == 1))
if !(rc != SQLITE_OK) {
goto __1
}
@@ -89538,26 +90731,27 @@ func dropColumnFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintptr)
__1:
;
pTab = (*Parse)(unsafe.Pointer(bp + 24 /* &sParse */)).FpNewTable
- if !(((pTab == uintptr(0)) || (int32((*Table)(unsafe.Pointer(pTab)).FnCol) == 1)) || (iCol >= int32((*Table)(unsafe.Pointer(pTab)).FnCol))) {
+ if !(pTab == uintptr(0) || int32((*Table)(unsafe.Pointer(pTab)).FnCol) == 1 || iCol >= int32((*Table)(unsafe.Pointer(pTab)).FnCol)) {
goto __2
}
// This can happen if the sqlite_schema table is corrupt
- rc = Xsqlite3CorruptError(tls, 109418)
+ rc = Xsqlite3CorruptError(tls, 110031)
goto drop_column_done
__2:
;
- pCol = renameTokenFind(tls, bp+24 /* &sParse */, uintptr(0), (*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FaCol+uintptr(iCol)*20)).FzName)
- if !(iCol < (int32((*Table)(unsafe.Pointer(pTab)).FnCol) - 1)) {
+ pCol = renameTokenFind(tls, bp+24 /* &sParse */, uintptr(0), (*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FaCol+uintptr(iCol)*16)).FzCnName)
+ if !(iCol < int32((*Table)(unsafe.Pointer(pTab)).FnCol)-1) {
goto __3
}
- pEnd = renameTokenFind(tls, bp+24 /* &sParse */, uintptr(0), (*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FaCol+uintptr((iCol+1))*20)).FzName)
+ pEnd = renameTokenFind(tls, bp+24 /* &sParse */, uintptr(0), (*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FaCol+uintptr(iCol+1)*16)).FzCnName)
zEnd = (*RenameToken)(unsafe.Pointer(pEnd)).Ft.Fz
goto __4
__3:
- zEnd = (zSql + uintptr((*Table)(unsafe.Pointer(pTab)).FaddColOffset))
+ ;
+ zEnd = zSql + uintptr(*(*int32)(unsafe.Pointer(pTab + 44)))
__5:
- if !((int32(*(*uint8)(unsafe.Pointer((*RenameToken)(unsafe.Pointer(pCol)).Ft.Fz))) != 0) && (int32(*(*uint8)(unsafe.Pointer((*RenameToken)(unsafe.Pointer(pCol)).Ft.Fz))) != ',')) {
+ if !(int32(*(*uint8)(unsafe.Pointer((*RenameToken)(unsafe.Pointer(pCol)).Ft.Fz))) != 0 && int32(*(*uint8)(unsafe.Pointer((*RenameToken)(unsafe.Pointer(pCol)).Ft.Fz))) != ',') {
goto __6
}
(*RenameToken)(unsafe.Pointer(pCol)).Ft.Fz--
@@ -89567,7 +90761,7 @@ __6:
__4:
;
- zNew = Xsqlite3MPrintf(tls, db, ts+9665 /* "%.*s%s" */, libc.VaList(bp, ((int32((*RenameToken)(unsafe.Pointer(pCol)).Ft.Fz)-int32(zSql))/1), zSql, zEnd))
+ zNew = Xsqlite3MPrintf(tls, db, ts+10779 /* "%.*s%s" */, libc.VaList(bp, (int32((*RenameToken)(unsafe.Pointer(pCol)).Ft.Fz)-int32(zSql))/1, zSql, zEnd))
Xsqlite3_result_text(tls, context, zNew, -1, libc.UintptrFromInt32(-1))
Xsqlite3_free(tls, zNew)
@@ -89587,7 +90781,7 @@ __7:
//
// statement. Argument pSrc contains the possibly qualified name of the
// table being edited, and token pName the name of the column to drop.
-func Xsqlite3AlterDropColumn(tls *libc.TLS, pParse uintptr, pSrc uintptr, pName uintptr) { /* sqlite3.c:109454:21: */
+func Xsqlite3AlterDropColumn(tls *libc.TLS, pParse uintptr, pSrc uintptr, pName uintptr) { /* sqlite3.c:110068:21: */
bp := tls.Alloc(64)
defer tls.Free(64)
@@ -89619,8 +90813,8 @@ func Xsqlite3AlterDropColumn(tls *libc.TLS, pParse uintptr, pSrc uintptr, pName
goto exit_drop_column
__1:
;
- pTab = Xsqlite3LocateTableItem(tls, pParse, uint32(0), (pSrc + 8 /* &.a */))
- if !(!(pTab != 0)) {
+ pTab = Xsqlite3LocateTableItem(tls, pParse, uint32(0), pSrc+8)
+ if !!(pTab != 0) {
goto __2
}
goto exit_drop_column
@@ -89655,22 +90849,22 @@ __5:
if !(iCol < 0) {
goto __6
}
- Xsqlite3ErrorMsg(tls, pParse, ts+5383 /* "no such column: ..." */, libc.VaList(bp, zCol))
+ Xsqlite3ErrorMsg(tls, pParse, ts+6230 /* "no such column: ..." */, libc.VaList(bp, zCol))
goto exit_drop_column
__6:
;
// Do not allow the user to drop a PRIMARY KEY column or a column
// constrained by a UNIQUE constraint.
- if !((int32((*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FaCol+uintptr(iCol)*20)).FcolFlags) & (COLFLAG_PRIMKEY | COLFLAG_UNIQUE)) != 0) {
+ if !(int32((*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FaCol+uintptr(iCol)*16)).FcolFlags)&(COLFLAG_PRIMKEY|COLFLAG_UNIQUE) != 0) {
goto __7
}
- Xsqlite3ErrorMsg(tls, pParse, ts+9672, /* "cannot drop %s c..." */
+ Xsqlite3ErrorMsg(tls, pParse, ts+10786, /* "cannot drop %s c..." */
libc.VaList(bp+8, func() uintptr {
- if (int32((*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FaCol+uintptr(iCol)*20)).FcolFlags) & COLFLAG_PRIMKEY) != 0 {
- return ts + 9700 /* "PRIMARY KEY" */
+ if int32((*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FaCol+uintptr(iCol)*16)).FcolFlags)&COLFLAG_PRIMKEY != 0 {
+ return ts + 10814 /* "PRIMARY KEY" */
}
- return ts + 5204 /* "UNIQUE" */
+ return ts + 6051 /* "UNIQUE" */
}(),
zCol))
goto exit_drop_column
@@ -89681,7 +90875,7 @@ __7:
if !(int32((*Table)(unsafe.Pointer(pTab)).FnCol) <= 1) {
goto __8
}
- Xsqlite3ErrorMsg(tls, pParse, ts+9712 /* "cannot drop colu..." */, libc.VaList(bp+24, zCol))
+ Xsqlite3ErrorMsg(tls, pParse, ts+10826 /* "cannot drop colu..." */, libc.VaList(bp+24, zCol))
goto exit_drop_column
__8:
;
@@ -89690,18 +90884,18 @@ __8:
iDb = Xsqlite3SchemaToIndex(tls, db, (*Table)(unsafe.Pointer(pTab)).FpSchema)
zDb = (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*16)).FzDbSName
- renameTestSchema(tls, pParse, zDb, (libc.Bool32(iDb == 1)), ts+755 /* "" */, 0)
- renameFixQuotes(tls, pParse, zDb, (libc.Bool32(iDb == 1)))
+ renameTestSchema(tls, pParse, zDb, libc.Bool32(iDb == 1), ts+1543 /* "" */, 0)
+ renameFixQuotes(tls, pParse, zDb, libc.Bool32(iDb == 1))
Xsqlite3NestedParse(tls, pParse,
- ts+9760 /* "UPDATE \"%w\".sqli..." */, libc.VaList(bp+32, zDb, iDb, iCol, (*Table)(unsafe.Pointer(pTab)).FzName))
+ ts+10874 /* "UPDATE \"%w\".sqli..." */, libc.VaList(bp+32, zDb, iDb, iCol, (*Table)(unsafe.Pointer(pTab)).FzName))
// Drop and reload the database schema.
renameReloadSchema(tls, pParse, iDb, uint16(INITFLAG_AlterDrop))
- renameTestSchema(tls, pParse, zDb, (libc.Bool32(iDb == 1)), ts+9881 /* "after drop colum..." */, 1)
+ renameTestSchema(tls, pParse, zDb, libc.Bool32(iDb == 1), ts+10995 /* "after drop colum..." */, 1)
// Edit rows of table on disk
- if !(((*Parse)(unsafe.Pointer(pParse)).FnErr == 0) && ((int32((*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FaCol+uintptr(iCol)*20)).FcolFlags) & COLFLAG_VIRTUAL) == 0)) {
+ if !((*Parse)(unsafe.Pointer(pParse)).FnErr == 0 && int32((*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FaCol+uintptr(iCol)*16)).FcolFlags)&COLFLAG_VIRTUAL == 0) {
goto __9
}
pPk = uintptr(0)
@@ -89711,21 +90905,21 @@ __8:
Xsqlite3OpenTable(tls, pParse, iCur, iDb, pTab, OP_OpenWrite)
addr = Xsqlite3VdbeAddOp1(tls, v, OP_Rewind, iCur)
reg = libc.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1)
- if !(((*Table)(unsafe.Pointer((pTab))).FtabFlags & U32(TF_WithoutRowid)) == U32(0)) {
+ if !((*Table)(unsafe.Pointer(pTab)).FtabFlags&U32(TF_WithoutRowid) == U32(0)) {
goto __10
}
Xsqlite3VdbeAddOp2(tls, v, OP_Rowid, iCur, reg)
- *(*int32)(unsafe.Pointer(pParse + 44 /* &.nMem */)) += (int32((*Table)(unsafe.Pointer(pTab)).FnCol))
+ *(*int32)(unsafe.Pointer(pParse + 44)) += int32((*Table)(unsafe.Pointer(pTab)).FnCol)
goto __11
__10:
pPk = Xsqlite3PrimaryKeyIndex(tls, pTab)
- *(*int32)(unsafe.Pointer(pParse + 44 /* &.nMem */)) += (int32((*Index)(unsafe.Pointer(pPk)).FnColumn))
+ *(*int32)(unsafe.Pointer(pParse + 44)) += int32((*Index)(unsafe.Pointer(pPk)).FnColumn)
i = 0
__12:
if !(i < int32((*Index)(unsafe.Pointer(pPk)).FnKeyCol)) {
goto __14
}
- Xsqlite3VdbeAddOp3(tls, v, OP_Column, iCur, i, ((reg + i) + 1))
+ Xsqlite3VdbeAddOp3(tls, v, OP_Column, iCur, i, reg+i+1)
goto __13
__13:
i++
@@ -89742,7 +90936,7 @@ __15:
if !(i < int32((*Table)(unsafe.Pointer(pTab)).FnCol)) {
goto __17
}
- if !((i != iCol) && ((int32((*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FaCol+uintptr(i)*20)).FcolFlags) & COLFLAG_VIRTUAL) == 0)) {
+ if !(i != iCol && int32((*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FaCol+uintptr(i)*16)).FcolFlags)&COLFLAG_VIRTUAL == 0) {
goto __18
}
if !(pPk != 0) {
@@ -89756,10 +90950,10 @@ __15:
goto __16
__21:
;
- regOut = (((reg + 1) + iPos) - (libc.Bool32(iPos > iColPos)))
+ regOut = reg + 1 + iPos - libc.Bool32(iPos > iColPos)
goto __20
__19:
- regOut = ((reg + 1) + nField)
+ regOut = reg + 1 + nField
__20:
;
if !(i == int32((*Table)(unsafe.Pointer(pTab)).FiPKey)) {
@@ -89781,19 +90975,28 @@ __16:
goto __17
__17:
;
- Xsqlite3VdbeAddOp3(tls, v, OP_MakeRecord, (reg + 1), nField, regRec)
- if !(pPk != 0) {
+ if !(nField == 0) {
goto __24
}
- Xsqlite3VdbeAddOp4Int(tls, v, OP_IdxInsert, iCur, regRec, (reg + 1), int32((*Index)(unsafe.Pointer(pPk)).FnKeyCol))
- goto __25
+ // dbsqlfuzz 5f09e7bcc78b4954d06bf9f2400d7715f48d1fef
+ (*Parse)(unsafe.Pointer(pParse)).FnMem++
+ Xsqlite3VdbeAddOp2(tls, v, OP_Null, 0, reg+1)
+ nField = 1
__24:
- Xsqlite3VdbeAddOp3(tls, v, OP_Insert, iCur, regRec, reg)
+ ;
+ Xsqlite3VdbeAddOp3(tls, v, OP_MakeRecord, reg+1, nField, regRec)
+ if !(pPk != 0) {
+ goto __25
+ }
+ Xsqlite3VdbeAddOp4Int(tls, v, OP_IdxInsert, iCur, regRec, reg+1, int32((*Index)(unsafe.Pointer(pPk)).FnKeyCol))
+ goto __26
__25:
+ Xsqlite3VdbeAddOp3(tls, v, OP_Insert, iCur, regRec, reg)
+__26:
;
Xsqlite3VdbeChangeP5(tls, v, uint16(OPFLAG_SAVEPOSITION))
- Xsqlite3VdbeAddOp2(tls, v, OP_Next, iCur, (addr + 1))
+ Xsqlite3VdbeAddOp2(tls, v, OP_Next, iCur, addr+1)
Xsqlite3VdbeJumpHere(tls, v, addr)
__9:
;
@@ -89804,16 +91007,16 @@ exit_drop_column:
}
// Register built-in functions used to help implement ALTER TABLE
-func Xsqlite3AlterFunctions(tls *libc.TLS) { /* sqlite3.c:109584:21: */
- Xsqlite3InsertBuiltinFuncs(tls, uintptr(unsafe.Pointer(&aAlterTableFuncs)), (int32(uint32(unsafe.Sizeof(aAlterTableFuncs)) / uint32(unsafe.Sizeof(FuncDef{})))))
+func Xsqlite3AlterFunctions(tls *libc.TLS) { /* sqlite3.c:110204:21: */
+ Xsqlite3InsertBuiltinFuncs(tls, uintptr(unsafe.Pointer(&aAlterTableFuncs)), int32(uint32(unsafe.Sizeof(aAlterTableFuncs))/uint32(unsafe.Sizeof(FuncDef{}))))
}
var aAlterTableFuncs = [5]FuncDef{
- {FnArg: int8(9), FfuncFlags: (U32((SQLITE_FUNC_INTERNAL | SQLITE_UTF8) | SQLITE_FUNC_CONSTANT)), FxSFunc: 0, FzName: ts + 9899 /* "sqlite_rename_co..." */},
- {FnArg: int8(7), FfuncFlags: (U32((SQLITE_FUNC_INTERNAL | SQLITE_UTF8) | SQLITE_FUNC_CONSTANT)), FxSFunc: 0, FzName: ts + 9920 /* "sqlite_rename_ta..." */},
- {FnArg: int8(7), FfuncFlags: (U32((SQLITE_FUNC_INTERNAL | SQLITE_UTF8) | SQLITE_FUNC_CONSTANT)), FxSFunc: 0, FzName: ts + 9940 /* "sqlite_rename_te..." */},
- {FnArg: int8(3), FfuncFlags: (U32((SQLITE_FUNC_INTERNAL | SQLITE_UTF8) | SQLITE_FUNC_CONSTANT)), FxSFunc: 0, FzName: ts + 9959 /* "sqlite_drop_colu..." */},
- {FnArg: int8(2), FfuncFlags: (U32((SQLITE_FUNC_INTERNAL | SQLITE_UTF8) | SQLITE_FUNC_CONSTANT)), FxSFunc: 0, FzName: ts + 9978 /* "sqlite_rename_qu..." */}} /* sqlite3.c:109585:18 */
+ {FnArg: int8(9), FfuncFlags: U32(SQLITE_FUNC_BUILTIN | SQLITE_FUNC_INTERNAL | SQLITE_UTF8 | SQLITE_FUNC_CONSTANT), FxSFunc: 0, FzName: ts + 11013 /* "sqlite_rename_co..." */},
+ {FnArg: int8(7), FfuncFlags: U32(SQLITE_FUNC_BUILTIN | SQLITE_FUNC_INTERNAL | SQLITE_UTF8 | SQLITE_FUNC_CONSTANT), FxSFunc: 0, FzName: ts + 11034 /* "sqlite_rename_ta..." */},
+ {FnArg: int8(7), FfuncFlags: U32(SQLITE_FUNC_BUILTIN | SQLITE_FUNC_INTERNAL | SQLITE_UTF8 | SQLITE_FUNC_CONSTANT), FxSFunc: 0, FzName: ts + 11054 /* "sqlite_rename_te..." */},
+ {FnArg: int8(3), FfuncFlags: U32(SQLITE_FUNC_BUILTIN | SQLITE_FUNC_INTERNAL | SQLITE_UTF8 | SQLITE_FUNC_CONSTANT), FxSFunc: 0, FzName: ts + 11073 /* "sqlite_drop_colu..." */},
+ {FnArg: int8(2), FfuncFlags: U32(SQLITE_FUNC_BUILTIN | SQLITE_FUNC_INTERNAL | SQLITE_UTF8 | SQLITE_FUNC_CONSTANT), FxSFunc: 0, FzName: ts + 11092 /* "sqlite_rename_qu..." */}} /* sqlite3.c:110205:18 */
//************* End of alter.c **********************************************
//************* Begin file analyze.c ****************************************
@@ -89969,7 +91172,7 @@ var aAlterTableFuncs = [5]FuncDef{
// or it may be a NULL pointer. If it is not NULL, then all entries in
// the sqlite_statN tables associated with the named table are deleted.
// If zWhere==0, then code is generated to delete all stat table entries.
-func openStatTable(tls *libc.TLS, pParse uintptr, iDb int32, iStatCur int32, zWhere uintptr, zWhereType uintptr) { /* sqlite3.c:109763:13: */
+func openStatTable(tls *libc.TLS, pParse uintptr, iDb int32, iStatCur int32, zWhere uintptr, zWhereType uintptr) { /* sqlite3.c:110383:13: */
bp := tls.Alloc(88)
defer tls.Free(88)
@@ -89982,7 +91185,7 @@ func openStatTable(tls *libc.TLS, pParse uintptr, iDb int32, iStatCur int32, zWh
// var aCreateTbl [3]U8 at bp+72, 3
var nToOpen int32
- if ((*Sqlite3)(unsafe.Pointer((db))).FdbOptFlags & (U32(SQLITE_Stat4))) == U32(0) {
+ if (*Sqlite3)(unsafe.Pointer(db)).FdbOptFlags&U32(SQLITE_Stat4) == U32(0) {
nToOpen = 2
} else {
nToOpen = 1
@@ -89992,25 +91195,25 @@ func openStatTable(tls *libc.TLS, pParse uintptr, iDb int32, iStatCur int32, zWh
return
}
- pDb = ((*Sqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*16)
+ pDb = (*Sqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*16
// Create new statistic tables if they do not exist, or clear them
// if they do already exist.
- for i = 0; i < (int32(uint32(unsafe.Sizeof(aTable)) / uint32(unsafe.Sizeof(struct {
+ for i = 0; i < int32(uint32(unsafe.Sizeof(aTable))/uint32(unsafe.Sizeof(struct {
FzName uintptr
FzCols uintptr
- }{})))); i++ {
+ }{}))); i++ {
var zTab uintptr = aTable[i].FzName
var pStat uintptr
*(*U8)(unsafe.Pointer(bp + 72 /* &aCreateTbl[0] */ + uintptr(i))) = U8(0)
- if (libc.AssignUintptr(&pStat, Xsqlite3FindTable(tls, db, zTab, (*Db)(unsafe.Pointer(pDb)).FzDbSName))) == uintptr(0) {
+ if libc.AssignUintptr(&pStat, Xsqlite3FindTable(tls, db, zTab, (*Db)(unsafe.Pointer(pDb)).FzDbSName)) == uintptr(0) {
if i < nToOpen {
// The sqlite_statN table does not exist. Create it. Note that a
// 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.
Xsqlite3NestedParse(tls, pParse,
- ts+10001 /* "CREATE TABLE %Q...." */, libc.VaList(bp, (*Db)(unsafe.Pointer(pDb)).FzDbSName, zTab, aTable[i].FzCols))
+ ts+11115 /* "CREATE TABLE %Q...." */, libc.VaList(bp, (*Db)(unsafe.Pointer(pDb)).FzDbSName, zTab, aTable[i].FzCols))
*(*U32)(unsafe.Pointer(bp + 76 /* &aRoot[0] */ + uintptr(i)*4)) = U32((*Parse)(unsafe.Pointer(pParse)).FregRoot)
*(*U8)(unsafe.Pointer(bp + 72 /* &aCreateTbl[0] */ + uintptr(i))) = U8(OPFLAG_P2ISREG)
}
@@ -90022,10 +91225,10 @@ func openStatTable(tls *libc.TLS, pParse uintptr, iDb int32, iStatCur int32, zWh
Xsqlite3TableLock(tls, pParse, iDb, *(*U32)(unsafe.Pointer(bp + 76 /* &aRoot[0] */ + uintptr(i)*4)), uint8(1), zTab)
if zWhere != 0 {
Xsqlite3NestedParse(tls, pParse,
- ts+10024, /* "DELETE FROM %Q.%..." */
+ ts+11138, /* "DELETE FROM %Q.%..." */
libc.VaList(bp+24, (*Db)(unsafe.Pointer(pDb)).FzDbSName, zTab, zWhereType, zWhere))
} else if (*Sqlite3)(unsafe.Pointer(db)).FxPreUpdateCallback != 0 {
- Xsqlite3NestedParse(tls, pParse, ts+10054 /* "DELETE FROM %Q.%..." */, libc.VaList(bp+56, (*Db)(unsafe.Pointer(pDb)).FzDbSName, zTab))
+ Xsqlite3NestedParse(tls, pParse, ts+11168 /* "DELETE FROM %Q.%..." */, libc.VaList(bp+56, (*Db)(unsafe.Pointer(pDb)).FzDbSName, zTab))
} else {
// The sqlite_stat[134] table already exists. Delete all rows.
Xsqlite3VdbeAddOp2(tls, v, OP_Clear, int32(*(*U32)(unsafe.Pointer(bp + 76 /* &aRoot[0] */ + uintptr(i)*4))), iDb)
@@ -90036,7 +91239,7 @@ func openStatTable(tls *libc.TLS, pParse uintptr, iDb int32, iStatCur int32, zWh
// Open the sqlite_stat[134] tables for writing.
for i = 0; i < nToOpen; i++ {
- Xsqlite3VdbeAddOp4Int(tls, v, OP_OpenWrite, (iStatCur + i), int32(*(*U32)(unsafe.Pointer(bp + 76 /* &aRoot[0] */ + uintptr(i)*4))), iDb, 3)
+ Xsqlite3VdbeAddOp4Int(tls, v, OP_OpenWrite, iStatCur+i, int32(*(*U32)(unsafe.Pointer(bp + 76 /* &aRoot[0] */ + uintptr(i)*4))), iDb, 3)
Xsqlite3VdbeChangeP5(tls, v, uint16(*(*U8)(unsafe.Pointer(bp + 72 /* &aCreateTbl[0] */ + uintptr(i)))))
}
@@ -90046,10 +91249,10 @@ var aTable = [3]struct {
FzName uintptr
FzCols uintptr
}{
- {FzName: ts + 10072 /* "sqlite_stat1" */, FzCols: ts + 10085 /* "tbl,idx,stat" */},
- {FzName: ts + 10098 /* "sqlite_stat4" */, FzCols: ts + 10111 /* "tbl,idx,neq,nlt,..." */},
- {FzName: ts + 10139 /* "sqlite_stat3" */},
-} /* sqlite3.c:109773:5 */
+ {FzName: ts + 11186 /* "sqlite_stat1" */, FzCols: ts + 11199 /* "tbl,idx,stat" */},
+ {FzName: ts + 11212 /* "sqlite_stat4" */, FzCols: ts + 11225 /* "tbl,idx,neq,nlt,..." */},
+ {FzName: ts + 11253 /* "sqlite_stat3" */},
+} /* sqlite3.c:110393:5 */
// Recommended number of samples for sqlite_stat4
@@ -90076,14 +91279,14 @@ type StatAccum1 = struct {
FiGet int32
Fa uintptr
F__ccgo_pad2 [4]byte
-} /* sqlite3.c:109861:9 */
+} /* sqlite3.c:110481:9 */
// Recommended number of samples for sqlite_stat4
// Three SQL functions - stat_init(), stat_push(), and stat_get() -
// share an instance of the following structure to hold their state
// information.
-type StatAccum = StatAccum1 /* sqlite3.c:109861:26 */
+type StatAccum = StatAccum1 /* sqlite3.c:110481:26 */
type StatSample1 = struct {
FanEq uintptr
FanDLt uintptr
@@ -90095,71 +91298,71 @@ type StatSample1 = struct {
F__ccgo_pad2 [3]byte
FiCol int32
FiHash U32
-} /* sqlite3.c:109861:9 */
+} /* sqlite3.c:110481:9 */
-type StatSample = StatSample1 /* sqlite3.c:109862:27 */
+type StatSample = StatSample1 /* sqlite3.c:110482:27 */
// Reclaim memory used by a StatSample
-func sampleClear(tls *libc.TLS, db uintptr, p uintptr) { /* sqlite3.c:109903:13: */
+func sampleClear(tls *libc.TLS, db uintptr, p uintptr) { /* sqlite3.c:110523:13: */
if (*StatSample)(unsafe.Pointer(p)).FnRowid != 0 {
- Xsqlite3DbFree(tls, db, *(*uintptr)(unsafe.Pointer(p + 16 /* &.u */)))
+ Xsqlite3DbFree(tls, db, *(*uintptr)(unsafe.Pointer(p + 16)))
(*StatSample)(unsafe.Pointer(p)).FnRowid = U32(0)
}
}
// Initialize the BLOB value of a ROWID
-func sampleSetRowid(tls *libc.TLS, db uintptr, p uintptr, n int32, pData uintptr) { /* sqlite3.c:109915:13: */
+func sampleSetRowid(tls *libc.TLS, db uintptr, p uintptr, n int32, pData uintptr) { /* sqlite3.c:110535:13: */
if (*StatSample)(unsafe.Pointer(p)).FnRowid != 0 {
- Xsqlite3DbFree(tls, db, *(*uintptr)(unsafe.Pointer(p + 16 /* &.u */)))
+ Xsqlite3DbFree(tls, db, *(*uintptr)(unsafe.Pointer(p + 16)))
}
- *(*uintptr)(unsafe.Pointer(p + 16 /* &.u */)) = Xsqlite3DbMallocRawNN(tls, db, uint64(n))
- if *(*uintptr)(unsafe.Pointer(p + 16 /* &.u */)) != 0 {
+ *(*uintptr)(unsafe.Pointer(p + 16)) = Xsqlite3DbMallocRawNN(tls, db, uint64(n))
+ if *(*uintptr)(unsafe.Pointer(p + 16)) != 0 {
(*StatSample)(unsafe.Pointer(p)).FnRowid = U32(n)
- libc.Xmemcpy(tls, *(*uintptr)(unsafe.Pointer(p + 16 /* &.u */)), pData, uint32(n))
+ libc.Xmemcpy(tls, *(*uintptr)(unsafe.Pointer(p + 16)), pData, uint32(n))
} else {
(*StatSample)(unsafe.Pointer(p)).FnRowid = U32(0)
}
}
// Initialize the INTEGER value of a ROWID.
-func sampleSetRowidInt64(tls *libc.TLS, db uintptr, p uintptr, iRowid I64) { /* sqlite3.c:109931:13: */
+func sampleSetRowidInt64(tls *libc.TLS, db uintptr, p uintptr, iRowid I64) { /* sqlite3.c:110551:13: */
if (*StatSample)(unsafe.Pointer(p)).FnRowid != 0 {
- Xsqlite3DbFree(tls, db, *(*uintptr)(unsafe.Pointer(p + 16 /* &.u */)))
+ Xsqlite3DbFree(tls, db, *(*uintptr)(unsafe.Pointer(p + 16)))
}
(*StatSample)(unsafe.Pointer(p)).FnRowid = U32(0)
- *(*I64)(unsafe.Pointer(p + 16 /* &.u */)) = iRowid
+ *(*I64)(unsafe.Pointer(p + 16)) = iRowid
}
// Copy the contents of object (*pFrom) into (*pTo).
-func sampleCopy(tls *libc.TLS, p uintptr, pTo uintptr, pFrom uintptr) { /* sqlite3.c:109944:13: */
+func sampleCopy(tls *libc.TLS, p uintptr, pTo uintptr, pFrom uintptr) { /* sqlite3.c:110564:13: */
(*StatSample)(unsafe.Pointer(pTo)).FisPSample = (*StatSample)(unsafe.Pointer(pFrom)).FisPSample
(*StatSample)(unsafe.Pointer(pTo)).FiCol = (*StatSample)(unsafe.Pointer(pFrom)).FiCol
(*StatSample)(unsafe.Pointer(pTo)).FiHash = (*StatSample)(unsafe.Pointer(pFrom)).FiHash
- libc.Xmemcpy(tls, (*StatSample)(unsafe.Pointer(pTo)).FanEq, (*StatSample)(unsafe.Pointer(pFrom)).FanEq, (uint32(unsafe.Sizeof(TRowcnt(0))) * uint32((*StatAccum)(unsafe.Pointer(p)).FnCol)))
- libc.Xmemcpy(tls, (*StatSample)(unsafe.Pointer(pTo)).FanLt, (*StatSample)(unsafe.Pointer(pFrom)).FanLt, (uint32(unsafe.Sizeof(TRowcnt(0))) * uint32((*StatAccum)(unsafe.Pointer(p)).FnCol)))
- libc.Xmemcpy(tls, (*StatSample)(unsafe.Pointer(pTo)).FanDLt, (*StatSample)(unsafe.Pointer(pFrom)).FanDLt, (uint32(unsafe.Sizeof(TRowcnt(0))) * uint32((*StatAccum)(unsafe.Pointer(p)).FnCol)))
+ libc.Xmemcpy(tls, (*StatSample)(unsafe.Pointer(pTo)).FanEq, (*StatSample)(unsafe.Pointer(pFrom)).FanEq, uint32(unsafe.Sizeof(TRowcnt(0)))*uint32((*StatAccum)(unsafe.Pointer(p)).FnCol))
+ libc.Xmemcpy(tls, (*StatSample)(unsafe.Pointer(pTo)).FanLt, (*StatSample)(unsafe.Pointer(pFrom)).FanLt, uint32(unsafe.Sizeof(TRowcnt(0)))*uint32((*StatAccum)(unsafe.Pointer(p)).FnCol))
+ libc.Xmemcpy(tls, (*StatSample)(unsafe.Pointer(pTo)).FanDLt, (*StatSample)(unsafe.Pointer(pFrom)).FanDLt, uint32(unsafe.Sizeof(TRowcnt(0)))*uint32((*StatAccum)(unsafe.Pointer(p)).FnCol))
if (*StatSample)(unsafe.Pointer(pFrom)).FnRowid != 0 {
- sampleSetRowid(tls, (*StatAccum)(unsafe.Pointer(p)).Fdb, pTo, int32((*StatSample)(unsafe.Pointer(pFrom)).FnRowid), *(*uintptr)(unsafe.Pointer(pFrom + 16 /* &.u */)))
+ sampleSetRowid(tls, (*StatAccum)(unsafe.Pointer(p)).Fdb, pTo, int32((*StatSample)(unsafe.Pointer(pFrom)).FnRowid), *(*uintptr)(unsafe.Pointer(pFrom + 16)))
} else {
- sampleSetRowidInt64(tls, (*StatAccum)(unsafe.Pointer(p)).Fdb, pTo, *(*I64)(unsafe.Pointer(pFrom + 16 /* &.u */)))
+ sampleSetRowidInt64(tls, (*StatAccum)(unsafe.Pointer(p)).Fdb, pTo, *(*I64)(unsafe.Pointer(pFrom + 16)))
}
}
// Reclaim all memory of a StatAccum structure.
-func statAccumDestructor(tls *libc.TLS, pOld uintptr) { /* sqlite3.c:109962:13: */
+func statAccumDestructor(tls *libc.TLS, pOld uintptr) { /* sqlite3.c:110582:13: */
var p uintptr = pOld
if (*StatAccum)(unsafe.Pointer(p)).FmxSample != 0 {
var i int32
for i = 0; i < (*StatAccum)(unsafe.Pointer(p)).FnCol; i++ {
- sampleClear(tls, (*StatAccum)(unsafe.Pointer(p)).Fdb, ((*StatAccum)(unsafe.Pointer(p)).FaBest + uintptr(i)*40))
+ sampleClear(tls, (*StatAccum)(unsafe.Pointer(p)).Fdb, (*StatAccum)(unsafe.Pointer(p)).FaBest+uintptr(i)*40)
}
for i = 0; i < (*StatAccum)(unsafe.Pointer(p)).FmxSample; i++ {
- sampleClear(tls, (*StatAccum)(unsafe.Pointer(p)).Fdb, ((*StatAccum)(unsafe.Pointer(p)).Fa + uintptr(i)*40))
+ sampleClear(tls, (*StatAccum)(unsafe.Pointer(p)).Fdb, (*StatAccum)(unsafe.Pointer(p)).Fa+uintptr(i)*40)
}
- sampleClear(tls, (*StatAccum)(unsafe.Pointer(p)).Fdb, (p + 32 /* &.current */))
+ sampleClear(tls, (*StatAccum)(unsafe.Pointer(p)).Fdb, p+32)
}
Xsqlite3DbFree(tls, (*StatAccum)(unsafe.Pointer(p)).Fdb, p)
}
@@ -90184,7 +91387,7 @@ func statAccumDestructor(tls *libc.TLS, pOld uintptr) { /* sqlite3.c:109962:13:
// value is a pointer to the StatAccum object. The datatype of the
// return value is BLOB, but it is really just a pointer to the StatAccum
// object.
-func statInit(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:109997:13: */
+func statInit(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:110617:13: */
var p uintptr
var nCol int32 // Number of columns in index being sampled
var nKeyCol int32 // Number of key columns
@@ -90193,7 +91396,7 @@ func statInit(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sql
var db uintptr = Xsqlite3_context_db_handle(tls, context) // Database connection
// Maximum number of samples. 0 if STAT4 data is not collected
var mxSample int32
- if ((*Sqlite3)(unsafe.Pointer((db))).FdbOptFlags & (U32(SQLITE_Stat4))) == U32(0) {
+ if (*Sqlite3)(unsafe.Pointer(db)).FdbOptFlags&U32(SQLITE_Stat4) == U32(0) {
mxSample = SQLITE_STAT4_SAMPLES
} else {
mxSample = 0
@@ -90204,22 +91407,21 @@ func statInit(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sql
nCol = Xsqlite3_value_int(tls, *(*uintptr)(unsafe.Pointer(argv)))
if uint32(unsafe.Sizeof(TRowcnt(0))) < uint32(8) {
- nColUp = ((nCol + 1) & libc.CplInt32(1))
+ nColUp = (nCol + 1) & libc.CplInt32(1)
} else {
nColUp = nCol
}
nKeyCol = Xsqlite3_value_int(tls, *(*uintptr)(unsafe.Pointer(argv + 1*4)))
// Allocate the space required for the StatAccum object
- n = (int32((uint32(unsafe.Sizeof(StatAccum{})) +
- (uint32(unsafe.Sizeof(TRowcnt(0))) * uint32(nColUp))) + // StatAccum.anEq
- (uint32(unsafe.Sizeof(TRowcnt(0))) * uint32(nColUp)))) // StatAccum.anDLt
+ n = int32(uint32(unsafe.Sizeof(StatAccum{})) +
+ uint32(unsafe.Sizeof(TRowcnt(0)))*uint32(nColUp) +
+ uint32(unsafe.Sizeof(TRowcnt(0)))*uint32(nColUp)) // StatAccum.anDLt
if mxSample != 0 {
- n = int32(uint32(n) + (((uint32(unsafe.Sizeof(TRowcnt(0))) * uint32(nColUp)) + // StatAccum.anLt
- (uint32(unsafe.Sizeof(StatSample{})) * (uint32(nCol + mxSample)))) + // StatAccum.aBest[], a[]
- (((uint32(unsafe.Sizeof(TRowcnt(0))) * uint32(3)) * uint32(nColUp)) * (uint32(nCol + mxSample)))))
+ n = int32(uint32(n) + (uint32(unsafe.Sizeof(TRowcnt(0)))*uint32(nColUp) +
+ uint32(unsafe.Sizeof(StatSample{}))*uint32(nCol+mxSample) +
+ uint32(unsafe.Sizeof(TRowcnt(0)))*uint32(3)*uint32(nColUp)*uint32(nCol+mxSample)))
}
- db = Xsqlite3_context_db_handle(tls, context)
p = Xsqlite3DbMallocZero(tls, db, uint64(n))
if p == uintptr(0) {
Xsqlite3_result_error_nomem(tls, context)
@@ -90233,8 +91435,8 @@ func statInit(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sql
(*StatAccum)(unsafe.Pointer(p)).FnCol = nCol
(*StatAccum)(unsafe.Pointer(p)).FnKeyCol = nKeyCol
(*StatAccum)(unsafe.Pointer(p)).FnSkipAhead = U8(0)
- (*StatAccum)(unsafe.Pointer(p)).Fcurrent.FanDLt = (p + 1*112)
- (*StatAccum)(unsafe.Pointer(p)).Fcurrent.FanEq = ((*StatAccum)(unsafe.Pointer(p)).Fcurrent.FanDLt + uintptr(nColUp)*4)
+ (*StatAccum)(unsafe.Pointer(p)).Fcurrent.FanDLt = p + 1*112
+ (*StatAccum)(unsafe.Pointer(p)).Fcurrent.FanEq = (*StatAccum)(unsafe.Pointer(p)).Fcurrent.FanDLt + uintptr(nColUp)*4
(*StatAccum)(unsafe.Pointer(p)).FmxSample = func() int32 {
if (*StatAccum)(unsafe.Pointer(p)).FnLimit == 0 {
@@ -90247,21 +91449,21 @@ func statInit(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sql
var i int32 // Used to iterate through p->aSample[]
(*StatAccum)(unsafe.Pointer(p)).FiGet = -1
- (*StatAccum)(unsafe.Pointer(p)).FnPSample = (((*StatAccum)(unsafe.Pointer(p)).FnEst / (TRowcnt((mxSample / 3) + 1))) + TRowcnt(1))
- (*StatAccum)(unsafe.Pointer(p)).Fcurrent.FanLt = ((*StatAccum)(unsafe.Pointer(p)).Fcurrent.FanEq + uintptr(nColUp)*4)
- (*StatAccum)(unsafe.Pointer(p)).FiPrn = ((U32(0x689e962d) * U32(nCol)) ^ (0xd0944565 * U32(Xsqlite3_value_int(tls, *(*uintptr)(unsafe.Pointer(argv + 2*4))))))
+ (*StatAccum)(unsafe.Pointer(p)).FnPSample = (*StatAccum)(unsafe.Pointer(p)).FnEst/TRowcnt(mxSample/3+1) + TRowcnt(1)
+ (*StatAccum)(unsafe.Pointer(p)).Fcurrent.FanLt = (*StatAccum)(unsafe.Pointer(p)).Fcurrent.FanEq + uintptr(nColUp)*4
+ (*StatAccum)(unsafe.Pointer(p)).FiPrn = U32(0x689e962d)*U32(nCol) ^ 0xd0944565*U32(Xsqlite3_value_int(tls, *(*uintptr)(unsafe.Pointer(argv + 2*4))))
// Set up the StatAccum.a[] and aBest[] arrays
- (*StatAccum)(unsafe.Pointer(p)).Fa = ((*StatAccum)(unsafe.Pointer(p)).Fcurrent.FanLt + uintptr(nColUp)*4)
- (*StatAccum)(unsafe.Pointer(p)).FaBest = ((*StatAccum)(unsafe.Pointer(p)).Fa + uintptr(mxSample)*40)
- pSpace = ((*StatAccum)(unsafe.Pointer(p)).Fa + uintptr((mxSample+nCol))*40)
- for i = 0; i < (mxSample + nCol); i++ {
+ (*StatAccum)(unsafe.Pointer(p)).Fa = (*StatAccum)(unsafe.Pointer(p)).Fcurrent.FanLt + uintptr(nColUp)*4
+ (*StatAccum)(unsafe.Pointer(p)).FaBest = (*StatAccum)(unsafe.Pointer(p)).Fa + uintptr(mxSample)*40
+ pSpace = (*StatAccum)(unsafe.Pointer(p)).Fa + uintptr(mxSample+nCol)*40
+ for i = 0; i < mxSample+nCol; i++ {
(*StatSample)(unsafe.Pointer((*StatAccum)(unsafe.Pointer(p)).Fa + uintptr(i)*40)).FanEq = pSpace
- pSpace += (uintptr(uint32(unsafe.Sizeof(TRowcnt(0))) * uint32(nColUp)))
+ pSpace += uintptr(uint32(unsafe.Sizeof(TRowcnt(0))) * uint32(nColUp))
(*StatSample)(unsafe.Pointer((*StatAccum)(unsafe.Pointer(p)).Fa + uintptr(i)*40)).FanLt = pSpace
- pSpace += (uintptr(uint32(unsafe.Sizeof(TRowcnt(0))) * uint32(nColUp)))
+ pSpace += uintptr(uint32(unsafe.Sizeof(TRowcnt(0))) * uint32(nColUp))
(*StatSample)(unsafe.Pointer((*StatAccum)(unsafe.Pointer(p)).Fa + uintptr(i)*40)).FanDLt = pSpace
- pSpace += (uintptr(uint32(unsafe.Sizeof(TRowcnt(0))) * uint32(nColUp)))
+ pSpace += uintptr(uint32(unsafe.Sizeof(TRowcnt(0))) * uint32(nColUp))
}
for i = 0; i < nCol; i++ {
@@ -90280,7 +91482,7 @@ var statInitFuncdef = FuncDef{
FnArg: int8(4), // nArg
FfuncFlags: U32(SQLITE_UTF8), // pNext
FxSFunc: 0, // xValue, xInverse
- FzName: ts + 10152 /* "stat_init" */} /* sqlite3.c:110084:22 */
+ FzName: ts + 11266 /* "stat_init" */} /* sqlite3.c:110703:22 */
// pNew and pOld are both candidate non-periodic samples selected for
// the same column (pNew->iCol==pOld->iCol). Ignoring this column and
@@ -90291,11 +91493,11 @@ var statInitFuncdef = FuncDef{
//
// This function assumes that for each argument sample, the contents of
// the anEq[] array from pSample->anEq[pSample->iCol+1] onwards are valid.
-func sampleIsBetterPost(tls *libc.TLS, pAccum uintptr, pNew uintptr, pOld uintptr) int32 { /* sqlite3.c:110108:12: */
+func sampleIsBetterPost(tls *libc.TLS, pAccum uintptr, pNew uintptr, pOld uintptr) int32 { /* sqlite3.c:110727:12: */
var nCol int32 = (*StatAccum)(unsafe.Pointer(pAccum)).FnCol
var i int32
- for i = ((*StatSample)(unsafe.Pointer(pNew)).FiCol + 1); i < nCol; i++ {
+ for i = (*StatSample)(unsafe.Pointer(pNew)).FiCol + 1; i < nCol; i++ {
if *(*TRowcnt)(unsafe.Pointer((*StatSample)(unsafe.Pointer(pNew)).FanEq + uintptr(i)*4)) > *(*TRowcnt)(unsafe.Pointer((*StatSample)(unsafe.Pointer(pOld)).FanEq + uintptr(i)*4)) {
return 1
}
@@ -90313,7 +91515,7 @@ func sampleIsBetterPost(tls *libc.TLS, pAccum uintptr, pNew uintptr, pOld uintpt
//
// This function assumes that for each argument sample, the contents of
// the anEq[] array from pSample->anEq[pSample->iCol] onwards are valid.
-func sampleIsBetter(tls *libc.TLS, pAccum uintptr, pNew uintptr, pOld uintptr) int32 { /* sqlite3.c:110132:12: */
+func sampleIsBetter(tls *libc.TLS, pAccum uintptr, pNew uintptr, pOld uintptr) int32 { /* sqlite3.c:110751:12: */
var nEqNew TRowcnt = *(*TRowcnt)(unsafe.Pointer((*StatSample)(unsafe.Pointer(pNew)).FanEq + uintptr((*StatSample)(unsafe.Pointer(pNew)).FiCol)*4))
var nEqOld TRowcnt = *(*TRowcnt)(unsafe.Pointer((*StatSample)(unsafe.Pointer(pOld)).FanEq + uintptr((*StatSample)(unsafe.Pointer(pOld)).FiCol)*4))
@@ -90324,14 +91526,14 @@ func sampleIsBetter(tls *libc.TLS, pAccum uintptr, pNew uintptr, pOld uintptr) i
if (*StatSample)(unsafe.Pointer(pNew)).FiCol < (*StatSample)(unsafe.Pointer(pOld)).FiCol {
return 1
}
- return (libc.Bool32(((*StatSample)(unsafe.Pointer(pNew)).FiCol == (*StatSample)(unsafe.Pointer(pOld)).FiCol) && (sampleIsBetterPost(tls, pAccum, pNew, pOld) != 0)))
+ return libc.Bool32((*StatSample)(unsafe.Pointer(pNew)).FiCol == (*StatSample)(unsafe.Pointer(pOld)).FiCol && sampleIsBetterPost(tls, pAccum, pNew, pOld) != 0)
}
return 0
}
// Copy the contents of sample *pNew into the p->a[] array. If necessary,
// remove the least desirable sample from p->a[] to make room.
-func sampleInsert(tls *libc.TLS, p uintptr, pNew uintptr, nEqZero int32) { /* sqlite3.c:110155:13: */
+func sampleInsert(tls *libc.TLS, p uintptr, pNew uintptr, nEqZero int32) { /* sqlite3.c:110774:13: */
var pSample uintptr
var i int32
var pOld uintptr
@@ -90363,12 +91565,12 @@ __1:
// added a sample that shares this prefix, there is no need to add
// this one. Instead, upgrade the priority of the highest priority
// existing sample that shares this prefix.
- i = ((*StatAccum)(unsafe.Pointer(p)).FnSample - 1)
+ i = (*StatAccum)(unsafe.Pointer(p)).FnSample - 1
__3:
if !(i >= 0) {
goto __5
}
- pOld = ((*StatAccum)(unsafe.Pointer(p)).Fa + uintptr(i)*40)
+ pOld = (*StatAccum)(unsafe.Pointer(p)).Fa + uintptr(i)*40
if !(*(*TRowcnt)(unsafe.Pointer((*StatSample)(unsafe.Pointer(pOld)).FanEq + uintptr((*StatSample)(unsafe.Pointer(pNew)).FiCol)*4)) == TRowcnt(0)) {
goto __6
}
@@ -90379,7 +91581,7 @@ __3:
__7:
;
- if !((pUpgrade == uintptr(0)) || (sampleIsBetter(tls, p, pOld, pUpgrade) != 0)) {
+ if !(pUpgrade == uintptr(0) || sampleIsBetter(tls, p, pOld, pUpgrade) != 0) {
goto __8
}
pUpgrade = pOld
@@ -90409,18 +91611,18 @@ __2:
if !((*StatAccum)(unsafe.Pointer(p)).FnSample >= (*StatAccum)(unsafe.Pointer(p)).FmxSample) {
goto __10
}
- pMin = ((*StatAccum)(unsafe.Pointer(p)).Fa + uintptr((*StatAccum)(unsafe.Pointer(p)).FiMin)*40)
+ pMin = (*StatAccum)(unsafe.Pointer(p)).Fa + uintptr((*StatAccum)(unsafe.Pointer(p)).FiMin)*40
anEq = (*StatSample)(unsafe.Pointer(pMin)).FanEq
anLt = (*StatSample)(unsafe.Pointer(pMin)).FanLt
anDLt = (*StatSample)(unsafe.Pointer(pMin)).FanDLt
sampleClear(tls, (*StatAccum)(unsafe.Pointer(p)).Fdb, pMin)
- libc.Xmemmove(tls, pMin, (pMin + 1*40), (uint32(unsafe.Sizeof(StatSample{})) * (uint32(((*StatAccum)(unsafe.Pointer(p)).FnSample - (*StatAccum)(unsafe.Pointer(p)).FiMin) - 1))))
- pSample = ((*StatAccum)(unsafe.Pointer(p)).Fa + uintptr(((*StatAccum)(unsafe.Pointer(p)).FnSample-1))*40)
+ libc.Xmemmove(tls, pMin, pMin+1*40, uint32(unsafe.Sizeof(StatSample{}))*uint32((*StatAccum)(unsafe.Pointer(p)).FnSample-(*StatAccum)(unsafe.Pointer(p)).FiMin-1))
+ pSample = (*StatAccum)(unsafe.Pointer(p)).Fa + uintptr((*StatAccum)(unsafe.Pointer(p)).FnSample-1)*40
(*StatSample)(unsafe.Pointer(pSample)).FnRowid = U32(0)
(*StatSample)(unsafe.Pointer(pSample)).FanEq = anEq
(*StatSample)(unsafe.Pointer(pSample)).FanDLt = anDLt
(*StatSample)(unsafe.Pointer(pSample)).FanLt = anLt
- (*StatAccum)(unsafe.Pointer(p)).FnSample = ((*StatAccum)(unsafe.Pointer(p)).FmxSample - 1)
+ (*StatAccum)(unsafe.Pointer(p)).FnSample = (*StatAccum)(unsafe.Pointer(p)).FmxSample - 1
__10:
;
@@ -90429,12 +91631,12 @@ __10:
// be out of order.
// Insert the new sample
- pSample = ((*StatAccum)(unsafe.Pointer(p)).Fa + uintptr((*StatAccum)(unsafe.Pointer(p)).FnSample)*40)
+ pSample = (*StatAccum)(unsafe.Pointer(p)).Fa + uintptr((*StatAccum)(unsafe.Pointer(p)).FnSample)*40
sampleCopy(tls, p, pSample, pNew)
(*StatAccum)(unsafe.Pointer(p)).FnSample++
// Zero the first nEqZero entries in the anEq[] array.
- libc.Xmemset(tls, (*StatSample)(unsafe.Pointer(pSample)).FanEq, 0, (uint32(unsafe.Sizeof(TRowcnt(0))) * uint32(nEqZero)))
+ libc.Xmemset(tls, (*StatSample)(unsafe.Pointer(pSample)).FanEq, 0, uint32(unsafe.Sizeof(TRowcnt(0)))*uint32(nEqZero))
find_new_min:
if !((*StatAccum)(unsafe.Pointer(p)).FnSample >= (*StatAccum)(unsafe.Pointer(p)).FmxSample) {
@@ -90452,7 +91654,7 @@ __12:
goto __13
__15:
;
- if !((iMin < 0) || (sampleIsBetter(tls, p, ((*StatAccum)(unsafe.Pointer(p)).Fa+uintptr(iMin)*40), ((*StatAccum)(unsafe.Pointer(p)).Fa+uintptr(i)*40)) != 0)) {
+ if !(iMin < 0 || sampleIsBetter(tls, p, (*StatAccum)(unsafe.Pointer(p)).Fa+uintptr(iMin)*40, (*StatAccum)(unsafe.Pointer(p)).Fa+uintptr(i)*40) != 0) {
goto __16
}
iMin = i
@@ -90474,22 +91676,22 @@ __11:
// p->current contains a sample that reflects the previous row of the
// index. The value of anEq[iChng] and subsequent anEq[] elements are
// correct at this point.
-func samplePushPrevious(tls *libc.TLS, p uintptr, iChng int32) { /* sqlite3.c:110247:13: */
+func samplePushPrevious(tls *libc.TLS, p uintptr, iChng int32) { /* sqlite3.c:110866:13: */
var i int32
// Check if any samples from the aBest[] array should be pushed
// into IndexSample.a[] at this point.
- for i = ((*StatAccum)(unsafe.Pointer(p)).FnCol - 2); i >= iChng; i-- {
- var pBest uintptr = ((*StatAccum)(unsafe.Pointer(p)).FaBest + uintptr(i)*40)
+ for i = (*StatAccum)(unsafe.Pointer(p)).FnCol - 2; i >= iChng; i-- {
+ var pBest uintptr = (*StatAccum)(unsafe.Pointer(p)).FaBest + uintptr(i)*40
*(*TRowcnt)(unsafe.Pointer((*StatSample)(unsafe.Pointer(pBest)).FanEq + uintptr(i)*4)) = *(*TRowcnt)(unsafe.Pointer((*StatAccum)(unsafe.Pointer(p)).Fcurrent.FanEq + uintptr(i)*4))
- if ((*StatAccum)(unsafe.Pointer(p)).FnSample < (*StatAccum)(unsafe.Pointer(p)).FmxSample) || (sampleIsBetter(tls, p, pBest, ((*StatAccum)(unsafe.Pointer(p)).Fa+uintptr((*StatAccum)(unsafe.Pointer(p)).FiMin)*40)) != 0) {
+ if (*StatAccum)(unsafe.Pointer(p)).FnSample < (*StatAccum)(unsafe.Pointer(p)).FmxSample || sampleIsBetter(tls, p, pBest, (*StatAccum)(unsafe.Pointer(p)).Fa+uintptr((*StatAccum)(unsafe.Pointer(p)).FiMin)*40) != 0 {
sampleInsert(tls, p, pBest, i)
}
}
// Check that no sample contains an anEq[] entry with an index of
// p->nMaxEqZero or greater set to zero.
- for i = ((*StatAccum)(unsafe.Pointer(p)).FnSample - 1); i >= 0; i-- {
+ for i = (*StatAccum)(unsafe.Pointer(p)).FnSample - 1; i >= 0; i-- {
var j int32
for j = (*StatAccum)(unsafe.Pointer(p)).FnMaxEqZero; j < (*StatAccum)(unsafe.Pointer(p)).FnCol; j++ {
}
@@ -90497,7 +91699,7 @@ func samplePushPrevious(tls *libc.TLS, p uintptr, iChng int32) { /* sqlite3.c:11
// Update the anEq[] fields of any samples already collected.
if iChng < (*StatAccum)(unsafe.Pointer(p)).FnMaxEqZero {
- for i = ((*StatAccum)(unsafe.Pointer(p)).FnSample - 1); i >= 0; i-- {
+ for i = (*StatAccum)(unsafe.Pointer(p)).FnSample - 1; i >= 0; i-- {
var j int32
for j = iChng; j < (*StatAccum)(unsafe.Pointer(p)).FnCol; j++ {
if *(*TRowcnt)(unsafe.Pointer((*StatSample)(unsafe.Pointer((*StatAccum)(unsafe.Pointer(p)).Fa+uintptr(i)*40)).FanEq + uintptr(j)*4)) == TRowcnt(0) {
@@ -90526,7 +91728,7 @@ func samplePushPrevious(tls *libc.TLS, p uintptr, iChng int32) { /* sqlite3.c:11
// if it wants the byte-code to do special processing.
//
// The R parameter is only used for STAT4
-func statPush(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:110299:13: */
+func statPush(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:110918:13: */
var i int32
// The three function arguments
@@ -90555,7 +91757,7 @@ func statPush(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sql
for i = iChng; i < (*StatAccum)(unsafe.Pointer(p)).FnCol; i++ {
*(*TRowcnt)(unsafe.Pointer((*StatAccum)(unsafe.Pointer(p)).Fcurrent.FanDLt + uintptr(i)*4))++
if (*StatAccum)(unsafe.Pointer(p)).FmxSample != 0 {
- *(*TRowcnt)(unsafe.Pointer((*StatAccum)(unsafe.Pointer(p)).Fcurrent.FanLt + uintptr(i)*4)) += (*(*TRowcnt)(unsafe.Pointer((*StatAccum)(unsafe.Pointer(p)).Fcurrent.FanEq + uintptr(i)*4)))
+ *(*TRowcnt)(unsafe.Pointer((*StatAccum)(unsafe.Pointer(p)).Fcurrent.FanLt + uintptr(i)*4)) += *(*TRowcnt)(unsafe.Pointer((*StatAccum)(unsafe.Pointer(p)).Fcurrent.FanEq + uintptr(i)*4))
}
*(*TRowcnt)(unsafe.Pointer((*StatAccum)(unsafe.Pointer(p)).Fcurrent.FanEq + uintptr(i)*4)) = TRowcnt(1)
}
@@ -90565,40 +91767,40 @@ func statPush(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sql
if (*StatAccum)(unsafe.Pointer(p)).FmxSample != 0 {
var nLt TRowcnt
if Xsqlite3_value_type(tls, *(*uintptr)(unsafe.Pointer(argv + 2*4))) == SQLITE_INTEGER {
- sampleSetRowidInt64(tls, (*StatAccum)(unsafe.Pointer(p)).Fdb, (p + 32 /* &.current */), Xsqlite3_value_int64(tls, *(*uintptr)(unsafe.Pointer(argv + 2*4))))
+ sampleSetRowidInt64(tls, (*StatAccum)(unsafe.Pointer(p)).Fdb, p+32, Xsqlite3_value_int64(tls, *(*uintptr)(unsafe.Pointer(argv + 2*4))))
} else {
- sampleSetRowid(tls, (*StatAccum)(unsafe.Pointer(p)).Fdb, (p + 32 /* &.current */), Xsqlite3_value_bytes(tls, *(*uintptr)(unsafe.Pointer(argv + 2*4))),
+ sampleSetRowid(tls, (*StatAccum)(unsafe.Pointer(p)).Fdb, p+32, Xsqlite3_value_bytes(tls, *(*uintptr)(unsafe.Pointer(argv + 2*4))),
Xsqlite3_value_blob(tls, *(*uintptr)(unsafe.Pointer(argv + 2*4))))
}
- (*StatAccum)(unsafe.Pointer(p)).Fcurrent.FiHash = libc.AssignPtrUint32(p+80 /* &.iPrn */, (((*StatAccum)(unsafe.Pointer(p)).FiPrn * U32(1103515245)) + U32(12345)))
+ (*StatAccum)(unsafe.Pointer(p)).Fcurrent.FiHash = libc.AssignPtrUint32(p+80, (*StatAccum)(unsafe.Pointer(p)).FiPrn*U32(1103515245)+U32(12345))
- nLt = *(*TRowcnt)(unsafe.Pointer((*StatAccum)(unsafe.Pointer(p)).Fcurrent.FanLt + uintptr(((*StatAccum)(unsafe.Pointer(p)).FnCol-1))*4))
+ nLt = *(*TRowcnt)(unsafe.Pointer((*StatAccum)(unsafe.Pointer(p)).Fcurrent.FanLt + uintptr((*StatAccum)(unsafe.Pointer(p)).FnCol-1)*4))
// Check if this is to be a periodic sample. If so, add it.
- if (nLt / (*StatAccum)(unsafe.Pointer(p)).FnPSample) != ((nLt + TRowcnt(1)) / (*StatAccum)(unsafe.Pointer(p)).FnPSample) {
+ if nLt/(*StatAccum)(unsafe.Pointer(p)).FnPSample != (nLt+TRowcnt(1))/(*StatAccum)(unsafe.Pointer(p)).FnPSample {
(*StatAccum)(unsafe.Pointer(p)).Fcurrent.FisPSample = U8(1)
(*StatAccum)(unsafe.Pointer(p)).Fcurrent.FiCol = 0
- sampleInsert(tls, p, (p + 32 /* &.current */), ((*StatAccum)(unsafe.Pointer(p)).FnCol - 1))
+ sampleInsert(tls, p, p+32, (*StatAccum)(unsafe.Pointer(p)).FnCol-1)
(*StatAccum)(unsafe.Pointer(p)).Fcurrent.FisPSample = U8(0)
}
// Update the aBest[] array.
- for i = 0; i < ((*StatAccum)(unsafe.Pointer(p)).FnCol - 1); i++ {
+ for i = 0; i < (*StatAccum)(unsafe.Pointer(p)).FnCol-1; i++ {
(*StatAccum)(unsafe.Pointer(p)).Fcurrent.FiCol = i
- if (i >= iChng) || (sampleIsBetterPost(tls, p, (p+32 /* &.current */), ((*StatAccum)(unsafe.Pointer(p)).FaBest+uintptr(i)*40)) != 0) {
- sampleCopy(tls, p, ((*StatAccum)(unsafe.Pointer(p)).FaBest + uintptr(i)*40), (p + 32 /* &.current */))
+ if i >= iChng || sampleIsBetterPost(tls, p, p+32, (*StatAccum)(unsafe.Pointer(p)).FaBest+uintptr(i)*40) != 0 {
+ sampleCopy(tls, p, (*StatAccum)(unsafe.Pointer(p)).FaBest+uintptr(i)*40, p+32)
}
}
- } else if ((*StatAccum)(unsafe.Pointer(p)).FnLimit != 0) && ((*StatAccum)(unsafe.Pointer(p)).FnRow > (TRowcnt((*StatAccum)(unsafe.Pointer(p)).FnLimit) * (TRowcnt(int32((*StatAccum)(unsafe.Pointer(p)).FnSkipAhead) + 1)))) {
+ } else if (*StatAccum)(unsafe.Pointer(p)).FnLimit != 0 && (*StatAccum)(unsafe.Pointer(p)).FnRow > TRowcnt((*StatAccum)(unsafe.Pointer(p)).FnLimit)*TRowcnt(int32((*StatAccum)(unsafe.Pointer(p)).FnSkipAhead)+1) {
(*StatAccum)(unsafe.Pointer(p)).FnSkipAhead++
- Xsqlite3_result_int(tls, context, (libc.Bool32(*(*TRowcnt)(unsafe.Pointer((*StatAccum)(unsafe.Pointer(p)).Fcurrent.FanDLt)) > TRowcnt(0))))
+ Xsqlite3_result_int(tls, context, libc.Bool32(*(*TRowcnt)(unsafe.Pointer((*StatAccum)(unsafe.Pointer(p)).Fcurrent.FanDLt)) > TRowcnt(0)))
}
}
var statPushFuncdef = FuncDef{
- FnArg: (int8(2 + IsStat4)), // nArg
+ FnArg: int8(2 + IsStat4),
FfuncFlags: U32(SQLITE_UTF8), // pNext
FxSFunc: 0, // xValue, xInverse
- FzName: ts + 10162 /* "stat_push" */} /* sqlite3.c:110374:22 */
+ FzName: ts + 11276 /* "stat_push" */} /* sqlite3.c:110993:22 */
// Implementation of the stat_get(P,J) SQL function. This routine is
// used to query statistical information that has been gathered into
@@ -90617,9 +91819,9 @@ var statPushFuncdef = FuncDef{
// STAT_GET_STAT1 and is hence omitted and this routine becomes
// a one-parameter function, stat_get(P), that always returns the
// stat1 table entry information.
-func statGet(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:110411:13: */
- bp := tls.Alloc(24)
- defer tls.Free(24)
+func statGet(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:111030:13: */
+ bp := tls.Alloc(72)
+ defer tls.Free(72)
var p uintptr = Xsqlite3_value_blob(tls, *(*uintptr)(unsafe.Pointer(argv)))
// STAT4 has a parameter on this routine.
@@ -90646,48 +91848,44 @@ func statGet(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqli
// rows, then each estimate is computed as:
//
// I = (K+D-1)/D
- var z uintptr
- var i int32
+ // var sStat Sqlite3_str at bp+24, 24
+ // Text of the constructed "stat" line
+ var i int32 // Loop counter
- var zRet uintptr = Xsqlite3MallocZero(tls, (uint64(((*StatAccum)(unsafe.Pointer(p)).FnKeyCol + 1) * 25)))
- if zRet == uintptr(0) {
- Xsqlite3_result_error_nomem(tls, context)
- return
- }
-
- Xsqlite3_snprintf(tls, 24, zRet, ts+10172, /* "%llu" */
+ Xsqlite3StrAccumInit(tls, bp+24 /* &sStat */, uintptr(0), uintptr(0), 0, ((*StatAccum)(unsafe.Pointer(p)).FnKeyCol+1)*100)
+ Xsqlite3_str_appendf(tls, bp+24 /* &sStat */, ts+11286, /* "%llu" */
libc.VaList(bp, func() uint64 {
if (*StatAccum)(unsafe.Pointer(p)).FnSkipAhead != 0 {
return U64((*StatAccum)(unsafe.Pointer(p)).FnEst)
}
return U64((*StatAccum)(unsafe.Pointer(p)).FnRow)
}()))
- z = (zRet + uintptr(Xsqlite3Strlen30(tls, zRet)))
for i = 0; i < (*StatAccum)(unsafe.Pointer(p)).FnKeyCol; i++ {
- var nDistinct U64 = (U64(*(*TRowcnt)(unsafe.Pointer((*StatAccum)(unsafe.Pointer(p)).Fcurrent.FanDLt + uintptr(i)*4)) + TRowcnt(1)))
- var iVal U64 = (((U64((*StatAccum)(unsafe.Pointer(p)).FnRow) + nDistinct) - uint64(1)) / nDistinct)
- Xsqlite3_snprintf(tls, 24, z, ts+10177 /* " %llu" */, libc.VaList(bp+8, iVal))
- z += uintptr(Xsqlite3Strlen30(tls, z))
+ var nDistinct U64 = U64(*(*TRowcnt)(unsafe.Pointer((*StatAccum)(unsafe.Pointer(p)).Fcurrent.FanDLt + uintptr(i)*4)) + TRowcnt(1))
+ var iVal U64 = (U64((*StatAccum)(unsafe.Pointer(p)).FnRow) + nDistinct - uint64(1)) / nDistinct
+ Xsqlite3_str_appendf(tls, bp+24 /* &sStat */, ts+11291 /* " %llu" */, libc.VaList(bp+8, iVal))
}
-
- Xsqlite3_result_text(tls, context, zRet, -1, *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{Xsqlite3_free})))
+ Xsqlite3ResultStrAccum(tls, context, bp+24 /* &sStat */)
} else if eCall == STAT_GET_ROWID {
if (*StatAccum)(unsafe.Pointer(p)).FiGet < 0 {
samplePushPrevious(tls, p, 0)
(*StatAccum)(unsafe.Pointer(p)).FiGet = 0
}
if (*StatAccum)(unsafe.Pointer(p)).FiGet < (*StatAccum)(unsafe.Pointer(p)).FnSample {
- var pS uintptr = ((*StatAccum)(unsafe.Pointer(p)).Fa + uintptr((*StatAccum)(unsafe.Pointer(p)).FiGet)*40)
+ var pS uintptr = (*StatAccum)(unsafe.Pointer(p)).Fa + uintptr((*StatAccum)(unsafe.Pointer(p)).FiGet)*40
if (*StatSample)(unsafe.Pointer(pS)).FnRowid == U32(0) {
- Xsqlite3_result_int64(tls, context, *(*I64)(unsafe.Pointer(pS + 16 /* &.u */)))
+ Xsqlite3_result_int64(tls, context, *(*I64)(unsafe.Pointer(pS + 16)))
} else {
- Xsqlite3_result_blob(tls, context, *(*uintptr)(unsafe.Pointer(pS + 16 /* &.u */)), int32((*StatSample)(unsafe.Pointer(pS)).FnRowid),
+ Xsqlite3_result_blob(tls, context, *(*uintptr)(unsafe.Pointer(pS + 16)), int32((*StatSample)(unsafe.Pointer(pS)).FnRowid),
libc.UintptrFromInt32(-1))
}
}
} else {
var aCnt uintptr = uintptr(0)
+ // var sStat Sqlite3_str at bp+48, 24
+
+ var i int32
switch eCall {
case STAT_GET_NEQ:
@@ -90706,44 +91904,34 @@ func statGet(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqli
}
}
-
- {
- var zRet uintptr = Xsqlite3MallocZero(tls, (uint64((*StatAccum)(unsafe.Pointer(p)).FnCol * 25)))
- if zRet == uintptr(0) {
- Xsqlite3_result_error_nomem(tls, context)
- } else {
- var i int32
- var z uintptr = zRet
- for i = 0; i < (*StatAccum)(unsafe.Pointer(p)).FnCol; i++ {
- Xsqlite3_snprintf(tls, 24, z, ts+10183 /* "%llu " */, libc.VaList(bp+16, U64(*(*TRowcnt)(unsafe.Pointer(aCnt + uintptr(i)*4)))))
- z += uintptr(Xsqlite3Strlen30(tls, z))
- }
-
- *(*uint8)(unsafe.Pointer(z + libc.UintptrFromInt32(-1))) = uint8(0)
- Xsqlite3_result_text(tls, context, zRet, -1, *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{Xsqlite3_free})))
- }
-
+ Xsqlite3StrAccumInit(tls, bp+48 /* &sStat */, uintptr(0), uintptr(0), 0, (*StatAccum)(unsafe.Pointer(p)).FnCol*100)
+ for i = 0; i < (*StatAccum)(unsafe.Pointer(p)).FnCol; i++ {
+ Xsqlite3_str_appendf(tls, bp+48 /* &sStat */, ts+11297 /* "%llu " */, libc.VaList(bp+16, U64(*(*TRowcnt)(unsafe.Pointer(aCnt + uintptr(i)*4)))))
+ }
+ if (*Sqlite3_str)(unsafe.Pointer(bp+48)).FnChar != 0 {
+ (*Sqlite3_str)(unsafe.Pointer(bp+48 /* &sStat */)).FnChar--
}
+ Xsqlite3ResultStrAccum(tls, context, bp+48 /* &sStat */)
}
_ = argc
}
var statGetFuncdef = FuncDef{
- FnArg: (int8(1 + IsStat4)), // nArg
+ FnArg: int8(1 + IsStat4),
FfuncFlags: U32(SQLITE_UTF8), // pNext
FxSFunc: 0, // xValue, xInverse
- FzName: ts + 10189 /* "stat_get" */} /* sqlite3.c:110526:22 */
+ FzName: ts + 11303 /* "stat_get" */} /* sqlite3.c:111127:22 */
-func callStatGet(tls *libc.TLS, pParse uintptr, regStat int32, iParam int32, regOut int32) { /* sqlite3.c:110538:13: */
- Xsqlite3VdbeAddOp2(tls, (*Parse)(unsafe.Pointer(pParse)).FpVdbe, OP_Integer, iParam, (regStat + 1))
+func callStatGet(tls *libc.TLS, pParse uintptr, regStat int32, iParam int32, regOut int32) { /* sqlite3.c:111139:13: */
+ Xsqlite3VdbeAddOp2(tls, (*Parse)(unsafe.Pointer(pParse)).FpVdbe, OP_Integer, iParam, regStat+1)
- Xsqlite3VdbeAddFunctionCall(tls, pParse, 0, regStat, regOut, (1 + IsStat4),
+ Xsqlite3VdbeAddFunctionCall(tls, pParse, 0, regStat, regOut, 1+IsStat4,
uintptr(unsafe.Pointer(&statGetFuncdef)), 0)
}
// Generate code to do an analysis of all indices associated with
// a single table.
-func analyzeOneTable(tls *libc.TLS, pParse uintptr, pTab uintptr, pOnlyIdx uintptr, iStatCur int32, iMem int32, iTab int32) { /* sqlite3.c:110579:13: */
+func analyzeOneTable(tls *libc.TLS, pParse uintptr, pTab uintptr, pOnlyIdx uintptr, iStatCur int32, iMem int32, iTab int32) { /* sqlite3.c:111180:13: */
var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb // Database handle
var pIdx uintptr // An index to being analyzed
var iIdxCur int32 // Cursor open on index being analyzed
@@ -90766,20 +91954,20 @@ func analyzeOneTable(tls *libc.TLS, pParse uintptr, pTab uintptr, pOnlyIdx uintp
var pStat1 uintptr = uintptr(0)
(*Parse)(unsafe.Pointer(pParse)).FnMem = func() int32 {
- if ((*Parse)(unsafe.Pointer(pParse)).FnMem) > (iMem) {
+ if (*Parse)(unsafe.Pointer(pParse)).FnMem > iMem {
return (*Parse)(unsafe.Pointer(pParse)).FnMem
}
return iMem
}()
v = Xsqlite3GetVdbe(tls, pParse)
- if (v == uintptr(0)) || (pTab == uintptr(0)) {
+ if v == uintptr(0) || pTab == uintptr(0) {
return
}
- if (*Table)(unsafe.Pointer(pTab)).Ftnum == Pgno(0) {
+ if !(int32((*Table)(unsafe.Pointer(pTab)).FeTabType) == TABTYP_NORM) {
// Do not gather statistics on views or virtual tables
return
}
- if Xsqlite3_strlike(tls, ts+10198 /* "sqlite\\_%" */, (*Table)(unsafe.Pointer(pTab)).FzName, uint32('\\')) == 0 {
+ if Xsqlite3_strlike(tls, ts+11312, (*Table)(unsafe.Pointer(pTab)).FzName, uint32('\\')) == 0 {
// Do not gather statistics on system tables
return
}
@@ -90792,12 +91980,12 @@ func analyzeOneTable(tls *libc.TLS, pParse uintptr, pTab uintptr, pOnlyIdx uintp
}
if (*Sqlite3)(unsafe.Pointer(db)).FxPreUpdateCallback != 0 {
- pStat1 = Xsqlite3DbMallocZero(tls, db, (uint64(uint32(unsafe.Sizeof(Table{})) + uint32(13))))
+ pStat1 = Xsqlite3DbMallocZero(tls, db, uint64(uint32(unsafe.Sizeof(Table{}))+uint32(13)))
if pStat1 == uintptr(0) {
return
}
- (*Table)(unsafe.Pointer(pStat1)).FzName = (pStat1 + 1*76)
- libc.Xmemcpy(tls, (*Table)(unsafe.Pointer(pStat1)).FzName, ts+10072 /* "sqlite_stat1" */, uint32(13))
+ (*Table)(unsafe.Pointer(pStat1)).FzName = pStat1 + 1*64
+ libc.Xmemcpy(tls, (*Table)(unsafe.Pointer(pStat1)).FzName, ts+11186 /* "sqlite_stat1" */, uint32(13))
(*Table)(unsafe.Pointer(pStat1)).FnCol = int16(3)
(*Table)(unsafe.Pointer(pStat1)).FiPKey = int16(-1)
Xsqlite3VdbeAddOp4(tls, (*Parse)(unsafe.Pointer(pParse)).FpVdbe, OP_Noop, 0, 0, 0, pStat1, -17)
@@ -90811,7 +91999,7 @@ func analyzeOneTable(tls *libc.TLS, pParse uintptr, pTab uintptr, pOnlyIdx uintp
iTabCur = libc.PostIncInt32(&iTab, 1)
iIdxCur = libc.PostIncInt32(&iTab, 1)
(*Parse)(unsafe.Pointer(pParse)).FnTab = func() int32 {
- if ((*Parse)(unsafe.Pointer(pParse)).FnTab) > (iTab) {
+ if (*Parse)(unsafe.Pointer(pParse)).FnTab > iTab {
return (*Parse)(unsafe.Pointer(pParse)).FnTab
}
return iTab
@@ -90826,23 +92014,23 @@ func analyzeOneTable(tls *libc.TLS, pParse uintptr, pTab uintptr, pOnlyIdx uintp
var zIdxName uintptr // Name of the index
var nColTest int32 // Number of columns to test for changes
- if (pOnlyIdx != 0) && (pOnlyIdx != pIdx) {
+ if pOnlyIdx != 0 && pOnlyIdx != pIdx {
continue
}
if (*Index)(unsafe.Pointer(pIdx)).FpPartIdxWhere == uintptr(0) {
needTableCnt = U8(0)
}
- if !(((*Table)(unsafe.Pointer((pTab))).FtabFlags & U32(TF_WithoutRowid)) == U32(0)) && ((int32(*(*uint16)(unsafe.Pointer((pIdx) + 56 /* &.idxType */)) & 0x3 >> 0)) == SQLITE_IDXTYPE_PRIMARYKEY) {
+ if !((*Table)(unsafe.Pointer(pTab)).FtabFlags&U32(TF_WithoutRowid) == U32(0)) && int32(*(*uint16)(unsafe.Pointer(pIdx + 56))&0x3>>0) == SQLITE_IDXTYPE_PRIMARYKEY {
nCol = int32((*Index)(unsafe.Pointer(pIdx)).FnKeyCol)
zIdxName = (*Table)(unsafe.Pointer(pTab)).FzName
- nColTest = (nCol - 1)
+ nColTest = nCol - 1
} else {
nCol = int32((*Index)(unsafe.Pointer(pIdx)).FnColumn)
zIdxName = (*Index)(unsafe.Pointer(pIdx)).FzName
- if (uint32(int32(*(*uint16)(unsafe.Pointer(pIdx + 56 /* &.uniqNotNull */)) & 0x8 >> 3))) != 0 {
- nColTest = (int32((*Index)(unsafe.Pointer(pIdx)).FnKeyCol) - 1)
+ if uint32(int32(*(*uint16)(unsafe.Pointer(pIdx + 56))&0x8>>3)) != 0 {
+ nColTest = int32((*Index)(unsafe.Pointer(pIdx)).FnKeyCol) - 1
} else {
- nColTest = (nCol - 1)
+ nColTest = nCol - 1
}
}
@@ -90884,10 +92072,10 @@ func analyzeOneTable(tls *libc.TLS, pParse uintptr, pTab uintptr, pOnlyIdx uintp
// when building a record to insert into the sample column of
// the sqlite_stat4 table.
(*Parse)(unsafe.Pointer(pParse)).FnMem = func() int32 {
- if ((*Parse)(unsafe.Pointer(pParse)).FnMem) > (regPrev + nColTest) {
+ if (*Parse)(unsafe.Pointer(pParse)).FnMem > regPrev+nColTest {
return (*Parse)(unsafe.Pointer(pParse)).FnMem
}
- return (regPrev + nColTest)
+ return regPrev + nColTest
}()
// Open a read-only cursor on the index being analyzed.
@@ -90901,10 +92089,10 @@ func analyzeOneTable(tls *libc.TLS, pParse uintptr, pTab uintptr, pOnlyIdx uintp
// (or for a WITHOUT ROWID table, the number of PK columns),
// (2) the number of columns in the key without the rowid/pk
// (3) estimated number of rows in the index,
- Xsqlite3VdbeAddOp2(tls, v, OP_Integer, nCol, (regStat + 1))
+ Xsqlite3VdbeAddOp2(tls, v, OP_Integer, nCol, regStat+1)
Xsqlite3VdbeAddOp2(tls, v, OP_Integer, int32((*Index)(unsafe.Pointer(pIdx)).FnKeyCol), regRowid)
- if ((*Sqlite3)(unsafe.Pointer((db))).FdbOptFlags & (U32(SQLITE_Stat4))) == U32(0) {
+ if (*Sqlite3)(unsafe.Pointer(db)).FdbOptFlags&U32(SQLITE_Stat4) == U32(0) {
Xsqlite3VdbeAddOp2(tls, v, OP_Count, iIdxCur, regTemp)
addrRewind = Xsqlite3VdbeAddOp1(tls, v, OP_Rewind, iIdxCur)
@@ -90915,7 +92103,7 @@ func analyzeOneTable(tls *libc.TLS, pParse uintptr, pTab uintptr, pOnlyIdx uintp
}
Xsqlite3VdbeAddOp2(tls, v, OP_Integer, (*Sqlite3)(unsafe.Pointer(db)).FnAnalysisLimit, regTemp2)
- Xsqlite3VdbeAddFunctionCall(tls, pParse, 0, (regStat + 1), regStat, 4,
+ Xsqlite3VdbeAddFunctionCall(tls, pParse, 0, regStat+1, regStat, 4,
uintptr(unsafe.Pointer(&statInitFuncdef)), 0)
// Implementation of the following:
@@ -90931,7 +92119,7 @@ func analyzeOneTable(tls *libc.TLS, pParse uintptr, pTab uintptr, pOnlyIdx uintp
if nColTest > 0 {
var endDistinctTest int32 = Xsqlite3VdbeMakeLabel(tls, pParse)
var aGotoChng uintptr // Array of jump instruction addresses
- aGotoChng = Xsqlite3DbMallocRawNN(tls, db, (uint64(uint32(unsafe.Sizeof(int32(0))) * uint32(nColTest))))
+ aGotoChng = Xsqlite3DbMallocRawNN(tls, db, uint64(uint32(unsafe.Sizeof(int32(0)))*uint32(nColTest)))
if aGotoChng == uintptr(0) {
continue
}
@@ -90946,7 +92134,7 @@ func analyzeOneTable(tls *libc.TLS, pParse uintptr, pTab uintptr, pOnlyIdx uintp
// goto endDistinctTest
Xsqlite3VdbeAddOp0(tls, v, OP_Goto)
addrNextRow = Xsqlite3VdbeCurrentAddr(tls, v)
- if ((nColTest == 1) && (int32((*Index)(unsafe.Pointer(pIdx)).FnKeyCol) == 1)) && (int32((*Index)(unsafe.Pointer((pIdx))).FonError) != OE_None) {
+ if nColTest == 1 && int32((*Index)(unsafe.Pointer(pIdx)).FnKeyCol) == 1 && int32((*Index)(unsafe.Pointer(pIdx)).FonError) != OE_None {
// For a single-column UNIQUE index, once we have found a non-NULL
// row, we know that all the rest will be distinct, so skip
// subsequent distinctness tests.
@@ -90958,7 +92146,7 @@ func analyzeOneTable(tls *libc.TLS, pParse uintptr, pTab uintptr, pOnlyIdx uintp
Xsqlite3VdbeAddOp2(tls, v, OP_Integer, i, regChng)
Xsqlite3VdbeAddOp3(tls, v, OP_Column, iIdxCur, i, regTemp)
- *(*int32)(unsafe.Pointer(aGotoChng + uintptr(i)*4)) = Xsqlite3VdbeAddOp4(tls, v, OP_Ne, regTemp, 0, (regPrev + i), pColl, -2)
+ *(*int32)(unsafe.Pointer(aGotoChng + uintptr(i)*4)) = Xsqlite3VdbeAddOp4(tls, v, OP_Ne, regTemp, 0, regPrev+i, pColl, -2)
Xsqlite3VdbeChangeP5(tls, v, uint16(SQLITE_NULLEQ))
}
@@ -90970,10 +92158,10 @@ func analyzeOneTable(tls *libc.TLS, pParse uintptr, pTab uintptr, pOnlyIdx uintp
// chng_addr_1:
// regPrev(1) = idx(1)
// ...
- Xsqlite3VdbeJumpHere(tls, v, (addrNextRow - 1))
+ Xsqlite3VdbeJumpHere(tls, v, addrNextRow-1)
for i = 0; i < nColTest; i++ {
Xsqlite3VdbeJumpHere(tls, v, *(*int32)(unsafe.Pointer(aGotoChng + uintptr(i)*4)))
- Xsqlite3VdbeAddOp3(tls, v, OP_Column, iIdxCur, i, (regPrev + i))
+ Xsqlite3VdbeAddOp3(tls, v, OP_Column, iIdxCur, i, regPrev+i)
}
Xsqlite3VdbeResolveLabel(tls, v, endDistinctTest)
@@ -90985,9 +92173,9 @@ func analyzeOneTable(tls *libc.TLS, pParse uintptr, pTab uintptr, pOnlyIdx uintp
// stat_push(P, regChng, regRowid) // 3rd parameter STAT4 only
// Next csr
// if !eof(csr) goto next_row;
- if ((*Sqlite3)(unsafe.Pointer((db))).FdbOptFlags & (U32(SQLITE_Stat4))) == U32(0) {
+ if (*Sqlite3)(unsafe.Pointer(db)).FdbOptFlags&U32(SQLITE_Stat4) == U32(0) {
- if ((*Table)(unsafe.Pointer((pTab))).FtabFlags & U32(TF_WithoutRowid)) == U32(0) {
+ if (*Table)(unsafe.Pointer(pTab)).FtabFlags&U32(TF_WithoutRowid) == U32(0) {
Xsqlite3VdbeAddOp2(tls, v, OP_IdxRowid, iIdxCur, regRowid)
} else {
var pPk uintptr = Xsqlite3PrimaryKeyIndex(tls, (*Index)(unsafe.Pointer(pIdx)).FpTable)
@@ -90998,7 +92186,7 @@ func analyzeOneTable(tls *libc.TLS, pParse uintptr, pTab uintptr, pOnlyIdx uintp
for j = 0; j < int32((*Index)(unsafe.Pointer(pPk)).FnKeyCol); j++ {
k = int32(Xsqlite3TableColumnToIndex(tls, pIdx, *(*I16)(unsafe.Pointer((*Index)(unsafe.Pointer(pPk)).FaiColumn + uintptr(j)*2))))
- Xsqlite3VdbeAddOp3(tls, v, OP_Column, iIdxCur, k, (regKey + j))
+ Xsqlite3VdbeAddOp3(tls, v, OP_Column, iIdxCur, k, regKey+j)
}
Xsqlite3VdbeAddOp3(tls, v, OP_MakeRecord, regKey, int32((*Index)(unsafe.Pointer(pPk)).FnKeyCol), regRowid)
@@ -91007,7 +92195,7 @@ func analyzeOneTable(tls *libc.TLS, pParse uintptr, pTab uintptr, pOnlyIdx uintp
}
{
- Xsqlite3VdbeAddFunctionCall(tls, pParse, 1, regStat, regTemp, (2 + IsStat4),
+ Xsqlite3VdbeAddFunctionCall(tls, pParse, 1, regStat, regTemp, 2+IsStat4,
uintptr(unsafe.Pointer(&statPushFuncdef)), 0)
if (*Sqlite3)(unsafe.Pointer(db)).FnAnalysisLimit != 0 {
var j1 int32
@@ -91030,34 +92218,34 @@ func analyzeOneTable(tls *libc.TLS, pParse uintptr, pTab uintptr, pOnlyIdx uintp
// Add the entry to the stat1 table.
callStatGet(tls, pParse, regStat, STAT_GET_STAT1, regStat1)
- Xsqlite3VdbeAddOp4(tls, v, OP_MakeRecord, regTabname, 3, regTemp, ts+10208 /* "BBB" */, 0)
+ Xsqlite3VdbeAddOp4(tls, v, OP_MakeRecord, regTabname, 3, regTemp, ts+11322 /* "BBB" */, 0)
Xsqlite3VdbeAddOp2(tls, v, OP_NewRowid, iStatCur, regNewRowid)
Xsqlite3VdbeAddOp3(tls, v, OP_Insert, iStatCur, regTemp, regNewRowid)
Xsqlite3VdbeChangeP4(tls, v, -1, pStat1, -6)
Xsqlite3VdbeChangeP5(tls, v, uint16(OPFLAG_APPEND))
// Add the entries to the stat4 table.
- if (((*Sqlite3)(unsafe.Pointer((db))).FdbOptFlags & (U32(SQLITE_Stat4))) == U32(0)) && ((*Sqlite3)(unsafe.Pointer(db)).FnAnalysisLimit == 0) {
+ if (*Sqlite3)(unsafe.Pointer(db)).FdbOptFlags&U32(SQLITE_Stat4) == U32(0) && (*Sqlite3)(unsafe.Pointer(db)).FnAnalysisLimit == 0 {
var regEq int32 = regStat1
- var regLt int32 = (regStat1 + 1)
- var regDLt int32 = (regStat1 + 2)
- var regSample int32 = (regStat1 + 3)
- var regCol int32 = (regStat1 + 4)
- var regSampleRowid int32 = (regCol + nCol)
+ var regLt int32 = regStat1 + 1
+ var regDLt int32 = regStat1 + 2
+ var regSample int32 = regStat1 + 3
+ var regCol int32 = regStat1 + 4
+ var regSampleRowid int32 = regCol + nCol
var addrNext int32
var addrIsNull int32
var seekOp U8
- if ((*Table)(unsafe.Pointer((pTab))).FtabFlags & U32(TF_WithoutRowid)) == U32(0) {
+ if (*Table)(unsafe.Pointer(pTab)).FtabFlags&U32(TF_WithoutRowid) == U32(0) {
seekOp = uint8(OP_NotExists)
} else {
seekOp = uint8(OP_NotFound)
}
(*Parse)(unsafe.Pointer(pParse)).FnMem = func() int32 {
- if ((*Parse)(unsafe.Pointer(pParse)).FnMem) > (regCol + nCol) {
+ if (*Parse)(unsafe.Pointer(pParse)).FnMem > regCol+nCol {
return (*Parse)(unsafe.Pointer(pParse)).FnMem
}
- return (regCol + nCol)
+ return regCol + nCol
}()
addrNext = Xsqlite3VdbeCurrentAddr(tls, v)
@@ -91070,12 +92258,12 @@ func analyzeOneTable(tls *libc.TLS, pParse uintptr, pTab uintptr, pOnlyIdx uintp
Xsqlite3VdbeAddOp4Int(tls, v, int32(seekOp), iTabCur, addrNext, regSampleRowid, 0)
for i = 0; i < nCol; i++ {
- Xsqlite3ExprCodeLoadIndexColumn(tls, pParse, pIdx, iTabCur, i, (regCol + i))
+ Xsqlite3ExprCodeLoadIndexColumn(tls, pParse, pIdx, iTabCur, i, regCol+i)
}
Xsqlite3VdbeAddOp3(tls, v, OP_MakeRecord, regCol, nCol, regSample)
Xsqlite3VdbeAddOp3(tls, v, OP_MakeRecord, regTabname, 6, regTemp)
- Xsqlite3VdbeAddOp2(tls, v, OP_NewRowid, (iStatCur + 1), regNewRowid)
- Xsqlite3VdbeAddOp3(tls, v, OP_Insert, (iStatCur + 1), regTemp, regNewRowid)
+ Xsqlite3VdbeAddOp2(tls, v, OP_NewRowid, iStatCur+1, regNewRowid)
+ Xsqlite3VdbeAddOp3(tls, v, OP_Insert, iStatCur+1, regTemp, regNewRowid)
Xsqlite3VdbeAddOp2(tls, v, OP_Goto, 1, addrNext) // P1==1 for end-of-loop
Xsqlite3VdbeJumpHere(tls, v, addrIsNull)
}
@@ -91086,13 +92274,13 @@ func analyzeOneTable(tls *libc.TLS, pParse uintptr, pTab uintptr, pOnlyIdx uintp
// Create a single sqlite_stat1 entry containing NULL as the index
// name and the row count as the content.
- if (pOnlyIdx == uintptr(0)) && (needTableCnt != 0) {
+ if pOnlyIdx == uintptr(0) && needTableCnt != 0 {
Xsqlite3VdbeAddOp2(tls, v, OP_Count, iTabCur, regStat1)
jZeroRows = Xsqlite3VdbeAddOp1(tls, v, OP_IfNot, regStat1)
Xsqlite3VdbeAddOp2(tls, v, OP_Null, 0, regIdxname)
- Xsqlite3VdbeAddOp4(tls, v, OP_MakeRecord, regTabname, 3, regTemp, ts+10208 /* "BBB" */, 0)
+ Xsqlite3VdbeAddOp4(tls, v, OP_MakeRecord, regTabname, 3, regTemp, ts+11322 /* "BBB" */, 0)
Xsqlite3VdbeAddOp2(tls, v, OP_NewRowid, iStatCur, regNewRowid)
Xsqlite3VdbeAddOp3(tls, v, OP_Insert, iStatCur, regTemp, regNewRowid)
Xsqlite3VdbeChangeP5(tls, v, uint16(OPFLAG_APPEND))
@@ -91103,7 +92291,7 @@ func analyzeOneTable(tls *libc.TLS, pParse uintptr, pTab uintptr, pOnlyIdx uintp
// Generate code that will cause the most recent index analysis to
// be loaded into internal hash tables where is can be used.
-func loadAnalysis(tls *libc.TLS, pParse uintptr, iDb int32) { /* sqlite3.c:110941:13: */
+func loadAnalysis(tls *libc.TLS, pParse uintptr, iDb int32) { /* sqlite3.c:111542:13: */
var v uintptr = Xsqlite3GetVdbe(tls, pParse)
if v != 0 {
Xsqlite3VdbeAddOp1(tls, v, OP_LoadAnalysis, iDb)
@@ -91111,7 +92299,7 @@ func loadAnalysis(tls *libc.TLS, pParse uintptr, iDb int32) { /* sqlite3.c:11094
}
// Generate code that will do an analysis of an entire database
-func analyzeDatabase(tls *libc.TLS, pParse uintptr, iDb int32) { /* sqlite3.c:110951:13: */
+func analyzeDatabase(tls *libc.TLS, pParse uintptr, iDb int32) { /* sqlite3.c:111552:13: */
var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb
var pSchema uintptr = (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*16)).FpSchema // Schema of database iDb
var k uintptr
@@ -91121,12 +92309,12 @@ func analyzeDatabase(tls *libc.TLS, pParse uintptr, iDb int32) { /* sqlite3.c:11
Xsqlite3BeginWriteOperation(tls, pParse, 0, iDb)
iStatCur = (*Parse)(unsafe.Pointer(pParse)).FnTab
- *(*int32)(unsafe.Pointer(pParse + 40 /* &.nTab */)) += (3)
+ *(*int32)(unsafe.Pointer(pParse + 40)) += 3
openStatTable(tls, pParse, iDb, iStatCur, uintptr(0), uintptr(0))
- iMem = ((*Parse)(unsafe.Pointer(pParse)).FnMem + 1)
+ iMem = (*Parse)(unsafe.Pointer(pParse)).FnMem + 1
iTab = (*Parse)(unsafe.Pointer(pParse)).FnTab
- for k = (*Hash)(unsafe.Pointer((pSchema + 8 /* &.tblHash */))).Ffirst; k != 0; k = (*HashElem)(unsafe.Pointer(k)).Fnext {
+ for k = (*Hash)(unsafe.Pointer(pSchema + 8)).Ffirst; k != 0; k = (*HashElem)(unsafe.Pointer(k)).Fnext {
var pTab uintptr = (*HashElem)(unsafe.Pointer(k)).Fdata
analyzeOneTable(tls, pParse, pTab, uintptr(0), iStatCur, iMem, iTab)
}
@@ -91136,20 +92324,20 @@ func analyzeDatabase(tls *libc.TLS, pParse uintptr, iDb int32) { /* sqlite3.c:11
// Generate code that will do an analysis of a single table in
// a database. If pOnlyIdx is not NULL then it is a single index
// in pTab that should be analyzed.
-func analyzeTable(tls *libc.TLS, pParse uintptr, pTab uintptr, pOnlyIdx uintptr) { /* sqlite3.c:110978:13: */
+func analyzeTable(tls *libc.TLS, pParse uintptr, pTab uintptr, pOnlyIdx uintptr) { /* sqlite3.c:111579:13: */
var iDb int32
var iStatCur int32
iDb = Xsqlite3SchemaToIndex(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, (*Table)(unsafe.Pointer(pTab)).FpSchema)
Xsqlite3BeginWriteOperation(tls, pParse, 0, iDb)
iStatCur = (*Parse)(unsafe.Pointer(pParse)).FnTab
- *(*int32)(unsafe.Pointer(pParse + 40 /* &.nTab */)) += (3)
+ *(*int32)(unsafe.Pointer(pParse + 40)) += 3
if pOnlyIdx != 0 {
- openStatTable(tls, pParse, iDb, iStatCur, (*Index)(unsafe.Pointer(pOnlyIdx)).FzName, ts+10212 /* "idx" */)
+ openStatTable(tls, pParse, iDb, iStatCur, (*Index)(unsafe.Pointer(pOnlyIdx)).FzName, ts+11326 /* "idx" */)
} else {
- openStatTable(tls, pParse, iDb, iStatCur, (*Table)(unsafe.Pointer(pTab)).FzName, ts+10216 /* "tbl" */)
+ openStatTable(tls, pParse, iDb, iStatCur, (*Table)(unsafe.Pointer(pTab)).FzName, ts+11330 /* "tbl" */)
}
- analyzeOneTable(tls, pParse, pTab, pOnlyIdx, iStatCur, ((*Parse)(unsafe.Pointer(pParse)).FnMem + 1), (*Parse)(unsafe.Pointer(pParse)).FnTab)
+ analyzeOneTable(tls, pParse, pTab, pOnlyIdx, iStatCur, (*Parse)(unsafe.Pointer(pParse)).FnMem+1, (*Parse)(unsafe.Pointer(pParse)).FnTab)
loadAnalysis(tls, pParse, iDb)
}
@@ -91163,7 +92351,7 @@ func analyzeTable(tls *libc.TLS, pParse uintptr, pTab uintptr, pOnlyIdx uintptr)
// Form 1 causes all indices in all attached databases to be analyzed.
// Form 2 analyzes all indices the single database named.
// Form 3 analyzes all indices associated with the named table.
-func Xsqlite3Analyze(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 uintptr) { /* sqlite3.c:111009:21: */
+func Xsqlite3Analyze(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 uintptr) { /* sqlite3.c:111610:21: */
bp := tls.Alloc(4)
defer tls.Free(4)
@@ -91193,7 +92381,7 @@ func Xsqlite3Analyze(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 uintp
} // Do not analyze the TEMP database
analyzeDatabase(tls, pParse, i)
}
- } else if ((*Token)(unsafe.Pointer(pName2)).Fn == uint32(0)) && ((libc.AssignInt32(&iDb, Xsqlite3FindDb(tls, db, pName1))) >= 0) {
+ } else if (*Token)(unsafe.Pointer(pName2)).Fn == uint32(0) && libc.AssignInt32(&iDb, Xsqlite3FindDb(tls, db, pName1)) >= 0 {
// Analyze the schema named as the argument
analyzeDatabase(tls, pParse, iDb)
} else {
@@ -91207,16 +92395,16 @@ func Xsqlite3Analyze(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 uintp
}
z = Xsqlite3NameFromToken(tls, db, *(*uintptr)(unsafe.Pointer(bp /* pTableName */)))
if z != 0 {
- if (libc.AssignUintptr(&pIdx, Xsqlite3FindIndex(tls, db, z, zDb))) != uintptr(0) {
+ if libc.AssignUintptr(&pIdx, Xsqlite3FindIndex(tls, db, z, zDb)) != uintptr(0) {
analyzeTable(tls, pParse, (*Index)(unsafe.Pointer(pIdx)).FpTable, pIdx)
- } else if (libc.AssignUintptr(&pTab, Xsqlite3LocateTable(tls, pParse, uint32(0), z, zDb))) != uintptr(0) {
+ } else if libc.AssignUintptr(&pTab, Xsqlite3LocateTable(tls, pParse, uint32(0), z, zDb)) != uintptr(0) {
analyzeTable(tls, pParse, pTab, uintptr(0))
}
Xsqlite3DbFree(tls, db, z)
}
}
}
- if (int32((*Sqlite3)(unsafe.Pointer(db)).FnSqlExec) == 0) && ((libc.AssignUintptr(&v, Xsqlite3GetVdbe(tls, pParse))) != uintptr(0)) {
+ if int32((*Sqlite3)(unsafe.Pointer(db)).FnSqlExec) == 0 && libc.AssignUintptr(&v, Xsqlite3GetVdbe(tls, pParse)) != uintptr(0) {
Xsqlite3VdbeAddOp0(tls, v, OP_Expire)
}
}
@@ -91226,28 +92414,28 @@ func Xsqlite3Analyze(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 uintp
type analysisInfo = struct {
Fdb uintptr
FzDatabase uintptr
-} /* sqlite3.c:111061:9 */
+} /* sqlite3.c:111662:9 */
// Used to pass information from the analyzer reader through to the
// callback routine.
-type AnalysisInfo = analysisInfo /* sqlite3.c:111061:29 */
+type AnalysisInfo = analysisInfo /* sqlite3.c:111662:29 */
// The first argument points to a nul-terminated string containing a
// list of space separated integers. Read the first nOut of these into
// the array aOut[].
-func decodeIntArray(tls *libc.TLS, zIntArray uintptr, nOut int32, aOut uintptr, aLog uintptr, pIndex uintptr) { /* sqlite3.c:111072:13: */
+func decodeIntArray(tls *libc.TLS, zIntArray uintptr, nOut int32, aOut uintptr, aLog uintptr, pIndex uintptr) { /* sqlite3.c:111673:13: */
var z uintptr = zIntArray
var c int32
var i int32
var v TRowcnt
if z == uintptr(0) {
- z = ts + 755 /* "" */
+ z = ts + 1543 /* "" */
}
- for i = 0; (*(*uint8)(unsafe.Pointer(z)) != 0) && (i < nOut); i++ {
+ for i = 0; *(*uint8)(unsafe.Pointer(z)) != 0 && i < nOut; i++ {
v = TRowcnt(0)
- for ((libc.AssignInt32(&c, int32(*(*uint8)(unsafe.Pointer(z))))) >= '0') && (c <= '9') {
- v = (((v * TRowcnt(10)) + TRowcnt(c)) - TRowcnt('0'))
+ for libc.AssignInt32(&c, int32(*(*uint8)(unsafe.Pointer(z)))) >= '0' && c <= '9' {
+ v = v*TRowcnt(10) + TRowcnt(c) - TRowcnt('0')
z++
}
if aOut != 0 {
@@ -91261,21 +92449,21 @@ func decodeIntArray(tls *libc.TLS, zIntArray uintptr, nOut int32, aOut uintptr,
}
}
if pIndex != 0 {
- libc.SetBitFieldPtr16Uint32(pIndex+56 /* &.bUnordered */, uint32(0), 2, 0x4)
- libc.SetBitFieldPtr16Uint32(pIndex+56 /* &.noSkipScan */, uint32(0), 6, 0x40)
+ libc.SetBitFieldPtr16Uint32(pIndex+56, uint32(0), 2, 0x4)
+ libc.SetBitFieldPtr16Uint32(pIndex+56, uint32(0), 6, 0x40)
for *(*uint8)(unsafe.Pointer(z)) != 0 {
- if Xsqlite3_strglob(tls, ts+10220 /* "unordered*" */, z) == 0 {
- libc.SetBitFieldPtr16Uint32(pIndex+56 /* &.bUnordered */, uint32(1), 2, 0x4)
- } else if Xsqlite3_strglob(tls, ts+10231 /* "sz=[0-9]*" */, z) == 0 {
- var sz int32 = Xsqlite3Atoi(tls, (z + uintptr(3)))
+ if Xsqlite3_strglob(tls, ts+11334, z) == 0 {
+ libc.SetBitFieldPtr16Uint32(pIndex+56, uint32(1), 2, 0x4)
+ } else if Xsqlite3_strglob(tls, ts+11345, z) == 0 {
+ var sz int32 = Xsqlite3Atoi(tls, z+uintptr(3))
if sz < 2 {
sz = 2
}
(*Index)(unsafe.Pointer(pIndex)).FszIdxRow = Xsqlite3LogEst(tls, uint64(sz))
- } else if Xsqlite3_strglob(tls, ts+10241 /* "noskipscan*" */, z) == 0 {
- libc.SetBitFieldPtr16Uint32(pIndex+56 /* &.noSkipScan */, uint32(1), 6, 0x40)
+ } else if Xsqlite3_strglob(tls, ts+11355, z) == 0 {
+ libc.SetBitFieldPtr16Uint32(pIndex+56, uint32(1), 6, 0x40)
}
- for (int32(*(*uint8)(unsafe.Pointer(z))) != 0) && (int32(*(*uint8)(unsafe.Pointer(z))) != ' ') {
+ for int32(*(*uint8)(unsafe.Pointer(z))) != 0 && int32(*(*uint8)(unsafe.Pointer(z))) != ' ' {
z++
}
for int32(*(*uint8)(unsafe.Pointer(z))) == ' ' {
@@ -91294,7 +92482,7 @@ func decodeIntArray(tls *libc.TLS, zIntArray uintptr, nOut int32, aOut uintptr,
//
// Entries for which argv[1]==NULL simply record the number of rows in
// the table.
-func analysisLoader(tls *libc.TLS, pData uintptr, argc int32, argv uintptr, NotUsed uintptr) int32 { /* sqlite3.c:111145:12: */
+func analysisLoader(tls *libc.TLS, pData uintptr, argc int32, argv uintptr, NotUsed uintptr) int32 { /* sqlite3.c:111746:12: */
bp := tls.Alloc(96)
defer tls.Free(96)
@@ -91306,7 +92494,7 @@ func analysisLoader(tls *libc.TLS, pData uintptr, argc int32, argv uintptr, NotU
_ = NotUsed
_ = argc
- if ((argv == uintptr(0)) || (*(*uintptr)(unsafe.Pointer(argv)) == uintptr(0))) || (*(*uintptr)(unsafe.Pointer(argv + 2*4)) == uintptr(0)) {
+ if argv == uintptr(0) || *(*uintptr)(unsafe.Pointer(argv)) == uintptr(0) || *(*uintptr)(unsafe.Pointer(argv + 2*4)) == uintptr(0) {
return 0
}
pTable = Xsqlite3FindTable(tls, (*AnalysisInfo)(unsafe.Pointer(pInfo)).Fdb, *(*uintptr)(unsafe.Pointer(argv)), (*AnalysisInfo)(unsafe.Pointer(pInfo)).FzDatabase)
@@ -91324,31 +92512,31 @@ func analysisLoader(tls *libc.TLS, pData uintptr, argc int32, argv uintptr, NotU
if pIndex != 0 {
var aiRowEst uintptr = uintptr(0)
- var nCol int32 = (int32((*Index)(unsafe.Pointer(pIndex)).FnKeyCol) + 1)
+ var nCol int32 = int32((*Index)(unsafe.Pointer(pIndex)).FnKeyCol) + 1
// Index.aiRowEst may already be set here if there are duplicate
// sqlite_stat1 entries for this index. In that case just clobber
// the old data with the new instead of allocating a new array.
if (*Index)(unsafe.Pointer(pIndex)).FaiRowEst == uintptr(0) {
- (*Index)(unsafe.Pointer(pIndex)).FaiRowEst = Xsqlite3MallocZero(tls, (uint64(uint32(unsafe.Sizeof(TRowcnt(0))) * uint32(nCol))))
+ (*Index)(unsafe.Pointer(pIndex)).FaiRowEst = Xsqlite3MallocZero(tls, uint64(uint32(unsafe.Sizeof(TRowcnt(0)))*uint32(nCol)))
if (*Index)(unsafe.Pointer(pIndex)).FaiRowEst == uintptr(0) {
Xsqlite3OomFault(tls, (*AnalysisInfo)(unsafe.Pointer(pInfo)).Fdb)
}
}
aiRowEst = (*Index)(unsafe.Pointer(pIndex)).FaiRowEst
- libc.SetBitFieldPtr16Uint32(pIndex+56 /* &.bUnordered */, uint32(0), 2, 0x4)
+ libc.SetBitFieldPtr16Uint32(pIndex+56, uint32(0), 2, 0x4)
decodeIntArray(tls, z, nCol, aiRowEst, (*Index)(unsafe.Pointer(pIndex)).FaiRowLogEst, pIndex)
- libc.SetBitFieldPtr16Uint32(pIndex+56 /* &.hasStat1 */, uint32(1), 7, 0x80)
+ libc.SetBitFieldPtr16Uint32(pIndex+56, uint32(1), 7, 0x80)
if (*Index)(unsafe.Pointer(pIndex)).FpPartIdxWhere == uintptr(0) {
(*Table)(unsafe.Pointer(pTable)).FnRowLogEst = *(*LogEst)(unsafe.Pointer((*Index)(unsafe.Pointer(pIndex)).FaiRowLogEst))
- *(*U32)(unsafe.Pointer(pTable + 36 /* &.tabFlags */)) |= (U32(TF_HasStat1))
+ *(*U32)(unsafe.Pointer(pTable + 28)) |= U32(TF_HasStat1)
}
} else {
// var fakeIdx Index at bp, 96
(*Index)(unsafe.Pointer(bp /* &fakeIdx */)).FszIdxRow = (*Table)(unsafe.Pointer(pTable)).FszTabRow
- decodeIntArray(tls, z, 1, uintptr(0), (pTable + 46 /* &.nRowLogEst */), bp /* &fakeIdx */)
+ decodeIntArray(tls, z, 1, uintptr(0), pTable+38, bp /* &fakeIdx */)
(*Table)(unsafe.Pointer(pTable)).FszTabRow = (*Index)(unsafe.Pointer(bp /* &fakeIdx */)).FszIdxRow
- *(*U32)(unsafe.Pointer(pTable + 36 /* &.tabFlags */)) |= (U32(TF_HasStat1))
+ *(*U32)(unsafe.Pointer(pTable + 28)) |= U32(TF_HasStat1)
}
return 0
@@ -91356,16 +92544,16 @@ func analysisLoader(tls *libc.TLS, pData uintptr, argc int32, argv uintptr, NotU
// If the Index.aSample variable is not NULL, delete the aSample[] array
// and its contents.
-func Xsqlite3DeleteIndexSamples(tls *libc.TLS, db uintptr, pIdx uintptr) { /* sqlite3.c:111208:21: */
+func Xsqlite3DeleteIndexSamples(tls *libc.TLS, db uintptr, pIdx uintptr) { /* sqlite3.c:111809:21: */
if (*Index)(unsafe.Pointer(pIdx)).FaSample != 0 {
var j int32
for j = 0; j < (*Index)(unsafe.Pointer(pIdx)).FnSample; j++ {
- var p uintptr = ((*Index)(unsafe.Pointer(pIdx)).FaSample + uintptr(j)*20)
+ var p uintptr = (*Index)(unsafe.Pointer(pIdx)).FaSample + uintptr(j)*20
Xsqlite3DbFree(tls, db, (*IndexSample)(unsafe.Pointer(p)).Fp)
}
Xsqlite3DbFree(tls, db, (*Index)(unsafe.Pointer(pIdx)).FaSample)
}
- if (db != 0) && ((*Sqlite3)(unsafe.Pointer(db)).FpnBytesFreed == uintptr(0)) {
+ if db != 0 && (*Sqlite3)(unsafe.Pointer(db)).FpnBytesFreed == uintptr(0) {
(*Index)(unsafe.Pointer(pIdx)).FnSample = 0
(*Index)(unsafe.Pointer(pIdx)).FaSample = uintptr(0)
}
@@ -91373,10 +92561,10 @@ func Xsqlite3DeleteIndexSamples(tls *libc.TLS, db uintptr, pIdx uintptr) { /* sq
// Populate the pIdx->aAvgEq[] array based on the samples currently
// stored in pIdx->aSample[].
-func initAvgEq(tls *libc.TLS, pIdx uintptr) { /* sqlite3.c:111233:13: */
+func initAvgEq(tls *libc.TLS, pIdx uintptr) { /* sqlite3.c:111834:13: */
if pIdx != 0 {
var aSample uintptr = (*Index)(unsafe.Pointer(pIdx)).FaSample
- var pFinal uintptr = (aSample + uintptr(((*Index)(unsafe.Pointer(pIdx)).FnSample-1))*20)
+ var pFinal uintptr = aSample + uintptr((*Index)(unsafe.Pointer(pIdx)).FnSample-1)*20
var iCol int32
var nCol int32 = 1
if (*Index)(unsafe.Pointer(pIdx)).FnSampleCol > 1 {
@@ -91384,7 +92572,7 @@ func initAvgEq(tls *libc.TLS, pIdx uintptr) { /* sqlite3.c:111233:13: */
// sample columns except the last. The last is always set to 1, as
// once the trailing PK fields are considered all index keys are
// unique.
- nCol = ((*Index)(unsafe.Pointer(pIdx)).FnSampleCol - 1)
+ nCol = (*Index)(unsafe.Pointer(pIdx)).FnSampleCol - 1
*(*TRowcnt)(unsafe.Pointer((*Index)(unsafe.Pointer(pIdx)).FaAvgEq + uintptr(nCol)*4)) = TRowcnt(1)
}
for iCol = 0; iCol < nCol; iCol++ {
@@ -91396,13 +92584,13 @@ func initAvgEq(tls *libc.TLS, pIdx uintptr) { /* sqlite3.c:111233:13: */
var nSum100 I64 = int64(0) // Number of terms contributing to sumEq
var nDist100 I64 // Number of distinct values in index
- if (!(int32((*Index)(unsafe.Pointer(pIdx)).FaiRowEst) != 0) || (iCol >= int32((*Index)(unsafe.Pointer(pIdx)).FnKeyCol))) || (*(*TRowcnt)(unsafe.Pointer((*Index)(unsafe.Pointer(pIdx)).FaiRowEst + uintptr((iCol+1))*4)) == TRowcnt(0)) {
+ if !(int32((*Index)(unsafe.Pointer(pIdx)).FaiRowEst) != 0) || iCol >= int32((*Index)(unsafe.Pointer(pIdx)).FnKeyCol) || *(*TRowcnt)(unsafe.Pointer((*Index)(unsafe.Pointer(pIdx)).FaiRowEst + uintptr(iCol+1)*4)) == TRowcnt(0) {
nRow = *(*TRowcnt)(unsafe.Pointer((*IndexSample)(unsafe.Pointer(pFinal)).FanLt + uintptr(iCol)*4))
- nDist100 = (int64(100) * I64(*(*TRowcnt)(unsafe.Pointer((*IndexSample)(unsafe.Pointer(pFinal)).FanDLt + uintptr(iCol)*4))))
+ nDist100 = int64(100) * I64(*(*TRowcnt)(unsafe.Pointer((*IndexSample)(unsafe.Pointer(pFinal)).FanDLt + uintptr(iCol)*4)))
nSample--
} else {
nRow = *(*TRowcnt)(unsafe.Pointer((*Index)(unsafe.Pointer(pIdx)).FaiRowEst))
- nDist100 = ((int64(100) * I64(*(*TRowcnt)(unsafe.Pointer((*Index)(unsafe.Pointer(pIdx)).FaiRowEst)))) / I64(*(*TRowcnt)(unsafe.Pointer((*Index)(unsafe.Pointer(pIdx)).FaiRowEst + uintptr((iCol+1))*4))))
+ nDist100 = int64(100) * I64(*(*TRowcnt)(unsafe.Pointer((*Index)(unsafe.Pointer(pIdx)).FaiRowEst))) / I64(*(*TRowcnt)(unsafe.Pointer((*Index)(unsafe.Pointer(pIdx)).FaiRowEst + uintptr(iCol+1)*4)))
}
(*Index)(unsafe.Pointer(pIdx)).FnRowEst0 = nRow
@@ -91411,15 +92599,15 @@ func initAvgEq(tls *libc.TLS, pIdx uintptr) { /* sqlite3.c:111233:13: */
// the nEq values for column iCol for the same set (adding the value
// only once where there exist duplicate prefixes).
for i = 0; i < nSample; i++ {
- if (i == ((*Index)(unsafe.Pointer(pIdx)).FnSample - 1)) ||
- (*(*TRowcnt)(unsafe.Pointer((*IndexSample)(unsafe.Pointer(aSample+uintptr(i)*20)).FanDLt + uintptr(iCol)*4)) != *(*TRowcnt)(unsafe.Pointer((*IndexSample)(unsafe.Pointer(aSample+uintptr((i+1))*20)).FanDLt + uintptr(iCol)*4))) {
- sumEq = sumEq + (*(*TRowcnt)(unsafe.Pointer((*IndexSample)(unsafe.Pointer(aSample+uintptr(i)*20)).FanEq + uintptr(iCol)*4)))
- nSum100 = nSum100 + (int64(100))
+ if i == (*Index)(unsafe.Pointer(pIdx)).FnSample-1 ||
+ *(*TRowcnt)(unsafe.Pointer((*IndexSample)(unsafe.Pointer(aSample+uintptr(i)*20)).FanDLt + uintptr(iCol)*4)) != *(*TRowcnt)(unsafe.Pointer((*IndexSample)(unsafe.Pointer(aSample+uintptr(i+1)*20)).FanDLt + uintptr(iCol)*4)) {
+ sumEq = sumEq + *(*TRowcnt)(unsafe.Pointer((*IndexSample)(unsafe.Pointer(aSample+uintptr(i)*20)).FanEq + uintptr(iCol)*4))
+ nSum100 = nSum100 + int64(100)
}
}
- if (nDist100 > nSum100) && (sumEq < nRow) {
- avgEq = (TRowcnt((int64(100) * (I64(nRow - sumEq))) / (nDist100 - nSum100)))
+ if nDist100 > nSum100 && sumEq < nRow {
+ avgEq = TRowcnt(int64(100) * I64(nRow-sumEq) / (nDist100 - nSum100))
}
if avgEq == TRowcnt(0) {
avgEq = TRowcnt(1)
@@ -91431,11 +92619,11 @@ func initAvgEq(tls *libc.TLS, pIdx uintptr) { /* sqlite3.c:111233:13: */
// Look up an index by name. Or, if the name of a WITHOUT ROWID table
// is supplied instead, find the PRIMARY KEY index for that table.
-func findIndexOrPrimaryKey(tls *libc.TLS, db uintptr, zName uintptr, zDb uintptr) uintptr { /* sqlite3.c:111292:14: */
+func findIndexOrPrimaryKey(tls *libc.TLS, db uintptr, zName uintptr, zDb uintptr) uintptr { /* sqlite3.c:111893:14: */
var pIdx uintptr = Xsqlite3FindIndex(tls, db, zName, zDb)
if pIdx == uintptr(0) {
var pTab uintptr = Xsqlite3FindTable(tls, db, zName, zDb)
- if (pTab != 0) && !(((*Table)(unsafe.Pointer((pTab))).FtabFlags & U32(TF_WithoutRowid)) == U32(0)) {
+ if pTab != 0 && !((*Table)(unsafe.Pointer(pTab)).FtabFlags&U32(TF_WithoutRowid) == U32(0)) {
pIdx = Xsqlite3PrimaryKeyIndex(tls, pTab)
}
}
@@ -91452,7 +92640,7 @@ func findIndexOrPrimaryKey(tls *libc.TLS, db uintptr, zName uintptr, zDb uintptr
// zSql2: SELECT idx,neq,nlt,ndlt,sample FROM %Q.sqlite_stat4
//
// where %Q is replaced with the database name before the SQL is executed.
-func loadStatTbl(tls *libc.TLS, db uintptr, zSql1 uintptr, zSql2 uintptr, zDb uintptr) int32 { /* sqlite3.c:111317:12: */
+func loadStatTbl(tls *libc.TLS, db uintptr, zSql1 uintptr, zSql2 uintptr, zDb uintptr) int32 { /* sqlite3.c:111918:12: */
bp := tls.Alloc(20)
defer tls.Free(20)
@@ -91472,7 +92660,7 @@ func loadStatTbl(tls *libc.TLS, db uintptr, zSql1 uintptr, zSql2 uintptr, zDb ui
return rc
}
- for Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp + 16 /* pStmt */))) == SQLITE_ROW {
+ for Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp + 16))) == SQLITE_ROW {
var nIdxCol int32 = 1 // Number of columns in stat4 records
var zIndex uintptr // Index name
@@ -91493,32 +92681,32 @@ func loadStatTbl(tls *libc.TLS, db uintptr, zSql1 uintptr, zSql2 uintptr, zDb ui
continue
}
- if !(((*Table)(unsafe.Pointer(((*Index)(unsafe.Pointer(pIdx)).FpTable))).FtabFlags & U32(TF_WithoutRowid)) == U32(0)) && ((int32(*(*uint16)(unsafe.Pointer((pIdx) + 56 /* &.idxType */)) & 0x3 >> 0)) == SQLITE_IDXTYPE_PRIMARYKEY) {
+ if !((*Table)(unsafe.Pointer((*Index)(unsafe.Pointer(pIdx)).FpTable)).FtabFlags&U32(TF_WithoutRowid) == U32(0)) && int32(*(*uint16)(unsafe.Pointer(pIdx + 56))&0x3>>0) == SQLITE_IDXTYPE_PRIMARYKEY {
nIdxCol = int32((*Index)(unsafe.Pointer(pIdx)).FnKeyCol)
} else {
nIdxCol = int32((*Index)(unsafe.Pointer(pIdx)).FnColumn)
}
(*Index)(unsafe.Pointer(pIdx)).FnSampleCol = nIdxCol
- nByte = (int32(uint32(unsafe.Sizeof(IndexSample{})) * uint32(nSample)))
- nByte = int32(uint32(nByte) + (((uint32(unsafe.Sizeof(TRowcnt(0))) * uint32(nIdxCol)) * uint32(3)) * uint32(nSample)))
- nByte = int32(uint32(nByte) + (uint32(nIdxCol) * uint32(unsafe.Sizeof(TRowcnt(0))))) // Space for Index.aAvgEq[]
+ nByte = int32(uint32(unsafe.Sizeof(IndexSample{})) * uint32(nSample))
+ nByte = int32(uint32(nByte) + uint32(unsafe.Sizeof(TRowcnt(0)))*uint32(nIdxCol)*uint32(3)*uint32(nSample))
+ nByte = int32(uint32(nByte) + uint32(nIdxCol)*uint32(unsafe.Sizeof(TRowcnt(0)))) // Space for Index.aAvgEq[]
(*Index)(unsafe.Pointer(pIdx)).FaSample = Xsqlite3DbMallocZero(tls, db, uint64(nByte))
if (*Index)(unsafe.Pointer(pIdx)).FaSample == uintptr(0) {
Xsqlite3_finalize(tls, *(*uintptr)(unsafe.Pointer(bp + 16 /* pStmt */)))
return SQLITE_NOMEM
}
- pSpace = ((*Index)(unsafe.Pointer(pIdx)).FaSample + uintptr(nSample)*20)
+ pSpace = (*Index)(unsafe.Pointer(pIdx)).FaSample + uintptr(nSample)*20
(*Index)(unsafe.Pointer(pIdx)).FaAvgEq = pSpace
- pSpace += 4 * (uintptr(nIdxCol))
- *(*U32)(unsafe.Pointer((*Index)(unsafe.Pointer(pIdx)).FpTable + 36 /* &.tabFlags */)) |= (U32(TF_HasStat4))
+ pSpace += 4 * uintptr(nIdxCol)
+ *(*U32)(unsafe.Pointer((*Index)(unsafe.Pointer(pIdx)).FpTable + 28)) |= U32(TF_HasStat4)
for i = 0; i < nSample; i++ {
(*IndexSample)(unsafe.Pointer((*Index)(unsafe.Pointer(pIdx)).FaSample + uintptr(i)*20)).FanEq = pSpace
- pSpace += 4 * (uintptr(nIdxCol))
+ pSpace += 4 * uintptr(nIdxCol)
(*IndexSample)(unsafe.Pointer((*Index)(unsafe.Pointer(pIdx)).FaSample + uintptr(i)*20)).FanLt = pSpace
- pSpace += 4 * (uintptr(nIdxCol))
+ pSpace += 4 * uintptr(nIdxCol)
(*IndexSample)(unsafe.Pointer((*Index)(unsafe.Pointer(pIdx)).FaSample + uintptr(i)*20)).FanDLt = pSpace
- pSpace += 4 * (uintptr(nIdxCol))
+ pSpace += 4 * uintptr(nIdxCol)
}
}
@@ -91537,7 +92725,7 @@ func loadStatTbl(tls *libc.TLS, db uintptr, zSql1 uintptr, zSql2 uintptr, zDb ui
return rc
}
- for Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp + 16 /* pStmt */))) == SQLITE_ROW {
+ for Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp + 16))) == SQLITE_ROW {
var zIndex uintptr // Index name
var pIdx uintptr // Pointer to the index object
var nCol int32 = 1 // Number of columns in index
@@ -91557,7 +92745,7 @@ func loadStatTbl(tls *libc.TLS, db uintptr, zSql1 uintptr, zSql2 uintptr, zDb ui
initAvgEq(tls, pPrevIdx)
pPrevIdx = pIdx
}
- pSample = ((*Index)(unsafe.Pointer(pIdx)).FaSample + uintptr((*Index)(unsafe.Pointer(pIdx)).FnSample)*20)
+ pSample = (*Index)(unsafe.Pointer(pIdx)).FaSample + uintptr((*Index)(unsafe.Pointer(pIdx)).FnSample)*20
decodeIntArray(tls, Xsqlite3_column_text(tls, *(*uintptr)(unsafe.Pointer(bp + 16 /* pStmt */)), 1), nCol, (*IndexSample)(unsafe.Pointer(pSample)).FanEq, uintptr(0), uintptr(0))
decodeIntArray(tls, Xsqlite3_column_text(tls, *(*uintptr)(unsafe.Pointer(bp + 16 /* pStmt */)), 2), nCol, (*IndexSample)(unsafe.Pointer(pSample)).FanLt, uintptr(0), uintptr(0))
decodeIntArray(tls, Xsqlite3_column_text(tls, *(*uintptr)(unsafe.Pointer(bp + 16 /* pStmt */)), 3), nCol, (*IndexSample)(unsafe.Pointer(pSample)).FanDLt, uintptr(0), uintptr(0))
@@ -91569,7 +92757,7 @@ func loadStatTbl(tls *libc.TLS, db uintptr, zSql1 uintptr, zSql2 uintptr, zDb ui
// a corrupt record. Adding the two 0x00 bytes prevents this from causing
// a buffer overread.
(*IndexSample)(unsafe.Pointer(pSample)).Fn = Xsqlite3_column_bytes(tls, *(*uintptr)(unsafe.Pointer(bp + 16 /* pStmt */)), 4)
- (*IndexSample)(unsafe.Pointer(pSample)).Fp = Xsqlite3DbMallocZero(tls, db, (uint64((*IndexSample)(unsafe.Pointer(pSample)).Fn + 2)))
+ (*IndexSample)(unsafe.Pointer(pSample)).Fp = Xsqlite3DbMallocZero(tls, db, uint64((*IndexSample)(unsafe.Pointer(pSample)).Fn+2))
if (*IndexSample)(unsafe.Pointer(pSample)).Fp == uintptr(0) {
Xsqlite3_finalize(tls, *(*uintptr)(unsafe.Pointer(bp + 16 /* pStmt */)))
return SQLITE_NOMEM
@@ -91588,13 +92776,15 @@ func loadStatTbl(tls *libc.TLS, db uintptr, zSql1 uintptr, zSql2 uintptr, zDb ui
// Load content from the sqlite_stat4 table into
// the Index.aSample[] arrays of all indices.
-func loadStat4(tls *libc.TLS, db uintptr, zDb uintptr) int32 { /* sqlite3.c:111438:12: */
+func loadStat4(tls *libc.TLS, db uintptr, zDb uintptr) int32 { /* sqlite3.c:112039:12: */
var rc int32 = SQLITE_OK // Result codes from subroutines
+ var pStat4 uintptr
- if Xsqlite3FindTable(tls, db, ts+10098 /* "sqlite_stat4" */, zDb) != 0 {
+ if libc.AssignUintptr(&pStat4, Xsqlite3FindTable(tls, db, ts+11212, zDb)) != uintptr(0) &&
+ int32((*Table)(unsafe.Pointer(pStat4)).FeTabType) == TABTYP_NORM {
rc = loadStatTbl(tls, db,
- ts+10253, /* "SELECT idx,count..." */
- ts+10307, /* "SELECT idx,neq,n..." */
+ ts+11367, /* "SELECT idx,count..." */
+ ts+11421, /* "SELECT idx,neq,n..." */
zDb)
}
return rc
@@ -91618,7 +92808,7 @@ func loadStat4(tls *libc.TLS, db uintptr, zDb uintptr) int32 { /* sqlite3.c:1114
// If an OOM error occurs, this function always sets db->mallocFailed.
// This means if the caller does not care about other errors, the return
// code may be ignored.
-func Xsqlite3AnalysisLoad(tls *libc.TLS, db uintptr, iDb int32) int32 { /* sqlite3.c:111473:20: */
+func Xsqlite3AnalysisLoad(tls *libc.TLS, db uintptr, iDb int32) int32 { /* sqlite3.c:112077:20: */
bp := tls.Alloc(16)
defer tls.Free(16)
@@ -91628,16 +92818,17 @@ func Xsqlite3AnalysisLoad(tls *libc.TLS, db uintptr, iDb int32) int32 { /* sqlit
var zSql uintptr
var rc int32 = SQLITE_OK
var pSchema uintptr = (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*16)).FpSchema
+ var pStat1 uintptr
// Clear any prior statistics
- for i = (*Hash)(unsafe.Pointer((pSchema + 8 /* &.tblHash */))).Ffirst; i != 0; i = (*HashElem)(unsafe.Pointer(i)).Fnext {
+ for i = (*Hash)(unsafe.Pointer(pSchema + 8)).Ffirst; i != 0; i = (*HashElem)(unsafe.Pointer(i)).Fnext {
var pTab uintptr = (*HashElem)(unsafe.Pointer(i)).Fdata
- *(*U32)(unsafe.Pointer(pTab + 36 /* &.tabFlags */)) &= (libc.Uint32FromInt32(libc.CplInt32(TF_HasStat1)))
+ *(*U32)(unsafe.Pointer(pTab + 28)) &= libc.Uint32FromInt32(libc.CplInt32(TF_HasStat1))
}
- for i = (*Hash)(unsafe.Pointer((pSchema + 24 /* &.idxHash */))).Ffirst; i != 0; i = (*HashElem)(unsafe.Pointer(i)).Fnext {
+ for i = (*Hash)(unsafe.Pointer(pSchema + 24)).Ffirst; i != 0; i = (*HashElem)(unsafe.Pointer(i)).Fnext {
var pIdx uintptr = (*HashElem)(unsafe.Pointer(i)).Fdata
- libc.SetBitFieldPtr16Uint32(pIdx+56 /* &.hasStat1 */, uint32(0), 7, 0x80)
+ libc.SetBitFieldPtr16Uint32(pIdx+56, uint32(0), 7, 0x80)
Xsqlite3DeleteIndexSamples(tls, db, pIdx)
(*Index)(unsafe.Pointer(pIdx)).FaSample = uintptr(0)
}
@@ -91645,9 +92836,10 @@ func Xsqlite3AnalysisLoad(tls *libc.TLS, db uintptr, iDb int32) int32 { /* sqlit
// Load new statistics out of the sqlite_stat1 table
(*AnalysisInfo)(unsafe.Pointer(bp + 8 /* &sInfo */)).Fdb = db
(*AnalysisInfo)(unsafe.Pointer(bp + 8 /* &sInfo */)).FzDatabase = (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*16)).FzDbSName
- if Xsqlite3FindTable(tls, db, ts+10072 /* "sqlite_stat1" */, (*AnalysisInfo)(unsafe.Pointer(bp+8 /* &sInfo */)).FzDatabase) != uintptr(0) {
+ if libc.AssignUintptr(&pStat1, Xsqlite3FindTable(tls, db, ts+11186, (*AnalysisInfo)(unsafe.Pointer(bp+8)).FzDatabase)) != 0 &&
+ int32((*Table)(unsafe.Pointer(pStat1)).FeTabType) == TABTYP_NORM {
zSql = Xsqlite3MPrintf(tls, db,
- ts+10359 /* "SELECT tbl,idx,s..." */, libc.VaList(bp, (*AnalysisInfo)(unsafe.Pointer(bp+8 /* &sInfo */)).FzDatabase))
+ ts+11473 /* "SELECT tbl,idx,s..." */, libc.VaList(bp, (*AnalysisInfo)(unsafe.Pointer(bp+8 /* &sInfo */)).FzDatabase))
if zSql == uintptr(0) {
rc = SQLITE_NOMEM
} else {
@@ -91660,9 +92852,9 @@ func Xsqlite3AnalysisLoad(tls *libc.TLS, db uintptr, iDb int32) int32 { /* sqlit
// Set appropriate defaults on all indexes not in the sqlite_stat1 table
- for i = (*Hash)(unsafe.Pointer((pSchema + 24 /* &.idxHash */))).Ffirst; i != 0; i = (*HashElem)(unsafe.Pointer(i)).Fnext {
+ for i = (*Hash)(unsafe.Pointer(pSchema + 24)).Ffirst; i != 0; i = (*HashElem)(unsafe.Pointer(i)).Fnext {
var pIdx uintptr = (*HashElem)(unsafe.Pointer(i)).Fdata
- if !((int32(*(*uint16)(unsafe.Pointer(pIdx + 56 /* &.hasStat1 */)) & 0x80 >> 7)) != 0) {
+ if !(int32(*(*uint16)(unsafe.Pointer(pIdx + 56))&0x80>>7) != 0) {
Xsqlite3DefaultRowEst(tls, pIdx)
}
}
@@ -91680,7 +92872,7 @@ func Xsqlite3AnalysisLoad(tls *libc.TLS, db uintptr, iDb int32) int32 { /* sqlit
return (*Sqlite3)(unsafe.Pointer(db)).Flookaside.FszTrue
}()
}
- for i = (*Hash)(unsafe.Pointer((pSchema + 24 /* &.idxHash */))).Ffirst; i != 0; i = (*HashElem)(unsafe.Pointer(i)).Fnext {
+ for i = (*Hash)(unsafe.Pointer(pSchema + 24)).Ffirst; i != 0; i = (*HashElem)(unsafe.Pointer(i)).Fnext {
var pIdx uintptr = (*HashElem)(unsafe.Pointer(i)).Fdata
Xsqlite3_free(tls, (*Index)(unsafe.Pointer(pIdx)).FaiRowEst)
(*Index)(unsafe.Pointer(pIdx)).FaiRowEst = uintptr(0)
@@ -91723,7 +92915,7 @@ func Xsqlite3AnalysisLoad(tls *libc.TLS, db uintptr, iDb int32) int32 { /* sqlit
// ATTACH DATABASE abc||def AS 'db2'
//
// will fail because neither abc or def can be resolved.
-func resolveAttachExpr(tls *libc.TLS, pName uintptr, pExpr uintptr) int32 { /* sqlite3.c:111578:12: */
+func resolveAttachExpr(tls *libc.TLS, pName uintptr, pExpr uintptr) int32 { /* sqlite3.c:112185:12: */
var rc int32 = SQLITE_OK
if pExpr != 0 {
if int32((*Expr)(unsafe.Pointer(pExpr)).Fop) != TK_ID {
@@ -91737,9 +92929,9 @@ func resolveAttachExpr(tls *libc.TLS, pName uintptr, pExpr uintptr) int32 { /* s
// Return true if zName points to a name that may be used to refer to
// database iDb attached to handle db.
-func Xsqlite3DbIsNamed(tls *libc.TLS, db uintptr, iDb int32, zName uintptr) int32 { /* sqlite3.c:111595:20: */
- return (libc.Bool32((Xsqlite3StrICmp(tls, (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+uintptr(iDb)*16)).FzDbSName, zName) == 0) ||
- ((iDb == 0) && (Xsqlite3StrICmp(tls, ts+5458 /* "main" */, zName) == 0))))
+func Xsqlite3DbIsNamed(tls *libc.TLS, db uintptr, iDb int32, zName uintptr) int32 { /* sqlite3.c:112202:20: */
+ return libc.Bool32(Xsqlite3StrICmp(tls, (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+uintptr(iDb)*16)).FzDbSName, zName) == 0 ||
+ iDb == 0 && Xsqlite3StrICmp(tls, ts+6305, zName) == 0)
}
// An SQL user-function registered to do the work of an ATTACH statement. The
@@ -91755,7 +92947,7 @@ func Xsqlite3DbIsNamed(tls *libc.TLS, db uintptr, iDb int32, zName uintptr) int3
// If the db->init.reopenMemdb flags is set, then instead of attaching a
// new database, close the database on db->init.iDb and reopen it as an
// empty MemDB.
-func attachFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintptr) { /* sqlite3.c:111617:13: */
+func attachFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintptr) { /* sqlite3.c:112224:13: */
bp := tls.Alloc(44)
defer tls.Free(44)
@@ -91790,30 +92982,30 @@ func attachFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintptr) { /
if !(zFile == uintptr(0)) {
goto __1
}
- zFile = ts + 755 /* "" */
+ zFile = ts + 1543 /* "" */
__1:
;
if !(zName == uintptr(0)) {
goto __2
}
- zName = ts + 755 /* "" */
+ zName = ts + 1543 /* "" */
__2:
;
- if !((uint32(int32(*(*uint8)(unsafe.Pointer(db + 164 /* &.init */ + 8 /* &.reopenMemdb */)) & 0x4 >> 2))) != 0) {
+ if !(uint32(int32(*(*uint8)(unsafe.Pointer(db + 172 + 8))&0x4>>2)) != 0) {
goto __3
}
// This is not a real ATTACH. Instead, this routine is being called
// from sqlite3_deserialize() to close database db->init.iDb and
// reopen it as a MemDB
- *(*uintptr)(unsafe.Pointer(bp + 28 /* pVfs */)) = Xsqlite3_vfs_find(tls, ts+2962 /* "memdb" */)
- if !(*(*uintptr)(unsafe.Pointer(bp + 28 /* pVfs */)) == uintptr(0)) {
+ *(*uintptr)(unsafe.Pointer(bp + 28 /* pVfs */)) = Xsqlite3_vfs_find(tls, ts+3773 /* "memdb" */)
+ if !(*(*uintptr)(unsafe.Pointer(bp + 28)) == uintptr(0)) {
goto __5
}
return
__5:
;
- pNew = ((*Sqlite3)(unsafe.Pointer(db)).FaDb + uintptr((*Sqlite3)(unsafe.Pointer(db)).Finit.FiDb)*16)
+ pNew = (*Sqlite3)(unsafe.Pointer(db)).FaDb + uintptr((*Sqlite3)(unsafe.Pointer(db)).Finit.FiDb)*16
if !((*Db)(unsafe.Pointer(pNew)).FpBt != 0) {
goto __6
}
@@ -91822,7 +93014,7 @@ __6:
;
(*Db)(unsafe.Pointer(pNew)).FpBt = uintptr(0)
(*Db)(unsafe.Pointer(pNew)).FpSchema = uintptr(0)
- rc = Xsqlite3BtreeOpen(tls, *(*uintptr)(unsafe.Pointer(bp + 28 /* pVfs */)), ts+10400 /* "x\x00" */, db, (pNew + 4 /* &.pBt */), 0, SQLITE_OPEN_MAIN_DB)
+ rc = Xsqlite3BtreeOpen(tls, *(*uintptr)(unsafe.Pointer(bp + 28 /* pVfs */)), ts+11514 /* "x\x00" */, db, pNew+4, 0, SQLITE_OPEN_MAIN_DB)
goto __4
__3:
// This is a real ATTACH
@@ -91832,11 +93024,11 @@ __3:
// * Too many attached databases,
// * Transaction currently open
// * Specified database name already being used.
- if !((*Sqlite3)(unsafe.Pointer(db)).FnDb >= (*(*int32)(unsafe.Pointer((db + 112 /* &.aLimit */) + 7*4)) + 2)) {
+ if !((*Sqlite3)(unsafe.Pointer(db)).FnDb >= *(*int32)(unsafe.Pointer(db + 120 + 7*4))+2) {
goto __7
}
- *(*uintptr)(unsafe.Pointer(bp + 40 /* zErrDyn */)) = Xsqlite3MPrintf(tls, db, ts+10403, /* "too many attache..." */
- libc.VaList(bp, *(*int32)(unsafe.Pointer((db + 112 /* &.aLimit */) + 7*4))))
+ *(*uintptr)(unsafe.Pointer(bp + 40 /* zErrDyn */)) = Xsqlite3MPrintf(tls, db, ts+11517, /* "too many attache..." */
+ libc.VaList(bp, *(*int32)(unsafe.Pointer(db + 120 + 7*4))))
goto attach_error
__7:
;
@@ -91849,7 +93041,7 @@ __8:
if !(Xsqlite3DbIsNamed(tls, db, i, zName) != 0) {
goto __11
}
- *(*uintptr)(unsafe.Pointer(bp + 40 /* zErrDyn */)) = Xsqlite3MPrintf(tls, db, ts+10440 /* "database %s is a..." */, libc.VaList(bp+8, zName))
+ *(*uintptr)(unsafe.Pointer(bp + 40 /* zErrDyn */)) = Xsqlite3MPrintf(tls, db, ts+11554 /* "database %s is a..." */, libc.VaList(bp+8, zName))
goto attach_error
__11:
;
@@ -91863,20 +93055,20 @@ __10:
// Allocate the new entry in the db->aDb[] array and initialize the schema
// hash tables.
- if !((*Sqlite3)(unsafe.Pointer(db)).FaDb == db+448 /* &.aDbStatic */) {
+ if !((*Sqlite3)(unsafe.Pointer(db)).FaDb == db+472) {
goto __12
}
- aNew = Xsqlite3DbMallocRawNN(tls, db, (uint64(uint32(unsafe.Sizeof(Db{})) * uint32(3))))
+ aNew = Xsqlite3DbMallocRawNN(tls, db, uint64(uint32(unsafe.Sizeof(Db{}))*uint32(3)))
if !(aNew == uintptr(0)) {
goto __14
}
return
__14:
;
- libc.Xmemcpy(tls, aNew, (*Sqlite3)(unsafe.Pointer(db)).FaDb, (uint32(unsafe.Sizeof(Db{})) * uint32(2)))
+ libc.Xmemcpy(tls, aNew, (*Sqlite3)(unsafe.Pointer(db)).FaDb, uint32(unsafe.Sizeof(Db{}))*uint32(2))
goto __13
__12:
- aNew = Xsqlite3DbRealloc(tls, db, (*Sqlite3)(unsafe.Pointer(db)).FaDb, (uint64(uint32(unsafe.Sizeof(Db{})) * (uint32((*Sqlite3)(unsafe.Pointer(db)).FnDb + 1)))))
+ aNew = Xsqlite3DbRealloc(tls, db, (*Sqlite3)(unsafe.Pointer(db)).FaDb, uint64(uint32(unsafe.Sizeof(Db{}))*uint32((*Sqlite3)(unsafe.Pointer(db)).FnDb+1)))
if !(aNew == uintptr(0)) {
goto __15
}
@@ -91886,7 +93078,7 @@ __15:
__13:
;
(*Sqlite3)(unsafe.Pointer(db)).FaDb = aNew
- pNew = ((*Sqlite3)(unsafe.Pointer(db)).FaDb + uintptr((*Sqlite3)(unsafe.Pointer(db)).FnDb)*16)
+ pNew = (*Sqlite3)(unsafe.Pointer(db)).FaDb + uintptr((*Sqlite3)(unsafe.Pointer(db)).FnDb)*16
libc.Xmemset(tls, pNew, 0, uint32(unsafe.Sizeof(Db{})))
// Open the database file. If the btree is successfully opened, use
@@ -91910,7 +93102,7 @@ __16:
;
*(*uint32)(unsafe.Pointer(bp + 24 /* flags */)) |= uint32(SQLITE_OPEN_MAIN_DB)
- rc = Xsqlite3BtreeOpen(tls, *(*uintptr)(unsafe.Pointer(bp + 28 /* pVfs */)), *(*uintptr)(unsafe.Pointer(bp + 32 /* zPath */)), db, (pNew + 4 /* &.pBt */), 0, int32(*(*uint32)(unsafe.Pointer(bp + 24 /* flags */))))
+ rc = Xsqlite3BtreeOpen(tls, *(*uintptr)(unsafe.Pointer(bp + 28 /* pVfs */)), *(*uintptr)(unsafe.Pointer(bp + 32 /* zPath */)), db, pNew+4, 0, int32(*(*uint32)(unsafe.Pointer(bp + 24 /* flags */))))
(*Sqlite3)(unsafe.Pointer(db)).FnDb++
(*Db)(unsafe.Pointer(pNew)).FzDbSName = Xsqlite3DbStrDup(tls, db, zName)
__4:
@@ -91920,24 +93112,24 @@ __4:
goto __18
}
rc = SQLITE_ERROR
- *(*uintptr)(unsafe.Pointer(bp + 40 /* zErrDyn */)) = Xsqlite3MPrintf(tls, db, ts+10470 /* "database is alre..." */, 0)
+ *(*uintptr)(unsafe.Pointer(bp + 40 /* zErrDyn */)) = Xsqlite3MPrintf(tls, db, ts+11584 /* "database is alre..." */, 0)
goto __19
__18:
if !(rc == SQLITE_OK) {
goto __20
}
(*Db)(unsafe.Pointer(pNew)).FpSchema = Xsqlite3SchemaGet(tls, db, (*Db)(unsafe.Pointer(pNew)).FpBt)
- if !(!(int32((*Db)(unsafe.Pointer(pNew)).FpSchema) != 0)) {
+ if !!(int32((*Db)(unsafe.Pointer(pNew)).FpSchema) != 0) {
goto __21
}
rc = SQLITE_NOMEM
goto __22
__21:
- if !(((*Schema)(unsafe.Pointer((*Db)(unsafe.Pointer(pNew)).FpSchema)).Ffile_format != 0) && (int32((*Schema)(unsafe.Pointer((*Db)(unsafe.Pointer(pNew)).FpSchema)).Fenc) != (int32((*Sqlite3)(unsafe.Pointer(db)).Fenc)))) {
+ if !((*Schema)(unsafe.Pointer((*Db)(unsafe.Pointer(pNew)).FpSchema)).Ffile_format != 0 && int32((*Schema)(unsafe.Pointer((*Db)(unsafe.Pointer(pNew)).FpSchema)).Fenc) != int32((*Sqlite3)(unsafe.Pointer(db)).Fenc)) {
goto __23
}
*(*uintptr)(unsafe.Pointer(bp + 40 /* zErrDyn */)) = Xsqlite3MPrintf(tls, db,
- ts+10499 /* "attached databas..." */, 0)
+ ts+11613 /* "attached databas..." */, 0)
rc = SQLITE_ERROR
__23:
;
@@ -91949,14 +93141,14 @@ __22:
Xsqlite3BtreeSecureDelete(tls, (*Db)(unsafe.Pointer(pNew)).FpBt,
Xsqlite3BtreeSecureDelete(tls, (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb)).FpBt, -1))
Xsqlite3BtreeSetPagerFlags(tls, (*Db)(unsafe.Pointer(pNew)).FpBt,
- (uint32(uint64(PAGER_SYNCHRONOUS_FULL) | ((*Sqlite3)(unsafe.Pointer(db)).Fflags & uint64(PAGER_FLAGS_MASK)))))
+ uint32(uint64(PAGER_SYNCHRONOUS_FULL)|(*Sqlite3)(unsafe.Pointer(db)).Fflags&uint64(PAGER_FLAGS_MASK)))
Xsqlite3BtreeLeave(tls, (*Db)(unsafe.Pointer(pNew)).FpBt)
__20:
;
__19:
;
- (*Db)(unsafe.Pointer(pNew)).Fsafety_level = (U8(SQLITE_DEFAULT_SYNCHRONOUS + 1))
- if !((rc == SQLITE_OK) && ((*Db)(unsafe.Pointer(pNew)).FzDbSName == uintptr(0))) {
+ (*Db)(unsafe.Pointer(pNew)).Fsafety_level = U8(SQLITE_DEFAULT_SYNCHRONOUS + 1)
+ if !(rc == SQLITE_OK && (*Db)(unsafe.Pointer(pNew)).FzDbSName == uintptr(0)) {
goto __24
}
rc = SQLITE_NOMEM
@@ -91973,8 +93165,8 @@ __24:
}
Xsqlite3BtreeEnterAll(tls, db)
(*Sqlite3)(unsafe.Pointer(db)).Finit.FiDb = U8(0)
- *(*U32)(unsafe.Pointer(db + 24 /* &.mDbFlags */)) &= (libc.Uint32FromInt32(libc.CplInt32(DBFLAG_SchemaKnownOk)))
- if !(!((int32(*(*uint8)(unsafe.Pointer(db + 164 /* &.init */ + 8 /* &.reopenMemdb */)) & 0x4 >> 2)) != 0)) {
+ *(*U32)(unsafe.Pointer(db + 24)) &= libc.Uint32FromInt32(libc.CplInt32(DBFLAG_SchemaKnownOk))
+ if !!(int32(*(*uint8)(unsafe.Pointer(db + 172 + 8))&0x4>>2) != 0) {
goto __26
}
rc = Xsqlite3Init(tls, db, bp+40 /* &zErrDyn */)
@@ -91987,10 +93179,10 @@ __25:
if !(rc != 0) {
goto __27
}
- if !(!((int32(*(*uint8)(unsafe.Pointer(db + 164 /* &.init */ + 8 /* &.reopenMemdb */)) & 0x4 >> 2)) != 0)) {
+ if !!(int32(*(*uint8)(unsafe.Pointer(db + 172 + 8))&0x4>>2) != 0) {
goto __28
}
- iDb = ((*Sqlite3)(unsafe.Pointer(db)).FnDb - 1)
+ iDb = (*Sqlite3)(unsafe.Pointer(db)).FnDb - 1
if !((*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+uintptr(iDb)*16)).FpBt != 0) {
goto __29
@@ -92002,18 +93194,18 @@ __29:
;
Xsqlite3ResetAllSchemasOfConnection(tls, db)
(*Sqlite3)(unsafe.Pointer(db)).FnDb = iDb
- if !((rc == SQLITE_NOMEM) || (rc == (SQLITE_IOERR | (int32(12) << 8)))) {
+ if !(rc == SQLITE_NOMEM || rc == SQLITE_IOERR|int32(12)<<8) {
goto __30
}
Xsqlite3OomFault(tls, db)
Xsqlite3DbFree(tls, db, *(*uintptr)(unsafe.Pointer(bp + 40 /* zErrDyn */)))
- *(*uintptr)(unsafe.Pointer(bp + 40 /* zErrDyn */)) = Xsqlite3MPrintf(tls, db, ts+5181 /* "out of memory" */, 0)
+ *(*uintptr)(unsafe.Pointer(bp + 40 /* zErrDyn */)) = Xsqlite3MPrintf(tls, db, ts+6028 /* "out of memory" */, 0)
goto __31
__30:
- if !(*(*uintptr)(unsafe.Pointer(bp + 40 /* zErrDyn */)) == uintptr(0)) {
+ if !(*(*uintptr)(unsafe.Pointer(bp + 40)) == uintptr(0)) {
goto __32
}
- *(*uintptr)(unsafe.Pointer(bp + 40 /* zErrDyn */)) = Xsqlite3MPrintf(tls, db, ts+10567 /* "unable to open d..." */, libc.VaList(bp+16, zFile))
+ *(*uintptr)(unsafe.Pointer(bp + 40 /* zErrDyn */)) = Xsqlite3MPrintf(tls, db, ts+11681 /* "unable to open d..." */, libc.VaList(bp+16, zFile))
__32:
;
__31:
@@ -92028,7 +93220,7 @@ __27:
attach_error:
// Return an error if we get here
- if !(*(*uintptr)(unsafe.Pointer(bp + 40 /* zErrDyn */)) != 0) {
+ if !(*(*uintptr)(unsafe.Pointer(bp + 40)) != 0) {
goto __33
}
Xsqlite3_result_error(tls, context, *(*uintptr)(unsafe.Pointer(bp + 40 /* zErrDyn */)), -1)
@@ -92048,7 +93240,7 @@ __34:
// DETACH DATABASE x
//
// SELECT sqlite_detach(x)
-func detachFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintptr) { /* sqlite3.c:111810:13: */
+func detachFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintptr) { /* sqlite3.c:112417:13: */
bp := tls.Alloc(152)
defer tls.Free(152)
@@ -92069,7 +93261,7 @@ func detachFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintptr) { /
if !(zName == uintptr(0)) {
goto __1
}
- zName = ts + 755 /* "" */
+ zName = ts + 1543 /* "" */
__1:
;
i = 0
@@ -92077,7 +93269,7 @@ __2:
if !(i < (*Sqlite3)(unsafe.Pointer(db)).FnDb) {
goto __4
}
- pDb = ((*Sqlite3)(unsafe.Pointer(db)).FaDb + uintptr(i)*16)
+ pDb = (*Sqlite3)(unsafe.Pointer(db)).FaDb + uintptr(i)*16
if !((*Db)(unsafe.Pointer(pDb)).FpBt == uintptr(0)) {
goto __5
}
@@ -92101,22 +93293,22 @@ __4:
if !(i >= (*Sqlite3)(unsafe.Pointer(db)).FnDb) {
goto __7
}
- Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([128]uint8{})), bp+24 /* &zErr[0] */, ts+10595 /* "no such database..." */, libc.VaList(bp, zName))
+ Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([128]uint8{})), bp+24 /* &zErr[0] */, ts+11709 /* "no such database..." */, libc.VaList(bp, zName))
goto detach_error
__7:
;
if !(i < 2) {
goto __8
}
- Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([128]uint8{})), bp+24 /* &zErr[0] */, ts+10616 /* "cannot detach da..." */, libc.VaList(bp+8, zName))
+ Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([128]uint8{})), bp+24 /* &zErr[0] */, ts+11730 /* "cannot detach da..." */, libc.VaList(bp+8, zName))
goto detach_error
__8:
;
- if !((Xsqlite3BtreeTxnState(tls, (*Db)(unsafe.Pointer(pDb)).FpBt) != SQLITE_TXN_NONE) ||
- (Xsqlite3BtreeIsInBackup(tls, (*Db)(unsafe.Pointer(pDb)).FpBt) != 0)) {
+ if !(Xsqlite3BtreeTxnState(tls, (*Db)(unsafe.Pointer(pDb)).FpBt) != SQLITE_TXN_NONE ||
+ Xsqlite3BtreeIsInBackup(tls, (*Db)(unsafe.Pointer(pDb)).FpBt) != 0) {
goto __9
}
- Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([128]uint8{})), bp+24 /* &zErr[0] */, ts+10642 /* "database %s is l..." */, libc.VaList(bp+16, zName))
+ Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([128]uint8{})), bp+24 /* &zErr[0] */, ts+11756 /* "database %s is l..." */, libc.VaList(bp+16, zName))
goto detach_error
__9:
;
@@ -92124,7 +93316,7 @@ __9:
// If any TEMP triggers reference the schema being detached, move those
// triggers to reference the TEMP schema itself.
- pEntry = (*Hash)(unsafe.Pointer(((*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+1*16)).FpSchema + 40 /* &.trigHash */))).Ffirst
+ pEntry = (*Hash)(unsafe.Pointer((*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+1*16)).FpSchema + 40)).Ffirst
__10:
if !(pEntry != 0) {
goto __11
@@ -92153,7 +93345,7 @@ detach_error:
// This procedure generates VDBE code for a single invocation of either the
// sqlite_detach() or sqlite_attach() SQL user functions.
-func codeAttach(tls *libc.TLS, pParse uintptr, type1 int32, pFunc uintptr, pAuthArg uintptr, pFilename uintptr, pDbname uintptr, pKey uintptr) { /* sqlite3.c:111872:13: */
+func codeAttach(tls *libc.TLS, pParse uintptr, type1 int32, pFunc uintptr, pAuthArg uintptr, pFilename uintptr, pDbname uintptr, pKey uintptr) { /* sqlite3.c:112479:13: */
bp := tls.Alloc(32)
defer tls.Free(32)
@@ -92175,7 +93367,7 @@ __1:
libc.Xmemset(tls, bp /* &sName */, 0, uint32(unsafe.Sizeof(NameContext{})))
(*NameContext)(unsafe.Pointer(bp /* &sName */)).FpParse = pParse
- if !(((SQLITE_OK != (libc.AssignInt32(&rc, resolveAttachExpr(tls, bp /* &sName */, pFilename)))) || (SQLITE_OK != (libc.AssignInt32(&rc, resolveAttachExpr(tls, bp /* &sName */, pDbname))))) || (SQLITE_OK != (libc.AssignInt32(&rc, resolveAttachExpr(tls, bp /* &sName */, pKey))))) {
+ if !(SQLITE_OK != resolveAttachExpr(tls, bp, pFilename) || SQLITE_OK != resolveAttachExpr(tls, bp, pDbname) || SQLITE_OK != resolveAttachExpr(tls, bp, pKey)) {
goto __2
}
goto attach_end
@@ -92188,7 +93380,8 @@ __2:
if !(int32((*Expr)(unsafe.Pointer(pAuthArg)).Fop) == TK_STRING) {
goto __4
}
- zAuthArg = *(*uintptr)(unsafe.Pointer(pAuthArg + 8 /* &.u */))
+
+ zAuthArg = *(*uintptr)(unsafe.Pointer(pAuthArg + 8))
goto __5
__4:
zAuthArg = uintptr(0)
@@ -92207,18 +93400,18 @@ __3:
v = Xsqlite3GetVdbe(tls, pParse)
regArgs = Xsqlite3GetTempRange(tls, pParse, 4)
Xsqlite3ExprCode(tls, pParse, pFilename, regArgs)
- Xsqlite3ExprCode(tls, pParse, pDbname, (regArgs + 1))
- Xsqlite3ExprCode(tls, pParse, pKey, (regArgs + 2))
+ Xsqlite3ExprCode(tls, pParse, pDbname, regArgs+1)
+ Xsqlite3ExprCode(tls, pParse, pKey, regArgs+2)
if !(v != 0) {
goto __7
}
- Xsqlite3VdbeAddFunctionCall(tls, pParse, 0, ((regArgs + 3) - int32((*FuncDef)(unsafe.Pointer(pFunc)).FnArg)), (regArgs + 3),
+ Xsqlite3VdbeAddFunctionCall(tls, pParse, 0, regArgs+3-int32((*FuncDef)(unsafe.Pointer(pFunc)).FnArg), regArgs+3,
int32((*FuncDef)(unsafe.Pointer(pFunc)).FnArg), pFunc, 0)
// Code an OP_Expire. For an ATTACH statement, set P1 to true (expire this
// statement only). For DETACH, set it to false (expire all existing
// statements).
- Xsqlite3VdbeAddOp1(tls, v, OP_Expire, (libc.Bool32(type1 == SQLITE_ATTACH)))
+ Xsqlite3VdbeAddOp1(tls, v, OP_Expire, libc.Bool32(type1 == SQLITE_ATTACH))
__7:
;
@@ -92231,7 +93424,7 @@ attach_end:
// Called by the parser to compile a DETACH statement.
//
// DETACH pDbname
-func Xsqlite3Detach(tls *libc.TLS, pParse uintptr, pDbname uintptr) { /* sqlite3.c:111943:21: */
+func Xsqlite3Detach(tls *libc.TLS, pParse uintptr, pDbname uintptr) { /* sqlite3.c:112551:21: */
codeAttach(tls, pParse, SQLITE_DETACH, uintptr(unsafe.Pointer(&detach_func)), pDbname, uintptr(0), uintptr(0), pDbname)
}
@@ -92239,12 +93432,12 @@ var detach_func = FuncDef{
FnArg: int8(1), // nArg
FfuncFlags: U32(SQLITE_UTF8), // pNext
FxSFunc: 0, // xValue, xInverse
- FzName: ts + 10664 /* "sqlite_detach" */} /* sqlite3.c:111944:24 */
+ FzName: ts + 11778 /* "sqlite_detach" */} /* sqlite3.c:112552:24 */
// Called by the parser to compile an ATTACH statement.
//
// ATTACH p AS pDbname KEY pKey
-func Xsqlite3Attach(tls *libc.TLS, pParse uintptr, p uintptr, pDbname uintptr, pKey uintptr) { /* sqlite3.c:111963:21: */
+func Xsqlite3Attach(tls *libc.TLS, pParse uintptr, p uintptr, pDbname uintptr, pKey uintptr) { /* sqlite3.c:112571:21: */
codeAttach(tls, pParse, SQLITE_ATTACH, uintptr(unsafe.Pointer(&attach_func)), p, p, pDbname, pKey)
}
@@ -92252,22 +93445,22 @@ var attach_func = FuncDef{
FnArg: int8(3), // nArg
FfuncFlags: U32(SQLITE_UTF8), // pNext
FxSFunc: 0, // xValue, xInverse
- FzName: ts + 10678 /* "sqlite_attach" */} /* sqlite3.c:111964:24 */
+ FzName: ts + 11792 /* "sqlite_attach" */} /* sqlite3.c:112572:24 */
// Expression callback used by sqlite3FixAAAA() routines.
-func fixExprCb(tls *libc.TLS, p uintptr, pExpr uintptr) int32 { /* sqlite3.c:111982:12: */
+func fixExprCb(tls *libc.TLS, p uintptr, pExpr uintptr) int32 { /* sqlite3.c:112590:12: */
bp := tls.Alloc(8)
defer tls.Free(8)
- var pFix uintptr = *(*uintptr)(unsafe.Pointer(p + 24 /* &.u */))
+ var pFix uintptr = *(*uintptr)(unsafe.Pointer(p + 24))
if !(int32((*DbFixer)(unsafe.Pointer(pFix)).FbTemp) != 0) {
- *(*U32)(unsafe.Pointer(pExpr + 4 /* &.flags */)) |= (U32(EP_FromDDL))
+ *(*U32)(unsafe.Pointer(pExpr + 4)) |= U32(EP_FromDDL)
}
if int32((*Expr)(unsafe.Pointer(pExpr)).Fop) == TK_VARIABLE {
if (*Sqlite3)(unsafe.Pointer((*Parse)(unsafe.Pointer((*DbFixer)(unsafe.Pointer(pFix)).FpParse)).Fdb)).Finit.Fbusy != 0 {
(*Expr)(unsafe.Pointer(pExpr)).Fop = U8(TK_NULL)
} else {
- Xsqlite3ErrorMsg(tls, (*DbFixer)(unsafe.Pointer(pFix)).FpParse, ts+10692 /* "%s cannot use va..." */, libc.VaList(bp, (*DbFixer)(unsafe.Pointer(pFix)).FzType))
+ Xsqlite3ErrorMsg(tls, (*DbFixer)(unsafe.Pointer(pFix)).FpParse, ts+11806 /* "%s cannot use va..." */, libc.VaList(bp, (*DbFixer)(unsafe.Pointer(pFix)).FzType))
return WRC_Abort
}
}
@@ -92275,11 +93468,11 @@ func fixExprCb(tls *libc.TLS, p uintptr, pExpr uintptr) int32 { /* sqlite3.c:111
}
// Select callback used by sqlite3FixAAAA() routines.
-func fixSelectCb(tls *libc.TLS, p uintptr, pSelect uintptr) int32 { /* sqlite3.c:111999:12: */
+func fixSelectCb(tls *libc.TLS, p uintptr, pSelect uintptr) int32 { /* sqlite3.c:112607:12: */
bp := tls.Alloc(24)
defer tls.Free(24)
- var pFix uintptr = *(*uintptr)(unsafe.Pointer(p + 24 /* &.u */))
+ var pFix uintptr = *(*uintptr)(unsafe.Pointer(p + 24))
var i int32
var pItem uintptr
var db uintptr = (*Parse)(unsafe.Pointer((*DbFixer)(unsafe.Pointer(pFix)).FpParse)).Fdb
@@ -92300,18 +93493,18 @@ __1:
if (*SrcItem)(unsafe.Pointer(pItem)).FzDatabase != 0 {
if iDb != Xsqlite3FindDbName(tls, db, (*SrcItem)(unsafe.Pointer(pItem)).FzDatabase) {
Xsqlite3ErrorMsg(tls, (*DbFixer)(unsafe.Pointer(pFix)).FpParse,
- ts+10716, /* "%s %T cannot ref..." */
+ ts+11830, /* "%s %T cannot ref..." */
libc.VaList(bp, (*DbFixer)(unsafe.Pointer(pFix)).FzType, (*DbFixer)(unsafe.Pointer(pFix)).FpName, (*SrcItem)(unsafe.Pointer(pItem)).FzDatabase))
return WRC_Abort
}
Xsqlite3DbFree(tls, db, (*SrcItem)(unsafe.Pointer(pItem)).FzDatabase)
(*SrcItem)(unsafe.Pointer(pItem)).FzDatabase = uintptr(0)
- libc.SetBitFieldPtr16Uint32(pItem+36 /* &.fg */ +4 /* &.notCte */, uint32(1), 8, 0x100)
+ libc.SetBitFieldPtr16Uint32(pItem+36+4, uint32(1), 8, 0x100)
}
(*SrcItem)(unsafe.Pointer(pItem)).FpSchema = (*DbFixer)(unsafe.Pointer(pFix)).FpSchema
- libc.SetBitFieldPtr16Uint32(pItem+36 /* &.fg */ +4 /* &.fromDDL */, uint32(1), 6, 0x40)
+ libc.SetBitFieldPtr16Uint32(pItem+36+4, uint32(1), 6, 0x40)
}
- if Xsqlite3WalkExpr(tls, (pFix+4 /* &.w */), (*SrcItem)(unsafe.Pointer((pList+8 /* &.a */)+uintptr(i)*72)).FpOn) != 0 {
+ if Xsqlite3WalkExpr(tls, pFix+4, (*SrcItem)(unsafe.Pointer(pList+8+uintptr(i)*72)).FpOn) != 0 {
return WRC_Abort
}
@@ -92326,7 +93519,7 @@ __3:
;
if (*Select)(unsafe.Pointer(pSelect)).FpWith != 0 {
for i = 0; i < (*With)(unsafe.Pointer((*Select)(unsafe.Pointer(pSelect)).FpWith)).FnCte; i++ {
- if Xsqlite3WalkSelect(tls, p, (*Cte)(unsafe.Pointer(((*Select)(unsafe.Pointer(pSelect)).FpWith+12 /* &.a */)+uintptr(i)*24)).FpSelect) != 0 {
+ if Xsqlite3WalkSelect(tls, p, (*Cte)(unsafe.Pointer((*Select)(unsafe.Pointer(pSelect)).FpWith+12+uintptr(i)*24)).FpSelect) != 0 {
return WRC_Abort
}
}
@@ -92336,7 +93529,7 @@ __3:
// Initialize a DbFixer structure. This routine must be called prior
// to passing the structure to one of the sqliteFixAAAA() routines below.
-func Xsqlite3FixInit(tls *libc.TLS, pFix uintptr, pParse uintptr, iDb int32, zType uintptr, pName uintptr) { /* sqlite3.c:112042:21: */
+func Xsqlite3FixInit(tls *libc.TLS, pFix uintptr, pParse uintptr, iDb int32, zType uintptr, pName uintptr) { /* sqlite3.c:112650:21: */
var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb
(*DbFixer)(unsafe.Pointer(pFix)).FpParse = pParse
@@ -92344,7 +93537,7 @@ func Xsqlite3FixInit(tls *libc.TLS, pFix uintptr, pParse uintptr, iDb int32, zTy
(*DbFixer)(unsafe.Pointer(pFix)).FpSchema = (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*16)).FpSchema
(*DbFixer)(unsafe.Pointer(pFix)).FzType = zType
(*DbFixer)(unsafe.Pointer(pFix)).FpName = pName
- (*DbFixer)(unsafe.Pointer(pFix)).FbTemp = (U8(libc.Bool32(iDb == 1)))
+ (*DbFixer)(unsafe.Pointer(pFix)).FbTemp = U8(libc.Bool32(iDb == 1))
(*DbFixer)(unsafe.Pointer(pFix)).Fw.FpParse = pParse
(*DbFixer)(unsafe.Pointer(pFix)).Fw.FxExprCallback = *(*uintptr)(unsafe.Pointer(&struct {
f func(*libc.TLS, uintptr, uintptr) int32
@@ -92357,7 +93550,7 @@ func Xsqlite3FixInit(tls *libc.TLS, pFix uintptr, pParse uintptr, iDb int32, zTy
}{Xsqlite3WalkWinDefnDummyCallback}))
(*DbFixer)(unsafe.Pointer(pFix)).Fw.FwalkerDepth = 0
(*DbFixer)(unsafe.Pointer(pFix)).Fw.FeCode = U16(0)
- *(*uintptr)(unsafe.Pointer(pFix + 4 /* &.w */ + 24 /* &.u */)) = pFix
+ *(*uintptr)(unsafe.Pointer(pFix + 4 + 24)) = pFix
}
// The following set of routines walk through the parse tree and assign
@@ -92372,7 +93565,7 @@ func Xsqlite3FixInit(tls *libc.TLS, pFix uintptr, pParse uintptr, iDb int32, zTy
// to an object in a different database, an error message is added to
// pParse->zErrMsg and these routines return non-zero. If everything
// checks out, these routines return 0.
-func Xsqlite3FixSrcList(tls *libc.TLS, pFix uintptr, pList uintptr) int32 { /* sqlite3.c:112080:20: */
+func Xsqlite3FixSrcList(tls *libc.TLS, pFix uintptr, pList uintptr) int32 { /* sqlite3.c:112688:20: */
bp := tls.Alloc(76)
defer tls.Free(76)
@@ -92382,34 +93575,34 @@ func Xsqlite3FixSrcList(tls *libc.TLS, pFix uintptr, pList uintptr) int32 { /* s
libc.Xmemset(tls, bp /* &s */, 0, uint32(unsafe.Sizeof(Select{})))
(*Select)(unsafe.Pointer(bp /* &s */)).FpSrc = pList
- res = Xsqlite3WalkSelect(tls, (pFix + 4 /* &.w */), bp /* &s */)
+ res = Xsqlite3WalkSelect(tls, pFix+4, bp /* &s */)
}
return res
}
-func Xsqlite3FixSelect(tls *libc.TLS, pFix uintptr, pSelect uintptr) int32 { /* sqlite3.c:112094:20: */
- return Xsqlite3WalkSelect(tls, (pFix + 4 /* &.w */), pSelect)
+func Xsqlite3FixSelect(tls *libc.TLS, pFix uintptr, pSelect uintptr) int32 { /* sqlite3.c:112702:20: */
+ return Xsqlite3WalkSelect(tls, pFix+4, pSelect)
}
-func Xsqlite3FixExpr(tls *libc.TLS, pFix uintptr, pExpr uintptr) int32 { /* sqlite3.c:112100:20: */
- return Xsqlite3WalkExpr(tls, (pFix + 4 /* &.w */), pExpr)
+func Xsqlite3FixExpr(tls *libc.TLS, pFix uintptr, pExpr uintptr) int32 { /* sqlite3.c:112708:20: */
+ return Xsqlite3WalkExpr(tls, pFix+4, pExpr)
}
-func Xsqlite3FixTriggerStep(tls *libc.TLS, pFix uintptr, pStep uintptr) int32 { /* sqlite3.c:112109:20: */
+func Xsqlite3FixTriggerStep(tls *libc.TLS, pFix uintptr, pStep uintptr) int32 { /* sqlite3.c:112717:20: */
for pStep != 0 {
- if (((Xsqlite3WalkSelect(tls, (pFix+4 /* &.w */), (*TriggerStep)(unsafe.Pointer(pStep)).FpSelect) != 0) ||
- (Xsqlite3WalkExpr(tls, (pFix+4 /* &.w */), (*TriggerStep)(unsafe.Pointer(pStep)).FpWhere) != 0)) ||
- (Xsqlite3WalkExprList(tls, (pFix+4 /* &.w */), (*TriggerStep)(unsafe.Pointer(pStep)).FpExprList) != 0)) ||
- (Xsqlite3FixSrcList(tls, pFix, (*TriggerStep)(unsafe.Pointer(pStep)).FpFrom) != 0) {
+ if Xsqlite3WalkSelect(tls, pFix+4, (*TriggerStep)(unsafe.Pointer(pStep)).FpSelect) != 0 ||
+ Xsqlite3WalkExpr(tls, pFix+4, (*TriggerStep)(unsafe.Pointer(pStep)).FpWhere) != 0 ||
+ Xsqlite3WalkExprList(tls, pFix+4, (*TriggerStep)(unsafe.Pointer(pStep)).FpExprList) != 0 ||
+ Xsqlite3FixSrcList(tls, pFix, (*TriggerStep)(unsafe.Pointer(pStep)).FpFrom) != 0 {
return 1
}
{
var pUp uintptr
for pUp = (*TriggerStep)(unsafe.Pointer(pStep)).FpUpsert; pUp != 0; pUp = (*Upsert)(unsafe.Pointer(pUp)).FpNextUpsert {
- if (((Xsqlite3WalkExprList(tls, (pFix+4 /* &.w */), (*Upsert)(unsafe.Pointer(pUp)).FpUpsertTarget) != 0) ||
- (Xsqlite3WalkExpr(tls, (pFix+4 /* &.w */), (*Upsert)(unsafe.Pointer(pUp)).FpUpsertTargetWhere) != 0)) ||
- (Xsqlite3WalkExprList(tls, (pFix+4 /* &.w */), (*Upsert)(unsafe.Pointer(pUp)).FpUpsertSet) != 0)) ||
- (Xsqlite3WalkExpr(tls, (pFix+4 /* &.w */), (*Upsert)(unsafe.Pointer(pUp)).FpUpsertWhere) != 0) {
+ if Xsqlite3WalkExprList(tls, pFix+4, (*Upsert)(unsafe.Pointer(pUp)).FpUpsertTarget) != 0 ||
+ Xsqlite3WalkExpr(tls, pFix+4, (*Upsert)(unsafe.Pointer(pUp)).FpUpsertTargetWhere) != 0 ||
+ Xsqlite3WalkExprList(tls, pFix+4, (*Upsert)(unsafe.Pointer(pUp)).FpUpsertSet) != 0 ||
+ Xsqlite3WalkExpr(tls, pFix+4, (*Upsert)(unsafe.Pointer(pUp)).FpUpsertWhere) != 0 {
return 1
}
}
@@ -92485,7 +93678,7 @@ func Xsqlite3FixTriggerStep(tls *libc.TLS, pFix uintptr, pStep uintptr) int32 {
//
// Setting the auth function to NULL disables this hook. The default
// setting of the auth function is NULL.
-func Xsqlite3_set_authorizer(tls *libc.TLS, db uintptr, xAuth uintptr, pArg uintptr) int32 { /* sqlite3.c:112213:16: */
+func Xsqlite3_set_authorizer(tls *libc.TLS, db uintptr, xAuth uintptr, pArg uintptr) int32 { /* sqlite3.c:112821:16: */
Xsqlite3_mutex_enter(tls, (*Sqlite3)(unsafe.Pointer(db)).Fmutex)
(*Sqlite3)(unsafe.Pointer(db)).FxAuth = xAuth
(*Sqlite3)(unsafe.Pointer(db)).FpAuthArg = pArg
@@ -92498,8 +93691,8 @@ func Xsqlite3_set_authorizer(tls *libc.TLS, db uintptr, xAuth uintptr, pArg uint
// Write an error message into pParse->zErrMsg that explains that the
// user-supplied authorization function returned an illegal value.
-func sqliteAuthBadReturnCode(tls *libc.TLS, pParse uintptr) { /* sqlite3.c:112233:13: */
- Xsqlite3ErrorMsg(tls, pParse, ts+10762 /* "authorizer malfu..." */, 0)
+func sqliteAuthBadReturnCode(tls *libc.TLS, pParse uintptr) { /* sqlite3.c:112841:13: */
+ Xsqlite3ErrorMsg(tls, pParse, ts+11876 /* "authorizer malfu..." */, 0)
(*Parse)(unsafe.Pointer(pParse)).Frc = SQLITE_ERROR
}
@@ -92510,7 +93703,7 @@ func sqliteAuthBadReturnCode(tls *libc.TLS, pParse uintptr) { /* sqlite3.c:11223
// If SQLITE_IGNORE is returned and pExpr is not NULL, then pExpr is changed
// to an SQL NULL expression. Otherwise, if pExpr is NULL, then SQLITE_IGNORE
// is treated as SQLITE_DENY. In this case an error is left in pParse.
-func Xsqlite3AuthReadCol(tls *libc.TLS, pParse uintptr, zTab uintptr, zCol uintptr, iDb int32) int32 { /* sqlite3.c:112247:20: */
+func Xsqlite3AuthReadCol(tls *libc.TLS, pParse uintptr, zTab uintptr, zCol uintptr, iDb int32) int32 { /* sqlite3.c:112855:20: */
bp := tls.Alloc(40)
defer tls.Free(40)
@@ -92525,13 +93718,13 @@ func Xsqlite3AuthReadCol(tls *libc.TLS, pParse uintptr, zTab uintptr, zCol uintp
f func(*libc.TLS, uintptr, int32, uintptr, uintptr, uintptr, uintptr) int32
})(unsafe.Pointer(&struct{ uintptr }{(*Sqlite3)(unsafe.Pointer(db)).FxAuth})).f(tls, (*Sqlite3)(unsafe.Pointer(db)).FpAuthArg, SQLITE_READ, zTab, zCol, zDb, (*Parse)(unsafe.Pointer(pParse)).FzAuthContext)
if rc == SQLITE_DENY {
- var z uintptr = Xsqlite3_mprintf(tls, ts+10785 /* "%s.%s" */, libc.VaList(bp, zTab, zCol))
- if ((*Sqlite3)(unsafe.Pointer(db)).FnDb > 2) || (iDb != 0) {
- z = Xsqlite3_mprintf(tls, ts+10791 /* "%s.%z" */, libc.VaList(bp+16, zDb, z))
+ var z uintptr = Xsqlite3_mprintf(tls, ts+11899 /* "%s.%s" */, libc.VaList(bp, zTab, zCol))
+ if (*Sqlite3)(unsafe.Pointer(db)).FnDb > 2 || iDb != 0 {
+ z = Xsqlite3_mprintf(tls, ts+11905 /* "%s.%z" */, libc.VaList(bp+16, zDb, z))
}
- Xsqlite3ErrorMsg(tls, pParse, ts+10797 /* "access to %z is ..." */, libc.VaList(bp+32, z))
+ Xsqlite3ErrorMsg(tls, pParse, ts+11911 /* "access to %z is ..." */, libc.VaList(bp+32, z))
(*Parse)(unsafe.Pointer(pParse)).Frc = SQLITE_AUTH
- } else if (rc != SQLITE_IGNORE) && (rc != SQLITE_OK) {
+ } else if rc != SQLITE_IGNORE && rc != SQLITE_OK {
sqliteAuthBadReturnCode(tls, pParse)
}
return rc
@@ -92544,7 +93737,7 @@ func Xsqlite3AuthReadCol(tls *libc.TLS, pParse uintptr, zTab uintptr, zCol uintp
// If the auth function returns SQLITE_IGNORE, change the TK_COLUMN
// instruction into a TK_NULL. If the auth function returns SQLITE_DENY,
// then generate an error.
-func Xsqlite3AuthRead(tls *libc.TLS, pParse uintptr, pExpr uintptr, pSchema uintptr, pTabList uintptr) { /* sqlite3.c:112283:21: */
+func Xsqlite3AuthRead(tls *libc.TLS, pParse uintptr, pExpr uintptr, pSchema uintptr, pTabList uintptr) { /* sqlite3.c:112891:21: */
var pTab uintptr = uintptr(0) // The table being read
var zCol uintptr // Name of the column of the table
var iSrc int32 // Index in pTabList->a[] of table being read
@@ -92563,8 +93756,8 @@ func Xsqlite3AuthRead(tls *libc.TLS, pParse uintptr, pExpr uintptr, pSchema uint
} else {
for iSrc = 0; iSrc < (*SrcList)(unsafe.Pointer(pTabList)).FnSrc; iSrc++ {
- if (*Expr)(unsafe.Pointer(pExpr)).FiTable == (*SrcItem)(unsafe.Pointer((pTabList+8 /* &.a */)+uintptr(iSrc)*72)).FiCursor {
- pTab = (*SrcItem)(unsafe.Pointer((pTabList + 8 /* &.a */) + uintptr(iSrc)*72)).FpTab
+ if (*Expr)(unsafe.Pointer(pExpr)).FiTable == (*SrcItem)(unsafe.Pointer(pTabList+8+uintptr(iSrc)*72)).FiCursor {
+ pTab = (*SrcItem)(unsafe.Pointer(pTabList + 8 + uintptr(iSrc)*72)).FpTab
break
}
}
@@ -92576,12 +93769,12 @@ func Xsqlite3AuthRead(tls *libc.TLS, pParse uintptr, pExpr uintptr, pSchema uint
if iCol >= 0 {
- zCol = (*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FaCol + uintptr(iCol)*20)).FzName
+ zCol = (*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FaCol + uintptr(iCol)*16)).FzCnName
} else if int32((*Table)(unsafe.Pointer(pTab)).FiPKey) >= 0 {
- zCol = (*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FaCol + uintptr((*Table)(unsafe.Pointer(pTab)).FiPKey)*20)).FzName
+ zCol = (*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FaCol + uintptr((*Table)(unsafe.Pointer(pTab)).FiPKey)*16)).FzCnName
} else {
- zCol = ts + 6688 /* "ROWID" */
+ zCol = ts + 7581 /* "ROWID" */
}
if SQLITE_IGNORE == Xsqlite3AuthReadCol(tls, pParse, (*Table)(unsafe.Pointer(pTab)).FzName, zCol, iDb) {
@@ -92593,14 +93786,14 @@ func Xsqlite3AuthRead(tls *libc.TLS, pParse uintptr, pExpr uintptr, pSchema uint
// either SQLITE_OK (zero) or SQLITE_IGNORE or SQLITE_DENY. If SQLITE_DENY
// is returned, then the error count and error message in pParse are
// modified appropriately.
-func Xsqlite3AuthCheck(tls *libc.TLS, pParse uintptr, code int32, zArg1 uintptr, zArg2 uintptr, zArg3 uintptr) int32 { /* sqlite3.c:112340:20: */
+func Xsqlite3AuthCheck(tls *libc.TLS, pParse uintptr, code int32, zArg1 uintptr, zArg2 uintptr, zArg3 uintptr) int32 { /* sqlite3.c:112948:20: */
var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb
var rc int32
// Don't do any authorization checks if the database is initialising
// or if the parser is being invoked from within sqlite3_declare_vtab.
- if (((*Sqlite3)(unsafe.Pointer(db)).FxAuth == uintptr(0)) || ((*Sqlite3)(unsafe.Pointer(db)).Finit.Fbusy != 0)) || (int32((*Parse)(unsafe.Pointer(pParse)).FeParseMode) != PARSE_MODE_NORMAL) {
+ if (*Sqlite3)(unsafe.Pointer(db)).FxAuth == uintptr(0) || (*Sqlite3)(unsafe.Pointer(db)).Finit.Fbusy != 0 || int32((*Parse)(unsafe.Pointer(pParse)).FeParseMode) != PARSE_MODE_NORMAL {
return SQLITE_OK
}
@@ -92615,9 +93808,9 @@ func Xsqlite3AuthCheck(tls *libc.TLS, pParse uintptr, code int32, zArg1 uintptr,
f func(*libc.TLS, uintptr, int32, uintptr, uintptr, uintptr, uintptr) int32
})(unsafe.Pointer(&struct{ uintptr }{(*Sqlite3)(unsafe.Pointer(db)).FxAuth})).f(tls, (*Sqlite3)(unsafe.Pointer(db)).FpAuthArg, code, zArg1, zArg2, zArg3, (*Parse)(unsafe.Pointer(pParse)).FzAuthContext)
if rc == SQLITE_DENY {
- Xsqlite3ErrorMsg(tls, pParse, ts+10824 /* "not authorized" */, 0)
+ Xsqlite3ErrorMsg(tls, pParse, ts+11938 /* "not authorized" */, 0)
(*Parse)(unsafe.Pointer(pParse)).Frc = SQLITE_AUTH
- } else if (rc != SQLITE_OK) && (rc != SQLITE_IGNORE) {
+ } else if rc != SQLITE_OK && rc != SQLITE_IGNORE {
rc = SQLITE_DENY
sqliteAuthBadReturnCode(tls, pParse)
}
@@ -92627,7 +93820,7 @@ func Xsqlite3AuthCheck(tls *libc.TLS, pParse uintptr, code int32, zArg1 uintptr,
// Push an authorization context. After this routine is called, the
// zArg3 argument to authorization callbacks will be zContext until
// popped. Or if pParse==0, this routine is a no-op.
-func Xsqlite3AuthContextPush(tls *libc.TLS, pParse uintptr, pContext uintptr, zContext uintptr) { /* sqlite3.c:112389:21: */
+func Xsqlite3AuthContextPush(tls *libc.TLS, pParse uintptr, pContext uintptr, zContext uintptr) { /* sqlite3.c:112997:21: */
(*AuthContext)(unsafe.Pointer(pContext)).FpParse = pParse
(*AuthContext)(unsafe.Pointer(pContext)).FzAuthContext = (*Parse)(unsafe.Pointer(pParse)).FzAuthContext
@@ -92636,7 +93829,7 @@ func Xsqlite3AuthContextPush(tls *libc.TLS, pParse uintptr, pContext uintptr, zC
// Pop an authorization context that was previously pushed
// by sqlite3AuthContextPush
-func Xsqlite3AuthContextPop(tls *libc.TLS, pContext uintptr) { /* sqlite3.c:112404:21: */
+func Xsqlite3AuthContextPop(tls *libc.TLS, pContext uintptr) { /* sqlite3.c:113012:21: */
if (*AuthContext)(unsafe.Pointer(pContext)).FpParse != 0 {
(*Parse)(unsafe.Pointer((*AuthContext)(unsafe.Pointer(pContext)).FpParse)).FzAuthContext = (*AuthContext)(unsafe.Pointer(pContext)).FzAuthContext
(*AuthContext)(unsafe.Pointer(pContext)).FpParse = uintptr(0)
@@ -92651,7 +93844,7 @@ func Xsqlite3AuthContextPop(tls *libc.TLS, pContext uintptr) { /* sqlite3.c:1124
// This routine just records the fact that the lock is desired. The
// code to make the lock occur is generated by a later call to
// codeTableLocks() which occurs during sqlite3FinishCoding().
-func lockTable(tls *libc.TLS, pParse uintptr, iDb int32, iTab Pgno, isWriteLock U8, zName uintptr) { /* sqlite3.c:112463:29: */
+func lockTable(tls *libc.TLS, pParse uintptr, iDb int32, iTab Pgno, isWriteLock U8, zName uintptr) { /* sqlite3.c:113071:29: */
var pToplevel uintptr
var i int32
var nBytes int32
@@ -92664,17 +93857,17 @@ func lockTable(tls *libc.TLS, pParse uintptr, iDb int32, iTab Pgno, isWriteLock
return pParse
}()
for i = 0; i < (*Parse)(unsafe.Pointer(pToplevel)).FnTableLock; i++ {
- p = ((*Parse)(unsafe.Pointer(pToplevel)).FaTableLock + uintptr(i)*16)
- if ((*TableLock)(unsafe.Pointer(p)).FiDb == iDb) && ((*TableLock)(unsafe.Pointer(p)).FiTab == iTab) {
- (*TableLock)(unsafe.Pointer(p)).FisWriteLock = (U8(libc.Bool32(((*TableLock)(unsafe.Pointer(p)).FisWriteLock != 0) || (isWriteLock != 0))))
+ p = (*Parse)(unsafe.Pointer(pToplevel)).FaTableLock + uintptr(i)*16
+ if (*TableLock)(unsafe.Pointer(p)).FiDb == iDb && (*TableLock)(unsafe.Pointer(p)).FiTab == iTab {
+ (*TableLock)(unsafe.Pointer(p)).FisWriteLock = U8(libc.Bool32((*TableLock)(unsafe.Pointer(p)).FisWriteLock != 0 || isWriteLock != 0))
return
}
}
- nBytes = (int32(uint32(unsafe.Sizeof(TableLock{})) * (uint32((*Parse)(unsafe.Pointer(pToplevel)).FnTableLock + 1))))
+ nBytes = int32(uint32(unsafe.Sizeof(TableLock{})) * uint32((*Parse)(unsafe.Pointer(pToplevel)).FnTableLock+1))
(*Parse)(unsafe.Pointer(pToplevel)).FaTableLock = Xsqlite3DbReallocOrFree(tls, (*Parse)(unsafe.Pointer(pToplevel)).Fdb, (*Parse)(unsafe.Pointer(pToplevel)).FaTableLock, uint64(nBytes))
if (*Parse)(unsafe.Pointer(pToplevel)).FaTableLock != 0 {
- p = ((*Parse)(unsafe.Pointer(pToplevel)).FaTableLock + uintptr(libc.PostIncInt32(&(*Parse)(unsafe.Pointer(pToplevel)).FnTableLock, 1))*16)
+ p = (*Parse)(unsafe.Pointer(pToplevel)).FaTableLock + uintptr(libc.PostIncInt32(&(*Parse)(unsafe.Pointer(pToplevel)).FnTableLock, 1))*16
(*TableLock)(unsafe.Pointer(p)).FiDb = iDb
(*TableLock)(unsafe.Pointer(p)).FiTab = iTab
(*TableLock)(unsafe.Pointer(p)).FisWriteLock = isWriteLock
@@ -92685,7 +93878,7 @@ func lockTable(tls *libc.TLS, pParse uintptr, iDb int32, iTab Pgno, isWriteLock
}
}
-func Xsqlite3TableLock(tls *libc.TLS, pParse uintptr, iDb int32, iTab Pgno, isWriteLock U8, zName uintptr) { /* sqlite3.c:112499:21: */
+func Xsqlite3TableLock(tls *libc.TLS, pParse uintptr, iDb int32, iTab Pgno, isWriteLock U8, zName uintptr) { /* sqlite3.c:113107:21: */
if iDb == 1 {
return
}
@@ -92697,12 +93890,12 @@ func Xsqlite3TableLock(tls *libc.TLS, pParse uintptr, iDb int32, iTab Pgno, isWr
// Code an OP_TableLock instruction for each table locked by the
// statement (configured by calls to sqlite3TableLock()).
-func codeTableLocks(tls *libc.TLS, pParse uintptr) { /* sqlite3.c:112515:13: */
+func codeTableLocks(tls *libc.TLS, pParse uintptr) { /* sqlite3.c:113123:13: */
var i int32
var pVdbe uintptr = (*Parse)(unsafe.Pointer(pParse)).FpVdbe
for i = 0; i < (*Parse)(unsafe.Pointer(pParse)).FnTableLock; i++ {
- var p uintptr = ((*Parse)(unsafe.Pointer(pParse)).FaTableLock + uintptr(i)*16)
+ var p uintptr = (*Parse)(unsafe.Pointer(pParse)).FaTableLock + uintptr(i)*16
var p1 int32 = (*TableLock)(unsafe.Pointer(p)).FiDb
Xsqlite3VdbeAddOp4(tls, pVdbe, OP_TableLock, p1, int32((*TableLock)(unsafe.Pointer(p)).FiTab), int32((*TableLock)(unsafe.Pointer(p)).FisWriteLock),
(*TableLock)(unsafe.Pointer(p)).FzLockName, -1)
@@ -92721,7 +93914,7 @@ func codeTableLocks(tls *libc.TLS, pParse uintptr) { /* sqlite3.c:112515:13: */
//
// Note that if an error occurred, it might be the case that
// no VDBE code was generated.
-func Xsqlite3FinishCoding(tls *libc.TLS, pParse uintptr) { /* sqlite3.c:112554:21: */
+func Xsqlite3FinishCoding(tls *libc.TLS, pParse uintptr) { /* sqlite3.c:113162:21: */
var db uintptr
var v uintptr
@@ -92729,7 +93922,7 @@ func Xsqlite3FinishCoding(tls *libc.TLS, pParse uintptr) { /* sqlite3.c:112554:2
if (*Parse)(unsafe.Pointer(pParse)).Fnested != 0 {
return
}
- if ((*Sqlite3)(unsafe.Pointer(db)).FmallocFailed != 0) || ((*Parse)(unsafe.Pointer(pParse)).FnErr != 0) {
+ if (*Sqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 || (*Parse)(unsafe.Pointer(pParse)).FnErr != 0 {
if (*Parse)(unsafe.Pointer(pParse)).Frc == SQLITE_OK {
(*Parse)(unsafe.Pointer(pParse)).Frc = SQLITE_ERROR
}
@@ -92752,21 +93945,25 @@ func Xsqlite3FinishCoding(tls *libc.TLS, pParse uintptr) { /* sqlite3.c:112554:2
if v != 0 {
if (*Parse)(unsafe.Pointer(pParse)).FbReturning != 0 {
- var pReturning uintptr = *(*uintptr)(unsafe.Pointer(pParse + 128 /* &.u1 */))
+ var pReturning uintptr = *(*uintptr)(unsafe.Pointer(pParse + 124))
var addrRewind int32
var i int32
var reg int32
- addrRewind = Xsqlite3VdbeAddOp1(tls, v, OP_Rewind, (*Returning)(unsafe.Pointer(pReturning)).FiRetCur)
+ if (*Returning)(unsafe.Pointer(pReturning)).FnRetCol == 0 {
- reg = (*Returning)(unsafe.Pointer(pReturning)).FiRetReg
- for i = 0; i < (*Returning)(unsafe.Pointer(pReturning)).FnRetCol; i++ {
- Xsqlite3VdbeAddOp3(tls, v, OP_Column, (*Returning)(unsafe.Pointer(pReturning)).FiRetCur, i, (reg + i))
- }
- Xsqlite3VdbeAddOp2(tls, v, OP_ResultRow, reg, i)
- Xsqlite3VdbeAddOp2(tls, v, OP_Next, (*Returning)(unsafe.Pointer(pReturning)).FiRetCur, (addrRewind + 1))
+ } else {
+ addrRewind = Xsqlite3VdbeAddOp1(tls, v, OP_Rewind, (*Returning)(unsafe.Pointer(pReturning)).FiRetCur)
+
+ reg = (*Returning)(unsafe.Pointer(pReturning)).FiRetReg
+ for i = 0; i < (*Returning)(unsafe.Pointer(pReturning)).FnRetCol; i++ {
+ Xsqlite3VdbeAddOp3(tls, v, OP_Column, (*Returning)(unsafe.Pointer(pReturning)).FiRetCur, i, reg+i)
+ }
+ Xsqlite3VdbeAddOp2(tls, v, OP_ResultRow, reg, i)
+ Xsqlite3VdbeAddOp2(tls, v, OP_Next, (*Returning)(unsafe.Pointer(pReturning)).FiRetCur, addrRewind+1)
- Xsqlite3VdbeJumpHere(tls, v, addrRewind)
+ Xsqlite3VdbeJumpHere(tls, v, addrRewind)
+ }
}
Xsqlite3VdbeAddOp0(tls, v, OP_Halt)
@@ -92775,15 +93972,15 @@ func Xsqlite3FinishCoding(tls *libc.TLS, pParse uintptr) { /* sqlite3.c:112554:2
// set for each database that is used. Generate code to start a
// transaction on each used database and to verify the schema cookie
// on each used database.
- if (int32((*Sqlite3)(unsafe.Pointer(db)).FmallocFailed) == 0) &&
- ((((*Parse)(unsafe.Pointer(pParse)).FcookieMask) != YDbMask(0)) || ((*Parse)(unsafe.Pointer(pParse)).FpConstExpr != 0)) {
+ if int32((*Sqlite3)(unsafe.Pointer(db)).FmallocFailed) == 0 &&
+ ((*Parse)(unsafe.Pointer(pParse)).FcookieMask != YDbMask(0) || (*Parse)(unsafe.Pointer(pParse)).FpConstExpr != 0) {
var iDb int32
var i int32
Xsqlite3VdbeJumpHere(tls, v, 0)
for iDb = 0; iDb < (*Sqlite3)(unsafe.Pointer(db)).FnDb; iDb++ {
var pSchema uintptr
- if (libc.Bool32((((*Parse)(unsafe.Pointer(pParse)).FcookieMask) & (YDbMask((YDbMask(1))) << (iDb))) != YDbMask(0))) == 0 {
+ if libc.Bool32((*Parse)(unsafe.Pointer(pParse)).FcookieMask&(YDbMask(YDbMask(1))<<iDb) != YDbMask(0)) == 0 {
continue
}
Xsqlite3VdbeUsesBtree(tls, v, iDb)
@@ -92791,8 +93988,8 @@ func Xsqlite3FinishCoding(tls *libc.TLS, pParse uintptr) { /* sqlite3.c:112554:2
Xsqlite3VdbeAddOp4Int(tls, v,
OP_Transaction, // Opcode
iDb, // P1
- (libc.Bool32((((*Parse)(unsafe.Pointer(pParse)).FwriteMask) & (YDbMask((YDbMask(1))) << (iDb))) != YDbMask(0))), // P2
- (*Schema)(unsafe.Pointer(pSchema)).Fschema_cookie, // P3
+ libc.Bool32((*Parse)(unsafe.Pointer(pParse)).FwriteMask&(YDbMask(YDbMask(1))<<iDb) != YDbMask(0)),
+ (*Schema)(unsafe.Pointer(pSchema)).Fschema_cookie, // P3
(*Schema)(unsafe.Pointer(pSchema)).FiGeneration)
if int32((*Sqlite3)(unsafe.Pointer(db)).Finit.Fbusy) == 0 {
Xsqlite3VdbeChangeP5(tls, v, uint16(1))
@@ -92823,16 +94020,20 @@ func Xsqlite3FinishCoding(tls *libc.TLS, pParse uintptr) { /* sqlite3.c:112554:2
var pEL uintptr = (*Parse)(unsafe.Pointer(pParse)).FpConstExpr
(*Parse)(unsafe.Pointer(pParse)).FokConstFactor = U8(0)
for i = 0; i < (*ExprList)(unsafe.Pointer(pEL)).FnExpr; i++ {
- var iReg int32 = *(*int32)(unsafe.Pointer((pEL + 8 /* &.a */) + uintptr(i)*20 + 16 /* &.u */))
+ var iReg int32 = *(*int32)(unsafe.Pointer(pEL + 8 + uintptr(i)*20 + 16))
if iReg > 0 {
- Xsqlite3ExprCode(tls, pParse, (*ExprList_item)(unsafe.Pointer((pEL+8 /* &.a */)+uintptr(i)*20)).FpExpr, iReg)
+ Xsqlite3ExprCode(tls, pParse, (*ExprList_item)(unsafe.Pointer(pEL+8+uintptr(i)*20)).FpExpr, iReg)
}
}
}
if (*Parse)(unsafe.Pointer(pParse)).FbReturning != 0 {
- var pRet uintptr = *(*uintptr)(unsafe.Pointer(pParse + 128 /* &.u1 */))
- Xsqlite3VdbeAddOp2(tls, v, OP_OpenEphemeral, (*Returning)(unsafe.Pointer(pRet)).FiRetCur, (*Returning)(unsafe.Pointer(pRet)).FnRetCol)
+ var pRet uintptr = *(*uintptr)(unsafe.Pointer(pParse + 124))
+ if (*Returning)(unsafe.Pointer(pRet)).FnRetCol == 0 {
+
+ } else {
+ Xsqlite3VdbeAddOp2(tls, v, OP_OpenEphemeral, (*Returning)(unsafe.Pointer(pRet)).FiRetCur, (*Returning)(unsafe.Pointer(pRet)).FnRetCol)
+ }
}
// Finally, jump back to the beginning of the executable code.
@@ -92841,7 +94042,7 @@ func Xsqlite3FinishCoding(tls *libc.TLS, pParse uintptr) { /* sqlite3.c:112554:2
}
// Get the VDBE program ready for execution
- if ((v != 0) && ((*Parse)(unsafe.Pointer(pParse)).FnErr == 0)) && !(int32((*Sqlite3)(unsafe.Pointer(db)).FmallocFailed) != 0) {
+ if v != 0 && (*Parse)(unsafe.Pointer(pParse)).FnErr == 0 && !(int32((*Sqlite3)(unsafe.Pointer(db)).FmallocFailed) != 0) {
// A minimum of one cursor is required if autoincrement is used
// See ticket [a696379c1f08866]
@@ -92854,15 +94055,16 @@ func Xsqlite3FinishCoding(tls *libc.TLS, pParse uintptr) { /* sqlite3.c:112554:2
// Run the parser and code generator recursively in order to generate
// code for the SQL statement given onto the end of the pParse context
-// currently under construction. When the parser is run recursively
-// this way, the final OP_Halt is not appended and other initialization
-// and finalization steps are omitted because those are handling by the
-// outermost parser.
-//
-// Not everything is nestable. This facility is designed to permit
-// INSERT, UPDATE, and DELETE operations against the schema table. Use
-// care if you decide to try to use this routine for some other purposes.
-func Xsqlite3NestedParse(tls *libc.TLS, pParse uintptr, zFormat uintptr, va uintptr) { /* sqlite3.c:112711:21: */
+// currently under construction. Notes:
+//
+// * The final OP_Halt is not appended and other initialization
+// and finalization steps are omitted because those are handling by the
+// outermost parser.
+//
+// * Built-in SQL functions always take precedence over application-defined
+// SQL functions. In other words, it is not possible to override a
+// built-in function.
+func Xsqlite3NestedParse(tls *libc.TLS, pParse uintptr, zFormat uintptr, va uintptr) { /* sqlite3.c:113328:21: */
bp := tls.Alloc(88)
defer tls.Free(88)
@@ -92871,6 +94073,7 @@ func Xsqlite3NestedParse(tls *libc.TLS, pParse uintptr, zFormat uintptr, va uint
var zSql uintptr
*(*uintptr)(unsafe.Pointer(bp + 84 /* zErrMsg */)) = uintptr(0)
var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb
+ var savedDbFlags U32 = (*Sqlite3)(unsafe.Pointer(db)).FmDbFlags
// var saveBuf [84]uint8 at bp, 84
if (*Parse)(unsafe.Pointer(pParse)).FnErr != 0 {
@@ -92891,12 +94094,14 @@ func Xsqlite3NestedParse(tls *libc.TLS, pParse uintptr, zFormat uintptr, va uint
return
}
(*Parse)(unsafe.Pointer(pParse)).Fnested++
- libc.Xmemcpy(tls, bp /* &saveBuf[0] */, ((pParse) + uintptr((uint32((uintptr(0) + 188 /* &.sLastToken */))))), (uint32(unsafe.Sizeof(Parse{})) - (uint32((uintptr(0) + 188 /* &.sLastToken */)))))
- libc.Xmemset(tls, ((pParse) + uintptr((uint32((uintptr(0) + 188 /* &.sLastToken */))))), 0, (uint32(unsafe.Sizeof(Parse{})) - (uint32((uintptr(0) + 188 /* &.sLastToken */)))))
+ libc.Xmemcpy(tls, bp /* &saveBuf[0] */, pParse+uintptr(uint32(uintptr(0)+184)), uint32(unsafe.Sizeof(Parse{}))-uint32(uintptr(0)+184))
+ libc.Xmemset(tls, pParse+uintptr(uint32(uintptr(0)+184)), 0, uint32(unsafe.Sizeof(Parse{}))-uint32(uintptr(0)+184))
+ *(*U32)(unsafe.Pointer(db + 24)) |= U32(DBFLAG_PreferBuiltin)
Xsqlite3RunParser(tls, pParse, zSql, bp+84 /* &zErrMsg */)
+ (*Sqlite3)(unsafe.Pointer(db)).FmDbFlags = savedDbFlags
Xsqlite3DbFree(tls, db, *(*uintptr)(unsafe.Pointer(bp + 84 /* zErrMsg */)))
Xsqlite3DbFree(tls, db, zSql)
- libc.Xmemcpy(tls, ((pParse) + uintptr((uint32((uintptr(0) + 188 /* &.sLastToken */))))), bp /* &saveBuf[0] */, (uint32(unsafe.Sizeof(Parse{})) - (uint32((uintptr(0) + 188 /* &.sLastToken */)))))
+ libc.Xmemcpy(tls, pParse+uintptr(uint32(uintptr(0)+184)), bp /* &saveBuf[0] */, uint32(unsafe.Sizeof(Parse{}))-uint32(uintptr(0)+184))
(*Parse)(unsafe.Pointer(pParse)).Fnested--
}
@@ -92910,7 +94115,7 @@ func Xsqlite3NestedParse(tls *libc.TLS, pParse uintptr, zFormat uintptr, va uint
// auxiliary databases added using the ATTACH command.
//
// See also sqlite3LocateTable().
-func Xsqlite3FindTable(tls *libc.TLS, db uintptr, zName uintptr, zDatabase uintptr) uintptr { /* sqlite3.c:112763:22: */
+func Xsqlite3FindTable(tls *libc.TLS, db uintptr, zName uintptr, zDatabase uintptr) uintptr { /* sqlite3.c:113383:22: */
var p uintptr = uintptr(0)
var i int32
@@ -92925,53 +94130,53 @@ func Xsqlite3FindTable(tls *libc.TLS, db uintptr, zName uintptr, zDatabase uintp
if i >= (*Sqlite3)(unsafe.Pointer(db)).FnDb {
// No match against the official names. But always match "main"
// to schema 0 as a legacy fallback.
- if Xsqlite3StrICmp(tls, zDatabase, ts+5458 /* "main" */) == 0 {
+ if Xsqlite3StrICmp(tls, zDatabase, ts+6305) == 0 {
i = 0
} else {
return uintptr(0)
}
}
- p = Xsqlite3HashFind(tls, ((*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+uintptr(i)*16)).FpSchema + 8 /* &.tblHash */), zName)
- if (p == uintptr(0)) && (Xsqlite3_strnicmp(tls, zName, ts+7081 /* "sqlite_" */, 7) == 0) {
+ p = Xsqlite3HashFind(tls, (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+uintptr(i)*16)).FpSchema+8, zName)
+ if p == uintptr(0) && Xsqlite3_strnicmp(tls, zName, ts+7997, 7) == 0 {
if i == 1 {
- if ((Xsqlite3StrICmp(tls, (zName+uintptr(7)), (ts+10839 /* "sqlite_temp_sche..." */ +7)) == 0) ||
- (Xsqlite3StrICmp(tls, (zName+uintptr(7)), (ts+10858 /* "sqlite_schema" */ +7)) == 0)) ||
- (Xsqlite3StrICmp(tls, (zName+uintptr(7)), (ts+4956 /* "sqlite_master" */ +7)) == 0) {
- p = Xsqlite3HashFind(tls, ((*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+1*16)).FpSchema + 8 /* &.tblHash */),
- ts+10872 /* "sqlite_temp_mast..." */)
+ if Xsqlite3StrICmp(tls, zName+uintptr(7), ts+11953+7) == 0 ||
+ Xsqlite3StrICmp(tls, zName+uintptr(7), ts+11972+7) == 0 ||
+ Xsqlite3StrICmp(tls, zName+uintptr(7), ts+5803+7) == 0 {
+ p = Xsqlite3HashFind(tls, (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+1*16)).FpSchema+8,
+ ts+11986 /* "sqlite_temp_mast..." */)
}
} else {
- if Xsqlite3StrICmp(tls, (zName+uintptr(7)), (ts+10858 /* "sqlite_schema" */ +7)) == 0 {
- p = Xsqlite3HashFind(tls, ((*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+uintptr(i)*16)).FpSchema + 8 /* &.tblHash */),
- ts+4956 /* "sqlite_master" */)
+ if Xsqlite3StrICmp(tls, zName+uintptr(7), ts+11972+7) == 0 {
+ p = Xsqlite3HashFind(tls, (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+uintptr(i)*16)).FpSchema+8,
+ ts+5803 /* "sqlite_master" */)
}
}
}
} else {
// Match against TEMP first
- p = Xsqlite3HashFind(tls, ((*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+1*16)).FpSchema + 8 /* &.tblHash */), zName)
+ p = Xsqlite3HashFind(tls, (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+1*16)).FpSchema+8, zName)
if p != 0 {
return p
}
// The main database is second
- p = Xsqlite3HashFind(tls, ((*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb)).FpSchema + 8 /* &.tblHash */), zName)
+ p = Xsqlite3HashFind(tls, (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb)).FpSchema+8, zName)
if p != 0 {
return p
}
// Attached databases are in order of attachment
for i = 2; i < (*Sqlite3)(unsafe.Pointer(db)).FnDb; i++ {
- p = Xsqlite3HashFind(tls, ((*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+uintptr(i)*16)).FpSchema + 8 /* &.tblHash */), zName)
+ p = Xsqlite3HashFind(tls, (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+uintptr(i)*16)).FpSchema+8, zName)
if p != 0 {
break
}
}
- if (p == uintptr(0)) && (Xsqlite3_strnicmp(tls, zName, ts+7081 /* "sqlite_" */, 7) == 0) {
- if Xsqlite3StrICmp(tls, (zName+uintptr(7)), (ts+10858 /* "sqlite_schema" */ +7)) == 0 {
- p = Xsqlite3HashFind(tls, ((*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb)).FpSchema + 8 /* &.tblHash */), ts+4956 /* "sqlite_master" */)
- } else if Xsqlite3StrICmp(tls, (zName+uintptr(7)), (ts+10839 /* "sqlite_temp_sche..." */ +7)) == 0 {
- p = Xsqlite3HashFind(tls, ((*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+1*16)).FpSchema + 8 /* &.tblHash */),
- ts+10872 /* "sqlite_temp_mast..." */)
+ if p == uintptr(0) && Xsqlite3_strnicmp(tls, zName, ts+7997, 7) == 0 {
+ if Xsqlite3StrICmp(tls, zName+uintptr(7), ts+11972+7) == 0 {
+ p = Xsqlite3HashFind(tls, (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb)).FpSchema+8, ts+5803 /* "sqlite_master" */)
+ } else if Xsqlite3StrICmp(tls, zName+uintptr(7), ts+11953+7) == 0 {
+ p = Xsqlite3HashFind(tls, (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+1*16)).FpSchema+8,
+ ts+11986 /* "sqlite_temp_mast..." */)
}
}
}
@@ -92986,7 +94191,7 @@ func Xsqlite3FindTable(tls *libc.TLS, db uintptr, zName uintptr, zDatabase uintp
// The difference between this routine and sqlite3FindTable() is that this
// routine leaves an error message in pParse->zErrMsg where
// sqlite3FindTable() does not.
-func Xsqlite3LocateTable(tls *libc.TLS, pParse uintptr, flags U32, zName uintptr, zDbase uintptr) uintptr { /* sqlite3.c:112841:22: */
+func Xsqlite3LocateTable(tls *libc.TLS, pParse uintptr, flags U32, zName uintptr, zDbase uintptr) uintptr { /* sqlite3.c:113461:22: */
bp := tls.Alloc(40)
defer tls.Free(40)
@@ -92995,8 +94200,8 @@ func Xsqlite3LocateTable(tls *libc.TLS, pParse uintptr, flags U32, zName uintptr
// Read the database schema. If an error occurs, leave an error message
// and code in pParse and return NULL.
- if (((*Sqlite3)(unsafe.Pointer(db)).FmDbFlags & U32(DBFLAG_SchemaKnownOk)) == U32(0)) &&
- (SQLITE_OK != Xsqlite3ReadSchema(tls, pParse)) {
+ if (*Sqlite3)(unsafe.Pointer(db)).FmDbFlags&U32(DBFLAG_SchemaKnownOk) == U32(0) &&
+ SQLITE_OK != Xsqlite3ReadSchema(tls, pParse) {
return uintptr(0)
}
@@ -93005,34 +94210,35 @@ func Xsqlite3LocateTable(tls *libc.TLS, pParse uintptr, flags U32, zName uintptr
// If zName is the not the name of a table in the schema created using
// CREATE, then check to see if it is the name of an virtual table that
// can be an eponymous virtual table.
- if (int32((*Parse)(unsafe.Pointer(pParse)).FdisableVtab) == 0) && (int32((*Sqlite3)(unsafe.Pointer(db)).Finit.Fbusy) == 0) {
- var pMod uintptr = Xsqlite3HashFind(tls, (db + 376 /* &.aModule */), zName)
- if (pMod == uintptr(0)) && (Xsqlite3_strnicmp(tls, zName, ts+10891 /* "pragma_" */, 7) == 0) {
+ if int32((*Parse)(unsafe.Pointer(pParse)).FdisableVtab) == 0 && int32((*Sqlite3)(unsafe.Pointer(db)).Finit.Fbusy) == 0 {
+ var pMod uintptr = Xsqlite3HashFind(tls, db+400, zName)
+ if pMod == uintptr(0) && Xsqlite3_strnicmp(tls, zName, ts+12005, 7) == 0 {
pMod = Xsqlite3PragmaVtabRegister(tls, db, zName)
}
- if (pMod != 0) && (Xsqlite3VtabEponymousTableInit(tls, pParse, pMod) != 0) {
+ if pMod != 0 && Xsqlite3VtabEponymousTableInit(tls, pParse, pMod) != 0 {
+
return (*Module)(unsafe.Pointer(pMod)).FpEpoTab
}
}
- if (flags & U32(LOCATE_NOERR)) != 0 {
+ if flags&U32(LOCATE_NOERR) != 0 {
return uintptr(0)
}
(*Parse)(unsafe.Pointer(pParse)).FcheckSchema = U8(1)
- } else if ((*Table)(unsafe.Pointer(p)).FnModuleArg != 0) && ((*Parse)(unsafe.Pointer(pParse)).FdisableVtab != 0) {
+ } else if int32((*Table)(unsafe.Pointer(p)).FeTabType) == TABTYP_VTAB && (*Parse)(unsafe.Pointer(pParse)).FdisableVtab != 0 {
p = uintptr(0)
}
if p == uintptr(0) {
var zMsg uintptr
- if (flags & U32(LOCATE_VIEW)) != 0 {
- zMsg = ts + 10899 /* "no such view" */
+ if flags&U32(LOCATE_VIEW) != 0 {
+ zMsg = ts + 12013 /* "no such view" */
} else {
- zMsg = ts + 10912 /* "no such table" */
+ zMsg = ts + 12026 /* "no such table" */
}
if zDbase != 0 {
- Xsqlite3ErrorMsg(tls, pParse, ts+5651 /* "%s: %s.%s" */, libc.VaList(bp, zMsg, zDbase, zName))
+ Xsqlite3ErrorMsg(tls, pParse, ts+6498 /* "%s: %s.%s" */, libc.VaList(bp, zMsg, zDbase, zName))
} else {
- Xsqlite3ErrorMsg(tls, pParse, ts+5661 /* "%s: %s" */, libc.VaList(bp+24, zMsg, zName))
+ Xsqlite3ErrorMsg(tls, pParse, ts+6508 /* "%s: %s" */, libc.VaList(bp+24, zMsg, zName))
}
} else {
@@ -93048,7 +94254,7 @@ func Xsqlite3LocateTable(tls *libc.TLS, pParse uintptr, flags U32, zName uintptr
// the search to schema (p->pSchema) if it is not NULL. p->pSchema may be
// non-NULL if it is part of a view or trigger program definition. See
// sqlite3FixSrcList() for details.
-func Xsqlite3LocateTableItem(tls *libc.TLS, pParse uintptr, flags U32, p uintptr) uintptr { /* sqlite3.c:112903:22: */
+func Xsqlite3LocateTableItem(tls *libc.TLS, pParse uintptr, flags U32, p uintptr) uintptr { /* sqlite3.c:113524:22: */
var zDb uintptr
if (*SrcItem)(unsafe.Pointer(p)).FpSchema != 0 {
@@ -93060,6 +94266,20 @@ func Xsqlite3LocateTableItem(tls *libc.TLS, pParse uintptr, flags U32, p uintptr
return Xsqlite3LocateTable(tls, pParse, flags, (*SrcItem)(unsafe.Pointer(p)).FzName, zDb)
}
+// Return the preferred table name for system tables. Translate legacy
+// names into the new preferred names, as appropriate.
+func Xsqlite3PreferredTableName(tls *libc.TLS, zName uintptr) uintptr { /* sqlite3.c:113544:27: */
+ if Xsqlite3_strnicmp(tls, zName, ts+7997, 7) == 0 {
+ if Xsqlite3StrICmp(tls, zName+uintptr(7), ts+5803+7) == 0 {
+ return ts + 11972 /* "sqlite_schema" */
+ }
+ if Xsqlite3StrICmp(tls, zName+uintptr(7), ts+11986+7) == 0 {
+ return ts + 11953 /* "sqlite_temp_sche..." */
+ }
+ }
+ return zName
+}
+
// Locate the in-memory structure that describes
// a particular index given the name of that index
// and the name of the database that contains the index.
@@ -93070,7 +94290,7 @@ func Xsqlite3LocateTableItem(tls *libc.TLS, pParse uintptr, flags U32, p uintptr
// for duplicate index names is done.) The search order is
// TEMP first, then MAIN, then any auxiliary databases added
// using the ATTACH command.
-func Xsqlite3FindIndex(tls *libc.TLS, db uintptr, zName uintptr, zDb uintptr) uintptr { /* sqlite3.c:112931:22: */
+func Xsqlite3FindIndex(tls *libc.TLS, db uintptr, zName uintptr, zDb uintptr) uintptr { /* sqlite3.c:113568:22: */
var p uintptr = uintptr(0)
var i int32
// All mutexes are required for schema access. Make sure we hold them.
@@ -93078,17 +94298,17 @@ func Xsqlite3FindIndex(tls *libc.TLS, db uintptr, zName uintptr, zDb uintptr) ui
for i = OMIT_TEMPDB; i < (*Sqlite3)(unsafe.Pointer(db)).FnDb; i++ {
var j int32
if i < 2 {
- j = (i ^ 1)
+ j = i ^ 1
} else {
j = i
} // Search TEMP before MAIN
var pSchema uintptr = (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb + uintptr(j)*16)).FpSchema
- if (zDb != 0) && (Xsqlite3DbIsNamed(tls, db, j, zDb) == 0) {
+ if zDb != 0 && Xsqlite3DbIsNamed(tls, db, j, zDb) == 0 {
continue
}
- p = Xsqlite3HashFind(tls, (pSchema + 24 /* &.idxHash */), zName)
+ p = Xsqlite3HashFind(tls, pSchema+24, zName)
if p != 0 {
break
}
@@ -93097,12 +94317,12 @@ func Xsqlite3FindIndex(tls *libc.TLS, db uintptr, zName uintptr, zDb uintptr) ui
}
// Reclaim the memory used by an index
-func Xsqlite3FreeIndex(tls *libc.TLS, db uintptr, p uintptr) { /* sqlite3.c:112951:21: */
+func Xsqlite3FreeIndex(tls *libc.TLS, db uintptr, p uintptr) { /* sqlite3.c:113588:21: */
Xsqlite3DeleteIndexSamples(tls, db, p)
Xsqlite3ExprDelete(tls, db, (*Index)(unsafe.Pointer(p)).FpPartIdxWhere)
Xsqlite3ExprListDelete(tls, db, (*Index)(unsafe.Pointer(p)).FaColExpr)
Xsqlite3DbFree(tls, db, (*Index)(unsafe.Pointer(p)).FzColAff)
- if (uint32(int32(*(*uint16)(unsafe.Pointer(p + 56 /* &.isResized */)) & 0x10 >> 4))) != 0 {
+ if uint32(int32(*(*uint16)(unsafe.Pointer(p + 56))&0x10>>4)) != 0 {
Xsqlite3DbFree(tls, db, (*Index)(unsafe.Pointer(p)).FazColl)
}
Xsqlite3_free(tls, (*Index)(unsafe.Pointer(p)).FaiRowEst)
@@ -93113,11 +94333,11 @@ func Xsqlite3FreeIndex(tls *libc.TLS, db uintptr, p uintptr) { /* sqlite3.c:1129
// unlike that index from its Table then remove the index from
// the index hash table and free all memory structures associated
// with the index.
-func Xsqlite3UnlinkAndDeleteIndex(tls *libc.TLS, db uintptr, iDb int32, zIdxName uintptr) { /* sqlite3.c:112971:21: */
+func Xsqlite3UnlinkAndDeleteIndex(tls *libc.TLS, db uintptr, iDb int32, zIdxName uintptr) { /* sqlite3.c:113608:21: */
var pIndex uintptr
var pHash uintptr
- pHash = ((*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+uintptr(iDb)*16)).FpSchema + 24 /* &.idxHash */)
+ pHash = (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+uintptr(iDb)*16)).FpSchema + 24
pIndex = Xsqlite3HashInsert(tls, pHash, zIdxName, uintptr(0))
if pIndex != 0 {
if (*Table)(unsafe.Pointer((*Index)(unsafe.Pointer(pIndex)).FpTable)).FpIndex == pIndex {
@@ -93127,16 +94347,16 @@ func Xsqlite3UnlinkAndDeleteIndex(tls *libc.TLS, db uintptr, iDb int32, zIdxName
// Justification of ALWAYS(); The index must be on the list of
// indices.
p = (*Table)(unsafe.Pointer((*Index)(unsafe.Pointer(pIndex)).FpTable)).FpIndex
- for (p != 0) && ((*Index)(unsafe.Pointer(p)).FpNext != pIndex) {
+ for p != 0 && (*Index)(unsafe.Pointer(p)).FpNext != pIndex {
p = (*Index)(unsafe.Pointer(p)).FpNext
}
- if (p != 0) && ((*Index)(unsafe.Pointer(p)).FpNext == pIndex) {
+ if p != 0 && (*Index)(unsafe.Pointer(p)).FpNext == pIndex {
(*Index)(unsafe.Pointer(p)).FpNext = (*Index)(unsafe.Pointer(pIndex)).FpNext
}
}
Xsqlite3FreeIndex(tls, db, pIndex)
}
- *(*U32)(unsafe.Pointer(db + 24 /* &.mDbFlags */)) |= (U32(DBFLAG_SchemaChange))
+ *(*U32)(unsafe.Pointer(db + 24)) |= U32(DBFLAG_SchemaChange)
}
// Look through the list of open database files in db->aDb[] and if
@@ -93145,11 +94365,11 @@ func Xsqlite3UnlinkAndDeleteIndex(tls *libc.TLS, db uintptr, iDb int32, zIdxName
//
// Entry 0 (the "main" database) and entry 1 (the "temp" database)
// are never candidates for being collapsed.
-func Xsqlite3CollapseDatabaseArray(tls *libc.TLS, db uintptr) { /* sqlite3.c:113004:21: */
+func Xsqlite3CollapseDatabaseArray(tls *libc.TLS, db uintptr) { /* sqlite3.c:113641:21: */
var i int32
var j int32
for i = libc.AssignInt32(&j, 2); i < (*Sqlite3)(unsafe.Pointer(db)).FnDb; i++ {
- var pDb uintptr = ((*Sqlite3)(unsafe.Pointer(db)).FaDb + uintptr(i)*16)
+ var pDb uintptr = (*Sqlite3)(unsafe.Pointer(db)).FaDb + uintptr(i)*16
if (*Db1)(unsafe.Pointer(pDb)).FpBt == uintptr(0) {
Xsqlite3DbFree(tls, db, (*Db1)(unsafe.Pointer(pDb)).FzDbSName)
(*Db1)(unsafe.Pointer(pDb)).FzDbSName = uintptr(0)
@@ -93161,29 +94381,29 @@ func Xsqlite3CollapseDatabaseArray(tls *libc.TLS, db uintptr) { /* sqlite3.c:113
j++
}
(*Sqlite3)(unsafe.Pointer(db)).FnDb = j
- if ((*Sqlite3)(unsafe.Pointer(db)).FnDb <= 2) && ((*Sqlite3)(unsafe.Pointer(db)).FaDb != db+448 /* &.aDbStatic */) {
- libc.Xmemcpy(tls, db+448 /* &.aDbStatic */, (*Sqlite3)(unsafe.Pointer(db)).FaDb, (uint32(2) * uint32(unsafe.Sizeof(Db{}))))
+ if (*Sqlite3)(unsafe.Pointer(db)).FnDb <= 2 && (*Sqlite3)(unsafe.Pointer(db)).FaDb != db+472 {
+ libc.Xmemcpy(tls, db+472, (*Sqlite3)(unsafe.Pointer(db)).FaDb, uint32(2)*uint32(unsafe.Sizeof(Db{})))
Xsqlite3DbFree(tls, db, (*Sqlite3)(unsafe.Pointer(db)).FaDb)
- (*Sqlite3)(unsafe.Pointer(db)).FaDb = db + 448 /* &.aDbStatic */
+ (*Sqlite3)(unsafe.Pointer(db)).FaDb = db + 472 /* &.aDbStatic */
}
}
// Reset the schema for the database at index iDb. Also reset the
// TEMP schema. The reset is deferred if db->nSchemaLock is not zero.
// Deferred resets may be run by calling with iDb<0.
-func Xsqlite3ResetOneSchema(tls *libc.TLS, db uintptr, iDb int32) { /* sqlite3.c:113031:21: */
+func Xsqlite3ResetOneSchema(tls *libc.TLS, db uintptr, iDb int32) { /* sqlite3.c:113668:21: */
var i int32
if iDb >= 0 {
- *(*U16)(unsafe.Pointer((*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer((db))).FaDb+uintptr(iDb)*16)).FpSchema + 78 /* &.schemaFlags */)) |= U16((DB_ResetWanted))
- *(*U16)(unsafe.Pointer((*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer((db))).FaDb+1*16)).FpSchema + 78 /* &.schemaFlags */)) |= U16((DB_ResetWanted))
- *(*U32)(unsafe.Pointer(db + 24 /* &.mDbFlags */)) &= (libc.Uint32FromInt32(libc.CplInt32(DBFLAG_SchemaKnownOk)))
+ *(*U16)(unsafe.Pointer((*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+uintptr(iDb)*16)).FpSchema + 78)) |= U16(DB_ResetWanted)
+ *(*U16)(unsafe.Pointer((*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+1*16)).FpSchema + 78)) |= U16(DB_ResetWanted)
+ *(*U32)(unsafe.Pointer(db + 24)) &= libc.Uint32FromInt32(libc.CplInt32(DBFLAG_SchemaKnownOk))
}
if (*Sqlite3)(unsafe.Pointer(db)).FnSchemaLock == U32(0) {
for i = 0; i < (*Sqlite3)(unsafe.Pointer(db)).FnDb; i++ {
- if (int32((*Schema)(unsafe.Pointer((*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer((db))).FaDb+uintptr(i)*16)).FpSchema)).FschemaFlags) & (DB_ResetWanted)) == (DB_ResetWanted) {
+ if int32((*Schema)(unsafe.Pointer((*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+uintptr(i)*16)).FpSchema)).FschemaFlags)&DB_ResetWanted == DB_ResetWanted {
Xsqlite3SchemaClear(tls, (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+uintptr(i)*16)).FpSchema)
}
}
@@ -93192,20 +94412,20 @@ func Xsqlite3ResetOneSchema(tls *libc.TLS, db uintptr, iDb int32) { /* sqlite3.c
// Erase all schema information from all attached databases (including
// "main" and "temp") for a single database connection.
-func Xsqlite3ResetAllSchemasOfConnection(tls *libc.TLS, db uintptr) { /* sqlite3.c:113055:21: */
+func Xsqlite3ResetAllSchemasOfConnection(tls *libc.TLS, db uintptr) { /* sqlite3.c:113692:21: */
var i int32
Xsqlite3BtreeEnterAll(tls, db)
for i = 0; i < (*Sqlite3)(unsafe.Pointer(db)).FnDb; i++ {
- var pDb uintptr = ((*Sqlite3)(unsafe.Pointer(db)).FaDb + uintptr(i)*16)
+ var pDb uintptr = (*Sqlite3)(unsafe.Pointer(db)).FaDb + uintptr(i)*16
if (*Db)(unsafe.Pointer(pDb)).FpSchema != 0 {
if (*Sqlite3)(unsafe.Pointer(db)).FnSchemaLock == U32(0) {
Xsqlite3SchemaClear(tls, (*Db)(unsafe.Pointer(pDb)).FpSchema)
} else {
- *(*U16)(unsafe.Pointer((*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer((db))).FaDb+uintptr(i)*16)).FpSchema + 78 /* &.schemaFlags */)) |= U16((DB_ResetWanted))
+ *(*U16)(unsafe.Pointer((*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+uintptr(i)*16)).FpSchema + 78)) |= U16(DB_ResetWanted)
}
}
}
- *(*U32)(unsafe.Pointer(db + 24 /* &.mDbFlags */)) &= (libc.Uint32FromInt32(libc.CplInt32((DBFLAG_SchemaChange | DBFLAG_SchemaKnownOk))))
+ *(*U32)(unsafe.Pointer(db + 24)) &= libc.Uint32FromInt32(libc.CplInt32(DBFLAG_SchemaChange | DBFLAG_SchemaKnownOk))
Xsqlite3VtabUnlockList(tls, db)
Xsqlite3BtreeLeaveAll(tls, db)
if (*Sqlite3)(unsafe.Pointer(db)).FnSchemaLock == U32(0) {
@@ -93214,17 +94434,96 @@ func Xsqlite3ResetAllSchemasOfConnection(tls *libc.TLS, db uintptr) { /* sqlite3
}
// This routine is called when a commit occurs.
-func Xsqlite3CommitInternalChanges(tls *libc.TLS, db uintptr) { /* sqlite3.c:113079:21: */
- *(*U32)(unsafe.Pointer(db + 24 /* &.mDbFlags */)) &= (libc.Uint32FromInt32(libc.CplInt32(DBFLAG_SchemaChange)))
+func Xsqlite3CommitInternalChanges(tls *libc.TLS, db uintptr) { /* sqlite3.c:113716:21: */
+ *(*U32)(unsafe.Pointer(db + 24)) &= libc.Uint32FromInt32(libc.CplInt32(DBFLAG_SchemaChange))
+}
+
+// Set the expression associated with a column. This is usually
+// the DEFAULT value, but might also be the expression that computes
+// the value for a generated column.
+func Xsqlite3ColumnSetExpr(tls *libc.TLS, pParse uintptr, pTab uintptr, pCol uintptr, pExpr uintptr) { /* sqlite3.c:113725:21: */
+ var pList uintptr
+
+ pList = *(*uintptr)(unsafe.Pointer(pTab + 44 + 8 /* &.pDfltList */))
+ if int32((*Column)(unsafe.Pointer(pCol)).FiDflt) == 0 ||
+ pList == uintptr(0) ||
+ (*ExprList)(unsafe.Pointer(pList)).FnExpr < int32((*Column)(unsafe.Pointer(pCol)).FiDflt) {
+ (*Column)(unsafe.Pointer(pCol)).FiDflt = func() uint16 {
+ if pList == uintptr(0) {
+ return uint16(1)
+ }
+ return uint16((*ExprList)(unsafe.Pointer(pList)).FnExpr + 1)
+ }()
+ *(*uintptr)(unsafe.Pointer(pTab + 44 + 8 /* &.pDfltList */)) = Xsqlite3ExprListAppend(tls, pParse, pList, pExpr)
+ } else {
+ Xsqlite3ExprDelete(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, (*ExprList_item)(unsafe.Pointer(pList+8+uintptr(int32((*Column)(unsafe.Pointer(pCol)).FiDflt)-1)*20)).FpExpr)
+ (*ExprList_item)(unsafe.Pointer(pList + 8 + uintptr(int32((*Column)(unsafe.Pointer(pCol)).FiDflt)-1)*20)).FpExpr = pExpr
+ }
+}
+
+// Return the expression associated with a column. The expression might be
+// the DEFAULT clause or the AS clause of a generated column.
+// Return NULL if the column has no associated expression.
+func Xsqlite3ColumnExpr(tls *libc.TLS, pTab uintptr, pCol uintptr) uintptr { /* sqlite3.c:113751:21: */
+ if int32((*Column)(unsafe.Pointer(pCol)).FiDflt) == 0 {
+ return uintptr(0)
+ }
+ if !(int32((*Table)(unsafe.Pointer(pTab)).FeTabType) == TABTYP_NORM) {
+ return uintptr(0)
+ }
+ if *(*uintptr)(unsafe.Pointer(pTab + 44 + 8)) == uintptr(0) {
+ return uintptr(0)
+ }
+ if (*ExprList)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pTab + 44 + 8)))).FnExpr < int32((*Column)(unsafe.Pointer(pCol)).FiDflt) {
+ return uintptr(0)
+ }
+ return (*ExprList_item)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pTab + 44 + 8)) + 8 + uintptr(int32((*Column)(unsafe.Pointer(pCol)).FiDflt)-1)*20)).FpExpr
+}
+
+// Set the collating sequence name for a column.
+func Xsqlite3ColumnSetColl(tls *libc.TLS, db uintptr, pCol uintptr, zColl uintptr) { /* sqlite3.c:113762:21: */
+ var nColl I64
+ var n I64
+ var zNew uintptr
+
+ n = I64(Xsqlite3Strlen30(tls, (*Column)(unsafe.Pointer(pCol)).FzCnName) + 1)
+ if int32((*Column)(unsafe.Pointer(pCol)).FcolFlags)&COLFLAG_HASTYPE != 0 {
+ n = n + I64(Xsqlite3Strlen30(tls, (*Column)(unsafe.Pointer(pCol)).FzCnName+uintptr(n))+1)
+ }
+ nColl = I64(Xsqlite3Strlen30(tls, zColl) + 1)
+ zNew = Xsqlite3DbRealloc(tls, db, (*Column)(unsafe.Pointer(pCol)).FzCnName, uint64(nColl+n))
+ if zNew != 0 {
+ (*Column)(unsafe.Pointer(pCol)).FzCnName = zNew
+ libc.Xmemcpy(tls, (*Column)(unsafe.Pointer(pCol)).FzCnName+uintptr(n), zColl, uint32(nColl))
+ *(*U16)(unsafe.Pointer(pCol + 12)) |= U16(COLFLAG_HASCOLL)
+ }
+}
+
+// Return the collating squence name for a column
+func Xsqlite3ColumnColl(tls *libc.TLS, pCol uintptr) uintptr { /* sqlite3.c:113787:27: */
+ var z uintptr
+ if int32((*Column)(unsafe.Pointer(pCol)).FcolFlags)&COLFLAG_HASCOLL == 0 {
+ return uintptr(0)
+ }
+ z = (*Column)(unsafe.Pointer(pCol)).FzCnName
+ for *(*uint8)(unsafe.Pointer(z)) != 0 {
+ z++
+ }
+ if int32((*Column)(unsafe.Pointer(pCol)).FcolFlags)&COLFLAG_HASTYPE != 0 {
+ for ok := true; ok; ok = *(*uint8)(unsafe.Pointer(z)) != 0 {
+ z++
+ }
+ }
+ return z + uintptr(1)
}
// Delete memory allocated for the column names of a table or view (the
// Table.aCol[] array).
-func Xsqlite3DeleteColumnNames(tls *libc.TLS, db uintptr, pTable uintptr) { /* sqlite3.c:113087:21: */
+func Xsqlite3DeleteColumnNames(tls *libc.TLS, db uintptr, pTable uintptr) { /* sqlite3.c:113802:21: */
var i int32
var pCol uintptr
- if (libc.AssignUintptr(&pCol, (*Table)(unsafe.Pointer(pTable)).FaCol)) != uintptr(0) {
+ if libc.AssignUintptr(&pCol, (*Table)(unsafe.Pointer(pTable)).FaCol) != uintptr(0) {
i = 0
__1:
if !(i < int32((*Table)(unsafe.Pointer(pTable)).FnCol)) {
@@ -93232,20 +94531,28 @@ func Xsqlite3DeleteColumnNames(tls *libc.TLS, db uintptr, pTable uintptr) { /* s
}
{
- Xsqlite3DbFree(tls, db, (*Column)(unsafe.Pointer(pCol)).FzName)
- Xsqlite3ExprDelete(tls, db, (*Column)(unsafe.Pointer(pCol)).FpDflt)
- Xsqlite3DbFree(tls, db, (*Column)(unsafe.Pointer(pCol)).FzColl)
+ Xsqlite3DbFree(tls, db, (*Column)(unsafe.Pointer(pCol)).FzCnName)
}
goto __2
__2:
i++
- pCol += 20
+ pCol += 16
goto __1
goto __3
__3:
;
Xsqlite3DbFree(tls, db, (*Table)(unsafe.Pointer(pTable)).FaCol)
+ if int32((*Table)(unsafe.Pointer(pTable)).FeTabType) == TABTYP_NORM {
+ Xsqlite3ExprListDelete(tls, db, *(*uintptr)(unsafe.Pointer(pTable + 44 + 8 /* &.pDfltList */)))
+ }
+ if db == uintptr(0) || (*Sqlite3)(unsafe.Pointer(db)).FpnBytesFreed == uintptr(0) {
+ (*Table)(unsafe.Pointer(pTable)).FaCol = uintptr(0)
+ (*Table)(unsafe.Pointer(pTable)).FnCol = int16(0)
+ if int32((*Table)(unsafe.Pointer(pTable)).FeTabType) == TABTYP_NORM {
+ *(*uintptr)(unsafe.Pointer(pTable + 44 + 8 /* &.pDfltList */)) = uintptr(0)
+ }
+ }
}
}
@@ -93262,7 +94569,7 @@ func Xsqlite3DeleteColumnNames(tls *libc.TLS, db uintptr, pTable uintptr) { /* s
// lookaside memory, but some ephemeral Table objects do.) Or the
// db parameter can be used with db->pnBytesFreed to measure the memory
// used by the Table object.
-func deleteTable(tls *libc.TLS, db uintptr, pTable uintptr) { /* sqlite3.c:113117:29: */
+func deleteTable(tls *libc.TLS, db uintptr, pTable uintptr) { /* sqlite3.c:113840:29: */
var pIndex uintptr
var pNext uintptr
@@ -93270,37 +94577,41 @@ func deleteTable(tls *libc.TLS, db uintptr, pTable uintptr) { /* sqlite3.c:11311
for pIndex = (*Table)(unsafe.Pointer(pTable)).FpIndex; pIndex != 0; pIndex = pNext {
pNext = (*Index)(unsafe.Pointer(pIndex)).FpNext
- if ((db == uintptr(0)) || ((*Sqlite3)(unsafe.Pointer(db)).FpnBytesFreed == uintptr(0))) && !((*Table)(unsafe.Pointer(pTable)).FnModuleArg != 0) {
+ if (db == uintptr(0) || (*Sqlite3)(unsafe.Pointer(db)).FpnBytesFreed == uintptr(0)) && !(int32((*Table)(unsafe.Pointer(pTable)).FeTabType) == TABTYP_VTAB) {
var zName uintptr = (*Index)(unsafe.Pointer(pIndex)).FzName
Xsqlite3HashInsert(tls,
- ((*Index)(unsafe.Pointer(pIndex)).FpSchema + 24 /* &.idxHash */), zName, uintptr(0))
+ (*Index)(unsafe.Pointer(pIndex)).FpSchema+24, zName, uintptr(0))
}
Xsqlite3FreeIndex(tls, db, pIndex)
}
- // Delete any foreign keys attached to this table.
- Xsqlite3FkDelete(tls, db, pTable)
+ if int32((*Table)(unsafe.Pointer(pTable)).FeTabType) == TABTYP_NORM {
+ Xsqlite3FkDelete(tls, db, pTable)
+ } else if int32((*Table)(unsafe.Pointer(pTable)).FeTabType) == TABTYP_VTAB {
+ Xsqlite3VtabClear(tls, db, pTable)
+ } else {
+
+ Xsqlite3SelectDelete(tls, db, *(*uintptr)(unsafe.Pointer(pTable + 44)))
+ }
// Delete the Table structure itself.
Xsqlite3DeleteColumnNames(tls, db, pTable)
Xsqlite3DbFree(tls, db, (*Table)(unsafe.Pointer(pTable)).FzName)
Xsqlite3DbFree(tls, db, (*Table)(unsafe.Pointer(pTable)).FzColAff)
- Xsqlite3SelectDelete(tls, db, (*Table)(unsafe.Pointer(pTable)).FpSelect)
Xsqlite3ExprListDelete(tls, db, (*Table)(unsafe.Pointer(pTable)).FpCheck)
- Xsqlite3VtabClear(tls, db, pTable)
Xsqlite3DbFree(tls, db, pTable)
// Verify that no lookaside memory was used by schema tables
}
-func Xsqlite3DeleteTable(tls *libc.TLS, db uintptr, pTable uintptr) { /* sqlite3.c:113168:21: */
+func Xsqlite3DeleteTable(tls *libc.TLS, db uintptr, pTable uintptr) { /* sqlite3.c:113897:21: */
// Do not delete the table until the reference count reaches zero.
if !(pTable != 0) {
return
}
- if (!(db != 0) || ((*Sqlite3)(unsafe.Pointer(db)).FpnBytesFreed == uintptr(0))) && ((libc.PreDecUint32(&(*Table)(unsafe.Pointer(pTable)).FnTabRef, 1)) > U32(0)) {
+ if (!(db != 0) || (*Sqlite3)(unsafe.Pointer(db)).FpnBytesFreed == uintptr(0)) && libc.PreDecUint32(&(*Table)(unsafe.Pointer(pTable)).FnTabRef, 1) > U32(0) {
return
}
deleteTable(tls, db, pTable)
@@ -93308,15 +94619,15 @@ func Xsqlite3DeleteTable(tls *libc.TLS, db uintptr, pTable uintptr) { /* sqlite3
// Unlink the given table from the hash tables and the delete the
// table structure with all its indices and foreign keys.
-func Xsqlite3UnlinkAndDeleteTable(tls *libc.TLS, db uintptr, iDb int32, zTabName uintptr) { /* sqlite3.c:113180:21: */
+func Xsqlite3UnlinkAndDeleteTable(tls *libc.TLS, db uintptr, iDb int32, zTabName uintptr) { /* sqlite3.c:113909:21: */
var p uintptr
var pDb uintptr
// Zero-length table names are allowed
- pDb = ((*Sqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*16)
- p = Xsqlite3HashInsert(tls, ((*Db)(unsafe.Pointer(pDb)).FpSchema + 8 /* &.tblHash */), zTabName, uintptr(0))
+ pDb = (*Sqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*16
+ p = Xsqlite3HashInsert(tls, (*Db)(unsafe.Pointer(pDb)).FpSchema+8, zTabName, uintptr(0))
Xsqlite3DeleteTable(tls, db, p)
- *(*U32)(unsafe.Pointer(db + 24 /* &.mDbFlags */)) |= (U32(DBFLAG_SchemaChange))
+ *(*U32)(unsafe.Pointer(db + 24)) |= U32(DBFLAG_SchemaChange)
}
// Given a token, return a string that consists of the text of that
@@ -93330,7 +94641,7 @@ func Xsqlite3UnlinkAndDeleteTable(tls *libc.TLS, db uintptr, iDb int32, zTabName
// Tokens are often just pointers into the original SQL text and so
// are not \000 terminated and are not persistent. The returned string
// is \000 terminated and is persistent.
-func Xsqlite3NameFromToken(tls *libc.TLS, db uintptr, pName uintptr) uintptr { /* sqlite3.c:113208:21: */
+func Xsqlite3NameFromToken(tls *libc.TLS, db uintptr, pName uintptr) uintptr { /* sqlite3.c:113937:21: */
var zName uintptr
if pName != 0 {
zName = Xsqlite3DbStrNDup(tls, db, (*Token)(unsafe.Pointer(pName)).Fz, uint64((*Token)(unsafe.Pointer(pName)).Fn))
@@ -93343,9 +94654,9 @@ func Xsqlite3NameFromToken(tls *libc.TLS, db uintptr, pName uintptr) uintptr { /
// Open the sqlite_schema table stored in database number iDb for
// writing. The table is opened using cursor 0.
-func Xsqlite3OpenSchemaTable(tls *libc.TLS, p uintptr, iDb int32) { /* sqlite3.c:113223:21: */
+func Xsqlite3OpenSchemaTable(tls *libc.TLS, p uintptr, iDb int32) { /* sqlite3.c:113952:21: */
var v uintptr = Xsqlite3GetVdbe(tls, p)
- Xsqlite3TableLock(tls, p, iDb, uint32(SCHEMA_ROOT), uint8(1), ts+4956 /* "sqlite_master" */)
+ Xsqlite3TableLock(tls, p, iDb, uint32(SCHEMA_ROOT), uint8(1), ts+5803 /* "sqlite_master" */)
Xsqlite3VdbeAddOp4Int(tls, v, OP_OpenWrite, 0, SCHEMA_ROOT, iDb, 5)
if (*Parse)(unsafe.Pointer(p)).FnTab == 0 {
(*Parse)(unsafe.Pointer(p)).FnTab = 1
@@ -93356,12 +94667,12 @@ func Xsqlite3OpenSchemaTable(tls *libc.TLS, p uintptr, iDb int32) { /* sqlite3.c
// of a database ("main", "temp" or the name of an attached db). This
// function returns the index of the named database in db->aDb[], or
// -1 if the named db cannot be found.
-func Xsqlite3FindDbName(tls *libc.TLS, db uintptr, zName uintptr) int32 { /* sqlite3.c:113238:20: */
+func Xsqlite3FindDbName(tls *libc.TLS, db uintptr, zName uintptr) int32 { /* sqlite3.c:113967:20: */
var i int32 = -1 // Database number
if zName != 0 {
var pDb uintptr
- i = ((*Sqlite3)(unsafe.Pointer(db)).FnDb - 1)
- pDb = ((*Sqlite3)(unsafe.Pointer(db)).FaDb + uintptr(i)*16)
+ i = (*Sqlite3)(unsafe.Pointer(db)).FnDb - 1
+ pDb = (*Sqlite3)(unsafe.Pointer(db)).FaDb + uintptr(i)*16
__1:
if !(i >= 0) {
goto __3
@@ -93372,7 +94683,7 @@ func Xsqlite3FindDbName(tls *libc.TLS, db uintptr, zName uintptr) int32 { /* sql
}
// "main" is always an acceptable alias for the primary database
// even if it has been renamed using SQLITE_DBCONFIG_MAINDBNAME.
- if (i == 0) && (0 == Xsqlite3_stricmp(tls, ts+5458 /* "main" */, zName)) {
+ if i == 0 && 0 == Xsqlite3_stricmp(tls, ts+6305, zName) {
goto __3
}
@@ -93392,7 +94703,7 @@ func Xsqlite3FindDbName(tls *libc.TLS, db uintptr, zName uintptr) int32 { /* sql
// "temp" or the name of an attached db). This routine returns the
// index of the named database in db->aDb[], or -1 if the named db
// does not exist.
-func Xsqlite3FindDb(tls *libc.TLS, db uintptr, pName uintptr) int32 { /* sqlite3.c:113258:20: */
+func Xsqlite3FindDb(tls *libc.TLS, db uintptr, pName uintptr) int32 { /* sqlite3.c:113987:20: */
var i int32 // Database number
var zName uintptr // Name we are searching for
zName = Xsqlite3NameFromToken(tls, db, pName)
@@ -93416,7 +94727,7 @@ func Xsqlite3FindDb(tls *libc.TLS, db uintptr, pName uintptr) int32 { /* sqlite3
// This routine sets the *ppUnqual pointer to point at the token (pName1 or
// pName2) that stores the unqualified table name. The index of the
// database "xxx" is returned.
-func Xsqlite3TwoPartName(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 uintptr, pUnqual uintptr) int32 { /* sqlite3.c:113283:20: */
+func Xsqlite3TwoPartName(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 uintptr, pUnqual uintptr) int32 { /* sqlite3.c:114012:20: */
bp := tls.Alloc(8)
defer tls.Free(8)
@@ -93425,13 +94736,13 @@ func Xsqlite3TwoPartName(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u
if (*Token)(unsafe.Pointer(pName2)).Fn > uint32(0) {
if (*Sqlite3)(unsafe.Pointer(db)).Finit.Fbusy != 0 {
- Xsqlite3ErrorMsg(tls, pParse, ts+10926 /* "corrupt database" */, 0)
+ Xsqlite3ErrorMsg(tls, pParse, ts+12040 /* "corrupt database" */, 0)
return -1
}
*(*uintptr)(unsafe.Pointer(pUnqual)) = pName2
iDb = Xsqlite3FindDb(tls, db, pName1)
if iDb < 0 {
- Xsqlite3ErrorMsg(tls, pParse, ts+10943 /* "unknown database..." */, libc.VaList(bp, pName1))
+ Xsqlite3ErrorMsg(tls, pParse, ts+12057 /* "unknown database..." */, libc.VaList(bp, pName1))
return -1
}
} else {
@@ -93443,9 +94754,9 @@ func Xsqlite3TwoPartName(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u
}
// True if PRAGMA writable_schema is ON
-func Xsqlite3WritableSchema(tls *libc.TLS, db uintptr) int32 { /* sqlite3.c:113316:20: */
+func Xsqlite3WritableSchema(tls *libc.TLS, db uintptr) int32 { /* sqlite3.c:114045:20: */
- return (libc.Bool32(((*Sqlite3)(unsafe.Pointer(db)).Fflags & (uint64(SQLITE_WriteSchema | SQLITE_Defensive))) == uint64(SQLITE_WriteSchema)))
+ return libc.Bool32((*Sqlite3)(unsafe.Pointer(db)).Fflags&uint64(SQLITE_WriteSchema|SQLITE_Defensive) == uint64(SQLITE_WriteSchema))
}
// This routine is used to check if the UTF-8 string zName is a legal
@@ -93457,28 +94768,28 @@ func Xsqlite3WritableSchema(tls *libc.TLS, db uintptr) int32 { /* sqlite3.c:1133
// When parsing the sqlite_schema table, this routine also checks to
// make sure the "type", "name", and "tbl_name" columns are consistent
// with the SQL.
-func Xsqlite3CheckObjectName(tls *libc.TLS, pParse uintptr, zName uintptr, zType uintptr, zTblName uintptr) int32 { /* sqlite3.c:113338:20: */
+func Xsqlite3CheckObjectName(tls *libc.TLS, pParse uintptr, zName uintptr, zType uintptr, zTblName uintptr) int32 { /* sqlite3.c:114067:20: */
bp := tls.Alloc(8)
defer tls.Free(8)
var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb
- if ((Xsqlite3WritableSchema(tls, db) != 0) ||
- ((uint32(int32(*(*uint8)(unsafe.Pointer((db + 164 /* &.init */) + 8 /* &.imposterTable */)) & 0x2 >> 1))) != 0)) ||
+ if Xsqlite3WritableSchema(tls, db) != 0 ||
+ uint32(int32(*(*uint8)(unsafe.Pointer(db + 172 + 8))&0x2>>1)) != 0 ||
!(int32(Xsqlite3Config.FbExtraSchemaChecks) != 0) {
// Skip these error checks for writable_schema=ON
return SQLITE_OK
}
if (*Sqlite3)(unsafe.Pointer(db)).Finit.Fbusy != 0 {
- if ((Xsqlite3_stricmp(tls, zType, *(*uintptr)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).Finit.FazInit))) != 0) ||
- (Xsqlite3_stricmp(tls, zName, *(*uintptr)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).Finit.FazInit + 1*4))) != 0)) ||
- (Xsqlite3_stricmp(tls, zTblName, *(*uintptr)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).Finit.FazInit + 2*4))) != 0) {
- Xsqlite3ErrorMsg(tls, pParse, ts+755 /* "" */, 0) // corruptSchema() will supply the error
+ if Xsqlite3_stricmp(tls, zType, *(*uintptr)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).Finit.FazInit))) != 0 ||
+ Xsqlite3_stricmp(tls, zName, *(*uintptr)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).Finit.FazInit + 1*4))) != 0 ||
+ Xsqlite3_stricmp(tls, zTblName, *(*uintptr)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).Finit.FazInit + 2*4))) != 0 {
+ Xsqlite3ErrorMsg(tls, pParse, ts+1543 /* "" */, 0) // corruptSchema() will supply the error
return SQLITE_ERROR
}
} else {
- if ((int32((*Parse)(unsafe.Pointer(pParse)).Fnested) == 0) && (0 == Xsqlite3_strnicmp(tls, zName, ts+7081 /* "sqlite_" */, 7))) ||
- ((Xsqlite3ReadOnlyShadowTables(tls, db) != 0) && (Xsqlite3ShadowTableName(tls, db, zName) != 0)) {
- Xsqlite3ErrorMsg(tls, pParse, ts+10963, /* "object name rese..." */
+ if int32((*Parse)(unsafe.Pointer(pParse)).Fnested) == 0 && 0 == Xsqlite3_strnicmp(tls, zName, ts+7997, 7) ||
+ Xsqlite3ReadOnlyShadowTables(tls, db) != 0 && Xsqlite3ShadowTableName(tls, db, zName) != 0 {
+ Xsqlite3ErrorMsg(tls, pParse, ts+12077, /* "object name rese..." */
libc.VaList(bp, zName))
return SQLITE_ERROR
}
@@ -93488,9 +94799,9 @@ func Xsqlite3CheckObjectName(tls *libc.TLS, pParse uintptr, zName uintptr, zType
}
// Return the PRIMARY KEY index of a table
-func Xsqlite3PrimaryKeyIndex(tls *libc.TLS, pTab uintptr) uintptr { /* sqlite3.c:113376:22: */
+func Xsqlite3PrimaryKeyIndex(tls *libc.TLS, pTab uintptr) uintptr { /* sqlite3.c:114105:22: */
var p uintptr
- for p = (*Table)(unsafe.Pointer(pTab)).FpIndex; (p != 0) && !((int32(*(*uint16)(unsafe.Pointer((p) + 56 /* &.idxType */)) & 0x3 >> 0)) == SQLITE_IDXTYPE_PRIMARYKEY); p = (*Index)(unsafe.Pointer(p)).FpNext {
+ for p = (*Table)(unsafe.Pointer(pTab)).FpIndex; p != 0 && !(int32(*(*uint16)(unsafe.Pointer(p + 56 /* &.idxType */))&0x3>>0) == SQLITE_IDXTYPE_PRIMARYKEY); p = (*Index)(unsafe.Pointer(p)).FpNext {
}
return p
}
@@ -93499,7 +94810,7 @@ func Xsqlite3PrimaryKeyIndex(tls *libc.TLS, pTab uintptr) uintptr { /* sqlite3.c
// for the column iCol in the table (as defined by the CREATE TABLE statement)
// find the (first) offset of that column in index pIdx. Or return -1
// if column iCol is not used in index pIdx.
-func Xsqlite3TableColumnToIndex(tls *libc.TLS, pIdx uintptr, iCol I16) I16 { /* sqlite3.c:113388:20: */
+func Xsqlite3TableColumnToIndex(tls *libc.TLS, pIdx uintptr, iCol I16) I16 { /* sqlite3.c:114117:20: */
var i int32
for i = 0; i < int32((*Index)(unsafe.Pointer(pIdx)).FnColumn); i++ {
if int32(iCol) == int32(*(*I16)(unsafe.Pointer((*Index)(unsafe.Pointer(pIdx)).FaiColumn + uintptr(i)*2))) {
@@ -93519,11 +94830,11 @@ func Xsqlite3TableColumnToIndex(tls *libc.TLS, pIdx uintptr, iCol I16) I16 { /*
// and only there are VIRTUAL columns to the left.
//
// If SQLITE_OMIT_GENERATED_COLUMNS, this routine is a no-op macro.
-func Xsqlite3StorageColumnToTable(tls *libc.TLS, pTab uintptr, iCol I16) I16 { /* sqlite3.c:113408:20: */
- if ((*Table)(unsafe.Pointer(pTab)).FtabFlags & U32(TF_HasVirtual)) != 0 {
+func Xsqlite3StorageColumnToTable(tls *libc.TLS, pTab uintptr, iCol I16) I16 { /* sqlite3.c:114137:20: */
+ if (*Table)(unsafe.Pointer(pTab)).FtabFlags&U32(TF_HasVirtual) != 0 {
var i int32
for i = 0; i <= int32(iCol); i++ {
- if (int32((*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FaCol+uintptr(i)*20)).FcolFlags) & COLFLAG_VIRTUAL) != 0 {
+ if int32((*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FaCol+uintptr(i)*16)).FcolFlags)&COLFLAG_VIRTUAL != 0 {
iCol++
}
}
@@ -93566,23 +94877,23 @@ func Xsqlite3StorageColumnToTable(tls *libc.TLS, pTab uintptr, iCol I16) I16 { /
// this routine is a no-op macro. If the pTab does not have any virtual
// columns, then this routine is no-op that always return iCol. If iCol
// is negative (indicating the ROWID column) then this routine return iCol.
-func Xsqlite3TableColumnToStorage(tls *libc.TLS, pTab uintptr, iCol I16) I16 { /* sqlite3.c:113456:20: */
+func Xsqlite3TableColumnToStorage(tls *libc.TLS, pTab uintptr, iCol I16) I16 { /* sqlite3.c:114185:20: */
var i int32
var n I16
- if (((*Table)(unsafe.Pointer(pTab)).FtabFlags & U32(TF_HasVirtual)) == U32(0)) || (int32(iCol) < 0) {
+ if (*Table)(unsafe.Pointer(pTab)).FtabFlags&U32(TF_HasVirtual) == U32(0) || int32(iCol) < 0 {
return iCol
}
i = 0
n = int16(0)
for ; i < int32(iCol); i++ {
- if (int32((*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FaCol+uintptr(i)*20)).FcolFlags) & COLFLAG_VIRTUAL) == 0 {
+ if int32((*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FaCol+uintptr(i)*16)).FcolFlags)&COLFLAG_VIRTUAL == 0 {
n++
}
}
- if (int32((*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FaCol+uintptr(i)*20)).FcolFlags) & COLFLAG_VIRTUAL) != 0 {
+ if int32((*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FaCol+uintptr(i)*16)).FcolFlags)&COLFLAG_VIRTUAL != 0 {
// iCol is a virtual column itself
- return (I16((int32((*Table)(unsafe.Pointer(pTab)).FnNVCol) + i) - int32(n)))
+ return I16(int32((*Table)(unsafe.Pointer(pTab)).FnNVCol) + i - int32(n))
} else {
// iCol is a normal or stored column
return n
@@ -93596,7 +94907,7 @@ func Xsqlite3TableColumnToStorage(tls *libc.TLS, pTab uintptr, iCol I16) I16 { /
// exists, so that the prepared statement for CREATE TABLE IF NOT EXISTS
// will return false for sqlite3_stmt_readonly() even if that statement
// is a read-only no-op.
-func sqlite3ForceNotReadOnly(tls *libc.TLS, pParse uintptr) { /* sqlite3.c:113482:13: */
+func sqlite3ForceNotReadOnly(tls *libc.TLS, pParse uintptr) { /* sqlite3.c:114211:13: */
var iReg int32 = libc.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1)
var v uintptr = Xsqlite3GetVdbe(tls, pParse)
if v != 0 {
@@ -93619,7 +94930,7 @@ func sqlite3ForceNotReadOnly(tls *libc.TLS, pParse uintptr) { /* sqlite3.c:11348
// routines will be called to add more information to this record.
// At the end of the CREATE TABLE statement, the sqlite3EndTable() routine
// is called to complete the construction of the new table record.
-func Xsqlite3StartTable(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 uintptr, isTemp int32, isView int32, isVirtual int32, noErr int32) { /* sqlite3.c:113507:21: */
+func Xsqlite3StartTable(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 uintptr, isTemp int32, isView int32, isVirtual int32, noErr int32) { /* sqlite3.c:114236:21: */
bp := tls.Alloc(20)
defer tls.Free(20)
@@ -93640,16 +94951,16 @@ func Xsqlite3StartTable(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 ui
zName = uintptr(0)
db = (*Parse)(unsafe.Pointer(pParse)).Fdb // Unqualified name of the table to create
- if !(((*Sqlite3)(unsafe.Pointer(db)).Finit.Fbusy != 0) && ((*Sqlite3)(unsafe.Pointer(db)).Finit.FnewTnum == Pgno(1))) {
+ if !((*Sqlite3)(unsafe.Pointer(db)).Finit.Fbusy != 0 && (*Sqlite3)(unsafe.Pointer(db)).Finit.FnewTnum == Pgno(1)) {
goto __1
}
// Special case: Parsing the sqlite_schema or sqlite_temp_schema schema
iDb = int32((*Sqlite3)(unsafe.Pointer(db)).Finit.FiDb)
zName = Xsqlite3DbStrDup(tls, db, func() uintptr {
- if (!(0 != 0)) && (iDb == 1) {
- return ts + 10872 /* "sqlite_temp_mast..." */
+ if !(0 != 0) && iDb == 1 {
+ return ts + 11986 /* "sqlite_temp_mast..." */
}
- return ts + 4956 /* "sqlite_master" */
+ return ts + 5803 /* "sqlite_master" */
}())
*(*uintptr)(unsafe.Pointer(bp + 16 /* pName */)) = pName1
goto __2
@@ -93662,16 +94973,16 @@ __1:
return
__3:
;
- if !(((!(0 != 0) && (isTemp != 0)) && ((*Token)(unsafe.Pointer(pName2)).Fn > uint32(0))) && (iDb != 1)) {
+ if !(!(0 != 0) && isTemp != 0 && (*Token)(unsafe.Pointer(pName2)).Fn > uint32(0) && iDb != 1) {
goto __4
}
// If creating a temp table, the name may not be qualified. Unless
// the database name is "temp" anyway.
- Xsqlite3ErrorMsg(tls, pParse, ts+11005 /* "temporary table ..." */, 0)
+ Xsqlite3ErrorMsg(tls, pParse, ts+12119 /* "temporary table ..." */, 0)
return
__4:
;
- if !(!(0 != 0) && (isTemp != 0)) {
+ if !(!(0 != 0) && isTemp != 0) {
goto __5
}
iDb = 1
@@ -93695,9 +95006,9 @@ __7:
;
if !(Xsqlite3CheckObjectName(tls, pParse, zName, func() uintptr {
if isView != 0 {
- return ts + 9208 /* "view" */
+ return ts + 10358
}
- return ts + 7823 /* "table" */
+ return ts + 8739
}(), zName) != 0) {
goto __8
}
@@ -93713,18 +95024,18 @@ __9:
zDb = (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*16)).FzDbSName
if !(Xsqlite3AuthCheck(tls, pParse, SQLITE_INSERT, func() uintptr {
- if (!(0 != 0)) && (isTemp == 1) {
- return ts + 10872 /* "sqlite_temp_mast..." */
+ if !(0 != 0) && isTemp == 1 {
+ return ts + 11986
}
- return ts + 4956 /* "sqlite_master" */
+ return ts + 5803
}(), uintptr(0), zDb) != 0) {
goto __10
}
goto begin_table_error
__10:
;
- if !(!(isVirtual != 0) && (Xsqlite3AuthCheck(tls, pParse, int32(aCode[(isTemp+(2*isView))]),
- zName, uintptr(0), zDb) != 0)) {
+ if !(!(isVirtual != 0) && Xsqlite3AuthCheck(tls, pParse, int32(aCode[isTemp+2*isView]),
+ zName, uintptr(0), zDb) != 0) {
goto __11
}
goto begin_table_error
@@ -93737,7 +95048,7 @@ __11:
// to an sqlite3_declare_vtab() call. In that case only the column names
// and types will be used, so there is no need to test for namespace
// collisions.
- if !(!(int32((*Parse)(unsafe.Pointer(pParse)).FeParseMode) != PARSE_MODE_NORMAL)) {
+ if !!(int32((*Parse)(unsafe.Pointer(pParse)).FeParseMode) != PARSE_MODE_NORMAL) {
goto __12
}
zDb1 = (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*16)).FzDbSName
@@ -93751,10 +95062,10 @@ __13:
if !(pTable != 0) {
goto __14
}
- if !(!(noErr != 0)) {
+ if !!(noErr != 0) {
goto __15
}
- Xsqlite3ErrorMsg(tls, pParse, ts+11046 /* "table %T already..." */, libc.VaList(bp, *(*uintptr)(unsafe.Pointer(bp + 16 /* pName */))))
+ Xsqlite3ErrorMsg(tls, pParse, ts+12160 /* "table %T already..." */, libc.VaList(bp, *(*uintptr)(unsafe.Pointer(bp + 16 /* pName */))))
goto __16
__15:
;
@@ -93768,7 +95079,7 @@ __14:
if !(Xsqlite3FindIndex(tls, db, zName, zDb1) != uintptr(0)) {
goto __17
}
- Xsqlite3ErrorMsg(tls, pParse, ts+11070 /* "there is already..." */, libc.VaList(bp+8, zName))
+ Xsqlite3ErrorMsg(tls, pParse, ts+12184 /* "there is already..." */, libc.VaList(bp+8, zName))
goto begin_table_error
__17:
;
@@ -93800,7 +95111,7 @@ __18:
// indices to be created and the table record must come before the
// indices. Hence, the record number for the table must be allocated
// now.
- if !(!(int32((*Sqlite3)(unsafe.Pointer(db)).Finit.Fbusy) != 0) && ((libc.AssignUintptr(&v, Xsqlite3GetVdbe(tls, pParse))) != uintptr(0))) {
+ if !(!(int32((*Sqlite3)(unsafe.Pointer(db)).Finit.Fbusy) != 0) && libc.AssignUintptr(&v, Xsqlite3GetVdbe(tls, pParse)) != uintptr(0)) {
goto __19
}
Xsqlite3BeginWriteOperation(tls, pParse, 1, iDb)
@@ -93814,13 +95125,13 @@ __20:
// If the file format and encoding in the database have not been set,
// set them now.
- reg1 = libc.AssignPtrInt32(pParse+88 /* &.regRowid */, libc.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1))
- reg2 = libc.AssignPtrInt32(pParse+92 /* &.regRoot */, libc.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1))
+ reg1 = libc.AssignPtrInt32(pParse+88, libc.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1))
+ reg2 = libc.AssignPtrInt32(pParse+92, libc.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1))
reg3 = libc.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1)
Xsqlite3VdbeAddOp3(tls, v, OP_ReadCookie, iDb, reg3, BTREE_FILE_FORMAT)
Xsqlite3VdbeUsesBtree(tls, v, iDb)
addr1 = Xsqlite3VdbeAddOp1(tls, v, OP_If, reg3)
- if ((*Sqlite3)(unsafe.Pointer(db)).Fflags & uint64(SQLITE_LegacyFileFmt)) != uint64(0) {
+ if (*Sqlite3)(unsafe.Pointer(db)).Fflags&uint64(SQLITE_LegacyFileFmt) != uint64(0) {
fileFormat = 1
} else {
fileFormat = SQLITE_MAX_FILE_FORMAT
@@ -93837,14 +95148,14 @@ __20:
// The root page number of the new table is left in reg pParse->regRoot.
// The rowid and root page number values are needed by the code that
// sqlite3EndTable will generate.
- if !((isView != 0) || (isVirtual != 0)) {
+ if !(isView != 0 || isVirtual != 0) {
goto __21
}
Xsqlite3VdbeAddOp2(tls, v, OP_Integer, 0, reg2)
goto __22
__21:
;
- *(*int32)(unsafe.Pointer(pParse + 128 /* &.u1 */)) = Xsqlite3VdbeAddOp3(tls, v, OP_CreateBtree, iDb, reg2, BTREE_INTKEY)
+ *(*int32)(unsafe.Pointer(pParse + 124)) = Xsqlite3VdbeAddOp3(tls, v, OP_CreateBtree, iDb, reg2, BTREE_INTKEY)
__22:
;
Xsqlite3OpenSchemaTable(tls, pParse, iDb)
@@ -93861,6 +95172,7 @@ __19:
// If an error occurs, we jump here
begin_table_error:
+ (*Parse)(unsafe.Pointer(pParse)).FcheckSchema = U8(1)
Xsqlite3DbFree(tls, db, zName)
return
}
@@ -93870,8 +95182,8 @@ var aCode = [4]U8{
U8(SQLITE_CREATE_TEMP_TABLE),
U8(SQLITE_CREATE_VIEW),
U8(SQLITE_CREATE_TEMP_VIEW),
-} /* sqlite3.c:113554:21 */
-var nullRow = [6]uint8{uint8(6), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0)} /* sqlite3.c:113632:23 */
+} /* sqlite3.c:114283:21 */
+var nullRow = [6]uint8{uint8(6), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0)} /* sqlite3.c:114361:23 */
// Set properties of a table column based on the (magical)
// name of the column.
@@ -93881,10 +95193,10 @@ var nullRow = [6]uint8{uint8(6), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0
// with any application-generated triggers.
// Clean up the data structures associated with the RETURNING clause.
-func sqlite3DeleteReturning(tls *libc.TLS, db uintptr, pRet uintptr) { /* sqlite3.c:113716:13: */
+func sqlite3DeleteReturning(tls *libc.TLS, db uintptr, pRet uintptr) { /* sqlite3.c:114446:13: */
var pHash uintptr
- pHash = ((*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+1*16)).FpSchema + 40 /* &.trigHash */)
- Xsqlite3HashInsert(tls, pHash, ts+11105 /* "sqlite_returning" */, uintptr(0))
+ pHash = (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+1*16)).FpSchema + 40
+ Xsqlite3HashInsert(tls, pHash, ts+12219 /* "sqlite_returning" */, uintptr(0))
Xsqlite3ExprListDelete(tls, db, (*Returning)(unsafe.Pointer(pRet)).FpReturnEL)
Xsqlite3DbFree(tls, db, pRet)
}
@@ -93903,12 +95215,12 @@ func sqlite3DeleteReturning(tls *libc.TLS, db uintptr, pRet uintptr) { /* sqlite
// is attached to a DELETE, INSERT, or UPDATE, so construct it as a
// RETURNING trigger instead. It will then be converted into the appropriate
// type on the first call to sqlite3TriggersExist().
-func Xsqlite3AddReturning(tls *libc.TLS, pParse uintptr, pList uintptr) { /* sqlite3.c:113740:21: */
+func Xsqlite3AddReturning(tls *libc.TLS, pParse uintptr, pList uintptr) { /* sqlite3.c:114470:21: */
var pRet uintptr
var pHash uintptr
var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb
if (*Parse)(unsafe.Pointer(pParse)).FpNewTrigger != 0 {
- Xsqlite3ErrorMsg(tls, pParse, ts+11122 /* "cannot use RETUR..." */, 0)
+ Xsqlite3ErrorMsg(tls, pParse, ts+12236 /* "cannot use RETUR..." */, 0)
} else {
}
@@ -93918,7 +95230,7 @@ func Xsqlite3AddReturning(tls *libc.TLS, pParse uintptr, pList uintptr) { /* sql
Xsqlite3ExprListDelete(tls, db, pList)
return
}
- *(*uintptr)(unsafe.Pointer(pParse + 128 /* &.u1 */)) = pRet
+ *(*uintptr)(unsafe.Pointer(pParse + 124)) = pRet
(*Returning)(unsafe.Pointer(pRet)).FpParse = pParse
(*Returning)(unsafe.Pointer(pRet)).FpReturnEL = pList
Xsqlite3ParserAddCleanup(tls, pParse,
@@ -93929,20 +95241,20 @@ func Xsqlite3AddReturning(tls *libc.TLS, pParse uintptr, pList uintptr) { /* sql
if (*Sqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 {
return
}
- (*Returning)(unsafe.Pointer(pRet)).FretTrig.FzName = ts + 11105 /* "sqlite_returning" */
+ (*Returning)(unsafe.Pointer(pRet)).FretTrig.FzName = ts + 12219 /* "sqlite_returning" */
(*Returning)(unsafe.Pointer(pRet)).FretTrig.Fop = U8(TK_RETURNING)
(*Returning)(unsafe.Pointer(pRet)).FretTrig.Ftr_tm = U8(TRIGGER_AFTER)
(*Returning)(unsafe.Pointer(pRet)).FretTrig.FbReturning = U8(1)
(*Returning)(unsafe.Pointer(pRet)).FretTrig.FpSchema = (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb + 1*16)).FpSchema
(*Returning)(unsafe.Pointer(pRet)).FretTrig.FpTabSchema = (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb + 1*16)).FpSchema
- (*Returning)(unsafe.Pointer(pRet)).FretTrig.Fstep_list = (pRet + 44 /* &.retTStep */)
+ (*Returning)(unsafe.Pointer(pRet)).FretTrig.Fstep_list = pRet + 44
(*Returning)(unsafe.Pointer(pRet)).FretTStep.Fop = U8(TK_RETURNING)
- (*Returning)(unsafe.Pointer(pRet)).FretTStep.FpTrig = (pRet + 8 /* &.retTrig */)
+ (*Returning)(unsafe.Pointer(pRet)).FretTStep.FpTrig = pRet + 8
(*Returning)(unsafe.Pointer(pRet)).FretTStep.FpExprList = pList
- pHash = ((*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+1*16)).FpSchema + 40 /* &.trigHash */)
+ pHash = (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+1*16)).FpSchema + 40
- if Xsqlite3HashInsert(tls, pHash, ts+11105 /* "sqlite_returning" */, (pRet+8 /* &.retTrig */)) ==
- (pRet + 8 /* &.retTrig */) {
+ if Xsqlite3HashInsert(tls, pHash, ts+12219, pRet+8) ==
+ pRet+8 {
Xsqlite3OomFault(tls, db)
}
}
@@ -93953,9 +95265,11 @@ func Xsqlite3AddReturning(tls *libc.TLS, pParse uintptr, pList uintptr) { /* sql
// in a CREATE TABLE statement. sqlite3StartTable() gets called
// first to get things going. Then this routine is called for each
// column.
-func Xsqlite3AddColumn(tls *libc.TLS, pParse uintptr, pName uintptr, pType uintptr) { /* sqlite3.c:113788:21: */
- bp := tls.Alloc(16)
- defer tls.Free(16)
+func Xsqlite3AddColumn(tls *libc.TLS, pParse uintptr, sName Token, sType Token) { /* sqlite3.c:114518:21: */
+ bp := tls.Alloc(32)
+ defer tls.Free(32)
+ *(*Token)(unsafe.Pointer(bp + 16)) = sName
+ *(*Token)(unsafe.Pointer(bp + 24)) = sType
var p uintptr
var i int32
@@ -93964,58 +95278,102 @@ func Xsqlite3AddColumn(tls *libc.TLS, pParse uintptr, pName uintptr, pType uintp
var pCol uintptr
var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb
var hName U8
+ var aNew uintptr
+ var eType U8 = U8(COLTYPE_CUSTOM)
+ var szEst U8 = U8(1)
+ var affinity uint8 = uint8(SQLITE_AFF_BLOB)
- if (libc.AssignUintptr(&p, (*Parse)(unsafe.Pointer(pParse)).FpNewTable)) == uintptr(0) {
+ if libc.AssignUintptr(&p, (*Parse)(unsafe.Pointer(pParse)).FpNewTable) == uintptr(0) {
return
}
- if (int32((*Table)(unsafe.Pointer(p)).FnCol) + 1) > *(*int32)(unsafe.Pointer((db + 112 /* &.aLimit */) + 2*4)) {
- Xsqlite3ErrorMsg(tls, pParse, ts+11156 /* "too many columns..." */, libc.VaList(bp, (*Table)(unsafe.Pointer(p)).FzName))
+ if int32((*Table)(unsafe.Pointer(p)).FnCol)+1 > *(*int32)(unsafe.Pointer(db + 120 + 2*4)) {
+ Xsqlite3ErrorMsg(tls, pParse, ts+12270 /* "too many columns..." */, libc.VaList(bp, (*Table)(unsafe.Pointer(p)).FzName))
return
}
- z = Xsqlite3DbMallocRaw(tls, db, (uint64(((*Token)(unsafe.Pointer(pName)).Fn + (*Token)(unsafe.Pointer(pType)).Fn) + uint32(2))))
+ if !(int32((*Parse)(unsafe.Pointer(pParse)).FeParseMode) >= PARSE_MODE_RENAME) {
+ Xsqlite3DequoteToken(tls, bp+16 /* &sName */)
+ }
+
+ // Because keywords GENERATE ALWAYS can be converted into indentifiers
+ // 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 (*Token)(unsafe.Pointer(bp+24)).Fn >= uint32(16) &&
+ Xsqlite3_strnicmp(tls, (*Token)(unsafe.Pointer(bp+24)).Fz+uintptr((*Token)(unsafe.Pointer(bp+24)).Fn-uint32(6)), ts+12293, 6) == 0 {
+ *(*uint32)(unsafe.Pointer(bp + 24 + 4)) -= uint32(6)
+ for (*Token)(unsafe.Pointer(bp+24)).Fn > uint32(0) && int32(Xsqlite3CtypeMap[uint8(*(*uint8)(unsafe.Pointer((*Token)(unsafe.Pointer(bp+24)).Fz + uintptr((*Token)(unsafe.Pointer(bp+24)).Fn-uint32(1)))))])&0x01 != 0 {
+ (*Token)(unsafe.Pointer(bp+24 /* &sType */)).Fn--
+ }
+ if (*Token)(unsafe.Pointer(bp+24)).Fn >= uint32(9) &&
+ Xsqlite3_strnicmp(tls, (*Token)(unsafe.Pointer(bp+24)).Fz+uintptr((*Token)(unsafe.Pointer(bp+24)).Fn-uint32(9)), ts+12300, 9) == 0 {
+ *(*uint32)(unsafe.Pointer(bp + 24 + 4)) -= uint32(9)
+ for (*Token)(unsafe.Pointer(bp+24)).Fn > uint32(0) && int32(Xsqlite3CtypeMap[uint8(*(*uint8)(unsafe.Pointer((*Token)(unsafe.Pointer(bp+24)).Fz + uintptr((*Token)(unsafe.Pointer(bp+24)).Fn-uint32(1)))))])&0x01 != 0 {
+ (*Token)(unsafe.Pointer(bp+24 /* &sType */)).Fn--
+ }
+ }
+ }
+
+ // Check for standard typenames. For standard typenames we will
+ // set the Column.eType field rather than storing the typename after
+ // the column name, in order to save space.
+ if (*Token)(unsafe.Pointer(bp+24)).Fn >= uint32(3) {
+ Xsqlite3DequoteToken(tls, bp+24 /* &sType */)
+ for i = 0; i < SQLITE_N_STDTYPE; i++ {
+ if (*Token)(unsafe.Pointer(bp+24)).Fn == uint32(Xsqlite3StdTypeLen[i]) &&
+ Xsqlite3_strnicmp(tls, (*Token)(unsafe.Pointer(bp+24)).Fz, Xsqlite3StdType[i], int32((*Token)(unsafe.Pointer(bp+24)).Fn)) == 0 {
+ (*Token)(unsafe.Pointer(bp + 24 /* &sType */)).Fn = uint32(0)
+ eType = U8(i + 1)
+ affinity = Xsqlite3StdTypeAffinity[i]
+ if int32(affinity) <= SQLITE_AFF_TEXT {
+ szEst = U8(5)
+ }
+ break
+ }
+ }
+ }
+
+ z = Xsqlite3DbMallocRaw(tls, db, uint64(I64((*Token)(unsafe.Pointer(bp+16)).Fn)+int64(1)+I64((*Token)(unsafe.Pointer(bp+24)).Fn)+I64(libc.Bool32((*Token)(unsafe.Pointer(bp+24)).Fn > uint32(0)))))
if z == uintptr(0) {
return
}
if int32((*Parse)(unsafe.Pointer(pParse)).FeParseMode) >= PARSE_MODE_RENAME {
- Xsqlite3RenameTokenMap(tls, pParse, z, pName)
+ Xsqlite3RenameTokenMap(tls, pParse, z, bp+16 /* &sName */)
}
- libc.Xmemcpy(tls, z, (*Token)(unsafe.Pointer(pName)).Fz, (*Token)(unsafe.Pointer(pName)).Fn)
- *(*uint8)(unsafe.Pointer(z + uintptr((*Token)(unsafe.Pointer(pName)).Fn))) = uint8(0)
+ libc.Xmemcpy(tls, z, (*Token)(unsafe.Pointer(bp+16 /* &sName */)).Fz, (*Token)(unsafe.Pointer(bp+16 /* &sName */)).Fn)
+ *(*uint8)(unsafe.Pointer(z + uintptr((*Token)(unsafe.Pointer(bp+16 /* &sName */)).Fn))) = uint8(0)
Xsqlite3Dequote(tls, z)
hName = Xsqlite3StrIHash(tls, z)
for i = 0; i < int32((*Table)(unsafe.Pointer(p)).FnCol); i++ {
- if (int32((*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(p)).FaCol+uintptr(i)*20)).FhName) == int32(hName)) && (Xsqlite3StrICmp(tls, z, (*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(p)).FaCol+uintptr(i)*20)).FzName) == 0) {
- Xsqlite3ErrorMsg(tls, pParse, ts+11179 /* "duplicate column..." */, libc.VaList(bp+8, z))
+ if int32((*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(p)).FaCol+uintptr(i)*16)).FhName) == int32(hName) && Xsqlite3StrICmp(tls, z, (*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(p)).FaCol+uintptr(i)*16)).FzCnName) == 0 {
+ Xsqlite3ErrorMsg(tls, pParse, ts+12310 /* "duplicate column..." */, libc.VaList(bp+8, z))
Xsqlite3DbFree(tls, db, z)
return
}
}
- if (int32((*Table)(unsafe.Pointer(p)).FnCol) & 0x7) == 0 {
- var aNew uintptr
- aNew = Xsqlite3DbRealloc(tls, db, (*Table)(unsafe.Pointer(p)).FaCol, (uint64((uint32(int32((*Table)(unsafe.Pointer(p)).FnCol) + 8)) * uint32(unsafe.Sizeof(Column{})))))
- if aNew == uintptr(0) {
- Xsqlite3DbFree(tls, db, z)
- return
- }
- (*Table)(unsafe.Pointer(p)).FaCol = aNew
+ aNew = Xsqlite3DbRealloc(tls, db, (*Table)(unsafe.Pointer(p)).FaCol, uint64((I64((*Table)(unsafe.Pointer(p)).FnCol)+int64(1))*I64(unsafe.Sizeof(Column{}))))
+ if aNew == uintptr(0) {
+ Xsqlite3DbFree(tls, db, z)
+ return
}
- pCol = ((*Table)(unsafe.Pointer(p)).FaCol + uintptr((*Table)(unsafe.Pointer(p)).FnCol)*20)
+ (*Table)(unsafe.Pointer(p)).FaCol = aNew
+ pCol = (*Table)(unsafe.Pointer(p)).FaCol + uintptr((*Table)(unsafe.Pointer(p)).FnCol)*16
libc.Xmemset(tls, pCol, 0, uint32(unsafe.Sizeof(Column{})))
- (*Column)(unsafe.Pointer(pCol)).FzName = z
+ (*Column)(unsafe.Pointer(pCol)).FzCnName = z
(*Column)(unsafe.Pointer(pCol)).FhName = hName
- if (*Token)(unsafe.Pointer(pType)).Fn == uint32(0) {
+ if (*Token)(unsafe.Pointer(bp+24)).Fn == uint32(0) {
// If there is no type specified, columns have the default affinity
// 'BLOB' with a default size of 4 bytes.
- (*Column)(unsafe.Pointer(pCol)).Faffinity = uint8(SQLITE_AFF_BLOB)
- (*Column)(unsafe.Pointer(pCol)).FszEst = U8(1)
+ (*Column)(unsafe.Pointer(pCol)).Faffinity = affinity
+ libc.SetBitFieldPtr8Uint32(pCol+4, uint32(eType), 4, 0xf0)
+ (*Column)(unsafe.Pointer(pCol)).FszEst = szEst
} else {
- zType = ((z + uintptr(Xsqlite3Strlen30(tls, z))) + uintptr(1))
- libc.Xmemcpy(tls, zType, (*Token)(unsafe.Pointer(pType)).Fz, (*Token)(unsafe.Pointer(pType)).Fn)
- *(*uint8)(unsafe.Pointer(zType + uintptr((*Token)(unsafe.Pointer(pType)).Fn))) = uint8(0)
+ zType = z + uintptr(Xsqlite3Strlen30(tls, z)) + uintptr(1)
+ libc.Xmemcpy(tls, zType, (*Token)(unsafe.Pointer(bp+24 /* &sType */)).Fz, (*Token)(unsafe.Pointer(bp+24 /* &sType */)).Fn)
+ *(*uint8)(unsafe.Pointer(zType + uintptr((*Token)(unsafe.Pointer(bp+24 /* &sType */)).Fn))) = uint8(0)
Xsqlite3Dequote(tls, zType)
(*Column)(unsafe.Pointer(pCol)).Faffinity = Xsqlite3AffinityType(tls, zType, pCol)
- *(*U16)(unsafe.Pointer(pCol + 16 /* &.colFlags */)) |= U16((COLFLAG_HASTYPE))
+ *(*U16)(unsafe.Pointer(pCol + 12)) |= U16(COLFLAG_HASTYPE)
}
(*Table)(unsafe.Pointer(p)).FnCol++
(*Table)(unsafe.Pointer(p)).FnNVCol++
@@ -94026,25 +95384,25 @@ func Xsqlite3AddColumn(tls *libc.TLS, pParse uintptr, pName uintptr, pType uintp
// parsing a CREATE TABLE statement. A "NOT NULL" constraint has
// been seen on a column. This routine sets the notNull flag on
// the column currently under construction.
-func Xsqlite3AddNotNull(tls *libc.TLS, pParse uintptr, onError int32) { /* sqlite3.c:113860:21: */
+func Xsqlite3AddNotNull(tls *libc.TLS, pParse uintptr, onError int32) { /* sqlite3.c:114631:21: */
var p uintptr
var pCol uintptr
p = (*Parse)(unsafe.Pointer(pParse)).FpNewTable
- if (p == uintptr(0)) || (int32((*Table)(unsafe.Pointer(p)).FnCol) < 1) {
+ if p == uintptr(0) || int32((*Table)(unsafe.Pointer(p)).FnCol) < 1 {
return
}
- pCol = ((*Table)(unsafe.Pointer(p)).FaCol + uintptr((int32((*Table)(unsafe.Pointer(p)).FnCol)-1))*20)
- (*Column)(unsafe.Pointer(pCol)).FnotNull = U8(onError)
- *(*U32)(unsafe.Pointer(p + 36 /* &.tabFlags */)) |= (U32(TF_HasNotNull))
+ pCol = (*Table)(unsafe.Pointer(p)).FaCol + uintptr(int32((*Table)(unsafe.Pointer(p)).FnCol)-1)*16
+ libc.SetBitFieldPtr8Uint32(pCol+4, uint32(U8(onError)), 0, 0xf)
+ *(*U32)(unsafe.Pointer(p + 28)) |= U32(TF_HasNotNull)
// Set the uniqNotNull flag on any UNIQUE or PK indexes already created
// on this column.
- if (int32((*Column)(unsafe.Pointer(pCol)).FcolFlags) & COLFLAG_UNIQUE) != 0 {
+ if int32((*Column)(unsafe.Pointer(pCol)).FcolFlags)&COLFLAG_UNIQUE != 0 {
var pIdx uintptr
for pIdx = (*Table)(unsafe.Pointer(p)).FpIndex; pIdx != 0; pIdx = (*Index)(unsafe.Pointer(pIdx)).FpNext {
- if int32(*(*I16)(unsafe.Pointer((*Index)(unsafe.Pointer(pIdx)).FaiColumn))) == (int32((*Table)(unsafe.Pointer(p)).FnCol) - 1) {
- libc.SetBitFieldPtr16Uint32(pIdx+56 /* &.uniqNotNull */, uint32(1), 3, 0x8)
+ if int32(*(*I16)(unsafe.Pointer((*Index)(unsafe.Pointer(pIdx)).FaiColumn))) == int32((*Table)(unsafe.Pointer(p)).FnCol)-1 {
+ libc.SetBitFieldPtr16Uint32(pIdx+56, uint32(1), 3, 0x8)
}
}
}
@@ -94073,7 +95431,7 @@ func Xsqlite3AddNotNull(tls *libc.TLS, pParse uintptr, onError int32) { /* sqlit
//
// If none of the substrings in the above table are found,
// SQLITE_AFF_NUMERIC is returned.
-func Xsqlite3AffinityType(tls *libc.TLS, zIn uintptr, pCol uintptr) uint8 { /* sqlite3.c:113907:21: */
+func Xsqlite3AffinityType(tls *libc.TLS, zIn uintptr, pCol uintptr) uint8 { /* sqlite3.c:114678:21: */
bp := tls.Alloc(4)
defer tls.Free(4)
@@ -94082,31 +95440,31 @@ func Xsqlite3AffinityType(tls *libc.TLS, zIn uintptr, pCol uintptr) uint8 { /* s
var zChar uintptr = uintptr(0)
for *(*uint8)(unsafe.Pointer(zIn)) != 0 {
- h = ((h << 8) + U32(Xsqlite3UpperToLower[((int32(*(*uint8)(unsafe.Pointer(zIn))))&0xff)]))
+ h = h<<8 + U32(Xsqlite3UpperToLower[int32(*(*uint8)(unsafe.Pointer(zIn)))&0xff])
zIn++
- if h == (U32((((int32('c') << 24) + (int32('h') << 16)) + (int32('a') << 8)) + 'r')) { // CHAR
+ if h == U32(int32('c')<<24+int32('h')<<16+int32('a')<<8+'r') { // CHAR
aff = uint8(SQLITE_AFF_TEXT)
zChar = zIn
- } else if h == (U32((((int32('c') << 24) + (int32('l') << 16)) + (int32('o') << 8)) + 'b')) { // CLOB
+ } else if h == U32(int32('c')<<24+int32('l')<<16+int32('o')<<8+'b') { // CLOB
aff = uint8(SQLITE_AFF_TEXT)
- } else if h == (U32((((int32('t') << 24) + (int32('e') << 16)) + (int32('x') << 8)) + 't')) { // TEXT
+ } else if h == U32(int32('t')<<24+int32('e')<<16+int32('x')<<8+'t') { // TEXT
aff = uint8(SQLITE_AFF_TEXT)
- } else if (h == (U32((((int32('b') << 24) + (int32('l') << 16)) + (int32('o') << 8)) + 'b'))) && // BLOB
- ((int32(aff) == SQLITE_AFF_NUMERIC) || (int32(aff) == SQLITE_AFF_REAL)) {
+ } else if h == U32(int32('b')<<24+int32('l')<<16+int32('o')<<8+'b') &&
+ (int32(aff) == SQLITE_AFF_NUMERIC || int32(aff) == SQLITE_AFF_REAL) {
aff = uint8(SQLITE_AFF_BLOB)
if int32(*(*uint8)(unsafe.Pointer(zIn))) == '(' {
zChar = zIn
}
- } else if (h == (U32((((int32('r') << 24) + (int32('e') << 16)) + (int32('a') << 8)) + 'l'))) && // REAL
- (int32(aff) == SQLITE_AFF_NUMERIC) {
+ } else if h == U32(int32('r')<<24+int32('e')<<16+int32('a')<<8+'l') &&
+ int32(aff) == SQLITE_AFF_NUMERIC {
aff = uint8(SQLITE_AFF_REAL)
- } else if (h == (U32((((int32('f') << 24) + (int32('l') << 16)) + (int32('o') << 8)) + 'a'))) && // FLOA
- (int32(aff) == SQLITE_AFF_NUMERIC) {
+ } else if h == U32(int32('f')<<24+int32('l')<<16+int32('o')<<8+'a') &&
+ int32(aff) == SQLITE_AFF_NUMERIC {
aff = uint8(SQLITE_AFF_REAL)
- } else if (h == (U32((((int32('d') << 24) + (int32('o') << 16)) + (int32('u') << 8)) + 'b'))) && // DOUB
- (int32(aff) == SQLITE_AFF_NUMERIC) {
+ } else if h == U32(int32('d')<<24+int32('o')<<16+int32('u')<<8+'b') &&
+ int32(aff) == SQLITE_AFF_NUMERIC {
aff = uint8(SQLITE_AFF_REAL)
- } else if (h & U32(0x00FFFFFF)) == (U32(((int32('i') << 16) + (int32('n') << 8)) + 't')) { // INT
+ } else if h&U32(0x00FFFFFF) == U32(int32('i')<<16+int32('n')<<8+'t') { // INT
aff = uint8(SQLITE_AFF_INTEGER)
break
}
@@ -94119,7 +95477,7 @@ func Xsqlite3AffinityType(tls *libc.TLS, zIn uintptr, pCol uintptr) uint8 { /* s
if int32(aff) < SQLITE_AFF_NUMERIC {
if zChar != 0 {
for *(*uint8)(unsafe.Pointer(zChar)) != 0 {
- if (int32(Xsqlite3CtypeMap[uint8(*(*uint8)(unsafe.Pointer(zChar)))]) & 0x04) != 0 {
+ if int32(Xsqlite3CtypeMap[uint8(*(*uint8)(unsafe.Pointer(zChar)))])&0x04 != 0 {
// BLOB(k), VARCHAR(k), CHAR(k) -> r=(k/4+1)
Xsqlite3GetInt32(tls, zChar, bp /* &v */)
break
@@ -94130,8 +95488,8 @@ func Xsqlite3AffinityType(tls *libc.TLS, zIn uintptr, pCol uintptr) uint8 { /* s
*(*int32)(unsafe.Pointer(bp /* v */)) = 16 // BLOB, TEXT, CLOB -> r=5 (approx 20 bytes)
}
}
- *(*int32)(unsafe.Pointer(bp /* v */)) = ((*(*int32)(unsafe.Pointer(bp /* v */)) / 4) + 1)
- if *(*int32)(unsafe.Pointer(bp /* v */)) > 255 {
+ *(*int32)(unsafe.Pointer(bp /* v */)) = *(*int32)(unsafe.Pointer(bp))/4 + 1
+ if *(*int32)(unsafe.Pointer(bp)) > 255 {
*(*int32)(unsafe.Pointer(bp /* v */)) = 255
}
(*Column)(unsafe.Pointer(pCol)).FszEst = U8(*(*int32)(unsafe.Pointer(bp /* v */)))
@@ -94147,7 +95505,7 @@ func Xsqlite3AffinityType(tls *libc.TLS, zIn uintptr, pCol uintptr) uint8 { /* s
//
// This routine is called by the parser while in the middle of
// parsing a CREATE TABLE statement.
-func Xsqlite3AddDefaultValue(tls *libc.TLS, pParse uintptr, pExpr uintptr, zStart uintptr, zEnd uintptr) { /* sqlite3.c:113984:21: */
+func Xsqlite3AddDefaultValue(tls *libc.TLS, pParse uintptr, pExpr uintptr, zStart uintptr, zEnd uintptr) { /* sqlite3.c:114755:21: */
bp := tls.Alloc(60)
defer tls.Free(60)
@@ -94156,27 +95514,28 @@ func Xsqlite3AddDefaultValue(tls *libc.TLS, pParse uintptr, pExpr uintptr, zStar
var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb
p = (*Parse)(unsafe.Pointer(pParse)).FpNewTable
if p != uintptr(0) {
- var isInit int32 = (libc.Bool32(((*Sqlite3)(unsafe.Pointer(db)).Finit.Fbusy != 0) && (int32((*Sqlite3)(unsafe.Pointer(db)).Finit.FiDb) != 1)))
- pCol = ((*Table)(unsafe.Pointer(p)).FaCol + uintptr((int32((*Table)(unsafe.Pointer(p)).FnCol)-1))*20)
+ var isInit int32 = libc.Bool32((*Sqlite3)(unsafe.Pointer(db)).Finit.Fbusy != 0 && int32((*Sqlite3)(unsafe.Pointer(db)).Finit.FiDb) != 1)
+ pCol = (*Table)(unsafe.Pointer(p)).FaCol + uintptr(int32((*Table)(unsafe.Pointer(p)).FnCol)-1)*16
if !(Xsqlite3ExprIsConstantOrFunction(tls, pExpr, uint8(isInit)) != 0) {
- Xsqlite3ErrorMsg(tls, pParse, ts+11205, /* "default value of..." */
- libc.VaList(bp, (*Column)(unsafe.Pointer(pCol)).FzName))
- } else if (int32((*Column)(unsafe.Pointer(pCol)).FcolFlags) & COLFLAG_GENERATED) != 0 {
+ Xsqlite3ErrorMsg(tls, pParse, ts+12336, /* "default value of..." */
+ libc.VaList(bp, (*Column)(unsafe.Pointer(pCol)).FzCnName))
+ } else if int32((*Column)(unsafe.Pointer(pCol)).FcolFlags)&COLFLAG_GENERATED != 0 {
- Xsqlite3ErrorMsg(tls, pParse, ts+11250 /* "cannot use DEFAU..." */, 0)
+ Xsqlite3ErrorMsg(tls, pParse, ts+12381 /* "cannot use DEFAU..." */, 0)
} else {
// A copy of pExpr is used instead of the original, as pExpr contains
// tokens that point to volatile memory.
// var x Expr at bp+8, 52
- Xsqlite3ExprDelete(tls, db, (*Column)(unsafe.Pointer(pCol)).FpDflt)
+ var pDfltExpr uintptr
libc.Xmemset(tls, bp+8 /* &x */, 0, uint32(unsafe.Sizeof(Expr{})))
(*Expr)(unsafe.Pointer(bp + 8 /* &x */)).Fop = U8(TK_SPAN)
- *(*uintptr)(unsafe.Pointer(bp + 8 /* &x */ + 8 /* &.u */)) = Xsqlite3DbSpanDup(tls, db, zStart, zEnd)
+ *(*uintptr)(unsafe.Pointer(bp + 8 + 8)) = Xsqlite3DbSpanDup(tls, db, zStart, zEnd)
(*Expr)(unsafe.Pointer(bp + 8 /* &x */)).FpLeft = pExpr
(*Expr)(unsafe.Pointer(bp + 8 /* &x */)).Fflags = U32(EP_Skip)
- (*Column)(unsafe.Pointer(pCol)).FpDflt = Xsqlite3ExprDup(tls, db, bp+8 /* &x */, EXPRDUP_REDUCE)
- Xsqlite3DbFree(tls, db, *(*uintptr)(unsafe.Pointer(bp + 8 /* &x */ + 8 /* &.u */)))
+ pDfltExpr = Xsqlite3ExprDup(tls, db, bp+8 /* &x */, EXPRDUP_REDUCE)
+ Xsqlite3DbFree(tls, db, *(*uintptr)(unsafe.Pointer(bp + 8 + 8)))
+ Xsqlite3ColumnSetExpr(tls, pParse, p, pCol, pDfltExpr)
}
}
if int32((*Parse)(unsafe.Pointer(pParse)).FeParseMode) >= PARSE_MODE_RENAME {
@@ -94199,21 +95558,21 @@ func Xsqlite3AddDefaultValue(tls *libc.TLS, pParse uintptr, pExpr uintptr, zStar
// if the expression is just a TK_STRING with an optional COLLATE clause.
// If the expression is anything other than TK_STRING, the expression is
// unchanged.
-func sqlite3StringToId(tls *libc.TLS, p uintptr) { /* sqlite3.c:114043:13: */
+func sqlite3StringToId(tls *libc.TLS, p uintptr) { /* sqlite3.c:114814:13: */
if int32((*Expr)(unsafe.Pointer(p)).Fop) == TK_STRING {
(*Expr)(unsafe.Pointer(p)).Fop = U8(TK_ID)
- } else if (int32((*Expr)(unsafe.Pointer(p)).Fop) == TK_COLLATE) && (int32((*Expr)(unsafe.Pointer((*Expr)(unsafe.Pointer(p)).FpLeft)).Fop) == TK_STRING) {
+ } else if int32((*Expr)(unsafe.Pointer(p)).Fop) == TK_COLLATE && int32((*Expr)(unsafe.Pointer((*Expr)(unsafe.Pointer(p)).FpLeft)).Fop) == TK_STRING {
(*Expr)(unsafe.Pointer((*Expr)(unsafe.Pointer(p)).FpLeft)).Fop = U8(TK_ID)
}
}
// Tag the given column as being part of the PRIMARY KEY
-func makeColumnPartOfPrimaryKey(tls *libc.TLS, pParse uintptr, pCol uintptr) { /* sqlite3.c:114054:13: */
- *(*U16)(unsafe.Pointer(pCol + 16 /* &.colFlags */)) |= U16((COLFLAG_PRIMKEY))
- if (int32((*Column)(unsafe.Pointer(pCol)).FcolFlags) & COLFLAG_GENERATED) != 0 {
+func makeColumnPartOfPrimaryKey(tls *libc.TLS, pParse uintptr, pCol uintptr) { /* sqlite3.c:114825:13: */
+ *(*U16)(unsafe.Pointer(pCol + 12)) |= U16(COLFLAG_PRIMKEY)
+ if int32((*Column)(unsafe.Pointer(pCol)).FcolFlags)&COLFLAG_GENERATED != 0 {
Xsqlite3ErrorMsg(tls, pParse,
- ts+11291 /* "generated column..." */, 0)
+ ts+12422 /* "generated column..." */, 0)
}
}
@@ -94233,7 +95592,7 @@ func makeColumnPartOfPrimaryKey(tls *libc.TLS, pParse uintptr, pCol uintptr) { /
//
// If the key is not an INTEGER PRIMARY KEY, then create a unique
// index for the key. No index is created for INTEGER PRIMARY KEYs.
-func Xsqlite3AddPrimaryKey(tls *libc.TLS, pParse uintptr, pList uintptr, onError int32, autoInc int32, sortOrder int32) { /* sqlite3.c:114084:21: */
+func Xsqlite3AddPrimaryKey(tls *libc.TLS, pParse uintptr, pList uintptr, onError int32, autoInc int32, sortOrder int32) { /* sqlite3.c:114855:21: */
bp := tls.Alloc(8)
defer tls.Free(8)
@@ -94254,20 +95613,20 @@ func Xsqlite3AddPrimaryKey(tls *libc.TLS, pParse uintptr, pList uintptr, onError
goto primary_key_exit
__1:
;
- if !(((*Table)(unsafe.Pointer(pTab)).FtabFlags & U32(TF_HasPrimaryKey)) != 0) {
+ if !((*Table)(unsafe.Pointer(pTab)).FtabFlags&U32(TF_HasPrimaryKey) != 0) {
goto __2
}
Xsqlite3ErrorMsg(tls, pParse,
- ts+11343 /* "table \"%s\" has m..." */, libc.VaList(bp, (*Table)(unsafe.Pointer(pTab)).FzName))
+ ts+12474 /* "table \"%s\" has m..." */, libc.VaList(bp, (*Table)(unsafe.Pointer(pTab)).FzName))
goto primary_key_exit
__2:
;
- *(*U32)(unsafe.Pointer(pTab + 36 /* &.tabFlags */)) |= (U32(TF_HasPrimaryKey))
+ *(*U32)(unsafe.Pointer(pTab + 28)) |= U32(TF_HasPrimaryKey)
if !(pList == uintptr(0)) {
goto __3
}
- iCol = (int32((*Table)(unsafe.Pointer(pTab)).FnCol) - 1)
- pCol = ((*Table)(unsafe.Pointer(pTab)).FaCol + uintptr(iCol)*20)
+ iCol = int32((*Table)(unsafe.Pointer(pTab)).FnCol) - 1
+ pCol = (*Table)(unsafe.Pointer(pTab)).FaCol + uintptr(iCol)*16
makeColumnPartOfPrimaryKey(tls, pParse, pCol)
nTerm = 1
goto __4
@@ -94278,22 +95637,23 @@ __5:
if !(i < nTerm) {
goto __7
}
- pCExpr = Xsqlite3ExprSkipCollate(tls, (*ExprList_item)(unsafe.Pointer((pList+8 /* &.a */)+uintptr(i)*20)).FpExpr)
+ pCExpr = Xsqlite3ExprSkipCollate(tls, (*ExprList_item)(unsafe.Pointer(pList+8+uintptr(i)*20)).FpExpr)
sqlite3StringToId(tls, pCExpr)
if !(int32((*Expr)(unsafe.Pointer(pCExpr)).Fop) == TK_ID) {
goto __8
}
- zCName = *(*uintptr)(unsafe.Pointer(pCExpr + 8 /* &.u */))
+
+ zCName = *(*uintptr)(unsafe.Pointer(pCExpr + 8))
iCol = 0
__9:
if !(iCol < int32((*Table)(unsafe.Pointer(pTab)).FnCol)) {
goto __11
}
- if !(Xsqlite3StrICmp(tls, zCName, (*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FaCol+uintptr(iCol)*20)).FzName) == 0) {
+ if !(Xsqlite3StrICmp(tls, zCName, (*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FaCol+uintptr(iCol)*16)).FzCnName) == 0) {
goto __12
}
- pCol = ((*Table)(unsafe.Pointer(pTab)).FaCol + uintptr(iCol)*20)
+ pCol = (*Table)(unsafe.Pointer(pTab)).FaCol + uintptr(iCol)*16
makeColumnPartOfPrimaryKey(tls, pParse, pCol)
goto __11
__12:
@@ -94316,27 +95676,27 @@ __7:
;
__4:
;
- if !((((nTerm == 1) &&
- (pCol != 0)) &&
- (Xsqlite3StrICmp(tls, Xsqlite3ColumnType(tls, pCol, ts+755 /* "" */), ts+11384 /* "INTEGER" */) == 0)) &&
- (sortOrder != SQLITE_SO_DESC)) {
+ if !(nTerm == 1 &&
+ pCol != 0 &&
+ int32(*(*uint8)(unsafe.Pointer(pCol + 4))&0xf0>>4) == COLTYPE_INTEGER &&
+ sortOrder != SQLITE_SO_DESC) {
goto __13
}
- if !((int32((*Parse)(unsafe.Pointer(pParse)).FeParseMode) >= PARSE_MODE_RENAME) && (pList != 0)) {
+ if !(int32((*Parse)(unsafe.Pointer(pParse)).FeParseMode) >= PARSE_MODE_RENAME && pList != 0) {
goto __15
}
- pCExpr1 = Xsqlite3ExprSkipCollate(tls, (*ExprList_item)(unsafe.Pointer((pList + 8 /* &.a */))).FpExpr)
- Xsqlite3RenameTokenRemap(tls, pParse, (pTab + 40 /* &.iPKey */), pCExpr1)
+ pCExpr1 = Xsqlite3ExprSkipCollate(tls, (*ExprList_item)(unsafe.Pointer(pList+8)).FpExpr)
+ Xsqlite3RenameTokenRemap(tls, pParse, pTab+32, pCExpr1)
__15:
;
(*Table)(unsafe.Pointer(pTab)).FiPKey = I16(iCol)
(*Table)(unsafe.Pointer(pTab)).FkeyConf = U8(onError)
- *(*U32)(unsafe.Pointer(pTab + 36 /* &.tabFlags */)) |= (U32(autoInc * TF_Autoincrement))
+ *(*U32)(unsafe.Pointer(pTab + 28)) |= U32(autoInc * TF_Autoincrement)
if !(pList != 0) {
goto __16
}
- (*Parse)(unsafe.Pointer(pParse)).FiPkSortOrder = (*ExprList_item)(unsafe.Pointer((pList + 8 /* &.a */))).FsortFlags
+ (*Parse)(unsafe.Pointer(pParse)).FiPkSortOrder = (*ExprList_item)(unsafe.Pointer(pList + 8)).FsortFlags
__16:
;
Xsqlite3HasExplicitNulls(tls, pParse, pList)
@@ -94346,7 +95706,7 @@ __13:
goto __17
}
Xsqlite3ErrorMsg(tls, pParse,
- ts+11392 /* "AUTOINCREMENT is..." */, 0)
+ ts+12515 /* "AUTOINCREMENT is..." */, 0)
goto __18
__17:
Xsqlite3CreateIndex(tls, pParse, uintptr(0), uintptr(0), uintptr(0), pList, onError, uintptr(0),
@@ -94363,27 +95723,27 @@ primary_key_exit:
}
// Add a new CHECK constraint to the table currently under construction.
-func Xsqlite3AddCheckConstraint(tls *libc.TLS, pParse uintptr, pCheckExpr uintptr, zStart uintptr, zEnd uintptr) { /* sqlite3.c:114159:21: */
+func Xsqlite3AddCheckConstraint(tls *libc.TLS, pParse uintptr, pCheckExpr uintptr, zStart uintptr, zEnd uintptr) { /* sqlite3.c:114932:21: */
bp := tls.Alloc(8)
defer tls.Free(8)
var pTab uintptr = (*Parse)(unsafe.Pointer(pParse)).FpNewTable
var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb
- if ((pTab != 0) && !(int32((*Parse)(unsafe.Pointer(pParse)).FeParseMode) == PARSE_MODE_DECLARE_VTAB)) &&
+ if pTab != 0 && !(int32((*Parse)(unsafe.Pointer(pParse)).FeParseMode) == PARSE_MODE_DECLARE_VTAB) &&
!(Xsqlite3BtreeIsReadonly(tls, (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+uintptr((*Sqlite3)(unsafe.Pointer(db)).Finit.FiDb)*16)).FpBt) != 0) {
(*Table)(unsafe.Pointer(pTab)).FpCheck = Xsqlite3ExprListAppend(tls, pParse, (*Table)(unsafe.Pointer(pTab)).FpCheck, pCheckExpr)
if (*Parse)(unsafe.Pointer(pParse)).FconstraintName.Fn != 0 {
- Xsqlite3ExprListSetName(tls, pParse, (*Table)(unsafe.Pointer(pTab)).FpCheck, (pParse + 72 /* &.constraintName */), 1)
+ Xsqlite3ExprListSetName(tls, pParse, (*Table)(unsafe.Pointer(pTab)).FpCheck, pParse+72, 1)
} else {
// var t Token at bp, 8
- for zStart++; (int32(Xsqlite3CtypeMap[uint8(*(*uint8)(unsafe.Pointer(zStart)))]) & 0x01) != 0; zStart++ {
+ for zStart++; int32(Xsqlite3CtypeMap[uint8(*(*uint8)(unsafe.Pointer(zStart)))])&0x01 != 0; zStart++ {
}
- for (int32(Xsqlite3CtypeMap[uint8(*(*uint8)(unsafe.Pointer(zEnd + libc.UintptrFromInt32(-1))))]) & 0x01) != 0 {
+ for int32(Xsqlite3CtypeMap[uint8(*(*uint8)(unsafe.Pointer(zEnd + libc.UintptrFromInt32(-1))))])&0x01 != 0 {
zEnd--
}
(*Token)(unsafe.Pointer(bp /* &t */)).Fz = zStart
- (*Token)(unsafe.Pointer(bp /* &t */)).Fn = uint32(((int32(zEnd) - int32((*Token)(unsafe.Pointer(bp /* &t */)).Fz)) / 1))
+ (*Token)(unsafe.Pointer(bp /* &t */)).Fn = uint32((int32(zEnd) - int32((*Token)(unsafe.Pointer(bp)).Fz)) / 1)
Xsqlite3ExprListSetName(tls, pParse, (*Table)(unsafe.Pointer(pTab)).FpCheck, bp /* &t */, 1)
}
} else {
@@ -94393,16 +95753,16 @@ func Xsqlite3AddCheckConstraint(tls *libc.TLS, pParse uintptr, pCheckExpr uintpt
// Set the collation function of the most recently parsed table column
// to the CollSeq given.
-func Xsqlite3AddCollateType(tls *libc.TLS, pParse uintptr, pToken uintptr) { /* sqlite3.c:114193:21: */
+func Xsqlite3AddCollateType(tls *libc.TLS, pParse uintptr, pToken uintptr) { /* sqlite3.c:114966:21: */
var p uintptr
var i int32
var zColl uintptr // Dequoted name of collation sequence
var db uintptr
- if ((libc.AssignUintptr(&p, (*Parse)(unsafe.Pointer(pParse)).FpNewTable)) == uintptr(0)) || (int32((*Parse)(unsafe.Pointer(pParse)).FeParseMode) >= PARSE_MODE_RENAME) {
+ if libc.AssignUintptr(&p, (*Parse)(unsafe.Pointer(pParse)).FpNewTable) == uintptr(0) || int32((*Parse)(unsafe.Pointer(pParse)).FeParseMode) >= PARSE_MODE_RENAME {
return
}
- i = (int32((*Table)(unsafe.Pointer(p)).FnCol) - 1)
+ i = int32((*Table)(unsafe.Pointer(p)).FnCol) - 1
db = (*Parse)(unsafe.Pointer(pParse)).Fdb
zColl = Xsqlite3NameFromToken(tls, db, pToken)
if !(zColl != 0) {
@@ -94411,8 +95771,7 @@ func Xsqlite3AddCollateType(tls *libc.TLS, pParse uintptr, pToken uintptr) { /*
if Xsqlite3LocateCollSeq(tls, pParse, zColl) != 0 {
var pIdx uintptr
- Xsqlite3DbFree(tls, db, (*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(p)).FaCol+uintptr(i)*20)).FzColl)
- (*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(p)).FaCol + uintptr(i)*20)).FzColl = zColl
+ Xsqlite3ColumnSetColl(tls, db, (*Table)(unsafe.Pointer(p)).FaCol+uintptr(i)*16, zColl)
// If the column is declared as "<name> PRIMARY KEY COLLATE <type>",
// then an index may have been created on this column before the
@@ -94420,17 +95779,16 @@ func Xsqlite3AddCollateType(tls *libc.TLS, pParse uintptr, pToken uintptr) { /*
for pIdx = (*Table)(unsafe.Pointer(p)).FpIndex; pIdx != 0; pIdx = (*Index)(unsafe.Pointer(pIdx)).FpNext {
if int32(*(*I16)(unsafe.Pointer((*Index)(unsafe.Pointer(pIdx)).FaiColumn))) == i {
- *(*uintptr)(unsafe.Pointer((*Index)(unsafe.Pointer(pIdx)).FazColl)) = (*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(p)).FaCol + uintptr(i)*20)).FzColl
+ *(*uintptr)(unsafe.Pointer((*Index)(unsafe.Pointer(pIdx)).FazColl)) = Xsqlite3ColumnColl(tls, (*Table)(unsafe.Pointer(p)).FaCol+uintptr(i)*16)
}
}
- } else {
- Xsqlite3DbFree(tls, db, zColl)
}
+ Xsqlite3DbFree(tls, db, zColl)
}
// Change the most recently parsed column to be a GENERATED ALWAYS AS
// column.
-func Xsqlite3AddGenerated(tls *libc.TLS, pParse uintptr, pExpr uintptr, pType uintptr) { /* sqlite3.c:114228:21: */
+func Xsqlite3AddGenerated(tls *libc.TLS, pParse uintptr, pExpr uintptr, pType uintptr) { /* sqlite3.c:114999:21: */
bp := tls.Alloc(8)
defer tls.Free(8)
@@ -94446,15 +95804,15 @@ func Xsqlite3AddGenerated(tls *libc.TLS, pParse uintptr, pExpr uintptr, pType ui
goto generated_done
__1:
;
- pCol = ((*Table)(unsafe.Pointer(pTab)).FaCol + uintptr((int32((*Table)(unsafe.Pointer(pTab)).FnCol)-1))*20)
+ pCol = (*Table)(unsafe.Pointer(pTab)).FaCol + uintptr(int32((*Table)(unsafe.Pointer(pTab)).FnCol)-1)*16
if !(int32((*Parse)(unsafe.Pointer(pParse)).FeParseMode) == PARSE_MODE_DECLARE_VTAB) {
goto __2
}
- Xsqlite3ErrorMsg(tls, pParse, ts+11448 /* "virtual tables c..." */, 0)
+ Xsqlite3ErrorMsg(tls, pParse, ts+12571 /* "virtual tables c..." */, 0)
goto generated_done
__2:
;
- if !((*Column)(unsafe.Pointer(pCol)).FpDflt != 0) {
+ if !(int32((*Column)(unsafe.Pointer(pCol)).FiDflt) > 0) {
goto __3
}
goto generated_error
@@ -94463,13 +95821,13 @@ __3:
if !(pType != 0) {
goto __4
}
- if !(((*Token)(unsafe.Pointer(pType)).Fn == uint32(7)) && (Xsqlite3_strnicmp(tls, ts+11491 /* "virtual" */, (*Token)(unsafe.Pointer(pType)).Fz, 7) == 0)) {
+ if !((*Token)(unsafe.Pointer(pType)).Fn == uint32(7) && Xsqlite3_strnicmp(tls, ts+12614, (*Token)(unsafe.Pointer(pType)).Fz, 7) == 0) {
goto __5
}
// no-op
goto __6
__5:
- if !(((*Token)(unsafe.Pointer(pType)).Fn == uint32(6)) && (Xsqlite3_strnicmp(tls, ts+11499 /* "stored" */, (*Token)(unsafe.Pointer(pType)).Fz, 6) == 0)) {
+ if !((*Token)(unsafe.Pointer(pType)).Fn == uint32(6) && Xsqlite3_strnicmp(tls, ts+12622, (*Token)(unsafe.Pointer(pType)).Fz, 6) == 0) {
goto __7
}
eType = U8(COLFLAG_STORED)
@@ -94488,22 +95846,22 @@ __4:
(*Table)(unsafe.Pointer(pTab)).FnNVCol--
__9:
;
- *(*U16)(unsafe.Pointer(pCol + 16 /* &.colFlags */)) |= U16((int32(eType)))
+ *(*U16)(unsafe.Pointer(pCol + 12)) |= U16(int32(eType))
- *(*U32)(unsafe.Pointer(pTab + 36 /* &.tabFlags */)) |= (U32(eType))
- if !((int32((*Column)(unsafe.Pointer(pCol)).FcolFlags) & COLFLAG_PRIMKEY) != 0) {
+ *(*U32)(unsafe.Pointer(pTab + 28)) |= U32(eType)
+ if !(int32((*Column)(unsafe.Pointer(pCol)).FcolFlags)&COLFLAG_PRIMKEY != 0) {
goto __10
}
makeColumnPartOfPrimaryKey(tls, pParse, pCol) // For the error message
__10:
;
- (*Column)(unsafe.Pointer(pCol)).FpDflt = pExpr
+ Xsqlite3ColumnSetExpr(tls, pParse, pTab, pCol, pExpr)
pExpr = uintptr(0)
goto generated_done
generated_error:
- Xsqlite3ErrorMsg(tls, pParse, ts+11506, /* "error in generat..." */
- libc.VaList(bp, (*Column)(unsafe.Pointer(pCol)).FzName))
+ Xsqlite3ErrorMsg(tls, pParse, ts+12629, /* "error in generat..." */
+ libc.VaList(bp, (*Column)(unsafe.Pointer(pCol)).FzCnName))
generated_done:
Xsqlite3ExprDelete(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, pExpr)
}
@@ -94525,12 +95883,12 @@ generated_done:
//
// IMPLEMENTATION-OF: R-34230-56049 SQLite automatically increments
// the schema-version whenever the schema changes.
-func Xsqlite3ChangeCookie(tls *libc.TLS, pParse uintptr, iDb int32) { /* sqlite3.c:114296:21: */
+func Xsqlite3ChangeCookie(tls *libc.TLS, pParse uintptr, iDb int32) { /* sqlite3.c:115067:21: */
var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb
var v uintptr = (*Parse)(unsafe.Pointer(pParse)).FpVdbe
Xsqlite3VdbeAddOp3(tls, v, OP_SetCookie, iDb, BTREE_SCHEMA_VERSION,
- (int32(uint32(1) + uint32((*Schema)(unsafe.Pointer((*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+uintptr(iDb)*16)).FpSchema)).Fschema_cookie))))
+ int32(uint32(1)+uint32((*Schema)(unsafe.Pointer((*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+uintptr(iDb)*16)).FpSchema)).Fschema_cookie)))
}
// Measure the number of characters needed to output the given
@@ -94539,7 +95897,7 @@ func Xsqlite3ChangeCookie(tls *libc.TLS, pParse uintptr, iDb int32) { /* sqlite3
//
// The estimate is conservative. It might be larger that what is
// really needed.
-func identLength(tls *libc.TLS, z uintptr) int32 { /* sqlite3.c:114312:12: */
+func identLength(tls *libc.TLS, z uintptr) int32 { /* sqlite3.c:115083:12: */
var n int32
n = 0
__1:
@@ -94560,7 +95918,7 @@ __2:
goto __3
__3:
;
- return (n + 2)
+ return n + 2
}
// The first parameter is a pointer to an output buffer. The second
@@ -94574,7 +95932,7 @@ __3:
// characters, does not begin with a digit and is not an SQL keyword,
// then it is copied to the output buffer exactly as it is. Otherwise,
// it is quoted using double-quotes.
-func identPut(tls *libc.TLS, z uintptr, pIdx uintptr, zSignedIdent uintptr) { /* sqlite3.c:114333:13: */
+func identPut(tls *libc.TLS, z uintptr, pIdx uintptr, zSignedIdent uintptr) { /* sqlite3.c:115104:13: */
var zIdent uintptr = zSignedIdent
var i int32
var j int32
@@ -94582,14 +95940,14 @@ func identPut(tls *libc.TLS, z uintptr, pIdx uintptr, zSignedIdent uintptr) { /*
i = *(*int32)(unsafe.Pointer(pIdx))
for j = 0; *(*uint8)(unsafe.Pointer(zIdent + uintptr(j))) != 0; j++ {
- if !((int32(Xsqlite3CtypeMap[*(*uint8)(unsafe.Pointer(zIdent + uintptr(j)))]) & 0x06) != 0) && (int32(*(*uint8)(unsafe.Pointer(zIdent + uintptr(j)))) != '_') {
+ if !(int32(Xsqlite3CtypeMap[*(*uint8)(unsafe.Pointer(zIdent + uintptr(j)))])&0x06 != 0) && int32(*(*uint8)(unsafe.Pointer(zIdent + uintptr(j)))) != '_' {
break
}
}
- needQuote = (libc.Bool32(((((int32(Xsqlite3CtypeMap[*(*uint8)(unsafe.Pointer(zIdent))]) & 0x04) != 0) ||
- (Xsqlite3KeywordCode(tls, zIdent, j) != TK_ID)) ||
- (int32(*(*uint8)(unsafe.Pointer(zIdent + uintptr(j)))) != 0)) ||
- (j == 0)))
+ needQuote = libc.Bool32(int32(Xsqlite3CtypeMap[*(*uint8)(unsafe.Pointer(zIdent))])&0x04 != 0 ||
+ Xsqlite3KeywordCode(tls, zIdent, j) != TK_ID ||
+ int32(*(*uint8)(unsafe.Pointer(zIdent + uintptr(j)))) != 0 ||
+ j == 0)
if needQuote != 0 {
*(*uint8)(unsafe.Pointer(z + uintptr(libc.PostIncInt32(&i, 1)))) = uint8('"')
@@ -94610,7 +95968,7 @@ func identPut(tls *libc.TLS, z uintptr, pIdx uintptr, zSignedIdent uintptr) { /*
// Generate a CREATE TABLE statement appropriate for the given
// table. Memory to hold the text of the statement is obtained
// from sqliteMalloc() and must be freed by the calling function.
-func createTableStmt(tls *libc.TLS, db uintptr, p uintptr) uintptr { /* sqlite3.c:114361:13: */
+func createTableStmt(tls *libc.TLS, db uintptr, p uintptr) uintptr { /* sqlite3.c:115132:13: */
bp := tls.Alloc(12)
defer tls.Free(12)
@@ -94631,34 +95989,34 @@ __1:
goto __3
}
{
- n = n + (identLength(tls, (*Column)(unsafe.Pointer(pCol)).FzName) + 5)
+ n = n + (identLength(tls, (*Column)(unsafe.Pointer(pCol)).FzCnName) + 5)
}
goto __2
__2:
i++
- pCol += 20
+ pCol += 16
goto __1
goto __3
__3:
;
- n = n + (identLength(tls, (*Table)(unsafe.Pointer(p)).FzName))
+ n = n + identLength(tls, (*Table)(unsafe.Pointer(p)).FzName)
if n < 50 {
- zSep = ts + 755 /* "" */
- zSep2 = ts + 11537 /* "," */
- zEnd = ts + 4066 /* ")" */
+ zSep = ts + 1543 /* "" */
+ zSep2 = ts + 12660 /* "," */
+ zEnd = ts + 4877 /* ")" */
} else {
- zSep = ts + 11539 /* "\n " */
- zSep2 = ts + 11543 /* ",\n " */
- zEnd = ts + 11548 /* "\n)" */
+ zSep = ts + 12662 /* "\n " */
+ zSep2 = ts + 12666 /* ",\n " */
+ zEnd = ts + 12671 /* "\n)" */
}
- n = n + (35 + (6 * int32((*Table)(unsafe.Pointer(p)).FnCol)))
+ n = n + (35 + 6*int32((*Table)(unsafe.Pointer(p)).FnCol))
zStmt = Xsqlite3DbMallocRaw(tls, uintptr(0), uint64(n))
if zStmt == uintptr(0) {
Xsqlite3OomFault(tls, db)
return uintptr(0)
}
- Xsqlite3_snprintf(tls, n, zStmt, ts+11551 /* "CREATE TABLE " */, 0)
+ Xsqlite3_snprintf(tls, n, zStmt, ts+12674 /* "CREATE TABLE " */, 0)
*(*int32)(unsafe.Pointer(bp + 8 /* k */)) = Xsqlite3Strlen30(tls, zStmt)
identPut(tls, zStmt, bp+8 /* &k */, (*Table)(unsafe.Pointer(p)).FzName)
*(*uint8)(unsafe.Pointer(zStmt + uintptr(libc.PostIncInt32(&*(*int32)(unsafe.Pointer(bp + 8 /* k */)), 1)))) = uint8('(')
@@ -94672,70 +96030,70 @@ __4:
var len int32
var zType uintptr
- Xsqlite3_snprintf(tls, (n - *(*int32)(unsafe.Pointer(bp + 8 /* k */))), (zStmt + uintptr(*(*int32)(unsafe.Pointer(bp + 8 /* k */)))), zSep, 0)
- *(*int32)(unsafe.Pointer(bp + 8 /* k */)) += Xsqlite3Strlen30(tls, (zStmt + uintptr(*(*int32)(unsafe.Pointer(bp + 8 /* k */)))))
+ Xsqlite3_snprintf(tls, n-*(*int32)(unsafe.Pointer(bp + 8)), zStmt+uintptr(*(*int32)(unsafe.Pointer(bp + 8))), zSep, 0)
+ *(*int32)(unsafe.Pointer(bp + 8 /* k */)) += Xsqlite3Strlen30(tls, zStmt+uintptr(*(*int32)(unsafe.Pointer(bp + 8))))
zSep = zSep2
- identPut(tls, zStmt, bp+8 /* &k */, (*Column)(unsafe.Pointer(pCol)).FzName)
+ identPut(tls, zStmt, bp+8 /* &k */, (*Column)(unsafe.Pointer(pCol)).FzCnName)
- zType = azType1[(int32((*Column)(unsafe.Pointer(pCol)).Faffinity) - SQLITE_AFF_BLOB)]
+ zType = azType1[int32((*Column)(unsafe.Pointer(pCol)).Faffinity)-SQLITE_AFF_BLOB]
len = Xsqlite3Strlen30(tls, zType)
- libc.Xmemcpy(tls, (zStmt + uintptr(*(*int32)(unsafe.Pointer(bp + 8 /* k */)))), zType, uint32(len))
+ libc.Xmemcpy(tls, zStmt+uintptr(*(*int32)(unsafe.Pointer(bp + 8))), zType, uint32(len))
*(*int32)(unsafe.Pointer(bp + 8 /* k */)) += len
}
goto __5
__5:
i++
- pCol += 20
+ pCol += 16
goto __4
goto __6
__6:
;
- Xsqlite3_snprintf(tls, (n - *(*int32)(unsafe.Pointer(bp + 8 /* k */))), (zStmt + uintptr(*(*int32)(unsafe.Pointer(bp + 8 /* k */)))), ts+2790 /* "%s" */, libc.VaList(bp, zEnd))
+ Xsqlite3_snprintf(tls, n-*(*int32)(unsafe.Pointer(bp + 8)), zStmt+uintptr(*(*int32)(unsafe.Pointer(bp + 8))), ts+3601 /* "%s" */, libc.VaList(bp, zEnd))
return zStmt
}
var azType1 = [5]uintptr{
- /* SQLITE_AFF_BLOB */ ts + 755, /* "" */
- /* SQLITE_AFF_TEXT */ ts + 11565, /* " TEXT" */
- /* SQLITE_AFF_NUMERIC */ ts + 11571, /* " NUM" */
- /* SQLITE_AFF_INTEGER */ ts + 11576, /* " INT" */
- /* SQLITE_AFF_REAL */ ts + 11581, /* " REAL" */
-} /* sqlite3.c:114391:23 */
+ /* SQLITE_AFF_BLOB */ ts + 1543, /* "" */
+ /* SQLITE_AFF_TEXT */ ts + 12688, /* " TEXT" */
+ /* SQLITE_AFF_NUMERIC */ ts + 12694, /* " NUM" */
+ /* SQLITE_AFF_INTEGER */ ts + 12699, /* " INT" */
+ /* SQLITE_AFF_REAL */ ts + 12704, /* " REAL" */
+} /* sqlite3.c:115162:23 */
// Resize an Index object to hold N columns total. Return SQLITE_OK
// on success and SQLITE_NOMEM on an OOM error.
-func resizeIndexObject(tls *libc.TLS, db uintptr, pIdx uintptr, N int32) int32 { /* sqlite3.c:114429:12: */
+func resizeIndexObject(tls *libc.TLS, db uintptr, pIdx uintptr, N int32) int32 { /* sqlite3.c:115200:12: */
var zExtra uintptr
var nByte int32
if int32((*Index)(unsafe.Pointer(pIdx)).FnColumn) >= N {
return SQLITE_OK
}
- nByte = (int32((((uint32(unsafe.Sizeof(uintptr(0))) + uint32(unsafe.Sizeof(LogEst(0)))) + uint32(unsafe.Sizeof(I16(0)))) + uint32(1)) * uint32(N)))
+ nByte = int32((uint32(unsafe.Sizeof(uintptr(0))) + uint32(unsafe.Sizeof(LogEst(0))) + uint32(unsafe.Sizeof(I16(0))) + uint32(1)) * uint32(N))
zExtra = Xsqlite3DbMallocZero(tls, db, uint64(nByte))
if zExtra == uintptr(0) {
return SQLITE_NOMEM
}
- libc.Xmemcpy(tls, zExtra, (*Index)(unsafe.Pointer(pIdx)).FazColl, (uint32(unsafe.Sizeof(uintptr(0))) * uint32((*Index)(unsafe.Pointer(pIdx)).FnColumn)))
+ libc.Xmemcpy(tls, zExtra, (*Index)(unsafe.Pointer(pIdx)).FazColl, uint32(unsafe.Sizeof(uintptr(0)))*uint32((*Index)(unsafe.Pointer(pIdx)).FnColumn))
(*Index)(unsafe.Pointer(pIdx)).FazColl = zExtra
- zExtra += (uintptr(uint32(unsafe.Sizeof(uintptr(0))) * uint32(N)))
- libc.Xmemcpy(tls, zExtra, (*Index)(unsafe.Pointer(pIdx)).FaiRowLogEst, (uint32(unsafe.Sizeof(LogEst(0))) * (uint32(int32((*Index)(unsafe.Pointer(pIdx)).FnKeyCol) + 1))))
+ zExtra += uintptr(uint32(unsafe.Sizeof(uintptr(0))) * uint32(N))
+ libc.Xmemcpy(tls, zExtra, (*Index)(unsafe.Pointer(pIdx)).FaiRowLogEst, uint32(unsafe.Sizeof(LogEst(0)))*uint32(int32((*Index)(unsafe.Pointer(pIdx)).FnKeyCol)+1))
(*Index)(unsafe.Pointer(pIdx)).FaiRowLogEst = zExtra
- zExtra += (uintptr(uint32(unsafe.Sizeof(LogEst(0))) * uint32(N)))
- libc.Xmemcpy(tls, zExtra, (*Index)(unsafe.Pointer(pIdx)).FaiColumn, (uint32(unsafe.Sizeof(I16(0))) * uint32((*Index)(unsafe.Pointer(pIdx)).FnColumn)))
+ zExtra += uintptr(uint32(unsafe.Sizeof(LogEst(0))) * uint32(N))
+ libc.Xmemcpy(tls, zExtra, (*Index)(unsafe.Pointer(pIdx)).FaiColumn, uint32(unsafe.Sizeof(I16(0)))*uint32((*Index)(unsafe.Pointer(pIdx)).FnColumn))
(*Index)(unsafe.Pointer(pIdx)).FaiColumn = zExtra
- zExtra += (uintptr(uint32(unsafe.Sizeof(I16(0))) * uint32(N)))
+ zExtra += uintptr(uint32(unsafe.Sizeof(I16(0))) * uint32(N))
libc.Xmemcpy(tls, zExtra, (*Index)(unsafe.Pointer(pIdx)).FaSortOrder, uint32((*Index)(unsafe.Pointer(pIdx)).FnColumn))
(*Index)(unsafe.Pointer(pIdx)).FaSortOrder = zExtra
(*Index)(unsafe.Pointer(pIdx)).FnColumn = U16(N)
- libc.SetBitFieldPtr16Uint32(pIdx+56 /* &.isResized */, uint32(1), 4, 0x10)
+ libc.SetBitFieldPtr16Uint32(pIdx+56, uint32(1), 4, 0x10)
return SQLITE_OK
}
// Estimate the total row width for a table.
-func estimateTableWidth(tls *libc.TLS, pTab uintptr) { /* sqlite3.c:114456:13: */
+func estimateTableWidth(tls *libc.TLS, pTab uintptr) { /* sqlite3.c:115227:13: */
var wTable uint32 = uint32(0)
var pTabCol uintptr
var i int32
@@ -94746,13 +96104,13 @@ __1:
goto __3
}
{
- wTable = wTable + (uint32((*Column)(unsafe.Pointer(pTabCol)).FszEst))
+ wTable = wTable + uint32((*Column)(unsafe.Pointer(pTabCol)).FszEst)
}
goto __2
__2:
i--
- pTabCol += 20
+ pTabCol += 16
goto __1
goto __3
__3:
@@ -94760,33 +96118,32 @@ __3:
if int32((*Table)(unsafe.Pointer(pTab)).FiPKey) < 0 {
wTable++
}
- (*Table)(unsafe.Pointer(pTab)).FszTabRow = Xsqlite3LogEst(tls, (uint64(wTable * uint32(4))))
+ (*Table)(unsafe.Pointer(pTab)).FszTabRow = Xsqlite3LogEst(tls, uint64(wTable*uint32(4)))
}
// Estimate the average size of a row for an index.
-func estimateIndexWidth(tls *libc.TLS, pIdx uintptr) { /* sqlite3.c:114470:13: */
+func estimateIndexWidth(tls *libc.TLS, pIdx uintptr) { /* sqlite3.c:115241:13: */
var wIndex uint32 = uint32(0)
var i int32
var aCol uintptr = (*Table)(unsafe.Pointer((*Index)(unsafe.Pointer(pIdx)).FpTable)).FaCol
for i = 0; i < int32((*Index)(unsafe.Pointer(pIdx)).FnColumn); i++ {
var x I16 = *(*I16)(unsafe.Pointer((*Index)(unsafe.Pointer(pIdx)).FaiColumn + uintptr(i)*2))
- wIndex = wIndex + (func() uint32 {
+ wIndex = wIndex + func() uint32 {
if int32(x) < 0 {
return uint32(1)
}
- return uint32((*Column)(unsafe.Pointer(aCol + uintptr(*(*I16)(unsafe.Pointer((*Index)(unsafe.Pointer(pIdx)).FaiColumn + uintptr(i)*2)))*20)).FszEst)
- }())
+ return uint32((*Column)(unsafe.Pointer(aCol + uintptr(*(*I16)(unsafe.Pointer((*Index)(unsafe.Pointer(pIdx)).FaiColumn + uintptr(i)*2)))*16)).FszEst)
+ }()
}
- (*Index)(unsafe.Pointer(pIdx)).FszIdxRow = Xsqlite3LogEst(tls, (uint64(wIndex * uint32(4))))
+ (*Index)(unsafe.Pointer(pIdx)).FszIdxRow = Xsqlite3LogEst(tls, uint64(wIndex*uint32(4)))
}
// Return true if column number x is any of the first nCol entries of aiCol[].
// This is used to determine if the column number x appears in any of the
// first nCol entries of an index.
-func hasColumn(tls *libc.TLS, aiCol uintptr, nCol int32, x int32) int32 { /* sqlite3.c:114486:12: */
+func hasColumn(tls *libc.TLS, aiCol uintptr, nCol int32, x int32) int32 { /* sqlite3.c:115257:12: */
for libc.PostDecInt32(&nCol, 1) > 0 {
-
if x == int32(*(*I16)(unsafe.Pointer(libc.PostIncUintptr(&aiCol, 2)))) {
return 1
}
@@ -94805,7 +96162,7 @@ func hasColumn(tls *libc.TLS, aiCol uintptr, nCol int32, x int32) int32 { /* sql
// This routine differs from hasColumn() in that both the column and the
// collating sequence must match for this routine, but for hasColumn() only
// the column name must match.
-func isDupColumn(tls *libc.TLS, pIdx uintptr, nKey int32, pPk uintptr, iCol int32) int32 { /* sqlite3.c:114509:12: */
+func isDupColumn(tls *libc.TLS, pIdx uintptr, nKey int32, pPk uintptr, iCol int32) int32 { /* sqlite3.c:115279:12: */
var i int32
var j int32
@@ -94813,8 +96170,8 @@ func isDupColumn(tls *libc.TLS, pIdx uintptr, nKey int32, pPk uintptr, iCol int3
for i = 0; i < nKey; i++ {
- if (int32(*(*I16)(unsafe.Pointer((*Index)(unsafe.Pointer(pIdx)).FaiColumn + uintptr(i)*2))) == j) &&
- (Xsqlite3StrICmp(tls, *(*uintptr)(unsafe.Pointer((*Index)(unsafe.Pointer(pIdx)).FazColl + uintptr(i)*4)), *(*uintptr)(unsafe.Pointer((*Index)(unsafe.Pointer(pPk)).FazColl + uintptr(iCol)*4))) == 0) {
+ if int32(*(*I16)(unsafe.Pointer((*Index)(unsafe.Pointer(pIdx)).FaiColumn + uintptr(i)*2))) == j &&
+ Xsqlite3StrICmp(tls, *(*uintptr)(unsafe.Pointer((*Index)(unsafe.Pointer(pIdx)).FazColl + uintptr(i)*4)), *(*uintptr)(unsafe.Pointer((*Index)(unsafe.Pointer(pPk)).FazColl + uintptr(iCol)*4))) == 0 {
return 1
}
}
@@ -94838,16 +96195,16 @@ func isDupColumn(tls *libc.TLS, pIdx uintptr, nKey int32, pPk uintptr, iCol int3
//
// The colNotIdxed mask is AND-ed with the SrcList.a[].colUsed mask
// to determine if the index is covering index.
-func recomputeColumnsNotIndexed(tls *libc.TLS, pIdx uintptr) { /* sqlite3.c:114548:13: */
+func recomputeColumnsNotIndexed(tls *libc.TLS, pIdx uintptr) { /* sqlite3.c:115318:13: */
var m Bitmask = uint64(0)
var j int32
var pTab uintptr = (*Index)(unsafe.Pointer(pIdx)).FpTable
- for j = (int32((*Index)(unsafe.Pointer(pIdx)).FnColumn) - 1); j >= 0; j-- {
+ for j = int32((*Index)(unsafe.Pointer(pIdx)).FnColumn) - 1; j >= 0; j-- {
var x int32 = int32(*(*I16)(unsafe.Pointer((*Index)(unsafe.Pointer(pIdx)).FaiColumn + uintptr(j)*2)))
- if (x >= 0) && ((int32((*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FaCol+uintptr(x)*20)).FcolFlags) & COLFLAG_VIRTUAL) == 0) {
+ if x >= 0 && int32((*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FaCol+uintptr(x)*16)).FcolFlags)&COLFLAG_VIRTUAL == 0 {
- if x < ((int32(uint32(unsafe.Sizeof(Bitmask(0))) * uint32(8))) - 1) {
- m = m | (Bitmask((uint64(1))) << (x))
+ if x < int32(uint32(unsafe.Sizeof(Bitmask(0)))*uint32(8))-1 {
+ m = m | Bitmask(uint64(1))<<x
}
}
}
@@ -94877,7 +96234,7 @@ func recomputeColumnsNotIndexed(tls *libc.TLS, pIdx uintptr) { /* sqlite3.c:1145
// indices with the PRIMARY KEY columns.
//
// For virtual tables, only (1) is performed.
-func convertToWithoutRowidTable(tls *libc.TLS, pParse uintptr, pTab uintptr) { /* sqlite3.c:114588:13: */
+func convertToWithoutRowidTable(tls *libc.TLS, pParse uintptr, pTab uintptr) { /* sqlite3.c:115358:13: */
bp := tls.Alloc(8)
defer tls.Free(8)
@@ -94891,21 +96248,22 @@ func convertToWithoutRowidTable(tls *libc.TLS, pParse uintptr, pTab uintptr) { /
var v uintptr = (*Parse)(unsafe.Pointer(pParse)).FpVdbe
// Mark every PRIMARY KEY column as NOT NULL (except for imposter tables)
- if !((int32(*(*uint8)(unsafe.Pointer(db + 164 /* &.init */ + 8 /* &.imposterTable */)) & 0x2 >> 1)) != 0) {
+ if !(int32(*(*uint8)(unsafe.Pointer(db + 172 + 8))&0x2>>1) != 0) {
for i = 0; i < int32((*Table)(unsafe.Pointer(pTab)).FnCol); i++ {
- if (int32((*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FaCol+uintptr(i)*20)).FcolFlags) & COLFLAG_PRIMKEY) != 0 {
- (*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FaCol + uintptr(i)*20)).FnotNull = U8(OE_Abort)
+ if int32((*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FaCol+uintptr(i)*16)).FcolFlags)&COLFLAG_PRIMKEY != 0 &&
+ int32(*(*uint8)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FaCol + uintptr(i)*16 + 4))&0xf>>0) == OE_None {
+ libc.SetBitFieldPtr8Uint32((*Table)(unsafe.Pointer(pTab)).FaCol+uintptr(i)*16+4, uint32(OE_Abort), 0, 0xf)
}
}
- *(*U32)(unsafe.Pointer(pTab + 36 /* &.tabFlags */)) |= (U32(TF_HasNotNull))
+ *(*U32)(unsafe.Pointer(pTab + 28)) |= U32(TF_HasNotNull)
}
// Convert the P3 operand of the OP_CreateBtree opcode from BTREE_INTKEY
// into BTREE_BLOBKEY.
- if *(*int32)(unsafe.Pointer(pParse + 128 /* &.u1 */)) != 0 {
+ if *(*int32)(unsafe.Pointer(pParse + 124)) != 0 {
- Xsqlite3VdbeChangeP3(tls, v, *(*int32)(unsafe.Pointer(pParse + 128 /* &.u1 */)), BTREE_BLOBKEY)
+ Xsqlite3VdbeChangeP3(tls, v, *(*int32)(unsafe.Pointer(pParse + 124)), BTREE_BLOBKEY)
}
// Locate the PRIMARY KEY index. Or, if this table was originally
@@ -94914,23 +96272,23 @@ func convertToWithoutRowidTable(tls *libc.TLS, pParse uintptr, pTab uintptr) { /
var pList uintptr
// var ipkToken Token at bp, 8
- Xsqlite3TokenInit(tls, bp /* &ipkToken */, (*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FaCol+uintptr((*Table)(unsafe.Pointer(pTab)).FiPKey)*20)).FzName)
+ Xsqlite3TokenInit(tls, bp /* &ipkToken */, (*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FaCol+uintptr((*Table)(unsafe.Pointer(pTab)).FiPKey)*16)).FzCnName)
pList = Xsqlite3ExprListAppend(tls, pParse, uintptr(0),
Xsqlite3ExprAlloc(tls, db, TK_ID, bp /* &ipkToken */, 0))
if pList == uintptr(0) {
- *(*U32)(unsafe.Pointer(pTab + 36 /* &.tabFlags */)) &= (libc.Uint32FromInt32(libc.CplInt32(TF_WithoutRowid)))
+ *(*U32)(unsafe.Pointer(pTab + 28)) &= libc.Uint32FromInt32(libc.CplInt32(TF_WithoutRowid))
return
}
if int32((*Parse)(unsafe.Pointer(pParse)).FeParseMode) >= PARSE_MODE_RENAME {
- Xsqlite3RenameTokenRemap(tls, pParse, (*ExprList_item)(unsafe.Pointer((pList + 8 /* &.a */))).FpExpr, (pTab + 40 /* &.iPKey */))
+ Xsqlite3RenameTokenRemap(tls, pParse, (*ExprList_item)(unsafe.Pointer(pList+8)).FpExpr, pTab+32)
}
- (*ExprList_item)(unsafe.Pointer((pList + 8 /* &.a */))).FsortFlags = (*Parse)(unsafe.Pointer(pParse)).FiPkSortOrder
+ (*ExprList_item)(unsafe.Pointer(pList + 8)).FsortFlags = (*Parse)(unsafe.Pointer(pParse)).FiPkSortOrder
(*Table)(unsafe.Pointer(pTab)).FiPKey = int16(-1)
Xsqlite3CreateIndex(tls, pParse, uintptr(0), uintptr(0), uintptr(0), pList, int32((*Table)(unsafe.Pointer(pTab)).FkeyConf), uintptr(0), uintptr(0), 0, 0,
uint8(SQLITE_IDXTYPE_PRIMARYKEY))
- if ((*Sqlite3)(unsafe.Pointer(db)).FmallocFailed != 0) || ((*Parse)(unsafe.Pointer(pParse)).FnErr != 0) {
- *(*U32)(unsafe.Pointer(pTab + 36 /* &.tabFlags */)) &= (libc.Uint32FromInt32(libc.CplInt32(TF_WithoutRowid)))
+ if (*Sqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 || (*Parse)(unsafe.Pointer(pParse)).FnErr != 0 {
+ *(*U32)(unsafe.Pointer(pTab + 28)) &= libc.Uint32FromInt32(libc.CplInt32(TF_WithoutRowid))
return
}
pPk = Xsqlite3PrimaryKeyIndex(tls, pTab)
@@ -94954,17 +96312,17 @@ func convertToWithoutRowidTable(tls *libc.TLS, pParse uintptr, pTab uintptr) { /
(*Index)(unsafe.Pointer(pPk)).FnKeyCol = U16(j)
}
- libc.SetBitFieldPtr16Uint32(pPk+56 /* &.isCovering */, uint32(1), 5, 0x20)
- if !((int32(*(*uint8)(unsafe.Pointer(db + 164 /* &.init */ + 8 /* &.imposterTable */)) & 0x2 >> 1)) != 0) {
- libc.SetBitFieldPtr16Uint32(pPk+56 /* &.uniqNotNull */, uint32(1), 3, 0x8)
+ libc.SetBitFieldPtr16Uint32(pPk+56, uint32(1), 5, 0x20)
+ if !(int32(*(*uint8)(unsafe.Pointer(db + 172 + 8))&0x2>>1) != 0) {
+ libc.SetBitFieldPtr16Uint32(pPk+56, uint32(1), 3, 0x8)
}
- nPk = int32(libc.AssignPtrUint16(pPk+52 /* &.nColumn */, (*Index)(unsafe.Pointer(pPk)).FnKeyCol))
+ nPk = int32(libc.AssignPtrUint16(pPk+52, (*Index)(unsafe.Pointer(pPk)).FnKeyCol))
// Bypass the creation of the PRIMARY KEY btree and the sqlite_schema
// table entry. This is only required if currently generating VDBE
// code for a CREATE TABLE (not when parsing one as part of reading
// a database schema).
- if (v != 0) && ((*Index)(unsafe.Pointer(pPk)).Ftnum > Pgno(0)) {
+ if v != 0 && (*Index)(unsafe.Pointer(pPk)).Ftnum > Pgno(0) {
Xsqlite3VdbeChangeOpcode(tls, v, int32((*Index)(unsafe.Pointer(pPk)).Ftnum), uint8(OP_Goto))
}
@@ -94976,7 +96334,7 @@ func convertToWithoutRowidTable(tls *libc.TLS, pParse uintptr, pTab uintptr) { /
// the final rowid column into one or more columns of the PRIMARY KEY.
for pIdx = (*Table)(unsafe.Pointer(pTab)).FpIndex; pIdx != 0; pIdx = (*Index)(unsafe.Pointer(pIdx)).FpNext {
var n int32
- if (int32(*(*uint16)(unsafe.Pointer((pIdx) + 56 /* &.idxType */)) & 0x3 >> 0)) == SQLITE_IDXTYPE_PRIMARYKEY {
+ if int32(*(*uint16)(unsafe.Pointer(pIdx + 56))&0x3>>0) == SQLITE_IDXTYPE_PRIMARYKEY {
continue
}
for i = libc.AssignInt32(&n, 0); i < nPk; i++ {
@@ -94990,7 +96348,7 @@ func convertToWithoutRowidTable(tls *libc.TLS, pParse uintptr, pTab uintptr) { /
(*Index)(unsafe.Pointer(pIdx)).FnColumn = (*Index)(unsafe.Pointer(pIdx)).FnKeyCol
continue
}
- if resizeIndexObject(tls, db, pIdx, (int32((*Index)(unsafe.Pointer(pIdx)).FnKeyCol)+n)) != 0 {
+ if resizeIndexObject(tls, db, pIdx, int32((*Index)(unsafe.Pointer(pIdx)).FnKeyCol)+n) != 0 {
return
}
i = 0
@@ -95002,7 +96360,7 @@ func convertToWithoutRowidTable(tls *libc.TLS, pParse uintptr, pTab uintptr) { /
*(*uintptr)(unsafe.Pointer((*Index)(unsafe.Pointer(pIdx)).FazColl + uintptr(j)*4)) = *(*uintptr)(unsafe.Pointer((*Index)(unsafe.Pointer(pPk)).FazColl + uintptr(i)*4))
if *(*U8)(unsafe.Pointer((*Index)(unsafe.Pointer(pPk)).FaSortOrder + uintptr(i))) != 0 {
// See ticket https://www.sqlite.org/src/info/bba7b69f9849b5bf
- libc.SetBitFieldPtr16Uint32(pIdx+56 /* &.bAscKeyBug */, uint32(1), 9, 0x200)
+ libc.SetBitFieldPtr16Uint32(pIdx+56, uint32(1), 9, 0x200)
}
j++
}
@@ -95014,18 +96372,18 @@ func convertToWithoutRowidTable(tls *libc.TLS, pParse uintptr, pTab uintptr) { /
nExtra = 0
for i = 0; i < int32((*Table)(unsafe.Pointer(pTab)).FnCol); i++ {
if !(hasColumn(tls, (*Index)(unsafe.Pointer(pPk)).FaiColumn, nPk, i) != 0) &&
- ((int32((*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FaCol+uintptr(i)*20)).FcolFlags) & COLFLAG_VIRTUAL) == 0) {
+ int32((*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FaCol+uintptr(i)*16)).FcolFlags)&COLFLAG_VIRTUAL == 0 {
nExtra++
}
}
- if resizeIndexObject(tls, db, pPk, (nPk+nExtra)) != 0 {
+ if resizeIndexObject(tls, db, pPk, nPk+nExtra) != 0 {
return
}
i = 0
j = nPk
for ; i < int32((*Table)(unsafe.Pointer(pTab)).FnCol); i++ {
if !(hasColumn(tls, (*Index)(unsafe.Pointer(pPk)).FaiColumn, j, i) != 0) &&
- ((int32((*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FaCol+uintptr(i)*20)).FcolFlags) & COLFLAG_VIRTUAL) == 0) {
+ int32((*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FaCol+uintptr(i)*16)).FcolFlags)&COLFLAG_VIRTUAL == 0 {
*(*I16)(unsafe.Pointer((*Index)(unsafe.Pointer(pPk)).FaiColumn + uintptr(j)*2)) = I16(i)
*(*uintptr)(unsafe.Pointer((*Index)(unsafe.Pointer(pPk)).FazColl + uintptr(j)*4)) = uintptr(unsafe.Pointer(&Xsqlite3StrBINARY))
@@ -95038,11 +96396,11 @@ func convertToWithoutRowidTable(tls *libc.TLS, pParse uintptr, pTab uintptr) { /
// Return true if pTab is a virtual table and zName is a shadow table name
// for that virtual table.
-func Xsqlite3IsShadowTableOf(tls *libc.TLS, db uintptr, pTab uintptr, zName uintptr) int32 { /* sqlite3.c:114745:20: */
+func Xsqlite3IsShadowTableOf(tls *libc.TLS, db uintptr, pTab uintptr, zName uintptr) int32 { /* sqlite3.c:115517:20: */
var nName int32 // Length of zName
var pMod uintptr // Module for the virtual table
- if !((*Table)(unsafe.Pointer(pTab)).FnModuleArg != 0) {
+ if !(int32((*Table)(unsafe.Pointer(pTab)).FeTabType) == TABTYP_VTAB) {
return 0
}
nName = Xsqlite3Strlen30(tls, (*Table)(unsafe.Pointer(pTab)).FzName)
@@ -95052,7 +96410,7 @@ func Xsqlite3IsShadowTableOf(tls *libc.TLS, db uintptr, pTab uintptr, zName uint
if int32(*(*uint8)(unsafe.Pointer(zName + uintptr(nName)))) != '_' {
return 0
}
- pMod = Xsqlite3HashFind(tls, (db + 376 /* &.aModule */), *(*uintptr)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FazModuleArg)))
+ pMod = Xsqlite3HashFind(tls, db+400, *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pTab + 44 + 4 /* &.azArg */)))))
if pMod == uintptr(0) {
return 0
}
@@ -95064,7 +96422,50 @@ func Xsqlite3IsShadowTableOf(tls *libc.TLS, db uintptr, pTab uintptr, zName uint
}
return (*struct {
f func(*libc.TLS, uintptr) int32
- })(unsafe.Pointer(&struct{ uintptr }{(*Sqlite3_module)(unsafe.Pointer((*Module)(unsafe.Pointer(pMod)).FpModule)).FxShadowName})).f(tls, ((zName + uintptr(nName)) + uintptr(1)))
+ })(unsafe.Pointer(&struct{ uintptr }{(*Sqlite3_module)(unsafe.Pointer((*Module)(unsafe.Pointer(pMod)).FpModule)).FxShadowName})).f(tls, zName+uintptr(nName)+uintptr(1))
+}
+
+// Table pTab is a virtual table. If it the virtual table implementation
+// exists and has an xShadowName method, then loop over all other ordinary
+// tables within the same schema looking for shadow tables of pTab, and mark
+// any shadow tables seen using the TF_Shadow flag.
+func Xsqlite3MarkAllShadowTablesOf(tls *libc.TLS, db uintptr, pTab uintptr) { /* sqlite3.c:115540:21: */
+ var nName int32 // Length of pTab->zName
+ var pMod uintptr // Module for the virtual table
+ var k uintptr // For looping through the symbol table
+
+ pMod = Xsqlite3HashFind(tls, db+400, *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pTab + 44 + 4 /* &.azArg */)))))
+ if pMod == uintptr(0) {
+ return
+ }
+ if (*Module)(unsafe.Pointer(pMod)).FpModule == uintptr(0) {
+ return
+ }
+ if (*Sqlite3_module)(unsafe.Pointer((*Module)(unsafe.Pointer(pMod)).FpModule)).FiVersion < 3 {
+ return
+ }
+ if (*Sqlite3_module)(unsafe.Pointer((*Module)(unsafe.Pointer(pMod)).FpModule)).FxShadowName == uintptr(0) {
+ return
+ }
+
+ nName = Xsqlite3Strlen30(tls, (*Table)(unsafe.Pointer(pTab)).FzName)
+ for k = (*Hash)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FpSchema + 8)).Ffirst; k != 0; k = (*HashElem)(unsafe.Pointer(k)).Fnext {
+ var pOther uintptr = (*HashElem)(unsafe.Pointer(k)).Fdata
+
+ if !(int32((*Table)(unsafe.Pointer(pOther)).FeTabType) == TABTYP_NORM) {
+ continue
+ }
+ if (*Table)(unsafe.Pointer(pOther)).FtabFlags&U32(TF_Shadow) != 0 {
+ continue
+ }
+ if Xsqlite3_strnicmp(tls, (*Table)(unsafe.Pointer(pOther)).FzName, (*Table)(unsafe.Pointer(pTab)).FzName, nName) == 0 &&
+ int32(*(*uint8)(unsafe.Pointer((*Table)(unsafe.Pointer(pOther)).FzName + uintptr(nName)))) == '_' &&
+ (*struct {
+ f func(*libc.TLS, uintptr) int32
+ })(unsafe.Pointer(&struct{ uintptr }{(*Sqlite3_module)(unsafe.Pointer((*Module)(unsafe.Pointer(pMod)).FpModule)).FxShadowName})).f(tls, (*Table)(unsafe.Pointer(pOther)).FzName+uintptr(nName)+uintptr(1)) != 0 {
+ *(*U32)(unsafe.Pointer(pOther + 28)) |= U32(TF_Shadow)
+ }
+ }
}
// Return true if zName is a shadow table name in the current database
@@ -95072,7 +96473,7 @@ func Xsqlite3IsShadowTableOf(tls *libc.TLS, db uintptr, pTab uintptr, zName uint
//
// zName is temporarily modified while this routine is running, but is
// restored to its original value prior to this routine returning.
-func Xsqlite3ShadowTableName(tls *libc.TLS, db uintptr, zName uintptr) int32 { /* sqlite3.c:114769:20: */
+func Xsqlite3ShadowTableName(tls *libc.TLS, db uintptr, zName uintptr) int32 { /* sqlite3.c:115576:20: */
var zTail uintptr // Pointer to the last "_" in zName
var pTab uintptr // Table that zName is a shadow of
zTail = libc.Xstrrchr(tls, zName, '_')
@@ -95085,7 +96486,7 @@ func Xsqlite3ShadowTableName(tls *libc.TLS, db uintptr, zName uintptr) int32 { /
if pTab == uintptr(0) {
return 0
}
- if !((*Table)(unsafe.Pointer(pTab)).FnModuleArg != 0) {
+ if !(int32((*Table)(unsafe.Pointer(pTab)).FeTabType) == TABTYP_VTAB) {
return 0
}
return Xsqlite3IsShadowTableOf(tls, db, pTab, zName)
@@ -95109,16 +96510,16 @@ func Xsqlite3ShadowTableName(tls *libc.TLS, db uintptr, zName uintptr) int32 { /
// was called to create a table generated from a
// "CREATE TABLE ... AS SELECT ..." statement. The column names of
// the new table will match the result set of the SELECT.
-func Xsqlite3EndTable(tls *libc.TLS, pParse uintptr, pCons uintptr, pEnd uintptr, tabOpts U8, pSelect uintptr) { /* sqlite3.c:114830:21: */
- bp := tls.Alloc(132)
- defer tls.Free(132)
+func Xsqlite3EndTable(tls *libc.TLS, pParse uintptr, pCons uintptr, pEnd uintptr, tabOpts U32, pSelect uintptr) { /* sqlite3.c:115637:21: */
+ bp := tls.Alloc(172)
+ defer tls.Free(172)
var p uintptr // The new table
var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb // The database connection
var iDb int32 // Database in which the table lives
var pIdx uintptr // An implied index of the table
- if (pEnd == uintptr(0)) && (pSelect == uintptr(0)) {
+ if pEnd == uintptr(0) && pSelect == uintptr(0) {
return
}
p = (*Parse)(unsafe.Pointer(pParse)).FpNewTable
@@ -95126,8 +96527,8 @@ func Xsqlite3EndTable(tls *libc.TLS, pParse uintptr, pCons uintptr, pEnd uintptr
return
}
- if (pSelect == uintptr(0)) && (Xsqlite3ShadowTableName(tls, db, (*Table)(unsafe.Pointer(p)).FzName) != 0) {
- *(*U32)(unsafe.Pointer(p + 36 /* &.tabFlags */)) |= (U32(TF_Shadow))
+ if pSelect == uintptr(0) && Xsqlite3ShadowTableName(tls, db, (*Table)(unsafe.Pointer(p)).FzName) != 0 {
+ *(*U32)(unsafe.Pointer(p + 28)) |= U32(TF_Shadow)
}
// If the db->init.busy is 1 it means we are reading the SQL off the
@@ -95139,28 +96540,63 @@ func Xsqlite3EndTable(tls *libc.TLS, pParse uintptr, pCons uintptr, pEnd uintptr
// If the root page number is 1, that means this is the sqlite_schema
// table itself. So mark it read-only.
if (*Sqlite3)(unsafe.Pointer(db)).Finit.Fbusy != 0 {
- if pSelect != 0 {
- Xsqlite3ErrorMsg(tls, pParse, ts+755 /* "" */, 0)
+ if pSelect != 0 || !(int32((*Table)(unsafe.Pointer(p)).FeTabType) == TABTYP_NORM) && (*Sqlite3)(unsafe.Pointer(db)).Finit.FnewTnum != 0 {
+ Xsqlite3ErrorMsg(tls, pParse, ts+1543 /* "" */, 0)
return
}
(*Table)(unsafe.Pointer(p)).Ftnum = (*Sqlite3)(unsafe.Pointer(db)).Finit.FnewTnum
if (*Table)(unsafe.Pointer(p)).Ftnum == Pgno(1) {
- *(*U32)(unsafe.Pointer(p + 36 /* &.tabFlags */)) |= (U32(TF_Readonly))
+ *(*U32)(unsafe.Pointer(p + 28)) |= U32(TF_Readonly)
+ }
+ }
+
+ // Special processing for tables that include the STRICT keyword:
+ //
+ // * Do not allow custom column datatypes. Every column must have
+ // a datatype that is one of INT, INTEGER, REAL, TEXT, or BLOB.
+ //
+ // * If a PRIMARY KEY is defined, other than the INTEGER PRIMARY KEY,
+ // then all columns of the PRIMARY KEY must have a NOT NULL
+ // constraint.
+ if tabOpts&U32(TF_Strict) != 0 {
+ var ii int32
+ *(*U32)(unsafe.Pointer(p + 28)) |= U32(TF_Strict)
+ for ii = 0; ii < int32((*Table)(unsafe.Pointer(p)).FnCol); ii++ {
+ var pCol uintptr = (*Table)(unsafe.Pointer(p)).FaCol + uintptr(ii)*16
+ if int32(*(*uint8)(unsafe.Pointer(pCol + 4))&0xf0>>4) == COLTYPE_CUSTOM {
+ if int32((*Column)(unsafe.Pointer(pCol)).FcolFlags)&COLFLAG_HASTYPE != 0 {
+ Xsqlite3ErrorMsg(tls, pParse,
+ ts+12710, /* "unknown datatype..." */
+ libc.VaList(bp, (*Table)(unsafe.Pointer(p)).FzName, (*Column)(unsafe.Pointer(pCol)).FzCnName, Xsqlite3ColumnType(tls, pCol, ts+1543 /* "" */)))
+ } else {
+ Xsqlite3ErrorMsg(tls, pParse, ts+12743, /* "missing datatype..." */
+ libc.VaList(bp+24, (*Table)(unsafe.Pointer(p)).FzName, (*Column)(unsafe.Pointer(pCol)).FzCnName))
+ }
+ return
+ } else if int32(*(*uint8)(unsafe.Pointer(pCol + 4))&0xf0>>4) == COLTYPE_ANY {
+ (*Column)(unsafe.Pointer(pCol)).Faffinity = uint8(SQLITE_AFF_BLOB)
+ }
+ if int32((*Column)(unsafe.Pointer(pCol)).FcolFlags)&COLFLAG_PRIMKEY != 0 &&
+ int32((*Table)(unsafe.Pointer(p)).FiPKey) != ii &&
+ int32(*(*uint8)(unsafe.Pointer(pCol + 4))&0xf>>0) == OE_None {
+ libc.SetBitFieldPtr8Uint32(pCol+4, uint32(OE_Abort), 0, 0xf)
+ *(*U32)(unsafe.Pointer(p + 28)) |= U32(TF_HasNotNull)
+ }
}
}
// Special processing for WITHOUT ROWID Tables
- if (int32(tabOpts) & TF_WithoutRowid) != 0 {
- if ((*Table)(unsafe.Pointer(p)).FtabFlags & U32(TF_Autoincrement)) != 0 {
+ if tabOpts&U32(TF_WithoutRowid) != 0 {
+ if (*Table)(unsafe.Pointer(p)).FtabFlags&U32(TF_Autoincrement) != 0 {
Xsqlite3ErrorMsg(tls, pParse,
- ts+11587 /* "AUTOINCREMENT no..." */, 0)
+ ts+12770 /* "AUTOINCREMENT no..." */, 0)
return
}
- if ((*Table)(unsafe.Pointer(p)).FtabFlags & U32(TF_HasPrimaryKey)) == U32(0) {
- Xsqlite3ErrorMsg(tls, pParse, ts+11637 /* "PRIMARY KEY miss..." */, libc.VaList(bp, (*Table)(unsafe.Pointer(p)).FzName))
+ if (*Table)(unsafe.Pointer(p)).FtabFlags&U32(TF_HasPrimaryKey) == U32(0) {
+ Xsqlite3ErrorMsg(tls, pParse, ts+12820 /* "PRIMARY KEY miss..." */, libc.VaList(bp+40, (*Table)(unsafe.Pointer(p)).FzName))
return
}
- *(*U32)(unsafe.Pointer(p + 36 /* &.tabFlags */)) |= (U32(TF_WithoutRowid | TF_NoVisibleRowid))
+ *(*U32)(unsafe.Pointer(p + 28)) |= U32(TF_WithoutRowid | TF_NoVisibleRowid)
convertToWithoutRowidTable(tls, pParse, p)
}
iDb = Xsqlite3SchemaToIndex(tls, db, (*Table)(unsafe.Pointer(p)).FpSchema)
@@ -95177,14 +96613,14 @@ func Xsqlite3EndTable(tls *libc.TLS, pParse uintptr, pCons uintptr, pEnd uintptr
}
}
- if ((*Table)(unsafe.Pointer(p)).FtabFlags & U32(TF_HasGenerated)) != 0 {
+ if (*Table)(unsafe.Pointer(p)).FtabFlags&U32(TF_HasGenerated) != 0 {
var ii int32
var nNG int32 = 0
for ii = 0; ii < int32((*Table)(unsafe.Pointer(p)).FnCol); ii++ {
- var colFlags U32 = U32((*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(p)).FaCol + uintptr(ii)*20)).FcolFlags)
- if (colFlags & U32(COLFLAG_GENERATED)) != U32(0) {
- var pX uintptr = (*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(p)).FaCol + uintptr(ii)*20)).FpDflt
+ var colFlags U32 = U32((*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(p)).FaCol + uintptr(ii)*16)).FcolFlags)
+ if colFlags&U32(COLFLAG_GENERATED) != U32(0) {
+ var pX uintptr = Xsqlite3ColumnExpr(tls, p, (*Table)(unsafe.Pointer(p)).FaCol+uintptr(ii)*16)
if Xsqlite3ResolveSelfReference(tls, pParse, p, NC_GenCol, pX, uintptr(0)) != 0 {
// If there are errors in resolving the expression, change the
@@ -95193,15 +96629,15 @@ func Xsqlite3EndTable(tls *libc.TLS, pParse uintptr, pCons uintptr, pEnd uintptr
// tree that have been allocated from lookaside memory, which is
// illegal in a schema and will lead to errors or heap corruption
// when the database connection closes.
- Xsqlite3ExprDelete(tls, db, pX)
- (*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(p)).FaCol + uintptr(ii)*20)).FpDflt = Xsqlite3ExprAlloc(tls, db, TK_NULL, uintptr(0), 0)
+ Xsqlite3ColumnSetExpr(tls, pParse, p, (*Table)(unsafe.Pointer(p)).FaCol+uintptr(ii)*16,
+ Xsqlite3ExprAlloc(tls, db, TK_NULL, uintptr(0), 0))
}
} else {
nNG++
}
}
if nNG == 0 {
- Xsqlite3ErrorMsg(tls, pParse, ts+11669 /* "must have at lea..." */, 0)
+ Xsqlite3ErrorMsg(tls, pParse, ts+12852 /* "must have at lea..." */, 0)
return
}
}
@@ -95232,14 +96668,14 @@ func Xsqlite3EndTable(tls *libc.TLS, pParse uintptr, pCons uintptr, pEnd uintptr
Xsqlite3VdbeAddOp1(tls, v, OP_Close, 0)
// Initialize zType for the new view or table.
- if (*Table)(unsafe.Pointer(p)).FpSelect == uintptr(0) {
+ if int32((*Table)(unsafe.Pointer(p)).FeTabType) == TABTYP_NORM {
// A regular table
- zType = ts + 7823 /* "table" */
- zType2 = ts + 11713 /* "TABLE" */
+ zType = ts + 8739 /* "table" */
+ zType2 = ts + 12896 /* "TABLE" */
} else {
// A view
- zType = ts + 9208 /* "view" */
- zType2 = ts + 11719 /* "VIEW" */
+ zType = ts + 10358 /* "view" */
+ zType2 = ts + 12902 /* "VIEW" */
}
// If this is a CREATE TABLE xx AS SELECT ..., execute the SELECT
@@ -95255,7 +96691,7 @@ func Xsqlite3EndTable(tls *libc.TLS, pParse uintptr, pCons uintptr, pEnd uintptr
// a schema-lock excludes all other database users, the write-lock would
// be redundant.
if pSelect != 0 {
- // var dest SelectDest at bp+104, 28
+ // var dest SelectDest at bp+144, 28
// Where the SELECT should store results
var regYield int32 // Register holding co-routine entry-point
var addrTop int32 // Top of the co-routine
@@ -95272,7 +96708,7 @@ func Xsqlite3EndTable(tls *libc.TLS, pParse uintptr, pCons uintptr, pEnd uintptr
Xsqlite3VdbeAddOp3(tls, v, OP_OpenWrite, 1, (*Parse)(unsafe.Pointer(pParse)).FregRoot, iDb)
Xsqlite3VdbeChangeP5(tls, v, uint16(OPFLAG_P2ISREG))
(*Parse)(unsafe.Pointer(pParse)).FnTab = 2
- addrTop = (Xsqlite3VdbeCurrentAddr(tls, v) + 1)
+ addrTop = Xsqlite3VdbeCurrentAddr(tls, v) + 1
Xsqlite3VdbeAddOp3(tls, v, OP_InitCoroutine, regYield, 0, addrTop)
if (*Parse)(unsafe.Pointer(pParse)).FnErr != 0 {
return
@@ -95282,21 +96718,21 @@ func Xsqlite3EndTable(tls *libc.TLS, pParse uintptr, pCons uintptr, pEnd uintptr
return
}
- (*Table)(unsafe.Pointer(p)).FnCol = libc.AssignPtrInt16(p+44 /* &.nNVCol */, (*Table)(unsafe.Pointer(pSelTab)).FnCol)
+ (*Table)(unsafe.Pointer(p)).FnCol = libc.AssignPtrInt16(p+36, (*Table)(unsafe.Pointer(pSelTab)).FnCol)
(*Table)(unsafe.Pointer(p)).FaCol = (*Table)(unsafe.Pointer(pSelTab)).FaCol
(*Table)(unsafe.Pointer(pSelTab)).FnCol = int16(0)
(*Table)(unsafe.Pointer(pSelTab)).FaCol = uintptr(0)
Xsqlite3DeleteTable(tls, db, pSelTab)
- Xsqlite3SelectDestInit(tls, bp+104 /* &dest */, SRT_Coroutine, regYield)
- Xsqlite3Select(tls, pParse, pSelect, bp+104 /* &dest */)
+ Xsqlite3SelectDestInit(tls, bp+144 /* &dest */, SRT_Coroutine, regYield)
+ Xsqlite3Select(tls, pParse, pSelect, bp+144 /* &dest */)
if (*Parse)(unsafe.Pointer(pParse)).FnErr != 0 {
return
}
Xsqlite3VdbeEndCoroutine(tls, v, regYield)
- Xsqlite3VdbeJumpHere(tls, v, (addrTop - 1))
- addrInsLoop = Xsqlite3VdbeAddOp1(tls, v, OP_Yield, (*SelectDest)(unsafe.Pointer(bp+104 /* &dest */)).FiSDParm)
+ Xsqlite3VdbeJumpHere(tls, v, addrTop-1)
+ addrInsLoop = Xsqlite3VdbeAddOp1(tls, v, OP_Yield, (*SelectDest)(unsafe.Pointer(bp+144 /* &dest */)).FiSDParm)
- Xsqlite3VdbeAddOp3(tls, v, OP_MakeRecord, (*SelectDest)(unsafe.Pointer(bp+104 /* &dest */)).FiSdst, (*SelectDest)(unsafe.Pointer(bp+104 /* &dest */)).FnSdst, regRec)
+ Xsqlite3VdbeAddOp3(tls, v, OP_MakeRecord, (*SelectDest)(unsafe.Pointer(bp+144 /* &dest */)).FiSdst, (*SelectDest)(unsafe.Pointer(bp+144 /* &dest */)).FnSdst, regRec)
Xsqlite3TableAffinity(tls, v, p, 0)
Xsqlite3VdbeAddOp2(tls, v, OP_NewRowid, 1, regRowid)
Xsqlite3VdbeAddOp3(tls, v, OP_Insert, 1, regRec, regRowid)
@@ -95311,16 +96747,16 @@ func Xsqlite3EndTable(tls *libc.TLS, pParse uintptr, pCons uintptr, pEnd uintptr
} else {
var pEnd2 uintptr
if tabOpts != 0 {
- pEnd2 = (pParse + 188 /* &.sLastToken */)
+ pEnd2 = pParse + 184
} else {
pEnd2 = pEnd
}
- n = ((int32((*Token)(unsafe.Pointer(pEnd2)).Fz) - int32((*Parse)(unsafe.Pointer(pParse)).FsNameToken.Fz)) / 1)
+ n = (int32((*Token)(unsafe.Pointer(pEnd2)).Fz) - int32((*Parse)(unsafe.Pointer(pParse)).FsNameToken.Fz)) / 1
if int32(*(*uint8)(unsafe.Pointer((*Token)(unsafe.Pointer(pEnd2)).Fz))) != ';' {
- n = int32(uint32(n) + ((*Token)(unsafe.Pointer(pEnd2)).Fn))
+ n = int32(uint32(n) + (*Token)(unsafe.Pointer(pEnd2)).Fn)
}
zStmt = Xsqlite3MPrintf(tls, db,
- ts+11724 /* "CREATE %s %.*s" */, libc.VaList(bp+8, zType2, n, (*Parse)(unsafe.Pointer(pParse)).FsNameToken.Fz))
+ ts+12907 /* "CREATE %s %.*s" */, libc.VaList(bp+48, zType2, n, (*Parse)(unsafe.Pointer(pParse)).FsNameToken.Fz))
}
// A slot for the record has already been allocated in the
@@ -95328,8 +96764,8 @@ func Xsqlite3EndTable(tls *libc.TLS, pParse uintptr, pCons uintptr, pEnd uintptr
// the information we've collected.
Xsqlite3NestedParse(tls, pParse,
- ts+11739, /* "UPDATE %Q.sqlite..." */
- libc.VaList(bp+32, (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+uintptr(iDb)*16)).FzDbSName,
+ ts+12922, /* "UPDATE %Q.sqlite..." */
+ libc.VaList(bp+72, (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+uintptr(iDb)*16)).FzDbSName,
zType,
(*Table)(unsafe.Pointer(p)).FzName,
(*Table)(unsafe.Pointer(p)).FzName,
@@ -95341,19 +96777,19 @@ func Xsqlite3EndTable(tls *libc.TLS, pParse uintptr, pCons uintptr, pEnd uintptr
// Check to see if we need to create an sqlite_sequence table for
// keeping track of autoincrement keys.
- if (((*Table)(unsafe.Pointer(p)).FtabFlags & U32(TF_Autoincrement)) != U32(0)) && !(int32((*Parse)(unsafe.Pointer(pParse)).FeParseMode) != PARSE_MODE_NORMAL) {
- var pDb uintptr = ((*Sqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*16)
+ if (*Table)(unsafe.Pointer(p)).FtabFlags&U32(TF_Autoincrement) != U32(0) && !(int32((*Parse)(unsafe.Pointer(pParse)).FeParseMode) != PARSE_MODE_NORMAL) {
+ var pDb uintptr = (*Sqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*16
if (*Schema)(unsafe.Pointer((*Db)(unsafe.Pointer(pDb)).FpSchema)).FpSeqTab == uintptr(0) {
Xsqlite3NestedParse(tls, pParse,
- ts+11837, /* "CREATE TABLE %Q...." */
- libc.VaList(bp+88, (*Db)(unsafe.Pointer(pDb)).FzDbSName))
+ ts+13020, /* "CREATE TABLE %Q...." */
+ libc.VaList(bp+128, (*Db)(unsafe.Pointer(pDb)).FzDbSName))
}
}
// Reparse everything to update our internal data structures
Xsqlite3VdbeAddParseSchemaOp(tls, v, iDb,
- Xsqlite3MPrintf(tls, db, ts+11879 /* "tbl_name='%q' AN..." */, libc.VaList(bp+96, (*Table)(unsafe.Pointer(p)).FzName)), uint16(0))
+ Xsqlite3MPrintf(tls, db, ts+13062 /* "tbl_name='%q' AN..." */, libc.VaList(bp+136, (*Table)(unsafe.Pointer(p)).FzName)), uint16(0))
}
// Add the table to the in-memory representation of the database.
@@ -95361,36 +96797,36 @@ func Xsqlite3EndTable(tls *libc.TLS, pParse uintptr, pCons uintptr, pEnd uintptr
var pOld uintptr
var pSchema uintptr = (*Table)(unsafe.Pointer(p)).FpSchema
- pOld = Xsqlite3HashInsert(tls, (pSchema + 8 /* &.tblHash */), (*Table)(unsafe.Pointer(p)).FzName, p)
+ pOld = Xsqlite3HashInsert(tls, pSchema+8, (*Table)(unsafe.Pointer(p)).FzName, p)
if pOld != 0 {
// Malloc must have failed inside HashInsert()
Xsqlite3OomFault(tls, db)
return
}
(*Parse)(unsafe.Pointer(pParse)).FpNewTable = uintptr(0)
- *(*U32)(unsafe.Pointer(db + 24 /* &.mDbFlags */)) |= (U32(DBFLAG_SchemaChange))
+ *(*U32)(unsafe.Pointer(db + 24)) |= U32(DBFLAG_SchemaChange)
// 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, (*Table)(unsafe.Pointer(p)).FzName, ts+8345 /* "sqlite_sequence" */) == 0 {
+ if libc.Xstrcmp(tls, (*Table)(unsafe.Pointer(p)).FzName, ts+9261) == 0 {
(*Schema)(unsafe.Pointer((*Table)(unsafe.Pointer(p)).FpSchema)).FpSeqTab = p
}
}
- if !(pSelect != 0) && !(int32((*Table)(unsafe.Pointer(p)).FpSelect) != 0) {
+ if !(pSelect != 0) && int32((*Table)(unsafe.Pointer(p)).FeTabType) == TABTYP_NORM {
if (*Token)(unsafe.Pointer(pCons)).Fz == uintptr(0) {
pCons = pEnd
}
- (*Table)(unsafe.Pointer(p)).FaddColOffset = (13 + ((int32((*Token)(unsafe.Pointer(pCons)).Fz) - int32((*Parse)(unsafe.Pointer(pParse)).FsNameToken.Fz)) / 1))
+ *(*int32)(unsafe.Pointer(p + 44)) = 13 + (int32((*Token)(unsafe.Pointer(pCons)).Fz)-int32((*Parse)(unsafe.Pointer(pParse)).FsNameToken.Fz))/1
}
}
// The parser calls this routine in order to create a new VIEW
-func Xsqlite3CreateView(tls *libc.TLS, pParse uintptr, pBegin uintptr, pName1 uintptr, pName2 uintptr, pCNames uintptr, pSelect uintptr, isTemp int32, noErr int32) { /* sqlite3.c:115129:21: */
+func Xsqlite3CreateView(tls *libc.TLS, pParse uintptr, pBegin uintptr, pName1 uintptr, pName2 uintptr, pCNames uintptr, pSelect uintptr, isTemp int32, noErr int32) { /* sqlite3.c:115974:21: */
bp := tls.Alloc(64)
defer tls.Free(64)
@@ -95411,13 +96847,13 @@ func Xsqlite3CreateView(tls *libc.TLS, pParse uintptr, pBegin uintptr, pName1 ui
if !(int32((*Parse)(unsafe.Pointer(pParse)).FnVar) > 0) {
goto __1
}
- Xsqlite3ErrorMsg(tls, pParse, ts+11913 /* "parameters are n..." */, 0)
+ Xsqlite3ErrorMsg(tls, pParse, ts+13096 /* "parameters are n..." */, 0)
goto create_view_fail
__1:
;
Xsqlite3StartTable(tls, pParse, pName1, pName2, isTemp, 1, 0, noErr)
p = (*Parse)(unsafe.Pointer(pParse)).FpNewTable
- if !((p == uintptr(0)) || ((*Parse)(unsafe.Pointer(pParse)).FnErr != 0)) {
+ if !(p == uintptr(0) || (*Parse)(unsafe.Pointer(pParse)).FnErr != 0) {
goto __2
}
goto create_view_fail
@@ -95429,12 +96865,12 @@ __2:
// setting fixes this problem. But the fix can be disabled by compiling
// with -DSQLITE_ALLOW_ROWID_IN_VIEW in case there are legacy apps that
// depend upon the old buggy behavior.
- *(*U32)(unsafe.Pointer(p + 36 /* &.tabFlags */)) |= (U32(TF_NoVisibleRowid))
+ *(*U32)(unsafe.Pointer(p + 28)) |= U32(TF_NoVisibleRowid)
Xsqlite3TwoPartName(tls, pParse, pName1, pName2, bp /* &pName */)
iDb = Xsqlite3SchemaToIndex(tls, db, (*Table)(unsafe.Pointer(p)).FpSchema)
- Xsqlite3FixInit(tls, bp+4 /* &sFix */, pParse, iDb, ts+9208 /* "view" */, *(*uintptr)(unsafe.Pointer(bp /* pName */)))
- if !(Xsqlite3FixSelect(tls, bp+4 /* &sFix */, pSelect) != 0) {
+ Xsqlite3FixInit(tls, bp+4 /* &sFix */, pParse, iDb, ts+10358 /* "view" */, *(*uintptr)(unsafe.Pointer(bp /* pName */)))
+ if !(Xsqlite3FixSelect(tls, bp+4, pSelect) != 0) {
goto __3
}
goto create_view_fail
@@ -95445,18 +96881,19 @@ __3:
// This will force all the Expr.token.z values to be dynamically
// allocated rather than point to the input string - which means that
// they will persist after the current sqlite3_exec() call returns.
- *(*U32)(unsafe.Pointer(pSelect + 4 /* &.selFlags */)) |= (U32(SF_View))
+ *(*U32)(unsafe.Pointer(pSelect + 4)) |= U32(SF_View)
if !(int32((*Parse)(unsafe.Pointer(pParse)).FeParseMode) >= PARSE_MODE_RENAME) {
goto __4
}
- (*Table)(unsafe.Pointer(p)).FpSelect = pSelect
+ *(*uintptr)(unsafe.Pointer(p + 44)) = pSelect
pSelect = uintptr(0)
goto __5
__4:
- (*Table)(unsafe.Pointer(p)).FpSelect = Xsqlite3SelectDup(tls, db, pSelect, EXPRDUP_REDUCE)
+ *(*uintptr)(unsafe.Pointer(p + 44)) = Xsqlite3SelectDup(tls, db, pSelect, EXPRDUP_REDUCE)
__5:
;
(*Table)(unsafe.Pointer(p)).FpCheck = Xsqlite3ExprListDup(tls, db, pCNames, EXPRDUP_REDUCE)
+ (*Table)(unsafe.Pointer(p)).FeTabType = U8(TABTYP_VIEW)
if !((*Sqlite3)(unsafe.Pointer(db)).FmallocFailed != 0) {
goto __6
}
@@ -95468,29 +96905,29 @@ __6:
// the end.
*(*Token)(unsafe.Pointer(bp + 56 /* sEnd */)) = (*Parse)(unsafe.Pointer(pParse)).FsLastToken
- if !(int32(*(*uint8)(unsafe.Pointer((*Token)(unsafe.Pointer(bp + 56 /* &sEnd */)).Fz))) != ';') {
+ if !(int32(*(*uint8)(unsafe.Pointer((*Token)(unsafe.Pointer(bp + 56)).Fz))) != ';') {
goto __7
}
- *(*uintptr)(unsafe.Pointer(bp + 56 /* &sEnd */ /* &.z */)) += (uintptr((*Token)(unsafe.Pointer(bp + 56 /* &sEnd */)).Fn))
+ *(*uintptr)(unsafe.Pointer(bp + 56)) += uintptr((*Token)(unsafe.Pointer(bp + 56)).Fn)
__7:
;
(*Token)(unsafe.Pointer(bp + 56 /* &sEnd */)).Fn = uint32(0)
- n = ((int32((*Token)(unsafe.Pointer(bp+56 /* &sEnd */)).Fz) - int32((*Token)(unsafe.Pointer(pBegin)).Fz)) / 1)
+ n = (int32((*Token)(unsafe.Pointer(bp+56)).Fz) - int32((*Token)(unsafe.Pointer(pBegin)).Fz)) / 1
z = (*Token)(unsafe.Pointer(pBegin)).Fz
__8:
- if !((int32(Xsqlite3CtypeMap[uint8(*(*uint8)(unsafe.Pointer(z + uintptr((n - 1)))))]) & 0x01) != 0) {
+ if !(int32(Xsqlite3CtypeMap[uint8(*(*uint8)(unsafe.Pointer(z + uintptr(n-1))))])&0x01 != 0) {
goto __9
}
n--
goto __8
__9:
;
- (*Token)(unsafe.Pointer(bp + 56 /* &sEnd */)).Fz = (z + uintptr((n - 1)))
+ (*Token)(unsafe.Pointer(bp + 56 /* &sEnd */)).Fz = z + uintptr(n-1)
(*Token)(unsafe.Pointer(bp + 56 /* &sEnd */)).Fn = uint32(1)
// Use sqlite3EndTable() to add the view to the schema table
- Xsqlite3EndTable(tls, pParse, uintptr(0), bp+56 /* &sEnd */, uint8(0), uintptr(0))
+ Xsqlite3EndTable(tls, pParse, uintptr(0), bp+56 /* &sEnd */, uint32(0), uintptr(0))
create_view_fail:
Xsqlite3SelectDelete(tls, db, pSelect)
@@ -95507,7 +96944,7 @@ __10:
// The Table structure pTable is really a VIEW. Fill in the names of
// the columns of the view in the pTable structure. Return the number
// of errors. If an error is seen leave an error message in pParse->zErrMsg.
-func Xsqlite3ViewGetColumnNames(tls *libc.TLS, pParse uintptr, pTable uintptr) int32 { /* sqlite3.c:115220:20: */
+func Xsqlite3ViewGetColumnNames(tls *libc.TLS, pParse uintptr, pTable uintptr) int32 { /* sqlite3.c:116066:20: */
bp := tls.Alloc(8)
defer tls.Free(8)
@@ -95519,14 +96956,11 @@ func Xsqlite3ViewGetColumnNames(tls *libc.TLS, pParse uintptr, pTable uintptr) i
var rc int32
var xAuth Sqlite3_xauth // Saved xAuth pointer
- (*Sqlite3)(unsafe.Pointer(db)).FnSchemaLock++
- rc = Xsqlite3VtabCallConnect(tls, pParse, pTable)
- (*Sqlite3)(unsafe.Pointer(db)).FnSchemaLock--
- if rc != 0 {
- return 1
- }
- if (*Table)(unsafe.Pointer(pTable)).FnModuleArg != 0 {
- return 0
+ if int32((*Table)(unsafe.Pointer(pTable)).FeTabType) == TABTYP_VTAB {
+ (*Sqlite3)(unsafe.Pointer(db)).FnSchemaLock++
+ rc = Xsqlite3VtabCallConnect(tls, pParse, pTable)
+ (*Sqlite3)(unsafe.Pointer(db)).FnSchemaLock--
+ return rc
}
// A positive nCol means the columns names for this view are
@@ -95550,7 +96984,7 @@ func Xsqlite3ViewGetColumnNames(tls *libc.TLS, pParse uintptr, pTable uintptr) i
// CREATE TEMP VIEW ex1 AS SELECT a FROM ex1;
// SELECT * FROM temp.ex1;
if int32((*Table)(unsafe.Pointer(pTable)).FnCol) < 0 {
- Xsqlite3ErrorMsg(tls, pParse, ts+11949 /* "view %s is circu..." */, libc.VaList(bp, (*Table)(unsafe.Pointer(pTable)).FzName))
+ Xsqlite3ErrorMsg(tls, pParse, ts+13132 /* "view %s is circu..." */, libc.VaList(bp, (*Table)(unsafe.Pointer(pTable)).FzName))
return 1
}
@@ -95561,7 +96995,7 @@ func Xsqlite3ViewGetColumnNames(tls *libc.TLS, pParse uintptr, pTable uintptr) i
// to be permanent. So the computation is done on a copy of the SELECT
// statement that defines the view.
- pSel = Xsqlite3SelectDup(tls, db, (*Table)(unsafe.Pointer(pTable)).FpSelect, 0)
+ pSel = Xsqlite3SelectDup(tls, db, *(*uintptr)(unsafe.Pointer(pTable + 44)), 0)
if pSel != 0 {
var eParseMode U8 = (*Parse)(unsafe.Pointer(pParse)).FeParseMode
(*Parse)(unsafe.Pointer(pParse)).FeParseMode = U8(PARSE_MODE_NORMAL)
@@ -95585,10 +97019,10 @@ func Xsqlite3ViewGetColumnNames(tls *libc.TLS, pParse uintptr, pTable uintptr) i
// normally holds CHECK constraints on an ordinary table, but for
// a VIEW it holds the list of column names.
Xsqlite3ColumnsFromExprList(tls, pParse, (*Table)(unsafe.Pointer(pTable)).FpCheck,
- (pTable + 42 /* &.nCol */), (pTable + 4 /* &.aCol */))
- if ((int32((*Sqlite3)(unsafe.Pointer(db)).FmallocFailed) == 0) &&
- ((*Parse)(unsafe.Pointer(pParse)).FnErr == 0)) &&
- (int32((*Table)(unsafe.Pointer(pTable)).FnCol) == (*ExprList)(unsafe.Pointer((*Select)(unsafe.Pointer(pSel)).FpEList)).FnExpr) {
+ pTable+34, pTable+4)
+ if int32((*Sqlite3)(unsafe.Pointer(db)).FmallocFailed) == 0 &&
+ (*Parse)(unsafe.Pointer(pParse)).FnErr == 0 &&
+ int32((*Table)(unsafe.Pointer(pTable)).FnCol) == (*ExprList)(unsafe.Pointer((*Select)(unsafe.Pointer(pSel)).FpEList)).FnExpr {
Xsqlite3SelectAddColumnTypeAndCollation(tls, pParse, pTable, pSel,
uint8(SQLITE_AFF_NONE))
}
@@ -95598,7 +97032,7 @@ func Xsqlite3ViewGetColumnNames(tls *libc.TLS, pParse uintptr, pTable uintptr) i
(*Table)(unsafe.Pointer(pTable)).FnCol = (*Table)(unsafe.Pointer(pSelTab)).FnCol
(*Table)(unsafe.Pointer(pTable)).FaCol = (*Table)(unsafe.Pointer(pSelTab)).FaCol
- *(*U32)(unsafe.Pointer(pTable + 36 /* &.tabFlags */)) |= ((*Table)(unsafe.Pointer(pSelTab)).FtabFlags & U32(COLFLAG_NOINSERT))
+ *(*U32)(unsafe.Pointer(pTable + 28)) |= (*Table)(unsafe.Pointer(pSelTab)).FtabFlags & U32(COLFLAG_NOINSERT)
(*Table)(unsafe.Pointer(pSelTab)).FnCol = int16(0)
(*Table)(unsafe.Pointer(pSelTab)).FaCol = uintptr(0)
@@ -95617,31 +97051,27 @@ func Xsqlite3ViewGetColumnNames(tls *libc.TLS, pParse uintptr, pTable uintptr) i
} else {
nErr++
}
- *(*U16)(unsafe.Pointer((*Table)(unsafe.Pointer(pTable)).FpSchema + 78 /* &.schemaFlags */)) |= U16((DB_UnresetViews))
+ *(*U16)(unsafe.Pointer((*Table)(unsafe.Pointer(pTable)).FpSchema + 78)) |= U16(DB_UnresetViews)
if (*Sqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 {
Xsqlite3DeleteColumnNames(tls, db, pTable)
- (*Table)(unsafe.Pointer(pTable)).FaCol = uintptr(0)
- (*Table)(unsafe.Pointer(pTable)).FnCol = int16(0)
}
return nErr
}
// Clear the column names from every VIEW in database idx.
-func sqliteViewResetAll(tls *libc.TLS, db uintptr, idx int32) { /* sqlite3.c:115351:13: */
+func sqliteViewResetAll(tls *libc.TLS, db uintptr, idx int32) { /* sqlite3.c:116194:13: */
var i uintptr
- if !((int32((*Schema)(unsafe.Pointer((*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer((db))).FaDb+uintptr(idx)*16)).FpSchema)).FschemaFlags) & (DB_UnresetViews)) == (DB_UnresetViews)) {
+ if !(int32((*Schema)(unsafe.Pointer((*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+uintptr(idx)*16)).FpSchema)).FschemaFlags)&DB_UnresetViews == DB_UnresetViews) {
return
}
- for i = (*Hash)(unsafe.Pointer(((*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+uintptr(idx)*16)).FpSchema + 8 /* &.tblHash */))).Ffirst; i != 0; i = (*HashElem)(unsafe.Pointer(i)).Fnext {
+ for i = (*Hash)(unsafe.Pointer((*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+uintptr(idx)*16)).FpSchema + 8)).Ffirst; i != 0; i = (*HashElem)(unsafe.Pointer(i)).Fnext {
var pTab uintptr = (*HashElem)(unsafe.Pointer(i)).Fdata
- if (*Table)(unsafe.Pointer(pTab)).FpSelect != 0 {
+ if int32((*Table)(unsafe.Pointer(pTab)).FeTabType) == TABTYP_VIEW {
Xsqlite3DeleteColumnNames(tls, db, pTab)
- (*Table)(unsafe.Pointer(pTab)).FaCol = uintptr(0)
- (*Table)(unsafe.Pointer(pTab)).FnCol = int16(0)
}
}
- *(*U16)(unsafe.Pointer((*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer((db))).FaDb+uintptr(idx)*16)).FpSchema + 78 /* &.schemaFlags */)) &= libc.Uint16FromInt32((libc.CplInt32(DB_UnresetViews)))
+ *(*U16)(unsafe.Pointer((*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+uintptr(idx)*16)).FpSchema + 78)) &= libc.Uint16FromInt32(libc.CplInt32(DB_UnresetViews))
}
// This function is called by the VDBE to adjust the internal schema
@@ -95659,20 +97089,20 @@ func sqliteViewResetAll(tls *libc.TLS, db uintptr, idx int32) { /* sqlite3.c:115
// We must continue looping until all tables and indices with
// rootpage==iFrom have been converted to have a rootpage of iTo
// in order to be certain that we got the right one.
-func Xsqlite3RootPageMoved(tls *libc.TLS, db uintptr, iDb int32, iFrom Pgno, iTo Pgno) { /* sqlite3.c:115387:21: */
+func Xsqlite3RootPageMoved(tls *libc.TLS, db uintptr, iDb int32, iFrom Pgno, iTo Pgno) { /* sqlite3.c:116228:21: */
var pElem uintptr
var pHash uintptr
var pDb uintptr
- pDb = ((*Sqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*16)
- pHash = ((*Db)(unsafe.Pointer(pDb)).FpSchema + 8 /* &.tblHash */)
+ pDb = (*Sqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*16
+ pHash = (*Db)(unsafe.Pointer(pDb)).FpSchema + 8
for pElem = (*Hash)(unsafe.Pointer(pHash)).Ffirst; pElem != 0; pElem = (*HashElem)(unsafe.Pointer(pElem)).Fnext {
var pTab uintptr = (*HashElem)(unsafe.Pointer(pElem)).Fdata
if (*Table)(unsafe.Pointer(pTab)).Ftnum == iFrom {
(*Table)(unsafe.Pointer(pTab)).Ftnum = iTo
}
}
- pHash = ((*Db)(unsafe.Pointer(pDb)).FpSchema + 24 /* &.idxHash */)
+ pHash = (*Db)(unsafe.Pointer(pDb)).FpSchema + 24
for pElem = (*Hash)(unsafe.Pointer(pHash)).Ffirst; pElem != 0; pElem = (*HashElem)(unsafe.Pointer(pElem)).Fnext {
var pIdx uintptr = (*HashElem)(unsafe.Pointer(pElem)).Fdata
if (*Index)(unsafe.Pointer(pIdx)).Ftnum == iFrom {
@@ -95685,14 +97115,14 @@ func Xsqlite3RootPageMoved(tls *libc.TLS, db uintptr, iDb int32, iFrom Pgno, iTo
// Also write code to modify the sqlite_schema table and internal schema
// if a root-page of another table is moved by the btree-layer whilst
// erasing iTable (this can happen with an auto-vacuum database).
-func destroyRootPage(tls *libc.TLS, pParse uintptr, iTable int32, iDb int32) { /* sqlite3.c:115417:13: */
+func destroyRootPage(tls *libc.TLS, pParse uintptr, iTable int32, iDb int32) { /* sqlite3.c:116258:13: */
bp := tls.Alloc(32)
defer tls.Free(32)
var v uintptr = Xsqlite3GetVdbe(tls, pParse)
var r1 int32 = Xsqlite3GetTempReg(tls, pParse)
if iTable < 2 {
- Xsqlite3ErrorMsg(tls, pParse, ts+11979 /* "corrupt schema" */, 0)
+ Xsqlite3ErrorMsg(tls, pParse, ts+13162 /* "corrupt schema" */, 0)
}
Xsqlite3VdbeAddOp3(tls, v, OP_Destroy, iTable, r1, iDb)
Xsqlite3MayAbort(tls, pParse)
@@ -95706,7 +97136,7 @@ func destroyRootPage(tls *libc.TLS, pParse uintptr, iTable int32, iDb int32) { /
// token for additional information.
Xsqlite3NestedParse(tls, pParse,
- ts+11994, /* "UPDATE %Q.sqlite..." */
+ ts+13177, /* "UPDATE %Q.sqlite..." */
libc.VaList(bp, (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer((*Parse)(unsafe.Pointer(pParse)).Fdb)).FaDb+uintptr(iDb)*16)).FzDbSName, iTable, r1, r1))
Xsqlite3ReleaseTempReg(tls, pParse, r1)
}
@@ -95715,7 +97145,7 @@ func destroyRootPage(tls *libc.TLS, pParse uintptr, iTable int32, iDb int32) { /
// Code to update the sqlite_schema tables and internal schema definitions
// in case a root-page belonging to another table is moved by the btree layer
// is also added (this can happen with an auto-vacuum database).
-func destroyTable(tls *libc.TLS, pParse uintptr, pTab uintptr) { /* sqlite3.c:115447:13: */
+func destroyTable(tls *libc.TLS, pParse uintptr, pTab uintptr) { /* sqlite3.c:116288:13: */
// If the database may be auto-vacuum capable (if SQLITE_OMIT_AUTOVACUUM
// is not defined), then it is important to call OP_Destroy on the
// table and index root-pages in order, starting with the numerically
@@ -95738,13 +97168,13 @@ func destroyTable(tls *libc.TLS, pParse uintptr, pTab uintptr) { /* sqlite3.c:11
var pIdx uintptr
var iLargest Pgno = Pgno(0)
- if (iDestroyed == Pgno(0)) || (iTab < iDestroyed) {
+ if iDestroyed == Pgno(0) || iTab < iDestroyed {
iLargest = iTab
}
for pIdx = (*Table)(unsafe.Pointer(pTab)).FpIndex; pIdx != 0; pIdx = (*Index)(unsafe.Pointer(pIdx)).FpNext {
var iIdx Pgno = (*Index)(unsafe.Pointer(pIdx)).Ftnum
- if ((iDestroyed == Pgno(0)) || (iIdx < iDestroyed)) && (iIdx > iLargest) {
+ if (iDestroyed == Pgno(0) || iIdx < iDestroyed) && iIdx > iLargest {
iLargest = iIdx
}
}
@@ -95761,7 +97191,7 @@ func destroyTable(tls *libc.TLS, pParse uintptr, pTab uintptr) { /* sqlite3.c:11
// Remove entries from the sqlite_statN tables (for N in (1,2,3))
// after a DROP INDEX or DROP TABLE command.
-func sqlite3ClearStatTables(tls *libc.TLS, pParse uintptr, iDb int32, zType uintptr, zName uintptr) { /* sqlite3.c:115496:13: */
+func sqlite3ClearStatTables(tls *libc.TLS, pParse uintptr, iDb int32, zType uintptr, zName uintptr) { /* sqlite3.c:116337:13: */
bp := tls.Alloc(64)
defer tls.Free(64)
@@ -95770,30 +97200,30 @@ func sqlite3ClearStatTables(tls *libc.TLS, pParse uintptr, iDb int32, zType uint
for i = 1; i <= 4; i++ {
// var zTab [24]uint8 at bp+40, 24
- Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([24]uint8{})), bp+40 /* &zTab[0] */, ts+12061 /* "sqlite_stat%d" */, libc.VaList(bp, i))
- if Xsqlite3FindTable(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, bp+40 /* &zTab[0] */, zDbName) != 0 {
+ Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([24]uint8{})), bp+40 /* &zTab[0] */, ts+13244 /* "sqlite_stat%d" */, libc.VaList(bp, i))
+ if Xsqlite3FindTable(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, bp+40, zDbName) != 0 {
Xsqlite3NestedParse(tls, pParse,
- ts+10024, /* "DELETE FROM %Q.%..." */
+ ts+11138, /* "DELETE FROM %Q.%..." */
libc.VaList(bp+8, zDbName, bp+40 /* &zTab[0] */, zType, zName))
}
}
}
// Generate code to drop a table.
-func Xsqlite3CodeDropTable(tls *libc.TLS, pParse uintptr, pTab uintptr, iDb int32, isView int32) { /* sqlite3.c:115519:21: */
+func Xsqlite3CodeDropTable(tls *libc.TLS, pParse uintptr, pTab uintptr, iDb int32, isView int32) { /* sqlite3.c:116360:21: */
bp := tls.Alloc(32)
defer tls.Free(32)
var v uintptr
var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb
var pTrigger uintptr
- var pDb uintptr = ((*Sqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*16)
+ var pDb uintptr = (*Sqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*16
v = Xsqlite3GetVdbe(tls, pParse)
Xsqlite3BeginWriteOperation(tls, pParse, 1, iDb)
- if (*Table)(unsafe.Pointer(pTab)).FnModuleArg != 0 {
+ if int32((*Table)(unsafe.Pointer(pTab)).FeTabType) == TABTYP_VTAB {
Xsqlite3VdbeAddOp0(tls, v, OP_VBegin)
}
@@ -95811,9 +97241,9 @@ func Xsqlite3CodeDropTable(tls *libc.TLS, pParse uintptr, pTab uintptr, iDb int3
// the table being dropped. This is done before the table is dropped
// at the btree level, in case the sqlite_sequence table needs to
// move as a result of the drop (can happen in auto-vacuum mode).
- if ((*Table)(unsafe.Pointer(pTab)).FtabFlags & U32(TF_Autoincrement)) != 0 {
+ if (*Table)(unsafe.Pointer(pTab)).FtabFlags&U32(TF_Autoincrement) != 0 {
Xsqlite3NestedParse(tls, pParse,
- ts+12075, /* "DELETE FROM %Q.s..." */
+ ts+13258, /* "DELETE FROM %Q.s..." */
libc.VaList(bp, (*Db)(unsafe.Pointer(pDb)).FzDbSName, (*Table)(unsafe.Pointer(pTab)).FzName))
}
@@ -95825,15 +97255,15 @@ func Xsqlite3CodeDropTable(tls *libc.TLS, pParse uintptr, pTab uintptr, iDb int3
// database.
Xsqlite3NestedParse(tls, pParse,
- ts+12120, /* "DELETE FROM %Q.s..." */
+ ts+13303, /* "DELETE FROM %Q.s..." */
libc.VaList(bp+16, (*Db)(unsafe.Pointer(pDb)).FzDbSName, (*Table)(unsafe.Pointer(pTab)).FzName))
- if !(isView != 0) && !((*Table)(unsafe.Pointer(pTab)).FnModuleArg != 0) {
+ if !(isView != 0) && !(int32((*Table)(unsafe.Pointer(pTab)).FeTabType) == TABTYP_VTAB) {
destroyTable(tls, pParse, pTab)
}
// Remove the table entry from SQLite's internal schema and modify
// the schema cookie.
- if (*Table)(unsafe.Pointer(pTab)).FnModuleArg != 0 {
+ if int32((*Table)(unsafe.Pointer(pTab)).FeTabType) == TABTYP_VTAB {
Xsqlite3VdbeAddOp4(tls, v, OP_VDestroy, iDb, 0, 0, (*Table)(unsafe.Pointer(pTab)).FzName, 0)
Xsqlite3MayAbort(tls, pParse)
}
@@ -95844,27 +97274,31 @@ func Xsqlite3CodeDropTable(tls *libc.TLS, pParse uintptr, pTab uintptr, iDb int3
// Return TRUE if shadow tables should be read-only in the current
// context.
-func Xsqlite3ReadOnlyShadowTables(tls *libc.TLS, db uintptr) int32 { /* sqlite3.c:115592:20: */
- if ((((*Sqlite3)(unsafe.Pointer(db)).Fflags & uint64(SQLITE_Defensive)) != uint64(0)) &&
- ((*Sqlite3)(unsafe.Pointer(db)).FpVtabCtx == uintptr(0))) &&
- ((*Sqlite3)(unsafe.Pointer(db)).FnVdbeExec == 0) {
+func Xsqlite3ReadOnlyShadowTables(tls *libc.TLS, db uintptr) int32 { /* sqlite3.c:116433:20: */
+ if (*Sqlite3)(unsafe.Pointer(db)).Fflags&uint64(SQLITE_Defensive) != uint64(0) &&
+ (*Sqlite3)(unsafe.Pointer(db)).FpVtabCtx == uintptr(0) &&
+ (*Sqlite3)(unsafe.Pointer(db)).FnVdbeExec == 0 &&
+ !((*Sqlite3)(unsafe.Pointer(db)).FnVTrans > 0 && (*Sqlite3)(unsafe.Pointer(db)).FaVTrans == uintptr(0)) {
return 1
}
return 0
}
// Return true if it is not allowed to drop the given table
-func tableMayNotBeDropped(tls *libc.TLS, db uintptr, pTab uintptr) int32 { /* sqlite3.c:115607:12: */
- if Xsqlite3_strnicmp(tls, (*Table)(unsafe.Pointer(pTab)).FzName, ts+7081 /* "sqlite_" */, 7) == 0 {
- if Xsqlite3_strnicmp(tls, ((*Table)(unsafe.Pointer(pTab)).FzName+uintptr(7)), ts+2413 /* "stat" */, 4) == 0 {
+func tableMayNotBeDropped(tls *libc.TLS, db uintptr, pTab uintptr) int32 { /* sqlite3.c:116449:12: */
+ if Xsqlite3_strnicmp(tls, (*Table)(unsafe.Pointer(pTab)).FzName, ts+7997, 7) == 0 {
+ if Xsqlite3_strnicmp(tls, (*Table)(unsafe.Pointer(pTab)).FzName+uintptr(7), ts+3224, 4) == 0 {
return 0
}
- if Xsqlite3_strnicmp(tls, ((*Table)(unsafe.Pointer(pTab)).FzName+uintptr(7)), ts+6150 /* "parameters" */, 10) == 0 {
+ if Xsqlite3_strnicmp(tls, (*Table)(unsafe.Pointer(pTab)).FzName+uintptr(7), ts+6997, 10) == 0 {
return 0
}
return 1
}
- if (((*Table)(unsafe.Pointer(pTab)).FtabFlags & U32(TF_Shadow)) != U32(0)) && (Xsqlite3ReadOnlyShadowTables(tls, db) != 0) {
+ if (*Table)(unsafe.Pointer(pTab)).FtabFlags&U32(TF_Shadow) != U32(0) && Xsqlite3ReadOnlyShadowTables(tls, db) != 0 {
+ return 1
+ }
+ if (*Table)(unsafe.Pointer(pTab)).FtabFlags&U32(TF_Eponymous) != 0 {
return 1
}
return 0
@@ -95872,7 +97306,7 @@ func tableMayNotBeDropped(tls *libc.TLS, db uintptr, pTab uintptr) int32 { /* sq
// This routine is called to do the work of a DROP TABLE statement.
// pName is the name of the table to be dropped.
-func Xsqlite3DropTable(tls *libc.TLS, pParse uintptr, pName uintptr, isView int32, noErr int32) { /* sqlite3.c:115623:21: */
+func Xsqlite3DropTable(tls *libc.TLS, pParse uintptr, pName uintptr, isView int32, noErr int32) { /* sqlite3.c:116468:21: */
bp := tls.Alloc(24)
defer tls.Free(24)
@@ -95906,7 +97340,7 @@ __2:
__3:
;
- pTab = Xsqlite3LocateTableItem(tls, pParse, uint32(isView), (pName + 8 /* &.a */))
+ pTab = Xsqlite3LocateTableItem(tls, pParse, uint32(isView), pName+8)
if !(noErr != 0) {
goto __4
}
@@ -95920,7 +97354,7 @@ __4:
if !(noErr != 0) {
goto __6
}
- Xsqlite3CodeVerifyNamedSchema(tls, pParse, (*SrcItem)(unsafe.Pointer((pName + 8 /* &.a */))).FzDatabase)
+ Xsqlite3CodeVerifyNamedSchema(tls, pParse, (*SrcItem)(unsafe.Pointer(pName+8)).FzDatabase)
sqlite3ForceNotReadOnly(tls, pParse)
__6:
;
@@ -95931,7 +97365,7 @@ __5:
// If pTab is a virtual table, call ViewGetColumnNames() to ensure
// it is initialized.
- if !(((*Table)(unsafe.Pointer(pTab)).FnModuleArg != 0) && (Xsqlite3ViewGetColumnNames(tls, pParse, pTab) != 0)) {
+ if !(int32((*Table)(unsafe.Pointer(pTab)).FeTabType) == TABTYP_VTAB && Xsqlite3ViewGetColumnNames(tls, pParse, pTab) != 0) {
goto __7
}
goto exit_drop_table
@@ -95939,10 +97373,10 @@ __7:
;
zTab = func() uintptr {
- if (!(0 != 0)) && (iDb == 1) {
- return ts + 10872 /* "sqlite_temp_mast..." */
+ if !(0 != 0) && iDb == 1 {
+ return ts + 11986
}
- return ts + 4956 /* "sqlite_master" */
+ return ts + 5803
}()
zDb = (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*16)).FzDbSName
zArg2 = uintptr(0)
@@ -95955,7 +97389,7 @@ __8:
if !(isView != 0) {
goto __9
}
- if !(!(0 != 0) && (iDb == 1)) {
+ if !(!(0 != 0) && iDb == 1) {
goto __11
}
code = SQLITE_DROP_TEMP_VIEW
@@ -95966,14 +97400,14 @@ __12:
;
goto __10
__9:
- if !((*Table)(unsafe.Pointer(pTab)).FnModuleArg != 0) {
+ if !(int32((*Table)(unsafe.Pointer(pTab)).FeTabType) == TABTYP_VTAB) {
goto __13
}
code = SQLITE_DROP_VTABLE
zArg2 = (*Module)(unsafe.Pointer((*VTable)(unsafe.Pointer(Xsqlite3GetVTable(tls, db, pTab))).FpMod)).FzName
goto __14
__13:
- if !(!(0 != 0) && (iDb == 1)) {
+ if !(!(0 != 0) && iDb == 1) {
goto __15
}
code = SQLITE_DROP_TEMP_TABLE
@@ -96002,24 +97436,24 @@ __18:
if !(tableMayNotBeDropped(tls, db, pTab) != 0) {
goto __19
}
- Xsqlite3ErrorMsg(tls, pParse, ts+12187 /* "table %s may not..." */, libc.VaList(bp, (*Table)(unsafe.Pointer(pTab)).FzName))
+ Xsqlite3ErrorMsg(tls, pParse, ts+13370 /* "table %s may not..." */, libc.VaList(bp, (*Table)(unsafe.Pointer(pTab)).FzName))
goto exit_drop_table
__19:
;
// Ensure DROP TABLE is not used on a view, and DROP VIEW is not used
// on a table.
- if !((isView != 0) && ((*Table)(unsafe.Pointer(pTab)).FpSelect == uintptr(0))) {
+ if !(isView != 0 && !(int32((*Table)(unsafe.Pointer(pTab)).FeTabType) == TABTYP_VIEW)) {
goto __20
}
- Xsqlite3ErrorMsg(tls, pParse, ts+12215 /* "use DROP TABLE t..." */, libc.VaList(bp+8, (*Table)(unsafe.Pointer(pTab)).FzName))
+ Xsqlite3ErrorMsg(tls, pParse, ts+13398 /* "use DROP TABLE t..." */, libc.VaList(bp+8, (*Table)(unsafe.Pointer(pTab)).FzName))
goto exit_drop_table
__20:
;
- if !(!(isView != 0) && ((*Table)(unsafe.Pointer(pTab)).FpSelect != 0)) {
+ if !(!(isView != 0) && int32((*Table)(unsafe.Pointer(pTab)).FeTabType) == TABTYP_VIEW) {
goto __21
}
- Xsqlite3ErrorMsg(tls, pParse, ts+12249 /* "use DROP VIEW to..." */, libc.VaList(bp+16, (*Table)(unsafe.Pointer(pTab)).FzName))
+ Xsqlite3ErrorMsg(tls, pParse, ts+13432 /* "use DROP VIEW to..." */, libc.VaList(bp+16, (*Table)(unsafe.Pointer(pTab)).FzName))
goto exit_drop_table
__21:
;
@@ -96031,10 +97465,10 @@ __21:
goto __22
}
Xsqlite3BeginWriteOperation(tls, pParse, 1, iDb)
- if !(!(isView != 0)) {
+ if !!(isView != 0) {
goto __23
}
- sqlite3ClearStatTables(tls, pParse, iDb, ts+10216 /* "tbl" */, (*Table)(unsafe.Pointer(pTab)).FzName)
+ sqlite3ClearStatTables(tls, pParse, iDb, ts+11330 /* "tbl" */, (*Table)(unsafe.Pointer(pTab)).FzName)
Xsqlite3FkDropTable(tls, pParse, pName, pTab)
__23:
;
@@ -96060,7 +97494,7 @@ exit_drop_table:
//
// The foreign key is set for IMMEDIATE processing. A subsequent call
// to sqlite3DeferForeignKey() might change this to DEFERRED.
-func Xsqlite3CreateForeignKey(tls *libc.TLS, pParse uintptr, pFromCol uintptr, pTo uintptr, pToCol uintptr, flags int32) { /* sqlite3.c:115743:21: */
+func Xsqlite3CreateForeignKey(tls *libc.TLS, pParse uintptr, pFromCol uintptr, pTo uintptr, pToCol uintptr, flags int32) { /* sqlite3.c:116588:21: */
bp := tls.Alloc(24)
defer tls.Free(24)
@@ -96068,7 +97502,7 @@ func Xsqlite3CreateForeignKey(tls *libc.TLS, pParse uintptr, pFromCol uintptr, p
var pFKey uintptr
var pNextTo uintptr
var p uintptr
- var nByte int32
+ var nByte I64
var i int32
var nCol int32
var z uintptr
@@ -96079,7 +97513,7 @@ func Xsqlite3CreateForeignKey(tls *libc.TLS, pParse uintptr, pFromCol uintptr, p
pFKey = uintptr(0)
p = (*Parse)(unsafe.Pointer(pParse)).FpNewTable
- if !((p == uintptr(0)) || (int32((*Parse)(unsafe.Pointer(pParse)).FeParseMode) == PARSE_MODE_DECLARE_VTAB)) {
+ if !(p == uintptr(0) || int32((*Parse)(unsafe.Pointer(pParse)).FeParseMode) == PARSE_MODE_DECLARE_VTAB) {
goto __1
}
goto fk_end
@@ -96088,31 +97522,31 @@ __1:
if !(pFromCol == uintptr(0)) {
goto __2
}
- iCol = (int32((*Table)(unsafe.Pointer(p)).FnCol) - 1)
+ iCol = int32((*Table)(unsafe.Pointer(p)).FnCol) - 1
if !(iCol < 0) {
goto __4
}
goto fk_end
__4:
;
- if !((pToCol != 0) && ((*ExprList)(unsafe.Pointer(pToCol)).FnExpr != 1)) {
+ if !(pToCol != 0 && (*ExprList)(unsafe.Pointer(pToCol)).FnExpr != 1) {
goto __5
}
Xsqlite3ErrorMsg(tls, pParse,
- ts+12281, /* "foreign key on %..." */
- libc.VaList(bp, (*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(p)).FaCol+uintptr(iCol)*20)).FzName, pTo))
+ ts+13464, /* "foreign key on %..." */
+ libc.VaList(bp, (*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(p)).FaCol+uintptr(iCol)*16)).FzCnName, pTo))
goto fk_end
__5:
;
nCol = 1
goto __3
__2:
- if !((pToCol != 0) && ((*ExprList)(unsafe.Pointer(pToCol)).FnExpr != (*ExprList)(unsafe.Pointer(pFromCol)).FnExpr)) {
+ if !(pToCol != 0 && (*ExprList)(unsafe.Pointer(pToCol)).FnExpr != (*ExprList)(unsafe.Pointer(pFromCol)).FnExpr) {
goto __6
}
Xsqlite3ErrorMsg(tls, pParse,
- ts+12344 /* "number of column..." */, 0)
+ ts+13527 /* "number of column..." */, 0)
goto fk_end
goto __7
__6:
@@ -96121,7 +97555,7 @@ __7:
;
__3:
;
- nByte = (int32(((uint32(unsafe.Sizeof(FKey{})) + ((uint32(nCol - 1)) * uint32(unsafe.Sizeof(sColMap{})))) + (*Token)(unsafe.Pointer(pTo)).Fn) + uint32(1)))
+ nByte = I64(uint32(unsafe.Sizeof(FKey{})) + uint32(nCol-1)*uint32(unsafe.Sizeof(sColMap{})) + (*Token)(unsafe.Pointer(pTo)).Fn + uint32(1))
if !(pToCol != 0) {
goto __8
}
@@ -96130,7 +97564,7 @@ __9:
if !(i < (*ExprList)(unsafe.Pointer(pToCol)).FnExpr) {
goto __11
}
- nByte = nByte + (Xsqlite3Strlen30(tls, (*ExprList_item)(unsafe.Pointer((pToCol+8 /* &.a */)+uintptr(i)*20)).FzEName) + 1)
+ nByte = nByte + I64(Xsqlite3Strlen30(tls, (*ExprList_item)(unsafe.Pointer(pToCol+8+uintptr(i)*20)).FzEName)+1)
goto __10
__10:
i++
@@ -96148,8 +97582,9 @@ __8:
__12:
;
(*FKey)(unsafe.Pointer(pFKey)).FpFrom = p
- (*FKey)(unsafe.Pointer(pFKey)).FpNextFrom = (*Table)(unsafe.Pointer(p)).FpFKey
- z = ((pFKey + 36 /* &.aCol */) + uintptr(nCol)*8)
+
+ (*FKey)(unsafe.Pointer(pFKey)).FpNextFrom = *(*uintptr)(unsafe.Pointer(p + 44 + 4 /* &.pFKey */))
+ z = pFKey + 36 + uintptr(nCol)*8
(*FKey)(unsafe.Pointer(pFKey)).FzTo = z
if !(int32((*Parse)(unsafe.Pointer(pParse)).FeParseMode) >= PARSE_MODE_RENAME) {
goto __13
@@ -96160,12 +97595,12 @@ __13:
libc.Xmemcpy(tls, z, (*Token)(unsafe.Pointer(pTo)).Fz, (*Token)(unsafe.Pointer(pTo)).Fn)
*(*uint8)(unsafe.Pointer(z + uintptr((*Token)(unsafe.Pointer(pTo)).Fn))) = uint8(0)
Xsqlite3Dequote(tls, z)
- z += (uintptr((*Token)(unsafe.Pointer(pTo)).Fn + uint32(1)))
+ z += uintptr((*Token)(unsafe.Pointer(pTo)).Fn + uint32(1))
(*FKey)(unsafe.Pointer(pFKey)).FnCol = nCol
if !(pFromCol == uintptr(0)) {
goto __14
}
- (*sColMap)(unsafe.Pointer((pFKey + 36 /* &.aCol */))).FiFrom = (int32((*Table)(unsafe.Pointer(p)).FnCol) - 1)
+ (*sColMap)(unsafe.Pointer(pFKey + 36)).FiFrom = int32((*Table)(unsafe.Pointer(p)).FnCol) - 1
goto __15
__14:
i = 0
@@ -96178,10 +97613,10 @@ __19:
if !(j < int32((*Table)(unsafe.Pointer(p)).FnCol)) {
goto __21
}
- if !(Xsqlite3StrICmp(tls, (*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(p)).FaCol+uintptr(j)*20)).FzName, (*ExprList_item)(unsafe.Pointer((pFromCol+8 /* &.a */)+uintptr(i)*20)).FzEName) == 0) {
+ if !(Xsqlite3StrICmp(tls, (*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(p)).FaCol+uintptr(j)*16)).FzCnName, (*ExprList_item)(unsafe.Pointer(pFromCol+8+uintptr(i)*20)).FzEName) == 0) {
goto __22
}
- (*sColMap)(unsafe.Pointer((pFKey + 36 /* &.aCol */) + uintptr(i)*8)).FiFrom = j
+ (*sColMap)(unsafe.Pointer(pFKey + 36 + uintptr(i)*8)).FiFrom = j
goto __21
__22:
;
@@ -96196,15 +97631,15 @@ __21:
goto __23
}
Xsqlite3ErrorMsg(tls, pParse,
- ts+12438, /* "unknown column \"..." */
- libc.VaList(bp+16, (*ExprList_item)(unsafe.Pointer((pFromCol+8 /* &.a */)+uintptr(i)*20)).FzEName))
+ ts+13621, /* "unknown column \"..." */
+ libc.VaList(bp+16, (*ExprList_item)(unsafe.Pointer(pFromCol+8+uintptr(i)*20)).FzEName))
goto fk_end
__23:
;
if !(int32((*Parse)(unsafe.Pointer(pParse)).FeParseMode) >= PARSE_MODE_RENAME) {
goto __24
}
- Xsqlite3RenameTokenRemap(tls, pParse, ((pFKey + 36 /* &.aCol */) + uintptr(i)*8), (*ExprList_item)(unsafe.Pointer((pFromCol+8 /* &.a */)+uintptr(i)*20)).FzEName)
+ Xsqlite3RenameTokenRemap(tls, pParse, pFKey+36+uintptr(i)*8, (*ExprList_item)(unsafe.Pointer(pFromCol+8+uintptr(i)*20)).FzEName)
__24:
;
goto __17
@@ -96224,17 +97659,17 @@ __26:
if !(i < nCol) {
goto __28
}
- n = Xsqlite3Strlen30(tls, (*ExprList_item)(unsafe.Pointer((pToCol+8 /* &.a */)+uintptr(i)*20)).FzEName)
- (*sColMap)(unsafe.Pointer((pFKey + 36 /* &.aCol */) + uintptr(i)*8)).FzCol = z
+ n = Xsqlite3Strlen30(tls, (*ExprList_item)(unsafe.Pointer(pToCol+8+uintptr(i)*20)).FzEName)
+ (*sColMap)(unsafe.Pointer(pFKey + 36 + uintptr(i)*8)).FzCol = z
if !(int32((*Parse)(unsafe.Pointer(pParse)).FeParseMode) >= PARSE_MODE_RENAME) {
goto __29
}
- Xsqlite3RenameTokenRemap(tls, pParse, z, (*ExprList_item)(unsafe.Pointer((pToCol+8 /* &.a */)+uintptr(i)*20)).FzEName)
+ Xsqlite3RenameTokenRemap(tls, pParse, z, (*ExprList_item)(unsafe.Pointer(pToCol+8+uintptr(i)*20)).FzEName)
__29:
;
- libc.Xmemcpy(tls, z, (*ExprList_item)(unsafe.Pointer((pToCol+8 /* &.a */)+uintptr(i)*20)).FzEName, uint32(n))
+ libc.Xmemcpy(tls, z, (*ExprList_item)(unsafe.Pointer(pToCol+8+uintptr(i)*20)).FzEName, uint32(n))
*(*uint8)(unsafe.Pointer(z + uintptr(n))) = uint8(0)
- z += (uintptr(n + 1))
+ z += uintptr(n + 1)
goto __27
__27:
i++
@@ -96245,10 +97680,10 @@ __28:
__25:
;
(*FKey)(unsafe.Pointer(pFKey)).FisDeferred = U8(0)
- *(*U8)(unsafe.Pointer((pFKey + 25 /* &.aAction */))) = (U8(flags & 0xff)) // ON DELETE action
- *(*U8)(unsafe.Pointer((pFKey + 25 /* &.aAction */) + 1)) = (U8((flags >> 8) & 0xff)) // ON UPDATE action
+ *(*U8)(unsafe.Pointer(pFKey + 25)) = U8(flags & 0xff) // ON DELETE action
+ *(*U8)(unsafe.Pointer(pFKey + 25 + 1)) = U8(flags >> 8 & 0xff) // ON UPDATE action
- pNextTo = Xsqlite3HashInsert(tls, ((*Table)(unsafe.Pointer(p)).FpSchema + 56 /* &.fkeyHash */),
+ pNextTo = Xsqlite3HashInsert(tls, (*Table)(unsafe.Pointer(p)).FpSchema+56,
(*FKey)(unsafe.Pointer(pFKey)).FzTo, pFKey)
if !(pNextTo == pFKey) {
goto __30
@@ -96267,7 +97702,8 @@ __31:
;
// Link the foreign key to the table as the last step.
- (*Table)(unsafe.Pointer(p)).FpFKey = pFKey
+
+ *(*uintptr)(unsafe.Pointer(p + 44 + 4 /* &.pFKey */)) = pFKey
pFKey = uintptr(0)
fk_end:
@@ -96281,10 +97717,16 @@ fk_end:
// parameter is 1 for INITIALLY DEFERRED and 0 for INITIALLY IMMEDIATE.
// The behavior of the most recently created foreign key is adjusted
// accordingly.
-func Xsqlite3DeferForeignKey(tls *libc.TLS, pParse uintptr, isDeferred int32) { /* sqlite3.c:115873:21: */
+func Xsqlite3DeferForeignKey(tls *libc.TLS, pParse uintptr, isDeferred int32) { /* sqlite3.c:116720:21: */
var pTab uintptr
var pFKey uintptr
- if ((libc.AssignUintptr(&pTab, (*Parse)(unsafe.Pointer(pParse)).FpNewTable)) == uintptr(0)) || ((libc.AssignUintptr(&pFKey, (*Table)(unsafe.Pointer(pTab)).FpFKey)) == uintptr(0)) {
+ if libc.AssignUintptr(&pTab, (*Parse)(unsafe.Pointer(pParse)).FpNewTable) == uintptr(0) {
+ return
+ }
+ if !(int32((*Table)(unsafe.Pointer(pTab)).FeTabType) == TABTYP_NORM) {
+ return
+ }
+ if libc.AssignUintptr(&pFKey, *(*uintptr)(unsafe.Pointer(pTab + 44 + 4))) == uintptr(0) {
return
}
// EV: R-30323-21917
@@ -96300,7 +97742,7 @@ func Xsqlite3DeferForeignKey(tls *libc.TLS, pParse uintptr, isDeferred int32) {
// root page number of the index. If memRootPage is negative, then
// the index already exists and must be cleared before being refilled and
// the root page number of the index is taken from pIndex->tnum.
-func sqlite3RefillIndex(tls *libc.TLS, pParse uintptr, pIndex uintptr, memRootPage int32) { /* sqlite3.c:115894:13: */
+func sqlite3RefillIndex(tls *libc.TLS, pParse uintptr, pIndex uintptr, memRootPage int32) { /* sqlite3.c:116743:13: */
bp := tls.Alloc(4)
defer tls.Free(4)
@@ -96352,22 +97794,22 @@ func sqlite3RefillIndex(tls *libc.TLS, pParse uintptr, pIndex uintptr, memRootPa
Xsqlite3GenerateIndexKey(tls, pParse, pIndex, iTab, regRecord, 0, bp /* &iPartIdxLabel */, uintptr(0), 0)
Xsqlite3VdbeAddOp2(tls, v, OP_SorterInsert, iSorter, regRecord)
Xsqlite3ResolvePartIdxLabel(tls, pParse, *(*int32)(unsafe.Pointer(bp /* iPartIdxLabel */)))
- Xsqlite3VdbeAddOp2(tls, v, OP_Next, iTab, (addr1 + 1))
+ Xsqlite3VdbeAddOp2(tls, v, OP_Next, iTab, addr1+1)
Xsqlite3VdbeJumpHere(tls, v, addr1)
if memRootPage < 0 {
Xsqlite3VdbeAddOp2(tls, v, OP_Clear, int32(tnum), iDb)
}
Xsqlite3VdbeAddOp4(tls, v, OP_OpenWrite, iIdx, int32(tnum), iDb,
pKey, -9)
- Xsqlite3VdbeChangeP5(tls, v, (uint16(OPFLAG_BULKCSR | (func() int32 {
+ Xsqlite3VdbeChangeP5(tls, v, uint16(OPFLAG_BULKCSR|func() int32 {
if memRootPage >= 0 {
return OPFLAG_P2ISREG
}
return 0
- }()))))
+ }()))
addr1 = Xsqlite3VdbeAddOp2(tls, v, OP_SorterSort, iSorter, 0)
- if int32((*Index)(unsafe.Pointer((pIndex))).FonError) != OE_None {
+ if int32((*Index)(unsafe.Pointer(pIndex)).FonError) != OE_None {
var j2 int32 = Xsqlite3VdbeGoto(tls, v, 1)
addr2 = Xsqlite3VdbeCurrentAddr(tls, v)
@@ -96387,7 +97829,7 @@ func sqlite3RefillIndex(tls *libc.TLS, pParse uintptr, pIndex uintptr, memRootPa
addr2 = Xsqlite3VdbeCurrentAddr(tls, v)
}
Xsqlite3VdbeAddOp3(tls, v, OP_SorterData, iSorter, regRecord, iIdx)
- if !((int32(*(*uint16)(unsafe.Pointer(pIndex + 56 /* &.bAscKeyBug */)) & 0x200 >> 9)) != 0) {
+ if !(int32(*(*uint16)(unsafe.Pointer(pIndex + 56))&0x200>>9) != 0) {
// This OP_SeekEnd opcode makes index insert for a REINDEX go much
// faster by avoiding unnecessary seeks. But the optimization does
// not work for UNIQUE constraint indexes on WITHOUT ROWID tables
@@ -96412,24 +97854,24 @@ func sqlite3RefillIndex(tls *libc.TLS, pParse uintptr, pIndex uintptr, memRootPa
// Increase the allocation size to provide an extra nExtra bytes
// of 8-byte aligned space after the Index object and return a
// pointer to this extra space in *ppExtra.
-func Xsqlite3AllocateIndexObject(tls *libc.TLS, db uintptr, nCol I16, nExtra int32, ppExtra uintptr) uintptr { /* sqlite3.c:116000:22: */
+func Xsqlite3AllocateIndexObject(tls *libc.TLS, db uintptr, nCol I16, nExtra int32, ppExtra uintptr) uintptr { /* sqlite3.c:116849:22: */
var p uintptr // Allocated index object
var nByte int32 // Bytes of space for Index object + arrays
- nByte = (int32(((((uint32(unsafe.Sizeof(Index{}))) + uint32(7)) & libc.Uint32FromInt32(libc.CplInt32(7))) + (((uint32(unsafe.Sizeof(uintptr(0))) * uint32(nCol)) + uint32(7)) & libc.Uint32FromInt32(libc.CplInt32(7)))) + (((((uint32(unsafe.Sizeof(LogEst(0))) * (uint32(int32(nCol) + 1))) + (uint32(unsafe.Sizeof(I16(0))) * uint32(nCol))) + (uint32(unsafe.Sizeof(U8(0))) * uint32(nCol))) + uint32(7)) & libc.Uint32FromInt32(libc.CplInt32(7))))) // Index.aSortOrder
- p = Xsqlite3DbMallocZero(tls, db, (uint64(nByte + nExtra)))
+ nByte = int32((uint32(unsafe.Sizeof(Index{}))+uint32(7))&libc.Uint32FromInt32(libc.CplInt32(7)) + (uint32(unsafe.Sizeof(uintptr(0)))*uint32(nCol)+uint32(7))&libc.Uint32FromInt32(libc.CplInt32(7)) + (uint32(unsafe.Sizeof(LogEst(0)))*uint32(int32(nCol)+1)+uint32(unsafe.Sizeof(I16(0)))*uint32(nCol)+uint32(unsafe.Sizeof(U8(0)))*uint32(nCol)+uint32(7))&libc.Uint32FromInt32(libc.CplInt32(7))) // Index.aSortOrder
+ p = Xsqlite3DbMallocZero(tls, db, uint64(nByte+nExtra))
if p != 0 {
- var pExtra uintptr = ((p) + uintptr((((uint32(unsafe.Sizeof(Index{}))) + uint32(7)) & libc.Uint32FromInt32(libc.CplInt32(7)))))
+ var pExtra uintptr = p + uintptr((uint32(unsafe.Sizeof(Index{}))+uint32(7))&libc.Uint32FromInt32(libc.CplInt32(7)))
(*Index)(unsafe.Pointer(p)).FazColl = pExtra
- pExtra += (uintptr(((uint32(unsafe.Sizeof(uintptr(0))) * uint32(nCol)) + uint32(7)) & libc.Uint32FromInt32(libc.CplInt32(7))))
+ pExtra += uintptr((uint32(unsafe.Sizeof(uintptr(0)))*uint32(nCol) + uint32(7)) & libc.Uint32FromInt32(libc.CplInt32(7)))
(*Index)(unsafe.Pointer(p)).FaiRowLogEst = pExtra
- pExtra += (uintptr(uint32(unsafe.Sizeof(LogEst(0))) * (uint32(int32(nCol) + 1))))
+ pExtra += uintptr(uint32(unsafe.Sizeof(LogEst(0))) * uint32(int32(nCol)+1))
(*Index)(unsafe.Pointer(p)).FaiColumn = pExtra
- pExtra += (uintptr(uint32(unsafe.Sizeof(I16(0))) * uint32(nCol)))
+ pExtra += uintptr(uint32(unsafe.Sizeof(I16(0))) * uint32(nCol))
(*Index)(unsafe.Pointer(p)).FaSortOrder = pExtra
(*Index)(unsafe.Pointer(p)).FnColumn = U16(nCol)
- (*Index)(unsafe.Pointer(p)).FnKeyCol = (U16(int32(nCol) - 1))
- *(*uintptr)(unsafe.Pointer(ppExtra)) = ((p) + uintptr(nByte))
+ (*Index)(unsafe.Pointer(p)).FnKeyCol = U16(int32(nCol) - 1)
+ *(*uintptr)(unsafe.Pointer(ppExtra)) = p + uintptr(nByte)
}
return p
}
@@ -96437,21 +97879,21 @@ func Xsqlite3AllocateIndexObject(tls *libc.TLS, db uintptr, nCol I16, nExtra int
// If expression list pList contains an expression that was parsed with
// an explicit "NULLS FIRST" or "NULLS LAST" clause, leave an error in
// pParse and return non-zero. Otherwise, return zero.
-func Xsqlite3HasExplicitNulls(tls *libc.TLS, pParse uintptr, pList uintptr) int32 { /* sqlite3.c:116033:20: */
+func Xsqlite3HasExplicitNulls(tls *libc.TLS, pParse uintptr, pList uintptr) int32 { /* sqlite3.c:116882:20: */
bp := tls.Alloc(8)
defer tls.Free(8)
if pList != 0 {
var i int32
for i = 0; i < (*ExprList)(unsafe.Pointer(pList)).FnExpr; i++ {
- if (uint32(int32(*(*uint8)(unsafe.Pointer((pList + 8 /* &.a */) + uintptr(i)*20 + 12 /* &.bNulls */)) & 0x20 >> 5))) != 0 {
- var sf U8 = (*ExprList_item)(unsafe.Pointer((pList + 8 /* &.a */) + uintptr(i)*20)).FsortFlags
- Xsqlite3ErrorMsg(tls, pParse, ts+12484, /* "unsupported use ..." */
+ if uint32(int32(*(*uint8)(unsafe.Pointer(pList + 8 + uintptr(i)*20 + 12))&0x20>>5)) != 0 {
+ var sf U8 = (*ExprList_item)(unsafe.Pointer(pList + 8 + uintptr(i)*20)).FsortFlags
+ Xsqlite3ErrorMsg(tls, pParse, ts+13667, /* "unsupported use ..." */
libc.VaList(bp, func() uintptr {
- if (int32(sf) == 0) || (int32(sf) == 3) {
- return ts + 12512 /* "FIRST" */
+ if int32(sf) == 0 || int32(sf) == 3 {
+ return ts + 13695 /* "FIRST" */
}
- return ts + 12518 /* "LAST" */
+ return ts + 13701 /* "LAST" */
}()))
return 1
}
@@ -96470,7 +97912,7 @@ func Xsqlite3HasExplicitNulls(tls *libc.TLS, pParse uintptr, pList uintptr) int3
// pList is a list of columns to be indexed. pList will be NULL if this
// is a primary key or unique-constraint on the most recent column added
// to the table currently under construction.
-func Xsqlite3CreateIndex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 uintptr, pTblName uintptr, pList uintptr, onError int32, pStart uintptr, pPIWhere uintptr, sortOrder int32, ifNotExist int32, idxType U8) { /* sqlite3.c:116061:21: */
+func Xsqlite3CreateIndex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 uintptr, pTblName uintptr, pList uintptr, onError int32, pStart uintptr, pPIWhere uintptr, sortOrder int32, ifNotExist int32, idxType U8) { /* sqlite3.c:116910:21: */
bp := tls.Alloc(196)
defer tls.Free(196)
@@ -96551,13 +97993,13 @@ func Xsqlite3CreateIndex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u
*(*uintptr)(unsafe.Pointer(bp + 192 /* zExtra */)) = uintptr(0)
pPk = uintptr(0) // PRIMARY KEY index for WITHOUT ROWID tables
- if !(((*Sqlite3)(unsafe.Pointer(db)).FmallocFailed != 0) || ((*Parse)(unsafe.Pointer(pParse)).FnErr > 0)) {
+ if !((*Sqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 || (*Parse)(unsafe.Pointer(pParse)).FnErr > 0) {
goto __1
}
goto exit_create_index
__1:
;
- if !((int32((*Parse)(unsafe.Pointer(pParse)).FeParseMode) == PARSE_MODE_DECLARE_VTAB) && (int32(idxType) != SQLITE_IDXTYPE_PRIMARYKEY)) {
+ if !(int32((*Parse)(unsafe.Pointer(pParse)).FeParseMode) == PARSE_MODE_DECLARE_VTAB && int32(idxType) != SQLITE_IDXTYPE_PRIMARYKEY) {
goto __2
}
goto exit_create_index
@@ -96596,11 +98038,11 @@ __7:
// If the index name was unqualified, check if the table
// is a temp table. If so, set the database to 1. Do not do this
// if initialising a database schema.
- if !(!(int32((*Sqlite3)(unsafe.Pointer(db)).Finit.Fbusy) != 0)) {
+ if !!(int32((*Sqlite3)(unsafe.Pointer(db)).Finit.Fbusy) != 0) {
goto __8
}
pTab = Xsqlite3SrcListLookup(tls, pParse, pTblName)
- if !((((*Token)(unsafe.Pointer(pName2)).Fn == uint32(0)) && (pTab != 0)) && ((*Table)(unsafe.Pointer(pTab)).FpSchema == (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+1*16)).FpSchema)) {
+ if !((*Token)(unsafe.Pointer(pName2)).Fn == uint32(0) && pTab != 0 && (*Table)(unsafe.Pointer(pTab)).FpSchema == (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+1*16)).FpSchema) {
goto __9
}
iDb = 1
@@ -96609,8 +98051,8 @@ __9:
__8:
;
- Xsqlite3FixInit(tls, bp+132 /* &sFix */, pParse, iDb, ts+12523 /* "index" */, *(*uintptr)(unsafe.Pointer(bp + 128 /* pName */)))
- if !(Xsqlite3FixSrcList(tls, bp+132 /* &sFix */, pTblName) != 0) {
+ Xsqlite3FixInit(tls, bp+132 /* &sFix */, pParse, iDb, ts+13706 /* "index" */, *(*uintptr)(unsafe.Pointer(bp + 128 /* pName */)))
+ if !(Xsqlite3FixSrcList(tls, bp+132, pTblName) != 0) {
goto __10
}
// Because the parser constructs pTblName from a single identifier,
@@ -96618,7 +98060,7 @@ __8:
__10:
;
- pTab = Xsqlite3LocateTableItem(tls, pParse, uint32(0), (pTblName + 8 /* &.a */))
+ pTab = Xsqlite3LocateTableItem(tls, pParse, uint32(0), pTblName+8)
if !(pTab == uintptr(0)) {
goto __11
@@ -96626,16 +98068,16 @@ __10:
goto exit_create_index
__11:
;
- if !((iDb == 1) && ((*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+uintptr(iDb)*16)).FpSchema != (*Table)(unsafe.Pointer(pTab)).FpSchema)) {
+ if !(iDb == 1 && (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+uintptr(iDb)*16)).FpSchema != (*Table)(unsafe.Pointer(pTab)).FpSchema) {
goto __12
}
Xsqlite3ErrorMsg(tls, pParse,
- ts+12529, /* "cannot create a ..." */
+ ts+13712, /* "cannot create a ..." */
libc.VaList(bp, (*Table)(unsafe.Pointer(pTab)).FzName))
goto exit_create_index
__12:
;
- if !(!(((*Table)(unsafe.Pointer((pTab))).FtabFlags & U32(TF_WithoutRowid)) == U32(0))) {
+ if !!((*Table)(unsafe.Pointer(pTab)).FtabFlags&U32(TF_WithoutRowid) == U32(0)) {
goto __13
}
pPk = Xsqlite3PrimaryKeyIndex(tls, pTab)
@@ -96646,7 +98088,7 @@ __5:
;
pTab = (*Parse)(unsafe.Pointer(pParse)).FpNewTable
- if !(!(pTab != 0)) {
+ if !!(pTab != 0) {
goto __14
}
goto exit_create_index
@@ -96655,28 +98097,28 @@ __14:
iDb = Xsqlite3SchemaToIndex(tls, db, (*Table)(unsafe.Pointer(pTab)).FpSchema)
__6:
;
- pDb = ((*Sqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*16)
+ pDb = (*Sqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*16
- if !(((Xsqlite3_strnicmp(tls, (*Table)(unsafe.Pointer(pTab)).FzName, ts+7081 /* "sqlite_" */, 7) == 0) &&
- (int32((*Sqlite3)(unsafe.Pointer(db)).Finit.Fbusy) == 0)) &&
- (pTblName != uintptr(0))) {
+ if !(Xsqlite3_strnicmp(tls, (*Table)(unsafe.Pointer(pTab)).FzName, ts+7997, 7) == 0 &&
+ int32((*Sqlite3)(unsafe.Pointer(db)).Finit.Fbusy) == 0 &&
+ pTblName != uintptr(0)) {
goto __15
}
- Xsqlite3ErrorMsg(tls, pParse, ts+12579 /* "table %s may not..." */, libc.VaList(bp+8, (*Table)(unsafe.Pointer(pTab)).FzName))
+ Xsqlite3ErrorMsg(tls, pParse, ts+13762 /* "table %s may not..." */, libc.VaList(bp+8, (*Table)(unsafe.Pointer(pTab)).FzName))
goto exit_create_index
__15:
;
- if !((*Table)(unsafe.Pointer(pTab)).FpSelect != 0) {
+ if !(int32((*Table)(unsafe.Pointer(pTab)).FeTabType) == TABTYP_VIEW) {
goto __16
}
- Xsqlite3ErrorMsg(tls, pParse, ts+12607 /* "views may not be..." */, 0)
+ Xsqlite3ErrorMsg(tls, pParse, ts+13790 /* "views may not be..." */, 0)
goto exit_create_index
__16:
;
- if !((*Table)(unsafe.Pointer(pTab)).FnModuleArg != 0) {
+ if !(int32((*Table)(unsafe.Pointer(pTab)).FeTabType) == TABTYP_VTAB) {
goto __17
}
- Xsqlite3ErrorMsg(tls, pParse, ts+12632 /* "virtual tables m..." */, 0)
+ Xsqlite3ErrorMsg(tls, pParse, ts+13815 /* "virtual tables m..." */, 0)
goto exit_create_index
__17:
;
@@ -96692,7 +98134,7 @@ __17:
// If pName==0 it means that we are
// dealing with a primary key or UNIQUE constraint. We have to invent our
// own name.
- if !(*(*uintptr)(unsafe.Pointer(bp + 128 /* pName */)) != 0) {
+ if !(*(*uintptr)(unsafe.Pointer(bp + 128)) != 0) {
goto __18
}
zName = Xsqlite3NameFromToken(tls, db, *(*uintptr)(unsafe.Pointer(bp + 128 /* pName */)))
@@ -96703,22 +98145,22 @@ __17:
__20:
;
- if !(SQLITE_OK != Xsqlite3CheckObjectName(tls, pParse, zName, ts+12523 /* "index" */, (*Table)(unsafe.Pointer(pTab)).FzName)) {
+ if !(SQLITE_OK != Xsqlite3CheckObjectName(tls, pParse, zName, ts+13706, (*Table)(unsafe.Pointer(pTab)).FzName)) {
goto __21
}
goto exit_create_index
__21:
;
- if !(!(int32((*Parse)(unsafe.Pointer(pParse)).FeParseMode) >= PARSE_MODE_RENAME)) {
+ if !!(int32((*Parse)(unsafe.Pointer(pParse)).FeParseMode) >= PARSE_MODE_RENAME) {
goto __22
}
- if !(!(int32((*Sqlite3)(unsafe.Pointer(db)).Finit.Fbusy) != 0)) {
+ if !!(int32((*Sqlite3)(unsafe.Pointer(db)).Finit.Fbusy) != 0) {
goto __23
}
if !(Xsqlite3FindTable(tls, db, zName, uintptr(0)) != uintptr(0)) {
goto __24
}
- Xsqlite3ErrorMsg(tls, pParse, ts+12666 /* "there is already..." */, libc.VaList(bp+16, zName))
+ Xsqlite3ErrorMsg(tls, pParse, ts+13849 /* "there is already..." */, libc.VaList(bp+16, zName))
goto exit_create_index
__24:
;
@@ -96727,10 +98169,10 @@ __23:
if !(Xsqlite3FindIndex(tls, db, zName, (*Db)(unsafe.Pointer(pDb)).FzDbSName) != uintptr(0)) {
goto __25
}
- if !(!(ifNotExist != 0)) {
+ if !!(ifNotExist != 0) {
goto __26
}
- Xsqlite3ErrorMsg(tls, pParse, ts+12700 /* "index %s already..." */, libc.VaList(bp+24, zName))
+ Xsqlite3ErrorMsg(tls, pParse, ts+13883 /* "index %s already..." */, libc.VaList(bp+24, zName))
goto __27
__26:
;
@@ -96759,7 +98201,7 @@ __29:
goto __30
__30:
;
- zName = Xsqlite3MPrintf(tls, db, ts+12724 /* "sqlite_autoindex..." */, libc.VaList(bp+32, (*Table)(unsafe.Pointer(pTab)).FzName, n))
+ zName = Xsqlite3MPrintf(tls, db, ts+13907 /* "sqlite_autoindex..." */, libc.VaList(bp+32, (*Table)(unsafe.Pointer(pTab)).FzName, n))
if !(zName == uintptr(0)) {
goto __31
}
@@ -96782,15 +98224,15 @@ __19:
;
// Check for authorization to create an index.
- if !(!(int32((*Parse)(unsafe.Pointer(pParse)).FeParseMode) >= PARSE_MODE_RENAME)) {
+ if !!(int32((*Parse)(unsafe.Pointer(pParse)).FeParseMode) >= PARSE_MODE_RENAME) {
goto __33
}
zDb = (*Db)(unsafe.Pointer(pDb)).FzDbSName
if !(Xsqlite3AuthCheck(tls, pParse, SQLITE_INSERT, func() uintptr {
- if (!(0 != 0)) && (iDb == 1) {
- return ts + 10872 /* "sqlite_temp_mast..." */
+ if !(0 != 0) && iDb == 1 {
+ return ts + 11986
}
- return ts + 4956 /* "sqlite_master" */
+ return ts + 5803
}(), uintptr(0), zDb) != 0) {
goto __34
}
@@ -96798,7 +98240,7 @@ __19:
__34:
;
i = SQLITE_CREATE_INDEX
- if !(!(0 != 0) && (iDb == 1)) {
+ if !(!(0 != 0) && iDb == 1) {
goto __35
}
i = SQLITE_CREATE_TEMP_INDEX
@@ -96819,9 +98261,9 @@ __33:
if !(pList == uintptr(0)) {
goto __37
}
- pCol = ((*Table)(unsafe.Pointer(pTab)).FaCol + uintptr((int32((*Table)(unsafe.Pointer(pTab)).FnCol)-1))*20)
- *(*U16)(unsafe.Pointer(pCol + 16 /* &.colFlags */)) |= U16((COLFLAG_UNIQUE))
- Xsqlite3TokenInit(tls, bp+184 /* &prevCol */, (*Column)(unsafe.Pointer(pCol)).FzName)
+ pCol = (*Table)(unsafe.Pointer(pTab)).FaCol + uintptr(int32((*Table)(unsafe.Pointer(pTab)).FnCol)-1)*16
+ *(*U16)(unsafe.Pointer(pCol + 12)) |= U16(COLFLAG_UNIQUE)
+ Xsqlite3TokenInit(tls, bp+184 /* &prevCol */, (*Column)(unsafe.Pointer(pCol)).FzCnName)
pList = Xsqlite3ExprListAppend(tls, pParse, uintptr(0),
Xsqlite3ExprAlloc(tls, db, TK_ID, bp+184 /* &prevCol */, 0))
if !(pList == uintptr(0)) {
@@ -96834,7 +98276,7 @@ __39:
Xsqlite3ExprListSetSortOrder(tls, pList, sortOrder, -1)
goto __38
__37:
- Xsqlite3ExprListCheckLength(tls, pParse, pList, ts+12523 /* "index" */)
+ Xsqlite3ExprListCheckLength(tls, pParse, pList, ts+13706 /* "index" */)
if !((*Parse)(unsafe.Pointer(pParse)).FnErr != 0) {
goto __40
}
@@ -96851,12 +98293,13 @@ __41:
if !(i < (*ExprList)(unsafe.Pointer(pList)).FnExpr) {
goto __43
}
- pExpr = (*ExprList_item)(unsafe.Pointer((pList + 8 /* &.a */) + uintptr(i)*20)).FpExpr
+ pExpr = (*ExprList_item)(unsafe.Pointer(pList + 8 + uintptr(i)*20)).FpExpr
if !(int32((*Expr)(unsafe.Pointer(pExpr)).Fop) == TK_COLLATE) {
goto __44
}
- nExtra = nExtra + (1 + Xsqlite3Strlen30(tls, *(*uintptr)(unsafe.Pointer(pExpr + 8 /* &.u */))))
+
+ nExtra = nExtra + (1 + Xsqlite3Strlen30(tls, *(*uintptr)(unsafe.Pointer(pExpr + 8))))
__44:
;
goto __42
@@ -96875,8 +98318,8 @@ __43:
nExtraCol = 1
}
- pIndex = Xsqlite3AllocateIndexObject(tls, db, (int16((*ExprList)(unsafe.Pointer(pList)).FnExpr + nExtraCol)),
- ((nName + nExtra) + 1), bp+192 /* &zExtra */)
+ pIndex = Xsqlite3AllocateIndexObject(tls, db, int16((*ExprList)(unsafe.Pointer(pList)).FnExpr+nExtraCol),
+ nName+nExtra+1, bp+192 /* &zExtra */)
if !((*Sqlite3)(unsafe.Pointer(db)).FmallocFailed != 0) {
goto __45
}
@@ -96885,12 +98328,12 @@ __45:
;
(*Index)(unsafe.Pointer(pIndex)).FzName = *(*uintptr)(unsafe.Pointer(bp + 192 /* zExtra */))
- *(*uintptr)(unsafe.Pointer(bp + 192 /* zExtra */)) += (uintptr(nName + 1))
- libc.Xmemcpy(tls, (*Index)(unsafe.Pointer(pIndex)).FzName, zName, (uint32(nName + 1)))
+ *(*uintptr)(unsafe.Pointer(bp + 192 /* zExtra */)) += uintptr(nName + 1)
+ libc.Xmemcpy(tls, (*Index)(unsafe.Pointer(pIndex)).FzName, zName, uint32(nName+1))
(*Index)(unsafe.Pointer(pIndex)).FpTable = pTab
(*Index)(unsafe.Pointer(pIndex)).FonError = U8(onError)
- libc.SetBitFieldPtr16Uint32(pIndex+56 /* &.uniqNotNull */, (uint32(libc.Bool32(onError != OE_None))), 3, 0x8)
- libc.SetBitFieldPtr16Uint32(pIndex+56 /* &.idxType */, uint32(idxType), 0, 0x3)
+ libc.SetBitFieldPtr16Uint32(pIndex+56, uint32(libc.Bool32(onError != OE_None)), 3, 0x8)
+ libc.SetBitFieldPtr16Uint32(pIndex+56, uint32(idxType), 0, 0x3)
(*Index)(unsafe.Pointer(pIndex)).FpSchema = (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*16)).FpSchema
(*Index)(unsafe.Pointer(pIndex)).FnKeyCol = U16((*ExprList)(unsafe.Pointer(pList)).FnExpr)
if !(pPIWhere != 0) {
@@ -96951,7 +98394,7 @@ __53:
goto __56
}
Xsqlite3ErrorMsg(tls, pParse,
- ts+12747 /* "expressions proh..." */, 0)
+ ts+13930 /* "expressions proh..." */, 0)
goto exit_create_index
__56:
;
@@ -96964,7 +98407,7 @@ __57:
;
j = -2
*(*I16)(unsafe.Pointer((*Index)(unsafe.Pointer(pIndex)).FaiColumn + uintptr(i)*2)) = int16(-2)
- libc.SetBitFieldPtr16Uint32(pIndex+56 /* &.uniqNotNull */, uint32(0), 3, 0x8)
+ libc.SetBitFieldPtr16Uint32(pIndex+56, uint32(0), 3, 0x8)
goto __55
__54:
j = int32((*Expr)(unsafe.Pointer(pCExpr)).FiColumn)
@@ -96975,16 +98418,16 @@ __54:
j = int32((*Table)(unsafe.Pointer(pTab)).FiPKey)
goto __59
__58:
- if !(int32((*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FaCol+uintptr(j)*20)).FnotNull) == 0) {
+ if !(int32(*(*uint8)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FaCol + uintptr(j)*16 + 4))&0xf>>0) == 0) {
goto __60
}
- libc.SetBitFieldPtr16Uint32(pIndex+56 /* &.uniqNotNull */, uint32(0), 3, 0x8)
+ libc.SetBitFieldPtr16Uint32(pIndex+56, uint32(0), 3, 0x8)
__60:
;
- if !((int32((*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FaCol+uintptr(j)*20)).FcolFlags) & COLFLAG_VIRTUAL) != 0) {
+ if !(int32((*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FaCol+uintptr(j)*16)).FcolFlags)&COLFLAG_VIRTUAL != 0) {
goto __61
}
- libc.SetBitFieldPtr16Uint32(pIndex+56 /* &.bHasVCol */, uint32(1), 10, 0x400)
+ libc.SetBitFieldPtr16Uint32(pIndex+56, uint32(1), 10, 0x400)
__61:
;
__59:
@@ -96996,24 +98439,25 @@ __55:
if !(int32((*Expr)(unsafe.Pointer((*ExprList_item)(unsafe.Pointer(pListItem)).FpExpr)).Fop) == TK_COLLATE) {
goto __62
}
- zColl = *(*uintptr)(unsafe.Pointer((*ExprList_item)(unsafe.Pointer(pListItem)).FpExpr + 8 /* &.u */))
- nColl = (Xsqlite3Strlen30(tls, zColl) + 1)
+
+ zColl = *(*uintptr)(unsafe.Pointer((*ExprList_item)(unsafe.Pointer(pListItem)).FpExpr + 8))
+ nColl = Xsqlite3Strlen30(tls, zColl) + 1
libc.Xmemcpy(tls, *(*uintptr)(unsafe.Pointer(bp + 192 /* zExtra */)), zColl, uint32(nColl))
zColl = *(*uintptr)(unsafe.Pointer(bp + 192 /* zExtra */))
*(*uintptr)(unsafe.Pointer(bp + 192 /* zExtra */)) += uintptr(nColl)
- nExtra = nExtra - (nColl)
+ nExtra = nExtra - nColl
goto __63
__62:
if !(j >= 0) {
goto __64
}
- zColl = (*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FaCol + uintptr(j)*20)).FzColl
+ zColl = Xsqlite3ColumnColl(tls, (*Table)(unsafe.Pointer(pTab)).FaCol+uintptr(j)*16)
__64:
;
__63:
;
- if !(!(zColl != 0)) {
+ if !!(zColl != 0) {
goto __65
}
zColl = uintptr(unsafe.Pointer(&Xsqlite3StrBINARY))
@@ -97026,7 +98470,7 @@ __65:
__66:
;
*(*uintptr)(unsafe.Pointer((*Index)(unsafe.Pointer(pIndex)).FazColl + uintptr(i)*4)) = zColl
- requestedSortOrder = (int32((*ExprList_item)(unsafe.Pointer(pListItem)).FsortFlags) & sortOrderMask)
+ requestedSortOrder = int32((*ExprList_item)(unsafe.Pointer(pListItem)).FsortFlags) & sortOrderMask
*(*U8)(unsafe.Pointer((*Index)(unsafe.Pointer(pIndex)).FaSortOrder + uintptr(i))) = U8(requestedSortOrder)
goto __51
__51:
@@ -97089,10 +98533,10 @@ __74:
// it as a covering index
recomputeColumnsNotIndexed(tls, pIndex)
- if !((pTblName != uintptr(0)) && (int32((*Index)(unsafe.Pointer(pIndex)).FnColumn) >= int32((*Table)(unsafe.Pointer(pTab)).FnCol))) {
+ if !(pTblName != uintptr(0) && int32((*Index)(unsafe.Pointer(pIndex)).FnColumn) >= int32((*Table)(unsafe.Pointer(pTab)).FnCol)) {
goto __75
}
- libc.SetBitFieldPtr16Uint32(pIndex+56 /* &.isCovering */, uint32(1), 5, 0x20)
+ libc.SetBitFieldPtr16Uint32(pIndex+56, uint32(1), 5, 0x20)
j = 0
__76:
if !(j < int32((*Table)(unsafe.Pointer(pTab)).FnCol)) {
@@ -97110,7 +98554,7 @@ __79:
goto __77
__80:
;
- libc.SetBitFieldPtr16Uint32(pIndex+56 /* &.isCovering */, uint32(0), 5, 0x20)
+ libc.SetBitFieldPtr16Uint32(pIndex+56, uint32(0), 5, 0x20)
goto __78
goto __77
__77:
@@ -97176,11 +98620,11 @@ __88:
// constraint and the previous equivalent constraint have explicit
// ON CONFLICT clauses this is an error. Otherwise, use the
// explicitly specified behavior for the index.
- if !(!((int32((*Index)(unsafe.Pointer(pIdx)).FonError) == OE_Default) || (int32((*Index)(unsafe.Pointer(pIndex)).FonError) == OE_Default))) {
+ if !!(int32((*Index)(unsafe.Pointer(pIdx)).FonError) == OE_Default || int32((*Index)(unsafe.Pointer(pIndex)).FonError) == OE_Default) {
goto __93
}
Xsqlite3ErrorMsg(tls, pParse,
- ts+12808 /* "conflicting ON C..." */, libc.VaList(bp+48, 0))
+ ts+13991 /* "conflicting ON C..." */, libc.VaList(bp+48, 0))
__93:
;
if !(int32((*Index)(unsafe.Pointer(pIdx)).FonError) == OE_Default) {
@@ -97194,7 +98638,7 @@ __92:
if !(int32(idxType) == SQLITE_IDXTYPE_PRIMARYKEY) {
goto __95
}
- libc.SetBitFieldPtr16Uint32(pIdx+56 /* &.idxType */, uint32(idxType), 0, 0x3)
+ libc.SetBitFieldPtr16Uint32(pIdx+56, uint32(idxType), 0, 0x3)
__95:
;
if !(int32((*Parse)(unsafe.Pointer(pParse)).FeParseMode) >= PARSE_MODE_RENAME) {
@@ -97218,7 +98662,7 @@ __84:
__81:
;
- if !(!(int32((*Parse)(unsafe.Pointer(pParse)).FeParseMode) >= PARSE_MODE_RENAME)) {
+ if !!(int32((*Parse)(unsafe.Pointer(pParse)).FeParseMode) >= PARSE_MODE_RENAME) {
goto __97
}
@@ -97236,14 +98680,14 @@ __81:
if !(Xsqlite3IndexHasDuplicateRootPage(tls, pIndex) != 0) {
goto __101
}
- Xsqlite3ErrorMsg(tls, pParse, ts+12850 /* "invalid rootpage" */, 0)
- (*Parse)(unsafe.Pointer(pParse)).Frc = Xsqlite3CorruptError(tls, 116514)
+ Xsqlite3ErrorMsg(tls, pParse, ts+14033 /* "invalid rootpage" */, 0)
+ (*Parse)(unsafe.Pointer(pParse)).Frc = Xsqlite3CorruptError(tls, 117365)
goto exit_create_index
__101:
;
__100:
;
- p = Xsqlite3HashInsert(tls, ((*Index)(unsafe.Pointer(pIndex)).FpSchema + 24 /* &.idxHash */),
+ p = Xsqlite3HashInsert(tls, (*Index)(unsafe.Pointer(pIndex)).FpSchema+24,
(*Index)(unsafe.Pointer(pIndex)).FzName, pIndex)
if !(p != 0) {
goto __102
@@ -97253,10 +98697,10 @@ __100:
goto exit_create_index
__102:
;
- *(*U32)(unsafe.Pointer(db + 24 /* &.mDbFlags */)) |= (U32(DBFLAG_SchemaChange))
+ *(*U32)(unsafe.Pointer(db + 24)) |= U32(DBFLAG_SchemaChange)
goto __99
__98:
- if !((((*Table)(unsafe.Pointer((pTab))).FtabFlags & U32(TF_WithoutRowid)) == U32(0)) || (pTblName != uintptr(0))) {
+ if !((*Table)(unsafe.Pointer(pTab)).FtabFlags&U32(TF_WithoutRowid) == U32(0) || pTblName != uintptr(0)) {
goto __103
}
iMem = libc.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1)
@@ -97286,20 +98730,20 @@ __104:
if !(pStart != 0) {
goto __105
}
- n1 = (int32(uint32(((int32((*Parse)(unsafe.Pointer(pParse)).FsLastToken.Fz) - int32((*Token)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 128 /* pName */)))).Fz)) / 1)) + (*Parse)(unsafe.Pointer(pParse)).FsLastToken.Fn))
- if !(int32(*(*uint8)(unsafe.Pointer((*Token)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 128 /* pName */)))).Fz + uintptr((n1 - 1))))) == ';') {
+ n1 = int32(uint32((int32((*Parse)(unsafe.Pointer(pParse)).FsLastToken.Fz)-int32((*Token)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 128)))).Fz))/1) + (*Parse)(unsafe.Pointer(pParse)).FsLastToken.Fn)
+ if !(int32(*(*uint8)(unsafe.Pointer((*Token)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 128)))).Fz + uintptr(n1-1)))) == ';') {
goto __107
}
n1--
__107:
;
// A named index with an explicit CREATE INDEX statement
- zStmt = Xsqlite3MPrintf(tls, db, ts+12867, /* "CREATE%s INDEX %..." */
+ zStmt = Xsqlite3MPrintf(tls, db, ts+14050, /* "CREATE%s INDEX %..." */
libc.VaList(bp+56, func() uintptr {
if onError == OE_None {
- return ts + 755 /* "" */
+ return ts + 1543 /* "" */
}
- return ts + 12887 /* " UNIQUE" */
+ return ts + 14070 /* " UNIQUE" */
}(), n1, (*Token)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 128 /* pName */)))).Fz))
goto __106
__105:
@@ -97311,7 +98755,7 @@ __106:
// Add an entry in sqlite_schema for this index
Xsqlite3NestedParse(tls, pParse,
- ts+12895, /* "INSERT INTO %Q.s..." */
+ ts+14078, /* "INSERT INTO %Q.s..." */
libc.VaList(bp+80, (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+uintptr(iDb)*16)).FzDbSName,
(*Index)(unsafe.Pointer(pIndex)).FzName,
(*Table)(unsafe.Pointer(pTab)).FzName,
@@ -97327,7 +98771,7 @@ __106:
sqlite3RefillIndex(tls, pParse, pIndex, iMem)
Xsqlite3ChangeCookie(tls, pParse, iDb)
Xsqlite3VdbeAddParseSchemaOp(tls, v, iDb,
- Xsqlite3MPrintf(tls, db, ts+12954 /* "name='%q' AND ty..." */, libc.VaList(bp+120, (*Index)(unsafe.Pointer(pIndex)).FzName)), uint16(0))
+ Xsqlite3MPrintf(tls, db, ts+14137 /* "name='%q' AND ty..." */, libc.VaList(bp+120, (*Index)(unsafe.Pointer(pIndex)).FzName)), uint16(0))
Xsqlite3VdbeAddOp2(tls, v, OP_Expire, 0, 1)
__108:
;
@@ -97339,7 +98783,7 @@ __99:
;
__97:
;
- if !(((*Sqlite3)(unsafe.Pointer(db)).Finit.Fbusy != 0) || (pTblName == uintptr(0))) {
+ if !((*Sqlite3)(unsafe.Pointer(db)).Finit.Fbusy != 0 || pTblName == uintptr(0)) {
goto __109
}
(*Index)(unsafe.Pointer(pIndex)).FpNext = (*Table)(unsafe.Pointer(pTab)).FpIndex
@@ -97369,14 +98813,9 @@ __112:
if !(pTab != 0) {
goto __113
}
- // Ensure all REPLACE indexes on pTab are at the end of the pIndex list.
- // The list was already ordered when this routine was entered, so at this
- // point at most a single index (the newly added index) will be out of
- // order. So we have to reorder at most one index.
- ppFrom = (pTab + 8 /* &.pIndex */)
- ppFrom = (pTab + 8 /* &.pIndex */)
+ ppFrom = pTab + 8
__114:
- if !((libc.AssignUintptr(&pThis, *(*uintptr)(unsafe.Pointer(ppFrom)))) != uintptr(0)) {
+ if !(libc.AssignUintptr(&pThis, *(*uintptr)(unsafe.Pointer(ppFrom))) != uintptr(0)) {
goto __116
}
if !(int32((*Index)(unsafe.Pointer(pThis)).FonError) != OE_Replace) {
@@ -97386,20 +98825,20 @@ __114:
__117:
;
__118:
- if !(((libc.AssignUintptr(&pNext, (*Index)(unsafe.Pointer(pThis)).FpNext)) != uintptr(0)) && (int32((*Index)(unsafe.Pointer(pNext)).FonError) != OE_Replace)) {
+ if !(libc.AssignUintptr(&pNext, (*Index)(unsafe.Pointer(pThis)).FpNext) != uintptr(0) && int32((*Index)(unsafe.Pointer(pNext)).FonError) != OE_Replace) {
goto __119
}
*(*uintptr)(unsafe.Pointer(ppFrom)) = pNext
(*Index)(unsafe.Pointer(pThis)).FpNext = (*Index)(unsafe.Pointer(pNext)).FpNext
(*Index)(unsafe.Pointer(pNext)).FpNext = pThis
- ppFrom = (pNext + 20 /* &.pNext */)
+ ppFrom = pNext + 20
goto __118
__119:
;
goto __116
goto __115
__115:
- ppFrom = (pThis + 20 /* &.pNext */)
+ ppFrom = pThis + 20
goto __114
goto __116
__116:
@@ -97428,12 +98867,12 @@ __113:
// Apart from that, we have little to go on besides intuition as to
// how aiRowEst[] should be initialized. The numbers generated here
// are based on typical values found in actual indices.
-func Xsqlite3DefaultRowEst(tls *libc.TLS, pIdx uintptr) { /* sqlite3.c:116669:21: */
+func Xsqlite3DefaultRowEst(tls *libc.TLS, pIdx uintptr) { /* sqlite3.c:117520:21: */
var a uintptr = (*Index)(unsafe.Pointer(pIdx)).FaiRowLogEst
var x LogEst
var nCopy int32 = func() int32 {
- if (int32(uint32(unsafe.Sizeof(aVal)) / uint32(unsafe.Sizeof(LogEst(0))))) < (int32((*Index)(unsafe.Pointer(pIdx)).FnKeyCol)) {
- return (int32(uint32(unsafe.Sizeof(aVal)) / uint32(unsafe.Sizeof(LogEst(0)))))
+ if int32(uint32(unsafe.Sizeof(aVal))/uint32(unsafe.Sizeof(LogEst(0)))) < int32((*Index)(unsafe.Pointer(pIdx)).FnKeyCol) {
+ return int32(uint32(unsafe.Sizeof(aVal)) / uint32(unsafe.Sizeof(LogEst(0))))
}
return int32((*Index)(unsafe.Pointer(pIdx)).FnKeyCol)
}()
@@ -97456,27 +98895,27 @@ func Xsqlite3DefaultRowEst(tls *libc.TLS, pIdx uintptr) { /* sqlite3.c:116669:21
(*Table)(unsafe.Pointer((*Index)(unsafe.Pointer(pIdx)).FpTable)).FnRowLogEst = libc.AssignInt16(&x, int16(99))
}
if (*Index)(unsafe.Pointer(pIdx)).FpPartIdxWhere != uintptr(0) {
- x = int16(int32(x) - (10))
+ x = int16(int32(x) - 10)
}
*(*LogEst)(unsafe.Pointer(a)) = x
// Estimate that a[1] is 10, a[2] is 9, a[3] is 8, a[4] is 7, a[5] is
// 6 and each subsequent value (if any) is 5.
- libc.Xmemcpy(tls, (a + 1*2), uintptr(unsafe.Pointer(&aVal)), (uint32(nCopy) * uint32(unsafe.Sizeof(LogEst(0)))))
- for i = (nCopy + 1); i <= int32((*Index)(unsafe.Pointer(pIdx)).FnKeyCol); i++ {
+ libc.Xmemcpy(tls, a+1*2, uintptr(unsafe.Pointer(&aVal)), uint32(nCopy)*uint32(unsafe.Sizeof(LogEst(0))))
+ for i = nCopy + 1; i <= int32((*Index)(unsafe.Pointer(pIdx)).FnKeyCol); i++ {
*(*LogEst)(unsafe.Pointer(a + uintptr(i)*2)) = int16(23)
}
- if int32((*Index)(unsafe.Pointer((pIdx))).FonError) != OE_None {
+ if int32((*Index)(unsafe.Pointer(pIdx)).FonError) != OE_None {
*(*LogEst)(unsafe.Pointer(a + uintptr((*Index)(unsafe.Pointer(pIdx)).FnKeyCol)*2)) = int16(0)
}
}
-var aVal = [5]LogEst{int16(33), int16(32), int16(30), int16(28), int16(26)} /* sqlite3.c:116671:23 */
+var aVal = [5]LogEst{int16(33), int16(32), int16(30), int16(28), int16(26)} /* sqlite3.c:117522:23 */
// This routine will drop an existing named index. This routine
// implements the DROP INDEX statement.
-func Xsqlite3DropIndex(tls *libc.TLS, pParse uintptr, pName uintptr, ifExists int32) { /* sqlite3.c:116713:21: */
+func Xsqlite3DropIndex(tls *libc.TLS, pParse uintptr, pName uintptr, ifExists int32) { /* sqlite3.c:117564:21: */
bp := tls.Alloc(32)
defer tls.Free(32)
@@ -97504,17 +98943,17 @@ __1:
goto exit_drop_index
__2:
;
- pIndex = Xsqlite3FindIndex(tls, db, (*SrcItem)(unsafe.Pointer((pName + 8 /* &.a */))).FzName, (*SrcItem)(unsafe.Pointer((pName + 8 /* &.a */))).FzDatabase)
+ pIndex = Xsqlite3FindIndex(tls, db, (*SrcItem)(unsafe.Pointer(pName+8)).FzName, (*SrcItem)(unsafe.Pointer(pName+8)).FzDatabase)
if !(pIndex == uintptr(0)) {
goto __3
}
- if !(!(ifExists != 0)) {
+ if !!(ifExists != 0) {
goto __4
}
- Xsqlite3ErrorMsg(tls, pParse, ts+12981 /* "no such index: %..." */, libc.VaList(bp, pName+8 /* &.a */))
+ Xsqlite3ErrorMsg(tls, pParse, ts+14164 /* "no such index: %..." */, libc.VaList(bp, pName+8))
goto __5
__4:
- Xsqlite3CodeVerifyNamedSchema(tls, pParse, (*SrcItem)(unsafe.Pointer((pName + 8 /* &.a */))).FzDatabase)
+ Xsqlite3CodeVerifyNamedSchema(tls, pParse, (*SrcItem)(unsafe.Pointer(pName+8)).FzDatabase)
sqlite3ForceNotReadOnly(tls, pParse)
__5:
;
@@ -97522,11 +98961,11 @@ __5:
goto exit_drop_index
__3:
;
- if !((int32(*(*uint16)(unsafe.Pointer(pIndex + 56 /* &.idxType */)) & 0x3 >> 0)) != SQLITE_IDXTYPE_APPDEF) {
+ if !(int32(*(*uint16)(unsafe.Pointer(pIndex + 56))&0x3>>0) != SQLITE_IDXTYPE_APPDEF) {
goto __6
}
Xsqlite3ErrorMsg(tls, pParse,
- ts+12999 /* "index associated..." */, libc.VaList(bp+8, 0))
+ ts+14182 /* "index associated..." */, libc.VaList(bp+8, 0))
goto exit_drop_index
__6:
;
@@ -97536,10 +98975,10 @@ __6:
pTab = (*Index)(unsafe.Pointer(pIndex)).FpTable
zDb = (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*16)).FzDbSName
zTab = func() uintptr {
- if (!(0 != 0)) && (iDb == 1) {
- return ts + 10872 /* "sqlite_temp_mast..." */
+ if !(0 != 0) && iDb == 1 {
+ return ts + 11986
}
- return ts + 4956 /* "sqlite_master" */
+ return ts + 5803
}()
if !(Xsqlite3AuthCheck(tls, pParse, SQLITE_DELETE, zTab, uintptr(0), zDb) != 0) {
goto __7
@@ -97547,7 +98986,7 @@ __6:
goto exit_drop_index
__7:
;
- if !(!(0 != 0) && (iDb == 1)) {
+ if !(!(0 != 0) && iDb == 1) {
goto __8
}
code = SQLITE_DROP_TEMP_INDEX
@@ -97567,9 +99006,9 @@ __9:
}
Xsqlite3BeginWriteOperation(tls, pParse, 1, iDb)
Xsqlite3NestedParse(tls, pParse,
- ts+13072, /* "DELETE FROM %Q.s..." */
+ ts+14255, /* "DELETE FROM %Q.s..." */
libc.VaList(bp+16, (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+uintptr(iDb)*16)).FzDbSName, (*Index)(unsafe.Pointer(pIndex)).FzName))
- sqlite3ClearStatTables(tls, pParse, iDb, ts+10212 /* "idx" */, (*Index)(unsafe.Pointer(pIndex)).FzName)
+ sqlite3ClearStatTables(tls, pParse, iDb, ts+11326 /* "idx" */, (*Index)(unsafe.Pointer(pIndex)).FzName)
Xsqlite3ChangeCookie(tls, pParse, iDb)
destroyRootPage(tls, pParse, int32((*Index)(unsafe.Pointer(pIndex)).Ftnum), iDb)
Xsqlite3VdbeAddOp4(tls, v, OP_DropIndex, iDb, 0, 0, (*Index)(unsafe.Pointer(pIndex)).FzName, 0)
@@ -97595,17 +99034,17 @@ exit_drop_index:
//
// Otherwise, if the realloc() fails, *pIdx is set to -1, *pnEntry remains
// unchanged and a copy of pArray returned.
-func Xsqlite3ArrayAllocate(tls *libc.TLS, db uintptr, pArray uintptr, szEntry int32, pnEntry uintptr, pIdx uintptr) uintptr { /* sqlite3.c:116795:21: */
+func Xsqlite3ArrayAllocate(tls *libc.TLS, db uintptr, pArray uintptr, szEntry int32, pnEntry uintptr, pIdx uintptr) uintptr { /* sqlite3.c:117646:21: */
var z uintptr
var n Sqlite3_int64 = Sqlite3_int64(libc.AssignPtrInt32(pIdx, *(*int32)(unsafe.Pointer(pnEntry))))
- if (n & (n - int64(1))) == int64(0) {
+ if n&(n-int64(1)) == int64(0) {
var sz Sqlite3_int64
if n == int64(0) {
sz = int64(1)
} else {
- sz = (int64(2) * n)
+ sz = int64(2) * n
}
- var pNew uintptr = Xsqlite3DbRealloc(tls, db, pArray, (uint64(sz * Sqlite3_int64(szEntry))))
+ var pNew uintptr = Xsqlite3DbRealloc(tls, db, pArray, uint64(sz*Sqlite3_int64(szEntry)))
if pNew == uintptr(0) {
*(*int32)(unsafe.Pointer(pIdx)) = -1
return pArray
@@ -97613,7 +99052,7 @@ func Xsqlite3ArrayAllocate(tls *libc.TLS, db uintptr, pArray uintptr, szEntry in
pArray = pNew
}
z = pArray
- libc.Xmemset(tls, (z + uintptr((n * Sqlite3_int64(szEntry)))), 0, uint32(szEntry))
+ libc.Xmemset(tls, z+uintptr(n*Sqlite3_int64(szEntry)), 0, uint32(szEntry))
*(*int32)(unsafe.Pointer(pnEntry))++
return pArray
}
@@ -97622,7 +99061,7 @@ func Xsqlite3ArrayAllocate(tls *libc.TLS, db uintptr, pArray uintptr, szEntry in
// need be.
//
// A new IdList is returned, or NULL if malloc() fails.
-func Xsqlite3IdListAppend(tls *libc.TLS, pParse uintptr, pList uintptr, pToken uintptr) uintptr { /* sqlite3.c:116825:23: */
+func Xsqlite3IdListAppend(tls *libc.TLS, pParse uintptr, pList uintptr, pToken uintptr) uintptr { /* sqlite3.c:117676:23: */
bp := tls.Alloc(4)
defer tls.Free(4)
@@ -97639,21 +99078,21 @@ func Xsqlite3IdListAppend(tls *libc.TLS, pParse uintptr, pList uintptr, pToken u
db,
(*IdList)(unsafe.Pointer(pList)).Fa,
int32(unsafe.Sizeof(IdList_item{})),
- (pList + 4 /* &.nId */),
+ pList+4,
bp /* &i */)
- if *(*int32)(unsafe.Pointer(bp /* i */)) < 0 {
+ if *(*int32)(unsafe.Pointer(bp)) < 0 {
Xsqlite3IdListDelete(tls, db, pList)
return uintptr(0)
}
(*IdList_item)(unsafe.Pointer((*IdList)(unsafe.Pointer(pList)).Fa + uintptr(*(*int32)(unsafe.Pointer(bp /* i */)))*8)).FzName = Xsqlite3NameFromToken(tls, db, pToken)
- if (int32((*Parse)(unsafe.Pointer(pParse)).FeParseMode) >= PARSE_MODE_RENAME) && ((*IdList_item)(unsafe.Pointer((*IdList)(unsafe.Pointer(pList)).Fa+uintptr(*(*int32)(unsafe.Pointer(bp /* i */)))*8)).FzName != 0) {
+ if int32((*Parse)(unsafe.Pointer(pParse)).FeParseMode) >= PARSE_MODE_RENAME && (*IdList_item)(unsafe.Pointer((*IdList)(unsafe.Pointer(pList)).Fa+uintptr(*(*int32)(unsafe.Pointer(bp)))*8)).FzName != 0 {
Xsqlite3RenameTokenMap(tls, pParse, (*IdList_item)(unsafe.Pointer((*IdList)(unsafe.Pointer(pList)).Fa+uintptr(*(*int32)(unsafe.Pointer(bp /* i */)))*8)).FzName, pToken)
}
return pList
}
// Delete an IdList.
-func Xsqlite3IdListDelete(tls *libc.TLS, db uintptr, pList uintptr) { /* sqlite3.c:116853:21: */
+func Xsqlite3IdListDelete(tls *libc.TLS, db uintptr, pList uintptr) { /* sqlite3.c:117704:21: */
var i int32
if pList == uintptr(0) {
return
@@ -97667,7 +99106,7 @@ func Xsqlite3IdListDelete(tls *libc.TLS, db uintptr, pList uintptr) { /* sqlite3
// Return the index in pList of the identifier named zId. Return -1
// if not found.
-func Xsqlite3IdListIndex(tls *libc.TLS, pList uintptr, zName uintptr) int32 { /* sqlite3.c:116867:20: */
+func Xsqlite3IdListIndex(tls *libc.TLS, pList uintptr, zName uintptr) int32 { /* sqlite3.c:117718:20: */
var i int32
if pList == uintptr(0) {
return -1
@@ -97705,7 +99144,7 @@ func Xsqlite3IdListIndex(tls *libc.TLS, pList uintptr, zName uintptr) int32 { /*
// If a memory allocation fails or the SrcList becomes too large, leave
// the original SrcList unchanged, return NULL, and leave an error message
// in pParse.
-func Xsqlite3SrcListEnlarge(tls *libc.TLS, pParse uintptr, pSrc uintptr, nExtra int32, iStart int32) uintptr { /* sqlite3.c:116908:24: */
+func Xsqlite3SrcListEnlarge(tls *libc.TLS, pParse uintptr, pSrc uintptr, nExtra int32, iStart int32) uintptr { /* sqlite3.c:117759:24: */
bp := tls.Alloc(8)
defer tls.Free(8)
@@ -97714,13 +99153,13 @@ func Xsqlite3SrcListEnlarge(tls *libc.TLS, pParse uintptr, pSrc uintptr, nExtra
// Sanity checking on calling parameters
// Allocate additional space if needed
- if (U32((*SrcList)(unsafe.Pointer(pSrc)).FnSrc) + U32(nExtra)) > (*SrcList)(unsafe.Pointer(pSrc)).FnAlloc {
+ if U32((*SrcList)(unsafe.Pointer(pSrc)).FnSrc)+U32(nExtra) > (*SrcList)(unsafe.Pointer(pSrc)).FnAlloc {
var pNew uintptr
- var nAlloc Sqlite3_int64 = ((int64(2) * Sqlite3_int64((*SrcList)(unsafe.Pointer(pSrc)).FnSrc)) + Sqlite3_int64(nExtra))
+ var nAlloc Sqlite3_int64 = int64(2)*Sqlite3_int64((*SrcList)(unsafe.Pointer(pSrc)).FnSrc) + Sqlite3_int64(nExtra)
var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb
- if ((*SrcList)(unsafe.Pointer(pSrc)).FnSrc + nExtra) >= SQLITE_MAX_SRCLIST {
- Xsqlite3ErrorMsg(tls, pParse, ts+13132, /* "too many FROM cl..." */
+ if (*SrcList)(unsafe.Pointer(pSrc)).FnSrc+nExtra >= SQLITE_MAX_SRCLIST {
+ Xsqlite3ErrorMsg(tls, pParse, ts+14315, /* "too many FROM cl..." */
libc.VaList(bp, SQLITE_MAX_SRCLIST))
return uintptr(0)
}
@@ -97728,7 +99167,7 @@ func Xsqlite3SrcListEnlarge(tls *libc.TLS, pParse uintptr, pSrc uintptr, nExtra
nAlloc = int64(SQLITE_MAX_SRCLIST)
}
pNew = Xsqlite3DbRealloc(tls, db, pSrc,
- (uint64(Sqlite3_int64(unsafe.Sizeof(SrcList{})) + ((nAlloc - int64(1)) * Sqlite3_int64(unsafe.Sizeof(SrcItem{}))))))
+ uint64(Sqlite3_int64(unsafe.Sizeof(SrcList{}))+(nAlloc-int64(1))*Sqlite3_int64(unsafe.Sizeof(SrcItem{}))))
if pNew == uintptr(0) {
return uintptr(0)
@@ -97739,15 +99178,15 @@ func Xsqlite3SrcListEnlarge(tls *libc.TLS, pParse uintptr, pSrc uintptr, nExtra
// Move existing slots that come after the newly inserted slots
// out of the way
- for i = ((*SrcList)(unsafe.Pointer(pSrc)).FnSrc - 1); i >= iStart; i-- {
- *(*SrcItem)(unsafe.Pointer((pSrc + 8 /* &.a */) + uintptr((i+nExtra))*72)) = *(*SrcItem)(unsafe.Pointer((pSrc + 8 /* &.a */) + uintptr(i)*72))
+ for i = (*SrcList)(unsafe.Pointer(pSrc)).FnSrc - 1; i >= iStart; i-- {
+ *(*SrcItem)(unsafe.Pointer(pSrc + 8 + uintptr(i+nExtra)*72)) = *(*SrcItem)(unsafe.Pointer(pSrc + 8 + uintptr(i)*72))
}
- *(*int32)(unsafe.Pointer(pSrc /* &.nSrc */)) += (nExtra)
+ *(*int32)(unsafe.Pointer(pSrc)) += nExtra
// Zero the newly allocated slots
- libc.Xmemset(tls, ((pSrc + 8 /* &.a */) + uintptr(iStart)*72), 0, (uint32(unsafe.Sizeof(SrcItem{})) * uint32(nExtra)))
- for i = iStart; i < (iStart + nExtra); i++ {
- (*SrcItem)(unsafe.Pointer((pSrc + 8 /* &.a */) + uintptr(i)*72)).FiCursor = -1
+ libc.Xmemset(tls, pSrc+8+uintptr(iStart)*72, 0, uint32(unsafe.Sizeof(SrcItem{}))*uint32(nExtra))
+ for i = iStart; i < iStart+nExtra; i++ {
+ (*SrcItem)(unsafe.Pointer(pSrc + 8 + uintptr(i)*72)).FiCursor = -1
}
// Return a pointer to the enlarged SrcList
@@ -97787,7 +99226,7 @@ func Xsqlite3SrcListEnlarge(tls *libc.TLS, pParse uintptr, pSrc uintptr, nExtra
//
// Both pTable and pDatabase are assumed to be quoted. They are dequoted
// before being added to the SrcList.
-func Xsqlite3SrcListAppend(tls *libc.TLS, pParse uintptr, pList uintptr, pTable uintptr, pDatabase uintptr) uintptr { /* sqlite3.c:116997:24: */
+func Xsqlite3SrcListAppend(tls *libc.TLS, pParse uintptr, pList uintptr, pTable uintptr, pDatabase uintptr) uintptr { /* sqlite3.c:117848:24: */
var pItem uintptr
var db uintptr
// Cannot have C without B
@@ -97800,8 +99239,8 @@ func Xsqlite3SrcListAppend(tls *libc.TLS, pParse uintptr, pList uintptr, pTable
}
(*SrcList)(unsafe.Pointer(pList)).FnAlloc = U32(1)
(*SrcList)(unsafe.Pointer(pList)).FnSrc = 1
- libc.Xmemset(tls, (pList + 8 /* &.a */), 0, uint32(unsafe.Sizeof(SrcItem{})))
- (*SrcItem)(unsafe.Pointer((pList + 8 /* &.a */))).FiCursor = -1
+ libc.Xmemset(tls, pList+8, 0, uint32(unsafe.Sizeof(SrcItem{})))
+ (*SrcItem)(unsafe.Pointer(pList + 8)).FiCursor = -1
} else {
var pNew uintptr = Xsqlite3SrcListEnlarge(tls, pParse, pList, 1, (*SrcList)(unsafe.Pointer(pList)).FnSrc)
if pNew == uintptr(0) {
@@ -97811,8 +99250,8 @@ func Xsqlite3SrcListAppend(tls *libc.TLS, pParse uintptr, pList uintptr, pTable
pList = pNew
}
}
- pItem = ((pList + 8 /* &.a */) + uintptr(((*SrcList)(unsafe.Pointer(pList)).FnSrc-1))*72)
- if (pDatabase != 0) && ((*Token)(unsafe.Pointer(pDatabase)).Fz == uintptr(0)) {
+ pItem = pList + 8 + uintptr((*SrcList)(unsafe.Pointer(pList)).FnSrc-1)*72
+ if pDatabase != 0 && (*Token)(unsafe.Pointer(pDatabase)).Fz == uintptr(0) {
pDatabase = uintptr(0)
}
if pDatabase != 0 {
@@ -97826,7 +99265,7 @@ func Xsqlite3SrcListAppend(tls *libc.TLS, pParse uintptr, pList uintptr, pTable
}
// Assign VdbeCursor index numbers to all tables in a SrcList
-func Xsqlite3SrcListAssignCursors(tls *libc.TLS, pParse uintptr, pList uintptr) { /* sqlite3.c:117042:21: */
+func Xsqlite3SrcListAssignCursors(tls *libc.TLS, pParse uintptr, pList uintptr) { /* sqlite3.c:117893:21: */
var i int32
var pItem uintptr
@@ -97858,7 +99297,7 @@ func Xsqlite3SrcListAssignCursors(tls *libc.TLS, pParse uintptr, pList uintptr)
}
// Delete an entire SrcList including all its substructure.
-func Xsqlite3SrcListDelete(tls *libc.TLS, db uintptr, pList uintptr) { /* sqlite3.c:117060:21: */
+func Xsqlite3SrcListDelete(tls *libc.TLS, db uintptr, pList uintptr) { /* sqlite3.c:117911:21: */
var i int32
var pItem uintptr
if pList == uintptr(0) {
@@ -97878,11 +99317,11 @@ __1:
if (*SrcItem)(unsafe.Pointer(pItem)).FzAlias != 0 {
Xsqlite3DbFreeNN(tls, db, (*SrcItem)(unsafe.Pointer(pItem)).FzAlias)
}
- if (uint32(int32(*(*uint16)(unsafe.Pointer(pItem + 36 /* &.fg */ + 4 /* &.isIndexedBy */)) & 0x2 >> 1))) != 0 {
- Xsqlite3DbFree(tls, db, *(*uintptr)(unsafe.Pointer(pItem + 64 /* &.u1 */)))
+ if uint32(int32(*(*uint16)(unsafe.Pointer(pItem + 36 + 4))&0x2>>1)) != 0 {
+ Xsqlite3DbFree(tls, db, *(*uintptr)(unsafe.Pointer(pItem + 64)))
}
- if (uint32(int32(*(*uint16)(unsafe.Pointer(pItem + 36 /* &.fg */ + 4 /* &.isTabFunc */)) & 0x4 >> 2))) != 0 {
- Xsqlite3ExprListDelete(tls, db, *(*uintptr)(unsafe.Pointer(pItem + 64 /* &.u1 */)))
+ if uint32(int32(*(*uint16)(unsafe.Pointer(pItem + 36 + 4))&0x4>>2)) != 0 {
+ Xsqlite3ExprListDelete(tls, db, *(*uintptr)(unsafe.Pointer(pItem + 64)))
}
Xsqlite3DeleteTable(tls, db, (*SrcItem)(unsafe.Pointer(pItem)).FpTab)
if (*SrcItem)(unsafe.Pointer(pItem)).FpSelect != 0 {
@@ -97921,7 +99360,7 @@ __3:
//
// Return a new SrcList which encodes is the FROM with the new
// term added.
-func Xsqlite3SrcListAppendFromTerm(tls *libc.TLS, pParse uintptr, p uintptr, pTable uintptr, pDatabase uintptr, pAlias uintptr, pSubquery uintptr, pOn uintptr, pUsing uintptr) uintptr { /* sqlite3.c:117094:24: */
+func Xsqlite3SrcListAppendFromTerm(tls *libc.TLS, pParse uintptr, p uintptr, pTable uintptr, pDatabase uintptr, pAlias uintptr, pSubquery uintptr, pOn uintptr, pUsing uintptr) uintptr { /* sqlite3.c:117945:24: */
bp := tls.Alloc(8)
defer tls.Free(8)
@@ -97929,15 +99368,15 @@ func Xsqlite3SrcListAppendFromTerm(tls *libc.TLS, pParse uintptr, p uintptr, pTa
var db uintptr
var pToken uintptr
db = (*Parse)(unsafe.Pointer(pParse)).Fdb
- if !(!(p != 0) && ((pOn != 0) || (pUsing != 0))) {
+ if !(!(p != 0) && (pOn != 0 || pUsing != 0)) {
goto __1
}
- Xsqlite3ErrorMsg(tls, pParse, ts+13168, /* "a JOIN clause is..." */
+ Xsqlite3ErrorMsg(tls, pParse, ts+14351, /* "a JOIN clause is..." */
libc.VaList(bp, func() uintptr {
if pOn != 0 {
- return ts + 13204 /* "ON" */
+ return ts + 14387 /* "ON" */
}
- return ts + 13207 /* "USING" */
+ return ts + 14390 /* "USING" */
}()))
goto append_from_error
__1:
@@ -97950,12 +99389,12 @@ __1:
__2:
;
- pItem = ((p + 8 /* &.a */) + uintptr(((*SrcList)(unsafe.Pointer(p)).FnSrc-1))*72)
+ pItem = p + 8 + uintptr((*SrcList)(unsafe.Pointer(p)).FnSrc-1)*72
- if !((int32((*Parse)(unsafe.Pointer(pParse)).FeParseMode) >= PARSE_MODE_RENAME) && ((*SrcItem)(unsafe.Pointer(pItem)).FzName != 0)) {
+ if !(int32((*Parse)(unsafe.Pointer(pParse)).FeParseMode) >= PARSE_MODE_RENAME && (*SrcItem)(unsafe.Pointer(pItem)).FzName != 0) {
goto __3
}
- if (pDatabase != 0) && ((*Token)(unsafe.Pointer(pDatabase)).Fz != 0) {
+ if pDatabase != 0 && (*Token)(unsafe.Pointer(pDatabase)).Fz != 0 {
pToken = pDatabase
} else {
pToken = pTable
@@ -97985,20 +99424,21 @@ append_from_error:
// Add an INDEXED BY or NOT INDEXED clause to the most recently added
// element of the source-list passed as the second argument.
-func Xsqlite3SrcListIndexedBy(tls *libc.TLS, pParse uintptr, p uintptr, pIndexedBy uintptr) { /* sqlite3.c:117145:21: */
+func Xsqlite3SrcListIndexedBy(tls *libc.TLS, pParse uintptr, p uintptr, pIndexedBy uintptr) { /* sqlite3.c:117996:21: */
- if (p != 0) && ((*Token)(unsafe.Pointer(pIndexedBy)).Fn > uint32(0)) {
+ if p != 0 && (*Token)(unsafe.Pointer(pIndexedBy)).Fn > uint32(0) {
var pItem uintptr
- pItem = ((p + 8 /* &.a */) + uintptr(((*SrcList)(unsafe.Pointer(p)).FnSrc-1))*72)
+ pItem = p + 8 + uintptr((*SrcList)(unsafe.Pointer(p)).FnSrc-1)*72
- if ((*Token)(unsafe.Pointer(pIndexedBy)).Fn == uint32(1)) && !(int32((*Token)(unsafe.Pointer(pIndexedBy)).Fz) != 0) {
+ if (*Token)(unsafe.Pointer(pIndexedBy)).Fn == uint32(1) && !(int32((*Token)(unsafe.Pointer(pIndexedBy)).Fz) != 0) {
// A "NOT INDEXED" clause was supplied. See parse.y
// construct "indexed_opt" for details.
- libc.SetBitFieldPtr16Uint32(pItem+36 /* &.fg */ +4 /* &.notIndexed */, uint32(1), 0, 0x1)
+ libc.SetBitFieldPtr16Uint32(pItem+36+4, uint32(1), 0, 0x1)
} else {
- *(*uintptr)(unsafe.Pointer(pItem + 64 /* &.u1 */)) = Xsqlite3NameFromToken(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, pIndexedBy)
- libc.SetBitFieldPtr16Uint32(pItem+36 /* &.fg */ +4 /* &.isIndexedBy */, uint32(1), 1, 0x2)
+ *(*uintptr)(unsafe.Pointer(pItem + 64)) = Xsqlite3NameFromToken(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, pIndexedBy)
+ libc.SetBitFieldPtr16Uint32(pItem+36+4, uint32(1), 1, 0x2)
+ // No collision on union u2
}
}
}
@@ -98006,7 +99446,7 @@ func Xsqlite3SrcListIndexedBy(tls *libc.TLS, pParse uintptr, p uintptr, pIndexed
// Append the contents of SrcList p2 to SrcList p1 and return the resulting
// SrcList. Or, if an error occurs, return NULL. In all cases, p1 and p2
// are deleted by this function.
-func Xsqlite3SrcListAppendList(tls *libc.TLS, pParse uintptr, p1 uintptr, p2 uintptr) uintptr { /* sqlite3.c:117170:24: */
+func Xsqlite3SrcListAppendList(tls *libc.TLS, pParse uintptr, p1 uintptr, p2 uintptr) uintptr { /* sqlite3.c:118022:24: */
if p2 != 0 {
var pNew uintptr = Xsqlite3SrcListEnlarge(tls, pParse, p1, (*SrcList)(unsafe.Pointer(p2)).FnSrc, 1)
@@ -98014,7 +99454,7 @@ func Xsqlite3SrcListAppendList(tls *libc.TLS, pParse uintptr, p1 uintptr, p2 uin
Xsqlite3SrcListDelete(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, p2)
} else {
p1 = pNew
- libc.Xmemcpy(tls, ((p1 + 8 /* &.a */) + 1*72), p2+8 /* &.a */, (uint32((*SrcList)(unsafe.Pointer(p2)).FnSrc) * uint32(unsafe.Sizeof(SrcItem{}))))
+ libc.Xmemcpy(tls, p1+8+1*72, p2+8, uint32((*SrcList)(unsafe.Pointer(p2)).FnSrc)*uint32(unsafe.Sizeof(SrcItem{})))
Xsqlite3DbFree(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, p2)
}
}
@@ -98023,12 +99463,12 @@ func Xsqlite3SrcListAppendList(tls *libc.TLS, pParse uintptr, p1 uintptr, p2 uin
// Add the list of function arguments to the SrcList entry for a
// table-valued-function.
-func Xsqlite3SrcListFuncArgs(tls *libc.TLS, pParse uintptr, p uintptr, pList uintptr) { /* sqlite3.c:117189:21: */
+func Xsqlite3SrcListFuncArgs(tls *libc.TLS, pParse uintptr, p uintptr, pList uintptr) { /* sqlite3.c:118041:21: */
if p != 0 {
- var pItem uintptr = ((p + 8 /* &.a */) + uintptr(((*SrcList)(unsafe.Pointer(p)).FnSrc-1))*72)
+ var pItem uintptr = p + 8 + uintptr((*SrcList)(unsafe.Pointer(p)).FnSrc-1)*72
- *(*uintptr)(unsafe.Pointer(pItem + 64 /* &.u1 */)) = pList
- libc.SetBitFieldPtr16Uint32(pItem+36 /* &.fg */ +4 /* &.isTabFunc */, uint32(1), 2, 0x4)
+ *(*uintptr)(unsafe.Pointer(pItem + 64)) = pList
+ libc.SetBitFieldPtr16Uint32(pItem+36+4, uint32(1), 2, 0x4)
} else {
Xsqlite3ExprListDelete(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, pList)
}
@@ -98047,25 +99487,25 @@ func Xsqlite3SrcListFuncArgs(tls *libc.TLS, pParse uintptr, p uintptr, pList uin
// The operator is "natural cross join". The A and B operands are stored
// in p->a[0] and p->a[1], respectively. The parser initially stores the
// operator with A. This routine shifts that operator over to B.
-func Xsqlite3SrcListShiftJoinType(tls *libc.TLS, p uintptr) { /* sqlite3.c:117217:21: */
+func Xsqlite3SrcListShiftJoinType(tls *libc.TLS, p uintptr) { /* sqlite3.c:118069:21: */
if p != 0 {
var i int32
- for i = ((*SrcList)(unsafe.Pointer(p)).FnSrc - 1); i > 0; i-- {
- (*SrcItem)(unsafe.Pointer((p + 8 /* &.a */) + uintptr(i)*72)).Ffg.Fjointype = (*SrcItem)(unsafe.Pointer((p + 8 /* &.a */) + uintptr((i-1))*72)).Ffg.Fjointype
+ for i = (*SrcList)(unsafe.Pointer(p)).FnSrc - 1; i > 0; i-- {
+ (*SrcItem)(unsafe.Pointer(p + 8 + uintptr(i)*72)).Ffg.Fjointype = (*SrcItem)(unsafe.Pointer(p + 8 + uintptr(i-1)*72)).Ffg.Fjointype
}
- (*SrcItem)(unsafe.Pointer((p + 8 /* &.a */))).Ffg.Fjointype = U8(0)
+ (*SrcItem)(unsafe.Pointer(p + 8)).Ffg.Fjointype = U8(0)
}
}
// Generate VDBE code for a BEGIN statement.
-func Xsqlite3BeginTransaction(tls *libc.TLS, pParse uintptr, type1 int32) { /* sqlite3.c:117230:21: */
+func Xsqlite3BeginTransaction(tls *libc.TLS, pParse uintptr, type1 int32) { /* sqlite3.c:118082:21: */
var db uintptr
var v uintptr
var i int32
db = (*Parse)(unsafe.Pointer(pParse)).Fdb
- if Xsqlite3AuthCheck(tls, pParse, SQLITE_TRANSACTION, ts+13213 /* "BEGIN" */, uintptr(0), uintptr(0)) != 0 {
+ if Xsqlite3AuthCheck(tls, pParse, SQLITE_TRANSACTION, ts+14396, uintptr(0), uintptr(0)) != 0 {
return
}
v = Xsqlite3GetVdbe(tls, pParse)
@@ -98076,7 +99516,7 @@ func Xsqlite3BeginTransaction(tls *libc.TLS, pParse uintptr, type1 int32) { /* s
for i = 0; i < (*Sqlite3)(unsafe.Pointer(db)).FnDb; i++ {
var eTxnType int32
var pBt uintptr = (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb + uintptr(i)*16)).FpBt
- if (pBt != 0) && (Xsqlite3BtreeIsReadonly(tls, pBt) != 0) {
+ if pBt != 0 && Xsqlite3BtreeIsReadonly(tls, pBt) != 0 {
eTxnType = 0 // Read txn
} else if type1 == TK_EXCLUSIVE {
eTxnType = 2 // Exclusive txn
@@ -98093,17 +99533,17 @@ func Xsqlite3BeginTransaction(tls *libc.TLS, pParse uintptr, type1 int32) { /* s
// Generate VDBE code for a COMMIT or ROLLBACK statement.
// Code for ROLLBACK is generated if eType==TK_ROLLBACK. Otherwise
// code is generated for a COMMIT.
-func Xsqlite3EndTransaction(tls *libc.TLS, pParse uintptr, eType int32) { /* sqlite3.c:117266:21: */
+func Xsqlite3EndTransaction(tls *libc.TLS, pParse uintptr, eType int32) { /* sqlite3.c:118118:21: */
var v uintptr
var isRollback int32
- isRollback = (libc.Bool32(eType == TK_ROLLBACK))
+ isRollback = libc.Bool32(eType == TK_ROLLBACK)
if Xsqlite3AuthCheck(tls, pParse, SQLITE_TRANSACTION,
func() uintptr {
if isRollback != 0 {
- return ts + 13219 /* "ROLLBACK" */
+ return ts + 14402
}
- return ts + 13228 /* "COMMIT" */
+ return ts + 14411
}(), uintptr(0), uintptr(0)) != 0 {
return
}
@@ -98115,12 +99555,12 @@ func Xsqlite3EndTransaction(tls *libc.TLS, pParse uintptr, eType int32) { /* sql
// This function is called by the parser when it parses a command to create,
// release or rollback an SQL savepoint.
-func Xsqlite3Savepoint(tls *libc.TLS, pParse uintptr, op int32, pName uintptr) { /* sqlite3.c:117288:21: */
+func Xsqlite3Savepoint(tls *libc.TLS, pParse uintptr, op int32, pName uintptr) { /* sqlite3.c:118140:21: */
var zName uintptr = Xsqlite3NameFromToken(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, pName)
if zName != 0 {
var v uintptr = Xsqlite3GetVdbe(tls, pParse)
- if !(v != 0) || (Xsqlite3AuthCheck(tls, pParse, SQLITE_SAVEPOINT, az[op], zName, uintptr(0)) != 0) {
+ if !(v != 0) || Xsqlite3AuthCheck(tls, pParse, SQLITE_SAVEPOINT, az[op], zName, uintptr(0)) != 0 {
Xsqlite3DbFree(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, zName)
return
}
@@ -98128,29 +99568,29 @@ func Xsqlite3Savepoint(tls *libc.TLS, pParse uintptr, op int32, pName uintptr) {
}
}
-var az = [3]uintptr{ts + 13213 /* "BEGIN" */, ts + 13235 /* "RELEASE" */, ts + 13219 /* "ROLLBACK" */} /* sqlite3.c:117293:23 */
+var az = [3]uintptr{ts + 14396 /* "BEGIN" */, ts + 14418 /* "RELEASE" */, ts + 14402 /* "ROLLBACK" */} /* sqlite3.c:118145:23 */
// Make sure the TEMP database is open and available for use. Return
// the number of errors. Leave any error messages in the pParse structure.
-func Xsqlite3OpenTempDatabase(tls *libc.TLS, pParse uintptr) int32 { /* sqlite3.c:117308:20: */
+func Xsqlite3OpenTempDatabase(tls *libc.TLS, pParse uintptr) int32 { /* sqlite3.c:118160:20: */
bp := tls.Alloc(4)
defer tls.Free(4)
var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb
- if ((*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+1*16)).FpBt == uintptr(0)) && !(int32((*Parse)(unsafe.Pointer(pParse)).Fexplain) != 0) {
+ if (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+1*16)).FpBt == uintptr(0) && !(int32((*Parse)(unsafe.Pointer(pParse)).Fexplain) != 0) {
var rc int32
// var pBt uintptr at bp, 4
rc = Xsqlite3BtreeOpen(tls, (*Sqlite3)(unsafe.Pointer(db)).FpVfs, uintptr(0), db, bp /* &pBt */, 0, flags)
if rc != SQLITE_OK {
Xsqlite3ErrorMsg(tls, pParse,
- ts+13243 /* "unable to open a..." */, 0)
+ ts+14426 /* "unable to open a..." */, 0)
(*Parse)(unsafe.Pointer(pParse)).Frc = rc
return 1
}
(*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb + 1*16)).FpBt = *(*uintptr)(unsafe.Pointer(bp /* pBt */))
- if SQLITE_NOMEM == Xsqlite3BtreeSetPageSize(tls, *(*uintptr)(unsafe.Pointer(bp /* pBt */)), (*Sqlite3)(unsafe.Pointer(db)).FnextPagesize, 0, 0) {
+ if SQLITE_NOMEM == Xsqlite3BtreeSetPageSize(tls, *(*uintptr)(unsafe.Pointer(bp)), (*Sqlite3)(unsafe.Pointer(db)).FnextPagesize, 0, 0) {
Xsqlite3OomFault(tls, db)
return 1
}
@@ -98158,23 +99598,23 @@ func Xsqlite3OpenTempDatabase(tls *libc.TLS, pParse uintptr) int32 { /* sqlite3.
return 0
}
-var flags int32 = ((((SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE) | SQLITE_OPEN_EXCLUSIVE) | SQLITE_OPEN_DELETEONCLOSE) | SQLITE_OPEN_TEMP_DB) /* sqlite3.c:117313:22 */
+var flags int32 = SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE | SQLITE_OPEN_EXCLUSIVE | SQLITE_OPEN_DELETEONCLOSE | SQLITE_OPEN_TEMP_DB /* sqlite3.c:118165:22 */
// Record the fact that the schema cookie will need to be verified
// for database iDb. The code to actually verify the schema cookie
// will occur at the end of the top-level VDBE and will be generated
// later, by sqlite3FinishCoding().
-func sqlite3CodeVerifySchemaAtToplevel(tls *libc.TLS, pToplevel uintptr, iDb int32) { /* sqlite3.c:117343:13: */
+func sqlite3CodeVerifySchemaAtToplevel(tls *libc.TLS, pToplevel uintptr, iDb int32) { /* sqlite3.c:118195:13: */
- if (libc.Bool32((((*Parse)(unsafe.Pointer(pToplevel)).FcookieMask) & (YDbMask((YDbMask(1))) << (iDb))) != YDbMask(0))) == 0 {
- *(*YDbMask)(unsafe.Pointer(pToplevel + 84 /* &.cookieMask */)) |= (YDbMask((YDbMask(1))) << (iDb))
- if !(0 != 0) && (iDb == 1) {
+ if libc.Bool32((*Parse)(unsafe.Pointer(pToplevel)).FcookieMask&(YDbMask(YDbMask(1))<<iDb) != YDbMask(0)) == 0 {
+ *(*YDbMask)(unsafe.Pointer(pToplevel + 84)) |= YDbMask(YDbMask(1)) << iDb
+ if !(0 != 0) && iDb == 1 {
Xsqlite3OpenTempDatabase(tls, pToplevel)
}
}
}
-func Xsqlite3CodeVerifySchema(tls *libc.TLS, pParse uintptr, iDb int32) { /* sqlite3.c:117355:21: */
+func Xsqlite3CodeVerifySchema(tls *libc.TLS, pParse uintptr, iDb int32) { /* sqlite3.c:118207:21: */
sqlite3CodeVerifySchemaAtToplevel(tls, func() uintptr {
if (*Parse)(unsafe.Pointer(pParse)).FpToplevel != 0 {
return (*Parse)(unsafe.Pointer(pParse)).FpToplevel
@@ -98185,12 +99625,12 @@ func Xsqlite3CodeVerifySchema(tls *libc.TLS, pParse uintptr, iDb int32) { /* sql
// If argument zDb is NULL, then call sqlite3CodeVerifySchema() for each
// attached database. Otherwise, invoke it for the database named zDb only.
-func Xsqlite3CodeVerifyNamedSchema(tls *libc.TLS, pParse uintptr, zDb uintptr) { /* sqlite3.c:117364:21: */
+func Xsqlite3CodeVerifyNamedSchema(tls *libc.TLS, pParse uintptr, zDb uintptr) { /* sqlite3.c:118216:21: */
var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb
var i int32
for i = 0; i < (*Sqlite3)(unsafe.Pointer(db)).FnDb; i++ {
- var pDb uintptr = ((*Sqlite3)(unsafe.Pointer(db)).FaDb + uintptr(i)*16)
- if ((*Db)(unsafe.Pointer(pDb)).FpBt != 0) && (!(zDb != 0) || (0 == Xsqlite3StrICmp(tls, zDb, (*Db)(unsafe.Pointer(pDb)).FzDbSName))) {
+ var pDb uintptr = (*Sqlite3)(unsafe.Pointer(db)).FaDb + uintptr(i)*16
+ if (*Db)(unsafe.Pointer(pDb)).FpBt != 0 && (!(zDb != 0) || 0 == Xsqlite3StrICmp(tls, zDb, (*Db)(unsafe.Pointer(pDb)).FzDbSName)) {
Xsqlite3CodeVerifySchema(tls, pParse, i)
}
}
@@ -98207,7 +99647,7 @@ func Xsqlite3CodeVerifyNamedSchema(tls *libc.TLS, pParse uintptr, zDb uintptr) {
// rollback the whole transaction. For operations where all constraints
// can be checked before any changes are made to the database, it is never
// necessary to undo a write and the checkpoint should not be set.
-func Xsqlite3BeginWriteOperation(tls *libc.TLS, pParse uintptr, setStatement int32, iDb int32) { /* sqlite3.c:117388:21: */
+func Xsqlite3BeginWriteOperation(tls *libc.TLS, pParse uintptr, setStatement int32, iDb int32) { /* sqlite3.c:118240:21: */
var pToplevel uintptr = func() uintptr {
if (*Parse)(unsafe.Pointer(pParse)).FpToplevel != 0 {
return (*Parse)(unsafe.Pointer(pParse)).FpToplevel
@@ -98215,8 +99655,8 @@ func Xsqlite3BeginWriteOperation(tls *libc.TLS, pParse uintptr, setStatement int
return pParse
}()
sqlite3CodeVerifySchemaAtToplevel(tls, pToplevel, iDb)
- *(*YDbMask)(unsafe.Pointer(pToplevel + 80 /* &.writeMask */)) |= (YDbMask((YDbMask(1))) << (iDb))
- *(*U8)(unsafe.Pointer(pToplevel + 20 /* &.isMultiWrite */)) |= U8((setStatement))
+ *(*YDbMask)(unsafe.Pointer(pToplevel + 80)) |= YDbMask(YDbMask(1)) << iDb
+ *(*U8)(unsafe.Pointer(pToplevel + 20)) |= U8(setStatement)
}
// Indicate that the statement currently under construction might write
@@ -98224,7 +99664,7 @@ func Xsqlite3BeginWriteOperation(tls *libc.TLS, pParse uintptr, setStatement int
// inserting multiple rows in a table, or inserting a row and index entries.)
// If an abort occurs after some of these writes have completed, then it will
// be necessary to undo the completed writes.
-func Xsqlite3MultiWrite(tls *libc.TLS, pParse uintptr) { /* sqlite3.c:117402:21: */
+func Xsqlite3MultiWrite(tls *libc.TLS, pParse uintptr) { /* sqlite3.c:118254:21: */
var pToplevel uintptr = func() uintptr {
if (*Parse)(unsafe.Pointer(pParse)).FpToplevel != 0 {
return (*Parse)(unsafe.Pointer(pParse)).FpToplevel
@@ -98248,7 +99688,7 @@ func Xsqlite3MultiWrite(tls *libc.TLS, pParse uintptr) { /* sqlite3.c:117402:21:
// particular, it prevents us from writing an effective
// implementation of sqlite3AssertMayAbort()) and so we have chosen
// to take the safe route and skip the optimization.
-func Xsqlite3MayAbort(tls *libc.TLS, pParse uintptr) { /* sqlite3.c:117423:21: */
+func Xsqlite3MayAbort(tls *libc.TLS, pParse uintptr) { /* sqlite3.c:118275:21: */
var pToplevel uintptr = func() uintptr {
if (*Parse)(unsafe.Pointer(pParse)).FpToplevel != 0 {
return (*Parse)(unsafe.Pointer(pParse)).FpToplevel
@@ -98261,7 +99701,7 @@ func Xsqlite3MayAbort(tls *libc.TLS, pParse uintptr) { /* sqlite3.c:117423:21: *
// Code an OP_Halt that causes the vdbe to return an SQLITE_CONSTRAINT
// error. The onError parameter determines which (if any) of the statement
// and/or current transaction is rolled back.
-func Xsqlite3HaltConstraint(tls *libc.TLS, pParse uintptr, errCode int32, onError int32, p4 uintptr, p4type I8, p5Errmsg U8) { /* sqlite3.c:117433:21: */
+func Xsqlite3HaltConstraint(tls *libc.TLS, pParse uintptr, errCode int32, onError int32, p4 uintptr, p4type I8, p5Errmsg U8) { /* sqlite3.c:118285:21: */
var v uintptr
v = Xsqlite3GetVdbe(tls, pParse)
@@ -98274,7 +99714,7 @@ func Xsqlite3HaltConstraint(tls *libc.TLS, pParse uintptr, errCode int32, onErro
}
// Code an OP_Halt due to UNIQUE or PRIMARY KEY constraint violation.
-func Xsqlite3UniqueConstraint(tls *libc.TLS, pParse uintptr, onError int32, pIdx uintptr) { /* sqlite3.c:117455:21: */
+func Xsqlite3UniqueConstraint(tls *libc.TLS, pParse uintptr, onError int32, pIdx uintptr) { /* sqlite3.c:118307:21: */
bp := tls.Alloc(32)
defer tls.Free(32)
@@ -98285,47 +99725,47 @@ func Xsqlite3UniqueConstraint(tls *libc.TLS, pParse uintptr, onError int32, pIdx
var pTab uintptr = (*Index)(unsafe.Pointer(pIdx)).FpTable
Xsqlite3StrAccumInit(tls, bp+8 /* &errMsg */, (*Parse)(unsafe.Pointer(pParse)).Fdb, uintptr(0), 0,
- *(*int32)(unsafe.Pointer(((*Parse)(unsafe.Pointer(pParse)).Fdb + 112 /* &.aLimit */))))
+ *(*int32)(unsafe.Pointer((*Parse)(unsafe.Pointer(pParse)).Fdb + 120)))
if (*Index)(unsafe.Pointer(pIdx)).FaColExpr != 0 {
- Xsqlite3_str_appendf(tls, bp+8 /* &errMsg */, ts+13313 /* "index '%q'" */, libc.VaList(bp, (*Index)(unsafe.Pointer(pIdx)).FzName))
+ Xsqlite3_str_appendf(tls, bp+8 /* &errMsg */, ts+14496 /* "index '%q'" */, libc.VaList(bp, (*Index)(unsafe.Pointer(pIdx)).FzName))
} else {
for j = 0; j < int32((*Index)(unsafe.Pointer(pIdx)).FnKeyCol); j++ {
var zCol uintptr
- zCol = (*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FaCol + uintptr(*(*I16)(unsafe.Pointer((*Index)(unsafe.Pointer(pIdx)).FaiColumn + uintptr(j)*2)))*20)).FzName
+ zCol = (*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FaCol + uintptr(*(*I16)(unsafe.Pointer((*Index)(unsafe.Pointer(pIdx)).FaiColumn + uintptr(j)*2)))*16)).FzCnName
if j != 0 {
- Xsqlite3_str_append(tls, bp+8 /* &errMsg */, ts+13324 /* ", " */, 2)
+ Xsqlite3_str_append(tls, bp+8 /* &errMsg */, ts+14507 /* ", " */, 2)
}
Xsqlite3_str_appendall(tls, bp+8 /* &errMsg */, (*Table)(unsafe.Pointer(pTab)).FzName)
- Xsqlite3_str_append(tls, bp+8 /* &errMsg */, ts+768 /* "." */, 1)
+ Xsqlite3_str_append(tls, bp+8 /* &errMsg */, ts+1556 /* "." */, 1)
Xsqlite3_str_appendall(tls, bp+8 /* &errMsg */, zCol)
}
}
zErr = Xsqlite3StrAccumFinish(tls, bp+8 /* &errMsg */)
Xsqlite3HaltConstraint(tls, pParse,
func() int32 {
- if (int32(*(*uint16)(unsafe.Pointer((pIdx) + 56 /* &.idxType */)) & 0x3 >> 0)) == SQLITE_IDXTYPE_PRIMARYKEY {
- return (SQLITE_CONSTRAINT | (int32(6) << 8))
+ if int32(*(*uint16)(unsafe.Pointer(pIdx + 56))&0x3>>0) == SQLITE_IDXTYPE_PRIMARYKEY {
+ return SQLITE_CONSTRAINT | int32(6)<<8
}
- return (SQLITE_CONSTRAINT | (int32(8) << 8))
+ return SQLITE_CONSTRAINT | int32(8)<<8
}(),
onError, zErr, int8(-7), uint8(P5_ConstraintUnique))
}
// Code an OP_Halt due to non-unique rowid.
-func Xsqlite3RowidConstraint(tls *libc.TLS, pParse uintptr, onError int32, pTab uintptr) { /* sqlite3.c:117491:21: */
+func Xsqlite3RowidConstraint(tls *libc.TLS, pParse uintptr, onError int32, pTab uintptr) { /* sqlite3.c:118343:21: */
bp := tls.Alloc(24)
defer tls.Free(24)
var zMsg uintptr
var rc int32
if int32((*Table)(unsafe.Pointer(pTab)).FiPKey) >= 0 {
- zMsg = Xsqlite3MPrintf(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, ts+10785 /* "%s.%s" */, libc.VaList(bp, (*Table)(unsafe.Pointer(pTab)).FzName,
- (*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FaCol+uintptr((*Table)(unsafe.Pointer(pTab)).FiPKey)*20)).FzName))
- rc = (SQLITE_CONSTRAINT | (int32(6) << 8))
+ zMsg = Xsqlite3MPrintf(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, ts+11899 /* "%s.%s" */, libc.VaList(bp, (*Table)(unsafe.Pointer(pTab)).FzName,
+ (*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FaCol+uintptr((*Table)(unsafe.Pointer(pTab)).FiPKey)*16)).FzCnName))
+ rc = SQLITE_CONSTRAINT | int32(6)<<8
} else {
- zMsg = Xsqlite3MPrintf(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, ts+13327 /* "%s.rowid" */, libc.VaList(bp+16, (*Table)(unsafe.Pointer(pTab)).FzName))
- rc = (SQLITE_CONSTRAINT | (int32(10) << 8))
+ zMsg = Xsqlite3MPrintf(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, ts+14510 /* "%s.rowid" */, libc.VaList(bp+16, (*Table)(unsafe.Pointer(pTab)).FzName))
+ rc = SQLITE_CONSTRAINT | int32(10)<<8
}
Xsqlite3HaltConstraint(tls, pParse, rc, onError, zMsg, int8(-7),
uint8(P5_ConstraintUnique))
@@ -98333,13 +99773,13 @@ func Xsqlite3RowidConstraint(tls *libc.TLS, pParse uintptr, onError int32, pTab
// Check to see if pIndex uses the collating sequence pColl. Return
// true if it does and false if it does not.
-func collationMatch(tls *libc.TLS, zColl uintptr, pIndex uintptr) int32 { /* sqlite3.c:117515:12: */
+func collationMatch(tls *libc.TLS, zColl uintptr, pIndex uintptr) int32 { /* sqlite3.c:118367:12: */
var i int32
for i = 0; i < int32((*Index)(unsafe.Pointer(pIndex)).FnColumn); i++ {
var z uintptr = *(*uintptr)(unsafe.Pointer((*Index)(unsafe.Pointer(pIndex)).FazColl + uintptr(i)*4))
- if (int32(*(*I16)(unsafe.Pointer((*Index)(unsafe.Pointer(pIndex)).FaiColumn + uintptr(i)*2))) >= 0) && (0 == Xsqlite3StrICmp(tls, z, zColl)) {
+ if int32(*(*I16)(unsafe.Pointer((*Index)(unsafe.Pointer(pIndex)).FaiColumn + uintptr(i)*2))) >= 0 && 0 == Xsqlite3StrICmp(tls, z, zColl) {
return 1
}
}
@@ -98348,12 +99788,12 @@ func collationMatch(tls *libc.TLS, zColl uintptr, pIndex uintptr) int32 { /* sql
// Recompute all indices of pTab that use the collating sequence pColl.
// If pColl==0 then recompute all indices of pTab.
-func reindexTable(tls *libc.TLS, pParse uintptr, pTab uintptr, zColl uintptr) { /* sqlite3.c:117534:13: */
- if !((*Table)(unsafe.Pointer(pTab)).FnModuleArg != 0) {
+func reindexTable(tls *libc.TLS, pParse uintptr, pTab uintptr, zColl uintptr) { /* sqlite3.c:118386:13: */
+ if !(int32((*Table)(unsafe.Pointer(pTab)).FeTabType) == TABTYP_VTAB) {
var pIndex uintptr // An index associated with pTab
for pIndex = (*Table)(unsafe.Pointer(pTab)).FpIndex; pIndex != 0; pIndex = (*Index)(unsafe.Pointer(pIndex)).FpNext {
- if (zColl == uintptr(0)) || (collationMatch(tls, zColl, pIndex) != 0) {
+ if zColl == uintptr(0) || collationMatch(tls, zColl, pIndex) != 0 {
var iDb int32 = Xsqlite3SchemaToIndex(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, (*Table)(unsafe.Pointer(pTab)).FpSchema)
Xsqlite3BeginWriteOperation(tls, pParse, 0, iDb)
sqlite3RefillIndex(tls, pParse, pIndex, -1)
@@ -98365,7 +99805,7 @@ func reindexTable(tls *libc.TLS, pParse uintptr, pTab uintptr, zColl uintptr) {
// Recompute all indices of all tables in all databases where the
// indices use the collating sequence pColl. If pColl==0 then recompute
// all indices everywhere.
-func reindexDatabases(tls *libc.TLS, pParse uintptr, zColl uintptr) { /* sqlite3.c:117555:13: */
+func reindexDatabases(tls *libc.TLS, pParse uintptr, zColl uintptr) { /* sqlite3.c:118407:13: */
var pDb uintptr // A single database
var iDb int32 // The database index number
var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb // The database connection
@@ -98381,7 +99821,7 @@ __1:
}
{
- for k = (*Hash)(unsafe.Pointer(((*Db)(unsafe.Pointer(pDb)).FpSchema + 8 /* &.tblHash */))).Ffirst; k != 0; k = (*HashElem)(unsafe.Pointer(k)).Fnext {
+ for k = (*Hash)(unsafe.Pointer((*Db)(unsafe.Pointer(pDb)).FpSchema + 8)).Ffirst; k != 0; k = (*HashElem)(unsafe.Pointer(k)).Fnext {
pTab = (*HashElem)(unsafe.Pointer(k)).Fdata
reindexTable(tls, pParse, pTab, zColl)
}
@@ -98407,7 +99847,7 @@ __3:
// Form 2 rebuilds all indices in all databases that use the named
// collating function. Forms 3 and 4 rebuild the named index or all
// indices associated with the named table.
-func Xsqlite3Reindex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 uintptr) { /* sqlite3.c:117587:21: */
+func Xsqlite3Reindex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 uintptr) { /* sqlite3.c:118439:21: */
bp := tls.Alloc(4)
defer tls.Free(4)
@@ -98430,7 +99870,7 @@ func Xsqlite3Reindex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 uintp
if pName1 == uintptr(0) {
reindexDatabases(tls, pParse, uintptr(0))
return
- } else if (pName2 == uintptr(0)) || ((*Token)(unsafe.Pointer(pName2)).Fz == uintptr(0)) {
+ } else if pName2 == uintptr(0) || (*Token)(unsafe.Pointer(pName2)).Fz == uintptr(0) {
var zColl uintptr
zColl = Xsqlite3NameFromToken(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, pName1)
@@ -98467,14 +99907,14 @@ func Xsqlite3Reindex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 uintp
sqlite3RefillIndex(tls, pParse, pIndex, -1)
return
}
- Xsqlite3ErrorMsg(tls, pParse, ts+13336 /* "unable to identi..." */, 0)
+ Xsqlite3ErrorMsg(tls, pParse, ts+14519 /* "unable to identi..." */, 0)
}
// Return a KeyInfo structure that is appropriate for the given Index.
//
// The caller should invoke sqlite3KeyInfoUnref() on the returned object
// when it has finished using it.
-func Xsqlite3KeyInfoOfIndex(tls *libc.TLS, pParse uintptr, pIdx uintptr) uintptr { /* sqlite3.c:117647:24: */
+func Xsqlite3KeyInfoOfIndex(tls *libc.TLS, pParse uintptr, pIdx uintptr) uintptr { /* sqlite3.c:118499:24: */
var i int32
var nCol int32 = int32((*Index)(unsafe.Pointer(pIdx)).FnColumn)
var nKey int32 = int32((*Index)(unsafe.Pointer(pIdx)).FnKeyCol)
@@ -98482,8 +99922,8 @@ func Xsqlite3KeyInfoOfIndex(tls *libc.TLS, pParse uintptr, pIdx uintptr) uintptr
if (*Parse)(unsafe.Pointer(pParse)).FnErr != 0 {
return uintptr(0)
}
- if (uint32(int32(*(*uint16)(unsafe.Pointer(pIdx + 56 /* &.uniqNotNull */)) & 0x8 >> 3))) != 0 {
- pKey = Xsqlite3KeyInfoAlloc(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, nKey, (nCol - nKey))
+ if uint32(int32(*(*uint16)(unsafe.Pointer(pIdx + 56))&0x8>>3)) != 0 {
+ pKey = Xsqlite3KeyInfoAlloc(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, nKey, nCol-nKey)
} else {
pKey = Xsqlite3KeyInfoAlloc(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, nCol, 0)
}
@@ -98491,7 +99931,7 @@ func Xsqlite3KeyInfoOfIndex(tls *libc.TLS, pParse uintptr, pIdx uintptr) uintptr
for i = 0; i < nCol; i++ {
var zColl uintptr = *(*uintptr)(unsafe.Pointer((*Index)(unsafe.Pointer(pIdx)).FazColl + uintptr(i)*4))
- *(*uintptr)(unsafe.Pointer((pKey + 20 /* &.aColl */) + uintptr(i)*4)) = func() uintptr {
+ *(*uintptr)(unsafe.Pointer(pKey + 20 + uintptr(i)*4)) = func() uintptr {
if zColl == uintptr(unsafe.Pointer(&Xsqlite3StrBINARY)) {
return uintptr(0)
}
@@ -98502,15 +99942,15 @@ func Xsqlite3KeyInfoOfIndex(tls *libc.TLS, pParse uintptr, pIdx uintptr) uintptr
}
if (*Parse)(unsafe.Pointer(pParse)).FnErr != 0 {
- if (int32(*(*uint16)(unsafe.Pointer(pIdx + 56 /* &.bNoQuery */)) & 0x100 >> 8)) == 0 {
+ if int32(*(*uint16)(unsafe.Pointer(pIdx + 56))&0x100>>8) == 0 {
// Deactivate the index because it contains an unknown collating
// sequence. The only way to reactive the index is to reload the
// schema. Adding the missing collating sequence later does not
// reactive the index. The application had the chance to register
// the missing index using the collation-needed callback. For
// simplicity, SQLite will not give the application a second chance.
- libc.SetBitFieldPtr16Uint32(pIdx+56 /* &.bNoQuery */, uint32(1), 8, 0x100)
- (*Parse)(unsafe.Pointer(pParse)).Frc = (SQLITE_ERROR | (int32(2) << 8))
+ libc.SetBitFieldPtr16Uint32(pIdx+56, uint32(1), 8, 0x100)
+ (*Parse)(unsafe.Pointer(pParse)).Frc = SQLITE_ERROR | int32(2)<<8
}
Xsqlite3KeyInfoUnref(tls, pKey)
pKey = uintptr(0)
@@ -98520,7 +99960,7 @@ func Xsqlite3KeyInfoOfIndex(tls *libc.TLS, pParse uintptr, pIdx uintptr) uintptr
}
// Create a new CTE object
-func Xsqlite3CteNew(tls *libc.TLS, pParse uintptr, pName uintptr, pArglist uintptr, pQuery uintptr, eM10d U8) uintptr { /* sqlite3.c:117691:20: */
+func Xsqlite3CteNew(tls *libc.TLS, pParse uintptr, pName uintptr, pArglist uintptr, pQuery uintptr, eM10d U8) uintptr { /* sqlite3.c:118543:20: */
var pNew uintptr
var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb
@@ -98540,7 +99980,7 @@ func Xsqlite3CteNew(tls *libc.TLS, pParse uintptr, pName uintptr, pArglist uintp
// Clear information from a Cte object, but do not deallocate storage
// for the object itself.
-func cteClear(tls *libc.TLS, db uintptr, pCte uintptr) { /* sqlite3.c:117720:13: */
+func cteClear(tls *libc.TLS, db uintptr, pCte uintptr) { /* sqlite3.c:118572:13: */
Xsqlite3ExprListDelete(tls, db, (*Cte)(unsafe.Pointer(pCte)).FpCols)
Xsqlite3SelectDelete(tls, db, (*Cte)(unsafe.Pointer(pCte)).FpSelect)
@@ -98548,7 +99988,7 @@ func cteClear(tls *libc.TLS, db uintptr, pCte uintptr) { /* sqlite3.c:117720:13:
}
// Free the contents of the CTE object passed as the second argument.
-func Xsqlite3CteDelete(tls *libc.TLS, db uintptr, pCte uintptr) { /* sqlite3.c:117730:21: */
+func Xsqlite3CteDelete(tls *libc.TLS, db uintptr, pCte uintptr) { /* sqlite3.c:118582:21: */
cteClear(tls, db, pCte)
Xsqlite3DbFree(tls, db, pCte)
@@ -98558,7 +99998,7 @@ func Xsqlite3CteDelete(tls *libc.TLS, db uintptr, pCte uintptr) { /* sqlite3.c:1
// WITH clause. The CTE described by teh third argument is added to
// the WITH clause of the second argument. If the second argument is
// NULL, then a new WITH argument is created.
-func Xsqlite3WithAdd(tls *libc.TLS, pParse uintptr, pWith uintptr, pCte uintptr) uintptr { /* sqlite3.c:117742:21: */
+func Xsqlite3WithAdd(tls *libc.TLS, pParse uintptr, pWith uintptr, pCte uintptr) uintptr { /* sqlite3.c:118594:21: */
bp := tls.Alloc(8)
defer tls.Free(8)
@@ -98573,17 +100013,17 @@ func Xsqlite3WithAdd(tls *libc.TLS, pParse uintptr, pWith uintptr, pCte uintptr)
// Check that the CTE name is unique within this WITH clause. If
// not, store an error in the Parse structure.
zName = (*Cte)(unsafe.Pointer(pCte)).FzName
- if (zName != 0) && (pWith != 0) {
+ if zName != 0 && pWith != 0 {
var i int32
for i = 0; i < (*With)(unsafe.Pointer(pWith)).FnCte; i++ {
- if Xsqlite3StrICmp(tls, zName, (*Cte)(unsafe.Pointer((pWith+12 /* &.a */)+uintptr(i)*24)).FzName) == 0 {
- Xsqlite3ErrorMsg(tls, pParse, ts+13382 /* "duplicate WITH t..." */, libc.VaList(bp, zName))
+ if Xsqlite3StrICmp(tls, zName, (*Cte)(unsafe.Pointer(pWith+12+uintptr(i)*24)).FzName) == 0 {
+ Xsqlite3ErrorMsg(tls, pParse, ts+14565 /* "duplicate WITH t..." */, libc.VaList(bp, zName))
}
}
}
if pWith != 0 {
- var nByte Sqlite3_int64 = (Sqlite3_int64(uint32(unsafe.Sizeof(With{})) + (uint32(unsafe.Sizeof(Cte{})) * uint32((*With)(unsafe.Pointer(pWith)).FnCte))))
+ var nByte Sqlite3_int64 = Sqlite3_int64(uint32(unsafe.Sizeof(With{})) + uint32(unsafe.Sizeof(Cte{}))*uint32((*With)(unsafe.Pointer(pWith)).FnCte))
pNew = Xsqlite3DbRealloc(tls, db, pWith, uint64(nByte))
} else {
pNew = Xsqlite3DbMallocZero(tls, db, uint64(unsafe.Sizeof(With{})))
@@ -98593,7 +100033,7 @@ func Xsqlite3WithAdd(tls *libc.TLS, pParse uintptr, pWith uintptr, pCte uintptr)
Xsqlite3CteDelete(tls, db, pCte)
pNew = pWith
} else {
- *(*Cte)(unsafe.Pointer((pNew + 12 /* &.a */) + uintptr(libc.PostIncInt32(&(*With)(unsafe.Pointer(pNew)).FnCte, 1))*24)) = *(*Cte)(unsafe.Pointer(pCte))
+ *(*Cte)(unsafe.Pointer(pNew + 12 + uintptr(libc.PostIncInt32(&(*With)(unsafe.Pointer(pNew)).FnCte, 1))*24)) = *(*Cte)(unsafe.Pointer(pCte))
Xsqlite3DbFree(tls, db, pCte)
}
@@ -98601,11 +100041,11 @@ func Xsqlite3WithAdd(tls *libc.TLS, pParse uintptr, pWith uintptr, pCte uintptr)
}
// Free the contents of the With object passed as the second argument.
-func Xsqlite3WithDelete(tls *libc.TLS, db uintptr, pWith uintptr) { /* sqlite3.c:117789:21: */
+func Xsqlite3WithDelete(tls *libc.TLS, db uintptr, pWith uintptr) { /* sqlite3.c:118641:21: */
if pWith != 0 {
var i int32
for i = 0; i < (*With)(unsafe.Pointer(pWith)).FnCte; i++ {
- cteClear(tls, db, ((pWith + 12 /* &.a */) + uintptr(i)*24))
+ cteClear(tls, db, pWith+12+uintptr(i)*24)
}
Xsqlite3DbFree(tls, db, pWith)
}
@@ -98631,7 +100071,7 @@ func Xsqlite3WithDelete(tls *libc.TLS, db uintptr, pWith uintptr) { /* sqlite3.c
// Invoke the 'collation needed' callback to request a collation sequence
// in the encoding enc of name zName, length nName.
-func callCollNeeded(tls *libc.TLS, db uintptr, enc int32, zName uintptr) { /* sqlite3.c:117824:13: */
+func callCollNeeded(tls *libc.TLS, db uintptr, enc int32, zName uintptr) { /* sqlite3.c:118676:13: */
if (*Sqlite3)(unsafe.Pointer(db)).FxCollNeeded != 0 {
var zExternal uintptr = Xsqlite3DbStrDup(tls, db, zName)
@@ -98662,7 +100102,7 @@ func callCollNeeded(tls *libc.TLS, db uintptr, enc int32, zName uintptr) { /* sq
// of this collation function (for other text encodings) available. Use one
// of these instead if they exist. Avoid a UTF-8 <-> UTF-16 conversion if
// possible.
-func synthCollSeq(tls *libc.TLS, db uintptr, pColl uintptr) int32 { /* sqlite3.c:117853:12: */
+func synthCollSeq(tls *libc.TLS, db uintptr, pColl uintptr) int32 { /* sqlite3.c:118705:12: */
var pColl2 uintptr
var z uintptr = (*CollSeq)(unsafe.Pointer(pColl)).FzName
var i int32
@@ -98677,7 +100117,7 @@ func synthCollSeq(tls *libc.TLS, db uintptr, pColl uintptr) int32 { /* sqlite3.c
return SQLITE_ERROR
}
-var aEnc = [3]U8{U8(SQLITE_UTF16BE), U8(SQLITE_UTF16LE), U8(SQLITE_UTF8)} /* sqlite3.c:117857:19 */
+var aEnc = [3]U8{U8(SQLITE_UTF16BE), U8(SQLITE_UTF16LE), U8(SQLITE_UTF8)} /* sqlite3.c:118709:19 */
// This routine is called on a collation sequence before it is used to
// check that it is defined. An undefined collation sequence exists when
@@ -98688,8 +100128,8 @@ var aEnc = [3]U8{U8(SQLITE_UTF16BE), U8(SQLITE_UTF16LE), U8(SQLITE_UTF8)} /* sql
// request a definition of the collating sequence. If this doesn't work,
// an equivalent collating sequence that uses a text encoding different
// from the main database is substituted, if one is available.
-func Xsqlite3CheckCollSeq(tls *libc.TLS, pParse uintptr, pColl uintptr) int32 { /* sqlite3.c:117880:20: */
- if (pColl != 0) && ((*CollSeq)(unsafe.Pointer(pColl)).FxCmp == uintptr(0)) {
+func Xsqlite3CheckCollSeq(tls *libc.TLS, pParse uintptr, pColl uintptr) int32 { /* sqlite3.c:118732:20: */
+ if pColl != 0 && (*CollSeq)(unsafe.Pointer(pColl)).FxCmp == uintptr(0) {
var zName uintptr = (*CollSeq)(unsafe.Pointer(pColl)).FzName
var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb
var p uintptr = Xsqlite3GetCollSeq(tls, pParse, (*Sqlite3)(unsafe.Pointer(db)).Fenc, pColl, zName)
@@ -98712,23 +100152,23 @@ func Xsqlite3CheckCollSeq(tls *libc.TLS, pParse uintptr, pColl uintptr) int32 {
// Stored immediately after the three collation sequences is a copy of
// the collation sequence name. A pointer to this string is stored in
// each collation sequence structure.
-func findCollSeqEntry(tls *libc.TLS, db uintptr, zName uintptr, create int32) uintptr { /* sqlite3.c:117908:16: */
+func findCollSeqEntry(tls *libc.TLS, db uintptr, zName uintptr, create int32) uintptr { /* sqlite3.c:118760:16: */
var pColl uintptr
- pColl = Xsqlite3HashFind(tls, (db + 420 /* &.aCollSeq */), zName)
+ pColl = Xsqlite3HashFind(tls, db+444, zName)
- if (uintptr(0) == pColl) && (create != 0) {
- var nName int32 = (Xsqlite3Strlen30(tls, zName) + 1)
- pColl = Xsqlite3DbMallocZero(tls, db, (uint64((uint32(3) * uint32(unsafe.Sizeof(CollSeq{}))) + uint32(nName))))
+ if uintptr(0) == pColl && create != 0 {
+ var nName int32 = Xsqlite3Strlen30(tls, zName) + 1
+ pColl = Xsqlite3DbMallocZero(tls, db, uint64(uint32(3)*uint32(unsafe.Sizeof(CollSeq{}))+uint32(nName)))
if pColl != 0 {
var pDel uintptr = uintptr(0)
- (*CollSeq)(unsafe.Pointer(pColl)).FzName = (pColl + 3*20)
+ (*CollSeq)(unsafe.Pointer(pColl)).FzName = pColl + 3*20
(*CollSeq)(unsafe.Pointer(pColl)).Fenc = U8(SQLITE_UTF8)
- (*CollSeq)(unsafe.Pointer(pColl + 1*20)).FzName = (pColl + 3*20)
+ (*CollSeq)(unsafe.Pointer(pColl + 1*20)).FzName = pColl + 3*20
(*CollSeq)(unsafe.Pointer(pColl + 1*20)).Fenc = U8(SQLITE_UTF16LE)
- (*CollSeq)(unsafe.Pointer(pColl + 2*20)).FzName = (pColl + 3*20)
+ (*CollSeq)(unsafe.Pointer(pColl + 2*20)).FzName = pColl + 3*20
(*CollSeq)(unsafe.Pointer(pColl + 2*20)).Fenc = U8(SQLITE_UTF16BE)
libc.Xmemcpy(tls, (*CollSeq)(unsafe.Pointer(pColl)).FzName, zName, uint32(nName))
- pDel = Xsqlite3HashInsert(tls, (db + 420 /* &.aCollSeq */), (*CollSeq)(unsafe.Pointer(pColl)).FzName, pColl)
+ pDel = Xsqlite3HashInsert(tls, db+444, (*CollSeq)(unsafe.Pointer(pColl)).FzName, pColl)
// If a malloc() failure occurred in sqlite3HashInsert(), it will
// return the pColl pointer to be deleted (because it wasn't added
@@ -98757,13 +100197,13 @@ func findCollSeqEntry(tls *libc.TLS, db uintptr, zName uintptr, create int32) ui
// cannot be found.
//
// See also: sqlite3LocateCollSeq(), sqlite3GetCollSeq()
-func Xsqlite3FindCollSeq(tls *libc.TLS, db uintptr, enc U8, zName uintptr, create int32) uintptr { /* sqlite3.c:117960:24: */
+func Xsqlite3FindCollSeq(tls *libc.TLS, db uintptr, enc U8, zName uintptr, create int32) uintptr { /* sqlite3.c:118812:24: */
var pColl uintptr
if zName != 0 {
pColl = findCollSeqEntry(tls, db, zName, create)
if pColl != 0 {
- pColl += 20 * (uintptr(int32(enc) - 1))
+ pColl += 20 * uintptr(int32(enc)-1)
}
} else {
pColl = (*Sqlite3)(unsafe.Pointer(db)).FpDfltColl
@@ -98773,7 +100213,7 @@ func Xsqlite3FindCollSeq(tls *libc.TLS, db uintptr, enc U8, zName uintptr, creat
// Change the text encoding for a database connection. This means that
// the pDfltColl must change as well.
-func Xsqlite3SetTextEncoding(tls *libc.TLS, db uintptr, enc U8) { /* sqlite3.c:117982:21: */
+func Xsqlite3SetTextEncoding(tls *libc.TLS, db uintptr, enc U8) { /* sqlite3.c:118834:21: */
(*Sqlite3)(unsafe.Pointer(db)).Fenc = enc
// EVIDENCE-OF: R-08308-17224 The default collating function for all
@@ -98793,7 +100233,7 @@ func Xsqlite3SetTextEncoding(tls *libc.TLS, db uintptr, enc U8) { /* sqlite3.c:1
// sequence can be found. If no collation is found, leave an error message.
//
// See also: sqlite3LocateCollSeq(), sqlite3FindCollSeq()
-func Xsqlite3GetCollSeq(tls *libc.TLS, pParse uintptr, enc U8, pColl uintptr, zName uintptr) uintptr { /* sqlite3.c:118005:24: */
+func Xsqlite3GetCollSeq(tls *libc.TLS, pParse uintptr, enc U8, pColl uintptr, zName uintptr) uintptr { /* sqlite3.c:118857:24: */
bp := tls.Alloc(8)
defer tls.Free(8)
@@ -98810,13 +100250,13 @@ func Xsqlite3GetCollSeq(tls *libc.TLS, pParse uintptr, enc U8, pColl uintptr, zN
callCollNeeded(tls, db, int32(enc), zName)
p = Xsqlite3FindCollSeq(tls, db, enc, zName, 0)
}
- if ((p != 0) && !(int32((*CollSeq)(unsafe.Pointer(p)).FxCmp) != 0)) && (synthCollSeq(tls, db, p) != 0) {
+ if p != 0 && !(int32((*CollSeq)(unsafe.Pointer(p)).FxCmp) != 0) && synthCollSeq(tls, db, p) != 0 {
p = uintptr(0)
}
if p == uintptr(0) {
- Xsqlite3ErrorMsg(tls, pParse, ts+13412 /* "no such collatio..." */, libc.VaList(bp, zName))
- (*Parse)(unsafe.Pointer(pParse)).Frc = (SQLITE_ERROR | (int32(1) << 8))
+ Xsqlite3ErrorMsg(tls, pParse, ts+14595 /* "no such collatio..." */, libc.VaList(bp, zName))
+ (*Parse)(unsafe.Pointer(pParse)).Frc = SQLITE_ERROR | int32(1)<<8
}
return p
}
@@ -98839,7 +100279,7 @@ func Xsqlite3GetCollSeq(tls *libc.TLS, pParse uintptr, enc U8, pColl uintptr, zN
// and generates an error message.
//
// See also: sqlite3FindCollSeq(), sqlite3GetCollSeq()
-func Xsqlite3LocateCollSeq(tls *libc.TLS, pParse uintptr, zName uintptr) uintptr { /* sqlite3.c:118056:24: */
+func Xsqlite3LocateCollSeq(tls *libc.TLS, pParse uintptr, zName uintptr) uintptr { /* sqlite3.c:118908:24: */
var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb
var enc U8 = (*Sqlite3)(unsafe.Pointer(db)).Fenc
var initbusy U8 = (*Sqlite3)(unsafe.Pointer(db)).Finit.Fbusy
@@ -98880,12 +100320,12 @@ func Xsqlite3LocateCollSeq(tls *libc.TLS, pParse uintptr, zName uintptr) uintptr
// If nArg==(-2) then any function with a non-null xSFunc is
// a perfect match and any function with xSFunc NULL is
// a non-match.
-func matchQuality(tls *libc.TLS, p uintptr, nArg int32, enc U8) int32 { /* sqlite3.c:118099:12: */
+func matchQuality(tls *libc.TLS, p uintptr, nArg int32, enc U8) int32 { /* sqlite3.c:118951:12: */
var match int32
// Wrong number of arguments means "no match"
if int32((*FuncDef)(unsafe.Pointer(p)).FnArg) != nArg {
- if nArg == (-2) {
+ if nArg == -2 {
if (*FuncDef)(unsafe.Pointer(p)).FxSFunc == uintptr(0) {
return 0
}
@@ -98905,10 +100345,10 @@ func matchQuality(tls *libc.TLS, p uintptr, nArg int32, enc U8) int32 { /* sqlit
}
// Bonus points if the text encoding matches
- if U32(enc) == ((*FuncDef)(unsafe.Pointer(p)).FfuncFlags & U32(SQLITE_FUNC_ENCMASK)) {
- match = match + (2) // Exact encoding match
- } else if ((U32(enc) & (*FuncDef)(unsafe.Pointer(p)).FfuncFlags) & U32(2)) != U32(0) {
- match = match + (1) // Both are UTF16, but with different byte orders
+ if U32(enc) == (*FuncDef)(unsafe.Pointer(p)).FfuncFlags&U32(SQLITE_FUNC_ENCMASK) {
+ match = match + 2 // Exact encoding match
+ } else if U32(enc)&(*FuncDef)(unsafe.Pointer(p)).FfuncFlags&U32(2) != U32(0) {
+ match = match + 1 // Both are UTF16, but with different byte orders
}
return match
@@ -98916,9 +100356,10 @@ func matchQuality(tls *libc.TLS, p uintptr, nArg int32, enc U8) int32 { /* sqlit
// Search a FuncDefHash for a function with the given name. Return
// a pointer to the matching FuncDef if found, or 0 if there is no match.
-func Xsqlite3FunctionSearch(tls *libc.TLS, h int32, zFunc uintptr) uintptr { /* sqlite3.c:118135:24: */
+func Xsqlite3FunctionSearch(tls *libc.TLS, h int32, zFunc uintptr) uintptr { /* sqlite3.c:118987:24: */
var p uintptr
- for p = *(*uintptr)(unsafe.Pointer((uintptr(unsafe.Pointer(&Xsqlite3BuiltinFunctions)) /* &.a */) + uintptr(h)*4)); p != 0; p = *(*uintptr)(unsafe.Pointer(p + 36 /* &.u */)) {
+ for p = *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&Xsqlite3BuiltinFunctions)) + uintptr(h)*4)); p != 0; p = *(*uintptr)(unsafe.Pointer(p + 36)) {
+
if Xsqlite3StrICmp(tls, (*FuncDef)(unsafe.Pointer(p)).FzName, zFunc) == 0 {
return p
}
@@ -98927,23 +100368,23 @@ func Xsqlite3FunctionSearch(tls *libc.TLS, h int32, zFunc uintptr) uintptr { /*
}
// Insert a new FuncDef into a FuncDefHash hash table.
-func Xsqlite3InsertBuiltinFuncs(tls *libc.TLS, aDef uintptr, nDef int32) { /* sqlite3.c:118151:21: */
+func Xsqlite3InsertBuiltinFuncs(tls *libc.TLS, aDef uintptr, nDef int32) { /* sqlite3.c:119004:21: */
var i int32
for i = 0; i < nDef; i++ {
var pOther uintptr
var zName uintptr = (*FuncDef)(unsafe.Pointer(aDef + uintptr(i)*40)).FzName
var nName int32 = Xsqlite3Strlen30(tls, zName)
- var h int32 = (((int32(*(*uint8)(unsafe.Pointer(zName)))) + (nName)) % SQLITE_FUNC_HASH_SZ)
+ var h int32 = (int32(*(*uint8)(unsafe.Pointer(zName))) + nName) % SQLITE_FUNC_HASH_SZ
pOther = Xsqlite3FunctionSearch(tls, h, zName)
if pOther != 0 {
(*FuncDef)(unsafe.Pointer(aDef + uintptr(i)*40)).FpNext = (*FuncDef)(unsafe.Pointer(pOther)).FpNext
- (*FuncDef)(unsafe.Pointer(pOther)).FpNext = (aDef + uintptr(i)*40)
+ (*FuncDef)(unsafe.Pointer(pOther)).FpNext = aDef + uintptr(i)*40
} else {
(*FuncDef)(unsafe.Pointer(aDef + uintptr(i)*40)).FpNext = uintptr(0)
- *(*uintptr)(unsafe.Pointer(aDef + uintptr(i)*40 + 36 /* &.u */)) = *(*uintptr)(unsafe.Pointer((uintptr(unsafe.Pointer(&Xsqlite3BuiltinFunctions)) /* &.a */) + uintptr(h)*4))
- *(*uintptr)(unsafe.Pointer((uintptr(unsafe.Pointer(&Xsqlite3BuiltinFunctions)) /* &.a */) + uintptr(h)*4)) = (aDef + uintptr(i)*40)
+ *(*uintptr)(unsafe.Pointer(aDef + uintptr(i)*40 + 36)) = *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&Xsqlite3BuiltinFunctions)) + uintptr(h)*4))
+ *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&Xsqlite3BuiltinFunctions)) + uintptr(h)*4)) = aDef + uintptr(i)*40
}
}
}
@@ -98965,7 +100406,7 @@ func Xsqlite3InsertBuiltinFuncs(tls *libc.TLS, aDef uintptr, nDef int32) { /* sq
// If createFlag is false, then a function with the required name and
// number of arguments may be returned even if the eTextRep flag does not
// match that requested.
-func Xsqlite3FindFunction(tls *libc.TLS, db uintptr, zName uintptr, nArg int32, enc U8, createFlag U8) uintptr { /* sqlite3.c:118196:24: */
+func Xsqlite3FindFunction(tls *libc.TLS, db uintptr, zName uintptr, nArg int32, enc U8, createFlag U8) uintptr { /* sqlite3.c:119050:24: */
var p uintptr // Iterator variable
var pBest uintptr = uintptr(0) // Best match found so far
var bestScore int32 = 0 // Score of best match
@@ -98975,7 +100416,7 @@ func Xsqlite3FindFunction(tls *libc.TLS, db uintptr, zName uintptr, nArg int32,
nName = Xsqlite3Strlen30(tls, zName)
// First search for a match amongst the application-defined functions.
- p = Xsqlite3HashFind(tls, (db + 404 /* &.aFunc */), zName)
+ p = Xsqlite3HashFind(tls, db+428, zName)
for p != 0 {
var score int32 = matchQuality(tls, p, nArg, enc)
if score > bestScore {
@@ -98996,9 +100437,9 @@ func Xsqlite3FindFunction(tls *libc.TLS, db uintptr, zName uintptr, nArg int32,
// have fields overwritten with new information appropriate for the
// new function. But the FuncDefs for built-in functions are read-only.
// So we must not search for built-ins when creating a new function.
- if !(createFlag != 0) && ((pBest == uintptr(0)) || (((*Sqlite3)(unsafe.Pointer(db)).FmDbFlags & U32(DBFLAG_PreferBuiltin)) != U32(0))) {
+ if !(createFlag != 0) && (pBest == uintptr(0) || (*Sqlite3)(unsafe.Pointer(db)).FmDbFlags&U32(DBFLAG_PreferBuiltin) != U32(0)) {
bestScore = 0
- h = (((int32(Xsqlite3UpperToLower[U8(*(*uint8)(unsafe.Pointer(zName)))])) + (nName)) % SQLITE_FUNC_HASH_SZ)
+ h = (int32(Xsqlite3UpperToLower[U8(*(*uint8)(unsafe.Pointer(zName)))]) + nName) % SQLITE_FUNC_HASH_SZ
p = Xsqlite3FunctionSearch(tls, h, zName)
for p != 0 {
var score int32 = matchQuality(tls, p, nArg, enc)
@@ -99013,17 +100454,17 @@ func Xsqlite3FindFunction(tls *libc.TLS, db uintptr, zName uintptr, nArg int32,
// If the createFlag parameter is true and the search did not reveal an
// exact match for the name, number of arguments and encoding, then add a
// new entry to the hash table and return it.
- if ((createFlag != 0) && (bestScore < FUNC_PERFECT_MATCH)) && ((libc.AssignUintptr(&pBest, Xsqlite3DbMallocZero(tls, db, (uint64((uint32(unsafe.Sizeof(FuncDef{}))+uint32(nName))+uint32(1)))))) != uintptr(0)) {
+ if createFlag != 0 && bestScore < FUNC_PERFECT_MATCH && libc.AssignUintptr(&pBest, Xsqlite3DbMallocZero(tls, db, uint64(uint32(unsafe.Sizeof(FuncDef{}))+uint32(nName)+uint32(1)))) != uintptr(0) {
var pOther uintptr
var z uintptr
- (*FuncDef)(unsafe.Pointer(pBest)).FzName = (pBest + 1*40)
+ (*FuncDef)(unsafe.Pointer(pBest)).FzName = pBest + 1*40
(*FuncDef)(unsafe.Pointer(pBest)).FnArg = I8(U16(nArg))
(*FuncDef)(unsafe.Pointer(pBest)).FfuncFlags = U32(enc)
- libc.Xmemcpy(tls, (pBest + 1*40), zName, (uint32(nName + 1)))
+ libc.Xmemcpy(tls, pBest+1*40, zName, uint32(nName+1))
for z = (*FuncDef)(unsafe.Pointer(pBest)).FzName; *(*U8)(unsafe.Pointer(z)) != 0; z++ {
*(*U8)(unsafe.Pointer(z)) = Xsqlite3UpperToLower[*(*U8)(unsafe.Pointer(z))]
}
- pOther = Xsqlite3HashInsert(tls, (db + 404 /* &.aFunc */), (*FuncDef)(unsafe.Pointer(pBest)).FzName, pBest)
+ pOther = Xsqlite3HashInsert(tls, db+428, (*FuncDef)(unsafe.Pointer(pBest)).FzName, pBest)
if pOther == pBest {
Xsqlite3DbFree(tls, db, pBest)
Xsqlite3OomFault(tls, db)
@@ -99033,7 +100474,7 @@ func Xsqlite3FindFunction(tls *libc.TLS, db uintptr, zName uintptr, nArg int32,
}
}
- if (pBest != 0) && (((*FuncDef)(unsafe.Pointer(pBest)).FxSFunc != 0) || (createFlag != 0)) {
+ if pBest != 0 && ((*FuncDef)(unsafe.Pointer(pBest)).FxSFunc != 0 || createFlag != 0) {
return pBest
}
return uintptr(0)
@@ -99045,7 +100486,7 @@ func Xsqlite3FindFunction(tls *libc.TLS, db uintptr, zName uintptr, nArg int32,
// of the schema hash tables).
//
// The Schema.cache_size variable is not cleared.
-func Xsqlite3SchemaClear(tls *libc.TLS, p uintptr) { /* sqlite3.c:118288:21: */
+func Xsqlite3SchemaClear(tls *libc.TLS, p uintptr) { /* sqlite3.c:119142:21: */
bp := tls.Alloc(32)
defer tls.Free(32)
@@ -99058,29 +100499,29 @@ func Xsqlite3SchemaClear(tls *libc.TLS, p uintptr) { /* sqlite3.c:118288:21: */
*(*Hash)(unsafe.Pointer(bp + 16 /* temp1 */)) = (*Schema)(unsafe.Pointer(pSchema)).FtblHash
*(*Hash)(unsafe.Pointer(bp /* temp2 */)) = (*Schema)(unsafe.Pointer(pSchema)).FtrigHash
- Xsqlite3HashInit(tls, (pSchema + 40 /* &.trigHash */))
- Xsqlite3HashClear(tls, (pSchema + 24 /* &.idxHash */))
- for pElem = (*Hash)(unsafe.Pointer(bp /* &temp2 */)).Ffirst; pElem != 0; pElem = (*HashElem)(unsafe.Pointer(pElem)).Fnext {
+ Xsqlite3HashInit(tls, pSchema+40)
+ Xsqlite3HashClear(tls, pSchema+24)
+ for pElem = (*Hash)(unsafe.Pointer(bp)).Ffirst; pElem != 0; pElem = (*HashElem)(unsafe.Pointer(pElem)).Fnext {
Xsqlite3DeleteTrigger(tls, uintptr(0), (*HashElem)(unsafe.Pointer(pElem)).Fdata)
}
Xsqlite3HashClear(tls, bp /* &temp2 */)
- Xsqlite3HashInit(tls, (pSchema + 8 /* &.tblHash */))
- for pElem = (*Hash)(unsafe.Pointer(bp + 16 /* &temp1 */)).Ffirst; pElem != 0; pElem = (*HashElem)(unsafe.Pointer(pElem)).Fnext {
+ Xsqlite3HashInit(tls, pSchema+8)
+ for pElem = (*Hash)(unsafe.Pointer(bp + 16)).Ffirst; pElem != 0; pElem = (*HashElem)(unsafe.Pointer(pElem)).Fnext {
var pTab uintptr = (*HashElem)(unsafe.Pointer(pElem)).Fdata
Xsqlite3DeleteTable(tls, uintptr(0), pTab)
}
Xsqlite3HashClear(tls, bp+16 /* &temp1 */)
- Xsqlite3HashClear(tls, (pSchema + 56 /* &.fkeyHash */))
+ Xsqlite3HashClear(tls, pSchema+56)
(*Schema)(unsafe.Pointer(pSchema)).FpSeqTab = uintptr(0)
- if (int32((*Schema)(unsafe.Pointer(pSchema)).FschemaFlags) & DB_SchemaLoaded) != 0 {
+ if int32((*Schema)(unsafe.Pointer(pSchema)).FschemaFlags)&DB_SchemaLoaded != 0 {
(*Schema)(unsafe.Pointer(pSchema)).FiGeneration++
}
- *(*U16)(unsafe.Pointer(pSchema + 78 /* &.schemaFlags */)) &= libc.Uint16FromInt32((libc.CplInt32((DB_SchemaLoaded | DB_ResetWanted))))
+ *(*U16)(unsafe.Pointer(pSchema + 78)) &= libc.Uint16FromInt32(libc.CplInt32(DB_SchemaLoaded | DB_ResetWanted))
}
// Find and return the schema associated with a BTree. Create
// a new one if necessary.
-func Xsqlite3SchemaGet(tls *libc.TLS, db uintptr, pBt uintptr) uintptr { /* sqlite3.c:118320:23: */
+func Xsqlite3SchemaGet(tls *libc.TLS, db uintptr, pBt uintptr) uintptr { /* sqlite3.c:119174:23: */
var p uintptr
if pBt != 0 {
p = Xsqlite3BtreeSchema(tls, pBt, int32(unsafe.Sizeof(Schema{})), *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{Xsqlite3SchemaClear})))
@@ -99090,10 +100531,10 @@ func Xsqlite3SchemaGet(tls *libc.TLS, db uintptr, pBt uintptr) uintptr { /* sqli
if !(p != 0) {
Xsqlite3OomFault(tls, db)
} else if 0 == int32((*Schema)(unsafe.Pointer(p)).Ffile_format) {
- Xsqlite3HashInit(tls, (p + 8 /* &.tblHash */))
- Xsqlite3HashInit(tls, (p + 24 /* &.idxHash */))
- Xsqlite3HashInit(tls, (p + 40 /* &.trigHash */))
- Xsqlite3HashInit(tls, (p + 56 /* &.fkeyHash */))
+ Xsqlite3HashInit(tls, p+8)
+ Xsqlite3HashInit(tls, p+24)
+ Xsqlite3HashInit(tls, p+40)
+ Xsqlite3HashInit(tls, p+56)
(*Schema)(unsafe.Pointer(p)).Fenc = U8(SQLITE_UTF8)
}
return p
@@ -99127,7 +100568,7 @@ func Xsqlite3SchemaGet(tls *libc.TLS, db uintptr, pBt uintptr) uintptr { /* sqli
// pSrc->a[0].pTab Pointer to the Table object
// pSrc->a[0].pIndex Pointer to the INDEXED BY index, if there is one
//
-func Xsqlite3SrcListLookup(tls *libc.TLS, pParse uintptr, pSrc uintptr) uintptr { /* sqlite3.c:118371:22: */
+func Xsqlite3SrcListLookup(tls *libc.TLS, pParse uintptr, pSrc uintptr) uintptr { /* sqlite3.c:119225:22: */
var pItem uintptr = pSrc + 8 /* &.a */
var pTab uintptr
@@ -99136,7 +100577,7 @@ func Xsqlite3SrcListLookup(tls *libc.TLS, pParse uintptr, pSrc uintptr) uintptr
(*SrcItem)(unsafe.Pointer(pItem)).FpTab = pTab
if pTab != 0 {
(*Table)(unsafe.Pointer(pTab)).FnTabRef++
- if ((uint32(int32(*(*uint16)(unsafe.Pointer((pItem + 36 /* &.fg */) + 4 /* &.isIndexedBy */)) & 0x2 >> 1))) != 0) && (Xsqlite3IndexedByLookup(tls, pParse, pItem) != 0) {
+ if uint32(int32(*(*uint16)(unsafe.Pointer(pItem + 36 + 4))&0x2>>1)) != 0 && Xsqlite3IndexedByLookup(tls, pParse, pItem) != 0 {
pTab = uintptr(0)
}
}
@@ -99157,17 +100598,17 @@ func Xsqlite3SrcListLookup(tls *libc.TLS, pParse uintptr, pSrc uintptr) uintptr
// 3) The table is a shadow table, the database connection is in
// defensive mode, and the current sqlite3_prepare()
// is for a top-level SQL statement.
-func tabIsReadOnly(tls *libc.TLS, pParse uintptr, pTab uintptr) int32 { /* sqlite3.c:118402:12: */
+func tabIsReadOnly(tls *libc.TLS, pParse uintptr, pTab uintptr) int32 { /* sqlite3.c:119256:12: */
var db uintptr
- if (*Table)(unsafe.Pointer(pTab)).FnModuleArg != 0 {
- return (libc.Bool32((*Sqlite3_module)(unsafe.Pointer((*Module)(unsafe.Pointer((*VTable)(unsafe.Pointer(Xsqlite3GetVTable(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, pTab))).FpMod)).FpModule)).FxUpdate == uintptr(0)))
+ if int32((*Table)(unsafe.Pointer(pTab)).FeTabType) == TABTYP_VTAB {
+ return libc.Bool32((*Sqlite3_module)(unsafe.Pointer((*Module)(unsafe.Pointer((*VTable)(unsafe.Pointer(Xsqlite3GetVTable(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, pTab))).FpMod)).FpModule)).FxUpdate == uintptr(0))
}
- if ((*Table)(unsafe.Pointer(pTab)).FtabFlags & (U32(TF_Readonly | TF_Shadow))) == U32(0) {
+ if (*Table)(unsafe.Pointer(pTab)).FtabFlags&U32(TF_Readonly|TF_Shadow) == U32(0) {
return 0
}
db = (*Parse)(unsafe.Pointer(pParse)).Fdb
- if ((*Table)(unsafe.Pointer(pTab)).FtabFlags & U32(TF_Readonly)) != U32(0) {
- return (libc.Bool32((Xsqlite3WritableSchema(tls, db) == 0) && (int32((*Parse)(unsafe.Pointer(pParse)).Fnested) == 0)))
+ if (*Table)(unsafe.Pointer(pTab)).FtabFlags&U32(TF_Readonly) != U32(0) {
+ return libc.Bool32(Xsqlite3WritableSchema(tls, db) == 0 && int32((*Parse)(unsafe.Pointer(pParse)).Fnested) == 0)
}
return Xsqlite3ReadOnlyShadowTables(tls, db)
@@ -99176,16 +100617,16 @@ func tabIsReadOnly(tls *libc.TLS, pParse uintptr, pTab uintptr) int32 { /* sqlit
// Check to make sure the given table is writable. If it is not
// writable, generate an error message and return 1. If it is
// writable return 0;
-func Xsqlite3IsReadOnly(tls *libc.TLS, pParse uintptr, pTab uintptr, viewOk int32) int32 { /* sqlite3.c:118421:20: */
+func Xsqlite3IsReadOnly(tls *libc.TLS, pParse uintptr, pTab uintptr, viewOk int32) int32 { /* sqlite3.c:119275:20: */
bp := tls.Alloc(16)
defer tls.Free(16)
if tabIsReadOnly(tls, pParse, pTab) != 0 {
- Xsqlite3ErrorMsg(tls, pParse, ts+13443 /* "table %s may not..." */, libc.VaList(bp, (*Table)(unsafe.Pointer(pTab)).FzName))
+ Xsqlite3ErrorMsg(tls, pParse, ts+14626 /* "table %s may not..." */, libc.VaList(bp, (*Table)(unsafe.Pointer(pTab)).FzName))
return 1
}
- if !(viewOk != 0) && ((*Table)(unsafe.Pointer(pTab)).FpSelect != 0) {
- Xsqlite3ErrorMsg(tls, pParse, ts+13472 /* "cannot modify %s..." */, libc.VaList(bp+8, (*Table)(unsafe.Pointer(pTab)).FzName))
+ if !(viewOk != 0) && int32((*Table)(unsafe.Pointer(pTab)).FeTabType) == TABTYP_VIEW {
+ Xsqlite3ErrorMsg(tls, pParse, ts+14655 /* "cannot modify %s..." */, libc.VaList(bp+8, (*Table)(unsafe.Pointer(pTab)).FzName))
return 1
}
return 0
@@ -99194,7 +100635,7 @@ func Xsqlite3IsReadOnly(tls *libc.TLS, pParse uintptr, pTab uintptr, viewOk int3
// Evaluate a view and store its result in an ephemeral table. The
// pWhere argument is an optional WHERE clause that restricts the
// set of rows in the view that are to be added to the ephemeral table.
-func Xsqlite3MaterializeView(tls *libc.TLS, pParse uintptr, pView uintptr, pWhere uintptr, pOrderBy uintptr, pLimit uintptr, iCur int32) { /* sqlite3.c:118442:21: */
+func Xsqlite3MaterializeView(tls *libc.TLS, pParse uintptr, pView uintptr, pWhere uintptr, pOrderBy uintptr, pLimit uintptr, iCur int32) { /* sqlite3.c:119296:21: */
bp := tls.Alloc(28)
defer tls.Free(28)
@@ -99208,8 +100649,8 @@ func Xsqlite3MaterializeView(tls *libc.TLS, pParse uintptr, pView uintptr, pWher
pFrom = Xsqlite3SrcListAppend(tls, pParse, uintptr(0), uintptr(0), uintptr(0))
if pFrom != 0 {
- (*SrcItem)(unsafe.Pointer((pFrom + 8 /* &.a */))).FzName = Xsqlite3DbStrDup(tls, db, (*Table)(unsafe.Pointer(pView)).FzName)
- (*SrcItem)(unsafe.Pointer((pFrom + 8 /* &.a */))).FzDatabase = Xsqlite3DbStrDup(tls, db, (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+uintptr(iDb)*16)).FzDbSName)
+ (*SrcItem)(unsafe.Pointer(pFrom + 8)).FzName = Xsqlite3DbStrDup(tls, db, (*Table)(unsafe.Pointer(pView)).FzName)
+ (*SrcItem)(unsafe.Pointer(pFrom + 8)).FzDatabase = Xsqlite3DbStrDup(tls, db, (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+uintptr(iDb)*16)).FzDbSName)
}
pSel = Xsqlite3SelectNew(tls, pParse, uintptr(0), pFrom, pWhere, uintptr(0), uintptr(0), pOrderBy,
@@ -99226,7 +100667,7 @@ func Xsqlite3MaterializeView(tls *libc.TLS, pParse uintptr, pView uintptr, pWher
// DELETE FROM table_wxyz WHERE a<5 AND b NOT NULL;
// \________/ \________________/
// pTabList pWhere
-func Xsqlite3DeleteFrom(tls *libc.TLS, pParse uintptr, pTabList uintptr, pWhere uintptr, pOrderBy uintptr, pLimit uintptr) { /* sqlite3.c:118580:21: */
+func Xsqlite3DeleteFrom(tls *libc.TLS, pParse uintptr, pTabList uintptr, pWhere uintptr, pOrderBy uintptr, pLimit uintptr) { /* sqlite3.c:119435:21: */
bp := tls.Alloc(56)
defer tls.Free(56)
@@ -99286,7 +100727,7 @@ func Xsqlite3DeleteFrom(tls *libc.TLS, pParse uintptr, pTabList uintptr, pWhere
libc.Xmemset(tls, bp /* &sContext */, 0, uint32(unsafe.Sizeof(AuthContext{})))
db = (*Parse)(unsafe.Pointer(pParse)).Fdb
- if !(((*Parse)(unsafe.Pointer(pParse)).FnErr != 0) || ((*Sqlite3)(unsafe.Pointer(db)).FmallocFailed != 0)) {
+ if !((*Parse)(unsafe.Pointer(pParse)).FnErr != 0 || (*Sqlite3)(unsafe.Pointer(db)).FmallocFailed != 0) {
goto __1
}
goto delete_from_cleanup
@@ -99308,8 +100749,8 @@ __2:
// Figure out if we have any triggers and if the table being
// deleted from is a view
pTrigger = Xsqlite3TriggersExist(tls, pParse, pTab, TK_DELETE, uintptr(0), uintptr(0))
- isView = (libc.Bool32((*Table)(unsafe.Pointer(pTab)).FpSelect != uintptr(0)))
- bComplex = (libc.Bool32((pTrigger != 0) || (Xsqlite3FkRequired(tls, pParse, pTab, uintptr(0), 0) != 0)))
+ isView = libc.Bool32(int32((*Table)(unsafe.Pointer(pTab)).FeTabType) == TABTYP_VIEW)
+ bComplex = libc.Bool32(pTrigger != 0 || Xsqlite3FkRequired(tls, pParse, pTab, uintptr(0), 0) != 0)
// If pTab is really a view, make sure it has been initialized.
if !(Xsqlite3ViewGetColumnNames(tls, pParse, pTab) != 0) {
@@ -99344,7 +100785,7 @@ __5:
// Assign cursor numbers to the table and all its indices.
- iTabCur = libc.AssignPtrInt32((pTabList+8 /* &.a */)+44 /* &.iCursor */, libc.PostIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnTab, 1))
+ iTabCur = libc.AssignPtrInt32(pTabList+8+44, libc.PostIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnTab, 1))
nIdx = 0
pIdx = (*Table)(unsafe.Pointer(pTab)).FpIndex
__6:
@@ -99402,7 +100843,7 @@ __12:
libc.Xmemset(tls, bp+8 /* &sNC */, 0, uint32(unsafe.Sizeof(NameContext{})))
(*NameContext)(unsafe.Pointer(bp + 8 /* &sNC */)).FpParse = pParse
(*NameContext)(unsafe.Pointer(bp + 8 /* &sNC */)).FpSrcList = pTabList
- if !(Xsqlite3ResolveExprNames(tls, bp+8 /* &sNC */, pWhere) != 0) {
+ if !(Xsqlite3ResolveExprNames(tls, bp+8, pWhere) != 0) {
goto __13
}
goto delete_from_cleanup
@@ -99411,9 +100852,9 @@ __13:
// Initialize the counter of the number of rows deleted, if
// we are counting rows.
- if !((((((*Sqlite3)(unsafe.Pointer(db)).Fflags & (U64((uint64(0x00001))) << 32)) != uint64(0)) &&
- !(int32((*Parse)(unsafe.Pointer(pParse)).Fnested) != 0)) &&
- !(int32((*Parse)(unsafe.Pointer(pParse)).FpTriggerTab) != 0)) &&
+ if !((*Sqlite3)(unsafe.Pointer(db)).Fflags&(U64(uint64(0x00001))<<32) != uint64(0) &&
+ !(int32((*Parse)(unsafe.Pointer(pParse)).Fnested) != 0) &&
+ !(int32((*Parse)(unsafe.Pointer(pParse)).FpTriggerTab) != 0) &&
!(int32((*Parse)(unsafe.Pointer(pParse)).FbReturning) != 0)) {
goto __14
}
@@ -99432,16 +100873,16 @@ __14:
// the callback returns SQLITE_IGNORE then the DELETE operation proceeds but
// the truncate optimization is disabled and all rows are deleted
// individually.
- if !(((((rcauth == SQLITE_OK) &&
- (pWhere == uintptr(0))) &&
- !(bComplex != 0)) &&
- !((*Table)(unsafe.Pointer(pTab)).FnModuleArg != 0)) &&
- ((*Sqlite3)(unsafe.Pointer(db)).FxPreUpdateCallback == uintptr(0))) {
+ if !(rcauth == SQLITE_OK &&
+ pWhere == uintptr(0) &&
+ !(bComplex != 0) &&
+ !(int32((*Table)(unsafe.Pointer(pTab)).FeTabType) == TABTYP_VTAB) &&
+ (*Sqlite3)(unsafe.Pointer(db)).FxPreUpdateCallback == uintptr(0)) {
goto __15
}
Xsqlite3TableLock(tls, pParse, iDb, (*Table)(unsafe.Pointer(pTab)).Ftnum, uint8(1), (*Table)(unsafe.Pointer(pTab)).FzName)
- if !(((*Table)(unsafe.Pointer((pTab))).FtabFlags & U32(TF_WithoutRowid)) == U32(0)) {
+ if !((*Table)(unsafe.Pointer(pTab)).FtabFlags&U32(TF_WithoutRowid) == U32(0)) {
goto __17
}
Xsqlite3VdbeAddOp4(tls, v, OP_Clear, int32((*Table)(unsafe.Pointer(pTab)).Ftnum), iDb, func() int32 {
@@ -99460,7 +100901,7 @@ __18:
}
Xsqlite3VdbeAddOp2(tls, v, OP_Clear, int32((*Index)(unsafe.Pointer(pIdx)).Ftnum), iDb)
- if !(((int32(*(*uint16)(unsafe.Pointer((pIdx) + 56 /* &.idxType */)) & 0x3 >> 0)) == SQLITE_IDXTYPE_PRIMARYKEY) && !(((*Table)(unsafe.Pointer((pTab))).FtabFlags & U32(TF_WithoutRowid)) == U32(0))) {
+ if !(int32(*(*uint16)(unsafe.Pointer(pIdx + 56))&0x3>>0) == SQLITE_IDXTYPE_PRIMARYKEY && !((*Table)(unsafe.Pointer(pTab)).FtabFlags&U32(TF_WithoutRowid) == U32(0))) {
goto __21
}
Xsqlite3VdbeChangeP3(tls, v, -1, func() int32 {
@@ -99481,20 +100922,20 @@ __20:
goto __16
__15:
- wcf = (U16(WHERE_ONEPASS_DESIRED | WHERE_DUPLICATES_OK))
- if !(((*NameContext)(unsafe.Pointer(bp+8 /* &sNC */)).FncFlags & NC_VarSelect) != 0) {
+ wcf = U16(WHERE_ONEPASS_DESIRED | WHERE_DUPLICATES_OK)
+ if !((*NameContext)(unsafe.Pointer(bp+8)).FncFlags&NC_VarSelect != 0) {
goto __22
}
bComplex = 1
__22:
;
- wcf = U16(int32(wcf) | (func() int32 {
+ wcf = U16(int32(wcf) | func() int32 {
if bComplex != 0 {
return 0
}
return WHERE_ONEPASS_MULTIROW
- }()))
- if !(((*Table)(unsafe.Pointer((pTab))).FtabFlags & U32(TF_WithoutRowid)) == U32(0)) {
+ }())
+ if !((*Table)(unsafe.Pointer(pTab)).FtabFlags&U32(TF_WithoutRowid) == U32(0)) {
goto __23
}
// For a rowid table, initialize the RowSet to an empty set
@@ -99509,8 +100950,8 @@ __23:
pPk = Xsqlite3PrimaryKeyIndex(tls, pTab)
nPk = I16((*Index)(unsafe.Pointer(pPk)).FnKeyCol)
- iPk = ((*Parse)(unsafe.Pointer(pParse)).FnMem + 1)
- *(*int32)(unsafe.Pointer(pParse + 44 /* &.nMem */)) += (int32(nPk))
+ iPk = (*Parse)(unsafe.Pointer(pParse)).FnMem + 1
+ *(*int32)(unsafe.Pointer(pParse + 44)) += int32(nPk)
iEphCur = libc.PostIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnTab, 1)
addrEphOpen = Xsqlite3VdbeAddOp2(tls, v, OP_OpenEphemeral, iEphCur, int32(nPk))
Xsqlite3VdbeSetP4KeyInfo(tls, pParse, pPk)
@@ -99524,7 +100965,7 @@ __24:
// ONEPASS_OFF: Two-pass approach - use a FIFO for rowids/PK values.
// ONEPASS_SINGLE: One-pass approach - at most one row deleted.
// ONEPASS_MULTI: One-pass approach - any number of rows may be deleted.
- pWInfo = Xsqlite3WhereBegin(tls, pParse, pTabList, pWhere, uintptr(0), uintptr(0), wcf, (iTabCur + 1))
+ pWInfo = Xsqlite3WhereBegin(tls, pParse, pTabList, pWhere, uintptr(0), uintptr(0), wcf, iTabCur+1)
if !(pWInfo == uintptr(0)) {
goto __25
}
@@ -99565,7 +101006,7 @@ __31:
}
Xsqlite3ExprCodeGetColumnOfTable(tls, v, pTab, iTabCur,
- int32(*(*I16)(unsafe.Pointer((*Index)(unsafe.Pointer(pPk)).FaiColumn + uintptr(i)*2))), (iPk + i))
+ int32(*(*I16)(unsafe.Pointer((*Index)(unsafe.Pointer(pPk)).FaiColumn + uintptr(i)*2))), iPk+i)
goto __32
__32:
i++
@@ -99588,7 +101029,7 @@ __30:
// one, so just keep it in its register(s) and fall through to the
// delete code.
nKey = nPk // OP_Found will use an unpacked key
- aToOpen = Xsqlite3DbMallocRawNN(tls, db, (uint64(nIdx + 2)))
+ aToOpen = Xsqlite3DbMallocRawNN(tls, db, uint64(nIdx+2))
if !(aToOpen == uintptr(0)) {
goto __36
}
@@ -99596,18 +101037,18 @@ __30:
goto delete_from_cleanup
__36:
;
- libc.Xmemset(tls, aToOpen, 1, (uint32(nIdx + 1)))
- *(*U8)(unsafe.Pointer(aToOpen + uintptr((nIdx + 1)))) = U8(0)
- if !(*(*int32)(unsafe.Pointer(bp + 40 /* &aiCurOnePass[0] */)) >= 0) {
+ libc.Xmemset(tls, aToOpen, 1, uint32(nIdx+1))
+ *(*U8)(unsafe.Pointer(aToOpen + uintptr(nIdx+1))) = U8(0)
+ if !(*(*int32)(unsafe.Pointer(bp + 40)) >= 0) {
goto __37
}
- *(*U8)(unsafe.Pointer(aToOpen + uintptr((*(*int32)(unsafe.Pointer(bp + 40 /* &aiCurOnePass[0] */)) - iTabCur)))) = U8(0)
+ *(*U8)(unsafe.Pointer(aToOpen + uintptr(*(*int32)(unsafe.Pointer(bp + 40))-iTabCur))) = U8(0)
__37:
;
- if !(*(*int32)(unsafe.Pointer(bp + 40 /* &aiCurOnePass[0] */ + 1*4)) >= 0) {
+ if !(*(*int32)(unsafe.Pointer(bp + 40 + 1*4)) >= 0) {
goto __38
}
- *(*U8)(unsafe.Pointer(aToOpen + uintptr((*(*int32)(unsafe.Pointer(bp + 40 /* &aiCurOnePass[0] */ + 1*4)) - iTabCur)))) = U8(0)
+ *(*U8)(unsafe.Pointer(aToOpen + uintptr(*(*int32)(unsafe.Pointer(bp + 40 + 1*4))-iTabCur))) = U8(0)
__38:
;
if !(addrEphOpen != 0) {
@@ -99643,7 +101084,7 @@ __35:
// deleting from and all its indices. If this is a view, then the
// only effect this statement has is to fire the INSTEAD OF
// triggers.
- if !(!(isView != 0)) {
+ if !!(isView != 0) {
goto __42
}
iAddrOnce = 0
@@ -99672,7 +101113,7 @@ __42:
goto __45
}
// OP_Found will use an unpacked key
- if !(!((*Table)(unsafe.Pointer(pTab)).FnModuleArg != 0) && (*(*U8)(unsafe.Pointer(aToOpen + uintptr((*(*int32)(unsafe.Pointer(bp + 48 /* iDataCur */)) - iTabCur)))) != 0)) {
+ if !(!(int32((*Table)(unsafe.Pointer(pTab)).FeTabType) == TABTYP_VTAB) && *(*U8)(unsafe.Pointer(aToOpen + uintptr(*(*int32)(unsafe.Pointer(bp + 48))-iTabCur))) != 0) {
goto __47
}
@@ -99686,7 +101127,7 @@ __45:
goto __48
}
addrLoop = Xsqlite3VdbeAddOp1(tls, v, OP_Rewind, iEphCur)
- if !((*Table)(unsafe.Pointer(pTab)).FnModuleArg != 0) {
+ if !(int32((*Table)(unsafe.Pointer(pTab)).FeTabType) == TABTYP_VTAB) {
goto __50
}
Xsqlite3VdbeAddOp3(tls, v, OP_Column, iEphCur, 0, iKey)
@@ -99706,7 +101147,7 @@ __46:
;
// Delete the row
- if !((*Table)(unsafe.Pointer(pTab)).FnModuleArg != 0) {
+ if !(int32((*Table)(unsafe.Pointer(pTab)).FeTabType) == TABTYP_VTAB) {
goto __52
}
pVTab = Xsqlite3GetVTable(tls, db, pTab)
@@ -99717,7 +101158,7 @@ __46:
goto __54
}
Xsqlite3VdbeAddOp1(tls, v, OP_Close, iTabCur)
- if !((*Parse)(unsafe.Pointer((pParse))).FpToplevel == uintptr(0)) {
+ if !((*Parse)(unsafe.Pointer(pParse)).FpToplevel == uintptr(0)) {
goto __55
}
(*Parse)(unsafe.Pointer(pParse)).FisMultiWrite = U8(0)
@@ -99730,7 +101171,7 @@ __54:
goto __53
__52:
- count = (libc.Bool32(int32((*Parse)(unsafe.Pointer(pParse)).Fnested) == 0)) // True to count changes
+ count = libc.Bool32(int32((*Parse)(unsafe.Pointer(pParse)).Fnested) == 0) // True to count changes
Xsqlite3GenerateRowDelete(tls, pParse, pTab, pTrigger, *(*int32)(unsafe.Pointer(bp + 48 /* iDataCur */)), *(*int32)(unsafe.Pointer(bp + 52 /* iIdxCur */)),
iKey, nKey, uint8(count), uint8(OE_Default), uint8(eOnePass), *(*int32)(unsafe.Pointer(bp + 40 /* &aiCurOnePass[0] */ + 1*4)))
__53:
@@ -99747,7 +101188,7 @@ __56:
if !(pPk != 0) {
goto __58
}
- Xsqlite3VdbeAddOp2(tls, v, OP_Next, iEphCur, (addrLoop + 1))
+ Xsqlite3VdbeAddOp2(tls, v, OP_Next, iEphCur, addrLoop+1)
Xsqlite3VdbeJumpHere(tls, v, addrLoop)
goto __59
__58:
@@ -99763,7 +101204,7 @@ __16:
// Update the sqlite_sequence table by storing the content of the
// maximum rowid counter values recorded while inserting into
// autoincrement tables.
- if !((int32((*Parse)(unsafe.Pointer(pParse)).Fnested) == 0) && ((*Parse)(unsafe.Pointer(pParse)).FpTriggerTab == uintptr(0))) {
+ if !(int32((*Parse)(unsafe.Pointer(pParse)).Fnested) == 0 && (*Parse)(unsafe.Pointer(pParse)).FpTriggerTab == uintptr(0)) {
goto __60
}
Xsqlite3AutoincrementEnd(tls, pParse)
@@ -99778,7 +101219,7 @@ __60:
}
Xsqlite3VdbeAddOp2(tls, v, OP_ChngCntRow, memCnt, 1)
Xsqlite3VdbeSetNumCols(tls, v, 1)
- Xsqlite3VdbeSetColName(tls, v, 0, COLNAME_NAME, ts+13510 /* "rows deleted" */, uintptr(0))
+ Xsqlite3VdbeSetColName(tls, v, 0, COLNAME_NAME, ts+14693 /* "rows deleted" */, uintptr(0))
__61:
;
@@ -99833,7 +101274,7 @@ delete_from_cleanup:
// starting at iIdxCur) that already points to the index entry to be deleted.
// Except, this optimization is disabled if there are BEFORE triggers since
// the trigger body might have moved the cursor.
-func Xsqlite3GenerateRowDelete(tls *libc.TLS, pParse uintptr, pTab uintptr, pTrigger uintptr, iDataCur int32, iIdxCur int32, iPk int32, nPk I16, count U8, onconf U8, eMode U8, iIdxNoSeek int32) { /* sqlite3.c:119028:21: */
+func Xsqlite3GenerateRowDelete(tls *libc.TLS, pParse uintptr, pTab uintptr, pTrigger uintptr, iDataCur int32, iIdxCur int32, iPk int32, nPk I16, count U8, onconf U8, eMode U8, iIdxNoSeek int32) { /* sqlite3.c:119883:21: */
var v uintptr = (*Parse)(unsafe.Pointer(pParse)).FpVdbe // Vdbe
var iOld int32 = 0 // First register in OLD.* array
var iLabel int32 // Label resolved to end of generated code
@@ -99845,7 +101286,7 @@ func Xsqlite3GenerateRowDelete(tls *libc.TLS, pParse uintptr, pTab uintptr, pTri
// (this can happen if a trigger program has already deleted it), do
// not attempt to delete it or fire any DELETE triggers.
iLabel = Xsqlite3VdbeMakeLabel(tls, pParse)
- if ((*Table)(unsafe.Pointer((pTab))).FtabFlags & U32(TF_WithoutRowid)) == U32(0) {
+ if (*Table)(unsafe.Pointer(pTab)).FtabFlags&U32(TF_WithoutRowid) == U32(0) {
opSeek = uint8(OP_NotExists)
} else {
opSeek = uint8(OP_NotFound)
@@ -99857,7 +101298,7 @@ func Xsqlite3GenerateRowDelete(tls *libc.TLS, pParse uintptr, pTab uintptr, pTri
// If there are any triggers to fire, allocate a range of registers to
// use for the old.* references in the triggers.
- if (Xsqlite3FkRequired(tls, pParse, pTab, uintptr(0), 0) != 0) || (pTrigger != 0) {
+ if Xsqlite3FkRequired(tls, pParse, pTab, uintptr(0), 0) != 0 || pTrigger != 0 {
var mask U32 // Mask of OLD.* columns in use
var iCol int32 // Iterator used while populating OLD.*
var addrStart int32 // Start of BEFORE trigger programs
@@ -99865,19 +101306,19 @@ func Xsqlite3GenerateRowDelete(tls *libc.TLS, pParse uintptr, pTab uintptr, pTri
// TODO: Could use temporary registers here. Also could attempt to
// avoid copying the contents of the rowid register.
mask = Xsqlite3TriggerColmask(tls,
- pParse, pTrigger, uintptr(0), 0, (TRIGGER_BEFORE | TRIGGER_AFTER), pTab, int32(onconf))
- mask = mask | (Xsqlite3FkOldmask(tls, pParse, pTab))
- iOld = ((*Parse)(unsafe.Pointer(pParse)).FnMem + 1)
- *(*int32)(unsafe.Pointer(pParse + 44 /* &.nMem */)) += (1 + int32((*Table)(unsafe.Pointer(pTab)).FnCol))
+ pParse, pTrigger, uintptr(0), 0, TRIGGER_BEFORE|TRIGGER_AFTER, pTab, int32(onconf))
+ mask = mask | Xsqlite3FkOldmask(tls, pParse, pTab)
+ iOld = (*Parse)(unsafe.Pointer(pParse)).FnMem + 1
+ *(*int32)(unsafe.Pointer(pParse + 44)) += 1 + int32((*Table)(unsafe.Pointer(pTab)).FnCol)
// Populate the OLD.* pseudo-table register array. These values will be
// used by any BEFORE and AFTER triggers that exist.
Xsqlite3VdbeAddOp2(tls, v, OP_Copy, iPk, iOld)
for iCol = 0; iCol < int32((*Table)(unsafe.Pointer(pTab)).FnCol); iCol++ {
- if (mask == 0xffffffff) || ((iCol <= 31) && ((mask & (uint32((uint32(1))) << (iCol))) != U32(0))) {
+ if mask == 0xffffffff || iCol <= 31 && mask&(uint32(uint32(1))<<iCol) != U32(0) {
var kk int32 = int32(Xsqlite3TableColumnToStorage(tls, pTab, int16(iCol)))
- Xsqlite3ExprCodeGetColumnOfTable(tls, v, pTab, iDataCur, iCol, ((iOld + kk) + 1))
+ Xsqlite3ExprCodeGetColumnOfTable(tls, v, pTab, iDataCur, iCol, iOld+kk+1)
}
}
@@ -99914,7 +101355,7 @@ func Xsqlite3GenerateRowDelete(tls *libc.TLS, pParse uintptr, pTab uintptr, pTri
// be invoked unless table pTab is a system table. The difference is that
// the update-hook is not invoked for rows removed by REPLACE, but the
// pre-update-hook is.
- if (*Table)(unsafe.Pointer(pTab)).FpSelect == uintptr(0) {
+ if !(int32((*Table)(unsafe.Pointer(pTab)).FeTabType) == TABTYP_VIEW) {
var p5 U8 = U8(0)
Xsqlite3GenerateRowIndexDelete(tls, pParse, pTab, iDataCur, iIdxCur, uintptr(0), iIdxNoSeek)
Xsqlite3VdbeAddOp2(tls, v, OP_Delete, iDataCur, func() int32 {
@@ -99923,17 +101364,17 @@ func Xsqlite3GenerateRowDelete(tls *libc.TLS, pParse uintptr, pTab uintptr, pTri
}
return 0
}())
- if (int32((*Parse)(unsafe.Pointer(pParse)).Fnested) == 0) || (0 == Xsqlite3_stricmp(tls, (*Table)(unsafe.Pointer(pTab)).FzName, ts+10072 /* "sqlite_stat1" */)) {
+ if int32((*Parse)(unsafe.Pointer(pParse)).Fnested) == 0 || 0 == Xsqlite3_stricmp(tls, (*Table)(unsafe.Pointer(pTab)).FzName, ts+11186) {
Xsqlite3VdbeAppendP4(tls, v, pTab, -6)
}
if int32(eMode) != ONEPASS_OFF {
Xsqlite3VdbeChangeP5(tls, v, uint16(OPFLAG_AUXDELETE))
}
- if (iIdxNoSeek >= 0) && (iIdxNoSeek != iDataCur) {
+ if iIdxNoSeek >= 0 && iIdxNoSeek != iDataCur {
Xsqlite3VdbeAddOp1(tls, v, OP_Delete, iIdxNoSeek)
}
if int32(eMode) == ONEPASS_MULTI {
- p5 = U8(int32(p5) | (OPFLAG_SAVEPOSITION))
+ p5 = U8(int32(p5) | OPFLAG_SAVEPOSITION)
}
Xsqlite3VdbeChangeP5(tls, v, uint16(p5))
}
@@ -99970,7 +101411,7 @@ func Xsqlite3GenerateRowDelete(tls *libc.TLS, pParse uintptr, pTab uintptr, pTri
//
// 3. The "iDataCur" cursor must be already be positioned on the row
// that is to be deleted.
-func Xsqlite3GenerateRowIndexDelete(tls *libc.TLS, pParse uintptr, pTab uintptr, iDataCur int32, iIdxCur int32, aRegIdx uintptr, iIdxNoSeek int32) { /* sqlite3.c:119180:21: */
+func Xsqlite3GenerateRowIndexDelete(tls *libc.TLS, pParse uintptr, pTab uintptr, iDataCur int32, iIdxCur int32, aRegIdx uintptr, iIdxNoSeek int32) { /* sqlite3.c:120035:21: */
bp := tls.Alloc(4)
defer tls.Free(4)
@@ -99984,7 +101425,7 @@ func Xsqlite3GenerateRowIndexDelete(tls *libc.TLS, pParse uintptr, pTab uintptr,
var pPk uintptr // PRIMARY KEY index, or NULL for rowid tables
v = (*Parse)(unsafe.Pointer(pParse)).FpVdbe
- if ((*Table)(unsafe.Pointer((pTab))).FtabFlags & U32(TF_WithoutRowid)) == U32(0) {
+ if (*Table)(unsafe.Pointer(pTab)).FtabFlags&U32(TF_WithoutRowid) == U32(0) {
pPk = uintptr(0)
} else {
pPk = Xsqlite3PrimaryKeyIndex(tls, pTab)
@@ -99997,21 +101438,21 @@ __1:
}
{
- if (aRegIdx != uintptr(0)) && (*(*int32)(unsafe.Pointer(aRegIdx + uintptr(i)*4)) == 0) {
+ if aRegIdx != uintptr(0) && *(*int32)(unsafe.Pointer(aRegIdx + uintptr(i)*4)) == 0 {
goto __2
}
if pIdx == pPk {
goto __2
}
- if (iIdxCur + i) == iIdxNoSeek {
+ if iIdxCur+i == iIdxNoSeek {
goto __2
}
r1 = Xsqlite3GenerateIndexKey(tls, pParse, pIdx, iDataCur, 0, 1,
bp /* &iPartIdxLabel */, pPrior, r1)
- Xsqlite3VdbeAddOp3(tls, v, OP_IdxDelete, (iIdxCur + i), r1,
+ Xsqlite3VdbeAddOp3(tls, v, OP_IdxDelete, iIdxCur+i, r1,
func() int32 {
- if (uint32(int32(*(*uint16)(unsafe.Pointer(pIdx + 56 /* &.uniqNotNull */)) & 0x8 >> 3))) != 0 {
+ if uint32(int32(*(*uint16)(unsafe.Pointer(pIdx + 56))&0x8>>3)) != 0 {
return int32((*Index)(unsafe.Pointer(pIdx)).FnKeyCol)
}
return int32((*Index)(unsafe.Pointer(pIdx)).FnColumn)
@@ -100059,7 +101500,7 @@ __3:
// This optimization is helpful when doing a DELETE or an INTEGRITY_CHECK
// on a table with multiple indices, and especially with the ROWID or
// PRIMARY KEY columns of the index.
-func Xsqlite3GenerateIndexKey(tls *libc.TLS, pParse uintptr, pIdx uintptr, iDataCur int32, regOut int32, prefixOnly int32, piPartIdxLabel uintptr, pPrior uintptr, regPrior int32) int32 { /* sqlite3.c:119245:20: */
+func Xsqlite3GenerateIndexKey(tls *libc.TLS, pParse uintptr, pIdx uintptr, iDataCur int32, regOut int32, prefixOnly int32, piPartIdxLabel uintptr, pPrior uintptr, regPrior int32) int32 { /* sqlite3.c:120100:20: */
var v uintptr = (*Parse)(unsafe.Pointer(pParse)).FpVdbe
var j int32
var regBase int32
@@ -100068,7 +101509,7 @@ func Xsqlite3GenerateIndexKey(tls *libc.TLS, pParse uintptr, pIdx uintptr, iData
if piPartIdxLabel != 0 {
if (*Index)(unsafe.Pointer(pIdx)).FpPartIdxWhere != 0 {
*(*int32)(unsafe.Pointer(piPartIdxLabel)) = Xsqlite3VdbeMakeLabel(tls, pParse)
- (*Parse)(unsafe.Pointer(pParse)).FiSelfTab = (iDataCur + 1)
+ (*Parse)(unsafe.Pointer(pParse)).FiSelfTab = iDataCur + 1
Xsqlite3ExprIfFalseDup(tls, pParse, (*Index)(unsafe.Pointer(pIdx)).FpPartIdxWhere, *(*int32)(unsafe.Pointer(piPartIdxLabel)),
SQLITE_JUMPIFNULL)
(*Parse)(unsafe.Pointer(pParse)).FiSelfTab = 0
@@ -100078,23 +101519,23 @@ func Xsqlite3GenerateIndexKey(tls *libc.TLS, pParse uintptr, pIdx uintptr, iData
*(*int32)(unsafe.Pointer(piPartIdxLabel)) = 0
}
}
- if (prefixOnly != 0) && ((uint32(int32(*(*uint16)(unsafe.Pointer(pIdx + 56 /* &.uniqNotNull */)) & 0x8 >> 3))) != 0) {
+ if prefixOnly != 0 && uint32(int32(*(*uint16)(unsafe.Pointer(pIdx + 56))&0x8>>3)) != 0 {
nCol = int32((*Index)(unsafe.Pointer(pIdx)).FnKeyCol)
} else {
nCol = int32((*Index)(unsafe.Pointer(pIdx)).FnColumn)
}
regBase = Xsqlite3GetTempRange(tls, pParse, nCol)
- if (pPrior != 0) && ((regBase != regPrior) || ((*Index)(unsafe.Pointer(pPrior)).FpPartIdxWhere != 0)) {
+ if pPrior != 0 && (regBase != regPrior || (*Index)(unsafe.Pointer(pPrior)).FpPartIdxWhere != 0) {
pPrior = uintptr(0)
}
for j = 0; j < nCol; j++ {
- if ((pPrior != 0) &&
- (int32(*(*I16)(unsafe.Pointer((*Index)(unsafe.Pointer(pPrior)).FaiColumn + uintptr(j)*2))) == int32(*(*I16)(unsafe.Pointer((*Index)(unsafe.Pointer(pIdx)).FaiColumn + uintptr(j)*2))))) &&
- (int32(*(*I16)(unsafe.Pointer((*Index)(unsafe.Pointer(pPrior)).FaiColumn + uintptr(j)*2))) != (-2)) {
+ if pPrior != 0 &&
+ int32(*(*I16)(unsafe.Pointer((*Index)(unsafe.Pointer(pPrior)).FaiColumn + uintptr(j)*2))) == int32(*(*I16)(unsafe.Pointer((*Index)(unsafe.Pointer(pIdx)).FaiColumn + uintptr(j)*2))) &&
+ int32(*(*I16)(unsafe.Pointer((*Index)(unsafe.Pointer(pPrior)).FaiColumn + uintptr(j)*2))) != -2 {
// This column was already computed by the previous index
continue
}
- Xsqlite3ExprCodeLoadIndexColumn(tls, pParse, pIdx, iDataCur, j, (regBase + j))
+ Xsqlite3ExprCodeLoadIndexColumn(tls, pParse, pIdx, iDataCur, j, regBase+j)
if int32(*(*I16)(unsafe.Pointer((*Index)(unsafe.Pointer(pIdx)).FaiColumn + uintptr(j)*2))) >= 0 {
// If the column affinity is REAL but the number is an integer, then it
// might be stored in the table as an integer (using a compact
@@ -100115,7 +101556,7 @@ func Xsqlite3GenerateIndexKey(tls *libc.TLS, pParse uintptr, pIdx uintptr, iData
// If a prior call to sqlite3GenerateIndexKey() generated a jump-over label
// because it was a partial index, then this routine should be called to
// resolve that label.
-func Xsqlite3ResolvePartIdxLabel(tls *libc.TLS, pParse uintptr, iLabel int32) { /* sqlite3.c:119307:21: */
+func Xsqlite3ResolvePartIdxLabel(tls *libc.TLS, pParse uintptr, iLabel int32) { /* sqlite3.c:120162:21: */
if iLabel != 0 {
Xsqlite3VdbeResolveLabel(tls, (*Parse)(unsafe.Pointer(pParse)).FpVdbe, iLabel)
}
@@ -100143,24 +101584,24 @@ func Xsqlite3ResolvePartIdxLabel(tls *libc.TLS, pParse uintptr, iLabel int32) {
// #include "vdbeInt.h"
// Return the collating function associated with a function.
-func sqlite3GetFuncCollSeq(tls *libc.TLS, context uintptr) uintptr { /* sqlite3.c:119341:16: */
+func sqlite3GetFuncCollSeq(tls *libc.TLS, context uintptr) uintptr { /* sqlite3.c:120196:16: */
var pOp uintptr
- pOp = ((*Vdbe)(unsafe.Pointer((*Sqlite3_context)(unsafe.Pointer(context)).FpVdbe)).FaOp + uintptr(((*Sqlite3_context)(unsafe.Pointer(context)).FiOp-1))*20)
+ pOp = (*Vdbe)(unsafe.Pointer((*Sqlite3_context)(unsafe.Pointer(context)).FpVdbe)).FaOp + uintptr((*Sqlite3_context)(unsafe.Pointer(context)).FiOp-1)*20
- return *(*uintptr)(unsafe.Pointer(pOp + 16 /* &.p4 */))
+ return *(*uintptr)(unsafe.Pointer(pOp + 16))
}
// Indicate that the accumulator load should be skipped on this
// iteration of the aggregate loop.
-func sqlite3SkipAccumulatorLoad(tls *libc.TLS, context uintptr) { /* sqlite3.c:119354:13: */
+func sqlite3SkipAccumulatorLoad(tls *libc.TLS, context uintptr) { /* sqlite3.c:120209:13: */
(*Sqlite3_context)(unsafe.Pointer(context)).FisError = -1
(*Sqlite3_context)(unsafe.Pointer(context)).FskipFlag = U8(1)
}
// Implementation of the non-aggregate min() and max() functions
-func minmaxFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:119363:13: */
+func minmaxFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:120218:13: */
var i int32
var mask int32 // 0 for min() or 0xffffffff for max()
var iBest int32
@@ -100181,7 +101622,7 @@ func minmaxFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* s
if Xsqlite3_value_type(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*4))) == SQLITE_NULL {
return
}
- if (Xsqlite3MemCompare(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(iBest)*4)), *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*4)), pColl) ^ mask) >= 0 {
+ if Xsqlite3MemCompare(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(iBest)*4)), *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*4)), pColl)^mask >= 0 {
iBest = i
}
@@ -100190,8 +101631,8 @@ func minmaxFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* s
}
// Return the type of the argument.
-func typeofFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintptr) { /* sqlite3.c:119393:13: */
- var i int32 = (Xsqlite3_value_type(tls, *(*uintptr)(unsafe.Pointer(argv))) - 1)
+func typeofFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintptr) { /* sqlite3.c:120248:13: */
+ var i int32 = Xsqlite3_value_type(tls, *(*uintptr)(unsafe.Pointer(argv))) - 1
_ = NotUsed
// EVIDENCE-OF: R-01470-60482 The sqlite3_value_type(V) interface returns
@@ -100201,10 +101642,10 @@ func typeofFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintptr) { /
Xsqlite3_result_text(tls, context, azType2[i], -1, uintptr(0))
}
-var azType2 = [5]uintptr{ts + 5268 /* "integer" */, ts + 5263 /* "real" */, ts + 13523 /* "text" */, ts + 13528 /* "blob" */, ts + 5258 /* "null" */} /* sqlite3.c:119398:21 */
+var azType2 = [5]uintptr{ts + 6115 /* "integer" */, ts + 6110 /* "real" */, ts + 7872 /* "text" */, ts + 7867 /* "blob" */, ts + 6105 /* "null" */} /* sqlite3.c:120253:21 */
// Implementation of the length() function
-func lengthFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:119418:13: */
+func lengthFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:120273:13: */
_ = argc
switch Xsqlite3_value_type(tls, *(*uintptr)(unsafe.Pointer(argv))) {
@@ -100227,16 +101668,16 @@ func lengthFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* s
return
}
z0 = z
- for (int32(libc.AssignUint8(&c, *(*uint8)(unsafe.Pointer(z))))) != 0 {
+ for int32(libc.AssignUint8(&c, *(*uint8)(unsafe.Pointer(z)))) != 0 {
z++
if int32(c) >= 0xc0 {
- for (int32(*(*uint8)(unsafe.Pointer(z))) & 0xc0) == 0x80 {
+ for int32(*(*uint8)(unsafe.Pointer(z)))&0xc0 == 0x80 {
z++
z0++
}
}
}
- Xsqlite3_result_int(tls, context, ((int32(z) - int32(z0)) / 1))
+ Xsqlite3_result_int(tls, context, (int32(z)-int32(z0))/1)
break
}
@@ -100253,7 +101694,7 @@ func lengthFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* s
//
// IMP: R-23979-26855 The abs(X) function returns the absolute value of
// the numeric argument X.
-func absFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:119460:13: */
+func absFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:120315:13: */
_ = argc
switch Xsqlite3_value_type(tls, *(*uintptr)(unsafe.Pointer(argv))) {
@@ -100261,11 +101702,11 @@ func absFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqli
{
var iVal I64 = Xsqlite3_value_int64(tls, *(*uintptr)(unsafe.Pointer(argv)))
if iVal < int64(0) {
- if iVal == ((int64(-1)) - (int64(0xffffffff) | (I64((int64(0x7fffffff))) << 32))) {
+ if iVal == int64(-1)-(int64(0xffffffff)|I64(int64(0x7fffffff))<<32) {
// IMP: R-31676-45509 If X is the integer -9223372036854775808
// then abs(X) throws an integer overflow error since there is no
// equivalent positive 64-bit two complement value.
- Xsqlite3_result_error(tls, context, ts+13533 /* "integer overflow" */, -1)
+ Xsqlite3_result_error(tls, context, ts+14706 /* "integer overflow" */, -1)
return
}
iVal = -iVal
@@ -100307,7 +101748,7 @@ func absFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqli
// If both haystack and needle are BLOBs, then the result is one more than
// the number of bytes in haystack prior to the first occurrence of needle,
// or 0 if needle never occurs in haystack.
-func instrFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:119509:13: */
+func instrFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:120364:13: */
var zHaystack uintptr
var zNeedle uintptr
var nHaystack int32
@@ -100326,7 +101767,7 @@ func instrFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sq
_ = argc
typeHaystack = Xsqlite3_value_type(tls, *(*uintptr)(unsafe.Pointer(argv)))
typeNeedle = Xsqlite3_value_type(tls, *(*uintptr)(unsafe.Pointer(argv + 1*4)))
- if !((typeHaystack == SQLITE_NULL) || (typeNeedle == SQLITE_NULL)) {
+ if !(typeHaystack == SQLITE_NULL || typeNeedle == SQLITE_NULL) {
goto __1
}
return
@@ -100337,7 +101778,7 @@ __1:
if !(nNeedle > 0) {
goto __2
}
- if !((typeHaystack == SQLITE_BLOB) && (typeNeedle == SQLITE_BLOB)) {
+ if !(typeHaystack == SQLITE_BLOB && typeNeedle == SQLITE_BLOB) {
goto __3
}
zHaystack = Xsqlite3_value_blob(tls, *(*uintptr)(unsafe.Pointer(argv)))
@@ -100345,7 +101786,7 @@ __1:
isText = 0
goto __4
__3:
- if !((typeHaystack != SQLITE_BLOB) && (typeNeedle != SQLITE_BLOB)) {
+ if !(typeHaystack != SQLITE_BLOB && typeNeedle != SQLITE_BLOB) {
goto __5
}
zHaystack = Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv)))
@@ -100376,7 +101817,7 @@ __6:
;
__4:
;
- if !((zNeedle == uintptr(0)) || ((nHaystack != 0) && (zHaystack == uintptr(0)))) {
+ if !(zNeedle == uintptr(0) || nHaystack != 0 && zHaystack == uintptr(0)) {
goto __9
}
goto endInstrOOM
@@ -100384,8 +101825,8 @@ __9:
;
firstChar = *(*uint8)(unsafe.Pointer(zNeedle))
__10:
- if !((nNeedle <= nHaystack) &&
- ((int32(*(*uint8)(unsafe.Pointer(zHaystack))) != int32(firstChar)) || (libc.Xmemcmp(tls, zHaystack, zNeedle, uint32(nNeedle)) != 0))) {
+ if !(nNeedle <= nHaystack &&
+ (int32(*(*uint8)(unsafe.Pointer(zHaystack))) != int32(firstChar) || libc.Xmemcmp(tls, zHaystack, zNeedle, uint32(nNeedle)) != 0)) {
goto __11
}
N++
@@ -100394,7 +101835,7 @@ __12:
zHaystack++
goto __13
__13:
- if (isText != 0) && ((int32(*(*uint8)(unsafe.Pointer(zHaystack))) & 0xc0) == 0x80) {
+ if isText != 0 && int32(*(*uint8)(unsafe.Pointer(zHaystack)))&0xc0 == 0x80 {
goto __12
}
goto __14
@@ -100422,7 +101863,7 @@ endInstrOOM:
}
// Implementation of the printf() function.
-func printfFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:119577:13: */
+func printfFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:120432:13: */
bp := tls.Alloc(44)
defer tls.Free(44)
@@ -100434,11 +101875,11 @@ func printfFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* s
var n int32
var db uintptr = Xsqlite3_context_db_handle(tls, context)
- if (argc >= 1) && ((libc.AssignUintptr(&zFormat, Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv))))) != uintptr(0)) {
- (*PrintfArguments)(unsafe.Pointer(bp + 32 /* &x */)).FnArg = (argc - 1)
+ if argc >= 1 && libc.AssignUintptr(&zFormat, Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv)))) != uintptr(0) {
+ (*PrintfArguments)(unsafe.Pointer(bp + 32 /* &x */)).FnArg = argc - 1
(*PrintfArguments)(unsafe.Pointer(bp + 32 /* &x */)).FnUsed = 0
- (*PrintfArguments)(unsafe.Pointer(bp + 32 /* &x */)).FapArg = (argv + uintptr(1)*4)
- Xsqlite3StrAccumInit(tls, bp+8 /* &str */, db, uintptr(0), 0, *(*int32)(unsafe.Pointer((db + 112 /* &.aLimit */))))
+ (*PrintfArguments)(unsafe.Pointer(bp + 32 /* &x */)).FapArg = argv + uintptr(1)*4
+ Xsqlite3StrAccumInit(tls, bp+8 /* &str */, db, uintptr(0), 0, *(*int32)(unsafe.Pointer(db + 120)))
(*StrAccum)(unsafe.Pointer(bp + 8 /* &str */)).FprintfFlags = U8(SQLITE_PRINTF_SQLFUNC)
Xsqlite3_str_appendf(tls, bp+8 /* &str */, zFormat, libc.VaList(bp, bp+32 /* &x */))
n = int32((*StrAccum)(unsafe.Pointer(bp + 8 /* &str */)).FnChar)
@@ -100457,7 +101898,7 @@ func printfFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* s
// If p1 is negative, then we begin abs(p1) from the end of x[].
//
// If p2 is negative, return the p2 characters preceding p1.
-func substrFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:119613:13: */
+func substrFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:120468:13: */
var z uintptr
var z2 uintptr
var len int32
@@ -100466,8 +101907,8 @@ func substrFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* s
var p2 I64
var negP2 int32 = 0
- if (Xsqlite3_value_type(tls, *(*uintptr)(unsafe.Pointer(argv + 1*4))) == SQLITE_NULL) ||
- ((argc == 3) && (Xsqlite3_value_type(tls, *(*uintptr)(unsafe.Pointer(argv + 2*4))) == SQLITE_NULL)) {
+ if Xsqlite3_value_type(tls, *(*uintptr)(unsafe.Pointer(argv + 1*4))) == SQLITE_NULL ||
+ argc == 3 && Xsqlite3_value_type(tls, *(*uintptr)(unsafe.Pointer(argv + 2*4))) == SQLITE_NULL {
return
}
p0type = Xsqlite3_value_type(tls, *(*uintptr)(unsafe.Pointer(argv)))
@@ -100488,8 +101929,8 @@ func substrFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* s
if p1 < int64(0) {
for z2 = z; *(*uint8)(unsafe.Pointer(z2)) != 0; len++ {
{
- if (int32(*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&z2, 1))))) >= 0xc0 {
- for (int32(*(*uint8)(unsafe.Pointer(z2))) & 0xc0) == 0x80 {
+ if int32(*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&z2, 1)))) >= 0xc0 {
+ for int32(*(*uint8)(unsafe.Pointer(z2)))&0xc0 == 0x80 {
z2++
}
}
@@ -100505,12 +101946,12 @@ func substrFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* s
negP2 = 1
}
} else {
- p2 = I64(*(*int32)(unsafe.Pointer((Xsqlite3_context_db_handle(tls, context) + 112 /* &.aLimit */))))
+ p2 = I64(*(*int32)(unsafe.Pointer(Xsqlite3_context_db_handle(tls, context) + 120)))
}
if p1 < int64(0) {
- p1 = p1 + (I64(len))
+ p1 = p1 + I64(len)
if p1 < int64(0) {
- p2 = p2 + (p1)
+ p2 = p2 + p1
if p2 < int64(0) {
p2 = int64(0)
}
@@ -100522,18 +101963,18 @@ func substrFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* s
p2--
}
if negP2 != 0 {
- p1 = p1 - (p2)
+ p1 = p1 - p2
if p1 < int64(0) {
- p2 = p2 + (p1)
+ p2 = p2 + p1
p1 = int64(0)
}
}
if p0type != SQLITE_BLOB {
- for (*(*uint8)(unsafe.Pointer(z)) != 0) && (p1 != 0) {
+ for *(*uint8)(unsafe.Pointer(z)) != 0 && p1 != 0 {
{
- if (int32(*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&z, 1))))) >= 0xc0 {
- for (int32(*(*uint8)(unsafe.Pointer(z))) & 0xc0) == 0x80 {
+ if int32(*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&z, 1)))) >= 0xc0 {
+ for int32(*(*uint8)(unsafe.Pointer(z)))&0xc0 == 0x80 {
z++
}
}
@@ -100541,31 +101982,31 @@ func substrFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* s
p1--
}
- for z2 = z; (*(*uint8)(unsafe.Pointer(z2)) != 0) && (p2 != 0); p2-- {
+ for z2 = z; *(*uint8)(unsafe.Pointer(z2)) != 0 && p2 != 0; p2-- {
{
- if (int32(*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&z2, 1))))) >= 0xc0 {
- for (int32(*(*uint8)(unsafe.Pointer(z2))) & 0xc0) == 0x80 {
+ if int32(*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&z2, 1)))) >= 0xc0 {
+ for int32(*(*uint8)(unsafe.Pointer(z2)))&0xc0 == 0x80 {
z2++
}
}
}
}
- Xsqlite3_result_text64(tls, context, z, (uint64((int32(z2) - int32(z)) / 1)), libc.UintptrFromInt32(-1),
+ Xsqlite3_result_text64(tls, context, z, uint64((int32(z2)-int32(z))/1), libc.UintptrFromInt32(-1),
uint8(SQLITE_UTF8))
} else {
- if (p1 + p2) > I64(len) {
- p2 = (I64(len) - p1)
+ if p1+p2 > I64(len) {
+ p2 = I64(len) - p1
if p2 < int64(0) {
p2 = int64(0)
}
}
- Xsqlite3_result_blob64(tls, context, (z + uintptr(p1)), U64(p2), libc.UintptrFromInt32(-1))
+ Xsqlite3_result_blob64(tls, context, z+uintptr(p1), U64(p2), libc.UintptrFromInt32(-1))
}
}
// Implementation of the round() function
-func roundFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:119708:13: */
+func roundFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:120563:13: */
bp := tls.Alloc(24)
defer tls.Free(24)
@@ -100593,17 +102034,17 @@ func roundFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sq
// If Y==0 and X will fit in a 64-bit int,
// handle the rounding directly,
// otherwise use printf.
- if (*(*float64)(unsafe.Pointer(bp + 16 /* r */)) < -4503599627370496.0) || (*(*float64)(unsafe.Pointer(bp + 16 /* r */)) > +4503599627370496.0) {
+ if *(*float64)(unsafe.Pointer(bp + 16)) < -4503599627370496.0 || *(*float64)(unsafe.Pointer(bp + 16)) > +4503599627370496.0 {
// The value has no fractional part so there is nothing to round
} else if n == 0 {
- *(*float64)(unsafe.Pointer(bp + 16 /* r */)) = float64((libc.Int64FromFloat64(*(*float64)(unsafe.Pointer(bp + 16 /* r */)) + (func() float64 {
- if *(*float64)(unsafe.Pointer(bp + 16 /* r */)) < float64(0) {
+ *(*float64)(unsafe.Pointer(bp + 16 /* r */)) = float64(libc.Int64FromFloat64(*(*float64)(unsafe.Pointer(bp + 16)) + func() float64 {
+ if *(*float64)(unsafe.Pointer(bp + 16)) < float64(0) {
return -0.5
}
return +0.5
- }()))))
+ }()))
} else {
- zBuf = Xsqlite3_mprintf(tls, ts+13550 /* "%.*f" */, libc.VaList(bp, n, *(*float64)(unsafe.Pointer(bp + 16 /* r */))))
+ zBuf = Xsqlite3_mprintf(tls, ts+14723 /* "%.*f" */, libc.VaList(bp, n, *(*float64)(unsafe.Pointer(bp + 16 /* r */))))
if zBuf == uintptr(0) {
Xsqlite3_result_error_nomem(tls, context)
return
@@ -100619,11 +102060,11 @@ func roundFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sq
// the database handle that malloc() has failed and return NULL.
// If nByte is larger than the maximum string or blob length, then
// raise an SQLITE_TOOBIG exception and return NULL.
-func contextMalloc(tls *libc.TLS, context uintptr, nByte I64) uintptr { /* sqlite3.c:119749:13: */
+func contextMalloc(tls *libc.TLS, context uintptr, nByte I64) uintptr { /* sqlite3.c:120604:13: */
var z uintptr
var db uintptr = Xsqlite3_context_db_handle(tls, context)
- if nByte > I64(*(*int32)(unsafe.Pointer((db + 112 /* &.aLimit */)))) {
+ if nByte > I64(*(*int32)(unsafe.Pointer(db + 120))) {
Xsqlite3_result_error_toobig(tls, context)
z = uintptr(0)
} else {
@@ -100636,7 +102077,7 @@ func contextMalloc(tls *libc.TLS, context uintptr, nByte I64) uintptr { /* sqlit
}
// Implementation of the upper() and lower() SQL functions.
-func upperFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:119770:13: */
+func upperFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:120625:13: */
var z1 uintptr
var z2 uintptr
var i int32
@@ -100647,17 +102088,17 @@ func upperFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sq
// Verify that the call to _bytes() does not invalidate the _text() pointer
if z2 != 0 {
- z1 = contextMalloc(tls, context, ((I64(n)) + int64(1)))
+ z1 = contextMalloc(tls, context, I64(n)+int64(1))
if z1 != 0 {
for i = 0; i < n; i++ {
- *(*uint8)(unsafe.Pointer(z1 + uintptr(i))) = (uint8((int32(*(*uint8)(unsafe.Pointer(z2 + uintptr(i))))) & ^(int32(Xsqlite3CtypeMap[uint8(*(*uint8)(unsafe.Pointer(z2 + uintptr(i))))]) & 0x20)))
+ *(*uint8)(unsafe.Pointer(z1 + uintptr(i))) = uint8(int32(*(*uint8)(unsafe.Pointer(z2 + uintptr(i)))) & ^(int32(Xsqlite3CtypeMap[uint8(*(*uint8)(unsafe.Pointer(z2 + uintptr(i))))]) & 0x20))
}
Xsqlite3_result_text(tls, context, z1, n, *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{Xsqlite3_free})))
}
}
}
-func lowerFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:119789:13: */
+func lowerFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:120644:13: */
var z1 uintptr
var z2 uintptr
var i int32
@@ -100668,7 +102109,7 @@ func lowerFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sq
// Verify that the call to _bytes() does not invalidate the _text() pointer
if z2 != 0 {
- z1 = contextMalloc(tls, context, ((I64(n)) + int64(1)))
+ z1 = contextMalloc(tls, context, I64(n)+int64(1))
if z1 != 0 {
for i = 0; i < n; i++ {
*(*uint8)(unsafe.Pointer(z1 + uintptr(i))) = uint8(Xsqlite3UpperToLower[uint8(*(*uint8)(unsafe.Pointer(z2 + uintptr(i))))])
@@ -100686,7 +102127,7 @@ func lowerFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sq
// is. We might as well use the "version()" function as a substitute.
// Implementation of random(). Return a random integer.
-func randomFunc(tls *libc.TLS, context uintptr, NotUsed int32, NotUsed2 uintptr) { /* sqlite3.c:119822:13: */
+func randomFunc(tls *libc.TLS, context uintptr, NotUsed int32, NotUsed2 uintptr) { /* sqlite3.c:120677:13: */
bp := tls.Alloc(8)
defer tls.Free(8)
@@ -100695,7 +102136,7 @@ func randomFunc(tls *libc.TLS, context uintptr, NotUsed int32, NotUsed2 uintptr)
_ = NotUsed
_ = NotUsed2
Xsqlite3_randomness(tls, int32(unsafe.Sizeof(Sqlite_int64(0))), bp /* &r */)
- if *(*Sqlite_int64)(unsafe.Pointer(bp /* r */)) < int64(0) {
+ if *(*Sqlite_int64)(unsafe.Pointer(bp)) < int64(0) {
// We need to prevent a random number of 0x8000000000000000
// (or -9223372036854775808) since when you do abs() of that
// number of you get the same value back again. To do this
@@ -100703,14 +102144,14 @@ func randomFunc(tls *libc.TLS, context uintptr, NotUsed int32, NotUsed2 uintptr)
// values, resulting in a positive value. Then take the
// 2s complement of that positive value. The end result can
// therefore be no less than -9223372036854775807.
- *(*Sqlite_int64)(unsafe.Pointer(bp /* r */)) = -(*(*Sqlite_int64)(unsafe.Pointer(bp /* r */)) & (int64(0xffffffff) | (I64((int64(0x7fffffff))) << 32)))
+ *(*Sqlite_int64)(unsafe.Pointer(bp /* r */)) = -(*(*Sqlite_int64)(unsafe.Pointer(bp)) & (int64(0xffffffff) | I64(int64(0x7fffffff))<<32))
}
Xsqlite3_result_int64(tls, context, *(*Sqlite_int64)(unsafe.Pointer(bp /* r */)))
}
// Implementation of randomblob(N). Return a random blob
// that is N bytes long.
-func randomBlob(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:119848:13: */
+func randomBlob(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:120703:13: */
var n Sqlite3_int64
var p uintptr
@@ -100728,7 +102169,7 @@ func randomBlob(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* s
// Implementation of the last_insert_rowid() SQL function. The return
// value is the same as the sqlite3_last_insert_rowid() API function.
-func last_insert_rowid(tls *libc.TLS, context uintptr, NotUsed int32, NotUsed2 uintptr) { /* sqlite3.c:119872:13: */
+func last_insert_rowid(tls *libc.TLS, context uintptr, NotUsed int32, NotUsed2 uintptr) { /* sqlite3.c:120727:13: */
var db uintptr = Xsqlite3_context_db_handle(tls, context)
_ = NotUsed
_ = NotUsed2
@@ -100740,25 +102181,25 @@ func last_insert_rowid(tls *libc.TLS, context uintptr, NotUsed int32, NotUsed2 u
// Implementation of the changes() SQL function.
//
-// IMP: R-62073-11209 The changes() SQL function is a wrapper
-// around the sqlite3_changes() C/C++ function and hence follows the same
-// rules for counting changes.
-func changes(tls *libc.TLS, context uintptr, NotUsed int32, NotUsed2 uintptr) { /* sqlite3.c:119892:13: */
+// IMP: R-32760-32347 The changes() SQL function is a wrapper
+// around the sqlite3_changes64() C/C++ function and hence follows the
+// same rules for counting changes.
+func changes(tls *libc.TLS, context uintptr, NotUsed int32, NotUsed2 uintptr) { /* sqlite3.c:120747:13: */
var db uintptr = Xsqlite3_context_db_handle(tls, context)
_ = NotUsed
_ = NotUsed2
- Xsqlite3_result_int(tls, context, Xsqlite3_changes(tls, db))
+ Xsqlite3_result_int64(tls, context, Xsqlite3_changes64(tls, db))
}
// Implementation of the total_changes() SQL function. The return value is
-// the same as the sqlite3_total_changes() API function.
-func total_changes(tls *libc.TLS, context uintptr, NotUsed int32, NotUsed2 uintptr) { /* sqlite3.c:119906:13: */
+// the same as the sqlite3_total_changes64() API function.
+func total_changes(tls *libc.TLS, context uintptr, NotUsed int32, NotUsed2 uintptr) { /* sqlite3.c:120761:13: */
var db uintptr = Xsqlite3_context_db_handle(tls, context)
_ = NotUsed
_ = NotUsed2
- // IMP: R-52756-41993 This function is a wrapper around the
- // sqlite3_total_changes() C/C++ interface.
- Xsqlite3_result_int(tls, context, Xsqlite3_total_changes(tls, db))
+ // IMP: R-11217-42568 This function is a wrapper around the
+ // sqlite3_total_changes64() C/C++ interface.
+ Xsqlite3_result_int64(tls, context, Xsqlite3_total_changes64(tls, db))
}
// A structure defining how to do GLOB-style comparisons.
@@ -100767,20 +102208,20 @@ type compareInfo = struct {
FmatchOne U8
FmatchSet U8
FnoCase U8
-} /* sqlite3.c:119921:1 */
+} /* sqlite3.c:120776:1 */
// For LIKE and GLOB matching on EBCDIC machines, assume that every
// character is exactly one byte in size. Also, provde the Utf8Read()
// macro for fast reading of the next character in the common case where
// the next character is ASCII.
-var globInfo = compareInfo{FmatchAll: U8('*'), FmatchOne: U8('?'), FmatchSet: U8('[')} /* sqlite3.c:119941:33 */
+var globInfo = compareInfo{FmatchAll: U8('*'), FmatchOne: U8('?'), FmatchSet: U8('[')} /* sqlite3.c:120796:33 */
// The correct SQL-92 behavior is for the LIKE operator to ignore
// case. Thus 'a' LIKE 'A' would be true.
-var likeInfoNorm = compareInfo{FmatchAll: U8('%'), FmatchOne: U8('_'), FnoCase: U8(1)} /* sqlite3.c:119944:33 */
+var likeInfoNorm = compareInfo{FmatchAll: U8('%'), FmatchOne: U8('_'), FnoCase: U8(1)} /* sqlite3.c:120799:33 */
// If SQLITE_CASE_SENSITIVE_LIKE is defined, then the LIKE operator
// is case sensitive causing 'a' LIKE 'A' to be false
-var likeInfoAlt = compareInfo{FmatchAll: U8('%'), FmatchOne: U8('_')} /* sqlite3.c:119947:33 */
+var likeInfoAlt = compareInfo{FmatchAll: U8('%'), FmatchOne: U8('_')} /* sqlite3.c:120802:33 */
// Possible error returns from patternMatch()
@@ -100820,7 +102261,7 @@ var likeInfoAlt = compareInfo{FmatchAll: U8('%'), FmatchOne: U8('_')} /* sqlite3
// The comments within this routine usually assume glob matching.
//
// This routine is usually quick, but can be N**2 in the worst case.
-func patternCompare(tls *libc.TLS, zPattern uintptr, zString uintptr, pInfo uintptr, matchOther U32) int32 { /* sqlite3.c:119994:12: */
+func patternCompare(tls *libc.TLS, zPattern uintptr, zString uintptr, pInfo uintptr, matchOther U32) int32 { /* sqlite3.c:120849:12: */
bp := tls.Alloc(11)
defer tls.Free(11)
*(*uintptr)(unsafe.Pointer(bp)) = zPattern
@@ -100833,24 +102274,24 @@ func patternCompare(tls *libc.TLS, zPattern uintptr, zString uintptr, pInfo uint
var noCase U8 = (*compareInfo)(unsafe.Pointer(pInfo)).FnoCase // True if uppercase==lowercase
var zEscaped uintptr = uintptr(0) // One past the last escaped input char
- for (libc.AssignUint32(&c, func() uint32 {
- if int32(*(*U8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* zPattern */))))) < 0x80 {
- return uint32(*(*U8)(unsafe.Pointer(libc.PostIncUintptr(&*(*uintptr)(unsafe.Pointer(bp /* zPattern */)), 1))))
+ for libc.AssignUint32(&c, func() uint32 {
+ if int32(*(*U8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp))))) < 0x80 {
+ return uint32(*(*U8)(unsafe.Pointer(libc.PostIncUintptr(&*(*uintptr)(unsafe.Pointer(bp)), 1))))
}
- return Xsqlite3Utf8Read(tls, bp /* &zPattern */)
- }())) != U32(0) {
+ return Xsqlite3Utf8Read(tls, bp)
+ }()) != U32(0) {
if c == matchAll { // Match "*"
// Skip over multiple "*" characters in the pattern. If there
// are also "?" characters, skip those as well, but consume a
// single character of the input string for each "?" skipped
- for ((libc.AssignUint32(&c, func() uint32 {
- if int32(*(*U8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* zPattern */))))) < 0x80 {
- return uint32(*(*U8)(unsafe.Pointer(libc.PostIncUintptr(&*(*uintptr)(unsafe.Pointer(bp /* zPattern */)), 1))))
- }
- return Xsqlite3Utf8Read(tls, bp /* &zPattern */)
- }())) == matchAll) ||
- ((c == matchOne) && (matchOne != U32(0))) {
- if (c == matchOne) && (Xsqlite3Utf8Read(tls, bp+4 /* &zString */) == U32(0)) {
+ for libc.AssignUint32(&c, func() uint32 {
+ if int32(*(*U8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp))))) < 0x80 {
+ return uint32(*(*U8)(unsafe.Pointer(libc.PostIncUintptr(&*(*uintptr)(unsafe.Pointer(bp)), 1))))
+ }
+ return Xsqlite3Utf8Read(tls, bp)
+ }()) == matchAll ||
+ c == matchOne && matchOne != U32(0) {
+ if c == matchOne && Xsqlite3Utf8Read(tls, bp+4) == U32(0) {
return SQLITE_NOWILDCARDMATCH
}
}
@@ -100866,14 +102307,14 @@ func patternCompare(tls *libc.TLS, zPattern uintptr, zString uintptr, pInfo uint
// "[...]" immediately follows the "*". We have to do a slow
// recursive search in this case, but it is an unusual case.
// '[' is a single-byte character
- for *(*U8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 4 /* zString */)))) != 0 {
- var bMatch int32 = patternCompare(tls, (*(*uintptr)(unsafe.Pointer(bp /* zPattern */)) + libc.UintptrFromInt32(-1)), *(*uintptr)(unsafe.Pointer(bp + 4 /* zString */)), pInfo, matchOther)
+ for *(*U8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 4)))) != 0 {
+ var bMatch int32 = patternCompare(tls, *(*uintptr)(unsafe.Pointer(bp))+libc.UintptrFromInt32(-1), *(*uintptr)(unsafe.Pointer(bp + 4 /* zString */)), pInfo, matchOther)
if bMatch != SQLITE_NOMATCH {
return bMatch
}
{
- if (int32(*(*U8)(unsafe.Pointer(libc.PostIncUintptr(&*(*uintptr)(unsafe.Pointer(bp + 4 /* zString */)), 1))))) >= 0xc0 {
- for (int32(*(*U8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 4 /* zString */))))) & 0xc0) == 0x80 {
+ if int32(*(*U8)(unsafe.Pointer(libc.PostIncUintptr(&*(*uintptr)(unsafe.Pointer(bp + 4)), 1)))) >= 0xc0 {
+ for int32(*(*U8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 4)))))&0xc0 == 0x80 {
*(*uintptr)(unsafe.Pointer(bp + 4 /* zString */))++
}
}
@@ -100897,7 +102338,7 @@ func patternCompare(tls *libc.TLS, zPattern uintptr, zString uintptr, pInfo uint
var bMatch int32
if noCase != 0 {
- *(*uint8)(unsafe.Pointer(bp + 8 /* &zStop[0] */)) = (uint8((c) & U32(^(int32(Xsqlite3CtypeMap[uint8(c)]) & 0x20))))
+ *(*uint8)(unsafe.Pointer(bp + 8 /* &zStop[0] */)) = uint8(c & U32(^(int32(Xsqlite3CtypeMap[uint8(c)]) & 0x20)))
*(*uint8)(unsafe.Pointer(bp + 8 /* &zStop[0] */ + 1)) = uint8(Xsqlite3UpperToLower[uint8(c)])
*(*uint8)(unsafe.Pointer(bp + 8 /* &zStop[0] */ + 2)) = uint8(0)
} else {
@@ -100906,7 +102347,7 @@ func patternCompare(tls *libc.TLS, zPattern uintptr, zString uintptr, pInfo uint
}
for 1 != 0 {
*(*uintptr)(unsafe.Pointer(bp + 4 /* zString */)) += uintptr(libc.Xstrcspn(tls, *(*uintptr)(unsafe.Pointer(bp + 4 /* zString */)), bp+8 /* &zStop[0] */))
- if int32(*(*U8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 4 /* zString */))))) == 0 {
+ if int32(*(*U8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 4))))) == 0 {
break
}
*(*uintptr)(unsafe.Pointer(bp + 4 /* zString */))++
@@ -100917,12 +102358,12 @@ func patternCompare(tls *libc.TLS, zPattern uintptr, zString uintptr, pInfo uint
}
} else {
var bMatch int32
- for (libc.AssignUint32(&c2, func() uint32 {
- if int32(*(*U8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 4 /* zString */))))) < 0x80 {
- return uint32(*(*U8)(unsafe.Pointer(libc.PostIncUintptr(&*(*uintptr)(unsafe.Pointer(bp + 4 /* zString */)), 1))))
+ for libc.AssignUint32(&c2, func() uint32 {
+ if int32(*(*U8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 4))))) < 0x80 {
+ return uint32(*(*U8)(unsafe.Pointer(libc.PostIncUintptr(&*(*uintptr)(unsafe.Pointer(bp + 4)), 1))))
}
- return Xsqlite3Utf8Read(tls, bp+4 /* &zString */)
- }())) != U32(0) {
+ return Xsqlite3Utf8Read(tls, bp+4)
+ }()) != U32(0) {
if c2 != c {
continue
}
@@ -100960,10 +102401,10 @@ func patternCompare(tls *libc.TLS, zPattern uintptr, zString uintptr, pInfo uint
}
c2 = Xsqlite3Utf8Read(tls, bp /* &zPattern */)
}
- for (c2 != 0) && (c2 != U32(']')) {
- if (((c2 == U32('-')) && (int32(*(*U8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* zPattern */))))) != ']')) && (int32(*(*U8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* zPattern */))))) != 0)) && (prior_c > U32(0)) {
+ for c2 != 0 && c2 != U32(']') {
+ if c2 == U32('-') && int32(*(*U8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp))))) != ']' && int32(*(*U8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp))))) != 0 && prior_c > U32(0) {
c2 = Xsqlite3Utf8Read(tls, bp /* &zPattern */)
- if (c >= prior_c) && (c <= c2) {
+ if c >= prior_c && c <= c2 {
seen = 1
}
prior_c = U32(0)
@@ -100975,30 +102416,30 @@ func patternCompare(tls *libc.TLS, zPattern uintptr, zString uintptr, pInfo uint
}
c2 = Xsqlite3Utf8Read(tls, bp /* &zPattern */)
}
- if (c2 == U32(0)) || ((seen ^ invert) == 0) {
+ if c2 == U32(0) || seen^invert == 0 {
return SQLITE_NOMATCH
}
continue
}
}
c2 = func() uint32 {
- if int32(*(*U8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 4 /* zString */))))) < 0x80 {
- return uint32(*(*U8)(unsafe.Pointer(libc.PostIncUintptr(&*(*uintptr)(unsafe.Pointer(bp + 4 /* zString */)), 1))))
+ if int32(*(*U8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 4))))) < 0x80 {
+ return uint32(*(*U8)(unsafe.Pointer(libc.PostIncUintptr(&*(*uintptr)(unsafe.Pointer(bp + 4)), 1))))
}
- return Xsqlite3Utf8Read(tls, bp+4 /* &zString */)
+ return Xsqlite3Utf8Read(tls, bp+4)
}()
if c == c2 {
continue
}
- if (((noCase != 0) && ((int32(Xsqlite3UpperToLower[uint8(c)])) == (int32(Xsqlite3UpperToLower[uint8(c2)])))) && (c < U32(0x80))) && (c2 < U32(0x80)) {
+ if noCase != 0 && int32(Xsqlite3UpperToLower[uint8(c)]) == int32(Xsqlite3UpperToLower[uint8(c2)]) && c < U32(0x80) && c2 < U32(0x80) {
continue
}
- if ((c == matchOne) && (*(*uintptr)(unsafe.Pointer(bp /* zPattern */)) != zEscaped)) && (c2 != U32(0)) {
+ if c == matchOne && *(*uintptr)(unsafe.Pointer(bp)) != zEscaped && c2 != U32(0) {
continue
}
return SQLITE_NOMATCH
}
- if int32(*(*U8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 4 /* zString */))))) == 0 {
+ if int32(*(*U8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 4))))) == 0 {
return SQLITE_MATCH
}
return SQLITE_NOMATCH
@@ -101006,13 +102447,13 @@ func patternCompare(tls *libc.TLS, zPattern uintptr, zString uintptr, pInfo uint
// The sqlite3_strglob() interface. Return 0 on a match (like strcmp()) and
// non-zero if there is no match.
-func Xsqlite3_strglob(tls *libc.TLS, zGlobPattern uintptr, zString uintptr) int32 { /* sqlite3.c:120127:16: */
+func Xsqlite3_strglob(tls *libc.TLS, zGlobPattern uintptr, zString uintptr) int32 { /* sqlite3.c:120982:16: */
return patternCompare(tls, zGlobPattern, zString, uintptr(unsafe.Pointer(&globInfo)), uint32('['))
}
// The sqlite3_strlike() interface. Return 0 on a match and non-zero for
// a miss - like strcmp().
-func Xsqlite3_strlike(tls *libc.TLS, zPattern uintptr, zStr uintptr, esc uint32) int32 { /* sqlite3.c:120135:16: */
+func Xsqlite3_strlike(tls *libc.TLS, zPattern uintptr, zStr uintptr, esc uint32) int32 { /* sqlite3.c:120990:16: */
return patternCompare(tls, zPattern, zStr, uintptr(unsafe.Pointer(&likeInfoNorm)), esc)
}
@@ -101030,7 +102471,7 @@ func Xsqlite3_strlike(tls *libc.TLS, zPattern uintptr, zStr uintptr, esc uint32)
//
// This same function (with a different compareInfo structure) computes
// the GLOB operator.
-func likeFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:120161:13: */
+func likeFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:121016:13: */
bp := tls.Alloc(8)
defer tls.Free(8)
@@ -101042,8 +102483,8 @@ func likeFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sql
var pInfo uintptr = Xsqlite3_user_data(tls, context)
// var backupInfo compareInfo at bp+4, 4
- if (Xsqlite3_value_type(tls, *(*uintptr)(unsafe.Pointer(argv))) == SQLITE_BLOB) ||
- (Xsqlite3_value_type(tls, *(*uintptr)(unsafe.Pointer(argv + 1*4))) == SQLITE_BLOB) {
+ if Xsqlite3_value_type(tls, *(*uintptr)(unsafe.Pointer(argv))) == SQLITE_BLOB ||
+ Xsqlite3_value_type(tls, *(*uintptr)(unsafe.Pointer(argv + 1*4))) == SQLITE_BLOB {
Xsqlite3_result_int(tls, context, 0)
return
}
@@ -101052,24 +102493,24 @@ func likeFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sql
// of deep recursion and N*N behavior in patternCompare().
nPat = Xsqlite3_value_bytes(tls, *(*uintptr)(unsafe.Pointer(argv)))
- if nPat > *(*int32)(unsafe.Pointer((db + 112 /* &.aLimit */) + 8*4)) {
- Xsqlite3_result_error(tls, context, ts+13555 /* "LIKE or GLOB pat..." */, -1)
+ if nPat > *(*int32)(unsafe.Pointer(db + 120 + 8*4)) {
+ Xsqlite3_result_error(tls, context, ts+14728 /* "LIKE or GLOB pat..." */, -1)
return
}
if argc == 3 {
// The escape character string must consist of a single UTF-8 character.
// Otherwise, return an error.
*(*uintptr)(unsafe.Pointer(bp /* zEsc */)) = Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv + 2*4)))
- if *(*uintptr)(unsafe.Pointer(bp /* zEsc */)) == uintptr(0) {
+ if *(*uintptr)(unsafe.Pointer(bp)) == uintptr(0) {
return
}
- if Xsqlite3Utf8CharLen(tls, *(*uintptr)(unsafe.Pointer(bp /* zEsc */)), -1) != 1 {
+ if Xsqlite3Utf8CharLen(tls, *(*uintptr)(unsafe.Pointer(bp)), -1) != 1 {
Xsqlite3_result_error(tls, context,
- ts+13588 /* "ESCAPE expressio..." */, -1)
+ ts+14761 /* "ESCAPE expressio..." */, -1)
return
}
escape = Xsqlite3Utf8Read(tls, bp /* &zEsc */)
- if (escape == U32((*compareInfo)(unsafe.Pointer(pInfo)).FmatchAll)) || (escape == U32((*compareInfo)(unsafe.Pointer(pInfo)).FmatchOne)) {
+ if escape == U32((*compareInfo)(unsafe.Pointer(pInfo)).FmatchAll) || escape == U32((*compareInfo)(unsafe.Pointer(pInfo)).FmatchOne) {
libc.Xmemcpy(tls, bp+4 /* &backupInfo */, pInfo, uint32(unsafe.Sizeof(compareInfo{})))
pInfo = bp + 4 /* &backupInfo */
if escape == U32((*compareInfo)(unsafe.Pointer(pInfo)).FmatchAll) {
@@ -101084,16 +102525,16 @@ func likeFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sql
}
zB = Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv)))
zA = Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv + 1*4)))
- if (zA != 0) && (zB != 0) {
+ if zA != 0 && zB != 0 {
Xsqlite3_result_int(tls, context,
- (libc.Bool32(patternCompare(tls, zB, zA, pInfo, escape) == SQLITE_MATCH)))
+ libc.Bool32(patternCompare(tls, zB, zA, pInfo, escape) == SQLITE_MATCH))
}
}
// Implementation of the NULLIF(x,y) function. The result is the first
// argument if the arguments are different. The result is NULL if the
// arguments are equal to each other.
-func nullifFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintptr) { /* sqlite3.c:120232:13: */
+func nullifFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintptr) { /* sqlite3.c:121087:13: */
var pColl uintptr = sqlite3GetFuncCollSeq(tls, context)
_ = NotUsed
if Xsqlite3MemCompare(tls, *(*uintptr)(unsafe.Pointer(argv)), *(*uintptr)(unsafe.Pointer(argv + 1*4)), pColl) != 0 {
@@ -101103,7 +102544,7 @@ func nullifFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintptr) { /
// Implementation of the sqlite_version() function. The result is the version
// of the SQLite library that is running.
-func versionFunc(tls *libc.TLS, context uintptr, NotUsed int32, NotUsed2 uintptr) { /* sqlite3.c:120248:13: */
+func versionFunc(tls *libc.TLS, context uintptr, NotUsed int32, NotUsed2 uintptr) { /* sqlite3.c:121103:13: */
_ = NotUsed
_ = NotUsed2
// IMP: R-48699-48617 This function is an SQL wrapper around the
@@ -101114,7 +102555,7 @@ func versionFunc(tls *libc.TLS, context uintptr, NotUsed int32, NotUsed2 uintptr
// Implementation of the sqlite_source_id() function. The result is a string
// that identifies the particular version of the source code used to build
// SQLite.
-func sourceidFunc(tls *libc.TLS, context uintptr, NotUsed int32, NotUsed2 uintptr) { /* sqlite3.c:120264:13: */
+func sourceidFunc(tls *libc.TLS, context uintptr, NotUsed int32, NotUsed2 uintptr) { /* sqlite3.c:121119:13: */
_ = NotUsed
_ = NotUsed2
// IMP: R-24470-31136 This function is an SQL wrapper around the
@@ -101125,26 +102566,26 @@ func sourceidFunc(tls *libc.TLS, context uintptr, NotUsed int32, NotUsed2 uintpt
// Implementation of the sqlite_log() function. This is a wrapper around
// sqlite3_log(). The return value is NULL. The function exists purely for
// its side-effects.
-func errlogFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:120280:13: */
+func errlogFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:121135:13: */
bp := tls.Alloc(8)
defer tls.Free(8)
_ = argc
_ = context
- Xsqlite3_log(tls, Xsqlite3_value_int(tls, *(*uintptr)(unsafe.Pointer(argv))), ts+2790 /* "%s" */, libc.VaList(bp, Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv + 1*4)))))
+ Xsqlite3_log(tls, Xsqlite3_value_int(tls, *(*uintptr)(unsafe.Pointer(argv))), ts+3601 /* "%s" */, libc.VaList(bp, Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv + 1*4)))))
}
// Implementation of the sqlite_compileoption_used() function.
// The result is an integer that identifies if the compiler option
// was used to build SQLite.
-func compileoptionusedFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:120296:13: */
+func compileoptionusedFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:121151:13: */
var zOptName uintptr
_ = argc
// IMP: R-39564-36305 The sqlite_compileoption_used() SQL
// function is a wrapper around the sqlite3_compileoption_used() C/C++
// function.
- if (libc.AssignUintptr(&zOptName, Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv))))) != uintptr(0) {
+ if libc.AssignUintptr(&zOptName, Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv)))) != uintptr(0) {
Xsqlite3_result_int(tls, context, Xsqlite3_compileoption_used(tls, zOptName))
}
}
@@ -101152,7 +102593,7 @@ func compileoptionusedFunc(tls *libc.TLS, context uintptr, argc int32, argv uint
// Implementation of the sqlite_compileoption_get() function.
// The result is a string that identifies the compiler options
// used to build SQLite.
-func compileoptiongetFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:120320:13: */
+func compileoptiongetFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:121175:13: */
var n int32
_ = argc
@@ -101167,14 +102608,14 @@ func compileoptiongetFunc(tls *libc.TLS, context uintptr, argc int32, argv uintp
var hexdigits = [16]uint8{
uint8('0'), uint8('1'), uint8('2'), uint8('3'), uint8('4'), uint8('5'), uint8('6'), uint8('7'),
uint8('8'), uint8('9'), uint8('A'), uint8('B'), uint8('C'), uint8('D'), uint8('E'), uint8('F'),
-} /* sqlite3.c:120338:19 */
+} /* sqlite3.c:121193:19 */
// Implementation of the QUOTE() function. This function takes a single
// argument. If the argument is numeric, the return value is the same as
// the argument. If the argument is NULL, the return value is the string
// "NULL". Otherwise, the argument is enclosed in single quotes with
// single-quote escapes.
-func quoteFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:120350:13: */
+func quoteFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:121205:13: */
bp := tls.Alloc(80)
defer tls.Free(80)
@@ -101188,10 +102629,10 @@ func quoteFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sq
// var zBuf [50]uint8 at bp+16, 50
r1 = Xsqlite3_value_double(tls, *(*uintptr)(unsafe.Pointer(argv)))
- Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([50]uint8{})), bp+16 /* &zBuf[0] */, ts+4034 /* "%!.15g" */, libc.VaList(bp, r1))
+ Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([50]uint8{})), bp+16 /* &zBuf[0] */, ts+4845 /* "%!.15g" */, libc.VaList(bp, r1))
Xsqlite3AtoF(tls, bp+16 /* &zBuf[0] */, bp+72 /* &r2 */, 20, uint8(SQLITE_UTF8))
- if r1 != *(*float64)(unsafe.Pointer(bp + 72 /* r2 */)) {
- Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([50]uint8{})), bp+16 /* &zBuf[0] */, ts+13633 /* "%!.20e" */, libc.VaList(bp+8, r1))
+ if r1 != *(*float64)(unsafe.Pointer(bp + 72)) {
+ Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([50]uint8{})), bp+16 /* &zBuf[0] */, ts+14806 /* "%!.20e" */, libc.VaList(bp+8, r1))
}
Xsqlite3_result_text(tls, context, bp+16 /* &zBuf[0] */, -1, libc.UintptrFromInt32(-1))
break
@@ -101209,15 +102650,15 @@ func quoteFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sq
var zBlob uintptr = Xsqlite3_value_blob(tls, *(*uintptr)(unsafe.Pointer(argv)))
var nBlob int32 = Xsqlite3_value_bytes(tls, *(*uintptr)(unsafe.Pointer(argv)))
// No encoding change
- zText = contextMalloc(tls, context, ((int64(2) * I64(nBlob)) + int64(4)))
+ zText = contextMalloc(tls, context, int64(2)*I64(nBlob)+int64(4))
if zText != 0 {
var i int32
for i = 0; i < nBlob; i++ {
- *(*uint8)(unsafe.Pointer(zText + uintptr(((i * 2) + 2)))) = hexdigits[((int32(*(*uint8)(unsafe.Pointer(zBlob + uintptr(i)))) >> 4) & 0x0F)]
- *(*uint8)(unsafe.Pointer(zText + uintptr(((i * 2) + 3)))) = hexdigits[((int32(*(*uint8)(unsafe.Pointer(zBlob + uintptr(i))))) & 0x0F)]
+ *(*uint8)(unsafe.Pointer(zText + uintptr(i*2+2))) = hexdigits[int32(*(*uint8)(unsafe.Pointer(zBlob + uintptr(i))))>>4&0x0F]
+ *(*uint8)(unsafe.Pointer(zText + uintptr(i*2+3))) = hexdigits[int32(*(*uint8)(unsafe.Pointer(zBlob + uintptr(i))))&0x0F]
}
- *(*uint8)(unsafe.Pointer(zText + uintptr(((nBlob * 2) + 2)))) = uint8('\'')
- *(*uint8)(unsafe.Pointer(zText + uintptr(((nBlob * 2) + 3)))) = uint8(0)
+ *(*uint8)(unsafe.Pointer(zText + uintptr(nBlob*2+2))) = uint8('\'')
+ *(*uint8)(unsafe.Pointer(zText + uintptr(nBlob*2+3))) = uint8(0)
*(*uint8)(unsafe.Pointer(zText)) = uint8('X')
*(*uint8)(unsafe.Pointer(zText + 1)) = uint8('\'')
Xsqlite3_result_text(tls, context, zText, -1, libc.UintptrFromInt32(-1))
@@ -101244,7 +102685,7 @@ func quoteFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sq
n++
}
}
- z = contextMalloc(tls, context, (((I64(i)) + (I64(n))) + int64(3)))
+ z = contextMalloc(tls, context, I64(i)+I64(n)+int64(3))
if z != 0 {
*(*uint8)(unsafe.Pointer(z)) = uint8('\'')
i = 0
@@ -101265,7 +102706,7 @@ func quoteFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sq
default:
{
- Xsqlite3_result_text(tls, context, ts+756 /* "NULL" */, 4, uintptr(0))
+ Xsqlite3_result_text(tls, context, ts+1544 /* "NULL" */, 4, uintptr(0))
break
}
@@ -101274,13 +102715,13 @@ func quoteFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sq
// The unicode() function. Return the integer unicode code-point value
// for the first character of the input string.
-func unicodeFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:120426:13: */
+func unicodeFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:121281:13: */
bp := tls.Alloc(4)
defer tls.Free(4)
*(*uintptr)(unsafe.Pointer(bp /* z */)) = Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv)))
_ = argc
- if (*(*uintptr)(unsafe.Pointer(bp /* z */)) != 0) && (*(*uint8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* z */)))) != 0) {
+ if *(*uintptr)(unsafe.Pointer(bp)) != 0 && *(*uint8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))) != 0 {
Xsqlite3_result_int(tls, context, int32(Xsqlite3Utf8Read(tls, bp /* &z */)))
}
}
@@ -101288,11 +102729,11 @@ func unicodeFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /*
// The char() function takes zero or more arguments, each of which is
// an integer. It constructs a string where each character of the string
// is the unicode character for the corresponding integer argument.
-func charFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:120441:13: */
+func charFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:121296:13: */
var z uintptr
var zOut uintptr
var i int32
- zOut = libc.AssignUintptr(&z, Xsqlite3_malloc64(tls, (uint64((argc*4)+1))))
+ zOut = libc.AssignUintptr(&z, Xsqlite3_malloc64(tls, uint64(argc*4+1)))
if z == uintptr(0) {
Xsqlite3_result_error_nomem(tls, context)
return
@@ -101301,32 +102742,32 @@ func charFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sql
var x Sqlite3_int64
var c uint32
x = Xsqlite3_value_int64(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*4)))
- if (x < int64(0)) || (x > int64(0x10ffff)) {
+ if x < int64(0) || x > int64(0x10ffff) {
x = int64(0xfffd)
}
- c = (uint32(x & int64(0x1fffff)))
+ c = uint32(x & int64(0x1fffff))
if c < uint32(0x00080) {
- *(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&zOut, 1))) = (U8(c & uint32(0xFF)))
+ *(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&zOut, 1))) = U8(c & uint32(0xFF))
} else if c < uint32(0x00800) {
- *(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&zOut, 1))) = (uint8(0xC0 + int32((U8((c >> 6) & uint32(0x1F))))))
- *(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&zOut, 1))) = (uint8(0x80 + int32((U8(c & uint32(0x3F))))))
+ *(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&zOut, 1))) = uint8(0xC0 + int32(U8(c>>6&uint32(0x1F))))
+ *(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&zOut, 1))) = uint8(0x80 + int32(U8(c&uint32(0x3F))))
} else if c < uint32(0x10000) {
- *(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&zOut, 1))) = (uint8(0xE0 + int32((U8((c >> 12) & uint32(0x0F))))))
- *(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&zOut, 1))) = (uint8(0x80 + int32((U8((c >> 6) & uint32(0x3F))))))
- *(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&zOut, 1))) = (uint8(0x80 + int32((U8(c & uint32(0x3F))))))
+ *(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&zOut, 1))) = uint8(0xE0 + int32(U8(c>>12&uint32(0x0F))))
+ *(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&zOut, 1))) = uint8(0x80 + int32(U8(c>>6&uint32(0x3F))))
+ *(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&zOut, 1))) = uint8(0x80 + int32(U8(c&uint32(0x3F))))
} else {
- *(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&zOut, 1))) = (uint8(0xF0 + int32((U8((c >> 18) & uint32(0x07))))))
- *(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&zOut, 1))) = (uint8(0x80 + int32((U8((c >> 12) & uint32(0x3F))))))
- *(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&zOut, 1))) = (uint8(0x80 + int32((U8((c >> 6) & uint32(0x3F))))))
- *(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&zOut, 1))) = (uint8(0x80 + int32((U8(c & uint32(0x3F))))))
+ *(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&zOut, 1))) = uint8(0xF0 + int32(U8(c>>18&uint32(0x07))))
+ *(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&zOut, 1))) = uint8(0x80 + int32(U8(c>>12&uint32(0x3F))))
+ *(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&zOut, 1))) = uint8(0x80 + int32(U8(c>>6&uint32(0x3F))))
+ *(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&zOut, 1))) = uint8(0x80 + int32(U8(c&uint32(0x3F))))
}
}
- Xsqlite3_result_text64(tls, context, z, (uint64((int32(zOut) - int32(z)) / 1)), *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{Xsqlite3_free})), uint8(SQLITE_UTF8))
+ Xsqlite3_result_text64(tls, context, z, uint64((int32(zOut)-int32(z))/1), *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{Xsqlite3_free})), uint8(SQLITE_UTF8))
}
// The hex() function. Interpret the argument as a blob. Return
// a hexadecimal rendering as text.
-func hexFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:120482:13: */
+func hexFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:121337:13: */
var i int32
var n int32
var pBlob uintptr
@@ -101337,7 +102778,7 @@ func hexFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqli
pBlob = Xsqlite3_value_blob(tls, *(*uintptr)(unsafe.Pointer(argv)))
n = Xsqlite3_value_bytes(tls, *(*uintptr)(unsafe.Pointer(argv)))
// No encoding change
- z = libc.AssignUintptr(&zHex, contextMalloc(tls, context, (((I64(n))*int64(2))+int64(1))))
+ z = libc.AssignUintptr(&zHex, contextMalloc(tls, context, I64(n)*int64(2)+int64(1)))
if zHex != 0 {
i = 0
__1:
@@ -101346,8 +102787,8 @@ func hexFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqli
}
{
var c uint8 = *(*uint8)(unsafe.Pointer(pBlob))
- *(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&z, 1))) = hexdigits[((int32(c) >> 4) & 0xf)]
- *(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&z, 1))) = hexdigits[(int32(c) & 0xf)]
+ *(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&z, 1))) = hexdigits[int32(c)>>4&0xf]
+ *(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&z, 1))) = hexdigits[int32(c)&0xf]
}
goto __2
@@ -101359,12 +102800,12 @@ func hexFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqli
__3:
;
*(*uint8)(unsafe.Pointer(z)) = uint8(0)
- Xsqlite3_result_text(tls, context, zHex, (n * 2), *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{Xsqlite3_free})))
+ Xsqlite3_result_text(tls, context, zHex, n*2, *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{Xsqlite3_free})))
}
}
// The zeroblob(N) function returns a zero-filled blob of size N bytes.
-func zeroblobFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:120510:13: */
+func zeroblobFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:121365:13: */
var n I64
var rc int32
@@ -101383,7 +102824,7 @@ func zeroblobFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /*
// them A, B, and C. The result is also a string which is derived
// from A by replacing every occurrence of B with C. The match
// must be exact. Collating sequences are not used.
-func replaceFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:120533:13: */
+func replaceFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:121388:13: */
var zStr uintptr // The input string A
var zPattern uintptr // The pattern string B
var zRep uintptr // The replacement string C
@@ -101423,33 +102864,33 @@ func replaceFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /*
}
nRep = Xsqlite3_value_bytes(tls, *(*uintptr)(unsafe.Pointer(argv + 2*4)))
- nOut = (I64(nStr + 1))
+ nOut = I64(nStr + 1)
zOut = contextMalloc(tls, context, nOut)
if zOut == uintptr(0) {
return
}
- loopLimit = (nStr - nPattern)
+ loopLimit = nStr - nPattern
cntExpand = uint32(0)
for i = libc.AssignInt32(&j, 0); i <= loopLimit; i++ {
- if (int32(*(*uint8)(unsafe.Pointer(zStr + uintptr(i)))) != int32(*(*uint8)(unsafe.Pointer(zPattern)))) || (libc.Xmemcmp(tls, (zStr+uintptr(i)), zPattern, uint32(nPattern)) != 0) {
+ if int32(*(*uint8)(unsafe.Pointer(zStr + uintptr(i)))) != int32(*(*uint8)(unsafe.Pointer(zPattern))) || libc.Xmemcmp(tls, zStr+uintptr(i), zPattern, uint32(nPattern)) != 0 {
*(*uint8)(unsafe.Pointer(zOut + uintptr(libc.PostIncInt32(&j, 1)))) = *(*uint8)(unsafe.Pointer(zStr + uintptr(i)))
} else {
if nRep > nPattern {
- nOut = nOut + (I64(nRep - nPattern))
+ nOut = nOut + I64(nRep-nPattern)
- if (nOut - int64(1)) > I64(*(*int32)(unsafe.Pointer((db + 112 /* &.aLimit */)))) {
+ if nOut-int64(1) > I64(*(*int32)(unsafe.Pointer(db + 120))) {
Xsqlite3_result_error_toobig(tls, context)
Xsqlite3_free(tls, zOut)
return
}
cntExpand++
- if (cntExpand & (cntExpand - uint32(1))) == uint32(0) {
+ if cntExpand&(cntExpand-uint32(1)) == uint32(0) {
// Grow the size of the output buffer only on substitutions
// whose index is a power of two: 1, 2, 4, 8, 16, 32, ...
var zOld uintptr
zOld = zOut
- zOut = Xsqlite3Realloc(tls, zOut, (uint64(I64(int32(nOut)) + ((nOut - I64(nStr)) - int64(1)))))
+ zOut = Xsqlite3Realloc(tls, zOut, uint64(I64(int32(nOut))+(nOut-I64(nStr)-int64(1))))
if zOut == uintptr(0) {
Xsqlite3_result_error_nomem(tls, context)
Xsqlite3_free(tls, zOld)
@@ -101457,13 +102898,13 @@ func replaceFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /*
}
}
}
- libc.Xmemcpy(tls, (zOut + uintptr(j)), zRep, uint32(nRep))
- j = j + (nRep)
+ libc.Xmemcpy(tls, zOut+uintptr(j), zRep, uint32(nRep))
+ j = j + nRep
i = i + (nPattern - 1)
}
}
- libc.Xmemcpy(tls, (zOut + uintptr(j)), (zStr + uintptr(i)), (uint32(nStr - i)))
+ libc.Xmemcpy(tls, zOut+uintptr(j), zStr+uintptr(i), uint32(nStr-i))
j = j + (nStr - i)
*(*uint8)(unsafe.Pointer(zOut + uintptr(j))) = uint8(0)
@@ -101472,7 +102913,7 @@ func replaceFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /*
// Implementation of the TRIM(), LTRIM(), and RTRIM() functions.
// The userdata is 0x1 for left trim, 0x2 for right trim, 0x3 for both.
-func trimFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:120626:13: */
+func trimFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:121481:13: */
var zIn uintptr // Input string
var zCharSet uintptr // Set of characters to trim
var nIn uint32 // Number of bytes in input
@@ -101496,7 +102937,7 @@ func trimFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sql
aLen = uintptr(uintptr(unsafe.Pointer(&lenOne)))
azChar = uintptr(uintptr(unsafe.Pointer(&azOne)))
zCharSet = uintptr(0)
- } else if (libc.AssignUintptr(&zCharSet, Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv + 1*4))))) == uintptr(0) {
+ } else if libc.AssignUintptr(&zCharSet, Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv + 1*4)))) == uintptr(0) {
return
} else {
var z uintptr
@@ -101504,8 +102945,8 @@ func trimFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sql
nChar = 0
for ; *(*uint8)(unsafe.Pointer(z)) != 0; nChar++ {
{
- if (int32(*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&z, 1))))) >= 0xc0 {
- for (int32(*(*uint8)(unsafe.Pointer(z))) & 0xc0) == 0x80 {
+ if int32(*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&z, 1)))) >= 0xc0 {
+ for int32(*(*uint8)(unsafe.Pointer(z)))&0xc0 == 0x80 {
z++
}
}
@@ -101514,35 +102955,35 @@ func trimFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sql
}
if nChar > 0 {
azChar = contextMalloc(tls, context,
- ((I64(nChar)) * (int64(uint32(unsafe.Sizeof(uintptr(0))) + uint32(unsafe.Sizeof(uint32(0)))))))
+ I64(nChar)*int64(uint32(unsafe.Sizeof(uintptr(0)))+uint32(unsafe.Sizeof(uint32(0)))))
if azChar == uintptr(0) {
return
}
- aLen = (azChar + uintptr(nChar)*4)
+ aLen = azChar + uintptr(nChar)*4
z = zCharSet
nChar = 0
for ; *(*uint8)(unsafe.Pointer(z)) != 0; nChar++ {
*(*uintptr)(unsafe.Pointer(azChar + uintptr(nChar)*4)) = z
{
- if (int32(*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&z, 1))))) >= 0xc0 {
- for (int32(*(*uint8)(unsafe.Pointer(z))) & 0xc0) == 0x80 {
+ if int32(*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&z, 1)))) >= 0xc0 {
+ for int32(*(*uint8)(unsafe.Pointer(z)))&0xc0 == 0x80 {
z++
}
}
}
- *(*uint32)(unsafe.Pointer(aLen + uintptr(nChar)*4)) = (uint32((int32(z) - int32(*(*uintptr)(unsafe.Pointer(azChar + uintptr(nChar)*4)))) / 1))
+ *(*uint32)(unsafe.Pointer(aLen + uintptr(nChar)*4)) = uint32((int32(z) - int32(*(*uintptr)(unsafe.Pointer(azChar + uintptr(nChar)*4)))) / 1)
}
}
}
if nChar > 0 {
flags = int32(Xsqlite3_user_data(tls, context))
- if (flags & 1) != 0 {
+ if flags&1 != 0 {
for nIn > uint32(0) {
var len uint32 = uint32(0)
for i = 0; i < nChar; i++ {
len = *(*uint32)(unsafe.Pointer(aLen + uintptr(i)*4))
- if (len <= nIn) && (libc.Xmemcmp(tls, zIn, *(*uintptr)(unsafe.Pointer(azChar + uintptr(i)*4)), len) == 0) {
+ if len <= nIn && libc.Xmemcmp(tls, zIn, *(*uintptr)(unsafe.Pointer(azChar + uintptr(i)*4)), len) == 0 {
break
}
}
@@ -101550,22 +102991,22 @@ func trimFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sql
break
}
zIn += uintptr(len)
- nIn = nIn - (len)
+ nIn = nIn - len
}
}
- if (flags & 2) != 0 {
+ if flags&2 != 0 {
for nIn > uint32(0) {
var len uint32 = uint32(0)
for i = 0; i < nChar; i++ {
len = *(*uint32)(unsafe.Pointer(aLen + uintptr(i)*4))
- if (len <= nIn) && (libc.Xmemcmp(tls, (zIn+uintptr((nIn-len))), *(*uintptr)(unsafe.Pointer(azChar + uintptr(i)*4)), len) == 0) {
+ if len <= nIn && libc.Xmemcmp(tls, zIn+uintptr(nIn-len), *(*uintptr)(unsafe.Pointer(azChar + uintptr(i)*4)), len) == 0 {
break
}
}
if i >= nChar {
break
}
- nIn = nIn - (len)
+ nIn = nIn - len
}
}
if zCharSet != 0 {
@@ -101575,8 +103016,8 @@ func trimFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sql
Xsqlite3_result_text(tls, context, zIn, int32(nIn), libc.UintptrFromInt32(-1))
}
-var lenOne = [1]uint32{uint32(1)} /* sqlite3.c:120648:27 */
-var azOne = [1]uintptr{uintptr(ts + 9652 /* " " */)} /* sqlite3.c:120649:26 */
+var lenOne = [1]uint32{uint32(1)} /* sqlite3.c:121503:27 */
+var azOne = [1]uintptr{uintptr(ts + 10766 /* " " */)} /* sqlite3.c:121504:26 */
// IMP: R-25361-16150 This function is omitted from SQLite by default. It
// is only available if the SQLITE_SOUNDEX compile-time option is used
@@ -101585,7 +103026,7 @@ var azOne = [1]uintptr{uintptr(ts + 9652 /* " " */)} /* sqlite3.c:120649:26 */
//
// IMP: R-59782-00072 The soundex(X) function returns a string that is the
// soundex encoding of the string X.
-func soundexFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:120739:13: */
+func soundexFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:121594:13: */
bp := tls.Alloc(8)
defer tls.Free(8)
@@ -101597,19 +103038,19 @@ func soundexFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /*
zIn = Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv)))
if zIn == uintptr(0) {
- zIn = ts + 755 /* "" */
+ zIn = ts + 1543 /* "" */
}
- for i = 0; (*(*U8)(unsafe.Pointer(zIn + uintptr(i))) != 0) && !((int32(Xsqlite3CtypeMap[*(*U8)(unsafe.Pointer(zIn + uintptr(i)))]) & 0x02) != 0); i++ {
+ for i = 0; *(*U8)(unsafe.Pointer(zIn + uintptr(i))) != 0 && !(int32(Xsqlite3CtypeMap[*(*U8)(unsafe.Pointer(zIn + uintptr(i)))])&0x02 != 0); i++ {
}
if *(*U8)(unsafe.Pointer(zIn + uintptr(i))) != 0 {
- var prevcode U8 = iCode[(int32(*(*U8)(unsafe.Pointer(zIn + uintptr(i)))) & 0x7f)]
- *(*uint8)(unsafe.Pointer(bp /* &zResult[0] */)) = (uint8((int32(*(*U8)(unsafe.Pointer(zIn + uintptr(i))))) & ^(int32(Xsqlite3CtypeMap[*(*U8)(unsafe.Pointer(zIn + uintptr(i)))]) & 0x20)))
- for j = 1; (j < 4) && (*(*U8)(unsafe.Pointer(zIn + uintptr(i))) != 0); i++ {
- var code int32 = int32(iCode[(int32(*(*U8)(unsafe.Pointer(zIn + uintptr(i)))) & 0x7f)])
+ var prevcode U8 = iCode[int32(*(*U8)(unsafe.Pointer(zIn + uintptr(i))))&0x7f]
+ *(*uint8)(unsafe.Pointer(bp /* &zResult[0] */)) = uint8(int32(*(*U8)(unsafe.Pointer(zIn + uintptr(i)))) & ^(int32(Xsqlite3CtypeMap[*(*U8)(unsafe.Pointer(zIn + uintptr(i)))]) & 0x20))
+ for j = 1; j < 4 && *(*U8)(unsafe.Pointer(zIn + uintptr(i))) != 0; i++ {
+ var code int32 = int32(iCode[int32(*(*U8)(unsafe.Pointer(zIn + uintptr(i))))&0x7f])
if code > 0 {
if code != int32(prevcode) {
prevcode = U8(code)
- *(*uint8)(unsafe.Pointer(bp /* &zResult[0] */ + uintptr(libc.PostIncInt32(&j, 1)))) = (uint8(code + '0'))
+ *(*uint8)(unsafe.Pointer(bp /* &zResult[0] */ + uintptr(libc.PostIncInt32(&j, 1)))) = uint8(code + '0')
}
} else {
prevcode = U8(0)
@@ -101623,7 +103064,7 @@ func soundexFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /*
} else {
// IMP: R-64894-50321 The string "?000" is returned if the argument
// is NULL or contains no ASCII alphabetic characters.
- Xsqlite3_result_text(tls, context, ts+13640 /* "?000" */, 4, uintptr(0))
+ Xsqlite3_result_text(tls, context, ts+14813 /* "?000" */, 4, uintptr(0))
}
}
@@ -101636,10 +103077,10 @@ var iCode = [128]uint8{
uint8(1), uint8(2), uint8(6), uint8(2), uint8(3), uint8(0), uint8(1), uint8(0), uint8(2), uint8(0), uint8(2), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0),
uint8(0), uint8(0), uint8(1), uint8(2), uint8(3), uint8(0), uint8(1), uint8(2), uint8(0), uint8(0), uint8(2), uint8(2), uint8(4), uint8(5), uint8(5), uint8(0),
uint8(1), uint8(2), uint8(6), uint8(2), uint8(3), uint8(0), uint8(1), uint8(0), uint8(2), uint8(0), uint8(2), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0),
-} /* sqlite3.c:120747:30 */
+} /* sqlite3.c:121602:30 */
// A function that loads a shared-library extension then returns NULL.
-func loadExt(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:120792:13: */
+func loadExt(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:121647:13: */
bp := tls.Alloc(4)
defer tls.Free(4)
@@ -101650,8 +103091,8 @@ func loadExt(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqli
// Disallow the load_extension() SQL function unless the SQLITE_LoadExtFunc
// flag is set. See the sqlite3_enable_load_extension() API.
- if ((*Sqlite3)(unsafe.Pointer(db)).Fflags & uint64(SQLITE_LoadExtFunc)) == uint64(0) {
- Xsqlite3_result_error(tls, context, ts+10824 /* "not authorized" */, -1)
+ if (*Sqlite3)(unsafe.Pointer(db)).Fflags&uint64(SQLITE_LoadExtFunc) == uint64(0) {
+ Xsqlite3_result_error(tls, context, ts+11938 /* "not authorized" */, -1)
return
}
@@ -101660,7 +103101,7 @@ func loadExt(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqli
} else {
zProc = uintptr(0)
}
- if (zFile != 0) && (Xsqlite3_load_extension(tls, db, zFile, zProc, bp /* &zErrMsg */) != 0) {
+ if zFile != 0 && Xsqlite3_load_extension(tls, db, zFile, zProc, bp) != 0 {
Xsqlite3_result_error(tls, context, *(*uintptr)(unsafe.Pointer(bp /* zErrMsg */)), -1)
Xsqlite3_free(tls, *(*uintptr)(unsafe.Pointer(bp /* zErrMsg */)))
}
@@ -101675,11 +103116,11 @@ type SumCtx1 = struct {
Foverflow U8
Fapprox U8
F__ccgo_pad1 [6]byte
-} /* sqlite3.c:120823:9 */
+} /* sqlite3.c:121678:9 */
// An instance of the following structure holds the context of a
// sum() or avg() aggregate computation.
-type SumCtx = SumCtx1 /* sqlite3.c:120823:23 */
+type SumCtx = SumCtx1 /* sqlite3.c:121678:23 */
// Routines used to compute the sum, average, and total.
//
@@ -101689,29 +103130,29 @@ type SumCtx = SumCtx1 /* sqlite3.c:120823:23 */
// SUM might return an integer if it never encounters a floating point
// value. TOTAL never fails, but SUM might through an exception if
// it overflows an integer.
-func sumStep(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:120842:13: */
+func sumStep(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:121697:13: */
var p uintptr
var type1 int32
_ = argc
p = Xsqlite3_aggregate_context(tls, context, int32(unsafe.Sizeof(SumCtx{})))
type1 = Xsqlite3_value_numeric_type(tls, *(*uintptr)(unsafe.Pointer(argv)))
- if (p != 0) && (type1 != SQLITE_NULL) {
+ if p != 0 && type1 != SQLITE_NULL {
(*SumCtx)(unsafe.Pointer(p)).Fcnt++
if type1 == SQLITE_INTEGER {
var v I64 = Xsqlite3_value_int64(tls, *(*uintptr)(unsafe.Pointer(argv)))
- *(*float64)(unsafe.Pointer(p /* &.rSum */)) += (float64(v))
- if ((int32((*SumCtx)(unsafe.Pointer(p)).Fapprox) | int32((*SumCtx)(unsafe.Pointer(p)).Foverflow)) == 0) && (Xsqlite3AddInt64(tls, (p+8 /* &.iSum */), v) != 0) {
- (*SumCtx)(unsafe.Pointer(p)).Fapprox = libc.AssignPtrUint8(p+24 /* &.overflow */, U8(1))
+ *(*float64)(unsafe.Pointer(p)) += float64(v)
+ if int32((*SumCtx)(unsafe.Pointer(p)).Fapprox)|int32((*SumCtx)(unsafe.Pointer(p)).Foverflow) == 0 && Xsqlite3AddInt64(tls, p+8, v) != 0 {
+ (*SumCtx)(unsafe.Pointer(p)).Fapprox = libc.AssignPtrUint8(p+24, U8(1))
}
} else {
- *(*float64)(unsafe.Pointer(p /* &.rSum */)) += (Xsqlite3_value_double(tls, *(*uintptr)(unsafe.Pointer(argv))))
+ *(*float64)(unsafe.Pointer(p)) += Xsqlite3_value_double(tls, *(*uintptr)(unsafe.Pointer(argv)))
(*SumCtx)(unsafe.Pointer(p)).Fapprox = U8(1)
}
}
}
-func sumInverse(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:120864:13: */
+func sumInverse(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:121719:13: */
var p uintptr
var type1 int32
@@ -101720,26 +103161,26 @@ func sumInverse(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* s
type1 = Xsqlite3_value_numeric_type(tls, *(*uintptr)(unsafe.Pointer(argv)))
// p is always non-NULL because sumStep() will have been called first
// to initialize it
- if (p != 0) && (type1 != SQLITE_NULL) {
+ if p != 0 && type1 != SQLITE_NULL {
(*SumCtx)(unsafe.Pointer(p)).Fcnt--
- if (type1 == SQLITE_INTEGER) && (int32((*SumCtx)(unsafe.Pointer(p)).Fapprox) == 0) {
+ if type1 == SQLITE_INTEGER && int32((*SumCtx)(unsafe.Pointer(p)).Fapprox) == 0 {
var v I64 = Xsqlite3_value_int64(tls, *(*uintptr)(unsafe.Pointer(argv)))
- *(*float64)(unsafe.Pointer(p /* &.rSum */)) -= (float64(v))
- *(*I64)(unsafe.Pointer(p + 8 /* &.iSum */)) -= (v)
+ *(*float64)(unsafe.Pointer(p)) -= float64(v)
+ *(*I64)(unsafe.Pointer(p + 8)) -= v
} else {
- *(*float64)(unsafe.Pointer(p /* &.rSum */)) -= (Xsqlite3_value_double(tls, *(*uintptr)(unsafe.Pointer(argv))))
+ *(*float64)(unsafe.Pointer(p)) -= Xsqlite3_value_double(tls, *(*uintptr)(unsafe.Pointer(argv)))
}
}
}
-func sumFinalize(tls *libc.TLS, context uintptr) { /* sqlite3.c:120889:13: */
+func sumFinalize(tls *libc.TLS, context uintptr) { /* sqlite3.c:121744:13: */
var p uintptr
p = Xsqlite3_aggregate_context(tls, context, 0)
- if (p != 0) && ((*SumCtx)(unsafe.Pointer(p)).Fcnt > int64(0)) {
+ if p != 0 && (*SumCtx)(unsafe.Pointer(p)).Fcnt > int64(0) {
if (*SumCtx)(unsafe.Pointer(p)).Foverflow != 0 {
- Xsqlite3_result_error(tls, context, ts+13533 /* "integer overflow" */, -1)
+ Xsqlite3_result_error(tls, context, ts+14706 /* "integer overflow" */, -1)
} else if (*SumCtx)(unsafe.Pointer(p)).Fapprox != 0 {
Xsqlite3_result_double(tls, context, (*SumCtx)(unsafe.Pointer(p)).FrSum)
} else {
@@ -101748,15 +103189,15 @@ func sumFinalize(tls *libc.TLS, context uintptr) { /* sqlite3.c:120889:13: */
}
}
-func avgFinalize(tls *libc.TLS, context uintptr) { /* sqlite3.c:120902:13: */
+func avgFinalize(tls *libc.TLS, context uintptr) { /* sqlite3.c:121757:13: */
var p uintptr
p = Xsqlite3_aggregate_context(tls, context, 0)
- if (p != 0) && ((*SumCtx)(unsafe.Pointer(p)).Fcnt > int64(0)) {
- Xsqlite3_result_double(tls, context, ((*SumCtx)(unsafe.Pointer(p)).FrSum / float64((*SumCtx)(unsafe.Pointer(p)).Fcnt)))
+ if p != 0 && (*SumCtx)(unsafe.Pointer(p)).Fcnt > int64(0) {
+ Xsqlite3_result_double(tls, context, (*SumCtx)(unsafe.Pointer(p)).FrSum/float64((*SumCtx)(unsafe.Pointer(p)).Fcnt))
}
}
-func totalFinalize(tls *libc.TLS, context uintptr) { /* sqlite3.c:120909:13: */
+func totalFinalize(tls *libc.TLS, context uintptr) { /* sqlite3.c:121764:13: */
var p uintptr
p = Xsqlite3_aggregate_context(tls, context, 0)
// (double)0 In case of SQLITE_OMIT_FLOATING_POINT...
@@ -101770,17 +103211,17 @@ func totalFinalize(tls *libc.TLS, context uintptr) { /* sqlite3.c:120909:13: */
// The following structure keeps track of state information for the
// count() aggregate function.
-type CountCtx1 = struct{ Fn I64 } /* sqlite3.c:120920:9 */
+type CountCtx1 = struct{ Fn I64 } /* sqlite3.c:121775:9 */
// The following structure keeps track of state information for the
// count() aggregate function.
-type CountCtx = CountCtx1 /* sqlite3.c:120920:25 */
+type CountCtx = CountCtx1 /* sqlite3.c:121775:25 */
// Routines to implement the count() aggregate function.
-func countStep(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:120931:13: */
+func countStep(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:121786:13: */
var p uintptr
p = Xsqlite3_aggregate_context(tls, context, int32(unsafe.Sizeof(CountCtx{})))
- if ((argc == 0) || (SQLITE_NULL != Xsqlite3_value_type(tls, *(*uintptr)(unsafe.Pointer(argv))))) && (p != 0) {
+ if (argc == 0 || SQLITE_NULL != Xsqlite3_value_type(tls, *(*uintptr)(unsafe.Pointer(argv)))) && p != 0 {
(*CountCtx)(unsafe.Pointer(p)).Fn++
}
@@ -101791,7 +103232,7 @@ func countStep(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sq
}
-func countFinalize(tls *libc.TLS, context uintptr) { /* sqlite3.c:120947:13: */
+func countFinalize(tls *libc.TLS, context uintptr) { /* sqlite3.c:121802:13: */
var p uintptr
p = Xsqlite3_aggregate_context(tls, context, 0)
Xsqlite3_result_int64(tls, context, func() int64 {
@@ -101802,17 +103243,17 @@ func countFinalize(tls *libc.TLS, context uintptr) { /* sqlite3.c:120947:13: */
}())
}
-func countInverse(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { /* sqlite3.c:120953:13: */
+func countInverse(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { /* sqlite3.c:121808:13: */
var p uintptr
p = Xsqlite3_aggregate_context(tls, ctx, int32(unsafe.Sizeof(CountCtx{})))
// p is always non-NULL since countStep() will have been called first
- if ((argc == 0) || (SQLITE_NULL != Xsqlite3_value_type(tls, *(*uintptr)(unsafe.Pointer(argv))))) && (p != 0) {
+ if (argc == 0 || SQLITE_NULL != Xsqlite3_value_type(tls, *(*uintptr)(unsafe.Pointer(argv)))) && p != 0 {
(*CountCtx)(unsafe.Pointer(p)).Fn--
}
}
// Routines to implement min() and max() aggregate functions.
-func minmaxStep(tls *libc.TLS, context uintptr, NotUsed int32, argv uintptr) { /* sqlite3.c:120971:13: */
+func minmaxStep(tls *libc.TLS, context uintptr, NotUsed int32, argv uintptr) { /* sqlite3.c:121826:13: */
var pArg uintptr = *(*uintptr)(unsafe.Pointer(argv))
var pBest uintptr
_ = NotUsed
@@ -101837,9 +103278,9 @@ func minmaxStep(tls *libc.TLS, context uintptr, NotUsed int32, argv uintptr) { /
// returns (void *)db, where db is the sqlite3* database pointer.
// Therefore the next statement sets variable 'max' to 1 for the max()
// aggregate, or 0 for min().
- max = (libc.Bool32(Xsqlite3_user_data(tls, context) != uintptr(0)))
+ max = libc.Bool32(Xsqlite3_user_data(tls, context) != uintptr(0))
cmp = Xsqlite3MemCompare(tls, pBest, pArg, pColl)
- if ((max != 0) && (cmp < 0)) || (!(max != 0) && (cmp > 0)) {
+ if max != 0 && cmp < 0 || !(max != 0) && cmp > 0 {
Xsqlite3VdbeMemCopy(tls, pBest, pArg)
} else {
sqlite3SkipAccumulatorLoad(tls, context)
@@ -101850,7 +103291,7 @@ func minmaxStep(tls *libc.TLS, context uintptr, NotUsed int32, argv uintptr) { /
}
}
-func minMaxValueFinalize(tls *libc.TLS, context uintptr, bValue int32) { /* sqlite3.c:121009:13: */
+func minMaxValueFinalize(tls *libc.TLS, context uintptr, bValue int32) { /* sqlite3.c:121864:13: */
var pRes uintptr
pRes = Xsqlite3_aggregate_context(tls, context, 0)
if pRes != 0 {
@@ -101863,18 +103304,31 @@ func minMaxValueFinalize(tls *libc.TLS, context uintptr, bValue int32) { /* sqli
}
}
-func minMaxValue(tls *libc.TLS, context uintptr) { /* sqlite3.c:121020:13: */
+func minMaxValue(tls *libc.TLS, context uintptr) { /* sqlite3.c:121875:13: */
minMaxValueFinalize(tls, context, 1)
}
-func minMaxFinalize(tls *libc.TLS, context uintptr) { /* sqlite3.c:121026:13: */
+func minMaxFinalize(tls *libc.TLS, context uintptr) { /* sqlite3.c:121881:13: */
minMaxValueFinalize(tls, context, 0)
}
// group_concat(EXPR, ?SEPARATOR?)
-func groupConcatStep(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:121033:13: */
+//
+// The SEPARATOR goes before the EXPR string. This is tragic. 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
+// around for so long that we dare not, for fear of breaking something.
+type GroupConcatCtx = struct {
+ Fstr StrAccum
+ FnAccum int32
+ FnFirstSepLength int32
+ FpnSepLengths uintptr
+} /* sqlite3.c:121906:3 */
+
+func groupConcatStep(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:121908:13: */
var zVal uintptr
- var pAccum uintptr
+ var pGCC uintptr
var zSep uintptr
var nVal int32
var nSep int32
@@ -101882,87 +103336,122 @@ func groupConcatStep(tls *libc.TLS, context uintptr, argc int32, argv uintptr) {
if Xsqlite3_value_type(tls, *(*uintptr)(unsafe.Pointer(argv))) == SQLITE_NULL {
return
}
- pAccum = Xsqlite3_aggregate_context(tls, context, int32(unsafe.Sizeof(StrAccum{})))
-
- if pAccum != 0 {
+ pGCC = Xsqlite3_aggregate_context(tls, context, int32(unsafe.Sizeof(GroupConcatCtx{})))
+ if pGCC != 0 {
var db uintptr = Xsqlite3_context_db_handle(tls, context)
- var firstTerm int32 = (libc.Bool32((*StrAccum)(unsafe.Pointer(pAccum)).FmxAlloc == U32(0)))
- (*StrAccum)(unsafe.Pointer(pAccum)).FmxAlloc = U32(*(*int32)(unsafe.Pointer((db + 112 /* &.aLimit */))))
- if !(firstTerm != 0) {
- if argc == 2 {
- zSep = Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv + 1*4)))
- nSep = Xsqlite3_value_bytes(tls, *(*uintptr)(unsafe.Pointer(argv + 1*4)))
+ var firstTerm int32 = libc.Bool32((*GroupConcatCtx)(unsafe.Pointer(pGCC)).Fstr.FmxAlloc == U32(0))
+ (*GroupConcatCtx)(unsafe.Pointer(pGCC)).Fstr.FmxAlloc = U32(*(*int32)(unsafe.Pointer(db + 120)))
+ if argc == 1 {
+ if !(firstTerm != 0) {
+ Xsqlite3_str_appendchar(tls, pGCC, 1, uint8(','))
} else {
- zSep = ts + 11537 /* "," */
- nSep = 1
+ (*GroupConcatCtx)(unsafe.Pointer(pGCC)).FnFirstSepLength = 1
}
+ } else if !(firstTerm != 0) {
+ zSep = Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv + 1*4)))
+ nSep = Xsqlite3_value_bytes(tls, *(*uintptr)(unsafe.Pointer(argv + 1*4)))
if zSep != 0 {
- Xsqlite3_str_append(tls, pAccum, zSep, nSep)
+ Xsqlite3_str_append(tls, pGCC, zSep, nSep)
+ } else {
+ nSep = 0
+ }
+ if nSep != (*GroupConcatCtx)(unsafe.Pointer(pGCC)).FnFirstSepLength || (*GroupConcatCtx)(unsafe.Pointer(pGCC)).FpnSepLengths != uintptr(0) {
+ var pnsl uintptr = (*GroupConcatCtx)(unsafe.Pointer(pGCC)).FpnSepLengths
+ if pnsl == uintptr(0) {
+ // First separator length variation seen, start tracking them.
+ pnsl = Xsqlite3_malloc64(tls, uint64(uint32((*GroupConcatCtx)(unsafe.Pointer(pGCC)).FnAccum+1)*uint32(unsafe.Sizeof(int32(0)))))
+ if pnsl != uintptr(0) {
+ var i int32 = 0
+ var nA int32 = (*GroupConcatCtx)(unsafe.Pointer(pGCC)).FnAccum - 1
+ for i < nA {
+ *(*int32)(unsafe.Pointer(pnsl + uintptr(libc.PostIncInt32(&i, 1))*4)) = (*GroupConcatCtx)(unsafe.Pointer(pGCC)).FnFirstSepLength
+ }
+ }
+ } else {
+ pnsl = Xsqlite3_realloc64(tls, pnsl, uint64(uint32((*GroupConcatCtx)(unsafe.Pointer(pGCC)).FnAccum)*uint32(unsafe.Sizeof(int32(0)))))
+ }
+ if pnsl != uintptr(0) {
+ if (*GroupConcatCtx)(unsafe.Pointer(pGCC)).FnAccum > 0 {
+ *(*int32)(unsafe.Pointer(pnsl + uintptr((*GroupConcatCtx)(unsafe.Pointer(pGCC)).FnAccum-1)*4)) = nSep
+ }
+ (*GroupConcatCtx)(unsafe.Pointer(pGCC)).FpnSepLengths = pnsl
+ } else {
+ Xsqlite3StrAccumSetError(tls, pGCC, uint8(SQLITE_NOMEM))
+ }
}
+ } else {
+ (*GroupConcatCtx)(unsafe.Pointer(pGCC)).FnFirstSepLength = Xsqlite3_value_bytes(tls, *(*uintptr)(unsafe.Pointer(argv + 1*4)))
}
+ *(*int32)(unsafe.Pointer(pGCC + 24)) += 1
zVal = Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv)))
nVal = Xsqlite3_value_bytes(tls, *(*uintptr)(unsafe.Pointer(argv)))
if zVal != 0 {
- Xsqlite3_str_append(tls, pAccum, zVal, nVal)
+ Xsqlite3_str_append(tls, pGCC, zVal, nVal)
}
}
}
-func groupConcatInverse(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:121066:13: */
- var n int32
- var pAccum uintptr
+func groupConcatInverse(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:121979:13: */
+ var pGCC uintptr
+ _ = argc // Suppress unused parameter warning
if Xsqlite3_value_type(tls, *(*uintptr)(unsafe.Pointer(argv))) == SQLITE_NULL {
return
}
- pAccum = Xsqlite3_aggregate_context(tls, context, int32(unsafe.Sizeof(StrAccum{})))
- // pAccum is always non-NULL since groupConcatStep() will have always
+ pGCC = Xsqlite3_aggregate_context(tls, context, int32(unsafe.Sizeof(GroupConcatCtx{})))
+ // pGCC is always non-NULL since groupConcatStep() will have always
// run frist to initialize it
- if pAccum != 0 {
- n = Xsqlite3_value_bytes(tls, *(*uintptr)(unsafe.Pointer(argv)))
- if argc == 2 {
- n = n + (Xsqlite3_value_bytes(tls, *(*uintptr)(unsafe.Pointer(argv + 1*4))))
+ if pGCC != 0 {
+ var nVS int32
+ // 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)))
+ nVS = Xsqlite3_value_bytes(tls, *(*uintptr)(unsafe.Pointer(argv)))
+ *(*int32)(unsafe.Pointer(pGCC + 24)) -= 1
+ if (*GroupConcatCtx)(unsafe.Pointer(pGCC)).FpnSepLengths != uintptr(0) {
+
+ if (*GroupConcatCtx)(unsafe.Pointer(pGCC)).FnAccum > 0 {
+ nVS = nVS + *(*int32)(unsafe.Pointer((*GroupConcatCtx)(unsafe.Pointer(pGCC)).FpnSepLengths))
+ libc.Xmemmove(tls, (*GroupConcatCtx)(unsafe.Pointer(pGCC)).FpnSepLengths, (*GroupConcatCtx)(unsafe.Pointer(pGCC)).FpnSepLengths+uintptr(1)*4,
+ uint32((*GroupConcatCtx)(unsafe.Pointer(pGCC)).FnAccum-1)*uint32(unsafe.Sizeof(int32(0))))
+ }
} else {
- n++
+ // If removing single accumulated string, harmlessly over-do.
+ nVS = nVS + (*GroupConcatCtx)(unsafe.Pointer(pGCC)).FnFirstSepLength
}
- if n >= int32((*StrAccum)(unsafe.Pointer(pAccum)).FnChar) {
- (*StrAccum)(unsafe.Pointer(pAccum)).FnChar = U32(0)
+ if nVS >= int32((*GroupConcatCtx)(unsafe.Pointer(pGCC)).Fstr.FnChar) {
+ (*GroupConcatCtx)(unsafe.Pointer(pGCC)).Fstr.FnChar = U32(0)
} else {
- *(*U32)(unsafe.Pointer(pAccum + 16 /* &.nChar */)) -= (U32(n))
- libc.Xmemmove(tls, (*StrAccum)(unsafe.Pointer(pAccum)).FzText, ((*StrAccum)(unsafe.Pointer(pAccum)).FzText + uintptr(n)), (*StrAccum)(unsafe.Pointer(pAccum)).FnChar)
+ *(*U32)(unsafe.Pointer(pGCC + 16)) -= U32(nVS)
+ libc.Xmemmove(tls, (*GroupConcatCtx)(unsafe.Pointer(pGCC)).Fstr.FzText, (*GroupConcatCtx)(unsafe.Pointer(pGCC)).Fstr.FzText+uintptr(nVS), (*GroupConcatCtx)(unsafe.Pointer(pGCC)).Fstr.FnChar)
}
- if (*StrAccum)(unsafe.Pointer(pAccum)).FnChar == U32(0) {
- (*StrAccum)(unsafe.Pointer(pAccum)).FmxAlloc = U32(0)
+ if (*GroupConcatCtx)(unsafe.Pointer(pGCC)).Fstr.FnChar == U32(0) {
+ (*GroupConcatCtx)(unsafe.Pointer(pGCC)).Fstr.FmxAlloc = U32(0)
+ Xsqlite3_free(tls, (*GroupConcatCtx)(unsafe.Pointer(pGCC)).FpnSepLengths)
+ (*GroupConcatCtx)(unsafe.Pointer(pGCC)).FpnSepLengths = uintptr(0)
}
}
}
-func groupConcatFinalize(tls *libc.TLS, context uintptr) { /* sqlite3.c:121097:13: */
- var pAccum uintptr
- pAccum = Xsqlite3_aggregate_context(tls, context, 0)
- if pAccum != 0 {
- if int32((*StrAccum)(unsafe.Pointer(pAccum)).FaccError) == SQLITE_TOOBIG {
- Xsqlite3_result_error_toobig(tls, context)
- } else if int32((*StrAccum)(unsafe.Pointer(pAccum)).FaccError) == SQLITE_NOMEM {
- Xsqlite3_result_error_nomem(tls, context)
- } else {
- Xsqlite3_result_text(tls, context, Xsqlite3StrAccumFinish(tls, pAccum), -1,
- *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{Xsqlite3_free})))
- }
+func groupConcatFinalize(tls *libc.TLS, context uintptr) { /* sqlite3.c:122025:13: */
+ var pGCC uintptr = Xsqlite3_aggregate_context(tls, context, 0)
+ if pGCC != 0 {
+ Xsqlite3ResultStrAccum(tls, context, pGCC)
+ Xsqlite3_free(tls, (*GroupConcatCtx)(unsafe.Pointer(pGCC)).FpnSepLengths)
}
}
-func groupConcatValue(tls *libc.TLS, context uintptr) { /* sqlite3.c:121112:13: */
- var pAccum uintptr
- pAccum = Xsqlite3_aggregate_context(tls, context, 0)
- if pAccum != 0 {
- if int32((*Sqlite3_str)(unsafe.Pointer(pAccum)).FaccError) == SQLITE_TOOBIG {
+func groupConcatValue(tls *libc.TLS, context uintptr) { /* sqlite3.c:122036:13: */
+ var pGCC uintptr = Xsqlite3_aggregate_context(tls, context, 0)
+ if pGCC != 0 {
+ var pAccum uintptr = pGCC
+ if int32((*StrAccum)(unsafe.Pointer(pAccum)).FaccError) == SQLITE_TOOBIG {
Xsqlite3_result_error_toobig(tls, context)
- } else if int32((*Sqlite3_str)(unsafe.Pointer(pAccum)).FaccError) == SQLITE_NOMEM {
+ } else if int32((*StrAccum)(unsafe.Pointer(pAccum)).FaccError) == SQLITE_NOMEM {
Xsqlite3_result_error_nomem(tls, context)
} else {
var zText uintptr = Xsqlite3_str_value(tls, pAccum)
- Xsqlite3_result_text(tls, context, zText, -1, libc.UintptrFromInt32(-1))
+ Xsqlite3_result_text(tls, context, zText, int32((*StrAccum)(unsafe.Pointer(pAccum)).FnChar), libc.UintptrFromInt32(-1))
}
}
}
@@ -101970,8 +103459,8 @@ func groupConcatValue(tls *libc.TLS, context uintptr) { /* sqlite3.c:121112:13:
// This routine does per-connection function registration. Most
// of the built-in functions above are part of the global function set.
// This routine only deals with those that are not global.
-func Xsqlite3RegisterPerConnectionBuiltinFunctions(tls *libc.TLS, db uintptr) { /* sqlite3.c:121135:21: */
- var rc int32 = Xsqlite3_overload_function(tls, db, ts+13645 /* "MATCH" */, 2)
+func Xsqlite3RegisterPerConnectionBuiltinFunctions(tls *libc.TLS, db uintptr) { /* sqlite3.c:122060:21: */
+ var rc int32 = Xsqlite3_overload_function(tls, db, ts+14818 /* "MATCH" */, 2)
if rc == SQLITE_NOMEM {
Xsqlite3OomFault(tls, db)
@@ -101981,24 +103470,24 @@ func Xsqlite3RegisterPerConnectionBuiltinFunctions(tls *libc.TLS, db uintptr) {
// Re-register the built-in LIKE functions. The caseSensitive
// parameter determines whether or not the LIKE operator is case
// sensitive.
-func Xsqlite3RegisterLikeFunctions(tls *libc.TLS, db uintptr, caseSensitive int32) { /* sqlite3.c:121148:21: */
+func Xsqlite3RegisterLikeFunctions(tls *libc.TLS, db uintptr, caseSensitive int32) { /* sqlite3.c:122073:21: */
var pInfo uintptr
var flags int32
if caseSensitive != 0 {
pInfo = uintptr(unsafe.Pointer(&likeInfoAlt))
- flags = (SQLITE_FUNC_LIKE | SQLITE_FUNC_CASE)
+ flags = SQLITE_FUNC_LIKE | SQLITE_FUNC_CASE
} else {
pInfo = uintptr(unsafe.Pointer(&likeInfoNorm))
flags = SQLITE_FUNC_LIKE
}
- Xsqlite3CreateFunc(tls, db, ts+13651 /* "like" */, 2, SQLITE_UTF8, pInfo, *(*uintptr)(unsafe.Pointer(&struct {
+ Xsqlite3CreateFunc(tls, db, ts+14824 /* "like" */, 2, SQLITE_UTF8, pInfo, *(*uintptr)(unsafe.Pointer(&struct {
f func(*libc.TLS, uintptr, int32, uintptr)
}{likeFunc})), uintptr(0), uintptr(0), uintptr(0), uintptr(0), uintptr(0))
- Xsqlite3CreateFunc(tls, db, ts+13651 /* "like" */, 3, SQLITE_UTF8, pInfo, *(*uintptr)(unsafe.Pointer(&struct {
+ Xsqlite3CreateFunc(tls, db, ts+14824 /* "like" */, 3, SQLITE_UTF8, pInfo, *(*uintptr)(unsafe.Pointer(&struct {
f func(*libc.TLS, uintptr, int32, uintptr)
}{likeFunc})), uintptr(0), uintptr(0), uintptr(0), uintptr(0), uintptr(0))
- *(*U32)(unsafe.Pointer(Xsqlite3FindFunction(tls, db, ts+13651 /* "like" */, 2, uint8(SQLITE_UTF8), uint8(0)) + 4 /* &.funcFlags */)) |= (U32(flags))
- *(*U32)(unsafe.Pointer(Xsqlite3FindFunction(tls, db, ts+13651 /* "like" */, 3, uint8(SQLITE_UTF8), uint8(0)) + 4 /* &.funcFlags */)) |= (U32(flags))
+ *(*U32)(unsafe.Pointer(Xsqlite3FindFunction(tls, db, ts+14824, 2, uint8(SQLITE_UTF8), uint8(0)) + 4)) |= U32(flags)
+ *(*U32)(unsafe.Pointer(Xsqlite3FindFunction(tls, db, ts+14824, 3, uint8(SQLITE_UTF8), uint8(0)) + 4)) |= U32(flags)
}
// pExpr points to an expression which implements a function. If
@@ -102016,17 +103505,17 @@ func Xsqlite3RegisterLikeFunctions(tls *libc.TLS, db uintptr, caseSensitive int3
// the function (default for LIKE). If the function makes the distinction
// between uppercase and lowercase (as does GLOB) then *pIsNocase is set to
// false.
-func Xsqlite3IsLikeFunction(tls *libc.TLS, db uintptr, pExpr uintptr, pIsNocase uintptr, aWc uintptr) int32 { /* sqlite3.c:121181:20: */
+func Xsqlite3IsLikeFunction(tls *libc.TLS, db uintptr, pExpr uintptr, pIsNocase uintptr, aWc uintptr) int32 { /* sqlite3.c:122106:20: */
var pDef uintptr
var nExpr int32
- if !(int32(*(*uintptr)(unsafe.Pointer(pExpr + 20 /* &.x */))) != 0) {
+ if !(int32(*(*uintptr)(unsafe.Pointer(pExpr + 20))) != 0) {
return 0
}
+ nExpr = (*ExprList)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pExpr + 20)))).FnExpr
- nExpr = (*ExprList)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pExpr + 20 /* &.x */)))).FnExpr
- pDef = Xsqlite3FindFunction(tls, db, *(*uintptr)(unsafe.Pointer(pExpr + 8 /* &.u */)), nExpr, uint8(SQLITE_UTF8), uint8(0))
- if (pDef == uintptr(0)) || (((*FuncDef)(unsafe.Pointer(pDef)).FfuncFlags & U32(SQLITE_FUNC_LIKE)) == U32(0)) {
+ pDef = Xsqlite3FindFunction(tls, db, *(*uintptr)(unsafe.Pointer(pExpr + 8)), nExpr, uint8(SQLITE_UTF8), uint8(0))
+ if pDef == uintptr(0) || (*FuncDef)(unsafe.Pointer(pDef)).FfuncFlags&U32(SQLITE_FUNC_LIKE) == U32(0) {
return 0
}
@@ -102038,13 +103527,14 @@ func Xsqlite3IsLikeFunction(tls *libc.TLS, db uintptr, pExpr uintptr, pIsNocase
if nExpr < 3 {
*(*uint8)(unsafe.Pointer(aWc + 3)) = uint8(0)
} else {
- var pEscape uintptr = (*ExprList_item)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(pExpr + 20 /* &.x */)) + 8 /* &.a */) + 2*20)).FpExpr
+ var pEscape uintptr = (*ExprList_item)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pExpr + 20)) + 8 + 2*20)).FpExpr
var zEscape uintptr
if int32((*Expr)(unsafe.Pointer(pEscape)).Fop) != TK_STRING {
return 0
}
- zEscape = *(*uintptr)(unsafe.Pointer(pEscape + 8 /* &.u */))
- if (int32(*(*uint8)(unsafe.Pointer(zEscape))) == 0) || (int32(*(*uint8)(unsafe.Pointer(zEscape + 1))) != 0) {
+
+ zEscape = *(*uintptr)(unsafe.Pointer(pEscape + 8))
+ if int32(*(*uint8)(unsafe.Pointer(zEscape))) == 0 || int32(*(*uint8)(unsafe.Pointer(zEscape + 1))) != 0 {
return 0
}
if int32(*(*uint8)(unsafe.Pointer(zEscape))) == int32(*(*uint8)(unsafe.Pointer(aWc))) {
@@ -102056,7 +103546,7 @@ func Xsqlite3IsLikeFunction(tls *libc.TLS, db uintptr, pExpr uintptr, pIsNocase
*(*uint8)(unsafe.Pointer(aWc + 3)) = *(*uint8)(unsafe.Pointer(zEscape))
}
- *(*int32)(unsafe.Pointer(pIsNocase)) = (libc.Bool32(((*FuncDef)(unsafe.Pointer(pDef)).FfuncFlags & U32(SQLITE_FUNC_CASE)) == U32(0)))
+ *(*int32)(unsafe.Pointer(pIsNocase)) = libc.Bool32((*FuncDef)(unsafe.Pointer(pDef)).FfuncFlags&U32(SQLITE_FUNC_CASE) == U32(0))
return 1
}
@@ -102065,13 +103555,13 @@ func Xsqlite3IsLikeFunction(tls *libc.TLS, db uintptr, pExpr uintptr, pIsNocase
// Extra math functions that require linking with -lm
// Implementation of sign(X) function.
-func signFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:121405:13: */
+func signFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:122332:13: */
var type0 int32
var x float64
_ = argc
type0 = Xsqlite3_value_numeric_type(tls, *(*uintptr)(unsafe.Pointer(argv)))
- if (type0 != SQLITE_INTEGER) && (type0 != SQLITE_FLOAT) {
+ if type0 != SQLITE_INTEGER && type0 != SQLITE_FLOAT {
return
}
x = Xsqlite3_value_double(tls, *(*uintptr)(unsafe.Pointer(argv)))
@@ -102093,86 +103583,87 @@ func signFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sql
// a consequence of calling sqlite3_initialize()).
//
// After this routine runs
-func Xsqlite3RegisterBuiltinFunctions(tls *libc.TLS) { /* sqlite3.c:121427:21: */
+func Xsqlite3RegisterBuiltinFunctions(tls *libc.TLS) { /* sqlite3.c:122354:21: */
Xsqlite3AlterFunctions(tls)
Xsqlite3WindowFunctions(tls)
Xsqlite3RegisterDateTimeFunctions(tls)
- Xsqlite3InsertBuiltinFuncs(tls, uintptr(unsafe.Pointer(&aBuiltinFunc)), (int32(uint32(unsafe.Sizeof(aBuiltinFunc)) / uint32(unsafe.Sizeof(FuncDef{})))))
+ Xsqlite3InsertBuiltinFuncs(tls, uintptr(unsafe.Pointer(&aBuiltinFunc)), int32(uint32(unsafe.Sizeof(aBuiltinFunc))/uint32(unsafe.Sizeof(FuncDef{}))))
}
-var aBuiltinFunc = [68]FuncDef{
+var aBuiltinFunc = [69]FuncDef{
//**** Functions only available with SQLITE_TESTCTRL_INTERNAL_FUNCTIONS ****
- {FnArg: int8(2), FfuncFlags: (U32(((((SQLITE_UTF8 | SQLITE_FUNC_INTERNAL) | SQLITE_FUNC_TEST) | SQLITE_FUNC_INLINE) | SQLITE_FUNC_CONSTANT) | (0))), FpUserData: uintptr(INLINEFUNC_implies_nonnull_row), FxSFunc: 0, FzName: ts + 13656 /* "implies_nonnull_..." */},
- {FnArg: int8(2), FfuncFlags: (U32(((((SQLITE_UTF8 | SQLITE_FUNC_INTERNAL) | SQLITE_FUNC_TEST) | SQLITE_FUNC_INLINE) | SQLITE_FUNC_CONSTANT) | (0))), FpUserData: uintptr(INLINEFUNC_expr_compare), FxSFunc: 0, FzName: ts + 13676 /* "expr_compare" */},
- {FnArg: int8(2), FfuncFlags: (U32(((((SQLITE_UTF8 | SQLITE_FUNC_INTERNAL) | SQLITE_FUNC_TEST) | SQLITE_FUNC_INLINE) | SQLITE_FUNC_CONSTANT) | (0))), FpUserData: uintptr(INLINEFUNC_expr_implies_expr), FxSFunc: 0, FzName: ts + 13689 /* "expr_implies_exp..." */},
+ {FnArg: int8(2), FfuncFlags: U32(SQLITE_FUNC_BUILTIN | SQLITE_UTF8 | SQLITE_FUNC_INTERNAL | SQLITE_FUNC_TEST | SQLITE_FUNC_INLINE | SQLITE_FUNC_CONSTANT | 0), FpUserData: uintptr(INLINEFUNC_implies_nonnull_row), FxSFunc: 0, FzName: ts + 14829 /* "implies_nonnull_..." */},
+ {FnArg: int8(2), FfuncFlags: U32(SQLITE_FUNC_BUILTIN | SQLITE_UTF8 | SQLITE_FUNC_INTERNAL | SQLITE_FUNC_TEST | SQLITE_FUNC_INLINE | SQLITE_FUNC_CONSTANT | 0), FpUserData: uintptr(INLINEFUNC_expr_compare), FxSFunc: 0, FzName: ts + 14849 /* "expr_compare" */},
+ {FnArg: int8(2), FfuncFlags: U32(SQLITE_FUNC_BUILTIN | SQLITE_UTF8 | SQLITE_FUNC_INTERNAL | SQLITE_FUNC_TEST | SQLITE_FUNC_INLINE | SQLITE_FUNC_CONSTANT | 0), FpUserData: uintptr(INLINEFUNC_expr_implies_expr), FxSFunc: 0, FzName: ts + 14862 /* "expr_implies_exp..." */},
+ {FnArg: int8(1), FfuncFlags: U32(SQLITE_FUNC_BUILTIN | SQLITE_UTF8 | SQLITE_FUNC_INTERNAL | SQLITE_FUNC_TEST | SQLITE_FUNC_INLINE | SQLITE_FUNC_CONSTANT | 0), FpUserData: uintptr(INLINEFUNC_affinity), FxSFunc: 0, FzName: ts + 14880 /* "affinity" */},
//**** Regular functions ****
- {FnArg: int8(1), FfuncFlags: (U32((SQLITE_FUNC_CONSTANT | SQLITE_UTF8) | (0 * SQLITE_FUNC_NEEDCOLL))), FxSFunc: 0, FzName: ts + 13707 /* "soundex" */},
- {FnArg: int8(1), FfuncFlags: (U32((SQLITE_UTF8 | SQLITE_DIRECTONLY) | SQLITE_FUNC_UNSAFE)), FxSFunc: 0, FzName: ts + 13715 /* "load_extension" */},
- {FnArg: int8(2), FfuncFlags: (U32((SQLITE_UTF8 | SQLITE_DIRECTONLY) | SQLITE_FUNC_UNSAFE)), FxSFunc: 0, FzName: ts + 13715 /* "load_extension" */},
- {FnArg: int8(1), FfuncFlags: (U32(SQLITE_FUNC_SLOCHNG | SQLITE_UTF8)), FxSFunc: 0, FzName: ts + 13730 /* "sqlite_compileop..." */},
- {FnArg: int8(1), FfuncFlags: (U32(SQLITE_FUNC_SLOCHNG | SQLITE_UTF8)), FxSFunc: 0, FzName: ts + 13756 /* "sqlite_compileop..." */},
- {FnArg: int8(1), FfuncFlags: (U32(((SQLITE_UTF8 | SQLITE_FUNC_INLINE) | SQLITE_FUNC_CONSTANT) | (SQLITE_FUNC_UNLIKELY))), FpUserData: uintptr(INLINEFUNC_unlikely), FxSFunc: 0, FzName: ts + 13781 /* "unlikely" */},
- {FnArg: int8(2), FfuncFlags: (U32(((SQLITE_UTF8 | SQLITE_FUNC_INLINE) | SQLITE_FUNC_CONSTANT) | (SQLITE_FUNC_UNLIKELY))), FpUserData: uintptr(INLINEFUNC_unlikely), FxSFunc: 0, FzName: ts + 13790 /* "likelihood" */},
- {FnArg: int8(1), FfuncFlags: (U32(((SQLITE_UTF8 | SQLITE_FUNC_INLINE) | SQLITE_FUNC_CONSTANT) | (SQLITE_FUNC_UNLIKELY))), FpUserData: uintptr(INLINEFUNC_unlikely), FxSFunc: 0, FzName: ts + 13801 /* "likely" */},
- {FnArg: int8(1), FfuncFlags: (U32((((SQLITE_FUNC_CONSTANT | SQLITE_UTF8) | (0 * SQLITE_FUNC_NEEDCOLL)) | SQLITE_FUNC_OFFSET) | SQLITE_FUNC_TYPEOF)), FxSFunc: 0, FzName: ts + 13808 /* "sqlite_offset" */},
- {FnArg: int8(1), FfuncFlags: (U32((SQLITE_FUNC_CONSTANT | SQLITE_UTF8) | (0 * SQLITE_FUNC_NEEDCOLL))), FpUserData: uintptr(1), FxSFunc: 0, FzName: ts + 13822 /* "ltrim" */},
- {FnArg: int8(2), FfuncFlags: (U32((SQLITE_FUNC_CONSTANT | SQLITE_UTF8) | (0 * SQLITE_FUNC_NEEDCOLL))), FpUserData: uintptr(1), FxSFunc: 0, FzName: ts + 13822 /* "ltrim" */},
- {FnArg: int8(1), FfuncFlags: (U32((SQLITE_FUNC_CONSTANT | SQLITE_UTF8) | (0 * SQLITE_FUNC_NEEDCOLL))), FpUserData: uintptr(2), FxSFunc: 0, FzName: ts + 13828 /* "rtrim" */},
- {FnArg: int8(2), FfuncFlags: (U32((SQLITE_FUNC_CONSTANT | SQLITE_UTF8) | (0 * SQLITE_FUNC_NEEDCOLL))), FpUserData: uintptr(2), FxSFunc: 0, FzName: ts + 13828 /* "rtrim" */},
- {FnArg: int8(1), FfuncFlags: (U32((SQLITE_FUNC_CONSTANT | SQLITE_UTF8) | (0 * SQLITE_FUNC_NEEDCOLL))), FpUserData: uintptr(3), FxSFunc: 0, FzName: ts + 13834 /* "trim" */},
- {FnArg: int8(2), FfuncFlags: (U32((SQLITE_FUNC_CONSTANT | SQLITE_UTF8) | (0 * SQLITE_FUNC_NEEDCOLL))), FpUserData: uintptr(3), FxSFunc: 0, FzName: ts + 13834 /* "trim" */},
- {FnArg: int8(-1), FfuncFlags: (U32((SQLITE_FUNC_CONSTANT | SQLITE_UTF8) | (1 * SQLITE_FUNC_NEEDCOLL))), FxSFunc: 0, FzName: ts + 13839 /* "min" */},
- {FfuncFlags: (U32((SQLITE_FUNC_CONSTANT | SQLITE_UTF8) | (1 * SQLITE_FUNC_NEEDCOLL))), FzName: ts + 13839 /* "min" */},
- {FnArg: int8(1), FfuncFlags: (U32((SQLITE_UTF8 | (1 * SQLITE_FUNC_NEEDCOLL)) | SQLITE_FUNC_MINMAX)), FxSFunc: 0, FxFinalize: 0, FxValue: 0, FzName: ts + 13839 /* "min" */},
- {FnArg: int8(-1), FfuncFlags: (U32((SQLITE_FUNC_CONSTANT | SQLITE_UTF8) | (1 * SQLITE_FUNC_NEEDCOLL))), FpUserData: uintptr(1), FxSFunc: 0, FzName: ts + 13843 /* "max" */},
- {FfuncFlags: (U32((SQLITE_FUNC_CONSTANT | SQLITE_UTF8) | (1 * SQLITE_FUNC_NEEDCOLL))), FpUserData: uintptr(1), FzName: ts + 13843 /* "max" */},
- {FnArg: int8(1), FfuncFlags: (U32((SQLITE_UTF8 | (1 * SQLITE_FUNC_NEEDCOLL)) | SQLITE_FUNC_MINMAX)), FpUserData: uintptr(1), FxSFunc: 0, FxFinalize: 0, FxValue: 0, FzName: ts + 13843 /* "max" */},
- {FnArg: int8(1), FfuncFlags: (U32(((SQLITE_FUNC_CONSTANT | SQLITE_UTF8) | (0 * SQLITE_FUNC_NEEDCOLL)) | SQLITE_FUNC_TYPEOF)), FxSFunc: 0, FzName: ts + 13847 /* "typeof" */},
- {FnArg: int8(1), FfuncFlags: (U32(((SQLITE_FUNC_CONSTANT | SQLITE_UTF8) | (0 * SQLITE_FUNC_NEEDCOLL)) | SQLITE_FUNC_LENGTH)), FxSFunc: 0, FzName: ts + 13854 /* "length" */},
- {FnArg: int8(2), FfuncFlags: (U32((SQLITE_FUNC_CONSTANT | SQLITE_UTF8) | (0 * SQLITE_FUNC_NEEDCOLL))), FxSFunc: 0, FzName: ts + 13861 /* "instr" */},
- {FnArg: int8(-1), FfuncFlags: (U32((SQLITE_FUNC_CONSTANT | SQLITE_UTF8) | (0 * SQLITE_FUNC_NEEDCOLL))), FxSFunc: 0, FzName: ts + 13867 /* "printf" */},
- {FnArg: int8(1), FfuncFlags: (U32((SQLITE_FUNC_CONSTANT | SQLITE_UTF8) | (0 * SQLITE_FUNC_NEEDCOLL))), FxSFunc: 0, FzName: ts + 13874 /* "unicode" */},
- {FnArg: int8(-1), FfuncFlags: (U32((SQLITE_FUNC_CONSTANT | SQLITE_UTF8) | (0 * SQLITE_FUNC_NEEDCOLL))), FxSFunc: 0, FzName: ts + 13882 /* "char" */},
- {FnArg: int8(1), FfuncFlags: (U32((SQLITE_FUNC_CONSTANT | SQLITE_UTF8) | (0 * SQLITE_FUNC_NEEDCOLL))), FxSFunc: 0, FzName: ts + 13887 /* "abs" */},
- {FnArg: int8(1), FfuncFlags: (U32((SQLITE_FUNC_CONSTANT | SQLITE_UTF8) | (0 * SQLITE_FUNC_NEEDCOLL))), FxSFunc: 0, FzName: ts + 13891 /* "round" */},
- {FnArg: int8(2), FfuncFlags: (U32((SQLITE_FUNC_CONSTANT | SQLITE_UTF8) | (0 * SQLITE_FUNC_NEEDCOLL))), FxSFunc: 0, FzName: ts + 13891 /* "round" */},
- {FnArg: int8(1), FfuncFlags: (U32((SQLITE_FUNC_CONSTANT | SQLITE_UTF8) | (0 * SQLITE_FUNC_NEEDCOLL))), FxSFunc: 0, FzName: ts + 13897 /* "upper" */},
- {FnArg: int8(1), FfuncFlags: (U32((SQLITE_FUNC_CONSTANT | SQLITE_UTF8) | (0 * SQLITE_FUNC_NEEDCOLL))), FxSFunc: 0, FzName: ts + 13903 /* "lower" */},
- {FnArg: int8(1), FfuncFlags: (U32((SQLITE_FUNC_CONSTANT | SQLITE_UTF8) | (0 * SQLITE_FUNC_NEEDCOLL))), FxSFunc: 0, FzName: ts + 13909 /* "hex" */},
- {FnArg: int8(2), FfuncFlags: (U32(((SQLITE_UTF8 | SQLITE_FUNC_INLINE) | SQLITE_FUNC_CONSTANT) | (0))), FxSFunc: 0, FzName: ts + 13913 /* "ifnull" */},
- {FfuncFlags: (U32(SQLITE_UTF8 | (0 * SQLITE_FUNC_NEEDCOLL))), FxSFunc: 0, FzName: ts + 13920 /* "random" */},
- {FnArg: int8(1), FfuncFlags: (U32(SQLITE_UTF8 | (0 * SQLITE_FUNC_NEEDCOLL))), FxSFunc: 0, FzName: ts + 13927 /* "randomblob" */},
- {FnArg: int8(2), FfuncFlags: (U32((SQLITE_FUNC_CONSTANT | SQLITE_UTF8) | (1 * SQLITE_FUNC_NEEDCOLL))), FxSFunc: 0, FzName: ts + 13938 /* "nullif" */},
- {FfuncFlags: (U32(SQLITE_FUNC_SLOCHNG | SQLITE_UTF8)), FxSFunc: 0, FzName: ts + 13945 /* "sqlite_version" */},
- {FfuncFlags: (U32(SQLITE_FUNC_SLOCHNG | SQLITE_UTF8)), FxSFunc: 0, FzName: ts + 13960 /* "sqlite_source_id" */},
- {FnArg: int8(2), FfuncFlags: (U32((SQLITE_FUNC_CONSTANT | SQLITE_UTF8) | (0 * SQLITE_FUNC_NEEDCOLL))), FxSFunc: 0, FzName: ts + 13977 /* "sqlite_log" */},
- {FnArg: int8(1), FfuncFlags: (U32((SQLITE_FUNC_CONSTANT | SQLITE_UTF8) | (0 * SQLITE_FUNC_NEEDCOLL))), FxSFunc: 0, FzName: ts + 13988 /* "quote" */},
- {FfuncFlags: (U32(SQLITE_UTF8 | (0 * SQLITE_FUNC_NEEDCOLL))), FxSFunc: 0, FzName: ts + 13994 /* "last_insert_rowi..." */},
- {FfuncFlags: (U32(SQLITE_UTF8 | (0 * SQLITE_FUNC_NEEDCOLL))), FxSFunc: 0, FzName: ts + 14012 /* "changes" */},
- {FfuncFlags: (U32(SQLITE_UTF8 | (0 * SQLITE_FUNC_NEEDCOLL))), FxSFunc: 0, FzName: ts + 14020 /* "total_changes" */},
- {FnArg: int8(3), FfuncFlags: (U32((SQLITE_FUNC_CONSTANT | SQLITE_UTF8) | (0 * SQLITE_FUNC_NEEDCOLL))), FxSFunc: 0, FzName: ts + 14034 /* "replace" */},
- {FnArg: int8(1), FfuncFlags: (U32((SQLITE_FUNC_CONSTANT | SQLITE_UTF8) | (0 * SQLITE_FUNC_NEEDCOLL))), FxSFunc: 0, FzName: ts + 14042 /* "zeroblob" */},
- {FnArg: int8(2), FfuncFlags: (U32((SQLITE_FUNC_CONSTANT | SQLITE_UTF8) | (0 * SQLITE_FUNC_NEEDCOLL))), FxSFunc: 0, FzName: ts + 14051 /* "substr" */},
- {FnArg: int8(3), FfuncFlags: (U32((SQLITE_FUNC_CONSTANT | SQLITE_UTF8) | (0 * SQLITE_FUNC_NEEDCOLL))), FxSFunc: 0, FzName: ts + 14051 /* "substr" */},
- {FnArg: int8(2), FfuncFlags: (U32((SQLITE_FUNC_CONSTANT | SQLITE_UTF8) | (0 * SQLITE_FUNC_NEEDCOLL))), FxSFunc: 0, FzName: ts + 14058 /* "substring" */},
- {FnArg: int8(3), FfuncFlags: (U32((SQLITE_FUNC_CONSTANT | SQLITE_UTF8) | (0 * SQLITE_FUNC_NEEDCOLL))), FxSFunc: 0, FzName: ts + 14058 /* "substring" */},
- {FnArg: int8(1), FfuncFlags: (U32((SQLITE_UTF8 | (0 * SQLITE_FUNC_NEEDCOLL)) | 0)), FxSFunc: 0, FxFinalize: 0, FxValue: 0, FxInverse: 0, FzName: ts + 14068 /* "sum" */},
- {FnArg: int8(1), FfuncFlags: (U32((SQLITE_UTF8 | (0 * SQLITE_FUNC_NEEDCOLL)) | 0)), FxSFunc: 0, FxFinalize: 0, FxValue: 0, FxInverse: 0, FzName: ts + 14072 /* "total" */},
- {FnArg: int8(1), FfuncFlags: (U32((SQLITE_UTF8 | (0 * SQLITE_FUNC_NEEDCOLL)) | 0)), FxSFunc: 0, FxFinalize: 0, FxValue: 0, FxInverse: 0, FzName: ts + 14078 /* "avg" */},
- {FfuncFlags: (U32((SQLITE_UTF8 | (0 * SQLITE_FUNC_NEEDCOLL)) | SQLITE_FUNC_COUNT)), FxSFunc: 0, FxFinalize: 0, FxValue: 0, FxInverse: 0, FzName: ts + 14082 /* "count" */},
- {FnArg: int8(1), FfuncFlags: (U32((SQLITE_UTF8 | (0 * SQLITE_FUNC_NEEDCOLL)) | 0)), FxSFunc: 0, FxFinalize: 0, FxValue: 0, FxInverse: 0, FzName: ts + 14082 /* "count" */},
- {FnArg: int8(1), FfuncFlags: (U32((SQLITE_UTF8 | (0 * SQLITE_FUNC_NEEDCOLL)) | 0)), FxSFunc: 0, FxFinalize: 0, FxValue: 0, FxInverse: 0, FzName: ts + 14088 /* "group_concat" */},
- {FnArg: int8(2), FfuncFlags: (U32((SQLITE_UTF8 | (0 * SQLITE_FUNC_NEEDCOLL)) | 0)), FxSFunc: 0, FxFinalize: 0, FxValue: 0, FxInverse: 0, FzName: ts + 14088 /* "group_concat" */},
-
- {FnArg: int8(2), FfuncFlags: (U32(((SQLITE_FUNC_CONSTANT | SQLITE_UTF8) | SQLITE_FUNC_LIKE) | SQLITE_FUNC_CASE)), FpUserData: 0, FxSFunc: 0, FzName: ts + 14101 /* "glob" */},
- {FnArg: int8(2), FfuncFlags: (U32((SQLITE_FUNC_CONSTANT | SQLITE_UTF8) | SQLITE_FUNC_LIKE)), FpUserData: 0, FxSFunc: 0, FzName: ts + 13651 /* "like" */},
- {FnArg: int8(3), FfuncFlags: (U32((SQLITE_FUNC_CONSTANT | SQLITE_UTF8) | SQLITE_FUNC_LIKE)), FpUserData: 0, FxSFunc: 0, FzName: ts + 13651 /* "like" */},
- {FnArg: int8(1), FfuncFlags: (U32((SQLITE_FUNC_CONSTANT | SQLITE_UTF8) | (0 * SQLITE_FUNC_NEEDCOLL))), FzName: ts + 14106 /* "coalesce" */},
- {FfuncFlags: (U32((SQLITE_FUNC_CONSTANT | SQLITE_UTF8) | (0 * SQLITE_FUNC_NEEDCOLL))), FzName: ts + 14106 /* "coalesce" */},
- {FnArg: int8(1), FfuncFlags: (U32((SQLITE_FUNC_CONSTANT | SQLITE_UTF8) | (0 * SQLITE_FUNC_NEEDCOLL))), FxSFunc: 0, FzName: ts + 14115 /* "sign" */},
- {FnArg: int8(-1), FfuncFlags: (U32(((SQLITE_UTF8 | SQLITE_FUNC_INLINE) | SQLITE_FUNC_CONSTANT) | (0))), FxSFunc: 0, FzName: ts + 14106 /* "coalesce" */},
- {FnArg: int8(3), FfuncFlags: (U32(((SQLITE_UTF8 | SQLITE_FUNC_INLINE) | SQLITE_FUNC_CONSTANT) | (0))), FpUserData: uintptr(INLINEFUNC_iif), FxSFunc: 0, FzName: ts + 14120 /* "iif" */}} /* sqlite3.c:121438:18 */
+ {FnArg: int8(1), FfuncFlags: U32(SQLITE_FUNC_BUILTIN | SQLITE_FUNC_CONSTANT | SQLITE_UTF8 | 0*SQLITE_FUNC_NEEDCOLL), FxSFunc: 0, FzName: ts + 14889 /* "soundex" */},
+ {FnArg: int8(1), FfuncFlags: U32(SQLITE_FUNC_BUILTIN | SQLITE_UTF8 | SQLITE_DIRECTONLY | SQLITE_FUNC_UNSAFE), FxSFunc: 0, FzName: ts + 14897 /* "load_extension" */},
+ {FnArg: int8(2), FfuncFlags: U32(SQLITE_FUNC_BUILTIN | SQLITE_UTF8 | SQLITE_DIRECTONLY | SQLITE_FUNC_UNSAFE), FxSFunc: 0, FzName: ts + 14897 /* "load_extension" */},
+ {FnArg: int8(1), FfuncFlags: U32(SQLITE_FUNC_BUILTIN | SQLITE_FUNC_SLOCHNG | SQLITE_UTF8), FxSFunc: 0, FzName: ts + 14912 /* "sqlite_compileop..." */},
+ {FnArg: int8(1), FfuncFlags: U32(SQLITE_FUNC_BUILTIN | SQLITE_FUNC_SLOCHNG | SQLITE_UTF8), FxSFunc: 0, FzName: ts + 14938 /* "sqlite_compileop..." */},
+ {FnArg: int8(1), FfuncFlags: U32(SQLITE_FUNC_BUILTIN | SQLITE_UTF8 | SQLITE_FUNC_INLINE | SQLITE_FUNC_CONSTANT | SQLITE_FUNC_UNLIKELY), FpUserData: uintptr(INLINEFUNC_unlikely), FxSFunc: 0, FzName: ts + 14963 /* "unlikely" */},
+ {FnArg: int8(2), FfuncFlags: U32(SQLITE_FUNC_BUILTIN | SQLITE_UTF8 | SQLITE_FUNC_INLINE | SQLITE_FUNC_CONSTANT | SQLITE_FUNC_UNLIKELY), FpUserData: uintptr(INLINEFUNC_unlikely), FxSFunc: 0, FzName: ts + 14972 /* "likelihood" */},
+ {FnArg: int8(1), FfuncFlags: U32(SQLITE_FUNC_BUILTIN | SQLITE_UTF8 | SQLITE_FUNC_INLINE | SQLITE_FUNC_CONSTANT | SQLITE_FUNC_UNLIKELY), FpUserData: uintptr(INLINEFUNC_unlikely), FxSFunc: 0, FzName: ts + 14983 /* "likely" */},
+ {FnArg: int8(1), FfuncFlags: U32(SQLITE_FUNC_BUILTIN | SQLITE_FUNC_CONSTANT | SQLITE_UTF8 | 0*SQLITE_FUNC_NEEDCOLL | SQLITE_FUNC_OFFSET | SQLITE_FUNC_TYPEOF), FxSFunc: 0, FzName: ts + 14990 /* "sqlite_offset" */},
+ {FnArg: int8(1), FfuncFlags: U32(SQLITE_FUNC_BUILTIN | SQLITE_FUNC_CONSTANT | SQLITE_UTF8 | 0*SQLITE_FUNC_NEEDCOLL), FpUserData: uintptr(1), FxSFunc: 0, FzName: ts + 15004 /* "ltrim" */},
+ {FnArg: int8(2), FfuncFlags: U32(SQLITE_FUNC_BUILTIN | SQLITE_FUNC_CONSTANT | SQLITE_UTF8 | 0*SQLITE_FUNC_NEEDCOLL), FpUserData: uintptr(1), FxSFunc: 0, FzName: ts + 15004 /* "ltrim" */},
+ {FnArg: int8(1), FfuncFlags: U32(SQLITE_FUNC_BUILTIN | SQLITE_FUNC_CONSTANT | SQLITE_UTF8 | 0*SQLITE_FUNC_NEEDCOLL), FpUserData: uintptr(2), FxSFunc: 0, FzName: ts + 15010 /* "rtrim" */},
+ {FnArg: int8(2), FfuncFlags: U32(SQLITE_FUNC_BUILTIN | SQLITE_FUNC_CONSTANT | SQLITE_UTF8 | 0*SQLITE_FUNC_NEEDCOLL), FpUserData: uintptr(2), FxSFunc: 0, FzName: ts + 15010 /* "rtrim" */},
+ {FnArg: int8(1), FfuncFlags: U32(SQLITE_FUNC_BUILTIN | SQLITE_FUNC_CONSTANT | SQLITE_UTF8 | 0*SQLITE_FUNC_NEEDCOLL), FpUserData: uintptr(3), FxSFunc: 0, FzName: ts + 15016 /* "trim" */},
+ {FnArg: int8(2), FfuncFlags: U32(SQLITE_FUNC_BUILTIN | SQLITE_FUNC_CONSTANT | SQLITE_UTF8 | 0*SQLITE_FUNC_NEEDCOLL), FpUserData: uintptr(3), FxSFunc: 0, FzName: ts + 15016 /* "trim" */},
+ {FnArg: int8(-1), FfuncFlags: U32(SQLITE_FUNC_BUILTIN | SQLITE_FUNC_CONSTANT | SQLITE_UTF8 | 1*SQLITE_FUNC_NEEDCOLL), FxSFunc: 0, FzName: ts + 15021 /* "min" */},
+ {FfuncFlags: U32(SQLITE_FUNC_BUILTIN | SQLITE_FUNC_CONSTANT | SQLITE_UTF8 | 1*SQLITE_FUNC_NEEDCOLL), FzName: ts + 15021 /* "min" */},
+ {FnArg: int8(1), FfuncFlags: U32(SQLITE_FUNC_BUILTIN | SQLITE_UTF8 | 1*SQLITE_FUNC_NEEDCOLL | SQLITE_FUNC_MINMAX | SQLITE_FUNC_ANYORDER), FxSFunc: 0, FxFinalize: 0, FxValue: 0, FzName: ts + 15021 /* "min" */},
+ {FnArg: int8(-1), FfuncFlags: U32(SQLITE_FUNC_BUILTIN | SQLITE_FUNC_CONSTANT | SQLITE_UTF8 | 1*SQLITE_FUNC_NEEDCOLL), FpUserData: uintptr(1), FxSFunc: 0, FzName: ts + 15025 /* "max" */},
+ {FfuncFlags: U32(SQLITE_FUNC_BUILTIN | SQLITE_FUNC_CONSTANT | SQLITE_UTF8 | 1*SQLITE_FUNC_NEEDCOLL), FpUserData: uintptr(1), FzName: ts + 15025 /* "max" */},
+ {FnArg: int8(1), FfuncFlags: U32(SQLITE_FUNC_BUILTIN | SQLITE_UTF8 | 1*SQLITE_FUNC_NEEDCOLL | SQLITE_FUNC_MINMAX | SQLITE_FUNC_ANYORDER), FpUserData: uintptr(1), FxSFunc: 0, FxFinalize: 0, FxValue: 0, FzName: ts + 15025 /* "max" */},
+ {FnArg: int8(1), FfuncFlags: U32(SQLITE_FUNC_BUILTIN | SQLITE_FUNC_CONSTANT | SQLITE_UTF8 | 0*SQLITE_FUNC_NEEDCOLL | SQLITE_FUNC_TYPEOF), FxSFunc: 0, FzName: ts + 15029 /* "typeof" */},
+ {FnArg: int8(1), FfuncFlags: U32(SQLITE_FUNC_BUILTIN | SQLITE_FUNC_CONSTANT | SQLITE_UTF8 | 0*SQLITE_FUNC_NEEDCOLL | SQLITE_FUNC_LENGTH), FxSFunc: 0, FzName: ts + 15036 /* "length" */},
+ {FnArg: int8(2), FfuncFlags: U32(SQLITE_FUNC_BUILTIN | SQLITE_FUNC_CONSTANT | SQLITE_UTF8 | 0*SQLITE_FUNC_NEEDCOLL), FxSFunc: 0, FzName: ts + 15043 /* "instr" */},
+ {FnArg: int8(-1), FfuncFlags: U32(SQLITE_FUNC_BUILTIN | SQLITE_FUNC_CONSTANT | SQLITE_UTF8 | 0*SQLITE_FUNC_NEEDCOLL), FxSFunc: 0, FzName: ts + 15049 /* "printf" */},
+ {FnArg: int8(1), FfuncFlags: U32(SQLITE_FUNC_BUILTIN | SQLITE_FUNC_CONSTANT | SQLITE_UTF8 | 0*SQLITE_FUNC_NEEDCOLL), FxSFunc: 0, FzName: ts + 15056 /* "unicode" */},
+ {FnArg: int8(-1), FfuncFlags: U32(SQLITE_FUNC_BUILTIN | SQLITE_FUNC_CONSTANT | SQLITE_UTF8 | 0*SQLITE_FUNC_NEEDCOLL), FxSFunc: 0, FzName: ts + 15064 /* "char" */},
+ {FnArg: int8(1), FfuncFlags: U32(SQLITE_FUNC_BUILTIN | SQLITE_FUNC_CONSTANT | SQLITE_UTF8 | 0*SQLITE_FUNC_NEEDCOLL), FxSFunc: 0, FzName: ts + 15069 /* "abs" */},
+ {FnArg: int8(1), FfuncFlags: U32(SQLITE_FUNC_BUILTIN | SQLITE_FUNC_CONSTANT | SQLITE_UTF8 | 0*SQLITE_FUNC_NEEDCOLL), FxSFunc: 0, FzName: ts + 15073 /* "round" */},
+ {FnArg: int8(2), FfuncFlags: U32(SQLITE_FUNC_BUILTIN | SQLITE_FUNC_CONSTANT | SQLITE_UTF8 | 0*SQLITE_FUNC_NEEDCOLL), FxSFunc: 0, FzName: ts + 15073 /* "round" */},
+ {FnArg: int8(1), FfuncFlags: U32(SQLITE_FUNC_BUILTIN | SQLITE_FUNC_CONSTANT | SQLITE_UTF8 | 0*SQLITE_FUNC_NEEDCOLL), FxSFunc: 0, FzName: ts + 15079 /* "upper" */},
+ {FnArg: int8(1), FfuncFlags: U32(SQLITE_FUNC_BUILTIN | SQLITE_FUNC_CONSTANT | SQLITE_UTF8 | 0*SQLITE_FUNC_NEEDCOLL), FxSFunc: 0, FzName: ts + 15085 /* "lower" */},
+ {FnArg: int8(1), FfuncFlags: U32(SQLITE_FUNC_BUILTIN | SQLITE_FUNC_CONSTANT | SQLITE_UTF8 | 0*SQLITE_FUNC_NEEDCOLL), FxSFunc: 0, FzName: ts + 15091 /* "hex" */},
+ {FnArg: int8(2), FfuncFlags: U32(SQLITE_FUNC_BUILTIN | SQLITE_UTF8 | SQLITE_FUNC_INLINE | SQLITE_FUNC_CONSTANT | 0), FxSFunc: 0, FzName: ts + 15095 /* "ifnull" */},
+ {FfuncFlags: U32(SQLITE_FUNC_BUILTIN | SQLITE_UTF8 | 0*SQLITE_FUNC_NEEDCOLL), FxSFunc: 0, FzName: ts + 15102 /* "random" */},
+ {FnArg: int8(1), FfuncFlags: U32(SQLITE_FUNC_BUILTIN | SQLITE_UTF8 | 0*SQLITE_FUNC_NEEDCOLL), FxSFunc: 0, FzName: ts + 15109 /* "randomblob" */},
+ {FnArg: int8(2), FfuncFlags: U32(SQLITE_FUNC_BUILTIN | SQLITE_FUNC_CONSTANT | SQLITE_UTF8 | 1*SQLITE_FUNC_NEEDCOLL), FxSFunc: 0, FzName: ts + 15120 /* "nullif" */},
+ {FfuncFlags: U32(SQLITE_FUNC_BUILTIN | SQLITE_FUNC_SLOCHNG | SQLITE_UTF8), FxSFunc: 0, FzName: ts + 15127 /* "sqlite_version" */},
+ {FfuncFlags: U32(SQLITE_FUNC_BUILTIN | SQLITE_FUNC_SLOCHNG | SQLITE_UTF8), FxSFunc: 0, FzName: ts + 15142 /* "sqlite_source_id" */},
+ {FnArg: int8(2), FfuncFlags: U32(SQLITE_FUNC_BUILTIN | SQLITE_FUNC_CONSTANT | SQLITE_UTF8 | 0*SQLITE_FUNC_NEEDCOLL), FxSFunc: 0, FzName: ts + 15159 /* "sqlite_log" */},
+ {FnArg: int8(1), FfuncFlags: U32(SQLITE_FUNC_BUILTIN | SQLITE_FUNC_CONSTANT | SQLITE_UTF8 | 0*SQLITE_FUNC_NEEDCOLL), FxSFunc: 0, FzName: ts + 15170 /* "quote" */},
+ {FfuncFlags: U32(SQLITE_FUNC_BUILTIN | SQLITE_UTF8 | 0*SQLITE_FUNC_NEEDCOLL), FxSFunc: 0, FzName: ts + 15176 /* "last_insert_rowi..." */},
+ {FfuncFlags: U32(SQLITE_FUNC_BUILTIN | SQLITE_UTF8 | 0*SQLITE_FUNC_NEEDCOLL), FxSFunc: 0, FzName: ts + 15194 /* "changes" */},
+ {FfuncFlags: U32(SQLITE_FUNC_BUILTIN | SQLITE_UTF8 | 0*SQLITE_FUNC_NEEDCOLL), FxSFunc: 0, FzName: ts + 15202 /* "total_changes" */},
+ {FnArg: int8(3), FfuncFlags: U32(SQLITE_FUNC_BUILTIN | SQLITE_FUNC_CONSTANT | SQLITE_UTF8 | 0*SQLITE_FUNC_NEEDCOLL), FxSFunc: 0, FzName: ts + 15216 /* "replace" */},
+ {FnArg: int8(1), FfuncFlags: U32(SQLITE_FUNC_BUILTIN | SQLITE_FUNC_CONSTANT | SQLITE_UTF8 | 0*SQLITE_FUNC_NEEDCOLL), FxSFunc: 0, FzName: ts + 15224 /* "zeroblob" */},
+ {FnArg: int8(2), FfuncFlags: U32(SQLITE_FUNC_BUILTIN | SQLITE_FUNC_CONSTANT | SQLITE_UTF8 | 0*SQLITE_FUNC_NEEDCOLL), FxSFunc: 0, FzName: ts + 15233 /* "substr" */},
+ {FnArg: int8(3), FfuncFlags: U32(SQLITE_FUNC_BUILTIN | SQLITE_FUNC_CONSTANT | SQLITE_UTF8 | 0*SQLITE_FUNC_NEEDCOLL), FxSFunc: 0, FzName: ts + 15233 /* "substr" */},
+ {FnArg: int8(2), FfuncFlags: U32(SQLITE_FUNC_BUILTIN | SQLITE_FUNC_CONSTANT | SQLITE_UTF8 | 0*SQLITE_FUNC_NEEDCOLL), FxSFunc: 0, FzName: ts + 15240 /* "substring" */},
+ {FnArg: int8(3), FfuncFlags: U32(SQLITE_FUNC_BUILTIN | SQLITE_FUNC_CONSTANT | SQLITE_UTF8 | 0*SQLITE_FUNC_NEEDCOLL), FxSFunc: 0, FzName: ts + 15240 /* "substring" */},
+ {FnArg: int8(1), FfuncFlags: U32(SQLITE_FUNC_BUILTIN | SQLITE_UTF8 | 0*SQLITE_FUNC_NEEDCOLL | 0), FxSFunc: 0, FxFinalize: 0, FxValue: 0, FxInverse: 0, FzName: ts + 15250 /* "sum" */},
+ {FnArg: int8(1), FfuncFlags: U32(SQLITE_FUNC_BUILTIN | SQLITE_UTF8 | 0*SQLITE_FUNC_NEEDCOLL | 0), FxSFunc: 0, FxFinalize: 0, FxValue: 0, FxInverse: 0, FzName: ts + 15254 /* "total" */},
+ {FnArg: int8(1), FfuncFlags: U32(SQLITE_FUNC_BUILTIN | SQLITE_UTF8 | 0*SQLITE_FUNC_NEEDCOLL | 0), FxSFunc: 0, FxFinalize: 0, FxValue: 0, FxInverse: 0, FzName: ts + 15260 /* "avg" */},
+ {FfuncFlags: U32(SQLITE_FUNC_BUILTIN | SQLITE_UTF8 | 0*SQLITE_FUNC_NEEDCOLL | SQLITE_FUNC_COUNT | SQLITE_FUNC_ANYORDER), FxSFunc: 0, FxFinalize: 0, FxValue: 0, FxInverse: 0, FzName: ts + 15264 /* "count" */},
+ {FnArg: int8(1), FfuncFlags: U32(SQLITE_FUNC_BUILTIN | SQLITE_UTF8 | 0*SQLITE_FUNC_NEEDCOLL | SQLITE_FUNC_ANYORDER), FxSFunc: 0, FxFinalize: 0, FxValue: 0, FxInverse: 0, FzName: ts + 15264 /* "count" */},
+ {FnArg: int8(1), FfuncFlags: U32(SQLITE_FUNC_BUILTIN | SQLITE_UTF8 | 0*SQLITE_FUNC_NEEDCOLL | 0), FxSFunc: 0, FxFinalize: 0, FxValue: 0, FxInverse: 0, FzName: ts + 15270 /* "group_concat" */},
+ {FnArg: int8(2), FfuncFlags: U32(SQLITE_FUNC_BUILTIN | SQLITE_UTF8 | 0*SQLITE_FUNC_NEEDCOLL | 0), FxSFunc: 0, FxFinalize: 0, FxValue: 0, FxInverse: 0, FzName: ts + 15270 /* "group_concat" */},
+
+ {FnArg: int8(2), FfuncFlags: U32(SQLITE_FUNC_BUILTIN | SQLITE_FUNC_CONSTANT | SQLITE_UTF8 | SQLITE_FUNC_LIKE | SQLITE_FUNC_CASE), FpUserData: 0, FxSFunc: 0, FzName: ts + 15283 /* "glob" */},
+ {FnArg: int8(2), FfuncFlags: U32(SQLITE_FUNC_BUILTIN | SQLITE_FUNC_CONSTANT | SQLITE_UTF8 | SQLITE_FUNC_LIKE), FpUserData: 0, FxSFunc: 0, FzName: ts + 14824 /* "like" */},
+ {FnArg: int8(3), FfuncFlags: U32(SQLITE_FUNC_BUILTIN | SQLITE_FUNC_CONSTANT | SQLITE_UTF8 | SQLITE_FUNC_LIKE), FpUserData: 0, FxSFunc: 0, FzName: ts + 14824 /* "like" */},
+ {FnArg: int8(1), FfuncFlags: U32(SQLITE_FUNC_BUILTIN | SQLITE_FUNC_CONSTANT | SQLITE_UTF8 | 0*SQLITE_FUNC_NEEDCOLL), FzName: ts + 15288 /* "coalesce" */},
+ {FfuncFlags: U32(SQLITE_FUNC_BUILTIN | SQLITE_FUNC_CONSTANT | SQLITE_UTF8 | 0*SQLITE_FUNC_NEEDCOLL), FzName: ts + 15288 /* "coalesce" */},
+ {FnArg: int8(1), FfuncFlags: U32(SQLITE_FUNC_BUILTIN | SQLITE_FUNC_CONSTANT | SQLITE_UTF8 | 0*SQLITE_FUNC_NEEDCOLL), FxSFunc: 0, FzName: ts + 15297 /* "sign" */},
+ {FnArg: int8(-1), FfuncFlags: U32(SQLITE_FUNC_BUILTIN | SQLITE_UTF8 | SQLITE_FUNC_INLINE | SQLITE_FUNC_CONSTANT | 0), FxSFunc: 0, FzName: ts + 15288 /* "coalesce" */},
+ {FnArg: int8(3), FfuncFlags: U32(SQLITE_FUNC_BUILTIN | SQLITE_UTF8 | SQLITE_FUNC_INLINE | SQLITE_FUNC_CONSTANT | 0), FpUserData: uintptr(INLINEFUNC_iif), FxSFunc: 0, FzName: ts + 15302 /* "iif" */}} /* sqlite3.c:122365:18 */
//************* End of func.c ***********************************************
//************* Begin file fkey.c *******************************************
@@ -102347,14 +103838,14 @@ var aBuiltinFunc = [68]FuncDef{
// then non-zero is returned, and a "foreign key mismatch" error loaded
// into pParse. If an OOM error occurs, non-zero is returned and the
// pParse->db->mallocFailed flag is set.
-func Xsqlite3FkLocateIndex(tls *libc.TLS, pParse uintptr, pParent uintptr, pFKey uintptr, ppIdx uintptr, paiCol uintptr) int32 { /* sqlite3.c:121786:20: */
+func Xsqlite3FkLocateIndex(tls *libc.TLS, pParse uintptr, pParent uintptr, pFKey uintptr, ppIdx uintptr, paiCol uintptr) int32 { /* sqlite3.c:122715:20: */
bp := tls.Alloc(16)
defer tls.Free(16)
- var pIdx uintptr = uintptr(0) // Value to return via *ppIdx
- var aiCol uintptr = uintptr(0) // Value to return via *paiCol
- var nCol int32 = (*FKey)(unsafe.Pointer(pFKey)).FnCol // Number of columns in parent key
- var zKey uintptr = (*sColMap)(unsafe.Pointer((pFKey + 36 /* &.aCol */))).FzCol // Name of left-most parent key column
+ var pIdx uintptr = uintptr(0) // Value to return via *ppIdx
+ var aiCol uintptr = uintptr(0) // Value to return via *paiCol
+ var nCol int32 = (*FKey)(unsafe.Pointer(pFKey)).FnCol // Number of columns in parent key
+ var zKey uintptr = (*sColMap)(unsafe.Pointer(pFKey + 36)).FzCol // Name of left-most parent key column
// The caller is responsible for zeroing output parameters.
@@ -102376,13 +103867,13 @@ func Xsqlite3FkLocateIndex(tls *libc.TLS, pParse uintptr, pParent uintptr, pFKey
if !(zKey != 0) {
return 0
}
- if !(Xsqlite3StrICmp(tls, (*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pParent)).FaCol+uintptr((*Table)(unsafe.Pointer(pParent)).FiPKey)*20)).FzName, zKey) != 0) {
+ if !(Xsqlite3StrICmp(tls, (*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pParent)).FaCol+uintptr((*Table)(unsafe.Pointer(pParent)).FiPKey)*16)).FzCnName, zKey) != 0) {
return 0
}
}
} else if paiCol != 0 {
- aiCol = Xsqlite3DbMallocRawNN(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, (uint64(uint32(nCol) * uint32(unsafe.Sizeof(int32(0))))))
+ aiCol = Xsqlite3DbMallocRawNN(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, uint64(uint32(nCol)*uint32(unsafe.Sizeof(int32(0)))))
if !(aiCol != 0) {
return 1
}
@@ -102390,7 +103881,7 @@ func Xsqlite3FkLocateIndex(tls *libc.TLS, pParse uintptr, pParent uintptr, pFKey
}
for pIdx = (*Table)(unsafe.Pointer(pParent)).FpIndex; pIdx != 0; pIdx = (*Index)(unsafe.Pointer(pIdx)).FpNext {
- if ((int32((*Index)(unsafe.Pointer(pIdx)).FnKeyCol) == nCol) && (int32((*Index)(unsafe.Pointer((pIdx))).FonError) != OE_None)) && ((*Index)(unsafe.Pointer(pIdx)).FpPartIdxWhere == uintptr(0)) {
+ if int32((*Index)(unsafe.Pointer(pIdx)).FnKeyCol) == nCol && int32((*Index)(unsafe.Pointer(pIdx)).FonError) != OE_None && (*Index)(unsafe.Pointer(pIdx)).FpPartIdxWhere == uintptr(0) {
// pIdx is a UNIQUE index (or a PRIMARY KEY) and has the right number
// of columns. If each indexed column corresponds to a foreign key
// column of pFKey, then this index is a winner.
@@ -102399,11 +103890,11 @@ func Xsqlite3FkLocateIndex(tls *libc.TLS, pParse uintptr, pParent uintptr, pFKey
// If zKey is NULL, then this foreign key is implicitly mapped to
// the PRIMARY KEY of table pParent. The PRIMARY KEY index may be
// identified by the test.
- if (int32(*(*uint16)(unsafe.Pointer((pIdx) + 56 /* &.idxType */)) & 0x3 >> 0)) == SQLITE_IDXTYPE_PRIMARYKEY {
+ if int32(*(*uint16)(unsafe.Pointer(pIdx + 56))&0x3>>0) == SQLITE_IDXTYPE_PRIMARYKEY {
if aiCol != 0 {
var i int32
for i = 0; i < nCol; i++ {
- *(*int32)(unsafe.Pointer(aiCol + uintptr(i)*4)) = (*sColMap)(unsafe.Pointer((pFKey + 36 /* &.aCol */) + uintptr(i)*8)).FiFrom
+ *(*int32)(unsafe.Pointer(aiCol + uintptr(i)*4)) = (*sColMap)(unsafe.Pointer(pFKey + 36 + uintptr(i)*8)).FiFrom
}
}
break
@@ -102427,7 +103918,7 @@ func Xsqlite3FkLocateIndex(tls *libc.TLS, pParse uintptr, pParent uintptr, pFKey
// If the index uses a collation sequence that is different from
// the default collation sequence for the column, this index is
// unusable. Bail out early in this case.
- zDfltColl = (*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pParent)).FaCol + uintptr(iCol)*20)).FzColl
+ zDfltColl = Xsqlite3ColumnColl(tls, (*Table)(unsafe.Pointer(pParent)).FaCol+uintptr(iCol)*16)
if !(zDfltColl != 0) {
zDfltColl = uintptr(unsafe.Pointer(&Xsqlite3StrBINARY))
}
@@ -102435,11 +103926,11 @@ func Xsqlite3FkLocateIndex(tls *libc.TLS, pParse uintptr, pParent uintptr, pFKey
break
}
- zIdxCol = (*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pParent)).FaCol + uintptr(iCol)*20)).FzName
+ zIdxCol = (*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pParent)).FaCol + uintptr(iCol)*16)).FzCnName
for j = 0; j < nCol; j++ {
- if Xsqlite3StrICmp(tls, (*sColMap)(unsafe.Pointer((pFKey+36 /* &.aCol */)+uintptr(j)*8)).FzCol, zIdxCol) == 0 {
+ if Xsqlite3StrICmp(tls, (*sColMap)(unsafe.Pointer(pFKey+36+uintptr(j)*8)).FzCol, zIdxCol) == 0 {
if aiCol != 0 {
- *(*int32)(unsafe.Pointer(aiCol + uintptr(i)*4)) = (*sColMap)(unsafe.Pointer((pFKey + 36 /* &.aCol */) + uintptr(j)*8)).FiFrom
+ *(*int32)(unsafe.Pointer(aiCol + uintptr(i)*4)) = (*sColMap)(unsafe.Pointer(pFKey + 36 + uintptr(j)*8)).FiFrom
}
break
}
@@ -102458,7 +103949,7 @@ func Xsqlite3FkLocateIndex(tls *libc.TLS, pParse uintptr, pParent uintptr, pFKey
if !(pIdx != 0) {
if !(int32((*Parse)(unsafe.Pointer(pParse)).FdisableTriggers) != 0) {
Xsqlite3ErrorMsg(tls, pParse,
- ts+14124, /* "foreign key mism..." */
+ ts+15306, /* "foreign key mism..." */
libc.VaList(bp, (*Table)(unsafe.Pointer((*FKey)(unsafe.Pointer(pFKey)).FpFrom)).FzName, (*FKey)(unsafe.Pointer(pFKey)).FzTo))
}
Xsqlite3DbFree(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, aiCol)
@@ -102493,11 +103984,11 @@ func Xsqlite3FkLocateIndex(tls *libc.TLS, pParse uintptr, pParent uintptr, pFKey
//
// These operations are identified in the comment at the top of this file
// (fkey.c) as "I.1" and "D.1".
-func fkLookupParent(tls *libc.TLS, pParse uintptr, iDb int32, pTab uintptr, pIdx uintptr, pFKey uintptr, aiCol uintptr, regData int32, nIncr int32, isIgnore int32) { /* sqlite3.c:121921:13: */
- var i int32 // Iterator variable
- var v uintptr = Xsqlite3GetVdbe(tls, pParse) // Vdbe to add code to
- var iCur int32 = ((*Parse)(unsafe.Pointer(pParse)).FnTab - 1) // Cursor number to use
- var iOk int32 = Xsqlite3VdbeMakeLabel(tls, pParse) // jump here if parent key found
+func fkLookupParent(tls *libc.TLS, pParse uintptr, iDb int32, pTab uintptr, pIdx uintptr, pFKey uintptr, aiCol uintptr, regData int32, nIncr int32, isIgnore int32) { /* sqlite3.c:122852:13: */
+ var i int32 // Iterator variable
+ var v uintptr = Xsqlite3GetVdbe(tls, pParse) // Vdbe to add code to
+ var iCur int32 = (*Parse)(unsafe.Pointer(pParse)).FnTab - 1 // Cursor number to use
+ var iOk int32 = Xsqlite3VdbeMakeLabel(tls, pParse) // jump here if parent key found
// If nIncr is less than zero, then check at runtime if there are any
// outstanding constraints to resolve. If there are not, there is no need
@@ -102511,7 +104002,7 @@ func fkLookupParent(tls *libc.TLS, pParse uintptr, iDb int32, pTab uintptr, pIdx
}
for i = 0; i < (*FKey)(unsafe.Pointer(pFKey)).FnCol; i++ {
- var iReg int32 = ((int32(Xsqlite3TableColumnToStorage(tls, (*FKey)(unsafe.Pointer(pFKey)).FpFrom, int16(*(*int32)(unsafe.Pointer(aiCol + uintptr(i)*4))))) + regData) + 1)
+ var iReg int32 = int32(Xsqlite3TableColumnToStorage(tls, (*FKey)(unsafe.Pointer(pFKey)).FpFrom, int16(*(*int32)(unsafe.Pointer(aiCol + uintptr(i)*4))))) + regData + 1
Xsqlite3VdbeAddOp2(tls, v, OP_IsNull, iReg, iOk)
}
@@ -102528,14 +104019,14 @@ func fkLookupParent(tls *libc.TLS, pParse uintptr, iDb int32, pTab uintptr, pIdx
// the value. Otherwise, the value inserted into the child key column
// will have INTEGER affinity applied to it, which may not be correct.
Xsqlite3VdbeAddOp2(tls, v, OP_SCopy,
- ((int32(Xsqlite3TableColumnToStorage(tls, (*FKey)(unsafe.Pointer(pFKey)).FpFrom, int16(*(*int32)(unsafe.Pointer(aiCol))))) + 1) + regData), regTemp)
+ int32(Xsqlite3TableColumnToStorage(tls, (*FKey)(unsafe.Pointer(pFKey)).FpFrom, int16(*(*int32)(unsafe.Pointer(aiCol)))))+1+regData, regTemp)
iMustBeInt = Xsqlite3VdbeAddOp2(tls, v, OP_MustBeInt, regTemp, 0)
// If the parent table is the same as the child table, and we are about
// to increment the constraint-counter (i.e. this is an INSERT operation),
// then check if the row being inserted matches itself. If so, do not
// increment the constraint-counter.
- if (pTab == (*FKey)(unsafe.Pointer(pFKey)).FpFrom) && (nIncr == 1) {
+ if pTab == (*FKey)(unsafe.Pointer(pFKey)).FpFrom && nIncr == 1 {
Xsqlite3VdbeAddOp3(tls, v, OP_Eq, regData, iOk, regTemp)
Xsqlite3VdbeChangeP5(tls, v, uint16(SQLITE_NOTNULL))
}
@@ -102543,7 +104034,7 @@ func fkLookupParent(tls *libc.TLS, pParse uintptr, iDb int32, pTab uintptr, pIdx
Xsqlite3OpenTable(tls, pParse, iCur, iDb, pTab, OP_OpenRead)
Xsqlite3VdbeAddOp3(tls, v, OP_NotExists, iCur, 0, regTemp)
Xsqlite3VdbeGoto(tls, v, iOk)
- Xsqlite3VdbeJumpHere(tls, v, (Xsqlite3VdbeCurrentAddr(tls, v) - 2))
+ Xsqlite3VdbeJumpHere(tls, v, Xsqlite3VdbeCurrentAddr(tls, v)-2)
Xsqlite3VdbeJumpHere(tls, v, iMustBeInt)
Xsqlite3ReleaseTempReg(tls, pParse, regTemp)
} else {
@@ -102555,8 +104046,8 @@ func fkLookupParent(tls *libc.TLS, pParse uintptr, iDb int32, pTab uintptr, pIdx
Xsqlite3VdbeSetP4KeyInfo(tls, pParse, pIdx)
for i = 0; i < nCol; i++ {
Xsqlite3VdbeAddOp2(tls, v, OP_Copy,
- ((int32(Xsqlite3TableColumnToStorage(tls, (*FKey)(unsafe.Pointer(pFKey)).FpFrom, int16(*(*int32)(unsafe.Pointer(aiCol + uintptr(i)*4))))) + 1) + regData),
- (regTemp + i))
+ int32(Xsqlite3TableColumnToStorage(tls, (*FKey)(unsafe.Pointer(pFKey)).FpFrom, int16(*(*int32)(unsafe.Pointer(aiCol + uintptr(i)*4)))))+1+regData,
+ regTemp+i)
}
// If the parent table is the same as the child table, and we are about
@@ -102568,14 +104059,14 @@ func fkLookupParent(tls *libc.TLS, pParse uintptr, iDb int32, pTab uintptr, pIdx
// itself. So set JUMPIFNULL to make sure we do the OP_Found if any
// of the parent-key values are NULL (at this point it is known that
// none of the child key values are).
- if (pTab == (*FKey)(unsafe.Pointer(pFKey)).FpFrom) && (nIncr == 1) {
- var iJump int32 = ((Xsqlite3VdbeCurrentAddr(tls, v) + nCol) + 1)
+ if pTab == (*FKey)(unsafe.Pointer(pFKey)).FpFrom && nIncr == 1 {
+ var iJump int32 = Xsqlite3VdbeCurrentAddr(tls, v) + nCol + 1
for i = 0; i < nCol; i++ {
- var iChild int32 = ((int32(Xsqlite3TableColumnToStorage(tls, (*FKey)(unsafe.Pointer(pFKey)).FpFrom, int16(*(*int32)(unsafe.Pointer(aiCol + uintptr(i)*4))))) +
- 1) + regData)
- var iParent int32 = (1 + regData)
- iParent = iParent + (int32(Xsqlite3TableColumnToStorage(tls, (*Index)(unsafe.Pointer(pIdx)).FpTable,
- *(*I16)(unsafe.Pointer((*Index)(unsafe.Pointer(pIdx)).FaiColumn + uintptr(i)*2)))))
+ var iChild int32 = int32(Xsqlite3TableColumnToStorage(tls, (*FKey)(unsafe.Pointer(pFKey)).FpFrom, int16(*(*int32)(unsafe.Pointer(aiCol + uintptr(i)*4))))) +
+ 1 + regData
+ var iParent int32 = 1 + regData
+ iParent = iParent + int32(Xsqlite3TableColumnToStorage(tls, (*Index)(unsafe.Pointer(pIdx)).FpTable,
+ *(*I16)(unsafe.Pointer((*Index)(unsafe.Pointer(pIdx)).FaiColumn + uintptr(i)*2))))
if int32(*(*I16)(unsafe.Pointer((*Index)(unsafe.Pointer(pIdx)).FaiColumn + uintptr(i)*2))) == int32((*Table)(unsafe.Pointer(pTab)).FiPKey) {
// The parent key is a composite key that includes the IPK column
@@ -102596,18 +104087,18 @@ func fkLookupParent(tls *libc.TLS, pParse uintptr, iDb int32, pTab uintptr, pIdx
}
}
- if ((!(int32((*FKey)(unsafe.Pointer(pFKey)).FisDeferred) != 0) && !(((*Sqlite3)(unsafe.Pointer((*Parse)(unsafe.Pointer(pParse)).Fdb)).Fflags & uint64(SQLITE_DeferFKs)) != 0)) &&
- !(int32((*Parse)(unsafe.Pointer(pParse)).FpToplevel) != 0)) &&
+ if !(int32((*FKey)(unsafe.Pointer(pFKey)).FisDeferred) != 0) && !((*Sqlite3)(unsafe.Pointer((*Parse)(unsafe.Pointer(pParse)).Fdb)).Fflags&uint64(SQLITE_DeferFKs) != 0) &&
+ !(int32((*Parse)(unsafe.Pointer(pParse)).FpToplevel) != 0) &&
!(int32((*Parse)(unsafe.Pointer(pParse)).FisMultiWrite) != 0) {
// Special case: If this is an INSERT statement that will insert exactly
// one row into the table, raise a constraint immediately instead of
// incrementing a counter. This is necessary as the VM code is being
// generated for will not open a statement transaction.
- Xsqlite3HaltConstraint(tls, pParse, (SQLITE_CONSTRAINT | (int32(3) << 8)),
+ Xsqlite3HaltConstraint(tls, pParse, SQLITE_CONSTRAINT|int32(3)<<8,
OE_Abort, uintptr(0), int8(-1), uint8(P5_ConstraintFK))
} else {
- if (nIncr > 0) && (int32((*FKey)(unsafe.Pointer(pFKey)).FisDeferred) == 0) {
+ if nIncr > 0 && int32((*FKey)(unsafe.Pointer(pFKey)).FisDeferred) == 0 {
Xsqlite3MayAbort(tls, pParse)
}
Xsqlite3VdbeAddOp2(tls, v, OP_FkCounter, int32((*FKey)(unsafe.Pointer(pFKey)).FisDeferred), nIncr)
@@ -102623,7 +104114,7 @@ func fkLookupParent(tls *libc.TLS, pParse uintptr, iDb int32, pTab uintptr, pIdx
// regBase is the first of an array of register that contains the data
// for pTab. regBase itself holds the rowid. regBase+1 holds the first
// column. regBase+2 holds the second column, and so forth.
-func exprTableRegister(tls *libc.TLS, pParse uintptr, pTab uintptr, regBase int32, iCol I16) uintptr { /* sqlite3.c:122074:13: */
+func exprTableRegister(tls *libc.TLS, pParse uintptr, pTab uintptr, regBase int32, iCol I16) uintptr { /* sqlite3.c:123005:13: */
var pExpr uintptr
var pCol uintptr
var zColl uintptr
@@ -102631,11 +104122,11 @@ func exprTableRegister(tls *libc.TLS, pParse uintptr, pTab uintptr, regBase int3
pExpr = Xsqlite3Expr(tls, db, TK_REGISTER, uintptr(0))
if pExpr != 0 {
- if (int32(iCol) >= 0) && (int32(iCol) != int32((*Table)(unsafe.Pointer(pTab)).FiPKey)) {
- pCol = ((*Table)(unsafe.Pointer(pTab)).FaCol + uintptr(iCol)*20)
- (*Expr)(unsafe.Pointer(pExpr)).FiTable = ((regBase + int32(Xsqlite3TableColumnToStorage(tls, pTab, iCol))) + 1)
+ if int32(iCol) >= 0 && int32(iCol) != int32((*Table)(unsafe.Pointer(pTab)).FiPKey) {
+ pCol = (*Table)(unsafe.Pointer(pTab)).FaCol + uintptr(iCol)*16
+ (*Expr)(unsafe.Pointer(pExpr)).FiTable = regBase + int32(Xsqlite3TableColumnToStorage(tls, pTab, iCol)) + 1
(*Expr)(unsafe.Pointer(pExpr)).FaffExpr = (*Column)(unsafe.Pointer(pCol)).Faffinity
- zColl = (*Column)(unsafe.Pointer(pCol)).FzColl
+ zColl = Xsqlite3ColumnColl(tls, pCol)
if zColl == uintptr(0) {
zColl = (*CollSeq)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FpDfltColl)).FzName
}
@@ -102650,10 +104141,11 @@ func exprTableRegister(tls *libc.TLS, pParse uintptr, pTab uintptr, regBase int3
// Return an Expr object that refers to column iCol of table pTab which
// has cursor iCur.
-func exprTableColumn(tls *libc.TLS, db uintptr, pTab uintptr, iCursor int32, iCol I16) uintptr { /* sqlite3.c:122106:13: */
+func exprTableColumn(tls *libc.TLS, db uintptr, pTab uintptr, iCursor int32, iCol I16) uintptr { /* sqlite3.c:123037:13: */
var pExpr uintptr = Xsqlite3Expr(tls, db, TK_COLUMN, uintptr(0))
if pExpr != 0 {
- *(*uintptr)(unsafe.Pointer(pExpr + 44 /* &.y */)) = pTab
+
+ *(*uintptr)(unsafe.Pointer(pExpr + 44)) = pTab
(*Expr)(unsafe.Pointer(pExpr)).FiTable = iCursor
(*Expr)(unsafe.Pointer(pExpr)).FiColumn = iCol
}
@@ -102690,7 +104182,7 @@ func exprTableColumn(tls *libc.TLS, db uintptr, pTab uintptr, iCursor int32, iCo
//
// These operations are identified in the comment at the top of this file
// (fkey.c) as "I.2" and "D.2".
-func fkScanChildren(tls *libc.TLS, pParse uintptr, pSrc uintptr, pTab uintptr, pIdx uintptr, pFKey uintptr, aiCol uintptr, regData int32, nIncr int32) { /* sqlite3.c:122153:13: */
+func fkScanChildren(tls *libc.TLS, pParse uintptr, pSrc uintptr, pTab uintptr, pIdx uintptr, pFKey uintptr, aiCol uintptr, regData int32, nIncr int32) { /* sqlite3.c:123085:13: */
bp := tls.Alloc(32)
defer tls.Free(32)
@@ -102731,10 +104223,10 @@ func fkScanChildren(tls *libc.TLS, pParse uintptr, pSrc uintptr, pTab uintptr, p
if aiCol != 0 {
iCol = int16(*(*int32)(unsafe.Pointer(aiCol + uintptr(i)*4)))
} else {
- iCol = int16((*sColMap)(unsafe.Pointer((pFKey + 36 /* &.aCol */))).FiFrom)
+ iCol = int16((*sColMap)(unsafe.Pointer(pFKey + 36)).FiFrom)
}
- zCol = (*Column)(unsafe.Pointer((*Table)(unsafe.Pointer((*FKey)(unsafe.Pointer(pFKey)).FpFrom)).FaCol + uintptr(iCol)*20)).FzName
+ zCol = (*Column)(unsafe.Pointer((*Table)(unsafe.Pointer((*FKey)(unsafe.Pointer(pFKey)).FpFrom)).FaCol + uintptr(iCol)*16)).FzCnName
pRight = Xsqlite3Expr(tls, db, TK_ID, zCol)
pEq = Xsqlite3PExpr(tls, pParse, TK_EQ, pLeft, pRight)
pWhere = Xsqlite3ExprAnd(tls, pParse, pWhere, pEq)
@@ -102753,13 +104245,13 @@ func fkScanChildren(tls *libc.TLS, pParse uintptr, pSrc uintptr, pTab uintptr, p
// uniquely identify the current row, but the parent key is more convenient
// as the required values have already been loaded into registers
// by the caller.
- if (pTab == (*FKey)(unsafe.Pointer(pFKey)).FpFrom) && (nIncr > 0) {
+ if pTab == (*FKey)(unsafe.Pointer(pFKey)).FpFrom && nIncr > 0 {
var pNe uintptr // Expression (pLeft != pRight)
var pLeft uintptr // Value from parent table row
var pRight uintptr // Column ref to child table
- if ((*Table)(unsafe.Pointer((pTab))).FtabFlags & U32(TF_WithoutRowid)) == U32(0) {
+ if (*Table)(unsafe.Pointer(pTab)).FtabFlags&U32(TF_WithoutRowid) == U32(0) {
pLeft = exprTableRegister(tls, pParse, pTab, regData, int16(-1))
- pRight = exprTableColumn(tls, db, pTab, (*SrcItem)(unsafe.Pointer((pSrc + 8 /* &.a */))).FiCursor, int16(-1))
+ pRight = exprTableColumn(tls, db, pTab, (*SrcItem)(unsafe.Pointer(pSrc+8)).FiCursor, int16(-1))
pNe = Xsqlite3PExpr(tls, pParse, TK_NE, pLeft, pRight)
} else {
var pEq uintptr
@@ -102769,7 +104261,7 @@ func fkScanChildren(tls *libc.TLS, pParse uintptr, pSrc uintptr, pTab uintptr, p
var iCol I16 = *(*I16)(unsafe.Pointer((*Index)(unsafe.Pointer(pIdx)).FaiColumn + uintptr(i)*2))
pLeft = exprTableRegister(tls, pParse, pTab, regData, iCol)
- pRight = Xsqlite3Expr(tls, db, TK_ID, (*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FaCol+uintptr(iCol)*20)).FzName)
+ pRight = Xsqlite3Expr(tls, db, TK_ID, (*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FaCol+uintptr(iCol)*16)).FzCnName)
pEq = Xsqlite3PExpr(tls, pParse, TK_IS, pLeft, pRight)
pAll = Xsqlite3ExprAnd(tls, pParse, pAll, pEq)
}
@@ -102814,8 +104306,8 @@ func fkScanChildren(tls *libc.TLS, pParse uintptr, pSrc uintptr, pTab uintptr, p
// "t2". Calling this function with "t2" as the argument would return a
// NULL pointer (as there are no FK constraints for which t2 is the parent
// table).
-func Xsqlite3FkReferences(tls *libc.TLS, pTab uintptr) uintptr { /* sqlite3.c:122282:21: */
- return Xsqlite3HashFind(tls, ((*Table)(unsafe.Pointer(pTab)).FpSchema + 56 /* &.fkeyHash */), (*Table)(unsafe.Pointer(pTab)).FzName)
+func Xsqlite3FkReferences(tls *libc.TLS, pTab uintptr) uintptr { /* sqlite3.c:123214:21: */
+ return Xsqlite3HashFind(tls, (*Table)(unsafe.Pointer(pTab)).FpSchema+56, (*Table)(unsafe.Pointer(pTab)).FzName)
}
// The second argument is a Trigger structure allocated by the
@@ -102824,7 +104316,7 @@ func Xsqlite3FkReferences(tls *libc.TLS, pTab uintptr) uintptr { /* sqlite3.c:12
//
// The Trigger structure or any of its sub-components may be allocated from
// the lookaside buffer belonging to database handle dbMem.
-func fkTriggerDelete(tls *libc.TLS, dbMem uintptr, p uintptr) { /* sqlite3.c:122294:13: */
+func fkTriggerDelete(tls *libc.TLS, dbMem uintptr, p uintptr) { /* sqlite3.c:123226:13: */
if p != 0 {
var pStep uintptr = (*Trigger)(unsafe.Pointer(p)).Fstep_list
Xsqlite3ExprDelete(tls, dbMem, (*TriggerStep)(unsafe.Pointer(pStep)).FpWhere)
@@ -102850,14 +104342,14 @@ func fkTriggerDelete(tls *libc.TLS, dbMem uintptr, p uintptr) { /* sqlite3.c:122
// then the equivalent of "DELETE FROM <tbl>" is executed before dropping
// the table from the database. Triggers are disabled while running this
// DELETE, but foreign key actions are not.
-func Xsqlite3FkDropTable(tls *libc.TLS, pParse uintptr, pName uintptr, pTab uintptr) { /* sqlite3.c:122322:21: */
+func Xsqlite3FkDropTable(tls *libc.TLS, pParse uintptr, pName uintptr, pTab uintptr) { /* sqlite3.c:123254:21: */
var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb
- if (((*Sqlite3)(unsafe.Pointer(db)).Fflags & uint64(SQLITE_ForeignKeys)) != 0) && !((*Table)(unsafe.Pointer(pTab)).FnModuleArg != 0) {
+ if (*Sqlite3)(unsafe.Pointer(db)).Fflags&uint64(SQLITE_ForeignKeys) != 0 && int32((*Table)(unsafe.Pointer(pTab)).FeTabType) == TABTYP_NORM {
var iSkip int32 = 0
var v uintptr = Xsqlite3GetVdbe(tls, pParse)
// VDBE has already been allocated
- // Not a view
+
if Xsqlite3FkReferences(tls, pTab) == uintptr(0) {
// Search for a deferred foreign key constraint for which this table
// is the child table. If one cannot be found, return without
@@ -102865,8 +104357,8 @@ func Xsqlite3FkDropTable(tls *libc.TLS, pParse uintptr, pName uintptr, pTab uint
// the entire DELETE if there are no outstanding deferred constraints
// when this statement is run.
var p uintptr
- for p = (*Table)(unsafe.Pointer(pTab)).FpFKey; p != 0; p = (*FKey)(unsafe.Pointer(p)).FpNextFrom {
- if ((*FKey)(unsafe.Pointer(p)).FisDeferred != 0) || (((*Sqlite3)(unsafe.Pointer(db)).Fflags & uint64(SQLITE_DeferFKs)) != 0) {
+ for p = *(*uintptr)(unsafe.Pointer(pTab + 44 + 4 /* &.pFKey */)); p != 0; p = (*FKey)(unsafe.Pointer(p)).FpNextFrom {
+ if (*FKey)(unsafe.Pointer(p)).FisDeferred != 0 || (*Sqlite3)(unsafe.Pointer(db)).Fflags&uint64(SQLITE_DeferFKs) != 0 {
break
}
}
@@ -102889,11 +104381,11 @@ func Xsqlite3FkDropTable(tls *libc.TLS, pParse uintptr, pName uintptr, pTab uint
// If the SQLITE_DeferFKs flag is set, then this is not required, as
// the statement transaction will not be rolled back even if FK
// constraints are violated.
- if ((*Sqlite3)(unsafe.Pointer(db)).Fflags & uint64(SQLITE_DeferFKs)) == uint64(0) {
+ if (*Sqlite3)(unsafe.Pointer(db)).Fflags&uint64(SQLITE_DeferFKs) == uint64(0) {
- Xsqlite3VdbeAddOp2(tls, v, OP_FkIfZero, 0, (Xsqlite3VdbeCurrentAddr(tls, v) + 2))
+ Xsqlite3VdbeAddOp2(tls, v, OP_FkIfZero, 0, Xsqlite3VdbeCurrentAddr(tls, v)+2)
- Xsqlite3HaltConstraint(tls, pParse, (SQLITE_CONSTRAINT | (int32(3) << 8)),
+ Xsqlite3HaltConstraint(tls, pParse, SQLITE_CONSTRAINT|int32(3)<<8,
OE_Abort, uintptr(0), int8(-1), uint8(P5_ConstraintFK))
}
@@ -102913,14 +104405,14 @@ func Xsqlite3FkDropTable(tls *libc.TLS, pParse uintptr, pName uintptr, pTab uint
//
// This function returns true if any of the columns that are part of the
// child key for FK constraint *p are modified.
-func fkChildIsModified(tls *libc.TLS, pTab uintptr, p uintptr, aChange uintptr, bChngRowid int32) int32 { /* sqlite3.c:122385:12: */
+func fkChildIsModified(tls *libc.TLS, pTab uintptr, p uintptr, aChange uintptr, bChngRowid int32) int32 { /* sqlite3.c:123317:12: */
var i int32
for i = 0; i < (*FKey)(unsafe.Pointer(p)).FnCol; i++ {
- var iChildKey int32 = (*sColMap)(unsafe.Pointer((p + 36 /* &.aCol */) + uintptr(i)*8)).FiFrom
+ var iChildKey int32 = (*sColMap)(unsafe.Pointer(p + 36 + uintptr(i)*8)).FiFrom
if *(*int32)(unsafe.Pointer(aChange + uintptr(iChildKey)*4)) >= 0 {
return 1
}
- if (iChildKey == int32((*Table)(unsafe.Pointer(pTab)).FiPKey)) && (bChngRowid != 0) {
+ if iChildKey == int32((*Table)(unsafe.Pointer(pTab)).FiPKey) && bChngRowid != 0 {
return 1
}
}
@@ -102937,19 +104429,19 @@ func fkChildIsModified(tls *libc.TLS, pTab uintptr, p uintptr, aChange uintptr,
//
// This function returns true if any of the columns that are part of the
// parent key for FK constraint *p are modified.
-func fkParentIsModified(tls *libc.TLS, pTab uintptr, p uintptr, aChange uintptr, bChngRowid int32) int32 { /* sqlite3.c:122412:12: */
+func fkParentIsModified(tls *libc.TLS, pTab uintptr, p uintptr, aChange uintptr, bChngRowid int32) int32 { /* sqlite3.c:123344:12: */
var i int32
for i = 0; i < (*FKey)(unsafe.Pointer(p)).FnCol; i++ {
- var zKey uintptr = (*sColMap)(unsafe.Pointer((p + 36 /* &.aCol */) + uintptr(i)*8)).FzCol
+ var zKey uintptr = (*sColMap)(unsafe.Pointer(p + 36 + uintptr(i)*8)).FzCol
var iKey int32
for iKey = 0; iKey < int32((*Table)(unsafe.Pointer(pTab)).FnCol); iKey++ {
- if (*(*int32)(unsafe.Pointer(aChange + uintptr(iKey)*4)) >= 0) || ((iKey == int32((*Table)(unsafe.Pointer(pTab)).FiPKey)) && (bChngRowid != 0)) {
- var pCol uintptr = ((*Table)(unsafe.Pointer(pTab)).FaCol + uintptr(iKey)*20)
+ if *(*int32)(unsafe.Pointer(aChange + uintptr(iKey)*4)) >= 0 || iKey == int32((*Table)(unsafe.Pointer(pTab)).FiPKey) && bChngRowid != 0 {
+ var pCol uintptr = (*Table)(unsafe.Pointer(pTab)).FaCol + uintptr(iKey)*16
if zKey != 0 {
- if 0 == Xsqlite3StrICmp(tls, (*Column)(unsafe.Pointer(pCol)).FzName, zKey) {
+ if 0 == Xsqlite3StrICmp(tls, (*Column)(unsafe.Pointer(pCol)).FzCnName, zKey) {
return 1
}
- } else if (int32((*Column)(unsafe.Pointer(pCol)).FcolFlags) & COLFLAG_PRIMKEY) != 0 {
+ } else if int32((*Column)(unsafe.Pointer(pCol)).FcolFlags)&COLFLAG_PRIMKEY != 0 {
return 1
}
}
@@ -102961,7 +104453,7 @@ func fkParentIsModified(tls *libc.TLS, pTab uintptr, p uintptr, aChange uintptr,
// Return true if the parser passed as the first argument is being
// used to code a trigger that is really a "SET NULL" action belonging
// to trigger pFKey.
-func isSetNullAction(tls *libc.TLS, pParse uintptr, pFKey uintptr) int32 { /* sqlite3.c:122441:12: */
+func isSetNullAction(tls *libc.TLS, pParse uintptr, pFKey uintptr) int32 { /* sqlite3.c:123373:12: */
var pTop uintptr = func() uintptr {
if (*Parse)(unsafe.Pointer(pParse)).FpToplevel != 0 {
return (*Parse)(unsafe.Pointer(pParse)).FpToplevel
@@ -102970,8 +104462,8 @@ func isSetNullAction(tls *libc.TLS, pParse uintptr, pFKey uintptr) int32 { /* sq
}()
if (*Parse)(unsafe.Pointer(pTop)).FpTriggerPrg != 0 {
var p uintptr = (*TriggerPrg)(unsafe.Pointer((*Parse)(unsafe.Pointer(pTop)).FpTriggerPrg)).FpTrigger
- if ((p == *(*uintptr)(unsafe.Pointer((pFKey + 28 /* &.apTrigger */)))) && (int32(*(*U8)(unsafe.Pointer((pFKey + 25 /* &.aAction */)))) == OE_SetNull)) ||
- ((p == *(*uintptr)(unsafe.Pointer((pFKey + 28 /* &.apTrigger */) + 1*4))) && (int32(*(*U8)(unsafe.Pointer((pFKey + 25 /* &.aAction */) + 1))) == OE_SetNull)) {
+ if p == *(*uintptr)(unsafe.Pointer(pFKey + 28)) && int32(*(*U8)(unsafe.Pointer(pFKey + 25))) == OE_SetNull ||
+ p == *(*uintptr)(unsafe.Pointer(pFKey + 28 + 1*4)) && int32(*(*U8)(unsafe.Pointer(pFKey + 25 + 1))) == OE_SetNull {
return 1
}
}
@@ -102996,7 +104488,7 @@ func isSetNullAction(tls *libc.TLS, pParse uintptr, pFKey uintptr) int32 { /* sq
// the original record is deleted from the table using the calling convention
// described for DELETE. Then again after the original record is deleted
// but before the new record is inserted using the INSERT convention.
-func Xsqlite3FkCheck(tls *libc.TLS, pParse uintptr, pTab uintptr, regOld int32, regNew int32, aChange uintptr, bChngRowid int32) { /* sqlite3.c:122474:21: */
+func Xsqlite3FkCheck(tls *libc.TLS, pParse uintptr, pTab uintptr, regOld int32, regNew int32, aChange uintptr, bChngRowid int32) { /* sqlite3.c:123406:21: */
bp := tls.Alloc(20)
defer tls.Free(20)
@@ -103009,7 +104501,10 @@ func Xsqlite3FkCheck(tls *libc.TLS, pParse uintptr, pTab uintptr, regOld int32,
// Exactly one of regOld and regNew should be non-zero.
// If foreign-keys are disabled, this function is a no-op.
- if ((*Sqlite3)(unsafe.Pointer(db)).Fflags & uint64(SQLITE_ForeignKeys)) == uint64(0) {
+ if (*Sqlite3)(unsafe.Pointer(db)).Fflags&uint64(SQLITE_ForeignKeys) == uint64(0) {
+ return
+ }
+ if !(int32((*Table)(unsafe.Pointer(pTab)).FeTabType) == TABTYP_NORM) {
return
}
@@ -103018,7 +104513,7 @@ func Xsqlite3FkCheck(tls *libc.TLS, pParse uintptr, pTab uintptr, regOld int32,
// Loop through all the foreign key constraints for which pTab is the
// child table (the table that the foreign key definition is part of).
- for pFKey = (*Table)(unsafe.Pointer(pTab)).FpFKey; pFKey != 0; pFKey = (*FKey)(unsafe.Pointer(pFKey)).FpNextFrom {
+ for pFKey = *(*uintptr)(unsafe.Pointer(pTab + 44 + 4 /* &.pFKey */)); pFKey != 0; pFKey = (*FKey)(unsafe.Pointer(pFKey)).FpNextFrom {
var pTo uintptr // Parent table of foreign key pFKey
*(*uintptr)(unsafe.Pointer(bp /* pIdx */)) = uintptr(0) // Index on key columns in pTo
*(*uintptr)(unsafe.Pointer(bp + 4 /* aiFree */)) = uintptr(0)
@@ -103028,9 +104523,9 @@ func Xsqlite3FkCheck(tls *libc.TLS, pParse uintptr, pTab uintptr, regOld int32,
var i int32
var bIgnore int32 = 0
- if ((aChange != 0) &&
- (Xsqlite3_stricmp(tls, (*Table)(unsafe.Pointer(pTab)).FzName, (*FKey)(unsafe.Pointer(pFKey)).FzTo) != 0)) &&
- (fkChildIsModified(tls, pTab, pFKey, aChange, bChngRowid) == 0) {
+ if aChange != 0 &&
+ Xsqlite3_stricmp(tls, (*Table)(unsafe.Pointer(pTab)).FzName, (*FKey)(unsafe.Pointer(pFKey)).FzTo) != 0 &&
+ fkChildIsModified(tls, pTab, pFKey, aChange, bChngRowid) == 0 {
continue
}
@@ -103043,9 +104538,9 @@ func Xsqlite3FkCheck(tls *libc.TLS, pParse uintptr, pTab uintptr, regOld int32,
} else {
pTo = Xsqlite3LocateTable(tls, pParse, uint32(0), (*FKey)(unsafe.Pointer(pFKey)).FzTo, zDb)
}
- if !(pTo != 0) || (Xsqlite3FkLocateIndex(tls, pParse, pTo, pFKey, bp /* &pIdx */, bp+4 /* &aiFree */) != 0) {
+ if !(pTo != 0) || Xsqlite3FkLocateIndex(tls, pParse, pTo, pFKey, bp, bp+4) != 0 {
- if !(isIgnoreErrors != 0) || ((*Sqlite3)(unsafe.Pointer(db)).FmallocFailed != 0) {
+ if !(isIgnoreErrors != 0) || (*Sqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 {
return
}
if pTo == uintptr(0) {
@@ -103056,12 +104551,12 @@ func Xsqlite3FkCheck(tls *libc.TLS, pParse uintptr, pTab uintptr, regOld int32,
// missing, behave as if it is empty. i.e. decrement the relevant
// FK counter for each row of the current table with non-NULL keys.
var v uintptr = Xsqlite3GetVdbe(tls, pParse)
- var iJump int32 = ((Xsqlite3VdbeCurrentAddr(tls, v) + (*FKey)(unsafe.Pointer(pFKey)).FnCol) + 1)
+ var iJump int32 = Xsqlite3VdbeCurrentAddr(tls, v) + (*FKey)(unsafe.Pointer(pFKey)).FnCol + 1
for i = 0; i < (*FKey)(unsafe.Pointer(pFKey)).FnCol; i++ {
var iFromCol int32
var iReg int32
- iFromCol = (*sColMap)(unsafe.Pointer((pFKey + 36 /* &.aCol */) + uintptr(i)*8)).FiFrom
- iReg = ((int32(Xsqlite3TableColumnToStorage(tls, (*FKey)(unsafe.Pointer(pFKey)).FpFrom, int16(iFromCol))) + regOld) + 1)
+ iFromCol = (*sColMap)(unsafe.Pointer(pFKey + 36 + uintptr(i)*8)).FiFrom
+ iReg = int32(Xsqlite3TableColumnToStorage(tls, (*FKey)(unsafe.Pointer(pFKey)).FpFrom, int16(iFromCol))) + regOld + 1
Xsqlite3VdbeAddOp2(tls, v, OP_IsNull, iReg, iJump)
}
Xsqlite3VdbeAddOp2(tls, v, OP_FkCounter, int32((*FKey)(unsafe.Pointer(pFKey)).FisDeferred), -1)
@@ -103069,10 +104564,10 @@ func Xsqlite3FkCheck(tls *libc.TLS, pParse uintptr, pTab uintptr, regOld int32,
continue
}
- if *(*uintptr)(unsafe.Pointer(bp + 4 /* aiFree */)) != 0 {
+ if *(*uintptr)(unsafe.Pointer(bp + 4)) != 0 {
aiCol = *(*uintptr)(unsafe.Pointer(bp + 4 /* aiFree */))
} else {
- *(*int32)(unsafe.Pointer(bp + 8 /* iCol */)) = (*sColMap)(unsafe.Pointer((pFKey + 36 /* &.aCol */))).FiFrom
+ *(*int32)(unsafe.Pointer(bp + 8 /* iCol */)) = (*sColMap)(unsafe.Pointer(pFKey + 36)).FiFrom
aiCol = bp + 8 /* &iCol */
}
for i = 0; i < (*FKey)(unsafe.Pointer(pFKey)).FnCol; i++ {
@@ -103086,13 +104581,13 @@ func Xsqlite3FkCheck(tls *libc.TLS, pParse uintptr, pTab uintptr, regOld int32,
if (*Sqlite3)(unsafe.Pointer(db)).FxAuth != 0 {
var rcauth int32
var zCol uintptr = (*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTo)).FaCol + uintptr(func() int32 {
- if *(*uintptr)(unsafe.Pointer(bp /* pIdx */)) != 0 {
+ if *(*uintptr)(unsafe.Pointer(bp)) != 0 {
return int32(*(*I16)(unsafe.Pointer((*Index)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* pIdx */)))).FaiColumn + uintptr(i)*2)))
}
return int32((*Table)(unsafe.Pointer(pTo)).FiPKey)
- }())*20)).FzName
+ }())*16)).FzCnName
rcauth = Xsqlite3AuthReadCol(tls, pParse, (*Table)(unsafe.Pointer(pTo)).FzName, zCol, iDb)
- bIgnore = (libc.Bool32(rcauth == SQLITE_IGNORE))
+ bIgnore = libc.Bool32(rcauth == SQLITE_IGNORE)
}
}
@@ -103108,7 +104603,7 @@ func Xsqlite3FkCheck(tls *libc.TLS, pParse uintptr, pTab uintptr, regOld int32,
// outstanding foreign key constraint violation.
fkLookupParent(tls, pParse, iDb, pTo, *(*uintptr)(unsafe.Pointer(bp /* pIdx */)), pFKey, aiCol, regOld, -1, bIgnore)
}
- if (regNew != 0) && !(isSetNullAction(tls, pParse, pFKey) != 0) {
+ if regNew != 0 && !(isSetNullAction(tls, pParse, pFKey) != 0) {
// A row is being added to the child table. If a parent row cannot
// be found, adding the child row has violated the FK constraint.
//
@@ -103130,20 +104625,20 @@ func Xsqlite3FkCheck(tls *libc.TLS, pParse uintptr, pTab uintptr, regOld int32,
var pSrc uintptr
*(*uintptr)(unsafe.Pointer(bp + 16 /* aiCol */)) = uintptr(0)
- if (aChange != 0) && (fkParentIsModified(tls, pTab, pFKey, aChange, bChngRowid) == 0) {
+ if aChange != 0 && fkParentIsModified(tls, pTab, pFKey, aChange, bChngRowid) == 0 {
continue
}
- if ((!(int32((*FKey)(unsafe.Pointer(pFKey)).FisDeferred) != 0) && !(((*Sqlite3)(unsafe.Pointer(db)).Fflags & uint64(SQLITE_DeferFKs)) != 0)) &&
- !(int32((*Parse)(unsafe.Pointer(pParse)).FpToplevel) != 0)) && !(int32((*Parse)(unsafe.Pointer(pParse)).FisMultiWrite) != 0) {
+ if !(int32((*FKey)(unsafe.Pointer(pFKey)).FisDeferred) != 0) && !((*Sqlite3)(unsafe.Pointer(db)).Fflags&uint64(SQLITE_DeferFKs) != 0) &&
+ !(int32((*Parse)(unsafe.Pointer(pParse)).FpToplevel) != 0) && !(int32((*Parse)(unsafe.Pointer(pParse)).FisMultiWrite) != 0) {
// Inserting a single row into a parent table cannot cause (or fix)
// an immediate foreign key violation. So do nothing in this case.
continue
}
- if Xsqlite3FkLocateIndex(tls, pParse, pTab, pFKey, bp+12 /* &pIdx */, bp+16 /* &aiCol */) != 0 {
- if !(isIgnoreErrors != 0) || ((*Sqlite3)(unsafe.Pointer(db)).FmallocFailed != 0) {
+ if Xsqlite3FkLocateIndex(tls, pParse, pTab, pFKey, bp+12, bp+16) != 0 {
+ if !(isIgnoreErrors != 0) || (*Sqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 {
return
}
continue
@@ -103163,7 +104658,7 @@ func Xsqlite3FkCheck(tls *libc.TLS, pParse uintptr, pTab uintptr, regOld int32,
fkScanChildren(tls, pParse, pSrc, pTab, *(*uintptr)(unsafe.Pointer(bp + 12 /* pIdx */)), pFKey, *(*uintptr)(unsafe.Pointer(bp + 16 /* aiCol */)), regNew, -1)
}
if regOld != 0 {
- var eAction int32 = int32(*(*U8)(unsafe.Pointer((pFKey + 25 /* &.aAction */) + uintptr((libc.Bool32(aChange != uintptr(0)))))))
+ var eAction int32 = int32(*(*U8)(unsafe.Pointer(pFKey + 25 + uintptr(libc.Bool32(aChange != uintptr(0))))))
fkScanChildren(tls, pParse, pSrc, pTab, *(*uintptr)(unsafe.Pointer(bp + 12 /* pIdx */)), pFKey, *(*uintptr)(unsafe.Pointer(bp + 16 /* aiCol */)), regOld, 1)
// If this is a deferred FK constraint, or a CASCADE or SET NULL
// action applies, then any foreign key violations caused by
@@ -103182,7 +104677,7 @@ func Xsqlite3FkCheck(tls *libc.TLS, pParse uintptr, pTab uintptr, regOld int32,
// child table to fire. In these cases the fk constraint counters
// might be set incorrectly if any OP_FkCounter related scans are
// omitted.
- if (!(int32((*FKey)(unsafe.Pointer(pFKey)).FisDeferred) != 0) && (eAction != OE_Cascade)) && (eAction != OE_SetNull) {
+ if !(int32((*FKey)(unsafe.Pointer(pFKey)).FisDeferred) != 0) && eAction != OE_Cascade && eAction != OE_SetNull {
Xsqlite3MayAbort(tls, pParse)
}
}
@@ -103195,36 +104690,36 @@ func Xsqlite3FkCheck(tls *libc.TLS, pParse uintptr, pTab uintptr, regOld int32,
// This function is called before generating code to update or delete a
// row contained in table pTab.
-func Xsqlite3FkOldmask(tls *libc.TLS, pParse uintptr, pTab uintptr) U32 { /* sqlite3.c:122676:20: */
+func Xsqlite3FkOldmask(tls *libc.TLS, pParse uintptr, pTab uintptr) U32 { /* sqlite3.c:123609:20: */
bp := tls.Alloc(4)
defer tls.Free(4)
var mask U32 = U32(0)
- if ((*Sqlite3)(unsafe.Pointer((*Parse)(unsafe.Pointer(pParse)).Fdb)).Fflags & uint64(SQLITE_ForeignKeys)) != 0 {
+ if (*Sqlite3)(unsafe.Pointer((*Parse)(unsafe.Pointer(pParse)).Fdb)).Fflags&uint64(SQLITE_ForeignKeys) != 0 && int32((*Table)(unsafe.Pointer(pTab)).FeTabType) == TABTYP_NORM {
var p uintptr
var i int32
- for p = (*Table)(unsafe.Pointer(pTab)).FpFKey; p != 0; p = (*FKey)(unsafe.Pointer(p)).FpNextFrom {
+ for p = *(*uintptr)(unsafe.Pointer(pTab + 44 + 4 /* &.pFKey */)); p != 0; p = (*FKey)(unsafe.Pointer(p)).FpNextFrom {
for i = 0; i < (*FKey)(unsafe.Pointer(p)).FnCol; i++ {
- mask = mask | (func() uint32 {
- if ((*sColMap)(unsafe.Pointer((p + 36 /* &.aCol */) + uintptr(i)*8)).FiFrom) > 31 {
+ mask = mask | func() uint32 {
+ if (*sColMap)(unsafe.Pointer(p+36+uintptr(i)*8)).FiFrom > 31 {
return 0xffffffff
}
- return (U32(U32(1)) << ((*sColMap)(unsafe.Pointer((p + 36 /* &.aCol */) + uintptr(i)*8)).FiFrom))
- }())
+ return U32(U32(1)) << (*sColMap)(unsafe.Pointer(p+36+uintptr(i)*8)).FiFrom
+ }()
}
}
for p = Xsqlite3FkReferences(tls, pTab); p != 0; p = (*FKey)(unsafe.Pointer(p)).FpNextTo {
*(*uintptr)(unsafe.Pointer(bp /* pIdx */)) = uintptr(0)
Xsqlite3FkLocateIndex(tls, pParse, pTab, p, bp /* &pIdx */, uintptr(0))
- if *(*uintptr)(unsafe.Pointer(bp /* pIdx */)) != 0 {
+ if *(*uintptr)(unsafe.Pointer(bp)) != 0 {
for i = 0; i < int32((*Index)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* pIdx */)))).FnKeyCol); i++ {
- mask = mask | (func() uint32 {
- if (int32(*(*I16)(unsafe.Pointer((*Index)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* pIdx */)))).FaiColumn + uintptr(i)*2)))) > 31 {
+ mask = mask | func() uint32 {
+ if int32(*(*I16)(unsafe.Pointer((*Index)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FaiColumn + uintptr(i)*2))) > 31 {
return 0xffffffff
}
- return (U32(U32(1)) << (int32(*(*I16)(unsafe.Pointer((*Index)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* pIdx */)))).FaiColumn + uintptr(i)*2)))))
- }())
+ return U32(U32(1)) << int32(*(*I16)(unsafe.Pointer((*Index)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FaiColumn + uintptr(i)*2)))
+ }()
}
}
}
@@ -103254,22 +104749,22 @@ func Xsqlite3FkOldmask(tls *libc.TLS, pParse uintptr, pTab uintptr) U32 { /* sql
// not "NO ACTION" (i.e. is CASCADE, SET DEFAULT or SET NULL).
//
// Or, assuming some other foreign key processing is required, 1.
-func Xsqlite3FkRequired(tls *libc.TLS, pParse uintptr, pTab uintptr, aChange uintptr, chngRowid int32) int32 { /* sqlite3.c:122726:20: */
+func Xsqlite3FkRequired(tls *libc.TLS, pParse uintptr, pTab uintptr, aChange uintptr, chngRowid int32) int32 { /* sqlite3.c:123659:20: */
var eRet int32 = 1 // Value to return if bHaveFK is true
var bHaveFK int32 = 0 // If FK processing is required
- if ((*Sqlite3)(unsafe.Pointer((*Parse)(unsafe.Pointer(pParse)).Fdb)).Fflags & uint64(SQLITE_ForeignKeys)) != 0 {
+ if (*Sqlite3)(unsafe.Pointer((*Parse)(unsafe.Pointer(pParse)).Fdb)).Fflags&uint64(SQLITE_ForeignKeys) != 0 && int32((*Table)(unsafe.Pointer(pTab)).FeTabType) == TABTYP_NORM {
if !(aChange != 0) {
// A DELETE operation. Foreign key processing is required if the
// table in question is either the child or parent table for any
// foreign key constraint.
- bHaveFK = (libc.Bool32((Xsqlite3FkReferences(tls, pTab) != 0) || ((*Table)(unsafe.Pointer(pTab)).FpFKey != 0)))
+ bHaveFK = libc.Bool32(Xsqlite3FkReferences(tls, pTab) != 0 || *(*uintptr)(unsafe.Pointer(pTab + 44 + 4)) != 0)
} else {
// This is an UPDATE. Foreign key processing is only required if the
// operation modifies one or more child or parent key columns.
var p uintptr
// Check if any child key columns are being modified.
- for p = (*Table)(unsafe.Pointer(pTab)).FpFKey; p != 0; p = (*FKey)(unsafe.Pointer(p)).FpNextFrom {
+ for p = *(*uintptr)(unsafe.Pointer(pTab + 44 + 4 /* &.pFKey */)); p != 0; p = (*FKey)(unsafe.Pointer(p)).FpNextFrom {
if fkChildIsModified(tls, pTab, p, aChange, chngRowid) != 0 {
if 0 == Xsqlite3_stricmp(tls, (*Table)(unsafe.Pointer(pTab)).FzName, (*FKey)(unsafe.Pointer(p)).FzTo) {
eRet = 2
@@ -103281,7 +104776,7 @@ func Xsqlite3FkRequired(tls *libc.TLS, pParse uintptr, pTab uintptr, aChange uin
// Check if any parent key columns are being modified.
for p = Xsqlite3FkReferences(tls, pTab); p != 0; p = (*FKey)(unsafe.Pointer(p)).FpNextTo {
if fkParentIsModified(tls, pTab, p, aChange, chngRowid) != 0 {
- if int32(*(*U8)(unsafe.Pointer((p + 25 /* &.aAction */) + 1))) != OE_None {
+ if int32(*(*U8)(unsafe.Pointer(p + 25 + 1))) != OE_None {
return 2
}
bHaveFK = 1
@@ -103322,22 +104817,22 @@ func Xsqlite3FkRequired(tls *libc.TLS, pParse uintptr, pTab uintptr, aChange uin
// The returned pointer is cached as part of the foreign key object. It
// is eventually freed along with the rest of the foreign key object by
// sqlite3FkDelete().
-func fkActionTrigger(tls *libc.TLS, pParse uintptr, pTab uintptr, pFKey uintptr, pChanges uintptr) uintptr { /* sqlite3.c:122794:16: */
+func fkActionTrigger(tls *libc.TLS, pParse uintptr, pTab uintptr, pFKey uintptr, pChanges uintptr) uintptr { /* sqlite3.c:123727:16: */
bp := tls.Alloc(48)
defer tls.Free(48)
- var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb // Database handle
- var action int32 // One of OE_None, OE_Cascade etc.
- var pTrigger uintptr // Trigger definition to return
- var iAction int32 = (libc.Bool32(pChanges != uintptr(0))) // 1 for UPDATE, 0 for DELETE
+ var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb // Database handle
+ var action int32 // One of OE_None, OE_Cascade etc.
+ var pTrigger uintptr // Trigger definition to return
+ var iAction int32 = libc.Bool32(pChanges != uintptr(0)) // 1 for UPDATE, 0 for DELETE
- action = int32(*(*U8)(unsafe.Pointer((pFKey + 25 /* &.aAction */) + uintptr(iAction))))
- if (action == OE_Restrict) && (((*Sqlite3)(unsafe.Pointer(db)).Fflags & uint64(SQLITE_DeferFKs)) != 0) {
+ action = int32(*(*U8)(unsafe.Pointer(pFKey + 25 + uintptr(iAction))))
+ if action == OE_Restrict && (*Sqlite3)(unsafe.Pointer(db)).Fflags&uint64(SQLITE_DeferFKs) != 0 {
return uintptr(0)
}
- pTrigger = *(*uintptr)(unsafe.Pointer((pFKey + 28 /* &.apTrigger */) + uintptr(iAction)*4))
+ pTrigger = *(*uintptr)(unsafe.Pointer(pFKey + 28 + uintptr(iAction)*4))
- if (action != OE_None) && !(pTrigger != 0) {
+ if action != OE_None && !(pTrigger != 0) {
var zFrom uintptr // Name of child table
var nFrom int32 // Length in bytes of zFrom
*(*uintptr)(unsafe.Pointer(bp /* pIdx */)) = uintptr(0) // Parent key index for this FK
@@ -103349,13 +104844,13 @@ func fkActionTrigger(tls *libc.TLS, pParse uintptr, pTab uintptr, pFKey uintptr,
var i int32 // Iterator variable
var pWhen uintptr = uintptr(0) // WHEN clause for the trigger
- if Xsqlite3FkLocateIndex(tls, pParse, pTab, pFKey, bp /* &pIdx */, bp+4 /* &aiCol */) != 0 {
+ if Xsqlite3FkLocateIndex(tls, pParse, pTab, pFKey, bp, bp+4) != 0 {
return uintptr(0)
}
for i = 0; i < (*FKey)(unsafe.Pointer(pFKey)).FnCol; i++ {
- *(*Token)(unsafe.Pointer(bp + 24 /* tOld */)) = Token{Fz: ts + 5467 /* "old" */, Fn: uint32(3)} // Literal "old" token
- *(*Token)(unsafe.Pointer(bp + 32 /* tNew */)) = Token{Fz: ts + 5463 /* "new" */, Fn: uint32(3)} // Literal "new" token
+ *(*Token)(unsafe.Pointer(bp + 24 /* tOld */)) = Token{Fz: ts + 6314 /* "old" */, Fn: uint32(3)} // Literal "old" token
+ *(*Token)(unsafe.Pointer(bp + 32 /* tNew */)) = Token{Fz: ts + 6310 /* "new" */, Fn: uint32(3)} // Literal "new" token
// var tFromCol Token at bp+16, 8
// Name of column in child table
// var tToCol Token at bp+8, 8
@@ -103363,20 +104858,20 @@ func fkActionTrigger(tls *libc.TLS, pParse uintptr, pTab uintptr, pFKey uintptr,
var iFromCol int32 // Idx of column in child table
var pEq uintptr // tFromCol = OLD.tToCol
- if *(*uintptr)(unsafe.Pointer(bp + 4 /* aiCol */)) != 0 {
+ if *(*uintptr)(unsafe.Pointer(bp + 4)) != 0 {
iFromCol = *(*int32)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 4 /* aiCol */)) + uintptr(i)*4))
} else {
- iFromCol = (*sColMap)(unsafe.Pointer((pFKey + 36 /* &.aCol */))).FiFrom
+ iFromCol = (*sColMap)(unsafe.Pointer(pFKey + 36)).FiFrom
}
Xsqlite3TokenInit(tls, bp+8, /* &tToCol */
(*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FaCol+uintptr(func() int32 {
- if *(*uintptr)(unsafe.Pointer(bp /* pIdx */)) != 0 {
+ if *(*uintptr)(unsafe.Pointer(bp)) != 0 {
return int32(*(*I16)(unsafe.Pointer((*Index)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* pIdx */)))).FaiColumn + uintptr(i)*2)))
}
return int32((*Table)(unsafe.Pointer(pTab)).FiPKey)
- }())*20)).FzName)
- Xsqlite3TokenInit(tls, bp+16 /* &tFromCol */, (*Column)(unsafe.Pointer((*Table)(unsafe.Pointer((*FKey)(unsafe.Pointer(pFKey)).FpFrom)).FaCol+uintptr(iFromCol)*20)).FzName)
+ }())*16)).FzCnName)
+ Xsqlite3TokenInit(tls, bp+16 /* &tFromCol */, (*Column)(unsafe.Pointer((*Table)(unsafe.Pointer((*FKey)(unsafe.Pointer(pFKey)).FpFrom)).FaCol+uintptr(iFromCol)*16)).FzCnName)
// Create the expression "OLD.zToCol = zFromCol". It is important
// that the "OLD.zToCol" term is on the LHS of the = operator, so
@@ -103404,20 +104899,20 @@ func fkActionTrigger(tls *libc.TLS, pParse uintptr, pTab uintptr, pFKey uintptr,
pWhen = Xsqlite3ExprAnd(tls, pParse, pWhen, pEq)
}
- if (action != OE_Restrict) && ((action != OE_Cascade) || (pChanges != 0)) {
+ if action != OE_Restrict && (action != OE_Cascade || pChanges != 0) {
var pNew uintptr
if action == OE_Cascade {
pNew = Xsqlite3PExpr(tls, pParse, TK_DOT,
Xsqlite3ExprAlloc(tls, db, TK_ID, bp+32 /* &tNew */, 0),
Xsqlite3ExprAlloc(tls, db, TK_ID, bp+8 /* &tToCol */, 0))
} else if action == OE_SetDflt {
- var pCol uintptr = ((*Table)(unsafe.Pointer((*FKey)(unsafe.Pointer(pFKey)).FpFrom)).FaCol + uintptr(iFromCol)*20)
+ var pCol uintptr = (*Table)(unsafe.Pointer((*FKey)(unsafe.Pointer(pFKey)).FpFrom)).FaCol + uintptr(iFromCol)*16
var pDflt uintptr
- if (int32((*Column)(unsafe.Pointer(pCol)).FcolFlags) & COLFLAG_GENERATED) != 0 {
+ if int32((*Column)(unsafe.Pointer(pCol)).FcolFlags)&COLFLAG_GENERATED != 0 {
pDflt = uintptr(0)
} else {
- pDflt = (*Column)(unsafe.Pointer(pCol)).FpDflt
+ pDflt = Xsqlite3ColumnExpr(tls, (*FKey)(unsafe.Pointer(pFKey)).FpFrom, pCol)
}
if pDflt != 0 {
pNew = Xsqlite3ExprDup(tls, db, pDflt, 0)
@@ -103443,7 +104938,7 @@ func fkActionTrigger(tls *libc.TLS, pParse uintptr, pTab uintptr, pFKey uintptr,
(*Token)(unsafe.Pointer(bp + 40 /* &tFrom */)).Fz = zFrom
(*Token)(unsafe.Pointer(bp + 40 /* &tFrom */)).Fn = uint32(nFrom)
- pRaise = Xsqlite3Expr(tls, db, TK_RAISE, ts+4250 /* "FOREIGN KEY cons..." */)
+ pRaise = Xsqlite3Expr(tls, db, TK_RAISE, ts+5056 /* "FOREIGN KEY cons..." */)
if pRaise != 0 {
(*Expr)(unsafe.Pointer(pRaise)).FaffExpr = uint8(OE_Abort)
}
@@ -103460,10 +104955,10 @@ func fkActionTrigger(tls *libc.TLS, pParse uintptr, pTab uintptr, pFKey uintptr,
(*Sqlite3)(unsafe.Pointer(db)).Flookaside.Fsz = U16(0)
pTrigger = Xsqlite3DbMallocZero(tls, db,
- (uint64(((uint32(unsafe.Sizeof(Trigger{})) + uint32(unsafe.Sizeof(TriggerStep{}))) + uint32(nFrom)) + uint32(1))))
+ uint64(uint32(unsafe.Sizeof(Trigger{}))+uint32(unsafe.Sizeof(TriggerStep{}))+uint32(nFrom)+uint32(1)))
if pTrigger != 0 {
- pStep = libc.AssignPtrUintptr(pTrigger+28 /* &.step_list */, (pTrigger + 1*36))
- (*TriggerStep)(unsafe.Pointer(pStep)).FzTarget = (pStep + 1*48)
+ pStep = libc.AssignPtrUintptr(pTrigger+28, pTrigger+1*36)
+ (*TriggerStep)(unsafe.Pointer(pStep)).FzTarget = pStep + 1*48
libc.Xmemcpy(tls, (*TriggerStep)(unsafe.Pointer(pStep)).FzTarget, zFrom, uint32(nFrom))
(*TriggerStep)(unsafe.Pointer(pStep)).FpWhere = Xsqlite3ExprDup(tls, db, pWhere, EXPRDUP_REDUCE)
@@ -103510,7 +105005,7 @@ func fkActionTrigger(tls *libc.TLS, pParse uintptr, pTab uintptr, pFKey uintptr,
(*TriggerStep)(unsafe.Pointer(pStep)).FpTrig = pTrigger
(*Trigger)(unsafe.Pointer(pTrigger)).FpSchema = (*Table)(unsafe.Pointer(pTab)).FpSchema
(*Trigger)(unsafe.Pointer(pTrigger)).FpTabSchema = (*Table)(unsafe.Pointer(pTab)).FpSchema
- *(*uintptr)(unsafe.Pointer((pFKey + 28 /* &.apTrigger */) + uintptr(iAction)*4)) = pTrigger
+ *(*uintptr)(unsafe.Pointer(pFKey + 28 + uintptr(iAction)*4)) = pTrigger
(*Trigger)(unsafe.Pointer(pTrigger)).Fop = func() uint8 {
if pChanges != 0 {
return uint8(TK_UPDATE)
@@ -103524,15 +105019,15 @@ func fkActionTrigger(tls *libc.TLS, pParse uintptr, pTab uintptr, pFKey uintptr,
// This function is called when deleting or updating a row to implement
// any required CASCADE, SET NULL or SET DEFAULT actions.
-func Xsqlite3FkActions(tls *libc.TLS, pParse uintptr, pTab uintptr, pChanges uintptr, regOld int32, aChange uintptr, bChngRowid int32) { /* sqlite3.c:122986:21: */
+func Xsqlite3FkActions(tls *libc.TLS, pParse uintptr, pTab uintptr, pChanges uintptr, regOld int32, aChange uintptr, bChngRowid int32) { /* sqlite3.c:123919:21: */
// If foreign-key support is enabled, iterate through all FKs that
// refer to table pTab. If there is an action associated with the FK
// for this operation (either update or delete), invoke the associated
// trigger sub-program.
- if ((*Sqlite3)(unsafe.Pointer((*Parse)(unsafe.Pointer(pParse)).Fdb)).Fflags & uint64(SQLITE_ForeignKeys)) != 0 {
+ if (*Sqlite3)(unsafe.Pointer((*Parse)(unsafe.Pointer(pParse)).Fdb)).Fflags&uint64(SQLITE_ForeignKeys) != 0 {
var pFKey uintptr // Iterator variable
for pFKey = Xsqlite3FkReferences(tls, pTab); pFKey != 0; pFKey = (*FKey)(unsafe.Pointer(pFKey)).FpNextTo {
- if (aChange == uintptr(0)) || (fkParentIsModified(tls, pTab, pFKey, aChange, bChngRowid) != 0) {
+ if aChange == uintptr(0) || fkParentIsModified(tls, pTab, pFKey, aChange, bChngRowid) != 0 {
var pAct uintptr = fkActionTrigger(tls, pParse, pTab, pFKey, pChanges)
if pAct != 0 {
Xsqlite3CodeRowTriggerDirect(tls, pParse, pAct, pTab, regOld, OE_Abort, 0)
@@ -103545,14 +105040,14 @@ func Xsqlite3FkActions(tls *libc.TLS, pParse uintptr, pTab uintptr, pChanges uin
// Free all memory associated with foreign key definitions attached to
// table pTab. Remove the deleted foreign keys from the Schema.fkeyHash
// hash table.
-func Xsqlite3FkDelete(tls *libc.TLS, db uintptr, pTab uintptr) { /* sqlite3.c:123018:21: */
+func Xsqlite3FkDelete(tls *libc.TLS, db uintptr, pTab uintptr) { /* sqlite3.c:123951:21: */
var pFKey uintptr // Iterator variable
var pNext uintptr // Copy of pFKey->pNextFrom
- for pFKey = (*Table)(unsafe.Pointer(pTab)).FpFKey; pFKey != 0; pFKey = pNext {
+ for pFKey = *(*uintptr)(unsafe.Pointer(pTab + 44 + 4 /* &.pFKey */)); pFKey != 0; pFKey = pNext {
// Remove the FK from the fkeyHash hash table.
- if !(db != 0) || ((*Sqlite3)(unsafe.Pointer(db)).FpnBytesFreed == uintptr(0)) {
+ if !(db != 0) || (*Sqlite3)(unsafe.Pointer(db)).FpnBytesFreed == uintptr(0) {
if (*FKey)(unsafe.Pointer(pFKey)).FpPrevTo != 0 {
(*FKey)(unsafe.Pointer((*FKey)(unsafe.Pointer(pFKey)).FpPrevTo)).FpNextTo = (*FKey)(unsafe.Pointer(pFKey)).FpNextTo
} else {
@@ -103563,7 +105058,7 @@ func Xsqlite3FkDelete(tls *libc.TLS, db uintptr, pTab uintptr) { /* sqlite3.c:12
}
return (*FKey)(unsafe.Pointer(pFKey)).FzTo
}()
- Xsqlite3HashInsert(tls, ((*Table)(unsafe.Pointer(pTab)).FpSchema + 56 /* &.fkeyHash */), z, p)
+ Xsqlite3HashInsert(tls, (*Table)(unsafe.Pointer(pTab)).FpSchema+56, z, p)
}
if (*FKey)(unsafe.Pointer(pFKey)).FpNextTo != 0 {
(*FKey)(unsafe.Pointer((*FKey)(unsafe.Pointer(pFKey)).FpNextTo)).FpPrevTo = (*FKey)(unsafe.Pointer(pFKey)).FpPrevTo
@@ -103574,8 +105069,8 @@ func Xsqlite3FkDelete(tls *libc.TLS, db uintptr, pTab uintptr) { /* sqlite3.c:12
// classified as either immediate or deferred.
// Delete any triggers created to implement actions for this FK.
- fkTriggerDelete(tls, db, *(*uintptr)(unsafe.Pointer((pFKey + 28 /* &.apTrigger */))))
- fkTriggerDelete(tls, db, *(*uintptr)(unsafe.Pointer((pFKey + 28 /* &.apTrigger */) + 1*4)))
+ fkTriggerDelete(tls, db, *(*uintptr)(unsafe.Pointer(pFKey + 28)))
+ fkTriggerDelete(tls, db, *(*uintptr)(unsafe.Pointer(pFKey + 28 + 1*4)))
pNext = (*FKey)(unsafe.Pointer(pFKey)).FpNextFrom
Xsqlite3DbFree(tls, db, pFKey)
@@ -103605,7 +105100,7 @@ func Xsqlite3FkDelete(tls *libc.TLS, db uintptr, pTab uintptr) { /* sqlite3.c:12
//
// If pTab is a WITHOUT ROWID table, then it is the PRIMARY KEY index
// for that table that is actually opened.
-func Xsqlite3OpenTable(tls *libc.TLS, pParse uintptr, iCur int32, iDb int32, pTab uintptr, opcode int32) { /* sqlite3.c:123084:21: */
+func Xsqlite3OpenTable(tls *libc.TLS, pParse uintptr, iCur int32, iDb int32, pTab uintptr, opcode int32) { /* sqlite3.c:124017:21: */
var v uintptr
v = (*Parse)(unsafe.Pointer(pParse)).FpVdbe
@@ -103617,7 +105112,7 @@ func Xsqlite3OpenTable(tls *libc.TLS, pParse uintptr, iCur int32, iDb int32, pTa
}
return uint8(0)
}(), (*Table)(unsafe.Pointer(pTab)).FzName)
- if ((*Table)(unsafe.Pointer((pTab))).FtabFlags & U32(TF_WithoutRowid)) == U32(0) {
+ if (*Table)(unsafe.Pointer(pTab)).FtabFlags&U32(TF_WithoutRowid) == U32(0) {
Xsqlite3VdbeAddOp4Int(tls, v, opcode, iCur, int32((*Table)(unsafe.Pointer(pTab)).Ftnum), iDb, int32((*Table)(unsafe.Pointer(pTab)).FnNVCol))
} else {
@@ -103647,7 +105142,7 @@ func Xsqlite3OpenTable(tls *libc.TLS, pParse uintptr, iCur int32, iDb int32, pTa
// Memory for the buffer containing the column index affinity string
// is managed along with the rest of the Index structure. It will be
// released when sqlite3DeleteIndex() is called.
-func Xsqlite3IndexAffinityStr(tls *libc.TLS, db uintptr, pIdx uintptr) uintptr { /* sqlite3.c:123131:27: */
+func Xsqlite3IndexAffinityStr(tls *libc.TLS, db uintptr, pIdx uintptr) uintptr { /* sqlite3.c:124064:27: */
if !(int32((*Index)(unsafe.Pointer(pIdx)).FzColAff) != 0) {
// The first time a column affinity string for a particular index is
// required, it is allocated and populated here. It is then stored as
@@ -103658,7 +105153,7 @@ func Xsqlite3IndexAffinityStr(tls *libc.TLS, db uintptr, pIdx uintptr) uintptr {
// up.
var n int32
var pTab uintptr = (*Index)(unsafe.Pointer(pIdx)).FpTable
- (*Index)(unsafe.Pointer(pIdx)).FzColAff = Xsqlite3DbMallocRaw(tls, uintptr(0), (uint64(int32((*Index)(unsafe.Pointer(pIdx)).FnColumn) + 1)))
+ (*Index)(unsafe.Pointer(pIdx)).FzColAff = Xsqlite3DbMallocRaw(tls, uintptr(0), uint64(int32((*Index)(unsafe.Pointer(pIdx)).FnColumn)+1))
if !(int32((*Index)(unsafe.Pointer(pIdx)).FzColAff) != 0) {
Xsqlite3OomFault(tls, db)
return uintptr(0)
@@ -103667,12 +105162,12 @@ func Xsqlite3IndexAffinityStr(tls *libc.TLS, db uintptr, pIdx uintptr) uintptr {
var x I16 = *(*I16)(unsafe.Pointer((*Index)(unsafe.Pointer(pIdx)).FaiColumn + uintptr(n)*2))
var aff uint8
if int32(x) >= 0 {
- aff = (*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FaCol + uintptr(x)*20)).Faffinity
- } else if int32(x) == (-1) {
+ aff = (*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FaCol + uintptr(x)*16)).Faffinity
+ } else if int32(x) == -1 {
aff = uint8(SQLITE_AFF_INTEGER)
} else {
- aff = Xsqlite3ExprAffinity(tls, (*ExprList_item)(unsafe.Pointer(((*Index)(unsafe.Pointer(pIdx)).FaColExpr+8 /* &.a */)+uintptr(n)*20)).FpExpr)
+ aff = Xsqlite3ExprAffinity(tls, (*ExprList_item)(unsafe.Pointer((*Index)(unsafe.Pointer(pIdx)).FaColExpr+8+uintptr(n)*20)).FpExpr)
}
if int32(aff) < SQLITE_AFF_BLOB {
aff = uint8(SQLITE_AFF_BLOB)
@@ -103688,31 +105183,70 @@ func Xsqlite3IndexAffinityStr(tls *libc.TLS, db uintptr, pIdx uintptr) uintptr {
return (*Index)(unsafe.Pointer(pIdx)).FzColAff
}
+// Make changes to the evolving bytecode to do affinity transformations
+// of values that are about to be gathered into a row for table pTab.
+//
+// For ordinary (legacy, non-strict) tables:
+// -----------------------------------------
+//
// Compute the affinity string for table pTab, if it has not already been
// computed. As an optimization, omit trailing SQLITE_AFF_BLOB affinities.
//
-// If the affinity exists (if it is no entirely SQLITE_AFF_BLOB values) and
-// if iReg>0 then code an OP_Affinity opcode that will set the affinities
-// for register iReg and following. Or if affinities exists and iReg==0,
+// If the affinity string is empty (because it was all SQLITE_AFF_BLOB entries
+// which were then optimized out) then this routine becomes a no-op.
+//
+// Otherwise if iReg>0 then code an OP_Affinity opcode that will set the
+// affinities for register iReg and following. Or if iReg==0,
// then just set the P4 operand of the previous opcode (which should be
// an OP_MakeRecord) to the affinity string.
//
// A column affinity string has one character per column:
//
-// Character Column affinity
-// ------------------------------
-// 'A' BLOB
-// 'B' TEXT
-// 'C' NUMERIC
-// 'D' INTEGER
-// 'E' REAL
-func Xsqlite3TableAffinity(tls *libc.TLS, v uintptr, pTab uintptr, iReg int32) { /* sqlite3.c:123190:21: */
+// Character Column affinity
+// --------- ---------------
+// 'A' BLOB
+// 'B' TEXT
+// 'C' NUMERIC
+// 'D' INTEGER
+// 'E' REAL
+//
+// For STRICT tables:
+// ------------------
+//
+// Generate an appropropriate OP_TypeCheck opcode that will verify the
+// datatypes against the column definitions in pTab. If iReg==0, that
+// means an OP_MakeRecord opcode has already been generated and should be
+// the last opcode generated. The new OP_TypeCheck needs to be inserted
+// before the OP_MakeRecord. The new OP_TypeCheck should use the same
+// register set as the OP_MakeRecord. If iReg>0 then register iReg is
+// the first of a series of registers that will form the new record.
+// Apply the type checking to that array of registers.
+func Xsqlite3TableAffinity(tls *libc.TLS, v uintptr, pTab uintptr, iReg int32) { /* sqlite3.c:124143:21: */
var i int32
var j int32
- var zColAff uintptr = (*Table)(unsafe.Pointer(pTab)).FzColAff
+ var zColAff uintptr
+ if (*Table)(unsafe.Pointer(pTab)).FtabFlags&U32(TF_Strict) != 0 {
+ if iReg == 0 {
+ // Move the previous opcode (which should be OP_MakeRecord) forward
+ // by one slot and insert a new OP_TypeCheck where the current
+ // OP_MakeRecord is found
+ var pPrev uintptr
+ Xsqlite3VdbeAppendP4(tls, v, pTab, -6)
+ pPrev = Xsqlite3VdbeGetOp(tls, v, -1)
+
+ (*VdbeOp)(unsafe.Pointer(pPrev)).Fopcode = U8(OP_TypeCheck)
+ Xsqlite3VdbeAddOp3(tls, v, OP_MakeRecord, (*VdbeOp)(unsafe.Pointer(pPrev)).Fp1, (*VdbeOp)(unsafe.Pointer(pPrev)).Fp2, (*VdbeOp)(unsafe.Pointer(pPrev)).Fp3)
+ } else {
+ // Insert an isolated OP_Typecheck
+ Xsqlite3VdbeAddOp2(tls, v, OP_TypeCheck, iReg, int32((*Table)(unsafe.Pointer(pTab)).FnNVCol))
+ Xsqlite3VdbeAppendP4(tls, v, pTab, -6)
+ }
+ return
+ }
+ zColAff = (*Table)(unsafe.Pointer(pTab)).FzColAff
if zColAff == uintptr(0) {
var db uintptr = Xsqlite3VdbeDb(tls, v)
- zColAff = Xsqlite3DbMallocRaw(tls, uintptr(0), (uint64(int32((*Table)(unsafe.Pointer(pTab)).FnCol) + 1)))
+ zColAff = Xsqlite3DbMallocRaw(tls, uintptr(0), uint64(int32((*Table)(unsafe.Pointer(pTab)).FnCol)+1))
if !(zColAff != 0) {
Xsqlite3OomFault(tls, db)
return
@@ -103720,21 +105254,22 @@ func Xsqlite3TableAffinity(tls *libc.TLS, v uintptr, pTab uintptr, iReg int32) {
for i = libc.AssignInt32(&j, 0); i < int32((*Table)(unsafe.Pointer(pTab)).FnCol); i++ {
- if (int32((*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FaCol+uintptr(i)*20)).FcolFlags) & COLFLAG_VIRTUAL) == 0 {
- *(*uint8)(unsafe.Pointer(zColAff + uintptr(libc.PostIncInt32(&j, 1)))) = (*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FaCol + uintptr(i)*20)).Faffinity
+ if int32((*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FaCol+uintptr(i)*16)).FcolFlags)&COLFLAG_VIRTUAL == 0 {
+ *(*uint8)(unsafe.Pointer(zColAff + uintptr(libc.PostIncInt32(&j, 1)))) = (*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FaCol + uintptr(i)*16)).Faffinity
}
}
- for ok := true; ok; ok = ((j >= 0) && (int32(*(*uint8)(unsafe.Pointer(zColAff + uintptr(j)))) <= SQLITE_AFF_BLOB)) {
+ for ok := true; ok; ok = j >= 0 && int32(*(*uint8)(unsafe.Pointer(zColAff + uintptr(j)))) <= SQLITE_AFF_BLOB {
*(*uint8)(unsafe.Pointer(zColAff + uintptr(libc.PostDecInt32(&j, 1)))) = uint8(0)
}
(*Table)(unsafe.Pointer(pTab)).FzColAff = zColAff
}
- i = (int32(libc.Xstrlen(tls, zColAff) & Size_t(0x3fffffff)))
+ i = int32(libc.Xstrlen(tls, zColAff) & Size_t(0x3fffffff))
if i != 0 {
if iReg != 0 {
Xsqlite3VdbeAddOp4(tls, v, OP_Affinity, iReg, i, 0, zColAff, i)
} else {
+
Xsqlite3VdbeChangeP4(tls, v, -1, zColAff, i)
}
}
@@ -103744,12 +105279,12 @@ func Xsqlite3TableAffinity(tls *libc.TLS, v uintptr, pTab uintptr, iReg int32) {
// have been opened at any point in the VDBE program. This is used to see if
// a statement of the form "INSERT INTO <iDb, pTab> SELECT ..." can
// run without using a temporary table for the results of the SELECT.
-func readsTable(tls *libc.TLS, p uintptr, iDb int32, pTab uintptr) int32 { /* sqlite3.c:123229:12: */
+func readsTable(tls *libc.TLS, p uintptr, iDb int32, pTab uintptr) int32 { /* sqlite3.c:124204:12: */
var v uintptr = Xsqlite3GetVdbe(tls, p)
var i int32
var iEnd int32 = Xsqlite3VdbeCurrentAddr(tls, v)
var pVTab uintptr
- if (*Table)(unsafe.Pointer(pTab)).FnModuleArg != 0 {
+ if int32((*Table)(unsafe.Pointer(pTab)).FeTabType) == TABTYP_VTAB {
pVTab = Xsqlite3GetVTable(tls, (*Parse)(unsafe.Pointer(p)).Fdb, pTab)
} else {
pVTab = uintptr(0)
@@ -103758,7 +105293,7 @@ func readsTable(tls *libc.TLS, p uintptr, iDb int32, pTab uintptr) int32 { /* sq
for i = 1; i < iEnd; i++ {
var pOp uintptr = Xsqlite3VdbeGetOp(tls, v, i)
- if (int32((*VdbeOp)(unsafe.Pointer(pOp)).Fopcode) == OP_OpenRead) && ((*VdbeOp)(unsafe.Pointer(pOp)).Fp3 == iDb) {
+ if int32((*VdbeOp)(unsafe.Pointer(pOp)).Fopcode) == OP_OpenRead && (*VdbeOp)(unsafe.Pointer(pOp)).Fp3 == iDb {
var pIndex uintptr
var tnum Pgno = Pgno((*VdbeOp)(unsafe.Pointer(pOp)).Fp2)
if tnum == (*Table)(unsafe.Pointer(pTab)).Ftnum {
@@ -103770,7 +105305,7 @@ func readsTable(tls *libc.TLS, p uintptr, iDb int32, pTab uintptr) int32 { /* sq
}
}
}
- if (int32((*VdbeOp)(unsafe.Pointer(pOp)).Fopcode) == OP_VOpen) && (*(*uintptr)(unsafe.Pointer(pOp + 16 /* &.p4 */)) == pVTab) {
+ if int32((*VdbeOp)(unsafe.Pointer(pOp)).Fopcode) == OP_VOpen && *(*uintptr)(unsafe.Pointer(pOp + 16)) == pVTab {
return 1
}
@@ -103780,10 +105315,10 @@ func readsTable(tls *libc.TLS, p uintptr, iDb int32, pTab uintptr) int32 { /* sq
// This walker callback will compute the union of colFlags flags for all
// referenced columns in a CHECK constraint or generated column expression.
-func exprColumnFlagUnion(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 { /* sqlite3.c:123266:12: */
- if (int32((*Expr)(unsafe.Pointer(pExpr)).Fop) == TK_COLUMN) && (int32((*Expr)(unsafe.Pointer(pExpr)).FiColumn) >= 0) {
+func exprColumnFlagUnion(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 { /* sqlite3.c:124241:12: */
+ if int32((*Expr)(unsafe.Pointer(pExpr)).Fop) == TK_COLUMN && int32((*Expr)(unsafe.Pointer(pExpr)).FiColumn) >= 0 {
- *(*U16)(unsafe.Pointer(pWalker + 20 /* &.eCode */)) |= U16((int32((*Column)(unsafe.Pointer((*Table1)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pWalker + 24 /* &.u */)))).FaCol + uintptr((*Expr)(unsafe.Pointer(pExpr)).FiColumn)*20)).FcolFlags)))
+ *(*U16)(unsafe.Pointer(pWalker + 20)) |= U16(int32((*Column)(unsafe.Pointer((*Table1)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pWalker + 24)))).FaCol + uintptr((*Expr)(unsafe.Pointer(pExpr)).FiColumn)*16)).FcolFlags))
}
return WRC_Continue
}
@@ -103793,7 +105328,7 @@ func exprColumnFlagUnion(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 {
// or VIRTUAL columns have not yet been initialized. This routine goes
// back and computes the values for those columns based on the previously
// computed normal columns.
-func Xsqlite3ComputeGeneratedColumns(tls *libc.TLS, pParse uintptr, iRegStore int32, pTab uintptr) { /* sqlite3.c:123282:21: */
+func Xsqlite3ComputeGeneratedColumns(tls *libc.TLS, pParse uintptr, iRegStore int32, pTab uintptr) { /* sqlite3.c:124257:21: */
bp := tls.Alloc(36)
defer tls.Free(36)
@@ -103807,23 +105342,30 @@ func Xsqlite3ComputeGeneratedColumns(tls *libc.TLS, pParse uintptr, iRegStore in
// Before computing generated columns, first go through and make sure
// that appropriate affinity has been applied to the regular columns
Xsqlite3TableAffinity(tls, (*Parse)(unsafe.Pointer(pParse)).FpVdbe, pTab, iRegStore)
- if (((*Table)(unsafe.Pointer(pTab)).FtabFlags & U32(TF_HasStored)) != U32(0)) &&
- (int32((*VdbeOp)(unsafe.Pointer((libc.AssignUintptr(&pOp, Xsqlite3VdbeGetOp(tls, (*Parse)(unsafe.Pointer(pParse)).FpVdbe, -1))))).Fopcode) == OP_Affinity) {
- // Change the OP_Affinity argument to '@' (NONE) for all stored
- // columns. '@' is the no-op affinity and those columns have not
- // yet been computed.
- var ii int32
- var jj int32
- var zP4 uintptr = *(*uintptr)(unsafe.Pointer(pOp + 16 /* &.p4 */))
+ if (*Table)(unsafe.Pointer(pTab)).FtabFlags&U32(TF_HasStored) != U32(0) {
+ pOp = Xsqlite3VdbeGetOp(tls, (*Parse)(unsafe.Pointer(pParse)).FpVdbe, -1)
+ if int32((*VdbeOp)(unsafe.Pointer(pOp)).Fopcode) == OP_Affinity {
+ // Change the OP_Affinity argument to '@' (NONE) for all stored
+ // columns. '@' is the no-op affinity and those columns have not
+ // yet been computed.
+ var ii int32
+ var jj int32
+ var zP4 uintptr = *(*uintptr)(unsafe.Pointer(pOp + 16))
- for ii = libc.AssignInt32(&jj, 0); *(*uint8)(unsafe.Pointer(zP4 + uintptr(jj))) != 0; ii++ {
- if (int32((*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FaCol+uintptr(ii)*20)).FcolFlags) & COLFLAG_VIRTUAL) != 0 {
- continue
- }
- if (int32((*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FaCol+uintptr(ii)*20)).FcolFlags) & COLFLAG_STORED) != 0 {
- *(*uint8)(unsafe.Pointer(zP4 + uintptr(jj))) = uint8(SQLITE_AFF_NONE)
+ for ii = libc.AssignInt32(&jj, 0); *(*uint8)(unsafe.Pointer(zP4 + uintptr(jj))) != 0; ii++ {
+ if int32((*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FaCol+uintptr(ii)*16)).FcolFlags)&COLFLAG_VIRTUAL != 0 {
+ continue
+ }
+ if int32((*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FaCol+uintptr(ii)*16)).FcolFlags)&COLFLAG_STORED != 0 {
+ *(*uint8)(unsafe.Pointer(zP4 + uintptr(jj))) = uint8(SQLITE_AFF_NONE)
+ }
+ jj++
}
- jj++
+ } else if int32((*VdbeOp)(unsafe.Pointer(pOp)).Fopcode) == OP_TypeCheck {
+ // If an OP_TypeCheck was generated because the table is STRICT,
+ // then set the P3 operand to indicate that generated columns should
+ // not be checked
+ (*VdbeOp)(unsafe.Pointer(pOp)).Fp3 = 1
}
}
@@ -103831,13 +105373,13 @@ func Xsqlite3ComputeGeneratedColumns(tls *libc.TLS, pParse uintptr, iRegStore in
// this is a two-pass algorithm. On the first pass, mark all generated
// columns as "not available".
for i = 0; i < int32((*Table)(unsafe.Pointer(pTab)).FnCol); i++ {
- if (int32((*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FaCol+uintptr(i)*20)).FcolFlags) & COLFLAG_GENERATED) != 0 {
+ if int32((*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FaCol+uintptr(i)*16)).FcolFlags)&COLFLAG_GENERATED != 0 {
- *(*U16)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FaCol + uintptr(i)*20 + 16 /* &.colFlags */)) |= U16((COLFLAG_NOTAVAIL))
+ *(*U16)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FaCol + uintptr(i)*16 + 12)) |= U16(COLFLAG_NOTAVAIL)
}
}
- *(*uintptr)(unsafe.Pointer(bp + 8 /* &w */ + 24 /* &.u */)) = pTab
+ *(*uintptr)(unsafe.Pointer(bp + 8 + 24)) = pTab
(*Walker)(unsafe.Pointer(bp + 8 /* &w */)).FxExprCallback = *(*uintptr)(unsafe.Pointer(&struct {
f func(*libc.TLS, uintptr, uintptr) int32
}{exprColumnFlagUnion}))
@@ -103849,31 +105391,31 @@ func Xsqlite3ComputeGeneratedColumns(tls *libc.TLS, pParse uintptr, iRegStore in
// compute dependencies and mark remove the COLSPAN_NOTAVAIL mark, as
// they are needed.
(*Parse)(unsafe.Pointer(pParse)).FiSelfTab = -iRegStore
- for ok := true; ok; ok = ((pRedo != 0) && (eProgress != 0)) {
+ for ok := true; ok; ok = pRedo != 0 && eProgress != 0 {
eProgress = 0
pRedo = uintptr(0)
for i = 0; i < int32((*Table)(unsafe.Pointer(pTab)).FnCol); i++ {
- var pCol uintptr = ((*Table)(unsafe.Pointer(pTab)).FaCol + uintptr(i)*20)
- if (int32((*Column)(unsafe.Pointer(pCol)).FcolFlags) & COLFLAG_NOTAVAIL) != 0 {
+ var pCol uintptr = (*Table)(unsafe.Pointer(pTab)).FaCol + uintptr(i)*16
+ if int32((*Column)(unsafe.Pointer(pCol)).FcolFlags)&COLFLAG_NOTAVAIL != 0 {
var x int32
- *(*U16)(unsafe.Pointer(pCol + 16 /* &.colFlags */)) |= U16((COLFLAG_BUSY))
+ *(*U16)(unsafe.Pointer(pCol + 12)) |= U16(COLFLAG_BUSY)
(*Walker)(unsafe.Pointer(bp + 8 /* &w */)).FeCode = U16(0)
- Xsqlite3WalkExpr(tls, bp+8 /* &w */, (*Column)(unsafe.Pointer(pCol)).FpDflt)
- *(*U16)(unsafe.Pointer(pCol + 16 /* &.colFlags */)) &= libc.Uint16FromInt32((libc.CplInt32(COLFLAG_BUSY)))
- if (int32((*Walker)(unsafe.Pointer(bp+8 /* &w */)).FeCode) & COLFLAG_NOTAVAIL) != 0 {
+ Xsqlite3WalkExpr(tls, bp+8 /* &w */, Xsqlite3ColumnExpr(tls, pTab, pCol))
+ *(*U16)(unsafe.Pointer(pCol + 12)) &= libc.Uint16FromInt32(libc.CplInt32(COLFLAG_BUSY))
+ if int32((*Walker)(unsafe.Pointer(bp+8)).FeCode)&COLFLAG_NOTAVAIL != 0 {
pRedo = pCol
continue
}
eProgress = 1
- x = (int32(Xsqlite3TableColumnToStorage(tls, pTab, int16(i))) + iRegStore)
- Xsqlite3ExprCodeGeneratedColumn(tls, pParse, pCol, x)
- *(*U16)(unsafe.Pointer(pCol + 16 /* &.colFlags */)) &= libc.Uint16FromInt32((libc.CplInt32(COLFLAG_NOTAVAIL)))
+ x = int32(Xsqlite3TableColumnToStorage(tls, pTab, int16(i))) + iRegStore
+ Xsqlite3ExprCodeGeneratedColumn(tls, pParse, pTab, pCol, x)
+ *(*U16)(unsafe.Pointer(pCol + 12)) &= libc.Uint16FromInt32(libc.CplInt32(COLFLAG_NOTAVAIL))
}
}
}
if pRedo != 0 {
- Xsqlite3ErrorMsg(tls, pParse, ts+6944 /* "generated column..." */, libc.VaList(bp, (*Column)(unsafe.Pointer(pRedo)).FzName))
+ Xsqlite3ErrorMsg(tls, pParse, ts+7837 /* "generated column..." */, libc.VaList(bp, (*Column)(unsafe.Pointer(pRedo)).FzCnName))
}
(*Parse)(unsafe.Pointer(pParse)).FiSelfTab = 0
}
@@ -103899,11 +105441,11 @@ func Xsqlite3ComputeGeneratedColumns(tls *libc.TLS, pParse uintptr, iRegStore in
//
// The 2nd register is the one that is returned. That is all the
// insert routine needs to know about.
-func autoIncBegin(tls *libc.TLS, pParse uintptr, iDb int32, pTab uintptr) int32 { /* sqlite3.c:123400:12: */
+func autoIncBegin(tls *libc.TLS, pParse uintptr, iDb int32, pTab uintptr) int32 { /* sqlite3.c:124381:12: */
var memId int32 = 0 // Register holding maximum rowid
- if (((*Table)(unsafe.Pointer(pTab)).FtabFlags & U32(TF_Autoincrement)) != U32(0)) &&
- (((*Sqlite3)(unsafe.Pointer((*Parse)(unsafe.Pointer(pParse)).Fdb)).FmDbFlags & U32(DBFLAG_Vacuum)) == U32(0)) {
+ if (*Table)(unsafe.Pointer(pTab)).FtabFlags&U32(TF_Autoincrement) != U32(0) &&
+ (*Sqlite3)(unsafe.Pointer((*Parse)(unsafe.Pointer(pParse)).Fdb)).FmDbFlags&U32(DBFLAG_Vacuum) == U32(0) {
var pToplevel uintptr = func() uintptr {
if (*Parse)(unsafe.Pointer(pParse)).FpToplevel != 0 {
return (*Parse)(unsafe.Pointer(pParse)).FpToplevel
@@ -103916,17 +105458,17 @@ func autoIncBegin(tls *libc.TLS, pParse uintptr, iDb int32, pTab uintptr) int32
// Verify that the sqlite_sequence table exists and is an ordinary
// rowid table with exactly two columns.
// Ticket d8dc2b3a58cd5dc2918a1d4acb 2018-05-23
- if (((pSeqTab == uintptr(0)) ||
- !(((*Table)(unsafe.Pointer((pSeqTab))).FtabFlags & U32(TF_WithoutRowid)) == U32(0))) ||
- ((*Table)(unsafe.Pointer(pSeqTab)).FnModuleArg != 0)) ||
- (int32((*Table)(unsafe.Pointer(pSeqTab)).FnCol) != 2) {
+ if pSeqTab == uintptr(0) ||
+ !((*Table)(unsafe.Pointer(pSeqTab)).FtabFlags&U32(TF_WithoutRowid) == U32(0)) ||
+ int32((*Table)(unsafe.Pointer(pSeqTab)).FeTabType) == TABTYP_VTAB ||
+ int32((*Table)(unsafe.Pointer(pSeqTab)).FnCol) != 2 {
(*Parse)(unsafe.Pointer(pParse)).FnErr++
- (*Parse)(unsafe.Pointer(pParse)).Frc = (SQLITE_CORRUPT | (int32(2) << 8))
+ (*Parse)(unsafe.Pointer(pParse)).Frc = SQLITE_CORRUPT | int32(2)<<8
return 0
}
pInfo = (*Parse)(unsafe.Pointer(pToplevel)).FpAinc
- for (pInfo != 0) && ((*AutoincInfo)(unsafe.Pointer(pInfo)).FpTab != pTab) {
+ for pInfo != 0 && (*AutoincInfo)(unsafe.Pointer(pInfo)).FpTab != pTab {
pInfo = (*AutoincInfo)(unsafe.Pointer(pInfo)).FpNext
}
if pInfo == uintptr(0) {
@@ -103944,7 +105486,7 @@ func autoIncBegin(tls *libc.TLS, pParse uintptr, iDb int32, pTab uintptr) int32
(*AutoincInfo)(unsafe.Pointer(pInfo)).FiDb = iDb
(*Parse)(unsafe.Pointer(pToplevel)).FnMem++ // Register to hold name of table
(*AutoincInfo)(unsafe.Pointer(pInfo)).FregCtr = libc.PreIncInt32(&(*Parse)(unsafe.Pointer(pToplevel)).FnMem, 1) // Max rowid register
- *(*int32)(unsafe.Pointer(pToplevel + 44 /* &.nMem */)) += (2) // Rowid in sqlite_sequence + orig max val
+ *(*int32)(unsafe.Pointer(pToplevel + 44)) += 2 // Rowid in sqlite_sequence + orig max val
}
memId = (*AutoincInfo)(unsafe.Pointer(pInfo)).FregCtr
}
@@ -103953,7 +105495,7 @@ func autoIncBegin(tls *libc.TLS, pParse uintptr, iDb int32, pTab uintptr) int32
// This routine generates code that will initialize all of the
// register used by the autoincrement tracker.
-func Xsqlite3AutoincrementBegin(tls *libc.TLS, pParse uintptr) { /* sqlite3.c:123451:21: */
+func Xsqlite3AutoincrementBegin(tls *libc.TLS, pParse uintptr) { /* sqlite3.c:124432:21: */
var p uintptr // Information about an AUTOINCREMENT
var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb // The database connection
var pDb uintptr // Database only autoinc table
@@ -103966,25 +105508,25 @@ func Xsqlite3AutoincrementBegin(tls *libc.TLS, pParse uintptr) { /* sqlite3.c:12
// We failed long ago if this is not so
for p = (*Parse)(unsafe.Pointer(pParse)).FpAinc; p != 0; p = (*AutoincInfo)(unsafe.Pointer(p)).FpNext {
var aOp uintptr
- pDb = ((*Sqlite3)(unsafe.Pointer(db)).FaDb + uintptr((*AutoincInfo)(unsafe.Pointer(p)).FiDb)*16)
+ pDb = (*Sqlite3)(unsafe.Pointer(db)).FaDb + uintptr((*AutoincInfo)(unsafe.Pointer(p)).FiDb)*16
memId = (*AutoincInfo)(unsafe.Pointer(p)).FregCtr
Xsqlite3OpenTable(tls, pParse, 0, (*AutoincInfo)(unsafe.Pointer(p)).FiDb, (*Schema)(unsafe.Pointer((*Db)(unsafe.Pointer(pDb)).FpSchema)).FpSeqTab, OP_OpenRead)
- Xsqlite3VdbeLoadString(tls, v, (memId - 1), (*Table)(unsafe.Pointer((*AutoincInfo)(unsafe.Pointer(p)).FpTab)).FzName)
- aOp = Xsqlite3VdbeAddOpList(tls, v, (int32(uint32(unsafe.Sizeof(autoInc)) / uint32(unsafe.Sizeof(VdbeOpList{})))), uintptr(unsafe.Pointer(&autoInc)), iLn1)
+ Xsqlite3VdbeLoadString(tls, v, memId-1, (*Table)(unsafe.Pointer((*AutoincInfo)(unsafe.Pointer(p)).FpTab)).FzName)
+ aOp = Xsqlite3VdbeAddOpList(tls, v, int32(uint32(unsafe.Sizeof(autoInc))/uint32(unsafe.Sizeof(VdbeOpList{}))), uintptr(unsafe.Pointer(&autoInc)), iLn1)
if aOp == uintptr(0) {
break
}
(*VdbeOp)(unsafe.Pointer(aOp)).Fp2 = memId
- (*VdbeOp)(unsafe.Pointer(aOp)).Fp3 = (memId + 2)
+ (*VdbeOp)(unsafe.Pointer(aOp)).Fp3 = memId + 2
(*VdbeOp)(unsafe.Pointer(aOp + 2*20)).Fp3 = memId
- (*VdbeOp)(unsafe.Pointer(aOp + 3*20)).Fp1 = (memId - 1)
+ (*VdbeOp)(unsafe.Pointer(aOp + 3*20)).Fp1 = memId - 1
(*VdbeOp)(unsafe.Pointer(aOp + 3*20)).Fp3 = memId
(*VdbeOp)(unsafe.Pointer(aOp + 3*20)).Fp5 = U16(SQLITE_JUMPIFNULL)
- (*VdbeOp)(unsafe.Pointer(aOp + 4*20)).Fp2 = (memId + 1)
+ (*VdbeOp)(unsafe.Pointer(aOp + 4*20)).Fp2 = memId + 1
(*VdbeOp)(unsafe.Pointer(aOp + 5*20)).Fp3 = memId
(*VdbeOp)(unsafe.Pointer(aOp + 6*20)).Fp1 = memId
- (*VdbeOp)(unsafe.Pointer(aOp + 7*20)).Fp2 = (memId + 2)
+ (*VdbeOp)(unsafe.Pointer(aOp + 7*20)).Fp2 = memId + 2
(*VdbeOp)(unsafe.Pointer(aOp + 7*20)).Fp1 = memId
(*VdbeOp)(unsafe.Pointer(aOp + 10*20)).Fp2 = memId
if (*Parse)(unsafe.Pointer(pParse)).FnTab == 0 {
@@ -103993,7 +105535,7 @@ func Xsqlite3AutoincrementBegin(tls *libc.TLS, pParse uintptr) { /* sqlite3.c:12
}
}
-var iLn1 int32 = 0 /* sqlite3.c:123465:22 */
+var iLn1 int32 = 0 /* sqlite3.c:124446:22 */
var autoInc = [12]VdbeOpList{
/* 0 */ {Fopcode: U8(OP_Null)},
/* 1 */ {Fopcode: U8(OP_Rewind), Fp2: int8(10)},
@@ -104007,7 +105549,7 @@ var autoInc = [12]VdbeOpList{
/* 9 */ {Fopcode: U8(OP_Next), Fp2: int8(2)},
/* 10 */ {Fopcode: U8(OP_Integer)},
/* 11 */ {Fopcode: U8(OP_Close)},
-} /* sqlite3.c:123466:29 */
+} /* sqlite3.c:124447:29 */
// Update the maximum rowid for an autoincrement calculation.
//
@@ -104015,7 +105557,7 @@ var autoInc = [12]VdbeOpList{
// new rowid that is about to be inserted. If that new rowid is
// larger than the maximum rowid in the memId memory cell, then the
// memory cell is updated.
-func autoIncStep(tls *libc.TLS, pParse uintptr, memId int32, regRowid int32) { /* sqlite3.c:123512:13: */
+func autoIncStep(tls *libc.TLS, pParse uintptr, memId int32, regRowid int32) { /* sqlite3.c:124493:13: */
if memId > 0 {
Xsqlite3VdbeAddOp2(tls, (*Parse)(unsafe.Pointer(pParse)).FpVdbe, OP_MemMax, memId, regRowid)
}
@@ -104026,47 +105568,47 @@ func autoIncStep(tls *libc.TLS, pParse uintptr, memId int32, regRowid int32) { /
// Every statement that might do an INSERT into an autoincrement
// table (either directly or through triggers) needs to call this
// routine just before the "exit" code.
-func autoIncrementEnd(tls *libc.TLS, pParse uintptr) { /* sqlite3.c:123525:29: */
+func autoIncrementEnd(tls *libc.TLS, pParse uintptr) { /* sqlite3.c:124506:29: */
var p uintptr
var v uintptr = (*Parse)(unsafe.Pointer(pParse)).FpVdbe
var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb
for p = (*Parse)(unsafe.Pointer(pParse)).FpAinc; p != 0; p = (*AutoincInfo)(unsafe.Pointer(p)).FpNext {
var aOp uintptr
- var pDb uintptr = ((*Sqlite3)(unsafe.Pointer(db)).FaDb + uintptr((*AutoincInfo)(unsafe.Pointer(p)).FiDb)*16)
+ var pDb uintptr = (*Sqlite3)(unsafe.Pointer(db)).FaDb + uintptr((*AutoincInfo)(unsafe.Pointer(p)).FiDb)*16
var iRec int32
var memId int32 = (*AutoincInfo)(unsafe.Pointer(p)).FregCtr
iRec = Xsqlite3GetTempReg(tls, pParse)
- Xsqlite3VdbeAddOp3(tls, v, OP_Le, (memId + 2), (Xsqlite3VdbeCurrentAddr(tls, v) + 7), memId)
+ Xsqlite3VdbeAddOp3(tls, v, OP_Le, memId+2, Xsqlite3VdbeCurrentAddr(tls, v)+7, memId)
Xsqlite3OpenTable(tls, pParse, 0, (*AutoincInfo)(unsafe.Pointer(p)).FiDb, (*Schema)(unsafe.Pointer((*Db)(unsafe.Pointer(pDb)).FpSchema)).FpSeqTab, OP_OpenWrite)
- aOp = Xsqlite3VdbeAddOpList(tls, v, (int32(uint32(unsafe.Sizeof(autoIncEnd)) / uint32(unsafe.Sizeof(VdbeOpList{})))), uintptr(unsafe.Pointer(&autoIncEnd)), iLn2)
+ aOp = Xsqlite3VdbeAddOpList(tls, v, int32(uint32(unsafe.Sizeof(autoIncEnd))/uint32(unsafe.Sizeof(VdbeOpList{}))), uintptr(unsafe.Pointer(&autoIncEnd)), iLn2)
if aOp == uintptr(0) {
break
}
- (*VdbeOp)(unsafe.Pointer(aOp)).Fp1 = (memId + 1)
- (*VdbeOp)(unsafe.Pointer(aOp + 1*20)).Fp2 = (memId + 1)
- (*VdbeOp)(unsafe.Pointer(aOp + 2*20)).Fp1 = (memId - 1)
+ (*VdbeOp)(unsafe.Pointer(aOp)).Fp1 = memId + 1
+ (*VdbeOp)(unsafe.Pointer(aOp + 1*20)).Fp2 = memId + 1
+ (*VdbeOp)(unsafe.Pointer(aOp + 2*20)).Fp1 = memId - 1
(*VdbeOp)(unsafe.Pointer(aOp + 2*20)).Fp3 = iRec
(*VdbeOp)(unsafe.Pointer(aOp + 3*20)).Fp2 = iRec
- (*VdbeOp)(unsafe.Pointer(aOp + 3*20)).Fp3 = (memId + 1)
+ (*VdbeOp)(unsafe.Pointer(aOp + 3*20)).Fp3 = memId + 1
(*VdbeOp)(unsafe.Pointer(aOp + 3*20)).Fp5 = U16(OPFLAG_APPEND)
Xsqlite3ReleaseTempReg(tls, pParse, iRec)
}
}
-var iLn2 int32 = 0 /* sqlite3.c:123532:22 */
+var iLn2 int32 = 0 /* sqlite3.c:124513:22 */
var autoIncEnd = [5]VdbeOpList{
/* 0 */ {Fopcode: U8(OP_NotNull), Fp2: int8(2)},
/* 1 */ {Fopcode: U8(OP_NewRowid)},
/* 2 */ {Fopcode: U8(OP_MakeRecord), Fp2: int8(2)},
/* 3 */ {Fopcode: U8(OP_Insert)},
/* 4 */ {Fopcode: U8(OP_Close)},
-} /* sqlite3.c:123533:29 */
+} /* sqlite3.c:124514:29 */
-func Xsqlite3AutoincrementEnd(tls *libc.TLS, pParse uintptr) { /* sqlite3.c:123562:21: */
+func Xsqlite3AutoincrementEnd(tls *libc.TLS, pParse uintptr) { /* sqlite3.c:124543:21: */
if (*Parse)(unsafe.Pointer(pParse)).FpAinc != 0 {
autoIncrementEnd(tls, pParse)
}
@@ -104167,7 +105709,7 @@ func Xsqlite3AutoincrementEnd(tls *libc.TLS, pParse uintptr) { /* sqlite3.c:1235
// transfer values form intermediate table into <table>
// end loop
// D: cleanup
-func Xsqlite3Insert(tls *libc.TLS, pParse uintptr, pTabList uintptr, pSelect uintptr, pColumn uintptr, onError int32, pUpsert uintptr) { /* sqlite3.c:123681:21: */
+func Xsqlite3Insert(tls *libc.TLS, pParse uintptr, pTabList uintptr, pSelect uintptr, pColumn uintptr, onError int32, pUpsert uintptr) { /* sqlite3.c:124662:21: */
bp := tls.Alloc(148)
defer tls.Free(148)
@@ -104260,7 +105802,7 @@ func Xsqlite3Insert(tls *libc.TLS, pParse uintptr, pTabList uintptr, pSelect uin
aRegIdx = uintptr(0) // Mask of trigger times
db = (*Parse)(unsafe.Pointer(pParse)).Fdb
- if !(((*Parse)(unsafe.Pointer(pParse)).FnErr != 0) || ((*Sqlite3)(unsafe.Pointer(db)).FmallocFailed != 0)) {
+ if !((*Parse)(unsafe.Pointer(pParse)).FnErr != 0 || (*Sqlite3)(unsafe.Pointer(db)).FmallocFailed != 0) {
goto __1
}
goto insert_cleanup
@@ -104271,7 +105813,7 @@ __1:
// If the Select object is really just a simple VALUES() list with a
// single row (the common case) then keep that one row of values
// and discard the other (unused) parts of the pSelect object
- if !(((pSelect != 0) && (((*Select)(unsafe.Pointer(pSelect)).FselFlags & U32(SF_Values)) != U32(0))) && ((*Select)(unsafe.Pointer(pSelect)).FpPrior == uintptr(0))) {
+ if !(pSelect != 0 && (*Select)(unsafe.Pointer(pSelect)).FselFlags&U32(SF_Values) != U32(0) && (*Select)(unsafe.Pointer(pSelect)).FpPrior == uintptr(0)) {
goto __2
}
pList = (*Select)(unsafe.Pointer(pSelect)).FpEList
@@ -104299,12 +105841,12 @@ __3:
goto insert_cleanup
__4:
;
- withoutRowid = libc.BoolUint8(!(((*Table)(unsafe.Pointer((pTab))).FtabFlags & U32(TF_WithoutRowid)) == U32(0)))
+ withoutRowid = libc.BoolUint8(!((*Table)(unsafe.Pointer(pTab)).FtabFlags&U32(TF_WithoutRowid) == U32(0)))
// Figure out if we have any triggers and if the table being
// inserted into is a view
pTrigger = Xsqlite3TriggersExist(tls, pParse, pTab, TK_INSERT, uintptr(0), bp+72 /* &tmask */)
- isView = (libc.Bool32((*Table)(unsafe.Pointer(pTab)).FpSelect != uintptr(0)))
+ isView = libc.Bool32(int32((*Table)(unsafe.Pointer(pTab)).FeTabType) == TABTYP_VIEW)
// If pTab is really a view, make sure it has been initialized.
// ViewGetColumnNames() is a no-op if pTab is not a view.
@@ -104316,7 +105858,7 @@ __5:
;
// Cannot insert into a read-only table.
- if !(Xsqlite3IsReadOnly(tls, pParse, pTab, *(*int32)(unsafe.Pointer(bp + 72 /* tmask */))) != 0) {
+ if !(Xsqlite3IsReadOnly(tls, pParse, pTab, *(*int32)(unsafe.Pointer(bp + 72))) != 0) {
goto __6
}
goto insert_cleanup
@@ -104337,7 +105879,7 @@ __7:
Xsqlite3VdbeCountChanges(tls, v)
__8:
;
- Xsqlite3BeginWriteOperation(tls, pParse, (libc.Bool32((pSelect != 0) || (pTrigger != 0))), iDb)
+ Xsqlite3BeginWriteOperation(tls, pParse, libc.Bool32(pSelect != 0 || pTrigger != 0), iDb)
// If the statement is of the form
//
@@ -104347,7 +105889,7 @@ __8:
// very fast and which reduce fragmentation of indices.
//
// This is the 2nd template.
- if !((pColumn == uintptr(0)) && (xferOptimization(tls, pParse, pTab, pSelect, onError, iDb) != 0)) {
+ if !(pColumn == uintptr(0) && xferOptimization(tls, pParse, pTab, pSelect, onError, iDb) != 0) {
goto __9
}
@@ -104361,16 +105903,16 @@ __9:
// Allocate a block registers to hold the rowid and the values
// for all columns of the new row.
- regRowid = libc.AssignInt32(&regIns, ((*Parse)(unsafe.Pointer(pParse)).FnMem + 1))
- *(*int32)(unsafe.Pointer(pParse + 44 /* &.nMem */)) += (int32((*Table)(unsafe.Pointer(pTab)).FnCol) + 1)
- if !((*Table)(unsafe.Pointer(pTab)).FnModuleArg != 0) {
+ regRowid = libc.AssignInt32(&regIns, (*Parse)(unsafe.Pointer(pParse)).FnMem+1)
+ *(*int32)(unsafe.Pointer(pParse + 44)) += int32((*Table)(unsafe.Pointer(pTab)).FnCol) + 1
+ if !(int32((*Table)(unsafe.Pointer(pTab)).FeTabType) == TABTYP_VTAB) {
goto __10
}
regRowid++
(*Parse)(unsafe.Pointer(pParse)).FnMem++
__10:
;
- regData = (regRowid + 1)
+ regData = regRowid + 1
// If the INSERT statement included an IDLIST term, then make sure
// all elements of the IDLIST really are columns of the table and
@@ -104390,7 +105932,7 @@ __10:
// order. This enables an optimization that avoids shuffling the
// columns into storage order. False negatives are harmless,
// but false positives will cause database corruption.
- bIdListInOrder = (U8(libc.Bool32(((*Table)(unsafe.Pointer(pTab)).FtabFlags & (U32(TF_OOOHidden | TF_HasStored))) == U32(0))))
+ bIdListInOrder = U8(libc.Bool32((*Table)(unsafe.Pointer(pTab)).FtabFlags&U32(TF_OOOHidden|TF_HasStored) == U32(0)))
if !(pColumn != 0) {
goto __11
}
@@ -104417,7 +105959,7 @@ __18:
if !(j < int32((*Table)(unsafe.Pointer(pTab)).FnCol)) {
goto __20
}
- if !(Xsqlite3StrICmp(tls, (*IdList_item)(unsafe.Pointer((*IdList)(unsafe.Pointer(pColumn)).Fa+uintptr(i)*8)).FzName, (*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FaCol+uintptr(j)*20)).FzName) == 0) {
+ if !(Xsqlite3StrICmp(tls, (*IdList_item)(unsafe.Pointer((*IdList)(unsafe.Pointer(pColumn)).Fa+uintptr(i)*8)).FzName, (*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FaCol+uintptr(j)*16)).FzCnName) == 0) {
goto __21
}
(*IdList_item)(unsafe.Pointer((*IdList)(unsafe.Pointer(pColumn)).Fa + uintptr(i)*8)).Fidx = j
@@ -104433,12 +105975,12 @@ __22:
ipkColumn = i
__23:
;
- if !((int32((*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FaCol+uintptr(j)*20)).FcolFlags) & (COLFLAG_STORED | COLFLAG_VIRTUAL)) != 0) {
+ if !(int32((*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FaCol+uintptr(j)*16)).FcolFlags)&(COLFLAG_STORED|COLFLAG_VIRTUAL) != 0) {
goto __24
}
Xsqlite3ErrorMsg(tls, pParse,
- ts+14169, /* "cannot INSERT in..." */
- libc.VaList(bp, (*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FaCol+uintptr(j)*20)).FzName))
+ ts+15351, /* "cannot INSERT in..." */
+ libc.VaList(bp, (*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FaCol+uintptr(j)*16)).FzCnName))
goto insert_cleanup
__24:
;
@@ -104455,15 +105997,15 @@ __20:
if !(j >= int32((*Table)(unsafe.Pointer(pTab)).FnCol)) {
goto __25
}
- if !((Xsqlite3IsRowid(tls, (*IdList_item)(unsafe.Pointer((*IdList)(unsafe.Pointer(pColumn)).Fa+uintptr(i)*8)).FzName) != 0) && !(withoutRowid != 0)) {
+ if !(Xsqlite3IsRowid(tls, (*IdList_item)(unsafe.Pointer((*IdList)(unsafe.Pointer(pColumn)).Fa+uintptr(i)*8)).FzName) != 0 && !(withoutRowid != 0)) {
goto __26
}
ipkColumn = i
bIdListInOrder = U8(0)
goto __27
__26:
- Xsqlite3ErrorMsg(tls, pParse, ts+14210, /* "table %S has no ..." */
- libc.VaList(bp+8, pTabList+8 /* &.a */, (*IdList_item)(unsafe.Pointer((*IdList)(unsafe.Pointer(pColumn)).Fa+uintptr(i)*8)).FzName))
+ Xsqlite3ErrorMsg(tls, pParse, ts+15392, /* "table %S has no ..." */
+ libc.VaList(bp+8, pTabList+8, (*IdList_item)(unsafe.Pointer((*IdList)(unsafe.Pointer(pColumn)).Fa+uintptr(i)*8)).FzName))
(*Parse)(unsafe.Pointer(pParse)).FcheckSchema = U8(1)
goto insert_cleanup
__27:
@@ -104489,7 +106031,7 @@ __11:
} // Result code
regYield = libc.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1)
- addrTop = (Xsqlite3VdbeCurrentAddr(tls, v) + 1)
+ addrTop = Xsqlite3VdbeCurrentAddr(tls, v) + 1
Xsqlite3VdbeAddOp3(tls, v, OP_InitCoroutine, regYield, 0, addrTop)
Xsqlite3SelectDestInit(tls, bp+76 /* &dest */, SRT_Coroutine, regYield)
(*SelectDest)(unsafe.Pointer(bp + 76 /* &dest */)).FiSdst = func() int32 {
@@ -104501,14 +106043,14 @@ __11:
(*SelectDest)(unsafe.Pointer(bp + 76 /* &dest */)).FnSdst = int32((*Table)(unsafe.Pointer(pTab)).FnCol)
rc = Xsqlite3Select(tls, pParse, pSelect, bp+76 /* &dest */)
regFromSelect = (*SelectDest)(unsafe.Pointer(bp + 76 /* &dest */)).FiSdst
- if !(((rc != 0) || ((*Sqlite3)(unsafe.Pointer(db)).FmallocFailed != 0)) || ((*Parse)(unsafe.Pointer(pParse)).FnErr != 0)) {
+ if !(rc != 0 || (*Sqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 || (*Parse)(unsafe.Pointer(pParse)).FnErr != 0) {
goto __30
}
goto insert_cleanup
__30:
;
Xsqlite3VdbeEndCoroutine(tls, v, regYield)
- Xsqlite3VdbeJumpHere(tls, v, (addrTop - 1)) // label B:
+ Xsqlite3VdbeJumpHere(tls, v, addrTop-1) // label B:
nColumn = (*ExprList)(unsafe.Pointer((*Select)(unsafe.Pointer(pSelect)).FpEList)).FnExpr
@@ -104520,7 +106062,7 @@ __30:
// A temp table must be used if the table being updated is also one
// of the tables being read by the SELECT statement. Also use a
// temp table in the case of row triggers.
- if !((pTrigger != 0) || (readsTable(tls, pParse, iDb, pTab) != 0)) {
+ if !(pTrigger != 0 || readsTable(tls, pParse, iDb, pTab) != 0) {
goto __31
}
useTempTable = U8(1)
@@ -104555,7 +106097,7 @@ __28:
goto __33
}
nColumn = (*ExprList)(unsafe.Pointer(pList)).FnExpr
- if !(Xsqlite3ResolveExprListNames(tls, bp+104 /* &sNC */, pList) != 0) {
+ if !(Xsqlite3ResolveExprListNames(tls, bp+104, pList) != 0) {
goto __35
}
goto insert_cleanup
@@ -104572,20 +106114,20 @@ __29:
// If there is no IDLIST term but the table has an integer primary
// key, the set the ipkColumn variable to the integer primary key
// column index in the original table definition.
- if !((pColumn == uintptr(0)) && (nColumn > 0)) {
+ if !(pColumn == uintptr(0) && nColumn > 0) {
goto __36
}
ipkColumn = int32((*Table)(unsafe.Pointer(pTab)).FiPKey)
- if !((ipkColumn >= 0) && (((*Table)(unsafe.Pointer(pTab)).FtabFlags & U32(TF_HasGenerated)) != U32(0))) {
+ if !(ipkColumn >= 0 && (*Table)(unsafe.Pointer(pTab)).FtabFlags&U32(TF_HasGenerated) != U32(0)) {
goto __37
}
- i = (ipkColumn - 1)
+ i = ipkColumn - 1
__38:
if !(i >= 0) {
goto __40
}
- if !((int32((*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FaCol+uintptr(i)*20)).FcolFlags) & COLFLAG_GENERATED) != 0) {
+ if !(int32((*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FaCol+uintptr(i)*16)).FcolFlags)&COLFLAG_GENERATED != 0) {
goto __41
}
@@ -104605,7 +106147,7 @@ __37:
// Make sure the number of columns in the source data matches the number
// of columns to be inserted into the table.
- if !(((*Table)(unsafe.Pointer(pTab)).FtabFlags & (U32(TF_HasGenerated | TF_HasHidden))) != U32(0)) {
+ if !((*Table)(unsafe.Pointer(pTab)).FtabFlags&U32(TF_HasGenerated|TF_HasHidden) != U32(0)) {
goto __42
}
i = 0
@@ -104613,7 +106155,7 @@ __43:
if !(i < int32((*Table)(unsafe.Pointer(pTab)).FnCol)) {
goto __45
}
- if !((int32((*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FaCol+uintptr(i)*20)).FcolFlags) & COLFLAG_NOINSERT) != 0) {
+ if !(int32((*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FaCol+uintptr(i)*16)).FcolFlags)&COLFLAG_NOINSERT != 0) {
goto __46
}
nHidden++
@@ -104628,29 +106170,29 @@ __45:
;
__42:
;
- if !(nColumn != (int32((*Table)(unsafe.Pointer(pTab)).FnCol) - nHidden)) {
+ if !(nColumn != int32((*Table)(unsafe.Pointer(pTab)).FnCol)-nHidden) {
goto __47
}
Xsqlite3ErrorMsg(tls, pParse,
- ts+14242, /* "table %S has %d ..." */
- libc.VaList(bp+24, pTabList+8 /* &.a */, (int32((*Table)(unsafe.Pointer(pTab)).FnCol)-nHidden), nColumn))
+ ts+15424, /* "table %S has %d ..." */
+ libc.VaList(bp+24, pTabList+8, int32((*Table)(unsafe.Pointer(pTab)).FnCol)-nHidden, nColumn))
goto insert_cleanup
__47:
;
__36:
;
- if !((pColumn != uintptr(0)) && (nColumn != (*IdList)(unsafe.Pointer(pColumn)).FnId)) {
+ if !(pColumn != uintptr(0) && nColumn != (*IdList)(unsafe.Pointer(pColumn)).FnId) {
goto __48
}
- Xsqlite3ErrorMsg(tls, pParse, ts+14294 /* "%d values for %d..." */, libc.VaList(bp+48, nColumn, (*IdList)(unsafe.Pointer(pColumn)).FnId))
+ Xsqlite3ErrorMsg(tls, pParse, ts+15476 /* "%d values for %d..." */, libc.VaList(bp+48, nColumn, (*IdList)(unsafe.Pointer(pColumn)).FnId))
goto insert_cleanup
__48:
;
// Initialize the count of rows to be inserted
- if !((((((*Sqlite3)(unsafe.Pointer(db)).Fflags & (U64((uint64(0x00001))) << 32)) != uint64(0)) &&
- !(int32((*Parse)(unsafe.Pointer(pParse)).Fnested) != 0)) &&
- !(int32((*Parse)(unsafe.Pointer(pParse)).FpTriggerTab) != 0)) &&
+ if !((*Sqlite3)(unsafe.Pointer(db)).Fflags&(U64(uint64(0x00001))<<32) != uint64(0) &&
+ !(int32((*Parse)(unsafe.Pointer(pParse)).Fnested) != 0) &&
+ !(int32((*Parse)(unsafe.Pointer(pParse)).FpTriggerTab) != 0) &&
!(int32((*Parse)(unsafe.Pointer(pParse)).FbReturning) != 0)) {
goto __49
}
@@ -104660,12 +106202,12 @@ __49:
;
// If this is not a view, open the table and and all indices
- if !(!(isView != 0)) {
+ if !!(isView != 0) {
goto __50
}
nIdx = Xsqlite3OpenTableAndIndices(tls, pParse, pTab, OP_OpenWrite, uint8(0), -1, uintptr(0),
bp+136 /* &iDataCur */, bp+140 /* &iIdxCur */)
- aRegIdx = Xsqlite3DbMallocRawNN(tls, db, (uint64(uint32(unsafe.Sizeof(int32(0))) * (uint32(nIdx + 2)))))
+ aRegIdx = Xsqlite3DbMallocRawNN(tls, db, uint64(uint32(unsafe.Sizeof(int32(0)))*uint32(nIdx+2)))
if !(aRegIdx == uintptr(0)) {
goto __51
}
@@ -104680,7 +106222,7 @@ __52:
}
*(*int32)(unsafe.Pointer(aRegIdx + uintptr(i)*4)) = libc.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1)
- *(*int32)(unsafe.Pointer(pParse + 44 /* &.nMem */)) += (int32((*Index)(unsafe.Pointer(pIdx)).FnColumn))
+ *(*int32)(unsafe.Pointer(pParse + 44)) += int32((*Index)(unsafe.Pointer(pIdx)).FnColumn)
goto __53
__53:
pIdx = (*Index)(unsafe.Pointer(pIdx)).FpNext
@@ -104695,18 +106237,18 @@ __50:
if !(pUpsert != 0) {
goto __55
}
- if !((*Table)(unsafe.Pointer(pTab)).FnModuleArg != 0) {
+ if !(int32((*Table)(unsafe.Pointer(pTab)).FeTabType) == TABTYP_VTAB) {
goto __56
}
- Xsqlite3ErrorMsg(tls, pParse, ts+14319, /* "UPSERT not imple..." */
+ Xsqlite3ErrorMsg(tls, pParse, ts+15501, /* "UPSERT not imple..." */
libc.VaList(bp+64, (*Table)(unsafe.Pointer(pTab)).FzName))
goto insert_cleanup
__56:
;
- if !((*Table)(unsafe.Pointer(pTab)).FpSelect != 0) {
+ if !(int32((*Table)(unsafe.Pointer(pTab)).FeTabType) == TABTYP_VIEW) {
goto __57
}
- Xsqlite3ErrorMsg(tls, pParse, ts+14365 /* "cannot UPSERT a ..." */, 0)
+ Xsqlite3ErrorMsg(tls, pParse, ts+15547 /* "cannot UPSERT a ..." */, 0)
goto insert_cleanup
__57:
;
@@ -104716,7 +106258,7 @@ __57:
goto insert_cleanup
__58:
;
- (*SrcItem)(unsafe.Pointer((pTabList + 8 /* &.a */))).FiCursor = *(*int32)(unsafe.Pointer(bp + 136 /* iDataCur */))
+ (*SrcItem)(unsafe.Pointer(pTabList + 8)).FiCursor = *(*int32)(unsafe.Pointer(bp + 136 /* iDataCur */))
pNx = pUpsert
__59:
(*Upsert)(unsafe.Pointer(pNx)).FpUpsertSrc = pTabList
@@ -104781,7 +106323,7 @@ __64:
// tag-20191021-001: If the INTEGER PRIMARY KEY is being generated by the
// SELECT, go ahead and copy the value into the rowid slot now, so that
// the value does not get overwritten by a NULL at tag-20191021-002.
- Xsqlite3VdbeAddOp2(tls, v, OP_Copy, (regFromSelect + ipkColumn), regRowid)
+ Xsqlite3VdbeAddOp2(tls, v, OP_Copy, regFromSelect+ipkColumn, regRowid)
__67:
;
__66:
@@ -104814,11 +106356,11 @@ __68:
goto __69
__71:
;
- if !(((libc.AssignUint32(&colFlags, U32((*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FaCol+uintptr(i)*20)).FcolFlags))) & U32(COLFLAG_NOINSERT)) != U32(0)) {
+ if !(libc.AssignUint32(&colFlags, U32((*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FaCol+uintptr(i)*16)).FcolFlags))&U32(COLFLAG_NOINSERT) != U32(0)) {
goto __72
}
nHidden++
- if !((colFlags & U32(COLFLAG_VIRTUAL)) != U32(0)) {
+ if !(colFlags&U32(COLFLAG_VIRTUAL) != U32(0)) {
goto __73
}
// Virtual columns do not participate in OP_MakeRecord. So back up
@@ -104828,14 +106370,14 @@ __71:
goto __69
goto __74
__73:
- if !((colFlags & U32(COLFLAG_STORED)) != U32(0)) {
+ if !(colFlags&U32(COLFLAG_STORED) != U32(0)) {
goto __75
}
// Stored columns are computed later. But if there are BEFORE
// triggers, the slots used for stored columns will be OP_Copy-ed
// to a second block of registers, so the register needs to be
// initialized to NULL to avoid an uninitialized register read
- if !((*(*int32)(unsafe.Pointer(bp + 72 /* tmask */)) & TRIGGER_BEFORE) != 0) {
+ if !(*(*int32)(unsafe.Pointer(bp + 72))&TRIGGER_BEFORE != 0) {
goto __77
}
Xsqlite3VdbeAddOp1(tls, v, OP_SoftNull, iRegStore)
@@ -104849,7 +106391,9 @@ __75:
}
// Hidden columns that are not explicitly named in the INSERT
// get there default value
- Xsqlite3ExprCodeFactorable(tls, pParse, (*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FaCol+uintptr(i)*20)).FpDflt, iRegStore)
+ Xsqlite3ExprCodeFactorable(tls, pParse,
+ Xsqlite3ColumnExpr(tls, pTab, (*Table)(unsafe.Pointer(pTab)).FaCol+uintptr(i)*16),
+ iRegStore)
goto __69
__78:
;
@@ -104864,7 +106408,7 @@ __72:
}
j = 0
__81:
- if !((j < (*IdList)(unsafe.Pointer(pColumn)).FnId) && ((*IdList_item)(unsafe.Pointer((*IdList)(unsafe.Pointer(pColumn)).Fa+uintptr(j)*8)).Fidx != i)) {
+ if !(j < (*IdList)(unsafe.Pointer(pColumn)).FnId && (*IdList_item)(unsafe.Pointer((*IdList)(unsafe.Pointer(pColumn)).Fa+uintptr(j)*8)).Fidx != i) {
goto __83
}
goto __82
@@ -104879,7 +106423,9 @@ __83:
}
// A column not named in the insert column list gets its
// default value
- Xsqlite3ExprCodeFactorable(tls, pParse, (*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FaCol+uintptr(i)*20)).FpDflt, iRegStore)
+ Xsqlite3ExprCodeFactorable(tls, pParse,
+ Xsqlite3ColumnExpr(tls, pTab, (*Table)(unsafe.Pointer(pTab)).FaCol+uintptr(i)*16),
+ iRegStore)
goto __69
__84:
;
@@ -104890,11 +106436,13 @@ __79:
goto __85
}
// This is INSERT INTO ... DEFAULT VALUES. Load the default value.
- Xsqlite3ExprCodeFactorable(tls, pParse, (*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FaCol+uintptr(i)*20)).FpDflt, iRegStore)
+ Xsqlite3ExprCodeFactorable(tls, pParse,
+ Xsqlite3ColumnExpr(tls, pTab, (*Table)(unsafe.Pointer(pTab)).FaCol+uintptr(i)*16),
+ iRegStore)
goto __69
goto __86
__85:
- k = (i - nHidden)
+ k = i - nHidden
__86:
;
__80:
@@ -104912,12 +106460,12 @@ __87:
if !(regFromSelect != regData) {
goto __91
}
- Xsqlite3VdbeAddOp2(tls, v, OP_SCopy, (regFromSelect + k), iRegStore)
+ Xsqlite3VdbeAddOp2(tls, v, OP_SCopy, regFromSelect+k, iRegStore)
__91:
;
goto __90
__89:
- Xsqlite3ExprCode(tls, pParse, (*ExprList_item)(unsafe.Pointer((pList+8 /* &.a */)+uintptr(k)*20)).FpExpr, iRegStore)
+ Xsqlite3ExprCode(tls, pParse, (*ExprList_item)(unsafe.Pointer(pList+8+uintptr(k)*20)).FpExpr, iRegStore)
__90:
;
__88:
@@ -104933,10 +106481,10 @@ __70:
// Run the BEFORE and INSTEAD OF triggers, if there are any
endOfLoop = Xsqlite3VdbeMakeLabel(tls, pParse)
- if !((*(*int32)(unsafe.Pointer(bp + 72 /* tmask */)) & TRIGGER_BEFORE) != 0) {
+ if !(*(*int32)(unsafe.Pointer(bp + 72))&TRIGGER_BEFORE != 0) {
goto __92
}
- regCols = Xsqlite3GetTempRange(tls, pParse, (int32((*Table)(unsafe.Pointer(pTab)).FnCol) + 1))
+ regCols = Xsqlite3GetTempRange(tls, pParse, int32((*Table)(unsafe.Pointer(pTab)).FnCol)+1)
// build the NEW.* reference row. Note that if there is an INTEGER
// PRIMARY KEY into which a NULL is being inserted, that NULL will be
@@ -104957,7 +106505,7 @@ __93:
goto __96
__95:
; // Otherwise useTempTable is true
- Xsqlite3ExprCode(tls, pParse, (*ExprList_item)(unsafe.Pointer((pList+8 /* &.a */)+uintptr(ipkColumn)*20)).FpExpr, regCols)
+ Xsqlite3ExprCode(tls, pParse, (*ExprList_item)(unsafe.Pointer(pList+8+uintptr(ipkColumn)*20)).FpExpr, regCols)
__96:
;
addr1 = Xsqlite3VdbeAddOp1(tls, v, OP_NotNull, regCols)
@@ -104969,17 +106517,17 @@ __94:
// Copy the new data already generated.
- Xsqlite3VdbeAddOp3(tls, v, OP_Copy, (regRowid + 1), (regCols + 1), (int32((*Table)(unsafe.Pointer(pTab)).FnNVCol) - 1))
+ Xsqlite3VdbeAddOp3(tls, v, OP_Copy, regRowid+1, regCols+1, int32((*Table)(unsafe.Pointer(pTab)).FnNVCol)-1)
// Compute the new value for generated columns after all other
// columns have already been computed. This must be done after
// computing the ROWID in case one of the generated columns
// refers to the ROWID.
- if !(((*Table)(unsafe.Pointer(pTab)).FtabFlags & U32(TF_HasGenerated)) != 0) {
+ if !((*Table)(unsafe.Pointer(pTab)).FtabFlags&U32(TF_HasGenerated) != 0) {
goto __97
}
- Xsqlite3ComputeGeneratedColumns(tls, pParse, (regCols + 1), pTab)
+ Xsqlite3ComputeGeneratedColumns(tls, pParse, regCols+1, pTab)
__97:
;
@@ -104987,25 +106535,25 @@ __97:
// do not attempt any conversions before assembling the record.
// If this is a real table, attempt conversions as required by the
// table column affinities.
- if !(!(isView != 0)) {
+ if !!(isView != 0) {
goto __98
}
- Xsqlite3TableAffinity(tls, v, pTab, (regCols + 1))
+ Xsqlite3TableAffinity(tls, v, pTab, regCols+1)
__98:
;
// Fire BEFORE or INSTEAD OF triggers
Xsqlite3CodeRowTrigger(tls, pParse, pTrigger, TK_INSERT, uintptr(0), TRIGGER_BEFORE,
- pTab, ((regCols - int32((*Table)(unsafe.Pointer(pTab)).FnCol)) - 1), onError, endOfLoop)
+ pTab, regCols-int32((*Table)(unsafe.Pointer(pTab)).FnCol)-1, onError, endOfLoop)
- Xsqlite3ReleaseTempRange(tls, pParse, regCols, (int32((*Table)(unsafe.Pointer(pTab)).FnCol) + 1))
+ Xsqlite3ReleaseTempRange(tls, pParse, regCols, int32((*Table)(unsafe.Pointer(pTab)).FnCol)+1)
__92:
;
- if !(!(isView != 0)) {
+ if !!(isView != 0) {
goto __99
}
- if !((*Table)(unsafe.Pointer(pTab)).FnModuleArg != 0) {
+ if !(int32((*Table)(unsafe.Pointer(pTab)).FeTabType) == TABTYP_VTAB) {
goto __100
}
// The row that the VUpdate opcode will delete: none
@@ -105028,15 +106576,15 @@ __103:
// Rowid already initialized at tag-20191021-001
goto __106
__105:
- pIpk = (*ExprList_item)(unsafe.Pointer((pList + 8 /* &.a */) + uintptr(ipkColumn)*20)).FpExpr
- if !((int32((*Expr)(unsafe.Pointer(pIpk)).Fop) == TK_NULL) && !((*Table)(unsafe.Pointer(pTab)).FnModuleArg != 0)) {
+ pIpk = (*ExprList_item)(unsafe.Pointer(pList + 8 + uintptr(ipkColumn)*20)).FpExpr
+ if !(int32((*Expr)(unsafe.Pointer(pIpk)).Fop) == TK_NULL && !(int32((*Table)(unsafe.Pointer(pTab)).FeTabType) == TABTYP_VTAB)) {
goto __107
}
Xsqlite3VdbeAddOp3(tls, v, OP_NewRowid, *(*int32)(unsafe.Pointer(bp + 136 /* iDataCur */)), regRowid, regAutoinc)
appendFlag = U8(1)
goto __108
__107:
- Xsqlite3ExprCode(tls, pParse, (*ExprList_item)(unsafe.Pointer((pList+8 /* &.a */)+uintptr(ipkColumn)*20)).FpExpr, regRowid)
+ Xsqlite3ExprCode(tls, pParse, (*ExprList_item)(unsafe.Pointer(pList+8+uintptr(ipkColumn)*20)).FpExpr, regRowid)
__108:
;
__106:
@@ -105045,10 +106593,10 @@ __104:
;
// If the PRIMARY KEY expression is NULL, then use OP_NewRowid
// to generate a unique primary key value.
- if !(!(appendFlag != 0)) {
+ if !!(appendFlag != 0) {
goto __109
}
- if !(!((*Table)(unsafe.Pointer(pTab)).FnModuleArg != 0)) {
+ if !!(int32((*Table)(unsafe.Pointer(pTab)).FeTabType) == TABTYP_VTAB) {
goto __110
}
addr11 = Xsqlite3VdbeAddOp1(tls, v, OP_NotNull, regRowid)
@@ -105057,7 +106605,7 @@ __104:
goto __111
__110:
addr11 = Xsqlite3VdbeCurrentAddr(tls, v)
- Xsqlite3VdbeAddOp2(tls, v, OP_IsNull, regRowid, (addr11 + 2))
+ Xsqlite3VdbeAddOp2(tls, v, OP_IsNull, regRowid, addr11+2)
__111:
;
Xsqlite3VdbeAddOp1(tls, v, OP_MustBeInt, regRowid)
@@ -105065,7 +106613,7 @@ __109:
;
goto __102
__101:
- if !(((*Table)(unsafe.Pointer(pTab)).FnModuleArg != 0) || (withoutRowid != 0)) {
+ if !(int32((*Table)(unsafe.Pointer(pTab)).FeTabType) == TABTYP_VTAB || withoutRowid != 0) {
goto __112
}
Xsqlite3VdbeAddOp2(tls, v, OP_Null, 0, regRowid)
@@ -105083,21 +106631,21 @@ __102:
// columns have already been computed. This must be done after
// computing the ROWID in case one of the generated columns
// is derived from the INTEGER PRIMARY KEY.
- if !(((*Table)(unsafe.Pointer(pTab)).FtabFlags & U32(TF_HasGenerated)) != 0) {
+ if !((*Table)(unsafe.Pointer(pTab)).FtabFlags&U32(TF_HasGenerated) != 0) {
goto __114
}
- Xsqlite3ComputeGeneratedColumns(tls, pParse, (regRowid + 1), pTab)
+ Xsqlite3ComputeGeneratedColumns(tls, pParse, regRowid+1, pTab)
__114:
;
// Generate code to check constraints and generate index keys and
// do the insertion.
- if !((*Table)(unsafe.Pointer(pTab)).FnModuleArg != 0) {
+ if !(int32((*Table)(unsafe.Pointer(pTab)).FeTabType) == TABTYP_VTAB) {
goto __115
}
pVTab = Xsqlite3GetVTable(tls, db, pTab)
Xsqlite3VtabMakeWritable(tls, pParse, pTab)
- Xsqlite3VdbeAddOp4(tls, v, OP_VUpdate, 1, (int32((*Table)(unsafe.Pointer(pTab)).FnCol) + 2), regIns, pVTab, -12)
+ Xsqlite3VdbeAddOp4(tls, v, OP_VUpdate, 1, int32((*Table)(unsafe.Pointer(pTab)).FnCol)+2, regIns, pVTab, -12)
Xsqlite3VdbeChangeP5(tls, v, func() uint16 {
if onError == OE_Default {
return uint16(OE_Abort)
@@ -105110,7 +106658,7 @@ __115:
*(*int32)(unsafe.Pointer(bp + 144 /* isReplace */)) = 0 // True to use OPFLAG_SEEKRESULT
Xsqlite3GenerateConstraintChecks(tls, pParse, pTab, aRegIdx, *(*int32)(unsafe.Pointer(bp + 136 /* iDataCur */)), *(*int32)(unsafe.Pointer(bp + 140 /* iIdxCur */)),
- regIns, 0, (uint8(libc.Bool32(ipkColumn >= 0))), uint8(onError), endOfLoop, bp+144 /* &isReplace */, uintptr(0), pUpsert)
+ regIns, 0, uint8(libc.Bool32(ipkColumn >= 0)), uint8(onError), endOfLoop, bp+144 /* &isReplace */, uintptr(0), pUpsert)
Xsqlite3FkCheck(tls, pParse, pTab, 0, regIns, uintptr(0), 0)
// Set the OPFLAG_USESEEKRESULT flag if either (a) there are no REPLACE
@@ -105121,7 +106669,7 @@ __115:
// cursor that is disturbed. And these instructions both clear the
// VdbeCursor.seekResult variable, disabling the OPFLAG_USESEEKRESULT
// functionality.
- bUseSeek = (libc.Bool32((*(*int32)(unsafe.Pointer(bp + 144 /* isReplace */)) == 0) || !(Xsqlite3VdbeHasSubProgram(tls, v) != 0)))
+ bUseSeek = libc.Bool32(*(*int32)(unsafe.Pointer(bp + 144)) == 0 || !(Xsqlite3VdbeHasSubProgram(tls, v) != 0))
Xsqlite3CompleteInsertion(tls, pParse, pTab, *(*int32)(unsafe.Pointer(bp + 136 /* iDataCur */)), *(*int32)(unsafe.Pointer(bp + 140 /* iIdxCur */)),
regIns, aRegIdx, 0, int32(appendFlag), bUseSeek)
__116:
@@ -105142,7 +106690,7 @@ __117:
}
// Code AFTER triggers
Xsqlite3CodeRowTrigger(tls, pParse, pTrigger, TK_INSERT, uintptr(0), TRIGGER_AFTER,
- pTab, ((regData - 2) - int32((*Table)(unsafe.Pointer(pTab)).FnCol)), onError, endOfLoop)
+ pTab, regData-2-int32((*Table)(unsafe.Pointer(pTab)).FnCol), onError, endOfLoop)
__118:
;
@@ -105171,7 +106719,7 @@ insert_end:
// Update the sqlite_sequence table by storing the content of the
// maximum rowid counter values recorded while inserting into
// autoincrement tables.
- if !((int32((*Parse)(unsafe.Pointer(pParse)).Fnested) == 0) && ((*Parse)(unsafe.Pointer(pParse)).FpTriggerTab == uintptr(0))) {
+ if !(int32((*Parse)(unsafe.Pointer(pParse)).Fnested) == 0 && (*Parse)(unsafe.Pointer(pParse)).FpTriggerTab == uintptr(0)) {
goto __122
}
Xsqlite3AutoincrementEnd(tls, pParse)
@@ -105186,7 +106734,7 @@ __122:
}
Xsqlite3VdbeAddOp2(tls, v, OP_ChngCntRow, regRowCount, 1)
Xsqlite3VdbeSetNumCols(tls, v, 1)
- Xsqlite3VdbeSetColName(tls, v, 0, COLNAME_NAME, ts+14386 /* "rows inserted" */, uintptr(0))
+ Xsqlite3VdbeSetColName(tls, v, 0, COLNAME_NAME, ts+15568 /* "rows inserted" */, uintptr(0))
__123:
;
@@ -105210,15 +106758,15 @@ insert_cleanup:
// Set bit 0x01 of pWalker->eCode if pWalker->eCode to 0 and if this
// expression node references any of the
// columns that are being modifed by an UPDATE statement.
-func checkConstraintExprNode(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 { /* sqlite3.c:124428:12: */
+func checkConstraintExprNode(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 { /* sqlite3.c:125415:12: */
if int32((*Expr)(unsafe.Pointer(pExpr)).Fop) == TK_COLUMN {
if int32((*Expr)(unsafe.Pointer(pExpr)).FiColumn) >= 0 {
- if *(*int32)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pWalker + 24 /* &.u */)) + uintptr((*Expr)(unsafe.Pointer(pExpr)).FiColumn)*4)) >= 0 {
- *(*U16)(unsafe.Pointer(pWalker + 20 /* &.eCode */)) |= U16((CKCNSTRNT_COLUMN))
+ if *(*int32)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pWalker + 24)) + uintptr((*Expr)(unsafe.Pointer(pExpr)).FiColumn)*4)) >= 0 {
+ *(*U16)(unsafe.Pointer(pWalker + 20)) |= U16(CKCNSTRNT_COLUMN)
}
} else {
- *(*U16)(unsafe.Pointer(pWalker + 20 /* &.eCode */)) |= U16((CKCNSTRNT_ROWID))
+ *(*U16)(unsafe.Pointer(pWalker + 20)) |= U16(CKCNSTRNT_ROWID)
}
}
return WRC_Continue
@@ -105237,7 +106785,7 @@ func checkConstraintExprNode(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int3
// The operation of this routine is the same - return true if an only if
// the expression uses one or more of columns identified by the second and
// third arguments.
-func Xsqlite3ExprReferencesUpdatedColumn(tls *libc.TLS, pExpr uintptr, aiChng uintptr, chngRowid int32) int32 { /* sqlite3.c:124457:20: */
+func Xsqlite3ExprReferencesUpdatedColumn(tls *libc.TLS, pExpr uintptr, aiChng uintptr, chngRowid int32) int32 { /* sqlite3.c:125444:20: */
bp := tls.Alloc(28)
defer tls.Free(28)
@@ -105248,14 +106796,14 @@ func Xsqlite3ExprReferencesUpdatedColumn(tls *libc.TLS, pExpr uintptr, aiChng ui
(*Walker)(unsafe.Pointer(bp /* &w */)).FxExprCallback = *(*uintptr)(unsafe.Pointer(&struct {
f func(*libc.TLS, uintptr, uintptr) int32
}{checkConstraintExprNode}))
- *(*uintptr)(unsafe.Pointer(bp /* &w */ + 24 /* &.u */)) = aiChng
+ *(*uintptr)(unsafe.Pointer(bp + 24)) = aiChng
Xsqlite3WalkExpr(tls, bp /* &w */, pExpr)
if !(chngRowid != 0) {
- *(*U16)(unsafe.Pointer(bp /* &w */ + 20 /* &.eCode */)) &= libc.Uint16FromInt32((libc.CplInt32(CKCNSTRNT_ROWID)))
+ *(*U16)(unsafe.Pointer(bp + 20)) &= libc.Uint16FromInt32(libc.CplInt32(CKCNSTRNT_ROWID))
}
- return (libc.Bool32(int32((*Walker)(unsafe.Pointer(bp /* &w */)).FeCode) != 0))
+ return libc.Bool32(int32((*Walker)(unsafe.Pointer(bp)).FeCode) != 0)
}
// The sqlite3GenerateConstraintChecks() routine usually wants to visit
@@ -105270,7 +106818,7 @@ func Xsqlite3ExprReferencesUpdatedColumn(tls *libc.TLS, pExpr uintptr, aiChng ui
type IndexListTerm1 = struct {
Fp uintptr
Fix int32
-} /* sqlite3.c:124490:9 */
+} /* sqlite3.c:125477:9 */
// The sqlite3GenerateConstraintChecks() routine usually wants to visit
// the indexes of a table in the order provided in the Table->pIndex list.
@@ -105281,7 +106829,7 @@ type IndexListTerm1 = struct {
// The IndexIterator object is used to walk through all of the indexes
// of a table in either Index.pNext order, or in some other order established
// by an array of IndexListTerm objects.
-type IndexListTerm = IndexListTerm1 /* sqlite3.c:124490:30 */
+type IndexListTerm = IndexListTerm1 /* sqlite3.c:125477:30 */
type IndexIterator1 = struct {
FeType int32
Fi int32
@@ -105289,37 +106837,37 @@ type IndexIterator1 = struct {
Flx struct{ FpIdx uintptr }
F__ccgo_pad1 [4]byte
}
-} /* sqlite3.c:124491:9 */
+} /* sqlite3.c:125478:9 */
-type IndexIterator = IndexIterator1 /* sqlite3.c:124491:30 */
+type IndexIterator = IndexIterator1 /* sqlite3.c:125478:30 */
// Return the first index on the list
-func indexIteratorFirst(tls *libc.TLS, pIter uintptr, pIx uintptr) uintptr { /* sqlite3.c:124515:14: */
+func indexIteratorFirst(tls *libc.TLS, pIter uintptr, pIx uintptr) uintptr { /* sqlite3.c:125502:14: */
if (*IndexIterator)(unsafe.Pointer(pIter)).FeType != 0 {
- *(*int32)(unsafe.Pointer(pIx)) = (*IndexListTerm)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((pIter + 8 /* &.u */ /* &.ax */) + 4 /* &.aIdx */)))).Fix
- return (*IndexListTerm)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((pIter + 8 /* &.u */ /* &.ax */) + 4 /* &.aIdx */)))).Fp
+ *(*int32)(unsafe.Pointer(pIx)) = (*IndexListTerm)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pIter + 8 + 4 /* &.aIdx */)))).Fix
+ return (*IndexListTerm)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pIter + 8 + 4 /* &.aIdx */)))).Fp
} else {
*(*int32)(unsafe.Pointer(pIx)) = 0
- return *(*uintptr)(unsafe.Pointer(pIter + 8 /* &.u */ /* &.lx */ /* &.pIdx */))
+ return *(*uintptr)(unsafe.Pointer(pIter + 8))
}
return uintptr(0)
}
// Return the next index from the list. Return NULL when out of indexes
-func indexIteratorNext(tls *libc.TLS, pIter uintptr, pIx uintptr) uintptr { /* sqlite3.c:124527:14: */
+func indexIteratorNext(tls *libc.TLS, pIter uintptr, pIx uintptr) uintptr { /* sqlite3.c:125514:14: */
if (*IndexIterator)(unsafe.Pointer(pIter)).FeType != 0 {
var i int32 = libc.PreIncInt32(&(*IndexIterator)(unsafe.Pointer(pIter)).Fi, 1)
- if i >= *(*int32)(unsafe.Pointer((pIter + 8 /* &.u */ /* &.ax */) /* &.nIdx */)) {
+ if i >= *(*int32)(unsafe.Pointer(pIter + 8)) {
*(*int32)(unsafe.Pointer(pIx)) = i
return uintptr(0)
}
- *(*int32)(unsafe.Pointer(pIx)) = (*IndexListTerm)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((pIter + 8 /* &.u */ /* &.ax */) + 4 /* &.aIdx */)) + uintptr(i)*8)).Fix
- return (*IndexListTerm)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((pIter + 8 /* &.u */ /* &.ax */) + 4 /* &.aIdx */)) + uintptr(i)*8)).Fp
+ *(*int32)(unsafe.Pointer(pIx)) = (*IndexListTerm)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pIter + 8 + 4 /* &.aIdx */)) + uintptr(i)*8)).Fix
+ return (*IndexListTerm)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pIter + 8 + 4 /* &.aIdx */)) + uintptr(i)*8)).Fp
} else {
- (*(*int32)(unsafe.Pointer(pIx)))++
- *(*uintptr)(unsafe.Pointer(pIter + 8 /* &.u */ /* &.lx */ /* &.pIdx */)) = (*Index)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pIter + 8 /* &.u */ /* &.lx */ /* &.pIdx */)))).FpNext
- return *(*uintptr)(unsafe.Pointer(pIter + 8 /* &.u */ /* &.lx */ /* &.pIdx */))
+ *(*int32)(unsafe.Pointer(pIx))++
+ *(*uintptr)(unsafe.Pointer(pIter + 8)) = (*Index)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pIter + 8)))).FpNext
+ return *(*uintptr)(unsafe.Pointer(pIter + 8))
}
return uintptr(0)
}
@@ -105413,7 +106961,7 @@ func indexIteratorNext(tls *libc.TLS, pIter uintptr, pIx uintptr) uintptr { /* s
// Or if overrideError==OE_Default, then the pParse->onError parameter
// is used. Or if pParse->onError==OE_Default then the onError value
// for the constraint is used.
-func Xsqlite3GenerateConstraintChecks(tls *libc.TLS, pParse uintptr, pTab uintptr, aRegIdx uintptr, iDataCur int32, iIdxCur int32, regNewData int32, regOldData int32, pkChng U8, overrideError U8, ignoreDest int32, pbMayReplace uintptr, aiChng uintptr, pUpsert uintptr) { /* sqlite3.c:124634:21: */
+func Xsqlite3GenerateConstraintChecks(tls *libc.TLS, pParse uintptr, pTab uintptr, aRegIdx uintptr, iDataCur int32, iIdxCur int32, regNewData int32, regOldData int32, pkChng U8, overrideError U8, ignoreDest int32, pbMayReplace uintptr, aiChng uintptr, pUpsert uintptr) { /* sqlite3.c:125621:21: */
bp := tls.Alloc(56)
defer tls.Free(56)
@@ -105445,7 +106993,7 @@ func Xsqlite3GenerateConstraintChecks(tls *libc.TLS, pParse uintptr, pTab uintpt
// var sIdxIter IndexIterator at bp+16, 16
// Index iterator
- isUpdate = (U8(libc.Bool32(regOldData != 0)))
+ isUpdate = U8(libc.Bool32(regOldData != 0))
db = (*Parse)(unsafe.Pointer(pParse)).Fdb
v = (*Parse)(unsafe.Pointer(pParse)).FpVdbe
@@ -105456,7 +107004,7 @@ func Xsqlite3GenerateConstraintChecks(tls *libc.TLS, pParse uintptr, pTab uintpt
// normal rowid tables. nPkField is the number of key fields in the
// pPk index or 1 for a rowid table. In other words, nPkField is the
// number of fields in the true primary key of the table.
- if ((*Table)(unsafe.Pointer((pTab))).FtabFlags & U32(TF_WithoutRowid)) == U32(0) {
+ if (*Table)(unsafe.Pointer(pTab)).FtabFlags&U32(TF_WithoutRowid) == U32(0) {
pPk = uintptr(0)
nPkField = 1
} else {
@@ -105467,28 +107015,28 @@ func Xsqlite3GenerateConstraintChecks(tls *libc.TLS, pParse uintptr, pTab uintpt
// Record that this module has started
// Test all NOT NULL constraints.
- if ((*Table)(unsafe.Pointer(pTab)).FtabFlags & U32(TF_HasNotNull)) != 0 {
+ if (*Table)(unsafe.Pointer(pTab)).FtabFlags&U32(TF_HasNotNull) != 0 {
var b2ndPass int32 = 0 // True if currently running 2nd pass
var nSeenReplace int32 = 0 // Number of ON CONFLICT REPLACE operations
var nGenerated int32 = 0 // Number of generated columns with NOT NULL
for 1 != 0 { // Make 2 passes over columns. Exit loop via "break"
for i = 0; i < nCol; i++ {
- var iReg int32 // Register holding column value
- var pCol uintptr = ((*Table)(unsafe.Pointer(pTab)).FaCol + uintptr(i)*20) // The column to check for NOT NULL
- var isGenerated int32 // non-zero if column is generated
- onError = int32((*Column)(unsafe.Pointer(pCol)).FnotNull)
+ var iReg int32 // Register holding column value
+ var pCol uintptr = (*Table)(unsafe.Pointer(pTab)).FaCol + uintptr(i)*16 // The column to check for NOT NULL
+ var isGenerated int32 // non-zero if column is generated
+ onError = int32(*(*uint8)(unsafe.Pointer(pCol + 4)) & 0xf >> 0)
if onError == OE_None {
continue
} // No NOT NULL on this column
if i == int32((*Table)(unsafe.Pointer(pTab)).FiPKey) {
continue // ROWID is never NULL
}
- isGenerated = (int32((*Column)(unsafe.Pointer(pCol)).FcolFlags) & COLFLAG_GENERATED)
- if (isGenerated != 0) && !(b2ndPass != 0) {
+ isGenerated = int32((*Column)(unsafe.Pointer(pCol)).FcolFlags) & COLFLAG_GENERATED
+ if isGenerated != 0 && !(b2ndPass != 0) {
nGenerated++
continue // Generated columns processed on 2nd pass
}
- if ((aiChng != 0) && (*(*int32)(unsafe.Pointer(aiChng + uintptr(i)*4)) < 0)) && !(isGenerated != 0) {
+ if aiChng != 0 && *(*int32)(unsafe.Pointer(aiChng + uintptr(i)*4)) < 0 && !(isGenerated != 0) {
// Do not check NOT NULL on columns that do not change
continue
}
@@ -105498,25 +107046,26 @@ func Xsqlite3GenerateConstraintChecks(tls *libc.TLS, pParse uintptr, pTab uintpt
onError = OE_Abort
}
if onError == OE_Replace {
- if (b2ndPass != 0) || // REPLACE becomes ABORT on the 2nd pass
- ((*Column)(unsafe.Pointer(pCol)).FpDflt == uintptr(0)) {
+ if b2ndPass != 0 ||
+ int32((*Column)(unsafe.Pointer(pCol)).FiDflt) == 0 {
onError = OE_Abort
} else {
}
- } else if (b2ndPass != 0) && !(isGenerated != 0) {
+ } else if b2ndPass != 0 && !(isGenerated != 0) {
continue
}
- iReg = ((int32(Xsqlite3TableColumnToStorage(tls, pTab, int16(i))) + regNewData) + 1)
+ iReg = int32(Xsqlite3TableColumnToStorage(tls, pTab, int16(i))) + regNewData + 1
switch onError {
case OE_Replace:
{
var addr1 int32 = Xsqlite3VdbeAddOp1(tls, v, OP_NotNull, iReg)
nSeenReplace++
- Xsqlite3ExprCodeCopy(tls, pParse, (*Column)(unsafe.Pointer(pCol)).FpDflt, iReg)
+ Xsqlite3ExprCodeCopy(tls, pParse,
+ Xsqlite3ColumnExpr(tls, pTab, pCol), iReg)
Xsqlite3VdbeJumpHere(tls, v, addr1)
break
@@ -105529,9 +107078,9 @@ func Xsqlite3GenerateConstraintChecks(tls *libc.TLS, pParse uintptr, pTab uintpt
fallthrough
case OE_Fail:
{
- var zMsg uintptr = Xsqlite3MPrintf(tls, db, ts+10785 /* "%s.%s" */, libc.VaList(bp, (*Table)(unsafe.Pointer(pTab)).FzName,
- (*Column)(unsafe.Pointer(pCol)).FzName))
- Xsqlite3VdbeAddOp3(tls, v, OP_HaltIfNull, (SQLITE_CONSTRAINT | (int32(5) << 8)),
+ var zMsg uintptr = Xsqlite3MPrintf(tls, db, ts+11899 /* "%s.%s" */, libc.VaList(bp, (*Table)(unsafe.Pointer(pTab)).FzName,
+ (*Column)(unsafe.Pointer(pCol)).FzCnName))
+ Xsqlite3VdbeAddOp3(tls, v, OP_HaltIfNull, SQLITE_CONSTRAINT|int32(5)<<8,
onError, iReg)
Xsqlite3VdbeAppendP4(tls, v, zMsg, -7)
Xsqlite3VdbeChangeP5(tls, v, uint16(P5_ConstraintNotNull))
@@ -105550,7 +107099,7 @@ func Xsqlite3GenerateConstraintChecks(tls *libc.TLS, pParse uintptr, pTab uintpt
}
} // end switch(onError)
} // end loop i over columns
- if (nGenerated == 0) && (nSeenReplace == 0) {
+ if nGenerated == 0 && nSeenReplace == 0 {
// If there are no generated columns with NOT NULL constraints
// and no NOT NULL ON CONFLICT REPLACE constraints, then a single
// pass is sufficient
@@ -105560,17 +107109,17 @@ func Xsqlite3GenerateConstraintChecks(tls *libc.TLS, pParse uintptr, pTab uintpt
break
} // Never need more than 2 passes
b2ndPass = 1
- if (nSeenReplace > 0) && (((*Table)(unsafe.Pointer(pTab)).FtabFlags & U32(TF_HasGenerated)) != U32(0)) {
+ if nSeenReplace > 0 && (*Table)(unsafe.Pointer(pTab)).FtabFlags&U32(TF_HasGenerated) != U32(0) {
// If any NOT NULL ON CONFLICT REPLACE constraints fired on the
// first pass, recomputed values for all generated columns, as
// those values might depend on columns affected by the REPLACE.
- Xsqlite3ComputeGeneratedColumns(tls, pParse, (regNewData + 1), pTab)
+ Xsqlite3ComputeGeneratedColumns(tls, pParse, regNewData+1, pTab)
}
} // end of 2-pass loop
} // end if( has-not-null-constraints )
// Test all CHECK constraints
- if ((*Table)(unsafe.Pointer(pTab)).FpCheck != 0) && (((*Sqlite3)(unsafe.Pointer(db)).Fflags & uint64(SQLITE_IgnoreChecks)) == uint64(0)) {
+ if (*Table)(unsafe.Pointer(pTab)).FpCheck != 0 && (*Sqlite3)(unsafe.Pointer(db)).Fflags&uint64(SQLITE_IgnoreChecks) == uint64(0) {
var pCheck uintptr = (*Table)(unsafe.Pointer(pTab)).FpCheck
(*Parse)(unsafe.Pointer(pParse)).FiSelfTab = -(regNewData + 1)
if int32(overrideError) != OE_Default {
@@ -105581,15 +107130,15 @@ func Xsqlite3GenerateConstraintChecks(tls *libc.TLS, pParse uintptr, pTab uintpt
for i = 0; i < (*ExprList)(unsafe.Pointer(pCheck)).FnExpr; i++ {
var allOk int32
var pCopy uintptr
- var pExpr uintptr = (*ExprList_item)(unsafe.Pointer((pCheck + 8 /* &.a */) + uintptr(i)*20)).FpExpr
- if (aiChng != 0) &&
+ var pExpr uintptr = (*ExprList_item)(unsafe.Pointer(pCheck + 8 + uintptr(i)*20)).FpExpr
+ if aiChng != 0 &&
!(Xsqlite3ExprReferencesUpdatedColumn(tls, pExpr, aiChng, int32(pkChng)) != 0) {
// The check constraints do not reference any of the columns being
// updated so there is no point it verifying the check constraint
continue
}
if int32(bAffinityDone) == 0 {
- Xsqlite3TableAffinity(tls, v, pTab, (regNewData + 1))
+ Xsqlite3TableAffinity(tls, v, pTab, regNewData+1)
bAffinityDone = U8(1)
}
allOk = Xsqlite3VdbeMakeLabel(tls, pParse)
@@ -105602,12 +107151,12 @@ func Xsqlite3GenerateConstraintChecks(tls *libc.TLS, pParse uintptr, pTab uintpt
if onError == OE_Ignore {
Xsqlite3VdbeGoto(tls, v, ignoreDest)
} else {
- var zName uintptr = (*ExprList_item)(unsafe.Pointer((pCheck + 8 /* &.a */) + uintptr(i)*20)).FzEName
+ var zName uintptr = (*ExprList_item)(unsafe.Pointer(pCheck + 8 + uintptr(i)*20)).FzEName
if onError == OE_Replace {
onError = OE_Abort
} // IMP: R-26383-51744
- Xsqlite3HaltConstraint(tls, pParse, (SQLITE_CONSTRAINT | (int32(1) << 8)),
+ Xsqlite3HaltConstraint(tls, pParse, SQLITE_CONSTRAINT|int32(1)<<8,
onError, zName, int8(P4_TRANSIENT),
uint8(P5_ConstraintCheck))
}
@@ -105645,8 +107194,8 @@ func Xsqlite3GenerateConstraintChecks(tls *libc.TLS, pParse uintptr, pTab uintpt
// in the list. See sqlite3CreateIndex() for where that happens.
(*IndexIterator)(unsafe.Pointer(bp + 16 /* &sIdxIter */)).FeType = 0
(*IndexIterator)(unsafe.Pointer(bp + 16 /* &sIdxIter */)).Fi = 0
- *(*uintptr)(unsafe.Pointer(bp + 16 /* &sIdxIter */ + 8 /* &.u */ /* &.ax */ + 4 /* &.aIdx */)) = uintptr(0) // Silence harmless compiler warning
- *(*uintptr)(unsafe.Pointer(bp + 16 /* &sIdxIter */ + 8 /* &.u */ /* &.lx */ /* &.pIdx */)) = (*Table)(unsafe.Pointer(pTab)).FpIndex
+ *(*uintptr)(unsafe.Pointer(bp + 16 + 8 + 4 /* &.aIdx */)) = uintptr(0) // Silence harmless compiler warning
+ *(*uintptr)(unsafe.Pointer(bp + 16 + 8)) = (*Table)(unsafe.Pointer(pTab)).FpIndex
if pUpsert != 0 {
if (*Upsert)(unsafe.Pointer(pUpsert)).FpUpsertTarget == uintptr(0) {
// There is just on ON CONFLICT clause and it has no constraint-target
@@ -105687,14 +107236,14 @@ func Xsqlite3GenerateConstraintChecks(tls *libc.TLS, pParse uintptr, pTab uintpt
__3:
;
(*IndexIterator)(unsafe.Pointer(bp + 16 /* &sIdxIter */)).FeType = 1
- *(*int32)(unsafe.Pointer(bp + 16 /* &sIdxIter */ + 8 /* &.u */ /* &.ax */ /* &.nIdx */)) = nIdx
- nByte = (U64(((uint32(unsafe.Sizeof(IndexListTerm{})) + uint32(1)) * uint32(nIdx)) + uint32(nIdx)))
- *(*uintptr)(unsafe.Pointer(bp + 16 /* &sIdxIter */ + 8 /* &.u */ /* &.ax */ + 4 /* &.aIdx */)) = Xsqlite3DbMallocZero(tls, db, nByte)
- if *(*uintptr)(unsafe.Pointer((bp + 16 /* &sIdxIter */ + 8 /* &.u */ /* &.ax */) + 4 /* &.aIdx */)) == uintptr(0) {
+ *(*int32)(unsafe.Pointer(bp + 16 + 8)) = nIdx
+ nByte = U64((uint32(unsafe.Sizeof(IndexListTerm{}))+uint32(1))*uint32(nIdx) + uint32(nIdx))
+ *(*uintptr)(unsafe.Pointer(bp + 16 + 8 + 4 /* &.aIdx */)) = Xsqlite3DbMallocZero(tls, db, nByte)
+ if *(*uintptr)(unsafe.Pointer(bp + 16 + 8 + 4)) == uintptr(0) {
return
} // OOM
- bUsed = (*(*uintptr)(unsafe.Pointer((bp + 16 /* &sIdxIter */ + 8 /* &.u */ /* &.ax */) + 4 /* &.aIdx */)) + uintptr(nIdx)*8)
- (*Upsert)(unsafe.Pointer(pUpsert)).FpToFree = *(*uintptr)(unsafe.Pointer(bp + 16 /* &sIdxIter */ + 8 /* &.u */ /* &.ax */ + 4 /* &.aIdx */))
+ bUsed = *(*uintptr)(unsafe.Pointer(bp + 16 + 8 + 4)) + uintptr(nIdx)*8
+ (*Upsert)(unsafe.Pointer(pUpsert)).FpToFree = *(*uintptr)(unsafe.Pointer(bp + 16 + 8 + 4 /* &.aIdx */))
i = 0
pTerm = pUpsert
for ; pTerm != 0; pTerm = (*Upsert)(unsafe.Pointer(pTerm)).FpNextUpsert {
@@ -105706,7 +107255,7 @@ func Xsqlite3GenerateConstraintChecks(tls *libc.TLS, pParse uintptr, pTab uintpt
} // Skip ON CONFLICT for the IPK
jj = 0
pIdx = (*Table)(unsafe.Pointer(pTab)).FpIndex
- for (pIdx != uintptr(0)) && (pIdx != (*Upsert)(unsafe.Pointer(pTerm)).FpUpsertIdx) {
+ for pIdx != uintptr(0) && pIdx != (*Upsert)(unsafe.Pointer(pTerm)).FpUpsertIdx {
pIdx = (*Index)(unsafe.Pointer(pIdx)).FpNext
jj++
}
@@ -105714,8 +107263,8 @@ func Xsqlite3GenerateConstraintChecks(tls *libc.TLS, pParse uintptr, pTab uintpt
continue
} // Duplicate ON CONFLICT clause ignored
*(*U8)(unsafe.Pointer(bUsed + uintptr(jj))) = U8(1)
- (*IndexListTerm)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((bp + 16 /* &sIdxIter */ + 8 /* &.u */ /* &.ax */) + 4 /* &.aIdx */)) + uintptr(i)*8)).Fp = pIdx
- (*IndexListTerm)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((bp + 16 /* &sIdxIter */ + 8 /* &.u */ /* &.ax */) + 4 /* &.aIdx */)) + uintptr(i)*8)).Fix = jj
+ (*IndexListTerm)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16 + 8 + 4 /* &.aIdx */)) + uintptr(i)*8)).Fp = pIdx
+ (*IndexListTerm)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16 + 8 + 4 /* &.aIdx */)) + uintptr(i)*8)).Fix = jj
i++
}
jj = 0
@@ -105728,8 +107277,8 @@ func Xsqlite3GenerateConstraintChecks(tls *libc.TLS, pParse uintptr, pTab uintpt
if *(*U8)(unsafe.Pointer(bUsed + uintptr(jj))) != 0 {
goto __5
}
- (*IndexListTerm)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((bp + 16 /* &sIdxIter */ + 8 /* &.u */ /* &.ax */) + 4 /* &.aIdx */)) + uintptr(i)*8)).Fp = pIdx
- (*IndexListTerm)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((bp + 16 /* &sIdxIter */ + 8 /* &.u */ /* &.ax */) + 4 /* &.aIdx */)) + uintptr(i)*8)).Fix = jj
+ (*IndexListTerm)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16 + 8 + 4 /* &.aIdx */)) + uintptr(i)*8)).Fp = pIdx
+ (*IndexListTerm)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16 + 8 + 4 /* &.aIdx */)) + uintptr(i)*8)).Fix = jj
i++
}
@@ -105762,15 +107311,15 @@ func Xsqlite3GenerateConstraintChecks(tls *libc.TLS, pParse uintptr, pTab uintpt
// in a second pass. The addrRecheck and lblRecheckOk variables are
// used to link together these tests which are separated from each other
// in the generate bytecode.
- if ((*Sqlite3)(unsafe.Pointer(db)).Fflags & (uint64(SQLITE_RecTriggers | SQLITE_ForeignKeys))) == uint64(0) {
+ if (*Sqlite3)(unsafe.Pointer(db)).Fflags&uint64(SQLITE_RecTriggers|SQLITE_ForeignKeys) == uint64(0) {
// There are not DELETE triggers nor FK constraints. No constraint
// rechecks are needed.
pTrigger = uintptr(0)
regTrigCnt = 0
} else {
- if ((*Sqlite3)(unsafe.Pointer(db)).Fflags & uint64(SQLITE_RecTriggers)) != 0 {
+ if (*Sqlite3)(unsafe.Pointer(db)).Fflags&uint64(SQLITE_RecTriggers) != 0 {
pTrigger = Xsqlite3TriggersExist(tls, pParse, pTab, TK_DELETE, uintptr(0), uintptr(0))
- regTrigCnt = (libc.Bool32((pTrigger != uintptr(0)) || (Xsqlite3FkRequired(tls, pParse, pTab, uintptr(0), 0) != 0)))
+ regTrigCnt = libc.Bool32(pTrigger != uintptr(0) || Xsqlite3FkRequired(tls, pParse, pTab, uintptr(0), 0) != 0)
} else {
pTrigger = uintptr(0)
regTrigCnt = Xsqlite3FkRequired(tls, pParse, pTab, uintptr(0), 0)
@@ -105788,7 +107337,7 @@ func Xsqlite3GenerateConstraintChecks(tls *libc.TLS, pParse uintptr, pTab uintpt
// If rowid is changing, make sure the new rowid does not previously
// exist in the table.
- if (pkChng != 0) && (pPk == uintptr(0)) {
+ if pkChng != 0 && pPk == uintptr(0) {
var addrRowidOk int32 = Xsqlite3VdbeMakeLabel(tls, pParse)
// Figure out what action to take in case of a rowid collision
@@ -105821,10 +107370,10 @@ func Xsqlite3GenerateConstraintChecks(tls *libc.TLS, pParse uintptr, pTab uintpt
// to some other UNIQUE constraint is FAIL or IGNORE, then we need
// to defer the running of the rowid conflict checking until after
// the UNIQUE constraints have run.
- if ((onError == OE_Replace) && // IPK rule is REPLACE
- (onError != int32(overrideError))) && // Rules for other constraints are different
- ((*Table)(unsafe.Pointer(pTab)).FpIndex != 0) {
- ipkTop = (Xsqlite3VdbeAddOp0(tls, v, OP_Goto) + 1)
+ if onError == OE_Replace &&
+ onError != int32(overrideError) &&
+ (*Table)(unsafe.Pointer(pTab)).FpIndex != 0 {
+ ipkTop = Xsqlite3VdbeAddOp0(tls, v, OP_Goto) + 1
}
@@ -105923,11 +107472,11 @@ func Xsqlite3GenerateConstraintChecks(tls *libc.TLS, pParse uintptr, pTab uintpt
}
}
Xsqlite3VdbeResolveLabel(tls, v, addrRowidOk)
- if (pUpsert != 0) && (pUpsertClause != pUpsert) {
+ if pUpsert != 0 && pUpsertClause != pUpsert {
upsertIpkReturn = Xsqlite3VdbeAddOp0(tls, v, OP_Goto)
} else if ipkTop != 0 {
ipkBottom = Xsqlite3VdbeAddOp0(tls, v, OP_Goto)
- Xsqlite3VdbeJumpHere(tls, v, (ipkTop - 1))
+ Xsqlite3VdbeJumpHere(tls, v, ipkTop-1)
}
}
@@ -105944,22 +107493,22 @@ func Xsqlite3GenerateConstraintChecks(tls *libc.TLS, pParse uintptr, pTab uintpt
var addrUniqueOk int32 // Jump here if the UNIQUE constraint is satisfied
var addrConflictCk int32 // First opcode in the conflict check logic
- if *(*int32)(unsafe.Pointer(aRegIdx + uintptr(*(*int32)(unsafe.Pointer(bp + 32 /* ix */)))*4)) == 0 {
+ if *(*int32)(unsafe.Pointer(aRegIdx + uintptr(*(*int32)(unsafe.Pointer(bp + 32)))*4)) == 0 {
continue
} // Skip indices that do not change
if pUpsert != 0 {
pUpsertClause = Xsqlite3UpsertOfIndex(tls, pUpsert, pIdx)
- if (upsertIpkDelay != 0) && (pUpsertClause == pUpsert) {
+ if upsertIpkDelay != 0 && pUpsertClause == pUpsert {
Xsqlite3VdbeJumpHere(tls, v, upsertIpkDelay)
}
}
addrUniqueOk = Xsqlite3VdbeMakeLabel(tls, pParse)
if int32(bAffinityDone) == 0 {
- Xsqlite3TableAffinity(tls, v, pTab, (regNewData + 1))
+ Xsqlite3TableAffinity(tls, v, pTab, regNewData+1)
bAffinityDone = U8(1)
}
- iThisCur = (iIdxCur + *(*int32)(unsafe.Pointer(bp + 32 /* ix */)))
+ iThisCur = iIdxCur + *(*int32)(unsafe.Pointer(bp + 32))
// Skip partial indices for which the WHERE clause is not true
if (*Index)(unsafe.Pointer(pIdx)).FpPartIdxWhere != 0 {
@@ -105972,23 +107521,23 @@ func Xsqlite3GenerateConstraintChecks(tls *libc.TLS, pParse uintptr, pTab uintpt
// Create a record for this index entry as it should appear after
// the insert or update. Store that record in the aRegIdx[ix] register
- regIdx = (*(*int32)(unsafe.Pointer(aRegIdx + uintptr(*(*int32)(unsafe.Pointer(bp + 32 /* ix */)))*4)) + 1)
+ regIdx = *(*int32)(unsafe.Pointer(aRegIdx + uintptr(*(*int32)(unsafe.Pointer(bp + 32)))*4)) + 1
for i = 0; i < int32((*Index)(unsafe.Pointer(pIdx)).FnColumn); i++ {
var iField int32 = int32(*(*I16)(unsafe.Pointer((*Index)(unsafe.Pointer(pIdx)).FaiColumn + uintptr(i)*2)))
var x int32
- if iField == (-2) {
+ if iField == -2 {
(*Parse)(unsafe.Pointer(pParse)).FiSelfTab = -(regNewData + 1)
- Xsqlite3ExprCodeCopy(tls, pParse, (*ExprList_item)(unsafe.Pointer(((*Index)(unsafe.Pointer(pIdx)).FaColExpr+8 /* &.a */)+uintptr(i)*20)).FpExpr, (regIdx + i))
+ Xsqlite3ExprCodeCopy(tls, pParse, (*ExprList_item)(unsafe.Pointer((*Index)(unsafe.Pointer(pIdx)).FaColExpr+8+uintptr(i)*20)).FpExpr, regIdx+i)
(*Parse)(unsafe.Pointer(pParse)).FiSelfTab = 0
- } else if (iField == (-1)) || (iField == int32((*Table)(unsafe.Pointer(pTab)).FiPKey)) {
+ } else if iField == -1 || iField == int32((*Table)(unsafe.Pointer(pTab)).FiPKey) {
x = regNewData
- Xsqlite3VdbeAddOp2(tls, v, OP_IntCopy, x, (regIdx + i))
+ Xsqlite3VdbeAddOp2(tls, v, OP_IntCopy, x, regIdx+i)
} else {
- x = ((int32(Xsqlite3TableColumnToStorage(tls, pTab, int16(iField))) + regNewData) + 1)
- Xsqlite3VdbeAddOp2(tls, v, OP_SCopy, x, (regIdx + i))
+ x = int32(Xsqlite3TableColumnToStorage(tls, pTab, int16(iField))) + regNewData + 1
+ Xsqlite3VdbeAddOp2(tls, v, OP_SCopy, x, regIdx+i)
}
}
@@ -105998,7 +107547,7 @@ func Xsqlite3GenerateConstraintChecks(tls *libc.TLS, pParse uintptr, pTab uintpt
// of a WITHOUT ROWID table and there has been no change the
// primary key, then no collision is possible. The collision detection
// logic below can all be skipped.
- if ((isUpdate != 0) && (pPk == pIdx)) && (int32(pkChng) == 0) {
+ if isUpdate != 0 && pPk == pIdx && int32(pkChng) == 0 {
Xsqlite3VdbeResolveLabel(tls, v, addrUniqueOk)
continue
}
@@ -106046,8 +107595,8 @@ func Xsqlite3GenerateConstraintChecks(tls *libc.TLS, pParse uintptr, pTab uintpt
} else {
regR = Xsqlite3GetTempRange(tls, pParse, nPkField)
}
- if (isUpdate != 0) || (onError == OE_Replace) {
- if ((*Table)(unsafe.Pointer((pTab))).FtabFlags & U32(TF_WithoutRowid)) == U32(0) {
+ if isUpdate != 0 || onError == OE_Replace {
+ if (*Table)(unsafe.Pointer(pTab)).FtabFlags&U32(TF_WithoutRowid) == U32(0) {
Xsqlite3VdbeAddOp2(tls, v, OP_IdxRowid, iThisCur, regR)
// Conflict only if the rowid of the existing index entry
// is different from old-rowid
@@ -106064,7 +107613,7 @@ func Xsqlite3GenerateConstraintChecks(tls *libc.TLS, pParse uintptr, pTab uintpt
for i = 0; i < int32((*Index)(unsafe.Pointer(pPk)).FnKeyCol); i++ {
x = int32(Xsqlite3TableColumnToIndex(tls, pIdx, *(*I16)(unsafe.Pointer((*Index)(unsafe.Pointer(pPk)).FaiColumn + uintptr(i)*2))))
- Xsqlite3VdbeAddOp3(tls, v, OP_Column, iThisCur, x, (regR + i))
+ Xsqlite3VdbeAddOp3(tls, v, OP_Column, iThisCur, x, regR+i)
}
}
@@ -106076,10 +107625,10 @@ func Xsqlite3GenerateConstraintChecks(tls *libc.TLS, pParse uintptr, pTab uintpt
// For a UNIQUE index, only conflict if the PRIMARY KEY values
// of the matched index row are different from the original PRIMARY
// KEY values of this row before the update.
- var addrJump int32 = (Xsqlite3VdbeCurrentAddr(tls, v) + int32((*Index)(unsafe.Pointer(pPk)).FnKeyCol))
+ var addrJump int32 = Xsqlite3VdbeCurrentAddr(tls, v) + int32((*Index)(unsafe.Pointer(pPk)).FnKeyCol)
var op int32 = OP_Ne
var regCmp int32 = func() int32 {
- if (int32(*(*uint16)(unsafe.Pointer((pIdx) + 56 /* &.idxType */)) & 0x3 >> 0)) == SQLITE_IDXTYPE_PRIMARYKEY {
+ if int32(*(*uint16)(unsafe.Pointer(pIdx + 56))&0x3>>0) == SQLITE_IDXTYPE_PRIMARYKEY {
return regIdx
}
return regR
@@ -106089,13 +107638,13 @@ func Xsqlite3GenerateConstraintChecks(tls *libc.TLS, pParse uintptr, pTab uintpt
var p4 uintptr = Xsqlite3LocateCollSeq(tls, pParse, *(*uintptr)(unsafe.Pointer((*Index)(unsafe.Pointer(pPk)).FazColl + uintptr(i)*4)))
x = int32(*(*I16)(unsafe.Pointer((*Index)(unsafe.Pointer(pPk)).FaiColumn + uintptr(i)*2)))
- if i == (int32((*Index)(unsafe.Pointer(pPk)).FnKeyCol) - 1) {
+ if i == int32((*Index)(unsafe.Pointer(pPk)).FnKeyCol)-1 {
addrJump = addrUniqueOk
op = OP_Eq
}
x = int32(Xsqlite3TableColumnToStorage(tls, pTab, int16(x)))
Xsqlite3VdbeAddOp4(tls, v, op,
- ((regOldData + 1) + x), addrJump, (regCmp + i), p4, -2)
+ regOldData+1+x, addrJump, regCmp+i, p4, -2)
Xsqlite3VdbeChangeP5(tls, v, uint16(SQLITE_NOTNULL))
}
@@ -106119,7 +107668,7 @@ func Xsqlite3GenerateConstraintChecks(tls *libc.TLS, pParse uintptr, pTab uintpt
}
case OE_Update:
{
- Xsqlite3UpsertDoUpdate(tls, pParse, pUpsert, pTab, pIdx, (iIdxCur + *(*int32)(unsafe.Pointer(bp + 32 /* ix */))))
+ Xsqlite3UpsertDoUpdate(tls, pParse, pUpsert, pTab, pIdx, iIdxCur+*(*int32)(unsafe.Pointer(bp + 32)))
}
fallthrough
@@ -106134,13 +107683,13 @@ func Xsqlite3GenerateConstraintChecks(tls *libc.TLS, pParse uintptr, pTab uintpt
{
var nConflictCk int32 // Number of opcodes in conflict check logic
- nConflictCk = (Xsqlite3VdbeCurrentAddr(tls, v) - addrConflictCk)
+ nConflictCk = Xsqlite3VdbeCurrentAddr(tls, v) - addrConflictCk
if regTrigCnt != 0 {
Xsqlite3MultiWrite(tls, pParse)
nReplaceTrig++
}
- if (pTrigger != 0) && (isUpdate != 0) {
+ if pTrigger != 0 && isUpdate != 0 {
Xsqlite3VdbeAddOp1(tls, v, OP_CursorLock, iDataCur)
}
Xsqlite3GenerateRowDelete(tls, pParse, pTab, pTrigger, iDataCur, iIdxCur,
@@ -106151,7 +107700,7 @@ func Xsqlite3GenerateConstraintChecks(tls *libc.TLS, pParse uintptr, pTab uintpt
}
return uint8(ONEPASS_OFF)
}(), iThisCur)
- if (pTrigger != 0) && (isUpdate != 0) {
+ if pTrigger != 0 && isUpdate != 0 {
Xsqlite3VdbeAddOp1(tls, v, OP_CursorUnlock, iDataCur)
}
if regTrigCnt != 0 {
@@ -106168,7 +107717,7 @@ func Xsqlite3GenerateConstraintChecks(tls *libc.TLS, pParse uintptr, pTab uintpt
if (*Index)(unsafe.Pointer(pIdx)).FpPartIdxWhere != 0 {
// Bypass the recheck if this partial index is not defined
// for the current row
- Xsqlite3VdbeAddOp2(tls, v, OP_IsNull, (regIdx - 1), lblRecheckOk)
+ Xsqlite3VdbeAddOp2(tls, v, OP_IsNull, regIdx-1, lblRecheckOk)
}
// Copy the constraint check code from above, except change
@@ -106181,18 +107730,18 @@ func Xsqlite3GenerateConstraintChecks(tls *libc.TLS, pParse uintptr, pTab uintpt
// Hence, make a complete copy of the opcode, rather than using
// a pointer to the opcode.
*(*VdbeOp)(unsafe.Pointer(bp + 36 /* x */)) = *(*VdbeOp)(unsafe.Pointer(Xsqlite3VdbeGetOp(tls, v, addrConflictCk)))
- if int32((*VdbeOp)(unsafe.Pointer(bp+36 /* &x */)).Fopcode) != OP_IdxRowid {
+ if int32((*VdbeOp)(unsafe.Pointer(bp+36)).Fopcode) != OP_IdxRowid {
var p2 int32 // New P2 value for copied conflict check opcode
var zP4 uintptr
- if (int32(Xsqlite3OpcodeProperty[(*VdbeOp)(unsafe.Pointer(bp+36 /* &x */)).Fopcode]) & OPFLG_JUMP) != 0 {
+ if int32(Xsqlite3OpcodeProperty[(*VdbeOp)(unsafe.Pointer(bp+36)).Fopcode])&OPFLG_JUMP != 0 {
p2 = lblRecheckOk
} else {
p2 = (*VdbeOp)(unsafe.Pointer(bp + 36 /* &x */)).Fp2
}
- if int32((*VdbeOp)(unsafe.Pointer(bp+36 /* &x */)).Fp4type) == (-3) {
- zP4 = uintptr(*(*int32)(unsafe.Pointer(bp + 36 /* &x */ + 16 /* &.p4 */)))
+ if int32((*VdbeOp)(unsafe.Pointer(bp+36)).Fp4type) == -3 {
+ zP4 = uintptr(*(*int32)(unsafe.Pointer(bp + 36 + 16)))
} else {
- zP4 = *(*uintptr)(unsafe.Pointer(bp + 36 /* &x */ + 16 /* &.p4 */))
+ zP4 = *(*uintptr)(unsafe.Pointer(bp + 36 + 16))
}
Xsqlite3VdbeAddOp4(tls, v, int32((*VdbeOp)(unsafe.Pointer(bp+36 /* &x */)).Fopcode), (*VdbeOp)(unsafe.Pointer(bp+36 /* &x */)).Fp1, p2, (*VdbeOp)(unsafe.Pointer(bp+36 /* &x */)).Fp3, zP4, int32((*VdbeOp)(unsafe.Pointer(bp+36 /* &x */)).Fp4type))
Xsqlite3VdbeChangeP5(tls, v, (*VdbeOp)(unsafe.Pointer(bp+36 /* &x */)).Fp5)
@@ -106215,10 +107764,10 @@ func Xsqlite3GenerateConstraintChecks(tls *libc.TLS, pParse uintptr, pTab uintpt
if regR != regIdx {
Xsqlite3ReleaseTempRange(tls, pParse, regR, nPkField)
}
- if ((pUpsertClause != 0) &&
- (upsertIpkReturn != 0)) &&
- (Xsqlite3UpsertNextIsIPK(tls, pUpsertClause) != 0) {
- Xsqlite3VdbeGoto(tls, v, (upsertIpkDelay + 1))
+ if pUpsertClause != 0 &&
+ upsertIpkReturn != 0 &&
+ Xsqlite3UpsertNextIsIPK(tls, pUpsertClause) != 0 {
+ Xsqlite3VdbeGoto(tls, v, upsertIpkDelay+1)
Xsqlite3VdbeJumpHere(tls, v, upsertIpkReturn)
upsertIpkReturn = 0
}
@@ -106252,9 +107801,9 @@ func Xsqlite3GenerateConstraintChecks(tls *libc.TLS, pParse uintptr, pTab uintpt
}
// Generate the table record
- if ((*Table)(unsafe.Pointer((pTab))).FtabFlags & U32(TF_WithoutRowid)) == U32(0) {
+ if (*Table)(unsafe.Pointer(pTab)).FtabFlags&U32(TF_WithoutRowid) == U32(0) {
var regRec int32 = *(*int32)(unsafe.Pointer(aRegIdx + uintptr(*(*int32)(unsafe.Pointer(bp + 32 /* ix */)))*4))
- Xsqlite3VdbeAddOp3(tls, v, OP_MakeRecord, (regNewData + 1), int32((*Table)(unsafe.Pointer(pTab)).FnNVCol), regRec)
+ Xsqlite3VdbeAddOp3(tls, v, OP_MakeRecord, regNewData+1, int32((*Table)(unsafe.Pointer(pTab)).FnNVCol), regRec)
if !(bAffinityDone != 0) {
Xsqlite3TableAffinity(tls, v, pTab, 0)
@@ -106269,7 +107818,7 @@ func Xsqlite3GenerateConstraintChecks(tls *libc.TLS, pParse uintptr, pTab uintpt
// number is iCur, and register regData contains the new record for the
// PK index. This function adds code to invoke the pre-update hook,
// if one is registered.
-func codeWithoutRowidPreupdate(tls *libc.TLS, pParse uintptr, pTab uintptr, iCur int32, regData int32) { /* sqlite3.c:125487:13: */
+func codeWithoutRowidPreupdate(tls *libc.TLS, pParse uintptr, pTab uintptr, iCur int32, regData int32) { /* sqlite3.c:126477:13: */
var v uintptr = (*Parse)(unsafe.Pointer(pParse)).FpVdbe
var r int32 = Xsqlite3GetTempReg(tls, pParse)
@@ -106286,7 +107835,7 @@ func codeWithoutRowidPreupdate(tls *libc.TLS, pParse uintptr, pTab uintptr, iCur
//
// The arguments to this routine should be the same as the first six
// arguments to sqlite3GenerateConstraintChecks.
-func Xsqlite3CompleteInsertion(tls *libc.TLS, pParse uintptr, pTab uintptr, iDataCur int32, iIdxCur int32, regNewData int32, aRegIdx uintptr, update_flags int32, appendBias int32, useSeekResult int32) { /* sqlite3.c:125515:21: */
+func Xsqlite3CompleteInsertion(tls *libc.TLS, pParse uintptr, pTab uintptr, iDataCur int32, iIdxCur int32, regNewData int32, aRegIdx uintptr, update_flags int32, appendBias int32, useSeekResult int32) { /* sqlite3.c:126505:21: */
var v uintptr // Prepared statements under construction
var pIdx uintptr // An index being inserted or updated
var pik_flags U8 // flag values passed to the btree insert
@@ -106308,7 +107857,7 @@ __1:
goto __2
}
if (*Index)(unsafe.Pointer(pIdx)).FpPartIdxWhere != 0 {
- Xsqlite3VdbeAddOp2(tls, v, OP_IsNull, *(*int32)(unsafe.Pointer(aRegIdx + uintptr(i)*4)), (Xsqlite3VdbeCurrentAddr(tls, v) + 2))
+ Xsqlite3VdbeAddOp2(tls, v, OP_IsNull, *(*int32)(unsafe.Pointer(aRegIdx + uintptr(i)*4)), Xsqlite3VdbeCurrentAddr(tls, v)+2)
}
pik_flags = func() uint8 {
@@ -106317,18 +107866,18 @@ __1:
}
return uint8(0)
}()
- if ((int32(*(*uint16)(unsafe.Pointer((pIdx) + 56 /* &.idxType */)) & 0x3 >> 0)) == SQLITE_IDXTYPE_PRIMARYKEY) && !(((*Table)(unsafe.Pointer((pTab))).FtabFlags & U32(TF_WithoutRowid)) == U32(0)) {
+ if int32(*(*uint16)(unsafe.Pointer(pIdx + 56))&0x3>>0) == SQLITE_IDXTYPE_PRIMARYKEY && !((*Table)(unsafe.Pointer(pTab)).FtabFlags&U32(TF_WithoutRowid) == U32(0)) {
- pik_flags = U8(int32(pik_flags) | (OPFLAG_NCHANGE))
- pik_flags = U8(int32(pik_flags) | (update_flags & OPFLAG_SAVEPOSITION))
+ pik_flags = U8(int32(pik_flags) | OPFLAG_NCHANGE)
+ pik_flags = U8(int32(pik_flags) | update_flags&OPFLAG_SAVEPOSITION)
if update_flags == 0 {
- codeWithoutRowidPreupdate(tls, pParse, pTab, (iIdxCur + i), *(*int32)(unsafe.Pointer(aRegIdx + uintptr(i)*4)))
+ codeWithoutRowidPreupdate(tls, pParse, pTab, iIdxCur+i, *(*int32)(unsafe.Pointer(aRegIdx + uintptr(i)*4)))
}
}
- Xsqlite3VdbeAddOp4Int(tls, v, OP_IdxInsert, (iIdxCur + i), *(*int32)(unsafe.Pointer(aRegIdx + uintptr(i)*4)),
- (*(*int32)(unsafe.Pointer(aRegIdx + uintptr(i)*4)) + 1),
+ Xsqlite3VdbeAddOp4Int(tls, v, OP_IdxInsert, iIdxCur+i, *(*int32)(unsafe.Pointer(aRegIdx + uintptr(i)*4)),
+ *(*int32)(unsafe.Pointer(aRegIdx + uintptr(i)*4))+1,
func() int32 {
- if (uint32(int32(*(*uint16)(unsafe.Pointer(pIdx + 56 /* &.uniqNotNull */)) & 0x8 >> 3))) != 0 {
+ if uint32(int32(*(*uint16)(unsafe.Pointer(pIdx + 56))&0x8>>3)) != 0 {
return int32((*Index)(unsafe.Pointer(pIdx)).FnKeyCol)
}
return int32((*Index)(unsafe.Pointer(pIdx)).FnColumn)
@@ -106344,25 +107893,25 @@ __2:
goto __3
__3:
;
- if !(((*Table)(unsafe.Pointer((pTab))).FtabFlags & U32(TF_WithoutRowid)) == U32(0)) {
+ if !((*Table)(unsafe.Pointer(pTab)).FtabFlags&U32(TF_WithoutRowid) == U32(0)) {
return
}
if (*Parse)(unsafe.Pointer(pParse)).Fnested != 0 {
pik_flags = U8(0)
} else {
pik_flags = U8(OPFLAG_NCHANGE)
- pik_flags = U8(int32(pik_flags) | (func() int32 {
+ pik_flags = U8(int32(pik_flags) | func() int32 {
if update_flags != 0 {
return update_flags
}
return OPFLAG_LASTROWID
- }()))
+ }())
}
if appendBias != 0 {
- pik_flags = U8(int32(pik_flags) | (OPFLAG_APPEND))
+ pik_flags = U8(int32(pik_flags) | OPFLAG_APPEND)
}
if useSeekResult != 0 {
- pik_flags = U8(int32(pik_flags) | (OPFLAG_USESEEKRESULT))
+ pik_flags = U8(int32(pik_flags) | OPFLAG_USESEEKRESULT)
}
Xsqlite3VdbeAddOp3(tls, v, OP_Insert, iDataCur, *(*int32)(unsafe.Pointer(aRegIdx + uintptr(i)*4)), regNewData)
if !(int32((*Parse)(unsafe.Pointer(pParse)).Fnested) != 0) {
@@ -106390,17 +107939,18 @@ __3:
//
// If pTab is a virtual table, then this routine is a no-op and the
// *piDataCur and *piIdxCur values are left uninitialized.
-func Xsqlite3OpenTableAndIndices(tls *libc.TLS, pParse uintptr, pTab uintptr, op int32, p5 U8, iBase int32, aToOpen uintptr, piDataCur uintptr, piIdxCur uintptr) int32 { /* sqlite3.c:125604:20: */
+func Xsqlite3OpenTableAndIndices(tls *libc.TLS, pParse uintptr, pTab uintptr, op int32, p5 U8, iBase int32, aToOpen uintptr, piDataCur uintptr, piIdxCur uintptr) int32 { /* sqlite3.c:126594:20: */
var i int32
var iDb int32
var iDataCur int32
var pIdx uintptr
var v uintptr
- if (*Table)(unsafe.Pointer(pTab)).FnModuleArg != 0 {
+ if int32((*Table)(unsafe.Pointer(pTab)).FeTabType) == TABTYP_VTAB {
// This routine is a no-op for virtual tables. Leave the output
- // variables *piDataCur and *piIdxCur uninitialized so that valgrind
- // can detect if they are used by mistake in the caller.
+ // variables *piDataCur and *piIdxCur set to illegal cursor numbers
+ // for improved error detection.
+ *(*int32)(unsafe.Pointer(piDataCur)) = libc.AssignPtrInt32(piIdxCur, -999)
return 0
}
iDb = Xsqlite3SchemaToIndex(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, (*Table)(unsafe.Pointer(pTab)).FpSchema)
@@ -106413,10 +107963,10 @@ func Xsqlite3OpenTableAndIndices(tls *libc.TLS, pParse uintptr, pTab uintptr, op
if piDataCur != 0 {
*(*int32)(unsafe.Pointer(piDataCur)) = iDataCur
}
- if (((*Table)(unsafe.Pointer((pTab))).FtabFlags & U32(TF_WithoutRowid)) == U32(0)) && ((aToOpen == uintptr(0)) || (*(*U8)(unsafe.Pointer(aToOpen)) != 0)) {
+ if (*Table)(unsafe.Pointer(pTab)).FtabFlags&U32(TF_WithoutRowid) == U32(0) && (aToOpen == uintptr(0) || *(*U8)(unsafe.Pointer(aToOpen)) != 0) {
Xsqlite3OpenTable(tls, pParse, iDataCur, iDb, pTab, op)
} else {
- Xsqlite3TableLock(tls, pParse, iDb, (*Table)(unsafe.Pointer(pTab)).Ftnum, (uint8(libc.Bool32(op == OP_OpenWrite))), (*Table)(unsafe.Pointer(pTab)).FzName)
+ Xsqlite3TableLock(tls, pParse, iDb, (*Table)(unsafe.Pointer(pTab)).Ftnum, uint8(libc.Bool32(op == OP_OpenWrite)), (*Table)(unsafe.Pointer(pTab)).FzName)
}
if piIdxCur != 0 {
*(*int32)(unsafe.Pointer(piIdxCur)) = iBase
@@ -106430,13 +107980,13 @@ __1:
{
var iIdxCur int32 = libc.PostIncInt32(&iBase, 1)
- if ((int32(*(*uint16)(unsafe.Pointer((pIdx) + 56 /* &.idxType */)) & 0x3 >> 0)) == SQLITE_IDXTYPE_PRIMARYKEY) && !(((*Table)(unsafe.Pointer((pTab))).FtabFlags & U32(TF_WithoutRowid)) == U32(0)) {
+ if int32(*(*uint16)(unsafe.Pointer(pIdx + 56))&0x3>>0) == SQLITE_IDXTYPE_PRIMARYKEY && !((*Table)(unsafe.Pointer(pTab)).FtabFlags&U32(TF_WithoutRowid) == U32(0)) {
if piDataCur != 0 {
*(*int32)(unsafe.Pointer(piDataCur)) = iIdxCur
}
p5 = U8(0)
}
- if (aToOpen == uintptr(0)) || (*(*U8)(unsafe.Pointer(aToOpen + uintptr((i + 1)))) != 0) {
+ if aToOpen == uintptr(0) || *(*U8)(unsafe.Pointer(aToOpen + uintptr(i+1))) != 0 {
Xsqlite3VdbeAddOp3(tls, v, op, iIdxCur, int32((*Index)(unsafe.Pointer(pIdx)).Ftnum), iDb)
Xsqlite3VdbeSetP4KeyInfo(tls, pParse, pIdx)
Xsqlite3VdbeChangeP5(tls, v, uint16(p5))
@@ -106467,10 +108017,10 @@ __3:
// * The same onError processing (OE_Abort, OE_Ignore, etc)
// * The same collating sequence on each column
// * The index has the exact same WHERE clause
-func xferCompatibleIndex(tls *libc.TLS, pDest uintptr, pSrc uintptr) int32 { /* sqlite3.c:125682:12: */
+func xferCompatibleIndex(tls *libc.TLS, pDest uintptr, pSrc uintptr) int32 { /* sqlite3.c:126673:12: */
var i int32
- if (int32((*Index)(unsafe.Pointer(pDest)).FnKeyCol) != int32((*Index)(unsafe.Pointer(pSrc)).FnKeyCol)) || (int32((*Index)(unsafe.Pointer(pDest)).FnColumn) != int32((*Index)(unsafe.Pointer(pSrc)).FnColumn)) {
+ if int32((*Index)(unsafe.Pointer(pDest)).FnKeyCol) != int32((*Index)(unsafe.Pointer(pSrc)).FnKeyCol) || int32((*Index)(unsafe.Pointer(pDest)).FnColumn) != int32((*Index)(unsafe.Pointer(pSrc)).FnColumn) {
return 0 // Different number of columns
}
if int32((*Index)(unsafe.Pointer(pDest)).FonError) != int32((*Index)(unsafe.Pointer(pSrc)).FonError) {
@@ -106480,10 +108030,10 @@ func xferCompatibleIndex(tls *libc.TLS, pDest uintptr, pSrc uintptr) int32 { /*
if int32(*(*I16)(unsafe.Pointer((*Index)(unsafe.Pointer(pSrc)).FaiColumn + uintptr(i)*2))) != int32(*(*I16)(unsafe.Pointer((*Index)(unsafe.Pointer(pDest)).FaiColumn + uintptr(i)*2))) {
return 0 // Different columns indexed
}
- if int32(*(*I16)(unsafe.Pointer((*Index)(unsafe.Pointer(pSrc)).FaiColumn + uintptr(i)*2))) == (-2) {
+ if int32(*(*I16)(unsafe.Pointer((*Index)(unsafe.Pointer(pSrc)).FaiColumn + uintptr(i)*2))) == -2 {
- if Xsqlite3ExprCompare(tls, uintptr(0), (*ExprList_item)(unsafe.Pointer(((*Index)(unsafe.Pointer(pSrc)).FaColExpr+8 /* &.a */)+uintptr(i)*20)).FpExpr,
- (*ExprList_item)(unsafe.Pointer(((*Index)(unsafe.Pointer(pDest)).FaColExpr+8 /* &.a */)+uintptr(i)*20)).FpExpr, -1) != 0 {
+ if Xsqlite3ExprCompare(tls, uintptr(0), (*ExprList_item)(unsafe.Pointer((*Index)(unsafe.Pointer(pSrc)).FaColExpr+8+uintptr(i)*20)).FpExpr,
+ (*ExprList_item)(unsafe.Pointer((*Index)(unsafe.Pointer(pDest)).FaColExpr+8+uintptr(i)*20)).FpExpr, -1) != 0 {
return 0 // Different expressions in the index
}
}
@@ -106525,7 +108075,7 @@ func xferCompatibleIndex(tls *libc.TLS, pDest uintptr, pSrc uintptr) int32 { /*
// is no chance that the xfer optimization can be applied.
//
// This optimization is particularly useful at making VACUUM run faster.
-func xferOptimization(tls *libc.TLS, pParse uintptr, pDest uintptr, pSelect uintptr, onError int32, iDbDest int32) int32 { /* sqlite3.c:125743:12: */
+func xferOptimization(tls *libc.TLS, pParse uintptr, pDest uintptr, pSelect uintptr, onError int32, iDbDest int32) int32 { /* sqlite3.c:126734:12: */
var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb
var pEList uintptr // The result set of the SELECT
var pSrc uintptr // The table in the FROM clause of SELECT
@@ -106549,7 +108099,7 @@ func xferOptimization(tls *libc.TLS, pParse uintptr, pDest uintptr, pSelect uint
if pSelect == uintptr(0) {
return 0 // Must be of the form INSERT INTO ... SELECT ...
}
- if ((*Parse)(unsafe.Pointer(pParse)).FpWith != 0) || ((*Select)(unsafe.Pointer(pSelect)).FpWith != 0) {
+ if (*Parse)(unsafe.Pointer(pParse)).FpWith != 0 || (*Select)(unsafe.Pointer(pSelect)).FpWith != 0 {
// Do not attempt to process this query if there are an WITH clauses
// attached to it. Proceeding may generate a false "no such table: xxx"
// error if pSelect reads from a CTE named "xxx".
@@ -106558,7 +108108,7 @@ func xferOptimization(tls *libc.TLS, pParse uintptr, pDest uintptr, pSelect uint
if Xsqlite3TriggerList(tls, pParse, pDest) != 0 {
return 0 // tab1 must not have triggers
}
- if (*Table)(unsafe.Pointer(pDest)).FnModuleArg != 0 {
+ if int32((*Table)(unsafe.Pointer(pDest)).FeTabType) == TABTYP_VTAB {
return 0 // tab1 must not be a virtual table
}
if onError == OE_Default {
@@ -106573,7 +108123,7 @@ func xferOptimization(tls *libc.TLS, pParse uintptr, pDest uintptr, pSelect uint
if (*SrcList)(unsafe.Pointer((*Select)(unsafe.Pointer(pSelect)).FpSrc)).FnSrc != 1 {
return 0 // FROM clause must have exactly one term
}
- if (*SrcItem)(unsafe.Pointer(((*Select)(unsafe.Pointer(pSelect)).FpSrc + 8 /* &.a */))).FpSelect != 0 {
+ if (*SrcItem)(unsafe.Pointer((*Select)(unsafe.Pointer(pSelect)).FpSrc+8)).FpSelect != 0 {
return 0 // FROM clause cannot contain a subquery
}
if (*Select)(unsafe.Pointer(pSelect)).FpWhere != 0 {
@@ -106593,7 +108143,7 @@ func xferOptimization(tls *libc.TLS, pParse uintptr, pDest uintptr, pSelect uint
if (*Select)(unsafe.Pointer(pSelect)).FpPrior != 0 {
return 0 // SELECT may not be a compound query
}
- if ((*Select)(unsafe.Pointer(pSelect)).FselFlags & U32(SF_Distinct)) != 0 {
+ if (*Select)(unsafe.Pointer(pSelect)).FselFlags&U32(SF_Distinct) != 0 {
return 0 // SELECT may not be DISTINCT
}
pEList = (*Select)(unsafe.Pointer(pSelect)).FpEList
@@ -106602,7 +108152,7 @@ func xferOptimization(tls *libc.TLS, pParse uintptr, pDest uintptr, pSelect uint
return 0 // The result set must have exactly one column
}
- if int32((*Expr)(unsafe.Pointer((*ExprList_item)(unsafe.Pointer((pEList + 8 /* &.a */))).FpExpr)).Fop) != TK_ASTERISK {
+ if int32((*Expr)(unsafe.Pointer((*ExprList_item)(unsafe.Pointer(pEList+8)).FpExpr)).Fop) != TK_ASTERISK {
return 0 // The result set must be the special operator "*"
}
@@ -106614,18 +108164,15 @@ func xferOptimization(tls *libc.TLS, pParse uintptr, pDest uintptr, pSelect uint
if pSrc == uintptr(0) {
return 0 // FROM clause does not contain a real table
}
- if ((*Table)(unsafe.Pointer(pSrc)).Ftnum == (*Table)(unsafe.Pointer(pDest)).Ftnum) && ((*Table)(unsafe.Pointer(pSrc)).FpSchema == (*Table)(unsafe.Pointer(pDest)).FpSchema) {
+ if (*Table)(unsafe.Pointer(pSrc)).Ftnum == (*Table)(unsafe.Pointer(pDest)).Ftnum && (*Table)(unsafe.Pointer(pSrc)).FpSchema == (*Table)(unsafe.Pointer(pDest)).FpSchema {
// Possible due to bad sqlite_schema.rootpage
return 0 // tab1 and tab2 may not be the same table
}
- if (libc.Bool32(((*Table)(unsafe.Pointer((pDest))).FtabFlags & U32(TF_WithoutRowid)) == U32(0))) != (libc.Bool32(((*Table)(unsafe.Pointer((pSrc))).FtabFlags & U32(TF_WithoutRowid)) == U32(0))) {
+ if libc.Bool32((*Table)(unsafe.Pointer(pDest)).FtabFlags&U32(TF_WithoutRowid) == U32(0)) != libc.Bool32((*Table)(unsafe.Pointer(pSrc)).FtabFlags&U32(TF_WithoutRowid) == U32(0)) {
return 0 // source and destination must both be WITHOUT ROWID or not
}
- if (*Table)(unsafe.Pointer(pSrc)).FnModuleArg != 0 {
- return 0 // tab2 must not be a virtual table
- }
- if (*Table)(unsafe.Pointer(pSrc)).FpSelect != 0 {
- return 0 // tab2 may not be a view
+ if !(int32((*Table)(unsafe.Pointer(pSrc)).FeTabType) == TABTYP_NORM) {
+ return 0 // tab2 may not be a view or virtual table
}
if int32((*Table)(unsafe.Pointer(pDest)).FnCol) != int32((*Table)(unsafe.Pointer(pSrc)).FnCol) {
return 0 // Number of columns must be the same in tab1 and tab2
@@ -106633,9 +108180,12 @@ func xferOptimization(tls *libc.TLS, pParse uintptr, pDest uintptr, pSelect uint
if int32((*Table)(unsafe.Pointer(pDest)).FiPKey) != int32((*Table)(unsafe.Pointer(pSrc)).FiPKey) {
return 0 // Both tables must have the same INTEGER PRIMARY KEY
}
+ if (*Table)(unsafe.Pointer(pDest)).FtabFlags&U32(TF_Strict) != U32(0) && (*Table)(unsafe.Pointer(pSrc)).FtabFlags&U32(TF_Strict) == U32(0) {
+ return 0 // Cannot feed from a non-strict into a strict table
+ }
for i = 0; i < int32((*Table)(unsafe.Pointer(pDest)).FnCol); i++ {
- var pDestCol uintptr = ((*Table)(unsafe.Pointer(pDest)).FaCol + uintptr(i)*20)
- var pSrcCol uintptr = ((*Table)(unsafe.Pointer(pSrc)).FaCol + uintptr(i)*20)
+ var pDestCol uintptr = (*Table)(unsafe.Pointer(pDest)).FaCol + uintptr(i)*16
+ var pSrcCol uintptr = (*Table)(unsafe.Pointer(pSrc)).FaCol + uintptr(i)*16
// Even if tables t1 and t2 have identical schemas, if they contain
// generated columns, then this statement is semantically incorrect:
//
@@ -106651,14 +108201,16 @@ func xferOptimization(tls *libc.TLS, pParse uintptr, pDest uintptr, pSelect uint
// We could, in theory, disable this (except for internal use by the
// VACUUM command where it is actually needed). But why do that? It
// seems harmless enough, and provides a useful service.
- if (int32((*Column)(unsafe.Pointer(pDestCol)).FcolFlags) & COLFLAG_GENERATED) != (int32((*Column)(unsafe.Pointer(pSrcCol)).FcolFlags) & COLFLAG_GENERATED) {
+ if int32((*Column)(unsafe.Pointer(pDestCol)).FcolFlags)&COLFLAG_GENERATED != int32((*Column)(unsafe.Pointer(pSrcCol)).FcolFlags)&COLFLAG_GENERATED {
return 0 // Both columns have the same generated-column type
}
// But the transfer is only allowed if both the source and destination
// tables have the exact same expressions for generated columns.
// This requirement could be relaxed for VIRTUAL columns, I suppose.
- if (int32((*Column)(unsafe.Pointer(pDestCol)).FcolFlags) & COLFLAG_GENERATED) != 0 {
- if Xsqlite3ExprCompare(tls, uintptr(0), (*Column)(unsafe.Pointer(pSrcCol)).FpDflt, (*Column)(unsafe.Pointer(pDestCol)).FpDflt, -1) != 0 {
+ if int32((*Column)(unsafe.Pointer(pDestCol)).FcolFlags)&COLFLAG_GENERATED != 0 {
+ if Xsqlite3ExprCompare(tls, uintptr(0),
+ Xsqlite3ColumnExpr(tls, pSrc, pSrcCol),
+ Xsqlite3ColumnExpr(tls, pDest, pDestCol), -1) != 0 {
return 0 // Different generator expressions
}
@@ -106666,24 +108218,27 @@ func xferOptimization(tls *libc.TLS, pParse uintptr, pDest uintptr, pSelect uint
if int32((*Column)(unsafe.Pointer(pDestCol)).Faffinity) != int32((*Column)(unsafe.Pointer(pSrcCol)).Faffinity) {
return 0 // Affinity must be the same on all columns
}
- if Xsqlite3_stricmp(tls, (*Column)(unsafe.Pointer(pDestCol)).FzColl, (*Column)(unsafe.Pointer(pSrcCol)).FzColl) != 0 {
+ if Xsqlite3_stricmp(tls, Xsqlite3ColumnColl(tls, pDestCol),
+ Xsqlite3ColumnColl(tls, pSrcCol)) != 0 {
return 0 // Collating sequence must be the same on all columns
}
- if ((*Column)(unsafe.Pointer(pDestCol)).FnotNull != 0) && !(int32((*Column)(unsafe.Pointer(pSrcCol)).FnotNull) != 0) {
+ if uint32(int32(*(*uint8)(unsafe.Pointer(pDestCol + 4))&0xf>>0)) != 0 && !(int32(*(*uint8)(unsafe.Pointer(pSrcCol + 4))&0xf>>0) != 0) {
return 0 // tab2 must be NOT NULL if tab1 is
}
// Default values for second and subsequent columns need to match.
- if ((int32((*Column)(unsafe.Pointer(pDestCol)).FcolFlags) & COLFLAG_GENERATED) == 0) && (i > 0) {
+ if int32((*Column)(unsafe.Pointer(pDestCol)).FcolFlags)&COLFLAG_GENERATED == 0 && i > 0 {
+ var pDestExpr uintptr = Xsqlite3ColumnExpr(tls, pDest, pDestCol)
+ var pSrcExpr uintptr = Xsqlite3ColumnExpr(tls, pSrc, pSrcCol)
- if ((libc.Bool32((*Column)(unsafe.Pointer(pDestCol)).FpDflt == uintptr(0))) != (libc.Bool32((*Column)(unsafe.Pointer(pSrcCol)).FpDflt == uintptr(0)))) ||
- (((*Column)(unsafe.Pointer(pDestCol)).FpDflt != 0) && (libc.Xstrcmp(tls, *(*uintptr)(unsafe.Pointer((*Column)(unsafe.Pointer(pDestCol)).FpDflt + 8 /* &.u */)),
- *(*uintptr)(unsafe.Pointer((*Column)(unsafe.Pointer(pSrcCol)).FpDflt + 8 /* &.u */))) != 0)) {
+ if libc.Bool32(pDestExpr == uintptr(0)) != libc.Bool32(pSrcExpr == uintptr(0)) ||
+ pDestExpr != uintptr(0) && libc.Xstrcmp(tls, *(*uintptr)(unsafe.Pointer(pDestExpr + 8)),
+ *(*uintptr)(unsafe.Pointer(pSrcExpr + 8))) != 0 {
return 0 // Default values must be the same for all columns
}
}
}
for pDestIdx = (*Table)(unsafe.Pointer(pDest)).FpIndex; pDestIdx != 0; pDestIdx = (*Index)(unsafe.Pointer(pDestIdx)).FpNext {
- if int32((*Index)(unsafe.Pointer((pDestIdx))).FonError) != OE_None {
+ if int32((*Index)(unsafe.Pointer(pDestIdx)).FonError) != OE_None {
destHasUniqueIdx = 1
}
for pSrcIdx = (*Table)(unsafe.Pointer(pSrc)).FpIndex; pSrcIdx != 0; pSrcIdx = (*Index)(unsafe.Pointer(pSrcIdx)).FpNext {
@@ -106694,15 +108249,15 @@ func xferOptimization(tls *libc.TLS, pParse uintptr, pDest uintptr, pSelect uint
if pSrcIdx == uintptr(0) {
return 0 // pDestIdx has no corresponding index in pSrc
}
- if (((*Index)(unsafe.Pointer(pSrcIdx)).Ftnum == (*Index)(unsafe.Pointer(pDestIdx)).Ftnum) && ((*Table)(unsafe.Pointer(pSrc)).FpSchema == (*Table)(unsafe.Pointer(pDest)).FpSchema)) &&
- (Xsqlite3FaultSim(tls, 411) == SQLITE_OK) {
+ if (*Index)(unsafe.Pointer(pSrcIdx)).Ftnum == (*Index)(unsafe.Pointer(pDestIdx)).Ftnum && (*Table)(unsafe.Pointer(pSrc)).FpSchema == (*Table)(unsafe.Pointer(pDest)).FpSchema &&
+ Xsqlite3FaultSim(tls, 411) == SQLITE_OK {
// The sqlite3FaultSim() call allows this corruption test to be
// bypassed during testing, in order to exercise other corruption tests
// further downstream.
return 0 // Corrupt schema - two indexes on the same btree
}
}
- if ((*Table)(unsafe.Pointer(pDest)).FpCheck != 0) && (Xsqlite3ExprListCompare(tls, (*Table)(unsafe.Pointer(pSrc)).FpCheck, (*Table)(unsafe.Pointer(pDest)).FpCheck, -1) != 0) {
+ if (*Table)(unsafe.Pointer(pDest)).FpCheck != 0 && Xsqlite3ExprListCompare(tls, (*Table)(unsafe.Pointer(pSrc)).FpCheck, (*Table)(unsafe.Pointer(pDest)).FpCheck, -1) != 0 {
return 0 // Tables have different CHECK constraints. Ticket #2252
}
// Disallow the transfer optimization if the destination table constains
@@ -106711,10 +108266,11 @@ func xferOptimization(tls *libc.TLS, pParse uintptr, pDest uintptr, pSelect uint
// command, and the VACUUM command disables foreign key constraints. So
// the extra complication to make this rule less restrictive is probably
// not worth the effort. Ticket [6284df89debdfa61db8073e062908af0c9b6118e]
- if (((*Sqlite3)(unsafe.Pointer(db)).Fflags & uint64(SQLITE_ForeignKeys)) != uint64(0)) && ((*Table)(unsafe.Pointer(pDest)).FpFKey != uintptr(0)) {
+
+ if (*Sqlite3)(unsafe.Pointer(db)).Fflags&uint64(SQLITE_ForeignKeys) != uint64(0) && *(*uintptr)(unsafe.Pointer(pDest + 44 + 4)) != uintptr(0) {
return 0
}
- if ((*Sqlite3)(unsafe.Pointer(db)).Fflags & (U64((uint64(0x00001))) << 32)) != uint64(0) {
+ if (*Sqlite3)(unsafe.Pointer(db)).Fflags&(U64(uint64(0x00001))<<32) != uint64(0) {
return 0 // xfer opt does not play well with PRAGMA count_changes
}
@@ -106732,9 +108288,9 @@ func xferOptimization(tls *libc.TLS, pParse uintptr, pDest uintptr, pSelect uint
regRowid = Xsqlite3GetTempReg(tls, pParse)
Xsqlite3OpenTable(tls, pParse, iDest, iDbDest, pDest, OP_OpenWrite)
- if (((*Sqlite3)(unsafe.Pointer(db)).FmDbFlags & U32(DBFLAG_Vacuum)) == U32(0)) && ((((int32((*Table)(unsafe.Pointer(pDest)).FiPKey) < 0) && ((*Table)(unsafe.Pointer(pDest)).FpIndex != uintptr(0))) || // (1)
- (destHasUniqueIdx != 0)) || // (2)
- ((onError != OE_Abort) && (onError != OE_Rollback))) {
+ if (*Sqlite3)(unsafe.Pointer(db)).FmDbFlags&U32(DBFLAG_Vacuum) == U32(0) && (int32((*Table)(unsafe.Pointer(pDest)).FiPKey) < 0 && (*Table)(unsafe.Pointer(pDest)).FpIndex != uintptr(0) ||
+ destHasUniqueIdx != 0 ||
+ onError != OE_Abort && onError != OE_Rollback) {
// In some circumstances, we are able to run the xfer optimization
// only if the destination table is initially empty. Unless the
// DBFLAG_Vacuum flag is set, this block generates code to make
@@ -106755,13 +108311,13 @@ func xferOptimization(tls *libc.TLS, pParse uintptr, pDest uintptr, pSelect uint
emptyDestTest = Xsqlite3VdbeAddOp0(tls, v, OP_Goto)
Xsqlite3VdbeJumpHere(tls, v, addr1)
}
- if ((*Table)(unsafe.Pointer((pSrc))).FtabFlags & U32(TF_WithoutRowid)) == U32(0) {
+ if (*Table)(unsafe.Pointer(pSrc)).FtabFlags&U32(TF_WithoutRowid) == U32(0) {
var insFlags U8
Xsqlite3OpenTable(tls, pParse, iSrc, iDbSrc, pSrc, OP_OpenRead)
emptySrcTest = Xsqlite3VdbeAddOp2(tls, v, OP_Rewind, iSrc, 0)
if int32((*Table)(unsafe.Pointer(pDest)).FiPKey) >= 0 {
addr1 = Xsqlite3VdbeAddOp2(tls, v, OP_Rowid, iSrc, regRowid)
- if ((*Sqlite3)(unsafe.Pointer(db)).FmDbFlags & U32(DBFLAG_Vacuum)) == U32(0) {
+ if (*Sqlite3)(unsafe.Pointer(db)).FmDbFlags&U32(DBFLAG_Vacuum) == U32(0) {
addr2 = Xsqlite3VdbeAddOp3(tls, v, OP_NotExists, iDest, 0, regRowid)
@@ -106769,27 +108325,27 @@ func xferOptimization(tls *libc.TLS, pParse uintptr, pDest uintptr, pSelect uint
Xsqlite3VdbeJumpHere(tls, v, addr2)
}
autoIncStep(tls, pParse, regAutoinc, regRowid)
- } else if ((*Table)(unsafe.Pointer(pDest)).FpIndex == uintptr(0)) && !(((*Sqlite3)(unsafe.Pointer(db)).FmDbFlags & U32(DBFLAG_VacuumInto)) != 0) {
+ } else if (*Table)(unsafe.Pointer(pDest)).FpIndex == uintptr(0) && !((*Sqlite3)(unsafe.Pointer(db)).FmDbFlags&U32(DBFLAG_VacuumInto) != 0) {
addr1 = Xsqlite3VdbeAddOp2(tls, v, OP_NewRowid, iDest, regRowid)
} else {
addr1 = Xsqlite3VdbeAddOp2(tls, v, OP_Rowid, iSrc, regRowid)
}
- if ((*Sqlite3)(unsafe.Pointer(db)).FmDbFlags & U32(DBFLAG_Vacuum)) != 0 {
+ if (*Sqlite3)(unsafe.Pointer(db)).FmDbFlags&U32(DBFLAG_Vacuum) != 0 {
Xsqlite3VdbeAddOp1(tls, v, OP_SeekEnd, iDest)
- insFlags = (U8((OPFLAG_APPEND | OPFLAG_USESEEKRESULT) | OPFLAG_PREFORMAT))
+ insFlags = U8(OPFLAG_APPEND | OPFLAG_USESEEKRESULT | OPFLAG_PREFORMAT)
} else {
- insFlags = (U8(((OPFLAG_NCHANGE | OPFLAG_LASTROWID) | OPFLAG_APPEND) | OPFLAG_PREFORMAT))
+ insFlags = U8(OPFLAG_NCHANGE | OPFLAG_LASTROWID | OPFLAG_APPEND | OPFLAG_PREFORMAT)
}
- if ((*Sqlite3)(unsafe.Pointer(db)).FmDbFlags & U32(DBFLAG_Vacuum)) == U32(0) {
+ if (*Sqlite3)(unsafe.Pointer(db)).FmDbFlags&U32(DBFLAG_Vacuum) == U32(0) {
Xsqlite3VdbeAddOp3(tls, v, OP_RowData, iSrc, regData, 1)
- insFlags = libc.Uint8FromInt32(int32(insFlags) & (libc.CplInt32(OPFLAG_PREFORMAT)))
+ insFlags = libc.Uint8FromInt32(int32(insFlags) & libc.CplInt32(OPFLAG_PREFORMAT))
} else {
Xsqlite3VdbeAddOp3(tls, v, OP_RowCell, iDest, iSrc, regRowid)
}
Xsqlite3VdbeAddOp3(tls, v, OP_Insert, iDest, regData, regRowid)
- if ((*Sqlite3)(unsafe.Pointer(db)).FmDbFlags & U32(DBFLAG_Vacuum)) == U32(0) {
+ if (*Sqlite3)(unsafe.Pointer(db)).FmDbFlags&U32(DBFLAG_Vacuum) == U32(0) {
Xsqlite3VdbeChangeP4(tls, v, -1, pDest, -6)
}
Xsqlite3VdbeChangeP5(tls, v, uint16(insFlags))
@@ -106817,7 +108373,7 @@ func xferOptimization(tls *libc.TLS, pParse uintptr, pDest uintptr, pSelect uint
Xsqlite3VdbeChangeP5(tls, v, uint16(OPFLAG_BULKCSR))
addr1 = Xsqlite3VdbeAddOp2(tls, v, OP_Rewind, iSrc, 0)
- if ((*Sqlite3)(unsafe.Pointer(db)).FmDbFlags & U32(DBFLAG_Vacuum)) != 0 {
+ if (*Sqlite3)(unsafe.Pointer(db)).FmDbFlags&U32(DBFLAG_Vacuum) != 0 {
// This INSERT command is part of a VACUUM operation, which guarantees
// that the destination table is empty. If all indexed columns use
// collation sequence BINARY, then it can also be assumed that the
@@ -106839,24 +108395,24 @@ func xferOptimization(tls *libc.TLS, pParse uintptr, pDest uintptr, pSelect uint
}
}
if i == int32((*Index)(unsafe.Pointer(pSrcIdx)).FnColumn) {
- idxInsFlags = (U8(OPFLAG_USESEEKRESULT | OPFLAG_PREFORMAT))
+ idxInsFlags = U8(OPFLAG_USESEEKRESULT | OPFLAG_PREFORMAT)
Xsqlite3VdbeAddOp1(tls, v, OP_SeekEnd, iDest)
Xsqlite3VdbeAddOp2(tls, v, OP_RowCell, iDest, iSrc)
}
- } else if !(((*Table)(unsafe.Pointer((pSrc))).FtabFlags & U32(TF_WithoutRowid)) == U32(0)) && ((int32(*(*uint16)(unsafe.Pointer(pDestIdx + 56 /* &.idxType */)) & 0x3 >> 0)) == SQLITE_IDXTYPE_PRIMARYKEY) {
- idxInsFlags = U8(int32(idxInsFlags) | (OPFLAG_NCHANGE))
+ } else if !((*Table)(unsafe.Pointer(pSrc)).FtabFlags&U32(TF_WithoutRowid) == U32(0)) && int32(*(*uint16)(unsafe.Pointer(pDestIdx + 56))&0x3>>0) == SQLITE_IDXTYPE_PRIMARYKEY {
+ idxInsFlags = U8(int32(idxInsFlags) | OPFLAG_NCHANGE)
}
- if int32(idxInsFlags) != (OPFLAG_USESEEKRESULT | OPFLAG_PREFORMAT) {
+ if int32(idxInsFlags) != OPFLAG_USESEEKRESULT|OPFLAG_PREFORMAT {
Xsqlite3VdbeAddOp3(tls, v, OP_RowData, iSrc, regData, 1)
- if ((((*Sqlite3)(unsafe.Pointer(db)).FmDbFlags & U32(DBFLAG_Vacuum)) == U32(0)) &&
- !(((*Table)(unsafe.Pointer((pDest))).FtabFlags & U32(TF_WithoutRowid)) == U32(0))) &&
- ((int32(*(*uint16)(unsafe.Pointer((pDestIdx) + 56 /* &.idxType */)) & 0x3 >> 0)) == SQLITE_IDXTYPE_PRIMARYKEY) {
+ if (*Sqlite3)(unsafe.Pointer(db)).FmDbFlags&U32(DBFLAG_Vacuum) == U32(0) &&
+ !((*Table)(unsafe.Pointer(pDest)).FtabFlags&U32(TF_WithoutRowid) == U32(0)) &&
+ int32(*(*uint16)(unsafe.Pointer(pDestIdx + 56))&0x3>>0) == SQLITE_IDXTYPE_PRIMARYKEY {
codeWithoutRowidPreupdate(tls, pParse, pDest, iDest, regData)
}
}
Xsqlite3VdbeAddOp2(tls, v, OP_IdxInsert, iDest, regData)
- Xsqlite3VdbeChangeP5(tls, v, (uint16(int32(idxInsFlags) | OPFLAG_APPEND)))
- Xsqlite3VdbeAddOp2(tls, v, OP_Next, iSrc, (addr1 + 1))
+ Xsqlite3VdbeChangeP5(tls, v, uint16(int32(idxInsFlags)|OPFLAG_APPEND))
+ Xsqlite3VdbeAddOp2(tls, v, OP_Next, iSrc, addr1+1)
Xsqlite3VdbeJumpHere(tls, v, addr1)
Xsqlite3VdbeAddOp2(tls, v, OP_Close, iSrc, 0)
Xsqlite3VdbeAddOp2(tls, v, OP_Close, iDest, 0)
@@ -106905,7 +108461,7 @@ func xferOptimization(tls *libc.TLS, pParse uintptr, pDest uintptr, pSelect uint
// the xCallback() function is called. pArg becomes the first
// argument to xCallback(). If xCallback=NULL then no callback
// is invoked, even for queries.
-func Xsqlite3_exec(tls *libc.TLS, db uintptr, zSql uintptr, xCallback Sqlite3_callback, pArg uintptr, pzErrMsg uintptr) int32 { /* sqlite3.c:126153:16: */
+func Xsqlite3_exec(tls *libc.TLS, db uintptr, zSql uintptr, xCallback Sqlite3_callback, pArg uintptr, pzErrMsg uintptr) int32 { /* sqlite3.c:127150:16: */
bp := tls.Alloc(8)
defer tls.Free(8)
@@ -106923,23 +108479,23 @@ func Xsqlite3_exec(tls *libc.TLS, db uintptr, zSql uintptr, xCallback Sqlite3_ca
*(*uintptr)(unsafe.Pointer(bp /* pStmt */)) = uintptr(0)
azCols = uintptr(0) // True if callback data is initialized
- if !(!(Xsqlite3SafetyCheckOk(tls, db) != 0)) {
+ if !!(Xsqlite3SafetyCheckOk(tls, db) != 0) {
goto __1
}
- return Xsqlite3MisuseError(tls, 126166)
+ return Xsqlite3MisuseError(tls, 127163)
__1:
;
if !(zSql == uintptr(0)) {
goto __2
}
- zSql = ts + 755 /* "" */
+ zSql = ts + 1543 /* "" */
__2:
;
Xsqlite3_mutex_enter(tls, (*Sqlite3)(unsafe.Pointer(db)).Fmutex)
Xsqlite3Error(tls, db, SQLITE_OK)
__3:
- if !((rc == SQLITE_OK) && (*(*uint8)(unsafe.Pointer(zSql)) != 0)) {
+ if !(rc == SQLITE_OK && *(*uint8)(unsafe.Pointer(zSql)) != 0) {
goto __4
}
nCol = 0
@@ -106954,7 +108510,7 @@ __3:
goto __3
__5:
;
- if !(!(*(*uintptr)(unsafe.Pointer(bp /* pStmt */)) != 0)) {
+ if !!(*(*uintptr)(unsafe.Pointer(bp)) != 0) {
goto __6
}
// this happens for a comment or white-space
@@ -106971,15 +108527,15 @@ __7:
rc = Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp /* pStmt */)))
// Invoke the callback function if required
- if !((xCallback != 0) && ((SQLITE_ROW == rc) || (((SQLITE_DONE == rc) && !(callbackIsInit != 0)) &&
- (((*Sqlite3)(unsafe.Pointer(db)).Fflags & uint64(SQLITE_NullCallback)) != 0)))) {
+ if !(xCallback != 0 && (SQLITE_ROW == rc || SQLITE_DONE == rc && !(callbackIsInit != 0) &&
+ (*Sqlite3)(unsafe.Pointer(db)).Fflags&uint64(SQLITE_NullCallback) != 0)) {
goto __9
}
- if !(!(callbackIsInit != 0)) {
+ if !!(callbackIsInit != 0) {
goto __10
}
nCol = Xsqlite3_column_count(tls, *(*uintptr)(unsafe.Pointer(bp /* pStmt */)))
- azCols = Xsqlite3DbMallocRaw(tls, db, (uint64((uint32((2 * nCol) + 1)) * uint32(unsafe.Sizeof(uintptr(0))))))
+ azCols = Xsqlite3DbMallocRaw(tls, db, uint64(uint32(2*nCol+1)*uint32(unsafe.Sizeof(uintptr(0)))))
if !(azCols == uintptr(0)) {
goto __11
}
@@ -107008,14 +108564,14 @@ __10:
if !(rc == SQLITE_ROW) {
goto __15
}
- azVals = (azCols + uintptr(nCol)*4)
+ azVals = azCols + uintptr(nCol)*4
i = 0
__16:
if !(i < nCol) {
goto __18
}
*(*uintptr)(unsafe.Pointer(azVals + uintptr(i)*4)) = Xsqlite3_column_text(tls, *(*uintptr)(unsafe.Pointer(bp /* pStmt */)), i)
- if !(!(int32(*(*uintptr)(unsafe.Pointer(azVals + uintptr(i)*4))) != 0) && (Xsqlite3_column_type(tls, *(*uintptr)(unsafe.Pointer(bp /* pStmt */)), i) != SQLITE_NULL)) {
+ if !(!(int32(*(*uintptr)(unsafe.Pointer(azVals + uintptr(i)*4))) != 0) && Xsqlite3_column_type(tls, *(*uintptr)(unsafe.Pointer(bp)), i) != SQLITE_NULL) {
goto __19
}
Xsqlite3OomFault(tls, db)
@@ -107057,7 +108613,7 @@ __9:
*(*uintptr)(unsafe.Pointer(bp /* pStmt */)) = uintptr(0)
zSql = *(*uintptr)(unsafe.Pointer(bp + 4 /* zLeftover */))
__22:
- if !((int32(Xsqlite3CtypeMap[uint8(*(*uint8)(unsafe.Pointer(zSql)))]) & 0x01) != 0) {
+ if !(int32(Xsqlite3CtypeMap[uint8(*(*uint8)(unsafe.Pointer(zSql)))])&0x01 != 0) {
goto __23
}
zSql++
@@ -107078,7 +108634,7 @@ __4:
;
exec_out:
- if !(*(*uintptr)(unsafe.Pointer(bp /* pStmt */)) != 0) {
+ if !(*(*uintptr)(unsafe.Pointer(bp)) != 0) {
goto __24
}
Xsqlite3VdbeFinalize(tls, *(*uintptr)(unsafe.Pointer(bp /* pStmt */)))
@@ -107087,7 +108643,7 @@ __24:
Xsqlite3DbFree(tls, db, azCols)
rc = Xsqlite3ApiExit(tls, db, rc)
- if !((rc != SQLITE_OK) && (pzErrMsg != 0)) {
+ if !(rc != SQLITE_OK && pzErrMsg != 0) {
goto __25
}
*(*uintptr)(unsafe.Pointer(pzErrMsg)) = Xsqlite3DbStrDup(tls, uintptr(0), Xsqlite3_errmsg(tls, db))
@@ -107115,7 +108671,7 @@ __26:
// This is the function signature used for all extension entry points. It
// is also defined in the file "loadext.c".
-type Sqlite3_loadext_entry = uintptr /* sqlite3.c:126633:13 */
+type Sqlite3_loadext_entry = uintptr /* sqlite3.c:127637:13 */
// The following macros redefine the API routines so that they are
// redirected through the global sqlite3_api structure.
@@ -107437,7 +108993,12 @@ var sqlite3Apis = Sqlite3_api_routines{
Fdatabase_file_object: 0,
// Version 3.34.0 and later
Ftxn_state: 0,
-} /* sqlite3.c:127067:35 */
+ // Version 3.36.1 and later
+ Fchanges64: 0,
+ Ftotal_changes64: 0,
+ // Version 3.37.0 and later
+ Fautovacuum_pages: 0,
+} /* sqlite3.c:128076:35 */
// True if x is the directory separator character
@@ -107451,7 +109012,7 @@ var sqlite3Apis = Sqlite3_api_routines{
// If an error occurs and pzErrMsg is not 0, then fill *pzErrMsg with
// error message text. The calling function should free this memory
// by calling sqlite3DbFree(db, ).
-func sqlite3LoadExtension(tls *libc.TLS, db uintptr, zFile uintptr, zProc uintptr, pzErrMsg uintptr) int32 { /* sqlite3.c:127439:12: */
+func sqlite3LoadExtension(tls *libc.TLS, db uintptr, zFile uintptr, zProc uintptr, pzErrMsg uintptr) int32 { /* sqlite3.c:128453:12: */
bp := tls.Alloc(60)
defer tls.Free(60)
@@ -107489,13 +109050,13 @@ __1:
// must call either sqlite3_enable_load_extension(db) or
// sqlite3_db_config(db, SQLITE_DBCONFIG_ENABLE_LOAD_EXTENSION, 1, 0)
// to turn on extension loading.
- if !(((*Sqlite3)(unsafe.Pointer(db)).Fflags & uint64(SQLITE_LoadExtension)) == uint64(0)) {
+ if !((*Sqlite3)(unsafe.Pointer(db)).Fflags&uint64(SQLITE_LoadExtension) == uint64(0)) {
goto __2
}
if !(pzErrMsg != 0) {
goto __3
}
- *(*uintptr)(unsafe.Pointer(pzErrMsg)) = Xsqlite3_mprintf(tls, ts+10824 /* "not authorized" */, 0)
+ *(*uintptr)(unsafe.Pointer(pzErrMsg)) = Xsqlite3_mprintf(tls, ts+11938 /* "not authorized" */, 0)
__3:
;
return SQLITE_ERROR
@@ -107505,7 +109066,7 @@ __2:
if zProc != 0 {
zEntry = zProc
} else {
- zEntry = ts + 14400 /* "sqlite3_extensio..." */
+ zEntry = ts + 15582 /* "sqlite3_extensio..." */
}
// tag-20210611-1. Some dlopen() implementations will segfault if given
@@ -107522,10 +109083,10 @@ __4:
handle = Xsqlite3OsDlOpen(tls, pVfs, zFile)
ii = 0
__5:
- if !((ii < (int32(uint32(unsafe.Sizeof(azEndings)) / uint32(unsafe.Sizeof(uintptr(0)))))) && (handle == uintptr(0))) {
+ if !(ii < int32(uint32(unsafe.Sizeof(azEndings))/uint32(unsafe.Sizeof(uintptr(0)))) && handle == uintptr(0)) {
goto __7
}
- zAltFile = Xsqlite3_mprintf(tls, ts+10785 /* "%s.%s" */, libc.VaList(bp, zFile, azEndings[ii]))
+ zAltFile = Xsqlite3_mprintf(tls, ts+11899 /* "%s.%s" */, libc.VaList(bp, zFile, azEndings[ii]))
if !(zAltFile == uintptr(0)) {
goto __8
}
@@ -107559,11 +109120,11 @@ __9:
//
// /usr/local/lib/libExample5.4.3.so ==> sqlite3_example_init
// C:/lib/mathfuncs.dll ==> sqlite3_mathfuncs_init
- if !((xInit == uintptr(0)) && (zProc == uintptr(0))) {
+ if !(xInit == uintptr(0) && zProc == uintptr(0)) {
goto __10
}
ncFile = Xsqlite3Strlen30(tls, zFile)
- zAltEntry = Xsqlite3_malloc64(tls, (uint64(ncFile + 30)))
+ zAltEntry = Xsqlite3_malloc64(tls, uint64(ncFile+30))
if !(zAltEntry == uintptr(0)) {
goto __11
}
@@ -107571,10 +109132,10 @@ __9:
return SQLITE_NOMEM
__11:
;
- libc.Xmemcpy(tls, zAltEntry, ts+14423 /* "sqlite3_" */, uint32(8))
- iFile = (ncFile - 1)
+ libc.Xmemcpy(tls, zAltEntry, ts+15605 /* "sqlite3_" */, uint32(8))
+ iFile = ncFile - 1
__12:
- if !((iFile >= 0) && !((int32(*(*uint8)(unsafe.Pointer(zFile + uintptr(iFile))))) == '/')) {
+ if !(iFile >= 0 && !(int32(*(*uint8)(unsafe.Pointer(zFile + uintptr(iFile)))) == '/')) {
goto __14
}
goto __13
@@ -107585,18 +109146,18 @@ __13:
__14:
;
iFile++
- if !(Xsqlite3_strnicmp(tls, (zFile+uintptr(iFile)), ts+14432 /* "lib" */, 3) == 0) {
+ if !(Xsqlite3_strnicmp(tls, zFile+uintptr(iFile), ts+15614, 3) == 0) {
goto __15
}
- iFile = iFile + (3)
+ iFile = iFile + 3
__15:
;
iEntry = 8
__16:
- if !(((libc.AssignInt32(&c, int32(*(*uint8)(unsafe.Pointer(zFile + uintptr(iFile)))))) != 0) && (c != '.')) {
+ if !(libc.AssignInt32(&c, int32(*(*uint8)(unsafe.Pointer(zFile + uintptr(iFile))))) != 0 && c != '.') {
goto __18
}
- if !((int32(Xsqlite3CtypeMap[uint8(c)]) & 0x02) != 0) {
+ if !(int32(Xsqlite3CtypeMap[uint8(c)])&0x02 != 0) {
goto __19
}
*(*uint8)(unsafe.Pointer(zAltEntry + uintptr(libc.PostIncInt32(&iEntry, 1)))) = uint8(Xsqlite3UpperToLower[uint32(c)])
@@ -107609,7 +109170,7 @@ __17:
goto __18
__18:
;
- libc.Xmemcpy(tls, (zAltEntry + uintptr(iEntry)), ts+14436 /* "_init" */, uint32(6))
+ libc.Xmemcpy(tls, zAltEntry+uintptr(iEntry), ts+15618 /* "_init" */, uint32(6))
zEntry = zAltEntry
xInit = Xsqlite3OsDlSym(tls, pVfs, handle, zEntry)
__10:
@@ -107620,15 +109181,15 @@ __10:
if !(pzErrMsg != 0) {
goto __21
}
- nMsg = nMsg + (U64(libc.Xstrlen(tls, zEntry) + Size_t(300)))
+ nMsg = nMsg + U64(libc.Xstrlen(tls, zEntry)+Size_t(300))
*(*uintptr)(unsafe.Pointer(pzErrMsg)) = libc.AssignPtrUintptr(bp+56 /* zErrmsg */, Xsqlite3_malloc64(tls, nMsg))
- if !(*(*uintptr)(unsafe.Pointer(bp + 56 /* zErrmsg */)) != 0) {
+ if !(*(*uintptr)(unsafe.Pointer(bp + 56)) != 0) {
goto __22
}
// zErrmsg would be NULL if not so
Xsqlite3_snprintf(tls, int32(nMsg), *(*uintptr)(unsafe.Pointer(bp + 56 /* zErrmsg */)),
- ts+14442 /* "no entry point [..." */, libc.VaList(bp+16, zEntry, zFile))
- Xsqlite3OsDlError(tls, pVfs, (int32(nMsg - uint64(1))), *(*uintptr)(unsafe.Pointer(bp + 56 /* zErrmsg */)))
+ ts+15624 /* "no entry point [..." */, libc.VaList(bp+16, zEntry, zFile))
+ Xsqlite3OsDlError(tls, pVfs, int32(nMsg-uint64(1)), *(*uintptr)(unsafe.Pointer(bp + 56 /* zErrmsg */)))
__22:
;
__21:
@@ -107645,7 +109206,7 @@ __20:
if !(rc != 0) {
goto __23
}
- if !(rc == (SQLITE_OK | (int32(1) << 8))) {
+ if !(rc == SQLITE_OK|int32(1)<<8) {
goto __24
}
return SQLITE_OK
@@ -107654,7 +109215,7 @@ __24:
if !(pzErrMsg != 0) {
goto __25
}
- *(*uintptr)(unsafe.Pointer(pzErrMsg)) = Xsqlite3_mprintf(tls, ts+14485 /* "error during ini..." */, libc.VaList(bp+32, *(*uintptr)(unsafe.Pointer(bp + 56 /* zErrmsg */))))
+ *(*uintptr)(unsafe.Pointer(pzErrMsg)) = Xsqlite3_mprintf(tls, ts+15667 /* "error during ini..." */, libc.VaList(bp+32, *(*uintptr)(unsafe.Pointer(bp + 56 /* zErrmsg */))))
__25:
;
Xsqlite3_free(tls, *(*uintptr)(unsafe.Pointer(bp + 56 /* zErrmsg */)))
@@ -107664,7 +109225,7 @@ __23:
;
// Append the new shared library handle to the db->aExtension array.
- aHandle = Xsqlite3DbMallocZero(tls, db, (uint64(uint32(unsafe.Sizeof(handle)) * (uint32((*Sqlite3)(unsafe.Pointer(db)).FnExtension + 1)))))
+ aHandle = Xsqlite3DbMallocZero(tls, db, uint64(uint32(unsafe.Sizeof(handle))*uint32((*Sqlite3)(unsafe.Pointer(db)).FnExtension+1)))
if !(aHandle == uintptr(0)) {
goto __26
}
@@ -107674,7 +109235,7 @@ __26:
if !((*Sqlite3)(unsafe.Pointer(db)).FnExtension > 0) {
goto __27
}
- libc.Xmemcpy(tls, aHandle, (*Sqlite3)(unsafe.Pointer(db)).FaExtension, (uint32(unsafe.Sizeof(handle)) * uint32((*Sqlite3)(unsafe.Pointer(db)).FnExtension)))
+ libc.Xmemcpy(tls, aHandle, (*Sqlite3)(unsafe.Pointer(db)).FaExtension, uint32(unsafe.Sizeof(handle))*uint32((*Sqlite3)(unsafe.Pointer(db)).FnExtension))
__27:
;
Xsqlite3DbFree(tls, db, (*Sqlite3)(unsafe.Pointer(db)).FaExtension)
@@ -107687,15 +109248,15 @@ extension_not_found:
if !(pzErrMsg != 0) {
goto __28
}
- nMsg = nMsg + (uint64(300))
+ nMsg = nMsg + uint64(300)
*(*uintptr)(unsafe.Pointer(pzErrMsg)) = libc.AssignPtrUintptr(bp+56 /* zErrmsg */, Xsqlite3_malloc64(tls, nMsg))
- if !(*(*uintptr)(unsafe.Pointer(bp + 56 /* zErrmsg */)) != 0) {
+ if !(*(*uintptr)(unsafe.Pointer(bp + 56)) != 0) {
goto __29
}
// zErrmsg would be NULL if not so
Xsqlite3_snprintf(tls, int32(nMsg), *(*uintptr)(unsafe.Pointer(bp + 56 /* zErrmsg */)),
- ts+14517 /* "unable to open s..." */, libc.VaList(bp+40, FILENAME_MAX, zFile))
- Xsqlite3OsDlError(tls, pVfs, (int32(nMsg - uint64(1))), *(*uintptr)(unsafe.Pointer(bp + 56 /* zErrmsg */)))
+ ts+15699 /* "unable to open s..." */, libc.VaList(bp+40, FILENAME_MAX, zFile))
+ Xsqlite3OsDlError(tls, pVfs, int32(nMsg-uint64(1)), *(*uintptr)(unsafe.Pointer(bp + 56 /* zErrmsg */)))
__29:
;
__28:
@@ -107704,10 +109265,10 @@ __28:
}
var azEndings = [1]uintptr{
- ts + 14554, /* "so" */
-} /* sqlite3.c:127457:21 */
+ ts + 15736, /* "so" */
+} /* sqlite3.c:128471:21 */
-func Xsqlite3_load_extension(tls *libc.TLS, db uintptr, zFile uintptr, zProc uintptr, pzErrMsg uintptr) int32 { /* sqlite3.c:127590:16: */
+func Xsqlite3_load_extension(tls *libc.TLS, db uintptr, zFile uintptr, zProc uintptr, pzErrMsg uintptr) int32 { /* sqlite3.c:128604:16: */
var rc int32
Xsqlite3_mutex_enter(tls, (*Sqlite3)(unsafe.Pointer(db)).Fmutex)
rc = sqlite3LoadExtension(tls, db, zFile, zProc, pzErrMsg)
@@ -107718,7 +109279,7 @@ func Xsqlite3_load_extension(tls *libc.TLS, db uintptr, zFile uintptr, zProc uin
// Call this routine when the database connection is closing in order
// to clean up loaded extensions
-func Xsqlite3CloseExtensions(tls *libc.TLS, db uintptr) { /* sqlite3.c:127608:21: */
+func Xsqlite3CloseExtensions(tls *libc.TLS, db uintptr) { /* sqlite3.c:128622:21: */
var i int32
for i = 0; i < (*Sqlite3)(unsafe.Pointer(db)).FnExtension; i++ {
@@ -107729,12 +109290,12 @@ func Xsqlite3CloseExtensions(tls *libc.TLS, db uintptr) { /* sqlite3.c:127608:21
// Enable or disable extension loading. Extension loading is disabled by
// default so as not to open security holes in older applications.
-func Xsqlite3_enable_load_extension(tls *libc.TLS, db uintptr, onoff int32) int32 { /* sqlite3.c:127621:16: */
+func Xsqlite3_enable_load_extension(tls *libc.TLS, db uintptr, onoff int32) int32 { /* sqlite3.c:128635:16: */
Xsqlite3_mutex_enter(tls, (*Sqlite3)(unsafe.Pointer(db)).Fmutex)
if onoff != 0 {
- *(*U64)(unsafe.Pointer(db + 32 /* &.flags */)) |= (uint64(SQLITE_LoadExtension | SQLITE_LoadExtFunc))
+ *(*U64)(unsafe.Pointer(db + 32)) |= uint64(SQLITE_LoadExtension | SQLITE_LoadExtFunc)
} else {
- *(*U64)(unsafe.Pointer(db + 32 /* &.flags */)) &= (libc.CplUint64((uint64(SQLITE_LoadExtension | SQLITE_LoadExtFunc))))
+ *(*U64)(unsafe.Pointer(db + 32)) &= libc.CplUint64(uint64(SQLITE_LoadExtension | SQLITE_LoadExtFunc))
}
Xsqlite3_mutex_leave(tls, (*Sqlite3)(unsafe.Pointer(db)).Fmutex)
return SQLITE_OK
@@ -107748,15 +109309,15 @@ func Xsqlite3_enable_load_extension(tls *libc.TLS, db uintptr, onoff int32) int3
type sqlite3AutoExtList = struct {
FnExt U32
FaExt uintptr
-} /* sqlite3.c:127641:9 */
+} /* sqlite3.c:128655:9 */
// The following object holds the list of automatically loaded
// extensions.
//
// This list is shared across threads. The SQLITE_MUTEX_STATIC_MAIN
// mutex must be held while accessing this list.
-type Sqlite3AutoExtList = sqlite3AutoExtList /* sqlite3.c:127641:35 */
-var sqlite3Autoext = sqlite3AutoExtList{} /* sqlite3.c:127645:3 */
+type Sqlite3AutoExtList = sqlite3AutoExtList /* sqlite3.c:128655:35 */
+var sqlite3Autoext = sqlite3AutoExtList{} /* sqlite3.c:128659:3 */
// The "wsdAutoext" macro will resolve to the autoextension
// state vector. If writable static data is unsupported on the target,
@@ -107766,7 +109327,7 @@ var sqlite3Autoext = sqlite3AutoExtList{} /* sqlite3.c:127645:3 */
// Register a statically linked extension that is automatically
// loaded by every new database connection.
-func Xsqlite3_auto_extension(tls *libc.TLS, xInit uintptr) int32 { /* sqlite3.c:127667:16: */
+func Xsqlite3_auto_extension(tls *libc.TLS, xInit uintptr) int32 { /* sqlite3.c:128681:16: */
var rc int32 = SQLITE_OK
rc = Xsqlite3_initialize(tls)
if rc != 0 {
@@ -107782,7 +109343,7 @@ func Xsqlite3_auto_extension(tls *libc.TLS, xInit uintptr) int32 { /* sqlite3.c:
}
}
if i == sqlite3Autoext.FnExt {
- var nByte U64 = (U64((sqlite3Autoext.FnExt + U32(1)) * U32(unsafe.Sizeof(uintptr(0)))))
+ var nByte U64 = U64((sqlite3Autoext.FnExt + U32(1)) * U32(unsafe.Sizeof(uintptr(0))))
var aNew uintptr
aNew = Xsqlite3_realloc64(tls, sqlite3Autoext.FaExt, nByte)
if aNew == uintptr(0) {
@@ -107807,13 +109368,13 @@ func Xsqlite3_auto_extension(tls *libc.TLS, xInit uintptr) int32 { /* sqlite3.c:
//
// Return 1 if xInit was found on the list and removed. Return 0 if xInit
// was not on the list.
-func Xsqlite3_cancel_auto_extension(tls *libc.TLS, xInit uintptr) int32 { /* sqlite3.c:127714:16: */
+func Xsqlite3_cancel_auto_extension(tls *libc.TLS, xInit uintptr) int32 { /* sqlite3.c:128728:16: */
var mutex uintptr = Xsqlite3MutexAlloc(tls, SQLITE_MUTEX_STATIC_MAIN)
var i int32
var n int32 = 0
Xsqlite3_mutex_enter(tls, mutex)
- for i = (int32(sqlite3Autoext.FnExt) - 1); i >= 0; i-- {
+ for i = int32(sqlite3Autoext.FnExt) - 1; i >= 0; i-- {
if *(*uintptr)(unsafe.Pointer(sqlite3Autoext.FaExt + uintptr(i)*4)) == xInit {
sqlite3Autoext.FnExt--
*(*uintptr)(unsafe.Pointer(sqlite3Autoext.FaExt + uintptr(i)*4)) = *(*uintptr)(unsafe.Pointer(sqlite3Autoext.FaExt + uintptr(sqlite3Autoext.FnExt)*4))
@@ -107826,7 +109387,7 @@ func Xsqlite3_cancel_auto_extension(tls *libc.TLS, xInit uintptr) int32 { /* sql
}
// Reset the automatic extension loading mechanism.
-func Xsqlite3_reset_auto_extension(tls *libc.TLS) { /* sqlite3.c:127739:17: */
+func Xsqlite3_reset_auto_extension(tls *libc.TLS) { /* sqlite3.c:128753:17: */
if Xsqlite3_initialize(tls) == SQLITE_OK {
var mutex uintptr = Xsqlite3MutexAlloc(tls, SQLITE_MUTEX_STATIC_MAIN)
@@ -107841,7 +109402,7 @@ func Xsqlite3_reset_auto_extension(tls *libc.TLS) { /* sqlite3.c:127739:17: */
// Load all automatic extensions.
//
// If anything goes wrong, set an error in the database connection.
-func Xsqlite3AutoLoadExtensions(tls *libc.TLS, db uintptr) { /* sqlite3.c:127761:21: */
+func Xsqlite3AutoLoadExtensions(tls *libc.TLS, db uintptr) { /* sqlite3.c:128775:21: */
bp := tls.Alloc(12)
defer tls.Free(12)
@@ -107868,11 +109429,11 @@ func Xsqlite3AutoLoadExtensions(tls *libc.TLS, db uintptr) { /* sqlite3.c:127761
}
Xsqlite3_mutex_leave(tls, mutex)
*(*uintptr)(unsafe.Pointer(bp + 8 /* zErrmsg */)) = uintptr(0)
- if (xInit != 0) && ((libc.AssignInt32(&rc, (*struct {
+ if xInit != 0 && libc.AssignInt32(&rc, (*struct {
f func(*libc.TLS, uintptr, uintptr, uintptr) int32
- })(unsafe.Pointer(&struct{ uintptr }{xInit})).f(tls, db, bp+8 /* &zErrmsg */, pThunk))) != 0) {
+ })(unsafe.Pointer(&struct{ uintptr }{xInit})).f(tls, db, bp+8, pThunk)) != 0 {
Xsqlite3ErrorWithMsg(tls, db, rc,
- ts+14557 /* "automatic extens..." */, libc.VaList(bp, *(*uintptr)(unsafe.Pointer(bp + 8 /* zErrmsg */))))
+ ts+15739 /* "automatic extens..." */, libc.VaList(bp, *(*uintptr)(unsafe.Pointer(bp + 8 /* zErrmsg */))))
go1 = 0
}
Xsqlite3_free(tls, *(*uintptr)(unsafe.Pointer(bp + 8 /* zErrmsg */)))
@@ -107916,63 +109477,69 @@ func Xsqlite3AutoLoadExtensions(tls *libc.TLS, db uintptr) { /* sqlite3.c:127761
// Names of columns for pragmas that return multi-column result
// or that return single-column results where the name of the
// result column is different from the name of the pragma
-var pragCName = [51]uintptr{
- /* 0 */ ts + 4171, /* "id" */ // Used by: foreign_key_list
- /* 1 */ ts + 14596, /* "seq" */
- /* 2 */ ts + 7823, /* "table" */
- /* 3 */ ts + 14600, /* "from" */
- /* 4 */ ts + 14605, /* "to" */
- /* 5 */ ts + 14608, /* "on_update" */
- /* 6 */ ts + 14618, /* "on_delete" */
- /* 7 */ ts + 14628, /* "match" */
- /* 8 */ ts + 14634, /* "cid" */ // Used by: table_xinfo
- /* 9 */ ts + 14638, /* "name" */
- /* 10 */ ts + 14643, /* "type" */
- /* 11 */ ts + 14648, /* "notnull" */
- /* 12 */ ts + 14656, /* "dflt_value" */
- /* 13 */ ts + 14667, /* "pk" */
- /* 14 */ ts + 14670, /* "hidden" */
+var pragCName = [57]uintptr{
+ /* 0 */ ts + 4977, /* "id" */ // Used by: foreign_key_list
+ /* 1 */ ts + 15778, /* "seq" */
+ /* 2 */ ts + 8739, /* "table" */
+ /* 3 */ ts + 15782, /* "from" */
+ /* 4 */ ts + 15787, /* "to" */
+ /* 5 */ ts + 15790, /* "on_update" */
+ /* 6 */ ts + 15800, /* "on_delete" */
+ /* 7 */ ts + 15810, /* "match" */
+ /* 8 */ ts + 15816, /* "cid" */ // Used by: table_xinfo
+ /* 9 */ ts + 15820, /* "name" */
+ /* 10 */ ts + 15825, /* "type" */
+ /* 11 */ ts + 15830, /* "notnull" */
+ /* 12 */ ts + 15838, /* "dflt_value" */
+ /* 13 */ ts + 15849, /* "pk" */
+ /* 14 */ ts + 15852, /* "hidden" */
// table_info reuses 8
- /* 15 */ ts + 14677, /* "seqno" */ // Used by: index_xinfo
- /* 16 */ ts + 14634, /* "cid" */
- /* 17 */ ts + 14638, /* "name" */
- /* 18 */ ts + 14683, /* "desc" */
- /* 19 */ ts + 14688, /* "coll" */
- /* 20 */ ts + 14693, /* "key" */
- /* 21 */ ts + 14638, /* "name" */ // Used by: function_list
- /* 22 */ ts + 14697, /* "builtin" */
- /* 23 */ ts + 14643, /* "type" */
- /* 24 */ ts + 14705, /* "enc" */
- /* 25 */ ts + 14709, /* "narg" */
- /* 26 */ ts + 14714, /* "flags" */
- /* 27 */ ts + 10216, /* "tbl" */ // Used by: stats
- /* 28 */ ts + 10212, /* "idx" */
- /* 29 */ ts + 14720, /* "wdth" */
- /* 30 */ ts + 14725, /* "hght" */
- /* 31 */ ts + 14730, /* "flgs" */
- /* 32 */ ts + 14596, /* "seq" */ // Used by: index_list
- /* 33 */ ts + 14638, /* "name" */
- /* 34 */ ts + 14735, /* "unique" */
- /* 35 */ ts + 14742, /* "origin" */
- /* 36 */ ts + 14749, /* "partial" */
- /* 37 */ ts + 7823, /* "table" */ // Used by: foreign_key_check
- /* 38 */ ts + 14757, /* "rowid" */
- /* 39 */ ts + 4174, /* "parent" */
- /* 40 */ ts + 14763, /* "fkid" */
- // index_info reuses 15
- /* 41 */ ts + 14596, /* "seq" */ // Used by: database_list
- /* 42 */ ts + 14638, /* "name" */
- /* 43 */ ts + 14768, /* "file" */
- /* 44 */ ts + 14773, /* "busy" */ // Used by: wal_checkpoint
- /* 45 */ ts + 14778, /* "log" */
- /* 46 */ ts + 14782, /* "checkpointed" */
- // collation_list reuses 32
- /* 47 */ ts + 14795, /* "database" */ // Used by: lock_status
- /* 48 */ ts + 14804, /* "status" */
- /* 49 */ ts + 14811, /* "cache_size" */ // Used by: default_cache_size
+ /* 15 */ ts + 15859, /* "schema" */ // Used by: table_list
+ /* 16 */ ts + 15820, /* "name" */
+ /* 17 */ ts + 15825, /* "type" */
+ /* 18 */ ts + 15866, /* "ncol" */
+ /* 19 */ ts + 15871, /* "wr" */
+ /* 20 */ ts + 15874, /* "strict" */
+ /* 21 */ ts + 15881, /* "seqno" */ // Used by: index_xinfo
+ /* 22 */ ts + 15816, /* "cid" */
+ /* 23 */ ts + 15820, /* "name" */
+ /* 24 */ ts + 15887, /* "desc" */
+ /* 25 */ ts + 15892, /* "coll" */
+ /* 26 */ ts + 15897, /* "key" */
+ /* 27 */ ts + 15820, /* "name" */ // Used by: function_list
+ /* 28 */ ts + 15901, /* "builtin" */
+ /* 29 */ ts + 15825, /* "type" */
+ /* 30 */ ts + 15909, /* "enc" */
+ /* 31 */ ts + 15913, /* "narg" */
+ /* 32 */ ts + 15918, /* "flags" */
+ /* 33 */ ts + 11330, /* "tbl" */ // Used by: stats
+ /* 34 */ ts + 11326, /* "idx" */
+ /* 35 */ ts + 15924, /* "wdth" */
+ /* 36 */ ts + 15929, /* "hght" */
+ /* 37 */ ts + 15934, /* "flgs" */
+ /* 38 */ ts + 15778, /* "seq" */ // Used by: index_list
+ /* 39 */ ts + 15820, /* "name" */
+ /* 40 */ ts + 15939, /* "unique" */
+ /* 41 */ ts + 15946, /* "origin" */
+ /* 42 */ ts + 15953, /* "partial" */
+ /* 43 */ ts + 8739, /* "table" */ // Used by: foreign_key_check
+ /* 44 */ ts + 15961, /* "rowid" */
+ /* 45 */ ts + 4980, /* "parent" */
+ /* 46 */ ts + 15967, /* "fkid" */
+ // index_info reuses 21
+ /* 47 */ ts + 15778, /* "seq" */ // Used by: database_list
+ /* 48 */ ts + 15820, /* "name" */
+ /* 49 */ ts + 15972, /* "file" */
+ /* 50 */ ts + 15977, /* "busy" */ // Used by: wal_checkpoint
+ /* 51 */ ts + 15982, /* "log" */
+ /* 52 */ ts + 15986, /* "checkpointed" */
+ // collation_list reuses 38
+ /* 53 */ ts + 15999, /* "database" */ // Used by: lock_status
+ /* 54 */ ts + 16008, /* "status" */
+ /* 55 */ ts + 16015, /* "cache_size" */ // Used by: default_cache_size
// module_list pragma_list reuses 9
- /* 50 */ ts + 14822, /* "timeout" */ // Used by: busy_timeout
-} /* sqlite3.c:127901:19 */
+ /* 56 */ ts + 16026, /* "timeout" */ // Used by: busy_timeout
+} /* sqlite3.c:128916:19 */
// Definitions of all built-in pragmas
type PragmaName1 = struct {
@@ -107982,245 +109549,249 @@ type PragmaName1 = struct {
FiPragCName U8
FnPragCName U8
FiArg U64
-} /* sqlite3.c:127960:9 */
+} /* sqlite3.c:128981:9 */
// Definitions of all built-in pragmas
-type PragmaName = PragmaName1 /* sqlite3.c:127967:3 */
-var aPragmaName = [65]PragmaName{
- { /* zName: */ FzName: ts + 14830, /* "analysis_limit" */
+type PragmaName = PragmaName1 /* sqlite3.c:128988:3 */
+var aPragmaName = [66]PragmaName{
+ { /* zName: */ FzName: ts + 16034, /* "analysis_limit" */
/* ePragTyp: */ FePragTyp: U8(PragTyp_ANALYSIS_LIMIT),
/* ePragFlg: */ FmPragFlg: U8(PragFlg_Result0)},
- { /* zName: */ FzName: ts + 14845, /* "application_id" */
+ { /* zName: */ FzName: ts + 16049, /* "application_id" */
/* ePragTyp: */ FePragTyp: U8(PragTyp_HEADER_VALUE),
- /* ePragFlg: */ FmPragFlg: (U8(PragFlg_NoColumns1 | PragFlg_Result0)),
+ /* ePragFlg: */ FmPragFlg: U8(PragFlg_NoColumns1 | PragFlg_Result0),
/* iArg: */ FiArg: uint64(BTREE_APPLICATION_ID)},
- { /* zName: */ FzName: ts + 14860, /* "auto_vacuum" */
+ { /* zName: */ FzName: ts + 16064, /* "auto_vacuum" */
/* ePragTyp: */ FePragTyp: U8(PragTyp_AUTO_VACUUM),
- /* ePragFlg: */ FmPragFlg: (U8(((PragFlg_NeedSchema | PragFlg_Result0) | PragFlg_SchemaReq) | PragFlg_NoColumns1))},
- { /* zName: */ FzName: ts + 14872, /* "automatic_index" */
+ /* ePragFlg: */ FmPragFlg: U8(PragFlg_NeedSchema | PragFlg_Result0 | PragFlg_SchemaReq | PragFlg_NoColumns1)},
+ { /* zName: */ FzName: ts + 16076, /* "automatic_index" */
/* ePragTyp: */ FePragTyp: U8(PragTyp_FLAG),
- /* ePragFlg: */ FmPragFlg: (U8(PragFlg_Result0 | PragFlg_NoColumns1)),
+ /* ePragFlg: */ FmPragFlg: U8(PragFlg_Result0 | PragFlg_NoColumns1),
/* iArg: */ FiArg: uint64(SQLITE_AutoIndex)},
- { /* zName: */ FzName: ts + 14888, /* "busy_timeout" */
+ { /* zName: */ FzName: ts + 16092, /* "busy_timeout" */
/* ePragTyp: */ FePragTyp: U8(PragTyp_BUSY_TIMEOUT),
/* ePragFlg: */ FmPragFlg: U8(PragFlg_Result0),
- /* ColNames: */ FiPragCName: U8(50), FnPragCName: U8(1)},
- { /* zName: */ FzName: ts + 14811, /* "cache_size" */
+ /* ColNames: */ FiPragCName: U8(56), FnPragCName: U8(1)},
+ { /* zName: */ FzName: ts + 16015, /* "cache_size" */
/* ePragTyp: */ FePragTyp: U8(PragTyp_CACHE_SIZE),
- /* ePragFlg: */ FmPragFlg: (U8(((PragFlg_NeedSchema | PragFlg_Result0) | PragFlg_SchemaReq) | PragFlg_NoColumns1))},
- { /* zName: */ FzName: ts + 14901, /* "cache_spill" */
+ /* ePragFlg: */ FmPragFlg: U8(PragFlg_NeedSchema | PragFlg_Result0 | PragFlg_SchemaReq | PragFlg_NoColumns1)},
+ { /* zName: */ FzName: ts + 16105, /* "cache_spill" */
/* ePragTyp: */ FePragTyp: U8(PragTyp_CACHE_SPILL),
- /* ePragFlg: */ FmPragFlg: (U8((PragFlg_Result0 | PragFlg_SchemaReq) | PragFlg_NoColumns1))},
- { /* zName: */ FzName: ts + 14913, /* "case_sensitive_l..." */
+ /* ePragFlg: */ FmPragFlg: U8(PragFlg_Result0 | PragFlg_SchemaReq | PragFlg_NoColumns1)},
+ { /* zName: */ FzName: ts + 16117, /* "case_sensitive_l..." */
/* ePragTyp: */ FePragTyp: U8(PragTyp_CASE_SENSITIVE_LIKE),
/* ePragFlg: */ FmPragFlg: U8(PragFlg_NoColumns)},
- { /* zName: */ FzName: ts + 14933, /* "cell_size_check" */
+ { /* zName: */ FzName: ts + 16137, /* "cell_size_check" */
/* ePragTyp: */ FePragTyp: U8(PragTyp_FLAG),
- /* ePragFlg: */ FmPragFlg: (U8(PragFlg_Result0 | PragFlg_NoColumns1)),
+ /* ePragFlg: */ FmPragFlg: U8(PragFlg_Result0 | PragFlg_NoColumns1),
/* iArg: */ FiArg: uint64(SQLITE_CellSizeCk)},
- { /* zName: */ FzName: ts + 14949, /* "checkpoint_fullf..." */
+ { /* zName: */ FzName: ts + 16153, /* "checkpoint_fullf..." */
/* ePragTyp: */ FePragTyp: U8(PragTyp_FLAG),
- /* ePragFlg: */ FmPragFlg: (U8(PragFlg_Result0 | PragFlg_NoColumns1)),
+ /* ePragFlg: */ FmPragFlg: U8(PragFlg_Result0 | PragFlg_NoColumns1),
/* iArg: */ FiArg: uint64(SQLITE_CkptFullFSync)},
- { /* zName: */ FzName: ts + 14970, /* "collation_list" */
+ { /* zName: */ FzName: ts + 16174, /* "collation_list" */
/* ePragTyp: */ FePragTyp: U8(PragTyp_COLLATION_LIST),
/* ePragFlg: */ FmPragFlg: U8(PragFlg_Result0),
- /* ColNames: */ FiPragCName: U8(32), FnPragCName: U8(2)},
- { /* zName: */ FzName: ts + 14985, /* "compile_options" */
+ /* ColNames: */ FiPragCName: U8(38), FnPragCName: U8(2)},
+ { /* zName: */ FzName: ts + 16189, /* "compile_options" */
/* ePragTyp: */ FePragTyp: U8(PragTyp_COMPILE_OPTIONS),
/* ePragFlg: */ FmPragFlg: U8(PragFlg_Result0)},
- { /* zName: */ FzName: ts + 15001, /* "count_changes" */
+ { /* zName: */ FzName: ts + 16205, /* "count_changes" */
/* ePragTyp: */ FePragTyp: U8(PragTyp_FLAG),
- /* ePragFlg: */ FmPragFlg: (U8(PragFlg_Result0 | PragFlg_NoColumns1)),
- /* iArg: */ FiArg: (U64((uint64(0x00001))) << 32)},
- { /* zName: */ FzName: ts + 15015, /* "data_version" */
+ /* ePragFlg: */ FmPragFlg: U8(PragFlg_Result0 | PragFlg_NoColumns1),
+ /* iArg: */ FiArg: U64(uint64(0x00001)) << 32},
+ { /* zName: */ FzName: ts + 16219, /* "data_version" */
/* ePragTyp: */ FePragTyp: U8(PragTyp_HEADER_VALUE),
- /* ePragFlg: */ FmPragFlg: (U8(PragFlg_ReadOnly | PragFlg_Result0)),
+ /* ePragFlg: */ FmPragFlg: U8(PragFlg_ReadOnly | PragFlg_Result0),
/* iArg: */ FiArg: uint64(BTREE_DATA_VERSION)},
- { /* zName: */ FzName: ts + 15028, /* "database_list" */
+ { /* zName: */ FzName: ts + 16232, /* "database_list" */
/* ePragTyp: */ FePragTyp: U8(PragTyp_DATABASE_LIST),
- /* ePragFlg: */ FmPragFlg: (U8(PragFlg_NeedSchema | PragFlg_Result0)),
- /* ColNames: */ FiPragCName: U8(41), FnPragCName: U8(3)},
- { /* zName: */ FzName: ts + 15042, /* "default_cache_si..." */
+ /* ePragFlg: */ FmPragFlg: U8(PragFlg_NeedSchema | PragFlg_Result0),
+ /* ColNames: */ FiPragCName: U8(47), FnPragCName: U8(3)},
+ { /* zName: */ FzName: ts + 16246, /* "default_cache_si..." */
/* ePragTyp: */ FePragTyp: U8(PragTyp_DEFAULT_CACHE_SIZE),
- /* ePragFlg: */ FmPragFlg: (U8(((PragFlg_NeedSchema | PragFlg_Result0) | PragFlg_SchemaReq) | PragFlg_NoColumns1)),
- /* ColNames: */ FiPragCName: U8(49), FnPragCName: U8(1)},
- { /* zName: */ FzName: ts + 15061, /* "defer_foreign_ke..." */
+ /* ePragFlg: */ FmPragFlg: U8(PragFlg_NeedSchema | PragFlg_Result0 | PragFlg_SchemaReq | PragFlg_NoColumns1),
+ /* ColNames: */ FiPragCName: U8(55), FnPragCName: U8(1)},
+ { /* zName: */ FzName: ts + 16265, /* "defer_foreign_ke..." */
/* ePragTyp: */ FePragTyp: U8(PragTyp_FLAG),
- /* ePragFlg: */ FmPragFlg: (U8(PragFlg_Result0 | PragFlg_NoColumns1)),
+ /* ePragFlg: */ FmPragFlg: U8(PragFlg_Result0 | PragFlg_NoColumns1),
/* iArg: */ FiArg: uint64(SQLITE_DeferFKs)},
- { /* zName: */ FzName: ts + 15080, /* "empty_result_cal..." */
+ { /* zName: */ FzName: ts + 16284, /* "empty_result_cal..." */
/* ePragTyp: */ FePragTyp: U8(PragTyp_FLAG),
- /* ePragFlg: */ FmPragFlg: (U8(PragFlg_Result0 | PragFlg_NoColumns1)),
+ /* ePragFlg: */ FmPragFlg: U8(PragFlg_Result0 | PragFlg_NoColumns1),
/* iArg: */ FiArg: uint64(SQLITE_NullCallback)},
- { /* zName: */ FzName: ts + 15103, /* "encoding" */
+ { /* zName: */ FzName: ts + 16307, /* "encoding" */
/* ePragTyp: */ FePragTyp: U8(PragTyp_ENCODING),
- /* ePragFlg: */ FmPragFlg: (U8(PragFlg_Result0 | PragFlg_NoColumns1))},
- { /* zName: */ FzName: ts + 15112, /* "foreign_key_chec..." */
+ /* ePragFlg: */ FmPragFlg: U8(PragFlg_Result0 | PragFlg_NoColumns1)},
+ { /* zName: */ FzName: ts + 16316, /* "foreign_key_chec..." */
/* ePragTyp: */ FePragTyp: U8(PragTyp_FOREIGN_KEY_CHECK),
- /* ePragFlg: */ FmPragFlg: (U8(((PragFlg_NeedSchema | PragFlg_Result0) | PragFlg_Result1) | PragFlg_SchemaOpt)),
- /* ColNames: */ FiPragCName: U8(37), FnPragCName: U8(4)},
- { /* zName: */ FzName: ts + 15130, /* "foreign_key_list" */
+ /* ePragFlg: */ FmPragFlg: U8(PragFlg_NeedSchema | PragFlg_Result0 | PragFlg_Result1 | PragFlg_SchemaOpt),
+ /* ColNames: */ FiPragCName: U8(43), FnPragCName: U8(4)},
+ { /* zName: */ FzName: ts + 16334, /* "foreign_key_list" */
/* ePragTyp: */ FePragTyp: U8(PragTyp_FOREIGN_KEY_LIST),
- /* ePragFlg: */ FmPragFlg: (U8((PragFlg_NeedSchema | PragFlg_Result1) | PragFlg_SchemaOpt)), FnPragCName: U8(8)},
- { /* zName: */ FzName: ts + 15147, /* "foreign_keys" */
+ /* ePragFlg: */ FmPragFlg: U8(PragFlg_NeedSchema | PragFlg_Result1 | PragFlg_SchemaOpt), FnPragCName: U8(8)},
+ { /* zName: */ FzName: ts + 16351, /* "foreign_keys" */
/* ePragTyp: */ FePragTyp: U8(PragTyp_FLAG),
- /* ePragFlg: */ FmPragFlg: (U8(PragFlg_Result0 | PragFlg_NoColumns1)),
+ /* ePragFlg: */ FmPragFlg: U8(PragFlg_Result0 | PragFlg_NoColumns1),
/* iArg: */ FiArg: uint64(SQLITE_ForeignKeys)},
- { /* zName: */ FzName: ts + 15160, /* "freelist_count" */
+ { /* zName: */ FzName: ts + 16364, /* "freelist_count" */
/* ePragTyp: */ FePragTyp: U8(PragTyp_HEADER_VALUE),
- /* ePragFlg: */ FmPragFlg: (U8(PragFlg_ReadOnly | PragFlg_Result0))},
- { /* zName: */ FzName: ts + 15175, /* "full_column_name..." */
+ /* ePragFlg: */ FmPragFlg: U8(PragFlg_ReadOnly | PragFlg_Result0)},
+ { /* zName: */ FzName: ts + 16379, /* "full_column_name..." */
/* ePragTyp: */ FePragTyp: U8(PragTyp_FLAG),
- /* ePragFlg: */ FmPragFlg: (U8(PragFlg_Result0 | PragFlg_NoColumns1)),
+ /* ePragFlg: */ FmPragFlg: U8(PragFlg_Result0 | PragFlg_NoColumns1),
/* iArg: */ FiArg: uint64(SQLITE_FullColNames)},
- { /* zName: */ FzName: ts + 15193, /* "fullfsync" */
+ { /* zName: */ FzName: ts + 16397, /* "fullfsync" */
/* ePragTyp: */ FePragTyp: U8(PragTyp_FLAG),
- /* ePragFlg: */ FmPragFlg: (U8(PragFlg_Result0 | PragFlg_NoColumns1)),
+ /* ePragFlg: */ FmPragFlg: U8(PragFlg_Result0 | PragFlg_NoColumns1),
/* iArg: */ FiArg: uint64(SQLITE_FullFSync)},
- { /* zName: */ FzName: ts + 15203, /* "function_list" */
+ { /* zName: */ FzName: ts + 16407, /* "function_list" */
/* ePragTyp: */ FePragTyp: U8(PragTyp_FUNCTION_LIST),
/* ePragFlg: */ FmPragFlg: U8(PragFlg_Result0),
- /* ColNames: */ FiPragCName: U8(21), FnPragCName: U8(6)},
- { /* zName: */ FzName: ts + 15217, /* "hard_heap_limit" */
+ /* ColNames: */ FiPragCName: U8(27), FnPragCName: U8(6)},
+ { /* zName: */ FzName: ts + 16421, /* "hard_heap_limit" */
/* ePragTyp: */ FePragTyp: U8(PragTyp_HARD_HEAP_LIMIT),
/* ePragFlg: */ FmPragFlg: U8(PragFlg_Result0)},
- { /* zName: */ FzName: ts + 15233, /* "ignore_check_con..." */
+ { /* zName: */ FzName: ts + 16437, /* "ignore_check_con..." */
/* ePragTyp: */ FePragTyp: U8(PragTyp_FLAG),
- /* ePragFlg: */ FmPragFlg: (U8(PragFlg_Result0 | PragFlg_NoColumns1)),
+ /* ePragFlg: */ FmPragFlg: U8(PragFlg_Result0 | PragFlg_NoColumns1),
/* iArg: */ FiArg: uint64(SQLITE_IgnoreChecks)},
- { /* zName: */ FzName: ts + 15258, /* "incremental_vacu..." */
+ { /* zName: */ FzName: ts + 16462, /* "incremental_vacu..." */
/* ePragTyp: */ FePragTyp: U8(PragTyp_INCREMENTAL_VACUUM),
- /* ePragFlg: */ FmPragFlg: (U8(PragFlg_NeedSchema | PragFlg_NoColumns))},
- { /* zName: */ FzName: ts + 15277, /* "index_info" */
+ /* ePragFlg: */ FmPragFlg: U8(PragFlg_NeedSchema | PragFlg_NoColumns)},
+ { /* zName: */ FzName: ts + 16481, /* "index_info" */
/* ePragTyp: */ FePragTyp: U8(PragTyp_INDEX_INFO),
- /* ePragFlg: */ FmPragFlg: (U8((PragFlg_NeedSchema | PragFlg_Result1) | PragFlg_SchemaOpt)),
- /* ColNames: */ FiPragCName: U8(15), FnPragCName: U8(3)},
- { /* zName: */ FzName: ts + 15288, /* "index_list" */
+ /* ePragFlg: */ FmPragFlg: U8(PragFlg_NeedSchema | PragFlg_Result1 | PragFlg_SchemaOpt),
+ /* ColNames: */ FiPragCName: U8(21), FnPragCName: U8(3)},
+ { /* zName: */ FzName: ts + 16492, /* "index_list" */
/* ePragTyp: */ FePragTyp: U8(PragTyp_INDEX_LIST),
- /* ePragFlg: */ FmPragFlg: (U8((PragFlg_NeedSchema | PragFlg_Result1) | PragFlg_SchemaOpt)),
- /* ColNames: */ FiPragCName: U8(32), FnPragCName: U8(5)},
- { /* zName: */ FzName: ts + 15299, /* "index_xinfo" */
+ /* ePragFlg: */ FmPragFlg: U8(PragFlg_NeedSchema | PragFlg_Result1 | PragFlg_SchemaOpt),
+ /* ColNames: */ FiPragCName: U8(38), FnPragCName: U8(5)},
+ { /* zName: */ FzName: ts + 16503, /* "index_xinfo" */
/* ePragTyp: */ FePragTyp: U8(PragTyp_INDEX_INFO),
- /* ePragFlg: */ FmPragFlg: (U8((PragFlg_NeedSchema | PragFlg_Result1) | PragFlg_SchemaOpt)),
- /* ColNames: */ FiPragCName: U8(15), FnPragCName: U8(6),
+ /* ePragFlg: */ FmPragFlg: U8(PragFlg_NeedSchema | PragFlg_Result1 | PragFlg_SchemaOpt),
+ /* ColNames: */ FiPragCName: U8(21), FnPragCName: U8(6),
/* iArg: */ FiArg: uint64(1)},
- { /* zName: */ FzName: ts + 15311, /* "integrity_check" */
+ { /* zName: */ FzName: ts + 16515, /* "integrity_check" */
/* ePragTyp: */ FePragTyp: U8(PragTyp_INTEGRITY_CHECK),
- /* ePragFlg: */ FmPragFlg: (U8((PragFlg_NeedSchema | PragFlg_Result0) | PragFlg_Result1))},
- { /* zName: */ FzName: ts + 15327, /* "journal_mode" */
+ /* ePragFlg: */ FmPragFlg: U8(PragFlg_NeedSchema | PragFlg_Result0 | PragFlg_Result1 | PragFlg_SchemaOpt)},
+ { /* zName: */ FzName: ts + 16531, /* "journal_mode" */
/* ePragTyp: */ FePragTyp: U8(PragTyp_JOURNAL_MODE),
- /* ePragFlg: */ FmPragFlg: (U8((PragFlg_NeedSchema | PragFlg_Result0) | PragFlg_SchemaReq))},
- { /* zName: */ FzName: ts + 15340, /* "journal_size_lim..." */
+ /* ePragFlg: */ FmPragFlg: U8(PragFlg_NeedSchema | PragFlg_Result0 | PragFlg_SchemaReq)},
+ { /* zName: */ FzName: ts + 16544, /* "journal_size_lim..." */
/* ePragTyp: */ FePragTyp: U8(PragTyp_JOURNAL_SIZE_LIMIT),
- /* ePragFlg: */ FmPragFlg: (U8(PragFlg_Result0 | PragFlg_SchemaReq))},
- { /* zName: */ FzName: ts + 15359, /* "legacy_alter_tab..." */
+ /* ePragFlg: */ FmPragFlg: U8(PragFlg_Result0 | PragFlg_SchemaReq)},
+ { /* zName: */ FzName: ts + 16563, /* "legacy_alter_tab..." */
/* ePragTyp: */ FePragTyp: U8(PragTyp_FLAG),
- /* ePragFlg: */ FmPragFlg: (U8(PragFlg_Result0 | PragFlg_NoColumns1)),
+ /* ePragFlg: */ FmPragFlg: U8(PragFlg_Result0 | PragFlg_NoColumns1),
/* iArg: */ FiArg: uint64(SQLITE_LegacyAlter)},
- { /* zName: */ FzName: ts + 15378, /* "locking_mode" */
+ { /* zName: */ FzName: ts + 16582, /* "locking_mode" */
/* ePragTyp: */ FePragTyp: U8(PragTyp_LOCKING_MODE),
- /* ePragFlg: */ FmPragFlg: (U8(PragFlg_Result0 | PragFlg_SchemaReq))},
- { /* zName: */ FzName: ts + 15391, /* "max_page_count" */
+ /* ePragFlg: */ FmPragFlg: U8(PragFlg_Result0 | PragFlg_SchemaReq)},
+ { /* zName: */ FzName: ts + 16595, /* "max_page_count" */
/* ePragTyp: */ FePragTyp: U8(PragTyp_PAGE_COUNT),
- /* ePragFlg: */ FmPragFlg: (U8((PragFlg_NeedSchema | PragFlg_Result0) | PragFlg_SchemaReq))},
- { /* zName: */ FzName: ts + 15406, /* "mmap_size" */
+ /* ePragFlg: */ FmPragFlg: U8(PragFlg_NeedSchema | PragFlg_Result0 | PragFlg_SchemaReq)},
+ { /* zName: */ FzName: ts + 16610, /* "mmap_size" */
/* ePragTyp: */ FePragTyp: U8(PragTyp_MMAP_SIZE)},
- { /* zName: */ FzName: ts + 15416, /* "module_list" */
+ { /* zName: */ FzName: ts + 16620, /* "module_list" */
/* ePragTyp: */ FePragTyp: U8(PragTyp_MODULE_LIST),
/* ePragFlg: */ FmPragFlg: U8(PragFlg_Result0),
/* ColNames: */ FiPragCName: U8(9), FnPragCName: U8(1)},
- { /* zName: */ FzName: ts + 15428, /* "optimize" */
+ { /* zName: */ FzName: ts + 16632, /* "optimize" */
/* ePragTyp: */ FePragTyp: U8(PragTyp_OPTIMIZE),
- /* ePragFlg: */ FmPragFlg: (U8(PragFlg_Result1 | PragFlg_NeedSchema))},
- { /* zName: */ FzName: ts + 15437, /* "page_count" */
+ /* ePragFlg: */ FmPragFlg: U8(PragFlg_Result1 | PragFlg_NeedSchema)},
+ { /* zName: */ FzName: ts + 16641, /* "page_count" */
/* ePragTyp: */ FePragTyp: U8(PragTyp_PAGE_COUNT),
- /* ePragFlg: */ FmPragFlg: (U8((PragFlg_NeedSchema | PragFlg_Result0) | PragFlg_SchemaReq))},
- { /* zName: */ FzName: ts + 15448, /* "page_size" */
+ /* ePragFlg: */ FmPragFlg: U8(PragFlg_NeedSchema | PragFlg_Result0 | PragFlg_SchemaReq)},
+ { /* zName: */ FzName: ts + 16652, /* "page_size" */
/* ePragTyp: */ FePragTyp: U8(PragTyp_PAGE_SIZE),
- /* ePragFlg: */ FmPragFlg: (U8((PragFlg_Result0 | PragFlg_SchemaReq) | PragFlg_NoColumns1))},
- { /* zName: */ FzName: ts + 15458, /* "pragma_list" */
+ /* ePragFlg: */ FmPragFlg: U8(PragFlg_Result0 | PragFlg_SchemaReq | PragFlg_NoColumns1)},
+ { /* zName: */ FzName: ts + 16662, /* "pragma_list" */
/* ePragTyp: */ FePragTyp: U8(PragTyp_PRAGMA_LIST),
/* ePragFlg: */ FmPragFlg: U8(PragFlg_Result0),
/* ColNames: */ FiPragCName: U8(9), FnPragCName: U8(1)},
- { /* zName: */ FzName: ts + 15470, /* "query_only" */
+ { /* zName: */ FzName: ts + 16674, /* "query_only" */
/* ePragTyp: */ FePragTyp: U8(PragTyp_FLAG),
- /* ePragFlg: */ FmPragFlg: (U8(PragFlg_Result0 | PragFlg_NoColumns1)),
+ /* ePragFlg: */ FmPragFlg: U8(PragFlg_Result0 | PragFlg_NoColumns1),
/* iArg: */ FiArg: uint64(SQLITE_QueryOnly)},
- { /* zName: */ FzName: ts + 15481, /* "quick_check" */
+ { /* zName: */ FzName: ts + 16685, /* "quick_check" */
/* ePragTyp: */ FePragTyp: U8(PragTyp_INTEGRITY_CHECK),
- /* ePragFlg: */ FmPragFlg: (U8((PragFlg_NeedSchema | PragFlg_Result0) | PragFlg_Result1))},
- { /* zName: */ FzName: ts + 15493, /* "read_uncommitted" */
+ /* ePragFlg: */ FmPragFlg: U8(PragFlg_NeedSchema | PragFlg_Result0 | PragFlg_Result1 | PragFlg_SchemaOpt)},
+ { /* zName: */ FzName: ts + 16697, /* "read_uncommitted" */
/* ePragTyp: */ FePragTyp: U8(PragTyp_FLAG),
- /* ePragFlg: */ FmPragFlg: (U8(PragFlg_Result0 | PragFlg_NoColumns1)),
+ /* ePragFlg: */ FmPragFlg: U8(PragFlg_Result0 | PragFlg_NoColumns1),
/* iArg: */ FiArg: uint64(SQLITE_ReadUncommit)},
- { /* zName: */ FzName: ts + 15510, /* "recursive_trigge..." */
+ { /* zName: */ FzName: ts + 16714, /* "recursive_trigge..." */
/* ePragTyp: */ FePragTyp: U8(PragTyp_FLAG),
- /* ePragFlg: */ FmPragFlg: (U8(PragFlg_Result0 | PragFlg_NoColumns1)),
+ /* ePragFlg: */ FmPragFlg: U8(PragFlg_Result0 | PragFlg_NoColumns1),
/* iArg: */ FiArg: uint64(SQLITE_RecTriggers)},
- { /* zName: */ FzName: ts + 15529, /* "reverse_unordere..." */
+ { /* zName: */ FzName: ts + 16733, /* "reverse_unordere..." */
/* ePragTyp: */ FePragTyp: U8(PragTyp_FLAG),
- /* ePragFlg: */ FmPragFlg: (U8(PragFlg_Result0 | PragFlg_NoColumns1)),
+ /* ePragFlg: */ FmPragFlg: U8(PragFlg_Result0 | PragFlg_NoColumns1),
/* iArg: */ FiArg: uint64(SQLITE_ReverseOrder)},
- { /* zName: */ FzName: ts + 15555, /* "schema_version" */
+ { /* zName: */ FzName: ts + 16759, /* "schema_version" */
/* ePragTyp: */ FePragTyp: U8(PragTyp_HEADER_VALUE),
- /* ePragFlg: */ FmPragFlg: (U8(PragFlg_NoColumns1 | PragFlg_Result0)),
+ /* ePragFlg: */ FmPragFlg: U8(PragFlg_NoColumns1 | PragFlg_Result0),
/* iArg: */ FiArg: uint64(BTREE_SCHEMA_VERSION)},
- { /* zName: */ FzName: ts + 15570, /* "secure_delete" */
+ { /* zName: */ FzName: ts + 16774, /* "secure_delete" */
/* ePragTyp: */ FePragTyp: U8(PragTyp_SECURE_DELETE),
/* ePragFlg: */ FmPragFlg: U8(PragFlg_Result0)},
- { /* zName: */ FzName: ts + 15584, /* "short_column_nam..." */
+ { /* zName: */ FzName: ts + 16788, /* "short_column_nam..." */
/* ePragTyp: */ FePragTyp: U8(PragTyp_FLAG),
- /* ePragFlg: */ FmPragFlg: (U8(PragFlg_Result0 | PragFlg_NoColumns1)),
+ /* ePragFlg: */ FmPragFlg: U8(PragFlg_Result0 | PragFlg_NoColumns1),
/* iArg: */ FiArg: uint64(SQLITE_ShortColNames)},
- { /* zName: */ FzName: ts + 15603, /* "shrink_memory" */
+ { /* zName: */ FzName: ts + 16807, /* "shrink_memory" */
/* ePragTyp: */ FePragTyp: U8(PragTyp_SHRINK_MEMORY),
/* ePragFlg: */ FmPragFlg: U8(PragFlg_NoColumns)},
- { /* zName: */ FzName: ts + 15617, /* "soft_heap_limit" */
+ { /* zName: */ FzName: ts + 16821, /* "soft_heap_limit" */
/* ePragTyp: */ FePragTyp: U8(PragTyp_SOFT_HEAP_LIMIT),
/* ePragFlg: */ FmPragFlg: U8(PragFlg_Result0)},
- { /* zName: */ FzName: ts + 15633, /* "synchronous" */
+ { /* zName: */ FzName: ts + 16837, /* "synchronous" */
/* ePragTyp: */ FePragTyp: U8(PragTyp_SYNCHRONOUS),
- /* ePragFlg: */ FmPragFlg: (U8(((PragFlg_NeedSchema | PragFlg_Result0) | PragFlg_SchemaReq) | PragFlg_NoColumns1))},
- { /* zName: */ FzName: ts + 15645, /* "table_info" */
+ /* ePragFlg: */ FmPragFlg: U8(PragFlg_NeedSchema | PragFlg_Result0 | PragFlg_SchemaReq | PragFlg_NoColumns1)},
+ { /* zName: */ FzName: ts + 16849, /* "table_info" */
/* ePragTyp: */ FePragTyp: U8(PragTyp_TABLE_INFO),
- /* ePragFlg: */ FmPragFlg: (U8((PragFlg_NeedSchema | PragFlg_Result1) | PragFlg_SchemaOpt)),
+ /* ePragFlg: */ FmPragFlg: U8(PragFlg_NeedSchema | PragFlg_Result1 | PragFlg_SchemaOpt),
/* ColNames: */ FiPragCName: U8(8), FnPragCName: U8(6)},
- { /* zName: */ FzName: ts + 15656, /* "table_xinfo" */
+ { /* zName: */ FzName: ts + 16860, /* "table_list" */
+ /* ePragTyp: */ FePragTyp: U8(PragTyp_TABLE_LIST),
+ /* ePragFlg: */ FmPragFlg: U8(PragFlg_NeedSchema | PragFlg_Result1),
+ /* ColNames: */ FiPragCName: U8(15), FnPragCName: U8(6)},
+ { /* zName: */ FzName: ts + 16871, /* "table_xinfo" */
/* ePragTyp: */ FePragTyp: U8(PragTyp_TABLE_INFO),
- /* ePragFlg: */ FmPragFlg: (U8((PragFlg_NeedSchema | PragFlg_Result1) | PragFlg_SchemaOpt)),
+ /* ePragFlg: */ FmPragFlg: U8(PragFlg_NeedSchema | PragFlg_Result1 | PragFlg_SchemaOpt),
/* ColNames: */ FiPragCName: U8(8), FnPragCName: U8(7),
/* iArg: */ FiArg: uint64(1)},
- { /* zName: */ FzName: ts + 15668, /* "temp_store" */
+ { /* zName: */ FzName: ts + 16883, /* "temp_store" */
/* ePragTyp: */ FePragTyp: U8(PragTyp_TEMP_STORE),
- /* ePragFlg: */ FmPragFlg: (U8(PragFlg_Result0 | PragFlg_NoColumns1))},
- { /* zName: */ FzName: ts + 15679, /* "temp_store_direc..." */
+ /* ePragFlg: */ FmPragFlg: U8(PragFlg_Result0 | PragFlg_NoColumns1)},
+ { /* zName: */ FzName: ts + 16894, /* "temp_store_direc..." */
/* ePragTyp: */ FePragTyp: U8(PragTyp_TEMP_STORE_DIRECTORY),
/* ePragFlg: */ FmPragFlg: U8(PragFlg_NoColumns1)},
- { /* zName: */ FzName: ts + 15700, /* "threads" */
+ { /* zName: */ FzName: ts + 16915, /* "threads" */
/* ePragTyp: */ FePragTyp: U8(PragTyp_THREADS),
/* ePragFlg: */ FmPragFlg: U8(PragFlg_Result0)},
- { /* zName: */ FzName: ts + 15708, /* "trusted_schema" */
+ { /* zName: */ FzName: ts + 16923, /* "trusted_schema" */
/* ePragTyp: */ FePragTyp: U8(PragTyp_FLAG),
- /* ePragFlg: */ FmPragFlg: (U8(PragFlg_Result0 | PragFlg_NoColumns1)),
+ /* ePragFlg: */ FmPragFlg: U8(PragFlg_Result0 | PragFlg_NoColumns1),
/* iArg: */ FiArg: uint64(SQLITE_TrustedSchema)},
- { /* zName: */ FzName: ts + 15723, /* "user_version" */
+ { /* zName: */ FzName: ts + 16938, /* "user_version" */
/* ePragTyp: */ FePragTyp: U8(PragTyp_HEADER_VALUE),
- /* ePragFlg: */ FmPragFlg: (U8(PragFlg_NoColumns1 | PragFlg_Result0)),
+ /* ePragFlg: */ FmPragFlg: U8(PragFlg_NoColumns1 | PragFlg_Result0),
/* iArg: */ FiArg: uint64(BTREE_USER_VERSION)},
- { /* zName: */ FzName: ts + 15736, /* "wal_autocheckpoi..." */
+ { /* zName: */ FzName: ts + 16951, /* "wal_autocheckpoi..." */
/* ePragTyp: */ FePragTyp: U8(PragTyp_WAL_AUTOCHECKPOINT)},
- { /* zName: */ FzName: ts + 15755, /* "wal_checkpoint" */
+ { /* zName: */ FzName: ts + 16970, /* "wal_checkpoint" */
/* ePragTyp: */ FePragTyp: U8(PragTyp_WAL_CHECKPOINT),
/* ePragFlg: */ FmPragFlg: U8(PragFlg_NeedSchema),
- /* ColNames: */ FiPragCName: U8(44), FnPragCName: U8(3)},
- { /* zName: */ FzName: ts + 15770, /* "writable_schema" */
+ /* ColNames: */ FiPragCName: U8(50), FnPragCName: U8(3)},
+ { /* zName: */ FzName: ts + 16985, /* "writable_schema" */
/* ePragTyp: */ FePragTyp: U8(PragTyp_FLAG),
- /* ePragFlg: */ FmPragFlg: (U8(PragFlg_Result0 | PragFlg_NoColumns1)),
- /* iArg: */ FiArg: (uint64(SQLITE_WriteSchema | SQLITE_NoSchemaError))},
-} /* sqlite3.c:127968:25 */
+ /* ePragFlg: */ FmPragFlg: U8(PragFlg_Result0 | PragFlg_NoColumns1),
+ /* iArg: */ FiArg: uint64(SQLITE_WriteSchema | SQLITE_NoSchemaError)},
+} /* sqlite3.c:128989:25 */
-// Number of pragmas: 67 on by default, 77 total.
+// Number of pragmas: 68 on by default, 78 total.
//************* End of pragma.h *********************************************
//************* Continuing where we left off in pragma.c ********************
@@ -108234,31 +109805,31 @@ var aPragmaName = [65]PragmaName{
// should be passed into sqlite3BtreeSetSafetyLevel(). The is done
// to support legacy SQL code. The safety level used to be boolean
// and older scripts may have used numbers 0 for OFF and 1 for ON.
-func getSafetyLevel(tls *libc.TLS, z uintptr, omitFull int32, dflt U8) U8 { /* sqlite3.c:128497:11: */
+func getSafetyLevel(tls *libc.TLS, z uintptr, omitFull int32, dflt U8) U8 { /* sqlite3.c:129523:11: */
// on no off false yes true extra full
var i int32
var n int32
- if (int32(Xsqlite3CtypeMap[uint8(*(*uint8)(unsafe.Pointer(z)))]) & 0x04) != 0 {
+ if int32(Xsqlite3CtypeMap[uint8(*(*uint8)(unsafe.Pointer(z)))])&0x04 != 0 {
return U8(Xsqlite3Atoi(tls, z))
}
n = Xsqlite3Strlen30(tls, z)
- for i = 0; i < (int32(uint32(unsafe.Sizeof(iLength)) / uint32(unsafe.Sizeof(U8(0))))); i++ {
- if ((int32(iLength[i]) == n) && (Xsqlite3_strnicmp(tls, (uintptr(unsafe.Pointer(&zText))+uintptr(iOffset[i])), z, n) == 0)) &&
- (!(omitFull != 0) || (int32(iValue[i]) <= 1)) {
+ for i = 0; i < int32(uint32(unsafe.Sizeof(iLength))/uint32(unsafe.Sizeof(U8(0)))); i++ {
+ if int32(iLength[i]) == n && Xsqlite3_strnicmp(tls, uintptr(unsafe.Pointer(&zText))+uintptr(iOffset[i]), z, n) == 0 &&
+ (!(omitFull != 0) || int32(iValue[i]) <= 1) {
return iValue[i]
}
}
return dflt
}
-var zText = *(*[25]uint8)(unsafe.Pointer(ts + 15786 /* "onoffalseyestrue..." */)) /* sqlite3.c:128499:21 */
-var iOffset = [8]U8{U8(0), U8(1), U8(2), U8(4), U8(9), U8(12), U8(15), U8(20)} /* sqlite3.c:128500:19 */
-var iLength = [8]U8{U8(2), U8(2), U8(3), U8(5), U8(3), U8(4), U8(5), U8(4)} /* sqlite3.c:128501:19 */
-var iValue = [8]U8{U8(1), U8(0), U8(0), U8(0), U8(1), U8(1), U8(3), U8(2)} /* sqlite3.c:128502:19 */
+var zText = *(*[25]uint8)(unsafe.Pointer(ts + 17001 /* "onoffalseyestrue..." */)) /* sqlite3.c:129525:21 */
+var iOffset = [8]U8{U8(0), U8(1), U8(2), U8(4), U8(9), U8(12), U8(15), U8(20)} /* sqlite3.c:129526:19 */
+var iLength = [8]U8{U8(2), U8(2), U8(3), U8(5), U8(3), U8(4), U8(5), U8(4)} /* sqlite3.c:129527:19 */
+var iValue = [8]U8{U8(1), U8(0), U8(0), U8(0), U8(1), U8(1), U8(3), U8(2)} /* sqlite3.c:129528:19 */
// Interpret the given string as a boolean value.
-func Xsqlite3GetBoolean(tls *libc.TLS, z uintptr, dflt U8) U8 { /* sqlite3.c:128522:19: */
- return (U8(libc.Bool32(int32(getSafetyLevel(tls, z, 1, dflt)) != 0)))
+func Xsqlite3GetBoolean(tls *libc.TLS, z uintptr, dflt U8) U8 { /* sqlite3.c:129548:19: */
+ return U8(libc.Bool32(int32(getSafetyLevel(tls, z, 1, dflt)) != 0))
}
// The sqlite3GetBoolean() function is used by other modules but the
@@ -108266,12 +109837,12 @@ func Xsqlite3GetBoolean(tls *libc.TLS, z uintptr, dflt U8) U8 { /* sqlite3.c:128
// the rest of the file if PRAGMAs are omitted from the build.
// Interpret the given string as a locking mode value.
-func getLockingMode(tls *libc.TLS, z uintptr) int32 { /* sqlite3.c:128535:12: */
+func getLockingMode(tls *libc.TLS, z uintptr) int32 { /* sqlite3.c:129561:12: */
if z != 0 {
- if 0 == Xsqlite3StrICmp(tls, z, ts+15811 /* "exclusive" */) {
+ if 0 == Xsqlite3StrICmp(tls, z, ts+17026) {
return PAGER_LOCKINGMODE_EXCLUSIVE
}
- if 0 == Xsqlite3StrICmp(tls, z, ts+15821 /* "normal" */) {
+ if 0 == Xsqlite3StrICmp(tls, z, ts+17036) {
return PAGER_LOCKINGMODE_NORMAL
}
}
@@ -108282,20 +109853,20 @@ func getLockingMode(tls *libc.TLS, z uintptr) int32 { /* sqlite3.c:128535:12: */
//
// The following strings, "none", "full" and "incremental" are
// acceptable, as are their numeric equivalents: 0, 1 and 2 respectively.
-func getAutoVacuum(tls *libc.TLS, z uintptr) int32 { /* sqlite3.c:128550:12: */
+func getAutoVacuum(tls *libc.TLS, z uintptr) int32 { /* sqlite3.c:129576:12: */
var i int32
- if 0 == Xsqlite3StrICmp(tls, z, ts+15828 /* "none" */) {
+ if 0 == Xsqlite3StrICmp(tls, z, ts+7885) {
return BTREE_AUTOVACUUM_NONE
}
- if 0 == Xsqlite3StrICmp(tls, z, ts+15833 /* "full" */) {
+ if 0 == Xsqlite3StrICmp(tls, z, ts+17043) {
return BTREE_AUTOVACUUM_FULL
}
- if 0 == Xsqlite3StrICmp(tls, z, ts+15838 /* "incremental" */) {
+ if 0 == Xsqlite3StrICmp(tls, z, ts+17048) {
return BTREE_AUTOVACUUM_INCR
}
i = Xsqlite3Atoi(tls, z)
return int32(func() uint8 {
- if (i >= 0) && (i <= 2) {
+ if i >= 0 && i <= 2 {
return uint8(i)
}
return uint8(0)
@@ -108305,12 +109876,12 @@ func getAutoVacuum(tls *libc.TLS, z uintptr) int32 { /* sqlite3.c:128550:12: */
// Interpret the given string as a temp db location. Return 1 for file
// backed temporary databases, 2 for the Red-Black tree in memory database
// and 0 to use the compile-time default.
-func getTempStore(tls *libc.TLS, z uintptr) int32 { /* sqlite3.c:128566:12: */
- if (int32(*(*uint8)(unsafe.Pointer(z))) >= '0') && (int32(*(*uint8)(unsafe.Pointer(z))) <= '2') {
- return (int32(*(*uint8)(unsafe.Pointer(z))) - '0')
- } else if Xsqlite3StrICmp(tls, z, ts+14768 /* "file" */) == 0 {
+func getTempStore(tls *libc.TLS, z uintptr) int32 { /* sqlite3.c:129592:12: */
+ if int32(*(*uint8)(unsafe.Pointer(z))) >= '0' && int32(*(*uint8)(unsafe.Pointer(z))) <= '2' {
+ return int32(*(*uint8)(unsafe.Pointer(z))) - '0'
+ } else if Xsqlite3StrICmp(tls, z, ts+15972) == 0 {
return 1
- } else if Xsqlite3StrICmp(tls, z, ts+15850 /* "memory" */) == 0 {
+ } else if Xsqlite3StrICmp(tls, z, ts+17060) == 0 {
return 2
} else {
return 0
@@ -108320,13 +109891,13 @@ func getTempStore(tls *libc.TLS, z uintptr) int32 { /* sqlite3.c:128566:12: */
// Invalidate temp storage, either when the temp storage is changed
// from default, or when 'file' and the temp_store_directory has changed
-func invalidateTempStorage(tls *libc.TLS, pParse uintptr) int32 { /* sqlite3.c:128584:12: */
+func invalidateTempStorage(tls *libc.TLS, pParse uintptr) int32 { /* sqlite3.c:129610:12: */
var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb
if (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+1*16)).FpBt != uintptr(0) {
if !(int32((*Sqlite3)(unsafe.Pointer(db)).FautoCommit) != 0) ||
- (Xsqlite3BtreeTxnState(tls, (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+1*16)).FpBt) != SQLITE_TXN_NONE) {
+ Xsqlite3BtreeTxnState(tls, (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+1*16)).FpBt) != SQLITE_TXN_NONE {
Xsqlite3ErrorMsg(tls, pParse,
- ts+15857 /* "temporary storag..." */, 0)
+ ts+17067 /* "temporary storag..." */, 0)
return SQLITE_ERROR
}
Xsqlite3BtreeClose(tls, (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+1*16)).FpBt)
@@ -108339,7 +109910,7 @@ func invalidateTempStorage(tls *libc.TLS, pParse uintptr) int32 { /* sqlite3.c:1
// If the TEMP database is open, close it and mark the database schema
// as needing reloading. This must be done when using the SQLITE_TEMP_STORE
// or DEFAULT_TEMP_STORE pragmas.
-func changeTempStorage(tls *libc.TLS, pParse uintptr, zStorageType uintptr) int32 { /* sqlite3.c:128608:12: */
+func changeTempStorage(tls *libc.TLS, pParse uintptr, zStorageType uintptr) int32 { /* sqlite3.c:129634:12: */
var ts int32 = getTempStore(tls, zStorageType)
var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb
if int32((*Sqlite3)(unsafe.Pointer(db)).Ftemp_store) == ts {
@@ -108353,7 +109924,7 @@ func changeTempStorage(tls *libc.TLS, pParse uintptr, zStorageType uintptr) int3
}
// Set result column names for a pragma.
-func setPragmaResultColumnNames(tls *libc.TLS, v uintptr, pPragma uintptr) { /* sqlite3.c:128623:13: */
+func setPragmaResultColumnNames(tls *libc.TLS, v uintptr, pPragma uintptr) { /* sqlite3.c:129649:13: */
var n U8 = (*PragmaName)(unsafe.Pointer(pPragma)).FnPragCName
Xsqlite3VdbeSetNumCols(tls, v, func() int32 {
if int32(n) == 0 {
@@ -108387,7 +109958,7 @@ func setPragmaResultColumnNames(tls *libc.TLS, v uintptr, pPragma uintptr) { /*
}
// Generate code to return a single integer value.
-func returnSingleInt(tls *libc.TLS, v uintptr, value I64) { /* sqlite3.c:128642:13: */
+func returnSingleInt(tls *libc.TLS, v uintptr, value I64) { /* sqlite3.c:129668:13: */
bp := tls.Alloc(8)
defer tls.Free(8)
*(*I64)(unsafe.Pointer(bp)) = value
@@ -108397,7 +109968,7 @@ func returnSingleInt(tls *libc.TLS, v uintptr, value I64) { /* sqlite3.c:128642:
}
// Generate code to return a single text value.
-func returnSingleText(tls *libc.TLS, v uintptr, zValue uintptr) { /* sqlite3.c:128650:13: */
+func returnSingleText(tls *libc.TLS, v uintptr, zValue uintptr) { /* sqlite3.c:129676:13: */
if zValue != 0 {
Xsqlite3VdbeLoadString(tls, v, 1, zValue)
Xsqlite3VdbeAddOp2(tls, v, OP_ResultRow, 1, 1)
@@ -108406,15 +109977,15 @@ func returnSingleText(tls *libc.TLS, v uintptr, zValue uintptr) { /* sqlite3.c:1
// Set the safety_level and pager flags for pager iDb. Or if iDb<0
// set these values for all pagers.
-func setAllPagerFlags(tls *libc.TLS, db uintptr) { /* sqlite3.c:128666:13: */
+func setAllPagerFlags(tls *libc.TLS, db uintptr) { /* sqlite3.c:129692:13: */
if (*Sqlite3)(unsafe.Pointer(db)).FautoCommit != 0 {
var pDb uintptr = (*Sqlite3)(unsafe.Pointer(db)).FaDb
var n int32 = (*Sqlite3)(unsafe.Pointer(db)).FnDb
- for (libc.PostDecInt32(&n, 1)) > 0 {
+ for libc.PostDecInt32(&n, 1) > 0 {
if (*Db)(unsafe.Pointer(pDb)).FpBt != 0 {
Xsqlite3BtreeSetPagerFlags(tls, (*Db)(unsafe.Pointer(pDb)).FpBt,
- (uint32(U64((*Db)(unsafe.Pointer(pDb)).Fsafety_level) | ((*Sqlite3)(unsafe.Pointer(db)).Fflags & uint64(PAGER_FLAGS_MASK)))))
+ uint32(U64((*Db)(unsafe.Pointer(pDb)).Fsafety_level)|(*Sqlite3)(unsafe.Pointer(db)).Fflags&uint64(PAGER_FLAGS_MASK)))
}
pDb += 16
}
@@ -108422,23 +109993,23 @@ func setAllPagerFlags(tls *libc.TLS, db uintptr) { /* sqlite3.c:128666:13: */
}
// Return a human-readable name for a constraint resolution action.
-func actionName(tls *libc.TLS, action U8) uintptr { /* sqlite3.c:128694:19: */
+func actionName(tls *libc.TLS, action U8) uintptr { /* sqlite3.c:129720:19: */
var zName uintptr
switch int32(action) {
case OE_SetNull:
- zName = ts + 15919 /* "SET NULL" */
+ zName = ts + 17129 /* "SET NULL" */
break
case OE_SetDflt:
- zName = ts + 15928 /* "SET DEFAULT" */
+ zName = ts + 17138 /* "SET DEFAULT" */
break
case OE_Cascade:
- zName = ts + 15940 /* "CASCADE" */
+ zName = ts + 17150 /* "CASCADE" */
break
case OE_Restrict:
- zName = ts + 15948 /* "RESTRICT" */
+ zName = ts + 17158 /* "RESTRICT" */
break
default:
- zName = ts + 15957 /* "NO ACTION" */
+ zName = ts + 17167 /* "NO ACTION" */
break
}
return zName
@@ -108447,47 +110018,47 @@ func actionName(tls *libc.TLS, action U8) uintptr { /* sqlite3.c:128694:19: */
// Parameter eMode must be one of the PAGER_JOURNALMODE_XXX constants
// defined in pager.h. This function returns the associated lowercase
// journal-mode name.
-func Xsqlite3JournalModename(tls *libc.TLS, eMode int32) uintptr { /* sqlite3.c:128714:27: */
+func Xsqlite3JournalModename(tls *libc.TLS, eMode int32) uintptr { /* sqlite3.c:129740:27: */
- if eMode == (int32(uint32(unsafe.Sizeof(azModeName)) / uint32(unsafe.Sizeof(uintptr(0))))) {
+ if eMode == int32(uint32(unsafe.Sizeof(azModeName))/uint32(unsafe.Sizeof(uintptr(0)))) {
return uintptr(0)
}
return azModeName[eMode]
}
var azModeName = [6]uintptr{
- ts + 15967 /* "delete" */, ts + 15974 /* "persist" */, ts + 15982 /* "off" */, ts + 15986 /* "truncate" */, ts + 15850 /* "memory" */, ts + 15995, /* "wal" */
-} /* sqlite3.c:128715:15 */
+ ts + 17177 /* "delete" */, ts + 17184 /* "persist" */, ts + 17192 /* "off" */, ts + 17196 /* "truncate" */, ts + 17060 /* "memory" */, ts + 17205, /* "wal" */
+} /* sqlite3.c:129741:15 */
// Locate a pragma in the aPragmaName[] array.
-func pragmaLocate(tls *libc.TLS, zName uintptr) uintptr { /* sqlite3.c:128736:25: */
+func pragmaLocate(tls *libc.TLS, zName uintptr) uintptr { /* sqlite3.c:129762:25: */
var upr int32
var lwr int32
var mid int32 = 0
var rc int32
lwr = 0
- upr = ((int32(uint32(unsafe.Sizeof(aPragmaName)) / uint32(unsafe.Sizeof(PragmaName{})))) - 1)
+ upr = int32(uint32(unsafe.Sizeof(aPragmaName))/uint32(unsafe.Sizeof(PragmaName{}))) - 1
for lwr <= upr {
- mid = ((lwr + upr) / 2)
+ mid = (lwr + upr) / 2
rc = Xsqlite3_stricmp(tls, zName, aPragmaName[mid].FzName)
if rc == 0 {
break
}
if rc < 0 {
- upr = (mid - 1)
+ upr = mid - 1
} else {
- lwr = (mid + 1)
+ lwr = mid + 1
}
}
if lwr > upr {
return uintptr(0)
}
- return (uintptr(unsafe.Pointer(&aPragmaName)) + uintptr(mid)*16)
+ return uintptr(unsafe.Pointer(&aPragmaName)) + uintptr(mid)*16
}
// Create zero or more entries in the output for the SQL functions
// defined by FuncDef p.
-func pragmaFunclistLine(tls *libc.TLS, v uintptr, p uintptr, isBuiltin int32, showInternFuncs int32) { /* sqlite3.c:128757:13: */
+func pragmaFunclistLine(tls *libc.TLS, v uintptr, p uintptr, isBuiltin int32, showInternFuncs int32) { /* sqlite3.c:129783:13: */
bp := tls.Alloc(48)
defer tls.Free(48)
@@ -108497,37 +110068,37 @@ func pragmaFunclistLine(tls *libc.TLS, v uintptr, p uintptr, isBuiltin int32, sh
if (*FuncDef)(unsafe.Pointer(p)).FxSFunc == uintptr(0) {
continue
}
- if (((*FuncDef)(unsafe.Pointer(p)).FfuncFlags & U32(SQLITE_FUNC_INTERNAL)) != U32(0)) &&
- (showInternFuncs == 0) {
+ if (*FuncDef)(unsafe.Pointer(p)).FfuncFlags&U32(SQLITE_FUNC_INTERNAL) != U32(0) &&
+ showInternFuncs == 0 {
continue
}
if (*FuncDef)(unsafe.Pointer(p)).FxValue != uintptr(0) {
- zType = ts + 15999 /* "w" */
+ zType = ts + 17209 /* "w" */
} else if (*FuncDef)(unsafe.Pointer(p)).FxFinalize != uintptr(0) {
- zType = ts + 16001 /* "a" */
+ zType = ts + 17211 /* "a" */
} else {
- zType = ts + 16003 /* "s" */
+ zType = ts + 7397 /* "s" */
}
- Xsqlite3VdbeMultiLoad(tls, v, 1, ts+16005, /* "sissii" */
+ Xsqlite3VdbeMultiLoad(tls, v, 1, ts+17213, /* "sissii" */
libc.VaList(bp, (*FuncDef)(unsafe.Pointer(p)).FzName, isBuiltin,
- zType, azEnc[((*FuncDef)(unsafe.Pointer(p)).FfuncFlags&U32(SQLITE_FUNC_ENCMASK))],
+ zType, azEnc[(*FuncDef)(unsafe.Pointer(p)).FfuncFlags&U32(SQLITE_FUNC_ENCMASK)],
int32((*FuncDef)(unsafe.Pointer(p)).FnArg),
- (((*FuncDef)(unsafe.Pointer(p)).FfuncFlags&mask)^U32(SQLITE_INNOCUOUS))))
+ (*FuncDef)(unsafe.Pointer(p)).FfuncFlags&mask^U32(SQLITE_INNOCUOUS)))
}
}
-var mask U32 = (U32((((SQLITE_DETERMINISTIC | SQLITE_DIRECTONLY) | SQLITE_SUBTYPE) | SQLITE_INNOCUOUS) | SQLITE_FUNC_INTERNAL)) /* sqlite3.c:128765:22 */
-var azEnc = [4]uintptr{uintptr(0), ts + 16012 /* "utf8" */, ts + 16017 /* "utf16le" */, ts + 16025 /* "utf16be" */} /* sqlite3.c:128772:23 */
+var mask U32 = U32(SQLITE_DETERMINISTIC | SQLITE_DIRECTONLY | SQLITE_SUBTYPE | SQLITE_INNOCUOUS | SQLITE_FUNC_INTERNAL) /* sqlite3.c:129791:22 */
+var azEnc = [4]uintptr{uintptr(0), ts + 17220 /* "utf8" */, ts + 17225 /* "utf16le" */, ts + 17233 /* "utf16be" */} /* sqlite3.c:129798:23 */
// Helper subroutine for PRAGMA integrity_check:
//
// Generate code to output a single-column result row with a value of the
// string held in register 3. Decrement the result count in register 1
// and halt if the maximum number of result rows have been issued.
-func integrityCheckResultRow(tls *libc.TLS, v uintptr) int32 { /* sqlite3.c:128809:12: */
+func integrityCheckResultRow(tls *libc.TLS, v uintptr) int32 { /* sqlite3.c:129835:12: */
var addr int32
Xsqlite3VdbeAddOp2(tls, v, OP_ResultRow, 3, 1)
- addr = Xsqlite3VdbeAddOp3(tls, v, OP_IfPos, 1, (Xsqlite3VdbeCurrentAddr(tls, v) + 2), 1)
+ addr = Xsqlite3VdbeAddOp3(tls, v, OP_IfPos, 1, Xsqlite3VdbeCurrentAddr(tls, v)+2, 1)
Xsqlite3VdbeAddOp0(tls, v, OP_Halt)
return addr
@@ -108546,16 +110117,16 @@ func integrityCheckResultRow(tls *libc.TLS, v uintptr) int32 { /* sqlite3.c:1288
// If the left side is "database.id" then pId1 is the database name
// and pId2 is the id. If the left side is just "id" then pId1 is the
// id and pId2 is any empty string.
-func Xsqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, pValue uintptr, minusFlag int32) { /* sqlite3.c:128833:21: */
- bp := tls.Alloc(488)
- defer tls.Free(488)
+func Xsqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, pValue uintptr, minusFlag int32) { /* sqlite3.c:129859:21: */
+ bp := tls.Alloc(576)
+ defer tls.Free(576)
var zLeft uintptr // Nul-terminated UTF-8 string <id>
var zRight uintptr // Nul-terminated UTF-8 string <value>, or NULL
var zDb uintptr // The database name
- // var pId uintptr at bp+360, 4
+ // var pId uintptr at bp+440, 4
// Pointer to <id> token
- // var aFcntl [4]uintptr at bp+364, 16
+ // var aFcntl [4]uintptr at bp+444, 16
// Argument to SQLITE_FCNTL_PRAGMA
var iDb int32 // Database index for <database>
var rc int32 // return value form SQLITE_FCNTL_PRAGMA
@@ -108571,7 +110142,7 @@ func Xsqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p
var pBt1 uintptr
var b int32
var iReg int32
- // var x I64 at bp+384, 8
+ // var x I64 at bp+464, 8
// This indicates that no database name was specified as part
// of the PRAGMA command. In this case the locking-mode must be
@@ -108589,43 +110160,54 @@ func Xsqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p
var eMode1 int32 // One of the PAGER_JOURNALMODE_XXX symbols
var ii2 int32
var pPager1 uintptr
- // var iLimit I64 at bp+392, 8
+ // var iLimit I64 at bp+472, 8
var aOp1 uintptr
var iAddr int32
var eAuto int32
var pBt2 uintptr
- // var iLimit1 int32 at bp+400, 4
+ // var iLimit1 int32 at bp+480, 4
var addr int32
var size2 int32
- // var size3 int32 at bp+404, 4
+ // var size3 int32 at bp+484, 4
var ii3 int32
- // var sz Sqlite3_int64 at bp+408, 8
+ // var sz Sqlite3_int64 at bp+488, 8
- // var res int32 at bp+416, 4
+ // var res int32 at bp+496, 4
var iLevel int32
var mask U64
var isHidden int32
+ var pColExpr uintptr
var i int32
var k int32
var nHidden int32
var pCol uintptr
var pPk uintptr
var pTab uintptr
+ // var pDummy uintptr at bp+500, 4
+
+ var zSql uintptr
+ var pTab1 uintptr
+ var pTab2 uintptr
+ var zType uintptr
+ var k1 uintptr
+ var pHash uintptr
+ var initNCol int32
+ var ii4 int32
var cnum I16
var iIdxDb int32
var i1 int32
var mx int32
var pIdx uintptr
- var pTab1 uintptr
- // var azOrigin [3]uintptr at bp+420, 12
+ var pTab3 uintptr
+ // var azOrigin [3]uintptr at bp+504, 12
var iTabDb int32
var pIdx1 uintptr
- var pTab2 uintptr
+ var pTab4 uintptr
var i2 int32
var i3 int32
var pColl uintptr
@@ -108642,57 +110224,60 @@ func Xsqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p
var iTabDb1 int32
var i7 int32
var pFK uintptr
- var pTab3 uintptr
+ var pTab5 uintptr
var iCol int32
var jmp int32
var pFK1 uintptr // A foreign key constraint
- var pTab4 uintptr // Child table contain "REFERENCES" keyword
+ var pTab6 uintptr // Child table contain "REFERENCES" keyword
var pParent uintptr // Parent table that child points to
- // var pIdx2 uintptr at bp+432, 4
+ // var pIdx2 uintptr at bp+516, 4
// Index in the parent table
var i8 int32 // Loop counter: Foreign key number for pTab
var j3 int32 // Loop counter: Field of the foreign key
- var k1 uintptr // Loop counter: Next table in schema
+ var k2 uintptr // Loop counter: Next table in schema
var x1 int32 // result variable
var regResult int32 // 3 registers to hold a result row
var regKey int32 // Register to hold key for checking the FK
var regRow int32 // Registers to hold a row from pTab
var addrTop int32 // Top of a loop checking foreign keys
var addrOk int32 // Jump here if the key is OK
- // var aiCols uintptr at bp+436, 4
+ // var aiCols uintptr at bp+520, 4
- var pTab5 uintptr // Current table
+ var pTab7 uintptr // Current table
var pIdx3 uintptr // An index on pTab
var nIdx int32
- var pTab6 uintptr
+ var pTab8 uintptr
var pIdx4 uintptr
var zErr uintptr
+ var pCol1 uintptr
+ var doError int32
var jmp2 int32
var addrCkFault int32
var addrCkOk int32
var zErr1 uintptr
- var k2 int32
+ var k3 int32
var pCheck uintptr
var iCol1 int32
var uniqOk int32
var jmp6 int32
var kk int32
var jmp21 int32
- // var jmp3 int32 at bp+452, 4
+ // var jmp3 int32 at bp+536, 4
var jmp4 int32
var jmp5 int32
var ckUniq int32
- var pTab7 uintptr
+ var pTab9 uintptr
var pIdx5 uintptr
var pPk1 uintptr
var pPrior uintptr
var loopTop int32
- // var iDataCur int32 at bp+444, 4
+ // var iDataCur int32 at bp+528, 4
- // var iIdxCur int32 at bp+448, 4
+ // var iIdxCur int32 at bp+532, 4
var r1 int32
+ var bStrict int32
var x2 uintptr // For looping over tables in the schema
var pTbls uintptr // Set of all tables in the schema
var aRoot uintptr // Array of root page numbers of all btrees
@@ -108702,7 +110287,7 @@ func Xsqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p
var i9 int32
var j4 int32
var addr1 int32
- // var mxErr int32 at bp+440, 4
+ // var mxErr int32 at bp+524, 4
var pObjTab uintptr // Check only this one table, if not NULL
@@ -108719,21 +110304,21 @@ func Xsqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p
var r11 int32
var iDbLast int32 // Loop termination point for the schema loop
var iTabCur int32 // Cursor for a table whose size needs checking
- var k3 uintptr // Loop over tables of a schema
+ var k4 uintptr // Loop over tables of a schema
var pSchema uintptr // The current schema
- var pTab8 uintptr // A table in the schema
+ var pTab10 uintptr // A table in the schema
var pIdx6 uintptr // An index of the table
var szThreshold LogEst // Size threshold above which reanalysis is needd
var zSubSql uintptr // SQL statement for the OP_SqlExec opcode
var opMask U32
- // var N Sqlite3_int64 at bp+456, 8
+ // var N Sqlite3_int64 at bp+544, 8
var iPrior Sqlite3_int64
- // var N1 Sqlite3_int64 at bp+464, 8
+ // var N1 Sqlite3_int64 at bp+552, 8
- // var N2 Sqlite3_int64 at bp+472, 8
+ // var N2 Sqlite3_int64 at bp+560, 8
- // var N3 Sqlite3_int64 at bp+480, 8
+ // var N3 Sqlite3_int64 at bp+568, 8
zLeft = uintptr(0)
zRight = uintptr(0)
zDb = uintptr(0)
@@ -108751,26 +110336,26 @@ __1:
// Interpret the [schema.] part of the pragma statement. iDb is the
// index of the database this pragma is being applied to in db.aDb[].
- iDb = Xsqlite3TwoPartName(tls, pParse, pId1, pId2, bp+360 /* &pId */)
+ iDb = Xsqlite3TwoPartName(tls, pParse, pId1, pId2, bp+440 /* &pId */)
if !(iDb < 0) {
goto __2
}
return
__2:
;
- pDb = ((*Sqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*16)
+ pDb = (*Sqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*16
// If the temp database has been explicitly named as part of the
// pragma, make sure it is open.
- if !((iDb == 1) && (Xsqlite3OpenTempDatabase(tls, pParse) != 0)) {
+ if !(iDb == 1 && Xsqlite3OpenTempDatabase(tls, pParse) != 0) {
goto __3
}
return
__3:
;
- zLeft = Xsqlite3NameFromToken(tls, db, *(*uintptr)(unsafe.Pointer(bp + 360 /* pId */)))
- if !(!(zLeft != 0)) {
+ zLeft = Xsqlite3NameFromToken(tls, db, *(*uintptr)(unsafe.Pointer(bp + 440 /* pId */)))
+ if !!(zLeft != 0) {
goto __4
}
return
@@ -108779,7 +110364,7 @@ __4:
if !(minusFlag != 0) {
goto __5
}
- zRight = Xsqlite3MPrintf(tls, db, ts+16033 /* "-%T" */, libc.VaList(bp, pValue))
+ zRight = Xsqlite3MPrintf(tls, db, ts+17241 /* "-%T" */, libc.VaList(bp, pValue))
goto __6
__5:
zRight = Xsqlite3NameFromToken(tls, db, pValue)
@@ -108812,30 +110397,30 @@ __7:
// second element of the array is the name of the pragma and the third
// element is the argument to the pragma or NULL if the pragma has no
// argument.
- *(*uintptr)(unsafe.Pointer(bp + 364 /* &aFcntl[0] */)) = uintptr(0)
- *(*uintptr)(unsafe.Pointer(bp + 364 /* &aFcntl[0] */ + 1*4)) = zLeft
- *(*uintptr)(unsafe.Pointer(bp + 364 /* &aFcntl[0] */ + 2*4)) = zRight
- *(*uintptr)(unsafe.Pointer(bp + 364 /* &aFcntl[0] */ + 3*4)) = uintptr(0)
+ *(*uintptr)(unsafe.Pointer(bp + 444 /* &aFcntl[0] */)) = uintptr(0)
+ *(*uintptr)(unsafe.Pointer(bp + 444 /* &aFcntl[0] */ + 1*4)) = zLeft
+ *(*uintptr)(unsafe.Pointer(bp + 444 /* &aFcntl[0] */ + 2*4)) = zRight
+ *(*uintptr)(unsafe.Pointer(bp + 444 /* &aFcntl[0] */ + 3*4)) = uintptr(0)
(*Sqlite3)(unsafe.Pointer(db)).FbusyHandler.FnBusy = 0
- rc = Xsqlite3_file_control(tls, db, zDb, SQLITE_FCNTL_PRAGMA, bp+364 /* aFcntl */)
+ rc = Xsqlite3_file_control(tls, db, zDb, SQLITE_FCNTL_PRAGMA, bp+444 /* aFcntl */)
if !(rc == SQLITE_OK) {
goto __8
}
Xsqlite3VdbeSetNumCols(tls, v, 1)
- Xsqlite3VdbeSetColName(tls, v, 0, COLNAME_NAME, *(*uintptr)(unsafe.Pointer(bp + 364 /* &aFcntl[0] */)), libc.UintptrFromInt32(-1))
- returnSingleText(tls, v, *(*uintptr)(unsafe.Pointer(bp + 364 /* &aFcntl[0] */)))
- Xsqlite3_free(tls, *(*uintptr)(unsafe.Pointer(bp + 364 /* &aFcntl[0] */)))
+ Xsqlite3VdbeSetColName(tls, v, 0, COLNAME_NAME, *(*uintptr)(unsafe.Pointer(bp + 444 /* &aFcntl[0] */)), libc.UintptrFromInt32(-1))
+ returnSingleText(tls, v, *(*uintptr)(unsafe.Pointer(bp + 444 /* &aFcntl[0] */)))
+ Xsqlite3_free(tls, *(*uintptr)(unsafe.Pointer(bp + 444 /* &aFcntl[0] */)))
goto pragma_out
__8:
;
if !(rc != SQLITE_NOTFOUND) {
goto __9
}
- if !(*(*uintptr)(unsafe.Pointer(bp + 364 /* &aFcntl[0] */)) != 0) {
+ if !(*(*uintptr)(unsafe.Pointer(bp + 444)) != 0) {
goto __10
}
- Xsqlite3ErrorMsg(tls, pParse, ts+2790 /* "%s" */, libc.VaList(bp+8, *(*uintptr)(unsafe.Pointer(bp + 364 /* &aFcntl[0] */))))
- Xsqlite3_free(tls, *(*uintptr)(unsafe.Pointer(bp + 364 /* &aFcntl[0] */)))
+ Xsqlite3ErrorMsg(tls, pParse, ts+3601 /* "%s" */, libc.VaList(bp+8, *(*uintptr)(unsafe.Pointer(bp + 444 /* &aFcntl[0] */))))
+ Xsqlite3_free(tls, *(*uintptr)(unsafe.Pointer(bp + 444 /* &aFcntl[0] */)))
__10:
;
(*Parse)(unsafe.Pointer(pParse)).FnErr++
@@ -108849,12 +110434,14 @@ __9:
if !(pPragma == uintptr(0)) {
goto __11
}
+ // IMP: R-43042-22504 No error messages are generated if an
+ // unknown pragma is issued.
goto pragma_out
__11:
;
// Make sure the database schema is loaded if the pragma requires that
- if !((int32((*PragmaName)(unsafe.Pointer(pPragma)).FmPragFlg) & PragFlg_NeedSchema) != 0) {
+ if !(int32((*PragmaName)(unsafe.Pointer(pPragma)).FmPragFlg)&PragFlg_NeedSchema != 0) {
goto __12
}
if !(Xsqlite3ReadSchema(tls, pParse) != 0) {
@@ -108867,8 +110454,8 @@ __12:
;
// Register the result column names for pragmas that return results
- if !(((int32((*PragmaName)(unsafe.Pointer(pPragma)).FmPragFlg) & PragFlg_NoColumns) == 0) &&
- (((int32((*PragmaName)(unsafe.Pointer(pPragma)).FmPragFlg) & PragFlg_NoColumns1) == 0) || (zRight == uintptr(0)))) {
+ if !(int32((*PragmaName)(unsafe.Pointer(pPragma)).FmPragFlg)&PragFlg_NoColumns == 0 &&
+ (int32((*PragmaName)(unsafe.Pointer(pPragma)).FmPragFlg)&PragFlg_NoColumns1 == 0 || zRight == uintptr(0))) {
goto __14
}
setPragmaResultColumnNames(tls, v, pPragma)
@@ -109064,37 +110651,51 @@ __14:
case PragTyp_TABLE_INFO:
goto __32
- case PragTyp_INDEX_INFO:
+ // PRAGMA table_list
+ //
+ // Return a single row for each table, virtual table, or view in the
+ // entire schema.
+ //
+ // schema: Name of attached database hold this table
+ // name: Name of the table itself
+ // type: "table", "view", "virtual", "shadow"
+ // ncol: Number of columns
+ // wr: True for a WITHOUT ROWID table
+ // strict: True for a STRICT table
+ case PragTyp_TABLE_LIST:
goto __33
- case PragTyp_INDEX_LIST:
+ case PragTyp_INDEX_INFO:
goto __34
- case PragTyp_DATABASE_LIST:
+ case PragTyp_INDEX_LIST:
goto __35
- case PragTyp_COLLATION_LIST:
+ case PragTyp_DATABASE_LIST:
goto __36
- case PragTyp_FUNCTION_LIST:
+ case PragTyp_COLLATION_LIST:
goto __37
- case PragTyp_MODULE_LIST:
+ case PragTyp_FUNCTION_LIST:
goto __38
- case PragTyp_PRAGMA_LIST:
+ case PragTyp_MODULE_LIST:
goto __39
- case PragTyp_FOREIGN_KEY_LIST:
+ case PragTyp_PRAGMA_LIST:
goto __40
- case PragTyp_FOREIGN_KEY_CHECK:
+ case PragTyp_FOREIGN_KEY_LIST:
goto __41
+ case PragTyp_FOREIGN_KEY_CHECK:
+ goto __42
+
// Reinstall the LIKE and GLOB functions. The variant of LIKE
// used will be case sensitive or not depending on the RHS.
case PragTyp_CASE_SENSITIVE_LIKE:
- goto __42
+ goto __43
// PRAGMA integrity_check
// PRAGMA integrity_check(N)
@@ -109120,7 +110721,7 @@ __14:
//
// PRAGMA schema.integrity_check;
case PragTyp_INTEGRITY_CHECK:
- goto __43
+ goto __44
// PRAGMA encoding
// PRAGMA encoding = "utf-8"|"utf-16"|"utf-16le"|"utf-16be"
@@ -109143,7 +110744,7 @@ __14:
// new database files created using this database handle. It is only
// useful if invoked immediately after the main database i
case PragTyp_ENCODING:
- goto __44
+ goto __45
// PRAGMA [schema.]schema_version
// PRAGMA [schema.]schema_version = <integer>
@@ -109176,20 +110777,20 @@ __14:
// The user-version is not used internally by SQLite. It may be used by
// applications for any purpose.
case PragTyp_HEADER_VALUE:
- goto __45
+ goto __46
// PRAGMA compile_options
//
// Return the names of all compile-time options used in this build,
// one option per row.
case PragTyp_COMPILE_OPTIONS:
- goto __46
+ goto __47
// PRAGMA [schema.]wal_checkpoint = passive|full|restart|truncate
//
// Checkpoint the database.
case PragTyp_WAL_CHECKPOINT:
- goto __47
+ goto __48
// PRAGMA wal_autocheckpoint
// PRAGMA wal_autocheckpoint = N
@@ -109198,7 +110799,7 @@ __14:
// after accumulating N frames in the log. Or query for the current value
// of N.
case PragTyp_WAL_AUTOCHECKPOINT:
- goto __48
+ goto __49
// PRAGMA shrink_memory
//
@@ -109206,7 +110807,7 @@ __14:
// connection on which it is invoked to free up as much memory as it
// can, by calling sqlite3_db_release_memory().
case PragTyp_SHRINK_MEMORY:
- goto __49
+ goto __50
// PRAGMA optimize
// PRAGMA optimize(MASK)
@@ -109261,7 +110862,7 @@ __14:
// The rules for when tables are analyzed are likely to change in
// future releases.
case PragTyp_OPTIMIZE:
- goto __50
+ goto __51
// PRAGMA busy_timeout
// PRAGMA busy_timeout = N
@@ -109272,7 +110873,7 @@ __14:
// disables the timeout.
/*case PragTyp_BUSY_TIMEOUT*/
default:
- goto __51
+ goto __52
// PRAGMA soft_heap_limit
// PRAGMA soft_heap_limit = N
@@ -109284,7 +110885,7 @@ __14:
// returns the same integer that would be returned by the
// sqlite3_soft_heap_limit64(-1) C-language function.
case PragTyp_SOFT_HEAP_LIMIT:
- goto __52
+ goto __53
// PRAGMA hard_heap_limit
// PRAGMA hard_heap_limit = N
@@ -109296,7 +110897,7 @@ __14:
// the hard heap limit. This allows an application to set a heap limit
// constraint that cannot be relaxed by an untrusted SQL script.
case PragTyp_HARD_HEAP_LIMIT:
- goto __53
+ goto __54
// PRAGMA threads
// PRAGMA threads = N
@@ -109304,7 +110905,7 @@ __14:
// Configure the maximum number of worker threads. Return the new
// maximum, which might be less than requested.
case PragTyp_THREADS:
- goto __54
+ goto __55
// PRAGMA analysis_limit
// PRAGMA analysis_limit = N
@@ -109312,7 +110913,7 @@ __14:
// Configure the maximum number of rows that ANALYZE will examine
// in each index that it looks at. Return the new limit.
case PragTyp_ANALYSIS_LIMIT:
- goto __55
+ goto __56
}
goto __15
@@ -109332,30 +110933,30 @@ __14:
// size of historical compatibility.
__16:
Xsqlite3VdbeUsesBtree(tls, v, iDb)
- if !(!(zRight != 0)) {
- goto __56
+ if !!(zRight != 0) {
+ goto __57
}
- *(*int32)(unsafe.Pointer(pParse + 44 /* &.nMem */)) += (2)
+ *(*int32)(unsafe.Pointer(pParse + 44)) += 2
- aOp = Xsqlite3VdbeAddOpList(tls, v, (int32(uint32(unsafe.Sizeof(getCacheSize)) / uint32(unsafe.Sizeof(VdbeOpList{})))), uintptr(unsafe.Pointer(&getCacheSize)), iLn3)
+ aOp = Xsqlite3VdbeAddOpList(tls, v, int32(uint32(unsafe.Sizeof(getCacheSize))/uint32(unsafe.Sizeof(VdbeOpList{}))), uintptr(unsafe.Pointer(&getCacheSize)), iLn3)
if !(0 != 0) {
- goto __58
+ goto __59
}
goto __15
-__58:
+__59:
;
(*VdbeOp)(unsafe.Pointer(aOp)).Fp1 = iDb
(*VdbeOp)(unsafe.Pointer(aOp + 1*20)).Fp1 = iDb
(*VdbeOp)(unsafe.Pointer(aOp + 6*20)).Fp1 = -2000
- goto __57
-__56:
+ goto __58
+__57:
size = Xsqlite3AbsInt32(tls, Xsqlite3Atoi(tls, zRight))
Xsqlite3BeginWriteOperation(tls, pParse, 0, iDb)
Xsqlite3VdbeAddOp3(tls, v, OP_SetCookie, iDb, BTREE_DEFAULT_CACHE_SIZE, size)
(*Schema)(unsafe.Pointer((*Db)(unsafe.Pointer(pDb)).FpSchema)).Fcache_size = size
Xsqlite3BtreeSetCacheSize(tls, (*Db)(unsafe.Pointer(pDb)).FpBt, (*Schema)(unsafe.Pointer((*Db)(unsafe.Pointer(pDb)).FpSchema)).Fcache_size)
-__57:
+__58:
;
goto __15
@@ -109369,8 +110970,8 @@ __57:
__17:
pBt = (*Db)(unsafe.Pointer(pDb)).FpBt
- if !(!(zRight != 0)) {
- goto __59
+ if !!(zRight != 0) {
+ goto __60
}
if pBt != 0 {
size1 = Xsqlite3BtreeGetPageSize(tls, pBt)
@@ -109378,18 +110979,18 @@ __17:
size1 = 0
}
returnSingleInt(tls, v, int64(size1))
- goto __60
-__59:
+ goto __61
+__60:
// Malloc may fail when setting the page-size, as there is an internal
// buffer that the pager module resizes using sqlite3_realloc().
(*Sqlite3)(unsafe.Pointer(db)).FnextPagesize = Xsqlite3Atoi(tls, zRight)
if !(SQLITE_NOMEM == Xsqlite3BtreeSetPageSize(tls, pBt, (*Sqlite3)(unsafe.Pointer(db)).FnextPagesize, 0, 0)) {
- goto __61
+ goto __62
}
Xsqlite3OomFault(tls, db)
-__61:
+__62:
;
-__60:
+__61:
;
goto __15
@@ -109404,36 +111005,36 @@ __18:
b = -1
if !(zRight != 0) {
- goto __62
- }
- if !(Xsqlite3_stricmp(tls, zRight, ts+16037 /* "fast" */) == 0) {
goto __63
}
+ if !(Xsqlite3_stricmp(tls, zRight, ts+17245) == 0) {
+ goto __64
+ }
b = 2
- goto __64
-__63:
- b = int32(Xsqlite3GetBoolean(tls, zRight, uint8(0)))
+ goto __65
__64:
+ b = int32(Xsqlite3GetBoolean(tls, zRight, uint8(0)))
+__65:
;
-__62:
+__63:
;
- if !(((*Token)(unsafe.Pointer(pId2)).Fn == uint32(0)) && (b >= 0)) {
- goto __65
+ if !((*Token)(unsafe.Pointer(pId2)).Fn == uint32(0) && b >= 0) {
+ goto __66
}
ii = 0
-__66:
+__67:
if !(ii < (*Sqlite3)(unsafe.Pointer(db)).FnDb) {
- goto __68
+ goto __69
}
Xsqlite3BtreeSecureDelete(tls, (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+uintptr(ii)*16)).FpBt, b)
- goto __67
-__67:
- ii++
- goto __66
goto __68
__68:
+ ii++
+ goto __67
+ goto __69
+__69:
;
-__65:
+__66:
;
b = Xsqlite3BtreeSecureDelete(tls, pBt1, b)
returnSingleInt(tls, v, int64(b))
@@ -109455,39 +111056,39 @@ __65:
//
// Return the number of pages in the specified database.
__19:
- *(*I64)(unsafe.Pointer(bp + 384 /* x */)) = int64(0)
+ *(*I64)(unsafe.Pointer(bp + 464 /* x */)) = int64(0)
Xsqlite3CodeVerifySchema(tls, pParse, iDb)
iReg = libc.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1)
- if !((int32(Xsqlite3UpperToLower[uint8(*(*uint8)(unsafe.Pointer(zLeft)))])) == 'p') {
- goto __69
+ if !(int32(Xsqlite3UpperToLower[uint8(*(*uint8)(unsafe.Pointer(zLeft)))]) == 'p') {
+ goto __70
}
Xsqlite3VdbeAddOp2(tls, v, OP_Pagecount, iDb, iReg)
- goto __70
-__69:
- if !((zRight != 0) && (Xsqlite3DecOrHexToI64(tls, zRight, bp+384 /* &x */) == 0)) {
- goto __71
+ goto __71
+__70:
+ if !(zRight != 0 && Xsqlite3DecOrHexToI64(tls, zRight, bp+464) == 0) {
+ goto __72
}
- if !(*(*I64)(unsafe.Pointer(bp + 384 /* x */)) < int64(0)) {
- goto __73
+ if !(*(*I64)(unsafe.Pointer(bp + 464)) < int64(0)) {
+ goto __74
}
- *(*I64)(unsafe.Pointer(bp + 384 /* x */)) = int64(0)
- goto __74
-__73:
- if !(*(*I64)(unsafe.Pointer(bp + 384 /* x */)) > int64(0xfffffffe)) {
- goto __75
+ *(*I64)(unsafe.Pointer(bp + 464 /* x */)) = int64(0)
+ goto __75
+__74:
+ if !(*(*I64)(unsafe.Pointer(bp + 464)) > int64(0xfffffffe)) {
+ goto __76
}
- *(*I64)(unsafe.Pointer(bp + 384 /* x */)) = int64(0xfffffffe)
-__75:
+ *(*I64)(unsafe.Pointer(bp + 464 /* x */)) = int64(0xfffffffe)
+__76:
;
-__74:
+__75:
;
- goto __72
-__71:
- *(*I64)(unsafe.Pointer(bp + 384 /* x */)) = int64(0)
+ goto __73
__72:
+ *(*I64)(unsafe.Pointer(bp + 464 /* x */)) = int64(0)
+__73:
;
- Xsqlite3VdbeAddOp3(tls, v, OP_MaxPgcnt, iDb, iReg, int32(*(*I64)(unsafe.Pointer(bp + 384 /* x */))))
-__70:
+ Xsqlite3VdbeAddOp3(tls, v, OP_MaxPgcnt, iDb, iReg, int32(*(*I64)(unsafe.Pointer(bp + 464 /* x */))))
+__71:
;
Xsqlite3VdbeAddOp2(tls, v, OP_ResultRow, iReg, 1)
goto __15
@@ -109495,49 +111096,49 @@ __70:
// PRAGMA [schema.]locking_mode
// PRAGMA [schema.]locking_mode = (normal|exclusive)
__20:
- zRet = ts + 15821 /* "normal" */
+ zRet = ts + 17036 /* "normal" */
eMode = getLockingMode(tls, zRight)
- if !(((*Token)(unsafe.Pointer(pId2)).Fn == uint32(0)) && (eMode == -1)) {
- goto __76
+ if !((*Token)(unsafe.Pointer(pId2)).Fn == uint32(0) && eMode == -1) {
+ goto __77
}
// Simple "PRAGMA locking_mode;" statement. This is a query for
// the current default locking mode (which may be different to
// the locking-mode of the main database).
eMode = int32((*Sqlite3)(unsafe.Pointer(db)).FdfltLockMode)
- goto __77
-__76:
+ goto __78
+__77:
if !((*Token)(unsafe.Pointer(pId2)).Fn == uint32(0)) {
- goto __78
+ goto __79
}
ii1 = 2
-__79:
+__80:
if !(ii1 < (*Sqlite3)(unsafe.Pointer(db)).FnDb) {
- goto __81
+ goto __82
}
pPager = Xsqlite3BtreePager(tls, (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+uintptr(ii1)*16)).FpBt)
Xsqlite3PagerLockingMode(tls, pPager, eMode)
- goto __80
-__80:
- ii1++
- goto __79
goto __81
__81:
+ ii1++
+ goto __80
+ goto __82
+__82:
;
(*Sqlite3)(unsafe.Pointer(db)).FdfltLockMode = U8(eMode)
-__78:
+__79:
;
pPager = Xsqlite3BtreePager(tls, (*Db)(unsafe.Pointer(pDb)).FpBt)
eMode = Xsqlite3PagerLockingMode(tls, pPager, eMode)
-__77:
+__78:
;
if !(eMode == PAGER_LOCKINGMODE_EXCLUSIVE) {
- goto __82
+ goto __83
}
- zRet = ts + 15811 /* "exclusive" */
-__82:
+ zRet = ts + 17026 /* "exclusive" */
+__83:
;
returnSingleText(tls, v, zRet)
goto __15
@@ -109548,76 +111149,76 @@ __82:
__21: // Loop counter
if !(zRight == uintptr(0)) {
- goto __83
+ goto __84
}
// If there is no "=MODE" part of the pragma, do a query for the
// current mode
eMode1 = -1
- goto __84
-__83:
+ goto __85
+__84:
n = Xsqlite3Strlen30(tls, zRight)
eMode1 = 0
-__85:
- if !((libc.AssignUintptr(&zMode, Xsqlite3JournalModename(tls, eMode1))) != uintptr(0)) {
- goto __87
+__86:
+ if !(libc.AssignUintptr(&zMode, Xsqlite3JournalModename(tls, eMode1)) != uintptr(0)) {
+ goto __88
}
if !(Xsqlite3_strnicmp(tls, zRight, zMode, n) == 0) {
- goto __88
+ goto __89
}
- goto __87
-__88:
+ goto __88
+__89:
;
- goto __86
-__86:
- eMode1++
- goto __85
goto __87
__87:
+ eMode1++
+ goto __86
+ goto __88
+__88:
;
- if !(!(zMode != 0)) {
- goto __89
+ if !!(zMode != 0) {
+ goto __90
}
// If the "=MODE" part does not match any known journal mode,
// then do a query
eMode1 = -1
-__89:
+__90:
;
- if !((eMode1 == PAGER_JOURNALMODE_OFF) && (((*Sqlite3)(unsafe.Pointer(db)).Fflags & uint64(SQLITE_Defensive)) != uint64(0))) {
- goto __90
+ if !(eMode1 == PAGER_JOURNALMODE_OFF && (*Sqlite3)(unsafe.Pointer(db)).Fflags&uint64(SQLITE_Defensive) != uint64(0)) {
+ goto __91
}
// Do not allow journal-mode "OFF" in defensive since the database
// can become corrupted using ordinary SQL when the journal is off
eMode1 = -1
-__90:
+__91:
;
-__84:
+__85:
;
- if !((eMode1 == (-1)) && ((*Token)(unsafe.Pointer(pId2)).Fn == uint32(0))) {
- goto __91
+ if !(eMode1 == -1 && (*Token)(unsafe.Pointer(pId2)).Fn == uint32(0)) {
+ goto __92
}
// Convert "PRAGMA journal_mode" into "PRAGMA main.journal_mode"
iDb = 0
(*Token)(unsafe.Pointer(pId2)).Fn = uint32(1)
-__91:
- ;
- ii2 = ((*Sqlite3)(unsafe.Pointer(db)).FnDb - 1)
__92:
+ ;
+ ii2 = (*Sqlite3)(unsafe.Pointer(db)).FnDb - 1
+__93:
if !(ii2 >= 0) {
- goto __94
- }
- if !(((*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+uintptr(ii2)*16)).FpBt != 0) && ((ii2 == iDb) || ((*Token)(unsafe.Pointer(pId2)).Fn == uint32(0)))) {
goto __95
}
+ if !((*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+uintptr(ii2)*16)).FpBt != 0 && (ii2 == iDb || (*Token)(unsafe.Pointer(pId2)).Fn == uint32(0))) {
+ goto __96
+ }
Xsqlite3VdbeUsesBtree(tls, v, ii2)
Xsqlite3VdbeAddOp3(tls, v, OP_JournalMode, ii2, 1, eMode1)
-__95:
+__96:
;
- goto __93
-__93:
- ii2--
- goto __92
goto __94
__94:
+ ii2--
+ goto __93
+ goto __95
+__95:
;
Xsqlite3VdbeAddOp2(tls, v, OP_ResultRow, 1, 1)
goto __15
@@ -109628,21 +111229,21 @@ __94:
// Get or set the size limit on rollback journal files.
__22:
pPager1 = Xsqlite3BtreePager(tls, (*Db)(unsafe.Pointer(pDb)).FpBt)
- *(*I64)(unsafe.Pointer(bp + 392 /* iLimit */)) = int64(-2)
+ *(*I64)(unsafe.Pointer(bp + 472 /* iLimit */)) = int64(-2)
if !(zRight != 0) {
- goto __96
- }
- Xsqlite3DecOrHexToI64(tls, zRight, bp+392 /* &iLimit */)
- if !(*(*I64)(unsafe.Pointer(bp + 392 /* iLimit */)) < int64(-1)) {
goto __97
}
- *(*I64)(unsafe.Pointer(bp + 392 /* iLimit */)) = int64(-1)
-__97:
+ Xsqlite3DecOrHexToI64(tls, zRight, bp+472 /* &iLimit */)
+ if !(*(*I64)(unsafe.Pointer(bp + 472)) < int64(-1)) {
+ goto __98
+ }
+ *(*I64)(unsafe.Pointer(bp + 472 /* iLimit */)) = int64(-1)
+__98:
;
-__96:
+__97:
;
- *(*I64)(unsafe.Pointer(bp + 392 /* iLimit */)) = Xsqlite3PagerJournalSizeLimit(tls, pPager1, *(*I64)(unsafe.Pointer(bp + 392 /* iLimit */)))
- returnSingleInt(tls, v, *(*I64)(unsafe.Pointer(bp + 392 /* iLimit */)))
+ *(*I64)(unsafe.Pointer(bp + 472 /* iLimit */)) = Xsqlite3PagerJournalSizeLimit(tls, pPager1, *(*I64)(unsafe.Pointer(bp + 472 /* iLimit */)))
+ returnSingleInt(tls, v, *(*I64)(unsafe.Pointer(bp + 472 /* iLimit */)))
goto __15
// PRAGMA [schema.]auto_vacuum
@@ -109653,12 +111254,12 @@ __96:
__23:
pBt2 = (*Db)(unsafe.Pointer(pDb)).FpBt
- if !(!(zRight != 0)) {
- goto __98
+ if !!(zRight != 0) {
+ goto __99
}
returnSingleInt(tls, v, int64(Xsqlite3BtreeGetAutoVacuum(tls, pBt2)))
- goto __99
-__98:
+ goto __100
+__99:
eAuto = getAutoVacuum(tls, zRight)
(*Sqlite3)(unsafe.Pointer(db)).FnextAutovac = int8(U8(eAuto))
@@ -109667,27 +111268,27 @@ __98:
// creates the database file. It is important that it is created
// as an auto-vacuum capable db.
rc = Xsqlite3BtreeSetAutoVacuum(tls, pBt2, eAuto)
- if !((rc == SQLITE_OK) && ((eAuto == 1) || (eAuto == 2))) {
- goto __100
+ if !(rc == SQLITE_OK && (eAuto == 1 || eAuto == 2)) {
+ goto __101
}
iAddr = Xsqlite3VdbeCurrentAddr(tls, v)
- aOp1 = Xsqlite3VdbeAddOpList(tls, v, (int32(uint32(unsafe.Sizeof(setMeta6)) / uint32(unsafe.Sizeof(VdbeOpList{})))), uintptr(unsafe.Pointer(&setMeta6)), iLn4)
+ aOp1 = Xsqlite3VdbeAddOpList(tls, v, int32(uint32(unsafe.Sizeof(setMeta6))/uint32(unsafe.Sizeof(VdbeOpList{}))), uintptr(unsafe.Pointer(&setMeta6)), iLn4)
if !(0 != 0) {
- goto __101
+ goto __102
}
goto __15
-__101:
+__102:
;
(*VdbeOp)(unsafe.Pointer(aOp1)).Fp1 = iDb
(*VdbeOp)(unsafe.Pointer(aOp1 + 1*20)).Fp1 = iDb
- (*VdbeOp)(unsafe.Pointer(aOp1 + 2*20)).Fp2 = (iAddr + 4)
+ (*VdbeOp)(unsafe.Pointer(aOp1 + 2*20)).Fp2 = iAddr + 4
(*VdbeOp)(unsafe.Pointer(aOp1 + 4*20)).Fp1 = iDb
- (*VdbeOp)(unsafe.Pointer(aOp1 + 4*20)).Fp3 = (eAuto - 1)
+ (*VdbeOp)(unsafe.Pointer(aOp1 + 4*20)).Fp3 = eAuto - 1
Xsqlite3VdbeUsesBtree(tls, v, iDb)
-__100:
+__101:
;
-__99:
+__100:
;
goto __15
@@ -109695,14 +111296,14 @@ __99:
//
// Do N steps of incremental vacuuming on a database.
__24:
- if !(((zRight == uintptr(0)) || !(Xsqlite3GetInt32(tls, zRight, bp+400 /* &iLimit1 */) != 0)) || (*(*int32)(unsafe.Pointer(bp + 400 /* iLimit1 */)) <= 0)) {
- goto __102
+ if !(zRight == uintptr(0) || !(Xsqlite3GetInt32(tls, zRight, bp+480) != 0) || *(*int32)(unsafe.Pointer(bp + 480)) <= 0) {
+ goto __103
}
- *(*int32)(unsafe.Pointer(bp + 400 /* iLimit1 */)) = 0x7fffffff
-__102:
+ *(*int32)(unsafe.Pointer(bp + 480 /* iLimit1 */)) = 0x7fffffff
+__103:
;
Xsqlite3BeginWriteOperation(tls, pParse, 0, iDb)
- Xsqlite3VdbeAddOp2(tls, v, OP_Integer, *(*int32)(unsafe.Pointer(bp + 400 /* iLimit1 */)), 1)
+ Xsqlite3VdbeAddOp2(tls, v, OP_Integer, *(*int32)(unsafe.Pointer(bp + 480 /* iLimit1 */)), 1)
addr = Xsqlite3VdbeAddOp1(tls, v, OP_IncrVacuum, iDb)
Xsqlite3VdbeAddOp1(tls, v, OP_ResultRow, 1)
Xsqlite3VdbeAddOp2(tls, v, OP_AddImm, 1, -1)
@@ -109721,16 +111322,16 @@ __102:
// of memory.
__25:
;
- if !(!(zRight != 0)) {
- goto __103
+ if !!(zRight != 0) {
+ goto __104
}
returnSingleInt(tls, v, int64((*Schema)(unsafe.Pointer((*Db)(unsafe.Pointer(pDb)).FpSchema)).Fcache_size))
- goto __104
-__103:
+ goto __105
+__104:
size2 = Xsqlite3Atoi(tls, zRight)
(*Schema)(unsafe.Pointer((*Db)(unsafe.Pointer(pDb)).FpSchema)).Fcache_size = size2
Xsqlite3BtreeSetCacheSize(tls, (*Db)(unsafe.Pointer(pDb)).FpBt, (*Schema)(unsafe.Pointer((*Db)(unsafe.Pointer(pDb)).FpSchema)).Fcache_size)
-__104:
+__105:
;
goto __15
@@ -109756,36 +111357,36 @@ __104:
// not just the schema specified.
__26:
;
- if !(!(zRight != 0)) {
- goto __105
+ if !!(zRight != 0) {
+ goto __106
}
returnSingleInt(tls, v,
func() int64 {
- if ((*Sqlite3)(unsafe.Pointer(db)).Fflags & uint64(SQLITE_CacheSpill)) == uint64(0) {
+ if (*Sqlite3)(unsafe.Pointer(db)).Fflags&uint64(SQLITE_CacheSpill) == uint64(0) {
return int64(0)
}
return int64(Xsqlite3BtreeSetSpillSize(tls, (*Db)(unsafe.Pointer(pDb)).FpBt, 0))
}())
- goto __106
-__105:
- *(*int32)(unsafe.Pointer(bp + 404 /* size3 */)) = 1
- if !(Xsqlite3GetInt32(tls, zRight, bp+404 /* &size3 */) != 0) {
- goto __107
- }
- Xsqlite3BtreeSetSpillSize(tls, (*Db)(unsafe.Pointer(pDb)).FpBt, *(*int32)(unsafe.Pointer(bp + 404 /* size3 */)))
-__107:
- ;
- if !(Xsqlite3GetBoolean(tls, zRight, (uint8(libc.Bool32(*(*int32)(unsafe.Pointer(bp + 404 /* size3 */)) != 0)))) != 0) {
+ goto __107
+__106:
+ *(*int32)(unsafe.Pointer(bp + 484 /* size3 */)) = 1
+ if !(Xsqlite3GetInt32(tls, zRight, bp+484) != 0) {
goto __108
}
- *(*U64)(unsafe.Pointer(db + 32 /* &.flags */)) |= (uint64(SQLITE_CacheSpill))
- goto __109
+ Xsqlite3BtreeSetSpillSize(tls, (*Db)(unsafe.Pointer(pDb)).FpBt, *(*int32)(unsafe.Pointer(bp + 484 /* size3 */)))
__108:
- *(*U64)(unsafe.Pointer(db + 32 /* &.flags */)) &= (libc.CplUint64(uint64(SQLITE_CacheSpill)))
+ ;
+ if !(Xsqlite3GetBoolean(tls, zRight, uint8(libc.Bool32(*(*int32)(unsafe.Pointer(bp + 484)) != 0))) != 0) {
+ goto __109
+ }
+ *(*U64)(unsafe.Pointer(db + 32)) |= uint64(SQLITE_CacheSpill)
+ goto __110
__109:
+ *(*U64)(unsafe.Pointer(db + 32)) &= libc.CplUint64(uint64(SQLITE_CacheSpill))
+__110:
;
setAllPagerFlags(tls, db)
-__106:
+__107:
;
goto __15
@@ -109804,57 +111405,57 @@ __106:
__27:
;
if !(zRight != 0) {
- goto __110
- }
- Xsqlite3DecOrHexToI64(tls, zRight, bp+408 /* &sz */)
- if !(*(*Sqlite3_int64)(unsafe.Pointer(bp + 408 /* sz */)) < int64(0)) {
goto __111
}
- *(*Sqlite3_int64)(unsafe.Pointer(bp + 408 /* sz */)) = Xsqlite3Config.FszMmap
-__111:
- ;
- if !((*Token)(unsafe.Pointer(pId2)).Fn == uint32(0)) {
+ Xsqlite3DecOrHexToI64(tls, zRight, bp+488 /* &sz */)
+ if !(*(*Sqlite3_int64)(unsafe.Pointer(bp + 488)) < int64(0)) {
goto __112
}
- (*Sqlite3)(unsafe.Pointer(db)).FszMmap = *(*Sqlite3_int64)(unsafe.Pointer(bp + 408 /* sz */))
+ *(*Sqlite3_int64)(unsafe.Pointer(bp + 488 /* sz */)) = Xsqlite3Config.FszMmap
__112:
;
- ii3 = ((*Sqlite3)(unsafe.Pointer(db)).FnDb - 1)
+ if !((*Token)(unsafe.Pointer(pId2)).Fn == uint32(0)) {
+ goto __113
+ }
+ (*Sqlite3)(unsafe.Pointer(db)).FszMmap = *(*Sqlite3_int64)(unsafe.Pointer(bp + 488 /* sz */))
__113:
+ ;
+ ii3 = (*Sqlite3)(unsafe.Pointer(db)).FnDb - 1
+__114:
if !(ii3 >= 0) {
- goto __115
- }
- if !(((*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+uintptr(ii3)*16)).FpBt != 0) && ((ii3 == iDb) || ((*Token)(unsafe.Pointer(pId2)).Fn == uint32(0)))) {
goto __116
}
- Xsqlite3BtreeSetMmapLimit(tls, (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+uintptr(ii3)*16)).FpBt, *(*Sqlite3_int64)(unsafe.Pointer(bp + 408 /* sz */)))
-__116:
+ if !((*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+uintptr(ii3)*16)).FpBt != 0 && (ii3 == iDb || (*Token)(unsafe.Pointer(pId2)).Fn == uint32(0))) {
+ goto __117
+ }
+ Xsqlite3BtreeSetMmapLimit(tls, (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+uintptr(ii3)*16)).FpBt, *(*Sqlite3_int64)(unsafe.Pointer(bp + 488 /* sz */)))
+__117:
;
- goto __114
-__114:
- ii3--
- goto __113
goto __115
__115:
+ ii3--
+ goto __114
+ goto __116
+__116:
;
-__110:
+__111:
;
- *(*Sqlite3_int64)(unsafe.Pointer(bp + 408 /* sz */)) = int64(-1)
- rc = Xsqlite3_file_control(tls, db, zDb, SQLITE_FCNTL_MMAP_SIZE, bp+408 /* &sz */)
+ *(*Sqlite3_int64)(unsafe.Pointer(bp + 488 /* sz */)) = int64(-1)
+ rc = Xsqlite3_file_control(tls, db, zDb, SQLITE_FCNTL_MMAP_SIZE, bp+488 /* &sz */)
if !(rc == SQLITE_OK) {
- goto __117
+ goto __118
}
- returnSingleInt(tls, v, *(*Sqlite3_int64)(unsafe.Pointer(bp + 408 /* sz */)))
- goto __118
-__117:
+ returnSingleInt(tls, v, *(*Sqlite3_int64)(unsafe.Pointer(bp + 488 /* sz */)))
+ goto __119
+__118:
if !(rc != SQLITE_NOTFOUND) {
- goto __119
+ goto __120
}
(*Parse)(unsafe.Pointer(pParse)).FnErr++
(*Parse)(unsafe.Pointer(pParse)).Frc = rc
-__119:
+__120:
;
-__118:
+__119:
;
goto __15
@@ -109868,14 +111469,14 @@ __118:
// Note that it is possible for the library compile-time options to
// override this setting
__28:
- if !(!(zRight != 0)) {
- goto __120
+ if !!(zRight != 0) {
+ goto __121
}
returnSingleInt(tls, v, int64((*Sqlite3)(unsafe.Pointer(db)).Ftemp_store))
- goto __121
-__120:
- changeTempStorage(tls, pParse, zRight)
+ goto __122
__121:
+ changeTempStorage(tls, pParse, zRight)
+__122:
;
goto __15
@@ -109888,44 +111489,44 @@ __121:
// If temporary directory is changed, then invalidateTempStorage.
//
__29:
- if !(!(zRight != 0)) {
- goto __122
+ if !!(zRight != 0) {
+ goto __123
}
returnSingleText(tls, v, Xsqlite3_temp_directory)
- goto __123
-__122:
+ goto __124
+__123:
if !(*(*uint8)(unsafe.Pointer(zRight)) != 0) {
- goto __124
- }
- rc = Xsqlite3OsAccess(tls, (*Sqlite3)(unsafe.Pointer(db)).FpVfs, zRight, SQLITE_ACCESS_READWRITE, bp+416 /* &res */)
- if !((rc != SQLITE_OK) || (*(*int32)(unsafe.Pointer(bp + 416 /* res */)) == 0)) {
goto __125
}
- Xsqlite3ErrorMsg(tls, pParse, ts+16042 /* "not a writable d..." */, 0)
+ rc = Xsqlite3OsAccess(tls, (*Sqlite3)(unsafe.Pointer(db)).FpVfs, zRight, SQLITE_ACCESS_READWRITE, bp+496 /* &res */)
+ if !(rc != SQLITE_OK || *(*int32)(unsafe.Pointer(bp + 496)) == 0) {
+ goto __126
+ }
+ Xsqlite3ErrorMsg(tls, pParse, ts+17250 /* "not a writable d..." */, 0)
goto pragma_out
-__125:
+__126:
;
-__124:
+__125:
;
- if !(((SQLITE_TEMP_STORE == 0) ||
- ((SQLITE_TEMP_STORE == 1) && (int32((*Sqlite3)(unsafe.Pointer(db)).Ftemp_store) <= 1))) ||
- ((SQLITE_TEMP_STORE == 2) && (int32((*Sqlite3)(unsafe.Pointer(db)).Ftemp_store) == 1))) {
- goto __126
+ if !(SQLITE_TEMP_STORE == 0 ||
+ SQLITE_TEMP_STORE == 1 && int32((*Sqlite3)(unsafe.Pointer(db)).Ftemp_store) <= 1 ||
+ SQLITE_TEMP_STORE == 2 && int32((*Sqlite3)(unsafe.Pointer(db)).Ftemp_store) == 1) {
+ goto __127
}
invalidateTempStorage(tls, pParse)
-__126:
+__127:
;
Xsqlite3_free(tls, Xsqlite3_temp_directory)
if !(*(*uint8)(unsafe.Pointer(zRight)) != 0) {
- goto __127
+ goto __128
}
- Xsqlite3_temp_directory = Xsqlite3_mprintf(tls, ts+2790 /* "%s" */, libc.VaList(bp+16, zRight))
- goto __128
-__127:
- Xsqlite3_temp_directory = uintptr(0)
+ Xsqlite3_temp_directory = Xsqlite3_mprintf(tls, ts+3601 /* "%s" */, libc.VaList(bp+16, zRight))
+ goto __129
__128:
+ Xsqlite3_temp_directory = uintptr(0)
+__129:
;
-__123:
+__124:
;
goto __15
@@ -109937,72 +111538,82 @@ __123:
// default value will be restored the next time the database is
// opened.
__30:
- if !(!(zRight != 0)) {
- goto __129
+ if !!(zRight != 0) {
+ goto __130
}
- returnSingleInt(tls, v, (int64(int32((*Db)(unsafe.Pointer(pDb)).Fsafety_level) - 1)))
- goto __130
-__129:
- if !(!(int32((*Sqlite3)(unsafe.Pointer(db)).FautoCommit) != 0)) {
- goto __131
+ returnSingleInt(tls, v, int64(int32((*Db)(unsafe.Pointer(pDb)).Fsafety_level)-1))
+ goto __131
+__130:
+ if !!(int32((*Sqlite3)(unsafe.Pointer(db)).FautoCommit) != 0) {
+ goto __132
}
Xsqlite3ErrorMsg(tls, pParse,
- ts+16067 /* "Safety level may..." */, 0)
- goto __132
-__131:
+ ts+17275 /* "Safety level may..." */, 0)
+ goto __133
+__132:
if !(iDb != 1) {
- goto __133
+ goto __134
}
- iLevel = ((int32(getSafetyLevel(tls, zRight, 0, uint8(1))) + 1) & PAGER_SYNCHRONOUS_MASK)
+ iLevel = (int32(getSafetyLevel(tls, zRight, 0, uint8(1))) + 1) & PAGER_SYNCHRONOUS_MASK
if !(iLevel == 0) {
- goto __134
+ goto __135
}
iLevel = 1
-__134:
+__135:
;
(*Db)(unsafe.Pointer(pDb)).Fsafety_level = U8(iLevel)
(*Db)(unsafe.Pointer(pDb)).FbSyncSet = U8(1)
setAllPagerFlags(tls, db)
-__133:
+__134:
;
-__132:
+__133:
;
-__130:
+__131:
;
goto __15
__31:
if !(zRight == uintptr(0)) {
- goto __135
+ goto __136
}
setPragmaResultColumnNames(tls, v, pPragma)
- returnSingleInt(tls, v, (int64(libc.Bool32(((*Sqlite3)(unsafe.Pointer(db)).Fflags & (*PragmaName)(unsafe.Pointer(pPragma)).FiArg) != uint64(0)))))
- goto __136
-__135:
+ returnSingleInt(tls, v, int64(libc.Bool32((*Sqlite3)(unsafe.Pointer(db)).Fflags&(*PragmaName)(unsafe.Pointer(pPragma)).FiArg != uint64(0))))
+ goto __137
+__136:
mask = (*PragmaName)(unsafe.Pointer(pPragma)).FiArg // Mask of bits to set or clear.
if !(int32((*Sqlite3)(unsafe.Pointer(db)).FautoCommit) == 0) {
- goto __137
+ goto __138
}
// Foreign key support may not be enabled or disabled while not
// in auto-commit mode.
- mask = mask & (libc.Uint64FromInt32(libc.CplInt32(SQLITE_ForeignKeys)))
-__137:
+ mask = mask & libc.Uint64FromInt32(libc.CplInt32(SQLITE_ForeignKeys))
+__138:
;
if !(Xsqlite3GetBoolean(tls, zRight, uint8(0)) != 0) {
- goto __138
+ goto __139
}
- *(*U64)(unsafe.Pointer(db + 32 /* &.flags */)) |= (mask)
- goto __139
-__138:
- *(*U64)(unsafe.Pointer(db + 32 /* &.flags */)) &= (^mask)
+ *(*U64)(unsafe.Pointer(db + 32)) |= mask
+ goto __140
+__139:
+ *(*U64)(unsafe.Pointer(db + 32)) &= ^mask
if !(mask == uint64(SQLITE_DeferFKs)) {
- goto __140
+ goto __141
}
(*Sqlite3)(unsafe.Pointer(db)).FnDeferredImmCons = int64(0)
-__140:
+__141:
;
-__139:
+ if !(mask&uint64(SQLITE_WriteSchema) != uint64(0) &&
+ Xsqlite3_stricmp(tls, zRight, ts+17328) == 0) {
+ goto __142
+ }
+ // 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.
+ Xsqlite3ResetAllSchemasOfConnection(tls, db)
+__142:
+ ;
+__140:
;
// Many of the flag-pragmas modify the code generated by the SQL
@@ -110010,7 +111621,7 @@ __139:
// compiled SQL statements after modifying a pragma value.
Xsqlite3VdbeAddOp0(tls, v, OP_Expire)
setAllPagerFlags(tls, db)
-__136:
+__137:
;
goto __15
@@ -110027,12 +111638,12 @@ __136:
// pk: Non-zero for PK fields.
__32:
if !(zRight != 0) {
- goto __141
+ goto __143
}
Xsqlite3CodeVerifyNamedSchema(tls, pParse, zDb)
pTab = Xsqlite3LocateTable(tls, pParse, uint32(LOCATE_NOERR), zRight, zDb)
if !(pTab != 0) {
- goto __142
+ goto __144
}
nHidden = 0
pPk = Xsqlite3PrimaryKeyIndex(tls, pTab)
@@ -110040,516 +111651,659 @@ __32:
Xsqlite3ViewGetColumnNames(tls, pParse, pTab)
i = 0
pCol = (*Table)(unsafe.Pointer(pTab)).FaCol
-__143:
+__145:
if !(i < int32((*Table)(unsafe.Pointer(pTab)).FnCol)) {
- goto __145
+ goto __147
}
isHidden = 0
- if !((int32((*Column)(unsafe.Pointer(pCol)).FcolFlags) & COLFLAG_NOINSERT) != 0) {
- goto __146
+ if !(int32((*Column)(unsafe.Pointer(pCol)).FcolFlags)&COLFLAG_NOINSERT != 0) {
+ goto __148
}
if !((*PragmaName)(unsafe.Pointer(pPragma)).FiArg == uint64(0)) {
- goto __147
+ goto __149
}
nHidden++
- goto __144
-__147:
+ goto __146
+__149:
;
- if !((int32((*Column)(unsafe.Pointer(pCol)).FcolFlags) & COLFLAG_VIRTUAL) != 0) {
- goto __148
- }
- isHidden = 2 // GENERATED ALWAYS AS ... VIRTUAL
- goto __149
-__148:
- if !((int32((*Column)(unsafe.Pointer(pCol)).FcolFlags) & COLFLAG_STORED) != 0) {
+ if !(int32((*Column)(unsafe.Pointer(pCol)).FcolFlags)&COLFLAG_VIRTUAL != 0) {
goto __150
}
- isHidden = 3 // GENERATED ALWAYS AS ... STORED
+ isHidden = 2 // GENERATED ALWAYS AS ... VIRTUAL
goto __151
__150:
+ if !(int32((*Column)(unsafe.Pointer(pCol)).FcolFlags)&COLFLAG_STORED != 0) {
+ goto __152
+ }
+ isHidden = 3 // GENERATED ALWAYS AS ... STORED
+ goto __153
+__152:
;
isHidden = 1 // HIDDEN
-__151:
+__153:
;
-__149:
+__151:
;
-__146:
+__148:
;
- if !((int32((*Column)(unsafe.Pointer(pCol)).FcolFlags) & COLFLAG_PRIMKEY) == 0) {
- goto __152
- }
- k = 0
- goto __153
-__152:
- if !(pPk == uintptr(0)) {
+ if !(int32((*Column)(unsafe.Pointer(pCol)).FcolFlags)&COLFLAG_PRIMKEY == 0) {
goto __154
}
- k = 1
+ k = 0
goto __155
__154:
+ if !(pPk == uintptr(0)) {
+ goto __156
+ }
k = 1
+ goto __157
__156:
- if !((k <= int32((*Table)(unsafe.Pointer(pTab)).FnCol)) && (int32(*(*I16)(unsafe.Pointer((*Index)(unsafe.Pointer(pPk)).FaiColumn + uintptr((k-1))*2))) != i)) {
- goto __158
+ k = 1
+__158:
+ if !(k <= int32((*Table)(unsafe.Pointer(pTab)).FnCol) && int32(*(*I16)(unsafe.Pointer((*Index)(unsafe.Pointer(pPk)).FaiColumn + uintptr(k-1)*2))) != i) {
+ goto __160
}
- goto __157
-__157:
+ goto __159
+__159:
k++
- goto __156
goto __158
-__158:
+ goto __160
+__160:
;
-__155:
+__157:
;
-__153:
+__155:
;
+ pColExpr = Xsqlite3ColumnExpr(tls, pTab, pCol)
Xsqlite3VdbeMultiLoad(tls, v, 1, func() uintptr {
if (*PragmaName)(unsafe.Pointer(pPragma)).FiArg != 0 {
- return ts + 16120 /* "issisii" */
+ return ts + 17334 /* "issisii" */
}
- return ts + 16128 /* "issisi" */
+ return ts + 17342 /* "issisi" */
}(),
- libc.VaList(bp+24, (i-nHidden),
- (*Column)(unsafe.Pointer(pCol)).FzName,
- Xsqlite3ColumnType(tls, pCol, ts+755 /* "" */),
+ libc.VaList(bp+24, i-nHidden,
+ (*Column)(unsafe.Pointer(pCol)).FzCnName,
+ Xsqlite3ColumnType(tls, pCol, ts+1543 /* "" */),
func() int32 {
- if (*Column)(unsafe.Pointer(pCol)).FnotNull != 0 {
+ if uint32(int32(*(*uint8)(unsafe.Pointer(pCol + 4))&0xf>>0)) != 0 {
return 1
}
return 0
}(),
func() uintptr {
- if ((*Column)(unsafe.Pointer(pCol)).FpDflt != 0) && (isHidden < 2) {
- return *(*uintptr)(unsafe.Pointer((*Column)(unsafe.Pointer(pCol)).FpDflt + 8 /* &.u */))
+ if isHidden >= 2 || pColExpr == uintptr(0) {
+ return uintptr(0)
}
- return uintptr(0)
+ return *(*uintptr)(unsafe.Pointer(pColExpr + 8))
}(),
k,
isHidden))
- goto __144
-__144:
+ goto __146
+__146:
i++
- pCol += 20
- goto __143
+ pCol += 16
goto __145
-__145:
+ goto __147
+__147:
;
-__142:
+__144:
;
-__141:
+__143:
;
goto __15
+ // PRAGMA table_list
+ //
+ // Return a single row for each table, virtual table, or view in the
+ // entire schema.
+ //
+ // schema: Name of attached database hold this table
+ // name: Name of the table itself
+ // type: "table", "view", "virtual", "shadow"
+ // ncol: Number of columns
+ // wr: True for a WITHOUT ROWID table
+ // strict: True for a STRICT table
__33:
+ (*Parse)(unsafe.Pointer(pParse)).FnMem = 6
+ Xsqlite3CodeVerifyNamedSchema(tls, pParse, zDb)
+ ii4 = 0
+__161:
+ if !(ii4 < (*Sqlite3)(unsafe.Pointer(db)).FnDb) {
+ goto __163
+ }
+ if !(zDb != 0 && Xsqlite3_stricmp(tls, zDb, (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+uintptr(ii4)*16)).FzDbSName) != 0) {
+ goto __164
+ }
+ goto __162
+__164:
+ ;
+
+ // Ensure that the Table.nCol field is initialized for all views
+ // and virtual tables. Each time we initialize a Table.nCol value
+ // for a table, that can potentially disrupt the hash table, so restart
+ // the initialization scan.
+ pHash = (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+uintptr(ii4)*16)).FpSchema + 8
+ initNCol = int32((*Hash)(unsafe.Pointer(pHash)).Fcount)
+__165:
+ if !(libc.PostDecInt32(&initNCol, 1) != 0) {
+ goto __166
+ }
+ k1 = (*Hash)(unsafe.Pointer(pHash)).Ffirst
+__167:
+ if !(1 != 0) {
+ goto __169
+ }
+ if !(k1 == uintptr(0)) {
+ goto __170
+ }
+ initNCol = 0
+ goto __169
+__170:
+ ;
+ pTab1 = (*HashElem)(unsafe.Pointer(k1)).Fdata
+ if !(int32((*Table)(unsafe.Pointer(pTab1)).FnCol) == 0) {
+ goto __171
+ }
+ zSql = Xsqlite3MPrintf(tls, db, ts+17349 /* "SELECT*FROM\"%w\"" */, libc.VaList(bp+80, (*Table)(unsafe.Pointer(pTab1)).FzName))
+ if !(zSql != 0) {
+ goto __172
+ }
+ *(*uintptr)(unsafe.Pointer(bp + 500 /* pDummy */)) = uintptr(0)
+ Xsqlite3_prepare(tls, db, zSql, -1, bp+500 /* &pDummy */, uintptr(0))
+ Xsqlite3_finalize(tls, *(*uintptr)(unsafe.Pointer(bp + 500 /* pDummy */)))
+ Xsqlite3DbFree(tls, db, zSql)
+__172:
+ ;
+ pHash = (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+uintptr(ii4)*16)).FpSchema + 8
+ goto __169
+__171:
+ ;
+ goto __168
+__168:
+ k1 = (*HashElem)(unsafe.Pointer(k1)).Fnext
+ goto __167
+ goto __169
+__169:
+ ;
+ goto __165
+__166:
+ ;
+
+ k1 = (*Hash)(unsafe.Pointer(pHash)).Ffirst
+__173:
+ if !(k1 != 0) {
+ goto __175
+ }
+ pTab2 = (*HashElem)(unsafe.Pointer(k1)).Fdata
+ if !(zRight != 0 && Xsqlite3_stricmp(tls, zRight, (*Table)(unsafe.Pointer(pTab2)).FzName) != 0) {
+ goto __176
+ }
+ goto __174
+__176:
+ ;
+ if !(int32((*Table)(unsafe.Pointer(pTab2)).FeTabType) == TABTYP_VIEW) {
+ goto __177
+ }
+ zType = ts + 10358 /* "view" */
+ goto __178
+__177:
+ if !(int32((*Table)(unsafe.Pointer(pTab2)).FeTabType) == TABTYP_VTAB) {
+ goto __179
+ }
+ zType = ts + 12614 /* "virtual" */
+ goto __180
+__179:
+ if !((*Table)(unsafe.Pointer(pTab2)).FtabFlags&U32(TF_Shadow) != 0) {
+ goto __181
+ }
+ zType = ts + 17365 /* "shadow" */
+ goto __182
+__181:
+ zType = ts + 8739 /* "table" */
+__182:
+ ;
+__180:
+ ;
+__178:
+ ;
+ Xsqlite3VdbeMultiLoad(tls, v, 1, ts+17372, /* "sssiii" */
+ libc.VaList(bp+88, (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+uintptr(ii4)*16)).FzDbSName,
+ Xsqlite3PreferredTableName(tls, (*Table)(unsafe.Pointer(pTab2)).FzName),
+ zType,
+ int32((*Table)(unsafe.Pointer(pTab2)).FnCol),
+ libc.Bool32((*Table)(unsafe.Pointer(pTab2)).FtabFlags&U32(TF_WithoutRowid) != U32(0)),
+ libc.Bool32((*Table)(unsafe.Pointer(pTab2)).FtabFlags&U32(TF_Strict) != U32(0))))
+ goto __174
+__174:
+ k1 = (*HashElem)(unsafe.Pointer(k1)).Fnext
+ goto __173
+ goto __175
+__175:
+ ;
+ goto __162
+__162:
+ ii4++
+ goto __161
+ goto __163
+__163:
+ ;
+
+ goto __15
+
+__34:
if !(zRight != 0) {
- goto __159
+ goto __183
}
pIdx = Xsqlite3FindIndex(tls, db, zRight, zDb)
if !(pIdx == uintptr(0)) {
- goto __160
+ goto __184
}
// If there is no index named zRight, check to see if there is a
// WITHOUT ROWID table named zRight, and if there is, show the
// structure of the PRIMARY KEY index for that table.
- pTab1 = Xsqlite3LocateTable(tls, pParse, uint32(LOCATE_NOERR), zRight, zDb)
- if !((pTab1 != 0) && !(((*Table)(unsafe.Pointer((pTab1))).FtabFlags & U32(TF_WithoutRowid)) == U32(0))) {
- goto __161
+ pTab3 = Xsqlite3LocateTable(tls, pParse, uint32(LOCATE_NOERR), zRight, zDb)
+ if !(pTab3 != 0 && !((*Table)(unsafe.Pointer(pTab3)).FtabFlags&U32(TF_WithoutRowid) == U32(0))) {
+ goto __185
}
- pIdx = Xsqlite3PrimaryKeyIndex(tls, pTab1)
-__161:
+ pIdx = Xsqlite3PrimaryKeyIndex(tls, pTab3)
+__185:
;
-__160:
+__184:
;
if !(pIdx != 0) {
- goto __162
+ goto __186
}
iIdxDb = Xsqlite3SchemaToIndex(tls, db, (*Index)(unsafe.Pointer(pIdx)).FpSchema)
if !((*PragmaName)(unsafe.Pointer(pPragma)).FiArg != 0) {
- goto __163
+ goto __187
}
// PRAGMA index_xinfo (newer version with more rows and columns)
mx = int32((*Index)(unsafe.Pointer(pIdx)).FnColumn)
(*Parse)(unsafe.Pointer(pParse)).FnMem = 6
- goto __164
-__163:
+ goto __188
+__187:
// PRAGMA index_info (legacy version)
mx = int32((*Index)(unsafe.Pointer(pIdx)).FnKeyCol)
(*Parse)(unsafe.Pointer(pParse)).FnMem = 3
-__164:
+__188:
;
- pTab1 = (*Index)(unsafe.Pointer(pIdx)).FpTable
+ pTab3 = (*Index)(unsafe.Pointer(pIdx)).FpTable
Xsqlite3CodeVerifySchema(tls, pParse, iIdxDb)
i1 = 0
-__165:
+__189:
if !(i1 < mx) {
- goto __167
+ goto __191
}
cnum = *(*I16)(unsafe.Pointer((*Index)(unsafe.Pointer(pIdx)).FaiColumn + uintptr(i1)*2))
- Xsqlite3VdbeMultiLoad(tls, v, 1, ts+16135 /* "iisX" */, libc.VaList(bp+80, i1, int32(cnum),
+ Xsqlite3VdbeMultiLoad(tls, v, 1, ts+17379 /* "iisX" */, libc.VaList(bp+136, i1, int32(cnum),
func() uintptr {
if int32(cnum) < 0 {
return uintptr(0)
}
- return (*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab1)).FaCol + uintptr(cnum)*20)).FzName
+ return (*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab3)).FaCol + uintptr(cnum)*16)).FzCnName
}()))
if !((*PragmaName)(unsafe.Pointer(pPragma)).FiArg != 0) {
- goto __168
+ goto __192
}
- Xsqlite3VdbeMultiLoad(tls, v, 4, ts+16140, /* "isiX" */
- libc.VaList(bp+104, int32(*(*U8)(unsafe.Pointer((*Index)(unsafe.Pointer(pIdx)).FaSortOrder + uintptr(i1)))),
+ Xsqlite3VdbeMultiLoad(tls, v, 4, ts+17384, /* "isiX" */
+ libc.VaList(bp+160, int32(*(*U8)(unsafe.Pointer((*Index)(unsafe.Pointer(pIdx)).FaSortOrder + uintptr(i1)))),
*(*uintptr)(unsafe.Pointer((*Index)(unsafe.Pointer(pIdx)).FazColl + uintptr(i1)*4)),
- (libc.Bool32(i1 < int32((*Index)(unsafe.Pointer(pIdx)).FnKeyCol)))))
-__168:
+ libc.Bool32(i1 < int32((*Index)(unsafe.Pointer(pIdx)).FnKeyCol))))
+__192:
;
Xsqlite3VdbeAddOp2(tls, v, OP_ResultRow, 1, (*Parse)(unsafe.Pointer(pParse)).FnMem)
- goto __166
-__166:
+ goto __190
+__190:
i1++
- goto __165
- goto __167
-__167:
+ goto __189
+ goto __191
+__191:
;
-__162:
+__186:
;
-__159:
+__183:
;
goto __15
-__34:
+__35:
if !(zRight != 0) {
- goto __169
+ goto __193
}
- pTab2 = Xsqlite3FindTable(tls, db, zRight, zDb)
- if !(pTab2 != 0) {
- goto __170
+ pTab4 = Xsqlite3FindTable(tls, db, zRight, zDb)
+ if !(pTab4 != 0) {
+ goto __194
}
- iTabDb = Xsqlite3SchemaToIndex(tls, db, (*Table)(unsafe.Pointer(pTab2)).FpSchema)
+ iTabDb = Xsqlite3SchemaToIndex(tls, db, (*Table)(unsafe.Pointer(pTab4)).FpSchema)
(*Parse)(unsafe.Pointer(pParse)).FnMem = 5
Xsqlite3CodeVerifySchema(tls, pParse, iTabDb)
- pIdx1 = (*Table)(unsafe.Pointer(pTab2)).FpIndex
+ pIdx1 = (*Table)(unsafe.Pointer(pTab4)).FpIndex
i2 = 0
-__171:
+__195:
if !(pIdx1 != 0) {
- goto __173
+ goto __197
}
- *(*[3]uintptr)(unsafe.Pointer(bp + 420 /* azOrigin */)) = [3]uintptr{ts + 16145 /* "c" */, ts + 16147 /* "u" */, ts + 14667 /* "pk" */}
- Xsqlite3VdbeMultiLoad(tls, v, 1, ts+16149, /* "isisi" */
- libc.VaList(bp+128, i2,
+ *(*[3]uintptr)(unsafe.Pointer(bp + 504 /* azOrigin */)) = [3]uintptr{ts + 17389 /* "c" */, ts + 17391 /* "u" */, ts + 15849 /* "pk" */}
+ Xsqlite3VdbeMultiLoad(tls, v, 1, ts+17393, /* "isisi" */
+ libc.VaList(bp+184, i2,
(*Index)(unsafe.Pointer(pIdx1)).FzName,
- (libc.Bool32(int32((*Index)(unsafe.Pointer((pIdx1))).FonError) != OE_None)),
- *(*uintptr)(unsafe.Pointer(bp + 420 /* &azOrigin[0] */ + uintptr((uint32(int32(*(*uint16)(unsafe.Pointer(pIdx1 + 56 /* &.idxType */))&0x3>>0))))*4)),
- (libc.Bool32((*Index)(unsafe.Pointer(pIdx1)).FpPartIdxWhere != uintptr(0)))))
- goto __172
-__172:
+ libc.Bool32(int32((*Index)(unsafe.Pointer(pIdx1)).FonError) != OE_None),
+ *(*uintptr)(unsafe.Pointer(bp + 504 /* &azOrigin[0] */ + uintptr(uint32(int32(*(*uint16)(unsafe.Pointer(pIdx1 + 56))&0x3>>0)))*4)),
+ libc.Bool32((*Index)(unsafe.Pointer(pIdx1)).FpPartIdxWhere != uintptr(0))))
+ goto __196
+__196:
pIdx1 = (*Index)(unsafe.Pointer(pIdx1)).FpNext
i2++
- goto __171
- goto __173
-__173:
+ goto __195
+ goto __197
+__197:
;
-__170:
+__194:
;
-__169:
+__193:
;
goto __15
-__35:
+__36:
(*Parse)(unsafe.Pointer(pParse)).FnMem = 3
i3 = 0
-__174:
+__198:
if !(i3 < (*Sqlite3)(unsafe.Pointer(db)).FnDb) {
- goto __176
+ goto __200
}
if !((*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+uintptr(i3)*16)).FpBt == uintptr(0)) {
- goto __177
+ goto __201
}
- goto __175
-__177:
+ goto __199
+__201:
;
- Xsqlite3VdbeMultiLoad(tls, v, 1, ts+16155, /* "iss" */
- libc.VaList(bp+168, i3,
+ Xsqlite3VdbeMultiLoad(tls, v, 1, ts+17399, /* "iss" */
+ libc.VaList(bp+224, i3,
(*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+uintptr(i3)*16)).FzDbSName,
Xsqlite3BtreeGetFilename(tls, (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+uintptr(i3)*16)).FpBt)))
- goto __175
-__175:
+ goto __199
+__199:
i3++
- goto __174
- goto __176
-__176:
+ goto __198
+ goto __200
+__200:
;
goto __15
-__36:
+__37:
i4 = 0
(*Parse)(unsafe.Pointer(pParse)).FnMem = 2
- p = (*Hash)(unsafe.Pointer((db + 420 /* &.aCollSeq */))).Ffirst
-__178:
+ p = (*Hash)(unsafe.Pointer(db + 444)).Ffirst
+__202:
if !(p != 0) {
- goto __180
+ goto __204
}
pColl = (*HashElem)(unsafe.Pointer(p)).Fdata
- Xsqlite3VdbeMultiLoad(tls, v, 1, ts+16159 /* "is" */, libc.VaList(bp+192, libc.PostIncInt32(&i4, 1), (*CollSeq)(unsafe.Pointer(pColl)).FzName))
- goto __179
-__179:
+ Xsqlite3VdbeMultiLoad(tls, v, 1, ts+17403 /* "is" */, libc.VaList(bp+248, libc.PostIncInt32(&i4, 1), (*CollSeq)(unsafe.Pointer(pColl)).FzName))
+ goto __203
+__203:
p = (*HashElem)(unsafe.Pointer(p)).Fnext
- goto __178
- goto __180
-__180:
+ goto __202
+ goto __204
+__204:
;
goto __15
-__37:
- showInternFunc = (libc.Bool32(((*Sqlite3)(unsafe.Pointer(db)).FmDbFlags & U32(DBFLAG_InternalFunc)) != U32(0)))
+__38:
+ showInternFunc = libc.Bool32((*Sqlite3)(unsafe.Pointer(db)).FmDbFlags&U32(DBFLAG_InternalFunc) != U32(0))
(*Parse)(unsafe.Pointer(pParse)).FnMem = 6
i5 = 0
-__181:
+__205:
if !(i5 < SQLITE_FUNC_HASH_SZ) {
- goto __183
+ goto __207
}
- p1 = *(*uintptr)(unsafe.Pointer((uintptr(unsafe.Pointer(&Xsqlite3BuiltinFunctions)) /* &.a */) + uintptr(i5)*4))
-__184:
+ p1 = *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&Xsqlite3BuiltinFunctions)) + uintptr(i5)*4))
+__208:
if !(p1 != 0) {
- goto __186
+ goto __210
}
+
pragmaFunclistLine(tls, v, p1, 1, showInternFunc)
- goto __185
-__185:
- p1 = *(*uintptr)(unsafe.Pointer(p1 + 36 /* &.u */))
- goto __184
- goto __186
-__186:
+ goto __209
+__209:
+ p1 = *(*uintptr)(unsafe.Pointer(p1 + 36))
+ goto __208
+ goto __210
+__210:
;
- goto __182
-__182:
+ goto __206
+__206:
i5++
- goto __181
- goto __183
-__183:
+ goto __205
+ goto __207
+__207:
;
- j = (*Hash)(unsafe.Pointer((db + 404 /* &.aFunc */))).Ffirst
-__187:
+ j = (*Hash)(unsafe.Pointer(db + 428)).Ffirst
+__211:
if !(j != 0) {
- goto __189
+ goto __213
}
p1 = (*HashElem)(unsafe.Pointer(j)).Fdata
+
pragmaFunclistLine(tls, v, p1, 0, showInternFunc)
- goto __188
-__188:
+ goto __212
+__212:
j = (*HashElem)(unsafe.Pointer(j)).Fnext
- goto __187
- goto __189
-__189:
+ goto __211
+ goto __213
+__213:
;
goto __15
-__38:
+__39:
(*Parse)(unsafe.Pointer(pParse)).FnMem = 1
- j1 = (*Hash)(unsafe.Pointer((db + 376 /* &.aModule */))).Ffirst
-__190:
+ j1 = (*Hash)(unsafe.Pointer(db + 400)).Ffirst
+__214:
if !(j1 != 0) {
- goto __192
+ goto __216
}
pMod = (*HashElem)(unsafe.Pointer(j1)).Fdata
- Xsqlite3VdbeMultiLoad(tls, v, 1, ts+16003 /* "s" */, libc.VaList(bp+208, (*Module)(unsafe.Pointer(pMod)).FzName))
- goto __191
-__191:
+ Xsqlite3VdbeMultiLoad(tls, v, 1, ts+7397 /* "s" */, libc.VaList(bp+264, (*Module)(unsafe.Pointer(pMod)).FzName))
+ goto __215
+__215:
j1 = (*HashElem)(unsafe.Pointer(j1)).Fnext
- goto __190
- goto __192
-__192:
+ goto __214
+ goto __216
+__216:
;
goto __15
-__39:
+__40:
i6 = 0
-__193:
- if !(i6 < (int32(uint32(unsafe.Sizeof(aPragmaName)) / uint32(unsafe.Sizeof(PragmaName{}))))) {
- goto __195
+__217:
+ if !(i6 < int32(uint32(unsafe.Sizeof(aPragmaName))/uint32(unsafe.Sizeof(PragmaName{})))) {
+ goto __219
}
- Xsqlite3VdbeMultiLoad(tls, v, 1, ts+16003 /* "s" */, libc.VaList(bp+216, aPragmaName[i6].FzName))
- goto __194
-__194:
+ Xsqlite3VdbeMultiLoad(tls, v, 1, ts+7397 /* "s" */, libc.VaList(bp+272, aPragmaName[i6].FzName))
+ goto __218
+__218:
i6++
- goto __193
- goto __195
-__195:
+ goto __217
+ goto __219
+__219:
;
goto __15
-__40:
+__41:
if !(zRight != 0) {
- goto __196
+ goto __220
}
- pTab3 = Xsqlite3FindTable(tls, db, zRight, zDb)
- if !(pTab3 != 0) {
- goto __197
+ pTab5 = Xsqlite3FindTable(tls, db, zRight, zDb)
+ if !(pTab5 != 0 && int32((*Table)(unsafe.Pointer(pTab5)).FeTabType) == TABTYP_NORM) {
+ goto __221
}
- pFK = (*Table)(unsafe.Pointer(pTab3)).FpFKey
+ pFK = *(*uintptr)(unsafe.Pointer(pTab5 + 44 + 4 /* &.pFKey */))
if !(pFK != 0) {
- goto __198
+ goto __222
}
- iTabDb1 = Xsqlite3SchemaToIndex(tls, db, (*Table)(unsafe.Pointer(pTab3)).FpSchema)
+ iTabDb1 = Xsqlite3SchemaToIndex(tls, db, (*Table)(unsafe.Pointer(pTab5)).FpSchema)
i7 = 0
(*Parse)(unsafe.Pointer(pParse)).FnMem = 8
Xsqlite3CodeVerifySchema(tls, pParse, iTabDb1)
-__199:
+__223:
if !(pFK != 0) {
- goto __200
+ goto __224
}
j2 = 0
-__201:
+__225:
if !(j2 < (*FKey)(unsafe.Pointer(pFK)).FnCol) {
- goto __203
+ goto __227
}
- Xsqlite3VdbeMultiLoad(tls, v, 1, ts+16162, /* "iissssss" */
- libc.VaList(bp+224, i7,
+ Xsqlite3VdbeMultiLoad(tls, v, 1, ts+17406, /* "iissssss" */
+ libc.VaList(bp+280, i7,
j2,
(*FKey)(unsafe.Pointer(pFK)).FzTo,
- (*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab3)).FaCol+uintptr((*sColMap)(unsafe.Pointer((pFK+36 /* &.aCol */)+uintptr(j2)*8)).FiFrom)*20)).FzName,
- (*sColMap)(unsafe.Pointer((pFK+36 /* &.aCol */)+uintptr(j2)*8)).FzCol,
- actionName(tls, *(*U8)(unsafe.Pointer((pFK + 25 /* &.aAction */) + 1))), // ON UPDATE
- actionName(tls, *(*U8)(unsafe.Pointer((pFK + 25 /* &.aAction */)))), // ON DELETE
- ts+16171 /* "NONE" */))
- goto __202
-__202:
+ (*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab5)).FaCol+uintptr((*sColMap)(unsafe.Pointer(pFK+36+uintptr(j2)*8)).FiFrom)*16)).FzCnName,
+ (*sColMap)(unsafe.Pointer(pFK+36+uintptr(j2)*8)).FzCol,
+ actionName(tls, *(*U8)(unsafe.Pointer(pFK + 25 + 1))), // ON UPDATE
+ actionName(tls, *(*U8)(unsafe.Pointer(pFK + 25))),
+ ts+17415 /* "NONE" */))
+ goto __226
+__226:
j2++
- goto __201
- goto __203
-__203:
+ goto __225
+ goto __227
+__227:
;
i7++
pFK = (*FKey)(unsafe.Pointer(pFK)).FpNextFrom
- goto __199
-__200:
+ goto __223
+__224:
;
-__198:
+__222:
;
-__197:
+__221:
;
-__196:
+__220:
;
goto __15
-__41: // child to parent column mapping
+__42: // child to parent column mapping
- regResult = ((*Parse)(unsafe.Pointer(pParse)).FnMem + 1)
- *(*int32)(unsafe.Pointer(pParse + 44 /* &.nMem */)) += (4)
+ regResult = (*Parse)(unsafe.Pointer(pParse)).FnMem + 1
+ *(*int32)(unsafe.Pointer(pParse + 44)) += 4
regKey = libc.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1)
regRow = libc.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1)
- k1 = (*Hash)(unsafe.Pointer(((*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+uintptr(iDb)*16)).FpSchema + 8 /* &.tblHash */))).Ffirst
-__204:
- if !(k1 != 0) {
- goto __205
+ k2 = (*Hash)(unsafe.Pointer((*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+uintptr(iDb)*16)).FpSchema + 8)).Ffirst
+__228:
+ if !(k2 != 0) {
+ goto __229
}
if !(zRight != 0) {
- goto __206
+ goto __230
}
- pTab4 = Xsqlite3LocateTable(tls, pParse, uint32(0), zRight, zDb)
- k1 = uintptr(0)
- goto __207
-__206:
- pTab4 = (*HashElem)(unsafe.Pointer(k1)).Fdata
- k1 = (*HashElem)(unsafe.Pointer(k1)).Fnext
-__207:
+ pTab6 = Xsqlite3LocateTable(tls, pParse, uint32(0), zRight, zDb)
+ k2 = uintptr(0)
+ goto __231
+__230:
+ pTab6 = (*HashElem)(unsafe.Pointer(k2)).Fdata
+ k2 = (*HashElem)(unsafe.Pointer(k2)).Fnext
+__231:
;
- if !((pTab4 == uintptr(0)) || ((*Table)(unsafe.Pointer(pTab4)).FpFKey == uintptr(0))) {
- goto __208
+ if !(pTab6 == uintptr(0) || !(int32((*Table)(unsafe.Pointer(pTab6)).FeTabType) == TABTYP_NORM) || *(*uintptr)(unsafe.Pointer(pTab6 + 44 + 4)) == uintptr(0)) {
+ goto __232
}
- goto __204
-__208:
+ goto __228
+__232:
;
- iDb = Xsqlite3SchemaToIndex(tls, db, (*Table)(unsafe.Pointer(pTab4)).FpSchema)
+ iDb = Xsqlite3SchemaToIndex(tls, db, (*Table)(unsafe.Pointer(pTab6)).FpSchema)
zDb = (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*16)).FzDbSName
Xsqlite3CodeVerifySchema(tls, pParse, iDb)
- Xsqlite3TableLock(tls, pParse, iDb, (*Table)(unsafe.Pointer(pTab4)).Ftnum, uint8(0), (*Table)(unsafe.Pointer(pTab4)).FzName)
- if !((int32((*Table)(unsafe.Pointer(pTab4)).FnCol) + regRow) > (*Parse)(unsafe.Pointer(pParse)).FnMem) {
- goto __209
+ Xsqlite3TableLock(tls, pParse, iDb, (*Table)(unsafe.Pointer(pTab6)).Ftnum, uint8(0), (*Table)(unsafe.Pointer(pTab6)).FzName)
+ if !(int32((*Table)(unsafe.Pointer(pTab6)).FnCol)+regRow > (*Parse)(unsafe.Pointer(pParse)).FnMem) {
+ goto __233
}
- (*Parse)(unsafe.Pointer(pParse)).FnMem = (int32((*Table)(unsafe.Pointer(pTab4)).FnCol) + regRow)
-__209:
+ (*Parse)(unsafe.Pointer(pParse)).FnMem = int32((*Table)(unsafe.Pointer(pTab6)).FnCol) + regRow
+__233:
;
- Xsqlite3OpenTable(tls, pParse, 0, iDb, pTab4, OP_OpenRead)
- Xsqlite3VdbeLoadString(tls, v, regResult, (*Table)(unsafe.Pointer(pTab4)).FzName)
+ Xsqlite3OpenTable(tls, pParse, 0, iDb, pTab6, OP_OpenRead)
+ Xsqlite3VdbeLoadString(tls, v, regResult, (*Table)(unsafe.Pointer(pTab6)).FzName)
+
i8 = 1
- pFK1 = (*Table)(unsafe.Pointer(pTab4)).FpFKey
-__210:
+ pFK1 = *(*uintptr)(unsafe.Pointer(pTab6 + 44 + 4 /* &.pFKey */))
+__234:
if !(pFK1 != 0) {
- goto __212
+ goto __236
}
pParent = Xsqlite3FindTable(tls, db, (*FKey)(unsafe.Pointer(pFK1)).FzTo, zDb)
if !(pParent == uintptr(0)) {
- goto __213
+ goto __237
}
- goto __211
-__213:
+ goto __235
+__237:
;
- *(*uintptr)(unsafe.Pointer(bp + 432 /* pIdx2 */)) = uintptr(0)
+ *(*uintptr)(unsafe.Pointer(bp + 516 /* pIdx2 */)) = uintptr(0)
Xsqlite3TableLock(tls, pParse, iDb, (*Table)(unsafe.Pointer(pParent)).Ftnum, uint8(0), (*Table)(unsafe.Pointer(pParent)).FzName)
- x1 = Xsqlite3FkLocateIndex(tls, pParse, pParent, pFK1, bp+432 /* &pIdx2 */, uintptr(0))
+ x1 = Xsqlite3FkLocateIndex(tls, pParse, pParent, pFK1, bp+516 /* &pIdx2 */, uintptr(0))
if !(x1 == 0) {
- goto __214
+ goto __238
}
- if !(*(*uintptr)(unsafe.Pointer(bp + 432 /* pIdx2 */)) == uintptr(0)) {
- goto __216
+ if !(*(*uintptr)(unsafe.Pointer(bp + 516)) == uintptr(0)) {
+ goto __240
}
Xsqlite3OpenTable(tls, pParse, i8, iDb, pParent, OP_OpenRead)
- goto __217
-__216:
- Xsqlite3VdbeAddOp3(tls, v, OP_OpenRead, i8, int32((*Index)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 432 /* pIdx2 */)))).Ftnum), iDb)
- Xsqlite3VdbeSetP4KeyInfo(tls, pParse, *(*uintptr)(unsafe.Pointer(bp + 432 /* pIdx2 */)))
-__217:
+ goto __241
+__240:
+ Xsqlite3VdbeAddOp3(tls, v, OP_OpenRead, i8, int32((*Index)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 516 /* pIdx2 */)))).Ftnum), iDb)
+ Xsqlite3VdbeSetP4KeyInfo(tls, pParse, *(*uintptr)(unsafe.Pointer(bp + 516 /* pIdx2 */)))
+__241:
;
- goto __215
-__214:
- k1 = uintptr(0)
- goto __212
-__215:
+ goto __239
+__238:
+ k2 = uintptr(0)
+ goto __236
+__239:
;
- goto __211
-__211:
+ goto __235
+__235:
i8++
pFK1 = (*FKey)(unsafe.Pointer(pFK1)).FpNextFrom
- goto __210
- goto __212
-__212:
+ goto __234
+ goto __236
+__236:
;
if !(pFK1 != 0) {
- goto __218
+ goto __242
}
- goto __205
-__218:
+ goto __229
+__242:
;
if !((*Parse)(unsafe.Pointer(pParse)).FnTab < i8) {
- goto __219
+ goto __243
}
(*Parse)(unsafe.Pointer(pParse)).FnTab = i8
-__219:
+__243:
;
addrTop = Xsqlite3VdbeAddOp1(tls, v, OP_Rewind, 0)
+
i8 = 1
- pFK1 = (*Table)(unsafe.Pointer(pTab4)).FpFKey
-__220:
+ pFK1 = *(*uintptr)(unsafe.Pointer(pTab6 + 44 + 4 /* &.pFKey */))
+__244:
if !(pFK1 != 0) {
- goto __222
+ goto __246
}
pParent = Xsqlite3FindTable(tls, db, (*FKey)(unsafe.Pointer(pFK1)).FzTo, zDb)
- *(*uintptr)(unsafe.Pointer(bp + 432 /* pIdx2 */)) = uintptr(0)
- *(*uintptr)(unsafe.Pointer(bp + 436 /* aiCols */)) = uintptr(0)
+ *(*uintptr)(unsafe.Pointer(bp + 516 /* pIdx2 */)) = uintptr(0)
+ *(*uintptr)(unsafe.Pointer(bp + 520 /* aiCols */)) = uintptr(0)
if !(pParent != 0) {
- goto __223
+ goto __247
}
- x1 = Xsqlite3FkLocateIndex(tls, pParse, pParent, pFK1, bp+432 /* &pIdx2 */, bp+436 /* &aiCols */)
+ x1 = Xsqlite3FkLocateIndex(tls, pParse, pParent, pFK1, bp+516 /* &pIdx2 */, bp+520 /* &aiCols */)
-__223:
+__247:
;
addrOk = Xsqlite3VdbeMakeLabel(tls, pParse)
@@ -110557,87 +112311,93 @@ __223:
// regRow..regRow+n. If any of the child key values are NULL, this
// row cannot cause an FK violation. Jump directly to addrOk in
// this case.
+ if !(regRow+(*FKey)(unsafe.Pointer(pFK1)).FnCol > (*Parse)(unsafe.Pointer(pParse)).FnMem) {
+ goto __248
+ }
+ (*Parse)(unsafe.Pointer(pParse)).FnMem = regRow + (*FKey)(unsafe.Pointer(pFK1)).FnCol
+__248:
+ ;
j3 = 0
-__224:
+__249:
if !(j3 < (*FKey)(unsafe.Pointer(pFK1)).FnCol) {
- goto __226
+ goto __251
}
- if *(*uintptr)(unsafe.Pointer(bp + 436 /* aiCols */)) != 0 {
- iCol = *(*int32)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 436 /* aiCols */)) + uintptr(j3)*4))
+ if *(*uintptr)(unsafe.Pointer(bp + 520)) != 0 {
+ iCol = *(*int32)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 520 /* aiCols */)) + uintptr(j3)*4))
} else {
- iCol = (*sColMap)(unsafe.Pointer((pFK1 + 36 /* &.aCol */) + uintptr(j3)*8)).FiFrom
+ iCol = (*sColMap)(unsafe.Pointer(pFK1 + 36 + uintptr(j3)*8)).FiFrom
}
- Xsqlite3ExprCodeGetColumnOfTable(tls, v, pTab4, 0, iCol, (regRow + j3))
- Xsqlite3VdbeAddOp2(tls, v, OP_IsNull, (regRow + j3), addrOk)
- goto __225
-__225:
+ Xsqlite3ExprCodeGetColumnOfTable(tls, v, pTab6, 0, iCol, regRow+j3)
+ Xsqlite3VdbeAddOp2(tls, v, OP_IsNull, regRow+j3, addrOk)
+ goto __250
+__250:
j3++
- goto __224
- goto __226
-__226:
+ goto __249
+ goto __251
+__251:
;
// Generate code to query the parent index for a matching parent
// key. If a match is found, jump to addrOk.
- if !(*(*uintptr)(unsafe.Pointer(bp + 432 /* pIdx2 */)) != 0) {
- goto __227
+ if !(*(*uintptr)(unsafe.Pointer(bp + 516)) != 0) {
+ goto __252
}
Xsqlite3VdbeAddOp4(tls, v, OP_MakeRecord, regRow, (*FKey)(unsafe.Pointer(pFK1)).FnCol, regKey,
- Xsqlite3IndexAffinityStr(tls, db, *(*uintptr)(unsafe.Pointer(bp + 432 /* pIdx2 */))), (*FKey)(unsafe.Pointer(pFK1)).FnCol)
+ Xsqlite3IndexAffinityStr(tls, db, *(*uintptr)(unsafe.Pointer(bp + 516 /* pIdx2 */))), (*FKey)(unsafe.Pointer(pFK1)).FnCol)
Xsqlite3VdbeAddOp4Int(tls, v, OP_Found, i8, addrOk, regKey, 0)
- goto __228
-__227:
+ goto __253
+__252:
if !(pParent != 0) {
- goto __229
+ goto __254
}
- jmp = (Xsqlite3VdbeCurrentAddr(tls, v) + 2)
+ jmp = Xsqlite3VdbeCurrentAddr(tls, v) + 2
Xsqlite3VdbeAddOp3(tls, v, OP_SeekRowid, i8, jmp, regRow)
Xsqlite3VdbeGoto(tls, v, addrOk)
-__229:
+__254:
;
-__228:
+__253:
;
// Generate code to report an FK violation to the caller.
- if !(((*Table)(unsafe.Pointer((pTab4))).FtabFlags & U32(TF_WithoutRowid)) == U32(0)) {
- goto __230
+ if !((*Table)(unsafe.Pointer(pTab6)).FtabFlags&U32(TF_WithoutRowid) == U32(0)) {
+ goto __255
}
- Xsqlite3VdbeAddOp2(tls, v, OP_Rowid, 0, (regResult + 1))
- goto __231
-__230:
- Xsqlite3VdbeAddOp2(tls, v, OP_Null, 0, (regResult + 1))
-__231:
+ Xsqlite3VdbeAddOp2(tls, v, OP_Rowid, 0, regResult+1)
+ goto __256
+__255:
+ Xsqlite3VdbeAddOp2(tls, v, OP_Null, 0, regResult+1)
+__256:
;
- Xsqlite3VdbeMultiLoad(tls, v, (regResult + 2), ts+16176 /* "siX" */, libc.VaList(bp+288, (*FKey)(unsafe.Pointer(pFK1)).FzTo, (i8-1)))
+ Xsqlite3VdbeMultiLoad(tls, v, regResult+2, ts+17420 /* "siX" */, libc.VaList(bp+344, (*FKey)(unsafe.Pointer(pFK1)).FzTo, i8-1))
Xsqlite3VdbeAddOp2(tls, v, OP_ResultRow, regResult, 4)
Xsqlite3VdbeResolveLabel(tls, v, addrOk)
- Xsqlite3DbFree(tls, db, *(*uintptr)(unsafe.Pointer(bp + 436 /* aiCols */)))
- goto __221
-__221:
+ Xsqlite3DbFree(tls, db, *(*uintptr)(unsafe.Pointer(bp + 520 /* aiCols */)))
+ goto __245
+__245:
i8++
pFK1 = (*FKey)(unsafe.Pointer(pFK1)).FpNextFrom
- goto __220
- goto __222
-__222:
+ goto __244
+ goto __246
+__246:
;
- Xsqlite3VdbeAddOp2(tls, v, OP_Next, 0, (addrTop + 1))
+ Xsqlite3VdbeAddOp2(tls, v, OP_Next, 0, addrTop+1)
Xsqlite3VdbeJumpHere(tls, v, addrTop)
- goto __204
-__205:
+ goto __228
+__229:
;
goto __15
// Reinstall the LIKE and GLOB functions. The variant of LIKE
// used will be case sensitive or not depending on the RHS.
-__42:
+__43:
if !(zRight != 0) {
- goto __232
+ goto __257
}
Xsqlite3RegisterLikeFunctions(tls, db, int32(Xsqlite3GetBoolean(tls, zRight, uint8(0))))
-__232:
+__257:
;
goto __15
@@ -110665,10 +112425,10 @@ __232:
// schema, use the form:
//
// PRAGMA schema.integrity_check;
-__43:
+__44:
pObjTab = uintptr(0) // Check only this one table, if not NULL
- isQuick = (libc.Bool32((int32(Xsqlite3UpperToLower[uint8(*(*uint8)(unsafe.Pointer(zLeft)))])) == 'q'))
+ isQuick = libc.Bool32(int32(Xsqlite3UpperToLower[uint8(*(*uint8)(unsafe.Pointer(zLeft)))]) == 'q')
// If the PRAGMA command was of the form "PRAGMA <db>.integrity_check",
// then iDb is set to the index of the database identified by <db>.
@@ -110681,31 +112441,31 @@ __43:
// of all attached databases.
if !((*Token)(unsafe.Pointer(pId2)).Fz == uintptr(0)) {
- goto __233
+ goto __258
}
iDb = -1
-__233:
+__258:
;
// Initialize the VDBE program
(*Parse)(unsafe.Pointer(pParse)).FnMem = 6
// Set the maximum error count
- *(*int32)(unsafe.Pointer(bp + 440 /* mxErr */)) = SQLITE_INTEGRITY_CHECK_ERROR_MAX
+ *(*int32)(unsafe.Pointer(bp + 524 /* mxErr */)) = SQLITE_INTEGRITY_CHECK_ERROR_MAX
if !(zRight != 0) {
- goto __234
+ goto __259
}
- if !(Xsqlite3GetInt32(tls, zRight, bp+440 /* &mxErr */) != 0) {
- goto __235
+ if !(Xsqlite3GetInt32(tls, zRight, bp+524) != 0) {
+ goto __260
}
- if !(*(*int32)(unsafe.Pointer(bp + 440 /* mxErr */)) <= 0) {
- goto __237
+ if !(*(*int32)(unsafe.Pointer(bp + 524)) <= 0) {
+ goto __262
}
- *(*int32)(unsafe.Pointer(bp + 440 /* mxErr */)) = SQLITE_INTEGRITY_CHECK_ERROR_MAX
-__237:
+ *(*int32)(unsafe.Pointer(bp + 524 /* mxErr */)) = SQLITE_INTEGRITY_CHECK_ERROR_MAX
+__262:
;
- goto __236
-__235:
+ goto __261
+__260:
pObjTab = Xsqlite3LocateTable(tls, pParse, uint32(0), zRight,
func() uintptr {
if iDb >= 0 {
@@ -110713,32 +112473,32 @@ __235:
}
return uintptr(0)
}())
-__236:
+__261:
;
-__234:
+__259:
;
- Xsqlite3VdbeAddOp2(tls, v, OP_Integer, (*(*int32)(unsafe.Pointer(bp + 440 /* mxErr */)) - 1), 1) // reg[1] holds errors left
+ Xsqlite3VdbeAddOp2(tls, v, OP_Integer, *(*int32)(unsafe.Pointer(bp + 524))-1, 1) // reg[1] holds errors left
// Do an integrity check on each database file
i9 = 0
-__238:
+__263:
if !(i9 < (*Sqlite3)(unsafe.Pointer(db)).FnDb) {
- goto __240
+ goto __265
} // Array of root page numbers of all btrees
cnt = 0 // Number of entries in aRoot[]
mxIdx = 0 // Maximum number of indexes for any table
- if !((0 != 0) && (i9 == 1)) {
- goto __241
+ if !(0 != 0 && i9 == 1) {
+ goto __266
}
- goto __239
-__241:
+ goto __264
+__266:
;
- if !((iDb >= 0) && (i9 != iDb)) {
- goto __242
+ if !(iDb >= 0 && i9 != iDb) {
+ goto __267
}
- goto __239
-__242:
+ goto __264
+__267:
;
Xsqlite3CodeVerifySchema(tls, pParse, i9)
@@ -110748,126 +112508,126 @@ __242:
// Begin by finding the root pages numbers
// for all tables and indices in the database.
- pTbls = ((*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+uintptr(i9)*16)).FpSchema + 8 /* &.tblHash */)
+ pTbls = (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+uintptr(i9)*16)).FpSchema + 8
cnt = 0
x2 = (*Hash)(unsafe.Pointer(pTbls)).Ffirst
-__243:
+__268:
if !(x2 != 0) {
- goto __245
+ goto __270
}
- pTab5 = (*HashElem)(unsafe.Pointer(x2)).Fdata // Number of indexes on pTab
- if !((pObjTab != 0) && (pObjTab != pTab5)) {
- goto __246
+ pTab7 = (*HashElem)(unsafe.Pointer(x2)).Fdata // Number of indexes on pTab
+ if !(pObjTab != 0 && pObjTab != pTab7) {
+ goto __271
}
- goto __244
-__246:
+ goto __269
+__271:
;
- if !(((*Table)(unsafe.Pointer((pTab5))).FtabFlags & U32(TF_WithoutRowid)) == U32(0)) {
- goto __247
+ if !((*Table)(unsafe.Pointer(pTab7)).FtabFlags&U32(TF_WithoutRowid) == U32(0)) {
+ goto __272
}
cnt++
-__247:
+__272:
;
nIdx = 0
- pIdx3 = (*Table)(unsafe.Pointer(pTab5)).FpIndex
-__248:
+ pIdx3 = (*Table)(unsafe.Pointer(pTab7)).FpIndex
+__273:
if !(pIdx3 != 0) {
- goto __250
+ goto __275
}
cnt++
- goto __249
-__249:
+ goto __274
+__274:
pIdx3 = (*Index)(unsafe.Pointer(pIdx3)).FpNext
nIdx++
- goto __248
- goto __250
-__250:
+ goto __273
+ goto __275
+__275:
;
if !(nIdx > mxIdx) {
- goto __251
+ goto __276
}
mxIdx = nIdx
-__251:
+__276:
;
- goto __244
-__244:
+ goto __269
+__269:
x2 = (*HashElem)(unsafe.Pointer(x2)).Fnext
- goto __243
- goto __245
-__245:
+ goto __268
+ goto __270
+__270:
;
if !(cnt == 0) {
- goto __252
+ goto __277
}
- goto __239
-__252:
+ goto __264
+__277:
;
if !(pObjTab != 0) {
- goto __253
+ goto __278
}
cnt++
-__253:
+__278:
;
- aRoot = Xsqlite3DbMallocRawNN(tls, db, (uint64(uint32(unsafe.Sizeof(int32(0))) * (uint32(cnt + 1)))))
+ aRoot = Xsqlite3DbMallocRawNN(tls, db, uint64(uint32(unsafe.Sizeof(int32(0)))*uint32(cnt+1)))
if !(aRoot == uintptr(0)) {
- goto __254
+ goto __279
}
- goto __240
-__254:
+ goto __265
+__279:
;
cnt = 0
if !(pObjTab != 0) {
- goto __255
+ goto __280
}
*(*int32)(unsafe.Pointer(aRoot + uintptr(libc.PreIncInt32(&cnt, 1))*4)) = 0
-__255:
+__280:
;
x2 = (*Hash)(unsafe.Pointer(pTbls)).Ffirst
-__256:
+__281:
if !(x2 != 0) {
- goto __258
+ goto __283
}
- pTab6 = (*HashElem)(unsafe.Pointer(x2)).Fdata
- if !((pObjTab != 0) && (pObjTab != pTab6)) {
- goto __259
+ pTab8 = (*HashElem)(unsafe.Pointer(x2)).Fdata
+ if !(pObjTab != 0 && pObjTab != pTab8) {
+ goto __284
}
- goto __257
-__259:
+ goto __282
+__284:
;
- if !(((*Table)(unsafe.Pointer((pTab6))).FtabFlags & U32(TF_WithoutRowid)) == U32(0)) {
- goto __260
+ if !((*Table)(unsafe.Pointer(pTab8)).FtabFlags&U32(TF_WithoutRowid) == U32(0)) {
+ goto __285
}
- *(*int32)(unsafe.Pointer(aRoot + uintptr(libc.PreIncInt32(&cnt, 1))*4)) = int32((*Table)(unsafe.Pointer(pTab6)).Ftnum)
-__260:
+ *(*int32)(unsafe.Pointer(aRoot + uintptr(libc.PreIncInt32(&cnt, 1))*4)) = int32((*Table)(unsafe.Pointer(pTab8)).Ftnum)
+__285:
;
- pIdx4 = (*Table)(unsafe.Pointer(pTab6)).FpIndex
-__261:
+ pIdx4 = (*Table)(unsafe.Pointer(pTab8)).FpIndex
+__286:
if !(pIdx4 != 0) {
- goto __263
+ goto __288
}
*(*int32)(unsafe.Pointer(aRoot + uintptr(libc.PreIncInt32(&cnt, 1))*4)) = int32((*Index)(unsafe.Pointer(pIdx4)).Ftnum)
- goto __262
-__262:
+ goto __287
+__287:
pIdx4 = (*Index)(unsafe.Pointer(pIdx4)).FpNext
- goto __261
- goto __263
-__263:
+ goto __286
+ goto __288
+__288:
;
- goto __257
-__257:
+ goto __282
+__282:
x2 = (*HashElem)(unsafe.Pointer(x2)).Fnext
- goto __256
- goto __258
-__258:
+ goto __281
+ goto __283
+__283:
;
*(*int32)(unsafe.Pointer(aRoot)) = cnt
// Make sure sufficient number of registers have been allocated
(*Parse)(unsafe.Pointer(pParse)).FnMem = func() int32 {
- if ((*Parse)(unsafe.Pointer(pParse)).FnMem) > (8 + mxIdx) {
+ if (*Parse)(unsafe.Pointer(pParse)).FnMem > 8+mxIdx {
return (*Parse)(unsafe.Pointer(pParse)).FnMem
}
- return (8 + mxIdx)
+ return 8 + mxIdx
}()
Xsqlite3ClearTempRegCache(tls, pParse)
@@ -110876,7 +112636,7 @@ __258:
Xsqlite3VdbeChangeP5(tls, v, uint16(U8(i9)))
addr1 = Xsqlite3VdbeAddOp1(tls, v, OP_IsNull, 2)
Xsqlite3VdbeAddOp4(tls, v, OP_String8, 0, 3, 0,
- Xsqlite3MPrintf(tls, db, ts+16180 /* "*** in database ..." */, libc.VaList(bp+304, (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+uintptr(i9)*16)).FzDbSName)),
+ Xsqlite3MPrintf(tls, db, ts+17424 /* "*** in database ..." */, libc.VaList(bp+360, (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+uintptr(i9)*16)).FzDbSName)),
-7)
Xsqlite3VdbeAddOp3(tls, v, OP_Concat, 2, 3, 3)
integrityCheckResultRow(tls, v)
@@ -110884,165 +112644,203 @@ __258:
// Make sure all the indices are constructed correctly.
x2 = (*Hash)(unsafe.Pointer(pTbls)).Ffirst
-__264:
+__289:
if !(x2 != 0) {
- goto __266
+ goto __291
}
- pTab7 = (*HashElem)(unsafe.Pointer(x2)).Fdata
+ pTab9 = (*HashElem)(unsafe.Pointer(x2)).Fdata
pPrior = uintptr(0)
r1 = -1
- if !((*Table)(unsafe.Pointer(pTab7)).Ftnum < Pgno(1)) {
- goto __267
+ if !!(int32((*Table)(unsafe.Pointer(pTab9)).FeTabType) == TABTYP_NORM) {
+ goto __292
}
- goto __265
-__267:
- ; // Skip VIEWs or VIRTUAL TABLEs
- if !((pObjTab != 0) && (pObjTab != pTab7)) {
- goto __268
+ goto __290
+__292:
+ ;
+ if !(pObjTab != 0 && pObjTab != pTab9) {
+ goto __293
}
- goto __265
-__268:
+ goto __290
+__293:
;
- if ((*Table)(unsafe.Pointer((pTab7))).FtabFlags & U32(TF_WithoutRowid)) == U32(0) {
+ if (*Table)(unsafe.Pointer(pTab9)).FtabFlags&U32(TF_WithoutRowid) == U32(0) {
pPk1 = uintptr(0)
} else {
- pPk1 = Xsqlite3PrimaryKeyIndex(tls, pTab7)
+ pPk1 = Xsqlite3PrimaryKeyIndex(tls, pTab9)
}
- Xsqlite3OpenTableAndIndices(tls, pParse, pTab7, OP_OpenRead, uint8(0),
- 1, uintptr(0), bp+444 /* &iDataCur */, bp+448 /* &iIdxCur */)
+ Xsqlite3OpenTableAndIndices(tls, pParse, pTab9, OP_OpenRead, uint8(0),
+ 1, uintptr(0), bp+528 /* &iDataCur */, bp+532 /* &iIdxCur */)
// reg[7] counts the number of entries in the table.
// reg[8+i] counts the number of entries in the i-th index
Xsqlite3VdbeAddOp2(tls, v, OP_Integer, 0, 7)
j4 = 0
- pIdx5 = (*Table)(unsafe.Pointer(pTab7)).FpIndex
-__269:
+ pIdx5 = (*Table)(unsafe.Pointer(pTab9)).FpIndex
+__294:
if !(pIdx5 != 0) {
- goto __271
+ goto __296
}
- Xsqlite3VdbeAddOp2(tls, v, OP_Integer, 0, (8 + j4)) // index entries counter
- goto __270
-__270:
+ Xsqlite3VdbeAddOp2(tls, v, OP_Integer, 0, 8+j4) // index entries counter
+ goto __295
+__295:
pIdx5 = (*Index)(unsafe.Pointer(pIdx5)).FpNext
j4++
- goto __269
- goto __271
-__271:
+ goto __294
+ goto __296
+__296:
;
- Xsqlite3VdbeAddOp2(tls, v, OP_Rewind, *(*int32)(unsafe.Pointer(bp + 444 /* iDataCur */)), 0)
+ Xsqlite3VdbeAddOp2(tls, v, OP_Rewind, *(*int32)(unsafe.Pointer(bp + 528 /* iDataCur */)), 0)
loopTop = Xsqlite3VdbeAddOp2(tls, v, OP_AddImm, 7, 1)
- if !(!(isQuick != 0)) {
- goto __272
+ if !!(isQuick != 0) {
+ goto __297
}
// Sanity check on record header decoding
- Xsqlite3VdbeAddOp3(tls, v, OP_Column, *(*int32)(unsafe.Pointer(bp + 444 /* iDataCur */)), (int32((*Table)(unsafe.Pointer(pTab7)).FnNVCol) - 1), 3)
+ Xsqlite3VdbeAddOp3(tls, v, OP_Column, *(*int32)(unsafe.Pointer(bp + 528 /* iDataCur */)), int32((*Table)(unsafe.Pointer(pTab9)).FnNVCol)-1, 3)
Xsqlite3VdbeChangeP5(tls, v, uint16(OPFLAG_TYPEOFARG))
-__272:
+
+__297:
;
- // Verify that all NOT NULL columns really are NOT NULL
+ // Verify that all NOT NULL columns really are NOT NULL. At the
+ // same time verify the type of the content of STRICT tables
+ bStrict = libc.Bool32((*Table)(unsafe.Pointer(pTab9)).FtabFlags&U32(TF_Strict) != U32(0))
j4 = 0
-__273:
- if !(j4 < int32((*Table)(unsafe.Pointer(pTab7)).FnCol)) {
- goto __275
+__298:
+ if !(j4 < int32((*Table)(unsafe.Pointer(pTab9)).FnCol)) {
+ goto __300
}
- if !(j4 == int32((*Table)(unsafe.Pointer(pTab7)).FiPKey)) {
- goto __276
+ pCol1 = (*Table)(unsafe.Pointer(pTab9)).FaCol + uintptr(j4)*16
+ if !(j4 == int32((*Table)(unsafe.Pointer(pTab9)).FiPKey)) {
+ goto __301
}
- goto __274
-__276:
+ goto __299
+__301:
;
- if !(int32((*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab7)).FaCol+uintptr(j4)*20)).FnotNull) == 0) {
- goto __277
+ if !(int32(*(*uint8)(unsafe.Pointer(pCol1 + 4))&0xf>>0) == 0 && !(bStrict != 0)) {
+ goto __302
}
- goto __274
-__277:
+ goto __299
+__302:
;
- Xsqlite3ExprCodeGetColumnOfTable(tls, v, pTab7, *(*int32)(unsafe.Pointer(bp + 444 /* iDataCur */)), j4, 3)
+ if bStrict != 0 {
+ doError = Xsqlite3VdbeMakeLabel(tls, pParse)
+ } else {
+ doError = 0
+ }
+ Xsqlite3ExprCodeGetColumnOfTable(tls, v, pTab9, *(*int32)(unsafe.Pointer(bp + 528 /* iDataCur */)), j4, 3)
if !(int32((*VdbeOp)(unsafe.Pointer(Xsqlite3VdbeGetOp(tls, v, -1))).Fopcode) == OP_Column) {
- goto __278
+ goto __303
}
Xsqlite3VdbeChangeP5(tls, v, uint16(OPFLAG_TYPEOFARG))
-__278:
+__303:
;
+ if !(uint32(int32(*(*uint8)(unsafe.Pointer(pCol1 + 4))&0xf>>0)) != 0) {
+ goto __304
+ }
jmp2 = Xsqlite3VdbeAddOp1(tls, v, OP_NotNull, 3)
- zErr = Xsqlite3MPrintf(tls, db, ts+16204 /* "NULL value in %s..." */, libc.VaList(bp+312, (*Table)(unsafe.Pointer(pTab7)).FzName,
- (*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab7)).FaCol+uintptr(j4)*20)).FzName))
+ zErr = Xsqlite3MPrintf(tls, db, ts+17448 /* "NULL value in %s..." */, libc.VaList(bp+368, (*Table)(unsafe.Pointer(pTab9)).FzName,
+ (*Column)(unsafe.Pointer(pCol1)).FzCnName))
+ Xsqlite3VdbeAddOp4(tls, v, OP_String8, 0, 3, 0, zErr, -7)
+ if !(bStrict != 0 && int32(*(*uint8)(unsafe.Pointer(pCol1 + 4))&0xf0>>4) != COLTYPE_ANY) {
+ goto __305
+ }
+ Xsqlite3VdbeGoto(tls, v, doError)
+ goto __306
+__305:
+ integrityCheckResultRow(tls, v)
+__306:
+ ;
+ Xsqlite3VdbeJumpHere(tls, v, jmp2)
+__304:
+ ;
+ if !((*Table)(unsafe.Pointer(pTab9)).FtabFlags&U32(TF_Strict) != U32(0) &&
+ int32(*(*uint8)(unsafe.Pointer(pCol1 + 4))&0xf0>>4) != COLTYPE_ANY) {
+ goto __307
+ }
+ jmp2 = Xsqlite3VdbeAddOp3(tls, v, OP_IsNullOrType, 3, 0,
+ int32(Xsqlite3StdTypeMap[(int32(*(*uint8)(unsafe.Pointer(pCol1 + 4))&0xf0>>4)-1)&0xf<<28>>28]))
+
+ zErr = Xsqlite3MPrintf(tls, db, ts+17468, /* "non-%s value in ..." */
+ libc.VaList(bp+384, Xsqlite3StdType[(int32(*(*uint8)(unsafe.Pointer(pCol1 + 4))&0xf0>>4)-1)&0xf<<28>>28],
+ (*Table)(unsafe.Pointer(pTab9)).FzName, (*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab9)).FaCol+uintptr(j4)*16)).FzCnName))
Xsqlite3VdbeAddOp4(tls, v, OP_String8, 0, 3, 0, zErr, -7)
+ Xsqlite3VdbeResolveLabel(tls, v, doError)
integrityCheckResultRow(tls, v)
Xsqlite3VdbeJumpHere(tls, v, jmp2)
- goto __274
-__274:
+__307:
+ ;
+ goto __299
+__299:
j4++
- goto __273
- goto __275
-__275:
+ goto __298
+ goto __300
+__300:
;
// Verify CHECK constraints
- if !(((*Table)(unsafe.Pointer(pTab7)).FpCheck != 0) && (((*Sqlite3)(unsafe.Pointer(db)).Fflags & uint64(SQLITE_IgnoreChecks)) == uint64(0))) {
- goto __279
+ if !((*Table)(unsafe.Pointer(pTab9)).FpCheck != 0 && (*Sqlite3)(unsafe.Pointer(db)).Fflags&uint64(SQLITE_IgnoreChecks) == uint64(0)) {
+ goto __308
}
- pCheck = Xsqlite3ExprListDup(tls, db, (*Table)(unsafe.Pointer(pTab7)).FpCheck, 0)
+ pCheck = Xsqlite3ExprListDup(tls, db, (*Table)(unsafe.Pointer(pTab9)).FpCheck, 0)
if !(int32((*Sqlite3)(unsafe.Pointer(db)).FmallocFailed) == 0) {
- goto __280
+ goto __309
}
addrCkFault = Xsqlite3VdbeMakeLabel(tls, pParse)
addrCkOk = Xsqlite3VdbeMakeLabel(tls, pParse)
- (*Parse)(unsafe.Pointer(pParse)).FiSelfTab = (*(*int32)(unsafe.Pointer(bp + 444 /* iDataCur */)) + 1)
- k2 = ((*ExprList)(unsafe.Pointer(pCheck)).FnExpr - 1)
-__281:
- if !(k2 > 0) {
- goto __283
+ (*Parse)(unsafe.Pointer(pParse)).FiSelfTab = *(*int32)(unsafe.Pointer(bp + 528)) + 1
+ k3 = (*ExprList)(unsafe.Pointer(pCheck)).FnExpr - 1
+__310:
+ if !(k3 > 0) {
+ goto __312
}
- Xsqlite3ExprIfFalse(tls, pParse, (*ExprList_item)(unsafe.Pointer((pCheck+8 /* &.a */)+uintptr(k2)*20)).FpExpr, addrCkFault, 0)
- goto __282
-__282:
- k2--
- goto __281
- goto __283
-__283:
+ Xsqlite3ExprIfFalse(tls, pParse, (*ExprList_item)(unsafe.Pointer(pCheck+8+uintptr(k3)*20)).FpExpr, addrCkFault, 0)
+ goto __311
+__311:
+ k3--
+ goto __310
+ goto __312
+__312:
;
- Xsqlite3ExprIfTrue(tls, pParse, (*ExprList_item)(unsafe.Pointer((pCheck + 8 /* &.a */))).FpExpr, addrCkOk,
+ Xsqlite3ExprIfTrue(tls, pParse, (*ExprList_item)(unsafe.Pointer(pCheck+8)).FpExpr, addrCkOk,
SQLITE_JUMPIFNULL)
Xsqlite3VdbeResolveLabel(tls, v, addrCkFault)
(*Parse)(unsafe.Pointer(pParse)).FiSelfTab = 0
- zErr1 = Xsqlite3MPrintf(tls, db, ts+16224, /* "CHECK constraint..." */
- libc.VaList(bp+328, (*Table)(unsafe.Pointer(pTab7)).FzName))
+ zErr1 = Xsqlite3MPrintf(tls, db, ts+17490, /* "CHECK constraint..." */
+ libc.VaList(bp+408, (*Table)(unsafe.Pointer(pTab9)).FzName))
Xsqlite3VdbeAddOp4(tls, v, OP_String8, 0, 3, 0, zErr1, -7)
integrityCheckResultRow(tls, v)
Xsqlite3VdbeResolveLabel(tls, v, addrCkOk)
-__280:
+__309:
;
Xsqlite3ExprListDelete(tls, db, pCheck)
-__279:
+__308:
;
- if !(!(isQuick != 0)) {
- goto __284
+ if !!(isQuick != 0) {
+ goto __313
} // Omit the remaining tests for quick_check
// Validate index entries for the current row
j4 = 0
- pIdx5 = (*Table)(unsafe.Pointer(pTab7)).FpIndex
-__285:
+ pIdx5 = (*Table)(unsafe.Pointer(pTab9)).FpIndex
+__314:
if !(pIdx5 != 0) {
- goto __287
+ goto __316
}
ckUniq = Xsqlite3VdbeMakeLabel(tls, pParse)
if !(pPk1 == pIdx5) {
- goto __288
+ goto __317
}
- goto __286
-__288:
+ goto __315
+__317:
;
- r1 = Xsqlite3GenerateIndexKey(tls, pParse, pIdx5, *(*int32)(unsafe.Pointer(bp + 444 /* iDataCur */)), 0, 0, bp+452, /* &jmp3 */
+ r1 = Xsqlite3GenerateIndexKey(tls, pParse, pIdx5, *(*int32)(unsafe.Pointer(bp + 528 /* iDataCur */)), 0, 0, bp+536, /* &jmp3 */
pPrior, r1)
pPrior = pIdx5
- Xsqlite3VdbeAddOp2(tls, v, OP_AddImm, (8 + j4), 1) // increment entry count
+ Xsqlite3VdbeAddOp2(tls, v, OP_AddImm, 8+j4, 1) // increment entry count
// Verify that an index entry exists for the current table row
- jmp21 = Xsqlite3VdbeAddOp4Int(tls, v, OP_Found, (*(*int32)(unsafe.Pointer(bp + 448 /* iIdxCur */)) + j4), ckUniq, r1,
+ jmp21 = Xsqlite3VdbeAddOp4Int(tls, v, OP_Found, *(*int32)(unsafe.Pointer(bp + 532))+j4, ckUniq, r1,
int32((*Index)(unsafe.Pointer(pIdx5)).FnColumn))
- Xsqlite3VdbeLoadString(tls, v, 3, ts+16254 /* "row " */)
+ Xsqlite3VdbeLoadString(tls, v, 3, ts+17520 /* "row " */)
Xsqlite3VdbeAddOp3(tls, v, OP_Concat, 7, 3, 3)
- Xsqlite3VdbeLoadString(tls, v, 4, ts+16259 /* " missing from in..." */)
+ Xsqlite3VdbeLoadString(tls, v, 4, ts+17525 /* " missing from in..." */)
Xsqlite3VdbeAddOp3(tls, v, OP_Concat, 4, 3, 3)
jmp5 = Xsqlite3VdbeLoadString(tls, v, 4, (*Index)(unsafe.Pointer(pIdx5)).FzName)
Xsqlite3VdbeAddOp3(tls, v, OP_Concat, 4, 3, 3)
@@ -111051,116 +112849,116 @@ __288:
// For UNIQUE indexes, verify that only one entry exists with the
// current key. The entry is unique if (1) any column is NULL
// or (2) the next entry has a different key
- if !(int32((*Index)(unsafe.Pointer((pIdx5))).FonError) != OE_None) {
- goto __289
+ if !(int32((*Index)(unsafe.Pointer(pIdx5)).FonError) != OE_None) {
+ goto __318
}
uniqOk = Xsqlite3VdbeMakeLabel(tls, pParse)
kk = 0
-__290:
+__319:
if !(kk < int32((*Index)(unsafe.Pointer(pIdx5)).FnKeyCol)) {
- goto __292
+ goto __321
}
iCol1 = int32(*(*I16)(unsafe.Pointer((*Index)(unsafe.Pointer(pIdx5)).FaiColumn + uintptr(kk)*2)))
- if !((iCol1 >= 0) && ((*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab7)).FaCol+uintptr(iCol1)*20)).FnotNull != 0)) {
- goto __293
+ if !(iCol1 >= 0 && uint32(int32(*(*uint8)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab9)).FaCol + uintptr(iCol1)*16 + 4))&0xf>>0)) != 0) {
+ goto __322
}
- goto __291
-__293:
+ goto __320
+__322:
;
- Xsqlite3VdbeAddOp2(tls, v, OP_IsNull, (r1 + kk), uniqOk)
+ Xsqlite3VdbeAddOp2(tls, v, OP_IsNull, r1+kk, uniqOk)
- goto __291
-__291:
+ goto __320
+__320:
kk++
- goto __290
- goto __292
-__292:
+ goto __319
+ goto __321
+__321:
;
- jmp6 = Xsqlite3VdbeAddOp1(tls, v, OP_Next, (*(*int32)(unsafe.Pointer(bp + 448 /* iIdxCur */)) + j4))
+ jmp6 = Xsqlite3VdbeAddOp1(tls, v, OP_Next, *(*int32)(unsafe.Pointer(bp + 532))+j4)
Xsqlite3VdbeGoto(tls, v, uniqOk)
Xsqlite3VdbeJumpHere(tls, v, jmp6)
- Xsqlite3VdbeAddOp4Int(tls, v, OP_IdxGT, (*(*int32)(unsafe.Pointer(bp + 448 /* iIdxCur */)) + j4), uniqOk, r1,
+ Xsqlite3VdbeAddOp4Int(tls, v, OP_IdxGT, *(*int32)(unsafe.Pointer(bp + 532))+j4, uniqOk, r1,
int32((*Index)(unsafe.Pointer(pIdx5)).FnKeyCol))
- Xsqlite3VdbeLoadString(tls, v, 3, ts+16280 /* "non-unique entry..." */)
+ Xsqlite3VdbeLoadString(tls, v, 3, ts+17546 /* "non-unique entry..." */)
Xsqlite3VdbeGoto(tls, v, jmp5)
Xsqlite3VdbeResolveLabel(tls, v, uniqOk)
-__289:
+__318:
;
Xsqlite3VdbeJumpHere(tls, v, jmp4)
- Xsqlite3ResolvePartIdxLabel(tls, pParse, *(*int32)(unsafe.Pointer(bp + 452 /* jmp3 */)))
- goto __286
-__286:
+ Xsqlite3ResolvePartIdxLabel(tls, pParse, *(*int32)(unsafe.Pointer(bp + 536 /* jmp3 */)))
+ goto __315
+__315:
pIdx5 = (*Index)(unsafe.Pointer(pIdx5)).FpNext
j4++
- goto __285
- goto __287
-__287:
+ goto __314
+ goto __316
+__316:
;
-__284:
+__313:
;
- Xsqlite3VdbeAddOp2(tls, v, OP_Next, *(*int32)(unsafe.Pointer(bp + 444 /* iDataCur */)), loopTop)
- Xsqlite3VdbeJumpHere(tls, v, (loopTop - 1))
- if !(!(isQuick != 0)) {
- goto __294
+ Xsqlite3VdbeAddOp2(tls, v, OP_Next, *(*int32)(unsafe.Pointer(bp + 528 /* iDataCur */)), loopTop)
+ Xsqlite3VdbeJumpHere(tls, v, loopTop-1)
+ if !!(isQuick != 0) {
+ goto __323
}
- Xsqlite3VdbeLoadString(tls, v, 2, ts+16307 /* "wrong # of entri..." */)
+ Xsqlite3VdbeLoadString(tls, v, 2, ts+17573 /* "wrong # of entri..." */)
j4 = 0
- pIdx5 = (*Table)(unsafe.Pointer(pTab7)).FpIndex
-__295:
+ pIdx5 = (*Table)(unsafe.Pointer(pTab9)).FpIndex
+__324:
if !(pIdx5 != 0) {
- goto __297
+ goto __326
}
if !(pPk1 == pIdx5) {
- goto __298
+ goto __327
}
- goto __296
-__298:
+ goto __325
+__327:
;
- Xsqlite3VdbeAddOp2(tls, v, OP_Count, (*(*int32)(unsafe.Pointer(bp + 448 /* iIdxCur */)) + j4), 3)
- addr1 = Xsqlite3VdbeAddOp3(tls, v, OP_Eq, (8 + j4), 0, 3)
+ Xsqlite3VdbeAddOp2(tls, v, OP_Count, *(*int32)(unsafe.Pointer(bp + 532))+j4, 3)
+ addr1 = Xsqlite3VdbeAddOp3(tls, v, OP_Eq, 8+j4, 0, 3)
Xsqlite3VdbeChangeP5(tls, v, uint16(SQLITE_NOTNULL))
Xsqlite3VdbeLoadString(tls, v, 4, (*Index)(unsafe.Pointer(pIdx5)).FzName)
Xsqlite3VdbeAddOp3(tls, v, OP_Concat, 4, 2, 3)
integrityCheckResultRow(tls, v)
Xsqlite3VdbeJumpHere(tls, v, addr1)
- goto __296
-__296:
+ goto __325
+__325:
pIdx5 = (*Index)(unsafe.Pointer(pIdx5)).FpNext
j4++
- goto __295
- goto __297
-__297:
+ goto __324
+ goto __326
+__326:
;
-__294:
+__323:
;
- goto __265
-__265:
+ goto __290
+__290:
x2 = (*HashElem)(unsafe.Pointer(x2)).Fnext
- goto __264
- goto __266
-__266:
+ goto __289
+ goto __291
+__291:
;
- goto __239
-__239:
+ goto __264
+__264:
i9++
- goto __238
- goto __240
-__240:
+ goto __263
+ goto __265
+__265:
;
- aOp2 = Xsqlite3VdbeAddOpList(tls, v, (int32(uint32(unsafe.Sizeof(endCode)) / uint32(unsafe.Sizeof(VdbeOpList{})))), uintptr(unsafe.Pointer(&endCode)), iLn5)
+ aOp2 = Xsqlite3VdbeAddOpList(tls, v, int32(uint32(unsafe.Sizeof(endCode))/uint32(unsafe.Sizeof(VdbeOpList{}))), uintptr(unsafe.Pointer(&endCode)), iLn5)
if !(aOp2 != 0) {
- goto __299
+ goto __328
}
- (*VdbeOp)(unsafe.Pointer(aOp2)).Fp2 = (1 - *(*int32)(unsafe.Pointer(bp + 440 /* mxErr */)))
+ (*VdbeOp)(unsafe.Pointer(aOp2)).Fp2 = 1 - *(*int32)(unsafe.Pointer(bp + 524))
(*VdbeOp)(unsafe.Pointer(aOp2 + 2*20)).Fp4type = int8(-1)
- *(*uintptr)(unsafe.Pointer(aOp2 + 2*20 + 16 /* &.p4 */)) = ts + 16336 /* "ok" */
+ *(*uintptr)(unsafe.Pointer(aOp2 + 2*20 + 16)) = ts + 17602 /* "ok" */
(*VdbeOp)(unsafe.Pointer(aOp2 + 5*20)).Fp4type = int8(-1)
- *(*uintptr)(unsafe.Pointer(aOp2 + 5*20 + 16 /* &.p4 */)) = Xsqlite3ErrStr(tls, SQLITE_CORRUPT)
-__299:
+ *(*uintptr)(unsafe.Pointer(aOp2 + 5*20 + 16)) = Xsqlite3ErrStr(tls, SQLITE_CORRUPT)
+__328:
;
- Xsqlite3VdbeChangeP3(tls, v, 0, (Xsqlite3VdbeCurrentAddr(tls, v) - 2))
+ Xsqlite3VdbeChangeP3(tls, v, 0, Xsqlite3VdbeCurrentAddr(tls, v)-2)
goto __15
@@ -111184,61 +112982,61 @@ __299:
// In the second form this pragma sets the text encoding to be used in
// new database files created using this database handle. It is only
// useful if invoked immediately after the main database i
-__44:
- if !(!(zRight != 0)) {
- goto __300
+__45:
+ if !!(zRight != 0) {
+ goto __329
} // "PRAGMA encoding"
if !(Xsqlite3ReadSchema(tls, pParse) != 0) {
- goto __302
+ goto __331
}
goto pragma_out
-__302:
+__331:
;
returnSingleText(tls, v, encnames1[(*Sqlite3)(unsafe.Pointer((*Parse)(unsafe.Pointer(pParse)).Fdb)).Fenc].FzName)
- goto __301
-__300: // "PRAGMA encoding = XXX"
+ goto __330
+__329: // "PRAGMA encoding = XXX"
// Only change the value of sqlite.enc if the database handle is not
// initialized. If the main database exists, the new sqlite.enc value
// will be overwritten when the schema is next loaded. If it does not
// already exists, it will be created to use the new encoding value.
- if !(((*Sqlite3)(unsafe.Pointer(db)).FmDbFlags & U32(DBFLAG_EncodingFixed)) == U32(0)) {
- goto __303
+ if !((*Sqlite3)(unsafe.Pointer(db)).FmDbFlags&U32(DBFLAG_EncodingFixed) == U32(0)) {
+ goto __332
}
- pEnc = (uintptr(unsafe.Pointer(&encnames1)))
-__304:
+ pEnc = uintptr(unsafe.Pointer(&encnames1))
+__333:
if !((*EncName)(unsafe.Pointer(pEnc)).FzName != 0) {
- goto __306
+ goto __335
}
if !(0 == Xsqlite3StrICmp(tls, zRight, (*EncName)(unsafe.Pointer(pEnc)).FzName)) {
- goto __307
+ goto __336
}
if (*EncName)(unsafe.Pointer(pEnc)).Fenc != 0 {
enc = (*EncName)(unsafe.Pointer(pEnc)).Fenc
} else {
enc = uint8(SQLITE_UTF16LE)
}
- ((*Schema)(unsafe.Pointer((*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer((db))).FaDb)).FpSchema)).Fenc) = enc
+ (*Schema)(unsafe.Pointer((*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb)).FpSchema)).Fenc = enc
Xsqlite3SetTextEncoding(tls, db, enc)
- goto __306
-__307:
+ goto __335
+__336:
;
- goto __305
-__305:
+ goto __334
+__334:
pEnc += 8
- goto __304
- goto __306
-__306:
+ goto __333
+ goto __335
+__335:
;
- if !(!(int32((*EncName)(unsafe.Pointer(pEnc)).FzName) != 0)) {
- goto __308
+ if !!(int32((*EncName)(unsafe.Pointer(pEnc)).FzName) != 0) {
+ goto __337
}
- Xsqlite3ErrorMsg(tls, pParse, ts+16339 /* "unsupported enco..." */, libc.VaList(bp+336, zRight))
-__308:
+ Xsqlite3ErrorMsg(tls, pParse, ts+17605 /* "unsupported enco..." */, libc.VaList(bp+416, zRight))
+__337:
;
-__303:
+__332:
;
-__301:
+__330:
;
goto __15
@@ -111273,40 +113071,40 @@ __301:
//
// The user-version is not used internally by SQLite. It may be used by
// applications for any purpose.
-__45:
+__46:
iCookie = int32((*PragmaName)(unsafe.Pointer(pPragma)).FiArg) // Which cookie to read or write
Xsqlite3VdbeUsesBtree(tls, v, iDb)
- if !((zRight != 0) && ((int32((*PragmaName)(unsafe.Pointer(pPragma)).FmPragFlg) & PragFlg_ReadOnly) == 0)) {
- goto __309
+ if !(zRight != 0 && int32((*PragmaName)(unsafe.Pointer(pPragma)).FmPragFlg)&PragFlg_ReadOnly == 0) {
+ goto __338
}
- aOp3 = Xsqlite3VdbeAddOpList(tls, v, (int32(uint32(unsafe.Sizeof(setCookie)) / uint32(unsafe.Sizeof(VdbeOpList{})))), uintptr(unsafe.Pointer(&setCookie)), 0)
+ aOp3 = Xsqlite3VdbeAddOpList(tls, v, int32(uint32(unsafe.Sizeof(setCookie))/uint32(unsafe.Sizeof(VdbeOpList{}))), uintptr(unsafe.Pointer(&setCookie)), 0)
if !(0 != 0) {
- goto __311
+ goto __340
}
goto __15
-__311:
+__340:
;
(*VdbeOp)(unsafe.Pointer(aOp3)).Fp1 = iDb
(*VdbeOp)(unsafe.Pointer(aOp3 + 1*20)).Fp1 = iDb
(*VdbeOp)(unsafe.Pointer(aOp3 + 1*20)).Fp2 = iCookie
(*VdbeOp)(unsafe.Pointer(aOp3 + 1*20)).Fp3 = Xsqlite3Atoi(tls, zRight)
(*VdbeOp)(unsafe.Pointer(aOp3 + 1*20)).Fp5 = U16(1)
- goto __310
-__309:
+ goto __339
+__338:
;
- aOp4 = Xsqlite3VdbeAddOpList(tls, v, (int32(uint32(unsafe.Sizeof(readCookie)) / uint32(unsafe.Sizeof(VdbeOpList{})))), uintptr(unsafe.Pointer(&readCookie)), 0)
+ aOp4 = Xsqlite3VdbeAddOpList(tls, v, int32(uint32(unsafe.Sizeof(readCookie))/uint32(unsafe.Sizeof(VdbeOpList{}))), uintptr(unsafe.Pointer(&readCookie)), 0)
if !(0 != 0) {
- goto __312
+ goto __341
}
goto __15
-__312:
+__341:
;
(*VdbeOp)(unsafe.Pointer(aOp4)).Fp1 = iDb
(*VdbeOp)(unsafe.Pointer(aOp4 + 1*20)).Fp1 = iDb
(*VdbeOp)(unsafe.Pointer(aOp4 + 1*20)).Fp3 = iCookie
Xsqlite3VdbeReusable(tls, v)
-__310:
+__339:
;
goto __15
@@ -111315,17 +113113,17 @@ __310:
//
// Return the names of all compile-time options used in this build,
// one option per row.
-__46:
+__47:
i10 = 0
(*Parse)(unsafe.Pointer(pParse)).FnMem = 1
-__313:
- if !((libc.AssignUintptr(&zOpt, Xsqlite3_compileoption_get(tls, libc.PostIncInt32(&i10, 1)))) != uintptr(0)) {
- goto __314
+__342:
+ if !(libc.AssignUintptr(&zOpt, Xsqlite3_compileoption_get(tls, libc.PostIncInt32(&i10, 1))) != uintptr(0)) {
+ goto __343
}
Xsqlite3VdbeLoadString(tls, v, 1, zOpt)
Xsqlite3VdbeAddOp2(tls, v, OP_ResultRow, 1, 1)
- goto __313
-__314:
+ goto __342
+__343:
;
Xsqlite3VdbeReusable(tls, v)
@@ -111334,40 +113132,40 @@ __314:
// PRAGMA [schema.]wal_checkpoint = passive|full|restart|truncate
//
// Checkpoint the database.
-__47:
+__48:
iBt = func() int32 {
if (*Token)(unsafe.Pointer(pId2)).Fz != 0 {
return iDb
}
- return (SQLITE_MAX_ATTACHED + 2)
+ return SQLITE_MAX_ATTACHED + 2
}()
eMode2 = SQLITE_CHECKPOINT_PASSIVE
if !(zRight != 0) {
- goto __315
+ goto __344
}
- if !(Xsqlite3StrICmp(tls, zRight, ts+15833 /* "full" */) == 0) {
- goto __316
+ if !(Xsqlite3StrICmp(tls, zRight, ts+17043) == 0) {
+ goto __345
}
eMode2 = SQLITE_CHECKPOINT_FULL
- goto __317
-__316:
- if !(Xsqlite3StrICmp(tls, zRight, ts+16364 /* "restart" */) == 0) {
- goto __318
+ goto __346
+__345:
+ if !(Xsqlite3StrICmp(tls, zRight, ts+17630) == 0) {
+ goto __347
}
eMode2 = SQLITE_CHECKPOINT_RESTART
- goto __319
-__318:
- if !(Xsqlite3StrICmp(tls, zRight, ts+15986 /* "truncate" */) == 0) {
- goto __320
+ goto __348
+__347:
+ if !(Xsqlite3StrICmp(tls, zRight, ts+17196) == 0) {
+ goto __349
}
eMode2 = SQLITE_CHECKPOINT_TRUNCATE
-__320:
+__349:
;
-__319:
+__348:
;
-__317:
+__346:
;
-__315:
+__344:
;
(*Parse)(unsafe.Pointer(pParse)).FnMem = 3
Xsqlite3VdbeAddOp3(tls, v, OP_Checkpoint, iBt, eMode2, 1)
@@ -111381,12 +113179,12 @@ __315:
// Configure a database connection to automatically checkpoint a database
// after accumulating N frames in the log. Or query for the current value
// of N.
-__48:
+__49:
if !(zRight != 0) {
- goto __321
+ goto __350
}
Xsqlite3_wal_autocheckpoint(tls, db, Xsqlite3Atoi(tls, zRight))
-__321:
+__350:
;
returnSingleInt(tls, v,
func() int64 {
@@ -111405,7 +113203,7 @@ __321:
// IMPLEMENTATION-OF: R-23445-46109 This pragma causes the database
// connection on which it is invoked to free up as much memory as it
// can, by calling sqlite3_db_release_memory().
-__49:
+__50:
Xsqlite3_db_release_memory(tls, db)
goto __15
@@ -111461,115 +113259,115 @@ __49:
//
// The rules for when tables are analyzed are likely to change in
// future releases.
-__50: // Mask of operations to perform
+__51: // Mask of operations to perform
if !(zRight != 0) {
- goto __322
+ goto __351
}
opMask = U32(Xsqlite3Atoi(tls, zRight))
- if !((opMask & U32(0x02)) == U32(0)) {
- goto __324
+ if !(opMask&U32(0x02) == U32(0)) {
+ goto __353
}
goto __15
-__324:
+__353:
;
- goto __323
-__322:
+ goto __352
+__351:
opMask = U32(0xfffe)
-__323:
+__352:
;
iTabCur = libc.PostIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnTab, 1)
iDbLast = func() int32 {
if zDb != 0 {
return iDb
}
- return ((*Sqlite3)(unsafe.Pointer(db)).FnDb - 1)
+ return (*Sqlite3)(unsafe.Pointer(db)).FnDb - 1
}()
-__325:
+__354:
if !(iDb <= iDbLast) {
- goto __327
+ goto __356
}
if !(iDb == 1) {
- goto __328
+ goto __357
}
- goto __326
-__328:
+ goto __355
+__357:
;
Xsqlite3CodeVerifySchema(tls, pParse, iDb)
pSchema = (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*16)).FpSchema
- k3 = (*Hash)(unsafe.Pointer((pSchema + 8 /* &.tblHash */))).Ffirst
-__329:
- if !(k3 != 0) {
- goto __331
+ k4 = (*Hash)(unsafe.Pointer(pSchema + 8)).Ffirst
+__358:
+ if !(k4 != 0) {
+ goto __360
}
- pTab8 = (*HashElem)(unsafe.Pointer(k3)).Fdata
+ pTab10 = (*HashElem)(unsafe.Pointer(k4)).Fdata
// If table pTab has not been used in a way that would benefit from
// having analysis statistics during the current session, then skip it.
// This also has the effect of skipping virtual tables and views
- if !(((*Table)(unsafe.Pointer(pTab8)).FtabFlags & U32(TF_StatsUsed)) == U32(0)) {
- goto __332
+ if !((*Table)(unsafe.Pointer(pTab10)).FtabFlags&U32(TF_StatsUsed) == U32(0)) {
+ goto __361
}
- goto __330
-__332:
+ goto __359
+__361:
;
// Reanalyze if the table is 25 times larger than the last analysis
- szThreshold = (LogEst(int32((*Table)(unsafe.Pointer(pTab8)).FnRowLogEst) + 46))
- pIdx6 = (*Table)(unsafe.Pointer(pTab8)).FpIndex
-__333:
+ szThreshold = LogEst(int32((*Table)(unsafe.Pointer(pTab10)).FnRowLogEst) + 46)
+ pIdx6 = (*Table)(unsafe.Pointer(pTab10)).FpIndex
+__362:
if !(pIdx6 != 0) {
- goto __335
+ goto __364
}
- if !(!((int32(*(*uint16)(unsafe.Pointer(pIdx6 + 56 /* &.hasStat1 */)) & 0x80 >> 7)) != 0)) {
- goto __336
+ if !!(int32(*(*uint16)(unsafe.Pointer(pIdx6 + 56))&0x80>>7) != 0) {
+ goto __365
}
szThreshold = int16(0) // Always analyze if any index lacks statistics
- goto __335
-__336:
+ goto __364
+__365:
;
- goto __334
-__334:
+ goto __363
+__363:
pIdx6 = (*Index)(unsafe.Pointer(pIdx6)).FpNext
- goto __333
- goto __335
-__335:
+ goto __362
+ goto __364
+__364:
;
if !(szThreshold != 0) {
- goto __337
+ goto __366
}
- Xsqlite3OpenTable(tls, pParse, iTabCur, iDb, pTab8, OP_OpenRead)
+ Xsqlite3OpenTable(tls, pParse, iTabCur, iDb, pTab10, OP_OpenRead)
Xsqlite3VdbeAddOp3(tls, v, OP_IfSmaller, iTabCur,
- (int32((U32(Xsqlite3VdbeCurrentAddr(tls, v) + 2)) + (opMask & U32(1)))), int32(szThreshold))
+ int32(U32(Xsqlite3VdbeCurrentAddr(tls, v)+2)+opMask&U32(1)), int32(szThreshold))
-__337:
+__366:
;
- zSubSql = Xsqlite3MPrintf(tls, db, ts+16372, /* "ANALYZE \"%w\".\"%w..." */
- libc.VaList(bp+344, (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+uintptr(iDb)*16)).FzDbSName, (*Table)(unsafe.Pointer(pTab8)).FzName))
- if !((opMask & U32(0x01)) != 0) {
- goto __338
+ zSubSql = Xsqlite3MPrintf(tls, db, ts+17638, /* "ANALYZE \"%w\".\"%w..." */
+ libc.VaList(bp+424, (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+uintptr(iDb)*16)).FzDbSName, (*Table)(unsafe.Pointer(pTab10)).FzName))
+ if !(opMask&U32(0x01) != 0) {
+ goto __367
}
r11 = Xsqlite3GetTempReg(tls, pParse)
Xsqlite3VdbeAddOp4(tls, v, OP_String8, 0, r11, 0, zSubSql, -7)
Xsqlite3VdbeAddOp2(tls, v, OP_ResultRow, r11, 1)
- goto __339
-__338:
+ goto __368
+__367:
Xsqlite3VdbeAddOp4(tls, v, OP_SqlExec, 0, 0, 0, zSubSql, -7)
-__339:
+__368:
;
- goto __330
-__330:
- k3 = (*HashElem)(unsafe.Pointer(k3)).Fnext
- goto __329
- goto __331
-__331:
+ goto __359
+__359:
+ k4 = (*HashElem)(unsafe.Pointer(k4)).Fnext
+ goto __358
+ goto __360
+__360:
;
- goto __326
-__326:
+ goto __355
+__355:
iDb++
- goto __325
- goto __327
-__327:
+ goto __354
+ goto __356
+__356:
;
Xsqlite3VdbeAddOp0(tls, v, OP_Expire)
goto __15
@@ -111582,13 +113380,13 @@ __327:
// then 0 is returned. Setting the busy_timeout to 0 or negative
// disables the timeout.
/*case PragTyp_BUSY_TIMEOUT*/
-__51:
+__52:
;
if !(zRight != 0) {
- goto __340
+ goto __369
}
Xsqlite3_busy_timeout(tls, db, Xsqlite3Atoi(tls, zRight))
-__340:
+__369:
;
returnSingleInt(tls, v, int64((*Sqlite3)(unsafe.Pointer(db)).FbusyTimeout))
goto __15
@@ -111602,12 +113400,12 @@ __340:
// IMPLEMENTATION-OF: R-64451-07163 The soft_heap_limit pragma always
// returns the same integer that would be returned by the
// sqlite3_soft_heap_limit64(-1) C-language function.
-__52:
- if !((zRight != 0) && (Xsqlite3DecOrHexToI64(tls, zRight, bp+456 /* &N */) == SQLITE_OK)) {
- goto __341
+__53:
+ if !(zRight != 0 && Xsqlite3DecOrHexToI64(tls, zRight, bp+544) == SQLITE_OK) {
+ goto __370
}
- Xsqlite3_soft_heap_limit64(tls, *(*Sqlite3_int64)(unsafe.Pointer(bp + 456 /* N */)))
-__341:
+ Xsqlite3_soft_heap_limit64(tls, *(*Sqlite3_int64)(unsafe.Pointer(bp + 544 /* N */)))
+__370:
;
returnSingleInt(tls, v, Xsqlite3_soft_heap_limit64(tls, int64(-1)))
goto __15
@@ -111621,18 +113419,18 @@ __341:
// sqlite3_hard_heap_limit64() C-language API can raise or deactivate
// the hard heap limit. This allows an application to set a heap limit
// constraint that cannot be relaxed by an untrusted SQL script.
-__53:
- if !((zRight != 0) && (Xsqlite3DecOrHexToI64(tls, zRight, bp+464 /* &N1 */) == SQLITE_OK)) {
- goto __342
+__54:
+ if !(zRight != 0 && Xsqlite3DecOrHexToI64(tls, zRight, bp+552) == SQLITE_OK) {
+ goto __371
}
iPrior = Xsqlite3_hard_heap_limit64(tls, int64(-1))
- if !((*(*Sqlite3_int64)(unsafe.Pointer(bp + 464 /* N1 */)) > int64(0)) && ((iPrior == int64(0)) || (iPrior > *(*Sqlite3_int64)(unsafe.Pointer(bp + 464 /* N1 */))))) {
- goto __343
+ if !(*(*Sqlite3_int64)(unsafe.Pointer(bp + 552)) > int64(0) && (iPrior == int64(0) || iPrior > *(*Sqlite3_int64)(unsafe.Pointer(bp + 552)))) {
+ goto __372
}
- Xsqlite3_hard_heap_limit64(tls, *(*Sqlite3_int64)(unsafe.Pointer(bp + 464 /* N1 */)))
-__343:
+ Xsqlite3_hard_heap_limit64(tls, *(*Sqlite3_int64)(unsafe.Pointer(bp + 552 /* N1 */)))
+__372:
;
-__342:
+__371:
;
returnSingleInt(tls, v, Xsqlite3_hard_heap_limit64(tls, int64(-1)))
goto __15
@@ -111642,14 +113440,14 @@ __342:
//
// Configure the maximum number of worker threads. Return the new
// maximum, which might be less than requested.
-__54:
- if !(((zRight != 0) &&
- (Xsqlite3DecOrHexToI64(tls, zRight, bp+472 /* &N2 */) == SQLITE_OK)) &&
- (*(*Sqlite3_int64)(unsafe.Pointer(bp + 472 /* N2 */)) >= int64(0))) {
- goto __344
+__55:
+ if !(zRight != 0 &&
+ Xsqlite3DecOrHexToI64(tls, zRight, bp+560) == SQLITE_OK &&
+ *(*Sqlite3_int64)(unsafe.Pointer(bp + 560)) >= int64(0)) {
+ goto __373
}
- Xsqlite3_limit(tls, db, SQLITE_LIMIT_WORKER_THREADS, (int32(*(*Sqlite3_int64)(unsafe.Pointer(bp + 472 /* N2 */)) & int64(0x7fffffff))))
-__344:
+ Xsqlite3_limit(tls, db, SQLITE_LIMIT_WORKER_THREADS, int32(*(*Sqlite3_int64)(unsafe.Pointer(bp + 560))&int64(0x7fffffff)))
+__373:
;
returnSingleInt(tls, v, int64(Xsqlite3_limit(tls, db, SQLITE_LIMIT_WORKER_THREADS, -1)))
goto __15
@@ -111659,16 +113457,16 @@ __344:
//
// Configure the maximum number of rows that ANALYZE will examine
// in each index that it looks at. Return the new limit.
-__55:
- if !(((zRight != 0) &&
- (Xsqlite3DecOrHexToI64(tls, zRight, bp+480 /* &N3 */) == SQLITE_OK)) &&
- (*(*Sqlite3_int64)(unsafe.Pointer(bp + 480 /* N3 */)) >= int64(0))) {
- goto __345
+__56:
+ if !(zRight != 0 &&
+ Xsqlite3DecOrHexToI64(tls, zRight, bp+568) == SQLITE_OK &&
+ *(*Sqlite3_int64)(unsafe.Pointer(bp + 568)) >= int64(0)) {
+ goto __374
}
- (*Sqlite3)(unsafe.Pointer(db)).FnAnalysisLimit = (int32(*(*Sqlite3_int64)(unsafe.Pointer(bp + 480 /* N3 */)) & int64(0x7fffffff)))
-__345:
+ (*Sqlite3)(unsafe.Pointer(db)).FnAnalysisLimit = int32(*(*Sqlite3_int64)(unsafe.Pointer(bp + 568)) & int64(0x7fffffff))
+__374:
;
- returnSingleInt(tls, v, int64((*Sqlite3)(unsafe.Pointer(db)).FnAnalysisLimit))
+ returnSingleInt(tls, v, int64((*Sqlite3)(unsafe.Pointer(db)).FnAnalysisLimit)) // IMP: R-57594-65522
goto __15
__15:
@@ -111679,11 +113477,11 @@ __15:
// PragFlg_NoColumns1 flag is set and the caller specified an argument
// to the PRAGMA, the implementation has not added any OP_ResultRow
// instructions to the VM.
- if !(((int32((*PragmaName)(unsafe.Pointer(pPragma)).FmPragFlg) & PragFlg_NoColumns1) != 0) && (zRight != 0)) {
- goto __346
+ if !(int32((*PragmaName)(unsafe.Pointer(pPragma)).FmPragFlg)&PragFlg_NoColumns1 != 0 && zRight != 0) {
+ goto __375
}
-__346:
+__375:
;
pragma_out:
@@ -111695,9 +113493,9 @@ type EncName = struct {
FzName uintptr
Fenc U8
F__ccgo_pad1 [3]byte
-} /* sqlite3.c:130282:18 */
+} /* sqlite3.c:131430:18 */
-var iLn3 int32 = 0 /* sqlite3.c:128958:22 */
+var iLn3 int32 = 0 /* sqlite3.c:129988:22 */
var getCacheSize = [9]VdbeOpList{
{Fopcode: U8(OP_Transaction)}, // 0
{Fopcode: U8(OP_ReadCookie), Fp2: int8(1), Fp3: int8(BTREE_DEFAULT_CACHE_SIZE)}, // 1
@@ -111708,16 +113506,16 @@ var getCacheSize = [9]VdbeOpList{
{Fopcode: U8(OP_Integer), Fp2: int8(1)}, // 6
{Fopcode: U8(OP_Noop)},
{Fopcode: U8(OP_ResultRow), Fp1: int8(1), Fp2: int8(1)},
-} /* sqlite3.c:128959:29 */
-var iLn4 int32 = 0 /* sqlite3.c:129227:26 */
+} /* sqlite3.c:129989:29 */
+var iLn4 int32 = 0 /* sqlite3.c:130257:26 */
var setMeta6 = [5]VdbeOpList{
{Fopcode: U8(OP_Transaction), Fp2: int8(1)}, // 0
{Fopcode: U8(OP_ReadCookie), Fp2: int8(1), Fp3: int8(BTREE_LARGEST_ROOT_PAGE)},
{Fopcode: U8(OP_If), Fp1: int8(1)}, // 2
{Fopcode: U8(OP_Halt), Fp2: int8(OE_Abort)}, // 3
{Fopcode: U8(OP_SetCookie), Fp2: int8(BTREE_INCR_VACUUM)}, // 4
-} /* sqlite3.c:129228:33 */
-var iLn5 int32 = 0 /* sqlite3.c:130232:24 */
+} /* sqlite3.c:130258:33 */
+var iLn5 int32 = 0 /* sqlite3.c:131380:24 */
var endCode = [7]VdbeOpList{
{Fopcode: U8(OP_AddImm), Fp1: int8(1)}, // 0
{Fopcode: U8(OP_IfNotZero), Fp1: int8(1), Fp2: int8(4)}, // 1
@@ -111726,27 +113524,27 @@ var endCode = [7]VdbeOpList{
{Fopcode: U8(OP_Halt)}, // 4
{Fopcode: U8(OP_String8), Fp2: int8(3)}, // 5
{Fopcode: U8(OP_Goto), Fp2: int8(3)}, // 6
-} /* sqlite3.c:130233:31 */
+} /* sqlite3.c:131381:31 */
var encnames1 = [9]EncName{
- {FzName: ts + 16390 /* "UTF8" */, Fenc: U8(SQLITE_UTF8)},
- {FzName: ts + 16395 /* "UTF-8" */, Fenc: U8(SQLITE_UTF8)}, // Must be element [1]
- {FzName: ts + 16401 /* "UTF-16le" */, Fenc: U8(SQLITE_UTF16LE)}, // Must be element [2]
- {FzName: ts + 16410 /* "UTF-16be" */, Fenc: U8(SQLITE_UTF16BE)}, // Must be element [3]
- {FzName: ts + 16419 /* "UTF16le" */, Fenc: U8(SQLITE_UTF16LE)},
- {FzName: ts + 16427 /* "UTF16be" */, Fenc: U8(SQLITE_UTF16BE)},
- {FzName: ts + 16435 /* "UTF-16" */}, // SQLITE_UTF16NATIVE
- {FzName: ts + 16442 /* "UTF16" */}, // SQLITE_UTF16NATIVE
+ {FzName: ts + 17656 /* "UTF8" */, Fenc: U8(SQLITE_UTF8)},
+ {FzName: ts + 17661 /* "UTF-8" */, Fenc: U8(SQLITE_UTF8)}, // Must be element [1]
+ {FzName: ts + 17667 /* "UTF-16le" */, Fenc: U8(SQLITE_UTF16LE)}, // Must be element [2]
+ {FzName: ts + 17676 /* "UTF-16be" */, Fenc: U8(SQLITE_UTF16BE)}, // Must be element [3]
+ {FzName: ts + 17685 /* "UTF16le" */, Fenc: U8(SQLITE_UTF16LE)},
+ {FzName: ts + 17693 /* "UTF16be" */, Fenc: U8(SQLITE_UTF16BE)},
+ {FzName: ts + 17701 /* "UTF-16" */}, // SQLITE_UTF16NATIVE
+ {FzName: ts + 17708 /* "UTF16" */}, // SQLITE_UTF16NATIVE
{},
-} /* sqlite3.c:130285:7 */
+} /* sqlite3.c:131433:7 */
var setCookie = [2]VdbeOpList{
{Fopcode: U8(OP_Transaction), Fp2: int8(1)}, // 0
{Fopcode: U8(OP_SetCookie)}, // 1
-} /* sqlite3.c:130365:31 */
+} /* sqlite3.c:131513:31 */
var readCookie = [3]VdbeOpList{
{Fopcode: U8(OP_Transaction)}, // 0
{Fopcode: U8(OP_ReadCookie), Fp2: int8(1)}, // 1
{Fopcode: U8(OP_ResultRow), Fp1: int8(1), Fp2: int8(1)},
-} /* sqlite3.c:130380:31 */
+} /* sqlite3.c:131528:31 */
// ****************************************************************************
//
// Implementation of an eponymous virtual table that runs a pragma.
@@ -111758,24 +113556,24 @@ type PragmaVtab1 = struct {
FnHidden U8
FiHidden U8
F__ccgo_pad1 [2]byte
-} /* sqlite3.c:130740:9 */
+} /* sqlite3.c:131888:9 */
// ****************************************************************************
//
// Implementation of an eponymous virtual table that runs a pragma.
//
-type PragmaVtab = PragmaVtab1 /* sqlite3.c:130740:27 */
+type PragmaVtab = PragmaVtab1 /* sqlite3.c:131888:27 */
type PragmaVtabCursor1 = struct {
Fbase Sqlite3_vtab_cursor
FpPragma uintptr
FiRowid Sqlite_int64
FazArg [2]uintptr
-} /* sqlite3.c:130741:9 */
+} /* sqlite3.c:131889:9 */
-type PragmaVtabCursor = PragmaVtabCursor1 /* sqlite3.c:130741:33 */
+type PragmaVtabCursor = PragmaVtabCursor1 /* sqlite3.c:131889:33 */
// Pragma virtual table module xConnect method.
-func pragmaVtabConnect(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uintptr, ppVtab uintptr, pzErr uintptr) int32 { /* sqlite3.c:130759:12: */
+func pragmaVtabConnect(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uintptr, ppVtab uintptr, pzErr uintptr) int32 { /* sqlite3.c:131907:12: */
bp := tls.Alloc(256)
defer tls.Free(256)
@@ -111792,7 +113590,7 @@ func pragmaVtabConnect(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv
_ = argc
_ = argv
Xsqlite3StrAccumInit(tls, bp+32 /* &acc */, uintptr(0), bp+56 /* &zBuf[0] */, int32(unsafe.Sizeof([200]uint8{})), 0)
- Xsqlite3_str_appendall(tls, bp+32 /* &acc */, ts+16448 /* "CREATE TABLE x" */)
+ Xsqlite3_str_appendall(tls, bp+32 /* &acc */, ts+17714 /* "CREATE TABLE x" */)
i = 0
j = int32((*PragmaName)(unsafe.Pointer(pPragma)).FiPragCName)
__1:
@@ -111800,7 +113598,7 @@ __1:
goto __3
}
{
- Xsqlite3_str_appendf(tls, bp+32 /* &acc */, ts+16463 /* "%c\"%s\"" */, libc.VaList(bp, int32(cSep), pragCName[j]))
+ Xsqlite3_str_appendf(tls, bp+32 /* &acc */, ts+17729 /* "%c\"%s\"" */, libc.VaList(bp, int32(cSep), pragCName[j]))
cSep = uint8(',')
}
@@ -111813,19 +113611,19 @@ __2:
__3:
;
if i == 0 {
- Xsqlite3_str_appendf(tls, bp+32 /* &acc */, ts+16470 /* "(\"%s\"" */, libc.VaList(bp+16, (*PragmaName)(unsafe.Pointer(pPragma)).FzName))
+ Xsqlite3_str_appendf(tls, bp+32 /* &acc */, ts+17736 /* "(\"%s\"" */, libc.VaList(bp+16, (*PragmaName)(unsafe.Pointer(pPragma)).FzName))
i++
}
j = 0
- if (int32((*PragmaName)(unsafe.Pointer(pPragma)).FmPragFlg) & PragFlg_Result1) != 0 {
- Xsqlite3_str_appendall(tls, bp+32 /* &acc */, ts+16476 /* ",arg HIDDEN" */)
+ if int32((*PragmaName)(unsafe.Pointer(pPragma)).FmPragFlg)&PragFlg_Result1 != 0 {
+ Xsqlite3_str_appendall(tls, bp+32 /* &acc */, ts+17742 /* ",arg HIDDEN" */)
j++
}
- if (int32((*PragmaName)(unsafe.Pointer(pPragma)).FmPragFlg) & (PragFlg_SchemaOpt | PragFlg_SchemaReq)) != 0 {
- Xsqlite3_str_appendall(tls, bp+32 /* &acc */, ts+16488 /* ",schema HIDDEN" */)
+ if int32((*PragmaName)(unsafe.Pointer(pPragma)).FmPragFlg)&(PragFlg_SchemaOpt|PragFlg_SchemaReq) != 0 {
+ Xsqlite3_str_appendall(tls, bp+32 /* &acc */, ts+17754 /* ",schema HIDDEN" */)
j++
}
- Xsqlite3_str_append(tls, bp+32 /* &acc */, ts+4066 /* ")" */, 1)
+ Xsqlite3_str_append(tls, bp+32 /* &acc */, ts+4877 /* ")" */, 1)
Xsqlite3StrAccumFinish(tls, bp+32 /* &acc */)
rc = Xsqlite3_declare_vtab(tls, db, bp+56 /* &zBuf[0] */)
@@ -111841,7 +113639,7 @@ __3:
(*PragmaVtab)(unsafe.Pointer(pTab)).FnHidden = U8(j)
}
} else {
- *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, ts+2790 /* "%s" */, libc.VaList(bp+24, Xsqlite3_errmsg(tls, db)))
+ *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, ts+3601 /* "%s" */, libc.VaList(bp+24, Xsqlite3_errmsg(tls, db)))
}
*(*uintptr)(unsafe.Pointer(ppVtab)) = pTab
@@ -111849,7 +113647,7 @@ __3:
}
// Pragma virtual table module xDisconnect method.
-func pragmaVtabDisconnect(tls *libc.TLS, pVtab uintptr) int32 { /* sqlite3.c:130821:12: */
+func pragmaVtabDisconnect(tls *libc.TLS, pVtab uintptr) int32 { /* sqlite3.c:131969:12: */
var pTab uintptr = pVtab
Xsqlite3_free(tls, pTab)
return SQLITE_OK
@@ -111861,7 +113659,7 @@ func pragmaVtabDisconnect(tls *libc.TLS, pVtab uintptr) int32 { /* sqlite3.c:130
// query planner to give == constraints on as many hidden parameters as
// possible, and especially on the first hidden parameter. So return a
// high cost if hidden parameters are unconstrained.
-func pragmaVtabBestIndex(tls *libc.TLS, tab uintptr, pIdxInfo uintptr) int32 { /* sqlite3.c:130834:12: */
+func pragmaVtabBestIndex(tls *libc.TLS, tab uintptr, pIdxInfo uintptr) int32 { /* sqlite3.c:131982:12: */
bp := tls.Alloc(8)
defer tls.Free(8)
@@ -111893,9 +113691,9 @@ __1:
if (*sqlite3_index_constraint)(unsafe.Pointer(pConstraint)).FiColumn < int32((*PragmaVtab)(unsafe.Pointer(pTab)).FiHidden) {
goto __2
}
- j = ((*sqlite3_index_constraint)(unsafe.Pointer(pConstraint)).FiColumn - int32((*PragmaVtab)(unsafe.Pointer(pTab)).FiHidden))
+ j = (*sqlite3_index_constraint)(unsafe.Pointer(pConstraint)).FiColumn - int32((*PragmaVtab)(unsafe.Pointer(pTab)).FiHidden)
- *(*int32)(unsafe.Pointer(bp /* &seen[0] */ + uintptr(j)*4)) = (i + 1)
+ *(*int32)(unsafe.Pointer(bp /* &seen[0] */ + uintptr(j)*4)) = i + 1
}
goto __2
@@ -111906,27 +113704,27 @@ __2:
goto __3
__3:
;
- if *(*int32)(unsafe.Pointer(bp /* &seen[0] */)) == 0 {
+ if *(*int32)(unsafe.Pointer(bp)) == 0 {
(*Sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FestimatedCost = float64(2147483647)
(*Sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FestimatedRows = int64(2147483647)
return SQLITE_OK
}
- j = (*(*int32)(unsafe.Pointer(bp /* &seen[0] */)) - 1)
+ j = *(*int32)(unsafe.Pointer(bp)) - 1
(*sqlite3_index_constraint_usage)(unsafe.Pointer((*Sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FaConstraintUsage + uintptr(j)*8)).FargvIndex = 1
(*sqlite3_index_constraint_usage)(unsafe.Pointer((*Sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FaConstraintUsage + uintptr(j)*8)).Fomit = uint8(1)
- if *(*int32)(unsafe.Pointer(bp /* &seen[0] */ + 1*4)) == 0 {
+ if *(*int32)(unsafe.Pointer(bp + 1*4)) == 0 {
return SQLITE_OK
}
(*Sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FestimatedCost = float64(20)
(*Sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FestimatedRows = int64(20)
- j = (*(*int32)(unsafe.Pointer(bp /* &seen[0] */ + 1*4)) - 1)
+ j = *(*int32)(unsafe.Pointer(bp + 1*4)) - 1
(*sqlite3_index_constraint_usage)(unsafe.Pointer((*Sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FaConstraintUsage + uintptr(j)*8)).FargvIndex = 2
(*sqlite3_index_constraint_usage)(unsafe.Pointer((*Sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FaConstraintUsage + uintptr(j)*8)).Fomit = uint8(1)
return SQLITE_OK
}
// Create a new cursor for the pragma virtual table
-func pragmaVtabOpen(tls *libc.TLS, pVtab uintptr, ppCursor uintptr) int32 { /* sqlite3.c:130871:12: */
+func pragmaVtabOpen(tls *libc.TLS, pVtab uintptr, ppCursor uintptr) int32 { /* sqlite3.c:132019:12: */
var pCsr uintptr
pCsr = Xsqlite3_malloc(tls, int32(unsafe.Sizeof(PragmaVtabCursor{})))
if pCsr == uintptr(0) {
@@ -111934,23 +113732,23 @@ func pragmaVtabOpen(tls *libc.TLS, pVtab uintptr, ppCursor uintptr) int32 { /* s
}
libc.Xmemset(tls, pCsr, 0, uint32(unsafe.Sizeof(PragmaVtabCursor{})))
(*PragmaVtabCursor)(unsafe.Pointer(pCsr)).Fbase.FpVtab = pVtab
- *(*uintptr)(unsafe.Pointer(ppCursor)) = (pCsr /* &.base */)
+ *(*uintptr)(unsafe.Pointer(ppCursor)) = pCsr
return SQLITE_OK
}
// Clear all content from pragma virtual table cursor.
-func pragmaVtabCursorClear(tls *libc.TLS, pCsr uintptr) { /* sqlite3.c:130882:13: */
+func pragmaVtabCursorClear(tls *libc.TLS, pCsr uintptr) { /* sqlite3.c:132030:13: */
var i int32
Xsqlite3_finalize(tls, (*PragmaVtabCursor)(unsafe.Pointer(pCsr)).FpPragma)
(*PragmaVtabCursor)(unsafe.Pointer(pCsr)).FpPragma = uintptr(0)
- for i = 0; i < (int32(uint32(unsafe.Sizeof([2]uintptr{})) / uint32(unsafe.Sizeof(uintptr(0))))); i++ {
- Xsqlite3_free(tls, *(*uintptr)(unsafe.Pointer((pCsr + 16 /* &.azArg */) + uintptr(i)*4)))
- *(*uintptr)(unsafe.Pointer((pCsr + 16 /* &.azArg */) + uintptr(i)*4)) = uintptr(0)
+ for i = 0; i < int32(uint32(unsafe.Sizeof([2]uintptr{}))/uint32(unsafe.Sizeof(uintptr(0)))); i++ {
+ Xsqlite3_free(tls, *(*uintptr)(unsafe.Pointer(pCsr + 16 + uintptr(i)*4)))
+ *(*uintptr)(unsafe.Pointer(pCsr + 16 + uintptr(i)*4)) = uintptr(0)
}
}
// Close a pragma virtual table cursor
-func pragmaVtabClose(tls *libc.TLS, cur uintptr) int32 { /* sqlite3.c:130893:12: */
+func pragmaVtabClose(tls *libc.TLS, cur uintptr) int32 { /* sqlite3.c:132041:12: */
var pCsr uintptr = cur
pragmaVtabCursorClear(tls, pCsr)
Xsqlite3_free(tls, pCsr)
@@ -111958,7 +113756,7 @@ func pragmaVtabClose(tls *libc.TLS, cur uintptr) int32 { /* sqlite3.c:130893:12:
}
// Advance the pragma virtual table cursor to the next row
-func pragmaVtabNext(tls *libc.TLS, pVtabCursor uintptr) int32 { /* sqlite3.c:130901:12: */
+func pragmaVtabNext(tls *libc.TLS, pVtabCursor uintptr) int32 { /* sqlite3.c:132049:12: */
var pCsr uintptr = pVtabCursor
var rc int32 = SQLITE_OK
@@ -111974,7 +113772,7 @@ func pragmaVtabNext(tls *libc.TLS, pVtabCursor uintptr) int32 { /* sqlite3.c:130
}
// Pragma virtual table module xFilter method.
-func pragmaVtabFilter(tls *libc.TLS, pVtabCursor uintptr, idxNum int32, idxStr uintptr, argc int32, argv uintptr) int32 { /* sqlite3.c:130919:12: */
+func pragmaVtabFilter(tls *libc.TLS, pVtabCursor uintptr, idxNum int32, idxStr uintptr, argc int32, argv uintptr) int32 { /* sqlite3.c:132067:12: */
bp := tls.Alloc(56)
defer tls.Free(56)
@@ -111990,7 +113788,7 @@ func pragmaVtabFilter(tls *libc.TLS, pVtabCursor uintptr, idxNum int32, idxStr u
_ = idxNum
_ = idxStr
pragmaVtabCursorClear(tls, pCsr)
- if (int32((*PragmaName)(unsafe.Pointer((*PragmaVtab)(unsafe.Pointer(pTab)).FpName)).FmPragFlg) & PragFlg_Result1) != 0 {
+ if int32((*PragmaName)(unsafe.Pointer((*PragmaVtab)(unsafe.Pointer(pTab)).FpName)).FmPragFlg)&PragFlg_Result1 != 0 {
j = 0
} else {
j = 1
@@ -112004,8 +113802,8 @@ __1:
var zText uintptr = Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*4)))
if zText != 0 {
- *(*uintptr)(unsafe.Pointer((pCsr + 16 /* &.azArg */) + uintptr(j)*4)) = Xsqlite3_mprintf(tls, ts+2790 /* "%s" */, libc.VaList(bp, zText))
- if *(*uintptr)(unsafe.Pointer((pCsr + 16 /* &.azArg */) + uintptr(j)*4)) == uintptr(0) {
+ *(*uintptr)(unsafe.Pointer(pCsr + 16 + uintptr(j)*4)) = Xsqlite3_mprintf(tls, ts+3601 /* "%s" */, libc.VaList(bp, zText))
+ if *(*uintptr)(unsafe.Pointer(pCsr + 16 + uintptr(j)*4)) == uintptr(0) {
return SQLITE_NOMEM
}
}
@@ -112019,49 +113817,49 @@ __2:
goto __3
__3:
;
- Xsqlite3StrAccumInit(tls, bp+32 /* &acc */, uintptr(0), uintptr(0), 0, *(*int32)(unsafe.Pointer(((*PragmaVtab)(unsafe.Pointer(pTab)).Fdb + 112 /* &.aLimit */) + 1*4)))
- Xsqlite3_str_appendall(tls, bp+32 /* &acc */, ts+16503 /* "PRAGMA " */)
- if *(*uintptr)(unsafe.Pointer((pCsr + 16 /* &.azArg */) + 1*4)) != 0 {
- Xsqlite3_str_appendf(tls, bp+32 /* &acc */, ts+16511 /* "%Q." */, libc.VaList(bp+8, *(*uintptr)(unsafe.Pointer((pCsr + 16 /* &.azArg */) + 1*4))))
+ Xsqlite3StrAccumInit(tls, bp+32 /* &acc */, uintptr(0), uintptr(0), 0, *(*int32)(unsafe.Pointer((*PragmaVtab)(unsafe.Pointer(pTab)).Fdb + 120 + 1*4)))
+ Xsqlite3_str_appendall(tls, bp+32 /* &acc */, ts+17769 /* "PRAGMA " */)
+ if *(*uintptr)(unsafe.Pointer(pCsr + 16 + 1*4)) != 0 {
+ Xsqlite3_str_appendf(tls, bp+32 /* &acc */, ts+17777 /* "%Q." */, libc.VaList(bp+8, *(*uintptr)(unsafe.Pointer(pCsr + 16 + 1*4))))
}
Xsqlite3_str_appendall(tls, bp+32 /* &acc */, (*PragmaName)(unsafe.Pointer((*PragmaVtab)(unsafe.Pointer(pTab)).FpName)).FzName)
- if *(*uintptr)(unsafe.Pointer((pCsr + 16 /* &.azArg */))) != 0 {
- Xsqlite3_str_appendf(tls, bp+32 /* &acc */, ts+16515 /* "=%Q" */, libc.VaList(bp+16, *(*uintptr)(unsafe.Pointer((pCsr + 16 /* &.azArg */)))))
+ if *(*uintptr)(unsafe.Pointer(pCsr + 16)) != 0 {
+ Xsqlite3_str_appendf(tls, bp+32 /* &acc */, ts+17781 /* "=%Q" */, libc.VaList(bp+16, *(*uintptr)(unsafe.Pointer(pCsr + 16))))
}
zSql = Xsqlite3StrAccumFinish(tls, bp+32 /* &acc */)
if zSql == uintptr(0) {
return SQLITE_NOMEM
}
- rc = Xsqlite3_prepare_v2(tls, (*PragmaVtab)(unsafe.Pointer(pTab)).Fdb, zSql, -1, (pCsr + 4 /* &.pPragma */), uintptr(0))
+ rc = Xsqlite3_prepare_v2(tls, (*PragmaVtab)(unsafe.Pointer(pTab)).Fdb, zSql, -1, pCsr+4, uintptr(0))
Xsqlite3_free(tls, zSql)
if rc != SQLITE_OK {
- (*PragmaVtab)(unsafe.Pointer(pTab)).Fbase.FzErrMsg = Xsqlite3_mprintf(tls, ts+2790 /* "%s" */, libc.VaList(bp+24, Xsqlite3_errmsg(tls, (*PragmaVtab)(unsafe.Pointer(pTab)).Fdb)))
+ (*PragmaVtab)(unsafe.Pointer(pTab)).Fbase.FzErrMsg = Xsqlite3_mprintf(tls, ts+3601 /* "%s" */, libc.VaList(bp+24, Xsqlite3_errmsg(tls, (*PragmaVtab)(unsafe.Pointer(pTab)).Fdb)))
return rc
}
return pragmaVtabNext(tls, pVtabCursor)
}
// Pragma virtual table module xEof method.
-func pragmaVtabEof(tls *libc.TLS, pVtabCursor uintptr) int32 { /* sqlite3.c:130969:12: */
+func pragmaVtabEof(tls *libc.TLS, pVtabCursor uintptr) int32 { /* sqlite3.c:132117:12: */
var pCsr uintptr = pVtabCursor
- return (libc.Bool32((*PragmaVtabCursor)(unsafe.Pointer(pCsr)).FpPragma == uintptr(0)))
+ return libc.Bool32((*PragmaVtabCursor)(unsafe.Pointer(pCsr)).FpPragma == uintptr(0))
}
// The xColumn method simply returns the corresponding column from
// the PRAGMA.
-func pragmaVtabColumn(tls *libc.TLS, pVtabCursor uintptr, ctx uintptr, i int32) int32 { /* sqlite3.c:130977:12: */
+func pragmaVtabColumn(tls *libc.TLS, pVtabCursor uintptr, ctx uintptr, i int32) int32 { /* sqlite3.c:132125:12: */
var pCsr uintptr = pVtabCursor
var pTab uintptr = (*Sqlite3_vtab_cursor)(unsafe.Pointer(pVtabCursor)).FpVtab
if i < int32((*PragmaVtab)(unsafe.Pointer(pTab)).FiHidden) {
Xsqlite3_result_value(tls, ctx, Xsqlite3_column_value(tls, (*PragmaVtabCursor)(unsafe.Pointer(pCsr)).FpPragma, i))
} else {
- Xsqlite3_result_text(tls, ctx, *(*uintptr)(unsafe.Pointer((pCsr + 16 /* &.azArg */) + uintptr((i-int32((*PragmaVtab)(unsafe.Pointer(pTab)).FiHidden)))*4)), -1, libc.UintptrFromInt32(-1))
+ Xsqlite3_result_text(tls, ctx, *(*uintptr)(unsafe.Pointer(pCsr + 16 + uintptr(i-int32((*PragmaVtab)(unsafe.Pointer(pTab)).FiHidden))*4)), -1, libc.UintptrFromInt32(-1))
}
return SQLITE_OK
}
// Pragma virtual table module xRowid method.
-func pragmaVtabRowid(tls *libc.TLS, pVtabCursor uintptr, p uintptr) int32 { /* sqlite3.c:130995:12: */
+func pragmaVtabRowid(tls *libc.TLS, pVtabCursor uintptr, p uintptr) int32 { /* sqlite3.c:132143:12: */
var pCsr uintptr = pVtabCursor
*(*Sqlite_int64)(unsafe.Pointer(p)) = (*PragmaVtabCursor)(unsafe.Pointer(pCsr)).FiRowid
return SQLITE_OK
@@ -112079,19 +113877,19 @@ var pragmaVtabModule = Sqlite3_module{ // xCreate - create a table
FxEof: 0, // xEof
FxColumn: 0, // xColumn - read data
FxRowid: 0, // xShadowName
-} /* sqlite3.c:131002:29 */
+} /* sqlite3.c:132150:29 */
// Check to see if zTabName is really the name of a pragma. If it is,
// then register an eponymous virtual table for that pragma and return
// a pointer to the Module object for the new virtual table.
-func Xsqlite3PragmaVtabRegister(tls *libc.TLS, db uintptr, zName uintptr) uintptr { /* sqlite3.c:131034:23: */
+func Xsqlite3PragmaVtabRegister(tls *libc.TLS, db uintptr, zName uintptr) uintptr { /* sqlite3.c:132182:23: */
var pName uintptr
- pName = pragmaLocate(tls, (zName + uintptr(7)))
+ pName = pragmaLocate(tls, zName+uintptr(7))
if pName == uintptr(0) {
return uintptr(0)
}
- if (int32((*PragmaName)(unsafe.Pointer(pName)).FmPragFlg) & (PragFlg_Result0 | PragFlg_Result1)) == 0 {
+ if int32((*PragmaName)(unsafe.Pointer(pName)).FmPragFlg)&(PragFlg_Result0|PragFlg_Result1) == 0 {
return uintptr(0)
}
@@ -112117,7 +113915,7 @@ func Xsqlite3PragmaVtabRegister(tls *libc.TLS, db uintptr, zName uintptr) uintpt
// Fill the InitData structure with an error message that indicates
// that the database is corrupt.
-func corruptSchema(tls *libc.TLS, pData uintptr, azObj uintptr, zExtra uintptr) { /* sqlite3.c:131071:13: */
+func corruptSchema(tls *libc.TLS, pData uintptr, azObj uintptr, zExtra uintptr) { /* sqlite3.c:132219:13: */
bp := tls.Alloc(56)
defer tls.Free(56)
@@ -112126,43 +113924,44 @@ func corruptSchema(tls *libc.TLS, pData uintptr, azObj uintptr, zExtra uintptr)
(*InitData)(unsafe.Pointer(pData)).Frc = SQLITE_NOMEM
} else if *(*uintptr)(unsafe.Pointer((*InitData)(unsafe.Pointer(pData)).FpzErrMsg)) != uintptr(0) {
// A error message has already been generated. Do not overwrite it
- } else if ((*InitData)(unsafe.Pointer(pData)).FmInitFlags & (U32(INITFLAG_AlterRename | INITFLAG_AlterDrop))) != 0 {
+ } else if (*InitData)(unsafe.Pointer(pData)).FmInitFlags&U32(INITFLAG_AlterMask) != 0 {
*(*uintptr)(unsafe.Pointer((*InitData)(unsafe.Pointer(pData)).FpzErrMsg)) = Xsqlite3MPrintf(tls, db,
- ts+16519 /* "error in %s %s a..." */, libc.VaList(bp, *(*uintptr)(unsafe.Pointer(azObj)), *(*uintptr)(unsafe.Pointer(azObj + 1*4)),
- func() uintptr {
- if ((*InitData)(unsafe.Pointer(pData)).FmInitFlags & U32(INITFLAG_AlterRename)) != 0 {
- return ts + 16547 /* "rename" */
- }
- return ts + 16554 /* "drop column" */
- }(),
+ ts+17785 /* "error in %s %s a..." */, libc.VaList(bp, *(*uintptr)(unsafe.Pointer(azObj)), *(*uintptr)(unsafe.Pointer(azObj + 1*4)),
+ azAlterType[(*InitData)(unsafe.Pointer(pData)).FmInitFlags&U32(INITFLAG_AlterMask)-U32(1)],
zExtra))
(*InitData)(unsafe.Pointer(pData)).Frc = SQLITE_ERROR
- } else if ((*Sqlite3)(unsafe.Pointer(db)).Fflags & uint64(SQLITE_WriteSchema)) != 0 {
- (*InitData)(unsafe.Pointer(pData)).Frc = Xsqlite3CorruptError(tls, 131089)
+ } else if (*Sqlite3)(unsafe.Pointer(db)).Fflags&uint64(SQLITE_WriteSchema) != 0 {
+ (*InitData)(unsafe.Pointer(pData)).Frc = Xsqlite3CorruptError(tls, 132242)
} else {
var z uintptr
var zObj uintptr
if *(*uintptr)(unsafe.Pointer(azObj + 1*4)) != 0 {
zObj = *(*uintptr)(unsafe.Pointer(azObj + 1*4))
} else {
- zObj = ts + 4122 /* "?" */
+ zObj = ts + 4928 /* "?" */
}
- z = Xsqlite3MPrintf(tls, db, ts+16566 /* "malformed databa..." */, libc.VaList(bp+32, zObj))
- if (zExtra != 0) && (*(*uint8)(unsafe.Pointer(zExtra)) != 0) {
- z = Xsqlite3MPrintf(tls, db, ts+16597 /* "%z - %s" */, libc.VaList(bp+40, z, zExtra))
+ z = Xsqlite3MPrintf(tls, db, ts+17813 /* "malformed databa..." */, libc.VaList(bp+32, zObj))
+ if zExtra != 0 && *(*uint8)(unsafe.Pointer(zExtra)) != 0 {
+ z = Xsqlite3MPrintf(tls, db, ts+17844 /* "%z - %s" */, libc.VaList(bp+40, z, zExtra))
}
*(*uintptr)(unsafe.Pointer((*InitData)(unsafe.Pointer(pData)).FpzErrMsg)) = z
- (*InitData)(unsafe.Pointer(pData)).Frc = Xsqlite3CorruptError(tls, 131096)
+ (*InitData)(unsafe.Pointer(pData)).Frc = Xsqlite3CorruptError(tls, 132249)
}
}
+var azAlterType = [3]uintptr{
+ ts + 17852, /* "rename" */
+ ts + 17859, /* "drop column" */
+ ts + 17871, /* "add column" */
+} /* sqlite3.c:132230:23 */
+
// Check to see if any sibling index (another index on the same table)
// of pIndex has the same root page number, and if it does, return true.
// This would indicate a corrupt schema.
-func Xsqlite3IndexHasDuplicateRootPage(tls *libc.TLS, pIndex uintptr) int32 { /* sqlite3.c:131105:20: */
+func Xsqlite3IndexHasDuplicateRootPage(tls *libc.TLS, pIndex uintptr) int32 { /* sqlite3.c:132258:20: */
var p uintptr
for p = (*Table)(unsafe.Pointer((*Index)(unsafe.Pointer(pIndex)).FpTable)).FpIndex; p != 0; p = (*Index)(unsafe.Pointer(p)).FpNext {
- if ((*Index)(unsafe.Pointer(p)).Ftnum == (*Index)(unsafe.Pointer(pIndex)).Ftnum) && (p != pIndex) {
+ if (*Index)(unsafe.Pointer(p)).Ftnum == (*Index)(unsafe.Pointer(pIndex)).Ftnum && p != pIndex {
return 1
}
}
@@ -112181,7 +113980,7 @@ func Xsqlite3IndexHasDuplicateRootPage(tls *libc.TLS, pIndex uintptr) int32 { /*
// argv[3] = root page number for table or index. 0 for trigger or view.
// argv[4] = SQL text for the CREATE statement.
//
-func Xsqlite3InitCallback(tls *libc.TLS, pInit uintptr, argc int32, argv uintptr, NotUsed uintptr) int32 { /* sqlite3.c:131139:20: */
+func Xsqlite3InitCallback(tls *libc.TLS, pInit uintptr, argc int32, argv uintptr, NotUsed uintptr) int32 { /* sqlite3.c:132292:20: */
bp := tls.Alloc(4)
defer tls.Free(4)
@@ -112192,7 +113991,7 @@ func Xsqlite3InitCallback(tls *libc.TLS, pInit uintptr, argc int32, argv uintptr
_ = NotUsed
_ = argc
- *(*U32)(unsafe.Pointer(db + 24 /* &.mDbFlags */)) |= (U32(DBFLAG_EncodingFixed))
+ *(*U32)(unsafe.Pointer(db + 24)) |= U32(DBFLAG_EncodingFixed)
if argv == uintptr(0) {
return 0
} // Might happen if EMPTY_RESULT_CALLBACKS are on
@@ -112204,9 +114003,9 @@ func Xsqlite3InitCallback(tls *libc.TLS, pInit uintptr, argc int32, argv uintptr
if *(*uintptr)(unsafe.Pointer(argv + 3*4)) == uintptr(0) {
corruptSchema(tls, pData, argv, uintptr(0))
- } else if ((*(*uintptr)(unsafe.Pointer(argv + 4*4)) != 0) &&
- ('c' == int32(Xsqlite3UpperToLower[uint8(*(*uint8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(argv + 4*4)))))]))) &&
- ('r' == int32(Xsqlite3UpperToLower[uint8(*(*uint8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(argv + 4*4)) + 1)))])) {
+ } else if *(*uintptr)(unsafe.Pointer(argv + 4*4)) != 0 &&
+ 'c' == int32(Xsqlite3UpperToLower[uint8(*(*uint8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(argv + 4*4)))))]) &&
+ 'r' == int32(Xsqlite3UpperToLower[uint8(*(*uint8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(argv + 4*4)) + 1)))]) {
// Call the parser to process a CREATE TABLE, INDEX or VIEW.
// But because db->init.busy is set to 1, no VDBE code is generated
// or executed. All the parser does is build the internal data
@@ -112223,13 +114022,13 @@ func Xsqlite3InitCallback(tls *libc.TLS, pInit uintptr, argc int32, argv uintptr
// Return code from sqlite3_prepare()
(*Sqlite3)(unsafe.Pointer(db)).Finit.FiDb = U8(iDb)
- if (Xsqlite3GetUInt32(tls, *(*uintptr)(unsafe.Pointer(argv + 3*4)), (db+164 /* &.init */ /* &.newTnum */)) == 0) ||
- (((*Sqlite3)(unsafe.Pointer(db)).Finit.FnewTnum > (*InitData)(unsafe.Pointer(pData)).FmxPage) && ((*InitData)(unsafe.Pointer(pData)).FmxPage > Pgno(0))) {
+ if Xsqlite3GetUInt32(tls, *(*uintptr)(unsafe.Pointer(argv + 3*4)), db+172) == 0 ||
+ (*Sqlite3)(unsafe.Pointer(db)).Finit.FnewTnum > (*InitData)(unsafe.Pointer(pData)).FmxPage && (*InitData)(unsafe.Pointer(pData)).FmxPage > Pgno(0) {
if Xsqlite3Config.FbExtraSchemaChecks != 0 {
- corruptSchema(tls, pData, argv, ts+12850 /* "invalid rootpage" */)
+ corruptSchema(tls, pData, argv, ts+14033 /* "invalid rootpage" */)
}
}
- libc.SetBitFieldPtr8Uint32(db+164 /* &.init */ +8 /* &.orphanTrigger */, uint32(0), 0, 0x1)
+ libc.SetBitFieldPtr8Uint32(db+172+8, uint32(0), 0, 0x1)
(*Sqlite3)(unsafe.Pointer(db)).Finit.FazInit = argv
*(*uintptr)(unsafe.Pointer(bp /* pStmt */)) = uintptr(0)
sqlite3Prepare(tls, db, *(*uintptr)(unsafe.Pointer(argv + 4*4)), -1, uint32(0), uintptr(0), bp /* &pStmt */, uintptr(0))
@@ -112238,7 +114037,7 @@ func Xsqlite3InitCallback(tls *libc.TLS, pInit uintptr, argc int32, argv uintptr
(*Sqlite3)(unsafe.Pointer(db)).Finit.FiDb = saved_iDb
// assert( saved_iDb==0 || (db->mDbFlags & DBFLAG_Vacuum)!=0 );
if SQLITE_OK != rc {
- if (uint32(int32(*(*uint8)(unsafe.Pointer(db + 164 /* &.init */ + 8 /* &.orphanTrigger */)) & 0x1 >> 0))) != 0 {
+ if uint32(int32(*(*uint8)(unsafe.Pointer(db + 172 + 8))&0x1>>0)) != 0 {
} else {
if rc > (*InitData)(unsafe.Pointer(pData)).Frc {
@@ -112246,13 +114045,14 @@ func Xsqlite3InitCallback(tls *libc.TLS, pInit uintptr, argc int32, argv uintptr
}
if rc == SQLITE_NOMEM {
Xsqlite3OomFault(tls, db)
- } else if (rc != SQLITE_INTERRUPT) && ((rc & 0xFF) != SQLITE_LOCKED) {
+ } else if rc != SQLITE_INTERRUPT && rc&0xFF != SQLITE_LOCKED {
corruptSchema(tls, pData, argv, Xsqlite3_errmsg(tls, db))
}
}
}
+ (*Sqlite3)(unsafe.Pointer(db)).Finit.FazInit = uintptr(unsafe.Pointer(&Xsqlite3StdType)) // Any array of string ptrs will do
Xsqlite3_finalize(tls, *(*uintptr)(unsafe.Pointer(bp /* pStmt */)))
- } else if (*(*uintptr)(unsafe.Pointer(argv + 1*4)) == uintptr(0)) || ((*(*uintptr)(unsafe.Pointer(argv + 4*4)) != uintptr(0)) && (int32(*(*uint8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(argv + 4*4))))) != 0)) {
+ } else if *(*uintptr)(unsafe.Pointer(argv + 1*4)) == uintptr(0) || *(*uintptr)(unsafe.Pointer(argv + 4*4)) != uintptr(0) && int32(*(*uint8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(argv + 4*4))))) != 0 {
corruptSchema(tls, pData, argv, uintptr(0))
} else {
// If the SQL column is blank it means this is an index that
@@ -112263,13 +114063,13 @@ func Xsqlite3InitCallback(tls *libc.TLS, pInit uintptr, argc int32, argv uintptr
var pIndex uintptr
pIndex = Xsqlite3FindIndex(tls, db, *(*uintptr)(unsafe.Pointer(argv + 1*4)), (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+uintptr(iDb)*16)).FzDbSName)
if pIndex == uintptr(0) {
- corruptSchema(tls, pData, argv, ts+16605 /* "orphan index" */)
- } else if (((Xsqlite3GetUInt32(tls, *(*uintptr)(unsafe.Pointer(argv + 3*4)), (pIndex+44 /* &.tnum */)) == 0) ||
- ((*Index)(unsafe.Pointer(pIndex)).Ftnum < Pgno(2))) ||
- ((*Index)(unsafe.Pointer(pIndex)).Ftnum > (*InitData)(unsafe.Pointer(pData)).FmxPage)) ||
- (Xsqlite3IndexHasDuplicateRootPage(tls, pIndex) != 0) {
+ corruptSchema(tls, pData, argv, ts+17882 /* "orphan index" */)
+ } else if Xsqlite3GetUInt32(tls, *(*uintptr)(unsafe.Pointer(argv + 3*4)), pIndex+44) == 0 ||
+ (*Index)(unsafe.Pointer(pIndex)).Ftnum < Pgno(2) ||
+ (*Index)(unsafe.Pointer(pIndex)).Ftnum > (*InitData)(unsafe.Pointer(pData)).FmxPage ||
+ Xsqlite3IndexHasDuplicateRootPage(tls, pIndex) != 0 {
if Xsqlite3Config.FbExtraSchemaChecks != 0 {
- corruptSchema(tls, pData, argv, ts+12850 /* "invalid rootpage" */)
+ corruptSchema(tls, pData, argv, ts+14033 /* "invalid rootpage" */)
}
}
}
@@ -112282,7 +114082,7 @@ func Xsqlite3InitCallback(tls *libc.TLS, pInit uintptr, argc int32, argv uintptr
// database. iDb==1 should never be used. iDb>=2 is used for
// auxiliary databases. Return one of the SQLITE_ error codes to
// indicate success or failure.
-func Xsqlite3InitOne(tls *libc.TLS, db uintptr, iDb int32, pzErrMsg uintptr, mFlags U32) int32 { /* sqlite3.c:131241:20: */
+func Xsqlite3InitOne(tls *libc.TLS, db uintptr, iDb int32, pzErrMsg uintptr, mFlags U32) int32 { /* sqlite3.c:132395:20: */
bp := tls.Alloc(88)
defer tls.Free(88)
@@ -112303,7 +114103,7 @@ func Xsqlite3InitOne(tls *libc.TLS, db uintptr, iDb int32, pzErrMsg uintptr, mFl
var xAuth Sqlite3_xauth
var zSql uintptr
openedTransaction = 0
- mask = (int32(((*Sqlite3)(unsafe.Pointer(db)).FmDbFlags & U32(DBFLAG_EncodingFixed)) | libc.Uint32FromInt32(libc.CplInt32(DBFLAG_EncodingFixed))))
+ mask = int32((*Sqlite3)(unsafe.Pointer(db)).FmDbFlags&U32(DBFLAG_EncodingFixed) | libc.Uint32FromInt32(libc.CplInt32(DBFLAG_EncodingFixed)))
(*Sqlite3)(unsafe.Pointer(db)).Finit.Fbusy = U8(1)
@@ -112312,16 +114112,16 @@ func Xsqlite3InitOne(tls *libc.TLS, db uintptr, iDb int32, pzErrMsg uintptr, mFl
// table name will be inserted automatically by the parser so we can just
// use the abbreviation "x" here. The parser will also automatically tag
// the schema table as read-only.
- *(*uintptr)(unsafe.Pointer(bp + 16 /* &azArg[0] */)) = ts + 7823 /* "table" */
+ *(*uintptr)(unsafe.Pointer(bp + 16 /* &azArg[0] */)) = ts + 8739 /* "table" */
*(*uintptr)(unsafe.Pointer(bp + 16 /* &azArg[0] */ + 1*4)) = libc.AssignUintptr(&zSchemaTabName, func() uintptr {
- if (!(0 != 0)) && (iDb == 1) {
- return ts + 10872 /* "sqlite_temp_mast..." */
+ if !(0 != 0) && iDb == 1 {
+ return ts + 11986
}
- return ts + 4956 /* "sqlite_master" */
+ return ts + 5803
}())
*(*uintptr)(unsafe.Pointer(bp + 16 /* &azArg[0] */ + 2*4)) = *(*uintptr)(unsafe.Pointer(bp + 16 /* &azArg[0] */ + 1*4))
- *(*uintptr)(unsafe.Pointer(bp + 16 /* &azArg[0] */ + 3*4)) = ts + 6913 /* "1" */
- *(*uintptr)(unsafe.Pointer(bp + 16 /* &azArg[0] */ + 4*4)) = ts + 16618 /* "CREATE TABLE x(t..." */
+ *(*uintptr)(unsafe.Pointer(bp + 16 /* &azArg[0] */ + 3*4)) = ts + 7806 /* "1" */
+ *(*uintptr)(unsafe.Pointer(bp + 16 /* &azArg[0] */ + 4*4)) = ts + 17895 /* "CREATE TABLE x(t..." */
*(*uintptr)(unsafe.Pointer(bp + 16 /* &azArg[0] */ + 5*4)) = uintptr(0)
(*InitData)(unsafe.Pointer(bp + 40 /* &initData */)).Fdb = db
(*InitData)(unsafe.Pointer(bp + 40 /* &initData */)).FiDb = iDb
@@ -112331,8 +114131,8 @@ func Xsqlite3InitOne(tls *libc.TLS, db uintptr, iDb int32, pzErrMsg uintptr, mFl
(*InitData)(unsafe.Pointer(bp + 40 /* &initData */)).FnInitRow = U32(0)
(*InitData)(unsafe.Pointer(bp + 40 /* &initData */)).FmxPage = Pgno(0)
Xsqlite3InitCallback(tls, bp+40 /* &initData */, 5, bp+16 /* azArg */, uintptr(0))
- *(*U32)(unsafe.Pointer(db + 24 /* &.mDbFlags */)) &= (U32(mask))
- if !((*InitData)(unsafe.Pointer(bp+40 /* &initData */)).Frc != 0) {
+ *(*U32)(unsafe.Pointer(db + 24)) &= U32(mask)
+ if !((*InitData)(unsafe.Pointer(bp+40)).Frc != 0) {
goto __1
}
rc = (*InitData)(unsafe.Pointer(bp + 40 /* &initData */)).Frc
@@ -112341,12 +114141,12 @@ __1:
;
// Create a cursor to hold the database open
- pDb = ((*Sqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*16)
+ pDb = (*Sqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*16
if !((*Db)(unsafe.Pointer(pDb)).FpBt == uintptr(0)) {
goto __2
}
- *(*U16)(unsafe.Pointer((*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer((db))).FaDb+1*16)).FpSchema + 78 /* &.schemaFlags */)) |= U16((DB_SchemaLoaded))
+ *(*U16)(unsafe.Pointer((*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+1*16)).FpSchema + 78)) |= U16(DB_SchemaLoaded)
rc = SQLITE_OK
goto error_out
__2:
@@ -112389,10 +114189,10 @@ __3:
// the possible values of meta[4].
i = 0
__5:
- if !(i < (int32(uint32(unsafe.Sizeof([5]int32{})) / uint32(unsafe.Sizeof(int32(0)))))) {
+ if !(i < int32(uint32(unsafe.Sizeof([5]int32{}))/uint32(unsafe.Sizeof(int32(0))))) {
goto __7
}
- Xsqlite3BtreeGetMeta(tls, (*Db)(unsafe.Pointer(pDb)).FpBt, (i + 1), (bp + 68 /* &meta */ + uintptr(i)*4))
+ Xsqlite3BtreeGetMeta(tls, (*Db)(unsafe.Pointer(pDb)).FpBt, i+1, bp+68+uintptr(i)*4)
goto __6
__6:
i++
@@ -112400,7 +114200,7 @@ __6:
goto __7
__7:
;
- if !(((*Sqlite3)(unsafe.Pointer(db)).Fflags & uint64(SQLITE_ResetDatabase)) != uint64(0)) {
+ if !((*Sqlite3)(unsafe.Pointer(db)).Fflags&uint64(SQLITE_ResetDatabase) != uint64(0)) {
goto __8
}
libc.Xmemset(tls, bp+68 /* &meta[0] */, 0, uint32(unsafe.Sizeof([5]int32{})))
@@ -112412,14 +114212,14 @@ __8:
// main database, set sqlite3.enc to the encoding of the main database.
// For an attached db, it is an error if the encoding is not the same
// as sqlite3.enc.
- if !(*(*int32)(unsafe.Pointer(bp + 68 /* &meta[0] */ + 4*4)) != 0) {
+ if !(*(*int32)(unsafe.Pointer(bp + 68 + 4*4)) != 0) {
goto __9
} // text encoding
- if !((iDb == 0) && (((*Sqlite3)(unsafe.Pointer(db)).FmDbFlags & U32(DBFLAG_EncodingFixed)) == U32(0))) {
+ if !(iDb == 0 && (*Sqlite3)(unsafe.Pointer(db)).FmDbFlags&U32(DBFLAG_EncodingFixed) == U32(0)) {
goto __10
}
// If opening the main database, set ENC(db).
- encoding = (U8(int32(U8(*(*int32)(unsafe.Pointer(bp + 68 /* &meta[0] */ + 4*4)))) & 3))
+ encoding = U8(int32(U8(*(*int32)(unsafe.Pointer(bp + 68 + 4*4)))) & 3)
if !(int32(encoding) == 0) {
goto __12
}
@@ -112430,11 +114230,11 @@ __12:
goto __11
__10:
// If opening an attached database, the encoding much match ENC(db)
- if !((*(*int32)(unsafe.Pointer(bp + 68 /* &meta[0] */ + 4*4)) & 3) != (int32((*Sqlite3)(unsafe.Pointer(db)).Fenc))) {
+ if !(*(*int32)(unsafe.Pointer(bp + 68 + 4*4))&3 != int32((*Sqlite3)(unsafe.Pointer(db)).Fenc)) {
goto __13
}
Xsqlite3SetString(tls, pzErrMsg, db,
- ts+10499 /* "attached databas..." */)
+ ts+11613 /* "attached databas..." */)
rc = SQLITE_ERROR
goto initone_error_out
__13:
@@ -112474,7 +114274,7 @@ __16:
if !(int32((*Schema)(unsafe.Pointer((*Db)(unsafe.Pointer(pDb)).FpSchema)).Ffile_format) > SQLITE_MAX_FILE_FORMAT) {
goto __17
}
- Xsqlite3SetString(tls, pzErrMsg, db, ts+16690 /* "unsupported file..." */)
+ Xsqlite3SetString(tls, pzErrMsg, db, ts+17967 /* "unsupported file..." */)
rc = SQLITE_ERROR
goto initone_error_out
__17:
@@ -112484,10 +114284,10 @@ __17:
// clear the legacy_file_format pragma flag so that a VACUUM will
// not downgrade the database and thus invalidate any descending
// indices that the user might have created.
- if !((iDb == 0) && (*(*int32)(unsafe.Pointer(bp + 68 /* &meta[0] */ + 1*4)) >= 4)) {
+ if !(iDb == 0 && *(*int32)(unsafe.Pointer(bp + 68 + 1*4)) >= 4) {
goto __18
}
- *(*U64)(unsafe.Pointer(db + 32 /* &.flags */)) &= (libc.CplUint64(uint64(SQLITE_LegacyFileFmt)))
+ *(*U64)(unsafe.Pointer(db + 32)) &= libc.CplUint64(uint64(SQLITE_LegacyFileFmt))
__18:
;
@@ -112496,7 +114296,7 @@ __18:
(*InitData)(unsafe.Pointer(bp + 40 /* &initData */)).FmxPage = Xsqlite3BtreeLastPage(tls, (*Db)(unsafe.Pointer(pDb)).FpBt)
zSql = Xsqlite3MPrintf(tls, db,
- ts+16714, /* "SELECT*FROM\"%w\"...." */
+ ts+17991, /* "SELECT*FROM\"%w\"...." */
libc.VaList(bp, (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+uintptr(iDb)*16)).FzDbSName, zSchemaTabName))
xAuth = (*Sqlite3)(unsafe.Pointer(db)).FxAuth
@@ -112525,10 +114325,10 @@ __20:
}
rc = SQLITE_NOMEM
Xsqlite3ResetAllSchemasOfConnection(tls, db)
- pDb = ((*Sqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*16)
+ pDb = (*Sqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*16
goto __22
__21:
- if !((rc == SQLITE_OK) || (((*Sqlite3)(unsafe.Pointer(db)).Fflags & uint64(SQLITE_NoSchemaError)) != 0)) {
+ if !(rc == SQLITE_OK || (*Sqlite3)(unsafe.Pointer(db)).Fflags&uint64(SQLITE_NoSchemaError) != 0) {
goto __23
}
// Hack: If the SQLITE_NoSchemaError flag is set, then consider
@@ -112540,7 +114340,7 @@ __21:
//
// The primary purpose of this is to allow access to the sqlite_schema
// table even when its contents have been corrupted.
- *(*U16)(unsafe.Pointer((*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer((db))).FaDb+uintptr(iDb)*16)).FpSchema + 78 /* &.schemaFlags */)) |= U16((DB_SchemaLoaded))
+ *(*U16)(unsafe.Pointer((*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+uintptr(iDb)*16)).FpSchema + 78)) |= U16(DB_SchemaLoaded)
rc = SQLITE_OK
__23:
;
@@ -112563,7 +114363,7 @@ error_out:
if !(rc != 0) {
goto __25
}
- if !((rc == SQLITE_NOMEM) || (rc == (SQLITE_IOERR | (int32(12) << 8)))) {
+ if !(rc == SQLITE_NOMEM || rc == SQLITE_IOERR|int32(12)<<8) {
goto __26
}
Xsqlite3OomFault(tls, db)
@@ -112583,24 +114383,24 @@ __25:
//
// After a database is initialized, the DB_SchemaLoaded bit is set
// bit is set in the flags field of the Db structure.
-func Xsqlite3Init(tls *libc.TLS, db uintptr, pzErrMsg uintptr) int32 { /* sqlite3.c:131480:20: */
+func Xsqlite3Init(tls *libc.TLS, db uintptr, pzErrMsg uintptr) int32 { /* sqlite3.c:132634:20: */
var i int32
var rc int32
- var commit_internal int32 = libc.BoolInt32(!(((*Sqlite3)(unsafe.Pointer(db)).FmDbFlags & U32(DBFLAG_SchemaChange)) != 0))
+ var commit_internal int32 = libc.BoolInt32(!((*Sqlite3)(unsafe.Pointer(db)).FmDbFlags&U32(DBFLAG_SchemaChange) != 0))
- ((*Sqlite3)(unsafe.Pointer(db)).Fenc) = (*Schema)(unsafe.Pointer((*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer((db))).FaDb)).FpSchema)).Fenc
+ (*Sqlite3)(unsafe.Pointer(db)).Fenc = (*Schema)(unsafe.Pointer((*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb)).FpSchema)).Fenc
// Do the main schema first
- if !((int32((*Schema)(unsafe.Pointer((*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer((db))).FaDb)).FpSchema)).FschemaFlags) & (DB_SchemaLoaded)) == (DB_SchemaLoaded)) {
+ if !(int32((*Schema)(unsafe.Pointer((*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb)).FpSchema)).FschemaFlags)&DB_SchemaLoaded == DB_SchemaLoaded) {
rc = Xsqlite3InitOne(tls, db, 0, pzErrMsg, uint32(0))
if rc != 0 {
return rc
}
}
// All other schemas after the main schema. The "temp" schema must be last
- for i = ((*Sqlite3)(unsafe.Pointer(db)).FnDb - 1); i > 0; i-- {
+ for i = (*Sqlite3)(unsafe.Pointer(db)).FnDb - 1; i > 0; i-- {
- if !((int32((*Schema)(unsafe.Pointer((*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer((db))).FaDb+uintptr(i)*16)).FpSchema)).FschemaFlags) & (DB_SchemaLoaded)) == (DB_SchemaLoaded)) {
+ if !(int32((*Schema)(unsafe.Pointer((*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+uintptr(i)*16)).FpSchema)).FschemaFlags)&DB_SchemaLoaded == DB_SchemaLoaded) {
rc = Xsqlite3InitOne(tls, db, i, pzErrMsg, uint32(0))
if rc != 0 {
return rc
@@ -112615,17 +114415,17 @@ func Xsqlite3Init(tls *libc.TLS, db uintptr, pzErrMsg uintptr) int32 { /* sqlite
// This routine is a no-op if the database schema is already initialized.
// Otherwise, the schema is loaded. An error code is returned.
-func Xsqlite3ReadSchema(tls *libc.TLS, pParse uintptr) int32 { /* sqlite3.c:131512:20: */
+func Xsqlite3ReadSchema(tls *libc.TLS, pParse uintptr) int32 { /* sqlite3.c:132666:20: */
var rc int32 = SQLITE_OK
var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb
if !(int32((*Sqlite3)(unsafe.Pointer(db)).Finit.Fbusy) != 0) {
- rc = Xsqlite3Init(tls, db, (pParse + 4 /* &.zErrMsg */))
+ rc = Xsqlite3Init(tls, db, pParse+4)
if rc != SQLITE_OK {
(*Parse)(unsafe.Pointer(pParse)).Frc = rc
(*Parse)(unsafe.Pointer(pParse)).FnErr++
} else if (*Sqlite3)(unsafe.Pointer(db)).FnoSharedCache != 0 {
- *(*U32)(unsafe.Pointer(db + 24 /* &.mDbFlags */)) |= (U32(DBFLAG_SchemaKnownOk))
+ *(*U32)(unsafe.Pointer(db + 24)) |= U32(DBFLAG_SchemaKnownOk)
}
}
return rc
@@ -112634,7 +114434,7 @@ func Xsqlite3ReadSchema(tls *libc.TLS, pParse uintptr) int32 { /* sqlite3.c:1315
// Check schema cookies in all databases. If any cookie is out
// of date set pParse->rc to SQLITE_SCHEMA. If all schema cookies
// make no changes to pParse->rc.
-func schemaIsValid(tls *libc.TLS, pParse uintptr) { /* sqlite3.c:131534:13: */
+func schemaIsValid(tls *libc.TLS, pParse uintptr) { /* sqlite3.c:132688:13: */
bp := tls.Alloc(4)
defer tls.Free(4)
@@ -112655,7 +114455,7 @@ func schemaIsValid(tls *libc.TLS, pParse uintptr) { /* sqlite3.c:131534:13: */
// will be closed immediately after reading the meta-value.
if Xsqlite3BtreeTxnState(tls, pBt) == SQLITE_TXN_NONE {
rc = Xsqlite3BtreeBeginTrans(tls, pBt, 0, uintptr(0))
- if (rc == SQLITE_NOMEM) || (rc == (SQLITE_IOERR | (int32(12) << 8))) {
+ if rc == SQLITE_NOMEM || rc == SQLITE_IOERR|int32(12)<<8 {
Xsqlite3OomFault(tls, db)
(*Parse)(unsafe.Pointer(pParse)).Frc = SQLITE_NOMEM
}
@@ -112670,7 +114470,7 @@ func schemaIsValid(tls *libc.TLS, pParse uintptr) { /* sqlite3.c:131534:13: */
// set Parse.rc to SQLITE_SCHEMA.
Xsqlite3BtreeGetMeta(tls, pBt, BTREE_SCHEMA_VERSION, bp /* &cookie */)
- if *(*int32)(unsafe.Pointer(bp /* cookie */)) != (*Schema)(unsafe.Pointer((*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+uintptr(iDb)*16)).FpSchema)).Fschema_cookie {
+ if *(*int32)(unsafe.Pointer(bp)) != (*Schema)(unsafe.Pointer((*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+uintptr(iDb)*16)).FpSchema)).Fschema_cookie {
Xsqlite3ResetOneSchema(tls, db, iDb)
(*Parse)(unsafe.Pointer(pParse)).Frc = SQLITE_SCHEMA
}
@@ -112687,7 +114487,7 @@ func schemaIsValid(tls *libc.TLS, pParse uintptr) { /* sqlite3.c:131534:13: */
//
// If the same database is attached more than once, the first
// attached database is returned.
-func Xsqlite3SchemaToIndex(tls *libc.TLS, db uintptr, pSchema uintptr) int32 { /* sqlite3.c:131584:20: */
+func Xsqlite3SchemaToIndex(tls *libc.TLS, db uintptr, pSchema uintptr) int32 { /* sqlite3.c:132738:20: */
var i int32 = -32768
// If pSchema is NULL, then return -32768. This happens when code in
@@ -112714,7 +114514,7 @@ func Xsqlite3SchemaToIndex(tls *libc.TLS, db uintptr, pSchema uintptr) int32 { /
}
// Free all memory allocations in the pParse object
-func Xsqlite3ParserReset(tls *libc.TLS, pParse uintptr) { /* sqlite3.c:131614:21: */
+func Xsqlite3ParserReset(tls *libc.TLS, pParse uintptr) { /* sqlite3.c:132768:21: */
var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb
for (*Parse)(unsafe.Pointer(pParse)).FpCleanup != 0 {
var pCleanup uintptr = (*Parse)(unsafe.Pointer(pParse)).FpCleanup
@@ -112730,7 +114530,7 @@ func Xsqlite3ParserReset(tls *libc.TLS, pParse uintptr) { /* sqlite3.c:131614:21
}
if db != 0 {
- *(*U32)(unsafe.Pointer(db + 296 /* &.lookaside */ /* &.bDisable */)) -= (U32((*Parse)(unsafe.Pointer(pParse)).FdisableLookaside))
+ *(*U32)(unsafe.Pointer(db + 320)) -= U32((*Parse)(unsafe.Pointer(pParse)).FdisableLookaside)
(*Sqlite3)(unsafe.Pointer(db)).Flookaside.Fsz = func() uint16 {
if (*Sqlite3)(unsafe.Pointer(db)).Flookaside.FbDisable != 0 {
return uint16(0)
@@ -112767,7 +114567,7 @@ func Xsqlite3ParserReset(tls *libc.TLS, pParse uintptr) { /* sqlite3.c:131614:21
// return value thereafter. Something like this:
//
// pObj = sqlite3ParserAddCleanup(pParse, destructor, pObj);
-func Xsqlite3ParserAddCleanup(tls *libc.TLS, pParse uintptr, xCleanup uintptr, pPtr uintptr) uintptr { /* sqlite3.c:131662:21: */
+func Xsqlite3ParserAddCleanup(tls *libc.TLS, pParse uintptr, xCleanup uintptr, pPtr uintptr) uintptr { /* sqlite3.c:132816:21: */
var pCleanup uintptr = Xsqlite3DbMallocRaw(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, uint64(unsafe.Sizeof(ParseCleanup{})))
if pCleanup != 0 {
(*ParseCleanup)(unsafe.Pointer(pCleanup)).FpNext = (*Parse)(unsafe.Pointer(pParse)).FpCleanup
@@ -112784,33 +114584,33 @@ func Xsqlite3ParserAddCleanup(tls *libc.TLS, pParse uintptr, xCleanup uintptr, p
}
// Compile the UTF-8 encoded SQL statement zSql into a statement handle.
-func sqlite3Prepare(tls *libc.TLS, db uintptr, zSql uintptr, nBytes int32, prepFlags U32, pReprepare uintptr, ppStmt uintptr, pzTail uintptr) int32 { /* sqlite3.c:131686:12: */
- bp := tls.Alloc(292)
- defer tls.Free(292)
+func sqlite3Prepare(tls *libc.TLS, db uintptr, zSql uintptr, nBytes int32, prepFlags U32, pReprepare uintptr, ppStmt uintptr, pzTail uintptr) int32 { /* sqlite3.c:132840:12: */
+ bp := tls.Alloc(288)
+ defer tls.Free(288)
- // var zErrMsg uintptr at bp+288, 4
+ // var zErrMsg uintptr at bp+284, 4
// Error message
var rc int32 // Result code
var i int32 // Loop counter
- // var sParse Parse at bp+16, 272
+ // var sParse Parse at bp+16, 268
var zDb uintptr
var pBt uintptr
var zSqlCopy uintptr
var mxLen int32
var pT uintptr
- *(*uintptr)(unsafe.Pointer(bp + 288 /* zErrMsg */)) = uintptr(0)
+ *(*uintptr)(unsafe.Pointer(bp + 284 /* zErrMsg */)) = uintptr(0)
rc = SQLITE_OK // Parsing context
- libc.Xmemset(tls, bp+16 /* &sParse */, 0, uint32((uintptr(0) + 148 /* &.aTempReg */)))
- libc.Xmemset(tls, ((bp + 16 /* &sParse */) + uintptr((uint32((uintptr(0) + 188 /* &.sLastToken */))))), 0, (uint32(unsafe.Sizeof(Parse{})) - (uint32((uintptr(0) + 188 /* &.sLastToken */)))))
+ libc.Xmemset(tls, bp+16 /* &sParse */, 0, uint32(uintptr(0)+144))
+ libc.Xmemset(tls, bp+16+uintptr(uint32(uintptr(0)+184)), 0, uint32(unsafe.Sizeof(Parse{}))-uint32(uintptr(0)+184))
(*Parse)(unsafe.Pointer(bp + 16 /* &sParse */)).FpReprepare = pReprepare
// assert( !db->mallocFailed ); // not true with SQLITE_USE_ALLOCA
// For a long-term use prepared statement avoid the use of
// lookaside memory.
- if !((prepFlags & U32(SQLITE_PREPARE_PERSISTENT)) != 0) {
+ if !(prepFlags&U32(SQLITE_PREPARE_PERSISTENT) != 0) {
goto __1
}
(*Parse)(unsafe.Pointer(bp+16 /* &sParse */)).FdisableLookaside++
@@ -112818,7 +114618,7 @@ func sqlite3Prepare(tls *libc.TLS, db uintptr, zSql uintptr, nBytes int32, prepF
(*Sqlite3)(unsafe.Pointer(db)).Flookaside.Fsz = U16(0)
__1:
;
- (*Parse)(unsafe.Pointer(bp + 16 /* &sParse */)).FdisableVtab = (U8(libc.Bool32((prepFlags & U32(SQLITE_PREPARE_NO_VTAB)) != U32(0))))
+ (*Parse)(unsafe.Pointer(bp + 16 /* &sParse */)).FdisableVtab = U8(libc.Bool32(prepFlags&U32(SQLITE_PREPARE_NO_VTAB) != U32(0)))
// Check to verify that it is possible to get a read lock on all
// database schemas. The inability to get a read lock indicates that
@@ -112842,7 +114642,7 @@ __1:
// Note that setting READ_UNCOMMITTED overrides most lock detection,
// but it does *not* override schema lock detection, so this all still
// works even if READ_UNCOMMITTED is set.
- if !(!(int32((*Sqlite3)(unsafe.Pointer(db)).FnoSharedCache) != 0)) {
+ if !!(int32((*Sqlite3)(unsafe.Pointer(db)).FnoSharedCache) != 0) {
goto __2
}
i = 0
@@ -112860,7 +114660,7 @@ __3:
goto __7
}
zDb = (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb + uintptr(i)*16)).FzDbSName
- Xsqlite3ErrorWithMsg(tls, db, rc, ts+16748 /* "database schema ..." */, libc.VaList(bp, zDb))
+ Xsqlite3ErrorWithMsg(tls, db, rc, ts+18025 /* "database schema ..." */, libc.VaList(bp, zDb))
goto end_prepare
__7:
@@ -112880,15 +114680,15 @@ __2:
Xsqlite3VtabUnlockList(tls, db)
(*Parse)(unsafe.Pointer(bp + 16 /* &sParse */)).Fdb = db
- if !((nBytes >= 0) && ((nBytes == 0) || (int32(*(*uint8)(unsafe.Pointer(zSql + uintptr((nBytes - 1))))) != 0))) {
+ if !(nBytes >= 0 && (nBytes == 0 || int32(*(*uint8)(unsafe.Pointer(zSql + uintptr(nBytes-1)))) != 0)) {
goto __8
}
- mxLen = *(*int32)(unsafe.Pointer((db + 112 /* &.aLimit */) + 1*4))
+ mxLen = *(*int32)(unsafe.Pointer(db + 120 + 1*4))
if !(nBytes > mxLen) {
goto __10
}
- Xsqlite3ErrorWithMsg(tls, db, SQLITE_TOOBIG, ts+16778 /* "statement too lo..." */, 0)
+ Xsqlite3ErrorWithMsg(tls, db, SQLITE_TOOBIG, ts+18055 /* "statement too lo..." */, 0)
rc = Xsqlite3ApiExit(tls, db, SQLITE_TOOBIG)
goto end_prepare
__10:
@@ -112897,17 +114697,17 @@ __10:
if !(zSqlCopy != 0) {
goto __11
}
- Xsqlite3RunParser(tls, bp+16 /* &sParse */, zSqlCopy, bp+288 /* &zErrMsg */)
- (*Parse)(unsafe.Pointer(bp + 16 /* &sParse */)).FzTail = (zSql + uintptr(((int32((*Parse)(unsafe.Pointer(bp+16 /* &sParse */)).FzTail) - int32(zSqlCopy)) / 1)))
+ Xsqlite3RunParser(tls, bp+16 /* &sParse */, zSqlCopy, bp+284 /* &zErrMsg */)
+ (*Parse)(unsafe.Pointer(bp + 16 /* &sParse */)).FzTail = zSql + uintptr((int32((*Parse)(unsafe.Pointer(bp+16)).FzTail)-int32(zSqlCopy))/1)
Xsqlite3DbFree(tls, db, zSqlCopy)
goto __12
__11:
- (*Parse)(unsafe.Pointer(bp + 16 /* &sParse */)).FzTail = (zSql + uintptr(nBytes))
+ (*Parse)(unsafe.Pointer(bp + 16 /* &sParse */)).FzTail = zSql + uintptr(nBytes)
__12:
;
goto __9
__8:
- Xsqlite3RunParser(tls, bp+16 /* &sParse */, zSql, bp+288 /* &zErrMsg */)
+ Xsqlite3RunParser(tls, bp+16 /* &sParse */, zSql, bp+284 /* &zErrMsg */)
__9:
;
@@ -112921,7 +114721,7 @@ __13:
if !(int32((*Sqlite3)(unsafe.Pointer(db)).Finit.Fbusy) == 0) {
goto __14
}
- Xsqlite3VdbeSetSql(tls, (*Parse)(unsafe.Pointer(bp+16 /* &sParse */)).FpVdbe, zSql, ((int32((*Parse)(unsafe.Pointer(bp+16 /* &sParse */)).FzTail) - int32(zSql)) / 1), uint8(prepFlags))
+ Xsqlite3VdbeSetSql(tls, (*Parse)(unsafe.Pointer(bp+16 /* &sParse */)).FpVdbe, zSql, (int32((*Parse)(unsafe.Pointer(bp+16)).FzTail)-int32(zSql))/1, uint8(prepFlags))
__14:
;
if !((*Sqlite3)(unsafe.Pointer(db)).FmallocFailed != 0) {
@@ -112931,16 +114731,16 @@ __14:
(*Parse)(unsafe.Pointer(bp + 16 /* &sParse */)).FcheckSchema = U8(0)
__15:
;
- if !(((*Parse)(unsafe.Pointer(bp+16 /* &sParse */)).Frc != SQLITE_OK) && ((*Parse)(unsafe.Pointer(bp+16 /* &sParse */)).Frc != SQLITE_DONE)) {
+ if !((*Parse)(unsafe.Pointer(bp+16)).Frc != SQLITE_OK && (*Parse)(unsafe.Pointer(bp+16)).Frc != SQLITE_DONE) {
goto __16
}
- if !((*Parse)(unsafe.Pointer(bp+16 /* &sParse */)).FcheckSchema != 0) {
+ if !((*Parse)(unsafe.Pointer(bp+16)).FcheckSchema != 0) {
goto __18
}
schemaIsValid(tls, bp+16 /* &sParse */)
__18:
;
- if !((*Parse)(unsafe.Pointer(bp+16 /* &sParse */)).FpVdbe != 0) {
+ if !((*Parse)(unsafe.Pointer(bp+16)).FpVdbe != 0) {
goto __19
}
Xsqlite3VdbeFinalize(tls, (*Parse)(unsafe.Pointer(bp+16 /* &sParse */)).FpVdbe)
@@ -112948,11 +114748,11 @@ __19:
;
rc = (*Parse)(unsafe.Pointer(bp + 16 /* &sParse */)).Frc
- if !(*(*uintptr)(unsafe.Pointer(bp + 288 /* zErrMsg */)) != 0) {
+ if !(*(*uintptr)(unsafe.Pointer(bp + 284)) != 0) {
goto __20
}
- Xsqlite3ErrorWithMsg(tls, db, rc, ts+2790 /* "%s" */, libc.VaList(bp+8, *(*uintptr)(unsafe.Pointer(bp + 288 /* zErrMsg */))))
- Xsqlite3DbFree(tls, db, *(*uintptr)(unsafe.Pointer(bp + 288 /* zErrMsg */)))
+ Xsqlite3ErrorWithMsg(tls, db, rc, ts+3601 /* "%s" */, libc.VaList(bp+8, *(*uintptr)(unsafe.Pointer(bp + 284 /* zErrMsg */))))
+ Xsqlite3DbFree(tls, db, *(*uintptr)(unsafe.Pointer(bp + 284 /* zErrMsg */)))
goto __21
__20:
Xsqlite3Error(tls, db, rc)
@@ -112969,7 +114769,7 @@ __17:
// Delete any TriggerPrg structures allocated while parsing this statement.
__22:
- if !((*Parse)(unsafe.Pointer(bp+16 /* &sParse */)).FpTriggerPrg != 0) {
+ if !((*Parse)(unsafe.Pointer(bp+16)).FpTriggerPrg != 0) {
goto __23
}
pT = (*Parse)(unsafe.Pointer(bp + 16 /* &sParse */)).FpTriggerPrg
@@ -112985,18 +114785,18 @@ end_prepare:
return rc
}
-func sqlite3LockAndPrepare(tls *libc.TLS, db uintptr, zSql uintptr, nBytes int32, prepFlags U32, pOld uintptr, ppStmt uintptr, pzTail uintptr) int32 { /* sqlite3.c:131827:12: */
+func sqlite3LockAndPrepare(tls *libc.TLS, db uintptr, zSql uintptr, nBytes int32, prepFlags U32, pOld uintptr, ppStmt uintptr, pzTail uintptr) int32 { /* sqlite3.c:132981:12: */
var rc int32
var cnt int32 = 0
*(*uintptr)(unsafe.Pointer(ppStmt)) = uintptr(0)
- if !(Xsqlite3SafetyCheckOk(tls, db) != 0) || (zSql == uintptr(0)) {
- return Xsqlite3MisuseError(tls, 131844)
+ if !(Xsqlite3SafetyCheckOk(tls, db) != 0) || zSql == uintptr(0) {
+ return Xsqlite3MisuseError(tls, 132998)
}
Xsqlite3_mutex_enter(tls, (*Sqlite3)(unsafe.Pointer(db)).Fmutex)
Xsqlite3BtreeEnterAll(tls, db)
- for ok := true; ok; ok = ((rc == (SQLITE_ERROR | (int32(2) << 8))) ||
- ((rc == SQLITE_SCHEMA) && ((func() int32 { Xsqlite3ResetOneSchema(tls, db, -1); return libc.PostIncInt32(&cnt, 1) }()) == 0))) {
+ for ok := true; ok; ok = rc == SQLITE_ERROR|int32(2)<<8 ||
+ rc == SQLITE_SCHEMA && func() int32 { Xsqlite3ResetOneSchema(tls, db, -1); return libc.PostIncInt32(&cnt, 1) }() == 0 {
// Make multiple attempts to compile the SQL, until it either succeeds
// or encounters a permanent error. A schema problem after one schema
// reset is considered a permanent error.
@@ -113017,7 +114817,7 @@ func sqlite3LockAndPrepare(tls *libc.TLS, db uintptr, zSql uintptr, nBytes int32
// if the statement cannot be recompiled because another connection has
// locked the sqlite3_schema table, return SQLITE_LOCKED. If any other error
// occurs, return SQLITE_SCHEMA.
-func Xsqlite3Reprepare(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:131873:20: */
+func Xsqlite3Reprepare(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:133027:20: */
bp := tls.Alloc(4)
defer tls.Free(4)
@@ -113056,14 +114856,14 @@ func Xsqlite3Reprepare(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:131873:20:
// sqlite3_step(). In the new version, the original SQL text is retained
// and the statement is automatically recompiled if an schema change
// occurs.
-func Xsqlite3_prepare(tls *libc.TLS, db uintptr, zSql uintptr, nBytes int32, ppStmt uintptr, pzTail uintptr) int32 { /* sqlite3.c:131912:16: */
+func Xsqlite3_prepare(tls *libc.TLS, db uintptr, zSql uintptr, nBytes int32, ppStmt uintptr, pzTail uintptr) int32 { /* sqlite3.c:133066:16: */
var rc int32
rc = sqlite3LockAndPrepare(tls, db, zSql, nBytes, uint32(0), uintptr(0), ppStmt, pzTail)
// VERIFY: F13021
return rc
}
-func Xsqlite3_prepare_v2(tls *libc.TLS, db uintptr, zSql uintptr, nBytes int32, ppStmt uintptr, pzTail uintptr) int32 { /* sqlite3.c:131924:16: */
+func Xsqlite3_prepare_v2(tls *libc.TLS, db uintptr, zSql uintptr, nBytes int32, ppStmt uintptr, pzTail uintptr) int32 { /* sqlite3.c:133078:16: */
var rc int32
// EVIDENCE-OF: R-37923-12173 The sqlite3_prepare_v2() interface works
// exactly the same as sqlite3_prepare_v3() with a zero prepFlags
@@ -113076,7 +114876,7 @@ func Xsqlite3_prepare_v2(tls *libc.TLS, db uintptr, zSql uintptr, nBytes int32,
return rc
}
-func Xsqlite3_prepare_v3(tls *libc.TLS, db uintptr, zSql uintptr, nBytes int32, prepFlags uint32, ppStmt uintptr, pzTail uintptr) int32 { /* sqlite3.c:131942:16: */
+func Xsqlite3_prepare_v3(tls *libc.TLS, db uintptr, zSql uintptr, nBytes int32, prepFlags uint32, ppStmt uintptr, pzTail uintptr) int32 { /* sqlite3.c:133096:16: */
var rc int32
// EVIDENCE-OF: R-56861-42673 sqlite3_prepare_v3() differs from
// sqlite3_prepare_v2() only in having the extra prepFlags parameter,
@@ -113086,14 +114886,14 @@ func Xsqlite3_prepare_v3(tls *libc.TLS, db uintptr, zSql uintptr, nBytes int32,
// Proof by comparison to the implementation of sqlite3_prepare_v2()
// directly above.
rc = sqlite3LockAndPrepare(tls, db, zSql, nBytes,
- (uint32(SQLITE_PREPARE_SAVESQL) | (prepFlags & uint32(SQLITE_PREPARE_MASK))),
+ uint32(SQLITE_PREPARE_SAVESQL)|prepFlags&uint32(SQLITE_PREPARE_MASK),
uintptr(0), ppStmt, pzTail)
return rc
}
// Compile the UTF-16 encoded SQL statement zSql into a statement handle.
-func sqlite3Prepare16(tls *libc.TLS, db uintptr, zSql uintptr, nBytes int32, prepFlags U32, ppStmt uintptr, pzTail uintptr) int32 { /* sqlite3.c:131970:12: */
+func sqlite3Prepare16(tls *libc.TLS, db uintptr, zSql uintptr, nBytes int32, prepFlags U32, ppStmt uintptr, pzTail uintptr) int32 { /* sqlite3.c:133124:12: */
bp := tls.Alloc(4)
defer tls.Free(4)
@@ -113105,13 +114905,13 @@ func sqlite3Prepare16(tls *libc.TLS, db uintptr, zSql uintptr, nBytes int32, pre
var rc int32 = SQLITE_OK
*(*uintptr)(unsafe.Pointer(ppStmt)) = uintptr(0)
- if !(Xsqlite3SafetyCheckOk(tls, db) != 0) || (zSql == uintptr(0)) {
- return Xsqlite3MisuseError(tls, 131991)
+ if !(Xsqlite3SafetyCheckOk(tls, db) != 0) || zSql == uintptr(0) {
+ return Xsqlite3MisuseError(tls, 133145)
}
if nBytes >= 0 {
var sz int32
var z uintptr = zSql
- for sz = 0; (sz < nBytes) && ((int32(*(*uint8)(unsafe.Pointer(z + uintptr(sz)))) != 0) || (int32(*(*uint8)(unsafe.Pointer(z + uintptr((sz + 1))))) != 0)); sz = sz + (2) {
+ for sz = 0; sz < nBytes && (int32(*(*uint8)(unsafe.Pointer(z + uintptr(sz)))) != 0 || int32(*(*uint8)(unsafe.Pointer(z + uintptr(sz+1)))) != 0); sz = sz + 2 {
}
nBytes = sz
}
@@ -113121,13 +114921,13 @@ func sqlite3Prepare16(tls *libc.TLS, db uintptr, zSql uintptr, nBytes int32, pre
rc = sqlite3LockAndPrepare(tls, db, zSql8, -1, prepFlags, uintptr(0), ppStmt, bp /* &zTail8 */)
}
- if (*(*uintptr)(unsafe.Pointer(bp /* zTail8 */)) != 0) && (pzTail != 0) {
+ if *(*uintptr)(unsafe.Pointer(bp)) != 0 && pzTail != 0 {
// If sqlite3_prepare returns a tail pointer, we calculate the
// equivalent pointer into the UTF-16 string by counting the unicode
// characters between zSql8 and zTail8, and then returning a pointer
// the same number of characters into the UTF-16 string.
- var chars_parsed int32 = Xsqlite3Utf8CharLen(tls, zSql8, ((int32(*(*uintptr)(unsafe.Pointer(bp /* zTail8 */))) - int32(zSql8)) / 1))
- *(*uintptr)(unsafe.Pointer(pzTail)) = (zSql + uintptr(Xsqlite3Utf16ByteLen(tls, zSql, chars_parsed)))
+ var chars_parsed int32 = Xsqlite3Utf8CharLen(tls, zSql8, (int32(*(*uintptr)(unsafe.Pointer(bp)))-int32(zSql8))/1)
+ *(*uintptr)(unsafe.Pointer(pzTail)) = zSql + uintptr(Xsqlite3Utf16ByteLen(tls, zSql, chars_parsed))
}
Xsqlite3DbFree(tls, db, zSql8)
rc = Xsqlite3ApiExit(tls, db, rc)
@@ -113141,24 +114941,24 @@ func sqlite3Prepare16(tls *libc.TLS, db uintptr, zSql uintptr, nBytes int32, pre
// sqlite3_step(). In the new version, the original SQL text is retained
// and the statement is automatically recompiled if an schema change
// occurs.
-func Xsqlite3_prepare16(tls *libc.TLS, db uintptr, zSql uintptr, nBytes int32, ppStmt uintptr, pzTail uintptr) int32 { /* sqlite3.c:132028:16: */
+func Xsqlite3_prepare16(tls *libc.TLS, db uintptr, zSql uintptr, nBytes int32, ppStmt uintptr, pzTail uintptr) int32 { /* sqlite3.c:133182:16: */
var rc int32
rc = sqlite3Prepare16(tls, db, zSql, nBytes, uint32(0), ppStmt, pzTail)
// VERIFY: F13021
return rc
}
-func Xsqlite3_prepare16_v2(tls *libc.TLS, db uintptr, zSql uintptr, nBytes int32, ppStmt uintptr, pzTail uintptr) int32 { /* sqlite3.c:132040:16: */
+func Xsqlite3_prepare16_v2(tls *libc.TLS, db uintptr, zSql uintptr, nBytes int32, ppStmt uintptr, pzTail uintptr) int32 { /* sqlite3.c:133194:16: */
var rc int32
rc = sqlite3Prepare16(tls, db, zSql, nBytes, uint32(SQLITE_PREPARE_SAVESQL), ppStmt, pzTail)
// VERIFY: F13021
return rc
}
-func Xsqlite3_prepare16_v3(tls *libc.TLS, db uintptr, zSql uintptr, nBytes int32, prepFlags uint32, ppStmt uintptr, pzTail uintptr) int32 { /* sqlite3.c:132052:16: */
+func Xsqlite3_prepare16_v3(tls *libc.TLS, db uintptr, zSql uintptr, nBytes int32, prepFlags uint32, ppStmt uintptr, pzTail uintptr) int32 { /* sqlite3.c:133206:16: */
var rc int32
rc = sqlite3Prepare16(tls, db, zSql, nBytes,
- (uint32(SQLITE_PREPARE_SAVESQL) | (prepFlags & uint32(SQLITE_PREPARE_MASK))),
+ uint32(SQLITE_PREPARE_SAVESQL)|prepFlags&uint32(SQLITE_PREPARE_MASK),
ppStmt, pzTail)
// VERIFY: F13021
return rc
@@ -113189,7 +114989,7 @@ type DistinctCtx1 = struct {
F__ccgo_pad1 [2]byte
FtabTnct int32
FaddrTnct int32
-} /* sqlite3.c:132093:9 */
+} /* sqlite3.c:133247:9 */
//************* End of prepare.c ********************************************
//************* Begin file select.c *****************************************
@@ -113210,7 +115010,7 @@ type DistinctCtx1 = struct {
// An instance of the following object is used to record information about
// how to process the DISTINCT keyword, to simplify passing that information
// into the selectInnerLoop() routine.
-type DistinctCtx = DistinctCtx1 /* sqlite3.c:132093:28 */
+type DistinctCtx = DistinctCtx1 /* sqlite3.c:133247:28 */
// An instance of the following object is used to record information about
// the ORDER BY (or GROUP BY) clause of query is being coded.
@@ -113240,7 +115040,7 @@ type SortCtx1 = struct {
FsortFlags U8
F__ccgo_pad1 [3]byte
FpDeferredRowLoad uintptr
-} /* sqlite3.c:132119:9 */
+} /* sqlite3.c:133273:9 */
// An instance of the following object is used to record information about
// the ORDER BY (or GROUP BY) clause of query is being coded.
@@ -113258,19 +115058,19 @@ type SortCtx1 = struct {
// When the sorter-reference optimization is used, there is one entry in the
// aDefer[] array for each database table that may be read as values are
// extracted from the sorter.
-type SortCtx = SortCtx1 /* sqlite3.c:132119:24 */
+type SortCtx = SortCtx1 /* sqlite3.c:133273:24 */
type RowLoadInfo1 = struct {
FregResult int32
FecelFlags U8
F__ccgo_pad1 [3]byte
-} /* sqlite3.c:132119:9 */
+} /* sqlite3.c:133273:9 */
// Delete all the content of a Select structure. Deallocate the structure
// itself depending on the value of bFree
//
// If bFree==1, call sqlite3DbFree() on the p object.
// If bFree==0, Leave the first Select object unfreed
-func clearSelect(tls *libc.TLS, db uintptr, p uintptr, bFree int32) { /* sqlite3.c:132149:13: */
+func clearSelect(tls *libc.TLS, db uintptr, p uintptr, bFree int32) { /* sqlite3.c:133303:13: */
for p != 0 {
var pPrior uintptr = (*Select)(unsafe.Pointer(p)).FpPrior
Xsqlite3ExprListDelete(tls, db, (*Select)(unsafe.Pointer(p)).FpEList)
@@ -113299,7 +115099,7 @@ func clearSelect(tls *libc.TLS, db uintptr, p uintptr, bFree int32) { /* sqlite3
}
// Initialize a SelectDest structure.
-func Xsqlite3SelectDestInit(tls *libc.TLS, pDest uintptr, eDest int32, iParm int32) { /* sqlite3.c:132178:21: */
+func Xsqlite3SelectDestInit(tls *libc.TLS, pDest uintptr, eDest int32, iParm int32) { /* sqlite3.c:133332:21: */
(*SelectDest)(unsafe.Pointer(pDest)).FeDest = U8(eDest)
(*SelectDest)(unsafe.Pointer(pDest)).FiSDParm = iParm
(*SelectDest)(unsafe.Pointer(pDest)).FiSDParm2 = 0
@@ -113310,7 +115110,7 @@ func Xsqlite3SelectDestInit(tls *libc.TLS, pDest uintptr, eDest int32, iParm int
// Allocate a new Select structure and return a pointer to that
// structure.
-func Xsqlite3SelectNew(tls *libc.TLS, pParse uintptr, pEList uintptr, pSrc uintptr, pWhere uintptr, pGroupBy uintptr, pHaving uintptr, pOrderBy uintptr, selFlags U32, pLimit uintptr) uintptr { /* sqlite3.c:132192:23: */
+func Xsqlite3SelectNew(tls *libc.TLS, pParse uintptr, pEList uintptr, pSrc uintptr, pWhere uintptr, pGroupBy uintptr, pHaving uintptr, pOrderBy uintptr, selFlags U32, pLimit uintptr) uintptr { /* sqlite3.c:133346:23: */
bp := tls.Alloc(76)
defer tls.Free(76)
@@ -113333,8 +115133,8 @@ func Xsqlite3SelectNew(tls *libc.TLS, pParse uintptr, pEList uintptr, pSrc uintp
(*Select)(unsafe.Pointer(pNew)).FiLimit = 0
(*Select)(unsafe.Pointer(pNew)).FiOffset = 0
(*Select)(unsafe.Pointer(pNew)).FselId = U32(libc.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnSelect, 1))
- *(*int32)(unsafe.Pointer((pNew + 20 /* &.addrOpenEphm */))) = -1
- *(*int32)(unsafe.Pointer((pNew + 20 /* &.addrOpenEphm */) + 1*4)) = -1
+ *(*int32)(unsafe.Pointer(pNew + 20)) = -1
+ *(*int32)(unsafe.Pointer(pNew + 20 + 1*4)) = -1
(*Select)(unsafe.Pointer(pNew)).FnSelectRow = int16(0)
if pSrc == uintptr(0) {
pSrc = Xsqlite3DbMallocZero(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, uint64(unsafe.Sizeof(SrcList{})))
@@ -113351,7 +115151,7 @@ func Xsqlite3SelectNew(tls *libc.TLS, pParse uintptr, pEList uintptr, pSrc uintp
(*Select)(unsafe.Pointer(pNew)).FpWin = uintptr(0)
(*Select)(unsafe.Pointer(pNew)).FpWinDefn = uintptr(0)
if (*Sqlite3)(unsafe.Pointer((*Parse)(unsafe.Pointer(pParse)).Fdb)).FmallocFailed != 0 {
- clearSelect(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, pNew, (libc.Bool32(pNew != bp /* &standin */)))
+ clearSelect(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, pNew, libc.Bool32(pNew != bp))
pAllocated = uintptr(0)
} else {
@@ -113360,14 +115160,14 @@ func Xsqlite3SelectNew(tls *libc.TLS, pParse uintptr, pEList uintptr, pSrc uintp
}
// Delete the given Select structure and all of its substructures.
-func Xsqlite3SelectDelete(tls *libc.TLS, db uintptr, p uintptr) { /* sqlite3.c:132250:21: */
+func Xsqlite3SelectDelete(tls *libc.TLS, db uintptr, p uintptr) { /* sqlite3.c:133404:21: */
if p != 0 {
clearSelect(tls, db, p, 1)
}
}
// Return a pointer to the right-most SELECT statement in a compound.
-func findRightmost(tls *libc.TLS, p uintptr) uintptr { /* sqlite3.c:132257:15: */
+func findRightmost(tls *libc.TLS, p uintptr) uintptr { /* sqlite3.c:133411:15: */
for (*Select)(unsafe.Pointer(p)).FpNext != 0 {
p = (*Select)(unsafe.Pointer(p)).FpNext
}
@@ -113389,7 +115189,7 @@ func findRightmost(tls *libc.TLS, p uintptr) uintptr { /* sqlite3.c:132257:15: *
//
// If an illegal or unsupported join type is seen, then still return
// a join type, but put an error in the pParse structure.
-func Xsqlite3JoinType(tls *libc.TLS, pParse uintptr, pA uintptr, pB uintptr, pC uintptr) int32 { /* sqlite3.c:132279:20: */
+func Xsqlite3JoinType(tls *libc.TLS, pParse uintptr, pA uintptr, pB uintptr, pC uintptr) int32 { /* sqlite3.c:133433:20: */
bp := tls.Alloc(44)
defer tls.Free(44)
@@ -113402,65 +115202,65 @@ func Xsqlite3JoinType(tls *libc.TLS, pParse uintptr, pA uintptr, pB uintptr, pC
*(*uintptr)(unsafe.Pointer(bp + 32 /* &apAll[0] */)) = pA
*(*uintptr)(unsafe.Pointer(bp + 32 /* &apAll[0] */ + 1*4)) = pB
*(*uintptr)(unsafe.Pointer(bp + 32 /* &apAll[0] */ + 2*4)) = pC
- for i = 0; (i < 3) && (*(*uintptr)(unsafe.Pointer(bp + 32 /* &apAll[0] */ + uintptr(i)*4)) != 0); i++ {
+ for i = 0; i < 3 && *(*uintptr)(unsafe.Pointer(bp + 32 /* &apAll[0] */ + uintptr(i)*4)) != 0; i++ {
p = *(*uintptr)(unsafe.Pointer(bp + 32 /* &apAll[0] */ + uintptr(i)*4))
- for j = 0; j < (int32(uint32(unsafe.Sizeof(aKeyword)) / uint32(unsafe.Sizeof(struct {
+ for j = 0; j < int32(uint32(unsafe.Sizeof(aKeyword))/uint32(unsafe.Sizeof(struct {
Fi U8
FnChar U8
Fcode U8
- }{})))); j++ {
- if ((*Token)(unsafe.Pointer(p)).Fn == uint32(aKeyword[j].FnChar)) &&
- (Xsqlite3_strnicmp(tls, (*Token)(unsafe.Pointer(p)).Fz, (uintptr(unsafe.Pointer(&zKeyText))+uintptr(aKeyword[j].Fi)), int32((*Token)(unsafe.Pointer(p)).Fn)) == 0) {
- jointype = jointype | (int32(aKeyword[j].Fcode))
+ }{}))); j++ {
+ if (*Token)(unsafe.Pointer(p)).Fn == uint32(aKeyword[j].FnChar) &&
+ Xsqlite3_strnicmp(tls, (*Token)(unsafe.Pointer(p)).Fz, uintptr(unsafe.Pointer(&zKeyText))+uintptr(aKeyword[j].Fi), int32((*Token)(unsafe.Pointer(p)).Fn)) == 0 {
+ jointype = jointype | int32(aKeyword[j].Fcode)
break
}
}
- if j >= (int32(uint32(unsafe.Sizeof(aKeyword)) / uint32(unsafe.Sizeof(struct {
+ if j >= int32(uint32(unsafe.Sizeof(aKeyword))/uint32(unsafe.Sizeof(struct {
Fi U8
FnChar U8
Fcode U8
- }{})))) {
- jointype = jointype | (JT_ERROR)
+ }{}))) {
+ jointype = jointype | JT_ERROR
break
}
}
- if ((jointype & (JT_INNER | JT_OUTER)) == (JT_INNER | JT_OUTER)) || ((jointype & JT_ERROR) != 0) {
- var zSp uintptr = ts + 9652 /* " " */
+ if jointype&(JT_INNER|JT_OUTER) == JT_INNER|JT_OUTER || jointype&JT_ERROR != 0 {
+ var zSp uintptr = ts + 10766 /* " " */
if pC == uintptr(0) {
zSp++
}
Xsqlite3ErrorMsg(tls, pParse,
- ts+16797 /* "unknown or unsup..." */, libc.VaList(bp, pA, pB, zSp, pC))
+ ts+18074 /* "unknown or unsup..." */, libc.VaList(bp, pA, pB, zSp, pC))
jointype = JT_INNER
- } else if ((jointype & JT_OUTER) != 0) &&
- ((jointype & (JT_LEFT | JT_RIGHT)) != JT_LEFT) {
+ } else if jointype&JT_OUTER != 0 &&
+ jointype&(JT_LEFT|JT_RIGHT) != JT_LEFT {
Xsqlite3ErrorMsg(tls, pParse,
- ts+16841 /* "RIGHT and FULL O..." */, 0)
+ ts+18118 /* "RIGHT and FULL O..." */, 0)
jointype = JT_INNER
}
return jointype
}
-var zKeyText = *(*[34]uint8)(unsafe.Pointer(ts + 16896 /* "naturaleftouteri..." */)) /* sqlite3.c:132284:21 */
+var zKeyText = *(*[34]uint8)(unsafe.Pointer(ts + 18173 /* "naturaleftouteri..." */)) /* sqlite3.c:133438:21 */
var aKeyword = [7]struct {
Fi U8
FnChar U8
Fcode U8
}{
/* natural */ {FnChar: U8(7), Fcode: U8(JT_NATURAL)},
- /* left */ {Fi: U8(6), FnChar: U8(4), Fcode: (U8(JT_LEFT | JT_OUTER))},
+ /* left */ {Fi: U8(6), FnChar: U8(4), Fcode: U8(JT_LEFT | JT_OUTER)},
/* outer */ {Fi: U8(10), FnChar: U8(5), Fcode: U8(JT_OUTER)},
- /* right */ {Fi: U8(14), FnChar: U8(5), Fcode: (U8(JT_RIGHT | JT_OUTER))},
- /* full */ {Fi: U8(19), FnChar: U8(4), Fcode: (U8((JT_LEFT | JT_RIGHT) | JT_OUTER))},
+ /* right */ {Fi: U8(14), FnChar: U8(5), Fcode: U8(JT_RIGHT | JT_OUTER)},
+ /* full */ {Fi: U8(19), FnChar: U8(4), Fcode: U8(JT_LEFT | JT_RIGHT | JT_OUTER)},
/* inner */ {Fi: U8(23), FnChar: U8(5), Fcode: U8(JT_INNER)},
- /* cross */ {Fi: U8(28), FnChar: U8(5), Fcode: (U8(JT_INNER | JT_CROSS))},
-} /* sqlite3.c:132289:5 */
+ /* cross */ {Fi: U8(28), FnChar: U8(5), Fcode: U8(JT_INNER | JT_CROSS)},
+} /* sqlite3.c:133443:5 */
// Return the index of a column in a table. Return -1 if the column
// is not contained in the table.
-func Xsqlite3ColumnIndex(tls *libc.TLS, pTab uintptr, zCol uintptr) int32 { /* sqlite3.c:132340:20: */
+func Xsqlite3ColumnIndex(tls *libc.TLS, pTab uintptr, zCol uintptr) int32 { /* sqlite3.c:133494:20: */
var i int32
var h U8 = Xsqlite3StrIHash(tls, zCol)
var pCol uintptr
@@ -113471,14 +115271,14 @@ __1:
goto __3
}
{
- if (int32((*Column)(unsafe.Pointer(pCol)).FhName) == int32(h)) && (Xsqlite3StrICmp(tls, (*Column)(unsafe.Pointer(pCol)).FzName, zCol) == 0) {
+ if int32((*Column)(unsafe.Pointer(pCol)).FhName) == int32(h) && Xsqlite3StrICmp(tls, (*Column)(unsafe.Pointer(pCol)).FzCnName, zCol) == 0 {
return i
}
}
goto __2
__2:
- pCol += 20
+ pCol += 16
i++
goto __1
goto __3
@@ -113494,15 +115294,15 @@ __3:
// of the matching column and return TRUE.
//
// If not found, return FALSE.
-func tableAndColumnIndex(tls *libc.TLS, pSrc uintptr, N int32, zCol uintptr, piTab uintptr, piCol uintptr, bIgnoreHidden int32) int32 { /* sqlite3.c:132359:12: */
+func tableAndColumnIndex(tls *libc.TLS, pSrc uintptr, N int32, zCol uintptr, piTab uintptr, piCol uintptr, bIgnoreHidden int32) int32 { /* sqlite3.c:133513:12: */
var i int32 // For looping over tables in pSrc
var iCol int32 // Index of column matching zCol
// Both or neither are NULL
for i = 0; i < N; i++ {
- iCol = Xsqlite3ColumnIndex(tls, (*SrcItem)(unsafe.Pointer((pSrc+8 /* &.a */)+uintptr(i)*72)).FpTab, zCol)
- if (iCol >= 0) &&
- ((bIgnoreHidden == 0) || ((libc.Bool32((int32((*Column)(unsafe.Pointer(((*Table)(unsafe.Pointer((*SrcItem)(unsafe.Pointer((pSrc+8 /* &.a */)+uintptr(i)*72)).FpTab)).FaCol + uintptr(iCol)*20))).FcolFlags) & COLFLAG_HIDDEN) != 0)) == 0)) {
+ iCol = Xsqlite3ColumnIndex(tls, (*SrcItem)(unsafe.Pointer(pSrc+8+uintptr(i)*72)).FpTab, zCol)
+ if iCol >= 0 &&
+ (bIgnoreHidden == 0 || libc.Bool32(int32((*Column)(unsafe.Pointer((*Table)(unsafe.Pointer((*SrcItem)(unsafe.Pointer(pSrc+8+uintptr(i)*72)).FpTab)).FaCol+uintptr(iCol)*16)).FcolFlags)&COLFLAG_HIDDEN != 0) == 0) {
if piTab != 0 {
*(*int32)(unsafe.Pointer(piTab)) = i
*(*int32)(unsafe.Pointer(piCol)) = iCol
@@ -113522,7 +115322,7 @@ func tableAndColumnIndex(tls *libc.TLS, pSrc uintptr, N int32, zCol uintptr, piT
// where tab1 is the iSrc'th table in SrcList pSrc and tab2 is the
// (iSrc+1)'th. Column col1 is column iColLeft of tab1, and col2 is
// column iColRight of tab2.
-func addWhereTerm(tls *libc.TLS, pParse uintptr, pSrc uintptr, iLeft int32, iColLeft int32, iRight int32, iColRight int32, isOuterJoin int32, ppWhere uintptr) { /* sqlite3.c:132397:13: */
+func addWhereTerm(tls *libc.TLS, pParse uintptr, pSrc uintptr, iLeft int32, iColLeft int32, iRight int32, iColRight int32, isOuterJoin int32, ppWhere uintptr) { /* sqlite3.c:133551:13: */
var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb
var pE1 uintptr
var pE2 uintptr
@@ -113532,8 +115332,11 @@ func addWhereTerm(tls *libc.TLS, pParse uintptr, pSrc uintptr, iLeft int32, iCol
pE2 = Xsqlite3CreateColumnExpr(tls, db, pSrc, iRight, iColRight)
pEq = Xsqlite3PExpr(tls, pParse, TK_EQ, pE1, pE2)
- if (pEq != 0) && (isOuterJoin != 0) {
- *(*U32)(unsafe.Pointer(pEq + 4 /* &.flags */)) |= (U32(EP_FromJoin))
+ // Due to db->mallocFailed test
+ // in sqlite3DbMallocRawNN() called from
+ // sqlite3PExpr().
+ if pEq != 0 && isOuterJoin != 0 {
+ *(*U32)(unsafe.Pointer(pEq + 4)) |= U32(EP_FromJoin)
(*Expr)(unsafe.Pointer(pEq)).FiRightJoinTable = (*Expr)(unsafe.Pointer(pE2)).FiTable
}
@@ -113564,15 +115367,18 @@ func addWhereTerm(tls *libc.TLS, pParse uintptr, pSrc uintptr, iLeft int32, iCol
// defer the handling of t1.x=5, it will be processed immediately
// after the t1 loop and rows with t1.x!=5 will never appear in
// the output, which is incorrect.
-func Xsqlite3SetJoinExpr(tls *libc.TLS, p uintptr, iTable int32) { /* sqlite3.c:132456:21: */
+func Xsqlite3SetJoinExpr(tls *libc.TLS, p uintptr, iTable int32) { /* sqlite3.c:133613:21: */
for p != 0 {
- *(*U32)(unsafe.Pointer(p + 4 /* &.flags */)) |= (U32(EP_FromJoin))
+ *(*U32)(unsafe.Pointer(p + 4)) |= U32(EP_FromJoin)
(*Expr)(unsafe.Pointer(p)).FiRightJoinTable = iTable
- if (int32((*Expr)(unsafe.Pointer(p)).Fop) == TK_FUNCTION) && (*(*uintptr)(unsafe.Pointer(p + 20 /* &.x */)) != 0) {
- var i int32
- for i = 0; i < (*ExprList)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(p + 20 /* &.x */)))).FnExpr; i++ {
- Xsqlite3SetJoinExpr(tls, (*ExprList_item)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(p + 20 /* &.x */))+8 /* &.a */)+uintptr(i)*20)).FpExpr, iTable)
+ if int32((*Expr)(unsafe.Pointer(p)).Fop) == TK_FUNCTION {
+
+ if *(*uintptr)(unsafe.Pointer(p + 20)) != 0 {
+ var i int32
+ for i = 0; i < (*ExprList)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(p + 20 /* &.x */)))).FnExpr; i++ {
+ Xsqlite3SetJoinExpr(tls, (*ExprList_item)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(p + 20))+8+uintptr(i)*20)).FpExpr, iTable)
+ }
}
}
Xsqlite3SetJoinExpr(tls, (*Expr)(unsafe.Pointer(p)).FpLeft, iTable)
@@ -113585,19 +115391,22 @@ func Xsqlite3SetJoinExpr(tls *libc.TLS, p uintptr, iTable int32) { /* sqlite3.c:
// an ordinary term that omits the EP_FromJoin mark.
//
// This happens when a LEFT JOIN is simplified into an ordinary JOIN.
-func unsetJoinExpr(tls *libc.TLS, p uintptr, iTable int32) { /* sqlite3.c:132479:13: */
+func unsetJoinExpr(tls *libc.TLS, p uintptr, iTable int32) { /* sqlite3.c:133639:13: */
for p != 0 {
- if (((*Expr)(unsafe.Pointer((p))).Fflags & (U32(EP_FromJoin))) != U32(0)) &&
- ((iTable < 0) || ((*Expr)(unsafe.Pointer(p)).FiRightJoinTable == iTable)) {
- *(*U32)(unsafe.Pointer(p + 4 /* &.flags */)) &= (libc.Uint32FromInt32(libc.CplInt32(EP_FromJoin)))
+ if (*Expr)(unsafe.Pointer(p)).Fflags&U32(EP_FromJoin) != U32(0) &&
+ (iTable < 0 || (*Expr)(unsafe.Pointer(p)).FiRightJoinTable == iTable) {
+ *(*U32)(unsafe.Pointer(p + 4)) &= libc.Uint32FromInt32(libc.CplInt32(EP_FromJoin))
}
- if (int32((*Expr)(unsafe.Pointer(p)).Fop) == TK_COLUMN) && ((*Expr)(unsafe.Pointer(p)).FiTable == iTable) {
- *(*U32)(unsafe.Pointer(p + 4 /* &.flags */)) &= (libc.Uint32FromInt32(libc.CplInt32(EP_CanBeNull)))
+ if int32((*Expr)(unsafe.Pointer(p)).Fop) == TK_COLUMN && (*Expr)(unsafe.Pointer(p)).FiTable == iTable {
+ *(*U32)(unsafe.Pointer(p + 4)) &= libc.Uint32FromInt32(libc.CplInt32(EP_CanBeNull))
}
- if (int32((*Expr)(unsafe.Pointer(p)).Fop) == TK_FUNCTION) && (*(*uintptr)(unsafe.Pointer(p + 20 /* &.x */)) != 0) {
- var i int32
- for i = 0; i < (*ExprList)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(p + 20 /* &.x */)))).FnExpr; i++ {
- unsetJoinExpr(tls, (*ExprList_item)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(p + 20 /* &.x */))+8 /* &.a */)+uintptr(i)*20)).FpExpr, iTable)
+ if int32((*Expr)(unsafe.Pointer(p)).Fop) == TK_FUNCTION {
+
+ if *(*uintptr)(unsafe.Pointer(p + 20)) != 0 {
+ var i int32
+ for i = 0; i < (*ExprList)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(p + 20 /* &.x */)))).FnExpr; i++ {
+ unsetJoinExpr(tls, (*ExprList_item)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(p + 20))+8+uintptr(i)*20)).FpExpr, iTable)
+ }
}
}
unsetJoinExpr(tls, (*Expr)(unsafe.Pointer(p)).FpLeft, iTable)
@@ -113617,7 +115426,7 @@ func unsetJoinExpr(tls *libc.TLS, p uintptr, iTable int32) { /* sqlite3.c:132479
// also attached to the left entry.
//
// This routine returns the number of errors encountered.
-func sqliteProcessJoin(tls *libc.TLS, pParse uintptr, p uintptr) int32 { /* sqlite3.c:132513:12: */
+func sqliteProcessJoin(tls *libc.TLS, pParse uintptr, p uintptr) int32 { /* sqlite3.c:133676:12: */
bp := tls.Alloc(32)
defer tls.Free(32)
@@ -113628,28 +115437,28 @@ func sqliteProcessJoin(tls *libc.TLS, pParse uintptr, p uintptr) int32 { /* sqli
var pRight uintptr // Right table being joined
pSrc = (*Select)(unsafe.Pointer(p)).FpSrc
- pLeft = (pSrc + 8 /* &.a */)
- pRight = (pLeft + 1*72)
+ pLeft = pSrc + 8
+ pRight = pLeft + 1*72
i = 0
__1:
- if !(i < ((*SrcList)(unsafe.Pointer(pSrc)).FnSrc - 1)) {
+ if !(i < (*SrcList)(unsafe.Pointer(pSrc)).FnSrc-1) {
goto __3
}
{
var pRightTab uintptr = (*SrcItem)(unsafe.Pointer(pRight)).FpTab
var isOuter int32
- if ((*SrcItem)(unsafe.Pointer(pLeft)).FpTab == uintptr(0)) || (pRightTab == uintptr(0)) {
+ if (*SrcItem)(unsafe.Pointer(pLeft)).FpTab == uintptr(0) || pRightTab == uintptr(0) {
goto __2
}
- isOuter = (libc.Bool32((int32((*SrcItem)(unsafe.Pointer(pRight)).Ffg.Fjointype) & JT_OUTER) != 0))
+ isOuter = libc.Bool32(int32((*SrcItem)(unsafe.Pointer(pRight)).Ffg.Fjointype)&JT_OUTER != 0)
// When the NATURAL keyword is present, add WHERE clause terms for
// every column that the two tables have in common.
- if (int32((*SrcItem)(unsafe.Pointer(pRight)).Ffg.Fjointype) & JT_NATURAL) != 0 {
- if ((*SrcItem)(unsafe.Pointer(pRight)).FpOn != 0) || ((*SrcItem)(unsafe.Pointer(pRight)).FpUsing != 0) {
+ if int32((*SrcItem)(unsafe.Pointer(pRight)).Ffg.Fjointype)&JT_NATURAL != 0 {
+ if (*SrcItem)(unsafe.Pointer(pRight)).FpOn != 0 || (*SrcItem)(unsafe.Pointer(pRight)).FpUsing != 0 {
Xsqlite3ErrorMsg(tls, pParse,
- ts+16930 /* "a NATURAL join m..." */, libc.VaList(bp, 0))
+ ts+18207 /* "a NATURAL join m..." */, libc.VaList(bp, 0))
return 1
}
for j = 0; j < int32((*Table)(unsafe.Pointer(pRightTab)).FnCol); j++ {
@@ -113659,21 +115468,21 @@ __1:
// var iLeftCol int32 at bp+20, 4
// Matching column in the left table
- if (int32((*Column)(unsafe.Pointer(((*Table)(unsafe.Pointer(pRightTab)).FaCol + uintptr(j)*20))).FcolFlags) & COLFLAG_HIDDEN) != 0 {
+ if int32((*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pRightTab)).FaCol+uintptr(j)*16)).FcolFlags)&COLFLAG_HIDDEN != 0 {
continue
}
- zName = (*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pRightTab)).FaCol + uintptr(j)*20)).FzName
- if tableAndColumnIndex(tls, pSrc, (i+1), zName, bp+16 /* &iLeft */, bp+20 /* &iLeftCol */, 1) != 0 {
- addWhereTerm(tls, pParse, pSrc, *(*int32)(unsafe.Pointer(bp + 16 /* iLeft */)), *(*int32)(unsafe.Pointer(bp + 20 /* iLeftCol */)), (i + 1), j,
- isOuter, (p + 36 /* &.pWhere */))
+ zName = (*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pRightTab)).FaCol + uintptr(j)*16)).FzCnName
+ if tableAndColumnIndex(tls, pSrc, i+1, zName, bp+16, bp+20, 1) != 0 {
+ addWhereTerm(tls, pParse, pSrc, *(*int32)(unsafe.Pointer(bp + 16 /* iLeft */)), *(*int32)(unsafe.Pointer(bp + 20 /* iLeftCol */)), i+1, j,
+ isOuter, p+36)
}
}
}
// Disallow both ON and USING clauses in the same join
- if ((*SrcItem)(unsafe.Pointer(pRight)).FpOn != 0) && ((*SrcItem)(unsafe.Pointer(pRight)).FpUsing != 0) {
+ if (*SrcItem)(unsafe.Pointer(pRight)).FpOn != 0 && (*SrcItem)(unsafe.Pointer(pRight)).FpUsing != 0 {
Xsqlite3ErrorMsg(tls, pParse,
- ts+16980 /* "cannot have both..." */, 0)
+ ts+18257 /* "cannot have both..." */, 0)
return 1
}
@@ -113705,14 +115514,14 @@ __1:
zName = (*IdList_item)(unsafe.Pointer((*IdList)(unsafe.Pointer(pList)).Fa + uintptr(j)*8)).FzName
iRightCol = Xsqlite3ColumnIndex(tls, pRightTab, zName)
- if (iRightCol < 0) ||
- !(tableAndColumnIndex(tls, pSrc, (i+1), zName, bp+24 /* &iLeft */, bp+28 /* &iLeftCol */, 0) != 0) {
+ if iRightCol < 0 ||
+ !(tableAndColumnIndex(tls, pSrc, i+1, zName, bp+24, bp+28, 0) != 0) {
Xsqlite3ErrorMsg(tls, pParse,
- ts+17035 /* "cannot join usin..." */, libc.VaList(bp+8, zName))
+ ts+18312 /* "cannot join usin..." */, libc.VaList(bp+8, zName))
return 1
}
- addWhereTerm(tls, pParse, pSrc, *(*int32)(unsafe.Pointer(bp + 24 /* iLeft */)), *(*int32)(unsafe.Pointer(bp + 28 /* iLeftCol */)), (i + 1), iRightCol,
- isOuter, (p + 36 /* &.pWhere */))
+ addWhereTerm(tls, pParse, pSrc, *(*int32)(unsafe.Pointer(bp + 24 /* iLeft */)), *(*int32)(unsafe.Pointer(bp + 28 /* iLeftCol */)), i+1, iRightCol,
+ isOuter, p+36)
}
}
@@ -113731,11 +115540,11 @@ __3:
// An instance of this object holds information (beyond pParse and pSelect)
// needed to load the next result row that is to be added to the sorter.
-type RowLoadInfo = RowLoadInfo1 /* sqlite3.c:132605:28 */
+type RowLoadInfo = RowLoadInfo1 /* sqlite3.c:133768:28 */
// This routine does the work of loading query data into an array of
// registers so that it can be added to the sorter.
-func innerLoopLoadRow(tls *libc.TLS, pParse uintptr, pSelect uintptr, pInfo uintptr) { /* sqlite3.c:132619:13: */
+func innerLoopLoadRow(tls *libc.TLS, pParse uintptr, pSelect uintptr, pInfo uintptr) { /* sqlite3.c:133782:13: */
Xsqlite3ExprCodeExprList(tls, pParse, (*Select)(unsafe.Pointer(pSelect)).FpEList, (*RowLoadInfo)(unsafe.Pointer(pInfo)).FregResult,
0, (*RowLoadInfo)(unsafe.Pointer(pInfo)).FecelFlags)
}
@@ -113744,24 +115553,24 @@ func innerLoopLoadRow(tls *libc.TLS, pParse uintptr, pSelect uintptr, pInfo uint
// added into the sorter.
//
// Return the register in which the result is stored.
-func makeSorterRecord(tls *libc.TLS, pParse uintptr, pSort uintptr, pSelect uintptr, regBase int32, nBase int32) int32 { /* sqlite3.c:132640:12: */
+func makeSorterRecord(tls *libc.TLS, pParse uintptr, pSort uintptr, pSelect uintptr, regBase int32, nBase int32) int32 { /* sqlite3.c:133803:12: */
var nOBSat int32 = (*SortCtx)(unsafe.Pointer(pSort)).FnOBSat
var v uintptr = (*Parse)(unsafe.Pointer(pParse)).FpVdbe
var regOut int32 = libc.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1)
if (*SortCtx)(unsafe.Pointer(pSort)).FpDeferredRowLoad != 0 {
innerLoopLoadRow(tls, pParse, pSelect, (*SortCtx)(unsafe.Pointer(pSort)).FpDeferredRowLoad)
}
- Xsqlite3VdbeAddOp3(tls, v, OP_MakeRecord, (regBase + nOBSat), (nBase - nOBSat), regOut)
+ Xsqlite3VdbeAddOp3(tls, v, OP_MakeRecord, regBase+nOBSat, nBase-nOBSat, regOut)
return regOut
}
// Generate code that will push the record in registers regData
// through regData+nData-1 onto the sorter.
-func pushOntoSorter(tls *libc.TLS, pParse uintptr, pSort uintptr, pSelect uintptr, regData int32, regOrigData int32, nData int32, nPrefixReg int32) { /* sqlite3.c:132661:13: */
+func pushOntoSorter(tls *libc.TLS, pParse uintptr, pSort uintptr, pSelect uintptr, regData int32, regOrigData int32, nData int32, nPrefixReg int32) { /* sqlite3.c:133824:13: */
var v uintptr = (*Parse)(unsafe.Pointer(pParse)).FpVdbe // Stmt under construction
- var bSeq int32 = (libc.Bool32((int32((*SortCtx)(unsafe.Pointer(pSort)).FsortFlags) & SORTFLAG_UseSorter) == 0))
+ var bSeq int32 = libc.Bool32(int32((*SortCtx)(unsafe.Pointer(pSort)).FsortFlags)&SORTFLAG_UseSorter == 0)
var nExpr int32 = (*ExprList)(unsafe.Pointer((*SortCtx)(unsafe.Pointer(pSort)).FpOrderBy)).FnExpr // No. of ORDER BY terms
- var nBase int32 = ((nExpr + bSeq) + nData) // Fields in sorter record
+ var nBase int32 = nExpr + bSeq + nData // Fields in sorter record
var regBase int32 // Regs for sorter record
var regRecord int32 = 0 // Assembled sorter record
var nOBSat int32 = (*SortCtx)(unsafe.Pointer(pSort)).FnOBSat // ORDER BY terms to skip
@@ -113784,30 +115593,30 @@ func pushOntoSorter(tls *libc.TLS, pParse uintptr, pSort uintptr, pSelect uintpt
if nPrefixReg != 0 {
- regBase = (regData - nPrefixReg)
+ regBase = regData - nPrefixReg
} else {
- regBase = ((*Parse)(unsafe.Pointer(pParse)).FnMem + 1)
- *(*int32)(unsafe.Pointer(pParse + 44 /* &.nMem */)) += (nBase)
+ regBase = (*Parse)(unsafe.Pointer(pParse)).FnMem + 1
+ *(*int32)(unsafe.Pointer(pParse + 44)) += nBase
}
if (*Select)(unsafe.Pointer(pSelect)).FiOffset != 0 {
- iLimit = ((*Select)(unsafe.Pointer(pSelect)).FiOffset + 1)
+ iLimit = (*Select)(unsafe.Pointer(pSelect)).FiOffset + 1
} else {
iLimit = (*Select)(unsafe.Pointer(pSelect)).FiLimit
}
(*SortCtx)(unsafe.Pointer(pSort)).FlabelDone = Xsqlite3VdbeMakeLabel(tls, pParse)
Xsqlite3ExprCodeExprList(tls, pParse, (*SortCtx)(unsafe.Pointer(pSort)).FpOrderBy, regBase, regOrigData,
- (uint8(SQLITE_ECEL_DUP | (func() int32 {
+ uint8(SQLITE_ECEL_DUP|func() int32 {
if regOrigData != 0 {
return SQLITE_ECEL_REF
}
return 0
- }()))))
+ }()))
if bSeq != 0 {
- Xsqlite3VdbeAddOp2(tls, v, OP_Sequence, (*SortCtx)(unsafe.Pointer(pSort)).FiECursor, (regBase + nExpr))
+ Xsqlite3VdbeAddOp2(tls, v, OP_Sequence, (*SortCtx)(unsafe.Pointer(pSort)).FiECursor, regBase+nExpr)
}
- if (nPrefixReg == 0) && (nData > 0) {
- Xsqlite3ExprCodeMove(tls, pParse, regData, ((regBase + nExpr) + bSeq), nData)
+ if nPrefixReg == 0 && nData > 0 {
+ Xsqlite3ExprCodeMove(tls, pParse, regData, regBase+nExpr+bSeq, nData)
}
if nOBSat > 0 {
var regPrevKey int32 // The first nOBSat columns of the previous row
@@ -113818,11 +115627,11 @@ func pushOntoSorter(tls *libc.TLS, pParse uintptr, pSort uintptr, pSelect uintpt
var pKI uintptr // Original KeyInfo on the sorter table
regRecord = makeSorterRecord(tls, pParse, pSort, pSelect, regBase, nBase)
- regPrevKey = ((*Parse)(unsafe.Pointer(pParse)).FnMem + 1)
- *(*int32)(unsafe.Pointer(pParse + 44 /* &.nMem */)) += ((*SortCtx)(unsafe.Pointer(pSort)).FnOBSat)
- nKey = ((nExpr - (*SortCtx)(unsafe.Pointer(pSort)).FnOBSat) + bSeq)
+ regPrevKey = (*Parse)(unsafe.Pointer(pParse)).FnMem + 1
+ *(*int32)(unsafe.Pointer(pParse + 44)) += (*SortCtx)(unsafe.Pointer(pSort)).FnOBSat
+ nKey = nExpr - (*SortCtx)(unsafe.Pointer(pSort)).FnOBSat + bSeq
if bSeq != 0 {
- addrFirst = Xsqlite3VdbeAddOp1(tls, v, OP_IfNot, (regBase + nExpr))
+ addrFirst = Xsqlite3VdbeAddOp1(tls, v, OP_IfNot, regBase+nExpr)
} else {
addrFirst = Xsqlite3VdbeAddOp1(tls, v, OP_SequenceTest, (*SortCtx)(unsafe.Pointer(pSort)).FiECursor)
}
@@ -113832,16 +115641,16 @@ func pushOntoSorter(tls *libc.TLS, pParse uintptr, pSort uintptr, pSelect uintpt
if (*Sqlite3)(unsafe.Pointer((*Parse)(unsafe.Pointer(pParse)).Fdb)).FmallocFailed != 0 {
return
}
- (*VdbeOp)(unsafe.Pointer(pOp)).Fp2 = (nKey + nData)
- pKI = *(*uintptr)(unsafe.Pointer(pOp + 16 /* &.p4 */))
+ (*VdbeOp)(unsafe.Pointer(pOp)).Fp2 = nKey + nData
+ pKI = *(*uintptr)(unsafe.Pointer(pOp + 16))
libc.Xmemset(tls, (*KeyInfo)(unsafe.Pointer(pKI)).FaSortFlags, 0, uint32((*KeyInfo)(unsafe.Pointer(pKI)).FnKeyField)) // Makes OP_Jump testable
Xsqlite3VdbeChangeP4(tls, v, -1, pKI, -9)
- *(*uintptr)(unsafe.Pointer(pOp + 16 /* &.p4 */)) = Xsqlite3KeyInfoFromExprList(tls, pParse, (*SortCtx)(unsafe.Pointer(pSort)).FpOrderBy, nOBSat,
- ((int32((*KeyInfo)(unsafe.Pointer(pKI)).FnAllField) - int32((*KeyInfo)(unsafe.Pointer(pKI)).FnKeyField)) - 1))
+ *(*uintptr)(unsafe.Pointer(pOp + 16)) = Xsqlite3KeyInfoFromExprList(tls, pParse, (*SortCtx)(unsafe.Pointer(pSort)).FpOrderBy, nOBSat,
+ int32((*KeyInfo)(unsafe.Pointer(pKI)).FnAllField)-int32((*KeyInfo)(unsafe.Pointer(pKI)).FnKeyField)-1)
pOp = uintptr(0) // Ensure pOp not used after sqltie3VdbeAddOp3()
addrJmp = Xsqlite3VdbeCurrentAddr(tls, v)
- Xsqlite3VdbeAddOp3(tls, v, OP_Jump, (addrJmp + 1), 0, (addrJmp + 1))
+ Xsqlite3VdbeAddOp3(tls, v, OP_Jump, addrJmp+1, 0, addrJmp+1)
(*SortCtx)(unsafe.Pointer(pSort)).FlabelBkOut = Xsqlite3VdbeMakeLabel(tls, pParse)
(*SortCtx)(unsafe.Pointer(pSort)).FregReturn = libc.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1)
Xsqlite3VdbeAddOp2(tls, v, OP_Gosub, (*SortCtx)(unsafe.Pointer(pSort)).FregReturn, (*SortCtx)(unsafe.Pointer(pSort)).FlabelBkOut)
@@ -113870,24 +115679,24 @@ func pushOntoSorter(tls *libc.TLS, pParse uintptr, pSort uintptr, pSelect uintpt
// just bypass the row insert logic. See the header comment on the
// sqlite3WhereOrderByLimitOptLabel() function for additional info.
var iCsr int32 = (*SortCtx)(unsafe.Pointer(pSort)).FiECursor
- Xsqlite3VdbeAddOp2(tls, v, OP_IfNotZero, iLimit, (Xsqlite3VdbeCurrentAddr(tls, v) + 4))
+ Xsqlite3VdbeAddOp2(tls, v, OP_IfNotZero, iLimit, Xsqlite3VdbeCurrentAddr(tls, v)+4)
Xsqlite3VdbeAddOp2(tls, v, OP_Last, iCsr, 0)
iSkip = Xsqlite3VdbeAddOp4Int(tls, v, OP_IdxLE,
- iCsr, 0, (regBase + nOBSat), (nExpr - nOBSat))
+ iCsr, 0, regBase+nOBSat, nExpr-nOBSat)
Xsqlite3VdbeAddOp1(tls, v, OP_Delete, iCsr)
}
if regRecord == 0 {
regRecord = makeSorterRecord(tls, pParse, pSort, pSelect, regBase, nBase)
}
- if (int32((*SortCtx)(unsafe.Pointer(pSort)).FsortFlags) & SORTFLAG_UseSorter) != 0 {
+ if int32((*SortCtx)(unsafe.Pointer(pSort)).FsortFlags)&SORTFLAG_UseSorter != 0 {
op = OP_SorterInsert
} else {
op = OP_IdxInsert
}
Xsqlite3VdbeAddOp4Int(tls, v, op, (*SortCtx)(unsafe.Pointer(pSort)).FiECursor, regRecord,
- (regBase + nOBSat), (nBase - nOBSat))
+ regBase+nOBSat, nBase-nOBSat)
if iSkip != 0 {
Xsqlite3VdbeChangeP2(tls, v, iSkip,
func() int32 {
@@ -113900,7 +115709,7 @@ func pushOntoSorter(tls *libc.TLS, pParse uintptr, pSort uintptr, pSelect uintpt
}
// Add code to implement the OFFSET
-func codeOffset(tls *libc.TLS, v uintptr, iOffset int32, iContinue int32) { /* sqlite3.c:132803:13: */
+func codeOffset(tls *libc.TLS, v uintptr, iOffset int32, iContinue int32) { /* sqlite3.c:133966:13: */
if iOffset > 0 {
Xsqlite3VdbeAddOp3(tls, v, OP_IfPos, iOffset, iContinue, 1)
@@ -113948,7 +115757,7 @@ func codeOffset(tls *libc.TLS, v uintptr, iOffset int32, iContinue int32) { /* s
// how many elements there are in the array of registers and (b) the
// collation sequences that should be used for the comparisons if
// eTnctType is WHERE_DISTINCT_ORDERED.
-func codeDistinct(tls *libc.TLS, pParse uintptr, eTnctType int32, iTab int32, addrRepeat int32, pEList uintptr, regElem int32) int32 { /* sqlite3.c:132857:12: */
+func codeDistinct(tls *libc.TLS, pParse uintptr, eTnctType int32, iTab int32, addrRepeat int32, pEList uintptr, regElem int32) int32 { /* sqlite3.c:134020:12: */
var iRet int32 = 0
var nResultCol int32 = (*ExprList)(unsafe.Pointer(pEList)).FnExpr
var v uintptr = (*Parse)(unsafe.Pointer(pParse)).FpVdbe
@@ -113961,24 +115770,24 @@ func codeDistinct(tls *libc.TLS, pParse uintptr, eTnctType int32, iTab int32, ad
var regPrev int32 // Previous row content
// Allocate space for the previous row
- iRet = libc.AssignInt32(&regPrev, ((*Parse)(unsafe.Pointer(pParse)).FnMem + 1))
- *(*int32)(unsafe.Pointer(pParse + 44 /* &.nMem */)) += (nResultCol)
+ iRet = libc.AssignInt32(&regPrev, (*Parse)(unsafe.Pointer(pParse)).FnMem+1)
+ *(*int32)(unsafe.Pointer(pParse + 44)) += nResultCol
- iJump = (Xsqlite3VdbeCurrentAddr(tls, v) + nResultCol)
+ iJump = Xsqlite3VdbeCurrentAddr(tls, v) + nResultCol
for i = 0; i < nResultCol; i++ {
- var pColl uintptr = Xsqlite3ExprCollSeq(tls, pParse, (*ExprList_item)(unsafe.Pointer((pEList+8 /* &.a */)+uintptr(i)*20)).FpExpr)
- if i < (nResultCol - 1) {
- Xsqlite3VdbeAddOp3(tls, v, OP_Ne, (regElem + i), iJump, (regPrev + i))
+ var pColl uintptr = Xsqlite3ExprCollSeq(tls, pParse, (*ExprList_item)(unsafe.Pointer(pEList+8+uintptr(i)*20)).FpExpr)
+ if i < nResultCol-1 {
+ Xsqlite3VdbeAddOp3(tls, v, OP_Ne, regElem+i, iJump, regPrev+i)
} else {
- Xsqlite3VdbeAddOp3(tls, v, OP_Eq, (regElem + i), addrRepeat, (regPrev + i))
+ Xsqlite3VdbeAddOp3(tls, v, OP_Eq, regElem+i, addrRepeat, regPrev+i)
}
Xsqlite3VdbeChangeP4(tls, v, -1, pColl, -2)
Xsqlite3VdbeChangeP5(tls, v, uint16(SQLITE_NULLEQ))
}
- Xsqlite3VdbeAddOp3(tls, v, OP_Copy, regElem, regPrev, (nResultCol - 1))
+ Xsqlite3VdbeAddOp3(tls, v, OP_Copy, regElem, regPrev, nResultCol-1)
break
}
@@ -114029,12 +115838,13 @@ func codeDistinct(tls *libc.TLS, pParse uintptr, eTnctType int32, iTab int32, ad
// The ephemeral table is not needed. But we do need register
// iVal to be initialized to NULL. So change the OP_OpenEphemeral
// into an OP_Null on the iVal register.
-func fixDistinctOpenEph(tls *libc.TLS, pParse uintptr, eTnctType int32, iVal int32, iOpenEphAddr int32) { /* sqlite3.c:132941:13: */
- if (eTnctType == WHERE_DISTINCT_UNIQUE) || (eTnctType == WHERE_DISTINCT_ORDERED) {
+func fixDistinctOpenEph(tls *libc.TLS, pParse uintptr, eTnctType int32, iVal int32, iOpenEphAddr int32) { /* sqlite3.c:134104:13: */
+ if (*Parse)(unsafe.Pointer(pParse)).FnErr == 0 &&
+ (eTnctType == WHERE_DISTINCT_UNIQUE || eTnctType == WHERE_DISTINCT_ORDERED) {
var v uintptr = (*Parse)(unsafe.Pointer(pParse)).FpVdbe
Xsqlite3VdbeChangeToNoop(tls, v, iOpenEphAddr)
- if int32((*VdbeOp)(unsafe.Pointer(Xsqlite3VdbeGetOp(tls, v, (iOpenEphAddr+1)))).Fopcode) == OP_Explain {
- Xsqlite3VdbeChangeToNoop(tls, v, (iOpenEphAddr + 1))
+ if int32((*VdbeOp)(unsafe.Pointer(Xsqlite3VdbeGetOp(tls, v, iOpenEphAddr+1))).Fopcode) == OP_Explain {
+ Xsqlite3VdbeChangeToNoop(tls, v, iOpenEphAddr+1)
}
if eTnctType == WHERE_DISTINCT_ORDERED {
// Change the OP_OpenEphemeral to an OP_Null that sets the MEM_Cleared
@@ -114056,7 +115866,7 @@ func fixDistinctOpenEph(tls *libc.TLS, pParse uintptr, eTnctType int32, iVal int
// are evaluated in order to get the data for this row. If srcTab is
// zero or more, then data is pulled from srcTab and p->pEList is used only
// to get the number of columns and the collation sequence for each column.
-func selectInnerLoop(tls *libc.TLS, pParse uintptr, p uintptr, srcTab int32, pSort uintptr, pDistinct uintptr, pDest uintptr, iContinue int32, iBreak int32) { /* sqlite3.c:133056:13: */
+func selectInnerLoop(tls *libc.TLS, pParse uintptr, p uintptr, srcTab int32, pSort uintptr, pDistinct uintptr, pDest uintptr, iContinue int32, iBreak int32) { /* sqlite3.c:134226:13: */
bp := tls.Alloc(8)
defer tls.Free(8)
@@ -114083,10 +115893,10 @@ func selectInnerLoop(tls *libc.TLS, pParse uintptr, p uintptr, srcTab int32, pSo
} else {
hasDistinct = WHERE_DISTINCT_NOOP
}
- if (pSort != 0) && ((*SortCtx)(unsafe.Pointer(pSort)).FpOrderBy == uintptr(0)) {
+ if pSort != 0 && (*SortCtx)(unsafe.Pointer(pSort)).FpOrderBy == uintptr(0) {
pSort = uintptr(0)
}
- if (pSort == uintptr(0)) && !(hasDistinct != 0) {
+ if pSort == uintptr(0) && !(hasDistinct != 0) {
codeOffset(tls, v, (*Select)(unsafe.Pointer(p)).FiOffset, iContinue)
}
@@ -114097,26 +115907,26 @@ func selectInnerLoop(tls *libc.TLS, pParse uintptr, p uintptr, srcTab int32, pSo
if (*SelectDest)(unsafe.Pointer(pDest)).FiSdst == 0 {
if pSort != 0 {
nPrefixReg = (*ExprList)(unsafe.Pointer((*SortCtx)(unsafe.Pointer(pSort)).FpOrderBy)).FnExpr
- if !((int32((*SortCtx)(unsafe.Pointer(pSort)).FsortFlags) & SORTFLAG_UseSorter) != 0) {
+ if !(int32((*SortCtx)(unsafe.Pointer(pSort)).FsortFlags)&SORTFLAG_UseSorter != 0) {
nPrefixReg++
}
- *(*int32)(unsafe.Pointer(pParse + 44 /* &.nMem */)) += (nPrefixReg)
+ *(*int32)(unsafe.Pointer(pParse + 44)) += nPrefixReg
}
- (*SelectDest)(unsafe.Pointer(pDest)).FiSdst = ((*Parse)(unsafe.Pointer(pParse)).FnMem + 1)
- *(*int32)(unsafe.Pointer(pParse + 44 /* &.nMem */)) += (nResultCol)
- } else if ((*SelectDest)(unsafe.Pointer(pDest)).FiSdst + nResultCol) > (*Parse)(unsafe.Pointer(pParse)).FnMem {
+ (*SelectDest)(unsafe.Pointer(pDest)).FiSdst = (*Parse)(unsafe.Pointer(pParse)).FnMem + 1
+ *(*int32)(unsafe.Pointer(pParse + 44)) += nResultCol
+ } else if (*SelectDest)(unsafe.Pointer(pDest)).FiSdst+nResultCol > (*Parse)(unsafe.Pointer(pParse)).FnMem {
// This is an error condition that can result, for example, when a SELECT
// on the right-hand side of an INSERT contains more result columns than
// 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 + 44 /* &.nMem */)) += (nResultCol)
+ *(*int32)(unsafe.Pointer(pParse + 44)) += nResultCol
}
(*SelectDest)(unsafe.Pointer(pDest)).FnSdst = nResultCol
regOrig = libc.AssignInt32(&regResult, (*SelectDest)(unsafe.Pointer(pDest)).FiSdst)
if srcTab >= 0 {
for i = 0; i < nResultCol; i++ {
- Xsqlite3VdbeAddOp3(tls, v, OP_Column, srcTab, i, (regResult + i))
+ Xsqlite3VdbeAddOp3(tls, v, OP_Column, srcTab, i, regResult+i)
}
} else if eDest != SRT_Exists {
@@ -114124,12 +115934,12 @@ func selectInnerLoop(tls *libc.TLS, pParse uintptr, p uintptr, srcTab int32, pSo
// values returned by the SELECT are not required.
var ecelFlags U8 // "ecel" is an abbreviation of "ExprCodeExprList"
var pEList uintptr
- if ((eDest == SRT_Mem) || (eDest == SRT_Output)) || (eDest == SRT_Coroutine) {
+ if eDest == SRT_Mem || eDest == SRT_Output || eDest == SRT_Coroutine {
ecelFlags = U8(SQLITE_ECEL_DUP)
} else {
ecelFlags = U8(0)
}
- if (((pSort != 0) && (hasDistinct == 0)) && (eDest != SRT_EphemTab)) && (eDest != SRT_Table) {
+ if pSort != 0 && hasDistinct == 0 && eDest != SRT_EphemTab && eDest != SRT_Table {
// For each expression in p->pEList that is a copy of an expression in
// the ORDER BY clause (pSort->pOrderBy), set the associated
// iOrderByCol value to one more than the index of the ORDER BY
@@ -114140,8 +115950,8 @@ func selectInnerLoop(tls *libc.TLS, pParse uintptr, p uintptr, srcTab int32, pSo
for i = (*SortCtx)(unsafe.Pointer(pSort)).FnOBSat; i < (*ExprList)(unsafe.Pointer((*SortCtx)(unsafe.Pointer(pSort)).FpOrderBy)).FnExpr; i++ {
var j int32
- if (libc.AssignInt32(&j, int32(*(*U16)(unsafe.Pointer(((*SortCtx)(unsafe.Pointer(pSort)).FpOrderBy + 8 /* &.a */) + uintptr(i)*20 + 16 /* &.u */ /* &.x */ /* &.iOrderByCol */))))) > 0 {
- *(*U16)(unsafe.Pointer(((*Select)(unsafe.Pointer(p)).FpEList + 8 /* &.a */) + uintptr((j-1))*20 + 16 /* &.u */ /* &.x */ /* &.iOrderByCol */)) = (U16((i + 1) - (*SortCtx)(unsafe.Pointer(pSort)).FnOBSat))
+ if libc.AssignInt32(&j, int32(*(*U16)(unsafe.Pointer((*SortCtx)(unsafe.Pointer(pSort)).FpOrderBy + 8 + uintptr(i)*20 + 16)))) > 0 {
+ *(*U16)(unsafe.Pointer((*Select)(unsafe.Pointer(p)).FpEList + 8 + uintptr(j-1)*20 + 16)) = U16(i + 1 - (*SortCtx)(unsafe.Pointer(pSort)).FnOBSat)
}
}
@@ -114149,7 +115959,7 @@ func selectInnerLoop(tls *libc.TLS, pParse uintptr, p uintptr, srcTab int32, pSo
// from the sorter by the optimizations in this branch
pEList = (*Select)(unsafe.Pointer(p)).FpEList
for i = 0; i < (*ExprList)(unsafe.Pointer(pEList)).FnExpr; i++ {
- if int32(*(*U16)(unsafe.Pointer(((pEList + 8 /* &.a */) + uintptr(i)*20 + 16 /* &.u */ /* &.x */) /* &.iOrderByCol */))) > 0 {
+ if int32(*(*U16)(unsafe.Pointer(pEList + 8 + uintptr(i)*20 + 16))) > 0 {
nResultCol--
regOrig = 0
}
@@ -114158,9 +115968,9 @@ func selectInnerLoop(tls *libc.TLS, pParse uintptr, p uintptr, srcTab int32, pSo
}
(*RowLoadInfo)(unsafe.Pointer(bp /* &sRowLoadInfo */)).FregResult = regResult
(*RowLoadInfo)(unsafe.Pointer(bp /* &sRowLoadInfo */)).FecelFlags = ecelFlags
- if (((*Select)(unsafe.Pointer(p)).FiLimit != 0) &&
- ((int32(ecelFlags) & SQLITE_ECEL_OMITREF) != 0)) &&
- (nPrefixReg > 0) {
+ if (*Select)(unsafe.Pointer(p)).FiLimit != 0 &&
+ int32(ecelFlags)&SQLITE_ECEL_OMITREF != 0 &&
+ nPrefixReg > 0 {
(*SortCtx)(unsafe.Pointer(pSort)).FpDeferredRowLoad = bp /* &sRowLoadInfo */
regOrig = 0
@@ -114216,24 +116026,24 @@ func selectInnerLoop(tls *libc.TLS, pParse uintptr, p uintptr, srcTab int32, pSo
fallthrough
case SRT_EphemTab:
{
- var r1 int32 = Xsqlite3GetTempRange(tls, pParse, (nPrefixReg + 1))
+ var r1 int32 = Xsqlite3GetTempRange(tls, pParse, nPrefixReg+1)
- Xsqlite3VdbeAddOp3(tls, v, OP_MakeRecord, regResult, nResultCol, (r1 + nPrefixReg))
+ Xsqlite3VdbeAddOp3(tls, v, OP_MakeRecord, regResult, nResultCol, r1+nPrefixReg)
if eDest == SRT_DistFifo {
// If the destination is DistFifo, then cursor (iParm+1) is open
// on an ephemeral index. If the current row is already present
// in the index, do not write it to the output. If not, add the
// current row to the index and proceed with writing it to the
// output table as well.
- var addr int32 = (Xsqlite3VdbeCurrentAddr(tls, v) + 4)
- Xsqlite3VdbeAddOp4Int(tls, v, OP_Found, (iParm + 1), addr, r1, 0)
+ var addr int32 = Xsqlite3VdbeCurrentAddr(tls, v) + 4
+ Xsqlite3VdbeAddOp4Int(tls, v, OP_Found, iParm+1, addr, r1, 0)
- Xsqlite3VdbeAddOp4Int(tls, v, OP_IdxInsert, (iParm + 1), r1, regResult, nResultCol)
+ Xsqlite3VdbeAddOp4Int(tls, v, OP_IdxInsert, iParm+1, r1, regResult, nResultCol)
}
if pSort != 0 {
- pushOntoSorter(tls, pParse, pSort, p, (r1 + nPrefixReg), regOrig, 1, nPrefixReg)
+ pushOntoSorter(tls, pParse, pSort, p, r1+nPrefixReg, regOrig, 1, nPrefixReg)
} else {
var r2 int32 = Xsqlite3GetTempReg(tls, pParse)
Xsqlite3VdbeAddOp2(tls, v, OP_NewRowid, iParm, r2)
@@ -114241,7 +116051,7 @@ func selectInnerLoop(tls *libc.TLS, pParse uintptr, p uintptr, srcTab int32, pSo
Xsqlite3VdbeChangeP5(tls, v, uint16(OPFLAG_APPEND))
Xsqlite3ReleaseTempReg(tls, pParse, r2)
}
- Xsqlite3ReleaseTempRange(tls, pParse, r1, (nPrefixReg + 1))
+ Xsqlite3ReleaseTempRange(tls, pParse, r1, nPrefixReg+1)
break
}
@@ -114261,7 +116071,7 @@ func selectInnerLoop(tls *libc.TLS, pParse uintptr, p uintptr, srcTab int32, pSo
Xsqlite3VdbeAddOp2(tls, v, OP_IsNull, regResult, iBreak)
Xsqlite3VdbeAddOp3(tls, v, OP_MakeRecord,
- (regResult + (libc.Bool32(i2 < 0))), (nResultCol - (libc.Bool32(i2 < 0))), r1)
+ regResult+libc.Bool32(i2 < 0), nResultCol-libc.Bool32(i2 < 0), r1)
if i2 < 0 {
Xsqlite3VdbeAddOp3(tls, v, OP_Insert, iParm, r1, regResult)
} else {
@@ -114358,34 +116168,34 @@ func selectInnerLoop(tls *libc.TLS, pParse uintptr, p uintptr, srcTab int32, pSo
nKey = (*ExprList)(unsafe.Pointer(pSO)).FnExpr
r1 = Xsqlite3GetTempReg(tls, pParse)
- r2 = Xsqlite3GetTempRange(tls, pParse, (nKey + 2))
- r3 = ((r2 + nKey) + 1)
+ r2 = Xsqlite3GetTempRange(tls, pParse, nKey+2)
+ r3 = r2 + nKey + 1
if eDest == SRT_DistQueue {
// If the destination is DistQueue, then cursor (iParm+1) is open
// on a second ephemeral index that holds all values every previously
// added to the queue.
- addrTest = Xsqlite3VdbeAddOp4Int(tls, v, OP_Found, (iParm + 1), 0,
+ addrTest = Xsqlite3VdbeAddOp4Int(tls, v, OP_Found, iParm+1, 0,
regResult, nResultCol)
}
Xsqlite3VdbeAddOp3(tls, v, OP_MakeRecord, regResult, nResultCol, r3)
if eDest == SRT_DistQueue {
- Xsqlite3VdbeAddOp2(tls, v, OP_IdxInsert, (iParm + 1), r3)
+ Xsqlite3VdbeAddOp2(tls, v, OP_IdxInsert, iParm+1, r3)
Xsqlite3VdbeChangeP5(tls, v, uint16(OPFLAG_USESEEKRESULT))
}
for i = 0; i < nKey; i++ {
Xsqlite3VdbeAddOp2(tls, v, OP_SCopy,
- ((regResult + int32(*(*U16)(unsafe.Pointer(((pSO + 8 /* &.a */) + uintptr(i)*20 + 16 /* &.u */ /* &.x */) /* &.iOrderByCol */)))) - 1),
- (r2 + i))
+ regResult+int32(*(*U16)(unsafe.Pointer(pSO + 8 + uintptr(i)*20 + 16)))-1,
+ r2+i)
}
- Xsqlite3VdbeAddOp2(tls, v, OP_Sequence, iParm, (r2 + nKey))
- Xsqlite3VdbeAddOp3(tls, v, OP_MakeRecord, r2, (nKey + 2), r1)
- Xsqlite3VdbeAddOp4Int(tls, v, OP_IdxInsert, iParm, r1, r2, (nKey + 2))
+ Xsqlite3VdbeAddOp2(tls, v, OP_Sequence, iParm, r2+nKey)
+ Xsqlite3VdbeAddOp3(tls, v, OP_MakeRecord, r2, nKey+2, r1)
+ Xsqlite3VdbeAddOp4Int(tls, v, OP_IdxInsert, iParm, r1, r2, nKey+2)
if addrTest != 0 {
Xsqlite3VdbeJumpHere(tls, v, addrTest)
}
Xsqlite3ReleaseTempReg(tls, pParse, r1)
- Xsqlite3ReleaseTempRange(tls, pParse, r2, (nKey + 2))
+ Xsqlite3ReleaseTempRange(tls, pParse, r2, nKey+2)
break
}
@@ -114405,24 +116215,24 @@ func selectInnerLoop(tls *libc.TLS, pParse uintptr, p uintptr, srcTab int32, pSo
// Jump to the end of the loop if the LIMIT is reached. Except, if
// there is a sorter, in which case the sorter has already limited
// the output for us.
- if (pSort == uintptr(0)) && ((*Select)(unsafe.Pointer(p)).FiLimit != 0) {
+ if pSort == uintptr(0) && (*Select)(unsafe.Pointer(p)).FiLimit != 0 {
Xsqlite3VdbeAddOp2(tls, v, OP_DecrJumpZero, (*Select)(unsafe.Pointer(p)).FiLimit, iBreak)
}
}
// Allocate a KeyInfo object sufficient for an index of N key columns and
// X extra columns.
-func Xsqlite3KeyInfoAlloc(tls *libc.TLS, db uintptr, N int32, X int32) uintptr { /* sqlite3.c:133450:24: */
- var nExtra int32 = (int32(((uint32(N + X)) * (uint32(unsafe.Sizeof(uintptr(0))) + uint32(1))) - uint32(unsafe.Sizeof(uintptr(0)))))
- var p uintptr = Xsqlite3DbMallocRawNN(tls, db, (uint64(uint32(unsafe.Sizeof(KeyInfo{})) + uint32(nExtra))))
+func Xsqlite3KeyInfoAlloc(tls *libc.TLS, db uintptr, N int32, X int32) uintptr { /* sqlite3.c:134620:24: */
+ var nExtra int32 = int32(uint32(N+X)*(uint32(unsafe.Sizeof(uintptr(0)))+uint32(1)) - uint32(unsafe.Sizeof(uintptr(0))))
+ var p uintptr = Xsqlite3DbMallocRawNN(tls, db, uint64(uint32(unsafe.Sizeof(KeyInfo{}))+uint32(nExtra)))
if p != 0 {
- (*KeyInfo)(unsafe.Pointer(p)).FaSortFlags = ((p + 20 /* &.aColl */) + uintptr((N+X))*4)
+ (*KeyInfo)(unsafe.Pointer(p)).FaSortFlags = p + 20 + uintptr(N+X)*4
(*KeyInfo)(unsafe.Pointer(p)).FnKeyField = U16(N)
- (*KeyInfo)(unsafe.Pointer(p)).FnAllField = (U16(N + X))
+ (*KeyInfo)(unsafe.Pointer(p)).FnAllField = U16(N + X)
(*KeyInfo)(unsafe.Pointer(p)).Fenc = (*Sqlite3)(unsafe.Pointer(db)).Fenc
(*KeyInfo)(unsafe.Pointer(p)).Fdb = db
(*KeyInfo)(unsafe.Pointer(p)).FnRef = U32(1)
- libc.Xmemset(tls, (p + 1*24), 0, uint32(nExtra))
+ libc.Xmemset(tls, p+1*24, 0, uint32(nExtra))
} else {
Xsqlite3OomFault(tls, db)
}
@@ -114430,7 +116240,7 @@ func Xsqlite3KeyInfoAlloc(tls *libc.TLS, db uintptr, N int32, X int32) uintptr {
}
// Deallocate a KeyInfo object
-func Xsqlite3KeyInfoUnref(tls *libc.TLS, p uintptr) { /* sqlite3.c:133470:21: */
+func Xsqlite3KeyInfoUnref(tls *libc.TLS, p uintptr) { /* sqlite3.c:134640:21: */
if p != 0 {
(*KeyInfo)(unsafe.Pointer(p)).FnRef--
@@ -114441,7 +116251,7 @@ func Xsqlite3KeyInfoUnref(tls *libc.TLS, p uintptr) { /* sqlite3.c:133470:21: */
}
// Make a new pointer to a KeyInfo object
-func Xsqlite3KeyInfoRef(tls *libc.TLS, p uintptr) uintptr { /* sqlite3.c:133481:24: */
+func Xsqlite3KeyInfoRef(tls *libc.TLS, p uintptr) uintptr { /* sqlite3.c:134651:24: */
if p != 0 {
(*KeyInfo)(unsafe.Pointer(p)).FnRef++
@@ -114461,7 +116271,7 @@ func Xsqlite3KeyInfoRef(tls *libc.TLS, p uintptr) uintptr { /* sqlite3.c:133481:
// Space to hold the KeyInfo structure is obtained from malloc. The calling
// function is responsible for seeing that this structure is eventually
// freed.
-func Xsqlite3KeyInfoFromExprList(tls *libc.TLS, pParse uintptr, pList uintptr, iStart int32, nExtra int32) uintptr { /* sqlite3.c:133513:24: */
+func Xsqlite3KeyInfoFromExprList(tls *libc.TLS, pParse uintptr, pList uintptr, iStart int32, nExtra int32) uintptr { /* sqlite3.c:134683:24: */
var nExpr int32
var pInfo uintptr
var pItem uintptr
@@ -114469,18 +116279,18 @@ func Xsqlite3KeyInfoFromExprList(tls *libc.TLS, pParse uintptr, pList uintptr, i
var i int32
nExpr = (*ExprList)(unsafe.Pointer(pList)).FnExpr
- pInfo = Xsqlite3KeyInfoAlloc(tls, db, (nExpr - iStart), (nExtra + 1))
+ pInfo = Xsqlite3KeyInfoAlloc(tls, db, nExpr-iStart, nExtra+1)
if pInfo != 0 {
i = iStart
- pItem = ((pList + 8 /* &.a */) + uintptr(iStart)*20)
+ pItem = pList + 8 + uintptr(iStart)*20
__1:
if !(i < nExpr) {
goto __3
}
{
- *(*uintptr)(unsafe.Pointer((pInfo + 20 /* &.aColl */) + uintptr((i-iStart))*4)) = Xsqlite3ExprNNCollSeq(tls, pParse, (*ExprList_item)(unsafe.Pointer(pItem)).FpExpr)
- *(*U8)(unsafe.Pointer((*KeyInfo)(unsafe.Pointer(pInfo)).FaSortFlags + uintptr((i - iStart)))) = (*ExprList_item)(unsafe.Pointer(pItem)).FsortFlags
+ *(*uintptr)(unsafe.Pointer(pInfo + 20 + uintptr(i-iStart)*4)) = Xsqlite3ExprNNCollSeq(tls, pParse, (*ExprList_item)(unsafe.Pointer(pItem)).FpExpr)
+ *(*U8)(unsafe.Pointer((*KeyInfo)(unsafe.Pointer(pInfo)).FaSortFlags + uintptr(i-iStart))) = (*ExprList_item)(unsafe.Pointer(pItem)).FsortFlags
}
goto __2
@@ -114495,20 +116305,20 @@ func Xsqlite3KeyInfoFromExprList(tls *libc.TLS, pParse uintptr, pList uintptr, i
}
// Name of the connection operator, used for error messages.
-func Xsqlite3SelectOpName(tls *libc.TLS, id int32) uintptr { /* sqlite3.c:133540:27: */
+func Xsqlite3SelectOpName(tls *libc.TLS, id int32) uintptr { /* sqlite3.c:134710:27: */
var z uintptr
switch id {
case TK_ALL:
- z = ts + 17099 /* "UNION ALL" */
+ z = ts + 18376 /* "UNION ALL" */
break
case TK_INTERSECT:
- z = ts + 17109 /* "INTERSECT" */
+ z = ts + 18386 /* "INTERSECT" */
break
case TK_EXCEPT:
- z = ts + 17119 /* "EXCEPT" */
+ z = ts + 18396 /* "EXCEPT" */
break
default:
- z = ts + 17126 /* "UNION" */
+ z = ts + 18403 /* "UNION" */
break
}
return z
@@ -114522,11 +116332,11 @@ func Xsqlite3SelectOpName(tls *libc.TLS, id int32) uintptr { /* sqlite3.c:133540
//
// where xxx is one of "DISTINCT", "ORDER BY" or "GROUP BY". Exactly which
// is determined by the zUsage argument.
-func explainTempTable(tls *libc.TLS, pParse uintptr, zUsage uintptr) { /* sqlite3.c:133562:13: */
+func explainTempTable(tls *libc.TLS, pParse uintptr, zUsage uintptr) { /* sqlite3.c:134732:13: */
bp := tls.Alloc(8)
defer tls.Free(8)
- Xsqlite3VdbeExplain(tls, pParse, uint8(0), ts+17132 /* "USE TEMP B-TREE ..." */, libc.VaList(bp, zUsage))
+ Xsqlite3VdbeExplain(tls, pParse, uint8(0), ts+18409 /* "USE TEMP B-TREE ..." */, libc.VaList(bp, zUsage))
}
// Assign expression b to lvalue a. A second, no-op, version of this macro
@@ -114539,7 +116349,7 @@ func explainTempTable(tls *libc.TLS, pParse uintptr, zUsage uintptr) { /* sqlite
// then the results were placed in a sorter. After the loop is terminated
// we need to run the sorter and output the results. The following
// routine generates the code needed to do that.
-func generateSortTail(tls *libc.TLS, pParse uintptr, p uintptr, pSort uintptr, nColumn int32, pDest uintptr) { /* sqlite3.c:133588:13: */
+func generateSortTail(tls *libc.TLS, pParse uintptr, p uintptr, pSort uintptr, nColumn int32, pDest uintptr) { /* sqlite3.c:134758:13: */
var v uintptr = (*Parse)(unsafe.Pointer(pParse)).FpVdbe // The prepared statement
var addrBreak int32 = (*SortCtx)(unsafe.Pointer(pSort)).FlabelDone // Jump here to exit loop
var addrContinue int32 = Xsqlite3VdbeMakeLabel(tls, pParse) // Jump here for next cycle
@@ -114566,57 +116376,57 @@ func generateSortTail(tls *libc.TLS, pParse uintptr, p uintptr, pSort uintptr, n
}
iTab = (*SortCtx)(unsafe.Pointer(pSort)).FiECursor
- if ((eDest == SRT_Output) || (eDest == SRT_Coroutine)) || (eDest == SRT_Mem) {
+ if eDest == SRT_Output || eDest == SRT_Coroutine || eDest == SRT_Mem {
regRowid = 0
regRow = (*SelectDest)(unsafe.Pointer(pDest)).FiSdst
} else {
regRowid = Xsqlite3GetTempReg(tls, pParse)
- if (eDest == SRT_EphemTab) || (eDest == SRT_Table) {
+ if eDest == SRT_EphemTab || eDest == SRT_Table {
regRow = Xsqlite3GetTempReg(tls, pParse)
nColumn = 0
} else {
regRow = Xsqlite3GetTempRange(tls, pParse, nColumn)
}
}
- nKey = ((*ExprList)(unsafe.Pointer(pOrderBy)).FnExpr - (*SortCtx)(unsafe.Pointer(pSort)).FnOBSat)
- if (int32((*SortCtx)(unsafe.Pointer(pSort)).FsortFlags) & SORTFLAG_UseSorter) != 0 {
+ nKey = (*ExprList)(unsafe.Pointer(pOrderBy)).FnExpr - (*SortCtx)(unsafe.Pointer(pSort)).FnOBSat
+ if int32((*SortCtx)(unsafe.Pointer(pSort)).FsortFlags)&SORTFLAG_UseSorter != 0 {
var regSortOut int32 = libc.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1)
iSortTab = libc.PostIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnTab, 1)
if (*SortCtx)(unsafe.Pointer(pSort)).FlabelBkOut != 0 {
addrOnce = Xsqlite3VdbeAddOp0(tls, v, OP_Once)
}
Xsqlite3VdbeAddOp3(tls, v, OP_OpenPseudo, iSortTab, regSortOut,
- (((nKey + 1) + nColumn) + nRefKey))
+ nKey+1+nColumn+nRefKey)
if addrOnce != 0 {
Xsqlite3VdbeJumpHere(tls, v, addrOnce)
}
- addr = (1 + Xsqlite3VdbeAddOp2(tls, v, OP_SorterSort, iTab, addrBreak))
+ addr = 1 + Xsqlite3VdbeAddOp2(tls, v, OP_SorterSort, iTab, addrBreak)
codeOffset(tls, v, (*Select)(unsafe.Pointer(p)).FiOffset, addrContinue)
Xsqlite3VdbeAddOp3(tls, v, OP_SorterData, iTab, regSortOut, iSortTab)
bSeq = 0
} else {
- addr = (1 + Xsqlite3VdbeAddOp2(tls, v, OP_Sort, iTab, addrBreak))
+ addr = 1 + Xsqlite3VdbeAddOp2(tls, v, OP_Sort, iTab, addrBreak)
codeOffset(tls, v, (*Select)(unsafe.Pointer(p)).FiOffset, addrContinue)
iSortTab = iTab
bSeq = 1
}
i = 0
- iCol = ((nKey + bSeq) - 1)
+ iCol = nKey + bSeq - 1
for ; i < nColumn; i++ {
- if int32(*(*U16)(unsafe.Pointer((aOutEx + uintptr(i)*20 + 16 /* &.u */ /* &.x */) /* &.iOrderByCol */))) == 0 {
+ if int32(*(*U16)(unsafe.Pointer(aOutEx + uintptr(i)*20 + 16))) == 0 {
iCol++
}
}
- for i = (nColumn - 1); i >= 0; i-- {
+ for i = nColumn - 1; i >= 0; i-- {
{
var iRead int32
- if *(*U16)(unsafe.Pointer(aOutEx + uintptr(i)*20 + 16 /* &.u */ /* &.x */ /* &.iOrderByCol */)) != 0 {
- iRead = (int32(*(*U16)(unsafe.Pointer((aOutEx + uintptr(i)*20 + 16 /* &.u */ /* &.x */) /* &.iOrderByCol */))) - 1)
+ if *(*U16)(unsafe.Pointer(aOutEx + uintptr(i)*20 + 16)) != 0 {
+ iRead = int32(*(*U16)(unsafe.Pointer(aOutEx + uintptr(i)*20 + 16))) - 1
} else {
iRead = libc.PostDecInt32(&iCol, 1)
}
- Xsqlite3VdbeAddOp3(tls, v, OP_Column, iSortTab, iRead, (regRow + i))
+ Xsqlite3VdbeAddOp3(tls, v, OP_Column, iSortTab, iRead, regRow+i)
}
}
@@ -114625,7 +116435,7 @@ func generateSortTail(tls *libc.TLS, pParse uintptr, p uintptr, pSort uintptr, n
fallthrough
case SRT_EphemTab:
{
- Xsqlite3VdbeAddOp3(tls, v, OP_Column, iSortTab, (nKey + bSeq), regRow)
+ Xsqlite3VdbeAddOp3(tls, v, OP_Column, iSortTab, nKey+bSeq, regRow)
Xsqlite3VdbeAddOp2(tls, v, OP_NewRowid, iParm, regRowid)
Xsqlite3VdbeAddOp3(tls, v, OP_Insert, iParm, regRow, regRowid)
Xsqlite3VdbeChangeP5(tls, v, uint16(OPFLAG_APPEND))
@@ -114651,7 +116461,7 @@ func generateSortTail(tls *libc.TLS, pParse uintptr, p uintptr, pSort uintptr, n
{
var i2 int32 = (*SelectDest)(unsafe.Pointer(pDest)).FiSDParm2
var r1 int32 = Xsqlite3GetTempReg(tls, pParse)
- Xsqlite3VdbeAddOp3(tls, v, OP_MakeRecord, (regRow + (libc.Bool32(i2 < 0))), (nColumn - (libc.Bool32(i2 < 0))), r1)
+ Xsqlite3VdbeAddOp3(tls, v, OP_MakeRecord, regRow+libc.Bool32(i2 < 0), nColumn-libc.Bool32(i2 < 0), r1)
if i2 < 0 {
Xsqlite3VdbeAddOp3(tls, v, OP_Insert, iParm, r1, regRow)
} else {
@@ -114682,7 +116492,7 @@ func generateSortTail(tls *libc.TLS, pParse uintptr, p uintptr, pSort uintptr, n
}
// The bottom of the loop
Xsqlite3VdbeResolveLabel(tls, v, addrContinue)
- if (int32((*SortCtx)(unsafe.Pointer(pSort)).FsortFlags) & SORTFLAG_UseSorter) != 0 {
+ if int32((*SortCtx)(unsafe.Pointer(pSort)).FsortFlags)&SORTFLAG_UseSorter != 0 {
Xsqlite3VdbeAddOp2(tls, v, OP_SorterNext, iTab, addr)
} else {
Xsqlite3VdbeAddOp2(tls, v, OP_Next, iTab, addr)
@@ -114715,7 +116525,7 @@ func generateSortTail(tls *libc.TLS, pParse uintptr, p uintptr, pSort uintptr, n
//
// This routine has either 3 or 6 parameters depending on whether or not
// the SQLITE_ENABLE_COLUMN_METADATA compile-time option is used.
-func columnTypeImpl(tls *libc.TLS, pNC uintptr, pExpr uintptr, pzOrigDb uintptr, pzOrigTab uintptr, pzOrigCol uintptr) uintptr { /* sqlite3.c:133813:19: */
+func columnTypeImpl(tls *libc.TLS, pNC uintptr, pExpr uintptr, pzOrigDb uintptr, pzOrigTab uintptr, pzOrigCol uintptr) uintptr { /* sqlite3.c:134983:19: */
bp := tls.Alloc(76)
defer tls.Free(76)
@@ -114734,13 +116544,13 @@ func columnTypeImpl(tls *libc.TLS, pNC uintptr, pExpr uintptr, pzOrigDb uintptr,
var pTab uintptr = uintptr(0) // Table structure column is extracted from
var pS uintptr = uintptr(0) // Select the column is extracted from
var iCol int32 = int32((*Expr)(unsafe.Pointer(pExpr)).FiColumn) // Index of column in pTab
- for (pNC != 0) && !(pTab != 0) {
+ for pNC != 0 && !(pTab != 0) {
var pTabList uintptr = (*NameContext)(unsafe.Pointer(pNC)).FpSrcList
- for j = 0; (j < (*SrcList)(unsafe.Pointer(pTabList)).FnSrc) && ((*SrcItem)(unsafe.Pointer((pTabList+8 /* &.a */)+uintptr(j)*72)).FiCursor != (*Expr)(unsafe.Pointer(pExpr)).FiTable); j++ {
+ for j = 0; j < (*SrcList)(unsafe.Pointer(pTabList)).FnSrc && (*SrcItem)(unsafe.Pointer(pTabList+8 /* &.a */ +uintptr(j)*72)).FiCursor != (*Expr)(unsafe.Pointer(pExpr)).FiTable; j++ {
}
if j < (*SrcList)(unsafe.Pointer(pTabList)).FnSrc {
- pTab = (*SrcItem)(unsafe.Pointer((pTabList + 8 /* &.a */) + uintptr(j)*72)).FpTab
- pS = (*SrcItem)(unsafe.Pointer((pTabList + 8 /* &.a */) + uintptr(j)*72)).FpSelect
+ pTab = (*SrcItem)(unsafe.Pointer(pTabList + 8 + uintptr(j)*72)).FpTab
+ pS = (*SrcItem)(unsafe.Pointer(pTabList + 8 + uintptr(j)*72)).FpSelect
} else {
pNC = (*NameContext)(unsafe.Pointer(pNC)).FpNext
}
@@ -114771,14 +116581,14 @@ func columnTypeImpl(tls *libc.TLS, pNC uintptr, pExpr uintptr, pzOrigDb uintptr,
// The "table" is actually a sub-select or a view in the FROM clause
// of the SELECT statement. Return the declaration type and origin
// data for the result-set column of the sub-select.
- if (iCol < (*ExprList)(unsafe.Pointer((*Select)(unsafe.Pointer(pS)).FpEList)).FnExpr) &&
- (iCol >= 0) {
+ if iCol < (*ExprList)(unsafe.Pointer((*Select)(unsafe.Pointer(pS)).FpEList)).FnExpr &&
+ iCol >= 0 {
// If iCol is less than zero, then the expression requests the
// rowid of the sub-select or view. This expression is legal (see
// test case misc2.2.2) - it always evaluates to NULL.
// var sNC NameContext at bp, 32
- var p uintptr = (*ExprList_item)(unsafe.Pointer(((*Select)(unsafe.Pointer(pS)).FpEList + 8 /* &.a */) + uintptr(iCol)*20)).FpExpr
+ var p uintptr = (*ExprList_item)(unsafe.Pointer((*Select)(unsafe.Pointer(pS)).FpEList + 8 + uintptr(iCol)*20)).FpExpr
(*NameContext)(unsafe.Pointer(bp /* &sNC */)).FpSrcList = (*Select)(unsafe.Pointer(pS)).FpSrc
(*NameContext)(unsafe.Pointer(bp /* &sNC */)).FpNext = pNC
(*NameContext)(unsafe.Pointer(bp /* &sNC */)).FpParse = (*NameContext)(unsafe.Pointer(pNC)).FpParse
@@ -114792,14 +116602,14 @@ func columnTypeImpl(tls *libc.TLS, pNC uintptr, pExpr uintptr, pzOrigDb uintptr,
}
if iCol < 0 {
- zType = ts + 11384 /* "INTEGER" */
- *(*uintptr)(unsafe.Pointer(bp + 40 /* zOrigCol */)) = ts + 14757 /* "rowid" */
+ zType = ts + 1090 /* "INTEGER" */
+ *(*uintptr)(unsafe.Pointer(bp + 40 /* zOrigCol */)) = ts + 15961 /* "rowid" */
} else {
- *(*uintptr)(unsafe.Pointer(bp + 40 /* zOrigCol */)) = (*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FaCol + uintptr(iCol)*20)).FzName
- zType = Xsqlite3ColumnType(tls, ((*Table)(unsafe.Pointer(pTab)).FaCol + uintptr(iCol)*20), uintptr(0))
+ *(*uintptr)(unsafe.Pointer(bp + 40 /* zOrigCol */)) = (*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FaCol + uintptr(iCol)*16)).FzCnName
+ zType = Xsqlite3ColumnType(tls, (*Table)(unsafe.Pointer(pTab)).FaCol+uintptr(iCol)*16, uintptr(0))
}
*(*uintptr)(unsafe.Pointer(bp + 36 /* zOrigTab */)) = (*Table)(unsafe.Pointer(pTab)).FzName
- if ((*NameContext)(unsafe.Pointer(pNC)).FpParse != 0) && ((*Table)(unsafe.Pointer(pTab)).FpSchema != 0) {
+ if (*NameContext)(unsafe.Pointer(pNC)).FpParse != 0 && (*Table)(unsafe.Pointer(pTab)).FpSchema != 0 {
var iDb int32 = Xsqlite3SchemaToIndex(tls, (*Parse)(unsafe.Pointer((*NameContext)(unsafe.Pointer(pNC)).FpParse)).Fdb, (*Table)(unsafe.Pointer(pTab)).FpSchema)
*(*uintptr)(unsafe.Pointer(bp + 32 /* zOrigDb */)) = (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer((*Parse)(unsafe.Pointer((*NameContext)(unsafe.Pointer(pNC)).FpParse)).Fdb)).FaDb + uintptr(iDb)*16)).FzDbSName
}
@@ -114814,9 +116624,11 @@ func columnTypeImpl(tls *libc.TLS, pNC uintptr, pExpr uintptr, pzOrigDb uintptr,
// statement.
// var sNC NameContext at bp+44, 32
- var pS uintptr = *(*uintptr)(unsafe.Pointer(pExpr + 20 /* &.x */))
- var p uintptr = (*ExprList_item)(unsafe.Pointer(((*Select)(unsafe.Pointer(pS)).FpEList + 8 /* &.a */))).FpExpr
+ var pS uintptr
+ var p uintptr
+ pS = *(*uintptr)(unsafe.Pointer(pExpr + 20))
+ p = (*ExprList_item)(unsafe.Pointer((*Select)(unsafe.Pointer(pS)).FpEList + 8)).FpExpr
(*NameContext)(unsafe.Pointer(bp + 44 /* &sNC */)).FpSrcList = (*Select)(unsafe.Pointer(pS)).FpSrc
(*NameContext)(unsafe.Pointer(bp + 44 /* &sNC */)).FpNext = pNC
(*NameContext)(unsafe.Pointer(bp + 44 /* &sNC */)).FpParse = (*NameContext)(unsafe.Pointer(pNC)).FpParse
@@ -114837,7 +116649,7 @@ func columnTypeImpl(tls *libc.TLS, pNC uintptr, pExpr uintptr, pzOrigDb uintptr,
// Generate code that will tell the VDBE the declaration types of columns
// in the result set.
-func generateColumnTypes(tls *libc.TLS, pParse uintptr, pTabList uintptr, pEList uintptr) { /* sqlite3.c:133962:13: */
+func generateColumnTypes(tls *libc.TLS, pParse uintptr, pTabList uintptr, pEList uintptr) { /* sqlite3.c:135134:13: */
bp := tls.Alloc(44)
defer tls.Free(44)
@@ -114849,7 +116661,7 @@ func generateColumnTypes(tls *libc.TLS, pParse uintptr, pTabList uintptr, pEList
(*NameContext)(unsafe.Pointer(bp /* &sNC */)).FpParse = pParse
(*NameContext)(unsafe.Pointer(bp /* &sNC */)).FpNext = uintptr(0)
for i = 0; i < (*ExprList)(unsafe.Pointer(pEList)).FnExpr; i++ {
- var p uintptr = (*ExprList_item)(unsafe.Pointer((pEList + 8 /* &.a */) + uintptr(i)*20)).FpExpr
+ var p uintptr = (*ExprList_item)(unsafe.Pointer(pEList + 8 + uintptr(i)*20)).FpExpr
var zType uintptr
*(*uintptr)(unsafe.Pointer(bp + 32 /* zOrigDb */)) = uintptr(0)
*(*uintptr)(unsafe.Pointer(bp + 36 /* zOrigTab */)) = uintptr(0)
@@ -114894,7 +116706,7 @@ func generateColumnTypes(tls *libc.TLS, pParse uintptr, pTabList uintptr, pEList
// full=ON, short=ANY: If the result refers directly to a table column,
// then the result column name with the table name
// prefix, ex: TABLE.COLUMN. Otherwise use zSpan.
-func Xsqlite3GenerateColumnNames(tls *libc.TLS, pParse uintptr, pSelect uintptr) { /* sqlite3.c:134029:21: */
+func Xsqlite3GenerateColumnNames(tls *libc.TLS, pParse uintptr, pSelect uintptr) { /* sqlite3.c:135201:21: */
bp := tls.Alloc(24)
defer tls.Free(24)
@@ -114924,43 +116736,43 @@ func Xsqlite3GenerateColumnNames(tls *libc.TLS, pParse uintptr, pSelect uintptr)
pEList = (*Select)(unsafe.Pointer(pSelect)).FpEList
(*Parse)(unsafe.Pointer(pParse)).FcolNamesSet = U8(1)
- fullName = (libc.Bool32(((*Sqlite3)(unsafe.Pointer(db)).Fflags & uint64(SQLITE_FullColNames)) != uint64(0)))
- srcName = (libc.Bool32((((*Sqlite3)(unsafe.Pointer(db)).Fflags & uint64(SQLITE_ShortColNames)) != uint64(0)) || (fullName != 0)))
+ fullName = libc.Bool32((*Sqlite3)(unsafe.Pointer(db)).Fflags&uint64(SQLITE_FullColNames) != uint64(0))
+ srcName = libc.Bool32((*Sqlite3)(unsafe.Pointer(db)).Fflags&uint64(SQLITE_ShortColNames) != uint64(0) || fullName != 0)
Xsqlite3VdbeSetNumCols(tls, v, (*ExprList)(unsafe.Pointer(pEList)).FnExpr)
for i = 0; i < (*ExprList)(unsafe.Pointer(pEList)).FnExpr; i++ {
- var p uintptr = (*ExprList_item)(unsafe.Pointer((pEList + 8 /* &.a */) + uintptr(i)*20)).FpExpr
+ var p uintptr = (*ExprList_item)(unsafe.Pointer(pEList + 8 + uintptr(i)*20)).FpExpr
// Agg processing has not run yet
// Covering idx not yet coded
- if ((*ExprList_item)(unsafe.Pointer((pEList+8 /* &.a */)+uintptr(i)*20)).FzEName != 0) && ((int32(*(*uint8)(unsafe.Pointer(((pEList + 8 /* &.a */) + uintptr(i)*20) + 12 /* &.eEName */)) & 0x3 >> 0)) == ENAME_NAME) {
+ if (*ExprList_item)(unsafe.Pointer(pEList+8+uintptr(i)*20)).FzEName != 0 && int32(*(*uint8)(unsafe.Pointer(pEList + 8 + uintptr(i)*20 + 12))&0x3>>0) == ENAME_NAME {
// An AS clause always takes first priority
- var zName uintptr = (*ExprList_item)(unsafe.Pointer((pEList + 8 /* &.a */) + uintptr(i)*20)).FzEName
+ var zName uintptr = (*ExprList_item)(unsafe.Pointer(pEList + 8 + uintptr(i)*20)).FzEName
Xsqlite3VdbeSetColName(tls, v, i, COLNAME_NAME, zName, libc.UintptrFromInt32(-1))
- } else if (srcName != 0) && (int32((*Expr)(unsafe.Pointer(p)).Fop) == TK_COLUMN) {
+ } else if srcName != 0 && int32((*Expr)(unsafe.Pointer(p)).Fop) == TK_COLUMN {
var zCol uintptr
var iCol int32 = int32((*Expr)(unsafe.Pointer(p)).FiColumn)
- pTab = *(*uintptr)(unsafe.Pointer(p + 44 /* &.y */))
+ pTab = *(*uintptr)(unsafe.Pointer(p + 44))
if iCol < 0 {
iCol = int32((*Table)(unsafe.Pointer(pTab)).FiPKey)
}
if iCol < 0 {
- zCol = ts + 14757 /* "rowid" */
+ zCol = ts + 15961 /* "rowid" */
} else {
- zCol = (*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FaCol + uintptr(iCol)*20)).FzName
+ zCol = (*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FaCol + uintptr(iCol)*16)).FzCnName
}
if fullName != 0 {
var zName uintptr = uintptr(0)
- zName = Xsqlite3MPrintf(tls, db, ts+10785 /* "%s.%s" */, libc.VaList(bp, (*Table)(unsafe.Pointer(pTab)).FzName, zCol))
+ zName = Xsqlite3MPrintf(tls, db, ts+11899 /* "%s.%s" */, libc.VaList(bp, (*Table)(unsafe.Pointer(pTab)).FzName, zCol))
Xsqlite3VdbeSetColName(tls, v, i, COLNAME_NAME, zName, *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{Xsqlite3OomFault})))
} else {
Xsqlite3VdbeSetColName(tls, v, i, COLNAME_NAME, zCol, libc.UintptrFromInt32(-1))
}
} else {
- var z uintptr = (*ExprList_item)(unsafe.Pointer((pEList + 8 /* &.a */) + uintptr(i)*20)).FzEName
+ var z uintptr = (*ExprList_item)(unsafe.Pointer(pEList + 8 + uintptr(i)*20)).FzEName
if z == uintptr(0) {
- z = Xsqlite3MPrintf(tls, db, ts+17155 /* "column%d" */, libc.VaList(bp+16, (i+1)))
+ z = Xsqlite3MPrintf(tls, db, ts+18432 /* "column%d" */, libc.VaList(bp+16, i+1))
} else {
z = Xsqlite3DbStrDup(tls, db, z)
}
@@ -114990,7 +116802,7 @@ func Xsqlite3GenerateColumnNames(tls *libc.TLS, pParse uintptr, pSelect uintptr)
// when modifying this routine to avoid breaking legacy.
//
// See Also: sqlite3GenerateColumnNames()
-func Xsqlite3ColumnsFromExprList(tls *libc.TLS, pParse uintptr, pEList uintptr, pnCol uintptr, paCol uintptr) int32 { /* sqlite3.c:134121:20: */
+func Xsqlite3ColumnsFromExprList(tls *libc.TLS, pParse uintptr, pEList uintptr, pnCol uintptr, paCol uintptr) int32 { /* sqlite3.c:135294:20: */
bp := tls.Alloc(52)
defer tls.Free(52)
@@ -115011,7 +116823,7 @@ func Xsqlite3ColumnsFromExprList(tls *libc.TLS, pParse uintptr, pEList uintptr,
Xsqlite3HashInit(tls, bp+32 /* &ht */)
if pEList != 0 {
nCol = (*ExprList)(unsafe.Pointer(pEList)).FnExpr
- aCol = Xsqlite3DbMallocZero(tls, db, (uint64(uint32(unsafe.Sizeof(Column{})) * uint32(nCol))))
+ aCol = Xsqlite3DbMallocZero(tls, db, uint64(uint32(unsafe.Sizeof(Column{}))*uint32(nCol)))
if nCol > 32767 {
nCol = 32767
@@ -115027,65 +116839,67 @@ func Xsqlite3ColumnsFromExprList(tls *libc.TLS, pParse uintptr, pEList uintptr,
i = 0
pCol = aCol
__1:
- if !((i < nCol) && !(int32((*Sqlite3)(unsafe.Pointer(db)).FmallocFailed) != 0)) {
+ if !(i < nCol && !(int32((*Sqlite3)(unsafe.Pointer(db)).FmallocFailed) != 0)) {
goto __3
}
{
// Get an appropriate name for the column
- if ((libc.AssignUintptr(&zName, (*ExprList_item)(unsafe.Pointer((pEList+8 /* &.a */)+uintptr(i)*20)).FzEName)) != uintptr(0)) && ((int32(*(*uint8)(unsafe.Pointer(((pEList + 8 /* &.a */) + uintptr(i)*20) + 12 /* &.eEName */)) & 0x3 >> 0)) == ENAME_NAME) {
+ if libc.AssignUintptr(&zName, (*ExprList_item)(unsafe.Pointer(pEList+8+uintptr(i)*20)).FzEName) != uintptr(0) && int32(*(*uint8)(unsafe.Pointer(pEList + 8 + uintptr(i)*20 + 12))&0x3>>0) == ENAME_NAME {
// If the column contains an "AS <name>" phrase, use <name> as the name
} else {
- var pColExpr uintptr = Xsqlite3ExprSkipCollateAndLikely(tls, (*ExprList_item)(unsafe.Pointer((pEList+8 /* &.a */)+uintptr(i)*20)).FpExpr)
- for (pColExpr != uintptr(0)) && (int32((*Expr)(unsafe.Pointer(pColExpr)).Fop) == TK_DOT) {
+ var pColExpr uintptr = Xsqlite3ExprSkipCollateAndLikely(tls, (*ExprList_item)(unsafe.Pointer(pEList+8+uintptr(i)*20)).FpExpr)
+ for pColExpr != uintptr(0) && int32((*Expr)(unsafe.Pointer(pColExpr)).Fop) == TK_DOT {
pColExpr = (*Expr)(unsafe.Pointer(pColExpr)).FpRight
}
- if (int32((*Expr)(unsafe.Pointer(pColExpr)).Fop) == TK_COLUMN) && ((libc.AssignUintptr(&pTab, *(*uintptr)(unsafe.Pointer(pColExpr + 44 /* &.y */)))) != uintptr(0)) {
+ if int32((*Expr)(unsafe.Pointer(pColExpr)).Fop) == TK_COLUMN &&
+ (*Expr)(unsafe.Pointer(pColExpr)).Fflags&U32(EP_WinFunc|EP_Subrtn) == U32(0) &&
+ libc.AssignUintptr(&pTab, *(*uintptr)(unsafe.Pointer(pColExpr + 44))) != uintptr(0) {
// For columns use the column name name
var iCol int32 = int32((*Expr)(unsafe.Pointer(pColExpr)).FiColumn)
if iCol < 0 {
iCol = int32((*Table)(unsafe.Pointer(pTab)).FiPKey)
}
if iCol >= 0 {
- zName = (*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FaCol + uintptr(iCol)*20)).FzName
+ zName = (*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FaCol + uintptr(iCol)*16)).FzCnName
} else {
- zName = ts + 14757 /* "rowid" */
+ zName = ts + 15961 /* "rowid" */
}
} else if int32((*Expr)(unsafe.Pointer(pColExpr)).Fop) == TK_ID {
- zName = *(*uintptr)(unsafe.Pointer(pColExpr + 8 /* &.u */))
+ zName = *(*uintptr)(unsafe.Pointer(pColExpr + 8))
} else {
// Use the original text of the column expression as its name
- zName = (*ExprList_item)(unsafe.Pointer((pEList + 8 /* &.a */) + uintptr(i)*20)).FzEName
+ zName = (*ExprList_item)(unsafe.Pointer(pEList + 8 + uintptr(i)*20)).FzEName
}
}
- if (zName != 0) && !(Xsqlite3IsTrueOrFalse(tls, zName) != 0) {
+ if zName != 0 && !(Xsqlite3IsTrueOrFalse(tls, zName) != 0) {
zName = Xsqlite3DbStrDup(tls, db, zName)
} else {
- zName = Xsqlite3MPrintf(tls, db, ts+17155 /* "column%d" */, libc.VaList(bp, (i+1)))
+ zName = Xsqlite3MPrintf(tls, db, ts+18432 /* "column%d" */, libc.VaList(bp, i+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.
*(*U32)(unsafe.Pointer(bp + 48 /* cnt */)) = U32(0)
- for (zName != 0) && (Xsqlite3HashFind(tls, bp+32 /* &ht */, zName) != uintptr(0)) {
+ for zName != 0 && Xsqlite3HashFind(tls, bp+32, zName) != uintptr(0) {
nName = Xsqlite3Strlen30(tls, zName)
if nName > 0 {
- for j = (nName - 1); (j > 0) && ((int32(Xsqlite3CtypeMap[uint8(*(*uint8)(unsafe.Pointer(zName + uintptr(j))))]) & 0x04) != 0); j-- {
+ for j = nName - 1; j > 0 && int32(Xsqlite3CtypeMap[uint8(*(*uint8)(unsafe.Pointer(zName + uintptr(j))))])&0x04 != 0; j-- {
}
if int32(*(*uint8)(unsafe.Pointer(zName + uintptr(j)))) == ':' {
nName = j
}
}
- zName = Xsqlite3MPrintf(tls, db, ts+17164 /* "%.*z:%u" */, libc.VaList(bp+8, nName, zName, libc.PreIncUint32(&*(*U32)(unsafe.Pointer(bp + 48 /* cnt */)), 1)))
- if *(*U32)(unsafe.Pointer(bp + 48 /* cnt */)) > U32(3) {
+ zName = Xsqlite3MPrintf(tls, db, ts+18441 /* "%.*z:%u" */, libc.VaList(bp+8, nName, zName, libc.PreIncUint32(&*(*U32)(unsafe.Pointer(bp + 48 /* cnt */)), 1)))
+ if *(*U32)(unsafe.Pointer(bp + 48)) > U32(3) {
Xsqlite3_randomness(tls, int32(unsafe.Sizeof(U32(0))), bp+48 /* &cnt */)
}
}
- (*Column)(unsafe.Pointer(pCol)).FzName = zName
+ (*Column)(unsafe.Pointer(pCol)).FzCnName = zName
(*Column)(unsafe.Pointer(pCol)).FhName = Xsqlite3StrIHash(tls, zName)
- if (zName != 0) && (Xsqlite3HashInsert(tls, bp+32 /* &ht */, zName, pCol) == pCol) {
+ if zName != 0 && Xsqlite3HashInsert(tls, bp+32, zName, pCol) == pCol {
Xsqlite3OomFault(tls, db)
}
@@ -115093,7 +116907,7 @@ __1:
goto __2
__2:
i++
- pCol += 20
+ pCol += 16
goto __1
goto __3
__3:
@@ -115101,7 +116915,7 @@ __3:
Xsqlite3HashClear(tls, bp+32 /* &ht */)
if (*Sqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 {
for j = 0; j < i; j++ {
- Xsqlite3DbFree(tls, db, (*Column)(unsafe.Pointer(aCol+uintptr(j)*20)).FzName)
+ Xsqlite3DbFree(tls, db, (*Column)(unsafe.Pointer(aCol+uintptr(j)*16)).FzCnName)
}
Xsqlite3DbFree(tls, db, aCol)
*(*uintptr)(unsafe.Pointer(paCol)) = uintptr(0)
@@ -115120,7 +116934,7 @@ __3:
//
// This routine requires that all identifiers in the SELECT
// statement be resolved.
-func Xsqlite3SelectAddColumnTypeAndCollation(tls *libc.TLS, pParse uintptr, pTab uintptr, pSelect uintptr, aff uint8) { /* sqlite3.c:134225:21: */
+func Xsqlite3SelectAddColumnTypeAndCollation(tls *libc.TLS, pParse uintptr, pTab uintptr, pSelect uintptr, aff uint8) { /* sqlite3.c:135401:21: */
bp := tls.Alloc(32)
defer tls.Free(32)
@@ -115147,35 +116961,39 @@ __1:
}
{
var zType uintptr
- var n int32
- var m int32
- *(*U32)(unsafe.Pointer(pTab + 36 /* &.tabFlags */)) |= (U32(int32((*Column)(unsafe.Pointer(pCol)).FcolFlags) & COLFLAG_NOINSERT))
+ var n I64
+ var m I64
+ *(*U32)(unsafe.Pointer(pTab + 28)) |= U32(int32((*Column)(unsafe.Pointer(pCol)).FcolFlags) & COLFLAG_NOINSERT)
p = (*ExprList_item)(unsafe.Pointer(a + uintptr(i)*20)).FpExpr
zType = columnTypeImpl(tls, bp /* &sNC */, p, uintptr(0), uintptr(0), uintptr(0))
// pCol->szEst = ... // Column size est for SELECT tables never used
(*Column)(unsafe.Pointer(pCol)).Faffinity = Xsqlite3ExprAffinity(tls, p)
if zType != 0 {
- m = Xsqlite3Strlen30(tls, zType)
- n = Xsqlite3Strlen30(tls, (*Column)(unsafe.Pointer(pCol)).FzName)
- (*Column)(unsafe.Pointer(pCol)).FzName = Xsqlite3DbReallocOrFree(tls, db, (*Column)(unsafe.Pointer(pCol)).FzName, (uint64((n + m) + 2)))
- if (*Column)(unsafe.Pointer(pCol)).FzName != 0 {
- libc.Xmemcpy(tls, ((*Column)(unsafe.Pointer(pCol)).FzName + uintptr((n + 1))), zType, (uint32(m + 1)))
- *(*U16)(unsafe.Pointer(pCol + 16 /* &.colFlags */)) |= U16((COLFLAG_HASTYPE))
+ m = I64(Xsqlite3Strlen30(tls, zType))
+ n = I64(Xsqlite3Strlen30(tls, (*Column)(unsafe.Pointer(pCol)).FzCnName))
+ (*Column)(unsafe.Pointer(pCol)).FzCnName = Xsqlite3DbReallocOrFree(tls, db, (*Column)(unsafe.Pointer(pCol)).FzCnName, uint64(n+m+int64(2)))
+ if (*Column)(unsafe.Pointer(pCol)).FzCnName != 0 {
+ libc.Xmemcpy(tls, (*Column)(unsafe.Pointer(pCol)).FzCnName+uintptr(n+int64(1)), zType, uint32(m+int64(1)))
+ *(*U16)(unsafe.Pointer(pCol + 12)) |= U16(COLFLAG_HASTYPE)
+ } else {
+
+ *(*U16)(unsafe.Pointer(pCol + 12)) &= libc.Uint16FromInt32(libc.CplInt32(COLFLAG_HASTYPE | COLFLAG_HASCOLL))
}
}
if int32((*Column)(unsafe.Pointer(pCol)).Faffinity) <= SQLITE_AFF_NONE {
(*Column)(unsafe.Pointer(pCol)).Faffinity = aff
}
pColl = Xsqlite3ExprCollSeq(tls, pParse, p)
- if (pColl != 0) && ((*Column)(unsafe.Pointer(pCol)).FzColl == uintptr(0)) {
- (*Column)(unsafe.Pointer(pCol)).FzColl = Xsqlite3DbStrDup(tls, db, (*CollSeq)(unsafe.Pointer(pColl)).FzName)
+ if pColl != 0 {
+
+ Xsqlite3ColumnSetColl(tls, db, pCol, (*CollSeq)(unsafe.Pointer(pColl)).FzName)
}
}
goto __2
__2:
i++
- pCol += 20
+ pCol += 16
goto __1
goto __3
__3:
@@ -115185,14 +117003,14 @@ __3:
// Given a SELECT statement, generate a Table structure that describes
// the result set of that SELECT.
-func Xsqlite3ResultSetOfSelect(tls *libc.TLS, pParse uintptr, pSelect uintptr, aff uint8) uintptr { /* sqlite3.c:134276:22: */
+func Xsqlite3ResultSetOfSelect(tls *libc.TLS, pParse uintptr, pSelect uintptr, aff uint8) uintptr { /* sqlite3.c:135456:22: */
var pTab uintptr
var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb
var savedFlags U64
savedFlags = (*Sqlite3)(unsafe.Pointer(db)).Fflags
- *(*U64)(unsafe.Pointer(db + 32 /* &.flags */)) &= (libc.CplUint64(uint64(SQLITE_FullColNames)))
- *(*U64)(unsafe.Pointer(db + 32 /* &.flags */)) |= (uint64(SQLITE_ShortColNames))
+ *(*U64)(unsafe.Pointer(db + 32)) &= libc.CplUint64(uint64(SQLITE_FullColNames))
+ *(*U64)(unsafe.Pointer(db + 32)) |= uint64(SQLITE_ShortColNames)
Xsqlite3SelectPrep(tls, pParse, pSelect, uintptr(0))
(*Sqlite3)(unsafe.Pointer(db)).Fflags = savedFlags
if (*Parse)(unsafe.Pointer(pParse)).FnErr != 0 {
@@ -115208,7 +117026,7 @@ func Xsqlite3ResultSetOfSelect(tls *libc.TLS, pParse uintptr, pSelect uintptr, a
(*Table)(unsafe.Pointer(pTab)).FnTabRef = U32(1)
(*Table)(unsafe.Pointer(pTab)).FzName = uintptr(0)
(*Table)(unsafe.Pointer(pTab)).FnRowLogEst = int16(200)
- Xsqlite3ColumnsFromExprList(tls, pParse, (*Select)(unsafe.Pointer(pSelect)).FpEList, (pTab + 42 /* &.nCol */), (pTab + 4 /* &.aCol */))
+ Xsqlite3ColumnsFromExprList(tls, pParse, (*Select)(unsafe.Pointer(pSelect)).FpEList, pTab+34, pTab+4)
Xsqlite3SelectAddColumnTypeAndCollation(tls, pParse, pTab, pSelect, aff)
(*Table)(unsafe.Pointer(pTab)).FiPKey = int16(-1)
if (*Sqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 {
@@ -115220,12 +117038,12 @@ func Xsqlite3ResultSetOfSelect(tls *libc.TLS, pParse uintptr, pSelect uintptr, a
// Get a VDBE for the given parser context. Create a new one if necessary.
// If an error occurs, return NULL and leave a message in pParse.
-func Xsqlite3GetVdbe(tls *libc.TLS, pParse uintptr) uintptr { /* sqlite3.c:134309:21: */
+func Xsqlite3GetVdbe(tls *libc.TLS, pParse uintptr) uintptr { /* sqlite3.c:135489:21: */
if (*Parse)(unsafe.Pointer(pParse)).FpVdbe != 0 {
return (*Parse)(unsafe.Pointer(pParse)).FpVdbe
}
- if ((*Parse)(unsafe.Pointer(pParse)).FpToplevel == uintptr(0)) &&
- (((*Sqlite3)(unsafe.Pointer(((*Parse)(unsafe.Pointer(pParse)).Fdb))).FdbOptFlags & (U32(SQLITE_FactorOutConst))) == U32(0)) {
+ if (*Parse)(unsafe.Pointer(pParse)).FpToplevel == uintptr(0) &&
+ (*Sqlite3)(unsafe.Pointer((*Parse)(unsafe.Pointer(pParse)).Fdb)).FdbOptFlags&U32(SQLITE_FactorOutConst) == U32(0) {
(*Parse)(unsafe.Pointer(pParse)).FokConstFactor = U8(1)
}
return Xsqlite3VdbeCreate(tls, pParse)
@@ -115252,7 +117070,7 @@ func Xsqlite3GetVdbe(tls *libc.TLS, pParse uintptr) uintptr { /* sqlite3.c:13430
// redefined. The UNION ALL operator uses this property to force
// the reuse of the same limit and offset registers across multiple
// SELECT statements.
-func computeLimitRegisters(tls *libc.TLS, pParse uintptr, p uintptr, iBreak int32) { /* sqlite3.c:134345:13: */
+func computeLimitRegisters(tls *libc.TLS, pParse uintptr, p uintptr, iBreak int32) { /* sqlite3.c:135525:13: */
bp := tls.Alloc(4)
defer tls.Free(4)
@@ -115276,14 +117094,14 @@ func computeLimitRegisters(tls *libc.TLS, pParse uintptr, p uintptr, iBreak int3
(*Select)(unsafe.Pointer(p)).FiLimit = libc.AssignInt32(&iLimit, libc.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1))
v = Xsqlite3GetVdbe(tls, pParse)
- if Xsqlite3ExprIsInteger(tls, (*Expr)(unsafe.Pointer(pLimit)).FpLeft, bp /* &n */) != 0 {
+ if Xsqlite3ExprIsInteger(tls, (*Expr)(unsafe.Pointer(pLimit)).FpLeft, bp) != 0 {
Xsqlite3VdbeAddOp2(tls, v, OP_Integer, *(*int32)(unsafe.Pointer(bp /* n */)), iLimit)
- if *(*int32)(unsafe.Pointer(bp /* n */)) == 0 {
+ if *(*int32)(unsafe.Pointer(bp)) == 0 {
Xsqlite3VdbeGoto(tls, v, iBreak)
- } else if (*(*int32)(unsafe.Pointer(bp /* n */)) >= 0) && (int32((*Select)(unsafe.Pointer(p)).FnSelectRow) > int32(Xsqlite3LogEst(tls, U64(*(*int32)(unsafe.Pointer(bp /* n */)))))) {
+ } else if *(*int32)(unsafe.Pointer(bp)) >= 0 && int32((*Select)(unsafe.Pointer(p)).FnSelectRow) > int32(Xsqlite3LogEst(tls, U64(*(*int32)(unsafe.Pointer(bp))))) {
(*Select)(unsafe.Pointer(p)).FnSelectRow = Xsqlite3LogEst(tls, U64(*(*int32)(unsafe.Pointer(bp /* n */))))
- *(*U32)(unsafe.Pointer(p + 4 /* &.selFlags */)) |= (U32(SF_FixedLimit))
+ *(*U32)(unsafe.Pointer(p + 4)) |= U32(SF_FixedLimit)
}
} else {
Xsqlite3ExprCode(tls, pParse, (*Expr)(unsafe.Pointer(pLimit)).FpLeft, iLimit)
@@ -115297,7 +117115,7 @@ func computeLimitRegisters(tls *libc.TLS, pParse uintptr, p uintptr, iBreak int3
Xsqlite3ExprCode(tls, pParse, (*Expr)(unsafe.Pointer(pLimit)).FpRight, iOffset)
Xsqlite3VdbeAddOp1(tls, v, OP_MustBeInt, iOffset)
- Xsqlite3VdbeAddOp3(tls, v, OP_OffsetLimit, iLimit, (iOffset + 1), iOffset)
+ Xsqlite3VdbeAddOp3(tls, v, OP_OffsetLimit, iLimit, iOffset+1, iOffset)
}
}
@@ -115309,7 +117127,7 @@ func computeLimitRegisters(tls *libc.TLS, pParse uintptr, p uintptr, iBreak int3
//
// The collating sequence for the compound select is taken from the
// left-most term of the select that has a collating sequence.
-func multiSelectCollSeq(tls *libc.TLS, pParse uintptr, p uintptr, iCol int32) uintptr { /* sqlite3.c:134402:16: */
+func multiSelectCollSeq(tls *libc.TLS, pParse uintptr, p uintptr, iCol int32) uintptr { /* sqlite3.c:135582:16: */
var pRet uintptr
if (*Select)(unsafe.Pointer(p)).FpPrior != 0 {
pRet = multiSelectCollSeq(tls, pParse, (*Select)(unsafe.Pointer(p)).FpPrior, iCol)
@@ -115320,8 +117138,8 @@ func multiSelectCollSeq(tls *libc.TLS, pParse uintptr, p uintptr, iCol int32) ui
// iCol must be less than p->pEList->nExpr. Otherwise an error would
// have been thrown during name resolution and we would not have gotten
// this far
- if (pRet == uintptr(0)) && (iCol < (*ExprList)(unsafe.Pointer((*Select)(unsafe.Pointer(p)).FpEList)).FnExpr) {
- pRet = Xsqlite3ExprCollSeq(tls, pParse, (*ExprList_item)(unsafe.Pointer(((*Select)(unsafe.Pointer(p)).FpEList+8 /* &.a */)+uintptr(iCol)*20)).FpExpr)
+ if pRet == uintptr(0) && iCol < (*ExprList)(unsafe.Pointer((*Select)(unsafe.Pointer(p)).FpEList)).FnExpr {
+ pRet = Xsqlite3ExprCollSeq(tls, pParse, (*ExprList_item)(unsafe.Pointer((*Select)(unsafe.Pointer(p)).FpEList+8+uintptr(iCol)*20)).FpExpr)
}
return pRet
}
@@ -115333,30 +117151,35 @@ func multiSelectCollSeq(tls *libc.TLS, pParse uintptr, p uintptr, iCol int32) ui
// Space to hold the KeyInfo structure is obtained from malloc. The calling
// function is responsible for ensuring that this structure is eventually
// freed.
-func multiSelectOrderByKeyInfo(tls *libc.TLS, pParse uintptr, p uintptr, nExtra int32) uintptr { /* sqlite3.c:134428:16: */
+func multiSelectOrderByKeyInfo(tls *libc.TLS, pParse uintptr, p uintptr, nExtra int32) uintptr { /* sqlite3.c:135608:16: */
var pOrderBy uintptr = (*Select)(unsafe.Pointer(p)).FpOrderBy
- var nOrderBy int32 = (*ExprList)(unsafe.Pointer((*Select)(unsafe.Pointer(p)).FpOrderBy)).FnExpr
+ var nOrderBy int32
+ if pOrderBy != uintptr(0) {
+ nOrderBy = (*ExprList)(unsafe.Pointer(pOrderBy)).FnExpr
+ } else {
+ nOrderBy = 0
+ }
var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb
- var pRet uintptr = Xsqlite3KeyInfoAlloc(tls, db, (nOrderBy + nExtra), 1)
+ var pRet uintptr = Xsqlite3KeyInfoAlloc(tls, db, nOrderBy+nExtra, 1)
if pRet != 0 {
var i int32
for i = 0; i < nOrderBy; i++ {
- var pItem uintptr = ((pOrderBy + 8 /* &.a */) + uintptr(i)*20)
+ var pItem uintptr = pOrderBy + 8 + uintptr(i)*20
var pTerm uintptr = (*ExprList_item)(unsafe.Pointer(pItem)).FpExpr
var pColl uintptr
- if ((*Expr)(unsafe.Pointer(pTerm)).Fflags & U32(EP_Collate)) != 0 {
+ if (*Expr)(unsafe.Pointer(pTerm)).Fflags&U32(EP_Collate) != 0 {
pColl = Xsqlite3ExprCollSeq(tls, pParse, pTerm)
} else {
- pColl = multiSelectCollSeq(tls, pParse, p, (int32(*(*U16)(unsafe.Pointer((pItem + 16 /* &.u */ /* &.x */) /* &.iOrderByCol */))) - 1))
+ pColl = multiSelectCollSeq(tls, pParse, p, int32(*(*U16)(unsafe.Pointer(pItem + 16)))-1)
if pColl == uintptr(0) {
pColl = (*Sqlite3)(unsafe.Pointer(db)).FpDfltColl
}
- (*ExprList_item)(unsafe.Pointer((pOrderBy + 8 /* &.a */) + uintptr(i)*20)).FpExpr = Xsqlite3ExprAddCollateString(tls, pParse, pTerm, (*CollSeq)(unsafe.Pointer(pColl)).FzName)
+ (*ExprList_item)(unsafe.Pointer(pOrderBy + 8 + uintptr(i)*20)).FpExpr = Xsqlite3ExprAddCollateString(tls, pParse, pTerm, (*CollSeq)(unsafe.Pointer(pColl)).FzName)
}
- *(*uintptr)(unsafe.Pointer((pRet + 20 /* &.aColl */) + uintptr(i)*4)) = pColl
- *(*U8)(unsafe.Pointer((*KeyInfo)(unsafe.Pointer(pRet)).FaSortFlags + uintptr(i))) = (*ExprList_item)(unsafe.Pointer((pOrderBy + 8 /* &.a */) + uintptr(i)*20)).FsortFlags
+ *(*uintptr)(unsafe.Pointer(pRet + 20 + uintptr(i)*4)) = pColl
+ *(*U8)(unsafe.Pointer((*KeyInfo)(unsafe.Pointer(pRet)).FaSortFlags + uintptr(i))) = (*ExprList_item)(unsafe.Pointer(pOrderBy + 8 + uintptr(i)*20)).FsortFlags
}
}
@@ -115397,7 +117220,7 @@ func multiSelectOrderByKeyInfo(tls *libc.TLS, pParse uintptr, p uintptr, nExtra
// with a positive value, then the first OFFSET outputs are discarded rather
// than being sent to pDest. The LIMIT count does not begin until after OFFSET
// rows have been skipped.
-func generateWithRecursiveQuery(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) { /* sqlite3.c:134494:13: */
+func generateWithRecursiveQuery(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) { /* sqlite3.c:135674:13: */
bp := tls.Alloc(28)
defer tls.Free(28)
@@ -115426,7 +117249,6 @@ func generateWithRecursiveQuery(tls *libc.TLS, pParse uintptr, p uintptr, pDest
pSrc = (*Select)(unsafe.Pointer(p)).FpSrc
nCol = (*ExprList)(unsafe.Pointer((*Select)(unsafe.Pointer(p)).FpEList)).FnExpr
v = (*Parse)(unsafe.Pointer(pParse)).FpVdbe
- pSetup = (*Select)(unsafe.Pointer(p)).FpPrior
iCurrent = 0
iDistinct = 0
eDest = SRT_Fifo // Registers used by LIMIT and OFFSET
@@ -115434,7 +117256,7 @@ func generateWithRecursiveQuery(tls *libc.TLS, pParse uintptr, p uintptr, pDest
if !((*Select)(unsafe.Pointer(p)).FpWin != 0) {
goto __1
}
- Xsqlite3ErrorMsg(tls, pParse, ts+17172 /* "cannot use windo..." */, 0)
+ Xsqlite3ErrorMsg(tls, pParse, ts+18449 /* "cannot use windo..." */, 0)
return
__1:
;
@@ -115455,7 +117277,7 @@ __2:
regLimit = (*Select)(unsafe.Pointer(p)).FiLimit
regOffset = (*Select)(unsafe.Pointer(p)).FiOffset
(*Select)(unsafe.Pointer(p)).FpLimit = uintptr(0)
- (*Select)(unsafe.Pointer(p)).FiLimit = libc.AssignPtrInt32(p+12 /* &.iOffset */, 0)
+ (*Select)(unsafe.Pointer(p)).FiLimit = libc.AssignPtrInt32(p+12, 0)
pOrderBy = (*Select)(unsafe.Pointer(p)).FpOrderBy
// Locate the cursor number of the Current table
@@ -115464,10 +117286,10 @@ __3:
if !(i < (*SrcList)(unsafe.Pointer(pSrc)).FnSrc) {
goto __5
}
- if !((uint32(int32(*(*uint16)(unsafe.Pointer((pSrc + 8 /* &.a */) + uintptr(i)*72 + 36 /* &.fg */ + 4 /* &.isRecursive */)) & 0x20 >> 5))) != 0) {
+ if !(uint32(int32(*(*uint16)(unsafe.Pointer(pSrc + 8 + uintptr(i)*72 + 36 + 4))&0x20>>5)) != 0) {
goto __6
}
- iCurrent = (*SrcItem)(unsafe.Pointer((pSrc + 8 /* &.a */) + uintptr(i)*72)).FiCursor
+ iCurrent = (*SrcItem)(unsafe.Pointer(pSrc + 8 + uintptr(i)*72)).FiCursor
goto __5
__6:
;
@@ -115510,7 +117332,7 @@ __8:
goto __9
}
pKeyInfo = multiSelectOrderByKeyInfo(tls, pParse, p, 1)
- Xsqlite3VdbeAddOp4(tls, v, OP_OpenEphemeral, iQueue, ((*ExprList)(unsafe.Pointer(pOrderBy)).FnExpr + 2), 0,
+ Xsqlite3VdbeAddOp4(tls, v, OP_OpenEphemeral, iQueue, (*ExprList)(unsafe.Pointer(pOrderBy)).FnExpr+2, 0,
pKeyInfo, -9)
(*SelectDest)(unsafe.Pointer(bp /* &destQueue */)).FpOrderBy = pOrderBy
goto __10
@@ -115522,8 +117344,8 @@ __10:
if !(iDistinct != 0) {
goto __11
}
- *(*int32)(unsafe.Pointer((p + 20 /* &.addrOpenEphm */))) = Xsqlite3VdbeAddOp2(tls, v, OP_OpenEphemeral, iDistinct, 0)
- *(*U32)(unsafe.Pointer(p + 4 /* &.selFlags */)) |= (U32(SF_UsesEphemeral))
+ *(*int32)(unsafe.Pointer(p + 20)) = Xsqlite3VdbeAddOp2(tls, v, OP_OpenEphemeral, iDistinct, 0)
+ *(*U32)(unsafe.Pointer(p + 4)) |= U32(SF_UsesEphemeral)
__11:
;
@@ -115537,20 +117359,19 @@ __11:
// iDistinct table. pFirstRec is left pointing to the left-most
// recursive term of the CTE.
pFirstRec = p
- pFirstRec = p
__12:
if !(pFirstRec != uintptr(0)) {
goto __14
}
- if !(((*Select)(unsafe.Pointer(pFirstRec)).FselFlags & U32(SF_Aggregate)) != 0) {
+ if !((*Select)(unsafe.Pointer(pFirstRec)).FselFlags&U32(SF_Aggregate) != 0) {
goto __15
}
- Xsqlite3ErrorMsg(tls, pParse, ts+17221 /* "recursive aggreg..." */, 0)
+ Xsqlite3ErrorMsg(tls, pParse, ts+18498 /* "recursive aggreg..." */, 0)
goto end_of_recursive_query
__15:
;
(*Select)(unsafe.Pointer(pFirstRec)).Fop = U8(TK_ALL)
- if !(((*Select)(unsafe.Pointer((*Select)(unsafe.Pointer(pFirstRec)).FpPrior)).FselFlags & U32(SF_Recursive)) == U32(0)) {
+ if !((*Select)(unsafe.Pointer((*Select)(unsafe.Pointer(pFirstRec)).FpPrior)).FselFlags&U32(SF_Recursive) == U32(0)) {
goto __16
}
goto __14
@@ -115567,7 +117388,7 @@ __14:
// Store the results of the setup-query in Queue.
pSetup = (*Select)(unsafe.Pointer(pFirstRec)).FpPrior
(*Select)(unsafe.Pointer(pSetup)).FpNext = uintptr(0)
- Xsqlite3VdbeExplain(tls, pParse, uint8(1), ts+17263 /* "SETUP" */, 0)
+ Xsqlite3VdbeExplain(tls, pParse, uint8(1), ts+18540 /* "SETUP" */, 0)
rc = Xsqlite3Select(tls, pParse, pSetup, bp /* &destQueue */)
(*Select)(unsafe.Pointer(pSetup)).FpNext = p
if !(rc != 0) {
@@ -115585,7 +117406,7 @@ __17:
if !(pOrderBy != 0) {
goto __18
}
- Xsqlite3VdbeAddOp3(tls, v, OP_Column, iQueue, ((*ExprList)(unsafe.Pointer(pOrderBy)).FnExpr + 1), regCurrent)
+ Xsqlite3VdbeAddOp3(tls, v, OP_Column, iQueue, (*ExprList)(unsafe.Pointer(pOrderBy)).FnExpr+1, regCurrent)
goto __19
__18:
Xsqlite3VdbeAddOp2(tls, v, OP_RowData, iQueue, regCurrent)
@@ -115610,7 +117431,7 @@ __20:
// Execute the recursive SELECT taking the single row in Current as
// the value for the recursive-table. Store the results in the Queue.
(*Select)(unsafe.Pointer(pFirstRec)).FpPrior = uintptr(0)
- Xsqlite3VdbeExplain(tls, pParse, uint8(1), ts+17269 /* "RECURSIVE STEP" */, 0)
+ Xsqlite3VdbeExplain(tls, pParse, uint8(1), ts+18546 /* "RECURSIVE STEP" */, 0)
Xsqlite3Select(tls, pParse, p, bp /* &destQueue */)
(*Select)(unsafe.Pointer(pFirstRec)).FpPrior = pSetup
@@ -115640,13 +117461,13 @@ end_of_recursive_query:
// clause occurs within scalar expression (ex: "SELECT (VALUES(1),(2),(3))").
// The sqlite3CodeSubselect will have added the LIMIT 1 clause in tht case.
// Since the limit is exactly 1, we only need to evalutes the left-most VALUES.
-func multiSelectValues(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) int32 { /* sqlite3.c:134671:12: */
+func multiSelectValues(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) int32 { /* sqlite3.c:135850:12: */
bp := tls.Alloc(16)
defer tls.Free(16)
var nRow int32 = 1
var rc int32 = 0
- var bShowAll int32 = (libc.Bool32((*Select)(unsafe.Pointer(p)).FpLimit == uintptr(0)))
+ var bShowAll int32 = libc.Bool32((*Select)(unsafe.Pointer(p)).FpLimit == uintptr(0))
for ok := true; ok; ok = 1 != 0 {
@@ -115658,13 +117479,13 @@ func multiSelectValues(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr)
}
p = (*Select)(unsafe.Pointer(p)).FpPrior
- nRow = nRow + (bShowAll)
+ nRow = nRow + bShowAll
}
- Xsqlite3VdbeExplain(tls, pParse, uint8(0), ts+17284 /* "SCAN %d CONSTANT..." */, libc.VaList(bp, nRow, func() uintptr {
+ Xsqlite3VdbeExplain(tls, pParse, uint8(0), ts+18561 /* "SCAN %d CONSTANT..." */, libc.VaList(bp, nRow, func() uintptr {
if nRow == 1 {
- return ts + 755 /* "" */
+ return ts + 1543 /* "" */
}
- return ts + 17307 /* "S" */
+ return ts + 18584 /* "S" */
}()))
for p != 0 {
selectInnerLoop(tls, pParse, p, -1, uintptr(0), uintptr(0), pDest, 1, 1)
@@ -115680,11 +117501,11 @@ func multiSelectValues(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr)
// Return true if the SELECT statement which is known to be the recursive
// part of a recursive CTE still has its anchor terms attached. If the
// anchor terms have already been removed, then return false.
-func hasAnchor(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:134708:12: */
- for (p != 0) && (((*Select)(unsafe.Pointer(p)).FselFlags & U32(SF_Recursive)) != U32(0)) {
+func hasAnchor(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:135887:12: */
+ for p != 0 && (*Select)(unsafe.Pointer(p)).FselFlags&U32(SF_Recursive) != U32(0) {
p = (*Select)(unsafe.Pointer(p)).FpPrior
}
- return (libc.Bool32(p != uintptr(0)))
+ return libc.Bool32(p != uintptr(0))
}
// This routine is called to process a compound query form from
@@ -115716,7 +117537,7 @@ func hasAnchor(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:134708:12: */
//
// Notice that because of the way SQLite parses compound SELECTs, the
// individual selects always group from left to right.
-func multiSelect(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) int32 { /* sqlite3.c:134744:12: */
+func multiSelect(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) int32 { /* sqlite3.c:135923:12: */
bp := tls.Alloc(104)
defer tls.Free(104)
@@ -115771,7 +117592,7 @@ func multiSelect(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) int32
// The VDBE already created by calling function
// Create the destination temporary table if necessary
- if !(int32((*SelectDest)(unsafe.Pointer(bp+16 /* &dest */)).FeDest) == SRT_EphemTab) {
+ if !(int32((*SelectDest)(unsafe.Pointer(bp+16)).FeDest) == SRT_EphemTab) {
goto __1
}
@@ -115781,7 +117602,7 @@ __1:
;
// Special handling for a compound-select that originates as a VALUES clause.
- if !(((*Select)(unsafe.Pointer(p)).FselFlags & U32(SF_MultiValue)) != 0) {
+ if !((*Select)(unsafe.Pointer(p)).FselFlags&U32(SF_MultiValue) != 0) {
goto __2
}
rc = multiSelectValues(tls, pParse, p, bp+16 /* &dest */)
@@ -115798,7 +117619,7 @@ __2:
// Make sure all SELECTs in the statement have the same number of elements
// in their result sets.
- if !((((*Select)(unsafe.Pointer(p)).FselFlags & U32(SF_Recursive)) != U32(0)) && (hasAnchor(tls, p) != 0)) {
+ if !((*Select)(unsafe.Pointer(p)).FselFlags&U32(SF_Recursive) != U32(0) && hasAnchor(tls, p) != 0) {
goto __4
}
generateWithRecursiveQuery(tls, pParse, p, bp+16 /* &dest */)
@@ -115816,8 +117637,8 @@ __6:
if !((*Select)(unsafe.Pointer(pPrior)).FpPrior == uintptr(0)) {
goto __8
}
- Xsqlite3VdbeExplain(tls, pParse, uint8(1), ts+17309 /* "COMPOUND QUERY" */, 0)
- Xsqlite3VdbeExplain(tls, pParse, uint8(1), ts+17324 /* "LEFT-MOST SUBQUE..." */, 0)
+ Xsqlite3VdbeExplain(tls, pParse, uint8(1), ts+18586 /* "COMPOUND QUERY" */, 0)
+ Xsqlite3VdbeExplain(tls, pParse, uint8(1), ts+18601 /* "LEFT-MOST SUBQUE..." */, 0)
__8:
;
@@ -115861,21 +117682,21 @@ __14:
goto __16
}
Xsqlite3VdbeAddOp3(tls, v, OP_OffsetLimit,
- (*Select)(unsafe.Pointer(p)).FiLimit, ((*Select)(unsafe.Pointer(p)).FiOffset + 1), (*Select)(unsafe.Pointer(p)).FiOffset)
+ (*Select)(unsafe.Pointer(p)).FiLimit, (*Select)(unsafe.Pointer(p)).FiOffset+1, (*Select)(unsafe.Pointer(p)).FiOffset)
__16:
;
__15:
;
- Xsqlite3VdbeExplain(tls, pParse, uint8(1), ts+17099 /* "UNION ALL" */, 0)
+ Xsqlite3VdbeExplain(tls, pParse, uint8(1), ts+18376 /* "UNION ALL" */, 0)
rc = Xsqlite3Select(tls, pParse, p, bp+16 /* &dest */)
pDelete = (*Select)(unsafe.Pointer(p)).FpPrior
(*Select)(unsafe.Pointer(p)).FpPrior = pPrior
(*Select)(unsafe.Pointer(p)).FnSelectRow = Xsqlite3LogEstAdd(tls, (*Select)(unsafe.Pointer(p)).FnSelectRow, (*Select)(unsafe.Pointer(pPrior)).FnSelectRow)
- if !(((((*Select)(unsafe.Pointer(p)).FpLimit != 0) &&
- (Xsqlite3ExprIsInteger(tls, (*Expr)(unsafe.Pointer((*Select)(unsafe.Pointer(p)).FpLimit)).FpLeft, bp+44 /* &nLimit */) != 0)) &&
- (*(*int32)(unsafe.Pointer(bp + 44 /* nLimit */)) > 0)) && (int32((*Select)(unsafe.Pointer(p)).FnSelectRow) > int32(Xsqlite3LogEst(tls, U64(*(*int32)(unsafe.Pointer(bp + 44 /* nLimit */))))))) {
+ if !((*Select)(unsafe.Pointer(p)).FpLimit != 0 &&
+ Xsqlite3ExprIsInteger(tls, (*Expr)(unsafe.Pointer((*Select)(unsafe.Pointer(p)).FpLimit)).FpLeft, bp+44) != 0 &&
+ *(*int32)(unsafe.Pointer(bp + 44)) > 0 && int32((*Select)(unsafe.Pointer(p)).FnSelectRow) > int32(Xsqlite3LogEst(tls, U64(*(*int32)(unsafe.Pointer(bp + 44)))))) {
goto __17
}
(*Select)(unsafe.Pointer(p)).FnSelectRow = Xsqlite3LogEst(tls, U64(*(*int32)(unsafe.Pointer(bp + 44 /* nLimit */))))
@@ -115894,7 +117715,7 @@ __12: // Cursor number of the temp table holding result
op = U8(0)
priorOp = SRT_Union
- if !(int32((*SelectDest)(unsafe.Pointer(bp+16 /* &dest */)).FeDest) == priorOp) {
+ if !(int32((*SelectDest)(unsafe.Pointer(bp+16)).FeDest) == priorOp) {
goto __19
}
// We can reuse a temporary table generated by a SELECT to our
@@ -115909,8 +117730,8 @@ __19:
addr1 = Xsqlite3VdbeAddOp2(tls, v, OP_OpenEphemeral, unionTab, 0)
- *(*int32)(unsafe.Pointer((p + 20 /* &.addrOpenEphm */))) = addr1
- *(*U32)(unsafe.Pointer(findRightmost(tls, p) + 4 /* &.selFlags */)) |= (U32(SF_UsesEphemeral))
+ *(*int32)(unsafe.Pointer(p + 20)) = addr1
+ *(*U32)(unsafe.Pointer(findRightmost(tls, p) + 4)) |= U32(SF_UsesEphemeral)
__20:
;
@@ -115942,7 +117763,7 @@ __23:
pLimit = (*Select)(unsafe.Pointer(p)).FpLimit
(*Select)(unsafe.Pointer(p)).FpLimit = uintptr(0)
(*SelectDest)(unsafe.Pointer(bp + 48 /* &uniondest */)).FeDest = op
- Xsqlite3VdbeExplain(tls, pParse, uint8(1), ts+17343 /* "%s USING TEMP B-..." */, libc.VaList(bp, Xsqlite3SelectOpName(tls, int32((*Select)(unsafe.Pointer(p)).Fop))))
+ Xsqlite3VdbeExplain(tls, pParse, uint8(1), ts+18620 /* "%s USING TEMP B-..." */, libc.VaList(bp, Xsqlite3SelectOpName(tls, int32((*Select)(unsafe.Pointer(p)).Fop))))
rc = Xsqlite3Select(tls, pParse, p, bp+48 /* &uniondest */)
@@ -115963,7 +117784,7 @@ __24:
// Convert the data in the temporary table into whatever form
// it is that we currently need.
- if !((int32((*SelectDest)(unsafe.Pointer(bp+16 /* &dest */)).FeDest) != priorOp) && (int32((*Sqlite3)(unsafe.Pointer(db)).FmallocFailed) == 0)) {
+ if !(int32((*SelectDest)(unsafe.Pointer(bp+16)).FeDest) != priorOp && int32((*Sqlite3)(unsafe.Pointer(db)).FmallocFailed) == 0) {
goto __25
}
iBreak = Xsqlite3VdbeMakeLabel(tls, pParse)
@@ -115992,8 +117813,8 @@ __13:
addr2 = Xsqlite3VdbeAddOp2(tls, v, OP_OpenEphemeral, tab1, 0)
- *(*int32)(unsafe.Pointer((p + 20 /* &.addrOpenEphm */))) = addr2
- *(*U32)(unsafe.Pointer(findRightmost(tls, p) + 4 /* &.selFlags */)) |= (U32(SF_UsesEphemeral))
+ *(*int32)(unsafe.Pointer(p + 20)) = addr2
+ *(*U32)(unsafe.Pointer(findRightmost(tls, p) + 4)) |= U32(SF_UsesEphemeral)
// Code the SELECTs to our left into temporary table "tab1".
Xsqlite3SelectDestInit(tls, bp+76 /* &intersectdest */, SRT_Union, tab1)
@@ -116009,12 +117830,12 @@ __26:
// Code the current SELECT into temporary table "tab2"
addr2 = Xsqlite3VdbeAddOp2(tls, v, OP_OpenEphemeral, tab2, 0)
- *(*int32)(unsafe.Pointer((p + 20 /* &.addrOpenEphm */) + 1*4)) = addr2
+ *(*int32)(unsafe.Pointer(p + 20 + 1*4)) = addr2
(*Select)(unsafe.Pointer(p)).FpPrior = uintptr(0)
pLimit1 = (*Select)(unsafe.Pointer(p)).FpLimit
(*Select)(unsafe.Pointer(p)).FpLimit = uintptr(0)
(*SelectDest)(unsafe.Pointer(bp + 76 /* &intersectdest */)).FiSDParm = tab2
- Xsqlite3VdbeExplain(tls, pParse, uint8(1), ts+17343 /* "%s USING TEMP B-..." */, libc.VaList(bp+8, Xsqlite3SelectOpName(tls, int32((*Select)(unsafe.Pointer(p)).Fop))))
+ Xsqlite3VdbeExplain(tls, pParse, uint8(1), ts+18620 /* "%s USING TEMP B-..." */, libc.VaList(bp+8, Xsqlite3SelectOpName(tls, int32((*Select)(unsafe.Pointer(p)).Fop))))
rc = Xsqlite3Select(tls, pParse, p, bp+76 /* &intersectdest */)
@@ -116084,13 +117905,13 @@ __30:
// SELECT statements to the left always skip this part. The right-most
// SELECT might also skip this part if it has no ORDER BY clause and
// no temp tables are required.
- if !(((*Select)(unsafe.Pointer(p)).FselFlags & U32(SF_UsesEphemeral)) != 0) {
+ if !((*Select)(unsafe.Pointer(p)).FselFlags&U32(SF_UsesEphemeral) != 0) {
goto __31
} // Number of columns in result set
nCol = (*ExprList)(unsafe.Pointer((*Select)(unsafe.Pointer(p)).FpEList)).FnExpr
pKeyInfo = Xsqlite3KeyInfoAlloc(tls, db, nCol, 1)
- if !(!(pKeyInfo != 0)) {
+ if !!(pKeyInfo != 0) {
goto __32
}
rc = SQLITE_NOMEM
@@ -116129,7 +117950,7 @@ __40:
if !(i < 2) {
goto __42
}
- addr3 = *(*int32)(unsafe.Pointer((pLoop + 20 /* &.addrOpenEphm */) + uintptr(i)*4))
+ addr3 = *(*int32)(unsafe.Pointer(pLoop + 20 + uintptr(i)*4))
if !(addr3 < 0) {
goto __43
}
@@ -116142,7 +117963,7 @@ __43:
Xsqlite3VdbeChangeP2(tls, v, addr3, nCol)
Xsqlite3VdbeChangeP4(tls, v, addr3, Xsqlite3KeyInfoRef(tls, pKeyInfo),
-9)
- *(*int32)(unsafe.Pointer((pLoop + 20 /* &.addrOpenEphm */) + uintptr(i)*4)) = -1
+ *(*int32)(unsafe.Pointer(pLoop + 20 + uintptr(i)*4)) = -1
goto __41
__41:
i++
@@ -116164,21 +117985,30 @@ __31:
multi_select_end:
(*SelectDest)(unsafe.Pointer(pDest)).FiSdst = (*SelectDest)(unsafe.Pointer(bp + 16 /* &dest */)).FiSdst
(*SelectDest)(unsafe.Pointer(pDest)).FnSdst = (*SelectDest)(unsafe.Pointer(bp + 16 /* &dest */)).FnSdst
- Xsqlite3SelectDelete(tls, db, pDelete)
+ if !(pDelete != 0) {
+ goto __44
+ }
+ Xsqlite3ParserAddCleanup(tls, pParse,
+ *(*uintptr)(unsafe.Pointer(&struct {
+ f func(*libc.TLS, uintptr, uintptr)
+ }{Xsqlite3SelectDelete})),
+ pDelete)
+__44:
+ ;
return rc
}
// Error message for when two or more terms of a compound select have different
// size result sets.
-func Xsqlite3SelectWrongNumTermsError(tls *libc.TLS, pParse uintptr, p uintptr) { /* sqlite3.c:135095:21: */
+func Xsqlite3SelectWrongNumTermsError(tls *libc.TLS, pParse uintptr, p uintptr) { /* sqlite3.c:136279:21: */
bp := tls.Alloc(8)
defer tls.Free(8)
- if ((*Select)(unsafe.Pointer(p)).FselFlags & U32(SF_Values)) != 0 {
- Xsqlite3ErrorMsg(tls, pParse, ts+17364 /* "all VALUES must ..." */, 0)
+ if (*Select)(unsafe.Pointer(p)).FselFlags&U32(SF_Values) != 0 {
+ Xsqlite3ErrorMsg(tls, pParse, ts+18641 /* "all VALUES must ..." */, 0)
} else {
Xsqlite3ErrorMsg(tls, pParse,
- ts+17410, /* "SELECTs to the l..." */
+ ts+18687, /* "SELECTs to the l..." */
libc.VaList(bp, Xsqlite3SelectOpName(tls, int32((*Select)(unsafe.Pointer(p)).Fop))))
}
}
@@ -116201,7 +118031,7 @@ func Xsqlite3SelectWrongNumTermsError(tls *libc.TLS, pParse uintptr, p uintptr)
//
// If the LIMIT found in p->iLimit is reached, jump immediately to
// iBreak.
-func generateOutputSubroutine(tls *libc.TLS, pParse uintptr, p uintptr, pIn uintptr, pDest uintptr, regReturn int32, regPrev int32, pKeyInfo uintptr, iBreak int32) int32 { /* sqlite3.c:135125:12: */
+func generateOutputSubroutine(tls *libc.TLS, pParse uintptr, p uintptr, pIn uintptr, pDest uintptr, regReturn int32, regPrev int32, pKeyInfo uintptr, iBreak int32) int32 { /* sqlite3.c:136309:12: */
var v uintptr = (*Parse)(unsafe.Pointer(pParse)).FpVdbe
var iContinue int32
var addr int32
@@ -116214,11 +118044,11 @@ func generateOutputSubroutine(tls *libc.TLS, pParse uintptr, p uintptr, pIn uint
var addr1 int32
var addr2 int32
addr1 = Xsqlite3VdbeAddOp1(tls, v, OP_IfNot, regPrev)
- addr2 = Xsqlite3VdbeAddOp4(tls, v, OP_Compare, (*SelectDest)(unsafe.Pointer(pIn)).FiSdst, (regPrev + 1), (*SelectDest)(unsafe.Pointer(pIn)).FnSdst,
+ addr2 = Xsqlite3VdbeAddOp4(tls, v, OP_Compare, (*SelectDest)(unsafe.Pointer(pIn)).FiSdst, regPrev+1, (*SelectDest)(unsafe.Pointer(pIn)).FnSdst,
Xsqlite3KeyInfoRef(tls, pKeyInfo), -9)
- Xsqlite3VdbeAddOp3(tls, v, OP_Jump, (addr2 + 2), iContinue, (addr2 + 2))
+ Xsqlite3VdbeAddOp3(tls, v, OP_Jump, addr2+2, iContinue, addr2+2)
Xsqlite3VdbeJumpHere(tls, v, addr1)
- Xsqlite3VdbeAddOp3(tls, v, OP_Copy, (*SelectDest)(unsafe.Pointer(pIn)).FiSdst, (regPrev + 1), ((*SelectDest)(unsafe.Pointer(pIn)).FnSdst - 1))
+ Xsqlite3VdbeAddOp3(tls, v, OP_Copy, (*SelectDest)(unsafe.Pointer(pIn)).FiSdst, regPrev+1, (*SelectDest)(unsafe.Pointer(pIn)).FnSdst-1)
Xsqlite3VdbeAddOp2(tls, v, OP_Integer, 1, regPrev)
}
if (*Sqlite3)(unsafe.Pointer((*Parse)(unsafe.Pointer(pParse)).Fdb)).FmallocFailed != 0 {
@@ -116397,7 +118227,7 @@ func generateOutputSubroutine(tls *libc.TLS, pParse uintptr, p uintptr, pIn uint
// actually called using Gosub and they do not Return. EofA and EofB loop
// until all data is exhausted then jump to the "end" labe. AltB, AeqB,
// and AgtB jump to either L2 or to one of EofA or EofB.
-func multiSelectOrderBy(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) int32 { /* sqlite3.c:135333:12: */
+func multiSelectOrderBy(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) int32 { /* sqlite3.c:136517:12: */
bp := tls.Alloc(64)
defer tls.Free(64)
@@ -116458,7 +118288,7 @@ func multiSelectOrderBy(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr)
// the ORDER BY clause covers every term of the result set. Add
// terms to the ORDER BY clause as necessary.
if op != TK_ALL {
- for i = 1; (int32((*Sqlite3)(unsafe.Pointer(db)).FmallocFailed) == 0) && (i <= (*ExprList)(unsafe.Pointer((*Select)(unsafe.Pointer(p)).FpEList)).FnExpr); i++ {
+ for i = 1; int32((*Sqlite3)(unsafe.Pointer(db)).FmallocFailed) == 0 && i <= (*ExprList)(unsafe.Pointer((*Select)(unsafe.Pointer(p)).FpEList)).FnExpr; i++ {
var pItem uintptr
j = 0
pItem = pOrderBy + 8 /* &.a */
@@ -116468,7 +118298,7 @@ func multiSelectOrderBy(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr)
}
{
- if int32(*(*U16)(unsafe.Pointer((pItem + 16 /* &.u */ /* &.x */) /* &.iOrderByCol */))) == i {
+ if int32(*(*U16)(unsafe.Pointer(pItem + 16))) == i {
goto __3
}
@@ -116486,11 +118316,11 @@ func multiSelectOrderBy(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr)
if pNew == uintptr(0) {
return SQLITE_NOMEM
}
- *(*U32)(unsafe.Pointer(pNew + 4 /* &.flags */)) |= (U32(EP_IntValue))
- *(*int32)(unsafe.Pointer(pNew + 8 /* &.u */)) = i
+ *(*U32)(unsafe.Pointer(pNew + 4)) |= U32(EP_IntValue)
+ *(*int32)(unsafe.Pointer(pNew + 8)) = i
(*Select)(unsafe.Pointer(p)).FpOrderBy = libc.AssignUintptr(&pOrderBy, Xsqlite3ExprListAppend(tls, pParse, pOrderBy, pNew))
if pOrderBy != 0 {
- *(*U16)(unsafe.Pointer((pOrderBy + 8 /* &.a */) + uintptr(libc.PostIncInt32(&nOrderBy, 1))*20 + 16 /* &.u */ /* &.x */ /* &.iOrderByCol */)) = U16(i)
+ *(*U16)(unsafe.Pointer(pOrderBy + 8 + uintptr(libc.PostIncInt32(&nOrderBy, 1))*20 + 16)) = U16(i)
}
}
}
@@ -116502,7 +118332,7 @@ func multiSelectOrderBy(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr)
// collations to the ORDER BY clause terms so that when the subqueries
// to the right and the left are evaluated, they use the correct
// collation.
- aPermute = Xsqlite3DbMallocRawNN(tls, db, (uint64(uint32(unsafe.Sizeof(U32(0))) * (uint32(nOrderBy + 1)))))
+ aPermute = Xsqlite3DbMallocRawNN(tls, db, uint64(uint32(unsafe.Sizeof(U32(0)))*uint32(nOrderBy+1)))
if aPermute != 0 {
var pItem uintptr
*(*U32)(unsafe.Pointer(aPermute)) = U32(nOrderBy)
@@ -116514,7 +118344,7 @@ func multiSelectOrderBy(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr)
}
{
- *(*U32)(unsafe.Pointer(aPermute + uintptr(i)*4)) = (U32(int32(*(*U16)(unsafe.Pointer((pItem + 16 /* &.u */ /* &.x */) /* &.iOrderByCol */))) - 1))
+ *(*U32)(unsafe.Pointer(aPermute + uintptr(i)*4)) = U32(int32(*(*U16)(unsafe.Pointer(pItem + 16))) - 1)
}
goto __5
@@ -116542,14 +118372,14 @@ func multiSelectOrderBy(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr)
} else {
var nExpr int32 = (*ExprList)(unsafe.Pointer((*Select)(unsafe.Pointer(p)).FpEList)).FnExpr
- regPrev = ((*Parse)(unsafe.Pointer(pParse)).FnMem + 1)
- *(*int32)(unsafe.Pointer(pParse + 44 /* &.nMem */)) += (nExpr + 1)
+ regPrev = (*Parse)(unsafe.Pointer(pParse)).FnMem + 1
+ *(*int32)(unsafe.Pointer(pParse + 44)) += nExpr + 1
Xsqlite3VdbeAddOp2(tls, v, OP_Integer, 0, regPrev)
pKeyDup = Xsqlite3KeyInfoAlloc(tls, db, nExpr, 1)
if pKeyDup != 0 {
for i = 0; i < nExpr; i++ {
- *(*uintptr)(unsafe.Pointer((pKeyDup + 20 /* &.aColl */) + uintptr(i)*4)) = multiSelectCollSeq(tls, pParse, p, i)
+ *(*uintptr)(unsafe.Pointer(pKeyDup + 20 + uintptr(i)*4)) = multiSelectCollSeq(tls, pParse, p, i)
*(*U8)(unsafe.Pointer((*KeyInfo)(unsafe.Pointer(pKeyDup)).FaSortFlags + uintptr(i))) = U8(0)
}
}
@@ -116558,19 +118388,19 @@ func multiSelectOrderBy(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr)
// Separate the left and the right query from one another
(*Select)(unsafe.Pointer(p)).FpPrior = uintptr(0)
(*Select)(unsafe.Pointer(pPrior)).FpNext = uintptr(0)
- Xsqlite3ResolveOrderGroupBy(tls, pParse, p, (*Select)(unsafe.Pointer(p)).FpOrderBy, ts+6251 /* "ORDER" */)
+ Xsqlite3ResolveOrderGroupBy(tls, pParse, p, (*Select)(unsafe.Pointer(p)).FpOrderBy, ts+7098 /* "ORDER" */)
if (*Select)(unsafe.Pointer(pPrior)).FpPrior == uintptr(0) {
- Xsqlite3ResolveOrderGroupBy(tls, pParse, pPrior, (*Select)(unsafe.Pointer(pPrior)).FpOrderBy, ts+6251 /* "ORDER" */)
+ Xsqlite3ResolveOrderGroupBy(tls, pParse, pPrior, (*Select)(unsafe.Pointer(pPrior)).FpOrderBy, ts+7098 /* "ORDER" */)
}
// Compute the limit registers
computeLimitRegisters(tls, pParse, p, labelEnd)
- if ((*Select)(unsafe.Pointer(p)).FiLimit != 0) && (op == TK_ALL) {
+ if (*Select)(unsafe.Pointer(p)).FiLimit != 0 && op == TK_ALL {
regLimitA = libc.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1)
regLimitB = libc.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1)
Xsqlite3VdbeAddOp2(tls, v, OP_Copy, func() int32 {
if (*Select)(unsafe.Pointer(p)).FiOffset != 0 {
- return ((*Select)(unsafe.Pointer(p)).FiOffset + 1)
+ return (*Select)(unsafe.Pointer(p)).FiOffset + 1
}
return (*Select)(unsafe.Pointer(p)).FiLimit
}(),
@@ -116589,29 +118419,29 @@ func multiSelectOrderBy(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr)
Xsqlite3SelectDestInit(tls, bp+8 /* &destA */, SRT_Coroutine, regAddrA)
Xsqlite3SelectDestInit(tls, bp+36 /* &destB */, SRT_Coroutine, regAddrB)
- Xsqlite3VdbeExplain(tls, pParse, uint8(1), ts+17492 /* "MERGE (%s)" */, libc.VaList(bp, Xsqlite3SelectOpName(tls, int32((*Select)(unsafe.Pointer(p)).Fop))))
+ Xsqlite3VdbeExplain(tls, pParse, uint8(1), ts+18769 /* "MERGE (%s)" */, libc.VaList(bp, Xsqlite3SelectOpName(tls, int32((*Select)(unsafe.Pointer(p)).Fop))))
// Generate a coroutine to evaluate the SELECT statement to the
// left of the compound operator - the "A" select.
- addrSelectA = (Xsqlite3VdbeCurrentAddr(tls, v) + 1)
+ addrSelectA = Xsqlite3VdbeCurrentAddr(tls, v) + 1
addr1 = Xsqlite3VdbeAddOp3(tls, v, OP_InitCoroutine, regAddrA, 0, addrSelectA)
(*Select)(unsafe.Pointer(pPrior)).FiLimit = regLimitA
- Xsqlite3VdbeExplain(tls, pParse, uint8(1), ts+17503 /* "LEFT" */, 0)
+ Xsqlite3VdbeExplain(tls, pParse, uint8(1), ts+18780 /* "LEFT" */, 0)
Xsqlite3Select(tls, pParse, pPrior, bp+8 /* &destA */)
Xsqlite3VdbeEndCoroutine(tls, v, regAddrA)
Xsqlite3VdbeJumpHere(tls, v, addr1)
// Generate a coroutine to evaluate the SELECT statement on
// the right - the "B" select
- addrSelectB = (Xsqlite3VdbeCurrentAddr(tls, v) + 1)
+ addrSelectB = Xsqlite3VdbeCurrentAddr(tls, v) + 1
addr1 = Xsqlite3VdbeAddOp3(tls, v, OP_InitCoroutine, regAddrB, 0, addrSelectB)
savedLimit = (*Select)(unsafe.Pointer(p)).FiLimit
savedOffset = (*Select)(unsafe.Pointer(p)).FiOffset
(*Select)(unsafe.Pointer(p)).FiLimit = regLimitB
(*Select)(unsafe.Pointer(p)).FiOffset = 0
- Xsqlite3VdbeExplain(tls, pParse, uint8(1), ts+17508 /* "RIGHT" */, 0)
+ Xsqlite3VdbeExplain(tls, pParse, uint8(1), ts+18785 /* "RIGHT" */, 0)
Xsqlite3Select(tls, pParse, p, bp+36 /* &destB */)
(*Select)(unsafe.Pointer(p)).FiLimit = savedLimit
(*Select)(unsafe.Pointer(p)).FiOffset = savedOffset
@@ -116626,7 +118456,7 @@ func multiSelectOrderBy(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr)
// Generate a subroutine that outputs the current row of the B
// select as the next output row of the compound select.
- if (op == TK_ALL) || (op == TK_UNION) {
+ if op == TK_ALL || op == TK_UNION {
addrOutB = generateOutputSubroutine(tls, pParse,
p, bp+36 /* &destB */, pDest, regOutB,
@@ -116636,7 +118466,7 @@ func multiSelectOrderBy(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr)
// Generate a subroutine to run when the results from select A
// are exhausted and only data in select B remains.
- if (op == TK_EXCEPT) || (op == TK_INTERSECT) {
+ if op == TK_EXCEPT || op == TK_INTERSECT {
addrEofA_noB = libc.AssignInt32(&addrEofA, labelEnd)
} else {
@@ -116682,7 +118512,7 @@ func multiSelectOrderBy(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr)
// Generate code to handle the case of A>B
addrAgtB = Xsqlite3VdbeCurrentAddr(tls, v)
- if (op == TK_ALL) || (op == TK_UNION) {
+ if op == TK_ALL || op == TK_UNION {
Xsqlite3VdbeAddOp2(tls, v, OP_Gosub, regOutB, addrOutB)
}
Xsqlite3VdbeAddOp2(tls, v, OP_Yield, regAddrB, addrEofB)
@@ -116718,7 +118548,7 @@ func multiSelectOrderBy(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr)
// ** TBD: Insert subroutine calls to close cursors on incomplete
// subqueries ***
Xsqlite3VdbeExplainPop(tls, pParse)
- return (libc.Bool32((*Parse)(unsafe.Pointer(pParse)).FnErr != 0))
+ return libc.Bool32((*Parse)(unsafe.Pointer(pParse)).FnErr != 0)
}
// An instance of the SubstContext object describes an substitution edit
@@ -116732,14 +118562,14 @@ type SubstContext1 = struct {
FiNewTable int32
FisLeftJoin int32
FpEList uintptr
-} /* sqlite3.c:135643:9 */
+} /* sqlite3.c:136829:9 */
// An instance of the SubstContext object describes an substitution edit
// to be performed on a parse tree.
//
// All references to columns in table iTable are to be replaced by corresponding
// expressions in pEList.
-type SubstContext = SubstContext1 /* sqlite3.c:135649:3 */
+type SubstContext = SubstContext1 /* sqlite3.c:136835:3 */
// Scan through the expression pExpr. Replace every reference to
// a column in table number iTable with a copy of the iColumn-th
@@ -116752,30 +118582,30 @@ type SubstContext = SubstContext1 /* sqlite3.c:135649:3 */
// FORM clause entry is iTable. This routine makes the necessary
// changes to pExpr so that it refers directly to the source table
// of the subquery rather the result set of the subquery.
-func substExpr(tls *libc.TLS, pSubst uintptr, pExpr uintptr) uintptr { /* sqlite3.c:135668:13: */
+func substExpr(tls *libc.TLS, pSubst uintptr, pExpr uintptr) uintptr { /* sqlite3.c:136854:13: */
bp := tls.Alloc(52)
defer tls.Free(52)
if pExpr == uintptr(0) {
return uintptr(0)
}
- if (((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_FromJoin))) != U32(0)) &&
- ((*Expr)(unsafe.Pointer(pExpr)).FiRightJoinTable == (*SubstContext)(unsafe.Pointer(pSubst)).FiTable) {
+ if (*Expr)(unsafe.Pointer(pExpr)).Fflags&U32(EP_FromJoin) != U32(0) &&
+ (*Expr)(unsafe.Pointer(pExpr)).FiRightJoinTable == (*SubstContext)(unsafe.Pointer(pSubst)).FiTable {
(*Expr)(unsafe.Pointer(pExpr)).FiRightJoinTable = (*SubstContext)(unsafe.Pointer(pSubst)).FiNewTable
}
- if ((int32((*Expr)(unsafe.Pointer(pExpr)).Fop) == TK_COLUMN) &&
- ((*Expr)(unsafe.Pointer(pExpr)).FiTable == (*SubstContext)(unsafe.Pointer(pSubst)).FiTable)) &&
- !(((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_FixedCol))) != U32(0)) {
+ if int32((*Expr)(unsafe.Pointer(pExpr)).Fop) == TK_COLUMN &&
+ (*Expr)(unsafe.Pointer(pExpr)).FiTable == (*SubstContext)(unsafe.Pointer(pSubst)).FiTable &&
+ !((*Expr)(unsafe.Pointer(pExpr)).Fflags&U32(EP_FixedCol) != U32(0)) {
{
var pNew uintptr
- var pCopy uintptr = (*ExprList_item)(unsafe.Pointer(((*SubstContext)(unsafe.Pointer(pSubst)).FpEList + 8 /* &.a */) + uintptr((*Expr)(unsafe.Pointer(pExpr)).FiColumn)*20)).FpExpr
+ var pCopy uintptr = (*ExprList_item)(unsafe.Pointer((*SubstContext)(unsafe.Pointer(pSubst)).FpEList + 8 + uintptr((*Expr)(unsafe.Pointer(pExpr)).FiColumn)*20)).FpExpr
// var ifNullRow Expr at bp, 52
if Xsqlite3ExprIsVector(tls, pCopy) != 0 {
Xsqlite3VectorErrorMsg(tls, (*SubstContext)(unsafe.Pointer(pSubst)).FpParse, pCopy)
} else {
var db uintptr = (*Parse)(unsafe.Pointer((*SubstContext)(unsafe.Pointer(pSubst)).FpParse)).Fdb
- if ((*SubstContext)(unsafe.Pointer(pSubst)).FisLeftJoin != 0) && (int32((*Expr)(unsafe.Pointer(pCopy)).Fop) != TK_COLUMN) {
+ if (*SubstContext)(unsafe.Pointer(pSubst)).FisLeftJoin != 0 && int32((*Expr)(unsafe.Pointer(pCopy)).Fop) != TK_COLUMN {
libc.Xmemset(tls, bp /* &ifNullRow */, 0, uint32(unsafe.Sizeof(Expr{})))
(*Expr)(unsafe.Pointer(bp /* &ifNullRow */)).Fop = U8(TK_IF_NULL_ROW)
(*Expr)(unsafe.Pointer(bp /* &ifNullRow */)).FpLeft = pCopy
@@ -116790,9 +118620,9 @@ func substExpr(tls *libc.TLS, pSubst uintptr, pExpr uintptr) uintptr { /* sqlite
return pExpr
}
if (*SubstContext)(unsafe.Pointer(pSubst)).FisLeftJoin != 0 {
- *(*U32)(unsafe.Pointer(pNew + 4 /* &.flags */)) |= (U32(EP_CanBeNull))
+ *(*U32)(unsafe.Pointer(pNew + 4)) |= U32(EP_CanBeNull)
}
- if ((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_FromJoin))) != U32(0) {
+ if (*Expr)(unsafe.Pointer(pExpr)).Fflags&U32(EP_FromJoin) != U32(0) {
Xsqlite3SetJoinExpr(tls, pNew, (*Expr)(unsafe.Pointer(pExpr)).FiRightJoinTable)
}
Xsqlite3ExprDelete(tls, db, pExpr)
@@ -116800,33 +118630,33 @@ func substExpr(tls *libc.TLS, pSubst uintptr, pExpr uintptr) uintptr { /* sqlite
// 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.
- if (int32((*Expr)(unsafe.Pointer(pExpr)).Fop) != TK_COLUMN) && (int32((*Expr)(unsafe.Pointer(pExpr)).Fop) != TK_COLLATE) {
+ if int32((*Expr)(unsafe.Pointer(pExpr)).Fop) != TK_COLUMN && int32((*Expr)(unsafe.Pointer(pExpr)).Fop) != TK_COLLATE {
var pColl uintptr = Xsqlite3ExprCollSeq(tls, (*SubstContext)(unsafe.Pointer(pSubst)).FpParse, pExpr)
pExpr = Xsqlite3ExprAddCollateString(tls, (*SubstContext)(unsafe.Pointer(pSubst)).FpParse, pExpr,
func() uintptr {
if pColl != 0 {
return (*CollSeq)(unsafe.Pointer(pColl)).FzName
}
- return ts + 318 /* "BINARY" */
+ return ts + 1070
}())
}
- *(*U32)(unsafe.Pointer(pExpr + 4 /* &.flags */)) &= (libc.Uint32FromInt32(libc.CplInt32(EP_Collate)))
+ *(*U32)(unsafe.Pointer(pExpr + 4)) &= libc.Uint32FromInt32(libc.CplInt32(EP_Collate))
}
}
} else {
- if (int32((*Expr)(unsafe.Pointer(pExpr)).Fop) == TK_IF_NULL_ROW) && ((*Expr)(unsafe.Pointer(pExpr)).FiTable == (*SubstContext)(unsafe.Pointer(pSubst)).FiTable) {
+ if int32((*Expr)(unsafe.Pointer(pExpr)).Fop) == TK_IF_NULL_ROW && (*Expr)(unsafe.Pointer(pExpr)).FiTable == (*SubstContext)(unsafe.Pointer(pSubst)).FiTable {
(*Expr)(unsafe.Pointer(pExpr)).FiTable = (*SubstContext)(unsafe.Pointer(pSubst)).FiNewTable
}
(*Expr)(unsafe.Pointer(pExpr)).FpLeft = substExpr(tls, pSubst, (*Expr)(unsafe.Pointer(pExpr)).FpLeft)
(*Expr)(unsafe.Pointer(pExpr)).FpRight = substExpr(tls, pSubst, (*Expr)(unsafe.Pointer(pExpr)).FpRight)
- if ((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_xIsSelect))) != U32(0) {
- substSelect(tls, pSubst, *(*uintptr)(unsafe.Pointer(pExpr + 20 /* &.x */)), 1)
+ if (*Expr)(unsafe.Pointer(pExpr)).Fflags&U32(EP_xIsSelect) != U32(0) {
+ substSelect(tls, pSubst, *(*uintptr)(unsafe.Pointer(pExpr + 20)), 1)
} else {
- substExprList(tls, pSubst, *(*uintptr)(unsafe.Pointer(pExpr + 20 /* &.x */)))
+ substExprList(tls, pSubst, *(*uintptr)(unsafe.Pointer(pExpr + 20)))
}
- if ((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_WinFunc))) != U32(0) {
- var pWin uintptr = *(*uintptr)(unsafe.Pointer(pExpr + 44 /* &.y */))
+ if (*Expr)(unsafe.Pointer(pExpr)).Fflags&U32(EP_WinFunc) != U32(0) {
+ var pWin uintptr = *(*uintptr)(unsafe.Pointer(pExpr + 44))
(*Window)(unsafe.Pointer(pWin)).FpFilter = substExpr(tls, pSubst, (*Window)(unsafe.Pointer(pWin)).FpFilter)
substExprList(tls, pSubst, (*Window)(unsafe.Pointer(pWin)).FpPartition)
substExprList(tls, pSubst, (*Window)(unsafe.Pointer(pWin)).FpOrderBy)
@@ -116835,24 +118665,24 @@ func substExpr(tls *libc.TLS, pSubst uintptr, pExpr uintptr) uintptr { /* sqlite
return pExpr
}
-func substExprList(tls *libc.TLS, pSubst uintptr, pList uintptr) { /* sqlite3.c:135753:13: */
+func substExprList(tls *libc.TLS, pSubst uintptr, pList uintptr) { /* sqlite3.c:136939:13: */
var i int32
if pList == uintptr(0) {
return
}
for i = 0; i < (*ExprList)(unsafe.Pointer(pList)).FnExpr; i++ {
- (*ExprList_item)(unsafe.Pointer((pList + 8 /* &.a */) + uintptr(i)*20)).FpExpr = substExpr(tls, pSubst, (*ExprList_item)(unsafe.Pointer((pList+8 /* &.a */)+uintptr(i)*20)).FpExpr)
+ (*ExprList_item)(unsafe.Pointer(pList + 8 + uintptr(i)*20)).FpExpr = substExpr(tls, pSubst, (*ExprList_item)(unsafe.Pointer(pList+8+uintptr(i)*20)).FpExpr)
}
}
-func substSelect(tls *libc.TLS, pSubst uintptr, p uintptr, doPrior int32) { /* sqlite3.c:135763:13: */
+func substSelect(tls *libc.TLS, pSubst uintptr, p uintptr, doPrior int32) { /* sqlite3.c:136949:13: */
var pSrc uintptr
var pItem uintptr
var i int32
if !(p != 0) {
return
}
- for ok := true; ok; ok = ((doPrior != 0) && ((libc.AssignUintptr(&p, (*Select)(unsafe.Pointer(p)).FpPrior)) != uintptr(0))) {
+ for ok := true; ok; ok = doPrior != 0 && libc.AssignUintptr(&p, (*Select)(unsafe.Pointer(p)).FpPrior) != uintptr(0) {
substExprList(tls, pSubst, (*Select)(unsafe.Pointer(p)).FpEList)
substExprList(tls, pSubst, (*Select)(unsafe.Pointer(p)).FpGroupBy)
substExprList(tls, pSubst, (*Select)(unsafe.Pointer(p)).FpOrderBy)
@@ -116868,8 +118698,8 @@ func substSelect(tls *libc.TLS, pSubst uintptr, p uintptr, doPrior int32) { /* s
}
{
substSelect(tls, pSubst, (*SrcItem)(unsafe.Pointer(pItem)).FpSelect, 1)
- if (uint32(int32(*(*uint16)(unsafe.Pointer(pItem + 36 /* &.fg */ + 4 /* &.isTabFunc */)) & 0x4 >> 2))) != 0 {
- substExprList(tls, pSubst, *(*uintptr)(unsafe.Pointer(pItem + 64 /* &.u1 */)))
+ if uint32(int32(*(*uint16)(unsafe.Pointer(pItem + 36 + 4))&0x4>>2)) != 0 {
+ substExprList(tls, pSubst, *(*uintptr)(unsafe.Pointer(pItem + 64)))
}
}
@@ -116888,23 +118718,23 @@ func substSelect(tls *libc.TLS, pSubst uintptr, p uintptr, doPrior int32) { /* s
//
// This routine scans the entire SELECT statement and recomputes the
// pSrcItem->colUsed mask.
-func recomputeColumnsUsedExpr(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 { /* sqlite3.c:135798:12: */
+func recomputeColumnsUsedExpr(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 { /* sqlite3.c:136984:12: */
var pItem uintptr
if int32((*Expr)(unsafe.Pointer(pExpr)).Fop) != TK_COLUMN {
return WRC_Continue
}
- pItem = *(*uintptr)(unsafe.Pointer(pWalker + 24 /* &.u */))
+ pItem = *(*uintptr)(unsafe.Pointer(pWalker + 24))
if (*SrcItem)(unsafe.Pointer(pItem)).FiCursor != (*Expr)(unsafe.Pointer(pExpr)).FiTable {
return WRC_Continue
}
if int32((*Expr)(unsafe.Pointer(pExpr)).FiColumn) < 0 {
return WRC_Continue
}
- *(*Bitmask)(unsafe.Pointer(pItem + 56 /* &.colUsed */)) |= (Xsqlite3ExprColUsed(tls, pExpr))
+ *(*Bitmask)(unsafe.Pointer(pItem + 56)) |= Xsqlite3ExprColUsed(tls, pExpr)
return WRC_Continue
}
-func recomputeColumnsUsed(tls *libc.TLS, pSelect uintptr, pSrcItem uintptr) { /* sqlite3.c:135807:13: */
+func recomputeColumnsUsed(tls *libc.TLS, pSelect uintptr, pSrcItem uintptr) { /* sqlite3.c:136993:13: */
bp := tls.Alloc(28)
defer tls.Free(28)
@@ -116920,7 +118750,7 @@ func recomputeColumnsUsed(tls *libc.TLS, pSelect uintptr, pSrcItem uintptr) { /*
(*Walker)(unsafe.Pointer(bp /* &w */)).FxSelectCallback = *(*uintptr)(unsafe.Pointer(&struct {
f func(*libc.TLS, uintptr, uintptr) int32
}{Xsqlite3SelectWalkNoop}))
- *(*uintptr)(unsafe.Pointer(bp /* &w */ + 24 /* &.u */)) = pSrcItem
+ *(*uintptr)(unsafe.Pointer(bp + 24)) = pSrcItem
(*SrcItem)(unsafe.Pointer(pSrcItem)).FcolUsed = uint64(0)
Xsqlite3WalkSelect(tls, bp /* &w */, pSelect)
}
@@ -116929,14 +118759,14 @@ func recomputeColumnsUsed(tls *libc.TLS, pSelect uintptr, pSrcItem uintptr) { /*
// new cursor number assigned, set an entry in the aCsrMap[] array
// to map the old cursor number to the new:
//
-// aCsrMap[iOld] = iNew;
+// aCsrMap[iOld+1] = iNew;
//
// The array is guaranteed by the caller to be large enough for all
-// existing cursor numbers in pSrc.
+// existing cursor numbers in pSrc. aCsrMap[0] is the array size.
//
// If pSrc contains any sub-selects, call this routine recursively
// on the FROM clause of each such sub-select, with iExcept set to -1.
-func srclistRenumberCursors(tls *libc.TLS, pParse uintptr, aCsrMap uintptr, pSrc uintptr, iExcept int32) { /* sqlite3.c:135836:13: */
+func srclistRenumberCursors(tls *libc.TLS, pParse uintptr, aCsrMap uintptr, pSrc uintptr, iExcept int32) { /* sqlite3.c:137022:13: */
var i int32
var pItem uintptr
i = 0
@@ -116948,10 +118778,11 @@ __1:
{
if i != iExcept {
var p uintptr
- if !((int32(*(*uint16)(unsafe.Pointer(pItem + 36 /* &.fg */ + 4 /* &.isRecursive */)) & 0x20 >> 5)) != 0) || (*(*int32)(unsafe.Pointer(aCsrMap + uintptr((*SrcItem)(unsafe.Pointer(pItem)).FiCursor)*4)) == 0) {
- *(*int32)(unsafe.Pointer(aCsrMap + uintptr((*SrcItem)(unsafe.Pointer(pItem)).FiCursor)*4)) = libc.PostIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnTab, 1)
+
+ if !(int32(*(*uint16)(unsafe.Pointer(pItem + 36 + 4))&0x20>>5) != 0) || *(*int32)(unsafe.Pointer(aCsrMap + uintptr((*SrcItem)(unsafe.Pointer(pItem)).FiCursor+1)*4)) == 0 {
+ *(*int32)(unsafe.Pointer(aCsrMap + uintptr((*SrcItem)(unsafe.Pointer(pItem)).FiCursor+1)*4)) = libc.PostIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnTab, 1)
}
- (*SrcItem)(unsafe.Pointer(pItem)).FiCursor = *(*int32)(unsafe.Pointer(aCsrMap + uintptr((*SrcItem)(unsafe.Pointer(pItem)).FiCursor)*4))
+ (*SrcItem)(unsafe.Pointer(pItem)).FiCursor = *(*int32)(unsafe.Pointer(aCsrMap + uintptr((*SrcItem)(unsafe.Pointer(pItem)).FiCursor+1)*4))
for p = (*SrcItem)(unsafe.Pointer(pItem)).FpSelect; p != 0; p = (*Select)(unsafe.Pointer(p)).FpPrior {
srclistRenumberCursors(tls, pParse, aCsrMap, (*Select)(unsafe.Pointer(p)).FpSrc, -1)
}
@@ -116967,16 +118798,24 @@ __2:
__3:
}
+// *piCursor is a cursor number. Change it if it needs to be mapped.
+func renumberCursorDoMapping(tls *libc.TLS, pWalker uintptr, piCursor uintptr) { /* sqlite3.c:137048:13: */
+ var aCsrMap uintptr = *(*uintptr)(unsafe.Pointer(pWalker + 24))
+ var iCsr int32 = *(*int32)(unsafe.Pointer(piCursor))
+ if iCsr < *(*int32)(unsafe.Pointer(aCsrMap)) && *(*int32)(unsafe.Pointer(aCsrMap + uintptr(iCsr+1)*4)) > 0 {
+ *(*int32)(unsafe.Pointer(piCursor)) = *(*int32)(unsafe.Pointer(aCsrMap + uintptr(iCsr+1)*4))
+ }
+}
+
// Expression walker callback used by renumberCursors() to update
// Expr objects to match newly assigned cursor numbers.
-func renumberCursorsCb(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 { /* sqlite3.c:135862:12: */
- var aCsrMap uintptr = *(*uintptr)(unsafe.Pointer(pWalker + 24 /* &.u */))
+func renumberCursorsCb(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 { /* sqlite3.c:137060:12: */
var op int32 = int32((*Expr)(unsafe.Pointer(pExpr)).Fop)
- if ((op == TK_COLUMN) || (op == TK_IF_NULL_ROW)) && (*(*int32)(unsafe.Pointer(aCsrMap + uintptr((*Expr)(unsafe.Pointer(pExpr)).FiTable)*4)) != 0) {
- (*Expr)(unsafe.Pointer(pExpr)).FiTable = *(*int32)(unsafe.Pointer(aCsrMap + uintptr((*Expr)(unsafe.Pointer(pExpr)).FiTable)*4))
+ if op == TK_COLUMN || op == TK_IF_NULL_ROW {
+ renumberCursorDoMapping(tls, pWalker, pExpr+28)
}
- if (((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_FromJoin))) != U32(0)) && (*(*int32)(unsafe.Pointer(aCsrMap + uintptr((*Expr)(unsafe.Pointer(pExpr)).FiRightJoinTable)*4)) != 0) {
- (*Expr)(unsafe.Pointer(pExpr)).FiRightJoinTable = *(*int32)(unsafe.Pointer(aCsrMap + uintptr((*Expr)(unsafe.Pointer(pExpr)).FiRightJoinTable)*4))
+ if (*Expr)(unsafe.Pointer(pExpr)).Fflags&U32(EP_FromJoin) != U32(0) {
+ renumberCursorDoMapping(tls, pWalker, pExpr+36)
}
return WRC_Continue
}
@@ -116997,7 +118836,7 @@ func renumberCursorsCb(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 { /*
// * the array entries for all cursor numbers that do *not* appear in
// FROM clauses of the select statement as described above are
// initialized to zero.
-func renumberCursors(tls *libc.TLS, pParse uintptr, p uintptr, iExcept int32, aCsrMap uintptr) { /* sqlite3.c:135892:13: */
+func renumberCursors(tls *libc.TLS, pParse uintptr, p uintptr, iExcept int32, aCsrMap uintptr) { /* sqlite3.c:137089:13: */
bp := tls.Alloc(28)
defer tls.Free(28)
@@ -117005,7 +118844,7 @@ func renumberCursors(tls *libc.TLS, pParse uintptr, p uintptr, iExcept int32, aC
srclistRenumberCursors(tls, pParse, aCsrMap, (*Select)(unsafe.Pointer(p)).FpSrc, iExcept)
libc.Xmemset(tls, bp /* &w */, 0, uint32(unsafe.Sizeof(Walker{})))
- *(*uintptr)(unsafe.Pointer(bp /* &w */ + 24 /* &.u */)) = aCsrMap
+ *(*uintptr)(unsafe.Pointer(bp + 24)) = aCsrMap
(*Walker)(unsafe.Pointer(bp /* &w */)).FxExprCallback = *(*uintptr)(unsafe.Pointer(&struct {
f func(*libc.TLS, uintptr, uintptr) int32
}{renumberCursorsCb}))
@@ -117167,7 +119006,7 @@ func renumberCursors(tls *libc.TLS, pParse uintptr, p uintptr, iExcept int32, aC
//
// All of the expression analysis must occur on both the outer query and
// the subquery before this routine runs.
-func flattenSubquery(tls *libc.TLS, pParse uintptr, p uintptr, iFrom int32, isAgg int32) int32 { /* sqlite3.c:136063:12: */
+func flattenSubquery(tls *libc.TLS, pParse uintptr, p uintptr, iFrom int32, isAgg int32) int32 { /* sqlite3.c:137260:12: */
bp := tls.Alloc(48)
defer tls.Free(48)
@@ -117190,16 +119029,16 @@ func flattenSubquery(tls *libc.TLS, pParse uintptr, p uintptr, iFrom int32, isAg
// Check to see if flattening is permitted. Return 0 if not.
- if ((*Sqlite3)(unsafe.Pointer((db))).FdbOptFlags & (U32(SQLITE_QueryFlattener))) != U32(0) {
+ if (*Sqlite3)(unsafe.Pointer(db)).FdbOptFlags&U32(SQLITE_QueryFlattener) != U32(0) {
return 0
}
pSrc = (*Select)(unsafe.Pointer(p)).FpSrc
- pSubitem = ((pSrc + 8 /* &.a */) + uintptr(iFrom)*72)
+ pSubitem = pSrc + 8 + uintptr(iFrom)*72
iParent = (*SrcItem)(unsafe.Pointer(pSubitem)).FiCursor
pSub = (*SrcItem)(unsafe.Pointer(pSubitem)).FpSelect
- if ((*Select)(unsafe.Pointer(p)).FpWin != 0) || ((*Select)(unsafe.Pointer(pSub)).FpWin != 0) {
+ if (*Select)(unsafe.Pointer(p)).FpWin != 0 || (*Select)(unsafe.Pointer(pSub)).FpWin != 0 {
return 0
} // Restriction (25)
@@ -117210,37 +119049,37 @@ func flattenSubquery(tls *libc.TLS, pParse uintptr, p uintptr, iFrom int32, isAg
// because they could be computed at compile-time. But when LIMIT and OFFSET
// became arbitrary expressions, we were forced to add restrictions (13)
// and (14).
- if ((*Select)(unsafe.Pointer(pSub)).FpLimit != 0) && ((*Select)(unsafe.Pointer(p)).FpLimit != 0) {
+ if (*Select)(unsafe.Pointer(pSub)).FpLimit != 0 && (*Select)(unsafe.Pointer(p)).FpLimit != 0 {
return 0
} // Restriction (13)
- if ((*Select)(unsafe.Pointer(pSub)).FpLimit != 0) && ((*Expr)(unsafe.Pointer((*Select)(unsafe.Pointer(pSub)).FpLimit)).FpRight != 0) {
+ if (*Select)(unsafe.Pointer(pSub)).FpLimit != 0 && (*Expr)(unsafe.Pointer((*Select)(unsafe.Pointer(pSub)).FpLimit)).FpRight != 0 {
return 0
} // Restriction (14)
- if (((*Select)(unsafe.Pointer(p)).FselFlags & U32(SF_Compound)) != U32(0)) && ((*Select)(unsafe.Pointer(pSub)).FpLimit != 0) {
+ if (*Select)(unsafe.Pointer(p)).FselFlags&U32(SF_Compound) != U32(0) && (*Select)(unsafe.Pointer(pSub)).FpLimit != 0 {
return 0 // Restriction (15)
}
if (*SrcList)(unsafe.Pointer(pSubSrc)).FnSrc == 0 {
return 0
} // Restriction (7)
- if ((*Select)(unsafe.Pointer(pSub)).FselFlags & U32(SF_Distinct)) != 0 {
+ if (*Select)(unsafe.Pointer(pSub)).FselFlags&U32(SF_Distinct) != 0 {
return 0
} // Restriction (4)
- if ((*Select)(unsafe.Pointer(pSub)).FpLimit != 0) && (((*SrcList)(unsafe.Pointer(pSrc)).FnSrc > 1) || (isAgg != 0)) {
+ if (*Select)(unsafe.Pointer(pSub)).FpLimit != 0 && ((*SrcList)(unsafe.Pointer(pSrc)).FnSrc > 1 || isAgg != 0) {
return 0 // Restrictions (8)(9)
}
- if ((*Select)(unsafe.Pointer(p)).FpOrderBy != 0) && ((*Select)(unsafe.Pointer(pSub)).FpOrderBy != 0) {
+ if (*Select)(unsafe.Pointer(p)).FpOrderBy != 0 && (*Select)(unsafe.Pointer(pSub)).FpOrderBy != 0 {
return 0 // Restriction (11)
}
- if (isAgg != 0) && ((*Select)(unsafe.Pointer(pSub)).FpOrderBy != 0) {
+ if isAgg != 0 && (*Select)(unsafe.Pointer(pSub)).FpOrderBy != 0 {
return 0
} // Restriction (16)
- if ((*Select)(unsafe.Pointer(pSub)).FpLimit != 0) && ((*Select)(unsafe.Pointer(p)).FpWhere != 0) {
+ if (*Select)(unsafe.Pointer(pSub)).FpLimit != 0 && (*Select)(unsafe.Pointer(p)).FpWhere != 0 {
return 0
} // Restriction (19)
- if ((*Select)(unsafe.Pointer(pSub)).FpLimit != 0) && (((*Select)(unsafe.Pointer(p)).FselFlags & U32(SF_Distinct)) != U32(0)) {
+ if (*Select)(unsafe.Pointer(pSub)).FpLimit != 0 && (*Select)(unsafe.Pointer(p)).FselFlags&U32(SF_Distinct) != U32(0) {
return 0 // Restriction (21)
}
- if ((*Select)(unsafe.Pointer(pSub)).FselFlags & (U32(SF_Recursive))) != 0 {
+ if (*Select)(unsafe.Pointer(pSub)).FselFlags&U32(SF_Recursive) != 0 {
return 0 // Restrictions (22)
}
@@ -117262,12 +119101,12 @@ func flattenSubquery(tls *libc.TLS, pParse uintptr, p uintptr, iFrom int32, isAg
// the LEFT JOIN table should be all-NULL.
//
// See also tickets #306, #350, and #3300.
- if (int32((*SrcItem)(unsafe.Pointer(pSubitem)).Ffg.Fjointype) & JT_OUTER) != 0 {
+ if int32((*SrcItem)(unsafe.Pointer(pSubitem)).Ffg.Fjointype)&JT_OUTER != 0 {
isLeftJoin = 1
- if ((((*SrcList)(unsafe.Pointer(pSubSrc)).FnSrc > 1) || // (3a)
- (isAgg != 0)) || // (3b)
- ((*Table)(unsafe.Pointer((*SrcItem)(unsafe.Pointer((pSubSrc + 8 /* &.a */))).FpTab)).FnModuleArg != 0)) || // (3c)
- (((*Select)(unsafe.Pointer(p)).FselFlags & U32(SF_Distinct)) != U32(0)) {
+ if (*SrcList)(unsafe.Pointer(pSubSrc)).FnSrc > 1 ||
+ isAgg != 0 ||
+ int32((*Table)(unsafe.Pointer((*SrcItem)(unsafe.Pointer(pSubSrc+8)).FpTab)).FeTabType) == TABTYP_VTAB ||
+ (*Select)(unsafe.Pointer(p)).FselFlags&U32(SF_Distinct) != U32(0) {
return 0
}
}
@@ -117280,15 +119119,15 @@ func flattenSubquery(tls *libc.TLS, pParse uintptr, p uintptr, iFrom int32, isAg
if (*Select)(unsafe.Pointer(pSub)).FpOrderBy != 0 {
return 0 // Restriction (20)
}
- if ((isAgg != 0) || (((*Select)(unsafe.Pointer(p)).FselFlags & U32(SF_Distinct)) != U32(0))) || (isLeftJoin > 0) {
+ if isAgg != 0 || (*Select)(unsafe.Pointer(p)).FselFlags&U32(SF_Distinct) != U32(0) || isLeftJoin > 0 {
return 0 // (17d1), (17d2), or (17f)
}
for pSub1 = pSub; pSub1 != 0; pSub1 = (*Select)(unsafe.Pointer(pSub1)).FpPrior {
- if (((((*Select)(unsafe.Pointer(pSub1)).FselFlags & (U32(SF_Distinct | SF_Aggregate))) != U32(0)) || // (17b)
- (((*Select)(unsafe.Pointer(pSub1)).FpPrior != 0) && (int32((*Select)(unsafe.Pointer(pSub1)).Fop) != TK_ALL))) || // (17a)
- ((*SrcList)(unsafe.Pointer((*Select)(unsafe.Pointer(pSub1)).FpSrc)).FnSrc < 1)) || // (17c)
- ((*Select)(unsafe.Pointer(pSub1)).FpWin != 0) {
+ if (*Select)(unsafe.Pointer(pSub1)).FselFlags&U32(SF_Distinct|SF_Aggregate) != U32(0) ||
+ (*Select)(unsafe.Pointer(pSub1)).FpPrior != 0 && int32((*Select)(unsafe.Pointer(pSub1)).Fop) != TK_ALL ||
+ (*SrcList)(unsafe.Pointer((*Select)(unsafe.Pointer(pSub1)).FpSrc)).FnSrc < 1 ||
+ (*Select)(unsafe.Pointer(pSub1)).FpWin != 0 {
return 0
}
@@ -117298,14 +119137,14 @@ func flattenSubquery(tls *libc.TLS, pParse uintptr, p uintptr, iFrom int32, isAg
if (*Select)(unsafe.Pointer(p)).FpOrderBy != 0 {
var ii int32
for ii = 0; ii < (*ExprList)(unsafe.Pointer((*Select)(unsafe.Pointer(p)).FpOrderBy)).FnExpr; ii++ {
- if int32(*(*U16)(unsafe.Pointer((((*Select)(unsafe.Pointer(p)).FpOrderBy + 8 /* &.a */) + uintptr(ii)*20 + 16 /* &.u */ /* &.x */) /* &.iOrderByCol */))) == 0 {
+ if int32(*(*U16)(unsafe.Pointer((*Select)(unsafe.Pointer(p)).FpOrderBy + 8 + uintptr(ii)*20 + 16))) == 0 {
return 0
}
}
}
// Restriction (23)
- if ((*Select)(unsafe.Pointer(p)).FselFlags & U32(SF_Recursive)) != 0 {
+ if (*Select)(unsafe.Pointer(p)).FselFlags&U32(SF_Recursive) != 0 {
return 0
}
@@ -117313,7 +119152,10 @@ func flattenSubquery(tls *libc.TLS, pParse uintptr, p uintptr, iFrom int32, isAg
if (*Parse)(unsafe.Pointer(pParse)).FnSelect > 500 {
return 0
}
- aCsrMap = Xsqlite3DbMallocZero(tls, db, (uint64(uint32((*Parse)(unsafe.Pointer(pParse)).FnTab) * uint32(unsafe.Sizeof(int32(0))))))
+ aCsrMap = Xsqlite3DbMallocZero(tls, db, uint64((I64((*Parse)(unsafe.Pointer(pParse)).FnTab)+int64(1))*I64(unsafe.Sizeof(int32(0)))))
+ if aCsrMap != 0 {
+ *(*int32)(unsafe.Pointer(aCsrMap)) = (*Parse)(unsafe.Pointer(pParse)).FnTab
+ }
}
}
@@ -117386,7 +119228,7 @@ func flattenSubquery(tls *libc.TLS, pParse uintptr, p uintptr, iFrom int32, isAg
(*Select)(unsafe.Pointer(p)).FpPrior = pPrior
} else {
(*Select)(unsafe.Pointer(pNew)).FselId = U32(libc.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnSelect, 1))
- if (aCsrMap != 0) && (int32((*Sqlite3)(unsafe.Pointer(db)).FmallocFailed) == 0) {
+ if aCsrMap != 0 && int32((*Sqlite3)(unsafe.Pointer(db)).FmallocFailed) == 0 {
renumberCursors(tls, pParse, pNew, iFrom, aCsrMap)
}
(*Select)(unsafe.Pointer(pNew)).FpPrior = pPrior
@@ -117477,7 +119319,7 @@ __1:
// The middle slot is expanded to two slots in order to make space
// for the two elements in the FROM clause of the subquery.
if nSubSrc > 1 {
- pSrc = Xsqlite3SrcListEnlarge(tls, pParse, pSrc, (nSubSrc - 1), (iFrom + 1))
+ pSrc = Xsqlite3SrcListEnlarge(tls, pParse, pSrc, nSubSrc-1, iFrom+1)
if pSrc == uintptr(0) {
goto __3
}
@@ -117487,13 +119329,13 @@ __1:
// Transfer the FROM clause terms from the subquery into the
// outer query.
for i = 0; i < nSubSrc; i++ {
- Xsqlite3IdListDelete(tls, db, (*SrcItem)(unsafe.Pointer((pSrc+8 /* &.a */)+uintptr((i+iFrom))*72)).FpUsing)
+ Xsqlite3IdListDelete(tls, db, (*SrcItem)(unsafe.Pointer(pSrc+8+uintptr(i+iFrom)*72)).FpUsing)
- *(*SrcItem)(unsafe.Pointer((pSrc + 8 /* &.a */) + uintptr((i+iFrom))*72)) = *(*SrcItem)(unsafe.Pointer((pSubSrc + 8 /* &.a */) + uintptr(i)*72))
- iNewParent = (*SrcItem)(unsafe.Pointer((pSubSrc + 8 /* &.a */) + uintptr(i)*72)).FiCursor
- libc.Xmemset(tls, ((pSubSrc + 8 /* &.a */) + uintptr(i)*72), 0, uint32(unsafe.Sizeof(SrcItem{})))
+ *(*SrcItem)(unsafe.Pointer(pSrc + 8 + uintptr(i+iFrom)*72)) = *(*SrcItem)(unsafe.Pointer(pSubSrc + 8 + uintptr(i)*72))
+ iNewParent = (*SrcItem)(unsafe.Pointer(pSubSrc + 8 + uintptr(i)*72)).FiCursor
+ libc.Xmemset(tls, pSubSrc+8+uintptr(i)*72, 0, uint32(unsafe.Sizeof(SrcItem{})))
}
- (*SrcItem)(unsafe.Pointer((pSrc + 8 /* &.a */) + uintptr(iFrom)*72)).Ffg.Fjointype = jointype
+ (*SrcItem)(unsafe.Pointer(pSrc + 8 + uintptr(iFrom)*72)).Ffg.Fjointype = jointype
// Now begin substituting subquery result set expressions for
// references to the iParent in the outer query.
@@ -117506,7 +119348,7 @@ __1:
//
// We look at every expression in the outer query and every place we see
// "a" we substitute "x*3" and every place we see "b" we substitute "y+10".
- if ((*Select)(unsafe.Pointer(pSub)).FpOrderBy != 0) && (((*Select)(unsafe.Pointer(pParent)).FselFlags & U32(SF_NoopOrderBy)) == U32(0)) {
+ if (*Select)(unsafe.Pointer(pSub)).FpOrderBy != 0 && (*Select)(unsafe.Pointer(pParent)).FselFlags&U32(SF_NoopOrderBy) == U32(0) {
// At this point, any non-zero iOrderByCol values indicate that the
// ORDER BY column expression is identical to the iOrderByCol'th
// expression returned by SELECT statement pSub. Since these values
@@ -117519,7 +119361,7 @@ __1:
// currently part of pSub->pSrc). See ticket [d11a6e908f].
var pOrderBy uintptr = (*Select)(unsafe.Pointer(pSub)).FpOrderBy
for i = 0; i < (*ExprList)(unsafe.Pointer(pOrderBy)).FnExpr; i++ {
- *(*U16)(unsafe.Pointer((pOrderBy + 8 /* &.a */) + uintptr(i)*20 + 16 /* &.u */ /* &.x */ /* &.iOrderByCol */)) = U16(0)
+ *(*U16)(unsafe.Pointer(pOrderBy + 8 + uintptr(i)*20 + 16)) = U16(0)
}
(*Select)(unsafe.Pointer(pParent)).FpOrderBy = pOrderBy
@@ -117550,7 +119392,7 @@ __1:
// The flattened query is a compound if either the inner or the
// outer query is a compound.
- *(*U32)(unsafe.Pointer(pParent + 4 /* &.selFlags */)) |= ((*Select)(unsafe.Pointer(pSub)).FselFlags & U32(SF_Compound))
+ *(*U32)(unsafe.Pointer(pParent + 4)) |= (*Select)(unsafe.Pointer(pSub)).FselFlags & U32(SF_Compound)
// restriction (17b)
// SELECT ... FROM (SELECT ... LIMIT a OFFSET b) LIMIT x OFFSET y;
@@ -117565,7 +119407,7 @@ __1:
// Recompute the SrcList_item.colUsed masks for the flattened
// tables.
for i = 0; i < nSubSrc; i++ {
- recomputeColumnsUsed(tls, pParent, ((pSrc + 8 /* &.a */) + uintptr((i+iFrom))*72))
+ recomputeColumnsUsed(tls, pParent, pSrc+8+uintptr(i+iFrom)*72)
}
}
@@ -117589,7 +119431,7 @@ __3:
// A structure to keep track of all of the column values that are fixed to
// a known value due to WHERE clause constraints of the form COLUMN=VALUE.
-type WhereConst = WhereConst1 /* sqlite3.c:136486:27 */
+type WhereConst = WhereConst1 /* sqlite3.c:137684:27 */
// Add a new entry to the pConst object. Except, do not add duplicate
// pColumn entires. Also, do not add if doing so would not be appropriate.
@@ -117597,10 +119439,10 @@ type WhereConst = WhereConst1 /* sqlite3.c:136486:27 */
// The caller guarantees the pColumn is a column and pValue is a constant.
// This routine has to do some additional checks before completing the
// insert.
-func constInsert(tls *libc.TLS, pConst uintptr, pColumn uintptr, pValue uintptr, pExpr uintptr) { /* sqlite3.c:136504:13: */
+func constInsert(tls *libc.TLS, pConst uintptr, pColumn uintptr, pValue uintptr, pExpr uintptr) { /* sqlite3.c:137702:13: */
var i int32
- if ((*Expr)(unsafe.Pointer((pColumn))).Fflags & (U32(EP_FixedCol))) != U32(0) {
+ if (*Expr)(unsafe.Pointer(pColumn)).Fflags&U32(EP_FixedCol) != U32(0) {
return
}
if int32(Xsqlite3ExprAffinity(tls, pValue)) != 0 {
@@ -117613,10 +119455,10 @@ func constInsert(tls *libc.TLS, pConst uintptr, pColumn uintptr, pValue uintptr,
// 2018-10-25 ticket [cf5ed20f]
// Make sure the same pColumn is not inserted more than once
for i = 0; i < (*WhereConst)(unsafe.Pointer(pConst)).FnConst; i++ {
- var pE2 uintptr = *(*uintptr)(unsafe.Pointer((*WhereConst)(unsafe.Pointer(pConst)).FapExpr + uintptr((i*2))*4))
+ var pE2 uintptr = *(*uintptr)(unsafe.Pointer((*WhereConst)(unsafe.Pointer(pConst)).FapExpr + uintptr(i*2)*4))
- if ((*Expr)(unsafe.Pointer(pE2)).FiTable == (*Expr)(unsafe.Pointer(pColumn)).FiTable) &&
- (int32((*Expr)(unsafe.Pointer(pE2)).FiColumn) == int32((*Expr)(unsafe.Pointer(pColumn)).FiColumn)) {
+ if (*Expr)(unsafe.Pointer(pE2)).FiTable == (*Expr)(unsafe.Pointer(pColumn)).FiTable &&
+ int32((*Expr)(unsafe.Pointer(pE2)).FiColumn) == int32((*Expr)(unsafe.Pointer(pColumn)).FiColumn) {
return // Already present. Return without doing anything.
}
}
@@ -117626,12 +119468,12 @@ func constInsert(tls *libc.TLS, pConst uintptr, pColumn uintptr, pValue uintptr,
(*WhereConst)(unsafe.Pointer(pConst)).FnConst++
(*WhereConst)(unsafe.Pointer(pConst)).FapExpr = Xsqlite3DbReallocOrFree(tls, (*Parse)(unsafe.Pointer((*WhereConst)(unsafe.Pointer(pConst)).FpParse)).Fdb, (*WhereConst)(unsafe.Pointer(pConst)).FapExpr,
- (uint64((uint32((*WhereConst)(unsafe.Pointer(pConst)).FnConst * 2)) * uint32(unsafe.Sizeof(uintptr(0))))))
+ uint64(uint32((*WhereConst)(unsafe.Pointer(pConst)).FnConst*2)*uint32(unsafe.Sizeof(uintptr(0)))))
if (*WhereConst)(unsafe.Pointer(pConst)).FapExpr == uintptr(0) {
(*WhereConst)(unsafe.Pointer(pConst)).FnConst = 0
} else {
- *(*uintptr)(unsafe.Pointer((*WhereConst)(unsafe.Pointer(pConst)).FapExpr + uintptr((((*WhereConst)(unsafe.Pointer(pConst)).FnConst*2)-2))*4)) = pColumn
- *(*uintptr)(unsafe.Pointer((*WhereConst)(unsafe.Pointer(pConst)).FapExpr + uintptr((((*WhereConst)(unsafe.Pointer(pConst)).FnConst*2)-1))*4)) = pValue
+ *(*uintptr)(unsafe.Pointer((*WhereConst)(unsafe.Pointer(pConst)).FapExpr + uintptr((*WhereConst)(unsafe.Pointer(pConst)).FnConst*2-2)*4)) = pColumn
+ *(*uintptr)(unsafe.Pointer((*WhereConst)(unsafe.Pointer(pConst)).FapExpr + uintptr((*WhereConst)(unsafe.Pointer(pConst)).FnConst*2-1)*4)) = pValue
}
}
@@ -117639,13 +119481,13 @@ func constInsert(tls *libc.TLS, pConst uintptr, pColumn uintptr, pValue uintptr,
// is a constant expression and where the term must be true because it
// is part of the AND-connected terms of the expression. For each term
// found, add it to the pConst structure.
-func findConstInWhere(tls *libc.TLS, pConst uintptr, pExpr uintptr) { /* sqlite3.c:136552:13: */
+func findConstInWhere(tls *libc.TLS, pConst uintptr, pExpr uintptr) { /* sqlite3.c:137750:13: */
var pRight uintptr
var pLeft uintptr
if pExpr == uintptr(0) {
return
}
- if ((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_FromJoin))) != U32(0) {
+ if (*Expr)(unsafe.Pointer(pExpr)).Fflags&U32(EP_FromJoin) != U32(0) {
return
}
if int32((*Expr)(unsafe.Pointer(pExpr)).Fop) == TK_AND {
@@ -117659,10 +119501,10 @@ func findConstInWhere(tls *libc.TLS, pConst uintptr, pExpr uintptr) { /* sqlite3
pRight = (*Expr)(unsafe.Pointer(pExpr)).FpRight
pLeft = (*Expr)(unsafe.Pointer(pExpr)).FpLeft
- if (int32((*Expr)(unsafe.Pointer(pRight)).Fop) == TK_COLUMN) && (Xsqlite3ExprIsConstant(tls, pLeft) != 0) {
+ if int32((*Expr)(unsafe.Pointer(pRight)).Fop) == TK_COLUMN && Xsqlite3ExprIsConstant(tls, pLeft) != 0 {
constInsert(tls, pConst, pRight, pLeft, pExpr)
}
- if (int32((*Expr)(unsafe.Pointer(pLeft)).Fop) == TK_COLUMN) && (Xsqlite3ExprIsConstant(tls, pRight) != 0) {
+ if int32((*Expr)(unsafe.Pointer(pLeft)).Fop) == TK_COLUMN && Xsqlite3ExprIsConstant(tls, pRight) != 0 {
constInsert(tls, pConst, pLeft, pRight, pExpr)
}
}
@@ -117674,7 +119516,7 @@ func findConstInWhere(tls *libc.TLS, pConst uintptr, pExpr uintptr) { /* sqlite3
// then overwrite it with the corresponding value. Except, do not do so
// if argument bIgnoreAffBlob is non-zero and the affinity of pExpr
// is SQLITE_AFF_BLOB.
-func propagateConstantExprRewriteOne(tls *libc.TLS, pConst uintptr, pExpr uintptr, bIgnoreAffBlob int32) int32 { /* sqlite3.c:136583:12: */
+func propagateConstantExprRewriteOne(tls *libc.TLS, pConst uintptr, pExpr uintptr, bIgnoreAffBlob int32) int32 { /* sqlite3.c:137781:12: */
var i int32
if *(*U8)(unsafe.Pointer((*WhereConst)(unsafe.Pointer(pConst)).FpOomFault)) != 0 {
return WRC_Prune
@@ -117682,12 +119524,12 @@ func propagateConstantExprRewriteOne(tls *libc.TLS, pConst uintptr, pExpr uintpt
if int32((*Expr)(unsafe.Pointer(pExpr)).Fop) != TK_COLUMN {
return WRC_Continue
}
- if ((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_FixedCol | EP_FromJoin))) != U32(0) {
+ if (*Expr)(unsafe.Pointer(pExpr)).Fflags&U32(EP_FixedCol|EP_FromJoin) != U32(0) {
return WRC_Continue
}
for i = 0; i < (*WhereConst)(unsafe.Pointer(pConst)).FnConst; i++ {
- var pColumn uintptr = *(*uintptr)(unsafe.Pointer((*WhereConst)(unsafe.Pointer(pConst)).FapExpr + uintptr((i*2))*4))
+ var pColumn uintptr = *(*uintptr)(unsafe.Pointer((*WhereConst)(unsafe.Pointer(pConst)).FapExpr + uintptr(i*2)*4))
if pColumn == pExpr {
continue
}
@@ -117697,15 +119539,15 @@ func propagateConstantExprRewriteOne(tls *libc.TLS, pConst uintptr, pExpr uintpt
if int32((*Expr)(unsafe.Pointer(pColumn)).FiColumn) != int32((*Expr)(unsafe.Pointer(pExpr)).FiColumn) {
continue
}
- if (bIgnoreAffBlob != 0) && (int32(Xsqlite3ExprAffinity(tls, pColumn)) == SQLITE_AFF_BLOB) {
+ if bIgnoreAffBlob != 0 && int32(Xsqlite3ExprAffinity(tls, pColumn)) == SQLITE_AFF_BLOB {
break
}
// A match is found. Add the EP_FixedCol property
(*WhereConst)(unsafe.Pointer(pConst)).FnChng++
- *(*U32)(unsafe.Pointer(pExpr + 4 /* &.flags */)) &= (libc.Uint32FromInt32(libc.CplInt32(EP_Leaf)))
- *(*U32)(unsafe.Pointer(pExpr + 4 /* &.flags */)) |= (U32(EP_FixedCol))
+ *(*U32)(unsafe.Pointer(pExpr + 4)) &= libc.Uint32FromInt32(libc.CplInt32(EP_Leaf))
+ *(*U32)(unsafe.Pointer(pExpr + 4)) |= U32(EP_FixedCol)
- (*Expr)(unsafe.Pointer(pExpr)).FpLeft = Xsqlite3ExprDup(tls, (*Parse)(unsafe.Pointer((*WhereConst)(unsafe.Pointer(pConst)).FpParse)).Fdb, *(*uintptr)(unsafe.Pointer((*WhereConst)(unsafe.Pointer(pConst)).FapExpr + uintptr(((i*2)+1))*4)), 0)
+ (*Expr)(unsafe.Pointer(pExpr)).FpLeft = Xsqlite3ExprDup(tls, (*Parse)(unsafe.Pointer((*WhereConst)(unsafe.Pointer(pConst)).FpParse)).Fdb, *(*uintptr)(unsafe.Pointer((*WhereConst)(unsafe.Pointer(pConst)).FapExpr + uintptr(i*2+1)*4)), 0)
if (*Sqlite3)(unsafe.Pointer((*Parse)(unsafe.Pointer((*WhereConst)(unsafe.Pointer(pConst)).FpParse)).Fdb)).FmallocFailed != 0 {
return WRC_Prune
}
@@ -117728,12 +119570,12 @@ func propagateConstantExprRewriteOne(tls *libc.TLS, pConst uintptr, pExpr uintpt
// uses an affinity other than TEXT and one of its immediate
// children is a column that matches one of the columns in
// pWalker->u.pConst.
-func propagateConstantExprRewrite(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 { /* sqlite3.c:136632:12: */
- var pConst uintptr = *(*uintptr)(unsafe.Pointer(pWalker + 24 /* &.u */))
+func propagateConstantExprRewrite(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 { /* sqlite3.c:137830:12: */
+ var pConst uintptr = *(*uintptr)(unsafe.Pointer(pWalker + 24))
if (*WhereConst)(unsafe.Pointer(pConst)).FbHasAffBlob != 0 {
- if ((int32((*Expr)(unsafe.Pointer(pExpr)).Fop) >= TK_EQ) && (int32((*Expr)(unsafe.Pointer(pExpr)).Fop) <= TK_GE)) ||
- (int32((*Expr)(unsafe.Pointer(pExpr)).Fop) == TK_IS) {
+ if int32((*Expr)(unsafe.Pointer(pExpr)).Fop) >= TK_EQ && int32((*Expr)(unsafe.Pointer(pExpr)).Fop) <= TK_GE ||
+ int32((*Expr)(unsafe.Pointer(pExpr)).Fop) == TK_IS {
propagateConstantExprRewriteOne(tls, pConst, (*Expr)(unsafe.Pointer(pExpr)).FpLeft, 0)
if *(*U8)(unsafe.Pointer((*WhereConst)(unsafe.Pointer(pConst)).FpOomFault)) != 0 {
return WRC_Prune
@@ -117795,7 +119637,7 @@ func propagateConstantExprRewrite(tls *libc.TLS, pWalker uintptr, pExpr uintptr)
// operators ==, <=, <, >=, >, or IS in a way that will cause the correct
// type conversions to occur. See logic associated with the bHasAffBlob flag
// for details.
-func propagateConstants(tls *libc.TLS, pParse uintptr, p uintptr) int32 { /* sqlite3.c:136703:12: */
+func propagateConstants(tls *libc.TLS, pParse uintptr, p uintptr) int32 { /* sqlite3.c:137901:12: */
bp := tls.Alloc(52)
defer tls.Free(52)
@@ -117805,14 +119647,14 @@ func propagateConstants(tls *libc.TLS, pParse uintptr, p uintptr) int32 { /* sql
var nChng int32 = 0
(*WhereConst)(unsafe.Pointer(bp /* &x */)).FpParse = pParse
- (*WhereConst)(unsafe.Pointer(bp /* &x */)).FpOomFault = ((*Parse)(unsafe.Pointer(pParse)).Fdb + 83 /* &.mallocFailed */)
- for ok := true; ok; ok = (*WhereConst)(unsafe.Pointer(bp /* &x */)).FnChng != 0 {
+ (*WhereConst)(unsafe.Pointer(bp /* &x */)).FpOomFault = (*Parse)(unsafe.Pointer(pParse)).Fdb + 83
+ for ok := true; ok; ok = (*WhereConst)(unsafe.Pointer(bp)).FnChng != 0 {
(*WhereConst)(unsafe.Pointer(bp /* &x */)).FnConst = 0
(*WhereConst)(unsafe.Pointer(bp /* &x */)).FnChng = 0
(*WhereConst)(unsafe.Pointer(bp /* &x */)).FapExpr = uintptr(0)
(*WhereConst)(unsafe.Pointer(bp /* &x */)).FbHasAffBlob = 0
findConstInWhere(tls, bp /* &x */, (*Select)(unsafe.Pointer(p)).FpWhere)
- if (*WhereConst)(unsafe.Pointer(bp /* &x */)).FnConst != 0 {
+ if (*WhereConst)(unsafe.Pointer(bp)).FnConst != 0 {
libc.Xmemset(tls, bp+24 /* &w */, 0, uint32(unsafe.Sizeof(Walker{})))
(*Walker)(unsafe.Pointer(bp + 24 /* &w */)).FpParse = pParse
(*Walker)(unsafe.Pointer(bp + 24 /* &w */)).FxExprCallback = *(*uintptr)(unsafe.Pointer(&struct {
@@ -117823,10 +119665,10 @@ func propagateConstants(tls *libc.TLS, pParse uintptr, p uintptr) int32 { /* sql
}{Xsqlite3SelectWalkNoop}))
(*Walker)(unsafe.Pointer(bp + 24 /* &w */)).FxSelectCallback2 = uintptr(0)
(*Walker)(unsafe.Pointer(bp + 24 /* &w */)).FwalkerDepth = 0
- *(*uintptr)(unsafe.Pointer(bp + 24 /* &w */ + 24 /* &.u */)) = bp /* &x */
+ *(*uintptr)(unsafe.Pointer(bp + 24 + 24)) = bp /* &x */
Xsqlite3WalkExpr(tls, bp+24 /* &w */, (*Select)(unsafe.Pointer(p)).FpWhere)
Xsqlite3DbFree(tls, (*Parse)(unsafe.Pointer((*WhereConst)(unsafe.Pointer(bp /* &x */)).FpParse)).Fdb, (*WhereConst)(unsafe.Pointer(bp /* &x */)).FapExpr)
- nChng = nChng + ((*WhereConst)(unsafe.Pointer(bp /* &x */)).FnChng)
+ nChng = nChng + (*WhereConst)(unsafe.Pointer(bp)).FnChng
}
}
return nChng
@@ -117848,7 +119690,7 @@ func propagateConstants(tls *libc.TLS, pParse uintptr, p uintptr) int32 { /* sql
//
// * the sub-query uses only one distinct window frame, and
// * that the window frame has a PARTITION BY clase.
-func pushDownWindowCheck(tls *libc.TLS, pParse uintptr, pSubq uintptr, pExpr uintptr) int32 { /* sqlite3.c:136754:12: */
+func pushDownWindowCheck(tls *libc.TLS, pParse uintptr, pSubq uintptr, pExpr uintptr) int32 { /* sqlite3.c:137952:12: */
return Xsqlite3ExprIsConstantOrGroupBy(tls, pParse, pExpr, (*Window)(unsafe.Pointer((*Select)(unsafe.Pointer(pSubq)).FpWin)).FpPartition)
}
@@ -117919,7 +119761,7 @@ func pushDownWindowCheck(tls *libc.TLS, pParse uintptr, pSubq uintptr, pExpr uin
//
// Return 0 if no changes are made and non-zero if one or more WHERE clause
// terms are duplicated into the subquery.
-func pushDownWhereTerms(tls *libc.TLS, pParse uintptr, pSubq uintptr, pWhere uintptr, iCursor int32, isLeftJoin int32) int32 { /* sqlite3.c:136832:12: */
+func pushDownWhereTerms(tls *libc.TLS, pParse uintptr, pSubq uintptr, pWhere uintptr, iCursor int32, isLeftJoin int32) int32 { /* sqlite3.c:138030:12: */
bp := tls.Alloc(20)
defer tls.Free(20)
@@ -117928,7 +119770,7 @@ func pushDownWhereTerms(tls *libc.TLS, pParse uintptr, pSubq uintptr, pWhere uin
if pWhere == uintptr(0) {
return 0
}
- if ((*Select)(unsafe.Pointer(pSubq)).FselFlags & (U32(SF_Recursive | SF_MultiPart))) != 0 {
+ if (*Select)(unsafe.Pointer(pSubq)).FselFlags&U32(SF_Recursive|SF_MultiPart) != 0 {
return 0
}
@@ -117940,7 +119782,7 @@ func pushDownWhereTerms(tls *libc.TLS, pParse uintptr, pSubq uintptr, pWhere uin
} // restriction (6b)
}
} else {
- if ((*Select)(unsafe.Pointer(pSubq)).FpWin != 0) && ((*Window)(unsafe.Pointer((*Select)(unsafe.Pointer(pSubq)).FpWin)).FpPartition == uintptr(0)) {
+ if (*Select)(unsafe.Pointer(pSubq)).FpWin != 0 && (*Window)(unsafe.Pointer((*Select)(unsafe.Pointer(pSubq)).FpWin)).FpPartition == uintptr(0) {
return 0
}
}
@@ -117949,21 +119791,21 @@ func pushDownWhereTerms(tls *libc.TLS, pParse uintptr, pSubq uintptr, pWhere uin
return 0 // restriction (3)
}
for int32((*Expr)(unsafe.Pointer(pWhere)).Fop) == TK_AND {
- nChng = nChng + (pushDownWhereTerms(tls, pParse, pSubq, (*Expr)(unsafe.Pointer(pWhere)).FpRight,
- iCursor, isLeftJoin))
+ nChng = nChng + pushDownWhereTerms(tls, pParse, pSubq, (*Expr)(unsafe.Pointer(pWhere)).FpRight,
+ iCursor, isLeftJoin)
pWhere = (*Expr)(unsafe.Pointer(pWhere)).FpLeft
}
- if (isLeftJoin != 0) &&
- (((libc.Bool32(((*Expr)(unsafe.Pointer((pWhere))).Fflags & (U32(EP_FromJoin))) != U32(0))) == 0) ||
- ((*Expr)(unsafe.Pointer(pWhere)).FiRightJoinTable != iCursor)) {
+ if isLeftJoin != 0 &&
+ (libc.Bool32((*Expr)(unsafe.Pointer(pWhere)).Fflags&U32(EP_FromJoin) != U32(0)) == 0 ||
+ (*Expr)(unsafe.Pointer(pWhere)).FiRightJoinTable != iCursor) {
return 0 // restriction (4)
}
- if (((*Expr)(unsafe.Pointer((pWhere))).Fflags & (U32(EP_FromJoin))) != U32(0)) && ((*Expr)(unsafe.Pointer(pWhere)).FiRightJoinTable != iCursor) {
+ if (*Expr)(unsafe.Pointer(pWhere)).Fflags&U32(EP_FromJoin) != U32(0) && (*Expr)(unsafe.Pointer(pWhere)).FiRightJoinTable != iCursor {
return 0 // restriction (5)
}
if Xsqlite3ExprIsTableConstant(tls, pWhere, iCursor) != 0 {
nChng++
- *(*U32)(unsafe.Pointer(pSubq + 4 /* &.selFlags */)) |= (U32(SF_PushDown))
+ *(*U32)(unsafe.Pointer(pSubq + 4)) |= U32(SF_PushDown)
for pSubq != 0 {
// var x SubstContext at bp, 20
@@ -117975,13 +119817,13 @@ func pushDownWhereTerms(tls *libc.TLS, pParse uintptr, pSubq uintptr, pWhere uin
(*SubstContext)(unsafe.Pointer(bp /* &x */)).FisLeftJoin = 0
(*SubstContext)(unsafe.Pointer(bp /* &x */)).FpEList = (*Select)(unsafe.Pointer(pSubq)).FpEList
pNew = substExpr(tls, bp /* &x */, pNew)
- if ((*Select)(unsafe.Pointer(pSubq)).FpWin != 0) && (0 == pushDownWindowCheck(tls, pParse, pSubq, pNew)) {
+ if (*Select)(unsafe.Pointer(pSubq)).FpWin != 0 && 0 == pushDownWindowCheck(tls, pParse, pSubq, pNew) {
// Restriction 6c has prevented push-down in this case
Xsqlite3ExprDelete(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, pNew)
nChng--
break
}
- if ((*Select)(unsafe.Pointer(pSubq)).FselFlags & U32(SF_Aggregate)) != 0 {
+ if (*Select)(unsafe.Pointer(pSubq)).FselFlags&U32(SF_Aggregate) != 0 {
(*Select)(unsafe.Pointer(pSubq)).FpHaving = Xsqlite3ExprAnd(tls, pParse, (*Select)(unsafe.Pointer(pSubq)).FpHaving, pNew)
} else {
(*Select)(unsafe.Pointer(pSubq)).FpWhere = Xsqlite3ExprAnd(tls, pParse, (*Select)(unsafe.Pointer(pSubq)).FpWhere, pNew)
@@ -118006,26 +119848,28 @@ func pushDownWhereTerms(tls *libc.TLS, pParse uintptr, pSubq uintptr, pWhere uin
// This routine must be called after aggregate functions have been
// located but before their arguments have been subjected to aggregate
// analysis.
-func minMaxQuery(tls *libc.TLS, db uintptr, pFunc uintptr, ppMinMax uintptr) U8 { /* sqlite3.c:136934:11: */
- var eRet int32 = WHERE_ORDERBY_NORMAL // Return value
- var pEList uintptr = *(*uintptr)(unsafe.Pointer(pFunc + 20 /* &.x */)) // Arguments to agg function
- var zFunc uintptr // Name of aggregate function pFunc
+func minMaxQuery(tls *libc.TLS, db uintptr, pFunc uintptr, ppMinMax uintptr) U8 { /* sqlite3.c:138132:11: */
+ var eRet int32 = WHERE_ORDERBY_NORMAL // Return value
+ var pEList uintptr // Arguments to agg function
+ var zFunc uintptr // Name of aggregate function pFunc
var pOrderBy uintptr
var sortFlags U8 = U8(0)
- if (((pEList == uintptr(0)) ||
- ((*ExprList)(unsafe.Pointer(pEList)).FnExpr != 1)) ||
- (((*Expr)(unsafe.Pointer((pFunc))).Fflags & (U32(EP_WinFunc))) != U32(0))) ||
- (((*Sqlite3)(unsafe.Pointer((db))).FdbOptFlags & (U32(SQLITE_MinMaxOpt))) != U32(0)) {
+ pEList = *(*uintptr)(unsafe.Pointer(pFunc + 20))
+ if pEList == uintptr(0) ||
+ (*ExprList)(unsafe.Pointer(pEList)).FnExpr != 1 ||
+ (*Expr)(unsafe.Pointer(pFunc)).Fflags&U32(EP_WinFunc) != U32(0) ||
+ (*Sqlite3)(unsafe.Pointer(db)).FdbOptFlags&U32(SQLITE_MinMaxOpt) != U32(0) {
return U8(eRet)
}
- zFunc = *(*uintptr)(unsafe.Pointer(pFunc + 8 /* &.u */))
- if Xsqlite3StrICmp(tls, zFunc, ts+13839 /* "min" */) == 0 {
+
+ zFunc = *(*uintptr)(unsafe.Pointer(pFunc + 8))
+ if Xsqlite3StrICmp(tls, zFunc, ts+15021) == 0 {
eRet = WHERE_ORDERBY_MIN
- if Xsqlite3ExprCanBeNull(tls, (*ExprList_item)(unsafe.Pointer((pEList+8 /* &.a */))).FpExpr) != 0 {
+ if Xsqlite3ExprCanBeNull(tls, (*ExprList_item)(unsafe.Pointer(pEList+8)).FpExpr) != 0 {
sortFlags = U8(KEYINFO_ORDER_BIGNULL)
}
- } else if Xsqlite3StrICmp(tls, zFunc, ts+13843 /* "max" */) == 0 {
+ } else if Xsqlite3StrICmp(tls, zFunc, ts+15025) == 0 {
eRet = WHERE_ORDERBY_MAX
sortFlags = U8(KEYINFO_ORDER_DESC)
} else {
@@ -118034,7 +119878,7 @@ func minMaxQuery(tls *libc.TLS, db uintptr, pFunc uintptr, ppMinMax uintptr) U8
*(*uintptr)(unsafe.Pointer(ppMinMax)) = libc.AssignUintptr(&pOrderBy, Xsqlite3ExprListDup(tls, db, pEList, 0))
if pOrderBy != 0 {
- (*ExprList_item)(unsafe.Pointer((pOrderBy + 8 /* &.a */))).FsortFlags = sortFlags
+ (*ExprList_item)(unsafe.Pointer(pOrderBy + 8)).FsortFlags = sortFlags
}
return U8(eRet)
}
@@ -118047,31 +119891,42 @@ func minMaxQuery(tls *libc.TLS, db uintptr, pFunc uintptr, ppMinMax uintptr) U8
//
// where table is a database table, not a sub-select or view. If the query
// does match this pattern, then a pointer to the Table object representing
-// <tbl> is returned. Otherwise, 0 is returned.
-func isSimpleCount(tls *libc.TLS, p uintptr, pAggInfo uintptr) uintptr { /* sqlite3.c:136980:14: */
+// <tbl> is returned. Otherwise, NULL is returned.
+//
+// This routine checks to see if it is safe to use the count optimization.
+// A correct answer is still obtained (though perhaps more slowly) if
+// this routine returns NULL when it could have returned a table pointer.
+// But returning the pointer when NULL should have been returned can
+// result in incorrect answers and/or crashes. So, when in doubt, return NULL.
+func isSimpleCount(tls *libc.TLS, p uintptr, pAggInfo uintptr) uintptr { /* sqlite3.c:138187:14: */
var pTab uintptr
var pExpr uintptr
- if ((((*Select)(unsafe.Pointer(p)).FpWhere != 0) || ((*ExprList)(unsafe.Pointer((*Select)(unsafe.Pointer(p)).FpEList)).FnExpr != 1)) ||
- ((*SrcList)(unsafe.Pointer((*Select)(unsafe.Pointer(p)).FpSrc)).FnSrc != 1)) || ((*SrcItem)(unsafe.Pointer(((*Select)(unsafe.Pointer(p)).FpSrc + 8 /* &.a */))).FpSelect != 0) {
+ if (*Select)(unsafe.Pointer(p)).FpWhere != 0 ||
+ (*ExprList)(unsafe.Pointer((*Select)(unsafe.Pointer(p)).FpEList)).FnExpr != 1 ||
+ (*SrcList)(unsafe.Pointer((*Select)(unsafe.Pointer(p)).FpSrc)).FnSrc != 1 ||
+ (*SrcItem)(unsafe.Pointer((*Select)(unsafe.Pointer(p)).FpSrc+8)).FpSelect != 0 ||
+ (*AggInfo)(unsafe.Pointer(pAggInfo)).FnFunc != 1 {
return uintptr(0)
}
- pTab = (*SrcItem)(unsafe.Pointer(((*Select)(unsafe.Pointer(p)).FpSrc + 8 /* &.a */))).FpTab
- pExpr = (*ExprList_item)(unsafe.Pointer(((*Select)(unsafe.Pointer(p)).FpEList + 8 /* &.a */))).FpExpr
+ pTab = (*SrcItem)(unsafe.Pointer((*Select)(unsafe.Pointer(p)).FpSrc + 8)).FpTab
- if (*Table)(unsafe.Pointer(pTab)).FnModuleArg != 0 {
+ if !(int32((*Table)(unsafe.Pointer(pTab)).FeTabType) == TABTYP_NORM) {
return uintptr(0)
}
+ pExpr = (*ExprList_item)(unsafe.Pointer((*Select)(unsafe.Pointer(p)).FpEList + 8)).FpExpr
+
if int32((*Expr)(unsafe.Pointer(pExpr)).Fop) != TK_AGG_FUNCTION {
return uintptr(0)
}
- if (*AggInfo)(unsafe.Pointer(pAggInfo)).FnFunc == 0 {
+ if (*Expr)(unsafe.Pointer(pExpr)).FpAggInfo != pAggInfo {
return uintptr(0)
}
- if ((*FuncDef)(unsafe.Pointer((*AggInfo_func)(unsafe.Pointer((*AggInfo)(unsafe.Pointer(pAggInfo)).FaFunc)).FpFunc)).FfuncFlags & U32(SQLITE_FUNC_COUNT)) == U32(0) {
+ if (*FuncDef)(unsafe.Pointer((*AggInfo_func)(unsafe.Pointer((*AggInfo)(unsafe.Pointer(pAggInfo)).FaFunc)).FpFunc)).FfuncFlags&U32(SQLITE_FUNC_COUNT) == U32(0) {
return uintptr(0)
}
- if ((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_Distinct | EP_WinFunc))) != U32(0) {
+
+ if (*Expr)(unsafe.Pointer(pExpr)).Fflags&U32(EP_Distinct|EP_WinFunc) != U32(0) {
return uintptr(0)
}
@@ -118083,22 +119938,23 @@ func isSimpleCount(tls *libc.TLS, p uintptr, pAggInfo uintptr) uintptr { /* sqli
// was such a clause and the named index cannot be found, return
// SQLITE_ERROR and leave an error in pParse. Otherwise, populate
// pFrom->pIndex and return SQLITE_OK.
-func Xsqlite3IndexedByLookup(tls *libc.TLS, pParse uintptr, pFrom uintptr) int32 { /* sqlite3.c:137011:20: */
+func Xsqlite3IndexedByLookup(tls *libc.TLS, pParse uintptr, pFrom uintptr) int32 { /* sqlite3.c:138225:20: */
bp := tls.Alloc(16)
defer tls.Free(16)
var pTab uintptr = (*SrcItem)(unsafe.Pointer(pFrom)).FpTab
- var zIndexedBy uintptr = *(*uintptr)(unsafe.Pointer(pFrom + 64 /* &.u1 */))
+ var zIndexedBy uintptr = *(*uintptr)(unsafe.Pointer(pFrom + 64))
var pIdx uintptr
- for pIdx = (*Table)(unsafe.Pointer(pTab)).FpIndex; (pIdx != 0) && (Xsqlite3StrICmp(tls, (*Index)(unsafe.Pointer(pIdx)).FzName, zIndexedBy) != 0); pIdx = (*Index)(unsafe.Pointer(pIdx)).FpNext {
+ for pIdx = (*Table)(unsafe.Pointer(pTab)).FpIndex; pIdx != 0 && Xsqlite3StrICmp(tls, (*Index)(unsafe.Pointer(pIdx)).FzName, zIndexedBy) != 0; pIdx = (*Index)(unsafe.Pointer(pIdx)).FpNext {
}
if !(pIdx != 0) {
- Xsqlite3ErrorMsg(tls, pParse, ts+17514 /* "no such index: %..." */, libc.VaList(bp, zIndexedBy, 0))
+ Xsqlite3ErrorMsg(tls, pParse, ts+18791 /* "no such index: %..." */, libc.VaList(bp, zIndexedBy, 0))
(*Parse)(unsafe.Pointer(pParse)).FcheckSchema = U8(1)
return SQLITE_ERROR
}
- *(*uintptr)(unsafe.Pointer(pFrom + 68 /* &.u2 */)) = pIdx
+
+ *(*uintptr)(unsafe.Pointer(pFrom + 68)) = pIdx
return SQLITE_OK
}
@@ -118121,7 +119977,7 @@ func Xsqlite3IndexedByLookup(tls *libc.TLS, pParse uintptr, pFrom uintptr) int32
// This transformation is only needed for EXCEPT, INTERSECT, and UNION.
// The UNION ALL operator works fine with multiSelectOrderBy() even when
// there are COLLATE terms in the ORDER BY.
-func convertCompoundSelectToSubquery(tls *libc.TLS, pWalker uintptr, p uintptr) int32 { /* sqlite3.c:137052:12: */
+func convertCompoundSelectToSubquery(tls *libc.TLS, pWalker uintptr, p uintptr) int32 { /* sqlite3.c:138267:12: */
bp := tls.Alloc(8)
defer tls.Free(8)
@@ -118140,7 +119996,7 @@ func convertCompoundSelectToSubquery(tls *libc.TLS, pWalker uintptr, p uintptr)
if (*Select)(unsafe.Pointer(p)).FpOrderBy == uintptr(0) {
return WRC_Continue
}
- for pX = p; (pX != 0) && ((int32((*Select)(unsafe.Pointer(pX)).Fop) == TK_ALL) || (int32((*Select)(unsafe.Pointer(pX)).Fop) == TK_SELECT)); pX = (*Select)(unsafe.Pointer(pX)).FpPrior {
+ for pX = p; pX != 0 && (int32((*Select)(unsafe.Pointer(pX)).Fop) == TK_ALL || int32((*Select)(unsafe.Pointer(pX)).Fop) == TK_SELECT); pX = (*Select)(unsafe.Pointer(pX)).FpPrior {
}
if pX == uintptr(0) {
return WRC_Continue
@@ -118151,11 +120007,11 @@ func convertCompoundSelectToSubquery(tls *libc.TLS, pWalker uintptr, p uintptr)
// SELECT is rewritten for window-functions processing and then passed
// to sqlite3SelectPrep() and similar a second time. The rewriting done
// by this function is not required in this case.
- if *(*U16)(unsafe.Pointer(a + 16 /* &.u */ /* &.x */ /* &.iOrderByCol */)) != 0 {
+ if *(*U16)(unsafe.Pointer(a + 16)) != 0 {
return WRC_Continue
}
- for i = ((*ExprList)(unsafe.Pointer((*Select)(unsafe.Pointer(p)).FpOrderBy)).FnExpr - 1); i >= 0; i-- {
- if ((*Expr)(unsafe.Pointer((*ExprList_item)(unsafe.Pointer(a+uintptr(i)*20)).FpExpr)).Fflags & U32(EP_Collate)) != 0 {
+ for i = (*ExprList)(unsafe.Pointer((*Select)(unsafe.Pointer(p)).FpOrderBy)).FnExpr - 1; i >= 0; i-- {
+ if (*Expr)(unsafe.Pointer((*ExprList_item)(unsafe.Pointer(a+uintptr(i)*20)).FpExpr)).Fflags&U32(EP_Collate) != 0 {
break
}
}
@@ -118188,9 +120044,9 @@ func convertCompoundSelectToSubquery(tls *libc.TLS, pWalker uintptr, p uintptr)
(*Select)(unsafe.Pointer(p)).FpNext = uintptr(0)
(*Select)(unsafe.Pointer(p)).FpWith = uintptr(0)
(*Select)(unsafe.Pointer(p)).FpWinDefn = uintptr(0)
- *(*U32)(unsafe.Pointer(p + 4 /* &.selFlags */)) &= (libc.Uint32FromInt32(libc.CplInt32(SF_Compound)))
+ *(*U32)(unsafe.Pointer(p + 4)) &= libc.Uint32FromInt32(libc.CplInt32(SF_Compound))
- *(*U32)(unsafe.Pointer(p + 4 /* &.selFlags */)) |= (U32(SF_Converted))
+ *(*U32)(unsafe.Pointer(p + 4)) |= U32(SF_Converted)
(*Select)(unsafe.Pointer((*Select)(unsafe.Pointer(pNew)).FpPrior)).FpNext = pNew
(*Select)(unsafe.Pointer(pNew)).FpLimit = uintptr(0)
@@ -118200,12 +120056,12 @@ func convertCompoundSelectToSubquery(tls *libc.TLS, pWalker uintptr, p uintptr)
// Check to see if the FROM clause term pFrom has table-valued function
// arguments. If it does, leave an error message in pParse and return
// non-zero, since pFrom is not allowed to be a table-valued function.
-func cannotBeFunction(tls *libc.TLS, pParse uintptr, pFrom uintptr) int32 { /* sqlite3.c:137117:12: */
+func cannotBeFunction(tls *libc.TLS, pParse uintptr, pFrom uintptr) int32 { /* sqlite3.c:138332:12: */
bp := tls.Alloc(8)
defer tls.Free(8)
- if (uint32(int32(*(*uint16)(unsafe.Pointer(pFrom + 36 /* &.fg */ + 4 /* &.isTabFunc */)) & 0x4 >> 2))) != 0 {
- Xsqlite3ErrorMsg(tls, pParse, ts+17532 /* "'%s' is not a fu..." */, libc.VaList(bp, (*SrcItem)(unsafe.Pointer(pFrom)).FzName))
+ if uint32(int32(*(*uint16)(unsafe.Pointer(pFrom + 36 + 4))&0x4>>2)) != 0 {
+ Xsqlite3ErrorMsg(tls, pParse, ts+18809 /* "'%s' is not a fu..." */, libc.VaList(bp, (*SrcItem)(unsafe.Pointer(pFrom)).FzName))
return 1
}
return 0
@@ -118219,16 +120075,16 @@ func cannotBeFunction(tls *libc.TLS, pParse uintptr, pFrom uintptr) int32 { /* s
//
// If a non-NULL value is returned, set *ppContext to point to the With
// object that the returned CTE belongs to.
-func searchWith(tls *libc.TLS, pWith uintptr, pItem uintptr, ppContext uintptr) uintptr { /* sqlite3.c:137136:19: */
+func searchWith(tls *libc.TLS, pWith uintptr, pItem uintptr, ppContext uintptr) uintptr { /* sqlite3.c:138351:19: */
var zName uintptr = (*SrcItem)(unsafe.Pointer(pItem)).FzName
var p uintptr
for p = pWith; p != 0; p = (*With)(unsafe.Pointer(p)).FpOuter {
var i int32
for i = 0; i < (*With)(unsafe.Pointer(p)).FnCte; i++ {
- if Xsqlite3StrICmp(tls, zName, (*Cte)(unsafe.Pointer((p+12 /* &.a */)+uintptr(i)*24)).FzName) == 0 {
+ if Xsqlite3StrICmp(tls, zName, (*Cte)(unsafe.Pointer(p+12+uintptr(i)*24)).FzName) == 0 {
*(*uintptr)(unsafe.Pointer(ppContext)) = p
- return ((p + 12 /* &.a */) + uintptr(i)*24)
+ return p + 12 + uintptr(i)*24
}
}
if (*With)(unsafe.Pointer(p)).FbView != 0 {
@@ -118254,7 +120110,7 @@ func searchWith(tls *libc.TLS, pWith uintptr, pItem uintptr, ppContext uintptr)
//
// If bFree is true, do not continue to use the pWith pointer after
// calling this routine, Instead, use only the return value.
-func Xsqlite3WithPush(tls *libc.TLS, pParse uintptr, pWith uintptr, bFree U8) uintptr { /* sqlite3.c:137175:21: */
+func Xsqlite3WithPush(tls *libc.TLS, pParse uintptr, pWith uintptr, bFree U8) uintptr { /* sqlite3.c:138390:21: */
if pWith != 0 {
if bFree != 0 {
pWith = Xsqlite3ParserAddCleanup(tls, pParse,
@@ -118287,12 +120143,12 @@ func Xsqlite3WithPush(tls *libc.TLS, pParse uintptr, pWith uintptr, bFree U8) ui
// Return 0 if no match is found.
// Return 1 if a match is found.
// Return 2 if an error condition is detected.
-func resolveFromTermToCte(tls *libc.TLS, pParse uintptr, pWalker uintptr, pFrom uintptr) int32 { /* sqlite3.c:137206:12: */
- bp := tls.Alloc(44)
- defer tls.Free(44)
+func resolveFromTermToCte(tls *libc.TLS, pParse uintptr, pWalker uintptr, pFrom uintptr) int32 { /* sqlite3.c:138421:12: */
+ bp := tls.Alloc(52)
+ defer tls.Free(52)
var pCte uintptr // Matched CTE (or NULL if no match)
- // var pWith uintptr at bp+40, 4
+ // var pWith uintptr at bp+48, 4
// The matching WITH
if (*Parse)(unsafe.Pointer(pParse)).FpWith == uintptr(0) {
@@ -118309,14 +120165,14 @@ func resolveFromTermToCte(tls *libc.TLS, pParse uintptr, pWalker uintptr, pFrom
// it cannot possibly be a CTE reference.
return 0
}
- if (uint32(int32(*(*uint16)(unsafe.Pointer(pFrom + 36 /* &.fg */ + 4 /* &.notCte */)) & 0x100 >> 8))) != 0 {
+ if uint32(int32(*(*uint16)(unsafe.Pointer(pFrom + 36 + 4))&0x100>>8)) != 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().
// (2) This is the first term in the FROM clause of an UPDATE.
return 0
}
- pCte = searchWith(tls, (*Parse)(unsafe.Pointer(pParse)).FpWith, pFrom, bp+40 /* &pWith */)
+ pCte = searchWith(tls, (*Parse)(unsafe.Pointer(pParse)).FpWith, pFrom, bp+48 /* &pWith */)
if pCte != 0 {
var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb
var pTab uintptr
@@ -118348,10 +120204,10 @@ func resolveFromTermToCte(tls *libc.TLS, pParse uintptr, pWalker uintptr, pFrom
pCteUse = (*Cte)(unsafe.Pointer(pCte)).FpUse
if pCteUse == uintptr(0) {
(*Cte)(unsafe.Pointer(pCte)).FpUse = libc.AssignUintptr(&pCteUse, Xsqlite3DbMallocZero(tls, db, uint64(unsafe.Sizeof(CteUse{}))))
- if (pCteUse == uintptr(0)) ||
- (Xsqlite3ParserAddCleanup(tls, pParse, *(*uintptr)(unsafe.Pointer(&struct {
+ if pCteUse == uintptr(0) ||
+ Xsqlite3ParserAddCleanup(tls, pParse, *(*uintptr)(unsafe.Pointer(&struct {
f func(*libc.TLS, uintptr, uintptr)
- }{Xsqlite3DbFree})), pCteUse) == uintptr(0)) {
+ }{Xsqlite3DbFree})), pCteUse) == uintptr(0) {
Xsqlite3DbFree(tls, db, pTab)
return 2
}
@@ -118362,57 +120218,61 @@ func resolveFromTermToCte(tls *libc.TLS, pParse uintptr, pWalker uintptr, pFrom
(*Table)(unsafe.Pointer(pTab)).FzName = Xsqlite3DbStrDup(tls, db, (*Cte)(unsafe.Pointer(pCte)).FzName)
(*Table)(unsafe.Pointer(pTab)).FiPKey = int16(-1)
(*Table)(unsafe.Pointer(pTab)).FnRowLogEst = int16(200)
- *(*U32)(unsafe.Pointer(pTab + 36 /* &.tabFlags */)) |= (U32(TF_Ephemeral | TF_NoVisibleRowid))
+ *(*U32)(unsafe.Pointer(pTab + 28)) |= U32(TF_Ephemeral | TF_NoVisibleRowid)
(*SrcItem)(unsafe.Pointer(pFrom)).FpSelect = Xsqlite3SelectDup(tls, db, (*Cte)(unsafe.Pointer(pCte)).FpSelect, 0)
if (*Sqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 {
return 2
}
- *(*U32)(unsafe.Pointer((*SrcItem)(unsafe.Pointer(pFrom)).FpSelect + 4 /* &.selFlags */)) |= (U32(SF_CopyCte))
+ *(*U32)(unsafe.Pointer((*SrcItem)(unsafe.Pointer(pFrom)).FpSelect + 4)) |= U32(SF_CopyCte)
- libc.SetBitFieldPtr16Uint32(pFrom+36 /* &.fg */ +4 /* &.isCte */, uint32(1), 7, 0x80)
- *(*uintptr)(unsafe.Pointer(pFrom + 68 /* &.u2 */)) = pCteUse
+ if uint32(int32(*(*uint16)(unsafe.Pointer(pFrom + 36 + 4))&0x2>>1)) != 0 {
+ Xsqlite3ErrorMsg(tls, pParse, ts+18832 /* "no such index: \"..." */, libc.VaList(bp+8, *(*uintptr)(unsafe.Pointer(pFrom + 64))))
+ return 2
+ }
+ libc.SetBitFieldPtr16Uint32(pFrom+36+4, uint32(1), 7, 0x80)
+ *(*uintptr)(unsafe.Pointer(pFrom + 68)) = pCteUse
(*CteUse)(unsafe.Pointer(pCteUse)).FnUse++
- if ((*CteUse)(unsafe.Pointer(pCteUse)).FnUse >= 2) && (int32((*CteUse)(unsafe.Pointer(pCteUse)).FeM10d) == M10d_Any) {
+ if (*CteUse)(unsafe.Pointer(pCteUse)).FnUse >= 2 && int32((*CteUse)(unsafe.Pointer(pCteUse)).FeM10d) == M10d_Any {
(*CteUse)(unsafe.Pointer(pCteUse)).FeM10d = U8(M10d_Yes)
}
// Check if this is a recursive CTE.
pRecTerm = libc.AssignUintptr(&pSel, (*SrcItem)(unsafe.Pointer(pFrom)).FpSelect)
- bMayRecursive = (libc.Bool32((int32((*Select)(unsafe.Pointer(pSel)).Fop) == TK_ALL) || (int32((*Select)(unsafe.Pointer(pSel)).Fop) == TK_UNION)))
- for (bMayRecursive != 0) && (int32((*Select)(unsafe.Pointer(pRecTerm)).Fop) == int32((*Select)(unsafe.Pointer(pSel)).Fop)) {
+ bMayRecursive = libc.Bool32(int32((*Select)(unsafe.Pointer(pSel)).Fop) == TK_ALL || int32((*Select)(unsafe.Pointer(pSel)).Fop) == TK_UNION)
+ for bMayRecursive != 0 && int32((*Select)(unsafe.Pointer(pRecTerm)).Fop) == int32((*Select)(unsafe.Pointer(pSel)).Fop) {
var i int32
var pSrc uintptr = (*Select)(unsafe.Pointer(pRecTerm)).FpSrc
for i = 0; i < (*SrcList)(unsafe.Pointer(pSrc)).FnSrc; i++ {
- var pItem uintptr = ((pSrc + 8 /* &.a */) + uintptr(i)*72)
- if (((*SrcItem)(unsafe.Pointer(pItem)).FzDatabase == uintptr(0)) &&
- ((*SrcItem)(unsafe.Pointer(pItem)).FzName != uintptr(0))) &&
- (0 == Xsqlite3StrICmp(tls, (*SrcItem)(unsafe.Pointer(pItem)).FzName, (*Cte)(unsafe.Pointer(pCte)).FzName)) {
+ var pItem uintptr = pSrc + 8 + uintptr(i)*72
+ if (*SrcItem)(unsafe.Pointer(pItem)).FzDatabase == uintptr(0) &&
+ (*SrcItem)(unsafe.Pointer(pItem)).FzName != uintptr(0) &&
+ 0 == Xsqlite3StrICmp(tls, (*SrcItem)(unsafe.Pointer(pItem)).FzName, (*Cte)(unsafe.Pointer(pCte)).FzName) {
(*SrcItem)(unsafe.Pointer(pItem)).FpTab = pTab
(*Table)(unsafe.Pointer(pTab)).FnTabRef++
- libc.SetBitFieldPtr16Uint32(pItem+36 /* &.fg */ +4 /* &.isRecursive */, uint32(1), 5, 0x20)
- if ((*Select)(unsafe.Pointer(pRecTerm)).FselFlags & U32(SF_Recursive)) != 0 {
+ libc.SetBitFieldPtr16Uint32(pItem+36+4, uint32(1), 5, 0x20)
+ if (*Select)(unsafe.Pointer(pRecTerm)).FselFlags&U32(SF_Recursive) != 0 {
Xsqlite3ErrorMsg(tls, pParse,
- ts+17555 /* "multiple referen..." */, libc.VaList(bp+8, (*Cte)(unsafe.Pointer(pCte)).FzName))
+ ts+18852 /* "multiple referen..." */, libc.VaList(bp+16, (*Cte)(unsafe.Pointer(pCte)).FzName))
return 2
}
- *(*U32)(unsafe.Pointer(pRecTerm + 4 /* &.selFlags */)) |= (U32(SF_Recursive))
+ *(*U32)(unsafe.Pointer(pRecTerm + 4)) |= U32(SF_Recursive)
if iRecTab < 0 {
iRecTab = libc.PostIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnTab, 1)
}
(*SrcItem)(unsafe.Pointer(pItem)).FiCursor = iRecTab
}
}
- if ((*Select)(unsafe.Pointer(pRecTerm)).FselFlags & U32(SF_Recursive)) == U32(0) {
+ if (*Select)(unsafe.Pointer(pRecTerm)).FselFlags&U32(SF_Recursive) == U32(0) {
break
}
pRecTerm = (*Select)(unsafe.Pointer(pRecTerm)).FpPrior
}
- (*Cte)(unsafe.Pointer(pCte)).FzCteErr = ts + 17598 /* "circular referen..." */
+ (*Cte)(unsafe.Pointer(pCte)).FzCteErr = ts + 18895 /* "circular referen..." */
pSavedWith = (*Parse)(unsafe.Pointer(pParse)).FpWith
- (*Parse)(unsafe.Pointer(pParse)).FpWith = *(*uintptr)(unsafe.Pointer(bp + 40 /* pWith */))
- if ((*Select)(unsafe.Pointer(pSel)).FselFlags & U32(SF_Recursive)) != 0 {
+ (*Parse)(unsafe.Pointer(pParse)).FpWith = *(*uintptr)(unsafe.Pointer(bp + 48 /* pWith */))
+ if (*Select)(unsafe.Pointer(pSel)).FselFlags&U32(SF_Recursive) != 0 {
var rc int32
(*Select)(unsafe.Pointer(pRecTerm)).FpWith = (*Select)(unsafe.Pointer(pSel)).FpWith
@@ -118428,27 +120288,27 @@ func resolveFromTermToCte(tls *libc.TLS, pParse uintptr, pWalker uintptr, pFrom
return 2
}
}
- (*Parse)(unsafe.Pointer(pParse)).FpWith = *(*uintptr)(unsafe.Pointer(bp + 40 /* pWith */))
+ (*Parse)(unsafe.Pointer(pParse)).FpWith = *(*uintptr)(unsafe.Pointer(bp + 48 /* pWith */))
for pLeft = pSel; (*Select)(unsafe.Pointer(pLeft)).FpPrior != 0; pLeft = (*Select)(unsafe.Pointer(pLeft)).FpPrior {
}
pEList = (*Select)(unsafe.Pointer(pLeft)).FpEList
if (*Cte)(unsafe.Pointer(pCte)).FpCols != 0 {
- if (pEList != 0) && ((*ExprList)(unsafe.Pointer(pEList)).FnExpr != (*ExprList)(unsafe.Pointer((*Cte)(unsafe.Pointer(pCte)).FpCols)).FnExpr) {
- Xsqlite3ErrorMsg(tls, pParse, ts+17621, /* "table %s has %d ..." */
- libc.VaList(bp+16, (*Cte)(unsafe.Pointer(pCte)).FzName, (*ExprList)(unsafe.Pointer(pEList)).FnExpr, (*ExprList)(unsafe.Pointer((*Cte)(unsafe.Pointer(pCte)).FpCols)).FnExpr))
+ if pEList != 0 && (*ExprList)(unsafe.Pointer(pEList)).FnExpr != (*ExprList)(unsafe.Pointer((*Cte)(unsafe.Pointer(pCte)).FpCols)).FnExpr {
+ Xsqlite3ErrorMsg(tls, pParse, ts+18918, /* "table %s has %d ..." */
+ libc.VaList(bp+24, (*Cte)(unsafe.Pointer(pCte)).FzName, (*ExprList)(unsafe.Pointer(pEList)).FnExpr, (*ExprList)(unsafe.Pointer((*Cte)(unsafe.Pointer(pCte)).FpCols)).FnExpr))
(*Parse)(unsafe.Pointer(pParse)).FpWith = pSavedWith
return 2
}
pEList = (*Cte)(unsafe.Pointer(pCte)).FpCols
}
- Xsqlite3ColumnsFromExprList(tls, pParse, pEList, (pTab + 42 /* &.nCol */), (pTab + 4 /* &.aCol */))
+ Xsqlite3ColumnsFromExprList(tls, pParse, pEList, pTab+34, pTab+4)
if bMayRecursive != 0 {
- if ((*Select)(unsafe.Pointer(pSel)).FselFlags & U32(SF_Recursive)) != 0 {
- (*Cte)(unsafe.Pointer(pCte)).FzCteErr = ts + 17659 /* "multiple recursi..." */
+ if (*Select)(unsafe.Pointer(pSel)).FselFlags&U32(SF_Recursive) != 0 {
+ (*Cte)(unsafe.Pointer(pCte)).FzCteErr = ts + 18956 /* "multiple recursi..." */
} else {
- (*Cte)(unsafe.Pointer(pCte)).FzCteErr = ts + 17693 /* "recursive refere..." */
+ (*Cte)(unsafe.Pointer(pCte)).FzCteErr = ts + 18990 /* "recursive refere..." */
}
Xsqlite3WalkSelect(tls, pWalker, pSel)
}
@@ -118465,9 +120325,9 @@ func resolveFromTermToCte(tls *libc.TLS, pParse uintptr, pWalker uintptr, pFrom
// This function is used as the xSelectCallback2() callback by
// sqlite3SelectExpand() when walking a SELECT tree to resolve table
// names and other FROM clause elements.
-func Xsqlite3SelectPopWith(tls *libc.TLS, pWalker uintptr, p uintptr) { /* sqlite3.c:137386:21: */
+func Xsqlite3SelectPopWith(tls *libc.TLS, pWalker uintptr, p uintptr) { /* sqlite3.c:138605:21: */
var pParse uintptr = (*Walker)(unsafe.Pointer(pWalker)).FpParse
- if ((*Parse)(unsafe.Pointer(pParse)).FpWith != 0) && ((*Select)(unsafe.Pointer(p)).FpPrior == uintptr(0)) {
+ if (*Parse)(unsafe.Pointer(pParse)).FpWith != 0 && (*Select)(unsafe.Pointer(p)).FpPrior == uintptr(0) {
var pWith uintptr = (*Select)(unsafe.Pointer(findRightmost(tls, p))).FpWith
if pWith != uintptr(0) {
@@ -118481,7 +120341,7 @@ func Xsqlite3SelectPopWith(tls *libc.TLS, pWalker uintptr, p uintptr) { /* sqlit
// allocates and populates the SrcList_item.pTab object. If successful,
// SQLITE_OK is returned. Otherwise, if an OOM error is encountered,
// SQLITE_NOMEM.
-func Xsqlite3ExpandSubquery(tls *libc.TLS, pParse uintptr, pFrom uintptr) int32 { /* sqlite3.c:137405:20: */
+func Xsqlite3ExpandSubquery(tls *libc.TLS, pParse uintptr, pFrom uintptr) int32 { /* sqlite3.c:138624:20: */
bp := tls.Alloc(8)
defer tls.Free(8)
@@ -118496,16 +120356,16 @@ func Xsqlite3ExpandSubquery(tls *libc.TLS, pParse uintptr, pFrom uintptr) int32
if (*SrcItem)(unsafe.Pointer(pFrom)).FzAlias != 0 {
(*Table)(unsafe.Pointer(pTab)).FzName = Xsqlite3DbStrDup(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, (*SrcItem)(unsafe.Pointer(pFrom)).FzAlias)
} else {
- (*Table)(unsafe.Pointer(pTab)).FzName = Xsqlite3MPrintf(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, ts+17731 /* "subquery_%u" */, libc.VaList(bp, (*Select)(unsafe.Pointer(pSel)).FselId))
+ (*Table)(unsafe.Pointer(pTab)).FzName = Xsqlite3MPrintf(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, ts+19028 /* "subquery_%u" */, libc.VaList(bp, (*Select)(unsafe.Pointer(pSel)).FselId))
}
for (*Select)(unsafe.Pointer(pSel)).FpPrior != 0 {
pSel = (*Select)(unsafe.Pointer(pSel)).FpPrior
}
- Xsqlite3ColumnsFromExprList(tls, pParse, (*Select)(unsafe.Pointer(pSel)).FpEList, (pTab + 42 /* &.nCol */), (pTab + 4 /* &.aCol */))
+ Xsqlite3ColumnsFromExprList(tls, pParse, (*Select)(unsafe.Pointer(pSel)).FpEList, pTab+34, pTab+4)
(*Table)(unsafe.Pointer(pTab)).FiPKey = int16(-1)
(*Table)(unsafe.Pointer(pTab)).FnRowLogEst = int16(200)
// The usual case - do not allow ROWID on a subquery
- *(*U32)(unsafe.Pointer(pTab + 36 /* &.tabFlags */)) |= (U32(TF_Ephemeral | TF_NoVisibleRowid))
+ *(*U32)(unsafe.Pointer(pTab + 28)) |= U32(TF_Ephemeral | TF_NoVisibleRowid)
if (*Parse)(unsafe.Pointer(pParse)).FnErr != 0 {
return SQLITE_ERROR
@@ -118535,7 +120395,7 @@ func Xsqlite3ExpandSubquery(tls *libc.TLS, pParse uintptr, pFrom uintptr) int32
// If found, expand each "*" to be every column in every table
// and TABLE.* to be every column in TABLE.
//
-func selectExpander(tls *libc.TLS, pWalker uintptr, p uintptr) int32 { /* sqlite3.c:137457:12: */
+func selectExpander(tls *libc.TLS, pWalker uintptr, p uintptr) int32 { /* sqlite3.c:138676:12: */
bp := tls.Alloc(80)
defer tls.Free(80)
@@ -118554,12 +120414,12 @@ func selectExpander(tls *libc.TLS, pWalker uintptr, p uintptr) int32 { /* sqlite
var selFlags U16 = U16((*Select)(unsafe.Pointer(p)).FselFlags)
var elistFlags U32 = U32(0)
- *(*U32)(unsafe.Pointer(p + 4 /* &.selFlags */)) |= (U32(SF_Expanded))
+ *(*U32)(unsafe.Pointer(p + 4)) |= U32(SF_Expanded)
if (*Sqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 {
return WRC_Abort
}
- if (int32(selFlags) & SF_Expanded) != 0 {
+ if int32(selFlags)&SF_Expanded != 0 {
return WRC_Prune
}
if (*Walker)(unsafe.Pointer(pWalker)).FeCode != 0 {
@@ -118568,7 +120428,7 @@ func selectExpander(tls *libc.TLS, pWalker uintptr, p uintptr) int32 { /* sqlite
}
pTabList = (*Select)(unsafe.Pointer(p)).FpSrc
pEList = (*Select)(unsafe.Pointer(p)).FpEList
- if ((*Parse)(unsafe.Pointer(pParse)).FpWith != 0) && (((*Select)(unsafe.Pointer(p)).FselFlags & U32(SF_View)) != 0) {
+ if (*Parse)(unsafe.Pointer(pParse)).FpWith != 0 && (*Select)(unsafe.Pointer(p)).FselFlags&U32(SF_View) != 0 {
if (*Select)(unsafe.Pointer(p)).FpWith == uintptr(0) {
(*Select)(unsafe.Pointer(p)).FpWith = Xsqlite3DbMallocZero(tls, db, uint64(unsafe.Sizeof(With{})))
if (*Select)(unsafe.Pointer(p)).FpWith == uintptr(0) {
@@ -118609,7 +120469,7 @@ __1:
if Xsqlite3ExpandSubquery(tls, pParse, pFrom) != 0 {
return WRC_Abort
}
- } else if (libc.AssignInt32(&rc, resolveFromTermToCte(tls, pParse, pWalker, pFrom))) != 0 {
+ } else if libc.AssignInt32(&rc, resolveFromTermToCte(tls, pParse, pWalker, pFrom)) != 0 {
if rc > 1 {
return WRC_Abort
}
@@ -118623,37 +120483,37 @@ __1:
return WRC_Abort
}
if (*Table)(unsafe.Pointer(pTab)).FnTabRef >= U32(0xffff) {
- Xsqlite3ErrorMsg(tls, pParse, ts+17743, /* "too many referen..." */
+ Xsqlite3ErrorMsg(tls, pParse, ts+19040, /* "too many referen..." */
libc.VaList(bp, (*Table)(unsafe.Pointer(pTab)).FzName))
(*SrcItem)(unsafe.Pointer(pFrom)).FpTab = uintptr(0)
return WRC_Abort
}
(*Table)(unsafe.Pointer(pTab)).FnTabRef++
- if !((*Table)(unsafe.Pointer(pTab)).FnModuleArg != 0) && (cannotBeFunction(tls, pParse, pFrom) != 0) {
+ if !(int32((*Table)(unsafe.Pointer(pTab)).FeTabType) == TABTYP_VTAB) && cannotBeFunction(tls, pParse, pFrom) != 0 {
return WRC_Abort
}
- if ((*Table)(unsafe.Pointer(pTab)).FnModuleArg != 0) || ((*Table)(unsafe.Pointer(pTab)).FpSelect != 0) {
+ if !(int32((*Table)(unsafe.Pointer(pTab)).FeTabType) == TABTYP_NORM) {
var nCol I16
var eCodeOrig U8 = U8((*Walker)(unsafe.Pointer(pWalker)).FeCode)
if Xsqlite3ViewGetColumnNames(tls, pParse, pTab) != 0 {
return WRC_Abort
}
- if (((*Table)(unsafe.Pointer(pTab)).FpSelect != 0) &&
- (((*Sqlite3)(unsafe.Pointer(db)).Fflags & uint64(SQLITE_EnableView)) == uint64(0))) &&
- ((*Table)(unsafe.Pointer(pTab)).FpSchema != (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+1*16)).FpSchema) {
- Xsqlite3ErrorMsg(tls, pParse, ts+17782, /* "access to view \"..." */
- libc.VaList(bp+8, (*Table)(unsafe.Pointer(pTab)).FzName))
- }
-
- if ((((*Table)(unsafe.Pointer(pTab)).FnModuleArg != 0) &&
- ((uint32(int32(*(*uint16)(unsafe.Pointer((pFrom + 36 /* &.fg */) + 4 /* &.fromDDL */)) & 0x40 >> 6))) != 0)) &&
- ((*Table)(unsafe.Pointer(pTab)).FpVTable != uintptr(0))) &&
- (int32((*VTable)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FpVTable)).FeVtabRisk) > (libc.Bool32(((*Sqlite3)(unsafe.Pointer(db)).Fflags & uint64(SQLITE_TrustedSchema)) != uint64(0)))) {
- Xsqlite3ErrorMsg(tls, pParse, ts+17813, /* "unsafe use of vi..." */
+ if int32((*Table)(unsafe.Pointer(pTab)).FeTabType) == TABTYP_VIEW {
+ if (*Sqlite3)(unsafe.Pointer(db)).Fflags&uint64(SQLITE_EnableView) == uint64(0) &&
+ (*Table)(unsafe.Pointer(pTab)).FpSchema != (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+1*16)).FpSchema {
+ Xsqlite3ErrorMsg(tls, pParse, ts+19079, /* "access to view \"..." */
+ libc.VaList(bp+8, (*Table)(unsafe.Pointer(pTab)).FzName))
+ }
+ (*SrcItem)(unsafe.Pointer(pFrom)).FpSelect = Xsqlite3SelectDup(tls, db, *(*uintptr)(unsafe.Pointer(pTab + 44)), 0)
+ } else if int32((*Table)(unsafe.Pointer(pTab)).FeTabType) == TABTYP_VTAB &&
+ uint32(int32(*(*uint16)(unsafe.Pointer(pFrom + 36 + 4))&0x40>>6)) != 0 &&
+ *(*uintptr)(unsafe.Pointer(pTab + 44 + 8)) != uintptr(0) &&
+ int32((*VTable)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pTab + 44 + 8)))).FeVtabRisk) > libc.Bool32((*Sqlite3)(unsafe.Pointer(db)).Fflags&uint64(SQLITE_TrustedSchema) != uint64(0)) {
+ Xsqlite3ErrorMsg(tls, pParse, ts+19110, /* "unsafe use of vi..." */
libc.VaList(bp+16, (*Table)(unsafe.Pointer(pTab)).FzName))
}
- (*SrcItem)(unsafe.Pointer(pFrom)).FpSelect = Xsqlite3SelectDup(tls, db, (*Table)(unsafe.Pointer(pTab)).FpSelect, 0)
+
nCol = (*Table)(unsafe.Pointer(pTab)).FnCol
(*Table)(unsafe.Pointer(pTab)).FnCol = int16(-1)
(*Walker)(unsafe.Pointer(pWalker)).FeCode = U16(1) // Turn on Select.selId renumbering
@@ -118664,7 +120524,7 @@ __1:
}
// Locate the index named by the INDEXED BY clause, if any.
- if ((uint32(int32(*(*uint16)(unsafe.Pointer((pFrom + 36 /* &.fg */) + 4 /* &.isIndexedBy */)) & 0x2 >> 1))) != 0) && (Xsqlite3IndexedByLookup(tls, pParse, pFrom) != 0) {
+ if uint32(int32(*(*uint16)(unsafe.Pointer(pFrom + 36 + 4))&0x2>>1)) != 0 && Xsqlite3IndexedByLookup(tls, pParse, pFrom) != 0 {
return WRC_Abort
}
@@ -118679,7 +120539,7 @@ __3:
;
// Process NATURAL keywords, and ON and USING clauses of joins.
- if (((*Parse)(unsafe.Pointer(pParse)).FnErr != 0) || ((*Sqlite3)(unsafe.Pointer(db)).FmallocFailed != 0)) || (sqliteProcessJoin(tls, pParse, p) != 0) {
+ if (*Parse)(unsafe.Pointer(pParse)).FnErr != 0 || (*Sqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 || sqliteProcessJoin(tls, pParse, p) != 0 {
return WRC_Abort
}
@@ -118694,15 +120554,15 @@ __3:
// The first loop just checks to see if there are any "*" operators
// that need expanding.
for k = 0; k < (*ExprList)(unsafe.Pointer(pEList)).FnExpr; k++ {
- pE = (*ExprList_item)(unsafe.Pointer((pEList + 8 /* &.a */) + uintptr(k)*20)).FpExpr
+ pE = (*ExprList_item)(unsafe.Pointer(pEList + 8 + uintptr(k)*20)).FpExpr
if int32((*Expr)(unsafe.Pointer(pE)).Fop) == TK_ASTERISK {
break
}
- if (int32((*Expr)(unsafe.Pointer(pE)).Fop) == TK_DOT) && (int32((*Expr)(unsafe.Pointer((*Expr)(unsafe.Pointer(pE)).FpRight)).Fop) == TK_ASTERISK) {
+ if int32((*Expr)(unsafe.Pointer(pE)).Fop) == TK_DOT && int32((*Expr)(unsafe.Pointer((*Expr)(unsafe.Pointer(pE)).FpRight)).Fop) == TK_ASTERISK {
break
}
- elistFlags = elistFlags | ((*Expr)(unsafe.Pointer(pE)).Fflags)
+ elistFlags = elistFlags | (*Expr)(unsafe.Pointer(pE)).Fflags
}
if k < (*ExprList)(unsafe.Pointer(pEList)).FnExpr {
// If we get here it means the result set contains one or more "*"
@@ -118711,21 +120571,21 @@ __3:
var a uintptr = pEList + 8 /* &.a */
var pNew uintptr = uintptr(0)
var flags int32 = int32((*Sqlite3)(unsafe.Pointer((*Parse)(unsafe.Pointer(pParse)).Fdb)).Fflags)
- var longNames int32 = (libc.Bool32(((flags & SQLITE_FullColNames) != 0) &&
- ((flags & SQLITE_ShortColNames) == 0)))
+ var longNames int32 = libc.Bool32(flags&SQLITE_FullColNames != 0 &&
+ flags&SQLITE_ShortColNames == 0)
for k = 0; k < (*ExprList)(unsafe.Pointer(pEList)).FnExpr; k++ {
pE = (*ExprList_item)(unsafe.Pointer(a + uintptr(k)*20)).FpExpr
- elistFlags = elistFlags | ((*Expr)(unsafe.Pointer(pE)).Fflags)
+ elistFlags = elistFlags | (*Expr)(unsafe.Pointer(pE)).Fflags
pRight = (*Expr)(unsafe.Pointer(pE)).FpRight
- if (int32((*Expr)(unsafe.Pointer(pE)).Fop) != TK_ASTERISK) &&
- ((int32((*Expr)(unsafe.Pointer(pE)).Fop) != TK_DOT) || (int32((*Expr)(unsafe.Pointer(pRight)).Fop) != TK_ASTERISK)) {
+ if int32((*Expr)(unsafe.Pointer(pE)).Fop) != TK_ASTERISK &&
+ (int32((*Expr)(unsafe.Pointer(pE)).Fop) != TK_DOT || int32((*Expr)(unsafe.Pointer(pRight)).Fop) != TK_ASTERISK) {
// This particular expression does not need to be expanded.
pNew = Xsqlite3ExprListAppend(tls, pParse, pNew, (*ExprList_item)(unsafe.Pointer(a+uintptr(k)*20)).FpExpr)
if pNew != 0 {
- (*ExprList_item)(unsafe.Pointer((pNew + 8 /* &.a */) + uintptr(((*ExprList)(unsafe.Pointer(pNew)).FnExpr-1))*20)).FzEName = (*ExprList_item)(unsafe.Pointer(a + uintptr(k)*20)).FzEName
- libc.SetBitFieldPtr8Uint32((pNew+8 /* &.a */)+uintptr(((*ExprList)(unsafe.Pointer(pNew)).FnExpr-1))*20+12 /* &.eEName */, (uint32(int32(*(*uint8)(unsafe.Pointer(a + uintptr(k)*20 + 12 /* &.eEName */)) & 0x3 >> 0))), 0, 0x3)
+ (*ExprList_item)(unsafe.Pointer(pNew + 8 + uintptr((*ExprList)(unsafe.Pointer(pNew)).FnExpr-1)*20)).FzEName = (*ExprList_item)(unsafe.Pointer(a + uintptr(k)*20)).FzEName
+ libc.SetBitFieldPtr8Uint32(pNew+8+uintptr((*ExprList)(unsafe.Pointer(pNew)).FnExpr-1)*20+12, uint32(int32(*(*uint8)(unsafe.Pointer(a + uintptr(k)*20 + 12))&0x3>>0)), 0, 0x3)
(*ExprList_item)(unsafe.Pointer(a + uintptr(k)*20)).FzEName = uintptr(0)
}
(*ExprList_item)(unsafe.Pointer(a + uintptr(k)*20)).FpExpr = uintptr(0)
@@ -118736,7 +120596,7 @@ __3:
var zTName uintptr = uintptr(0) // text of name of TABLE
if int32((*Expr)(unsafe.Pointer(pE)).Fop) == TK_DOT {
- zTName = *(*uintptr)(unsafe.Pointer((*Expr)(unsafe.Pointer(pE)).FpLeft + 8 /* &.u */))
+ zTName = *(*uintptr)(unsafe.Pointer((*Expr)(unsafe.Pointer(pE)).FpLeft + 8))
}
i = 0
pFrom = pTabList + 8 /* &.a */
@@ -118756,42 +120616,42 @@ __3:
if (*Sqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 {
goto __6
}
- if (pSub == uintptr(0)) || (((*Select)(unsafe.Pointer(pSub)).FselFlags & U32(SF_NestedFrom)) == U32(0)) {
+ if pSub == uintptr(0) || (*Select)(unsafe.Pointer(pSub)).FselFlags&U32(SF_NestedFrom) == U32(0) {
pSub = uintptr(0)
- if (zTName != 0) && (Xsqlite3StrICmp(tls, zTName, zTabName) != 0) {
+ if zTName != 0 && Xsqlite3StrICmp(tls, zTName, zTabName) != 0 {
goto __5
}
iDb = Xsqlite3SchemaToIndex(tls, db, (*Table)(unsafe.Pointer(pTab)).FpSchema)
if iDb >= 0 {
zSchemaName = (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*16)).FzDbSName
} else {
- zSchemaName = ts + 17846 /* "*" */
+ zSchemaName = ts + 19143 /* "*" */
}
}
for j = 0; j < int32((*Table)(unsafe.Pointer(pTab)).FnCol); j++ {
- var zName uintptr = (*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FaCol + uintptr(j)*20)).FzName
+ var zName uintptr = (*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FaCol + uintptr(j)*16)).FzCnName
var zColname uintptr // The computed column name
var zToFree uintptr // Malloced string that needs to be freed
// var sColname Token at bp+72, 8
// Computed column name as a token
- if ((zTName != 0) && (pSub != 0)) &&
- (Xsqlite3MatchEName(tls, (((*Select)(unsafe.Pointer(pSub)).FpEList+8 /* &.a */)+uintptr(j)*20), uintptr(0), zTName, uintptr(0)) == 0) {
+ if zTName != 0 && pSub != 0 &&
+ Xsqlite3MatchEName(tls, (*Select)(unsafe.Pointer(pSub)).FpEList+8+uintptr(j)*20, uintptr(0), zTName, uintptr(0)) == 0 {
continue
}
// If a column is marked as 'hidden', omit it from the expanded
// result-set list unless the SELECT has the SF_IncludeHidden
// bit set.
- if (((*Select)(unsafe.Pointer(p)).FselFlags & U32(SF_IncludeHidden)) == U32(0)) &&
- ((int32((*Column)(unsafe.Pointer(((*Table)(unsafe.Pointer(pTab)).FaCol + uintptr(j)*20))).FcolFlags) & COLFLAG_HIDDEN) != 0) {
+ if (*Select)(unsafe.Pointer(p)).FselFlags&U32(SF_IncludeHidden) == U32(0) &&
+ int32((*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FaCol+uintptr(j)*16)).FcolFlags)&COLFLAG_HIDDEN != 0 {
continue
}
tableSeen = 1
- if (i > 0) && (zTName == uintptr(0)) {
- if ((int32((*SrcItem)(unsafe.Pointer(pFrom)).Ffg.Fjointype) & JT_NATURAL) != 0) &&
- (tableAndColumnIndex(tls, pTabList, i, zName, uintptr(0), uintptr(0), 1) != 0) {
+ if i > 0 && zTName == uintptr(0) {
+ if int32((*SrcItem)(unsafe.Pointer(pFrom)).Ffg.Fjointype)&JT_NATURAL != 0 &&
+ tableAndColumnIndex(tls, pTabList, i, zName, uintptr(0), uintptr(0), 1) != 0 {
// In a NATURAL join, omit the join columns from the
// table to the right of the join
continue
@@ -118805,7 +120665,7 @@ __3:
pRight = Xsqlite3Expr(tls, db, TK_ID, zName)
zColname = zName
zToFree = uintptr(0)
- if (longNames != 0) || ((*SrcList)(unsafe.Pointer(pTabList)).FnSrc > 1) {
+ if longNames != 0 || (*SrcList)(unsafe.Pointer(pTabList)).FnSrc > 1 {
var pLeft uintptr
pLeft = Xsqlite3Expr(tls, db, TK_ID, zTabName)
pExpr = Xsqlite3PExpr(tls, pParse, TK_DOT, pLeft, pRight)
@@ -118814,7 +120674,7 @@ __3:
pExpr = Xsqlite3PExpr(tls, pParse, TK_DOT, pLeft, pExpr)
}
if longNames != 0 {
- zColname = Xsqlite3MPrintf(tls, db, ts+10785 /* "%s.%s" */, libc.VaList(bp+24, zTabName, zName))
+ zColname = Xsqlite3MPrintf(tls, db, ts+11899 /* "%s.%s" */, libc.VaList(bp+24, zTabName, zName))
zToFree = zColname
}
} else {
@@ -118823,18 +120683,18 @@ __3:
pNew = Xsqlite3ExprListAppend(tls, pParse, pNew, pExpr)
Xsqlite3TokenInit(tls, bp+72 /* &sColname */, zColname)
Xsqlite3ExprListSetName(tls, pParse, pNew, bp+72 /* &sColname */, 0)
- if ((pNew != 0) && (((*Select)(unsafe.Pointer(p)).FselFlags & U32(SF_NestedFrom)) != U32(0))) && !(int32((*Parse)(unsafe.Pointer(pParse)).FeParseMode) >= PARSE_MODE_RENAME) {
- var pX uintptr = ((pNew + 8 /* &.a */) + uintptr(((*ExprList)(unsafe.Pointer(pNew)).FnExpr-1))*20)
+ if pNew != 0 && (*Select)(unsafe.Pointer(p)).FselFlags&U32(SF_NestedFrom) != U32(0) && !(int32((*Parse)(unsafe.Pointer(pParse)).FeParseMode) >= PARSE_MODE_RENAME) {
+ var pX uintptr = pNew + 8 + uintptr((*ExprList)(unsafe.Pointer(pNew)).FnExpr-1)*20
Xsqlite3DbFree(tls, db, (*ExprList_item)(unsafe.Pointer(pX)).FzEName)
if pSub != 0 {
- (*ExprList_item)(unsafe.Pointer(pX)).FzEName = Xsqlite3DbStrDup(tls, db, (*ExprList_item)(unsafe.Pointer(((*Select)(unsafe.Pointer(pSub)).FpEList+8 /* &.a */)+uintptr(j)*20)).FzEName)
+ (*ExprList_item)(unsafe.Pointer(pX)).FzEName = Xsqlite3DbStrDup(tls, db, (*ExprList_item)(unsafe.Pointer((*Select)(unsafe.Pointer(pSub)).FpEList+8+uintptr(j)*20)).FzEName)
} else {
- (*ExprList_item)(unsafe.Pointer(pX)).FzEName = Xsqlite3MPrintf(tls, db, ts+17848, /* "%s.%s.%s" */
+ (*ExprList_item)(unsafe.Pointer(pX)).FzEName = Xsqlite3MPrintf(tls, db, ts+19145, /* "%s.%s.%s" */
libc.VaList(bp+40, zSchemaName, zTabName, zColname))
}
- libc.SetBitFieldPtr8Uint32(pX+12 /* &.eEName */, uint32(ENAME_TAB), 0, 0x3)
+ libc.SetBitFieldPtr8Uint32(pX+12, uint32(ENAME_TAB), 0, 0x3)
}
Xsqlite3DbFree(tls, db, zToFree)
}
@@ -118850,9 +120710,9 @@ __3:
;
if !(tableSeen != 0) {
if zTName != 0 {
- Xsqlite3ErrorMsg(tls, pParse, ts+17857 /* "no such table: %..." */, libc.VaList(bp+64, zTName))
+ Xsqlite3ErrorMsg(tls, pParse, ts+19154 /* "no such table: %..." */, libc.VaList(bp+64, zTName))
} else {
- Xsqlite3ErrorMsg(tls, pParse, ts+17875 /* "no tables specif..." */, 0)
+ Xsqlite3ErrorMsg(tls, pParse, ts+19172 /* "no tables specif..." */, 0)
}
}
}
@@ -118861,12 +120721,12 @@ __3:
(*Select)(unsafe.Pointer(p)).FpEList = pNew
}
if (*Select)(unsafe.Pointer(p)).FpEList != 0 {
- if (*ExprList)(unsafe.Pointer((*Select)(unsafe.Pointer(p)).FpEList)).FnExpr > *(*int32)(unsafe.Pointer((db + 112 /* &.aLimit */) + 2*4)) {
- Xsqlite3ErrorMsg(tls, pParse, ts+17895 /* "too many columns..." */, 0)
+ if (*ExprList)(unsafe.Pointer((*Select)(unsafe.Pointer(p)).FpEList)).FnExpr > *(*int32)(unsafe.Pointer(db + 120 + 2*4)) {
+ Xsqlite3ErrorMsg(tls, pParse, ts+19192 /* "too many columns..." */, 0)
return WRC_Abort
}
- if (elistFlags & (U32(EP_HasFunc | EP_Subquery))) != U32(0) {
- *(*U32)(unsafe.Pointer(p + 4 /* &.selFlags */)) |= (U32(SF_ComplexResult))
+ if elistFlags&U32(EP_HasFunc|EP_Subquery) != U32(0) {
+ *(*U32)(unsafe.Pointer(p + 4)) |= U32(SF_ComplexResult)
}
}
return WRC_Continue
@@ -118883,7 +120743,7 @@ __3:
// If anything goes wrong, an error message is written into pParse.
// The calling function can detect the problem by looking at pParse->nErr
// and/or pParse->db->mallocFailed.
-func sqlite3SelectExpand(tls *libc.TLS, pParse uintptr, pSelect uintptr) { /* sqlite3.c:137782:13: */
+func sqlite3SelectExpand(tls *libc.TLS, pParse uintptr, pSelect uintptr) { /* sqlite3.c:139002:13: */
bp := tls.Alloc(28)
defer tls.Free(28)
@@ -118921,16 +120781,16 @@ func sqlite3SelectExpand(tls *libc.TLS, pParse uintptr, pSelect uintptr) { /* sq
// by selectExpander() but the type and collation information was omitted
// at that point because identifiers had not yet been resolved. This
// routine is called after identifier resolution.
-func selectAddSubqueryTypeInfo(tls *libc.TLS, pWalker uintptr, p uintptr) { /* sqlite3.c:137812:13: */
+func selectAddSubqueryTypeInfo(tls *libc.TLS, pWalker uintptr, p uintptr) { /* sqlite3.c:139032:13: */
var pParse uintptr
var i int32
var pTabList uintptr
var pFrom uintptr
- if ((*Select)(unsafe.Pointer(p)).FselFlags & U32(SF_HasTypeInfo)) != 0 {
+ if (*Select)(unsafe.Pointer(p)).FselFlags&U32(SF_HasTypeInfo) != 0 {
return
}
- *(*U32)(unsafe.Pointer(p + 4 /* &.selFlags */)) |= (U32(SF_HasTypeInfo))
+ *(*U32)(unsafe.Pointer(p + 4)) |= U32(SF_HasTypeInfo)
pParse = (*Walker)(unsafe.Pointer(pWalker)).FpParse
pTabList = (*Select)(unsafe.Pointer(p)).FpSrc
i = 0
@@ -118942,7 +120802,7 @@ __1:
{
var pTab uintptr = (*SrcItem)(unsafe.Pointer(pFrom)).FpTab
- if ((*Table)(unsafe.Pointer(pTab)).FtabFlags & U32(TF_Ephemeral)) != U32(0) {
+ if (*Table)(unsafe.Pointer(pTab)).FtabFlags&U32(TF_Ephemeral) != U32(0) {
// A sub-query in the FROM clause of a SELECT
var pSel uintptr = (*SrcItem)(unsafe.Pointer(pFrom)).FpSelect
if pSel != 0 {
@@ -118969,7 +120829,7 @@ __3:
// SELECT statement.
//
// Use this routine after name resolution.
-func sqlite3SelectAddTypeInfo(tls *libc.TLS, pParse uintptr, pSelect uintptr) { /* sqlite3.c:137847:13: */
+func sqlite3SelectAddTypeInfo(tls *libc.TLS, pParse uintptr, pSelect uintptr) { /* sqlite3.c:139067:13: */
bp := tls.Alloc(28)
defer tls.Free(28)
@@ -118998,20 +120858,20 @@ func sqlite3SelectAddTypeInfo(tls *libc.TLS, pParse uintptr, pSelect uintptr) {
// * Identifiers in expression are matched to tables.
//
// This routine acts recursively on all subqueries within the SELECT.
-func Xsqlite3SelectPrep(tls *libc.TLS, pParse uintptr, p uintptr, pOuterNC uintptr) { /* sqlite3.c:137871:21: */
+func Xsqlite3SelectPrep(tls *libc.TLS, pParse uintptr, p uintptr, pOuterNC uintptr) { /* sqlite3.c:139091:21: */
if (*Sqlite3)(unsafe.Pointer((*Parse)(unsafe.Pointer(pParse)).Fdb)).FmallocFailed != 0 {
return
}
- if ((*Select)(unsafe.Pointer(p)).FselFlags & U32(SF_HasTypeInfo)) != 0 {
+ if (*Select)(unsafe.Pointer(p)).FselFlags&U32(SF_HasTypeInfo) != 0 {
return
}
sqlite3SelectExpand(tls, pParse, p)
- if ((*Parse)(unsafe.Pointer(pParse)).FnErr != 0) || ((*Sqlite3)(unsafe.Pointer((*Parse)(unsafe.Pointer(pParse)).Fdb)).FmallocFailed != 0) {
+ if (*Parse)(unsafe.Pointer(pParse)).FnErr != 0 || (*Sqlite3)(unsafe.Pointer((*Parse)(unsafe.Pointer(pParse)).Fdb)).FmallocFailed != 0 {
return
}
Xsqlite3ResolveSelectNames(tls, pParse, p, pOuterNC)
- if ((*Parse)(unsafe.Pointer(pParse)).FnErr != 0) || ((*Sqlite3)(unsafe.Pointer((*Parse)(unsafe.Pointer(pParse)).Fdb)).FmallocFailed != 0) {
+ if (*Parse)(unsafe.Pointer(pParse)).FnErr != 0 || (*Sqlite3)(unsafe.Pointer((*Parse)(unsafe.Pointer(pParse)).Fdb)).FmallocFailed != 0 {
return
}
sqlite3SelectAddTypeInfo(tls, pParse, p)
@@ -119023,18 +120883,18 @@ func Xsqlite3SelectPrep(tls *libc.TLS, pParse uintptr, p uintptr, pOuterNC uintp
// intermediate results while calculating an aggregate. This
// routine generates code that stores NULLs in all of those memory
// cells.
-func resetAccumulator(tls *libc.TLS, pParse uintptr, pAggInfo uintptr) { /* sqlite3.c:137894:13: */
+func resetAccumulator(tls *libc.TLS, pParse uintptr, pAggInfo uintptr) { /* sqlite3.c:139114:13: */
bp := tls.Alloc(8)
defer tls.Free(8)
var v uintptr = (*Parse)(unsafe.Pointer(pParse)).FpVdbe
var i int32
var pFunc uintptr
- var nReg int32 = ((*AggInfo)(unsafe.Pointer(pAggInfo)).FnFunc + (*AggInfo)(unsafe.Pointer(pAggInfo)).FnColumn)
+ var nReg int32 = (*AggInfo)(unsafe.Pointer(pAggInfo)).FnFunc + (*AggInfo)(unsafe.Pointer(pAggInfo)).FnColumn
if nReg == 0 {
return
}
- if ((*Parse)(unsafe.Pointer(pParse)).FnErr != 0) || ((*Sqlite3)(unsafe.Pointer((*Parse)(unsafe.Pointer(pParse)).Fdb)).FmallocFailed != 0) {
+ if (*Parse)(unsafe.Pointer(pParse)).FnErr != 0 || (*Sqlite3)(unsafe.Pointer((*Parse)(unsafe.Pointer(pParse)).Fdb)).FmallocFailed != 0 {
return
}
Xsqlite3VdbeAddOp3(tls, v, OP_Null, 0, (*AggInfo)(unsafe.Pointer(pAggInfo)).FmnReg, (*AggInfo)(unsafe.Pointer(pAggInfo)).FmxReg)
@@ -119048,15 +120908,15 @@ __1:
if (*AggInfo_func)(unsafe.Pointer(pFunc)).FiDistinct >= 0 {
var pE uintptr = (*AggInfo_func)(unsafe.Pointer(pFunc)).FpFExpr
- if (*(*uintptr)(unsafe.Pointer(pE + 20 /* &.x */)) == uintptr(0)) || ((*ExprList)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pE + 20 /* &.x */)))).FnExpr != 1) {
+ if *(*uintptr)(unsafe.Pointer(pE + 20)) == uintptr(0) || (*ExprList)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pE + 20)))).FnExpr != 1 {
Xsqlite3ErrorMsg(tls, pParse,
- ts+17926 /* "DISTINCT aggrega..." */, 0)
+ ts+19223 /* "DISTINCT aggrega..." */, 0)
(*AggInfo_func)(unsafe.Pointer(pFunc)).FiDistinct = -1
} else {
- var pKeyInfo uintptr = Xsqlite3KeyInfoFromExprList(tls, pParse, *(*uintptr)(unsafe.Pointer(pE + 20 /* &.x */)), 0, 0)
+ var pKeyInfo uintptr = Xsqlite3KeyInfoFromExprList(tls, pParse, *(*uintptr)(unsafe.Pointer(pE + 20)), 0, 0)
(*AggInfo_func)(unsafe.Pointer(pFunc)).FiDistAddr = Xsqlite3VdbeAddOp4(tls, v, OP_OpenEphemeral,
(*AggInfo_func)(unsafe.Pointer(pFunc)).FiDistinct, 0, 0, pKeyInfo, -9)
- Xsqlite3VdbeExplain(tls, pParse, uint8(0), ts+17977 /* "USE TEMP B-TREE ..." */, libc.VaList(bp, (*FuncDef)(unsafe.Pointer((*AggInfo_func)(unsafe.Pointer(pFunc)).FpFunc)).FzName))
+ Xsqlite3VdbeExplain(tls, pParse, uint8(0), ts+19274 /* "USE TEMP B-TREE ..." */, libc.VaList(bp, (*FuncDef)(unsafe.Pointer((*AggInfo_func)(unsafe.Pointer(pFunc)).FpFunc)).FzName))
}
}
@@ -119072,7 +120932,7 @@ __3:
// Invoke the OP_AggFinalize opcode for every aggregate function
// in the AggInfo structure.
-func finalizeAggFunctions(tls *libc.TLS, pParse uintptr, pAggInfo uintptr) { /* sqlite3.c:137938:13: */
+func finalizeAggFunctions(tls *libc.TLS, pParse uintptr, pAggInfo uintptr) { /* sqlite3.c:139158:13: */
var v uintptr = (*Parse)(unsafe.Pointer(pParse)).FpVdbe
var i int32
var pF uintptr
@@ -119083,8 +120943,9 @@ __1:
goto __3
}
{
- var pList uintptr = *(*uintptr)(unsafe.Pointer((*AggInfo_func)(unsafe.Pointer(pF)).FpFExpr + 20 /* &.x */))
+ var pList uintptr
+ pList = *(*uintptr)(unsafe.Pointer((*AggInfo_func)(unsafe.Pointer(pF)).FpFExpr + 20))
Xsqlite3VdbeAddOp2(tls, v, OP_AggFinal, (*AggInfo_func)(unsafe.Pointer(pF)).FiMem, func() int32 {
if pList != 0 {
return (*ExprList)(unsafe.Pointer(pList)).FnExpr
@@ -119110,7 +120971,7 @@ __3:
// in pAggInfo, then only populate the pAggInfo->nAccumulator accumulator
// registers if register regAcc contains 0. The caller will take care
// of setting and clearing regAcc.
-func updateAccumulator(tls *libc.TLS, pParse uintptr, regAcc int32, pAggInfo uintptr, eDistinctType int32) { /* sqlite3.c:137960:13: */
+func updateAccumulator(tls *libc.TLS, pParse uintptr, regAcc int32, pAggInfo uintptr, eDistinctType int32) { /* sqlite3.c:139181:13: */
var v uintptr = (*Parse)(unsafe.Pointer(pParse)).FpVdbe
var i int32
var regHit int32 = 0
@@ -119129,13 +120990,14 @@ __1:
var nArg int32
var addrNext int32 = 0
var regAgg int32
- var pList uintptr = *(*uintptr)(unsafe.Pointer((*AggInfo_func)(unsafe.Pointer(pF)).FpFExpr + 20 /* &.x */))
+ var pList uintptr
- if ((*Expr)(unsafe.Pointer(((*AggInfo_func)(unsafe.Pointer(pF)).FpFExpr))).Fflags & (U32(EP_WinFunc))) != U32(0) {
- var pFilter uintptr = (*Window)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((*AggInfo_func)(unsafe.Pointer(pF)).FpFExpr + 44 /* &.y */)))).FpFilter
- if (((*AggInfo)(unsafe.Pointer(pAggInfo)).FnAccumulator != 0) &&
- (((*FuncDef)(unsafe.Pointer((*AggInfo_func)(unsafe.Pointer(pF)).FpFunc)).FfuncFlags & U32(SQLITE_FUNC_NEEDCOLL)) != 0)) &&
- (regAcc != 0) {
+ pList = *(*uintptr)(unsafe.Pointer((*AggInfo_func)(unsafe.Pointer(pF)).FpFExpr + 20))
+ if (*Expr)(unsafe.Pointer((*AggInfo_func)(unsafe.Pointer(pF)).FpFExpr)).Fflags&U32(EP_WinFunc) != U32(0) {
+ var pFilter uintptr = (*Window)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((*AggInfo_func)(unsafe.Pointer(pF)).FpFExpr + 44)))).FpFilter
+ if (*AggInfo)(unsafe.Pointer(pAggInfo)).FnAccumulator != 0 &&
+ (*FuncDef)(unsafe.Pointer((*AggInfo_func)(unsafe.Pointer(pF)).FpFunc)).FfuncFlags&U32(SQLITE_FUNC_NEEDCOLL) != 0 &&
+ regAcc != 0 {
// If regAcc==0, there there exists some min() or max() function
// without a FILTER clause that will ensure the magnet registers
// are populated.
@@ -119162,14 +121024,14 @@ __1:
nArg = 0
regAgg = 0
}
- if ((*AggInfo_func)(unsafe.Pointer(pF)).FiDistinct >= 0) && (pList != 0) {
+ if (*AggInfo_func)(unsafe.Pointer(pF)).FiDistinct >= 0 && pList != 0 {
if addrNext == 0 {
addrNext = Xsqlite3VdbeMakeLabel(tls, pParse)
}
(*AggInfo_func)(unsafe.Pointer(pF)).FiDistinct = codeDistinct(tls, pParse, eDistinctType,
(*AggInfo_func)(unsafe.Pointer(pF)).FiDistinct, addrNext, pList, regAgg)
}
- if ((*FuncDef)(unsafe.Pointer((*AggInfo_func)(unsafe.Pointer(pF)).FpFunc)).FfuncFlags & U32(SQLITE_FUNC_NEEDCOLL)) != 0 {
+ if (*FuncDef)(unsafe.Pointer((*AggInfo_func)(unsafe.Pointer(pF)).FpFunc)).FfuncFlags&U32(SQLITE_FUNC_NEEDCOLL) != 0 {
var pColl uintptr = uintptr(0)
var pItem uintptr
var j int32
@@ -119177,7 +121039,7 @@ __1:
j = 0
pItem = pList + 8 /* &.a */
__4:
- if !(!(pColl != 0) && (j < nArg)) {
+ if !(!(pColl != 0) && j < nArg) {
goto __6
}
{
@@ -119195,7 +121057,7 @@ __1:
if !(pColl != 0) {
pColl = (*Sqlite3)(unsafe.Pointer((*Parse)(unsafe.Pointer(pParse)).Fdb)).FpDfltColl
}
- if (regHit == 0) && ((*AggInfo)(unsafe.Pointer(pAggInfo)).FnAccumulator != 0) {
+ if regHit == 0 && (*AggInfo)(unsafe.Pointer(pAggInfo)).FnAccumulator != 0 {
regHit = libc.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1)
}
Xsqlite3VdbeAddOp4(tls, v, OP_CollSeq, regHit, 0, 0, pColl, -2)
@@ -119217,7 +121079,7 @@ __2:
goto __3
__3:
;
- if (regHit == 0) && ((*AggInfo)(unsafe.Pointer(pAggInfo)).FnAccumulator != 0) {
+ if regHit == 0 && (*AggInfo)(unsafe.Pointer(pAggInfo)).FnAccumulator != 0 {
regHit = regAcc
}
if regHit != 0 {
@@ -119250,25 +121112,25 @@ __9:
// Add a single OP_Explain instruction to the VDBE to explain a simple
// count(*) query ("SELECT count(*) FROM pTab").
-func explainSimpleCount(tls *libc.TLS, pParse uintptr, pTab uintptr, pIdx uintptr) { /* sqlite3.c:138061:13: */
+func explainSimpleCount(tls *libc.TLS, pParse uintptr, pTab uintptr, pIdx uintptr) { /* sqlite3.c:139283:13: */
bp := tls.Alloc(24)
defer tls.Free(24)
if int32((*Parse)(unsafe.Pointer(pParse)).Fexplain) == 2 {
- var bCover int32 = (libc.Bool32((pIdx != uintptr(0)) && ((((*Table)(unsafe.Pointer((pTab))).FtabFlags & U32(TF_WithoutRowid)) == U32(0)) || !((int32(*(*uint16)(unsafe.Pointer((pIdx) + 56 /* &.idxType */)) & 0x3 >> 0)) == SQLITE_IDXTYPE_PRIMARYKEY))))
- Xsqlite3VdbeExplain(tls, pParse, uint8(0), ts+18010, /* "SCAN %s%s%s" */
+ var bCover int32 = libc.Bool32(pIdx != uintptr(0) && ((*Table)(unsafe.Pointer(pTab)).FtabFlags&U32(TF_WithoutRowid) == U32(0) || !(int32(*(*uint16)(unsafe.Pointer(pIdx + 56))&0x3>>0) == SQLITE_IDXTYPE_PRIMARYKEY)))
+ Xsqlite3VdbeExplain(tls, pParse, uint8(0), ts+19307, /* "SCAN %s%s%s" */
libc.VaList(bp, (*Table)(unsafe.Pointer(pTab)).FzName,
func() uintptr {
if bCover != 0 {
- return ts + 18022 /* " USING COVERING ..." */
+ return ts + 19319 /* " USING COVERING ..." */
}
- return ts + 755 /* "" */
+ return ts + 1543 /* "" */
}(),
func() uintptr {
if bCover != 0 {
return (*Index)(unsafe.Pointer(pIdx)).FzName
}
- return ts + 755 /* "" */
+ return ts + 1543 /* "" */
}()))
}
}
@@ -119282,13 +121144,21 @@ func explainSimpleCount(tls *libc.TLS, pParse uintptr, pTab uintptr, pIdx uintpt
// sub-expression matches the criteria for being moved to the WHERE
// clause. If so, add it to the WHERE clause and replace the sub-expression
// within the HAVING expression with a constant "1".
-func havingToWhereExprCb(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 { /* sqlite3.c:138090:12: */
+func havingToWhereExprCb(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 { /* sqlite3.c:139312:12: */
if int32((*Expr)(unsafe.Pointer(pExpr)).Fop) != TK_AND {
- var pS uintptr = *(*uintptr)(unsafe.Pointer(pWalker + 24 /* &.u */))
- if (Xsqlite3ExprIsConstantOrGroupBy(tls, (*Walker)(unsafe.Pointer(pWalker)).FpParse, pExpr, (*Select)(unsafe.Pointer(pS)).FpGroupBy) != 0) &&
- ((libc.Bool32(((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_FromJoin | EP_IsFalse))) == U32(EP_IsFalse))) == 0) {
+ var pS uintptr = *(*uintptr)(unsafe.Pointer(pWalker + 24))
+ // This routine is called before the HAVING clause of the current
+ // SELECT is analyzed for aggregates. So if pExpr->pAggInfo is set
+ // here, it indicates that the expression is a correlated reference to a
+ // column from an outer aggregate query, or an aggregate function that
+ // belongs to an outer query. Do not move the expression to the WHERE
+ // clause in this obscure case, as doing so may corrupt the outer Select
+ // statements AggInfo structure.
+ if Xsqlite3ExprIsConstantOrGroupBy(tls, (*Walker)(unsafe.Pointer(pWalker)).FpParse, pExpr, (*Select)(unsafe.Pointer(pS)).FpGroupBy) != 0 &&
+ libc.Bool32((*Expr)(unsafe.Pointer(pExpr)).Fflags&U32(EP_FromJoin|EP_IsFalse) == U32(EP_IsFalse)) == 0 &&
+ (*Expr)(unsafe.Pointer(pExpr)).FpAggInfo == uintptr(0) {
var db uintptr = (*Parse)(unsafe.Pointer((*Walker)(unsafe.Pointer(pWalker)).FpParse)).Fdb
- var pNew uintptr = Xsqlite3Expr(tls, db, TK_INTEGER, ts+6913 /* "1" */)
+ var pNew uintptr = Xsqlite3Expr(tls, db, TK_INTEGER, ts+7806 /* "1" */)
if pNew != 0 {
var pWhere uintptr = (*Select)(unsafe.Pointer(pS)).FpWhere
{
@@ -119320,7 +121190,7 @@ func havingToWhereExprCb(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 {
// A term of the HAVING expression is eligible for transfer if it consists
// entirely of constants and expressions that are also GROUP BY terms that
// use the "BINARY" collation sequence.
-func havingToWhere(tls *libc.TLS, pParse uintptr, p uintptr) { /* sqlite3.c:138126:13: */
+func havingToWhere(tls *libc.TLS, pParse uintptr, p uintptr) { /* sqlite3.c:139356:13: */
bp := tls.Alloc(28)
defer tls.Free(28)
@@ -119331,17 +121201,17 @@ func havingToWhere(tls *libc.TLS, pParse uintptr, p uintptr) { /* sqlite3.c:1381
(*Walker)(unsafe.Pointer(bp /* &sWalker */)).FxExprCallback = *(*uintptr)(unsafe.Pointer(&struct {
f func(*libc.TLS, uintptr, uintptr) int32
}{havingToWhereExprCb}))
- *(*uintptr)(unsafe.Pointer(bp /* &sWalker */ + 24 /* &.u */)) = p
+ *(*uintptr)(unsafe.Pointer(bp + 24)) = p
Xsqlite3WalkExpr(tls, bp /* &sWalker */, (*Select)(unsafe.Pointer(p)).FpHaving)
}
// Check to see if the pThis entry of pTabList is a self-join of a prior view.
// If it is, then return the SrcList_item for the prior view. If it is not,
// then return 0.
-func isSelfJoinView(tls *libc.TLS, pTabList uintptr, pThis uintptr) uintptr { /* sqlite3.c:138146:16: */
+func isSelfJoinView(tls *libc.TLS, pTabList uintptr, pThis uintptr) uintptr { /* sqlite3.c:139376:16: */
var pItem uintptr
- if ((*Select)(unsafe.Pointer((*SrcItem)(unsafe.Pointer(pThis)).FpSelect)).FselFlags & U32(SF_PushDown)) != 0 {
+ if (*Select)(unsafe.Pointer((*SrcItem)(unsafe.Pointer(pThis)).FpSelect)).FselFlags&U32(SF_PushDown) != 0 {
return uintptr(0)
}
for pItem = pTabList + 8; /* &.a */ pItem < pThis; pItem += 72 {
@@ -119349,7 +121219,7 @@ func isSelfJoinView(tls *libc.TLS, pTabList uintptr, pThis uintptr) uintptr { /*
if (*SrcItem)(unsafe.Pointer(pItem)).FpSelect == uintptr(0) {
continue
}
- if (uint32(int32(*(*uint16)(unsafe.Pointer(pItem + 36 /* &.fg */ + 4 /* &.viaCoroutine */)) & 0x10 >> 4))) != 0 {
+ if uint32(int32(*(*uint16)(unsafe.Pointer(pItem + 36 + 4))&0x10>>4)) != 0 {
continue
}
if (*SrcItem)(unsafe.Pointer(pItem)).FzName == uintptr(0) {
@@ -119363,12 +121233,12 @@ func isSelfJoinView(tls *libc.TLS, pTabList uintptr, pThis uintptr) uintptr { /*
continue
}
pS1 = (*SrcItem)(unsafe.Pointer(pItem)).FpSelect
- if ((*Table)(unsafe.Pointer((*SrcItem)(unsafe.Pointer(pItem)).FpTab)).FpSchema == uintptr(0)) && ((*Select)(unsafe.Pointer((*SrcItem)(unsafe.Pointer(pThis)).FpSelect)).FselId != (*Select)(unsafe.Pointer(pS1)).FselId) {
+ if (*Table)(unsafe.Pointer((*SrcItem)(unsafe.Pointer(pItem)).FpTab)).FpSchema == uintptr(0) && (*Select)(unsafe.Pointer((*SrcItem)(unsafe.Pointer(pThis)).FpSelect)).FselId != (*Select)(unsafe.Pointer(pS1)).FselId {
// The query flattener left two different CTE tables with identical
// names in the same FROM clause.
continue
}
- if ((*Select)(unsafe.Pointer((*SrcItem)(unsafe.Pointer(pItem)).FpSelect)).FselFlags & U32(SF_PushDown)) != 0 {
+ if (*Select)(unsafe.Pointer((*SrcItem)(unsafe.Pointer(pItem)).FpSelect)).FselFlags&U32(SF_PushDown) != 0 {
// The view was modified by some other optimization such as
// pushDownWhereTerms()
continue
@@ -119379,7 +121249,7 @@ func isSelfJoinView(tls *libc.TLS, pTabList uintptr, pThis uintptr) uintptr { /*
}
// Deallocate a single AggInfo object
-func agginfoFree(tls *libc.TLS, db uintptr, p uintptr) { /* sqlite3.c:138181:13: */
+func agginfoFree(tls *libc.TLS, db uintptr, p uintptr) { /* sqlite3.c:139411:13: */
Xsqlite3DbFree(tls, db, (*AggInfo)(unsafe.Pointer(p)).FaCol)
Xsqlite3DbFree(tls, db, (*AggInfo)(unsafe.Pointer(p)).FaFunc)
Xsqlite3DbFreeNN(tls, db, p)
@@ -119396,7 +121266,7 @@ func agginfoFree(tls *libc.TLS, db uintptr, p uintptr) { /* sqlite3.c:138181:13:
//
// This routine does NOT free the Select structure passed in. The
// calling function needs to do that.
-func Xsqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) int32 { /* sqlite3.c:138287:20: */
+func Xsqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) int32 { /* sqlite3.c:139519:20: */
bp := tls.Alloc(164)
defer tls.Free(164)
@@ -119530,7 +121400,7 @@ func Xsqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) int
db = (*Parse)(unsafe.Pointer(pParse)).Fdb
v = Xsqlite3GetVdbe(tls, pParse)
- if !(((p == uintptr(0)) || ((*Sqlite3)(unsafe.Pointer(db)).FmallocFailed != 0)) || ((*Parse)(unsafe.Pointer(pParse)).FnErr != 0)) {
+ if !(p == uintptr(0) || (*Sqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 || (*Parse)(unsafe.Pointer(pParse)).FnErr != 0) {
goto __1
}
return 1
@@ -119543,7 +121413,7 @@ __1:
__2:
;
- if !((int32((*SelectDest)(unsafe.Pointer(pDest)).FeDest)) <= SRT_DistQueue) {
+ if !(int32((*SelectDest)(unsafe.Pointer(pDest)).FeDest) <= SRT_DistQueue) {
goto __3
}
@@ -119560,37 +121430,42 @@ __2:
(*Select)(unsafe.Pointer(p)).FpOrderBy = uintptr(0)
__4:
;
- *(*U32)(unsafe.Pointer(p + 4 /* &.selFlags */)) &= (libc.Uint32FromInt32(libc.CplInt32(SF_Distinct)))
- *(*U32)(unsafe.Pointer(p + 4 /* &.selFlags */)) |= (U32(SF_NoopOrderBy))
+ *(*U32)(unsafe.Pointer(p + 4)) &= libc.Uint32FromInt32(libc.CplInt32(SF_Distinct))
+ *(*U32)(unsafe.Pointer(p + 4)) |= U32(SF_NoopOrderBy)
__3:
;
Xsqlite3SelectPrep(tls, pParse, p, uintptr(0))
- if !(((*Parse)(unsafe.Pointer(pParse)).FnErr != 0) || ((*Sqlite3)(unsafe.Pointer(db)).FmallocFailed != 0)) {
+ if !((*Parse)(unsafe.Pointer(pParse)).FnErr != 0 || (*Sqlite3)(unsafe.Pointer(db)).FmallocFailed != 0) {
goto __5
}
goto select_end
__5:
;
- // If the SF_UpdateFrom flag is set, then this function is being called
+ // If the SF_UFSrcCheck flag is set, then this function is being called
// as part of populating the temp table for an UPDATE...FROM statement.
// In this case, it is an error if the target object (pSrc->a[0]) name
// or alias is duplicated within FROM clause (pSrc->a[1..n]).
- if !(((*Select)(unsafe.Pointer(p)).FselFlags & U32(SF_UpdateFrom)) != 0) {
+ //
+ // Postgres disallows this case too. The reason is that some other
+ // systems handle this case differently, and not all the same way,
+ // which is just confusing. To avoid this, we follow PG's lead and
+ // disallow it altogether.
+ if !((*Select)(unsafe.Pointer(p)).FselFlags&U32(SF_UFSrcCheck) != 0) {
goto __6
}
- p0 = ((*Select)(unsafe.Pointer(p)).FpSrc + 8 /* &.a */)
+ p0 = (*Select)(unsafe.Pointer(p)).FpSrc + 8
i = 1
__7:
if !(i < (*SrcList)(unsafe.Pointer((*Select)(unsafe.Pointer(p)).FpSrc)).FnSrc) {
goto __9
}
- p1 = (((*Select)(unsafe.Pointer(p)).FpSrc + 8 /* &.a */) + uintptr(i)*72)
- if !(((*SrcItem)(unsafe.Pointer(p0)).FpTab == (*SrcItem)(unsafe.Pointer(p1)).FpTab) && (0 == Xsqlite3_stricmp(tls, (*SrcItem)(unsafe.Pointer(p0)).FzAlias, (*SrcItem)(unsafe.Pointer(p1)).FzAlias))) {
+ p1 = (*Select)(unsafe.Pointer(p)).FpSrc + 8 + uintptr(i)*72
+ if !((*SrcItem)(unsafe.Pointer(p0)).FpTab == (*SrcItem)(unsafe.Pointer(p1)).FpTab && 0 == Xsqlite3_stricmp(tls, (*SrcItem)(unsafe.Pointer(p0)).FzAlias, (*SrcItem)(unsafe.Pointer(p1)).FzAlias)) {
goto __10
}
Xsqlite3ErrorMsg(tls, pParse,
- ts+18045, /* "target object/al..." */
+ ts+19342, /* "target object/al..." */
libc.VaList(bp, func() uintptr {
if (*SrcItem)(unsafe.Pointer(p0)).FzAlias != 0 {
return (*SrcItem)(unsafe.Pointer(p0)).FzAlias
@@ -119607,6 +121482,12 @@ __8:
goto __9
__9:
;
+
+ // Clear the SF_UFSrcCheck flag. The check has already been performed,
+ // and leaving this flag set can cause errors if a compound sub-query
+ // in p->pSrc is flattened into this query and this function called
+ // again as part of compound SELECT processing.
+ *(*U32)(unsafe.Pointer(p + 4)) &= libc.Uint32FromInt32(libc.CplInt32(SF_UFSrcCheck))
__6:
;
@@ -119625,7 +121506,7 @@ __11:
__12:
;
pTabList = (*Select)(unsafe.Pointer(p)).FpSrc
- isAgg = (libc.Bool32(((*Select)(unsafe.Pointer(p)).FselFlags & U32(SF_Aggregate)) != U32(0)))
+ isAgg = libc.Bool32((*Select)(unsafe.Pointer(p)).FselFlags&U32(SF_Aggregate) != U32(0))
libc.Xmemset(tls, bp+48 /* &sSort */, 0, uint32(unsafe.Sizeof(SortCtx{})))
(*SortCtx)(unsafe.Pointer(bp + 48 /* &sSort */)).FpOrderBy = (*Select)(unsafe.Pointer(p)).FpOrderBy
@@ -119633,10 +121514,10 @@ __12:
// reduction of join operators) in the FROM clause up into the main query
i = 0
__13:
- if !(!(int32((*Select)(unsafe.Pointer(p)).FpPrior) != 0) && (i < (*SrcList)(unsafe.Pointer(pTabList)).FnSrc)) {
+ if !(!(int32((*Select)(unsafe.Pointer(p)).FpPrior) != 0) && i < (*SrcList)(unsafe.Pointer(pTabList)).FnSrc) {
goto __15
}
- pItem = ((pTabList + 8 /* &.a */) + uintptr(i)*72)
+ pItem = pTabList + 8 + uintptr(i)*72
pSub = (*SrcItem)(unsafe.Pointer(pItem)).FpSelect
pTab = (*SrcItem)(unsafe.Pointer(pItem)).FpTab
@@ -119646,13 +121527,13 @@ __13:
// Convert LEFT JOIN into JOIN if there are terms of the right table
// of the LEFT JOIN used in the WHERE clause.
- if !((((int32((*SrcItem)(unsafe.Pointer(pItem)).Ffg.Fjointype) & JT_LEFT) != 0) &&
- (Xsqlite3ExprImpliesNonNullRow(tls, (*Select)(unsafe.Pointer(p)).FpWhere, (*SrcItem)(unsafe.Pointer(pItem)).FiCursor) != 0)) &&
- (((*Sqlite3)(unsafe.Pointer((db))).FdbOptFlags & (U32(SQLITE_SimplifyJoin))) == U32(0))) {
+ if !(int32((*SrcItem)(unsafe.Pointer(pItem)).Ffg.Fjointype)&JT_LEFT != 0 &&
+ Xsqlite3ExprImpliesNonNullRow(tls, (*Select)(unsafe.Pointer(p)).FpWhere, (*SrcItem)(unsafe.Pointer(pItem)).FiCursor) != 0 &&
+ (*Sqlite3)(unsafe.Pointer(db)).FdbOptFlags&U32(SQLITE_SimplifyJoin) == U32(0)) {
goto __16
}
- *(*U8)(unsafe.Pointer(pItem + 36 /* &.fg */ /* &.jointype */)) &= libc.Uint8FromInt32((libc.CplInt32((JT_LEFT | JT_OUTER))))
+ *(*U8)(unsafe.Pointer(pItem + 36)) &= libc.Uint8FromInt32(libc.CplInt32(JT_LEFT | JT_OUTER))
unsetJoinExpr(tls, (*Select)(unsafe.Pointer(p)).FpWhere, (*SrcItem)(unsafe.Pointer(pItem)).FiCursor)
__16:
;
@@ -119670,7 +121551,7 @@ __17:
if !(int32((*Table)(unsafe.Pointer(pTab)).FnCol) != (*ExprList)(unsafe.Pointer((*Select)(unsafe.Pointer(pSub)).FpEList)).FnExpr) {
goto __18
}
- Xsqlite3ErrorMsg(tls, pParse, ts+18099, /* "expected %d colu..." */
+ Xsqlite3ErrorMsg(tls, pParse, ts+19396, /* "expected %d colu..." */
libc.VaList(bp+8, int32((*Table)(unsafe.Pointer(pTab)).FnCol), (*Table)(unsafe.Pointer(pTab)).FzName, (*ExprList)(unsafe.Pointer((*Select)(unsafe.Pointer(pSub)).FpEList)).FnExpr))
goto select_end
__18:
@@ -119682,13 +121563,46 @@ __18:
// is not a join. But if the outer query is not a join, then the subquery
// will be implemented as a co-routine and there is no advantage to
// flattening in that case.
- if !(((*Select)(unsafe.Pointer(pSub)).FselFlags & U32(SF_Aggregate)) != U32(0)) {
+ if !((*Select)(unsafe.Pointer(pSub)).FselFlags&U32(SF_Aggregate) != U32(0)) {
goto __19
}
goto __14
__19:
;
+ // 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
+ //
+ // Beware of these cases where the ORDER BY clause may not be safely
+ // omitted:
+ //
+ // (1) There is also a LIMIT clause
+ // (2) The subquery was added to help with window-function
+ // processing
+ // (3) The subquery is in the FROM clause of an UPDATE
+ // (4) The outer query uses an aggregate function other than
+ // the built-in count(), min(), or max().
+ // (5) The ORDER BY isn't going to accomplish anything because
+ // one of:
+ // (a) The outer query has a different ORDER BY clause
+ // (b) The subquery is part of a join
+ // See forum post 062d576715d277c8
+ if !((*Select)(unsafe.Pointer(pSub)).FpOrderBy != uintptr(0) &&
+ ((*Select)(unsafe.Pointer(p)).FpOrderBy != uintptr(0) || (*SrcList)(unsafe.Pointer(pTabList)).FnSrc > 1) &&
+ (*Select)(unsafe.Pointer(pSub)).FpLimit == uintptr(0) &&
+ (*Select)(unsafe.Pointer(pSub)).FselFlags&U32(SF_OrderByReqd) == U32(0) &&
+ (*Select)(unsafe.Pointer(p)).FselFlags&U32(SF_OrderByReqd) == U32(0) &&
+ (*Sqlite3)(unsafe.Pointer(db)).FdbOptFlags&U32(SQLITE_OmitOrderBy) == U32(0)) {
+ goto __20
+ }
+
+ Xsqlite3ExprListDelete(tls, db, (*Select)(unsafe.Pointer(pSub)).FpOrderBy)
+ (*Select)(unsafe.Pointer(pSub)).FpOrderBy = uintptr(0)
+__20:
+ ;
+
// If the outer query contains a "complex" result set (that is,
// if the result set of the outer query uses functions or subqueries)
// and if the subquery contains an ORDER BY clause and if
@@ -119706,42 +121620,42 @@ __19:
// the expensive_function() like:
//
// SELECT x FROM (SELECT x FROM tab ORDER BY y LIMIT 10);
- if !(((((*Select)(unsafe.Pointer(pSub)).FpOrderBy != uintptr(0)) &&
- (i == 0)) &&
- (((*Select)(unsafe.Pointer(p)).FselFlags & U32(SF_ComplexResult)) != U32(0))) &&
- (((*SrcList)(unsafe.Pointer(pTabList)).FnSrc == 1) ||
- ((int32((*SrcItem)(unsafe.Pointer((pTabList+8 /* &.a */)+1*72)).Ffg.Fjointype) & (JT_LEFT | JT_CROSS)) != 0))) {
- goto __20
+ if !((*Select)(unsafe.Pointer(pSub)).FpOrderBy != uintptr(0) &&
+ i == 0 &&
+ (*Select)(unsafe.Pointer(p)).FselFlags&U32(SF_ComplexResult) != U32(0) &&
+ ((*SrcList)(unsafe.Pointer(pTabList)).FnSrc == 1 ||
+ int32((*SrcItem)(unsafe.Pointer(pTabList+8+1*72)).Ffg.Fjointype)&(JT_LEFT|JT_CROSS) != 0)) {
+ goto __21
}
goto __14
-__20:
+__21:
;
if !(flattenSubquery(tls, pParse, p, i, isAgg) != 0) {
- goto __21
+ goto __22
}
if !((*Parse)(unsafe.Pointer(pParse)).FnErr != 0) {
- goto __22
+ goto __23
}
goto select_end
-__22:
+__23:
;
// This subquery can be absorbed into its parent.
i = -1
-__21:
+__22:
;
pTabList = (*Select)(unsafe.Pointer(p)).FpSrc
if !((*Sqlite3)(unsafe.Pointer(db)).FmallocFailed != 0) {
- goto __23
+ goto __24
}
goto select_end
-__23:
+__24:
;
- if !(!((int32((*SelectDest)(unsafe.Pointer(pDest)).FeDest)) <= SRT_Fifo)) {
- goto __24
+ if !!(int32((*SelectDest)(unsafe.Pointer(pDest)).FeDest) <= SRT_Fifo) {
+ goto __25
}
(*SortCtx)(unsafe.Pointer(bp + 48 /* &sSort */)).FpOrderBy = (*Select)(unsafe.Pointer(p)).FpOrderBy
-__24:
+__25:
;
goto __14
__14:
@@ -119754,44 +121668,44 @@ __15:
// Handle compound SELECT statements using the separate multiSelect()
// procedure.
if !((*Select)(unsafe.Pointer(p)).FpPrior != 0) {
- goto __25
+ goto __26
}
rc = multiSelect(tls, pParse, p, pDest)
if !((*Select)(unsafe.Pointer(p)).FpNext == uintptr(0)) {
- goto __26
+ goto __27
}
Xsqlite3VdbeExplainPop(tls, pParse)
-__26:
+__27:
;
return rc
-__25:
+__26:
;
// Do the WHERE-clause constant propagation optimization if this is
// a join. No need to speed time on this operation for non-join queries
// as the equivalent optimization will be handled by query planner in
// sqlite3WhereBegin().
- if !(((((*Select)(unsafe.Pointer(p)).FpWhere != uintptr(0)) &&
- (int32((*Expr)(unsafe.Pointer((*Select)(unsafe.Pointer(p)).FpWhere)).Fop) == TK_AND)) &&
- (((*Sqlite3)(unsafe.Pointer((db))).FdbOptFlags & (U32(SQLITE_PropagateConst))) == U32(0))) &&
- (propagateConstants(tls, pParse, p) != 0)) {
- goto __27
+ if !((*Select)(unsafe.Pointer(p)).FpWhere != uintptr(0) &&
+ int32((*Expr)(unsafe.Pointer((*Select)(unsafe.Pointer(p)).FpWhere)).Fop) == TK_AND &&
+ (*Sqlite3)(unsafe.Pointer(db)).FdbOptFlags&U32(SQLITE_PropagateConst) == U32(0) &&
+ propagateConstants(tls, pParse, p) != 0) {
+ goto __28
}
- goto __28
-__27:
- ;
+ goto __29
__28:
;
+__29:
+ ;
// For each term in the FROM clause, do two things:
// (1) Authorized unreferenced tables
// (2) Generate code for all sub-queries
i = 0
-__29:
+__30:
if !(i < (*SrcList)(unsafe.Pointer(pTabList)).FnSrc) {
- goto __31
+ goto __32
}
- pItem1 = ((pTabList + 8 /* &.a */) + uintptr(i)*72)
+ pItem1 = pTabList + 8 + uintptr(i)*72
// Issue SQLITE_READ authorizations with a fake column name for any
// tables that are referenced but from which no values are extracted.
@@ -119808,20 +121722,20 @@ __29:
// which would be unambiguous. But legacy authorization callbacks might
// assume the column name is non-NULL and segfault. The use of an empty
// string for the fake column name seems safer.
- if !(((*SrcItem)(unsafe.Pointer(pItem1)).FcolUsed == uint64(0)) && ((*SrcItem)(unsafe.Pointer(pItem1)).FzName != uintptr(0))) {
- goto __32
+ if !((*SrcItem)(unsafe.Pointer(pItem1)).FcolUsed == uint64(0) && (*SrcItem)(unsafe.Pointer(pItem1)).FzName != uintptr(0)) {
+ goto __33
}
- Xsqlite3AuthCheck(tls, pParse, SQLITE_READ, (*SrcItem)(unsafe.Pointer(pItem1)).FzName, ts+755 /* "" */, (*SrcItem)(unsafe.Pointer(pItem1)).FzDatabase)
-__32:
+ Xsqlite3AuthCheck(tls, pParse, SQLITE_READ, (*SrcItem)(unsafe.Pointer(pItem1)).FzName, ts+1543 /* "" */, (*SrcItem)(unsafe.Pointer(pItem1)).FzDatabase)
+__33:
;
// Generate code for all sub-queries in the FROM clause
pSub1 = (*SrcItem)(unsafe.Pointer(pItem1)).FpSelect
if !(pSub1 == uintptr(0)) {
- goto __33
+ goto __34
}
- goto __30
-__33:
+ goto __31
+__34:
;
// The code for a subquery should only be generated once.
@@ -119832,22 +121746,23 @@ __33:
// (SQLITE_MAX_EXPR_DEPTH-Parse.nHeight) height. This is a bit
// more conservative than necessary, but much easier than enforcing
// an exact limit.
- *(*int32)(unsafe.Pointer(pParse + 208 /* &.nHeight */)) += (Xsqlite3SelectExprHeight(tls, p))
+ *(*int32)(unsafe.Pointer(pParse + 204)) += Xsqlite3SelectExprHeight(tls, p)
// Make copies of constant WHERE-clause terms in the outer query down
// inside the subquery. This can help the subquery to run more efficiently.
- if !(((((*Sqlite3)(unsafe.Pointer((db))).FdbOptFlags & (U32(SQLITE_PushDown))) == U32(0)) &&
- (((int32(*(*uint16)(unsafe.Pointer((pItem1 + 36 /* &.fg */) + 4 /* &.isCte */)) & 0x80 >> 7)) == 0) || (int32((*CteUse)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pItem1 + 68 /* &.u2 */)))).FeM10d) != M10d_Yes))) &&
- (pushDownWhereTerms(tls, pParse, pSub1, (*Select)(unsafe.Pointer(p)).FpWhere, (*SrcItem)(unsafe.Pointer(pItem1)).FiCursor,
- (libc.Bool32((int32((*SrcItem)(unsafe.Pointer(pItem1)).Ffg.Fjointype)&JT_OUTER) != 0))) != 0)) {
- goto __34
+ if !((*Sqlite3)(unsafe.Pointer(db)).FdbOptFlags&U32(SQLITE_PushDown) == U32(0) &&
+ (int32(*(*uint16)(unsafe.Pointer(pItem1 + 36 + 4))&0x80>>7) == 0 ||
+ int32((*CteUse)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pItem1 + 68)))).FeM10d) != M10d_Yes && (*CteUse)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pItem1 + 68)))).FnUse < 2) &&
+ pushDownWhereTerms(tls, pParse, pSub1, (*Select)(unsafe.Pointer(p)).FpWhere, (*SrcItem)(unsafe.Pointer(pItem1)).FiCursor,
+ libc.Bool32(int32((*SrcItem)(unsafe.Pointer(pItem1)).Ffg.Fjointype)&JT_OUTER != 0)) != 0) {
+ goto __35
}
- goto __35
-__34:
- ;
+ goto __36
__35:
;
+__36:
+ ;
zSavedAuthContext = (*Parse)(unsafe.Pointer(pParse)).FzAuthContext
(*Parse)(unsafe.Pointer(pParse)).FzAuthContext = (*SrcItem)(unsafe.Pointer(pItem1)).FzName
@@ -119861,126 +121776,127 @@ __35:
//
// TODO: Are there other reasons beside (1) and (2) to use a co-routine
// implementation?
- if !(((i == 0) &&
- (((*SrcList)(unsafe.Pointer(pTabList)).FnSrc == 1) ||
- ((int32((*SrcItem)(unsafe.Pointer((pTabList+8 /* &.a */)+1*72)).Ffg.Fjointype) & (JT_LEFT | JT_CROSS)) != 0))) && // (1)
- (((int32(*(*uint16)(unsafe.Pointer((pItem1 + 36 /* &.fg */) + 4 /* &.isCte */)) & 0x80 >> 7)) == 0) || (int32((*CteUse)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pItem1 + 68 /* &.u2 */)))).FeM10d) != M10d_Yes))) {
- goto __36
+ if !(i == 0 &&
+ ((*SrcList)(unsafe.Pointer(pTabList)).FnSrc == 1 ||
+ int32((*SrcItem)(unsafe.Pointer(pTabList+8+1*72)).Ffg.Fjointype)&(JT_LEFT|JT_CROSS) != 0) &&
+ (int32(*(*uint16)(unsafe.Pointer(pItem1 + 36 + 4))&0x80>>7) == 0 || int32((*CteUse)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pItem1 + 68)))).FeM10d) != M10d_Yes)) {
+ goto __37
}
// Implement a co-routine that will return a single row of the result
// set on each invocation.
- addrTop = (Xsqlite3VdbeCurrentAddr(tls, v) + 1)
+ addrTop = Xsqlite3VdbeCurrentAddr(tls, v) + 1
(*SrcItem)(unsafe.Pointer(pItem1)).FregReturn = libc.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1)
Xsqlite3VdbeAddOp3(tls, v, OP_InitCoroutine, (*SrcItem)(unsafe.Pointer(pItem1)).FregReturn, 0, addrTop)
(*SrcItem)(unsafe.Pointer(pItem1)).FaddrFillSub = addrTop
Xsqlite3SelectDestInit(tls, bp+88 /* &dest */, SRT_Coroutine, (*SrcItem)(unsafe.Pointer(pItem1)).FregReturn)
- Xsqlite3VdbeExplain(tls, pParse, uint8(1), ts+18139 /* "CO-ROUTINE %!S" */, libc.VaList(bp+32, pItem1))
+ Xsqlite3VdbeExplain(tls, pParse, uint8(1), ts+19436 /* "CO-ROUTINE %!S" */, libc.VaList(bp+32, pItem1))
Xsqlite3Select(tls, pParse, pSub1, bp+88 /* &dest */)
(*Table)(unsafe.Pointer((*SrcItem)(unsafe.Pointer(pItem1)).FpTab)).FnRowLogEst = (*Select)(unsafe.Pointer(pSub1)).FnSelectRow
- libc.SetBitFieldPtr16Uint32(pItem1+36 /* &.fg */ +4 /* &.viaCoroutine */, uint32(1), 4, 0x10)
+ libc.SetBitFieldPtr16Uint32(pItem1+36+4, uint32(1), 4, 0x10)
(*SrcItem)(unsafe.Pointer(pItem1)).FregResult = (*SelectDest)(unsafe.Pointer(bp + 88 /* &dest */)).FiSdst
Xsqlite3VdbeEndCoroutine(tls, v, (*SrcItem)(unsafe.Pointer(pItem1)).FregReturn)
- Xsqlite3VdbeJumpHere(tls, v, (addrTop - 1))
+ Xsqlite3VdbeJumpHere(tls, v, addrTop-1)
Xsqlite3ClearTempRegCache(tls, pParse)
- goto __37
-__36:
- if !(((uint32(int32(*(*uint16)(unsafe.Pointer((pItem1 + 36 /* &.fg */) + 4 /* &.isCte */)) & 0x80 >> 7))) != 0) && ((*CteUse)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pItem1 + 68 /* &.u2 */)))).FaddrM9e > 0)) {
- goto __38
+ goto __38
+__37:
+ if !(uint32(int32(*(*uint16)(unsafe.Pointer(pItem1 + 36 + 4))&0x80>>7)) != 0 && (*CteUse)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pItem1 + 68)))).FaddrM9e > 0) {
+ goto __39
}
// This is a CTE for which materialization code has already been
// generated. Invoke the subroutine to compute the materialization,
// the make the pItem->iCursor be a copy of the ephemerial table that
// holds the result of the materialization.
- pCteUse = *(*uintptr)(unsafe.Pointer(pItem1 + 68 /* &.u2 */))
+ pCteUse = *(*uintptr)(unsafe.Pointer(pItem1 + 68))
Xsqlite3VdbeAddOp2(tls, v, OP_Gosub, (*CteUse)(unsafe.Pointer(pCteUse)).FregRtn, (*CteUse)(unsafe.Pointer(pCteUse)).FaddrM9e)
if !((*SrcItem)(unsafe.Pointer(pItem1)).FiCursor != (*CteUse)(unsafe.Pointer(pCteUse)).FiCur) {
- goto __40
+ goto __41
}
Xsqlite3VdbeAddOp2(tls, v, OP_OpenDup, (*SrcItem)(unsafe.Pointer(pItem1)).FiCursor, (*CteUse)(unsafe.Pointer(pCteUse)).FiCur)
-__40:
+
+__41:
;
(*Select)(unsafe.Pointer(pSub1)).FnSelectRow = (*CteUse)(unsafe.Pointer(pCteUse)).FnRowEst
- goto __39
-__38:
- if !((libc.AssignUintptr(&pPrior, isSelfJoinView(tls, pTabList, pItem1))) != uintptr(0)) {
- goto __41
+ goto __40
+__39:
+ if !(libc.AssignUintptr(&pPrior, isSelfJoinView(tls, pTabList, pItem1)) != uintptr(0)) {
+ goto __42
}
// This view has already been materialized by a prior entry in
// this same FROM clause. Reuse it.
if !((*SrcItem)(unsafe.Pointer(pPrior)).FaddrFillSub != 0) {
- goto __43
+ goto __44
}
Xsqlite3VdbeAddOp2(tls, v, OP_Gosub, (*SrcItem)(unsafe.Pointer(pPrior)).FregReturn, (*SrcItem)(unsafe.Pointer(pPrior)).FaddrFillSub)
-__43:
+__44:
;
Xsqlite3VdbeAddOp2(tls, v, OP_OpenDup, (*SrcItem)(unsafe.Pointer(pItem1)).FiCursor, (*SrcItem)(unsafe.Pointer(pPrior)).FiCursor)
(*Select)(unsafe.Pointer(pSub1)).FnSelectRow = (*Select)(unsafe.Pointer((*SrcItem)(unsafe.Pointer(pPrior)).FpSelect)).FnSelectRow
- goto __42
-__41:
+ goto __43
+__42:
onceAddr = 0
(*SrcItem)(unsafe.Pointer(pItem1)).FregReturn = libc.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1)
topAddr = Xsqlite3VdbeAddOp2(tls, v, OP_Integer, 0, (*SrcItem)(unsafe.Pointer(pItem1)).FregReturn)
- (*SrcItem)(unsafe.Pointer(pItem1)).FaddrFillSub = (topAddr + 1)
- if !((int32(*(*uint16)(unsafe.Pointer((pItem1 + 36 /* &.fg */) + 4 /* &.isCorrelated */)) & 0x8 >> 3)) == 0) {
- goto __44
+ (*SrcItem)(unsafe.Pointer(pItem1)).FaddrFillSub = topAddr + 1
+ if !(int32(*(*uint16)(unsafe.Pointer(pItem1 + 36 + 4))&0x8>>3) == 0) {
+ goto __45
}
// If the subquery is not correlated and if we are not inside of
// a trigger, then we only need to compute the value of the subquery
// once.
onceAddr = Xsqlite3VdbeAddOp0(tls, v, OP_Once)
- goto __45
-__44:
- ;
+ goto __46
__45:
;
+__46:
+ ;
Xsqlite3SelectDestInit(tls, bp+88 /* &dest */, SRT_EphemTab, (*SrcItem)(unsafe.Pointer(pItem1)).FiCursor)
- Xsqlite3VdbeExplain(tls, pParse, uint8(1), ts+18154 /* "MATERIALIZE %!S" */, libc.VaList(bp+40, pItem1))
+ Xsqlite3VdbeExplain(tls, pParse, uint8(1), ts+19451 /* "MATERIALIZE %!S" */, libc.VaList(bp+40, pItem1))
Xsqlite3Select(tls, pParse, pSub1, bp+88 /* &dest */)
(*Table)(unsafe.Pointer((*SrcItem)(unsafe.Pointer(pItem1)).FpTab)).FnRowLogEst = (*Select)(unsafe.Pointer(pSub1)).FnSelectRow
if !(onceAddr != 0) {
- goto __46
+ goto __47
}
Xsqlite3VdbeJumpHere(tls, v, onceAddr)
-__46:
+__47:
;
retAddr = Xsqlite3VdbeAddOp1(tls, v, OP_Return, (*SrcItem)(unsafe.Pointer(pItem1)).FregReturn)
Xsqlite3VdbeChangeP1(tls, v, topAddr, retAddr)
Xsqlite3ClearTempRegCache(tls, pParse)
- if !(((uint32(int32(*(*uint16)(unsafe.Pointer((pItem1 + 36 /* &.fg */) + 4 /* &.isCte */)) & 0x80 >> 7))) != 0) && ((int32(*(*uint16)(unsafe.Pointer((pItem1 + 36 /* &.fg */) + 4 /* &.isCorrelated */)) & 0x8 >> 3)) == 0)) {
- goto __47
+ if !(uint32(int32(*(*uint16)(unsafe.Pointer(pItem1 + 36 + 4))&0x80>>7)) != 0 && int32(*(*uint16)(unsafe.Pointer(pItem1 + 36 + 4))&0x8>>3) == 0) {
+ goto __48
}
- pCteUse1 = *(*uintptr)(unsafe.Pointer(pItem1 + 68 /* &.u2 */))
+ pCteUse1 = *(*uintptr)(unsafe.Pointer(pItem1 + 68))
(*CteUse)(unsafe.Pointer(pCteUse1)).FaddrM9e = (*SrcItem)(unsafe.Pointer(pItem1)).FaddrFillSub
(*CteUse)(unsafe.Pointer(pCteUse1)).FregRtn = (*SrcItem)(unsafe.Pointer(pItem1)).FregReturn
(*CteUse)(unsafe.Pointer(pCteUse1)).FiCur = (*SrcItem)(unsafe.Pointer(pItem1)).FiCursor
(*CteUse)(unsafe.Pointer(pCteUse1)).FnRowEst = (*Select)(unsafe.Pointer(pSub1)).FnSelectRow
-__47:
+__48:
;
-__42:
+__43:
;
-__39:
+__40:
;
-__37:
+__38:
;
if !((*Sqlite3)(unsafe.Pointer(db)).FmallocFailed != 0) {
- goto __48
+ goto __49
}
goto select_end
-__48:
+__49:
;
- *(*int32)(unsafe.Pointer(pParse + 208 /* &.nHeight */)) -= (Xsqlite3SelectExprHeight(tls, p))
+ *(*int32)(unsafe.Pointer(pParse + 204)) -= Xsqlite3SelectExprHeight(tls, p)
(*Parse)(unsafe.Pointer(pParse)).FzAuthContext = zSavedAuthContext
- goto __30
-__30:
- i++
- goto __29
goto __31
__31:
+ i++
+ goto __30
+ goto __32
+__32:
;
// Various elements of the SELECT copied into local variables for
@@ -119989,7 +121905,7 @@ __31:
pWhere = (*Select)(unsafe.Pointer(p)).FpWhere
pGroupBy = (*Select)(unsafe.Pointer(p)).FpGroupBy
pHaving = (*Select)(unsafe.Pointer(p)).FpHaving
- (*DistinctCtx)(unsafe.Pointer(bp + 116 /* &sDistinct */)).FisTnct = (U8(libc.Bool32(((*Select)(unsafe.Pointer(p)).FselFlags & U32(SF_Distinct)) != U32(0))))
+ (*DistinctCtx)(unsafe.Pointer(bp + 116 /* &sDistinct */)).FisTnct = U8(libc.Bool32((*Select)(unsafe.Pointer(p)).FselFlags&U32(SF_Distinct) != U32(0)))
// If the query is DISTINCT with an ORDER BY but is not an aggregate, and
// if the select-list is the same as the ORDER BY list, then this query
@@ -120005,19 +121921,19 @@ __31:
// used for both the ORDER BY and DISTINCT processing. As originally
// written the query must use a temp-table for at least one of the ORDER
// BY and DISTINCT, and an index or separate temp-table for the other.
- if !(((((*Select)(unsafe.Pointer(p)).FselFlags & (U32(SF_Distinct | SF_Aggregate))) == U32(SF_Distinct)) &&
- (Xsqlite3ExprListCompare(tls, (*SortCtx)(unsafe.Pointer(bp+48 /* &sSort */)).FpOrderBy, pEList, -1) == 0)) &&
- ((*Select)(unsafe.Pointer(p)).FpWin == uintptr(0))) {
- goto __49
+ if !((*Select)(unsafe.Pointer(p)).FselFlags&U32(SF_Distinct|SF_Aggregate) == U32(SF_Distinct) &&
+ Xsqlite3ExprListCompare(tls, (*SortCtx)(unsafe.Pointer(bp+48)).FpOrderBy, pEList, -1) == 0 &&
+ (*Select)(unsafe.Pointer(p)).FpWin == uintptr(0)) {
+ goto __50
}
- *(*U32)(unsafe.Pointer(p + 4 /* &.selFlags */)) &= (libc.Uint32FromInt32(libc.CplInt32(SF_Distinct)))
- pGroupBy = libc.AssignPtrUintptr(p+40 /* &.pGroupBy */, Xsqlite3ExprListDup(tls, db, pEList, 0))
- *(*U32)(unsafe.Pointer(p + 4 /* &.selFlags */)) |= (U32(SF_Aggregate))
+ *(*U32)(unsafe.Pointer(p + 4)) &= libc.Uint32FromInt32(libc.CplInt32(SF_Distinct))
+ pGroupBy = libc.AssignPtrUintptr(p+40, Xsqlite3ExprListDup(tls, db, pEList, 0))
+ *(*U32)(unsafe.Pointer(p + 4)) |= U32(SF_Aggregate)
// Notice that even thought SF_Distinct has been cleared from p->selFlags,
// the sDistinct.isTnct is still set. Hence, isTnct represents the
// original setting of the SF_Distinct flag, not the current setting
-__49:
+__50:
;
// If there is an ORDER BY clause, then create an ephemeral index to
@@ -120027,49 +121943,49 @@ __49:
// 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.
- if !((*SortCtx)(unsafe.Pointer(bp+48 /* &sSort */)).FpOrderBy != 0) {
- goto __50
+ if !((*SortCtx)(unsafe.Pointer(bp+48)).FpOrderBy != 0) {
+ goto __51
}
pKeyInfo = Xsqlite3KeyInfoFromExprList(tls,
pParse, (*SortCtx)(unsafe.Pointer(bp+48 /* &sSort */)).FpOrderBy, 0, (*ExprList)(unsafe.Pointer(pEList)).FnExpr)
(*SortCtx)(unsafe.Pointer(bp + 48 /* &sSort */)).FiECursor = libc.PostIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnTab, 1)
(*SortCtx)(unsafe.Pointer(bp + 48 /* &sSort */)).FaddrSortIndex = Xsqlite3VdbeAddOp4(tls, v, OP_OpenEphemeral,
- (*SortCtx)(unsafe.Pointer(bp+48 /* &sSort */)).FiECursor, (((*ExprList)(unsafe.Pointer((*SortCtx)(unsafe.Pointer(bp+48 /* &sSort */)).FpOrderBy)).FnExpr + 1) + (*ExprList)(unsafe.Pointer(pEList)).FnExpr), 0,
+ (*SortCtx)(unsafe.Pointer(bp+48 /* &sSort */)).FiECursor, (*ExprList)(unsafe.Pointer((*SortCtx)(unsafe.Pointer(bp+48)).FpOrderBy)).FnExpr+1+(*ExprList)(unsafe.Pointer(pEList)).FnExpr, 0,
pKeyInfo, -9)
- goto __51
-__50:
- (*SortCtx)(unsafe.Pointer(bp + 48 /* &sSort */)).FaddrSortIndex = -1
+ goto __52
__51:
+ (*SortCtx)(unsafe.Pointer(bp + 48 /* &sSort */)).FaddrSortIndex = -1
+__52:
;
// If the output is destined for a temporary table, open that table.
if !(int32((*SelectDest)(unsafe.Pointer(pDest)).FeDest) == SRT_EphemTab) {
- goto __52
+ goto __53
}
Xsqlite3VdbeAddOp2(tls, v, OP_OpenEphemeral, (*SelectDest)(unsafe.Pointer(pDest)).FiSDParm, (*ExprList)(unsafe.Pointer(pEList)).FnExpr)
-__52:
+__53:
;
// Set the limiter.
iEnd = Xsqlite3VdbeMakeLabel(tls, pParse)
- if !(((*Select)(unsafe.Pointer(p)).FselFlags & U32(SF_FixedLimit)) == U32(0)) {
- goto __53
+ if !((*Select)(unsafe.Pointer(p)).FselFlags&U32(SF_FixedLimit) == U32(0)) {
+ goto __54
}
(*Select)(unsafe.Pointer(p)).FnSelectRow = int16(320) // 4 billion rows
-__53:
+__54:
;
computeLimitRegisters(tls, pParse, p, iEnd)
- if !(((*Select)(unsafe.Pointer(p)).FiLimit == 0) && ((*SortCtx)(unsafe.Pointer(bp+48 /* &sSort */)).FaddrSortIndex >= 0)) {
- goto __54
+ if !((*Select)(unsafe.Pointer(p)).FiLimit == 0 && (*SortCtx)(unsafe.Pointer(bp+48)).FaddrSortIndex >= 0) {
+ goto __55
}
Xsqlite3VdbeChangeOpcode(tls, v, (*SortCtx)(unsafe.Pointer(bp+48 /* &sSort */)).FaddrSortIndex, uint8(OP_SorterOpen))
- *(*U8)(unsafe.Pointer(bp + 48 /* &sSort */ + 32 /* &.sortFlags */)) |= U8((SORTFLAG_UseSorter))
-__54:
+ *(*U8)(unsafe.Pointer(bp + 48 + 32)) |= U8(SORTFLAG_UseSorter)
+__55:
;
// Open an ephemeral index to use for the distinct set.
- if !(((*Select)(unsafe.Pointer(p)).FselFlags & U32(SF_Distinct)) != 0) {
- goto __55
+ if !((*Select)(unsafe.Pointer(p)).FselFlags&U32(SF_Distinct) != 0) {
+ goto __56
}
(*DistinctCtx)(unsafe.Pointer(bp + 116 /* &sDistinct */)).FtabTnct = libc.PostIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnTab, 1)
(*DistinctCtx)(unsafe.Pointer(bp + 116 /* &sDistinct */)).FaddrTnct = Xsqlite3VdbeAddOp4(tls, v, OP_OpenEphemeral,
@@ -120078,29 +121994,29 @@ __54:
-9)
Xsqlite3VdbeChangeP5(tls, v, uint16(BTREE_UNORDERED))
(*DistinctCtx)(unsafe.Pointer(bp + 116 /* &sDistinct */)).FeTnctType = U8(WHERE_DISTINCT_UNORDERED)
- goto __56
-__55:
- (*DistinctCtx)(unsafe.Pointer(bp + 116 /* &sDistinct */)).FeTnctType = U8(WHERE_DISTINCT_NOOP)
+ goto __57
__56:
+ (*DistinctCtx)(unsafe.Pointer(bp + 116 /* &sDistinct */)).FeTnctType = U8(WHERE_DISTINCT_NOOP)
+__57:
;
- if !(!(isAgg != 0) && (pGroupBy == uintptr(0))) {
- goto __57
+ if !(!(isAgg != 0) && pGroupBy == uintptr(0)) {
+ goto __58
}
// No aggregate functions and no GROUP BY clause
- wctrlFlags = (U16((func() uint32 {
- if (*DistinctCtx)(unsafe.Pointer(bp+116 /* &sDistinct */)).FisTnct != 0 {
+ wctrlFlags = U16(func() uint32 {
+ if (*DistinctCtx)(unsafe.Pointer(bp+116)).FisTnct != 0 {
return uint32(WHERE_WANT_DISTINCT)
}
return uint32(0)
- }()) |
- ((*Select)(unsafe.Pointer(p)).FselFlags & U32(SF_FixedLimit))))
+ }() |
+ (*Select)(unsafe.Pointer(p)).FselFlags&U32(SF_FixedLimit))
pWin = (*Select)(unsafe.Pointer(p)).FpWin // Main window object (or NULL)
if !(pWin != 0) {
- goto __59
+ goto __60
}
Xsqlite3WindowCodeInit(tls, pParse, p)
-__59:
+__60:
;
// Begin the database scan.
@@ -120108,49 +122024,49 @@ __59:
pWInfo = Xsqlite3WhereBegin(tls, pParse, pTabList, pWhere, (*SortCtx)(unsafe.Pointer(bp+48 /* &sSort */)).FpOrderBy,
(*Select)(unsafe.Pointer(p)).FpEList, wctrlFlags, int32((*Select)(unsafe.Pointer(p)).FnSelectRow))
if !(pWInfo == uintptr(0)) {
- goto __60
+ goto __61
}
goto select_end
-__60:
+__61:
;
if !(int32(Xsqlite3WhereOutputRowCount(tls, pWInfo)) < int32((*Select)(unsafe.Pointer(p)).FnSelectRow)) {
- goto __61
+ goto __62
}
(*Select)(unsafe.Pointer(p)).FnSelectRow = Xsqlite3WhereOutputRowCount(tls, pWInfo)
-__61:
+__62:
;
- if !(((*DistinctCtx)(unsafe.Pointer(bp+116 /* &sDistinct */)).FisTnct != 0) && (Xsqlite3WhereIsDistinct(tls, pWInfo) != 0)) {
- goto __62
+ if !((*DistinctCtx)(unsafe.Pointer(bp+116)).FisTnct != 0 && Xsqlite3WhereIsDistinct(tls, pWInfo) != 0) {
+ goto __63
}
(*DistinctCtx)(unsafe.Pointer(bp + 116 /* &sDistinct */)).FeTnctType = U8(Xsqlite3WhereIsDistinct(tls, pWInfo))
-__62:
+__63:
;
- if !((*SortCtx)(unsafe.Pointer(bp+48 /* &sSort */)).FpOrderBy != 0) {
- goto __63
+ if !((*SortCtx)(unsafe.Pointer(bp+48)).FpOrderBy != 0) {
+ goto __64
}
(*SortCtx)(unsafe.Pointer(bp + 48 /* &sSort */)).FnOBSat = Xsqlite3WhereIsOrdered(tls, pWInfo)
(*SortCtx)(unsafe.Pointer(bp + 48 /* &sSort */)).FlabelOBLopt = Xsqlite3WhereOrderByLimitOptLabel(tls, pWInfo)
- if !((*SortCtx)(unsafe.Pointer(bp+48 /* &sSort */)).FnOBSat == (*ExprList)(unsafe.Pointer((*SortCtx)(unsafe.Pointer(bp+48 /* &sSort */)).FpOrderBy)).FnExpr) {
- goto __64
+ if !((*SortCtx)(unsafe.Pointer(bp+48)).FnOBSat == (*ExprList)(unsafe.Pointer((*SortCtx)(unsafe.Pointer(bp+48)).FpOrderBy)).FnExpr) {
+ goto __65
}
(*SortCtx)(unsafe.Pointer(bp + 48 /* &sSort */)).FpOrderBy = uintptr(0)
-__64:
+__65:
;
-__63:
+__64:
;
// If sorting index that was created by a prior OP_OpenEphemeral
// instruction ended up not being needed, then change the OP_OpenEphemeral
// into an OP_Noop.
- if !(((*SortCtx)(unsafe.Pointer(bp+48 /* &sSort */)).FaddrSortIndex >= 0) && ((*SortCtx)(unsafe.Pointer(bp+48 /* &sSort */)).FpOrderBy == uintptr(0))) {
- goto __65
+ if !((*SortCtx)(unsafe.Pointer(bp+48)).FaddrSortIndex >= 0 && (*SortCtx)(unsafe.Pointer(bp+48)).FpOrderBy == uintptr(0)) {
+ goto __66
}
Xsqlite3VdbeChangeToNoop(tls, v, (*SortCtx)(unsafe.Pointer(bp+48 /* &sSort */)).FaddrSortIndex)
-__65:
+__66:
;
if !(pWin != 0) {
- goto __66
+ goto __67
}
addrGosub = Xsqlite3VdbeMakeLabel(tls, pParse)
iCont = Xsqlite3VdbeMakeLabel(tls, pParse)
@@ -120168,8 +122084,8 @@ __65:
Xsqlite3VdbeAddOp1(tls, v, OP_Return, regGosub)
Xsqlite3VdbeResolveLabel(tls, v, iBreak)
- goto __67
-__66:
+ goto __68
+__67:
// Use the standard inner loop.
selectInnerLoop(tls, pParse, p, -1, bp+48 /* &sSort */, bp+116 /* &sDistinct */, pDest,
@@ -120179,10 +122095,10 @@ __66:
// End the database scan loop.
Xsqlite3WhereEnd(tls, pWInfo)
-__67:
+__68:
;
- goto __58
-__57: // End of processing for this SELECT
+ goto __59
+__58: // End of processing for this SELECT
sortPTab = 0 // Pseudotable used to decode sorting results
sortOut = 0 // Output register from the sorter
orderByGrp = 0 // True if the GROUP BY and ORDER BY are the same
@@ -120190,45 +122106,45 @@ __57: // End of processing for this SELECT
// Remove any and all aliases between the result set and the
// GROUP BY clause.
if !(pGroupBy != 0) {
- goto __68
+ goto __69
} // For looping over expression in a list
k = (*ExprList)(unsafe.Pointer((*Select)(unsafe.Pointer(p)).FpEList)).FnExpr
pItem2 = (*Select)(unsafe.Pointer(p)).FpEList + 8 /* &.a */
-__70:
+__71:
if !(k > 0) {
- goto __72
+ goto __73
}
- *(*U16)(unsafe.Pointer(pItem2 + 16 /* &.u */ /* &.x */ + 2 /* &.iAlias */)) = U16(0)
- goto __71
-__71:
- k--
- pItem2 += 20
- goto __70
+ *(*U16)(unsafe.Pointer(pItem2 + 16 + 2 /* &.iAlias */)) = U16(0)
goto __72
__72:
+ k--
+ pItem2 += 20
+ goto __71
+ goto __73
+__73:
;
k = (*ExprList)(unsafe.Pointer(pGroupBy)).FnExpr
pItem2 = pGroupBy + 8 /* &.a */
-__73:
+__74:
if !(k > 0) {
- goto __75
+ goto __76
}
- *(*U16)(unsafe.Pointer(pItem2 + 16 /* &.u */ /* &.x */ + 2 /* &.iAlias */)) = U16(0)
- goto __74
-__74:
- k--
- pItem2 += 20
- goto __73
+ *(*U16)(unsafe.Pointer(pItem2 + 16 + 2 /* &.iAlias */)) = U16(0)
goto __75
__75:
+ k--
+ pItem2 += 20
+ goto __74
+ goto __76
+__76:
;
if !(int32((*Select)(unsafe.Pointer(p)).FnSelectRow) > 66) {
- goto __76
+ goto __77
}
(*Select)(unsafe.Pointer(p)).FnSelectRow = int16(66)
-__76:
+__77:
;
// If there is both a GROUP BY and an ORDER BY clause and they are
@@ -120239,8 +122155,8 @@ __76:
// but not actually sorted. Either way, record the fact that the
// ORDER BY and GROUP BY clauses are the same by setting the orderByGrp
// variable.
- if !(((*SortCtx)(unsafe.Pointer(bp+48 /* &sSort */)).FpOrderBy != 0) && ((*ExprList)(unsafe.Pointer(pGroupBy)).FnExpr == (*ExprList)(unsafe.Pointer((*SortCtx)(unsafe.Pointer(bp+48 /* &sSort */)).FpOrderBy)).FnExpr)) {
- goto __77
+ if !((*SortCtx)(unsafe.Pointer(bp+48)).FpOrderBy != 0 && (*ExprList)(unsafe.Pointer(pGroupBy)).FnExpr == (*ExprList)(unsafe.Pointer((*SortCtx)(unsafe.Pointer(bp+48)).FpOrderBy)).FnExpr) {
+ goto __78
}
// The GROUP BY processing doesn't care whether rows are delivered in
// ASC or DESC order - only that each group is returned contiguously.
@@ -120248,32 +122164,32 @@ __76:
// ORDER BY to maximize the chances of rows being delivered in an
// order that makes the ORDER BY redundant.
ii = 0
-__78:
+__79:
if !(ii < (*ExprList)(unsafe.Pointer(pGroupBy)).FnExpr) {
- goto __80
+ goto __81
}
- sortFlags = (U8(int32((*ExprList_item)(unsafe.Pointer(((*SortCtx)(unsafe.Pointer(bp+48 /* &sSort */)).FpOrderBy+8 /* &.a */)+uintptr(ii)*20)).FsortFlags) & KEYINFO_ORDER_DESC))
- (*ExprList_item)(unsafe.Pointer((pGroupBy + 8 /* &.a */) + uintptr(ii)*20)).FsortFlags = sortFlags
- goto __79
-__79:
- ii++
- goto __78
+ sortFlags = U8(int32((*ExprList_item)(unsafe.Pointer((*SortCtx)(unsafe.Pointer(bp+48)).FpOrderBy+8+uintptr(ii)*20)).FsortFlags) & KEYINFO_ORDER_DESC)
+ (*ExprList_item)(unsafe.Pointer(pGroupBy + 8 + uintptr(ii)*20)).FsortFlags = sortFlags
goto __80
__80:
+ ii++
+ goto __79
+ goto __81
+__81:
;
- if !(Xsqlite3ExprListCompare(tls, pGroupBy, (*SortCtx)(unsafe.Pointer(bp+48 /* &sSort */)).FpOrderBy, -1) == 0) {
- goto __81
+ if !(Xsqlite3ExprListCompare(tls, pGroupBy, (*SortCtx)(unsafe.Pointer(bp+48)).FpOrderBy, -1) == 0) {
+ goto __82
}
orderByGrp = 1
-__81:
+__82:
;
-__77:
+__78:
;
- goto __69
-__68:
+ goto __70
+__69:
;
(*Select)(unsafe.Pointer(p)).FnSelectRow = int16(0)
-__69:
+__70:
;
// Create a label to jump to when we want to abort the query
@@ -120284,28 +122200,28 @@ __69:
// SELECT statement.
pAggInfo = Xsqlite3DbMallocZero(tls, db, uint64(unsafe.Sizeof(AggInfo{})))
if !(pAggInfo != 0) {
- goto __82
+ goto __83
}
Xsqlite3ParserAddCleanup(tls, pParse,
*(*uintptr)(unsafe.Pointer(&struct {
f func(*libc.TLS, uintptr, uintptr)
}{agginfoFree})), pAggInfo)
-__82:
+__83:
;
if !((*Sqlite3)(unsafe.Pointer(db)).FmallocFailed != 0) {
- goto __83
+ goto __84
}
goto select_end
-__83:
+__84:
;
(*AggInfo)(unsafe.Pointer(pAggInfo)).FselId = (*Select)(unsafe.Pointer(p)).FselId
libc.Xmemset(tls, bp+128 /* &sNC */, 0, uint32(unsafe.Sizeof(NameContext{})))
(*NameContext)(unsafe.Pointer(bp + 128 /* &sNC */)).FpParse = pParse
(*NameContext)(unsafe.Pointer(bp + 128 /* &sNC */)).FpSrcList = pTabList
- *(*uintptr)(unsafe.Pointer(bp + 128 /* &sNC */ + 8 /* &.uNC */)) = pAggInfo
+ *(*uintptr)(unsafe.Pointer(bp + 128 + 8)) = pAggInfo
- (*AggInfo)(unsafe.Pointer(pAggInfo)).FmnReg = ((*Parse)(unsafe.Pointer(pParse)).FnMem + 1)
+ (*AggInfo)(unsafe.Pointer(pAggInfo)).FmnReg = (*Parse)(unsafe.Pointer(pParse)).FnMem + 1
(*AggInfo)(unsafe.Pointer(pAggInfo)).FnSortingColumn = func() int32 {
if pGroupBy != 0 {
return (*ExprList)(unsafe.Pointer(pGroupBy)).FnExpr
@@ -120316,85 +122232,87 @@ __83:
Xsqlite3ExprAnalyzeAggList(tls, bp+128 /* &sNC */, pEList)
Xsqlite3ExprAnalyzeAggList(tls, bp+128 /* &sNC */, (*SortCtx)(unsafe.Pointer(bp+48 /* &sSort */)).FpOrderBy)
if !(pHaving != 0) {
- goto __84
+ goto __85
}
if !(pGroupBy != 0) {
- goto __85
+ goto __86
}
havingToWhere(tls, pParse, p)
pWhere = (*Select)(unsafe.Pointer(p)).FpWhere
-__85:
+__86:
;
Xsqlite3ExprAnalyzeAggregates(tls, bp+128 /* &sNC */, pHaving)
-__84:
+__85:
;
(*AggInfo)(unsafe.Pointer(pAggInfo)).FnAccumulator = (*AggInfo)(unsafe.Pointer(pAggInfo)).FnColumn
- if !((((*Select)(unsafe.Pointer(p)).FpGroupBy == uintptr(0)) && ((*Select)(unsafe.Pointer(p)).FpHaving == uintptr(0))) && ((*AggInfo)(unsafe.Pointer(pAggInfo)).FnFunc == 1)) {
- goto __86
+ if !((*Select)(unsafe.Pointer(p)).FpGroupBy == uintptr(0) && (*Select)(unsafe.Pointer(p)).FpHaving == uintptr(0) && (*AggInfo)(unsafe.Pointer(pAggInfo)).FnFunc == 1) {
+ goto __87
}
minMaxFlag = minMaxQuery(tls, db, (*AggInfo_func)(unsafe.Pointer((*AggInfo)(unsafe.Pointer(pAggInfo)).FaFunc)).FpFExpr, bp+160 /* &pMinMaxOrderBy */)
- goto __87
-__86:
- minMaxFlag = U8(WHERE_ORDERBY_NORMAL)
+ goto __88
__87:
+ minMaxFlag = U8(WHERE_ORDERBY_NORMAL)
+__88:
;
i = 0
-__88:
+__89:
if !(i < (*AggInfo)(unsafe.Pointer(pAggInfo)).FnFunc) {
- goto __90
+ goto __91
}
pExpr = (*AggInfo_func)(unsafe.Pointer((*AggInfo)(unsafe.Pointer(pAggInfo)).FaFunc + uintptr(i)*20)).FpFExpr
- *(*int32)(unsafe.Pointer(bp + 128 /* &sNC */ + 24 /* &.ncFlags */)) |= (NC_InAggFunc)
- Xsqlite3ExprAnalyzeAggList(tls, bp+128 /* &sNC */, *(*uintptr)(unsafe.Pointer(pExpr + 20 /* &.x */)))
+ *(*int32)(unsafe.Pointer(bp + 128 + 24)) |= NC_InAggFunc
+ Xsqlite3ExprAnalyzeAggList(tls, bp+128 /* &sNC */, *(*uintptr)(unsafe.Pointer(pExpr + 20)))
- if !(((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_WinFunc))) != U32(0)) {
- goto __91
+ if !((*Expr)(unsafe.Pointer(pExpr)).Fflags&U32(EP_WinFunc) != U32(0)) {
+ goto __92
}
- Xsqlite3ExprAnalyzeAggregates(tls, bp+128 /* &sNC */, (*Window)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pExpr + 44 /* &.y */)))).FpFilter)
-__91:
+ Xsqlite3ExprAnalyzeAggregates(tls, bp+128 /* &sNC */, (*Window)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pExpr + 44)))).FpFilter)
+__92:
;
- *(*int32)(unsafe.Pointer(bp + 128 /* &sNC */ + 24 /* &.ncFlags */)) &= (libc.CplInt32(NC_InAggFunc))
- goto __89
-__89:
- i++
- goto __88
+ *(*int32)(unsafe.Pointer(bp + 128 + 24)) &= libc.CplInt32(NC_InAggFunc)
goto __90
__90:
+ i++
+ goto __89
+ goto __91
+__91:
;
(*AggInfo)(unsafe.Pointer(pAggInfo)).FmxReg = (*Parse)(unsafe.Pointer(pParse)).FnMem
if !((*Sqlite3)(unsafe.Pointer(db)).FmallocFailed != 0) {
- goto __92
+ goto __93
}
goto select_end
-__92:
+__93:
;
// Processing for aggregates with GROUP BY is very different and
// much more complex than aggregates without a GROUP BY.
if !(pGroupBy != 0) {
- goto __93
+ goto __94
} // Return address register for reset subroutine
pDistinct = uintptr(0)
distFlag = U16(0)
eDist = WHERE_DISTINCT_NOOP
- if !((((*AggInfo)(unsafe.Pointer(pAggInfo)).FnFunc == 1) &&
- ((*AggInfo_func)(unsafe.Pointer((*AggInfo)(unsafe.Pointer(pAggInfo)).FaFunc)).FiDistinct >= 0)) &&
- (*(*uintptr)(unsafe.Pointer((*AggInfo_func)(unsafe.Pointer((*AggInfo)(unsafe.Pointer(pAggInfo)).FaFunc)).FpFExpr + 20 /* &.x */)) != 0)) {
- goto __95
+ if !((*AggInfo)(unsafe.Pointer(pAggInfo)).FnFunc == 1 &&
+ (*AggInfo_func)(unsafe.Pointer((*AggInfo)(unsafe.Pointer(pAggInfo)).FaFunc)).FiDistinct >= 0 &&
+ (*AggInfo_func)(unsafe.Pointer((*AggInfo)(unsafe.Pointer(pAggInfo)).FaFunc)).FpFExpr != uintptr(0) &&
+ (*Expr)(unsafe.Pointer((*AggInfo_func)(unsafe.Pointer((*AggInfo)(unsafe.Pointer(pAggInfo)).FaFunc)).FpFExpr)).Fflags&U32(EP_xIsSelect) == U32(0) &&
+ *(*uintptr)(unsafe.Pointer((*AggInfo_func)(unsafe.Pointer((*AggInfo)(unsafe.Pointer(pAggInfo)).FaFunc)).FpFExpr + 20)) != uintptr(0)) {
+ goto __96
}
- pExpr1 = (*ExprList_item)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer((*AggInfo_func)(unsafe.Pointer((*AggInfo)(unsafe.Pointer(pAggInfo)).FaFunc)).FpFExpr + 20 /* &.x */)) + 8 /* &.a */))).FpExpr
+ pExpr1 = (*ExprList_item)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((*AggInfo_func)(unsafe.Pointer((*AggInfo)(unsafe.Pointer(pAggInfo)).FaFunc)).FpFExpr + 20)) + 8)).FpExpr
pExpr1 = Xsqlite3ExprDup(tls, db, pExpr1, 0)
pDistinct = Xsqlite3ExprListDup(tls, db, pGroupBy, 0)
pDistinct = Xsqlite3ExprListAppend(tls, pParse, pDistinct, pExpr1)
if pDistinct != 0 {
- distFlag = (uint16(WHERE_WANT_DISTINCT | WHERE_AGG_DISTINCT))
+ distFlag = uint16(WHERE_WANT_DISTINCT | WHERE_AGG_DISTINCT)
} else {
distFlag = uint16(0)
}
-__95:
+__96:
;
// If there is a GROUP BY clause we might need a sorting index to
@@ -120415,13 +122333,13 @@ __95:
addrOutputRow = Xsqlite3VdbeMakeLabel(tls, pParse)
regReset = libc.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1)
addrReset = Xsqlite3VdbeMakeLabel(tls, pParse)
- iAMem = ((*Parse)(unsafe.Pointer(pParse)).FnMem + 1)
- *(*int32)(unsafe.Pointer(pParse + 44 /* &.nMem */)) += ((*ExprList)(unsafe.Pointer(pGroupBy)).FnExpr)
- iBMem = ((*Parse)(unsafe.Pointer(pParse)).FnMem + 1)
- *(*int32)(unsafe.Pointer(pParse + 44 /* &.nMem */)) += ((*ExprList)(unsafe.Pointer(pGroupBy)).FnExpr)
+ iAMem = (*Parse)(unsafe.Pointer(pParse)).FnMem + 1
+ *(*int32)(unsafe.Pointer(pParse + 44)) += (*ExprList)(unsafe.Pointer(pGroupBy)).FnExpr
+ iBMem = (*Parse)(unsafe.Pointer(pParse)).FnMem + 1
+ *(*int32)(unsafe.Pointer(pParse + 44)) += (*ExprList)(unsafe.Pointer(pGroupBy)).FnExpr
Xsqlite3VdbeAddOp2(tls, v, OP_Integer, 0, iAbortFlag)
- Xsqlite3VdbeAddOp3(tls, v, OP_Null, 0, iAMem, ((iAMem + (*ExprList)(unsafe.Pointer(pGroupBy)).FnExpr) - 1))
+ Xsqlite3VdbeAddOp3(tls, v, OP_Null, 0, iAMem, iAMem+(*ExprList)(unsafe.Pointer(pGroupBy)).FnExpr-1)
// Begin a loop that will extract all source rows in GROUP BY order.
// This might involve two separate loops with an OP_Sort in between, or
@@ -120430,37 +122348,37 @@ __95:
Xsqlite3VdbeAddOp2(tls, v, OP_Gosub, regReset, addrReset)
pWInfo = Xsqlite3WhereBegin(tls, pParse, pTabList, pWhere, pGroupBy, pDistinct,
- (uint16((WHERE_GROUPBY | (func() int32 {
+ uint16(WHERE_GROUPBY|func() int32 {
if orderByGrp != 0 {
return WHERE_SORTBYGROUP
}
return 0
- }())) | int32(distFlag))), 0)
+ }()|int32(distFlag)), 0)
if !(pWInfo == uintptr(0)) {
- goto __96
+ goto __97
}
Xsqlite3ExprListDelete(tls, db, pDistinct)
goto select_end
-__96:
+__97:
;
eDist = Xsqlite3WhereIsDistinct(tls, pWInfo)
if !(Xsqlite3WhereIsOrdered(tls, pWInfo) == (*ExprList)(unsafe.Pointer(pGroupBy)).FnExpr) {
- goto __97
+ goto __98
}
// The optimizer is able to deliver rows in group by order so
// we do not have to sort. The OP_OpenEphemeral table will be
// cancelled later because we still need to use the pKeyInfo
groupBySort = 0
- goto __98
-__97:
+ goto __99
+__98:
explainTempTable(tls, pParse,
func() uintptr {
- if ((*DistinctCtx)(unsafe.Pointer(bp+116 /* &sDistinct */)).FisTnct != 0) && (((*Select)(unsafe.Pointer(p)).FselFlags & U32(SF_Distinct)) == U32(0)) {
- return ts + 18170 /* "DISTINCT" */
+ if (*DistinctCtx)(unsafe.Pointer(bp+116)).FisTnct != 0 && (*Select)(unsafe.Pointer(p)).FselFlags&U32(SF_Distinct) == U32(0) {
+ return ts + 19467 /* "DISTINCT" */
}
- return ts + 18179 /* "GROUP BY" */
+ return ts + 19476 /* "GROUP BY" */
}())
groupBySort = 1
@@ -120468,48 +122386,48 @@ __97:
nCol = nGroupBy
j = nGroupBy
i = 0
-__99:
+__100:
if !(i < (*AggInfo)(unsafe.Pointer(pAggInfo)).FnColumn) {
- goto __101
+ goto __102
}
if !(int32((*AggInfo_col)(unsafe.Pointer((*AggInfo)(unsafe.Pointer(pAggInfo)).FaCol+uintptr(i)*20)).FiSorterColumn) >= j) {
- goto __102
+ goto __103
}
nCol++
j++
-__102:
+__103:
;
- goto __100
-__100:
- i++
- goto __99
goto __101
__101:
+ i++
+ goto __100
+ goto __102
+__102:
;
regBase = Xsqlite3GetTempRange(tls, pParse, nCol)
Xsqlite3ExprCodeExprList(tls, pParse, pGroupBy, regBase, 0, uint8(0))
j = nGroupBy
i = 0
-__103:
+__104:
if !(i < (*AggInfo)(unsafe.Pointer(pAggInfo)).FnColumn) {
- goto __105
+ goto __106
}
- pCol = ((*AggInfo)(unsafe.Pointer(pAggInfo)).FaCol + uintptr(i)*20)
+ pCol = (*AggInfo)(unsafe.Pointer(pAggInfo)).FaCol + uintptr(i)*20
if !(int32((*AggInfo_col)(unsafe.Pointer(pCol)).FiSorterColumn) >= j) {
- goto __106
+ goto __107
}
- r1 = (j + regBase)
+ r1 = j + regBase
Xsqlite3ExprCodeGetColumnOfTable(tls, v,
(*AggInfo_col)(unsafe.Pointer(pCol)).FpTab, (*AggInfo_col)(unsafe.Pointer(pCol)).FiTable, int32((*AggInfo_col)(unsafe.Pointer(pCol)).FiColumn), r1)
j++
-__106:
+__107:
;
- goto __104
-__104:
- i++
- goto __103
goto __105
__105:
+ i++
+ goto __104
+ goto __106
+__106:
;
regRecord = Xsqlite3GetTempReg(tls, pParse)
Xsqlite3VdbeAddOp3(tls, v, OP_MakeRecord, regBase, nCol, regRecord)
@@ -120524,7 +122442,7 @@ __105:
Xsqlite3VdbeAddOp2(tls, v, OP_SorterSort, (*AggInfo)(unsafe.Pointer(pAggInfo)).FsortingIdx, addrEnd)
(*AggInfo)(unsafe.Pointer(pAggInfo)).FuseSortingIdx = U8(1)
-__98:
+__99:
;
// If the index or temporary table used by the GROUP BY sort
@@ -120534,13 +122452,13 @@ __98:
// This is an optimization - the correct answer should result regardless.
// Use the SQLITE_GroupByOrder flag with SQLITE_TESTCTRL_OPTIMIZER to
// disable this optimization for testing purposes.
- if !(((orderByGrp != 0) && (((*Sqlite3)(unsafe.Pointer((db))).FdbOptFlags & (U32(SQLITE_GroupByOrder))) == U32(0))) &&
- ((groupBySort != 0) || (Xsqlite3WhereIsSorted(tls, pWInfo) != 0))) {
- goto __107
+ if !(orderByGrp != 0 && (*Sqlite3)(unsafe.Pointer(db)).FdbOptFlags&U32(SQLITE_GroupByOrder) == U32(0) &&
+ (groupBySort != 0 || Xsqlite3WhereIsSorted(tls, pWInfo) != 0)) {
+ goto __108
}
(*SortCtx)(unsafe.Pointer(bp + 48 /* &sSort */)).FpOrderBy = uintptr(0)
Xsqlite3VdbeChangeToNoop(tls, v, (*SortCtx)(unsafe.Pointer(bp+48 /* &sSort */)).FaddrSortIndex)
-__107:
+__108:
;
// Evaluate the current GROUP BY terms and store in b0, b1, b2...
@@ -120549,38 +122467,38 @@ __107:
// from the previous row currently stored in a0, a1, a2...
addrTopOfLoop = Xsqlite3VdbeCurrentAddr(tls, v)
if !(groupBySort != 0) {
- goto __108
+ goto __109
}
Xsqlite3VdbeAddOp3(tls, v, OP_SorterData, (*AggInfo)(unsafe.Pointer(pAggInfo)).FsortingIdx,
sortOut, sortPTab)
-__108:
+__109:
;
j = 0
-__109:
+__110:
if !(j < (*ExprList)(unsafe.Pointer(pGroupBy)).FnExpr) {
- goto __111
+ goto __112
}
if !(groupBySort != 0) {
- goto __112
+ goto __113
}
- Xsqlite3VdbeAddOp3(tls, v, OP_Column, sortPTab, j, (iBMem + j))
- goto __113
-__112:
- (*AggInfo)(unsafe.Pointer(pAggInfo)).FdirectMode = U8(1)
- Xsqlite3ExprCode(tls, pParse, (*ExprList_item)(unsafe.Pointer((pGroupBy+8 /* &.a */)+uintptr(j)*20)).FpExpr, (iBMem + j))
+ Xsqlite3VdbeAddOp3(tls, v, OP_Column, sortPTab, j, iBMem+j)
+ goto __114
__113:
+ (*AggInfo)(unsafe.Pointer(pAggInfo)).FdirectMode = U8(1)
+ Xsqlite3ExprCode(tls, pParse, (*ExprList_item)(unsafe.Pointer(pGroupBy+8+uintptr(j)*20)).FpExpr, iBMem+j)
+__114:
;
- goto __110
-__110:
- j++
- goto __109
goto __111
__111:
+ j++
+ goto __110
+ goto __112
+__112:
;
Xsqlite3VdbeAddOp4(tls, v, OP_Compare, iAMem, iBMem, (*ExprList)(unsafe.Pointer(pGroupBy)).FnExpr,
Xsqlite3KeyInfoRef(tls, pKeyInfo1), -9)
addr1 = Xsqlite3VdbeCurrentAddr(tls, v)
- Xsqlite3VdbeAddOp3(tls, v, OP_Jump, (addr1 + 1), 0, (addr1 + 1))
+ Xsqlite3VdbeAddOp3(tls, v, OP_Jump, addr1+1, 0, addr1+1)
// Generate code that runs whenever the GROUP BY changes.
// Changes in the GROUP BY are detected by the previous code
@@ -120605,16 +122523,16 @@ __111:
// End of the loop
if !(groupBySort != 0) {
- goto __114
+ goto __115
}
Xsqlite3VdbeAddOp2(tls, v, OP_SorterNext, (*AggInfo)(unsafe.Pointer(pAggInfo)).FsortingIdx, addrTopOfLoop)
- goto __115
-__114:
+ goto __116
+__115:
;
Xsqlite3WhereEnd(tls, pWInfo)
Xsqlite3VdbeChangeToNoop(tls, v, addrSortingIdx)
-__115:
+__116:
;
Xsqlite3ExprListDelete(tls, db, pDistinct)
@@ -120636,14 +122554,14 @@ __115:
Xsqlite3VdbeAddOp1(tls, v, OP_Return, regOutputRow)
Xsqlite3VdbeResolveLabel(tls, v, addrOutputRow)
addrOutputRow = Xsqlite3VdbeCurrentAddr(tls, v)
- Xsqlite3VdbeAddOp2(tls, v, OP_IfPos, iUseFlag, (addrOutputRow + 2))
+ Xsqlite3VdbeAddOp2(tls, v, OP_IfPos, iUseFlag, addrOutputRow+2)
Xsqlite3VdbeAddOp1(tls, v, OP_Return, regOutputRow)
finalizeAggFunctions(tls, pParse, pAggInfo)
- Xsqlite3ExprIfFalse(tls, pParse, pHaving, (addrOutputRow + 1), SQLITE_JUMPIFNULL)
+ Xsqlite3ExprIfFalse(tls, pParse, pHaving, addrOutputRow+1, SQLITE_JUMPIFNULL)
selectInnerLoop(tls, pParse, p, -1, bp+48, /* &sSort */
bp+116 /* &sDistinct */, pDest,
- (addrOutputRow + 1), addrSetAbort)
+ addrOutputRow+1, addrSetAbort)
Xsqlite3VdbeAddOp1(tls, v, OP_Return, regOutputRow)
// Generate a subroutine that will reset the group-by accumulator
@@ -120654,16 +122572,16 @@ __115:
Xsqlite3VdbeAddOp1(tls, v, OP_Return, regReset)
if !(eDist != WHERE_DISTINCT_NOOP) {
- goto __116
+ goto __117
}
- pF = ((*AggInfo)(unsafe.Pointer(pAggInfo)).FaFunc)
+ pF = (*AggInfo)(unsafe.Pointer(pAggInfo)).FaFunc
fixDistinctOpenEph(tls, pParse, eDist, (*AggInfo_func)(unsafe.Pointer(pF)).FiDistinct, (*AggInfo_func)(unsafe.Pointer(pF)).FiDistAddr)
-__116:
+__117:
;
- goto __94
-__93:
- if !((libc.AssignUintptr(&pTab1, isSimpleCount(tls, p, pAggInfo))) != uintptr(0)) {
- goto __117
+ goto __95
+__94:
+ if !(libc.AssignUintptr(&pTab1, isSimpleCount(tls, p, pAggInfo)) != uintptr(0)) {
+ goto __118
}
// If isSimpleCount() returns a pointer to a Table structure, then
// the SQL statement is of the form:
@@ -120694,59 +122612,59 @@ __93:
//
// In practice the KeyInfo structure will not be used. It is only
// passed to keep OP_OpenRead happy.
- if !(!(((*Table)(unsafe.Pointer((pTab1))).FtabFlags & U32(TF_WithoutRowid)) == U32(0))) {
- goto __119
+ if !!((*Table)(unsafe.Pointer(pTab1)).FtabFlags&U32(TF_WithoutRowid) == U32(0)) {
+ goto __120
}
pBest = Xsqlite3PrimaryKeyIndex(tls, pTab1)
-__119:
+__120:
;
- if !(!((int32(*(*uint16)(unsafe.Pointer(((*Select)(unsafe.Pointer(p)).FpSrc + 8 /* &.a */) + 36 /* &.fg */ + 4 /* &.notIndexed */)) & 0x1 >> 0)) != 0)) {
- goto __120
+ if !!(int32(*(*uint16)(unsafe.Pointer((*Select)(unsafe.Pointer(p)).FpSrc + 8 + 36 + 4))&0x1>>0) != 0) {
+ goto __121
}
pIdx = (*Table)(unsafe.Pointer(pTab1)).FpIndex
-__121:
+__122:
if !(pIdx != 0) {
- goto __123
- }
- if !(((((int32(*(*uint16)(unsafe.Pointer(pIdx + 56 /* &.bUnordered */)) & 0x4 >> 2)) == 0) &&
- (int32((*Index)(unsafe.Pointer(pIdx)).FszIdxRow) < int32((*Table)(unsafe.Pointer(pTab1)).FszTabRow))) &&
- ((*Index)(unsafe.Pointer(pIdx)).FpPartIdxWhere == uintptr(0))) &&
- (!(pBest != 0) || (int32((*Index)(unsafe.Pointer(pIdx)).FszIdxRow) < int32((*Index)(unsafe.Pointer(pBest)).FszIdxRow)))) {
goto __124
}
+ if !(int32(*(*uint16)(unsafe.Pointer(pIdx + 56))&0x4>>2) == 0 &&
+ int32((*Index)(unsafe.Pointer(pIdx)).FszIdxRow) < int32((*Table)(unsafe.Pointer(pTab1)).FszTabRow) &&
+ (*Index)(unsafe.Pointer(pIdx)).FpPartIdxWhere == uintptr(0) &&
+ (!(pBest != 0) || int32((*Index)(unsafe.Pointer(pIdx)).FszIdxRow) < int32((*Index)(unsafe.Pointer(pBest)).FszIdxRow))) {
+ goto __125
+ }
pBest = pIdx
-__124:
+__125:
;
- goto __122
-__122:
- pIdx = (*Index)(unsafe.Pointer(pIdx)).FpNext
- goto __121
goto __123
__123:
+ pIdx = (*Index)(unsafe.Pointer(pIdx)).FpNext
+ goto __122
+ goto __124
+__124:
;
-__120:
+__121:
;
if !(pBest != 0) {
- goto __125
+ goto __126
}
iRoot = (*Index)(unsafe.Pointer(pBest)).Ftnum
pKeyInfo2 = Xsqlite3KeyInfoOfIndex(tls, pParse, pBest)
-__125:
+__126:
;
// Open a read-only cursor, execute the OP_Count, close the cursor.
Xsqlite3VdbeAddOp4Int(tls, v, OP_OpenRead, iCsr, int32(iRoot), iDb, 1)
if !(pKeyInfo2 != 0) {
- goto __126
+ goto __127
}
Xsqlite3VdbeChangeP4(tls, v, -1, pKeyInfo2, -9)
-__126:
+__127:
;
Xsqlite3VdbeAddOp2(tls, v, OP_Count, iCsr, (*AggInfo_func)(unsafe.Pointer((*AggInfo)(unsafe.Pointer(pAggInfo)).FaFunc)).FiMem)
Xsqlite3VdbeAddOp1(tls, v, OP_Close, iCsr)
explainSimpleCount(tls, pParse, pTab1, pBest)
- goto __118
-__117:
+ goto __119
+__118:
regAcc = 0 // "populate accumulators" flag
pDistinct1 = uintptr(0)
distFlag1 = U16(0)
@@ -120761,53 +122679,54 @@ __117:
// least once even if the FILTER clause means the min() or max()
// function visits zero rows.
if !((*AggInfo)(unsafe.Pointer(pAggInfo)).FnAccumulator != 0) {
- goto __127
+ goto __128
}
i = 0
-__129:
+__130:
if !(i < (*AggInfo)(unsafe.Pointer(pAggInfo)).FnFunc) {
- goto __131
- }
- if !(((*Expr)(unsafe.Pointer(((*AggInfo_func)(unsafe.Pointer((*AggInfo)(unsafe.Pointer(pAggInfo)).FaFunc + uintptr(i)*20)).FpFExpr))).Fflags & (U32(EP_WinFunc))) != U32(0)) {
goto __132
}
- goto __130
-__132:
- ;
- if !(((*FuncDef)(unsafe.Pointer((*AggInfo_func)(unsafe.Pointer((*AggInfo)(unsafe.Pointer(pAggInfo)).FaFunc+uintptr(i)*20)).FpFunc)).FfuncFlags & U32(SQLITE_FUNC_NEEDCOLL)) != 0) {
+ if !((*Expr)(unsafe.Pointer((*AggInfo_func)(unsafe.Pointer((*AggInfo)(unsafe.Pointer(pAggInfo)).FaFunc+uintptr(i)*20)).FpFExpr)).Fflags&U32(EP_WinFunc) != U32(0)) {
goto __133
}
goto __131
__133:
;
- goto __130
-__130:
- i++
- goto __129
+ if !((*FuncDef)(unsafe.Pointer((*AggInfo_func)(unsafe.Pointer((*AggInfo)(unsafe.Pointer(pAggInfo)).FaFunc+uintptr(i)*20)).FpFunc)).FfuncFlags&U32(SQLITE_FUNC_NEEDCOLL) != 0) {
+ goto __134
+ }
+ goto __132
+__134:
+ ;
goto __131
__131:
+ i++
+ goto __130
+ goto __132
+__132:
;
if !(i == (*AggInfo)(unsafe.Pointer(pAggInfo)).FnFunc) {
- goto __134
+ goto __135
}
regAcc = libc.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1)
Xsqlite3VdbeAddOp2(tls, v, OP_Integer, 0, regAcc)
-__134:
+__135:
;
- goto __128
-__127:
- if !(((*AggInfo)(unsafe.Pointer(pAggInfo)).FnFunc == 1) && ((*AggInfo_func)(unsafe.Pointer((*AggInfo)(unsafe.Pointer(pAggInfo)).FaFunc)).FiDistinct >= 0)) {
- goto __135
+ goto __129
+__128:
+ if !((*AggInfo)(unsafe.Pointer(pAggInfo)).FnFunc == 1 && (*AggInfo_func)(unsafe.Pointer((*AggInfo)(unsafe.Pointer(pAggInfo)).FaFunc)).FiDistinct >= 0) {
+ goto __136
}
- pDistinct1 = *(*uintptr)(unsafe.Pointer((*AggInfo_func)(unsafe.Pointer((*AggInfo)(unsafe.Pointer(pAggInfo)).FaFunc)).FpFExpr + 20 /* &.x */))
+
+ pDistinct1 = *(*uintptr)(unsafe.Pointer((*AggInfo_func)(unsafe.Pointer((*AggInfo)(unsafe.Pointer(pAggInfo)).FaFunc)).FpFExpr + 20))
if pDistinct1 != 0 {
- distFlag1 = (uint16(WHERE_WANT_DISTINCT | WHERE_AGG_DISTINCT))
+ distFlag1 = uint16(WHERE_WANT_DISTINCT | WHERE_AGG_DISTINCT)
} else {
distFlag1 = uint16(0)
}
-__135:
+__136:
;
-__128:
+__129:
;
// This case runs if the aggregate has no GROUP BY clause. The
@@ -120822,75 +122741,75 @@ __128:
// be an appropriate ORDER BY expression for the optimization.
pWInfo = Xsqlite3WhereBegin(tls, pParse, pTabList, pWhere, *(*uintptr)(unsafe.Pointer(bp + 160 /* pMinMaxOrderBy */)),
- pDistinct1, (uint16(int32(minMaxFlag) | int32(distFlag1))), 0)
+ pDistinct1, uint16(int32(minMaxFlag)|int32(distFlag1)), 0)
if !(pWInfo == uintptr(0)) {
- goto __136
+ goto __137
}
goto select_end
-__136:
+__137:
;
eDist1 = Xsqlite3WhereIsDistinct(tls, pWInfo)
updateAccumulator(tls, pParse, regAcc, pAggInfo, eDist1)
if !(eDist1 != WHERE_DISTINCT_NOOP) {
- goto __137
+ goto __138
}
- pF1 = ((*AggInfo)(unsafe.Pointer(pAggInfo)).FaFunc)
+ pF1 = (*AggInfo)(unsafe.Pointer(pAggInfo)).FaFunc
fixDistinctOpenEph(tls, pParse, eDist1, (*AggInfo_func)(unsafe.Pointer(pF1)).FiDistinct, (*AggInfo_func)(unsafe.Pointer(pF1)).FiDistAddr)
-__137:
+__138:
;
if !(regAcc != 0) {
- goto __138
+ goto __139
}
Xsqlite3VdbeAddOp2(tls, v, OP_Integer, 1, regAcc)
-__138:
+__139:
;
if !(minMaxFlag != 0) {
- goto __139
+ goto __140
}
Xsqlite3WhereMinMaxOptEarlyOut(tls, v, pWInfo)
-__139:
+__140:
;
Xsqlite3WhereEnd(tls, pWInfo)
finalizeAggFunctions(tls, pParse, pAggInfo)
-__118:
+__119:
;
(*SortCtx)(unsafe.Pointer(bp + 48 /* &sSort */)).FpOrderBy = uintptr(0)
Xsqlite3ExprIfFalse(tls, pParse, pHaving, addrEnd, SQLITE_JUMPIFNULL)
selectInnerLoop(tls, pParse, p, -1, uintptr(0), uintptr(0),
pDest, addrEnd, addrEnd)
-__94:
+__95:
;
Xsqlite3VdbeResolveLabel(tls, v, addrEnd)
-__58:
+__59:
; // endif aggregate query
- if !(int32((*DistinctCtx)(unsafe.Pointer(bp+116 /* &sDistinct */)).FeTnctType) == WHERE_DISTINCT_UNORDERED) {
- goto __140
+ if !(int32((*DistinctCtx)(unsafe.Pointer(bp+116)).FeTnctType) == WHERE_DISTINCT_UNORDERED) {
+ goto __141
}
- explainTempTable(tls, pParse, ts+18170 /* "DISTINCT" */)
-__140:
+ explainTempTable(tls, pParse, ts+19467 /* "DISTINCT" */)
+__141:
;
// If there is an ORDER BY clause, then we need to sort the results
// and send them to the callback one by one.
- if !((*SortCtx)(unsafe.Pointer(bp+48 /* &sSort */)).FpOrderBy != 0) {
- goto __141
+ if !((*SortCtx)(unsafe.Pointer(bp+48)).FpOrderBy != 0) {
+ goto __142
}
explainTempTable(tls, pParse,
func() uintptr {
- if (*SortCtx)(unsafe.Pointer(bp+48 /* &sSort */)).FnOBSat > 0 {
- return ts + 18188 /* "RIGHT PART OF OR..." */
+ if (*SortCtx)(unsafe.Pointer(bp+48)).FnOBSat > 0 {
+ return ts + 19485 /* "RIGHT PART OF OR..." */
}
- return ts + 18211 /* "ORDER BY" */
+ return ts + 19508 /* "ORDER BY" */
}())
generateSortTail(tls, pParse, p, bp+48 /* &sSort */, (*ExprList)(unsafe.Pointer(pEList)).FnExpr, pDest)
-__141:
+__142:
;
// Jump here to skip this query
@@ -120898,13 +122817,13 @@ __141:
// The SELECT has been coded. If there is an error in the Parse structure,
// set the return code to 1. Otherwise 0.
- rc = (libc.Bool32((*Parse)(unsafe.Pointer(pParse)).FnErr > 0))
+ rc = libc.Bool32((*Parse)(unsafe.Pointer(pParse)).FnErr > 0)
// Control jumps to here if an error is encountered above, or upon
// successful coding of the SELECT.
select_end:
;
- *(*int32)(unsafe.Pointer(pParse + 36 /* &.nErr */)) += (int32((*Sqlite3)(unsafe.Pointer(db)).FmallocFailed))
+ *(*int32)(unsafe.Pointer(pParse + 36)) += int32((*Sqlite3)(unsafe.Pointer(db)).FmallocFailed)
Xsqlite3ExprListDelete(tls, db, *(*uintptr)(unsafe.Pointer(bp + 160 /* pMinMaxOrderBy */)))
Xsqlite3VdbeExplainPop(tls, pParse)
@@ -120941,7 +122860,7 @@ type TabResult1 = struct {
FnColumn U32
FnData U32
Frc int32
-} /* sqlite3.c:139498:9 */
+} /* sqlite3.c:140779:9 */
//************* End of select.c *********************************************
//************* Begin file table.c ******************************************
@@ -120965,12 +122884,12 @@ type TabResult1 = struct {
// This structure is used to pass data from sqlite3_get_table() through
// to the callback function is uses to build the result.
-type TabResult = TabResult1 /* sqlite3.c:139506:3 */
+type TabResult = TabResult1 /* sqlite3.c:140787:3 */
// This routine is called once for each row in the result table. Its job
// is to fill in the TabResult structure appropriately, allocating new
// memory as necessary.
-func sqlite3_get_table_cb(tls *libc.TLS, pArg uintptr, nCol int32, argv uintptr, colv uintptr) int32 { /* sqlite3.c:139513:12: */
+func sqlite3_get_table_cb(tls *libc.TLS, pArg uintptr, nCol int32, argv uintptr, colv uintptr) int32 { /* sqlite3.c:140794:12: */
bp := tls.Alloc(8)
defer tls.Free(8)
@@ -120984,20 +122903,20 @@ func sqlite3_get_table_cb(tls *libc.TLS, pArg uintptr, nCol int32, argv uintptr,
// Make sure there is enough space in p->azResult to hold everything
// we need to remember from this invocation of the callback.
- if !(((*TabResult)(unsafe.Pointer(p)).FnRow == U32(0)) && (argv != uintptr(0))) {
+ if !((*TabResult)(unsafe.Pointer(p)).FnRow == U32(0) && argv != uintptr(0)) {
goto __1
}
- need = (nCol * 2)
+ need = nCol * 2
goto __2
__1:
need = nCol
__2:
;
- if !(((*TabResult)(unsafe.Pointer(p)).FnData + U32(need)) > (*TabResult)(unsafe.Pointer(p)).FnAlloc) {
+ if !((*TabResult)(unsafe.Pointer(p)).FnData+U32(need) > (*TabResult)(unsafe.Pointer(p)).FnAlloc) {
goto __3
}
- (*TabResult)(unsafe.Pointer(p)).FnAlloc = (((*TabResult)(unsafe.Pointer(p)).FnAlloc * U32(2)) + U32(need))
- azNew = Xsqlite3Realloc(tls, (*TabResult)(unsafe.Pointer(p)).FazResult, (uint64(uint32(unsafe.Sizeof(uintptr(0))) * (*TabResult)(unsafe.Pointer(p)).FnAlloc)))
+ (*TabResult)(unsafe.Pointer(p)).FnAlloc = (*TabResult)(unsafe.Pointer(p)).FnAlloc*U32(2) + U32(need)
+ azNew = Xsqlite3Realloc(tls, (*TabResult)(unsafe.Pointer(p)).FazResult, uint64(uint32(unsafe.Sizeof(uintptr(0)))*(*TabResult)(unsafe.Pointer(p)).FnAlloc))
if !(azNew == uintptr(0)) {
goto __4
}
@@ -121019,7 +122938,7 @@ __7:
if !(i < nCol) {
goto __9
}
- z = Xsqlite3_mprintf(tls, ts+2790 /* "%s" */, libc.VaList(bp, *(*uintptr)(unsafe.Pointer(colv + uintptr(i)*4))))
+ z = Xsqlite3_mprintf(tls, ts+3601 /* "%s" */, libc.VaList(bp, *(*uintptr)(unsafe.Pointer(colv + uintptr(i)*4))))
if !(z == uintptr(0)) {
goto __10
}
@@ -121041,7 +122960,7 @@ __5:
}
Xsqlite3_free(tls, (*TabResult)(unsafe.Pointer(p)).FzErrMsg)
(*TabResult)(unsafe.Pointer(p)).FzErrMsg = Xsqlite3_mprintf(tls,
- ts+18220 /* "sqlite3_get_tabl..." */, 0)
+ ts+19517 /* "sqlite3_get_tabl..." */, 0)
(*TabResult)(unsafe.Pointer(p)).Frc = SQLITE_ERROR
return 1
__11:
@@ -121064,7 +122983,7 @@ __13:
z = uintptr(0)
goto __17
__16:
- n = (Xsqlite3Strlen30(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*4))) + 1)
+ n = Xsqlite3Strlen30(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*4))) + 1
z = Xsqlite3_malloc64(tls, uint64(n))
if !(z == uintptr(0)) {
goto __18
@@ -121101,7 +123020,7 @@ malloc_failed:
// from malloc(). But the caller cannot free this memory directly.
// Instead, the entire table should be passed to sqlite3_free_table() when
// the calling procedure is finished using it.
-func Xsqlite3_get_table(tls *libc.TLS, db uintptr, zSql uintptr, pazResult uintptr, pnRow uintptr, pnColumn uintptr, pzErrMsg uintptr) int32 { /* sqlite3.c:139587:16: */
+func Xsqlite3_get_table(tls *libc.TLS, db uintptr, zSql uintptr, pazResult uintptr, pnRow uintptr, pnColumn uintptr, pzErrMsg uintptr) int32 { /* sqlite3.c:140868:16: */
bp := tls.Alloc(36)
defer tls.Free(36)
@@ -121124,8 +123043,8 @@ func Xsqlite3_get_table(tls *libc.TLS, db uintptr, zSql uintptr, pazResult uintp
(*TabResult)(unsafe.Pointer(bp + 8 /* &res */)).FnData = U32(1)
(*TabResult)(unsafe.Pointer(bp + 8 /* &res */)).FnAlloc = U32(20)
(*TabResult)(unsafe.Pointer(bp + 8 /* &res */)).Frc = SQLITE_OK
- (*TabResult)(unsafe.Pointer(bp + 8 /* &res */)).FazResult = Xsqlite3_malloc64(tls, (uint64(uint32(unsafe.Sizeof(uintptr(0))) * (*TabResult)(unsafe.Pointer(bp+8 /* &res */)).FnAlloc)))
- if (*TabResult)(unsafe.Pointer(bp+8 /* &res */)).FazResult == uintptr(0) {
+ (*TabResult)(unsafe.Pointer(bp + 8 /* &res */)).FazResult = Xsqlite3_malloc64(tls, uint64(uint32(unsafe.Sizeof(uintptr(0)))*(*TabResult)(unsafe.Pointer(bp+8)).FnAlloc))
+ if (*TabResult)(unsafe.Pointer(bp+8)).FazResult == uintptr(0) {
(*Sqlite3)(unsafe.Pointer(db)).FerrCode = SQLITE_NOMEM
return SQLITE_NOMEM
}
@@ -121134,13 +123053,13 @@ func Xsqlite3_get_table(tls *libc.TLS, db uintptr, zSql uintptr, pazResult uintp
f func(*libc.TLS, uintptr, int32, uintptr, uintptr) int32
}{sqlite3_get_table_cb})), bp+8 /* &res */, pzErrMsg)
- *(*uintptr)(unsafe.Pointer((*TabResult)(unsafe.Pointer(bp + 8 /* &res */)).FazResult)) = uintptr(int32((*TabResult)(unsafe.Pointer(bp + 8 /* &res */)).FnData))
- if (rc & 0xff) == SQLITE_ABORT {
- Xsqlite3_free_table(tls, ((*TabResult)(unsafe.Pointer(bp+8 /* &res */)).FazResult + 1*4))
- if (*TabResult)(unsafe.Pointer(bp+8 /* &res */)).FzErrMsg != 0 {
+ *(*uintptr)(unsafe.Pointer((*TabResult)(unsafe.Pointer(bp + 8 /* &res */)).FazResult)) = uintptr(int32((*TabResult)(unsafe.Pointer(bp + 8)).FnData))
+ if rc&0xff == SQLITE_ABORT {
+ Xsqlite3_free_table(tls, (*TabResult)(unsafe.Pointer(bp+8)).FazResult+1*4)
+ if (*TabResult)(unsafe.Pointer(bp+8)).FzErrMsg != 0 {
if pzErrMsg != 0 {
Xsqlite3_free(tls, *(*uintptr)(unsafe.Pointer(pzErrMsg)))
- *(*uintptr)(unsafe.Pointer(pzErrMsg)) = Xsqlite3_mprintf(tls, ts+2790 /* "%s" */, libc.VaList(bp, (*TabResult)(unsafe.Pointer(bp+8 /* &res */)).FzErrMsg))
+ *(*uintptr)(unsafe.Pointer(pzErrMsg)) = Xsqlite3_mprintf(tls, ts+3601 /* "%s" */, libc.VaList(bp, (*TabResult)(unsafe.Pointer(bp+8 /* &res */)).FzErrMsg))
}
Xsqlite3_free(tls, (*TabResult)(unsafe.Pointer(bp+8 /* &res */)).FzErrMsg)
}
@@ -121149,20 +123068,20 @@ func Xsqlite3_get_table(tls *libc.TLS, db uintptr, zSql uintptr, pazResult uintp
}
Xsqlite3_free(tls, (*TabResult)(unsafe.Pointer(bp+8 /* &res */)).FzErrMsg)
if rc != SQLITE_OK {
- Xsqlite3_free_table(tls, ((*TabResult)(unsafe.Pointer(bp+8 /* &res */)).FazResult + 1*4))
+ Xsqlite3_free_table(tls, (*TabResult)(unsafe.Pointer(bp+8)).FazResult+1*4)
return rc
}
- if (*TabResult)(unsafe.Pointer(bp+8 /* &res */)).FnAlloc > (*TabResult)(unsafe.Pointer(bp+8 /* &res */)).FnData {
+ if (*TabResult)(unsafe.Pointer(bp+8)).FnAlloc > (*TabResult)(unsafe.Pointer(bp+8)).FnData {
var azNew uintptr
- azNew = Xsqlite3Realloc(tls, (*TabResult)(unsafe.Pointer(bp+8 /* &res */)).FazResult, (uint64(uint32(unsafe.Sizeof(uintptr(0))) * (*TabResult)(unsafe.Pointer(bp+8 /* &res */)).FnData)))
+ azNew = Xsqlite3Realloc(tls, (*TabResult)(unsafe.Pointer(bp+8 /* &res */)).FazResult, uint64(uint32(unsafe.Sizeof(uintptr(0)))*(*TabResult)(unsafe.Pointer(bp+8)).FnData))
if azNew == uintptr(0) {
- Xsqlite3_free_table(tls, ((*TabResult)(unsafe.Pointer(bp+8 /* &res */)).FazResult + 1*4))
+ Xsqlite3_free_table(tls, (*TabResult)(unsafe.Pointer(bp+8)).FazResult+1*4)
(*Sqlite3)(unsafe.Pointer(db)).FerrCode = SQLITE_NOMEM
return SQLITE_NOMEM
}
(*TabResult)(unsafe.Pointer(bp + 8 /* &res */)).FazResult = azNew
}
- *(*uintptr)(unsafe.Pointer(pazResult)) = ((*TabResult)(unsafe.Pointer(bp+8 /* &res */)).FazResult + 1*4)
+ *(*uintptr)(unsafe.Pointer(pazResult)) = (*TabResult)(unsafe.Pointer(bp+8)).FazResult + 1*4
if pnColumn != 0 {
*(*int32)(unsafe.Pointer(pnColumn)) = int32((*TabResult)(unsafe.Pointer(bp + 8 /* &res */)).FnColumn)
}
@@ -121173,7 +123092,7 @@ func Xsqlite3_get_table(tls *libc.TLS, db uintptr, zSql uintptr, pazResult uintp
}
// This routine frees the space the sqlite3_get_table() malloced.
-func Xsqlite3_free_table(tls *libc.TLS, azResult uintptr) { /* sqlite3.c:139656:17: */
+func Xsqlite3_free_table(tls *libc.TLS, azResult uintptr) { /* sqlite3.c:140937:17: */
if azResult != 0 {
var i int32
var n int32
@@ -121204,7 +123123,7 @@ func Xsqlite3_free_table(tls *libc.TLS, azResult uintptr) { /* sqlite3.c:139656:
// #include "sqliteInt.h"
// Delete a linked list of TriggerStep structures.
-func Xsqlite3DeleteTriggerStep(tls *libc.TLS, db uintptr, pTriggerStep uintptr) { /* sqlite3.c:139691:21: */
+func Xsqlite3DeleteTriggerStep(tls *libc.TLS, db uintptr, pTriggerStep uintptr) { /* sqlite3.c:140972:21: */
for pTriggerStep != 0 {
var pTmp uintptr = pTriggerStep
pTriggerStep = (*TriggerStep)(unsafe.Pointer(pTriggerStep)).FpNext
@@ -121233,7 +123152,7 @@ func Xsqlite3DeleteTriggerStep(tls *libc.TLS, db uintptr, pTriggerStep uintptr)
// To state it another way: This routine returns a list of all triggers
// that fire off of pTab. The list will include any TEMP triggers on
// pTab as well as the triggers lised in pTab->pTrigger.
-func Xsqlite3TriggerList(tls *libc.TLS, pParse uintptr, pTab uintptr) uintptr { /* sqlite3.c:139722:24: */
+func Xsqlite3TriggerList(tls *libc.TLS, pParse uintptr, pTab uintptr) uintptr { /* sqlite3.c:141003:24: */
var pTmpSchema uintptr // Schema of the pTab table
var pList uintptr // List of triggers to return
var p uintptr // Loop variable for TEMP triggers
@@ -121242,18 +123161,18 @@ func Xsqlite3TriggerList(tls *libc.TLS, pParse uintptr, pTab uintptr) uintptr {
return uintptr(0)
}
pTmpSchema = (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer((*Parse)(unsafe.Pointer(pParse)).Fdb)).FaDb + 1*16)).FpSchema
- p = (*Hash)(unsafe.Pointer((pTmpSchema + 40 /* &.trigHash */))).Ffirst
+ p = (*Hash)(unsafe.Pointer(pTmpSchema + 40)).Ffirst
pList = (*Table)(unsafe.Pointer(pTab)).FpTrigger
for p != 0 {
var pTrig uintptr = (*HashElem)(unsafe.Pointer(p)).Fdata
- if ((((*Trigger)(unsafe.Pointer(pTrig)).FpTabSchema == (*Table)(unsafe.Pointer(pTab)).FpSchema) &&
- ((*Trigger)(unsafe.Pointer(pTrig)).Ftable != 0)) &&
- (0 == Xsqlite3StrICmp(tls, (*Trigger)(unsafe.Pointer(pTrig)).Ftable, (*Table)(unsafe.Pointer(pTab)).FzName))) &&
- ((*Trigger)(unsafe.Pointer(pTrig)).FpTabSchema != pTmpSchema) {
+ if (*Trigger)(unsafe.Pointer(pTrig)).FpTabSchema == (*Table)(unsafe.Pointer(pTab)).FpSchema &&
+ (*Trigger)(unsafe.Pointer(pTrig)).Ftable != 0 &&
+ 0 == Xsqlite3StrICmp(tls, (*Trigger)(unsafe.Pointer(pTrig)).Ftable, (*Table)(unsafe.Pointer(pTab)).FzName) &&
+ (*Trigger)(unsafe.Pointer(pTrig)).FpTabSchema != pTmpSchema {
(*Trigger)(unsafe.Pointer(pTrig)).FpNext = pList
pList = pTrig
- } else if (int32((*Trigger)(unsafe.Pointer(pTrig)).Fop) == TK_RETURNING) &&
- ((*Sqlite3)(unsafe.Pointer((*Parse)(unsafe.Pointer(pParse)).Fdb)).FpVtabCtx == uintptr(0)) {
+ } else if int32((*Trigger)(unsafe.Pointer(pTrig)).Fop) == TK_RETURNING &&
+ (*Sqlite3)(unsafe.Pointer((*Parse)(unsafe.Pointer(pParse)).Fdb)).FpVtabCtx == uintptr(0) {
(*Trigger)(unsafe.Pointer(pTrig)).Ftable = (*Table)(unsafe.Pointer(pTab)).FzName
(*Trigger)(unsafe.Pointer(pTrig)).FpTabSchema = (*Table)(unsafe.Pointer(pTab)).FpSchema
@@ -121271,7 +123190,7 @@ func Xsqlite3TriggerList(tls *libc.TLS, pParse uintptr, pTab uintptr) uintptr {
// in pParse->pNewTrigger. After the trigger actions have been parsed, the
// sqlite3FinishTrigger() function is called to complete the trigger
// construction process.
-func Xsqlite3BeginTrigger(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 uintptr, tr_tm int32, op int32, pColumns uintptr, pTableName uintptr, pWhen uintptr, isTemp int32, noErr int32) { /* sqlite3.c:139778:21: */
+func Xsqlite3BeginTrigger(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 uintptr, tr_tm int32, op int32, pColumns uintptr, pTableName uintptr, pWhen uintptr, isTemp int32, noErr int32) { /* sqlite3.c:141059:21: */
bp := tls.Alloc(88)
defer tls.Free(88)
@@ -121301,7 +123220,7 @@ func Xsqlite3BeginTrigger(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2
if !((*Token)(unsafe.Pointer(pName2)).Fn > uint32(0)) {
goto __3
}
- Xsqlite3ErrorMsg(tls, pParse, ts+18285 /* "temporary trigge..." */, 0)
+ Xsqlite3ErrorMsg(tls, pParse, ts+19582 /* "temporary trigge..." */, 0)
goto trigger_cleanup
__3:
;
@@ -121319,7 +123238,7 @@ __4:
;
__2:
;
- if !(!(pTableName != 0) || ((*Sqlite3)(unsafe.Pointer(db)).FmallocFailed != 0)) {
+ if !(!(pTableName != 0) || (*Sqlite3)(unsafe.Pointer(db)).FmallocFailed != 0) {
goto __5
}
goto trigger_cleanup
@@ -121333,11 +123252,11 @@ __5:
//
// To maintain backwards compatibility, ignore the database
// name on pTableName if we are reparsing out of the schema table
- if !(((*Sqlite3)(unsafe.Pointer(db)).Finit.Fbusy != 0) && (iDb != 1)) {
+ if !((*Sqlite3)(unsafe.Pointer(db)).Finit.Fbusy != 0 && iDb != 1) {
goto __6
}
- Xsqlite3DbFree(tls, db, (*SrcItem)(unsafe.Pointer((pTableName + 8 /* &.a */))).FzDatabase)
- (*SrcItem)(unsafe.Pointer((pTableName + 8 /* &.a */))).FzDatabase = uintptr(0)
+ Xsqlite3DbFree(tls, db, (*SrcItem)(unsafe.Pointer(pTableName+8)).FzDatabase)
+ (*SrcItem)(unsafe.Pointer(pTableName + 8)).FzDatabase = uintptr(0)
__6:
;
@@ -121346,8 +123265,8 @@ __6:
// If sqlite3SrcListLookup() returns 0, indicating the table does not
// exist, the error is caught by the block below.
pTab = Xsqlite3SrcListLookup(tls, pParse, pTableName)
- if !((((int32((*Sqlite3)(unsafe.Pointer(db)).Finit.Fbusy) == 0) && ((*Token)(unsafe.Pointer(pName2)).Fn == uint32(0))) && (pTab != 0)) &&
- ((*Table)(unsafe.Pointer(pTab)).FpSchema == (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+1*16)).FpSchema)) {
+ if !(int32((*Sqlite3)(unsafe.Pointer(db)).Finit.Fbusy) == 0 && (*Token)(unsafe.Pointer(pName2)).Fn == uint32(0) && pTab != 0 &&
+ (*Table)(unsafe.Pointer(pTab)).FpSchema == (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+1*16)).FpSchema) {
goto __7
}
iDb = 1
@@ -121362,25 +123281,25 @@ __7:
__8:
;
- Xsqlite3FixInit(tls, bp+36 /* &sFix */, pParse, iDb, ts+18331 /* "trigger" */, *(*uintptr)(unsafe.Pointer(bp + 32 /* pName */)))
- if !(Xsqlite3FixSrcList(tls, bp+36 /* &sFix */, pTableName) != 0) {
+ Xsqlite3FixInit(tls, bp+36 /* &sFix */, pParse, iDb, ts+19628 /* "trigger" */, *(*uintptr)(unsafe.Pointer(bp + 32 /* pName */)))
+ if !(Xsqlite3FixSrcList(tls, bp+36, pTableName) != 0) {
goto __9
}
goto trigger_cleanup
__9:
;
pTab = Xsqlite3SrcListLookup(tls, pParse, pTableName)
- if !(!(pTab != 0)) {
+ if !!(pTab != 0) {
goto __10
}
// The table does not exist.
goto trigger_orphan_error
__10:
;
- if !((*Table)(unsafe.Pointer(pTab)).FnModuleArg != 0) {
+ if !(int32((*Table)(unsafe.Pointer(pTab)).FeTabType) == TABTYP_VTAB) {
goto __11
}
- Xsqlite3ErrorMsg(tls, pParse, ts+18339 /* "cannot create tr..." */, 0)
+ Xsqlite3ErrorMsg(tls, pParse, ts+19636 /* "cannot create tr..." */, 0)
goto trigger_orphan_error
__11:
;
@@ -121395,23 +123314,23 @@ __11:
goto trigger_cleanup
__12:
;
- if !(Xsqlite3CheckObjectName(tls, pParse, zName, ts+18331 /* "trigger" */, (*Table)(unsafe.Pointer(pTab)).FzName) != 0) {
+ if !(Xsqlite3CheckObjectName(tls, pParse, zName, ts+19628, (*Table)(unsafe.Pointer(pTab)).FzName) != 0) {
goto __13
}
goto trigger_cleanup
__13:
;
- if !(!(int32((*Parse)(unsafe.Pointer(pParse)).FeParseMode) >= PARSE_MODE_RENAME)) {
+ if !!(int32((*Parse)(unsafe.Pointer(pParse)).FeParseMode) >= PARSE_MODE_RENAME) {
goto __14
}
- if !(Xsqlite3HashFind(tls, ((*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+uintptr(iDb)*16)).FpSchema+40 /* &.trigHash */), zName) != 0) {
+ if !(Xsqlite3HashFind(tls, (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+uintptr(iDb)*16)).FpSchema+40, zName) != 0) {
goto __15
}
- if !(!(noErr != 0)) {
+ if !!(noErr != 0) {
goto __16
}
- Xsqlite3ErrorMsg(tls, pParse, ts+18380 /* "trigger %T alrea..." */, libc.VaList(bp, *(*uintptr)(unsafe.Pointer(bp + 32 /* pName */))))
+ Xsqlite3ErrorMsg(tls, pParse, ts+19677 /* "trigger %T alrea..." */, libc.VaList(bp, *(*uintptr)(unsafe.Pointer(bp + 32 /* pName */))))
goto __17
__16:
;
@@ -121425,39 +123344,39 @@ __14:
;
// Do not create a trigger on a system table
- if !(Xsqlite3_strnicmp(tls, (*Table)(unsafe.Pointer(pTab)).FzName, ts+7081 /* "sqlite_" */, 7) == 0) {
+ if !(Xsqlite3_strnicmp(tls, (*Table)(unsafe.Pointer(pTab)).FzName, ts+7997, 7) == 0) {
goto __18
}
- Xsqlite3ErrorMsg(tls, pParse, ts+18406 /* "cannot create tr..." */, 0)
+ Xsqlite3ErrorMsg(tls, pParse, ts+19703 /* "cannot create tr..." */, 0)
goto trigger_cleanup
__18:
;
// INSTEAD of triggers are only for views and views only support INSTEAD
// of triggers.
- if !(((*Table)(unsafe.Pointer(pTab)).FpSelect != 0) && (tr_tm != TK_INSTEAD)) {
+ if !(int32((*Table)(unsafe.Pointer(pTab)).FeTabType) == TABTYP_VIEW && tr_tm != TK_INSTEAD) {
goto __19
}
- Xsqlite3ErrorMsg(tls, pParse, ts+18444, /* "cannot create %s..." */
+ Xsqlite3ErrorMsg(tls, pParse, ts+19741, /* "cannot create %s..." */
libc.VaList(bp+8, func() uintptr {
if tr_tm == TK_BEFORE {
- return ts + 18481 /* "BEFORE" */
+ return ts + 19778 /* "BEFORE" */
}
- return ts + 18488 /* "AFTER" */
+ return ts + 19785 /* "AFTER" */
}(), pTableName+8 /* &.a */))
goto trigger_orphan_error
__19:
;
- if !(!(int32((*Table)(unsafe.Pointer(pTab)).FpSelect) != 0) && (tr_tm == TK_INSTEAD)) {
+ if !(!(int32((*Table)(unsafe.Pointer(pTab)).FeTabType) == TABTYP_VIEW) && tr_tm == TK_INSTEAD) {
goto __20
}
Xsqlite3ErrorMsg(tls, pParse,
- ts+18494 /* "cannot create IN..." */, libc.VaList(bp+24, pTableName+8 /* &.a */))
+ ts+19791 /* "cannot create IN..." */, libc.VaList(bp+24, pTableName+8))
goto trigger_orphan_error
__20:
;
- if !(!(int32((*Parse)(unsafe.Pointer(pParse)).FeParseMode) >= PARSE_MODE_RENAME)) {
+ if !!(int32((*Parse)(unsafe.Pointer(pParse)).FeParseMode) >= PARSE_MODE_RENAME) {
goto __21
}
iTabDb = Xsqlite3SchemaToIndex(tls, db, (*Table)(unsafe.Pointer(pTab)).FpSchema)
@@ -121468,7 +123387,7 @@ __20:
} else {
zDbTrig = zDb
}
- if !((iTabDb == 1) || (isTemp != 0)) {
+ if !(iTabDb == 1 || isTemp != 0) {
goto __22
}
code = SQLITE_CREATE_TEMP_TRIGGER
@@ -121481,10 +123400,10 @@ __22:
__23:
;
if !(Xsqlite3AuthCheck(tls, pParse, SQLITE_INSERT, func() uintptr {
- if (!(0 != 0)) && (iTabDb == 1) {
- return ts + 10872 /* "sqlite_temp_mast..." */
+ if !(0 != 0) && iTabDb == 1 {
+ return ts + 11986
}
- return ts + 4956 /* "sqlite_master" */
+ return ts + 5803
}(), uintptr(0), zDb) != 0) {
goto __24
}
@@ -121515,7 +123434,7 @@ __26:
;
(*Trigger)(unsafe.Pointer(pTrigger)).FzName = zName
zName = uintptr(0)
- (*Trigger)(unsafe.Pointer(pTrigger)).Ftable = Xsqlite3DbStrDup(tls, db, (*SrcItem)(unsafe.Pointer((pTableName + 8 /* &.a */))).FzName)
+ (*Trigger)(unsafe.Pointer(pTrigger)).Ftable = Xsqlite3DbStrDup(tls, db, (*SrcItem)(unsafe.Pointer(pTableName+8)).FzName)
(*Trigger)(unsafe.Pointer(pTrigger)).FpSchema = (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*16)).FpSchema
(*Trigger)(unsafe.Pointer(pTrigger)).FpTabSchema = (*Table)(unsafe.Pointer(pTab)).FpSchema
(*Trigger)(unsafe.Pointer(pTrigger)).Fop = U8(op)
@@ -121528,7 +123447,7 @@ __26:
if !(int32((*Parse)(unsafe.Pointer(pParse)).FeParseMode) >= PARSE_MODE_RENAME) {
goto __27
}
- Xsqlite3RenameTokenRemap(tls, pParse, (*Trigger)(unsafe.Pointer(pTrigger)).Ftable, (*SrcItem)(unsafe.Pointer((pTableName + 8 /* &.a */))).FzName)
+ Xsqlite3RenameTokenRemap(tls, pParse, (*Trigger)(unsafe.Pointer(pTrigger)).Ftable, (*SrcItem)(unsafe.Pointer(pTableName+8)).FzName)
(*Trigger)(unsafe.Pointer(pTrigger)).FpWhen = pWhen
pWhen = uintptr(0)
goto __28
@@ -121546,7 +123465,7 @@ trigger_cleanup:
Xsqlite3SrcListDelete(tls, db, pTableName)
Xsqlite3IdListDelete(tls, db, pColumns)
Xsqlite3ExprDelete(tls, db, pWhen)
- if !(!(int32((*Parse)(unsafe.Pointer(pParse)).FpNewTrigger) != 0)) {
+ if !!(int32((*Parse)(unsafe.Pointer(pParse)).FpNewTrigger) != 0) {
goto __29
}
Xsqlite3DeleteTrigger(tls, db, pTrigger)
@@ -121570,7 +123489,7 @@ trigger_orphan_error:
// "orphaned trigger" - a trigger whose associated table is missing.
//
// 2020-11-05 see also https://sqlite.org/forum/forumpost/157dc791df
- libc.SetBitFieldPtr8Uint32(db+164 /* &.init */ +8 /* &.orphanTrigger */, uint32(1), 0, 0x1)
+ libc.SetBitFieldPtr8Uint32(db+172+8, uint32(1), 0, 0x1)
__31:
;
goto trigger_cleanup
@@ -121578,7 +123497,7 @@ __31:
// This routine is called after all of the trigger actions have been parsed
// in order to complete the process of building the trigger.
-func Xsqlite3FinishTrigger(tls *libc.TLS, pParse uintptr, pStepList uintptr, pAll uintptr) { /* sqlite3.c:139985:21: */
+func Xsqlite3FinishTrigger(tls *libc.TLS, pParse uintptr, pStepList uintptr, pAll uintptr) { /* sqlite3.c:141266:21: */
bp := tls.Alloc(100)
defer tls.Free(100)
@@ -121599,7 +123518,7 @@ func Xsqlite3FinishTrigger(tls *libc.TLS, pParse uintptr, pStepList uintptr, pAl
db = (*Parse)(unsafe.Pointer(pParse)).Fdb // Trigger name for error reporting
(*Parse)(unsafe.Pointer(pParse)).FpNewTrigger = uintptr(0)
- if !(((*Parse)(unsafe.Pointer(pParse)).FnErr != 0) || !(pTrig != 0)) {
+ if !((*Parse)(unsafe.Pointer(pParse)).FnErr != 0 || !(pTrig != 0)) {
goto __1
}
goto triggerfinish_cleanup
@@ -121618,9 +123537,9 @@ __2:
__3:
;
Xsqlite3TokenInit(tls, bp+40 /* &nameToken */, (*Trigger)(unsafe.Pointer(pTrig)).FzName)
- Xsqlite3FixInit(tls, bp+48 /* &sFix */, pParse, iDb, ts+18331 /* "trigger" */, bp+40 /* &nameToken */)
- if !((Xsqlite3FixTriggerStep(tls, bp+48 /* &sFix */, (*Trigger)(unsafe.Pointer(pTrig)).Fstep_list) != 0) ||
- (Xsqlite3FixExpr(tls, bp+48 /* &sFix */, (*Trigger)(unsafe.Pointer(pTrig)).FpWhen) != 0)) {
+ Xsqlite3FixInit(tls, bp+48 /* &sFix */, pParse, iDb, ts+19628 /* "trigger" */, bp+40 /* &nameToken */)
+ if !(Xsqlite3FixTriggerStep(tls, bp+48, (*Trigger)(unsafe.Pointer(pTrig)).Fstep_list) != 0 ||
+ Xsqlite3FixExpr(tls, bp+48, (*Trigger)(unsafe.Pointer(pTrig)).FpWhen) != 0) {
goto __4
}
goto triggerfinish_cleanup
@@ -121638,7 +123557,7 @@ __5:
// if we are not initializing,
// build the sqlite_schema entry
- if !(!(int32((*Sqlite3)(unsafe.Pointer(db)).Finit.Fbusy) != 0)) {
+ if !!(int32((*Sqlite3)(unsafe.Pointer(db)).Finit.Fbusy) != 0) {
goto __7
}
@@ -121655,13 +123574,13 @@ __8:
Xsqlite3NestedParse(tls, pParse,
- ts+18540, /* "INSERT INTO %Q.s..." */
+ ts+19837, /* "INSERT INTO %Q.s..." */
libc.VaList(bp, (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+uintptr(iDb)*16)).FzDbSName, zName,
(*Trigger)(unsafe.Pointer(pTrig)).Ftable, z))
Xsqlite3DbFree(tls, db, z)
Xsqlite3ChangeCookie(tls, pParse, iDb)
Xsqlite3VdbeAddParseSchemaOp(tls, v, iDb,
- Xsqlite3MPrintf(tls, db, ts+18615 /* "type='trigger' A..." */, libc.VaList(bp+32, zName)), uint16(0))
+ Xsqlite3MPrintf(tls, db, ts+19912 /* "type='trigger' A..." */, libc.VaList(bp+32, zName)), uint16(0))
__7:
;
__6:
@@ -121671,7 +123590,7 @@ __6:
goto __9
}
pLink = pTrig
- pHash = ((*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+uintptr(iDb)*16)).FpSchema + 40 /* &.trigHash */)
+ pHash = (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+uintptr(iDb)*16)).FpSchema + 40
pTrig = Xsqlite3HashInsert(tls, pHash, zName, pTrig)
if !(pTrig != 0) {
@@ -121683,7 +123602,7 @@ __10:
if !((*Trigger)(unsafe.Pointer(pLink)).FpSchema == (*Trigger)(unsafe.Pointer(pLink)).FpTabSchema) {
goto __12
}
- pTab = Xsqlite3HashFind(tls, ((*Trigger)(unsafe.Pointer(pLink)).FpTabSchema + 8 /* &.tblHash */), (*Trigger)(unsafe.Pointer(pLink)).Ftable)
+ pTab = Xsqlite3HashFind(tls, (*Trigger)(unsafe.Pointer(pLink)).FpTabSchema+8, (*Trigger)(unsafe.Pointer(pLink)).Ftable)
(*Trigger)(unsafe.Pointer(pLink)).FpNext = (*Table)(unsafe.Pointer(pTab)).FpTrigger
(*Table)(unsafe.Pointer(pTab)).FpTrigger = pLink
@@ -121702,12 +123621,12 @@ triggerfinish_cleanup:
// Duplicate a range of text from an SQL statement, then convert all
// whitespace characters into ordinary space characters.
-func triggerSpanDup(tls *libc.TLS, db uintptr, zStart uintptr, zEnd uintptr) uintptr { /* sqlite3.c:140073:13: */
+func triggerSpanDup(tls *libc.TLS, db uintptr, zStart uintptr, zEnd uintptr) uintptr { /* sqlite3.c:141354:13: */
var z uintptr = Xsqlite3DbSpanDup(tls, db, zStart, zEnd)
var i int32
if z != 0 {
for i = 0; *(*uint8)(unsafe.Pointer(z + uintptr(i))) != 0; i++ {
- if (int32(Xsqlite3CtypeMap[uint8(*(*uint8)(unsafe.Pointer(z + uintptr(i))))]) & 0x01) != 0 {
+ if int32(Xsqlite3CtypeMap[uint8(*(*uint8)(unsafe.Pointer(z + uintptr(i))))])&0x01 != 0 {
*(*uint8)(unsafe.Pointer(z + uintptr(i))) = uint8(' ')
}
}
@@ -121720,7 +123639,7 @@ func triggerSpanDup(tls *libc.TLS, db uintptr, zStart uintptr, zEnd uintptr) uin
//
// The parser calls this routine when it finds a SELECT statement in
// body of a TRIGGER.
-func Xsqlite3TriggerSelectStep(tls *libc.TLS, db uintptr, pSelect uintptr, zStart uintptr, zEnd uintptr) uintptr { /* sqlite3.c:140087:28: */
+func Xsqlite3TriggerSelectStep(tls *libc.TLS, db uintptr, pSelect uintptr, zStart uintptr, zEnd uintptr) uintptr { /* sqlite3.c:141368:28: */
var pTriggerStep uintptr = Xsqlite3DbMallocZero(tls, db, uint64(unsafe.Sizeof(TriggerStep{})))
if pTriggerStep == uintptr(0) {
Xsqlite3SelectDelete(tls, db, pSelect)
@@ -121737,13 +123656,13 @@ func Xsqlite3TriggerSelectStep(tls *libc.TLS, db uintptr, pSelect uintptr, zStar
// holds both the TriggerStep object and the TriggerStep.target.z string.
//
// If an OOM error occurs, NULL is returned and db->mallocFailed is set.
-func triggerStepAllocate(tls *libc.TLS, pParse uintptr, op U8, pName uintptr, zStart uintptr, zEnd uintptr) uintptr { /* sqlite3.c:140111:20: */
+func triggerStepAllocate(tls *libc.TLS, pParse uintptr, op U8, pName uintptr, zStart uintptr, zEnd uintptr) uintptr { /* sqlite3.c:141392:20: */
var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb
var pTriggerStep uintptr
- pTriggerStep = Xsqlite3DbMallocZero(tls, db, (uint64((uint32(unsafe.Sizeof(TriggerStep{})) + (*Token)(unsafe.Pointer(pName)).Fn) + uint32(1))))
+ pTriggerStep = Xsqlite3DbMallocZero(tls, db, uint64(uint32(unsafe.Sizeof(TriggerStep{}))+(*Token)(unsafe.Pointer(pName)).Fn+uint32(1)))
if pTriggerStep != 0 {
- var z uintptr = (pTriggerStep + 1*48)
+ var z uintptr = pTriggerStep + 1*48
libc.Xmemcpy(tls, z, (*Token)(unsafe.Pointer(pName)).Fz, (*Token)(unsafe.Pointer(pName)).Fn)
Xsqlite3Dequote(tls, z)
(*TriggerStep)(unsafe.Pointer(pTriggerStep)).FzTarget = z
@@ -121761,7 +123680,7 @@ func triggerStepAllocate(tls *libc.TLS, pParse uintptr, op U8, pName uintptr, zS
//
// The parser calls this routine when it sees an INSERT inside the
// body of a trigger.
-func Xsqlite3TriggerInsertStep(tls *libc.TLS, pParse uintptr, pTableName uintptr, pColumn uintptr, pSelect uintptr, orconf U8, pUpsert uintptr, zStart uintptr, zEnd uintptr) uintptr { /* sqlite3.c:140143:28: */
+func Xsqlite3TriggerInsertStep(tls *libc.TLS, pParse uintptr, pTableName uintptr, pColumn uintptr, pSelect uintptr, orconf U8, pUpsert uintptr, zStart uintptr, zEnd uintptr) uintptr { /* sqlite3.c:141424:28: */
var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb
var pTriggerStep uintptr
@@ -121793,7 +123712,7 @@ func Xsqlite3TriggerInsertStep(tls *libc.TLS, pParse uintptr, pTableName uintptr
// Construct a trigger step that implements an UPDATE statement and return
// a pointer to that trigger step. The parser calls this routine when it
// sees an UPDATE statement inside the body of a CREATE TRIGGER.
-func Xsqlite3TriggerUpdateStep(tls *libc.TLS, pParse uintptr, pTableName uintptr, pFrom uintptr, pEList uintptr, pWhere uintptr, orconf U8, zStart uintptr, zEnd uintptr) uintptr { /* sqlite3.c:140188:28: */
+func Xsqlite3TriggerUpdateStep(tls *libc.TLS, pParse uintptr, pTableName uintptr, pFrom uintptr, pEList uintptr, pWhere uintptr, orconf U8, zStart uintptr, zEnd uintptr) uintptr { /* sqlite3.c:141469:28: */
var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb
var pTriggerStep uintptr
@@ -121822,7 +123741,7 @@ func Xsqlite3TriggerUpdateStep(tls *libc.TLS, pParse uintptr, pTableName uintptr
// Construct a trigger step that implements a DELETE statement and return
// a pointer to that trigger step. The parser calls this routine when it
// sees a DELETE statement inside the body of a CREATE TRIGGER.
-func Xsqlite3TriggerDeleteStep(tls *libc.TLS, pParse uintptr, pTableName uintptr, pWhere uintptr, zStart uintptr, zEnd uintptr) uintptr { /* sqlite3.c:140228:28: */
+func Xsqlite3TriggerDeleteStep(tls *libc.TLS, pParse uintptr, pTableName uintptr, pWhere uintptr, zStart uintptr, zEnd uintptr) uintptr { /* sqlite3.c:141509:28: */
var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb
var pTriggerStep uintptr
@@ -121841,8 +123760,8 @@ func Xsqlite3TriggerDeleteStep(tls *libc.TLS, pParse uintptr, pTableName uintptr
}
// Recursively delete a Trigger structure
-func Xsqlite3DeleteTrigger(tls *libc.TLS, db uintptr, pTrigger uintptr) { /* sqlite3.c:140255:21: */
- if (pTrigger == uintptr(0)) || ((*Trigger)(unsafe.Pointer(pTrigger)).FbReturning != 0) {
+func Xsqlite3DeleteTrigger(tls *libc.TLS, db uintptr, pTrigger uintptr) { /* sqlite3.c:141536:21: */
+ if pTrigger == uintptr(0) || (*Trigger)(unsafe.Pointer(pTrigger)).FbReturning != 0 {
return
}
Xsqlite3DeleteTriggerStep(tls, db, (*Trigger)(unsafe.Pointer(pTrigger)).Fstep_list)
@@ -121861,7 +123780,7 @@ func Xsqlite3DeleteTrigger(tls *libc.TLS, db uintptr, pTrigger uintptr) { /* sql
// same job as this routine except it takes a pointer to the trigger
// instead of the trigger name.
//
-func Xsqlite3DropTrigger(tls *libc.TLS, pParse uintptr, pName uintptr, noErr int32) { /* sqlite3.c:140273:21: */
+func Xsqlite3DropTrigger(tls *libc.TLS, pParse uintptr, pName uintptr, noErr int32) { /* sqlite3.c:141554:21: */
bp := tls.Alloc(8)
defer tls.Free(8)
@@ -121887,8 +123806,8 @@ __1:
__2:
;
- zDb = (*SrcItem)(unsafe.Pointer((pName + 8 /* &.a */))).FzDatabase
- zName = (*SrcItem)(unsafe.Pointer((pName + 8 /* &.a */))).FzName
+ zDb = (*SrcItem)(unsafe.Pointer(pName + 8)).FzDatabase
+ zName = (*SrcItem)(unsafe.Pointer(pName + 8)).FzName
i = OMIT_TEMPDB
__3:
@@ -121896,18 +123815,18 @@ __3:
goto __5
}
if i < 2 {
- j = (i ^ 1)
+ j = i ^ 1
} else {
j = i
} // Search TEMP before MAIN
- if !((zDb != 0) && (Xsqlite3DbIsNamed(tls, db, j, zDb) == 0)) {
+ if !(zDb != 0 && Xsqlite3DbIsNamed(tls, db, j, zDb) == 0) {
goto __6
}
goto __4
__6:
;
- pTrigger = Xsqlite3HashFind(tls, ((*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+uintptr(j)*16)).FpSchema + 40 /* &.trigHash */), zName)
+ pTrigger = Xsqlite3HashFind(tls, (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+uintptr(j)*16)).FpSchema+40, zName)
if !(pTrigger != 0) {
goto __7
}
@@ -121921,13 +123840,13 @@ __4:
goto __5
__5:
;
- if !(!(pTrigger != 0)) {
+ if !!(pTrigger != 0) {
goto __8
}
- if !(!(noErr != 0)) {
+ if !!(noErr != 0) {
goto __9
}
- Xsqlite3ErrorMsg(tls, pParse, ts+18644 /* "no such trigger:..." */, libc.VaList(bp, pName+8 /* &.a */))
+ Xsqlite3ErrorMsg(tls, pParse, ts+19941 /* "no such trigger:..." */, libc.VaList(bp, pName+8))
goto __10
__9:
Xsqlite3CodeVerifyNamedSchema(tls, pParse, zDb)
@@ -121945,12 +123864,12 @@ drop_trigger_cleanup:
// Return a pointer to the Table structure for the table that a trigger
// is set on.
-func tableOfTrigger(tls *libc.TLS, pTrigger uintptr) uintptr { /* sqlite3.c:140315:14: */
- return Xsqlite3HashFind(tls, ((*Trigger)(unsafe.Pointer(pTrigger)).FpTabSchema + 8 /* &.tblHash */), (*Trigger)(unsafe.Pointer(pTrigger)).Ftable)
+func tableOfTrigger(tls *libc.TLS, pTrigger uintptr) uintptr { /* sqlite3.c:141596:14: */
+ return Xsqlite3HashFind(tls, (*Trigger)(unsafe.Pointer(pTrigger)).FpTabSchema+8, (*Trigger)(unsafe.Pointer(pTrigger)).Ftable)
}
// Drop a trigger given a pointer to that trigger.
-func Xsqlite3DropTriggerPtr(tls *libc.TLS, pParse uintptr, pTrigger uintptr) { /* sqlite3.c:140323:21: */
+func Xsqlite3DropTriggerPtr(tls *libc.TLS, pParse uintptr, pTrigger uintptr) { /* sqlite3.c:141604:21: */
bp := tls.Alloc(16)
defer tls.Free(16)
@@ -121967,23 +123886,23 @@ func Xsqlite3DropTriggerPtr(tls *libc.TLS, pParse uintptr, pTrigger uintptr) { /
var code int32 = SQLITE_DROP_TRIGGER
var zDb uintptr = (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*16)).FzDbSName
var zTab uintptr = func() uintptr {
- if (!(0 != 0)) && (iDb == 1) {
- return ts + 10872 /* "sqlite_temp_mast..." */
+ if !(0 != 0) && iDb == 1 {
+ return ts + 11986
}
- return ts + 4956 /* "sqlite_master" */
+ return ts + 5803
}()
if iDb == 1 {
code = SQLITE_DROP_TEMP_TRIGGER
}
- if (Xsqlite3AuthCheck(tls, pParse, code, (*Trigger)(unsafe.Pointer(pTrigger)).FzName, (*Table)(unsafe.Pointer(pTable)).FzName, zDb) != 0) || (Xsqlite3AuthCheck(tls, pParse, SQLITE_DELETE, zTab, uintptr(0), zDb) != 0) {
+ if Xsqlite3AuthCheck(tls, pParse, code, (*Trigger)(unsafe.Pointer(pTrigger)).FzName, (*Table)(unsafe.Pointer(pTable)).FzName, zDb) != 0 || Xsqlite3AuthCheck(tls, pParse, SQLITE_DELETE, zTab, uintptr(0), zDb) != 0 {
return
}
}
// Generate code to destroy the database record of the trigger.
- if (libc.AssignUintptr(&v, Xsqlite3GetVdbe(tls, pParse))) != uintptr(0) {
+ if libc.AssignUintptr(&v, Xsqlite3GetVdbe(tls, pParse)) != uintptr(0) {
Xsqlite3NestedParse(tls, pParse,
- ts+18664, /* "DELETE FROM %Q.s..." */
+ ts+19961, /* "DELETE FROM %Q.s..." */
libc.VaList(bp, (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+uintptr(iDb)*16)).FzDbSName, (*Trigger)(unsafe.Pointer(pTrigger)).FzName))
Xsqlite3ChangeCookie(tls, pParse, iDb)
Xsqlite3VdbeAddOp4(tls, v, OP_DropTrigger, iDb, 0, 0, (*Trigger)(unsafe.Pointer(pTrigger)).FzName, 0)
@@ -121991,18 +123910,18 @@ func Xsqlite3DropTriggerPtr(tls *libc.TLS, pParse uintptr, pTrigger uintptr) { /
}
// Remove a trigger from the hash tables of the sqlite* pointer.
-func Xsqlite3UnlinkAndDeleteTrigger(tls *libc.TLS, db uintptr, iDb int32, zName uintptr) { /* sqlite3.c:140361:21: */
+func Xsqlite3UnlinkAndDeleteTrigger(tls *libc.TLS, db uintptr, iDb int32, zName uintptr) { /* sqlite3.c:141642:21: */
var pTrigger uintptr
var pHash uintptr
- pHash = ((*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+uintptr(iDb)*16)).FpSchema + 40 /* &.trigHash */)
+ pHash = (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+uintptr(iDb)*16)).FpSchema + 40
pTrigger = Xsqlite3HashInsert(tls, pHash, zName, uintptr(0))
if pTrigger != 0 {
if (*Trigger)(unsafe.Pointer(pTrigger)).FpSchema == (*Trigger)(unsafe.Pointer(pTrigger)).FpTabSchema {
var pTab uintptr = tableOfTrigger(tls, pTrigger)
if pTab != 0 {
var pp uintptr
- for pp = (pTab + 68 /* &.pTrigger */); *(*uintptr)(unsafe.Pointer(pp)) != 0; pp = (*(*uintptr)(unsafe.Pointer(pp)) + 32 /* &.pNext */) {
+ for pp = pTab + 56; *(*uintptr)(unsafe.Pointer(pp)) != 0; pp = *(*uintptr)(unsafe.Pointer(pp)) + 32 {
if *(*uintptr)(unsafe.Pointer(pp)) == pTrigger {
*(*uintptr)(unsafe.Pointer(pp)) = (*Trigger)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pp)))).FpNext
break
@@ -122011,7 +123930,7 @@ func Xsqlite3UnlinkAndDeleteTrigger(tls *libc.TLS, db uintptr, iDb int32, zName
}
}
Xsqlite3DeleteTrigger(tls, db, pTrigger)
- *(*U32)(unsafe.Pointer(db + 24 /* &.mDbFlags */)) |= (U32(DBFLAG_SchemaChange))
+ *(*U32)(unsafe.Pointer(db + 24)) |= U32(DBFLAG_SchemaChange)
}
}
@@ -122022,13 +123941,13 @@ func Xsqlite3UnlinkAndDeleteTrigger(tls *libc.TLS, db uintptr, iDb int32, zName
// wildcard that matches anything. Likewise if pEList==NULL then
// it matches anything so always return true. Return false only
// if there is no match.
-func checkColumnOverlap(tls *libc.TLS, pIdList uintptr, pEList uintptr) int32 { /* sqlite3.c:140395:12: */
+func checkColumnOverlap(tls *libc.TLS, pIdList uintptr, pEList uintptr) int32 { /* sqlite3.c:141676:12: */
var e int32
- if (pIdList == uintptr(0)) || (pEList == uintptr(0)) {
+ if pIdList == uintptr(0) || pEList == uintptr(0) {
return 1
}
for e = 0; e < (*ExprList)(unsafe.Pointer(pEList)).FnExpr; e++ {
- if Xsqlite3IdListIndex(tls, pIdList, (*ExprList_item)(unsafe.Pointer((pEList+8 /* &.a */)+uintptr(e)*20)).FzEName) >= 0 {
+ if Xsqlite3IdListIndex(tls, pIdList, (*ExprList_item)(unsafe.Pointer(pEList+8+uintptr(e)*20)).FzEName) >= 0 {
return 1
}
}
@@ -122039,7 +123958,7 @@ func checkColumnOverlap(tls *libc.TLS, pIdList uintptr, pEList uintptr) int32 {
// one trigger that must be fired when an operation of type 'op' is
// performed on the table, and, if that operation is an UPDATE, if at
// least one of the columns in pChanges is being modified.
-func Xsqlite3TriggersExist(tls *libc.TLS, pParse uintptr, pTab uintptr, op int32, pChanges uintptr, pMask uintptr) uintptr { /* sqlite3.c:140410:24: */
+func Xsqlite3TriggersExist(tls *libc.TLS, pParse uintptr, pTab uintptr, op int32, pChanges uintptr, pMask uintptr) uintptr { /* sqlite3.c:141691:24: */
bp := tls.Alloc(8)
defer tls.Free(8)
@@ -122055,8 +123974,8 @@ func Xsqlite3TriggersExist(tls *libc.TLS, pParse uintptr, pTab uintptr, op int32
goto __1
}
p = pList
- if !((((*Sqlite3)(unsafe.Pointer((*Parse)(unsafe.Pointer(pParse)).Fdb)).Fflags & uint64(SQLITE_EnableTrigger)) == uint64(0)) &&
- ((*Table)(unsafe.Pointer(pTab)).FpTrigger != uintptr(0))) {
+ if !((*Sqlite3)(unsafe.Pointer((*Parse)(unsafe.Pointer(pParse)).Fdb)).Fflags&uint64(SQLITE_EnableTrigger) == uint64(0) &&
+ (*Table)(unsafe.Pointer(pTab)).FpTrigger != uintptr(0)) {
goto __2
}
// The SQLITE_DBCONFIG_ENABLE_TRIGGER setting is off. That means that
@@ -122070,7 +123989,7 @@ func Xsqlite3TriggersExist(tls *libc.TLS, pParse uintptr, pTab uintptr, op int32
__3:
;
__4:
- if !(((*Trigger)(unsafe.Pointer(p)).FpNext != 0) && ((*Trigger)(unsafe.Pointer(p)).FpNext != (*Table)(unsafe.Pointer(pTab)).FpTrigger)) {
+ if !((*Trigger)(unsafe.Pointer(p)).FpNext != 0 && (*Trigger)(unsafe.Pointer(p)).FpNext != (*Table)(unsafe.Pointer(pTab)).FpTrigger) {
goto __5
}
p = (*Trigger)(unsafe.Pointer(p)).FpNext
@@ -122082,10 +124001,10 @@ __5:
__2:
;
__6:
- if !((int32((*Trigger)(unsafe.Pointer(p)).Fop) == op) && (checkColumnOverlap(tls, (*Trigger)(unsafe.Pointer(p)).FpColumns, pChanges) != 0)) {
+ if !(int32((*Trigger)(unsafe.Pointer(p)).Fop) == op && checkColumnOverlap(tls, (*Trigger)(unsafe.Pointer(p)).FpColumns, pChanges) != 0) {
goto __9
}
- mask = mask | (int32((*Trigger)(unsafe.Pointer(p)).Ftr_tm))
+ mask = mask | int32((*Trigger)(unsafe.Pointer(p)).Ftr_tm)
goto __10
__9:
if !(int32((*Trigger)(unsafe.Pointer(p)).Fop) == TK_RETURNING) {
@@ -122095,19 +124014,19 @@ __9:
// us what time of trigger it should be.
(*Trigger)(unsafe.Pointer(p)).Fop = U8(op)
- if !((*Table)(unsafe.Pointer(pTab)).FnModuleArg != 0) {
+ if !(int32((*Table)(unsafe.Pointer(pTab)).FeTabType) == TABTYP_VTAB) {
goto __13
}
if !(op != TK_INSERT) {
goto __15
}
Xsqlite3ErrorMsg(tls, pParse,
- ts+18726, /* "%s RETURNING is ..." */
+ ts+20023, /* "%s RETURNING is ..." */
libc.VaList(bp, func() uintptr {
if op == TK_DELETE {
- return ts + 18774 /* "DELETE" */
+ return ts + 20071 /* "DELETE" */
}
- return ts + 18781 /* "UPDATE" */
+ return ts + 20078 /* "UPDATE" */
}()))
__15:
;
@@ -122117,15 +124036,15 @@ __13:
(*Trigger)(unsafe.Pointer(p)).Ftr_tm = U8(TRIGGER_AFTER)
__14:
;
- mask = mask | (int32((*Trigger)(unsafe.Pointer(p)).Ftr_tm))
+ mask = mask | int32((*Trigger)(unsafe.Pointer(p)).Ftr_tm)
goto __12
__11:
- if !(((((*Trigger)(unsafe.Pointer(p)).FbReturning != 0) && (int32((*Trigger)(unsafe.Pointer(p)).Fop) == TK_INSERT)) && (op == TK_UPDATE)) &&
- ((*Parse)(unsafe.Pointer((pParse))).FpToplevel == uintptr(0))) {
+ if !((*Trigger)(unsafe.Pointer(p)).FbReturning != 0 && int32((*Trigger)(unsafe.Pointer(p)).Fop) == TK_INSERT && op == TK_UPDATE &&
+ (*Parse)(unsafe.Pointer(pParse)).FpToplevel == uintptr(0)) {
goto __16
}
// Also fire a RETURNING trigger for an UPSERT
- mask = mask | (int32((*Trigger)(unsafe.Pointer(p)).Ftr_tm))
+ mask = mask | int32((*Trigger)(unsafe.Pointer(p)).Ftr_tm)
__16:
;
__12:
@@ -122166,7 +124085,7 @@ __17:
// referring to a target in another database. An exception is when the
// trigger is in TEMP in which case it can refer to any other database it
// wants.
-func Xsqlite3TriggerStepSrc(tls *libc.TLS, pParse uintptr, pStep uintptr) uintptr { /* sqlite3.c:140484:24: */
+func Xsqlite3TriggerStepSrc(tls *libc.TLS, pParse uintptr, pStep uintptr) uintptr { /* sqlite3.c:141765:24: */
var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb
var pSrc uintptr // SrcList to be returned
var zName uintptr = Xsqlite3DbStrDup(tls, db, (*TriggerStep)(unsafe.Pointer(pStep)).FzTarget)
@@ -122174,9 +124093,9 @@ func Xsqlite3TriggerStepSrc(tls *libc.TLS, pParse uintptr, pStep uintptr) uintpt
if pSrc != 0 {
var pSchema uintptr = (*Trigger)(unsafe.Pointer((*TriggerStep)(unsafe.Pointer(pStep)).FpTrig)).FpSchema
- (*SrcItem)(unsafe.Pointer((pSrc + 8 /* &.a */))).FzName = zName
+ (*SrcItem)(unsafe.Pointer(pSrc + 8)).FzName = zName
if pSchema != (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+1*16)).FpSchema {
- (*SrcItem)(unsafe.Pointer((pSrc + 8 /* &.a */))).FpSchema = pSchema
+ (*SrcItem)(unsafe.Pointer(pSrc + 8)).FpSchema = pSchema
}
if (*TriggerStep)(unsafe.Pointer(pStep)).FpFrom != 0 {
var pDup uintptr = Xsqlite3SrcListDup(tls, db, (*TriggerStep)(unsafe.Pointer(pStep)).FpFrom, 0)
@@ -122191,7 +124110,7 @@ func Xsqlite3TriggerStepSrc(tls *libc.TLS, pParse uintptr, pStep uintptr) uintpt
// Return true if the pExpr term from the RETURNING clause argument
// list is of the form "*". Raise an error if the terms if of the
// form "table.*".
-func isAsteriskTerm(tls *libc.TLS, pParse uintptr, pTerm uintptr) int32 { /* sqlite3.c:140515:12: */
+func isAsteriskTerm(tls *libc.TLS, pParse uintptr, pTerm uintptr) int32 { /* sqlite3.c:141796:12: */
if int32((*Expr)(unsafe.Pointer(pTerm)).Fop) == TK_ASTERISK {
return 1
@@ -122203,7 +124122,7 @@ func isAsteriskTerm(tls *libc.TLS, pParse uintptr, pTerm uintptr) int32 { /* sql
if int32((*Expr)(unsafe.Pointer((*Expr)(unsafe.Pointer(pTerm)).FpRight)).Fop) != TK_ASTERISK {
return 0
}
- Xsqlite3ErrorMsg(tls, pParse, ts+18788 /* "RETURNING may no..." */, 0)
+ Xsqlite3ErrorMsg(tls, pParse, ts+20085 /* "RETURNING may no..." */, 0)
return 1
}
@@ -122212,13 +124131,13 @@ func isAsteriskTerm(tls *libc.TLS, pParse uintptr, pTerm uintptr) int32 { /* sql
//
// This routine makes a copy of the pList, and at the same time expands
// any "*" wildcards to be the complete set of columns from pTab.
-func sqlite3ExpandReturning(tls *libc.TLS, pParse uintptr, pList uintptr, pTab uintptr) uintptr { /* sqlite3.c:140535:17: */
+func sqlite3ExpandReturning(tls *libc.TLS, pParse uintptr, pList uintptr, pTab uintptr) uintptr { /* sqlite3.c:141816:17: */
var pNew uintptr = uintptr(0)
var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb
var i int32
for i = 0; i < (*ExprList)(unsafe.Pointer(pList)).FnExpr; i++ {
- var pOldExpr uintptr = (*ExprList_item)(unsafe.Pointer((pList + 8 /* &.a */) + uintptr(i)*20)).FpExpr
+ var pOldExpr uintptr = (*ExprList_item)(unsafe.Pointer(pList + 8 + uintptr(i)*20)).FpExpr
if pOldExpr == uintptr(0) {
continue
}
@@ -122226,24 +124145,24 @@ func sqlite3ExpandReturning(tls *libc.TLS, pParse uintptr, pList uintptr, pTab u
var jj int32
for jj = 0; jj < int32((*Table)(unsafe.Pointer(pTab)).FnCol); jj++ {
var pNewExpr uintptr
- if (int32((*Column)(unsafe.Pointer(((*Table)(unsafe.Pointer(pTab)).FaCol + uintptr(jj)*20))).FcolFlags) & COLFLAG_HIDDEN) != 0 {
+ if int32((*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FaCol+uintptr(jj)*16)).FcolFlags)&COLFLAG_HIDDEN != 0 {
continue
}
- pNewExpr = Xsqlite3Expr(tls, db, TK_ID, (*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FaCol+uintptr(jj)*20)).FzName)
+ pNewExpr = Xsqlite3Expr(tls, db, TK_ID, (*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FaCol+uintptr(jj)*16)).FzCnName)
pNew = Xsqlite3ExprListAppend(tls, pParse, pNew, pNewExpr)
if !(int32((*Sqlite3)(unsafe.Pointer(db)).FmallocFailed) != 0) {
- var pItem uintptr = ((pNew + 8 /* &.a */) + uintptr(((*ExprList)(unsafe.Pointer(pNew)).FnExpr-1))*20)
- (*ExprList_item)(unsafe.Pointer(pItem)).FzEName = Xsqlite3DbStrDup(tls, db, (*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FaCol+uintptr(jj)*20)).FzName)
- libc.SetBitFieldPtr8Uint32(pItem+12 /* &.eEName */, uint32(ENAME_NAME), 0, 0x3)
+ var pItem uintptr = pNew + 8 + uintptr((*ExprList)(unsafe.Pointer(pNew)).FnExpr-1)*20
+ (*ExprList_item)(unsafe.Pointer(pItem)).FzEName = Xsqlite3DbStrDup(tls, db, (*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FaCol+uintptr(jj)*16)).FzCnName)
+ libc.SetBitFieldPtr8Uint32(pItem+12, uint32(ENAME_NAME), 0, 0x3)
}
}
} else {
var pNewExpr uintptr = Xsqlite3ExprDup(tls, db, pOldExpr, 0)
pNew = Xsqlite3ExprListAppend(tls, pParse, pNew, pNewExpr)
- if !(int32((*Sqlite3)(unsafe.Pointer(db)).FmallocFailed) != 0) && ((*ExprList_item)(unsafe.Pointer((pList+8 /* &.a */)+uintptr(i)*20)).FzEName != uintptr(0)) {
- var pItem uintptr = ((pNew + 8 /* &.a */) + uintptr(((*ExprList)(unsafe.Pointer(pNew)).FnExpr-1))*20)
- (*ExprList_item)(unsafe.Pointer(pItem)).FzEName = Xsqlite3DbStrDup(tls, db, (*ExprList_item)(unsafe.Pointer((pList+8 /* &.a */)+uintptr(i)*20)).FzEName)
- libc.SetBitFieldPtr8Uint32(pItem+12 /* &.eEName */, (uint32(int32(*(*uint8)(unsafe.Pointer((pList + 8 /* &.a */) + uintptr(i)*20 + 12 /* &.eEName */)) & 0x3 >> 0))), 0, 0x3)
+ if !(int32((*Sqlite3)(unsafe.Pointer(db)).FmallocFailed) != 0) && (*ExprList_item)(unsafe.Pointer(pList+8+uintptr(i)*20)).FzEName != uintptr(0) {
+ var pItem uintptr = pNew + 8 + uintptr((*ExprList)(unsafe.Pointer(pNew)).FnExpr-1)*20
+ (*ExprList_item)(unsafe.Pointer(pItem)).FzEName = Xsqlite3DbStrDup(tls, db, (*ExprList_item)(unsafe.Pointer(pList+8+uintptr(i)*20)).FzEName)
+ libc.SetBitFieldPtr8Uint32(pItem+12, uint32(int32(*(*uint8)(unsafe.Pointer(pList + 8 + uintptr(i)*20 + 12))&0x3>>0)), 0, 0x3)
}
}
}
@@ -122253,7 +124172,7 @@ func sqlite3ExpandReturning(tls *libc.TLS, pParse uintptr, pList uintptr, pTab u
// Generate code for the RETURNING trigger. Unlike other triggers
// that invoke a subprogram in the bytecode, the code for RETURNING
// is generated in-line.
-func codeReturningTrigger(tls *libc.TLS, pParse uintptr, pTrigger uintptr, pTab uintptr, regIn int32) { /* sqlite3.c:140578:13: */
+func codeReturningTrigger(tls *libc.TLS, pParse uintptr, pTrigger uintptr, pTab uintptr, regIn int32) { /* sqlite3.c:141859:13: */
bp := tls.Alloc(192)
defer tls.Free(192)
@@ -122265,16 +124184,17 @@ func codeReturningTrigger(tls *libc.TLS, pParse uintptr, pTrigger uintptr, pTab
// var sFrom SrcList at bp+80, 80
- pReturning = *(*uintptr)(unsafe.Pointer(pParse + 128 /* &.u1 */))
+ pReturning = *(*uintptr)(unsafe.Pointer(pParse + 124))
libc.Xmemset(tls, bp /* &sSelect */, 0, uint32(unsafe.Sizeof(Select{})))
libc.Xmemset(tls, bp+80 /* &sFrom */, 0, uint32(unsafe.Sizeof(SrcList{})))
(*Select)(unsafe.Pointer(bp /* &sSelect */)).FpEList = Xsqlite3ExprListDup(tls, db, (*Returning)(unsafe.Pointer(pReturning)).FpReturnEL, 0)
(*Select)(unsafe.Pointer(bp /* &sSelect */)).FpSrc = bp + 80 /* &sFrom */
(*SrcList)(unsafe.Pointer(bp + 80 /* &sFrom */)).FnSrc = 1
- (*SrcItem)(unsafe.Pointer((bp + 80 /* &sFrom */ + 8 /* &.a */))).FpTab = pTab
+ (*SrcItem)(unsafe.Pointer(bp + 80 + 8)).FpTab = pTab
+ (*SrcItem)(unsafe.Pointer(bp + 80 + 8)).FiCursor = -1
Xsqlite3SelectPrep(tls, pParse, bp /* &sSelect */, uintptr(0))
- if (int32((*Sqlite3)(unsafe.Pointer(db)).FmallocFailed) == 0) && ((*Parse)(unsafe.Pointer(pParse)).FnErr == 0) {
+ if int32((*Sqlite3)(unsafe.Pointer(db)).FmallocFailed) == 0 && (*Parse)(unsafe.Pointer(pParse)).FnErr == 0 {
Xsqlite3GenerateColumnNames(tls, pParse, bp /* &sSelect */)
}
Xsqlite3ExprListDelete(tls, db, (*Select)(unsafe.Pointer(bp /* &sSelect */)).FpEList)
@@ -122288,23 +124208,23 @@ func codeReturningTrigger(tls *libc.TLS, pParse uintptr, pTrigger uintptr, pTab
(*Returning)(unsafe.Pointer(pReturning)).FiRetCur = libc.PostIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnTab, 1)
}
(*NameContext)(unsafe.Pointer(bp + 160 /* &sNC */)).FpParse = pParse
- *(*int32)(unsafe.Pointer(bp + 160 /* &sNC */ + 8 /* &.uNC */)) = regIn
+ *(*int32)(unsafe.Pointer(bp + 160 + 8)) = regIn
(*NameContext)(unsafe.Pointer(bp + 160 /* &sNC */)).FncFlags = NC_UBaseReg
(*Parse)(unsafe.Pointer(pParse)).FeTriggerOp = (*Trigger)(unsafe.Pointer(pTrigger)).Fop
(*Parse)(unsafe.Pointer(pParse)).FpTriggerTab = pTab
- if Xsqlite3ResolveExprListNames(tls, bp+160 /* &sNC */, pNew) == SQLITE_OK {
+ if Xsqlite3ResolveExprListNames(tls, bp+160, pNew) == SQLITE_OK {
var i int32
var nCol int32 = (*ExprList)(unsafe.Pointer(pNew)).FnExpr
- var reg int32 = ((*Parse)(unsafe.Pointer(pParse)).FnMem + 1)
- *(*int32)(unsafe.Pointer(pParse + 44 /* &.nMem */)) += (nCol + 2)
+ var reg int32 = (*Parse)(unsafe.Pointer(pParse)).FnMem + 1
+ *(*int32)(unsafe.Pointer(pParse + 44)) += nCol + 2
(*Returning)(unsafe.Pointer(pReturning)).FiRetReg = reg
for i = 0; i < nCol; i++ {
- var pCol uintptr = (*ExprList_item)(unsafe.Pointer((pNew + 8 /* &.a */) + uintptr(i)*20)).FpExpr
- Xsqlite3ExprCodeFactorable(tls, pParse, pCol, (reg + i))
+ var pCol uintptr = (*ExprList_item)(unsafe.Pointer(pNew + 8 + uintptr(i)*20)).FpExpr
+ Xsqlite3ExprCodeFactorable(tls, pParse, pCol, reg+i)
}
- Xsqlite3VdbeAddOp3(tls, v, OP_MakeRecord, reg, i, (reg + i))
- Xsqlite3VdbeAddOp2(tls, v, OP_NewRowid, (*Returning)(unsafe.Pointer(pReturning)).FiRetCur, ((reg + i) + 1))
- Xsqlite3VdbeAddOp3(tls, v, OP_Insert, (*Returning)(unsafe.Pointer(pReturning)).FiRetCur, (reg + i), ((reg + i) + 1))
+ Xsqlite3VdbeAddOp3(tls, v, OP_MakeRecord, reg, i, reg+i)
+ Xsqlite3VdbeAddOp2(tls, v, OP_NewRowid, (*Returning)(unsafe.Pointer(pReturning)).FiRetCur, reg+i+1)
+ Xsqlite3VdbeAddOp3(tls, v, OP_Insert, (*Returning)(unsafe.Pointer(pReturning)).FiRetCur, reg+i, reg+i+1)
}
Xsqlite3ExprListDelete(tls, db, pNew)
(*Parse)(unsafe.Pointer(pParse)).FeTriggerOp = U8(0)
@@ -122314,7 +124234,7 @@ func codeReturningTrigger(tls *libc.TLS, pParse uintptr, pTrigger uintptr, pTab
// Generate VDBE code for the statements inside the body of a single
// trigger.
-func codeTriggerProgram(tls *libc.TLS, pParse uintptr, pStepList uintptr, orconf int32) int32 { /* sqlite3.c:140645:12: */
+func codeTriggerProgram(tls *libc.TLS, pParse uintptr, pStepList uintptr, orconf int32) int32 { /* sqlite3.c:141927:12: */
bp := tls.Alloc(36)
defer tls.Free(36)
@@ -122344,7 +124264,7 @@ func codeTriggerProgram(tls *libc.TLS, pParse uintptr, pStepList uintptr, orconf
if (*TriggerStep)(unsafe.Pointer(pStep)).FzSpan != 0 {
Xsqlite3VdbeAddOp4(tls, v, OP_Trace, 0x7fffffff, 1, 0,
- Xsqlite3MPrintf(tls, db, ts+5143 /* "-- %s" */, libc.VaList(bp, (*TriggerStep)(unsafe.Pointer(pStep)).FzSpan)),
+ Xsqlite3MPrintf(tls, db, ts+5990 /* "-- %s" */, libc.VaList(bp, (*TriggerStep)(unsafe.Pointer(pStep)).FzSpan)),
-7)
}
@@ -122401,7 +124321,7 @@ func codeTriggerProgram(tls *libc.TLS, pParse uintptr, pStepList uintptr, orconf
// Parse context structure pFrom has just been used to create a sub-vdbe
// (trigger program). If an error has occurred, transfer error information
// from pFrom to pTo.
-func transferParseError(tls *libc.TLS, pTo uintptr, pFrom uintptr) { /* sqlite3.c:140749:13: */
+func transferParseError(tls *libc.TLS, pTo uintptr, pFrom uintptr) { /* sqlite3.c:142031:13: */
if (*Parse)(unsafe.Pointer(pTo)).FnErr == 0 {
(*Parse)(unsafe.Pointer(pTo)).FzErrMsg = (*Parse)(unsafe.Pointer(pFrom)).FzErrMsg
@@ -122414,7 +124334,7 @@ func transferParseError(tls *libc.TLS, pTo uintptr, pFrom uintptr) { /* sqlite3.
// Create and populate a new TriggerPrg object with a sub-program
// implementing trigger pTrigger with ON CONFLICT policy orconf.
-func codeRowTrigger(tls *libc.TLS, pParse uintptr, pTrigger uintptr, pTab uintptr, orconf int32) uintptr { /* sqlite3.c:140765:19: */
+func codeRowTrigger(tls *libc.TLS, pParse uintptr, pTrigger uintptr, pTab uintptr, orconf int32) uintptr { /* sqlite3.c:142047:19: */
bp := tls.Alloc(40)
defer tls.Free(40)
@@ -122450,8 +124370,8 @@ func codeRowTrigger(tls *libc.TLS, pParse uintptr, pTrigger uintptr, pTab uintpt
Xsqlite3VdbeLinkSubProgram(tls, (*Parse)(unsafe.Pointer(pTop)).FpVdbe, pProgram)
(*TriggerPrg)(unsafe.Pointer(pPrg)).FpTrigger = pTrigger
(*TriggerPrg)(unsafe.Pointer(pPrg)).Forconf = orconf
- *(*U32)(unsafe.Pointer((pPrg + 16 /* &.aColmask */))) = 0xffffffff
- *(*U32)(unsafe.Pointer((pPrg + 16 /* &.aColmask */) + 1*4)) = 0xffffffff
+ *(*U32)(unsafe.Pointer(pPrg + 16)) = 0xffffffff
+ *(*U32)(unsafe.Pointer(pPrg + 16 + 1*4)) = 0xffffffff
// Allocate and populate a new Parse context to use for coding the
// trigger sub-program.
@@ -122474,7 +124394,7 @@ func codeRowTrigger(tls *libc.TLS, pParse uintptr, pTrigger uintptr, pTab uintpt
if (*Trigger)(unsafe.Pointer(pTrigger)).FzName != 0 {
Xsqlite3VdbeChangeP4(tls, v, -1,
- Xsqlite3MPrintf(tls, db, ts+18830 /* "-- TRIGGER %s" */, libc.VaList(bp, (*Trigger)(unsafe.Pointer(pTrigger)).FzName)), -7)
+ Xsqlite3MPrintf(tls, db, ts+20127 /* "-- TRIGGER %s" */, libc.VaList(bp, (*Trigger)(unsafe.Pointer(pTrigger)).FzName)), -7)
}
// If one was specified, code the WHEN clause. If it evaluates to false
@@ -122482,8 +124402,8 @@ func codeRowTrigger(tls *libc.TLS, pParse uintptr, pTrigger uintptr, pTab uintpt
// OP_Halt inserted at the end of the program.
if (*Trigger)(unsafe.Pointer(pTrigger)).FpWhen != 0 {
pWhen = Xsqlite3ExprDup(tls, db, (*Trigger)(unsafe.Pointer(pTrigger)).FpWhen, 0)
- if (int32((*Sqlite3)(unsafe.Pointer(db)).FmallocFailed) == 0) &&
- (SQLITE_OK == Xsqlite3ResolveExprNames(tls, bp+8 /* &sNC */, pWhen)) {
+ if int32((*Sqlite3)(unsafe.Pointer(db)).FmallocFailed) == 0 &&
+ SQLITE_OK == Xsqlite3ResolveExprNames(tls, bp+8, pWhen) {
iEndTrigger = Xsqlite3VdbeMakeLabel(tls, pSubParse)
Xsqlite3ExprIfFalse(tls, pSubParse, pWhen, iEndTrigger, SQLITE_JUMPIFNULL)
}
@@ -122500,14 +124420,14 @@ func codeRowTrigger(tls *libc.TLS, pParse uintptr, pTrigger uintptr, pTab uintpt
Xsqlite3VdbeAddOp0(tls, v, OP_Halt)
transferParseError(tls, pParse, pSubParse)
- if (int32((*Sqlite3)(unsafe.Pointer(db)).FmallocFailed) == 0) && ((*Parse)(unsafe.Pointer(pParse)).FnErr == 0) {
- (*SubProgram)(unsafe.Pointer(pProgram)).FaOp = Xsqlite3VdbeTakeOpArray(tls, v, (pProgram + 4 /* &.nOp */), (pTop + 96 /* &.nMaxArg */))
+ if int32((*Sqlite3)(unsafe.Pointer(db)).FmallocFailed) == 0 && (*Parse)(unsafe.Pointer(pParse)).FnErr == 0 {
+ (*SubProgram)(unsafe.Pointer(pProgram)).FaOp = Xsqlite3VdbeTakeOpArray(tls, v, pProgram+4, pTop+96)
}
(*SubProgram)(unsafe.Pointer(pProgram)).FnMem = (*Parse)(unsafe.Pointer(pSubParse)).FnMem
(*SubProgram)(unsafe.Pointer(pProgram)).FnCsr = (*Parse)(unsafe.Pointer(pSubParse)).FnTab
(*SubProgram)(unsafe.Pointer(pProgram)).Ftoken = pTrigger
- *(*U32)(unsafe.Pointer((pPrg + 16 /* &.aColmask */))) = (*Parse)(unsafe.Pointer(pSubParse)).Foldmask
- *(*U32)(unsafe.Pointer((pPrg + 16 /* &.aColmask */) + 1*4)) = (*Parse)(unsafe.Pointer(pSubParse)).Fnewmask
+ *(*U32)(unsafe.Pointer(pPrg + 16)) = (*Parse)(unsafe.Pointer(pSubParse)).Foldmask
+ *(*U32)(unsafe.Pointer(pPrg + 16 + 1*4)) = (*Parse)(unsafe.Pointer(pSubParse)).Fnewmask
Xsqlite3VdbeDelete(tls, v)
}
@@ -122521,7 +124441,7 @@ func codeRowTrigger(tls *libc.TLS, pParse uintptr, pTrigger uintptr, pTab uintpt
// trigger pTrigger with default ON CONFLICT algorithm orconf. If no such
// TriggerPrg object exists, a new object is allocated and populated before
// being returned.
-func getRowTrigger(tls *libc.TLS, pParse uintptr, pTrigger uintptr, pTab uintptr, orconf int32) uintptr { /* sqlite3.c:140880:19: */
+func getRowTrigger(tls *libc.TLS, pParse uintptr, pTrigger uintptr, pTab uintptr, orconf int32) uintptr { /* sqlite3.c:142162:19: */
var pRoot uintptr = func() uintptr {
if (*Parse)(unsafe.Pointer(pParse)).FpToplevel != 0 {
return (*Parse)(unsafe.Pointer(pParse)).FpToplevel
@@ -122534,7 +124454,7 @@ func getRowTrigger(tls *libc.TLS, pParse uintptr, pTrigger uintptr, pTab uintptr
// process of being coded). If this is the case, then an entry with
// a matching TriggerPrg.pTrigger field will be present somewhere
// in the Parse.pTriggerPrg list. Search for such an entry.
- for pPrg = (*Parse)(unsafe.Pointer(pRoot)).FpTriggerPrg; (pPrg != 0) && (((*TriggerPrg)(unsafe.Pointer(pPrg)).FpTrigger != pTrigger) || ((*TriggerPrg)(unsafe.Pointer(pPrg)).Forconf != orconf)); pPrg = (*TriggerPrg)(unsafe.Pointer(pPrg)).FpNext {
+ for pPrg = (*Parse)(unsafe.Pointer(pRoot)).FpTriggerPrg; pPrg != 0 && ((*TriggerPrg)(unsafe.Pointer(pPrg)).FpTrigger != pTrigger || (*TriggerPrg)(unsafe.Pointer(pPrg)).Forconf != orconf); pPrg = (*TriggerPrg)(unsafe.Pointer(pPrg)).FpNext {
}
// If an existing TriggerPrg could not be located, create a new one.
@@ -122549,7 +124469,7 @@ func getRowTrigger(tls *libc.TLS, pParse uintptr, pTrigger uintptr, pTab uintptr
// table pTab. The reg, orconf and ignoreJump parameters passed to this
// function are the same as those described in the header function for
// sqlite3CodeRowTrigger()
-func Xsqlite3CodeRowTriggerDirect(tls *libc.TLS, pParse uintptr, p uintptr, pTab uintptr, reg int32, orconf int32, ignoreJump int32) { /* sqlite3.c:140914:21: */
+func Xsqlite3CodeRowTriggerDirect(tls *libc.TLS, pParse uintptr, p uintptr, pTab uintptr, reg int32, orconf int32, ignoreJump int32) { /* sqlite3.c:142196:21: */
var v uintptr = Xsqlite3GetVdbe(tls, pParse) // Main VM
var pPrg uintptr
pPrg = getRowTrigger(tls, pParse, p, pTab, orconf)
@@ -122557,7 +124477,7 @@ func Xsqlite3CodeRowTriggerDirect(tls *libc.TLS, pParse uintptr, p uintptr, pTab
// Code the OP_Program opcode in the parent VDBE. P4 of the OP_Program
// is a pointer to the sub-vdbe containing the trigger program.
if pPrg != 0 {
- var bRecursive int32 = (libc.Bool32(((*Trigger)(unsafe.Pointer(p)).FzName != 0) && (uint64(0) == ((*Sqlite3)(unsafe.Pointer((*Parse)(unsafe.Pointer(pParse)).Fdb)).Fflags & uint64(SQLITE_RecTriggers)))))
+ var bRecursive int32 = libc.Bool32((*Trigger)(unsafe.Pointer(p)).FzName != 0 && uint64(0) == (*Sqlite3)(unsafe.Pointer((*Parse)(unsafe.Pointer(pParse)).Fdb)).Fflags&uint64(SQLITE_RecTriggers))
Xsqlite3VdbeAddOp4(tls, v, OP_Program, reg, ignoreJump, libc.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1),
(*TriggerPrg)(unsafe.Pointer(pPrg)).FpProgram, -4)
@@ -122609,7 +124529,7 @@ func Xsqlite3CodeRowTriggerDirect(tls *libc.TLS, pParse uintptr, p uintptr, pTab
// trigger program to use (REPLACE, IGNORE etc.). Parameter ignoreJump
// is the instruction that control should jump to if a trigger program
// raises an IGNORE exception.
-func Xsqlite3CodeRowTrigger(tls *libc.TLS, pParse uintptr, pTrigger uintptr, op int32, pChanges uintptr, tr_tm int32, pTab uintptr, reg int32, orconf int32, ignoreJump int32) { /* sqlite3.c:140986:21: */
+func Xsqlite3CodeRowTrigger(tls *libc.TLS, pParse uintptr, pTrigger uintptr, op int32, pChanges uintptr, tr_tm int32, pTab uintptr, reg int32, orconf int32, ignoreJump int32) { /* sqlite3.c:142268:21: */
var p uintptr // Used to iterate through pTrigger list
for p = pTrigger; p != 0; p = (*Trigger)(unsafe.Pointer(p)).FpNext {
@@ -122622,12 +124542,12 @@ func Xsqlite3CodeRowTrigger(tls *libc.TLS, pParse uintptr, pTrigger uintptr, op
// 1. The trigger is an exact match to the current DML statement
// 2. This is a RETURNING trigger for INSERT but we are currently
// doing the UPDATE part of an UPSERT.
- if (((int32((*Trigger)(unsafe.Pointer(p)).Fop) == op) || ((((*Trigger)(unsafe.Pointer(p)).FbReturning != 0) && (int32((*Trigger)(unsafe.Pointer(p)).Fop) == TK_INSERT)) && (op == TK_UPDATE))) &&
- (int32((*Trigger)(unsafe.Pointer(p)).Ftr_tm) == tr_tm)) &&
- (checkColumnOverlap(tls, (*Trigger)(unsafe.Pointer(p)).FpColumns, pChanges) != 0) {
+ if (int32((*Trigger)(unsafe.Pointer(p)).Fop) == op || (*Trigger)(unsafe.Pointer(p)).FbReturning != 0 && int32((*Trigger)(unsafe.Pointer(p)).Fop) == TK_INSERT && op == TK_UPDATE) &&
+ int32((*Trigger)(unsafe.Pointer(p)).Ftr_tm) == tr_tm &&
+ checkColumnOverlap(tls, (*Trigger)(unsafe.Pointer(p)).FpColumns, pChanges) != 0 {
if !(int32((*Trigger)(unsafe.Pointer(p)).FbReturning) != 0) {
Xsqlite3CodeRowTriggerDirect(tls, pParse, p, pTab, reg, orconf, ignoreJump)
- } else if (*Parse)(unsafe.Pointer((pParse))).FpToplevel == uintptr(0) {
+ } else if (*Parse)(unsafe.Pointer(pParse)).FpToplevel == uintptr(0) {
codeReturningTrigger(tls, pParse, p, pTab, reg)
}
}
@@ -122657,7 +124577,7 @@ func Xsqlite3CodeRowTrigger(tls *libc.TLS, pParse uintptr, pTrigger uintptr, op
// included in the returned mask if the TRIGGER_BEFORE bit is set in the
// tr_tm parameter. Similarly, values accessed by AFTER triggers are only
// included in the returned mask if the TRIGGER_AFTER bit is set in tr_tm.
-func Xsqlite3TriggerColmask(tls *libc.TLS, pParse uintptr, pTrigger uintptr, pChanges uintptr, isNew int32, tr_tm int32, pTab uintptr, orconf int32) U32 { /* sqlite3.c:141056:20: */
+func Xsqlite3TriggerColmask(tls *libc.TLS, pParse uintptr, pTrigger uintptr, pChanges uintptr, isNew int32, tr_tm int32, pTab uintptr, orconf int32) U32 { /* sqlite3.c:142338:20: */
var op int32
if pChanges != 0 {
op = TK_UPDATE
@@ -122668,16 +124588,16 @@ func Xsqlite3TriggerColmask(tls *libc.TLS, pParse uintptr, pTrigger uintptr, pCh
var p uintptr
for p = pTrigger; p != 0; p = (*Trigger)(unsafe.Pointer(p)).FpNext {
- if ((int32((*Trigger)(unsafe.Pointer(p)).Fop) == op) &&
- ((tr_tm & int32((*Trigger)(unsafe.Pointer(p)).Ftr_tm)) != 0)) &&
- (checkColumnOverlap(tls, (*Trigger)(unsafe.Pointer(p)).FpColumns, pChanges) != 0) {
+ if int32((*Trigger)(unsafe.Pointer(p)).Fop) == op &&
+ tr_tm&int32((*Trigger)(unsafe.Pointer(p)).Ftr_tm) != 0 &&
+ checkColumnOverlap(tls, (*Trigger)(unsafe.Pointer(p)).FpColumns, pChanges) != 0 {
if (*Trigger)(unsafe.Pointer(p)).FbReturning != 0 {
mask = 0xffffffff
} else {
var pPrg uintptr
pPrg = getRowTrigger(tls, pParse, p, pTab, orconf)
if pPrg != 0 {
- mask = mask | (*(*U32)(unsafe.Pointer((pPrg + 16 /* &.aColmask */) + uintptr(isNew)*4)))
+ mask = mask | *(*U32)(unsafe.Pointer(pPrg + 16 + uintptr(isNew)*4))
}
}
}
@@ -122714,22 +124634,23 @@ func Xsqlite3TriggerColmask(tls *libc.TLS, pParse uintptr, pTrigger uintptr, pCh
// (not a virtual table) then the value might have been stored as an
// integer. In that case, add an OP_RealAffinity opcode to make sure
// it has been converted into REAL.
-func Xsqlite3ColumnDefault(tls *libc.TLS, v uintptr, pTab uintptr, i int32, iReg int32) { /* sqlite3.c:141154:21: */
+func Xsqlite3ColumnDefault(tls *libc.TLS, v uintptr, pTab uintptr, i int32, iReg int32) { /* sqlite3.c:142436:21: */
bp := tls.Alloc(4)
defer tls.Free(4)
- if !(int32((*Table)(unsafe.Pointer(pTab)).FpSelect) != 0) {
+ if !(int32((*Table)(unsafe.Pointer(pTab)).FeTabType) == TABTYP_VIEW) {
*(*uintptr)(unsafe.Pointer(bp /* pValue */)) = uintptr(0)
var enc U8 = (*Sqlite3)(unsafe.Pointer(Xsqlite3VdbeDb(tls, v))).Fenc
- var pCol uintptr = ((*Table)(unsafe.Pointer(pTab)).FaCol + uintptr(i)*20)
+ var pCol uintptr = (*Table)(unsafe.Pointer(pTab)).FaCol + uintptr(i)*16
- Xsqlite3ValueFromExpr(tls, Xsqlite3VdbeDb(tls, v), (*Column)(unsafe.Pointer(pCol)).FpDflt, enc,
+ Xsqlite3ValueFromExpr(tls, Xsqlite3VdbeDb(tls, v),
+ Xsqlite3ColumnExpr(tls, pTab, pCol), enc,
uint8((*Column)(unsafe.Pointer(pCol)).Faffinity), bp /* &pValue */)
- if *(*uintptr)(unsafe.Pointer(bp /* pValue */)) != 0 {
+ if *(*uintptr)(unsafe.Pointer(bp)) != 0 {
Xsqlite3VdbeAppendP4(tls, v, *(*uintptr)(unsafe.Pointer(bp /* pValue */)), -11)
}
}
- if (int32((*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FaCol+uintptr(i)*20)).Faffinity) == SQLITE_AFF_REAL) && !((*Table)(unsafe.Pointer(pTab)).FnModuleArg != 0) {
+ if int32((*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FaCol+uintptr(i)*16)).Faffinity) == SQLITE_AFF_REAL && !(int32((*Table)(unsafe.Pointer(pTab)).FeTabType) == TABTYP_VTAB) {
Xsqlite3VdbeAddOp1(tls, v, OP_RealAffinity, iReg)
}
}
@@ -122743,14 +124664,14 @@ func Xsqlite3ColumnDefault(tls *libc.TLS, v uintptr, pTab uintptr, i int32, iReg
// aXRef[j] will be non-negative if column j of the original table is
// being updated. chngRowid will be true if the rowid of the table is
// being updated.
-func indexColumnIsBeingUpdated(tls *libc.TLS, pIdx uintptr, iCol int32, aXRef uintptr, chngRowid int32) int32 { /* sqlite3.c:141186:12: */
+func indexColumnIsBeingUpdated(tls *libc.TLS, pIdx uintptr, iCol int32, aXRef uintptr, chngRowid int32) int32 { /* sqlite3.c:142469:12: */
var iIdxCol I16 = *(*I16)(unsafe.Pointer((*Index)(unsafe.Pointer(pIdx)).FaiColumn + uintptr(iCol)*2))
// Cannot index rowid
if int32(iIdxCol) >= 0 {
- return (libc.Bool32(*(*int32)(unsafe.Pointer(aXRef + uintptr(iIdxCol)*4)) >= 0))
+ return libc.Bool32(*(*int32)(unsafe.Pointer(aXRef + uintptr(iIdxCol)*4)) >= 0)
}
- return Xsqlite3ExprReferencesUpdatedColumn(tls, (*ExprList_item)(unsafe.Pointer(((*Index)(unsafe.Pointer(pIdx)).FaColExpr+8 /* &.a */)+uintptr(iCol)*20)).FpExpr,
+ return Xsqlite3ExprReferencesUpdatedColumn(tls, (*ExprList_item)(unsafe.Pointer((*Index)(unsafe.Pointer(pIdx)).FaColExpr+8+uintptr(iCol)*20)).FpExpr,
aXRef, chngRowid)
}
@@ -122764,7 +124685,7 @@ func indexColumnIsBeingUpdated(tls *libc.TLS, pIdx uintptr, iCol int32, aXRef ui
// aXRef[j] will be non-negative if column j of the original table is
// being updated. chngRowid will be true if the rowid of the table is
// being updated.
-func indexWhereClauseMightChange(tls *libc.TLS, pIdx uintptr, aXRef uintptr, chngRowid int32) int32 { /* sqlite3.c:141216:12: */
+func indexWhereClauseMightChange(tls *libc.TLS, pIdx uintptr, aXRef uintptr, chngRowid int32) int32 { /* sqlite3.c:142499:12: */
if (*Index)(unsafe.Pointer(pIdx)).FpPartIdxWhere == uintptr(0) {
return 0
}
@@ -122776,10 +124697,10 @@ func indexWhereClauseMightChange(tls *libc.TLS, pIdx uintptr, aXRef uintptr, chn
// Expr.iColumn set to value (iCol+1). The resolver will modify the
// expression to be a TK_COLUMN reading column iCol of the first
// table in the source-list (pSrc->a[0]).
-func exprRowColumn(tls *libc.TLS, pParse uintptr, iCol int32) uintptr { /* sqlite3.c:141232:13: */
+func exprRowColumn(tls *libc.TLS, pParse uintptr, iCol int32) uintptr { /* sqlite3.c:142515:13: */
var pRet uintptr = Xsqlite3PExpr(tls, pParse, TK_ROW, uintptr(0), uintptr(0))
if pRet != 0 {
- (*Expr)(unsafe.Pointer(pRet)).FiColumn = (YnVar(iCol + 1))
+ (*Expr)(unsafe.Pointer(pRet)).FiColumn = YnVar(iCol + 1)
}
return pRet
}
@@ -122820,7 +124741,7 @@ func exprRowColumn(tls *libc.TLS, pParse uintptr, iCol int32) uintptr { /* sqlit
// records with automatically assigned integer keys For intkey tables, the
// rowid value in <other-columns> is used as the integer key, and the
// remaining fields make up the table record.
-func updateFromSelect(tls *libc.TLS, pParse uintptr, iEph int32, pPk uintptr, pChanges uintptr, pTabList uintptr, pWhere uintptr, pOrderBy uintptr, pLimit uintptr) { /* sqlite3.c:141276:13: */
+func updateFromSelect(tls *libc.TLS, pParse uintptr, iEph int32, pPk uintptr, pChanges uintptr, pTabList uintptr, pWhere uintptr, pOrderBy uintptr, pLimit uintptr) { /* sqlite3.c:142559:13: */
bp := tls.Alloc(28)
defer tls.Free(28)
@@ -122833,7 +124754,7 @@ func updateFromSelect(tls *libc.TLS, pParse uintptr, iEph int32, pPk uintptr, pC
var pLimit2 uintptr = uintptr(0)
var pOrderBy2 uintptr = uintptr(0)
var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb
- var pTab uintptr = (*SrcItem)(unsafe.Pointer((pTabList + 8 /* &.a */))).FpTab
+ var pTab uintptr = (*SrcItem)(unsafe.Pointer(pTabList + 8)).FpTab
var pSrc uintptr
var pWhere2 uintptr
var eDest int32
@@ -122845,28 +124766,28 @@ func updateFromSelect(tls *libc.TLS, pParse uintptr, iEph int32, pPk uintptr, pC
pWhere2 = Xsqlite3ExprDup(tls, db, pWhere, 0)
if pSrc != 0 {
- libc.SetBitFieldPtr16Uint32((pSrc+8 /* &.a */)+36 /* &.fg */ +4 /* &.notCte */, uint32(1), 8, 0x100)
- (*SrcItem)(unsafe.Pointer((pSrc + 8 /* &.a */))).FiCursor = -1
- (*Table)(unsafe.Pointer((*SrcItem)(unsafe.Pointer((pSrc + 8 /* &.a */))).FpTab)).FnTabRef--
- (*SrcItem)(unsafe.Pointer((pSrc + 8 /* &.a */))).FpTab = uintptr(0)
+ libc.SetBitFieldPtr16Uint32(pSrc+8+36+4, uint32(1), 8, 0x100)
+ (*SrcItem)(unsafe.Pointer(pSrc + 8)).FiCursor = -1
+ (*Table)(unsafe.Pointer((*SrcItem)(unsafe.Pointer(pSrc+8)).FpTab)).FnTabRef--
+ (*SrcItem)(unsafe.Pointer(pSrc + 8)).FpTab = uintptr(0)
}
if pPk != 0 {
for i = 0; i < int32((*Index)(unsafe.Pointer(pPk)).FnKeyCol); i++ {
var pNew uintptr = exprRowColumn(tls, pParse, int32(*(*I16)(unsafe.Pointer((*Index)(unsafe.Pointer(pPk)).FaiColumn + uintptr(i)*2))))
pList = Xsqlite3ExprListAppend(tls, pParse, pList, pNew)
}
- if (*Table)(unsafe.Pointer(pTab)).FnModuleArg != 0 {
+ if int32((*Table)(unsafe.Pointer(pTab)).FeTabType) == TABTYP_VTAB {
eDest = SRT_Table
} else {
eDest = SRT_Upfrom
}
- } else if (*Table)(unsafe.Pointer(pTab)).FpSelect != 0 {
+ } else if int32((*Table)(unsafe.Pointer(pTab)).FeTabType) == TABTYP_VIEW {
for i = 0; i < int32((*Table)(unsafe.Pointer(pTab)).FnCol); i++ {
pList = Xsqlite3ExprListAppend(tls, pParse, pList, exprRowColumn(tls, pParse, i))
}
eDest = SRT_Table
} else {
- if (*Table)(unsafe.Pointer(pTab)).FnModuleArg != 0 {
+ if int32((*Table)(unsafe.Pointer(pTab)).FeTabType) == TABTYP_VTAB {
eDest = SRT_Table
} else {
eDest = SRT_Upfrom
@@ -122877,11 +124798,14 @@ func updateFromSelect(tls *libc.TLS, pParse uintptr, iEph int32, pPk uintptr, pC
if pChanges != 0 {
for i = 0; i < (*ExprList)(unsafe.Pointer(pChanges)).FnExpr; i++ {
pList = Xsqlite3ExprListAppend(tls, pParse, pList,
- Xsqlite3ExprDup(tls, db, (*ExprList_item)(unsafe.Pointer((pChanges+8 /* &.a */)+uintptr(i)*20)).FpExpr, 0))
+ Xsqlite3ExprDup(tls, db, (*ExprList_item)(unsafe.Pointer(pChanges+8+uintptr(i)*20)).FpExpr, 0))
}
}
pSelect = Xsqlite3SelectNew(tls, pParse, pList,
- pSrc, pWhere2, pGrp, uintptr(0), pOrderBy2, (uint32(SF_UpdateFrom | SF_IncludeHidden)), pLimit2)
+ pSrc, pWhere2, pGrp, uintptr(0), pOrderBy2, uint32(SF_UFSrcCheck|SF_IncludeHidden), pLimit2)
+ if pSelect != 0 {
+ *(*U32)(unsafe.Pointer(pSelect + 4)) |= U32(SF_OrderByReqd)
+ }
Xsqlite3SelectDestInit(tls, bp /* &dest */, eDest, iEph)
(*SelectDest)(unsafe.Pointer(bp /* &dest */)).FiSDParm2 = func() int32 {
if pPk != 0 {
@@ -122900,7 +124824,7 @@ func updateFromSelect(tls *libc.TLS, pParse uintptr, iEph int32, pPk uintptr, pC
// onError | pChanges | pWhere
// \_______________________/
// pTabList
-func Xsqlite3Update(tls *libc.TLS, pParse uintptr, pTabList uintptr, pChanges uintptr, pWhere uintptr, onError int32, pOrderBy uintptr, pLimit uintptr, pUpsert uintptr) { /* sqlite3.c:141372:21: */
+func Xsqlite3Update(tls *libc.TLS, pParse uintptr, pTabList uintptr, pChanges uintptr, pWhere uintptr, onError int32, pOrderBy uintptr, pLimit uintptr, pUpsert uintptr) { /* sqlite3.c:142656:21: */
bp := tls.Alloc(72)
defer tls.Free(72)
@@ -122966,6 +124890,7 @@ func Xsqlite3Update(tls *libc.TLS, pParse uintptr, pTabList uintptr, pChanges ui
var regRowSet int32 // Rowset of rows to be updated
var regKey int32
var rc int32
+ var hCol U8
var bProgress int32
var reg int32
var pKeyInfo uintptr
@@ -122999,7 +124924,7 @@ func Xsqlite3Update(tls *libc.TLS, pParse uintptr, pTabList uintptr, pChanges ui
libc.Xmemset(tls, bp+16 /* &sContext */, 0, uint32(unsafe.Sizeof(AuthContext{})))
db = (*Parse)(unsafe.Pointer(pParse)).Fdb
- if !(((*Parse)(unsafe.Pointer(pParse)).FnErr != 0) || ((*Sqlite3)(unsafe.Pointer(db)).FmallocFailed != 0)) {
+ if !((*Parse)(unsafe.Pointer(pParse)).FnErr != 0 || (*Sqlite3)(unsafe.Pointer(db)).FmallocFailed != 0) {
goto __1
}
goto update_cleanup
@@ -123019,7 +124944,7 @@ __2:
// Figure out if we have any triggers and if the table being
// updated is a view.
pTrigger = Xsqlite3TriggersExist(tls, pParse, pTab, TK_UPDATE, pChanges, bp+24 /* &tmask */)
- isView = (libc.Bool32((*Table)(unsafe.Pointer(pTab)).FpSelect != uintptr(0)))
+ isView = libc.Bool32(int32((*Table)(unsafe.Pointer(pTab)).FeTabType) == TABTYP_VIEW)
// If there was a FROM clause, set nChangeFrom to the number of expressions
// in the change-list. Otherwise, set it to 0. There cannot be a FROM
@@ -123037,7 +124962,7 @@ __2:
goto update_cleanup
__3:
;
- if !(Xsqlite3IsReadOnly(tls, pParse, pTab, *(*int32)(unsafe.Pointer(bp + 24 /* tmask */))) != 0) {
+ if !(Xsqlite3IsReadOnly(tls, pParse, pTab, *(*int32)(unsafe.Pointer(bp + 24))) != 0) {
goto __4
}
goto update_cleanup
@@ -123049,8 +124974,8 @@ __4:
// need to occur right after the database cursor. So go ahead and
// allocate enough space, just in case.
iBaseCur = libc.AssignInt32(&iDataCur, libc.PostIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnTab, 1))
- iIdxCur = (iDataCur + 1)
- if ((*Table)(unsafe.Pointer((pTab))).FtabFlags & U32(TF_WithoutRowid)) == U32(0) {
+ iIdxCur = iDataCur + 1
+ if (*Table)(unsafe.Pointer(pTab)).FtabFlags&U32(TF_WithoutRowid) == U32(0) {
pPk = uintptr(0)
} else {
pPk = Xsqlite3PrimaryKeyIndex(tls, pTab)
@@ -123086,21 +125011,21 @@ __7:
(*Parse)(unsafe.Pointer(pParse)).FnTab = iBaseCur
__9:
;
- (*SrcItem)(unsafe.Pointer((pTabList + 8 /* &.a */))).FiCursor = iDataCur
+ (*SrcItem)(unsafe.Pointer(pTabList + 8)).FiCursor = iDataCur
// Allocate space for aXRef[], aRegIdx[], and aToOpen[].
// Initialize aXRef[] and aToOpen[] to their default values.
- aXRef = Xsqlite3DbMallocRawNN(tls, db, (uint64(((uint32(unsafe.Sizeof(int32(0))) * (uint32((int32((*Table)(unsafe.Pointer(pTab)).FnCol) + nIdx) + 1))) + uint32(nIdx)) + uint32(2))))
+ aXRef = Xsqlite3DbMallocRawNN(tls, db, uint64(uint32(unsafe.Sizeof(int32(0)))*uint32(int32((*Table)(unsafe.Pointer(pTab)).FnCol)+nIdx+1)+uint32(nIdx)+uint32(2)))
if !(aXRef == uintptr(0)) {
goto __10
}
goto update_cleanup
__10:
;
- aRegIdx = (aXRef + uintptr((*Table)(unsafe.Pointer(pTab)).FnCol)*4)
- aToOpen = ((aRegIdx + uintptr(nIdx)*4) + uintptr(1)*4)
- libc.Xmemset(tls, aToOpen, 1, (uint32(nIdx + 1)))
- *(*U8)(unsafe.Pointer(aToOpen + uintptr((nIdx + 1)))) = U8(0)
+ aRegIdx = aXRef + uintptr((*Table)(unsafe.Pointer(pTab)).FnCol)*4
+ aToOpen = aRegIdx + uintptr(nIdx)*4 + uintptr(1)*4
+ libc.Xmemset(tls, aToOpen, 1, uint32(nIdx+1))
+ *(*U8)(unsafe.Pointer(aToOpen + uintptr(nIdx+1))) = U8(0)
i = 0
__11:
if !(i < int32((*Table)(unsafe.Pointer(pTab)).FnCol)) {
@@ -123119,7 +125044,7 @@ __13:
libc.Xmemset(tls, bp+28 /* &sNC */, 0, uint32(unsafe.Sizeof(NameContext{})))
(*NameContext)(unsafe.Pointer(bp + 28 /* &sNC */)).FpParse = pParse
(*NameContext)(unsafe.Pointer(bp + 28 /* &sNC */)).FpSrcList = pTabList
- *(*uintptr)(unsafe.Pointer(bp + 28 /* &sNC */ + 8 /* &.uNC */)) = pUpsert
+ *(*uintptr)(unsafe.Pointer(bp + 28 + 8)) = pUpsert
(*NameContext)(unsafe.Pointer(bp + 28 /* &sNC */)).FncFlags = NC_UUpsert
// Begin generating code.
@@ -123142,9 +125067,10 @@ __15:
if !(i < (*ExprList)(unsafe.Pointer(pChanges)).FnExpr) {
goto __17
}
+ hCol = Xsqlite3StrIHash(tls, (*ExprList_item)(unsafe.Pointer(pChanges+8+uintptr(i)*20)).FzEName)
// If this is an UPDATE with a FROM clause, do not resolve expressions
// here. The call to sqlite3Select() below will do that.
- if !((nChangeFrom == 0) && (Xsqlite3ResolveExprNames(tls, bp+28 /* &sNC */, (*ExprList_item)(unsafe.Pointer((pChanges+8 /* &.a */)+uintptr(i)*20)).FpExpr) != 0)) {
+ if !(nChangeFrom == 0 && Xsqlite3ResolveExprNames(tls, bp+28, (*ExprList_item)(unsafe.Pointer(pChanges+8+uintptr(i)*20)).FpExpr) != 0) {
goto __18
}
goto update_cleanup
@@ -123155,30 +125081,31 @@ __19:
if !(j < int32((*Table)(unsafe.Pointer(pTab)).FnCol)) {
goto __21
}
- if !(Xsqlite3StrICmp(tls, (*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FaCol+uintptr(j)*20)).FzName, (*ExprList_item)(unsafe.Pointer((pChanges+8 /* &.a */)+uintptr(i)*20)).FzEName) == 0) {
+ if !(int32((*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FaCol+uintptr(j)*16)).FhName) == int32(hCol) &&
+ Xsqlite3StrICmp(tls, (*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FaCol+uintptr(j)*16)).FzCnName, (*ExprList_item)(unsafe.Pointer(pChanges+8+uintptr(i)*20)).FzEName) == 0) {
goto __22
}
if !(j == int32((*Table)(unsafe.Pointer(pTab)).FiPKey)) {
goto __23
}
chngRowid = U8(1)
- pRowidExpr = (*ExprList_item)(unsafe.Pointer((pChanges + 8 /* &.a */) + uintptr(i)*20)).FpExpr
+ pRowidExpr = (*ExprList_item)(unsafe.Pointer(pChanges + 8 + uintptr(i)*20)).FpExpr
iRowidExpr = i
goto __24
__23:
- if !((pPk != 0) && ((int32((*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FaCol+uintptr(j)*20)).FcolFlags) & COLFLAG_PRIMKEY) != 0)) {
+ if !(pPk != 0 && int32((*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FaCol+uintptr(j)*16)).FcolFlags)&COLFLAG_PRIMKEY != 0) {
goto __25
}
chngPk = U8(1)
goto __26
__25:
- if !((int32((*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FaCol+uintptr(j)*20)).FcolFlags) & COLFLAG_GENERATED) != 0) {
+ if !(int32((*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FaCol+uintptr(j)*16)).FcolFlags)&COLFLAG_GENERATED != 0) {
goto __27
}
Xsqlite3ErrorMsg(tls, pParse,
- ts+18844, /* "cannot UPDATE ge..." */
- libc.VaList(bp, (*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FaCol+uintptr(j)*20)).FzName))
+ ts+20141, /* "cannot UPDATE ge..." */
+ libc.VaList(bp, (*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FaCol+uintptr(j)*16)).FzCnName))
goto update_cleanup
__27:
;
@@ -123200,16 +125127,16 @@ __21:
if !(j >= int32((*Table)(unsafe.Pointer(pTab)).FnCol)) {
goto __28
}
- if !((pPk == uintptr(0)) && (Xsqlite3IsRowid(tls, (*ExprList_item)(unsafe.Pointer((pChanges+8 /* &.a */)+uintptr(i)*20)).FzEName) != 0)) {
+ if !(pPk == uintptr(0) && Xsqlite3IsRowid(tls, (*ExprList_item)(unsafe.Pointer(pChanges+8+uintptr(i)*20)).FzEName) != 0) {
goto __29
}
j = -1
chngRowid = U8(1)
- pRowidExpr = (*ExprList_item)(unsafe.Pointer((pChanges + 8 /* &.a */) + uintptr(i)*20)).FpExpr
+ pRowidExpr = (*ExprList_item)(unsafe.Pointer(pChanges + 8 + uintptr(i)*20)).FpExpr
iRowidExpr = i
goto __30
__29:
- Xsqlite3ErrorMsg(tls, pParse, ts+18880 /* "no such column: ..." */, libc.VaList(bp+8, (*ExprList_item)(unsafe.Pointer((pChanges+8 /* &.a */)+uintptr(i)*20)).FzEName))
+ Xsqlite3ErrorMsg(tls, pParse, ts+20177 /* "no such column: ..." */, libc.VaList(bp+8, (*ExprList_item)(unsafe.Pointer(pChanges+8+uintptr(i)*20)).FzEName))
(*Parse)(unsafe.Pointer(pParse)).FcheckSchema = U8(1)
goto update_cleanup
__30:
@@ -123220,9 +125147,9 @@ __28:
rc = Xsqlite3AuthCheck(tls, pParse, SQLITE_UPDATE, (*Table)(unsafe.Pointer(pTab)).FzName,
func() uintptr {
if j < 0 {
- return ts + 6688 /* "ROWID" */
+ return ts + 7581 /* "ROWID" */
}
- return (*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FaCol + uintptr(j)*20)).FzName
+ return (*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FaCol + uintptr(j)*16)).FzCnName
}(),
(*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+uintptr(iDb)*16)).FzDbSName)
if !(rc == SQLITE_DENY) {
@@ -123248,7 +125175,7 @@ __16:
__17:
;
- chngKey = (U8(int32(chngRowid) + int32(chngPk)))
+ chngKey = U8(int32(chngRowid) + int32(chngPk))
// Mark generated columns as changing if their generator expressions
// reference any changing column. The actual aXRef[] value for
@@ -123256,7 +125183,7 @@ __17:
// is non-negative, so the value of aXRef[] for generated columns can be
// set to any non-negative number. We use 99999 so that the value is
// obvious when looking at aXRef[] in a symbolic debugger.
- if !(((*Table)(unsafe.Pointer(pTab)).FtabFlags & U32(TF_HasGenerated)) != 0) {
+ if !((*Table)(unsafe.Pointer(pTab)).FtabFlags&U32(TF_HasGenerated) != 0) {
goto __34
}
@@ -123273,13 +125200,14 @@ __38:
goto __39
__41:
;
- if !((int32((*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FaCol+uintptr(i)*20)).FcolFlags) & COLFLAG_GENERATED) == 0) {
+ if !(int32((*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FaCol+uintptr(i)*16)).FcolFlags)&COLFLAG_GENERATED == 0) {
goto __42
}
goto __39
__42:
;
- if !(Xsqlite3ExprReferencesUpdatedColumn(tls, (*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FaCol+uintptr(i)*20)).FpDflt,
+ if !(Xsqlite3ExprReferencesUpdatedColumn(tls,
+ Xsqlite3ColumnExpr(tls, pTab, (*Table)(unsafe.Pointer(pTab)).FaCol+uintptr(i)*16),
aXRef, int32(chngRowid)) != 0) {
goto __43
}
@@ -123309,8 +125237,8 @@ __34:
// So reset the colUsed mask. Unless this is a virtual table. In that
// case, set all bits of the colUsed mask (to ensure that the virtual
// table implementation makes all columns available).
- (*SrcItem)(unsafe.Pointer((pTabList + 8 /* &.a */))).FcolUsed = func() uint64 {
- if (*Table)(unsafe.Pointer(pTab)).FnModuleArg != 0 {
+ (*SrcItem)(unsafe.Pointer(pTabList + 8)).FcolUsed = func() uint64 {
+ if int32((*Table)(unsafe.Pointer(pTab)).FeTabType) == TABTYP_VTAB {
return libc.Uint64(libc.Uint64FromInt32(-1))
}
return uint64(0)
@@ -123333,12 +125261,12 @@ __45:
if !(pIdx != 0) {
goto __47
}
- if !((((chngKey != 0) || (hasFK > 1)) || (pIdx == pPk)) ||
- (indexWhereClauseMightChange(tls, pIdx, aXRef, int32(chngRowid)) != 0)) {
+ if !(chngKey != 0 || hasFK > 1 || pIdx == pPk ||
+ indexWhereClauseMightChange(tls, pIdx, aXRef, int32(chngRowid)) != 0) {
goto __48
}
reg = libc.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1)
- *(*int32)(unsafe.Pointer(pParse + 44 /* &.nMem */)) += (int32((*Index)(unsafe.Pointer(pIdx)).FnColumn))
+ *(*int32)(unsafe.Pointer(pParse + 44)) += int32((*Index)(unsafe.Pointer(pIdx)).FnColumn)
goto __49
__48:
reg = 0
@@ -123351,8 +125279,8 @@ __50:
goto __53
}
reg = libc.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1)
- *(*int32)(unsafe.Pointer(pParse + 44 /* &.nMem */)) += (int32((*Index)(unsafe.Pointer(pIdx)).FnColumn))
- if !((onError == OE_Default) && (int32((*Index)(unsafe.Pointer(pIdx)).FonError) == OE_Replace)) {
+ *(*int32)(unsafe.Pointer(pParse + 44)) += int32((*Index)(unsafe.Pointer(pIdx)).FnColumn)
+ if !(onError == OE_Default && int32((*Index)(unsafe.Pointer(pIdx)).FonError) == OE_Replace) {
goto __54
}
*(*int32)(unsafe.Pointer(bp + 68 /* bReplace */)) = 1
@@ -123373,7 +125301,7 @@ __49:
if !(reg == 0) {
goto __55
}
- *(*U8)(unsafe.Pointer(aToOpen + uintptr((nAllIdx + 1)))) = U8(0)
+ *(*U8)(unsafe.Pointer(aToOpen + uintptr(nAllIdx+1))) = U8(0)
__55:
;
*(*int32)(unsafe.Pointer(aRegIdx + uintptr(nAllIdx)*4)) = reg
@@ -123386,12 +125314,12 @@ __46:
__47:
;
*(*int32)(unsafe.Pointer(aRegIdx + uintptr(nAllIdx)*4)) = libc.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1) // Register storing the table record
- if !(*(*int32)(unsafe.Pointer(bp + 68 /* bReplace */)) != 0) {
+ if !(*(*int32)(unsafe.Pointer(bp + 68)) != 0) {
goto __56
}
// If REPLACE conflict resolution might be invoked, open cursors on all
// indexes in case they are needed to delete records.
- libc.Xmemset(tls, aToOpen, 1, (uint32(nIdx + 1)))
+ libc.Xmemset(tls, aToOpen, 1, uint32(nIdx+1))
__56:
;
@@ -123401,10 +125329,10 @@ __56:
Xsqlite3VdbeCountChanges(tls, v)
__57:
;
- Xsqlite3BeginWriteOperation(tls, pParse, (libc.Bool32((pTrigger != 0) || (hasFK != 0))), iDb)
+ Xsqlite3BeginWriteOperation(tls, pParse, libc.Bool32(pTrigger != 0 || hasFK != 0), iDb)
// Allocate required registers.
- if !(!((*Table)(unsafe.Pointer(pTab)).FnModuleArg != 0)) {
+ if !!(int32((*Table)(unsafe.Pointer(pTab)).FeTabType) == TABTYP_VTAB) {
goto __58
}
// For now, regRowSet and aRegIdx[nAllIdx] share the same register.
@@ -123415,21 +125343,21 @@ __57:
regRowSet = *(*int32)(unsafe.Pointer(aRegIdx + uintptr(nAllIdx)*4))
regOldRowid = libc.AssignInt32(&regNewRowid, libc.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1))
- if !(((chngPk != 0) || (pTrigger != 0)) || (hasFK != 0)) {
+ if !(chngPk != 0 || pTrigger != 0 || hasFK != 0) {
goto __59
}
- regOld = ((*Parse)(unsafe.Pointer(pParse)).FnMem + 1)
- *(*int32)(unsafe.Pointer(pParse + 44 /* &.nMem */)) += (int32((*Table)(unsafe.Pointer(pTab)).FnCol))
+ regOld = (*Parse)(unsafe.Pointer(pParse)).FnMem + 1
+ *(*int32)(unsafe.Pointer(pParse + 44)) += int32((*Table)(unsafe.Pointer(pTab)).FnCol)
__59:
;
- if !(((chngKey != 0) || (pTrigger != 0)) || (hasFK != 0)) {
+ if !(chngKey != 0 || pTrigger != 0 || hasFK != 0) {
goto __60
}
regNewRowid = libc.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1)
__60:
;
- regNew = ((*Parse)(unsafe.Pointer(pParse)).FnMem + 1)
- *(*int32)(unsafe.Pointer(pParse + 44 /* &.nMem */)) += (int32((*Table)(unsafe.Pointer(pTab)).FnCol))
+ regNew = (*Parse)(unsafe.Pointer(pParse)).FnMem + 1
+ *(*int32)(unsafe.Pointer(pParse + 44)) += int32((*Table)(unsafe.Pointer(pTab)).FnCol)
__58:
;
@@ -123443,7 +125371,7 @@ __61:
// If we are trying to update a view, realize that view into
// an ephemeral table.
- if !((nChangeFrom == 0) && (isView != 0)) {
+ if !(nChangeFrom == 0 && isView != 0) {
goto __62
}
Xsqlite3MaterializeView(tls, pParse, pTab,
@@ -123455,7 +125383,7 @@ __62:
// Resolve the column names in all the expressions in the
// WHERE clause.
- if !((nChangeFrom == 0) && (Xsqlite3ResolveExprNames(tls, bp+28 /* &sNC */, pWhere) != 0)) {
+ if !(nChangeFrom == 0 && Xsqlite3ResolveExprNames(tls, bp+28, pWhere) != 0) {
goto __63
}
goto update_cleanup
@@ -123463,7 +125391,7 @@ __63:
;
// Virtual tables must be handled separately
- if !((*Table)(unsafe.Pointer(pTab)).FnModuleArg != 0) {
+ if !(int32((*Table)(unsafe.Pointer(pTab)).FeTabType) == TABTYP_VTAB) {
goto __64
}
updateVirtualTable(tls, pParse, pTabList, pTab, pChanges, pRowidExpr, aXRef,
@@ -123477,11 +125405,11 @@ __64:
// Not an UPSERT. Normal processing. Begin by
// initialize the count of updated rows
- if !(((((((*Sqlite3)(unsafe.Pointer(db)).Fflags & (U64((uint64(0x00001))) << 32)) != uint64(0)) &&
- !(int32((*Parse)(unsafe.Pointer(pParse)).FpTriggerTab) != 0)) &&
- !(int32((*Parse)(unsafe.Pointer(pParse)).Fnested) != 0)) &&
- !(int32((*Parse)(unsafe.Pointer(pParse)).FbReturning) != 0)) &&
- (pUpsert == uintptr(0))) {
+ if !((*Sqlite3)(unsafe.Pointer(db)).Fflags&(U64(uint64(0x00001))<<32) != uint64(0) &&
+ !(int32((*Parse)(unsafe.Pointer(pParse)).FpTriggerTab) != 0) &&
+ !(int32((*Parse)(unsafe.Pointer(pParse)).Fnested) != 0) &&
+ !(int32((*Parse)(unsafe.Pointer(pParse)).FbReturning) != 0) &&
+ pUpsert == uintptr(0)) {
goto __65
}
regRowCount = libc.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1)
@@ -123489,7 +125417,7 @@ __64:
__65:
;
- if !((nChangeFrom == 0) && (((*Table)(unsafe.Pointer((pTab))).FtabFlags & U32(TF_WithoutRowid)) == U32(0))) {
+ if !(nChangeFrom == 0 && (*Table)(unsafe.Pointer(pTab)).FtabFlags&U32(TF_WithoutRowid) == U32(0)) {
goto __66
}
Xsqlite3VdbeAddOp3(tls, v, OP_Null, 0, regRowSet, regOldRowid)
@@ -123503,24 +125431,24 @@ __66:
} else {
nPk = int16(0)
}
- iPk = ((*Parse)(unsafe.Pointer(pParse)).FnMem + 1)
- *(*int32)(unsafe.Pointer(pParse + 44 /* &.nMem */)) += (int32(nPk))
- *(*int32)(unsafe.Pointer(pParse + 44 /* &.nMem */)) += (nChangeFrom)
+ iPk = (*Parse)(unsafe.Pointer(pParse)).FnMem + 1
+ *(*int32)(unsafe.Pointer(pParse + 44)) += int32(nPk)
+ *(*int32)(unsafe.Pointer(pParse + 44)) += nChangeFrom
regKey = libc.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1)
if !(pUpsert == uintptr(0)) {
goto __68
}
- nEphCol = ((int32(nPk) + nChangeFrom) + (func() int32 {
+ nEphCol = int32(nPk) + nChangeFrom + func() int32 {
if isView != 0 {
return int32((*Table)(unsafe.Pointer(pTab)).FnCol)
}
return 0
- }()))
+ }()
iEph = libc.PostIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnTab, 1)
if !(pPk != 0) {
goto __69
}
- Xsqlite3VdbeAddOp3(tls, v, OP_Null, 0, iPk, ((iPk + int32(nPk)) - 1))
+ Xsqlite3VdbeAddOp3(tls, v, OP_Null, 0, iPk, iPk+int32(nPk)-1)
__69:
;
addrOpen = Xsqlite3VdbeAddOp2(tls, v, OP_OpenEphemeral, iEph, nEphCol)
@@ -123585,10 +125513,10 @@ __76:
// things might disturb a cursor being used to scan through the table
// or index, causing a single-pass approach to malfunction.
flags = WHERE_ONEPASS_DESIRED
- if !((((!(int32((*Parse)(unsafe.Pointer(pParse)).Fnested) != 0) && !(pTrigger != 0)) && !(hasFK != 0)) && !(chngKey != 0)) && !(*(*int32)(unsafe.Pointer(bp + 68 /* bReplace */)) != 0)) {
+ if !(!(int32((*Parse)(unsafe.Pointer(pParse)).Fnested) != 0) && !(pTrigger != 0) && !(hasFK != 0) && !(chngKey != 0) && !(*(*int32)(unsafe.Pointer(bp + 68)) != 0)) {
goto __78
}
- flags = flags | (WHERE_ONEPASS_MULTIROW)
+ flags = flags | WHERE_ONEPASS_MULTIROW
__78:
;
pWInfo = Xsqlite3WhereBegin(tls, pParse, pTabList, pWhere, uintptr(0), uintptr(0), uint16(flags), iIdxCur)
@@ -123619,7 +125547,7 @@ __79:
goto __81
}
iCur = *(*int32)(unsafe.Pointer(bp + 60 /* &aiCurOnePass[0] */ + 1*4))
- if !(((iCur >= 0) && (iCur != iDataCur)) && (*(*U8)(unsafe.Pointer(aToOpen + uintptr((iCur - iBaseCur)))) != 0)) {
+ if !(iCur >= 0 && iCur != iDataCur && *(*U8)(unsafe.Pointer(aToOpen + uintptr(iCur-iBaseCur))) != 0) {
goto __82
}
eOnePass = ONEPASS_OFF
@@ -123633,7 +125561,7 @@ __80:
__77:
;
- if !(((*Table)(unsafe.Pointer((pTab))).FtabFlags & U32(TF_WithoutRowid)) == U32(0)) {
+ if !((*Table)(unsafe.Pointer(pTab)).FtabFlags&U32(TF_WithoutRowid) == U32(0)) {
goto __83
}
// Read the rowid of the current row of the WHERE scan. In ONEPASS_OFF
@@ -123669,7 +125597,7 @@ __88:
}
Xsqlite3ExprCodeGetColumnOfTable(tls, v, pTab, iDataCur,
- int32(*(*I16)(unsafe.Pointer((*Index)(unsafe.Pointer(pPk)).FaiColumn + uintptr(i)*2))), (iPk + i))
+ int32(*(*I16)(unsafe.Pointer((*Index)(unsafe.Pointer(pPk)).FaiColumn + uintptr(i)*2))), iPk+i)
goto __89
__89:
i++
@@ -123703,14 +125631,14 @@ __75:
if !(pUpsert == uintptr(0)) {
goto __94
}
- if !((nChangeFrom == 0) && (eOnePass != ONEPASS_MULTI)) {
+ if !(nChangeFrom == 0 && eOnePass != ONEPASS_MULTI) {
goto __95
}
Xsqlite3WhereEnd(tls, pWInfo)
__95:
;
- if !(!(isView != 0)) {
+ if !!(isView != 0) {
goto __96
}
addrOnce = 0
@@ -123719,22 +125647,22 @@ __95:
if !(eOnePass != ONEPASS_OFF) {
goto __97
}
- if !(*(*int32)(unsafe.Pointer(bp + 60 /* &aiCurOnePass[0] */)) >= 0) {
+ if !(*(*int32)(unsafe.Pointer(bp + 60)) >= 0) {
goto __98
}
- *(*U8)(unsafe.Pointer(aToOpen + uintptr((*(*int32)(unsafe.Pointer(bp + 60 /* &aiCurOnePass[0] */)) - iBaseCur)))) = U8(0)
+ *(*U8)(unsafe.Pointer(aToOpen + uintptr(*(*int32)(unsafe.Pointer(bp + 60))-iBaseCur))) = U8(0)
__98:
;
- if !(*(*int32)(unsafe.Pointer(bp + 60 /* &aiCurOnePass[0] */ + 1*4)) >= 0) {
+ if !(*(*int32)(unsafe.Pointer(bp + 60 + 1*4)) >= 0) {
goto __99
}
- *(*U8)(unsafe.Pointer(aToOpen + uintptr((*(*int32)(unsafe.Pointer(bp + 60 /* &aiCurOnePass[0] */ + 1*4)) - iBaseCur)))) = U8(0)
+ *(*U8)(unsafe.Pointer(aToOpen + uintptr(*(*int32)(unsafe.Pointer(bp + 60 + 1*4))-iBaseCur))) = U8(0)
__99:
;
__97:
;
- if !((eOnePass == ONEPASS_MULTI) && ((nIdx - (libc.Bool32(*(*int32)(unsafe.Pointer(bp + 60 /* &aiCurOnePass[0] */ + 1*4)) >= 0))) > 0)) {
+ if !(eOnePass == ONEPASS_MULTI && nIdx-libc.Bool32(*(*int32)(unsafe.Pointer(bp + 60 + 1*4)) >= 0) > 0) {
goto __100
}
addrOnce = Xsqlite3VdbeAddOp0(tls, v, OP_Once)
@@ -123755,8 +125683,8 @@ __96:
if !(eOnePass != ONEPASS_OFF) {
goto __102
}
- if !((*(*int32)(unsafe.Pointer(bp + 60 /* &aiCurOnePass[0] */)) != iDataCur) &&
- (*(*int32)(unsafe.Pointer(bp + 60 /* &aiCurOnePass[0] */ + 1*4)) != iDataCur)) {
+ if !(*(*int32)(unsafe.Pointer(bp + 60)) != iDataCur &&
+ *(*int32)(unsafe.Pointer(bp + 60 + 1*4)) != iDataCur) {
goto __104
}
@@ -123779,7 +125707,7 @@ __105:
goto __103
__102:
- if !((pPk != 0) || (nChangeFrom != 0)) {
+ if !(pPk != 0 || nChangeFrom != 0) {
goto __106
}
labelContinue = Xsqlite3VdbeMakeLabel(tls, pParse)
@@ -123788,7 +125716,7 @@ __102:
if !(nChangeFrom != 0) {
goto __108
}
- if !(!(isView != 0)) {
+ if !!(isView != 0) {
goto __110
}
if !(pPk != 0) {
@@ -123799,7 +125727,7 @@ __113:
if !(i < int32(nPk)) {
goto __115
}
- Xsqlite3VdbeAddOp3(tls, v, OP_Column, iEph, i, (iPk + i))
+ Xsqlite3VdbeAddOp3(tls, v, OP_Column, iEph, i, iPk+i)
goto __114
__114:
i++
@@ -123864,7 +125792,7 @@ __116:
// Compute the old pre-UPDATE content of the row being changed, if that
// information is needed
- if !(((chngPk != 0) || (hasFK != 0)) || (pTrigger != 0)) {
+ if !(chngPk != 0 || hasFK != 0 || pTrigger != 0) {
goto __119
}
oldmask = func() uint32 {
@@ -123873,18 +125801,18 @@ __116:
}
return uint32(0)
}()
- oldmask = oldmask | (Xsqlite3TriggerColmask(tls, pParse,
- pTrigger, pChanges, 0, (TRIGGER_BEFORE | TRIGGER_AFTER), pTab, onError))
+ oldmask = oldmask | Xsqlite3TriggerColmask(tls, pParse,
+ pTrigger, pChanges, 0, TRIGGER_BEFORE|TRIGGER_AFTER, pTab, onError)
i = 0
__120:
if !(i < int32((*Table)(unsafe.Pointer(pTab)).FnCol)) {
goto __122
}
- colFlags = U32((*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FaCol + uintptr(i)*20)).FcolFlags)
- k = (int32(Xsqlite3TableColumnToStorage(tls, pTab, int16(i))) + regOld)
- if !(((oldmask == 0xffffffff) ||
- ((i < 32) && ((oldmask & (uint32((uint32(1))) << (i))) != U32(0)))) ||
- ((colFlags & U32(COLFLAG_PRIMKEY)) != U32(0))) {
+ colFlags = U32((*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FaCol + uintptr(i)*16)).FcolFlags)
+ k = int32(Xsqlite3TableColumnToStorage(tls, pTab, int16(i))) + regOld
+ if !(oldmask == 0xffffffff ||
+ i < 32 && oldmask&(uint32(uint32(1))<<i) != U32(0) ||
+ colFlags&U32(COLFLAG_PRIMKEY) != U32(0)) {
goto __123
}
@@ -123901,7 +125829,7 @@ __121:
goto __122
__122:
;
- if !((int32(chngRowid) == 0) && (pPk == uintptr(0))) {
+ if !(int32(chngRowid) == 0 && pPk == uintptr(0)) {
goto __125
}
Xsqlite3VdbeAddOp2(tls, v, OP_Copy, regOldRowid, regNewRowid)
@@ -123936,10 +125864,10 @@ __126:
Xsqlite3VdbeAddOp2(tls, v, OP_Null, 0, k)
goto __130
__129:
- if !((int32((*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FaCol+uintptr(i)*20)).FcolFlags) & COLFLAG_GENERATED) != 0) {
+ if !(int32((*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FaCol+uintptr(i)*16)).FcolFlags)&COLFLAG_GENERATED != 0) {
goto __131
}
- if !((int32((*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FaCol+uintptr(i)*20)).FcolFlags) & COLFLAG_VIRTUAL) != 0) {
+ if !(int32((*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FaCol+uintptr(i)*16)).FcolFlags)&COLFLAG_VIRTUAL != 0) {
goto __133
}
k--
@@ -123961,15 +125889,15 @@ __131:
return int32(nPk)
}()
- Xsqlite3VdbeAddOp3(tls, v, OP_Column, iEph, (nOff + j), k)
+ Xsqlite3VdbeAddOp3(tls, v, OP_Column, iEph, nOff+j, k)
goto __137
__136:
- Xsqlite3ExprCode(tls, pParse, (*ExprList_item)(unsafe.Pointer((pChanges+8 /* &.a */)+uintptr(j)*20)).FpExpr, k)
+ Xsqlite3ExprCode(tls, pParse, (*ExprList_item)(unsafe.Pointer(pChanges+8+uintptr(j)*20)).FpExpr, k)
__137:
;
goto __135
__134:
- if !(((0 == (*(*int32)(unsafe.Pointer(bp + 24 /* tmask */)) & TRIGGER_BEFORE)) || (i > 31)) || ((uint32(newmask) & (uint32((uint32(1))) << (i))) != 0)) {
+ if !(0 == *(*int32)(unsafe.Pointer(bp + 24))&TRIGGER_BEFORE || i > 31 || uint32(newmask)&(uint32(uint32(1))<<i) != 0) {
goto __138
}
// This branch loads the value of a column that will not be changed
@@ -123998,7 +125926,7 @@ __127:
goto __128
__128:
;
- if !(((*Table)(unsafe.Pointer(pTab)).FtabFlags & U32(TF_HasGenerated)) != 0) {
+ if !((*Table)(unsafe.Pointer(pTab)).FtabFlags&U32(TF_HasGenerated) != 0) {
goto __140
}
@@ -124008,14 +125936,14 @@ __140:
// Fire any BEFORE UPDATE triggers. This happens before constraints are
// verified. One could argue that this is wrong.
- if !((*(*int32)(unsafe.Pointer(bp + 24 /* tmask */)) & TRIGGER_BEFORE) != 0) {
+ if !(*(*int32)(unsafe.Pointer(bp + 24))&TRIGGER_BEFORE != 0) {
goto __141
}
Xsqlite3TableAffinity(tls, v, pTab, regNew)
Xsqlite3CodeRowTrigger(tls, pParse, pTrigger, TK_UPDATE, pChanges,
TRIGGER_BEFORE, pTab, regOldRowid, onError, labelContinue)
- if !(!(isView != 0)) {
+ if !!(isView != 0) {
goto __142
}
// The row-trigger may have deleted the row being updated. In this
@@ -124049,10 +125977,10 @@ __145:
if !(i < int32((*Table)(unsafe.Pointer(pTab)).FnCol)) {
goto __147
}
- if !((int32((*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FaCol+uintptr(i)*20)).FcolFlags) & COLFLAG_GENERATED) != 0) {
+ if !(int32((*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FaCol+uintptr(i)*16)).FcolFlags)&COLFLAG_GENERATED != 0) {
goto __148
}
- if !((int32((*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FaCol+uintptr(i)*20)).FcolFlags) & COLFLAG_VIRTUAL) != 0) {
+ if !(int32((*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FaCol+uintptr(i)*16)).FcolFlags)&COLFLAG_VIRTUAL != 0) {
goto __150
}
k--
@@ -124060,7 +125988,7 @@ __150:
;
goto __149
__148:
- if !((*(*int32)(unsafe.Pointer(aXRef + uintptr(i)*4)) < 0) && (i != int32((*Table)(unsafe.Pointer(pTab)).FiPKey))) {
+ if !(*(*int32)(unsafe.Pointer(aXRef + uintptr(i)*4)) < 0 && i != int32((*Table)(unsafe.Pointer(pTab)).FiPKey)) {
goto __151
}
Xsqlite3ExprCodeGetColumnOfTable(tls, v, pTab, iDataCur, i, k)
@@ -124076,7 +126004,7 @@ __146:
goto __147
__147:
;
- if !(((*Table)(unsafe.Pointer(pTab)).FtabFlags & U32(TF_HasGenerated)) != 0) {
+ if !((*Table)(unsafe.Pointer(pTab)).FtabFlags&U32(TF_HasGenerated) != 0) {
goto __152
}
@@ -124088,7 +126016,7 @@ __142:
__141:
;
- if !(!(isView != 0)) {
+ if !!(isView != 0) {
goto __153
}
// Do constraint checks.
@@ -124100,7 +126028,7 @@ __141:
// If REPLACE conflict handling may have been used, or if the PK of the
// row is changing, then the GenerateConstraintChecks() above may have
// moved cursor iDataCur. Reseek it.
- if !((*(*int32)(unsafe.Pointer(bp + 68 /* bReplace */)) != 0) || (chngKey != 0)) {
+ if !(*(*int32)(unsafe.Pointer(bp + 68)) != 0 || chngKey != 0) {
goto __154
}
if !(pPk != 0) {
@@ -124149,12 +126077,12 @@ __158:
// is the column index supplied by the user.
Xsqlite3VdbeAddOp3(tls, v, OP_Delete, iDataCur,
- (OPFLAG_ISUPDATE | (func() int32 {
- if (hasFK > 1) || (chngKey != 0) {
+ OPFLAG_ISUPDATE|func() int32 {
+ if hasFK > 1 || chngKey != 0 {
return 0
}
return OPFLAG_ISNOOP
- }())),
+ }(),
regNewRowid)
if !(eOnePass == ONEPASS_MULTI) {
goto __159
@@ -124163,7 +126091,7 @@ __158:
Xsqlite3VdbeChangeP5(tls, v, uint16(OPFLAG_SAVEPOSITION))
__159:
;
- if !(!(int32((*Parse)(unsafe.Pointer(pParse)).Fnested) != 0)) {
+ if !!(int32((*Parse)(unsafe.Pointer(pParse)).Fnested) != 0) {
goto __160
}
Xsqlite3VdbeAppendP4(tls, v, pTab, -6)
@@ -124180,12 +126108,12 @@ __161:
// Insert the new index entries and the new record.
Xsqlite3CompleteInsertion(tls,
pParse, pTab, iDataCur, iIdxCur, regNewRowid, aRegIdx,
- (OPFLAG_ISUPDATE | (func() int32 {
+ OPFLAG_ISUPDATE|func() int32 {
if eOnePass == ONEPASS_MULTI {
return OPFLAG_SAVEPOSITION
}
return 0
- }())),
+ }(),
0, 0)
// Do any ON CASCADE, SET NULL or SET DEFAULT operations required to
@@ -124237,7 +126165,7 @@ __165:
// Update the sqlite_sequence table by storing the content of the
// maximum rowid counter values recorded while inserting into
// autoincrement tables.
- if !(((int32((*Parse)(unsafe.Pointer(pParse)).Fnested) == 0) && ((*Parse)(unsafe.Pointer(pParse)).FpTriggerTab == uintptr(0))) && (pUpsert == uintptr(0))) {
+ if !(int32((*Parse)(unsafe.Pointer(pParse)).Fnested) == 0 && (*Parse)(unsafe.Pointer(pParse)).FpTriggerTab == uintptr(0) && pUpsert == uintptr(0)) {
goto __168
}
Xsqlite3AutoincrementEnd(tls, pParse)
@@ -124251,7 +126179,7 @@ __168:
}
Xsqlite3VdbeAddOp2(tls, v, OP_ChngCntRow, regRowCount, 1)
Xsqlite3VdbeSetNumCols(tls, v, 1)
- Xsqlite3VdbeSetColName(tls, v, 0, COLNAME_NAME, ts+18899 /* "rows updated" */, uintptr(0))
+ Xsqlite3VdbeSetColName(tls, v, 0, COLNAME_NAME, ts+20196 /* "rows updated" */, uintptr(0))
__169:
;
@@ -124287,7 +126215,7 @@ update_cleanup:
// The "onepass" strategy does not use an ephemeral table. Instead, it
// stores the same values (A, B and C above) in a register array and
// makes a single invocation of VUpdate.
-func updateVirtualTable(tls *libc.TLS, pParse uintptr, pSrc uintptr, pTab uintptr, pChanges uintptr, pRowid uintptr, aXRef uintptr, pWhere uintptr, onError int32) { /* sqlite3.c:142259:13: */
+func updateVirtualTable(tls *libc.TLS, pParse uintptr, pSrc uintptr, pTab uintptr, pChanges uintptr, pRowid uintptr, aXRef uintptr, pWhere uintptr, onError int32) { /* sqlite3.c:143548:13: */
bp := tls.Alloc(8)
defer tls.Free(8)
@@ -124297,11 +126225,11 @@ func updateVirtualTable(tls *libc.TLS, pParse uintptr, pSrc uintptr, pTab uintpt
var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb // Database connection
var pVTab uintptr = Xsqlite3GetVTable(tls, db, pTab)
var pWInfo uintptr = uintptr(0)
- var nArg int32 = (2 + int32((*Table)(unsafe.Pointer(pTab)).FnCol)) // Number of arguments to VUpdate
- var regArg int32 // First register in VUpdate arg array
- var regRec int32 // Register in which to assemble record
- var regRowid int32 // Register for ephem table rowid
- var iCsr int32 = (*SrcItem)(unsafe.Pointer((pSrc + 8 /* &.a */))).FiCursor // Cursor used for virtual table scan
+ var nArg int32 = 2 + int32((*Table)(unsafe.Pointer(pTab)).FnCol) // Number of arguments to VUpdate
+ var regArg int32 // First register in VUpdate arg array
+ var regRec int32 // Register in which to assemble record
+ var regRowid int32 // Register for ephem table rowid
+ var iCsr int32 = (*SrcItem)(unsafe.Pointer(pSrc + 8)).FiCursor // Cursor used for virtual table scan
// var aDummy [2]int32 at bp, 8
// Unused arg for sqlite3WhereOkOnePass()
var eOnePass int32 // True to use onepass strategy
@@ -124313,13 +126241,13 @@ func updateVirtualTable(tls *libc.TLS, pParse uintptr, pSrc uintptr, pTab uintpt
ephemTab = libc.PostIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnTab, 1)
addr = Xsqlite3VdbeAddOp2(tls, v, OP_OpenEphemeral, ephemTab, nArg)
- regArg = ((*Parse)(unsafe.Pointer(pParse)).FnMem + 1)
- *(*int32)(unsafe.Pointer(pParse + 44 /* &.nMem */)) += (nArg)
+ regArg = (*Parse)(unsafe.Pointer(pParse)).FnMem + 1
+ *(*int32)(unsafe.Pointer(pParse + 44)) += nArg
if (*SrcList)(unsafe.Pointer(pSrc)).FnSrc > 1 {
var pPk uintptr = uintptr(0)
var pRow uintptr
var pList uintptr
- if ((*Table)(unsafe.Pointer((pTab))).FtabFlags & U32(TF_WithoutRowid)) == U32(0) {
+ if (*Table)(unsafe.Pointer(pTab)).FtabFlags&U32(TF_WithoutRowid) == U32(0) {
if pRowid != 0 {
pRow = Xsqlite3ExprDup(tls, db, pRowid, 0)
} else {
@@ -124331,7 +126259,7 @@ func updateVirtualTable(tls *libc.TLS, pParse uintptr, pSrc uintptr, pTab uintpt
iPk = *(*I16)(unsafe.Pointer((*Index)(unsafe.Pointer(pPk)).FaiColumn))
if *(*int32)(unsafe.Pointer(aXRef + uintptr(iPk)*4)) >= 0 {
- pRow = Xsqlite3ExprDup(tls, db, (*ExprList_item)(unsafe.Pointer((pChanges+8 /* &.a */)+uintptr(*(*int32)(unsafe.Pointer(aXRef + uintptr(iPk)*4)))*20)).FpExpr, 0)
+ pRow = Xsqlite3ExprDup(tls, db, (*ExprList_item)(unsafe.Pointer(pChanges+8+uintptr(*(*int32)(unsafe.Pointer(aXRef + uintptr(iPk)*4)))*20)).FpExpr, 0)
} else {
pRow = exprRowColumn(tls, pParse, int32(iPk))
}
@@ -124341,7 +126269,7 @@ func updateVirtualTable(tls *libc.TLS, pParse uintptr, pSrc uintptr, pTab uintpt
for i = 0; i < int32((*Table)(unsafe.Pointer(pTab)).FnCol); i++ {
if *(*int32)(unsafe.Pointer(aXRef + uintptr(i)*4)) >= 0 {
pList = Xsqlite3ExprListAppend(tls, pParse, pList,
- Xsqlite3ExprDup(tls, db, (*ExprList_item)(unsafe.Pointer((pChanges+8 /* &.a */)+uintptr(*(*int32)(unsafe.Pointer(aXRef + uintptr(i)*4)))*20)).FpExpr, 0))
+ Xsqlite3ExprDup(tls, db, (*ExprList_item)(unsafe.Pointer(pChanges+8+uintptr(*(*int32)(unsafe.Pointer(aXRef + uintptr(i)*4)))*20)).FpExpr, 0))
} else {
pList = Xsqlite3ExprListAppend(tls, pParse, pList, exprRowColumn(tls, pParse, i))
}
@@ -124364,18 +126292,18 @@ func updateVirtualTable(tls *libc.TLS, pParse uintptr, pSrc uintptr, pTab uintpt
for i = 0; i < int32((*Table)(unsafe.Pointer(pTab)).FnCol); i++ {
if *(*int32)(unsafe.Pointer(aXRef + uintptr(i)*4)) >= 0 {
- Xsqlite3ExprCode(tls, pParse, (*ExprList_item)(unsafe.Pointer((pChanges+8 /* &.a */)+uintptr(*(*int32)(unsafe.Pointer(aXRef + uintptr(i)*4)))*20)).FpExpr, ((regArg + 2) + i))
+ Xsqlite3ExprCode(tls, pParse, (*ExprList_item)(unsafe.Pointer(pChanges+8+uintptr(*(*int32)(unsafe.Pointer(aXRef + uintptr(i)*4)))*20)).FpExpr, regArg+2+i)
} else {
- Xsqlite3VdbeAddOp3(tls, v, OP_VColumn, iCsr, i, ((regArg + 2) + i))
+ Xsqlite3VdbeAddOp3(tls, v, OP_VColumn, iCsr, i, regArg+2+i)
Xsqlite3VdbeChangeP5(tls, v, uint16(OPFLAG_NOCHNG)) // For sqlite3_vtab_nochange()
}
}
- if ((*Table)(unsafe.Pointer((pTab))).FtabFlags & U32(TF_WithoutRowid)) == U32(0) {
+ if (*Table)(unsafe.Pointer(pTab)).FtabFlags&U32(TF_WithoutRowid) == U32(0) {
Xsqlite3VdbeAddOp2(tls, v, OP_Rowid, iCsr, regArg)
if pRowid != 0 {
- Xsqlite3ExprCode(tls, pParse, pRowid, (regArg + 1))
+ Xsqlite3ExprCode(tls, pParse, pRowid, regArg+1)
} else {
- Xsqlite3VdbeAddOp2(tls, v, OP_Rowid, iCsr, (regArg + 1))
+ Xsqlite3VdbeAddOp2(tls, v, OP_Rowid, iCsr, regArg+1)
}
} else {
var pPk uintptr // PRIMARY KEY index
@@ -124384,7 +126312,7 @@ func updateVirtualTable(tls *libc.TLS, pParse uintptr, pSrc uintptr, pTab uintpt
iPk = *(*I16)(unsafe.Pointer((*Index)(unsafe.Pointer(pPk)).FaiColumn))
Xsqlite3VdbeAddOp3(tls, v, OP_VColumn, iCsr, int32(iPk), regArg)
- Xsqlite3VdbeAddOp2(tls, v, OP_SCopy, ((regArg + 2) + int32(iPk)), (regArg + 1))
+ Xsqlite3VdbeAddOp2(tls, v, OP_SCopy, regArg+2+int32(iPk), regArg+1)
}
eOnePass = Xsqlite3WhereOkOnePass(tls, pWInfo, bp /* &aDummy[0] */)
@@ -124418,7 +126346,7 @@ func updateVirtualTable(tls *libc.TLS, pParse uintptr, pSrc uintptr, pTab uintpt
// Extract arguments from the current row of the ephemeral table and
// invoke the VUpdate method.
for i = 0; i < nArg; i++ {
- Xsqlite3VdbeAddOp3(tls, v, OP_Column, ephemTab, i, (regArg + i))
+ Xsqlite3VdbeAddOp3(tls, v, OP_Column, ephemTab, i, regArg+i)
}
}
Xsqlite3VtabMakeWritable(tls, pParse, pTab)
@@ -124434,7 +126362,7 @@ func updateVirtualTable(tls *libc.TLS, pParse uintptr, pSrc uintptr, pTab uintpt
// End of the ephemeral table scan. Or, if using the onepass strategy,
// jump to here if the scan visited zero rows.
if eOnePass == ONEPASS_OFF {
- Xsqlite3VdbeAddOp2(tls, v, OP_Next, ephemTab, (addr + 1))
+ Xsqlite3VdbeAddOp2(tls, v, OP_Next, ephemTab, addr+1)
Xsqlite3VdbeJumpHere(tls, v, addr)
Xsqlite3VdbeAddOp2(tls, v, OP_Close, ephemTab, 0)
} else {
@@ -124459,7 +126387,7 @@ func updateVirtualTable(tls *libc.TLS, pParse uintptr, pSrc uintptr, pTab uintpt
// #include "sqliteInt.h"
// Free a list of Upsert objects
-func upsertDelete(tls *libc.TLS, db uintptr, p uintptr) { /* sqlite3.c:142445:29: */
+func upsertDelete(tls *libc.TLS, db uintptr, p uintptr) { /* sqlite3.c:143734:29: */
for ok := true; ok; ok = p != 0 {
var pNext uintptr = (*Upsert)(unsafe.Pointer(p)).FpNextUpsert
Xsqlite3ExprListDelete(tls, db, (*Upsert)(unsafe.Pointer(p)).FpUpsertTarget)
@@ -124472,14 +126400,14 @@ func upsertDelete(tls *libc.TLS, db uintptr, p uintptr) { /* sqlite3.c:142445:29
}
}
-func Xsqlite3UpsertDelete(tls *libc.TLS, db uintptr, p uintptr) { /* sqlite3.c:142457:21: */
+func Xsqlite3UpsertDelete(tls *libc.TLS, db uintptr, p uintptr) { /* sqlite3.c:143746:21: */
if p != 0 {
upsertDelete(tls, db, p)
}
}
// Duplicate an Upsert object.
-func Xsqlite3UpsertDup(tls *libc.TLS, db uintptr, p uintptr) uintptr { /* sqlite3.c:142465:23: */
+func Xsqlite3UpsertDup(tls *libc.TLS, db uintptr, p uintptr) uintptr { /* sqlite3.c:143754:23: */
if p == uintptr(0) {
return uintptr(0)
}
@@ -124492,7 +126420,7 @@ func Xsqlite3UpsertDup(tls *libc.TLS, db uintptr, p uintptr) uintptr { /* sqlite
}
// Create a new Upsert object.
-func Xsqlite3UpsertNew(tls *libc.TLS, db uintptr, pTarget uintptr, pTargetWhere uintptr, pSet uintptr, pWhere uintptr, pNext uintptr) uintptr { /* sqlite3.c:142479:23: */
+func Xsqlite3UpsertNew(tls *libc.TLS, db uintptr, pTarget uintptr, pTargetWhere uintptr, pSet uintptr, pWhere uintptr, pNext uintptr) uintptr { /* sqlite3.c:143768:23: */
var pNew uintptr
pNew = Xsqlite3DbMallocZero(tls, db, uint64(unsafe.Sizeof(Upsert{})))
if pNew == uintptr(0) {
@@ -124507,7 +126435,7 @@ func Xsqlite3UpsertNew(tls *libc.TLS, db uintptr, pTarget uintptr, pTargetWhere
(*Upsert)(unsafe.Pointer(pNew)).FpUpsertTargetWhere = pTargetWhere
(*Upsert)(unsafe.Pointer(pNew)).FpUpsertSet = pSet
(*Upsert)(unsafe.Pointer(pNew)).FpUpsertWhere = pWhere
- (*Upsert)(unsafe.Pointer(pNew)).FisDoUpdate = (U8(libc.Bool32(pSet != uintptr(0))))
+ (*Upsert)(unsafe.Pointer(pNew)).FisDoUpdate = U8(libc.Bool32(pSet != uintptr(0)))
(*Upsert)(unsafe.Pointer(pNew)).FpNextUpsert = pNext
}
return pNew
@@ -124518,7 +126446,7 @@ func Xsqlite3UpsertNew(tls *libc.TLS, db uintptr, pTarget uintptr, pTargetWhere
//
// Return SQLITE_OK if everything works, or an error code is something
// is wrong.
-func Xsqlite3UpsertAnalyzeTarget(tls *libc.TLS, pParse uintptr, pTabList uintptr, pUpsert uintptr) int32 { /* sqlite3.c:142514:20: */
+func Xsqlite3UpsertAnalyzeTarget(tls *libc.TLS, pParse uintptr, pTabList uintptr, pUpsert uintptr) int32 { /* sqlite3.c:143803:20: */
bp := tls.Alloc(168)
defer tls.Free(168)
@@ -124541,7 +126469,7 @@ func Xsqlite3UpsertAnalyzeTarget(tls *libc.TLS, pParse uintptr, pTabList uintptr
(*NameContext)(unsafe.Pointer(bp + 16 /* &sNC */)).FpParse = pParse
(*NameContext)(unsafe.Pointer(bp + 16 /* &sNC */)).FpSrcList = pTabList
__1:
- if !((pUpsert != 0) && ((*Upsert)(unsafe.Pointer(pUpsert)).FpUpsertTarget != 0)) {
+ if !(pUpsert != 0 && (*Upsert)(unsafe.Pointer(pUpsert)).FpUpsertTarget != 0) {
goto __3
}
{
@@ -124555,13 +126483,13 @@ __1:
}
// Check to see if the conflict target matches the rowid.
- pTab = (*SrcItem)(unsafe.Pointer((pTabList + 8 /* &.a */))).FpTab
+ pTab = (*SrcItem)(unsafe.Pointer(pTabList + 8)).FpTab
pTarget = (*Upsert)(unsafe.Pointer(pUpsert)).FpUpsertTarget
- iCursor = (*SrcItem)(unsafe.Pointer((pTabList + 8 /* &.a */))).FiCursor
- if (((((*Table)(unsafe.Pointer((pTab))).FtabFlags & U32(TF_WithoutRowid)) == U32(0)) &&
- ((*ExprList)(unsafe.Pointer(pTarget)).FnExpr == 1)) &&
- (int32((*Expr)(unsafe.Pointer((libc.AssignUintptr(&pTerm, (*ExprList_item)(unsafe.Pointer((pTarget + 8 /* &.a */))).FpExpr)))).Fop) == TK_COLUMN)) &&
- (int32((*Expr)(unsafe.Pointer(pTerm)).FiColumn) == (-1)) {
+ iCursor = (*SrcItem)(unsafe.Pointer(pTabList + 8)).FiCursor
+ if (*Table)(unsafe.Pointer(pTab)).FtabFlags&U32(TF_WithoutRowid) == U32(0) &&
+ (*ExprList)(unsafe.Pointer(pTarget)).FnExpr == 1 &&
+ int32((*Expr)(unsafe.Pointer(libc.AssignUintptr(&pTerm, (*ExprList_item)(unsafe.Pointer(pTarget+8)).FpExpr))).Fop) == TK_COLUMN &&
+ int32((*Expr)(unsafe.Pointer(pTerm)).FiColumn) == -1 {
// The conflict-target is the rowid of the primary table
goto __2
@@ -124574,16 +126502,16 @@ __1:
// prior to comparing against the conflict-target expression.
libc.Xmemset(tls, bp+48 /* &sCol[0] */, 0, uint32(unsafe.Sizeof([2]Expr{})))
(*Expr)(unsafe.Pointer(bp + 48 /* &sCol */)).Fop = U8(TK_COLLATE)
- (*Expr)(unsafe.Pointer(bp + 48 /* &sCol */)).FpLeft = (bp + 48 /* &sCol */ + 1*52)
+ (*Expr)(unsafe.Pointer(bp + 48 /* &sCol */)).FpLeft = bp + 48 + 1*52
(*Expr)(unsafe.Pointer(bp + 48 /* &sCol */ + 1*52)).Fop = U8(TK_COLUMN)
- (*Expr)(unsafe.Pointer(bp + 48 /* &sCol */ + 1*52)).FiTable = (*SrcItem)(unsafe.Pointer((pTabList + 8 /* &.a */))).FiCursor
+ (*Expr)(unsafe.Pointer(bp + 48 /* &sCol */ + 1*52)).FiTable = (*SrcItem)(unsafe.Pointer(pTabList + 8)).FiCursor
// Check for matches against other indexes
for pIdx = (*Table)(unsafe.Pointer(pTab)).FpIndex; pIdx != 0; pIdx = (*Index)(unsafe.Pointer(pIdx)).FpNext {
var ii int32
var jj int32
var nn int32
- if !(int32((*Index)(unsafe.Pointer((pIdx))).FonError) != OE_None) {
+ if !(int32((*Index)(unsafe.Pointer(pIdx)).FonError) != OE_None) {
continue
}
if (*ExprList)(unsafe.Pointer(pTarget)).FnExpr != int32((*Index)(unsafe.Pointer(pIdx)).FnKeyCol) {
@@ -124601,21 +126529,21 @@ __1:
nn = int32((*Index)(unsafe.Pointer(pIdx)).FnKeyCol)
for ii = 0; ii < nn; ii++ {
var pExpr uintptr
- *(*uintptr)(unsafe.Pointer(bp + 48 /* &sCol */ + 8 /* &.u */)) = *(*uintptr)(unsafe.Pointer((*Index)(unsafe.Pointer(pIdx)).FazColl + uintptr(ii)*4))
- if int32(*(*I16)(unsafe.Pointer((*Index)(unsafe.Pointer(pIdx)).FaiColumn + uintptr(ii)*2))) == (-2) {
+ *(*uintptr)(unsafe.Pointer(bp + 48 + 8)) = *(*uintptr)(unsafe.Pointer((*Index)(unsafe.Pointer(pIdx)).FazColl + uintptr(ii)*4))
+ if int32(*(*I16)(unsafe.Pointer((*Index)(unsafe.Pointer(pIdx)).FaiColumn + uintptr(ii)*2))) == -2 {
- pExpr = (*ExprList_item)(unsafe.Pointer(((*Index)(unsafe.Pointer(pIdx)).FaColExpr + 8 /* &.a */) + uintptr(ii)*20)).FpExpr
+ pExpr = (*ExprList_item)(unsafe.Pointer((*Index)(unsafe.Pointer(pIdx)).FaColExpr + 8 + uintptr(ii)*20)).FpExpr
if int32((*Expr)(unsafe.Pointer(pExpr)).Fop) != TK_COLLATE {
(*Expr)(unsafe.Pointer(bp + 48 /* &sCol */)).FpLeft = pExpr
- pExpr = (bp + 48 /* &sCol */)
+ pExpr = bp + 48
}
} else {
- (*Expr)(unsafe.Pointer(bp + 48 /* &sCol */)).FpLeft = (bp + 48 /* &sCol */ + 1*52)
+ (*Expr)(unsafe.Pointer(bp + 48 /* &sCol */)).FpLeft = bp + 48 + 1*52
(*Expr)(unsafe.Pointer(bp + 48 /* &sCol */ + 1*52)).FiColumn = *(*I16)(unsafe.Pointer((*Index)(unsafe.Pointer(pIdx)).FaiColumn + uintptr(ii)*2))
- pExpr = (bp + 48 /* &sCol */)
+ pExpr = bp + 48
}
for jj = 0; jj < nn; jj++ {
- if Xsqlite3ExprCompare(tls, pParse, (*ExprList_item)(unsafe.Pointer((pTarget+8 /* &.a */)+uintptr(jj)*20)).FpExpr, pExpr, iCursor) < 2 {
+ if Xsqlite3ExprCompare(tls, pParse, (*ExprList_item)(unsafe.Pointer(pTarget+8+uintptr(jj)*20)).FpExpr, pExpr, iCursor) < 2 {
break // Column ii of the index matches column jj of target
}
}
@@ -124635,13 +126563,13 @@ __1:
if (*Upsert)(unsafe.Pointer(pUpsert)).FpUpsertIdx == uintptr(0) {
// var zWhich [16]uint8 at bp+152, 16
- if (nClause == 0) && ((*Upsert)(unsafe.Pointer(pUpsert)).FpNextUpsert == uintptr(0)) {
+ if nClause == 0 && (*Upsert)(unsafe.Pointer(pUpsert)).FpNextUpsert == uintptr(0) {
*(*uint8)(unsafe.Pointer(bp + 152 /* &zWhich[0] */)) = uint8(0)
} else {
- Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([16]uint8{})), bp+152 /* &zWhich[0] */, ts+18912 /* "%r " */, libc.VaList(bp, (nClause+1)))
+ Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([16]uint8{})), bp+152 /* &zWhich[0] */, ts+20209 /* "%r " */, libc.VaList(bp, nClause+1))
}
Xsqlite3ErrorMsg(tls, pParse,
- ts+18916 /* "%sON CONFLICT cl..." */, libc.VaList(bp+8, bp+152 /* &zWhich[0] */))
+ ts+20213 /* "%sON CONFLICT cl..." */, libc.VaList(bp+8, bp+152 /* &zWhich[0] */))
return SQLITE_ERROR
}
@@ -124660,7 +126588,7 @@ __3:
// Return true if pUpsert is the last ON CONFLICT clause with a
// conflict target, or if pUpsert is followed by another ON CONFLICT
// clause that targets the INTEGER PRIMARY KEY.
-func Xsqlite3UpsertNextIsIPK(tls *libc.TLS, pUpsert uintptr) int32 { /* sqlite3.c:142641:20: */
+func Xsqlite3UpsertNextIsIPK(tls *libc.TLS, pUpsert uintptr) int32 { /* sqlite3.c:143930:20: */
var pNext uintptr
if pUpsert == uintptr(0) {
return 0
@@ -124682,10 +126610,10 @@ func Xsqlite3UpsertNextIsIPK(tls *libc.TLS, pUpsert uintptr) int32 { /* sqlite3.
// a particular index pIdx, return a pointer to the particular ON CONFLICT
// clause that applies to the index. Or, if the index is not subject to
// any ON CONFLICT clause, return NULL.
-func Xsqlite3UpsertOfIndex(tls *libc.TLS, pUpsert uintptr, pIdx uintptr) uintptr { /* sqlite3.c:142657:23: */
- for ((pUpsert != 0) &&
- ((*Upsert)(unsafe.Pointer(pUpsert)).FpUpsertTarget != uintptr(0))) &&
- ((*Upsert)(unsafe.Pointer(pUpsert)).FpUpsertIdx != pIdx) {
+func Xsqlite3UpsertOfIndex(tls *libc.TLS, pUpsert uintptr, pIdx uintptr) uintptr { /* sqlite3.c:143946:23: */
+ for pUpsert != 0 &&
+ (*Upsert)(unsafe.Pointer(pUpsert)).FpUpsertTarget != uintptr(0) &&
+ (*Upsert)(unsafe.Pointer(pUpsert)).FpUpsertIdx != pIdx {
pUpsert = (*Upsert)(unsafe.Pointer(pUpsert)).FpNextUpsert
}
return pUpsert
@@ -124698,7 +126626,7 @@ func Xsqlite3UpsertOfIndex(tls *libc.TLS, pUpsert uintptr, pIdx uintptr) uintptr
// currently points to the conflicting table row. Otherwise, if pIdx
// is not NULL, then pIdx is the constraint that failed and iCur is a
// cursor points to the conflicting row.
-func Xsqlite3UpsertDoUpdate(tls *libc.TLS, pParse uintptr, pUpsert uintptr, pTab uintptr, pIdx uintptr, iCur int32) { /* sqlite3.c:142677:21: */
+func Xsqlite3UpsertDoUpdate(tls *libc.TLS, pParse uintptr, pUpsert uintptr, pTab uintptr, pIdx uintptr, iCur int32) { /* sqlite3.c:143966:21: */
var v uintptr = (*Parse)(unsafe.Pointer(pParse)).FpVdbe
var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb
var pSrc uintptr // FROM clause for the UPDATE
@@ -124709,8 +126637,8 @@ func Xsqlite3UpsertDoUpdate(tls *libc.TLS, pParse uintptr, pUpsert uintptr, pTab
iDataCur = (*Upsert)(unsafe.Pointer(pUpsert)).FiDataCur
pUpsert = Xsqlite3UpsertOfIndex(tls, pTop, pIdx)
- if (pIdx != 0) && (iCur != iDataCur) {
- if ((*Table)(unsafe.Pointer((pTab))).FtabFlags & U32(TF_WithoutRowid)) == U32(0) {
+ if pIdx != 0 && iCur != iDataCur {
+ if (*Table)(unsafe.Pointer(pTab)).FtabFlags&U32(TF_WithoutRowid) == U32(0) {
var regRowid int32 = Xsqlite3GetTempReg(tls, pParse)
Xsqlite3VdbeAddOp2(tls, v, OP_IdxRowid, iCur, regRowid)
Xsqlite3VdbeAddOp3(tls, v, OP_SeekRowid, iDataCur, 0, regRowid)
@@ -124719,20 +126647,20 @@ func Xsqlite3UpsertDoUpdate(tls *libc.TLS, pParse uintptr, pUpsert uintptr, pTab
} else {
var pPk uintptr = Xsqlite3PrimaryKeyIndex(tls, pTab)
var nPk int32 = int32((*Index)(unsafe.Pointer(pPk)).FnKeyCol)
- var iPk int32 = ((*Parse)(unsafe.Pointer(pParse)).FnMem + 1)
- *(*int32)(unsafe.Pointer(pParse + 44 /* &.nMem */)) += (nPk)
+ var iPk int32 = (*Parse)(unsafe.Pointer(pParse)).FnMem + 1
+ *(*int32)(unsafe.Pointer(pParse + 44)) += nPk
for i = 0; i < nPk; i++ {
var k int32
k = int32(Xsqlite3TableColumnToIndex(tls, pIdx, *(*I16)(unsafe.Pointer((*Index)(unsafe.Pointer(pPk)).FaiColumn + uintptr(i)*2))))
- Xsqlite3VdbeAddOp3(tls, v, OP_Column, iCur, k, (iPk + i))
+ Xsqlite3VdbeAddOp3(tls, v, OP_Column, iCur, k, iPk+i)
}
i = Xsqlite3VdbeAddOp4Int(tls, v, OP_Found, iDataCur, 0, iPk, nPk)
Xsqlite3VdbeAddOp4(tls, v, OP_Halt, SQLITE_CORRUPT, OE_Abort, 0,
- ts+10926 /* "corrupt database" */, -1)
+ ts+12040 /* "corrupt database" */, -1)
Xsqlite3MayAbort(tls, pParse)
Xsqlite3VdbeJumpHere(tls, v, i)
}
@@ -124742,8 +126670,8 @@ func Xsqlite3UpsertDoUpdate(tls *libc.TLS, pParse uintptr, pUpsert uintptr, pTab
pSrc = Xsqlite3SrcListDup(tls, db, (*Upsert)(unsafe.Pointer(pTop)).FpUpsertSrc, 0)
// excluded.* columns of type REAL need to be converted to a hard real
for i = 0; i < int32((*Table)(unsafe.Pointer(pTab)).FnCol); i++ {
- if int32((*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FaCol+uintptr(i)*20)).Faffinity) == SQLITE_AFF_REAL {
- Xsqlite3VdbeAddOp1(tls, v, OP_RealAffinity, ((*Upsert)(unsafe.Pointer(pTop)).FregData + i))
+ if int32((*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FaCol+uintptr(i)*16)).Faffinity) == SQLITE_AFF_REAL {
+ Xsqlite3VdbeAddOp1(tls, v, OP_RealAffinity, (*Upsert)(unsafe.Pointer(pTop)).FregData+i)
}
}
Xsqlite3Update(tls, pParse, pSrc, Xsqlite3ExprListDup(tls, db, (*Upsert)(unsafe.Pointer(pUpsert)).FpUpsertSet, 0),
@@ -124778,7 +126706,7 @@ func Xsqlite3UpsertDoUpdate(tls *libc.TLS, pParse uintptr, pUpsert uintptr, pTab
//
// The execSqlF() routine does the same thing, except it accepts
// a format string as its third argument
-func execSql(tls *libc.TLS, db uintptr, pzErrMsg uintptr, zSql uintptr) int32 { /* sqlite3.c:142774:12: */
+func execSql(tls *libc.TLS, db uintptr, pzErrMsg uintptr, zSql uintptr) int32 { /* sqlite3.c:144063:12: */
bp := tls.Alloc(4)
defer tls.Free(4)
@@ -124791,7 +126719,7 @@ func execSql(tls *libc.TLS, db uintptr, pzErrMsg uintptr, zSql uintptr) int32 {
if rc != SQLITE_OK {
return rc
}
- for SQLITE_ROW == (libc.AssignInt32(&rc, Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp /* pStmt */))))) {
+ for SQLITE_ROW == libc.AssignInt32(&rc, Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp)))) {
var zSubSql uintptr = Xsqlite3_column_text(tls, *(*uintptr)(unsafe.Pointer(bp /* pStmt */)), 0)
// The secondary SQL must be one of CREATE TABLE, CREATE INDEX,
@@ -124799,8 +126727,8 @@ func execSql(tls *libc.TLS, db uintptr, pzErrMsg uintptr, zSql uintptr) int32 {
// 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, ts+18989 /* "CRE" */, uint32(3)) == 0) || (libc.Xstrncmp(tls, zSubSql, ts+18993 /* "INS" */, uint32(3)) == 0)) {
+ if zSubSql != 0 &&
+ (libc.Xstrncmp(tls, zSubSql, ts+20286, uint32(3)) == 0 || libc.Xstrncmp(tls, zSubSql, ts+20290, uint32(3)) == 0) {
rc = execSql(tls, db, pzErrMsg, zSubSql)
if rc != SQLITE_OK {
break
@@ -124818,7 +126746,7 @@ func execSql(tls *libc.TLS, db uintptr, pzErrMsg uintptr, zSql uintptr) int32 {
return rc
}
-func execSqlF(tls *libc.TLS, db uintptr, pzErrMsg uintptr, zSql uintptr, va uintptr) int32 { /* sqlite3.c:142804:12: */
+func execSqlF(tls *libc.TLS, db uintptr, pzErrMsg uintptr, zSql uintptr, va uintptr) int32 { /* sqlite3.c:144093:12: */
var z uintptr
var ap Va_list
_ = ap
@@ -124862,7 +126790,7 @@ func execSqlF(tls *libc.TLS, db uintptr, pzErrMsg uintptr, zSql uintptr, va uint
// And a power loss in between deleting the original and renaming the
// transient would cause the database file to appear to be deleted
// following reboot.
-func Xsqlite3Vacuum(tls *libc.TLS, pParse uintptr, pNm uintptr, pInto uintptr) { /* sqlite3.c:142847:21: */
+func Xsqlite3Vacuum(tls *libc.TLS, pParse uintptr, pNm uintptr, pInto uintptr) { /* sqlite3.c:144136:21: */
bp := tls.Alloc(4)
defer tls.Free(4)
*(*uintptr)(unsafe.Pointer(bp)) = pNm
@@ -124884,7 +126812,7 @@ __1:
goto build_vacuum_end
__2:
;
- if !(*(*uintptr)(unsafe.Pointer(bp /* pNm */)) != 0) {
+ if !(*(*uintptr)(unsafe.Pointer(bp)) != 0) {
goto __3
}
// Default behavior: Report an error if the argument to VACUUM is
@@ -124902,7 +126830,7 @@ __3:
goto __5
}
iIntoReg = 0
- if !((pInto != 0) && (Xsqlite3ResolveSelfReference(tls, pParse, uintptr(0), 0, pInto, uintptr(0)) == 0)) {
+ if !(pInto != 0 && Xsqlite3ResolveSelfReference(tls, pParse, uintptr(0), 0, pInto, uintptr(0)) == 0) {
goto __6
}
iIntoReg = libc.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1)
@@ -124919,24 +126847,24 @@ build_vacuum_end:
}
// This routine implements the OP_Vacuum opcode of the VDBE.
-func Xsqlite3RunVacuum(tls *libc.TLS, pzErrMsg uintptr, db uintptr, iDb int32, pOut uintptr) int32 { /* sqlite3.c:142885:36: */
+func Xsqlite3RunVacuum(tls *libc.TLS, pzErrMsg uintptr, db uintptr, iDb int32, pOut uintptr) int32 { /* sqlite3.c:144174:36: */
bp := tls.Alloc(52)
defer tls.Free(52)
- var rc int32 // Return code from service routines
- var pMain uintptr // The database being vacuumed
- var pTemp uintptr // The temporary database we vacuum into
- var saved_mDbFlags U32 // Saved value of db->mDbFlags
- var saved_flags U64 // Saved value of db->flags
- var saved_nChange int32 // Saved value of db->nChange
- var saved_nTotalChange int32 // Saved value of db->nTotalChange
- var saved_openFlags U32 // Saved value of db->openFlags
- var saved_mTrace U8 // Saved trace settings
- var pDb uintptr // Database to detach at end of vacuum
- var isMemDb int32 // True if vacuuming a :memory: database
- var nRes int32 // Bytes of reserved space at the end of each page
- var nDb int32 // Number of attached databases
- var zDbMain uintptr // Schema name of database to vacuum
+ var rc int32 // Return code from service routines
+ var pMain uintptr // The database being vacuumed
+ var pTemp uintptr // The temporary database we vacuum into
+ var saved_mDbFlags U32 // Saved value of db->mDbFlags
+ var saved_flags U64 // Saved value of db->flags
+ var saved_nChange I64 // Saved value of db->nChange
+ var saved_nTotalChange I64 // Saved value of db->nTotalChange
+ var saved_openFlags U32 // Saved value of db->openFlags
+ var saved_mTrace U8 // Saved trace settings
+ var pDb uintptr // Database to detach at end of vacuum
+ var isMemDb int32 // True if vacuuming a :memory: database
+ var nRes int32 // Bytes of reserved space at the end of each page
+ var nDb int32 // Number of attached databases
+ var zDbMain uintptr // Schema name of database to vacuum
var zOut uintptr
var id uintptr
// var sz I64 at bp+40, 8
@@ -124947,17 +126875,17 @@ func Xsqlite3RunVacuum(tls *libc.TLS, pzErrMsg uintptr, db uintptr, iDb int32, p
rc = SQLITE_OK
pDb = uintptr(0) // Name of output file
- if !(!(int32((*Sqlite3)(unsafe.Pointer(db)).FautoCommit) != 0)) {
+ if !!(int32((*Sqlite3)(unsafe.Pointer(db)).FautoCommit) != 0) {
goto __1
}
- Xsqlite3SetString(tls, pzErrMsg, db, ts+18997 /* "cannot VACUUM fr..." */)
+ Xsqlite3SetString(tls, pzErrMsg, db, ts+20294 /* "cannot VACUUM fr..." */)
return SQLITE_ERROR // IMP: R-12218-18073
__1:
;
if !((*Sqlite3)(unsafe.Pointer(db)).FnVdbeActive > 1) {
goto __2
}
- Xsqlite3SetString(tls, pzErrMsg, db, ts+19037 /* "cannot VACUUM - ..." */)
+ Xsqlite3SetString(tls, pzErrMsg, db, ts+20334 /* "cannot VACUUM - ..." */)
return SQLITE_ERROR // IMP: R-15610-35227
__2:
;
@@ -124968,16 +126896,16 @@ __2:
if !(Xsqlite3_value_type(tls, pOut) != SQLITE_TEXT) {
goto __5
}
- Xsqlite3SetString(tls, pzErrMsg, db, ts+19080 /* "non-text filenam..." */)
+ Xsqlite3SetString(tls, pzErrMsg, db, ts+20377 /* "non-text filenam..." */)
return SQLITE_ERROR
__5:
;
zOut = Xsqlite3_value_text(tls, pOut)
- *(*uint32)(unsafe.Pointer(db + 60 /* &.openFlags */)) &= (libc.Uint32FromInt32(libc.CplInt32(SQLITE_OPEN_READONLY)))
- *(*uint32)(unsafe.Pointer(db + 60 /* &.openFlags */)) |= (uint32(SQLITE_OPEN_CREATE | SQLITE_OPEN_READWRITE))
+ *(*uint32)(unsafe.Pointer(db + 60)) &= libc.Uint32FromInt32(libc.CplInt32(SQLITE_OPEN_READONLY))
+ *(*uint32)(unsafe.Pointer(db + 60)) |= uint32(SQLITE_OPEN_CREATE | SQLITE_OPEN_READWRITE)
goto __4
__3:
- zOut = ts + 755 /* "" */
+ zOut = ts + 1543 /* "" */
__4:
;
@@ -124989,10 +126917,10 @@ __4:
saved_nChange = (*Sqlite3)(unsafe.Pointer(db)).FnChange
saved_nTotalChange = (*Sqlite3)(unsafe.Pointer(db)).FnTotalChange
saved_mTrace = (*Sqlite3)(unsafe.Pointer(db)).FmTrace
- *(*U64)(unsafe.Pointer(db + 32 /* &.flags */)) |= (uint64(SQLITE_WriteSchema | SQLITE_IgnoreChecks))
- *(*U32)(unsafe.Pointer(db + 24 /* &.mDbFlags */)) |= (U32(DBFLAG_PreferBuiltin | DBFLAG_Vacuum))
- *(*U64)(unsafe.Pointer(db + 32 /* &.flags */)) &= (libc.CplUint64(((uint64((SQLITE_ForeignKeys | SQLITE_ReverseOrder) |
- SQLITE_Defensive)) | (U64((uint64(0x00001))) << 32))))
+ *(*U64)(unsafe.Pointer(db + 32)) |= uint64(SQLITE_WriteSchema | SQLITE_IgnoreChecks)
+ *(*U32)(unsafe.Pointer(db + 24)) |= U32(DBFLAG_PreferBuiltin | DBFLAG_Vacuum)
+ *(*U64)(unsafe.Pointer(db + 32)) &= libc.CplUint64(uint64(SQLITE_ForeignKeys|SQLITE_ReverseOrder|
+ SQLITE_Defensive) | U64(uint64(0x00001))<<32)
(*Sqlite3)(unsafe.Pointer(db)).FmTrace = U8(0)
zDbMain = (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*16)).FzDbSName
@@ -125013,7 +126941,7 @@ __4:
// time to parse and run the PRAGMA to turn journalling off than it does
// to write the journal header file.
nDb = (*Sqlite3)(unsafe.Pointer(db)).FnDb
- rc = execSqlF(tls, db, pzErrMsg, ts+19098 /* "ATTACH %Q AS vac..." */, libc.VaList(bp, zOut))
+ rc = execSqlF(tls, db, pzErrMsg, ts+20395 /* "ATTACH %Q AS vac..." */, libc.VaList(bp, zOut))
(*Sqlite3)(unsafe.Pointer(db)).FopenFlags = saved_openFlags
if !(rc != SQLITE_OK) {
goto __6
@@ -125022,7 +126950,7 @@ __4:
__6:
;
- pDb = ((*Sqlite3)(unsafe.Pointer(db)).FaDb + uintptr(nDb)*16)
+ pDb = (*Sqlite3)(unsafe.Pointer(db)).FaDb + uintptr(nDb)*16
pTemp = (*Db)(unsafe.Pointer(pDb)).FpBt
if !(pOut != 0) {
@@ -125030,27 +126958,27 @@ __6:
}
id = Xsqlite3PagerFile(tls, Xsqlite3BtreePager(tls, pTemp))
*(*I64)(unsafe.Pointer(bp + 40 /* sz */)) = int64(0)
- if !(((*Sqlite3_file)(unsafe.Pointer(id)).FpMethods != uintptr(0)) && ((Xsqlite3OsFileSize(tls, id, bp+40 /* &sz */) != SQLITE_OK) || (*(*I64)(unsafe.Pointer(bp + 40 /* sz */)) > int64(0)))) {
+ if !((*Sqlite3_file)(unsafe.Pointer(id)).FpMethods != uintptr(0) && (Xsqlite3OsFileSize(tls, id, bp+40) != SQLITE_OK || *(*I64)(unsafe.Pointer(bp + 40)) > int64(0))) {
goto __8
}
rc = SQLITE_ERROR
- Xsqlite3SetString(tls, pzErrMsg, db, ts+19121 /* "output file alre..." */)
+ Xsqlite3SetString(tls, pzErrMsg, db, ts+20418 /* "output file alre..." */)
goto end_of_vacuum
__8:
;
- *(*U32)(unsafe.Pointer(db + 24 /* &.mDbFlags */)) |= (U32(DBFLAG_VacuumInto))
+ *(*U32)(unsafe.Pointer(db + 24)) |= U32(DBFLAG_VacuumInto)
__7:
;
nRes = Xsqlite3BtreeGetRequestedReserve(tls, pMain)
Xsqlite3BtreeSetCacheSize(tls, pTemp, (*Schema)(unsafe.Pointer((*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+uintptr(iDb)*16)).FpSchema)).Fcache_size)
Xsqlite3BtreeSetSpillSize(tls, pTemp, Xsqlite3BtreeSetSpillSize(tls, pMain, 0))
- Xsqlite3BtreeSetPagerFlags(tls, pTemp, (uint32(PAGER_SYNCHRONOUS_OFF | PAGER_CACHESPILL)))
+ Xsqlite3BtreeSetPagerFlags(tls, pTemp, uint32(PAGER_SYNCHRONOUS_OFF|PAGER_CACHESPILL))
// Begin a transaction and take an exclusive lock on the main database
// file. This is done before the sqlite3BtreeGetPageSize(pMain) call below,
// to ensure that we do not try to change the page-size on a WAL database.
- rc = execSql(tls, db, pzErrMsg, ts+13213 /* "BEGIN" */)
+ rc = execSql(tls, db, pzErrMsg, ts+14396 /* "BEGIN" */)
if !(rc != SQLITE_OK) {
goto __9
}
@@ -125072,16 +127000,17 @@ __10:
// Do not attempt to change the page size for a WAL database
if !(Xsqlite3PagerGetJournalMode(tls, Xsqlite3BtreePager(tls, pMain)) ==
- PAGER_JOURNALMODE_WAL) {
+ PAGER_JOURNALMODE_WAL &&
+ pOut == uintptr(0)) {
goto __11
}
(*Sqlite3)(unsafe.Pointer(db)).FnextPagesize = 0
__11:
;
- if !(((Xsqlite3BtreeSetPageSize(tls, pTemp, Xsqlite3BtreeGetPageSize(tls, pMain), nRes, 0) != 0) ||
- (!(isMemDb != 0) && (Xsqlite3BtreeSetPageSize(tls, pTemp, (*Sqlite3)(unsafe.Pointer(db)).FnextPagesize, nRes, 0) != 0))) ||
- ((*Sqlite3)(unsafe.Pointer(db)).FmallocFailed != 0)) {
+ if !(Xsqlite3BtreeSetPageSize(tls, pTemp, Xsqlite3BtreeGetPageSize(tls, pMain), nRes, 0) != 0 ||
+ !(isMemDb != 0) && Xsqlite3BtreeSetPageSize(tls, pTemp, (*Sqlite3)(unsafe.Pointer(db)).FnextPagesize, nRes, 0) != 0 ||
+ (*Sqlite3)(unsafe.Pointer(db)).FmallocFailed != 0) {
goto __12
}
rc = SQLITE_NOMEM
@@ -125101,7 +127030,7 @@ __12:
(*Sqlite3)(unsafe.Pointer(db)).Finit.FiDb = U8(nDb) // force new CREATE statements into vacuum_db
rc = execSqlF(tls, db, pzErrMsg,
- ts+19148, /* "SELECT sql FROM ..." */
+ ts+20445, /* "SELECT sql FROM ..." */
libc.VaList(bp+8, zDbMain))
if !(rc != SQLITE_OK) {
goto __13
@@ -125111,7 +127040,7 @@ __13:
;
rc = execSqlF(tls, db, pzErrMsg,
- ts+19256, /* "SELECT sql FROM ..." */
+ ts+20553, /* "SELECT sql FROM ..." */
libc.VaList(bp+16, zDbMain))
if !(rc != SQLITE_OK) {
goto __14
@@ -125126,10 +127055,10 @@ __14:
// the contents to the temporary database.
rc = execSqlF(tls, db, pzErrMsg,
- ts+19310, /* "SELECT'INSERT IN..." */
+ ts+20607, /* "SELECT'INSERT IN..." */
libc.VaList(bp+24, zDbMain))
- *(*U32)(unsafe.Pointer(db + 24 /* &.mDbFlags */)) &= (libc.Uint32FromInt32(libc.CplInt32(DBFLAG_Vacuum)))
+ *(*U32)(unsafe.Pointer(db + 24)) &= libc.Uint32FromInt32(libc.CplInt32(DBFLAG_Vacuum))
if !(rc != SQLITE_OK) {
goto __15
}
@@ -125143,7 +127072,7 @@ __15:
// from the schema table.
rc = execSqlF(tls, db, pzErrMsg,
- ts+19461, /* "INSERT INTO vacu..." */
+ ts+20758, /* "INSERT INTO vacu..." */
libc.VaList(bp+32, zDbMain))
if !(rc != 0) {
goto __16
@@ -125162,13 +127091,13 @@ __16:
// Copy Btree meta values
i = 0
__17:
- if !(i < (int32(uint32(unsafe.Sizeof(aCopy)) / uint32(unsafe.Sizeof(uint8(0)))))) {
+ if !(i < int32(uint32(unsafe.Sizeof(aCopy))/uint32(unsafe.Sizeof(uint8(0))))) {
goto __19
}
// GetMeta() and UpdateMeta() cannot fail in this context because
// we already have page 1 loaded into cache and marked dirty.
Xsqlite3BtreeGetMeta(tls, pMain, int32(aCopy[i]), bp+48 /* &meta */)
- rc = Xsqlite3BtreeUpdateMeta(tls, pTemp, int32(aCopy[i]), (*(*U32)(unsafe.Pointer(bp + 48 /* meta */)) + U32(aCopy[(i+1)])))
+ rc = Xsqlite3BtreeUpdateMeta(tls, pTemp, int32(aCopy[i]), *(*U32)(unsafe.Pointer(bp + 48))+U32(aCopy[i+1]))
if !(rc != SQLITE_OK) {
goto __20
}
@@ -125177,7 +127106,7 @@ __20:
;
goto __18
__18:
- i = i + (2)
+ i = i + 2
goto __17
goto __19
__19:
@@ -125256,7 +127185,7 @@ var aCopy = [10]uint8{
uint8(BTREE_TEXT_ENCODING), uint8(0), // Preserve the text encoding
uint8(BTREE_USER_VERSION), uint8(0), // Preserve the user version
uint8(BTREE_APPLICATION_ID), uint8(0), // Preserve the application id
-} /* sqlite3.c:143076:32 */
+} /* sqlite3.c:144367:32 */
// Construct and install a Module object for a virtual table. When this
// routine is called, it is guaranteed that all appropriate locks are held
@@ -125264,7 +127193,7 @@ var aCopy = [10]uint8{
//
// If there already exists a module with zName, replace it with the new one.
// If pModule==0, then delete the module zName if it exists.
-func Xsqlite3VtabCreateModule(tls *libc.TLS, db uintptr, zName uintptr, pModule uintptr, pAux uintptr, xDestroy uintptr) uintptr { /* sqlite3.c:143188:23: */
+func Xsqlite3VtabCreateModule(tls *libc.TLS, db uintptr, zName uintptr, pModule uintptr, pAux uintptr, xDestroy uintptr) uintptr { /* sqlite3.c:144479:23: */
var pMod uintptr
var pDel uintptr
var zCopy uintptr
@@ -125273,13 +127202,13 @@ func Xsqlite3VtabCreateModule(tls *libc.TLS, db uintptr, zName uintptr, pModule
pMod = uintptr(0)
} else {
var nName int32 = Xsqlite3Strlen30(tls, zName)
- pMod = Xsqlite3Malloc(tls, (uint64((uint32(unsafe.Sizeof(Module{})) + uint32(nName)) + uint32(1))))
+ pMod = Xsqlite3Malloc(tls, uint64(uint32(unsafe.Sizeof(Module{}))+uint32(nName)+uint32(1)))
if pMod == uintptr(0) {
Xsqlite3OomFault(tls, db)
return uintptr(0)
}
- zCopy = (pMod + 1*24)
- libc.Xmemcpy(tls, zCopy, zName, (uint32(nName + 1)))
+ zCopy = pMod + 1*24
+ libc.Xmemcpy(tls, zCopy, zName, uint32(nName+1))
(*Module)(unsafe.Pointer(pMod)).FzName = zCopy
(*Module)(unsafe.Pointer(pMod)).FpModule = pModule
(*Module)(unsafe.Pointer(pMod)).FpAux = pAux
@@ -125287,7 +127216,7 @@ func Xsqlite3VtabCreateModule(tls *libc.TLS, db uintptr, zName uintptr, pModule
(*Module)(unsafe.Pointer(pMod)).FpEpoTab = uintptr(0)
(*Module)(unsafe.Pointer(pMod)).FnRefModule = 1
}
- pDel = Xsqlite3HashInsert(tls, (db + 376 /* &.aModule */), zCopy, pMod)
+ pDel = Xsqlite3HashInsert(tls, db+400, zCopy, pMod)
if pDel != 0 {
if pDel == pMod {
Xsqlite3OomFault(tls, db)
@@ -125304,13 +127233,13 @@ func Xsqlite3VtabCreateModule(tls *libc.TLS, db uintptr, zName uintptr, pModule
// The actual function that does the work of creating a new module.
// This function implements the sqlite3_create_module() and
// sqlite3_create_module_v2() interfaces.
-func createModule(tls *libc.TLS, db uintptr, zName uintptr, pModule uintptr, pAux uintptr, xDestroy uintptr) int32 { /* sqlite3.c:143236:12: */
+func createModule(tls *libc.TLS, db uintptr, zName uintptr, pModule uintptr, pAux uintptr, xDestroy uintptr) int32 { /* sqlite3.c:144527:12: */
var rc int32 = SQLITE_OK
Xsqlite3_mutex_enter(tls, (*Sqlite3)(unsafe.Pointer(db)).Fmutex)
Xsqlite3VtabCreateModule(tls, db, zName, pModule, pAux, xDestroy)
rc = Xsqlite3ApiExit(tls, db, rc)
- if (rc != SQLITE_OK) && (xDestroy != 0) {
+ if rc != SQLITE_OK && xDestroy != 0 {
(*struct{ f func(*libc.TLS, uintptr) })(unsafe.Pointer(&struct{ uintptr }{xDestroy})).f(tls, pAux)
}
Xsqlite3_mutex_leave(tls, (*Sqlite3)(unsafe.Pointer(db)).Fmutex)
@@ -125318,26 +127247,26 @@ func createModule(tls *libc.TLS, db uintptr, zName uintptr, pModule uintptr, pAu
}
// External API function used to create a new virtual-table module.
-func Xsqlite3_create_module(tls *libc.TLS, db uintptr, zName uintptr, pModule uintptr, pAux uintptr) int32 { /* sqlite3.c:143257:16: */
+func Xsqlite3_create_module(tls *libc.TLS, db uintptr, zName uintptr, pModule uintptr, pAux uintptr) int32 { /* sqlite3.c:144548:16: */
return createModule(tls, db, zName, pModule, pAux, uintptr(0))
}
// External API function used to create a new virtual-table module.
-func Xsqlite3_create_module_v2(tls *libc.TLS, db uintptr, zName uintptr, pModule uintptr, pAux uintptr, xDestroy uintptr) int32 { /* sqlite3.c:143272:16: */
+func Xsqlite3_create_module_v2(tls *libc.TLS, db uintptr, zName uintptr, pModule uintptr, pAux uintptr, xDestroy uintptr) int32 { /* sqlite3.c:144563:16: */
return createModule(tls, db, zName, pModule, pAux, xDestroy)
}
// External API to drop all virtual-table modules, except those named
// on the azNames list.
-func Xsqlite3_drop_modules(tls *libc.TLS, db uintptr, azNames uintptr) int32 { /* sqlite3.c:143289:16: */
+func Xsqlite3_drop_modules(tls *libc.TLS, db uintptr, azNames uintptr) int32 { /* sqlite3.c:144580:16: */
var pThis uintptr
var pNext uintptr
- for pThis = (*Hash)(unsafe.Pointer((db + 376 /* &.aModule */))).Ffirst; pThis != 0; pThis = pNext {
+ for pThis = (*Hash)(unsafe.Pointer(db + 400)).Ffirst; pThis != 0; pThis = pNext {
var pMod uintptr = (*HashElem)(unsafe.Pointer(pThis)).Fdata
pNext = (*HashElem)(unsafe.Pointer(pThis)).Fnext
if azNames != 0 {
var ii int32
- for ii = 0; (*(*uintptr)(unsafe.Pointer(azNames + uintptr(ii)*4)) != uintptr(0)) && (libc.Xstrcmp(tls, *(*uintptr)(unsafe.Pointer(azNames + uintptr(ii)*4)), (*Module)(unsafe.Pointer(pMod)).FzName) != 0); ii++ {
+ for ii = 0; *(*uintptr)(unsafe.Pointer(azNames + uintptr(ii)*4)) != uintptr(0) && libc.Xstrcmp(tls, *(*uintptr)(unsafe.Pointer(azNames + uintptr(ii)*4)), (*Module)(unsafe.Pointer(pMod)).FzName) != 0; ii++ {
}
if *(*uintptr)(unsafe.Pointer(azNames + uintptr(ii)*4)) != uintptr(0) {
continue
@@ -125350,7 +127279,7 @@ func Xsqlite3_drop_modules(tls *libc.TLS, db uintptr, azNames uintptr) int32 { /
// Decrement the reference count on a Module object. Destroy the
// module when the reference count reaches zero.
-func Xsqlite3VtabModuleUnref(tls *libc.TLS, db uintptr, pMod uintptr) { /* sqlite3.c:143311:21: */
+func Xsqlite3VtabModuleUnref(tls *libc.TLS, db uintptr, pMod uintptr) { /* sqlite3.c:144602:21: */
(*Module)(unsafe.Pointer(pMod)).FnRefModule--
if (*Module)(unsafe.Pointer(pMod)).FnRefModule == 0 {
@@ -125368,24 +127297,24 @@ func Xsqlite3VtabModuleUnref(tls *libc.TLS, db uintptr, pMod uintptr) { /* sqlit
//
// If a disconnect is attempted while a virtual table is locked,
// the disconnect is deferred until all locks have been removed.
-func Xsqlite3VtabLock(tls *libc.TLS, pVTab uintptr) { /* sqlite3.c:143331:21: */
+func Xsqlite3VtabLock(tls *libc.TLS, pVTab uintptr) { /* sqlite3.c:144622:21: */
(*VTable)(unsafe.Pointer(pVTab)).FnRef++
}
// pTab is a pointer to a Table structure representing a virtual-table.
// Return a pointer to the VTable object used by connection db to access
// this virtual-table, if one has been created, or NULL otherwise.
-func Xsqlite3GetVTable(tls *libc.TLS, db uintptr, pTab uintptr) uintptr { /* sqlite3.c:143341:23: */
+func Xsqlite3GetVTable(tls *libc.TLS, db uintptr, pTab uintptr) uintptr { /* sqlite3.c:144632:23: */
var pVtab uintptr
- for pVtab = (*Table)(unsafe.Pointer(pTab)).FpVTable; (pVtab != 0) && ((*VTable)(unsafe.Pointer(pVtab)).Fdb != db); pVtab = (*VTable)(unsafe.Pointer(pVtab)).FpNext {
+ for pVtab = *(*uintptr)(unsafe.Pointer(pTab + 44 + 8 /* &.p */)); pVtab != 0 && (*VTable)(unsafe.Pointer(pVtab)).Fdb != db; pVtab = (*VTable)(unsafe.Pointer(pVtab)).FpNext {
}
return pVtab
}
// Decrement the ref-count on a virtual table object. When the ref-count
// reaches zero, call the xDisconnect() method to delete the object.
-func Xsqlite3VtabUnlock(tls *libc.TLS, pVTab uintptr) { /* sqlite3.c:143352:21: */
+func Xsqlite3VtabUnlock(tls *libc.TLS, pVTab uintptr) { /* sqlite3.c:144643:21: */
var db uintptr = (*VTable)(unsafe.Pointer(pVTab)).Fdb
(*VTable)(unsafe.Pointer(pVTab)).FnRef--
@@ -125402,20 +127331,22 @@ func Xsqlite3VtabUnlock(tls *libc.TLS, pVTab uintptr) { /* sqlite3.c:143352:21:
}
// Table p is a virtual table. This function moves all elements in the
-// p->pVTable list to the sqlite3.pDisconnect lists of their associated
+// p->u.vtab.p list to the sqlite3.pDisconnect lists of their associated
// database connections to be disconnected at the next opportunity.
// Except, if argument db is not NULL, then the entry associated with
-// connection db is left in the p->pVTable list.
-func vtabDisconnectAll(tls *libc.TLS, db uintptr, p uintptr) uintptr { /* sqlite3.c:143377:15: */
+// connection db is left in the p->u.vtab.p list.
+func vtabDisconnectAll(tls *libc.TLS, db uintptr, p uintptr) uintptr { /* sqlite3.c:144669:15: */
var pRet uintptr = uintptr(0)
- var pVTable uintptr = (*Table)(unsafe.Pointer(p)).FpVTable
- (*Table)(unsafe.Pointer(p)).FpVTable = uintptr(0)
+ var pVTable uintptr
+
+ pVTable = *(*uintptr)(unsafe.Pointer(p + 44 + 8 /* &.p */))
+ *(*uintptr)(unsafe.Pointer(p + 44 + 8 /* &.p */)) = uintptr(0)
// Assert that the mutex (if any) associated with the BtShared database
// that contains table p is held by the caller. See header comments
// above function sqlite3VtabUnlockList() for an explanation of why
// this makes it safe to access the sqlite3.pDisconnect list of any
- // database connection that may have an entry in the p->pVTable list.
+ // database connection that may have an entry in the p->u.vtab.p list.
for pVTable != 0 {
var db2 uintptr = (*VTable)(unsafe.Pointer(pVTable)).Fdb
@@ -125423,7 +127354,7 @@ func vtabDisconnectAll(tls *libc.TLS, db uintptr, p uintptr) uintptr { /* sqlite
if db2 == db {
pRet = pVTable
- (*Table)(unsafe.Pointer(p)).FpVTable = pRet
+ *(*uintptr)(unsafe.Pointer(p + 44 + 8 /* &.p */)) = pRet
(*VTable)(unsafe.Pointer(pRet)).FpNext = uintptr(0)
} else {
(*VTable)(unsafe.Pointer(pVTable)).FpNext = (*Sqlite3)(unsafe.Pointer(db2)).FpDisconnect
@@ -125441,11 +127372,11 @@ func vtabDisconnectAll(tls *libc.TLS, db uintptr, p uintptr) uintptr { /* sqlite
// used when closing database connection db to free all of its VTable
// objects without disturbing the rest of the Schema object (which may
// be being used by other shared-cache connections).
-func Xsqlite3VtabDisconnect(tls *libc.TLS, db uintptr, p uintptr) { /* sqlite3.c:143417:21: */
+func Xsqlite3VtabDisconnect(tls *libc.TLS, db uintptr, p uintptr) { /* sqlite3.c:144712:21: */
var ppVTab uintptr
- for ppVTab = (p + 64 /* &.pVTable */); *(*uintptr)(unsafe.Pointer(ppVTab)) != 0; ppVTab = (*(*uintptr)(unsafe.Pointer(ppVTab)) + 24 /* &.pNext */) {
- if (*VTable)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(ppVTab))))).Fdb == db {
+ for ppVTab = p + 44 + 8; *(*uintptr)(unsafe.Pointer(ppVTab)) != 0; ppVTab = *(*uintptr)(unsafe.Pointer(ppVTab)) + 24 {
+ if (*VTable)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(ppVTab)))).Fdb == db {
var pVTab uintptr = *(*uintptr)(unsafe.Pointer(ppVTab))
*(*uintptr)(unsafe.Pointer(ppVTab)) = (*VTable)(unsafe.Pointer(pVTab)).FpNext
Xsqlite3VtabUnlock(tls, pVTab)
@@ -125472,7 +127403,7 @@ func Xsqlite3VtabDisconnect(tls *libc.TLS, db uintptr, p uintptr) { /* sqlite3.c
//
// As a result, a sqlite3.pDisconnect cannot be accessed simultaneously
// by multiple threads. It is thread-safe.
-func Xsqlite3VtabUnlockList(tls *libc.TLS, db uintptr) { /* sqlite3.c:143455:21: */
+func Xsqlite3VtabUnlockList(tls *libc.TLS, db uintptr) { /* sqlite3.c:144750:21: */
var p uintptr = (*Sqlite3)(unsafe.Pointer(db)).FpDisconnect
if p != 0 {
@@ -125498,50 +127429,53 @@ func Xsqlite3VtabUnlockList(tls *libc.TLS, db uintptr) { /* sqlite3.c:143455:21:
// structure being xDisconnected and free). Any other VTable structures
// in the list are moved to the sqlite3.pDisconnect list of the associated
// database connection.
-func Xsqlite3VtabClear(tls *libc.TLS, db uintptr, p uintptr) { /* sqlite3.c:143486:21: */
- if !(db != 0) || ((*Sqlite3)(unsafe.Pointer(db)).FpnBytesFreed == uintptr(0)) {
+func Xsqlite3VtabClear(tls *libc.TLS, db uintptr, p uintptr) { /* sqlite3.c:144781:21: */
+
+ if !(db != 0) || (*Sqlite3)(unsafe.Pointer(db)).FpnBytesFreed == uintptr(0) {
vtabDisconnectAll(tls, uintptr(0), p)
}
- if (*Table)(unsafe.Pointer(p)).FazModuleArg != 0 {
+ if *(*uintptr)(unsafe.Pointer(p + 44 + 4)) != 0 {
var i int32
- for i = 0; i < (*Table)(unsafe.Pointer(p)).FnModuleArg; i++ {
+ for i = 0; i < *(*int32)(unsafe.Pointer(p + 44 /* &.u */ /* &.vtab */ /* &.nArg */)); i++ {
if i != 1 {
- Xsqlite3DbFree(tls, db, *(*uintptr)(unsafe.Pointer((*Table)(unsafe.Pointer(p)).FazModuleArg + uintptr(i)*4)))
+ Xsqlite3DbFree(tls, db, *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(p + 44 + 4 /* &.azArg */)) + uintptr(i)*4)))
}
}
- Xsqlite3DbFree(tls, db, (*Table)(unsafe.Pointer(p)).FazModuleArg)
+ Xsqlite3DbFree(tls, db, *(*uintptr)(unsafe.Pointer(p + 44 + 4 /* &.azArg */)))
}
}
-// Add a new module argument to pTable->azModuleArg[].
+// Add a new module argument to pTable->u.vtab.azArg[].
// The string is not copied - the pointer is stored. The
// string will be freed automatically when the table is
// deleted.
-func addModuleArgument(tls *libc.TLS, pParse uintptr, pTable uintptr, zArg uintptr) { /* sqlite3.c:143503:13: */
+func addModuleArgument(tls *libc.TLS, pParse uintptr, pTable uintptr, zArg uintptr) { /* sqlite3.c:144799:13: */
bp := tls.Alloc(8)
defer tls.Free(8)
- var nBytes Sqlite3_int64 = (Sqlite3_int64(uint32(unsafe.Sizeof(uintptr(0))) * (uint32(2 + (*Table)(unsafe.Pointer(pTable)).FnModuleArg))))
+ var nBytes Sqlite3_int64
var azModuleArg uintptr
var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb
- if ((*Table)(unsafe.Pointer(pTable)).FnModuleArg + 3) >= *(*int32)(unsafe.Pointer((db + 112 /* &.aLimit */) + 2*4)) {
- Xsqlite3ErrorMsg(tls, pParse, ts+11156 /* "too many columns..." */, libc.VaList(bp, (*Table)(unsafe.Pointer(pTable)).FzName))
+
+ nBytes = Sqlite3_int64(uint32(unsafe.Sizeof(uintptr(0))) * uint32(2+*(*int32)(unsafe.Pointer(pTable + 44))))
+ if *(*int32)(unsafe.Pointer(pTable + 44))+3 >= *(*int32)(unsafe.Pointer(db + 120 + 2*4)) {
+ Xsqlite3ErrorMsg(tls, pParse, ts+12270 /* "too many columns..." */, libc.VaList(bp, (*Table)(unsafe.Pointer(pTable)).FzName))
}
- azModuleArg = Xsqlite3DbRealloc(tls, db, (*Table)(unsafe.Pointer(pTable)).FazModuleArg, uint64(nBytes))
+ azModuleArg = Xsqlite3DbRealloc(tls, db, *(*uintptr)(unsafe.Pointer(pTable + 44 + 4 /* &.azArg */)), uint64(nBytes))
if azModuleArg == uintptr(0) {
Xsqlite3DbFree(tls, db, zArg)
} else {
- var i int32 = libc.PostIncInt32(&(*Table)(unsafe.Pointer(pTable)).FnModuleArg, 1)
+ var i int32 = libc.PostIncInt32(&*(*int32)(unsafe.Pointer(pTable + 44)), 1)
*(*uintptr)(unsafe.Pointer(azModuleArg + uintptr(i)*4)) = zArg
- *(*uintptr)(unsafe.Pointer(azModuleArg + uintptr((i+1))*4)) = uintptr(0)
- (*Table)(unsafe.Pointer(pTable)).FazModuleArg = azModuleArg
+ *(*uintptr)(unsafe.Pointer(azModuleArg + uintptr(i+1)*4)) = uintptr(0)
+ *(*uintptr)(unsafe.Pointer(pTable + 44 + 4 /* &.azArg */)) = azModuleArg
}
}
// The parser calls this routine when it first sees a CREATE VIRTUAL TABLE
// statement. The module name has been parsed, but the optional list
// of parameters that follow the module name are still pending.
-func Xsqlite3VtabBeginParse(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 uintptr, pModuleName uintptr, ifNotExists int32) { /* sqlite3.c:143526:21: */
+func Xsqlite3VtabBeginParse(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 uintptr, pModuleName uintptr, ifNotExists int32) { /* sqlite3.c:144825:21: */
var pTable uintptr // The new virtual table
var db uintptr // Database connection
@@ -125551,31 +127485,33 @@ func Xsqlite3VtabBeginParse(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName
return
}
+ (*Table)(unsafe.Pointer(pTable)).FeTabType = U8(TABTYP_VTAB)
+
db = (*Parse)(unsafe.Pointer(pParse)).Fdb
addModuleArgument(tls, pParse, pTable, Xsqlite3NameFromToken(tls, db, pModuleName))
addModuleArgument(tls, pParse, pTable, uintptr(0))
addModuleArgument(tls, pParse, pTable, Xsqlite3DbStrDup(tls, db, (*Table)(unsafe.Pointer(pTable)).FzName))
- (*Parse)(unsafe.Pointer(pParse)).FsNameToken.Fn = uint32(((int32(((*Token)(unsafe.Pointer(pModuleName)).Fz + uintptr((*Token)(unsafe.Pointer(pModuleName)).Fn))) - int32((*Parse)(unsafe.Pointer(pParse)).FsNameToken.Fz)) / 1))
+ (*Parse)(unsafe.Pointer(pParse)).FsNameToken.Fn = uint32((int32((*Token)(unsafe.Pointer(pModuleName)).Fz+uintptr((*Token)(unsafe.Pointer(pModuleName)).Fn)) - int32((*Parse)(unsafe.Pointer(pParse)).FsNameToken.Fz)) / 1)
// Creating a virtual table invokes the authorization callback twice.
// The first invocation, to obtain permission to INSERT a row into the
// sqlite_schema table, has already been made by sqlite3StartTable().
// The second call, to obtain permission to create the table, is made now.
- if (*Table)(unsafe.Pointer(pTable)).FazModuleArg != 0 {
+ if *(*uintptr)(unsafe.Pointer(pTable + 44 + 4)) != 0 {
var iDb int32 = Xsqlite3SchemaToIndex(tls, db, (*Table)(unsafe.Pointer(pTable)).FpSchema)
// The database the table is being created in
Xsqlite3AuthCheck(tls, pParse, SQLITE_CREATE_VTABLE, (*Table)(unsafe.Pointer(pTable)).FzName,
- *(*uintptr)(unsafe.Pointer((*Table)(unsafe.Pointer(pTable)).FazModuleArg)), (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer((*Parse)(unsafe.Pointer(pParse)).Fdb)).FaDb+uintptr(iDb)*16)).FzDbSName)
+ *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pTable + 44 + 4 /* &.azArg */)))), (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer((*Parse)(unsafe.Pointer(pParse)).Fdb)).FaDb+uintptr(iDb)*16)).FzDbSName)
}
}
// This routine takes the module argument that has been accumulating
// in pParse->zArg[] and appends it to the list of arguments on the
// virtual table currently under construction in pParse->pTable.
-func addArgumentToVtab(tls *libc.TLS, pParse uintptr) { /* sqlite3.c:143574:13: */
- if ((*Parse)(unsafe.Pointer(pParse)).FsArg.Fz != 0) && ((*Parse)(unsafe.Pointer(pParse)).FpNewTable != 0) {
+func addArgumentToVtab(tls *libc.TLS, pParse uintptr) { /* sqlite3.c:144874:13: */
+ if (*Parse)(unsafe.Pointer(pParse)).FsArg.Fz != 0 && (*Parse)(unsafe.Pointer(pParse)).FpNewTable != 0 {
var z uintptr = (*Parse)(unsafe.Pointer(pParse)).FsArg.Fz
var n int32 = int32((*Parse)(unsafe.Pointer(pParse)).FsArg.Fn)
var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb
@@ -125585,7 +127521,7 @@ func addArgumentToVtab(tls *libc.TLS, pParse uintptr) { /* sqlite3.c:143574:13:
// The parser calls this routine after the CREATE VIRTUAL TABLE statement
// has been completely parsed.
-func Xsqlite3VtabFinishParse(tls *libc.TLS, pParse uintptr, pEnd uintptr) { /* sqlite3.c:143587:21: */
+func Xsqlite3VtabFinishParse(tls *libc.TLS, pParse uintptr, pEnd uintptr) { /* sqlite3.c:144887:21: */
bp := tls.Alloc(64)
defer tls.Free(64)
@@ -125595,9 +127531,10 @@ func Xsqlite3VtabFinishParse(tls *libc.TLS, pParse uintptr, pEnd uintptr) { /* s
if pTab == uintptr(0) {
return
}
+
addArgumentToVtab(tls, pParse)
(*Parse)(unsafe.Pointer(pParse)).FsArg.Fz = uintptr(0)
- if (*Table)(unsafe.Pointer(pTab)).FnModuleArg < 1 {
+ if *(*int32)(unsafe.Pointer(pTab + 44)) < 1 {
return
}
@@ -125617,9 +127554,9 @@ func Xsqlite3VtabFinishParse(tls *libc.TLS, pParse uintptr, pEnd uintptr) { /* s
// Compute the complete text of the CREATE VIRTUAL TABLE statement
if pEnd != 0 {
- (*Parse)(unsafe.Pointer(pParse)).FsNameToken.Fn = (uint32(((int32((*Token)(unsafe.Pointer(pEnd)).Fz) - int32((*Parse)(unsafe.Pointer(pParse)).FsNameToken.Fz)) / 1)) + (*Token)(unsafe.Pointer(pEnd)).Fn)
+ (*Parse)(unsafe.Pointer(pParse)).FsNameToken.Fn = uint32((int32((*Token)(unsafe.Pointer(pEnd)).Fz)-int32((*Parse)(unsafe.Pointer(pParse)).FsNameToken.Fz))/1) + (*Token)(unsafe.Pointer(pEnd)).Fn
}
- zStmt = Xsqlite3MPrintf(tls, db, ts+19591 /* "CREATE VIRTUAL T..." */, libc.VaList(bp, (pParse+180 /* &.sNameToken */)))
+ zStmt = Xsqlite3MPrintf(tls, db, ts+20888 /* "CREATE VIRTUAL T..." */, libc.VaList(bp, pParse+176))
// A slot for the record has already been allocated in the
// schema table. We just need to update that slot with all
@@ -125631,7 +127568,7 @@ func Xsqlite3VtabFinishParse(tls *libc.TLS, pParse uintptr, pEnd uintptr) { /* s
iDb = Xsqlite3SchemaToIndex(tls, db, (*Table)(unsafe.Pointer(pTab)).FpSchema)
Xsqlite3NestedParse(tls, pParse,
- ts+19615, /* "UPDATE %Q.sqlite..." */
+ ts+20912, /* "UPDATE %Q.sqlite..." */
libc.VaList(bp+8, (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+uintptr(iDb)*16)).FzDbSName,
(*Table)(unsafe.Pointer(pTab)).FzName,
(*Table)(unsafe.Pointer(pTab)).FzName,
@@ -125641,7 +127578,7 @@ func Xsqlite3VtabFinishParse(tls *libc.TLS, pParse uintptr, pEnd uintptr) { /* s
Xsqlite3ChangeCookie(tls, pParse, iDb)
Xsqlite3VdbeAddOp0(tls, v, OP_Expire)
- zWhere = Xsqlite3MPrintf(tls, db, ts+19714 /* "name=%Q AND sql=..." */, libc.VaList(bp+48, (*Table)(unsafe.Pointer(pTab)).FzName, zStmt))
+ zWhere = Xsqlite3MPrintf(tls, db, ts+21011 /* "name=%Q AND sql=..." */, libc.VaList(bp+48, (*Table)(unsafe.Pointer(pTab)).FzName, zStmt))
Xsqlite3VdbeAddParseSchemaOp(tls, v, iDb, zWhere, uint16(0))
Xsqlite3DbFree(tls, db, zStmt)
@@ -125649,11 +127586,14 @@ func Xsqlite3VtabFinishParse(tls *libc.TLS, pParse uintptr, pEnd uintptr) { /* s
Xsqlite3VdbeLoadString(tls, v, iReg, (*Table)(unsafe.Pointer(pTab)).FzName)
Xsqlite3VdbeAddOp2(tls, v, OP_VCreate, iDb, iReg)
} else {
+ // If we are rereading the sqlite_schema table create the in-memory
+ // record of the table.
var pOld uintptr
var pSchema uintptr = (*Table)(unsafe.Pointer(pTab)).FpSchema
var zName uintptr = (*Table)(unsafe.Pointer(pTab)).FzName
- pOld = Xsqlite3HashInsert(tls, (pSchema + 8 /* &.tblHash */), zName, pTab)
+ Xsqlite3MarkAllShadowTablesOf(tls, db, pTab)
+ pOld = Xsqlite3HashInsert(tls, pSchema+8, zName, pTab)
if pOld != 0 {
Xsqlite3OomFault(tls, db)
// Malloc must have failed inside HashInsert()
@@ -125665,7 +127605,7 @@ func Xsqlite3VtabFinishParse(tls *libc.TLS, pParse uintptr, pEnd uintptr) { /* s
// The parser calls this routine when it sees the first token
// of an argument to the module name in a CREATE VIRTUAL TABLE statement.
-func Xsqlite3VtabArgInit(tls *libc.TLS, pParse uintptr) { /* sqlite3.c:143673:21: */
+func Xsqlite3VtabArgInit(tls *libc.TLS, pParse uintptr) { /* sqlite3.c:144970:21: */
addArgumentToVtab(tls, pParse)
(*Parse)(unsafe.Pointer(pParse)).FsArg.Fz = uintptr(0)
(*Parse)(unsafe.Pointer(pParse)).FsArg.Fn = uint32(0)
@@ -125673,21 +127613,21 @@ func Xsqlite3VtabArgInit(tls *libc.TLS, pParse uintptr) { /* sqlite3.c:143673:21
// The parser calls this routine for each token after the first token
// in an argument to the module name in a CREATE VIRTUAL TABLE statement.
-func Xsqlite3VtabArgExtend(tls *libc.TLS, pParse uintptr, p uintptr) { /* sqlite3.c:143683:21: */
- var pArg uintptr = (pParse + 244 /* &.sArg */)
+func Xsqlite3VtabArgExtend(tls *libc.TLS, pParse uintptr, p uintptr) { /* sqlite3.c:144980:21: */
+ var pArg uintptr = pParse + 240
if (*Token)(unsafe.Pointer(pArg)).Fz == uintptr(0) {
(*Token)(unsafe.Pointer(pArg)).Fz = (*Token)(unsafe.Pointer(p)).Fz
(*Token)(unsafe.Pointer(pArg)).Fn = (*Token)(unsafe.Pointer(p)).Fn
} else {
- (*Token)(unsafe.Pointer(pArg)).Fn = uint32(((int32(((*Token)(unsafe.Pointer(p)).Fz + uintptr((*Token)(unsafe.Pointer(p)).Fn))) - int32((*Token)(unsafe.Pointer(pArg)).Fz)) / 1))
+ (*Token)(unsafe.Pointer(pArg)).Fn = uint32((int32((*Token)(unsafe.Pointer(p)).Fz+uintptr((*Token)(unsafe.Pointer(p)).Fn)) - int32((*Token)(unsafe.Pointer(pArg)).Fz)) / 1)
}
}
// Invoke a virtual table constructor (either xCreate or xConnect). The
// pointer to the function to invoke is passed as the fourth parameter
// to this procedure.
-func vtabCallConstructor(tls *libc.TLS, db uintptr, pTab uintptr, pMod uintptr, xConstruct uintptr, pzErr uintptr) int32 { /* sqlite3.c:143699:12: */
+func vtabCallConstructor(tls *libc.TLS, db uintptr, pTab uintptr, pMod uintptr, xConstruct uintptr, pzErr uintptr) int32 { /* sqlite3.c:144996:12: */
bp := tls.Alloc(52)
defer tls.Free(52)
@@ -125695,18 +127635,20 @@ func vtabCallConstructor(tls *libc.TLS, db uintptr, pTab uintptr, pMod uintptr,
var pVTable uintptr
var rc int32
- var azArg uintptr = (*Table)(unsafe.Pointer(pTab)).FazModuleArg
- var nArg int32 = (*Table)(unsafe.Pointer(pTab)).FnModuleArg
+ var azArg uintptr
+ var nArg int32 = *(*int32)(unsafe.Pointer(pTab + 44))
*(*uintptr)(unsafe.Pointer(bp + 48 /* zErr */)) = uintptr(0)
var zModuleName uintptr
var iDb int32
var pCtx uintptr
+ azArg = *(*uintptr)(unsafe.Pointer(pTab + 44 + 4 /* &.azArg */))
+
// Check that the virtual-table is not already being initialized
for pCtx = (*Sqlite3)(unsafe.Pointer(db)).FpVtabCtx; pCtx != 0; pCtx = (*VtabCtx)(unsafe.Pointer(pCtx)).FpPrior {
if (*VtabCtx)(unsafe.Pointer(pCtx)).FpTab == pTab {
*(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3MPrintf(tls, db,
- ts+19733 /* "vtable construct..." */, libc.VaList(bp, (*Table)(unsafe.Pointer(pTab)).FzName))
+ ts+21030 /* "vtable construct..." */, libc.VaList(bp, (*Table)(unsafe.Pointer(pTab)).FzName))
return SQLITE_LOCKED
}
}
@@ -125727,7 +127669,7 @@ func vtabCallConstructor(tls *libc.TLS, db uintptr, pTab uintptr, pMod uintptr,
(*VTable)(unsafe.Pointer(pVTable)).FeVtabRisk = U8(SQLITE_VTABRISK_Normal)
iDb = Xsqlite3SchemaToIndex(tls, db, (*Table)(unsafe.Pointer(pTab)).FpSchema)
- *(*uintptr)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FazModuleArg + 1*4)) = (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*16)).FzDbSName
+ *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pTab + 44 + 4 /* &.azArg */)) + 1*4)) = (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*16)).FzDbSName
// Invoke the virtual table constructor
@@ -125738,17 +127680,17 @@ func vtabCallConstructor(tls *libc.TLS, db uintptr, pTab uintptr, pMod uintptr,
(*Sqlite3)(unsafe.Pointer(db)).FpVtabCtx = bp + 32 /* &sCtx */
rc = (*struct {
f func(*libc.TLS, uintptr, uintptr, int32, uintptr, uintptr, uintptr) int32
- })(unsafe.Pointer(&struct{ uintptr }{xConstruct})).f(tls, db, (*Module)(unsafe.Pointer(pMod)).FpAux, nArg, azArg, (pVTable + 8 /* &.pVtab */), bp+48 /* &zErr */)
+ })(unsafe.Pointer(&struct{ uintptr }{xConstruct})).f(tls, db, (*Module)(unsafe.Pointer(pMod)).FpAux, nArg, azArg, pVTable+8 /* &.pVtab */, bp+48 /* &zErr */)
(*Sqlite3)(unsafe.Pointer(db)).FpVtabCtx = (*VtabCtx)(unsafe.Pointer(bp + 32 /* &sCtx */)).FpPrior
if rc == SQLITE_NOMEM {
Xsqlite3OomFault(tls, db)
}
if SQLITE_OK != rc {
- if *(*uintptr)(unsafe.Pointer(bp + 48 /* zErr */)) == uintptr(0) {
- *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3MPrintf(tls, db, ts+19775 /* "vtable construct..." */, libc.VaList(bp+8, zModuleName))
+ if *(*uintptr)(unsafe.Pointer(bp + 48)) == uintptr(0) {
+ *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3MPrintf(tls, db, ts+21072 /* "vtable construct..." */, libc.VaList(bp+8, zModuleName))
} else {
- *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3MPrintf(tls, db, ts+2790 /* "%s" */, libc.VaList(bp+16, *(*uintptr)(unsafe.Pointer(bp + 48 /* zErr */))))
+ *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3MPrintf(tls, db, ts+3601 /* "%s" */, libc.VaList(bp+16, *(*uintptr)(unsafe.Pointer(bp + 48 /* zErr */))))
Xsqlite3_free(tls, *(*uintptr)(unsafe.Pointer(bp + 48 /* zErr */)))
}
Xsqlite3DbFree(tls, db, pVTable)
@@ -125759,8 +127701,8 @@ func vtabCallConstructor(tls *libc.TLS, db uintptr, pTab uintptr, pMod uintptr,
(*Sqlite3_vtab)(unsafe.Pointer((*VTable)(unsafe.Pointer(pVTable)).FpVtab)).FpModule = (*Module)(unsafe.Pointer(pMod)).FpModule
(*Module)(unsafe.Pointer(pMod)).FnRefModule++
(*VTable)(unsafe.Pointer(pVTable)).FnRef = 1
- if (*VtabCtx)(unsafe.Pointer(bp+32 /* &sCtx */)).FbDeclared == 0 {
- var zFormat uintptr = ts + 19805 /* "vtable construct..." */
+ if (*VtabCtx)(unsafe.Pointer(bp+32)).FbDeclared == 0 {
+ var zFormat uintptr = ts + 21102 /* "vtable construct..." */
*(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3MPrintf(tls, db, zFormat, libc.VaList(bp+24, (*Table)(unsafe.Pointer(pTab)).FzName))
Xsqlite3VtabUnlock(tls, pVTable)
rc = SQLITE_ERROR
@@ -125768,45 +127710,45 @@ func vtabCallConstructor(tls *libc.TLS, db uintptr, pTab uintptr, pMod uintptr,
var iCol int32
var oooHidden U16 = U16(0)
// If everything went according to plan, link the new VTable structure
- // into the linked list headed by pTab->pVTable. Then loop through the
+ // into the linked list headed by pTab->u.vtab.p. Then loop through the
// columns of the table to see if any of them contain the token "hidden".
// If so, set the Column COLFLAG_HIDDEN flag and remove the token from
// the type string.
- (*VTable)(unsafe.Pointer(pVTable)).FpNext = (*Table)(unsafe.Pointer(pTab)).FpVTable
- (*Table)(unsafe.Pointer(pTab)).FpVTable = pVTable
+ (*VTable)(unsafe.Pointer(pVTable)).FpNext = *(*uintptr)(unsafe.Pointer(pTab + 44 + 8 /* &.p */))
+ *(*uintptr)(unsafe.Pointer(pTab + 44 + 8 /* &.p */)) = pVTable
for iCol = 0; iCol < int32((*Table)(unsafe.Pointer(pTab)).FnCol); iCol++ {
- var zType uintptr = Xsqlite3ColumnType(tls, ((*Table)(unsafe.Pointer(pTab)).FaCol + uintptr(iCol)*20), ts+755 /* "" */)
+ var zType uintptr = Xsqlite3ColumnType(tls, (*Table)(unsafe.Pointer(pTab)).FaCol+uintptr(iCol)*16, ts+1543 /* "" */)
var nType int32
var i int32 = 0
nType = Xsqlite3Strlen30(tls, zType)
for i = 0; i < nType; i++ {
- if ((0 == Xsqlite3_strnicmp(tls, ts+14670 /* "hidden" */, (zType+uintptr(i)), 6)) &&
- ((i == 0) || (int32(*(*uint8)(unsafe.Pointer(zType + uintptr((i - 1))))) == ' '))) &&
- ((int32(*(*uint8)(unsafe.Pointer(zType + uintptr((i + 6))))) == 0) || (int32(*(*uint8)(unsafe.Pointer(zType + uintptr((i + 6))))) == ' ')) {
+ if 0 == Xsqlite3_strnicmp(tls, ts+15852, zType+uintptr(i), 6) &&
+ (i == 0 || int32(*(*uint8)(unsafe.Pointer(zType + uintptr(i-1)))) == ' ') &&
+ (int32(*(*uint8)(unsafe.Pointer(zType + uintptr(i+6)))) == 0 || int32(*(*uint8)(unsafe.Pointer(zType + uintptr(i+6)))) == ' ') {
break
}
}
if i < nType {
var j int32
- var nDel int32 = (6 + (func() int32 {
- if *(*uint8)(unsafe.Pointer(zType + uintptr((i + 6)))) != 0 {
+ var nDel int32 = 6 + func() int32 {
+ if *(*uint8)(unsafe.Pointer(zType + uintptr(i+6))) != 0 {
return 1
}
return 0
- }()))
- for j = i; (j + nDel) <= nType; j++ {
- *(*uint8)(unsafe.Pointer(zType + uintptr(j))) = *(*uint8)(unsafe.Pointer(zType + uintptr((j + nDel))))
+ }()
+ for j = i; j+nDel <= nType; j++ {
+ *(*uint8)(unsafe.Pointer(zType + uintptr(j))) = *(*uint8)(unsafe.Pointer(zType + uintptr(j+nDel)))
}
- if (int32(*(*uint8)(unsafe.Pointer(zType + uintptr(i)))) == 0) && (i > 0) {
+ if int32(*(*uint8)(unsafe.Pointer(zType + uintptr(i)))) == 0 && i > 0 {
- *(*uint8)(unsafe.Pointer(zType + uintptr((i - 1)))) = uint8(0)
+ *(*uint8)(unsafe.Pointer(zType + uintptr(i-1))) = uint8(0)
}
- *(*U16)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FaCol + uintptr(iCol)*20 + 16 /* &.colFlags */)) |= U16((COLFLAG_HIDDEN))
- *(*U32)(unsafe.Pointer(pTab + 36 /* &.tabFlags */)) |= (U32(TF_HasHidden))
+ *(*U16)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FaCol + uintptr(iCol)*16 + 12)) |= U16(COLFLAG_HIDDEN)
+ *(*U32)(unsafe.Pointer(pTab + 28)) |= U32(TF_HasHidden)
oooHidden = U16(TF_OOOHidden)
} else {
- *(*U32)(unsafe.Pointer(pTab + 36 /* &.tabFlags */)) |= (U32(oooHidden))
+ *(*U32)(unsafe.Pointer(pTab + 28)) |= U32(oooHidden)
}
}
}
@@ -125821,7 +127763,7 @@ func vtabCallConstructor(tls *libc.TLS, db uintptr, pTab uintptr, pMod uintptr,
// and an error left in pParse.
//
// This call is a no-op if table pTab is not a virtual table.
-func Xsqlite3VtabCallConnect(tls *libc.TLS, pParse uintptr, pTab uintptr) int32 { /* sqlite3.c:143832:20: */
+func Xsqlite3VtabCallConnect(tls *libc.TLS, pParse uintptr, pTab uintptr) int32 { /* sqlite3.c:145132:20: */
bp := tls.Alloc(20)
defer tls.Free(20)
@@ -125830,23 +127772,23 @@ func Xsqlite3VtabCallConnect(tls *libc.TLS, pParse uintptr, pTab uintptr) int32
var pMod uintptr
var rc int32
- if !((*Table)(unsafe.Pointer(pTab)).FnModuleArg != 0) || (Xsqlite3GetVTable(tls, db, pTab) != 0) {
+ if Xsqlite3GetVTable(tls, db, pTab) != 0 {
return SQLITE_OK
}
// Locate the required virtual table module
- zMod = *(*uintptr)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FazModuleArg))
- pMod = Xsqlite3HashFind(tls, (db + 376 /* &.aModule */), zMod)
+ zMod = *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pTab + 44 + 4 /* &.azArg */))))
+ pMod = Xsqlite3HashFind(tls, db+400, zMod)
if !(pMod != 0) {
- var zModule uintptr = *(*uintptr)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FazModuleArg))
- Xsqlite3ErrorMsg(tls, pParse, ts+19851 /* "no such module: ..." */, libc.VaList(bp, zModule))
+ var zModule uintptr = *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pTab + 44 + 4 /* &.azArg */))))
+ Xsqlite3ErrorMsg(tls, pParse, ts+21148 /* "no such module: ..." */, libc.VaList(bp, zModule))
rc = SQLITE_ERROR
} else {
*(*uintptr)(unsafe.Pointer(bp + 16 /* zErr */)) = uintptr(0)
rc = vtabCallConstructor(tls, db, pTab, pMod, (*Sqlite3_module)(unsafe.Pointer((*Module)(unsafe.Pointer(pMod)).FpModule)).FxConnect, bp+16 /* &zErr */)
if rc != SQLITE_OK {
- Xsqlite3ErrorMsg(tls, pParse, ts+2790 /* "%s" */, libc.VaList(bp+8, *(*uintptr)(unsafe.Pointer(bp + 16 /* zErr */))))
+ Xsqlite3ErrorMsg(tls, pParse, ts+3601 /* "%s" */, libc.VaList(bp+8, *(*uintptr)(unsafe.Pointer(bp + 16 /* zErr */))))
(*Parse)(unsafe.Pointer(pParse)).Frc = rc
}
Xsqlite3DbFree(tls, db, *(*uintptr)(unsafe.Pointer(bp + 16 /* zErr */)))
@@ -125857,18 +127799,18 @@ func Xsqlite3VtabCallConnect(tls *libc.TLS, pParse uintptr, pTab uintptr) int32
// Grow the db->aVTrans[] array so that there is room for at least one
// more v-table. Return SQLITE_NOMEM if a malloc fails, or SQLITE_OK otherwise.
-func growVTrans(tls *libc.TLS, db uintptr) int32 { /* sqlite3.c:143867:12: */
+func growVTrans(tls *libc.TLS, db uintptr) int32 { /* sqlite3.c:145168:12: */
var ARRAY_INCR int32 = 5
// Grow the sqlite3.aVTrans array if required
- if ((*Sqlite3)(unsafe.Pointer(db)).FnVTrans % ARRAY_INCR) == 0 {
+ if (*Sqlite3)(unsafe.Pointer(db)).FnVTrans%ARRAY_INCR == 0 {
var aVTrans uintptr
- var nBytes Sqlite3_int64 = (Sqlite3_int64(unsafe.Sizeof(uintptr(0))) * (Sqlite3_int64((*Sqlite3)(unsafe.Pointer(db)).FnVTrans) + Sqlite3_int64(ARRAY_INCR)))
+ var nBytes Sqlite3_int64 = Sqlite3_int64(unsafe.Sizeof(uintptr(0))) * (Sqlite3_int64((*Sqlite3)(unsafe.Pointer(db)).FnVTrans) + Sqlite3_int64(ARRAY_INCR))
aVTrans = Xsqlite3DbRealloc(tls, db, (*Sqlite3)(unsafe.Pointer(db)).FaVTrans, uint64(nBytes))
if !(aVTrans != 0) {
return SQLITE_NOMEM
}
- libc.Xmemset(tls, (aVTrans + uintptr((*Sqlite3)(unsafe.Pointer(db)).FnVTrans)*4), 0, (uint32(unsafe.Sizeof(uintptr(0))) * uint32(ARRAY_INCR)))
+ libc.Xmemset(tls, aVTrans+uintptr((*Sqlite3)(unsafe.Pointer(db)).FnVTrans)*4, 0, uint32(unsafe.Sizeof(uintptr(0)))*uint32(ARRAY_INCR))
(*Sqlite3)(unsafe.Pointer(db)).FaVTrans = aVTrans
}
@@ -125877,7 +127819,7 @@ func growVTrans(tls *libc.TLS, db uintptr) int32 { /* sqlite3.c:143867:12: */
// Add the virtual table pVTab to the array sqlite3.aVTrans[]. Space should
// have already been reserved using growVTrans().
-func addToVTrans(tls *libc.TLS, db uintptr, pVTab uintptr) { /* sqlite3.c:143890:13: */
+func addToVTrans(tls *libc.TLS, db uintptr, pVTab uintptr) { /* sqlite3.c:145191:13: */
// Add pVtab to the end of sqlite3.aVTrans
*(*uintptr)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaVTrans + uintptr(libc.PostIncInt32(&(*Sqlite3)(unsafe.Pointer(db)).FnVTrans, 1))*4)) = pVTab
Xsqlite3VtabLock(tls, pVTab)
@@ -125889,7 +127831,7 @@ func addToVTrans(tls *libc.TLS, db uintptr, pVTab uintptr) { /* sqlite3.c:143890
// If an error occurs, *pzErr is set to point to an English language
// description of the error and an SQLITE_XXX error code is returned.
// In this case the caller must call sqlite3DbFree(db, ) on *pzErr.
-func Xsqlite3VtabCallCreate(tls *libc.TLS, db uintptr, iDb int32, zTab uintptr, pzErr uintptr) int32 { /* sqlite3.c:143904:20: */
+func Xsqlite3VtabCallCreate(tls *libc.TLS, db uintptr, iDb int32, zTab uintptr, pzErr uintptr) int32 { /* sqlite3.c:145205:20: */
bp := tls.Alloc(8)
defer tls.Free(8)
@@ -125901,14 +127843,14 @@ func Xsqlite3VtabCallCreate(tls *libc.TLS, db uintptr, iDb int32, zTab uintptr,
pTab = Xsqlite3FindTable(tls, db, zTab, (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+uintptr(iDb)*16)).FzDbSName)
// Locate the required virtual table module
- zMod = *(*uintptr)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FazModuleArg))
- pMod = Xsqlite3HashFind(tls, (db + 376 /* &.aModule */), zMod)
+ zMod = *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pTab + 44 + 4 /* &.azArg */))))
+ pMod = Xsqlite3HashFind(tls, db+400, zMod)
// If the module has been registered and includes a Create method,
// invoke it now. If the module has not been registered, return an
// error. Otherwise, do nothing.
- if ((pMod == uintptr(0)) || ((*Sqlite3_module)(unsafe.Pointer((*Module)(unsafe.Pointer(pMod)).FpModule)).FxCreate == uintptr(0))) || ((*Sqlite3_module)(unsafe.Pointer((*Module)(unsafe.Pointer(pMod)).FpModule)).FxDestroy == uintptr(0)) {
- *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3MPrintf(tls, db, ts+19851 /* "no such module: ..." */, libc.VaList(bp, zMod))
+ if pMod == uintptr(0) || (*Sqlite3_module)(unsafe.Pointer((*Module)(unsafe.Pointer(pMod)).FpModule)).FxCreate == uintptr(0) || (*Sqlite3_module)(unsafe.Pointer((*Module)(unsafe.Pointer(pMod)).FpModule)).FxDestroy == uintptr(0) {
+ *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3MPrintf(tls, db, ts+21148 /* "no such module: ..." */, libc.VaList(bp, zMod))
rc = SQLITE_ERROR
} else {
rc = vtabCallConstructor(tls, db, pTab, pMod, (*Sqlite3_module)(unsafe.Pointer((*Module)(unsafe.Pointer(pMod)).FpModule)).FxCreate, pzErr)
@@ -125916,7 +127858,7 @@ func Xsqlite3VtabCallCreate(tls *libc.TLS, db uintptr, iDb int32, zTab uintptr,
// Justification of ALWAYS(): The xConstructor method is required to
// create a valid sqlite3_vtab if it returns SQLITE_OK.
- if (rc == SQLITE_OK) && (Xsqlite3GetVTable(tls, db, pTab) != 0) {
+ if rc == SQLITE_OK && Xsqlite3GetVTable(tls, db, pTab) != 0 {
rc = growVTrans(tls, db)
if rc == SQLITE_OK {
addToVTrans(tls, db, Xsqlite3GetVTable(tls, db, pTab))
@@ -125929,46 +127871,54 @@ func Xsqlite3VtabCallCreate(tls *libc.TLS, db uintptr, iDb int32, zTab uintptr,
// This function is used to set the schema of a virtual table. It is only
// valid to call this function from within the xCreate() or xConnect() of a
// virtual table module.
-func Xsqlite3_declare_vtab(tls *libc.TLS, db uintptr, zCreateTable uintptr) int32 { /* sqlite3.c:143945:16: */
- bp := tls.Alloc(284)
- defer tls.Free(284)
+func Xsqlite3_declare_vtab(tls *libc.TLS, db uintptr, zCreateTable uintptr) int32 { /* sqlite3.c:145246:16: */
+ bp := tls.Alloc(280)
+ defer tls.Free(280)
var pCtx uintptr
var rc int32 = SQLITE_OK
var pTab uintptr
- *(*uintptr)(unsafe.Pointer(bp + 280 /* zErr */)) = uintptr(0)
- // var sParse Parse at bp+8, 272
+ *(*uintptr)(unsafe.Pointer(bp + 276 /* zErr */)) = uintptr(0)
+ // var sParse Parse at bp+8, 268
+
+ var initBusy int32
Xsqlite3_mutex_enter(tls, (*Sqlite3)(unsafe.Pointer(db)).Fmutex)
pCtx = (*Sqlite3)(unsafe.Pointer(db)).FpVtabCtx
- if !(pCtx != 0) || ((*VtabCtx)(unsafe.Pointer(pCtx)).FbDeclared != 0) {
+ if !(pCtx != 0) || (*VtabCtx)(unsafe.Pointer(pCtx)).FbDeclared != 0 {
Xsqlite3Error(tls, db, SQLITE_MISUSE)
Xsqlite3_mutex_leave(tls, (*Sqlite3)(unsafe.Pointer(db)).Fmutex)
- return Xsqlite3MisuseError(tls, 143962)
+ return Xsqlite3MisuseError(tls, 145264)
}
pTab = (*VtabCtx)(unsafe.Pointer(pCtx)).FpTab
libc.Xmemset(tls, bp+8 /* &sParse */, 0, uint32(unsafe.Sizeof(Parse{})))
(*Parse)(unsafe.Pointer(bp + 8 /* &sParse */)).FeParseMode = U8(PARSE_MODE_DECLARE_VTAB)
(*Parse)(unsafe.Pointer(bp + 8 /* &sParse */)).Fdb = db
+ // We should never be able to reach this point while loading the
+ // schema. Nevertheless, defend against that (turn off db->init.busy)
+ // in case a bug arises.
+
+ initBusy = int32((*Sqlite3)(unsafe.Pointer(db)).Finit.Fbusy)
+ (*Sqlite3)(unsafe.Pointer(db)).Finit.Fbusy = U8(0)
(*Parse)(unsafe.Pointer(bp + 8 /* &sParse */)).FnQueryLoop = U32(1)
- if ((((SQLITE_OK == Xsqlite3RunParser(tls, bp+8 /* &sParse */, zCreateTable, bp+280 /* &zErr */)) &&
- ((*Parse)(unsafe.Pointer(bp+8 /* &sParse */)).FpNewTable != 0)) &&
- !(int32((*Sqlite3)(unsafe.Pointer(db)).FmallocFailed) != 0)) &&
- !(int32((*Table)(unsafe.Pointer((*Parse)(unsafe.Pointer(bp+8 /* &sParse */)).FpNewTable)).FpSelect) != 0)) &&
- !((*Table)(unsafe.Pointer((*Parse)(unsafe.Pointer(bp+8 /* &sParse */)).FpNewTable)).FnModuleArg != 0) {
+ if SQLITE_OK == Xsqlite3RunParser(tls, bp+8, zCreateTable, bp+276) &&
+ (*Parse)(unsafe.Pointer(bp+8)).FpNewTable != 0 &&
+ !(int32((*Sqlite3)(unsafe.Pointer(db)).FmallocFailed) != 0) &&
+ int32((*Table)(unsafe.Pointer((*Parse)(unsafe.Pointer(bp+8)).FpNewTable)).FeTabType) == TABTYP_NORM {
if !(int32((*Table)(unsafe.Pointer(pTab)).FaCol) != 0) {
var pNew uintptr = (*Parse)(unsafe.Pointer(bp + 8 /* &sParse */)).FpNewTable
var pIdx uintptr
(*Table)(unsafe.Pointer(pTab)).FaCol = (*Table)(unsafe.Pointer(pNew)).FaCol
- (*Table)(unsafe.Pointer(pTab)).FnNVCol = libc.AssignPtrInt16(pTab+42 /* &.nCol */, (*Table)(unsafe.Pointer(pNew)).FnCol)
- *(*U32)(unsafe.Pointer(pTab + 36 /* &.tabFlags */)) |= ((*Table)(unsafe.Pointer(pNew)).FtabFlags & (U32(TF_WithoutRowid | TF_NoVisibleRowid)))
+ Xsqlite3ExprListDelete(tls, db, *(*uintptr)(unsafe.Pointer(pNew + 44 + 8 /* &.pDfltList */)))
+ (*Table)(unsafe.Pointer(pTab)).FnNVCol = libc.AssignPtrInt16(pTab+34, (*Table)(unsafe.Pointer(pNew)).FnCol)
+ *(*U32)(unsafe.Pointer(pTab + 28)) |= (*Table)(unsafe.Pointer(pNew)).FtabFlags & U32(TF_WithoutRowid|TF_NoVisibleRowid)
(*Table)(unsafe.Pointer(pNew)).FnCol = int16(0)
(*Table)(unsafe.Pointer(pNew)).FaCol = uintptr(0)
- if (!(((*Table)(unsafe.Pointer((pNew))).FtabFlags & U32(TF_WithoutRowid)) == U32(0)) &&
- ((*Sqlite3_module)(unsafe.Pointer((*Module)(unsafe.Pointer((*VTable)(unsafe.Pointer((*VtabCtx)(unsafe.Pointer(pCtx)).FpVTable)).FpMod)).FpModule)).FxUpdate != uintptr(0))) &&
- (int32((*Index)(unsafe.Pointer(Xsqlite3PrimaryKeyIndex(tls, pNew))).FnKeyCol) != 1) {
+ if !((*Table)(unsafe.Pointer(pNew)).FtabFlags&U32(TF_WithoutRowid) == U32(0)) &&
+ (*Sqlite3_module)(unsafe.Pointer((*Module)(unsafe.Pointer((*VTable)(unsafe.Pointer((*VtabCtx)(unsafe.Pointer(pCtx)).FpVTable)).FpMod)).FpModule)).FxUpdate != uintptr(0) &&
+ int32((*Index)(unsafe.Pointer(Xsqlite3PrimaryKeyIndex(tls, pNew))).FnKeyCol) != 1 {
// WITHOUT ROWID virtual tables must either be read-only (xUpdate==0)
// or else must have a single-column PRIMARY KEY
rc = SQLITE_ERROR
@@ -125984,21 +127934,22 @@ func Xsqlite3_declare_vtab(tls *libc.TLS, db uintptr, zCreateTable uintptr) int3
(*VtabCtx)(unsafe.Pointer(pCtx)).FbDeclared = 1
} else {
Xsqlite3ErrorWithMsg(tls, db, SQLITE_ERROR, func() uintptr {
- if *(*uintptr)(unsafe.Pointer(bp + 280 /* zErr */)) != 0 {
- return ts + 2790 /* "%s" */
+ if *(*uintptr)(unsafe.Pointer(bp + 276)) != 0 {
+ return ts + 3601 /* "%s" */
}
return uintptr(0)
- }(), libc.VaList(bp, *(*uintptr)(unsafe.Pointer(bp + 280 /* zErr */))))
- Xsqlite3DbFree(tls, db, *(*uintptr)(unsafe.Pointer(bp + 280 /* zErr */)))
+ }(), libc.VaList(bp, *(*uintptr)(unsafe.Pointer(bp + 276 /* zErr */))))
+ Xsqlite3DbFree(tls, db, *(*uintptr)(unsafe.Pointer(bp + 276 /* zErr */)))
rc = SQLITE_ERROR
}
(*Parse)(unsafe.Pointer(bp + 8 /* &sParse */)).FeParseMode = U8(PARSE_MODE_NORMAL)
- if (*Parse)(unsafe.Pointer(bp+8 /* &sParse */)).FpVdbe != 0 {
+ if (*Parse)(unsafe.Pointer(bp+8)).FpVdbe != 0 {
Xsqlite3VdbeFinalize(tls, (*Parse)(unsafe.Pointer(bp+8 /* &sParse */)).FpVdbe)
}
Xsqlite3DeleteTable(tls, db, (*Parse)(unsafe.Pointer(bp+8 /* &sParse */)).FpNewTable)
Xsqlite3ParserReset(tls, bp+8 /* &sParse */)
+ (*Sqlite3)(unsafe.Pointer(db)).Finit.Fbusy = U8(initBusy)
rc = Xsqlite3ApiExit(tls, db, rc)
Xsqlite3_mutex_leave(tls, (*Sqlite3)(unsafe.Pointer(db)).Fmutex)
@@ -126010,15 +127961,17 @@ func Xsqlite3_declare_vtab(tls *libc.TLS, db uintptr, zCreateTable uintptr) int3
// when a DROP TABLE is mentioned.
//
// This call is a no-op if zTab is not a virtual table.
-func Xsqlite3VtabCallDestroy(tls *libc.TLS, db uintptr, iDb int32, zTab uintptr) int32 { /* sqlite3.c:144030:20: */
+func Xsqlite3VtabCallDestroy(tls *libc.TLS, db uintptr, iDb int32, zTab uintptr) int32 { /* sqlite3.c:145339:20: */
var rc int32 = SQLITE_OK
var pTab uintptr
pTab = Xsqlite3FindTable(tls, db, zTab, (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+uintptr(iDb)*16)).FzDbSName)
- if (pTab != uintptr(0)) && ((*Table)(unsafe.Pointer(pTab)).FpVTable != uintptr(0)) {
+ if pTab != uintptr(0) &&
+ int32((*Table)(unsafe.Pointer(pTab)).FeTabType) == TABTYP_VTAB &&
+ *(*uintptr)(unsafe.Pointer(pTab + 44 + 8)) != uintptr(0) {
var p uintptr
var xDestroy uintptr
- for p = (*Table)(unsafe.Pointer(pTab)).FpVTable; p != 0; p = (*VTable)(unsafe.Pointer(p)).FpNext {
+ for p = *(*uintptr)(unsafe.Pointer(pTab + 44 + 8 /* &.p */)); p != 0; p = (*VTable)(unsafe.Pointer(p)).FpNext {
if (*Sqlite3_vtab)(unsafe.Pointer((*VTable)(unsafe.Pointer(p)).FpVtab)).FnRef > 0 {
return SQLITE_LOCKED
@@ -126038,7 +127991,7 @@ func Xsqlite3VtabCallDestroy(tls *libc.TLS, db uintptr, iDb int32, zTab uintptr)
if rc == SQLITE_OK {
(*VTable)(unsafe.Pointer(p)).FpVtab = uintptr(0)
- (*Table)(unsafe.Pointer(pTab)).FpVTable = uintptr(0)
+ *(*uintptr)(unsafe.Pointer(pTab + 44 + 8 /* &.p */)) = uintptr(0)
Xsqlite3VtabUnlock(tls, p)
}
Xsqlite3DeleteTable(tls, db, pTab)
@@ -126053,7 +128006,7 @@ func Xsqlite3VtabCallDestroy(tls *libc.TLS, db uintptr, iDb int32, zTab uintptr)
// the offset of the method to call in the sqlite3_module structure.
//
// The array is cleared after invoking the callbacks.
-func callFinaliser(tls *libc.TLS, db uintptr, offset int32) { /* sqlite3.c:144071:13: */
+func callFinaliser(tls *libc.TLS, db uintptr, offset int32) { /* sqlite3.c:145383:13: */
var i int32
if (*Sqlite3)(unsafe.Pointer(db)).FaVTrans != 0 {
var aVTrans uintptr = (*Sqlite3)(unsafe.Pointer(db)).FaVTrans
@@ -126063,7 +128016,7 @@ func callFinaliser(tls *libc.TLS, db uintptr, offset int32) { /* sqlite3.c:14407
var p uintptr = (*VTable)(unsafe.Pointer(pVTab)).FpVtab
if p != 0 {
var x uintptr
- x = *(*uintptr)(unsafe.Pointer(((*Sqlite3_vtab)(unsafe.Pointer(p)).FpModule + uintptr(offset))))
+ x = *(*uintptr)(unsafe.Pointer((*Sqlite3_vtab)(unsafe.Pointer(p)).FpModule + uintptr(offset)))
if x != 0 {
(*struct {
f func(*libc.TLS, uintptr) int32
@@ -126083,16 +128036,16 @@ func callFinaliser(tls *libc.TLS, db uintptr, offset int32) { /* sqlite3.c:14407
// SQLITE_OK if all xSync operations are successful.
//
// If an error message is available, leave it in p->zErrMsg.
-func Xsqlite3VtabSync(tls *libc.TLS, db uintptr, p uintptr) int32 { /* sqlite3.c:144099:20: */
+func Xsqlite3VtabSync(tls *libc.TLS, db uintptr, p uintptr) int32 { /* sqlite3.c:145411:20: */
var i int32
var rc int32 = SQLITE_OK
var aVTrans uintptr = (*Sqlite3)(unsafe.Pointer(db)).FaVTrans
(*Sqlite3)(unsafe.Pointer(db)).FaVTrans = uintptr(0)
- for i = 0; (rc == SQLITE_OK) && (i < (*Sqlite3)(unsafe.Pointer(db)).FnVTrans); i++ {
+ for i = 0; rc == SQLITE_OK && i < (*Sqlite3)(unsafe.Pointer(db)).FnVTrans; i++ {
var x uintptr
var pVtab uintptr = (*VTable)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(aVTrans + uintptr(i)*4)))).FpVtab
- if (pVtab != 0) && ((libc.AssignUintptr(&x, (*Sqlite3_module)(unsafe.Pointer((*Sqlite3_vtab)(unsafe.Pointer(pVtab)).FpModule)).FxSync)) != uintptr(0)) {
+ if pVtab != 0 && libc.AssignUintptr(&x, (*Sqlite3_module)(unsafe.Pointer((*Sqlite3_vtab)(unsafe.Pointer(pVtab)).FpModule)).FxSync) != uintptr(0) {
rc = (*struct {
f func(*libc.TLS, uintptr) int32
})(unsafe.Pointer(&struct{ uintptr }{x})).f(tls, pVtab)
@@ -126105,15 +128058,15 @@ func Xsqlite3VtabSync(tls *libc.TLS, db uintptr, p uintptr) int32 { /* sqlite3.c
// Invoke the xRollback method of all virtual tables in the
// sqlite3.aVTrans array. Then clear the array itself.
-func Xsqlite3VtabRollback(tls *libc.TLS, db uintptr) int32 { /* sqlite3.c:144121:20: */
- callFinaliser(tls, db, int32((uintptr(0) + 68 /* &.xRollback */)))
+func Xsqlite3VtabRollback(tls *libc.TLS, db uintptr) int32 { /* sqlite3.c:145433:20: */
+ callFinaliser(tls, db, int32(uintptr(0)+68))
return SQLITE_OK
}
// Invoke the xCommit method of all virtual tables in the
// sqlite3.aVTrans array. Then clear the array itself.
-func Xsqlite3VtabCommit(tls *libc.TLS, db uintptr) int32 { /* sqlite3.c:144130:20: */
- callFinaliser(tls, db, int32((uintptr(0) + 64 /* &.xCommit */)))
+func Xsqlite3VtabCommit(tls *libc.TLS, db uintptr) int32 { /* sqlite3.c:145442:20: */
+ callFinaliser(tls, db, int32(uintptr(0)+64))
return SQLITE_OK
}
@@ -126123,7 +128076,7 @@ func Xsqlite3VtabCommit(tls *libc.TLS, db uintptr) int32 { /* sqlite3.c:144130:2
//
// If the xBegin call is successful, place the sqlite3_vtab pointer
// in the sqlite3.aVTrans array.
-func Xsqlite3VtabBegin(tls *libc.TLS, db uintptr, pVTab uintptr) int32 { /* sqlite3.c:144143:20: */
+func Xsqlite3VtabBegin(tls *libc.TLS, db uintptr, pVTab uintptr) int32 { /* sqlite3.c:145455:20: */
var rc int32 = SQLITE_OK
var pModule uintptr
@@ -126131,7 +128084,7 @@ func Xsqlite3VtabBegin(tls *libc.TLS, db uintptr, pVTab uintptr) int32 { /* sqli
// than zero, then this function is being called from within a
// virtual module xSync() callback. It is illegal to write to
// virtual module tables in this case, so return SQLITE_LOCKED.
- if ((*Sqlite3)(unsafe.Pointer((db))).FnVTrans > 0) && ((*Sqlite3)(unsafe.Pointer((db))).FaVTrans == uintptr(0)) {
+ if (*Sqlite3)(unsafe.Pointer(db)).FnVTrans > 0 && (*Sqlite3)(unsafe.Pointer(db)).FaVTrans == uintptr(0) {
return SQLITE_LOCKED
}
if !(pVTab != 0) {
@@ -126157,13 +128110,13 @@ func Xsqlite3VtabBegin(tls *libc.TLS, db uintptr, pVTab uintptr) int32 { /* sqli
f func(*libc.TLS, uintptr) int32
})(unsafe.Pointer(&struct{ uintptr }{(*Sqlite3_module)(unsafe.Pointer(pModule)).FxBegin})).f(tls, (*VTable)(unsafe.Pointer(pVTab)).FpVtab)
if rc == SQLITE_OK {
- var iSvpt int32 = ((*Sqlite3)(unsafe.Pointer(db)).FnStatement + (*Sqlite3)(unsafe.Pointer(db)).FnSavepoint)
+ var iSvpt int32 = (*Sqlite3)(unsafe.Pointer(db)).FnStatement + (*Sqlite3)(unsafe.Pointer(db)).FnSavepoint
addToVTrans(tls, db, pVTab)
- if (iSvpt != 0) && ((*Sqlite3_module)(unsafe.Pointer(pModule)).FxSavepoint != 0) {
+ if iSvpt != 0 && (*Sqlite3_module)(unsafe.Pointer(pModule)).FxSavepoint != 0 {
(*VTable)(unsafe.Pointer(pVTab)).FiSavepoint = iSvpt
rc = (*struct {
f func(*libc.TLS, uintptr, int32) int32
- })(unsafe.Pointer(&struct{ uintptr }{(*Sqlite3_module)(unsafe.Pointer(pModule)).FxSavepoint})).f(tls, (*VTable)(unsafe.Pointer(pVTab)).FpVtab, (iSvpt - 1))
+ })(unsafe.Pointer(&struct{ uintptr }{(*Sqlite3_module)(unsafe.Pointer(pModule)).FxSavepoint})).f(tls, (*VTable)(unsafe.Pointer(pVTab)).FpVtab, iSvpt-1)
}
}
}
@@ -126184,21 +128137,21 @@ func Xsqlite3VtabBegin(tls *libc.TLS, db uintptr, pVTab uintptr) int32 { /* sqli
// processing is abandoned and the error returned to the caller of this
// function immediately. If all calls to virtual table methods are successful,
// SQLITE_OK is returned.
-func Xsqlite3VtabSavepoint(tls *libc.TLS, db uintptr, op int32, iSavepoint int32) int32 { /* sqlite3.c:144203:20: */
+func Xsqlite3VtabSavepoint(tls *libc.TLS, db uintptr, op int32, iSavepoint int32) int32 { /* sqlite3.c:145515:20: */
var rc int32 = SQLITE_OK
if (*Sqlite3)(unsafe.Pointer(db)).FaVTrans != 0 {
var i int32
- for i = 0; (rc == SQLITE_OK) && (i < (*Sqlite3)(unsafe.Pointer(db)).FnVTrans); i++ {
+ for i = 0; rc == SQLITE_OK && i < (*Sqlite3)(unsafe.Pointer(db)).FnVTrans; i++ {
var pVTab uintptr = *(*uintptr)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaVTrans + uintptr(i)*4))
var pMod uintptr = (*Module)(unsafe.Pointer((*VTable)(unsafe.Pointer(pVTab)).FpMod)).FpModule
- if ((*VTable)(unsafe.Pointer(pVTab)).FpVtab != 0) && ((*Sqlite3_module)(unsafe.Pointer(pMod)).FiVersion >= 2) {
+ if (*VTable)(unsafe.Pointer(pVTab)).FpVtab != 0 && (*Sqlite3_module)(unsafe.Pointer(pMod)).FiVersion >= 2 {
var xMethod uintptr
Xsqlite3VtabLock(tls, pVTab)
switch op {
case SAVEPOINT_BEGIN:
xMethod = (*Sqlite3_module)(unsafe.Pointer(pMod)).FxSavepoint
- (*VTable)(unsafe.Pointer(pVTab)).FiSavepoint = (iSavepoint + 1)
+ (*VTable)(unsafe.Pointer(pVTab)).FiSavepoint = iSavepoint + 1
break
fallthrough
case SAVEPOINT_ROLLBACK:
@@ -126209,7 +128162,7 @@ func Xsqlite3VtabSavepoint(tls *libc.TLS, db uintptr, op int32, iSavepoint int32
xMethod = (*Sqlite3_module)(unsafe.Pointer(pMod)).FxRelease
break
}
- if (xMethod != 0) && ((*VTable)(unsafe.Pointer(pVTab)).FiSavepoint > iSavepoint) {
+ if xMethod != 0 && (*VTable)(unsafe.Pointer(pVTab)).FiSavepoint > iSavepoint {
rc = (*struct {
f func(*libc.TLS, uintptr, int32) int32
})(unsafe.Pointer(&struct{ uintptr }{xMethod})).f(tls, (*VTable)(unsafe.Pointer(pVTab)).FpVtab, iSavepoint)
@@ -126232,7 +128185,7 @@ func Xsqlite3VtabSavepoint(tls *libc.TLS, db uintptr, op int32, iSavepoint int32
// Return either the pDef argument (indicating no change) or a
// new FuncDef structure that is marked as ephemeral using the
// SQLITE_FUNC_EPHEM flag.
-func Xsqlite3VtabOverloadFunction(tls *libc.TLS, db uintptr, pDef uintptr, nArg int32, pExpr uintptr) uintptr { /* sqlite3.c:144251:24: */
+func Xsqlite3VtabOverloadFunction(tls *libc.TLS, db uintptr, pDef uintptr, nArg int32, pExpr uintptr) uintptr { /* sqlite3.c:145563:24: */
bp := tls.Alloc(8)
defer tls.Free(8)
@@ -126251,11 +128204,12 @@ func Xsqlite3VtabOverloadFunction(tls *libc.TLS, db uintptr, pDef uintptr, nArg
if int32((*Expr)(unsafe.Pointer(pExpr)).Fop) != TK_COLUMN {
return pDef
}
- pTab = *(*uintptr)(unsafe.Pointer(pExpr + 44 /* &.y */))
+
+ pTab = *(*uintptr)(unsafe.Pointer(pExpr + 44))
if pTab == uintptr(0) {
return pDef
}
- if !((*Table)(unsafe.Pointer(pTab)).FnModuleArg != 0) {
+ if !(int32((*Table)(unsafe.Pointer(pTab)).FeTabType) == TABTYP_VTAB) {
return pDef
}
pVtab = (*VTable)(unsafe.Pointer(Xsqlite3GetVTable(tls, db, pTab))).FpVtab
@@ -126280,17 +128234,17 @@ func Xsqlite3VtabOverloadFunction(tls *libc.TLS, db uintptr, pDef uintptr, nArg
// Create a new ephemeral function definition for the overloaded
// function
- pNew = Xsqlite3DbMallocZero(tls, db, (uint64((uint32(unsafe.Sizeof(FuncDef{})) +
- uint32(Xsqlite3Strlen30(tls, (*FuncDef)(unsafe.Pointer(pDef)).FzName))) + uint32(1))))
+ pNew = Xsqlite3DbMallocZero(tls, db, uint64(uint32(unsafe.Sizeof(FuncDef{}))+
+ uint32(Xsqlite3Strlen30(tls, (*FuncDef)(unsafe.Pointer(pDef)).FzName))+uint32(1)))
if pNew == uintptr(0) {
return pDef
}
*(*FuncDef)(unsafe.Pointer(pNew)) = *(*FuncDef)(unsafe.Pointer(pDef))
- (*FuncDef)(unsafe.Pointer(pNew)).FzName = (pNew + 1*40)
- libc.Xmemcpy(tls, (pNew + 1*40), (*FuncDef)(unsafe.Pointer(pDef)).FzName, (uint32(Xsqlite3Strlen30(tls, (*FuncDef)(unsafe.Pointer(pDef)).FzName) + 1)))
+ (*FuncDef)(unsafe.Pointer(pNew)).FzName = pNew + 1*40
+ libc.Xmemcpy(tls, pNew+1*40, (*FuncDef)(unsafe.Pointer(pDef)).FzName, uint32(Xsqlite3Strlen30(tls, (*FuncDef)(unsafe.Pointer(pDef)).FzName)+1))
(*FuncDef)(unsafe.Pointer(pNew)).FxSFunc = *(*uintptr)(unsafe.Pointer(bp /* xSFunc */))
(*FuncDef)(unsafe.Pointer(pNew)).FpUserData = *(*uintptr)(unsafe.Pointer(bp + 4 /* pArg */))
- *(*U32)(unsafe.Pointer(pNew + 4 /* &.funcFlags */)) |= (U32(SQLITE_FUNC_EPHEM))
+ *(*U32)(unsafe.Pointer(pNew + 4)) |= U32(SQLITE_FUNC_EPHEM)
return pNew
}
@@ -126298,7 +128252,7 @@ func Xsqlite3VtabOverloadFunction(tls *libc.TLS, db uintptr, pDef uintptr, nArg
// array so that an OP_VBegin will get generated for it. Add pTab to the
// array if it is missing. If pTab is already in the array, this routine
// is a no-op.
-func Xsqlite3VtabMakeWritable(tls *libc.TLS, pParse uintptr, pTab uintptr) { /* sqlite3.c:144320:21: */
+func Xsqlite3VtabMakeWritable(tls *libc.TLS, pParse uintptr, pTab uintptr) { /* sqlite3.c:145633:21: */
var pToplevel uintptr = func() uintptr {
if (*Parse)(unsafe.Pointer(pParse)).FpToplevel != 0 {
return (*Parse)(unsafe.Pointer(pParse)).FpToplevel
@@ -126314,7 +128268,7 @@ func Xsqlite3VtabMakeWritable(tls *libc.TLS, pParse uintptr, pTab uintptr) { /*
return
}
}
- n = (int32((uint32((*Parse)(unsafe.Pointer(pToplevel)).FnVtabLock + 1)) * uint32(unsafe.Sizeof(uintptr(0)))))
+ n = int32(uint32((*Parse)(unsafe.Pointer(pToplevel)).FnVtabLock+1) * uint32(unsafe.Sizeof(uintptr(0))))
apVtabLock = Xsqlite3Realloc(tls, (*Parse)(unsafe.Pointer(pToplevel)).FapVtabLock, uint64(n))
if apVtabLock != 0 {
(*Parse)(unsafe.Pointer(pToplevel)).FapVtabLock = apVtabLock
@@ -126326,8 +128280,9 @@ func Xsqlite3VtabMakeWritable(tls *libc.TLS, pParse uintptr, pTab uintptr) { /*
// Check to see if virtual table module pMod can be have an eponymous
// virtual table instance. If it can, create one if one does not already
-// exist. Return non-zero if the eponymous virtual table instance exists
-// when this routine returns, and return zero if it does not exist.
+// exist. Return non-zero if either the eponymous virtual table instance
+// exists when this routine returns or if an attempt to create it failed
+// and an error message was left in pParse.
//
// An eponymous virtual table instance is one that is named after its
// module, and more importantly, does not require a CREATE VIRTUAL TABLE
@@ -126336,7 +128291,7 @@ func Xsqlite3VtabMakeWritable(tls *libc.TLS, pParse uintptr, pTab uintptr) { /*
//
// Any virtual table module for which xConnect and xCreate are the same
// method can have an eponymous virtual table instance.
-func Xsqlite3VtabEponymousTableInit(tls *libc.TLS, pParse uintptr, pMod uintptr) int32 { /* sqlite3.c:144353:20: */
+func Xsqlite3VtabEponymousTableInit(tls *libc.TLS, pParse uintptr, pMod uintptr) int32 { /* sqlite3.c:145667:20: */
bp := tls.Alloc(12)
defer tls.Free(12)
@@ -126348,7 +128303,7 @@ func Xsqlite3VtabEponymousTableInit(tls *libc.TLS, pParse uintptr, pMod uintptr)
if (*Module)(unsafe.Pointer(pMod)).FpEpoTab != 0 {
return 1
}
- if ((*Sqlite3_module)(unsafe.Pointer(pModule)).FxCreate != uintptr(0)) && ((*Sqlite3_module)(unsafe.Pointer(pModule)).FxCreate != (*Sqlite3_module)(unsafe.Pointer(pModule)).FxConnect) {
+ if (*Sqlite3_module)(unsafe.Pointer(pModule)).FxCreate != uintptr(0) && (*Sqlite3_module)(unsafe.Pointer(pModule)).FxCreate != (*Sqlite3_module)(unsafe.Pointer(pModule)).FxConnect {
return 0
}
pTab = Xsqlite3DbMallocZero(tls, db, uint64(unsafe.Sizeof(Table{})))
@@ -126362,32 +128317,32 @@ func Xsqlite3VtabEponymousTableInit(tls *libc.TLS, pParse uintptr, pMod uintptr)
}
(*Module)(unsafe.Pointer(pMod)).FpEpoTab = pTab
(*Table)(unsafe.Pointer(pTab)).FnTabRef = U32(1)
+ (*Table)(unsafe.Pointer(pTab)).FeTabType = U8(TABTYP_VTAB)
(*Table)(unsafe.Pointer(pTab)).FpSchema = (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb)).FpSchema
(*Table)(unsafe.Pointer(pTab)).FiPKey = int16(-1)
- *(*U32)(unsafe.Pointer(pTab + 36 /* &.tabFlags */)) |= (U32(TF_Eponymous))
+ *(*U32)(unsafe.Pointer(pTab + 28)) |= U32(TF_Eponymous)
addModuleArgument(tls, pParse, pTab, Xsqlite3DbStrDup(tls, db, (*Table)(unsafe.Pointer(pTab)).FzName))
addModuleArgument(tls, pParse, pTab, uintptr(0))
addModuleArgument(tls, pParse, pTab, Xsqlite3DbStrDup(tls, db, (*Table)(unsafe.Pointer(pTab)).FzName))
rc = vtabCallConstructor(tls, db, pTab, pMod, (*Sqlite3_module)(unsafe.Pointer(pModule)).FxConnect, bp+8 /* &zErr */)
if rc != 0 {
- Xsqlite3ErrorMsg(tls, pParse, ts+2790 /* "%s" */, libc.VaList(bp, *(*uintptr)(unsafe.Pointer(bp + 8 /* zErr */))))
+ Xsqlite3ErrorMsg(tls, pParse, ts+3601 /* "%s" */, libc.VaList(bp, *(*uintptr)(unsafe.Pointer(bp + 8 /* zErr */))))
Xsqlite3DbFree(tls, db, *(*uintptr)(unsafe.Pointer(bp + 8 /* zErr */)))
Xsqlite3VtabEponymousTableClear(tls, db, pMod)
- return 0
}
return 1
}
// Erase the eponymous virtual table instance associated with
// virtual table module pMod, if it exists.
-func Xsqlite3VtabEponymousTableClear(tls *libc.TLS, db uintptr, pMod uintptr) { /* sqlite3.c:144391:21: */
+func Xsqlite3VtabEponymousTableClear(tls *libc.TLS, db uintptr, pMod uintptr) { /* sqlite3.c:145705:21: */
var pTab uintptr = (*Module)(unsafe.Pointer(pMod)).FpEpoTab
if pTab != uintptr(0) {
// Mark the table as Ephemeral prior to deleting it, so that the
// sqlite3DeleteTable() routine will know that it is not stored in
// the schema.
- *(*U32)(unsafe.Pointer(pTab + 36 /* &.tabFlags */)) |= (U32(TF_Ephemeral))
+ *(*U32)(unsafe.Pointer(pTab + 28)) |= U32(TF_Ephemeral)
Xsqlite3DeleteTable(tls, db, pTab)
(*Module)(unsafe.Pointer(pMod)).FpEpoTab = uintptr(0)
}
@@ -126398,19 +128353,19 @@ func Xsqlite3VtabEponymousTableClear(tls *libc.TLS, db uintptr, pMod uintptr) {
//
// The results of this routine are undefined unless it is called from
// within an xUpdate method.
-func Xsqlite3_vtab_on_conflict(tls *libc.TLS, db uintptr) int32 { /* sqlite3.c:144410:16: */
+func Xsqlite3_vtab_on_conflict(tls *libc.TLS, db uintptr) int32 { /* sqlite3.c:145724:16: */
- return int32(aMap[(int32((*Sqlite3)(unsafe.Pointer(db)).FvtabOnConflict) - 1)])
+ return int32(aMap[int32((*Sqlite3)(unsafe.Pointer(db)).FvtabOnConflict)-1])
}
var aMap = [5]uint8{
uint8(SQLITE_ROLLBACK), uint8(SQLITE_ABORT), uint8(SQLITE_FAIL), uint8(SQLITE_IGNORE), uint8(SQLITE_REPLACE),
-} /* sqlite3.c:144411:30 */
+} /* sqlite3.c:145725:30 */
// Call from within the xCreate() or xConnect() methods to provide
// the SQLite core with additional information about the behavior
// of the virtual table being implemented.
-func Xsqlite3_vtab_config(tls *libc.TLS, db uintptr, op int32, va uintptr) int32 { /* sqlite3.c:144428:16: */
+func Xsqlite3_vtab_config(tls *libc.TLS, db uintptr, op int32, va uintptr) int32 { /* sqlite3.c:145742:16: */
var ap Va_list
_ = ap
var rc int32 = SQLITE_OK
@@ -126419,7 +128374,7 @@ func Xsqlite3_vtab_config(tls *libc.TLS, db uintptr, op int32, va uintptr) int32
Xsqlite3_mutex_enter(tls, (*Sqlite3)(unsafe.Pointer(db)).Fmutex)
p = (*Sqlite3)(unsafe.Pointer(db)).FpVtabCtx
if !(p != 0) {
- rc = Xsqlite3MisuseError(tls, 144439)
+ rc = Xsqlite3MisuseError(tls, 145753)
} else {
ap = va
@@ -126447,7 +128402,7 @@ func Xsqlite3_vtab_config(tls *libc.TLS, db uintptr, op int32, va uintptr) int32
fallthrough
default:
{
- rc = Xsqlite3MisuseError(tls, 144457)
+ rc = Xsqlite3MisuseError(tls, 145771)
break
}
@@ -126510,7 +128465,7 @@ type WhereClause1 = struct {
FnSlot int32
Fa uintptr
FaStatic [8]WhereTerm
-} /* sqlite3.c:14936:9 */
+} /* sqlite3.c:14311:9 */
//************* End of vtab.c ***********************************************
//************* Begin file wherecode.c **************************************
@@ -126550,23 +128505,23 @@ type WhereClause1 = struct {
// a separate source file for easier editing.
// Forward references
-type WhereClause = WhereClause1 /* sqlite3.c:144517:28 */
+type WhereClause = WhereClause1 /* sqlite3.c:145831:28 */
type WhereMaskSet1 = struct {
FbVarSelect int32
Fn int32
Fix [64]int32
-} /* sqlite3.c:14936:9 */
+} /* sqlite3.c:14311:9 */
-type WhereMaskSet = WhereMaskSet1 /* sqlite3.c:144518:29 */
+type WhereMaskSet = WhereMaskSet1 /* sqlite3.c:145832:29 */
type WhereOrInfo1 = struct {
Fwc WhereClause
Findexable Bitmask
-} /* sqlite3.c:144519:9 */
+} /* sqlite3.c:145833:9 */
-type WhereOrInfo = WhereOrInfo1 /* sqlite3.c:144519:28 */
-type WhereAndInfo1 = struct{ Fwc WhereClause } /* sqlite3.c:144520:9 */
+type WhereOrInfo = WhereOrInfo1 /* sqlite3.c:145833:28 */
+type WhereAndInfo1 = struct{ Fwc WhereClause } /* sqlite3.c:145834:9 */
-type WhereAndInfo = WhereAndInfo1 /* sqlite3.c:144520:29 */
+type WhereAndInfo = WhereAndInfo1 /* sqlite3.c:145834:29 */
type WhereLevel1 = struct {
FiLeftJoin int32
FiTabCur int32
@@ -126594,9 +128549,9 @@ type WhereLevel1 = struct {
FpWLoop uintptr
F__ccgo_pad1 [4]byte
FnotReady Bitmask
-} /* sqlite3.c:14936:9 */
+} /* sqlite3.c:14311:9 */
-type WhereLevel = WhereLevel1 /* sqlite3.c:144521:27 */
+type WhereLevel = WhereLevel1 /* sqlite3.c:145835:27 */
type WhereLoop1 = struct {
Fprereq Bitmask
FmaskSelf Bitmask
@@ -126623,9 +128578,9 @@ type WhereLoop1 = struct {
FpNextLoop uintptr
FaLTermSpace [3]uintptr
F__ccgo_pad2 [4]byte
-} /* sqlite3.c:14936:9 */
+} /* sqlite3.c:14311:9 */
-type WhereLoop = WhereLoop1 /* sqlite3.c:144522:26 */
+type WhereLoop = WhereLoop1 /* sqlite3.c:145836:26 */
type WherePath1 = struct {
FmaskLoop Bitmask
FrevLoop Bitmask
@@ -126636,9 +128591,9 @@ type WherePath1 = struct {
F__ccgo_pad1 [1]byte
FaLoop uintptr
F__ccgo_pad2 [4]byte
-} /* sqlite3.c:144523:9 */
+} /* sqlite3.c:145837:9 */
-type WherePath = WherePath1 /* sqlite3.c:144523:26 */
+type WherePath = WherePath1 /* sqlite3.c:145837:26 */
type WhereTerm1 = struct {
FpExpr uintptr
FpWC uintptr
@@ -126657,9 +128612,9 @@ type WhereTerm1 = struct {
}
FprereqRight Bitmask
FprereqAll Bitmask
-} /* sqlite3.c:14936:9 */
+} /* sqlite3.c:14311:9 */
-type WhereTerm = WhereTerm1 /* sqlite3.c:144524:26 */
+type WhereTerm = WhereTerm1 /* sqlite3.c:145838:26 */
type WhereLoopBuilder1 = struct {
FpWInfo uintptr
FpWC uintptr
@@ -126672,9 +128627,9 @@ type WhereLoopBuilder1 = struct {
FbldFlags2 uint8
F__ccgo_pad1 [2]byte
FiPlanLimit uint32
-} /* sqlite3.c:144525:9 */
+} /* sqlite3.c:145839:9 */
-type WhereLoopBuilder = WhereLoopBuilder1 /* sqlite3.c:144525:33 */
+type WhereLoopBuilder = WhereLoopBuilder1 /* sqlite3.c:145839:33 */
type WhereScan1 = struct {
FpOrigWC uintptr
FpWC uintptr
@@ -126689,24 +128644,24 @@ type WhereScan1 = struct {
FaiCur [11]int32
FaiColumn [11]I16
F__ccgo_pad2 [2]byte
-} /* sqlite3.c:144526:9 */
+} /* sqlite3.c:145840:9 */
-type WhereScan = WhereScan1 /* sqlite3.c:144526:26 */
+type WhereScan = WhereScan1 /* sqlite3.c:145840:26 */
type WhereOrCost1 = struct {
Fprereq Bitmask
FrRun LogEst
FnOut LogEst
F__ccgo_pad1 [4]byte
-} /* sqlite3.c:144525:9 */
+} /* sqlite3.c:145839:9 */
-type WhereOrCost = WhereOrCost1 /* sqlite3.c:144527:28 */
+type WhereOrCost = WhereOrCost1 /* sqlite3.c:145841:28 */
type WhereOrSet1 = struct {
Fn U16
F__ccgo_pad1 [6]byte
Fa [3]WhereOrCost
-} /* sqlite3.c:144525:9 */
+} /* sqlite3.c:145839:9 */
-type WhereOrSet = WhereOrSet1 /* sqlite3.c:144528:27 */
+type WhereOrSet = WhereOrSet1 /* sqlite3.c:145842:27 */
// This object contains information needed to implement a single nested
// loop in WHERE clause.
@@ -126728,7 +128683,7 @@ type InLoop = struct {
FnPrefix int32
FeEndLoopOp U8
F__ccgo_pad1 [3]byte
-} /* sqlite3.c:144567:7 */
+} /* sqlite3.c:145881:7 */
// Allowed values for WhereLoopBuider.bldFlags
@@ -126754,7 +128709,7 @@ type WhereExprMod1 = struct {
FpNext uintptr
FpExpr uintptr
Forig Expr
-} /* sqlite3.c:14936:9 */
+} /* sqlite3.c:14311:9 */
// Allowed values for WhereLoopBuider.bldFlags
@@ -126776,7 +128731,7 @@ type WhereExprMod1 = struct {
// of an index rather than an expression or a virtual column. All
// such transformations need to be undone at the end of WHERE clause
// processing.
-type WhereExprMod = WhereExprMod1 /* sqlite3.c:144931:29 */
+type WhereExprMod = WhereExprMod1 /* sqlite3.c:146245:29 */
// Bitmasks for the operators on WhereTerm objects. These are all
// operators that are of interest to the query planner. An
@@ -126798,15 +128753,15 @@ type WhereExprMod = WhereExprMod1 /* sqlite3.c:144931:29 */
//************* Continuing where we left off in wherecode.c *****************
// Return the name of the i-th column of the pIdx index.
-func explainIndexColumnName(tls *libc.TLS, pIdx uintptr, i int32) uintptr { /* sqlite3.c:145112:19: */
+func explainIndexColumnName(tls *libc.TLS, pIdx uintptr, i int32) uintptr { /* sqlite3.c:146426:19: */
i = int32(*(*I16)(unsafe.Pointer((*Index)(unsafe.Pointer(pIdx)).FaiColumn + uintptr(i)*2)))
- if i == (-2) {
- return ts + 19870 /* "<expr>" */
+ if i == -2 {
+ return ts + 21167 /* "<expr>" */
}
- if i == (-1) {
- return ts + 14757 /* "rowid" */
+ if i == -1 {
+ return ts + 15961 /* "rowid" */
}
- return (*Column)(unsafe.Pointer((*Table)(unsafe.Pointer((*Index)(unsafe.Pointer(pIdx)).FpTable)).FaCol + uintptr(i)*20)).FzName
+ return (*Column)(unsafe.Pointer((*Table)(unsafe.Pointer((*Index)(unsafe.Pointer(pIdx)).FpTable)).FaCol + uintptr(i)*16)).FzCnName
}
// This routine is a helper for explainIndexRange() below
@@ -126815,39 +128770,39 @@ func explainIndexColumnName(tls *libc.TLS, pIdx uintptr, i int32) uintptr { /* s
// at a time. This routine adds a new term to the end of the expression.
// Terms are separated by AND so add the "AND" text for second and subsequent
// terms only.
-func explainAppendTerm(tls *libc.TLS, pStr uintptr, pIdx uintptr, nTerm int32, iTerm int32, bAnd int32, zOp uintptr) { /* sqlite3.c:145127:13: */
+func explainAppendTerm(tls *libc.TLS, pStr uintptr, pIdx uintptr, nTerm int32, iTerm int32, bAnd int32, zOp uintptr) { /* sqlite3.c:146441:13: */
var i int32
if bAnd != 0 {
- Xsqlite3_str_append(tls, pStr, ts+19877 /* " AND " */, 5)
+ Xsqlite3_str_append(tls, pStr, ts+21174 /* " AND " */, 5)
}
if nTerm > 1 {
- Xsqlite3_str_append(tls, pStr, ts+19883 /* "(" */, 1)
+ Xsqlite3_str_append(tls, pStr, ts+21180 /* "(" */, 1)
}
for i = 0; i < nTerm; i++ {
if i != 0 {
- Xsqlite3_str_append(tls, pStr, ts+11537 /* "," */, 1)
+ Xsqlite3_str_append(tls, pStr, ts+12660 /* "," */, 1)
}
- Xsqlite3_str_appendall(tls, pStr, explainIndexColumnName(tls, pIdx, (iTerm+i)))
+ Xsqlite3_str_appendall(tls, pStr, explainIndexColumnName(tls, pIdx, iTerm+i))
}
if nTerm > 1 {
- Xsqlite3_str_append(tls, pStr, ts+4066 /* ")" */, 1)
+ Xsqlite3_str_append(tls, pStr, ts+4877 /* ")" */, 1)
}
Xsqlite3_str_append(tls, pStr, zOp, 1)
if nTerm > 1 {
- Xsqlite3_str_append(tls, pStr, ts+19883 /* "(" */, 1)
+ Xsqlite3_str_append(tls, pStr, ts+21180 /* "(" */, 1)
}
for i = 0; i < nTerm; i++ {
if i != 0 {
- Xsqlite3_str_append(tls, pStr, ts+11537 /* "," */, 1)
+ Xsqlite3_str_append(tls, pStr, ts+12660 /* "," */, 1)
}
- Xsqlite3_str_append(tls, pStr, ts+4122 /* "?" */, 1)
+ Xsqlite3_str_append(tls, pStr, ts+4928 /* "?" */, 1)
}
if nTerm > 1 {
- Xsqlite3_str_append(tls, pStr, ts+4066 /* ")" */, 1)
+ Xsqlite3_str_append(tls, pStr, ts+4877 /* ")" */, 1)
}
}
@@ -126863,42 +128818,42 @@ func explainAppendTerm(tls *libc.TLS, pStr uintptr, pIdx uintptr, nTerm int32, i
// string similar to:
//
// "a=? AND b>?"
-func explainIndexRange(tls *libc.TLS, pStr uintptr, pLoop uintptr) { /* sqlite3.c:145171:13: */
+func explainIndexRange(tls *libc.TLS, pStr uintptr, pLoop uintptr) { /* sqlite3.c:146485:13: */
bp := tls.Alloc(8)
defer tls.Free(8)
- var pIndex uintptr = *(*uintptr)(unsafe.Pointer(pLoop + 24 /* &.u */ /* &.btree */ + 8 /* &.pIndex */))
- var nEq U16 = *(*U16)(unsafe.Pointer(pLoop + 24 /* &.u */ /* &.btree */ /* &.nEq */))
+ var pIndex uintptr = *(*uintptr)(unsafe.Pointer(pLoop + 24 + 8 /* &.pIndex */))
+ var nEq U16 = *(*U16)(unsafe.Pointer(pLoop + 24))
var nSkip U16 = (*WhereLoop)(unsafe.Pointer(pLoop)).FnSkip
var i int32
var j int32
- if (int32(nEq) == 0) && (((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & (U32(WHERE_BTM_LIMIT | WHERE_TOP_LIMIT))) == U32(0)) {
+ if int32(nEq) == 0 && (*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags&U32(WHERE_BTM_LIMIT|WHERE_TOP_LIMIT) == U32(0) {
return
}
- Xsqlite3_str_append(tls, pStr, ts+19885 /* " (" */, 2)
+ Xsqlite3_str_append(tls, pStr, ts+21182 /* " (" */, 2)
for i = 0; i < int32(nEq); i++ {
var z uintptr = explainIndexColumnName(tls, pIndex, i)
if i != 0 {
- Xsqlite3_str_append(tls, pStr, ts+19877 /* " AND " */, 5)
+ Xsqlite3_str_append(tls, pStr, ts+21174 /* " AND " */, 5)
}
Xsqlite3_str_appendf(tls, pStr, func() uintptr {
if i >= int32(nSkip) {
- return ts + 19888 /* "%s=?" */
+ return ts + 21185 /* "%s=?" */
}
- return ts + 19893 /* "ANY(%s)" */
+ return ts + 21190 /* "ANY(%s)" */
}(), libc.VaList(bp, z))
}
j = i
- if ((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & U32(WHERE_BTM_LIMIT)) != 0 {
- explainAppendTerm(tls, pStr, pIndex, int32(*(*U16)(unsafe.Pointer(pLoop + 24 /* &.u */ /* &.btree */ + 2 /* &.nBtm */))), j, i, ts+19901 /* ">" */)
+ if (*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags&U32(WHERE_BTM_LIMIT) != 0 {
+ explainAppendTerm(tls, pStr, pIndex, int32(*(*U16)(unsafe.Pointer(pLoop + 24 + 2 /* &.nBtm */))), j, i, ts+21198 /* ">" */)
i = 1
}
- if ((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & U32(WHERE_TOP_LIMIT)) != 0 {
- explainAppendTerm(tls, pStr, pIndex, int32(*(*U16)(unsafe.Pointer(pLoop + 24 /* &.u */ /* &.btree */ + 4 /* &.nTop */))), j, i, ts+19903 /* "<" */)
+ if (*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags&U32(WHERE_TOP_LIMIT) != 0 {
+ explainAppendTerm(tls, pStr, pIndex, int32(*(*U16)(unsafe.Pointer(pLoop + 24 + 4 /* &.nTop */))), j, i, ts+21200 /* "<" */)
}
- Xsqlite3_str_append(tls, pStr, ts+4066 /* ")" */, 1)
+ Xsqlite3_str_append(tls, pStr, ts+4877 /* ")" */, 1)
}
// This function is a no-op unless currently processing an EXPLAIN QUERY PLAN
@@ -126908,18 +128863,18 @@ func explainIndexRange(tls *libc.TLS, pStr uintptr, pLoop uintptr) { /* sqlite3.
//
// If an OP_Explain opcode is added to the VM, its address is returned.
// Otherwise, if no OP_Explain is coded, zero is returned.
-func Xsqlite3WhereExplainOneScan(tls *libc.TLS, pParse uintptr, pTabList uintptr, pLevel uintptr, wctrlFlags U16) int32 { /* sqlite3.c:145205:20: */
+func Xsqlite3WhereExplainOneScan(tls *libc.TLS, pParse uintptr, pTabList uintptr, pLevel uintptr, wctrlFlags U16) int32 { /* sqlite3.c:146519:20: */
bp := tls.Alloc(172)
defer tls.Free(172)
var ret int32 = 0
- if int32((*Parse)(unsafe.Pointer((func() uintptr {
+ if int32((*Parse)(unsafe.Pointer(func() uintptr {
if (*Parse)(unsafe.Pointer(pParse)).FpToplevel != 0 {
return (*Parse)(unsafe.Pointer(pParse)).FpToplevel
}
return pParse
- }()))).Fexplain) == 2 {
- var pItem uintptr = ((pTabList + 8 /* &.a */) + uintptr((*WhereLevel)(unsafe.Pointer(pLevel)).FiFrom)*72)
+ }())).Fexplain) == 2 {
+ var pItem uintptr = pTabList + 8 + uintptr((*WhereLevel)(unsafe.Pointer(pLevel)).FiFrom)*72
var v uintptr = (*Parse)(unsafe.Pointer(pParse)).FpVdbe // VM being constructed
var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb // Database handle
var isSearch int32 // True for a SEARCH. False for SCAN.
@@ -126933,63 +128888,63 @@ func Xsqlite3WhereExplainOneScan(tls *libc.TLS, pParse uintptr, pTabList uintptr
pLoop = (*WhereLevel)(unsafe.Pointer(pLevel)).FpWLoop
flags = (*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags
- if ((flags & U32(WHERE_MULTI_OR)) != 0) || ((int32(wctrlFlags) & WHERE_OR_SUBCLAUSE) != 0) {
+ if flags&U32(WHERE_MULTI_OR) != 0 || int32(wctrlFlags)&WHERE_OR_SUBCLAUSE != 0 {
return 0
}
- isSearch = (libc.Bool32((((flags & (U32(WHERE_BTM_LIMIT | WHERE_TOP_LIMIT))) != U32(0)) ||
- (((flags & U32(WHERE_VIRTUALTABLE)) == U32(0)) && (int32(*(*U16)(unsafe.Pointer((pLoop + 24 /* &.u */ /* &.btree */) /* &.nEq */))) > 0))) ||
- ((int32(wctrlFlags) & (WHERE_ORDERBY_MIN | WHERE_ORDERBY_MAX)) != 0)))
+ isSearch = libc.Bool32(flags&U32(WHERE_BTM_LIMIT|WHERE_TOP_LIMIT) != U32(0) ||
+ flags&U32(WHERE_VIRTUALTABLE) == U32(0) && int32(*(*U16)(unsafe.Pointer(pLoop + 24))) > 0 ||
+ int32(wctrlFlags)&(WHERE_ORDERBY_MIN|WHERE_ORDERBY_MAX) != 0)
Xsqlite3StrAccumInit(tls, bp+48 /* &str */, db, bp+72 /* &zBuf[0] */, int32(unsafe.Sizeof([100]uint8{})), SQLITE_MAX_LENGTH)
(*StrAccum)(unsafe.Pointer(bp + 48 /* &str */)).FprintfFlags = U8(SQLITE_PRINTF_INTERNAL)
- Xsqlite3_str_appendf(tls, bp+48 /* &str */, ts+19905 /* "%s %S" */, libc.VaList(bp, func() uintptr {
+ Xsqlite3_str_appendf(tls, bp+48 /* &str */, ts+21202 /* "%s %S" */, libc.VaList(bp, func() uintptr {
if isSearch != 0 {
- return ts + 19911 /* "SEARCH" */
+ return ts + 21208 /* "SEARCH" */
}
- return ts + 19918 /* "SCAN" */
+ return ts + 21215 /* "SCAN" */
}(), pItem))
- if (flags & (U32(WHERE_IPK | WHERE_VIRTUALTABLE))) == U32(0) {
+ if flags&U32(WHERE_IPK|WHERE_VIRTUALTABLE) == U32(0) {
var zFmt uintptr = uintptr(0)
var pIdx uintptr
- pIdx = *(*uintptr)(unsafe.Pointer(pLoop + 24 /* &.u */ /* &.btree */ + 8 /* &.pIndex */))
+ pIdx = *(*uintptr)(unsafe.Pointer(pLoop + 24 + 8 /* &.pIndex */))
- if !(((*Table)(unsafe.Pointer(((*SrcItem)(unsafe.Pointer(pItem)).FpTab))).FtabFlags & U32(TF_WithoutRowid)) == U32(0)) && ((int32(*(*uint16)(unsafe.Pointer((pIdx) + 56 /* &.idxType */)) & 0x3 >> 0)) == SQLITE_IDXTYPE_PRIMARYKEY) {
+ if !((*Table)(unsafe.Pointer((*SrcItem)(unsafe.Pointer(pItem)).FpTab)).FtabFlags&U32(TF_WithoutRowid) == U32(0)) && int32(*(*uint16)(unsafe.Pointer(pIdx + 56))&0x3>>0) == SQLITE_IDXTYPE_PRIMARYKEY {
if isSearch != 0 {
- zFmt = ts + 9700 /* "PRIMARY KEY" */
- }
- } else if (flags & U32(WHERE_PARTIALIDX)) != 0 {
- zFmt = ts + 19923 /* "AUTOMATIC PARTIA..." */
- } else if (flags & U32(WHERE_AUTO_INDEX)) != 0 {
- zFmt = ts + 19956 /* "AUTOMATIC COVERI..." */
- } else if (flags & U32(WHERE_IDX_ONLY)) != 0 {
- zFmt = ts + 19981 /* "COVERING INDEX %..." */
+ zFmt = ts + 10814 /* "PRIMARY KEY" */
+ }
+ } else if flags&U32(WHERE_PARTIALIDX) != 0 {
+ zFmt = ts + 21220 /* "AUTOMATIC PARTIA..." */
+ } else if flags&U32(WHERE_AUTO_INDEX) != 0 {
+ zFmt = ts + 21253 /* "AUTOMATIC COVERI..." */
+ } else if flags&U32(WHERE_IDX_ONLY) != 0 {
+ zFmt = ts + 21278 /* "COVERING INDEX %..." */
} else {
- zFmt = ts + 19999 /* "INDEX %s" */
+ zFmt = ts + 21296 /* "INDEX %s" */
}
if zFmt != 0 {
- Xsqlite3_str_append(tls, bp+48 /* &str */, ts+20008 /* " USING " */, 7)
+ Xsqlite3_str_append(tls, bp+48 /* &str */, ts+21305 /* " USING " */, 7)
Xsqlite3_str_appendf(tls, bp+48 /* &str */, zFmt, libc.VaList(bp+16, (*Index)(unsafe.Pointer(pIdx)).FzName))
explainIndexRange(tls, bp+48 /* &str */, pLoop)
}
- } else if ((flags & U32(WHERE_IPK)) != U32(0)) && ((flags & U32(WHERE_CONSTRAINT)) != U32(0)) {
+ } else if flags&U32(WHERE_IPK) != U32(0) && flags&U32(WHERE_CONSTRAINT) != U32(0) {
var zRangeOp uintptr
- if (flags & (U32(WHERE_COLUMN_EQ | WHERE_COLUMN_IN))) != 0 {
- zRangeOp = ts + 20016 /* "=" */
- } else if (flags & U32(WHERE_BOTH_LIMIT)) == U32(WHERE_BOTH_LIMIT) {
- zRangeOp = ts + 20018 /* ">? AND rowid<" */
- } else if (flags & U32(WHERE_BTM_LIMIT)) != 0 {
- zRangeOp = ts + 19901 /* ">" */
+ if flags&U32(WHERE_COLUMN_EQ|WHERE_COLUMN_IN) != 0 {
+ zRangeOp = ts + 21313 /* "=" */
+ } else if flags&U32(WHERE_BOTH_LIMIT) == U32(WHERE_BOTH_LIMIT) {
+ zRangeOp = ts + 21315 /* ">? AND rowid<" */
+ } else if flags&U32(WHERE_BTM_LIMIT) != 0 {
+ zRangeOp = ts + 21198 /* ">" */
} else {
- zRangeOp = ts + 19903 /* "<" */
+ zRangeOp = ts + 21200 /* "<" */
}
Xsqlite3_str_appendf(tls, bp+48, /* &str */
- ts+20032 /* " USING INTEGER P..." */, libc.VaList(bp+24, zRangeOp))
- } else if (flags & U32(WHERE_VIRTUALTABLE)) != U32(0) {
- Xsqlite3_str_appendf(tls, bp+48 /* &str */, ts+20070, /* " VIRTUAL TABLE I..." */
- libc.VaList(bp+32, *(*int32)(unsafe.Pointer(pLoop + 24 /* &.u */ /* &.vtab */ /* &.idxNum */)), *(*uintptr)(unsafe.Pointer(pLoop + 24 /* &.u */ /* &.vtab */ + 8 /* &.idxStr */))))
+ ts+21329 /* " USING INTEGER P..." */, libc.VaList(bp+24, zRangeOp))
+ } else if flags&U32(WHERE_VIRTUALTABLE) != U32(0) {
+ Xsqlite3_str_appendf(tls, bp+48 /* &str */, ts+21367, /* " VIRTUAL TABLE I..." */
+ libc.VaList(bp+32, *(*int32)(unsafe.Pointer(pLoop + 24)), *(*uintptr)(unsafe.Pointer(pLoop + 24 + 8 /* &.idxStr */))))
}
zMsg = Xsqlite3StrAccumFinish(tls, bp+48 /* &str */)
@@ -127039,21 +128994,21 @@ func Xsqlite3WhereExplainOneScan(tls *libc.TLS, pParse uintptr, pTabList uintptr
// The TERM_LIKECOND marking indicates that the term should be coded inside
// a conditional such that is only evaluated on the second pass of a
// LIKE-optimization loop, when scanning BLOBs instead of strings.
-func disableTerm(tls *libc.TLS, pLevel uintptr, pTerm uintptr) { /* sqlite3.c:145372:13: */
+func disableTerm(tls *libc.TLS, pLevel uintptr, pTerm uintptr) { /* sqlite3.c:146686:13: */
var nLoop int32 = 0
- for (((int32((*WhereTerm)(unsafe.Pointer(pTerm)).FwtFlags) & TERM_CODED) == 0) &&
- (((*WhereLevel)(unsafe.Pointer(pLevel)).FiLeftJoin == 0) || (((*Expr)(unsafe.Pointer(((*WhereTerm)(unsafe.Pointer(pTerm)).FpExpr))).Fflags & (U32(EP_FromJoin))) != U32(0)))) &&
- (((*WhereLevel)(unsafe.Pointer(pLevel)).FnotReady & (*WhereTerm)(unsafe.Pointer(pTerm)).FprereqAll) == uint64(0)) {
- if (nLoop != 0) && ((int32((*WhereTerm)(unsafe.Pointer(pTerm)).FwtFlags) & TERM_LIKE) != 0) {
- *(*U16)(unsafe.Pointer(pTerm + 10 /* &.wtFlags */)) |= U16((TERM_LIKECOND))
+ for int32((*WhereTerm)(unsafe.Pointer(pTerm)).FwtFlags)&TERM_CODED == 0 &&
+ ((*WhereLevel)(unsafe.Pointer(pLevel)).FiLeftJoin == 0 || (*Expr)(unsafe.Pointer((*WhereTerm)(unsafe.Pointer(pTerm)).FpExpr)).Fflags&U32(EP_FromJoin) != U32(0)) &&
+ (*WhereLevel)(unsafe.Pointer(pLevel)).FnotReady&(*WhereTerm)(unsafe.Pointer(pTerm)).FprereqAll == uint64(0) {
+ if nLoop != 0 && int32((*WhereTerm)(unsafe.Pointer(pTerm)).FwtFlags)&TERM_LIKE != 0 {
+ *(*U16)(unsafe.Pointer(pTerm + 10)) |= U16(TERM_LIKECOND)
} else {
- *(*U16)(unsafe.Pointer(pTerm + 10 /* &.wtFlags */)) |= U16((TERM_CODED))
+ *(*U16)(unsafe.Pointer(pTerm + 10)) |= U16(TERM_CODED)
}
if (*WhereTerm)(unsafe.Pointer(pTerm)).FiParent < 0 {
break
}
- pTerm = ((*WhereClause)(unsafe.Pointer((*WhereTerm)(unsafe.Pointer(pTerm)).FpWC)).Fa + uintptr((*WhereTerm)(unsafe.Pointer(pTerm)).FiParent)*48)
+ pTerm = (*WhereClause)(unsafe.Pointer((*WhereTerm)(unsafe.Pointer(pTerm)).FpWC)).Fa + uintptr((*WhereTerm)(unsafe.Pointer(pTerm)).FiParent)*48
(*WhereTerm)(unsafe.Pointer(pTerm)).FnChild--
if int32((*WhereTerm)(unsafe.Pointer(pTerm)).FnChild) != 0 {
@@ -127072,7 +129027,7 @@ func disableTerm(tls *libc.TLS, pLevel uintptr, pTerm uintptr) { /* sqlite3.c:14
//
// This routine makes its own copy of zAff so that the caller is free
// to modify zAff after this routine returns.
-func codeApplyAffinity(tls *libc.TLS, pParse uintptr, base int32, n int32, zAff uintptr) { /* sqlite3.c:145410:13: */
+func codeApplyAffinity(tls *libc.TLS, pParse uintptr, base int32, n int32, zAff uintptr) { /* sqlite3.c:146724:13: */
var v uintptr = (*Parse)(unsafe.Pointer(pParse)).FpVdbe
if zAff == uintptr(0) {
@@ -127082,12 +129037,12 @@ func codeApplyAffinity(tls *libc.TLS, pParse uintptr, base int32, n int32, zAff
// Adjust base and n to skip over SQLITE_AFF_BLOB and SQLITE_AFF_NONE
// entries at the beginning and end of the affinity string.
- for (n > 0) && (int32(*(*uint8)(unsafe.Pointer(zAff))) <= SQLITE_AFF_BLOB) {
+ for n > 0 && int32(*(*uint8)(unsafe.Pointer(zAff))) <= SQLITE_AFF_BLOB {
n--
base++
zAff++
}
- for (n > 1) && (int32(*(*uint8)(unsafe.Pointer(zAff + uintptr((n - 1))))) <= SQLITE_AFF_BLOB) {
+ for n > 1 && int32(*(*uint8)(unsafe.Pointer(zAff + uintptr(n-1)))) <= SQLITE_AFF_BLOB {
n--
}
@@ -127105,12 +129060,12 @@ func codeApplyAffinity(tls *libc.TLS, pParse uintptr, base int32, n int32, zAff
//
// * the comparison will be performed with no affinity, or
// * the affinity change in zAff is guaranteed not to change the value.
-func updateRangeAffinityStr(tls *libc.TLS, pRight uintptr, n int32, zAff uintptr) { /* sqlite3.c:145447:13: */
+func updateRangeAffinityStr(tls *libc.TLS, pRight uintptr, n int32, zAff uintptr) { /* sqlite3.c:146761:13: */
var i int32
for i = 0; i < n; i++ {
var p uintptr = Xsqlite3VectorFieldSubexpr(tls, pRight, i)
- if (int32(Xsqlite3CompareAffinity(tls, p, *(*uint8)(unsafe.Pointer(zAff + uintptr(i))))) == SQLITE_AFF_BLOB) ||
- (Xsqlite3ExprNeedsNoAffinityChange(tls, p, *(*uint8)(unsafe.Pointer(zAff + uintptr(i)))) != 0) {
+ if int32(Xsqlite3CompareAffinity(tls, p, *(*uint8)(unsafe.Pointer(zAff + uintptr(i))))) == SQLITE_AFF_BLOB ||
+ Xsqlite3ExprNeedsNoAffinityChange(tls, p, *(*uint8)(unsafe.Pointer(zAff + uintptr(i)))) != 0 {
*(*uint8)(unsafe.Pointer(zAff + uintptr(i))) = uint8(SQLITE_AFF_BLOB)
}
}
@@ -127143,45 +129098,50 @@ func updateRangeAffinityStr(tls *libc.TLS, pRight uintptr, n int32, zAff uintptr
// The reduced pX is different from the original (obviously) and thus is
// only used for indexing, to improve performance. The original unaltered
// IN expression must also be run on each output row for correctness.
-func removeUnindexableInClauseTerms(tls *libc.TLS, pParse uintptr, iEq int32, pLoop uintptr, pX uintptr) uintptr { /* sqlite3.c:145493:13: */
+func removeUnindexableInClauseTerms(tls *libc.TLS, pParse uintptr, iEq int32, pLoop uintptr, pX uintptr) uintptr { /* sqlite3.c:146807:13: */
var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb
var pNew uintptr
pNew = Xsqlite3ExprDup(tls, db, pX, 0)
if int32((*Sqlite3)(unsafe.Pointer(db)).FmallocFailed) == 0 {
- var pOrigRhs uintptr = (*Select)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pNew + 20 /* &.x */)))).FpEList // Original unmodified RHS
- var pOrigLhs uintptr = *(*uintptr)(unsafe.Pointer((*Expr)(unsafe.Pointer(pNew)).FpLeft + 20 /* &.x */)) // Original unmodified LHS
- var pRhs uintptr = uintptr(0) // New RHS after modifications
- var pLhs uintptr = uintptr(0) // New LHS after mods
- var i int32 // Loop counter
- var pSelect uintptr // Pointer to the SELECT on the RHS
+ var pOrigRhs uintptr // Original unmodified RHS
+ var pOrigLhs uintptr // Original unmodified LHS
+ var pRhs uintptr = uintptr(0) // New RHS after modifications
+ var pLhs uintptr = uintptr(0) // New LHS after mods
+ var i int32 // Loop counter
+ var pSelect uintptr // Pointer to the SELECT on the RHS
+
+ pOrigRhs = (*Select)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pNew + 20)))).FpEList
+ pOrigLhs = *(*uintptr)(unsafe.Pointer((*Expr)(unsafe.Pointer(pNew)).FpLeft + 20))
for i = iEq; i < int32((*WhereLoop)(unsafe.Pointer(pLoop)).FnLTerm); i++ {
if (*WhereTerm)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((*WhereLoop)(unsafe.Pointer(pLoop)).FaLTerm + uintptr(i)*4)))).FpExpr == pX {
- var iField int32 = (*(*int32)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer((*WhereLoop)(unsafe.Pointer(pLoop)).FaLTerm + uintptr(i)*4)) + 24 /* &.u */ /* &.x */) + 4 /* &.iField */)) - 1)
- if (*ExprList_item)(unsafe.Pointer((pOrigRhs+8 /* &.a */)+uintptr(iField)*20)).FpExpr == uintptr(0) {
+ var iField int32
+
+ iField = *(*int32)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((*WhereLoop)(unsafe.Pointer(pLoop)).FaLTerm + uintptr(i)*4)) + 24 + 4)) - 1
+ if (*ExprList_item)(unsafe.Pointer(pOrigRhs+8+uintptr(iField)*20)).FpExpr == uintptr(0) {
continue
} // Duplicate PK column
- pRhs = Xsqlite3ExprListAppend(tls, pParse, pRhs, (*ExprList_item)(unsafe.Pointer((pOrigRhs+8 /* &.a */)+uintptr(iField)*20)).FpExpr)
- (*ExprList_item)(unsafe.Pointer((pOrigRhs + 8 /* &.a */) + uintptr(iField)*20)).FpExpr = uintptr(0)
+ pRhs = Xsqlite3ExprListAppend(tls, pParse, pRhs, (*ExprList_item)(unsafe.Pointer(pOrigRhs+8+uintptr(iField)*20)).FpExpr)
+ (*ExprList_item)(unsafe.Pointer(pOrigRhs + 8 + uintptr(iField)*20)).FpExpr = uintptr(0)
- pLhs = Xsqlite3ExprListAppend(tls, pParse, pLhs, (*ExprList_item)(unsafe.Pointer((pOrigLhs+8 /* &.a */)+uintptr(iField)*20)).FpExpr)
- (*ExprList_item)(unsafe.Pointer((pOrigLhs + 8 /* &.a */) + uintptr(iField)*20)).FpExpr = uintptr(0)
+ pLhs = Xsqlite3ExprListAppend(tls, pParse, pLhs, (*ExprList_item)(unsafe.Pointer(pOrigLhs+8+uintptr(iField)*20)).FpExpr)
+ (*ExprList_item)(unsafe.Pointer(pOrigLhs + 8 + uintptr(iField)*20)).FpExpr = uintptr(0)
}
}
Xsqlite3ExprListDelete(tls, db, pOrigRhs)
Xsqlite3ExprListDelete(tls, db, pOrigLhs)
- *(*uintptr)(unsafe.Pointer((*Expr)(unsafe.Pointer(pNew)).FpLeft + 20 /* &.x */)) = pLhs
- (*Select)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pNew + 20 /* &.x */)))).FpEList = pRhs
- if (pLhs != 0) && ((*ExprList)(unsafe.Pointer(pLhs)).FnExpr == 1) {
+ *(*uintptr)(unsafe.Pointer((*Expr)(unsafe.Pointer(pNew)).FpLeft + 20)) = pLhs
+ (*Select)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pNew + 20)))).FpEList = pRhs
+ if pLhs != 0 && (*ExprList)(unsafe.Pointer(pLhs)).FnExpr == 1 {
// Take care here not to generate a TK_VECTOR containing only a
// single value. Since the parser never creates such a vector, some
// of the subroutines do not handle this case.
- var p uintptr = (*ExprList_item)(unsafe.Pointer((pLhs + 8 /* &.a */))).FpExpr
- (*ExprList_item)(unsafe.Pointer((pLhs + 8 /* &.a */))).FpExpr = uintptr(0)
+ var p uintptr = (*ExprList_item)(unsafe.Pointer(pLhs + 8)).FpExpr
+ (*ExprList_item)(unsafe.Pointer(pLhs + 8)).FpExpr = uintptr(0)
Xsqlite3ExprDelete(tls, db, (*Expr)(unsafe.Pointer(pNew)).FpLeft)
(*Expr)(unsafe.Pointer(pNew)).FpLeft = p
}
- pSelect = *(*uintptr)(unsafe.Pointer(pNew + 20 /* &.x */))
+ pSelect = *(*uintptr)(unsafe.Pointer(pNew + 20))
if (*Select)(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
@@ -127192,7 +129152,7 @@ func removeUnindexableInClauseTerms(tls *libc.TLS, pParse uintptr, iEq int32, pL
// it's easiest just to zero them here.
var pOrderBy uintptr = (*Select)(unsafe.Pointer(pSelect)).FpOrderBy
for i = 0; i < (*ExprList)(unsafe.Pointer(pOrderBy)).FnExpr; i++ {
- *(*U16)(unsafe.Pointer((pOrderBy + 8 /* &.a */) + uintptr(i)*20 + 16 /* &.u */ /* &.x */ /* &.iOrderByCol */)) = U16(0)
+ *(*U16)(unsafe.Pointer(pOrderBy + 8 + uintptr(i)*20 + 16)) = U16(0)
}
}
@@ -127213,7 +129173,7 @@ func removeUnindexableInClauseTerms(tls *libc.TLS, pParse uintptr, iEq int32, pL
// For a constraint of the form X=expr, the expression is evaluated in
// straight-line code. For constraints of the form X IN (...)
// this routine sets up a loop that will iterate over all values of X.
-func codeEqualityTerm(tls *libc.TLS, pParse uintptr, pTerm uintptr, pLevel uintptr, iEq int32, bRev int32, iTarget int32) int32 { /* sqlite3.c:145575:12: */
+func codeEqualityTerm(tls *libc.TLS, pParse uintptr, pTerm uintptr, pLevel uintptr, iEq int32, bRev int32, iTarget int32) int32 { /* sqlite3.c:146896:12: */
bp := tls.Alloc(4)
defer tls.Free(4)
@@ -127221,7 +129181,7 @@ func codeEqualityTerm(tls *libc.TLS, pParse uintptr, pTerm uintptr, pLevel uintp
var v uintptr = (*Parse)(unsafe.Pointer(pParse)).FpVdbe
var iReg int32 // Register holding results
- if (int32((*Expr)(unsafe.Pointer(pX)).Fop) == TK_EQ) || (int32((*Expr)(unsafe.Pointer(pX)).Fop) == TK_IS) {
+ if int32((*Expr)(unsafe.Pointer(pX)).Fop) == TK_EQ || int32((*Expr)(unsafe.Pointer(pX)).Fop) == TK_IS {
iReg = Xsqlite3ExprCodeTarget(tls, pParse, (*Expr)(unsafe.Pointer(pX)).FpRight, iTarget)
} else if int32((*Expr)(unsafe.Pointer(pX)).Fop) == TK_ISNULL {
iReg = iTarget
@@ -127236,9 +129196,9 @@ func codeEqualityTerm(tls *libc.TLS, pParse uintptr, pTerm uintptr, pLevel uintp
var nEq int32 = 0
var aiMap uintptr = uintptr(0)
- if ((((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & U32(WHERE_VIRTUALTABLE)) == U32(0)) &&
- (*(*uintptr)(unsafe.Pointer((pLoop + 24 /* &.u */ /* &.btree */) + 8 /* &.pIndex */)) != uintptr(0))) &&
- (*(*U8)(unsafe.Pointer((*Index)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((pLoop + 24 /* &.u */ /* &.btree */) + 8 /* &.pIndex */)))).FaSortOrder + uintptr(iEq))) != 0) {
+ if (*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags&U32(WHERE_VIRTUALTABLE) == U32(0) &&
+ *(*uintptr)(unsafe.Pointer(pLoop + 24 + 8)) != uintptr(0) &&
+ *(*U8)(unsafe.Pointer((*Index)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pLoop + 24 + 8)))).FaSortOrder + uintptr(iEq))) != 0 {
bRev = libc.BoolInt32(!(bRev != 0))
}
@@ -127246,7 +129206,7 @@ func codeEqualityTerm(tls *libc.TLS, pParse uintptr, pTerm uintptr, pLevel uintp
iReg = iTarget
for i = 0; i < iEq; i++ {
- if (*(*uintptr)(unsafe.Pointer((*WhereLoop)(unsafe.Pointer(pLoop)).FaLTerm + uintptr(i)*4)) != 0) && ((*WhereTerm)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((*WhereLoop)(unsafe.Pointer(pLoop)).FaLTerm + uintptr(i)*4)))).FpExpr == pX) {
+ if *(*uintptr)(unsafe.Pointer((*WhereLoop)(unsafe.Pointer(pLoop)).FaLTerm + uintptr(i)*4)) != 0 && (*WhereTerm)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((*WhereLoop)(unsafe.Pointer(pLoop)).FaLTerm + uintptr(i)*4)))).FpExpr == pX {
disableTerm(tls, pLevel, pTerm)
return iTarget
}
@@ -127259,14 +129219,14 @@ func codeEqualityTerm(tls *libc.TLS, pParse uintptr, pTerm uintptr, pLevel uintp
}
*(*int32)(unsafe.Pointer(bp /* iTab */)) = 0
- if (((*Expr)(unsafe.Pointer(pX)).Fflags & U32(EP_xIsSelect)) == U32(0)) || ((*ExprList)(unsafe.Pointer((*Select)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pX + 20 /* &.x */)))).FpEList)).FnExpr == 1) {
+ if !((*Expr)(unsafe.Pointer(pX)).Fflags&U32(EP_xIsSelect) != U32(0)) || (*ExprList)(unsafe.Pointer((*Select)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pX + 20)))).FpEList)).FnExpr == 1 {
eType = Xsqlite3FindInIndex(tls, pParse, pX, uint32(IN_INDEX_LOOP), uintptr(0), uintptr(0), bp /* &iTab */)
} else {
var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb
pX = removeUnindexableInClauseTerms(tls, pParse, iEq, pLoop, pX)
if !(int32((*Sqlite3)(unsafe.Pointer(db)).FmallocFailed) != 0) {
- aiMap = Xsqlite3DbMallocZero(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, (uint64(uint32(unsafe.Sizeof(int32(0))) * uint32(nEq))))
+ aiMap = Xsqlite3DbMallocZero(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, uint64(uint32(unsafe.Sizeof(int32(0)))*uint32(nEq)))
eType = Xsqlite3FindInIndex(tls, pParse, pX, uint32(IN_INDEX_LOOP), uintptr(0), aiMap, bp /* &iTab */)
(*Expr)(unsafe.Pointer((*WhereTerm)(unsafe.Pointer(pTerm)).FpExpr)).FiTable = *(*int32)(unsafe.Pointer(bp /* iTab */))
}
@@ -127285,25 +129245,25 @@ func codeEqualityTerm(tls *libc.TLS, pParse uintptr, pTerm uintptr, pLevel uintp
return OP_Rewind
}(), *(*int32)(unsafe.Pointer(bp /* iTab */)), 0)
- *(*U32)(unsafe.Pointer(pLoop + 36 /* &.wsFlags */)) |= (U32(WHERE_IN_ABLE))
- if *(*int32)(unsafe.Pointer((pLevel + 56 /* &.u */ /* &.in */) /* &.nIn */)) == 0 {
+ *(*U32)(unsafe.Pointer(pLoop + 36)) |= U32(WHERE_IN_ABLE)
+ if *(*int32)(unsafe.Pointer(pLevel + 56)) == 0 {
(*WhereLevel)(unsafe.Pointer(pLevel)).FaddrNxt = Xsqlite3VdbeMakeLabel(tls, pParse)
}
- if (iEq > 0) && (((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & U32(WHERE_IN_SEEKSCAN)) == U32(0)) {
- *(*U32)(unsafe.Pointer(pLoop + 36 /* &.wsFlags */)) |= (U32(WHERE_IN_EARLYOUT))
+ if iEq > 0 && (*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags&U32(WHERE_IN_SEEKSCAN) == U32(0) {
+ *(*U32)(unsafe.Pointer(pLoop + 36)) |= U32(WHERE_IN_EARLYOUT)
}
- i = *(*int32)(unsafe.Pointer(pLevel + 56 /* &.u */ /* &.in */ /* &.nIn */))
- *(*int32)(unsafe.Pointer(pLevel + 56 /* &.u */ /* &.in */ /* &.nIn */)) += (nEq)
- *(*uintptr)(unsafe.Pointer(pLevel + 56 /* &.u */ /* &.in */ + 4 /* &.aInLoop */)) = Xsqlite3DbReallocOrFree(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, *(*uintptr)(unsafe.Pointer(pLevel + 56 /* &.u */ /* &.in */ + 4 /* &.aInLoop */)),
- (uint64(uint32(unsafe.Sizeof(InLoop{})) * uint32(*(*int32)(unsafe.Pointer((pLevel + 56 /* &.u */ /* &.in */) /* &.nIn */))))))
- pIn = *(*uintptr)(unsafe.Pointer(pLevel + 56 /* &.u */ /* &.in */ + 4 /* &.aInLoop */))
+ i = *(*int32)(unsafe.Pointer(pLevel + 56))
+ *(*int32)(unsafe.Pointer(pLevel + 56)) += nEq
+ *(*uintptr)(unsafe.Pointer(pLevel + 56 + 4 /* &.aInLoop */)) = Xsqlite3DbReallocOrFree(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, *(*uintptr)(unsafe.Pointer(pLevel + 56 + 4 /* &.aInLoop */)),
+ uint64(uint32(unsafe.Sizeof(InLoop{}))*uint32(*(*int32)(unsafe.Pointer(pLevel + 56)))))
+ pIn = *(*uintptr)(unsafe.Pointer(pLevel + 56 + 4 /* &.aInLoop */))
if pIn != 0 {
var iMap int32 = 0 // Index in aiMap[]
- pIn += 20 * (uintptr(i))
+ pIn += 20 * uintptr(i)
for i = iEq; i < int32((*WhereLoop)(unsafe.Pointer(pLoop)).FnLTerm); i++ {
if (*WhereTerm)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((*WhereLoop)(unsafe.Pointer(pLoop)).FaLTerm + uintptr(i)*4)))).FpExpr == pX {
- var iOut int32 = ((iReg + i) - iEq)
+ var iOut int32 = iReg + i - iEq
if eType == IN_INDEX_ROWID {
*(*int32)(unsafe.Pointer(pIn + 4 /* &.addrInTop */)) = Xsqlite3VdbeAddOp2(tls, v, OP_Rowid, *(*int32)(unsafe.Pointer(bp /* iTab */)), iOut)
} else {
@@ -127325,7 +129285,7 @@ func codeEqualityTerm(tls *libc.TLS, pParse uintptr, pTerm uintptr, pLevel uintp
return uint8(OP_Next)
}()
if iEq > 0 {
- *(*int32)(unsafe.Pointer(pIn + 8 /* &.iBase */)) = (iReg - i)
+ *(*int32)(unsafe.Pointer(pIn + 8 /* &.iBase */)) = iReg - i
*(*int32)(unsafe.Pointer(pIn + 12 /* &.nPrefix */)) = i
} else {
*(*int32)(unsafe.Pointer(pIn + 12 /* &.nPrefix */)) = 0
@@ -127337,12 +129297,12 @@ func codeEqualityTerm(tls *libc.TLS, pParse uintptr, pTerm uintptr, pLevel uintp
}
}
- if (iEq > 0) &&
- (((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & (U32(WHERE_IN_SEEKSCAN | WHERE_VIRTUALTABLE))) == U32(0)) {
+ if iEq > 0 &&
+ (*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags&U32(WHERE_IN_SEEKSCAN|WHERE_VIRTUALTABLE) == U32(0) {
Xsqlite3VdbeAddOp3(tls, v, OP_SeekHit, (*WhereLevel)(unsafe.Pointer(pLevel)).FiIdxCur, 0, iEq)
}
} else {
- *(*int32)(unsafe.Pointer(pLevel + 56 /* &.u */ /* &.in */ /* &.nIn */)) = 0
+ *(*int32)(unsafe.Pointer(pLevel + 56)) = 0
}
Xsqlite3DbFree(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, aiMap)
}
@@ -127355,8 +129315,8 @@ func codeEqualityTerm(tls *libc.TLS, pParse uintptr, pTerm uintptr, pLevel uintp
// But do not disable the term unless we are certain that the term is
// not a transitive constraint. For an example of where that does not
// work, see https://sqlite.org/forum/forumpost/eb8613976a (2021-05-04)
- if (((*WhereLoop1)(unsafe.Pointer((*WhereLevel)(unsafe.Pointer(pLevel)).FpWLoop)).FwsFlags & U32(WHERE_TRANSCONS)) == U32(0)) ||
- ((int32((*WhereTerm)(unsafe.Pointer(pTerm)).FeOperator) & WO_EQUIV) == 0) {
+ if (*WhereLoop1)(unsafe.Pointer((*WhereLevel)(unsafe.Pointer(pLevel)).FpWLoop)).FwsFlags&U32(WHERE_TRANSCONS) == U32(0) ||
+ int32((*WhereTerm)(unsafe.Pointer(pTerm)).FeOperator)&WO_EQUIV == 0 {
disableTerm(tls, pLevel, pTerm)
}
@@ -127406,7 +129366,7 @@ func codeEqualityTerm(tls *libc.TLS, pParse uintptr, pTerm uintptr, pLevel uintp
// no conversion should be attempted before using a t2.b value as part of
// a key to search the index. Hence the first byte in the returned affinity
// string in this example would be set to SQLITE_AFF_BLOB.
-func codeAllEqualityTerms(tls *libc.TLS, pParse uintptr, pLevel uintptr, bRev int32, nExtraReg int32, pzAff uintptr) int32 { /* sqlite3.c:145771:12: */
+func codeAllEqualityTerms(tls *libc.TLS, pParse uintptr, pLevel uintptr, bRev int32, nExtraReg int32, pzAff uintptr) int32 { /* sqlite3.c:147092:12: */
var nEq U16 // The number of == or IN constraints to code
var nSkip U16 // Number of left-most columns to skip
var v uintptr = (*Parse)(unsafe.Pointer(pParse)).FpVdbe // The vm under construction
@@ -127421,20 +129381,20 @@ func codeAllEqualityTerms(tls *libc.TLS, pParse uintptr, pLevel uintptr, bRev in
// This module is only called on query plans that use an index.
pLoop = (*WhereLevel)(unsafe.Pointer(pLevel)).FpWLoop
- nEq = *(*U16)(unsafe.Pointer(pLoop + 24 /* &.u */ /* &.btree */ /* &.nEq */))
+ nEq = *(*U16)(unsafe.Pointer(pLoop + 24))
nSkip = (*WhereLoop)(unsafe.Pointer(pLoop)).FnSkip
- pIdx = *(*uintptr)(unsafe.Pointer(pLoop + 24 /* &.u */ /* &.btree */ + 8 /* &.pIndex */))
+ pIdx = *(*uintptr)(unsafe.Pointer(pLoop + 24 + 8 /* &.pIndex */))
// Figure out how many memory cells we will need then allocate them.
- regBase = ((*Parse)(unsafe.Pointer(pParse)).FnMem + 1)
- nReg = (int32(*(*U16)(unsafe.Pointer((pLoop + 24 /* &.u */ /* &.btree */) /* &.nEq */))) + nExtraReg)
- *(*int32)(unsafe.Pointer(pParse + 44 /* &.nMem */)) += (nReg)
+ regBase = (*Parse)(unsafe.Pointer(pParse)).FnMem + 1
+ nReg = int32(*(*U16)(unsafe.Pointer(pLoop + 24))) + nExtraReg
+ *(*int32)(unsafe.Pointer(pParse + 44)) += nReg
zAff = Xsqlite3DbStrDup(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, Xsqlite3IndexAffinityStr(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, pIdx))
if nSkip != 0 {
var iIdxCur int32 = (*WhereLevel)(unsafe.Pointer(pLevel)).FiIdxCur
- Xsqlite3VdbeAddOp3(tls, v, OP_Null, 0, regBase, ((regBase + int32(nSkip)) - 1))
+ Xsqlite3VdbeAddOp3(tls, v, OP_Null, 0, regBase, regBase+int32(nSkip)-1)
Xsqlite3VdbeAddOp1(tls, v, func() int32 {
if bRev != 0 {
return OP_Last
@@ -127453,7 +129413,7 @@ func codeAllEqualityTerms(tls *libc.TLS, pParse uintptr, pLevel uintptr, bRev in
Xsqlite3VdbeJumpHere(tls, v, j)
for j = 0; j < int32(nSkip); j++ {
- Xsqlite3VdbeAddOp3(tls, v, OP_Column, iIdxCur, j, (regBase + j))
+ Xsqlite3VdbeAddOp3(tls, v, OP_Column, iIdxCur, j, regBase+j)
}
}
@@ -127467,17 +129427,17 @@ func codeAllEqualityTerms(tls *libc.TLS, pParse uintptr, pLevel uintptr, bRev in
// The following testcase is true for indices with redundant columns.
// Ex: CREATE INDEX i1 ON t1(a,b,a); SELECT * FROM t1 WHERE a=0 AND b=0;
- r1 = codeEqualityTerm(tls, pParse, pTerm, pLevel, j, bRev, (regBase + j))
- if r1 != (regBase + j) {
+ r1 = codeEqualityTerm(tls, pParse, pTerm, pLevel, j, bRev, regBase+j)
+ if r1 != regBase+j {
if nReg == 1 {
Xsqlite3ReleaseTempReg(tls, pParse, regBase)
regBase = r1
} else {
- Xsqlite3VdbeAddOp2(tls, v, OP_Copy, r1, (regBase + j))
+ Xsqlite3VdbeAddOp2(tls, v, OP_Copy, r1, regBase+j)
}
}
- if (int32((*WhereTerm)(unsafe.Pointer(pTerm)).FeOperator) & WO_IN) != 0 {
- if ((*Expr)(unsafe.Pointer((*WhereTerm)(unsafe.Pointer(pTerm)).FpExpr)).Fflags & U32(EP_xIsSelect)) != 0 {
+ if int32((*WhereTerm)(unsafe.Pointer(pTerm)).FeOperator)&WO_IN != 0 {
+ if (*Expr)(unsafe.Pointer((*WhereTerm)(unsafe.Pointer(pTerm)).FpExpr)).Fflags&U32(EP_xIsSelect) != 0 {
// No affinity ever needs to be (or should be) applied to a value
// from the RHS of an "? IN (SELECT ...)" expression. The
// sqlite3FindInIndex() routine has already ensured that the
@@ -127486,13 +129446,13 @@ func codeAllEqualityTerms(tls *libc.TLS, pParse uintptr, pLevel uintptr, bRev in
*(*uint8)(unsafe.Pointer(zAff + uintptr(j))) = uint8(SQLITE_AFF_BLOB)
}
}
- } else if (int32((*WhereTerm)(unsafe.Pointer(pTerm)).FeOperator) & WO_ISNULL) == 0 {
+ } else if int32((*WhereTerm)(unsafe.Pointer(pTerm)).FeOperator)&WO_ISNULL == 0 {
var pRight uintptr = (*Expr)(unsafe.Pointer((*WhereTerm)(unsafe.Pointer(pTerm)).FpExpr)).FpRight
- if ((int32((*WhereTerm)(unsafe.Pointer(pTerm)).FwtFlags) & TERM_IS) == 0) && (Xsqlite3ExprCanBeNull(tls, pRight) != 0) {
- Xsqlite3VdbeAddOp2(tls, v, OP_IsNull, (regBase + j), (*WhereLevel)(unsafe.Pointer(pLevel)).FaddrBrk)
+ if int32((*WhereTerm)(unsafe.Pointer(pTerm)).FwtFlags)&TERM_IS == 0 && Xsqlite3ExprCanBeNull(tls, pRight) != 0 {
+ Xsqlite3VdbeAddOp2(tls, v, OP_IsNull, regBase+j, (*WhereLevel)(unsafe.Pointer(pLevel)).FaddrBrk)
}
- if (int32((*Sqlite3)(unsafe.Pointer((*Parse)(unsafe.Pointer(pParse)).Fdb)).FmallocFailed) == 0) && ((*Parse)(unsafe.Pointer(pParse)).FnErr == 0) {
+ if int32((*Sqlite3)(unsafe.Pointer((*Parse)(unsafe.Pointer(pParse)).Fdb)).FmallocFailed) == 0 && (*Parse)(unsafe.Pointer(pParse)).FnErr == 0 {
if int32(Xsqlite3CompareAffinity(tls, pRight, *(*uint8)(unsafe.Pointer(zAff + uintptr(j))))) == SQLITE_AFF_BLOB {
*(*uint8)(unsafe.Pointer(zAff + uintptr(j))) = uint8(SQLITE_AFF_BLOB)
}
@@ -127522,25 +129482,25 @@ func codeAllEqualityTerms(tls *libc.TLS, pParse uintptr, pLevel uintptr, bRev in
// on. For each table column, if the column is the i'th column of the
// index, then the corresponding array entry is set to (i+1). If the column
// does not appear in the index at all, the array entry is set to 0.
-func codeDeferredSeek(tls *libc.TLS, pWInfo uintptr, pIdx uintptr, iCur int32, iIdxCur int32) { /* sqlite3.c:146144:13: */
+func codeDeferredSeek(tls *libc.TLS, pWInfo uintptr, pIdx uintptr, iCur int32, iIdxCur int32) { /* sqlite3.c:147465:13: */
var pParse uintptr = (*WhereInfo)(unsafe.Pointer(pWInfo)).FpParse // Parse context
var v uintptr = (*Parse)(unsafe.Pointer(pParse)).FpVdbe // Vdbe to generate code within
- libc.SetBitFieldPtr8Uint32(pWInfo+48 /* &.bDeferredSeek */, uint32(1), 0, 0x1)
+ libc.SetBitFieldPtr8Uint32(pWInfo+48, uint32(1), 0, 0x1)
Xsqlite3VdbeAddOp3(tls, v, OP_DeferredSeek, iIdxCur, 0, iCur)
- if ((int32((*WhereInfo)(unsafe.Pointer(pWInfo)).FwctrlFlags) & WHERE_OR_SUBCLAUSE) != 0) &&
- (((*Parse)(unsafe.Pointer(func() uintptr {
+ if int32((*WhereInfo)(unsafe.Pointer(pWInfo)).FwctrlFlags)&WHERE_OR_SUBCLAUSE != 0 &&
+ (*Parse)(unsafe.Pointer(func() uintptr {
if (*Parse)(unsafe.Pointer(pParse)).FpToplevel != 0 {
return (*Parse)(unsafe.Pointer(pParse)).FpToplevel
}
return pParse
- }())).FwriteMask) == YDbMask(0)) {
+ }())).FwriteMask == YDbMask(0) {
var i int32
var pTab uintptr = (*Index)(unsafe.Pointer(pIdx)).FpTable
- var ai uintptr = Xsqlite3DbMallocZero(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, (uint64(uint32(unsafe.Sizeof(U32(0))) * (uint32(int32((*Table)(unsafe.Pointer(pTab)).FnCol) + 1)))))
+ var ai uintptr = Xsqlite3DbMallocZero(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, uint64(uint32(unsafe.Sizeof(U32(0)))*uint32(int32((*Table)(unsafe.Pointer(pTab)).FnCol)+1)))
if ai != 0 {
*(*U32)(unsafe.Pointer(ai)) = U32((*Table)(unsafe.Pointer(pTab)).FnCol)
- for i = 0; i < (int32((*Index)(unsafe.Pointer(pIdx)).FnColumn) - 1); i++ {
+ for i = 0; i < int32((*Index)(unsafe.Pointer(pIdx)).FnColumn)-1; i++ {
var x1 int32
var x2 int32
@@ -127548,7 +129508,7 @@ func codeDeferredSeek(tls *libc.TLS, pWInfo uintptr, pIdx uintptr, iCur int32, i
x2 = int32(Xsqlite3TableColumnToStorage(tls, pTab, int16(x1)))
if x1 >= 0 {
- *(*U32)(unsafe.Pointer(ai + uintptr((x2+1))*4)) = (U32(i + 1))
+ *(*U32)(unsafe.Pointer(ai + uintptr(x2+1)*4)) = U32(i + 1)
}
}
Xsqlite3VdbeChangeP4(tls, v, -1, ai, -15)
@@ -127563,21 +129523,23 @@ func codeDeferredSeek(tls *libc.TLS, pWInfo uintptr, pIdx uintptr, iCur int32, i
// If the expression is not a vector, then nReg must be passed 1. In
// this case, generate code to evaluate the expression and leave the
// result in register iReg.
-func codeExprOrVector(tls *libc.TLS, pParse uintptr, p uintptr, iReg int32, nReg int32) { /* sqlite3.c:146188:13: */
+func codeExprOrVector(tls *libc.TLS, pParse uintptr, p uintptr, iReg int32, nReg int32) { /* sqlite3.c:147509:13: */
- if (p != 0) && (Xsqlite3ExprIsVector(tls, p) != 0) {
- if ((*Expr)(unsafe.Pointer(p)).Fflags & U32(EP_xIsSelect)) != 0 {
+ if p != 0 && Xsqlite3ExprIsVector(tls, p) != 0 {
+ if (*Expr)(unsafe.Pointer(p)).Fflags&U32(EP_xIsSelect) != U32(0) {
var v uintptr = (*Parse)(unsafe.Pointer(pParse)).FpVdbe
var iSelect int32
iSelect = Xsqlite3CodeSubselect(tls, pParse, p)
- Xsqlite3VdbeAddOp3(tls, v, OP_Copy, iSelect, iReg, (nReg - 1))
+ Xsqlite3VdbeAddOp3(tls, v, OP_Copy, iSelect, iReg, nReg-1)
} else {
var i int32
- var pList uintptr = *(*uintptr)(unsafe.Pointer(p + 20 /* &.x */))
+ var pList uintptr
+
+ pList = *(*uintptr)(unsafe.Pointer(p + 20))
for i = 0; i < nReg; i++ {
- Xsqlite3ExprCode(tls, pParse, (*ExprList_item)(unsafe.Pointer((pList+8 /* &.a */)+uintptr(i)*20)).FpExpr, (iReg + i))
+ Xsqlite3ExprCode(tls, pParse, (*ExprList_item)(unsafe.Pointer(pList+8+uintptr(i)*20)).FpExpr, iReg+i)
}
}
} else {
@@ -127589,10 +129551,10 @@ func codeExprOrVector(tls *libc.TLS, pParse uintptr, p uintptr, iReg int32, nReg
// An instance of the IdxExprTrans object carries information about a
// mapping from an expression on table columns into a column in an index
// down through the Walker.
-type IdxExprTrans = IdxExprTrans1 /* sqlite3.c:146226:3 */
+type IdxExprTrans = IdxExprTrans1 /* sqlite3.c:147549:3 */
// Preserve pExpr on the WhereETrans list of the WhereInfo.
-func preserveExpr(tls *libc.TLS, pTrans uintptr, pExpr uintptr) { /* sqlite3.c:146231:13: */
+func preserveExpr(tls *libc.TLS, pTrans uintptr, pExpr uintptr) { /* sqlite3.c:147554:13: */
var pNew uintptr
pNew = Xsqlite3DbMallocRaw(tls, (*IdxExprTrans)(unsafe.Pointer(pTrans)).Fdb, uint64(unsafe.Sizeof(WhereExprMod{})))
if pNew == uintptr(0) {
@@ -127601,7 +129563,7 @@ func preserveExpr(tls *libc.TLS, pTrans uintptr, pExpr uintptr) { /* sqlite3.c:1
(*WhereExprMod)(unsafe.Pointer(pNew)).FpNext = (*WhereInfo)(unsafe.Pointer((*IdxExprTrans)(unsafe.Pointer(pTrans)).FpWInfo)).FpExprMods
(*WhereInfo)(unsafe.Pointer((*IdxExprTrans)(unsafe.Pointer(pTrans)).FpWInfo)).FpExprMods = pNew
(*WhereExprMod)(unsafe.Pointer(pNew)).FpExpr = pExpr
- libc.Xmemcpy(tls, (pNew + 8 /* &.orig */), pExpr, uint32(unsafe.Sizeof(Expr{})))
+ libc.Xmemcpy(tls, pNew+8, pExpr, uint32(unsafe.Sizeof(Expr{})))
}
// The walker node callback used to transform matching expressions into
@@ -127609,17 +129571,17 @@ func preserveExpr(tls *libc.TLS, pTrans uintptr, pExpr uintptr) { /* sqlite3.c:1
//
// If pExpr matches, then transform it into a reference to the index column
// that contains the value of pExpr.
-func whereIndexExprTransNode(tls *libc.TLS, p uintptr, pExpr uintptr) int32 { /* sqlite3.c:146247:12: */
- var pX uintptr = *(*uintptr)(unsafe.Pointer(p + 24 /* &.u */))
+func whereIndexExprTransNode(tls *libc.TLS, p uintptr, pExpr uintptr) int32 { /* sqlite3.c:147570:12: */
+ var pX uintptr = *(*uintptr)(unsafe.Pointer(p + 24))
if Xsqlite3ExprCompare(tls, uintptr(0), pExpr, (*IdxExprTrans)(unsafe.Pointer(pX)).FpIdxExpr, (*IdxExprTrans)(unsafe.Pointer(pX)).FiTabCur) == 0 {
preserveExpr(tls, pX, pExpr)
(*Expr)(unsafe.Pointer(pExpr)).FaffExpr = Xsqlite3ExprAffinity(tls, pExpr)
(*Expr)(unsafe.Pointer(pExpr)).Fop = U8(TK_COLUMN)
(*Expr)(unsafe.Pointer(pExpr)).FiTable = (*IdxExprTrans)(unsafe.Pointer(pX)).FiIdxCur
(*Expr)(unsafe.Pointer(pExpr)).FiColumn = YnVar((*IdxExprTrans)(unsafe.Pointer(pX)).FiIdxCol)
- *(*uintptr)(unsafe.Pointer(pExpr + 44 /* &.y */)) = uintptr(0)
- *(*U32)(unsafe.Pointer(pExpr + 4 /* &.flags */)) &= (libc.Uint32FromInt32(libc.CplInt32((EP_Skip | EP_Unlikely))))
+ *(*U32)(unsafe.Pointer(pExpr + 4)) &= libc.Uint32FromInt32(libc.CplInt32(EP_Skip | EP_Unlikely | EP_WinFunc | EP_Subrtn))
+ *(*uintptr)(unsafe.Pointer(pExpr + 44)) = uintptr(0)
return WRC_Prune
} else {
return WRC_Continue
@@ -127629,16 +129591,16 @@ func whereIndexExprTransNode(tls *libc.TLS, p uintptr, pExpr uintptr) int32 { /*
// A walker node callback that translates a column reference to a table
// into a corresponding column reference of an index.
-func whereIndexExprTransColumn(tls *libc.TLS, p uintptr, pExpr uintptr) int32 { /* sqlite3.c:146269:12: */
+func whereIndexExprTransColumn(tls *libc.TLS, p uintptr, pExpr uintptr) int32 { /* sqlite3.c:147592:12: */
if int32((*Expr)(unsafe.Pointer(pExpr)).Fop) == TK_COLUMN {
- var pX uintptr = *(*uintptr)(unsafe.Pointer(p + 24 /* &.u */))
- if ((*Expr)(unsafe.Pointer(pExpr)).FiTable == (*IdxExprTrans)(unsafe.Pointer(pX)).FiTabCur) && (int32((*Expr)(unsafe.Pointer(pExpr)).FiColumn) == (*IdxExprTrans)(unsafe.Pointer(pX)).FiTabCol) {
+ var pX uintptr = *(*uintptr)(unsafe.Pointer(p + 24))
+ if (*Expr)(unsafe.Pointer(pExpr)).FiTable == (*IdxExprTrans)(unsafe.Pointer(pX)).FiTabCur && int32((*Expr)(unsafe.Pointer(pExpr)).FiColumn) == (*IdxExprTrans)(unsafe.Pointer(pX)).FiTabCol {
preserveExpr(tls, pX, pExpr)
- (*Expr)(unsafe.Pointer(pExpr)).FaffExpr = Xsqlite3TableColumnAffinity(tls, *(*uintptr)(unsafe.Pointer(pExpr + 44 /* &.y */)), int32((*Expr)(unsafe.Pointer(pExpr)).FiColumn))
+ (*Expr)(unsafe.Pointer(pExpr)).FaffExpr = Xsqlite3TableColumnAffinity(tls, *(*uintptr)(unsafe.Pointer(pExpr + 44)), int32((*Expr)(unsafe.Pointer(pExpr)).FiColumn))
(*Expr)(unsafe.Pointer(pExpr)).FiTable = (*IdxExprTrans)(unsafe.Pointer(pX)).FiIdxCur
(*Expr)(unsafe.Pointer(pExpr)).FiColumn = YnVar((*IdxExprTrans)(unsafe.Pointer(pX)).FiIdxCol)
- *(*uintptr)(unsafe.Pointer(pExpr + 44 /* &.y */)) = uintptr(0)
+ *(*uintptr)(unsafe.Pointer(pExpr + 44)) = uintptr(0)
}
}
return WRC_Continue
@@ -127651,7 +129613,7 @@ func whereIndexExprTransColumn(tls *libc.TLS, p uintptr, pExpr uintptr) int32 {
// 2019-10-24: Updated to also translate references to a VIRTUAL column in
// the table into references to the corresponding (stored) column of the
// index.
-func whereIndexExprTrans(tls *libc.TLS, pIdx uintptr, iTabCur int32, iIdxCur int32, pWInfo uintptr) { /* sqlite3.c:146294:13: */
+func whereIndexExprTrans(tls *libc.TLS, pIdx uintptr, iTabCur int32, iIdxCur int32, pWInfo uintptr) { /* sqlite3.c:147617:13: */
bp := tls.Alloc(56)
defer tls.Free(56)
@@ -127663,33 +129625,34 @@ func whereIndexExprTrans(tls *libc.TLS, pIdx uintptr, iTabCur int32, iIdxCur int
// var x IdxExprTrans at bp+28, 28
aColExpr = (*Index)(unsafe.Pointer(pIdx)).FaColExpr
- if (aColExpr == uintptr(0)) && !((int32(*(*uint16)(unsafe.Pointer(pIdx + 56 /* &.bHasVCol */)) & 0x400 >> 10)) != 0) {
+ if aColExpr == uintptr(0) && !(int32(*(*uint16)(unsafe.Pointer(pIdx + 56))&0x400>>10) != 0) {
// The index does not reference any expressions or virtual columns
// so no translations are needed.
return
}
pTab = (*Index)(unsafe.Pointer(pIdx)).FpTable
libc.Xmemset(tls, bp /* &w */, 0, uint32(unsafe.Sizeof(Walker{})))
- *(*uintptr)(unsafe.Pointer(bp /* &w */ + 24 /* &.u */)) = bp + 28 /* &x */
+ *(*uintptr)(unsafe.Pointer(bp + 24)) = bp + 28 /* &x */
(*IdxExprTrans)(unsafe.Pointer(bp + 28 /* &x */)).FiTabCur = iTabCur
(*IdxExprTrans)(unsafe.Pointer(bp + 28 /* &x */)).FiIdxCur = iIdxCur
(*IdxExprTrans)(unsafe.Pointer(bp + 28 /* &x */)).FpWInfo = pWInfo
(*IdxExprTrans)(unsafe.Pointer(bp + 28 /* &x */)).Fdb = (*Parse)(unsafe.Pointer((*WhereInfo)(unsafe.Pointer(pWInfo)).FpParse)).Fdb
for iIdxCol = 0; iIdxCol < int32((*Index)(unsafe.Pointer(pIdx)).FnColumn); iIdxCol++ {
var iRef I16 = *(*I16)(unsafe.Pointer((*Index)(unsafe.Pointer(pIdx)).FaiColumn + uintptr(iIdxCol)*2))
- if int32(iRef) == (-2) {
+ if int32(iRef) == -2 {
- (*IdxExprTrans)(unsafe.Pointer(bp + 28 /* &x */)).FpIdxExpr = (*ExprList_item)(unsafe.Pointer((aColExpr + 8 /* &.a */) + uintptr(iIdxCol)*20)).FpExpr
- if Xsqlite3ExprIsConstant(tls, (*IdxExprTrans)(unsafe.Pointer(bp+28 /* &x */)).FpIdxExpr) != 0 {
+ (*IdxExprTrans)(unsafe.Pointer(bp + 28 /* &x */)).FpIdxExpr = (*ExprList_item)(unsafe.Pointer(aColExpr + 8 + uintptr(iIdxCol)*20)).FpExpr
+ if Xsqlite3ExprIsConstant(tls, (*IdxExprTrans)(unsafe.Pointer(bp+28)).FpIdxExpr) != 0 {
continue
}
(*Walker)(unsafe.Pointer(bp /* &w */)).FxExprCallback = *(*uintptr)(unsafe.Pointer(&struct {
f func(*libc.TLS, uintptr, uintptr) int32
}{whereIndexExprTransNode}))
- } else if ((int32(iRef) >= 0) &&
- ((int32((*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FaCol+uintptr(iRef)*20)).FcolFlags) & COLFLAG_VIRTUAL) != 0)) &&
- (((*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FaCol+uintptr(iRef)*20)).FzColl == uintptr(0)) ||
- (Xsqlite3StrICmp(tls, (*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FaCol+uintptr(iRef)*20)).FzColl, uintptr(unsafe.Pointer(&Xsqlite3StrBINARY))) == 0)) {
+ } else if int32(iRef) >= 0 &&
+ int32((*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FaCol+uintptr(iRef)*16)).FcolFlags)&COLFLAG_VIRTUAL != 0 &&
+ (int32((*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FaCol+uintptr(iRef)*16)).FcolFlags)&COLFLAG_HASCOLL == 0 ||
+ Xsqlite3StrICmp(tls, Xsqlite3ColumnColl(tls, (*Table)(unsafe.Pointer(pTab)).FaCol+uintptr(iRef)*16),
+ uintptr(unsafe.Pointer(&Xsqlite3StrBINARY))) == 0) {
// Check to see if there are direct references to generated columns
// that are contained in the index. Pulling the generated column
// out of the index is an optimization only - the main table is always
@@ -127715,7 +129678,7 @@ func whereIndexExprTrans(tls *libc.TLS, pIdx uintptr, iTabCur int32, iIdxCur int
// WHERE clause terms on the query, and if any of those terms must be
// true because pTruth is true, then mark those WHERE clause terms as
// coded.
-func whereApplyPartialIndexConstraints(tls *libc.TLS, pTruth uintptr, iTabCur int32, pWC uintptr) { /* sqlite3.c:146357:13: */
+func whereApplyPartialIndexConstraints(tls *libc.TLS, pTruth uintptr, iTabCur int32, pWC uintptr) { /* sqlite3.c:147681:13: */
var i int32
var pTerm uintptr
for int32((*Expr)(unsafe.Pointer(pTruth)).Fop) == TK_AND {
@@ -127730,12 +129693,12 @@ __1:
}
{
var pExpr uintptr
- if (int32((*WhereTerm)(unsafe.Pointer(pTerm)).FwtFlags) & TERM_CODED) != 0 {
+ if int32((*WhereTerm)(unsafe.Pointer(pTerm)).FwtFlags)&TERM_CODED != 0 {
goto __2
}
pExpr = (*WhereTerm)(unsafe.Pointer(pTerm)).FpExpr
if Xsqlite3ExprCompare(tls, uintptr(0), pExpr, pTruth, iTabCur) == 0 {
- *(*U16)(unsafe.Pointer(pTerm + 10 /* &.wtFlags */)) |= U16((TERM_CODED))
+ *(*U16)(unsafe.Pointer(pTerm + 10)) |= U16(TERM_CODED)
}
}
@@ -127750,7 +129713,7 @@ __3:
// Generate code for the start of the iLevel-th loop in the WHERE clause
// implementation described by pWInfo.
-func Xsqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWInfo uintptr, iLevel int32, pLevel uintptr, notReady Bitmask) Bitmask { /* sqlite3.c:146382:24: */
+func Xsqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWInfo uintptr, iLevel int32, pLevel uintptr, notReady Bitmask) Bitmask { /* sqlite3.c:147706:24: */
bp := tls.Alloc(72)
defer tls.Free(72)
@@ -127772,13 +129735,13 @@ func Xsqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI
var pIdx uintptr = uintptr(0) // Index used by loop (if any)
var iLoop int32 // Iteration of constraint generator loop
- pWC = (pWInfo + 80 /* &.sWC */)
+ pWC = pWInfo + 80
db = (*Parse)(unsafe.Pointer(pParse)).Fdb
pLoop = (*WhereLevel)(unsafe.Pointer(pLevel)).FpWLoop
- pTabItem = (((*WhereInfo)(unsafe.Pointer(pWInfo)).FpTabList + 8 /* &.a */) + uintptr((*WhereLevel)(unsafe.Pointer(pLevel)).FiFrom)*72)
+ pTabItem = (*WhereInfo)(unsafe.Pointer(pWInfo)).FpTabList + 8 + uintptr((*WhereLevel)(unsafe.Pointer(pLevel)).FiFrom)*72
iCur = (*SrcItem)(unsafe.Pointer(pTabItem)).FiCursor
- (*WhereLevel)(unsafe.Pointer(pLevel)).FnotReady = (notReady & ^Xsqlite3WhereGetMask(tls, (pWInfo+488 /* &.sMaskSet */), iCur))
- bRev = (int32(((*WhereInfo)(unsafe.Pointer(pWInfo)).FrevMask >> iLevel) & uint64(1)))
+ (*WhereLevel)(unsafe.Pointer(pLevel)).FnotReady = notReady & ^Xsqlite3WhereGetMask(tls, pWInfo+488, iCur)
+ bRev = int32((*WhereInfo)(unsafe.Pointer(pWInfo)).FrevMask >> iLevel & uint64(1))
// Create labels for the "break" and "continue" instructions
// for the current loop. Jump to addrBrk to break out of a loop.
@@ -127789,14 +129752,14 @@ func Xsqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI
// means to continue with the next IN value combination. When
// there are no IN operators in the constraints, the "addrNxt" label
// is the same as "addrBrk".
- addrBrk = libc.AssignPtrInt32(pLevel+12 /* &.addrBrk */, libc.AssignPtrInt32(pLevel+16 /* &.addrNxt */, Xsqlite3VdbeMakeLabel(tls, pParse)))
- addrCont = libc.AssignPtrInt32(pLevel+24 /* &.addrCont */, Xsqlite3VdbeMakeLabel(tls, pParse))
+ addrBrk = libc.AssignPtrInt32(pLevel+12, libc.AssignPtrInt32(pLevel+16, Xsqlite3VdbeMakeLabel(tls, pParse)))
+ addrCont = libc.AssignPtrInt32(pLevel+24, Xsqlite3VdbeMakeLabel(tls, pParse))
// If this is the right table of a LEFT OUTER JOIN, allocate and
// initialize a memory cell that records if this table matches any
// row of the left table of the join.
- if (int32((*WhereLevel)(unsafe.Pointer(pLevel)).FiFrom) > 0) && ((int32((*SrcItem)(unsafe.Pointer(pTabItem)).Ffg.Fjointype) & JT_LEFT) != 0) {
+ if int32((*WhereLevel)(unsafe.Pointer(pLevel)).FiFrom) > 0 && int32((*SrcItem)(unsafe.Pointer(pTabItem)).Ffg.Fjointype)&JT_LEFT != 0 {
(*WhereLevel)(unsafe.Pointer(pLevel)).FiLeftJoin = libc.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1)
Xsqlite3VdbeAddOp2(tls, v, OP_Integer, 0, (*WhereLevel)(unsafe.Pointer(pLevel)).FiLeftJoin)
@@ -127804,18 +129767,18 @@ func Xsqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI
// Compute a safe address to jump to if we discover that the table for
// this loop is empty and can never contribute content.
- for j = iLevel; (j > 0) && ((*WhereLevel)(unsafe.Pointer((pWInfo+752 /* &.a */)+uintptr(j)*80)).FiLeftJoin == 0); j-- {
+ for j = iLevel; j > 0 && (*WhereLevel)(unsafe.Pointer(pWInfo+752 /* &.a */ +uintptr(j)*80)).FiLeftJoin == 0; j-- {
}
- addrHalt = (*WhereLevel)(unsafe.Pointer((pWInfo + 752 /* &.a */) + uintptr(j)*80)).FaddrBrk
+ addrHalt = (*WhereLevel)(unsafe.Pointer(pWInfo + 752 + uintptr(j)*80)).FaddrBrk
// Special case of a FROM clause subquery implemented as a co-routine
- if (uint32(int32(*(*uint16)(unsafe.Pointer(pTabItem + 36 /* &.fg */ + 4 /* &.viaCoroutine */)) & 0x10 >> 4))) != 0 {
+ if uint32(int32(*(*uint16)(unsafe.Pointer(pTabItem + 36 + 4))&0x10>>4)) != 0 {
var regYield int32 = (*SrcItem)(unsafe.Pointer(pTabItem)).FregReturn
Xsqlite3VdbeAddOp3(tls, v, OP_InitCoroutine, regYield, 0, (*SrcItem)(unsafe.Pointer(pTabItem)).FaddrFillSub)
(*WhereLevel)(unsafe.Pointer(pLevel)).Fp2 = Xsqlite3VdbeAddOp2(tls, v, OP_Yield, regYield, addrBrk)
(*WhereLevel)(unsafe.Pointer(pLevel)).Fop = U8(OP_Goto)
- } else if ((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & U32(WHERE_VIRTUALTABLE)) != U32(0) {
+ } else if (*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags&U32(WHERE_VIRTUALTABLE) != U32(0) {
// Case 1: The table is a virtual-table. Use the VFilter and VNext
// to access the data.
var iReg int32 // P3 Value for OP_VFilter
@@ -127823,15 +129786,15 @@ func Xsqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI
var nConstraint int32 = int32((*WhereLoop)(unsafe.Pointer(pLoop)).FnLTerm)
var iIn int32 // Counter for IN constraints
- iReg = Xsqlite3GetTempRange(tls, pParse, (nConstraint + 2))
+ iReg = Xsqlite3GetTempRange(tls, pParse, nConstraint+2)
addrNotFound = (*WhereLevel)(unsafe.Pointer(pLevel)).FaddrBrk
for j = 0; j < nConstraint; j++ {
- var iTarget int32 = ((iReg + j) + 2)
+ var iTarget int32 = iReg + j + 2
pTerm = *(*uintptr)(unsafe.Pointer((*WhereLoop)(unsafe.Pointer(pLoop)).FaLTerm + uintptr(j)*4))
if pTerm == uintptr(0) {
continue
}
- if (int32((*WhereTerm)(unsafe.Pointer(pTerm)).FeOperator) & WO_IN) != 0 {
+ if int32((*WhereTerm)(unsafe.Pointer(pTerm)).FeOperator)&WO_IN != 0 {
codeEqualityTerm(tls, pParse, pTerm, pLevel, j, bRev, iTarget)
addrNotFound = (*WhereLevel)(unsafe.Pointer(pLevel)).FaddrNxt
} else {
@@ -127839,22 +129802,22 @@ func Xsqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI
codeExprOrVector(tls, pParse, pRight, iTarget, 1)
}
}
- Xsqlite3VdbeAddOp2(tls, v, OP_Integer, *(*int32)(unsafe.Pointer(pLoop + 24 /* &.u */ /* &.vtab */ /* &.idxNum */)), iReg)
- Xsqlite3VdbeAddOp2(tls, v, OP_Integer, nConstraint, (iReg + 1))
+ Xsqlite3VdbeAddOp2(tls, v, OP_Integer, *(*int32)(unsafe.Pointer(pLoop + 24)), iReg)
+ Xsqlite3VdbeAddOp2(tls, v, OP_Integer, nConstraint, iReg+1)
Xsqlite3VdbeAddOp4(tls, v, OP_VFilter, iCur, addrNotFound, iReg,
- *(*uintptr)(unsafe.Pointer(pLoop + 24 /* &.u */ /* &.vtab */ + 8 /* &.idxStr */)),
+ *(*uintptr)(unsafe.Pointer(pLoop + 24 + 8 /* &.idxStr */)),
func() int32 {
- if *(*U8)(unsafe.Pointer(pLoop + 24 /* &.u */ /* &.vtab */ + 4 /* &.needFree */)) != 0 {
+ if *(*U8)(unsafe.Pointer(pLoop + 24 + 4)) != 0 {
return -7
}
return -1
}())
- *(*U8)(unsafe.Pointer(pLoop + 24 /* &.u */ /* &.vtab */ + 4 /* &.needFree */)) = U8(0)
+ *(*U8)(unsafe.Pointer(pLoop + 24 + 4 /* &.needFree */)) = U8(0)
// An OOM inside of AddOp4(OP_VFilter) instruction above might have freed
// the u.vtab.idxStr. NULL it out to prevent a use-after-free
if (*Sqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 {
- *(*uintptr)(unsafe.Pointer(pLoop + 24 /* &.u */ /* &.vtab */ + 8 /* &.idxStr */)) = uintptr(0)
+ *(*uintptr)(unsafe.Pointer(pLoop + 24 + 8 /* &.idxStr */)) = uintptr(0)
}
(*WhereLevel)(unsafe.Pointer(pLevel)).Fp1 = iCur
(*WhereLevel)(unsafe.Pointer(pLevel)).Fop = func() uint8 {
@@ -127864,16 +129827,21 @@ func Xsqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI
return uint8(OP_VNext)
}()
(*WhereLevel)(unsafe.Pointer(pLevel)).Fp2 = Xsqlite3VdbeCurrentAddr(tls, v)
- iIn = *(*int32)(unsafe.Pointer(pLevel + 56 /* &.u */ /* &.in */ /* &.nIn */))
- for j = (nConstraint - 1); j >= 0; j-- {
+
+ if (*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags&U32(WHERE_IN_ABLE) != 0 {
+ iIn = *(*int32)(unsafe.Pointer(pLevel + 56))
+ } else {
+ iIn = 0
+ }
+ for j = nConstraint - 1; j >= 0; j-- {
pTerm = *(*uintptr)(unsafe.Pointer((*WhereLoop)(unsafe.Pointer(pLoop)).FaLTerm + uintptr(j)*4))
- if (int32((*WhereTerm)(unsafe.Pointer(pTerm)).FeOperator) & WO_IN) != 0 {
+ if int32((*WhereTerm)(unsafe.Pointer(pTerm)).FeOperator)&WO_IN != 0 {
iIn--
}
- if (j < 16) && (((int32(*(*U16)(unsafe.Pointer((pLoop + 24 /* &.u */ /* &.vtab */) + 6 /* &.omitMask */))) >> j) & 1) != 0) {
+ if j < 16 && int32(*(*U16)(unsafe.Pointer(pLoop + 24 + 6)))>>j&1 != 0 {
disableTerm(tls, pLevel, pTerm)
- } else if ((int32((*WhereTerm)(unsafe.Pointer(pTerm)).FeOperator) & WO_IN) != 0) &&
- (Xsqlite3ExprVectorSize(tls, (*Expr)(unsafe.Pointer((*WhereTerm)(unsafe.Pointer(pTerm)).FpExpr)).FpLeft) == 1) {
+ } else if int32((*WhereTerm)(unsafe.Pointer(pTerm)).FeOperator)&WO_IN != 0 &&
+ Xsqlite3ExprVectorSize(tls, (*Expr)(unsafe.Pointer((*WhereTerm)(unsafe.Pointer(pTerm)).FpExpr)).FpLeft) == 1 {
var pCompare uintptr // The comparison operator
var pRight uintptr // RHS of the comparison
var pOp uintptr // Opcode to access the value of the IN constraint
@@ -127885,7 +129853,7 @@ func Xsqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI
if !(int32((*Sqlite3)(unsafe.Pointer(db)).FmallocFailed) != 0) {
- pOp = Xsqlite3VdbeGetOp(tls, v, *(*int32)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((pLevel + 56 /* &.u */ /* &.in */) + 4 /* &.aInLoop */)) + uintptr(iIn)*20 + 4 /* &.addrInTop */)))
+ pOp = Xsqlite3VdbeGetOp(tls, v, *(*int32)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pLevel + 56 + 4)) + uintptr(iIn)*20 + 4 /* &.addrInTop */)))
Xsqlite3VdbeAddOp3(tls, v, int32((*VdbeOp)(unsafe.Pointer(pOp)).Fopcode), (*VdbeOp)(unsafe.Pointer(pOp)).Fp1, (*VdbeOp)(unsafe.Pointer(pOp)).Fp2, (*VdbeOp)(unsafe.Pointer(pOp)).Fp3)
}
@@ -127898,7 +129866,7 @@ func Xsqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI
(*Expr)(unsafe.Pointer(pCompare)).FpLeft = (*Expr)(unsafe.Pointer((*WhereTerm)(unsafe.Pointer(pTerm)).FpExpr)).FpLeft
(*Expr)(unsafe.Pointer(pCompare)).FpRight = libc.AssignUintptr(&pRight, Xsqlite3Expr(tls, db, TK_REGISTER, uintptr(0)))
if pRight != 0 {
- (*Expr)(unsafe.Pointer(pRight)).FiTable = ((iReg + j) + 2)
+ (*Expr)(unsafe.Pointer(pRight)).FiTable = iReg + j + 2
Xsqlite3ExprIfFalse(tls,
pParse, pCompare, (*WhereLevel)(unsafe.Pointer(pLevel)).FaddrCont, SQLITE_JUMPIFNULL)
}
@@ -127914,8 +129882,8 @@ func Xsqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI
// simpler and safer to simply not reuse the registers.
//
// sqlite3ReleaseTempRange(pParse, iReg, nConstraint+2);
- } else if (((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & U32(WHERE_IPK)) != U32(0)) &&
- (((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & (U32(WHERE_COLUMN_IN | WHERE_COLUMN_EQ))) != U32(0)) {
+ } else if (*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags&U32(WHERE_IPK) != U32(0) &&
+ (*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags&U32(WHERE_COLUMN_IN|WHERE_COLUMN_EQ) != U32(0) {
// Case 2: We can directly reference a single row using an
// equality comparison against the ROWID field. Or
// we reference multiple rows using a "rowid IN (...)"
@@ -127932,11 +129900,8 @@ func Xsqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI
Xsqlite3VdbeAddOp3(tls, v, OP_SeekRowid, iCur, addrNxt, iRowidReg)
(*WhereLevel)(unsafe.Pointer(pLevel)).Fop = U8(OP_Noop)
- if ((*WhereTerm)(unsafe.Pointer(pTerm)).FprereqAll & (*WhereLevel)(unsafe.Pointer(pLevel)).FnotReady) == uint64(0) {
- *(*U16)(unsafe.Pointer(pTerm + 10 /* &.wtFlags */)) |= U16((TERM_CODED))
- }
- } else if (((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & U32(WHERE_IPK)) != U32(0)) &&
- (((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & U32(WHERE_COLUMN_RANGE)) != U32(0)) {
+ } else if (*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags&U32(WHERE_IPK) != U32(0) &&
+ (*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags&U32(WHERE_COLUMN_RANGE) != U32(0) {
// Case 3: We have an inequality comparison against the ROWID field.
var testOp int32 = OP_Noop
var start int32
@@ -127946,10 +129911,10 @@ func Xsqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI
j = 0
pStart = libc.AssignUintptr(&pEnd, uintptr(0))
- if ((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & U32(WHERE_BTM_LIMIT)) != 0 {
+ if (*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags&U32(WHERE_BTM_LIMIT) != 0 {
pStart = *(*uintptr)(unsafe.Pointer((*WhereLoop)(unsafe.Pointer(pLoop)).FaLTerm + uintptr(libc.PostIncInt32(&j, 1))*4))
}
- if ((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & U32(WHERE_TOP_LIMIT)) != 0 {
+ if (*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags&U32(WHERE_TOP_LIMIT) != 0 {
pEnd = *(*uintptr)(unsafe.Pointer((*WhereLoop)(unsafe.Pointer(pLoop)).FaLTerm + uintptr(libc.PostIncInt32(&j, 1))*4))
}
@@ -127985,12 +129950,12 @@ func Xsqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI
r1 = libc.AssignPtrInt32(bp+12 /* rTemp */, Xsqlite3GetTempReg(tls, pParse))
codeExprOrVector(tls, pParse, (*Expr)(unsafe.Pointer(pX)).FpRight, r1, 1)
- op = int32(*(*U8)(unsafe.Pointer(bp + 8 /* &aMoveOp[0] */ + uintptr(((((int32((*Expr)(unsafe.Pointer(pX)).Fop) - TK_GT) - 1) & 0x3) | 0x1)))))
+ op = int32(*(*U8)(unsafe.Pointer(bp + 8 /* &aMoveOp[0] */ + uintptr((int32((*Expr)(unsafe.Pointer(pX)).Fop)-TK_GT-1)&0x3|0x1))))
} else {
r1 = Xsqlite3ExprCodeTemp(tls, pParse, (*Expr)(unsafe.Pointer(pX)).FpRight, bp+12 /* &rTemp */)
disableTerm(tls, pLevel, pStart)
- op = int32(*(*U8)(unsafe.Pointer(bp + 8 /* &aMoveOp[0] */ + uintptr((int32((*Expr)(unsafe.Pointer(pX)).Fop) - TK_GT)))))
+ op = int32(*(*U8)(unsafe.Pointer(bp + 8 /* &aMoveOp[0] */ + uintptr(int32((*Expr)(unsafe.Pointer(pX)).Fop)-TK_GT))))
}
Xsqlite3VdbeAddOp3(tls, v, op, iCur, addrBrk, r1)
@@ -128012,8 +129977,8 @@ func Xsqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI
memEndValue = libc.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1)
codeExprOrVector(tls, pParse, (*Expr)(unsafe.Pointer(pX)).FpRight, memEndValue, 1)
- if (0 == Xsqlite3ExprIsVector(tls, (*Expr)(unsafe.Pointer(pX)).FpRight)) &&
- ((int32((*Expr)(unsafe.Pointer(pX)).Fop) == TK_LT) || (int32((*Expr)(unsafe.Pointer(pX)).Fop) == TK_GT)) {
+ if 0 == Xsqlite3ExprIsVector(tls, (*Expr)(unsafe.Pointer(pX)).FpRight) &&
+ (int32((*Expr)(unsafe.Pointer(pX)).Fop) == TK_LT || int32((*Expr)(unsafe.Pointer(pX)).Fop) == TK_GT) {
if bRev != 0 {
testOp = OP_Le
} else {
@@ -128045,22 +130010,22 @@ func Xsqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI
Xsqlite3VdbeAddOp2(tls, v, OP_Rowid, iCur, iRowidReg)
Xsqlite3VdbeAddOp3(tls, v, testOp, memEndValue, addrBrk, iRowidReg)
- Xsqlite3VdbeChangeP5(tls, v, (uint16(SQLITE_AFF_NUMERIC | SQLITE_JUMPIFNULL)))
- }
- } else if ((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & U32(WHERE_INDEXED)) != 0 {
- var nEq U16 = *(*U16)(unsafe.Pointer(pLoop + 24 /* &.u */ /* &.btree */ /* &.nEq */)) // Number of == or IN terms
- var nBtm U16 = *(*U16)(unsafe.Pointer(pLoop + 24 /* &.u */ /* &.btree */ + 2 /* &.nBtm */)) // Length of BTM vector
- var nTop U16 = *(*U16)(unsafe.Pointer(pLoop + 24 /* &.u */ /* &.btree */ + 4 /* &.nTop */)) // Length of TOP vector
- var regBase int32 // Base register holding constraint values
- var pRangeStart uintptr = uintptr(0) // Inequality constraint at range start
- var pRangeEnd uintptr = uintptr(0) // Inequality constraint at range end
- var startEq int32 // True if range start uses ==, >= or <=
- var endEq int32 // True if range end uses ==, >= or <=
- var start_constraints int32 // Start of range is constrained
- var nConstraint int32 // Number of constraint terms
- var iIdxCur int32 // The VDBE cursor for the index
- var nExtraReg int32 = 0 // Number of extra registers needed
- var op int32 // Instruction opcode
+ Xsqlite3VdbeChangeP5(tls, v, uint16(SQLITE_AFF_NUMERIC|SQLITE_JUMPIFNULL))
+ }
+ } else if (*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags&U32(WHERE_INDEXED) != 0 {
+ var nEq U16 = *(*U16)(unsafe.Pointer(pLoop + 24)) // Number of == or IN terms
+ var nBtm U16 = *(*U16)(unsafe.Pointer(pLoop + 24 + 2 /* &.nBtm */)) // Length of BTM vector
+ var nTop U16 = *(*U16)(unsafe.Pointer(pLoop + 24 + 4 /* &.nTop */)) // Length of TOP vector
+ var regBase int32 // Base register holding constraint values
+ var pRangeStart uintptr = uintptr(0) // Inequality constraint at range start
+ var pRangeEnd uintptr = uintptr(0) // Inequality constraint at range end
+ var startEq int32 // True if range start uses ==, >= or <=
+ var endEq int32 // True if range end uses ==, >= or <=
+ var start_constraints int32 // Start of range is constrained
+ var nConstraint int32 // Number of constraint terms
+ var iIdxCur int32 // The VDBE cursor for the index
+ var nExtraReg int32 = 0 // Number of extra registers needed
+ var op int32 // Instruction opcode
// var zStartAff uintptr at bp+16, 4
// Affinity for start of range constraint
var zEndAff uintptr = uintptr(0) // Affinity for end of range constraint
@@ -128070,34 +130035,34 @@ func Xsqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI
var regBignull int32 = 0 // big-null flag register
var addrSeekScan int32 = 0 // Opcode of the OP_SeekScan, if any
- pIdx = *(*uintptr)(unsafe.Pointer(pLoop + 24 /* &.u */ /* &.btree */ + 8 /* &.pIndex */))
+ pIdx = *(*uintptr)(unsafe.Pointer(pLoop + 24 + 8 /* &.pIndex */))
iIdxCur = (*WhereLevel)(unsafe.Pointer(pLevel)).FiIdxCur
// Find any inequality constraint terms for the start and end
// of the range.
j = int32(nEq)
- if ((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & U32(WHERE_BTM_LIMIT)) != 0 {
+ if (*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags&U32(WHERE_BTM_LIMIT) != 0 {
pRangeStart = *(*uintptr)(unsafe.Pointer((*WhereLoop)(unsafe.Pointer(pLoop)).FaLTerm + uintptr(libc.PostIncInt32(&j, 1))*4))
nExtraReg = func() int32 {
- if (nExtraReg) > (int32(*(*U16)(unsafe.Pointer(pLoop + 24 /* &.u */ /* &.btree */ + 2 /* &.nBtm */)))) {
+ if nExtraReg > int32(*(*U16)(unsafe.Pointer(pLoop + 24 + 2))) {
return nExtraReg
}
- return int32(*(*U16)(unsafe.Pointer(pLoop + 24 /* &.u */ /* &.btree */ + 2 /* &.nBtm */)))
+ return int32(*(*U16)(unsafe.Pointer(pLoop + 24 + 2)))
}()
// Like optimization range constraints always occur in pairs
}
- if ((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & U32(WHERE_TOP_LIMIT)) != 0 {
+ if (*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags&U32(WHERE_TOP_LIMIT) != 0 {
pRangeEnd = *(*uintptr)(unsafe.Pointer((*WhereLoop)(unsafe.Pointer(pLoop)).FaLTerm + uintptr(libc.PostIncInt32(&j, 1))*4))
nExtraReg = func() int32 {
- if (nExtraReg) > (int32(*(*U16)(unsafe.Pointer(pLoop + 24 /* &.u */ /* &.btree */ + 4 /* &.nTop */)))) {
+ if nExtraReg > int32(*(*U16)(unsafe.Pointer(pLoop + 24 + 4))) {
return nExtraReg
}
- return int32(*(*U16)(unsafe.Pointer(pLoop + 24 /* &.u */ /* &.btree */ + 4 /* &.nTop */)))
+ return int32(*(*U16)(unsafe.Pointer(pLoop + 24 + 4)))
}()
if pRangeStart == uintptr(0) {
j = int32(*(*I16)(unsafe.Pointer((*Index)(unsafe.Pointer(pIdx)).FaiColumn + uintptr(nEq)*2)))
- if ((j >= 0) && (int32((*Column)(unsafe.Pointer((*Table)(unsafe.Pointer((*Index)(unsafe.Pointer(pIdx)).FpTable)).FaCol+uintptr(j)*20)).FnotNull) == 0)) || (j == (-2)) {
+ if j >= 0 && int32(*(*uint8)(unsafe.Pointer((*Table)(unsafe.Pointer((*Index)(unsafe.Pointer(pIdx)).FpTable)).FaCol + uintptr(j)*16 + 4))&0xf>>0) == 0 || j == -2 {
bSeekPastNull = U8(1)
}
}
@@ -128109,8 +130074,8 @@ func Xsqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI
// index entries for which the column is null and for those for which
// it is not. For an ASC sort, the non-NULL entries are scanned first.
// For DESC, NULL entries are scanned first.
- if (((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & (U32(WHERE_TOP_LIMIT | WHERE_BTM_LIMIT))) == U32(0)) &&
- (((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & U32(WHERE_BIGNULL_SORT)) != U32(0)) {
+ if (*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags&U32(WHERE_TOP_LIMIT|WHERE_BTM_LIMIT) == U32(0) &&
+ (*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags&U32(WHERE_BIGNULL_SORT) != U32(0) {
nExtraReg = 1
bSeekPastNull = U8(1)
@@ -128124,7 +130089,7 @@ func Xsqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI
// If we are doing a reverse order scan on an ascending index, or
// a forward order scan on a descending index, interchange the
// start and end terms (pRangeStart and pRangeEnd).
- if (int32(nEq) < int32((*Index)(unsafe.Pointer(pIdx)).FnColumn)) && (bRev == (libc.Bool32(int32(*(*U8)(unsafe.Pointer((*Index)(unsafe.Pointer(pIdx)).FaSortOrder + uintptr(nEq)))) == SQLITE_SO_ASC))) {
+ if int32(nEq) < int32((*Index)(unsafe.Pointer(pIdx)).FnColumn) && bRev == libc.Bool32(int32(*(*U8)(unsafe.Pointer((*Index)(unsafe.Pointer(pIdx)).FaSortOrder + uintptr(nEq)))) == SQLITE_SO_ASC) {
{
var t uintptr = pRangeEnd
pRangeEnd = pRangeStart
@@ -128145,7 +130110,7 @@ func Xsqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI
}
- if (iLevel > 0) && (((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & U32(WHERE_IN_SEEKSCAN)) != U32(0)) {
+ if iLevel > 0 && (*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags&U32(WHERE_IN_SEEKSCAN) != U32(0) {
// In case OP_SeekScan is used, ensure that the index cursor does not
// point to a valid row for the first iteration of this loop.
Xsqlite3VdbeAddOp1(tls, v, OP_NullRow, iIdxCur)
@@ -128157,8 +130122,8 @@ func Xsqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI
regBase = codeAllEqualityTerms(tls, pParse, pLevel, bRev, nExtraReg, bp+16 /* &zStartAff */)
- if (*(*uintptr)(unsafe.Pointer(bp + 16 /* zStartAff */)) != 0) && (nTop != 0) {
- zEndAff = Xsqlite3DbStrDup(tls, db, (*(*uintptr)(unsafe.Pointer(bp + 16 /* zStartAff */)) + uintptr(nEq)))
+ if *(*uintptr)(unsafe.Pointer(bp + 16)) != 0 && nTop != 0 {
+ zEndAff = Xsqlite3DbStrDup(tls, db, *(*uintptr)(unsafe.Pointer(bp + 16))+uintptr(nEq))
}
addrNxt = func() int32 {
if regBignull != 0 {
@@ -128167,25 +130132,25 @@ func Xsqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI
return (*WhereLevel)(unsafe.Pointer(pLevel)).FaddrNxt
}()
- startEq = (libc.Bool32(!(pRangeStart != 0) || ((int32((*WhereTerm)(unsafe.Pointer(pRangeStart)).FeOperator) & ((int32(WO_EQ) << (TK_LE - TK_EQ)) | (int32(WO_EQ) << (TK_GE - TK_EQ)))) != 0)))
- endEq = (libc.Bool32(!(pRangeEnd != 0) || ((int32((*WhereTerm)(unsafe.Pointer(pRangeEnd)).FeOperator) & ((int32(WO_EQ) << (TK_LE - TK_EQ)) | (int32(WO_EQ) << (TK_GE - TK_EQ)))) != 0)))
- start_constraints = (libc.Bool32((pRangeStart != 0) || (int32(nEq) > 0)))
+ startEq = libc.Bool32(!(pRangeStart != 0) || int32((*WhereTerm)(unsafe.Pointer(pRangeStart)).FeOperator)&(int32(WO_EQ)<<(TK_LE-TK_EQ)|int32(WO_EQ)<<(TK_GE-TK_EQ)) != 0)
+ endEq = libc.Bool32(!(pRangeEnd != 0) || int32((*WhereTerm)(unsafe.Pointer(pRangeEnd)).FeOperator)&(int32(WO_EQ)<<(TK_LE-TK_EQ)|int32(WO_EQ)<<(TK_GE-TK_EQ)) != 0)
+ start_constraints = libc.Bool32(pRangeStart != 0 || int32(nEq) > 0)
// Seek the index cursor to the start of the range.
nConstraint = int32(nEq)
if pRangeStart != 0 {
var pRight uintptr = (*Expr)(unsafe.Pointer((*WhereTerm)(unsafe.Pointer(pRangeStart)).FpExpr)).FpRight
- codeExprOrVector(tls, pParse, pRight, (regBase + int32(nEq)), int32(nBtm))
+ codeExprOrVector(tls, pParse, pRight, regBase+int32(nEq), int32(nBtm))
- if ((int32((*WhereTerm)(unsafe.Pointer(pRangeStart)).FwtFlags) & TERM_VNULL) == 0) &&
- (Xsqlite3ExprCanBeNull(tls, pRight) != 0) {
- Xsqlite3VdbeAddOp2(tls, v, OP_IsNull, (regBase + int32(nEq)), addrNxt)
+ if int32((*WhereTerm)(unsafe.Pointer(pRangeStart)).FwtFlags)&TERM_VNULL == 0 &&
+ Xsqlite3ExprCanBeNull(tls, pRight) != 0 {
+ Xsqlite3VdbeAddOp2(tls, v, OP_IsNull, regBase+int32(nEq), addrNxt)
}
- if *(*uintptr)(unsafe.Pointer(bp + 16 /* zStartAff */)) != 0 {
- updateRangeAffinityStr(tls, pRight, int32(nBtm), (*(*uintptr)(unsafe.Pointer(bp + 16 /* zStartAff */)) + uintptr(nEq)))
+ if *(*uintptr)(unsafe.Pointer(bp + 16)) != 0 {
+ updateRangeAffinityStr(tls, pRight, int32(nBtm), *(*uintptr)(unsafe.Pointer(bp + 16))+uintptr(nEq))
}
- nConstraint = nConstraint + (int32(nBtm))
+ nConstraint = nConstraint + int32(nBtm)
if Xsqlite3ExprIsVector(tls, pRight) == 0 {
disableTerm(tls, pLevel, pRangeStart)
@@ -128195,16 +130160,16 @@ func Xsqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI
bSeekPastNull = U8(0)
} else if bSeekPastNull != 0 {
startEq = 0
- Xsqlite3VdbeAddOp2(tls, v, OP_Null, 0, (regBase + int32(nEq)))
+ Xsqlite3VdbeAddOp2(tls, v, OP_Null, 0, regBase+int32(nEq))
start_constraints = 1
nConstraint++
} else if regBignull != 0 {
- Xsqlite3VdbeAddOp2(tls, v, OP_Null, 0, (regBase + int32(nEq)))
+ Xsqlite3VdbeAddOp2(tls, v, OP_Null, 0, regBase+int32(nEq))
start_constraints = 1
nConstraint++
}
- codeApplyAffinity(tls, pParse, regBase, (nConstraint - int32(bSeekPastNull)), *(*uintptr)(unsafe.Pointer(bp + 16 /* zStartAff */)))
- if (int32((*WhereLoop)(unsafe.Pointer(pLoop)).FnSkip) > 0) && (nConstraint == int32((*WhereLoop)(unsafe.Pointer(pLoop)).FnSkip)) {
+ codeApplyAffinity(tls, pParse, regBase, nConstraint-int32(bSeekPastNull), *(*uintptr)(unsafe.Pointer(bp + 16 /* zStartAff */)))
+ if int32((*WhereLoop)(unsafe.Pointer(pLoop)).FnSkip) > 0 && nConstraint == int32((*WhereLoop)(unsafe.Pointer(pLoop)).FnSkip) {
// The skip-scan logic inside the call to codeAllEqualityConstraints()
// above has already left the cursor sitting on the correct row,
// so no further seeking is needed
@@ -128214,9 +130179,9 @@ func Xsqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI
}
- op = int32(aStartOp[(((start_constraints << 2) + (startEq << 1)) + bRev)])
+ op = int32(aStartOp[start_constraints<<2+startEq<<1+bRev])
- if (((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & U32(WHERE_IN_SEEKSCAN)) != U32(0)) && (op == OP_SeekGE) {
+ if (*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags&U32(WHERE_IN_SEEKSCAN) != U32(0) && op == OP_SeekGE {
// TUNING: The OP_SeekScan opcode seeks to reduce the number
// of expensive seek operations by replacing a single seek with
@@ -128227,17 +130192,17 @@ func Xsqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI
// on the estimated number of rows in the btree seems like a good
// guess.
addrSeekScan = Xsqlite3VdbeAddOp1(tls, v, OP_SeekScan,
- ((int32(*(*LogEst)(unsafe.Pointer((*Index)(unsafe.Pointer(pIdx)).FaiRowLogEst))) + 9) / 10))
+ (int32(*(*LogEst)(unsafe.Pointer((*Index)(unsafe.Pointer(pIdx)).FaiRowLogEst)))+9)/10)
}
Xsqlite3VdbeAddOp4Int(tls, v, op, iIdxCur, addrNxt, regBase, nConstraint)
if regBignull != 0 {
- Xsqlite3VdbeAddOp2(tls, v, OP_Goto, 0, (Xsqlite3VdbeCurrentAddr(tls, v) + 2))
- op = int32(aStartOp[((((libc.Bool32(nConstraint > 1)) * 4) + 2) + bRev)])
+ Xsqlite3VdbeAddOp2(tls, v, OP_Goto, 0, Xsqlite3VdbeCurrentAddr(tls, v)+2)
+ op = int32(aStartOp[libc.Bool32(nConstraint > 1)*4+2+bRev])
Xsqlite3VdbeAddOp4Int(tls, v, op, iIdxCur, addrNxt, regBase,
- (nConstraint - startEq))
+ nConstraint-startEq)
}
}
@@ -128245,22 +130210,32 @@ func Xsqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI
// Load the value for the inequality constraint at the end of the
// range (if any).
nConstraint = int32(nEq)
+
if pRangeEnd != 0 {
var pRight uintptr = (*Expr)(unsafe.Pointer((*WhereTerm)(unsafe.Pointer(pRangeEnd)).FpExpr)).FpRight
- codeExprOrVector(tls, pParse, pRight, (regBase + int32(nEq)), int32(nTop))
+ if addrSeekScan != 0 {
+ // For a seek-scan that has a range on the lowest term of the index,
+ // we have to make the top of the loop be code that sets the end
+ // condition of the range. Otherwise, the OP_SeekScan might jump
+ // over that initialization, leaving the range-end value set to the
+ // range-start value, resulting in a wrong answer.
+ // See ticket 5981a8c041a3c2f3 (2021-11-02).
+ (*WhereLevel)(unsafe.Pointer(pLevel)).Fp2 = Xsqlite3VdbeCurrentAddr(tls, v)
+ }
+ codeExprOrVector(tls, pParse, pRight, regBase+int32(nEq), int32(nTop))
- if ((int32((*WhereTerm)(unsafe.Pointer(pRangeEnd)).FwtFlags) & TERM_VNULL) == 0) &&
- (Xsqlite3ExprCanBeNull(tls, pRight) != 0) {
- Xsqlite3VdbeAddOp2(tls, v, OP_IsNull, (regBase + int32(nEq)), addrNxt)
+ if int32((*WhereTerm)(unsafe.Pointer(pRangeEnd)).FwtFlags)&TERM_VNULL == 0 &&
+ Xsqlite3ExprCanBeNull(tls, pRight) != 0 {
+ Xsqlite3VdbeAddOp2(tls, v, OP_IsNull, regBase+int32(nEq), addrNxt)
}
if zEndAff != 0 {
updateRangeAffinityStr(tls, pRight, int32(nTop), zEndAff)
- codeApplyAffinity(tls, pParse, (regBase + int32(nEq)), int32(nTop), zEndAff)
+ codeApplyAffinity(tls, pParse, regBase+int32(nEq), int32(nTop), zEndAff)
} else {
}
- nConstraint = nConstraint + (int32(nTop))
+ nConstraint = nConstraint + int32(nTop)
if Xsqlite3ExprIsVector(tls, pRight) == 0 {
disableTerm(tls, pLevel, pRangeEnd)
@@ -128269,7 +130244,7 @@ func Xsqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI
}
} else if bStopAtNull != 0 {
if regBignull == 0 {
- Xsqlite3VdbeAddOp2(tls, v, OP_Null, 0, (regBase + int32(nEq)))
+ Xsqlite3VdbeAddOp2(tls, v, OP_Null, 0, regBase+int32(nEq))
endEq = 0
}
nConstraint++
@@ -128278,16 +130253,18 @@ func Xsqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI
Xsqlite3DbFree(tls, db, zEndAff)
// Top of the loop body
- (*WhereLevel)(unsafe.Pointer(pLevel)).Fp2 = Xsqlite3VdbeCurrentAddr(tls, v)
+ if (*WhereLevel)(unsafe.Pointer(pLevel)).Fp2 == 0 {
+ (*WhereLevel)(unsafe.Pointer(pLevel)).Fp2 = Xsqlite3VdbeCurrentAddr(tls, v)
+ }
// Check if the index cursor is past the end of the range.
if nConstraint != 0 {
if regBignull != 0 {
// Except, skip the end-of-range check while doing the NULL-scan
- Xsqlite3VdbeAddOp2(tls, v, OP_IfNot, regBignull, (Xsqlite3VdbeCurrentAddr(tls, v) + 3))
+ Xsqlite3VdbeAddOp2(tls, v, OP_IfNot, regBignull, Xsqlite3VdbeCurrentAddr(tls, v)+3)
}
- op = int32(aEndOp[((bRev * 2) + endEq)])
+ op = int32(aEndOp[bRev*2+endEq])
Xsqlite3VdbeAddOp4Int(tls, v, op, iIdxCur, addrNxt, regBase, nConstraint)
if addrSeekScan != 0 {
@@ -128298,31 +130275,31 @@ func Xsqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI
// During a NULL-scan, check to see if we have reached the end of
// the NULLs
- Xsqlite3VdbeAddOp2(tls, v, OP_If, regBignull, (Xsqlite3VdbeCurrentAddr(tls, v) + 2))
+ Xsqlite3VdbeAddOp2(tls, v, OP_If, regBignull, Xsqlite3VdbeCurrentAddr(tls, v)+2)
- op = int32(aEndOp[((bRev * 2) + int32(bSeekPastNull))])
+ op = int32(aEndOp[bRev*2+int32(bSeekPastNull)])
Xsqlite3VdbeAddOp4Int(tls, v, op, iIdxCur, addrNxt, regBase,
- (nConstraint + int32(bSeekPastNull)))
+ nConstraint+int32(bSeekPastNull))
}
- if ((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & U32(WHERE_IN_EARLYOUT)) != U32(0) {
+ if (*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags&U32(WHERE_IN_EARLYOUT) != U32(0) {
Xsqlite3VdbeAddOp3(tls, v, OP_SeekHit, iIdxCur, int32(nEq), int32(nEq))
}
// Seek the table cursor, if required
- omitTable = (libc.Bool32((((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & U32(WHERE_IDX_ONLY)) != U32(0)) &&
- ((int32((*WhereInfo)(unsafe.Pointer(pWInfo)).FwctrlFlags) & WHERE_OR_SUBCLAUSE) == 0)))
+ omitTable = libc.Bool32((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags&U32(WHERE_IDX_ONLY) != U32(0) &&
+ int32((*WhereInfo)(unsafe.Pointer(pWInfo)).FwctrlFlags)&WHERE_OR_SUBCLAUSE == 0)
if omitTable != 0 {
// pIdx is a covering index. No need to access the main table.
- } else if ((*Table)(unsafe.Pointer(((*Index)(unsafe.Pointer(pIdx)).FpTable))).FtabFlags & U32(TF_WithoutRowid)) == U32(0) {
+ } else if (*Table)(unsafe.Pointer((*Index)(unsafe.Pointer(pIdx)).FpTable)).FtabFlags&U32(TF_WithoutRowid) == U32(0) {
codeDeferredSeek(tls, pWInfo, pIdx, iCur, iIdxCur)
} else if iCur != iIdxCur {
var pPk uintptr = Xsqlite3PrimaryKeyIndex(tls, (*Index)(unsafe.Pointer(pIdx)).FpTable)
iRowidReg = Xsqlite3GetTempRange(tls, pParse, int32((*Index)(unsafe.Pointer(pPk)).FnKeyCol))
for j = 0; j < int32((*Index)(unsafe.Pointer(pPk)).FnKeyCol); j++ {
k = int32(Xsqlite3TableColumnToIndex(tls, pIdx, *(*I16)(unsafe.Pointer((*Index)(unsafe.Pointer(pPk)).FaiColumn + uintptr(j)*2))))
- Xsqlite3VdbeAddOp3(tls, v, OP_Column, iIdxCur, k, (iRowidReg + j))
+ Xsqlite3VdbeAddOp3(tls, v, OP_Column, iIdxCur, k, iRowidReg+j)
}
Xsqlite3VdbeAddOp4Int(tls, v, OP_NotFound, iCur, addrCont,
iRowidReg, int32((*Index)(unsafe.Pointer(pPk)).FnKeyCol))
@@ -128345,7 +130322,7 @@ func Xsqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI
// OR clause, since the transformation will become invalid once we
// move forward to the next index.
// https://sqlite.org/src/info/4e8e4857d32d401f
- if (int32((*WhereInfo)(unsafe.Pointer(pWInfo)).FwctrlFlags) & WHERE_OR_SUBCLAUSE) == 0 {
+ if int32((*WhereInfo)(unsafe.Pointer(pWInfo)).FwctrlFlags)&WHERE_OR_SUBCLAUSE == 0 {
whereIndexExprTrans(tls, pIdx, iCur, iIdxCur, pWInfo)
}
@@ -128367,7 +130344,7 @@ func Xsqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI
}
// Record the instruction used to terminate the loop.
- if ((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & U32(WHERE_ONEROW)) != 0 {
+ if (*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags&U32(WHERE_ONEROW) != 0 {
(*WhereLevel)(unsafe.Pointer(pLevel)).Fop = U8(OP_Noop)
} else if bRev != 0 {
(*WhereLevel)(unsafe.Pointer(pLevel)).Fop = U8(OP_Prev)
@@ -128376,12 +130353,12 @@ func Xsqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI
}
(*WhereLevel)(unsafe.Pointer(pLevel)).Fp1 = iIdxCur
(*WhereLevel)(unsafe.Pointer(pLevel)).Fp3 = func() uint8 {
- if ((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & U32(WHERE_UNQ_WANTED)) != U32(0) {
+ if (*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags&U32(WHERE_UNQ_WANTED) != U32(0) {
return uint8(1)
}
return uint8(0)
}()
- if ((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & U32(WHERE_CONSTRAINT)) == U32(0) {
+ if (*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags&U32(WHERE_CONSTRAINT) == U32(0) {
(*WhereLevel)(unsafe.Pointer(pLevel)).Fp5 = U8(SQLITE_STMTSTATUS_FULLSCAN_STEP)
} else {
@@ -128389,7 +130366,7 @@ func Xsqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI
if omitTable != 0 {
pIdx = uintptr(0)
}
- } else if ((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & U32(WHERE_MULTI_OR)) != 0 {
+ } else if (*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags&U32(WHERE_MULTI_OR) != 0 {
// Case 5: Two or more separately indexed terms connected by OR
//
// Example:
@@ -128449,7 +130426,7 @@ func Xsqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI
pTerm = *(*uintptr)(unsafe.Pointer((*WhereLoop)(unsafe.Pointer(pLoop)).FaLTerm))
- pOrWc = (*(*uintptr)(unsafe.Pointer(pTerm + 24 /* &.u */)) /* &.wc */)
+ pOrWc = *(*uintptr)(unsafe.Pointer(pTerm + 24))
(*WhereLevel)(unsafe.Pointer(pLevel)).Fop = U8(OP_Return)
(*WhereLevel)(unsafe.Pointer(pLevel)).Fp1 = regReturn
@@ -128459,17 +130436,17 @@ func Xsqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI
if int32((*WhereInfo)(unsafe.Pointer(pWInfo)).FnLevel) > 1 {
var nNotReady int32 // The number of notReady tables
var origSrc uintptr // Original list of tables
- nNotReady = ((int32((*WhereInfo)(unsafe.Pointer(pWInfo)).FnLevel) - iLevel) - 1)
- pOrTab = Xsqlite3DbMallocRaw(tls, db, (uint64(uint32(unsafe.Sizeof(SrcList{})) + (uint32(nNotReady) * uint32(unsafe.Sizeof(SrcItem{}))))))
+ nNotReady = int32((*WhereInfo)(unsafe.Pointer(pWInfo)).FnLevel) - iLevel - 1
+ pOrTab = Xsqlite3DbMallocRaw(tls, db, uint64(uint32(unsafe.Sizeof(SrcList{}))+uint32(nNotReady)*uint32(unsafe.Sizeof(SrcItem{}))))
if pOrTab == uintptr(0) {
return notReady
}
- (*SrcList)(unsafe.Pointer(pOrTab)).FnAlloc = U32((U8(nNotReady + 1)))
+ (*SrcList)(unsafe.Pointer(pOrTab)).FnAlloc = U32(U8(nNotReady + 1))
(*SrcList)(unsafe.Pointer(pOrTab)).FnSrc = int32((*SrcList)(unsafe.Pointer(pOrTab)).FnAlloc)
- libc.Xmemcpy(tls, pOrTab+8 /* &.a */, pTabItem, uint32(unsafe.Sizeof(SrcItem{})))
+ libc.Xmemcpy(tls, pOrTab+8, pTabItem, uint32(unsafe.Sizeof(SrcItem{})))
origSrc = (*WhereInfo)(unsafe.Pointer(pWInfo)).FpTabList + 8 /* &.a */
for k = 1; k <= nNotReady; k++ {
- libc.Xmemcpy(tls, ((pOrTab + 8 /* &.a */) + uintptr(k)*72), (origSrc + uintptr((*WhereLevel)(unsafe.Pointer(pLevel+uintptr(k)*80)).FiFrom)*72), uint32(unsafe.Sizeof(SrcItem{})))
+ libc.Xmemcpy(tls, pOrTab+8+uintptr(k)*72, origSrc+uintptr((*WhereLevel)(unsafe.Pointer(pLevel+uintptr(k)*80)).FiFrom)*72, uint32(unsafe.Sizeof(SrcItem{})))
}
} else {
pOrTab = (*WhereInfo)(unsafe.Pointer(pWInfo)).FpTabList
@@ -128486,8 +130463,8 @@ func Xsqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI
// correct response for the end-of-loop code (the OP_Return) is to
// fall through to the next instruction, just as an OP_Next does if
// called on an uninitialized cursor.
- if (int32((*WhereInfo)(unsafe.Pointer(pWInfo)).FwctrlFlags) & WHERE_DUPLICATES_OK) == 0 {
- if ((*Table)(unsafe.Pointer((pTab))).FtabFlags & U32(TF_WithoutRowid)) == U32(0) {
+ if int32((*WhereInfo)(unsafe.Pointer(pWInfo)).FwctrlFlags)&WHERE_DUPLICATES_OK == 0 {
+ if (*Table)(unsafe.Pointer(pTab)).FtabFlags&U32(TF_WithoutRowid) == U32(0) {
regRowset = libc.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1)
Xsqlite3VdbeAddOp2(tls, v, OP_Null, 0, regRowset)
} else {
@@ -128517,14 +130494,14 @@ func Xsqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI
var iTerm int32
for iTerm = 0; iTerm < (*WhereClause)(unsafe.Pointer(pWC)).FnTerm; iTerm++ {
var pExpr uintptr = (*WhereTerm)(unsafe.Pointer((*WhereClause)(unsafe.Pointer(pWC)).Fa + uintptr(iTerm)*48)).FpExpr
- if ((*WhereClause)(unsafe.Pointer(pWC)).Fa + uintptr(iTerm)*48) == pTerm {
+ if (*WhereClause)(unsafe.Pointer(pWC)).Fa+uintptr(iTerm)*48 == pTerm {
continue
}
- if (int32((*WhereTerm)(unsafe.Pointer((*WhereClause)(unsafe.Pointer(pWC)).Fa+uintptr(iTerm)*48)).FwtFlags) & (TERM_VIRTUAL | TERM_CODED)) != 0 {
+ if int32((*WhereTerm)(unsafe.Pointer((*WhereClause)(unsafe.Pointer(pWC)).Fa+uintptr(iTerm)*48)).FwtFlags)&(TERM_VIRTUAL|TERM_CODED) != 0 {
continue
}
- if (int32((*WhereTerm)(unsafe.Pointer((*WhereClause)(unsafe.Pointer(pWC)).Fa+uintptr(iTerm)*48)).FeOperator) & WO_ALL) == 0 {
+ if int32((*WhereTerm)(unsafe.Pointer((*WhereClause)(unsafe.Pointer(pWC)).Fa+uintptr(iTerm)*48)).FeOperator)&WO_ALL == 0 {
continue
}
@@ -128537,17 +130514,17 @@ func Xsqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI
// op==TK_AND comparison inside of sqlite3PExpr() false, and this
// prevents sqlite3PExpr() from applying the AND short-circuit
// optimization, which we do not want here.
- pAndExpr = Xsqlite3PExpr(tls, pParse, (TK_AND | 0x10000), uintptr(0), pAndExpr)
+ pAndExpr = Xsqlite3PExpr(tls, pParse, TK_AND|0x10000, uintptr(0), pAndExpr)
}
}
// Run a separate WHERE clause for each term of the OR clause. After
// eliminating duplicates from other WHERE clauses, the action for each
// sub-WHERE clause is to to invoke the main loop body as a subroutine.
- Xsqlite3VdbeExplain(tls, pParse, uint8(1), ts+20097 /* "MULTI-INDEX OR" */, 0)
+ Xsqlite3VdbeExplain(tls, pParse, uint8(1), ts+21394 /* "MULTI-INDEX OR" */, 0)
for ii = 0; ii < (*WhereClause)(unsafe.Pointer(pOrWc)).FnTerm; ii++ {
- var pOrTerm uintptr = ((*WhereClause)(unsafe.Pointer(pOrWc)).Fa + uintptr(ii)*48)
- if ((*WhereTerm)(unsafe.Pointer(pOrTerm)).FleftCursor == iCur) || ((int32((*WhereTerm)(unsafe.Pointer(pOrTerm)).FeOperator) & WO_AND) != 0) {
+ var pOrTerm uintptr = (*WhereClause)(unsafe.Pointer(pOrWc)).Fa + uintptr(ii)*48
+ if (*WhereTerm)(unsafe.Pointer(pOrTerm)).FleftCursor == iCur || int32((*WhereTerm)(unsafe.Pointer(pOrTerm)).FeOperator)&WO_AND != 0 {
var pSubWInfo uintptr // Info for single OR-term scan
var pOrExpr uintptr = (*WhereTerm)(unsafe.Pointer(pOrTerm)).FpExpr // Current OR clause term
var pDelete uintptr // Local copy of OR clause term
@@ -128563,7 +130540,7 @@ func Xsqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI
pOrExpr = pAndExpr
}
// Loop through table entries that match term pOrTerm.
- Xsqlite3VdbeExplain(tls, pParse, uint8(1), ts+20112 /* "INDEX %d" */, libc.VaList(bp, (ii+1)))
+ Xsqlite3VdbeExplain(tls, pParse, uint8(1), ts+21409 /* "INDEX %d" */, libc.VaList(bp, ii+1))
pSubWInfo = Xsqlite3WhereBegin(tls, pParse, pOrTab, pOrExpr, uintptr(0), uintptr(0),
uint16(WHERE_OR_SUBCLAUSE), iCovCur)
@@ -128571,7 +130548,7 @@ func Xsqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI
if pSubWInfo != 0 {
var pSubLoop uintptr
var addrExplain int32 = Xsqlite3WhereExplainOneScan(tls,
- pParse, pOrTab, (pSubWInfo + 752 /* &.a */), uint16(0))
+ pParse, pOrTab, pSubWInfo+752, uint16(0))
_ = addrExplain
_ = addrExplain
@@ -128579,14 +130556,14 @@ func Xsqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI
// duplicate rows from prior sub-WHERE clauses, and record the
// rowid (or PRIMARY KEY) for the current row so that the same
// row will be skipped in subsequent sub-WHERE clauses.
- if (int32((*WhereInfo)(unsafe.Pointer(pWInfo)).FwctrlFlags) & WHERE_DUPLICATES_OK) == 0 {
+ if int32((*WhereInfo)(unsafe.Pointer(pWInfo)).FwctrlFlags)&WHERE_DUPLICATES_OK == 0 {
var iSet int32 = func() int32 {
- if ii == ((*WhereClause)(unsafe.Pointer(pOrWc)).FnTerm - 1) {
+ if ii == (*WhereClause)(unsafe.Pointer(pOrWc)).FnTerm-1 {
return -1
}
return ii
}()
- if ((*Table)(unsafe.Pointer((pTab))).FtabFlags & U32(TF_WithoutRowid)) == U32(0) {
+ if (*Table)(unsafe.Pointer(pTab)).FtabFlags&U32(TF_WithoutRowid) == U32(0) {
Xsqlite3ExprCodeGetColumnOfTable(tls, v, pTab, iCur, -1, regRowid)
jmp1 = Xsqlite3VdbeAddOp4Int(tls, v, OP_RowSetTest, regRowset, 0,
regRowid, iSet)
@@ -128601,7 +130578,7 @@ func Xsqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI
r = Xsqlite3GetTempRange(tls, pParse, nPk)
for iPk = 0; iPk < nPk; iPk++ {
var iCol int32 = int32(*(*I16)(unsafe.Pointer((*Index)(unsafe.Pointer(pPk)).FaiColumn + uintptr(iPk)*2)))
- Xsqlite3ExprCodeGetColumnOfTable(tls, v, pTab, iCur, iCol, (r + iPk))
+ Xsqlite3ExprCodeGetColumnOfTable(tls, v, pTab, iCur, iCol, r+iPk)
}
// Check if the temp table already contains this key. If so,
@@ -128646,7 +130623,7 @@ func Xsqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI
// contained one or more AND term from a notReady table. The
// terms from the notReady table could not be tested and will
// need to be tested later.
- if (uint32(int32(*(*uint8)(unsafe.Pointer(pSubWInfo + 48 /* &.untestedTerms */)) & 0x2 >> 1))) != 0 {
+ if uint32(int32(*(*uint8)(unsafe.Pointer(pSubWInfo + 48))&0x2>>1)) != 0 {
untestedTerms = 1
}
@@ -128661,18 +130638,18 @@ func Xsqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI
// terms, set pCov to the candidate covering index. Otherwise, set
// pCov to NULL to indicate that no candidate covering index will
// be available.
- pSubLoop = (*WhereLevel)(unsafe.Pointer((pSubWInfo + 752 /* &.a */))).FpWLoop
+ pSubLoop = (*WhereLevel)(unsafe.Pointer(pSubWInfo + 752)).FpWLoop
- if ((((*WhereLoop)(unsafe.Pointer(pSubLoop)).FwsFlags & U32(WHERE_INDEXED)) != U32(0)) &&
- ((ii == 0) || (*(*uintptr)(unsafe.Pointer((pSubLoop + 24 /* &.u */ /* &.btree */) + 8 /* &.pIndex */)) == pCov))) &&
- ((((*Table)(unsafe.Pointer((pTab))).FtabFlags & U32(TF_WithoutRowid)) == U32(0)) || !((int32(*(*uint16)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(pSubLoop + 24 /* &.u */ /* &.btree */ + 8 /* &.pIndex */))) + 56 /* &.idxType */)) & 0x3 >> 0)) == SQLITE_IDXTYPE_PRIMARYKEY)) {
+ if (*WhereLoop)(unsafe.Pointer(pSubLoop)).FwsFlags&U32(WHERE_INDEXED) != U32(0) &&
+ (ii == 0 || *(*uintptr)(unsafe.Pointer(pSubLoop + 24 + 8)) == pCov) &&
+ ((*Table)(unsafe.Pointer(pTab)).FtabFlags&U32(TF_WithoutRowid) == U32(0) || !(int32(*(*uint16)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pSubLoop + 24 + 8)) + 56))&0x3>>0) == SQLITE_IDXTYPE_PRIMARYKEY)) {
- pCov = *(*uintptr)(unsafe.Pointer(pSubLoop + 24 /* &.u */ /* &.btree */ + 8 /* &.pIndex */))
+ pCov = *(*uintptr)(unsafe.Pointer(pSubLoop + 24 + 8 /* &.pIndex */))
} else {
pCov = uintptr(0)
}
if Xsqlite3WhereUsesDeferredSeek(tls, pSubWInfo) != 0 {
- libc.SetBitFieldPtr8Uint32(pWInfo+48 /* &.bDeferredSeek */, uint32(1), 0, 0x1)
+ libc.SetBitFieldPtr8Uint32(pWInfo+48, uint32(1), 0, 0x1)
}
// Finish the loop through table entries that match term pOrTerm.
@@ -128683,7 +130660,8 @@ func Xsqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI
}
}
Xsqlite3VdbeExplainPop(tls, pParse)
- *(*uintptr)(unsafe.Pointer(pLevel + 56 /* &.u */)) = pCov
+
+ *(*uintptr)(unsafe.Pointer(pLevel + 56)) = pCov
if pCov != 0 {
(*WhereLevel)(unsafe.Pointer(pLevel)).FiIdxCur = iCovCur
}
@@ -128703,7 +130681,7 @@ func Xsqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI
}
} else {
- if (uint32(int32(*(*uint16)(unsafe.Pointer(pTabItem + 36 /* &.fg */ + 4 /* &.isRecursive */)) & 0x20 >> 5))) != 0 {
+ if uint32(int32(*(*uint16)(unsafe.Pointer(pTabItem + 36 + 4))&0x20>>5)) != 0 {
// Tables marked isRecursive have only a single row that is stored in
// a pseudo-cursor. No need to Rewind or Next such cursors.
(*WhereLevel)(unsafe.Pointer(pLevel)).Fop = U8(OP_Noop)
@@ -128711,7 +130689,7 @@ func Xsqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI
(*WhereLevel)(unsafe.Pointer(pLevel)).Fop = aStep[bRev]
(*WhereLevel)(unsafe.Pointer(pLevel)).Fp1 = iCur
- (*WhereLevel)(unsafe.Pointer(pLevel)).Fp2 = (1 + Xsqlite3VdbeAddOp2(tls, v, int32(aStart[bRev]), iCur, addrHalt))
+ (*WhereLevel)(unsafe.Pointer(pLevel)).Fp2 = 1 + Xsqlite3VdbeAddOp2(tls, v, int32(aStart[bRev]), iCur, addrHalt)
(*WhereLevel)(unsafe.Pointer(pLevel)).Fp5 = U8(SQLITE_STMTSTATUS_FULLSCAN_STEP)
}
@@ -128736,7 +130714,7 @@ func Xsqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI
}
return 2
}()
- for ok := true; ok; ok = (iLoop > 0) {
+ for ok := true; ok; ok = iLoop > 0 {
var iNext int32 = 0 // Next value for iLoop
pTerm = (*WhereClause)(unsafe.Pointer(pWC)).Fa
j = (*WhereClause)(unsafe.Pointer(pWC)).FnTerm
@@ -128748,32 +130726,32 @@ func Xsqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI
var pE uintptr
var skipLikeAddr int32 = 0
- if (int32((*WhereTerm)(unsafe.Pointer(pTerm)).FwtFlags) & (TERM_VIRTUAL | TERM_CODED)) != 0 {
+ if int32((*WhereTerm)(unsafe.Pointer(pTerm)).FwtFlags)&(TERM_VIRTUAL|TERM_CODED) != 0 {
goto __2
}
- if ((*WhereTerm)(unsafe.Pointer(pTerm)).FprereqAll & (*WhereLevel)(unsafe.Pointer(pLevel)).FnotReady) != uint64(0) {
+ if (*WhereTerm)(unsafe.Pointer(pTerm)).FprereqAll&(*WhereLevel)(unsafe.Pointer(pLevel)).FnotReady != uint64(0) {
- libc.SetBitFieldPtr8Uint32(pWInfo+48 /* &.untestedTerms */, uint32(1), 1, 0x2)
+ libc.SetBitFieldPtr8Uint32(pWInfo+48, uint32(1), 1, 0x2)
goto __2
}
pE = (*WhereTerm)(unsafe.Pointer(pTerm)).FpExpr
- if ((int32((*SrcItem)(unsafe.Pointer(pTabItem)).Ffg.Fjointype) & JT_LEFT) != 0) && !(((*Expr)(unsafe.Pointer((pE))).Fflags & (U32(EP_FromJoin))) != U32(0)) {
+ if int32((*SrcItem)(unsafe.Pointer(pTabItem)).Ffg.Fjointype)&JT_LEFT != 0 && !((*Expr)(unsafe.Pointer(pE)).Fflags&U32(EP_FromJoin) != U32(0)) {
goto __2
}
- if (iLoop == 1) && !(Xsqlite3ExprCoveredByIndex(tls, pE, (*WhereLevel)(unsafe.Pointer(pLevel)).FiTabCur, pIdx) != 0) {
+ if iLoop == 1 && !(Xsqlite3ExprCoveredByIndex(tls, pE, (*WhereLevel)(unsafe.Pointer(pLevel)).FiTabCur, pIdx) != 0) {
iNext = 2
goto __2
}
- if (iLoop < 3) && ((int32((*WhereTerm)(unsafe.Pointer(pTerm)).FwtFlags) & TERM_VARSELECT) != 0) {
+ if iLoop < 3 && int32((*WhereTerm)(unsafe.Pointer(pTerm)).FwtFlags)&TERM_VARSELECT != 0 {
if iNext == 0 {
iNext = 3
}
goto __2
}
- if (int32((*WhereTerm)(unsafe.Pointer(pTerm)).FwtFlags) & TERM_LIKECOND) != 0 {
+ if int32((*WhereTerm)(unsafe.Pointer(pTerm)).FwtFlags)&TERM_LIKECOND != 0 {
// If the TERM_LIKECOND flag is set, that means that the range search
// is sufficient to guarantee that the LIKE operator is true, so we
// can skip the call to the like(A,B) function. But this only works
@@ -128785,7 +130763,7 @@ func Xsqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI
if skipLikeAddr != 0 {
Xsqlite3VdbeJumpHere(tls, v, skipLikeAddr)
}
- *(*U16)(unsafe.Pointer(pTerm + 10 /* &.wtFlags */)) |= U16((TERM_CODED))
+ *(*U16)(unsafe.Pointer(pTerm + 10)) |= U16(TERM_CODED)
}
goto __2
@@ -128817,41 +130795,41 @@ __4:
// var sEAlt Expr at bp+20, 52
var pAlt uintptr
- if (int32((*WhereTerm)(unsafe.Pointer(pTerm)).FwtFlags) & (TERM_VIRTUAL | TERM_CODED)) != 0 {
+ if int32((*WhereTerm)(unsafe.Pointer(pTerm)).FwtFlags)&(TERM_VIRTUAL|TERM_CODED) != 0 {
goto __5
}
- if (int32((*WhereTerm)(unsafe.Pointer(pTerm)).FeOperator) & (WO_EQ | WO_IS)) == 0 {
+ if int32((*WhereTerm)(unsafe.Pointer(pTerm)).FeOperator)&(WO_EQ|WO_IS) == 0 {
goto __5
}
- if (int32((*WhereTerm)(unsafe.Pointer(pTerm)).FeOperator) & WO_EQUIV) == 0 {
+ if int32((*WhereTerm)(unsafe.Pointer(pTerm)).FeOperator)&WO_EQUIV == 0 {
goto __5
}
if (*WhereTerm)(unsafe.Pointer(pTerm)).FleftCursor != iCur {
goto __5
}
- if (int32((*SrcItem)(unsafe.Pointer(pTabItem)).Ffg.Fjointype) & JT_LEFT) != 0 {
+ if int32((*SrcItem)(unsafe.Pointer(pTabItem)).Ffg.Fjointype)&JT_LEFT != 0 {
goto __5
}
pE = (*WhereTerm)(unsafe.Pointer(pTerm)).FpExpr
- pAlt = Xsqlite3WhereFindTerm(tls, pWC, iCur, *(*int32)(unsafe.Pointer(pTerm + 24 /* &.u */ /* &.x */ /* &.leftColumn */)), notReady,
- (uint32((WO_EQ | WO_IN) | WO_IS)), uintptr(0))
+ pAlt = Xsqlite3WhereFindTerm(tls, pWC, iCur, *(*int32)(unsafe.Pointer(pTerm + 24)), notReady,
+ uint32(WO_EQ|WO_IN|WO_IS), uintptr(0))
if pAlt == uintptr(0) {
goto __5
}
- if (int32((*WhereTerm)(unsafe.Pointer(pAlt)).FwtFlags) & (TERM_CODED)) != 0 {
+ if int32((*WhereTerm)(unsafe.Pointer(pAlt)).FwtFlags)&TERM_CODED != 0 {
goto __5
}
- if (((int32((*WhereTerm)(unsafe.Pointer(pAlt)).FeOperator) & WO_IN) != 0) &&
- (((*Expr)(unsafe.Pointer((*WhereTerm)(unsafe.Pointer(pAlt)).FpExpr)).Fflags & U32(EP_xIsSelect)) != 0)) &&
- ((*ExprList)(unsafe.Pointer((*Select)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((*WhereTerm)(unsafe.Pointer(pAlt)).FpExpr + 20 /* &.x */)))).FpEList)).FnExpr > 1) {
+ if int32((*WhereTerm)(unsafe.Pointer(pAlt)).FeOperator)&WO_IN != 0 &&
+ (*Expr)(unsafe.Pointer((*WhereTerm)(unsafe.Pointer(pAlt)).FpExpr)).Fflags&U32(EP_xIsSelect) != U32(0) &&
+ (*ExprList)(unsafe.Pointer((*Select)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((*WhereTerm)(unsafe.Pointer(pAlt)).FpExpr + 20)))).FpEList)).FnExpr > 1 {
goto __5
}
*(*Expr)(unsafe.Pointer(bp + 20 /* sEAlt */)) = *(*Expr)(unsafe.Pointer((*WhereTerm)(unsafe.Pointer(pAlt)).FpExpr))
(*Expr)(unsafe.Pointer(bp + 20 /* &sEAlt */)).FpLeft = (*Expr)(unsafe.Pointer(pE)).FpLeft
Xsqlite3ExprIfFalse(tls, pParse, bp+20 /* &sEAlt */, addrCont, SQLITE_JUMPIFNULL)
- *(*U16)(unsafe.Pointer(pAlt + 10 /* &.wtFlags */)) |= U16((TERM_CODED))
+ *(*U16)(unsafe.Pointer(pAlt + 10)) |= U16(TERM_CODED)
}
goto __5
@@ -128877,16 +130855,16 @@ __6:
}
{
- if (int32((*WhereTerm)(unsafe.Pointer(pTerm)).FwtFlags) & (TERM_VIRTUAL | TERM_CODED)) != 0 {
+ if int32((*WhereTerm)(unsafe.Pointer(pTerm)).FwtFlags)&(TERM_VIRTUAL|TERM_CODED) != 0 {
goto __8
}
- if ((*WhereTerm)(unsafe.Pointer(pTerm)).FprereqAll & (*WhereLevel)(unsafe.Pointer(pLevel)).FnotReady) != uint64(0) {
+ if (*WhereTerm)(unsafe.Pointer(pTerm)).FprereqAll&(*WhereLevel)(unsafe.Pointer(pLevel)).FnotReady != uint64(0) {
goto __8
}
Xsqlite3ExprIfFalse(tls, pParse, (*WhereTerm)(unsafe.Pointer(pTerm)).FpExpr, addrCont, SQLITE_JUMPIFNULL)
- *(*U16)(unsafe.Pointer(pTerm + 10 /* &.wtFlags */)) |= U16((TERM_CODED))
+ *(*U16)(unsafe.Pointer(pTerm + 10)) |= U16(TERM_CODED)
}
goto __8
@@ -128910,25 +130888,25 @@ var aStartOp = [8]U8{
U8(OP_SeekLT), // 5: (start_constraints && !startEq && bRev)
U8(OP_SeekGE), // 6: (start_constraints && startEq && !bRev)
U8(OP_SeekLE), // 7: (start_constraints && startEq && bRev)
-} /* sqlite3.c:146729:21 */
+} /* sqlite3.c:148055:21 */
var aEndOp = [4]U8{
U8(OP_IdxGE), // 0: (end_constraints && !bRev && !endEq)
U8(OP_IdxGT), // 1: (end_constraints && !bRev && endEq)
U8(OP_IdxLE), // 2: (end_constraints && bRev && !endEq)
U8(OP_IdxLT), // 3: (end_constraints && bRev && endEq)
-} /* sqlite3.c:146739:21 */
-var aStep = [2]U8{U8(OP_Next), U8(OP_Prev)} /* sqlite3.c:147420:21 */
-var aStart = [2]U8{U8(OP_Rewind), U8(OP_Last)} /* sqlite3.c:147421:21 */
+} /* sqlite3.c:148065:21 */
+var aStep = [2]U8{U8(OP_Next), U8(OP_Prev)} /* sqlite3.c:148760:21 */
+var aStart = [2]U8{U8(OP_Rewind), U8(OP_Last)} /* sqlite3.c:148761:21 */
// Deallocate all memory associated with a WhereOrInfo object.
-func whereOrInfoDelete(tls *libc.TLS, db uintptr, p uintptr) { /* sqlite3.c:147629:13: */
- Xsqlite3WhereClauseClear(tls, (p /* &.wc */))
+func whereOrInfoDelete(tls *libc.TLS, db uintptr, p uintptr) { /* sqlite3.c:148970:13: */
+ Xsqlite3WhereClauseClear(tls, p)
Xsqlite3DbFree(tls, db, p)
}
// Deallocate all memory associated with a WhereAndInfo object.
-func whereAndInfoDelete(tls *libc.TLS, db uintptr, p uintptr) { /* sqlite3.c:147637:13: */
- Xsqlite3WhereClauseClear(tls, (p /* &.wc */))
+func whereAndInfoDelete(tls *libc.TLS, db uintptr, p uintptr) { /* sqlite3.c:148978:13: */
+ Xsqlite3WhereClauseClear(tls, p)
Xsqlite3DbFree(tls, db, p)
}
@@ -128949,30 +130927,30 @@ func whereAndInfoDelete(tls *libc.TLS, db uintptr, p uintptr) { /* sqlite3.c:147
// WhereTerms. All pointers to WhereTerms should be invalidated after
// calling this routine. Such pointers may be reinitialized by referencing
// the pWC->a[] array.
-func whereClauseInsert(tls *libc.TLS, pWC uintptr, p uintptr, wtFlags U16) int32 { /* sqlite3.c:147661:12: */
+func whereClauseInsert(tls *libc.TLS, pWC uintptr, p uintptr, wtFlags U16) int32 { /* sqlite3.c:149002:12: */
var pTerm uintptr
var idx int32
if (*WhereClause)(unsafe.Pointer(pWC)).FnTerm >= (*WhereClause)(unsafe.Pointer(pWC)).FnSlot {
var pOld uintptr = (*WhereClause)(unsafe.Pointer(pWC)).Fa
var db uintptr = (*Parse)(unsafe.Pointer((*WhereInfo)(unsafe.Pointer((*WhereClause)(unsafe.Pointer(pWC)).FpWInfo)).FpParse)).Fdb
- (*WhereClause)(unsafe.Pointer(pWC)).Fa = Xsqlite3DbMallocRawNN(tls, db, (uint64((uint32(unsafe.Sizeof(WhereTerm{})) * uint32((*WhereClause)(unsafe.Pointer(pWC)).FnSlot)) * uint32(2))))
+ (*WhereClause)(unsafe.Pointer(pWC)).Fa = Xsqlite3DbMallocRawNN(tls, db, uint64(uint32(unsafe.Sizeof(WhereTerm{}))*uint32((*WhereClause)(unsafe.Pointer(pWC)).FnSlot)*uint32(2)))
if (*WhereClause)(unsafe.Pointer(pWC)).Fa == uintptr(0) {
- if (int32(wtFlags) & TERM_DYNAMIC) != 0 {
+ if int32(wtFlags)&TERM_DYNAMIC != 0 {
Xsqlite3ExprDelete(tls, db, p)
}
(*WhereClause)(unsafe.Pointer(pWC)).Fa = pOld
return 0
}
- libc.Xmemcpy(tls, (*WhereClause)(unsafe.Pointer(pWC)).Fa, pOld, (uint32(unsafe.Sizeof(WhereTerm{})) * uint32((*WhereClause)(unsafe.Pointer(pWC)).FnTerm)))
- if pOld != pWC+24 /* &.aStatic */ {
+ libc.Xmemcpy(tls, (*WhereClause)(unsafe.Pointer(pWC)).Fa, pOld, uint32(unsafe.Sizeof(WhereTerm{}))*uint32((*WhereClause)(unsafe.Pointer(pWC)).FnTerm))
+ if pOld != pWC+24 {
Xsqlite3DbFree(tls, db, pOld)
}
- (*WhereClause)(unsafe.Pointer(pWC)).FnSlot = (int32(uint32(Xsqlite3DbMallocSize(tls, db, (*WhereClause)(unsafe.Pointer(pWC)).Fa)) / uint32(unsafe.Sizeof(WhereTerm{}))))
+ (*WhereClause)(unsafe.Pointer(pWC)).FnSlot = int32(uint32(Xsqlite3DbMallocSize(tls, db, (*WhereClause)(unsafe.Pointer(pWC)).Fa)) / uint32(unsafe.Sizeof(WhereTerm{})))
}
- pTerm = ((*WhereClause)(unsafe.Pointer(pWC)).Fa + uintptr(libc.AssignInt32(&idx, libc.PostIncInt32(&(*WhereClause)(unsafe.Pointer(pWC)).FnTerm, 1)))*48)
- if (p != 0) && (((*Expr)(unsafe.Pointer((p))).Fflags & (U32(EP_Unlikely))) != U32(0)) {
- (*WhereTerm)(unsafe.Pointer(pTerm)).FtruthProb = (LogEst(int32(Xsqlite3LogEst(tls, uint64((*Expr)(unsafe.Pointer(p)).FiTable))) - 270))
+ pTerm = (*WhereClause)(unsafe.Pointer(pWC)).Fa + uintptr(libc.AssignInt32(&idx, libc.PostIncInt32(&(*WhereClause)(unsafe.Pointer(pWC)).FnTerm, 1)))*48
+ if p != 0 && (*Expr)(unsafe.Pointer(p)).Fflags&U32(EP_Unlikely) != U32(0) {
+ (*WhereTerm)(unsafe.Pointer(pTerm)).FtruthProb = LogEst(int32(Xsqlite3LogEst(tls, uint64((*Expr)(unsafe.Pointer(p)).FiTable))) - 270)
} else {
(*WhereTerm)(unsafe.Pointer(pTerm)).FtruthProb = int16(1)
}
@@ -128980,26 +130958,26 @@ func whereClauseInsert(tls *libc.TLS, pWC uintptr, p uintptr, wtFlags U16) int32
(*WhereTerm)(unsafe.Pointer(pTerm)).FwtFlags = wtFlags
(*WhereTerm)(unsafe.Pointer(pTerm)).FpWC = pWC
(*WhereTerm)(unsafe.Pointer(pTerm)).FiParent = -1
- libc.Xmemset(tls, (pTerm + 12 /* &.eOperator */), 0,
- (uint32(unsafe.Sizeof(WhereTerm{})) - (uint32((uintptr(0) + 12 /* &.eOperator */)))))
+ libc.Xmemset(tls, pTerm+12, 0,
+ uint32(unsafe.Sizeof(WhereTerm{}))-uint32(uintptr(0)+12))
return idx
}
// Return TRUE if the given operator is one of the operators that is
// allowed for an indexable WHERE clause term. The allowed operators are
// "=", "<", ">", "<=", ">=", "IN", "IS", and "IS NULL"
-func allowedOp(tls *libc.TLS, op int32) int32 { /* sqlite3.c:147702:12: */
+func allowedOp(tls *libc.TLS, op int32) int32 { /* sqlite3.c:149043:12: */
- return (libc.Bool32((((op == TK_IN) || ((op >= TK_EQ) && (op <= TK_GE))) || (op == TK_ISNULL)) || (op == TK_IS)))
+ return libc.Bool32(op == TK_IN || op >= TK_EQ && op <= TK_GE || op == TK_ISNULL || op == TK_IS)
}
// Commute a comparison operator. Expressions of the form "X op Y"
// are converted into "Y op X".
-func exprCommute(tls *libc.TLS, pParse uintptr, pExpr uintptr) U16 { /* sqlite3.c:147714:12: */
- if ((int32((*Expr)(unsafe.Pointer((*Expr)(unsafe.Pointer(pExpr)).FpLeft)).Fop) == TK_VECTOR) ||
- (int32((*Expr)(unsafe.Pointer((*Expr)(unsafe.Pointer(pExpr)).FpRight)).Fop) == TK_VECTOR)) ||
- (Xsqlite3BinaryCompareCollSeq(tls, pParse, (*Expr)(unsafe.Pointer(pExpr)).FpLeft, (*Expr)(unsafe.Pointer(pExpr)).FpRight) != Xsqlite3BinaryCompareCollSeq(tls, pParse, (*Expr)(unsafe.Pointer(pExpr)).FpRight, (*Expr)(unsafe.Pointer(pExpr)).FpLeft)) {
- *(*U32)(unsafe.Pointer(pExpr + 4 /* &.flags */)) ^= (U32(EP_Commuted))
+func exprCommute(tls *libc.TLS, pParse uintptr, pExpr uintptr) U16 { /* sqlite3.c:149055:12: */
+ if int32((*Expr)(unsafe.Pointer((*Expr)(unsafe.Pointer(pExpr)).FpLeft)).Fop) == TK_VECTOR ||
+ int32((*Expr)(unsafe.Pointer((*Expr)(unsafe.Pointer(pExpr)).FpRight)).Fop) == TK_VECTOR ||
+ Xsqlite3BinaryCompareCollSeq(tls, pParse, (*Expr)(unsafe.Pointer(pExpr)).FpLeft, (*Expr)(unsafe.Pointer(pExpr)).FpRight) != Xsqlite3BinaryCompareCollSeq(tls, pParse, (*Expr)(unsafe.Pointer(pExpr)).FpRight, (*Expr)(unsafe.Pointer(pExpr)).FpLeft) {
+ *(*U32)(unsafe.Pointer(pExpr + 4)) ^= U32(EP_Commuted)
}
{
var t uintptr = (*Expr)(unsafe.Pointer(pExpr)).FpRight
@@ -129009,13 +130987,13 @@ func exprCommute(tls *libc.TLS, pParse uintptr, pExpr uintptr) U16 { /* sqlite3.
if int32((*Expr)(unsafe.Pointer(pExpr)).Fop) >= TK_GT {
- (*Expr)(unsafe.Pointer(pExpr)).Fop = (U8(((int32((*Expr)(unsafe.Pointer(pExpr)).Fop) - TK_GT) ^ 2) + TK_GT))
+ (*Expr)(unsafe.Pointer(pExpr)).Fop = U8(int32((*Expr)(unsafe.Pointer(pExpr)).Fop) - TK_GT ^ 2 + TK_GT)
}
return U16(0)
}
// Translate from TK_xx operator to WO_xx bitmask.
-func operatorMask(tls *libc.TLS, op int32) U16 { /* sqlite3.c:147737:12: */
+func operatorMask(tls *libc.TLS, op int32) U16 { /* sqlite3.c:149078:12: */
var c U16
if op == TK_IN {
@@ -129026,7 +131004,7 @@ func operatorMask(tls *libc.TLS, op int32) U16 { /* sqlite3.c:147737:12: */
c = U16(WO_IS)
} else {
- c = (U16(int32(WO_EQ) << (op - TK_EQ)))
+ c = U16(int32(WO_EQ) << (op - TK_EQ))
}
return c
@@ -129042,7 +131020,7 @@ func operatorMask(tls *libc.TLS, op int32) U16 { /* sqlite3.c:147737:12: */
// that virtual tables cannot participate in the LIKE optimization.) The
// collating sequence for the column on the LHS must be appropriate for
// the operator.
-func isLikeOrGlob(tls *libc.TLS, pParse uintptr, pExpr uintptr, ppPrefix uintptr, pisComplete uintptr, pnoCase uintptr) int32 { /* sqlite3.c:147775:12: */
+func isLikeOrGlob(tls *libc.TLS, pParse uintptr, pExpr uintptr, ppPrefix uintptr, pisComplete uintptr, pnoCase uintptr) int32 { /* sqlite3.c:149116:12: */
bp := tls.Alloc(16)
defer tls.Free(16)
@@ -129059,33 +131037,35 @@ func isLikeOrGlob(tls *libc.TLS, pParse uintptr, pExpr uintptr, ppPrefix uintptr
var op int32 // Opcode of pRight
var rc int32 // Result code to return
- if !(Xsqlite3IsLikeFunction(tls, db, pExpr, pnoCase, bp /* wc */) != 0) {
+ if !(Xsqlite3IsLikeFunction(tls, db, pExpr, pnoCase, bp) != 0) {
return 0
}
- pList = *(*uintptr)(unsafe.Pointer(pExpr + 20 /* &.x */))
- pLeft = (*ExprList_item)(unsafe.Pointer((pList + 8 /* &.a */) + 1*20)).FpExpr
- pRight = Xsqlite3ExprSkipCollate(tls, (*ExprList_item)(unsafe.Pointer((pList + 8 /* &.a */))).FpExpr)
+ pList = *(*uintptr)(unsafe.Pointer(pExpr + 20))
+ pLeft = (*ExprList_item)(unsafe.Pointer(pList + 8 + 1*20)).FpExpr
+
+ pRight = Xsqlite3ExprSkipCollate(tls, (*ExprList_item)(unsafe.Pointer(pList+8)).FpExpr)
op = int32((*Expr)(unsafe.Pointer(pRight)).Fop)
- if (op == TK_VARIABLE) && (((*Sqlite3)(unsafe.Pointer(db)).Fflags & uint64(SQLITE_EnableQPSG)) == uint64(0)) {
+ if op == TK_VARIABLE && (*Sqlite3)(unsafe.Pointer(db)).Fflags&uint64(SQLITE_EnableQPSG) == uint64(0) {
var pReprepare uintptr = (*Parse)(unsafe.Pointer(pParse)).FpReprepare
var iCol int32 = int32((*Expr)(unsafe.Pointer(pRight)).FiColumn)
pVal = Xsqlite3VdbeGetBoundValue(tls, pReprepare, iCol, uint8(SQLITE_AFF_BLOB))
- if (pVal != 0) && (Xsqlite3_value_type(tls, pVal) == SQLITE_TEXT) {
+ if pVal != 0 && Xsqlite3_value_type(tls, pVal) == SQLITE_TEXT {
z = Xsqlite3_value_text(tls, pVal)
}
Xsqlite3VdbeSetVarmask(tls, (*Parse)(unsafe.Pointer(pParse)).FpVdbe, iCol)
} else if op == TK_STRING {
- z = *(*uintptr)(unsafe.Pointer(pRight + 8 /* &.u */))
+
+ z = *(*uintptr)(unsafe.Pointer(pRight + 8))
}
if z != 0 {
// Count the number of prefix characters prior to the first wildcard
cnt = 0
- for ((((int32(libc.AssignUint8(&c, *(*U8)(unsafe.Pointer(z + uintptr(cnt)))))) != 0) && (int32(c) != int32(*(*U8)(unsafe.Pointer(bp /* &wc[0] */))))) && (int32(c) != int32(*(*U8)(unsafe.Pointer(bp /* &wc[0] */ + 1))))) && (int32(c) != int32(*(*U8)(unsafe.Pointer(bp /* &wc[0] */ + 2)))) {
+ for int32(libc.AssignUint8(&c, *(*U8)(unsafe.Pointer(z + uintptr(cnt))))) != 0 && int32(c) != int32(*(*U8)(unsafe.Pointer(bp))) && int32(c) != int32(*(*U8)(unsafe.Pointer(bp + 1))) && int32(c) != int32(*(*U8)(unsafe.Pointer(bp + 2))) {
cnt++
- if (int32(c) == int32(*(*U8)(unsafe.Pointer(bp /* &wc[0] */ + 3)))) && (int32(*(*U8)(unsafe.Pointer(z + uintptr(cnt)))) != 0) {
+ if int32(c) == int32(*(*U8)(unsafe.Pointer(bp + 3))) && int32(*(*U8)(unsafe.Pointer(z + uintptr(cnt)))) != 0 {
cnt++
}
}
@@ -129098,21 +131078,23 @@ func isLikeOrGlob(tls *libc.TLS, pParse uintptr, pExpr uintptr, ppPrefix uintptr
// range search. The third is because the caller assumes that the pattern
// consists of at least one character after all escapes have been
// removed.
- if ((cnt != 0) && (255 != int32(*(*U8)(unsafe.Pointer(z + uintptr((cnt - 1))))))) && ((cnt > 1) || (int32(*(*U8)(unsafe.Pointer(z))) != int32(*(*U8)(unsafe.Pointer(bp /* &wc[0] */ + 3))))) {
+ if cnt != 0 && 255 != int32(*(*U8)(unsafe.Pointer(z + uintptr(cnt-1)))) && (cnt > 1 || int32(*(*U8)(unsafe.Pointer(z))) != int32(*(*U8)(unsafe.Pointer(bp + 3)))) {
var pPrefix uintptr
// A "complete" match if the pattern ends with "*" or "%"
- *(*int32)(unsafe.Pointer(pisComplete)) = (libc.Bool32((int32(c) == int32(*(*U8)(unsafe.Pointer(bp /* &wc[0] */)))) && (int32(*(*U8)(unsafe.Pointer(z + uintptr((cnt + 1))))) == 0)))
+ *(*int32)(unsafe.Pointer(pisComplete)) = libc.Bool32(int32(c) == int32(*(*U8)(unsafe.Pointer(bp))) && int32(*(*U8)(unsafe.Pointer(z + uintptr(cnt+1)))) == 0)
// Get the pattern prefix. Remove all escapes from the prefix.
pPrefix = Xsqlite3Expr(tls, db, TK_STRING, z)
if pPrefix != 0 {
var iFrom int32
var iTo int32
- var zNew uintptr = *(*uintptr)(unsafe.Pointer(pPrefix + 8 /* &.u */))
+ var zNew uintptr
+
+ zNew = *(*uintptr)(unsafe.Pointer(pPrefix + 8))
*(*uint8)(unsafe.Pointer(zNew + uintptr(cnt))) = uint8(0)
for iFrom = libc.AssignInt32(&iTo, 0); iFrom < cnt; iFrom++ {
- if int32(*(*uint8)(unsafe.Pointer(zNew + uintptr(iFrom)))) == int32(*(*U8)(unsafe.Pointer(bp /* &wc[0] */ + 3))) {
+ if int32(*(*uint8)(unsafe.Pointer(zNew + uintptr(iFrom)))) == int32(*(*U8)(unsafe.Pointer(bp + 3))) {
iFrom++
}
*(*uint8)(unsafe.Pointer(zNew + uintptr(libc.PostIncInt32(&iTo, 1)))) = *(*uint8)(unsafe.Pointer(zNew + uintptr(iFrom)))
@@ -129131,20 +131113,22 @@ func isLikeOrGlob(tls *libc.TLS, pParse uintptr, pExpr uintptr, ppPrefix uintptr
// 2019-06-10 https://sqlite.org/src/info/fd76310a5e843e07
// 2019-06-14 https://sqlite.org/src/info/ce8717f0885af975
// 2019-09-03 https://sqlite.org/src/info/0f0428096f17252a
- if ((int32((*Expr)(unsafe.Pointer(pLeft)).Fop) != TK_COLUMN) ||
- (int32(Xsqlite3ExprAffinity(tls, pLeft)) != SQLITE_AFF_TEXT)) ||
- ((*Table)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pLeft + 44 /* &.y */)))).FnModuleArg != 0) {
+ if int32((*Expr)(unsafe.Pointer(pLeft)).Fop) != TK_COLUMN ||
+ int32(Xsqlite3ExprAffinity(tls, pLeft)) != SQLITE_AFF_TEXT ||
+ (*Expr)(unsafe.Pointer(pLeft)).Fflags&U32(EP_WinFunc|EP_Subrtn) == U32(0) &&
+ *(*uintptr)(unsafe.Pointer(pLeft + 44)) != 0 &&
+ int32((*Table)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pLeft + 44)))).FeTabType) == TABTYP_VTAB {
var isNum int32
// var rDummy float64 at bp+8, 8
isNum = Xsqlite3AtoF(tls, zNew, bp+8 /* &rDummy */, iTo, uint8(SQLITE_UTF8))
if isNum <= 0 {
- if (iTo == 1) && (int32(*(*uint8)(unsafe.Pointer(zNew))) == '-') {
+ if iTo == 1 && int32(*(*uint8)(unsafe.Pointer(zNew))) == '-' {
isNum = +1
} else {
- *(*uint8)(unsafe.Pointer(zNew + uintptr((iTo - 1))))++
+ *(*uint8)(unsafe.Pointer(zNew + uintptr(iTo-1)))++
isNum = Xsqlite3AtoF(tls, zNew, bp+8 /* &rDummy */, iTo, uint8(SQLITE_UTF8))
- *(*uint8)(unsafe.Pointer(zNew + uintptr((iTo - 1))))--
+ *(*uint8)(unsafe.Pointer(zNew + uintptr(iTo-1)))--
}
}
if isNum > 0 {
@@ -129161,7 +131145,8 @@ func isLikeOrGlob(tls *libc.TLS, pParse uintptr, pExpr uintptr, ppPrefix uintptr
if op == TK_VARIABLE {
var v uintptr = (*Parse)(unsafe.Pointer(pParse)).FpVdbe
Xsqlite3VdbeSetVarmask(tls, v, int32((*Expr)(unsafe.Pointer(pRight)).FiColumn))
- if (*(*int32)(unsafe.Pointer(pisComplete)) != 0) && (*(*uint8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pRight + 8 /* &.u */)) + 1)) != 0) {
+
+ if *(*int32)(unsafe.Pointer(pisComplete)) != 0 && *(*uint8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pRight + 8)) + 1)) != 0 {
// If the rhs of the LIKE expression is a variable, and the current
// value of the variable means there is no need to invoke the LIKE
// function, then no OP_Variable will be added to the program.
@@ -129169,7 +131154,7 @@ func isLikeOrGlob(tls *libc.TLS, pParse uintptr, pExpr uintptr, ppPrefix uintptr
// API. To work around them, add a dummy OP_Variable here.
var r1 int32 = Xsqlite3GetTempReg(tls, pParse)
Xsqlite3ExprCodeTarget(tls, pParse, pRight, r1)
- Xsqlite3VdbeChangeP3(tls, v, (Xsqlite3VdbeCurrentAddr(tls, v) - 1), 0)
+ Xsqlite3VdbeChangeP3(tls, v, Xsqlite3VdbeCurrentAddr(tls, v)-1, 0)
Xsqlite3ReleaseTempReg(tls, pParse, r1)
}
}
@@ -129178,7 +131163,7 @@ func isLikeOrGlob(tls *libc.TLS, pParse uintptr, pExpr uintptr, ppPrefix uintptr
}
}
- rc = (libc.Bool32(z != uintptr(0)))
+ rc = libc.Bool32(z != uintptr(0))
Xsqlite3ValueFree(tls, pVal)
return rc
}
@@ -129207,7 +131192,7 @@ func isLikeOrGlob(tls *libc.TLS, pParse uintptr, pExpr uintptr, ppPrefix uintptr
// of virtual table in forms (5) or (7) then return 2.
//
// If the expression matches none of the patterns above, return 0.
-func isAuxiliaryVtabOperator(tls *libc.TLS, db uintptr, pExpr uintptr, peOp2 uintptr, ppLeft uintptr, ppRight uintptr) int32 { /* sqlite3.c:147947:12: */
+func isAuxiliaryVtabOperator(tls *libc.TLS, db uintptr, pExpr uintptr, peOp2 uintptr, ppLeft uintptr, ppRight uintptr) int32 { /* sqlite3.c:149295:12: */
bp := tls.Alloc(8)
defer tls.Free(8)
@@ -129216,8 +131201,8 @@ func isAuxiliaryVtabOperator(tls *libc.TLS, db uintptr, pExpr uintptr, peOp2 uin
var pCol uintptr // Column reference
var i int32
- pList = *(*uintptr)(unsafe.Pointer(pExpr + 20 /* &.x */))
- if (pList == uintptr(0)) || ((*ExprList)(unsafe.Pointer(pList)).FnExpr != 2) {
+ pList = *(*uintptr)(unsafe.Pointer(pExpr + 20))
+ if pList == uintptr(0) || (*ExprList)(unsafe.Pointer(pList)).FnExpr != 2 {
return 0
}
@@ -129227,13 +131212,14 @@ func isAuxiliaryVtabOperator(tls *libc.TLS, db uintptr, pExpr uintptr, peOp2 uin
//
// vtab_column MATCH expression
// MATCH(expression,vtab_column)
- pCol = (*ExprList_item)(unsafe.Pointer((pList + 8 /* &.a */) + 1*20)).FpExpr
+ pCol = (*ExprList_item)(unsafe.Pointer(pList + 8 + 1*20)).FpExpr
+
+ if int32((*Expr)(unsafe.Pointer(pCol)).Fop) == TK_COLUMN && *(*uintptr)(unsafe.Pointer(pCol + 44)) != uintptr(0) && int32((*Table)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pCol + 44)))).FeTabType) == TABTYP_VTAB {
+ for i = 0; i < int32(uint32(unsafe.Sizeof(aOp))/uint32(unsafe.Sizeof(Op2{}))); i++ {
- if ((int32((*Expr)(unsafe.Pointer((pCol))).Fop) == TK_COLUMN) && (*(*uintptr)(unsafe.Pointer(pCol + 44 /* &.y */)) != uintptr(0))) && ((*Table)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pCol + 44 /* &.y */)))).FnModuleArg != 0) {
- for i = 0; i < (int32(uint32(unsafe.Sizeof(aOp)) / uint32(unsafe.Sizeof(Op2{})))); i++ {
- if Xsqlite3StrICmp(tls, *(*uintptr)(unsafe.Pointer(pExpr + 8 /* &.u */)), aOp[i].FzOp) == 0 {
+ if Xsqlite3StrICmp(tls, *(*uintptr)(unsafe.Pointer(pExpr + 8)), aOp[i].FzOp) == 0 {
*(*uint8)(unsafe.Pointer(peOp2)) = aOp[i].FeOp2
- *(*uintptr)(unsafe.Pointer(ppRight)) = (*ExprList_item)(unsafe.Pointer((pList + 8 /* &.a */))).FpExpr
+ *(*uintptr)(unsafe.Pointer(ppRight)) = (*ExprList_item)(unsafe.Pointer(pList + 8)).FpExpr
*(*uintptr)(unsafe.Pointer(ppLeft)) = pCol
return 1
}
@@ -129249,16 +131235,16 @@ func isAuxiliaryVtabOperator(tls *libc.TLS, db uintptr, pExpr uintptr, peOp2 uin
// Historically, xFindFunction expected to see lower-case function
// names. But for this use case, xFindFunction is expected to deal
// with function names in an arbitrary case.
- pCol = (*ExprList_item)(unsafe.Pointer((pList + 8 /* &.a */))).FpExpr
+ pCol = (*ExprList_item)(unsafe.Pointer(pList + 8)).FpExpr
- if ((int32((*Expr)(unsafe.Pointer((pCol))).Fop) == TK_COLUMN) && (*(*uintptr)(unsafe.Pointer(pCol + 44 /* &.y */)) != uintptr(0))) && ((*Table)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pCol + 44 /* &.y */)))).FnModuleArg != 0) {
+ if int32((*Expr)(unsafe.Pointer(pCol)).Fop) == TK_COLUMN && *(*uintptr)(unsafe.Pointer(pCol + 44)) != uintptr(0) && int32((*Table)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pCol + 44)))).FeTabType) == TABTYP_VTAB {
var pVtab uintptr
var pMod uintptr
// var xNotUsed uintptr at bp, 4
// var pNotUsed uintptr at bp+4, 4
- pVtab = (*VTable)(unsafe.Pointer(Xsqlite3GetVTable(tls, db, *(*uintptr)(unsafe.Pointer(pCol + 44 /* &.y */))))).FpVtab
+ pVtab = (*VTable)(unsafe.Pointer(Xsqlite3GetVTable(tls, db, *(*uintptr)(unsafe.Pointer(pCol + 44))))).FpVtab
pMod = (*Sqlite3_vtab)(unsafe.Pointer(pVtab)).FpModule
if (*Sqlite3_module)(unsafe.Pointer(pMod)).FxFindFunction != uintptr(0) {
@@ -129267,22 +131253,22 @@ func isAuxiliaryVtabOperator(tls *libc.TLS, db uintptr, pExpr uintptr, peOp2 uin
})(unsafe.Pointer(&struct{ uintptr }{(*Sqlite3_module)(unsafe.Pointer(pMod)).FxFindFunction})).f(tls, pVtab, 2, *(*uintptr)(unsafe.Pointer(pExpr + 8 /* &.u */)), bp /* &xNotUsed */, bp+4 /* &pNotUsed */)
if i >= SQLITE_INDEX_CONSTRAINT_FUNCTION {
*(*uint8)(unsafe.Pointer(peOp2)) = uint8(i)
- *(*uintptr)(unsafe.Pointer(ppRight)) = (*ExprList_item)(unsafe.Pointer((pList + 8 /* &.a */) + 1*20)).FpExpr
+ *(*uintptr)(unsafe.Pointer(ppRight)) = (*ExprList_item)(unsafe.Pointer(pList + 8 + 1*20)).FpExpr
*(*uintptr)(unsafe.Pointer(ppLeft)) = pCol
return 1
}
}
}
- } else if ((int32((*Expr)(unsafe.Pointer(pExpr)).Fop) == TK_NE) || (int32((*Expr)(unsafe.Pointer(pExpr)).Fop) == TK_ISNOT)) || (int32((*Expr)(unsafe.Pointer(pExpr)).Fop) == TK_NOTNULL) {
+ } else if int32((*Expr)(unsafe.Pointer(pExpr)).Fop) == TK_NE || int32((*Expr)(unsafe.Pointer(pExpr)).Fop) == TK_ISNOT || int32((*Expr)(unsafe.Pointer(pExpr)).Fop) == TK_NOTNULL {
var res int32 = 0
var pLeft uintptr = (*Expr)(unsafe.Pointer(pExpr)).FpLeft
var pRight uintptr = (*Expr)(unsafe.Pointer(pExpr)).FpRight
- if ((int32((*Expr)(unsafe.Pointer((pLeft))).Fop) == TK_COLUMN) && (*(*uintptr)(unsafe.Pointer(pLeft + 44 /* &.y */)) != uintptr(0))) && ((*Table)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pLeft + 44 /* &.y */)))).FnModuleArg != 0) {
+ if int32((*Expr)(unsafe.Pointer(pLeft)).Fop) == TK_COLUMN && *(*uintptr)(unsafe.Pointer(pLeft + 44)) != uintptr(0) && int32((*Table)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pLeft + 44)))).FeTabType) == TABTYP_VTAB {
res++
}
- if (pRight != 0) && (((int32((*Expr)(unsafe.Pointer((pRight))).Fop) == TK_COLUMN) && (*(*uintptr)(unsafe.Pointer(pRight + 44 /* &.y */)) != uintptr(0))) && ((*Table)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pRight + 44 /* &.y */)))).FnModuleArg != 0)) {
+ if pRight != 0 && (int32((*Expr)(unsafe.Pointer(pRight)).Fop) == TK_COLUMN && *(*uintptr)(unsafe.Pointer(pRight + 44)) != uintptr(0) && int32((*Table)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pRight + 44)))).FeTabType) == TABTYP_VTAB) {
res++
{
var t uintptr = pLeft
@@ -129311,26 +131297,26 @@ type Op2 = struct {
FzOp uintptr
FeOp2 uint8
F__ccgo_pad1 [3]byte
-} /* sqlite3.c:147955:18 */
+} /* sqlite3.c:149303:18 */
var aOp = [4]Op2{
- {FzOp: ts + 14628 /* "match" */, FeOp2: uint8(SQLITE_INDEX_CONSTRAINT_MATCH)},
- {FzOp: ts + 14101 /* "glob" */, FeOp2: uint8(SQLITE_INDEX_CONSTRAINT_GLOB)},
- {FzOp: ts + 13651 /* "like" */, FeOp2: uint8(SQLITE_INDEX_CONSTRAINT_LIKE)},
- {FzOp: ts + 20121 /* "regexp" */, FeOp2: uint8(SQLITE_INDEX_CONSTRAINT_REGEXP)},
-} /* sqlite3.c:147958:7 */
+ {FzOp: ts + 15810 /* "match" */, FeOp2: uint8(SQLITE_INDEX_CONSTRAINT_MATCH)},
+ {FzOp: ts + 15283 /* "glob" */, FeOp2: uint8(SQLITE_INDEX_CONSTRAINT_GLOB)},
+ {FzOp: ts + 14824 /* "like" */, FeOp2: uint8(SQLITE_INDEX_CONSTRAINT_LIKE)},
+ {FzOp: ts + 21418 /* "regexp" */, FeOp2: uint8(SQLITE_INDEX_CONSTRAINT_REGEXP)},
+} /* sqlite3.c:149306:7 */
// If the pBase expression originated in the ON or USING clause of
// a join, then transfer the appropriate markings over to derived.
-func transferJoinMarkings(tls *libc.TLS, pDerived uintptr, pBase uintptr) { /* sqlite3.c:148052:13: */
+func transferJoinMarkings(tls *libc.TLS, pDerived uintptr, pBase uintptr) { /* sqlite3.c:149407:13: */
if pDerived != 0 {
- *(*U32)(unsafe.Pointer(pDerived + 4 /* &.flags */)) |= ((*Expr)(unsafe.Pointer(pBase)).Fflags & U32(EP_FromJoin))
+ *(*U32)(unsafe.Pointer(pDerived + 4)) |= (*Expr)(unsafe.Pointer(pBase)).Fflags & U32(EP_FromJoin)
(*Expr)(unsafe.Pointer(pDerived)).FiRightJoinTable = (*Expr)(unsafe.Pointer(pBase)).FiRightJoinTable
}
}
// Mark term iChild as being a child of term iParent
-func markTermAsChild(tls *libc.TLS, pWC uintptr, iChild int32, iParent int32) { /* sqlite3.c:148062:13: */
+func markTermAsChild(tls *libc.TLS, pWC uintptr, iChild int32, iParent int32) { /* sqlite3.c:149417:13: */
(*WhereTerm)(unsafe.Pointer((*WhereClause)(unsafe.Pointer(pWC)).Fa + uintptr(iChild)*48)).FiParent = iParent
(*WhereTerm)(unsafe.Pointer((*WhereClause)(unsafe.Pointer(pWC)).Fa + uintptr(iChild)*48)).FtruthProb = (*WhereTerm)(unsafe.Pointer((*WhereClause)(unsafe.Pointer(pWC)).Fa + uintptr(iParent)*48)).FtruthProb
(*WhereTerm)(unsafe.Pointer((*WhereClause)(unsafe.Pointer(pWC)).Fa+uintptr(iParent)*48)).FnChild++
@@ -129339,15 +131325,15 @@ func markTermAsChild(tls *libc.TLS, pWC uintptr, iChild int32, iParent int32) {
// Return the N-th AND-connected subterm of pTerm. Or if pTerm is not
// a conjunction, then return just pTerm when N==0. If N is exceeds
// the number of available subterms, return NULL.
-func whereNthSubterm(tls *libc.TLS, pTerm uintptr, N int32) uintptr { /* sqlite3.c:148073:18: */
+func whereNthSubterm(tls *libc.TLS, pTerm uintptr, N int32) uintptr { /* sqlite3.c:149428:18: */
if int32((*WhereTerm)(unsafe.Pointer(pTerm)).FeOperator) != WO_AND {
if N == 0 {
return pTerm
}
return uintptr(0)
}
- if N < (*WhereAndInfo)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pTerm + 24 /* &.u */)))).Fwc.FnTerm {
- return ((*WhereAndInfo)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pTerm + 24 /* &.u */)))).Fwc.Fa + uintptr(N)*48)
+ if N < (*WhereAndInfo)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pTerm + 24)))).Fwc.FnTerm {
+ return (*WhereAndInfo)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pTerm + 24)))).Fwc.Fa + uintptr(N)*48
}
return uintptr(0)
}
@@ -129370,24 +131356,24 @@ func whereNthSubterm(tls *libc.TLS, pTerm uintptr, N int32) uintptr { /* sqlite3
// The following is NOT generated:
//
// x<y OR x>y --> x!=y
-func whereCombineDisjuncts(tls *libc.TLS, pSrc uintptr, pWC uintptr, pOne uintptr, pTwo uintptr) { /* sqlite3.c:148103:13: */
- var eOp U16 = (U16(int32((*WhereTerm)(unsafe.Pointer(pOne)).FeOperator) | int32((*WhereTerm)(unsafe.Pointer(pTwo)).FeOperator)))
+func whereCombineDisjuncts(tls *libc.TLS, pSrc uintptr, pWC uintptr, pOne uintptr, pTwo uintptr) { /* sqlite3.c:149458:13: */
+ var eOp U16 = U16(int32((*WhereTerm)(unsafe.Pointer(pOne)).FeOperator) | int32((*WhereTerm)(unsafe.Pointer(pTwo)).FeOperator))
var db uintptr // Database connection (for malloc)
var pNew uintptr // New virtual expression
var op int32 // Operator for the combined expression
var idxNew int32 // Index in pWC of the next virtual term
- if ((int32((*WhereTerm)(unsafe.Pointer(pOne)).FwtFlags) | int32((*WhereTerm)(unsafe.Pointer(pTwo)).FwtFlags)) & TERM_VNULL) != 0 {
+ if (int32((*WhereTerm)(unsafe.Pointer(pOne)).FwtFlags)|int32((*WhereTerm)(unsafe.Pointer(pTwo)).FwtFlags))&TERM_VNULL != 0 {
return
}
- if (int32((*WhereTerm)(unsafe.Pointer(pOne)).FeOperator) & ((((WO_EQ | (int32(WO_EQ) << (TK_LT - TK_EQ))) | (int32(WO_EQ) << (TK_LE - TK_EQ))) | (int32(WO_EQ) << (TK_GT - TK_EQ))) | (int32(WO_EQ) << (TK_GE - TK_EQ)))) == 0 {
+ if int32((*WhereTerm)(unsafe.Pointer(pOne)).FeOperator)&(WO_EQ|int32(WO_EQ)<<(TK_LT-TK_EQ)|int32(WO_EQ)<<(TK_LE-TK_EQ)|int32(WO_EQ)<<(TK_GT-TK_EQ)|int32(WO_EQ)<<(TK_GE-TK_EQ)) == 0 {
return
}
- if (int32((*WhereTerm)(unsafe.Pointer(pTwo)).FeOperator) & ((((WO_EQ | (int32(WO_EQ) << (TK_LT - TK_EQ))) | (int32(WO_EQ) << (TK_LE - TK_EQ))) | (int32(WO_EQ) << (TK_GT - TK_EQ))) | (int32(WO_EQ) << (TK_GE - TK_EQ)))) == 0 {
+ if int32((*WhereTerm)(unsafe.Pointer(pTwo)).FeOperator)&(WO_EQ|int32(WO_EQ)<<(TK_LT-TK_EQ)|int32(WO_EQ)<<(TK_LE-TK_EQ)|int32(WO_EQ)<<(TK_GT-TK_EQ)|int32(WO_EQ)<<(TK_GE-TK_EQ)) == 0 {
return
}
- if ((int32(eOp) & ((WO_EQ | (int32(WO_EQ) << (TK_LT - TK_EQ))) | (int32(WO_EQ) << (TK_LE - TK_EQ)))) != int32(eOp)) &&
- ((int32(eOp) & ((WO_EQ | (int32(WO_EQ) << (TK_GT - TK_EQ))) | (int32(WO_EQ) << (TK_GE - TK_EQ)))) != int32(eOp)) {
+ if int32(eOp)&(WO_EQ|int32(WO_EQ)<<(TK_LT-TK_EQ)|int32(WO_EQ)<<(TK_LE-TK_EQ)) != int32(eOp) &&
+ int32(eOp)&(WO_EQ|int32(WO_EQ)<<(TK_GT-TK_EQ)|int32(WO_EQ)<<(TK_GE-TK_EQ)) != int32(eOp) {
return
}
@@ -129398,12 +131384,12 @@ func whereCombineDisjuncts(tls *libc.TLS, pSrc uintptr, pWC uintptr, pOne uintpt
return
}
// If we reach this point, it means the two subterms can be combined
- if (int32(eOp) & (int32(eOp) - 1)) != 0 {
- if (int32(eOp) & ((int32(WO_EQ) << (TK_LT - TK_EQ)) | (int32(WO_EQ) << (TK_LE - TK_EQ)))) != 0 {
- eOp = (U16(int32(WO_EQ) << (TK_LE - TK_EQ)))
+ if int32(eOp)&(int32(eOp)-1) != 0 {
+ if int32(eOp)&(int32(WO_EQ)<<(TK_LT-TK_EQ)|int32(WO_EQ)<<(TK_LE-TK_EQ)) != 0 {
+ eOp = U16(int32(WO_EQ) << (TK_LE - TK_EQ))
} else {
- eOp = (U16(int32(WO_EQ) << (TK_GE - TK_EQ)))
+ eOp = U16(int32(WO_EQ) << (TK_GE - TK_EQ))
}
}
db = (*Parse)(unsafe.Pointer((*WhereInfo)(unsafe.Pointer((*WhereClause)(unsafe.Pointer(pWC)).FpWInfo)).FpParse)).Fdb
@@ -129411,10 +131397,10 @@ func whereCombineDisjuncts(tls *libc.TLS, pSrc uintptr, pWC uintptr, pOne uintpt
if pNew == uintptr(0) {
return
}
- for op = TK_EQ; int32(eOp) != (int32(WO_EQ) << (op - TK_EQ)); op++ {
+ for op = TK_EQ; int32(eOp) != int32(WO_EQ)<<(op-TK_EQ); op++ {
}
(*Expr)(unsafe.Pointer(pNew)).Fop = U8(op)
- idxNew = whereClauseInsert(tls, pWC, pNew, (uint16(TERM_VIRTUAL | TERM_DYNAMIC)))
+ idxNew = whereClauseInsert(tls, pWC, pNew, uint16(TERM_VIRTUAL|TERM_DYNAMIC))
exprAnalyze(tls, pSrc, pWC, idxNew)
}
@@ -129503,30 +131489,30 @@ func whereCombineDisjuncts(tls *libc.TLS, pSrc uintptr, pWC uintptr, pOne uintpt
//
// If none of cases 1, 2, or 3 apply, then leave the eOperator set to
// zero. This term is not useful for search.
-func exprAnalyzeOrTerm(tls *libc.TLS, pSrc uintptr, pWC uintptr, idxTerm int32) { /* sqlite3.c:148230:13: */
- var pWInfo uintptr = (*WhereClause)(unsafe.Pointer(pWC)).FpWInfo // WHERE clause processing context
- var pParse uintptr = (*WhereInfo)(unsafe.Pointer(pWInfo)).FpParse // Parser context
- var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb // Database connection
- var pTerm uintptr = ((*WhereClause)(unsafe.Pointer(pWC)).Fa + uintptr(idxTerm)*48) // The term to be analyzed
- var pExpr uintptr = (*WhereTerm)(unsafe.Pointer(pTerm)).FpExpr // The expression of the term
- var i int32 // Loop counters
- var pOrWc uintptr // Breakup of pTerm into subterms
- var pOrTerm uintptr // A Sub-term within the pOrWc
- var pOrInfo uintptr // Additional information associated with pTerm
- var chngToIN Bitmask // Tables that might satisfy case 1
- var indexable Bitmask // Tables that are indexable, satisfying case 2
+func exprAnalyzeOrTerm(tls *libc.TLS, pSrc uintptr, pWC uintptr, idxTerm int32) { /* sqlite3.c:149585:13: */
+ var pWInfo uintptr = (*WhereClause)(unsafe.Pointer(pWC)).FpWInfo // WHERE clause processing context
+ var pParse uintptr = (*WhereInfo)(unsafe.Pointer(pWInfo)).FpParse // Parser context
+ var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb // Database connection
+ var pTerm uintptr = (*WhereClause)(unsafe.Pointer(pWC)).Fa + uintptr(idxTerm)*48 // The term to be analyzed
+ var pExpr uintptr = (*WhereTerm)(unsafe.Pointer(pTerm)).FpExpr // The expression of the term
+ var i int32 // Loop counters
+ var pOrWc uintptr // Breakup of pTerm into subterms
+ var pOrTerm uintptr // A Sub-term within the pOrWc
+ var pOrInfo uintptr // Additional information associated with pTerm
+ var chngToIN Bitmask // Tables that might satisfy case 1
+ var indexable Bitmask // Tables that are indexable, satisfying case 2
// Break the OR clause into its separate subterms. The subterms are
// stored in a WhereClause structure containing within the WhereOrInfo
// object that is attached to the original OR clause term.
- *(*uintptr)(unsafe.Pointer(pTerm + 24 /* &.u */)) = libc.AssignUintptr(&pOrInfo, Xsqlite3DbMallocZero(tls, db, uint64(unsafe.Sizeof(WhereOrInfo{}))))
+ *(*uintptr)(unsafe.Pointer(pTerm + 24)) = libc.AssignUintptr(&pOrInfo, Xsqlite3DbMallocZero(tls, db, uint64(unsafe.Sizeof(WhereOrInfo{}))))
if pOrInfo == uintptr(0) {
return
}
- *(*U16)(unsafe.Pointer(pTerm + 10 /* &.wtFlags */)) |= U16((TERM_ORINFO))
- pOrWc = (pOrInfo /* &.wc */)
- libc.Xmemset(tls, pOrWc+24 /* &.aStatic */, 0, uint32(unsafe.Sizeof([8]WhereTerm{})))
+ *(*U16)(unsafe.Pointer(pTerm + 10)) |= U16(TERM_ORINFO)
+ pOrWc = pOrInfo
+ libc.Xmemset(tls, pOrWc+24, 0, uint32(unsafe.Sizeof([8]WhereTerm{})))
Xsqlite3WhereClauseInit(tls, pOrWc, pWInfo)
Xsqlite3WhereSplit(tls, pOrWc, pExpr, uint8(TK_OR))
Xsqlite3WhereExprAnalyze(tls, pSrc, pOrWc)
@@ -129537,14 +131523,14 @@ func exprAnalyzeOrTerm(tls *libc.TLS, pSrc uintptr, pWC uintptr, idxTerm int32)
// Compute the set of tables that might satisfy cases 1 or 3.
indexable = libc.CplUint64(uint64(0))
chngToIN = libc.CplUint64(uint64(0))
- i = ((*WhereClause)(unsafe.Pointer(pOrWc)).FnTerm - 1)
+ i = (*WhereClause)(unsafe.Pointer(pOrWc)).FnTerm - 1
pOrTerm = (*WhereClause)(unsafe.Pointer(pOrWc)).Fa
__1:
- if !((i >= 0) && (indexable != 0)) {
+ if !(i >= 0 && indexable != 0) {
goto __3
}
{
- if (int32((*WhereTerm)(unsafe.Pointer(pOrTerm)).FeOperator) & WO_SINGLE) == 0 {
+ if int32((*WhereTerm)(unsafe.Pointer(pOrTerm)).FeOperator)&WO_SINGLE == 0 {
var pAndInfo uintptr
chngToIN = uint64(0)
@@ -129554,11 +131540,12 @@ __1:
var pAndTerm uintptr
var j int32
var b Bitmask = uint64(0)
- *(*uintptr)(unsafe.Pointer(pOrTerm + 24 /* &.u */)) = pAndInfo
- *(*U16)(unsafe.Pointer(pOrTerm + 10 /* &.wtFlags */)) |= U16((TERM_ANDINFO))
+ *(*uintptr)(unsafe.Pointer(pOrTerm + 24)) = pAndInfo
+ *(*U16)(unsafe.Pointer(pOrTerm + 10)) |= U16(TERM_ANDINFO)
(*WhereTerm)(unsafe.Pointer(pOrTerm)).FeOperator = U16(WO_AND)
- pAndWC = (pAndInfo /* &.wc */)
- libc.Xmemset(tls, pAndWC+24 /* &.aStatic */, 0, uint32(unsafe.Sizeof([8]WhereTerm{})))
+ (*WhereTerm)(unsafe.Pointer(pOrTerm)).FleftCursor = -1
+ pAndWC = pAndInfo
+ libc.Xmemset(tls, pAndWC+24, 0, uint32(unsafe.Sizeof([8]WhereTerm{})))
Xsqlite3WhereClauseInit(tls, pAndWC, (*WhereClause)(unsafe.Pointer(pWC)).FpWInfo)
Xsqlite3WhereSplit(tls, pAndWC, (*WhereTerm)(unsafe.Pointer(pOrTerm)).FpExpr, uint8(TK_AND))
Xsqlite3WhereExprAnalyze(tls, pSrc, pAndWC)
@@ -129572,9 +131559,9 @@ __1:
}
{
- if (allowedOp(tls, int32((*Expr)(unsafe.Pointer((*WhereTerm)(unsafe.Pointer(pAndTerm)).FpExpr)).Fop)) != 0) ||
- (int32((*WhereTerm)(unsafe.Pointer(pAndTerm)).FeOperator) == WO_AUX) {
- b = b | (Xsqlite3WhereGetMask(tls, (pWInfo + 488 /* &.sMaskSet */), (*WhereTerm)(unsafe.Pointer(pAndTerm)).FleftCursor))
+ if allowedOp(tls, int32((*Expr)(unsafe.Pointer((*WhereTerm)(unsafe.Pointer(pAndTerm)).FpExpr)).Fop)) != 0 ||
+ int32((*WhereTerm)(unsafe.Pointer(pAndTerm)).FeOperator) == WO_AUX {
+ b = b | Xsqlite3WhereGetMask(tls, pWInfo+488, (*WhereTerm)(unsafe.Pointer(pAndTerm)).FleftCursor)
}
}
@@ -129586,23 +131573,23 @@ __1:
goto __6
__6:
}
- indexable = indexable & (b)
+ indexable = indexable & b
}
- } else if (int32((*WhereTerm)(unsafe.Pointer(pOrTerm)).FwtFlags) & TERM_COPIED) != 0 {
+ } else if int32((*WhereTerm)(unsafe.Pointer(pOrTerm)).FwtFlags)&TERM_COPIED != 0 {
// Skip this term for now. We revisit it when we process the
// corresponding TERM_VIRTUAL term
} else {
var b Bitmask
- b = Xsqlite3WhereGetMask(tls, (pWInfo + 488 /* &.sMaskSet */), (*WhereTerm)(unsafe.Pointer(pOrTerm)).FleftCursor)
- if (int32((*WhereTerm)(unsafe.Pointer(pOrTerm)).FwtFlags) & TERM_VIRTUAL) != 0 {
- var pOther uintptr = ((*WhereClause)(unsafe.Pointer(pOrWc)).Fa + uintptr((*WhereTerm)(unsafe.Pointer(pOrTerm)).FiParent)*48)
- b = b | (Xsqlite3WhereGetMask(tls, (pWInfo + 488 /* &.sMaskSet */), (*WhereTerm)(unsafe.Pointer(pOther)).FleftCursor))
+ b = Xsqlite3WhereGetMask(tls, pWInfo+488, (*WhereTerm)(unsafe.Pointer(pOrTerm)).FleftCursor)
+ if int32((*WhereTerm)(unsafe.Pointer(pOrTerm)).FwtFlags)&TERM_VIRTUAL != 0 {
+ var pOther uintptr = (*WhereClause)(unsafe.Pointer(pOrWc)).Fa + uintptr((*WhereTerm)(unsafe.Pointer(pOrTerm)).FiParent)*48
+ b = b | Xsqlite3WhereGetMask(tls, pWInfo+488, (*WhereTerm)(unsafe.Pointer(pOther)).FleftCursor)
}
- indexable = indexable & (b)
- if (int32((*WhereTerm)(unsafe.Pointer(pOrTerm)).FeOperator) & WO_EQ) == 0 {
+ indexable = indexable & b
+ if int32((*WhereTerm)(unsafe.Pointer(pOrTerm)).FeOperator)&WO_EQ == 0 {
chngToIN = uint64(0)
} else {
- chngToIN = chngToIN & (b)
+ chngToIN = chngToIN & b
}
}
@@ -129619,21 +131606,20 @@ __3:
// Record the set of tables that satisfy case 3. The set might be
// empty.
(*WhereOrInfo)(unsafe.Pointer(pOrInfo)).Findexable = indexable
+ (*WhereTerm)(unsafe.Pointer(pTerm)).FeOperator = U16(WO_OR)
+ (*WhereTerm)(unsafe.Pointer(pTerm)).FleftCursor = -1
if indexable != 0 {
- (*WhereTerm)(unsafe.Pointer(pTerm)).FeOperator = U16(WO_OR)
(*WhereClause)(unsafe.Pointer(pWC)).FhasOr = U8(1)
- } else {
- (*WhereTerm)(unsafe.Pointer(pTerm)).FeOperator = U16(WO_OR)
}
// For a two-way OR, attempt to implementation case 2.
- if (indexable != 0) && ((*WhereClause)(unsafe.Pointer(pOrWc)).FnTerm == 2) {
+ if indexable != 0 && (*WhereClause)(unsafe.Pointer(pOrWc)).FnTerm == 2 {
var iOne int32 = 0
var pOne uintptr
- for (libc.AssignUintptr(&pOne, whereNthSubterm(tls, ((*WhereClause)(unsafe.Pointer(pOrWc)).Fa), libc.PostIncInt32(&iOne, 1)))) != uintptr(0) {
+ for libc.AssignUintptr(&pOne, whereNthSubterm(tls, (*WhereClause)(unsafe.Pointer(pOrWc)).Fa, libc.PostIncInt32(&iOne, 1))) != uintptr(0) {
var iTwo int32 = 0
var pTwo uintptr
- for (libc.AssignUintptr(&pTwo, whereNthSubterm(tls, ((*WhereClause)(unsafe.Pointer(pOrWc)).Fa+1*48), libc.PostIncInt32(&iTwo, 1)))) != uintptr(0) {
+ for libc.AssignUintptr(&pTwo, whereNthSubterm(tls, (*WhereClause)(unsafe.Pointer(pOrWc)).Fa+1*48, libc.PostIncInt32(&iTwo, 1))) != uintptr(0) {
whereCombineDisjuncts(tls, pSrc, pWC, pOne, pTwo)
}
}
@@ -129669,25 +131655,25 @@ __3:
// will be recorded in iCursor and iColumn. There might not be any
// such table and column. Set okToChngToIN if an appropriate table
// and column is found but leave okToChngToIN false if not found.
- for j = 0; (j < 2) && !(okToChngToIN != 0); j++ {
+ for j = 0; j < 2 && !(okToChngToIN != 0); j++ {
var pLeft uintptr = uintptr(0)
pOrTerm = (*WhereClause)(unsafe.Pointer(pOrWc)).Fa
- i = ((*WhereClause)(unsafe.Pointer(pOrWc)).FnTerm - 1)
+ i = (*WhereClause)(unsafe.Pointer(pOrWc)).FnTerm - 1
__7:
if !(i >= 0) {
goto __9
}
{
- *(*U16)(unsafe.Pointer(pOrTerm + 10 /* &.wtFlags */)) &= libc.Uint16FromInt32((libc.CplInt32(TERM_OR_OK)))
+ *(*U16)(unsafe.Pointer(pOrTerm + 10)) &= libc.Uint16FromInt32(libc.CplInt32(TERM_OR_OK))
if (*WhereTerm)(unsafe.Pointer(pOrTerm)).FleftCursor == iCursor {
// This is the 2-bit case and we are on the second iteration and
// current term is from the first iteration. So skip this term.
goto __8
}
- if (chngToIN & Xsqlite3WhereGetMask(tls, (pWInfo+488 /* &.sMaskSet */),
- (*WhereTerm)(unsafe.Pointer(pOrTerm)).FleftCursor)) == uint64(0) {
+ if chngToIN&Xsqlite3WhereGetMask(tls, pWInfo+488,
+ (*WhereTerm)(unsafe.Pointer(pOrTerm)).FleftCursor) == uint64(0) {
// This term must be of the form t1.a==t2.b where t2 is in the
// chngToIN set but t1 is not. This term will be either preceded
// or follwed by an inverted copy (t2.b==t1.a). Skip this term
@@ -129695,7 +131681,8 @@ __3:
goto __8
}
- iColumn = *(*int32)(unsafe.Pointer(pOrTerm + 24 /* &.u */ /* &.x */ /* &.leftColumn */))
+
+ iColumn = *(*int32)(unsafe.Pointer(pOrTerm + 24))
iCursor = (*WhereTerm)(unsafe.Pointer(pOrTerm)).FleftCursor
pLeft = (*Expr)(unsafe.Pointer((*WhereTerm)(unsafe.Pointer(pOrTerm)).FpExpr)).FpLeft
goto __9
@@ -129720,15 +131707,15 @@ __3:
// table and column is common to every term in the OR clause
okToChngToIN = 1
__10:
- if !((i >= 0) && (okToChngToIN != 0)) {
+ if !(i >= 0 && okToChngToIN != 0) {
goto __12
}
{
if (*WhereTerm)(unsafe.Pointer(pOrTerm)).FleftCursor != iCursor {
- *(*U16)(unsafe.Pointer(pOrTerm + 10 /* &.wtFlags */)) &= libc.Uint16FromInt32((libc.CplInt32(TERM_OR_OK)))
- } else if (*(*int32)(unsafe.Pointer((pOrTerm + 24 /* &.u */ /* &.x */) /* &.leftColumn */)) != iColumn) || ((iColumn == (-2)) &&
- (Xsqlite3ExprCompare(tls, pParse, (*Expr)(unsafe.Pointer((*WhereTerm)(unsafe.Pointer(pOrTerm)).FpExpr)).FpLeft, pLeft, -1) != 0)) {
+ *(*U16)(unsafe.Pointer(pOrTerm + 10)) &= libc.Uint16FromInt32(libc.CplInt32(TERM_OR_OK))
+ } else if *(*int32)(unsafe.Pointer(pOrTerm + 24)) != iColumn || iColumn == -2 &&
+ Xsqlite3ExprCompare(tls, pParse, (*Expr)(unsafe.Pointer((*WhereTerm)(unsafe.Pointer(pOrTerm)).FpExpr)).FpLeft, pLeft, -1) != 0 {
okToChngToIN = 0
} else {
var affLeft int32
@@ -129738,10 +131725,10 @@ __3:
// conversions are required on the right. (Ticket #2249)
affRight = int32(Xsqlite3ExprAffinity(tls, (*Expr)(unsafe.Pointer((*WhereTerm)(unsafe.Pointer(pOrTerm)).FpExpr)).FpRight))
affLeft = int32(Xsqlite3ExprAffinity(tls, (*Expr)(unsafe.Pointer((*WhereTerm)(unsafe.Pointer(pOrTerm)).FpExpr)).FpLeft))
- if (affRight != 0) && (affRight != affLeft) {
+ if affRight != 0 && affRight != affLeft {
okToChngToIN = 0
} else {
- *(*U16)(unsafe.Pointer(pOrTerm + 10 /* &.wtFlags */)) |= U16((TERM_OR_OK))
+ *(*U16)(unsafe.Pointer(pOrTerm + 10)) |= U16(TERM_OR_OK)
}
}
@@ -129764,14 +131751,14 @@ __3:
var pLeft uintptr = uintptr(0) // The LHS of the IN operator
var pNew uintptr // The complete IN operator
- i = ((*WhereClause)(unsafe.Pointer(pOrWc)).FnTerm - 1)
+ i = (*WhereClause)(unsafe.Pointer(pOrWc)).FnTerm - 1
pOrTerm = (*WhereClause)(unsafe.Pointer(pOrWc)).Fa
__13:
if !(i >= 0) {
goto __15
}
{
- if (int32((*WhereTerm)(unsafe.Pointer(pOrTerm)).FwtFlags) & TERM_OR_OK) == 0 {
+ if int32((*WhereTerm)(unsafe.Pointer(pOrTerm)).FwtFlags)&TERM_OR_OK == 0 {
goto __14
}
@@ -129795,8 +131782,8 @@ __3:
var idxNew int32
transferJoinMarkings(tls, pNew, pExpr)
- *(*uintptr)(unsafe.Pointer(pNew + 20 /* &.x */)) = pList
- idxNew = whereClauseInsert(tls, pWC, pNew, (uint16(TERM_VIRTUAL | TERM_DYNAMIC)))
+ *(*uintptr)(unsafe.Pointer(pNew + 20)) = pList
+ idxNew = whereClauseInsert(tls, pWC, pNew, uint16(TERM_VIRTUAL|TERM_DYNAMIC))
exprAnalyze(tls, pSrc, pWC, idxNew)
// pTerm = &pWC->a[idxTerm]; // would be needed if pTerm where reused
@@ -129821,23 +131808,23 @@ __3:
// for the LHS anyplace else in the WHERE clause where the LHS column occurs.
// This is an optimization. No harm comes from returning 0. But if 1 is
// returned when it should not be, then incorrect answers might result.
-func termIsEquivalence(tls *libc.TLS, pParse uintptr, pExpr uintptr) int32 { /* sqlite3.c:148501:12: */
+func termIsEquivalence(tls *libc.TLS, pParse uintptr, pExpr uintptr) int32 { /* sqlite3.c:149859:12: */
var aff1 uint8
var aff2 uint8
var pColl uintptr
- if !(((*Sqlite3)(unsafe.Pointer(((*Parse)(unsafe.Pointer(pParse)).Fdb))).FdbOptFlags & (U32(SQLITE_Transitive))) == U32(0)) {
+ if !((*Sqlite3)(unsafe.Pointer((*Parse)(unsafe.Pointer(pParse)).Fdb)).FdbOptFlags&U32(SQLITE_Transitive) == U32(0)) {
return 0
}
- if (int32((*Expr)(unsafe.Pointer(pExpr)).Fop) != TK_EQ) && (int32((*Expr)(unsafe.Pointer(pExpr)).Fop) != TK_IS) {
+ if int32((*Expr)(unsafe.Pointer(pExpr)).Fop) != TK_EQ && int32((*Expr)(unsafe.Pointer(pExpr)).Fop) != TK_IS {
return 0
}
- if ((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_FromJoin))) != U32(0) {
+ if (*Expr)(unsafe.Pointer(pExpr)).Fflags&U32(EP_FromJoin) != U32(0) {
return 0
}
aff1 = Xsqlite3ExprAffinity(tls, (*Expr)(unsafe.Pointer(pExpr)).FpLeft)
aff2 = Xsqlite3ExprAffinity(tls, (*Expr)(unsafe.Pointer(pExpr)).FpRight)
- if (int32(aff1) != int32(aff2)) &&
- (!((int32(aff1)) >= SQLITE_AFF_NUMERIC) || !((int32(aff2)) >= SQLITE_AFF_NUMERIC)) {
+ if int32(aff1) != int32(aff2) &&
+ (!(int32(aff1) >= SQLITE_AFF_NUMERIC) || !(int32(aff2) >= SQLITE_AFF_NUMERIC)) {
return 0
}
pColl = Xsqlite3ExprCompareCollSeq(tls, pParse, pExpr)
@@ -129850,22 +131837,22 @@ func termIsEquivalence(tls *libc.TLS, pParse uintptr, pExpr uintptr) int32 { /*
// Recursively walk the expressions of a SELECT statement and generate
// a bitmask indicating which tables are used in that expression
// tree.
-func exprSelectUsage(tls *libc.TLS, pMaskSet uintptr, pS uintptr) Bitmask { /* sqlite3.c:148524:16: */
+func exprSelectUsage(tls *libc.TLS, pMaskSet uintptr, pS uintptr) Bitmask { /* sqlite3.c:149882:16: */
var mask Bitmask = uint64(0)
for pS != 0 {
var pSrc uintptr = (*Select)(unsafe.Pointer(pS)).FpSrc
- mask = mask | (Xsqlite3WhereExprListUsage(tls, pMaskSet, (*Select)(unsafe.Pointer(pS)).FpEList))
- mask = mask | (Xsqlite3WhereExprListUsage(tls, pMaskSet, (*Select)(unsafe.Pointer(pS)).FpGroupBy))
- mask = mask | (Xsqlite3WhereExprListUsage(tls, pMaskSet, (*Select)(unsafe.Pointer(pS)).FpOrderBy))
- mask = mask | (Xsqlite3WhereExprUsage(tls, pMaskSet, (*Select)(unsafe.Pointer(pS)).FpWhere))
- mask = mask | (Xsqlite3WhereExprUsage(tls, pMaskSet, (*Select)(unsafe.Pointer(pS)).FpHaving))
+ mask = mask | Xsqlite3WhereExprListUsage(tls, pMaskSet, (*Select)(unsafe.Pointer(pS)).FpEList)
+ mask = mask | Xsqlite3WhereExprListUsage(tls, pMaskSet, (*Select)(unsafe.Pointer(pS)).FpGroupBy)
+ mask = mask | Xsqlite3WhereExprListUsage(tls, pMaskSet, (*Select)(unsafe.Pointer(pS)).FpOrderBy)
+ mask = mask | Xsqlite3WhereExprUsage(tls, pMaskSet, (*Select)(unsafe.Pointer(pS)).FpWhere)
+ mask = mask | Xsqlite3WhereExprUsage(tls, pMaskSet, (*Select)(unsafe.Pointer(pS)).FpHaving)
if pSrc != uintptr(0) {
var i int32
for i = 0; i < (*SrcList)(unsafe.Pointer(pSrc)).FnSrc; i++ {
- mask = mask | (exprSelectUsage(tls, pMaskSet, (*SrcItem)(unsafe.Pointer((pSrc+8 /* &.a */)+uintptr(i)*72)).FpSelect))
- mask = mask | (Xsqlite3WhereExprUsage(tls, pMaskSet, (*SrcItem)(unsafe.Pointer((pSrc+8 /* &.a */)+uintptr(i)*72)).FpOn))
- if (uint32(int32(*(*uint16)(unsafe.Pointer((pSrc + 8 /* &.a */) + uintptr(i)*72 + 36 /* &.fg */ + 4 /* &.isTabFunc */)) & 0x4 >> 2))) != 0 {
- mask = mask | (Xsqlite3WhereExprListUsage(tls, pMaskSet, *(*uintptr)(unsafe.Pointer((pSrc + 8 /* &.a */) + uintptr(i)*72 + 64 /* &.u1 */))))
+ mask = mask | exprSelectUsage(tls, pMaskSet, (*SrcItem)(unsafe.Pointer(pSrc+8+uintptr(i)*72)).FpSelect)
+ mask = mask | Xsqlite3WhereExprUsage(tls, pMaskSet, (*SrcItem)(unsafe.Pointer(pSrc+8+uintptr(i)*72)).FpOn)
+ if uint32(int32(*(*uint16)(unsafe.Pointer(pSrc + 8 + uintptr(i)*72 + 36 + 4))&0x4>>2)) != 0 {
+ mask = mask | Xsqlite3WhereExprListUsage(tls, pMaskSet, *(*uintptr)(unsafe.Pointer(pSrc + 8 + uintptr(i)*72 + 64)))
}
}
}
@@ -129885,7 +131872,7 @@ func exprSelectUsage(tls *libc.TLS, pMaskSet uintptr, pS uintptr) Bitmask { /* s
// If pExpr is a TK_COLUMN column reference, then this routine always returns
// true even if that particular column is not indexed, because the column
// might be added to an automatic index later.
-func exprMightBeIndexed2(tls *libc.TLS, pFrom uintptr, mPrereq Bitmask, aiCurCol uintptr, pExpr uintptr) int32 { /* sqlite3.c:148561:28: */
+func exprMightBeIndexed2(tls *libc.TLS, pFrom uintptr, mPrereq Bitmask, aiCurCol uintptr, pExpr uintptr) int32 { /* sqlite3.c:149919:28: */
var pIdx uintptr
var i int32
var iCur int32
@@ -129904,16 +131891,16 @@ __2:
goto __3
__3:
;
- iCur = (*SrcItem)(unsafe.Pointer((pFrom + 8 /* &.a */) + uintptr(i)*72)).FiCursor
- for pIdx = (*Table)(unsafe.Pointer((*SrcItem)(unsafe.Pointer((pFrom + 8 /* &.a */) + uintptr(i)*72)).FpTab)).FpIndex; pIdx != 0; pIdx = (*Index)(unsafe.Pointer(pIdx)).FpNext {
+ iCur = (*SrcItem)(unsafe.Pointer(pFrom + 8 + uintptr(i)*72)).FiCursor
+ for pIdx = (*Table)(unsafe.Pointer((*SrcItem)(unsafe.Pointer(pFrom + 8 + uintptr(i)*72)).FpTab)).FpIndex; pIdx != 0; pIdx = (*Index)(unsafe.Pointer(pIdx)).FpNext {
if (*Index)(unsafe.Pointer(pIdx)).FaColExpr == uintptr(0) {
continue
}
for i = 0; i < int32((*Index)(unsafe.Pointer(pIdx)).FnKeyCol); i++ {
- if int32(*(*I16)(unsafe.Pointer((*Index)(unsafe.Pointer(pIdx)).FaiColumn + uintptr(i)*2))) != (-2) {
+ if int32(*(*I16)(unsafe.Pointer((*Index)(unsafe.Pointer(pIdx)).FaiColumn + uintptr(i)*2))) != -2 {
continue
}
- if Xsqlite3ExprCompareSkip(tls, pExpr, (*ExprList_item)(unsafe.Pointer(((*Index)(unsafe.Pointer(pIdx)).FaColExpr+8 /* &.a */)+uintptr(i)*20)).FpExpr, iCur) == 0 {
+ if Xsqlite3ExprCompareSkip(tls, pExpr, (*ExprList_item)(unsafe.Pointer((*Index)(unsafe.Pointer(pIdx)).FaColExpr+8+uintptr(i)*20)).FpExpr, iCur) == 0 {
*(*int32)(unsafe.Pointer(aiCurCol)) = iCur
*(*int32)(unsafe.Pointer(aiCurCol + 1*4)) = -2
return 1
@@ -129923,13 +131910,14 @@ __3:
return 0
}
-func exprMightBeIndexed(tls *libc.TLS, pFrom uintptr, mPrereq Bitmask, aiCurCol uintptr, pExpr uintptr, op int32) int32 { /* sqlite3.c:148585:12: */
+func exprMightBeIndexed(tls *libc.TLS, pFrom uintptr, mPrereq Bitmask, aiCurCol uintptr, pExpr uintptr, op int32) int32 { /* sqlite3.c:149943:12: */
// If this expression is a vector to the left or right of a
// inequality constraint (>, <, >= or <=), perform the processing
// on the first element of the vector.
- if (int32((*Expr)(unsafe.Pointer(pExpr)).Fop) == TK_VECTOR) && ((op >= TK_GT) && (op <= TK_GE)) {
- pExpr = (*ExprList_item)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(pExpr + 20 /* &.x */)) + 8 /* &.a */))).FpExpr
+ if int32((*Expr)(unsafe.Pointer(pExpr)).Fop) == TK_VECTOR && (op >= TK_GT && op <= TK_GE) {
+
+ pExpr = (*ExprList_item)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pExpr + 20)) + 8)).FpExpr
}
@@ -129941,7 +131929,7 @@ func exprMightBeIndexed(tls *libc.TLS, pFrom uintptr, mPrereq Bitmask, aiCurCol
if mPrereq == uint64(0) {
return 0
} // No table references
- if (mPrereq & (mPrereq - uint64(1))) != uint64(0) {
+ if mPrereq&(mPrereq-uint64(1)) != uint64(0) {
return 0
} // Refs more than one table
return exprMightBeIndexed2(tls, pFrom, mPrereq, aiCurCol, pExpr)
@@ -129963,7 +131951,7 @@ func exprMightBeIndexed(tls *libc.TLS, pFrom uintptr, mPrereq Bitmask, aiCurCol
// needs to be freed with the WhereClause) and TERM_VIRTUAL (because it
// is a commuted copy of a prior term.) The original term has nChild=1
// and the copy has idxParent set to the index of the original term.
-func exprAnalyze(tls *libc.TLS, pSrc uintptr, pWC uintptr, idxTerm int32) { /* sqlite3.c:148632:13: */
+func exprAnalyze(tls *libc.TLS, pSrc uintptr, pWC uintptr, idxTerm int32) { /* sqlite3.c:149991:13: */
bp := tls.Alloc(32)
defer tls.Free(32)
@@ -129986,8 +131974,8 @@ func exprAnalyze(tls *libc.TLS, pSrc uintptr, pWC uintptr, idxTerm int32) { /* s
if (*Sqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 {
return
}
- pTerm = ((*WhereClause)(unsafe.Pointer(pWC)).Fa + uintptr(idxTerm)*48)
- pMaskSet = (pWInfo + 488 /* &.sMaskSet */)
+ pTerm = (*WhereClause)(unsafe.Pointer(pWC)).Fa + uintptr(idxTerm)*48
+ pMaskSet = pWInfo + 488
pExpr = (*WhereTerm)(unsafe.Pointer(pTerm)).FpExpr
prereqLeft = Xsqlite3WhereExprUsage(tls, pMaskSet, (*Expr)(unsafe.Pointer(pExpr)).FpLeft)
@@ -129997,10 +131985,10 @@ func exprAnalyze(tls *libc.TLS, pSrc uintptr, pWC uintptr, idxTerm int32) { /* s
if Xsqlite3ExprCheckIN(tls, pParse, pExpr) != 0 {
return
}
- if ((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_xIsSelect))) != U32(0) {
- (*WhereTerm)(unsafe.Pointer(pTerm)).FprereqRight = exprSelectUsage(tls, pMaskSet, *(*uintptr)(unsafe.Pointer(pExpr + 20 /* &.x */)))
+ if (*Expr)(unsafe.Pointer(pExpr)).Fflags&U32(EP_xIsSelect) != U32(0) {
+ (*WhereTerm)(unsafe.Pointer(pTerm)).FprereqRight = exprSelectUsage(tls, pMaskSet, *(*uintptr)(unsafe.Pointer(pExpr + 20)))
} else {
- (*WhereTerm)(unsafe.Pointer(pTerm)).FprereqRight = Xsqlite3WhereExprListUsage(tls, pMaskSet, *(*uintptr)(unsafe.Pointer(pExpr + 20 /* &.x */)))
+ (*WhereTerm)(unsafe.Pointer(pTerm)).FprereqRight = Xsqlite3WhereExprListUsage(tls, pMaskSet, *(*uintptr)(unsafe.Pointer(pExpr + 20)))
}
} else if op == TK_ISNULL {
(*WhereTerm)(unsafe.Pointer(pTerm)).FprereqRight = uint64(0)
@@ -130010,15 +131998,15 @@ func exprAnalyze(tls *libc.TLS, pSrc uintptr, pWC uintptr, idxTerm int32) { /* s
(*WhereMaskSet)(unsafe.Pointer(pMaskSet)).FbVarSelect = 0
prereqAll = Xsqlite3WhereExprUsageNN(tls, pMaskSet, pExpr)
if (*WhereMaskSet)(unsafe.Pointer(pMaskSet)).FbVarSelect != 0 {
- *(*U16)(unsafe.Pointer(pTerm + 10 /* &.wtFlags */)) |= U16((TERM_VARSELECT))
+ *(*U16)(unsafe.Pointer(pTerm + 10)) |= U16(TERM_VARSELECT)
}
- if ((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_FromJoin))) != U32(0) {
+ if (*Expr)(unsafe.Pointer(pExpr)).Fflags&U32(EP_FromJoin) != U32(0) {
var x Bitmask = Xsqlite3WhereGetMask(tls, pMaskSet, (*Expr)(unsafe.Pointer(pExpr)).FiRightJoinTable)
- prereqAll = prereqAll | (x)
- extraRight = (x - uint64(1)) // ON clause terms may not be used with an index
+ prereqAll = prereqAll | x
+ extraRight = x - uint64(1) // ON clause terms may not be used with an index
// on left table of a LEFT JOIN. Ticket #3015
- if (prereqAll >> 1) >= x {
- Xsqlite3ErrorMsg(tls, pParse, ts+20128 /* "ON clause refere..." */, 0)
+ if prereqAll>>1 >= x {
+ Xsqlite3ErrorMsg(tls, pParse, ts+21425 /* "ON clause refere..." */, 0)
return
}
}
@@ -130032,28 +132020,29 @@ func exprAnalyze(tls *libc.TLS, pSrc uintptr, pWC uintptr, idxTerm int32) { /* s
var pLeft uintptr = Xsqlite3ExprSkipCollate(tls, (*Expr)(unsafe.Pointer(pExpr)).FpLeft)
var pRight uintptr = Xsqlite3ExprSkipCollate(tls, (*Expr)(unsafe.Pointer(pExpr)).FpRight)
var opMask U16
- if ((*WhereTerm)(unsafe.Pointer(pTerm)).FprereqRight & prereqLeft) == uint64(0) {
+ if (*WhereTerm)(unsafe.Pointer(pTerm)).FprereqRight&prereqLeft == uint64(0) {
opMask = uint16(WO_ALL)
} else {
opMask = uint16(WO_EQUIV)
}
- if *(*int32)(unsafe.Pointer((pTerm + 24 /* &.u */ /* &.x */) + 4 /* &.iField */)) > 0 {
+ if *(*int32)(unsafe.Pointer(pTerm + 24 + 4)) > 0 {
- pLeft = (*ExprList_item)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(pLeft + 20 /* &.x */)) + 8 /* &.a */) + uintptr((*(*int32)(unsafe.Pointer((pTerm + 24 /* &.u */ /* &.x */) + 4 /* &.iField */))-1))*20)).FpExpr
+ pLeft = (*ExprList_item)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pLeft + 20)) + 8 + uintptr(*(*int32)(unsafe.Pointer(pTerm + 24 + 4))-1)*20)).FpExpr
}
- if exprMightBeIndexed(tls, pSrc, prereqLeft, bp /* &aiCurCol[0] */, pLeft, op) != 0 {
+ if exprMightBeIndexed(tls, pSrc, prereqLeft, bp, pLeft, op) != 0 {
(*WhereTerm)(unsafe.Pointer(pTerm)).FleftCursor = *(*int32)(unsafe.Pointer(bp /* &aiCurCol[0] */))
- *(*int32)(unsafe.Pointer(pTerm + 24 /* &.u */ /* &.x */ /* &.leftColumn */)) = *(*int32)(unsafe.Pointer(bp /* &aiCurCol[0] */ + 1*4))
- (*WhereTerm)(unsafe.Pointer(pTerm)).FeOperator = (U16(int32(operatorMask(tls, op)) & int32(opMask)))
+
+ *(*int32)(unsafe.Pointer(pTerm + 24)) = *(*int32)(unsafe.Pointer(bp /* &aiCurCol[0] */ + 1*4))
+ (*WhereTerm)(unsafe.Pointer(pTerm)).FeOperator = U16(int32(operatorMask(tls, op)) & int32(opMask))
}
if op == TK_IS {
- *(*U16)(unsafe.Pointer(pTerm + 10 /* &.wtFlags */)) |= U16((TERM_IS))
+ *(*U16)(unsafe.Pointer(pTerm + 10)) |= U16(TERM_IS)
}
- if ((pRight != 0) &&
- (exprMightBeIndexed(tls, pSrc, (*WhereTerm)(unsafe.Pointer(pTerm)).FprereqRight, bp /* &aiCurCol[0] */, pRight, op) != 0)) &&
- !(((*Expr)(unsafe.Pointer((pRight))).Fflags & (U32(EP_FixedCol))) != U32(0)) {
+ if pRight != 0 &&
+ exprMightBeIndexed(tls, pSrc, (*WhereTerm)(unsafe.Pointer(pTerm)).FprereqRight, bp, pRight, op) != 0 &&
+ !((*Expr)(unsafe.Pointer(pRight)).Fflags&U32(EP_FixedCol) != U32(0)) {
var pNew uintptr
var pDup uintptr
var eExtraOp U16 = U16(0) // Extra bits for pNew->eOperator
@@ -130065,65 +132054,71 @@ func exprAnalyze(tls *libc.TLS, pSrc uintptr, pWC uintptr, idxTerm int32) { /* s
Xsqlite3ExprDelete(tls, db, pDup)
return
}
- idxNew = whereClauseInsert(tls, pWC, pDup, (uint16(TERM_VIRTUAL | TERM_DYNAMIC)))
+ idxNew = whereClauseInsert(tls, pWC, pDup, uint16(TERM_VIRTUAL|TERM_DYNAMIC))
if idxNew == 0 {
return
}
- pNew = ((*WhereClause)(unsafe.Pointer(pWC)).Fa + uintptr(idxNew)*48)
+ pNew = (*WhereClause)(unsafe.Pointer(pWC)).Fa + uintptr(idxNew)*48
markTermAsChild(tls, pWC, idxNew, idxTerm)
if op == TK_IS {
- *(*U16)(unsafe.Pointer(pNew + 10 /* &.wtFlags */)) |= U16((TERM_IS))
+ *(*U16)(unsafe.Pointer(pNew + 10)) |= U16(TERM_IS)
}
- pTerm = ((*WhereClause)(unsafe.Pointer(pWC)).Fa + uintptr(idxTerm)*48)
- *(*U16)(unsafe.Pointer(pTerm + 10 /* &.wtFlags */)) |= U16((TERM_COPIED))
+ pTerm = (*WhereClause)(unsafe.Pointer(pWC)).Fa + uintptr(idxTerm)*48
+ *(*U16)(unsafe.Pointer(pTerm + 10)) |= U16(TERM_COPIED)
if termIsEquivalence(tls, pParse, pDup) != 0 {
- *(*U16)(unsafe.Pointer(pTerm + 12 /* &.eOperator */)) |= U16((WO_EQUIV))
+ *(*U16)(unsafe.Pointer(pTerm + 12)) |= U16(WO_EQUIV)
eExtraOp = U16(WO_EQUIV)
}
} else {
pDup = pExpr
pNew = pTerm
}
- *(*U16)(unsafe.Pointer(pNew + 10 /* &.wtFlags */)) |= U16((int32(exprCommute(tls, pParse, pDup))))
+ *(*U16)(unsafe.Pointer(pNew + 10)) |= U16(int32(exprCommute(tls, pParse, pDup)))
(*WhereTerm)(unsafe.Pointer(pNew)).FleftCursor = *(*int32)(unsafe.Pointer(bp /* &aiCurCol[0] */))
- *(*int32)(unsafe.Pointer(pNew + 24 /* &.u */ /* &.x */ /* &.leftColumn */)) = *(*int32)(unsafe.Pointer(bp /* &aiCurCol[0] */ + 1*4))
- (*WhereTerm)(unsafe.Pointer(pNew)).FprereqRight = (prereqLeft | extraRight)
+ *(*int32)(unsafe.Pointer(pNew + 24)) = *(*int32)(unsafe.Pointer(bp /* &aiCurCol[0] */ + 1*4))
+
+ (*WhereTerm)(unsafe.Pointer(pNew)).FprereqRight = prereqLeft | extraRight
(*WhereTerm)(unsafe.Pointer(pNew)).FprereqAll = prereqAll
- (*WhereTerm)(unsafe.Pointer(pNew)).FeOperator = (U16((int32(operatorMask(tls, int32((*Expr)(unsafe.Pointer(pDup)).Fop))) + int32(eExtraOp)) & int32(opMask)))
- } else if (op == TK_ISNULL) && (0 == Xsqlite3ExprCanBeNull(tls, pLeft)) {
+ (*WhereTerm)(unsafe.Pointer(pNew)).FeOperator = U16((int32(operatorMask(tls, int32((*Expr)(unsafe.Pointer(pDup)).Fop))) + int32(eExtraOp)) & int32(opMask))
+ } else if op == TK_ISNULL &&
+ !((*Expr)(unsafe.Pointer(pExpr)).Fflags&U32(EP_FromJoin) != U32(0)) &&
+ 0 == Xsqlite3ExprCanBeNull(tls, pLeft) {
+
(*Expr)(unsafe.Pointer(pExpr)).Fop = U8(TK_TRUEFALSE)
- *(*uintptr)(unsafe.Pointer(pExpr + 8 /* &.u */)) = ts + 5775 /* "false" */
- *(*U32)(unsafe.Pointer(pExpr + 4 /* &.flags */)) |= (U32(EP_IsFalse))
+ *(*uintptr)(unsafe.Pointer(pExpr + 8)) = ts + 6622 /* "false" */
+ *(*U32)(unsafe.Pointer(pExpr + 4)) |= U32(EP_IsFalse)
(*WhereTerm)(unsafe.Pointer(pTerm)).FprereqAll = uint64(0)
(*WhereTerm)(unsafe.Pointer(pTerm)).FeOperator = U16(0)
}
- } else if (int32((*Expr)(unsafe.Pointer(pExpr)).Fop) == TK_BETWEEN) && (int32((*WhereClause)(unsafe.Pointer(pWC)).Fop) == TK_AND) {
- var pList uintptr = *(*uintptr)(unsafe.Pointer(pExpr + 20 /* &.x */))
+ } else if int32((*Expr)(unsafe.Pointer(pExpr)).Fop) == TK_BETWEEN && int32((*WhereClause)(unsafe.Pointer(pWC)).Fop) == TK_AND {
+ var pList uintptr
var i int32
+ pList = *(*uintptr)(unsafe.Pointer(pExpr + 20))
+
for i = 0; i < 2; i++ {
var pNewExpr uintptr
var idxNew int32
pNewExpr = Xsqlite3PExpr(tls, pParse, int32(ops[i]),
Xsqlite3ExprDup(tls, db, (*Expr)(unsafe.Pointer(pExpr)).FpLeft, 0),
- Xsqlite3ExprDup(tls, db, (*ExprList_item)(unsafe.Pointer((pList+8 /* &.a */)+uintptr(i)*20)).FpExpr, 0))
+ Xsqlite3ExprDup(tls, db, (*ExprList_item)(unsafe.Pointer(pList+8+uintptr(i)*20)).FpExpr, 0))
transferJoinMarkings(tls, pNewExpr, pExpr)
- idxNew = whereClauseInsert(tls, pWC, pNewExpr, (uint16(TERM_VIRTUAL | TERM_DYNAMIC)))
+ idxNew = whereClauseInsert(tls, pWC, pNewExpr, uint16(TERM_VIRTUAL|TERM_DYNAMIC))
exprAnalyze(tls, pSrc, pWC, idxNew)
- pTerm = ((*WhereClause)(unsafe.Pointer(pWC)).Fa + uintptr(idxTerm)*48)
+ pTerm = (*WhereClause)(unsafe.Pointer(pWC)).Fa + uintptr(idxTerm)*48
markTermAsChild(tls, pWC, idxNew, idxTerm)
}
} else if int32((*Expr)(unsafe.Pointer(pExpr)).Fop) == TK_OR {
exprAnalyzeOrTerm(tls, pSrc, pWC, idxTerm)
- pTerm = ((*WhereClause)(unsafe.Pointer(pWC)).Fa + uintptr(idxTerm)*48)
+ pTerm = (*WhereClause)(unsafe.Pointer(pWC)).Fa + uintptr(idxTerm)*48
} else if int32((*Expr)(unsafe.Pointer(pExpr)).Fop) == TK_NOTNULL {
- if ((int32((*Expr)(unsafe.Pointer((*Expr)(unsafe.Pointer(pExpr)).FpLeft)).Fop) == TK_COLUMN) &&
- (int32((*Expr)(unsafe.Pointer((*Expr)(unsafe.Pointer(pExpr)).FpLeft)).FiColumn) >= 0)) &&
- !(((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_FromJoin))) != U32(0)) {
+ if int32((*Expr)(unsafe.Pointer((*Expr)(unsafe.Pointer(pExpr)).FpLeft)).Fop) == TK_COLUMN &&
+ int32((*Expr)(unsafe.Pointer((*Expr)(unsafe.Pointer(pExpr)).FpLeft)).FiColumn) >= 0 &&
+ !((*Expr)(unsafe.Pointer(pExpr)).Fflags&U32(EP_FromJoin) != U32(0)) {
var pNewExpr uintptr
var pLeft uintptr = (*Expr)(unsafe.Pointer(pExpr)).FpLeft
var idxNew int32
@@ -130134,22 +132129,22 @@ func exprAnalyze(tls *libc.TLS, pSrc uintptr, pWC uintptr, idxTerm int32) { /* s
Xsqlite3ExprAlloc(tls, db, TK_NULL, uintptr(0), 0))
idxNew = whereClauseInsert(tls, pWC, pNewExpr,
- (uint16((TERM_VIRTUAL | TERM_DYNAMIC) | TERM_VNULL)))
+ uint16(TERM_VIRTUAL|TERM_DYNAMIC|TERM_VNULL))
if idxNew != 0 {
- pNewTerm = ((*WhereClause)(unsafe.Pointer(pWC)).Fa + uintptr(idxNew)*48)
+ pNewTerm = (*WhereClause)(unsafe.Pointer(pWC)).Fa + uintptr(idxNew)*48
(*WhereTerm)(unsafe.Pointer(pNewTerm)).FprereqRight = uint64(0)
(*WhereTerm)(unsafe.Pointer(pNewTerm)).FleftCursor = (*Expr)(unsafe.Pointer(pLeft)).FiTable
- *(*int32)(unsafe.Pointer(pNewTerm + 24 /* &.u */ /* &.x */ /* &.leftColumn */)) = int32((*Expr)(unsafe.Pointer(pLeft)).FiColumn)
- (*WhereTerm)(unsafe.Pointer(pNewTerm)).FeOperator = (U16(int32(WO_EQ) << (TK_GT - TK_EQ)))
+ *(*int32)(unsafe.Pointer(pNewTerm + 24)) = int32((*Expr)(unsafe.Pointer(pLeft)).FiColumn)
+ (*WhereTerm)(unsafe.Pointer(pNewTerm)).FeOperator = U16(int32(WO_EQ) << (TK_GT - TK_EQ))
markTermAsChild(tls, pWC, idxNew, idxTerm)
- pTerm = ((*WhereClause)(unsafe.Pointer(pWC)).Fa + uintptr(idxTerm)*48)
- *(*U16)(unsafe.Pointer(pTerm + 10 /* &.wtFlags */)) |= U16((TERM_COPIED))
+ pTerm = (*WhereClause)(unsafe.Pointer(pWC)).Fa + uintptr(idxTerm)*48
+ *(*U16)(unsafe.Pointer(pTerm + 10)) |= U16(TERM_COPIED)
(*WhereTerm)(unsafe.Pointer(pNewTerm)).FprereqAll = (*WhereTerm)(unsafe.Pointer(pTerm)).FprereqAll
}
}
- } else if ((int32((*Expr)(unsafe.Pointer(pExpr)).Fop) == TK_FUNCTION) &&
- (int32((*WhereClause)(unsafe.Pointer(pWC)).Fop) == TK_AND)) &&
- (isLikeOrGlob(tls, pParse, pExpr, bp+8 /* &pStr1 */, bp+12 /* &isComplete */, bp+16 /* &noCase */) != 0) {
+ } else if int32((*Expr)(unsafe.Pointer(pExpr)).Fop) == TK_FUNCTION &&
+ int32((*WhereClause)(unsafe.Pointer(pWC)).Fop) == TK_AND &&
+ isLikeOrGlob(tls, pParse, pExpr, bp+8, bp+12, bp+16) != 0 {
var pLeft uintptr // LHS of LIKE/GLOB operator
var pStr2 uintptr // Copy of pStr1 - RHS of LIKE/GLOB operator
var pNewExpr1 uintptr
@@ -130157,45 +132152,45 @@ func exprAnalyze(tls *libc.TLS, pSrc uintptr, pWC uintptr, idxTerm int32) { /* s
var idxNew1 int32
var idxNew2 int32
var zCollSeqName uintptr // Name of collating sequence
- var wtFlags U16 = (U16((TERM_LIKEOPT | TERM_VIRTUAL) | TERM_DYNAMIC))
+ var wtFlags U16 = U16(TERM_LIKEOPT | TERM_VIRTUAL | TERM_DYNAMIC)
- pLeft = (*ExprList_item)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(pExpr + 20 /* &.x */)) + 8 /* &.a */) + 1*20)).FpExpr
+ pLeft = (*ExprList_item)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pExpr + 20)) + 8 + 1*20)).FpExpr
pStr2 = Xsqlite3ExprDup(tls, db, *(*uintptr)(unsafe.Pointer(bp + 8 /* pStr1 */)), 0)
// Convert the lower bound to upper-case and the upper bound to
// lower-case (upper-case is less than lower-case in ASCII) so that
// the range constraints also work for BLOBs
- if (*(*int32)(unsafe.Pointer(bp + 16 /* noCase */)) != 0) && !(int32((*Sqlite3)(unsafe.Pointer((*Parse)(unsafe.Pointer(pParse)).Fdb)).FmallocFailed) != 0) {
+ if *(*int32)(unsafe.Pointer(bp + 16)) != 0 && !(int32((*Sqlite3)(unsafe.Pointer((*Parse)(unsafe.Pointer(pParse)).Fdb)).FmallocFailed) != 0) {
var i int32
var c uint8
- *(*U16)(unsafe.Pointer(pTerm + 10 /* &.wtFlags */)) |= U16((TERM_LIKE))
- for i = 0; (int32(libc.AssignUint8(&c, *(*uint8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8 /* pStr1 */)) + 8 /* &.u */)) + uintptr(i)))))) != 0; i++ {
- *(*uint8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8 /* pStr1 */)) + 8 /* &.u */)) + uintptr(i))) = (uint8((int32(c)) & ^(int32(Xsqlite3CtypeMap[uint8(c)]) & 0x20)))
- *(*uint8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pStr2 + 8 /* &.u */)) + uintptr(i))) = uint8(Xsqlite3UpperToLower[uint8(c)])
+ *(*U16)(unsafe.Pointer(pTerm + 10)) |= U16(TERM_LIKE)
+ for i = 0; int32(libc.AssignUint8(&c, *(*uint8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8 /* pStr1 */)) + 8 /* &.u */)) + uintptr(i))))) != 0; i++ {
+ *(*uint8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)) + 8)) + uintptr(i))) = uint8(int32(c) & ^(int32(Xsqlite3CtypeMap[uint8(c)]) & 0x20))
+ *(*uint8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pStr2 + 8)) + uintptr(i))) = uint8(Xsqlite3UpperToLower[uint8(c)])
}
}
if !(int32((*Sqlite3)(unsafe.Pointer(db)).FmallocFailed) != 0) {
var c U8
var pC uintptr // Last character before the first wildcard
- pC = (*(*uintptr)(unsafe.Pointer(pStr2 + 8 /* &.u */)) + uintptr((Xsqlite3Strlen30(tls, *(*uintptr)(unsafe.Pointer(pStr2 + 8 /* &.u */))) - 1)))
+ pC = *(*uintptr)(unsafe.Pointer(pStr2 + 8)) + uintptr(Xsqlite3Strlen30(tls, *(*uintptr)(unsafe.Pointer(pStr2 + 8)))-1)
c = *(*U8)(unsafe.Pointer(pC))
- if *(*int32)(unsafe.Pointer(bp + 16 /* noCase */)) != 0 {
+ if *(*int32)(unsafe.Pointer(bp + 16)) != 0 {
// The point is to increment the last character before the first
// wildcard. But if we increment '@', that will push it into the
// alphabetic range where case conversions will mess up the
// inequality. To avoid this, make sure to also run the full
// LIKE on all candidate expressions by clearing the isComplete flag
- if int32(c) == ('A' - 1) {
+ if int32(c) == 'A'-1 {
*(*int32)(unsafe.Pointer(bp + 12 /* isComplete */)) = 0
}
c = Xsqlite3UpperToLower[c]
}
- *(*U8)(unsafe.Pointer(pC)) = (U8(int32(c) + 1))
+ *(*U8)(unsafe.Pointer(pC)) = U8(int32(c) + 1)
}
zCollSeqName = func() uintptr {
- if *(*int32)(unsafe.Pointer(bp + 16 /* noCase */)) != 0 {
- return ts + 20169 /* "NOCASE" */
+ if *(*int32)(unsafe.Pointer(bp + 16)) != 0 {
+ return ts + 21466 /* "NOCASE" */
}
return uintptr(unsafe.Pointer(&Xsqlite3StrBINARY))
}()
@@ -130215,8 +132210,8 @@ func exprAnalyze(tls *libc.TLS, pSrc uintptr, pWC uintptr, idxTerm int32) { /* s
idxNew2 = whereClauseInsert(tls, pWC, pNewExpr2, wtFlags)
exprAnalyze(tls, pSrc, pWC, idxNew2)
- pTerm = ((*WhereClause)(unsafe.Pointer(pWC)).Fa + uintptr(idxTerm)*48)
- if *(*int32)(unsafe.Pointer(bp + 12 /* isComplete */)) != 0 {
+ pTerm = (*WhereClause)(unsafe.Pointer(pWC)).Fa + uintptr(idxTerm)*48
+ if *(*int32)(unsafe.Pointer(bp + 12)) != 0 {
markTermAsChild(tls, pWC, idxNew1, idxTerm)
markTermAsChild(tls, pWC, idxNew2, idxTerm)
}
@@ -130229,38 +132224,39 @@ func exprAnalyze(tls *libc.TLS, pSrc uintptr, pWC uintptr, idxTerm int32) { /* s
//
// This is only required if at least one side of the comparison operation
// is not a sub-select.
- if (((((int32((*Expr)(unsafe.Pointer(pExpr)).Fop) == TK_EQ) || (int32((*Expr)(unsafe.Pointer(pExpr)).Fop) == TK_IS)) &&
- ((libc.AssignInt32(&nLeft, Xsqlite3ExprVectorSize(tls, (*Expr)(unsafe.Pointer(pExpr)).FpLeft))) > 1)) &&
- (Xsqlite3ExprVectorSize(tls, (*Expr)(unsafe.Pointer(pExpr)).FpRight) == nLeft)) &&
- ((((*Expr)(unsafe.Pointer((*Expr)(unsafe.Pointer(pExpr)).FpLeft)).Fflags & U32(EP_xIsSelect)) == U32(0)) ||
- (((*Expr)(unsafe.Pointer((*Expr)(unsafe.Pointer(pExpr)).FpRight)).Fflags & U32(EP_xIsSelect)) == U32(0)))) &&
- (int32((*WhereClause)(unsafe.Pointer(pWC)).Fop) == TK_AND) {
+ if (int32((*Expr)(unsafe.Pointer(pExpr)).Fop) == TK_EQ || int32((*Expr)(unsafe.Pointer(pExpr)).Fop) == TK_IS) &&
+ libc.AssignInt32(&nLeft, Xsqlite3ExprVectorSize(tls, (*Expr)(unsafe.Pointer(pExpr)).FpLeft)) > 1 &&
+ Xsqlite3ExprVectorSize(tls, (*Expr)(unsafe.Pointer(pExpr)).FpRight) == nLeft &&
+ ((*Expr)(unsafe.Pointer((*Expr)(unsafe.Pointer(pExpr)).FpLeft)).Fflags&U32(EP_xIsSelect) == U32(0) ||
+ (*Expr)(unsafe.Pointer((*Expr)(unsafe.Pointer(pExpr)).FpRight)).Fflags&U32(EP_xIsSelect) == U32(0)) &&
+ int32((*WhereClause)(unsafe.Pointer(pWC)).Fop) == TK_AND {
var i int32
for i = 0; i < nLeft; i++ {
var idxNew int32
var pNew uintptr
- var pLeft uintptr = Xsqlite3ExprForVectorField(tls, pParse, (*Expr)(unsafe.Pointer(pExpr)).FpLeft, i)
- var pRight uintptr = Xsqlite3ExprForVectorField(tls, pParse, (*Expr)(unsafe.Pointer(pExpr)).FpRight, i)
+ var pLeft uintptr = Xsqlite3ExprForVectorField(tls, pParse, (*Expr)(unsafe.Pointer(pExpr)).FpLeft, i, nLeft)
+ var pRight uintptr = Xsqlite3ExprForVectorField(tls, pParse, (*Expr)(unsafe.Pointer(pExpr)).FpRight, i, nLeft)
pNew = Xsqlite3PExpr(tls, pParse, int32((*Expr)(unsafe.Pointer(pExpr)).Fop), pLeft, pRight)
transferJoinMarkings(tls, pNew, pExpr)
idxNew = whereClauseInsert(tls, pWC, pNew, uint16(TERM_DYNAMIC))
exprAnalyze(tls, pSrc, pWC, idxNew)
}
- pTerm = ((*WhereClause)(unsafe.Pointer(pWC)).Fa + uintptr(idxTerm)*48)
- *(*U16)(unsafe.Pointer(pTerm + 10 /* &.wtFlags */)) |= U16((TERM_CODED | TERM_VIRTUAL)) // Disable the original
+ pTerm = (*WhereClause)(unsafe.Pointer(pWC)).Fa + uintptr(idxTerm)*48
+ *(*U16)(unsafe.Pointer(pTerm + 10)) |= U16(TERM_CODED | TERM_VIRTUAL) // Disable the original
(*WhereTerm)(unsafe.Pointer(pTerm)).FeOperator = U16(0)
- } else if (((((int32((*Expr)(unsafe.Pointer(pExpr)).Fop) == TK_IN) &&
- (*(*int32)(unsafe.Pointer((pTerm + 24 /* &.u */ /* &.x */) + 4 /* &.iField */)) == 0)) &&
- (int32((*Expr)(unsafe.Pointer((*Expr)(unsafe.Pointer(pExpr)).FpLeft)).Fop) == TK_VECTOR)) &&
- ((*Select)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pExpr + 20 /* &.x */)))).FpPrior == uintptr(0))) &&
- ((*Select)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pExpr + 20 /* &.x */)))).FpWin == uintptr(0))) &&
- (int32((*WhereClause)(unsafe.Pointer(pWC)).Fop) == TK_AND) {
+ } else if int32((*Expr)(unsafe.Pointer(pExpr)).Fop) == TK_IN &&
+ *(*int32)(unsafe.Pointer(pTerm + 24 + 4)) == 0 &&
+ int32((*Expr)(unsafe.Pointer((*Expr)(unsafe.Pointer(pExpr)).FpLeft)).Fop) == TK_VECTOR &&
+ (*Expr)(unsafe.Pointer(pExpr)).Fflags&U32(EP_xIsSelect) != U32(0) &&
+ (*Select)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pExpr + 20)))).FpPrior == uintptr(0) &&
+ (*Select)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pExpr + 20)))).FpWin == uintptr(0) &&
+ int32((*WhereClause)(unsafe.Pointer(pWC)).Fop) == TK_AND {
var i int32
for i = 0; i < Xsqlite3ExprVectorSize(tls, (*Expr)(unsafe.Pointer(pExpr)).FpLeft); i++ {
var idxNew int32
idxNew = whereClauseInsert(tls, pWC, pExpr, uint16(TERM_VIRTUAL))
- *(*int32)(unsafe.Pointer((*WhereClause)(unsafe.Pointer(pWC)).Fa + uintptr(idxNew)*48 + 24 /* &.u */ /* &.x */ + 4 /* &.iField */)) = (i + 1)
+ *(*int32)(unsafe.Pointer((*WhereClause)(unsafe.Pointer(pWC)).Fa + uintptr(idxNew)*48 + 24 + 4 /* &.iField */)) = i + 1
exprAnalyze(tls, pSrc, pWC, idxNew)
markTermAsChild(tls, pWC, idxNew, idxTerm)
}
@@ -130276,25 +132272,25 @@ func exprAnalyze(tls *libc.TLS, pSrc uintptr, pWC uintptr, idxTerm int32) { /* s
prereqExpr = Xsqlite3WhereExprUsage(tls, pMaskSet, *(*uintptr)(unsafe.Pointer(bp + 28 /* pRight */)))
prereqColumn = Xsqlite3WhereExprUsage(tls, pMaskSet, *(*uintptr)(unsafe.Pointer(bp + 24 /* pLeft */)))
- if (prereqExpr & prereqColumn) == uint64(0) {
+ if prereqExpr&prereqColumn == uint64(0) {
var pNewExpr uintptr
pNewExpr = Xsqlite3PExpr(tls, pParse, TK_MATCH,
uintptr(0), Xsqlite3ExprDup(tls, db, *(*uintptr)(unsafe.Pointer(bp + 28 /* pRight */)), 0))
- if (((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_FromJoin))) != U32(0)) && (pNewExpr != 0) {
- *(*U32)(unsafe.Pointer(pNewExpr + 4 /* &.flags */)) |= (U32(EP_FromJoin))
+ if (*Expr)(unsafe.Pointer(pExpr)).Fflags&U32(EP_FromJoin) != U32(0) && pNewExpr != 0 {
+ *(*U32)(unsafe.Pointer(pNewExpr + 4)) |= U32(EP_FromJoin)
(*Expr)(unsafe.Pointer(pNewExpr)).FiRightJoinTable = (*Expr)(unsafe.Pointer(pExpr)).FiRightJoinTable
}
- idxNew = whereClauseInsert(tls, pWC, pNewExpr, (uint16(TERM_VIRTUAL | TERM_DYNAMIC)))
+ idxNew = whereClauseInsert(tls, pWC, pNewExpr, uint16(TERM_VIRTUAL|TERM_DYNAMIC))
- pNewTerm = ((*WhereClause)(unsafe.Pointer(pWC)).Fa + uintptr(idxNew)*48)
+ pNewTerm = (*WhereClause)(unsafe.Pointer(pWC)).Fa + uintptr(idxNew)*48
(*WhereTerm)(unsafe.Pointer(pNewTerm)).FprereqRight = prereqExpr
(*WhereTerm)(unsafe.Pointer(pNewTerm)).FleftCursor = (*Expr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 24 /* pLeft */)))).FiTable
- *(*int32)(unsafe.Pointer(pNewTerm + 24 /* &.u */ /* &.x */ /* &.leftColumn */)) = int32((*Expr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 24 /* pLeft */)))).FiColumn)
+ *(*int32)(unsafe.Pointer(pNewTerm + 24)) = int32((*Expr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 24 /* pLeft */)))).FiColumn)
(*WhereTerm)(unsafe.Pointer(pNewTerm)).FeOperator = U16(WO_AUX)
(*WhereTerm)(unsafe.Pointer(pNewTerm)).FeMatchOp = *(*uint8)(unsafe.Pointer(bp + 20 /* eOp2 */))
markTermAsChild(tls, pWC, idxNew, idxTerm)
- pTerm = ((*WhereClause)(unsafe.Pointer(pWC)).Fa + uintptr(idxTerm)*48)
- *(*U16)(unsafe.Pointer(pTerm + 10 /* &.wtFlags */)) |= U16((TERM_COPIED))
+ pTerm = (*WhereClause)(unsafe.Pointer(pWC)).Fa + uintptr(idxTerm)*48
+ *(*U16)(unsafe.Pointer(pTerm + 10)) |= U16(TERM_COPIED)
(*WhereTerm)(unsafe.Pointer(pNewTerm)).FprereqAll = (*WhereTerm)(unsafe.Pointer(pTerm)).FprereqAll
}
{
@@ -130309,11 +132305,11 @@ func exprAnalyze(tls *libc.TLS, pSrc uintptr, pWC uintptr, idxTerm int32) { /* s
// Prevent ON clause terms of a LEFT JOIN from being used to drive
// an index for tables to the left of the join.
- pTerm = ((*WhereClause)(unsafe.Pointer(pWC)).Fa + uintptr(idxTerm)*48)
- *(*Bitmask)(unsafe.Pointer(pTerm + 32 /* &.prereqRight */)) |= (extraRight)
+ pTerm = (*WhereClause)(unsafe.Pointer(pWC)).Fa + uintptr(idxTerm)*48
+ *(*Bitmask)(unsafe.Pointer(pTerm + 32)) |= extraRight
}
-var ops = [2]U8{U8(TK_GE), U8(TK_LE)} /* sqlite3.c:148776:21 */
+var ops = [2]U8{U8(TK_GE), U8(TK_LE)} /* sqlite3.c:150143:21 */
// **************************************************************************
//
@@ -130336,7 +132332,7 @@ var ops = [2]U8{U8(TK_GE), U8(TK_LE)} /* sqlite3.c:148776:21 */
// In the previous sentence and in the diagram, "slot[]" refers to
// the WhereClause.a[] array. The slot[] array grows as needed to contain
// all terms of the WHERE clause.
-func Xsqlite3WhereSplit(tls *libc.TLS, pWC uintptr, pExpr uintptr, op U8) { /* sqlite3.c:149062:21: */
+func Xsqlite3WhereSplit(tls *libc.TLS, pWC uintptr, pExpr uintptr, op U8) { /* sqlite3.c:150436:21: */
var pE2 uintptr = Xsqlite3ExprSkipCollateAndLikely(tls, pExpr)
(*WhereClause)(unsafe.Pointer(pWC)).Fop = op
@@ -130352,36 +132348,36 @@ func Xsqlite3WhereSplit(tls *libc.TLS, pWC uintptr, pExpr uintptr, op U8) { /* s
}
// Initialize a preallocated WhereClause structure.
-func Xsqlite3WhereClauseInit(tls *libc.TLS, pWC uintptr, pWInfo uintptr) { /* sqlite3.c:149078:21: */
+func Xsqlite3WhereClauseInit(tls *libc.TLS, pWC uintptr, pWInfo uintptr) { /* sqlite3.c:150452:21: */
(*WhereClause)(unsafe.Pointer(pWC)).FpWInfo = pWInfo
(*WhereClause)(unsafe.Pointer(pWC)).FhasOr = U8(0)
(*WhereClause)(unsafe.Pointer(pWC)).FpOuter = uintptr(0)
(*WhereClause)(unsafe.Pointer(pWC)).FnTerm = 0
- (*WhereClause)(unsafe.Pointer(pWC)).FnSlot = (int32(uint32(unsafe.Sizeof([8]WhereTerm{})) / uint32(unsafe.Sizeof(WhereTerm{}))))
+ (*WhereClause)(unsafe.Pointer(pWC)).FnSlot = int32(uint32(unsafe.Sizeof([8]WhereTerm{})) / uint32(unsafe.Sizeof(WhereTerm{})))
(*WhereClause)(unsafe.Pointer(pWC)).Fa = pWC + 24 /* &.aStatic */
}
// Deallocate a WhereClause structure. The WhereClause structure
// itself is not freed. This routine is the inverse of
// sqlite3WhereClauseInit().
-func Xsqlite3WhereClauseClear(tls *libc.TLS, pWC uintptr) { /* sqlite3.c:149095:21: */
+func Xsqlite3WhereClauseClear(tls *libc.TLS, pWC uintptr) { /* sqlite3.c:150469:21: */
var i int32
var a uintptr
var db uintptr = (*Parse)(unsafe.Pointer((*WhereInfo)(unsafe.Pointer((*WhereClause)(unsafe.Pointer(pWC)).FpWInfo)).FpParse)).Fdb
- i = ((*WhereClause)(unsafe.Pointer(pWC)).FnTerm - 1)
+ i = (*WhereClause)(unsafe.Pointer(pWC)).FnTerm - 1
a = (*WhereClause)(unsafe.Pointer(pWC)).Fa
__1:
if !(i >= 0) {
goto __3
}
{
- if (int32((*WhereTerm)(unsafe.Pointer(a)).FwtFlags) & TERM_DYNAMIC) != 0 {
+ if int32((*WhereTerm)(unsafe.Pointer(a)).FwtFlags)&TERM_DYNAMIC != 0 {
Xsqlite3ExprDelete(tls, db, (*WhereTerm)(unsafe.Pointer(a)).FpExpr)
}
- if (int32((*WhereTerm)(unsafe.Pointer(a)).FwtFlags) & TERM_ORINFO) != 0 {
- whereOrInfoDelete(tls, db, *(*uintptr)(unsafe.Pointer(a + 24 /* &.u */)))
- } else if (int32((*WhereTerm)(unsafe.Pointer(a)).FwtFlags) & TERM_ANDINFO) != 0 {
- whereAndInfoDelete(tls, db, *(*uintptr)(unsafe.Pointer(a + 24 /* &.u */)))
+ if int32((*WhereTerm)(unsafe.Pointer(a)).FwtFlags)&TERM_ORINFO != 0 {
+ whereOrInfoDelete(tls, db, *(*uintptr)(unsafe.Pointer(a + 24)))
+ } else if int32((*WhereTerm)(unsafe.Pointer(a)).FwtFlags)&TERM_ANDINFO != 0 {
+ whereAndInfoDelete(tls, db, *(*uintptr)(unsafe.Pointer(a + 24)))
}
}
@@ -130393,7 +132389,7 @@ __2:
goto __3
__3:
;
- if (*WhereClause)(unsafe.Pointer(pWC)).Fa != pWC+24 /* &.aStatic */ {
+ if (*WhereClause)(unsafe.Pointer(pWC)).Fa != pWC+24 {
Xsqlite3DbFree(tls, db, (*WhereClause)(unsafe.Pointer(pWC)).Fa)
}
}
@@ -130401,11 +132397,11 @@ __3:
// These routines walk (recursively) an expression tree and generate
// a bitmask indicating which tables are used in that expression
// tree.
-func Xsqlite3WhereExprUsageNN(tls *libc.TLS, pMaskSet uintptr, p uintptr) Bitmask { /* sqlite3.c:149120:24: */
+func Xsqlite3WhereExprUsageNN(tls *libc.TLS, pMaskSet uintptr, p uintptr) Bitmask { /* sqlite3.c:150494:24: */
var mask Bitmask
- if (int32((*Expr)(unsafe.Pointer(p)).Fop) == TK_COLUMN) && !(((*Expr)(unsafe.Pointer((p))).Fflags & (U32(EP_FixedCol))) != U32(0)) {
+ if int32((*Expr)(unsafe.Pointer(p)).Fop) == TK_COLUMN && !((*Expr)(unsafe.Pointer(p)).Fflags&U32(EP_FixedCol) != U32(0)) {
return Xsqlite3WhereGetMask(tls, pMaskSet, (*Expr)(unsafe.Pointer(p)).FiTable)
- } else if ((*Expr)(unsafe.Pointer((p))).Fflags & (U32(EP_TokenOnly | EP_Leaf))) != U32(0) {
+ } else if (*Expr)(unsafe.Pointer(p)).Fflags&U32(EP_TokenOnly|EP_Leaf) != U32(0) {
return uint64(0)
}
@@ -130415,40 +132411,41 @@ func Xsqlite3WhereExprUsageNN(tls *libc.TLS, pMaskSet uintptr, p uintptr) Bitmas
mask = uint64(0)
}
if (*Expr)(unsafe.Pointer(p)).FpLeft != 0 {
- mask = mask | (Xsqlite3WhereExprUsageNN(tls, pMaskSet, (*Expr)(unsafe.Pointer(p)).FpLeft))
+ mask = mask | Xsqlite3WhereExprUsageNN(tls, pMaskSet, (*Expr)(unsafe.Pointer(p)).FpLeft)
}
if (*Expr)(unsafe.Pointer(p)).FpRight != 0 {
- mask = mask | (Xsqlite3WhereExprUsageNN(tls, pMaskSet, (*Expr)(unsafe.Pointer(p)).FpRight))
+ mask = mask | Xsqlite3WhereExprUsageNN(tls, pMaskSet, (*Expr)(unsafe.Pointer(p)).FpRight)
- } else if ((*Expr)(unsafe.Pointer((p))).Fflags & (U32(EP_xIsSelect))) != U32(0) {
- if ((*Expr)(unsafe.Pointer((p))).Fflags & (U32(EP_VarSelect))) != U32(0) {
+ } else if (*Expr)(unsafe.Pointer(p)).Fflags&U32(EP_xIsSelect) != U32(0) {
+ if (*Expr)(unsafe.Pointer(p)).Fflags&U32(EP_VarSelect) != U32(0) {
(*WhereMaskSet)(unsafe.Pointer(pMaskSet)).FbVarSelect = 1
}
- mask = mask | (exprSelectUsage(tls, pMaskSet, *(*uintptr)(unsafe.Pointer(p + 20 /* &.x */))))
- } else if *(*uintptr)(unsafe.Pointer(p + 20 /* &.x */)) != 0 {
- mask = mask | (Xsqlite3WhereExprListUsage(tls, pMaskSet, *(*uintptr)(unsafe.Pointer(p + 20 /* &.x */))))
+ mask = mask | exprSelectUsage(tls, pMaskSet, *(*uintptr)(unsafe.Pointer(p + 20)))
+ } else if *(*uintptr)(unsafe.Pointer(p + 20)) != 0 {
+ mask = mask | Xsqlite3WhereExprListUsage(tls, pMaskSet, *(*uintptr)(unsafe.Pointer(p + 20)))
}
- if ((int32((*Expr)(unsafe.Pointer(p)).Fop) == TK_FUNCTION) || (int32((*Expr)(unsafe.Pointer(p)).Fop) == TK_AGG_FUNCTION)) && (*(*uintptr)(unsafe.Pointer(p + 44 /* &.y */)) != 0) {
- mask = mask | (Xsqlite3WhereExprListUsage(tls, pMaskSet, (*Window)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(p + 44 /* &.y */)))).FpPartition))
- mask = mask | (Xsqlite3WhereExprListUsage(tls, pMaskSet, (*Window)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(p + 44 /* &.y */)))).FpOrderBy))
- mask = mask | (Xsqlite3WhereExprUsage(tls, pMaskSet, (*Window)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(p + 44 /* &.y */)))).FpFilter))
+ if (int32((*Expr)(unsafe.Pointer(p)).Fop) == TK_FUNCTION || int32((*Expr)(unsafe.Pointer(p)).Fop) == TK_AGG_FUNCTION) && (*Expr)(unsafe.Pointer(p)).Fflags&U32(EP_WinFunc) != U32(0) {
+
+ mask = mask | Xsqlite3WhereExprListUsage(tls, pMaskSet, (*Window)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(p + 44)))).FpPartition)
+ mask = mask | Xsqlite3WhereExprListUsage(tls, pMaskSet, (*Window)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(p + 44)))).FpOrderBy)
+ mask = mask | Xsqlite3WhereExprUsage(tls, pMaskSet, (*Window)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(p + 44)))).FpFilter)
}
return mask
}
-func Xsqlite3WhereExprUsage(tls *libc.TLS, pMaskSet uintptr, p uintptr) Bitmask { /* sqlite3.c:149148:24: */
+func Xsqlite3WhereExprUsage(tls *libc.TLS, pMaskSet uintptr, p uintptr) Bitmask { /* sqlite3.c:150523:24: */
if p != 0 {
return Xsqlite3WhereExprUsageNN(tls, pMaskSet, p)
}
return uint64(0)
}
-func Xsqlite3WhereExprListUsage(tls *libc.TLS, pMaskSet uintptr, pList uintptr) Bitmask { /* sqlite3.c:149151:24: */
+func Xsqlite3WhereExprListUsage(tls *libc.TLS, pMaskSet uintptr, pList uintptr) Bitmask { /* sqlite3.c:150526:24: */
var i int32
var mask Bitmask = uint64(0)
if pList != 0 {
for i = 0; i < (*ExprList)(unsafe.Pointer(pList)).FnExpr; i++ {
- mask = mask | (Xsqlite3WhereExprUsage(tls, pMaskSet, (*ExprList_item)(unsafe.Pointer((pList+8 /* &.a */)+uintptr(i)*20)).FpExpr))
+ mask = mask | Xsqlite3WhereExprUsage(tls, pMaskSet, (*ExprList_item)(unsafe.Pointer(pList+8+uintptr(i)*20)).FpExpr)
}
}
return mask
@@ -130460,9 +132457,9 @@ func Xsqlite3WhereExprListUsage(tls *libc.TLS, pMaskSet uintptr, pList uintptr)
// end of the WHERE clause. We do not want to analyze these new
// virtual terms, so start analyzing at the end and work forward
// so that the added virtual terms are never processed.
-func Xsqlite3WhereExprAnalyze(tls *libc.TLS, pTabList uintptr, pWC uintptr) { /* sqlite3.c:149171:21: */
+func Xsqlite3WhereExprAnalyze(tls *libc.TLS, pTabList uintptr, pWC uintptr) { /* sqlite3.c:150546:21: */
var i int32
- for i = ((*WhereClause)(unsafe.Pointer(pWC)).FnTerm - 1); i >= 0; i-- {
+ for i = (*WhereClause)(unsafe.Pointer(pWC)).FnTerm - 1; i >= 0; i-- {
exprAnalyze(tls, pTabList, pWC, i)
}
}
@@ -130472,7 +132469,7 @@ func Xsqlite3WhereExprAnalyze(tls *libc.TLS, pTabList uintptr, pWC uintptr) { /*
//
// Each function argument translates into an equality constraint against
// a HIDDEN column in the table.
-func Xsqlite3WhereTabFuncArgs(tls *libc.TLS, pParse uintptr, pItem uintptr, pWC uintptr) { /* sqlite3.c:149188:21: */
+func Xsqlite3WhereTabFuncArgs(tls *libc.TLS, pParse uintptr, pItem uintptr, pWC uintptr) { /* sqlite3.c:150563:21: */
bp := tls.Alloc(16)
defer tls.Free(16)
@@ -130482,22 +132479,22 @@ func Xsqlite3WhereTabFuncArgs(tls *libc.TLS, pParse uintptr, pItem uintptr, pWC
var pArgs uintptr
var pColRef uintptr
var pTerm uintptr
- if (int32(*(*uint16)(unsafe.Pointer((pItem + 36 /* &.fg */) + 4 /* &.isTabFunc */)) & 0x4 >> 2)) == 0 {
+ if int32(*(*uint16)(unsafe.Pointer(pItem + 36 + 4))&0x4>>2) == 0 {
return
}
pTab = (*SrcItem)(unsafe.Pointer(pItem)).FpTab
- pArgs = *(*uintptr)(unsafe.Pointer(pItem + 64 /* &.u1 */))
+ pArgs = *(*uintptr)(unsafe.Pointer(pItem + 64))
if pArgs == uintptr(0) {
return
}
for j = libc.AssignInt32(&k, 0); j < (*ExprList)(unsafe.Pointer(pArgs)).FnExpr; j++ {
var pRhs uintptr
- for (k < int32((*Table)(unsafe.Pointer(pTab)).FnCol)) && ((int32((*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FaCol+uintptr(k)*20)).FcolFlags) & COLFLAG_HIDDEN) == 0) {
+ for k < int32((*Table)(unsafe.Pointer(pTab)).FnCol) && int32((*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FaCol+uintptr(k)*16)).FcolFlags)&COLFLAG_HIDDEN == 0 {
k++
}
if k >= int32((*Table)(unsafe.Pointer(pTab)).FnCol) {
- Xsqlite3ErrorMsg(tls, pParse, ts+20176, /* "too many argumen..." */
+ Xsqlite3ErrorMsg(tls, pParse, ts+21473, /* "too many argumen..." */
libc.VaList(bp, (*Table)(unsafe.Pointer(pTab)).FzName, j))
return
}
@@ -130507,11 +132504,12 @@ func Xsqlite3WhereTabFuncArgs(tls *libc.TLS, pParse uintptr, pItem uintptr, pWC
}
(*Expr)(unsafe.Pointer(pColRef)).FiTable = (*SrcItem)(unsafe.Pointer(pItem)).FiCursor
(*Expr)(unsafe.Pointer(pColRef)).FiColumn = YnVar(libc.PostIncInt32(&k, 1))
- *(*uintptr)(unsafe.Pointer(pColRef + 44 /* &.y */)) = pTab
+
+ *(*uintptr)(unsafe.Pointer(pColRef + 44)) = pTab
pRhs = Xsqlite3PExpr(tls, pParse, TK_UPLUS,
- Xsqlite3ExprDup(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, (*ExprList_item)(unsafe.Pointer((pArgs+8 /* &.a */)+uintptr(j)*20)).FpExpr, 0), uintptr(0))
+ Xsqlite3ExprDup(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, (*ExprList_item)(unsafe.Pointer(pArgs+8+uintptr(j)*20)).FpExpr, 0), uintptr(0))
pTerm = Xsqlite3PExpr(tls, pParse, TK_EQ, pColRef, pRhs)
- if (int32((*SrcItem)(unsafe.Pointer(pItem)).Ffg.Fjointype) & JT_LEFT) != 0 {
+ if int32((*SrcItem)(unsafe.Pointer(pItem)).Ffg.Fjointype)&JT_LEFT != 0 {
Xsqlite3SetJoinExpr(tls, pTerm, (*SrcItem)(unsafe.Pointer(pItem)).FiCursor)
}
whereClauseInsert(tls, pWC, pTerm, uint16(TERM_DYNAMIC))
@@ -130549,7 +132547,7 @@ func Xsqlite3WhereTabFuncArgs(tls *libc.TLS, pParse uintptr, pItem uintptr, pWC
type HiddenIndexInfo1 = struct {
FpWC uintptr
FpParse uintptr
-} /* sqlite3.c:149258:9 */
+} /* sqlite3.c:150634:9 */
//************* End of whereexpr.c ******************************************
//************* Begin file where.c ******************************************
@@ -130579,16 +132577,16 @@ type HiddenIndexInfo1 = struct {
// This object is not an API and can be changed from one release to the
// next. As long as allocateIndexInfo() and sqlite3_vtab_collation()
// agree on the structure, all will be well.
-type HiddenIndexInfo = HiddenIndexInfo1 /* sqlite3.c:149258:32 */
+type HiddenIndexInfo = HiddenIndexInfo1 /* sqlite3.c:150634:32 */
// Return the estimated number of output rows from a WHERE clause
-func Xsqlite3WhereOutputRowCount(tls *libc.TLS, pWInfo uintptr) LogEst { /* sqlite3.c:149270:23: */
+func Xsqlite3WhereOutputRowCount(tls *libc.TLS, pWInfo uintptr) LogEst { /* sqlite3.c:150646:23: */
return (*WhereInfo)(unsafe.Pointer(pWInfo)).FnRowOut
}
// Return one of the WHERE_DISTINCT_xxxxx values to indicate how this
// WHERE clause returns outputs for DISTINCT processing.
-func Xsqlite3WhereIsDistinct(tls *libc.TLS, pWInfo uintptr) int32 { /* sqlite3.c:149278:20: */
+func Xsqlite3WhereIsDistinct(tls *libc.TLS, pWInfo uintptr) int32 { /* sqlite3.c:150654:20: */
return int32((*WhereInfo)(unsafe.Pointer(pWInfo)).FeDistinct)
}
@@ -130598,7 +132596,7 @@ func Xsqlite3WhereIsDistinct(tls *libc.TLS, pWInfo uintptr) int32 { /* sqlite3.c
// terms means that no sorting is needed at all. A return that
// is positive but less than the number of ORDER BY terms means that
// block sorting is required.
-func Xsqlite3WhereIsOrdered(tls *libc.TLS, pWInfo uintptr) int32 { /* sqlite3.c:149290:20: */
+func Xsqlite3WhereIsOrdered(tls *libc.TLS, pWInfo uintptr) int32 { /* sqlite3.c:150666:20: */
return int32((*WhereInfo)(unsafe.Pointer(pWInfo)).FnOBSat)
}
@@ -130623,14 +132621,14 @@ func Xsqlite3WhereIsOrdered(tls *libc.TLS, pWInfo uintptr) int32 { /* sqlite3.c:
// Returning the continuation the second inner loop is an optimization
// that might make the code run a little faster, but should not change
// the final answer.
-func Xsqlite3WhereOrderByLimitOptLabel(tls *libc.TLS, pWInfo uintptr) int32 { /* sqlite3.c:149317:20: */
+func Xsqlite3WhereOrderByLimitOptLabel(tls *libc.TLS, pWInfo uintptr) int32 { /* sqlite3.c:150693:20: */
var pInner uintptr
- if !((int32(*(*uint8)(unsafe.Pointer(pWInfo + 48 /* &.bOrderedInnerLoop */)) & 0x4 >> 2)) != 0) {
+ if !(int32(*(*uint8)(unsafe.Pointer(pWInfo + 48))&0x4>>2) != 0) {
// The ORDER BY LIMIT optimization does not apply. Jump to the
// continuation of the inner-most loop.
return (*WhereInfo)(unsafe.Pointer(pWInfo)).FiContinue
}
- pInner = ((pWInfo + 752 /* &.a */) + uintptr((int32((*WhereInfo)(unsafe.Pointer(pWInfo)).FnLevel)-1))*80)
+ pInner = pWInfo + 752 + uintptr(int32((*WhereInfo)(unsafe.Pointer(pWInfo)).FnLevel)-1)*80
return (*WhereLevel)(unsafe.Pointer(pInner)).FaddrNxt
}
@@ -130644,18 +132642,18 @@ func Xsqlite3WhereOrderByLimitOptLabel(tls *libc.TLS, pWInfo uintptr) int32 { /*
// Any extra OP_Goto that is coded here is an optimization. The
// correct answer should be obtained regardless. This OP_Goto just
// makes the answer appear faster.
-func Xsqlite3WhereMinMaxOptEarlyOut(tls *libc.TLS, v uintptr, pWInfo uintptr) { /* sqlite3.c:149340:21: */
+func Xsqlite3WhereMinMaxOptEarlyOut(tls *libc.TLS, v uintptr, pWInfo uintptr) { /* sqlite3.c:150716:21: */
var pInner uintptr
var i int32
- if !((int32(*(*uint8)(unsafe.Pointer(pWInfo + 48 /* &.bOrderedInnerLoop */)) & 0x4 >> 2)) != 0) {
+ if !(int32(*(*uint8)(unsafe.Pointer(pWInfo + 48))&0x4>>2) != 0) {
return
}
if int32((*WhereInfo)(unsafe.Pointer(pWInfo)).FnOBSat) == 0 {
return
}
- for i = (int32((*WhereInfo)(unsafe.Pointer(pWInfo)).FnLevel) - 1); i >= 0; i-- {
- pInner = ((pWInfo + 752 /* &.a */) + uintptr(i)*80)
- if ((*WhereLoop1)(unsafe.Pointer((*WhereLevel)(unsafe.Pointer(pInner)).FpWLoop)).FwsFlags & U32(WHERE_COLUMN_IN)) != U32(0) {
+ for i = int32((*WhereInfo)(unsafe.Pointer(pWInfo)).FnLevel) - 1; i >= 0; i-- {
+ pInner = pWInfo + 752 + uintptr(i)*80
+ if (*WhereLoop1)(unsafe.Pointer((*WhereLevel)(unsafe.Pointer(pInner)).FpWLoop)).FwsFlags&U32(WHERE_COLUMN_IN) != U32(0) {
Xsqlite3VdbeGoto(tls, v, (*WhereLevel)(unsafe.Pointer(pInner)).FaddrNxt)
return
}
@@ -130665,14 +132663,14 @@ func Xsqlite3WhereMinMaxOptEarlyOut(tls *libc.TLS, v uintptr, pWInfo uintptr) {
// Return the VDBE address or label to jump to in order to continue
// immediately with the next row of a WHERE clause.
-func Xsqlite3WhereContinueLabel(tls *libc.TLS, pWInfo uintptr) int32 { /* sqlite3.c:149359:20: */
+func Xsqlite3WhereContinueLabel(tls *libc.TLS, pWInfo uintptr) int32 { /* sqlite3.c:150735:20: */
return (*WhereInfo)(unsafe.Pointer(pWInfo)).FiContinue
}
// Return the VDBE address or label to jump to in order to break
// out of a WHERE loop.
-func Xsqlite3WhereBreakLabel(tls *libc.TLS, pWInfo uintptr) int32 { /* sqlite3.c:149368:20: */
+func Xsqlite3WhereBreakLabel(tls *libc.TLS, pWInfo uintptr) int32 { /* sqlite3.c:150744:20: */
return (*WhereInfo)(unsafe.Pointer(pWInfo)).FiBreak
}
@@ -130691,21 +132689,21 @@ func Xsqlite3WhereBreakLabel(tls *libc.TLS, pWInfo uintptr) int32 { /* sqlite3.c
//
// aiCur[0] and aiCur[1] both get -1 if the where-clause logic is
// unable to use the ONEPASS optimization.
-func Xsqlite3WhereOkOnePass(tls *libc.TLS, pWInfo uintptr, aiCur uintptr) int32 { /* sqlite3.c:149389:20: */
- libc.Xmemcpy(tls, aiCur, pWInfo+20 /* &.aiCurOnePass */, (uint32(unsafe.Sizeof(int32(0))) * uint32(2)))
+func Xsqlite3WhereOkOnePass(tls *libc.TLS, pWInfo uintptr, aiCur uintptr) int32 { /* sqlite3.c:150765:20: */
+ libc.Xmemcpy(tls, aiCur, pWInfo+20, uint32(unsafe.Sizeof(int32(0)))*uint32(2))
return int32((*WhereInfo)(unsafe.Pointer(pWInfo)).FeOnePass)
}
// Return TRUE if the WHERE loop uses the OP_DeferredSeek opcode to move
// the data cursor to the row selected by the index cursor.
-func Xsqlite3WhereUsesDeferredSeek(tls *libc.TLS, pWInfo uintptr) int32 { /* sqlite3.c:149405:20: */
- return (int32(*(*uint8)(unsafe.Pointer(pWInfo + 48 /* &.bDeferredSeek */)) & 0x1 >> 0))
+func Xsqlite3WhereUsesDeferredSeek(tls *libc.TLS, pWInfo uintptr) int32 { /* sqlite3.c:150781:20: */
+ return int32(*(*uint8)(unsafe.Pointer(pWInfo + 48)) & 0x1 >> 0)
}
// Move the content of pSrc into pDest
-func whereOrMove(tls *libc.TLS, pDest uintptr, pSrc uintptr) { /* sqlite3.c:149412:13: */
+func whereOrMove(tls *libc.TLS, pDest uintptr, pSrc uintptr) { /* sqlite3.c:150788:13: */
(*WhereOrSet)(unsafe.Pointer(pDest)).Fn = (*WhereOrSet)(unsafe.Pointer(pSrc)).Fn
- libc.Xmemcpy(tls, pDest+8 /* &.a */, pSrc+8 /* &.a */, (uint32((*WhereOrSet)(unsafe.Pointer(pDest)).Fn) * uint32(unsafe.Sizeof(WhereOrCost{}))))
+ libc.Xmemcpy(tls, pDest+8, pSrc+8, uint32((*WhereOrSet)(unsafe.Pointer(pDest)).Fn)*uint32(unsafe.Sizeof(WhereOrCost{})))
}
// Try to insert a new prerequisite/cost entry into the WhereOrSet pSet.
@@ -130713,7 +132711,7 @@ func whereOrMove(tls *libc.TLS, pDest uintptr, pSrc uintptr) { /* sqlite3.c:1494
// The new entry might overwrite an existing entry, or it might be
// appended, or it might be discarded. Do whatever is the right thing
// so that pSet keeps the N_OR_COST best entries seen so far.
-func whereOrInsert(tls *libc.TLS, pSet uintptr, prereq Bitmask, rRun LogEst, nOut LogEst) int32 { /* sqlite3.c:149424:12: */
+func whereOrInsert(tls *libc.TLS, pSet uintptr, prereq Bitmask, rRun LogEst, nOut LogEst) int32 { /* sqlite3.c:150800:12: */
var i U16
var p uintptr
i = (*WhereOrSet)(unsafe.Pointer(pSet)).Fn
@@ -130722,13 +132720,13 @@ __1:
if !(int32(i) > 0) {
goto __3
}
- if !((int32(rRun) <= int32((*WhereOrCost)(unsafe.Pointer(p)).FrRun)) && ((prereq & (*WhereOrCost)(unsafe.Pointer(p)).Fprereq) == prereq)) {
+ if !(int32(rRun) <= int32((*WhereOrCost)(unsafe.Pointer(p)).FrRun) && prereq&(*WhereOrCost)(unsafe.Pointer(p)).Fprereq == prereq) {
goto __4
}
goto whereOrInsert_done
__4:
;
- if !((int32((*WhereOrCost)(unsafe.Pointer(p)).FrRun) <= int32(rRun)) && (((*WhereOrCost)(unsafe.Pointer(p)).Fprereq & prereq) == (*WhereOrCost)(unsafe.Pointer(p)).Fprereq)) {
+ if !(int32((*WhereOrCost)(unsafe.Pointer(p)).FrRun) <= int32(rRun) && (*WhereOrCost)(unsafe.Pointer(p)).Fprereq&prereq == (*WhereOrCost)(unsafe.Pointer(p)).Fprereq) {
goto __5
}
return 0
@@ -130745,7 +132743,7 @@ __3:
if !(int32((*WhereOrSet)(unsafe.Pointer(pSet)).Fn) < N_OR_COST) {
goto __6
}
- p = ((pSet + 8 /* &.a */) + uintptr(libc.PostIncUint16(&(*WhereOrSet)(unsafe.Pointer(pSet)).Fn, 1))*16)
+ p = pSet + 8 + uintptr(libc.PostIncUint16(&(*WhereOrSet)(unsafe.Pointer(pSet)).Fn, 1))*16
(*WhereOrCost)(unsafe.Pointer(p)).FnOut = nOut
goto __7
__6:
@@ -130755,10 +132753,10 @@ __8:
if !(int32(i) < int32((*WhereOrSet)(unsafe.Pointer(pSet)).Fn)) {
goto __10
}
- if !(int32((*WhereOrCost)(unsafe.Pointer(p)).FrRun) > int32((*WhereOrCost)(unsafe.Pointer((pSet+8 /* &.a */)+uintptr(i)*16)).FrRun)) {
+ if !(int32((*WhereOrCost)(unsafe.Pointer(p)).FrRun) > int32((*WhereOrCost)(unsafe.Pointer(pSet+8+uintptr(i)*16)).FrRun)) {
goto __11
}
- p = ((pSet + 8 /* &.a */) + uintptr(i)*16)
+ p = pSet + 8 + uintptr(i)*16
__11:
;
goto __9
@@ -130790,12 +132788,12 @@ __13:
// Return the bitmask for the given cursor number. Return 0 if
// iCursor is not in the set.
-func Xsqlite3WhereGetMask(tls *libc.TLS, pMaskSet uintptr, iCursor int32) Bitmask { /* sqlite3.c:149461:24: */
+func Xsqlite3WhereGetMask(tls *libc.TLS, pMaskSet uintptr, iCursor int32) Bitmask { /* sqlite3.c:150837:24: */
var i int32
for i = 0; i < (*WhereMaskSet)(unsafe.Pointer(pMaskSet)).Fn; i++ {
- if *(*int32)(unsafe.Pointer((pMaskSet + 8 /* &.ix */) + uintptr(i)*4)) == iCursor {
- return (Bitmask((uint64(1))) << (i))
+ if *(*int32)(unsafe.Pointer(pMaskSet + 8 + uintptr(i)*4)) == iCursor {
+ return Bitmask(uint64(1)) << i
}
}
return uint64(0)
@@ -130807,16 +132805,16 @@ func Xsqlite3WhereGetMask(tls *libc.TLS, pMaskSet uintptr, iCursor int32) Bitmas
// tables in the FROM clause is limited by a test early in the
// sqlite3WhereBegin() routine. So we know that the pMaskSet->ix[]
// array will never overflow.
-func createMask(tls *libc.TLS, pMaskSet uintptr, iCursor int32) { /* sqlite3.c:149480:13: */
+func createMask(tls *libc.TLS, pMaskSet uintptr, iCursor int32) { /* sqlite3.c:150856:13: */
- *(*int32)(unsafe.Pointer((pMaskSet + 8 /* &.ix */) + uintptr(libc.PostIncInt32(&(*WhereMaskSet)(unsafe.Pointer(pMaskSet)).Fn, 1))*4)) = iCursor
+ *(*int32)(unsafe.Pointer(pMaskSet + 8 + uintptr(libc.PostIncInt32(&(*WhereMaskSet)(unsafe.Pointer(pMaskSet)).Fn, 1))*4)) = iCursor
}
// If the right-hand branch of the expression is a TK_COLUMN, then return
// a pointer to the right-hand branch. Otherwise, return NULL.
-func whereRightSubexprIsColumn(tls *libc.TLS, p uintptr) uintptr { /* sqlite3.c:149489:13: */
+func whereRightSubexprIsColumn(tls *libc.TLS, p uintptr) uintptr { /* sqlite3.c:150865:13: */
p = Xsqlite3ExprSkipCollateAndLikely(tls, (*Expr)(unsafe.Pointer(p)).FpRight)
- if ((p != uintptr(0)) && (int32((*Expr)(unsafe.Pointer(p)).Fop) == TK_COLUMN)) && !(((*Expr)(unsafe.Pointer((p))).Fflags & (U32(EP_FixedCol))) != U32(0)) {
+ if p != uintptr(0) && int32((*Expr)(unsafe.Pointer(p)).Fop) == TK_COLUMN && !((*Expr)(unsafe.Pointer(p)).Fflags&U32(EP_FixedCol) != U32(0)) {
return p
}
return uintptr(0)
@@ -130825,7 +132823,7 @@ func whereRightSubexprIsColumn(tls *libc.TLS, p uintptr) uintptr { /* sqlite3.c:
// Advance to the next WhereTerm that matches according to the criteria
// established when the pScan object was initialized by whereScanInit().
// Return NULL if there are no more matching WhereTerms.
-func whereScanNext(tls *libc.TLS, pScan uintptr) uintptr { /* sqlite3.c:149502:18: */
+func whereScanNext(tls *libc.TLS, pScan uintptr) uintptr { /* sqlite3.c:150878:18: */
var iCur int32 // The cursor on the LHS of the term
var iColumn I16 // The column on the LHS of the term. -1 for IPK
var pX uintptr // An expression being tested
@@ -130835,41 +132833,42 @@ func whereScanNext(tls *libc.TLS, pScan uintptr) uintptr { /* sqlite3.c:149502:1
pWC = (*WhereScan)(unsafe.Pointer(pScan)).FpWC
for 1 != 0 {
- iColumn = *(*I16)(unsafe.Pointer((pScan + 72 /* &.aiColumn */) + uintptr((int32((*WhereScan)(unsafe.Pointer(pScan)).FiEquiv)-1))*2))
- iCur = *(*int32)(unsafe.Pointer((pScan + 28 /* &.aiCur */) + uintptr((int32((*WhereScan)(unsafe.Pointer(pScan)).FiEquiv)-1))*4))
+ iColumn = *(*I16)(unsafe.Pointer(pScan + 72 + uintptr(int32((*WhereScan)(unsafe.Pointer(pScan)).FiEquiv)-1)*2))
+ iCur = *(*int32)(unsafe.Pointer(pScan + 28 + uintptr(int32((*WhereScan)(unsafe.Pointer(pScan)).FiEquiv)-1)*4))
- for ok := true; ok; ok = (pWC != uintptr(0)) {
- pTerm = ((*WhereClause)(unsafe.Pointer(pWC)).Fa + uintptr(k)*48)
+ for ok := true; ok; ok = pWC != uintptr(0) {
+ pTerm = (*WhereClause)(unsafe.Pointer(pWC)).Fa + uintptr(k)*48
__1:
if !(k < (*WhereClause)(unsafe.Pointer(pWC)).FnTerm) {
goto __3
}
{
- if ((((*WhereTerm)(unsafe.Pointer(pTerm)).FleftCursor == iCur) &&
- (*(*int32)(unsafe.Pointer((pTerm + 24 /* &.u */ /* &.x */) /* &.leftColumn */)) == int32(iColumn))) &&
- ((int32(iColumn) != (-2)) ||
- (Xsqlite3ExprCompareSkip(tls, (*Expr)(unsafe.Pointer((*WhereTerm)(unsafe.Pointer(pTerm)).FpExpr)).FpLeft,
- (*WhereScan)(unsafe.Pointer(pScan)).FpIdxExpr, iCur) == 0))) &&
- ((int32((*WhereScan)(unsafe.Pointer(pScan)).FiEquiv) <= 1) || !(((*Expr)(unsafe.Pointer(((*WhereTerm)(unsafe.Pointer(pTerm)).FpExpr))).Fflags & (U32(EP_FromJoin))) != U32(0))) {
- if (((int32((*WhereTerm)(unsafe.Pointer(pTerm)).FeOperator) & WO_EQUIV) != 0) &&
- (int32((*WhereScan)(unsafe.Pointer(pScan)).FnEquiv) < (int32(uint32(unsafe.Sizeof([11]int32{})) / uint32(unsafe.Sizeof(int32(0))))))) &&
- ((libc.AssignUintptr(&pX, whereRightSubexprIsColumn(tls, (*WhereTerm)(unsafe.Pointer(pTerm)).FpExpr))) != uintptr(0)) {
+
+ if (*WhereTerm)(unsafe.Pointer(pTerm)).FleftCursor == iCur &&
+ *(*int32)(unsafe.Pointer(pTerm + 24)) == int32(iColumn) &&
+ (int32(iColumn) != -2 ||
+ Xsqlite3ExprCompareSkip(tls, (*Expr)(unsafe.Pointer((*WhereTerm)(unsafe.Pointer(pTerm)).FpExpr)).FpLeft,
+ (*WhereScan)(unsafe.Pointer(pScan)).FpIdxExpr, iCur) == 0) &&
+ (int32((*WhereScan)(unsafe.Pointer(pScan)).FiEquiv) <= 1 || !((*Expr)(unsafe.Pointer((*WhereTerm)(unsafe.Pointer(pTerm)).FpExpr)).Fflags&U32(EP_FromJoin) != U32(0))) {
+ if int32((*WhereTerm)(unsafe.Pointer(pTerm)).FeOperator)&WO_EQUIV != 0 &&
+ int32((*WhereScan)(unsafe.Pointer(pScan)).FnEquiv) < int32(uint32(unsafe.Sizeof([11]int32{}))/uint32(unsafe.Sizeof(int32(0)))) &&
+ libc.AssignUintptr(&pX, whereRightSubexprIsColumn(tls, (*WhereTerm)(unsafe.Pointer(pTerm)).FpExpr)) != uintptr(0) {
var j int32
for j = 0; j < int32((*WhereScan)(unsafe.Pointer(pScan)).FnEquiv); j++ {
- if (*(*int32)(unsafe.Pointer((pScan + 28 /* &.aiCur */) + uintptr(j)*4)) == (*Expr)(unsafe.Pointer(pX)).FiTable) &&
- (int32(*(*I16)(unsafe.Pointer((pScan + 72 /* &.aiColumn */) + uintptr(j)*2))) == int32((*Expr)(unsafe.Pointer(pX)).FiColumn)) {
+ if *(*int32)(unsafe.Pointer(pScan + 28 + uintptr(j)*4)) == (*Expr)(unsafe.Pointer(pX)).FiTable &&
+ int32(*(*I16)(unsafe.Pointer(pScan + 72 + uintptr(j)*2))) == int32((*Expr)(unsafe.Pointer(pX)).FiColumn) {
break
}
}
if j == int32((*WhereScan)(unsafe.Pointer(pScan)).FnEquiv) {
- *(*int32)(unsafe.Pointer((pScan + 28 /* &.aiCur */) + uintptr(j)*4)) = (*Expr)(unsafe.Pointer(pX)).FiTable
- *(*I16)(unsafe.Pointer((pScan + 72 /* &.aiColumn */) + uintptr(j)*2)) = (*Expr)(unsafe.Pointer(pX)).FiColumn
+ *(*int32)(unsafe.Pointer(pScan + 28 + uintptr(j)*4)) = (*Expr)(unsafe.Pointer(pX)).FiTable
+ *(*I16)(unsafe.Pointer(pScan + 72 + uintptr(j)*2)) = (*Expr)(unsafe.Pointer(pX)).FiColumn
(*WhereScan)(unsafe.Pointer(pScan)).FnEquiv++
}
}
- if (U32((*WhereTerm)(unsafe.Pointer(pTerm)).FeOperator) & (*WhereScan)(unsafe.Pointer(pScan)).FopMask) != U32(0) {
+ if U32((*WhereTerm)(unsafe.Pointer(pTerm)).FeOperator)&(*WhereScan)(unsafe.Pointer(pScan)).FopMask != U32(0) {
// Verify the affinity and collating sequence match
- if ((*WhereScan)(unsafe.Pointer(pScan)).FzCollName != 0) && ((int32((*WhereTerm)(unsafe.Pointer(pTerm)).FeOperator) & WO_ISNULL) == 0) {
+ if (*WhereScan)(unsafe.Pointer(pScan)).FzCollName != 0 && int32((*WhereTerm)(unsafe.Pointer(pTerm)).FeOperator)&WO_ISNULL == 0 {
var pColl uintptr
var pParse uintptr = (*WhereInfo)(unsafe.Pointer((*WhereClause)(unsafe.Pointer(pWC)).FpWInfo)).FpParse
pX = (*WhereTerm)(unsafe.Pointer(pTerm)).FpExpr
@@ -130885,15 +132884,19 @@ func whereScanNext(tls *libc.TLS, pScan uintptr) uintptr { /* sqlite3.c:149502:1
goto __2
}
}
- if ((((int32((*WhereTerm)(unsafe.Pointer(pTerm)).FeOperator) & (WO_EQ | WO_IS)) != 0) &&
- (int32((*Expr)(unsafe.Pointer((libc.AssignUintptr(&pX, (*Expr)(unsafe.Pointer((*WhereTerm)(unsafe.Pointer(pTerm)).FpExpr)).FpRight)))).Fop) == TK_COLUMN)) &&
- ((*Expr)(unsafe.Pointer(pX)).FiTable == *(*int32)(unsafe.Pointer((pScan + 28 /* &.aiCur */))))) &&
- (int32((*Expr)(unsafe.Pointer(pX)).FiColumn) == int32(*(*I16)(unsafe.Pointer((pScan + 72 /* &.aiColumn */))))) {
+ if int32((*WhereTerm)(unsafe.Pointer(pTerm)).FeOperator)&(WO_EQ|WO_IS) != 0 &&
+ func() bool {
+ pX = (*Expr)(unsafe.Pointer((*WhereTerm)(unsafe.Pointer(pTerm)).FpExpr)).FpRight
+ return pX != uintptr(0)
+ }() &&
+ int32((*Expr)(unsafe.Pointer(pX)).Fop) == TK_COLUMN &&
+ (*Expr)(unsafe.Pointer(pX)).FiTable == *(*int32)(unsafe.Pointer(pScan + 28)) &&
+ int32((*Expr)(unsafe.Pointer(pX)).FiColumn) == int32(*(*I16)(unsafe.Pointer(pScan + 72))) {
goto __2
}
(*WhereScan)(unsafe.Pointer(pScan)).FpWC = pWC
- (*WhereScan)(unsafe.Pointer(pScan)).Fk = (k + 1)
+ (*WhereScan)(unsafe.Pointer(pScan)).Fk = k + 1
return pTerm
}
}
@@ -130924,7 +132927,7 @@ func whereScanNext(tls *libc.TLS, pScan uintptr) uintptr { /* sqlite3.c:149502:1
// It is factored out into a separate tail-recursion subroutine so that
// the normal whereScanInit() routine, which is a high-runner, does not
// need to push registers onto the stack as part of its prologue.
-func whereScanInitIndexExpr(tls *libc.TLS, pScan uintptr) uintptr { /* sqlite3.c:149601:34: */
+func whereScanInitIndexExpr(tls *libc.TLS, pScan uintptr) uintptr { /* sqlite3.c:150980:34: */
(*WhereScan)(unsafe.Pointer(pScan)).Fidxaff = Xsqlite3ExprAffinity(tls, (*WhereScan)(unsafe.Pointer(pScan)).FpIdxExpr)
return whereScanNext(tls, pScan)
}
@@ -130946,7 +132949,7 @@ func whereScanInitIndexExpr(tls *libc.TLS, pScan uintptr) uintptr { /* sqlite3.c
//
// If X is not the INTEGER PRIMARY KEY then X must be compatible with
// index pIdx.
-func whereScanInit(tls *libc.TLS, pScan uintptr, pWC uintptr, iCur int32, iColumn int32, opMask U32, pIdx uintptr) uintptr { /* sqlite3.c:149625:18: */
+func whereScanInit(tls *libc.TLS, pScan uintptr, pWC uintptr, iCur int32, iColumn int32, opMask U32, pIdx uintptr) uintptr { /* sqlite3.c:151004:18: */
(*WhereScan)(unsafe.Pointer(pScan)).FpOrigWC = pWC
(*WhereScan)(unsafe.Pointer(pScan)).FpWC = pWC
(*WhereScan)(unsafe.Pointer(pScan)).FpIdxExpr = uintptr(0)
@@ -130954,27 +132957,27 @@ func whereScanInit(tls *libc.TLS, pScan uintptr, pWC uintptr, iCur int32, iColum
(*WhereScan)(unsafe.Pointer(pScan)).FzCollName = uintptr(0)
(*WhereScan)(unsafe.Pointer(pScan)).FopMask = opMask
(*WhereScan)(unsafe.Pointer(pScan)).Fk = 0
- *(*int32)(unsafe.Pointer((pScan + 28 /* &.aiCur */))) = iCur
+ *(*int32)(unsafe.Pointer(pScan + 28)) = iCur
(*WhereScan)(unsafe.Pointer(pScan)).FnEquiv = uint8(1)
(*WhereScan)(unsafe.Pointer(pScan)).FiEquiv = uint8(1)
if pIdx != 0 {
var j int32 = iColumn
iColumn = int32(*(*I16)(unsafe.Pointer((*Index)(unsafe.Pointer(pIdx)).FaiColumn + uintptr(j)*2)))
- if iColumn == (-2) {
- (*WhereScan)(unsafe.Pointer(pScan)).FpIdxExpr = (*ExprList_item)(unsafe.Pointer(((*Index)(unsafe.Pointer(pIdx)).FaColExpr + 8 /* &.a */) + uintptr(j)*20)).FpExpr
+ if iColumn == -2 {
+ (*WhereScan)(unsafe.Pointer(pScan)).FpIdxExpr = (*ExprList_item)(unsafe.Pointer((*Index)(unsafe.Pointer(pIdx)).FaColExpr + 8 + uintptr(j)*20)).FpExpr
(*WhereScan)(unsafe.Pointer(pScan)).FzCollName = *(*uintptr)(unsafe.Pointer((*Index)(unsafe.Pointer(pIdx)).FazColl + uintptr(j)*4))
- *(*I16)(unsafe.Pointer((pScan + 72 /* &.aiColumn */))) = int16(-2)
+ *(*I16)(unsafe.Pointer(pScan + 72)) = int16(-2)
return whereScanInitIndexExpr(tls, pScan)
} else if iColumn == int32((*Table)(unsafe.Pointer((*Index)(unsafe.Pointer(pIdx)).FpTable)).FiPKey) {
iColumn = -1
} else if iColumn >= 0 {
- (*WhereScan)(unsafe.Pointer(pScan)).Fidxaff = (*Column)(unsafe.Pointer((*Table)(unsafe.Pointer((*Index)(unsafe.Pointer(pIdx)).FpTable)).FaCol + uintptr(iColumn)*20)).Faffinity
+ (*WhereScan)(unsafe.Pointer(pScan)).Fidxaff = (*Column)(unsafe.Pointer((*Table)(unsafe.Pointer((*Index)(unsafe.Pointer(pIdx)).FpTable)).FaCol + uintptr(iColumn)*16)).Faffinity
(*WhereScan)(unsafe.Pointer(pScan)).FzCollName = *(*uintptr)(unsafe.Pointer((*Index)(unsafe.Pointer(pIdx)).FazColl + uintptr(j)*4))
}
- } else if iColumn == (-2) {
+ } else if iColumn == -2 {
return uintptr(0)
}
- *(*I16)(unsafe.Pointer((pScan + 72 /* &.aiColumn */))) = I16(iColumn)
+ *(*I16)(unsafe.Pointer(pScan + 72)) = I16(iColumn)
return whereScanNext(tls, pScan)
}
@@ -131001,7 +133004,7 @@ func whereScanInit(tls *libc.TLS, pScan uintptr, pWC uintptr, iCur int32, iColum
// the form "X <op> Y" where Y is a column in another table if no terms of
// the form "X <op> <const-expr>" exist. If no terms with a constant RHS
// exist, try to return a term that does not use WO_EQUIV.
-func Xsqlite3WhereFindTerm(tls *libc.TLS, pWC uintptr, iCur int32, iColumn int32, notReady Bitmask, op U32, pIdx uintptr) uintptr { /* sqlite3.c:149689:26: */
+func Xsqlite3WhereFindTerm(tls *libc.TLS, pWC uintptr, iCur int32, iColumn int32, notReady Bitmask, op U32, pIdx uintptr) uintptr { /* sqlite3.c:151068:26: */
bp := tls.Alloc(96)
defer tls.Free(96)
@@ -131010,10 +133013,10 @@ func Xsqlite3WhereFindTerm(tls *libc.TLS, pWC uintptr, iCur int32, iColumn int32
// var scan WhereScan at bp, 96
p = whereScanInit(tls, bp /* &scan */, pWC, iCur, iColumn, op, pIdx)
- op = op & (U32(WO_EQ | WO_IS))
+ op = op & U32(WO_EQ|WO_IS)
for p != 0 {
- if ((*WhereTerm)(unsafe.Pointer(p)).FprereqRight & notReady) == uint64(0) {
- if ((*WhereTerm)(unsafe.Pointer(p)).FprereqRight == uint64(0)) && ((U32((*WhereTerm)(unsafe.Pointer(p)).FeOperator) & op) != U32(0)) {
+ if (*WhereTerm)(unsafe.Pointer(p)).FprereqRight&notReady == uint64(0) {
+ if (*WhereTerm)(unsafe.Pointer(p)).FprereqRight == uint64(0) && U32((*WhereTerm)(unsafe.Pointer(p)).FeOperator)&op != U32(0) {
return p
}
@@ -131031,17 +133034,17 @@ func Xsqlite3WhereFindTerm(tls *libc.TLS, pWC uintptr, iCur int32, iColumn int32
//
// If such an expression is found, its index in pList->a[] is returned. If
// no expression is found, -1 is returned.
-func findIndexCol(tls *libc.TLS, pParse uintptr, pList uintptr, iBase int32, pIdx uintptr, iCol int32) int32 { /* sqlite3.c:149723:12: */
+func findIndexCol(tls *libc.TLS, pParse uintptr, pList uintptr, iBase int32, pIdx uintptr, iCol int32) int32 { /* sqlite3.c:151102:12: */
var i int32
var zColl uintptr = *(*uintptr)(unsafe.Pointer((*Index)(unsafe.Pointer(pIdx)).FazColl + uintptr(iCol)*4))
for i = 0; i < (*ExprList)(unsafe.Pointer(pList)).FnExpr; i++ {
- var p uintptr = Xsqlite3ExprSkipCollateAndLikely(tls, (*ExprList_item)(unsafe.Pointer((pList+8 /* &.a */)+uintptr(i)*20)).FpExpr)
- if (((p != uintptr(0)) &&
- ((int32((*Expr)(unsafe.Pointer(p)).Fop) == TK_COLUMN) || (int32((*Expr)(unsafe.Pointer(p)).Fop) == TK_AGG_COLUMN))) &&
- (int32((*Expr)(unsafe.Pointer(p)).FiColumn) == int32(*(*I16)(unsafe.Pointer((*Index)(unsafe.Pointer(pIdx)).FaiColumn + uintptr(iCol)*2))))) &&
- ((*Expr)(unsafe.Pointer(p)).FiTable == iBase) {
- var pColl uintptr = Xsqlite3ExprNNCollSeq(tls, pParse, (*ExprList_item)(unsafe.Pointer((pList+8 /* &.a */)+uintptr(i)*20)).FpExpr)
+ var p uintptr = Xsqlite3ExprSkipCollateAndLikely(tls, (*ExprList_item)(unsafe.Pointer(pList+8+uintptr(i)*20)).FpExpr)
+ if p != uintptr(0) &&
+ (int32((*Expr)(unsafe.Pointer(p)).Fop) == TK_COLUMN || int32((*Expr)(unsafe.Pointer(p)).Fop) == TK_AGG_COLUMN) &&
+ int32((*Expr)(unsafe.Pointer(p)).FiColumn) == int32(*(*I16)(unsafe.Pointer((*Index)(unsafe.Pointer(pIdx)).FaiColumn + uintptr(iCol)*2))) &&
+ (*Expr)(unsafe.Pointer(p)).FiTable == iBase {
+ var pColl uintptr = Xsqlite3ExprNNCollSeq(tls, pParse, (*ExprList_item)(unsafe.Pointer(pList+8+uintptr(i)*20)).FpExpr)
if 0 == Xsqlite3StrICmp(tls, (*CollSeq)(unsafe.Pointer(pColl)).FzName, zColl) {
return i
}
@@ -131052,13 +133055,13 @@ func findIndexCol(tls *libc.TLS, pParse uintptr, pList uintptr, iBase int32, pId
}
// Return TRUE if the iCol-th column of index pIdx is NOT NULL
-func indexColumnNotNull(tls *libc.TLS, pIdx uintptr, iCol int32) int32 { /* sqlite3.c:149753:12: */
+func indexColumnNotNull(tls *libc.TLS, pIdx uintptr, iCol int32) int32 { /* sqlite3.c:151132:12: */
var j int32
j = int32(*(*I16)(unsafe.Pointer((*Index)(unsafe.Pointer(pIdx)).FaiColumn + uintptr(iCol)*2)))
if j >= 0 {
- return int32((*Column)(unsafe.Pointer((*Table)(unsafe.Pointer((*Index)(unsafe.Pointer(pIdx)).FpTable)).FaCol + uintptr(j)*20)).FnotNull)
- } else if j == (-1) {
+ return int32(*(*uint8)(unsafe.Pointer((*Table)(unsafe.Pointer((*Index)(unsafe.Pointer(pIdx)).FpTable)).FaCol + uintptr(j)*16 + 4)) & 0xf >> 0)
+ } else if j == -1 {
return 1
} else {
@@ -131073,7 +133076,7 @@ func indexColumnNotNull(tls *libc.TLS, pIdx uintptr, iCol int32) int32 { /* sqli
//
// A DISTINCT list is redundant if any subset of the columns in the
// DISTINCT list are collectively unique and individually non-null.
-func isDistinctRedundant(tls *libc.TLS, pParse uintptr, pTabList uintptr, pWC uintptr, pDistinct uintptr) int32 { /* sqlite3.c:149776:12: */
+func isDistinctRedundant(tls *libc.TLS, pParse uintptr, pTabList uintptr, pWC uintptr, pDistinct uintptr) int32 { /* sqlite3.c:151155:12: */
var pTab uintptr
var pIdx uintptr
var i int32
@@ -131085,21 +133088,21 @@ func isDistinctRedundant(tls *libc.TLS, pParse uintptr, pTabList uintptr, pWC ui
if (*SrcList)(unsafe.Pointer(pTabList)).FnSrc != 1 {
return 0
}
- iBase = (*SrcItem)(unsafe.Pointer((pTabList + 8 /* &.a */))).FiCursor
- pTab = (*SrcItem)(unsafe.Pointer((pTabList + 8 /* &.a */))).FpTab
+ iBase = (*SrcItem)(unsafe.Pointer(pTabList + 8)).FiCursor
+ pTab = (*SrcItem)(unsafe.Pointer(pTabList + 8)).FpTab
// If any of the expressions is an IPK column on table iBase, then return
// true. Note: The (p->iTable==iBase) part of this test may be false if the
// current SELECT is a correlated sub-query.
for i = 0; i < (*ExprList)(unsafe.Pointer(pDistinct)).FnExpr; i++ {
- var p uintptr = Xsqlite3ExprSkipCollateAndLikely(tls, (*ExprList_item)(unsafe.Pointer((pDistinct+8 /* &.a */)+uintptr(i)*20)).FpExpr)
+ var p uintptr = Xsqlite3ExprSkipCollateAndLikely(tls, (*ExprList_item)(unsafe.Pointer(pDistinct+8+uintptr(i)*20)).FpExpr)
if p == uintptr(0) {
continue
}
- if (int32((*Expr)(unsafe.Pointer(p)).Fop) != TK_COLUMN) && (int32((*Expr)(unsafe.Pointer(p)).Fop) != TK_AGG_COLUMN) {
+ if int32((*Expr)(unsafe.Pointer(p)).Fop) != TK_COLUMN && int32((*Expr)(unsafe.Pointer(p)).Fop) != TK_AGG_COLUMN {
continue
}
- if ((*Expr)(unsafe.Pointer(p)).FiTable == iBase) && (int32((*Expr)(unsafe.Pointer(p)).FiColumn) < 0) {
+ if (*Expr)(unsafe.Pointer(p)).FiTable == iBase && int32((*Expr)(unsafe.Pointer(p)).FiColumn) < 0 {
return 1
}
}
@@ -131117,7 +133120,7 @@ func isDistinctRedundant(tls *libc.TLS, pParse uintptr, pTabList uintptr, pWC ui
// 3. All of those index columns for which the WHERE clause does not
// contain a "col=X" term are subject to a NOT NULL constraint.
for pIdx = (*Table)(unsafe.Pointer(pTab)).FpIndex; pIdx != 0; pIdx = (*Index)(unsafe.Pointer(pIdx)).FpNext {
- if !(int32((*Index)(unsafe.Pointer((pIdx))).FonError) != OE_None) {
+ if !(int32((*Index)(unsafe.Pointer(pIdx)).FonError) != OE_None) {
continue
}
if (*Index)(unsafe.Pointer(pIdx)).FpPartIdxWhere != 0 {
@@ -131143,11 +133146,11 @@ func isDistinctRedundant(tls *libc.TLS, pParse uintptr, pTabList uintptr, pWC ui
}
// Estimate the logarithm of the input value to base 2.
-func estLog(tls *libc.TLS, N LogEst) LogEst { /* sqlite3.c:149840:15: */
+func estLog(tls *libc.TLS, N LogEst) LogEst { /* sqlite3.c:151219:15: */
if int32(N) <= 10 {
return int16(0)
}
- return (int16(int32(Xsqlite3LogEst(tls, uint64(N))) - 33))
+ return int16(int32(Xsqlite3LogEst(tls, uint64(N))) - 33)
}
// Convert OP_Column opcodes to OP_Copy in previously generated code.
@@ -131160,7 +133163,7 @@ func estLog(tls *libc.TLS, N LogEst) LogEst { /* sqlite3.c:149840:15: */
// cursor iTabCur are transformed into OP_Sequence opcode for the
// iAutoidxCur cursor, in order to generate unique rowids for the
// automatic index being generated.
-func translateColumnToCopy(tls *libc.TLS, pParse uintptr, iStart int32, iTabCur int32, iRegister int32, iAutoidxCur int32) { /* sqlite3.c:149856:13: */
+func translateColumnToCopy(tls *libc.TLS, pParse uintptr, iStart int32, iTabCur int32, iRegister int32, iAutoidxCur int32) { /* sqlite3.c:151235:13: */
var v uintptr = (*Parse)(unsafe.Pointer(pParse)).FpVdbe
var pOp uintptr = Xsqlite3VdbeGetOp(tls, v, iStart)
var iEnd int32 = Xsqlite3VdbeCurrentAddr(tls, v)
@@ -131177,7 +133180,7 @@ __1:
}
if int32((*VdbeOp)(unsafe.Pointer(pOp)).Fopcode) == OP_Column {
(*VdbeOp)(unsafe.Pointer(pOp)).Fopcode = U8(OP_Copy)
- (*VdbeOp)(unsafe.Pointer(pOp)).Fp1 = ((*VdbeOp)(unsafe.Pointer(pOp)).Fp2 + iRegister)
+ (*VdbeOp)(unsafe.Pointer(pOp)).Fp1 = (*VdbeOp)(unsafe.Pointer(pOp)).Fp2 + iRegister
(*VdbeOp)(unsafe.Pointer(pOp)).Fp2 = (*VdbeOp)(unsafe.Pointer(pOp)).Fp3
(*VdbeOp)(unsafe.Pointer(pOp)).Fp3 = 0
} else if int32((*VdbeOp)(unsafe.Pointer(pOp)).Fopcode) == OP_Rowid {
@@ -131203,29 +133206,30 @@ __3:
// Return TRUE if the WHERE clause term pTerm is of a form where it
// could be used with an index to access pSrc, assuming an appropriate
// index existed.
-func termCanDriveIndex(tls *libc.TLS, pTerm uintptr, pSrc uintptr, notReady Bitmask) int32 { /* sqlite3.c:149938:12: */
+func termCanDriveIndex(tls *libc.TLS, pTerm uintptr, pSrc uintptr, notReady Bitmask) int32 { /* sqlite3.c:151317:12: */
var aff uint8
if (*WhereTerm)(unsafe.Pointer(pTerm)).FleftCursor != (*SrcItem)(unsafe.Pointer(pSrc)).FiCursor {
return 0
}
- if (int32((*WhereTerm)(unsafe.Pointer(pTerm)).FeOperator) & (WO_EQ | WO_IS)) == 0 {
+ if int32((*WhereTerm)(unsafe.Pointer(pTerm)).FeOperator)&(WO_EQ|WO_IS) == 0 {
return 0
}
- if (((int32((*SrcItem)(unsafe.Pointer(pSrc)).Ffg.Fjointype) & JT_LEFT) != 0) &&
- !(((*Expr)(unsafe.Pointer(((*WhereTerm)(unsafe.Pointer(pTerm)).FpExpr))).Fflags & (U32(EP_FromJoin))) != U32(0))) &&
- ((int32((*WhereTerm)(unsafe.Pointer(pTerm)).FeOperator) & WO_IS) != 0) {
+ if int32((*SrcItem)(unsafe.Pointer(pSrc)).Ffg.Fjointype)&JT_LEFT != 0 &&
+ !((*Expr)(unsafe.Pointer((*WhereTerm)(unsafe.Pointer(pTerm)).FpExpr)).Fflags&U32(EP_FromJoin) != U32(0)) &&
+ int32((*WhereTerm)(unsafe.Pointer(pTerm)).FeOperator)&WO_IS != 0 {
// Cannot use an IS term from the WHERE clause as an index driver for
// the RHS of a LEFT JOIN. Such a term can only be used if it is from
// the ON clause.
return 0
}
- if ((*WhereTerm)(unsafe.Pointer(pTerm)).FprereqRight & notReady) != uint64(0) {
+ if (*WhereTerm)(unsafe.Pointer(pTerm)).FprereqRight&notReady != uint64(0) {
return 0
}
- if *(*int32)(unsafe.Pointer((pTerm + 24 /* &.u */ /* &.x */) /* &.leftColumn */)) < 0 {
+
+ if *(*int32)(unsafe.Pointer(pTerm + 24)) < 0 {
return 0
}
- aff = (*Column)(unsafe.Pointer((*Table)(unsafe.Pointer((*SrcItem)(unsafe.Pointer(pSrc)).FpTab)).FaCol + uintptr(*(*int32)(unsafe.Pointer(pTerm + 24 /* &.u */ /* &.x */ /* &.leftColumn */)))*20)).Faffinity
+ aff = (*Column)(unsafe.Pointer((*Table)(unsafe.Pointer((*SrcItem)(unsafe.Pointer(pSrc)).FpTab)).FaCol + uintptr(*(*int32)(unsafe.Pointer(pTerm + 24)))*16)).Faffinity
if !(Xsqlite3IndexAffinityOk(tls, (*WhereTerm)(unsafe.Pointer(pTerm)).FpExpr, aff) != 0) {
return 0
}
@@ -131236,7 +133240,7 @@ func termCanDriveIndex(tls *libc.TLS, pTerm uintptr, pSrc uintptr, notReady Bitm
// Generate code to construct the Index object for an automatic index
// and to set up the WhereLevel object pLevel so that the code generator
// makes use of the automatic index.
-func constructAutomaticIndex(tls *libc.TLS, pParse uintptr, pWC uintptr, pSrc uintptr, notReady Bitmask, pLevel uintptr) { /* sqlite3.c:149971:13: */
+func constructAutomaticIndex(tls *libc.TLS, pParse uintptr, pWC uintptr, pSrc uintptr, notReady Bitmask, pLevel uintptr) { /* sqlite3.c:151351:13: */
bp := tls.Alloc(20)
defer tls.Free(20)
@@ -131286,7 +133290,7 @@ func constructAutomaticIndex(tls *libc.TLS, pParse uintptr, pWC uintptr, pSrc ui
// and used to match WHERE clause constraints
nKeyCol = 0
pTable = (*SrcItem)(unsafe.Pointer(pSrc)).FpTab
- pWCEnd = ((*WhereClause)(unsafe.Pointer(pWC)).Fa + uintptr((*WhereClause)(unsafe.Pointer(pWC)).FnTerm)*48)
+ pWCEnd = (*WhereClause)(unsafe.Pointer(pWC)).Fa + uintptr((*WhereClause)(unsafe.Pointer(pWC)).FnTerm)*48
pLoop = (*WhereLevel)(unsafe.Pointer(pLevel)).FpWLoop
idxCols = uint64(0)
pTerm = (*WhereClause)(unsafe.Pointer(pWC)).Fa
@@ -131296,10 +133300,10 @@ __1:
}
pExpr = (*WhereTerm)(unsafe.Pointer(pTerm)).FpExpr
// table of a LEFT JOIN
- if !(((((*WhereLoop)(unsafe.Pointer(pLoop)).Fprereq == uint64(0)) &&
- ((int32((*WhereTerm)(unsafe.Pointer(pTerm)).FwtFlags) & TERM_VIRTUAL) == 0)) &&
- !(((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_FromJoin))) != U32(0))) &&
- (Xsqlite3ExprIsTableConstant(tls, pExpr, (*SrcItem)(unsafe.Pointer(pSrc)).FiCursor) != 0)) {
+ if !((*WhereLoop)(unsafe.Pointer(pLoop)).Fprereq == uint64(0) &&
+ int32((*WhereTerm)(unsafe.Pointer(pTerm)).FwtFlags)&TERM_VIRTUAL == 0 &&
+ !((*Expr)(unsafe.Pointer(pExpr)).Fflags&U32(EP_FromJoin) != U32(0)) &&
+ Xsqlite3ExprIsTableConstant(tls, pExpr, (*SrcItem)(unsafe.Pointer(pSrc)).FiCursor) != 0) {
goto __4
}
pPartial = Xsqlite3ExprAnd(tls, pParse, pPartial,
@@ -131309,33 +133313,34 @@ __4:
if !(termCanDriveIndex(tls, pTerm, pSrc, notReady) != 0) {
goto __5
}
- iCol = *(*int32)(unsafe.Pointer(pTerm + 24 /* &.u */ /* &.x */ /* &.leftColumn */))
- if iCol >= (int32(uint32(unsafe.Sizeof(Bitmask(0))) * uint32(8))) {
- cMask = (Bitmask((uint64(1))) << ((int32(uint32(unsafe.Sizeof(Bitmask(0))) * uint32(8))) - 1))
+
+ iCol = *(*int32)(unsafe.Pointer(pTerm + 24))
+ if iCol >= int32(uint32(unsafe.Sizeof(Bitmask(0)))*uint32(8)) {
+ cMask = Bitmask(uint64(1)) << (int32(uint32(unsafe.Sizeof(Bitmask(0)))*uint32(8)) - 1)
} else {
- cMask = (Bitmask((uint64(1))) << (iCol))
+ cMask = Bitmask(uint64(1)) << iCol
}
- if !(!(sentWarning != 0)) {
+ if !!(sentWarning != 0) {
goto __6
}
- Xsqlite3_log(tls, (SQLITE_WARNING | (int32(1) << 8)),
- ts+20212 /* "automatic index ..." */, libc.VaList(bp, (*Table)(unsafe.Pointer(pTable)).FzName,
- (*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTable)).FaCol+uintptr(iCol)*20)).FzName))
+ Xsqlite3_log(tls, SQLITE_WARNING|int32(1)<<8,
+ ts+21509 /* "automatic index ..." */, libc.VaList(bp, (*Table)(unsafe.Pointer(pTable)).FzName,
+ (*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTable)).FaCol+uintptr(iCol)*16)).FzCnName))
sentWarning = U8(1)
__6:
;
- if !((idxCols & cMask) == uint64(0)) {
+ if !(idxCols&cMask == uint64(0)) {
goto __7
}
- if !(whereLoopResize(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, pLoop, (nKeyCol+1)) != 0) {
+ if !(whereLoopResize(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, pLoop, nKeyCol+1) != 0) {
goto __8
}
goto end_auto_index_create
__8:
;
*(*uintptr)(unsafe.Pointer((*WhereLoop)(unsafe.Pointer(pLoop)).FaLTerm + uintptr(libc.PostIncInt32(&nKeyCol, 1))*4)) = pTerm
- idxCols = idxCols | (cMask)
+ idxCols = idxCols | cMask
__7:
;
__5:
@@ -131348,9 +133353,9 @@ __2:
__3:
;
- *(*U16)(unsafe.Pointer(pLoop + 24 /* &.u */ /* &.btree */ /* &.nEq */)) = libc.AssignPtrUint16(pLoop+40 /* &.nLTerm */, U16(nKeyCol))
- (*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags = (U32(((WHERE_COLUMN_EQ | WHERE_IDX_ONLY) | WHERE_INDEXED) |
- WHERE_AUTO_INDEX))
+ *(*U16)(unsafe.Pointer(pLoop + 24)) = libc.AssignPtrUint16(pLoop+40, U16(nKeyCol))
+ (*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags = U32(WHERE_COLUMN_EQ | WHERE_IDX_ONLY | WHERE_INDEXED |
+ WHERE_AUTO_INDEX)
// Count the number of additional columns needed to create a
// covering index. A "covering index" is an index that contains all
@@ -131359,10 +133364,10 @@ __3:
// be a covering index because the index will not be updated if the
// original table changes and the index and table cannot both be used
// if they go out of sync.
- extraCols = ((*SrcItem)(unsafe.Pointer(pSrc)).FcolUsed & (^idxCols | (Bitmask((uint64(1))) << ((int32(uint32(unsafe.Sizeof(Bitmask(0))) * uint32(8))) - 1))))
+ extraCols = (*SrcItem)(unsafe.Pointer(pSrc)).FcolUsed & (^idxCols | Bitmask(uint64(1))<<(int32(uint32(unsafe.Sizeof(Bitmask(0)))*uint32(8))-1))
mxBitCol = func() int32 {
- if ((int32(uint32(unsafe.Sizeof(Bitmask(0))) * uint32(8))) - 1) < (int32((*Table)(unsafe.Pointer(pTable)).FnCol)) {
- return ((int32(uint32(unsafe.Sizeof(Bitmask(0))) * uint32(8))) - 1)
+ if int32(uint32(unsafe.Sizeof(Bitmask(0)))*uint32(8))-1 < int32((*Table)(unsafe.Pointer(pTable)).FnCol) {
+ return int32(uint32(unsafe.Sizeof(Bitmask(0)))*uint32(8)) - 1
}
return int32((*Table)(unsafe.Pointer(pTable)).FnCol)
}()
@@ -131372,7 +133377,7 @@ __9:
if !(i < mxBitCol) {
goto __11
}
- if !((extraCols & (Bitmask((uint64(1))) << (i))) != 0) {
+ if !(extraCols&(Bitmask(uint64(1))<<i) != 0) {
goto __12
}
nKeyCol++
@@ -131385,23 +133390,23 @@ __10:
goto __11
__11:
;
- if !(((*SrcItem)(unsafe.Pointer(pSrc)).FcolUsed & (Bitmask((uint64(1))) << ((int32(uint32(unsafe.Sizeof(Bitmask(0))) * uint32(8))) - 1))) != 0) {
+ if !((*SrcItem)(unsafe.Pointer(pSrc)).FcolUsed&(Bitmask(uint64(1))<<(int32(uint32(unsafe.Sizeof(Bitmask(0)))*uint32(8))-1)) != 0) {
goto __13
}
- nKeyCol = nKeyCol + ((int32((*Table)(unsafe.Pointer(pTable)).FnCol) - (int32(uint32(unsafe.Sizeof(Bitmask(0))) * uint32(8)))) + 1)
+ nKeyCol = nKeyCol + (int32((*Table)(unsafe.Pointer(pTable)).FnCol) - int32(uint32(unsafe.Sizeof(Bitmask(0)))*uint32(8)) + 1)
__13:
;
// Construct the Index object to describe this index
- pIdx = Xsqlite3AllocateIndexObject(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, (int16(nKeyCol + 1)), 0, bp+16 /* &zNotUsed */)
+ pIdx = Xsqlite3AllocateIndexObject(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, int16(nKeyCol+1), 0, bp+16 /* &zNotUsed */)
if !(pIdx == uintptr(0)) {
goto __14
}
goto end_auto_index_create
__14:
;
- *(*uintptr)(unsafe.Pointer(pLoop + 24 /* &.u */ /* &.btree */ + 8 /* &.pIndex */)) = pIdx
- (*Index)(unsafe.Pointer(pIdx)).FzName = ts + 20238 /* "auto-index" */
+ *(*uintptr)(unsafe.Pointer(pLoop + 24 + 8 /* &.pIndex */)) = pIdx
+ (*Index)(unsafe.Pointer(pIdx)).FzName = ts + 21535 /* "auto-index" */
(*Index)(unsafe.Pointer(pIdx)).FpTable = pTable
n = 0
idxCols = uint64(0)
@@ -131413,19 +133418,20 @@ __15:
if !(termCanDriveIndex(tls, pTerm, pSrc, notReady) != 0) {
goto __18
}
- iCol1 = *(*int32)(unsafe.Pointer(pTerm + 24 /* &.u */ /* &.x */ /* &.leftColumn */))
- if iCol1 >= (int32(uint32(unsafe.Sizeof(Bitmask(0))) * uint32(8))) {
- cMask1 = (Bitmask((uint64(1))) << ((int32(uint32(unsafe.Sizeof(Bitmask(0))) * uint32(8))) - 1))
+
+ iCol1 = *(*int32)(unsafe.Pointer(pTerm + 24))
+ if iCol1 >= int32(uint32(unsafe.Sizeof(Bitmask(0)))*uint32(8)) {
+ cMask1 = Bitmask(uint64(1)) << (int32(uint32(unsafe.Sizeof(Bitmask(0)))*uint32(8)) - 1)
} else {
- cMask1 = (Bitmask((uint64(1))) << (iCol1))
+ cMask1 = Bitmask(uint64(1)) << iCol1
}
- if !((idxCols & cMask1) == uint64(0)) {
+ if !(idxCols&cMask1 == uint64(0)) {
goto __19
}
pX = (*WhereTerm)(unsafe.Pointer(pTerm)).FpExpr
- idxCols = idxCols | (cMask1)
- *(*I16)(unsafe.Pointer((*Index)(unsafe.Pointer(pIdx)).FaiColumn + uintptr(n)*2)) = I16(*(*int32)(unsafe.Pointer(pTerm + 24 /* &.u */ /* &.x */ /* &.leftColumn */)))
+ idxCols = idxCols | cMask1
+ *(*I16)(unsafe.Pointer((*Index)(unsafe.Pointer(pIdx)).FaiColumn + uintptr(n)*2)) = I16(*(*int32)(unsafe.Pointer(pTerm + 24)))
pColl = Xsqlite3ExprCompareCollSeq(tls, pParse, pX)
// TH3 collate01.800
*(*uintptr)(unsafe.Pointer((*Index)(unsafe.Pointer(pIdx)).FazColl + uintptr(n)*4)) = func() uintptr {
@@ -131454,7 +133460,7 @@ __20:
if !(i < mxBitCol) {
goto __22
}
- if !((extraCols & (Bitmask((uint64(1))) << (i))) != 0) {
+ if !(extraCols&(Bitmask(uint64(1))<<i) != 0) {
goto __23
}
*(*I16)(unsafe.Pointer((*Index)(unsafe.Pointer(pIdx)).FaiColumn + uintptr(n)*2)) = I16(i)
@@ -131469,10 +133475,10 @@ __21:
goto __22
__22:
;
- if !(((*SrcItem)(unsafe.Pointer(pSrc)).FcolUsed & (Bitmask((uint64(1))) << ((int32(uint32(unsafe.Sizeof(Bitmask(0))) * uint32(8))) - 1))) != 0) {
+ if !((*SrcItem)(unsafe.Pointer(pSrc)).FcolUsed&(Bitmask(uint64(1))<<(int32(uint32(unsafe.Sizeof(Bitmask(0)))*uint32(8))-1)) != 0) {
goto __24
}
- i = ((int32(uint32(unsafe.Sizeof(Bitmask(0))) * uint32(8))) - 1)
+ i = int32(uint32(unsafe.Sizeof(Bitmask(0)))*uint32(8)) - 1
__25:
if !(i < int32((*Table)(unsafe.Pointer(pTable)).FnCol)) {
goto __27
@@ -131496,12 +133502,12 @@ __24:
// Create the automatic index
(*WhereLevel)(unsafe.Pointer(pLevel)).FiIdxCur = libc.PostIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnTab, 1)
- Xsqlite3VdbeAddOp2(tls, v, OP_OpenAutoindex, (*WhereLevel)(unsafe.Pointer(pLevel)).FiIdxCur, (nKeyCol + 1))
+ Xsqlite3VdbeAddOp2(tls, v, OP_OpenAutoindex, (*WhereLevel)(unsafe.Pointer(pLevel)).FiIdxCur, nKeyCol+1)
Xsqlite3VdbeSetP4KeyInfo(tls, pParse, pIdx)
// Fill the automatic index with content
- pTabItem = (((*WhereInfo)(unsafe.Pointer((*WhereClause)(unsafe.Pointer(pWC)).FpWInfo)).FpTabList + 8 /* &.a */) + uintptr((*WhereLevel)(unsafe.Pointer(pLevel)).FiFrom)*72)
- if !((uint32(int32(*(*uint16)(unsafe.Pointer(pTabItem + 36 /* &.fg */ + 4 /* &.viaCoroutine */)) & 0x10 >> 4))) != 0) {
+ pTabItem = (*WhereInfo)(unsafe.Pointer((*WhereClause)(unsafe.Pointer(pWC)).FpWInfo)).FpTabList + 8 + uintptr((*WhereLevel)(unsafe.Pointer(pLevel)).FiFrom)*72
+ if !(uint32(int32(*(*uint16)(unsafe.Pointer(pTabItem + 36 + 4))&0x10>>4)) != 0) {
goto __28
}
regYield = (*SrcItem)(unsafe.Pointer(pTabItem)).FregReturn
@@ -131519,7 +133525,7 @@ __29:
}
iContinue = Xsqlite3VdbeMakeLabel(tls, pParse)
Xsqlite3ExprIfFalse(tls, pParse, pPartial, iContinue, SQLITE_JUMPIFNULL)
- *(*U32)(unsafe.Pointer(pLoop + 36 /* &.wsFlags */)) |= (U32(WHERE_PARTIALIDX))
+ *(*U32)(unsafe.Pointer(pLoop + 36)) |= U32(WHERE_PARTIALIDX)
__30:
;
regRecord = Xsqlite3GetTempReg(tls, pParse)
@@ -131533,18 +133539,18 @@ __30:
Xsqlite3VdbeResolveLabel(tls, v, iContinue)
__31:
;
- if !((uint32(int32(*(*uint16)(unsafe.Pointer(pTabItem + 36 /* &.fg */ + 4 /* &.viaCoroutine */)) & 0x10 >> 4))) != 0) {
+ if !(uint32(int32(*(*uint16)(unsafe.Pointer(pTabItem + 36 + 4))&0x10>>4)) != 0) {
goto __32
}
- Xsqlite3VdbeChangeP2(tls, v, addrCounter, (regBase + n))
+ Xsqlite3VdbeChangeP2(tls, v, addrCounter, regBase+n)
translateColumnToCopy(tls, pParse, addrTop, (*WhereLevel)(unsafe.Pointer(pLevel)).FiTabCur,
(*SrcItem)(unsafe.Pointer(pTabItem)).FregResult, (*WhereLevel)(unsafe.Pointer(pLevel)).FiIdxCur)
Xsqlite3VdbeGoto(tls, v, addrTop)
- libc.SetBitFieldPtr16Uint32(pTabItem+36 /* &.fg */ +4 /* &.viaCoroutine */, uint32(0), 4, 0x10)
+ libc.SetBitFieldPtr16Uint32(pTabItem+36+4, uint32(0), 4, 0x10)
goto __33
__32:
- Xsqlite3VdbeAddOp2(tls, v, OP_Next, (*WhereLevel)(unsafe.Pointer(pLevel)).FiTabCur, (addrTop + 1))
+ Xsqlite3VdbeAddOp2(tls, v, OP_Next, (*WhereLevel)(unsafe.Pointer(pLevel)).FiTabCur, addrTop+1)
Xsqlite3VdbeChangeP5(tls, v, uint16(SQLITE_STMTSTATUS_AUTOINDEX))
__33:
;
@@ -131561,7 +133567,7 @@ end_auto_index_create:
// Allocate and populate an sqlite3_index_info structure. It is the
// responsibility of the caller to eventually release the structure
// by passing the pointer returned by this function to sqlite3_free().
-func allocateIndexInfo(tls *libc.TLS, pParse uintptr, pWC uintptr, mUnusable Bitmask, pSrc uintptr, pOrderBy uintptr, pmNoOmit uintptr) uintptr { /* sqlite3.c:150178:27: */
+func allocateIndexInfo(tls *libc.TLS, pParse uintptr, pWC uintptr, mUnusable Bitmask, pSrc uintptr, pOrderBy uintptr, pmNoOmit uintptr) uintptr { /* sqlite3.c:151564:27: */
var i int32
var j int32
var nTerm int32
@@ -131586,14 +133592,14 @@ __1:
if (*WhereTerm)(unsafe.Pointer(pTerm)).FleftCursor != (*SrcItem)(unsafe.Pointer(pSrc)).FiCursor {
goto __2
}
- if ((*WhereTerm)(unsafe.Pointer(pTerm)).FprereqRight & mUnusable) != 0 {
+ if (*WhereTerm)(unsafe.Pointer(pTerm)).FprereqRight&mUnusable != 0 {
goto __2
}
- if (int32((*WhereTerm)(unsafe.Pointer(pTerm)).FeOperator) & libc.CplInt32(WO_EQUIV)) == 0 {
+ if int32((*WhereTerm)(unsafe.Pointer(pTerm)).FeOperator)&libc.CplInt32(WO_EQUIV) == 0 {
goto __2
}
- if (int32((*WhereTerm)(unsafe.Pointer(pTerm)).FwtFlags) & TERM_VNULL) != 0 {
+ if int32((*WhereTerm)(unsafe.Pointer(pTerm)).FwtFlags)&TERM_VNULL != 0 {
goto __2
}
@@ -131616,11 +133622,11 @@ __3:
if pOrderBy != 0 {
var n int32 = (*ExprList)(unsafe.Pointer(pOrderBy)).FnExpr
for i = 0; i < n; i++ {
- var pExpr uintptr = (*ExprList_item)(unsafe.Pointer((pOrderBy + 8 /* &.a */) + uintptr(i)*20)).FpExpr
- if (int32((*Expr)(unsafe.Pointer(pExpr)).Fop) != TK_COLUMN) || ((*Expr)(unsafe.Pointer(pExpr)).FiTable != (*SrcItem)(unsafe.Pointer(pSrc)).FiCursor) {
+ var pExpr uintptr = (*ExprList_item)(unsafe.Pointer(pOrderBy + 8 + uintptr(i)*20)).FpExpr
+ if int32((*Expr)(unsafe.Pointer(pExpr)).Fop) != TK_COLUMN || (*Expr)(unsafe.Pointer(pExpr)).FiTable != (*SrcItem)(unsafe.Pointer(pSrc)).FiCursor {
break
}
- if (int32((*ExprList_item)(unsafe.Pointer((pOrderBy+8 /* &.a */)+uintptr(i)*20)).FsortFlags) & KEYINFO_ORDER_BIGNULL) != 0 {
+ if int32((*ExprList_item)(unsafe.Pointer(pOrderBy+8+uintptr(i)*20)).FsortFlags)&KEYINFO_ORDER_BIGNULL != 0 {
break
}
}
@@ -131630,17 +133636,17 @@ __3:
}
// Allocate the sqlite3_index_info structure
- pIdxInfo = Xsqlite3DbMallocZero(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, (uint64(((uint32(unsafe.Sizeof(Sqlite3_index_info{})) +
- ((uint32(unsafe.Sizeof(sqlite3_index_constraint{})) + uint32(unsafe.Sizeof(sqlite3_index_constraint_usage{}))) * uint32(nTerm))) +
- (uint32(unsafe.Sizeof(sqlite3_index_orderby{})) * uint32(nOrderBy))) + uint32(unsafe.Sizeof(HiddenIndexInfo1{})))))
+ pIdxInfo = Xsqlite3DbMallocZero(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, uint64(uint32(unsafe.Sizeof(Sqlite3_index_info{}))+
+ (uint32(unsafe.Sizeof(sqlite3_index_constraint{}))+uint32(unsafe.Sizeof(sqlite3_index_constraint_usage{})))*uint32(nTerm)+
+ uint32(unsafe.Sizeof(sqlite3_index_orderby{}))*uint32(nOrderBy)+uint32(unsafe.Sizeof(HiddenIndexInfo1{}))))
if pIdxInfo == uintptr(0) {
- Xsqlite3ErrorMsg(tls, pParse, ts+5181 /* "out of memory" */, 0)
+ Xsqlite3ErrorMsg(tls, pParse, ts+6028 /* "out of memory" */, 0)
return uintptr(0)
}
- pHidden = (pIdxInfo + 1*72)
- pIdxCons = (pHidden + 1*8)
- pIdxOrderBy = (pIdxCons + uintptr(nTerm)*12)
- pUsage = (pIdxOrderBy + uintptr(nOrderBy)*8)
+ pHidden = pIdxInfo + 1*72
+ pIdxCons = pHidden + 1*8
+ pIdxOrderBy = pIdxCons + uintptr(nTerm)*12
+ pUsage = pIdxOrderBy + uintptr(nOrderBy)*8
(*Sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FnOrderBy = nOrderBy
(*Sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FaConstraint = pIdxCons
(*Sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FaOrderBy = pIdxOrderBy
@@ -131658,34 +133664,34 @@ __4:
if (*WhereTerm)(unsafe.Pointer(pTerm)).FleftCursor != (*SrcItem)(unsafe.Pointer(pSrc)).FiCursor {
goto __5
}
- if ((*WhereTerm)(unsafe.Pointer(pTerm)).FprereqRight & mUnusable) != 0 {
+ if (*WhereTerm)(unsafe.Pointer(pTerm)).FprereqRight&mUnusable != 0 {
goto __5
}
- if (int32((*WhereTerm)(unsafe.Pointer(pTerm)).FeOperator) & libc.CplInt32(WO_EQUIV)) == 0 {
+ if int32((*WhereTerm)(unsafe.Pointer(pTerm)).FeOperator)&libc.CplInt32(WO_EQUIV) == 0 {
goto __5
}
- if (int32((*WhereTerm)(unsafe.Pointer(pTerm)).FwtFlags) & TERM_VNULL) != 0 {
+ if int32((*WhereTerm)(unsafe.Pointer(pTerm)).FwtFlags)&TERM_VNULL != 0 {
goto __5
}
// tag-20191211-002: WHERE-clause constraints are not useful to the
// right-hand table of a LEFT JOIN. See tag-20191211-001 for the
// equivalent restriction for ordinary tables.
- if ((int32((*SrcItem)(unsafe.Pointer(pSrc)).Ffg.Fjointype) & JT_LEFT) != 0) &&
- !(((*Expr)(unsafe.Pointer(((*WhereTerm)(unsafe.Pointer(pTerm)).FpExpr))).Fflags & (U32(EP_FromJoin))) != U32(0)) {
+ if int32((*SrcItem)(unsafe.Pointer(pSrc)).Ffg.Fjointype)&JT_LEFT != 0 &&
+ !((*Expr)(unsafe.Pointer((*WhereTerm)(unsafe.Pointer(pTerm)).FpExpr)).Fflags&U32(EP_FromJoin) != U32(0)) {
goto __5
}
- (*sqlite3_index_constraint)(unsafe.Pointer(pIdxCons + uintptr(j)*12)).FiColumn = *(*int32)(unsafe.Pointer(pTerm + 24 /* &.u */ /* &.x */ /* &.leftColumn */))
+ (*sqlite3_index_constraint)(unsafe.Pointer(pIdxCons + uintptr(j)*12)).FiColumn = *(*int32)(unsafe.Pointer(pTerm + 24))
(*sqlite3_index_constraint)(unsafe.Pointer(pIdxCons + uintptr(j)*12)).FiTermOffset = i
- op = (U16(int32((*WhereTerm)(unsafe.Pointer(pTerm)).FeOperator) & WO_ALL))
+ op = U16(int32((*WhereTerm)(unsafe.Pointer(pTerm)).FeOperator) & WO_ALL)
if int32(op) == WO_IN {
op = U16(WO_EQ)
}
if int32(op) == WO_AUX {
(*sqlite3_index_constraint)(unsafe.Pointer(pIdxCons + uintptr(j)*12)).Fop = (*WhereTerm)(unsafe.Pointer(pTerm)).FeMatchOp
- } else if (int32(op) & (WO_ISNULL | WO_IS)) != 0 {
+ } else if int32(op)&(WO_ISNULL|WO_IS) != 0 {
if int32(op) == WO_ISNULL {
(*sqlite3_index_constraint)(unsafe.Pointer(pIdxCons + uintptr(j)*12)).Fop = uint8(SQLITE_INDEX_CONSTRAINT_ISNULL)
} else {
@@ -131697,17 +133703,17 @@ __4:
// the WO_ and SQLITE_INDEX_CONSTRAINT_ codes are identical. The
// following asserts verify this fact.
- if ((int32(op) & ((((int32(WO_EQ) << (TK_LT - TK_EQ)) | (int32(WO_EQ) << (TK_LE - TK_EQ))) | (int32(WO_EQ) << (TK_GT - TK_EQ))) | (int32(WO_EQ) << (TK_GE - TK_EQ)))) != 0) &&
- (Xsqlite3ExprIsVector(tls, (*Expr)(unsafe.Pointer((*WhereTerm)(unsafe.Pointer(pTerm)).FpExpr)).FpRight) != 0) {
+ if int32(op)&(int32(WO_EQ)<<(TK_LT-TK_EQ)|int32(WO_EQ)<<(TK_LE-TK_EQ)|int32(WO_EQ)<<(TK_GT-TK_EQ)|int32(WO_EQ)<<(TK_GE-TK_EQ)) != 0 &&
+ Xsqlite3ExprIsVector(tls, (*Expr)(unsafe.Pointer((*WhereTerm)(unsafe.Pointer(pTerm)).FpExpr)).FpRight) != 0 {
if j < 16 {
- mNoOmit = U16(int32(mNoOmit) | (int32(1) << j))
+ mNoOmit = U16(int32(mNoOmit) | int32(1)<<j)
}
- if int32(op) == (int32(WO_EQ) << (TK_LT - TK_EQ)) {
- (*sqlite3_index_constraint)(unsafe.Pointer(pIdxCons + uintptr(j)*12)).Fop = (uint8(int32(WO_EQ) << (TK_LE - TK_EQ)))
+ if int32(op) == int32(WO_EQ)<<(TK_LT-TK_EQ) {
+ (*sqlite3_index_constraint)(unsafe.Pointer(pIdxCons + uintptr(j)*12)).Fop = uint8(int32(WO_EQ) << (TK_LE - TK_EQ))
}
- if int32(op) == (int32(WO_EQ) << (TK_GT - TK_EQ)) {
- (*sqlite3_index_constraint)(unsafe.Pointer(pIdxCons + uintptr(j)*12)).Fop = (uint8(int32(WO_EQ) << (TK_GE - TK_EQ)))
+ if int32(op) == int32(WO_EQ)<<(TK_GT-TK_EQ) {
+ (*sqlite3_index_constraint)(unsafe.Pointer(pIdxCons + uintptr(j)*12)).Fop = uint8(int32(WO_EQ) << (TK_GE - TK_EQ))
}
}
}
@@ -131725,9 +133731,9 @@ __6:
;
(*Sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FnConstraint = j
for i = 0; i < nOrderBy; i++ {
- var pExpr uintptr = (*ExprList_item)(unsafe.Pointer((pOrderBy + 8 /* &.a */) + uintptr(i)*20)).FpExpr
+ var pExpr uintptr = (*ExprList_item)(unsafe.Pointer(pOrderBy + 8 + uintptr(i)*20)).FpExpr
(*sqlite3_index_orderby)(unsafe.Pointer(pIdxOrderBy + uintptr(i)*8)).FiColumn = int32((*Expr)(unsafe.Pointer(pExpr)).FiColumn)
- (*sqlite3_index_orderby)(unsafe.Pointer(pIdxOrderBy + uintptr(i)*8)).Fdesc = (uint8(int32((*ExprList_item)(unsafe.Pointer((pOrderBy+8 /* &.a */)+uintptr(i)*20)).FsortFlags) & KEYINFO_ORDER_DESC))
+ (*sqlite3_index_orderby)(unsafe.Pointer(pIdxOrderBy + uintptr(i)*8)).Fdesc = uint8(int32((*ExprList_item)(unsafe.Pointer(pOrderBy+8+uintptr(i)*20)).FsortFlags) & KEYINFO_ORDER_DESC)
}
*(*U16)(unsafe.Pointer(pmNoOmit)) = mNoOmit
@@ -131748,7 +133754,7 @@ __6:
// Whether or not an error is returned, it is the responsibility of the
// caller to eventually free p->idxStr if p->needToFreeIdxStr indicates
// that this is required.
-func vtabBestIndex(tls *libc.TLS, pParse uintptr, pTab uintptr, p uintptr) int32 { /* sqlite3.c:150333:12: */
+func vtabBestIndex(tls *libc.TLS, pParse uintptr, pTab uintptr, p uintptr) int32 { /* sqlite3.c:151721:12: */
bp := tls.Alloc(16)
defer tls.Free(16)
@@ -131759,13 +133765,13 @@ func vtabBestIndex(tls *libc.TLS, pParse uintptr, pTab uintptr, p uintptr) int32
f func(*libc.TLS, uintptr, uintptr) int32
})(unsafe.Pointer(&struct{ uintptr }{(*Sqlite3_module)(unsafe.Pointer((*Sqlite3_vtab)(unsafe.Pointer(pVtab)).FpModule)).FxBestIndex})).f(tls, pVtab, p)
- if (rc != SQLITE_OK) && (rc != SQLITE_CONSTRAINT) {
+ if rc != SQLITE_OK && rc != SQLITE_CONSTRAINT {
if rc == SQLITE_NOMEM {
Xsqlite3OomFault(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb)
} else if !(int32((*Sqlite3_vtab)(unsafe.Pointer(pVtab)).FzErrMsg) != 0) {
- Xsqlite3ErrorMsg(tls, pParse, ts+2790 /* "%s" */, libc.VaList(bp, Xsqlite3ErrStr(tls, rc)))
+ Xsqlite3ErrorMsg(tls, pParse, ts+3601 /* "%s" */, libc.VaList(bp, Xsqlite3ErrStr(tls, rc)))
} else {
- Xsqlite3ErrorMsg(tls, pParse, ts+2790 /* "%s" */, libc.VaList(bp+8, (*Sqlite3_vtab)(unsafe.Pointer(pVtab)).FzErrMsg))
+ Xsqlite3ErrorMsg(tls, pParse, ts+3601 /* "%s" */, libc.VaList(bp+8, (*Sqlite3_vtab)(unsafe.Pointer(pVtab)).FzErrMsg))
}
}
Xsqlite3_free(tls, (*Sqlite3_vtab)(unsafe.Pointer(pVtab)).FzErrMsg)
@@ -131784,7 +133790,7 @@ func vtabBestIndex(tls *libc.TLS, pParse uintptr, pTab uintptr, p uintptr) int32
// into the aSample[] array - it is an index into a virtual set of samples
// based on the contents of aSample[] and the number of fields in record
// pRec.
-func whereKeyStats(tls *libc.TLS, pParse uintptr, pIdx uintptr, pRec uintptr, roundUp int32, aStat uintptr) int32 { /* sqlite3.c:150370:12: */
+func whereKeyStats(tls *libc.TLS, pParse uintptr, pIdx uintptr, pRec uintptr, roundUp int32, aStat uintptr) int32 { /* sqlite3.c:151758:12: */
var aSample uintptr = (*Index)(unsafe.Pointer(pIdx)).FaSample
var iCol int32 // Index of required stats in anEq[] etc.
var i int32 // Index of first sample >= pRec
@@ -131842,41 +133848,41 @@ func whereKeyStats(tls *libc.TLS, pParse uintptr, pIdx uintptr, pRec uintptr, ro
// cause any problems.
nField = int32((*UnpackedRecord)(unsafe.Pointer(pRec)).FnField)
iCol = 0
- iSample = ((*Index)(unsafe.Pointer(pIdx)).FnSample * nField)
- for ok := true; ok; ok = ((res != 0) && (iMin < iSample)) {
+ iSample = (*Index)(unsafe.Pointer(pIdx)).FnSample * nField
+ for ok := true; ok; ok = res != 0 && iMin < iSample {
var iSamp int32 // Index in aSample[] of test sample
var n int32 // Number of fields in test sample
- iTest = ((iMin + iSample) / 2)
- iSamp = (iTest / nField)
+ iTest = (iMin + iSample) / 2
+ iSamp = iTest / nField
if iSamp > 0 {
// The proposed effective sample is a prefix of sample aSample[iSamp].
// Specifically, the shortest prefix of at least (1 + iTest%nField)
// fields that is greater than the previous effective sample.
- for n = ((iTest % nField) + 1); n < nField; n++ {
- if *(*TRowcnt)(unsafe.Pointer((*IndexSample)(unsafe.Pointer(aSample+uintptr((iSamp-1))*20)).FanLt + uintptr((n-1))*4)) != *(*TRowcnt)(unsafe.Pointer((*IndexSample)(unsafe.Pointer(aSample+uintptr(iSamp)*20)).FanLt + uintptr((n-1))*4)) {
+ for n = iTest%nField + 1; n < nField; n++ {
+ if *(*TRowcnt)(unsafe.Pointer((*IndexSample)(unsafe.Pointer(aSample+uintptr(iSamp-1)*20)).FanLt + uintptr(n-1)*4)) != *(*TRowcnt)(unsafe.Pointer((*IndexSample)(unsafe.Pointer(aSample+uintptr(iSamp)*20)).FanLt + uintptr(n-1)*4)) {
break
}
}
} else {
- n = (iTest + 1)
+ n = iTest + 1
}
(*UnpackedRecord)(unsafe.Pointer(pRec)).FnField = U16(n)
res = Xsqlite3VdbeRecordCompare(tls, (*IndexSample)(unsafe.Pointer(aSample+uintptr(iSamp)*20)).Fn, (*IndexSample)(unsafe.Pointer(aSample+uintptr(iSamp)*20)).Fp, pRec)
if res < 0 {
- iLower = (*(*TRowcnt)(unsafe.Pointer((*IndexSample)(unsafe.Pointer(aSample+uintptr(iSamp)*20)).FanLt + uintptr((n-1))*4)) + *(*TRowcnt)(unsafe.Pointer((*IndexSample)(unsafe.Pointer(aSample+uintptr(iSamp)*20)).FanEq + uintptr((n-1))*4)))
- iMin = (iTest + 1)
- } else if (res == 0) && (n < nField) {
- iLower = *(*TRowcnt)(unsafe.Pointer((*IndexSample)(unsafe.Pointer(aSample+uintptr(iSamp)*20)).FanLt + uintptr((n-1))*4))
- iMin = (iTest + 1)
+ iLower = *(*TRowcnt)(unsafe.Pointer((*IndexSample)(unsafe.Pointer(aSample+uintptr(iSamp)*20)).FanLt + uintptr(n-1)*4)) + *(*TRowcnt)(unsafe.Pointer((*IndexSample)(unsafe.Pointer(aSample+uintptr(iSamp)*20)).FanEq + uintptr(n-1)*4))
+ iMin = iTest + 1
+ } else if res == 0 && n < nField {
+ iLower = *(*TRowcnt)(unsafe.Pointer((*IndexSample)(unsafe.Pointer(aSample+uintptr(iSamp)*20)).FanLt + uintptr(n-1)*4))
+ iMin = iTest + 1
res = -1
} else {
iSample = iTest
- iCol = (n - 1)
+ iCol = n - 1
}
}
- i = (iSample / nField)
+ i = iSample / nField
if res == 0 {
// Record pRec is equal to sample i
@@ -131898,15 +133904,15 @@ func whereKeyStats(tls *libc.TLS, pParse uintptr, pIdx uintptr, pRec uintptr, ro
if iLower >= iUpper {
iGap = TRowcnt(0)
} else {
- iGap = (iUpper - iLower)
+ iGap = iUpper - iLower
}
if roundUp != 0 {
- iGap = ((iGap * TRowcnt(2)) / TRowcnt(3))
+ iGap = iGap * TRowcnt(2) / TRowcnt(3)
} else {
- iGap = (iGap / TRowcnt(3))
+ iGap = iGap / TRowcnt(3)
}
- *(*TRowcnt)(unsafe.Pointer(aStat)) = (iLower + iGap)
- *(*TRowcnt)(unsafe.Pointer(aStat + 1*4)) = *(*TRowcnt)(unsafe.Pointer((*Index)(unsafe.Pointer(pIdx)).FaAvgEq + uintptr((nField-1))*4))
+ *(*TRowcnt)(unsafe.Pointer(aStat)) = iLower + iGap
+ *(*TRowcnt)(unsafe.Pointer(aStat + 1*4)) = *(*TRowcnt)(unsafe.Pointer((*Index)(unsafe.Pointer(pIdx)).FaAvgEq + uintptr(nField-1)*4))
}
// Restore the pRec->nField value before returning.
@@ -131923,20 +133929,20 @@ func whereKeyStats(tls *libc.TLS, pParse uintptr, pIdx uintptr, pRec uintptr, ro
// then the return value is the likelihood multiplied by the number of
// input rows. Otherwise, this function assumes that an "IS NOT NULL" term
// has a likelihood of 0.50, and any other term a likelihood of 0.25.
-func whereRangeAdjust(tls *libc.TLS, pTerm uintptr, nNew LogEst) LogEst { /* sqlite3.c:150562:15: */
+func whereRangeAdjust(tls *libc.TLS, pTerm uintptr, nNew LogEst) LogEst { /* sqlite3.c:151950:15: */
var nRet LogEst = nNew
if pTerm != 0 {
if int32((*WhereTerm)(unsafe.Pointer(pTerm)).FtruthProb) <= 0 {
- nRet = LogEst(int32(nRet) + (int32((*WhereTerm)(unsafe.Pointer(pTerm)).FtruthProb)))
- } else if (int32((*WhereTerm)(unsafe.Pointer(pTerm)).FwtFlags) & TERM_VNULL) == 0 {
- nRet = int16(int32(nRet) - (20))
+ nRet = LogEst(int32(nRet) + int32((*WhereTerm)(unsafe.Pointer(pTerm)).FtruthProb))
+ } else if int32((*WhereTerm)(unsafe.Pointer(pTerm)).FwtFlags)&TERM_VNULL == 0 {
+ nRet = int16(int32(nRet) - 20)
}
}
return nRet
}
// Return the affinity for a single column of an index.
-func Xsqlite3IndexColumnAffinity(tls *libc.TLS, db uintptr, pIdx uintptr, iCol int32) uint8 { /* sqlite3.c:150579:21: */
+func Xsqlite3IndexColumnAffinity(tls *libc.TLS, db uintptr, pIdx uintptr, iCol int32) uint8 { /* sqlite3.c:151967:21: */
if !(int32((*Index)(unsafe.Pointer(pIdx)).FzColAff) != 0) {
if Xsqlite3IndexAffinityStr(tls, db, pIdx) == uintptr(0) {
@@ -131980,15 +133986,15 @@ func Xsqlite3IndexColumnAffinity(tls *libc.TLS, db uintptr, pIdx uintptr, iCol i
//
// If an error occurs, an SQLite error code is returned. Otherwise,
// SQLITE_OK.
-func whereRangeSkipScanEst(tls *libc.TLS, pParse uintptr, pLower uintptr, pUpper uintptr, pLoop uintptr, pbDone uintptr) int32 { /* sqlite3.c:150626:12: */
+func whereRangeSkipScanEst(tls *libc.TLS, pParse uintptr, pLower uintptr, pUpper uintptr, pLoop uintptr, pbDone uintptr) int32 { /* sqlite3.c:152014:12: */
bp := tls.Alloc(12)
defer tls.Free(12)
- var p uintptr = *(*uintptr)(unsafe.Pointer(pLoop + 24 /* &.u */ /* &.btree */ + 8 /* &.pIndex */))
- var nEq int32 = int32(*(*U16)(unsafe.Pointer(pLoop + 24 /* &.u */ /* &.btree */ /* &.nEq */)))
+ var p uintptr = *(*uintptr)(unsafe.Pointer(pLoop + 24 + 8 /* &.pIndex */))
+ var nEq int32 = int32(*(*U16)(unsafe.Pointer(pLoop + 24)))
var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb
var nLower int32 = -1
- var nUpper int32 = ((*Index)(unsafe.Pointer(p)).FnSample + 1)
+ var nUpper int32 = (*Index)(unsafe.Pointer(p)).FnSample + 1
var rc int32 = SQLITE_OK
var aff U8 = U8(Xsqlite3IndexColumnAffinity(tls, db, p, nEq))
var pColl uintptr
@@ -132002,34 +134008,34 @@ func whereRangeSkipScanEst(tls *libc.TLS, pParse uintptr, pLower uintptr, pUpper
rc = Xsqlite3Stat4ValueFromExpr(tls, pParse, (*Expr)(unsafe.Pointer((*WhereTerm)(unsafe.Pointer(pLower)).FpExpr)).FpRight, aff, bp /* &p1 */)
nLower = 0
}
- if (pUpper != 0) && (rc == SQLITE_OK) {
+ if pUpper != 0 && rc == SQLITE_OK {
rc = Xsqlite3Stat4ValueFromExpr(tls, pParse, (*Expr)(unsafe.Pointer((*WhereTerm)(unsafe.Pointer(pUpper)).FpExpr)).FpRight, aff, bp+4 /* &p2 */)
- if *(*uintptr)(unsafe.Pointer(bp + 4 /* p2 */)) != 0 {
+ if *(*uintptr)(unsafe.Pointer(bp + 4)) != 0 {
nUpper = 0
} else {
nUpper = (*Index)(unsafe.Pointer(p)).FnSample
}
}
- if (*(*uintptr)(unsafe.Pointer(bp /* p1 */)) != 0) || (*(*uintptr)(unsafe.Pointer(bp + 4 /* p2 */)) != 0) {
+ if *(*uintptr)(unsafe.Pointer(bp)) != 0 || *(*uintptr)(unsafe.Pointer(bp + 4)) != 0 {
var i int32
var nDiff int32
- for i = 0; (rc == SQLITE_OK) && (i < (*Index)(unsafe.Pointer(p)).FnSample); i++ {
+ for i = 0; rc == SQLITE_OK && i < (*Index)(unsafe.Pointer(p)).FnSample; i++ {
rc = Xsqlite3Stat4Column(tls, db, (*IndexSample)(unsafe.Pointer((*Index)(unsafe.Pointer(p)).FaSample+uintptr(i)*20)).Fp, (*IndexSample)(unsafe.Pointer((*Index)(unsafe.Pointer(p)).FaSample+uintptr(i)*20)).Fn, nEq, bp+8 /* &pVal */)
- if (rc == SQLITE_OK) && (*(*uintptr)(unsafe.Pointer(bp /* p1 */)) != 0) {
+ if rc == SQLITE_OK && *(*uintptr)(unsafe.Pointer(bp)) != 0 {
var res int32 = Xsqlite3MemCompare(tls, *(*uintptr)(unsafe.Pointer(bp /* p1 */)), *(*uintptr)(unsafe.Pointer(bp + 8 /* pVal */)), pColl)
if res >= 0 {
nLower++
}
}
- if (rc == SQLITE_OK) && (*(*uintptr)(unsafe.Pointer(bp + 4 /* p2 */)) != 0) {
+ if rc == SQLITE_OK && *(*uintptr)(unsafe.Pointer(bp + 4)) != 0 {
var res int32 = Xsqlite3MemCompare(tls, *(*uintptr)(unsafe.Pointer(bp + 4 /* p2 */)), *(*uintptr)(unsafe.Pointer(bp + 8 /* pVal */)), pColl)
if res >= 0 {
nUpper++
}
}
}
- nDiff = (nUpper - nLower)
+ nDiff = nUpper - nLower
if nDiff <= 0 {
nDiff = 1
}
@@ -132039,9 +134045,9 @@ func whereRangeSkipScanEst(tls *libc.TLS, pParse uintptr, pLower uintptr, pUpper
// method (assume that the scan visits 1/64 of the rows) for estimating
// the number of rows visited. Otherwise, estimate the number of rows
// using the method described in the header comment for this function.
- if ((nDiff != 1) || (pUpper == uintptr(0))) || (pLower == uintptr(0)) {
- var nAdjust int32 = (int32(Xsqlite3LogEst(tls, uint64((*Index)(unsafe.Pointer(p)).FnSample))) - int32(Xsqlite3LogEst(tls, uint64(nDiff))))
- *(*LogEst)(unsafe.Pointer(pLoop + 22 /* &.nOut */)) -= LogEst((nAdjust))
+ if nDiff != 1 || pUpper == uintptr(0) || pLower == uintptr(0) {
+ var nAdjust int32 = int32(Xsqlite3LogEst(tls, uint64((*Index)(unsafe.Pointer(p)).FnSample))) - int32(Xsqlite3LogEst(tls, uint64(nDiff)))
+ *(*LogEst)(unsafe.Pointer(pLoop + 22)) -= LogEst(nAdjust)
*(*int32)(unsafe.Pointer(pbDone)) = 1
}
@@ -132095,7 +134101,7 @@ func whereRangeSkipScanEst(tls *libc.TLS, pParse uintptr, pLower uintptr, pUpper
// used, a single range inequality reduces the search space by a factor of 4.
// and a pair of constraints (x>? AND x<?) reduces the expected number of
// rows visited by a factor of 64.
-func whereRangeScanEst(tls *libc.TLS, pParse uintptr, pBuilder uintptr, pLower uintptr, pUpper uintptr, pLoop uintptr) int32 { /* sqlite3.c:150738:12: */
+func whereRangeScanEst(tls *libc.TLS, pParse uintptr, pBuilder uintptr, pLower uintptr, pUpper uintptr, pLoop uintptr) int32 { /* sqlite3.c:152126:12: */
bp := tls.Alloc(24)
defer tls.Free(24)
@@ -132103,17 +134109,17 @@ func whereRangeScanEst(tls *libc.TLS, pParse uintptr, pBuilder uintptr, pLower u
var nOut int32 = int32((*WhereLoop)(unsafe.Pointer(pLoop)).FnOut)
var nNew LogEst
- var p uintptr = *(*uintptr)(unsafe.Pointer(pLoop + 24 /* &.u */ /* &.btree */ + 8 /* &.pIndex */))
- var nEq int32 = int32(*(*U16)(unsafe.Pointer(pLoop + 24 /* &.u */ /* &.btree */ /* &.nEq */)))
+ var p uintptr = *(*uintptr)(unsafe.Pointer(pLoop + 24 + 8 /* &.pIndex */))
+ var nEq int32 = int32(*(*U16)(unsafe.Pointer(pLoop + 24)))
- if (((*Index)(unsafe.Pointer(p)).FnSample > 0) && (nEq < (*Index)(unsafe.Pointer(p)).FnSampleCol)) &&
- (((*Sqlite3)(unsafe.Pointer(((*Parse)(unsafe.Pointer(pParse)).Fdb))).FdbOptFlags & (U32(SQLITE_Stat4))) == U32(0)) {
+ if (*Index)(unsafe.Pointer(p)).FnSample > 0 && nEq < (*Index)(unsafe.Pointer(p)).FnSampleCol &&
+ (*Sqlite3)(unsafe.Pointer((*Parse)(unsafe.Pointer(pParse)).Fdb)).FdbOptFlags&U32(SQLITE_Stat4) == U32(0) {
if nEq == (*WhereLoopBuilder)(unsafe.Pointer(pBuilder)).FnRecValid {
*(*uintptr)(unsafe.Pointer(bp + 8 /* pRec */)) = (*WhereLoopBuilder)(unsafe.Pointer(pBuilder)).FpRec
// var a [2]TRowcnt at bp, 8
- var nBtm int32 = int32(*(*U16)(unsafe.Pointer(pLoop + 24 /* &.u */ /* &.btree */ + 2 /* &.nBtm */)))
- var nTop int32 = int32(*(*U16)(unsafe.Pointer(pLoop + 24 /* &.u */ /* &.btree */ + 4 /* &.nTop */)))
+ var nBtm int32 = int32(*(*U16)(unsafe.Pointer(pLoop + 24 + 2 /* &.nBtm */)))
+ var nTop int32 = int32(*(*U16)(unsafe.Pointer(pLoop + 24 + 4 /* &.nTop */)))
// Variable iLower will be set to the estimate of the number of rows in
// the index that are less than the lower bound of the range query. The
@@ -132138,7 +134144,7 @@ func whereRangeScanEst(tls *libc.TLS, pParse uintptr, pBuilder uintptr, pLower u
var iLwrIdx int32 = -2 // aSample[] for the lower bound
var iUprIdx int32 = -1 // aSample[] for the upper bound
- if *(*uintptr)(unsafe.Pointer(bp + 8 /* pRec */)) != 0 {
+ if *(*uintptr)(unsafe.Pointer(bp + 8)) != 0 {
(*UnpackedRecord)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8 /* pRec */)))).FnField = U16((*WhereLoopBuilder)(unsafe.Pointer(pBuilder)).FnRecValid)
}
@@ -132151,7 +134157,7 @@ func whereRangeScanEst(tls *libc.TLS, pParse uintptr, pBuilder uintptr, pLower u
// have been requested when testing key $P in whereEqualScanEst().
whereKeyStats(tls, pParse, p, *(*uintptr)(unsafe.Pointer(bp + 8 /* pRec */)), 0, bp /* &a[0] */)
iLower = *(*TRowcnt)(unsafe.Pointer(bp /* &a[0] */))
- iUpper = (*(*TRowcnt)(unsafe.Pointer(bp /* &a[0] */)) + *(*TRowcnt)(unsafe.Pointer(bp /* &a[0] */ + 1*4)))
+ iUpper = *(*TRowcnt)(unsafe.Pointer(bp)) + *(*TRowcnt)(unsafe.Pointer(bp + 1*4))
}
if *(*U8)(unsafe.Pointer((*Index)(unsafe.Pointer(p)).FaSortOrder + uintptr(nEq))) != 0 {
@@ -132176,19 +134182,19 @@ func whereRangeScanEst(tls *libc.TLS, pParse uintptr, pBuilder uintptr, pLower u
// Values extracted from pExpr
var pExpr uintptr = (*Expr)(unsafe.Pointer((*WhereTerm)(unsafe.Pointer(pLower)).FpExpr)).FpRight
rc = Xsqlite3Stat4ProbeSetValue(tls, pParse, p, bp+8 /* &pRec */, pExpr, nBtm, nEq, bp+12 /* &n */)
- if (rc == SQLITE_OK) && (*(*int32)(unsafe.Pointer(bp + 12 /* n */)) != 0) {
+ if rc == SQLITE_OK && *(*int32)(unsafe.Pointer(bp + 12)) != 0 {
var iNew TRowcnt
- var mask U16 = (U16((int32(WO_EQ) << (TK_GT - TK_EQ)) | (int32(WO_EQ) << (TK_LE - TK_EQ))))
- if Xsqlite3ExprVectorSize(tls, pExpr) > *(*int32)(unsafe.Pointer(bp + 12 /* n */)) {
- mask = (U16((int32(WO_EQ) << (TK_LE - TK_EQ)) | (int32(WO_EQ) << (TK_LT - TK_EQ))))
+ var mask U16 = U16(int32(WO_EQ)<<(TK_GT-TK_EQ) | int32(WO_EQ)<<(TK_LE-TK_EQ))
+ if Xsqlite3ExprVectorSize(tls, pExpr) > *(*int32)(unsafe.Pointer(bp + 12)) {
+ mask = U16(int32(WO_EQ)<<(TK_LE-TK_EQ) | int32(WO_EQ)<<(TK_LT-TK_EQ))
}
iLwrIdx = whereKeyStats(tls, pParse, p, *(*uintptr)(unsafe.Pointer(bp + 8 /* pRec */)), 0, bp /* &a[0] */)
- iNew = (*(*TRowcnt)(unsafe.Pointer(bp /* &a[0] */)) + (func() uint32 {
- if (int32((*WhereTerm)(unsafe.Pointer(pLower)).FeOperator) & int32(mask)) != 0 {
- return *(*TRowcnt)(unsafe.Pointer(bp /* &a[0] */ + 1*4))
+ iNew = *(*TRowcnt)(unsafe.Pointer(bp)) + func() uint32 {
+ if int32((*WhereTerm)(unsafe.Pointer(pLower)).FeOperator)&int32(mask) != 0 {
+ return *(*TRowcnt)(unsafe.Pointer(bp + 1*4))
}
return uint32(0)
- }()))
+ }()
if iNew > iLower {
iLower = iNew
}
@@ -132203,19 +134209,19 @@ func whereRangeScanEst(tls *libc.TLS, pParse uintptr, pBuilder uintptr, pLower u
// Values extracted from pExpr
var pExpr uintptr = (*Expr)(unsafe.Pointer((*WhereTerm)(unsafe.Pointer(pUpper)).FpExpr)).FpRight
rc = Xsqlite3Stat4ProbeSetValue(tls, pParse, p, bp+8 /* &pRec */, pExpr, nTop, nEq, bp+16 /* &n */)
- if (rc == SQLITE_OK) && (*(*int32)(unsafe.Pointer(bp + 16 /* n */)) != 0) {
+ if rc == SQLITE_OK && *(*int32)(unsafe.Pointer(bp + 16)) != 0 {
var iNew TRowcnt
- var mask U16 = (U16((int32(WO_EQ) << (TK_GT - TK_EQ)) | (int32(WO_EQ) << (TK_LE - TK_EQ))))
- if Xsqlite3ExprVectorSize(tls, pExpr) > *(*int32)(unsafe.Pointer(bp + 16 /* n */)) {
- mask = (U16((int32(WO_EQ) << (TK_LE - TK_EQ)) | (int32(WO_EQ) << (TK_LT - TK_EQ))))
+ var mask U16 = U16(int32(WO_EQ)<<(TK_GT-TK_EQ) | int32(WO_EQ)<<(TK_LE-TK_EQ))
+ if Xsqlite3ExprVectorSize(tls, pExpr) > *(*int32)(unsafe.Pointer(bp + 16)) {
+ mask = U16(int32(WO_EQ)<<(TK_LE-TK_EQ) | int32(WO_EQ)<<(TK_LT-TK_EQ))
}
iUprIdx = whereKeyStats(tls, pParse, p, *(*uintptr)(unsafe.Pointer(bp + 8 /* pRec */)), 1, bp /* &a[0] */)
- iNew = (*(*TRowcnt)(unsafe.Pointer(bp /* &a[0] */)) + (func() uint32 {
- if (int32((*WhereTerm)(unsafe.Pointer(pUpper)).FeOperator) & int32(mask)) != 0 {
- return *(*TRowcnt)(unsafe.Pointer(bp /* &a[0] */ + 1*4))
+ iNew = *(*TRowcnt)(unsafe.Pointer(bp)) + func() uint32 {
+ if int32((*WhereTerm)(unsafe.Pointer(pUpper)).FeOperator)&int32(mask) != 0 {
+ return *(*TRowcnt)(unsafe.Pointer(bp + 1*4))
}
return uint32(0)
- }()))
+ }()
if iNew < iUpper {
iUpper = iNew
}
@@ -132227,13 +134233,13 @@ func whereRangeScanEst(tls *libc.TLS, pParse uintptr, pBuilder uintptr, pLower u
(*WhereLoopBuilder)(unsafe.Pointer(pBuilder)).FpRec = *(*uintptr)(unsafe.Pointer(bp + 8 /* pRec */))
if rc == SQLITE_OK {
if iUpper > iLower {
- nNew = Xsqlite3LogEst(tls, (uint64(iUpper - iLower)))
+ nNew = Xsqlite3LogEst(tls, uint64(iUpper-iLower))
// TUNING: If both iUpper and iLower are derived from the same
// sample, then assume they are 4x more selective. This brings
// the estimated selectivity more in line with what it would be
// if estimated without the use of STAT4 tables.
if iLwrIdx == iUprIdx {
- nNew = int16(int32(nNew) - (20))
+ nNew = int16(int32(nNew) - 20)
}
} else {
nNew = int16(10)
@@ -132246,7 +134252,7 @@ func whereRangeScanEst(tls *libc.TLS, pParse uintptr, pBuilder uintptr, pLower u
} else {
*(*int32)(unsafe.Pointer(bp + 20 /* bDone */)) = 0
rc = whereRangeSkipScanEst(tls, pParse, pLower, pUpper, pLoop, bp+20 /* &bDone */)
- if *(*int32)(unsafe.Pointer(bp + 20 /* bDone */)) != 0 {
+ if *(*int32)(unsafe.Pointer(bp + 20)) != 0 {
return rc
}
}
@@ -132261,11 +134267,11 @@ func whereRangeScanEst(tls *libc.TLS, pParse uintptr, pBuilder uintptr, pLower u
// range query (e.g. col > ?) is assumed to match 1/4 of the rows in the
// index. While a closed range (e.g. col BETWEEN ? AND ?) is estimated to
// match 1/64 of the index.
- if (((pLower != 0) && (int32((*WhereTerm)(unsafe.Pointer(pLower)).FtruthProb) > 0)) && (pUpper != 0)) && (int32((*WhereTerm)(unsafe.Pointer(pUpper)).FtruthProb) > 0) {
- nNew = int16(int32(nNew) - (20))
+ if pLower != 0 && int32((*WhereTerm)(unsafe.Pointer(pLower)).FtruthProb) > 0 && pUpper != 0 && int32((*WhereTerm)(unsafe.Pointer(pUpper)).FtruthProb) > 0 {
+ nNew = int16(int32(nNew) - 20)
}
- nOut = nOut - ((libc.Bool32(pLower != uintptr(0))) + (libc.Bool32(pUpper != uintptr(0))))
+ nOut = nOut - (libc.Bool32(pLower != uintptr(0)) + libc.Bool32(pUpper != uintptr(0)))
if int32(nNew) < 10 {
nNew = int16(10)
}
@@ -132291,12 +134297,12 @@ func whereRangeScanEst(tls *libc.TLS, pParse uintptr, pBuilder uintptr, pLower u
// required for string comparison, or if unable to allocate memory
// for a UTF conversion required for comparison. The error is stored
// in the pParse structure.
-func whereEqualScanEst(tls *libc.TLS, pParse uintptr, pBuilder uintptr, pExpr uintptr, pnRow uintptr) int32 { /* sqlite3.c:150919:12: */
+func whereEqualScanEst(tls *libc.TLS, pParse uintptr, pBuilder uintptr, pExpr uintptr, pnRow uintptr) int32 { /* sqlite3.c:152307:12: */
bp := tls.Alloc(16)
defer tls.Free(16)
- var p uintptr = *(*uintptr)(unsafe.Pointer((*WhereLoopBuilder)(unsafe.Pointer(pBuilder)).FpNew + 24 /* &.u */ /* &.btree */ + 8 /* &.pIndex */))
- var nEq int32 = int32(*(*U16)(unsafe.Pointer((*WhereLoopBuilder)(unsafe.Pointer(pBuilder)).FpNew + 24 /* &.u */ /* &.btree */ /* &.nEq */)))
+ var p uintptr = *(*uintptr)(unsafe.Pointer((*WhereLoopBuilder)(unsafe.Pointer(pBuilder)).FpNew + 24 + 8 /* &.pIndex */))
+ var nEq int32 = int32(*(*U16)(unsafe.Pointer((*WhereLoopBuilder)(unsafe.Pointer(pBuilder)).FpNew + 24)))
*(*uintptr)(unsafe.Pointer(bp /* pRec */)) = (*WhereLoopBuilder)(unsafe.Pointer(pBuilder)).FpRec
var rc int32 // Subfunction return code
// var a [2]TRowcnt at bp+8, 8
@@ -132305,7 +134311,7 @@ func whereEqualScanEst(tls *libc.TLS, pParse uintptr, pBuilder uintptr, pExpr ui
// 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.
- if (*WhereLoopBuilder)(unsafe.Pointer(pBuilder)).FnRecValid < (nEq - 1) {
+ if (*WhereLoopBuilder)(unsafe.Pointer(pBuilder)).FnRecValid < nEq-1 {
return SQLITE_NOTFOUND
}
@@ -132316,12 +134322,12 @@ func whereEqualScanEst(tls *libc.TLS, pParse uintptr, pBuilder uintptr, pExpr ui
return SQLITE_OK
}
- rc = Xsqlite3Stat4ProbeSetValue(tls, pParse, p, bp /* &pRec */, pExpr, 1, (nEq - 1), bp+4 /* &bOk */)
+ rc = Xsqlite3Stat4ProbeSetValue(tls, pParse, p, bp /* &pRec */, pExpr, 1, nEq-1, bp+4 /* &bOk */)
(*WhereLoopBuilder)(unsafe.Pointer(pBuilder)).FpRec = *(*uintptr)(unsafe.Pointer(bp /* pRec */))
if rc != SQLITE_OK {
return rc
}
- if *(*int32)(unsafe.Pointer(bp + 4 /* bOk */)) == 0 {
+ if *(*int32)(unsafe.Pointer(bp + 4)) == 0 {
return SQLITE_NOTFOUND
}
(*WhereLoopBuilder)(unsafe.Pointer(pBuilder)).FnRecValid = nEq
@@ -132347,11 +134353,11 @@ func whereEqualScanEst(tls *libc.TLS, pParse uintptr, pBuilder uintptr, pExpr ui
// required for string comparison, or if unable to allocate memory
// for a UTF conversion required for comparison. The error is stored
// in the pParse structure.
-func whereInScanEst(tls *libc.TLS, pParse uintptr, pBuilder uintptr, pList uintptr, pnRow uintptr) int32 { /* sqlite3.c:150983:12: */
+func whereInScanEst(tls *libc.TLS, pParse uintptr, pBuilder uintptr, pList uintptr, pnRow uintptr) int32 { /* sqlite3.c:152371:12: */
bp := tls.Alloc(4)
defer tls.Free(4)
- var p uintptr = *(*uintptr)(unsafe.Pointer((*WhereLoopBuilder)(unsafe.Pointer(pBuilder)).FpNew + 24 /* &.u */ /* &.btree */ + 8 /* &.pIndex */))
+ var p uintptr = *(*uintptr)(unsafe.Pointer((*WhereLoopBuilder)(unsafe.Pointer(pBuilder)).FpNew + 24 + 8 /* &.pIndex */))
var nRow0 I64 = I64(Xsqlite3LogEstToInt(tls, *(*LogEst)(unsafe.Pointer((*Index)(unsafe.Pointer(p)).FaiRowLogEst))))
var nRecValid int32 = (*WhereLoopBuilder)(unsafe.Pointer(pBuilder)).FnRecValid
var rc int32 = SQLITE_OK // Subfunction return code
@@ -132360,10 +134366,10 @@ func whereInScanEst(tls *libc.TLS, pParse uintptr, pBuilder uintptr, pList uintp
var nRowEst TRowcnt = TRowcnt(0) // New estimate of the number of rows
var i int32 // Loop counter
- for i = 0; (rc == SQLITE_OK) && (i < (*ExprList)(unsafe.Pointer(pList)).FnExpr); i++ {
+ for i = 0; rc == SQLITE_OK && i < (*ExprList)(unsafe.Pointer(pList)).FnExpr; i++ {
*(*TRowcnt)(unsafe.Pointer(bp /* nEst */)) = TRowcnt(nRow0)
- rc = whereEqualScanEst(tls, pParse, pBuilder, (*ExprList_item)(unsafe.Pointer((pList+8 /* &.a */)+uintptr(i)*20)).FpExpr, bp /* &nEst */)
- nRowEst = nRowEst + (*(*TRowcnt)(unsafe.Pointer(bp /* nEst */)))
+ rc = whereEqualScanEst(tls, pParse, pBuilder, (*ExprList_item)(unsafe.Pointer(pList+8+uintptr(i)*20)).FpExpr, bp /* &nEst */)
+ nRowEst = nRowEst + *(*TRowcnt)(unsafe.Pointer(bp))
(*WhereLoopBuilder)(unsafe.Pointer(pBuilder)).FnRecValid = nRecValid
}
@@ -132380,31 +134386,31 @@ func whereInScanEst(tls *libc.TLS, pParse uintptr, pBuilder uintptr, pList uintp
// Convert bulk memory into a valid WhereLoop that can be passed
// to whereLoopClear harmlessly.
-func whereLoopInit(tls *libc.TLS, p uintptr) { /* sqlite3.c:151129:13: */
+func whereLoopInit(tls *libc.TLS, p uintptr) { /* sqlite3.c:152518:13: */
(*WhereLoop)(unsafe.Pointer(p)).FaLTerm = p + 56 /* &.aLTermSpace */
(*WhereLoop)(unsafe.Pointer(p)).FnLTerm = U16(0)
- (*WhereLoop)(unsafe.Pointer(p)).FnLSlot = U16((int32(uint32(unsafe.Sizeof([3]uintptr{})) / uint32(unsafe.Sizeof(uintptr(0))))))
+ (*WhereLoop)(unsafe.Pointer(p)).FnLSlot = U16(int32(uint32(unsafe.Sizeof([3]uintptr{})) / uint32(unsafe.Sizeof(uintptr(0)))))
(*WhereLoop)(unsafe.Pointer(p)).FwsFlags = U32(0)
}
// Clear the WhereLoop.u union. Leave WhereLoop.pLTerm intact.
-func whereLoopClearUnion(tls *libc.TLS, db uintptr, p uintptr) { /* sqlite3.c:151139:13: */
- if ((*WhereLoop)(unsafe.Pointer(p)).FwsFlags & (U32(WHERE_VIRTUALTABLE | WHERE_AUTO_INDEX))) != 0 {
- if (((*WhereLoop)(unsafe.Pointer(p)).FwsFlags & U32(WHERE_VIRTUALTABLE)) != U32(0)) && (*(*U8)(unsafe.Pointer((p + 24 /* &.u */ /* &.vtab */) + 4 /* &.needFree */)) != 0) {
- Xsqlite3_free(tls, *(*uintptr)(unsafe.Pointer(p + 24 /* &.u */ /* &.vtab */ + 8 /* &.idxStr */)))
- *(*U8)(unsafe.Pointer(p + 24 /* &.u */ /* &.vtab */ + 4 /* &.needFree */)) = U8(0)
- *(*uintptr)(unsafe.Pointer(p + 24 /* &.u */ /* &.vtab */ + 8 /* &.idxStr */)) = uintptr(0)
- } else if (((*WhereLoop)(unsafe.Pointer(p)).FwsFlags & U32(WHERE_AUTO_INDEX)) != U32(0)) && (*(*uintptr)(unsafe.Pointer((p + 24 /* &.u */ /* &.btree */) + 8 /* &.pIndex */)) != uintptr(0)) {
- Xsqlite3DbFree(tls, db, (*Index)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(p + 24 /* &.u */ /* &.btree */ + 8 /* &.pIndex */)))).FzColAff)
- Xsqlite3DbFreeNN(tls, db, *(*uintptr)(unsafe.Pointer(p + 24 /* &.u */ /* &.btree */ + 8 /* &.pIndex */)))
- *(*uintptr)(unsafe.Pointer(p + 24 /* &.u */ /* &.btree */ + 8 /* &.pIndex */)) = uintptr(0)
+func whereLoopClearUnion(tls *libc.TLS, db uintptr, p uintptr) { /* sqlite3.c:152528:13: */
+ if (*WhereLoop)(unsafe.Pointer(p)).FwsFlags&U32(WHERE_VIRTUALTABLE|WHERE_AUTO_INDEX) != 0 {
+ if (*WhereLoop)(unsafe.Pointer(p)).FwsFlags&U32(WHERE_VIRTUALTABLE) != U32(0) && *(*U8)(unsafe.Pointer(p + 24 + 4)) != 0 {
+ Xsqlite3_free(tls, *(*uintptr)(unsafe.Pointer(p + 24 + 8 /* &.idxStr */)))
+ *(*U8)(unsafe.Pointer(p + 24 + 4 /* &.needFree */)) = U8(0)
+ *(*uintptr)(unsafe.Pointer(p + 24 + 8 /* &.idxStr */)) = uintptr(0)
+ } else if (*WhereLoop)(unsafe.Pointer(p)).FwsFlags&U32(WHERE_AUTO_INDEX) != U32(0) && *(*uintptr)(unsafe.Pointer(p + 24 + 8)) != uintptr(0) {
+ Xsqlite3DbFree(tls, db, (*Index)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(p + 24 + 8 /* &.pIndex */)))).FzColAff)
+ Xsqlite3DbFreeNN(tls, db, *(*uintptr)(unsafe.Pointer(p + 24 + 8 /* &.pIndex */)))
+ *(*uintptr)(unsafe.Pointer(p + 24 + 8 /* &.pIndex */)) = uintptr(0)
}
}
}
// Deallocate internal memory used by a WhereLoop object
-func whereLoopClear(tls *libc.TLS, db uintptr, p uintptr) { /* sqlite3.c:151156:13: */
- if (*WhereLoop)(unsafe.Pointer(p)).FaLTerm != p+56 /* &.aLTermSpace */ {
+func whereLoopClear(tls *libc.TLS, db uintptr, p uintptr) { /* sqlite3.c:152545:13: */
+ if (*WhereLoop)(unsafe.Pointer(p)).FaLTerm != p+56 {
Xsqlite3DbFreeNN(tls, db, (*WhereLoop)(unsafe.Pointer(p)).FaLTerm)
}
whereLoopClearUnion(tls, db, p)
@@ -132412,18 +134418,18 @@ func whereLoopClear(tls *libc.TLS, db uintptr, p uintptr) { /* sqlite3.c:151156:
}
// Increase the memory allocation for pLoop->aLTerm[] to be at least n.
-func whereLoopResize(tls *libc.TLS, db uintptr, p uintptr, n int32) int32 { /* sqlite3.c:151165:12: */
+func whereLoopResize(tls *libc.TLS, db uintptr, p uintptr, n int32) int32 { /* sqlite3.c:152554:12: */
var paNew uintptr
if int32((*WhereLoop)(unsafe.Pointer(p)).FnLSlot) >= n {
return SQLITE_OK
}
- n = ((n + 7) & libc.CplInt32(7))
- paNew = Xsqlite3DbMallocRawNN(tls, db, (uint64(uint32(unsafe.Sizeof(uintptr(0))) * uint32(n))))
+ n = (n + 7) & libc.CplInt32(7)
+ paNew = Xsqlite3DbMallocRawNN(tls, db, uint64(uint32(unsafe.Sizeof(uintptr(0)))*uint32(n)))
if paNew == uintptr(0) {
return SQLITE_NOMEM
}
- libc.Xmemcpy(tls, paNew, (*WhereLoop)(unsafe.Pointer(p)).FaLTerm, (uint32(unsafe.Sizeof(uintptr(0))) * uint32((*WhereLoop)(unsafe.Pointer(p)).FnLSlot)))
- if (*WhereLoop)(unsafe.Pointer(p)).FaLTerm != p+56 /* &.aLTermSpace */ {
+ libc.Xmemcpy(tls, paNew, (*WhereLoop)(unsafe.Pointer(p)).FaLTerm, uint32(unsafe.Sizeof(uintptr(0)))*uint32((*WhereLoop)(unsafe.Pointer(p)).FnLSlot))
+ if (*WhereLoop)(unsafe.Pointer(p)).FaLTerm != p+56 {
Xsqlite3DbFreeNN(tls, db, (*WhereLoop)(unsafe.Pointer(p)).FaLTerm)
}
(*WhereLoop)(unsafe.Pointer(p)).FaLTerm = paNew
@@ -132432,39 +134438,40 @@ func whereLoopResize(tls *libc.TLS, db uintptr, p uintptr, n int32) int32 { /* s
}
// Transfer content from the second pLoop into the first.
-func whereLoopXfer(tls *libc.TLS, db uintptr, pTo uintptr, pFrom uintptr) int32 { /* sqlite3.c:151181:12: */
+func whereLoopXfer(tls *libc.TLS, db uintptr, pTo uintptr, pFrom uintptr) int32 { /* sqlite3.c:152570:12: */
whereLoopClearUnion(tls, db, pTo)
if whereLoopResize(tls, db, pTo, int32((*WhereLoop)(unsafe.Pointer(pFrom)).FnLTerm)) != 0 {
- libc.Xmemset(tls, pTo, 0, uint32((uintptr(0) + 44 /* &.nLSlot */)))
+ libc.Xmemset(tls, pTo, 0, uint32(uintptr(0)+44))
return SQLITE_NOMEM
}
- libc.Xmemcpy(tls, pTo, pFrom, uint32((uintptr(0) + 44 /* &.nLSlot */)))
- libc.Xmemcpy(tls, (*WhereLoop)(unsafe.Pointer(pTo)).FaLTerm, (*WhereLoop)(unsafe.Pointer(pFrom)).FaLTerm, (uint32((*WhereLoop)(unsafe.Pointer(pTo)).FnLTerm) * uint32(unsafe.Sizeof(uintptr(0)))))
- if ((*WhereLoop)(unsafe.Pointer(pFrom)).FwsFlags & U32(WHERE_VIRTUALTABLE)) != 0 {
- *(*U8)(unsafe.Pointer(pFrom + 24 /* &.u */ /* &.vtab */ + 4 /* &.needFree */)) = U8(0)
- } else if ((*WhereLoop)(unsafe.Pointer(pFrom)).FwsFlags & U32(WHERE_AUTO_INDEX)) != U32(0) {
- *(*uintptr)(unsafe.Pointer(pFrom + 24 /* &.u */ /* &.btree */ + 8 /* &.pIndex */)) = uintptr(0)
+ libc.Xmemcpy(tls, pTo, pFrom, uint32(uintptr(0)+44))
+ libc.Xmemcpy(tls, (*WhereLoop)(unsafe.Pointer(pTo)).FaLTerm, (*WhereLoop)(unsafe.Pointer(pFrom)).FaLTerm, uint32((*WhereLoop)(unsafe.Pointer(pTo)).FnLTerm)*uint32(unsafe.Sizeof(uintptr(0))))
+ if (*WhereLoop)(unsafe.Pointer(pFrom)).FwsFlags&U32(WHERE_VIRTUALTABLE) != 0 {
+ *(*U8)(unsafe.Pointer(pFrom + 24 + 4 /* &.needFree */)) = U8(0)
+ } else if (*WhereLoop)(unsafe.Pointer(pFrom)).FwsFlags&U32(WHERE_AUTO_INDEX) != U32(0) {
+ *(*uintptr)(unsafe.Pointer(pFrom + 24 + 8 /* &.pIndex */)) = uintptr(0)
}
return SQLITE_OK
}
// Delete a WhereLoop object
-func whereLoopDelete(tls *libc.TLS, db uintptr, p uintptr) { /* sqlite3.c:151200:13: */
+func whereLoopDelete(tls *libc.TLS, db uintptr, p uintptr) { /* sqlite3.c:152589:13: */
whereLoopClear(tls, db, p)
Xsqlite3DbFreeNN(tls, db, p)
}
// Free a WhereInfo structure
-func whereInfoFree(tls *libc.TLS, db uintptr, pWInfo uintptr) { /* sqlite3.c:151208:13: */
+func whereInfoFree(tls *libc.TLS, db uintptr, pWInfo uintptr) { /* sqlite3.c:152597:13: */
var i int32
for i = 0; i < int32((*WhereInfo)(unsafe.Pointer(pWInfo)).FnLevel); i++ {
- var pLevel uintptr = ((pWInfo + 752 /* &.a */) + uintptr(i)*80)
- if ((*WhereLevel)(unsafe.Pointer(pLevel)).FpWLoop != 0) && (((*WhereLoop1)(unsafe.Pointer((*WhereLevel)(unsafe.Pointer(pLevel)).FpWLoop)).FwsFlags & U32(WHERE_IN_ABLE)) != 0) {
- Xsqlite3DbFree(tls, db, *(*uintptr)(unsafe.Pointer(pLevel + 56 /* &.u */ /* &.in */ + 4 /* &.aInLoop */)))
+ var pLevel uintptr = pWInfo + 752 + uintptr(i)*80
+ if (*WhereLevel)(unsafe.Pointer(pLevel)).FpWLoop != 0 && (*WhereLoop1)(unsafe.Pointer((*WhereLevel)(unsafe.Pointer(pLevel)).FpWLoop)).FwsFlags&U32(WHERE_IN_ABLE) != U32(0) {
+
+ Xsqlite3DbFree(tls, db, *(*uintptr)(unsafe.Pointer(pLevel + 56 + 4 /* &.aInLoop */)))
}
}
- Xsqlite3WhereClauseClear(tls, (pWInfo + 80 /* &.sWC */))
+ Xsqlite3WhereClauseClear(tls, pWInfo+80)
for (*WhereInfo)(unsafe.Pointer(pWInfo)).FpLoops != 0 {
var p uintptr = (*WhereInfo)(unsafe.Pointer(pWInfo)).FpLoops
(*WhereInfo)(unsafe.Pointer(pWInfo)).FpLoops = (*WhereLoop)(unsafe.Pointer(p)).FpNextLoop
@@ -132475,18 +134482,19 @@ func whereInfoFree(tls *libc.TLS, db uintptr, pWInfo uintptr) { /* sqlite3.c:151
}
// Undo all Expr node modifications
-func whereUndoExprMods(tls *libc.TLS, pWInfo uintptr) { /* sqlite3.c:151229:13: */
+func whereUndoExprMods(tls *libc.TLS, pWInfo uintptr) { /* sqlite3.c:152619:13: */
for (*WhereInfo)(unsafe.Pointer(pWInfo)).FpExprMods != 0 {
var p uintptr = (*WhereInfo)(unsafe.Pointer(pWInfo)).FpExprMods
(*WhereInfo)(unsafe.Pointer(pWInfo)).FpExprMods = (*WhereExprMod)(unsafe.Pointer(p)).FpNext
- libc.Xmemcpy(tls, (*WhereExprMod)(unsafe.Pointer(p)).FpExpr, (p + 8 /* &.orig */), uint32(unsafe.Sizeof(Expr{})))
+ libc.Xmemcpy(tls, (*WhereExprMod)(unsafe.Pointer(p)).FpExpr, p+8, uint32(unsafe.Sizeof(Expr{})))
Xsqlite3DbFree(tls, (*Parse)(unsafe.Pointer((*WhereInfo)(unsafe.Pointer(pWInfo)).FpParse)).Fdb, p)
}
}
// Return TRUE if all of the following are true:
//
-// (1) X has the same or lower cost that Y
+// (1) X has the same or lower cost, or returns the same or fewer rows,
+// than Y.
// (2) X uses fewer WHERE clause terms than Y
// (3) Every WHERE clause term used by X is also used by Y
// (4) X skips at least as many columns as Y
@@ -132500,28 +134508,23 @@ func whereUndoExprMods(tls *libc.TLS, pWInfo uintptr) { /* sqlite3.c:151229:13:
// deserve a lower cost even if it is a proper subset of Y. Constraint (5)
// was added because a covering index probably deserves to have a lower cost
// than a non-covering index even if it is a proper subset.
-func whereLoopCheaperProperSubset(tls *libc.TLS, pX uintptr, pY uintptr) int32 { /* sqlite3.c:151256:12: */
+func whereLoopCheaperProperSubset(tls *libc.TLS, pX uintptr, pY uintptr) int32 { /* sqlite3.c:152647:12: */
var i int32
var j int32
- if (int32((*WhereLoop)(unsafe.Pointer(pX)).FnLTerm) - int32((*WhereLoop)(unsafe.Pointer(pX)).FnSkip)) >= (int32((*WhereLoop)(unsafe.Pointer(pY)).FnLTerm) - int32((*WhereLoop)(unsafe.Pointer(pY)).FnSkip)) {
+ if int32((*WhereLoop)(unsafe.Pointer(pX)).FnLTerm)-int32((*WhereLoop)(unsafe.Pointer(pX)).FnSkip) >= int32((*WhereLoop)(unsafe.Pointer(pY)).FnLTerm)-int32((*WhereLoop)(unsafe.Pointer(pY)).FnSkip) {
return 0 // X is not a subset of Y
}
- if int32((*WhereLoop)(unsafe.Pointer(pY)).FnSkip) > int32((*WhereLoop)(unsafe.Pointer(pX)).FnSkip) {
+ if int32((*WhereLoop)(unsafe.Pointer(pX)).FrRun) > int32((*WhereLoop)(unsafe.Pointer(pY)).FrRun) && int32((*WhereLoop)(unsafe.Pointer(pX)).FnOut) > int32((*WhereLoop)(unsafe.Pointer(pY)).FnOut) {
return 0
}
- if int32((*WhereLoop)(unsafe.Pointer(pX)).FrRun) >= int32((*WhereLoop)(unsafe.Pointer(pY)).FrRun) {
- if int32((*WhereLoop)(unsafe.Pointer(pX)).FrRun) > int32((*WhereLoop)(unsafe.Pointer(pY)).FrRun) {
- return 0
- } // X costs more than Y
- if int32((*WhereLoop)(unsafe.Pointer(pX)).FnOut) > int32((*WhereLoop)(unsafe.Pointer(pY)).FnOut) {
- return 0
- } // X costs more than Y
+ if int32((*WhereLoop)(unsafe.Pointer(pY)).FnSkip) > int32((*WhereLoop)(unsafe.Pointer(pX)).FnSkip) {
+ return 0
}
- for i = (int32((*WhereLoop)(unsafe.Pointer(pX)).FnLTerm) - 1); i >= 0; i-- {
+ for i = int32((*WhereLoop)(unsafe.Pointer(pX)).FnLTerm) - 1; i >= 0; i-- {
if *(*uintptr)(unsafe.Pointer((*WhereLoop)(unsafe.Pointer(pX)).FaLTerm + uintptr(i)*4)) == uintptr(0) {
continue
}
- for j = (int32((*WhereLoop)(unsafe.Pointer(pY)).FnLTerm) - 1); j >= 0; j-- {
+ for j = int32((*WhereLoop)(unsafe.Pointer(pY)).FnLTerm) - 1; j >= 0; j-- {
if *(*uintptr)(unsafe.Pointer((*WhereLoop)(unsafe.Pointer(pY)).FaLTerm + uintptr(j)*4)) == *(*uintptr)(unsafe.Pointer((*WhereLoop)(unsafe.Pointer(pX)).FaLTerm + uintptr(i)*4)) {
break
}
@@ -132530,15 +134533,15 @@ func whereLoopCheaperProperSubset(tls *libc.TLS, pX uintptr, pY uintptr) int32 {
return 0
} // X not a subset of Y since term X[i] not used by Y
}
- if (((*WhereLoop)(unsafe.Pointer(pX)).FwsFlags & U32(WHERE_IDX_ONLY)) != U32(0)) &&
- (((*WhereLoop)(unsafe.Pointer(pY)).FwsFlags & U32(WHERE_IDX_ONLY)) == U32(0)) {
+ if (*WhereLoop)(unsafe.Pointer(pX)).FwsFlags&U32(WHERE_IDX_ONLY) != U32(0) &&
+ (*WhereLoop)(unsafe.Pointer(pY)).FwsFlags&U32(WHERE_IDX_ONLY) == U32(0) {
return 0 // Constraint (5)
}
return 1 // All conditions meet
}
-// Try to adjust the cost of WhereLoop pTemplate upwards or downwards so
-// that:
+// Try to adjust the cost and number of output rows of WhereLoop pTemplate
+// upwards or downwards so that:
//
// (1) pTemplate costs less than any other WhereLoops that are a proper
// subset of pTemplate
@@ -132549,29 +134552,49 @@ func whereLoopCheaperProperSubset(tls *libc.TLS, pX uintptr, pY uintptr) int32 {
// To say "WhereLoop X is a proper subset of Y" means that X uses fewer
// WHERE clause terms than Y and that every WHERE clause term used by X is
// also used by Y.
-func whereLoopAdjustCost(tls *libc.TLS, p uintptr, pTemplate uintptr) { /* sqlite3.c:151297:13: */
- if ((*WhereLoop)(unsafe.Pointer(pTemplate)).FwsFlags & U32(WHERE_INDEXED)) == U32(0) {
+func whereLoopAdjustCost(tls *libc.TLS, p uintptr, pTemplate uintptr) { /* sqlite3.c:152685:13: */
+ if (*WhereLoop)(unsafe.Pointer(pTemplate)).FwsFlags&U32(WHERE_INDEXED) == U32(0) {
return
}
for ; p != 0; p = (*WhereLoop)(unsafe.Pointer(p)).FpNextLoop {
if int32((*WhereLoop)(unsafe.Pointer(p)).FiTab) != int32((*WhereLoop)(unsafe.Pointer(pTemplate)).FiTab) {
continue
}
- if ((*WhereLoop)(unsafe.Pointer(p)).FwsFlags & U32(WHERE_INDEXED)) == U32(0) {
+ if (*WhereLoop)(unsafe.Pointer(p)).FwsFlags&U32(WHERE_INDEXED) == U32(0) {
continue
}
if whereLoopCheaperProperSubset(tls, p, pTemplate) != 0 {
// Adjust pTemplate cost downward so that it is cheaper than its
// subset p.
- (*WhereLoop)(unsafe.Pointer(pTemplate)).FrRun = (*WhereLoop)(unsafe.Pointer(p)).FrRun
- (*WhereLoop)(unsafe.Pointer(pTemplate)).FnOut = (LogEst(int32((*WhereLoop)(unsafe.Pointer(p)).FnOut) - 1))
+ (*WhereLoop)(unsafe.Pointer(pTemplate)).FrRun = func() int16 {
+ if int32((*WhereLoop)(unsafe.Pointer(p)).FrRun) < int32((*WhereLoop)(unsafe.Pointer(pTemplate)).FrRun) {
+ return (*WhereLoop)(unsafe.Pointer(p)).FrRun
+ }
+ return (*WhereLoop)(unsafe.Pointer(pTemplate)).FrRun
+ }()
+ (*WhereLoop)(unsafe.Pointer(pTemplate)).FnOut = func() int16 {
+ if int32((*WhereLoop)(unsafe.Pointer(p)).FnOut)-1 < int32((*WhereLoop)(unsafe.Pointer(pTemplate)).FnOut) {
+ return int16(int32((*WhereLoop)(unsafe.Pointer(p)).FnOut) - 1)
+ }
+ return (*WhereLoop)(unsafe.Pointer(pTemplate)).FnOut
+ }()
} else if whereLoopCheaperProperSubset(tls, pTemplate, p) != 0 {
// Adjust pTemplate cost upward so that it is costlier than p since
// pTemplate is a proper subset of p
- (*WhereLoop)(unsafe.Pointer(pTemplate)).FrRun = (*WhereLoop)(unsafe.Pointer(p)).FrRun
- (*WhereLoop)(unsafe.Pointer(pTemplate)).FnOut = (LogEst(int32((*WhereLoop)(unsafe.Pointer(p)).FnOut) + 1))
+ (*WhereLoop)(unsafe.Pointer(pTemplate)).FrRun = func() int16 {
+ if int32((*WhereLoop)(unsafe.Pointer(p)).FrRun) > int32((*WhereLoop)(unsafe.Pointer(pTemplate)).FrRun) {
+ return (*WhereLoop)(unsafe.Pointer(p)).FrRun
+ }
+ return (*WhereLoop)(unsafe.Pointer(pTemplate)).FrRun
+ }()
+ (*WhereLoop)(unsafe.Pointer(pTemplate)).FnOut = func() int16 {
+ if int32((*WhereLoop)(unsafe.Pointer(p)).FnOut)+1 > int32((*WhereLoop)(unsafe.Pointer(pTemplate)).FnOut) {
+ return int16(int32((*WhereLoop)(unsafe.Pointer(p)).FnOut) + 1)
+ }
+ return (*WhereLoop)(unsafe.Pointer(pTemplate)).FnOut
+ }()
}
}
}
@@ -132588,7 +134611,7 @@ func whereLoopAdjustCost(tls *libc.TLS, p uintptr, pTemplate uintptr) { /* sqlit
// If pTemplate cannot replace any existing element of the list but needs
// to be added to the list as a new entry, then return a pointer to the
// tail of the list.
-func whereLoopFindLesser(tls *libc.TLS, ppPrev uintptr, pTemplate uintptr) uintptr { /* sqlite3.c:151334:18: */
+func whereLoopFindLesser(tls *libc.TLS, ppPrev uintptr, pTemplate uintptr) uintptr { /* sqlite3.c:152726:18: */
var p uintptr
p = *(*uintptr)(unsafe.Pointer(ppPrev))
__1:
@@ -132596,7 +134619,7 @@ __1:
goto __3
}
{
- if (int32((*WhereLoop)(unsafe.Pointer(p)).FiTab) != int32((*WhereLoop)(unsafe.Pointer(pTemplate)).FiTab)) || (int32((*WhereLoop)(unsafe.Pointer(p)).FiSortIdx) != int32((*WhereLoop)(unsafe.Pointer(pTemplate)).FiSortIdx)) {
+ if int32((*WhereLoop)(unsafe.Pointer(p)).FiTab) != int32((*WhereLoop)(unsafe.Pointer(pTemplate)).FiTab) || int32((*WhereLoop)(unsafe.Pointer(p)).FiSortIdx) != int32((*WhereLoop)(unsafe.Pointer(pTemplate)).FiSortIdx) {
// If either the iTab or iSortIdx values for two WhereLoop are different
// then those WhereLoops need to be considered separately. Neither is
// a candidate to replace the other.
@@ -132613,11 +134636,11 @@ __1:
// Any loop using an appliation-defined index (or PRIMARY KEY or
// UNIQUE constraint) with one or more == constraints is better
// than an automatic index. Unless it is a skip-scan.
- if ((((((*WhereLoop)(unsafe.Pointer(p)).FwsFlags & U32(WHERE_AUTO_INDEX)) != U32(0)) &&
- ((int32((*WhereLoop)(unsafe.Pointer(pTemplate)).FnSkip)) == 0)) &&
- (((*WhereLoop)(unsafe.Pointer(pTemplate)).FwsFlags & U32(WHERE_INDEXED)) != U32(0))) &&
- (((*WhereLoop)(unsafe.Pointer(pTemplate)).FwsFlags & U32(WHERE_COLUMN_EQ)) != U32(0))) &&
- (((*WhereLoop)(unsafe.Pointer(p)).Fprereq & (*WhereLoop)(unsafe.Pointer(pTemplate)).Fprereq) == (*WhereLoop)(unsafe.Pointer(pTemplate)).Fprereq) {
+ if (*WhereLoop)(unsafe.Pointer(p)).FwsFlags&U32(WHERE_AUTO_INDEX) != U32(0) &&
+ int32((*WhereLoop)(unsafe.Pointer(pTemplate)).FnSkip) == 0 &&
+ (*WhereLoop)(unsafe.Pointer(pTemplate)).FwsFlags&U32(WHERE_INDEXED) != U32(0) &&
+ (*WhereLoop)(unsafe.Pointer(pTemplate)).FwsFlags&U32(WHERE_COLUMN_EQ) != U32(0) &&
+ (*WhereLoop)(unsafe.Pointer(p)).Fprereq&(*WhereLoop)(unsafe.Pointer(pTemplate)).Fprereq == (*WhereLoop)(unsafe.Pointer(pTemplate)).Fprereq {
goto __3
}
@@ -132625,10 +134648,10 @@ __1:
// discarded. WhereLoop p is better if:
// (1) p has no more dependencies than pTemplate, and
// (2) p has an equal or lower cost than pTemplate
- if (((((*WhereLoop)(unsafe.Pointer(p)).Fprereq & (*WhereLoop)(unsafe.Pointer(pTemplate)).Fprereq) == (*WhereLoop)(unsafe.Pointer(p)).Fprereq) && // (1)
- (int32((*WhereLoop)(unsafe.Pointer(p)).FrSetup) <= int32((*WhereLoop)(unsafe.Pointer(pTemplate)).FrSetup))) && // (2a)
- (int32((*WhereLoop)(unsafe.Pointer(p)).FrRun) <= int32((*WhereLoop)(unsafe.Pointer(pTemplate)).FrRun))) && // (2b)
- (int32((*WhereLoop)(unsafe.Pointer(p)).FnOut) <= int32((*WhereLoop)(unsafe.Pointer(pTemplate)).FnOut)) {
+ if (*WhereLoop)(unsafe.Pointer(p)).Fprereq&(*WhereLoop)(unsafe.Pointer(pTemplate)).Fprereq == (*WhereLoop)(unsafe.Pointer(p)).Fprereq &&
+ int32((*WhereLoop)(unsafe.Pointer(p)).FrSetup) <= int32((*WhereLoop)(unsafe.Pointer(pTemplate)).FrSetup) &&
+ int32((*WhereLoop)(unsafe.Pointer(p)).FrRun) <= int32((*WhereLoop)(unsafe.Pointer(pTemplate)).FrRun) &&
+ int32((*WhereLoop)(unsafe.Pointer(p)).FnOut) <= int32((*WhereLoop)(unsafe.Pointer(pTemplate)).FnOut) {
return uintptr(0) // Discard pTemplate
}
@@ -132636,9 +134659,9 @@ __1:
// with pTemplate. pTemplate is better than p if:
// (1) pTemplate has no more dependences than p, and
// (2) pTemplate has an equal or lower cost than p.
- if ((((*WhereLoop)(unsafe.Pointer(p)).Fprereq & (*WhereLoop)(unsafe.Pointer(pTemplate)).Fprereq) == (*WhereLoop)(unsafe.Pointer(pTemplate)).Fprereq) && // (1)
- (int32((*WhereLoop)(unsafe.Pointer(p)).FrRun) >= int32((*WhereLoop)(unsafe.Pointer(pTemplate)).FrRun))) && // (2a)
- (int32((*WhereLoop)(unsafe.Pointer(p)).FnOut) >= int32((*WhereLoop)(unsafe.Pointer(pTemplate)).FnOut)) {
+ if (*WhereLoop)(unsafe.Pointer(p)).Fprereq&(*WhereLoop)(unsafe.Pointer(pTemplate)).Fprereq == (*WhereLoop)(unsafe.Pointer(pTemplate)).Fprereq &&
+ int32((*WhereLoop)(unsafe.Pointer(p)).FrRun) >= int32((*WhereLoop)(unsafe.Pointer(pTemplate)).FrRun) &&
+ int32((*WhereLoop)(unsafe.Pointer(p)).FnOut) >= int32((*WhereLoop)(unsafe.Pointer(pTemplate)).FnOut) {
// SETUP-INVARIANT above
goto __3 // Cause p to be overwritten by pTemplate
}
@@ -132646,7 +134669,7 @@ __1:
}
goto __2
__2:
- ppPrev = (p + 52 /* &.pNextLoop */)
+ ppPrev = p + 52
p = *(*uintptr)(unsafe.Pointer(ppPrev))
goto __1
goto __3
@@ -132677,7 +134700,7 @@ __3:
// (2) They have the same iSortIdx.
// (3) The template has same or fewer dependencies than the current loop
// (4) The template has the same or lower cost than the current loop
-func whereLoopInsert(tls *libc.TLS, pBuilder uintptr, pTemplate uintptr) int32 { /* sqlite3.c:151422:12: */
+func whereLoopInsert(tls *libc.TLS, pBuilder uintptr, pTemplate uintptr) int32 { /* sqlite3.c:152814:12: */
var ppPrev uintptr
var p uintptr
var pWInfo uintptr = (*WhereLoopBuilder)(unsafe.Pointer(pBuilder)).FpWInfo
@@ -132707,7 +134730,7 @@ func whereLoopInsert(tls *libc.TLS, pBuilder uintptr, pTemplate uintptr) int32 {
}
// Look for an existing WhereLoop to replace with pTemplate
- ppPrev = whereLoopFindLesser(tls, (pWInfo + 60 /* &.pLoops */), pTemplate)
+ ppPrev = whereLoopFindLesser(tls, pWInfo+60, pTemplate)
if ppPrev == uintptr(0) {
// There already exists a WhereLoop on the list that is better
@@ -132732,7 +134755,7 @@ func whereLoopInsert(tls *libc.TLS, pBuilder uintptr, pTemplate uintptr) int32 {
// We will be overwriting WhereLoop p[]. But before we do, first
// go through the rest of the list and delete any other entries besides
// p[] that are also supplated by pTemplate
- var ppTail uintptr = (p + 52 /* &.pNextLoop */)
+ var ppTail uintptr = p + 52
var pToDel uintptr
for *(*uintptr)(unsafe.Pointer(ppTail)) != 0 {
ppTail = whereLoopFindLesser(tls, ppTail, pTemplate)
@@ -132748,10 +134771,10 @@ func whereLoopInsert(tls *libc.TLS, pBuilder uintptr, pTemplate uintptr) int32 {
}
}
rc = whereLoopXfer(tls, db, p, pTemplate)
- if ((*WhereLoop)(unsafe.Pointer(p)).FwsFlags & U32(WHERE_VIRTUALTABLE)) == U32(0) {
- var pIndex uintptr = *(*uintptr)(unsafe.Pointer(p + 24 /* &.u */ /* &.btree */ + 8 /* &.pIndex */))
- if (pIndex != 0) && ((int32(*(*uint16)(unsafe.Pointer(pIndex + 56 /* &.idxType */)) & 0x3 >> 0)) == SQLITE_IDXTYPE_IPK) {
- *(*uintptr)(unsafe.Pointer(p + 24 /* &.u */ /* &.btree */ + 8 /* &.pIndex */)) = uintptr(0)
+ if (*WhereLoop)(unsafe.Pointer(p)).FwsFlags&U32(WHERE_VIRTUALTABLE) == U32(0) {
+ var pIndex uintptr = *(*uintptr)(unsafe.Pointer(p + 24 + 8 /* &.pIndex */))
+ if pIndex != 0 && int32(*(*uint16)(unsafe.Pointer(pIndex + 56))&0x3>>0) == SQLITE_IDXTYPE_IPK {
+ *(*uintptr)(unsafe.Pointer(p + 24 + 8 /* &.pIndex */)) = uintptr(0)
}
}
return rc
@@ -132784,7 +134807,7 @@ func whereLoopInsert(tls *libc.TLS, pBuilder uintptr, pTemplate uintptr) int32 {
// "x" column is boolean or else -1 or 0 or 1 is a common default value
// on the "x" column and so in that case only cap the output row estimate
// at 1/2 instead of 1/4.
-func whereLoopOutputAdjust(tls *libc.TLS, pWC uintptr, pLoop uintptr, nRow LogEst) { /* sqlite3.c:151559:13: */
+func whereLoopOutputAdjust(tls *libc.TLS, pWC uintptr, pLoop uintptr, nRow LogEst) { /* sqlite3.c:152951:13: */
bp := tls.Alloc(4)
defer tls.Free(4)
@@ -132803,16 +134826,16 @@ __1:
}
{
- if (int32((*WhereTerm)(unsafe.Pointer(pTerm)).FwtFlags) & TERM_VIRTUAL) != 0 {
+ if int32((*WhereTerm)(unsafe.Pointer(pTerm)).FwtFlags)&TERM_VIRTUAL != 0 {
goto __3
}
- if ((*WhereTerm)(unsafe.Pointer(pTerm)).FprereqAll & (*WhereLoop)(unsafe.Pointer(pLoop)).FmaskSelf) == uint64(0) {
+ if (*WhereTerm)(unsafe.Pointer(pTerm)).FprereqAll&(*WhereLoop)(unsafe.Pointer(pLoop)).FmaskSelf == uint64(0) {
goto __2
}
- if ((*WhereTerm)(unsafe.Pointer(pTerm)).FprereqAll & notAllowed) != uint64(0) {
+ if (*WhereTerm)(unsafe.Pointer(pTerm)).FprereqAll&notAllowed != uint64(0) {
goto __2
}
- for j = (int32((*WhereLoop)(unsafe.Pointer(pLoop)).FnLTerm) - 1); j >= 0; j-- {
+ for j = int32((*WhereLoop)(unsafe.Pointer(pLoop)).FnLTerm) - 1; j >= 0; j-- {
pX = *(*uintptr)(unsafe.Pointer((*WhereLoop)(unsafe.Pointer(pLoop)).FaLTerm + uintptr(j)*4))
if pX == uintptr(0) {
continue
@@ -132820,7 +134843,7 @@ __1:
if pX == pTerm {
break
}
- if ((*WhereTerm)(unsafe.Pointer(pX)).FiParent >= 0) && (((*WhereClause)(unsafe.Pointer(pWC)).Fa + uintptr((*WhereTerm)(unsafe.Pointer(pX)).FiParent)*48) == pTerm) {
+ if (*WhereTerm)(unsafe.Pointer(pX)).FiParent >= 0 && (*WhereClause)(unsafe.Pointer(pWC)).Fa+uintptr((*WhereTerm)(unsafe.Pointer(pX)).FiParent)*48 == pTerm {
break
}
}
@@ -132828,23 +134851,23 @@ __1:
if int32((*WhereTerm)(unsafe.Pointer(pTerm)).FtruthProb) <= 0 {
// If a truth probability is specified using the likelihood() hints,
// then use the probability provided by the application.
- *(*LogEst)(unsafe.Pointer(pLoop + 22 /* &.nOut */)) += LogEst((int32((*WhereTerm)(unsafe.Pointer(pTerm)).FtruthProb)))
+ *(*LogEst)(unsafe.Pointer(pLoop + 22)) += LogEst(int32((*WhereTerm)(unsafe.Pointer(pTerm)).FtruthProb))
} else {
// In the absence of explicit truth probabilities, use heuristics to
// guess a reasonable truth probability.
(*WhereLoop)(unsafe.Pointer(pLoop)).FnOut--
- if ((int32((*WhereTerm)(unsafe.Pointer(pTerm)).FeOperator) & (WO_EQ | WO_IS)) != 0) &&
- ((int32((*WhereTerm)(unsafe.Pointer(pTerm)).FwtFlags) & TERM_HIGHTRUTH) == 0) {
+ if int32((*WhereTerm)(unsafe.Pointer(pTerm)).FeOperator)&(WO_EQ|WO_IS) != 0 &&
+ int32((*WhereTerm)(unsafe.Pointer(pTerm)).FwtFlags)&TERM_HIGHTRUTH == 0 {
var pRight uintptr = (*Expr)(unsafe.Pointer((*WhereTerm)(unsafe.Pointer(pTerm)).FpExpr)).FpRight
*(*int32)(unsafe.Pointer(bp /* k */)) = 0
- if ((Xsqlite3ExprIsInteger(tls, pRight, bp /* &k */) != 0) && (*(*int32)(unsafe.Pointer(bp /* k */)) >= (-1))) && (*(*int32)(unsafe.Pointer(bp /* k */)) <= 1) {
+ if Xsqlite3ExprIsInteger(tls, pRight, bp) != 0 && *(*int32)(unsafe.Pointer(bp)) >= -1 && *(*int32)(unsafe.Pointer(bp)) <= 1 {
*(*int32)(unsafe.Pointer(bp /* k */)) = 10
} else {
*(*int32)(unsafe.Pointer(bp /* k */)) = 20
}
- if int32(iReduce) < *(*int32)(unsafe.Pointer(bp /* k */)) {
- *(*U16)(unsafe.Pointer(pTerm + 10 /* &.wtFlags */)) |= U16((TERM_HEURTRUTH))
+ if int32(iReduce) < *(*int32)(unsafe.Pointer(bp)) {
+ *(*U16)(unsafe.Pointer(pTerm + 10)) |= U16(TERM_HEURTRUTH)
iReduce = LogEst(*(*int32)(unsafe.Pointer(bp /* k */)))
}
}
@@ -132860,8 +134883,8 @@ __2:
goto __3
__3:
;
- if int32((*WhereLoop)(unsafe.Pointer(pLoop)).FnOut) > (int32(nRow) - int32(iReduce)) {
- (*WhereLoop)(unsafe.Pointer(pLoop)).FnOut = (LogEst(int32(nRow) - int32(iReduce)))
+ if int32((*WhereLoop)(unsafe.Pointer(pLoop)).FnOut) > int32(nRow)-int32(iReduce) {
+ (*WhereLoop)(unsafe.Pointer(pLoop)).FnOut = LogEst(int32(nRow) - int32(iReduce))
}
}
@@ -132880,15 +134903,15 @@ __3:
//
// then this function would be invoked with nEq=1. The value returned in
// this case is 3.
-func whereRangeVectorLen(tls *libc.TLS, pParse uintptr, iCur int32, pIdx uintptr, nEq int32, pTerm uintptr) int32 { /* sqlite3.c:151629:12: */
+func whereRangeVectorLen(tls *libc.TLS, pParse uintptr, iCur int32, pIdx uintptr, nEq int32, pTerm uintptr) int32 { /* sqlite3.c:153021:12: */
var nCmp int32 = Xsqlite3ExprVectorSize(tls, (*Expr)(unsafe.Pointer((*WhereTerm)(unsafe.Pointer(pTerm)).FpExpr)).FpLeft)
var i int32
nCmp = func() int32 {
- if (nCmp) < (int32((*Index)(unsafe.Pointer(pIdx)).FnColumn) - nEq) {
+ if nCmp < int32((*Index)(unsafe.Pointer(pIdx)).FnColumn)-nEq {
return nCmp
}
- return (int32((*Index)(unsafe.Pointer(pIdx)).FnColumn) - nEq)
+ return int32((*Index)(unsafe.Pointer(pIdx)).FnColumn) - nEq
}()
for i = 1; i < nCmp; i++ {
// Test if comparison i of pTerm is compatible with column (i+nEq)
@@ -132896,22 +134919,25 @@ func whereRangeVectorLen(tls *libc.TLS, pParse uintptr, iCur int32, pIdx uintptr
var aff uint8 // Comparison affinity
var idxaff uint8 = uint8(0) // Indexed columns affinity
var pColl uintptr // Comparison collation sequence
- var pLhs uintptr = (*ExprList_item)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer((*Expr)(unsafe.Pointer((*WhereTerm)(unsafe.Pointer(pTerm)).FpExpr)).FpLeft + 20 /* &.x */)) + 8 /* &.a */) + uintptr(i)*20)).FpExpr
- var pRhs uintptr = (*Expr)(unsafe.Pointer((*WhereTerm)(unsafe.Pointer(pTerm)).FpExpr)).FpRight
- if ((*Expr)(unsafe.Pointer(pRhs)).Fflags & U32(EP_xIsSelect)) != 0 {
- pRhs = (*ExprList_item)(unsafe.Pointer(((*Select)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pRhs + 20 /* &.x */)))).FpEList + 8 /* &.a */) + uintptr(i)*20)).FpExpr
+ var pLhs uintptr
+ var pRhs uintptr
+
+ pLhs = (*ExprList_item)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((*Expr)(unsafe.Pointer((*WhereTerm)(unsafe.Pointer(pTerm)).FpExpr)).FpLeft + 20)) + 8 + uintptr(i)*20)).FpExpr
+ pRhs = (*Expr)(unsafe.Pointer((*WhereTerm)(unsafe.Pointer(pTerm)).FpExpr)).FpRight
+ if (*Expr)(unsafe.Pointer(pRhs)).Fflags&U32(EP_xIsSelect) != U32(0) {
+ pRhs = (*ExprList_item)(unsafe.Pointer((*Select)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pRhs + 20)))).FpEList + 8 + uintptr(i)*20)).FpExpr
} else {
- pRhs = (*ExprList_item)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(pRhs + 20 /* &.x */)) + 8 /* &.a */) + uintptr(i)*20)).FpExpr
+ pRhs = (*ExprList_item)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pRhs + 20)) + 8 + uintptr(i)*20)).FpExpr
}
// Check that the LHS of the comparison is a column reference to
// the right column of the right source table. And that the sort
// order of the index column is the same as the sort order of the
// leftmost index column.
- if (((int32((*Expr)(unsafe.Pointer(pLhs)).Fop) != TK_COLUMN) ||
- ((*Expr)(unsafe.Pointer(pLhs)).FiTable != iCur)) ||
- (int32((*Expr)(unsafe.Pointer(pLhs)).FiColumn) != int32(*(*I16)(unsafe.Pointer((*Index)(unsafe.Pointer(pIdx)).FaiColumn + uintptr((i+nEq))*2))))) ||
- (int32(*(*U8)(unsafe.Pointer((*Index)(unsafe.Pointer(pIdx)).FaSortOrder + uintptr((i + nEq))))) != int32(*(*U8)(unsafe.Pointer((*Index)(unsafe.Pointer(pIdx)).FaSortOrder + uintptr(nEq))))) {
+ if int32((*Expr)(unsafe.Pointer(pLhs)).Fop) != TK_COLUMN ||
+ (*Expr)(unsafe.Pointer(pLhs)).FiTable != iCur ||
+ int32((*Expr)(unsafe.Pointer(pLhs)).FiColumn) != int32(*(*I16)(unsafe.Pointer((*Index)(unsafe.Pointer(pIdx)).FaiColumn + uintptr(i+nEq)*2))) ||
+ int32(*(*U8)(unsafe.Pointer((*Index)(unsafe.Pointer(pIdx)).FaSortOrder + uintptr(i+nEq)))) != int32(*(*U8)(unsafe.Pointer((*Index)(unsafe.Pointer(pIdx)).FaSortOrder + uintptr(nEq)))) {
break
}
@@ -132925,7 +134951,7 @@ func whereRangeVectorLen(tls *libc.TLS, pParse uintptr, iCur int32, pIdx uintptr
if pColl == uintptr(0) {
break
}
- if Xsqlite3StrICmp(tls, (*CollSeq)(unsafe.Pointer(pColl)).FzName, *(*uintptr)(unsafe.Pointer((*Index)(unsafe.Pointer(pIdx)).FazColl + uintptr((i+nEq))*4))) != 0 {
+ if Xsqlite3StrICmp(tls, (*CollSeq)(unsafe.Pointer(pColl)).FzName, *(*uintptr)(unsafe.Pointer((*Index)(unsafe.Pointer(pIdx)).FazColl + uintptr(i+nEq)*4))) != 0 {
break
}
}
@@ -132945,7 +134971,7 @@ func whereRangeVectorLen(tls *libc.TLS, pParse uintptr, iCur int32, pIdx uintptr
//
// If pProbe->idxType==SQLITE_IDXTYPE_IPK, that means pIndex is
// a fake index used for the INTEGER PRIMARY KEY.
-func whereLoopAddBtreeIndex(tls *libc.TLS, pBuilder uintptr, pSrc uintptr, pProbe uintptr, nInMul LogEst) int32 { /* sqlite3.c:151700:12: */
+func whereLoopAddBtreeIndex(tls *libc.TLS, pBuilder uintptr, pSrc uintptr, pProbe uintptr, nInMul LogEst) int32 { /* sqlite3.c:153095:12: */
bp := tls.Alloc(100)
defer tls.Free(100)
@@ -132976,19 +135002,19 @@ func whereLoopAddBtreeIndex(tls *libc.TLS, pBuilder uintptr, pSrc uintptr, pProb
return SQLITE_NOMEM
}
- if ((*WhereLoop)(unsafe.Pointer(pNew)).FwsFlags & U32(WHERE_BTM_LIMIT)) != 0 {
- opMask = ((int32(WO_EQ) << (TK_LT - TK_EQ)) | (int32(WO_EQ) << (TK_LE - TK_EQ)))
+ if (*WhereLoop)(unsafe.Pointer(pNew)).FwsFlags&U32(WHERE_BTM_LIMIT) != 0 {
+ opMask = int32(WO_EQ)<<(TK_LT-TK_EQ) | int32(WO_EQ)<<(TK_LE-TK_EQ)
} else {
- opMask = (((((((WO_EQ | WO_IN) | (int32(WO_EQ) << (TK_GT - TK_EQ))) | (int32(WO_EQ) << (TK_GE - TK_EQ))) | (int32(WO_EQ) << (TK_LT - TK_EQ))) | (int32(WO_EQ) << (TK_LE - TK_EQ))) | WO_ISNULL) | WO_IS)
+ opMask = WO_EQ | WO_IN | int32(WO_EQ)<<(TK_GT-TK_EQ) | int32(WO_EQ)<<(TK_GE-TK_EQ) | int32(WO_EQ)<<(TK_LT-TK_EQ) | int32(WO_EQ)<<(TK_LE-TK_EQ) | WO_ISNULL | WO_IS
}
- if (uint32(int32(*(*uint16)(unsafe.Pointer(pProbe + 56 /* &.bUnordered */)) & 0x4 >> 2))) != 0 {
- opMask = opMask & (libc.CplInt32(((((int32(WO_EQ) << (TK_GT - TK_EQ)) | (int32(WO_EQ) << (TK_GE - TK_EQ))) | (int32(WO_EQ) << (TK_LT - TK_EQ))) | (int32(WO_EQ) << (TK_LE - TK_EQ)))))
+ if uint32(int32(*(*uint16)(unsafe.Pointer(pProbe + 56))&0x4>>2)) != 0 {
+ opMask = opMask & libc.CplInt32(int32(WO_EQ)<<(TK_GT-TK_EQ)|int32(WO_EQ)<<(TK_GE-TK_EQ)|int32(WO_EQ)<<(TK_LT-TK_EQ)|int32(WO_EQ)<<(TK_LE-TK_EQ))
}
- saved_nEq = *(*U16)(unsafe.Pointer(pNew + 24 /* &.u */ /* &.btree */ /* &.nEq */))
- saved_nBtm = *(*U16)(unsafe.Pointer(pNew + 24 /* &.u */ /* &.btree */ + 2 /* &.nBtm */))
- saved_nTop = *(*U16)(unsafe.Pointer(pNew + 24 /* &.u */ /* &.btree */ + 4 /* &.nTop */))
+ saved_nEq = *(*U16)(unsafe.Pointer(pNew + 24))
+ saved_nBtm = *(*U16)(unsafe.Pointer(pNew + 24 + 2 /* &.nBtm */))
+ saved_nTop = *(*U16)(unsafe.Pointer(pNew + 24 + 4 /* &.nTop */))
saved_nSkip = (*WhereLoop)(unsafe.Pointer(pNew)).FnSkip
saved_nLTerm = (*WhereLoop)(unsafe.Pointer(pNew)).FnLTerm
saved_wsFlags = (*WhereLoop)(unsafe.Pointer(pNew)).FwsFlags
@@ -132999,53 +135025,53 @@ func whereLoopAddBtreeIndex(tls *libc.TLS, pBuilder uintptr, pSrc uintptr, pProb
(*WhereLoop)(unsafe.Pointer(pNew)).FrSetup = int16(0)
rSize = *(*LogEst)(unsafe.Pointer((*Index)(unsafe.Pointer(pProbe)).FaiRowLogEst))
rLogSize = estLog(tls, rSize)
- for ; (rc == SQLITE_OK) && (pTerm != uintptr(0)); pTerm = whereScanNext(tls, bp /* &scan */) {
+ for ; rc == SQLITE_OK && pTerm != uintptr(0); pTerm = whereScanNext(tls, bp /* &scan */) {
var eOp U16 = (*WhereTerm)(unsafe.Pointer(pTerm)).FeOperator // Shorthand for pTerm->eOperator
var rCostIdx LogEst
var nOutUnadjusted LogEst // nOut before IN() and WHERE adjustments
var nIn int32 = 0
var nRecValid int32 = (*WhereLoopBuilder)(unsafe.Pointer(pBuilder)).FnRecValid
- if ((int32(eOp) == WO_ISNULL) || ((int32((*WhereTerm)(unsafe.Pointer(pTerm)).FwtFlags) & TERM_VNULL) != 0)) &&
- (indexColumnNotNull(tls, pProbe, int32(saved_nEq)) != 0) {
+ if (int32(eOp) == WO_ISNULL || int32((*WhereTerm)(unsafe.Pointer(pTerm)).FwtFlags)&TERM_VNULL != 0) &&
+ indexColumnNotNull(tls, pProbe, int32(saved_nEq)) != 0 {
continue // ignore IS [NOT] NULL constraints on NOT NULL columns
}
- if ((*WhereTerm)(unsafe.Pointer(pTerm)).FprereqRight & (*WhereLoop)(unsafe.Pointer(pNew)).FmaskSelf) != 0 {
+ if (*WhereTerm)(unsafe.Pointer(pTerm)).FprereqRight&(*WhereLoop)(unsafe.Pointer(pNew)).FmaskSelf != 0 {
continue
}
// Do not allow the upper bound of a LIKE optimization range constraint
// to mix with a lower range bound from some other source
- if ((int32((*WhereTerm)(unsafe.Pointer(pTerm)).FwtFlags) & TERM_LIKEOPT) != 0) && (int32((*WhereTerm)(unsafe.Pointer(pTerm)).FeOperator) == (int32(WO_EQ) << (TK_LT - TK_EQ))) {
+ if int32((*WhereTerm)(unsafe.Pointer(pTerm)).FwtFlags)&TERM_LIKEOPT != 0 && int32((*WhereTerm)(unsafe.Pointer(pTerm)).FeOperator) == int32(WO_EQ)<<(TK_LT-TK_EQ) {
continue
}
// tag-20191211-001: Do not allow constraints from the WHERE clause to
// be used by the right table of a LEFT JOIN. Only constraints in the
// ON clause are allowed. See tag-20191211-002 for the vtab equivalent.
- if ((int32((*SrcItem)(unsafe.Pointer(pSrc)).Ffg.Fjointype) & JT_LEFT) != 0) &&
- !(((*Expr)(unsafe.Pointer(((*WhereTerm)(unsafe.Pointer(pTerm)).FpExpr))).Fflags & (U32(EP_FromJoin))) != U32(0)) {
+ if int32((*SrcItem)(unsafe.Pointer(pSrc)).Ffg.Fjointype)&JT_LEFT != 0 &&
+ !((*Expr)(unsafe.Pointer((*WhereTerm)(unsafe.Pointer(pTerm)).FpExpr)).Fflags&U32(EP_FromJoin) != U32(0)) {
continue
}
- if (int32((*Index)(unsafe.Pointer((pProbe))).FonError) != OE_None) && (int32(saved_nEq) == (int32((*Index)(unsafe.Pointer(pProbe)).FnKeyCol) - 1)) {
- *(*uint8)(unsafe.Pointer(pBuilder + 28 /* &.bldFlags1 */)) |= uint8((SQLITE_BLDF1_UNIQUE))
+ if int32((*Index)(unsafe.Pointer(pProbe)).FonError) != OE_None && int32(saved_nEq) == int32((*Index)(unsafe.Pointer(pProbe)).FnKeyCol)-1 {
+ *(*uint8)(unsafe.Pointer(pBuilder + 28)) |= uint8(SQLITE_BLDF1_UNIQUE)
} else {
- *(*uint8)(unsafe.Pointer(pBuilder + 28 /* &.bldFlags1 */)) |= uint8((SQLITE_BLDF1_INDEXED))
+ *(*uint8)(unsafe.Pointer(pBuilder + 28)) |= uint8(SQLITE_BLDF1_INDEXED)
}
(*WhereLoop)(unsafe.Pointer(pNew)).FwsFlags = saved_wsFlags
- *(*U16)(unsafe.Pointer(pNew + 24 /* &.u */ /* &.btree */ /* &.nEq */)) = saved_nEq
- *(*U16)(unsafe.Pointer(pNew + 24 /* &.u */ /* &.btree */ + 2 /* &.nBtm */)) = saved_nBtm
- *(*U16)(unsafe.Pointer(pNew + 24 /* &.u */ /* &.btree */ + 4 /* &.nTop */)) = saved_nTop
+ *(*U16)(unsafe.Pointer(pNew + 24)) = saved_nEq
+ *(*U16)(unsafe.Pointer(pNew + 24 + 2 /* &.nBtm */)) = saved_nBtm
+ *(*U16)(unsafe.Pointer(pNew + 24 + 4 /* &.nTop */)) = saved_nTop
(*WhereLoop)(unsafe.Pointer(pNew)).FnLTerm = saved_nLTerm
- if whereLoopResize(tls, db, pNew, (int32((*WhereLoop)(unsafe.Pointer(pNew)).FnLTerm)+1)) != 0 {
+ if whereLoopResize(tls, db, pNew, int32((*WhereLoop)(unsafe.Pointer(pNew)).FnLTerm)+1) != 0 {
break
} // OOM
*(*uintptr)(unsafe.Pointer((*WhereLoop)(unsafe.Pointer(pNew)).FaLTerm + uintptr(libc.PostIncUint16(&(*WhereLoop)(unsafe.Pointer(pNew)).FnLTerm, 1))*4)) = pTerm
- (*WhereLoop)(unsafe.Pointer(pNew)).Fprereq = ((saved_prereq | (*WhereTerm)(unsafe.Pointer(pTerm)).FprereqRight) & ^(*WhereLoop)(unsafe.Pointer(pNew)).FmaskSelf)
+ (*WhereLoop)(unsafe.Pointer(pNew)).Fprereq = (saved_prereq | (*WhereTerm)(unsafe.Pointer(pTerm)).FprereqRight) & ^(*WhereLoop)(unsafe.Pointer(pNew)).FmaskSelf
- if (int32(eOp) & WO_IN) != 0 {
+ if int32(eOp)&WO_IN != 0 {
var pExpr uintptr = (*WhereTerm)(unsafe.Pointer(pTerm)).FpExpr
- if ((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_xIsSelect))) != U32(0) {
+ if (*Expr)(unsafe.Pointer(pExpr)).Fflags&U32(EP_xIsSelect) != U32(0) {
// "x IN (SELECT ...)": TUNING: the SELECT returns 25 rows
var i int32
nIn = 46
@@ -133055,16 +135081,16 @@ func whereLoopAddBtreeIndex(tls *libc.TLS, pBuilder uintptr, pSrc uintptr, pProb
// However, the nIn multiplier should only be applied once, not once
// for each such term. The following loop checks that pTerm is the
// first such term in use, and sets nIn back to 0 if it is not.
- for i = 0; i < (int32((*WhereLoop)(unsafe.Pointer(pNew)).FnLTerm) - 1); i++ {
- if (*(*uintptr)(unsafe.Pointer((*WhereLoop)(unsafe.Pointer(pNew)).FaLTerm + uintptr(i)*4)) != 0) && ((*WhereTerm)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((*WhereLoop)(unsafe.Pointer(pNew)).FaLTerm + uintptr(i)*4)))).FpExpr == pExpr) {
+ for i = 0; i < int32((*WhereLoop)(unsafe.Pointer(pNew)).FnLTerm)-1; i++ {
+ if *(*uintptr)(unsafe.Pointer((*WhereLoop)(unsafe.Pointer(pNew)).FaLTerm + uintptr(i)*4)) != 0 && (*WhereTerm)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((*WhereLoop)(unsafe.Pointer(pNew)).FaLTerm + uintptr(i)*4)))).FpExpr == pExpr {
nIn = 0
}
}
- } else if (*(*uintptr)(unsafe.Pointer(pExpr + 20 /* &.x */)) != 0) && ((*ExprList)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pExpr + 20 /* &.x */)))).FnExpr != 0) {
+ } else if *(*uintptr)(unsafe.Pointer(pExpr + 20)) != 0 && (*ExprList)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pExpr + 20)))).FnExpr != 0 {
// "x IN (value, value, ...)"
- nIn = int32(Xsqlite3LogEst(tls, uint64((*ExprList)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pExpr + 20 /* &.x */)))).FnExpr)))
+ nIn = int32(Xsqlite3LogEst(tls, uint64((*ExprList)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pExpr + 20)))).FnExpr)))
}
- if ((uint32(int32(*(*uint16)(unsafe.Pointer(pProbe + 56 /* &.hasStat1 */)) & 0x80 >> 7))) != 0) && (int32(rLogSize) >= 10) {
+ if uint32(int32(*(*uint16)(unsafe.Pointer(pProbe + 56))&0x80>>7)) != 0 && int32(rLogSize) >= 10 {
var M LogEst
var logK LogEst
var x LogEst
@@ -133090,63 +135116,63 @@ func whereLoopAddBtreeIndex(tls *libc.TLS, pBuilder uintptr, pSrc uintptr, pProb
M = *(*LogEst)(unsafe.Pointer((*Index)(unsafe.Pointer(pProbe)).FaiRowLogEst + uintptr(saved_nEq)*2))
logK = estLog(tls, int16(nIn))
// TUNING v----- 10 to bias toward indexed IN
- x = (LogEst(((int32(M) + int32(logK)) + 10) - (nIn + int32(rLogSize))))
+ x = LogEst(int32(M) + int32(logK) + 10 - (nIn + int32(rLogSize)))
if int32(x) >= 0 {
- } else if (int32(nInMul) < 2) && (((*Sqlite3)(unsafe.Pointer((db))).FdbOptFlags & (U32(SQLITE_SeekScan))) == U32(0)) {
+ } else if int32(nInMul) < 2 && (*Sqlite3)(unsafe.Pointer(db)).FdbOptFlags&U32(SQLITE_SeekScan) == U32(0) {
- *(*U32)(unsafe.Pointer(pNew + 36 /* &.wsFlags */)) |= (U32(WHERE_IN_SEEKSCAN))
+ *(*U32)(unsafe.Pointer(pNew + 36)) |= U32(WHERE_IN_SEEKSCAN)
} else {
continue
}
}
- *(*U32)(unsafe.Pointer(pNew + 36 /* &.wsFlags */)) |= (U32(WHERE_COLUMN_IN))
- } else if (int32(eOp) & (WO_EQ | WO_IS)) != 0 {
+ *(*U32)(unsafe.Pointer(pNew + 36)) |= U32(WHERE_COLUMN_IN)
+ } else if int32(eOp)&(WO_EQ|WO_IS) != 0 {
var iCol int32 = int32(*(*I16)(unsafe.Pointer((*Index)(unsafe.Pointer(pProbe)).FaiColumn + uintptr(saved_nEq)*2)))
- *(*U32)(unsafe.Pointer(pNew + 36 /* &.wsFlags */)) |= (U32(WHERE_COLUMN_EQ))
+ *(*U32)(unsafe.Pointer(pNew + 36)) |= U32(WHERE_COLUMN_EQ)
- if (iCol == (-1)) ||
- (((iCol >= 0) && (int32(nInMul) == 0)) && (int32(saved_nEq) == (int32((*Index)(unsafe.Pointer(pProbe)).FnKeyCol) - 1))) {
- if ((iCol == (-1)) || ((uint32(int32(*(*uint16)(unsafe.Pointer(pProbe + 56 /* &.uniqNotNull */)) & 0x8 >> 3))) != 0)) ||
- (((int32((*Index)(unsafe.Pointer(pProbe)).FnKeyCol) == 1) && ((*Index)(unsafe.Pointer(pProbe)).FonError != 0)) && (int32(eOp) == WO_EQ)) {
- *(*U32)(unsafe.Pointer(pNew + 36 /* &.wsFlags */)) |= (U32(WHERE_ONEROW))
+ if iCol == -1 ||
+ iCol >= 0 && int32(nInMul) == 0 && int32(saved_nEq) == int32((*Index)(unsafe.Pointer(pProbe)).FnKeyCol)-1 {
+ if iCol == -1 || uint32(int32(*(*uint16)(unsafe.Pointer(pProbe + 56))&0x8>>3)) != 0 ||
+ int32((*Index)(unsafe.Pointer(pProbe)).FnKeyCol) == 1 && (*Index)(unsafe.Pointer(pProbe)).FonError != 0 && int32(eOp) == WO_EQ {
+ *(*U32)(unsafe.Pointer(pNew + 36)) |= U32(WHERE_ONEROW)
} else {
- *(*U32)(unsafe.Pointer(pNew + 36 /* &.wsFlags */)) |= (U32(WHERE_UNQ_WANTED))
+ *(*U32)(unsafe.Pointer(pNew + 36)) |= U32(WHERE_UNQ_WANTED)
}
}
- if int32((*WhereScan)(unsafe.Pointer(bp /* &scan */)).FiEquiv) > 1 {
- *(*U32)(unsafe.Pointer(pNew + 36 /* &.wsFlags */)) |= (U32(WHERE_TRANSCONS))
+ if int32((*WhereScan)(unsafe.Pointer(bp)).FiEquiv) > 1 {
+ *(*U32)(unsafe.Pointer(pNew + 36)) |= U32(WHERE_TRANSCONS)
}
- } else if (int32(eOp) & WO_ISNULL) != 0 {
- *(*U32)(unsafe.Pointer(pNew + 36 /* &.wsFlags */)) |= (U32(WHERE_COLUMN_NULL))
- } else if (int32(eOp) & ((int32(WO_EQ) << (TK_GT - TK_EQ)) | (int32(WO_EQ) << (TK_GE - TK_EQ)))) != 0 {
+ } else if int32(eOp)&WO_ISNULL != 0 {
+ *(*U32)(unsafe.Pointer(pNew + 36)) |= U32(WHERE_COLUMN_NULL)
+ } else if int32(eOp)&(int32(WO_EQ)<<(TK_GT-TK_EQ)|int32(WO_EQ)<<(TK_GE-TK_EQ)) != 0 {
- *(*U32)(unsafe.Pointer(pNew + 36 /* &.wsFlags */)) |= (U32(WHERE_COLUMN_RANGE | WHERE_BTM_LIMIT))
- *(*U16)(unsafe.Pointer(pNew + 24 /* &.u */ /* &.btree */ + 2 /* &.nBtm */)) = U16(whereRangeVectorLen(tls,
+ *(*U32)(unsafe.Pointer(pNew + 36)) |= U32(WHERE_COLUMN_RANGE | WHERE_BTM_LIMIT)
+ *(*U16)(unsafe.Pointer(pNew + 24 + 2 /* &.nBtm */)) = U16(whereRangeVectorLen(tls,
pParse, (*SrcItem)(unsafe.Pointer(pSrc)).FiCursor, pProbe, int32(saved_nEq), pTerm))
pBtm = pTerm
pTop = uintptr(0)
- if (int32((*WhereTerm)(unsafe.Pointer(pTerm)).FwtFlags) & TERM_LIKEOPT) != 0 {
+ if int32((*WhereTerm)(unsafe.Pointer(pTerm)).FwtFlags)&TERM_LIKEOPT != 0 {
// Range constraints that come from the LIKE optimization are
// always used in pairs.
- pTop = (pTerm + 1*48)
+ pTop = pTerm + 1*48
- if whereLoopResize(tls, db, pNew, (int32((*WhereLoop)(unsafe.Pointer(pNew)).FnLTerm)+1)) != 0 {
+ if whereLoopResize(tls, db, pNew, int32((*WhereLoop)(unsafe.Pointer(pNew)).FnLTerm)+1) != 0 {
break
} // OOM
*(*uintptr)(unsafe.Pointer((*WhereLoop)(unsafe.Pointer(pNew)).FaLTerm + uintptr(libc.PostIncUint16(&(*WhereLoop)(unsafe.Pointer(pNew)).FnLTerm, 1))*4)) = pTop
- *(*U32)(unsafe.Pointer(pNew + 36 /* &.wsFlags */)) |= (U32(WHERE_TOP_LIMIT))
- *(*U16)(unsafe.Pointer(pNew + 24 /* &.u */ /* &.btree */ + 4 /* &.nTop */)) = U16(1)
+ *(*U32)(unsafe.Pointer(pNew + 36)) |= U32(WHERE_TOP_LIMIT)
+ *(*U16)(unsafe.Pointer(pNew + 24 + 4 /* &.nTop */)) = U16(1)
}
} else {
- *(*U32)(unsafe.Pointer(pNew + 36 /* &.wsFlags */)) |= (U32(WHERE_COLUMN_RANGE | WHERE_TOP_LIMIT))
- *(*U16)(unsafe.Pointer(pNew + 24 /* &.u */ /* &.btree */ + 4 /* &.nTop */)) = U16(whereRangeVectorLen(tls,
+ *(*U32)(unsafe.Pointer(pNew + 36)) |= U32(WHERE_COLUMN_RANGE | WHERE_TOP_LIMIT)
+ *(*U16)(unsafe.Pointer(pNew + 24 + 4 /* &.nTop */)) = U16(whereRangeVectorLen(tls,
pParse, (*SrcItem)(unsafe.Pointer(pSrc)).FiCursor, pProbe, int32(saved_nEq), pTerm))
pTop = pTerm
- if ((*WhereLoop)(unsafe.Pointer(pNew)).FwsFlags & U32(WHERE_BTM_LIMIT)) != U32(0) {
- pBtm = *(*uintptr)(unsafe.Pointer((*WhereLoop)(unsafe.Pointer(pNew)).FaLTerm + uintptr((int32((*WhereLoop)(unsafe.Pointer(pNew)).FnLTerm)-2))*4))
+ if (*WhereLoop)(unsafe.Pointer(pNew)).FwsFlags&U32(WHERE_BTM_LIMIT) != U32(0) {
+ pBtm = *(*uintptr)(unsafe.Pointer((*WhereLoop)(unsafe.Pointer(pNew)).FaLTerm + uintptr(int32((*WhereLoop)(unsafe.Pointer(pNew)).FnLTerm)-2)*4))
} else {
pBtm = uintptr(0)
}
@@ -133158,30 +135184,30 @@ func whereLoopAddBtreeIndex(tls *libc.TLS, pBuilder uintptr, pSrc uintptr, pProb
// "x IN(...)" terms are replaced with "x = ?". This block updates
// the value of pNew->nOut to account for pTerm (but not nIn/nInMul).
- if ((*WhereLoop)(unsafe.Pointer(pNew)).FwsFlags & U32(WHERE_COLUMN_RANGE)) != 0 {
+ if (*WhereLoop)(unsafe.Pointer(pNew)).FwsFlags&U32(WHERE_COLUMN_RANGE) != 0 {
// Adjust nOut using stat4 data. Or, if there is no stat4
// data, using some other estimate.
whereRangeScanEst(tls, pParse, pBuilder, pBtm, pTop, pNew)
} else {
- var nEq int32 = int32(libc.PreIncUint16(&*(*U16)(unsafe.Pointer(pNew + 24 /* &.u */ /* &.btree */ /* &.nEq */)), 1))
+ var nEq int32 = int32(libc.PreIncUint16(&*(*U16)(unsafe.Pointer(pNew + 24)), 1))
- if (int32((*WhereTerm)(unsafe.Pointer(pTerm)).FtruthProb) <= 0) && (int32(*(*I16)(unsafe.Pointer((*Index)(unsafe.Pointer(pProbe)).FaiColumn + uintptr(saved_nEq)*2))) >= 0) {
+ if int32((*WhereTerm)(unsafe.Pointer(pTerm)).FtruthProb) <= 0 && int32(*(*I16)(unsafe.Pointer((*Index)(unsafe.Pointer(pProbe)).FaiColumn + uintptr(saved_nEq)*2))) >= 0 {
- *(*LogEst)(unsafe.Pointer(pNew + 22 /* &.nOut */)) += LogEst((int32((*WhereTerm)(unsafe.Pointer(pTerm)).FtruthProb)))
- *(*LogEst)(unsafe.Pointer(pNew + 22 /* &.nOut */)) -= LogEst((nIn))
+ *(*LogEst)(unsafe.Pointer(pNew + 22)) += LogEst(int32((*WhereTerm)(unsafe.Pointer(pTerm)).FtruthProb))
+ *(*LogEst)(unsafe.Pointer(pNew + 22)) -= LogEst(nIn)
} else {
*(*TRowcnt)(unsafe.Pointer(bp + 96 /* nOut */)) = TRowcnt(0)
- if ((((int32(nInMul) == 0) &&
- ((*Index)(unsafe.Pointer(pProbe)).FnSample != 0)) &&
- (int32(*(*U16)(unsafe.Pointer((pNew + 24 /* &.u */ /* &.btree */) /* &.nEq */))) <= (*Index)(unsafe.Pointer(pProbe)).FnSampleCol)) &&
- (((int32(eOp) & WO_IN) == 0) || !(((*Expr)(unsafe.Pointer(((*WhereTerm)(unsafe.Pointer(pTerm)).FpExpr))).Fflags & (U32(EP_xIsSelect))) != U32(0)))) &&
- (((*Sqlite3)(unsafe.Pointer((db))).FdbOptFlags & (U32(SQLITE_Stat4))) == U32(0)) {
+ if int32(nInMul) == 0 &&
+ (*Index)(unsafe.Pointer(pProbe)).FnSample != 0 &&
+ int32(*(*U16)(unsafe.Pointer(pNew + 24))) <= (*Index)(unsafe.Pointer(pProbe)).FnSampleCol &&
+ (int32(eOp)&WO_IN == 0 || (*Expr)(unsafe.Pointer((*WhereTerm)(unsafe.Pointer(pTerm)).FpExpr)).Fflags&U32(EP_xIsSelect) == U32(0)) &&
+ (*Sqlite3)(unsafe.Pointer(db)).FdbOptFlags&U32(SQLITE_Stat4) == U32(0) {
var pExpr uintptr = (*WhereTerm)(unsafe.Pointer(pTerm)).FpExpr
- if (int32(eOp) & ((WO_EQ | WO_ISNULL) | WO_IS)) != 0 {
+ if int32(eOp)&(WO_EQ|WO_ISNULL|WO_IS) != 0 {
rc = whereEqualScanEst(tls, pParse, pBuilder, (*Expr)(unsafe.Pointer(pExpr)).FpRight, bp+96 /* &nOut */)
} else {
- rc = whereInScanEst(tls, pParse, pBuilder, *(*uintptr)(unsafe.Pointer(pExpr + 20 /* &.x */)), bp+96 /* &nOut */)
+ rc = whereInScanEst(tls, pParse, pBuilder, *(*uintptr)(unsafe.Pointer(pExpr + 20)), bp+96 /* &nOut */)
}
if rc == SQLITE_NOTFOUND {
rc = SQLITE_OK
@@ -133189,34 +135215,32 @@ func whereLoopAddBtreeIndex(tls *libc.TLS, pBuilder uintptr, pSrc uintptr, pProb
if rc != SQLITE_OK {
break
} // Jump out of the pTerm loop
- if *(*TRowcnt)(unsafe.Pointer(bp + 96 /* nOut */)) != 0 {
+ if *(*TRowcnt)(unsafe.Pointer(bp + 96)) != 0 {
(*WhereLoop)(unsafe.Pointer(pNew)).FnOut = Xsqlite3LogEst(tls, uint64(*(*TRowcnt)(unsafe.Pointer(bp + 96 /* nOut */))))
- if (nEq == 1) &&
- // TUNING: Mark terms as "low selectivity" if they seem likely
- // to be true for half or more of the rows in the table.
- // See tag-202002240-1
- ((int32((*WhereLoop)(unsafe.Pointer(pNew)).FnOut) + 10) > int32(*(*LogEst)(unsafe.Pointer((*Index)(unsafe.Pointer(pProbe)).FaiRowLogEst)))) {
- *(*U16)(unsafe.Pointer(pTerm + 10 /* &.wtFlags */)) |= U16((TERM_HIGHTRUTH))
- if (int32((*WhereTerm)(unsafe.Pointer(pTerm)).FwtFlags) & TERM_HEURTRUTH) != 0 {
+ if nEq == 1 &&
+
+ int32((*WhereLoop)(unsafe.Pointer(pNew)).FnOut)+10 > int32(*(*LogEst)(unsafe.Pointer((*Index)(unsafe.Pointer(pProbe)).FaiRowLogEst))) {
+ *(*U16)(unsafe.Pointer(pTerm + 10)) |= U16(TERM_HIGHTRUTH)
+ if int32((*WhereTerm)(unsafe.Pointer(pTerm)).FwtFlags)&TERM_HEURTRUTH != 0 {
// If the term has previously been used with an assumption of
// higher selectivity, then set the flag to rerun the
// loop computations.
- *(*uint8)(unsafe.Pointer(pBuilder + 29 /* &.bldFlags2 */)) |= uint8((SQLITE_BLDF2_2NDPASS))
+ *(*uint8)(unsafe.Pointer(pBuilder + 29)) |= uint8(SQLITE_BLDF2_2NDPASS)
}
}
if int32((*WhereLoop)(unsafe.Pointer(pNew)).FnOut) > int32(saved_nOut) {
(*WhereLoop)(unsafe.Pointer(pNew)).FnOut = saved_nOut
}
- *(*LogEst)(unsafe.Pointer(pNew + 22 /* &.nOut */)) -= LogEst((nIn))
+ *(*LogEst)(unsafe.Pointer(pNew + 22)) -= LogEst(nIn)
}
}
- if *(*TRowcnt)(unsafe.Pointer(bp + 96 /* nOut */)) == TRowcnt(0) {
- *(*LogEst)(unsafe.Pointer(pNew + 22 /* &.nOut */)) += LogEst((int32(*(*LogEst)(unsafe.Pointer((*Index)(unsafe.Pointer(pProbe)).FaiRowLogEst + uintptr(nEq)*2))) - int32(*(*LogEst)(unsafe.Pointer((*Index)(unsafe.Pointer(pProbe)).FaiRowLogEst + uintptr((nEq-1))*2)))))
- if (int32(eOp) & WO_ISNULL) != 0 {
+ if *(*TRowcnt)(unsafe.Pointer(bp + 96)) == TRowcnt(0) {
+ *(*LogEst)(unsafe.Pointer(pNew + 22)) += LogEst(int32(*(*LogEst)(unsafe.Pointer((*Index)(unsafe.Pointer(pProbe)).FaiRowLogEst + uintptr(nEq)*2))) - int32(*(*LogEst)(unsafe.Pointer((*Index)(unsafe.Pointer(pProbe)).FaiRowLogEst + uintptr(nEq-1)*2))))
+ if int32(eOp)&WO_ISNULL != 0 {
// TUNING: If there is no likelihood() value, assume that a
// "col IS NULL" expression matches twice as many rows
// as (col=?).
- *(*LogEst)(unsafe.Pointer(pNew + 22 /* &.nOut */)) += int16((10))
+ *(*LogEst)(unsafe.Pointer(pNew + 22)) += int16(10)
}
}
}
@@ -133227,36 +135251,36 @@ func whereLoopAddBtreeIndex(tls *libc.TLS, pBuilder uintptr, pSrc uintptr, pProb
// seek only. Then, if this is a non-covering index, add the cost of
// visiting the rows in the main table.
- rCostIdx = (LogEst((int32((*WhereLoop)(unsafe.Pointer(pNew)).FnOut) + 1) + ((15 * int32((*Index)(unsafe.Pointer(pProbe)).FszIdxRow)) / int32((*Table)(unsafe.Pointer((*SrcItem)(unsafe.Pointer(pSrc)).FpTab)).FszTabRow))))
+ rCostIdx = LogEst(int32((*WhereLoop)(unsafe.Pointer(pNew)).FnOut) + 1 + 15*int32((*Index)(unsafe.Pointer(pProbe)).FszIdxRow)/int32((*Table)(unsafe.Pointer((*SrcItem)(unsafe.Pointer(pSrc)).FpTab)).FszTabRow))
(*WhereLoop)(unsafe.Pointer(pNew)).FrRun = Xsqlite3LogEstAdd(tls, rLogSize, rCostIdx)
- if ((*WhereLoop)(unsafe.Pointer(pNew)).FwsFlags & (U32(WHERE_IDX_ONLY | WHERE_IPK))) == U32(0) {
- (*WhereLoop)(unsafe.Pointer(pNew)).FrRun = Xsqlite3LogEstAdd(tls, (*WhereLoop)(unsafe.Pointer(pNew)).FrRun, (int16(int32((*WhereLoop)(unsafe.Pointer(pNew)).FnOut) + 16)))
+ if (*WhereLoop)(unsafe.Pointer(pNew)).FwsFlags&U32(WHERE_IDX_ONLY|WHERE_IPK) == U32(0) {
+ (*WhereLoop)(unsafe.Pointer(pNew)).FrRun = Xsqlite3LogEstAdd(tls, (*WhereLoop)(unsafe.Pointer(pNew)).FrRun, int16(int32((*WhereLoop)(unsafe.Pointer(pNew)).FnOut)+16))
}
nOutUnadjusted = (*WhereLoop)(unsafe.Pointer(pNew)).FnOut
- *(*LogEst)(unsafe.Pointer(pNew + 20 /* &.rRun */)) += LogEst((int32(nInMul) + nIn))
- *(*LogEst)(unsafe.Pointer(pNew + 22 /* &.nOut */)) += LogEst((int32(nInMul) + nIn))
+ *(*LogEst)(unsafe.Pointer(pNew + 20)) += LogEst(int32(nInMul) + nIn)
+ *(*LogEst)(unsafe.Pointer(pNew + 22)) += LogEst(int32(nInMul) + nIn)
whereLoopOutputAdjust(tls, (*WhereLoopBuilder)(unsafe.Pointer(pBuilder)).FpWC, pNew, rSize)
rc = whereLoopInsert(tls, pBuilder, pNew)
- if ((*WhereLoop)(unsafe.Pointer(pNew)).FwsFlags & U32(WHERE_COLUMN_RANGE)) != 0 {
+ if (*WhereLoop)(unsafe.Pointer(pNew)).FwsFlags&U32(WHERE_COLUMN_RANGE) != 0 {
(*WhereLoop)(unsafe.Pointer(pNew)).FnOut = saved_nOut
} else {
(*WhereLoop)(unsafe.Pointer(pNew)).FnOut = nOutUnadjusted
}
- if ((((*WhereLoop)(unsafe.Pointer(pNew)).FwsFlags & U32(WHERE_TOP_LIMIT)) == U32(0)) &&
- (int32(*(*U16)(unsafe.Pointer((pNew + 24 /* &.u */ /* &.btree */) /* &.nEq */))) < int32((*Index)(unsafe.Pointer(pProbe)).FnColumn))) &&
- ((int32(*(*U16)(unsafe.Pointer((pNew + 24 /* &.u */ /* &.btree */) /* &.nEq */))) < int32((*Index)(unsafe.Pointer(pProbe)).FnKeyCol)) || ((int32(*(*uint16)(unsafe.Pointer(pProbe + 56 /* &.idxType */)) & 0x3 >> 0)) != SQLITE_IDXTYPE_PRIMARYKEY)) {
- whereLoopAddBtreeIndex(tls, pBuilder, pSrc, pProbe, (int16(int32(nInMul) + nIn)))
+ if (*WhereLoop)(unsafe.Pointer(pNew)).FwsFlags&U32(WHERE_TOP_LIMIT) == U32(0) &&
+ int32(*(*U16)(unsafe.Pointer(pNew + 24))) < int32((*Index)(unsafe.Pointer(pProbe)).FnColumn) &&
+ (int32(*(*U16)(unsafe.Pointer(pNew + 24))) < int32((*Index)(unsafe.Pointer(pProbe)).FnKeyCol) || int32(*(*uint16)(unsafe.Pointer(pProbe + 56))&0x3>>0) != SQLITE_IDXTYPE_PRIMARYKEY) {
+ whereLoopAddBtreeIndex(tls, pBuilder, pSrc, pProbe, int16(int32(nInMul)+nIn))
}
(*WhereLoop)(unsafe.Pointer(pNew)).FnOut = saved_nOut
(*WhereLoopBuilder)(unsafe.Pointer(pBuilder)).FnRecValid = nRecValid
}
(*WhereLoop)(unsafe.Pointer(pNew)).Fprereq = saved_prereq
- *(*U16)(unsafe.Pointer(pNew + 24 /* &.u */ /* &.btree */ /* &.nEq */)) = saved_nEq
- *(*U16)(unsafe.Pointer(pNew + 24 /* &.u */ /* &.btree */ + 2 /* &.nBtm */)) = saved_nBtm
- *(*U16)(unsafe.Pointer(pNew + 24 /* &.u */ /* &.btree */ + 4 /* &.nTop */)) = saved_nTop
+ *(*U16)(unsafe.Pointer(pNew + 24)) = saved_nEq
+ *(*U16)(unsafe.Pointer(pNew + 24 + 2 /* &.nBtm */)) = saved_nBtm
+ *(*U16)(unsafe.Pointer(pNew + 24 + 4 /* &.nTop */)) = saved_nTop
(*WhereLoop)(unsafe.Pointer(pNew)).FnSkip = saved_nSkip
(*WhereLoop)(unsafe.Pointer(pNew)).FwsFlags = saved_wsFlags
(*WhereLoop)(unsafe.Pointer(pNew)).FnOut = saved_nOut
@@ -133273,27 +135297,27 @@ func whereLoopAddBtreeIndex(tls *libc.TLS, pBuilder uintptr, pSrc uintptr, pProb
// On the other hand, the extra seeks could end up being significantly
// more expensive.
- if (((((((int32(saved_nEq) == int32(saved_nSkip)) &&
- ((int32(saved_nEq) + 1) < int32((*Index)(unsafe.Pointer(pProbe)).FnKeyCol))) &&
- (int32(saved_nEq) == int32((*WhereLoop)(unsafe.Pointer(pNew)).FnLTerm))) &&
- ((int32(*(*uint16)(unsafe.Pointer(pProbe + 56 /* &.noSkipScan */)) & 0x40 >> 6)) == 0)) &&
- ((int32(*(*uint16)(unsafe.Pointer(pProbe + 56 /* &.hasStat1 */)) & 0x80 >> 7)) != 0)) &&
- (((*Sqlite3)(unsafe.Pointer((db))).FdbOptFlags & (U32(SQLITE_SkipScan))) == U32(0))) &&
- (int32(*(*LogEst)(unsafe.Pointer((*Index)(unsafe.Pointer(pProbe)).FaiRowLogEst + uintptr((int32(saved_nEq)+1))*2))) >= 42)) && // TUNING: Minimum for skip-scan
- ((libc.AssignInt32(&rc, whereLoopResize(tls, db, pNew, (int32((*WhereLoop)(unsafe.Pointer(pNew)).FnLTerm)+1)))) == SQLITE_OK) {
+ if int32(saved_nEq) == int32(saved_nSkip) &&
+ int32(saved_nEq)+1 < int32((*Index)(unsafe.Pointer(pProbe)).FnKeyCol) &&
+ int32(saved_nEq) == int32((*WhereLoop)(unsafe.Pointer(pNew)).FnLTerm) &&
+ int32(*(*uint16)(unsafe.Pointer(pProbe + 56))&0x40>>6) == 0 &&
+ int32(*(*uint16)(unsafe.Pointer(pProbe + 56))&0x80>>7) != 0 &&
+ (*Sqlite3)(unsafe.Pointer(db)).FdbOptFlags&U32(SQLITE_SkipScan) == U32(0) &&
+ int32(*(*LogEst)(unsafe.Pointer((*Index)(unsafe.Pointer(pProbe)).FaiRowLogEst + uintptr(int32(saved_nEq)+1)*2))) >= 42 &&
+ libc.AssignInt32(&rc, whereLoopResize(tls, db, pNew, int32((*WhereLoop)(unsafe.Pointer(pNew)).FnLTerm)+1)) == SQLITE_OK {
var nIter LogEst
- *(*U16)(unsafe.Pointer(pNew + 24 /* &.u */ /* &.btree */ /* &.nEq */))++
+ *(*U16)(unsafe.Pointer(pNew + 24))++
(*WhereLoop)(unsafe.Pointer(pNew)).FnSkip++
*(*uintptr)(unsafe.Pointer((*WhereLoop)(unsafe.Pointer(pNew)).FaLTerm + uintptr(libc.PostIncUint16(&(*WhereLoop)(unsafe.Pointer(pNew)).FnLTerm, 1))*4)) = uintptr(0)
- *(*U32)(unsafe.Pointer(pNew + 36 /* &.wsFlags */)) |= (U32(WHERE_SKIPSCAN))
- nIter = (LogEst(int32(*(*LogEst)(unsafe.Pointer((*Index)(unsafe.Pointer(pProbe)).FaiRowLogEst + uintptr(saved_nEq)*2))) - int32(*(*LogEst)(unsafe.Pointer((*Index)(unsafe.Pointer(pProbe)).FaiRowLogEst + uintptr((int32(saved_nEq)+1))*2)))))
- *(*LogEst)(unsafe.Pointer(pNew + 22 /* &.nOut */)) -= LogEst((int32(nIter)))
+ *(*U32)(unsafe.Pointer(pNew + 36)) |= U32(WHERE_SKIPSCAN)
+ nIter = LogEst(int32(*(*LogEst)(unsafe.Pointer((*Index)(unsafe.Pointer(pProbe)).FaiRowLogEst + uintptr(saved_nEq)*2))) - int32(*(*LogEst)(unsafe.Pointer((*Index)(unsafe.Pointer(pProbe)).FaiRowLogEst + uintptr(int32(saved_nEq)+1)*2))))
+ *(*LogEst)(unsafe.Pointer(pNew + 22)) -= LogEst(int32(nIter))
// TUNING: Because uncertainties in the estimates for skip-scan queries,
// add a 1.375 fudge factor to make skip-scan slightly less likely.
- nIter = int16(int32(nIter) + (5))
- whereLoopAddBtreeIndex(tls, pBuilder, pSrc, pProbe, (int16(int32(nIter) + int32(nInMul))))
+ nIter = int16(int32(nIter) + 5)
+ whereLoopAddBtreeIndex(tls, pBuilder, pSrc, pProbe, int16(int32(nIter)+int32(nInMul)))
(*WhereLoop)(unsafe.Pointer(pNew)).FnOut = saved_nOut
- *(*U16)(unsafe.Pointer(pNew + 24 /* &.u */ /* &.btree */ /* &.nEq */)) = saved_nEq
+ *(*U16)(unsafe.Pointer(pNew + 24)) = saved_nEq
(*WhereLoop)(unsafe.Pointer(pNew)).FnSkip = saved_nSkip
(*WhereLoop)(unsafe.Pointer(pNew)).FwsFlags = saved_wsFlags
}
@@ -133307,24 +135331,24 @@ func whereLoopAddBtreeIndex(tls *libc.TLS, pBuilder uintptr, pSrc uintptr, pProb
// Return False if pBuilder does not contain an ORDER BY clause or
// if there is no way for pIndex to be useful in implementing that
// ORDER BY clause.
-func indexMightHelpWithOrderBy(tls *libc.TLS, pBuilder uintptr, pIndex uintptr, iCursor int32) int32 { /* sqlite3.c:152100:12: */
+func indexMightHelpWithOrderBy(tls *libc.TLS, pBuilder uintptr, pIndex uintptr, iCursor int32) int32 { /* sqlite3.c:153495:12: */
var pOB uintptr
var aColExpr uintptr
var ii int32
var jj int32
- if (uint32(int32(*(*uint16)(unsafe.Pointer(pIndex + 56 /* &.bUnordered */)) & 0x4 >> 2))) != 0 {
+ if uint32(int32(*(*uint16)(unsafe.Pointer(pIndex + 56))&0x4>>2)) != 0 {
return 0
}
- if (libc.AssignUintptr(&pOB, (*WhereInfo)(unsafe.Pointer((*WhereLoopBuilder)(unsafe.Pointer(pBuilder)).FpWInfo)).FpOrderBy)) == uintptr(0) {
+ if libc.AssignUintptr(&pOB, (*WhereInfo)(unsafe.Pointer((*WhereLoopBuilder)(unsafe.Pointer(pBuilder)).FpWInfo)).FpOrderBy) == uintptr(0) {
return 0
}
for ii = 0; ii < (*ExprList)(unsafe.Pointer(pOB)).FnExpr; ii++ {
- var pExpr uintptr = Xsqlite3ExprSkipCollateAndLikely(tls, (*ExprList_item)(unsafe.Pointer((pOB+8 /* &.a */)+uintptr(ii)*20)).FpExpr)
+ var pExpr uintptr = Xsqlite3ExprSkipCollateAndLikely(tls, (*ExprList_item)(unsafe.Pointer(pOB+8+uintptr(ii)*20)).FpExpr)
if pExpr == uintptr(0) {
continue
}
- if (int32((*Expr)(unsafe.Pointer(pExpr)).Fop) == TK_COLUMN) && ((*Expr)(unsafe.Pointer(pExpr)).FiTable == iCursor) {
+ if int32((*Expr)(unsafe.Pointer(pExpr)).Fop) == TK_COLUMN && (*Expr)(unsafe.Pointer(pExpr)).FiTable == iCursor {
if int32((*Expr)(unsafe.Pointer(pExpr)).FiColumn) < 0 {
return 1
}
@@ -133333,12 +135357,12 @@ func indexMightHelpWithOrderBy(tls *libc.TLS, pBuilder uintptr, pIndex uintptr,
return 1
}
}
- } else if (libc.AssignUintptr(&aColExpr, (*Index)(unsafe.Pointer(pIndex)).FaColExpr)) != uintptr(0) {
+ } else if libc.AssignUintptr(&aColExpr, (*Index)(unsafe.Pointer(pIndex)).FaColExpr) != uintptr(0) {
for jj = 0; jj < int32((*Index)(unsafe.Pointer(pIndex)).FnKeyCol); jj++ {
- if int32(*(*I16)(unsafe.Pointer((*Index)(unsafe.Pointer(pIndex)).FaiColumn + uintptr(jj)*2))) != (-2) {
+ if int32(*(*I16)(unsafe.Pointer((*Index)(unsafe.Pointer(pIndex)).FaiColumn + uintptr(jj)*2))) != -2 {
continue
}
- if Xsqlite3ExprCompareSkip(tls, pExpr, (*ExprList_item)(unsafe.Pointer((aColExpr+8 /* &.a */)+uintptr(jj)*20)).FpExpr, iCursor) == 0 {
+ if Xsqlite3ExprCompareSkip(tls, pExpr, (*ExprList_item)(unsafe.Pointer(aColExpr+8+uintptr(jj)*20)).FpExpr, iCursor) == 0 {
return 1
}
}
@@ -133349,7 +135373,7 @@ func indexMightHelpWithOrderBy(tls *libc.TLS, pBuilder uintptr, pIndex uintptr,
// Check to see if a partial index with pPartIndexWhere can be used
// in the current query. Return true if it can be and false if not.
-func whereUsablePartialIndex(tls *libc.TLS, iTab int32, isLeft int32, pWC uintptr, pWhere uintptr) int32 { /* sqlite3.c:152134:12: */
+func whereUsablePartialIndex(tls *libc.TLS, iTab int32, isLeft int32, pWC uintptr, pWhere uintptr) int32 { /* sqlite3.c:153529:12: */
var i int32
var pTerm uintptr
var pParse uintptr = (*WhereInfo)(unsafe.Pointer((*WhereClause)(unsafe.Pointer(pWC)).FpWInfo)).FpParse
@@ -133359,7 +135383,7 @@ func whereUsablePartialIndex(tls *libc.TLS, iTab int32, isLeft int32, pWC uintpt
}
pWhere = (*Expr)(unsafe.Pointer(pWhere)).FpRight
}
- if ((*Sqlite3)(unsafe.Pointer((*Parse)(unsafe.Pointer(pParse)).Fdb)).Fflags & uint64(SQLITE_EnableQPSG)) != 0 {
+ if (*Sqlite3)(unsafe.Pointer((*Parse)(unsafe.Pointer(pParse)).Fdb)).Fflags&uint64(SQLITE_EnableQPSG) != 0 {
pParse = uintptr(0)
}
i = 0
@@ -133371,10 +135395,10 @@ __1:
{
var pExpr uintptr
pExpr = (*WhereTerm)(unsafe.Pointer(pTerm)).FpExpr
- if (((!(((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_FromJoin))) != U32(0)) || ((*Expr)(unsafe.Pointer(pExpr)).FiRightJoinTable == iTab)) &&
- ((isLeft == 0) || (((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_FromJoin))) != U32(0)))) &&
- (Xsqlite3ExprImpliesExpr(tls, pParse, pExpr, pWhere, iTab) != 0)) &&
- ((int32((*WhereTerm)(unsafe.Pointer(pTerm)).FwtFlags) & TERM_VNULL) == 0) {
+ if (!((*Expr)(unsafe.Pointer(pExpr)).Fflags&U32(EP_FromJoin) != U32(0)) || (*Expr)(unsafe.Pointer(pExpr)).FiRightJoinTable == iTab) &&
+ (isLeft == 0 || (*Expr)(unsafe.Pointer(pExpr)).Fflags&U32(EP_FromJoin) != U32(0)) &&
+ Xsqlite3ExprImpliesExpr(tls, pParse, pExpr, pWhere, iTab) != 0 &&
+ int32((*WhereTerm)(unsafe.Pointer(pTerm)).FwtFlags)&TERM_VNULL == 0 {
return 1
}
@@ -133424,7 +135448,7 @@ __3:
// bias the scoring in favor of using an index, since the worst-case
// performance of using an index is far better than the worst-case performance
// of a full table scan.
-func whereLoopAddBtree(tls *libc.TLS, pBuilder uintptr, mPrereq Bitmask) int32 { /* sqlite3.c:152198:12: */
+func whereLoopAddBtree(tls *libc.TLS, pBuilder uintptr, mPrereq Bitmask) int32 { /* sqlite3.c:153593:12: */
bp := tls.Alloc(102)
defer tls.Free(102)
@@ -133442,21 +135466,21 @@ func whereLoopAddBtree(tls *libc.TLS, pBuilder uintptr, mPrereq Bitmask) int32 {
var iSortIdx int32 = 1 // Index number
var b int32 // A boolean value
var rSize LogEst // number of rows in the table
- var rLogSize LogEst // Logarithm of the number of rows in the table
var pWC uintptr // The parsed WHERE clause
var pTab uintptr // Table being queried
pNew = (*WhereLoopBuilder)(unsafe.Pointer(pBuilder)).FpNew
pWInfo = (*WhereLoopBuilder)(unsafe.Pointer(pBuilder)).FpWInfo
pTabList = (*WhereInfo)(unsafe.Pointer(pWInfo)).FpTabList
- pSrc = ((pTabList + 8 /* &.a */) + uintptr((*WhereLoop)(unsafe.Pointer(pNew)).FiTab)*72)
+ pSrc = pTabList + 8 + uintptr((*WhereLoop)(unsafe.Pointer(pNew)).FiTab)*72
pTab = (*SrcItem)(unsafe.Pointer(pSrc)).FpTab
pWC = (*WhereLoopBuilder)(unsafe.Pointer(pBuilder)).FpWC
- if (uint32(int32(*(*uint16)(unsafe.Pointer(pSrc + 36 /* &.fg */ + 4 /* &.isIndexedBy */)) & 0x2 >> 1))) != 0 {
+ if uint32(int32(*(*uint16)(unsafe.Pointer(pSrc + 36 + 4))&0x2>>1)) != 0 {
+
// An INDEXED BY clause specifies a particular index to use
- pProbe = *(*uintptr)(unsafe.Pointer(pSrc + 68 /* &.u2 */))
- } else if !(((*Table)(unsafe.Pointer((pTab))).FtabFlags & U32(TF_WithoutRowid)) == U32(0)) {
+ pProbe = *(*uintptr)(unsafe.Pointer(pSrc + 68))
+ } else if !((*Table)(unsafe.Pointer(pTab)).FtabFlags&U32(TF_WithoutRowid) == U32(0)) {
pProbe = (*Table)(unsafe.Pointer(pTab)).FpIndex
} else {
// There is no INDEXED BY clause. Create a fake Index object in local
@@ -133472,11 +135496,11 @@ func whereLoopAddBtree(tls *libc.TLS, pBuilder uintptr, mPrereq Bitmask) int32 {
(*Index)(unsafe.Pointer(bp /* &sPk */)).FonError = U8(OE_Replace)
(*Index)(unsafe.Pointer(bp /* &sPk */)).FpTable = pTab
(*Index)(unsafe.Pointer(bp /* &sPk */)).FszIdxRow = (*Table)(unsafe.Pointer(pTab)).FszTabRow
- libc.SetBitFieldPtr16Uint32(bp /* &sPk */ +56 /* &.idxType */, uint32(SQLITE_IDXTYPE_IPK), 0, 0x3)
+ libc.SetBitFieldPtr16Uint32(bp+56, uint32(SQLITE_IDXTYPE_IPK), 0, 0x3)
*(*LogEst)(unsafe.Pointer(bp + 98 /* &aiRowEstPk[0] */)) = (*Table)(unsafe.Pointer(pTab)).FnRowLogEst
*(*LogEst)(unsafe.Pointer(bp + 98 /* &aiRowEstPk[0] */ + 1*2)) = int16(0)
pFirst = (*Table)(unsafe.Pointer((*SrcItem)(unsafe.Pointer(pSrc)).FpTab)).FpIndex
- if (int32(*(*uint16)(unsafe.Pointer((pSrc + 36 /* &.fg */) + 4 /* &.notIndexed */)) & 0x1 >> 0)) == 0 {
+ if int32(*(*uint16)(unsafe.Pointer(pSrc + 36 + 4))&0x1>>0) == 0 {
// The real indices of the table are only considered if the
// NOT INDEXED qualifier is omitted from the FROM clause
(*Index)(unsafe.Pointer(bp /* &sPk */)).FpNext = pFirst
@@ -133484,28 +135508,29 @@ func whereLoopAddBtree(tls *libc.TLS, pBuilder uintptr, mPrereq Bitmask) int32 {
pProbe = bp /* &sPk */
}
rSize = (*Table)(unsafe.Pointer(pTab)).FnRowLogEst
- rLogSize = estLog(tls, rSize)
// Automatic indexes
- if ((((((!(int32((*WhereLoopBuilder)(unsafe.Pointer(pBuilder)).FpOrSet) != 0) && // Not part of an OR optimization
- ((int32((*WhereInfo)(unsafe.Pointer(pWInfo)).FwctrlFlags) & WHERE_OR_SUBCLAUSE) == 0)) &&
- (((*Sqlite3)(unsafe.Pointer((*Parse)(unsafe.Pointer((*WhereInfo)(unsafe.Pointer(pWInfo)).FpParse)).Fdb)).Fflags & uint64(SQLITE_AutoIndex)) != uint64(0))) &&
- !((int32(*(*uint16)(unsafe.Pointer(pSrc + 36 /* &.fg */ + 4 /* &.isIndexedBy */)) & 0x2 >> 1)) != 0)) && // Has no INDEXED BY clause
- !((int32(*(*uint16)(unsafe.Pointer(pSrc + 36 /* &.fg */ + 4 /* &.notIndexed */)) & 0x1 >> 0)) != 0)) && // Has no NOT INDEXED clause
- (((*Table)(unsafe.Pointer((pTab))).FtabFlags & U32(TF_WithoutRowid)) == U32(0))) && // Not WITHOUT ROWID table. (FIXME: Why not?)
- !((int32(*(*uint16)(unsafe.Pointer(pSrc + 36 /* &.fg */ + 4 /* &.isCorrelated */)) & 0x8 >> 3)) != 0)) && // Not a correlated subquery
- !((int32(*(*uint16)(unsafe.Pointer(pSrc + 36 /* &.fg */ + 4 /* &.isRecursive */)) & 0x20 >> 5)) != 0) {
+ if !(int32((*WhereLoopBuilder)(unsafe.Pointer(pBuilder)).FpOrSet) != 0) &&
+ int32((*WhereInfo)(unsafe.Pointer(pWInfo)).FwctrlFlags)&WHERE_OR_SUBCLAUSE == 0 &&
+ (*Sqlite3)(unsafe.Pointer((*Parse)(unsafe.Pointer((*WhereInfo)(unsafe.Pointer(pWInfo)).FpParse)).Fdb)).Fflags&uint64(SQLITE_AutoIndex) != uint64(0) &&
+ !(int32(*(*uint16)(unsafe.Pointer(pSrc + 36 + 4))&0x2>>1) != 0) &&
+ !(int32(*(*uint16)(unsafe.Pointer(pSrc + 36 + 4))&0x1>>0) != 0) &&
+ (*Table)(unsafe.Pointer(pTab)).FtabFlags&U32(TF_WithoutRowid) == U32(0) &&
+ !(int32(*(*uint16)(unsafe.Pointer(pSrc + 36 + 4))&0x8>>3) != 0) &&
+ !(int32(*(*uint16)(unsafe.Pointer(pSrc + 36 + 4))&0x20>>5) != 0) {
// Generate auto-index WhereLoops
+ var rLogSize LogEst // Logarithm of the number of rows in the table
var pTerm uintptr
- var pWCEnd uintptr = ((*WhereClause)(unsafe.Pointer(pWC)).Fa + uintptr((*WhereClause)(unsafe.Pointer(pWC)).FnTerm)*48)
- for pTerm = (*WhereClause)(unsafe.Pointer(pWC)).Fa; (rc == SQLITE_OK) && (pTerm < pWCEnd); pTerm += 48 {
- if ((*WhereTerm)(unsafe.Pointer(pTerm)).FprereqRight & (*WhereLoop)(unsafe.Pointer(pNew)).FmaskSelf) != 0 {
+ var pWCEnd uintptr = (*WhereClause)(unsafe.Pointer(pWC)).Fa + uintptr((*WhereClause)(unsafe.Pointer(pWC)).FnTerm)*48
+ rLogSize = estLog(tls, rSize)
+ for pTerm = (*WhereClause)(unsafe.Pointer(pWC)).Fa; rc == SQLITE_OK && pTerm < pWCEnd; pTerm += 48 {
+ if (*WhereTerm)(unsafe.Pointer(pTerm)).FprereqRight&(*WhereLoop)(unsafe.Pointer(pNew)).FmaskSelf != 0 {
continue
}
if termCanDriveIndex(tls, pTerm, pSrc, uint64(0)) != 0 {
- *(*U16)(unsafe.Pointer(pNew + 24 /* &.u */ /* &.btree */ /* &.nEq */)) = U16(1)
+ *(*U16)(unsafe.Pointer(pNew + 24)) = U16(1)
(*WhereLoop)(unsafe.Pointer(pNew)).FnSkip = U16(0)
- *(*uintptr)(unsafe.Pointer(pNew + 24 /* &.u */ /* &.btree */ + 8 /* &.pIndex */)) = uintptr(0)
+ *(*uintptr)(unsafe.Pointer(pNew + 24 + 8 /* &.pIndex */)) = uintptr(0)
(*WhereLoop)(unsafe.Pointer(pNew)).FnLTerm = U16(1)
*(*uintptr)(unsafe.Pointer((*WhereLoop)(unsafe.Pointer(pNew)).FaLTerm)) = pTerm
// TUNING: One-time cost for computing the automatic index is
@@ -133516,11 +135541,11 @@ func whereLoopAddBtree(tls *libc.TLS, pBuilder uintptr, mPrereq Bitmask) int32 {
// will be more aggressive about generating automatic indexes for
// those objects, since there is no opportunity to add schema
// indexes on subqueries and views.
- (*WhereLoop)(unsafe.Pointer(pNew)).FrSetup = (LogEst(int32(rLogSize) + int32(rSize)))
- if ((*Table)(unsafe.Pointer(pTab)).FpSelect == uintptr(0)) && (((*Table)(unsafe.Pointer(pTab)).FtabFlags & U32(TF_Ephemeral)) == U32(0)) {
- *(*LogEst)(unsafe.Pointer(pNew + 18 /* &.rSetup */)) += int16((28))
+ (*WhereLoop)(unsafe.Pointer(pNew)).FrSetup = LogEst(int32(rLogSize) + int32(rSize))
+ if !(int32((*Table)(unsafe.Pointer(pTab)).FeTabType) == TABTYP_VIEW) && (*Table)(unsafe.Pointer(pTab)).FtabFlags&U32(TF_Ephemeral) == U32(0) {
+ *(*LogEst)(unsafe.Pointer(pNew + 18)) += int16(28)
} else {
- *(*LogEst)(unsafe.Pointer(pNew + 18 /* &.rSetup */)) -= int16((10))
+ *(*LogEst)(unsafe.Pointer(pNew + 18)) -= int16(10)
}
if int32((*WhereLoop)(unsafe.Pointer(pNew)).FrSetup) < 0 {
@@ -133533,7 +135558,7 @@ func whereLoopAddBtree(tls *libc.TLS, pBuilder uintptr, mPrereq Bitmask) int32 {
(*WhereLoop)(unsafe.Pointer(pNew)).FnOut = int16(43)
(*WhereLoop)(unsafe.Pointer(pNew)).FrRun = Xsqlite3LogEstAdd(tls, rLogSize, (*WhereLoop)(unsafe.Pointer(pNew)).FnOut)
(*WhereLoop)(unsafe.Pointer(pNew)).FwsFlags = U32(WHERE_AUTO_INDEX)
- (*WhereLoop)(unsafe.Pointer(pNew)).Fprereq = (mPrereq | (*WhereTerm)(unsafe.Pointer(pTerm)).FprereqRight)
+ (*WhereLoop)(unsafe.Pointer(pNew)).Fprereq = mPrereq | (*WhereTerm)(unsafe.Pointer(pTerm)).FprereqRight
rc = whereLoopInsert(tls, pBuilder, pNew)
}
}
@@ -133542,36 +135567,36 @@ func whereLoopAddBtree(tls *libc.TLS, pBuilder uintptr, mPrereq Bitmask) int32 {
// Loop over all indices. If there was an INDEXED BY clause, then only
// consider index pProbe.
__1:
- if !((rc == SQLITE_OK) && (pProbe != 0)) {
+ if !(rc == SQLITE_OK && pProbe != 0) {
goto __3
}
{
- var isLeft int32 = (libc.Bool32((int32((*SrcItem)(unsafe.Pointer(pSrc)).Ffg.Fjointype) & JT_OUTER) != 0))
- if ((*Index)(unsafe.Pointer(pProbe)).FpPartIdxWhere != uintptr(0)) &&
+ var isLeft int32 = libc.Bool32(int32((*SrcItem)(unsafe.Pointer(pSrc)).Ffg.Fjointype)&JT_OUTER != 0)
+ if (*Index)(unsafe.Pointer(pProbe)).FpPartIdxWhere != uintptr(0) &&
!(whereUsablePartialIndex(tls, (*SrcItem)(unsafe.Pointer(pSrc)).FiCursor, isLeft, pWC,
(*Index)(unsafe.Pointer(pProbe)).FpPartIdxWhere) != 0) {
// See ticket [98d973b8f5]
goto __2 // Partial index inappropriate for this query
}
- if (uint32(int32(*(*uint16)(unsafe.Pointer(pProbe + 56 /* &.bNoQuery */)) & 0x100 >> 8))) != 0 {
+ if uint32(int32(*(*uint16)(unsafe.Pointer(pProbe + 56))&0x100>>8)) != 0 {
goto __2
}
rSize = *(*LogEst)(unsafe.Pointer((*Index)(unsafe.Pointer(pProbe)).FaiRowLogEst))
- *(*U16)(unsafe.Pointer(pNew + 24 /* &.u */ /* &.btree */ /* &.nEq */)) = U16(0)
- *(*U16)(unsafe.Pointer(pNew + 24 /* &.u */ /* &.btree */ + 2 /* &.nBtm */)) = U16(0)
- *(*U16)(unsafe.Pointer(pNew + 24 /* &.u */ /* &.btree */ + 4 /* &.nTop */)) = U16(0)
+ *(*U16)(unsafe.Pointer(pNew + 24)) = U16(0)
+ *(*U16)(unsafe.Pointer(pNew + 24 + 2 /* &.nBtm */)) = U16(0)
+ *(*U16)(unsafe.Pointer(pNew + 24 + 4 /* &.nTop */)) = U16(0)
(*WhereLoop)(unsafe.Pointer(pNew)).FnSkip = U16(0)
(*WhereLoop)(unsafe.Pointer(pNew)).FnLTerm = U16(0)
(*WhereLoop)(unsafe.Pointer(pNew)).FiSortIdx = U8(0)
(*WhereLoop)(unsafe.Pointer(pNew)).FrSetup = int16(0)
(*WhereLoop)(unsafe.Pointer(pNew)).Fprereq = mPrereq
(*WhereLoop)(unsafe.Pointer(pNew)).FnOut = rSize
- *(*uintptr)(unsafe.Pointer(pNew + 24 /* &.u */ /* &.btree */ + 8 /* &.pIndex */)) = pProbe
+ *(*uintptr)(unsafe.Pointer(pNew + 24 + 8 /* &.pIndex */)) = pProbe
b = indexMightHelpWithOrderBy(tls, pBuilder, pProbe, (*SrcItem)(unsafe.Pointer(pSrc)).FiCursor)
// The ONEPASS_DESIRED flags never occurs together with ORDER BY
- if (int32(*(*uint16)(unsafe.Pointer(pProbe + 56 /* &.idxType */)) & 0x3 >> 0)) == SQLITE_IDXTYPE_IPK {
+ if int32(*(*uint16)(unsafe.Pointer(pProbe + 56))&0x3>>0) == SQLITE_IDXTYPE_IPK {
// Integer primary key index
(*WhereLoop)(unsafe.Pointer(pNew)).FwsFlags = U32(WHERE_IPK)
@@ -133593,7 +135618,7 @@ __1:
// to use an index in that case, since the constraint might be for
// the scarcer of the two values, and in that case an index lookup is
// better.
- (*WhereLoop)(unsafe.Pointer(pNew)).FrRun = (LogEst((int32(rSize) + 16) - (2 * (libc.Bool32(((*Table)(unsafe.Pointer(pTab)).FtabFlags & U32(TF_HasStat4)) != U32(0))))))
+ (*WhereLoop)(unsafe.Pointer(pNew)).FrRun = LogEst(int32(rSize) + 16 - 2*libc.Bool32((*Table)(unsafe.Pointer(pTab)).FtabFlags&U32(TF_HasStat4) != U32(0)))
whereLoopOutputAdjust(tls, pWC, pNew, rSize)
rc = whereLoopInsert(tls, pBuilder, pNew)
@@ -133603,30 +135628,30 @@ __1:
}
} else {
var m Bitmask
- if (uint32(int32(*(*uint16)(unsafe.Pointer(pProbe + 56 /* &.isCovering */)) & 0x20 >> 5))) != 0 {
- (*WhereLoop)(unsafe.Pointer(pNew)).FwsFlags = (U32(WHERE_IDX_ONLY | WHERE_INDEXED))
+ if uint32(int32(*(*uint16)(unsafe.Pointer(pProbe + 56))&0x20>>5)) != 0 {
+ (*WhereLoop)(unsafe.Pointer(pNew)).FwsFlags = U32(WHERE_IDX_ONLY | WHERE_INDEXED)
m = uint64(0)
} else {
- m = ((*SrcItem)(unsafe.Pointer(pSrc)).FcolUsed & (*Index)(unsafe.Pointer(pProbe)).FcolNotIdxed)
+ m = (*SrcItem)(unsafe.Pointer(pSrc)).FcolUsed & (*Index)(unsafe.Pointer(pProbe)).FcolNotIdxed
(*WhereLoop)(unsafe.Pointer(pNew)).FwsFlags = func() uint32 {
if m == uint64(0) {
- return (uint32(WHERE_IDX_ONLY | WHERE_INDEXED))
+ return uint32(WHERE_IDX_ONLY | WHERE_INDEXED)
}
return uint32(WHERE_INDEXED)
}()
}
// Full scan via index
- if ((((b != 0) ||
- !(((*Table)(unsafe.Pointer((pTab))).FtabFlags & U32(TF_WithoutRowid)) == U32(0))) ||
- ((*Index)(unsafe.Pointer(pProbe)).FpPartIdxWhere != uintptr(0))) ||
- ((uint32(int32(*(*uint16)(unsafe.Pointer((pSrc + 36 /* &.fg */) + 4 /* &.isIndexedBy */)) & 0x2 >> 1))) != 0)) ||
- ((((((m == uint64(0)) &&
- ((int32(*(*uint16)(unsafe.Pointer(pProbe + 56 /* &.bUnordered */)) & 0x4 >> 2)) == 0)) &&
- (int32((*Index)(unsafe.Pointer(pProbe)).FszIdxRow) < int32((*Table)(unsafe.Pointer(pTab)).FszTabRow))) &&
- ((int32((*WhereInfo)(unsafe.Pointer(pWInfo)).FwctrlFlags) & WHERE_ONEPASS_DESIRED) == 0)) &&
- (Xsqlite3Config.FbUseCis != 0)) &&
- (((*Sqlite3)(unsafe.Pointer(((*Parse)(unsafe.Pointer((*WhereInfo)(unsafe.Pointer(pWInfo)).FpParse)).Fdb))).FdbOptFlags & (U32(SQLITE_CoverIdxScan))) == U32(0))) {
+ if b != 0 ||
+ !((*Table)(unsafe.Pointer(pTab)).FtabFlags&U32(TF_WithoutRowid) == U32(0)) ||
+ (*Index)(unsafe.Pointer(pProbe)).FpPartIdxWhere != uintptr(0) ||
+ uint32(int32(*(*uint16)(unsafe.Pointer(pSrc + 36 + 4))&0x2>>1)) != 0 ||
+ m == uint64(0) &&
+ int32(*(*uint16)(unsafe.Pointer(pProbe + 56))&0x4>>2) == 0 &&
+ int32((*Index)(unsafe.Pointer(pProbe)).FszIdxRow) < int32((*Table)(unsafe.Pointer(pTab)).FszTabRow) &&
+ int32((*WhereInfo)(unsafe.Pointer(pWInfo)).FwctrlFlags)&WHERE_ONEPASS_DESIRED == 0 &&
+ Xsqlite3Config.FbUseCis != 0 &&
+ (*Sqlite3)(unsafe.Pointer((*Parse)(unsafe.Pointer((*WhereInfo)(unsafe.Pointer(pWInfo)).FpParse)).Fdb)).FdbOptFlags&U32(SQLITE_CoverIdxScan) == U32(0) {
(*WhereLoop)(unsafe.Pointer(pNew)).FiSortIdx = func() uint8 {
if b != 0 {
return uint8(iSortIdx)
@@ -133637,30 +135662,30 @@ __1:
// The cost of visiting the index rows is N*K, where K is
// between 1.1 and 3.0, depending on the relative sizes of the
// index and table rows.
- (*WhereLoop)(unsafe.Pointer(pNew)).FrRun = (LogEst((int32(rSize) + 1) + ((15 * int32((*Index)(unsafe.Pointer(pProbe)).FszIdxRow)) / int32((*Table)(unsafe.Pointer(pTab)).FszTabRow))))
+ (*WhereLoop)(unsafe.Pointer(pNew)).FrRun = LogEst(int32(rSize) + 1 + 15*int32((*Index)(unsafe.Pointer(pProbe)).FszIdxRow)/int32((*Table)(unsafe.Pointer(pTab)).FszTabRow))
if m != uint64(0) {
// If this is a non-covering index scan, add in the cost of
// doing table lookups. The cost will be 3x the number of
// lookups. Take into account WHERE clause terms that can be
// satisfied using just the index, and that do not require a
// table lookup.
- var nLookup LogEst = (LogEst(int32(rSize) + 16)) // Base cost: N*3
+ var nLookup LogEst = LogEst(int32(rSize) + 16) // Base cost: N*3
var ii int32
var iCur int32 = (*SrcItem)(unsafe.Pointer(pSrc)).FiCursor
- var pWC2 uintptr = (pWInfo + 80 /* &.sWC */)
+ var pWC2 uintptr = pWInfo + 80
for ii = 0; ii < (*WhereClause)(unsafe.Pointer(pWC2)).FnTerm; ii++ {
- var pTerm uintptr = ((*WhereClause)(unsafe.Pointer(pWC2)).Fa + uintptr(ii)*48)
+ var pTerm uintptr = (*WhereClause)(unsafe.Pointer(pWC2)).Fa + uintptr(ii)*48
if !(Xsqlite3ExprCoveredByIndex(tls, (*WhereTerm)(unsafe.Pointer(pTerm)).FpExpr, iCur, pProbe) != 0) {
break
}
// pTerm can be evaluated using just the index. So reduce
// the expected number of table lookups accordingly
if int32((*WhereTerm)(unsafe.Pointer(pTerm)).FtruthProb) <= 0 {
- nLookup = LogEst(int32(nLookup) + (int32((*WhereTerm)(unsafe.Pointer(pTerm)).FtruthProb)))
+ nLookup = LogEst(int32(nLookup) + int32((*WhereTerm)(unsafe.Pointer(pTerm)).FtruthProb))
} else {
nLookup--
- if (int32((*WhereTerm)(unsafe.Pointer(pTerm)).FeOperator) & (WO_EQ | WO_IS)) != 0 {
- nLookup = int16(int32(nLookup) - (19))
+ if int32((*WhereTerm)(unsafe.Pointer(pTerm)).FeOperator)&(WO_EQ|WO_IS) != 0 {
+ nLookup = int16(int32(nLookup) - 19)
}
}
}
@@ -133684,7 +135709,7 @@ __1:
// unique index is used (making the index functionally non-unique)
// then the sqlite_stat1 data becomes important for scoring the
// plan
- *(*U32)(unsafe.Pointer(pTab + 36 /* &.tabFlags */)) |= (U32(TF_StatsUsed))
+ *(*U32)(unsafe.Pointer(pTab + 28)) |= U32(TF_StatsUsed)
}
Xsqlite3Stat4ProbeFree(tls, (*WhereLoopBuilder)(unsafe.Pointer(pBuilder)).FpRec)
(*WhereLoopBuilder)(unsafe.Pointer(pBuilder)).FnRecValid = 0
@@ -133694,7 +135719,7 @@ __1:
goto __2
__2:
pProbe = func() uintptr {
- if (uint32(int32(*(*uint16)(unsafe.Pointer(pSrc + 36 /* &.fg */ + 4 /* &.isIndexedBy */)) & 0x2 >> 1))) != 0 {
+ if uint32(int32(*(*uint16)(unsafe.Pointer(pSrc + 36 + 4))&0x2>>1)) != 0 {
return uintptr(0)
}
return (*Index)(unsafe.Pointer(pProbe)).FpNext
@@ -133725,7 +135750,7 @@ __3:
//
// Output parameter *pbIn is set to true if the plan added to pBuilder
// uses one or more WO_IN terms, or false otherwise.
-func whereLoopAddVirtualOne(tls *libc.TLS, pBuilder uintptr, mPrereq Bitmask, mUsable Bitmask, mExclude U16, pIdxInfo uintptr, mNoOmit U16, pbIn uintptr) int32 { /* sqlite3.c:152472:12: */
+func whereLoopAddVirtualOne(tls *libc.TLS, pBuilder uintptr, mPrereq Bitmask, mUsable Bitmask, mExclude U16, pIdxInfo uintptr, mNoOmit U16, pbIn uintptr) int32 { /* sqlite3.c:153868:12: */
bp := tls.Alloc(16)
defer tls.Free(16)
@@ -133737,7 +135762,7 @@ func whereLoopAddVirtualOne(tls *libc.TLS, pBuilder uintptr, mPrereq Bitmask, mU
var rc int32 = SQLITE_OK
var pNew uintptr = (*WhereLoopBuilder)(unsafe.Pointer(pBuilder)).FpNew
var pParse uintptr = (*WhereInfo)(unsafe.Pointer((*WhereLoopBuilder)(unsafe.Pointer(pBuilder)).FpWInfo)).FpParse
- var pSrc uintptr = (((*WhereInfo)(unsafe.Pointer((*WhereLoopBuilder)(unsafe.Pointer(pBuilder)).FpWInfo)).FpTabList + 8 /* &.a */) + uintptr((*WhereLoop)(unsafe.Pointer(pNew)).FiTab)*72)
+ var pSrc uintptr = (*WhereInfo)(unsafe.Pointer((*WhereLoopBuilder)(unsafe.Pointer(pBuilder)).FpWInfo)).FpTabList + 8 + uintptr((*WhereLoop)(unsafe.Pointer(pNew)).FiTab)*72
var nConstraint int32 = (*Sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FnConstraint
*(*int32)(unsafe.Pointer(pbIn)) = 0
@@ -133745,17 +135770,17 @@ func whereLoopAddVirtualOne(tls *libc.TLS, pBuilder uintptr, mPrereq Bitmask, mU
// Set the usable flag on the subset of constraints identified by
// arguments mUsable and mExclude.
- pIdxCons = *(*uintptr)(unsafe.Pointer((pIdxInfo + 4 /* &.aConstraint */)))
+ pIdxCons = *(*uintptr)(unsafe.Pointer(pIdxInfo + 4))
i = 0
__1:
if !(i < nConstraint) {
goto __3
}
{
- var pTerm uintptr = ((*WhereClause)(unsafe.Pointer(pWC)).Fa + uintptr((*sqlite3_index_constraint)(unsafe.Pointer(pIdxCons)).FiTermOffset)*48)
+ var pTerm uintptr = (*WhereClause)(unsafe.Pointer(pWC)).Fa + uintptr((*sqlite3_index_constraint)(unsafe.Pointer(pIdxCons)).FiTermOffset)*48
(*sqlite3_index_constraint)(unsafe.Pointer(pIdxCons)).Fusable = uint8(0)
- if (((*WhereTerm)(unsafe.Pointer(pTerm)).FprereqRight & mUsable) == (*WhereTerm)(unsafe.Pointer(pTerm)).FprereqRight) &&
- ((int32((*WhereTerm)(unsafe.Pointer(pTerm)).FeOperator) & int32(mExclude)) == 0) {
+ if (*WhereTerm)(unsafe.Pointer(pTerm)).FprereqRight&mUsable == (*WhereTerm)(unsafe.Pointer(pTerm)).FprereqRight &&
+ int32((*WhereTerm)(unsafe.Pointer(pTerm)).FeOperator)&int32(mExclude) == 0 {
(*sqlite3_index_constraint)(unsafe.Pointer(pIdxCons)).Fusable = uint8(1)
}
@@ -133770,12 +135795,12 @@ __3:
;
// Initialize the output fields of the sqlite3_index_info structure
- libc.Xmemset(tls, pUsage, 0, (uint32(unsafe.Sizeof(sqlite3_index_constraint_usage{})) * uint32(nConstraint)))
+ libc.Xmemset(tls, pUsage, 0, uint32(unsafe.Sizeof(sqlite3_index_constraint_usage{}))*uint32(nConstraint))
(*Sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FidxStr = uintptr(0)
(*Sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FidxNum = 0
(*Sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).ForderByConsumed = 0
- (*Sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FestimatedCost = (float64((1e99)) / float64(2))
+ (*Sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FestimatedCost = float64(1e99) / float64(2)
(*Sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FestimatedRows = int64(25)
(*Sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FidxFlags = 0
(*Sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FcolUsed = Sqlite3_uint64(Sqlite3_int64((*SrcItem)(unsafe.Pointer(pSrc)).FcolUsed))
@@ -133798,8 +135823,8 @@ __3:
for i = 0; i < nConstraint; i++ {
*(*uintptr)(unsafe.Pointer((*WhereLoop)(unsafe.Pointer(pNew)).FaLTerm + uintptr(i)*4)) = uintptr(0)
}
- *(*U16)(unsafe.Pointer(pNew + 24 /* &.u */ /* &.vtab */ + 6 /* &.omitMask */)) = U16(0)
- pIdxCons = *(*uintptr)(unsafe.Pointer((pIdxInfo + 4 /* &.aConstraint */)))
+ *(*U16)(unsafe.Pointer(pNew + 24 + 6 /* &.omitMask */)) = U16(0)
+ pIdxCons = *(*uintptr)(unsafe.Pointer(pIdxInfo + 4))
i = 0
__4:
if !(i < nConstraint) {
@@ -133807,21 +135832,21 @@ __4:
}
{
var iTerm int32
- if (libc.AssignInt32(&iTerm, ((*sqlite3_index_constraint_usage)(unsafe.Pointer(pUsage+uintptr(i)*8)).FargvIndex - 1))) >= 0 {
+ if libc.AssignInt32(&iTerm, (*sqlite3_index_constraint_usage)(unsafe.Pointer(pUsage+uintptr(i)*8)).FargvIndex-1) >= 0 {
var pTerm uintptr
var j int32 = (*sqlite3_index_constraint)(unsafe.Pointer(pIdxCons)).FiTermOffset
- if ((((iTerm >= nConstraint) ||
- (j < 0)) ||
- (j >= (*WhereClause)(unsafe.Pointer(pWC)).FnTerm)) ||
- (*(*uintptr)(unsafe.Pointer((*WhereLoop)(unsafe.Pointer(pNew)).FaLTerm + uintptr(iTerm)*4)) != uintptr(0))) ||
- (int32((*sqlite3_index_constraint)(unsafe.Pointer(pIdxCons)).Fusable) == 0) {
- Xsqlite3ErrorMsg(tls, pParse, ts+20249 /* "%s.xBestIndex ma..." */, libc.VaList(bp, (*Table)(unsafe.Pointer((*SrcItem)(unsafe.Pointer(pSrc)).FpTab)).FzName))
+ if iTerm >= nConstraint ||
+ j < 0 ||
+ j >= (*WhereClause)(unsafe.Pointer(pWC)).FnTerm ||
+ *(*uintptr)(unsafe.Pointer((*WhereLoop)(unsafe.Pointer(pNew)).FaLTerm + uintptr(iTerm)*4)) != uintptr(0) ||
+ int32((*sqlite3_index_constraint)(unsafe.Pointer(pIdxCons)).Fusable) == 0 {
+ Xsqlite3ErrorMsg(tls, pParse, ts+21546 /* "%s.xBestIndex ma..." */, libc.VaList(bp, (*Table)(unsafe.Pointer((*SrcItem)(unsafe.Pointer(pSrc)).FpTab)).FzName))
return SQLITE_ERROR
}
- pTerm = ((*WhereClause)(unsafe.Pointer(pWC)).Fa + uintptr(j)*48)
- *(*Bitmask)(unsafe.Pointer(pNew /* &.prereq */)) |= ((*WhereTerm)(unsafe.Pointer(pTerm)).FprereqRight)
+ pTerm = (*WhereClause)(unsafe.Pointer(pWC)).Fa + uintptr(j)*48
+ *(*Bitmask)(unsafe.Pointer(pNew)) |= (*WhereTerm)(unsafe.Pointer(pTerm)).FprereqRight
*(*uintptr)(unsafe.Pointer((*WhereLoop)(unsafe.Pointer(pNew)).FaLTerm + uintptr(iTerm)*4)) = pTerm
if iTerm > mxTerm {
@@ -133829,21 +135854,21 @@ __4:
}
if (*sqlite3_index_constraint_usage)(unsafe.Pointer(pUsage+uintptr(i)*8)).Fomit != 0 {
- if (i < 16) && (((int32(1) << i) & int32(mNoOmit)) == 0) {
+ if i < 16 && int32(1)<<i&int32(mNoOmit) == 0 {
- *(*U16)(unsafe.Pointer(pNew + 24 /* &.u */ /* &.vtab */ + 6 /* &.omitMask */)) |= U16((int32(1) << iTerm))
+ *(*U16)(unsafe.Pointer(pNew + 24 + 6)) |= U16(int32(1) << iTerm)
} else {
}
}
- if (int32((*WhereTerm)(unsafe.Pointer(pTerm)).FeOperator) & WO_IN) != 0 {
+ if int32((*WhereTerm)(unsafe.Pointer(pTerm)).FeOperator)&WO_IN != 0 {
// A virtual table that is constrained by an IN clause may not
// consume the ORDER BY clause because (1) the order of IN terms
// is not necessarily related to the order of output terms and
// (2) Multiple outputs from a single IN value will not merge
// together.
(*Sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).ForderByConsumed = 0
- *(*int32)(unsafe.Pointer(pIdxInfo + 56 /* &.idxFlags */)) &= (libc.CplInt32(SQLITE_INDEX_SCAN_UNIQUE))
+ *(*int32)(unsafe.Pointer(pIdxInfo + 56)) &= libc.CplInt32(SQLITE_INDEX_SCAN_UNIQUE)
*(*int32)(unsafe.Pointer(pbIn)) = 1
}
}
@@ -133858,22 +135883,22 @@ __5:
__6:
;
- (*WhereLoop)(unsafe.Pointer(pNew)).FnLTerm = (U16(mxTerm + 1))
+ (*WhereLoop)(unsafe.Pointer(pNew)).FnLTerm = U16(mxTerm + 1)
for i = 0; i <= mxTerm; i++ {
if *(*uintptr)(unsafe.Pointer((*WhereLoop)(unsafe.Pointer(pNew)).FaLTerm + uintptr(i)*4)) == uintptr(0) {
// The non-zero argvIdx values must be contiguous. Raise an
// error if they are not
- Xsqlite3ErrorMsg(tls, pParse, ts+20249 /* "%s.xBestIndex ma..." */, libc.VaList(bp+8, (*Table)(unsafe.Pointer((*SrcItem)(unsafe.Pointer(pSrc)).FpTab)).FzName))
+ Xsqlite3ErrorMsg(tls, pParse, ts+21546 /* "%s.xBestIndex ma..." */, libc.VaList(bp+8, (*Table)(unsafe.Pointer((*SrcItem)(unsafe.Pointer(pSrc)).FpTab)).FzName))
return SQLITE_ERROR
}
}
- *(*int32)(unsafe.Pointer(pNew + 24 /* &.u */ /* &.vtab */ /* &.idxNum */)) = (*Sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FidxNum
- *(*U8)(unsafe.Pointer(pNew + 24 /* &.u */ /* &.vtab */ + 4 /* &.needFree */)) = U8((*Sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FneedToFreeIdxStr)
+ *(*int32)(unsafe.Pointer(pNew + 24)) = (*Sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FidxNum
+ *(*U8)(unsafe.Pointer(pNew + 24 + 4 /* &.needFree */)) = U8((*Sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FneedToFreeIdxStr)
(*Sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FneedToFreeIdxStr = 0
- *(*uintptr)(unsafe.Pointer(pNew + 24 /* &.u */ /* &.vtab */ + 8 /* &.idxStr */)) = (*Sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FidxStr
- *(*I8)(unsafe.Pointer(pNew + 24 /* &.u */ /* &.vtab */ + 5 /* &.isOrdered */)) = func() int8 {
+ *(*uintptr)(unsafe.Pointer(pNew + 24 + 8 /* &.idxStr */)) = (*Sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FidxStr
+ *(*I8)(unsafe.Pointer(pNew + 24 + 5 /* &.isOrdered */)) = func() int8 {
if (*Sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).ForderByConsumed != 0 {
return int8((*Sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FnOrderBy)
}
@@ -133885,15 +135910,15 @@ __6:
// Set the WHERE_ONEROW flag if the xBestIndex() method indicated
// that the scan will visit at most one row. Clear it otherwise.
- if ((*Sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FidxFlags & SQLITE_INDEX_SCAN_UNIQUE) != 0 {
- *(*U32)(unsafe.Pointer(pNew + 36 /* &.wsFlags */)) |= (U32(WHERE_ONEROW))
+ if (*Sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FidxFlags&SQLITE_INDEX_SCAN_UNIQUE != 0 {
+ *(*U32)(unsafe.Pointer(pNew + 36)) |= U32(WHERE_ONEROW)
} else {
- *(*U32)(unsafe.Pointer(pNew + 36 /* &.wsFlags */)) &= (libc.Uint32FromInt32(libc.CplInt32(WHERE_ONEROW)))
+ *(*U32)(unsafe.Pointer(pNew + 36)) &= libc.Uint32FromInt32(libc.CplInt32(WHERE_ONEROW))
}
rc = whereLoopInsert(tls, pBuilder, pNew)
- if *(*U8)(unsafe.Pointer(pNew + 24 /* &.u */ /* &.vtab */ + 4 /* &.needFree */)) != 0 {
- Xsqlite3_free(tls, *(*uintptr)(unsafe.Pointer(pNew + 24 /* &.u */ /* &.vtab */ + 8 /* &.idxStr */)))
- *(*U8)(unsafe.Pointer(pNew + 24 /* &.u */ /* &.vtab */ + 4 /* &.needFree */)) = U8(0)
+ if *(*U8)(unsafe.Pointer(pNew + 24 + 4)) != 0 {
+ Xsqlite3_free(tls, *(*uintptr)(unsafe.Pointer(pNew + 24 + 8 /* &.idxStr */)))
+ *(*U8)(unsafe.Pointer(pNew + 24 + 4 /* &.needFree */)) = U8(0)
}
return rc
@@ -133904,10 +135929,10 @@ __6:
// sequence associated with element iCons of the sqlite3_index_info.aConstraint
// array. Or, if iCons is out of range or there is no active xBestIndex
// call, return NULL.
-func Xsqlite3_vtab_collation(tls *libc.TLS, pIdxInfo uintptr, iCons int32) uintptr { /* sqlite3.c:152632:23: */
- var pHidden uintptr = (pIdxInfo + 1*72)
+func Xsqlite3_vtab_collation(tls *libc.TLS, pIdxInfo uintptr, iCons int32) uintptr { /* sqlite3.c:154028:23: */
+ var pHidden uintptr = pIdxInfo + 1*72
var zRet uintptr = uintptr(0)
- if (iCons >= 0) && (iCons < (*Sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FnConstraint) {
+ if iCons >= 0 && iCons < (*Sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FnConstraint {
var pC uintptr = uintptr(0)
var iTerm int32 = (*sqlite3_index_constraint)(unsafe.Pointer((*Sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FaConstraint + uintptr(iCons)*12)).FiTermOffset
var pX uintptr = (*WhereTerm)(unsafe.Pointer((*WhereClause)(unsafe.Pointer((*HiddenIndexInfo)(unsafe.Pointer(pHidden)).FpWC)).Fa + uintptr(iTerm)*48)).FpExpr
@@ -133947,7 +135972,7 @@ func Xsqlite3_vtab_collation(tls *libc.TLS, pIdxInfo uintptr, iCons int32) uintp
// Conversely, all tables in mUnusable must be scanned after the current
// virtual table, so any terms for which the prerequisites overlap with
// mUnusable should always be configured as "not-usable" for xBestIndex.
-func whereLoopAddVirtual(tls *libc.TLS, pBuilder uintptr, mPrereq Bitmask, mUnusable Bitmask) int32 { /* sqlite3.c:152672:12: */
+func whereLoopAddVirtual(tls *libc.TLS, pBuilder uintptr, mPrereq Bitmask, mUnusable Bitmask) int32 { /* sqlite3.c:154068:12: */
bp := tls.Alloc(8)
defer tls.Free(8)
@@ -133968,7 +135993,7 @@ func whereLoopAddVirtual(tls *libc.TLS, pBuilder uintptr, mPrereq Bitmask, mUnus
pParse = (*WhereInfo)(unsafe.Pointer(pWInfo)).FpParse
pWC = (*WhereLoopBuilder)(unsafe.Pointer(pBuilder)).FpWC
pNew = (*WhereLoopBuilder)(unsafe.Pointer(pBuilder)).FpNew
- pSrc = (((*WhereInfo)(unsafe.Pointer(pWInfo)).FpTabList + 8 /* &.a */) + uintptr((*WhereLoop)(unsafe.Pointer(pNew)).FiTab)*72)
+ pSrc = (*WhereInfo)(unsafe.Pointer(pWInfo)).FpTabList + 8 + uintptr((*WhereLoop)(unsafe.Pointer(pNew)).FiTab)*72
p = allocateIndexInfo(tls, pParse, pWC, mUnusable, pSrc, (*WhereLoopBuilder)(unsafe.Pointer(pBuilder)).FpOrderBy,
bp /* &mNoOmit */)
@@ -133978,7 +136003,7 @@ func whereLoopAddVirtual(tls *libc.TLS, pBuilder uintptr, mPrereq Bitmask, mUnus
(*WhereLoop)(unsafe.Pointer(pNew)).FrSetup = int16(0)
(*WhereLoop)(unsafe.Pointer(pNew)).FwsFlags = U32(WHERE_VIRTUALTABLE)
(*WhereLoop)(unsafe.Pointer(pNew)).FnLTerm = U16(0)
- *(*U8)(unsafe.Pointer(pNew + 24 /* &.u */ /* &.vtab */ + 4 /* &.needFree */)) = U8(0)
+ *(*U8)(unsafe.Pointer(pNew + 24 + 4 /* &.needFree */)) = U8(0)
nConstraint = (*Sqlite3_index_info)(unsafe.Pointer(p)).FnConstraint
if whereLoopResize(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, pNew, nConstraint) != 0 {
Xsqlite3DbFree(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, p)
@@ -133994,7 +136019,7 @@ func whereLoopAddVirtual(tls *libc.TLS, pBuilder uintptr, mPrereq Bitmask, mUnus
// and does not use an IN(...) operator, then there is no point in making
// any further calls to xBestIndex() since they will all return the same
// result (if the xBestIndex() implementation is sane).
- if (rc == SQLITE_OK) && (((libc.AssignUint64(&mBest, ((*WhereLoop)(unsafe.Pointer(pNew)).Fprereq & ^mPrereq))) != uint64(0)) || (*(*int32)(unsafe.Pointer(bp + 4 /* bIn */)) != 0)) {
+ if rc == SQLITE_OK && (libc.AssignUint64(&mBest, (*WhereLoop)(unsafe.Pointer(pNew)).Fprereq & ^mPrereq) != uint64(0) || *(*int32)(unsafe.Pointer(bp + 4)) != 0) {
var seenZero int32 = 0 // True if a plan with no prereqs seen
var seenZeroNoIN int32 = 0 // Plan with no prereqs and no IN(...) seen
var mPrev Bitmask = uint64(0)
@@ -134002,12 +136027,12 @@ func whereLoopAddVirtual(tls *libc.TLS, pBuilder uintptr, mPrereq Bitmask, mUnus
// If the plan produced by the earlier call uses an IN(...) term, call
// xBestIndex again, this time with IN(...) terms disabled.
- if *(*int32)(unsafe.Pointer(bp + 4 /* bIn */)) != 0 {
+ if *(*int32)(unsafe.Pointer(bp + 4)) != 0 {
rc = whereLoopAddVirtualOne(tls,
pBuilder, mPrereq, libc.Uint64(libc.Uint64FromInt32(-1)), uint16(WO_IN), p, *(*U16)(unsafe.Pointer(bp /* mNoOmit */)), bp+4 /* &bIn */)
- mBestNoIn = ((*WhereLoop)(unsafe.Pointer(pNew)).Fprereq & ^mPrereq)
+ mBestNoIn = (*WhereLoop)(unsafe.Pointer(pNew)).Fprereq & ^mPrereq
if mBestNoIn == uint64(0) {
seenZero = 1
seenZeroNoIN = 1
@@ -134021,24 +136046,24 @@ func whereLoopAddVirtual(tls *libc.TLS, pBuilder uintptr, mPrereq Bitmask, mUnus
var mNext Bitmask = libc.Uint64(libc.Uint64FromInt32(-1))
for i = 0; i < nConstraint; i++ {
- var mThis Bitmask = ((*WhereTerm)(unsafe.Pointer((*WhereClause)(unsafe.Pointer(pWC)).Fa+uintptr((*sqlite3_index_constraint)(unsafe.Pointer((*Sqlite3_index_info)(unsafe.Pointer(p)).FaConstraint+uintptr(i)*12)).FiTermOffset)*48)).FprereqRight & ^mPrereq)
- if (mThis > mPrev) && (mThis < mNext) {
+ var mThis Bitmask = (*WhereTerm)(unsafe.Pointer((*WhereClause)(unsafe.Pointer(pWC)).Fa+uintptr((*sqlite3_index_constraint)(unsafe.Pointer((*Sqlite3_index_info)(unsafe.Pointer(p)).FaConstraint+uintptr(i)*12)).FiTermOffset)*48)).FprereqRight & ^mPrereq
+ if mThis > mPrev && mThis < mNext {
mNext = mThis
}
}
mPrev = mNext
- if mNext == (libc.Uint64(libc.Uint64FromInt32(-1))) {
+ if mNext == libc.Uint64(libc.Uint64FromInt32(-1)) {
break
}
- if (mNext == mBest) || (mNext == mBestNoIn) {
+ if mNext == mBest || mNext == mBestNoIn {
continue
}
rc = whereLoopAddVirtualOne(tls,
- pBuilder, mPrereq, (mNext | mPrereq), uint16(0), p, *(*U16)(unsafe.Pointer(bp /* mNoOmit */)), bp+4 /* &bIn */)
+ pBuilder, mPrereq, mNext|mPrereq, uint16(0), p, *(*U16)(unsafe.Pointer(bp /* mNoOmit */)), bp+4 /* &bIn */)
if (*WhereLoop)(unsafe.Pointer(pNew)).Fprereq == mPrereq {
seenZero = 1
- if *(*int32)(unsafe.Pointer(bp + 4 /* bIn */)) == 0 {
+ if *(*int32)(unsafe.Pointer(bp + 4)) == 0 {
seenZeroNoIN = 1
}
}
@@ -134047,11 +136072,11 @@ func whereLoopAddVirtual(tls *libc.TLS, pBuilder uintptr, mPrereq Bitmask, mUnus
// If the calls to xBestIndex() in the above loop did not find a plan
// that requires no source tables at all (i.e. one guaranteed to be
// usable), make a call here with all source tables disabled
- if (rc == SQLITE_OK) && (seenZero == 0) {
+ if rc == SQLITE_OK && seenZero == 0 {
rc = whereLoopAddVirtualOne(tls,
pBuilder, mPrereq, mPrereq, uint16(0), p, *(*U16)(unsafe.Pointer(bp /* mNoOmit */)), bp+4 /* &bIn */)
- if *(*int32)(unsafe.Pointer(bp + 4 /* bIn */)) == 0 {
+ if *(*int32)(unsafe.Pointer(bp + 4)) == 0 {
seenZeroNoIN = 1
}
}
@@ -134059,7 +136084,7 @@ func whereLoopAddVirtual(tls *libc.TLS, pBuilder uintptr, mPrereq Bitmask, mUnus
// If the calls to xBestIndex() have so far failed to find a plan
// that requires no source tables at all and does not use an IN(...)
// operator, make a final call to obtain one here.
- if (rc == SQLITE_OK) && (seenZeroNoIN == 0) {
+ if rc == SQLITE_OK && seenZeroNoIN == 0 {
rc = whereLoopAddVirtualOne(tls,
pBuilder, mPrereq, mPrereq, uint16(WO_IN), p, *(*U16)(unsafe.Pointer(bp /* mNoOmit */)), bp+4 /* &bIn */)
@@ -134076,7 +136101,7 @@ func whereLoopAddVirtual(tls *libc.TLS, pBuilder uintptr, mPrereq Bitmask, mUnus
// Add WhereLoop entries to handle OR terms. This works for either
// btrees or virtual tables.
-func whereLoopAddOr(tls *libc.TLS, pBuilder uintptr, mPrereq Bitmask, mUnusable Bitmask) int32 { /* sqlite3.c:152795:12: */
+func whereLoopAddOr(tls *libc.TLS, pBuilder uintptr, mPrereq Bitmask, mUnusable Bitmask) int32 { /* sqlite3.c:154191:12: */
bp := tls.Alloc(616)
defer tls.Free(616)
@@ -134098,17 +136123,17 @@ func whereLoopAddOr(tls *libc.TLS, pBuilder uintptr, mPrereq Bitmask, mUnusable
var pItem uintptr
pWC = (*WhereLoopBuilder)(unsafe.Pointer(pBuilder)).FpWC
- pWCEnd = ((*WhereClause)(unsafe.Pointer(pWC)).Fa + uintptr((*WhereClause)(unsafe.Pointer(pWC)).FnTerm)*48)
+ pWCEnd = (*WhereClause)(unsafe.Pointer(pWC)).Fa + uintptr((*WhereClause)(unsafe.Pointer(pWC)).FnTerm)*48
pNew = (*WhereLoopBuilder)(unsafe.Pointer(pBuilder)).FpNew
libc.Xmemset(tls, bp /* &sSum */, 0, uint32(unsafe.Sizeof(WhereOrSet{})))
- pItem = (((*WhereInfo)(unsafe.Pointer(pWInfo)).FpTabList + 8 /* &.a */) + uintptr((*WhereLoop)(unsafe.Pointer(pNew)).FiTab)*72)
+ pItem = (*WhereInfo)(unsafe.Pointer(pWInfo)).FpTabList + 8 + uintptr((*WhereLoop)(unsafe.Pointer(pNew)).FiTab)*72
iCur = (*SrcItem)(unsafe.Pointer(pItem)).FiCursor
- for pTerm = (*WhereClause)(unsafe.Pointer(pWC)).Fa; (pTerm < pWCEnd) && (rc == SQLITE_OK); pTerm += 48 {
- if ((int32((*WhereTerm)(unsafe.Pointer(pTerm)).FeOperator) & WO_OR) != 0) &&
- (((*WhereOrInfo)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pTerm + 24 /* &.u */)))).Findexable & (*WhereLoop)(unsafe.Pointer(pNew)).FmaskSelf) != uint64(0)) {
- var pOrWC uintptr = (*(*uintptr)(unsafe.Pointer(pTerm + 24 /* &.u */)) /* &.wc */)
- var pOrWCEnd uintptr = ((*WhereClause)(unsafe.Pointer(pOrWC)).Fa + uintptr((*WhereClause)(unsafe.Pointer(pOrWC)).FnTerm)*48)
+ for pTerm = (*WhereClause)(unsafe.Pointer(pWC)).Fa; pTerm < pWCEnd && rc == SQLITE_OK; pTerm += 48 {
+ if int32((*WhereTerm)(unsafe.Pointer(pTerm)).FeOperator)&WO_OR != 0 &&
+ (*WhereOrInfo)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pTerm + 24)))).Findexable&(*WhereLoop)(unsafe.Pointer(pNew)).FmaskSelf != uint64(0) {
+ var pOrWC uintptr = *(*uintptr)(unsafe.Pointer(pTerm + 24))
+ var pOrWCEnd uintptr = (*WhereClause)(unsafe.Pointer(pOrWC)).Fa + uintptr((*WhereClause)(unsafe.Pointer(pOrWC)).FnTerm)*48
var pOrTerm uintptr
var once int32 = 1
var i int32
@@ -134119,8 +136144,8 @@ func whereLoopAddOr(tls *libc.TLS, pBuilder uintptr, mPrereq Bitmask, mUnusable
(*WhereLoopBuilder)(unsafe.Pointer(bp + 520 /* &sSubBuild */)).FpOrSet = bp + 56 /* &sCur */
for pOrTerm = (*WhereClause)(unsafe.Pointer(pOrWC)).Fa; pOrTerm < pOrWCEnd; pOrTerm += 48 {
- if (int32((*WhereTerm)(unsafe.Pointer(pOrTerm)).FeOperator) & WO_AND) != 0 {
- (*WhereLoopBuilder)(unsafe.Pointer(bp + 520 /* &sSubBuild */)).FpWC = (*(*uintptr)(unsafe.Pointer(pOrTerm + 24 /* &.u */)) /* &.wc */)
+ if int32((*WhereTerm)(unsafe.Pointer(pOrTerm)).FeOperator)&WO_AND != 0 {
+ (*WhereLoopBuilder)(unsafe.Pointer(bp + 520 /* &sSubBuild */)).FpWC = *(*uintptr)(unsafe.Pointer(pOrTerm + 24))
} else if (*WhereTerm)(unsafe.Pointer(pOrTerm)).FleftCursor == iCur {
(*WhereClause)(unsafe.Pointer(bp + 112 /* &tempWC */)).FpWInfo = (*WhereClause)(unsafe.Pointer(pWC)).FpWInfo
(*WhereClause)(unsafe.Pointer(bp + 112 /* &tempWC */)).FpOuter = pWC
@@ -134132,7 +136157,7 @@ func whereLoopAddOr(tls *libc.TLS, pBuilder uintptr, mPrereq Bitmask, mUnusable
continue
}
(*WhereOrSet)(unsafe.Pointer(bp + 56 /* &sCur */)).Fn = U16(0)
- if (*Table)(unsafe.Pointer((*SrcItem)(unsafe.Pointer(pItem)).FpTab)).FnModuleArg != 0 {
+ if int32((*Table)(unsafe.Pointer((*SrcItem)(unsafe.Pointer(pItem)).FpTab)).FeTabType) == TABTYP_VTAB {
rc = whereLoopAddVirtual(tls, bp+520 /* &sSubBuild */, mPrereq, mUnusable)
} else {
rc = whereLoopAddBtree(tls, bp+520 /* &sSubBuild */, mPrereq)
@@ -134141,7 +136166,7 @@ func whereLoopAddOr(tls *libc.TLS, pBuilder uintptr, mPrereq Bitmask, mUnusable
rc = whereLoopAddOr(tls, bp+520 /* &sSubBuild */, mPrereq, mUnusable)
}
- if int32((*WhereOrSet)(unsafe.Pointer(bp+56 /* &sCur */)).Fn) == 0 {
+ if int32((*WhereOrSet)(unsafe.Pointer(bp+56)).Fn) == 0 {
(*WhereOrSet)(unsafe.Pointer(bp /* &sSum */)).Fn = U16(0)
break
} else if once != 0 {
@@ -134154,9 +136179,9 @@ func whereLoopAddOr(tls *libc.TLS, pBuilder uintptr, mPrereq Bitmask, mUnusable
(*WhereOrSet)(unsafe.Pointer(bp /* &sSum */)).Fn = U16(0)
for i = 0; i < int32((*WhereOrSet)(unsafe.Pointer(bp+560 /* &sPrev */)).Fn); i++ {
for j = 0; j < int32((*WhereOrSet)(unsafe.Pointer(bp+56 /* &sCur */)).Fn); j++ {
- whereOrInsert(tls, bp /* &sSum */, ((*WhereOrCost)(unsafe.Pointer((bp+560 /* &sPrev */ +8 /* &.a */)+uintptr(i)*16)).Fprereq | (*WhereOrCost)(unsafe.Pointer((bp+56 /* &sCur */ +8 /* &.a */)+uintptr(j)*16)).Fprereq),
- Xsqlite3LogEstAdd(tls, (*WhereOrCost)(unsafe.Pointer((bp+560 /* &sPrev */ +8 /* &.a */)+uintptr(i)*16)).FrRun, (*WhereOrCost)(unsafe.Pointer((bp+56 /* &sCur */ +8 /* &.a */)+uintptr(j)*16)).FrRun),
- Xsqlite3LogEstAdd(tls, (*WhereOrCost)(unsafe.Pointer((bp+560 /* &sPrev */ +8 /* &.a */)+uintptr(i)*16)).FnOut, (*WhereOrCost)(unsafe.Pointer((bp+56 /* &sCur */ +8 /* &.a */)+uintptr(j)*16)).FnOut))
+ whereOrInsert(tls, bp /* &sSum */, (*WhereOrCost)(unsafe.Pointer(bp+560+8+uintptr(i)*16)).Fprereq|(*WhereOrCost)(unsafe.Pointer(bp+56+8+uintptr(j)*16)).Fprereq,
+ Xsqlite3LogEstAdd(tls, (*WhereOrCost)(unsafe.Pointer(bp+560+8+uintptr(i)*16)).FrRun, (*WhereOrCost)(unsafe.Pointer(bp+56+8+uintptr(j)*16)).FrRun),
+ Xsqlite3LogEstAdd(tls, (*WhereOrCost)(unsafe.Pointer(bp+560+8+uintptr(i)*16)).FnOut, (*WhereOrCost)(unsafe.Pointer(bp+56+8+uintptr(j)*16)).FnOut))
}
}
}
@@ -134166,7 +136191,7 @@ func whereLoopAddOr(tls *libc.TLS, pBuilder uintptr, mPrereq Bitmask, mUnusable
(*WhereLoop)(unsafe.Pointer(pNew)).FwsFlags = U32(WHERE_MULTI_OR)
(*WhereLoop)(unsafe.Pointer(pNew)).FrSetup = int16(0)
(*WhereLoop)(unsafe.Pointer(pNew)).FiSortIdx = U8(0)
- libc.Xmemset(tls, (pNew + 24 /* &.u */), 0, uint32(unsafe.Sizeof(struct {
+ libc.Xmemset(tls, pNew+24, 0, uint32(unsafe.Sizeof(struct {
Fbtree struct {
FnEq U16
FnBtm U16
@@ -134175,7 +136200,7 @@ func whereLoopAddOr(tls *libc.TLS, pBuilder uintptr, mPrereq Bitmask, mUnusable
FpIndex uintptr
}
}{})))
- for i = 0; (rc == SQLITE_OK) && (i < int32((*WhereOrSet)(unsafe.Pointer(bp /* &sSum */)).Fn)); i++ {
+ for i = 0; rc == SQLITE_OK && i < int32((*WhereOrSet)(unsafe.Pointer(bp /* &sSum */)).Fn); i++ {
// TUNING: Currently sSum.a[i].rRun is set to the sum of the costs
// of all sub-scans required by the OR-scan. However, due to rounding
// errors, it may be that the cost of the OR-scan is equal to its
@@ -134188,9 +136213,9 @@ func whereLoopAddOr(tls *libc.TLS, pBuilder uintptr, mPrereq Bitmask, mUnusable
//
// the planner may elect to "OR" together a full-table scan and an
// index lookup. And other similarly odd results.
- (*WhereLoop)(unsafe.Pointer(pNew)).FrRun = (LogEst(int32((*WhereOrCost)(unsafe.Pointer((bp /* &sSum */ +8 /* &.a */)+uintptr(i)*16)).FrRun) + 1))
- (*WhereLoop)(unsafe.Pointer(pNew)).FnOut = (*WhereOrCost)(unsafe.Pointer((bp /* &sSum */ + 8 /* &.a */) + uintptr(i)*16)).FnOut
- (*WhereLoop)(unsafe.Pointer(pNew)).Fprereq = (*WhereOrCost)(unsafe.Pointer((bp /* &sSum */ + 8 /* &.a */) + uintptr(i)*16)).Fprereq
+ (*WhereLoop)(unsafe.Pointer(pNew)).FrRun = LogEst(int32((*WhereOrCost)(unsafe.Pointer(bp+8+uintptr(i)*16)).FrRun) + 1)
+ (*WhereLoop)(unsafe.Pointer(pNew)).FnOut = (*WhereOrCost)(unsafe.Pointer(bp + 8 + uintptr(i)*16)).FnOut
+ (*WhereLoop)(unsafe.Pointer(pNew)).Fprereq = (*WhereOrCost)(unsafe.Pointer(bp + 8 + uintptr(i)*16)).Fprereq
rc = whereLoopInsert(tls, pBuilder, pNew)
}
@@ -134200,14 +136225,14 @@ func whereLoopAddOr(tls *libc.TLS, pBuilder uintptr, mPrereq Bitmask, mUnusable
}
// Add all WhereLoop objects for all tables
-func whereLoopAddAll(tls *libc.TLS, pBuilder uintptr) int32 { /* sqlite3.c:152921:12: */
+func whereLoopAddAll(tls *libc.TLS, pBuilder uintptr) int32 { /* sqlite3.c:154317:12: */
var pWInfo uintptr = (*WhereLoopBuilder)(unsafe.Pointer(pBuilder)).FpWInfo
var mPrereq Bitmask = uint64(0)
var mPrior Bitmask = uint64(0)
var iTab int32
var pTabList uintptr = (*WhereInfo)(unsafe.Pointer(pWInfo)).FpTabList
var pItem uintptr
- var pEnd uintptr = ((pTabList + 8 /* &.a */) + uintptr((*WhereInfo)(unsafe.Pointer(pWInfo)).FnLevel)*72)
+ var pEnd uintptr = pTabList + 8 + uintptr((*WhereInfo)(unsafe.Pointer(pWInfo)).FnLevel)*72
var db uintptr = (*Parse)(unsafe.Pointer((*WhereInfo)(unsafe.Pointer(pWInfo)).FpParse)).Fdb
var rc int32 = SQLITE_OK
var pNew uintptr
@@ -134225,34 +136250,34 @@ __1:
{
var mUnusable Bitmask = uint64(0)
(*WhereLoop)(unsafe.Pointer(pNew)).FiTab = U8(iTab)
- *(*uint32)(unsafe.Pointer(pBuilder + 32 /* &.iPlanLimit */)) += (uint32(SQLITE_QUERY_PLANNER_LIMIT_INCR))
- (*WhereLoop)(unsafe.Pointer(pNew)).FmaskSelf = Xsqlite3WhereGetMask(tls, (pWInfo + 488 /* &.sMaskSet */), (*SrcItem)(unsafe.Pointer(pItem)).FiCursor)
- if (int32((*SrcItem)(unsafe.Pointer(pItem)).Ffg.Fjointype) & (JT_LEFT | JT_CROSS)) != 0 {
+ *(*uint32)(unsafe.Pointer(pBuilder + 32)) += uint32(SQLITE_QUERY_PLANNER_LIMIT_INCR)
+ (*WhereLoop)(unsafe.Pointer(pNew)).FmaskSelf = Xsqlite3WhereGetMask(tls, pWInfo+488, (*SrcItem)(unsafe.Pointer(pItem)).FiCursor)
+ if int32((*SrcItem)(unsafe.Pointer(pItem)).Ffg.Fjointype)&(JT_LEFT|JT_CROSS) != 0 {
// This condition is true when pItem is the FROM clause term on the
// right-hand-side of a LEFT or CROSS JOIN.
mPrereq = mPrior
} else {
mPrereq = uint64(0)
}
- if (*Table)(unsafe.Pointer((*SrcItem)(unsafe.Pointer(pItem)).FpTab)).FnModuleArg != 0 {
+ if int32((*Table)(unsafe.Pointer((*SrcItem)(unsafe.Pointer(pItem)).FpTab)).FeTabType) == TABTYP_VTAB {
var p uintptr
- for p = (pItem + 1*72); p < pEnd; p += 72 {
- if (mUnusable != 0) || ((int32((*SrcItem)(unsafe.Pointer(p)).Ffg.Fjointype) & (JT_LEFT | JT_CROSS)) != 0) {
- mUnusable = mUnusable | (Xsqlite3WhereGetMask(tls, (pWInfo + 488 /* &.sMaskSet */), (*SrcItem)(unsafe.Pointer(p)).FiCursor))
+ for p = pItem + 1*72; p < pEnd; p += 72 {
+ if mUnusable != 0 || int32((*SrcItem)(unsafe.Pointer(p)).Ffg.Fjointype)&(JT_LEFT|JT_CROSS) != 0 {
+ mUnusable = mUnusable | Xsqlite3WhereGetMask(tls, pWInfo+488, (*SrcItem)(unsafe.Pointer(p)).FiCursor)
}
}
rc = whereLoopAddVirtual(tls, pBuilder, mPrereq, mUnusable)
} else {
rc = whereLoopAddBtree(tls, pBuilder, mPrereq)
}
- if (rc == SQLITE_OK) && ((*WhereClause)(unsafe.Pointer((*WhereLoopBuilder)(unsafe.Pointer(pBuilder)).FpWC)).FhasOr != 0) {
+ if rc == SQLITE_OK && (*WhereClause)(unsafe.Pointer((*WhereLoopBuilder)(unsafe.Pointer(pBuilder)).FpWC)).FhasOr != 0 {
rc = whereLoopAddOr(tls, pBuilder, mPrereq, mUnusable)
}
- mPrior = mPrior | ((*WhereLoop)(unsafe.Pointer(pNew)).FmaskSelf)
- if (rc != 0) || ((*Sqlite3)(unsafe.Pointer(db)).FmallocFailed != 0) {
+ mPrior = mPrior | (*WhereLoop)(unsafe.Pointer(pNew)).FmaskSelf
+ if rc != 0 || (*Sqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 {
if rc == SQLITE_DONE {
// We hit the query planner search limit set by iPlanLimit
- Xsqlite3_log(tls, SQLITE_WARNING, ts+20275 /* "abbreviated quer..." */, 0)
+ Xsqlite3_log(tls, SQLITE_WARNING, ts+21572 /* "abbreviated quer..." */, 0)
rc = SQLITE_OK
} else {
goto __3
@@ -134288,7 +136313,7 @@ __3:
// as equivalent rows are grouped together. Thus for GROUP BY and DISTINCT
// the pOrderBy terms can be matched in any order. With ORDER BY, the
// pOrderBy terms must be matched in strict left-to-right order.
-func wherePathSatisfiesOrderBy(tls *libc.TLS, pWInfo uintptr, pOrderBy uintptr, pPath uintptr, wctrlFlags U16, nLoop U16, pLast uintptr, pRevMask uintptr) I8 { /* sqlite3.c:152999:11: */
+func wherePathSatisfiesOrderBy(tls *libc.TLS, pWInfo uintptr, pOrderBy uintptr, pPath uintptr, wctrlFlags U16, nLoop U16, pLast uintptr, pRevMask uintptr) I8 { /* sqlite3.c:154395:11: */
var revSet U8 // True if rev is known
var rev U8 // Composite sort order
var revIdx U8 // Index sort order
@@ -134335,64 +136360,64 @@ func wherePathSatisfiesOrderBy(tls *libc.TLS, pWInfo uintptr, pOrderBy uintptr,
// rowid appears in the ORDER BY clause, the corresponding WhereLoop is
// automatically order-distinct.
- if (nLoop != 0) && (((*Sqlite3)(unsafe.Pointer((db))).FdbOptFlags & (U32(SQLITE_OrderByIdxJoin))) != U32(0)) {
+ if nLoop != 0 && (*Sqlite3)(unsafe.Pointer(db)).FdbOptFlags&U32(SQLITE_OrderByIdxJoin) != U32(0) {
return int8(0)
}
nOrderBy = U16((*ExprList)(unsafe.Pointer(pOrderBy)).FnExpr)
- if int32(nOrderBy) > ((int32(uint32(unsafe.Sizeof(Bitmask(0))) * uint32(8))) - 1) {
+ if int32(nOrderBy) > int32(uint32(unsafe.Sizeof(Bitmask(0)))*uint32(8))-1 {
return int8(0)
} // Cannot optimize overly large ORDER BYs
isOrderDistinct = U8(1)
- obDone = ((Bitmask((uint64(1))) << (int32(nOrderBy))) - uint64(1))
+ obDone = Bitmask(uint64(1))<<int32(nOrderBy) - uint64(1)
orderDistinctMask = uint64(0)
ready = uint64(0)
- eqOpMask = (U16((WO_EQ | WO_IS) | WO_ISNULL))
- if (int32(wctrlFlags) & ((WHERE_ORDERBY_LIMIT | WHERE_ORDERBY_MAX) | WHERE_ORDERBY_MIN)) != 0 {
- eqOpMask = U16(int32(eqOpMask) | (WO_IN))
+ eqOpMask = U16(WO_EQ | WO_IS | WO_ISNULL)
+ if int32(wctrlFlags)&(WHERE_ORDERBY_LIMIT|WHERE_ORDERBY_MAX|WHERE_ORDERBY_MIN) != 0 {
+ eqOpMask = U16(int32(eqOpMask) | WO_IN)
}
- for iLoop = 0; ((isOrderDistinct != 0) && (obSat < obDone)) && (iLoop <= int32(nLoop)); iLoop++ {
+ for iLoop = 0; isOrderDistinct != 0 && obSat < obDone && iLoop <= int32(nLoop); iLoop++ {
if iLoop > 0 {
- ready = ready | ((*WhereLoop)(unsafe.Pointer(pLoop)).FmaskSelf)
+ ready = ready | (*WhereLoop)(unsafe.Pointer(pLoop)).FmaskSelf
}
if iLoop < int32(nLoop) {
pLoop = *(*uintptr)(unsafe.Pointer((*WherePath)(unsafe.Pointer(pPath)).FaLoop + uintptr(iLoop)*4))
- if (int32(wctrlFlags) & WHERE_ORDERBY_LIMIT) != 0 {
+ if int32(wctrlFlags)&WHERE_ORDERBY_LIMIT != 0 {
continue
}
} else {
pLoop = pLast
}
- if ((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & U32(WHERE_VIRTUALTABLE)) != 0 {
- if (*(*I8)(unsafe.Pointer((pLoop + 24 /* &.u */ /* &.vtab */) + 5 /* &.isOrdered */)) != 0) && ((int32(wctrlFlags) & WHERE_DISTINCTBY) == 0) {
+ if (*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags&U32(WHERE_VIRTUALTABLE) != 0 {
+ if *(*I8)(unsafe.Pointer(pLoop + 24 + 5)) != 0 && int32(wctrlFlags)&WHERE_DISTINCTBY == 0 {
obSat = obDone
}
break
- } else if (int32(wctrlFlags) & WHERE_DISTINCTBY) != 0 {
- *(*U16)(unsafe.Pointer(pLoop + 24 /* &.u */ /* &.btree */ + 6 /* &.nDistinctCol */)) = U16(0)
+ } else if int32(wctrlFlags)&WHERE_DISTINCTBY != 0 {
+ *(*U16)(unsafe.Pointer(pLoop + 24 + 6 /* &.nDistinctCol */)) = U16(0)
}
- iCur = (*SrcItem)(unsafe.Pointer(((*WhereInfo)(unsafe.Pointer(pWInfo)).FpTabList + 8 /* &.a */) + uintptr((*WhereLoop)(unsafe.Pointer(pLoop)).FiTab)*72)).FiCursor
+ iCur = (*SrcItem)(unsafe.Pointer((*WhereInfo)(unsafe.Pointer(pWInfo)).FpTabList + 8 + uintptr((*WhereLoop)(unsafe.Pointer(pLoop)).FiTab)*72)).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
// loops.
for i = 0; i < int32(nOrderBy); i++ {
- if ((Bitmask((uint64(1))) << (i)) & obSat) != 0 {
+ if Bitmask(uint64(1))<<i&obSat != 0 {
continue
}
- pOBExpr = Xsqlite3ExprSkipCollateAndLikely(tls, (*ExprList_item)(unsafe.Pointer((pOrderBy+8 /* &.a */)+uintptr(i)*20)).FpExpr)
+ pOBExpr = Xsqlite3ExprSkipCollateAndLikely(tls, (*ExprList_item)(unsafe.Pointer(pOrderBy+8+uintptr(i)*20)).FpExpr)
if pOBExpr == uintptr(0) {
continue
}
- if (int32((*Expr)(unsafe.Pointer(pOBExpr)).Fop) != TK_COLUMN) && (int32((*Expr)(unsafe.Pointer(pOBExpr)).Fop) != TK_AGG_COLUMN) {
+ if int32((*Expr)(unsafe.Pointer(pOBExpr)).Fop) != TK_COLUMN && int32((*Expr)(unsafe.Pointer(pOBExpr)).Fop) != TK_AGG_COLUMN {
continue
}
if (*Expr)(unsafe.Pointer(pOBExpr)).FiTable != iCur {
continue
}
- pTerm = Xsqlite3WhereFindTerm(tls, (pWInfo + 80 /* &.sWC */), iCur, int32((*Expr)(unsafe.Pointer(pOBExpr)).FiColumn),
+ pTerm = Xsqlite3WhereFindTerm(tls, pWInfo+80, iCur, int32((*Expr)(unsafe.Pointer(pOBExpr)).FiColumn),
^ready, uint32(eqOpMask), uintptr(0))
if pTerm == uintptr(0) {
continue
@@ -134402,31 +136427,31 @@ func wherePathSatisfiesOrderBy(tls *libc.TLS, pWInfo uintptr, pOrderBy uintptr,
// optimization, and then only if they are actually used
// by the query plan
- for j = 0; (j < int32((*WhereLoop)(unsafe.Pointer(pLoop)).FnLTerm)) && (pTerm != *(*uintptr)(unsafe.Pointer((*WhereLoop)(unsafe.Pointer(pLoop)).FaLTerm + uintptr(j)*4))); j++ {
+ for j = 0; j < int32((*WhereLoop)(unsafe.Pointer(pLoop)).FnLTerm) && pTerm != *(*uintptr)(unsafe.Pointer((*WhereLoop)(unsafe.Pointer(pLoop)).FaLTerm + uintptr(j)*4)); j++ {
}
if j >= int32((*WhereLoop)(unsafe.Pointer(pLoop)).FnLTerm) {
continue
}
}
- if ((int32((*WhereTerm)(unsafe.Pointer(pTerm)).FeOperator) & (WO_EQ | WO_IS)) != 0) && (int32((*Expr)(unsafe.Pointer(pOBExpr)).FiColumn) >= 0) {
+ if int32((*WhereTerm)(unsafe.Pointer(pTerm)).FeOperator)&(WO_EQ|WO_IS) != 0 && int32((*Expr)(unsafe.Pointer(pOBExpr)).FiColumn) >= 0 {
var pParse uintptr = (*WhereInfo)(unsafe.Pointer(pWInfo)).FpParse
- var pColl1 uintptr = Xsqlite3ExprNNCollSeq(tls, pParse, (*ExprList_item)(unsafe.Pointer((pOrderBy+8 /* &.a */)+uintptr(i)*20)).FpExpr)
+ var pColl1 uintptr = Xsqlite3ExprNNCollSeq(tls, pParse, (*ExprList_item)(unsafe.Pointer(pOrderBy+8+uintptr(i)*20)).FpExpr)
var pColl2 uintptr = Xsqlite3ExprCompareCollSeq(tls, pParse, (*WhereTerm)(unsafe.Pointer(pTerm)).FpExpr)
- if (pColl2 == uintptr(0)) || (Xsqlite3StrICmp(tls, (*CollSeq)(unsafe.Pointer(pColl1)).FzName, (*CollSeq)(unsafe.Pointer(pColl2)).FzName) != 0) {
+ if pColl2 == uintptr(0) || Xsqlite3StrICmp(tls, (*CollSeq)(unsafe.Pointer(pColl1)).FzName, (*CollSeq)(unsafe.Pointer(pColl2)).FzName) != 0 {
continue
}
}
- obSat = obSat | (Bitmask((uint64(1))) << (i))
+ obSat = obSat | Bitmask(uint64(1))<<i
}
- if ((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & U32(WHERE_ONEROW)) == U32(0) {
- if ((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & U32(WHERE_IPK)) != 0 {
+ if (*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags&U32(WHERE_ONEROW) == U32(0) {
+ if (*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags&U32(WHERE_IPK) != 0 {
pIndex = uintptr(0)
nKeyCol = U16(0)
nColumn = U16(1)
- } else if ((libc.AssignUintptr(&pIndex, *(*uintptr)(unsafe.Pointer(pLoop + 24 /* &.u */ /* &.btree */ + 8 /* &.pIndex */)))) == uintptr(0)) || ((uint32(int32(*(*uint16)(unsafe.Pointer(pIndex + 56 /* &.bUnordered */)) & 0x4 >> 2))) != 0) {
+ } else if libc.AssignUintptr(&pIndex, *(*uintptr)(unsafe.Pointer(pLoop + 24 + 8))) == uintptr(0) || uint32(int32(*(*uint16)(unsafe.Pointer(pIndex + 56))&0x4>>2)) != 0 {
return int8(0)
} else {
nKeyCol = (*Index)(unsafe.Pointer(pIndex)).FnKeyCol
@@ -134436,8 +136461,8 @@ func wherePathSatisfiesOrderBy(tls *libc.TLS, pWInfo uintptr, pOrderBy uintptr,
// for isOrderDistinct to be true. So the isOrderDistint value
// computed here might be a false positive. Corrections will be
// made at tag-20210426-1 below
- isOrderDistinct = (U8(libc.Bool32((int32((*Index)(unsafe.Pointer((pIndex))).FonError) != OE_None) &&
- (((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & U32(WHERE_SKIPSCAN)) == U32(0)))))
+ isOrderDistinct = U8(libc.Bool32(int32((*Index)(unsafe.Pointer(pIndex)).FonError) != OE_None &&
+ (*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags&U32(WHERE_SKIPSCAN) == U32(0)))
}
// Loop through all columns of the index and deal with the ones
@@ -134447,7 +136472,7 @@ func wherePathSatisfiesOrderBy(tls *libc.TLS, pWInfo uintptr, pOrderBy uintptr,
for j = 0; j < int32(nColumn); j++ {
var bOnce U8 = U8(1) // True to run the ORDER BY search loop
- if (j < int32(*(*U16)(unsafe.Pointer((pLoop + 24 /* &.u */ /* &.btree */) /* &.nEq */)))) && (j >= int32((*WhereLoop)(unsafe.Pointer(pLoop)).FnSkip)) {
+ if j < int32(*(*U16)(unsafe.Pointer(pLoop + 24))) && j >= int32((*WhereLoop)(unsafe.Pointer(pLoop)).FnSkip) {
var eOp U16 = (*WhereTerm)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((*WhereLoop)(unsafe.Pointer(pLoop)).FaLTerm + uintptr(j)*4)))).FeOperator
// Skip over == and IS and ISNULL terms. (Also skip IN terms when
@@ -134461,19 +136486,19 @@ func wherePathSatisfiesOrderBy(tls *libc.TLS, pWInfo uintptr, pOrderBy uintptr,
// check that it is the only column used by this loop. Otherwise,
// if it is one of two or more, none of the columns can be
// considered to match an ORDER BY term.
- if (int32(eOp) & int32(eqOpMask)) != 0 {
- if (int32(eOp) & (WO_ISNULL | WO_IS)) != 0 {
+ if int32(eOp)&int32(eqOpMask) != 0 {
+ if int32(eOp)&(WO_ISNULL|WO_IS) != 0 {
isOrderDistinct = U8(0)
}
continue
- } else if (int32(eOp) & WO_IN) != 0 {
+ } else if int32(eOp)&WO_IN != 0 {
// ALWAYS() justification: eOp is an equality operator due to the
// j<pLoop->u.btree.nEq constraint above. Any equality other
// than WO_IN is captured by the previous "if". So this one
// always has to be WO_IN.
var pX uintptr = (*WhereTerm)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((*WhereLoop)(unsafe.Pointer(pLoop)).FaLTerm + uintptr(j)*4)))).FpExpr
- for i = (j + 1); i < int32(*(*U16)(unsafe.Pointer((pLoop + 24 /* &.u */ /* &.btree */) /* &.nEq */))); i++ {
+ for i = j + 1; i < int32(*(*U16)(unsafe.Pointer(pLoop + 24 /* &.u */ /* &.btree */ /* &.nEq */))); i++ {
if (*WhereTerm)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((*WhereLoop)(unsafe.Pointer(pLoop)).FaLTerm + uintptr(i)*4)))).FpExpr == pX {
bOnce = U8(0)
@@ -134487,7 +136512,7 @@ func wherePathSatisfiesOrderBy(tls *libc.TLS, pWInfo uintptr, pOrderBy uintptr,
// (revIdx) for the j-th column of the index.
if pIndex != 0 {
iColumn = int32(*(*I16)(unsafe.Pointer((*Index)(unsafe.Pointer(pIndex)).FaiColumn + uintptr(j)*2)))
- revIdx = (U8(int32(*(*U8)(unsafe.Pointer((*Index)(unsafe.Pointer(pIndex)).FaSortOrder + uintptr(j)))) & KEYINFO_ORDER_DESC))
+ revIdx = U8(int32(*(*U8)(unsafe.Pointer((*Index)(unsafe.Pointer(pIndex)).FaSortOrder + uintptr(j)))) & KEYINFO_ORDER_DESC)
if iColumn == int32((*Table)(unsafe.Pointer((*Index)(unsafe.Pointer(pIndex)).FpTable)).FiPKey) {
iColumn = -1
}
@@ -134499,12 +136524,12 @@ func wherePathSatisfiesOrderBy(tls *libc.TLS, pWInfo uintptr, pOrderBy uintptr,
// An unconstrained column that might be NULL means that this
// WhereLoop is not well-ordered. tag-20210426-1
if isOrderDistinct != 0 {
- if ((iColumn >= 0) &&
- (j >= int32(*(*U16)(unsafe.Pointer((pLoop + 24 /* &.u */ /* &.btree */) /* &.nEq */))))) &&
- (int32((*Column)(unsafe.Pointer((*Table)(unsafe.Pointer((*Index)(unsafe.Pointer(pIndex)).FpTable)).FaCol+uintptr(iColumn)*20)).FnotNull) == 0) {
+ if iColumn >= 0 &&
+ j >= int32(*(*U16)(unsafe.Pointer(pLoop + 24))) &&
+ int32(*(*uint8)(unsafe.Pointer((*Table)(unsafe.Pointer((*Index)(unsafe.Pointer(pIndex)).FpTable)).FaCol + uintptr(iColumn)*16 + 4))&0xf>>0) == 0 {
isOrderDistinct = U8(0)
}
- if iColumn == (-2) {
+ if iColumn == -2 {
isOrderDistinct = U8(0)
}
}
@@ -134512,20 +136537,20 @@ 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
isMatch = U8(0)
- for i = 0; (bOnce != 0) && (i < int32(nOrderBy)); i++ {
- if ((Bitmask((uint64(1))) << (i)) & obSat) != 0 {
+ for i = 0; bOnce != 0 && i < int32(nOrderBy); i++ {
+ if Bitmask(uint64(1))<<i&obSat != 0 {
continue
}
- pOBExpr = Xsqlite3ExprSkipCollateAndLikely(tls, (*ExprList_item)(unsafe.Pointer((pOrderBy+8 /* &.a */)+uintptr(i)*20)).FpExpr)
+ pOBExpr = Xsqlite3ExprSkipCollateAndLikely(tls, (*ExprList_item)(unsafe.Pointer(pOrderBy+8+uintptr(i)*20)).FpExpr)
if pOBExpr == uintptr(0) {
continue
}
- if (int32(wctrlFlags) & (WHERE_GROUPBY | WHERE_DISTINCTBY)) == 0 {
+ if int32(wctrlFlags)&(WHERE_GROUPBY|WHERE_DISTINCTBY) == 0 {
bOnce = U8(0)
}
- if iColumn >= (-1) {
- if (int32((*Expr)(unsafe.Pointer(pOBExpr)).Fop) != TK_COLUMN) && (int32((*Expr)(unsafe.Pointer(pOBExpr)).Fop) != TK_AGG_COLUMN) {
+ if iColumn >= -1 {
+ if int32((*Expr)(unsafe.Pointer(pOBExpr)).Fop) != TK_COLUMN && int32((*Expr)(unsafe.Pointer(pOBExpr)).Fop) != TK_AGG_COLUMN {
continue
}
if (*Expr)(unsafe.Pointer(pOBExpr)).FiTable != iCur {
@@ -134535,54 +136560,54 @@ func wherePathSatisfiesOrderBy(tls *libc.TLS, pWInfo uintptr, pOrderBy uintptr,
continue
}
} else {
- var pIdxExpr uintptr = (*ExprList_item)(unsafe.Pointer(((*Index)(unsafe.Pointer(pIndex)).FaColExpr + 8 /* &.a */) + uintptr(j)*20)).FpExpr
+ var pIdxExpr uintptr = (*ExprList_item)(unsafe.Pointer((*Index)(unsafe.Pointer(pIndex)).FaColExpr + 8 + uintptr(j)*20)).FpExpr
if Xsqlite3ExprCompareSkip(tls, pOBExpr, pIdxExpr, iCur) != 0 {
continue
}
}
- if iColumn != (-1) {
- pColl = Xsqlite3ExprNNCollSeq(tls, (*WhereInfo)(unsafe.Pointer(pWInfo)).FpParse, (*ExprList_item)(unsafe.Pointer((pOrderBy+8 /* &.a */)+uintptr(i)*20)).FpExpr)
+ if iColumn != -1 {
+ pColl = Xsqlite3ExprNNCollSeq(tls, (*WhereInfo)(unsafe.Pointer(pWInfo)).FpParse, (*ExprList_item)(unsafe.Pointer(pOrderBy+8+uintptr(i)*20)).FpExpr)
if Xsqlite3StrICmp(tls, (*CollSeq)(unsafe.Pointer(pColl)).FzName, *(*uintptr)(unsafe.Pointer((*Index)(unsafe.Pointer(pIndex)).FazColl + uintptr(j)*4))) != 0 {
continue
}
}
- if (int32(wctrlFlags) & WHERE_DISTINCTBY) != 0 {
- *(*U16)(unsafe.Pointer(pLoop + 24 /* &.u */ /* &.btree */ + 6 /* &.nDistinctCol */)) = (U16(j + 1))
+ if int32(wctrlFlags)&WHERE_DISTINCTBY != 0 {
+ *(*U16)(unsafe.Pointer(pLoop + 24 + 6 /* &.nDistinctCol */)) = U16(j + 1)
}
isMatch = U8(1)
break
}
- if (isMatch != 0) && ((int32(wctrlFlags) & WHERE_GROUPBY) == 0) {
+ if isMatch != 0 && int32(wctrlFlags)&WHERE_GROUPBY == 0 {
// Make sure the sort order is compatible in an ORDER BY clause.
// Sort order is irrelevant for a GROUP BY clause.
if revSet != 0 {
- if (int32(rev) ^ int32(revIdx)) != (int32((*ExprList_item)(unsafe.Pointer((pOrderBy+8 /* &.a */)+uintptr(i)*20)).FsortFlags) & KEYINFO_ORDER_DESC) {
+ if int32(rev)^int32(revIdx) != int32((*ExprList_item)(unsafe.Pointer(pOrderBy+8+uintptr(i)*20)).FsortFlags)&KEYINFO_ORDER_DESC {
isMatch = U8(0)
}
} else {
- rev = (U8(int32(revIdx) ^ (int32((*ExprList_item)(unsafe.Pointer((pOrderBy+8 /* &.a */)+uintptr(i)*20)).FsortFlags) & KEYINFO_ORDER_DESC)))
+ rev = U8(int32(revIdx) ^ int32((*ExprList_item)(unsafe.Pointer(pOrderBy+8+uintptr(i)*20)).FsortFlags)&KEYINFO_ORDER_DESC)
if rev != 0 {
- *(*Bitmask)(unsafe.Pointer(pRevMask)) |= (Bitmask((uint64(1))) << (iLoop))
+ *(*Bitmask)(unsafe.Pointer(pRevMask)) |= Bitmask(uint64(1)) << iLoop
}
revSet = U8(1)
}
}
- if (isMatch != 0) && ((int32((*ExprList_item)(unsafe.Pointer((pOrderBy+8 /* &.a */)+uintptr(i)*20)).FsortFlags) & KEYINFO_ORDER_BIGNULL) != 0) {
- if j == int32(*(*U16)(unsafe.Pointer((pLoop + 24 /* &.u */ /* &.btree */) /* &.nEq */))) {
- *(*U32)(unsafe.Pointer(pLoop + 36 /* &.wsFlags */)) |= (U32(WHERE_BIGNULL_SORT))
+ if isMatch != 0 && int32((*ExprList_item)(unsafe.Pointer(pOrderBy+8+uintptr(i)*20)).FsortFlags)&KEYINFO_ORDER_BIGNULL != 0 {
+ if j == int32(*(*U16)(unsafe.Pointer(pLoop + 24))) {
+ *(*U32)(unsafe.Pointer(pLoop + 36)) |= U32(WHERE_BIGNULL_SORT)
} else {
isMatch = U8(0)
}
}
if isMatch != 0 {
- if iColumn == (-1) {
+ if iColumn == -1 {
distinctColumns = U8(1)
}
- obSat = obSat | (Bitmask((uint64(1))) << (i))
+ obSat = obSat | Bitmask(uint64(1))<<i
} else {
// No match found
- if (j == 0) || (j < int32(nKeyCol)) {
+ if j == 0 || j < int32(nKeyCol) {
isOrderDistinct = U8(0)
}
@@ -134597,20 +136622,20 @@ func wherePathSatisfiesOrderBy(tls *libc.TLS, pWInfo uintptr, pOrderBy uintptr,
// Mark off any other ORDER BY terms that reference pLoop
if isOrderDistinct != 0 {
- orderDistinctMask = orderDistinctMask | ((*WhereLoop)(unsafe.Pointer(pLoop)).FmaskSelf)
+ orderDistinctMask = orderDistinctMask | (*WhereLoop)(unsafe.Pointer(pLoop)).FmaskSelf
for i = 0; i < int32(nOrderBy); i++ {
var p uintptr
var mTerm Bitmask
- if ((Bitmask((uint64(1))) << (i)) & obSat) != 0 {
+ if Bitmask(uint64(1))<<i&obSat != 0 {
continue
}
- p = (*ExprList_item)(unsafe.Pointer((pOrderBy + 8 /* &.a */) + uintptr(i)*20)).FpExpr
- mTerm = Xsqlite3WhereExprUsage(tls, (pWInfo + 488 /* &.sMaskSet */), p)
- if (mTerm == uint64(0)) && !(Xsqlite3ExprIsConstant(tls, p) != 0) {
+ p = (*ExprList_item)(unsafe.Pointer(pOrderBy + 8 + uintptr(i)*20)).FpExpr
+ mTerm = Xsqlite3WhereExprUsage(tls, pWInfo+488, p)
+ if mTerm == uint64(0) && !(Xsqlite3ExprIsConstant(tls, p) != 0) {
continue
}
- if (mTerm & ^orderDistinctMask) == uint64(0) {
- obSat = obSat | (Bitmask((uint64(1))) << (i))
+ if mTerm & ^orderDistinctMask == uint64(0) {
+ obSat = obSat | Bitmask(uint64(1))<<i
}
}
}
@@ -134619,9 +136644,14 @@ func wherePathSatisfiesOrderBy(tls *libc.TLS, pWInfo uintptr, pOrderBy uintptr,
return I8(nOrderBy)
}
if !(isOrderDistinct != 0) {
- for i = (int32(nOrderBy) - 1); i > 0; i-- {
- var m Bitmask = ((Bitmask((uint64(1))) << (i)) - uint64(1))
- if (obSat & m) == m {
+ for i = int32(nOrderBy) - 1; i > 0; i-- {
+ var m Bitmask
+ if i < int32(uint32(unsafe.Sizeof(Bitmask(0)))*uint32(8)) {
+ m = Bitmask(uint64(1))<<i - uint64(1)
+ } else {
+ m = uint64(0)
+ }
+ if obSat&m == m {
return I8(i)
}
}
@@ -134651,15 +136681,15 @@ func wherePathSatisfiesOrderBy(tls *libc.TLS, pWInfo uintptr, pOrderBy uintptr,
//
// SELECT * FROM t1 GROUP BY x,y ORDER BY x,y; -- IsSorted()==1
// SELECT * FROM t1 GROUP BY y,x ORDER BY y,x; -- IsSorted()==0
-func Xsqlite3WhereIsSorted(tls *libc.TLS, pWInfo uintptr) int32 { /* sqlite3.c:153344:20: */
+func Xsqlite3WhereIsSorted(tls *libc.TLS, pWInfo uintptr) int32 { /* sqlite3.c:154740:20: */
- return (int32(*(*uint8)(unsafe.Pointer(pWInfo + 48 /* &.sorted */)) & 0x8 >> 3))
+ return int32(*(*uint8)(unsafe.Pointer(pWInfo + 48)) & 0x8 >> 3)
}
// Return the cost of sorting nRow rows, assuming that the keys have
// nOrderby columns and that the first nSorted columns are already in
// order.
-func whereSortingCost(tls *libc.TLS, pWInfo uintptr, nRow LogEst, nOrderBy int32, nSorted int32) LogEst { /* sqlite3.c:153367:15: */
+func whereSortingCost(tls *libc.TLS, pWInfo uintptr, nRow LogEst, nOrderBy int32, nSorted int32) LogEst { /* sqlite3.c:154763:15: */
// TUNING: Estimated cost of a full external sort, where N is
// the number of rows to sort is:
//
@@ -134676,23 +136706,23 @@ func whereSortingCost(tls *libc.TLS, pWInfo uintptr, nRow LogEst, nOrderBy int32
var rScale LogEst
var rSortCost LogEst
- rScale = (LogEst(int32(Xsqlite3LogEst(tls, (uint64(((nOrderBy-nSorted)*100)/nOrderBy)))) - 66))
- rSortCost = (LogEst((int32(nRow) + int32(rScale)) + 16))
+ rScale = LogEst(int32(Xsqlite3LogEst(tls, uint64((nOrderBy-nSorted)*100/nOrderBy))) - 66)
+ rSortCost = LogEst(int32(nRow) + int32(rScale) + 16)
// Multiple by log(M) where M is the number of output rows.
// Use the LIMIT for M if it is smaller. Or if this sort is for
// a DISTINCT operator, M will be the number of distinct output
// rows, so fudge it downwards a bit.
- if ((int32((*WhereInfo)(unsafe.Pointer(pWInfo)).FwctrlFlags) & WHERE_USE_LIMIT) != 0) && (int32((*WhereInfo)(unsafe.Pointer(pWInfo)).FiLimit) < int32(nRow)) {
+ if int32((*WhereInfo)(unsafe.Pointer(pWInfo)).FwctrlFlags)&WHERE_USE_LIMIT != 0 && int32((*WhereInfo)(unsafe.Pointer(pWInfo)).FiLimit) < int32(nRow) {
nRow = (*WhereInfo)(unsafe.Pointer(pWInfo)).FiLimit
- } else if (int32((*WhereInfo)(unsafe.Pointer(pWInfo)).FwctrlFlags) & WHERE_WANT_DISTINCT) != 0 {
+ } else if int32((*WhereInfo)(unsafe.Pointer(pWInfo)).FwctrlFlags)&WHERE_WANT_DISTINCT != 0 {
// TUNING: In the sort for a DISTINCT operator, assume that the DISTINCT
// reduces the number of output rows by a factor of 2
if int32(nRow) > 10 {
- nRow = int16(int32(nRow) - (10))
+ nRow = int16(int32(nRow) - 10)
}
}
- rSortCost = LogEst(int32(rSortCost) + (int32(estLog(tls, nRow))))
+ rSortCost = LogEst(int32(rSortCost) + int32(estLog(tls, nRow)))
return rSortCost
}
@@ -134706,7 +136736,7 @@ func whereSortingCost(tls *libc.TLS, pWInfo uintptr, nRow LogEst, nOrderBy int32
//
// Return SQLITE_OK on success or SQLITE_NOMEM of a memory allocation
// error occurs.
-func wherePathSolver(tls *libc.TLS, pWInfo uintptr, nRowEst LogEst) int32 { /* sqlite3.c:153420:12: */
+func wherePathSolver(tls *libc.TLS, pWInfo uintptr, nRowEst LogEst) int32 { /* sqlite3.c:154816:12: */
bp := tls.Alloc(32)
defer tls.Free(32)
@@ -134755,24 +136785,24 @@ func wherePathSolver(tls *libc.TLS, pWInfo uintptr, nRowEst LogEst) int32 { /* s
// by the overall query. Once this estimate has been obtained, the caller
// will invoke this function a second time, passing the estimate as the
// nRowEst parameter.
- if ((*WhereInfo)(unsafe.Pointer(pWInfo)).FpOrderBy == uintptr(0)) || (int32(nRowEst) == 0) {
+ if (*WhereInfo)(unsafe.Pointer(pWInfo)).FpOrderBy == uintptr(0) || int32(nRowEst) == 0 {
nOrderBy = 0
} else {
nOrderBy = (*ExprList)(unsafe.Pointer((*WhereInfo)(unsafe.Pointer(pWInfo)).FpOrderBy)).FnExpr
}
// Allocate and initialize space for aTo, aFrom and aSortCost[]
- nSpace = (int32(((uint32(unsafe.Sizeof(WherePath{})) + (uint32(unsafe.Sizeof(uintptr(0))) * uint32(nLoop))) * uint32(mxChoice)) * uint32(2)))
- nSpace = int32(uint32(nSpace) + (uint32(unsafe.Sizeof(LogEst(0))) * uint32(nOrderBy)))
+ nSpace = int32((uint32(unsafe.Sizeof(WherePath{})) + uint32(unsafe.Sizeof(uintptr(0)))*uint32(nLoop)) * uint32(mxChoice) * uint32(2))
+ nSpace = int32(uint32(nSpace) + uint32(unsafe.Sizeof(LogEst(0)))*uint32(nOrderBy))
pSpace = Xsqlite3DbMallocRawNN(tls, db, uint64(nSpace))
if pSpace == uintptr(0) {
return SQLITE_NOMEM
}
aTo = pSpace
- aFrom = (aTo + uintptr(mxChoice)*32)
+ aFrom = aTo + uintptr(mxChoice)*32
libc.Xmemset(tls, aFrom, 0, uint32(unsafe.Sizeof(WherePath{})))
- pX = (aFrom + uintptr(mxChoice)*32)
- ii = (mxChoice * 2)
+ pX = aFrom + uintptr(mxChoice)*32
+ ii = mxChoice * 2
pFrom = aTo
__1:
if !(ii > 0) {
@@ -134786,7 +136816,7 @@ __1:
__2:
ii--
pFrom += 32
- pX += 4 * (uintptr(nLoop))
+ pX += 4 * uintptr(nLoop)
goto __1
goto __3
__3:
@@ -134799,7 +136829,7 @@ __3:
// the ORDER BY clause are already in order, where X is the array
// index.
aSortCost = pX
- libc.Xmemset(tls, aSortCost, 0, (uint32(unsafe.Sizeof(LogEst(0))) * uint32(nOrderBy)))
+ libc.Xmemset(tls, aSortCost, 0, uint32(unsafe.Sizeof(LogEst(0)))*uint32(nOrderBy))
}
// Seed the search with a single WherePath containing zero WhereLoops.
@@ -134808,7 +136838,7 @@ __3:
// of computing an automatic index is not paid back within the first 28
// rows, then do not use the automatic index.
(*WherePath)(unsafe.Pointer(aFrom)).FnRow = func() int16 {
- if ((*Parse)(unsafe.Pointer(pParse)).FnQueryLoop) < (U32(48)) {
+ if (*Parse)(unsafe.Pointer(pParse)).FnQueryLoop < U32(48) {
return int16((*Parse)(unsafe.Pointer(pParse)).FnQueryLoop)
}
return int16(48)
@@ -134850,13 +136880,13 @@ __3:
var maskNew Bitmask // Mask of src visited by (..)
*(*Bitmask)(unsafe.Pointer(bp /* revMask */)) = uint64(0) // Mask of rev-order loops for (..)
- if ((*WhereLoop)(unsafe.Pointer(pWLoop)).Fprereq & ^(*WherePath)(unsafe.Pointer(pFrom)).FmaskLoop) != uint64(0) {
+ if (*WhereLoop)(unsafe.Pointer(pWLoop)).Fprereq & ^(*WherePath)(unsafe.Pointer(pFrom)).FmaskLoop != uint64(0) {
continue
}
- if ((*WhereLoop)(unsafe.Pointer(pWLoop)).FmaskSelf & (*WherePath)(unsafe.Pointer(pFrom)).FmaskLoop) != uint64(0) {
+ if (*WhereLoop)(unsafe.Pointer(pWLoop)).FmaskSelf&(*WherePath)(unsafe.Pointer(pFrom)).FmaskLoop != uint64(0) {
continue
}
- if (((*WhereLoop)(unsafe.Pointer(pWLoop)).FwsFlags & U32(WHERE_AUTO_INDEX)) != U32(0)) && (int32((*WherePath)(unsafe.Pointer(pFrom)).FnRow) < 3) {
+ if (*WhereLoop)(unsafe.Pointer(pWLoop)).FwsFlags&U32(WHERE_AUTO_INDEX) != U32(0) && int32((*WherePath)(unsafe.Pointer(pFrom)).FnRow) < 3 {
// Do not use an automatic index if the this loop is expected
// to run less than 1.25 times. It is tempting to also exclude
// automatic index usage on an outer loop, but sometimes an automatic
@@ -134867,10 +136897,10 @@ __3:
// At this point, pWLoop is a candidate to be the next loop.
// Compute its cost
- rUnsorted = Xsqlite3LogEstAdd(tls, (*WhereLoop)(unsafe.Pointer(pWLoop)).FrSetup, (int16(int32((*WhereLoop)(unsafe.Pointer(pWLoop)).FrRun) + int32((*WherePath)(unsafe.Pointer(pFrom)).FnRow))))
+ rUnsorted = Xsqlite3LogEstAdd(tls, (*WhereLoop)(unsafe.Pointer(pWLoop)).FrSetup, int16(int32((*WhereLoop)(unsafe.Pointer(pWLoop)).FrRun)+int32((*WherePath)(unsafe.Pointer(pFrom)).FnRow)))
rUnsorted = Xsqlite3LogEstAdd(tls, rUnsorted, (*WherePath)(unsafe.Pointer(pFrom)).FrUnsorted)
- nOut = (LogEst(int32((*WherePath)(unsafe.Pointer(pFrom)).FnRow) + int32((*WhereLoop)(unsafe.Pointer(pWLoop)).FnOut)))
- maskNew = ((*WherePath)(unsafe.Pointer(pFrom)).FmaskLoop | (*WhereLoop)(unsafe.Pointer(pWLoop)).FmaskSelf)
+ nOut = LogEst(int32((*WherePath)(unsafe.Pointer(pFrom)).FnRow) + int32((*WhereLoop)(unsafe.Pointer(pWLoop)).FnOut))
+ maskNew = (*WherePath)(unsafe.Pointer(pFrom)).FmaskLoop | (*WhereLoop)(unsafe.Pointer(pWLoop)).FmaskSelf
if int32(isOrdered) < 0 {
isOrdered = wherePathSatisfiesOrderBy(tls, pWInfo,
(*WhereInfo)(unsafe.Pointer(pWInfo)).FpOrderBy, pFrom, (*WhereInfo)(unsafe.Pointer(pWInfo)).FwctrlFlags,
@@ -134878,7 +136908,7 @@ __3:
} else {
*(*Bitmask)(unsafe.Pointer(bp /* revMask */)) = (*WherePath)(unsafe.Pointer(pFrom)).FrevLoop
}
- if (int32(isOrdered) >= 0) && (int32(isOrdered) < nOrderBy) {
+ if int32(isOrdered) >= 0 && int32(isOrdered) < nOrderBy {
if int32(*(*LogEst)(unsafe.Pointer(aSortCost + uintptr(isOrdered)*2))) == 0 {
*(*LogEst)(unsafe.Pointer(aSortCost + uintptr(isOrdered)*2)) = whereSortingCost(tls,
pWInfo, nRowEst, nOrderBy, int32(isOrdered))
@@ -134887,11 +136917,11 @@ __3:
// extra encouragment to the query planner to select a plan
// where the rows emerge in the correct order without any sorting
// required.
- rCost = (LogEst(int32(Xsqlite3LogEstAdd(tls, rUnsorted, *(*LogEst)(unsafe.Pointer(aSortCost + uintptr(isOrdered)*2)))) + 5))
+ rCost = LogEst(int32(Xsqlite3LogEstAdd(tls, rUnsorted, *(*LogEst)(unsafe.Pointer(aSortCost + uintptr(isOrdered)*2)))) + 5)
} else {
rCost = rUnsorted
- rUnsorted = int16(int32(rUnsorted) - (2)) // TUNING: Slight bias in favor of no-sort plans
+ rUnsorted = int16(int32(rUnsorted) - 2) // TUNING: Slight bias in favor of no-sort plans
}
// Check to see if pWLoop should be added to the set of
@@ -134911,8 +136941,8 @@ __3:
goto __9
}
{
- if ((*WherePath)(unsafe.Pointer(pTo)).FmaskLoop == maskNew) &&
- (((int32((*WherePath)(unsafe.Pointer(pTo)).FisOrdered) ^ int32(isOrdered)) & 0x80) == 0) {
+ if (*WherePath)(unsafe.Pointer(pTo)).FmaskLoop == maskNew &&
+ (int32((*WherePath)(unsafe.Pointer(pTo)).FisOrdered)^int32(isOrdered))&0x80 == 0 {
goto __9
}
@@ -134928,8 +136958,8 @@ __3:
;
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(rUnsorted) >= int32(mxUnsorted)) {
// 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.
@@ -134944,7 +136974,7 @@ __3:
// New path replaces the prior worst to keep count below mxChoice
jj = mxI
}
- pTo = (aTo + uintptr(jj)*32)
+ pTo = aTo + uintptr(jj)*32
} else {
// Control reaches here if best-so-far path pTo=aTo[jj] covers the
// same set of loops and has the same isOrdered setting as the
@@ -134953,10 +136983,10 @@ __3:
//
// The conditional is an expanded vector comparison equivalent to:
// (pTo->rCost,pTo->nRow,pTo->rUnsorted) <= (rCost,nOut,rUnsorted)
- if (int32((*WherePath)(unsafe.Pointer(pTo)).FrCost) < int32(rCost)) ||
- ((int32((*WherePath)(unsafe.Pointer(pTo)).FrCost) == int32(rCost)) &&
- ((int32((*WherePath)(unsafe.Pointer(pTo)).FnRow) < int32(nOut)) ||
- ((int32((*WherePath)(unsafe.Pointer(pTo)).FnRow) == int32(nOut)) && (int32((*WherePath)(unsafe.Pointer(pTo)).FrUnsorted) <= int32(rUnsorted))))) {
+ if int32((*WherePath)(unsafe.Pointer(pTo)).FrCost) < int32(rCost) ||
+ int32((*WherePath)(unsafe.Pointer(pTo)).FrCost) == int32(rCost) &&
+ (int32((*WherePath)(unsafe.Pointer(pTo)).FnRow) < int32(nOut) ||
+ int32((*WherePath)(unsafe.Pointer(pTo)).FnRow) == int32(nOut) && int32((*WherePath)(unsafe.Pointer(pTo)).FrUnsorted) <= int32(rUnsorted)) {
// Discard the candidate path from further consideration
continue
@@ -134966,27 +136996,27 @@ __3:
// pTo path. Replace pTo with the candidate.
}
// pWLoop is a winner. Add it to the set of best so far
- (*WherePath)(unsafe.Pointer(pTo)).FmaskLoop = ((*WherePath)(unsafe.Pointer(pFrom)).FmaskLoop | (*WhereLoop)(unsafe.Pointer(pWLoop)).FmaskSelf)
+ (*WherePath)(unsafe.Pointer(pTo)).FmaskLoop = (*WherePath)(unsafe.Pointer(pFrom)).FmaskLoop | (*WhereLoop)(unsafe.Pointer(pWLoop)).FmaskSelf
(*WherePath)(unsafe.Pointer(pTo)).FrevLoop = *(*Bitmask)(unsafe.Pointer(bp /* revMask */))
(*WherePath)(unsafe.Pointer(pTo)).FnRow = nOut
(*WherePath)(unsafe.Pointer(pTo)).FrCost = rCost
(*WherePath)(unsafe.Pointer(pTo)).FrUnsorted = rUnsorted
(*WherePath)(unsafe.Pointer(pTo)).FisOrdered = isOrdered
- libc.Xmemcpy(tls, (*WherePath)(unsafe.Pointer(pTo)).FaLoop, (*WherePath)(unsafe.Pointer(pFrom)).FaLoop, (uint32(unsafe.Sizeof(uintptr(0))) * uint32(iLoop)))
+ libc.Xmemcpy(tls, (*WherePath)(unsafe.Pointer(pTo)).FaLoop, (*WherePath)(unsafe.Pointer(pFrom)).FaLoop, uint32(unsafe.Sizeof(uintptr(0)))*uint32(iLoop))
*(*uintptr)(unsafe.Pointer((*WherePath)(unsafe.Pointer(pTo)).FaLoop + uintptr(iLoop)*4)) = pWLoop
if nTo >= mxChoice {
mxI = 0
mxCost = (*WherePath)(unsafe.Pointer(aTo)).FrCost
mxUnsorted = (*WherePath)(unsafe.Pointer(aTo)).FnRow
jj = 1
- pTo = (aTo + 1*32)
+ pTo = aTo + 1*32
__10:
if !(jj < mxChoice) {
goto __12
}
{
- if (int32((*WherePath)(unsafe.Pointer(pTo)).FrCost) > int32(mxCost)) ||
- ((int32((*WherePath)(unsafe.Pointer(pTo)).FrCost) == int32(mxCost)) && (int32((*WherePath)(unsafe.Pointer(pTo)).FrUnsorted) > int32(mxUnsorted))) {
+ if int32((*WherePath)(unsafe.Pointer(pTo)).FrCost) > int32(mxCost) ||
+ int32((*WherePath)(unsafe.Pointer(pTo)).FrCost) == int32(mxCost) && int32((*WherePath)(unsafe.Pointer(pTo)).FrUnsorted) > int32(mxUnsorted) {
mxCost = (*WherePath)(unsafe.Pointer(pTo)).FrCost
mxUnsorted = (*WherePath)(unsafe.Pointer(pTo)).FrUnsorted
mxI = jj
@@ -135021,7 +137051,7 @@ __3:
}
if nFrom == 0 {
- Xsqlite3ErrorMsg(tls, pParse, ts+20310 /* "no query solutio..." */, 0)
+ Xsqlite3ErrorMsg(tls, pParse, ts+21607 /* "no query solutio..." */, 0)
Xsqlite3DbFreeNN(tls, db, pSpace)
return SQLITE_ERROR
}
@@ -135030,32 +137060,32 @@ __3:
pFrom = aFrom
for ii = 1; ii < nFrom; ii++ {
if int32((*WherePath)(unsafe.Pointer(pFrom)).FrCost) > int32((*WherePath)(unsafe.Pointer(aFrom+uintptr(ii)*32)).FrCost) {
- pFrom = (aFrom + uintptr(ii)*32)
+ pFrom = aFrom + uintptr(ii)*32
}
}
// Load the lowest cost path into pWInfo
for iLoop = 0; iLoop < nLoop; iLoop++ {
- var pLevel uintptr = ((pWInfo + 752 /* &.a */) + uintptr(iLoop)*80)
+ var pLevel uintptr = pWInfo + 752 + uintptr(iLoop)*80
(*WhereLevel)(unsafe.Pointer(pLevel)).FpWLoop = libc.AssignUintptr(&pWLoop, *(*uintptr)(unsafe.Pointer((*WherePath)(unsafe.Pointer(pFrom)).FaLoop + uintptr(iLoop)*4)))
(*WhereLevel)(unsafe.Pointer(pLevel)).FiFrom = (*WhereLoop)(unsafe.Pointer(pWLoop)).FiTab
- (*WhereLevel)(unsafe.Pointer(pLevel)).FiTabCur = (*SrcItem)(unsafe.Pointer(((*WhereInfo)(unsafe.Pointer(pWInfo)).FpTabList + 8 /* &.a */) + uintptr((*WhereLevel)(unsafe.Pointer(pLevel)).FiFrom)*72)).FiCursor
+ (*WhereLevel)(unsafe.Pointer(pLevel)).FiTabCur = (*SrcItem)(unsafe.Pointer((*WhereInfo)(unsafe.Pointer(pWInfo)).FpTabList + 8 + uintptr((*WhereLevel)(unsafe.Pointer(pLevel)).FiFrom)*72)).FiCursor
}
- if ((((int32((*WhereInfo)(unsafe.Pointer(pWInfo)).FwctrlFlags) & WHERE_WANT_DISTINCT) != 0) &&
- ((int32((*WhereInfo)(unsafe.Pointer(pWInfo)).FwctrlFlags) & WHERE_DISTINCTBY) == 0)) &&
- (int32((*WhereInfo)(unsafe.Pointer(pWInfo)).FeDistinct) == WHERE_DISTINCT_NOOP)) &&
- (nRowEst != 0) {
+ if int32((*WhereInfo)(unsafe.Pointer(pWInfo)).FwctrlFlags)&WHERE_WANT_DISTINCT != 0 &&
+ int32((*WhereInfo)(unsafe.Pointer(pWInfo)).FwctrlFlags)&WHERE_DISTINCTBY == 0 &&
+ int32((*WhereInfo)(unsafe.Pointer(pWInfo)).FeDistinct) == WHERE_DISTINCT_NOOP &&
+ nRowEst != 0 {
// var notUsed Bitmask at bp+8, 8
var rc int32 = int32(wherePathSatisfiesOrderBy(tls, pWInfo, (*WhereInfo)(unsafe.Pointer(pWInfo)).FpResultSet, pFrom,
- uint16(WHERE_DISTINCTBY), (uint16(nLoop - 1)), *(*uintptr)(unsafe.Pointer((*WherePath)(unsafe.Pointer(pFrom)).FaLoop + uintptr((nLoop-1))*4)), bp+8 /* &notUsed */))
+ uint16(WHERE_DISTINCTBY), uint16(nLoop-1), *(*uintptr)(unsafe.Pointer((*WherePath)(unsafe.Pointer(pFrom)).FaLoop + uintptr(nLoop-1)*4)), bp+8 /* &notUsed */))
if rc == (*ExprList)(unsafe.Pointer((*WhereInfo)(unsafe.Pointer(pWInfo)).FpResultSet)).FnExpr {
(*WhereInfo)(unsafe.Pointer(pWInfo)).FeDistinct = U8(WHERE_DISTINCT_ORDERED)
}
}
- libc.SetBitFieldPtr8Uint32(pWInfo+48 /* &.bOrderedInnerLoop */, uint32(0), 2, 0x4)
+ libc.SetBitFieldPtr8Uint32(pWInfo+48, uint32(0), 2, 0x4)
if (*WhereInfo)(unsafe.Pointer(pWInfo)).FpOrderBy != 0 {
- if (int32((*WhereInfo)(unsafe.Pointer(pWInfo)).FwctrlFlags) & WHERE_DISTINCTBY) != 0 {
+ if int32((*WhereInfo)(unsafe.Pointer(pWInfo)).FwctrlFlags)&WHERE_DISTINCTBY != 0 {
if int32((*WherePath)(unsafe.Pointer(pFrom)).FisOrdered) == (*ExprList)(unsafe.Pointer((*WhereInfo)(unsafe.Pointer(pWInfo)).FpOrderBy)).FnExpr {
(*WhereInfo)(unsafe.Pointer(pWInfo)).FeDistinct = U8(WHERE_DISTINCT_ORDERED)
}
@@ -135065,33 +137095,33 @@ __3:
if int32((*WhereInfo)(unsafe.Pointer(pWInfo)).FnOBSat) <= 0 {
(*WhereInfo)(unsafe.Pointer(pWInfo)).FnOBSat = int8(0)
if nLoop > 0 {
- var wsFlags U32 = (*WhereLoop)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((*WherePath)(unsafe.Pointer(pFrom)).FaLoop + uintptr((nLoop-1))*4)))).FwsFlags
- if ((wsFlags & U32(WHERE_ONEROW)) == U32(0)) &&
- ((wsFlags & (U32(WHERE_IPK | WHERE_COLUMN_IN))) != (U32(WHERE_IPK | WHERE_COLUMN_IN))) {
+ var wsFlags U32 = (*WhereLoop)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((*WherePath)(unsafe.Pointer(pFrom)).FaLoop + uintptr(nLoop-1)*4)))).FwsFlags
+ if wsFlags&U32(WHERE_ONEROW) == U32(0) &&
+ wsFlags&U32(WHERE_IPK|WHERE_COLUMN_IN) != U32(WHERE_IPK|WHERE_COLUMN_IN) {
*(*Bitmask)(unsafe.Pointer(bp + 16 /* m */)) = uint64(0)
var rc int32 = int32(wherePathSatisfiesOrderBy(tls, pWInfo, (*WhereInfo)(unsafe.Pointer(pWInfo)).FpOrderBy, pFrom,
- uint16(WHERE_ORDERBY_LIMIT), (uint16(nLoop - 1)), *(*uintptr)(unsafe.Pointer((*WherePath)(unsafe.Pointer(pFrom)).FaLoop + uintptr((nLoop-1))*4)), bp+16 /* &m */))
+ uint16(WHERE_ORDERBY_LIMIT), uint16(nLoop-1), *(*uintptr)(unsafe.Pointer((*WherePath)(unsafe.Pointer(pFrom)).FaLoop + uintptr(nLoop-1)*4)), bp+16 /* &m */))
if rc == (*ExprList)(unsafe.Pointer((*WhereInfo)(unsafe.Pointer(pWInfo)).FpOrderBy)).FnExpr {
- libc.SetBitFieldPtr8Uint32(pWInfo+48 /* &.bOrderedInnerLoop */, uint32(1), 2, 0x4)
+ libc.SetBitFieldPtr8Uint32(pWInfo+48, uint32(1), 2, 0x4)
(*WhereInfo)(unsafe.Pointer(pWInfo)).FrevMask = *(*Bitmask)(unsafe.Pointer(bp + 16 /* m */))
}
}
}
- } else if ((nLoop != 0) &&
- (int32((*WhereInfo)(unsafe.Pointer(pWInfo)).FnOBSat) == 1)) &&
- ((int32((*WhereInfo)(unsafe.Pointer(pWInfo)).FwctrlFlags) & (WHERE_ORDERBY_MIN | WHERE_ORDERBY_MAX)) != 0) {
- libc.SetBitFieldPtr8Uint32(pWInfo+48 /* &.bOrderedInnerLoop */, uint32(1), 2, 0x4)
+ } else if nLoop != 0 &&
+ int32((*WhereInfo)(unsafe.Pointer(pWInfo)).FnOBSat) == 1 &&
+ int32((*WhereInfo)(unsafe.Pointer(pWInfo)).FwctrlFlags)&(WHERE_ORDERBY_MIN|WHERE_ORDERBY_MAX) != 0 {
+ libc.SetBitFieldPtr8Uint32(pWInfo+48, uint32(1), 2, 0x4)
}
}
- if (((int32((*WhereInfo)(unsafe.Pointer(pWInfo)).FwctrlFlags) & WHERE_SORTBYGROUP) != 0) &&
- (int32((*WhereInfo)(unsafe.Pointer(pWInfo)).FnOBSat) == (*ExprList)(unsafe.Pointer((*WhereInfo)(unsafe.Pointer(pWInfo)).FpOrderBy)).FnExpr)) && (nLoop > 0) {
+ if int32((*WhereInfo)(unsafe.Pointer(pWInfo)).FwctrlFlags)&WHERE_SORTBYGROUP != 0 &&
+ int32((*WhereInfo)(unsafe.Pointer(pWInfo)).FnOBSat) == (*ExprList)(unsafe.Pointer((*WhereInfo)(unsafe.Pointer(pWInfo)).FpOrderBy)).FnExpr && nLoop > 0 {
*(*Bitmask)(unsafe.Pointer(bp + 24 /* revMask */)) = uint64(0)
var nOrder int32 = int32(wherePathSatisfiesOrderBy(tls, pWInfo, (*WhereInfo)(unsafe.Pointer(pWInfo)).FpOrderBy,
- pFrom, uint16(0), (uint16(nLoop - 1)), *(*uintptr)(unsafe.Pointer((*WherePath)(unsafe.Pointer(pFrom)).FaLoop + uintptr((nLoop-1))*4)), bp+24 /* &revMask */))
+ pFrom, uint16(0), uint16(nLoop-1), *(*uintptr)(unsafe.Pointer((*WherePath)(unsafe.Pointer(pFrom)).FaLoop + uintptr(nLoop-1)*4)), bp+24 /* &revMask */))
if nOrder == (*ExprList)(unsafe.Pointer((*WhereInfo)(unsafe.Pointer(pWInfo)).FpOrderBy)).FnExpr {
- libc.SetBitFieldPtr8Uint32(pWInfo+48 /* &.sorted */, uint32(1), 3, 0x8)
+ libc.SetBitFieldPtr8Uint32(pWInfo+48, uint32(1), 3, 0x8)
(*WhereInfo)(unsafe.Pointer(pWInfo)).FrevMask = *(*Bitmask)(unsafe.Pointer(bp + 24 /* revMask */))
}
}
@@ -135113,7 +137143,10 @@ __3:
// Return non-zero on success, if this query can be handled by this
// no-frills query planner. Return zero if this query needs the
// general-purpose query planner.
-func whereShortCut(tls *libc.TLS, pBuilder uintptr) int32 { /* sqlite3.c:153812:12: */
+func whereShortCut(tls *libc.TLS, pBuilder uintptr) int32 { /* sqlite3.c:155208:12: */
+ bp := tls.Alloc(96)
+ defer tls.Free(96)
+
var pWInfo uintptr
var pItem uintptr
var pWC uintptr
@@ -135123,50 +137156,57 @@ func whereShortCut(tls *libc.TLS, pBuilder uintptr) int32 { /* sqlite3.c:153812:
var j int32
var pTab uintptr
var pIdx uintptr
+ // var scan WhereScan at bp, 96
pWInfo = (*WhereLoopBuilder)(unsafe.Pointer(pBuilder)).FpWInfo
- if (int32((*WhereInfo)(unsafe.Pointer(pWInfo)).FwctrlFlags) & WHERE_OR_SUBCLAUSE) != 0 {
+ if int32((*WhereInfo)(unsafe.Pointer(pWInfo)).FwctrlFlags)&WHERE_OR_SUBCLAUSE != 0 {
return 0
}
pItem = (*WhereInfo)(unsafe.Pointer(pWInfo)).FpTabList + 8 /* &.a */
pTab = (*SrcItem)(unsafe.Pointer(pItem)).FpTab
- if (*Table)(unsafe.Pointer(pTab)).FnModuleArg != 0 {
+ if int32((*Table)(unsafe.Pointer(pTab)).FeTabType) == TABTYP_VTAB {
return 0
}
- if (uint32(int32(*(*uint16)(unsafe.Pointer(pItem + 36 /* &.fg */ + 4 /* &.isIndexedBy */)) & 0x2 >> 1))) != 0 {
+ if uint32(int32(*(*uint16)(unsafe.Pointer(pItem + 36 + 4))&0x2>>1)) != 0 {
return 0
}
iCur = (*SrcItem)(unsafe.Pointer(pItem)).FiCursor
- pWC = (pWInfo + 80 /* &.sWC */)
+ pWC = pWInfo + 80
pLoop = (*WhereLoopBuilder)(unsafe.Pointer(pBuilder)).FpNew
(*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags = U32(0)
(*WhereLoop)(unsafe.Pointer(pLoop)).FnSkip = U16(0)
- pTerm = Xsqlite3WhereFindTerm(tls, pWC, iCur, -1, uint64(0), (uint32(WO_EQ | WO_IS)), uintptr(0))
+ pTerm = whereScanInit(tls, bp /* &scan */, pWC, iCur, -1, uint32(WO_EQ|WO_IS), uintptr(0))
+ for pTerm != 0 && (*WhereTerm)(unsafe.Pointer(pTerm)).FprereqRight != 0 {
+ pTerm = whereScanNext(tls, bp /* &scan */)
+ }
if pTerm != 0 {
- (*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags = (U32((WHERE_COLUMN_EQ | WHERE_IPK) | WHERE_ONEROW))
+ (*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags = U32(WHERE_COLUMN_EQ | WHERE_IPK | WHERE_ONEROW)
*(*uintptr)(unsafe.Pointer((*WhereLoop)(unsafe.Pointer(pLoop)).FaLTerm)) = pTerm
(*WhereLoop)(unsafe.Pointer(pLoop)).FnLTerm = U16(1)
- *(*U16)(unsafe.Pointer(pLoop + 24 /* &.u */ /* &.btree */ /* &.nEq */)) = U16(1)
+ *(*U16)(unsafe.Pointer(pLoop + 24)) = U16(1)
// TUNING: Cost of a rowid lookup is 10
(*WhereLoop)(unsafe.Pointer(pLoop)).FrRun = int16(33) // 33==sqlite3LogEst(10)
} else {
for pIdx = (*Table)(unsafe.Pointer(pTab)).FpIndex; pIdx != 0; pIdx = (*Index)(unsafe.Pointer(pIdx)).FpNext {
var opMask int32
- if (!(int32((*Index)(unsafe.Pointer((pIdx))).FonError) != OE_None) ||
- ((*Index)(unsafe.Pointer(pIdx)).FpPartIdxWhere != uintptr(0))) ||
- (int32((*Index)(unsafe.Pointer(pIdx)).FnKeyCol) > (int32(uint32(unsafe.Sizeof([3]uintptr{})) / uint32(unsafe.Sizeof(uintptr(0)))))) {
+ if !(int32((*Index)(unsafe.Pointer(pIdx)).FonError) != OE_None) ||
+ (*Index)(unsafe.Pointer(pIdx)).FpPartIdxWhere != uintptr(0) ||
+ int32((*Index)(unsafe.Pointer(pIdx)).FnKeyCol) > int32(uint32(unsafe.Sizeof([3]uintptr{}))/uint32(unsafe.Sizeof(uintptr(0)))) {
continue
}
- if (uint32(int32(*(*uint16)(unsafe.Pointer(pIdx + 56 /* &.uniqNotNull */)) & 0x8 >> 3))) != 0 {
- opMask = (WO_EQ | WO_IS)
+ if uint32(int32(*(*uint16)(unsafe.Pointer(pIdx + 56))&0x8>>3)) != 0 {
+ opMask = WO_EQ | WO_IS
} else {
opMask = WO_EQ
}
for j = 0; j < int32((*Index)(unsafe.Pointer(pIdx)).FnKeyCol); j++ {
- pTerm = Xsqlite3WhereFindTerm(tls, pWC, iCur, j, uint64(0), uint32(opMask), pIdx)
+ pTerm = whereScanInit(tls, bp /* &scan */, pWC, iCur, j, uint32(opMask), pIdx)
+ for pTerm != 0 && (*WhereTerm)(unsafe.Pointer(pTerm)).FprereqRight != 0 {
+ pTerm = whereScanNext(tls, bp /* &scan */)
+ }
if pTerm == uintptr(0) {
break
}
@@ -135176,13 +137216,13 @@ func whereShortCut(tls *libc.TLS, pBuilder uintptr) int32 { /* sqlite3.c:153812:
if j != int32((*Index)(unsafe.Pointer(pIdx)).FnKeyCol) {
continue
}
- (*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags = (U32((WHERE_COLUMN_EQ | WHERE_ONEROW) | WHERE_INDEXED))
- if ((uint32(int32(*(*uint16)(unsafe.Pointer(pIdx + 56 /* &.isCovering */)) & 0x20 >> 5))) != 0) || (((*SrcItem)(unsafe.Pointer(pItem)).FcolUsed & (*Index)(unsafe.Pointer(pIdx)).FcolNotIdxed) == uint64(0)) {
- *(*U32)(unsafe.Pointer(pLoop + 36 /* &.wsFlags */)) |= (U32(WHERE_IDX_ONLY))
+ (*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags = U32(WHERE_COLUMN_EQ | WHERE_ONEROW | WHERE_INDEXED)
+ if uint32(int32(*(*uint16)(unsafe.Pointer(pIdx + 56))&0x20>>5)) != 0 || (*SrcItem)(unsafe.Pointer(pItem)).FcolUsed&(*Index)(unsafe.Pointer(pIdx)).FcolNotIdxed == uint64(0) {
+ *(*U32)(unsafe.Pointer(pLoop + 36)) |= U32(WHERE_IDX_ONLY)
}
(*WhereLoop)(unsafe.Pointer(pLoop)).FnLTerm = U16(j)
- *(*U16)(unsafe.Pointer(pLoop + 24 /* &.u */ /* &.btree */ /* &.nEq */)) = U16(j)
- *(*uintptr)(unsafe.Pointer(pLoop + 24 /* &.u */ /* &.btree */ + 8 /* &.pIndex */)) = pIdx
+ *(*U16)(unsafe.Pointer(pLoop + 24)) = U16(j)
+ *(*uintptr)(unsafe.Pointer(pLoop + 24 + 8 /* &.pIndex */)) = pIdx
// TUNING: Cost of a unique index lookup is 15
(*WhereLoop)(unsafe.Pointer(pLoop)).FrRun = int16(39) // 39==sqlite3LogEst(15)
break
@@ -135190,25 +137230,28 @@ func whereShortCut(tls *libc.TLS, pBuilder uintptr) int32 { /* sqlite3.c:153812:
}
if (*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags != 0 {
(*WhereLoop)(unsafe.Pointer(pLoop)).FnOut = int16(1)
- (*WhereLevel)(unsafe.Pointer((pWInfo + 752 /* &.a */))).FpWLoop = pLoop
+ (*WhereLevel)(unsafe.Pointer(pWInfo + 752)).FpWLoop = pLoop
(*WhereLoop)(unsafe.Pointer(pLoop)).FmaskSelf = uint64(1) // sqlite3WhereGetMask(&pWInfo->sMaskSet, iCur);
- (*WhereLevel)(unsafe.Pointer((pWInfo + 752 /* &.a */))).FiTabCur = iCur
+ (*WhereLevel)(unsafe.Pointer(pWInfo + 752)).FiTabCur = iCur
(*WhereInfo)(unsafe.Pointer(pWInfo)).FnRowOut = int16(1)
if (*WhereInfo)(unsafe.Pointer(pWInfo)).FpOrderBy != 0 {
(*WhereInfo)(unsafe.Pointer(pWInfo)).FnOBSat = I8((*ExprList)(unsafe.Pointer((*WhereInfo)(unsafe.Pointer(pWInfo)).FpOrderBy)).FnExpr)
}
- if (int32((*WhereInfo)(unsafe.Pointer(pWInfo)).FwctrlFlags) & WHERE_WANT_DISTINCT) != 0 {
+ if int32((*WhereInfo)(unsafe.Pointer(pWInfo)).FwctrlFlags)&WHERE_WANT_DISTINCT != 0 {
(*WhereInfo)(unsafe.Pointer(pWInfo)).FeDistinct = U8(WHERE_DISTINCT_UNIQUE)
}
+ if int32((*WhereScan)(unsafe.Pointer(bp)).FiEquiv) > 1 {
+ *(*U32)(unsafe.Pointer(pLoop + 36)) |= U32(WHERE_TRANSCONS)
+ }
return 1
}
return 0
}
// Helper function for exprIsDeterministic().
-func exprNodeIsDeterministic(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 { /* sqlite3.c:153894:12: */
- if (int32((*Expr)(unsafe.Pointer(pExpr)).Fop) == TK_FUNCTION) && ((libc.Bool32(((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_ConstFunc))) != U32(0))) == 0) {
+func exprNodeIsDeterministic(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 { /* sqlite3.c:155299:12: */
+ if int32((*Expr)(unsafe.Pointer(pExpr)).Fop) == TK_FUNCTION && libc.Bool32((*Expr)(unsafe.Pointer(pExpr)).Fflags&U32(EP_ConstFunc) != U32(0)) == 0 {
(*Walker)(unsafe.Pointer(pWalker)).FeCode = U16(0)
return WRC_Abort
}
@@ -135218,7 +137261,7 @@ func exprNodeIsDeterministic(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int3
// Return true if the expression contains no non-deterministic SQL
// functions. Do not consider non-deterministic SQL functions that are
// part of sub-select statements.
-func exprIsDeterministic(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:153907:12: */
+func exprIsDeterministic(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:155312:12: */
bp := tls.Alloc(28)
defer tls.Free(28)
@@ -135322,7 +137365,7 @@ func exprIsDeterministic(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:153907:1
// the first cursor in an array of cursors for all indices. iIdxCur should
// be used to compute the appropriate cursor depending on which index is
// used.
-func Xsqlite3WhereBegin(tls *libc.TLS, pParse uintptr, pTabList uintptr, pWhere uintptr, pOrderBy uintptr, pResultSet uintptr, wctrlFlags U16, iAuxArg int32) uintptr { /* sqlite3.c:154027:26: */
+func Xsqlite3WhereBegin(tls *libc.TLS, pParse uintptr, pTabList uintptr, pWhere uintptr, pOrderBy uintptr, pResultSet uintptr, wctrlFlags U16, iAuxArg int32) uintptr { /* sqlite3.c:155432:26: */
bp := tls.Alloc(44)
defer tls.Free(44)
@@ -135379,7 +137422,7 @@ func Xsqlite3WhereBegin(tls *libc.TLS, pParse uintptr, pTabList uintptr, pWhere
// An ORDER/GROUP BY clause of more than 63 terms cannot be optimized
- if !((pOrderBy != 0) && ((*ExprList)(unsafe.Pointer(pOrderBy)).FnExpr >= (int32(uint32(unsafe.Sizeof(Bitmask(0))) * uint32(8))))) {
+ if !(pOrderBy != 0 && (*ExprList)(unsafe.Pointer(pOrderBy)).FnExpr >= int32(uint32(unsafe.Sizeof(Bitmask(0)))*uint32(8))) {
goto __1
}
pOrderBy = uintptr(0)
@@ -135389,20 +137432,20 @@ __1:
// Disable the DISTINCT optimization if SQLITE_DistinctOpt is set via
// sqlite3_test_ctrl(SQLITE_TESTCTRL_OPTIMIZATIONS,...)
- if !(((*Sqlite3)(unsafe.Pointer((db))).FdbOptFlags & (U32(SQLITE_DistinctOpt))) != U32(0)) {
+ if !((*Sqlite3)(unsafe.Pointer(db)).FdbOptFlags&U32(SQLITE_DistinctOpt) != U32(0)) {
goto __2
}
- wctrlFlags = libc.Uint16FromInt32(int32(wctrlFlags) & (libc.CplInt32(WHERE_WANT_DISTINCT)))
+ wctrlFlags = libc.Uint16FromInt32(int32(wctrlFlags) & libc.CplInt32(WHERE_WANT_DISTINCT))
__2:
;
// The number of tables in the FROM clause is limited by the number of
// bits in a Bitmask
- if !((*SrcList)(unsafe.Pointer(pTabList)).FnSrc > (int32(uint32(unsafe.Sizeof(Bitmask(0))) * uint32(8)))) {
+ if !((*SrcList)(unsafe.Pointer(pTabList)).FnSrc > int32(uint32(unsafe.Sizeof(Bitmask(0)))*uint32(8))) {
goto __3
}
- Xsqlite3ErrorMsg(tls, pParse, ts+20328 /* "at most %d table..." */, libc.VaList(bp, (int32(uint32(unsafe.Sizeof(Bitmask(0)))*uint32(8)))))
+ Xsqlite3ErrorMsg(tls, pParse, ts+21625 /* "at most %d table..." */, libc.VaList(bp, int32(uint32(unsafe.Sizeof(Bitmask(0)))*uint32(8))))
return uintptr(0)
__3:
;
@@ -135411,7 +137454,7 @@ __3:
// pTabList. But if the WHERE_OR_SUBCLAUSE flag is set, then we should
// only generate code for the first table in pTabList and assume that
// any cursors associated with subsequent tables are uninitialized.
- if (int32(wctrlFlags) & WHERE_OR_SUBCLAUSE) != 0 {
+ if int32(wctrlFlags)&WHERE_OR_SUBCLAUSE != 0 {
nTabList = 1
} else {
nTabList = (*SrcList)(unsafe.Pointer(pTabList)).FnSrc
@@ -135423,8 +137466,8 @@ __3:
// and the WhereMaskSet structure. Since WhereClause contains an 8-byte
// field (type Bitmask) it must be aligned on an 8-byte boundary on
// some architectures. Hence the ROUND8() below.
- nByteWInfo = (int32(((uint32(unsafe.Sizeof(WhereInfo{})) + ((uint32(nTabList - 1)) * uint32(unsafe.Sizeof(WhereLevel{})))) + uint32(7)) & libc.Uint32FromInt32(libc.CplInt32(7))))
- pWInfo = Xsqlite3DbMallocRawNN(tls, db, (uint64(uint32(nByteWInfo) + uint32(unsafe.Sizeof(WhereLoop{})))))
+ nByteWInfo = int32((uint32(unsafe.Sizeof(WhereInfo{})) + uint32(nTabList-1)*uint32(unsafe.Sizeof(WhereLevel{})) + uint32(7)) & libc.Uint32FromInt32(libc.CplInt32(7)))
+ pWInfo = Xsqlite3DbMallocRawNN(tls, db, uint64(uint32(nByteWInfo)+uint32(unsafe.Sizeof(WhereLoop{}))))
if !((*Sqlite3)(unsafe.Pointer(db)).FmallocFailed != 0) {
goto __4
}
@@ -135438,28 +137481,28 @@ __4:
(*WhereInfo)(unsafe.Pointer(pWInfo)).FpOrderBy = pOrderBy
(*WhereInfo)(unsafe.Pointer(pWInfo)).FpWhere = pWhere
(*WhereInfo)(unsafe.Pointer(pWInfo)).FpResultSet = pResultSet
- *(*int32)(unsafe.Pointer((pWInfo + 20 /* &.aiCurOnePass */))) = libc.AssignPtrInt32((pWInfo+20 /* &.aiCurOnePass */)+1*4, -1)
+ *(*int32)(unsafe.Pointer(pWInfo + 20)) = libc.AssignPtrInt32(pWInfo+20+1*4, -1)
(*WhereInfo)(unsafe.Pointer(pWInfo)).FnLevel = U8(nTabList)
- (*WhereInfo)(unsafe.Pointer(pWInfo)).FiBreak = libc.AssignPtrInt32(pWInfo+28 /* &.iContinue */, Xsqlite3VdbeMakeLabel(tls, pParse))
+ (*WhereInfo)(unsafe.Pointer(pWInfo)).FiBreak = libc.AssignPtrInt32(pWInfo+28, Xsqlite3VdbeMakeLabel(tls, pParse))
(*WhereInfo)(unsafe.Pointer(pWInfo)).FwctrlFlags = wctrlFlags
(*WhereInfo)(unsafe.Pointer(pWInfo)).FiLimit = LogEst(iAuxArg)
(*WhereInfo)(unsafe.Pointer(pWInfo)).FsavedNQueryLoop = int32((*Parse)(unsafe.Pointer(pParse)).FnQueryLoop)
- libc.Xmemset(tls, (pWInfo + 45 /* &.nOBSat */), 0,
- ((uint32((uintptr(0) + 80 /* &.sWC */))) - (uint32((uintptr(0) + 45 /* &.nOBSat */)))))
- libc.Xmemset(tls, (pWInfo + 752 /* &.a */), 0, (uint32(unsafe.Sizeof(WhereLoop{})) + (uint32(nTabList) * uint32(unsafe.Sizeof(WhereLevel{})))))
+ libc.Xmemset(tls, pWInfo+45, 0,
+ uint32(uintptr(0)+80)-uint32(uintptr(0)+45))
+ libc.Xmemset(tls, pWInfo+752, 0, uint32(unsafe.Sizeof(WhereLoop{}))+uint32(nTabList)*uint32(unsafe.Sizeof(WhereLevel{})))
// ONEPASS defaults to OFF
- pMaskSet = (pWInfo + 488 /* &.sMaskSet */)
+ pMaskSet = pWInfo + 488
(*WhereLoopBuilder)(unsafe.Pointer(bp + 8 /* &sWLB */)).FpWInfo = pWInfo
- (*WhereLoopBuilder)(unsafe.Pointer(bp + 8 /* &sWLB */)).FpWC = (pWInfo + 80 /* &.sWC */)
- (*WhereLoopBuilder)(unsafe.Pointer(bp + 8 /* &sWLB */)).FpNew = ((pWInfo) + uintptr(nByteWInfo))
+ (*WhereLoopBuilder)(unsafe.Pointer(bp + 8 /* &sWLB */)).FpWC = pWInfo + 80
+ (*WhereLoopBuilder)(unsafe.Pointer(bp + 8 /* &sWLB */)).FpNew = pWInfo + uintptr(nByteWInfo)
whereLoopInit(tls, (*WhereLoopBuilder)(unsafe.Pointer(bp+8 /* &sWLB */)).FpNew)
// Split the WHERE clause into separate subexpressions where each
// subexpression is separated by an AND operator.
(*WhereMaskSet)(unsafe.Pointer(pMaskSet)).Fn = 0
- Xsqlite3WhereClauseInit(tls, (pWInfo + 80 /* &.sWC */), pWInfo)
- Xsqlite3WhereSplit(tls, (pWInfo + 80 /* &.sWC */), pWhere, uint8(TK_AND))
+ Xsqlite3WhereClauseInit(tls, pWInfo+80, pWInfo)
+ Xsqlite3WhereSplit(tls, pWInfo+80, pWhere, uint8(TK_AND))
// Special case: No FROM clause
if !(nTabList == 0) {
@@ -135471,13 +137514,13 @@ __4:
(*WhereInfo)(unsafe.Pointer(pWInfo)).FnOBSat = I8((*ExprList)(unsafe.Pointer(pOrderBy)).FnExpr)
__7:
;
- if !((int32(wctrlFlags) & WHERE_WANT_DISTINCT) != 0) {
+ if !(int32(wctrlFlags)&WHERE_WANT_DISTINCT != 0) {
goto __8
}
(*WhereInfo)(unsafe.Pointer(pWInfo)).FeDistinct = U8(WHERE_DISTINCT_UNIQUE)
__8:
;
- Xsqlite3VdbeExplain(tls, pParse, uint8(0), ts+20356 /* "SCAN CONSTANT RO..." */, 0)
+ Xsqlite3VdbeExplain(tls, pParse, uint8(0), ts+21653 /* "SCAN CONSTANT RO..." */, 0)
goto __6
__5:
// Assign a bit from the bitmask to every term in the FROM clause.
@@ -135495,11 +137538,11 @@ __5:
// WHERE_OR_SUBCLAUSE flag is set.
ii = 0
__9:
- createMask(tls, pMaskSet, (*SrcItem)(unsafe.Pointer((pTabList+8 /* &.a */)+uintptr(ii)*72)).FiCursor)
- Xsqlite3WhereTabFuncArgs(tls, pParse, ((pTabList + 8 /* &.a */) + uintptr(ii)*72), (pWInfo + 80 /* &.sWC */))
+ createMask(tls, pMaskSet, (*SrcItem)(unsafe.Pointer(pTabList+8+uintptr(ii)*72)).FiCursor)
+ Xsqlite3WhereTabFuncArgs(tls, pParse, pTabList+8+uintptr(ii)*72, pWInfo+80)
goto __10
__10:
- if (libc.PreIncInt32(&ii, 1)) < (*SrcList)(unsafe.Pointer(pTabList)).FnSrc {
+ if libc.PreIncInt32(&ii, 1) < (*SrcList)(unsafe.Pointer(pTabList)).FnSrc {
goto __9
}
goto __11
@@ -135509,7 +137552,7 @@ __6:
;
// Analyze all of the subexpressions.
- Xsqlite3WhereExprAnalyze(tls, pTabList, (pWInfo + 80 /* &.sWC */))
+ Xsqlite3WhereExprAnalyze(tls, pTabList, pWInfo+80)
if !((*Sqlite3)(unsafe.Pointer(db)).FmallocFailed != 0) {
goto __12
}
@@ -135529,21 +137572,21 @@ __12:
// FROM ... WHERE (SELECT random())>0; -- eval random() once overall
ii = 0
__13:
- if !(ii < (*WhereClause)(unsafe.Pointer((*WhereLoopBuilder)(unsafe.Pointer(bp+8 /* &sWLB */)).FpWC)).FnTerm) {
+ if !(ii < (*WhereClause)(unsafe.Pointer((*WhereLoopBuilder)(unsafe.Pointer(bp+8)).FpWC)).FnTerm) {
goto __15
}
- pT = ((*WhereClause)(unsafe.Pointer((*WhereLoopBuilder)(unsafe.Pointer(bp+8 /* &sWLB */)).FpWC)).Fa + uintptr(ii)*48)
- if !((int32((*WhereTerm)(unsafe.Pointer(pT)).FwtFlags) & TERM_VIRTUAL) != 0) {
+ pT = (*WhereClause)(unsafe.Pointer((*WhereLoopBuilder)(unsafe.Pointer(bp+8)).FpWC)).Fa + uintptr(ii)*48
+ if !(int32((*WhereTerm)(unsafe.Pointer(pT)).FwtFlags)&TERM_VIRTUAL != 0) {
goto __16
}
goto __14
__16:
;
- if !(((*WhereTerm)(unsafe.Pointer(pT)).FprereqAll == uint64(0)) && ((nTabList == 0) || (exprIsDeterministic(tls, (*WhereTerm)(unsafe.Pointer(pT)).FpExpr) != 0))) {
+ if !((*WhereTerm)(unsafe.Pointer(pT)).FprereqAll == uint64(0) && (nTabList == 0 || exprIsDeterministic(tls, (*WhereTerm)(unsafe.Pointer(pT)).FpExpr) != 0)) {
goto __17
}
Xsqlite3ExprIfFalse(tls, pParse, (*WhereTerm)(unsafe.Pointer(pT)).FpExpr, (*WhereInfo)(unsafe.Pointer(pWInfo)).FiBreak, SQLITE_JUMPIFNULL)
- *(*U16)(unsafe.Pointer(pT + 10 /* &.wtFlags */)) |= U16((TERM_CODED))
+ *(*U16)(unsafe.Pointer(pT + 10)) |= U16(TERM_CODED)
__17:
;
goto __14
@@ -135554,10 +137597,10 @@ __14:
__15:
;
- if !((int32(wctrlFlags) & WHERE_WANT_DISTINCT) != 0) {
+ if !(int32(wctrlFlags)&WHERE_WANT_DISTINCT != 0) {
goto __18
}
- if !(isDistinctRedundant(tls, pParse, pTabList, (pWInfo+80 /* &.sWC */), pResultSet) != 0) {
+ if !(isDistinctRedundant(tls, pParse, pTabList, pWInfo+80, pResultSet) != 0) {
goto __19
}
// The DISTINCT marking is pointless. Ignore it.
@@ -135568,7 +137611,7 @@ __19:
goto __21
}
// Try to ORDER BY the result set to make distinct processing easier
- *(*U16)(unsafe.Pointer(pWInfo + 40 /* &.wctrlFlags */)) |= U16((WHERE_DISTINCTBY))
+ *(*U16)(unsafe.Pointer(pWInfo + 40)) |= U16(WHERE_DISTINCTBY)
(*WhereInfo)(unsafe.Pointer(pWInfo)).FpOrderBy = pResultSet
__21:
;
@@ -135579,7 +137622,7 @@ __18:
// Construct the WhereLoop objects
- if !((nTabList != 1) || (whereShortCut(tls, bp+8 /* &sWLB */) == 0)) {
+ if !(nTabList != 1 || whereShortCut(tls, bp+8) == 0) {
goto __22
}
rc = whereLoopAddAll(tls, bp+8 /* &sWLB */)
@@ -135595,7 +137638,7 @@ __23:
// changed based on STAT4 information while computing subsequent loops,
// then we need to rerun the whole loop building process so that all
// loops will be built using the revised truthProb values.
- if !((int32((*WhereLoopBuilder)(unsafe.Pointer(bp+8 /* &sWLB */)).FbldFlags2) & SQLITE_BLDF2_2NDPASS) != 0) {
+ if !(int32((*WhereLoopBuilder)(unsafe.Pointer(bp+8)).FbldFlags2)&SQLITE_BLDF2_2NDPASS != 0) {
goto __24
}
@@ -135629,7 +137672,7 @@ __28:
if !((*WhereInfo)(unsafe.Pointer(pWInfo)).FpOrderBy != 0) {
goto __29
}
- wherePathSolver(tls, pWInfo, (int16(int32((*WhereInfo)(unsafe.Pointer(pWInfo)).FnRowOut) + 1)))
+ wherePathSolver(tls, pWInfo, int16(int32((*WhereInfo)(unsafe.Pointer(pWInfo)).FnRowOut)+1))
if !((*Sqlite3)(unsafe.Pointer(db)).FmallocFailed != 0) {
goto __30
}
@@ -135640,13 +137683,13 @@ __29:
;
__22:
;
- if !(((*WhereInfo)(unsafe.Pointer(pWInfo)).FpOrderBy == uintptr(0)) && (((*Sqlite3)(unsafe.Pointer(db)).Fflags & uint64(SQLITE_ReverseOrder)) != uint64(0))) {
+ if !((*WhereInfo)(unsafe.Pointer(pWInfo)).FpOrderBy == uintptr(0) && (*Sqlite3)(unsafe.Pointer(db)).Fflags&uint64(SQLITE_ReverseOrder) != uint64(0)) {
goto __31
}
(*WhereInfo)(unsafe.Pointer(pWInfo)).FrevMask = libc.Uint64(libc.Uint64FromInt32(-1))
__31:
;
- if !(((*Parse)(unsafe.Pointer(pParse)).FnErr != 0) || ((*Sqlite3)(unsafe.Pointer(db)).FmallocFailed != 0)) {
+ if !((*Parse)(unsafe.Pointer(pParse)).FnErr != 0 || (*Sqlite3)(unsafe.Pointer(db)).FmallocFailed != 0) {
goto __32
}
goto whereBeginError
@@ -135682,56 +137725,56 @@ __32:
// LEFT JOIN t2
// LEFT JOIN t3 ON (t1.ipk=t3.ipk)
notReady = libc.CplUint64(uint64(0))
- if !((((int32((*WhereInfo)(unsafe.Pointer(pWInfo)).FnLevel) >= 2) &&
- (pResultSet != uintptr(0))) && // these two combine to guarantee
- (0 == (int32(wctrlFlags) & WHERE_AGG_DISTINCT))) && // condition (1) above
- (((*Sqlite3)(unsafe.Pointer((db))).FdbOptFlags & (U32(SQLITE_OmitNoopJoin))) == U32(0))) {
+ if !(int32((*WhereInfo)(unsafe.Pointer(pWInfo)).FnLevel) >= 2 &&
+ pResultSet != uintptr(0) &&
+ 0 == int32(wctrlFlags)&WHERE_AGG_DISTINCT &&
+ (*Sqlite3)(unsafe.Pointer(db)).FdbOptFlags&U32(SQLITE_OmitNoopJoin) == U32(0)) {
goto __33
}
tabUsed = Xsqlite3WhereExprListUsage(tls, pMaskSet, pResultSet)
- if !((*WhereLoopBuilder)(unsafe.Pointer(bp+8 /* &sWLB */)).FpOrderBy != 0) {
+ if !((*WhereLoopBuilder)(unsafe.Pointer(bp+8)).FpOrderBy != 0) {
goto __34
}
- tabUsed = tabUsed | (Xsqlite3WhereExprListUsage(tls, pMaskSet, (*WhereLoopBuilder)(unsafe.Pointer(bp+8 /* &sWLB */)).FpOrderBy))
+ tabUsed = tabUsed | Xsqlite3WhereExprListUsage(tls, pMaskSet, (*WhereLoopBuilder)(unsafe.Pointer(bp+8)).FpOrderBy)
__34:
;
- i = (int32((*WhereInfo)(unsafe.Pointer(pWInfo)).FnLevel) - 1)
+ i = int32((*WhereInfo)(unsafe.Pointer(pWInfo)).FnLevel) - 1
__35:
if !(i >= 1) {
goto __37
}
- pLoop = (*WhereLevel)(unsafe.Pointer((pWInfo + 752 /* &.a */) + uintptr(i)*80)).FpWLoop
- pItem = (((*WhereInfo)(unsafe.Pointer(pWInfo)).FpTabList + 8 /* &.a */) + uintptr((*WhereLoop)(unsafe.Pointer(pLoop)).FiTab)*72)
- if !((int32((*SrcItem)(unsafe.Pointer(pItem)).Ffg.Fjointype) & JT_LEFT) == 0) {
+ pLoop = (*WhereLevel)(unsafe.Pointer(pWInfo + 752 + uintptr(i)*80)).FpWLoop
+ pItem = (*WhereInfo)(unsafe.Pointer(pWInfo)).FpTabList + 8 + uintptr((*WhereLoop)(unsafe.Pointer(pLoop)).FiTab)*72
+ if !(int32((*SrcItem)(unsafe.Pointer(pItem)).Ffg.Fjointype)&JT_LEFT == 0) {
goto __38
}
goto __36
__38:
;
- if !(((int32(wctrlFlags) & WHERE_WANT_DISTINCT) == 0) &&
- (((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & U32(WHERE_ONEROW)) == U32(0))) {
+ if !(int32(wctrlFlags)&WHERE_WANT_DISTINCT == 0 &&
+ (*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags&U32(WHERE_ONEROW) == U32(0)) {
goto __39
}
goto __36
__39:
;
- if !((tabUsed & (*WhereLoop)(unsafe.Pointer(pLoop)).FmaskSelf) != uint64(0)) {
+ if !(tabUsed&(*WhereLoop)(unsafe.Pointer(pLoop)).FmaskSelf != uint64(0)) {
goto __40
}
goto __36
__40:
;
- pEnd = ((*WhereClause)(unsafe.Pointer((*WhereLoopBuilder)(unsafe.Pointer(bp+8 /* &sWLB */)).FpWC)).Fa + uintptr((*WhereClause)(unsafe.Pointer((*WhereLoopBuilder)(unsafe.Pointer(bp+8 /* &sWLB */)).FpWC)).FnTerm)*48)
+ pEnd = (*WhereClause)(unsafe.Pointer((*WhereLoopBuilder)(unsafe.Pointer(bp+8)).FpWC)).Fa + uintptr((*WhereClause)(unsafe.Pointer((*WhereLoopBuilder)(unsafe.Pointer(bp+8)).FpWC)).FnTerm)*48
pTerm = (*WhereClause)(unsafe.Pointer((*WhereLoopBuilder)(unsafe.Pointer(bp + 8 /* &sWLB */)).FpWC)).Fa
__41:
if !(pTerm < pEnd) {
goto __43
}
- if !(((*WhereTerm)(unsafe.Pointer(pTerm)).FprereqAll & (*WhereLoop)(unsafe.Pointer(pLoop)).FmaskSelf) != uint64(0)) {
+ if !((*WhereTerm)(unsafe.Pointer(pTerm)).FprereqAll&(*WhereLoop)(unsafe.Pointer(pLoop)).FmaskSelf != uint64(0)) {
goto __44
}
- if !(!(((*Expr)(unsafe.Pointer(((*WhereTerm)(unsafe.Pointer(pTerm)).FpExpr))).Fflags & (U32(EP_FromJoin))) != U32(0)) ||
- ((*Expr)(unsafe.Pointer((*WhereTerm)(unsafe.Pointer(pTerm)).FpExpr)).FiRightJoinTable != (*SrcItem)(unsafe.Pointer(pItem)).FiCursor)) {
+ if !(!((*Expr)(unsafe.Pointer((*WhereTerm)(unsafe.Pointer(pTerm)).FpExpr)).Fflags&U32(EP_FromJoin) != U32(0)) ||
+ (*Expr)(unsafe.Pointer((*WhereTerm)(unsafe.Pointer(pTerm)).FpExpr)).FiRightJoinTable != (*SrcItem)(unsafe.Pointer(pItem)).FiCursor) {
goto __45
}
goto __43
@@ -135753,16 +137796,16 @@ __43:
__46:
;
- notReady = notReady & (^(*WhereLoop)(unsafe.Pointer(pLoop)).FmaskSelf)
+ notReady = notReady & ^(*WhereLoop)(unsafe.Pointer(pLoop)).FmaskSelf
pTerm = (*WhereClause)(unsafe.Pointer((*WhereLoopBuilder)(unsafe.Pointer(bp + 8 /* &sWLB */)).FpWC)).Fa
__47:
if !(pTerm < pEnd) {
goto __49
}
- if !(((*WhereTerm)(unsafe.Pointer(pTerm)).FprereqAll & (*WhereLoop)(unsafe.Pointer(pLoop)).FmaskSelf) != uint64(0)) {
+ if !((*WhereTerm)(unsafe.Pointer(pTerm)).FprereqAll&(*WhereLoop)(unsafe.Pointer(pLoop)).FmaskSelf != uint64(0)) {
goto __50
}
- *(*U16)(unsafe.Pointer(pTerm + 10 /* &.wtFlags */)) |= U16((TERM_CODED))
+ *(*U16)(unsafe.Pointer(pTerm + 10)) |= U16(TERM_CODED)
__50:
;
goto __48
@@ -135772,11 +137815,11 @@ __48:
goto __49
__49:
;
- if !(i != (int32((*WhereInfo)(unsafe.Pointer(pWInfo)).FnLevel) - 1)) {
+ if !(i != int32((*WhereInfo)(unsafe.Pointer(pWInfo)).FnLevel)-1) {
goto __51
}
- nByte = (int32((uint32((int32((*WhereInfo)(unsafe.Pointer(pWInfo)).FnLevel) - 1) - i)) * uint32(unsafe.Sizeof(WhereLevel{}))))
- libc.Xmemmove(tls, ((pWInfo + 752 /* &.a */) + uintptr(i)*80), ((pWInfo + 752 /* &.a */) + uintptr((i+1))*80), uint32(nByte))
+ nByte = int32(uint32(int32((*WhereInfo)(unsafe.Pointer(pWInfo)).FnLevel)-1-i) * uint32(unsafe.Sizeof(WhereLevel{})))
+ libc.Xmemmove(tls, pWInfo+752+uintptr(i)*80, pWInfo+752+uintptr(i+1)*80, uint32(nByte))
__51:
;
(*WhereInfo)(unsafe.Pointer(pWInfo)).FnLevel--
@@ -135790,7 +137833,7 @@ __37:
;
__33:
;
- *(*U32)(unsafe.Pointer((*WhereInfo)(unsafe.Pointer(pWInfo)).FpParse + 132 /* &.nQueryLoop */)) += (U32((*WhereInfo)(unsafe.Pointer(pWInfo)).FnRowOut))
+ *(*U32)(unsafe.Pointer((*WhereInfo)(unsafe.Pointer(pWInfo)).FpParse + 128)) += U32((*WhereInfo)(unsafe.Pointer(pWInfo)).FnRowOut)
// If the caller is an UPDATE or DELETE statement that is requesting
// to use a one-pass algorithm, determine if this is appropriate.
@@ -135811,15 +137854,15 @@ __33:
// use a one-pass approach, and this is not set accurately for scans
// that use the OR optimization.
- if !((int32(wctrlFlags) & WHERE_ONEPASS_DESIRED) != 0) {
+ if !(int32(wctrlFlags)&WHERE_ONEPASS_DESIRED != 0) {
goto __52
}
- wsFlags = int32((*WhereLoop1)(unsafe.Pointer((*WhereLevel)(unsafe.Pointer((pWInfo + 752 /* &.a */))).FpWLoop)).FwsFlags)
- bOnerow = (libc.Bool32((wsFlags & WHERE_ONEROW) != 0))
+ wsFlags = int32((*WhereLoop1)(unsafe.Pointer((*WhereLevel)(unsafe.Pointer(pWInfo + 752)).FpWLoop)).FwsFlags)
+ bOnerow = libc.Bool32(wsFlags&WHERE_ONEROW != 0)
- if !((bOnerow != 0) || (((0 != (int32(wctrlFlags) & WHERE_ONEPASS_MULTIROW)) &&
- !((*Table)(unsafe.Pointer((*SrcItem)(unsafe.Pointer((pTabList + 8 /* &.a */))).FpTab)).FnModuleArg != 0)) &&
- ((0 == (wsFlags & WHERE_MULTI_OR)) || ((int32(wctrlFlags) & WHERE_DUPLICATES_OK) != 0)))) {
+ if !(bOnerow != 0 || 0 != int32(wctrlFlags)&WHERE_ONEPASS_MULTIROW &&
+ !(int32((*Table)(unsafe.Pointer((*SrcItem)(unsafe.Pointer(pTabList+8)).FpTab)).FeTabType) == TABTYP_VTAB) &&
+ (0 == wsFlags&WHERE_MULTI_OR || int32(wctrlFlags)&WHERE_DUPLICATES_OK != 0)) {
goto __53
}
(*WhereInfo)(unsafe.Pointer(pWInfo)).FeOnePass = func() uint8 {
@@ -135828,16 +137871,16 @@ __33:
}
return uint8(ONEPASS_MULTI)
}()
- if !((((*Table)(unsafe.Pointer(((*SrcItem)(unsafe.Pointer((pTabList + 8 /* &.a */))).FpTab))).FtabFlags & U32(TF_WithoutRowid)) == U32(0)) && ((wsFlags & WHERE_IDX_ONLY) != 0)) {
+ if !((*Table)(unsafe.Pointer((*SrcItem)(unsafe.Pointer(pTabList+8)).FpTab)).FtabFlags&U32(TF_WithoutRowid) == U32(0) && wsFlags&WHERE_IDX_ONLY != 0) {
goto __54
}
- if !((int32(wctrlFlags) & WHERE_ONEPASS_MULTIROW) != 0) {
+ if !(int32(wctrlFlags)&WHERE_ONEPASS_MULTIROW != 0) {
goto __55
}
bFordelete = U8(OPFLAG_FORDELETE)
__55:
;
- (*WhereLoop1)(unsafe.Pointer((*WhereLevel)(unsafe.Pointer((pWInfo + 752 /* &.a */))).FpWLoop)).FwsFlags = (U32(wsFlags & libc.CplInt32(WHERE_IDX_ONLY)))
+ (*WhereLoop1)(unsafe.Pointer((*WhereLevel)(unsafe.Pointer(pWInfo + 752)).FpWLoop)).FwsFlags = U32(wsFlags & libc.CplInt32(WHERE_IDX_ONLY))
__54:
;
__53:
@@ -135854,17 +137897,17 @@ __56:
goto __58
}
- pTabItem = ((pTabList + 8 /* &.a */) + uintptr((*WhereLevel)(unsafe.Pointer(pLevel)).FiFrom)*72)
+ pTabItem = pTabList + 8 + uintptr((*WhereLevel)(unsafe.Pointer(pLevel)).FiFrom)*72
pTab = (*SrcItem)(unsafe.Pointer(pTabItem)).FpTab
iDb = Xsqlite3SchemaToIndex(tls, db, (*Table)(unsafe.Pointer(pTab)).FpSchema)
pLoop = (*WhereLevel)(unsafe.Pointer(pLevel)).FpWLoop
- if !((((*Table)(unsafe.Pointer(pTab)).FtabFlags & U32(TF_Ephemeral)) != U32(0)) || ((*Table)(unsafe.Pointer(pTab)).FpSelect != 0)) {
+ if !((*Table)(unsafe.Pointer(pTab)).FtabFlags&U32(TF_Ephemeral) != U32(0) || int32((*Table)(unsafe.Pointer(pTab)).FeTabType) == TABTYP_VIEW) {
goto __59
}
// Do nothing
goto __60
__59:
- if !(((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & U32(WHERE_VIRTUALTABLE)) != U32(0)) {
+ if !((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags&U32(WHERE_VIRTUALTABLE) != U32(0)) {
goto __61
}
pVTab = Xsqlite3GetVTable(tls, db, pTab)
@@ -135872,14 +137915,14 @@ __59:
Xsqlite3VdbeAddOp4(tls, v, OP_VOpen, iCur, 0, 0, pVTab, -12)
goto __62
__61:
- if !((*Table)(unsafe.Pointer(pTab)).FnModuleArg != 0) {
+ if !(int32((*Table)(unsafe.Pointer(pTab)).FeTabType) == TABTYP_VTAB) {
goto __63
}
// noop
goto __64
__63:
- if !((((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & U32(WHERE_IDX_ONLY)) == U32(0)) &&
- ((int32(wctrlFlags) & WHERE_OR_SUBCLAUSE) == 0)) {
+ if !((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags&U32(WHERE_IDX_ONLY) == U32(0) &&
+ int32(wctrlFlags)&WHERE_OR_SUBCLAUSE == 0) {
goto __65
}
op = OP_OpenRead
@@ -135887,15 +137930,15 @@ __63:
goto __67
}
op = OP_OpenWrite
- *(*int32)(unsafe.Pointer((pWInfo + 20 /* &.aiCurOnePass */))) = (*SrcItem)(unsafe.Pointer(pTabItem)).FiCursor
+ *(*int32)(unsafe.Pointer(pWInfo + 20)) = (*SrcItem)(unsafe.Pointer(pTabItem)).FiCursor
__67:
;
Xsqlite3OpenTable(tls, pParse, (*SrcItem)(unsafe.Pointer(pTabItem)).FiCursor, iDb, pTab, op)
- if !(((int32((*WhereInfo)(unsafe.Pointer(pWInfo)).FeOnePass) == ONEPASS_OFF) &&
- (int32((*Table)(unsafe.Pointer(pTab)).FnCol) < (int32(uint32(unsafe.Sizeof(Bitmask(0))) * uint32(8))))) &&
- (((*Table)(unsafe.Pointer(pTab)).FtabFlags & (U32(TF_HasGenerated | TF_WithoutRowid))) == U32(0))) {
+ if !(int32((*WhereInfo)(unsafe.Pointer(pWInfo)).FeOnePass) == ONEPASS_OFF &&
+ int32((*Table)(unsafe.Pointer(pTab)).FnCol) < int32(uint32(unsafe.Sizeof(Bitmask(0)))*uint32(8)) &&
+ (*Table)(unsafe.Pointer(pTab)).FtabFlags&U32(TF_HasGenerated|TF_WithoutRowid) == U32(0)) {
goto __68
}
// If we know that only a prefix of the record will be used,
@@ -135909,7 +137952,7 @@ __69:
}
goto __70
__70:
- b = (b >> 1)
+ b = b >> 1
n++
goto __69
goto __71
@@ -135933,15 +137976,15 @@ __62:
;
__60:
;
- if !(((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & U32(WHERE_INDEXED)) != 0) {
+ if !((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags&U32(WHERE_INDEXED) != 0) {
goto __72
}
- pIx = *(*uintptr)(unsafe.Pointer(pLoop + 24 /* &.u */ /* &.btree */ + 8 /* &.pIndex */))
+ pIx = *(*uintptr)(unsafe.Pointer(pLoop + 24 + 8 /* &.pIndex */))
op1 = OP_OpenRead
// iAuxArg is always set to a positive value if ONEPASS is possible
- if !((!(((*Table)(unsafe.Pointer((pTab))).FtabFlags & U32(TF_WithoutRowid)) == U32(0)) && ((int32(*(*uint16)(unsafe.Pointer((pIx) + 56 /* &.idxType */)) & 0x3 >> 0)) == SQLITE_IDXTYPE_PRIMARYKEY)) &&
- ((int32(wctrlFlags) & WHERE_OR_SUBCLAUSE) != 0)) {
+ if !(!((*Table)(unsafe.Pointer(pTab)).FtabFlags&U32(TF_WithoutRowid) == U32(0)) && int32(*(*uint16)(unsafe.Pointer(pIx + 56))&0x3>>0) == SQLITE_IDXTYPE_PRIMARYKEY &&
+ int32(wctrlFlags)&WHERE_OR_SUBCLAUSE != 0) {
goto __73
}
// This is one term of an OR-optimization using the PRIMARY KEY of a
@@ -135957,7 +138000,7 @@ __73:
iIndexCur = iAuxArg
__77:
- if !((pJ != 0) && (pJ != pIx)) {
+ if !(pJ != 0 && pJ != pIx) {
goto __78
}
iIndexCur++
@@ -135966,10 +138009,10 @@ __77:
__78:
;
op1 = OP_OpenWrite
- *(*int32)(unsafe.Pointer((pWInfo + 20 /* &.aiCurOnePass */) + 1*4)) = iIndexCur
+ *(*int32)(unsafe.Pointer(pWInfo + 20 + 1*4)) = iIndexCur
goto __76
__75:
- if !((iAuxArg != 0) && ((int32(wctrlFlags) & WHERE_OR_SUBCLAUSE) != 0)) {
+ if !(iAuxArg != 0 && int32(wctrlFlags)&WHERE_OR_SUBCLAUSE != 0) {
goto __79
}
iIndexCur = iAuxArg
@@ -135990,12 +138033,12 @@ __74:
}
Xsqlite3VdbeAddOp3(tls, v, op1, iIndexCur, int32((*Index)(unsafe.Pointer(pIx)).Ftnum), iDb)
Xsqlite3VdbeSetP4KeyInfo(tls, pParse, pIx)
- if !((((((((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & U32(WHERE_CONSTRAINT)) != U32(0)) &&
- (((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & (U32(WHERE_COLUMN_RANGE | WHERE_SKIPSCAN))) == U32(0))) &&
- (((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & U32(WHERE_BIGNULL_SORT)) == U32(0))) &&
- (((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & U32(WHERE_IN_SEEKSCAN)) == U32(0))) &&
- ((int32((*WhereInfo)(unsafe.Pointer(pWInfo)).FwctrlFlags) & WHERE_ORDERBY_MIN) == 0)) &&
- (int32((*WhereInfo)(unsafe.Pointer(pWInfo)).FeDistinct) != WHERE_DISTINCT_ORDERED)) {
+ if !((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags&U32(WHERE_CONSTRAINT) != U32(0) &&
+ (*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags&U32(WHERE_COLUMN_RANGE|WHERE_SKIPSCAN) == U32(0) &&
+ (*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags&U32(WHERE_BIGNULL_SORT) == U32(0) &&
+ (*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags&U32(WHERE_IN_SEEKSCAN) == U32(0) &&
+ int32((*WhereInfo)(unsafe.Pointer(pWInfo)).FwctrlFlags)&WHERE_ORDERBY_MIN == 0 &&
+ int32((*WhereInfo)(unsafe.Pointer(pWInfo)).FeDistinct) != WHERE_DISTINCT_ORDERED) {
goto __82
}
Xsqlite3VdbeChangeP5(tls, v, uint16(OPFLAG_SEEKEQ))
@@ -136036,31 +138079,37 @@ __85:
if !(ii < nTabList) {
goto __87
}
- pLevel = ((pWInfo + 752 /* &.a */) + uintptr(ii)*80)
- wsFlags1 = int32((*WhereLoop1)(unsafe.Pointer((*WhereLevel)(unsafe.Pointer(pLevel)).FpWLoop)).FwsFlags)
- if !(((*WhereLoop1)(unsafe.Pointer((*WhereLevel)(unsafe.Pointer(pLevel)).FpWLoop)).FwsFlags & U32(WHERE_AUTO_INDEX)) != U32(0)) {
+ if !((*Parse)(unsafe.Pointer(pParse)).FnErr != 0) {
goto __88
}
- constructAutomaticIndex(tls, pParse, (pWInfo + 80 /* &.sWC */),
- ((pTabList + 8 /* &.a */) + uintptr((*WhereLevel)(unsafe.Pointer(pLevel)).FiFrom)*72), notReady, pLevel)
- if !((*Sqlite3)(unsafe.Pointer(db)).FmallocFailed != 0) {
+ goto whereBeginError
+__88:
+ ;
+ pLevel = pWInfo + 752 + uintptr(ii)*80
+ wsFlags1 = int32((*WhereLoop1)(unsafe.Pointer((*WhereLevel)(unsafe.Pointer(pLevel)).FpWLoop)).FwsFlags)
+ if !((*WhereLoop1)(unsafe.Pointer((*WhereLevel)(unsafe.Pointer(pLevel)).FpWLoop)).FwsFlags&U32(WHERE_AUTO_INDEX) != U32(0)) {
goto __89
}
+ constructAutomaticIndex(tls, pParse, pWInfo+80,
+ pTabList+8+uintptr((*WhereLevel)(unsafe.Pointer(pLevel)).FiFrom)*72, notReady, pLevel)
+ if !((*Sqlite3)(unsafe.Pointer(db)).FmallocFailed != 0) {
+ goto __90
+ }
goto whereBeginError
-__89:
+__90:
;
-__88:
+__89:
;
addrExplain = Xsqlite3WhereExplainOneScan(tls,
pParse, pTabList, pLevel, wctrlFlags)
(*WhereLevel)(unsafe.Pointer(pLevel)).FaddrBody = Xsqlite3VdbeCurrentAddr(tls, v)
notReady = Xsqlite3WhereCodeOneLoopStart(tls, pParse, v, pWInfo, ii, pLevel, notReady)
(*WhereInfo)(unsafe.Pointer(pWInfo)).FiContinue = (*WhereLevel)(unsafe.Pointer(pLevel)).FaddrCont
- if !(((wsFlags1 & WHERE_MULTI_OR) == 0) && ((int32(wctrlFlags) & WHERE_OR_SUBCLAUSE) == 0)) {
- goto __90
+ if !(wsFlags1&WHERE_MULTI_OR == 0 && int32(wctrlFlags)&WHERE_OR_SUBCLAUSE == 0) {
+ goto __91
}
_ = addrExplain
-__90:
+__91:
;
goto __86
__86:
@@ -136078,13 +138127,13 @@ __87:
// Jump here if malloc fails
whereBeginError:
if !(pWInfo != 0) {
- goto __91
+ goto __92
}
whereUndoExprMods(tls, pWInfo)
(*Parse)(unsafe.Pointer(pParse)).FnQueryLoop = U32((*WhereInfo)(unsafe.Pointer(pWInfo)).FsavedNQueryLoop)
whereInfoFree(tls, db, pWInfo)
-__91:
+__92:
;
return uintptr(0)
}
@@ -136096,7 +138145,7 @@ __91:
// Generate the end of the WHERE loop. See comments on
// sqlite3WhereBegin() for additional information.
-func Xsqlite3WhereEnd(tls *libc.TLS, pWInfo uintptr) { /* sqlite3.c:154626:21: */
+func Xsqlite3WhereEnd(tls *libc.TLS, pWInfo uintptr) { /* sqlite3.c:156032:21: */
var pParse uintptr = (*WhereInfo)(unsafe.Pointer(pWInfo)).FpParse
var v uintptr = (*Parse)(unsafe.Pointer(pParse)).FpVdbe
var i int32
@@ -136108,27 +138157,27 @@ func Xsqlite3WhereEnd(tls *libc.TLS, pWInfo uintptr) { /* sqlite3.c:154626:21: *
// Generate loop termination code.
- for i = (int32((*WhereInfo)(unsafe.Pointer(pWInfo)).FnLevel) - 1); i >= 0; i-- {
+ for i = int32((*WhereInfo)(unsafe.Pointer(pWInfo)).FnLevel) - 1; i >= 0; i-- {
var addr int32
- pLevel = ((pWInfo + 752 /* &.a */) + uintptr(i)*80)
+ pLevel = pWInfo + 752 + uintptr(i)*80
pLoop = (*WhereLevel)(unsafe.Pointer(pLevel)).FpWLoop
if int32((*WhereLevel)(unsafe.Pointer(pLevel)).Fop) != OP_Noop {
var addrSeek int32 = 0
var pIdx uintptr
var n int32
- if (((((int32((*WhereInfo)(unsafe.Pointer(pWInfo)).FeDistinct) == WHERE_DISTINCT_ORDERED) &&
- (i == (int32((*WhereInfo)(unsafe.Pointer(pWInfo)).FnLevel) - 1))) && // Ticket [ef9318757b152e3] 2017-10-21
- (((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & U32(WHERE_INDEXED)) != U32(0))) &&
- ((uint32(int32(*(*uint16)(unsafe.Pointer((libc.AssignUintptr(&pIdx, *(*uintptr)(unsafe.Pointer(pLoop + 24 /* &.u */ /* &.btree */ + 8 /* &.pIndex */)))) + 56 /* &.hasStat1 */)) & 0x80 >> 7))) != 0)) &&
- ((libc.AssignInt32(&n, int32(*(*U16)(unsafe.Pointer(pLoop + 24 /* &.u */ /* &.btree */ + 6 /* &.nDistinctCol */))))) > 0)) &&
- (int32(*(*LogEst)(unsafe.Pointer((*Index)(unsafe.Pointer(pIdx)).FaiRowLogEst + uintptr(n)*2))) >= 36) {
- var r1 int32 = ((*Parse)(unsafe.Pointer(pParse)).FnMem + 1)
+ if int32((*WhereInfo)(unsafe.Pointer(pWInfo)).FeDistinct) == WHERE_DISTINCT_ORDERED &&
+ i == int32((*WhereInfo)(unsafe.Pointer(pWInfo)).FnLevel)-1 &&
+ (*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags&U32(WHERE_INDEXED) != U32(0) &&
+ uint32(int32(*(*uint16)(unsafe.Pointer(libc.AssignUintptr(&pIdx, *(*uintptr)(unsafe.Pointer(pLoop + 24 + 8))) + 56))&0x80>>7)) != 0 &&
+ libc.AssignInt32(&n, int32(*(*U16)(unsafe.Pointer(pLoop + 24 + 6)))) > 0 &&
+ int32(*(*LogEst)(unsafe.Pointer((*Index)(unsafe.Pointer(pIdx)).FaiRowLogEst + uintptr(n)*2))) >= 36 {
+ var r1 int32 = (*Parse)(unsafe.Pointer(pParse)).FnMem + 1
var j int32
var op int32
for j = 0; j < n; j++ {
- Xsqlite3VdbeAddOp3(tls, v, OP_Column, (*WhereLevel)(unsafe.Pointer(pLevel)).FiIdxCur, j, (r1 + j))
+ Xsqlite3VdbeAddOp3(tls, v, OP_Column, (*WhereLevel)(unsafe.Pointer(pLevel)).FiIdxCur, j, r1+j)
}
- *(*int32)(unsafe.Pointer(pParse + 44 /* &.nMem */)) += (n + 1)
+ *(*int32)(unsafe.Pointer(pParse + 44)) += n + 1
if int32((*WhereLevel)(unsafe.Pointer(pLevel)).Fop) == OP_Prev {
op = OP_SeekLT
} else {
@@ -136145,7 +138194,7 @@ func Xsqlite3WhereEnd(tls *libc.TLS, pWInfo uintptr) { /* sqlite3.c:154626:21: *
if (*WhereLevel)(unsafe.Pointer(pLevel)).FregBignull != 0 {
Xsqlite3VdbeResolveLabel(tls, v, (*WhereLevel)(unsafe.Pointer(pLevel)).FaddrBignull)
- Xsqlite3VdbeAddOp2(tls, v, OP_DecrJumpZero, (*WhereLevel)(unsafe.Pointer(pLevel)).FregBignull, ((*WhereLevel)(unsafe.Pointer(pLevel)).Fp2 - 1))
+ Xsqlite3VdbeAddOp2(tls, v, OP_DecrJumpZero, (*WhereLevel)(unsafe.Pointer(pLevel)).FregBignull, (*WhereLevel)(unsafe.Pointer(pLevel)).Fp2-1)
}
if addrSeek != 0 {
@@ -136154,23 +138203,23 @@ func Xsqlite3WhereEnd(tls *libc.TLS, pWInfo uintptr) { /* sqlite3.c:154626:21: *
} else {
Xsqlite3VdbeResolveLabel(tls, v, (*WhereLevel)(unsafe.Pointer(pLevel)).FaddrCont)
}
- if (((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & U32(WHERE_IN_ABLE)) != 0) && (*(*int32)(unsafe.Pointer((pLevel + 56 /* &.u */ /* &.in */) /* &.nIn */)) > 0) {
+ if (*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags&U32(WHERE_IN_ABLE) != U32(0) && *(*int32)(unsafe.Pointer(pLevel + 56)) > 0 {
var pIn uintptr
var j int32
Xsqlite3VdbeResolveLabel(tls, v, (*WhereLevel)(unsafe.Pointer(pLevel)).FaddrNxt)
- j = *(*int32)(unsafe.Pointer(pLevel + 56 /* &.u */ /* &.in */ /* &.nIn */))
- pIn = (*(*uintptr)(unsafe.Pointer((pLevel + 56 /* &.u */ /* &.in */) + 4 /* &.aInLoop */)) + uintptr((j-1))*20)
+ j = *(*int32)(unsafe.Pointer(pLevel + 56))
+ pIn = *(*uintptr)(unsafe.Pointer(pLevel + 56 + 4)) + uintptr(j-1)*20
__1:
if !(j > 0) {
goto __3
}
{
- Xsqlite3VdbeJumpHere(tls, v, (*(*int32)(unsafe.Pointer(pIn + 4)) + 1))
+ Xsqlite3VdbeJumpHere(tls, v, *(*int32)(unsafe.Pointer(pIn + 4))+1)
if int32(*(*U8)(unsafe.Pointer(pIn + 16))) != OP_Noop {
if *(*int32)(unsafe.Pointer(pIn + 12)) != 0 {
- var bEarlyOut int32 = (libc.Bool32((((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & U32(WHERE_VIRTUALTABLE)) == U32(0)) &&
- (((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & U32(WHERE_IN_EARLYOUT)) != U32(0))))
+ var bEarlyOut int32 = libc.Bool32((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags&U32(WHERE_VIRTUALTABLE) == U32(0) &&
+ (*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags&U32(WHERE_IN_EARLYOUT) != U32(0))
if (*WhereLevel)(unsafe.Pointer(pLevel)).FiLeftJoin != 0 {
// For LEFT JOIN queries, cursor pIn->iCur may not have been
// opened yet. This occurs for WHERE clauses such as
@@ -136181,25 +138230,25 @@ func Xsqlite3WhereEnd(tls *libc.TLS, pWInfo uintptr) { /* sqlite3.c:154626:21: *
// jump over the OP_Next or OP_Prev instruction about to
// be coded.
Xsqlite3VdbeAddOp2(tls, v, OP_IfNotOpen, *(*int32)(unsafe.Pointer(pIn)),
- ((Xsqlite3VdbeCurrentAddr(tls, v) + 2) + bEarlyOut))
+ Xsqlite3VdbeCurrentAddr(tls, v)+2+bEarlyOut)
}
if bEarlyOut != 0 {
Xsqlite3VdbeAddOp4Int(tls, v, OP_IfNoHope, (*WhereLevel)(unsafe.Pointer(pLevel)).FiIdxCur,
- (Xsqlite3VdbeCurrentAddr(tls, v) + 2),
+ Xsqlite3VdbeCurrentAddr(tls, v)+2,
*(*int32)(unsafe.Pointer(pIn + 8)), *(*int32)(unsafe.Pointer(pIn + 12)))
// Retarget the OP_IsNull against the left operand of IN so
// it jumps past the OP_IfNoHope. This is because the
// OP_IsNull also bypasses the OP_Affinity opcode that is
// required by OP_IfNoHope.
- Xsqlite3VdbeJumpHere(tls, v, (*(*int32)(unsafe.Pointer(pIn + 4)) + 1))
+ Xsqlite3VdbeJumpHere(tls, v, *(*int32)(unsafe.Pointer(pIn + 4))+1)
}
}
Xsqlite3VdbeAddOp2(tls, v, int32(*(*U8)(unsafe.Pointer(pIn + 16))), *(*int32)(unsafe.Pointer(pIn)), *(*int32)(unsafe.Pointer(pIn + 4)))
}
- Xsqlite3VdbeJumpHere(tls, v, (*(*int32)(unsafe.Pointer(pIn + 4)) - 1))
+ Xsqlite3VdbeJumpHere(tls, v, *(*int32)(unsafe.Pointer(pIn + 4))-1)
}
goto __2
@@ -136215,18 +138264,24 @@ func Xsqlite3WhereEnd(tls *libc.TLS, pWInfo uintptr) { /* sqlite3.c:154626:21: *
Xsqlite3VdbeGoto(tls, v, (*WhereLevel)(unsafe.Pointer(pLevel)).FaddrSkip)
Xsqlite3VdbeJumpHere(tls, v, (*WhereLevel)(unsafe.Pointer(pLevel)).FaddrSkip)
- Xsqlite3VdbeJumpHere(tls, v, ((*WhereLevel)(unsafe.Pointer(pLevel)).FaddrSkip - 2))
+ Xsqlite3VdbeJumpHere(tls, v, (*WhereLevel)(unsafe.Pointer(pLevel)).FaddrSkip-2)
}
if (*WhereLevel)(unsafe.Pointer(pLevel)).FiLeftJoin != 0 {
var ws int32 = int32((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags)
addr = Xsqlite3VdbeAddOp1(tls, v, OP_IfPos, (*WhereLevel)(unsafe.Pointer(pLevel)).FiLeftJoin)
- if (ws & WHERE_IDX_ONLY) == 0 {
+ if ws&WHERE_IDX_ONLY == 0 {
Xsqlite3VdbeAddOp1(tls, v, OP_NullRow, (*WhereLevel)(unsafe.Pointer(pLevel)).FiTabCur)
}
- if ((ws & WHERE_INDEXED) != 0) ||
- (((ws & WHERE_MULTI_OR) != 0) && (*(*uintptr)(unsafe.Pointer(pLevel + 56 /* &.u */)) != 0)) {
+ if ws&WHERE_INDEXED != 0 ||
+ ws&WHERE_MULTI_OR != 0 && *(*uintptr)(unsafe.Pointer(pLevel + 56)) != 0 {
+ if ws&WHERE_MULTI_OR != 0 {
+ var pIx uintptr = *(*uintptr)(unsafe.Pointer(pLevel + 56))
+ var iDb int32 = Xsqlite3SchemaToIndex(tls, db, (*Index)(unsafe.Pointer(pIx)).FpSchema)
+ Xsqlite3VdbeAddOp3(tls, v, OP_ReopenIdx, (*WhereLevel)(unsafe.Pointer(pLevel)).FiIdxCur, int32((*Index)(unsafe.Pointer(pIx)).Ftnum), iDb)
+ Xsqlite3VdbeSetP4KeyInfo(tls, pParse, pIx)
+ }
Xsqlite3VdbeAddOp1(tls, v, OP_NullRow, (*WhereLevel)(unsafe.Pointer(pLevel)).FiIdxCur)
}
if int32((*WhereLevel)(unsafe.Pointer(pLevel)).Fop) == OP_Return {
@@ -136255,7 +138310,7 @@ __4:
var pOp uintptr
var pLastOp uintptr
var pIdx uintptr = uintptr(0)
- var pTabItem uintptr = ((pTabList + 8 /* &.a */) + uintptr((*WhereLevel)(unsafe.Pointer(pLevel)).FiFrom)*72)
+ var pTabItem uintptr = pTabList + 8 + uintptr((*WhereLevel)(unsafe.Pointer(pLevel)).FiFrom)*72
var pTab uintptr = (*SrcItem)(unsafe.Pointer(pTabItem)).FpTab
pLoop = (*WhereLevel)(unsafe.Pointer(pLevel)).FpWLoop
@@ -136263,7 +138318,7 @@ __4:
// For a co-routine, change all OP_Column references to the table of
// the co-routine into OP_Copy of result contained in a register.
// OP_Rowid becomes OP_Null.
- if (uint32(int32(*(*uint16)(unsafe.Pointer(pTabItem + 36 /* &.fg */ + 4 /* &.viaCoroutine */)) & 0x10 >> 4))) != 0 {
+ if uint32(int32(*(*uint16)(unsafe.Pointer(pTabItem + 36 + 4))&0x10>>4)) != 0 {
translateColumnToCopy(tls, pParse, (*WhereLevel)(unsafe.Pointer(pLevel)).FaddrBody, (*WhereLevel)(unsafe.Pointer(pLevel)).FiTabCur,
(*SrcItem)(unsafe.Pointer(pTabItem)).FregResult, 0)
@@ -136280,30 +138335,30 @@ __4:
// directly. This loop scans all that code looking for opcodes
// that reference the table and converts them into opcodes that
// reference the index.
- if ((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & (U32(WHERE_INDEXED | WHERE_IDX_ONLY))) != 0 {
- pIdx = *(*uintptr)(unsafe.Pointer(pLoop + 24 /* &.u */ /* &.btree */ + 8 /* &.pIndex */))
- } else if ((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & U32(WHERE_MULTI_OR)) != 0 {
- pIdx = *(*uintptr)(unsafe.Pointer(pLevel + 56 /* &.u */))
+ if (*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags&U32(WHERE_INDEXED|WHERE_IDX_ONLY) != 0 {
+ pIdx = *(*uintptr)(unsafe.Pointer(pLoop + 24 + 8 /* &.pIndex */))
+ } else if (*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags&U32(WHERE_MULTI_OR) != 0 {
+ pIdx = *(*uintptr)(unsafe.Pointer(pLevel + 56))
}
- if (pIdx != 0) &&
+ if pIdx != 0 &&
!(int32((*Sqlite3)(unsafe.Pointer(db)).FmallocFailed) != 0) {
- if (int32((*WhereInfo)(unsafe.Pointer(pWInfo)).FeOnePass) == ONEPASS_OFF) || !(((*Table)(unsafe.Pointer(((*Index)(unsafe.Pointer(pIdx)).FpTable))).FtabFlags & U32(TF_WithoutRowid)) == U32(0)) {
+ if int32((*WhereInfo)(unsafe.Pointer(pWInfo)).FeOnePass) == ONEPASS_OFF || !((*Table)(unsafe.Pointer((*Index)(unsafe.Pointer(pIdx)).FpTable)).FtabFlags&U32(TF_WithoutRowid) == U32(0)) {
last = iEnd
} else {
last = (*WhereInfo)(unsafe.Pointer(pWInfo)).FiEndWhere
}
- k = ((*WhereLevel)(unsafe.Pointer(pLevel)).FaddrBody + 1)
+ k = (*WhereLevel)(unsafe.Pointer(pLevel)).FaddrBody + 1
pOp = Xsqlite3VdbeGetOp(tls, v, k)
- pLastOp = (pOp + uintptr((last-k))*20)
+ pLastOp = pOp + uintptr(last-k)*20
- for ok := true; ok; ok = ((libc.PreIncUintptr(&pOp, 20)) < pLastOp) {
+ for ok := true; ok; ok = libc.PreIncUintptr(&pOp, 20) < pLastOp {
if (*VdbeOp)(unsafe.Pointer(pOp)).Fp1 != (*WhereLevel)(unsafe.Pointer(pLevel)).FiTabCur {
// no-op
- } else if (int32((*VdbeOp)(unsafe.Pointer(pOp)).Fopcode) == OP_Column) ||
- (int32((*VdbeOp)(unsafe.Pointer(pOp)).Fopcode) == OP_Offset) {
+ } else if int32((*VdbeOp)(unsafe.Pointer(pOp)).Fopcode) == OP_Column ||
+ int32((*VdbeOp)(unsafe.Pointer(pOp)).Fopcode) == OP_Offset {
var x int32 = (*VdbeOp)(unsafe.Pointer(pOp)).Fp2
- if !(((*Table)(unsafe.Pointer((pTab))).FtabFlags & U32(TF_WithoutRowid)) == U32(0)) {
+ if !((*Table)(unsafe.Pointer(pTab)).FtabFlags&U32(TF_WithoutRowid) == U32(0)) {
var pPk uintptr = Xsqlite3PrimaryKeyIndex(tls, pTab)
x = int32(*(*I16)(unsafe.Pointer((*Index)(unsafe.Pointer(pPk)).FaiColumn + uintptr(x)*2)))
@@ -136488,16 +138543,16 @@ __6:
// window frame has been coerced to:
//
// ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW
-func row_numberStepFunc(tls *libc.TLS, pCtx uintptr, nArg int32, apArg uintptr) { /* sqlite3.c:155058:13: */
+func row_numberStepFunc(tls *libc.TLS, pCtx uintptr, nArg int32, apArg uintptr) { /* sqlite3.c:156470:13: */
var p uintptr = Xsqlite3_aggregate_context(tls, pCtx, int32(unsafe.Sizeof(I64(0))))
if p != 0 {
- (*(*I64)(unsafe.Pointer(p)))++
+ *(*I64)(unsafe.Pointer(p))++
}
_ = nArg
_ = apArg
}
-func row_numberValueFunc(tls *libc.TLS, pCtx uintptr) { /* sqlite3.c:155068:13: */
+func row_numberValueFunc(tls *libc.TLS, pCtx uintptr) { /* sqlite3.c:156480:13: */
var p uintptr = Xsqlite3_aggregate_context(tls, pCtx, int32(unsafe.Sizeof(I64(0))))
Xsqlite3_result_int64(tls, pCtx, func() int64 {
if p != 0 {
@@ -136513,13 +138568,13 @@ type CallCount = struct {
FnValue I64
FnStep I64
FnTotal I64
-} /* sqlite3.c:155077:1 */
+} /* sqlite3.c:156489:1 */
// Implementation of built-in window function dense_rank(). Assumes that
// the window frame has been set to:
//
// RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW
-func dense_rankStepFunc(tls *libc.TLS, pCtx uintptr, nArg int32, apArg uintptr) { /* sqlite3.c:155089:13: */
+func dense_rankStepFunc(tls *libc.TLS, pCtx uintptr, nArg int32, apArg uintptr) { /* sqlite3.c:156501:13: */
var p uintptr
p = Xsqlite3_aggregate_context(tls, pCtx, int32(unsafe.Sizeof(CallCount{})))
if p != 0 {
@@ -136529,7 +138584,7 @@ func dense_rankStepFunc(tls *libc.TLS, pCtx uintptr, nArg int32, apArg uintptr)
_ = apArg
}
-func dense_rankValueFunc(tls *libc.TLS, pCtx uintptr) { /* sqlite3.c:155100:13: */
+func dense_rankValueFunc(tls *libc.TLS, pCtx uintptr) { /* sqlite3.c:156512:13: */
var p uintptr
p = Xsqlite3_aggregate_context(tls, pCtx, int32(unsafe.Sizeof(CallCount{})))
if p != 0 {
@@ -136548,9 +138603,9 @@ type NthValueCtx = struct {
FnStep I64
FpValue uintptr
F__ccgo_pad1 [4]byte
-} /* sqlite3.c:155117:1 */
+} /* sqlite3.c:156529:1 */
-func nth_valueStepFunc(tls *libc.TLS, pCtx uintptr, nArg int32, apArg uintptr) { /* sqlite3.c:155121:13: */
+func nth_valueStepFunc(tls *libc.TLS, pCtx uintptr, nArg int32, apArg uintptr) { /* sqlite3.c:156533:13: */
var p uintptr
var fVal float64
var iVal I64
@@ -136572,7 +138627,7 @@ __3:
goto __2
__4:
fVal = Xsqlite3_value_double(tls, *(*uintptr)(unsafe.Pointer(apArg + 1*4)))
- if !((float64(I64(fVal))) != fVal) {
+ if !(float64(I64(fVal)) != fVal) {
goto __6
}
goto error_out
@@ -136597,7 +138652,7 @@ __7:
goto __8
}
(*NthValueCtx)(unsafe.Pointer(p)).FpValue = Xsqlite3_value_dup(tls, *(*uintptr)(unsafe.Pointer(apArg)))
- if !(!(int32((*NthValueCtx)(unsafe.Pointer(p)).FpValue) != 0)) {
+ if !!(int32((*NthValueCtx)(unsafe.Pointer(p)).FpValue) != 0) {
goto __9
}
Xsqlite3_result_error_nomem(tls, pCtx)
@@ -136613,23 +138668,23 @@ __1:
error_out:
Xsqlite3_result_error(tls,
- pCtx, ts+20374 /* "second argument ..." */, -1)
+ pCtx, ts+21671 /* "second argument ..." */, -1)
}
-func nth_valueFinalizeFunc(tls *libc.TLS, pCtx uintptr) { /* sqlite3.c:155162:13: */
+func nth_valueFinalizeFunc(tls *libc.TLS, pCtx uintptr) { /* sqlite3.c:156574:13: */
var p uintptr
p = Xsqlite3_aggregate_context(tls, pCtx, 0)
- if (p != 0) && ((*NthValueCtx)(unsafe.Pointer(p)).FpValue != 0) {
+ if p != 0 && (*NthValueCtx)(unsafe.Pointer(p)).FpValue != 0 {
Xsqlite3_result_value(tls, pCtx, (*NthValueCtx)(unsafe.Pointer(p)).FpValue)
Xsqlite3_value_free(tls, (*NthValueCtx)(unsafe.Pointer(p)).FpValue)
(*NthValueCtx)(unsafe.Pointer(p)).FpValue = uintptr(0)
}
}
-func first_valueStepFunc(tls *libc.TLS, pCtx uintptr, nArg int32, apArg uintptr) { /* sqlite3.c:155174:13: */
+func first_valueStepFunc(tls *libc.TLS, pCtx uintptr, nArg int32, apArg uintptr) { /* sqlite3.c:156586:13: */
var p uintptr
p = Xsqlite3_aggregate_context(tls, pCtx, int32(unsafe.Sizeof(NthValueCtx{})))
- if (p != 0) && ((*NthValueCtx)(unsafe.Pointer(p)).FpValue == uintptr(0)) {
+ if p != 0 && (*NthValueCtx)(unsafe.Pointer(p)).FpValue == uintptr(0) {
(*NthValueCtx)(unsafe.Pointer(p)).FpValue = Xsqlite3_value_dup(tls, *(*uintptr)(unsafe.Pointer(apArg)))
if !(int32((*NthValueCtx)(unsafe.Pointer(p)).FpValue) != 0) {
Xsqlite3_result_error_nomem(tls, pCtx)
@@ -136639,10 +138694,10 @@ func first_valueStepFunc(tls *libc.TLS, pCtx uintptr, nArg int32, apArg uintptr)
_ = apArg
}
-func first_valueFinalizeFunc(tls *libc.TLS, pCtx uintptr) { /* sqlite3.c:155190:13: */
+func first_valueFinalizeFunc(tls *libc.TLS, pCtx uintptr) { /* sqlite3.c:156602:13: */
var p uintptr
p = Xsqlite3_aggregate_context(tls, pCtx, int32(unsafe.Sizeof(NthValueCtx{})))
- if (p != 0) && ((*NthValueCtx)(unsafe.Pointer(p)).FpValue != 0) {
+ if p != 0 && (*NthValueCtx)(unsafe.Pointer(p)).FpValue != 0 {
Xsqlite3_result_value(tls, pCtx, (*NthValueCtx)(unsafe.Pointer(p)).FpValue)
Xsqlite3_value_free(tls, (*NthValueCtx)(unsafe.Pointer(p)).FpValue)
(*NthValueCtx)(unsafe.Pointer(p)).FpValue = uintptr(0)
@@ -136653,7 +138708,7 @@ func first_valueFinalizeFunc(tls *libc.TLS, pCtx uintptr) { /* sqlite3.c:155190:
// the window frame has been set to:
//
// RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW
-func rankStepFunc(tls *libc.TLS, pCtx uintptr, nArg int32, apArg uintptr) { /* sqlite3.c:155208:13: */
+func rankStepFunc(tls *libc.TLS, pCtx uintptr, nArg int32, apArg uintptr) { /* sqlite3.c:156620:13: */
var p uintptr
p = Xsqlite3_aggregate_context(tls, pCtx, int32(unsafe.Sizeof(CallCount{})))
if p != 0 {
@@ -136666,7 +138721,7 @@ func rankStepFunc(tls *libc.TLS, pCtx uintptr, nArg int32, apArg uintptr) { /* s
_ = apArg
}
-func rankValueFunc(tls *libc.TLS, pCtx uintptr) { /* sqlite3.c:155224:13: */
+func rankValueFunc(tls *libc.TLS, pCtx uintptr) { /* sqlite3.c:156636:13: */
var p uintptr
p = Xsqlite3_aggregate_context(tls, pCtx, int32(unsafe.Sizeof(CallCount{})))
if p != 0 {
@@ -136679,7 +138734,7 @@ func rankValueFunc(tls *libc.TLS, pCtx uintptr) { /* sqlite3.c:155224:13: */
// the window frame has been set to:
//
// GROUPS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING
-func percent_rankStepFunc(tls *libc.TLS, pCtx uintptr, nArg int32, apArg uintptr) { /* sqlite3.c:155239:13: */
+func percent_rankStepFunc(tls *libc.TLS, pCtx uintptr, nArg int32, apArg uintptr) { /* sqlite3.c:156651:13: */
var p uintptr
_ = nArg
_ = apArg
@@ -136689,7 +138744,7 @@ func percent_rankStepFunc(tls *libc.TLS, pCtx uintptr, nArg int32, apArg uintptr
}
}
-func percent_rankInvFunc(tls *libc.TLS, pCtx uintptr, nArg int32, apArg uintptr) { /* sqlite3.c:155252:13: */
+func percent_rankInvFunc(tls *libc.TLS, pCtx uintptr, nArg int32, apArg uintptr) { /* sqlite3.c:156664:13: */
var p uintptr
_ = nArg
_ = apArg
@@ -136697,13 +138752,13 @@ func percent_rankInvFunc(tls *libc.TLS, pCtx uintptr, nArg int32, apArg uintptr)
(*CallCount)(unsafe.Pointer(p)).FnStep++
}
-func percent_rankValueFunc(tls *libc.TLS, pCtx uintptr) { /* sqlite3.c:155263:13: */
+func percent_rankValueFunc(tls *libc.TLS, pCtx uintptr) { /* sqlite3.c:156675:13: */
var p uintptr
p = Xsqlite3_aggregate_context(tls, pCtx, int32(unsafe.Sizeof(CallCount{})))
if p != 0 {
(*CallCount)(unsafe.Pointer(p)).FnValue = (*CallCount)(unsafe.Pointer(p)).FnStep
if (*CallCount)(unsafe.Pointer(p)).FnTotal > int64(1) {
- var r float64 = (float64((*CallCount)(unsafe.Pointer(p)).FnValue) / (float64((*CallCount)(unsafe.Pointer(p)).FnTotal - int64(1))))
+ var r float64 = float64((*CallCount)(unsafe.Pointer(p)).FnValue) / float64((*CallCount)(unsafe.Pointer(p)).FnTotal-int64(1))
Xsqlite3_result_double(tls, pCtx, r)
} else {
Xsqlite3_result_double(tls, pCtx, 0.0)
@@ -136715,7 +138770,7 @@ func percent_rankValueFunc(tls *libc.TLS, pCtx uintptr) { /* sqlite3.c:155263:13
// the window frame has been set to:
//
// GROUPS BETWEEN 1 FOLLOWING AND UNBOUNDED FOLLOWING
-func cume_distStepFunc(tls *libc.TLS, pCtx uintptr, nArg int32, apArg uintptr) { /* sqlite3.c:155284:13: */
+func cume_distStepFunc(tls *libc.TLS, pCtx uintptr, nArg int32, apArg uintptr) { /* sqlite3.c:156696:13: */
var p uintptr
_ = nArg
_ = apArg
@@ -136725,7 +138780,7 @@ func cume_distStepFunc(tls *libc.TLS, pCtx uintptr, nArg int32, apArg uintptr) {
}
}
-func cume_distInvFunc(tls *libc.TLS, pCtx uintptr, nArg int32, apArg uintptr) { /* sqlite3.c:155297:13: */
+func cume_distInvFunc(tls *libc.TLS, pCtx uintptr, nArg int32, apArg uintptr) { /* sqlite3.c:156709:13: */
var p uintptr
_ = nArg
_ = apArg
@@ -136733,11 +138788,11 @@ func cume_distInvFunc(tls *libc.TLS, pCtx uintptr, nArg int32, apArg uintptr) {
(*CallCount)(unsafe.Pointer(p)).FnStep++
}
-func cume_distValueFunc(tls *libc.TLS, pCtx uintptr) { /* sqlite3.c:155308:13: */
+func cume_distValueFunc(tls *libc.TLS, pCtx uintptr) { /* sqlite3.c:156720:13: */
var p uintptr
p = Xsqlite3_aggregate_context(tls, pCtx, 0)
if p != 0 {
- var r float64 = ((float64((*CallCount)(unsafe.Pointer(p)).FnStep)) / (float64((*CallCount)(unsafe.Pointer(p)).FnTotal)))
+ var r float64 = float64((*CallCount)(unsafe.Pointer(p)).FnStep) / float64((*CallCount)(unsafe.Pointer(p)).FnTotal)
Xsqlite3_result_double(tls, pCtx, r)
}
}
@@ -136747,13 +138802,13 @@ type NtileCtx = struct {
FnTotal I64
FnParam I64
FiRow I64
-} /* sqlite3.c:155321:1 */
+} /* sqlite3.c:156733:1 */
// Implementation of ntile(). This assumes that the window frame has
// been coerced to:
//
// ROWS CURRENT ROW AND UNBOUNDED FOLLOWING
-func ntileStepFunc(tls *libc.TLS, pCtx uintptr, nArg int32, apArg uintptr) { /* sqlite3.c:155333:13: */
+func ntileStepFunc(tls *libc.TLS, pCtx uintptr, nArg int32, apArg uintptr) { /* sqlite3.c:156745:13: */
var p uintptr
_ = nArg
p = Xsqlite3_aggregate_context(tls, pCtx, int32(unsafe.Sizeof(NtileCtx{})))
@@ -136762,14 +138817,14 @@ func ntileStepFunc(tls *libc.TLS, pCtx uintptr, nArg int32, apArg uintptr) { /*
(*NtileCtx)(unsafe.Pointer(p)).FnParam = Xsqlite3_value_int64(tls, *(*uintptr)(unsafe.Pointer(apArg)))
if (*NtileCtx)(unsafe.Pointer(p)).FnParam <= int64(0) {
Xsqlite3_result_error(tls,
- pCtx, ts+20430 /* "argument of ntil..." */, -1)
+ pCtx, ts+21727 /* "argument of ntil..." */, -1)
}
}
(*NtileCtx)(unsafe.Pointer(p)).FnTotal++
}
}
-func ntileInvFunc(tls *libc.TLS, pCtx uintptr, nArg int32, apArg uintptr) { /* sqlite3.c:155353:13: */
+func ntileInvFunc(tls *libc.TLS, pCtx uintptr, nArg int32, apArg uintptr) { /* sqlite3.c:156765:13: */
var p uintptr
_ = nArg
_ = apArg
@@ -136777,22 +138832,22 @@ func ntileInvFunc(tls *libc.TLS, pCtx uintptr, nArg int32, apArg uintptr) { /* s
(*NtileCtx)(unsafe.Pointer(p)).FiRow++
}
-func ntileValueFunc(tls *libc.TLS, pCtx uintptr) { /* sqlite3.c:155364:13: */
+func ntileValueFunc(tls *libc.TLS, pCtx uintptr) { /* sqlite3.c:156776:13: */
var p uintptr
p = Xsqlite3_aggregate_context(tls, pCtx, int32(unsafe.Sizeof(NtileCtx{})))
- if (p != 0) && ((*NtileCtx)(unsafe.Pointer(p)).FnParam > int64(0)) {
- var nSize int32 = (int32((*NtileCtx)(unsafe.Pointer(p)).FnTotal / (*NtileCtx)(unsafe.Pointer(p)).FnParam))
+ if p != 0 && (*NtileCtx)(unsafe.Pointer(p)).FnParam > int64(0) {
+ var nSize int32 = int32((*NtileCtx)(unsafe.Pointer(p)).FnTotal / (*NtileCtx)(unsafe.Pointer(p)).FnParam)
if nSize == 0 {
- Xsqlite3_result_int64(tls, pCtx, ((*NtileCtx)(unsafe.Pointer(p)).FiRow + int64(1)))
+ Xsqlite3_result_int64(tls, pCtx, (*NtileCtx)(unsafe.Pointer(p)).FiRow+int64(1))
} else {
- var nLarge I64 = ((*NtileCtx)(unsafe.Pointer(p)).FnTotal - ((*NtileCtx)(unsafe.Pointer(p)).FnParam * I64(nSize)))
- var iSmall I64 = (nLarge * (I64(nSize + 1)))
+ var nLarge I64 = (*NtileCtx)(unsafe.Pointer(p)).FnTotal - (*NtileCtx)(unsafe.Pointer(p)).FnParam*I64(nSize)
+ var iSmall I64 = nLarge * I64(nSize+1)
var iRow I64 = (*NtileCtx)(unsafe.Pointer(p)).FiRow
if iRow < iSmall {
- Xsqlite3_result_int64(tls, pCtx, (int64(1) + (iRow / (I64(nSize + 1)))))
+ Xsqlite3_result_int64(tls, pCtx, int64(1)+iRow/I64(nSize+1))
} else {
- Xsqlite3_result_int64(tls, pCtx, ((int64(1) + nLarge) + ((iRow - iSmall) / I64(nSize))))
+ Xsqlite3_result_int64(tls, pCtx, int64(1)+nLarge+(iRow-iSmall)/I64(nSize))
}
}
}
@@ -136802,10 +138857,10 @@ func ntileValueFunc(tls *libc.TLS, pCtx uintptr) { /* sqlite3.c:155364:13: */
type LastValueCtx = struct {
FpVal uintptr
FnVal int32
-} /* sqlite3.c:155391:1 */
+} /* sqlite3.c:156803:1 */
// Implementation of last_value().
-func last_valueStepFunc(tls *libc.TLS, pCtx uintptr, nArg int32, apArg uintptr) { /* sqlite3.c:155399:13: */
+func last_valueStepFunc(tls *libc.TLS, pCtx uintptr, nArg int32, apArg uintptr) { /* sqlite3.c:156811:13: */
var p uintptr
_ = nArg
p = Xsqlite3_aggregate_context(tls, pCtx, int32(unsafe.Sizeof(LastValueCtx{})))
@@ -136820,7 +138875,7 @@ func last_valueStepFunc(tls *libc.TLS, pCtx uintptr, nArg int32, apArg uintptr)
}
}
-func last_valueInvFunc(tls *libc.TLS, pCtx uintptr, nArg int32, apArg uintptr) { /* sqlite3.c:155417:13: */
+func last_valueInvFunc(tls *libc.TLS, pCtx uintptr, nArg int32, apArg uintptr) { /* sqlite3.c:156829:13: */
var p uintptr
_ = nArg
_ = apArg
@@ -136834,18 +138889,18 @@ func last_valueInvFunc(tls *libc.TLS, pCtx uintptr, nArg int32, apArg uintptr) {
}
}
-func last_valueValueFunc(tls *libc.TLS, pCtx uintptr) { /* sqlite3.c:155434:13: */
+func last_valueValueFunc(tls *libc.TLS, pCtx uintptr) { /* sqlite3.c:156846:13: */
var p uintptr
p = Xsqlite3_aggregate_context(tls, pCtx, 0)
- if (p != 0) && ((*LastValueCtx)(unsafe.Pointer(p)).FpVal != 0) {
+ if p != 0 && (*LastValueCtx)(unsafe.Pointer(p)).FpVal != 0 {
Xsqlite3_result_value(tls, pCtx, (*LastValueCtx)(unsafe.Pointer(p)).FpVal)
}
}
-func last_valueFinalizeFunc(tls *libc.TLS, pCtx uintptr) { /* sqlite3.c:155441:13: */
+func last_valueFinalizeFunc(tls *libc.TLS, pCtx uintptr) { /* sqlite3.c:156853:13: */
var p uintptr
p = Xsqlite3_aggregate_context(tls, pCtx, int32(unsafe.Sizeof(LastValueCtx{})))
- if (p != 0) && ((*LastValueCtx)(unsafe.Pointer(p)).FpVal != 0) {
+ if p != 0 && (*LastValueCtx)(unsafe.Pointer(p)).FpVal != 0 {
Xsqlite3_result_value(tls, pCtx, (*LastValueCtx)(unsafe.Pointer(p)).FpVal)
Xsqlite3_value_free(tls, (*LastValueCtx)(unsafe.Pointer(p)).FpVal)
(*LastValueCtx)(unsafe.Pointer(p)).FpVal = uintptr(0)
@@ -136858,17 +138913,17 @@ func last_valueFinalizeFunc(tls *libc.TLS, pCtx uintptr) { /* sqlite3.c:155441:1
// comparison of the zName pointer. Example:
//
// if( pFuncDef->zName==row_valueName ){ ... }
-var row_numberName = *(*[11]uint8)(unsafe.Pointer(ts + 20475 /* "row_number" */)) /* sqlite3.c:155459:19 */
-var dense_rankName = *(*[11]uint8)(unsafe.Pointer(ts + 20486 /* "dense_rank" */)) /* sqlite3.c:155460:19 */
-var rankName = *(*[5]uint8)(unsafe.Pointer(ts + 20497 /* "rank" */)) /* sqlite3.c:155461:19 */
-var percent_rankName = *(*[13]uint8)(unsafe.Pointer(ts + 20502 /* "percent_rank" */)) /* sqlite3.c:155462:19 */
-var cume_distName = *(*[10]uint8)(unsafe.Pointer(ts + 20515 /* "cume_dist" */)) /* sqlite3.c:155463:19 */
-var ntileName = *(*[6]uint8)(unsafe.Pointer(ts + 20525 /* "ntile" */)) /* sqlite3.c:155464:19 */
-var last_valueName = *(*[11]uint8)(unsafe.Pointer(ts + 20531 /* "last_value" */)) /* sqlite3.c:155465:19 */
-var nth_valueName = *(*[10]uint8)(unsafe.Pointer(ts + 20542 /* "nth_value" */)) /* sqlite3.c:155466:19 */
-var first_valueName = *(*[12]uint8)(unsafe.Pointer(ts + 20552 /* "first_value" */)) /* sqlite3.c:155467:19 */
-var leadName = *(*[5]uint8)(unsafe.Pointer(ts + 20564 /* "lead" */)) /* sqlite3.c:155468:19 */
-var lagName = *(*[4]uint8)(unsafe.Pointer(ts + 20569 /* "lag" */)) /* sqlite3.c:155469:19 */
+var row_numberName = *(*[11]uint8)(unsafe.Pointer(ts + 21772 /* "row_number" */)) /* sqlite3.c:156871:19 */
+var dense_rankName = *(*[11]uint8)(unsafe.Pointer(ts + 21783 /* "dense_rank" */)) /* sqlite3.c:156872:19 */
+var rankName = *(*[5]uint8)(unsafe.Pointer(ts + 21794 /* "rank" */)) /* sqlite3.c:156873:19 */
+var percent_rankName = *(*[13]uint8)(unsafe.Pointer(ts + 21799 /* "percent_rank" */)) /* sqlite3.c:156874:19 */
+var cume_distName = *(*[10]uint8)(unsafe.Pointer(ts + 21812 /* "cume_dist" */)) /* sqlite3.c:156875:19 */
+var ntileName = *(*[6]uint8)(unsafe.Pointer(ts + 21822 /* "ntile" */)) /* sqlite3.c:156876:19 */
+var last_valueName = *(*[11]uint8)(unsafe.Pointer(ts + 21828 /* "last_value" */)) /* sqlite3.c:156877:19 */
+var nth_valueName = *(*[10]uint8)(unsafe.Pointer(ts + 21839 /* "nth_value" */)) /* sqlite3.c:156878:19 */
+var first_valueName = *(*[12]uint8)(unsafe.Pointer(ts + 21849 /* "first_value" */)) /* sqlite3.c:156879:19 */
+var leadName = *(*[5]uint8)(unsafe.Pointer(ts + 21861 /* "lead" */)) /* sqlite3.c:156880:19 */
+var lagName = *(*[4]uint8)(unsafe.Pointer(ts + 21866 /* "lag" */)) /* sqlite3.c:156881:19 */
// No-op implementations of xStep() and xFinalize(). Used as place-holders
// for built-in window functions that never call those interfaces.
@@ -136877,7 +138932,7 @@ var lagName = *(*[4]uint8)(unsafe.Pointer(ts + 20569 /* "lag" */))
// noopStepFunc() is never called, and so it is marked with NO_TEST to
// let the test coverage routine know not to expect this function to be
// invoked.
-func noopStepFunc(tls *libc.TLS, p uintptr, n int32, a uintptr) { /* sqlite3.c:155480:13: */ //NO_TEST
+func noopStepFunc(tls *libc.TLS, p uintptr, n int32, a uintptr) { /* sqlite3.c:156892:13: */ //NO_TEST
_ = p //NO_TEST
_ = n //NO_TEST
_ = a //NO_TEST
@@ -136885,7 +138940,7 @@ func noopStepFunc(tls *libc.TLS, p uintptr, n int32, a uintptr) { /* sqlite3.c:1
}
//NO_TEST
-func noopValueFunc(tls *libc.TLS, p uintptr) { /* sqlite3.c:155490:13: */
+func noopValueFunc(tls *libc.TLS, p uintptr) { /* sqlite3.c:156902:13: */
_ = p /*no-op*/
}
@@ -136900,28 +138955,28 @@ func noopValueFunc(tls *libc.TLS, p uintptr) { /* sqlite3.c:155490:13: */
// xInverse.
// Register those built-in window functions that are not also aggregates.
-func Xsqlite3WindowFunctions(tls *libc.TLS) { /* sqlite3.c:155521:21: */
- Xsqlite3InsertBuiltinFuncs(tls, uintptr(unsafe.Pointer(&aWindowFuncs)), (int32(uint32(unsafe.Sizeof(aWindowFuncs)) / uint32(unsafe.Sizeof(FuncDef{})))))
+func Xsqlite3WindowFunctions(tls *libc.TLS) { /* sqlite3.c:156933:21: */
+ Xsqlite3InsertBuiltinFuncs(tls, uintptr(unsafe.Pointer(&aWindowFuncs)), int32(uint32(unsafe.Sizeof(aWindowFuncs))/uint32(unsafe.Sizeof(FuncDef{}))))
}
var aWindowFuncs = [15]FuncDef{
- {FfuncFlags: (U32((SQLITE_UTF8 | SQLITE_FUNC_WINDOW) | 0)), FxSFunc: 0, FxFinalize: 0, FxValue: 0, FxInverse: 0, FzName: 0},
- {FfuncFlags: (U32((SQLITE_UTF8 | SQLITE_FUNC_WINDOW) | 0)), FxSFunc: 0, FxFinalize: 0, FxValue: 0, FxInverse: 0, FzName: 0},
- {FfuncFlags: (U32((SQLITE_UTF8 | SQLITE_FUNC_WINDOW) | 0)), FxSFunc: 0, FxFinalize: 0, FxValue: 0, FxInverse: 0, FzName: 0},
- {FfuncFlags: (U32((SQLITE_UTF8 | SQLITE_FUNC_WINDOW) | 0)), FxSFunc: 0, FxFinalize: 0, FxValue: 0, FxInverse: 0, FzName: 0},
- {FfuncFlags: (U32((SQLITE_UTF8 | SQLITE_FUNC_WINDOW) | 0)), FxSFunc: 0, FxFinalize: 0, FxValue: 0, FxInverse: 0, FzName: 0},
- {FnArg: int8(1), FfuncFlags: (U32((SQLITE_UTF8 | SQLITE_FUNC_WINDOW) | 0)), FxSFunc: 0, FxFinalize: 0, FxValue: 0, FxInverse: 0, FzName: 0},
- {FnArg: int8(1), FfuncFlags: (U32((SQLITE_UTF8 | SQLITE_FUNC_WINDOW) | 0)), FxSFunc: 0, FxFinalize: 0, FxValue: 0, FxInverse: 0, FzName: 0},
- {FnArg: int8(2), FfuncFlags: (U32((SQLITE_UTF8 | SQLITE_FUNC_WINDOW) | 0)), FxSFunc: 0, FxFinalize: 0, FxValue: 0, FxInverse: 0, FzName: 0},
- {FnArg: int8(1), FfuncFlags: (U32((SQLITE_UTF8 | SQLITE_FUNC_WINDOW) | 0)), FxSFunc: 0, FxFinalize: 0, FxValue: 0, FxInverse: 0, FzName: 0},
- {FnArg: int8(1), FfuncFlags: (U32((SQLITE_UTF8 | SQLITE_FUNC_WINDOW) | 0)), FxSFunc: 0, FxFinalize: 0, FxValue: 0, FxInverse: 0, FzName: 0},
- {FnArg: int8(2), FfuncFlags: (U32((SQLITE_UTF8 | SQLITE_FUNC_WINDOW) | 0)), FxSFunc: 0, FxFinalize: 0, FxValue: 0, FxInverse: 0, FzName: 0},
- {FnArg: int8(3), FfuncFlags: (U32((SQLITE_UTF8 | SQLITE_FUNC_WINDOW) | 0)), FxSFunc: 0, FxFinalize: 0, FxValue: 0, FxInverse: 0, FzName: 0},
- {FnArg: int8(1), FfuncFlags: (U32((SQLITE_UTF8 | SQLITE_FUNC_WINDOW) | 0)), FxSFunc: 0, FxFinalize: 0, FxValue: 0, FxInverse: 0, FzName: 0},
- {FnArg: int8(2), FfuncFlags: (U32((SQLITE_UTF8 | SQLITE_FUNC_WINDOW) | 0)), FxSFunc: 0, FxFinalize: 0, FxValue: 0, FxInverse: 0, FzName: 0},
- {FnArg: int8(3), FfuncFlags: (U32((SQLITE_UTF8 | SQLITE_FUNC_WINDOW) | 0)), FxSFunc: 0, FxFinalize: 0, FxValue: 0, FxInverse: 0, FzName: 0}} /* sqlite3.c:155522:18 */
-
-func windowFind(tls *libc.TLS, pParse uintptr, pList uintptr, zName uintptr) uintptr { /* sqlite3.c:155542:15: */
+ {FfuncFlags: U32(SQLITE_FUNC_BUILTIN | SQLITE_UTF8 | SQLITE_FUNC_WINDOW | 0), FxSFunc: 0, FxFinalize: 0, FxValue: 0, FxInverse: 0, FzName: 0},
+ {FfuncFlags: U32(SQLITE_FUNC_BUILTIN | SQLITE_UTF8 | SQLITE_FUNC_WINDOW | 0), FxSFunc: 0, FxFinalize: 0, FxValue: 0, FxInverse: 0, FzName: 0},
+ {FfuncFlags: U32(SQLITE_FUNC_BUILTIN | SQLITE_UTF8 | SQLITE_FUNC_WINDOW | 0), FxSFunc: 0, FxFinalize: 0, FxValue: 0, FxInverse: 0, FzName: 0},
+ {FfuncFlags: U32(SQLITE_FUNC_BUILTIN | SQLITE_UTF8 | SQLITE_FUNC_WINDOW | 0), FxSFunc: 0, FxFinalize: 0, FxValue: 0, FxInverse: 0, FzName: 0},
+ {FfuncFlags: U32(SQLITE_FUNC_BUILTIN | SQLITE_UTF8 | SQLITE_FUNC_WINDOW | 0), FxSFunc: 0, FxFinalize: 0, FxValue: 0, FxInverse: 0, FzName: 0},
+ {FnArg: int8(1), FfuncFlags: U32(SQLITE_FUNC_BUILTIN | SQLITE_UTF8 | SQLITE_FUNC_WINDOW | 0), FxSFunc: 0, FxFinalize: 0, FxValue: 0, FxInverse: 0, FzName: 0},
+ {FnArg: int8(1), FfuncFlags: U32(SQLITE_FUNC_BUILTIN | SQLITE_UTF8 | SQLITE_FUNC_WINDOW | 0), FxSFunc: 0, FxFinalize: 0, FxValue: 0, FxInverse: 0, FzName: 0},
+ {FnArg: int8(2), FfuncFlags: U32(SQLITE_FUNC_BUILTIN | SQLITE_UTF8 | SQLITE_FUNC_WINDOW | 0), FxSFunc: 0, FxFinalize: 0, FxValue: 0, FxInverse: 0, FzName: 0},
+ {FnArg: int8(1), FfuncFlags: U32(SQLITE_FUNC_BUILTIN | SQLITE_UTF8 | SQLITE_FUNC_WINDOW | 0), FxSFunc: 0, FxFinalize: 0, FxValue: 0, FxInverse: 0, FzName: 0},
+ {FnArg: int8(1), FfuncFlags: U32(SQLITE_FUNC_BUILTIN | SQLITE_UTF8 | SQLITE_FUNC_WINDOW | 0), FxSFunc: 0, FxFinalize: 0, FxValue: 0, FxInverse: 0, FzName: 0},
+ {FnArg: int8(2), FfuncFlags: U32(SQLITE_FUNC_BUILTIN | SQLITE_UTF8 | SQLITE_FUNC_WINDOW | 0), FxSFunc: 0, FxFinalize: 0, FxValue: 0, FxInverse: 0, FzName: 0},
+ {FnArg: int8(3), FfuncFlags: U32(SQLITE_FUNC_BUILTIN | SQLITE_UTF8 | SQLITE_FUNC_WINDOW | 0), FxSFunc: 0, FxFinalize: 0, FxValue: 0, FxInverse: 0, FzName: 0},
+ {FnArg: int8(1), FfuncFlags: U32(SQLITE_FUNC_BUILTIN | SQLITE_UTF8 | SQLITE_FUNC_WINDOW | 0), FxSFunc: 0, FxFinalize: 0, FxValue: 0, FxInverse: 0, FzName: 0},
+ {FnArg: int8(2), FfuncFlags: U32(SQLITE_FUNC_BUILTIN | SQLITE_UTF8 | SQLITE_FUNC_WINDOW | 0), FxSFunc: 0, FxFinalize: 0, FxValue: 0, FxInverse: 0, FzName: 0},
+ {FnArg: int8(3), FfuncFlags: U32(SQLITE_FUNC_BUILTIN | SQLITE_UTF8 | SQLITE_FUNC_WINDOW | 0), FxSFunc: 0, FxFinalize: 0, FxValue: 0, FxInverse: 0, FzName: 0}} /* sqlite3.c:156934:18 */
+
+func windowFind(tls *libc.TLS, pParse uintptr, pList uintptr, zName uintptr) uintptr { /* sqlite3.c:156954:15: */
bp := tls.Alloc(8)
defer tls.Free(8)
@@ -136932,7 +138987,7 @@ func windowFind(tls *libc.TLS, pParse uintptr, pList uintptr, zName uintptr) uin
}
}
if p == uintptr(0) {
- Xsqlite3ErrorMsg(tls, pParse, ts+20573 /* "no such window: ..." */, libc.VaList(bp, zName))
+ Xsqlite3ErrorMsg(tls, pParse, ts+21870 /* "no such window: ..." */, libc.VaList(bp, zName))
}
return p
}
@@ -136952,11 +139007,11 @@ func windowFind(tls *libc.TLS, pParse uintptr, pList uintptr, zName uintptr) uin
// * If the function is a built-in window function that requires the
// window to be coerced (see "BUILT-IN WINDOW FUNCTIONS" at the top
// of this file), pWin is updated here.
-func Xsqlite3WindowUpdate(tls *libc.TLS, pParse uintptr, pList uintptr, pWin uintptr, pFunc uintptr) { /* sqlite3.c:155570:21: */
+func Xsqlite3WindowUpdate(tls *libc.TLS, pParse uintptr, pList uintptr, pWin uintptr, pFunc uintptr) { /* sqlite3.c:156982:21: */
bp := tls.Alloc(128)
defer tls.Free(128)
- if ((*Window)(unsafe.Pointer(pWin)).FzName != 0) && (int32((*Window)(unsafe.Pointer(pWin)).FeFrmType) == 0) {
+ if (*Window)(unsafe.Pointer(pWin)).FzName != 0 && int32((*Window)(unsafe.Pointer(pWin)).FeFrmType) == 0 {
var p uintptr = windowFind(tls, pParse, pList, (*Window)(unsafe.Pointer(pWin)).FzName)
if p == uintptr(0) {
return
@@ -136972,16 +139027,16 @@ func Xsqlite3WindowUpdate(tls *libc.TLS, pParse uintptr, pList uintptr, pWin uin
} else {
Xsqlite3WindowChain(tls, pParse, pWin, pList)
}
- if ((int32((*Window)(unsafe.Pointer(pWin)).FeFrmType) == TK_RANGE) &&
- (((*Window)(unsafe.Pointer(pWin)).FpStart != 0) || ((*Window)(unsafe.Pointer(pWin)).FpEnd != 0))) &&
- (((*Window)(unsafe.Pointer(pWin)).FpOrderBy == uintptr(0)) || ((*ExprList)(unsafe.Pointer((*Window)(unsafe.Pointer(pWin)).FpOrderBy)).FnExpr != 1)) {
+ if int32((*Window)(unsafe.Pointer(pWin)).FeFrmType) == TK_RANGE &&
+ ((*Window)(unsafe.Pointer(pWin)).FpStart != 0 || (*Window)(unsafe.Pointer(pWin)).FpEnd != 0) &&
+ ((*Window)(unsafe.Pointer(pWin)).FpOrderBy == uintptr(0) || (*ExprList)(unsafe.Pointer((*Window)(unsafe.Pointer(pWin)).FpOrderBy)).FnExpr != 1) {
Xsqlite3ErrorMsg(tls, pParse,
- ts+20592 /* "RANGE with offse..." */, 0)
- } else if ((*FuncDef)(unsafe.Pointer(pFunc)).FfuncFlags & U32(SQLITE_FUNC_WINDOW)) != 0 {
+ ts+21889 /* "RANGE with offse..." */, 0)
+ } else if (*FuncDef)(unsafe.Pointer(pFunc)).FfuncFlags&U32(SQLITE_FUNC_WINDOW) != 0 {
var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb
if (*Window)(unsafe.Pointer(pWin)).FpFilter != 0 {
Xsqlite3ErrorMsg(tls, pParse,
- ts+20663 /* "FILTER clause ma..." */, 0)
+ ts+21960 /* "FILTER clause ma..." */, 0)
} else {
*(*[8]WindowUpdate)(unsafe.Pointer(bp /* aUp */)) = [8]WindowUpdate{
{FzFunc: uintptr(unsafe.Pointer(&row_numberName)), FeFrmType: TK_ROWS, FeStart: TK_UNBOUNDED, FeEnd: TK_CURRENT},
@@ -136994,17 +139049,17 @@ func Xsqlite3WindowUpdate(tls *libc.TLS, pParse uintptr, pList uintptr, pWin uin
{FzFunc: uintptr(unsafe.Pointer(&lagName)), FeFrmType: TK_ROWS, FeStart: TK_UNBOUNDED, FeEnd: TK_CURRENT},
}
var i int32
- for i = 0; i < (int32(uint32(unsafe.Sizeof([8]WindowUpdate{})) / uint32(unsafe.Sizeof(WindowUpdate{})))); i++ {
- if (*FuncDef)(unsafe.Pointer(pFunc)).FzName == (*WindowUpdate)(unsafe.Pointer(bp /* &aUp */ +uintptr(i)*16)).FzFunc {
+ for i = 0; i < int32(uint32(unsafe.Sizeof([8]WindowUpdate{}))/uint32(unsafe.Sizeof(WindowUpdate{}))); i++ {
+ if (*FuncDef)(unsafe.Pointer(pFunc)).FzName == (*WindowUpdate)(unsafe.Pointer(bp+uintptr(i)*16)).FzFunc {
Xsqlite3ExprDelete(tls, db, (*Window)(unsafe.Pointer(pWin)).FpStart)
Xsqlite3ExprDelete(tls, db, (*Window)(unsafe.Pointer(pWin)).FpEnd)
- (*Window)(unsafe.Pointer(pWin)).FpEnd = libc.AssignPtrUintptr(pWin+24 /* &.pStart */, uintptr(0))
+ (*Window)(unsafe.Pointer(pWin)).FpEnd = libc.AssignPtrUintptr(pWin+24, uintptr(0))
(*Window)(unsafe.Pointer(pWin)).FeFrmType = U8((*WindowUpdate)(unsafe.Pointer(bp /* &aUp */ + uintptr(i)*16)).FeFrmType)
(*Window)(unsafe.Pointer(pWin)).FeStart = U8((*WindowUpdate)(unsafe.Pointer(bp /* &aUp */ + uintptr(i)*16)).FeStart)
(*Window)(unsafe.Pointer(pWin)).FeEnd = U8((*WindowUpdate)(unsafe.Pointer(bp /* &aUp */ + uintptr(i)*16)).FeEnd)
(*Window)(unsafe.Pointer(pWin)).FeExclude = U8(0)
if int32((*Window)(unsafe.Pointer(pWin)).FeStart) == TK_FOLLOWING {
- (*Window)(unsafe.Pointer(pWin)).FpStart = Xsqlite3Expr(tls, db, TK_INTEGER, ts+6913 /* "1" */)
+ (*Window)(unsafe.Pointer(pWin)).FpStart = Xsqlite3Expr(tls, db, TK_INTEGER, ts+7806 /* "1" */)
}
break
}
@@ -137019,17 +139074,17 @@ type WindowUpdate = struct {
FeFrmType int32
FeStart int32
FeEnd int32
-} /* sqlite3.c:155605:7 */
+} /* sqlite3.c:157017:7 */
// Context object passed through sqlite3WalkExprList() to
// selectWindowRewriteExprCb() by selectWindowRewriteEList().
-type WindowRewrite = WindowRewrite1 /* sqlite3.c:155645:30 */
+type WindowRewrite = WindowRewrite1 /* sqlite3.c:157057:30 */
// Callback function used by selectWindowRewriteEList(). If necessary,
// this function appends to the output expression-list and updates
// expression (*ppExpr) in place.
-func selectWindowRewriteExprCb(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 { /* sqlite3.c:155659:12: */
- var p uintptr = *(*uintptr)(unsafe.Pointer(pWalker + 24 /* &.u */))
+func selectWindowRewriteExprCb(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 { /* sqlite3.c:157071:12: */
+ var p uintptr = *(*uintptr)(unsafe.Pointer(pWalker + 24))
var pParse uintptr = (*Walker)(unsafe.Pointer(pWalker)).FpParse
// If this function is being called from within a scalar sub-select
@@ -137044,7 +139099,7 @@ func selectWindowRewriteExprCb(tls *libc.TLS, pWalker uintptr, pExpr uintptr) in
var nSrc int32 = (*SrcList)(unsafe.Pointer((*WindowRewrite1)(unsafe.Pointer(p)).FpSrc)).FnSrc
var i int32
for i = 0; i < nSrc; i++ {
- if (*Expr)(unsafe.Pointer(pExpr)).FiTable == (*SrcItem)(unsafe.Pointer(((*WindowRewrite1)(unsafe.Pointer(p)).FpSrc+8 /* &.a */)+uintptr(i)*72)).FiCursor {
+ if (*Expr)(unsafe.Pointer(pExpr)).FiTable == (*SrcItem)(unsafe.Pointer((*WindowRewrite1)(unsafe.Pointer(p)).FpSrc+8+uintptr(i)*72)).FiCursor {
break
}
}
@@ -137057,12 +139112,12 @@ func selectWindowRewriteExprCb(tls *libc.TLS, pWalker uintptr, pExpr uintptr) in
switch int32((*Expr)(unsafe.Pointer(pExpr)).Fop) {
case TK_FUNCTION:
- if !(((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_WinFunc))) != U32(0)) {
+ if !((*Expr)(unsafe.Pointer(pExpr)).Fflags&U32(EP_WinFunc) != U32(0)) {
break
} else {
var pWin uintptr
for pWin = (*WindowRewrite1)(unsafe.Pointer(p)).FpWin; pWin != 0; pWin = (*Window)(unsafe.Pointer(pWin)).FpNextWin {
- if *(*uintptr)(unsafe.Pointer(pExpr + 44 /* &.y */)) == pWin {
+ if *(*uintptr)(unsafe.Pointer(pExpr + 44)) == pWin {
return WRC_Prune
}
@@ -137081,7 +139136,7 @@ func selectWindowRewriteExprCb(tls *libc.TLS, pWalker uintptr, pExpr uintptr) in
if (*WindowRewrite1)(unsafe.Pointer(p)).FpSub != 0 {
var i int32
for i = 0; i < (*ExprList)(unsafe.Pointer((*WindowRewrite1)(unsafe.Pointer(p)).FpSub)).FnExpr; i++ {
- if 0 == Xsqlite3ExprCompare(tls, uintptr(0), (*ExprList_item)(unsafe.Pointer(((*WindowRewrite1)(unsafe.Pointer(p)).FpSub+8 /* &.a */)+uintptr(i)*20)).FpExpr, pExpr, -1) {
+ if 0 == Xsqlite3ExprCompare(tls, uintptr(0), (*ExprList_item)(unsafe.Pointer((*WindowRewrite1)(unsafe.Pointer(p)).FpSub+8+uintptr(i)*20)).FpExpr, pExpr, -1) {
iCol = i
break
}
@@ -137089,28 +139144,28 @@ func selectWindowRewriteExprCb(tls *libc.TLS, pWalker uintptr, pExpr uintptr) in
}
if iCol < 0 {
var pDup uintptr = Xsqlite3ExprDup(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, pExpr, 0)
- if (pDup != 0) && (int32((*Expr)(unsafe.Pointer(pDup)).Fop) == TK_AGG_FUNCTION) {
+ if pDup != 0 && int32((*Expr)(unsafe.Pointer(pDup)).Fop) == TK_AGG_FUNCTION {
(*Expr)(unsafe.Pointer(pDup)).Fop = U8(TK_FUNCTION)
}
(*WindowRewrite1)(unsafe.Pointer(p)).FpSub = Xsqlite3ExprListAppend(tls, pParse, (*WindowRewrite1)(unsafe.Pointer(p)).FpSub, pDup)
}
if (*WindowRewrite1)(unsafe.Pointer(p)).FpSub != 0 {
- var f int32 = (int32((*Expr)(unsafe.Pointer(pExpr)).Fflags & U32(EP_Collate)))
+ var f int32 = int32((*Expr)(unsafe.Pointer(pExpr)).Fflags & U32(EP_Collate))
- *(*U32)(unsafe.Pointer(pExpr + 4 /* &.flags */)) |= (U32(EP_Static))
+ *(*U32)(unsafe.Pointer(pExpr + 4)) |= U32(EP_Static)
Xsqlite3ExprDelete(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, pExpr)
- *(*U32)(unsafe.Pointer(pExpr + 4 /* &.flags */)) &= (libc.Uint32FromInt32(libc.CplInt32(EP_Static)))
+ *(*U32)(unsafe.Pointer(pExpr + 4)) &= libc.Uint32FromInt32(libc.CplInt32(EP_Static))
libc.Xmemset(tls, pExpr, 0, uint32(unsafe.Sizeof(Expr{})))
(*Expr)(unsafe.Pointer(pExpr)).Fop = U8(TK_COLUMN)
(*Expr)(unsafe.Pointer(pExpr)).FiColumn = func() int16 {
if iCol < 0 {
- return (int16((*ExprList)(unsafe.Pointer((*WindowRewrite1)(unsafe.Pointer(p)).FpSub)).FnExpr - 1))
+ return int16((*ExprList)(unsafe.Pointer((*WindowRewrite1)(unsafe.Pointer(p)).FpSub)).FnExpr - 1)
}
return int16(iCol)
}()
(*Expr)(unsafe.Pointer(pExpr)).FiTable = (*Window)(unsafe.Pointer((*WindowRewrite1)(unsafe.Pointer(p)).FpWin)).FiEphCsr
- *(*uintptr)(unsafe.Pointer(pExpr + 44 /* &.y */)) = (*WindowRewrite1)(unsafe.Pointer(p)).FpTab
+ *(*uintptr)(unsafe.Pointer(pExpr + 44)) = (*WindowRewrite1)(unsafe.Pointer(p)).FpTab
(*Expr)(unsafe.Pointer(pExpr)).Fflags = U32(f)
}
if (*Sqlite3)(unsafe.Pointer((*Parse)(unsafe.Pointer(pParse)).Fdb)).FmallocFailed != 0 {
@@ -137127,8 +139182,8 @@ func selectWindowRewriteExprCb(tls *libc.TLS, pWalker uintptr, pExpr uintptr) in
return WRC_Continue
}
-func selectWindowRewriteSelectCb(tls *libc.TLS, pWalker uintptr, pSelect uintptr) int32 { /* sqlite3.c:155741:12: */
- var p uintptr = *(*uintptr)(unsafe.Pointer(pWalker + 24 /* &.u */))
+func selectWindowRewriteSelectCb(tls *libc.TLS, pWalker uintptr, pSelect uintptr) int32 { /* sqlite3.c:157153:12: */
+ var p uintptr = *(*uintptr)(unsafe.Pointer(pWalker + 24))
var pSave uintptr = (*WindowRewrite1)(unsafe.Pointer(p)).FpSubSelect
if pSave == pSelect {
return WRC_Continue
@@ -137151,7 +139206,7 @@ func selectWindowRewriteSelectCb(tls *libc.TLS, pWalker uintptr, pSelect uintptr
// with a TK_COLUMN that reads the (N-1)th element of table
// pWin->iEphCsr, where N is the number of elements in (*ppSub) after
// appending the new one.
-func selectWindowRewriteEList(tls *libc.TLS, pParse uintptr, pWin uintptr, pSrc uintptr, pEList uintptr, pTab uintptr, ppSub uintptr) { /* sqlite3.c:155768:13: */
+func selectWindowRewriteEList(tls *libc.TLS, pParse uintptr, pWin uintptr, pSrc uintptr, pEList uintptr, pTab uintptr, ppSub uintptr) { /* sqlite3.c:157180:13: */
bp := tls.Alloc(48)
defer tls.Free(48)
@@ -137174,7 +139229,7 @@ func selectWindowRewriteEList(tls *libc.TLS, pParse uintptr, pWin uintptr, pSrc
(*Walker)(unsafe.Pointer(bp /* &sWalker */)).FxSelectCallback = *(*uintptr)(unsafe.Pointer(&struct {
f func(*libc.TLS, uintptr, uintptr) int32
}{selectWindowRewriteSelectCb}))
- *(*uintptr)(unsafe.Pointer(bp /* &sWalker */ + 24 /* &.u */)) = bp + 28 /* &sRewrite */
+ *(*uintptr)(unsafe.Pointer(bp + 24)) = bp + 28 /* &sRewrite */
Xsqlite3WalkExprList(tls, bp /* &sWalker */, pEList)
@@ -137183,7 +139238,7 @@ func selectWindowRewriteEList(tls *libc.TLS, pParse uintptr, pWin uintptr, pSrc
// Append a copy of each expression in expression-list pAppend to
// expression list pList. Return a pointer to the result list.
-func exprListAppendList(tls *libc.TLS, pParse uintptr, pList uintptr, pAppend uintptr, bIntToNull int32) uintptr { /* sqlite3.c:155802:17: */
+func exprListAppendList(tls *libc.TLS, pParse uintptr, pList uintptr, pAppend uintptr, bIntToNull int32) uintptr { /* sqlite3.c:157214:17: */
bp := tls.Alloc(4)
defer tls.Free(4)
@@ -137197,7 +139252,7 @@ func exprListAppendList(tls *libc.TLS, pParse uintptr, pList uintptr, pAppend ui
}
for i = 0; i < (*ExprList)(unsafe.Pointer(pAppend)).FnExpr; i++ {
var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb
- var pDup uintptr = Xsqlite3ExprDup(tls, db, (*ExprList_item)(unsafe.Pointer((pAppend+8 /* &.a */)+uintptr(i)*20)).FpExpr, 0)
+ var pDup uintptr = Xsqlite3ExprDup(tls, db, (*ExprList_item)(unsafe.Pointer(pAppend+8+uintptr(i)*20)).FpExpr, 0)
if (*Sqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 {
Xsqlite3ExprDelete(tls, db, pDup)
@@ -137207,18 +139262,16 @@ func exprListAppendList(tls *libc.TLS, pParse uintptr, pList uintptr, pAppend ui
// var iDummy int32 at bp, 4
var pSub uintptr
- for pSub = pDup; ((*Expr)(unsafe.Pointer((pSub))).Fflags & (U32(EP_Skip))) != U32(0); pSub = (*Expr)(unsafe.Pointer(pSub)).FpLeft {
-
- }
- if Xsqlite3ExprIsInteger(tls, pSub, bp /* &iDummy */) != 0 {
+ pSub = Xsqlite3ExprSkipCollateAndLikely(tls, pDup)
+ if Xsqlite3ExprIsInteger(tls, pSub, bp) != 0 {
(*Expr)(unsafe.Pointer(pSub)).Fop = U8(TK_NULL)
- *(*U32)(unsafe.Pointer(pSub + 4 /* &.flags */)) &= (libc.Uint32FromInt32(libc.CplInt32(((EP_IntValue | EP_IsTrue) | EP_IsFalse))))
- *(*uintptr)(unsafe.Pointer(pSub + 8 /* &.u */)) = uintptr(0)
+ *(*U32)(unsafe.Pointer(pSub + 4)) &= libc.Uint32FromInt32(libc.CplInt32(EP_IntValue | EP_IsTrue | EP_IsFalse))
+ *(*uintptr)(unsafe.Pointer(pSub + 8)) = uintptr(0)
}
}
pList = Xsqlite3ExprListAppend(tls, pParse, pList, pDup)
if pList != 0 {
- (*ExprList_item)(unsafe.Pointer((pList + 8 /* &.a */) + uintptr((nInit+i))*20)).FsortFlags = (*ExprList_item)(unsafe.Pointer((pAppend + 8 /* &.a */) + uintptr(i)*20)).FsortFlags
+ (*ExprList_item)(unsafe.Pointer(pList + 8 + uintptr(nInit+i)*20)).FsortFlags = (*ExprList_item)(unsafe.Pointer(pAppend + 8 + uintptr(i)*20)).FsortFlags
}
}
}
@@ -137231,21 +139284,22 @@ func exprListAppendList(tls *libc.TLS, pParse uintptr, pList uintptr, pAppend ui
// due to the extra subquery layer that was added.
//
// See also the incrAggDepth() routine in resolve.c
-func sqlite3WindowExtraAggFuncDepth(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 { /* sqlite3.c:155846:12: */
- if (int32((*Expr)(unsafe.Pointer(pExpr)).Fop) == TK_AGG_FUNCTION) &&
- (int32((*Expr)(unsafe.Pointer(pExpr)).Fop2) >= (*Walker)(unsafe.Pointer(pWalker)).FwalkerDepth) {
+func sqlite3WindowExtraAggFuncDepth(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 { /* sqlite3.c:157256:12: */
+ if int32((*Expr)(unsafe.Pointer(pExpr)).Fop) == TK_AGG_FUNCTION &&
+ int32((*Expr)(unsafe.Pointer(pExpr)).Fop2) >= (*Walker)(unsafe.Pointer(pWalker)).FwalkerDepth {
(*Expr)(unsafe.Pointer(pExpr)).Fop2++
}
return WRC_Continue
}
-func disallowAggregatesInOrderByCb(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 { /* sqlite3.c:155855:12: */
+func disallowAggregatesInOrderByCb(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 { /* sqlite3.c:157265:12: */
bp := tls.Alloc(8)
defer tls.Free(8)
- if (int32((*Expr)(unsafe.Pointer(pExpr)).Fop) == TK_AGG_FUNCTION) && ((*Expr)(unsafe.Pointer(pExpr)).FpAggInfo == uintptr(0)) {
+ if int32((*Expr)(unsafe.Pointer(pExpr)).Fop) == TK_AGG_FUNCTION && (*Expr)(unsafe.Pointer(pExpr)).FpAggInfo == uintptr(0) {
+
Xsqlite3ErrorMsg(tls, (*Walker)(unsafe.Pointer(pWalker)).FpParse,
- ts+6974 /* "misuse of aggreg..." */, libc.VaList(bp, *(*uintptr)(unsafe.Pointer(pExpr + 8 /* &.u */))))
+ ts+7890 /* "misuse of aggreg..." */, libc.VaList(bp, *(*uintptr)(unsafe.Pointer(pExpr + 8))))
}
return WRC_Continue
}
@@ -137255,12 +139309,12 @@ func disallowAggregatesInOrderByCb(tls *libc.TLS, pWalker uintptr, pExpr uintptr
// rewrites the SELECT statement so that window function xStep functions
// are invoked in the correct order as described under "SELECT REWRITING"
// at the top of this file.
-func Xsqlite3WindowRewrite(tls *libc.TLS, pParse uintptr, p uintptr) int32 { /* sqlite3.c:155870:20: */
+func Xsqlite3WindowRewrite(tls *libc.TLS, pParse uintptr, p uintptr) int32 { /* sqlite3.c:157281:20: */
bp := tls.Alloc(32)
defer tls.Free(32)
var rc int32 = SQLITE_OK
- if (((*Select)(unsafe.Pointer(p)).FpWin != 0) && ((*Select)(unsafe.Pointer(p)).FpPrior == uintptr(0))) && (((*Select)(unsafe.Pointer(p)).FselFlags & U32(SF_WinRewrite)) == U32(0)) {
+ if (*Select)(unsafe.Pointer(p)).FpWin != 0 && (*Select)(unsafe.Pointer(p)).FpPrior == uintptr(0) && (*Select)(unsafe.Pointer(p)).FselFlags&U32(SF_WinRewrite) == U32(0) {
var v uintptr = Xsqlite3GetVdbe(tls, pParse)
var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb
var pSub uintptr = uintptr(0) // The subquery
@@ -137284,7 +139338,7 @@ func Xsqlite3WindowRewrite(tls *libc.TLS, pParse uintptr, p uintptr) int32 { /*
}
Xsqlite3AggInfoPersistWalkerInit(tls, bp /* &w */, pParse)
Xsqlite3WalkSelect(tls, bp /* &w */, p)
- if ((*Select)(unsafe.Pointer(p)).FselFlags & U32(SF_Aggregate)) == U32(0) {
+ if (*Select)(unsafe.Pointer(p)).FselFlags&U32(SF_Aggregate) == U32(0) {
(*Walker)(unsafe.Pointer(bp /* &w */)).FxExprCallback = *(*uintptr)(unsafe.Pointer(&struct {
f func(*libc.TLS, uintptr, uintptr) int32
}{disallowAggregatesInOrderByCb}))
@@ -137296,15 +139350,15 @@ func Xsqlite3WindowRewrite(tls *libc.TLS, pParse uintptr, p uintptr) int32 { /*
(*Select)(unsafe.Pointer(p)).FpWhere = uintptr(0)
(*Select)(unsafe.Pointer(p)).FpGroupBy = uintptr(0)
(*Select)(unsafe.Pointer(p)).FpHaving = uintptr(0)
- *(*U32)(unsafe.Pointer(p + 4 /* &.selFlags */)) &= (libc.Uint32FromInt32(libc.CplInt32(SF_Aggregate)))
- *(*U32)(unsafe.Pointer(p + 4 /* &.selFlags */)) |= (U32(SF_WinRewrite))
+ *(*U32)(unsafe.Pointer(p + 4)) &= libc.Uint32FromInt32(libc.CplInt32(SF_Aggregate))
+ *(*U32)(unsafe.Pointer(p + 4)) |= U32(SF_WinRewrite)
// Create the ORDER BY clause for the sub-select. This is the concatenation
// of the window PARTITION and ORDER BY clauses. Then, if this makes it
// redundant, remove the ORDER BY from the parent SELECT.
pSort = exprListAppendList(tls, pParse, uintptr(0), (*Window)(unsafe.Pointer(pMWin)).FpPartition, 1)
pSort = exprListAppendList(tls, pParse, pSort, (*Window)(unsafe.Pointer(pMWin)).FpOrderBy, 1)
- if ((pSort != 0) && ((*Select)(unsafe.Pointer(p)).FpOrderBy != 0)) && ((*ExprList)(unsafe.Pointer((*Select)(unsafe.Pointer(p)).FpOrderBy)).FnExpr <= (*ExprList)(unsafe.Pointer(pSort)).FnExpr) {
+ if pSort != 0 && (*Select)(unsafe.Pointer(p)).FpOrderBy != 0 && (*ExprList)(unsafe.Pointer((*Select)(unsafe.Pointer(p)).FpOrderBy)).FnExpr <= (*ExprList)(unsafe.Pointer(pSort)).FnExpr {
var nSave int32 = (*ExprList)(unsafe.Pointer(pSort)).FnExpr
(*ExprList)(unsafe.Pointer(pSort)).FnExpr = (*ExprList)(unsafe.Pointer((*Select)(unsafe.Pointer(p)).FpOrderBy)).FnExpr
if Xsqlite3ExprListCompare(tls, pSort, (*Select)(unsafe.Pointer(p)).FpOrderBy, -1) == 0 {
@@ -137318,13 +139372,13 @@ func Xsqlite3WindowRewrite(tls *libc.TLS, pParse uintptr, p uintptr) int32 { /*
// The OpenEphemeral instruction is coded later, after it is known how
// many columns the table will have.
(*Window)(unsafe.Pointer(pMWin)).FiEphCsr = libc.PostIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnTab, 1)
- *(*int32)(unsafe.Pointer(pParse + 40 /* &.nTab */)) += (3)
+ *(*int32)(unsafe.Pointer(pParse + 40)) += 3
selectWindowRewriteEList(tls, pParse, pMWin, pSrc, (*Select)(unsafe.Pointer(p)).FpEList, pTab, bp+28 /* &pSublist */)
selectWindowRewriteEList(tls, pParse, pMWin, pSrc, (*Select)(unsafe.Pointer(p)).FpOrderBy, pTab, bp+28 /* &pSublist */)
(*Window)(unsafe.Pointer(pMWin)).FnBufferCol = func() int32 {
- if *(*uintptr)(unsafe.Pointer(bp + 28 /* pSublist */)) != 0 {
- return (*ExprList)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 28 /* pSublist */)))).FnExpr
+ if *(*uintptr)(unsafe.Pointer(bp + 28)) != 0 {
+ return (*ExprList)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 28)))).FnExpr
}
return 0
}()
@@ -137340,20 +139394,22 @@ func Xsqlite3WindowRewrite(tls *libc.TLS, pParse uintptr, p uintptr) int32 { /*
// window function - one for the accumulator, another for interim
// results.
for pWin = pMWin; pWin != 0; pWin = (*Window)(unsafe.Pointer(pWin)).FpNextWin {
- var pArgs uintptr = *(*uintptr)(unsafe.Pointer((*Window)(unsafe.Pointer(pWin)).FpOwner + 20 /* &.x */))
- if ((*FuncDef)(unsafe.Pointer((*Window)(unsafe.Pointer(pWin)).FpFunc)).FfuncFlags & U32(SQLITE_FUNC_SUBTYPE)) != 0 {
+ var pArgs uintptr
+
+ pArgs = *(*uintptr)(unsafe.Pointer((*Window)(unsafe.Pointer(pWin)).FpOwner + 20))
+ if (*FuncDef)(unsafe.Pointer((*Window)(unsafe.Pointer(pWin)).FpFunc)).FfuncFlags&U32(SQLITE_FUNC_SUBTYPE) != 0 {
selectWindowRewriteEList(tls, pParse, pMWin, pSrc, pArgs, pTab, bp+28 /* &pSublist */)
(*Window)(unsafe.Pointer(pWin)).FiArgCol = func() int32 {
- if *(*uintptr)(unsafe.Pointer(bp + 28 /* pSublist */)) != 0 {
- return (*ExprList)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 28 /* pSublist */)))).FnExpr
+ if *(*uintptr)(unsafe.Pointer(bp + 28)) != 0 {
+ return (*ExprList)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 28)))).FnExpr
}
return 0
}()
(*Window)(unsafe.Pointer(pWin)).FbExprArgs = U8(1)
} else {
(*Window)(unsafe.Pointer(pWin)).FiArgCol = func() int32 {
- if *(*uintptr)(unsafe.Pointer(bp + 28 /* pSublist */)) != 0 {
- return (*ExprList)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 28 /* pSublist */)))).FnExpr
+ if *(*uintptr)(unsafe.Pointer(bp + 28)) != 0 {
+ return (*ExprList)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 28)))).FnExpr
}
return 0
}()
@@ -137373,22 +139429,25 @@ func Xsqlite3WindowRewrite(tls *libc.TLS, pParse uintptr, p uintptr) int32 { /*
// selected (e.g. "SELECT row_number() OVER () FROM t1"), it is possible
// that pSublist is still NULL here. Add a constant expression here to
// keep everything legal in this case.
- if *(*uintptr)(unsafe.Pointer(bp + 28 /* pSublist */)) == uintptr(0) {
+ if *(*uintptr)(unsafe.Pointer(bp + 28)) == uintptr(0) {
*(*uintptr)(unsafe.Pointer(bp + 28 /* pSublist */)) = Xsqlite3ExprListAppend(tls, pParse, uintptr(0),
- Xsqlite3Expr(tls, db, TK_INTEGER, ts+6506 /* "0" */))
+ Xsqlite3Expr(tls, db, TK_INTEGER, ts+7399 /* "0" */))
}
pSub = Xsqlite3SelectNew(tls,
pParse, *(*uintptr)(unsafe.Pointer(bp + 28 /* pSublist */)), pSrc, pWhere, pGroupBy, pHaving, pSort, uint32(0), uintptr(0))
(*Select)(unsafe.Pointer(p)).FpSrc = Xsqlite3SrcListAppend(tls, pParse, uintptr(0), uintptr(0), uintptr(0))
+ // Due to db->mallocFailed test inside
+ // of sqlite3DbMallocRawNN() called from
+ // sqlite3SrcListAppend()
if (*Select)(unsafe.Pointer(p)).FpSrc != 0 {
var pTab2 uintptr
- (*SrcItem)(unsafe.Pointer(((*Select)(unsafe.Pointer(p)).FpSrc + 8 /* &.a */))).FpSelect = pSub
+ (*SrcItem)(unsafe.Pointer((*Select)(unsafe.Pointer(p)).FpSrc + 8)).FpSelect = pSub
Xsqlite3SrcListAssignCursors(tls, pParse, (*Select)(unsafe.Pointer(p)).FpSrc)
- *(*U32)(unsafe.Pointer(pSub + 4 /* &.selFlags */)) |= (U32(SF_Expanded))
+ *(*U32)(unsafe.Pointer(pSub + 4)) |= U32(SF_Expanded | SF_OrderByReqd)
pTab2 = Xsqlite3ResultSetOfSelect(tls, pParse, pSub, uint8(SQLITE_AFF_NONE))
- *(*U32)(unsafe.Pointer(pSub + 4 /* &.selFlags */)) |= (selFlags & U32(SF_Aggregate))
+ *(*U32)(unsafe.Pointer(pSub + 4)) |= selFlags & U32(SF_Aggregate)
if pTab2 == uintptr(0) {
// Might actually be some other kind of error, but in that case
// pParse->nErr will be set, so if SQLITE_NOMEM is set, we will get
@@ -137396,8 +139455,8 @@ func Xsqlite3WindowRewrite(tls *libc.TLS, pParse uintptr, p uintptr) int32 { /*
rc = SQLITE_NOMEM
} else {
libc.Xmemcpy(tls, pTab, pTab2, uint32(unsafe.Sizeof(Table{})))
- *(*U32)(unsafe.Pointer(pTab + 36 /* &.tabFlags */)) |= (U32(TF_Ephemeral))
- (*SrcItem)(unsafe.Pointer(((*Select)(unsafe.Pointer(p)).FpSrc + 8 /* &.a */))).FpTab = pTab
+ *(*U32)(unsafe.Pointer(pTab + 28)) |= U32(TF_Ephemeral)
+ (*SrcItem)(unsafe.Pointer((*Select)(unsafe.Pointer(p)).FpSrc + 8)).FpTab = pTab
pTab = pTab2
libc.Xmemset(tls, bp /* &w */, 0, uint32(unsafe.Sizeof(Walker{})))
(*Walker)(unsafe.Pointer(bp /* &w */)).FxExprCallback = *(*uintptr)(unsafe.Pointer(&struct {
@@ -137417,7 +139476,13 @@ func Xsqlite3WindowRewrite(tls *libc.TLS, pParse uintptr, p uintptr) int32 { /*
if (*Sqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 {
rc = SQLITE_NOMEM
}
- Xsqlite3DbFree(tls, db, pTab)
+
+ // Defer deleting the temporary table pTab because if an error occurred,
+ // there could still be references to that table embedded in the
+ // result-set or ORDER BY clause of the SELECT statement p.
+ Xsqlite3ParserAddCleanup(tls, pParse, *(*uintptr)(unsafe.Pointer(&struct {
+ f func(*libc.TLS, uintptr, uintptr)
+ }{Xsqlite3DbFree})), pTab)
}
if rc != 0 {
@@ -137431,7 +139496,7 @@ func Xsqlite3WindowRewrite(tls *libc.TLS, pParse uintptr, p uintptr) int32 { /*
// Unlink the Window object from the Select to which it is attached,
// if it is attached.
-func Xsqlite3WindowUnlinkFromSelect(tls *libc.TLS, p uintptr) { /* sqlite3.c:156025:21: */
+func Xsqlite3WindowUnlinkFromSelect(tls *libc.TLS, p uintptr) { /* sqlite3.c:157445:21: */
if (*Window)(unsafe.Pointer(p)).FppThis != 0 {
*(*uintptr)(unsafe.Pointer((*Window)(unsafe.Pointer(p)).FppThis)) = (*Window)(unsafe.Pointer(p)).FpNextWin
if (*Window)(unsafe.Pointer(p)).FpNextWin != 0 {
@@ -137442,7 +139507,7 @@ func Xsqlite3WindowUnlinkFromSelect(tls *libc.TLS, p uintptr) { /* sqlite3.c:156
}
// Free the Window object passed as the second argument.
-func Xsqlite3WindowDelete(tls *libc.TLS, db uintptr, p uintptr) { /* sqlite3.c:156036:21: */
+func Xsqlite3WindowDelete(tls *libc.TLS, db uintptr, p uintptr) { /* sqlite3.c:157456:21: */
if p != 0 {
Xsqlite3WindowUnlinkFromSelect(tls, p)
Xsqlite3ExprDelete(tls, db, (*Window)(unsafe.Pointer(p)).FpFilter)
@@ -137457,7 +139522,7 @@ func Xsqlite3WindowDelete(tls *libc.TLS, db uintptr, p uintptr) { /* sqlite3.c:1
}
// Free the linked list of Window objects starting at the second argument.
-func Xsqlite3WindowListDelete(tls *libc.TLS, db uintptr, p uintptr) { /* sqlite3.c:156053:21: */
+func Xsqlite3WindowListDelete(tls *libc.TLS, db uintptr, p uintptr) { /* sqlite3.c:157473:21: */
for p != 0 {
var pNext uintptr = (*Window)(unsafe.Pointer(p)).FpNextWin
Xsqlite3WindowDelete(tls, db, p)
@@ -137470,7 +139535,7 @@ func Xsqlite3WindowListDelete(tls *libc.TLS, db uintptr, p uintptr) { /* sqlite3
// constant, change it to NULL. The fact that it is then a non-negative
// integer will be caught later. But it is important not to leave
// variable values in the expression tree.
-func sqlite3WindowOffsetExpr(tls *libc.TLS, pParse uintptr, pExpr uintptr) uintptr { /* sqlite3.c:156068:13: */
+func sqlite3WindowOffsetExpr(tls *libc.TLS, pParse uintptr, pExpr uintptr) uintptr { /* sqlite3.c:157488:13: */
if 0 == Xsqlite3ExprIsConstant(tls, pExpr) {
if int32((*Parse)(unsafe.Pointer(pParse)).FeParseMode) >= PARSE_MODE_RENAME {
Xsqlite3RenameExprUnmap(tls, pParse, pExpr)
@@ -137482,7 +139547,7 @@ func sqlite3WindowOffsetExpr(tls *libc.TLS, pParse uintptr, pExpr uintptr) uintp
}
// Allocate and return a new Window object describing a Window Definition.
-func Xsqlite3WindowAlloc(tls *libc.TLS, pParse uintptr, eType int32, eStart int32, pStart uintptr, eEnd int32, pEnd uintptr, eExclude U8) uintptr { /* sqlite3.c:156080:23: */
+func Xsqlite3WindowAlloc(tls *libc.TLS, pParse uintptr, eType int32, eStart int32, pStart uintptr, eEnd int32, pEnd uintptr, eExclude U8) uintptr { /* sqlite3.c:157500:23: */
var pWin uintptr
var bImplicitFrame int32
pWin = uintptr(0)
@@ -137511,11 +139576,11 @@ __1:
// The parser ensures that "UNBOUNDED PRECEDING" cannot be used as an ending
// boundary, and than "UNBOUNDED FOLLOWING" cannot be used as a starting
// frame boundary.
- if !(((eStart == TK_CURRENT) && (eEnd == TK_PRECEDING)) ||
- ((eStart == TK_FOLLOWING) && ((eEnd == TK_PRECEDING) || (eEnd == TK_CURRENT)))) {
+ if !(eStart == TK_CURRENT && eEnd == TK_PRECEDING ||
+ eStart == TK_FOLLOWING && (eEnd == TK_PRECEDING || eEnd == TK_CURRENT)) {
goto __2
}
- Xsqlite3ErrorMsg(tls, pParse, ts+20726 /* "unsupported fram..." */, 0)
+ Xsqlite3ErrorMsg(tls, pParse, ts+22023 /* "unsupported fram..." */, 0)
goto windowAllocErr
__2:
;
@@ -137530,7 +139595,7 @@ __3:
(*Window)(unsafe.Pointer(pWin)).FeFrmType = U8(eType)
(*Window)(unsafe.Pointer(pWin)).FeStart = U8(eStart)
(*Window)(unsafe.Pointer(pWin)).FeEnd = U8(eEnd)
- if !((int32(eExclude) == 0) && (((*Sqlite3)(unsafe.Pointer(((*Parse)(unsafe.Pointer(pParse)).Fdb))).FdbOptFlags & (U32(SQLITE_WindowFunc))) != U32(0))) {
+ if !(int32(eExclude) == 0 && (*Sqlite3)(unsafe.Pointer((*Parse)(unsafe.Pointer(pParse)).Fdb)).FdbOptFlags&U32(SQLITE_WindowFunc) != U32(0)) {
goto __4
}
eExclude = U8(TK_NO)
@@ -137551,7 +139616,7 @@ windowAllocErr:
// Attach PARTITION and ORDER BY clauses pPartition and pOrderBy to window
// pWin. Also, if parameter pBase is not NULL, set pWin->zBase to the
// equivalent nul-terminated string.
-func Xsqlite3WindowAssemble(tls *libc.TLS, pParse uintptr, pWin uintptr, pPartition uintptr, pOrderBy uintptr, pBase uintptr) uintptr { /* sqlite3.c:156152:23: */
+func Xsqlite3WindowAssemble(tls *libc.TLS, pParse uintptr, pWin uintptr, pPartition uintptr, pOrderBy uintptr, pBase uintptr) uintptr { /* sqlite3.c:157572:23: */
if pWin != 0 {
(*Window)(unsafe.Pointer(pWin)).FpPartition = pPartition
(*Window)(unsafe.Pointer(pWin)).FpOrderBy = pOrderBy
@@ -137570,7 +139635,7 @@ func Xsqlite3WindowAssemble(tls *libc.TLS, pParse uintptr, pWin uintptr, pPartit
// stored in the linked list starting at pWin->pNextWin. This function
// either updates *pWin according to the base specification, or else
// leaves an error in pParse.
-func Xsqlite3WindowChain(tls *libc.TLS, pParse uintptr, pWin uintptr, pList uintptr) { /* sqlite3.c:156179:21: */
+func Xsqlite3WindowChain(tls *libc.TLS, pParse uintptr, pWin uintptr, pList uintptr) { /* sqlite3.c:157599:21: */
bp := tls.Alloc(16)
defer tls.Free(16)
@@ -137581,15 +139646,15 @@ func Xsqlite3WindowChain(tls *libc.TLS, pParse uintptr, pWin uintptr, pList uint
var zErr uintptr = uintptr(0)
// Check for errors
if (*Window)(unsafe.Pointer(pWin)).FpPartition != 0 {
- zErr = ts + 20758 /* "PARTITION clause" */
- } else if ((*Window)(unsafe.Pointer(pExist)).FpOrderBy != 0) && ((*Window)(unsafe.Pointer(pWin)).FpOrderBy != 0) {
- zErr = ts + 20775 /* "ORDER BY clause" */
+ zErr = ts + 22055 /* "PARTITION clause" */
+ } else if (*Window)(unsafe.Pointer(pExist)).FpOrderBy != 0 && (*Window)(unsafe.Pointer(pWin)).FpOrderBy != 0 {
+ zErr = ts + 22072 /* "ORDER BY clause" */
} else if int32((*Window)(unsafe.Pointer(pExist)).FbImplicitFrame) == 0 {
- zErr = ts + 20791 /* "frame specificat..." */
+ zErr = ts + 22088 /* "frame specificat..." */
}
if zErr != 0 {
Xsqlite3ErrorMsg(tls, pParse,
- ts+20811 /* "cannot override ..." */, libc.VaList(bp, zErr, (*Window)(unsafe.Pointer(pWin)).FzBase))
+ ts+22108 /* "cannot override ..." */, libc.VaList(bp, zErr, (*Window)(unsafe.Pointer(pWin)).FzBase))
} else {
(*Window)(unsafe.Pointer(pWin)).FpPartition = Xsqlite3ExprListDup(tls, db, (*Window)(unsafe.Pointer(pExist)).FpPartition, 0)
if (*Window)(unsafe.Pointer(pExist)).FpOrderBy != 0 {
@@ -137604,15 +139669,15 @@ func Xsqlite3WindowChain(tls *libc.TLS, pParse uintptr, pWin uintptr, pList uint
}
// Attach window object pWin to expression p.
-func Xsqlite3WindowAttach(tls *libc.TLS, pParse uintptr, p uintptr, pWin uintptr) { /* sqlite3.c:156213:21: */
+func Xsqlite3WindowAttach(tls *libc.TLS, pParse uintptr, p uintptr, pWin uintptr) { /* sqlite3.c:157633:21: */
if p != 0 {
- *(*uintptr)(unsafe.Pointer(p + 44 /* &.y */)) = pWin
- *(*U32)(unsafe.Pointer(p + 4 /* &.flags */)) |= (U32(EP_WinFunc))
+ *(*uintptr)(unsafe.Pointer(p + 44)) = pWin
+ *(*U32)(unsafe.Pointer(p + 4)) |= U32(EP_WinFunc)
(*Window)(unsafe.Pointer(pWin)).FpOwner = p
- if (((*Expr)(unsafe.Pointer(p)).Fflags & U32(EP_Distinct)) != 0) && (int32((*Window)(unsafe.Pointer(pWin)).FeFrmType) != TK_FILTER) {
+ if (*Expr)(unsafe.Pointer(p)).Fflags&U32(EP_Distinct) != 0 && int32((*Window)(unsafe.Pointer(pWin)).FeFrmType) != TK_FILTER {
Xsqlite3ErrorMsg(tls, pParse,
- ts+20844 /* "DISTINCT is not ..." */, 0)
+ ts+22141 /* "DISTINCT is not ..." */, 0)
}
} else {
Xsqlite3WindowDelete(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, pWin)
@@ -137623,18 +139688,18 @@ func Xsqlite3WindowAttach(tls *libc.TLS, pParse uintptr, p uintptr, pWin uintptr
// to be processed as part of SELECT statement pSel). The window is linked
// in if either (a) there are no other windows already linked to this
// SELECT, or (b) the windows already linked use a compatible window frame.
-func Xsqlite3WindowLink(tls *libc.TLS, pSel uintptr, pWin uintptr) { /* sqlite3.c:156236:21: */
+func Xsqlite3WindowLink(tls *libc.TLS, pSel uintptr, pWin uintptr) { /* sqlite3.c:157656:21: */
if pSel != 0 {
- if (uintptr(0) == (*Select)(unsafe.Pointer(pSel)).FpWin) || (0 == Xsqlite3WindowCompare(tls, uintptr(0), (*Select)(unsafe.Pointer(pSel)).FpWin, pWin, 0)) {
+ if uintptr(0) == (*Select)(unsafe.Pointer(pSel)).FpWin || 0 == Xsqlite3WindowCompare(tls, uintptr(0), (*Select)(unsafe.Pointer(pSel)).FpWin, pWin, 0) {
(*Window)(unsafe.Pointer(pWin)).FpNextWin = (*Select)(unsafe.Pointer(pSel)).FpWin
if (*Select)(unsafe.Pointer(pSel)).FpWin != 0 {
- (*Window)(unsafe.Pointer((*Select)(unsafe.Pointer(pSel)).FpWin)).FppThis = (pWin + 36 /* &.pNextWin */)
+ (*Window)(unsafe.Pointer((*Select)(unsafe.Pointer(pSel)).FpWin)).FppThis = pWin + 36
}
(*Select)(unsafe.Pointer(pSel)).FpWin = pWin
- (*Window)(unsafe.Pointer(pWin)).FppThis = (pSel + 68 /* &.pWin */)
+ (*Window)(unsafe.Pointer(pWin)).FppThis = pSel + 68
} else {
if Xsqlite3ExprListCompare(tls, (*Window)(unsafe.Pointer(pWin)).FpPartition, (*Window)(unsafe.Pointer((*Select)(unsafe.Pointer(pSel)).FpWin)).FpPartition, -1) != 0 {
- *(*U32)(unsafe.Pointer(pSel + 4 /* &.selFlags */)) |= (U32(SF_MultiPart))
+ *(*U32)(unsafe.Pointer(pSel + 4)) |= U32(SF_MultiPart)
}
}
}
@@ -137643,9 +139708,9 @@ func Xsqlite3WindowLink(tls *libc.TLS, pSel uintptr, pWin uintptr) { /* sqlite3.
// Return 0 if the two window objects are identical, 1 if they are
// different, or 2 if it cannot be determined if the objects are identical
// or not. Identical window objects can be processed in a single scan.
-func Xsqlite3WindowCompare(tls *libc.TLS, pParse uintptr, p1 uintptr, p2 uintptr, bFilter int32) int32 { /* sqlite3.c:156258:20: */
+func Xsqlite3WindowCompare(tls *libc.TLS, pParse uintptr, p1 uintptr, p2 uintptr, bFilter int32) int32 { /* sqlite3.c:157678:20: */
var res int32
- if (p1 == uintptr(0)) || (p2 == uintptr(0)) {
+ if p1 == uintptr(0) || p2 == uintptr(0) {
return 1
}
if int32((*Window)(unsafe.Pointer(p1)).FeFrmType) != int32((*Window)(unsafe.Pointer(p2)).FeFrmType) {
@@ -137683,24 +139748,24 @@ func Xsqlite3WindowCompare(tls *libc.TLS, pParse uintptr, p1 uintptr, p2 uintptr
// This is called by code in select.c before it calls sqlite3WhereBegin()
// to begin iterating through the sub-query results. It is used to allocate
// and initialize registers and cursors used by sqlite3WindowCodeStep().
-func Xsqlite3WindowCodeInit(tls *libc.TLS, pParse uintptr, pSelect uintptr) { /* sqlite3.c:156287:21: */
- var nEphExpr int32 = (*ExprList)(unsafe.Pointer((*Select)(unsafe.Pointer((*SrcItem)(unsafe.Pointer(((*Select)(unsafe.Pointer(pSelect)).FpSrc + 8 /* &.a */))).FpSelect)).FpEList)).FnExpr
+func Xsqlite3WindowCodeInit(tls *libc.TLS, pParse uintptr, pSelect uintptr) { /* sqlite3.c:157712:21: */
+ var nEphExpr int32 = (*ExprList)(unsafe.Pointer((*Select)(unsafe.Pointer((*SrcItem)(unsafe.Pointer((*Select)(unsafe.Pointer(pSelect)).FpSrc + 8)).FpSelect)).FpEList)).FnExpr
var pMWin uintptr = (*Select)(unsafe.Pointer(pSelect)).FpWin
var pWin uintptr
var v uintptr = Xsqlite3GetVdbe(tls, pParse)
Xsqlite3VdbeAddOp2(tls, v, OP_OpenEphemeral, (*Window)(unsafe.Pointer(pMWin)).FiEphCsr, nEphExpr)
- Xsqlite3VdbeAddOp2(tls, v, OP_OpenDup, ((*Window)(unsafe.Pointer(pMWin)).FiEphCsr + 1), (*Window)(unsafe.Pointer(pMWin)).FiEphCsr)
- Xsqlite3VdbeAddOp2(tls, v, OP_OpenDup, ((*Window)(unsafe.Pointer(pMWin)).FiEphCsr + 2), (*Window)(unsafe.Pointer(pMWin)).FiEphCsr)
- Xsqlite3VdbeAddOp2(tls, v, OP_OpenDup, ((*Window)(unsafe.Pointer(pMWin)).FiEphCsr + 3), (*Window)(unsafe.Pointer(pMWin)).FiEphCsr)
+ Xsqlite3VdbeAddOp2(tls, v, OP_OpenDup, (*Window)(unsafe.Pointer(pMWin)).FiEphCsr+1, (*Window)(unsafe.Pointer(pMWin)).FiEphCsr)
+ Xsqlite3VdbeAddOp2(tls, v, OP_OpenDup, (*Window)(unsafe.Pointer(pMWin)).FiEphCsr+2, (*Window)(unsafe.Pointer(pMWin)).FiEphCsr)
+ Xsqlite3VdbeAddOp2(tls, v, OP_OpenDup, (*Window)(unsafe.Pointer(pMWin)).FiEphCsr+3, (*Window)(unsafe.Pointer(pMWin)).FiEphCsr)
// Allocate registers to use for PARTITION BY values, if any. Initialize
// said registers to NULL.
if (*Window)(unsafe.Pointer(pMWin)).FpPartition != 0 {
var nExpr int32 = (*ExprList)(unsafe.Pointer((*Window)(unsafe.Pointer(pMWin)).FpPartition)).FnExpr
- (*Window)(unsafe.Pointer(pMWin)).FregPart = ((*Parse)(unsafe.Pointer(pParse)).FnMem + 1)
- *(*int32)(unsafe.Pointer(pParse + 44 /* &.nMem */)) += (nExpr)
- Xsqlite3VdbeAddOp3(tls, v, OP_Null, 0, (*Window)(unsafe.Pointer(pMWin)).FregPart, (((*Window)(unsafe.Pointer(pMWin)).FregPart + nExpr) - 1))
+ (*Window)(unsafe.Pointer(pMWin)).FregPart = (*Parse)(unsafe.Pointer(pParse)).FnMem + 1
+ *(*int32)(unsafe.Pointer(pParse + 44)) += nExpr
+ Xsqlite3VdbeAddOp3(tls, v, OP_Null, 0, (*Window)(unsafe.Pointer(pMWin)).FregPart, (*Window)(unsafe.Pointer(pMWin)).FregPart+nExpr-1)
}
(*Window)(unsafe.Pointer(pMWin)).FregOne = libc.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1)
@@ -137718,33 +139783,36 @@ func Xsqlite3WindowCodeInit(tls *libc.TLS, pParse uintptr, pSelect uintptr) { /*
for pWin = pMWin; pWin != 0; pWin = (*Window)(unsafe.Pointer(pWin)).FpNextWin {
var p uintptr = (*Window)(unsafe.Pointer(pWin)).FpFunc
- if (((*FuncDef)(unsafe.Pointer(p)).FfuncFlags & U32(SQLITE_FUNC_MINMAX)) != 0) && (int32((*Window)(unsafe.Pointer(pWin)).FeStart) != TK_UNBOUNDED) {
+ if (*FuncDef)(unsafe.Pointer(p)).FfuncFlags&U32(SQLITE_FUNC_MINMAX) != 0 && int32((*Window)(unsafe.Pointer(pWin)).FeStart) != TK_UNBOUNDED {
// The inline versions of min() and max() require a single ephemeral
// table and 3 registers. The registers are used as follows:
//
// regApp+0: slot to copy min()/max() argument to for MakeRecord
// regApp+1: integer value used to ensure keys are unique
// regApp+2: output of MakeRecord
- var pList uintptr = *(*uintptr)(unsafe.Pointer((*Window)(unsafe.Pointer(pWin)).FpOwner + 20 /* &.x */))
- var pKeyInfo uintptr = Xsqlite3KeyInfoFromExprList(tls, pParse, pList, 0, 0)
+ var pList uintptr
+ var pKeyInfo uintptr
+
+ pList = *(*uintptr)(unsafe.Pointer((*Window)(unsafe.Pointer(pWin)).FpOwner + 20))
+ pKeyInfo = Xsqlite3KeyInfoFromExprList(tls, pParse, pList, 0, 0)
(*Window)(unsafe.Pointer(pWin)).FcsrApp = libc.PostIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnTab, 1)
- (*Window)(unsafe.Pointer(pWin)).FregApp = ((*Parse)(unsafe.Pointer(pParse)).FnMem + 1)
- *(*int32)(unsafe.Pointer(pParse + 44 /* &.nMem */)) += (3)
- if (pKeyInfo != 0) && (int32(*(*uint8)(unsafe.Pointer((*FuncDef)(unsafe.Pointer((*Window)(unsafe.Pointer(pWin)).FpFunc)).FzName + 1))) == 'i') {
+ (*Window)(unsafe.Pointer(pWin)).FregApp = (*Parse)(unsafe.Pointer(pParse)).FnMem + 1
+ *(*int32)(unsafe.Pointer(pParse + 44)) += 3
+ if pKeyInfo != 0 && int32(*(*uint8)(unsafe.Pointer((*FuncDef)(unsafe.Pointer((*Window)(unsafe.Pointer(pWin)).FpFunc)).FzName + 1))) == 'i' {
*(*U8)(unsafe.Pointer((*KeyInfo)(unsafe.Pointer(pKeyInfo)).FaSortFlags)) = U8(KEYINFO_ORDER_DESC)
}
Xsqlite3VdbeAddOp2(tls, v, OP_OpenEphemeral, (*Window)(unsafe.Pointer(pWin)).FcsrApp, 2)
Xsqlite3VdbeAppendP4(tls, v, pKeyInfo, -9)
- Xsqlite3VdbeAddOp2(tls, v, OP_Integer, 0, ((*Window)(unsafe.Pointer(pWin)).FregApp + 1))
- } else if ((*FuncDef)(unsafe.Pointer(p)).FzName == uintptr(unsafe.Pointer(&nth_valueName))) || ((*FuncDef)(unsafe.Pointer(p)).FzName == uintptr(unsafe.Pointer(&first_valueName))) {
+ Xsqlite3VdbeAddOp2(tls, v, OP_Integer, 0, (*Window)(unsafe.Pointer(pWin)).FregApp+1)
+ } else if (*FuncDef)(unsafe.Pointer(p)).FzName == uintptr(unsafe.Pointer(&nth_valueName)) || (*FuncDef)(unsafe.Pointer(p)).FzName == uintptr(unsafe.Pointer(&first_valueName)) {
// Allocate two registers at pWin->regApp. These will be used to
// store the start and end index of the current frame.
- (*Window)(unsafe.Pointer(pWin)).FregApp = ((*Parse)(unsafe.Pointer(pParse)).FnMem + 1)
+ (*Window)(unsafe.Pointer(pWin)).FregApp = (*Parse)(unsafe.Pointer(pParse)).FnMem + 1
(*Window)(unsafe.Pointer(pWin)).FcsrApp = libc.PostIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnTab, 1)
- *(*int32)(unsafe.Pointer(pParse + 44 /* &.nMem */)) += (2)
+ *(*int32)(unsafe.Pointer(pParse + 44)) += 2
Xsqlite3VdbeAddOp2(tls, v, OP_OpenDup, (*Window)(unsafe.Pointer(pWin)).FcsrApp, (*Window)(unsafe.Pointer(pMWin)).FiEphCsr)
- } else if ((*FuncDef)(unsafe.Pointer(p)).FzName == uintptr(unsafe.Pointer(&leadName))) || ((*FuncDef)(unsafe.Pointer(p)).FzName == uintptr(unsafe.Pointer(&lagName))) {
+ } else if (*FuncDef)(unsafe.Pointer(p)).FzName == uintptr(unsafe.Pointer(&leadName)) || (*FuncDef)(unsafe.Pointer(p)).FzName == uintptr(unsafe.Pointer(&lagName)) {
(*Window)(unsafe.Pointer(pWin)).FcsrApp = libc.PostIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnTab, 1)
Xsqlite3VdbeAddOp2(tls, v, OP_OpenDup, (*Window)(unsafe.Pointer(pWin)).FcsrApp, (*Window)(unsafe.Pointer(pMWin)).FiEphCsr)
}
@@ -137756,22 +139824,22 @@ func Xsqlite3WindowCodeInit(tls *libc.TLS, pParse uintptr, pSelect uintptr) { /*
// evaluated and the result left in register reg. This function generates VM
// code to check that the value is a non-negative integer and throws an
// exception if it is not.
-func windowCheckValue(tls *libc.TLS, pParse uintptr, reg int32, eCond int32) { /* sqlite3.c:156371:13: */
+func windowCheckValue(tls *libc.TLS, pParse uintptr, reg int32, eCond int32) { /* sqlite3.c:157799:13: */
var v uintptr = Xsqlite3GetVdbe(tls, pParse)
var regZero int32 = Xsqlite3GetTempReg(tls, pParse)
Xsqlite3VdbeAddOp2(tls, v, OP_Integer, 0, regZero)
if eCond >= WINDOW_STARTING_NUM {
var regString int32 = Xsqlite3GetTempReg(tls, pParse)
- Xsqlite3VdbeAddOp4(tls, v, OP_String8, 0, regString, 0, ts+755 /* "" */, -1)
- Xsqlite3VdbeAddOp3(tls, v, OP_Ge, regString, (Xsqlite3VdbeCurrentAddr(tls, v) + 2), reg)
- Xsqlite3VdbeChangeP5(tls, v, (uint16(SQLITE_AFF_NUMERIC | SQLITE_JUMPIFNULL)))
+ Xsqlite3VdbeAddOp4(tls, v, OP_String8, 0, regString, 0, ts+1543 /* "" */, -1)
+ Xsqlite3VdbeAddOp3(tls, v, OP_Ge, regString, Xsqlite3VdbeCurrentAddr(tls, v)+2, reg)
+ Xsqlite3VdbeChangeP5(tls, v, uint16(SQLITE_AFF_NUMERIC|SQLITE_JUMPIFNULL))
} else {
- Xsqlite3VdbeAddOp2(tls, v, OP_MustBeInt, reg, (Xsqlite3VdbeCurrentAddr(tls, v) + 2))
+ Xsqlite3VdbeAddOp2(tls, v, OP_MustBeInt, reg, Xsqlite3VdbeCurrentAddr(tls, v)+2)
}
- Xsqlite3VdbeAddOp3(tls, v, aOp1[eCond], regZero, (Xsqlite3VdbeCurrentAddr(tls, v) + 2), reg)
+ Xsqlite3VdbeAddOp3(tls, v, aOp1[eCond], regZero, Xsqlite3VdbeCurrentAddr(tls, v)+2, reg)
Xsqlite3VdbeChangeP5(tls, v, uint16(SQLITE_AFF_NUMERIC))
// NULL case captured by
// the OP_MustBeInt
@@ -137785,18 +139853,20 @@ func windowCheckValue(tls *libc.TLS, pParse uintptr, reg int32, eCond int32) { /
}
var azErr = [5]uintptr{
- ts + 20891, /* "frame starting o..." */
- ts + 20944, /* "frame ending off..." */
- ts + 20374, /* "second argument ..." */
- ts + 20995, /* "frame starting o..." */
- ts + 21047, /* "frame ending off..." */
-} /* sqlite3.c:156372:21 */
-var aOp1 = [5]int32{OP_Ge, OP_Ge, OP_Gt, OP_Ge, OP_Ge} /* sqlite3.c:156379:14 */
+ ts + 22188, /* "frame starting o..." */
+ ts + 22241, /* "frame ending off..." */
+ ts + 21671, /* "second argument ..." */
+ ts + 22292, /* "frame starting o..." */
+ ts + 22344, /* "frame ending off..." */
+} /* sqlite3.c:157800:21 */
+var aOp1 = [5]int32{OP_Ge, OP_Ge, OP_Gt, OP_Ge, OP_Ge} /* sqlite3.c:157807:14 */
// Return the number of arguments passed to the window-function associated
// with the object passed as the only argument to this function.
-func windowArgCount(tls *libc.TLS, pWin uintptr) int32 { /* sqlite3.c:156418:12: */
- var pList uintptr = *(*uintptr)(unsafe.Pointer((*Window)(unsafe.Pointer(pWin)).FpOwner + 20 /* &.x */))
+func windowArgCount(tls *libc.TLS, pWin uintptr) int32 { /* sqlite3.c:157846:12: */
+ var pList uintptr
+
+ pList = *(*uintptr)(unsafe.Pointer((*Window)(unsafe.Pointer(pWin)).FpOwner + 20))
return func() int32 {
if pList != 0 {
return (*ExprList)(unsafe.Pointer(pList)).FnExpr
@@ -137817,33 +139887,33 @@ type WindowCodeArg1 = struct {
Fstart WindowCsrAndReg
Fcurrent WindowCsrAndReg
Fend WindowCsrAndReg
-} /* sqlite3.c:156423:9 */
+} /* sqlite3.c:157853:9 */
-type WindowCodeArg = WindowCodeArg1 /* sqlite3.c:156423:30 */
+type WindowCodeArg = WindowCodeArg1 /* sqlite3.c:157853:30 */
type WindowCsrAndReg1 = struct {
Fcsr int32
Freg int32
-} /* sqlite3.c:156423:9 */
+} /* sqlite3.c:157853:9 */
-type WindowCsrAndReg = WindowCsrAndReg1 /* sqlite3.c:156424:32 */
+type WindowCsrAndReg = WindowCsrAndReg1 /* sqlite3.c:157854:32 */
// Generate VM code to read the window frames peer values from cursor csr into
// an array of registers starting at reg.
-func windowReadPeerValues(tls *libc.TLS, p uintptr, csr int32, reg int32) { /* sqlite3.c:156508:13: */
+func windowReadPeerValues(tls *libc.TLS, p uintptr, csr int32, reg int32) { /* sqlite3.c:157938:13: */
var pMWin uintptr = (*WindowCodeArg)(unsafe.Pointer(p)).FpMWin
var pOrderBy uintptr = (*Window)(unsafe.Pointer(pMWin)).FpOrderBy
if pOrderBy != 0 {
var v uintptr = Xsqlite3GetVdbe(tls, (*WindowCodeArg)(unsafe.Pointer(p)).FpParse)
var pPart uintptr = (*Window)(unsafe.Pointer(pMWin)).FpPartition
- var iColOff int32 = ((*Window)(unsafe.Pointer(pMWin)).FnBufferCol + (func() int32 {
+ var iColOff int32 = (*Window)(unsafe.Pointer(pMWin)).FnBufferCol + func() int32 {
if pPart != 0 {
return (*ExprList)(unsafe.Pointer(pPart)).FnExpr
}
return 0
- }()))
+ }()
var i int32
for i = 0; i < (*ExprList)(unsafe.Pointer(pOrderBy)).FnExpr; i++ {
- Xsqlite3VdbeAddOp3(tls, v, OP_Column, csr, (iColOff + i), (reg + i))
+ Xsqlite3VdbeAddOp3(tls, v, OP_Column, csr, iColOff+i, reg+i)
}
}
}
@@ -137865,7 +139935,7 @@ func windowReadPeerValues(tls *libc.TLS, p uintptr, csr int32, reg int32) { /* s
//
// If argument regPartSize is non-zero, then it is a register containing the
// number of rows in the current partition.
-func windowAggStep(tls *libc.TLS, p uintptr, pMWin uintptr, csr int32, bInverse int32, reg int32) { /* sqlite3.c:156545:13: */
+func windowAggStep(tls *libc.TLS, p uintptr, pMWin uintptr, csr int32, bInverse int32, reg int32) { /* sqlite3.c:157975:13: */
var pParse uintptr = (*WindowCodeArg)(unsafe.Pointer(p)).FpParse
var v uintptr = Xsqlite3GetVdbe(tls, pParse)
var pWin uintptr
@@ -137884,34 +139954,34 @@ func windowAggStep(tls *libc.TLS, p uintptr, pMWin uintptr, csr int32, bInverse
// be the same.
for i = 0; i < nArg; i++ {
- if (i != 1) || ((*FuncDef)(unsafe.Pointer(pFunc)).FzName != uintptr(unsafe.Pointer(&nth_valueName))) {
- Xsqlite3VdbeAddOp3(tls, v, OP_Column, csr, ((*Window)(unsafe.Pointer(pWin)).FiArgCol + i), (reg + i))
+ if i != 1 || (*FuncDef)(unsafe.Pointer(pFunc)).FzName != uintptr(unsafe.Pointer(&nth_valueName)) {
+ Xsqlite3VdbeAddOp3(tls, v, OP_Column, csr, (*Window)(unsafe.Pointer(pWin)).FiArgCol+i, reg+i)
} else {
- Xsqlite3VdbeAddOp3(tls, v, OP_Column, (*Window)(unsafe.Pointer(pMWin)).FiEphCsr, ((*Window)(unsafe.Pointer(pWin)).FiArgCol + i), (reg + i))
+ Xsqlite3VdbeAddOp3(tls, v, OP_Column, (*Window)(unsafe.Pointer(pMWin)).FiEphCsr, (*Window)(unsafe.Pointer(pWin)).FiArgCol+i, reg+i)
}
}
regArg = reg
- if (((*Window)(unsafe.Pointer(pMWin)).FregStartRowid == 0) &&
- (((*FuncDef)(unsafe.Pointer(pFunc)).FfuncFlags & U32(SQLITE_FUNC_MINMAX)) != 0)) &&
- (int32((*Window)(unsafe.Pointer(pWin)).FeStart) != TK_UNBOUNDED) {
+ if (*Window)(unsafe.Pointer(pMWin)).FregStartRowid == 0 &&
+ (*FuncDef)(unsafe.Pointer(pFunc)).FfuncFlags&U32(SQLITE_FUNC_MINMAX) != 0 &&
+ int32((*Window)(unsafe.Pointer(pWin)).FeStart) != TK_UNBOUNDED {
var addrIsNull int32 = Xsqlite3VdbeAddOp1(tls, v, OP_IsNull, regArg)
if bInverse == 0 {
- Xsqlite3VdbeAddOp2(tls, v, OP_AddImm, ((*Window)(unsafe.Pointer(pWin)).FregApp + 1), 1)
+ Xsqlite3VdbeAddOp2(tls, v, OP_AddImm, (*Window)(unsafe.Pointer(pWin)).FregApp+1, 1)
Xsqlite3VdbeAddOp2(tls, v, OP_SCopy, regArg, (*Window)(unsafe.Pointer(pWin)).FregApp)
- Xsqlite3VdbeAddOp3(tls, v, OP_MakeRecord, (*Window)(unsafe.Pointer(pWin)).FregApp, 2, ((*Window)(unsafe.Pointer(pWin)).FregApp + 2))
- Xsqlite3VdbeAddOp2(tls, v, OP_IdxInsert, (*Window)(unsafe.Pointer(pWin)).FcsrApp, ((*Window)(unsafe.Pointer(pWin)).FregApp + 2))
+ Xsqlite3VdbeAddOp3(tls, v, OP_MakeRecord, (*Window)(unsafe.Pointer(pWin)).FregApp, 2, (*Window)(unsafe.Pointer(pWin)).FregApp+2)
+ Xsqlite3VdbeAddOp2(tls, v, OP_IdxInsert, (*Window)(unsafe.Pointer(pWin)).FcsrApp, (*Window)(unsafe.Pointer(pWin)).FregApp+2)
} else {
Xsqlite3VdbeAddOp4Int(tls, v, OP_SeekGE, (*Window)(unsafe.Pointer(pWin)).FcsrApp, 0, regArg, 1)
Xsqlite3VdbeAddOp1(tls, v, OP_Delete, (*Window)(unsafe.Pointer(pWin)).FcsrApp)
- Xsqlite3VdbeJumpHere(tls, v, (Xsqlite3VdbeCurrentAddr(tls, v) - 2))
+ Xsqlite3VdbeJumpHere(tls, v, Xsqlite3VdbeCurrentAddr(tls, v)-2)
}
Xsqlite3VdbeJumpHere(tls, v, addrIsNull)
} else if (*Window)(unsafe.Pointer(pWin)).FregApp != 0 {
- Xsqlite3VdbeAddOp2(tls, v, OP_AddImm, (((*Window)(unsafe.Pointer(pWin)).FregApp + 1) - bInverse), 1)
+ Xsqlite3VdbeAddOp2(tls, v, OP_AddImm, (*Window)(unsafe.Pointer(pWin)).FregApp+1-bInverse, 1)
} else if (*FuncDef)(unsafe.Pointer(pFunc)).FxSFunc != *(*uintptr)(unsafe.Pointer(&struct {
f func(*libc.TLS, uintptr, int32, uintptr)
}{noopStepFunc})) {
@@ -137920,7 +139990,7 @@ func windowAggStep(tls *libc.TLS, p uintptr, pMWin uintptr, csr int32, bInverse
var regTmp int32
regTmp = Xsqlite3GetTempReg(tls, pParse)
- Xsqlite3VdbeAddOp3(tls, v, OP_Column, csr, ((*Window)(unsafe.Pointer(pWin)).FiArgCol + nArg), regTmp)
+ Xsqlite3VdbeAddOp3(tls, v, OP_Column, csr, (*Window)(unsafe.Pointer(pWin)).FiArgCol+nArg, regTmp)
addrIf = Xsqlite3VdbeAddOp3(tls, v, OP_IfNot, regTmp, 0, 1)
Xsqlite3ReleaseTempReg(tls, pParse, regTmp)
@@ -137930,21 +140000,21 @@ func windowAggStep(tls *libc.TLS, p uintptr, pMWin uintptr, csr int32, bInverse
var iOp int32 = Xsqlite3VdbeCurrentAddr(tls, v)
var iEnd int32
- nArg = (*ExprList)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((*Window)(unsafe.Pointer(pWin)).FpOwner + 20 /* &.x */)))).FnExpr
+ nArg = (*ExprList)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((*Window)(unsafe.Pointer(pWin)).FpOwner + 20)))).FnExpr
regArg = Xsqlite3GetTempRange(tls, pParse, nArg)
- Xsqlite3ExprCodeExprList(tls, pParse, *(*uintptr)(unsafe.Pointer((*Window)(unsafe.Pointer(pWin)).FpOwner + 20 /* &.x */)), regArg, 0, uint8(0))
+ Xsqlite3ExprCodeExprList(tls, pParse, *(*uintptr)(unsafe.Pointer((*Window)(unsafe.Pointer(pWin)).FpOwner + 20)), regArg, 0, uint8(0))
for iEnd = Xsqlite3VdbeCurrentAddr(tls, v); iOp < iEnd; iOp++ {
var pOp uintptr = Xsqlite3VdbeGetOp(tls, v, iOp)
- if (int32((*VdbeOp)(unsafe.Pointer(pOp)).Fopcode) == OP_Column) && ((*VdbeOp)(unsafe.Pointer(pOp)).Fp1 == (*Window)(unsafe.Pointer(pWin)).FiEphCsr) {
+ if int32((*VdbeOp)(unsafe.Pointer(pOp)).Fopcode) == OP_Column && (*VdbeOp)(unsafe.Pointer(pOp)).Fp1 == (*Window)(unsafe.Pointer(pWin)).FiEphCsr {
(*VdbeOp)(unsafe.Pointer(pOp)).Fp1 = csr
}
}
}
- if ((*FuncDef)(unsafe.Pointer(pFunc)).FfuncFlags & U32(SQLITE_FUNC_NEEDCOLL)) != 0 {
+ if (*FuncDef)(unsafe.Pointer(pFunc)).FfuncFlags&U32(SQLITE_FUNC_NEEDCOLL) != 0 {
var pColl uintptr
- pColl = Xsqlite3ExprNNCollSeq(tls, pParse, (*ExprList_item)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer((*Window)(unsafe.Pointer(pWin)).FpOwner + 20 /* &.x */)) + 8 /* &.a */))).FpExpr)
+ pColl = Xsqlite3ExprNNCollSeq(tls, pParse, (*ExprList_item)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((*Window)(unsafe.Pointer(pWin)).FpOwner + 20))+8)).FpExpr)
Xsqlite3VdbeAddOp4(tls, v, OP_CollSeq, 0, 0, 0, pColl, -2)
}
Xsqlite3VdbeAddOp3(tls, v, func() int32 {
@@ -137972,21 +140042,21 @@ func windowAggStep(tls *libc.TLS, p uintptr, pMWin uintptr, csr int32, bInverse
// (bFin==1) for each window function in the linked list starting at
// pMWin. Or, for built-in window-functions that do not use the standard
// API, generate the equivalent VM code.
-func windowAggFinal(tls *libc.TLS, p uintptr, bFin int32) { /* sqlite3.c:156659:13: */
+func windowAggFinal(tls *libc.TLS, p uintptr, bFin int32) { /* sqlite3.c:158092:13: */
var pParse uintptr = (*WindowCodeArg)(unsafe.Pointer(p)).FpParse
var pMWin uintptr = (*WindowCodeArg)(unsafe.Pointer(p)).FpMWin
var v uintptr = Xsqlite3GetVdbe(tls, pParse)
var pWin uintptr
for pWin = pMWin; pWin != 0; pWin = (*Window)(unsafe.Pointer(pWin)).FpNextWin {
- if (((*Window)(unsafe.Pointer(pMWin)).FregStartRowid == 0) &&
- (((*FuncDef)(unsafe.Pointer((*Window)(unsafe.Pointer(pWin)).FpFunc)).FfuncFlags & U32(SQLITE_FUNC_MINMAX)) != 0)) &&
- (int32((*Window)(unsafe.Pointer(pWin)).FeStart) != TK_UNBOUNDED) {
+ if (*Window)(unsafe.Pointer(pMWin)).FregStartRowid == 0 &&
+ (*FuncDef)(unsafe.Pointer((*Window)(unsafe.Pointer(pWin)).FpFunc)).FfuncFlags&U32(SQLITE_FUNC_MINMAX) != 0 &&
+ int32((*Window)(unsafe.Pointer(pWin)).FeStart) != TK_UNBOUNDED {
Xsqlite3VdbeAddOp2(tls, v, OP_Null, 0, (*Window)(unsafe.Pointer(pWin)).FregResult)
Xsqlite3VdbeAddOp1(tls, v, OP_Last, (*Window)(unsafe.Pointer(pWin)).FcsrApp)
Xsqlite3VdbeAddOp3(tls, v, OP_Column, (*Window)(unsafe.Pointer(pWin)).FcsrApp, 0, (*Window)(unsafe.Pointer(pWin)).FregResult)
- Xsqlite3VdbeJumpHere(tls, v, (Xsqlite3VdbeCurrentAddr(tls, v) - 2))
+ Xsqlite3VdbeJumpHere(tls, v, Xsqlite3VdbeCurrentAddr(tls, v)-2)
} else if (*Window)(unsafe.Pointer(pWin)).FregApp != 0 {
} else {
@@ -138008,7 +140078,7 @@ func windowAggFinal(tls *libc.TLS, p uintptr, bFin int32) { /* sqlite3.c:156659:
// p->pMWin list by doing a full scan of the current window frame. Store the
// results in the Window.regResult registers, ready to return the upper
// layer.
-func windowFullScan(tls *libc.TLS, p uintptr) { /* sqlite3.c:156698:13: */
+func windowFullScan(tls *libc.TLS, p uintptr) { /* sqlite3.c:158131:13: */
var pWin uintptr
var pParse uintptr = (*WindowCodeArg)(unsafe.Pointer(p)).FpParse
var pMWin uintptr = (*WindowCodeArg)(unsafe.Pointer(p)).FpMWin
@@ -138075,7 +140145,7 @@ func windowFullScan(tls *libc.TLS, p uintptr) { /* sqlite3.c:156698:13: */
windowReadPeerValues(tls, p, csr, regPeer)
Xsqlite3VdbeAddOp3(tls, v, OP_Compare, regPeer, regCPeer, nPeer)
Xsqlite3VdbeAppendP4(tls, v, pKeyInfo, -9)
- addr = (Xsqlite3VdbeCurrentAddr(tls, v) + 1)
+ addr = Xsqlite3VdbeCurrentAddr(tls, v) + 1
Xsqlite3VdbeAddOp3(tls, v, OP_Jump, addr, lblNext, addr)
} else {
@@ -138091,8 +140161,8 @@ func windowFullScan(tls *libc.TLS, p uintptr) { /* sqlite3.c:156698:13: */
Xsqlite3VdbeResolveLabel(tls, v, lblNext)
Xsqlite3VdbeAddOp2(tls, v, OP_Next, csr, addrNext)
- Xsqlite3VdbeJumpHere(tls, v, (addrNext - 1))
- Xsqlite3VdbeJumpHere(tls, v, (addrNext + 1))
+ Xsqlite3VdbeJumpHere(tls, v, addrNext-1)
+ Xsqlite3VdbeJumpHere(tls, v, addrNext+1)
Xsqlite3ReleaseTempReg(tls, pParse, regRowid)
Xsqlite3ReleaseTempReg(tls, pParse, regCRowid)
if nPeer != 0 {
@@ -138115,7 +140185,7 @@ func windowFullScan(tls *libc.TLS, p uintptr) { /* sqlite3.c:156698:13: */
// first_value()
// lag()
// lead()
-func windowReturnOneRow(tls *libc.TLS, p uintptr) { /* sqlite3.c:156804:13: */
+func windowReturnOneRow(tls *libc.TLS, p uintptr) { /* sqlite3.c:158237:13: */
var pMWin uintptr = (*WindowCodeArg)(unsafe.Pointer(p)).FpMWin
var v uintptr = (*WindowCodeArg)(unsafe.Pointer(p)).FpVdbe
@@ -138127,29 +140197,30 @@ func windowReturnOneRow(tls *libc.TLS, p uintptr) { /* sqlite3.c:156804:13: */
for pWin = pMWin; pWin != 0; pWin = (*Window)(unsafe.Pointer(pWin)).FpNextWin {
var pFunc uintptr = (*Window)(unsafe.Pointer(pWin)).FpFunc
- if ((*FuncDef)(unsafe.Pointer(pFunc)).FzName == uintptr(unsafe.Pointer(&nth_valueName))) ||
- ((*FuncDef)(unsafe.Pointer(pFunc)).FzName == uintptr(unsafe.Pointer(&first_valueName))) {
+
+ if (*FuncDef)(unsafe.Pointer(pFunc)).FzName == uintptr(unsafe.Pointer(&nth_valueName)) ||
+ (*FuncDef)(unsafe.Pointer(pFunc)).FzName == uintptr(unsafe.Pointer(&first_valueName)) {
var csr int32 = (*Window)(unsafe.Pointer(pWin)).FcsrApp
var lbl int32 = Xsqlite3VdbeMakeLabel(tls, pParse)
var tmpReg int32 = Xsqlite3GetTempReg(tls, pParse)
Xsqlite3VdbeAddOp2(tls, v, OP_Null, 0, (*Window)(unsafe.Pointer(pWin)).FregResult)
if (*FuncDef)(unsafe.Pointer(pFunc)).FzName == uintptr(unsafe.Pointer(&nth_valueName)) {
- Xsqlite3VdbeAddOp3(tls, v, OP_Column, (*Window)(unsafe.Pointer(pMWin)).FiEphCsr, ((*Window)(unsafe.Pointer(pWin)).FiArgCol + 1), tmpReg)
+ Xsqlite3VdbeAddOp3(tls, v, OP_Column, (*Window)(unsafe.Pointer(pMWin)).FiEphCsr, (*Window)(unsafe.Pointer(pWin)).FiArgCol+1, tmpReg)
windowCheckValue(tls, pParse, tmpReg, 2)
} else {
Xsqlite3VdbeAddOp2(tls, v, OP_Integer, 1, tmpReg)
}
Xsqlite3VdbeAddOp3(tls, v, OP_Add, tmpReg, (*Window)(unsafe.Pointer(pWin)).FregApp, tmpReg)
- Xsqlite3VdbeAddOp3(tls, v, OP_Gt, ((*Window)(unsafe.Pointer(pWin)).FregApp + 1), lbl, tmpReg)
+ Xsqlite3VdbeAddOp3(tls, v, OP_Gt, (*Window)(unsafe.Pointer(pWin)).FregApp+1, lbl, tmpReg)
Xsqlite3VdbeAddOp3(tls, v, OP_SeekRowid, csr, 0, tmpReg)
Xsqlite3VdbeAddOp3(tls, v, OP_Column, csr, (*Window)(unsafe.Pointer(pWin)).FiArgCol, (*Window)(unsafe.Pointer(pWin)).FregResult)
Xsqlite3VdbeResolveLabel(tls, v, lbl)
Xsqlite3ReleaseTempReg(tls, pParse, tmpReg)
- } else if ((*FuncDef)(unsafe.Pointer(pFunc)).FzName == uintptr(unsafe.Pointer(&leadName))) || ((*FuncDef)(unsafe.Pointer(pFunc)).FzName == uintptr(unsafe.Pointer(&lagName))) {
- var nArg int32 = (*ExprList)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((*Window)(unsafe.Pointer(pWin)).FpOwner + 20 /* &.x */)))).FnExpr
+ } else if (*FuncDef)(unsafe.Pointer(pFunc)).FzName == uintptr(unsafe.Pointer(&leadName)) || (*FuncDef)(unsafe.Pointer(pFunc)).FzName == uintptr(unsafe.Pointer(&lagName)) {
+ var nArg int32 = (*ExprList)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((*Window)(unsafe.Pointer(pWin)).FpOwner + 20)))).FnExpr
var csr int32 = (*Window)(unsafe.Pointer(pWin)).FcsrApp
var lbl int32 = Xsqlite3VdbeMakeLabel(tls, pParse)
var tmpReg int32 = Xsqlite3GetTempReg(tls, pParse)
@@ -138158,7 +140229,7 @@ func windowReturnOneRow(tls *libc.TLS, p uintptr) { /* sqlite3.c:156804:13: */
if nArg < 3 {
Xsqlite3VdbeAddOp2(tls, v, OP_Null, 0, (*Window)(unsafe.Pointer(pWin)).FregResult)
} else {
- Xsqlite3VdbeAddOp3(tls, v, OP_Column, iEph, ((*Window)(unsafe.Pointer(pWin)).FiArgCol + 2), (*Window)(unsafe.Pointer(pWin)).FregResult)
+ Xsqlite3VdbeAddOp3(tls, v, OP_Column, iEph, (*Window)(unsafe.Pointer(pWin)).FiArgCol+2, (*Window)(unsafe.Pointer(pWin)).FregResult)
}
Xsqlite3VdbeAddOp2(tls, v, OP_Rowid, iEph, tmpReg)
if nArg < 2 {
@@ -138177,7 +140248,7 @@ func windowReturnOneRow(tls *libc.TLS, p uintptr) { /* sqlite3.c:156804:13: */
return OP_Subtract
}()
var tmpReg2 int32 = Xsqlite3GetTempReg(tls, pParse)
- Xsqlite3VdbeAddOp3(tls, v, OP_Column, iEph, ((*Window)(unsafe.Pointer(pWin)).FiArgCol + 1), tmpReg2)
+ Xsqlite3VdbeAddOp3(tls, v, OP_Column, iEph, (*Window)(unsafe.Pointer(pWin)).FiArgCol+1, tmpReg2)
Xsqlite3VdbeAddOp3(tls, v, op, tmpReg2, tmpReg, tmpReg)
Xsqlite3ReleaseTempReg(tls, pParse, tmpReg2)
}
@@ -138197,7 +140268,7 @@ func windowReturnOneRow(tls *libc.TLS, p uintptr) { /* sqlite3.c:156804:13: */
// in the linked list passed as the second argument to NULL. And perform
// any equivalent initialization required by any built-in window functions
// in the list.
-func windowInitAccum(tls *libc.TLS, pParse uintptr, pMWin uintptr) int32 { /* sqlite3.c:156880:12: */
+func windowInitAccum(tls *libc.TLS, pParse uintptr, pMWin uintptr) int32 { /* sqlite3.c:158314:12: */
var v uintptr = Xsqlite3GetVdbe(tls, pParse)
var regArg int32
var nArg int32 = 0
@@ -138207,42 +140278,42 @@ func windowInitAccum(tls *libc.TLS, pParse uintptr, pMWin uintptr) int32 { /* sq
Xsqlite3VdbeAddOp2(tls, v, OP_Null, 0, (*Window)(unsafe.Pointer(pWin)).FregAccum)
nArg = func() int32 {
- if (nArg) > (windowArgCount(tls, pWin)) {
+ if nArg > windowArgCount(tls, pWin) {
return nArg
}
return windowArgCount(tls, pWin)
}()
if (*Window)(unsafe.Pointer(pMWin)).FregStartRowid == 0 {
- if ((*FuncDef)(unsafe.Pointer(pFunc)).FzName == uintptr(unsafe.Pointer(&nth_valueName))) || ((*FuncDef)(unsafe.Pointer(pFunc)).FzName == uintptr(unsafe.Pointer(&first_valueName))) {
+ if (*FuncDef)(unsafe.Pointer(pFunc)).FzName == uintptr(unsafe.Pointer(&nth_valueName)) || (*FuncDef)(unsafe.Pointer(pFunc)).FzName == uintptr(unsafe.Pointer(&first_valueName)) {
Xsqlite3VdbeAddOp2(tls, v, OP_Integer, 0, (*Window)(unsafe.Pointer(pWin)).FregApp)
- Xsqlite3VdbeAddOp2(tls, v, OP_Integer, 0, ((*Window)(unsafe.Pointer(pWin)).FregApp + 1))
+ Xsqlite3VdbeAddOp2(tls, v, OP_Integer, 0, (*Window)(unsafe.Pointer(pWin)).FregApp+1)
}
- if (((*FuncDef)(unsafe.Pointer(pFunc)).FfuncFlags & U32(SQLITE_FUNC_MINMAX)) != 0) && ((*Window)(unsafe.Pointer(pWin)).FcsrApp != 0) {
+ if (*FuncDef)(unsafe.Pointer(pFunc)).FfuncFlags&U32(SQLITE_FUNC_MINMAX) != 0 && (*Window)(unsafe.Pointer(pWin)).FcsrApp != 0 {
Xsqlite3VdbeAddOp1(tls, v, OP_ResetSorter, (*Window)(unsafe.Pointer(pWin)).FcsrApp)
- Xsqlite3VdbeAddOp2(tls, v, OP_Integer, 0, ((*Window)(unsafe.Pointer(pWin)).FregApp + 1))
+ Xsqlite3VdbeAddOp2(tls, v, OP_Integer, 0, (*Window)(unsafe.Pointer(pWin)).FregApp+1)
}
}
}
- regArg = ((*Parse)(unsafe.Pointer(pParse)).FnMem + 1)
- *(*int32)(unsafe.Pointer(pParse + 44 /* &.nMem */)) += (nArg)
+ regArg = (*Parse)(unsafe.Pointer(pParse)).FnMem + 1
+ *(*int32)(unsafe.Pointer(pParse + 44)) += nArg
return regArg
}
// Return true if the current frame should be cached in the ephemeral table,
// even if there are no xInverse() calls required.
-func windowCacheFrame(tls *libc.TLS, pMWin uintptr) int32 { /* sqlite3.c:156912:12: */
+func windowCacheFrame(tls *libc.TLS, pMWin uintptr) int32 { /* sqlite3.c:158346:12: */
var pWin uintptr
if (*Window)(unsafe.Pointer(pMWin)).FregStartRowid != 0 {
return 1
}
for pWin = pMWin; pWin != 0; pWin = (*Window)(unsafe.Pointer(pWin)).FpNextWin {
var pFunc uintptr = (*Window)(unsafe.Pointer(pWin)).FpFunc
- if ((((*FuncDef)(unsafe.Pointer(pFunc)).FzName == uintptr(unsafe.Pointer(&nth_valueName))) ||
- ((*FuncDef)(unsafe.Pointer(pFunc)).FzName == uintptr(unsafe.Pointer(&first_valueName)))) ||
- ((*FuncDef)(unsafe.Pointer(pFunc)).FzName == uintptr(unsafe.Pointer(&leadName)))) ||
- ((*FuncDef)(unsafe.Pointer(pFunc)).FzName == uintptr(unsafe.Pointer(&lagName))) {
+ if (*FuncDef)(unsafe.Pointer(pFunc)).FzName == uintptr(unsafe.Pointer(&nth_valueName)) ||
+ (*FuncDef)(unsafe.Pointer(pFunc)).FzName == uintptr(unsafe.Pointer(&first_valueName)) ||
+ (*FuncDef)(unsafe.Pointer(pFunc)).FzName == uintptr(unsafe.Pointer(&leadName)) ||
+ (*FuncDef)(unsafe.Pointer(pFunc)).FzName == uintptr(unsafe.Pointer(&lagName)) {
return 1
}
}
@@ -138257,7 +140328,7 @@ func windowCacheFrame(tls *libc.TLS, pMWin uintptr) int32 { /* sqlite3.c:156912:
// If the two arrays are not equal, the contents of regNew is copied to
// regOld and control falls through. Otherwise, if the contents of the arrays
// are equal, an OP_Goto is executed. The address of the OP_Goto is returned.
-func windowIfNewPeer(tls *libc.TLS, pParse uintptr, pOrderBy uintptr, regNew int32, regOld int32, addr int32) { /* sqlite3.c:156938:13: */
+func windowIfNewPeer(tls *libc.TLS, pParse uintptr, pOrderBy uintptr, regNew int32, regOld int32, addr int32) { /* sqlite3.c:158372:13: */
var v uintptr = Xsqlite3GetVdbe(tls, pParse)
if pOrderBy != 0 {
var nVal int32 = (*ExprList)(unsafe.Pointer(pOrderBy)).FnExpr
@@ -138265,9 +140336,9 @@ func windowIfNewPeer(tls *libc.TLS, pParse uintptr, pOrderBy uintptr, regNew int
Xsqlite3VdbeAddOp3(tls, v, OP_Compare, regOld, regNew, nVal)
Xsqlite3VdbeAppendP4(tls, v, pKeyInfo, -9)
Xsqlite3VdbeAddOp3(tls, v, OP_Jump,
- (Xsqlite3VdbeCurrentAddr(tls, v) + 1), addr, (Xsqlite3VdbeCurrentAddr(tls, v) + 1))
+ Xsqlite3VdbeCurrentAddr(tls, v)+1, addr, Xsqlite3VdbeCurrentAddr(tls, v)+1)
- Xsqlite3VdbeAddOp3(tls, v, OP_Copy, regNew, regOld, (nVal - 1))
+ Xsqlite3VdbeAddOp3(tls, v, OP_Copy, regNew, regOld, nVal-1)
} else {
Xsqlite3VdbeAddOp2(tls, v, OP_Goto, 0, addr)
}
@@ -138294,7 +140365,7 @@ func windowIfNewPeer(tls *libc.TLS, pParse uintptr, pOrderBy uintptr, regNew int
// A special type of arithmetic is used such that if csr1.peerVal is not
// a numeric type (real or integer), then the result of the addition
// or subtraction is a a copy of csr1.peerVal.
-func windowCodeRangeTest(tls *libc.TLS, p uintptr, op int32, csr1 int32, regVal int32, csr2 int32, lbl int32) { /* sqlite3.c:156984:13: */
+func windowCodeRangeTest(tls *libc.TLS, p uintptr, op int32, csr1 int32, regVal int32, csr2 int32, lbl int32) { /* sqlite3.c:158418:13: */
var pParse uintptr = (*WindowCodeArg)(unsafe.Pointer(p)).FpParse
var v uintptr = Xsqlite3GetVdbe(tls, pParse)
var pOrderBy uintptr = (*Window)(unsafe.Pointer((*WindowCodeArg)(unsafe.Pointer(p)).FpMWin)).FpOrderBy // ORDER BY clause for window
@@ -138310,7 +140381,7 @@ func windowCodeRangeTest(tls *libc.TLS, p uintptr, op int32, csr1 int32, regVal
windowReadPeerValues(tls, p, csr1, reg1)
windowReadPeerValues(tls, p, csr2, reg2)
- if (int32((*ExprList_item)(unsafe.Pointer((pOrderBy + 8 /* &.a */))).FsortFlags) & KEYINFO_ORDER_DESC) != 0 {
+ if int32((*ExprList_item)(unsafe.Pointer(pOrderBy+8)).FsortFlags)&KEYINFO_ORDER_DESC != 0 {
switch op {
case OP_Ge:
op = OP_Le
@@ -138346,7 +140417,7 @@ func windowCodeRangeTest(tls *libc.TLS, p uintptr, op int32, csr1 int32, regVal
// Additionally, if either reg1 or reg2 are NULL but the jump to lbl is
// not taken, control jumps over the comparison operator coded below this
// block.
- if (int32((*ExprList_item)(unsafe.Pointer((pOrderBy + 8 /* &.a */))).FsortFlags) & KEYINFO_ORDER_BIGNULL) != 0 {
+ if int32((*ExprList_item)(unsafe.Pointer(pOrderBy+8)).FsortFlags)&KEYINFO_ORDER_BIGNULL != 0 {
// This block runs if reg1 contains a NULL.
var addr int32 = Xsqlite3VdbeAddOp1(tls, v, OP_NotNull, reg1)
switch op {
@@ -138372,7 +140443,7 @@ func windowCodeRangeTest(tls *libc.TLS, p uintptr, op int32, csr1 int32, regVal
// This block runs if reg1 is not NULL, but reg2 is.
Xsqlite3VdbeJumpHere(tls, v, addr)
Xsqlite3VdbeAddOp2(tls, v, OP_IsNull, reg2, lbl)
- if (op == OP_Gt) || (op == OP_Ge) {
+ if op == OP_Gt || op == OP_Ge {
Xsqlite3VdbeChangeP2(tls, v, -1, addrDone)
}
}
@@ -138390,10 +140461,10 @@ 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.
- Xsqlite3VdbeAddOp4(tls, v, OP_String8, 0, regString, 0, ts+755 /* "" */, -1)
+ Xsqlite3VdbeAddOp4(tls, v, OP_String8, 0, regString, 0, ts+1543 /* "" */, -1)
addrGe = Xsqlite3VdbeAddOp3(tls, v, OP_Ge, regString, 0, reg1)
- if ((op == OP_Ge) && (arith == OP_Add)) || ((op == OP_Le) && (arith == OP_Subtract)) {
+ if op == OP_Ge && arith == OP_Add || op == OP_Le && arith == OP_Subtract {
Xsqlite3VdbeAddOp3(tls, v, op, reg2, lbl, reg1)
}
Xsqlite3VdbeAddOp3(tls, v, arith, regVal, reg1, reg1)
@@ -138403,7 +140474,7 @@ func windowCodeRangeTest(tls *libc.TLS, p uintptr, op int32, csr1 int32, regVal
// control skips over this test if the BIGNULL flag is set and either
// reg1 or reg2 contain a NULL value.
Xsqlite3VdbeAddOp3(tls, v, op, reg2, lbl, reg1)
- pColl = Xsqlite3ExprNNCollSeq(tls, pParse, (*ExprList_item)(unsafe.Pointer((pOrderBy + 8 /* &.a */))).FpExpr)
+ pColl = Xsqlite3ExprNNCollSeq(tls, pParse, (*ExprList_item)(unsafe.Pointer(pOrderBy+8)).FpExpr)
Xsqlite3VdbeAppendP4(tls, v, pColl, -2)
Xsqlite3VdbeChangeP5(tls, v, uint16(SQLITE_NULLEQ))
Xsqlite3VdbeResolveLabel(tls, v, addrDone)
@@ -138417,7 +140488,7 @@ func windowCodeRangeTest(tls *libc.TLS, p uintptr, op int32, csr1 int32, regVal
// generates VM code for a single RETURN_ROW, AGGSTEP or AGGINVERSE
// operation. Refer to the header comment for sqlite3WindowCodeStep() for
// details.
-func windowCodeOp(tls *libc.TLS, p uintptr, op int32, regCountdown int32, jumpOnEof int32) int32 { /* sqlite3.c:157117:12: */
+func windowCodeOp(tls *libc.TLS, p uintptr, op int32, regCountdown int32, jumpOnEof int32) int32 { /* sqlite3.c:158551:12: */
var csr int32
var reg int32
var pParse uintptr = (*WindowCodeArg)(unsafe.Pointer(p)).FpParse
@@ -138425,14 +140496,14 @@ func windowCodeOp(tls *libc.TLS, p uintptr, op int32, regCountdown int32, jumpOn
var ret int32 = 0
var v uintptr = (*WindowCodeArg)(unsafe.Pointer(p)).FpVdbe
var addrContinue int32 = 0
- var bPeer int32 = (libc.Bool32(int32((*Window)(unsafe.Pointer(pMWin)).FeFrmType) != TK_ROWS))
+ var bPeer int32 = libc.Bool32(int32((*Window)(unsafe.Pointer(pMWin)).FeFrmType) != TK_ROWS)
var lblDone int32 = Xsqlite3VdbeMakeLabel(tls, pParse)
var addrNextRange int32 = 0
// Special case - WINDOW_AGGINVERSE is always a no-op if the frame
// starts with UNBOUNDED PRECEDING.
- if (op == WINDOW_AGGINVERSE) && (int32((*Window)(unsafe.Pointer(pMWin)).FeStart) == TK_UNBOUNDED) {
+ if op == WINDOW_AGGINVERSE && int32((*Window)(unsafe.Pointer(pMWin)).FeStart) == TK_UNBOUNDED {
return 0
}
@@ -138459,7 +140530,7 @@ func windowCodeOp(tls *libc.TLS, p uintptr, op int32, regCountdown int32, jumpOn
}
}
- if (op == WINDOW_RETURN_ROW) && ((*Window)(unsafe.Pointer(pMWin)).FregStartRowid == 0) {
+ if op == WINDOW_RETURN_ROW && (*Window)(unsafe.Pointer(pMWin)).FregStartRowid == 0 {
windowAggFinal(tls, p, 0)
}
addrContinue = Xsqlite3VdbeCurrentAddr(tls, v)
@@ -138470,8 +140541,8 @@ func windowCodeOp(tls *libc.TLS, p uintptr, op int32, regCountdown int32, jumpOn
// temporary table. It otherwise might, if (a>b). Also ensure that,
// if the input cursor is still finding new rows, that the end
// cursor does not go past it to EOF.
- if ((int32((*Window)(unsafe.Pointer(pMWin)).FeStart) == int32((*Window)(unsafe.Pointer(pMWin)).FeEnd)) && (regCountdown != 0)) &&
- (int32((*Window)(unsafe.Pointer(pMWin)).FeFrmType) == TK_RANGE) {
+ if int32((*Window)(unsafe.Pointer(pMWin)).FeStart) == int32((*Window)(unsafe.Pointer(pMWin)).FeEnd) && regCountdown != 0 &&
+ int32((*Window)(unsafe.Pointer(pMWin)).FeFrmType) == TK_RANGE {
var regRowid1 int32 = Xsqlite3GetTempReg(tls, pParse)
var regRowid2 int32 = Xsqlite3GetTempReg(tls, pParse)
if op == WINDOW_AGGINVERSE {
@@ -138526,11 +140597,11 @@ func windowCodeOp(tls *libc.TLS, p uintptr, op int32, regCountdown int32, jumpOn
}
if jumpOnEof != 0 {
- Xsqlite3VdbeAddOp2(tls, v, OP_Next, csr, (Xsqlite3VdbeCurrentAddr(tls, v) + 2))
+ Xsqlite3VdbeAddOp2(tls, v, OP_Next, csr, Xsqlite3VdbeCurrentAddr(tls, v)+2)
ret = Xsqlite3VdbeAddOp0(tls, v, OP_Goto)
} else {
- Xsqlite3VdbeAddOp2(tls, v, OP_Next, csr, ((Xsqlite3VdbeCurrentAddr(tls, v) + 1) + bPeer))
+ Xsqlite3VdbeAddOp2(tls, v, OP_Next, csr, Xsqlite3VdbeCurrentAddr(tls, v)+1+bPeer)
if bPeer != 0 {
Xsqlite3VdbeAddOp2(tls, v, OP_Goto, 0, lblDone)
@@ -138565,7 +140636,7 @@ func windowCodeOp(tls *libc.TLS, p uintptr, op int32, regCountdown int32, jumpOn
// Allocate and return a duplicate of the Window object indicated by the
// third argument. Set the Window.pOwner field of the new object to
// pOwner.
-func Xsqlite3WindowDup(tls *libc.TLS, db uintptr, pOwner uintptr, p uintptr) uintptr { /* sqlite3.c:157266:23: */
+func Xsqlite3WindowDup(tls *libc.TLS, db uintptr, pOwner uintptr, p uintptr) uintptr { /* sqlite3.c:158700:23: */
var pNew uintptr = uintptr(0)
if p != 0 {
pNew = Xsqlite3DbMallocZero(tls, db, uint64(unsafe.Sizeof(Window{})))
@@ -138596,7 +140667,7 @@ func Xsqlite3WindowDup(tls *libc.TLS, db uintptr, pOwner uintptr, p uintptr) uin
// Return a copy of the linked list of Window objects passed as the
// second argument.
-func Xsqlite3WindowListDup(tls *libc.TLS, db uintptr, p uintptr) uintptr { /* sqlite3.c:157299:23: */
+func Xsqlite3WindowListDup(tls *libc.TLS, db uintptr, p uintptr) uintptr { /* sqlite3.c:158733:23: */
bp := tls.Alloc(4)
defer tls.Free(4)
@@ -138609,7 +140680,7 @@ func Xsqlite3WindowListDup(tls *libc.TLS, db uintptr, p uintptr) uintptr { /* sq
if *(*uintptr)(unsafe.Pointer(pp)) == uintptr(0) {
break
}
- pp = (*(*uintptr)(unsafe.Pointer(pp)) + 36 /* &.pNextWin */)
+ pp = *(*uintptr)(unsafe.Pointer(pp)) + 36
}
return *(*uintptr)(unsafe.Pointer(bp /* pRet */))
@@ -138621,7 +140692,7 @@ func Xsqlite3WindowListDup(tls *libc.TLS, db uintptr, p uintptr) uintptr { /* sq
//
// If an OOM error occurs, this function sets the Parse.db.mallocFailed
// flag and returns zero.
-func windowExprGtZero(tls *libc.TLS, pParse uintptr, pExpr uintptr) int32 { /* sqlite3.c:157321:12: */
+func windowExprGtZero(tls *libc.TLS, pParse uintptr, pExpr uintptr) int32 { /* sqlite3.c:158755:12: */
bp := tls.Alloc(4)
defer tls.Free(4)
@@ -138629,7 +140700,7 @@ func windowExprGtZero(tls *libc.TLS, pParse uintptr, pExpr uintptr) int32 { /* s
var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb
*(*uintptr)(unsafe.Pointer(bp /* pVal */)) = uintptr(0)
Xsqlite3ValueFromExpr(tls, db, pExpr, (*Sqlite3)(unsafe.Pointer(db)).Fenc, uint8(SQLITE_AFF_NUMERIC), bp /* &pVal */)
- if (*(*uintptr)(unsafe.Pointer(bp /* pVal */)) != 0) && (Xsqlite3_value_int(tls, *(*uintptr)(unsafe.Pointer(bp /* pVal */))) > 0) {
+ if *(*uintptr)(unsafe.Pointer(bp)) != 0 && Xsqlite3_value_int(tls, *(*uintptr)(unsafe.Pointer(bp))) > 0 {
ret = 1
}
Xsqlite3ValueFree(tls, *(*uintptr)(unsafe.Pointer(bp /* pVal */)))
@@ -138969,26 +141040,26 @@ func windowExprGtZero(tls *libc.TLS, pParse uintptr, pExpr uintptr) int32 { /* s
//
// The text above leaves out many details. Refer to the code and comments
// below for a more complete picture.
-func Xsqlite3WindowCodeStep(tls *libc.TLS, pParse uintptr, p uintptr, pWInfo uintptr, regGosub int32, addrGosub int32) { /* sqlite3.c:157668:21: */
+func Xsqlite3WindowCodeStep(tls *libc.TLS, pParse uintptr, p uintptr, pWInfo uintptr, regGosub int32, addrGosub int32) { /* sqlite3.c:159102:21: */
bp := tls.Alloc(56)
defer tls.Free(56)
var pMWin uintptr = (*Select)(unsafe.Pointer(p)).FpWin
var pOrderBy uintptr = (*Window)(unsafe.Pointer(pMWin)).FpOrderBy
var v uintptr = Xsqlite3GetVdbe(tls, pParse)
- var csrWrite int32 // Cursor used to write to eph. table
- var csrInput int32 = (*SrcItem)(unsafe.Pointer(((*Select)(unsafe.Pointer(p)).FpSrc + 8 /* &.a */))).FiCursor // Cursor of sub-select
- var nInput int32 = int32((*Table)(unsafe.Pointer((*SrcItem)(unsafe.Pointer(((*Select)(unsafe.Pointer(p)).FpSrc + 8 /* &.a */))).FpTab)).FnCol) // Number of cols returned by sub
- var iInput int32 // To iterate through sub cols
- var addrNe int32 // Address of OP_Ne
- var addrGosubFlush int32 = 0 // Address of OP_Gosub to flush:
- var addrInteger int32 = 0 // Address of OP_Integer
- var addrEmpty int32 // Address of OP_Rewind in flush:
- var regNew int32 // Array of registers holding new input row
- var regRecord int32 // regNew array in record form
- var regNewPeer int32 = 0 // Peer values for new row (part of regNew)
- var regPeer int32 = 0 // Peer values for current row
- var regFlushPart int32 = 0 // Register for "Gosub flush_partition"
+ var csrWrite int32 // Cursor used to write to eph. table
+ var csrInput int32 = (*SrcItem)(unsafe.Pointer((*Select)(unsafe.Pointer(p)).FpSrc + 8)).FiCursor // Cursor of sub-select
+ var nInput int32 = int32((*Table)(unsafe.Pointer((*SrcItem)(unsafe.Pointer((*Select)(unsafe.Pointer(p)).FpSrc + 8)).FpTab)).FnCol) // Number of cols returned by sub
+ var iInput int32 // To iterate through sub cols
+ var addrNe int32 // Address of OP_Ne
+ var addrGosubFlush int32 = 0 // Address of OP_Gosub to flush:
+ var addrInteger int32 = 0 // Address of OP_Integer
+ var addrEmpty int32 // Address of OP_Rewind in flush:
+ var regNew int32 // Array of registers holding new input row
+ var regRecord int32 // regNew array in record form
+ var regNewPeer int32 = 0 // Peer values for new row (part of regNew)
+ var regPeer int32 = 0 // Peer values for current row
+ var regFlushPart int32 = 0 // Register for "Gosub flush_partition"
// var s WindowCodeArg at bp, 56
// Context object for sub-routines
var lblWhereEnd int32 // Label just before sqlite3WhereEnd() code
@@ -139005,9 +141076,9 @@ func Xsqlite3WindowCodeStep(tls *libc.TLS, pParse uintptr, p uintptr, pWInfo uin
(*WindowCodeArg)(unsafe.Pointer(bp /* &s */)).FregGosub = regGosub
(*WindowCodeArg)(unsafe.Pointer(bp /* &s */)).FaddrGosub = addrGosub
(*WindowCodeArg)(unsafe.Pointer(bp /* &s */)).Fcurrent.Fcsr = (*Window)(unsafe.Pointer(pMWin)).FiEphCsr
- csrWrite = ((*WindowCodeArg)(unsafe.Pointer(bp /* &s */)).Fcurrent.Fcsr + 1)
- (*WindowCodeArg)(unsafe.Pointer(bp /* &s */)).Fstart.Fcsr = ((*WindowCodeArg)(unsafe.Pointer(bp /* &s */)).Fcurrent.Fcsr + 2)
- (*WindowCodeArg)(unsafe.Pointer(bp /* &s */)).Fend.Fcsr = ((*WindowCodeArg)(unsafe.Pointer(bp /* &s */)).Fcurrent.Fcsr + 3)
+ csrWrite = (*WindowCodeArg)(unsafe.Pointer(bp)).Fcurrent.Fcsr + 1
+ (*WindowCodeArg)(unsafe.Pointer(bp /* &s */)).Fstart.Fcsr = (*WindowCodeArg)(unsafe.Pointer(bp)).Fcurrent.Fcsr + 2
+ (*WindowCodeArg)(unsafe.Pointer(bp /* &s */)).Fend.Fcsr = (*WindowCodeArg)(unsafe.Pointer(bp)).Fcurrent.Fcsr + 3
// Figure out when rows may be deleted from the ephemeral table. There
// are four options - they may never be deleted (eDelete==0), they may
@@ -139017,16 +141088,16 @@ func Xsqlite3WindowCodeStep(tls *libc.TLS, pParse uintptr, p uintptr, pWInfo uin
// be deleted after they enter the frame (WINDOW_AGGSTEP).
switch int32((*Window)(unsafe.Pointer(pMWin)).FeStart) {
case TK_FOLLOWING:
- if (int32((*Window)(unsafe.Pointer(pMWin)).FeFrmType) != TK_RANGE) &&
- (windowExprGtZero(tls, pParse, (*Window)(unsafe.Pointer(pMWin)).FpStart) != 0) {
+ if int32((*Window)(unsafe.Pointer(pMWin)).FeFrmType) != TK_RANGE &&
+ windowExprGtZero(tls, pParse, (*Window)(unsafe.Pointer(pMWin)).FpStart) != 0 {
(*WindowCodeArg)(unsafe.Pointer(bp /* &s */)).FeDelete = WINDOW_RETURN_ROW
}
break
case TK_UNBOUNDED:
if windowCacheFrame(tls, pMWin) == 0 {
if int32((*Window)(unsafe.Pointer(pMWin)).FeEnd) == TK_PRECEDING {
- if (int32((*Window)(unsafe.Pointer(pMWin)).FeFrmType) != TK_RANGE) &&
- (windowExprGtZero(tls, pParse, (*Window)(unsafe.Pointer(pMWin)).FpEnd) != 0) {
+ if int32((*Window)(unsafe.Pointer(pMWin)).FeFrmType) != TK_RANGE &&
+ windowExprGtZero(tls, pParse, (*Window)(unsafe.Pointer(pMWin)).FpEnd) != 0 {
(*WindowCodeArg)(unsafe.Pointer(bp /* &s */)).FeDelete = WINDOW_AGGSTEP
}
} else {
@@ -139042,18 +141113,18 @@ func Xsqlite3WindowCodeStep(tls *libc.TLS, pParse uintptr, p uintptr, pWInfo uin
// Allocate registers for the array of values from the sub-query, the
// samve values in record form, and the rowid used to insert said record
// into the ephemeral table.
- regNew = ((*Parse)(unsafe.Pointer(pParse)).FnMem + 1)
- *(*int32)(unsafe.Pointer(pParse + 44 /* &.nMem */)) += (nInput)
+ regNew = (*Parse)(unsafe.Pointer(pParse)).FnMem + 1
+ *(*int32)(unsafe.Pointer(pParse + 44)) += nInput
regRecord = libc.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1)
(*WindowCodeArg)(unsafe.Pointer(bp /* &s */)).FregRowid = libc.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1)
// If the window frame contains an "<expr> PRECEDING" or "<expr> FOLLOWING"
// clause, allocate registers to store the results of evaluating each
// <expr>.
- if (int32((*Window)(unsafe.Pointer(pMWin)).FeStart) == TK_PRECEDING) || (int32((*Window)(unsafe.Pointer(pMWin)).FeStart) == TK_FOLLOWING) {
+ if int32((*Window)(unsafe.Pointer(pMWin)).FeStart) == TK_PRECEDING || int32((*Window)(unsafe.Pointer(pMWin)).FeStart) == TK_FOLLOWING {
regStart = libc.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1)
}
- if (int32((*Window)(unsafe.Pointer(pMWin)).FeEnd) == TK_PRECEDING) || (int32((*Window)(unsafe.Pointer(pMWin)).FeEnd) == TK_FOLLOWING) {
+ if int32((*Window)(unsafe.Pointer(pMWin)).FeEnd) == TK_PRECEDING || int32((*Window)(unsafe.Pointer(pMWin)).FeEnd) == TK_FOLLOWING {
regEnd = libc.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1)
}
@@ -139067,25 +141138,25 @@ func Xsqlite3WindowCodeStep(tls *libc.TLS, pParse uintptr, p uintptr, pWInfo uin
}
return 0
}()
- regNewPeer = (regNew + (*Window)(unsafe.Pointer(pMWin)).FnBufferCol)
+ regNewPeer = regNew + (*Window)(unsafe.Pointer(pMWin)).FnBufferCol
if (*Window)(unsafe.Pointer(pMWin)).FpPartition != 0 {
- regNewPeer = regNewPeer + ((*ExprList)(unsafe.Pointer((*Window)(unsafe.Pointer(pMWin)).FpPartition)).FnExpr)
+ regNewPeer = regNewPeer + (*ExprList)(unsafe.Pointer((*Window)(unsafe.Pointer(pMWin)).FpPartition)).FnExpr
}
- regPeer = ((*Parse)(unsafe.Pointer(pParse)).FnMem + 1)
- *(*int32)(unsafe.Pointer(pParse + 44 /* &.nMem */)) += (nPeer)
- (*WindowCodeArg)(unsafe.Pointer(bp /* &s */)).Fstart.Freg = ((*Parse)(unsafe.Pointer(pParse)).FnMem + 1)
- *(*int32)(unsafe.Pointer(pParse + 44 /* &.nMem */)) += (nPeer)
- (*WindowCodeArg)(unsafe.Pointer(bp /* &s */)).Fcurrent.Freg = ((*Parse)(unsafe.Pointer(pParse)).FnMem + 1)
- *(*int32)(unsafe.Pointer(pParse + 44 /* &.nMem */)) += (nPeer)
- (*WindowCodeArg)(unsafe.Pointer(bp /* &s */)).Fend.Freg = ((*Parse)(unsafe.Pointer(pParse)).FnMem + 1)
- *(*int32)(unsafe.Pointer(pParse + 44 /* &.nMem */)) += (nPeer)
+ regPeer = (*Parse)(unsafe.Pointer(pParse)).FnMem + 1
+ *(*int32)(unsafe.Pointer(pParse + 44)) += nPeer
+ (*WindowCodeArg)(unsafe.Pointer(bp /* &s */)).Fstart.Freg = (*Parse)(unsafe.Pointer(pParse)).FnMem + 1
+ *(*int32)(unsafe.Pointer(pParse + 44)) += nPeer
+ (*WindowCodeArg)(unsafe.Pointer(bp /* &s */)).Fcurrent.Freg = (*Parse)(unsafe.Pointer(pParse)).FnMem + 1
+ *(*int32)(unsafe.Pointer(pParse + 44)) += nPeer
+ (*WindowCodeArg)(unsafe.Pointer(bp /* &s */)).Fend.Freg = (*Parse)(unsafe.Pointer(pParse)).FnMem + 1
+ *(*int32)(unsafe.Pointer(pParse + 44)) += nPeer
}
// Load the column values for the row returned by the sub-select
// into an array of registers starting at regNew. Assemble them into
// a record in register regRecord.
for iInput = 0; iInput < nInput; iInput++ {
- Xsqlite3VdbeAddOp3(tls, v, OP_Column, csrInput, iInput, (regNew + iInput))
+ Xsqlite3VdbeAddOp3(tls, v, OP_Column, csrInput, iInput, regNew+iInput)
}
Xsqlite3VdbeAddOp3(tls, v, OP_MakeRecord, regNew, nInput, regRecord)
@@ -139098,17 +141169,17 @@ func Xsqlite3WindowCodeStep(tls *libc.TLS, pParse uintptr, p uintptr, pWInfo uin
var addr int32
var pPart uintptr = (*Window)(unsafe.Pointer(pMWin)).FpPartition
var nPart int32 = (*ExprList)(unsafe.Pointer(pPart)).FnExpr
- var regNewPart int32 = (regNew + (*Window)(unsafe.Pointer(pMWin)).FnBufferCol)
+ var regNewPart int32 = regNew + (*Window)(unsafe.Pointer(pMWin)).FnBufferCol
var pKeyInfo uintptr = Xsqlite3KeyInfoFromExprList(tls, pParse, pPart, 0, 0)
regFlushPart = libc.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1)
addr = Xsqlite3VdbeAddOp3(tls, v, OP_Compare, regNewPart, (*Window)(unsafe.Pointer(pMWin)).FregPart, nPart)
Xsqlite3VdbeAppendP4(tls, v, pKeyInfo, -9)
- Xsqlite3VdbeAddOp3(tls, v, OP_Jump, (addr + 2), (addr + 4), (addr + 2))
+ Xsqlite3VdbeAddOp3(tls, v, OP_Jump, addr+2, addr+4, addr+2)
addrGosubFlush = Xsqlite3VdbeAddOp1(tls, v, OP_Gosub, regFlushPart)
- Xsqlite3VdbeAddOp3(tls, v, OP_Copy, regNewPart, (*Window)(unsafe.Pointer(pMWin)).FregPart, (nPart - 1))
+ Xsqlite3VdbeAddOp3(tls, v, OP_Copy, regNewPart, (*Window)(unsafe.Pointer(pMWin)).FregPart, nPart-1)
}
// Insert the new row into the ephemeral table
@@ -139121,24 +141192,24 @@ func Xsqlite3WindowCodeStep(tls *libc.TLS, pParse uintptr, p uintptr, pWInfo uin
if regStart != 0 {
Xsqlite3ExprCode(tls, pParse, (*Window)(unsafe.Pointer(pMWin)).FpStart, regStart)
- windowCheckValue(tls, pParse, regStart, (0 + (func() int32 {
+ windowCheckValue(tls, pParse, regStart, 0+func() int32 {
if int32((*Window)(unsafe.Pointer(pMWin)).FeFrmType) == TK_RANGE {
return 3
}
return 0
- }())))
+ }())
}
if regEnd != 0 {
Xsqlite3ExprCode(tls, pParse, (*Window)(unsafe.Pointer(pMWin)).FpEnd, regEnd)
- windowCheckValue(tls, pParse, regEnd, (1 + (func() int32 {
+ windowCheckValue(tls, pParse, regEnd, 1+func() int32 {
if int32((*Window)(unsafe.Pointer(pMWin)).FeFrmType) == TK_RANGE {
return 3
}
return 0
- }())))
+ }())
}
- if ((int32((*Window)(unsafe.Pointer(pMWin)).FeFrmType) != TK_RANGE) && (int32((*Window)(unsafe.Pointer(pMWin)).FeStart) == int32((*Window)(unsafe.Pointer(pMWin)).FeEnd))) && (regStart != 0) {
+ if int32((*Window)(unsafe.Pointer(pMWin)).FeFrmType) != TK_RANGE && int32((*Window)(unsafe.Pointer(pMWin)).FeStart) == int32((*Window)(unsafe.Pointer(pMWin)).FeEnd) && regStart != 0 {
var op int32 = func() int32 {
if int32((*Window)(unsafe.Pointer(pMWin)).FeStart) == TK_FOLLOWING {
return OP_Ge
@@ -139156,7 +141227,7 @@ func Xsqlite3WindowCodeStep(tls *libc.TLS, pParse uintptr, p uintptr, pWInfo uin
Xsqlite3VdbeAddOp2(tls, v, OP_Goto, 0, lblWhereEnd)
Xsqlite3VdbeJumpHere(tls, v, addrGe)
}
- if ((int32((*Window)(unsafe.Pointer(pMWin)).FeStart) == TK_FOLLOWING) && (int32((*Window)(unsafe.Pointer(pMWin)).FeFrmType) != TK_RANGE)) && (regEnd != 0) {
+ if int32((*Window)(unsafe.Pointer(pMWin)).FeStart) == TK_FOLLOWING && int32((*Window)(unsafe.Pointer(pMWin)).FeFrmType) != TK_RANGE && regEnd != 0 {
Xsqlite3VdbeAddOp3(tls, v, OP_Subtract, regStart, regEnd, regStart)
}
@@ -139169,11 +141240,11 @@ func Xsqlite3WindowCodeStep(tls *libc.TLS, pParse uintptr, p uintptr, pWInfo uin
Xsqlite3VdbeAddOp2(tls, v, OP_Rewind, (*WindowCodeArg)(unsafe.Pointer(bp /* &s */)).Fend.Fcsr, 1)
- if (regPeer != 0) && (pOrderBy != 0) {
- Xsqlite3VdbeAddOp3(tls, v, OP_Copy, regNewPeer, regPeer, ((*ExprList)(unsafe.Pointer(pOrderBy)).FnExpr - 1))
- Xsqlite3VdbeAddOp3(tls, v, OP_Copy, regPeer, (*WindowCodeArg)(unsafe.Pointer(bp /* &s */)).Fstart.Freg, ((*ExprList)(unsafe.Pointer(pOrderBy)).FnExpr - 1))
- Xsqlite3VdbeAddOp3(tls, v, OP_Copy, regPeer, (*WindowCodeArg)(unsafe.Pointer(bp /* &s */)).Fcurrent.Freg, ((*ExprList)(unsafe.Pointer(pOrderBy)).FnExpr - 1))
- Xsqlite3VdbeAddOp3(tls, v, OP_Copy, regPeer, (*WindowCodeArg)(unsafe.Pointer(bp /* &s */)).Fend.Freg, ((*ExprList)(unsafe.Pointer(pOrderBy)).FnExpr - 1))
+ if regPeer != 0 && pOrderBy != 0 {
+ Xsqlite3VdbeAddOp3(tls, v, OP_Copy, regNewPeer, regPeer, (*ExprList)(unsafe.Pointer(pOrderBy)).FnExpr-1)
+ Xsqlite3VdbeAddOp3(tls, v, OP_Copy, regPeer, (*WindowCodeArg)(unsafe.Pointer(bp /* &s */)).Fstart.Freg, (*ExprList)(unsafe.Pointer(pOrderBy)).FnExpr-1)
+ Xsqlite3VdbeAddOp3(tls, v, OP_Copy, regPeer, (*WindowCodeArg)(unsafe.Pointer(bp /* &s */)).Fcurrent.Freg, (*ExprList)(unsafe.Pointer(pOrderBy)).FnExpr-1)
+ Xsqlite3VdbeAddOp3(tls, v, OP_Copy, regPeer, (*WindowCodeArg)(unsafe.Pointer(bp /* &s */)).Fend.Freg, (*ExprList)(unsafe.Pointer(pOrderBy)).FnExpr-1)
}
Xsqlite3VdbeAddOp2(tls, v, OP_Goto, 0, lblWhereEnd)
@@ -139201,7 +141272,7 @@ func Xsqlite3WindowCodeStep(tls *libc.TLS, pParse uintptr, p uintptr, pWInfo uin
}
}
} else if int32((*Window)(unsafe.Pointer(pMWin)).FeEnd) == TK_PRECEDING {
- var bRPS int32 = (libc.Bool32((int32((*Window)(unsafe.Pointer(pMWin)).FeStart) == TK_PRECEDING) && (int32((*Window)(unsafe.Pointer(pMWin)).FeFrmType) == TK_RANGE)))
+ var bRPS int32 = libc.Bool32(int32((*Window)(unsafe.Pointer(pMWin)).FeStart) == TK_PRECEDING && int32((*Window)(unsafe.Pointer(pMWin)).FeFrmType) == TK_RANGE)
windowCodeOp(tls, bp /* &s */, WINDOW_AGGSTEP, regEnd, 0)
if bRPS != 0 {
windowCodeOp(tls, bp /* &s */, WINDOW_AGGINVERSE, regStart, 0)
@@ -139255,7 +141326,7 @@ func Xsqlite3WindowCodeStep(tls *libc.TLS, pParse uintptr, p uintptr, pWInfo uin
addrEmpty = Xsqlite3VdbeAddOp1(tls, v, OP_Rewind, csrWrite)
if int32((*Window)(unsafe.Pointer(pMWin)).FeEnd) == TK_PRECEDING {
- var bRPS int32 = (libc.Bool32((int32((*Window)(unsafe.Pointer(pMWin)).FeStart) == TK_PRECEDING) && (int32((*Window)(unsafe.Pointer(pMWin)).FeFrmType) == TK_RANGE)))
+ var bRPS int32 = libc.Bool32(int32((*Window)(unsafe.Pointer(pMWin)).FeStart) == TK_PRECEDING && int32((*Window)(unsafe.Pointer(pMWin)).FeFrmType) == TK_RANGE)
windowCodeOp(tls, bp /* &s */, WINDOW_AGGSTEP, regEnd, 0)
if bRPS != 0 {
windowCodeOp(tls, bp /* &s */, WINDOW_AGGINVERSE, regStart, 0)
@@ -139365,16 +141436,16 @@ func Xsqlite3WindowCodeStep(tls *libc.TLS, pParse uintptr, p uintptr, pWInfo uin
type TrigEvent = struct {
Fa int32
Fb uintptr
-} /* sqlite3.c:158068:1 */
+} /* sqlite3.c:159502:1 */
type FrameBound = struct {
FeType int32
FpExpr uintptr
-} /* sqlite3.c:158070:1 */
+} /* sqlite3.c:159504:1 */
// Disable lookaside memory allocation for objects that might be
// shared across database connections.
-func disableLookaside(tls *libc.TLS, pParse uintptr) { /* sqlite3.c:158076:13: */
+func disableLookaside(tls *libc.TLS, pParse uintptr) { /* sqlite3.c:159510:13: */
var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb
(*Parse)(unsafe.Pointer(pParse)).FdisableLookaside++
(*Sqlite3)(unsafe.Pointer(db)).Flookaside.FbDisable++
@@ -139384,7 +141455,7 @@ func disableLookaside(tls *libc.TLS, pParse uintptr) { /* sqlite3.c:158076:13: *
// For a compound SELECT statement, make sure p->pPrior->pNext==p for
// all elements in the list. And make sure list length does not exceed
// SQLITE_LIMIT_COMPOUND_SELECT.
-func parserDoubleLinkSelect(tls *libc.TLS, pParse uintptr, p uintptr) { /* sqlite3.c:158109:15: */
+func parserDoubleLinkSelect(tls *libc.TLS, pParse uintptr, p uintptr) { /* sqlite3.c:159543:15: */
bp := tls.Alloc(16)
defer tls.Free(16)
@@ -139395,27 +141466,27 @@ func parserDoubleLinkSelect(tls *libc.TLS, pParse uintptr, p uintptr) { /* sqlit
var cnt int32 = 1
for 1 != 0 {
(*Select)(unsafe.Pointer(pLoop)).FpNext = pNext
- *(*U32)(unsafe.Pointer(pLoop + 4 /* &.selFlags */)) |= (U32(SF_Compound))
+ *(*U32)(unsafe.Pointer(pLoop + 4)) |= U32(SF_Compound)
pNext = pLoop
pLoop = (*Select)(unsafe.Pointer(pLoop)).FpPrior
if pLoop == uintptr(0) {
break
}
cnt++
- if ((*Select)(unsafe.Pointer(pLoop)).FpOrderBy != 0) || ((*Select)(unsafe.Pointer(pLoop)).FpLimit != 0) {
- Xsqlite3ErrorMsg(tls, pParse, ts+21097, /* "%s clause should..." */
+ if (*Select)(unsafe.Pointer(pLoop)).FpOrderBy != 0 || (*Select)(unsafe.Pointer(pLoop)).FpLimit != 0 {
+ Xsqlite3ErrorMsg(tls, pParse, ts+22394, /* "%s clause should..." */
libc.VaList(bp, func() uintptr {
if (*Select)(unsafe.Pointer(pLoop)).FpOrderBy != uintptr(0) {
- return ts + 18211 /* "ORDER BY" */
+ return ts + 19508 /* "ORDER BY" */
}
- return ts + 21139 /* "LIMIT" */
+ return ts + 22436 /* "LIMIT" */
}(),
Xsqlite3SelectOpName(tls, int32((*Select)(unsafe.Pointer(pNext)).Fop))))
break
}
}
- if ((((*Select)(unsafe.Pointer(p)).FselFlags & U32(SF_MultiValue)) == U32(0)) && ((libc.AssignInt32(&mxSelect, *(*int32)(unsafe.Pointer(((*Parse)(unsafe.Pointer(pParse)).Fdb + 112 /* &.aLimit */) + 4*4)))) > 0)) && (cnt > mxSelect) {
- Xsqlite3ErrorMsg(tls, pParse, ts+21145 /* "too many terms i..." */, 0)
+ if (*Select)(unsafe.Pointer(p)).FselFlags&U32(SF_MultiValue) == U32(0) && libc.AssignInt32(&mxSelect, *(*int32)(unsafe.Pointer((*Parse)(unsafe.Pointer(pParse)).Fdb + 120 + 4*4))) > 0 && cnt > mxSelect {
+ Xsqlite3ErrorMsg(tls, pParse, ts+22442 /* "too many terms i..." */, 0)
}
}
@@ -139423,7 +141494,7 @@ func parserDoubleLinkSelect(tls *libc.TLS, pParse uintptr, p uintptr) { /* sqlit
// Attach a With object describing the WITH clause to a Select
// object describing the query for which the WITH clause is a prefix.
-func attachWithToSelect(tls *libc.TLS, pParse uintptr, pSelect uintptr, pWith uintptr) uintptr { /* sqlite3.c:158140:17: */
+func attachWithToSelect(tls *libc.TLS, pParse uintptr, pSelect uintptr, pWith uintptr) uintptr { /* sqlite3.c:159574:17: */
if pSelect != 0 {
(*Select)(unsafe.Pointer(pSelect)).FpWith = pWith
parserDoubleLinkSelect(tls, pParse, pSelect)
@@ -139437,12 +141508,12 @@ func attachWithToSelect(tls *libc.TLS, pParse uintptr, pSelect uintptr, pWith ui
// Construct a new Expr object from a single identifier. Use the
// new Expr to populate pOut. Set the span of pOut to be the identifier
// that created the expression.
-func tokenExpr(tls *libc.TLS, pParse uintptr, op int32, t Token) uintptr { /* sqlite3.c:158155:15: */
+func tokenExpr(tls *libc.TLS, pParse uintptr, op int32, t Token) uintptr { /* sqlite3.c:159589:15: */
bp := tls.Alloc(8)
defer tls.Free(8)
*(*Token)(unsafe.Pointer(bp)) = t
- var p uintptr = Xsqlite3DbMallocRawNN(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, (uint64((uint32(unsafe.Sizeof(Expr{})) + (*Token)(unsafe.Pointer(bp /* &t */)).Fn) + uint32(1))))
+ var p uintptr = Xsqlite3DbMallocRawNN(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, uint64(uint32(unsafe.Sizeof(Expr{}))+(*Token)(unsafe.Pointer(bp)).Fn+uint32(1)))
if p != 0 {
// memset(p, 0, sizeof(Expr));
(*Expr)(unsafe.Pointer(p)).Fop = U8(op)
@@ -139450,17 +141521,20 @@ func tokenExpr(tls *libc.TLS, pParse uintptr, op int32, t Token) uintptr { /* sq
(*Expr)(unsafe.Pointer(p)).Fflags = U32(EP_Leaf)
(*Expr)(unsafe.Pointer(p)).FiAgg = int16(-1)
- (*Expr)(unsafe.Pointer(p)).FpLeft = libc.AssignPtrUintptr(p+16 /* &.pRight */, uintptr(0))
- *(*uintptr)(unsafe.Pointer(p + 20 /* &.x */)) = uintptr(0)
+ (*Expr)(unsafe.Pointer(p)).FpLeft = libc.AssignPtrUintptr(p+16, uintptr(0))
(*Expr)(unsafe.Pointer(p)).FpAggInfo = uintptr(0)
- *(*uintptr)(unsafe.Pointer(p + 44 /* &.y */)) = uintptr(0)
+ libc.Xmemset(tls, p+20, 0, uint32(unsafe.Sizeof(struct{ FpList uintptr }{})))
+ libc.Xmemset(tls, p+44, 0, uint32(unsafe.Sizeof(struct {
+ FpTab uintptr
+ F__ccgo_pad1 [4]byte
+ }{})))
(*Expr)(unsafe.Pointer(p)).Fop2 = U8(0)
(*Expr)(unsafe.Pointer(p)).FiTable = 0
(*Expr)(unsafe.Pointer(p)).FiColumn = int16(0)
- *(*uintptr)(unsafe.Pointer(p + 8 /* &.u */)) = (p + 1*52)
- libc.Xmemcpy(tls, *(*uintptr)(unsafe.Pointer(p + 8 /* &.u */)), (*Token)(unsafe.Pointer(bp /* &t */)).Fz, (*Token)(unsafe.Pointer(bp /* &t */)).Fn)
- *(*uint8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(p + 8 /* &.u */)) + uintptr((*Token)(unsafe.Pointer(bp /* &t */)).Fn))) = uint8(0)
- if (int32(Xsqlite3CtypeMap[uint8(*(*uint8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(p + 8 /* &.u */)))))]) & 0x80) != 0 {
+ *(*uintptr)(unsafe.Pointer(p + 8)) = p + 1*52
+ libc.Xmemcpy(tls, *(*uintptr)(unsafe.Pointer(p + 8)), (*Token)(unsafe.Pointer(bp /* &t */)).Fz, (*Token)(unsafe.Pointer(bp /* &t */)).Fn)
+ *(*uint8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(p + 8)) + uintptr((*Token)(unsafe.Pointer(bp /* &t */)).Fn))) = uint8(0)
+ if int32(Xsqlite3CtypeMap[uint8(*(*uint8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(p + 8)))))])&0x80 != 0 {
Xsqlite3DequoteExpr(tls, p)
}
(*Expr)(unsafe.Pointer(p)).FnHeight = 1
@@ -139474,9 +141548,9 @@ func tokenExpr(tls *libc.TLS, pParse uintptr, op int32, t Token) uintptr { /* sq
// A routine to convert a binary TK_IS or TK_ISNOT expression into a
// unary TK_ISNULL or TK_NOTNULL expression.
-func binaryToUnaryIfNull(tls *libc.TLS, pParse uintptr, pY uintptr, pA uintptr, op int32) { /* sqlite3.c:158190:15: */
+func binaryToUnaryIfNull(tls *libc.TLS, pParse uintptr, pY uintptr, pA uintptr, op int32) { /* sqlite3.c:159624:15: */
var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb
- if (((pA != 0) && (pY != 0)) && (int32((*Expr)(unsafe.Pointer(pY)).Fop) == TK_NULL)) && !(int32((*Parse)(unsafe.Pointer(pParse)).FeParseMode) >= PARSE_MODE_RENAME) {
+ if pA != 0 && pY != 0 && int32((*Expr)(unsafe.Pointer(pY)).Fop) == TK_NULL && !(int32((*Parse)(unsafe.Pointer(pParse)).FeParseMode) >= PARSE_MODE_RENAME) {
(*Expr)(unsafe.Pointer(pA)).Fop = U8(op)
Xsqlite3ExprDelete(tls, db, (*Expr)(unsafe.Pointer(pA)).FpRight)
(*Expr)(unsafe.Pointer(pA)).FpRight = uintptr(0)
@@ -139488,14 +141562,14 @@ func binaryToUnaryIfNull(tls *libc.TLS, pParse uintptr, pY uintptr, pA uintptr,
// list of identifiers. Report an error if the ID list contains
// a COLLATE clause or an ASC or DESC keyword, except ignore the
// error while parsing a legacy schema.
-func parserAddExprIdListTerm(tls *libc.TLS, pParse uintptr, pPrior uintptr, pIdToken uintptr, hasCollate int32, sortOrder int32) uintptr { /* sqlite3.c:158204:19: */
+func parserAddExprIdListTerm(tls *libc.TLS, pParse uintptr, pPrior uintptr, pIdToken uintptr, hasCollate int32, sortOrder int32) uintptr { /* sqlite3.c:159638:19: */
bp := tls.Alloc(16)
defer tls.Free(16)
var p uintptr = Xsqlite3ExprListAppend(tls, pParse, pPrior, uintptr(0))
- if ((hasCollate != 0) || (sortOrder != -1)) &&
- (int32((*Sqlite3)(unsafe.Pointer((*Parse)(unsafe.Pointer(pParse)).Fdb)).Finit.Fbusy) == 0) {
- Xsqlite3ErrorMsg(tls, pParse, ts+21179, /* "syntax error aft..." */
+ if (hasCollate != 0 || sortOrder != -1) &&
+ int32((*Sqlite3)(unsafe.Pointer((*Parse)(unsafe.Pointer(pParse)).Fdb)).Finit.Fbusy) == 0 {
+ Xsqlite3ErrorMsg(tls, pParse, ts+22476, /* "syntax error aft..." */
libc.VaList(bp, (*Token)(unsafe.Pointer(pIdToken)).Fn, (*Token)(unsafe.Pointer(pIdToken)).Fz))
}
Xsqlite3ExprListSetName(tls, pParse, p, pIdToken, 1)
@@ -139562,7 +141636,7 @@ func parserAddExprIdListTerm(tls *libc.TLS, pParse uintptr, pPrior uintptr, pIdT
type YYMINORTYPE = struct {
Fyyinit int32
F__ccgo_pad1 [4]byte
-} /* sqlite3.c:158494:3 */
+} /* sqlite3.c:159929:3 */
//************ End control #defines ******************************************
// Define the yytestcase() macro to be a no-op if is not already defined
@@ -139623,440 +141697,443 @@ type YYMINORTYPE = struct {
// yy_default[] Default action for each state.
//
// Begin parsing tables *********************************************
-var yy_action = [2023]uint16{
- /* 0 */ uint16(563), uint16(1295), uint16(563), uint16(1274), uint16(168), uint16(1257), uint16(115), uint16(112), uint16(218), uint16(373),
- /* 10 */ uint16(563), uint16(1295), uint16(374), uint16(563), uint16(488), uint16(563), uint16(115), uint16(112), uint16(218), uint16(406),
- /* 20 */ uint16(1300), uint16(1300), uint16(41), uint16(41), uint16(41), uint16(41), uint16(514), uint16(1504), uint16(520), uint16(1298),
- /* 30 */ uint16(1298), uint16(959), uint16(41), uint16(41), uint16(1260), uint16(71), uint16(71), uint16(51), uint16(51), uint16(960),
- /* 40 */ uint16(557), uint16(557), uint16(557), uint16(122), uint16(123), uint16(113), uint16(1200), uint16(1200), uint16(1035), uint16(1038),
- /* 50 */ uint16(1028), uint16(1028), uint16(120), uint16(120), uint16(121), uint16(121), uint16(121), uint16(121), uint16(414), uint16(406),
- /* 60 */ uint16(273), uint16(273), uint16(273), uint16(273), uint16(115), uint16(112), uint16(218), uint16(115), uint16(112), uint16(218),
- /* 70 */ uint16(197), uint16(268), uint16(545), uint16(560), uint16(515), uint16(560), uint16(211), uint16(563), uint16(385), uint16(248),
- /* 80 */ uint16(215), uint16(521), uint16(399), uint16(122), uint16(123), uint16(113), uint16(1200), uint16(1200), uint16(1035), uint16(1038),
- /* 90 */ uint16(1028), uint16(1028), uint16(120), uint16(120), uint16(121), uint16(121), uint16(121), uint16(121), uint16(540), uint16(13),
- /* 100 */ uint16(13), uint16(1259), uint16(119), uint16(119), uint16(119), uint16(119), uint16(118), uint16(118), uint16(117), uint16(117),
- /* 110 */ uint16(117), uint16(116), uint16(441), uint16(1176), uint16(419), uint16(197), uint16(446), uint16(320), uint16(512), uint16(1539),
- /* 120 */ uint16(1545), uint16(372), uint16(1547), uint16(6), uint16(371), uint16(1176), uint16(1148), uint16(394), uint16(1148), uint16(406),
- /* 130 */ uint16(1545), uint16(534), uint16(115), uint16(112), uint16(218), uint16(1415), uint16(99), uint16(30), uint16(121), uint16(121),
+var yy_action = [2037]uint16{
+ /* 0 */ uint16(564), uint16(115), uint16(112), uint16(220), uint16(169), uint16(199), uint16(115), uint16(112), uint16(220), uint16(564),
+ /* 10 */ uint16(375), uint16(1266), uint16(564), uint16(376), uint16(564), uint16(270), uint16(1309), uint16(1309), uint16(406), uint16(407),
+ /* 20 */ uint16(1084), uint16(199), uint16(1513), uint16(41), uint16(41), uint16(515), uint16(489), uint16(521), uint16(558), uint16(558),
+ /* 30 */ uint16(558), uint16(965), uint16(41), uint16(41), uint16(395), uint16(41), uint16(41), uint16(51), uint16(51), uint16(966),
+ /* 40 */ uint16(296), uint16(1269), uint16(296), uint16(122), uint16(123), uint16(113), uint16(1207), uint16(1207), uint16(1041), uint16(1044),
+ /* 50 */ uint16(1034), uint16(1034), uint16(120), uint16(120), uint16(121), uint16(121), uint16(121), uint16(121), uint16(564), uint16(407),
+ /* 60 */ uint16(275), uint16(275), uint16(275), uint16(275), uint16(1268), uint16(115), uint16(112), uint16(220), uint16(115), uint16(112),
+ /* 70 */ uint16(220), uint16(1512), uint16(846), uint16(561), uint16(516), uint16(561), uint16(115), uint16(112), uint16(220), uint16(250),
+ /* 80 */ uint16(217), uint16(71), uint16(71), uint16(122), uint16(123), uint16(113), uint16(1207), uint16(1207), uint16(1041), uint16(1044),
+ /* 90 */ uint16(1034), uint16(1034), uint16(120), uint16(120), uint16(121), uint16(121), uint16(121), uint16(121), uint16(440), uint16(440),
+ /* 100 */ uint16(440), uint16(1149), uint16(119), uint16(119), uint16(119), uint16(119), uint16(118), uint16(118), uint16(117), uint16(117),
+ /* 110 */ uint16(117), uint16(116), uint16(442), uint16(1183), uint16(1149), uint16(116), uint16(442), uint16(1149), uint16(546), uint16(513),
+ /* 120 */ uint16(1548), uint16(1554), uint16(374), uint16(442), uint16(6), uint16(1183), uint16(1154), uint16(522), uint16(1154), uint16(407),
+ /* 130 */ uint16(1556), uint16(461), uint16(373), uint16(1554), uint16(535), uint16(99), uint16(463), uint16(332), uint16(121), uint16(121),
/* 140 */ uint16(121), uint16(121), uint16(119), uint16(119), uint16(119), uint16(119), uint16(118), uint16(118), uint16(117), uint16(117),
- /* 150 */ uint16(117), uint16(116), uint16(441), uint16(122), uint16(123), uint16(113), uint16(1200), uint16(1200), uint16(1035), uint16(1038),
- /* 160 */ uint16(1028), uint16(1028), uint16(120), uint16(120), uint16(121), uint16(121), uint16(121), uint16(121), uint16(31), uint16(1176),
- /* 170 */ uint16(1177), uint16(1178), uint16(241), uint16(357), uint16(1558), uint16(501), uint16(498), uint16(497), uint16(317), uint16(124),
- /* 180 */ uint16(319), uint16(1176), uint16(1177), uint16(1178), uint16(1176), uint16(496), uint16(119), uint16(119), uint16(119), uint16(119),
- /* 190 */ uint16(118), uint16(118), uint16(117), uint16(117), uint16(117), uint16(116), uint16(441), uint16(139), uint16(96), uint16(406),
- /* 200 */ uint16(121), uint16(121), uint16(121), uint16(121), uint16(114), uint16(117), uint16(117), uint16(117), uint16(116), uint16(441),
- /* 210 */ uint16(541), uint16(1532), uint16(119), uint16(119), uint16(119), uint16(119), uint16(118), uint16(118), uint16(117), uint16(117),
- /* 220 */ uint16(117), uint16(116), uint16(441), uint16(122), uint16(123), uint16(113), uint16(1200), uint16(1200), uint16(1035), uint16(1038),
- /* 230 */ uint16(1028), uint16(1028), uint16(120), uint16(120), uint16(121), uint16(121), uint16(121), uint16(121), uint16(406), uint16(441),
- /* 240 */ uint16(1176), uint16(1177), uint16(1178), uint16(81), uint16(439), uint16(439), uint16(439), uint16(80), uint16(119), uint16(119),
- /* 250 */ uint16(119), uint16(119), uint16(118), uint16(118), uint16(117), uint16(117), uint16(117), uint16(116), uint16(441), uint16(488),
- /* 260 */ uint16(1176), uint16(318), uint16(122), uint16(123), uint16(113), uint16(1200), uint16(1200), uint16(1035), uint16(1038), uint16(1028),
- /* 270 */ uint16(1028), uint16(120), uint16(120), uint16(121), uint16(121), uint16(121), uint16(121), uint16(493), uint16(1025), uint16(1025),
- /* 280 */ uint16(1036), uint16(1039), uint16(119), uint16(119), uint16(119), uint16(119), uint16(118), uint16(118), uint16(117), uint16(117),
- /* 290 */ uint16(117), uint16(116), uint16(441), uint16(1584), uint16(995), uint16(1224), uint16(1), uint16(1), uint16(569), uint16(2),
- /* 300 */ uint16(1228), uint16(1267), uint16(137), uint16(1503), uint16(245), uint16(305), uint16(473), uint16(140), uint16(406), uint16(860),
- /* 310 */ uint16(561), uint16(1176), uint16(914), uint16(914), uint16(1308), uint16(359), uint16(1176), uint16(1177), uint16(1178), uint16(462),
- /* 320 */ uint16(330), uint16(119), uint16(119), uint16(119), uint16(119), uint16(118), uint16(118), uint16(117), uint16(117), uint16(117),
- /* 330 */ uint16(116), uint16(441), uint16(122), uint16(123), uint16(113), uint16(1200), uint16(1200), uint16(1035), uint16(1038), uint16(1028),
- /* 340 */ uint16(1028), uint16(120), uint16(120), uint16(121), uint16(121), uint16(121), uint16(121), uint16(328), uint16(273), uint16(273),
- /* 350 */ uint16(1015), uint16(83), uint16(1029), uint16(425), uint16(1564), uint16(569), uint16(2), uint16(1228), uint16(304), uint16(554),
- /* 360 */ uint16(925), uint16(560), uint16(305), uint16(944), uint16(140), uint16(860), uint16(1006), uint16(1176), uint16(1177), uint16(1178),
- /* 370 */ uint16(1005), uint16(1308), uint16(411), uint16(213), uint16(511), uint16(229), uint16(119), uint16(119), uint16(119), uint16(119),
- /* 380 */ uint16(118), uint16(118), uint16(117), uint16(117), uint16(117), uint16(116), uint16(441), uint16(519), uint16(347), uint16(116),
- /* 390 */ uint16(441), uint16(119), uint16(119), uint16(119), uint16(119), uint16(118), uint16(118), uint16(117), uint16(117), uint16(117),
- /* 400 */ uint16(116), uint16(441), uint16(1005), uint16(1005), uint16(1007), uint16(273), uint16(273), uint16(445), uint16(563), uint16(16),
- /* 410 */ uint16(16), uint16(1590), uint16(563), uint16(1540), uint16(563), uint16(406), uint16(1176), uint16(6), uint16(560), uint16(344),
- /* 420 */ uint16(182), uint16(118), uint16(118), uint16(117), uint16(117), uint16(117), uint16(116), uint16(441), uint16(416), uint16(142),
- /* 430 */ uint16(71), uint16(71), uint16(229), uint16(563), uint16(71), uint16(71), uint16(55), uint16(55), uint16(203), uint16(122),
- /* 440 */ uint16(123), uint16(113), uint16(1200), uint16(1200), uint16(1035), uint16(1038), uint16(1028), uint16(1028), uint16(120), uint16(120),
- /* 450 */ uint16(121), uint16(121), uint16(121), uint16(121), uint16(217), uint16(13), uint16(13), uint16(1176), uint16(406), uint16(568),
- /* 460 */ uint16(1400), uint16(1228), uint16(502), uint16(137), uint16(445), uint16(168), uint16(305), uint16(545), uint16(140), uint16(1180),
- /* 470 */ uint16(424), uint16(545), uint16(1176), uint16(1177), uint16(1178), uint16(1308), uint16(544), uint16(438), uint16(437), uint16(944),
- /* 480 */ uint16(513), uint16(452), uint16(122), uint16(123), uint16(113), uint16(1200), uint16(1200), uint16(1035), uint16(1038), uint16(1028),
- /* 490 */ uint16(1028), uint16(120), uint16(120), uint16(121), uint16(121), uint16(121), uint16(121), uint16(315), uint16(119), uint16(119),
- /* 500 */ uint16(119), uint16(119), uint16(118), uint16(118), uint16(117), uint16(117), uint16(117), uint16(116), uint16(441), uint16(273),
- /* 510 */ uint16(273), uint16(1143), uint16(416), uint16(1176), uint16(1177), uint16(1178), uint16(543), uint16(563), uint16(1143), uint16(304),
- /* 520 */ uint16(554), uint16(1561), uint16(560), uint16(1207), uint16(1143), uint16(1207), uint16(1180), uint16(1143), uint16(406), uint16(530),
- /* 530 */ uint16(421), uint16(1143), uint16(864), uint16(183), uint16(1143), uint16(143), uint16(229), uint16(562), uint16(32), uint16(71),
- /* 540 */ uint16(71), uint16(119), uint16(119), uint16(119), uint16(119), uint16(118), uint16(118), uint16(117), uint16(117), uint16(117),
- /* 550 */ uint16(116), uint16(441), uint16(122), uint16(123), uint16(113), uint16(1200), uint16(1200), uint16(1035), uint16(1038), uint16(1028),
- /* 560 */ uint16(1028), uint16(120), uint16(120), uint16(121), uint16(121), uint16(121), uint16(121), uint16(406), uint16(445), uint16(241),
- /* 570 */ uint16(1176), uint16(857), uint16(501), uint16(498), uint16(497), uint16(1176), uint16(526), uint16(189), uint16(245), uint16(538),
- /* 580 */ uint16(1539), uint16(282), uint16(496), uint16(370), uint16(6), uint16(563), uint16(529), uint16(477), uint16(5), uint16(279),
- /* 590 */ uint16(1015), uint16(122), uint16(123), uint16(113), uint16(1200), uint16(1200), uint16(1035), uint16(1038), uint16(1028), uint16(1028),
- /* 600 */ uint16(120), uint16(120), uint16(121), uint16(121), uint16(121), uint16(121), uint16(1006), uint16(13), uint16(13), uint16(1414),
- /* 610 */ uint16(1005), uint16(119), uint16(119), uint16(119), uint16(119), uint16(118), uint16(118), uint16(117), uint16(117), uint16(117),
- /* 620 */ uint16(116), uint16(441), uint16(426), uint16(273), uint16(273), uint16(1176), uint16(1176), uint16(1177), uint16(1178), uint16(1619),
- /* 630 */ uint16(392), uint16(1176), uint16(1177), uint16(1178), uint16(1176), uint16(342), uint16(560), uint16(406), uint16(525), uint16(361),
- /* 640 */ uint16(430), uint16(1161), uint16(1005), uint16(1005), uint16(1007), uint16(348), uint16(411), uint16(357), uint16(1558), uint16(488),
+ /* 150 */ uint16(117), uint16(116), uint16(442), uint16(122), uint16(123), uint16(113), uint16(1207), uint16(1207), uint16(1041), uint16(1044),
+ /* 160 */ uint16(1034), uint16(1034), uint16(120), uint16(120), uint16(121), uint16(121), uint16(121), uint16(121), uint16(1257), uint16(1183),
+ /* 170 */ uint16(1184), uint16(1185), uint16(243), uint16(1064), uint16(564), uint16(502), uint16(499), uint16(498), uint16(567), uint16(124),
+ /* 180 */ uint16(567), uint16(1183), uint16(1184), uint16(1185), uint16(474), uint16(497), uint16(119), uint16(119), uint16(119), uint16(119),
+ /* 190 */ uint16(118), uint16(118), uint16(117), uint16(117), uint16(117), uint16(116), uint16(442), uint16(70), uint16(70), uint16(407),
+ /* 200 */ uint16(121), uint16(121), uint16(121), uint16(121), uint16(114), uint16(117), uint16(117), uint16(117), uint16(116), uint16(442),
+ /* 210 */ uint16(1409), uint16(1469), uint16(119), uint16(119), uint16(119), uint16(119), uint16(118), uint16(118), uint16(117), uint16(117),
+ /* 220 */ uint16(117), uint16(116), uint16(442), uint16(122), uint16(123), uint16(113), uint16(1207), uint16(1207), uint16(1041), uint16(1044),
+ /* 230 */ uint16(1034), uint16(1034), uint16(120), uint16(120), uint16(121), uint16(121), uint16(121), uint16(121), uint16(407), uint16(1031),
+ /* 240 */ uint16(1031), uint16(1042), uint16(1045), uint16(81), uint16(382), uint16(541), uint16(378), uint16(80), uint16(119), uint16(119),
+ /* 250 */ uint16(119), uint16(119), uint16(118), uint16(118), uint16(117), uint16(117), uint16(117), uint16(116), uint16(442), uint16(381),
+ /* 260 */ uint16(463), uint16(332), uint16(122), uint16(123), uint16(113), uint16(1207), uint16(1207), uint16(1041), uint16(1044), uint16(1034),
+ /* 270 */ uint16(1034), uint16(120), uint16(120), uint16(121), uint16(121), uint16(121), uint16(121), uint16(262), uint16(215), uint16(512),
+ /* 280 */ uint16(1424), uint16(422), uint16(119), uint16(119), uint16(119), uint16(119), uint16(118), uint16(118), uint16(117), uint16(117),
+ /* 290 */ uint16(117), uint16(116), uint16(442), uint16(1231), uint16(1), uint16(1), uint16(571), uint16(2), uint16(1235), uint16(1573),
+ /* 300 */ uint16(571), uint16(2), uint16(1235), uint16(307), uint16(1149), uint16(141), uint16(1600), uint16(307), uint16(407), uint16(141),
+ /* 310 */ uint16(1183), uint16(361), uint16(1317), uint16(1035), uint16(866), uint16(531), uint16(1317), uint16(1149), uint16(359), uint16(1567),
+ /* 320 */ uint16(1149), uint16(119), uint16(119), uint16(119), uint16(119), uint16(118), uint16(118), uint16(117), uint16(117), uint16(117),
+ /* 330 */ uint16(116), uint16(442), uint16(122), uint16(123), uint16(113), uint16(1207), uint16(1207), uint16(1041), uint16(1044), uint16(1034),
+ /* 340 */ uint16(1034), uint16(120), uint16(120), uint16(121), uint16(121), uint16(121), uint16(121), uint16(275), uint16(275), uint16(1001),
+ /* 350 */ uint16(426), uint16(275), uint16(275), uint16(1128), uint16(1627), uint16(1021), uint16(1627), uint16(137), uint16(542), uint16(1541),
+ /* 360 */ uint16(561), uint16(272), uint16(950), uint16(950), uint16(561), uint16(1423), uint16(1183), uint16(1184), uint16(1185), uint16(1594),
+ /* 370 */ uint16(866), uint16(1012), uint16(530), uint16(315), uint16(231), uint16(1011), uint16(468), uint16(1276), uint16(231), uint16(119),
+ /* 380 */ uint16(119), uint16(119), uint16(119), uint16(118), uint16(118), uint16(117), uint16(117), uint16(117), uint16(116), uint16(442),
+ /* 390 */ uint16(1570), uint16(119), uint16(119), uint16(119), uint16(119), uint16(118), uint16(118), uint16(117), uint16(117), uint16(117),
+ /* 400 */ uint16(116), uint16(442), uint16(330), uint16(359), uint16(1567), uint16(564), uint16(446), uint16(1011), uint16(1011), uint16(1013),
+ /* 410 */ uint16(446), uint16(207), uint16(564), uint16(306), uint16(555), uint16(407), uint16(363), uint16(1021), uint16(363), uint16(346),
+ /* 420 */ uint16(184), uint16(118), uint16(118), uint16(117), uint16(117), uint16(117), uint16(116), uint16(442), uint16(71), uint16(71),
+ /* 430 */ uint16(439), uint16(438), uint16(1126), uint16(1012), uint16(472), uint16(71), uint16(71), uint16(1011), uint16(205), uint16(122),
+ /* 440 */ uint16(123), uint16(113), uint16(1207), uint16(1207), uint16(1041), uint16(1044), uint16(1034), uint16(1034), uint16(120), uint16(120),
+ /* 450 */ uint16(121), uint16(121), uint16(121), uint16(121), uint16(219), uint16(219), uint16(472), uint16(1183), uint16(407), uint16(570),
+ /* 460 */ uint16(1183), uint16(1235), uint16(503), uint16(1477), uint16(149), uint16(546), uint16(307), uint16(489), uint16(141), uint16(1011),
+ /* 470 */ uint16(1011), uint16(1013), uint16(546), uint16(140), uint16(545), uint16(1317), uint16(1214), uint16(191), uint16(1214), uint16(950),
+ /* 480 */ uint16(950), uint16(514), uint16(122), uint16(123), uint16(113), uint16(1207), uint16(1207), uint16(1041), uint16(1044), uint16(1034),
+ /* 490 */ uint16(1034), uint16(120), uint16(120), uint16(121), uint16(121), uint16(121), uint16(121), uint16(563), uint16(119), uint16(119),
+ /* 500 */ uint16(119), uint16(119), uint16(118), uint16(118), uint16(117), uint16(117), uint16(117), uint16(116), uint16(442), uint16(283),
+ /* 510 */ uint16(275), uint16(275), uint16(415), uint16(1183), uint16(1184), uint16(1185), uint16(1183), uint16(1184), uint16(1185), uint16(372),
+ /* 520 */ uint16(1183), uint16(243), uint16(344), uint16(561), uint16(502), uint16(499), uint16(498), uint16(1539), uint16(407), uint16(1540),
+ /* 530 */ uint16(1183), uint16(288), uint16(870), uint16(143), uint16(497), uint16(1549), uint16(185), uint16(231), uint16(9), uint16(6),
+ /* 540 */ uint16(253), uint16(119), uint16(119), uint16(119), uint16(119), uint16(118), uint16(118), uint16(117), uint16(117), uint16(117),
+ /* 550 */ uint16(116), uint16(442), uint16(122), uint16(123), uint16(113), uint16(1207), uint16(1207), uint16(1041), uint16(1044), uint16(1034),
+ /* 560 */ uint16(1034), uint16(120), uint16(120), uint16(121), uint16(121), uint16(121), uint16(121), uint16(407), uint16(137), uint16(446),
+ /* 570 */ uint16(447), uint16(863), uint16(169), uint16(1183), uint16(397), uint16(1204), uint16(1183), uint16(1184), uint16(1185), uint16(931),
+ /* 580 */ uint16(526), uint16(1001), uint16(98), uint16(339), uint16(564), uint16(342), uint16(1183), uint16(1184), uint16(1185), uint16(306),
+ /* 590 */ uint16(555), uint16(122), uint16(123), uint16(113), uint16(1207), uint16(1207), uint16(1041), uint16(1044), uint16(1034), uint16(1034),
+ /* 600 */ uint16(120), uint16(120), uint16(121), uint16(121), uint16(121), uint16(121), uint16(452), uint16(71), uint16(71), uint16(275),
+ /* 610 */ uint16(275), uint16(119), uint16(119), uint16(119), uint16(119), uint16(118), uint16(118), uint16(117), uint16(117), uint16(117),
+ /* 620 */ uint16(116), uint16(442), uint16(561), uint16(417), uint16(306), uint16(555), uint16(1183), uint16(1307), uint16(1307), uint16(1183),
+ /* 630 */ uint16(1184), uint16(1185), uint16(1204), uint16(1149), uint16(330), uint16(458), uint16(318), uint16(407), uint16(363), uint16(470),
+ /* 640 */ uint16(431), uint16(1167), uint16(32), uint16(541), uint16(527), uint16(350), uint16(1149), uint16(1629), uint16(393), uint16(1149),
/* 650 */ uint16(119), uint16(119), uint16(119), uint16(119), uint16(118), uint16(118), uint16(117), uint16(117), uint16(117), uint16(116),
- /* 660 */ uint16(441), uint16(122), uint16(123), uint16(113), uint16(1200), uint16(1200), uint16(1035), uint16(1038), uint16(1028), uint16(1028),
- /* 670 */ uint16(120), uint16(120), uint16(121), uint16(121), uint16(121), uint16(121), uint16(406), uint16(830), uint16(831), uint16(832),
- /* 680 */ uint16(1016), uint16(1176), uint16(1177), uint16(1178), uint16(396), uint16(285), uint16(148), uint16(1312), uint16(304), uint16(554),
- /* 690 */ uint16(1176), uint16(1177), uint16(1178), uint16(1467), uint16(216), uint16(3), uint16(337), uint16(137), uint16(340), uint16(560),
- /* 700 */ uint16(122), uint16(123), uint16(113), uint16(1200), uint16(1200), uint16(1035), uint16(1038), uint16(1028), uint16(1028), uint16(120),
- /* 710 */ uint16(120), uint16(121), uint16(121), uint16(121), uint16(121), uint16(563), uint16(504), uint16(946), uint16(273), uint16(273),
+ /* 660 */ uint16(442), uint16(122), uint16(123), uint16(113), uint16(1207), uint16(1207), uint16(1041), uint16(1044), uint16(1034), uint16(1034),
+ /* 670 */ uint16(120), uint16(120), uint16(121), uint16(121), uint16(121), uint16(121), uint16(407), uint16(199), uint16(472), uint16(1183),
+ /* 680 */ uint16(1022), uint16(472), uint16(1183), uint16(1184), uint16(1185), uint16(386), uint16(151), uint16(539), uint16(1548), uint16(277),
+ /* 690 */ uint16(400), uint16(137), uint16(6), uint16(317), uint16(5), uint16(564), uint16(562), uint16(3), uint16(920), uint16(920),
+ /* 700 */ uint16(122), uint16(123), uint16(113), uint16(1207), uint16(1207), uint16(1041), uint16(1044), uint16(1034), uint16(1034), uint16(120),
+ /* 710 */ uint16(120), uint16(121), uint16(121), uint16(121), uint16(121), uint16(411), uint16(505), uint16(83), uint16(71), uint16(71),
/* 720 */ uint16(119), uint16(119), uint16(119), uint16(119), uint16(118), uint16(118), uint16(117), uint16(117), uint16(117), uint16(116),
- /* 730 */ uint16(441), uint16(560), uint16(1176), uint16(427), uint16(563), uint16(451), uint16(98), uint16(13), uint16(13), uint16(259),
- /* 740 */ uint16(276), uint16(356), uint16(507), uint16(351), uint16(506), uint16(246), uint16(406), uint16(361), uint16(469), uint16(1530),
- /* 750 */ uint16(1000), uint16(347), uint16(293), uint16(304), uint16(554), uint16(1589), uint16(71), uint16(71), uint16(889), uint16(119),
- /* 760 */ uint16(119), uint16(119), uint16(119), uint16(118), uint16(118), uint16(117), uint16(117), uint16(117), uint16(116), uint16(441),
- /* 770 */ uint16(122), uint16(123), uint16(113), uint16(1200), uint16(1200), uint16(1035), uint16(1038), uint16(1028), uint16(1028), uint16(120),
- /* 780 */ uint16(120), uint16(121), uint16(121), uint16(121), uint16(121), uint16(406), uint16(1143), uint16(1078), uint16(1176), uint16(1177),
- /* 790 */ uint16(1178), uint16(416), uint16(1080), uint16(300), uint16(150), uint16(995), uint16(1080), uint16(361), uint16(361), uint16(1143),
- /* 800 */ uint16(361), uint16(378), uint16(1143), uint16(477), uint16(563), uint16(244), uint16(243), uint16(242), uint16(1278), uint16(122),
- /* 810 */ uint16(123), uint16(113), uint16(1200), uint16(1200), uint16(1035), uint16(1038), uint16(1028), uint16(1028), uint16(120), uint16(120),
- /* 820 */ uint16(121), uint16(121), uint16(121), uint16(121), uint16(563), uint16(880), uint16(13), uint16(13), uint16(483), uint16(119),
- /* 830 */ uint16(119), uint16(119), uint16(119), uint16(118), uint16(118), uint16(117), uint16(117), uint16(117), uint16(116), uint16(441),
- /* 840 */ uint16(1176), uint16(191), uint16(540), uint16(563), uint16(147), uint16(149), uint16(13), uint16(13), uint16(328), uint16(457),
- /* 850 */ uint16(316), uint16(1083), uint16(1083), uint16(485), uint16(1537), uint16(406), uint16(505), uint16(1530), uint16(6), uint16(1514),
- /* 860 */ uint16(284), uint16(192), uint16(1277), uint16(145), uint16(881), uint16(71), uint16(71), uint16(488), uint16(119), uint16(119),
- /* 870 */ uint16(119), uint16(119), uint16(118), uint16(118), uint16(117), uint16(117), uint16(117), uint16(116), uint16(441), uint16(122),
- /* 880 */ uint16(123), uint16(113), uint16(1200), uint16(1200), uint16(1035), uint16(1038), uint16(1028), uint16(1028), uint16(120), uint16(120),
- /* 890 */ uint16(121), uint16(121), uint16(121), uint16(121), uint16(563), uint16(471), uint16(1176), uint16(1177), uint16(1178), uint16(406),
- /* 900 */ uint16(852), uint16(327), uint16(301), uint16(462), uint16(330), uint16(1516), uint16(270), uint16(1530), uint16(1530), uint16(944),
- /* 910 */ uint16(1531), uint16(1307), uint16(313), uint16(9), uint16(842), uint16(251), uint16(71), uint16(71), uint16(477), uint16(428),
- /* 920 */ uint16(146), uint16(488), uint16(38), uint16(945), uint16(101), uint16(113), uint16(1200), uint16(1200), uint16(1035), uint16(1038),
- /* 930 */ uint16(1028), uint16(1028), uint16(120), uint16(120), uint16(121), uint16(121), uint16(121), uint16(121), uint16(119), uint16(119),
- /* 940 */ uint16(119), uint16(119), uint16(118), uint16(118), uint16(117), uint16(117), uint16(117), uint16(116), uint16(441), uint16(563),
- /* 950 */ uint16(1197), uint16(1099), uint16(563), uint16(436), uint16(563), uint16(1533), uint16(563), uint16(852), uint16(1122), uint16(1617),
- /* 960 */ uint16(454), uint16(290), uint16(1617), uint16(546), uint16(251), uint16(1303), uint16(1100), uint16(267), uint16(267), uint16(281),
- /* 970 */ uint16(404), uint16(70), uint16(70), uint16(460), uint16(71), uint16(71), uint16(71), uint16(71), uint16(13), uint16(13),
- /* 980 */ uint16(560), uint16(1101), uint16(119), uint16(119), uint16(119), uint16(119), uint16(118), uint16(118), uint16(117), uint16(117),
- /* 990 */ uint16(117), uint16(116), uint16(441), uint16(542), uint16(104), uint16(273), uint16(273), uint16(273), uint16(273), uint16(1197),
- /* 1000 */ uint16(217), uint16(1468), uint16(900), uint16(471), uint16(450), uint16(563), uint16(1473), uint16(1197), uint16(560), uint16(447),
- /* 1010 */ uint16(560), uint16(545), uint16(901), uint16(440), uint16(406), uint16(1058), uint16(292), uint16(274), uint16(274), uint16(198),
- /* 1020 */ uint16(547), uint16(450), uint16(449), uint16(1473), uint16(1475), uint16(944), uint16(455), uint16(56), uint16(56), uint16(410),
- /* 1030 */ uint16(560), uint16(1122), uint16(1618), uint16(379), uint16(406), uint16(1618), uint16(404), uint16(1120), uint16(122), uint16(123),
- /* 1040 */ uint16(113), uint16(1200), uint16(1200), uint16(1035), uint16(1038), uint16(1028), uint16(1028), uint16(120), uint16(120), uint16(121),
- /* 1050 */ uint16(121), uint16(121), uint16(121), uint16(1460), uint16(406), uint16(12), uint16(1197), uint16(1512), uint16(122), uint16(123),
- /* 1060 */ uint16(113), uint16(1200), uint16(1200), uint16(1035), uint16(1038), uint16(1028), uint16(1028), uint16(120), uint16(120), uint16(121),
- /* 1070 */ uint16(121), uint16(121), uint16(121), uint16(308), uint16(471), uint16(126), uint16(359), uint16(286), uint16(122), uint16(111),
- /* 1080 */ uint16(113), uint16(1200), uint16(1200), uint16(1035), uint16(1038), uint16(1028), uint16(1028), uint16(120), uint16(120), uint16(121),
- /* 1090 */ uint16(121), uint16(121), uint16(121), uint16(309), uint16(450), uint16(471), uint16(1473), uint16(119), uint16(119), uint16(119),
- /* 1100 */ uint16(119), uint16(118), uint16(118), uint16(117), uint16(117), uint16(117), uint16(116), uint16(441), uint16(1176), uint16(563),
- /* 1110 */ uint16(1120), uint16(482), uint16(563), uint16(312), uint16(433), uint16(479), uint16(197), uint16(119), uint16(119), uint16(119),
- /* 1120 */ uint16(119), uint16(118), uint16(118), uint16(117), uint16(117), uint16(117), uint16(116), uint16(441), uint16(405), uint16(12),
- /* 1130 */ uint16(536), uint16(15), uint16(15), uint16(478), uint16(43), uint16(43), uint16(509), uint16(119), uint16(119), uint16(119),
- /* 1140 */ uint16(119), uint16(118), uint16(118), uint16(117), uint16(117), uint16(117), uint16(116), uint16(441), uint16(289), uint16(535),
- /* 1150 */ uint16(294), uint16(563), uint16(294), uint16(391), uint16(1220), uint16(438), uint16(437), uint16(406), uint16(1154), uint16(403),
- /* 1160 */ uint16(402), uint16(1400), uint16(920), uint16(1204), uint16(1176), uint16(1177), uint16(1178), uint16(919), uint16(1206), uint16(291),
- /* 1170 */ uint16(1306), uint16(1249), uint16(412), uint16(57), uint16(57), uint16(488), uint16(1205), uint16(563), uint16(556), uint16(412),
- /* 1180 */ uint16(1176), uint16(1344), uint16(123), uint16(113), uint16(1200), uint16(1200), uint16(1035), uint16(1038), uint16(1028), uint16(1028),
- /* 1190 */ uint16(120), uint16(120), uint16(121), uint16(121), uint16(121), uint16(121), uint16(1400), uint16(1143), uint16(563), uint16(44),
- /* 1200 */ uint16(44), uint16(1207), uint16(194), uint16(1207), uint16(273), uint16(273), uint16(1400), uint16(461), uint16(537), uint16(1154),
- /* 1210 */ uint16(1143), uint16(108), uint16(555), uint16(1143), uint16(4), uint16(391), uint16(1121), uint16(560), uint16(1538), uint16(335),
- /* 1220 */ uint16(58), uint16(58), uint16(6), uint16(1246), uint16(1099), uint16(380), uint16(1400), uint16(376), uint16(558), uint16(1536),
- /* 1230 */ uint16(563), uint16(422), uint16(1221), uint16(6), uint16(304), uint16(554), uint16(1176), uint16(1177), uint16(1178), uint16(1100),
+ /* 730 */ uint16(442), uint16(1183), uint16(218), uint16(428), uint16(1183), uint16(1183), uint16(1184), uint16(1185), uint16(363), uint16(261),
+ /* 740 */ uint16(278), uint16(358), uint16(508), uint16(353), uint16(507), uint16(248), uint16(407), uint16(306), uint16(555), uint16(1539),
+ /* 750 */ uint16(1006), uint16(349), uint16(363), uint16(291), uint16(489), uint16(302), uint16(293), uint16(1542), uint16(281), uint16(119),
+ /* 760 */ uint16(119), uint16(119), uint16(119), uint16(118), uint16(118), uint16(117), uint16(117), uint16(117), uint16(116), uint16(442),
+ /* 770 */ uint16(122), uint16(123), uint16(113), uint16(1207), uint16(1207), uint16(1041), uint16(1044), uint16(1034), uint16(1034), uint16(120),
+ /* 780 */ uint16(120), uint16(121), uint16(121), uint16(121), uint16(121), uint16(407), uint16(148), uint16(1183), uint16(1184), uint16(1185),
+ /* 790 */ uint16(1183), uint16(1184), uint16(1185), uint16(275), uint16(275), uint16(1304), uint16(1257), uint16(1283), uint16(483), uint16(1476),
+ /* 800 */ uint16(150), uint16(489), uint16(480), uint16(564), uint16(1187), uint16(1304), uint16(561), uint16(1587), uint16(1255), uint16(122),
+ /* 810 */ uint16(123), uint16(113), uint16(1207), uint16(1207), uint16(1041), uint16(1044), uint16(1034), uint16(1034), uint16(120), uint16(120),
+ /* 820 */ uint16(121), uint16(121), uint16(121), uint16(121), uint16(564), uint16(886), uint16(13), uint16(13), uint16(520), uint16(119),
+ /* 830 */ uint16(119), uint16(119), uint16(119), uint16(118), uint16(118), uint16(117), uint16(117), uint16(117), uint16(116), uint16(442),
+ /* 840 */ uint16(1183), uint16(420), uint16(417), uint16(564), uint16(269), uint16(269), uint16(1316), uint16(13), uint16(13), uint16(1539),
+ /* 850 */ uint16(1546), uint16(16), uint16(16), uint16(322), uint16(6), uint16(407), uint16(506), uint16(561), uint16(1089), uint16(1089),
+ /* 860 */ uint16(486), uint16(1187), uint16(425), uint16(1539), uint16(887), uint16(292), uint16(71), uint16(71), uint16(119), uint16(119),
+ /* 870 */ uint16(119), uint16(119), uint16(118), uint16(118), uint16(117), uint16(117), uint16(117), uint16(116), uint16(442), uint16(122),
+ /* 880 */ uint16(123), uint16(113), uint16(1207), uint16(1207), uint16(1041), uint16(1044), uint16(1034), uint16(1034), uint16(120), uint16(120),
+ /* 890 */ uint16(121), uint16(121), uint16(121), uint16(121), uint16(564), uint16(12), uint16(1183), uint16(1184), uint16(1185), uint16(407),
+ /* 900 */ uint16(275), uint16(275), uint16(451), uint16(303), uint16(834), uint16(835), uint16(836), uint16(417), uint16(489), uint16(276),
+ /* 910 */ uint16(276), uint16(1547), uint16(284), uint16(561), uint16(319), uint16(6), uint16(321), uint16(71), uint16(71), uint16(429),
+ /* 920 */ uint16(451), uint16(450), uint16(561), uint16(952), uint16(101), uint16(113), uint16(1207), uint16(1207), uint16(1041), uint16(1044),
+ /* 930 */ uint16(1034), uint16(1034), uint16(120), uint16(120), uint16(121), uint16(121), uint16(121), uint16(121), uint16(119), uint16(119),
+ /* 940 */ uint16(119), uint16(119), uint16(118), uint16(118), uint16(117), uint16(117), uint16(117), uint16(116), uint16(442), uint16(1105),
+ /* 950 */ uint16(1183), uint16(489), uint16(564), uint16(1312), uint16(437), uint16(455), uint16(478), uint16(564), uint16(246), uint16(245),
+ /* 960 */ uint16(244), uint16(1409), uint16(1545), uint16(547), uint16(1106), uint16(405), uint16(6), uint16(1544), uint16(196), uint16(1258),
+ /* 970 */ uint16(413), uint16(6), uint16(105), uint16(462), uint16(103), uint16(71), uint16(71), uint16(286), uint16(564), uint16(1107),
+ /* 980 */ uint16(13), uint16(13), uint16(119), uint16(119), uint16(119), uint16(119), uint16(118), uint16(118), uint16(117), uint16(117),
+ /* 990 */ uint16(117), uint16(116), uint16(442), uint16(451), uint16(104), uint16(427), uint16(337), uint16(320), uint16(275), uint16(275),
+ /* 1000 */ uint16(906), uint16(13), uint16(13), uint16(564), uint16(1482), uint16(1105), uint16(1183), uint16(1184), uint16(1185), uint16(126),
+ /* 1010 */ uint16(907), uint16(561), uint16(546), uint16(564), uint16(407), uint16(478), uint16(295), uint16(1321), uint16(253), uint16(200),
+ /* 1020 */ uint16(1106), uint16(548), uint16(1482), uint16(1484), uint16(280), uint16(1409), uint16(55), uint16(55), uint16(1287), uint16(561),
+ /* 1030 */ uint16(478), uint16(380), uint16(423), uint16(951), uint16(407), uint16(1107), uint16(71), uint16(71), uint16(122), uint16(123),
+ /* 1040 */ uint16(113), uint16(1207), uint16(1207), uint16(1041), uint16(1044), uint16(1034), uint16(1034), uint16(120), uint16(120), uint16(121),
+ /* 1050 */ uint16(121), uint16(121), uint16(121), uint16(1204), uint16(407), uint16(287), uint16(552), uint16(309), uint16(122), uint16(123),
+ /* 1060 */ uint16(113), uint16(1207), uint16(1207), uint16(1041), uint16(1044), uint16(1034), uint16(1034), uint16(120), uint16(120), uint16(121),
+ /* 1070 */ uint16(121), uint16(121), uint16(121), uint16(441), uint16(1128), uint16(1628), uint16(146), uint16(1628), uint16(122), uint16(111),
+ /* 1080 */ uint16(113), uint16(1207), uint16(1207), uint16(1041), uint16(1044), uint16(1034), uint16(1034), uint16(120), uint16(120), uint16(121),
+ /* 1090 */ uint16(121), uint16(121), uint16(121), uint16(404), uint16(403), uint16(1482), uint16(424), uint16(119), uint16(119), uint16(119),
+ /* 1100 */ uint16(119), uint16(118), uint16(118), uint16(117), uint16(117), uint16(117), uint16(116), uint16(442), uint16(1183), uint16(564),
+ /* 1110 */ uint16(1204), uint16(544), uint16(1086), uint16(858), uint16(329), uint16(361), uint16(1086), uint16(119), uint16(119), uint16(119),
+ /* 1120 */ uint16(119), uint16(118), uint16(118), uint16(117), uint16(117), uint16(117), uint16(116), uint16(442), uint16(564), uint16(294),
+ /* 1130 */ uint16(144), uint16(523), uint16(56), uint16(56), uint16(224), uint16(564), uint16(510), uint16(119), uint16(119), uint16(119),
+ /* 1140 */ uint16(119), uint16(118), uint16(118), uint16(117), uint16(117), uint16(117), uint16(116), uint16(442), uint16(484), uint16(1409),
+ /* 1150 */ uint16(537), uint16(15), uint16(15), uint16(1126), uint16(434), uint16(439), uint16(438), uint16(407), uint16(13), uint16(13),
+ /* 1160 */ uint16(1523), uint16(12), uint16(926), uint16(1211), uint16(1183), uint16(1184), uint16(1185), uint16(925), uint16(1213), uint16(536),
+ /* 1170 */ uint16(858), uint16(557), uint16(413), uint16(193), uint16(1525), uint16(494), uint16(1212), uint16(448), uint16(1160), uint16(1222),
+ /* 1180 */ uint16(1183), uint16(564), uint16(123), uint16(113), uint16(1207), uint16(1207), uint16(1041), uint16(1044), uint16(1034), uint16(1034),
+ /* 1190 */ uint16(120), uint16(120), uint16(121), uint16(121), uint16(121), uint16(121), uint16(1521), uint16(1149), uint16(564), uint16(965),
+ /* 1200 */ uint16(564), uint16(1214), uint16(247), uint16(1214), uint16(13), uint16(13), uint16(1409), uint16(966), uint16(538), uint16(564),
+ /* 1210 */ uint16(1149), uint16(108), uint16(556), uint16(1149), uint16(4), uint16(310), uint16(392), uint16(1227), uint16(17), uint16(194),
+ /* 1220 */ uint16(485), uint16(43), uint16(43), uint16(57), uint16(57), uint16(306), uint16(555), uint16(524), uint16(559), uint16(1160),
+ /* 1230 */ uint16(464), uint16(564), uint16(44), uint16(44), uint16(392), uint16(1127), uint16(1183), uint16(1184), uint16(1185), uint16(479),
/* 1240 */ uint16(119), uint16(119), uint16(119), uint16(119), uint16(118), uint16(118), uint16(117), uint16(117), uint16(117), uint16(116),
- /* 1250 */ uint16(441), uint16(442), uint16(59), uint16(59), uint16(1101), uint16(516), uint16(1535), uint16(273), uint16(273), uint16(563),
- /* 1260 */ uint16(6), uint16(563), uint16(110), uint16(552), uint16(563), uint16(528), uint16(423), uint16(413), uint16(169), uint16(548),
- /* 1270 */ uint16(560), uint16(108), uint16(555), uint16(137), uint16(4), uint16(551), uint16(484), uint16(272), uint16(215), uint16(222),
- /* 1280 */ uint16(211), uint16(60), uint16(60), uint16(61), uint16(61), uint16(98), uint16(62), uint16(62), uint16(558), uint16(273),
- /* 1290 */ uint16(273), uint16(563), uint16(1015), uint16(467), uint16(1221), uint16(563), uint16(434), uint16(563), uint16(106), uint16(106),
- /* 1300 */ uint16(8), uint16(920), uint16(560), uint16(273), uint16(273), uint16(107), uint16(919), uint16(442), uint16(565), uint16(564),
- /* 1310 */ uint16(563), uint16(442), uint16(1005), uint16(45), uint16(45), uint16(464), uint16(560), uint16(46), uint16(46), uint16(47),
- /* 1320 */ uint16(47), uint16(84), uint16(202), uint16(552), uint16(1215), uint16(404), uint16(468), uint16(563), uint16(205), uint16(304),
- /* 1330 */ uint16(554), uint16(563), uint16(49), uint16(49), uint16(563), uint16(522), uint16(404), uint16(532), uint16(563), uint16(867),
- /* 1340 */ uint16(563), uint16(105), uint16(531), uint16(103), uint16(1005), uint16(1005), uint16(1007), uint16(1008), uint16(27), uint16(50),
- /* 1350 */ uint16(50), uint16(563), uint16(1015), uint16(63), uint16(63), uint16(475), uint16(64), uint16(64), uint16(106), uint16(106),
- /* 1360 */ uint16(65), uint16(65), uint16(14), uint16(14), uint16(17), uint16(107), uint16(563), uint16(442), uint16(565), uint16(564),
- /* 1370 */ uint16(563), uint16(303), uint16(1005), uint16(66), uint16(66), uint16(563), uint16(226), uint16(563), uint16(959), uint16(563),
- /* 1380 */ uint16(543), uint16(404), uint16(1196), uint16(1343), uint16(871), uint16(278), uint16(960), uint16(456), uint16(128), uint16(128),
- /* 1390 */ uint16(563), uint16(1065), uint16(67), uint16(67), uint16(563), uint16(206), uint16(867), uint16(52), uint16(52), uint16(68),
- /* 1400 */ uint16(68), uint16(69), uint16(69), uint16(417), uint16(1005), uint16(1005), uint16(1007), uint16(1008), uint16(27), uint16(1563),
- /* 1410 */ uint16(1165), uint16(444), uint16(53), uint16(53), uint16(277), uint16(1519), uint16(156), uint16(156), uint16(307), uint16(389),
- /* 1420 */ uint16(389), uint16(388), uint16(262), uint16(386), uint16(1165), uint16(444), uint16(839), uint16(321), uint16(277), uint16(108),
- /* 1430 */ uint16(555), uint16(523), uint16(4), uint16(389), uint16(389), uint16(388), uint16(262), uint16(386), uint16(563), uint16(223),
- /* 1440 */ uint16(839), uint16(311), uint16(326), uint16(1492), uint16(1117), uint16(98), uint16(558), uint16(393), uint16(1065), uint16(310),
- /* 1450 */ uint16(563), uint16(476), uint16(563), uint16(223), uint16(563), uint16(311), uint16(879), uint16(878), uint16(1009), uint16(277),
- /* 1460 */ uint16(157), uint16(157), uint16(463), uint16(310), uint16(389), uint16(389), uint16(388), uint16(262), uint16(386), uint16(442),
- /* 1470 */ uint16(518), uint16(839), uint16(76), uint16(76), uint16(54), uint16(54), uint16(72), uint16(72), uint16(355), uint16(225),
- /* 1480 */ uint16(563), uint16(552), uint16(275), uint16(563), uint16(223), uint16(325), uint16(311), uint16(161), uint16(354), uint16(465),
- /* 1490 */ uint16(135), uint16(563), uint16(228), uint16(225), uint16(310), uint16(532), uint16(563), uint16(206), uint16(886), uint16(887),
- /* 1500 */ uint16(533), uint16(161), uint16(129), uint16(129), uint16(135), uint16(73), uint16(73), uint16(224), uint16(962), uint16(963),
- /* 1510 */ uint16(1015), uint16(563), uint16(287), uint16(130), uint16(130), uint16(1009), uint16(106), uint16(106), uint16(131), uint16(131),
- /* 1520 */ uint16(563), uint16(224), uint16(563), uint16(107), uint16(225), uint16(442), uint16(565), uint16(564), uint16(997), uint16(1276),
- /* 1530 */ uint16(1005), uint16(250), uint16(161), uint16(127), uint16(127), uint16(135), uint16(108), uint16(555), uint16(1077), uint16(4),
- /* 1540 */ uint16(1077), uint16(407), uint16(155), uint16(155), uint16(154), uint16(154), uint16(304), uint16(554), uint16(1126), uint16(563),
- /* 1550 */ uint16(1331), uint16(563), uint16(224), uint16(558), uint16(470), uint16(407), uint16(563), uint16(250), uint16(563), uint16(1491),
- /* 1560 */ uint16(304), uint16(554), uint16(1005), uint16(1005), uint16(1007), uint16(1008), uint16(27), uint16(563), uint16(480), uint16(332),
- /* 1570 */ uint16(448), uint16(136), uint16(136), uint16(134), uint16(134), uint16(1340), uint16(442), uint16(336), uint16(132), uint16(132),
- /* 1580 */ uint16(133), uint16(133), uint16(563), uint16(1076), uint16(448), uint16(1076), uint16(407), uint16(563), uint16(552), uint16(75),
- /* 1590 */ uint16(75), uint16(304), uint16(554), uint16(339), uint16(341), uint16(343), uint16(108), uint16(555), uint16(563), uint16(4),
- /* 1600 */ uint16(1577), uint16(299), uint16(532), uint16(563), uint16(77), uint16(77), uint16(1291), uint16(531), uint16(472), uint16(74),
- /* 1610 */ uint16(74), uint16(250), uint16(1275), uint16(558), uint16(350), uint16(448), uint16(331), uint16(1015), uint16(360), uint16(98),
- /* 1620 */ uint16(42), uint16(42), uint16(1352), uint16(106), uint16(106), uint16(48), uint16(48), uint16(1399), uint16(494), uint16(1327),
- /* 1630 */ uint16(107), uint16(247), uint16(442), uint16(565), uint16(564), uint16(345), uint16(442), uint16(1005), uint16(98), uint16(1061),
- /* 1640 */ uint16(953), uint16(917), uint16(247), uint16(250), uint16(110), uint16(1552), uint16(550), uint16(850), uint16(552), uint16(918),
- /* 1650 */ uint16(144), uint16(1338), uint16(110), uint16(549), uint16(1405), uint16(1256), uint16(1248), uint16(1237), uint16(1236), uint16(1238),
- /* 1660 */ uint16(1571), uint16(1324), uint16(208), uint16(390), uint16(489), uint16(265), uint16(363), uint16(200), uint16(365), uint16(1005),
- /* 1670 */ uint16(1005), uint16(1007), uint16(1008), uint16(27), uint16(11), uint16(280), uint16(221), uint16(1015), uint16(323), uint16(474),
- /* 1680 */ uint16(1274), uint16(367), uint16(212), uint16(106), uint16(106), uint16(924), uint16(1386), uint16(324), uint16(288), uint16(1381),
- /* 1690 */ uint16(107), uint16(453), uint16(442), uint16(565), uint16(564), uint16(283), uint16(329), uint16(1005), uint16(1391), uint16(499),
- /* 1700 */ uint16(353), uint16(1374), uint16(1464), uint16(108), uint16(555), uint16(1463), uint16(4), uint16(1574), uint16(1390), uint16(397),
- /* 1710 */ uint16(1215), uint16(171), uint16(254), uint16(369), uint16(383), uint16(207), uint16(195), uint16(196), uint16(1511), uint16(553),
- /* 1720 */ uint16(558), uint16(1509), uint16(415), uint16(1212), uint16(100), uint16(555), uint16(83), uint16(4), uint16(204), uint16(1005),
- /* 1730 */ uint16(1005), uint16(1007), uint16(1008), uint16(27), uint16(180), uint16(166), uint16(173), uint16(219), uint16(79), uint16(82),
- /* 1740 */ uint16(458), uint16(558), uint16(175), uint16(442), uint16(35), uint16(1387), uint16(176), uint16(459), uint16(177), uint16(178),
- /* 1750 */ uint16(492), uint16(231), uint16(96), uint16(1469), uint16(395), uint16(552), uint16(1393), uint16(1392), uint16(36), uint16(466),
- /* 1760 */ uint16(1395), uint16(184), uint16(398), uint16(481), uint16(442), uint16(1458), uint16(235), uint16(89), uint16(1480), uint16(487),
- /* 1770 */ uint16(266), uint16(334), uint16(237), uint16(188), uint16(490), uint16(400), uint16(552), uint16(338), uint16(238), uint16(508),
- /* 1780 */ uint16(1239), uint16(239), uint16(1294), uint16(1293), uint16(1015), uint16(1292), uint16(1285), uint16(429), uint16(91), uint16(871),
- /* 1790 */ uint16(106), uint16(106), uint16(1588), uint16(213), uint16(401), uint16(1587), uint16(431), uint16(107), uint16(1264), uint16(442),
- /* 1800 */ uint16(565), uint16(564), uint16(1263), uint16(352), uint16(1005), uint16(1015), uint16(1262), uint16(1586), uint16(1557), uint16(517),
- /* 1810 */ uint16(432), uint16(106), uint16(106), uint16(1284), uint16(297), uint16(298), uint16(358), uint16(524), uint16(107), uint16(1335),
- /* 1820 */ uint16(442), uint16(565), uint16(564), uint16(95), uint16(1336), uint16(1005), uint16(252), uint16(253), uint16(435), uint16(125),
- /* 1830 */ uint16(543), uint16(1543), uint16(10), uint16(1444), uint16(377), uint16(1542), uint16(1005), uint16(1005), uint16(1007), uint16(1008),
- /* 1840 */ uint16(27), uint16(97), uint16(527), uint16(375), uint16(362), uint16(102), uint16(260), uint16(364), uint16(381), uint16(1317),
- /* 1850 */ uint16(382), uint16(1334), uint16(366), uint16(1245), uint16(1333), uint16(1316), uint16(368), uint16(1005), uint16(1005), uint16(1007),
- /* 1860 */ uint16(1008), uint16(27), uint16(1359), uint16(1358), uint16(34), uint16(199), uint16(1171), uint16(566), uint16(261), uint16(263),
- /* 1870 */ uint16(264), uint16(567), uint16(1234), uint16(158), uint16(1229), uint16(141), uint16(295), uint16(159), uint16(1496), uint16(302),
- /* 1880 */ uint16(1497), uint16(1495), uint16(1494), uint16(160), uint16(826), uint16(209), uint16(443), uint16(201), uint16(306), uint16(210),
- /* 1890 */ uint16(78), uint16(220), uint16(1075), uint16(138), uint16(1073), uint16(314), uint16(162), uint16(172), uint16(1196), uint16(227),
- /* 1900 */ uint16(174), uint16(903), uint16(322), uint16(230), uint16(1089), uint16(179), uint16(163), uint16(164), uint16(418), uint16(408),
- /* 1910 */ uint16(409), uint16(170), uint16(181), uint16(85), uint16(86), uint16(420), uint16(87), uint16(165), uint16(1092), uint16(88),
- /* 1920 */ uint16(233), uint16(232), uint16(1088), uint16(151), uint16(18), uint16(234), uint16(1081), uint16(250), uint16(333), uint16(1209),
- /* 1930 */ uint16(185), uint16(486), uint16(236), uint16(186), uint16(37), uint16(841), uint16(491), uint16(354), uint16(240), uint16(346),
- /* 1940 */ uint16(495), uint16(187), uint16(90), uint16(869), uint16(19), uint16(20), uint16(500), uint16(503), uint16(349), uint16(92),
- /* 1950 */ uint16(167), uint16(152), uint16(296), uint16(882), uint16(93), uint16(510), uint16(94), uint16(1159), uint16(153), uint16(1041),
- /* 1960 */ uint16(1128), uint16(39), uint16(214), uint16(269), uint16(1127), uint16(271), uint16(249), uint16(952), uint16(190), uint16(947),
- /* 1970 */ uint16(110), uint16(1149), uint16(21), uint16(7), uint16(1153), uint16(22), uint16(1145), uint16(23), uint16(1147), uint16(24),
- /* 1980 */ uint16(1133), uint16(25), uint16(1152), uint16(33), uint16(539), uint16(193), uint16(26), uint16(1056), uint16(98), uint16(1042),
- /* 1990 */ uint16(1040), uint16(1044), uint16(1098), uint16(1045), uint16(1097), uint16(256), uint16(255), uint16(28), uint16(40), uint16(257),
- /* 2000 */ uint16(1010), uint16(851), uint16(109), uint16(29), uint16(913), uint16(559), uint16(384), uint16(387), uint16(258), uint16(1167),
- /* 2010 */ uint16(1166), uint16(1225), uint16(1225), uint16(1225), uint16(1579), uint16(1225), uint16(1225), uint16(1225), uint16(1225), uint16(1225),
- /* 2020 */ uint16(1225), uint16(1225), uint16(1578),
-} /* sqlite3.c:158588:27 */
-var yy_lookahead = [2207]uint16{
- /* 0 */ uint16(192), uint16(221), uint16(192), uint16(223), uint16(192), uint16(214), uint16(272), uint16(273), uint16(274), uint16(217),
- /* 10 */ uint16(192), uint16(231), uint16(217), uint16(192), uint16(192), uint16(192), uint16(272), uint16(273), uint16(274), uint16(19),
- /* 20 */ uint16(233), uint16(234), uint16(214), uint16(215), uint16(214), uint16(215), uint16(203), uint16(293), uint16(203), uint16(233),
- /* 30 */ uint16(234), uint16(31), uint16(214), uint16(215), uint16(214), uint16(214), uint16(215), uint16(214), uint16(215), uint16(39),
- /* 40 */ uint16(208), uint16(209), uint16(210), uint16(43), uint16(44), uint16(45), uint16(46), uint16(47), uint16(48), uint16(49),
- /* 50 */ uint16(50), uint16(51), uint16(52), uint16(53), uint16(54), uint16(55), uint16(56), uint16(57), uint16(236), uint16(19),
- /* 60 */ uint16(237), uint16(238), uint16(237), uint16(238), uint16(272), uint16(273), uint16(274), uint16(272), uint16(273), uint16(274),
- /* 70 */ uint16(192), uint16(211), uint16(251), uint16(250), uint16(251), uint16(250), uint16(26), uint16(192), uint16(200), uint16(254),
- /* 80 */ uint16(255), uint16(260), uint16(204), uint16(43), uint16(44), uint16(45), uint16(46), uint16(47), uint16(48), uint16(49),
- /* 90 */ uint16(50), uint16(51), uint16(52), uint16(53), uint16(54), uint16(55), uint16(56), uint16(57), uint16(192), uint16(214),
- /* 100 */ uint16(215), uint16(214), uint16(102), uint16(103), uint16(104), uint16(105), uint16(106), uint16(107), uint16(108), uint16(109),
- /* 110 */ uint16(110), uint16(111), uint16(112), uint16(59), uint16(229), uint16(192), uint16(294), uint16(16), uint16(306), uint16(307),
- /* 120 */ uint16(312), uint16(313), uint16(312), uint16(311), uint16(314), uint16(59), uint16(86), uint16(204), uint16(88), uint16(19),
- /* 130 */ uint16(312), uint16(313), uint16(272), uint16(273), uint16(274), uint16(271), uint16(26), uint16(22), uint16(54), uint16(55),
+ /* 1250 */ uint16(442), uint16(443), uint16(564), uint16(327), uint16(13), uint16(13), uint16(564), uint16(418), uint16(1315), uint16(414),
+ /* 1260 */ uint16(171), uint16(564), uint16(311), uint16(553), uint16(213), uint16(529), uint16(1253), uint16(564), uint16(517), uint16(543),
+ /* 1270 */ uint16(412), uint16(108), uint16(556), uint16(137), uint16(4), uint16(58), uint16(58), uint16(435), uint16(314), uint16(59),
+ /* 1280 */ uint16(59), uint16(274), uint16(217), uint16(549), uint16(60), uint16(60), uint16(349), uint16(476), uint16(559), uint16(1353),
+ /* 1290 */ uint16(61), uint16(61), uint16(1021), uint16(275), uint16(275), uint16(1228), uint16(213), uint16(564), uint16(106), uint16(106),
+ /* 1300 */ uint16(8), uint16(275), uint16(275), uint16(275), uint16(275), uint16(107), uint16(561), uint16(443), uint16(566), uint16(565),
+ /* 1310 */ uint16(564), uint16(443), uint16(1011), uint16(1228), uint16(561), uint16(564), uint16(561), uint16(564), uint16(275), uint16(275),
+ /* 1320 */ uint16(62), uint16(62), uint16(1352), uint16(553), uint16(247), uint16(456), uint16(564), uint16(98), uint16(110), uint16(306),
+ /* 1330 */ uint16(555), uint16(561), uint16(564), uint16(45), uint16(45), uint16(405), uint16(1203), uint16(533), uint16(46), uint16(46),
+ /* 1340 */ uint16(47), uint16(47), uint16(532), uint16(465), uint16(1011), uint16(1011), uint16(1013), uint16(1014), uint16(27), uint16(49),
+ /* 1350 */ uint16(49), uint16(564), uint16(1021), uint16(405), uint16(469), uint16(50), uint16(50), uint16(564), uint16(106), uint16(106),
+ /* 1360 */ uint16(305), uint16(564), uint16(84), uint16(204), uint16(405), uint16(107), uint16(564), uint16(443), uint16(566), uint16(565),
+ /* 1370 */ uint16(405), uint16(564), uint16(1011), uint16(564), uint16(63), uint16(63), uint16(564), uint16(1599), uint16(564), uint16(895),
+ /* 1380 */ uint16(64), uint16(64), uint16(457), uint16(477), uint16(65), uint16(65), uint16(147), uint16(96), uint16(38), uint16(14),
+ /* 1390 */ uint16(14), uint16(1528), uint16(412), uint16(564), uint16(66), uint16(66), uint16(128), uint16(128), uint16(926), uint16(67),
+ /* 1400 */ uint16(67), uint16(52), uint16(52), uint16(925), uint16(1011), uint16(1011), uint16(1013), uint16(1014), uint16(27), uint16(1572),
+ /* 1410 */ uint16(1171), uint16(445), uint16(208), uint16(1123), uint16(279), uint16(394), uint16(68), uint16(68), uint16(228), uint16(390),
+ /* 1420 */ uint16(390), uint16(389), uint16(264), uint16(387), uint16(1171), uint16(445), uint16(843), uint16(877), uint16(279), uint16(108),
+ /* 1430 */ uint16(556), uint16(453), uint16(4), uint16(390), uint16(390), uint16(389), uint16(264), uint16(387), uint16(564), uint16(225),
+ /* 1440 */ uint16(843), uint16(313), uint16(328), uint16(1003), uint16(98), uint16(252), uint16(559), uint16(544), uint16(471), uint16(312),
+ /* 1450 */ uint16(252), uint16(564), uint16(208), uint16(225), uint16(564), uint16(313), uint16(473), uint16(30), uint16(252), uint16(279),
+ /* 1460 */ uint16(466), uint16(69), uint16(69), uint16(312), uint16(390), uint16(390), uint16(389), uint16(264), uint16(387), uint16(443),
+ /* 1470 */ uint16(333), uint16(843), uint16(98), uint16(564), uint16(53), uint16(53), uint16(323), uint16(157), uint16(157), uint16(227),
+ /* 1480 */ uint16(495), uint16(553), uint16(249), uint16(289), uint16(225), uint16(564), uint16(313), uint16(162), uint16(31), uint16(1501),
+ /* 1490 */ uint16(135), uint16(564), uint16(1500), uint16(227), uint16(312), uint16(533), uint16(158), uint16(158), uint16(885), uint16(884),
+ /* 1500 */ uint16(534), uint16(162), uint16(873), uint16(301), uint16(135), uint16(564), uint16(481), uint16(226), uint16(76), uint16(76),
+ /* 1510 */ uint16(1021), uint16(347), uint16(1071), uint16(98), uint16(54), uint16(54), uint16(106), uint16(106), uint16(1067), uint16(564),
+ /* 1520 */ uint16(249), uint16(226), uint16(519), uint16(107), uint16(227), uint16(443), uint16(566), uint16(565), uint16(72), uint16(72),
+ /* 1530 */ uint16(1011), uint16(334), uint16(162), uint16(564), uint16(230), uint16(135), uint16(108), uint16(556), uint16(959), uint16(4),
+ /* 1540 */ uint16(252), uint16(408), uint16(129), uint16(129), uint16(564), uint16(1349), uint16(306), uint16(555), uint16(564), uint16(923),
+ /* 1550 */ uint16(564), uint16(110), uint16(226), uint16(559), uint16(564), uint16(408), uint16(73), uint16(73), uint16(564), uint16(873),
+ /* 1560 */ uint16(306), uint16(555), uint16(1011), uint16(1011), uint16(1013), uint16(1014), uint16(27), uint16(130), uint16(130), uint16(1071),
+ /* 1570 */ uint16(449), uint16(131), uint16(131), uint16(127), uint16(127), uint16(357), uint16(443), uint16(156), uint16(156), uint16(892),
+ /* 1580 */ uint16(893), uint16(155), uint16(155), uint16(338), uint16(449), uint16(356), uint16(408), uint16(564), uint16(553), uint16(968),
+ /* 1590 */ uint16(969), uint16(306), uint16(555), uint16(1015), uint16(341), uint16(564), uint16(108), uint16(556), uint16(564), uint16(4),
+ /* 1600 */ uint16(1132), uint16(1286), uint16(533), uint16(564), uint16(856), uint16(343), uint16(145), uint16(532), uint16(345), uint16(1300),
+ /* 1610 */ uint16(136), uint16(136), uint16(1083), uint16(559), uint16(1083), uint16(449), uint16(564), uint16(1021), uint16(134), uint16(134),
+ /* 1620 */ uint16(1284), uint16(132), uint16(132), uint16(106), uint16(106), uint16(1285), uint16(133), uint16(133), uint16(564), uint16(352),
+ /* 1630 */ uint16(107), uint16(564), uint16(443), uint16(566), uint16(565), uint16(1340), uint16(443), uint16(1011), uint16(362), uint16(75),
+ /* 1640 */ uint16(75), uint16(1082), uint16(564), uint16(1082), uint16(564), uint16(924), uint16(1561), uint16(110), uint16(553), uint16(551),
+ /* 1650 */ uint16(1015), uint16(77), uint16(77), uint16(1361), uint16(74), uint16(74), uint16(1408), uint16(1336), uint16(1347), uint16(550),
+ /* 1660 */ uint16(1414), uint16(1265), uint16(1256), uint16(1244), uint16(1243), uint16(42), uint16(42), uint16(48), uint16(48), uint16(1011),
+ /* 1670 */ uint16(1011), uint16(1013), uint16(1014), uint16(27), uint16(1245), uint16(1580), uint16(490), uint16(1021), uint16(267), uint16(202),
+ /* 1680 */ uint16(1333), uint16(365), uint16(11), uint16(106), uint16(106), uint16(930), uint16(367), uint16(210), uint16(369), uint16(391),
+ /* 1690 */ uint16(107), uint16(1395), uint16(443), uint16(566), uint16(565), uint16(223), uint16(1390), uint16(1011), uint16(500), uint16(454),
+ /* 1700 */ uint16(282), uint16(1400), uint16(285), uint16(108), uint16(556), uint16(214), uint16(4), uint16(325), uint16(1383), uint16(1283),
+ /* 1710 */ uint16(475), uint16(355), uint16(1473), uint16(1583), uint16(1472), uint16(1399), uint16(371), uint16(1222), uint16(326), uint16(398),
+ /* 1720 */ uint16(559), uint16(290), uint16(331), uint16(197), uint16(100), uint16(556), uint16(209), uint16(4), uint16(198), uint16(1011),
+ /* 1730 */ uint16(1011), uint16(1013), uint16(1014), uint16(27), uint16(385), uint16(256), uint16(1520), uint16(1518), uint16(554), uint16(1219),
+ /* 1740 */ uint16(416), uint16(559), uint16(83), uint16(443), uint16(173), uint16(206), uint16(182), uint16(221), uint16(459), uint16(167),
+ /* 1750 */ uint16(177), uint16(460), uint16(175), uint16(493), uint16(233), uint16(553), uint16(79), uint16(178), uint16(1396), uint16(179),
+ /* 1760 */ uint16(35), uint16(180), uint16(96), uint16(1402), uint16(443), uint16(396), uint16(36), uint16(467), uint16(1478), uint16(1401),
+ /* 1770 */ uint16(482), uint16(237), uint16(1404), uint16(399), uint16(82), uint16(186), uint16(553), uint16(1467), uint16(89), uint16(488),
+ /* 1780 */ uint16(190), uint16(268), uint16(239), uint16(491), uint16(1021), uint16(340), uint16(240), uint16(401), uint16(1246), uint16(1489),
+ /* 1790 */ uint16(106), uint16(106), uint16(336), uint16(509), uint16(1294), uint16(241), uint16(1303), uint16(107), uint16(430), uint16(443),
+ /* 1800 */ uint16(566), uint16(565), uint16(1302), uint16(91), uint16(1011), uint16(1021), uint16(1598), uint16(1301), uint16(1273), uint16(215),
+ /* 1810 */ uint16(1597), uint16(106), uint16(106), uint16(402), uint16(877), uint16(432), uint16(354), uint16(1272), uint16(107), uint16(1271),
+ /* 1820 */ uint16(443), uint16(566), uint16(565), uint16(1596), uint16(1566), uint16(1011), uint16(1293), uint16(433), uint16(518), uint16(299),
+ /* 1830 */ uint16(300), uint16(360), uint16(95), uint16(525), uint16(1344), uint16(364), uint16(1011), uint16(1011), uint16(1013), uint16(1014),
+ /* 1840 */ uint16(27), uint16(254), uint16(255), uint16(1552), uint16(436), uint16(1551), uint16(125), uint16(544), uint16(10), uint16(379),
+ /* 1850 */ uint16(1326), uint16(1453), uint16(102), uint16(97), uint16(1345), uint16(528), uint16(304), uint16(1011), uint16(1011), uint16(1013),
+ /* 1860 */ uint16(1014), uint16(27), uint16(366), uint16(377), uint16(1343), uint16(1342), uint16(368), uint16(370), uint16(1325), uint16(384),
+ /* 1870 */ uint16(201), uint16(383), uint16(34), uint16(1368), uint16(1367), uint16(568), uint16(1177), uint16(266), uint16(263), uint16(265),
+ /* 1880 */ uint16(1505), uint16(159), uint16(569), uint16(1241), uint16(1236), uint16(1506), uint16(160), uint16(142), uint16(1504), uint16(1503),
+ /* 1890 */ uint16(297), uint16(211), uint16(830), uint16(161), uint16(212), uint16(78), uint16(444), uint16(203), uint16(308), uint16(222),
+ /* 1900 */ uint16(1081), uint16(139), uint16(1079), uint16(316), uint16(174), uint16(163), uint16(1203), uint16(229), uint16(176), uint16(909),
+ /* 1910 */ uint16(324), uint16(232), uint16(1095), uint16(181), uint16(409), uint16(410), uint16(172), uint16(164), uint16(165), uint16(419),
+ /* 1920 */ uint16(183), uint16(85), uint16(86), uint16(421), uint16(166), uint16(87), uint16(88), uint16(1098), uint16(1094), uint16(234),
+ /* 1930 */ uint16(235), uint16(152), uint16(18), uint16(236), uint16(335), uint16(1087), uint16(1216), uint16(252), uint16(187), uint16(487),
+ /* 1940 */ uint16(238), uint16(188), uint16(37), uint16(845), uint16(492), uint16(356), uint16(242), uint16(496), uint16(351), uint16(501),
+ /* 1950 */ uint16(189), uint16(90), uint16(19), uint16(504), uint16(348), uint16(20), uint16(875), uint16(92), uint16(298), uint16(168),
+ /* 1960 */ uint16(888), uint16(153), uint16(93), uint16(511), uint16(94), uint16(1165), uint16(154), uint16(1047), uint16(1134), uint16(39),
+ /* 1970 */ uint16(216), uint16(1133), uint16(271), uint16(273), uint16(958), uint16(192), uint16(953), uint16(110), uint16(1151), uint16(1155),
+ /* 1980 */ uint16(251), uint16(7), uint16(21), uint16(1159), uint16(1139), uint16(22), uint16(1153), uint16(33), uint16(23), uint16(24),
+ /* 1990 */ uint16(25), uint16(540), uint16(1158), uint16(195), uint16(98), uint16(1062), uint16(26), uint16(1048), uint16(1046), uint16(1050),
+ /* 2000 */ uint16(1104), uint16(1051), uint16(1103), uint16(257), uint16(258), uint16(28), uint16(40), uint16(1173), uint16(1016), uint16(857),
+ /* 2010 */ uint16(109), uint16(29), uint16(560), uint16(388), uint16(138), uint16(1172), uint16(259), uint16(170), uint16(260), uint16(1232),
+ /* 2020 */ uint16(1232), uint16(919), uint16(1232), uint16(1232), uint16(1232), uint16(1232), uint16(1232), uint16(1232), uint16(1232), uint16(1232),
+ /* 2030 */ uint16(1232), uint16(1232), uint16(1589), uint16(1232), uint16(1232), uint16(1232), uint16(1588),
+} /* sqlite3.c:160023:27 */
+var yy_lookahead = [2221]uint16{
+ /* 0 */ uint16(192), uint16(273), uint16(274), uint16(275), uint16(192), uint16(192), uint16(273), uint16(274), uint16(275), uint16(192),
+ /* 10 */ uint16(218), uint16(215), uint16(192), uint16(218), uint16(192), uint16(212), uint16(234), uint16(235), uint16(205), uint16(19),
+ /* 20 */ uint16(11), uint16(192), uint16(294), uint16(215), uint16(216), uint16(203), uint16(192), uint16(203), uint16(209), uint16(210),
+ /* 30 */ uint16(211), uint16(31), uint16(215), uint16(216), uint16(205), uint16(215), uint16(216), uint16(215), uint16(216), uint16(39),
+ /* 40 */ uint16(227), uint16(215), uint16(229), uint16(43), uint16(44), uint16(45), uint16(46), uint16(47), uint16(48), uint16(49),
+ /* 50 */ uint16(50), uint16(51), uint16(52), uint16(53), uint16(54), uint16(55), uint16(56), uint16(57), uint16(192), uint16(19),
+ /* 60 */ uint16(238), uint16(239), uint16(238), uint16(239), uint16(215), uint16(273), uint16(274), uint16(275), uint16(273), uint16(274),
+ /* 70 */ uint16(275), uint16(237), uint16(21), uint16(251), uint16(252), uint16(251), uint16(273), uint16(274), uint16(275), uint16(255),
+ /* 80 */ uint16(256), uint16(215), uint16(216), uint16(43), uint16(44), uint16(45), uint16(46), uint16(47), uint16(48), uint16(49),
+ /* 90 */ uint16(50), uint16(51), uint16(52), uint16(53), uint16(54), uint16(55), uint16(56), uint16(57), uint16(209), uint16(210),
+ /* 100 */ uint16(211), uint16(76), uint16(102), uint16(103), uint16(104), uint16(105), uint16(106), uint16(107), uint16(108), uint16(109),
+ /* 110 */ uint16(110), uint16(111), uint16(112), uint16(59), uint16(89), uint16(111), uint16(112), uint16(92), uint16(252), uint16(307),
+ /* 120 */ uint16(308), uint16(313), uint16(314), uint16(112), uint16(312), uint16(59), uint16(86), uint16(261), uint16(88), uint16(19),
+ /* 130 */ uint16(313), uint16(80), uint16(315), uint16(313), uint16(314), uint16(25), uint16(127), uint16(128), uint16(54), uint16(55),
/* 140 */ uint16(56), uint16(57), uint16(102), uint16(103), uint16(104), uint16(105), uint16(106), uint16(107), uint16(108), uint16(109),
/* 150 */ uint16(110), uint16(111), uint16(112), uint16(43), uint16(44), uint16(45), uint16(46), uint16(47), uint16(48), uint16(49),
- /* 160 */ uint16(50), uint16(51), uint16(52), uint16(53), uint16(54), uint16(55), uint16(56), uint16(57), uint16(53), uint16(115),
- /* 170 */ uint16(116), uint16(117), uint16(118), uint16(309), uint16(310), uint16(121), uint16(122), uint16(123), uint16(77), uint16(69),
- /* 180 */ uint16(79), uint16(115), uint16(116), uint16(117), uint16(59), uint16(131), uint16(102), uint16(103), uint16(104), uint16(105),
- /* 190 */ uint16(106), uint16(107), uint16(108), uint16(109), uint16(110), uint16(111), uint16(112), uint16(72), uint16(148), uint16(19),
+ /* 160 */ uint16(50), uint16(51), uint16(52), uint16(53), uint16(54), uint16(55), uint16(56), uint16(57), uint16(192), uint16(115),
+ /* 170 */ uint16(116), uint16(117), uint16(118), uint16(122), uint16(192), uint16(121), uint16(122), uint16(123), uint16(202), uint16(69),
+ /* 180 */ uint16(204), uint16(115), uint16(116), uint16(117), uint16(192), uint16(131), uint16(102), uint16(103), uint16(104), uint16(105),
+ /* 190 */ uint16(106), uint16(107), uint16(108), uint16(109), uint16(110), uint16(111), uint16(112), uint16(215), uint16(216), uint16(19),
/* 200 */ uint16(54), uint16(55), uint16(56), uint16(57), uint16(58), uint16(108), uint16(109), uint16(110), uint16(111), uint16(112),
- /* 210 */ uint16(304), uint16(305), uint16(102), uint16(103), uint16(104), uint16(105), uint16(106), uint16(107), uint16(108), uint16(109),
+ /* 210 */ uint16(192), uint16(160), uint16(102), uint16(103), uint16(104), uint16(105), uint16(106), uint16(107), uint16(108), uint16(109),
/* 220 */ uint16(110), uint16(111), uint16(112), uint16(43), uint16(44), uint16(45), uint16(46), uint16(47), uint16(48), uint16(49),
- /* 230 */ uint16(50), uint16(51), uint16(52), uint16(53), uint16(54), uint16(55), uint16(56), uint16(57), uint16(19), uint16(112),
- /* 240 */ uint16(115), uint16(116), uint16(117), uint16(24), uint16(208), uint16(209), uint16(210), uint16(67), uint16(102), uint16(103),
- /* 250 */ uint16(104), uint16(105), uint16(106), uint16(107), uint16(108), uint16(109), uint16(110), uint16(111), uint16(112), uint16(192),
- /* 260 */ uint16(59), uint16(160), uint16(43), uint16(44), uint16(45), uint16(46), uint16(47), uint16(48), uint16(49), uint16(50),
- /* 270 */ uint16(51), uint16(52), uint16(53), uint16(54), uint16(55), uint16(56), uint16(57), uint16(19), uint16(46), uint16(47),
- /* 280 */ uint16(48), uint16(49), uint16(102), uint16(103), uint16(104), uint16(105), uint16(106), uint16(107), uint16(108), uint16(109),
- /* 290 */ uint16(110), uint16(111), uint16(112), uint16(213), uint16(73), uint16(184), uint16(185), uint16(186), uint16(187), uint16(188),
- /* 300 */ uint16(189), uint16(221), uint16(81), uint16(236), uint16(46), uint16(194), uint16(192), uint16(196), uint16(19), uint16(59),
- /* 310 */ uint16(133), uint16(59), uint16(135), uint16(136), uint16(203), uint16(192), uint16(115), uint16(116), uint16(117), uint16(127),
- /* 320 */ uint16(128), uint16(102), uint16(103), uint16(104), uint16(105), uint16(106), uint16(107), uint16(108), uint16(109), uint16(110),
+ /* 230 */ uint16(50), uint16(51), uint16(52), uint16(53), uint16(54), uint16(55), uint16(56), uint16(57), uint16(19), uint16(46),
+ /* 240 */ uint16(47), uint16(48), uint16(49), uint16(24), uint16(248), uint16(192), uint16(250), uint16(67), uint16(102), uint16(103),
+ /* 250 */ uint16(104), uint16(105), uint16(106), uint16(107), uint16(108), uint16(109), uint16(110), uint16(111), uint16(112), uint16(277),
+ /* 260 */ uint16(127), uint16(128), uint16(43), uint16(44), uint16(45), uint16(46), uint16(47), uint16(48), uint16(49), uint16(50),
+ /* 270 */ uint16(51), uint16(52), uint16(53), uint16(54), uint16(55), uint16(56), uint16(57), uint16(26), uint16(164), uint16(165),
+ /* 280 */ uint16(272), uint16(263), uint16(102), uint16(103), uint16(104), uint16(105), uint16(106), uint16(107), uint16(108), uint16(109),
+ /* 290 */ uint16(110), uint16(111), uint16(112), uint16(184), uint16(185), uint16(186), uint16(187), uint16(188), uint16(189), uint16(186),
+ /* 300 */ uint16(187), uint16(188), uint16(189), uint16(194), uint16(76), uint16(196), uint16(229), uint16(194), uint16(19), uint16(196),
+ /* 310 */ uint16(59), uint16(192), uint16(203), uint16(120), uint16(59), uint16(87), uint16(203), uint16(89), uint16(310), uint16(311),
+ /* 320 */ uint16(92), uint16(102), uint16(103), uint16(104), uint16(105), uint16(106), uint16(107), uint16(108), uint16(109), uint16(110),
/* 330 */ uint16(111), uint16(112), uint16(43), uint16(44), uint16(45), uint16(46), uint16(47), uint16(48), uint16(49), uint16(50),
- /* 340 */ uint16(51), uint16(52), uint16(53), uint16(54), uint16(55), uint16(56), uint16(57), uint16(126), uint16(237), uint16(238),
- /* 350 */ uint16(100), uint16(150), uint16(120), uint16(230), uint16(186), uint16(187), uint16(188), uint16(189), uint16(137), uint16(138),
- /* 360 */ uint16(108), uint16(250), uint16(194), uint16(26), uint16(196), uint16(115), uint16(116), uint16(115), uint16(116), uint16(117),
- /* 370 */ uint16(120), uint16(203), uint16(114), uint16(164), uint16(165), uint16(264), uint16(102), uint16(103), uint16(104), uint16(105),
- /* 380 */ uint16(106), uint16(107), uint16(108), uint16(109), uint16(110), uint16(111), uint16(112), uint16(192), uint16(130), uint16(111),
- /* 390 */ uint16(112), uint16(102), uint16(103), uint16(104), uint16(105), uint16(106), uint16(107), uint16(108), uint16(109), uint16(110),
- /* 400 */ uint16(111), uint16(112), uint16(152), uint16(153), uint16(154), uint16(237), uint16(238), uint16(296), uint16(192), uint16(214),
- /* 410 */ uint16(215), uint16(228), uint16(192), uint16(307), uint16(192), uint16(19), uint16(59), uint16(311), uint16(250), uint16(23),
- /* 420 */ uint16(22), uint16(106), uint16(107), uint16(108), uint16(109), uint16(110), uint16(111), uint16(112), uint16(192), uint16(72),
- /* 430 */ uint16(214), uint16(215), uint16(264), uint16(192), uint16(214), uint16(215), uint16(214), uint16(215), uint16(149), uint16(43),
+ /* 340 */ uint16(51), uint16(52), uint16(53), uint16(54), uint16(55), uint16(56), uint16(57), uint16(238), uint16(239), uint16(73),
+ /* 350 */ uint16(231), uint16(238), uint16(239), uint16(22), uint16(23), uint16(100), uint16(25), uint16(81), uint16(305), uint16(306),
+ /* 360 */ uint16(251), uint16(23), uint16(25), uint16(25), uint16(251), uint16(272), uint16(115), uint16(116), uint16(117), uint16(214),
+ /* 370 */ uint16(115), uint16(116), uint16(144), uint16(192), uint16(265), uint16(120), uint16(114), uint16(222), uint16(265), uint16(102),
+ /* 380 */ uint16(103), uint16(104), uint16(105), uint16(106), uint16(107), uint16(108), uint16(109), uint16(110), uint16(111), uint16(112),
+ /* 390 */ uint16(192), uint16(102), uint16(103), uint16(104), uint16(105), uint16(106), uint16(107), uint16(108), uint16(109), uint16(110),
+ /* 400 */ uint16(111), uint16(112), uint16(126), uint16(310), uint16(311), uint16(192), uint16(297), uint16(152), uint16(153), uint16(154),
+ /* 410 */ uint16(297), uint16(149), uint16(192), uint16(137), uint16(138), uint16(19), uint16(192), uint16(100), uint16(192), uint16(23),
+ /* 420 */ uint16(22), uint16(106), uint16(107), uint16(108), uint16(109), uint16(110), uint16(111), uint16(112), uint16(215), uint16(216),
+ /* 430 */ uint16(106), uint16(107), uint16(101), uint16(116), uint16(192), uint16(215), uint16(216), uint16(120), uint16(149), uint16(43),
/* 440 */ uint16(44), uint16(45), uint16(46), uint16(47), uint16(48), uint16(49), uint16(50), uint16(51), uint16(52), uint16(53),
- /* 450 */ uint16(54), uint16(55), uint16(56), uint16(57), uint16(117), uint16(214), uint16(215), uint16(59), uint16(19), uint16(187),
- /* 460 */ uint16(192), uint16(189), uint16(23), uint16(81), uint16(296), uint16(192), uint16(194), uint16(251), uint16(196), uint16(59),
- /* 470 */ uint16(229), uint16(251), uint16(115), uint16(116), uint16(117), uint16(203), uint16(260), uint16(106), uint16(107), uint16(142),
- /* 480 */ uint16(260), uint16(267), uint16(43), uint16(44), uint16(45), uint16(46), uint16(47), uint16(48), uint16(49), uint16(50),
- /* 490 */ uint16(51), uint16(52), uint16(53), uint16(54), uint16(55), uint16(56), uint16(57), uint16(261), uint16(102), uint16(103),
- /* 500 */ uint16(104), uint16(105), uint16(106), uint16(107), uint16(108), uint16(109), uint16(110), uint16(111), uint16(112), uint16(237),
- /* 510 */ uint16(238), uint16(76), uint16(192), uint16(115), uint16(116), uint16(117), uint16(144), uint16(192), uint16(76), uint16(137),
- /* 520 */ uint16(138), uint16(192), uint16(250), uint16(152), uint16(89), uint16(154), uint16(116), uint16(92), uint16(19), uint16(87),
- /* 530 */ uint16(262), uint16(89), uint16(23), uint16(22), uint16(92), uint16(163), uint16(264), uint16(192), uint16(22), uint16(214),
- /* 540 */ uint16(215), uint16(102), uint16(103), uint16(104), uint16(105), uint16(106), uint16(107), uint16(108), uint16(109), uint16(110),
+ /* 450 */ uint16(54), uint16(55), uint16(56), uint16(57), uint16(117), uint16(117), uint16(192), uint16(59), uint16(19), uint16(187),
+ /* 460 */ uint16(59), uint16(189), uint16(23), uint16(282), uint16(240), uint16(252), uint16(194), uint16(192), uint16(196), uint16(152),
+ /* 470 */ uint16(153), uint16(154), uint16(252), uint16(72), uint16(261), uint16(203), uint16(152), uint16(25), uint16(154), uint16(142),
+ /* 480 */ uint16(142), uint16(261), uint16(43), uint16(44), uint16(45), uint16(46), uint16(47), uint16(48), uint16(49), uint16(50),
+ /* 490 */ uint16(51), uint16(52), uint16(53), uint16(54), uint16(55), uint16(56), uint16(57), uint16(192), uint16(102), uint16(103),
+ /* 500 */ uint16(104), uint16(105), uint16(106), uint16(107), uint16(108), uint16(109), uint16(110), uint16(111), uint16(112), uint16(267),
+ /* 510 */ uint16(238), uint16(239), uint16(237), uint16(115), uint16(116), uint16(117), uint16(115), uint16(116), uint16(117), uint16(192),
+ /* 520 */ uint16(59), uint16(118), uint16(16), uint16(251), uint16(121), uint16(122), uint16(123), uint16(303), uint16(19), uint16(303),
+ /* 530 */ uint16(59), uint16(267), uint16(23), uint16(72), uint16(131), uint16(308), uint16(22), uint16(265), uint16(22), uint16(312),
+ /* 540 */ uint16(24), uint16(102), uint16(103), uint16(104), uint16(105), uint16(106), uint16(107), uint16(108), uint16(109), uint16(110),
/* 550 */ uint16(111), uint16(112), uint16(43), uint16(44), uint16(45), uint16(46), uint16(47), uint16(48), uint16(49), uint16(50),
- /* 560 */ uint16(51), uint16(52), uint16(53), uint16(54), uint16(55), uint16(56), uint16(57), uint16(19), uint16(296), uint16(118),
- /* 570 */ uint16(59), uint16(23), uint16(121), uint16(122), uint16(123), uint16(59), uint16(251), uint16(26), uint16(46), uint16(306),
- /* 580 */ uint16(307), uint16(261), uint16(131), uint16(192), uint16(311), uint16(192), uint16(144), uint16(192), uint16(22), uint16(203),
- /* 590 */ uint16(100), uint16(43), uint16(44), uint16(45), uint16(46), uint16(47), uint16(48), uint16(49), uint16(50), uint16(51),
- /* 600 */ uint16(52), uint16(53), uint16(54), uint16(55), uint16(56), uint16(57), uint16(116), uint16(214), uint16(215), uint16(271),
- /* 610 */ uint16(120), uint16(102), uint16(103), uint16(104), uint16(105), uint16(106), uint16(107), uint16(108), uint16(109), uint16(110),
- /* 620 */ uint16(111), uint16(112), uint16(229), uint16(237), uint16(238), uint16(59), uint16(115), uint16(116), uint16(117), uint16(299),
- /* 630 */ uint16(300), uint16(115), uint16(116), uint16(117), uint16(59), uint16(16), uint16(250), uint16(19), uint16(192), uint16(192),
- /* 640 */ uint16(19), uint16(23), uint16(152), uint16(153), uint16(154), uint16(24), uint16(114), uint16(309), uint16(310), uint16(192),
+ /* 560 */ uint16(51), uint16(52), uint16(53), uint16(54), uint16(55), uint16(56), uint16(57), uint16(19), uint16(81), uint16(297),
+ /* 570 */ uint16(295), uint16(23), uint16(192), uint16(59), uint16(203), uint16(59), uint16(115), uint16(116), uint16(117), uint16(108),
+ /* 580 */ uint16(192), uint16(73), uint16(25), uint16(77), uint16(192), uint16(79), uint16(115), uint16(116), uint16(117), uint16(137),
+ /* 590 */ uint16(138), uint16(43), uint16(44), uint16(45), uint16(46), uint16(47), uint16(48), uint16(49), uint16(50), uint16(51),
+ /* 600 */ uint16(52), uint16(53), uint16(54), uint16(55), uint16(56), uint16(57), uint16(119), uint16(215), uint16(216), uint16(238),
+ /* 610 */ uint16(239), uint16(102), uint16(103), uint16(104), uint16(105), uint16(106), uint16(107), uint16(108), uint16(109), uint16(110),
+ /* 620 */ uint16(111), uint16(112), uint16(251), uint16(192), uint16(137), uint16(138), uint16(59), uint16(234), uint16(235), uint16(115),
+ /* 630 */ uint16(116), uint16(117), uint16(116), uint16(76), uint16(126), uint16(127), uint16(128), uint16(19), uint16(192), uint16(268),
+ /* 640 */ uint16(19), uint16(23), uint16(22), uint16(192), uint16(252), uint16(24), uint16(89), uint16(300), uint16(301), uint16(92),
/* 650 */ uint16(102), uint16(103), uint16(104), uint16(105), uint16(106), uint16(107), uint16(108), uint16(109), uint16(110), uint16(111),
/* 660 */ uint16(112), uint16(43), uint16(44), uint16(45), uint16(46), uint16(47), uint16(48), uint16(49), uint16(50), uint16(51),
- /* 670 */ uint16(52), uint16(53), uint16(54), uint16(55), uint16(56), uint16(57), uint16(19), uint16(7), uint16(8), uint16(9),
- /* 680 */ uint16(23), uint16(115), uint16(116), uint16(117), uint16(203), uint16(290), uint16(239), uint16(238), uint16(137), uint16(138),
- /* 690 */ uint16(115), uint16(116), uint16(117), uint16(236), uint16(192), uint16(22), uint16(77), uint16(81), uint16(79), uint16(250),
+ /* 670 */ uint16(52), uint16(53), uint16(54), uint16(55), uint16(56), uint16(57), uint16(19), uint16(192), uint16(192), uint16(59),
+ /* 680 */ uint16(23), uint16(192), uint16(115), uint16(116), uint16(117), uint16(200), uint16(240), uint16(307), uint16(308), uint16(22),
+ /* 690 */ uint16(205), uint16(81), uint16(312), uint16(262), uint16(22), uint16(192), uint16(133), uint16(22), uint16(135), uint16(136),
/* 700 */ uint16(43), uint16(44), uint16(45), uint16(46), uint16(47), uint16(48), uint16(49), uint16(50), uint16(51), uint16(52),
- /* 710 */ uint16(53), uint16(54), uint16(55), uint16(56), uint16(57), uint16(192), uint16(95), uint16(142), uint16(237), uint16(238),
+ /* 710 */ uint16(53), uint16(54), uint16(55), uint16(56), uint16(57), uint16(197), uint16(95), uint16(150), uint16(215), uint16(216),
/* 720 */ uint16(102), uint16(103), uint16(104), uint16(105), uint16(106), uint16(107), uint16(108), uint16(109), uint16(110), uint16(111),
- /* 730 */ uint16(112), uint16(250), uint16(59), uint16(112), uint16(192), uint16(119), uint16(26), uint16(214), uint16(215), uint16(118),
- /* 740 */ uint16(119), uint16(120), uint16(121), uint16(122), uint16(123), uint16(124), uint16(19), uint16(192), uint16(267), uint16(302),
- /* 750 */ uint16(23), uint16(130), uint16(229), uint16(137), uint16(138), uint16(23), uint16(214), uint16(215), uint16(26), uint16(102),
+ /* 730 */ uint16(112), uint16(59), uint16(192), uint16(112), uint16(59), uint16(115), uint16(116), uint16(117), uint16(192), uint16(118),
+ /* 740 */ uint16(119), uint16(120), uint16(121), uint16(122), uint16(123), uint16(124), uint16(19), uint16(137), uint16(138), uint16(303),
+ /* 750 */ uint16(23), uint16(130), uint16(192), uint16(267), uint16(192), uint16(252), uint16(267), uint16(306), uint16(203), uint16(102),
/* 760 */ uint16(103), uint16(104), uint16(105), uint16(106), uint16(107), uint16(108), uint16(109), uint16(110), uint16(111), uint16(112),
/* 770 */ uint16(43), uint16(44), uint16(45), uint16(46), uint16(47), uint16(48), uint16(49), uint16(50), uint16(51), uint16(52),
- /* 780 */ uint16(53), uint16(54), uint16(55), uint16(56), uint16(57), uint16(19), uint16(76), uint16(11), uint16(115), uint16(116),
- /* 790 */ uint16(117), uint16(192), uint16(29), uint16(251), uint16(239), uint16(73), uint16(33), uint16(192), uint16(192), uint16(89),
- /* 800 */ uint16(192), uint16(192), uint16(92), uint16(192), uint16(192), uint16(126), uint16(127), uint16(128), uint16(224), uint16(43),
+ /* 780 */ uint16(53), uint16(54), uint16(55), uint16(56), uint16(57), uint16(19), uint16(240), uint16(115), uint16(116), uint16(117),
+ /* 790 */ uint16(115), uint16(116), uint16(117), uint16(238), uint16(239), uint16(222), uint16(192), uint16(224), uint16(280), uint16(237),
+ /* 800 */ uint16(240), uint16(192), uint16(284), uint16(192), uint16(59), uint16(232), uint16(251), uint16(140), uint16(204), uint16(43),
/* 810 */ uint16(44), uint16(45), uint16(46), uint16(47), uint16(48), uint16(49), uint16(50), uint16(51), uint16(52), uint16(53),
- /* 820 */ uint16(54), uint16(55), uint16(56), uint16(57), uint16(192), uint16(35), uint16(214), uint16(215), uint16(65), uint16(102),
+ /* 820 */ uint16(54), uint16(55), uint16(56), uint16(57), uint16(192), uint16(35), uint16(215), uint16(216), uint16(192), uint16(102),
/* 830 */ uint16(103), uint16(104), uint16(105), uint16(106), uint16(107), uint16(108), uint16(109), uint16(110), uint16(111), uint16(112),
- /* 840 */ uint16(59), uint16(229), uint16(192), uint16(192), uint16(239), uint16(239), uint16(214), uint16(215), uint16(126), uint16(127),
- /* 850 */ uint16(128), uint16(126), uint16(127), uint16(128), uint16(307), uint16(19), uint16(66), uint16(302), uint16(311), uint16(192),
- /* 860 */ uint16(261), uint16(229), uint16(224), uint16(22), uint16(74), uint16(214), uint16(215), uint16(192), uint16(102), uint16(103),
+ /* 840 */ uint16(59), uint16(230), uint16(192), uint16(192), uint16(238), uint16(239), uint16(237), uint16(215), uint16(216), uint16(303),
+ /* 850 */ uint16(308), uint16(215), uint16(216), uint16(16), uint16(312), uint16(19), uint16(66), uint16(251), uint16(126), uint16(127),
+ /* 860 */ uint16(128), uint16(116), uint16(230), uint16(303), uint16(74), uint16(203), uint16(215), uint16(216), uint16(102), uint16(103),
/* 870 */ uint16(104), uint16(105), uint16(106), uint16(107), uint16(108), uint16(109), uint16(110), uint16(111), uint16(112), uint16(43),
/* 880 */ uint16(44), uint16(45), uint16(46), uint16(47), uint16(48), uint16(49), uint16(50), uint16(51), uint16(52), uint16(53),
- /* 890 */ uint16(54), uint16(55), uint16(56), uint16(57), uint16(192), uint16(192), uint16(115), uint16(116), uint16(117), uint16(19),
- /* 900 */ uint16(59), uint16(290), uint16(251), uint16(127), uint16(128), uint16(192), uint16(23), uint16(302), uint16(302), uint16(26),
- /* 910 */ uint16(302), uint16(236), uint16(192), uint16(22), uint16(21), uint16(24), uint16(214), uint16(215), uint16(192), uint16(129),
- /* 920 */ uint16(22), uint16(192), uint16(24), uint16(142), uint16(158), uint16(45), uint16(46), uint16(47), uint16(48), uint16(49),
+ /* 890 */ uint16(54), uint16(55), uint16(56), uint16(57), uint16(192), uint16(212), uint16(115), uint16(116), uint16(117), uint16(19),
+ /* 900 */ uint16(238), uint16(239), uint16(192), uint16(252), uint16(7), uint16(8), uint16(9), uint16(192), uint16(192), uint16(238),
+ /* 910 */ uint16(239), uint16(308), uint16(262), uint16(251), uint16(77), uint16(312), uint16(79), uint16(215), uint16(216), uint16(129),
+ /* 920 */ uint16(210), uint16(211), uint16(251), uint16(142), uint16(158), uint16(45), uint16(46), uint16(47), uint16(48), uint16(49),
/* 930 */ uint16(50), uint16(51), uint16(52), uint16(53), uint16(54), uint16(55), uint16(56), uint16(57), uint16(102), uint16(103),
- /* 940 */ uint16(104), uint16(105), uint16(106), uint16(107), uint16(108), uint16(109), uint16(110), uint16(111), uint16(112), uint16(192),
- /* 950 */ uint16(59), uint16(12), uint16(192), uint16(251), uint16(192), uint16(305), uint16(192), uint16(116), uint16(22), uint16(23),
- /* 960 */ uint16(242), uint16(203), uint16(26), uint16(203), uint16(24), uint16(236), uint16(27), uint16(237), uint16(238), uint16(266),
- /* 970 */ uint16(252), uint16(214), uint16(215), uint16(80), uint16(214), uint16(215), uint16(214), uint16(215), uint16(214), uint16(215),
- /* 980 */ uint16(250), uint16(42), uint16(102), uint16(103), uint16(104), uint16(105), uint16(106), uint16(107), uint16(108), uint16(109),
- /* 990 */ uint16(110), uint16(111), uint16(112), uint16(229), uint16(158), uint16(237), uint16(238), uint16(237), uint16(238), uint16(59),
- /* 1000 */ uint16(117), uint16(281), uint16(63), uint16(192), uint16(192), uint16(192), uint16(192), uint16(116), uint16(250), uint16(192),
- /* 1010 */ uint16(250), uint16(251), uint16(73), uint16(251), uint16(19), uint16(122), uint16(290), uint16(237), uint16(238), uint16(24),
- /* 1020 */ uint16(260), uint16(209), uint16(210), uint16(209), uint16(210), uint16(142), uint16(242), uint16(214), uint16(215), uint16(197),
- /* 1030 */ uint16(250), uint16(22), uint16(23), uint16(276), uint16(19), uint16(26), uint16(252), uint16(101), uint16(43), uint16(44),
+ /* 940 */ uint16(104), uint16(105), uint16(106), uint16(107), uint16(108), uint16(109), uint16(110), uint16(111), uint16(112), uint16(12),
+ /* 950 */ uint16(59), uint16(192), uint16(192), uint16(237), uint16(252), uint16(243), uint16(192), uint16(192), uint16(126), uint16(127),
+ /* 960 */ uint16(128), uint16(192), uint16(308), uint16(203), uint16(27), uint16(253), uint16(312), uint16(308), uint16(285), uint16(207),
+ /* 970 */ uint16(208), uint16(312), uint16(157), uint16(290), uint16(159), uint16(215), uint16(216), uint16(262), uint16(192), uint16(42),
+ /* 980 */ uint16(215), uint16(216), uint16(102), uint16(103), uint16(104), uint16(105), uint16(106), uint16(107), uint16(108), uint16(109),
+ /* 990 */ uint16(110), uint16(111), uint16(112), uint16(283), uint16(158), uint16(230), uint16(237), uint16(160), uint16(238), uint16(239),
+ /* 1000 */ uint16(63), uint16(215), uint16(216), uint16(192), uint16(192), uint16(12), uint16(115), uint16(116), uint16(117), uint16(22),
+ /* 1010 */ uint16(73), uint16(251), uint16(252), uint16(192), uint16(19), uint16(192), uint16(230), uint16(239), uint16(24), uint16(24),
+ /* 1020 */ uint16(27), uint16(261), uint16(210), uint16(211), uint16(99), uint16(192), uint16(215), uint16(216), uint16(225), uint16(251),
+ /* 1030 */ uint16(192), uint16(192), uint16(263), uint16(142), uint16(19), uint16(42), uint16(215), uint16(216), uint16(43), uint16(44),
/* 1040 */ uint16(45), uint16(46), uint16(47), uint16(48), uint16(49), uint16(50), uint16(51), uint16(52), uint16(53), uint16(54),
- /* 1050 */ uint16(55), uint16(56), uint16(57), uint16(160), uint16(19), uint16(211), uint16(116), uint16(192), uint16(43), uint16(44),
+ /* 1050 */ uint16(55), uint16(56), uint16(57), uint16(59), uint16(19), uint16(291), uint16(63), uint16(132), uint16(43), uint16(44),
/* 1060 */ uint16(45), uint16(46), uint16(47), uint16(48), uint16(49), uint16(50), uint16(51), uint16(52), uint16(53), uint16(54),
- /* 1070 */ uint16(55), uint16(56), uint16(57), uint16(192), uint16(192), uint16(22), uint16(192), uint16(266), uint16(43), uint16(44),
+ /* 1070 */ uint16(55), uint16(56), uint16(57), uint16(252), uint16(22), uint16(23), uint16(22), uint16(25), uint16(43), uint16(44),
/* 1080 */ uint16(45), uint16(46), uint16(47), uint16(48), uint16(49), uint16(50), uint16(51), uint16(52), uint16(53), uint16(54),
- /* 1090 */ uint16(55), uint16(56), uint16(57), uint16(192), uint16(282), uint16(192), uint16(282), uint16(102), uint16(103), uint16(104),
+ /* 1090 */ uint16(55), uint16(56), uint16(57), uint16(106), uint16(107), uint16(283), uint16(263), uint16(102), uint16(103), uint16(104),
/* 1100 */ uint16(105), uint16(106), uint16(107), uint16(108), uint16(109), uint16(110), uint16(111), uint16(112), uint16(59), uint16(192),
- /* 1110 */ uint16(101), uint16(279), uint16(192), uint16(192), uint16(230), uint16(283), uint16(192), uint16(102), uint16(103), uint16(104),
- /* 1120 */ uint16(105), uint16(106), uint16(107), uint16(108), uint16(109), uint16(110), uint16(111), uint16(112), uint16(204), uint16(211),
- /* 1130 */ uint16(66), uint16(214), uint16(215), uint16(289), uint16(214), uint16(215), uint16(108), uint16(102), uint16(103), uint16(104),
- /* 1140 */ uint16(105), uint16(106), uint16(107), uint16(108), uint16(109), uint16(110), uint16(111), uint16(112), uint16(266), uint16(85),
- /* 1150 */ uint16(226), uint16(192), uint16(228), uint16(22), uint16(23), uint16(106), uint16(107), uint16(19), uint16(94), uint16(106),
- /* 1160 */ uint16(107), uint16(192), uint16(134), uint16(114), uint16(115), uint16(116), uint16(117), uint16(139), uint16(119), uint16(266),
- /* 1170 */ uint16(203), uint16(206), uint16(207), uint16(214), uint16(215), uint16(192), uint16(127), uint16(192), uint16(206), uint16(207),
+ /* 1110 */ uint16(116), uint16(144), uint16(29), uint16(59), uint16(291), uint16(192), uint16(33), uint16(102), uint16(103), uint16(104),
+ /* 1120 */ uint16(105), uint16(106), uint16(107), uint16(108), uint16(109), uint16(110), uint16(111), uint16(112), uint16(192), uint16(291),
+ /* 1130 */ uint16(163), uint16(19), uint16(215), uint16(216), uint16(15), uint16(192), uint16(108), uint16(102), uint16(103), uint16(104),
+ /* 1140 */ uint16(105), uint16(106), uint16(107), uint16(108), uint16(109), uint16(110), uint16(111), uint16(112), uint16(65), uint16(192),
+ /* 1150 */ uint16(66), uint16(215), uint16(216), uint16(101), uint16(231), uint16(106), uint16(107), uint16(19), uint16(215), uint16(216),
+ /* 1160 */ uint16(192), uint16(212), uint16(134), uint16(114), uint16(115), uint16(116), uint16(117), uint16(139), uint16(119), uint16(85),
+ /* 1170 */ uint16(116), uint16(207), uint16(208), uint16(230), uint16(192), uint16(19), uint16(127), uint16(192), uint16(94), uint16(60),
/* 1180 */ uint16(59), uint16(192), uint16(44), uint16(45), uint16(46), uint16(47), uint16(48), uint16(49), uint16(50), uint16(51),
- /* 1190 */ uint16(52), uint16(53), uint16(54), uint16(55), uint16(56), uint16(57), uint16(192), uint16(76), uint16(192), uint16(214),
- /* 1200 */ uint16(215), uint16(152), uint16(284), uint16(154), uint16(237), uint16(238), uint16(192), uint16(289), uint16(87), uint16(145),
- /* 1210 */ uint16(89), uint16(19), uint16(20), uint16(92), uint16(22), uint16(22), uint16(23), uint16(250), uint16(307), uint16(236),
- /* 1220 */ uint16(214), uint16(215), uint16(311), uint16(203), uint16(12), uint16(247), uint16(192), uint16(249), uint16(36), uint16(307),
- /* 1230 */ uint16(192), uint16(262), uint16(101), uint16(311), uint16(137), uint16(138), uint16(115), uint16(116), uint16(117), uint16(27),
+ /* 1190 */ uint16(52), uint16(53), uint16(54), uint16(55), uint16(56), uint16(57), uint16(192), uint16(76), uint16(192), uint16(31),
+ /* 1200 */ uint16(192), uint16(152), uint16(46), uint16(154), uint16(215), uint16(216), uint16(192), uint16(39), uint16(87), uint16(192),
+ /* 1210 */ uint16(89), uint16(19), uint16(20), uint16(92), uint16(22), uint16(192), uint16(22), uint16(23), uint16(22), uint16(230),
+ /* 1220 */ uint16(263), uint16(215), uint16(216), uint16(215), uint16(216), uint16(137), uint16(138), uint16(115), uint16(36), uint16(145),
+ /* 1230 */ uint16(128), uint16(192), uint16(215), uint16(216), uint16(22), uint16(23), uint16(115), uint16(116), uint16(117), uint16(290),
/* 1240 */ uint16(102), uint16(103), uint16(104), uint16(105), uint16(106), uint16(107), uint16(108), uint16(109), uint16(110), uint16(111),
- /* 1250 */ uint16(112), uint16(59), uint16(214), uint16(215), uint16(42), uint16(203), uint16(307), uint16(237), uint16(238), uint16(192),
- /* 1260 */ uint16(311), uint16(192), uint16(26), uint16(71), uint16(192), uint16(144), uint16(262), uint16(297), uint16(298), uint16(203),
- /* 1270 */ uint16(250), uint16(19), uint16(20), uint16(81), uint16(22), uint16(63), uint16(262), uint16(254), uint16(255), uint16(15),
- /* 1280 */ uint16(26), uint16(214), uint16(215), uint16(214), uint16(215), uint16(26), uint16(214), uint16(215), uint16(36), uint16(237),
- /* 1290 */ uint16(238), uint16(192), uint16(100), uint16(114), uint16(101), uint16(192), uint16(262), uint16(192), uint16(106), uint16(107),
- /* 1300 */ uint16(48), uint16(134), uint16(250), uint16(237), uint16(238), uint16(113), uint16(139), uint16(115), uint16(116), uint16(117),
- /* 1310 */ uint16(192), uint16(59), uint16(120), uint16(214), uint16(215), uint16(242), uint16(250), uint16(214), uint16(215), uint16(214),
- /* 1320 */ uint16(215), uint16(148), uint16(149), uint16(71), uint16(60), uint16(252), uint16(242), uint16(192), uint16(149), uint16(137),
- /* 1330 */ uint16(138), uint16(192), uint16(214), uint16(215), uint16(192), uint16(19), uint16(252), uint16(85), uint16(192), uint16(59),
- /* 1340 */ uint16(192), uint16(157), uint16(90), uint16(159), uint16(152), uint16(153), uint16(154), uint16(155), uint16(156), uint16(214),
- /* 1350 */ uint16(215), uint16(192), uint16(100), uint16(214), uint16(215), uint16(19), uint16(214), uint16(215), uint16(106), uint16(107),
- /* 1360 */ uint16(214), uint16(215), uint16(214), uint16(215), uint16(22), uint16(113), uint16(192), uint16(115), uint16(116), uint16(117),
- /* 1370 */ uint16(192), uint16(242), uint16(120), uint16(214), uint16(215), uint16(192), uint16(24), uint16(192), uint16(31), uint16(192),
- /* 1380 */ uint16(144), uint16(252), uint16(26), uint16(192), uint16(125), uint16(99), uint16(39), uint16(192), uint16(214), uint16(215),
- /* 1390 */ uint16(192), uint16(59), uint16(214), uint16(215), uint16(192), uint16(141), uint16(116), uint16(214), uint16(215), uint16(214),
- /* 1400 */ uint16(215), uint16(214), uint16(215), uint16(61), uint16(152), uint16(153), uint16(154), uint16(155), uint16(156), uint16(0),
- /* 1410 */ uint16(1), uint16(2), uint16(214), uint16(215), uint16(5), uint16(192), uint16(214), uint16(215), uint16(132), uint16(10),
- /* 1420 */ uint16(11), uint16(12), uint16(13), uint16(14), uint16(1), uint16(2), uint16(17), uint16(192), uint16(5), uint16(19),
- /* 1430 */ uint16(20), uint16(115), uint16(22), uint16(10), uint16(11), uint16(12), uint16(13), uint16(14), uint16(192), uint16(30),
- /* 1440 */ uint16(17), uint16(32), uint16(23), uint16(192), uint16(23), uint16(26), uint16(36), uint16(26), uint16(116), uint16(40),
- /* 1450 */ uint16(192), uint16(115), uint16(192), uint16(30), uint16(192), uint16(32), uint16(119), uint16(120), uint16(59), uint16(5),
- /* 1460 */ uint16(214), uint16(215), uint16(128), uint16(40), uint16(10), uint16(11), uint16(12), uint16(13), uint16(14), uint16(59),
- /* 1470 */ uint16(19), uint16(17), uint16(214), uint16(215), uint16(214), uint16(215), uint16(214), uint16(215), uint16(120), uint16(70),
- /* 1480 */ uint16(192), uint16(71), uint16(22), uint16(192), uint16(30), uint16(151), uint16(32), uint16(78), uint16(130), uint16(128),
- /* 1490 */ uint16(81), uint16(192), uint16(140), uint16(70), uint16(40), uint16(85), uint16(192), uint16(141), uint16(7), uint16(8),
- /* 1500 */ uint16(90), uint16(78), uint16(214), uint16(215), uint16(81), uint16(214), uint16(215), uint16(98), uint16(83), uint16(84),
- /* 1510 */ uint16(100), uint16(192), uint16(151), uint16(214), uint16(215), uint16(116), uint16(106), uint16(107), uint16(214), uint16(215),
- /* 1520 */ uint16(192), uint16(98), uint16(192), uint16(113), uint16(70), uint16(115), uint16(116), uint16(117), uint16(23), uint16(224),
- /* 1530 */ uint16(120), uint16(26), uint16(78), uint16(214), uint16(215), uint16(81), uint16(19), uint16(20), uint16(152), uint16(22),
- /* 1540 */ uint16(154), uint16(132), uint16(214), uint16(215), uint16(214), uint16(215), uint16(137), uint16(138), uint16(97), uint16(192),
- /* 1550 */ uint16(256), uint16(192), uint16(98), uint16(36), uint16(23), uint16(132), uint16(192), uint16(26), uint16(192), uint16(192),
- /* 1560 */ uint16(137), uint16(138), uint16(152), uint16(153), uint16(154), uint16(155), uint16(156), uint16(192), uint16(192), uint16(192),
- /* 1570 */ uint16(161), uint16(214), uint16(215), uint16(214), uint16(215), uint16(192), uint16(59), uint16(192), uint16(214), uint16(215),
- /* 1580 */ uint16(214), uint16(215), uint16(192), uint16(152), uint16(161), uint16(154), uint16(132), uint16(192), uint16(71), uint16(214),
- /* 1590 */ uint16(215), uint16(137), uint16(138), uint16(192), uint16(192), uint16(192), uint16(19), uint16(20), uint16(192), uint16(22),
- /* 1600 */ uint16(140), uint16(253), uint16(85), uint16(192), uint16(214), uint16(215), uint16(192), uint16(90), uint16(23), uint16(214),
- /* 1610 */ uint16(215), uint16(26), uint16(192), uint16(36), uint16(192), uint16(161), uint16(23), uint16(100), uint16(192), uint16(26),
- /* 1620 */ uint16(214), uint16(215), uint16(192), uint16(106), uint16(107), uint16(214), uint16(215), uint16(192), uint16(23), uint16(192),
- /* 1630 */ uint16(113), uint16(26), uint16(115), uint16(116), uint16(117), uint16(23), uint16(59), uint16(120), uint16(26), uint16(23),
- /* 1640 */ uint16(23), uint16(23), uint16(26), uint16(26), uint16(26), uint16(316), uint16(234), uint16(23), uint16(71), uint16(23),
- /* 1650 */ uint16(26), uint16(192), uint16(26), uint16(192), uint16(192), uint16(192), uint16(192), uint16(192), uint16(192), uint16(192),
- /* 1660 */ uint16(192), uint16(253), uint16(212), uint16(190), uint16(286), uint16(285), uint16(253), uint16(240), uint16(253), uint16(152),
- /* 1670 */ uint16(153), uint16(154), uint16(155), uint16(156), uint16(241), uint16(243), uint16(295), uint16(100), uint16(291), uint16(291),
- /* 1680 */ uint16(223), uint16(253), uint16(227), uint16(106), uint16(107), uint16(108), uint16(269), uint16(244), uint16(244), uint16(265),
- /* 1690 */ uint16(113), uint16(257), uint16(115), uint16(116), uint16(117), uint16(257), uint16(243), uint16(120), uint16(269), uint16(218),
- /* 1700 */ uint16(217), uint16(265), uint16(217), uint16(19), uint16(20), uint16(217), uint16(22), uint16(195), uint16(269), uint16(269),
- /* 1710 */ uint16(60), uint16(295), uint16(140), uint16(257), uint16(243), uint16(241), uint16(247), uint16(247), uint16(199), uint16(278),
- /* 1720 */ uint16(36), uint16(199), uint16(199), uint16(38), uint16(19), uint16(20), uint16(150), uint16(22), uint16(149), uint16(152),
- /* 1730 */ uint16(153), uint16(154), uint16(155), uint16(156), uint16(22), uint16(43), uint16(232), uint16(295), uint16(292), uint16(292),
- /* 1740 */ uint16(18), uint16(36), uint16(235), uint16(59), uint16(268), uint16(270), uint16(235), uint16(199), uint16(235), uint16(235),
- /* 1750 */ uint16(18), uint16(198), uint16(148), uint16(281), uint16(244), uint16(71), uint16(270), uint16(270), uint16(268), uint16(244),
- /* 1760 */ uint16(232), uint16(232), uint16(244), uint16(199), uint16(59), uint16(244), uint16(198), uint16(157), uint16(288), uint16(62),
- /* 1770 */ uint16(199), uint16(287), uint16(198), uint16(22), uint16(219), uint16(219), uint16(71), uint16(199), uint16(198), uint16(114),
- /* 1780 */ uint16(199), uint16(198), uint16(216), uint16(216), uint16(100), uint16(216), uint16(225), uint16(64), uint16(22), uint16(125),
- /* 1790 */ uint16(106), uint16(107), uint16(222), uint16(164), uint16(219), uint16(222), uint16(24), uint16(113), uint16(216), uint16(115),
- /* 1800 */ uint16(116), uint16(117), uint16(218), uint16(216), uint16(120), uint16(100), uint16(216), uint16(216), uint16(310), uint16(303),
- /* 1810 */ uint16(112), uint16(106), uint16(107), uint16(225), uint16(280), uint16(280), uint16(219), uint16(143), uint16(113), uint16(259),
- /* 1820 */ uint16(115), uint16(116), uint16(117), uint16(114), uint16(259), uint16(120), uint16(199), uint16(91), uint16(82), uint16(147),
- /* 1830 */ uint16(144), uint16(315), uint16(22), uint16(275), uint16(199), uint16(315), uint16(152), uint16(153), uint16(154), uint16(155),
- /* 1840 */ uint16(156), uint16(146), uint16(145), uint16(247), uint16(258), uint16(157), uint16(25), uint16(258), uint16(245), uint16(248),
- /* 1850 */ uint16(244), uint16(259), uint16(258), uint16(202), uint16(259), uint16(248), uint16(258), uint16(152), uint16(153), uint16(154),
- /* 1860 */ uint16(155), uint16(156), uint16(263), uint16(263), uint16(26), uint16(246), uint16(13), uint16(201), uint16(193), uint16(193),
- /* 1870 */ uint16(6), uint16(191), uint16(191), uint16(205), uint16(191), uint16(220), uint16(220), uint16(205), uint16(211), uint16(277),
- /* 1880 */ uint16(211), uint16(211), uint16(211), uint16(205), uint16(4), uint16(212), uint16(3), uint16(22), uint16(162), uint16(212),
- /* 1890 */ uint16(211), uint16(15), uint16(23), uint16(16), uint16(23), uint16(138), uint16(129), uint16(150), uint16(26), uint16(24),
- /* 1900 */ uint16(141), uint16(20), uint16(16), uint16(143), uint16(1), uint16(141), uint16(129), uint16(129), uint16(61), uint16(301),
- /* 1910 */ uint16(301), uint16(298), uint16(150), uint16(53), uint16(53), uint16(37), uint16(53), uint16(129), uint16(115), uint16(53),
- /* 1920 */ uint16(140), uint16(34), uint16(1), uint16(5), uint16(22), uint16(114), uint16(68), uint16(26), uint16(160), uint16(75),
- /* 1930 */ uint16(68), uint16(41), uint16(140), uint16(114), uint16(24), uint16(20), uint16(19), uint16(130), uint16(124), uint16(23),
- /* 1940 */ uint16(67), uint16(22), uint16(22), uint16(59), uint16(22), uint16(22), uint16(67), uint16(96), uint16(24), uint16(22),
- /* 1950 */ uint16(37), uint16(23), uint16(67), uint16(28), uint16(148), uint16(22), uint16(26), uint16(23), uint16(23), uint16(23),
- /* 1960 */ uint16(23), uint16(22), uint16(140), uint16(23), uint16(97), uint16(23), uint16(34), uint16(115), uint16(22), uint16(142),
- /* 1970 */ uint16(26), uint16(75), uint16(34), uint16(44), uint16(75), uint16(34), uint16(88), uint16(34), uint16(86), uint16(34),
- /* 1980 */ uint16(23), uint16(34), uint16(93), uint16(22), uint16(24), uint16(26), uint16(34), uint16(23), uint16(26), uint16(23),
- /* 1990 */ uint16(23), uint16(23), uint16(23), uint16(11), uint16(23), uint16(22), uint16(26), uint16(22), uint16(22), uint16(140),
- /* 2000 */ uint16(23), uint16(23), uint16(22), uint16(22), uint16(134), uint16(26), uint16(23), uint16(15), uint16(140), uint16(1),
- /* 2010 */ uint16(1), uint16(317), uint16(317), uint16(317), uint16(140), uint16(317), uint16(317), uint16(317), uint16(317), uint16(317),
- /* 2020 */ uint16(317), uint16(317), uint16(140), uint16(317), uint16(317), uint16(317), uint16(317), uint16(317), uint16(317), uint16(317),
- /* 2030 */ uint16(317), uint16(317), uint16(317), uint16(317), uint16(317), uint16(317), uint16(317), uint16(317), uint16(317), uint16(317),
- /* 2040 */ uint16(317), uint16(317), uint16(317), uint16(317), uint16(317), uint16(317), uint16(317), uint16(317), uint16(317), uint16(317),
- /* 2050 */ uint16(317), uint16(317), uint16(317), uint16(317), uint16(317), uint16(317), uint16(317), uint16(317), uint16(317), uint16(317),
- /* 2060 */ uint16(317), uint16(317), uint16(317), uint16(317), uint16(317), uint16(317), uint16(317), uint16(317), uint16(317), uint16(317),
- /* 2070 */ uint16(317), uint16(317), uint16(317), uint16(317), uint16(317), uint16(317), uint16(317), uint16(317), uint16(317), uint16(317),
- /* 2080 */ uint16(317), uint16(317), uint16(317), uint16(317), uint16(317), uint16(317), uint16(317), uint16(317), uint16(317), uint16(317),
- /* 2090 */ uint16(317), uint16(317), uint16(317), uint16(317), uint16(317), uint16(317), uint16(317), uint16(317), uint16(317), uint16(317),
- /* 2100 */ uint16(317), uint16(317), uint16(317), uint16(317), uint16(317), uint16(317), uint16(317), uint16(317), uint16(317), uint16(317),
- /* 2110 */ uint16(317), uint16(317), uint16(317), uint16(317), uint16(317), uint16(317), uint16(317), uint16(317), uint16(317), uint16(317),
- /* 2120 */ uint16(317), uint16(317), uint16(317), uint16(317), uint16(317), uint16(317), uint16(317), uint16(317), uint16(317), uint16(317),
- /* 2130 */ uint16(317), uint16(317), uint16(317), uint16(317), uint16(317), uint16(317), uint16(317), uint16(317), uint16(317), uint16(317),
- /* 2140 */ uint16(317), uint16(317), uint16(317), uint16(317), uint16(317), uint16(317), uint16(317), uint16(317), uint16(317), uint16(317),
- /* 2150 */ uint16(317), uint16(317), uint16(317), uint16(317), uint16(317), uint16(317), uint16(317), uint16(317), uint16(317), uint16(317),
- /* 2160 */ uint16(317), uint16(317), uint16(317), uint16(317), uint16(317), uint16(317), uint16(317), uint16(317), uint16(317), uint16(317),
- /* 2170 */ uint16(317), uint16(317), uint16(317), uint16(317), uint16(317), uint16(317), uint16(317), uint16(317), uint16(317), uint16(317),
- /* 2180 */ uint16(317), uint16(317), uint16(317), uint16(317), uint16(317), uint16(317), uint16(317), uint16(317), uint16(317), uint16(317),
- /* 2190 */ uint16(317), uint16(317), uint16(317), uint16(317), uint16(317), uint16(317), uint16(317), uint16(317), uint16(317), uint16(317),
- /* 2200 */ uint16(317), uint16(317), uint16(317), uint16(317), uint16(317), uint16(317), uint16(317),
-} /* sqlite3.c:158793:25 */
-var yy_shift_ofst = [570]uint16{
- /* 0 */ uint16(1423), uint16(1409), uint16(1454), uint16(1192), uint16(1192), uint16(382), uint16(1252), uint16(1410), uint16(1517), uint16(1684),
- /* 10 */ uint16(1684), uint16(1684), uint16(221), uint16(0), uint16(0), uint16(180), uint16(1015), uint16(1684), uint16(1684), uint16(1684),
+ /* 1250 */ uint16(112), uint16(59), uint16(192), uint16(151), uint16(215), uint16(216), uint16(192), uint16(61), uint16(203), uint16(298),
+ /* 1260 */ uint16(299), uint16(192), uint16(192), uint16(71), uint16(25), uint16(144), uint16(203), uint16(192), uint16(203), uint16(230),
+ /* 1270 */ uint16(114), uint16(19), uint16(20), uint16(81), uint16(22), uint16(215), uint16(216), uint16(263), uint16(192), uint16(215),
+ /* 1280 */ uint16(216), uint16(255), uint16(256), uint16(203), uint16(215), uint16(216), uint16(130), uint16(19), uint16(36), uint16(192),
+ /* 1290 */ uint16(215), uint16(216), uint16(100), uint16(238), uint16(239), uint16(101), uint16(25), uint16(192), uint16(106), uint16(107),
+ /* 1300 */ uint16(48), uint16(238), uint16(239), uint16(238), uint16(239), uint16(113), uint16(251), uint16(115), uint16(116), uint16(117),
+ /* 1310 */ uint16(192), uint16(59), uint16(120), uint16(101), uint16(251), uint16(192), uint16(251), uint16(192), uint16(238), uint16(239),
+ /* 1320 */ uint16(215), uint16(216), uint16(192), uint16(71), uint16(46), uint16(243), uint16(192), uint16(25), uint16(25), uint16(137),
+ /* 1330 */ uint16(138), uint16(251), uint16(192), uint16(215), uint16(216), uint16(253), uint16(25), uint16(85), uint16(215), uint16(216),
+ /* 1340 */ uint16(215), uint16(216), uint16(90), uint16(243), uint16(152), uint16(153), uint16(154), uint16(155), uint16(156), uint16(215),
+ /* 1350 */ uint16(216), uint16(192), uint16(100), uint16(253), uint16(243), uint16(215), uint16(216), uint16(192), uint16(106), uint16(107),
+ /* 1360 */ uint16(243), uint16(192), uint16(148), uint16(149), uint16(253), uint16(113), uint16(192), uint16(115), uint16(116), uint16(117),
+ /* 1370 */ uint16(253), uint16(192), uint16(120), uint16(192), uint16(215), uint16(216), uint16(192), uint16(23), uint16(192), uint16(25),
+ /* 1380 */ uint16(215), uint16(216), uint16(192), uint16(115), uint16(215), uint16(216), uint16(22), uint16(148), uint16(24), uint16(215),
+ /* 1390 */ uint16(216), uint16(192), uint16(114), uint16(192), uint16(215), uint16(216), uint16(215), uint16(216), uint16(134), uint16(215),
+ /* 1400 */ uint16(216), uint16(215), uint16(216), uint16(139), uint16(152), uint16(153), uint16(154), uint16(155), uint16(156), uint16(0),
+ /* 1410 */ uint16(1), uint16(2), uint16(141), uint16(23), uint16(5), uint16(25), uint16(215), uint16(216), uint16(24), uint16(10),
+ /* 1420 */ uint16(11), uint16(12), uint16(13), uint16(14), uint16(1), uint16(2), uint16(17), uint16(125), uint16(5), uint16(19),
+ /* 1430 */ uint16(20), uint16(268), uint16(22), uint16(10), uint16(11), uint16(12), uint16(13), uint16(14), uint16(192), uint16(30),
+ /* 1440 */ uint16(17), uint16(32), uint16(23), uint16(23), uint16(25), uint16(25), uint16(36), uint16(144), uint16(23), uint16(40),
+ /* 1450 */ uint16(25), uint16(192), uint16(141), uint16(30), uint16(192), uint16(32), uint16(23), uint16(22), uint16(25), uint16(5),
+ /* 1460 */ uint16(128), uint16(215), uint16(216), uint16(40), uint16(10), uint16(11), uint16(12), uint16(13), uint16(14), uint16(59),
+ /* 1470 */ uint16(23), uint16(17), uint16(25), uint16(192), uint16(215), uint16(216), uint16(192), uint16(215), uint16(216), uint16(70),
+ /* 1480 */ uint16(23), uint16(71), uint16(25), uint16(151), uint16(30), uint16(192), uint16(32), uint16(78), uint16(53), uint16(192),
+ /* 1490 */ uint16(81), uint16(192), uint16(192), uint16(70), uint16(40), uint16(85), uint16(215), uint16(216), uint16(119), uint16(120),
+ /* 1500 */ uint16(90), uint16(78), uint16(59), uint16(254), uint16(81), uint16(192), uint16(192), uint16(98), uint16(215), uint16(216),
+ /* 1510 */ uint16(100), uint16(23), uint16(59), uint16(25), uint16(215), uint16(216), uint16(106), uint16(107), uint16(23), uint16(192),
+ /* 1520 */ uint16(25), uint16(98), uint16(19), uint16(113), uint16(70), uint16(115), uint16(116), uint16(117), uint16(215), uint16(216),
+ /* 1530 */ uint16(120), uint16(192), uint16(78), uint16(192), uint16(140), uint16(81), uint16(19), uint16(20), uint16(23), uint16(22),
+ /* 1540 */ uint16(25), uint16(132), uint16(215), uint16(216), uint16(192), uint16(192), uint16(137), uint16(138), uint16(192), uint16(23),
+ /* 1550 */ uint16(192), uint16(25), uint16(98), uint16(36), uint16(192), uint16(132), uint16(215), uint16(216), uint16(192), uint16(116),
+ /* 1560 */ uint16(137), uint16(138), uint16(152), uint16(153), uint16(154), uint16(155), uint16(156), uint16(215), uint16(216), uint16(116),
+ /* 1570 */ uint16(161), uint16(215), uint16(216), uint16(215), uint16(216), uint16(120), uint16(59), uint16(215), uint16(216), uint16(7),
+ /* 1580 */ uint16(8), uint16(215), uint16(216), uint16(192), uint16(161), uint16(130), uint16(132), uint16(192), uint16(71), uint16(83),
+ /* 1590 */ uint16(84), uint16(137), uint16(138), uint16(59), uint16(192), uint16(192), uint16(19), uint16(20), uint16(192), uint16(22),
+ /* 1600 */ uint16(97), uint16(225), uint16(85), uint16(192), uint16(23), uint16(192), uint16(25), uint16(90), uint16(192), uint16(192),
+ /* 1610 */ uint16(215), uint16(216), uint16(152), uint16(36), uint16(154), uint16(161), uint16(192), uint16(100), uint16(215), uint16(216),
+ /* 1620 */ uint16(192), uint16(215), uint16(216), uint16(106), uint16(107), uint16(225), uint16(215), uint16(216), uint16(192), uint16(192),
+ /* 1630 */ uint16(113), uint16(192), uint16(115), uint16(116), uint16(117), uint16(257), uint16(59), uint16(120), uint16(192), uint16(215),
+ /* 1640 */ uint16(216), uint16(152), uint16(192), uint16(154), uint16(192), uint16(23), uint16(317), uint16(25), uint16(71), uint16(235),
+ /* 1650 */ uint16(116), uint16(215), uint16(216), uint16(192), uint16(215), uint16(216), uint16(192), uint16(192), uint16(192), uint16(192),
+ /* 1660 */ uint16(192), uint16(192), uint16(192), uint16(192), uint16(192), uint16(215), uint16(216), uint16(215), uint16(216), uint16(152),
+ /* 1670 */ uint16(153), uint16(154), uint16(155), uint16(156), uint16(192), uint16(192), uint16(287), uint16(100), uint16(286), uint16(241),
+ /* 1680 */ uint16(254), uint16(254), uint16(242), uint16(106), uint16(107), uint16(108), uint16(254), uint16(213), uint16(254), uint16(190),
+ /* 1690 */ uint16(113), uint16(270), uint16(115), uint16(116), uint16(117), uint16(296), uint16(266), uint16(120), uint16(219), uint16(258),
+ /* 1700 */ uint16(244), uint16(270), uint16(258), uint16(19), uint16(20), uint16(228), uint16(22), uint16(292), uint16(266), uint16(224),
+ /* 1710 */ uint16(292), uint16(218), uint16(218), uint16(195), uint16(218), uint16(270), uint16(258), uint16(60), uint16(245), uint16(270),
+ /* 1720 */ uint16(36), uint16(245), uint16(244), uint16(248), uint16(19), uint16(20), uint16(242), uint16(22), uint16(248), uint16(152),
+ /* 1730 */ uint16(153), uint16(154), uint16(155), uint16(156), uint16(244), uint16(140), uint16(199), uint16(199), uint16(279), uint16(38),
+ /* 1740 */ uint16(199), uint16(36), uint16(150), uint16(59), uint16(296), uint16(149), uint16(22), uint16(296), uint16(18), uint16(43),
+ /* 1750 */ uint16(236), uint16(199), uint16(233), uint16(18), uint16(198), uint16(71), uint16(293), uint16(236), uint16(271), uint16(236),
+ /* 1760 */ uint16(269), uint16(236), uint16(148), uint16(271), uint16(59), uint16(245), uint16(269), uint16(245), uint16(282), uint16(271),
+ /* 1770 */ uint16(199), uint16(198), uint16(233), uint16(245), uint16(293), uint16(233), uint16(71), uint16(245), uint16(157), uint16(62),
+ /* 1780 */ uint16(22), uint16(199), uint16(198), uint16(220), uint16(100), uint16(199), uint16(198), uint16(220), uint16(199), uint16(289),
+ /* 1790 */ uint16(106), uint16(107), uint16(288), uint16(114), uint16(226), uint16(198), uint16(217), uint16(113), uint16(64), uint16(115),
+ /* 1800 */ uint16(116), uint16(117), uint16(217), uint16(22), uint16(120), uint16(100), uint16(223), uint16(217), uint16(217), uint16(164),
+ /* 1810 */ uint16(223), uint16(106), uint16(107), uint16(220), uint16(125), uint16(24), uint16(217), uint16(219), uint16(113), uint16(217),
+ /* 1820 */ uint16(115), uint16(116), uint16(117), uint16(217), uint16(311), uint16(120), uint16(226), uint16(112), uint16(304), uint16(281),
+ /* 1830 */ uint16(281), uint16(220), uint16(114), uint16(143), uint16(260), uint16(259), uint16(152), uint16(153), uint16(154), uint16(155),
+ /* 1840 */ uint16(156), uint16(199), uint16(91), uint16(316), uint16(82), uint16(316), uint16(147), uint16(144), uint16(22), uint16(199),
+ /* 1850 */ uint16(249), uint16(276), uint16(157), uint16(146), uint16(260), uint16(145), uint16(278), uint16(152), uint16(153), uint16(154),
+ /* 1860 */ uint16(155), uint16(156), uint16(259), uint16(248), uint16(260), uint16(260), uint16(259), uint16(259), uint16(249), uint16(245),
+ /* 1870 */ uint16(247), uint16(246), uint16(25), uint16(264), uint16(264), uint16(201), uint16(13), uint16(6), uint16(193), uint16(193),
+ /* 1880 */ uint16(212), uint16(206), uint16(191), uint16(191), uint16(191), uint16(212), uint16(206), uint16(221), uint16(212), uint16(212),
+ /* 1890 */ uint16(221), uint16(213), uint16(4), uint16(206), uint16(213), uint16(212), uint16(3), uint16(22), uint16(162), uint16(15),
+ /* 1900 */ uint16(23), uint16(16), uint16(23), uint16(138), uint16(150), uint16(129), uint16(25), uint16(24), uint16(141), uint16(20),
+ /* 1910 */ uint16(16), uint16(143), uint16(1), uint16(141), uint16(302), uint16(302), uint16(299), uint16(129), uint16(129), uint16(61),
+ /* 1920 */ uint16(150), uint16(53), uint16(53), uint16(37), uint16(129), uint16(53), uint16(53), uint16(115), uint16(1), uint16(34),
+ /* 1930 */ uint16(140), uint16(5), uint16(22), uint16(114), uint16(160), uint16(68), uint16(75), uint16(25), uint16(68), uint16(41),
+ /* 1940 */ uint16(140), uint16(114), uint16(24), uint16(20), uint16(19), uint16(130), uint16(124), uint16(67), uint16(24), uint16(67),
+ /* 1950 */ uint16(22), uint16(22), uint16(22), uint16(96), uint16(23), uint16(22), uint16(59), uint16(22), uint16(67), uint16(37),
+ /* 1960 */ uint16(28), uint16(23), uint16(148), uint16(22), uint16(25), uint16(23), uint16(23), uint16(23), uint16(23), uint16(22),
+ /* 1970 */ uint16(140), uint16(97), uint16(23), uint16(23), uint16(115), uint16(22), uint16(142), uint16(25), uint16(88), uint16(75),
+ /* 1980 */ uint16(34), uint16(44), uint16(34), uint16(75), uint16(23), uint16(34), uint16(86), uint16(22), uint16(34), uint16(34),
+ /* 1990 */ uint16(34), uint16(24), uint16(93), uint16(25), uint16(25), uint16(23), uint16(34), uint16(23), uint16(23), uint16(23),
+ /* 2000 */ uint16(23), uint16(11), uint16(23), uint16(25), uint16(22), uint16(22), uint16(22), uint16(1), uint16(23), uint16(23),
+ /* 2010 */ uint16(22), uint16(22), uint16(25), uint16(15), uint16(23), uint16(1), uint16(140), uint16(25), uint16(140), uint16(318),
+ /* 2020 */ uint16(318), uint16(134), uint16(318), uint16(318), uint16(318), uint16(318), uint16(318), uint16(318), uint16(318), uint16(318),
+ /* 2030 */ uint16(318), uint16(318), uint16(140), uint16(318), uint16(318), uint16(318), uint16(140), uint16(318), uint16(318), uint16(318),
+ /* 2040 */ uint16(318), uint16(318), uint16(318), uint16(318), uint16(318), uint16(318), uint16(318), uint16(318), uint16(318), uint16(318),
+ /* 2050 */ uint16(318), uint16(318), uint16(318), uint16(318), uint16(318), uint16(318), uint16(318), uint16(318), uint16(318), uint16(318),
+ /* 2060 */ uint16(318), uint16(318), uint16(318), uint16(318), uint16(318), uint16(318), uint16(318), uint16(318), uint16(318), uint16(318),
+ /* 2070 */ uint16(318), uint16(318), uint16(318), uint16(318), uint16(318), uint16(318), uint16(318), uint16(318), uint16(318), uint16(318),
+ /* 2080 */ uint16(318), uint16(318), uint16(318), uint16(318), uint16(318), uint16(318), uint16(318), uint16(318), uint16(318), uint16(318),
+ /* 2090 */ uint16(318), uint16(318), uint16(318), uint16(318), uint16(318), uint16(318), uint16(318), uint16(318), uint16(318), uint16(318),
+ /* 2100 */ uint16(318), uint16(318), uint16(318), uint16(318), uint16(318), uint16(318), uint16(318), uint16(318), uint16(318), uint16(318),
+ /* 2110 */ uint16(318), uint16(318), uint16(318), uint16(318), uint16(318), uint16(318), uint16(318), uint16(318), uint16(318), uint16(318),
+ /* 2120 */ uint16(318), uint16(318), uint16(318), uint16(318), uint16(318), uint16(318), uint16(318), uint16(318), uint16(318), uint16(318),
+ /* 2130 */ uint16(318), uint16(318), uint16(318), uint16(318), uint16(318), uint16(318), uint16(318), uint16(318), uint16(318), uint16(318),
+ /* 2140 */ uint16(318), uint16(318), uint16(318), uint16(318), uint16(318), uint16(318), uint16(318), uint16(318), uint16(318), uint16(318),
+ /* 2150 */ uint16(318), uint16(318), uint16(318), uint16(318), uint16(318), uint16(318), uint16(318), uint16(318), uint16(318), uint16(318),
+ /* 2160 */ uint16(318), uint16(318), uint16(318), uint16(318), uint16(318), uint16(318), uint16(318), uint16(318), uint16(318), uint16(318),
+ /* 2170 */ uint16(318), uint16(318), uint16(318), uint16(318), uint16(318), uint16(318), uint16(318), uint16(318), uint16(318), uint16(318),
+ /* 2180 */ uint16(318), uint16(318), uint16(318), uint16(318), uint16(318), uint16(318), uint16(318), uint16(318), uint16(318), uint16(318),
+ /* 2190 */ uint16(318), uint16(318), uint16(318), uint16(318), uint16(318), uint16(318), uint16(318), uint16(318), uint16(318), uint16(318),
+ /* 2200 */ uint16(318), uint16(318), uint16(318), uint16(318), uint16(318), uint16(318), uint16(318), uint16(318), uint16(318), uint16(318),
+ /* 2210 */ uint16(318), uint16(318), uint16(318), uint16(318), uint16(318), uint16(318), uint16(318), uint16(318), uint16(318), uint16(318),
+ /* 2220 */ uint16(318),
+} /* sqlite3.c:160229:25 */
+var yy_shift_ofst = [572]uint16{
+ /* 0 */ uint16(1423), uint16(1409), uint16(1454), uint16(1192), uint16(1192), uint16(610), uint16(1252), uint16(1410), uint16(1517), uint16(1684),
+ /* 10 */ uint16(1684), uint16(1684), uint16(276), uint16(0), uint16(0), uint16(180), uint16(1015), uint16(1684), uint16(1684), uint16(1684),
/* 20 */ uint16(1684), uint16(1684), uint16(1684), uint16(1684), uint16(1684), uint16(1684), uint16(1684), uint16(1684), uint16(1684), uint16(1684),
- /* 30 */ uint16(1049), uint16(1049), uint16(1121), uint16(1121), uint16(54), uint16(616), uint16(382), uint16(382), uint16(382), uint16(382),
- /* 40 */ uint16(382), uint16(40), uint16(110), uint16(219), uint16(289), uint16(396), uint16(439), uint16(509), uint16(548), uint16(618),
+ /* 30 */ uint16(1049), uint16(1049), uint16(1121), uint16(1121), uint16(54), uint16(487), uint16(610), uint16(610), uint16(610), uint16(610),
+ /* 40 */ uint16(610), uint16(40), uint16(110), uint16(219), uint16(289), uint16(396), uint16(439), uint16(509), uint16(548), uint16(618),
/* 50 */ uint16(657), uint16(727), uint16(766), uint16(836), uint16(995), uint16(1015), uint16(1015), uint16(1015), uint16(1015), uint16(1015),
/* 60 */ uint16(1015), uint16(1015), uint16(1015), uint16(1015), uint16(1015), uint16(1015), uint16(1015), uint16(1015), uint16(1015), uint16(1015),
/* 70 */ uint16(1015), uint16(1015), uint16(1015), uint16(1035), uint16(1015), uint16(1138), uint16(880), uint16(880), uint16(1577), uint16(1684),
@@ -140065,153 +142142,155 @@ var yy_shift_ofst = [570]uint16{
/* 100 */ uint16(1684), uint16(1684), uint16(1684), uint16(1684), uint16(1684), uint16(1684), uint16(1684), uint16(1684), uint16(1684), uint16(1684),
/* 110 */ uint16(1684), uint16(1684), uint16(1684), uint16(1705), uint16(1684), uint16(1684), uint16(1684), uint16(1684), uint16(1684), uint16(1684),
/* 120 */ uint16(1684), uint16(1684), uint16(1684), uint16(1684), uint16(1684), uint16(1684), uint16(1684), uint16(146), uint16(84), uint16(84),
- /* 130 */ uint16(84), uint16(84), uint16(84), uint16(274), uint16(315), uint16(125), uint16(97), uint16(357), uint16(66), uint16(66),
- /* 140 */ uint16(893), uint16(258), uint16(66), uint16(66), uint16(371), uint16(371), uint16(66), uint16(551), uint16(551), uint16(551),
- /* 150 */ uint16(551), uint16(192), uint16(209), uint16(209), uint16(278), uint16(127), uint16(2023), uint16(2023), uint16(621), uint16(621),
- /* 160 */ uint16(621), uint16(201), uint16(398), uint16(398), uint16(398), uint16(398), uint16(939), uint16(939), uint16(442), uint16(936),
- /* 170 */ uint16(1009), uint16(66), uint16(66), uint16(66), uint16(66), uint16(66), uint16(66), uint16(66), uint16(66), uint16(66),
+ /* 130 */ uint16(84), uint16(84), uint16(84), uint16(277), uint16(315), uint16(401), uint16(97), uint16(461), uint16(251), uint16(66),
+ /* 140 */ uint16(66), uint16(51), uint16(1156), uint16(66), uint16(66), uint16(324), uint16(324), uint16(66), uint16(452), uint16(452),
+ /* 150 */ uint16(452), uint16(452), uint16(133), uint16(114), uint16(114), uint16(4), uint16(11), uint16(2037), uint16(2037), uint16(621),
+ /* 160 */ uint16(621), uint16(621), uint16(567), uint16(398), uint16(398), uint16(398), uint16(398), uint16(937), uint16(937), uint16(228),
+ /* 170 */ uint16(251), uint16(331), uint16(1052), uint16(66), uint16(66), uint16(66), uint16(66), uint16(66), uint16(66), uint16(66),
/* 180 */ uint16(66), uint16(66), uint16(66), uint16(66), uint16(66), uint16(66), uint16(66), uint16(66), uint16(66), uint16(66),
- /* 190 */ uint16(66), uint16(710), uint16(710), uint16(66), uint16(776), uint16(435), uint16(435), uint16(410), uint16(410), uint16(372),
- /* 200 */ uint16(1097), uint16(2023), uint16(2023), uint16(2023), uint16(2023), uint16(2023), uint16(2023), uint16(2023), uint16(250), uint16(490),
- /* 210 */ uint16(490), uint16(511), uint16(451), uint16(516), uint16(252), uint16(566), uint16(575), uint16(781), uint16(673), uint16(66),
- /* 220 */ uint16(66), uint16(66), uint16(66), uint16(66), uint16(66), uint16(66), uint16(66), uint16(66), uint16(66), uint16(722),
- /* 230 */ uint16(66), uint16(66), uint16(66), uint16(66), uint16(66), uint16(66), uint16(66), uint16(66), uint16(66), uint16(66),
- /* 240 */ uint16(66), uint16(66), uint16(790), uint16(790), uint16(790), uint16(66), uint16(66), uint16(66), uint16(883), uint16(66),
- /* 250 */ uint16(66), uint16(66), uint16(891), uint16(1064), uint16(66), uint16(66), uint16(1212), uint16(66), uint16(66), uint16(66),
- /* 260 */ uint16(66), uint16(66), uint16(66), uint16(66), uint16(66), uint16(725), uint16(763), uint16(177), uint16(940), uint16(940),
- /* 270 */ uint16(940), uint16(940), uint16(337), uint16(177), uint16(177), uint16(1028), uint16(1053), uint16(670), uint16(1264), uint16(1179),
- /* 280 */ uint16(1173), uint16(1254), uint16(1316), uint16(1173), uint16(1316), uint16(1336), uint16(50), uint16(1179), uint16(1179), uint16(50),
- /* 290 */ uint16(1179), uint16(1254), uint16(1336), uint16(1259), uint16(732), uint16(532), uint16(1347), uint16(1347), uint16(1347), uint16(1316),
- /* 300 */ uint16(1236), uint16(1236), uint16(1184), uint16(1356), uint16(1167), uint16(898), uint16(1650), uint16(1650), uint16(1572), uint16(1572),
- /* 310 */ uint16(1685), uint16(1685), uint16(1572), uint16(1576), uint16(1579), uint16(1712), uint16(1692), uint16(1722), uint16(1722), uint16(1722),
- /* 320 */ uint16(1722), uint16(1572), uint16(1732), uint16(1604), uint16(1579), uint16(1579), uint16(1604), uint16(1712), uint16(1692), uint16(1604),
- /* 330 */ uint16(1692), uint16(1604), uint16(1572), uint16(1732), uint16(1610), uint16(1707), uint16(1572), uint16(1732), uint16(1751), uint16(1572),
- /* 340 */ uint16(1732), uint16(1572), uint16(1732), uint16(1751), uint16(1665), uint16(1665), uint16(1665), uint16(1723), uint16(1766), uint16(1766),
- /* 350 */ uint16(1751), uint16(1665), uint16(1664), uint16(1665), uint16(1723), uint16(1665), uint16(1665), uint16(1629), uint16(1772), uint16(1698),
- /* 360 */ uint16(1698), uint16(1751), uint16(1674), uint16(1709), uint16(1674), uint16(1709), uint16(1674), uint16(1709), uint16(1674), uint16(1709),
- /* 370 */ uint16(1572), uint16(1736), uint16(1736), uint16(1746), uint16(1746), uint16(1682), uint16(1686), uint16(1810), uint16(1572), uint16(1688),
- /* 380 */ uint16(1682), uint16(1695), uint16(1697), uint16(1604), uint16(1821), uint16(1838), uint16(1853), uint16(1853), uint16(1864), uint16(1864),
- /* 390 */ uint16(1864), uint16(2023), uint16(2023), uint16(2023), uint16(2023), uint16(2023), uint16(2023), uint16(2023), uint16(2023), uint16(2023),
- /* 400 */ uint16(2023), uint16(2023), uint16(2023), uint16(2023), uint16(2023), uint16(2023), uint16(232), uint16(101), uint16(1131), uint16(1193),
- /* 410 */ uint16(619), uint16(679), uint16(841), uint16(1421), uint16(1286), uint16(115), uint16(1352), uint16(1334), uint16(1361), uint16(1419),
- /* 420 */ uint16(1342), uint16(1505), uint16(1531), uint16(1585), uint16(1593), uint16(1605), uint16(1612), uint16(1280), uint16(1337), uint16(1491),
- /* 430 */ uint16(1358), uint16(1451), uint16(1332), uint16(1616), uint16(1617), uint16(1425), uint16(1618), uint16(1386), uint16(1431), uint16(1624),
- /* 440 */ uint16(1626), uint16(1399), uint16(1460), uint16(1880), uint16(1883), uint16(1865), uint16(1726), uint16(1876), uint16(1877), uint16(1869),
- /* 450 */ uint16(1871), uint16(1757), uint16(1747), uint16(1767), uint16(1872), uint16(1872), uint16(1875), uint16(1759), uint16(1881), uint16(1760),
- /* 460 */ uint16(1886), uint16(1903), uint16(1764), uint16(1777), uint16(1872), uint16(1778), uint16(1847), uint16(1878), uint16(1872), uint16(1762),
- /* 470 */ uint16(1860), uint16(1861), uint16(1863), uint16(1866), uint16(1788), uint16(1803), uint16(1887), uint16(1780), uint16(1921), uint16(1918),
- /* 480 */ uint16(1902), uint16(1811), uint16(1768), uint16(1858), uint16(1901), uint16(1862), uint16(1854), uint16(1890), uint16(1792), uint16(1819),
- /* 490 */ uint16(1910), uint16(1915), uint16(1917), uint16(1807), uint16(1814), uint16(1919), uint16(1873), uint16(1920), uint16(1922), uint16(1916),
- /* 500 */ uint16(1923), uint16(1879), uint16(1884), uint16(1924), uint16(1851), uint16(1925), uint16(1927), uint16(1885), uint16(1913), uint16(1928),
- /* 510 */ uint16(1806), uint16(1933), uint16(1934), uint16(1935), uint16(1936), uint16(1930), uint16(1937), uint16(1939), uint16(1867), uint16(1822),
- /* 520 */ uint16(1940), uint16(1942), uint16(1852), uint16(1932), uint16(1946), uint16(1827), uint16(1944), uint16(1938), uint16(1941), uint16(1943),
- /* 530 */ uint16(1945), uint16(1888), uint16(1896), uint16(1892), uint16(1929), uint16(1899), uint16(1889), uint16(1947), uint16(1957), uint16(1961),
- /* 540 */ uint16(1960), uint16(1959), uint16(1962), uint16(1952), uint16(1964), uint16(1944), uint16(1966), uint16(1967), uint16(1968), uint16(1969),
- /* 550 */ uint16(1970), uint16(1971), uint16(1973), uint16(1982), uint16(1975), uint16(1976), uint16(1977), uint16(1978), uint16(1980), uint16(1981),
- /* 560 */ uint16(1979), uint16(1870), uint16(1859), uint16(1868), uint16(1874), uint16(1882), uint16(1983), uint16(1992), uint16(2008), uint16(2009),
-} /* sqlite3.c:159019:33 */
-var yy_reduce_ofst = [406]int16{
- /* 0 */ int16(111), int16(168), int16(272), int16(760), int16(-177), int16(-175), int16(-192), int16(-190), int16(-182), int16(-179),
- /* 10 */ int16(216), int16(220), int16(481), int16(-208), int16(-205), int16(-266), int16(-140), int16(-115), int16(241), int16(393),
- /* 20 */ int16(523), int16(325), int16(612), int16(632), int16(542), int16(651), int16(764), int16(757), int16(702), int16(762),
- /* 30 */ int16(812), int16(814), int16(-188), int16(273), int16(924), int16(386), int16(758), int16(967), int16(1020), int16(1052),
- /* 40 */ int16(1066), int16(-256), int16(-256), int16(-256), int16(-256), int16(-256), int16(-256), int16(-256), int16(-256), int16(-256),
- /* 50 */ int16(-256), int16(-256), int16(-256), int16(-256), int16(-256), int16(-256), int16(-256), int16(-256), int16(-256), int16(-256),
- /* 60 */ int16(-256), int16(-256), int16(-256), int16(-256), int16(-256), int16(-256), int16(-256), int16(-256), int16(-256), int16(-256),
- /* 70 */ int16(-256), int16(-256), int16(-256), int16(-256), int16(-256), int16(-256), int16(-256), int16(-256), int16(195), int16(222),
- /* 80 */ int16(813), int16(917), int16(920), int16(959), int16(985), int16(1006), int16(1038), int16(1067), int16(1069), int16(1072),
- /* 90 */ int16(1099), int16(1103), int16(1105), int16(1118), int16(1135), int16(1139), int16(1142), int16(1146), int16(1148), int16(1159),
- /* 100 */ int16(1174), int16(1178), int16(1183), int16(1185), int16(1187), int16(1198), int16(1202), int16(1246), int16(1258), int16(1260),
- /* 110 */ int16(1262), int16(1288), int16(1291), int16(1299), int16(1304), int16(1319), int16(1328), int16(1330), int16(1357), int16(1359),
- /* 120 */ int16(1364), int16(1366), int16(1375), int16(1390), int16(1395), int16(1406), int16(1411), int16(-256), int16(-256), int16(-256),
- /* 130 */ int16(-256), int16(-256), int16(-256), int16(-256), int16(-256), int16(447), int16(-256), int16(555), int16(-178), int16(605),
- /* 140 */ int16(832), int16(-220), int16(606), int16(-94), int16(-168), int16(36), int16(-122), int16(730), int16(780), int16(730),
- /* 150 */ int16(780), int16(918), int16(-136), int16(338), int16(-256), int16(-256), int16(-256), int16(-256), int16(80), int16(80),
- /* 160 */ int16(80), int16(720), int16(703), int16(811), int16(882), int16(903), int16(-213), int16(-204), int16(106), int16(330),
- /* 170 */ int16(330), int16(-77), int16(236), int16(320), int16(599), int16(67), int16(457), int16(675), int16(729), int16(395),
- /* 180 */ int16(268), int16(611), int16(969), int16(1004), int16(726), int16(1014), int16(983), int16(123), int16(884), int16(608),
- /* 190 */ int16(1034), int16(547), int16(911), int16(650), int16(844), int16(922), int16(949), int16(965), int16(972), int16(978),
- /* 200 */ int16(449), int16(970), int16(718), int16(784), int16(1073), int16(1084), int16(1023), int16(1129), int16(-209), int16(-180),
- /* 210 */ int16(-113), int16(114), int16(183), int16(329), int16(345), int16(391), int16(446), int16(502), int16(609), int16(667),
- /* 220 */ int16(713), int16(817), int16(865), int16(881), int16(901), int16(921), int16(989), int16(1191), int16(1195), int16(214),
- /* 230 */ int16(1223), int16(1235), int16(1251), int16(1367), int16(1376), int16(1377), int16(1383), int16(1385), int16(1401), int16(1402),
- /* 240 */ int16(1403), int16(1414), int16(584), int16(638), int16(1305), int16(1420), int16(1422), int16(1426), int16(1294), int16(1430),
- /* 250 */ int16(1435), int16(1437), int16(1348), int16(1329), int16(1459), int16(1461), int16(1412), int16(1462), int16(345), int16(1463),
- /* 260 */ int16(1464), int16(1465), int16(1466), int16(1467), int16(1468), int16(1378), int16(1380), int16(1427), int16(1408), int16(1413),
- /* 270 */ int16(1415), int16(1428), int16(1294), int16(1427), int16(1427), int16(1433), int16(1450), int16(1473), int16(1381), int16(1417),
- /* 280 */ int16(1424), int16(1432), int16(1434), int16(1436), int16(1438), int16(1387), int16(1443), int16(1429), int16(1439), int16(1444),
- /* 290 */ int16(1440), int16(1453), int16(1388), int16(1481), int16(1455), int16(1457), int16(1483), int16(1485), int16(1488), int16(1456),
- /* 300 */ int16(1469), int16(1470), int16(1441), int16(1471), int16(1474), int16(1512), int16(1416), int16(1442), int16(1519), int16(1522),
- /* 310 */ int16(1446), int16(1447), int16(1523), int16(1472), int16(1475), int16(1476), int16(1504), int16(1507), int16(1511), int16(1513),
- /* 320 */ int16(1514), int16(1548), int16(1553), int16(1510), int16(1486), int16(1487), int16(1515), int16(1490), int16(1528), int16(1518),
- /* 330 */ int16(1529), int16(1521), int16(1564), int16(1568), int16(1480), int16(1484), int16(1571), int16(1574), int16(1555), int16(1578),
- /* 340 */ int16(1580), int16(1581), int16(1583), int16(1556), int16(1566), int16(1567), int16(1569), int16(1561), int16(1570), int16(1573),
- /* 350 */ int16(1575), int16(1582), int16(1584), int16(1587), int16(1588), int16(1590), int16(1591), int16(1498), int16(1506), int16(1534),
- /* 360 */ int16(1535), int16(1597), int16(1560), int16(1586), int16(1565), int16(1589), int16(1592), int16(1594), int16(1595), int16(1598),
- /* 370 */ int16(1627), int16(1516), int16(1520), int16(1599), int16(1600), int16(1601), int16(1596), int16(1558), int16(1635), int16(1602),
- /* 380 */ int16(1607), int16(1619), int16(1603), int16(1606), int16(1651), int16(1666), int16(1675), int16(1676), int16(1680), int16(1681),
- /* 390 */ int16(1683), int16(1608), int16(1609), int16(1613), int16(1668), int16(1667), int16(1669), int16(1670), int16(1671), int16(1672),
- /* 400 */ int16(1655), int16(1656), int16(1673), int16(1677), int16(1679), int16(1678),
-} /* sqlite3.c:159081:20 */
-var yy_default = [570]uint16{
- /* 0 */ uint16(1623), uint16(1623), uint16(1623), uint16(1453), uint16(1223), uint16(1332), uint16(1223), uint16(1223), uint16(1223), uint16(1453),
- /* 10 */ uint16(1453), uint16(1453), uint16(1223), uint16(1362), uint16(1362), uint16(1506), uint16(1254), uint16(1223), uint16(1223), uint16(1223),
- /* 20 */ uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1452), uint16(1223), uint16(1223),
- /* 30 */ uint16(1223), uint16(1223), uint16(1541), uint16(1541), uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1223),
- /* 40 */ uint16(1223), uint16(1223), uint16(1371), uint16(1223), uint16(1378), uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1223),
- /* 50 */ uint16(1454), uint16(1455), uint16(1223), uint16(1223), uint16(1223), uint16(1505), uint16(1507), uint16(1470), uint16(1385), uint16(1384),
- /* 60 */ uint16(1383), uint16(1382), uint16(1488), uint16(1349), uint16(1376), uint16(1369), uint16(1373), uint16(1448), uint16(1449), uint16(1447),
- /* 70 */ uint16(1451), uint16(1455), uint16(1454), uint16(1223), uint16(1372), uint16(1419), uint16(1433), uint16(1418), uint16(1223), uint16(1223),
- /* 80 */ uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1223),
- /* 90 */ uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1223),
- /* 100 */ uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1223),
- /* 110 */ uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1223),
- /* 120 */ uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1427), uint16(1432), uint16(1438),
- /* 130 */ uint16(1431), uint16(1428), uint16(1421), uint16(1420), uint16(1422), uint16(1223), uint16(1423), uint16(1223), uint16(1223), uint16(1223),
- /* 140 */ uint16(1244), uint16(1296), uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1525), uint16(1524), uint16(1223),
- /* 150 */ uint16(1223), uint16(1254), uint16(1413), uint16(1412), uint16(1424), uint16(1425), uint16(1435), uint16(1434), uint16(1513), uint16(1576),
- /* 160 */ uint16(1575), uint16(1471), uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1541), uint16(1223),
- /* 170 */ uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1223),
- /* 180 */ uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1223),
- /* 190 */ uint16(1223), uint16(1541), uint16(1541), uint16(1223), uint16(1254), uint16(1541), uint16(1541), uint16(1250), uint16(1250), uint16(1356),
- /* 200 */ uint16(1223), uint16(1520), uint16(1323), uint16(1323), uint16(1323), uint16(1323), uint16(1332), uint16(1323), uint16(1223), uint16(1223),
- /* 210 */ uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1223),
- /* 220 */ uint16(1223), uint16(1223), uint16(1223), uint16(1510), uint16(1508), uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1223),
- /* 230 */ uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1223),
- /* 240 */ uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1223),
- /* 250 */ uint16(1223), uint16(1223), uint16(1328), uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1223),
- /* 260 */ uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1570), uint16(1223), uint16(1483), uint16(1310), uint16(1328), uint16(1328),
- /* 270 */ uint16(1328), uint16(1328), uint16(1330), uint16(1311), uint16(1309), uint16(1322), uint16(1255), uint16(1230), uint16(1615), uint16(1388),
- /* 280 */ uint16(1377), uint16(1329), uint16(1351), uint16(1377), uint16(1351), uint16(1612), uint16(1375), uint16(1388), uint16(1388), uint16(1375),
- /* 290 */ uint16(1388), uint16(1329), uint16(1612), uint16(1271), uint16(1592), uint16(1266), uint16(1362), uint16(1362), uint16(1362), uint16(1351),
- /* 300 */ uint16(1356), uint16(1356), uint16(1450), uint16(1329), uint16(1322), uint16(1223), uint16(1615), uint16(1615), uint16(1337), uint16(1337),
- /* 310 */ uint16(1614), uint16(1614), uint16(1337), uint16(1471), uint16(1599), uint16(1397), uint16(1299), uint16(1305), uint16(1305), uint16(1305),
- /* 320 */ uint16(1305), uint16(1337), uint16(1241), uint16(1375), uint16(1599), uint16(1599), uint16(1375), uint16(1397), uint16(1299), uint16(1375),
- /* 330 */ uint16(1299), uint16(1375), uint16(1337), uint16(1241), uint16(1487), uint16(1609), uint16(1337), uint16(1241), uint16(1461), uint16(1337),
- /* 340 */ uint16(1241), uint16(1337), uint16(1241), uint16(1461), uint16(1297), uint16(1297), uint16(1297), uint16(1286), uint16(1223), uint16(1223),
- /* 350 */ uint16(1461), uint16(1297), uint16(1271), uint16(1297), uint16(1286), uint16(1297), uint16(1297), uint16(1559), uint16(1223), uint16(1465),
- /* 360 */ uint16(1465), uint16(1461), uint16(1355), uint16(1350), uint16(1355), uint16(1350), uint16(1355), uint16(1350), uint16(1355), uint16(1350),
- /* 370 */ uint16(1337), uint16(1551), uint16(1551), uint16(1365), uint16(1365), uint16(1370), uint16(1356), uint16(1456), uint16(1337), uint16(1223),
- /* 380 */ uint16(1370), uint16(1368), uint16(1366), uint16(1375), uint16(1247), uint16(1289), uint16(1573), uint16(1573), uint16(1569), uint16(1569),
- /* 390 */ uint16(1569), uint16(1620), uint16(1620), uint16(1520), uint16(1585), uint16(1254), uint16(1254), uint16(1254), uint16(1254), uint16(1585),
- /* 400 */ uint16(1273), uint16(1273), uint16(1255), uint16(1255), uint16(1254), uint16(1585), uint16(1223), uint16(1223), uint16(1223), uint16(1223),
- /* 410 */ uint16(1223), uint16(1223), uint16(1580), uint16(1223), uint16(1515), uint16(1472), uint16(1341), uint16(1223), uint16(1223), uint16(1223),
- /* 420 */ uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1223),
- /* 430 */ uint16(1223), uint16(1526), uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1223),
- /* 440 */ uint16(1223), uint16(1223), uint16(1402), uint16(1223), uint16(1226), uint16(1517), uint16(1223), uint16(1223), uint16(1223), uint16(1223),
- /* 450 */ uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1379), uint16(1380), uint16(1342), uint16(1223), uint16(1223), uint16(1223),
- /* 460 */ uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1394), uint16(1223), uint16(1223), uint16(1223), uint16(1389), uint16(1223),
- /* 470 */ uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1611), uint16(1223), uint16(1223),
- /* 480 */ uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1486), uint16(1485), uint16(1223), uint16(1223), uint16(1339), uint16(1223),
- /* 490 */ uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1223),
- /* 500 */ uint16(1223), uint16(1223), uint16(1269), uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1223),
- /* 510 */ uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1223),
- /* 520 */ uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1367), uint16(1223), uint16(1223), uint16(1223),
- /* 530 */ uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1223),
- /* 540 */ uint16(1223), uint16(1556), uint16(1357), uint16(1223), uint16(1223), uint16(1602), uint16(1223), uint16(1223), uint16(1223), uint16(1223),
- /* 550 */ uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1223),
- /* 560 */ uint16(1596), uint16(1313), uint16(1404), uint16(1223), uint16(1403), uint16(1407), uint16(1223), uint16(1235), uint16(1223), uint16(1223),
-} /* sqlite3.c:159124:27 */
+ /* 190 */ uint16(66), uint16(66), uint16(66), uint16(557), uint16(557), uint16(66), uint16(9), uint16(25), uint16(25), uint16(745),
+ /* 200 */ uint16(745), uint16(967), uint16(1088), uint16(2037), uint16(2037), uint16(2037), uint16(2037), uint16(2037), uint16(2037), uint16(2037),
+ /* 210 */ uint16(255), uint16(317), uint16(317), uint16(514), uint16(403), uint16(620), uint16(471), uint16(672), uint16(781), uint16(891),
+ /* 220 */ uint16(675), uint16(66), uint16(66), uint16(66), uint16(66), uint16(66), uint16(66), uint16(66), uint16(66), uint16(66),
+ /* 230 */ uint16(66), uint16(508), uint16(66), uint16(66), uint16(66), uint16(66), uint16(66), uint16(66), uint16(66), uint16(66),
+ /* 240 */ uint16(66), uint16(66), uint16(66), uint16(66), uint16(790), uint16(790), uint16(790), uint16(66), uint16(66), uint16(66),
+ /* 250 */ uint16(338), uint16(66), uint16(66), uint16(66), uint16(516), uint16(1084), uint16(66), uint16(66), uint16(993), uint16(66),
+ /* 260 */ uint16(66), uint16(66), uint16(66), uint16(66), uint16(66), uint16(66), uint16(66), uint16(732), uint16(1083), uint16(563),
+ /* 270 */ uint16(994), uint16(994), uint16(994), uint16(994), uint16(337), uint16(563), uint16(563), uint16(1028), uint16(987), uint16(897),
+ /* 280 */ uint16(1119), uint16(262), uint16(1214), uint16(1271), uint16(1112), uint16(1214), uint16(1112), uint16(1268), uint16(1239), uint16(262),
+ /* 290 */ uint16(262), uint16(1239), uint16(262), uint16(1271), uint16(1268), uint16(1302), uint16(1354), uint16(1278), uint16(1168), uint16(1168),
+ /* 300 */ uint16(1168), uint16(1112), uint16(1303), uint16(1303), uint16(815), uint16(1311), uint16(1264), uint16(1364), uint16(1657), uint16(1657),
+ /* 310 */ uint16(1595), uint16(1595), uint16(1701), uint16(1701), uint16(1595), uint16(1592), uint16(1596), uint16(1724), uint16(1706), uint16(1730),
+ /* 320 */ uint16(1730), uint16(1730), uint16(1730), uint16(1595), uint16(1735), uint16(1614), uint16(1596), uint16(1596), uint16(1614), uint16(1724),
+ /* 330 */ uint16(1706), uint16(1614), uint16(1706), uint16(1614), uint16(1595), uint16(1735), uint16(1621), uint16(1717), uint16(1595), uint16(1735),
+ /* 340 */ uint16(1758), uint16(1595), uint16(1735), uint16(1595), uint16(1735), uint16(1758), uint16(1679), uint16(1679), uint16(1679), uint16(1734),
+ /* 350 */ uint16(1781), uint16(1781), uint16(1758), uint16(1679), uint16(1689), uint16(1679), uint16(1734), uint16(1679), uint16(1679), uint16(1645),
+ /* 360 */ uint16(1791), uint16(1715), uint16(1715), uint16(1758), uint16(1690), uint16(1718), uint16(1690), uint16(1718), uint16(1690), uint16(1718),
+ /* 370 */ uint16(1690), uint16(1718), uint16(1595), uint16(1751), uint16(1751), uint16(1762), uint16(1762), uint16(1699), uint16(1703), uint16(1826),
+ /* 380 */ uint16(1595), uint16(1695), uint16(1699), uint16(1707), uint16(1710), uint16(1614), uint16(1847), uint16(1863), uint16(1863), uint16(1871),
+ /* 390 */ uint16(1871), uint16(1871), uint16(2037), uint16(2037), uint16(2037), uint16(2037), uint16(2037), uint16(2037), uint16(2037), uint16(2037),
+ /* 400 */ uint16(2037), uint16(2037), uint16(2037), uint16(2037), uint16(2037), uint16(2037), uint16(2037), uint16(193), uint16(837), uint16(1194),
+ /* 410 */ uint16(1212), uint16(506), uint16(832), uint16(1054), uint16(1390), uint16(925), uint16(1435), uint16(1394), uint16(1102), uint16(1332),
+ /* 420 */ uint16(1419), uint16(1196), uint16(1420), uint16(1425), uint16(1433), uint16(1447), uint16(1457), uint16(1488), uint16(1443), uint16(1379),
+ /* 430 */ uint16(1572), uint16(1455), uint16(1503), uint16(1453), uint16(1495), uint16(1515), uint16(1506), uint16(1526), uint16(1460), uint16(1489),
+ /* 440 */ uint16(1581), uint16(1622), uint16(1534), uint16(667), uint16(1888), uint16(1893), uint16(1875), uint16(1736), uint16(1884), uint16(1885),
+ /* 450 */ uint16(1877), uint16(1879), uint16(1765), uint16(1754), uint16(1776), uint16(1881), uint16(1881), uint16(1883), uint16(1767), uint16(1889),
+ /* 460 */ uint16(1768), uint16(1894), uint16(1911), uint16(1772), uint16(1788), uint16(1881), uint16(1789), uint16(1858), uint16(1886), uint16(1881),
+ /* 470 */ uint16(1770), uint16(1868), uint16(1869), uint16(1872), uint16(1873), uint16(1795), uint16(1812), uint16(1895), uint16(1790), uint16(1927),
+ /* 480 */ uint16(1926), uint16(1910), uint16(1819), uint16(1774), uint16(1867), uint16(1912), uint16(1870), uint16(1861), uint16(1898), uint16(1800),
+ /* 490 */ uint16(1827), uint16(1918), uint16(1923), uint16(1925), uint16(1815), uint16(1822), uint16(1928), uint16(1880), uint16(1929), uint16(1930),
+ /* 500 */ uint16(1931), uint16(1933), uint16(1882), uint16(1897), uint16(1924), uint16(1857), uint16(1932), uint16(1935), uint16(1891), uint16(1922),
+ /* 510 */ uint16(1938), uint16(1814), uint16(1941), uint16(1942), uint16(1943), uint16(1944), uint16(1939), uint16(1945), uint16(1947), uint16(1874),
+ /* 520 */ uint16(1830), uint16(1949), uint16(1950), uint16(1859), uint16(1946), uint16(1953), uint16(1834), uint16(1952), uint16(1948), uint16(1951),
+ /* 530 */ uint16(1954), uint16(1955), uint16(1890), uint16(1904), uint16(1900), uint16(1937), uint16(1908), uint16(1899), uint16(1956), uint16(1961),
+ /* 540 */ uint16(1965), uint16(1967), uint16(1968), uint16(1969), uint16(1962), uint16(1972), uint16(1952), uint16(1974), uint16(1975), uint16(1976),
+ /* 550 */ uint16(1977), uint16(1978), uint16(1979), uint16(1982), uint16(1990), uint16(1983), uint16(1984), uint16(1985), uint16(1986), uint16(1988),
+ /* 560 */ uint16(1989), uint16(1987), uint16(1887), uint16(1876), uint16(1878), uint16(1892), uint16(1896), uint16(1992), uint16(1991), uint16(1998),
+ /* 570 */ uint16(2006), uint16(2014),
+} /* sqlite3.c:160457:33 */
+var yy_reduce_ofst = [407]int16{
+ /* 0 */ int16(109), int16(113), int16(272), int16(760), int16(-178), int16(-176), int16(-192), int16(-183), int16(-180), int16(-134),
+ /* 10 */ int16(213), int16(220), int16(371), int16(-208), int16(-205), int16(-272), int16(-197), int16(611), int16(632), int16(765),
+ /* 20 */ int16(786), int16(392), int16(943), int16(989), int16(503), int16(651), int16(1039), int16(-18), int16(702), int16(821),
+ /* 30 */ int16(710), int16(812), int16(-188), int16(380), int16(-187), int16(555), int16(662), int16(1055), int16(1063), int16(1065),
+ /* 40 */ int16(1080), int16(-267), int16(-267), int16(-267), int16(-267), int16(-267), int16(-267), int16(-267), int16(-267), int16(-267),
+ /* 50 */ int16(-267), int16(-267), int16(-267), int16(-267), int16(-267), int16(-267), int16(-267), int16(-267), int16(-267), int16(-267),
+ /* 60 */ int16(-267), int16(-267), int16(-267), int16(-267), int16(-267), int16(-267), int16(-267), int16(-267), int16(-267), int16(-267),
+ /* 70 */ int16(-267), int16(-267), int16(-267), int16(-267), int16(-267), int16(-267), int16(-267), int16(-267), int16(636), int16(811),
+ /* 80 */ int16(917), int16(936), int16(1006), int16(1008), int16(1017), int16(1060), int16(1064), int16(1069), int16(1075), int16(1105),
+ /* 90 */ int16(1118), int16(1123), int16(1125), int16(1134), int16(1140), int16(1159), int16(1165), int16(1169), int16(1174), int16(1179),
+ /* 100 */ int16(1181), int16(1184), int16(1186), int16(1201), int16(1246), int16(1259), int16(1262), int16(1281), int16(1293), int16(1299),
+ /* 110 */ int16(1313), int16(1327), int16(1341), int16(1352), int16(1356), int16(1358), int16(1362), int16(1366), int16(1395), int16(1403),
+ /* 120 */ int16(1406), int16(1411), int16(1424), int16(1436), int16(1439), int16(1450), int16(1452), int16(-267), int16(-267), int16(-267),
+ /* 130 */ int16(-267), int16(-267), int16(-267), int16(-267), int16(-267), int16(224), int16(-267), int16(446), int16(-24), int16(275),
+ /* 140 */ int16(546), int16(518), int16(573), int16(560), int16(53), int16(-181), int16(-111), int16(485), int16(606), int16(671),
+ /* 150 */ int16(606), int16(671), int16(683), int16(8), int16(93), int16(-267), int16(-267), int16(-267), int16(-267), int16(155),
+ /* 160 */ int16(155), int16(155), int16(181), int16(242), int16(264), int16(486), int16(489), int16(-218), int16(393), int16(227),
+ /* 170 */ int16(604), int16(347), int16(347), int16(-171), int16(431), int16(650), int16(715), int16(-166), int16(562), int16(609),
+ /* 180 */ int16(716), int16(764), int16(18), int16(823), int16(769), int16(833), int16(838), int16(957), int16(759), int16(119),
+ /* 190 */ int16(923), int16(226), int16(1014), int16(542), int16(603), int16(451), int16(949), int16(654), int16(659), int16(762),
+ /* 200 */ int16(964), int16(-4), int16(778), int16(961), int16(712), int16(1082), int16(1100), int16(1111), int16(1026), int16(1117),
+ /* 210 */ int16(-204), int16(-174), int16(-151), int16(-8), int16(77), int16(198), int16(305), int16(327), int16(388), int16(540),
+ /* 220 */ int16(839), int16(968), int16(982), int16(985), int16(1004), int16(1023), int16(1070), int16(1086), int16(1097), int16(1130),
+ /* 230 */ int16(1190), int16(1163), int16(1199), int16(1284), int16(1297), int16(1300), int16(1314), int16(1339), int16(1353), int16(1391),
+ /* 240 */ int16(1402), int16(1413), int16(1416), int16(1417), int16(803), int16(1376), int16(1400), int16(1428), int16(1437), int16(1446),
+ /* 250 */ int16(1378), int16(1461), int16(1464), int16(1465), int16(1249), int16(1329), int16(1466), int16(1467), int16(1414), int16(1468),
+ /* 260 */ int16(305), int16(1469), int16(1470), int16(1471), int16(1472), int16(1482), int16(1483), int16(1389), int16(1392), int16(1438),
+ /* 270 */ int16(1426), int16(1427), int16(1432), int16(1434), int16(1378), int16(1438), int16(1438), int16(1440), int16(1474), int16(1499),
+ /* 280 */ int16(1399), int16(1421), int16(1430), int16(1456), int16(1441), int16(1442), int16(1444), int16(1415), int16(1473), int16(1431),
+ /* 290 */ int16(1445), int16(1476), int16(1449), int16(1478), int16(1418), int16(1479), int16(1477), int16(1485), int16(1493), int16(1494),
+ /* 300 */ int16(1496), int16(1458), int16(1475), int16(1480), int16(1459), int16(1490), int16(1484), int16(1518), int16(1448), int16(1451),
+ /* 310 */ int16(1537), int16(1538), int16(1463), int16(1481), int16(1541), int16(1486), int16(1487), int16(1491), int16(1519), int16(1514),
+ /* 320 */ int16(1521), int16(1523), int16(1525), int16(1552), int16(1556), int16(1520), int16(1492), int16(1498), int16(1522), int16(1497),
+ /* 330 */ int16(1539), int16(1528), int16(1542), int16(1532), int16(1571), int16(1573), int16(1500), int16(1504), int16(1582), int16(1584),
+ /* 340 */ int16(1563), int16(1586), int16(1588), int16(1589), int16(1597), int16(1567), int16(1579), int16(1585), int16(1590), int16(1568),
+ /* 350 */ int16(1583), int16(1587), int16(1593), int16(1591), int16(1598), int16(1599), int16(1600), int16(1602), int16(1606), int16(1513),
+ /* 360 */ int16(1524), int16(1548), int16(1549), int16(1611), int16(1574), int16(1576), int16(1594), int16(1603), int16(1604), int16(1607),
+ /* 370 */ int16(1605), int16(1608), int16(1642), int16(1527), int16(1529), int16(1609), int16(1610), int16(1601), int16(1615), int16(1575),
+ /* 380 */ int16(1650), int16(1578), int16(1619), int16(1623), int16(1625), int16(1624), int16(1674), int16(1685), int16(1686), int16(1691),
+ /* 390 */ int16(1692), int16(1693), int16(1612), int16(1613), int16(1617), int16(1675), int16(1668), int16(1673), int16(1676), int16(1677),
+ /* 400 */ int16(1680), int16(1666), int16(1669), int16(1678), int16(1681), int16(1683), int16(1687),
+} /* sqlite3.c:160520:20 */
+var yy_default = [572]uint16{
+ /* 0 */ uint16(1633), uint16(1633), uint16(1633), uint16(1462), uint16(1230), uint16(1341), uint16(1230), uint16(1230), uint16(1230), uint16(1462),
+ /* 10 */ uint16(1462), uint16(1462), uint16(1230), uint16(1371), uint16(1371), uint16(1515), uint16(1263), uint16(1230), uint16(1230), uint16(1230),
+ /* 20 */ uint16(1230), uint16(1230), uint16(1230), uint16(1230), uint16(1230), uint16(1230), uint16(1230), uint16(1461), uint16(1230), uint16(1230),
+ /* 30 */ uint16(1230), uint16(1230), uint16(1550), uint16(1550), uint16(1230), uint16(1230), uint16(1230), uint16(1230), uint16(1230), uint16(1230),
+ /* 40 */ uint16(1230), uint16(1230), uint16(1380), uint16(1230), uint16(1387), uint16(1230), uint16(1230), uint16(1230), uint16(1230), uint16(1230),
+ /* 50 */ uint16(1463), uint16(1464), uint16(1230), uint16(1230), uint16(1230), uint16(1514), uint16(1516), uint16(1479), uint16(1394), uint16(1393),
+ /* 60 */ uint16(1392), uint16(1391), uint16(1497), uint16(1358), uint16(1385), uint16(1378), uint16(1382), uint16(1457), uint16(1458), uint16(1456),
+ /* 70 */ uint16(1460), uint16(1464), uint16(1463), uint16(1230), uint16(1381), uint16(1428), uint16(1442), uint16(1427), uint16(1230), uint16(1230),
+ /* 80 */ uint16(1230), uint16(1230), uint16(1230), uint16(1230), uint16(1230), uint16(1230), uint16(1230), uint16(1230), uint16(1230), uint16(1230),
+ /* 90 */ uint16(1230), uint16(1230), uint16(1230), uint16(1230), uint16(1230), uint16(1230), uint16(1230), uint16(1230), uint16(1230), uint16(1230),
+ /* 100 */ uint16(1230), uint16(1230), uint16(1230), uint16(1230), uint16(1230), uint16(1230), uint16(1230), uint16(1230), uint16(1230), uint16(1230),
+ /* 110 */ uint16(1230), uint16(1230), uint16(1230), uint16(1230), uint16(1230), uint16(1230), uint16(1230), uint16(1230), uint16(1230), uint16(1230),
+ /* 120 */ uint16(1230), uint16(1230), uint16(1230), uint16(1230), uint16(1230), uint16(1230), uint16(1230), uint16(1436), uint16(1441), uint16(1447),
+ /* 130 */ uint16(1440), uint16(1437), uint16(1430), uint16(1429), uint16(1431), uint16(1230), uint16(1432), uint16(1230), uint16(1254), uint16(1230),
+ /* 140 */ uint16(1230), uint16(1251), uint16(1305), uint16(1230), uint16(1230), uint16(1230), uint16(1230), uint16(1230), uint16(1534), uint16(1533),
+ /* 150 */ uint16(1230), uint16(1230), uint16(1263), uint16(1422), uint16(1421), uint16(1433), uint16(1434), uint16(1444), uint16(1443), uint16(1522),
+ /* 160 */ uint16(1586), uint16(1585), uint16(1480), uint16(1230), uint16(1230), uint16(1230), uint16(1230), uint16(1230), uint16(1230), uint16(1550),
+ /* 170 */ uint16(1230), uint16(1230), uint16(1230), uint16(1230), uint16(1230), uint16(1230), uint16(1230), uint16(1230), uint16(1230), uint16(1230),
+ /* 180 */ uint16(1230), uint16(1230), uint16(1230), uint16(1230), uint16(1230), uint16(1230), uint16(1230), uint16(1230), uint16(1230), uint16(1230),
+ /* 190 */ uint16(1230), uint16(1230), uint16(1230), uint16(1550), uint16(1550), uint16(1230), uint16(1263), uint16(1550), uint16(1550), uint16(1259),
+ /* 200 */ uint16(1259), uint16(1365), uint16(1230), uint16(1529), uint16(1332), uint16(1332), uint16(1332), uint16(1332), uint16(1341), uint16(1332),
+ /* 210 */ uint16(1230), uint16(1230), uint16(1230), uint16(1230), uint16(1230), uint16(1230), uint16(1230), uint16(1230), uint16(1230), uint16(1230),
+ /* 220 */ uint16(1230), uint16(1230), uint16(1230), uint16(1230), uint16(1230), uint16(1519), uint16(1517), uint16(1230), uint16(1230), uint16(1230),
+ /* 230 */ uint16(1230), uint16(1230), uint16(1230), uint16(1230), uint16(1230), uint16(1230), uint16(1230), uint16(1230), uint16(1230), uint16(1230),
+ /* 240 */ uint16(1230), uint16(1230), uint16(1230), uint16(1230), uint16(1230), uint16(1230), uint16(1230), uint16(1230), uint16(1230), uint16(1230),
+ /* 250 */ uint16(1230), uint16(1230), uint16(1230), uint16(1230), uint16(1337), uint16(1230), uint16(1230), uint16(1230), uint16(1230), uint16(1230),
+ /* 260 */ uint16(1230), uint16(1230), uint16(1230), uint16(1230), uint16(1230), uint16(1230), uint16(1579), uint16(1230), uint16(1492), uint16(1319),
+ /* 270 */ uint16(1337), uint16(1337), uint16(1337), uint16(1337), uint16(1339), uint16(1320), uint16(1318), uint16(1331), uint16(1264), uint16(1237),
+ /* 280 */ uint16(1625), uint16(1397), uint16(1386), uint16(1338), uint16(1360), uint16(1386), uint16(1360), uint16(1622), uint16(1384), uint16(1397),
+ /* 290 */ uint16(1397), uint16(1384), uint16(1397), uint16(1338), uint16(1622), uint16(1280), uint16(1602), uint16(1275), uint16(1371), uint16(1371),
+ /* 300 */ uint16(1371), uint16(1360), uint16(1365), uint16(1365), uint16(1459), uint16(1338), uint16(1331), uint16(1230), uint16(1625), uint16(1625),
+ /* 310 */ uint16(1346), uint16(1346), uint16(1624), uint16(1624), uint16(1346), uint16(1480), uint16(1609), uint16(1406), uint16(1308), uint16(1314),
+ /* 320 */ uint16(1314), uint16(1314), uint16(1314), uint16(1346), uint16(1248), uint16(1384), uint16(1609), uint16(1609), uint16(1384), uint16(1406),
+ /* 330 */ uint16(1308), uint16(1384), uint16(1308), uint16(1384), uint16(1346), uint16(1248), uint16(1496), uint16(1619), uint16(1346), uint16(1248),
+ /* 340 */ uint16(1470), uint16(1346), uint16(1248), uint16(1346), uint16(1248), uint16(1470), uint16(1306), uint16(1306), uint16(1306), uint16(1295),
+ /* 350 */ uint16(1230), uint16(1230), uint16(1470), uint16(1306), uint16(1280), uint16(1306), uint16(1295), uint16(1306), uint16(1306), uint16(1568),
+ /* 360 */ uint16(1230), uint16(1474), uint16(1474), uint16(1470), uint16(1364), uint16(1359), uint16(1364), uint16(1359), uint16(1364), uint16(1359),
+ /* 370 */ uint16(1364), uint16(1359), uint16(1346), uint16(1560), uint16(1560), uint16(1374), uint16(1374), uint16(1379), uint16(1365), uint16(1465),
+ /* 380 */ uint16(1346), uint16(1230), uint16(1379), uint16(1377), uint16(1375), uint16(1384), uint16(1298), uint16(1582), uint16(1582), uint16(1578),
+ /* 390 */ uint16(1578), uint16(1578), uint16(1630), uint16(1630), uint16(1529), uint16(1595), uint16(1263), uint16(1263), uint16(1263), uint16(1263),
+ /* 400 */ uint16(1595), uint16(1282), uint16(1282), uint16(1264), uint16(1264), uint16(1263), uint16(1595), uint16(1230), uint16(1230), uint16(1230),
+ /* 410 */ uint16(1230), uint16(1230), uint16(1230), uint16(1590), uint16(1230), uint16(1524), uint16(1481), uint16(1350), uint16(1230), uint16(1230),
+ /* 420 */ uint16(1230), uint16(1230), uint16(1230), uint16(1230), uint16(1230), uint16(1230), uint16(1230), uint16(1230), uint16(1230), uint16(1230),
+ /* 430 */ uint16(1230), uint16(1230), uint16(1535), uint16(1230), uint16(1230), uint16(1230), uint16(1230), uint16(1230), uint16(1230), uint16(1230),
+ /* 440 */ uint16(1230), uint16(1230), uint16(1230), uint16(1411), uint16(1230), uint16(1233), uint16(1526), uint16(1230), uint16(1230), uint16(1230),
+ /* 450 */ uint16(1230), uint16(1230), uint16(1230), uint16(1230), uint16(1230), uint16(1388), uint16(1389), uint16(1351), uint16(1230), uint16(1230),
+ /* 460 */ uint16(1230), uint16(1230), uint16(1230), uint16(1230), uint16(1230), uint16(1403), uint16(1230), uint16(1230), uint16(1230), uint16(1398),
+ /* 470 */ uint16(1230), uint16(1230), uint16(1230), uint16(1230), uint16(1230), uint16(1230), uint16(1230), uint16(1230), uint16(1621), uint16(1230),
+ /* 480 */ uint16(1230), uint16(1230), uint16(1230), uint16(1230), uint16(1230), uint16(1495), uint16(1494), uint16(1230), uint16(1230), uint16(1348),
+ /* 490 */ uint16(1230), uint16(1230), uint16(1230), uint16(1230), uint16(1230), uint16(1230), uint16(1230), uint16(1230), uint16(1230), uint16(1230),
+ /* 500 */ uint16(1230), uint16(1230), uint16(1230), uint16(1278), uint16(1230), uint16(1230), uint16(1230), uint16(1230), uint16(1230), uint16(1230),
+ /* 510 */ uint16(1230), uint16(1230), uint16(1230), uint16(1230), uint16(1230), uint16(1230), uint16(1230), uint16(1230), uint16(1230), uint16(1230),
+ /* 520 */ uint16(1230), uint16(1230), uint16(1230), uint16(1230), uint16(1230), uint16(1230), uint16(1230), uint16(1376), uint16(1230), uint16(1230),
+ /* 530 */ uint16(1230), uint16(1230), uint16(1230), uint16(1230), uint16(1230), uint16(1230), uint16(1230), uint16(1230), uint16(1230), uint16(1230),
+ /* 540 */ uint16(1230), uint16(1230), uint16(1565), uint16(1366), uint16(1230), uint16(1230), uint16(1612), uint16(1230), uint16(1230), uint16(1230),
+ /* 550 */ uint16(1230), uint16(1230), uint16(1230), uint16(1230), uint16(1230), uint16(1230), uint16(1230), uint16(1230), uint16(1230), uint16(1230),
+ /* 560 */ uint16(1230), uint16(1606), uint16(1322), uint16(1413), uint16(1230), uint16(1412), uint16(1416), uint16(1252), uint16(1230), uint16(1242),
+ /* 570 */ uint16(1230), uint16(1230),
+} /* sqlite3.c:160563:27 */
//********* End of lemon-generated parsing tables ****************************
// The next table maps tokens (terminal symbols) into fallback tokens.
@@ -140253,8 +142332,8 @@ var yyFallback = [184]uint16{
uint16(0), // LP => nothing
uint16(0), // RP => nothing
uint16(0), // AS => nothing
- uint16(59), // WITHOUT => ID
uint16(0), // COMMA => nothing
+ uint16(59), // WITHOUT => ID
uint16(59), // ABORT => ID
uint16(59), // ACTION => ID
uint16(59), // AFTER => ID
@@ -140412,7 +142491,7 @@ var yyFallback = [184]uint16{
uint16(0), // ERROR => nothing
uint16(0), // SPACE => nothing
uint16(0), // ILLEGAL => nothing
-} /* sqlite3.c:159200:25 */
+} /* sqlite3.c:160640:25 */
// The following structure represents a single element of the
// parser's stack. Information stored includes:
@@ -140433,9 +142512,9 @@ type yyStackEntry = struct {
Fstateno uint16
Fmajor uint16
Fminor YYMINORTYPE
-} /* sqlite3.c:159404:1 */
+} /* sqlite3.c:160844:1 */
-type YyStackEntry = yyStackEntry /* sqlite3.c:159411:29 */
+type YyStackEntry = yyStackEntry /* sqlite3.c:160851:29 */
// The state of the parser is completely contained in an instance of
// the following structure
@@ -140444,9 +142523,11 @@ type yyParser = struct {
FpParse uintptr
Fyystack [100]YyStackEntry
FyystackEnd uintptr
-} /* sqlite3.c:159415:1 */
+} /* sqlite3.c:160855:1 */
+
+type YyParser = yyParser /* sqlite3.c:160874:25 */
-type YyParser = yyParser /* sqlite3.c:159434:25 */
+// #include <assert.h>
// Datatype of the argument to the memory allocated passed as the
// second argument to sqlite3ParserAlloc() below. This can be changed by
@@ -140454,13 +142535,13 @@ type YyParser = yyParser /* sqlite3.c:159434:25 */
// grammar.
// Initialize a new parser that has already been allocated.
-func Xsqlite3ParserInit(tls *libc.TLS, yypRawParser uintptr, pParse uintptr) { /* sqlite3.c:160243:21: */
+func Xsqlite3ParserInit(tls *libc.TLS, yypRawParser uintptr, pParse uintptr) { /* sqlite3.c:161687:21: */
var yypParser uintptr = yypRawParser
(*YyParser)(unsafe.Pointer(yypParser)).FpParse = pParse
(*YyParser)(unsafe.Pointer(yypParser)).Fyytos = yypParser + 8 /* &.yystack */
- (*YyStackEntry)(unsafe.Pointer((yypParser + 8 /* &.yystack */))).Fstateno = uint16(0)
- (*YyStackEntry)(unsafe.Pointer((yypParser + 8 /* &.yystack */))).Fmajor = uint16(0)
- (*YyParser)(unsafe.Pointer(yypParser)).FyystackEnd = ((yypParser + 8 /* &.yystack */) + 99*12)
+ (*YyStackEntry)(unsafe.Pointer(yypParser + 8)).Fstateno = uint16(0)
+ (*YyStackEntry)(unsafe.Pointer(yypParser + 8)).Fmajor = uint16(0)
+ (*YyParser)(unsafe.Pointer(yypParser)).FyystackEnd = yypParser + 8 + 99*12
}
// The following function deletes the "minor type" or semantic value
@@ -140469,7 +142550,7 @@ func Xsqlite3ParserInit(tls *libc.TLS, yypRawParser uintptr, pParse uintptr) { /
// a pointer to the value to be deleted. The code used to do the
// deletions is derived from the %destructor and/or %token_destructor
// directives of the input grammar.
-func yy_destructor(tls *libc.TLS, yypParser uintptr, yymajor uint16, yypminor uintptr) { /* sqlite3.c:160301:13: */
+func yy_destructor(tls *libc.TLS, yypParser uintptr, yymajor uint16, yypminor uintptr) { /* sqlite3.c:161745:13: */
var pParse uintptr = (*YyParser)(unsafe.Pointer(yypParser)).FpParse
switch int32(yymajor) {
@@ -140485,135 +142566,135 @@ func yy_destructor(tls *libc.TLS, yypParser uintptr, yymajor uint16, yypminor ui
//******** Begin destructor definitions **************************************
case 203:
fallthrough // select
- case 237:
- fallthrough // selectnowith
case 238:
+ fallthrough // selectnowith
+ case 239:
fallthrough // oneselect
- case 250: /* values */
+ case 251: /* values */
{
- Xsqlite3SelectDelete(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, *(*uintptr)(unsafe.Pointer(yypminor /* .Fyy81 */)))
+ Xsqlite3SelectDelete(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, *(*uintptr)(unsafe.Pointer(yypminor)))
}
break
- case 214:
- fallthrough // term
case 215:
+ fallthrough // term
+ case 216:
fallthrough // expr
- case 244:
+ case 245:
fallthrough // where_opt
- case 246:
+ case 247:
fallthrough // having_opt
- case 258:
+ case 259:
fallthrough // on_opt
- case 265:
+ case 266:
fallthrough // where_opt_ret
- case 276:
+ case 277:
fallthrough // case_operand
- case 278:
+ case 279:
fallthrough // case_else
- case 281:
+ case 282:
fallthrough // vinto
- case 288:
+ case 289:
fallthrough // when_clause
- case 293:
+ case 294:
fallthrough // key_opt
- case 309: /* filter_clause */
+ case 310: /* filter_clause */
{
- Xsqlite3ExprDelete(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, *(*uintptr)(unsafe.Pointer(yypminor /* .Fyy404 */)))
+ Xsqlite3ExprDelete(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, *(*uintptr)(unsafe.Pointer(yypminor)))
}
break
- case 219:
+ case 220:
fallthrough // eidlist_opt
- case 229:
- fallthrough // sortlist
case 230:
+ fallthrough // sortlist
+ case 231:
fallthrough // eidlist
- case 242:
+ case 243:
fallthrough // selcollist
- case 245:
+ case 246:
fallthrough // groupby_opt
- case 247:
+ case 248:
fallthrough // orderby_opt
- case 251:
- fallthrough // nexprlist
case 252:
+ fallthrough // nexprlist
+ case 253:
fallthrough // sclp
- case 260:
+ case 261:
fallthrough // exprlist
- case 266:
+ case 267:
fallthrough // setlist
- case 275:
+ case 276:
fallthrough // paren_exprlist
- case 277:
+ case 278:
fallthrough // case_exprlist
- case 308: /* part_opt */
+ case 309: /* part_opt */
{
- Xsqlite3ExprListDelete(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, *(*uintptr)(unsafe.Pointer(yypminor /* .Fyy70 */)))
+ Xsqlite3ExprListDelete(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, *(*uintptr)(unsafe.Pointer(yypminor)))
}
break
- case 236:
+ case 237:
fallthrough // fullname
- case 243:
+ case 244:
fallthrough // from
- case 254:
- fallthrough // seltablist
case 255:
+ fallthrough // seltablist
+ case 256:
fallthrough // stl_prefix
- case 261: /* xfullname */
+ case 262: /* xfullname */
{
- Xsqlite3SrcListDelete(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, *(*uintptr)(unsafe.Pointer(yypminor /* .Fyy153 */)))
+ Xsqlite3SrcListDelete(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, *(*uintptr)(unsafe.Pointer(yypminor)))
}
break
- case 239: /* wqlist */
+ case 240: /* wqlist */
{
- Xsqlite3WithDelete(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, *(*uintptr)(unsafe.Pointer(yypminor /* .Fyy103 */)))
+ Xsqlite3WithDelete(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, *(*uintptr)(unsafe.Pointer(yypminor)))
}
break
- case 249:
+ case 250:
fallthrough // window_clause
- case 304: /* windowdefn_list */
+ case 305: /* windowdefn_list */
{
- Xsqlite3WindowListDelete(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, *(*uintptr)(unsafe.Pointer(yypminor /* .Fyy49 */)))
+ Xsqlite3WindowListDelete(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, *(*uintptr)(unsafe.Pointer(yypminor)))
}
break
- case 259:
+ case 260:
fallthrough // using_opt
- case 262:
+ case 263:
fallthrough // idlist
- case 268: /* idlist_opt */
+ case 269: /* idlist_opt */
{
- Xsqlite3IdListDelete(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, *(*uintptr)(unsafe.Pointer(yypminor /* .Fyy436 */)))
+ Xsqlite3IdListDelete(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, *(*uintptr)(unsafe.Pointer(yypminor)))
}
break
- case 271:
+ case 272:
fallthrough // filter_over
- case 305:
- fallthrough // windowdefn
case 306:
- fallthrough // window
+ fallthrough // windowdefn
case 307:
+ fallthrough // window
+ case 308:
fallthrough // frame_opt
- case 310: /* over_clause */
+ case 311: /* over_clause */
{
- Xsqlite3WindowDelete(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, *(*uintptr)(unsafe.Pointer(yypminor /* .Fyy49 */)))
+ Xsqlite3WindowDelete(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, *(*uintptr)(unsafe.Pointer(yypminor)))
}
break
- case 284:
+ case 285:
fallthrough // trigger_cmd_list
- case 289: /* trigger_cmd */
+ case 290: /* trigger_cmd */
{
- Xsqlite3DeleteTriggerStep(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, *(*uintptr)(unsafe.Pointer(yypminor /* .Fyy157 */)))
+ Xsqlite3DeleteTriggerStep(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, *(*uintptr)(unsafe.Pointer(yypminor)))
}
break
- case 286: /* trigger_event */
+ case 287: /* trigger_event */
{
Xsqlite3IdListDelete(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, (*TrigEvent)(unsafe.Pointer(yypminor)).Fb)
}
break
- case 312:
- fallthrough // frame_bound
case 313:
+ fallthrough // frame_bound
+ case 314:
fallthrough // frame_bound_s
- case 314: /* frame_bound_e */
+ case 315: /* frame_bound_e */
{
Xsqlite3ExprDelete(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, (*FrameBound)(unsafe.Pointer(yypminor)).FpExpr)
}
@@ -140628,17 +142709,17 @@ func yy_destructor(tls *libc.TLS, yypParser uintptr, yymajor uint16, yypminor ui
//
// If there is a destructor routine associated with the token which
// is popped from the stack, then call it.
-func yy_pop_parser_stack(tls *libc.TLS, pParser uintptr) { /* sqlite3.c:160426:13: */
+func yy_pop_parser_stack(tls *libc.TLS, pParser uintptr) { /* sqlite3.c:161870:13: */
var yytos uintptr
yytos = libc.PostDecUintptr(&(*YyParser)(unsafe.Pointer(pParser)).Fyytos, 12)
- yy_destructor(tls, pParser, (*YyStackEntry)(unsafe.Pointer(yytos)).Fmajor, (yytos + 4 /* &.minor */))
+ yy_destructor(tls, pParser, (*YyStackEntry)(unsafe.Pointer(yytos)).Fmajor, yytos+4)
}
// Clear all secondary memory allocations from the parser
-func Xsqlite3ParserFinalize(tls *libc.TLS, p uintptr) { /* sqlite3.c:160444:21: */
+func Xsqlite3ParserFinalize(tls *libc.TLS, p uintptr) { /* sqlite3.c:161888:21: */
var pParser uintptr = p
- for (*YyParser)(unsafe.Pointer(pParser)).Fyytos > pParser+8 /* &.yystack */ {
+ for (*YyParser)(unsafe.Pointer(pParser)).Fyytos > pParser+8 {
yy_pop_parser_stack(tls, pParser)
}
}
@@ -140659,7 +142740,7 @@ func Xsqlite3ParserFinalize(tls *libc.TLS, p uintptr) { /* sqlite3.c:160444:21:
// Find the appropriate action for a parser given the terminal
// look-ahead token iLookAhead.
-func yy_find_shift_action(tls *libc.TLS, iLookAhead uint16, stateno uint16) uint16 { /* sqlite3.c:160524:21: */
+func yy_find_shift_action(tls *libc.TLS, iLookAhead uint16, stateno uint16) uint16 { /* sqlite3.c:161968:21: */
var i int32
if int32(stateno) > YY_MAX_SHIFT {
@@ -140669,7 +142750,7 @@ func yy_find_shift_action(tls *libc.TLS, iLookAhead uint16, stateno uint16) uint
for ok := true; ok; ok = 1 != 0 {
i = int32(yy_shift_ofst[stateno])
- i = i + (int32(iLookAhead))
+ i = i + int32(iLookAhead)
if int32(yy_lookahead[i]) != int32(iLookAhead) {
var iFallback uint16 // Fallback token
@@ -140681,9 +142762,9 @@ func yy_find_shift_action(tls *libc.TLS, iLookAhead uint16, stateno uint16) uint
continue
}
{
- var j int32 = ((i - int32(iLookAhead)) + YYWILDCARD)
+ var j int32 = i - int32(iLookAhead) + YYWILDCARD
- if (int32(yy_lookahead[j]) == YYWILDCARD) && (int32(iLookAhead) > 0) {
+ if int32(yy_lookahead[j]) == YYWILDCARD && int32(iLookAhead) > 0 {
return yy_action[j]
}
@@ -140699,28 +142780,28 @@ func yy_find_shift_action(tls *libc.TLS, iLookAhead uint16, stateno uint16) uint
// Find the appropriate action for a parser given the non-terminal
// look-ahead token iLookAhead.
-func yy_find_reduce_action(tls *libc.TLS, stateno uint16, iLookAhead uint16) uint16 { /* sqlite3.c:160589:21: */
+func yy_find_reduce_action(tls *libc.TLS, stateno uint16, iLookAhead uint16) uint16 { /* sqlite3.c:162033:21: */
var i int32
i = int32(yy_reduce_ofst[stateno])
- i = i + (int32(iLookAhead))
+ i = i + int32(iLookAhead)
return yy_action[i]
}
// The following routine is called if the stack overflows.
-func yyStackOverflow(tls *libc.TLS, yypParser uintptr) { /* sqlite3.c:160618:13: */
+func yyStackOverflow(tls *libc.TLS, yypParser uintptr) { /* sqlite3.c:162062:13: */
var pParse uintptr = (*YyParser)(unsafe.Pointer(yypParser)).FpParse
- for (*YyParser)(unsafe.Pointer(yypParser)).Fyytos > yypParser+8 /* &.yystack */ {
+ for (*YyParser)(unsafe.Pointer(yypParser)).Fyytos > yypParser+8 {
yy_pop_parser_stack(tls, yypParser)
}
// Here code is inserted which will execute if the parser
// stack every overflows
//******* Begin %stack_overflow code *****************************************
- Xsqlite3ErrorMsg(tls, pParse, ts+21217 /* "parser stack ove..." */, 0)
+ Xsqlite3ErrorMsg(tls, pParse, ts+22514 /* "parser stack ove..." */, 0)
//******* End %stack_overflow code *******************************************
(*YyParser)(unsafe.Pointer(yypParser)).FpParse = pParse
@@ -140729,7 +142810,7 @@ func yyStackOverflow(tls *libc.TLS, yypParser uintptr) { /* sqlite3.c:160618:13:
// Print tracing information for a SHIFT action
// Perform a shift action.
-func yy_shift(tls *libc.TLS, yypParser uintptr, yyNewState uint16, yyMajor uint16, yyMinor Token) { /* sqlite3.c:160661:13: */
+func yy_shift(tls *libc.TLS, yypParser uintptr, yyNewState uint16, yyMajor uint16, yyMinor Token) { /* sqlite3.c:162105:13: */
var yytos uintptr
(*YyParser)(unsafe.Pointer(yypParser)).Fyytos += 12
if (*YyParser)(unsafe.Pointer(yypParser)).Fyytos > (*YyParser)(unsafe.Pointer(yypParser)).FyystackEnd {
@@ -140743,13 +142824,13 @@ func yy_shift(tls *libc.TLS, yypParser uintptr, yyNewState uint16, yyMajor uint1
yytos = (*YyParser)(unsafe.Pointer(yypParser)).Fyytos
(*YyStackEntry)(unsafe.Pointer(yytos)).Fstateno = yyNewState
(*YyStackEntry)(unsafe.Pointer(yytos)).Fmajor = yyMajor
- *(*Token)(unsafe.Pointer(yytos + 4 /* &.minor */)) = yyMinor
+ *(*Token)(unsafe.Pointer(yytos + 4)) = yyMinor
}
// For rule J, yyRuleInfoLhs[J] contains the symbol on the left-hand side
// of that rule
-var yyRuleInfoLhs = [398]uint16{
+var yyRuleInfoLhs = [401]uint16{
uint16(188), // (0) explain ::= EXPLAIN
uint16(188), // (1) explain ::= EXPLAIN QUERY PLAN
uint16(187), // (2) cmdx ::= cmd
@@ -140769,390 +142850,393 @@ var yyRuleInfoLhs = [398]uint16{
uint16(198), // (16) ifnotexists ::= IF NOT EXISTS
uint16(197), // (17) temp ::= TEMP
uint16(197), // (18) temp ::=
- uint16(195), // (19) create_table_args ::= LP columnlist conslist_opt RP table_options
+ uint16(195), // (19) create_table_args ::= LP columnlist conslist_opt RP table_option_set
uint16(195), // (20) create_table_args ::= AS select
- uint16(202), // (21) table_options ::=
- uint16(202), // (22) table_options ::= WITHOUT nm
- uint16(204), // (23) columnname ::= nm typetoken
- uint16(206), // (24) typetoken ::=
- uint16(206), // (25) typetoken ::= typename LP signed RP
- uint16(206), // (26) typetoken ::= typename LP signed COMMA signed RP
- uint16(207), // (27) typename ::= typename ID|STRING
- uint16(211), // (28) scanpt ::=
- uint16(212), // (29) scantok ::=
- uint16(213), // (30) ccons ::= CONSTRAINT nm
- uint16(213), // (31) ccons ::= DEFAULT scantok term
- uint16(213), // (32) ccons ::= DEFAULT LP expr RP
- uint16(213), // (33) ccons ::= DEFAULT PLUS scantok term
- uint16(213), // (34) ccons ::= DEFAULT MINUS scantok term
- uint16(213), // (35) ccons ::= DEFAULT scantok ID|INDEXED
- uint16(213), // (36) ccons ::= NOT NULL onconf
- uint16(213), // (37) ccons ::= PRIMARY KEY sortorder onconf autoinc
- uint16(213), // (38) ccons ::= UNIQUE onconf
- uint16(213), // (39) ccons ::= CHECK LP expr RP
- uint16(213), // (40) ccons ::= REFERENCES nm eidlist_opt refargs
- uint16(213), // (41) ccons ::= defer_subclause
- uint16(213), // (42) ccons ::= COLLATE ID|STRING
- uint16(222), // (43) generated ::= LP expr RP
- uint16(222), // (44) generated ::= LP expr RP ID
- uint16(218), // (45) autoinc ::=
- uint16(218), // (46) autoinc ::= AUTOINCR
- uint16(220), // (47) refargs ::=
- uint16(220), // (48) refargs ::= refargs refarg
- uint16(223), // (49) refarg ::= MATCH nm
- uint16(223), // (50) refarg ::= ON INSERT refact
- uint16(223), // (51) refarg ::= ON DELETE refact
- uint16(223), // (52) refarg ::= ON UPDATE refact
- uint16(224), // (53) refact ::= SET NULL
- uint16(224), // (54) refact ::= SET DEFAULT
- uint16(224), // (55) refact ::= CASCADE
- uint16(224), // (56) refact ::= RESTRICT
- uint16(224), // (57) refact ::= NO ACTION
- uint16(221), // (58) defer_subclause ::= NOT DEFERRABLE init_deferred_pred_opt
- uint16(221), // (59) defer_subclause ::= DEFERRABLE init_deferred_pred_opt
- uint16(225), // (60) init_deferred_pred_opt ::=
- uint16(225), // (61) init_deferred_pred_opt ::= INITIALLY DEFERRED
- uint16(225), // (62) init_deferred_pred_opt ::= INITIALLY IMMEDIATE
- uint16(201), // (63) conslist_opt ::=
- uint16(227), // (64) tconscomma ::= COMMA
- uint16(228), // (65) tcons ::= CONSTRAINT nm
- uint16(228), // (66) tcons ::= PRIMARY KEY LP sortlist autoinc RP onconf
- uint16(228), // (67) tcons ::= UNIQUE LP sortlist RP onconf
- uint16(228), // (68) tcons ::= CHECK LP expr RP onconf
- uint16(228), // (69) tcons ::= FOREIGN KEY LP eidlist RP REFERENCES nm eidlist_opt refargs defer_subclause_opt
- uint16(231), // (70) defer_subclause_opt ::=
- uint16(216), // (71) onconf ::=
- uint16(216), // (72) onconf ::= ON CONFLICT resolvetype
- uint16(232), // (73) orconf ::=
- uint16(232), // (74) orconf ::= OR resolvetype
- uint16(233), // (75) resolvetype ::= IGNORE
- uint16(233), // (76) resolvetype ::= REPLACE
- uint16(189), // (77) cmd ::= DROP TABLE ifexists fullname
- uint16(235), // (78) ifexists ::= IF EXISTS
- uint16(235), // (79) ifexists ::=
- uint16(189), // (80) cmd ::= createkw temp VIEW ifnotexists nm dbnm eidlist_opt AS select
- uint16(189), // (81) cmd ::= DROP VIEW ifexists fullname
- uint16(189), // (82) cmd ::= select
- uint16(203), // (83) select ::= WITH wqlist selectnowith
- uint16(203), // (84) select ::= WITH RECURSIVE wqlist selectnowith
- uint16(203), // (85) select ::= selectnowith
- uint16(237), // (86) selectnowith ::= selectnowith multiselect_op oneselect
- uint16(240), // (87) multiselect_op ::= UNION
- uint16(240), // (88) multiselect_op ::= UNION ALL
- uint16(240), // (89) multiselect_op ::= EXCEPT|INTERSECT
- uint16(238), // (90) oneselect ::= SELECT distinct selcollist from where_opt groupby_opt having_opt orderby_opt limit_opt
- uint16(238), // (91) oneselect ::= SELECT distinct selcollist from where_opt groupby_opt having_opt window_clause orderby_opt limit_opt
- uint16(250), // (92) values ::= VALUES LP nexprlist RP
- uint16(250), // (93) values ::= values COMMA LP nexprlist RP
- uint16(241), // (94) distinct ::= DISTINCT
- uint16(241), // (95) distinct ::= ALL
- uint16(241), // (96) distinct ::=
- uint16(252), // (97) sclp ::=
- uint16(242), // (98) selcollist ::= sclp scanpt expr scanpt as
- uint16(242), // (99) selcollist ::= sclp scanpt STAR
- uint16(242), // (100) selcollist ::= sclp scanpt nm DOT STAR
- uint16(253), // (101) as ::= AS nm
- uint16(253), // (102) as ::=
- uint16(243), // (103) from ::=
- uint16(243), // (104) from ::= FROM seltablist
- uint16(255), // (105) stl_prefix ::= seltablist joinop
- uint16(255), // (106) stl_prefix ::=
- uint16(254), // (107) seltablist ::= stl_prefix nm dbnm as indexed_opt on_opt using_opt
- uint16(254), // (108) seltablist ::= stl_prefix nm dbnm LP exprlist RP as on_opt using_opt
- uint16(254), // (109) seltablist ::= stl_prefix LP select RP as on_opt using_opt
- uint16(254), // (110) seltablist ::= stl_prefix LP seltablist RP as on_opt using_opt
- uint16(199), // (111) dbnm ::=
- uint16(199), // (112) dbnm ::= DOT nm
- uint16(236), // (113) fullname ::= nm
- uint16(236), // (114) fullname ::= nm DOT nm
- uint16(261), // (115) xfullname ::= nm
- uint16(261), // (116) xfullname ::= nm DOT nm
- uint16(261), // (117) xfullname ::= nm DOT nm AS nm
- uint16(261), // (118) xfullname ::= nm AS nm
- uint16(256), // (119) joinop ::= COMMA|JOIN
- uint16(256), // (120) joinop ::= JOIN_KW JOIN
- uint16(256), // (121) joinop ::= JOIN_KW nm JOIN
- uint16(256), // (122) joinop ::= JOIN_KW nm nm JOIN
- uint16(258), // (123) on_opt ::= ON expr
- uint16(258), // (124) on_opt ::=
- uint16(257), // (125) indexed_opt ::=
- uint16(257), // (126) indexed_opt ::= INDEXED BY nm
- uint16(257), // (127) indexed_opt ::= NOT INDEXED
- uint16(259), // (128) using_opt ::= USING LP idlist RP
- uint16(259), // (129) using_opt ::=
- uint16(247), // (130) orderby_opt ::=
- uint16(247), // (131) orderby_opt ::= ORDER BY sortlist
- uint16(229), // (132) sortlist ::= sortlist COMMA expr sortorder nulls
- uint16(229), // (133) sortlist ::= expr sortorder nulls
- uint16(217), // (134) sortorder ::= ASC
- uint16(217), // (135) sortorder ::= DESC
- uint16(217), // (136) sortorder ::=
- uint16(263), // (137) nulls ::= NULLS FIRST
- uint16(263), // (138) nulls ::= NULLS LAST
- uint16(263), // (139) nulls ::=
- uint16(245), // (140) groupby_opt ::=
- uint16(245), // (141) groupby_opt ::= GROUP BY nexprlist
- uint16(246), // (142) having_opt ::=
- uint16(246), // (143) having_opt ::= HAVING expr
- uint16(248), // (144) limit_opt ::=
- uint16(248), // (145) limit_opt ::= LIMIT expr
- uint16(248), // (146) limit_opt ::= LIMIT expr OFFSET expr
- uint16(248), // (147) limit_opt ::= LIMIT expr COMMA expr
- uint16(189), // (148) cmd ::= with DELETE FROM xfullname indexed_opt where_opt_ret
- uint16(244), // (149) where_opt ::=
- uint16(244), // (150) where_opt ::= WHERE expr
- uint16(265), // (151) where_opt_ret ::=
- uint16(265), // (152) where_opt_ret ::= WHERE expr
- uint16(265), // (153) where_opt_ret ::= RETURNING selcollist
- uint16(265), // (154) where_opt_ret ::= WHERE expr RETURNING selcollist
- uint16(189), // (155) cmd ::= with UPDATE orconf xfullname indexed_opt SET setlist from where_opt_ret
- uint16(266), // (156) setlist ::= setlist COMMA nm EQ expr
- uint16(266), // (157) setlist ::= setlist COMMA LP idlist RP EQ expr
- uint16(266), // (158) setlist ::= nm EQ expr
- uint16(266), // (159) setlist ::= LP idlist RP EQ expr
- uint16(189), // (160) cmd ::= with insert_cmd INTO xfullname idlist_opt select upsert
- uint16(189), // (161) cmd ::= with insert_cmd INTO xfullname idlist_opt DEFAULT VALUES returning
- uint16(269), // (162) upsert ::=
- uint16(269), // (163) upsert ::= RETURNING selcollist
- uint16(269), // (164) upsert ::= ON CONFLICT LP sortlist RP where_opt DO UPDATE SET setlist where_opt upsert
- uint16(269), // (165) upsert ::= ON CONFLICT LP sortlist RP where_opt DO NOTHING upsert
- uint16(269), // (166) upsert ::= ON CONFLICT DO NOTHING returning
- uint16(269), // (167) upsert ::= ON CONFLICT DO UPDATE SET setlist where_opt returning
- uint16(270), // (168) returning ::= RETURNING selcollist
- uint16(267), // (169) insert_cmd ::= INSERT orconf
- uint16(267), // (170) insert_cmd ::= REPLACE
- uint16(268), // (171) idlist_opt ::=
- uint16(268), // (172) idlist_opt ::= LP idlist RP
- uint16(262), // (173) idlist ::= idlist COMMA nm
- uint16(262), // (174) idlist ::= nm
- uint16(215), // (175) expr ::= LP expr RP
- uint16(215), // (176) expr ::= ID|INDEXED
- uint16(215), // (177) expr ::= JOIN_KW
- uint16(215), // (178) expr ::= nm DOT nm
- uint16(215), // (179) expr ::= nm DOT nm DOT nm
- uint16(214), // (180) term ::= NULL|FLOAT|BLOB
- uint16(214), // (181) term ::= STRING
- uint16(214), // (182) term ::= INTEGER
- uint16(215), // (183) expr ::= VARIABLE
- uint16(215), // (184) expr ::= expr COLLATE ID|STRING
- uint16(215), // (185) expr ::= CAST LP expr AS typetoken RP
- uint16(215), // (186) expr ::= ID|INDEXED LP distinct exprlist RP
- uint16(215), // (187) expr ::= ID|INDEXED LP STAR RP
- uint16(215), // (188) expr ::= ID|INDEXED LP distinct exprlist RP filter_over
- uint16(215), // (189) expr ::= ID|INDEXED LP STAR RP filter_over
- uint16(214), // (190) term ::= CTIME_KW
- uint16(215), // (191) expr ::= LP nexprlist COMMA expr RP
- uint16(215), // (192) expr ::= expr AND expr
- uint16(215), // (193) expr ::= expr OR expr
- uint16(215), // (194) expr ::= expr LT|GT|GE|LE expr
- uint16(215), // (195) expr ::= expr EQ|NE expr
- uint16(215), // (196) expr ::= expr BITAND|BITOR|LSHIFT|RSHIFT expr
- uint16(215), // (197) expr ::= expr PLUS|MINUS expr
- uint16(215), // (198) expr ::= expr STAR|SLASH|REM expr
- uint16(215), // (199) expr ::= expr CONCAT expr
- uint16(272), // (200) likeop ::= NOT LIKE_KW|MATCH
- uint16(215), // (201) expr ::= expr likeop expr
- uint16(215), // (202) expr ::= expr likeop expr ESCAPE expr
- uint16(215), // (203) expr ::= expr ISNULL|NOTNULL
- uint16(215), // (204) expr ::= expr NOT NULL
- uint16(215), // (205) expr ::= expr IS expr
- uint16(215), // (206) expr ::= expr IS NOT expr
- uint16(215), // (207) expr ::= NOT expr
- uint16(215), // (208) expr ::= BITNOT expr
- uint16(215), // (209) expr ::= PLUS|MINUS expr
- uint16(273), // (210) between_op ::= BETWEEN
- uint16(273), // (211) between_op ::= NOT BETWEEN
- uint16(215), // (212) expr ::= expr between_op expr AND expr
- uint16(274), // (213) in_op ::= IN
- uint16(274), // (214) in_op ::= NOT IN
- uint16(215), // (215) expr ::= expr in_op LP exprlist RP
- uint16(215), // (216) expr ::= LP select RP
- uint16(215), // (217) expr ::= expr in_op LP select RP
- uint16(215), // (218) expr ::= expr in_op nm dbnm paren_exprlist
- uint16(215), // (219) expr ::= EXISTS LP select RP
- uint16(215), // (220) expr ::= CASE case_operand case_exprlist case_else END
- uint16(277), // (221) case_exprlist ::= case_exprlist WHEN expr THEN expr
- uint16(277), // (222) case_exprlist ::= WHEN expr THEN expr
- uint16(278), // (223) case_else ::= ELSE expr
- uint16(278), // (224) case_else ::=
- uint16(276), // (225) case_operand ::= expr
- uint16(276), // (226) case_operand ::=
- uint16(260), // (227) exprlist ::=
- uint16(251), // (228) nexprlist ::= nexprlist COMMA expr
- uint16(251), // (229) nexprlist ::= expr
- uint16(275), // (230) paren_exprlist ::=
- uint16(275), // (231) paren_exprlist ::= LP exprlist RP
- uint16(189), // (232) cmd ::= createkw uniqueflag INDEX ifnotexists nm dbnm ON nm LP sortlist RP where_opt
- uint16(279), // (233) uniqueflag ::= UNIQUE
- uint16(279), // (234) uniqueflag ::=
- uint16(219), // (235) eidlist_opt ::=
- uint16(219), // (236) eidlist_opt ::= LP eidlist RP
- uint16(230), // (237) eidlist ::= eidlist COMMA nm collate sortorder
- uint16(230), // (238) eidlist ::= nm collate sortorder
- uint16(280), // (239) collate ::=
- uint16(280), // (240) collate ::= COLLATE ID|STRING
- uint16(189), // (241) cmd ::= DROP INDEX ifexists fullname
- uint16(189), // (242) cmd ::= VACUUM vinto
- uint16(189), // (243) cmd ::= VACUUM nm vinto
- uint16(281), // (244) vinto ::= INTO expr
- uint16(281), // (245) vinto ::=
- uint16(189), // (246) cmd ::= PRAGMA nm dbnm
- uint16(189), // (247) cmd ::= PRAGMA nm dbnm EQ nmnum
- uint16(189), // (248) cmd ::= PRAGMA nm dbnm LP nmnum RP
- uint16(189), // (249) cmd ::= PRAGMA nm dbnm EQ minus_num
- uint16(189), // (250) cmd ::= PRAGMA nm dbnm LP minus_num RP
- uint16(209), // (251) plus_num ::= PLUS INTEGER|FLOAT
- uint16(210), // (252) minus_num ::= MINUS INTEGER|FLOAT
- uint16(189), // (253) cmd ::= createkw trigger_decl BEGIN trigger_cmd_list END
- uint16(283), // (254) trigger_decl ::= temp TRIGGER ifnotexists nm dbnm trigger_time trigger_event ON fullname foreach_clause when_clause
- uint16(285), // (255) trigger_time ::= BEFORE|AFTER
- uint16(285), // (256) trigger_time ::= INSTEAD OF
- uint16(285), // (257) trigger_time ::=
- uint16(286), // (258) trigger_event ::= DELETE|INSERT
- uint16(286), // (259) trigger_event ::= UPDATE
- uint16(286), // (260) trigger_event ::= UPDATE OF idlist
- uint16(288), // (261) when_clause ::=
- uint16(288), // (262) when_clause ::= WHEN expr
- uint16(284), // (263) trigger_cmd_list ::= trigger_cmd_list trigger_cmd SEMI
- uint16(284), // (264) trigger_cmd_list ::= trigger_cmd SEMI
- uint16(290), // (265) trnm ::= nm DOT nm
- uint16(291), // (266) tridxby ::= INDEXED BY nm
- uint16(291), // (267) tridxby ::= NOT INDEXED
- uint16(289), // (268) trigger_cmd ::= UPDATE orconf trnm tridxby SET setlist from where_opt scanpt
- uint16(289), // (269) trigger_cmd ::= scanpt insert_cmd INTO trnm idlist_opt select upsert scanpt
- uint16(289), // (270) trigger_cmd ::= DELETE FROM trnm tridxby where_opt scanpt
- uint16(289), // (271) trigger_cmd ::= scanpt select scanpt
- uint16(215), // (272) expr ::= RAISE LP IGNORE RP
- uint16(215), // (273) expr ::= RAISE LP raisetype COMMA nm RP
- uint16(234), // (274) raisetype ::= ROLLBACK
- uint16(234), // (275) raisetype ::= ABORT
- uint16(234), // (276) raisetype ::= FAIL
- uint16(189), // (277) cmd ::= DROP TRIGGER ifexists fullname
- uint16(189), // (278) cmd ::= ATTACH database_kw_opt expr AS expr key_opt
- uint16(189), // (279) cmd ::= DETACH database_kw_opt expr
- uint16(293), // (280) key_opt ::=
- uint16(293), // (281) key_opt ::= KEY expr
- uint16(189), // (282) cmd ::= REINDEX
- uint16(189), // (283) cmd ::= REINDEX nm dbnm
- uint16(189), // (284) cmd ::= ANALYZE
- uint16(189), // (285) cmd ::= ANALYZE nm dbnm
- uint16(189), // (286) cmd ::= ALTER TABLE fullname RENAME TO nm
- uint16(189), // (287) cmd ::= ALTER TABLE add_column_fullname ADD kwcolumn_opt columnname carglist
- uint16(189), // (288) cmd ::= ALTER TABLE fullname DROP kwcolumn_opt nm
- uint16(294), // (289) add_column_fullname ::= fullname
- uint16(189), // (290) cmd ::= ALTER TABLE fullname RENAME kwcolumn_opt nm TO nm
- uint16(189), // (291) cmd ::= create_vtab
- uint16(189), // (292) cmd ::= create_vtab LP vtabarglist RP
- uint16(296), // (293) create_vtab ::= createkw VIRTUAL TABLE ifnotexists nm dbnm USING nm
- uint16(298), // (294) vtabarg ::=
- uint16(299), // (295) vtabargtoken ::= ANY
- uint16(299), // (296) vtabargtoken ::= lp anylist RP
- uint16(300), // (297) lp ::= LP
- uint16(264), // (298) with ::= WITH wqlist
- uint16(264), // (299) with ::= WITH RECURSIVE wqlist
- uint16(303), // (300) wqas ::= AS
- uint16(303), // (301) wqas ::= AS MATERIALIZED
- uint16(303), // (302) wqas ::= AS NOT MATERIALIZED
- uint16(302), // (303) wqitem ::= nm eidlist_opt wqas LP select RP
- uint16(239), // (304) wqlist ::= wqitem
- uint16(239), // (305) wqlist ::= wqlist COMMA wqitem
- uint16(304), // (306) windowdefn_list ::= windowdefn
- uint16(304), // (307) windowdefn_list ::= windowdefn_list COMMA windowdefn
- uint16(305), // (308) windowdefn ::= nm AS LP window RP
- uint16(306), // (309) window ::= PARTITION BY nexprlist orderby_opt frame_opt
- uint16(306), // (310) window ::= nm PARTITION BY nexprlist orderby_opt frame_opt
- uint16(306), // (311) window ::= ORDER BY sortlist frame_opt
- uint16(306), // (312) window ::= nm ORDER BY sortlist frame_opt
- uint16(306), // (313) window ::= frame_opt
- uint16(306), // (314) window ::= nm frame_opt
- uint16(307), // (315) frame_opt ::=
- uint16(307), // (316) frame_opt ::= range_or_rows frame_bound_s frame_exclude_opt
- uint16(307), // (317) frame_opt ::= range_or_rows BETWEEN frame_bound_s AND frame_bound_e frame_exclude_opt
- uint16(311), // (318) range_or_rows ::= RANGE|ROWS|GROUPS
- uint16(313), // (319) frame_bound_s ::= frame_bound
- uint16(313), // (320) frame_bound_s ::= UNBOUNDED PRECEDING
- uint16(314), // (321) frame_bound_e ::= frame_bound
- uint16(314), // (322) frame_bound_e ::= UNBOUNDED FOLLOWING
- uint16(312), // (323) frame_bound ::= expr PRECEDING|FOLLOWING
- uint16(312), // (324) frame_bound ::= CURRENT ROW
- uint16(315), // (325) frame_exclude_opt ::=
- uint16(315), // (326) frame_exclude_opt ::= EXCLUDE frame_exclude
- uint16(316), // (327) frame_exclude ::= NO OTHERS
- uint16(316), // (328) frame_exclude ::= CURRENT ROW
- uint16(316), // (329) frame_exclude ::= GROUP|TIES
- uint16(249), // (330) window_clause ::= WINDOW windowdefn_list
- uint16(271), // (331) filter_over ::= filter_clause over_clause
- uint16(271), // (332) filter_over ::= over_clause
- uint16(271), // (333) filter_over ::= filter_clause
- uint16(310), // (334) over_clause ::= OVER LP window RP
- uint16(310), // (335) over_clause ::= OVER nm
- uint16(309), // (336) filter_clause ::= FILTER LP WHERE expr RP
- uint16(184), // (337) input ::= cmdlist
- uint16(185), // (338) cmdlist ::= cmdlist ecmd
- uint16(185), // (339) cmdlist ::= ecmd
- uint16(186), // (340) ecmd ::= SEMI
- uint16(186), // (341) ecmd ::= cmdx SEMI
- uint16(186), // (342) ecmd ::= explain cmdx SEMI
- uint16(191), // (343) trans_opt ::=
- uint16(191), // (344) trans_opt ::= TRANSACTION
- uint16(191), // (345) trans_opt ::= TRANSACTION nm
- uint16(193), // (346) savepoint_opt ::= SAVEPOINT
- uint16(193), // (347) savepoint_opt ::=
- uint16(189), // (348) cmd ::= create_table create_table_args
- uint16(200), // (349) columnlist ::= columnlist COMMA columnname carglist
- uint16(200), // (350) columnlist ::= columnname carglist
- uint16(192), // (351) nm ::= ID|INDEXED
- uint16(192), // (352) nm ::= STRING
- uint16(192), // (353) nm ::= JOIN_KW
- uint16(206), // (354) typetoken ::= typename
- uint16(207), // (355) typename ::= ID|STRING
- uint16(208), // (356) signed ::= plus_num
- uint16(208), // (357) signed ::= minus_num
- uint16(205), // (358) carglist ::= carglist ccons
- uint16(205), // (359) carglist ::=
- uint16(213), // (360) ccons ::= NULL onconf
- uint16(213), // (361) ccons ::= GENERATED ALWAYS AS generated
- uint16(213), // (362) ccons ::= AS generated
- uint16(201), // (363) conslist_opt ::= COMMA conslist
- uint16(226), // (364) conslist ::= conslist tconscomma tcons
- uint16(226), // (365) conslist ::= tcons
- uint16(227), // (366) tconscomma ::=
- uint16(231), // (367) defer_subclause_opt ::= defer_subclause
- uint16(233), // (368) resolvetype ::= raisetype
- uint16(237), // (369) selectnowith ::= oneselect
- uint16(238), // (370) oneselect ::= values
- uint16(252), // (371) sclp ::= selcollist COMMA
- uint16(253), // (372) as ::= ID|STRING
- uint16(270), // (373) returning ::=
- uint16(215), // (374) expr ::= term
- uint16(272), // (375) likeop ::= LIKE_KW|MATCH
- uint16(260), // (376) exprlist ::= nexprlist
- uint16(282), // (377) nmnum ::= plus_num
- uint16(282), // (378) nmnum ::= nm
- uint16(282), // (379) nmnum ::= ON
- uint16(282), // (380) nmnum ::= DELETE
- uint16(282), // (381) nmnum ::= DEFAULT
- uint16(209), // (382) plus_num ::= INTEGER|FLOAT
- uint16(287), // (383) foreach_clause ::=
- uint16(287), // (384) foreach_clause ::= FOR EACH ROW
- uint16(290), // (385) trnm ::= nm
- uint16(291), // (386) tridxby ::=
- uint16(292), // (387) database_kw_opt ::= DATABASE
- uint16(292), // (388) database_kw_opt ::=
- uint16(295), // (389) kwcolumn_opt ::=
- uint16(295), // (390) kwcolumn_opt ::= COLUMNKW
- uint16(297), // (391) vtabarglist ::= vtabarg
- uint16(297), // (392) vtabarglist ::= vtabarglist COMMA vtabarg
- uint16(298), // (393) vtabarg ::= vtabarg vtabargtoken
- uint16(301), // (394) anylist ::=
- uint16(301), // (395) anylist ::= anylist LP anylist RP
- uint16(301), // (396) anylist ::= anylist ANY
- uint16(264), // (397) with ::=
-} /* sqlite3.c:160702:25 */
+ uint16(202), // (21) table_option_set ::=
+ uint16(202), // (22) table_option_set ::= table_option_set COMMA table_option
+ uint16(204), // (23) table_option ::= WITHOUT nm
+ uint16(204), // (24) table_option ::= nm
+ uint16(205), // (25) columnname ::= nm typetoken
+ uint16(207), // (26) typetoken ::=
+ uint16(207), // (27) typetoken ::= typename LP signed RP
+ uint16(207), // (28) typetoken ::= typename LP signed COMMA signed RP
+ uint16(208), // (29) typename ::= typename ID|STRING
+ uint16(212), // (30) scanpt ::=
+ uint16(213), // (31) scantok ::=
+ uint16(214), // (32) ccons ::= CONSTRAINT nm
+ uint16(214), // (33) ccons ::= DEFAULT scantok term
+ uint16(214), // (34) ccons ::= DEFAULT LP expr RP
+ uint16(214), // (35) ccons ::= DEFAULT PLUS scantok term
+ uint16(214), // (36) ccons ::= DEFAULT MINUS scantok term
+ uint16(214), // (37) ccons ::= DEFAULT scantok ID|INDEXED
+ uint16(214), // (38) ccons ::= NOT NULL onconf
+ uint16(214), // (39) ccons ::= PRIMARY KEY sortorder onconf autoinc
+ uint16(214), // (40) ccons ::= UNIQUE onconf
+ uint16(214), // (41) ccons ::= CHECK LP expr RP
+ uint16(214), // (42) ccons ::= REFERENCES nm eidlist_opt refargs
+ uint16(214), // (43) ccons ::= defer_subclause
+ uint16(214), // (44) ccons ::= COLLATE ID|STRING
+ uint16(223), // (45) generated ::= LP expr RP
+ uint16(223), // (46) generated ::= LP expr RP ID
+ uint16(219), // (47) autoinc ::=
+ uint16(219), // (48) autoinc ::= AUTOINCR
+ uint16(221), // (49) refargs ::=
+ uint16(221), // (50) refargs ::= refargs refarg
+ uint16(224), // (51) refarg ::= MATCH nm
+ uint16(224), // (52) refarg ::= ON INSERT refact
+ uint16(224), // (53) refarg ::= ON DELETE refact
+ uint16(224), // (54) refarg ::= ON UPDATE refact
+ uint16(225), // (55) refact ::= SET NULL
+ uint16(225), // (56) refact ::= SET DEFAULT
+ uint16(225), // (57) refact ::= CASCADE
+ uint16(225), // (58) refact ::= RESTRICT
+ uint16(225), // (59) refact ::= NO ACTION
+ uint16(222), // (60) defer_subclause ::= NOT DEFERRABLE init_deferred_pred_opt
+ uint16(222), // (61) defer_subclause ::= DEFERRABLE init_deferred_pred_opt
+ uint16(226), // (62) init_deferred_pred_opt ::=
+ uint16(226), // (63) init_deferred_pred_opt ::= INITIALLY DEFERRED
+ uint16(226), // (64) init_deferred_pred_opt ::= INITIALLY IMMEDIATE
+ uint16(201), // (65) conslist_opt ::=
+ uint16(228), // (66) tconscomma ::= COMMA
+ uint16(229), // (67) tcons ::= CONSTRAINT nm
+ uint16(229), // (68) tcons ::= PRIMARY KEY LP sortlist autoinc RP onconf
+ uint16(229), // (69) tcons ::= UNIQUE LP sortlist RP onconf
+ uint16(229), // (70) tcons ::= CHECK LP expr RP onconf
+ uint16(229), // (71) tcons ::= FOREIGN KEY LP eidlist RP REFERENCES nm eidlist_opt refargs defer_subclause_opt
+ uint16(232), // (72) defer_subclause_opt ::=
+ uint16(217), // (73) onconf ::=
+ uint16(217), // (74) onconf ::= ON CONFLICT resolvetype
+ uint16(233), // (75) orconf ::=
+ uint16(233), // (76) orconf ::= OR resolvetype
+ uint16(234), // (77) resolvetype ::= IGNORE
+ uint16(234), // (78) resolvetype ::= REPLACE
+ uint16(189), // (79) cmd ::= DROP TABLE ifexists fullname
+ uint16(236), // (80) ifexists ::= IF EXISTS
+ uint16(236), // (81) ifexists ::=
+ uint16(189), // (82) cmd ::= createkw temp VIEW ifnotexists nm dbnm eidlist_opt AS select
+ uint16(189), // (83) cmd ::= DROP VIEW ifexists fullname
+ uint16(189), // (84) cmd ::= select
+ uint16(203), // (85) select ::= WITH wqlist selectnowith
+ uint16(203), // (86) select ::= WITH RECURSIVE wqlist selectnowith
+ uint16(203), // (87) select ::= selectnowith
+ uint16(238), // (88) selectnowith ::= selectnowith multiselect_op oneselect
+ uint16(241), // (89) multiselect_op ::= UNION
+ uint16(241), // (90) multiselect_op ::= UNION ALL
+ uint16(241), // (91) multiselect_op ::= EXCEPT|INTERSECT
+ uint16(239), // (92) oneselect ::= SELECT distinct selcollist from where_opt groupby_opt having_opt orderby_opt limit_opt
+ uint16(239), // (93) oneselect ::= SELECT distinct selcollist from where_opt groupby_opt having_opt window_clause orderby_opt limit_opt
+ uint16(251), // (94) values ::= VALUES LP nexprlist RP
+ uint16(251), // (95) values ::= values COMMA LP nexprlist RP
+ uint16(242), // (96) distinct ::= DISTINCT
+ uint16(242), // (97) distinct ::= ALL
+ uint16(242), // (98) distinct ::=
+ uint16(253), // (99) sclp ::=
+ uint16(243), // (100) selcollist ::= sclp scanpt expr scanpt as
+ uint16(243), // (101) selcollist ::= sclp scanpt STAR
+ uint16(243), // (102) selcollist ::= sclp scanpt nm DOT STAR
+ uint16(254), // (103) as ::= AS nm
+ uint16(254), // (104) as ::=
+ uint16(244), // (105) from ::=
+ uint16(244), // (106) from ::= FROM seltablist
+ uint16(256), // (107) stl_prefix ::= seltablist joinop
+ uint16(256), // (108) stl_prefix ::=
+ uint16(255), // (109) seltablist ::= stl_prefix nm dbnm as indexed_opt on_opt using_opt
+ uint16(255), // (110) seltablist ::= stl_prefix nm dbnm LP exprlist RP as on_opt using_opt
+ uint16(255), // (111) seltablist ::= stl_prefix LP select RP as on_opt using_opt
+ uint16(255), // (112) seltablist ::= stl_prefix LP seltablist RP as on_opt using_opt
+ uint16(199), // (113) dbnm ::=
+ uint16(199), // (114) dbnm ::= DOT nm
+ uint16(237), // (115) fullname ::= nm
+ uint16(237), // (116) fullname ::= nm DOT nm
+ uint16(262), // (117) xfullname ::= nm
+ uint16(262), // (118) xfullname ::= nm DOT nm
+ uint16(262), // (119) xfullname ::= nm DOT nm AS nm
+ uint16(262), // (120) xfullname ::= nm AS nm
+ uint16(257), // (121) joinop ::= COMMA|JOIN
+ uint16(257), // (122) joinop ::= JOIN_KW JOIN
+ uint16(257), // (123) joinop ::= JOIN_KW nm JOIN
+ uint16(257), // (124) joinop ::= JOIN_KW nm nm JOIN
+ uint16(259), // (125) on_opt ::= ON expr
+ uint16(259), // (126) on_opt ::=
+ uint16(258), // (127) indexed_opt ::=
+ uint16(258), // (128) indexed_opt ::= INDEXED BY nm
+ uint16(258), // (129) indexed_opt ::= NOT INDEXED
+ uint16(260), // (130) using_opt ::= USING LP idlist RP
+ uint16(260), // (131) using_opt ::=
+ uint16(248), // (132) orderby_opt ::=
+ uint16(248), // (133) orderby_opt ::= ORDER BY sortlist
+ uint16(230), // (134) sortlist ::= sortlist COMMA expr sortorder nulls
+ uint16(230), // (135) sortlist ::= expr sortorder nulls
+ uint16(218), // (136) sortorder ::= ASC
+ uint16(218), // (137) sortorder ::= DESC
+ uint16(218), // (138) sortorder ::=
+ uint16(264), // (139) nulls ::= NULLS FIRST
+ uint16(264), // (140) nulls ::= NULLS LAST
+ uint16(264), // (141) nulls ::=
+ uint16(246), // (142) groupby_opt ::=
+ uint16(246), // (143) groupby_opt ::= GROUP BY nexprlist
+ uint16(247), // (144) having_opt ::=
+ uint16(247), // (145) having_opt ::= HAVING expr
+ uint16(249), // (146) limit_opt ::=
+ uint16(249), // (147) limit_opt ::= LIMIT expr
+ uint16(249), // (148) limit_opt ::= LIMIT expr OFFSET expr
+ uint16(249), // (149) limit_opt ::= LIMIT expr COMMA expr
+ uint16(189), // (150) cmd ::= with DELETE FROM xfullname indexed_opt where_opt_ret
+ uint16(245), // (151) where_opt ::=
+ uint16(245), // (152) where_opt ::= WHERE expr
+ uint16(266), // (153) where_opt_ret ::=
+ uint16(266), // (154) where_opt_ret ::= WHERE expr
+ uint16(266), // (155) where_opt_ret ::= RETURNING selcollist
+ uint16(266), // (156) where_opt_ret ::= WHERE expr RETURNING selcollist
+ uint16(189), // (157) cmd ::= with UPDATE orconf xfullname indexed_opt SET setlist from where_opt_ret
+ uint16(267), // (158) setlist ::= setlist COMMA nm EQ expr
+ uint16(267), // (159) setlist ::= setlist COMMA LP idlist RP EQ expr
+ uint16(267), // (160) setlist ::= nm EQ expr
+ uint16(267), // (161) setlist ::= LP idlist RP EQ expr
+ uint16(189), // (162) cmd ::= with insert_cmd INTO xfullname idlist_opt select upsert
+ uint16(189), // (163) cmd ::= with insert_cmd INTO xfullname idlist_opt DEFAULT VALUES returning
+ uint16(270), // (164) upsert ::=
+ uint16(270), // (165) upsert ::= RETURNING selcollist
+ uint16(270), // (166) upsert ::= ON CONFLICT LP sortlist RP where_opt DO UPDATE SET setlist where_opt upsert
+ uint16(270), // (167) upsert ::= ON CONFLICT LP sortlist RP where_opt DO NOTHING upsert
+ uint16(270), // (168) upsert ::= ON CONFLICT DO NOTHING returning
+ uint16(270), // (169) upsert ::= ON CONFLICT DO UPDATE SET setlist where_opt returning
+ uint16(271), // (170) returning ::= RETURNING selcollist
+ uint16(268), // (171) insert_cmd ::= INSERT orconf
+ uint16(268), // (172) insert_cmd ::= REPLACE
+ uint16(269), // (173) idlist_opt ::=
+ uint16(269), // (174) idlist_opt ::= LP idlist RP
+ uint16(263), // (175) idlist ::= idlist COMMA nm
+ uint16(263), // (176) idlist ::= nm
+ uint16(216), // (177) expr ::= LP expr RP
+ uint16(216), // (178) expr ::= ID|INDEXED
+ uint16(216), // (179) expr ::= JOIN_KW
+ uint16(216), // (180) expr ::= nm DOT nm
+ uint16(216), // (181) expr ::= nm DOT nm DOT nm
+ uint16(215), // (182) term ::= NULL|FLOAT|BLOB
+ uint16(215), // (183) term ::= STRING
+ uint16(215), // (184) term ::= INTEGER
+ uint16(216), // (185) expr ::= VARIABLE
+ uint16(216), // (186) expr ::= expr COLLATE ID|STRING
+ uint16(216), // (187) expr ::= CAST LP expr AS typetoken RP
+ uint16(216), // (188) expr ::= ID|INDEXED LP distinct exprlist RP
+ uint16(216), // (189) expr ::= ID|INDEXED LP STAR RP
+ uint16(216), // (190) expr ::= ID|INDEXED LP distinct exprlist RP filter_over
+ uint16(216), // (191) expr ::= ID|INDEXED LP STAR RP filter_over
+ uint16(215), // (192) term ::= CTIME_KW
+ uint16(216), // (193) expr ::= LP nexprlist COMMA expr RP
+ uint16(216), // (194) expr ::= expr AND expr
+ uint16(216), // (195) expr ::= expr OR expr
+ uint16(216), // (196) expr ::= expr LT|GT|GE|LE expr
+ uint16(216), // (197) expr ::= expr EQ|NE expr
+ uint16(216), // (198) expr ::= expr BITAND|BITOR|LSHIFT|RSHIFT expr
+ uint16(216), // (199) expr ::= expr PLUS|MINUS expr
+ uint16(216), // (200) expr ::= expr STAR|SLASH|REM expr
+ uint16(216), // (201) expr ::= expr CONCAT expr
+ uint16(273), // (202) likeop ::= NOT LIKE_KW|MATCH
+ uint16(216), // (203) expr ::= expr likeop expr
+ uint16(216), // (204) expr ::= expr likeop expr ESCAPE expr
+ uint16(216), // (205) expr ::= expr ISNULL|NOTNULL
+ uint16(216), // (206) expr ::= expr NOT NULL
+ uint16(216), // (207) expr ::= expr IS expr
+ uint16(216), // (208) expr ::= expr IS NOT expr
+ uint16(216), // (209) expr ::= NOT expr
+ uint16(216), // (210) expr ::= BITNOT expr
+ uint16(216), // (211) expr ::= PLUS|MINUS expr
+ uint16(274), // (212) between_op ::= BETWEEN
+ uint16(274), // (213) between_op ::= NOT BETWEEN
+ uint16(216), // (214) expr ::= expr between_op expr AND expr
+ uint16(275), // (215) in_op ::= IN
+ uint16(275), // (216) in_op ::= NOT IN
+ uint16(216), // (217) expr ::= expr in_op LP exprlist RP
+ uint16(216), // (218) expr ::= LP select RP
+ uint16(216), // (219) expr ::= expr in_op LP select RP
+ uint16(216), // (220) expr ::= expr in_op nm dbnm paren_exprlist
+ uint16(216), // (221) expr ::= EXISTS LP select RP
+ uint16(216), // (222) expr ::= CASE case_operand case_exprlist case_else END
+ uint16(278), // (223) case_exprlist ::= case_exprlist WHEN expr THEN expr
+ uint16(278), // (224) case_exprlist ::= WHEN expr THEN expr
+ uint16(279), // (225) case_else ::= ELSE expr
+ uint16(279), // (226) case_else ::=
+ uint16(277), // (227) case_operand ::= expr
+ uint16(277), // (228) case_operand ::=
+ uint16(261), // (229) exprlist ::=
+ uint16(252), // (230) nexprlist ::= nexprlist COMMA expr
+ uint16(252), // (231) nexprlist ::= expr
+ uint16(276), // (232) paren_exprlist ::=
+ uint16(276), // (233) paren_exprlist ::= LP exprlist RP
+ uint16(189), // (234) cmd ::= createkw uniqueflag INDEX ifnotexists nm dbnm ON nm LP sortlist RP where_opt
+ uint16(280), // (235) uniqueflag ::= UNIQUE
+ uint16(280), // (236) uniqueflag ::=
+ uint16(220), // (237) eidlist_opt ::=
+ uint16(220), // (238) eidlist_opt ::= LP eidlist RP
+ uint16(231), // (239) eidlist ::= eidlist COMMA nm collate sortorder
+ uint16(231), // (240) eidlist ::= nm collate sortorder
+ uint16(281), // (241) collate ::=
+ uint16(281), // (242) collate ::= COLLATE ID|STRING
+ uint16(189), // (243) cmd ::= DROP INDEX ifexists fullname
+ uint16(189), // (244) cmd ::= VACUUM vinto
+ uint16(189), // (245) cmd ::= VACUUM nm vinto
+ uint16(282), // (246) vinto ::= INTO expr
+ uint16(282), // (247) vinto ::=
+ uint16(189), // (248) cmd ::= PRAGMA nm dbnm
+ uint16(189), // (249) cmd ::= PRAGMA nm dbnm EQ nmnum
+ uint16(189), // (250) cmd ::= PRAGMA nm dbnm LP nmnum RP
+ uint16(189), // (251) cmd ::= PRAGMA nm dbnm EQ minus_num
+ uint16(189), // (252) cmd ::= PRAGMA nm dbnm LP minus_num RP
+ uint16(210), // (253) plus_num ::= PLUS INTEGER|FLOAT
+ uint16(211), // (254) minus_num ::= MINUS INTEGER|FLOAT
+ uint16(189), // (255) cmd ::= createkw trigger_decl BEGIN trigger_cmd_list END
+ uint16(284), // (256) trigger_decl ::= temp TRIGGER ifnotexists nm dbnm trigger_time trigger_event ON fullname foreach_clause when_clause
+ uint16(286), // (257) trigger_time ::= BEFORE|AFTER
+ uint16(286), // (258) trigger_time ::= INSTEAD OF
+ uint16(286), // (259) trigger_time ::=
+ uint16(287), // (260) trigger_event ::= DELETE|INSERT
+ uint16(287), // (261) trigger_event ::= UPDATE
+ uint16(287), // (262) trigger_event ::= UPDATE OF idlist
+ uint16(289), // (263) when_clause ::=
+ uint16(289), // (264) when_clause ::= WHEN expr
+ uint16(285), // (265) trigger_cmd_list ::= trigger_cmd_list trigger_cmd SEMI
+ uint16(285), // (266) trigger_cmd_list ::= trigger_cmd SEMI
+ uint16(291), // (267) trnm ::= nm DOT nm
+ uint16(292), // (268) tridxby ::= INDEXED BY nm
+ uint16(292), // (269) tridxby ::= NOT INDEXED
+ uint16(290), // (270) trigger_cmd ::= UPDATE orconf trnm tridxby SET setlist from where_opt scanpt
+ uint16(290), // (271) trigger_cmd ::= scanpt insert_cmd INTO trnm idlist_opt select upsert scanpt
+ uint16(290), // (272) trigger_cmd ::= DELETE FROM trnm tridxby where_opt scanpt
+ uint16(290), // (273) trigger_cmd ::= scanpt select scanpt
+ uint16(216), // (274) expr ::= RAISE LP IGNORE RP
+ uint16(216), // (275) expr ::= RAISE LP raisetype COMMA nm RP
+ uint16(235), // (276) raisetype ::= ROLLBACK
+ uint16(235), // (277) raisetype ::= ABORT
+ uint16(235), // (278) raisetype ::= FAIL
+ uint16(189), // (279) cmd ::= DROP TRIGGER ifexists fullname
+ uint16(189), // (280) cmd ::= ATTACH database_kw_opt expr AS expr key_opt
+ uint16(189), // (281) cmd ::= DETACH database_kw_opt expr
+ uint16(294), // (282) key_opt ::=
+ uint16(294), // (283) key_opt ::= KEY expr
+ uint16(189), // (284) cmd ::= REINDEX
+ uint16(189), // (285) cmd ::= REINDEX nm dbnm
+ uint16(189), // (286) cmd ::= ANALYZE
+ uint16(189), // (287) cmd ::= ANALYZE nm dbnm
+ uint16(189), // (288) cmd ::= ALTER TABLE fullname RENAME TO nm
+ uint16(189), // (289) cmd ::= ALTER TABLE add_column_fullname ADD kwcolumn_opt columnname carglist
+ uint16(189), // (290) cmd ::= ALTER TABLE fullname DROP kwcolumn_opt nm
+ uint16(295), // (291) add_column_fullname ::= fullname
+ uint16(189), // (292) cmd ::= ALTER TABLE fullname RENAME kwcolumn_opt nm TO nm
+ uint16(189), // (293) cmd ::= create_vtab
+ uint16(189), // (294) cmd ::= create_vtab LP vtabarglist RP
+ uint16(297), // (295) create_vtab ::= createkw VIRTUAL TABLE ifnotexists nm dbnm USING nm
+ uint16(299), // (296) vtabarg ::=
+ uint16(300), // (297) vtabargtoken ::= ANY
+ uint16(300), // (298) vtabargtoken ::= lp anylist RP
+ uint16(301), // (299) lp ::= LP
+ uint16(265), // (300) with ::= WITH wqlist
+ uint16(265), // (301) with ::= WITH RECURSIVE wqlist
+ uint16(304), // (302) wqas ::= AS
+ uint16(304), // (303) wqas ::= AS MATERIALIZED
+ uint16(304), // (304) wqas ::= AS NOT MATERIALIZED
+ uint16(303), // (305) wqitem ::= nm eidlist_opt wqas LP select RP
+ uint16(240), // (306) wqlist ::= wqitem
+ uint16(240), // (307) wqlist ::= wqlist COMMA wqitem
+ uint16(305), // (308) windowdefn_list ::= windowdefn
+ uint16(305), // (309) windowdefn_list ::= windowdefn_list COMMA windowdefn
+ uint16(306), // (310) windowdefn ::= nm AS LP window RP
+ uint16(307), // (311) window ::= PARTITION BY nexprlist orderby_opt frame_opt
+ uint16(307), // (312) window ::= nm PARTITION BY nexprlist orderby_opt frame_opt
+ uint16(307), // (313) window ::= ORDER BY sortlist frame_opt
+ uint16(307), // (314) window ::= nm ORDER BY sortlist frame_opt
+ uint16(307), // (315) window ::= frame_opt
+ uint16(307), // (316) window ::= nm frame_opt
+ uint16(308), // (317) frame_opt ::=
+ uint16(308), // (318) frame_opt ::= range_or_rows frame_bound_s frame_exclude_opt
+ uint16(308), // (319) frame_opt ::= range_or_rows BETWEEN frame_bound_s AND frame_bound_e frame_exclude_opt
+ uint16(312), // (320) range_or_rows ::= RANGE|ROWS|GROUPS
+ uint16(314), // (321) frame_bound_s ::= frame_bound
+ uint16(314), // (322) frame_bound_s ::= UNBOUNDED PRECEDING
+ uint16(315), // (323) frame_bound_e ::= frame_bound
+ uint16(315), // (324) frame_bound_e ::= UNBOUNDED FOLLOWING
+ uint16(313), // (325) frame_bound ::= expr PRECEDING|FOLLOWING
+ uint16(313), // (326) frame_bound ::= CURRENT ROW
+ uint16(316), // (327) frame_exclude_opt ::=
+ uint16(316), // (328) frame_exclude_opt ::= EXCLUDE frame_exclude
+ uint16(317), // (329) frame_exclude ::= NO OTHERS
+ uint16(317), // (330) frame_exclude ::= CURRENT ROW
+ uint16(317), // (331) frame_exclude ::= GROUP|TIES
+ uint16(250), // (332) window_clause ::= WINDOW windowdefn_list
+ uint16(272), // (333) filter_over ::= filter_clause over_clause
+ uint16(272), // (334) filter_over ::= over_clause
+ uint16(272), // (335) filter_over ::= filter_clause
+ uint16(311), // (336) over_clause ::= OVER LP window RP
+ uint16(311), // (337) over_clause ::= OVER nm
+ uint16(310), // (338) filter_clause ::= FILTER LP WHERE expr RP
+ uint16(184), // (339) input ::= cmdlist
+ uint16(185), // (340) cmdlist ::= cmdlist ecmd
+ uint16(185), // (341) cmdlist ::= ecmd
+ uint16(186), // (342) ecmd ::= SEMI
+ uint16(186), // (343) ecmd ::= cmdx SEMI
+ uint16(186), // (344) ecmd ::= explain cmdx SEMI
+ uint16(191), // (345) trans_opt ::=
+ uint16(191), // (346) trans_opt ::= TRANSACTION
+ uint16(191), // (347) trans_opt ::= TRANSACTION nm
+ uint16(193), // (348) savepoint_opt ::= SAVEPOINT
+ uint16(193), // (349) savepoint_opt ::=
+ uint16(189), // (350) cmd ::= create_table create_table_args
+ uint16(202), // (351) table_option_set ::= table_option
+ uint16(200), // (352) columnlist ::= columnlist COMMA columnname carglist
+ uint16(200), // (353) columnlist ::= columnname carglist
+ uint16(192), // (354) nm ::= ID|INDEXED
+ uint16(192), // (355) nm ::= STRING
+ uint16(192), // (356) nm ::= JOIN_KW
+ uint16(207), // (357) typetoken ::= typename
+ uint16(208), // (358) typename ::= ID|STRING
+ uint16(209), // (359) signed ::= plus_num
+ uint16(209), // (360) signed ::= minus_num
+ uint16(206), // (361) carglist ::= carglist ccons
+ uint16(206), // (362) carglist ::=
+ uint16(214), // (363) ccons ::= NULL onconf
+ uint16(214), // (364) ccons ::= GENERATED ALWAYS AS generated
+ uint16(214), // (365) ccons ::= AS generated
+ uint16(201), // (366) conslist_opt ::= COMMA conslist
+ uint16(227), // (367) conslist ::= conslist tconscomma tcons
+ uint16(227), // (368) conslist ::= tcons
+ uint16(228), // (369) tconscomma ::=
+ uint16(232), // (370) defer_subclause_opt ::= defer_subclause
+ uint16(234), // (371) resolvetype ::= raisetype
+ uint16(238), // (372) selectnowith ::= oneselect
+ uint16(239), // (373) oneselect ::= values
+ uint16(253), // (374) sclp ::= selcollist COMMA
+ uint16(254), // (375) as ::= ID|STRING
+ uint16(271), // (376) returning ::=
+ uint16(216), // (377) expr ::= term
+ uint16(273), // (378) likeop ::= LIKE_KW|MATCH
+ uint16(261), // (379) exprlist ::= nexprlist
+ uint16(283), // (380) nmnum ::= plus_num
+ uint16(283), // (381) nmnum ::= nm
+ uint16(283), // (382) nmnum ::= ON
+ uint16(283), // (383) nmnum ::= DELETE
+ uint16(283), // (384) nmnum ::= DEFAULT
+ uint16(210), // (385) plus_num ::= INTEGER|FLOAT
+ uint16(288), // (386) foreach_clause ::=
+ uint16(288), // (387) foreach_clause ::= FOR EACH ROW
+ uint16(291), // (388) trnm ::= nm
+ uint16(292), // (389) tridxby ::=
+ uint16(293), // (390) database_kw_opt ::= DATABASE
+ uint16(293), // (391) database_kw_opt ::=
+ uint16(296), // (392) kwcolumn_opt ::=
+ uint16(296), // (393) kwcolumn_opt ::= COLUMNKW
+ uint16(298), // (394) vtabarglist ::= vtabarg
+ uint16(298), // (395) vtabarglist ::= vtabarglist COMMA vtabarg
+ uint16(299), // (396) vtabarg ::= vtabarg vtabargtoken
+ uint16(302), // (397) anylist ::=
+ uint16(302), // (398) anylist ::= anylist LP anylist RP
+ uint16(302), // (399) anylist ::= anylist ANY
+ uint16(265), // (400) with ::=
+} /* sqlite3.c:162146:25 */
// For rule J, yyRuleInfoNRhs[J] contains the negative of the number
// of symbols on the right-hand side of that rule.
-var yyRuleInfoNRhs = [398]int8{
+var yyRuleInfoNRhs = [401]int8{
int8(-1), // (0) explain ::= EXPLAIN
int8(-3), // (1) explain ::= EXPLAIN QUERY PLAN
int8(-1), // (2) cmdx ::= cmd
@@ -141172,386 +143256,389 @@ var yyRuleInfoNRhs = [398]int8{
int8(-3), // (16) ifnotexists ::= IF NOT EXISTS
int8(-1), // (17) temp ::= TEMP
int8(0), // (18) temp ::=
- int8(-5), // (19) create_table_args ::= LP columnlist conslist_opt RP table_options
+ int8(-5), // (19) create_table_args ::= LP columnlist conslist_opt RP table_option_set
int8(-2), // (20) create_table_args ::= AS select
- int8(0), // (21) table_options ::=
- int8(-2), // (22) table_options ::= WITHOUT nm
- int8(-2), // (23) columnname ::= nm typetoken
- int8(0), // (24) typetoken ::=
- int8(-4), // (25) typetoken ::= typename LP signed RP
- int8(-6), // (26) typetoken ::= typename LP signed COMMA signed RP
- int8(-2), // (27) typename ::= typename ID|STRING
- int8(0), // (28) scanpt ::=
- int8(0), // (29) scantok ::=
- int8(-2), // (30) ccons ::= CONSTRAINT nm
- int8(-3), // (31) ccons ::= DEFAULT scantok term
- int8(-4), // (32) ccons ::= DEFAULT LP expr RP
- int8(-4), // (33) ccons ::= DEFAULT PLUS scantok term
- int8(-4), // (34) ccons ::= DEFAULT MINUS scantok term
- int8(-3), // (35) ccons ::= DEFAULT scantok ID|INDEXED
- int8(-3), // (36) ccons ::= NOT NULL onconf
- int8(-5), // (37) ccons ::= PRIMARY KEY sortorder onconf autoinc
- int8(-2), // (38) ccons ::= UNIQUE onconf
- int8(-4), // (39) ccons ::= CHECK LP expr RP
- int8(-4), // (40) ccons ::= REFERENCES nm eidlist_opt refargs
- int8(-1), // (41) ccons ::= defer_subclause
- int8(-2), // (42) ccons ::= COLLATE ID|STRING
- int8(-3), // (43) generated ::= LP expr RP
- int8(-4), // (44) generated ::= LP expr RP ID
- int8(0), // (45) autoinc ::=
- int8(-1), // (46) autoinc ::= AUTOINCR
- int8(0), // (47) refargs ::=
- int8(-2), // (48) refargs ::= refargs refarg
- int8(-2), // (49) refarg ::= MATCH nm
- int8(-3), // (50) refarg ::= ON INSERT refact
- int8(-3), // (51) refarg ::= ON DELETE refact
- int8(-3), // (52) refarg ::= ON UPDATE refact
- int8(-2), // (53) refact ::= SET NULL
- int8(-2), // (54) refact ::= SET DEFAULT
- int8(-1), // (55) refact ::= CASCADE
- int8(-1), // (56) refact ::= RESTRICT
- int8(-2), // (57) refact ::= NO ACTION
- int8(-3), // (58) defer_subclause ::= NOT DEFERRABLE init_deferred_pred_opt
- int8(-2), // (59) defer_subclause ::= DEFERRABLE init_deferred_pred_opt
- int8(0), // (60) init_deferred_pred_opt ::=
- int8(-2), // (61) init_deferred_pred_opt ::= INITIALLY DEFERRED
- int8(-2), // (62) init_deferred_pred_opt ::= INITIALLY IMMEDIATE
- int8(0), // (63) conslist_opt ::=
- int8(-1), // (64) tconscomma ::= COMMA
- int8(-2), // (65) tcons ::= CONSTRAINT nm
- int8(-7), // (66) tcons ::= PRIMARY KEY LP sortlist autoinc RP onconf
- int8(-5), // (67) tcons ::= UNIQUE LP sortlist RP onconf
- int8(-5), // (68) tcons ::= CHECK LP expr RP onconf
- int8(-10), // (69) tcons ::= FOREIGN KEY LP eidlist RP REFERENCES nm eidlist_opt refargs defer_subclause_opt
- int8(0), // (70) defer_subclause_opt ::=
- int8(0), // (71) onconf ::=
- int8(-3), // (72) onconf ::= ON CONFLICT resolvetype
- int8(0), // (73) orconf ::=
- int8(-2), // (74) orconf ::= OR resolvetype
- int8(-1), // (75) resolvetype ::= IGNORE
- int8(-1), // (76) resolvetype ::= REPLACE
- int8(-4), // (77) cmd ::= DROP TABLE ifexists fullname
- int8(-2), // (78) ifexists ::= IF EXISTS
- int8(0), // (79) ifexists ::=
- int8(-9), // (80) cmd ::= createkw temp VIEW ifnotexists nm dbnm eidlist_opt AS select
- int8(-4), // (81) cmd ::= DROP VIEW ifexists fullname
- int8(-1), // (82) cmd ::= select
- int8(-3), // (83) select ::= WITH wqlist selectnowith
- int8(-4), // (84) select ::= WITH RECURSIVE wqlist selectnowith
- int8(-1), // (85) select ::= selectnowith
- int8(-3), // (86) selectnowith ::= selectnowith multiselect_op oneselect
- int8(-1), // (87) multiselect_op ::= UNION
- int8(-2), // (88) multiselect_op ::= UNION ALL
- int8(-1), // (89) multiselect_op ::= EXCEPT|INTERSECT
- int8(-9), // (90) oneselect ::= SELECT distinct selcollist from where_opt groupby_opt having_opt orderby_opt limit_opt
- int8(-10), // (91) oneselect ::= SELECT distinct selcollist from where_opt groupby_opt having_opt window_clause orderby_opt limit_opt
- int8(-4), // (92) values ::= VALUES LP nexprlist RP
- int8(-5), // (93) values ::= values COMMA LP nexprlist RP
- int8(-1), // (94) distinct ::= DISTINCT
- int8(-1), // (95) distinct ::= ALL
- int8(0), // (96) distinct ::=
- int8(0), // (97) sclp ::=
- int8(-5), // (98) selcollist ::= sclp scanpt expr scanpt as
- int8(-3), // (99) selcollist ::= sclp scanpt STAR
- int8(-5), // (100) selcollist ::= sclp scanpt nm DOT STAR
- int8(-2), // (101) as ::= AS nm
- int8(0), // (102) as ::=
- int8(0), // (103) from ::=
- int8(-2), // (104) from ::= FROM seltablist
- int8(-2), // (105) stl_prefix ::= seltablist joinop
- int8(0), // (106) stl_prefix ::=
- int8(-7), // (107) seltablist ::= stl_prefix nm dbnm as indexed_opt on_opt using_opt
- int8(-9), // (108) seltablist ::= stl_prefix nm dbnm LP exprlist RP as on_opt using_opt
- int8(-7), // (109) seltablist ::= stl_prefix LP select RP as on_opt using_opt
- int8(-7), // (110) seltablist ::= stl_prefix LP seltablist RP as on_opt using_opt
- int8(0), // (111) dbnm ::=
- int8(-2), // (112) dbnm ::= DOT nm
- int8(-1), // (113) fullname ::= nm
- int8(-3), // (114) fullname ::= nm DOT nm
- int8(-1), // (115) xfullname ::= nm
- int8(-3), // (116) xfullname ::= nm DOT nm
- int8(-5), // (117) xfullname ::= nm DOT nm AS nm
- int8(-3), // (118) xfullname ::= nm AS nm
- int8(-1), // (119) joinop ::= COMMA|JOIN
- int8(-2), // (120) joinop ::= JOIN_KW JOIN
- int8(-3), // (121) joinop ::= JOIN_KW nm JOIN
- int8(-4), // (122) joinop ::= JOIN_KW nm nm JOIN
- int8(-2), // (123) on_opt ::= ON expr
- int8(0), // (124) on_opt ::=
- int8(0), // (125) indexed_opt ::=
- int8(-3), // (126) indexed_opt ::= INDEXED BY nm
- int8(-2), // (127) indexed_opt ::= NOT INDEXED
- int8(-4), // (128) using_opt ::= USING LP idlist RP
- int8(0), // (129) using_opt ::=
- int8(0), // (130) orderby_opt ::=
- int8(-3), // (131) orderby_opt ::= ORDER BY sortlist
- int8(-5), // (132) sortlist ::= sortlist COMMA expr sortorder nulls
- int8(-3), // (133) sortlist ::= expr sortorder nulls
- int8(-1), // (134) sortorder ::= ASC
- int8(-1), // (135) sortorder ::= DESC
- int8(0), // (136) sortorder ::=
- int8(-2), // (137) nulls ::= NULLS FIRST
- int8(-2), // (138) nulls ::= NULLS LAST
- int8(0), // (139) nulls ::=
- int8(0), // (140) groupby_opt ::=
- int8(-3), // (141) groupby_opt ::= GROUP BY nexprlist
- int8(0), // (142) having_opt ::=
- int8(-2), // (143) having_opt ::= HAVING expr
- int8(0), // (144) limit_opt ::=
- int8(-2), // (145) limit_opt ::= LIMIT expr
- int8(-4), // (146) limit_opt ::= LIMIT expr OFFSET expr
- int8(-4), // (147) limit_opt ::= LIMIT expr COMMA expr
- int8(-6), // (148) cmd ::= with DELETE FROM xfullname indexed_opt where_opt_ret
- int8(0), // (149) where_opt ::=
- int8(-2), // (150) where_opt ::= WHERE expr
- int8(0), // (151) where_opt_ret ::=
- int8(-2), // (152) where_opt_ret ::= WHERE expr
- int8(-2), // (153) where_opt_ret ::= RETURNING selcollist
- int8(-4), // (154) where_opt_ret ::= WHERE expr RETURNING selcollist
- int8(-9), // (155) cmd ::= with UPDATE orconf xfullname indexed_opt SET setlist from where_opt_ret
- int8(-5), // (156) setlist ::= setlist COMMA nm EQ expr
- int8(-7), // (157) setlist ::= setlist COMMA LP idlist RP EQ expr
- int8(-3), // (158) setlist ::= nm EQ expr
- int8(-5), // (159) setlist ::= LP idlist RP EQ expr
- int8(-7), // (160) cmd ::= with insert_cmd INTO xfullname idlist_opt select upsert
- int8(-8), // (161) cmd ::= with insert_cmd INTO xfullname idlist_opt DEFAULT VALUES returning
- int8(0), // (162) upsert ::=
- int8(-2), // (163) upsert ::= RETURNING selcollist
- int8(-12), // (164) upsert ::= ON CONFLICT LP sortlist RP where_opt DO UPDATE SET setlist where_opt upsert
- int8(-9), // (165) upsert ::= ON CONFLICT LP sortlist RP where_opt DO NOTHING upsert
- int8(-5), // (166) upsert ::= ON CONFLICT DO NOTHING returning
- int8(-8), // (167) upsert ::= ON CONFLICT DO UPDATE SET setlist where_opt returning
- int8(-2), // (168) returning ::= RETURNING selcollist
- int8(-2), // (169) insert_cmd ::= INSERT orconf
- int8(-1), // (170) insert_cmd ::= REPLACE
- int8(0), // (171) idlist_opt ::=
- int8(-3), // (172) idlist_opt ::= LP idlist RP
- int8(-3), // (173) idlist ::= idlist COMMA nm
- int8(-1), // (174) idlist ::= nm
- int8(-3), // (175) expr ::= LP expr RP
- int8(-1), // (176) expr ::= ID|INDEXED
- int8(-1), // (177) expr ::= JOIN_KW
- int8(-3), // (178) expr ::= nm DOT nm
- int8(-5), // (179) expr ::= nm DOT nm DOT nm
- int8(-1), // (180) term ::= NULL|FLOAT|BLOB
- int8(-1), // (181) term ::= STRING
- int8(-1), // (182) term ::= INTEGER
- int8(-1), // (183) expr ::= VARIABLE
- int8(-3), // (184) expr ::= expr COLLATE ID|STRING
- int8(-6), // (185) expr ::= CAST LP expr AS typetoken RP
- int8(-5), // (186) expr ::= ID|INDEXED LP distinct exprlist RP
- int8(-4), // (187) expr ::= ID|INDEXED LP STAR RP
- int8(-6), // (188) expr ::= ID|INDEXED LP distinct exprlist RP filter_over
- int8(-5), // (189) expr ::= ID|INDEXED LP STAR RP filter_over
- int8(-1), // (190) term ::= CTIME_KW
- int8(-5), // (191) expr ::= LP nexprlist COMMA expr RP
- int8(-3), // (192) expr ::= expr AND expr
- int8(-3), // (193) expr ::= expr OR expr
- int8(-3), // (194) expr ::= expr LT|GT|GE|LE expr
- int8(-3), // (195) expr ::= expr EQ|NE expr
- int8(-3), // (196) expr ::= expr BITAND|BITOR|LSHIFT|RSHIFT expr
- int8(-3), // (197) expr ::= expr PLUS|MINUS expr
- int8(-3), // (198) expr ::= expr STAR|SLASH|REM expr
- int8(-3), // (199) expr ::= expr CONCAT expr
- int8(-2), // (200) likeop ::= NOT LIKE_KW|MATCH
- int8(-3), // (201) expr ::= expr likeop expr
- int8(-5), // (202) expr ::= expr likeop expr ESCAPE expr
- int8(-2), // (203) expr ::= expr ISNULL|NOTNULL
- int8(-3), // (204) expr ::= expr NOT NULL
- int8(-3), // (205) expr ::= expr IS expr
- int8(-4), // (206) expr ::= expr IS NOT expr
- int8(-2), // (207) expr ::= NOT expr
- int8(-2), // (208) expr ::= BITNOT expr
- int8(-2), // (209) expr ::= PLUS|MINUS expr
- int8(-1), // (210) between_op ::= BETWEEN
- int8(-2), // (211) between_op ::= NOT BETWEEN
- int8(-5), // (212) expr ::= expr between_op expr AND expr
- int8(-1), // (213) in_op ::= IN
- int8(-2), // (214) in_op ::= NOT IN
- int8(-5), // (215) expr ::= expr in_op LP exprlist RP
- int8(-3), // (216) expr ::= LP select RP
- int8(-5), // (217) expr ::= expr in_op LP select RP
- int8(-5), // (218) expr ::= expr in_op nm dbnm paren_exprlist
- int8(-4), // (219) expr ::= EXISTS LP select RP
- int8(-5), // (220) expr ::= CASE case_operand case_exprlist case_else END
- int8(-5), // (221) case_exprlist ::= case_exprlist WHEN expr THEN expr
- int8(-4), // (222) case_exprlist ::= WHEN expr THEN expr
- int8(-2), // (223) case_else ::= ELSE expr
- int8(0), // (224) case_else ::=
- int8(-1), // (225) case_operand ::= expr
- int8(0), // (226) case_operand ::=
- int8(0), // (227) exprlist ::=
- int8(-3), // (228) nexprlist ::= nexprlist COMMA expr
- int8(-1), // (229) nexprlist ::= expr
- int8(0), // (230) paren_exprlist ::=
- int8(-3), // (231) paren_exprlist ::= LP exprlist RP
- int8(-12), // (232) cmd ::= createkw uniqueflag INDEX ifnotexists nm dbnm ON nm LP sortlist RP where_opt
- int8(-1), // (233) uniqueflag ::= UNIQUE
- int8(0), // (234) uniqueflag ::=
- int8(0), // (235) eidlist_opt ::=
- int8(-3), // (236) eidlist_opt ::= LP eidlist RP
- int8(-5), // (237) eidlist ::= eidlist COMMA nm collate sortorder
- int8(-3), // (238) eidlist ::= nm collate sortorder
- int8(0), // (239) collate ::=
- int8(-2), // (240) collate ::= COLLATE ID|STRING
- int8(-4), // (241) cmd ::= DROP INDEX ifexists fullname
- int8(-2), // (242) cmd ::= VACUUM vinto
- int8(-3), // (243) cmd ::= VACUUM nm vinto
- int8(-2), // (244) vinto ::= INTO expr
- int8(0), // (245) vinto ::=
- int8(-3), // (246) cmd ::= PRAGMA nm dbnm
- int8(-5), // (247) cmd ::= PRAGMA nm dbnm EQ nmnum
- int8(-6), // (248) cmd ::= PRAGMA nm dbnm LP nmnum RP
- int8(-5), // (249) cmd ::= PRAGMA nm dbnm EQ minus_num
- int8(-6), // (250) cmd ::= PRAGMA nm dbnm LP minus_num RP
- int8(-2), // (251) plus_num ::= PLUS INTEGER|FLOAT
- int8(-2), // (252) minus_num ::= MINUS INTEGER|FLOAT
- int8(-5), // (253) cmd ::= createkw trigger_decl BEGIN trigger_cmd_list END
- int8(-11), // (254) trigger_decl ::= temp TRIGGER ifnotexists nm dbnm trigger_time trigger_event ON fullname foreach_clause when_clause
- int8(-1), // (255) trigger_time ::= BEFORE|AFTER
- int8(-2), // (256) trigger_time ::= INSTEAD OF
- int8(0), // (257) trigger_time ::=
- int8(-1), // (258) trigger_event ::= DELETE|INSERT
- int8(-1), // (259) trigger_event ::= UPDATE
- int8(-3), // (260) trigger_event ::= UPDATE OF idlist
- int8(0), // (261) when_clause ::=
- int8(-2), // (262) when_clause ::= WHEN expr
- int8(-3), // (263) trigger_cmd_list ::= trigger_cmd_list trigger_cmd SEMI
- int8(-2), // (264) trigger_cmd_list ::= trigger_cmd SEMI
- int8(-3), // (265) trnm ::= nm DOT nm
- int8(-3), // (266) tridxby ::= INDEXED BY nm
- int8(-2), // (267) tridxby ::= NOT INDEXED
- int8(-9), // (268) trigger_cmd ::= UPDATE orconf trnm tridxby SET setlist from where_opt scanpt
- int8(-8), // (269) trigger_cmd ::= scanpt insert_cmd INTO trnm idlist_opt select upsert scanpt
- int8(-6), // (270) trigger_cmd ::= DELETE FROM trnm tridxby where_opt scanpt
- int8(-3), // (271) trigger_cmd ::= scanpt select scanpt
- int8(-4), // (272) expr ::= RAISE LP IGNORE RP
- int8(-6), // (273) expr ::= RAISE LP raisetype COMMA nm RP
- int8(-1), // (274) raisetype ::= ROLLBACK
- int8(-1), // (275) raisetype ::= ABORT
- int8(-1), // (276) raisetype ::= FAIL
- int8(-4), // (277) cmd ::= DROP TRIGGER ifexists fullname
- int8(-6), // (278) cmd ::= ATTACH database_kw_opt expr AS expr key_opt
- int8(-3), // (279) cmd ::= DETACH database_kw_opt expr
- int8(0), // (280) key_opt ::=
- int8(-2), // (281) key_opt ::= KEY expr
- int8(-1), // (282) cmd ::= REINDEX
- int8(-3), // (283) cmd ::= REINDEX nm dbnm
- int8(-1), // (284) cmd ::= ANALYZE
- int8(-3), // (285) cmd ::= ANALYZE nm dbnm
- int8(-6), // (286) cmd ::= ALTER TABLE fullname RENAME TO nm
- int8(-7), // (287) cmd ::= ALTER TABLE add_column_fullname ADD kwcolumn_opt columnname carglist
- int8(-6), // (288) cmd ::= ALTER TABLE fullname DROP kwcolumn_opt nm
- int8(-1), // (289) add_column_fullname ::= fullname
- int8(-8), // (290) cmd ::= ALTER TABLE fullname RENAME kwcolumn_opt nm TO nm
- int8(-1), // (291) cmd ::= create_vtab
- int8(-4), // (292) cmd ::= create_vtab LP vtabarglist RP
- int8(-8), // (293) create_vtab ::= createkw VIRTUAL TABLE ifnotexists nm dbnm USING nm
- int8(0), // (294) vtabarg ::=
- int8(-1), // (295) vtabargtoken ::= ANY
- int8(-3), // (296) vtabargtoken ::= lp anylist RP
- int8(-1), // (297) lp ::= LP
- int8(-2), // (298) with ::= WITH wqlist
- int8(-3), // (299) with ::= WITH RECURSIVE wqlist
- int8(-1), // (300) wqas ::= AS
- int8(-2), // (301) wqas ::= AS MATERIALIZED
- int8(-3), // (302) wqas ::= AS NOT MATERIALIZED
- int8(-6), // (303) wqitem ::= nm eidlist_opt wqas LP select RP
- int8(-1), // (304) wqlist ::= wqitem
- int8(-3), // (305) wqlist ::= wqlist COMMA wqitem
- int8(-1), // (306) windowdefn_list ::= windowdefn
- int8(-3), // (307) windowdefn_list ::= windowdefn_list COMMA windowdefn
- int8(-5), // (308) windowdefn ::= nm AS LP window RP
- int8(-5), // (309) window ::= PARTITION BY nexprlist orderby_opt frame_opt
- int8(-6), // (310) window ::= nm PARTITION BY nexprlist orderby_opt frame_opt
- int8(-4), // (311) window ::= ORDER BY sortlist frame_opt
- int8(-5), // (312) window ::= nm ORDER BY sortlist frame_opt
- int8(-1), // (313) window ::= frame_opt
- int8(-2), // (314) window ::= nm frame_opt
- int8(0), // (315) frame_opt ::=
- int8(-3), // (316) frame_opt ::= range_or_rows frame_bound_s frame_exclude_opt
- int8(-6), // (317) frame_opt ::= range_or_rows BETWEEN frame_bound_s AND frame_bound_e frame_exclude_opt
- int8(-1), // (318) range_or_rows ::= RANGE|ROWS|GROUPS
- int8(-1), // (319) frame_bound_s ::= frame_bound
- int8(-2), // (320) frame_bound_s ::= UNBOUNDED PRECEDING
- int8(-1), // (321) frame_bound_e ::= frame_bound
- int8(-2), // (322) frame_bound_e ::= UNBOUNDED FOLLOWING
- int8(-2), // (323) frame_bound ::= expr PRECEDING|FOLLOWING
- int8(-2), // (324) frame_bound ::= CURRENT ROW
- int8(0), // (325) frame_exclude_opt ::=
- int8(-2), // (326) frame_exclude_opt ::= EXCLUDE frame_exclude
- int8(-2), // (327) frame_exclude ::= NO OTHERS
- int8(-2), // (328) frame_exclude ::= CURRENT ROW
- int8(-1), // (329) frame_exclude ::= GROUP|TIES
- int8(-2), // (330) window_clause ::= WINDOW windowdefn_list
- int8(-2), // (331) filter_over ::= filter_clause over_clause
- int8(-1), // (332) filter_over ::= over_clause
- int8(-1), // (333) filter_over ::= filter_clause
- int8(-4), // (334) over_clause ::= OVER LP window RP
- int8(-2), // (335) over_clause ::= OVER nm
- int8(-5), // (336) filter_clause ::= FILTER LP WHERE expr RP
- int8(-1), // (337) input ::= cmdlist
- int8(-2), // (338) cmdlist ::= cmdlist ecmd
- int8(-1), // (339) cmdlist ::= ecmd
- int8(-1), // (340) ecmd ::= SEMI
- int8(-2), // (341) ecmd ::= cmdx SEMI
- int8(-3), // (342) ecmd ::= explain cmdx SEMI
- int8(0), // (343) trans_opt ::=
- int8(-1), // (344) trans_opt ::= TRANSACTION
- int8(-2), // (345) trans_opt ::= TRANSACTION nm
- int8(-1), // (346) savepoint_opt ::= SAVEPOINT
- int8(0), // (347) savepoint_opt ::=
- int8(-2), // (348) cmd ::= create_table create_table_args
- int8(-4), // (349) columnlist ::= columnlist COMMA columnname carglist
- int8(-2), // (350) columnlist ::= columnname carglist
- int8(-1), // (351) nm ::= ID|INDEXED
- int8(-1), // (352) nm ::= STRING
- int8(-1), // (353) nm ::= JOIN_KW
- int8(-1), // (354) typetoken ::= typename
- int8(-1), // (355) typename ::= ID|STRING
- int8(-1), // (356) signed ::= plus_num
- int8(-1), // (357) signed ::= minus_num
- int8(-2), // (358) carglist ::= carglist ccons
- int8(0), // (359) carglist ::=
- int8(-2), // (360) ccons ::= NULL onconf
- int8(-4), // (361) ccons ::= GENERATED ALWAYS AS generated
- int8(-2), // (362) ccons ::= AS generated
- int8(-2), // (363) conslist_opt ::= COMMA conslist
- int8(-3), // (364) conslist ::= conslist tconscomma tcons
- int8(-1), // (365) conslist ::= tcons
- int8(0), // (366) tconscomma ::=
- int8(-1), // (367) defer_subclause_opt ::= defer_subclause
- int8(-1), // (368) resolvetype ::= raisetype
- int8(-1), // (369) selectnowith ::= oneselect
- int8(-1), // (370) oneselect ::= values
- int8(-2), // (371) sclp ::= selcollist COMMA
- int8(-1), // (372) as ::= ID|STRING
- int8(0), // (373) returning ::=
- int8(-1), // (374) expr ::= term
- int8(-1), // (375) likeop ::= LIKE_KW|MATCH
- int8(-1), // (376) exprlist ::= nexprlist
- int8(-1), // (377) nmnum ::= plus_num
- int8(-1), // (378) nmnum ::= nm
- int8(-1), // (379) nmnum ::= ON
- int8(-1), // (380) nmnum ::= DELETE
- int8(-1), // (381) nmnum ::= DEFAULT
- int8(-1), // (382) plus_num ::= INTEGER|FLOAT
- int8(0), // (383) foreach_clause ::=
- int8(-3), // (384) foreach_clause ::= FOR EACH ROW
- int8(-1), // (385) trnm ::= nm
- int8(0), // (386) tridxby ::=
- int8(-1), // (387) database_kw_opt ::= DATABASE
- int8(0), // (388) database_kw_opt ::=
- int8(0), // (389) kwcolumn_opt ::=
- int8(-1), // (390) kwcolumn_opt ::= COLUMNKW
- int8(-1), // (391) vtabarglist ::= vtabarg
- int8(-3), // (392) vtabarglist ::= vtabarglist COMMA vtabarg
- int8(-2), // (393) vtabarg ::= vtabarg vtabargtoken
- int8(0), // (394) anylist ::=
- int8(-4), // (395) anylist ::= anylist LP anylist RP
- int8(-2), // (396) anylist ::= anylist ANY
- int8(0), // (397) with ::=
-} /* sqlite3.c:161105:26 */
+ int8(0), // (21) table_option_set ::=
+ int8(-3), // (22) table_option_set ::= table_option_set COMMA table_option
+ int8(-2), // (23) table_option ::= WITHOUT nm
+ int8(-1), // (24) table_option ::= nm
+ int8(-2), // (25) columnname ::= nm typetoken
+ int8(0), // (26) typetoken ::=
+ int8(-4), // (27) typetoken ::= typename LP signed RP
+ int8(-6), // (28) typetoken ::= typename LP signed COMMA signed RP
+ int8(-2), // (29) typename ::= typename ID|STRING
+ int8(0), // (30) scanpt ::=
+ int8(0), // (31) scantok ::=
+ int8(-2), // (32) ccons ::= CONSTRAINT nm
+ int8(-3), // (33) ccons ::= DEFAULT scantok term
+ int8(-4), // (34) ccons ::= DEFAULT LP expr RP
+ int8(-4), // (35) ccons ::= DEFAULT PLUS scantok term
+ int8(-4), // (36) ccons ::= DEFAULT MINUS scantok term
+ int8(-3), // (37) ccons ::= DEFAULT scantok ID|INDEXED
+ int8(-3), // (38) ccons ::= NOT NULL onconf
+ int8(-5), // (39) ccons ::= PRIMARY KEY sortorder onconf autoinc
+ int8(-2), // (40) ccons ::= UNIQUE onconf
+ int8(-4), // (41) ccons ::= CHECK LP expr RP
+ int8(-4), // (42) ccons ::= REFERENCES nm eidlist_opt refargs
+ int8(-1), // (43) ccons ::= defer_subclause
+ int8(-2), // (44) ccons ::= COLLATE ID|STRING
+ int8(-3), // (45) generated ::= LP expr RP
+ int8(-4), // (46) generated ::= LP expr RP ID
+ int8(0), // (47) autoinc ::=
+ int8(-1), // (48) autoinc ::= AUTOINCR
+ int8(0), // (49) refargs ::=
+ int8(-2), // (50) refargs ::= refargs refarg
+ int8(-2), // (51) refarg ::= MATCH nm
+ int8(-3), // (52) refarg ::= ON INSERT refact
+ int8(-3), // (53) refarg ::= ON DELETE refact
+ int8(-3), // (54) refarg ::= ON UPDATE refact
+ int8(-2), // (55) refact ::= SET NULL
+ int8(-2), // (56) refact ::= SET DEFAULT
+ int8(-1), // (57) refact ::= CASCADE
+ int8(-1), // (58) refact ::= RESTRICT
+ int8(-2), // (59) refact ::= NO ACTION
+ int8(-3), // (60) defer_subclause ::= NOT DEFERRABLE init_deferred_pred_opt
+ int8(-2), // (61) defer_subclause ::= DEFERRABLE init_deferred_pred_opt
+ int8(0), // (62) init_deferred_pred_opt ::=
+ int8(-2), // (63) init_deferred_pred_opt ::= INITIALLY DEFERRED
+ int8(-2), // (64) init_deferred_pred_opt ::= INITIALLY IMMEDIATE
+ int8(0), // (65) conslist_opt ::=
+ int8(-1), // (66) tconscomma ::= COMMA
+ int8(-2), // (67) tcons ::= CONSTRAINT nm
+ int8(-7), // (68) tcons ::= PRIMARY KEY LP sortlist autoinc RP onconf
+ int8(-5), // (69) tcons ::= UNIQUE LP sortlist RP onconf
+ int8(-5), // (70) tcons ::= CHECK LP expr RP onconf
+ int8(-10), // (71) tcons ::= FOREIGN KEY LP eidlist RP REFERENCES nm eidlist_opt refargs defer_subclause_opt
+ int8(0), // (72) defer_subclause_opt ::=
+ int8(0), // (73) onconf ::=
+ int8(-3), // (74) onconf ::= ON CONFLICT resolvetype
+ int8(0), // (75) orconf ::=
+ int8(-2), // (76) orconf ::= OR resolvetype
+ int8(-1), // (77) resolvetype ::= IGNORE
+ int8(-1), // (78) resolvetype ::= REPLACE
+ int8(-4), // (79) cmd ::= DROP TABLE ifexists fullname
+ int8(-2), // (80) ifexists ::= IF EXISTS
+ int8(0), // (81) ifexists ::=
+ int8(-9), // (82) cmd ::= createkw temp VIEW ifnotexists nm dbnm eidlist_opt AS select
+ int8(-4), // (83) cmd ::= DROP VIEW ifexists fullname
+ int8(-1), // (84) cmd ::= select
+ int8(-3), // (85) select ::= WITH wqlist selectnowith
+ int8(-4), // (86) select ::= WITH RECURSIVE wqlist selectnowith
+ int8(-1), // (87) select ::= selectnowith
+ int8(-3), // (88) selectnowith ::= selectnowith multiselect_op oneselect
+ int8(-1), // (89) multiselect_op ::= UNION
+ int8(-2), // (90) multiselect_op ::= UNION ALL
+ int8(-1), // (91) multiselect_op ::= EXCEPT|INTERSECT
+ int8(-9), // (92) oneselect ::= SELECT distinct selcollist from where_opt groupby_opt having_opt orderby_opt limit_opt
+ int8(-10), // (93) oneselect ::= SELECT distinct selcollist from where_opt groupby_opt having_opt window_clause orderby_opt limit_opt
+ int8(-4), // (94) values ::= VALUES LP nexprlist RP
+ int8(-5), // (95) values ::= values COMMA LP nexprlist RP
+ int8(-1), // (96) distinct ::= DISTINCT
+ int8(-1), // (97) distinct ::= ALL
+ int8(0), // (98) distinct ::=
+ int8(0), // (99) sclp ::=
+ int8(-5), // (100) selcollist ::= sclp scanpt expr scanpt as
+ int8(-3), // (101) selcollist ::= sclp scanpt STAR
+ int8(-5), // (102) selcollist ::= sclp scanpt nm DOT STAR
+ int8(-2), // (103) as ::= AS nm
+ int8(0), // (104) as ::=
+ int8(0), // (105) from ::=
+ int8(-2), // (106) from ::= FROM seltablist
+ int8(-2), // (107) stl_prefix ::= seltablist joinop
+ int8(0), // (108) stl_prefix ::=
+ int8(-7), // (109) seltablist ::= stl_prefix nm dbnm as indexed_opt on_opt using_opt
+ int8(-9), // (110) seltablist ::= stl_prefix nm dbnm LP exprlist RP as on_opt using_opt
+ int8(-7), // (111) seltablist ::= stl_prefix LP select RP as on_opt using_opt
+ int8(-7), // (112) seltablist ::= stl_prefix LP seltablist RP as on_opt using_opt
+ int8(0), // (113) dbnm ::=
+ int8(-2), // (114) dbnm ::= DOT nm
+ int8(-1), // (115) fullname ::= nm
+ int8(-3), // (116) fullname ::= nm DOT nm
+ int8(-1), // (117) xfullname ::= nm
+ int8(-3), // (118) xfullname ::= nm DOT nm
+ int8(-5), // (119) xfullname ::= nm DOT nm AS nm
+ int8(-3), // (120) xfullname ::= nm AS nm
+ int8(-1), // (121) joinop ::= COMMA|JOIN
+ int8(-2), // (122) joinop ::= JOIN_KW JOIN
+ int8(-3), // (123) joinop ::= JOIN_KW nm JOIN
+ int8(-4), // (124) joinop ::= JOIN_KW nm nm JOIN
+ int8(-2), // (125) on_opt ::= ON expr
+ int8(0), // (126) on_opt ::=
+ int8(0), // (127) indexed_opt ::=
+ int8(-3), // (128) indexed_opt ::= INDEXED BY nm
+ int8(-2), // (129) indexed_opt ::= NOT INDEXED
+ int8(-4), // (130) using_opt ::= USING LP idlist RP
+ int8(0), // (131) using_opt ::=
+ int8(0), // (132) orderby_opt ::=
+ int8(-3), // (133) orderby_opt ::= ORDER BY sortlist
+ int8(-5), // (134) sortlist ::= sortlist COMMA expr sortorder nulls
+ int8(-3), // (135) sortlist ::= expr sortorder nulls
+ int8(-1), // (136) sortorder ::= ASC
+ int8(-1), // (137) sortorder ::= DESC
+ int8(0), // (138) sortorder ::=
+ int8(-2), // (139) nulls ::= NULLS FIRST
+ int8(-2), // (140) nulls ::= NULLS LAST
+ int8(0), // (141) nulls ::=
+ int8(0), // (142) groupby_opt ::=
+ int8(-3), // (143) groupby_opt ::= GROUP BY nexprlist
+ int8(0), // (144) having_opt ::=
+ int8(-2), // (145) having_opt ::= HAVING expr
+ int8(0), // (146) limit_opt ::=
+ int8(-2), // (147) limit_opt ::= LIMIT expr
+ int8(-4), // (148) limit_opt ::= LIMIT expr OFFSET expr
+ int8(-4), // (149) limit_opt ::= LIMIT expr COMMA expr
+ int8(-6), // (150) cmd ::= with DELETE FROM xfullname indexed_opt where_opt_ret
+ int8(0), // (151) where_opt ::=
+ int8(-2), // (152) where_opt ::= WHERE expr
+ int8(0), // (153) where_opt_ret ::=
+ int8(-2), // (154) where_opt_ret ::= WHERE expr
+ int8(-2), // (155) where_opt_ret ::= RETURNING selcollist
+ int8(-4), // (156) where_opt_ret ::= WHERE expr RETURNING selcollist
+ int8(-9), // (157) cmd ::= with UPDATE orconf xfullname indexed_opt SET setlist from where_opt_ret
+ int8(-5), // (158) setlist ::= setlist COMMA nm EQ expr
+ int8(-7), // (159) setlist ::= setlist COMMA LP idlist RP EQ expr
+ int8(-3), // (160) setlist ::= nm EQ expr
+ int8(-5), // (161) setlist ::= LP idlist RP EQ expr
+ int8(-7), // (162) cmd ::= with insert_cmd INTO xfullname idlist_opt select upsert
+ int8(-8), // (163) cmd ::= with insert_cmd INTO xfullname idlist_opt DEFAULT VALUES returning
+ int8(0), // (164) upsert ::=
+ int8(-2), // (165) upsert ::= RETURNING selcollist
+ int8(-12), // (166) upsert ::= ON CONFLICT LP sortlist RP where_opt DO UPDATE SET setlist where_opt upsert
+ int8(-9), // (167) upsert ::= ON CONFLICT LP sortlist RP where_opt DO NOTHING upsert
+ int8(-5), // (168) upsert ::= ON CONFLICT DO NOTHING returning
+ int8(-8), // (169) upsert ::= ON CONFLICT DO UPDATE SET setlist where_opt returning
+ int8(-2), // (170) returning ::= RETURNING selcollist
+ int8(-2), // (171) insert_cmd ::= INSERT orconf
+ int8(-1), // (172) insert_cmd ::= REPLACE
+ int8(0), // (173) idlist_opt ::=
+ int8(-3), // (174) idlist_opt ::= LP idlist RP
+ int8(-3), // (175) idlist ::= idlist COMMA nm
+ int8(-1), // (176) idlist ::= nm
+ int8(-3), // (177) expr ::= LP expr RP
+ int8(-1), // (178) expr ::= ID|INDEXED
+ int8(-1), // (179) expr ::= JOIN_KW
+ int8(-3), // (180) expr ::= nm DOT nm
+ int8(-5), // (181) expr ::= nm DOT nm DOT nm
+ int8(-1), // (182) term ::= NULL|FLOAT|BLOB
+ int8(-1), // (183) term ::= STRING
+ int8(-1), // (184) term ::= INTEGER
+ int8(-1), // (185) expr ::= VARIABLE
+ int8(-3), // (186) expr ::= expr COLLATE ID|STRING
+ int8(-6), // (187) expr ::= CAST LP expr AS typetoken RP
+ int8(-5), // (188) expr ::= ID|INDEXED LP distinct exprlist RP
+ int8(-4), // (189) expr ::= ID|INDEXED LP STAR RP
+ int8(-6), // (190) expr ::= ID|INDEXED LP distinct exprlist RP filter_over
+ int8(-5), // (191) expr ::= ID|INDEXED LP STAR RP filter_over
+ int8(-1), // (192) term ::= CTIME_KW
+ int8(-5), // (193) expr ::= LP nexprlist COMMA expr RP
+ int8(-3), // (194) expr ::= expr AND expr
+ int8(-3), // (195) expr ::= expr OR expr
+ int8(-3), // (196) expr ::= expr LT|GT|GE|LE expr
+ int8(-3), // (197) expr ::= expr EQ|NE expr
+ int8(-3), // (198) expr ::= expr BITAND|BITOR|LSHIFT|RSHIFT expr
+ int8(-3), // (199) expr ::= expr PLUS|MINUS expr
+ int8(-3), // (200) expr ::= expr STAR|SLASH|REM expr
+ int8(-3), // (201) expr ::= expr CONCAT expr
+ int8(-2), // (202) likeop ::= NOT LIKE_KW|MATCH
+ int8(-3), // (203) expr ::= expr likeop expr
+ int8(-5), // (204) expr ::= expr likeop expr ESCAPE expr
+ int8(-2), // (205) expr ::= expr ISNULL|NOTNULL
+ int8(-3), // (206) expr ::= expr NOT NULL
+ int8(-3), // (207) expr ::= expr IS expr
+ int8(-4), // (208) expr ::= expr IS NOT expr
+ int8(-2), // (209) expr ::= NOT expr
+ int8(-2), // (210) expr ::= BITNOT expr
+ int8(-2), // (211) expr ::= PLUS|MINUS expr
+ int8(-1), // (212) between_op ::= BETWEEN
+ int8(-2), // (213) between_op ::= NOT BETWEEN
+ int8(-5), // (214) expr ::= expr between_op expr AND expr
+ int8(-1), // (215) in_op ::= IN
+ int8(-2), // (216) in_op ::= NOT IN
+ int8(-5), // (217) expr ::= expr in_op LP exprlist RP
+ int8(-3), // (218) expr ::= LP select RP
+ int8(-5), // (219) expr ::= expr in_op LP select RP
+ int8(-5), // (220) expr ::= expr in_op nm dbnm paren_exprlist
+ int8(-4), // (221) expr ::= EXISTS LP select RP
+ int8(-5), // (222) expr ::= CASE case_operand case_exprlist case_else END
+ int8(-5), // (223) case_exprlist ::= case_exprlist WHEN expr THEN expr
+ int8(-4), // (224) case_exprlist ::= WHEN expr THEN expr
+ int8(-2), // (225) case_else ::= ELSE expr
+ int8(0), // (226) case_else ::=
+ int8(-1), // (227) case_operand ::= expr
+ int8(0), // (228) case_operand ::=
+ int8(0), // (229) exprlist ::=
+ int8(-3), // (230) nexprlist ::= nexprlist COMMA expr
+ int8(-1), // (231) nexprlist ::= expr
+ int8(0), // (232) paren_exprlist ::=
+ int8(-3), // (233) paren_exprlist ::= LP exprlist RP
+ int8(-12), // (234) cmd ::= createkw uniqueflag INDEX ifnotexists nm dbnm ON nm LP sortlist RP where_opt
+ int8(-1), // (235) uniqueflag ::= UNIQUE
+ int8(0), // (236) uniqueflag ::=
+ int8(0), // (237) eidlist_opt ::=
+ int8(-3), // (238) eidlist_opt ::= LP eidlist RP
+ int8(-5), // (239) eidlist ::= eidlist COMMA nm collate sortorder
+ int8(-3), // (240) eidlist ::= nm collate sortorder
+ int8(0), // (241) collate ::=
+ int8(-2), // (242) collate ::= COLLATE ID|STRING
+ int8(-4), // (243) cmd ::= DROP INDEX ifexists fullname
+ int8(-2), // (244) cmd ::= VACUUM vinto
+ int8(-3), // (245) cmd ::= VACUUM nm vinto
+ int8(-2), // (246) vinto ::= INTO expr
+ int8(0), // (247) vinto ::=
+ int8(-3), // (248) cmd ::= PRAGMA nm dbnm
+ int8(-5), // (249) cmd ::= PRAGMA nm dbnm EQ nmnum
+ int8(-6), // (250) cmd ::= PRAGMA nm dbnm LP nmnum RP
+ int8(-5), // (251) cmd ::= PRAGMA nm dbnm EQ minus_num
+ int8(-6), // (252) cmd ::= PRAGMA nm dbnm LP minus_num RP
+ int8(-2), // (253) plus_num ::= PLUS INTEGER|FLOAT
+ int8(-2), // (254) minus_num ::= MINUS INTEGER|FLOAT
+ int8(-5), // (255) cmd ::= createkw trigger_decl BEGIN trigger_cmd_list END
+ int8(-11), // (256) trigger_decl ::= temp TRIGGER ifnotexists nm dbnm trigger_time trigger_event ON fullname foreach_clause when_clause
+ int8(-1), // (257) trigger_time ::= BEFORE|AFTER
+ int8(-2), // (258) trigger_time ::= INSTEAD OF
+ int8(0), // (259) trigger_time ::=
+ int8(-1), // (260) trigger_event ::= DELETE|INSERT
+ int8(-1), // (261) trigger_event ::= UPDATE
+ int8(-3), // (262) trigger_event ::= UPDATE OF idlist
+ int8(0), // (263) when_clause ::=
+ int8(-2), // (264) when_clause ::= WHEN expr
+ int8(-3), // (265) trigger_cmd_list ::= trigger_cmd_list trigger_cmd SEMI
+ int8(-2), // (266) trigger_cmd_list ::= trigger_cmd SEMI
+ int8(-3), // (267) trnm ::= nm DOT nm
+ int8(-3), // (268) tridxby ::= INDEXED BY nm
+ int8(-2), // (269) tridxby ::= NOT INDEXED
+ int8(-9), // (270) trigger_cmd ::= UPDATE orconf trnm tridxby SET setlist from where_opt scanpt
+ int8(-8), // (271) trigger_cmd ::= scanpt insert_cmd INTO trnm idlist_opt select upsert scanpt
+ int8(-6), // (272) trigger_cmd ::= DELETE FROM trnm tridxby where_opt scanpt
+ int8(-3), // (273) trigger_cmd ::= scanpt select scanpt
+ int8(-4), // (274) expr ::= RAISE LP IGNORE RP
+ int8(-6), // (275) expr ::= RAISE LP raisetype COMMA nm RP
+ int8(-1), // (276) raisetype ::= ROLLBACK
+ int8(-1), // (277) raisetype ::= ABORT
+ int8(-1), // (278) raisetype ::= FAIL
+ int8(-4), // (279) cmd ::= DROP TRIGGER ifexists fullname
+ int8(-6), // (280) cmd ::= ATTACH database_kw_opt expr AS expr key_opt
+ int8(-3), // (281) cmd ::= DETACH database_kw_opt expr
+ int8(0), // (282) key_opt ::=
+ int8(-2), // (283) key_opt ::= KEY expr
+ int8(-1), // (284) cmd ::= REINDEX
+ int8(-3), // (285) cmd ::= REINDEX nm dbnm
+ int8(-1), // (286) cmd ::= ANALYZE
+ int8(-3), // (287) cmd ::= ANALYZE nm dbnm
+ int8(-6), // (288) cmd ::= ALTER TABLE fullname RENAME TO nm
+ int8(-7), // (289) cmd ::= ALTER TABLE add_column_fullname ADD kwcolumn_opt columnname carglist
+ int8(-6), // (290) cmd ::= ALTER TABLE fullname DROP kwcolumn_opt nm
+ int8(-1), // (291) add_column_fullname ::= fullname
+ int8(-8), // (292) cmd ::= ALTER TABLE fullname RENAME kwcolumn_opt nm TO nm
+ int8(-1), // (293) cmd ::= create_vtab
+ int8(-4), // (294) cmd ::= create_vtab LP vtabarglist RP
+ int8(-8), // (295) create_vtab ::= createkw VIRTUAL TABLE ifnotexists nm dbnm USING nm
+ int8(0), // (296) vtabarg ::=
+ int8(-1), // (297) vtabargtoken ::= ANY
+ int8(-3), // (298) vtabargtoken ::= lp anylist RP
+ int8(-1), // (299) lp ::= LP
+ int8(-2), // (300) with ::= WITH wqlist
+ int8(-3), // (301) with ::= WITH RECURSIVE wqlist
+ int8(-1), // (302) wqas ::= AS
+ int8(-2), // (303) wqas ::= AS MATERIALIZED
+ int8(-3), // (304) wqas ::= AS NOT MATERIALIZED
+ int8(-6), // (305) wqitem ::= nm eidlist_opt wqas LP select RP
+ int8(-1), // (306) wqlist ::= wqitem
+ int8(-3), // (307) wqlist ::= wqlist COMMA wqitem
+ int8(-1), // (308) windowdefn_list ::= windowdefn
+ int8(-3), // (309) windowdefn_list ::= windowdefn_list COMMA windowdefn
+ int8(-5), // (310) windowdefn ::= nm AS LP window RP
+ int8(-5), // (311) window ::= PARTITION BY nexprlist orderby_opt frame_opt
+ int8(-6), // (312) window ::= nm PARTITION BY nexprlist orderby_opt frame_opt
+ int8(-4), // (313) window ::= ORDER BY sortlist frame_opt
+ int8(-5), // (314) window ::= nm ORDER BY sortlist frame_opt
+ int8(-1), // (315) window ::= frame_opt
+ int8(-2), // (316) window ::= nm frame_opt
+ int8(0), // (317) frame_opt ::=
+ int8(-3), // (318) frame_opt ::= range_or_rows frame_bound_s frame_exclude_opt
+ int8(-6), // (319) frame_opt ::= range_or_rows BETWEEN frame_bound_s AND frame_bound_e frame_exclude_opt
+ int8(-1), // (320) range_or_rows ::= RANGE|ROWS|GROUPS
+ int8(-1), // (321) frame_bound_s ::= frame_bound
+ int8(-2), // (322) frame_bound_s ::= UNBOUNDED PRECEDING
+ int8(-1), // (323) frame_bound_e ::= frame_bound
+ int8(-2), // (324) frame_bound_e ::= UNBOUNDED FOLLOWING
+ int8(-2), // (325) frame_bound ::= expr PRECEDING|FOLLOWING
+ int8(-2), // (326) frame_bound ::= CURRENT ROW
+ int8(0), // (327) frame_exclude_opt ::=
+ int8(-2), // (328) frame_exclude_opt ::= EXCLUDE frame_exclude
+ int8(-2), // (329) frame_exclude ::= NO OTHERS
+ int8(-2), // (330) frame_exclude ::= CURRENT ROW
+ int8(-1), // (331) frame_exclude ::= GROUP|TIES
+ int8(-2), // (332) window_clause ::= WINDOW windowdefn_list
+ int8(-2), // (333) filter_over ::= filter_clause over_clause
+ int8(-1), // (334) filter_over ::= over_clause
+ int8(-1), // (335) filter_over ::= filter_clause
+ int8(-4), // (336) over_clause ::= OVER LP window RP
+ int8(-2), // (337) over_clause ::= OVER nm
+ int8(-5), // (338) filter_clause ::= FILTER LP WHERE expr RP
+ int8(-1), // (339) input ::= cmdlist
+ int8(-2), // (340) cmdlist ::= cmdlist ecmd
+ int8(-1), // (341) cmdlist ::= ecmd
+ int8(-1), // (342) ecmd ::= SEMI
+ int8(-2), // (343) ecmd ::= cmdx SEMI
+ int8(-3), // (344) ecmd ::= explain cmdx SEMI
+ int8(0), // (345) trans_opt ::=
+ int8(-1), // (346) trans_opt ::= TRANSACTION
+ int8(-2), // (347) trans_opt ::= TRANSACTION nm
+ int8(-1), // (348) savepoint_opt ::= SAVEPOINT
+ int8(0), // (349) savepoint_opt ::=
+ int8(-2), // (350) cmd ::= create_table create_table_args
+ int8(-1), // (351) table_option_set ::= table_option
+ int8(-4), // (352) columnlist ::= columnlist COMMA columnname carglist
+ int8(-2), // (353) columnlist ::= columnname carglist
+ int8(-1), // (354) nm ::= ID|INDEXED
+ int8(-1), // (355) nm ::= STRING
+ int8(-1), // (356) nm ::= JOIN_KW
+ int8(-1), // (357) typetoken ::= typename
+ int8(-1), // (358) typename ::= ID|STRING
+ int8(-1), // (359) signed ::= plus_num
+ int8(-1), // (360) signed ::= minus_num
+ int8(-2), // (361) carglist ::= carglist ccons
+ int8(0), // (362) carglist ::=
+ int8(-2), // (363) ccons ::= NULL onconf
+ int8(-4), // (364) ccons ::= GENERATED ALWAYS AS generated
+ int8(-2), // (365) ccons ::= AS generated
+ int8(-2), // (366) conslist_opt ::= COMMA conslist
+ int8(-3), // (367) conslist ::= conslist tconscomma tcons
+ int8(-1), // (368) conslist ::= tcons
+ int8(0), // (369) tconscomma ::=
+ int8(-1), // (370) defer_subclause_opt ::= defer_subclause
+ int8(-1), // (371) resolvetype ::= raisetype
+ int8(-1), // (372) selectnowith ::= oneselect
+ int8(-1), // (373) oneselect ::= values
+ int8(-2), // (374) sclp ::= selcollist COMMA
+ int8(-1), // (375) as ::= ID|STRING
+ int8(0), // (376) returning ::=
+ int8(-1), // (377) expr ::= term
+ int8(-1), // (378) likeop ::= LIKE_KW|MATCH
+ int8(-1), // (379) exprlist ::= nexprlist
+ int8(-1), // (380) nmnum ::= plus_num
+ int8(-1), // (381) nmnum ::= nm
+ int8(-1), // (382) nmnum ::= ON
+ int8(-1), // (383) nmnum ::= DELETE
+ int8(-1), // (384) nmnum ::= DEFAULT
+ int8(-1), // (385) plus_num ::= INTEGER|FLOAT
+ int8(0), // (386) foreach_clause ::=
+ int8(-3), // (387) foreach_clause ::= FOR EACH ROW
+ int8(-1), // (388) trnm ::= nm
+ int8(0), // (389) tridxby ::=
+ int8(-1), // (390) database_kw_opt ::= DATABASE
+ int8(0), // (391) database_kw_opt ::=
+ int8(0), // (392) kwcolumn_opt ::=
+ int8(-1), // (393) kwcolumn_opt ::= COLUMNKW
+ int8(-1), // (394) vtabarglist ::= vtabarg
+ int8(-3), // (395) vtabarglist ::= vtabarglist COMMA vtabarg
+ int8(-2), // (396) vtabarg ::= vtabarg vtabargtoken
+ int8(0), // (397) anylist ::=
+ int8(-4), // (398) anylist ::= anylist LP anylist RP
+ int8(-2), // (399) anylist ::= anylist ANY
+ int8(0), // (400) with ::=
+} /* sqlite3.c:162552:26 */
// Forward Declaration
@@ -141563,9 +143650,9 @@ var yyRuleInfoNRhs = [398]int8{
// if the lookahead token has already been consumed. As this procedure is
// only called from one place, optimizing compilers will in-line it, which
// means that the extra parameters have no performance impact.
-func yy_reduce(tls *libc.TLS, yypParser uintptr, yyruleno uint32, yyLookahead int32, yyLookaheadToken Token, pParse uintptr) uint16 { /* sqlite3.c:161518:21: */
- bp := tls.Alloc(84)
- defer tls.Free(84)
+func yy_reduce(tls *libc.TLS, yypParser uintptr, yyruleno uint32, yyLookahead int32, yyLookaheadToken Token, pParse uintptr) uint16 { /* sqlite3.c:162968:21: */
+ bp := tls.Alloc(100)
+ defer tls.Free(100)
var yygoto int32 // The next state
var yyact uint16 // The next action
@@ -141585,7 +143672,7 @@ func yy_reduce(tls *libc.TLS, yypParser uintptr, yyruleno uint32, yyLookahead in
// #line <lineno> <thisfile>
// break;
//********* Begin reduce actions *********************************************
- // var yylhsminor YYMINORTYPE at bp+60, 8
+ // var yylhsminor YYMINORTYPE at bp+40, 8
case uint32(0): /* explain ::= EXPLAIN */
{
@@ -141604,12 +143691,12 @@ func yy_reduce(tls *libc.TLS, yypParser uintptr, yyruleno uint32, yyLookahead in
break
case uint32(3): /* cmd ::= BEGIN transtype trans_opt */
{
- Xsqlite3BeginTransaction(tls, pParse, *(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*12 + 4 /* &.minor */)))
+ Xsqlite3BeginTransaction(tls, pParse, *(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*12 + 4)))
}
break
case uint32(4): /* transtype ::= */
{
- *(*int32)(unsafe.Pointer(yymsp + 1*12 + 4 /* &.minor */)) = TK_DEFERRED
+ *(*int32)(unsafe.Pointer(yymsp + 1*12 + 4)) = TK_DEFERRED
}
break
case uint32(5):
@@ -141618,9 +143705,9 @@ func yy_reduce(tls *libc.TLS, yypParser uintptr, yyruleno uint32, yyLookahead in
fallthrough
case uint32(7): /* transtype ::= EXCLUSIVE */
fallthrough
- case uint32(318): /* range_or_rows ::= RANGE|ROWS|GROUPS */
+ case uint32(320): /* range_or_rows ::= RANGE|ROWS|GROUPS */
{
- *(*int32)(unsafe.Pointer(yymsp + 4 /* &.minor */)) = int32((*YyStackEntry)(unsafe.Pointer(yymsp)).Fmajor) /*A-overwrites-X*/
+ *(*int32)(unsafe.Pointer(yymsp + 4)) = int32((*YyStackEntry)(unsafe.Pointer(yymsp)).Fmajor) /*A-overwrites-X*/
}
break
case uint32(8):
@@ -141632,22 +143719,22 @@ func yy_reduce(tls *libc.TLS, yypParser uintptr, yyruleno uint32, yyLookahead in
break
case uint32(10): /* cmd ::= SAVEPOINT nm */
{
- Xsqlite3Savepoint(tls, pParse, SAVEPOINT_BEGIN, (yymsp + 4 /* &.minor */ /* &.yy0 */))
+ Xsqlite3Savepoint(tls, pParse, SAVEPOINT_BEGIN, yymsp+4)
}
break
case uint32(11): /* cmd ::= RELEASE savepoint_opt nm */
{
- Xsqlite3Savepoint(tls, pParse, SAVEPOINT_RELEASE, (yymsp + 4 /* &.minor */ /* &.yy0 */))
+ Xsqlite3Savepoint(tls, pParse, SAVEPOINT_RELEASE, yymsp+4)
}
break
case uint32(12): /* cmd ::= ROLLBACK trans_opt TO savepoint_opt nm */
{
- Xsqlite3Savepoint(tls, pParse, SAVEPOINT_ROLLBACK, (yymsp + 4 /* &.minor */ /* &.yy0 */))
+ Xsqlite3Savepoint(tls, pParse, SAVEPOINT_ROLLBACK, yymsp+4)
}
break
case uint32(13): /* create_table ::= createkw temp TABLE ifnotexists nm dbnm */
{
- Xsqlite3StartTable(tls, pParse, (yymsp + libc.UintptrFromInt32(-1)*12 + 4 /* &.minor */ /* &.yy0 */), (yymsp + 4 /* &.minor */ /* &.yy0 */), *(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*12 + 4 /* &.minor */)), 0, 0, *(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*12 + 4 /* &.minor */)))
+ Xsqlite3StartTable(tls, pParse, yymsp+libc.UintptrFromInt32(-1)*12+4, yymsp+4, *(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*12 + 4)), 0, 0, *(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*12 + 4)))
}
break
case uint32(14): /* createkw ::= CREATE */
@@ -141659,1099 +143746,1119 @@ func yy_reduce(tls *libc.TLS, yypParser uintptr, yyruleno uint32, yyLookahead in
fallthrough // ifnotexists ::=
case uint32(18): /* temp ::= */
fallthrough
- case uint32(21): /* table_options ::= */
+ case uint32(47): /* autoinc ::= */
fallthrough
- case uint32(45): /* autoinc ::= */
+ case uint32(62): /* init_deferred_pred_opt ::= */
fallthrough
- case uint32(60): /* init_deferred_pred_opt ::= */
+ case uint32(72): /* defer_subclause_opt ::= */
fallthrough
- case uint32(70): /* defer_subclause_opt ::= */
+ case uint32(81): /* ifexists ::= */
fallthrough
- case uint32(79): /* ifexists ::= */
+ case uint32(98): /* distinct ::= */
fallthrough
- case uint32(96): /* distinct ::= */
- fallthrough
- case uint32(239): /* collate ::= */
+ case uint32(241): /* collate ::= */
{
- *(*int32)(unsafe.Pointer(yymsp + 1*12 + 4 /* &.minor */)) = 0
+ *(*int32)(unsafe.Pointer(yymsp + 1*12 + 4)) = 0
}
break
case uint32(16): /* ifnotexists ::= IF NOT EXISTS */
{
- *(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*12 + 4 /* &.minor */)) = 1
+ *(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*12 + 4)) = 1
}
break
case uint32(17): /* temp ::= TEMP */
{
- *(*int32)(unsafe.Pointer(yymsp + 4 /* &.minor */)) = (libc.Bool32(int32((*Sqlite3)(unsafe.Pointer((*Parse)(unsafe.Pointer(pParse)).Fdb)).Finit.Fbusy) == 0))
+ *(*int32)(unsafe.Pointer(yymsp + 4)) = libc.Bool32(int32((*Sqlite3)(unsafe.Pointer((*Parse)(unsafe.Pointer(pParse)).Fdb)).Finit.Fbusy) == 0)
}
break
- case uint32(19): /* create_table_args ::= LP columnlist conslist_opt RP table_options */
+ case uint32(19): /* create_table_args ::= LP columnlist conslist_opt RP table_option_set */
{
- Xsqlite3EndTable(tls, pParse, (yymsp + libc.UintptrFromInt32(-2)*12 + 4 /* &.minor */ /* &.yy0 */), (yymsp + libc.UintptrFromInt32(-1)*12 + 4 /* &.minor */ /* &.yy0 */), uint8(*(*int32)(unsafe.Pointer(yymsp + 4 /* &.minor */))), uintptr(0))
+ Xsqlite3EndTable(tls, pParse, yymsp+libc.UintptrFromInt32(-2)*12+4, yymsp+libc.UintptrFromInt32(-1)*12+4, *(*U32)(unsafe.Pointer(yymsp + 4)), uintptr(0))
}
break
case uint32(20): /* create_table_args ::= AS select */
{
- Xsqlite3EndTable(tls, pParse, uintptr(0), uintptr(0), uint8(0), *(*uintptr)(unsafe.Pointer(yymsp + 4 /* &.minor */)))
- Xsqlite3SelectDelete(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, *(*uintptr)(unsafe.Pointer(yymsp + 4 /* &.minor */)))
+ Xsqlite3EndTable(tls, pParse, uintptr(0), uintptr(0), uint32(0), *(*uintptr)(unsafe.Pointer(yymsp + 4)))
+ Xsqlite3SelectDelete(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, *(*uintptr)(unsafe.Pointer(yymsp + 4)))
+ }
+ break
+ case uint32(21): /* table_option_set ::= */
+ {
+ *(*U32)(unsafe.Pointer(yymsp + 1*12 + 4)) = U32(0)
+ }
+ break
+ case uint32(22): /* table_option_set ::= table_option_set COMMA table_option */
+ {
+ *(*U32)(unsafe.Pointer(bp + 40 /* &yylhsminor */)) = *(*U32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*12 + 4)) | *(*U32)(unsafe.Pointer(yymsp + 4))
+ }
+ *(*U32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*12 + 4)) = *(*U32)(unsafe.Pointer(bp + 40 /* &yylhsminor */))
+ break
+ case uint32(23): /* table_option ::= WITHOUT nm */
+ {
+ if (*Token)(unsafe.Pointer(yymsp+4)).Fn == uint32(5) && Xsqlite3_strnicmp(tls, (*Token)(unsafe.Pointer(yymsp+4)).Fz, ts+15961, 5) == 0 {
+ *(*U32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*12 + 4)) = U32(TF_WithoutRowid | TF_NoVisibleRowid)
+ } else {
+ *(*U32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*12 + 4)) = U32(0)
+ Xsqlite3ErrorMsg(tls, pParse, ts+22536 /* "unknown table op..." */, libc.VaList(bp, (*Token)(unsafe.Pointer(yymsp+4)).Fn, (*Token)(unsafe.Pointer(yymsp+4)).Fz))
+ }
}
break
- case uint32(22): /* table_options ::= WITHOUT nm */
+ case uint32(24): /* table_option ::= nm */
{
- if ((*Token)(unsafe.Pointer(yymsp+4 /* &.minor */)).Fn == uint32(5)) && (Xsqlite3_strnicmp(tls, (*Token)(unsafe.Pointer(yymsp+4 /* &.minor */)).Fz, ts+14757 /* "rowid" */, 5) == 0) {
- *(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*12 + 4 /* &.minor */)) = (TF_WithoutRowid | TF_NoVisibleRowid)
+ if (*Token)(unsafe.Pointer(yymsp+4)).Fn == uint32(6) && Xsqlite3_strnicmp(tls, (*Token)(unsafe.Pointer(yymsp+4)).Fz, ts+15874, 6) == 0 {
+ *(*U32)(unsafe.Pointer(bp + 40 /* &yylhsminor */)) = U32(TF_Strict)
} else {
- *(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*12 + 4 /* &.minor */)) = 0
- Xsqlite3ErrorMsg(tls, pParse, ts+21239 /* "unknown table op..." */, libc.VaList(bp, (*Token)(unsafe.Pointer(yymsp+4 /* &.minor */)).Fn, (*Token)(unsafe.Pointer(yymsp+4 /* &.minor */)).Fz))
+ *(*U32)(unsafe.Pointer(bp + 40 /* &yylhsminor */)) = U32(0)
+ Xsqlite3ErrorMsg(tls, pParse, ts+22536 /* "unknown table op..." */, libc.VaList(bp+16, (*Token)(unsafe.Pointer(yymsp+4)).Fn, (*Token)(unsafe.Pointer(yymsp+4)).Fz))
}
}
+ *(*U32)(unsafe.Pointer(yymsp + 4)) = *(*U32)(unsafe.Pointer(bp + 40 /* &yylhsminor */))
break
- case uint32(23): /* columnname ::= nm typetoken */
+ case uint32(25): /* columnname ::= nm typetoken */
{
- Xsqlite3AddColumn(tls, pParse, (yymsp + libc.UintptrFromInt32(-1)*12 + 4 /* &.minor */ /* &.yy0 */), (yymsp + 4 /* &.minor */ /* &.yy0 */))
+ Xsqlite3AddColumn(tls, pParse, *(*Token)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*12 + 4)), *(*Token)(unsafe.Pointer(yymsp + 4)))
}
break
- case uint32(24):
+ case uint32(26):
fallthrough // typetoken ::=
- case uint32(63): /* conslist_opt ::= */
+ case uint32(65): /* conslist_opt ::= */
fallthrough
- case uint32(102): /* as ::= */
+ case uint32(104): /* as ::= */
{
- (*Token)(unsafe.Pointer(yymsp + 1*12 + 4 /* &.minor */)).Fn = uint32(0)
- (*Token)(unsafe.Pointer(yymsp + 1*12 + 4 /* &.minor */)).Fz = uintptr(0)
+ (*Token)(unsafe.Pointer(yymsp + 1*12 + 4)).Fn = uint32(0)
+ (*Token)(unsafe.Pointer(yymsp + 1*12 + 4)).Fz = uintptr(0)
}
break
- case uint32(25): /* typetoken ::= typename LP signed RP */
+ case uint32(27): /* typetoken ::= typename LP signed RP */
{
- (*Token)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-3)*12 + 4 /* &.minor */)).Fn = uint32(((int32(((*Token)(unsafe.Pointer(yymsp+4 /* &.minor */)).Fz + uintptr((*Token)(unsafe.Pointer(yymsp+4 /* &.minor */)).Fn))) - int32((*Token)(unsafe.Pointer(yymsp+libc.UintptrFromInt32(-3)*12+4 /* &.minor */)).Fz)) / 1))
+ (*Token)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-3)*12 + 4)).Fn = uint32((int32((*Token)(unsafe.Pointer(yymsp+4)).Fz+uintptr((*Token)(unsafe.Pointer(yymsp+4)).Fn)) - int32((*Token)(unsafe.Pointer(yymsp+libc.UintptrFromInt32(-3)*12+4)).Fz)) / 1)
}
break
- case uint32(26): /* typetoken ::= typename LP signed COMMA signed RP */
+ case uint32(28): /* typetoken ::= typename LP signed COMMA signed RP */
{
- (*Token)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-5)*12 + 4 /* &.minor */)).Fn = uint32(((int32(((*Token)(unsafe.Pointer(yymsp+4 /* &.minor */)).Fz + uintptr((*Token)(unsafe.Pointer(yymsp+4 /* &.minor */)).Fn))) - int32((*Token)(unsafe.Pointer(yymsp+libc.UintptrFromInt32(-5)*12+4 /* &.minor */)).Fz)) / 1))
+ (*Token)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-5)*12 + 4)).Fn = uint32((int32((*Token)(unsafe.Pointer(yymsp+4)).Fz+uintptr((*Token)(unsafe.Pointer(yymsp+4)).Fn)) - int32((*Token)(unsafe.Pointer(yymsp+libc.UintptrFromInt32(-5)*12+4)).Fz)) / 1)
}
break
- case uint32(27): /* typename ::= typename ID|STRING */
+ case uint32(29): /* typename ::= typename ID|STRING */
{
- (*Token)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*12 + 4 /* &.minor */)).Fn = ((*Token)(unsafe.Pointer(yymsp+4 /* &.minor */)).Fn + uint32(((int32((*Token)(unsafe.Pointer(yymsp+4 /* &.minor */)).Fz) - int32((*Token)(unsafe.Pointer(yymsp+libc.UintptrFromInt32(-1)*12+4 /* &.minor */)).Fz)) / 1)))
+ (*Token)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*12 + 4)).Fn = (*Token)(unsafe.Pointer(yymsp+4)).Fn + uint32((int32((*Token)(unsafe.Pointer(yymsp+4)).Fz)-int32((*Token)(unsafe.Pointer(yymsp+libc.UintptrFromInt32(-1)*12+4)).Fz))/1)
}
break
- case uint32(28): /* scanpt ::= */
+ case uint32(30): /* scanpt ::= */
{
- *(*uintptr)(unsafe.Pointer(yymsp + 1*12 + 4 /* &.minor */)) = yyLookaheadToken.Fz
+ *(*uintptr)(unsafe.Pointer(yymsp + 1*12 + 4)) = yyLookaheadToken.Fz
}
break
- case uint32(29): /* scantok ::= */
+ case uint32(31): /* scantok ::= */
{
- *(*Token)(unsafe.Pointer(yymsp + 1*12 + 4 /* &.minor */)) = yyLookaheadToken
+ *(*Token)(unsafe.Pointer(yymsp + 1*12 + 4)) = yyLookaheadToken
}
break
- case uint32(30):
+ case uint32(32):
fallthrough // ccons ::= CONSTRAINT nm
- case uint32(65): /* tcons ::= CONSTRAINT nm */
+ case uint32(67): /* tcons ::= CONSTRAINT nm */
{
- (*Parse)(unsafe.Pointer(pParse)).FconstraintName = *(*Token)(unsafe.Pointer(yymsp + 4 /* &.minor */))
+ (*Parse)(unsafe.Pointer(pParse)).FconstraintName = *(*Token)(unsafe.Pointer(yymsp + 4))
}
break
- case uint32(31): /* ccons ::= DEFAULT scantok term */
+ case uint32(33): /* ccons ::= DEFAULT scantok term */
{
- Xsqlite3AddDefaultValue(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + 4 /* &.minor */)), (*Token)(unsafe.Pointer(yymsp+libc.UintptrFromInt32(-1)*12+4 /* &.minor */)).Fz, ((*Token)(unsafe.Pointer(yymsp+libc.UintptrFromInt32(-1)*12+4 /* &.minor */)).Fz + uintptr((*Token)(unsafe.Pointer(yymsp+libc.UintptrFromInt32(-1)*12+4 /* &.minor */)).Fn)))
+ Xsqlite3AddDefaultValue(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + 4)), (*Token)(unsafe.Pointer(yymsp+libc.UintptrFromInt32(-1)*12+4)).Fz, (*Token)(unsafe.Pointer(yymsp+libc.UintptrFromInt32(-1)*12+4)).Fz+uintptr((*Token)(unsafe.Pointer(yymsp+libc.UintptrFromInt32(-1)*12+4)).Fn))
}
break
- case uint32(32): /* ccons ::= DEFAULT LP expr RP */
+ case uint32(34): /* ccons ::= DEFAULT LP expr RP */
{
- Xsqlite3AddDefaultValue(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*12 + 4 /* &.minor */)), ((*Token)(unsafe.Pointer(yymsp+libc.UintptrFromInt32(-2)*12+4 /* &.minor */)).Fz + uintptr(1)), (*Token)(unsafe.Pointer(yymsp+4 /* &.minor */)).Fz)
+ Xsqlite3AddDefaultValue(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*12 + 4)), (*Token)(unsafe.Pointer(yymsp+libc.UintptrFromInt32(-2)*12+4)).Fz+uintptr(1), (*Token)(unsafe.Pointer(yymsp+4)).Fz)
}
break
- case uint32(33): /* ccons ::= DEFAULT PLUS scantok term */
+ case uint32(35): /* ccons ::= DEFAULT PLUS scantok term */
{
- Xsqlite3AddDefaultValue(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + 4 /* &.minor */)), (*Token)(unsafe.Pointer(yymsp+libc.UintptrFromInt32(-2)*12+4 /* &.minor */)).Fz, ((*Token)(unsafe.Pointer(yymsp+libc.UintptrFromInt32(-1)*12+4 /* &.minor */)).Fz + uintptr((*Token)(unsafe.Pointer(yymsp+libc.UintptrFromInt32(-1)*12+4 /* &.minor */)).Fn)))
+ Xsqlite3AddDefaultValue(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + 4)), (*Token)(unsafe.Pointer(yymsp+libc.UintptrFromInt32(-2)*12+4)).Fz, (*Token)(unsafe.Pointer(yymsp+libc.UintptrFromInt32(-1)*12+4)).Fz+uintptr((*Token)(unsafe.Pointer(yymsp+libc.UintptrFromInt32(-1)*12+4)).Fn))
}
break
- case uint32(34): /* ccons ::= DEFAULT MINUS scantok term */
+ case uint32(36): /* ccons ::= DEFAULT MINUS scantok term */
{
- var p uintptr = Xsqlite3PExpr(tls, pParse, TK_UMINUS, *(*uintptr)(unsafe.Pointer(yymsp + 4 /* &.minor */)), uintptr(0))
- Xsqlite3AddDefaultValue(tls, pParse, p, (*Token)(unsafe.Pointer(yymsp+libc.UintptrFromInt32(-2)*12+4 /* &.minor */)).Fz, ((*Token)(unsafe.Pointer(yymsp+libc.UintptrFromInt32(-1)*12+4 /* &.minor */)).Fz + uintptr((*Token)(unsafe.Pointer(yymsp+libc.UintptrFromInt32(-1)*12+4 /* &.minor */)).Fn)))
+ var p uintptr = Xsqlite3PExpr(tls, pParse, TK_UMINUS, *(*uintptr)(unsafe.Pointer(yymsp + 4)), uintptr(0))
+ Xsqlite3AddDefaultValue(tls, pParse, p, (*Token)(unsafe.Pointer(yymsp+libc.UintptrFromInt32(-2)*12+4)).Fz, (*Token)(unsafe.Pointer(yymsp+libc.UintptrFromInt32(-1)*12+4)).Fz+uintptr((*Token)(unsafe.Pointer(yymsp+libc.UintptrFromInt32(-1)*12+4)).Fn))
}
break
- case uint32(35): /* ccons ::= DEFAULT scantok ID|INDEXED */
+ case uint32(37): /* ccons ::= DEFAULT scantok ID|INDEXED */
{
- var p uintptr = tokenExpr(tls, pParse, TK_STRING, *(*Token)(unsafe.Pointer(yymsp + 4 /* &.minor */)))
+ var p uintptr = tokenExpr(tls, pParse, TK_STRING, *(*Token)(unsafe.Pointer(yymsp + 4)))
if p != 0 {
Xsqlite3ExprIdToTrueFalse(tls, p)
}
- Xsqlite3AddDefaultValue(tls, pParse, p, (*Token)(unsafe.Pointer(yymsp+4 /* &.minor */)).Fz, ((*Token)(unsafe.Pointer(yymsp+4 /* &.minor */)).Fz + uintptr((*Token)(unsafe.Pointer(yymsp+4 /* &.minor */)).Fn)))
+ Xsqlite3AddDefaultValue(tls, pParse, p, (*Token)(unsafe.Pointer(yymsp+4)).Fz, (*Token)(unsafe.Pointer(yymsp+4)).Fz+uintptr((*Token)(unsafe.Pointer(yymsp+4)).Fn))
}
break
- case uint32(36): /* ccons ::= NOT NULL onconf */
+ case uint32(38): /* ccons ::= NOT NULL onconf */
{
- Xsqlite3AddNotNull(tls, pParse, *(*int32)(unsafe.Pointer(yymsp + 4 /* &.minor */)))
+ Xsqlite3AddNotNull(tls, pParse, *(*int32)(unsafe.Pointer(yymsp + 4)))
}
break
- case uint32(37): /* ccons ::= PRIMARY KEY sortorder onconf autoinc */
+ case uint32(39): /* ccons ::= PRIMARY KEY sortorder onconf autoinc */
{
- Xsqlite3AddPrimaryKey(tls, pParse, uintptr(0), *(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*12 + 4 /* &.minor */)), *(*int32)(unsafe.Pointer(yymsp + 4 /* &.minor */)), *(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*12 + 4 /* &.minor */)))
+ Xsqlite3AddPrimaryKey(tls, pParse, uintptr(0), *(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*12 + 4)), *(*int32)(unsafe.Pointer(yymsp + 4)), *(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*12 + 4)))
}
break
- case uint32(38): /* ccons ::= UNIQUE onconf */
+ case uint32(40): /* ccons ::= UNIQUE onconf */
{
- Xsqlite3CreateIndex(tls, pParse, uintptr(0), uintptr(0), uintptr(0), uintptr(0), *(*int32)(unsafe.Pointer(yymsp + 4 /* &.minor */)), uintptr(0), uintptr(0), 0, 0,
+ Xsqlite3CreateIndex(tls, pParse, uintptr(0), uintptr(0), uintptr(0), uintptr(0), *(*int32)(unsafe.Pointer(yymsp + 4)), uintptr(0), uintptr(0), 0, 0,
uint8(SQLITE_IDXTYPE_UNIQUE))
}
break
- case uint32(39): /* ccons ::= CHECK LP expr RP */
+ case uint32(41): /* ccons ::= CHECK LP expr RP */
{
- Xsqlite3AddCheckConstraint(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*12 + 4 /* &.minor */)), (*Token)(unsafe.Pointer(yymsp+libc.UintptrFromInt32(-2)*12+4 /* &.minor */)).Fz, (*Token)(unsafe.Pointer(yymsp+4 /* &.minor */)).Fz)
+ Xsqlite3AddCheckConstraint(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*12 + 4)), (*Token)(unsafe.Pointer(yymsp+libc.UintptrFromInt32(-2)*12+4)).Fz, (*Token)(unsafe.Pointer(yymsp+4)).Fz)
}
break
- case uint32(40): /* ccons ::= REFERENCES nm eidlist_opt refargs */
+ case uint32(42): /* ccons ::= REFERENCES nm eidlist_opt refargs */
{
- Xsqlite3CreateForeignKey(tls, pParse, uintptr(0), (yymsp + libc.UintptrFromInt32(-2)*12 + 4 /* &.minor */ /* &.yy0 */), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*12 + 4 /* &.minor */)), *(*int32)(unsafe.Pointer(yymsp + 4 /* &.minor */)))
+ Xsqlite3CreateForeignKey(tls, pParse, uintptr(0), yymsp+libc.UintptrFromInt32(-2)*12+4, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*12 + 4)), *(*int32)(unsafe.Pointer(yymsp + 4)))
}
break
- case uint32(41): /* ccons ::= defer_subclause */
+ case uint32(43): /* ccons ::= defer_subclause */
{
- Xsqlite3DeferForeignKey(tls, pParse, *(*int32)(unsafe.Pointer(yymsp + 4 /* &.minor */)))
+ Xsqlite3DeferForeignKey(tls, pParse, *(*int32)(unsafe.Pointer(yymsp + 4)))
}
break
- case uint32(42): /* ccons ::= COLLATE ID|STRING */
+ case uint32(44): /* ccons ::= COLLATE ID|STRING */
{
- Xsqlite3AddCollateType(tls, pParse, (yymsp + 4 /* &.minor */ /* &.yy0 */))
+ Xsqlite3AddCollateType(tls, pParse, yymsp+4)
}
break
- case uint32(43): /* generated ::= LP expr RP */
+ case uint32(45): /* generated ::= LP expr RP */
{
- Xsqlite3AddGenerated(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*12 + 4 /* &.minor */)), uintptr(0))
+ Xsqlite3AddGenerated(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*12 + 4)), uintptr(0))
}
break
- case uint32(44): /* generated ::= LP expr RP ID */
+ case uint32(46): /* generated ::= LP expr RP ID */
{
- Xsqlite3AddGenerated(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*12 + 4 /* &.minor */)), (yymsp + 4 /* &.minor */ /* &.yy0 */))
+ Xsqlite3AddGenerated(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*12 + 4)), yymsp+4)
}
break
- case uint32(46): /* autoinc ::= AUTOINCR */
+ case uint32(48): /* autoinc ::= AUTOINCR */
{
- *(*int32)(unsafe.Pointer(yymsp + 4 /* &.minor */)) = 1
+ *(*int32)(unsafe.Pointer(yymsp + 4)) = 1
}
break
- case uint32(47): /* refargs ::= */
+ case uint32(49): /* refargs ::= */
{
- *(*int32)(unsafe.Pointer(yymsp + 1*12 + 4 /* &.minor */)) = (OE_None * 0x0101) /* EV: R-19803-45884 */
+ *(*int32)(unsafe.Pointer(yymsp + 1*12 + 4)) = OE_None * 0x0101 /* EV: R-19803-45884 */
}
break
- case uint32(48): /* refargs ::= refargs refarg */
+ case uint32(50): /* refargs ::= refargs refarg */
{
- *(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*12 + 4 /* &.minor */)) = ((*(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*12 + 4 /* &.minor */)) & ^*(*int32)(unsafe.Pointer((yymsp + 4 /* &.minor */ /* &.yy139 */) + 4 /* &.mask */))) | *(*int32)(unsafe.Pointer((yymsp + 4 /* &.minor */ /* &.yy139 */) /* &.value */)))
+ *(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*12 + 4)) = *(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*12 + 4)) & ^*(*int32)(unsafe.Pointer(yymsp + 4 + 4)) | *(*int32)(unsafe.Pointer(yymsp + 4))
}
break
- case uint32(49): /* refarg ::= MATCH nm */
+ case uint32(51): /* refarg ::= MATCH nm */
{
- *(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*12 + 4 /* &.minor */ /* &.yy139 */ /* &.value */)) = 0
- *(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*12 + 4 /* &.minor */ /* &.yy139 */ + 4 /* &.mask */)) = 0x000000
+ *(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*12 + 4)) = 0
+ *(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*12 + 4 + 4 /* &.mask */)) = 0x000000
}
break
- case uint32(50): /* refarg ::= ON INSERT refact */
+ case uint32(52): /* refarg ::= ON INSERT refact */
{
- *(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*12 + 4 /* &.minor */ /* &.yy139 */ /* &.value */)) = 0
- *(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*12 + 4 /* &.minor */ /* &.yy139 */ + 4 /* &.mask */)) = 0x000000
+ *(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*12 + 4)) = 0
+ *(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*12 + 4 + 4 /* &.mask */)) = 0x000000
}
break
- case uint32(51): /* refarg ::= ON DELETE refact */
+ case uint32(53): /* refarg ::= ON DELETE refact */
{
- *(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*12 + 4 /* &.minor */ /* &.yy139 */ /* &.value */)) = *(*int32)(unsafe.Pointer(yymsp + 4 /* &.minor */))
- *(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*12 + 4 /* &.minor */ /* &.yy139 */ + 4 /* &.mask */)) = 0x0000ff
+ *(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*12 + 4)) = *(*int32)(unsafe.Pointer(yymsp + 4))
+ *(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*12 + 4 + 4 /* &.mask */)) = 0x0000ff
}
break
- case uint32(52): /* refarg ::= ON UPDATE refact */
+ case uint32(54): /* refarg ::= ON UPDATE refact */
{
- *(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*12 + 4 /* &.minor */ /* &.yy139 */ /* &.value */)) = (*(*int32)(unsafe.Pointer(yymsp + 4 /* &.minor */)) << 8)
- *(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*12 + 4 /* &.minor */ /* &.yy139 */ + 4 /* &.mask */)) = 0x00ff00
+ *(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*12 + 4)) = *(*int32)(unsafe.Pointer(yymsp + 4)) << 8
+ *(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*12 + 4 + 4 /* &.mask */)) = 0x00ff00
}
break
- case uint32(53): /* refact ::= SET NULL */
+ case uint32(55): /* refact ::= SET NULL */
{
- *(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*12 + 4 /* &.minor */)) = OE_SetNull /* EV: R-33326-45252 */
+ *(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*12 + 4)) = OE_SetNull /* EV: R-33326-45252 */
}
break
- case uint32(54): /* refact ::= SET DEFAULT */
+ case uint32(56): /* refact ::= SET DEFAULT */
{
- *(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*12 + 4 /* &.minor */)) = OE_SetDflt /* EV: R-33326-45252 */
+ *(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*12 + 4)) = OE_SetDflt /* EV: R-33326-45252 */
}
break
- case uint32(55): /* refact ::= CASCADE */
+ case uint32(57): /* refact ::= CASCADE */
{
- *(*int32)(unsafe.Pointer(yymsp + 4 /* &.minor */)) = OE_Cascade /* EV: R-33326-45252 */
+ *(*int32)(unsafe.Pointer(yymsp + 4)) = OE_Cascade /* EV: R-33326-45252 */
}
break
- case uint32(56): /* refact ::= RESTRICT */
+ case uint32(58): /* refact ::= RESTRICT */
{
- *(*int32)(unsafe.Pointer(yymsp + 4 /* &.minor */)) = OE_Restrict /* EV: R-33326-45252 */
+ *(*int32)(unsafe.Pointer(yymsp + 4)) = OE_Restrict /* EV: R-33326-45252 */
}
break
- case uint32(57): /* refact ::= NO ACTION */
+ case uint32(59): /* refact ::= NO ACTION */
{
- *(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*12 + 4 /* &.minor */)) = OE_None /* EV: R-33326-45252 */
+ *(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*12 + 4)) = OE_None /* EV: R-33326-45252 */
}
break
- case uint32(58): /* defer_subclause ::= NOT DEFERRABLE init_deferred_pred_opt */
+ case uint32(60): /* defer_subclause ::= NOT DEFERRABLE init_deferred_pred_opt */
{
- *(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*12 + 4 /* &.minor */)) = 0
+ *(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*12 + 4)) = 0
}
break
- case uint32(59):
+ case uint32(61):
fallthrough // defer_subclause ::= DEFERRABLE init_deferred_pred_opt
- case uint32(74): /* orconf ::= OR resolvetype */
+ case uint32(76): /* orconf ::= OR resolvetype */
fallthrough
- case uint32(169): /* insert_cmd ::= INSERT orconf */
+ case uint32(171): /* insert_cmd ::= INSERT orconf */
{
- *(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*12 + 4 /* &.minor */)) = *(*int32)(unsafe.Pointer(yymsp + 4 /* &.minor */))
+ *(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*12 + 4)) = *(*int32)(unsafe.Pointer(yymsp + 4))
}
break
- case uint32(61):
+ case uint32(63):
fallthrough // init_deferred_pred_opt ::= INITIALLY DEFERRED
- case uint32(78): /* ifexists ::= IF EXISTS */
+ case uint32(80): /* ifexists ::= IF EXISTS */
fallthrough
- case uint32(211): /* between_op ::= NOT BETWEEN */
+ case uint32(213): /* between_op ::= NOT BETWEEN */
fallthrough
- case uint32(214): /* in_op ::= NOT IN */
+ case uint32(216): /* in_op ::= NOT IN */
fallthrough
- case uint32(240): /* collate ::= COLLATE ID|STRING */
+ case uint32(242): /* collate ::= COLLATE ID|STRING */
{
- *(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*12 + 4 /* &.minor */)) = 1
+ *(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*12 + 4)) = 1
}
break
- case uint32(62): /* init_deferred_pred_opt ::= INITIALLY IMMEDIATE */
+ case uint32(64): /* init_deferred_pred_opt ::= INITIALLY IMMEDIATE */
{
- *(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*12 + 4 /* &.minor */)) = 0
+ *(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*12 + 4)) = 0
}
break
- case uint32(64): /* tconscomma ::= COMMA */
+ case uint32(66): /* tconscomma ::= COMMA */
{
(*Parse)(unsafe.Pointer(pParse)).FconstraintName.Fn = uint32(0)
}
break
- case uint32(66): /* tcons ::= PRIMARY KEY LP sortlist autoinc RP onconf */
+ case uint32(68): /* tcons ::= PRIMARY KEY LP sortlist autoinc RP onconf */
{
- Xsqlite3AddPrimaryKey(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-3)*12 + 4 /* &.minor */)), *(*int32)(unsafe.Pointer(yymsp + 4 /* &.minor */)), *(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*12 + 4 /* &.minor */)), 0)
+ Xsqlite3AddPrimaryKey(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-3)*12 + 4)), *(*int32)(unsafe.Pointer(yymsp + 4)), *(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*12 + 4)), 0)
}
break
- case uint32(67): /* tcons ::= UNIQUE LP sortlist RP onconf */
+ case uint32(69): /* tcons ::= UNIQUE LP sortlist RP onconf */
{
- Xsqlite3CreateIndex(tls, pParse, uintptr(0), uintptr(0), uintptr(0), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*12 + 4 /* &.minor */)), *(*int32)(unsafe.Pointer(yymsp + 4 /* &.minor */)), uintptr(0), uintptr(0), 0, 0,
+ Xsqlite3CreateIndex(tls, pParse, uintptr(0), uintptr(0), uintptr(0), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*12 + 4)), *(*int32)(unsafe.Pointer(yymsp + 4)), uintptr(0), uintptr(0), 0, 0,
uint8(SQLITE_IDXTYPE_UNIQUE))
}
break
- case uint32(68): /* tcons ::= CHECK LP expr RP onconf */
+ case uint32(70): /* tcons ::= CHECK LP expr RP onconf */
{
- Xsqlite3AddCheckConstraint(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*12 + 4 /* &.minor */)), (*Token)(unsafe.Pointer(yymsp+libc.UintptrFromInt32(-3)*12+4 /* &.minor */)).Fz, (*Token)(unsafe.Pointer(yymsp+libc.UintptrFromInt32(-1)*12+4 /* &.minor */)).Fz)
+ Xsqlite3AddCheckConstraint(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*12 + 4)), (*Token)(unsafe.Pointer(yymsp+libc.UintptrFromInt32(-3)*12+4)).Fz, (*Token)(unsafe.Pointer(yymsp+libc.UintptrFromInt32(-1)*12+4)).Fz)
}
break
- case uint32(69): /* tcons ::= FOREIGN KEY LP eidlist RP REFERENCES nm eidlist_opt refargs defer_subclause_opt */
+ case uint32(71): /* tcons ::= FOREIGN KEY LP eidlist RP REFERENCES nm eidlist_opt refargs defer_subclause_opt */
{
- Xsqlite3CreateForeignKey(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-6)*12 + 4 /* &.minor */)), (yymsp + libc.UintptrFromInt32(-3)*12 + 4 /* &.minor */ /* &.yy0 */), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*12 + 4 /* &.minor */)), *(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*12 + 4 /* &.minor */)))
- Xsqlite3DeferForeignKey(tls, pParse, *(*int32)(unsafe.Pointer(yymsp + 4 /* &.minor */)))
+ Xsqlite3CreateForeignKey(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-6)*12 + 4)), yymsp+libc.UintptrFromInt32(-3)*12+4, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*12 + 4)), *(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*12 + 4)))
+ Xsqlite3DeferForeignKey(tls, pParse, *(*int32)(unsafe.Pointer(yymsp + 4)))
}
break
- case uint32(71):
+ case uint32(73):
fallthrough // onconf ::=
- case uint32(73): /* orconf ::= */
+ case uint32(75): /* orconf ::= */
{
- *(*int32)(unsafe.Pointer(yymsp + 1*12 + 4 /* &.minor */)) = OE_Default
+ *(*int32)(unsafe.Pointer(yymsp + 1*12 + 4)) = OE_Default
}
break
- case uint32(72): /* onconf ::= ON CONFLICT resolvetype */
+ case uint32(74): /* onconf ::= ON CONFLICT resolvetype */
{
- *(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*12 + 4 /* &.minor */)) = *(*int32)(unsafe.Pointer(yymsp + 4 /* &.minor */))
+ *(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*12 + 4)) = *(*int32)(unsafe.Pointer(yymsp + 4))
}
break
- case uint32(75): /* resolvetype ::= IGNORE */
+ case uint32(77): /* resolvetype ::= IGNORE */
{
- *(*int32)(unsafe.Pointer(yymsp + 4 /* &.minor */)) = OE_Ignore
+ *(*int32)(unsafe.Pointer(yymsp + 4)) = OE_Ignore
}
break
- case uint32(76):
+ case uint32(78):
fallthrough // resolvetype ::= REPLACE
- case uint32(170): /* insert_cmd ::= REPLACE */
+ case uint32(172): /* insert_cmd ::= REPLACE */
{
- *(*int32)(unsafe.Pointer(yymsp + 4 /* &.minor */)) = OE_Replace
+ *(*int32)(unsafe.Pointer(yymsp + 4)) = OE_Replace
}
break
- case uint32(77): /* cmd ::= DROP TABLE ifexists fullname */
+ case uint32(79): /* cmd ::= DROP TABLE ifexists fullname */
{
- Xsqlite3DropTable(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + 4 /* &.minor */)), 0, *(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*12 + 4 /* &.minor */)))
+ Xsqlite3DropTable(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + 4)), 0, *(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*12 + 4)))
}
break
- case uint32(80): /* cmd ::= createkw temp VIEW ifnotexists nm dbnm eidlist_opt AS select */
+ case uint32(82): /* cmd ::= createkw temp VIEW ifnotexists nm dbnm eidlist_opt AS select */
{
- Xsqlite3CreateView(tls, pParse, (yymsp + libc.UintptrFromInt32(-8)*12 + 4 /* &.minor */ /* &.yy0 */), (yymsp + libc.UintptrFromInt32(-4)*12 + 4 /* &.minor */ /* &.yy0 */), (yymsp + libc.UintptrFromInt32(-3)*12 + 4 /* &.minor */ /* &.yy0 */), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*12 + 4 /* &.minor */)), *(*uintptr)(unsafe.Pointer(yymsp + 4 /* &.minor */)), *(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-7)*12 + 4 /* &.minor */)), *(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-5)*12 + 4 /* &.minor */)))
+ Xsqlite3CreateView(tls, pParse, yymsp+libc.UintptrFromInt32(-8)*12+4, yymsp+libc.UintptrFromInt32(-4)*12+4, yymsp+libc.UintptrFromInt32(-3)*12+4, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*12 + 4)), *(*uintptr)(unsafe.Pointer(yymsp + 4)), *(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-7)*12 + 4)), *(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-5)*12 + 4)))
}
break
- case uint32(81): /* cmd ::= DROP VIEW ifexists fullname */
+ case uint32(83): /* cmd ::= DROP VIEW ifexists fullname */
{
- Xsqlite3DropTable(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + 4 /* &.minor */)), 1, *(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*12 + 4 /* &.minor */)))
+ Xsqlite3DropTable(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + 4)), 1, *(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*12 + 4)))
}
break
- case uint32(82): /* cmd ::= select */
+ case uint32(84): /* cmd ::= select */
{
- *(*SelectDest)(unsafe.Pointer(bp + 24 /* dest */)) = SelectDest{FeDest: U8(SRT_Output)}
- Xsqlite3Select(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + 4 /* &.minor */)), bp+24 /* &dest */)
- Xsqlite3SelectDelete(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, *(*uintptr)(unsafe.Pointer(yymsp + 4 /* &.minor */)))
+ *(*SelectDest)(unsafe.Pointer(bp + 48 /* dest */)) = SelectDest{FeDest: U8(SRT_Output)}
+ Xsqlite3Select(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + 4)), bp+48 /* &dest */)
+ Xsqlite3SelectDelete(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, *(*uintptr)(unsafe.Pointer(yymsp + 4)))
}
break
- case uint32(83): /* select ::= WITH wqlist selectnowith */
+ case uint32(85): /* select ::= WITH wqlist selectnowith */
{
- *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*12 + 4 /* &.minor */)) = attachWithToSelect(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + 4 /* &.minor */)), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*12 + 4 /* &.minor */)))
+ *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*12 + 4)) = attachWithToSelect(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + 4)), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*12 + 4)))
}
break
- case uint32(84): /* select ::= WITH RECURSIVE wqlist selectnowith */
+ case uint32(86): /* select ::= WITH RECURSIVE wqlist selectnowith */
{
- *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-3)*12 + 4 /* &.minor */)) = attachWithToSelect(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + 4 /* &.minor */)), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*12 + 4 /* &.minor */)))
+ *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-3)*12 + 4)) = attachWithToSelect(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + 4)), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*12 + 4)))
}
break
- case uint32(85): /* select ::= selectnowith */
+ case uint32(87): /* select ::= selectnowith */
{
- var p uintptr = *(*uintptr)(unsafe.Pointer(yymsp + 4 /* &.minor */))
+ var p uintptr = *(*uintptr)(unsafe.Pointer(yymsp + 4))
if p != 0 {
parserDoubleLinkSelect(tls, pParse, p)
}
- *(*uintptr)(unsafe.Pointer(yymsp + 4 /* &.minor */)) = p //A-overwrites-X
+ *(*uintptr)(unsafe.Pointer(yymsp + 4)) = p //A-overwrites-X
}
break
- case uint32(86): /* selectnowith ::= selectnowith multiselect_op oneselect */
+ case uint32(88): /* selectnowith ::= selectnowith multiselect_op oneselect */
{
- var pRhs uintptr = *(*uintptr)(unsafe.Pointer(yymsp + 4 /* &.minor */))
- var pLhs uintptr = *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*12 + 4 /* &.minor */))
- if (pRhs != 0) && ((*Select)(unsafe.Pointer(pRhs)).FpPrior != 0) {
+ var pRhs uintptr = *(*uintptr)(unsafe.Pointer(yymsp + 4))
+ var pLhs uintptr = *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*12 + 4))
+ if pRhs != 0 && (*Select)(unsafe.Pointer(pRhs)).FpPrior != 0 {
var pFrom uintptr
- // var x Token at bp+52, 8
+ // var x Token at bp+76, 8
- (*Token)(unsafe.Pointer(bp + 52 /* &x */)).Fn = uint32(0)
+ (*Token)(unsafe.Pointer(bp + 76 /* &x */)).Fn = uint32(0)
parserDoubleLinkSelect(tls, pParse, pRhs)
- pFrom = Xsqlite3SrcListAppendFromTerm(tls, pParse, uintptr(0), uintptr(0), uintptr(0), bp+52 /* &x */, pRhs, uintptr(0), uintptr(0))
+ pFrom = Xsqlite3SrcListAppendFromTerm(tls, pParse, uintptr(0), uintptr(0), uintptr(0), bp+76 /* &x */, pRhs, uintptr(0), uintptr(0))
pRhs = Xsqlite3SelectNew(tls, pParse, uintptr(0), pFrom, uintptr(0), uintptr(0), uintptr(0), uintptr(0), uint32(0), uintptr(0))
}
if pRhs != 0 {
- (*Select)(unsafe.Pointer(pRhs)).Fop = U8(*(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*12 + 4 /* &.minor */)))
+ (*Select)(unsafe.Pointer(pRhs)).Fop = U8(*(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*12 + 4)))
(*Select)(unsafe.Pointer(pRhs)).FpPrior = pLhs
if pLhs != 0 {
- *(*U32)(unsafe.Pointer(pLhs + 4 /* &.selFlags */)) &= (libc.Uint32FromInt32(libc.CplInt32(SF_MultiValue)))
+ *(*U32)(unsafe.Pointer(pLhs + 4)) &= libc.Uint32FromInt32(libc.CplInt32(SF_MultiValue))
}
- *(*U32)(unsafe.Pointer(pRhs + 4 /* &.selFlags */)) &= (libc.Uint32FromInt32(libc.CplInt32(SF_MultiValue)))
- if *(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*12 + 4 /* &.minor */)) != TK_ALL {
+ *(*U32)(unsafe.Pointer(pRhs + 4)) &= libc.Uint32FromInt32(libc.CplInt32(SF_MultiValue))
+ if *(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*12 + 4)) != TK_ALL {
(*Parse)(unsafe.Pointer(pParse)).FhasCompound = U8(1)
}
} else {
Xsqlite3SelectDelete(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, pLhs)
}
- *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*12 + 4 /* &.minor */)) = pRhs
+ *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*12 + 4)) = pRhs
}
break
- case uint32(87):
+ case uint32(89):
fallthrough // multiselect_op ::= UNION
- case uint32(89): /* multiselect_op ::= EXCEPT|INTERSECT */
+ case uint32(91): /* multiselect_op ::= EXCEPT|INTERSECT */
{
- *(*int32)(unsafe.Pointer(yymsp + 4 /* &.minor */)) = int32((*YyStackEntry)(unsafe.Pointer(yymsp)).Fmajor) /*A-overwrites-OP*/
+ *(*int32)(unsafe.Pointer(yymsp + 4)) = int32((*YyStackEntry)(unsafe.Pointer(yymsp)).Fmajor) /*A-overwrites-OP*/
}
break
- case uint32(88): /* multiselect_op ::= UNION ALL */
+ case uint32(90): /* multiselect_op ::= UNION ALL */
{
- *(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*12 + 4 /* &.minor */)) = TK_ALL
+ *(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*12 + 4)) = TK_ALL
}
break
- case uint32(90): /* oneselect ::= SELECT distinct selcollist from where_opt groupby_opt having_opt orderby_opt limit_opt */
+ case uint32(92): /* oneselect ::= SELECT distinct selcollist from where_opt groupby_opt having_opt orderby_opt limit_opt */
{
- *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-8)*12 + 4 /* &.minor */)) = Xsqlite3SelectNew(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-6)*12 + 4 /* &.minor */)), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-5)*12 + 4 /* &.minor */)), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*12 + 4 /* &.minor */)), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-3)*12 + 4 /* &.minor */)), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*12 + 4 /* &.minor */)), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*12 + 4 /* &.minor */)), uint32(*(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-7)*12 + 4 /* &.minor */))), *(*uintptr)(unsafe.Pointer(yymsp + 4 /* &.minor */)))
+ *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-8)*12 + 4)) = Xsqlite3SelectNew(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-6)*12 + 4)), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-5)*12 + 4)), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*12 + 4)), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-3)*12 + 4)), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*12 + 4)), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*12 + 4)), uint32(*(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-7)*12 + 4))), *(*uintptr)(unsafe.Pointer(yymsp + 4)))
}
break
- case uint32(91): /* oneselect ::= SELECT distinct selcollist from where_opt groupby_opt having_opt window_clause orderby_opt limit_opt */
+ case uint32(93): /* oneselect ::= SELECT distinct selcollist from where_opt groupby_opt having_opt window_clause orderby_opt limit_opt */
{
- *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-9)*12 + 4 /* &.minor */)) = Xsqlite3SelectNew(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-7)*12 + 4 /* &.minor */)), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-6)*12 + 4 /* &.minor */)), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-5)*12 + 4 /* &.minor */)), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*12 + 4 /* &.minor */)), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-3)*12 + 4 /* &.minor */)), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*12 + 4 /* &.minor */)), uint32(*(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-8)*12 + 4 /* &.minor */))), *(*uintptr)(unsafe.Pointer(yymsp + 4 /* &.minor */)))
- if *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-9)*12 + 4 /* &.minor */)) != 0 {
- (*Select)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-9)*12 + 4 /* &.minor */)))).FpWinDefn = *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*12 + 4 /* &.minor */))
+ *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-9)*12 + 4)) = Xsqlite3SelectNew(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-7)*12 + 4)), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-6)*12 + 4)), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-5)*12 + 4)), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*12 + 4)), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-3)*12 + 4)), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*12 + 4)), uint32(*(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-8)*12 + 4))), *(*uintptr)(unsafe.Pointer(yymsp + 4)))
+ if *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-9)*12 + 4)) != 0 {
+ (*Select)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-9)*12 + 4)))).FpWinDefn = *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*12 + 4))
} else {
- Xsqlite3WindowListDelete(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*12 + 4 /* &.minor */)))
+ Xsqlite3WindowListDelete(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*12 + 4)))
}
}
break
- case uint32(92): /* values ::= VALUES LP nexprlist RP */
+ case uint32(94): /* values ::= VALUES LP nexprlist RP */
{
- *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-3)*12 + 4 /* &.minor */)) = Xsqlite3SelectNew(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*12 + 4 /* &.minor */)), uintptr(0), uintptr(0), uintptr(0), uintptr(0), uintptr(0), uint32(SF_Values), uintptr(0))
+ *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-3)*12 + 4)) = Xsqlite3SelectNew(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*12 + 4)), uintptr(0), uintptr(0), uintptr(0), uintptr(0), uintptr(0), uint32(SF_Values), uintptr(0))
}
break
- case uint32(93): /* values ::= values COMMA LP nexprlist RP */
+ case uint32(95): /* values ::= values COMMA LP nexprlist RP */
{
var pRight uintptr
- var pLeft uintptr = *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*12 + 4 /* &.minor */))
- pRight = Xsqlite3SelectNew(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*12 + 4 /* &.minor */)), uintptr(0), uintptr(0), uintptr(0), uintptr(0), uintptr(0), (uint32(SF_Values | SF_MultiValue)), uintptr(0))
+ var pLeft uintptr = *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*12 + 4))
+ pRight = Xsqlite3SelectNew(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*12 + 4)), uintptr(0), uintptr(0), uintptr(0), uintptr(0), uintptr(0), uint32(SF_Values|SF_MultiValue), uintptr(0))
if pLeft != 0 {
- *(*U32)(unsafe.Pointer(pLeft + 4 /* &.selFlags */)) &= (libc.Uint32FromInt32(libc.CplInt32(SF_MultiValue)))
+ *(*U32)(unsafe.Pointer(pLeft + 4)) &= libc.Uint32FromInt32(libc.CplInt32(SF_MultiValue))
}
if pRight != 0 {
(*Select)(unsafe.Pointer(pRight)).Fop = U8(TK_ALL)
(*Select)(unsafe.Pointer(pRight)).FpPrior = pLeft
- *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*12 + 4 /* &.minor */)) = pRight
+ *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*12 + 4)) = pRight
} else {
- *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*12 + 4 /* &.minor */)) = pLeft
+ *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*12 + 4)) = pLeft
}
}
break
- case uint32(94): /* distinct ::= DISTINCT */
+ case uint32(96): /* distinct ::= DISTINCT */
{
- *(*int32)(unsafe.Pointer(yymsp + 4 /* &.minor */)) = SF_Distinct
+ *(*int32)(unsafe.Pointer(yymsp + 4)) = SF_Distinct
}
break
- case uint32(95): /* distinct ::= ALL */
+ case uint32(97): /* distinct ::= ALL */
{
- *(*int32)(unsafe.Pointer(yymsp + 4 /* &.minor */)) = SF_All
+ *(*int32)(unsafe.Pointer(yymsp + 4)) = SF_All
}
break
- case uint32(97):
+ case uint32(99):
fallthrough // sclp ::=
- case uint32(130): /* orderby_opt ::= */
+ case uint32(132): /* orderby_opt ::= */
fallthrough
- case uint32(140): /* groupby_opt ::= */
+ case uint32(142): /* groupby_opt ::= */
fallthrough
- case uint32(227): /* exprlist ::= */
+ case uint32(229): /* exprlist ::= */
fallthrough
- case uint32(230): /* paren_exprlist ::= */
+ case uint32(232): /* paren_exprlist ::= */
fallthrough
- case uint32(235): /* eidlist_opt ::= */
+ case uint32(237): /* eidlist_opt ::= */
{
- *(*uintptr)(unsafe.Pointer(yymsp + 1*12 + 4 /* &.minor */)) = uintptr(0)
+ *(*uintptr)(unsafe.Pointer(yymsp + 1*12 + 4)) = uintptr(0)
}
break
- case uint32(98): /* selcollist ::= sclp scanpt expr scanpt as */
+ case uint32(100): /* selcollist ::= sclp scanpt expr scanpt as */
{
- *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*12 + 4 /* &.minor */)) = Xsqlite3ExprListAppend(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*12 + 4 /* &.minor */)), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*12 + 4 /* &.minor */)))
- if (*Token)(unsafe.Pointer(yymsp+4 /* &.minor */)).Fn > uint32(0) {
- Xsqlite3ExprListSetName(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*12 + 4 /* &.minor */)), (yymsp + 4 /* &.minor */ /* &.yy0 */), 1)
+ *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*12 + 4)) = Xsqlite3ExprListAppend(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*12 + 4)), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*12 + 4)))
+ if (*Token)(unsafe.Pointer(yymsp+4)).Fn > uint32(0) {
+ Xsqlite3ExprListSetName(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*12 + 4)), yymsp+4, 1)
}
- Xsqlite3ExprListSetSpan(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*12 + 4 /* &.minor */)), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-3)*12 + 4 /* &.minor */)), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*12 + 4 /* &.minor */)))
+ Xsqlite3ExprListSetSpan(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*12 + 4)), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-3)*12 + 4)), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*12 + 4)))
}
break
- case uint32(99): /* selcollist ::= sclp scanpt STAR */
+ case uint32(101): /* selcollist ::= sclp scanpt STAR */
{
var p uintptr = Xsqlite3Expr(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, TK_ASTERISK, uintptr(0))
- *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*12 + 4 /* &.minor */)) = Xsqlite3ExprListAppend(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*12 + 4 /* &.minor */)), p)
+ *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*12 + 4)) = Xsqlite3ExprListAppend(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*12 + 4)), p)
}
break
- case uint32(100): /* selcollist ::= sclp scanpt nm DOT STAR */
+ case uint32(102): /* selcollist ::= sclp scanpt nm DOT STAR */
{
var pRight uintptr = Xsqlite3PExpr(tls, pParse, TK_ASTERISK, uintptr(0), uintptr(0))
- var pLeft uintptr = Xsqlite3ExprAlloc(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, TK_ID, (yymsp + libc.UintptrFromInt32(-2)*12 + 4 /* &.minor */ /* &.yy0 */), 1)
+ var pLeft uintptr = Xsqlite3ExprAlloc(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, TK_ID, yymsp+libc.UintptrFromInt32(-2)*12+4, 1)
var pDot uintptr = Xsqlite3PExpr(tls, pParse, TK_DOT, pLeft, pRight)
- *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*12 + 4 /* &.minor */)) = Xsqlite3ExprListAppend(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*12 + 4 /* &.minor */)), pDot)
+ *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*12 + 4)) = Xsqlite3ExprListAppend(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*12 + 4)), pDot)
}
break
- case uint32(101):
+ case uint32(103):
fallthrough // as ::= AS nm
- case uint32(112): /* dbnm ::= DOT nm */
+ case uint32(114): /* dbnm ::= DOT nm */
fallthrough
- case uint32(251): /* plus_num ::= PLUS INTEGER|FLOAT */
+ case uint32(253): /* plus_num ::= PLUS INTEGER|FLOAT */
fallthrough
- case uint32(252): /* minus_num ::= MINUS INTEGER|FLOAT */
+ case uint32(254): /* minus_num ::= MINUS INTEGER|FLOAT */
{
- *(*Token)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*12 + 4 /* &.minor */)) = *(*Token)(unsafe.Pointer(yymsp + 4 /* &.minor */))
+ *(*Token)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*12 + 4)) = *(*Token)(unsafe.Pointer(yymsp + 4))
}
break
- case uint32(103):
+ case uint32(105):
fallthrough // from ::=
- case uint32(106): /* stl_prefix ::= */
+ case uint32(108): /* stl_prefix ::= */
{
- *(*uintptr)(unsafe.Pointer(yymsp + 1*12 + 4 /* &.minor */)) = uintptr(0)
+ *(*uintptr)(unsafe.Pointer(yymsp + 1*12 + 4)) = uintptr(0)
}
break
- case uint32(104): /* from ::= FROM seltablist */
+ case uint32(106): /* from ::= FROM seltablist */
{
- *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*12 + 4 /* &.minor */)) = *(*uintptr)(unsafe.Pointer(yymsp + 4 /* &.minor */))
- Xsqlite3SrcListShiftJoinType(tls, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*12 + 4 /* &.minor */)))
+ *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*12 + 4)) = *(*uintptr)(unsafe.Pointer(yymsp + 4))
+ Xsqlite3SrcListShiftJoinType(tls, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*12 + 4)))
}
break
- case uint32(105): /* stl_prefix ::= seltablist joinop */
+ case uint32(107): /* stl_prefix ::= seltablist joinop */
{
- if (*(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*12 + 4 /* &.minor */)) != 0) && ((*SrcList)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*12 + 4 /* &.minor */)))).FnSrc > 0) {
- (*SrcItem)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*12 + 4 /* &.minor */)) + 8 /* &.a */) + uintptr(((*SrcList)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*12 + 4 /* &.minor */)))).FnSrc-1))*72)).Ffg.Fjointype = U8(*(*int32)(unsafe.Pointer(yymsp + 4 /* &.minor */)))
+ if *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*12 + 4)) != 0 && (*SrcList)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*12 + 4)))).FnSrc > 0 {
+ (*SrcItem)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*12 + 4)) + 8 + uintptr((*SrcList)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*12 + 4)))).FnSrc-1)*72)).Ffg.Fjointype = U8(*(*int32)(unsafe.Pointer(yymsp + 4)))
}
}
break
- case uint32(107): /* seltablist ::= stl_prefix nm dbnm as indexed_opt on_opt using_opt */
+ case uint32(109): /* seltablist ::= stl_prefix nm dbnm as indexed_opt on_opt using_opt */
{
- *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-6)*12 + 4 /* &.minor */)) = Xsqlite3SrcListAppendFromTerm(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-6)*12 + 4 /* &.minor */)), (yymsp + libc.UintptrFromInt32(-5)*12 + 4 /* &.minor */ /* &.yy0 */), (yymsp + libc.UintptrFromInt32(-4)*12 + 4 /* &.minor */ /* &.yy0 */), (yymsp + libc.UintptrFromInt32(-3)*12 + 4 /* &.minor */ /* &.yy0 */), uintptr(0), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*12 + 4 /* &.minor */)), *(*uintptr)(unsafe.Pointer(yymsp + 4 /* &.minor */)))
- Xsqlite3SrcListIndexedBy(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-6)*12 + 4 /* &.minor */)), (yymsp + libc.UintptrFromInt32(-2)*12 + 4 /* &.minor */ /* &.yy0 */))
+ *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-6)*12 + 4)) = Xsqlite3SrcListAppendFromTerm(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-6)*12 + 4)), yymsp+libc.UintptrFromInt32(-5)*12+4, yymsp+libc.UintptrFromInt32(-4)*12+4, yymsp+libc.UintptrFromInt32(-3)*12+4, uintptr(0), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*12 + 4)), *(*uintptr)(unsafe.Pointer(yymsp + 4)))
+ Xsqlite3SrcListIndexedBy(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-6)*12 + 4)), yymsp+libc.UintptrFromInt32(-2)*12+4)
}
break
- case uint32(108): /* seltablist ::= stl_prefix nm dbnm LP exprlist RP as on_opt using_opt */
+ case uint32(110): /* seltablist ::= stl_prefix nm dbnm LP exprlist RP as on_opt using_opt */
{
- *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-8)*12 + 4 /* &.minor */)) = Xsqlite3SrcListAppendFromTerm(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-8)*12 + 4 /* &.minor */)), (yymsp + libc.UintptrFromInt32(-7)*12 + 4 /* &.minor */ /* &.yy0 */), (yymsp + libc.UintptrFromInt32(-6)*12 + 4 /* &.minor */ /* &.yy0 */), (yymsp + libc.UintptrFromInt32(-2)*12 + 4 /* &.minor */ /* &.yy0 */), uintptr(0), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*12 + 4 /* &.minor */)), *(*uintptr)(unsafe.Pointer(yymsp + 4 /* &.minor */)))
- Xsqlite3SrcListFuncArgs(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-8)*12 + 4 /* &.minor */)), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*12 + 4 /* &.minor */)))
+ *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-8)*12 + 4)) = Xsqlite3SrcListAppendFromTerm(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-8)*12 + 4)), yymsp+libc.UintptrFromInt32(-7)*12+4, yymsp+libc.UintptrFromInt32(-6)*12+4, yymsp+libc.UintptrFromInt32(-2)*12+4, uintptr(0), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*12 + 4)), *(*uintptr)(unsafe.Pointer(yymsp + 4)))
+ Xsqlite3SrcListFuncArgs(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-8)*12 + 4)), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*12 + 4)))
}
break
- case uint32(109): /* seltablist ::= stl_prefix LP select RP as on_opt using_opt */
+ case uint32(111): /* seltablist ::= stl_prefix LP select RP as on_opt using_opt */
{
- *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-6)*12 + 4 /* &.minor */)) = Xsqlite3SrcListAppendFromTerm(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-6)*12 + 4 /* &.minor */)), uintptr(0), uintptr(0), (yymsp + libc.UintptrFromInt32(-2)*12 + 4 /* &.minor */ /* &.yy0 */), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*12 + 4 /* &.minor */)), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*12 + 4 /* &.minor */)), *(*uintptr)(unsafe.Pointer(yymsp + 4 /* &.minor */)))
+ *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-6)*12 + 4)) = Xsqlite3SrcListAppendFromTerm(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-6)*12 + 4)), uintptr(0), uintptr(0), yymsp+libc.UintptrFromInt32(-2)*12+4, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*12 + 4)), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*12 + 4)), *(*uintptr)(unsafe.Pointer(yymsp + 4)))
}
break
- case uint32(110): /* seltablist ::= stl_prefix LP seltablist RP as on_opt using_opt */
- {
- if (((*(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-6)*12 + 4 /* &.minor */)) == uintptr(0)) && ((*Token)(unsafe.Pointer(yymsp+libc.UintptrFromInt32(-2)*12+4 /* &.minor */)).Fn == uint32(0))) && (*(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*12 + 4 /* &.minor */)) == uintptr(0))) && (*(*uintptr)(unsafe.Pointer(yymsp + 4 /* &.minor */)) == uintptr(0)) {
- *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-6)*12 + 4 /* &.minor */)) = *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*12 + 4 /* &.minor */))
- } else if (*SrcList)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*12 + 4 /* &.minor */)))).FnSrc == 1 {
- *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-6)*12 + 4 /* &.minor */)) = Xsqlite3SrcListAppendFromTerm(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-6)*12 + 4 /* &.minor */)), uintptr(0), uintptr(0), (yymsp + libc.UintptrFromInt32(-2)*12 + 4 /* &.minor */ /* &.yy0 */), uintptr(0), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*12 + 4 /* &.minor */)), *(*uintptr)(unsafe.Pointer(yymsp + 4 /* &.minor */)))
- if *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-6)*12 + 4 /* &.minor */)) != 0 {
- var pNew uintptr = ((*(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-6)*12 + 4 /* &.minor */)) + 8 /* &.a */) + uintptr(((*SrcList)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-6)*12 + 4 /* &.minor */)))).FnSrc-1))*72)
- var pOld uintptr = *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*12 + 4 /* &.minor */)) + 8 /* &.a */
+ case uint32(112): /* seltablist ::= stl_prefix LP seltablist RP as on_opt using_opt */
+ {
+ if *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-6)*12 + 4)) == uintptr(0) && (*Token)(unsafe.Pointer(yymsp+libc.UintptrFromInt32(-2)*12+4)).Fn == uint32(0) && *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*12 + 4)) == uintptr(0) && *(*uintptr)(unsafe.Pointer(yymsp + 4)) == uintptr(0) {
+ *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-6)*12 + 4)) = *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*12 + 4))
+ } else if (*SrcList)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*12 + 4)))).FnSrc == 1 {
+ *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-6)*12 + 4)) = Xsqlite3SrcListAppendFromTerm(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-6)*12 + 4)), uintptr(0), uintptr(0), yymsp+libc.UintptrFromInt32(-2)*12+4, uintptr(0), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*12 + 4)), *(*uintptr)(unsafe.Pointer(yymsp + 4)))
+ if *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-6)*12 + 4)) != 0 {
+ var pNew uintptr = *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-6)*12 + 4)) + 8 + uintptr((*SrcList)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-6)*12 + 4)))).FnSrc-1)*72
+ var pOld uintptr = *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*12 + 4)) + 8 /* &.a */
(*SrcItem)(unsafe.Pointer(pNew)).FzName = (*SrcItem)(unsafe.Pointer(pOld)).FzName
(*SrcItem)(unsafe.Pointer(pNew)).FzDatabase = (*SrcItem)(unsafe.Pointer(pOld)).FzDatabase
(*SrcItem)(unsafe.Pointer(pNew)).FpSelect = (*SrcItem)(unsafe.Pointer(pOld)).FpSelect
- if (uint32(int32(*(*uint16)(unsafe.Pointer(pOld + 36 /* &.fg */ + 4 /* &.isTabFunc */)) & 0x4 >> 2))) != 0 {
- *(*uintptr)(unsafe.Pointer(pNew + 64 /* &.u1 */)) = *(*uintptr)(unsafe.Pointer(pOld + 64 /* &.u1 */))
- *(*uintptr)(unsafe.Pointer(pOld + 64 /* &.u1 */)) = uintptr(0)
- libc.SetBitFieldPtr16Uint32(pOld+36 /* &.fg */ +4 /* &.isTabFunc */, uint32(0), 2, 0x4)
- libc.SetBitFieldPtr16Uint32(pNew+36 /* &.fg */ +4 /* &.isTabFunc */, uint32(1), 2, 0x4)
+ if uint32(int32(*(*uint16)(unsafe.Pointer(pOld + 36 + 4))&0x4>>2)) != 0 {
+ *(*uintptr)(unsafe.Pointer(pNew + 64)) = *(*uintptr)(unsafe.Pointer(pOld + 64))
+ *(*uintptr)(unsafe.Pointer(pOld + 64)) = uintptr(0)
+ libc.SetBitFieldPtr16Uint32(pOld+36+4, uint32(0), 2, 0x4)
+ libc.SetBitFieldPtr16Uint32(pNew+36+4, uint32(1), 2, 0x4)
}
- (*SrcItem)(unsafe.Pointer(pOld)).FzName = libc.AssignPtrUintptr(pOld+4 /* &.zDatabase */, uintptr(0))
+ (*SrcItem)(unsafe.Pointer(pOld)).FzName = libc.AssignPtrUintptr(pOld+4, uintptr(0))
(*SrcItem)(unsafe.Pointer(pOld)).FpSelect = uintptr(0)
}
- Xsqlite3SrcListDelete(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*12 + 4 /* &.minor */)))
+ Xsqlite3SrcListDelete(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*12 + 4)))
} else {
var pSubquery uintptr
- Xsqlite3SrcListShiftJoinType(tls, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*12 + 4 /* &.minor */)))
- pSubquery = Xsqlite3SelectNew(tls, pParse, uintptr(0), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*12 + 4 /* &.minor */)), uintptr(0), uintptr(0), uintptr(0), uintptr(0), uint32(SF_NestedFrom), uintptr(0))
- *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-6)*12 + 4 /* &.minor */)) = Xsqlite3SrcListAppendFromTerm(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-6)*12 + 4 /* &.minor */)), uintptr(0), uintptr(0), (yymsp + libc.UintptrFromInt32(-2)*12 + 4 /* &.minor */ /* &.yy0 */), pSubquery, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*12 + 4 /* &.minor */)), *(*uintptr)(unsafe.Pointer(yymsp + 4 /* &.minor */)))
+ Xsqlite3SrcListShiftJoinType(tls, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*12 + 4)))
+ pSubquery = Xsqlite3SelectNew(tls, pParse, uintptr(0), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*12 + 4)), uintptr(0), uintptr(0), uintptr(0), uintptr(0), uint32(SF_NestedFrom), uintptr(0))
+ *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-6)*12 + 4)) = Xsqlite3SrcListAppendFromTerm(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-6)*12 + 4)), uintptr(0), uintptr(0), yymsp+libc.UintptrFromInt32(-2)*12+4, pSubquery, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*12 + 4)), *(*uintptr)(unsafe.Pointer(yymsp + 4)))
}
}
break
- case uint32(111):
+ case uint32(113):
fallthrough // dbnm ::=
- case uint32(125): /* indexed_opt ::= */
+ case uint32(127): /* indexed_opt ::= */
{
- (*Token)(unsafe.Pointer(yymsp + 1*12 + 4 /* &.minor */)).Fz = uintptr(0)
- (*Token)(unsafe.Pointer(yymsp + 1*12 + 4 /* &.minor */)).Fn = uint32(0)
+ (*Token)(unsafe.Pointer(yymsp + 1*12 + 4)).Fz = uintptr(0)
+ (*Token)(unsafe.Pointer(yymsp + 1*12 + 4)).Fn = uint32(0)
}
break
- case uint32(113): /* fullname ::= nm */
+ case uint32(115): /* fullname ::= nm */
{
- *(*uintptr)(unsafe.Pointer(bp + 60 /* &yylhsminor */)) = Xsqlite3SrcListAppend(tls, pParse, uintptr(0), (yymsp + 4 /* &.minor */ /* &.yy0 */), uintptr(0))
- if (int32((*Parse)(unsafe.Pointer(pParse)).FeParseMode) >= PARSE_MODE_RENAME) && (*(*uintptr)(unsafe.Pointer(bp + 60 /* &yylhsminor */)) != 0) {
- Xsqlite3RenameTokenMap(tls, pParse, (*SrcItem)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(bp + 60 /* &yylhsminor */)) + 8 /* &.a */))).FzName, (yymsp + 4 /* &.minor */ /* &.yy0 */))
+ *(*uintptr)(unsafe.Pointer(bp + 40 /* &yylhsminor */)) = Xsqlite3SrcListAppend(tls, pParse, uintptr(0), yymsp+4, uintptr(0))
+ if int32((*Parse)(unsafe.Pointer(pParse)).FeParseMode) >= PARSE_MODE_RENAME && *(*uintptr)(unsafe.Pointer(bp + 40)) != 0 {
+ Xsqlite3RenameTokenMap(tls, pParse, (*SrcItem)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 40))+8)).FzName, yymsp+4)
}
}
- *(*uintptr)(unsafe.Pointer(yymsp + 4 /* &.minor */)) = *(*uintptr)(unsafe.Pointer(bp + 60 /* &yylhsminor */))
+ *(*uintptr)(unsafe.Pointer(yymsp + 4)) = *(*uintptr)(unsafe.Pointer(bp + 40 /* &yylhsminor */))
break
- case uint32(114): /* fullname ::= nm DOT nm */
+ case uint32(116): /* fullname ::= nm DOT nm */
{
- *(*uintptr)(unsafe.Pointer(bp + 60 /* &yylhsminor */)) = Xsqlite3SrcListAppend(tls, pParse, uintptr(0), (yymsp + libc.UintptrFromInt32(-2)*12 + 4 /* &.minor */ /* &.yy0 */), (yymsp + 4 /* &.minor */ /* &.yy0 */))
- if (int32((*Parse)(unsafe.Pointer(pParse)).FeParseMode) >= PARSE_MODE_RENAME) && (*(*uintptr)(unsafe.Pointer(bp + 60 /* &yylhsminor */)) != 0) {
- Xsqlite3RenameTokenMap(tls, pParse, (*SrcItem)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(bp + 60 /* &yylhsminor */)) + 8 /* &.a */))).FzName, (yymsp + 4 /* &.minor */ /* &.yy0 */))
+ *(*uintptr)(unsafe.Pointer(bp + 40 /* &yylhsminor */)) = Xsqlite3SrcListAppend(tls, pParse, uintptr(0), yymsp+libc.UintptrFromInt32(-2)*12+4, yymsp+4)
+ if int32((*Parse)(unsafe.Pointer(pParse)).FeParseMode) >= PARSE_MODE_RENAME && *(*uintptr)(unsafe.Pointer(bp + 40)) != 0 {
+ Xsqlite3RenameTokenMap(tls, pParse, (*SrcItem)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 40))+8)).FzName, yymsp+4)
}
}
- *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*12 + 4 /* &.minor */)) = *(*uintptr)(unsafe.Pointer(bp + 60 /* &yylhsminor */))
+ *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*12 + 4)) = *(*uintptr)(unsafe.Pointer(bp + 40 /* &yylhsminor */))
break
- case uint32(115): /* xfullname ::= nm */
+ case uint32(117): /* xfullname ::= nm */
{
- *(*uintptr)(unsafe.Pointer(yymsp + 4 /* &.minor */)) = Xsqlite3SrcListAppend(tls, pParse, uintptr(0), (yymsp + 4 /* &.minor */ /* &.yy0 */), uintptr(0)) /*A-overwrites-X*/
+ *(*uintptr)(unsafe.Pointer(yymsp + 4)) = Xsqlite3SrcListAppend(tls, pParse, uintptr(0), yymsp+4, uintptr(0)) /*A-overwrites-X*/
}
break
- case uint32(116): /* xfullname ::= nm DOT nm */
+ case uint32(118): /* xfullname ::= nm DOT nm */
{
- *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*12 + 4 /* &.minor */)) = Xsqlite3SrcListAppend(tls, pParse, uintptr(0), (yymsp + libc.UintptrFromInt32(-2)*12 + 4 /* &.minor */ /* &.yy0 */), (yymsp + 4 /* &.minor */ /* &.yy0 */)) /*A-overwrites-X*/
+ *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*12 + 4)) = Xsqlite3SrcListAppend(tls, pParse, uintptr(0), yymsp+libc.UintptrFromInt32(-2)*12+4, yymsp+4) /*A-overwrites-X*/
}
break
- case uint32(117): /* xfullname ::= nm DOT nm AS nm */
+ case uint32(119): /* xfullname ::= nm DOT nm AS nm */
{
- *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*12 + 4 /* &.minor */)) = Xsqlite3SrcListAppend(tls, pParse, uintptr(0), (yymsp + libc.UintptrFromInt32(-4)*12 + 4 /* &.minor */ /* &.yy0 */), (yymsp + libc.UintptrFromInt32(-2)*12 + 4 /* &.minor */ /* &.yy0 */)) //A-overwrites-X
- if *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*12 + 4 /* &.minor */)) != 0 {
- (*SrcItem)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*12 + 4 /* &.minor */)) + 8 /* &.a */))).FzAlias = Xsqlite3NameFromToken(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, (yymsp + 4 /* &.minor */ /* &.yy0 */))
+ *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*12 + 4)) = Xsqlite3SrcListAppend(tls, pParse, uintptr(0), yymsp+libc.UintptrFromInt32(-4)*12+4, yymsp+libc.UintptrFromInt32(-2)*12+4) //A-overwrites-X
+ if *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*12 + 4)) != 0 {
+ (*SrcItem)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*12 + 4)) + 8)).FzAlias = Xsqlite3NameFromToken(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, yymsp+4 /* &.minor */ /* &.yy0 */)
}
}
break
- case uint32(118): /* xfullname ::= nm AS nm */
+ case uint32(120): /* xfullname ::= nm AS nm */
{
- *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*12 + 4 /* &.minor */)) = Xsqlite3SrcListAppend(tls, pParse, uintptr(0), (yymsp + libc.UintptrFromInt32(-2)*12 + 4 /* &.minor */ /* &.yy0 */), uintptr(0)) //A-overwrites-X
- if *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*12 + 4 /* &.minor */)) != 0 {
- (*SrcItem)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*12 + 4 /* &.minor */)) + 8 /* &.a */))).FzAlias = Xsqlite3NameFromToken(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, (yymsp + 4 /* &.minor */ /* &.yy0 */))
+ *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*12 + 4)) = Xsqlite3SrcListAppend(tls, pParse, uintptr(0), yymsp+libc.UintptrFromInt32(-2)*12+4, uintptr(0)) //A-overwrites-X
+ if *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*12 + 4)) != 0 {
+ (*SrcItem)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*12 + 4)) + 8)).FzAlias = Xsqlite3NameFromToken(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, yymsp+4 /* &.minor */ /* &.yy0 */)
}
}
break
- case uint32(119): /* joinop ::= COMMA|JOIN */
+ case uint32(121): /* joinop ::= COMMA|JOIN */
{
- *(*int32)(unsafe.Pointer(yymsp + 4 /* &.minor */)) = JT_INNER
+ *(*int32)(unsafe.Pointer(yymsp + 4)) = JT_INNER
}
break
- case uint32(120): /* joinop ::= JOIN_KW JOIN */
+ case uint32(122): /* joinop ::= JOIN_KW JOIN */
{
- *(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*12 + 4 /* &.minor */)) = Xsqlite3JoinType(tls, pParse, (yymsp + libc.UintptrFromInt32(-1)*12 + 4 /* &.minor */ /* &.yy0 */), uintptr(0), uintptr(0)) /*X-overwrites-A*/
+ *(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*12 + 4)) = Xsqlite3JoinType(tls, pParse, yymsp+libc.UintptrFromInt32(-1)*12+4, uintptr(0), uintptr(0)) /*X-overwrites-A*/
}
break
- case uint32(121): /* joinop ::= JOIN_KW nm JOIN */
+ case uint32(123): /* joinop ::= JOIN_KW nm JOIN */
{
- *(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*12 + 4 /* &.minor */)) = Xsqlite3JoinType(tls, pParse, (yymsp + libc.UintptrFromInt32(-2)*12 + 4 /* &.minor */ /* &.yy0 */), (yymsp + libc.UintptrFromInt32(-1)*12 + 4 /* &.minor */ /* &.yy0 */), uintptr(0)) /*X-overwrites-A*/
+ *(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*12 + 4)) = Xsqlite3JoinType(tls, pParse, yymsp+libc.UintptrFromInt32(-2)*12+4, yymsp+libc.UintptrFromInt32(-1)*12+4, uintptr(0)) /*X-overwrites-A*/
}
break
- case uint32(122): /* joinop ::= JOIN_KW nm nm JOIN */
+ case uint32(124): /* joinop ::= JOIN_KW nm nm JOIN */
{
- *(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-3)*12 + 4 /* &.minor */)) = Xsqlite3JoinType(tls, pParse, (yymsp + libc.UintptrFromInt32(-3)*12 + 4 /* &.minor */ /* &.yy0 */), (yymsp + libc.UintptrFromInt32(-2)*12 + 4 /* &.minor */ /* &.yy0 */), (yymsp + libc.UintptrFromInt32(-1)*12 + 4 /* &.minor */ /* &.yy0 */)) /*X-overwrites-A*/
+ *(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-3)*12 + 4)) = Xsqlite3JoinType(tls, pParse, yymsp+libc.UintptrFromInt32(-3)*12+4, yymsp+libc.UintptrFromInt32(-2)*12+4, yymsp+libc.UintptrFromInt32(-1)*12+4) /*X-overwrites-A*/
}
break
- case uint32(123):
+ case uint32(125):
fallthrough // on_opt ::= ON expr
- case uint32(143): /* having_opt ::= HAVING expr */
+ case uint32(145): /* having_opt ::= HAVING expr */
fallthrough
- case uint32(150): /* where_opt ::= WHERE expr */
+ case uint32(152): /* where_opt ::= WHERE expr */
fallthrough
- case uint32(152): /* where_opt_ret ::= WHERE expr */
+ case uint32(154): /* where_opt_ret ::= WHERE expr */
fallthrough
- case uint32(223): /* case_else ::= ELSE expr */
+ case uint32(225): /* case_else ::= ELSE expr */
fallthrough
- case uint32(244): /* vinto ::= INTO expr */
+ case uint32(246): /* vinto ::= INTO expr */
{
- *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*12 + 4 /* &.minor */)) = *(*uintptr)(unsafe.Pointer(yymsp + 4 /* &.minor */))
+ *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*12 + 4)) = *(*uintptr)(unsafe.Pointer(yymsp + 4))
}
break
- case uint32(124):
+ case uint32(126):
fallthrough // on_opt ::=
- case uint32(142): /* having_opt ::= */
+ case uint32(144): /* having_opt ::= */
fallthrough
- case uint32(144): /* limit_opt ::= */
+ case uint32(146): /* limit_opt ::= */
fallthrough
- case uint32(149): /* where_opt ::= */
+ case uint32(151): /* where_opt ::= */
fallthrough
- case uint32(151): /* where_opt_ret ::= */
+ case uint32(153): /* where_opt_ret ::= */
fallthrough
- case uint32(224): /* case_else ::= */
+ case uint32(226): /* case_else ::= */
fallthrough
- case uint32(226): /* case_operand ::= */
+ case uint32(228): /* case_operand ::= */
fallthrough
- case uint32(245): /* vinto ::= */
+ case uint32(247): /* vinto ::= */
{
- *(*uintptr)(unsafe.Pointer(yymsp + 1*12 + 4 /* &.minor */)) = uintptr(0)
+ *(*uintptr)(unsafe.Pointer(yymsp + 1*12 + 4)) = uintptr(0)
}
break
- case uint32(126): /* indexed_opt ::= INDEXED BY nm */
+ case uint32(128): /* indexed_opt ::= INDEXED BY nm */
{
- *(*Token)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*12 + 4 /* &.minor */)) = *(*Token)(unsafe.Pointer(yymsp + 4 /* &.minor */))
+ *(*Token)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*12 + 4)) = *(*Token)(unsafe.Pointer(yymsp + 4))
}
break
- case uint32(127): /* indexed_opt ::= NOT INDEXED */
+ case uint32(129): /* indexed_opt ::= NOT INDEXED */
{
- (*Token)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*12 + 4 /* &.minor */)).Fz = uintptr(0)
- (*Token)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*12 + 4 /* &.minor */)).Fn = uint32(1)
+ (*Token)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*12 + 4)).Fz = uintptr(0)
+ (*Token)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*12 + 4)).Fn = uint32(1)
}
break
- case uint32(128): /* using_opt ::= USING LP idlist RP */
+ case uint32(130): /* using_opt ::= USING LP idlist RP */
{
- *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-3)*12 + 4 /* &.minor */)) = *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*12 + 4 /* &.minor */))
+ *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-3)*12 + 4)) = *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*12 + 4))
}
break
- case uint32(129):
+ case uint32(131):
fallthrough // using_opt ::=
- case uint32(171): /* idlist_opt ::= */
+ case uint32(173): /* idlist_opt ::= */
{
- *(*uintptr)(unsafe.Pointer(yymsp + 1*12 + 4 /* &.minor */)) = uintptr(0)
+ *(*uintptr)(unsafe.Pointer(yymsp + 1*12 + 4)) = uintptr(0)
}
break
- case uint32(131):
+ case uint32(133):
fallthrough // orderby_opt ::= ORDER BY sortlist
- case uint32(141): /* groupby_opt ::= GROUP BY nexprlist */
+ case uint32(143): /* groupby_opt ::= GROUP BY nexprlist */
{
- *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*12 + 4 /* &.minor */)) = *(*uintptr)(unsafe.Pointer(yymsp + 4 /* &.minor */))
+ *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*12 + 4)) = *(*uintptr)(unsafe.Pointer(yymsp + 4))
}
break
- case uint32(132): /* sortlist ::= sortlist COMMA expr sortorder nulls */
+ case uint32(134): /* sortlist ::= sortlist COMMA expr sortorder nulls */
{
- *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*12 + 4 /* &.minor */)) = Xsqlite3ExprListAppend(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*12 + 4 /* &.minor */)), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*12 + 4 /* &.minor */)))
- Xsqlite3ExprListSetSortOrder(tls, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*12 + 4 /* &.minor */)), *(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*12 + 4 /* &.minor */)), *(*int32)(unsafe.Pointer(yymsp + 4 /* &.minor */)))
+ *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*12 + 4)) = Xsqlite3ExprListAppend(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*12 + 4)), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*12 + 4)))
+ Xsqlite3ExprListSetSortOrder(tls, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*12 + 4)), *(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*12 + 4)), *(*int32)(unsafe.Pointer(yymsp + 4)))
}
break
- case uint32(133): /* sortlist ::= expr sortorder nulls */
+ case uint32(135): /* sortlist ::= expr sortorder nulls */
{
- *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*12 + 4 /* &.minor */)) = Xsqlite3ExprListAppend(tls, pParse, uintptr(0), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*12 + 4 /* &.minor */))) //A-overwrites-Y
- Xsqlite3ExprListSetSortOrder(tls, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*12 + 4 /* &.minor */)), *(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*12 + 4 /* &.minor */)), *(*int32)(unsafe.Pointer(yymsp + 4 /* &.minor */)))
+ *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*12 + 4)) = Xsqlite3ExprListAppend(tls, pParse, uintptr(0), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*12 + 4))) //A-overwrites-Y
+ Xsqlite3ExprListSetSortOrder(tls, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*12 + 4)), *(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*12 + 4)), *(*int32)(unsafe.Pointer(yymsp + 4 /* &.minor */)))
}
break
- case uint32(134): /* sortorder ::= ASC */
+ case uint32(136): /* sortorder ::= ASC */
{
- *(*int32)(unsafe.Pointer(yymsp + 4 /* &.minor */)) = SQLITE_SO_ASC
+ *(*int32)(unsafe.Pointer(yymsp + 4)) = SQLITE_SO_ASC
}
break
- case uint32(135): /* sortorder ::= DESC */
+ case uint32(137): /* sortorder ::= DESC */
{
- *(*int32)(unsafe.Pointer(yymsp + 4 /* &.minor */)) = SQLITE_SO_DESC
+ *(*int32)(unsafe.Pointer(yymsp + 4)) = SQLITE_SO_DESC
}
break
- case uint32(136):
+ case uint32(138):
fallthrough // sortorder ::=
- case uint32(139): /* nulls ::= */
+ case uint32(141): /* nulls ::= */
{
- *(*int32)(unsafe.Pointer(yymsp + 1*12 + 4 /* &.minor */)) = -1
+ *(*int32)(unsafe.Pointer(yymsp + 1*12 + 4)) = -1
}
break
- case uint32(137): /* nulls ::= NULLS FIRST */
+ case uint32(139): /* nulls ::= NULLS FIRST */
{
- *(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*12 + 4 /* &.minor */)) = SQLITE_SO_ASC
+ *(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*12 + 4)) = SQLITE_SO_ASC
}
break
- case uint32(138): /* nulls ::= NULLS LAST */
+ case uint32(140): /* nulls ::= NULLS LAST */
{
- *(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*12 + 4 /* &.minor */)) = SQLITE_SO_DESC
+ *(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*12 + 4)) = SQLITE_SO_DESC
}
break
- case uint32(145): /* limit_opt ::= LIMIT expr */
+ case uint32(147): /* limit_opt ::= LIMIT expr */
{
- *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*12 + 4 /* &.minor */)) = Xsqlite3PExpr(tls, pParse, TK_LIMIT, *(*uintptr)(unsafe.Pointer(yymsp + 4 /* &.minor */)), uintptr(0))
+ *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*12 + 4)) = Xsqlite3PExpr(tls, pParse, TK_LIMIT, *(*uintptr)(unsafe.Pointer(yymsp + 4)), uintptr(0))
}
break
- case uint32(146): /* limit_opt ::= LIMIT expr OFFSET expr */
+ case uint32(148): /* limit_opt ::= LIMIT expr OFFSET expr */
{
- *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-3)*12 + 4 /* &.minor */)) = Xsqlite3PExpr(tls, pParse, TK_LIMIT, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*12 + 4 /* &.minor */)), *(*uintptr)(unsafe.Pointer(yymsp + 4 /* &.minor */)))
+ *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-3)*12 + 4)) = Xsqlite3PExpr(tls, pParse, TK_LIMIT, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*12 + 4)), *(*uintptr)(unsafe.Pointer(yymsp + 4)))
}
break
- case uint32(147): /* limit_opt ::= LIMIT expr COMMA expr */
+ case uint32(149): /* limit_opt ::= LIMIT expr COMMA expr */
{
- *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-3)*12 + 4 /* &.minor */)) = Xsqlite3PExpr(tls, pParse, TK_LIMIT, *(*uintptr)(unsafe.Pointer(yymsp + 4 /* &.minor */)), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*12 + 4 /* &.minor */)))
+ *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-3)*12 + 4)) = Xsqlite3PExpr(tls, pParse, TK_LIMIT, *(*uintptr)(unsafe.Pointer(yymsp + 4)), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*12 + 4)))
}
break
- case uint32(148): /* cmd ::= with DELETE FROM xfullname indexed_opt where_opt_ret */
+ case uint32(150): /* cmd ::= with DELETE FROM xfullname indexed_opt where_opt_ret */
{
- Xsqlite3SrcListIndexedBy(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*12 + 4 /* &.minor */)), (yymsp + libc.UintptrFromInt32(-1)*12 + 4 /* &.minor */ /* &.yy0 */))
- Xsqlite3DeleteFrom(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*12 + 4 /* &.minor */)), *(*uintptr)(unsafe.Pointer(yymsp + 4 /* &.minor */)), uintptr(0), uintptr(0))
+ Xsqlite3SrcListIndexedBy(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*12 + 4)), yymsp+libc.UintptrFromInt32(-1)*12+4)
+ Xsqlite3DeleteFrom(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*12 + 4)), *(*uintptr)(unsafe.Pointer(yymsp + 4)), uintptr(0), uintptr(0))
}
break
- case uint32(153): /* where_opt_ret ::= RETURNING selcollist */
+ case uint32(155): /* where_opt_ret ::= RETURNING selcollist */
{
- Xsqlite3AddReturning(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + 4 /* &.minor */)))
- *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*12 + 4 /* &.minor */)) = uintptr(0)
+ Xsqlite3AddReturning(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + 4)))
+ *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*12 + 4)) = uintptr(0)
}
break
- case uint32(154): /* where_opt_ret ::= WHERE expr RETURNING selcollist */
+ case uint32(156): /* where_opt_ret ::= WHERE expr RETURNING selcollist */
{
- Xsqlite3AddReturning(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + 4 /* &.minor */)))
- *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-3)*12 + 4 /* &.minor */)) = *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*12 + 4 /* &.minor */))
+ Xsqlite3AddReturning(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + 4)))
+ *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-3)*12 + 4)) = *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*12 + 4))
}
break
- case uint32(155): /* cmd ::= with UPDATE orconf xfullname indexed_opt SET setlist from where_opt_ret */
+ case uint32(157): /* cmd ::= with UPDATE orconf xfullname indexed_opt SET setlist from where_opt_ret */
{
- Xsqlite3SrcListIndexedBy(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-5)*12 + 4 /* &.minor */)), (yymsp + libc.UintptrFromInt32(-4)*12 + 4 /* &.minor */ /* &.yy0 */))
- Xsqlite3ExprListCheckLength(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*12 + 4 /* &.minor */)), ts+21266 /* "set list" */)
- *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-5)*12 + 4 /* &.minor */)) = Xsqlite3SrcListAppendList(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-5)*12 + 4 /* &.minor */)), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*12 + 4 /* &.minor */)))
- Xsqlite3Update(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-5)*12 + 4 /* &.minor */)), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*12 + 4 /* &.minor */)), *(*uintptr)(unsafe.Pointer(yymsp + 4 /* &.minor */)), *(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-6)*12 + 4 /* &.minor */)), uintptr(0), uintptr(0), uintptr(0))
+ Xsqlite3SrcListIndexedBy(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-5)*12 + 4)), yymsp+libc.UintptrFromInt32(-4)*12+4)
+ Xsqlite3ExprListCheckLength(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*12 + 4)), ts+22563 /* "set list" */)
+ *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-5)*12 + 4)) = Xsqlite3SrcListAppendList(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-5)*12 + 4)), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*12 + 4)))
+ Xsqlite3Update(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-5)*12 + 4)), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*12 + 4)), *(*uintptr)(unsafe.Pointer(yymsp + 4)), *(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-6)*12 + 4)), uintptr(0), uintptr(0), uintptr(0))
}
break
- case uint32(156): /* setlist ::= setlist COMMA nm EQ expr */
+ case uint32(158): /* setlist ::= setlist COMMA nm EQ expr */
{
- *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*12 + 4 /* &.minor */)) = Xsqlite3ExprListAppend(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*12 + 4 /* &.minor */)), *(*uintptr)(unsafe.Pointer(yymsp + 4 /* &.minor */)))
- Xsqlite3ExprListSetName(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*12 + 4 /* &.minor */)), (yymsp + libc.UintptrFromInt32(-2)*12 + 4 /* &.minor */ /* &.yy0 */), 1)
+ *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*12 + 4)) = Xsqlite3ExprListAppend(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*12 + 4)), *(*uintptr)(unsafe.Pointer(yymsp + 4)))
+ Xsqlite3ExprListSetName(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*12 + 4)), yymsp+libc.UintptrFromInt32(-2)*12+4, 1)
}
break
- case uint32(157): /* setlist ::= setlist COMMA LP idlist RP EQ expr */
+ case uint32(159): /* setlist ::= setlist COMMA LP idlist RP EQ expr */
{
- *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-6)*12 + 4 /* &.minor */)) = Xsqlite3ExprListAppendVector(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-6)*12 + 4 /* &.minor */)), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-3)*12 + 4 /* &.minor */)), *(*uintptr)(unsafe.Pointer(yymsp + 4 /* &.minor */)))
+ *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-6)*12 + 4)) = Xsqlite3ExprListAppendVector(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-6)*12 + 4)), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-3)*12 + 4)), *(*uintptr)(unsafe.Pointer(yymsp + 4)))
}
break
- case uint32(158): /* setlist ::= nm EQ expr */
+ case uint32(160): /* setlist ::= nm EQ expr */
{
- *(*uintptr)(unsafe.Pointer(bp + 60 /* &yylhsminor */)) = Xsqlite3ExprListAppend(tls, pParse, uintptr(0), *(*uintptr)(unsafe.Pointer(yymsp + 4 /* &.minor */)))
- Xsqlite3ExprListSetName(tls, pParse, *(*uintptr)(unsafe.Pointer(bp + 60 /* &yylhsminor */)), (yymsp + libc.UintptrFromInt32(-2)*12 + 4 /* &.minor */ /* &.yy0 */), 1)
+ *(*uintptr)(unsafe.Pointer(bp + 40 /* &yylhsminor */)) = Xsqlite3ExprListAppend(tls, pParse, uintptr(0), *(*uintptr)(unsafe.Pointer(yymsp + 4)))
+ Xsqlite3ExprListSetName(tls, pParse, *(*uintptr)(unsafe.Pointer(bp + 40 /* &yylhsminor */)), yymsp+libc.UintptrFromInt32(-2)*12+4, 1)
}
- *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*12 + 4 /* &.minor */)) = *(*uintptr)(unsafe.Pointer(bp + 60 /* &yylhsminor */))
+ *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*12 + 4)) = *(*uintptr)(unsafe.Pointer(bp + 40 /* &yylhsminor */))
break
- case uint32(159): /* setlist ::= LP idlist RP EQ expr */
+ case uint32(161): /* setlist ::= LP idlist RP EQ expr */
{
- *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*12 + 4 /* &.minor */)) = Xsqlite3ExprListAppendVector(tls, pParse, uintptr(0), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-3)*12 + 4 /* &.minor */)), *(*uintptr)(unsafe.Pointer(yymsp + 4 /* &.minor */)))
+ *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*12 + 4)) = Xsqlite3ExprListAppendVector(tls, pParse, uintptr(0), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-3)*12 + 4)), *(*uintptr)(unsafe.Pointer(yymsp + 4)))
}
break
- case uint32(160): /* cmd ::= with insert_cmd INTO xfullname idlist_opt select upsert */
+ case uint32(162): /* cmd ::= with insert_cmd INTO xfullname idlist_opt select upsert */
{
- Xsqlite3Insert(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-3)*12 + 4 /* &.minor */)), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*12 + 4 /* &.minor */)), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*12 + 4 /* &.minor */)), *(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-5)*12 + 4 /* &.minor */)), *(*uintptr)(unsafe.Pointer(yymsp + 4 /* &.minor */)))
+ Xsqlite3Insert(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-3)*12 + 4)), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*12 + 4)), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*12 + 4)), *(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-5)*12 + 4)), *(*uintptr)(unsafe.Pointer(yymsp + 4)))
}
break
- case uint32(161): /* cmd ::= with insert_cmd INTO xfullname idlist_opt DEFAULT VALUES returning */
+ case uint32(163): /* cmd ::= with insert_cmd INTO xfullname idlist_opt DEFAULT VALUES returning */
{
- Xsqlite3Insert(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*12 + 4 /* &.minor */)), uintptr(0), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-3)*12 + 4 /* &.minor */)), *(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-6)*12 + 4 /* &.minor */)), uintptr(0))
+ Xsqlite3Insert(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*12 + 4)), uintptr(0), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-3)*12 + 4)), *(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-6)*12 + 4)), uintptr(0))
}
break
- case uint32(162): /* upsert ::= */
+ case uint32(164): /* upsert ::= */
{
- *(*uintptr)(unsafe.Pointer(yymsp + 1*12 + 4 /* &.minor */)) = uintptr(0)
+ *(*uintptr)(unsafe.Pointer(yymsp + 1*12 + 4)) = uintptr(0)
}
break
- case uint32(163): /* upsert ::= RETURNING selcollist */
+ case uint32(165): /* upsert ::= RETURNING selcollist */
{
- *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*12 + 4 /* &.minor */)) = uintptr(0)
- Xsqlite3AddReturning(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + 4 /* &.minor */)))
+ *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*12 + 4)) = uintptr(0)
+ Xsqlite3AddReturning(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + 4)))
}
break
- case uint32(164): /* upsert ::= ON CONFLICT LP sortlist RP where_opt DO UPDATE SET setlist where_opt upsert */
+ case uint32(166): /* upsert ::= ON CONFLICT LP sortlist RP where_opt DO UPDATE SET setlist where_opt upsert */
{
- *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-11)*12 + 4 /* &.minor */)) = Xsqlite3UpsertNew(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-8)*12 + 4 /* &.minor */)), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-6)*12 + 4 /* &.minor */)), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*12 + 4 /* &.minor */)), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*12 + 4 /* &.minor */)), *(*uintptr)(unsafe.Pointer(yymsp + 4 /* &.minor */)))
+ *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-11)*12 + 4)) = Xsqlite3UpsertNew(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-8)*12 + 4)), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-6)*12 + 4)), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*12 + 4)), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*12 + 4)), *(*uintptr)(unsafe.Pointer(yymsp + 4)))
}
break
- case uint32(165): /* upsert ::= ON CONFLICT LP sortlist RP where_opt DO NOTHING upsert */
+ case uint32(167): /* upsert ::= ON CONFLICT LP sortlist RP where_opt DO NOTHING upsert */
{
- *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-8)*12 + 4 /* &.minor */)) = Xsqlite3UpsertNew(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-5)*12 + 4 /* &.minor */)), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-3)*12 + 4 /* &.minor */)), uintptr(0), uintptr(0), *(*uintptr)(unsafe.Pointer(yymsp + 4 /* &.minor */)))
+ *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-8)*12 + 4)) = Xsqlite3UpsertNew(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-5)*12 + 4)), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-3)*12 + 4)), uintptr(0), uintptr(0), *(*uintptr)(unsafe.Pointer(yymsp + 4)))
}
break
- case uint32(166): /* upsert ::= ON CONFLICT DO NOTHING returning */
+ case uint32(168): /* upsert ::= ON CONFLICT DO NOTHING returning */
{
- *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*12 + 4 /* &.minor */)) = Xsqlite3UpsertNew(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, uintptr(0), uintptr(0), uintptr(0), uintptr(0), uintptr(0))
+ *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*12 + 4)) = Xsqlite3UpsertNew(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, uintptr(0), uintptr(0), uintptr(0), uintptr(0), uintptr(0))
}
break
- case uint32(167): /* upsert ::= ON CONFLICT DO UPDATE SET setlist where_opt returning */
+ case uint32(169): /* upsert ::= ON CONFLICT DO UPDATE SET setlist where_opt returning */
{
- *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-7)*12 + 4 /* &.minor */)) = Xsqlite3UpsertNew(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, uintptr(0), uintptr(0), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*12 + 4 /* &.minor */)), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*12 + 4 /* &.minor */)), uintptr(0))
+ *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-7)*12 + 4)) = Xsqlite3UpsertNew(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, uintptr(0), uintptr(0), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*12 + 4)), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*12 + 4)), uintptr(0))
}
break
- case uint32(168): /* returning ::= RETURNING selcollist */
+ case uint32(170): /* returning ::= RETURNING selcollist */
{
- Xsqlite3AddReturning(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + 4 /* &.minor */)))
+ Xsqlite3AddReturning(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + 4)))
}
break
- case uint32(172): /* idlist_opt ::= LP idlist RP */
+ case uint32(174): /* idlist_opt ::= LP idlist RP */
{
- *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*12 + 4 /* &.minor */)) = *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*12 + 4 /* &.minor */))
+ *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*12 + 4)) = *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*12 + 4))
}
break
- case uint32(173): /* idlist ::= idlist COMMA nm */
+ case uint32(175): /* idlist ::= idlist COMMA nm */
{
- *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*12 + 4 /* &.minor */)) = Xsqlite3IdListAppend(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*12 + 4 /* &.minor */)), (yymsp + 4 /* &.minor */ /* &.yy0 */))
+ *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*12 + 4)) = Xsqlite3IdListAppend(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*12 + 4)), yymsp+4)
}
break
- case uint32(174): /* idlist ::= nm */
+ case uint32(176): /* idlist ::= nm */
{
- *(*uintptr)(unsafe.Pointer(yymsp + 4 /* &.minor */)) = Xsqlite3IdListAppend(tls, pParse, uintptr(0), (yymsp + 4 /* &.minor */ /* &.yy0 */)) /*A-overwrites-Y*/
+ *(*uintptr)(unsafe.Pointer(yymsp + 4)) = Xsqlite3IdListAppend(tls, pParse, uintptr(0), yymsp+4) /*A-overwrites-Y*/
}
break
- case uint32(175): /* expr ::= LP expr RP */
+ case uint32(177): /* expr ::= LP expr RP */
{
- *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*12 + 4 /* &.minor */)) = *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*12 + 4 /* &.minor */))
+ *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*12 + 4)) = *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*12 + 4))
}
break
- case uint32(176):
+ case uint32(178):
fallthrough // expr ::= ID|INDEXED
- case uint32(177): /* expr ::= JOIN_KW */
+ case uint32(179): /* expr ::= JOIN_KW */
{
- *(*uintptr)(unsafe.Pointer(yymsp + 4 /* &.minor */)) = tokenExpr(tls, pParse, TK_ID, *(*Token)(unsafe.Pointer(yymsp + 4 /* &.minor */))) /*A-overwrites-X*/
+ *(*uintptr)(unsafe.Pointer(yymsp + 4)) = tokenExpr(tls, pParse, TK_ID, *(*Token)(unsafe.Pointer(yymsp + 4))) /*A-overwrites-X*/
}
break
- case uint32(178): /* expr ::= nm DOT nm */
+ case uint32(180): /* expr ::= nm DOT nm */
{
- var temp1 uintptr = Xsqlite3ExprAlloc(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, TK_ID, (yymsp + libc.UintptrFromInt32(-2)*12 + 4 /* &.minor */ /* &.yy0 */), 1)
- var temp2 uintptr = Xsqlite3ExprAlloc(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, TK_ID, (yymsp + 4 /* &.minor */ /* &.yy0 */), 1)
+ var temp1 uintptr = Xsqlite3ExprAlloc(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, TK_ID, yymsp+libc.UintptrFromInt32(-2)*12+4, 1)
+ var temp2 uintptr = Xsqlite3ExprAlloc(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, TK_ID, yymsp+4, 1)
if int32((*Parse)(unsafe.Pointer(pParse)).FeParseMode) >= PARSE_MODE_RENAME {
- Xsqlite3RenameTokenMap(tls, pParse, temp2, (yymsp + 4 /* &.minor */ /* &.yy0 */))
- Xsqlite3RenameTokenMap(tls, pParse, temp1, (yymsp + libc.UintptrFromInt32(-2)*12 + 4 /* &.minor */ /* &.yy0 */))
+ Xsqlite3RenameTokenMap(tls, pParse, temp2, yymsp+4)
+ Xsqlite3RenameTokenMap(tls, pParse, temp1, yymsp+libc.UintptrFromInt32(-2)*12+4)
}
- *(*uintptr)(unsafe.Pointer(bp + 60 /* &yylhsminor */)) = Xsqlite3PExpr(tls, pParse, TK_DOT, temp1, temp2)
+ *(*uintptr)(unsafe.Pointer(bp + 40 /* &yylhsminor */)) = Xsqlite3PExpr(tls, pParse, TK_DOT, temp1, temp2)
}
- *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*12 + 4 /* &.minor */)) = *(*uintptr)(unsafe.Pointer(bp + 60 /* &yylhsminor */))
+ *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*12 + 4)) = *(*uintptr)(unsafe.Pointer(bp + 40 /* &yylhsminor */))
break
- case uint32(179): /* expr ::= nm DOT nm DOT nm */
+ case uint32(181): /* expr ::= nm DOT nm DOT nm */
{
- var temp1 uintptr = Xsqlite3ExprAlloc(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, TK_ID, (yymsp + libc.UintptrFromInt32(-4)*12 + 4 /* &.minor */ /* &.yy0 */), 1)
- var temp2 uintptr = Xsqlite3ExprAlloc(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, TK_ID, (yymsp + libc.UintptrFromInt32(-2)*12 + 4 /* &.minor */ /* &.yy0 */), 1)
- var temp3 uintptr = Xsqlite3ExprAlloc(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, TK_ID, (yymsp + 4 /* &.minor */ /* &.yy0 */), 1)
+ var temp1 uintptr = Xsqlite3ExprAlloc(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, TK_ID, yymsp+libc.UintptrFromInt32(-4)*12+4, 1)
+ var temp2 uintptr = Xsqlite3ExprAlloc(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, TK_ID, yymsp+libc.UintptrFromInt32(-2)*12+4, 1)
+ var temp3 uintptr = Xsqlite3ExprAlloc(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, TK_ID, yymsp+4, 1)
var temp4 uintptr = Xsqlite3PExpr(tls, pParse, TK_DOT, temp2, temp3)
if int32((*Parse)(unsafe.Pointer(pParse)).FeParseMode) >= PARSE_MODE_RENAME {
- Xsqlite3RenameTokenMap(tls, pParse, temp3, (yymsp + 4 /* &.minor */ /* &.yy0 */))
- Xsqlite3RenameTokenMap(tls, pParse, temp2, (yymsp + libc.UintptrFromInt32(-2)*12 + 4 /* &.minor */ /* &.yy0 */))
+ Xsqlite3RenameTokenMap(tls, pParse, temp3, yymsp+4)
+ Xsqlite3RenameTokenMap(tls, pParse, temp2, yymsp+libc.UintptrFromInt32(-2)*12+4)
}
- *(*uintptr)(unsafe.Pointer(bp + 60 /* &yylhsminor */)) = Xsqlite3PExpr(tls, pParse, TK_DOT, temp1, temp4)
+ *(*uintptr)(unsafe.Pointer(bp + 40 /* &yylhsminor */)) = Xsqlite3PExpr(tls, pParse, TK_DOT, temp1, temp4)
}
- *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*12 + 4 /* &.minor */)) = *(*uintptr)(unsafe.Pointer(bp + 60 /* &yylhsminor */))
+ *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*12 + 4)) = *(*uintptr)(unsafe.Pointer(bp + 40 /* &yylhsminor */))
break
- case uint32(180):
+ case uint32(182):
fallthrough // term ::= NULL|FLOAT|BLOB
- case uint32(181): /* term ::= STRING */
+ case uint32(183): /* term ::= STRING */
{
- *(*uintptr)(unsafe.Pointer(yymsp + 4 /* &.minor */)) = tokenExpr(tls, pParse, int32((*YyStackEntry)(unsafe.Pointer(yymsp)).Fmajor), *(*Token)(unsafe.Pointer(yymsp + 4 /* &.minor */))) /*A-overwrites-X*/
+ *(*uintptr)(unsafe.Pointer(yymsp + 4)) = tokenExpr(tls, pParse, int32((*YyStackEntry)(unsafe.Pointer(yymsp)).Fmajor), *(*Token)(unsafe.Pointer(yymsp + 4))) /*A-overwrites-X*/
}
break
- case uint32(182): /* term ::= INTEGER */
+ case uint32(184): /* term ::= INTEGER */
{
- *(*uintptr)(unsafe.Pointer(bp + 60 /* &yylhsminor */)) = Xsqlite3ExprAlloc(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, TK_INTEGER, (yymsp + 4 /* &.minor */ /* &.yy0 */), 1)
+ *(*uintptr)(unsafe.Pointer(bp + 40 /* &yylhsminor */)) = Xsqlite3ExprAlloc(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, TK_INTEGER, yymsp+4, 1)
}
- *(*uintptr)(unsafe.Pointer(yymsp + 4 /* &.minor */)) = *(*uintptr)(unsafe.Pointer(bp + 60 /* &yylhsminor */))
+ *(*uintptr)(unsafe.Pointer(yymsp + 4)) = *(*uintptr)(unsafe.Pointer(bp + 40 /* &yylhsminor */))
break
- case uint32(183): /* expr ::= VARIABLE */
+ case uint32(185): /* expr ::= VARIABLE */
{
- if !((int32(*(*uint8)(unsafe.Pointer((*Token)(unsafe.Pointer(yymsp + 4 /* &.minor */)).Fz))) == '#') && ((int32(Xsqlite3CtypeMap[uint8(*(*uint8)(unsafe.Pointer((*Token)(unsafe.Pointer(yymsp+4 /* &.minor */)).Fz + 1)))]) & 0x04) != 0)) {
- var n U32 = (*Token)(unsafe.Pointer(yymsp + 4 /* &.minor */)).Fn
- *(*uintptr)(unsafe.Pointer(yymsp + 4 /* &.minor */)) = tokenExpr(tls, pParse, TK_VARIABLE, *(*Token)(unsafe.Pointer(yymsp + 4 /* &.minor */)))
- Xsqlite3ExprAssignVarNumber(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + 4 /* &.minor */)), n)
+ if !(int32(*(*uint8)(unsafe.Pointer((*Token)(unsafe.Pointer(yymsp + 4)).Fz))) == '#' && int32(Xsqlite3CtypeMap[uint8(*(*uint8)(unsafe.Pointer((*Token)(unsafe.Pointer(yymsp+4)).Fz + 1)))])&0x04 != 0) {
+ var n U32 = (*Token)(unsafe.Pointer(yymsp + 4)).Fn
+ *(*uintptr)(unsafe.Pointer(yymsp + 4)) = tokenExpr(tls, pParse, TK_VARIABLE, *(*Token)(unsafe.Pointer(yymsp + 4)))
+ Xsqlite3ExprAssignVarNumber(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + 4)), n)
} else {
// When doing a nested parse, one can include terms in an expression
// that look like this: #1 #2 ... These terms refer to registers
// in the virtual machine. #N is the N-th register.
- *(*Token)(unsafe.Pointer(bp + 68 /* t */)) = *(*Token)(unsafe.Pointer(yymsp + 4 /* &.minor */)) //A-overwrites-X
+ *(*Token)(unsafe.Pointer(bp + 84 /* t */)) = *(*Token)(unsafe.Pointer(yymsp + 4)) //A-overwrites-X
if int32((*Parse)(unsafe.Pointer(pParse)).Fnested) == 0 {
- Xsqlite3ErrorMsg(tls, pParse, ts+21275 /* "near \"%T\": synta..." */, libc.VaList(bp+16, bp+68 /* &t */))
- *(*uintptr)(unsafe.Pointer(yymsp + 4 /* &.minor */)) = uintptr(0)
+ Xsqlite3ErrorMsg(tls, pParse, ts+22572 /* "near \"%T\": synta..." */, libc.VaList(bp+32, bp+84 /* &t */))
+ *(*uintptr)(unsafe.Pointer(yymsp + 4)) = uintptr(0)
} else {
- *(*uintptr)(unsafe.Pointer(yymsp + 4 /* &.minor */)) = Xsqlite3PExpr(tls, pParse, TK_REGISTER, uintptr(0), uintptr(0))
- if *(*uintptr)(unsafe.Pointer(yymsp + 4 /* &.minor */)) != 0 {
- Xsqlite3GetInt32(tls, ((*Token)(unsafe.Pointer(bp+68 /* &t */)).Fz + 1), (*(*uintptr)(unsafe.Pointer(yymsp + 4 /* &.minor */)) + 28 /* &.iTable */))
+ *(*uintptr)(unsafe.Pointer(yymsp + 4)) = Xsqlite3PExpr(tls, pParse, TK_REGISTER, uintptr(0), uintptr(0))
+ if *(*uintptr)(unsafe.Pointer(yymsp + 4)) != 0 {
+ Xsqlite3GetInt32(tls, (*Token)(unsafe.Pointer(bp+84)).Fz+1, *(*uintptr)(unsafe.Pointer(yymsp + 4))+28)
}
}
}
}
break
- case uint32(184): /* expr ::= expr COLLATE ID|STRING */
+ case uint32(186): /* expr ::= expr COLLATE ID|STRING */
{
- *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*12 + 4 /* &.minor */)) = Xsqlite3ExprAddCollateToken(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*12 + 4 /* &.minor */)), (yymsp + 4 /* &.minor */ /* &.yy0 */), 1)
+ *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*12 + 4)) = Xsqlite3ExprAddCollateToken(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*12 + 4)), yymsp+4, 1)
}
break
- case uint32(185): /* expr ::= CAST LP expr AS typetoken RP */
+ case uint32(187): /* expr ::= CAST LP expr AS typetoken RP */
{
- *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-5)*12 + 4 /* &.minor */)) = Xsqlite3ExprAlloc(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, TK_CAST, (yymsp + libc.UintptrFromInt32(-1)*12 + 4 /* &.minor */ /* &.yy0 */), 1)
- Xsqlite3ExprAttachSubtrees(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-5)*12 + 4 /* &.minor */)), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-3)*12 + 4 /* &.minor */)), uintptr(0))
+ *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-5)*12 + 4)) = Xsqlite3ExprAlloc(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, TK_CAST, yymsp+libc.UintptrFromInt32(-1)*12+4, 1)
+ Xsqlite3ExprAttachSubtrees(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-5)*12 + 4)), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-3)*12 + 4)), uintptr(0))
}
break
- case uint32(186): /* expr ::= ID|INDEXED LP distinct exprlist RP */
+ case uint32(188): /* expr ::= ID|INDEXED LP distinct exprlist RP */
{
- *(*uintptr)(unsafe.Pointer(bp + 60 /* &yylhsminor */)) = Xsqlite3ExprFunction(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*12 + 4 /* &.minor */)), (yymsp + libc.UintptrFromInt32(-4)*12 + 4 /* &.minor */ /* &.yy0 */), *(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*12 + 4 /* &.minor */)))
+ *(*uintptr)(unsafe.Pointer(bp + 40 /* &yylhsminor */)) = Xsqlite3ExprFunction(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*12 + 4)), yymsp+libc.UintptrFromInt32(-4)*12+4, *(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*12 + 4)))
}
- *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*12 + 4 /* &.minor */)) = *(*uintptr)(unsafe.Pointer(bp + 60 /* &yylhsminor */))
+ *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*12 + 4)) = *(*uintptr)(unsafe.Pointer(bp + 40 /* &yylhsminor */))
break
- case uint32(187): /* expr ::= ID|INDEXED LP STAR RP */
+ case uint32(189): /* expr ::= ID|INDEXED LP STAR RP */
{
- *(*uintptr)(unsafe.Pointer(bp + 60 /* &yylhsminor */)) = Xsqlite3ExprFunction(tls, pParse, uintptr(0), (yymsp + libc.UintptrFromInt32(-3)*12 + 4 /* &.minor */ /* &.yy0 */), 0)
+ *(*uintptr)(unsafe.Pointer(bp + 40 /* &yylhsminor */)) = Xsqlite3ExprFunction(tls, pParse, uintptr(0), yymsp+libc.UintptrFromInt32(-3)*12+4, 0)
}
- *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-3)*12 + 4 /* &.minor */)) = *(*uintptr)(unsafe.Pointer(bp + 60 /* &yylhsminor */))
+ *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-3)*12 + 4)) = *(*uintptr)(unsafe.Pointer(bp + 40 /* &yylhsminor */))
break
- case uint32(188): /* expr ::= ID|INDEXED LP distinct exprlist RP filter_over */
+ case uint32(190): /* expr ::= ID|INDEXED LP distinct exprlist RP filter_over */
{
- *(*uintptr)(unsafe.Pointer(bp + 60 /* &yylhsminor */)) = Xsqlite3ExprFunction(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*12 + 4 /* &.minor */)), (yymsp + libc.UintptrFromInt32(-5)*12 + 4 /* &.minor */ /* &.yy0 */), *(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-3)*12 + 4 /* &.minor */)))
- Xsqlite3WindowAttach(tls, pParse, *(*uintptr)(unsafe.Pointer(bp + 60 /* &yylhsminor */)), *(*uintptr)(unsafe.Pointer(yymsp + 4 /* &.minor */)))
+ *(*uintptr)(unsafe.Pointer(bp + 40 /* &yylhsminor */)) = Xsqlite3ExprFunction(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*12 + 4)), yymsp+libc.UintptrFromInt32(-5)*12+4, *(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-3)*12 + 4)))
+ Xsqlite3WindowAttach(tls, pParse, *(*uintptr)(unsafe.Pointer(bp + 40 /* &yylhsminor */)), *(*uintptr)(unsafe.Pointer(yymsp + 4)))
}
- *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-5)*12 + 4 /* &.minor */)) = *(*uintptr)(unsafe.Pointer(bp + 60 /* &yylhsminor */))
+ *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-5)*12 + 4)) = *(*uintptr)(unsafe.Pointer(bp + 40 /* &yylhsminor */))
break
- case uint32(189): /* expr ::= ID|INDEXED LP STAR RP filter_over */
+ case uint32(191): /* expr ::= ID|INDEXED LP STAR RP filter_over */
{
- *(*uintptr)(unsafe.Pointer(bp + 60 /* &yylhsminor */)) = Xsqlite3ExprFunction(tls, pParse, uintptr(0), (yymsp + libc.UintptrFromInt32(-4)*12 + 4 /* &.minor */ /* &.yy0 */), 0)
- Xsqlite3WindowAttach(tls, pParse, *(*uintptr)(unsafe.Pointer(bp + 60 /* &yylhsminor */)), *(*uintptr)(unsafe.Pointer(yymsp + 4 /* &.minor */)))
+ *(*uintptr)(unsafe.Pointer(bp + 40 /* &yylhsminor */)) = Xsqlite3ExprFunction(tls, pParse, uintptr(0), yymsp+libc.UintptrFromInt32(-4)*12+4, 0)
+ Xsqlite3WindowAttach(tls, pParse, *(*uintptr)(unsafe.Pointer(bp + 40 /* &yylhsminor */)), *(*uintptr)(unsafe.Pointer(yymsp + 4)))
}
- *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*12 + 4 /* &.minor */)) = *(*uintptr)(unsafe.Pointer(bp + 60 /* &yylhsminor */))
+ *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*12 + 4)) = *(*uintptr)(unsafe.Pointer(bp + 40 /* &yylhsminor */))
break
- case uint32(190): /* term ::= CTIME_KW */
+ case uint32(192): /* term ::= CTIME_KW */
{
- *(*uintptr)(unsafe.Pointer(bp + 60 /* &yylhsminor */)) = Xsqlite3ExprFunction(tls, pParse, uintptr(0), (yymsp + 4 /* &.minor */ /* &.yy0 */), 0)
+ *(*uintptr)(unsafe.Pointer(bp + 40 /* &yylhsminor */)) = Xsqlite3ExprFunction(tls, pParse, uintptr(0), yymsp+4, 0)
}
- *(*uintptr)(unsafe.Pointer(yymsp + 4 /* &.minor */)) = *(*uintptr)(unsafe.Pointer(bp + 60 /* &yylhsminor */))
+ *(*uintptr)(unsafe.Pointer(yymsp + 4)) = *(*uintptr)(unsafe.Pointer(bp + 40 /* &yylhsminor */))
break
- case uint32(191): /* expr ::= LP nexprlist COMMA expr RP */
+ case uint32(193): /* expr ::= LP nexprlist COMMA expr RP */
{
- var pList uintptr = Xsqlite3ExprListAppend(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-3)*12 + 4 /* &.minor */)), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*12 + 4 /* &.minor */)))
- *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*12 + 4 /* &.minor */)) = Xsqlite3PExpr(tls, pParse, TK_VECTOR, uintptr(0), uintptr(0))
- if *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*12 + 4 /* &.minor */)) != 0 {
- *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*12 + 4 /* &.minor */)) + 20 /* &.x */)) = pList
+ var pList uintptr = Xsqlite3ExprListAppend(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-3)*12 + 4)), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*12 + 4)))
+ *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*12 + 4)) = Xsqlite3PExpr(tls, pParse, TK_VECTOR, uintptr(0), uintptr(0))
+ if *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*12 + 4)) != 0 {
+ *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*12 + 4)) + 20)) = pList
if (*ExprList)(unsafe.Pointer(pList)).FnExpr != 0 {
- *(*U32)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*12 + 4 /* &.minor */)) + 4 /* &.flags */)) |= ((*Expr)(unsafe.Pointer((*ExprList_item)(unsafe.Pointer((pList + 8 /* &.a */))).FpExpr)).Fflags & (U32((EP_Collate | EP_Subquery) | EP_HasFunc)))
+ *(*U32)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*12 + 4)) + 4)) |= (*Expr)(unsafe.Pointer((*ExprList_item)(unsafe.Pointer(pList+8)).FpExpr)).Fflags & U32(EP_Collate|EP_Subquery|EP_HasFunc)
}
} else {
Xsqlite3ExprListDelete(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, pList)
}
}
break
- case uint32(192): /* expr ::= expr AND expr */
+ case uint32(194): /* expr ::= expr AND expr */
{
- *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*12 + 4 /* &.minor */)) = Xsqlite3ExprAnd(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*12 + 4 /* &.minor */)), *(*uintptr)(unsafe.Pointer(yymsp + 4 /* &.minor */)))
+ *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*12 + 4)) = Xsqlite3ExprAnd(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*12 + 4)), *(*uintptr)(unsafe.Pointer(yymsp + 4)))
}
break
- case uint32(193):
+ case uint32(195):
fallthrough // expr ::= expr OR expr
- case uint32(194): /* expr ::= expr LT|GT|GE|LE expr */
+ case uint32(196): /* expr ::= expr LT|GT|GE|LE expr */
fallthrough
- case uint32(195): /* expr ::= expr EQ|NE expr */
+ case uint32(197): /* expr ::= expr EQ|NE expr */
fallthrough
- case uint32(196): /* expr ::= expr BITAND|BITOR|LSHIFT|RSHIFT expr */
+ case uint32(198): /* expr ::= expr BITAND|BITOR|LSHIFT|RSHIFT expr */
fallthrough
- case uint32(197): /* expr ::= expr PLUS|MINUS expr */
+ case uint32(199): /* expr ::= expr PLUS|MINUS expr */
fallthrough
- case uint32(198): /* expr ::= expr STAR|SLASH|REM expr */
+ case uint32(200): /* expr ::= expr STAR|SLASH|REM expr */
fallthrough
- case uint32(199): /* expr ::= expr CONCAT expr */
+ case uint32(201): /* expr ::= expr CONCAT expr */
{
- *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*12 + 4 /* &.minor */)) = Xsqlite3PExpr(tls, pParse, int32((*YyStackEntry)(unsafe.Pointer(yymsp+libc.UintptrFromInt32(-1)*12)).Fmajor), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*12 + 4 /* &.minor */)), *(*uintptr)(unsafe.Pointer(yymsp + 4 /* &.minor */)))
+ *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*12 + 4)) = Xsqlite3PExpr(tls, pParse, int32((*YyStackEntry)(unsafe.Pointer(yymsp+libc.UintptrFromInt32(-1)*12)).Fmajor), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*12 + 4)), *(*uintptr)(unsafe.Pointer(yymsp + 4)))
}
break
- case uint32(200): /* likeop ::= NOT LIKE_KW|MATCH */
+ case uint32(202): /* likeop ::= NOT LIKE_KW|MATCH */
{
- *(*Token)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*12 + 4 /* &.minor */)) = *(*Token)(unsafe.Pointer(yymsp + 4 /* &.minor */))
- *(*uint32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*12 + 4 /* &.minor */ /* &.yy0 */ + 4 /* &.n */)) |= (0x80000000) /*yymsp[-1].minor.yy0-overwrite-yymsp[0].minor.yy0*/
+ *(*Token)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*12 + 4)) = *(*Token)(unsafe.Pointer(yymsp + 4))
+ *(*uint32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*12 + 4 + 4)) |= 0x80000000 /*yymsp[-1].minor.yy0-overwrite-yymsp[0].minor.yy0*/
}
break
- case uint32(201): /* expr ::= expr likeop expr */
+ case uint32(203): /* expr ::= expr likeop expr */
{
var pList uintptr
- var bNot int32 = (int32((*Token)(unsafe.Pointer(yymsp+libc.UintptrFromInt32(-1)*12+4 /* &.minor */)).Fn & 0x80000000))
- *(*uint32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*12 + 4 /* &.minor */ /* &.yy0 */ + 4 /* &.n */)) &= (uint32(0x7fffffff))
- pList = Xsqlite3ExprListAppend(tls, pParse, uintptr(0), *(*uintptr)(unsafe.Pointer(yymsp + 4 /* &.minor */)))
- pList = Xsqlite3ExprListAppend(tls, pParse, pList, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*12 + 4 /* &.minor */)))
- *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*12 + 4 /* &.minor */)) = Xsqlite3ExprFunction(tls, pParse, pList, (yymsp + libc.UintptrFromInt32(-1)*12 + 4 /* &.minor */ /* &.yy0 */), 0)
+ var bNot int32 = int32((*Token)(unsafe.Pointer(yymsp+libc.UintptrFromInt32(-1)*12+4)).Fn & 0x80000000)
+ *(*uint32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*12 + 4 + 4)) &= uint32(0x7fffffff)
+ pList = Xsqlite3ExprListAppend(tls, pParse, uintptr(0), *(*uintptr)(unsafe.Pointer(yymsp + 4)))
+ pList = Xsqlite3ExprListAppend(tls, pParse, pList, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*12 + 4)))
+ *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*12 + 4)) = Xsqlite3ExprFunction(tls, pParse, pList, yymsp+libc.UintptrFromInt32(-1)*12+4, 0)
if bNot != 0 {
- *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*12 + 4 /* &.minor */)) = Xsqlite3PExpr(tls, pParse, TK_NOT, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*12 + 4 /* &.minor */)), uintptr(0))
+ *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*12 + 4)) = Xsqlite3PExpr(tls, pParse, TK_NOT, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*12 + 4)), uintptr(0))
}
- if *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*12 + 4 /* &.minor */)) != 0 {
- *(*U32)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*12 + 4 /* &.minor */)) + 4 /* &.flags */)) |= (U32(EP_InfixFunc))
+ if *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*12 + 4)) != 0 {
+ *(*U32)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*12 + 4)) + 4)) |= U32(EP_InfixFunc)
}
}
break
- case uint32(202): /* expr ::= expr likeop expr ESCAPE expr */
+ case uint32(204): /* expr ::= expr likeop expr ESCAPE expr */
{
var pList uintptr
- var bNot int32 = (int32((*Token)(unsafe.Pointer(yymsp+libc.UintptrFromInt32(-3)*12+4 /* &.minor */)).Fn & 0x80000000))
- *(*uint32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-3)*12 + 4 /* &.minor */ /* &.yy0 */ + 4 /* &.n */)) &= (uint32(0x7fffffff))
- pList = Xsqlite3ExprListAppend(tls, pParse, uintptr(0), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*12 + 4 /* &.minor */)))
- pList = Xsqlite3ExprListAppend(tls, pParse, pList, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*12 + 4 /* &.minor */)))
- pList = Xsqlite3ExprListAppend(tls, pParse, pList, *(*uintptr)(unsafe.Pointer(yymsp + 4 /* &.minor */)))
- *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*12 + 4 /* &.minor */)) = Xsqlite3ExprFunction(tls, pParse, pList, (yymsp + libc.UintptrFromInt32(-3)*12 + 4 /* &.minor */ /* &.yy0 */), 0)
+ var bNot int32 = int32((*Token)(unsafe.Pointer(yymsp+libc.UintptrFromInt32(-3)*12+4)).Fn & 0x80000000)
+ *(*uint32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-3)*12 + 4 + 4)) &= uint32(0x7fffffff)
+ pList = Xsqlite3ExprListAppend(tls, pParse, uintptr(0), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*12 + 4)))
+ pList = Xsqlite3ExprListAppend(tls, pParse, pList, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*12 + 4)))
+ pList = Xsqlite3ExprListAppend(tls, pParse, pList, *(*uintptr)(unsafe.Pointer(yymsp + 4)))
+ *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*12 + 4)) = Xsqlite3ExprFunction(tls, pParse, pList, yymsp+libc.UintptrFromInt32(-3)*12+4, 0)
if bNot != 0 {
- *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*12 + 4 /* &.minor */)) = Xsqlite3PExpr(tls, pParse, TK_NOT, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*12 + 4 /* &.minor */)), uintptr(0))
+ *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*12 + 4)) = Xsqlite3PExpr(tls, pParse, TK_NOT, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*12 + 4)), uintptr(0))
}
- if *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*12 + 4 /* &.minor */)) != 0 {
- *(*U32)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*12 + 4 /* &.minor */)) + 4 /* &.flags */)) |= (U32(EP_InfixFunc))
+ if *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*12 + 4)) != 0 {
+ *(*U32)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*12 + 4)) + 4)) |= U32(EP_InfixFunc)
}
}
break
- case uint32(203): /* expr ::= expr ISNULL|NOTNULL */
+ case uint32(205): /* expr ::= expr ISNULL|NOTNULL */
{
- *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*12 + 4 /* &.minor */)) = Xsqlite3PExpr(tls, pParse, int32((*YyStackEntry)(unsafe.Pointer(yymsp)).Fmajor), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*12 + 4 /* &.minor */)), uintptr(0))
+ *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*12 + 4)) = Xsqlite3PExpr(tls, pParse, int32((*YyStackEntry)(unsafe.Pointer(yymsp)).Fmajor), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*12 + 4)), uintptr(0))
}
break
- case uint32(204): /* expr ::= expr NOT NULL */
+ case uint32(206): /* expr ::= expr NOT NULL */
{
- *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*12 + 4 /* &.minor */)) = Xsqlite3PExpr(tls, pParse, TK_NOTNULL, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*12 + 4 /* &.minor */)), uintptr(0))
+ *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*12 + 4)) = Xsqlite3PExpr(tls, pParse, TK_NOTNULL, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*12 + 4)), uintptr(0))
}
break
- case uint32(205): /* expr ::= expr IS expr */
+ case uint32(207): /* expr ::= expr IS expr */
{
- *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*12 + 4 /* &.minor */)) = Xsqlite3PExpr(tls, pParse, TK_IS, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*12 + 4 /* &.minor */)), *(*uintptr)(unsafe.Pointer(yymsp + 4 /* &.minor */)))
- binaryToUnaryIfNull(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + 4 /* &.minor */)), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*12 + 4 /* &.minor */)), TK_ISNULL)
+ *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*12 + 4)) = Xsqlite3PExpr(tls, pParse, TK_IS, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*12 + 4)), *(*uintptr)(unsafe.Pointer(yymsp + 4)))
+ binaryToUnaryIfNull(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + 4)), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*12 + 4)), TK_ISNULL)
}
break
- case uint32(206): /* expr ::= expr IS NOT expr */
+ case uint32(208): /* expr ::= expr IS NOT expr */
{
- *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-3)*12 + 4 /* &.minor */)) = Xsqlite3PExpr(tls, pParse, TK_ISNOT, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-3)*12 + 4 /* &.minor */)), *(*uintptr)(unsafe.Pointer(yymsp + 4 /* &.minor */)))
- binaryToUnaryIfNull(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + 4 /* &.minor */)), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-3)*12 + 4 /* &.minor */)), TK_NOTNULL)
+ *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-3)*12 + 4)) = Xsqlite3PExpr(tls, pParse, TK_ISNOT, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-3)*12 + 4)), *(*uintptr)(unsafe.Pointer(yymsp + 4)))
+ binaryToUnaryIfNull(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + 4)), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-3)*12 + 4)), TK_NOTNULL)
}
break
- case uint32(207):
+ case uint32(209):
fallthrough // expr ::= NOT expr
- case uint32(208): /* expr ::= BITNOT expr */
+ case uint32(210): /* expr ::= BITNOT expr */
{
- *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*12 + 4 /* &.minor */)) = Xsqlite3PExpr(tls, pParse, int32((*YyStackEntry)(unsafe.Pointer(yymsp+libc.UintptrFromInt32(-1)*12)).Fmajor), *(*uintptr)(unsafe.Pointer(yymsp + 4 /* &.minor */)), uintptr(0)) /*A-overwrites-B*/
+ *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*12 + 4)) = Xsqlite3PExpr(tls, pParse, int32((*YyStackEntry)(unsafe.Pointer(yymsp+libc.UintptrFromInt32(-1)*12)).Fmajor), *(*uintptr)(unsafe.Pointer(yymsp + 4)), uintptr(0)) /*A-overwrites-B*/
}
break
- case uint32(209): /* expr ::= PLUS|MINUS expr */
+ case uint32(211): /* expr ::= PLUS|MINUS expr */
{
- *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*12 + 4 /* &.minor */)) = Xsqlite3PExpr(tls, pParse, func() int32 {
+ *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*12 + 4)) = Xsqlite3PExpr(tls, pParse, func() int32 {
if int32((*YyStackEntry)(unsafe.Pointer(yymsp+libc.UintptrFromInt32(-1)*12)).Fmajor) == TK_PLUS {
return TK_UPLUS
}
@@ -142760,31 +144867,31 @@ func yy_reduce(tls *libc.TLS, yypParser uintptr, yyruleno uint32, yyLookahead in
//A-overwrites-B
}
break
- case uint32(210):
+ case uint32(212):
fallthrough // between_op ::= BETWEEN
- case uint32(213): /* in_op ::= IN */
+ case uint32(215): /* in_op ::= IN */
{
- *(*int32)(unsafe.Pointer(yymsp + 4 /* &.minor */)) = 0
+ *(*int32)(unsafe.Pointer(yymsp + 4)) = 0
}
break
- case uint32(212): /* expr ::= expr between_op expr AND expr */
+ case uint32(214): /* expr ::= expr between_op expr AND expr */
{
- var pList uintptr = Xsqlite3ExprListAppend(tls, pParse, uintptr(0), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*12 + 4 /* &.minor */)))
- pList = Xsqlite3ExprListAppend(tls, pParse, pList, *(*uintptr)(unsafe.Pointer(yymsp + 4 /* &.minor */)))
- *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*12 + 4 /* &.minor */)) = Xsqlite3PExpr(tls, pParse, TK_BETWEEN, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*12 + 4 /* &.minor */)), uintptr(0))
- if *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*12 + 4 /* &.minor */)) != 0 {
- *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*12 + 4 /* &.minor */)) + 20 /* &.x */)) = pList
+ var pList uintptr = Xsqlite3ExprListAppend(tls, pParse, uintptr(0), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*12 + 4)))
+ pList = Xsqlite3ExprListAppend(tls, pParse, pList, *(*uintptr)(unsafe.Pointer(yymsp + 4)))
+ *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*12 + 4)) = Xsqlite3PExpr(tls, pParse, TK_BETWEEN, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*12 + 4)), uintptr(0))
+ if *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*12 + 4)) != 0 {
+ *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*12 + 4)) + 20)) = pList
} else {
Xsqlite3ExprListDelete(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, pList)
}
- if *(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-3)*12 + 4 /* &.minor */)) != 0 {
- *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*12 + 4 /* &.minor */)) = Xsqlite3PExpr(tls, pParse, TK_NOT, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*12 + 4 /* &.minor */)), uintptr(0))
+ if *(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-3)*12 + 4)) != 0 {
+ *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*12 + 4)) = Xsqlite3PExpr(tls, pParse, TK_NOT, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*12 + 4)), uintptr(0))
}
}
break
- case uint32(215): /* expr ::= expr in_op LP exprlist RP */
+ case uint32(217): /* expr ::= expr in_op LP exprlist RP */
{
- if *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*12 + 4 /* &.minor */)) == uintptr(0) {
+ if *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*12 + 4)) == uintptr(0) {
// Expressions of the form
//
// expr1 IN ()
@@ -142792,59 +144899,65 @@ func yy_reduce(tls *libc.TLS, yypParser uintptr, yyruleno uint32, yyLookahead in
//
// simplify to constants 0 (false) and 1 (true), respectively,
// regardless of the value of expr1.
- Xsqlite3ExprUnmapAndDelete(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*12 + 4 /* &.minor */)))
- *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*12 + 4 /* &.minor */)) = Xsqlite3Expr(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, TK_INTEGER, func() uintptr {
- if *(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-3)*12 + 4 /* &.minor */)) != 0 {
- return ts + 6913 /* "1" */
+ Xsqlite3ExprUnmapAndDelete(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*12 + 4)))
+ *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*12 + 4)) = Xsqlite3Expr(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, TK_INTEGER, func() uintptr {
+ if *(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-3)*12 + 4)) != 0 {
+ return ts + 7806 /* "1" */
}
- return ts + 6506 /* "0" */
+ return ts + 7399 /* "0" */
}())
- } else if ((*ExprList)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*12 + 4 /* &.minor */)))).FnExpr == 1) && (Xsqlite3ExprIsConstant(tls, (*ExprList_item)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*12 + 4 /* &.minor */))+8 /* &.a */))).FpExpr) != 0) {
- var pRHS uintptr = (*ExprList_item)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*12 + 4 /* &.minor */)) + 8 /* &.a */))).FpExpr
- (*ExprList_item)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*12 + 4 /* &.minor */)) + 8 /* &.a */))).FpExpr = uintptr(0)
- Xsqlite3ExprListDelete(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*12 + 4 /* &.minor */)))
- pRHS = Xsqlite3PExpr(tls, pParse, TK_UPLUS, pRHS, uintptr(0))
- *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*12 + 4 /* &.minor */)) = Xsqlite3PExpr(tls, pParse, TK_EQ, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*12 + 4 /* &.minor */)), pRHS)
- if *(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-3)*12 + 4 /* &.minor */)) != 0 {
- *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*12 + 4 /* &.minor */)) = Xsqlite3PExpr(tls, pParse, TK_NOT, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*12 + 4 /* &.minor */)), uintptr(0))
- }
} else {
- *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*12 + 4 /* &.minor */)) = Xsqlite3PExpr(tls, pParse, TK_IN, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*12 + 4 /* &.minor */)), uintptr(0))
- if *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*12 + 4 /* &.minor */)) != 0 {
- *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*12 + 4 /* &.minor */)) + 20 /* &.x */)) = *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*12 + 4 /* &.minor */))
- Xsqlite3ExprSetHeightAndFlags(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*12 + 4 /* &.minor */)))
+ var pRHS uintptr = (*ExprList_item)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*12 + 4)) + 8)).FpExpr
+ if (*ExprList)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*12 + 4)))).FnExpr == 1 && Xsqlite3ExprIsConstant(tls, pRHS) != 0 && int32((*Expr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*12 + 4)))).Fop) != TK_VECTOR {
+ (*ExprList_item)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*12 + 4)) + 8)).FpExpr = uintptr(0)
+ Xsqlite3ExprListDelete(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*12 + 4)))
+ pRHS = Xsqlite3PExpr(tls, pParse, TK_UPLUS, pRHS, uintptr(0))
+ *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*12 + 4)) = Xsqlite3PExpr(tls, pParse, TK_EQ, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*12 + 4)), pRHS)
} else {
- Xsqlite3ExprListDelete(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*12 + 4 /* &.minor */)))
+ *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*12 + 4)) = Xsqlite3PExpr(tls, pParse, TK_IN, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*12 + 4)), uintptr(0))
+ if *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*12 + 4)) == uintptr(0) {
+ Xsqlite3ExprListDelete(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*12 + 4)))
+ } else if int32((*Expr)(unsafe.Pointer((*Expr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*12 + 4)))).FpLeft)).Fop) == TK_VECTOR {
+ var nExpr int32 = (*ExprList)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((*Expr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*12 + 4)))).FpLeft + 20)))).FnExpr
+ var pSelectRHS uintptr = Xsqlite3ExprListToValues(tls, pParse, nExpr, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*12 + 4)))
+ if pSelectRHS != 0 {
+ parserDoubleLinkSelect(tls, pParse, pSelectRHS)
+ Xsqlite3PExprAddSelect(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*12 + 4)), pSelectRHS)
+ }
+ } else {
+ *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*12 + 4)) + 20)) = *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*12 + 4))
+ Xsqlite3ExprSetHeightAndFlags(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*12 + 4)))
+ }
}
- if *(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-3)*12 + 4 /* &.minor */)) != 0 {
- *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*12 + 4 /* &.minor */)) = Xsqlite3PExpr(tls, pParse, TK_NOT, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*12 + 4 /* &.minor */)), uintptr(0))
+ if *(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-3)*12 + 4)) != 0 {
+ *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*12 + 4)) = Xsqlite3PExpr(tls, pParse, TK_NOT, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*12 + 4)), uintptr(0))
}
}
}
break
- case uint32(216): /* expr ::= LP select RP */
+ case uint32(218): /* expr ::= LP select RP */
{
- *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*12 + 4 /* &.minor */)) = Xsqlite3PExpr(tls, pParse, TK_SELECT, uintptr(0), uintptr(0))
- Xsqlite3PExprAddSelect(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*12 + 4 /* &.minor */)), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*12 + 4 /* &.minor */)))
+ *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*12 + 4)) = Xsqlite3PExpr(tls, pParse, TK_SELECT, uintptr(0), uintptr(0))
+ Xsqlite3PExprAddSelect(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*12 + 4)), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*12 + 4)))
}
break
- case uint32(217): /* expr ::= expr in_op LP select RP */
+ case uint32(219): /* expr ::= expr in_op LP select RP */
{
- *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*12 + 4 /* &.minor */)) = Xsqlite3PExpr(tls, pParse, TK_IN, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*12 + 4 /* &.minor */)), uintptr(0))
- Xsqlite3PExprAddSelect(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*12 + 4 /* &.minor */)), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*12 + 4 /* &.minor */)))
- if *(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-3)*12 + 4 /* &.minor */)) != 0 {
- *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*12 + 4 /* &.minor */)) = Xsqlite3PExpr(tls, pParse, TK_NOT, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*12 + 4 /* &.minor */)), uintptr(0))
+ *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*12 + 4)) = Xsqlite3PExpr(tls, pParse, TK_IN, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*12 + 4)), uintptr(0))
+ Xsqlite3PExprAddSelect(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*12 + 4)), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*12 + 4)))
+ if *(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-3)*12 + 4)) != 0 {
+ *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*12 + 4)) = Xsqlite3PExpr(tls, pParse, TK_NOT, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*12 + 4)), uintptr(0))
}
}
break
- case uint32(218): /* expr ::= expr in_op nm dbnm paren_exprlist */
+ case uint32(220): /* expr ::= expr in_op nm dbnm paren_exprlist */
{
- var pSrc uintptr = Xsqlite3SrcListAppend(tls, pParse, uintptr(0), (yymsp + libc.UintptrFromInt32(-2)*12 + 4 /* &.minor */ /* &.yy0 */), (yymsp + libc.UintptrFromInt32(-1)*12 + 4 /* &.minor */ /* &.yy0 */))
+ var pSrc uintptr = Xsqlite3SrcListAppend(tls, pParse, uintptr(0), yymsp+libc.UintptrFromInt32(-2)*12+4, yymsp+libc.UintptrFromInt32(-1)*12+4)
var pSelect uintptr = Xsqlite3SelectNew(tls, pParse, uintptr(0), pSrc, uintptr(0), uintptr(0), uintptr(0), uintptr(0), uint32(0), uintptr(0))
- if *(*uintptr)(unsafe.Pointer(yymsp + 4 /* &.minor */)) != 0 {
+ if *(*uintptr)(unsafe.Pointer(yymsp + 4)) != 0 {
Xsqlite3SrcListFuncArgs(tls, pParse, func() uintptr {
if pSelect != 0 {
return pSrc
@@ -142852,655 +144965,656 @@ func yy_reduce(tls *libc.TLS, yypParser uintptr, yyruleno uint32, yyLookahead in
return uintptr(0)
}(), *(*uintptr)(unsafe.Pointer(yymsp + 4 /* &.minor */)))
}
- *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*12 + 4 /* &.minor */)) = Xsqlite3PExpr(tls, pParse, TK_IN, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*12 + 4 /* &.minor */)), uintptr(0))
- Xsqlite3PExprAddSelect(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*12 + 4 /* &.minor */)), pSelect)
- if *(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-3)*12 + 4 /* &.minor */)) != 0 {
- *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*12 + 4 /* &.minor */)) = Xsqlite3PExpr(tls, pParse, TK_NOT, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*12 + 4 /* &.minor */)), uintptr(0))
+ *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*12 + 4)) = Xsqlite3PExpr(tls, pParse, TK_IN, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*12 + 4)), uintptr(0))
+ Xsqlite3PExprAddSelect(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*12 + 4)), pSelect)
+ if *(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-3)*12 + 4)) != 0 {
+ *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*12 + 4)) = Xsqlite3PExpr(tls, pParse, TK_NOT, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*12 + 4)), uintptr(0))
}
}
break
- case uint32(219): /* expr ::= EXISTS LP select RP */
+ case uint32(221): /* expr ::= EXISTS LP select RP */
{
var p uintptr
- p = libc.AssignPtrUintptr(yymsp+libc.UintptrFromInt32(-3)*12+4 /* &.minor */ /* &.yy404 */, Xsqlite3PExpr(tls, pParse, TK_EXISTS, uintptr(0), uintptr(0)))
- Xsqlite3PExprAddSelect(tls, pParse, p, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*12 + 4 /* &.minor */)))
+ p = libc.AssignPtrUintptr(yymsp+libc.UintptrFromInt32(-3)*12+4, Xsqlite3PExpr(tls, pParse, TK_EXISTS, uintptr(0), uintptr(0)))
+ Xsqlite3PExprAddSelect(tls, pParse, p, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*12 + 4)))
}
break
- case uint32(220): /* expr ::= CASE case_operand case_exprlist case_else END */
+ case uint32(222): /* expr ::= CASE case_operand case_exprlist case_else END */
{
- *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*12 + 4 /* &.minor */)) = Xsqlite3PExpr(tls, pParse, TK_CASE, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-3)*12 + 4 /* &.minor */)), uintptr(0))
- if *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*12 + 4 /* &.minor */)) != 0 {
- *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*12 + 4 /* &.minor */)) + 20 /* &.x */)) = func() uintptr {
- if *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*12 + 4 /* &.minor */)) != 0 {
- return Xsqlite3ExprListAppend(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*12 + 4 /* &.minor */)), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*12 + 4 /* &.minor */)))
+ *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*12 + 4)) = Xsqlite3PExpr(tls, pParse, TK_CASE, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-3)*12 + 4)), uintptr(0))
+ if *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*12 + 4)) != 0 {
+ *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*12 + 4)) + 20)) = func() uintptr {
+ if *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*12 + 4)) != 0 {
+ return Xsqlite3ExprListAppend(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*12 + 4)), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*12 + 4)))
}
- return *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*12 + 4 /* &.minor */))
+ return *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*12 + 4))
}()
- Xsqlite3ExprSetHeightAndFlags(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*12 + 4 /* &.minor */)))
+ Xsqlite3ExprSetHeightAndFlags(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*12 + 4)))
} else {
- Xsqlite3ExprListDelete(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*12 + 4 /* &.minor */)))
- Xsqlite3ExprDelete(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*12 + 4 /* &.minor */)))
+ Xsqlite3ExprListDelete(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*12 + 4)))
+ Xsqlite3ExprDelete(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*12 + 4)))
}
}
break
- case uint32(221): /* case_exprlist ::= case_exprlist WHEN expr THEN expr */
+ case uint32(223): /* case_exprlist ::= case_exprlist WHEN expr THEN expr */
{
- *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*12 + 4 /* &.minor */)) = Xsqlite3ExprListAppend(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*12 + 4 /* &.minor */)), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*12 + 4 /* &.minor */)))
- *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*12 + 4 /* &.minor */)) = Xsqlite3ExprListAppend(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*12 + 4 /* &.minor */)), *(*uintptr)(unsafe.Pointer(yymsp + 4 /* &.minor */)))
+ *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*12 + 4)) = Xsqlite3ExprListAppend(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*12 + 4)), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*12 + 4)))
+ *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*12 + 4)) = Xsqlite3ExprListAppend(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*12 + 4)), *(*uintptr)(unsafe.Pointer(yymsp + 4)))
}
break
- case uint32(222): /* case_exprlist ::= WHEN expr THEN expr */
+ case uint32(224): /* case_exprlist ::= WHEN expr THEN expr */
{
- *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-3)*12 + 4 /* &.minor */)) = Xsqlite3ExprListAppend(tls, pParse, uintptr(0), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*12 + 4 /* &.minor */)))
- *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-3)*12 + 4 /* &.minor */)) = Xsqlite3ExprListAppend(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-3)*12 + 4 /* &.minor */)), *(*uintptr)(unsafe.Pointer(yymsp + 4 /* &.minor */)))
+ *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-3)*12 + 4)) = Xsqlite3ExprListAppend(tls, pParse, uintptr(0), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*12 + 4)))
+ *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-3)*12 + 4)) = Xsqlite3ExprListAppend(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-3)*12 + 4)), *(*uintptr)(unsafe.Pointer(yymsp + 4)))
}
break
- case uint32(225): /* case_operand ::= expr */
+ case uint32(227): /* case_operand ::= expr */
{
- *(*uintptr)(unsafe.Pointer(yymsp + 4 /* &.minor */)) = *(*uintptr)(unsafe.Pointer(yymsp + 4 /* &.minor */)) /*A-overwrites-X*/
+ *(*uintptr)(unsafe.Pointer(yymsp + 4)) = *(*uintptr)(unsafe.Pointer(yymsp + 4)) /*A-overwrites-X*/
}
break
- case uint32(228): /* nexprlist ::= nexprlist COMMA expr */
+ case uint32(230): /* nexprlist ::= nexprlist COMMA expr */
{
- *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*12 + 4 /* &.minor */)) = Xsqlite3ExprListAppend(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*12 + 4 /* &.minor */)), *(*uintptr)(unsafe.Pointer(yymsp + 4 /* &.minor */)))
+ *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*12 + 4)) = Xsqlite3ExprListAppend(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*12 + 4)), *(*uintptr)(unsafe.Pointer(yymsp + 4)))
}
break
- case uint32(229): /* nexprlist ::= expr */
+ case uint32(231): /* nexprlist ::= expr */
{
- *(*uintptr)(unsafe.Pointer(yymsp + 4 /* &.minor */)) = Xsqlite3ExprListAppend(tls, pParse, uintptr(0), *(*uintptr)(unsafe.Pointer(yymsp + 4 /* &.minor */))) /*A-overwrites-Y*/
+ *(*uintptr)(unsafe.Pointer(yymsp + 4)) = Xsqlite3ExprListAppend(tls, pParse, uintptr(0), *(*uintptr)(unsafe.Pointer(yymsp + 4))) /*A-overwrites-Y*/
}
break
- case uint32(231):
+ case uint32(233):
fallthrough // paren_exprlist ::= LP exprlist RP
- case uint32(236): /* eidlist_opt ::= LP eidlist RP */
+ case uint32(238): /* eidlist_opt ::= LP eidlist RP */
{
- *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*12 + 4 /* &.minor */)) = *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*12 + 4 /* &.minor */))
+ *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*12 + 4)) = *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*12 + 4))
}
break
- case uint32(232): /* cmd ::= createkw uniqueflag INDEX ifnotexists nm dbnm ON nm LP sortlist RP where_opt */
+ case uint32(234): /* cmd ::= createkw uniqueflag INDEX ifnotexists nm dbnm ON nm LP sortlist RP where_opt */
{
- Xsqlite3CreateIndex(tls, pParse, (yymsp + libc.UintptrFromInt32(-7)*12 + 4 /* &.minor */ /* &.yy0 */), (yymsp + libc.UintptrFromInt32(-6)*12 + 4 /* &.minor */ /* &.yy0 */),
- Xsqlite3SrcListAppend(tls, pParse, uintptr(0), (yymsp+libc.UintptrFromInt32(-4)*12+4 /* &.minor */ /* &.yy0 */), uintptr(0)), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*12 + 4 /* &.minor */)), *(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-10)*12 + 4 /* &.minor */)),
- (yymsp + libc.UintptrFromInt32(-11)*12 + 4 /* &.minor */ /* &.yy0 */), *(*uintptr)(unsafe.Pointer(yymsp + 4 /* &.minor */)), SQLITE_SO_ASC, *(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-8)*12 + 4 /* &.minor */)), uint8(SQLITE_IDXTYPE_APPDEF))
- if (int32((*Parse)(unsafe.Pointer(pParse)).FeParseMode) >= PARSE_MODE_RENAME) && ((*Parse)(unsafe.Pointer(pParse)).FpNewIndex != 0) {
- Xsqlite3RenameTokenMap(tls, pParse, (*Index)(unsafe.Pointer((*Parse)(unsafe.Pointer(pParse)).FpNewIndex)).FzName, (yymsp + libc.UintptrFromInt32(-4)*12 + 4 /* &.minor */ /* &.yy0 */))
+ Xsqlite3CreateIndex(tls, pParse, yymsp+libc.UintptrFromInt32(-7)*12+4, yymsp+libc.UintptrFromInt32(-6)*12+4,
+ Xsqlite3SrcListAppend(tls, pParse, uintptr(0), yymsp+libc.UintptrFromInt32(-4)*12+4, uintptr(0)), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*12 + 4)), *(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-10)*12 + 4)),
+ yymsp+libc.UintptrFromInt32(-11)*12+4, *(*uintptr)(unsafe.Pointer(yymsp + 4)), SQLITE_SO_ASC, *(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-8)*12 + 4)), uint8(SQLITE_IDXTYPE_APPDEF))
+ if int32((*Parse)(unsafe.Pointer(pParse)).FeParseMode) >= PARSE_MODE_RENAME && (*Parse)(unsafe.Pointer(pParse)).FpNewIndex != 0 {
+ Xsqlite3RenameTokenMap(tls, pParse, (*Index)(unsafe.Pointer((*Parse)(unsafe.Pointer(pParse)).FpNewIndex)).FzName, yymsp+libc.UintptrFromInt32(-4)*12+4)
}
}
break
- case uint32(233):
+ case uint32(235):
fallthrough // uniqueflag ::= UNIQUE
- case uint32(275): /* raisetype ::= ABORT */
+ case uint32(277): /* raisetype ::= ABORT */
{
- *(*int32)(unsafe.Pointer(yymsp + 4 /* &.minor */)) = OE_Abort
+ *(*int32)(unsafe.Pointer(yymsp + 4)) = OE_Abort
}
break
- case uint32(234): /* uniqueflag ::= */
+ case uint32(236): /* uniqueflag ::= */
{
- *(*int32)(unsafe.Pointer(yymsp + 1*12 + 4 /* &.minor */)) = OE_None
+ *(*int32)(unsafe.Pointer(yymsp + 1*12 + 4)) = OE_None
}
break
- case uint32(237): /* eidlist ::= eidlist COMMA nm collate sortorder */
+ case uint32(239): /* eidlist ::= eidlist COMMA nm collate sortorder */
{
- *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*12 + 4 /* &.minor */)) = parserAddExprIdListTerm(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*12 + 4 /* &.minor */)), (yymsp + libc.UintptrFromInt32(-2)*12 + 4 /* &.minor */ /* &.yy0 */), *(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*12 + 4 /* &.minor */)), *(*int32)(unsafe.Pointer(yymsp + 4 /* &.minor */)))
+ *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*12 + 4)) = parserAddExprIdListTerm(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*12 + 4)), yymsp+libc.UintptrFromInt32(-2)*12+4, *(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*12 + 4)), *(*int32)(unsafe.Pointer(yymsp + 4)))
}
break
- case uint32(238): /* eidlist ::= nm collate sortorder */
+ case uint32(240): /* eidlist ::= nm collate sortorder */
{
- *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*12 + 4 /* &.minor */)) = parserAddExprIdListTerm(tls, pParse, uintptr(0), (yymsp + libc.UintptrFromInt32(-2)*12 + 4 /* &.minor */ /* &.yy0 */), *(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*12 + 4 /* &.minor */)), *(*int32)(unsafe.Pointer(yymsp + 4 /* &.minor */))) //A-overwrites-Y
+ *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*12 + 4)) = parserAddExprIdListTerm(tls, pParse, uintptr(0), yymsp+libc.UintptrFromInt32(-2)*12+4, *(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*12 + 4)), *(*int32)(unsafe.Pointer(yymsp + 4))) //A-overwrites-Y
}
break
- case uint32(241): /* cmd ::= DROP INDEX ifexists fullname */
+ case uint32(243): /* cmd ::= DROP INDEX ifexists fullname */
{
- Xsqlite3DropIndex(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + 4 /* &.minor */)), *(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*12 + 4 /* &.minor */)))
+ Xsqlite3DropIndex(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + 4)), *(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*12 + 4)))
}
break
- case uint32(242): /* cmd ::= VACUUM vinto */
+ case uint32(244): /* cmd ::= VACUUM vinto */
{
- Xsqlite3Vacuum(tls, pParse, uintptr(0), *(*uintptr)(unsafe.Pointer(yymsp + 4 /* &.minor */)))
+ Xsqlite3Vacuum(tls, pParse, uintptr(0), *(*uintptr)(unsafe.Pointer(yymsp + 4)))
}
break
- case uint32(243): /* cmd ::= VACUUM nm vinto */
+ case uint32(245): /* cmd ::= VACUUM nm vinto */
{
- Xsqlite3Vacuum(tls, pParse, (yymsp + libc.UintptrFromInt32(-1)*12 + 4 /* &.minor */ /* &.yy0 */), *(*uintptr)(unsafe.Pointer(yymsp + 4 /* &.minor */)))
+ Xsqlite3Vacuum(tls, pParse, yymsp+libc.UintptrFromInt32(-1)*12+4, *(*uintptr)(unsafe.Pointer(yymsp + 4)))
}
break
- case uint32(246): /* cmd ::= PRAGMA nm dbnm */
+ case uint32(248): /* cmd ::= PRAGMA nm dbnm */
{
- Xsqlite3Pragma(tls, pParse, (yymsp + libc.UintptrFromInt32(-1)*12 + 4 /* &.minor */ /* &.yy0 */), (yymsp + 4 /* &.minor */ /* &.yy0 */), uintptr(0), 0)
+ Xsqlite3Pragma(tls, pParse, yymsp+libc.UintptrFromInt32(-1)*12+4, yymsp+4, uintptr(0), 0)
}
break
- case uint32(247): /* cmd ::= PRAGMA nm dbnm EQ nmnum */
+ case uint32(249): /* cmd ::= PRAGMA nm dbnm EQ nmnum */
{
- Xsqlite3Pragma(tls, pParse, (yymsp + libc.UintptrFromInt32(-3)*12 + 4 /* &.minor */ /* &.yy0 */), (yymsp + libc.UintptrFromInt32(-2)*12 + 4 /* &.minor */ /* &.yy0 */), (yymsp + 4 /* &.minor */ /* &.yy0 */), 0)
+ Xsqlite3Pragma(tls, pParse, yymsp+libc.UintptrFromInt32(-3)*12+4, yymsp+libc.UintptrFromInt32(-2)*12+4, yymsp+4, 0)
}
break
- case uint32(248): /* cmd ::= PRAGMA nm dbnm LP nmnum RP */
+ case uint32(250): /* cmd ::= PRAGMA nm dbnm LP nmnum RP */
{
- Xsqlite3Pragma(tls, pParse, (yymsp + libc.UintptrFromInt32(-4)*12 + 4 /* &.minor */ /* &.yy0 */), (yymsp + libc.UintptrFromInt32(-3)*12 + 4 /* &.minor */ /* &.yy0 */), (yymsp + libc.UintptrFromInt32(-1)*12 + 4 /* &.minor */ /* &.yy0 */), 0)
+ Xsqlite3Pragma(tls, pParse, yymsp+libc.UintptrFromInt32(-4)*12+4, yymsp+libc.UintptrFromInt32(-3)*12+4, yymsp+libc.UintptrFromInt32(-1)*12+4, 0)
}
break
- case uint32(249): /* cmd ::= PRAGMA nm dbnm EQ minus_num */
+ case uint32(251): /* cmd ::= PRAGMA nm dbnm EQ minus_num */
{
- Xsqlite3Pragma(tls, pParse, (yymsp + libc.UintptrFromInt32(-3)*12 + 4 /* &.minor */ /* &.yy0 */), (yymsp + libc.UintptrFromInt32(-2)*12 + 4 /* &.minor */ /* &.yy0 */), (yymsp + 4 /* &.minor */ /* &.yy0 */), 1)
+ Xsqlite3Pragma(tls, pParse, yymsp+libc.UintptrFromInt32(-3)*12+4, yymsp+libc.UintptrFromInt32(-2)*12+4, yymsp+4, 1)
}
break
- case uint32(250): /* cmd ::= PRAGMA nm dbnm LP minus_num RP */
+ case uint32(252): /* cmd ::= PRAGMA nm dbnm LP minus_num RP */
{
- Xsqlite3Pragma(tls, pParse, (yymsp + libc.UintptrFromInt32(-4)*12 + 4 /* &.minor */ /* &.yy0 */), (yymsp + libc.UintptrFromInt32(-3)*12 + 4 /* &.minor */ /* &.yy0 */), (yymsp + libc.UintptrFromInt32(-1)*12 + 4 /* &.minor */ /* &.yy0 */), 1)
+ Xsqlite3Pragma(tls, pParse, yymsp+libc.UintptrFromInt32(-4)*12+4, yymsp+libc.UintptrFromInt32(-3)*12+4, yymsp+libc.UintptrFromInt32(-1)*12+4, 1)
}
break
- case uint32(253): /* cmd ::= createkw trigger_decl BEGIN trigger_cmd_list END */
+ case uint32(255): /* cmd ::= createkw trigger_decl BEGIN trigger_cmd_list END */
{
- // var all Token at bp+76, 8
+ // var all Token at bp+92, 8
- (*Token)(unsafe.Pointer(bp + 76 /* &all */)).Fz = (*Token)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-3)*12 + 4 /* &.minor */)).Fz
- (*Token)(unsafe.Pointer(bp + 76 /* &all */)).Fn = (uint32(((int32((*Token)(unsafe.Pointer(yymsp+4 /* &.minor */)).Fz) - int32((*Token)(unsafe.Pointer(yymsp+libc.UintptrFromInt32(-3)*12+4 /* &.minor */)).Fz)) / 1)) + (*Token)(unsafe.Pointer(yymsp+4 /* &.minor */)).Fn)
- Xsqlite3FinishTrigger(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*12 + 4 /* &.minor */)), bp+76 /* &all */)
+ (*Token)(unsafe.Pointer(bp + 92 /* &all */)).Fz = (*Token)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-3)*12 + 4)).Fz
+ (*Token)(unsafe.Pointer(bp + 92 /* &all */)).Fn = uint32((int32((*Token)(unsafe.Pointer(yymsp+4)).Fz)-int32((*Token)(unsafe.Pointer(yymsp+libc.UintptrFromInt32(-3)*12+4)).Fz))/1) + (*Token)(unsafe.Pointer(yymsp+4)).Fn
+ Xsqlite3FinishTrigger(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*12 + 4)), bp+92 /* &all */)
}
break
- case uint32(254): /* trigger_decl ::= temp TRIGGER ifnotexists nm dbnm trigger_time trigger_event ON fullname foreach_clause when_clause */
+ case uint32(256): /* trigger_decl ::= temp TRIGGER ifnotexists nm dbnm trigger_time trigger_event ON fullname foreach_clause when_clause */
{
- Xsqlite3BeginTrigger(tls, pParse, (yymsp + libc.UintptrFromInt32(-7)*12 + 4 /* &.minor */ /* &.yy0 */), (yymsp + libc.UintptrFromInt32(-6)*12 + 4 /* &.minor */ /* &.yy0 */), *(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-5)*12 + 4 /* &.minor */)), (*TrigEvent)(unsafe.Pointer(yymsp+libc.UintptrFromInt32(-4)*12+4 /* &.minor */)).Fa, (*TrigEvent)(unsafe.Pointer(yymsp+libc.UintptrFromInt32(-4)*12+4 /* &.minor */)).Fb, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*12 + 4 /* &.minor */)), *(*uintptr)(unsafe.Pointer(yymsp + 4 /* &.minor */)), *(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-10)*12 + 4 /* &.minor */)), *(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-8)*12 + 4 /* &.minor */)))
- *(*Token)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-10)*12 + 4 /* &.minor */)) = func() Token1 {
- if (*Token)(unsafe.Pointer(yymsp+libc.UintptrFromInt32(-6)*12+4 /* &.minor */)).Fn == uint32(0) {
- return *(*Token)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-7)*12 + 4 /* &.minor */))
+ Xsqlite3BeginTrigger(tls, pParse, yymsp+libc.UintptrFromInt32(-7)*12+4, yymsp+libc.UintptrFromInt32(-6)*12+4, *(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-5)*12 + 4)), (*TrigEvent)(unsafe.Pointer(yymsp+libc.UintptrFromInt32(-4)*12+4)).Fa, (*TrigEvent)(unsafe.Pointer(yymsp+libc.UintptrFromInt32(-4)*12+4)).Fb, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*12 + 4)), *(*uintptr)(unsafe.Pointer(yymsp + 4)), *(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-10)*12 + 4)), *(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-8)*12 + 4)))
+ *(*Token)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-10)*12 + 4)) = func() Token1 {
+ if (*Token)(unsafe.Pointer(yymsp+libc.UintptrFromInt32(-6)*12+4)).Fn == uint32(0) {
+ return *(*Token)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-7)*12 + 4))
}
- return *(*Token)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-6)*12 + 4 /* &.minor */))
+ return *(*Token)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-6)*12 + 4))
}() //A-overwrites-T
}
break
- case uint32(255): /* trigger_time ::= BEFORE|AFTER */
+ case uint32(257): /* trigger_time ::= BEFORE|AFTER */
{
- *(*int32)(unsafe.Pointer(yymsp + 4 /* &.minor */)) = int32((*YyStackEntry)(unsafe.Pointer(yymsp)).Fmajor) /*A-overwrites-X*/
+ *(*int32)(unsafe.Pointer(yymsp + 4)) = int32((*YyStackEntry)(unsafe.Pointer(yymsp)).Fmajor) /*A-overwrites-X*/
}
break
- case uint32(256): /* trigger_time ::= INSTEAD OF */
+ case uint32(258): /* trigger_time ::= INSTEAD OF */
{
- *(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*12 + 4 /* &.minor */)) = TK_INSTEAD
+ *(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*12 + 4)) = TK_INSTEAD
}
break
- case uint32(257): /* trigger_time ::= */
+ case uint32(259): /* trigger_time ::= */
{
- *(*int32)(unsafe.Pointer(yymsp + 1*12 + 4 /* &.minor */)) = TK_BEFORE
+ *(*int32)(unsafe.Pointer(yymsp + 1*12 + 4)) = TK_BEFORE
}
break
- case uint32(258):
+ case uint32(260):
fallthrough // trigger_event ::= DELETE|INSERT
- case uint32(259): /* trigger_event ::= UPDATE */
+ case uint32(261): /* trigger_event ::= UPDATE */
{
- (*TrigEvent)(unsafe.Pointer(yymsp + 4 /* &.minor */)).Fa = int32((*YyStackEntry)(unsafe.Pointer(yymsp)).Fmajor) /*A-overwrites-X*/
+ (*TrigEvent)(unsafe.Pointer(yymsp + 4)).Fa = int32((*YyStackEntry)(unsafe.Pointer(yymsp)).Fmajor) /*A-overwrites-X*/
(*TrigEvent)(unsafe.Pointer(yymsp + 4 /* &.minor */)).Fb = uintptr(0)
}
break
- case uint32(260): /* trigger_event ::= UPDATE OF idlist */
+ case uint32(262): /* trigger_event ::= UPDATE OF idlist */
{
- (*TrigEvent)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*12 + 4 /* &.minor */)).Fa = TK_UPDATE
- (*TrigEvent)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*12 + 4 /* &.minor */)).Fb = *(*uintptr)(unsafe.Pointer(yymsp + 4 /* &.minor */))
+ (*TrigEvent)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*12 + 4)).Fa = TK_UPDATE
+ (*TrigEvent)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*12 + 4)).Fb = *(*uintptr)(unsafe.Pointer(yymsp + 4))
}
break
- case uint32(261):
+ case uint32(263):
fallthrough // when_clause ::=
- case uint32(280): /* key_opt ::= */
+ case uint32(282): /* key_opt ::= */
{
- *(*uintptr)(unsafe.Pointer(yymsp + 1*12 + 4 /* &.minor */)) = uintptr(0)
+ *(*uintptr)(unsafe.Pointer(yymsp + 1*12 + 4)) = uintptr(0)
}
break
- case uint32(262):
+ case uint32(264):
fallthrough // when_clause ::= WHEN expr
- case uint32(281): /* key_opt ::= KEY expr */
+ case uint32(283): /* key_opt ::= KEY expr */
{
- *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*12 + 4 /* &.minor */)) = *(*uintptr)(unsafe.Pointer(yymsp + 4 /* &.minor */))
+ *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*12 + 4)) = *(*uintptr)(unsafe.Pointer(yymsp + 4))
}
break
- case uint32(263): /* trigger_cmd_list ::= trigger_cmd_list trigger_cmd SEMI */
+ case uint32(265): /* trigger_cmd_list ::= trigger_cmd_list trigger_cmd SEMI */
{
- (*TriggerStep)(unsafe.Pointer((*TriggerStep)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*12 + 4 /* &.minor */)))).FpLast)).FpNext = *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*12 + 4 /* &.minor */))
- (*TriggerStep)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*12 + 4 /* &.minor */)))).FpLast = *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*12 + 4 /* &.minor */))
+ (*TriggerStep)(unsafe.Pointer((*TriggerStep)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*12 + 4)))).FpLast)).FpNext = *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*12 + 4))
+ (*TriggerStep)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*12 + 4)))).FpLast = *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*12 + 4))
}
break
- case uint32(264): /* trigger_cmd_list ::= trigger_cmd SEMI */
+ case uint32(266): /* trigger_cmd_list ::= trigger_cmd SEMI */
{
- (*TriggerStep)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*12 + 4 /* &.minor */)))).FpLast = *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*12 + 4 /* &.minor */))
+ (*TriggerStep)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*12 + 4)))).FpLast = *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*12 + 4))
}
break
- case uint32(265): /* trnm ::= nm DOT nm */
+ case uint32(267): /* trnm ::= nm DOT nm */
{
- *(*Token)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*12 + 4 /* &.minor */)) = *(*Token)(unsafe.Pointer(yymsp + 4 /* &.minor */))
+ *(*Token)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*12 + 4)) = *(*Token)(unsafe.Pointer(yymsp + 4))
Xsqlite3ErrorMsg(tls, pParse,
- ts+21299 /* "qualified table ..." */, 0)
+ ts+22596 /* "qualified table ..." */, 0)
}
break
- case uint32(266): /* tridxby ::= INDEXED BY nm */
+ case uint32(268): /* tridxby ::= INDEXED BY nm */
{
Xsqlite3ErrorMsg(tls, pParse,
- ts+21394 /* "the INDEXED BY c..." */, 0)
+ ts+22691 /* "the INDEXED BY c..." */, 0)
}
break
- case uint32(267): /* tridxby ::= NOT INDEXED */
+ case uint32(269): /* tridxby ::= NOT INDEXED */
{
Xsqlite3ErrorMsg(tls, pParse,
- ts+21478 /* "the NOT INDEXED ..." */, 0)
+ ts+22775 /* "the NOT INDEXED ..." */, 0)
}
break
- case uint32(268): /* trigger_cmd ::= UPDATE orconf trnm tridxby SET setlist from where_opt scanpt */
+ case uint32(270): /* trigger_cmd ::= UPDATE orconf trnm tridxby SET setlist from where_opt scanpt */
{
- *(*uintptr)(unsafe.Pointer(bp + 60 /* &yylhsminor */)) = Xsqlite3TriggerUpdateStep(tls, pParse, (yymsp + libc.UintptrFromInt32(-6)*12 + 4 /* &.minor */ /* &.yy0 */), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*12 + 4 /* &.minor */)), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-3)*12 + 4 /* &.minor */)), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*12 + 4 /* &.minor */)), uint8(*(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-7)*12 + 4 /* &.minor */))), (*Token)(unsafe.Pointer(yymsp+libc.UintptrFromInt32(-8)*12+4 /* &.minor */)).Fz, *(*uintptr)(unsafe.Pointer(yymsp + 4 /* &.minor */)))
+ *(*uintptr)(unsafe.Pointer(bp + 40 /* &yylhsminor */)) = Xsqlite3TriggerUpdateStep(tls, pParse, yymsp+libc.UintptrFromInt32(-6)*12+4, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*12 + 4)), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-3)*12 + 4)), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*12 + 4)), uint8(*(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-7)*12 + 4))), (*Token)(unsafe.Pointer(yymsp+libc.UintptrFromInt32(-8)*12+4)).Fz, *(*uintptr)(unsafe.Pointer(yymsp + 4)))
}
- *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-8)*12 + 4 /* &.minor */)) = *(*uintptr)(unsafe.Pointer(bp + 60 /* &yylhsminor */))
+ *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-8)*12 + 4)) = *(*uintptr)(unsafe.Pointer(bp + 40 /* &yylhsminor */))
break
- case uint32(269): /* trigger_cmd ::= scanpt insert_cmd INTO trnm idlist_opt select upsert scanpt */
+ case uint32(271): /* trigger_cmd ::= scanpt insert_cmd INTO trnm idlist_opt select upsert scanpt */
{
- *(*uintptr)(unsafe.Pointer(bp + 60 /* &yylhsminor */)) = Xsqlite3TriggerInsertStep(tls, pParse, (yymsp + libc.UintptrFromInt32(-4)*12 + 4 /* &.minor */ /* &.yy0 */), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-3)*12 + 4 /* &.minor */)), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*12 + 4 /* &.minor */)), uint8(*(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-6)*12 + 4 /* &.minor */))), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*12 + 4 /* &.minor */)), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-7)*12 + 4 /* &.minor */)), *(*uintptr)(unsafe.Pointer(yymsp + 4 /* &.minor */))) //yylhsminor.yy157-overwrites-yymsp[-6].minor.yy376
+ *(*uintptr)(unsafe.Pointer(bp + 40 /* &yylhsminor */)) = Xsqlite3TriggerInsertStep(tls, pParse, yymsp+libc.UintptrFromInt32(-4)*12+4, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-3)*12 + 4)), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*12 + 4)), uint8(*(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-6)*12 + 4))), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*12 + 4)), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-7)*12 + 4)), *(*uintptr)(unsafe.Pointer(yymsp + 4))) //yylhsminor.yy95-overwrites-yymsp[-6].minor.yy64
}
- *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-7)*12 + 4 /* &.minor */)) = *(*uintptr)(unsafe.Pointer(bp + 60 /* &yylhsminor */))
+ *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-7)*12 + 4)) = *(*uintptr)(unsafe.Pointer(bp + 40 /* &yylhsminor */))
break
- case uint32(270): /* trigger_cmd ::= DELETE FROM trnm tridxby where_opt scanpt */
+ case uint32(272): /* trigger_cmd ::= DELETE FROM trnm tridxby where_opt scanpt */
{
- *(*uintptr)(unsafe.Pointer(bp + 60 /* &yylhsminor */)) = Xsqlite3TriggerDeleteStep(tls, pParse, (yymsp + libc.UintptrFromInt32(-3)*12 + 4 /* &.minor */ /* &.yy0 */), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*12 + 4 /* &.minor */)), (*Token)(unsafe.Pointer(yymsp+libc.UintptrFromInt32(-5)*12+4 /* &.minor */)).Fz, *(*uintptr)(unsafe.Pointer(yymsp + 4 /* &.minor */)))
+ *(*uintptr)(unsafe.Pointer(bp + 40 /* &yylhsminor */)) = Xsqlite3TriggerDeleteStep(tls, pParse, yymsp+libc.UintptrFromInt32(-3)*12+4, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*12 + 4)), (*Token)(unsafe.Pointer(yymsp+libc.UintptrFromInt32(-5)*12+4)).Fz, *(*uintptr)(unsafe.Pointer(yymsp + 4)))
}
- *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-5)*12 + 4 /* &.minor */)) = *(*uintptr)(unsafe.Pointer(bp + 60 /* &yylhsminor */))
+ *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-5)*12 + 4)) = *(*uintptr)(unsafe.Pointer(bp + 40 /* &yylhsminor */))
break
- case uint32(271): /* trigger_cmd ::= scanpt select scanpt */
+ case uint32(273): /* trigger_cmd ::= scanpt select scanpt */
{
- *(*uintptr)(unsafe.Pointer(bp + 60 /* &yylhsminor */)) = Xsqlite3TriggerSelectStep(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*12 + 4 /* &.minor */)), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*12 + 4 /* &.minor */)), *(*uintptr)(unsafe.Pointer(yymsp + 4 /* &.minor */))) /*yylhsminor.yy157-overwrites-yymsp[-1].minor.yy81*/
+ *(*uintptr)(unsafe.Pointer(bp + 40 /* &yylhsminor */)) = Xsqlite3TriggerSelectStep(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*12 + 4)), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*12 + 4)), *(*uintptr)(unsafe.Pointer(yymsp + 4))) /*yylhsminor.yy95-overwrites-yymsp[-1].minor.yy303*/
}
- *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*12 + 4 /* &.minor */)) = *(*uintptr)(unsafe.Pointer(bp + 60 /* &yylhsminor */))
+ *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*12 + 4)) = *(*uintptr)(unsafe.Pointer(bp + 40 /* &yylhsminor */))
break
- case uint32(272): /* expr ::= RAISE LP IGNORE RP */
+ case uint32(274): /* expr ::= RAISE LP IGNORE RP */
{
- *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-3)*12 + 4 /* &.minor */)) = Xsqlite3PExpr(tls, pParse, TK_RAISE, uintptr(0), uintptr(0))
- if *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-3)*12 + 4 /* &.minor */)) != 0 {
- (*Expr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-3)*12 + 4 /* &.minor */)))).FaffExpr = uint8(OE_Ignore)
+ *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-3)*12 + 4)) = Xsqlite3PExpr(tls, pParse, TK_RAISE, uintptr(0), uintptr(0))
+ if *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-3)*12 + 4)) != 0 {
+ (*Expr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-3)*12 + 4)))).FaffExpr = uint8(OE_Ignore)
}
}
break
- case uint32(273): /* expr ::= RAISE LP raisetype COMMA nm RP */
+ case uint32(275): /* expr ::= RAISE LP raisetype COMMA nm RP */
{
- *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-5)*12 + 4 /* &.minor */)) = Xsqlite3ExprAlloc(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, TK_RAISE, (yymsp + libc.UintptrFromInt32(-1)*12 + 4 /* &.minor */ /* &.yy0 */), 1)
- if *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-5)*12 + 4 /* &.minor */)) != 0 {
- (*Expr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-5)*12 + 4 /* &.minor */)))).FaffExpr = uint8(*(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-3)*12 + 4 /* &.minor */)))
+ *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-5)*12 + 4)) = Xsqlite3ExprAlloc(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, TK_RAISE, yymsp+libc.UintptrFromInt32(-1)*12+4, 1)
+ if *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-5)*12 + 4)) != 0 {
+ (*Expr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-5)*12 + 4)))).FaffExpr = uint8(*(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-3)*12 + 4)))
}
}
break
- case uint32(274): /* raisetype ::= ROLLBACK */
+ case uint32(276): /* raisetype ::= ROLLBACK */
{
- *(*int32)(unsafe.Pointer(yymsp + 4 /* &.minor */)) = OE_Rollback
+ *(*int32)(unsafe.Pointer(yymsp + 4)) = OE_Rollback
}
break
- case uint32(276): /* raisetype ::= FAIL */
+ case uint32(278): /* raisetype ::= FAIL */
{
- *(*int32)(unsafe.Pointer(yymsp + 4 /* &.minor */)) = OE_Fail
+ *(*int32)(unsafe.Pointer(yymsp + 4)) = OE_Fail
}
break
- case uint32(277): /* cmd ::= DROP TRIGGER ifexists fullname */
+ case uint32(279): /* cmd ::= DROP TRIGGER ifexists fullname */
{
- Xsqlite3DropTrigger(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + 4 /* &.minor */)), *(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*12 + 4 /* &.minor */)))
+ Xsqlite3DropTrigger(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + 4)), *(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*12 + 4)))
}
break
- case uint32(278): /* cmd ::= ATTACH database_kw_opt expr AS expr key_opt */
+ case uint32(280): /* cmd ::= ATTACH database_kw_opt expr AS expr key_opt */
{
- Xsqlite3Attach(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-3)*12 + 4 /* &.minor */)), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*12 + 4 /* &.minor */)), *(*uintptr)(unsafe.Pointer(yymsp + 4 /* &.minor */)))
+ Xsqlite3Attach(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-3)*12 + 4)), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*12 + 4)), *(*uintptr)(unsafe.Pointer(yymsp + 4)))
}
break
- case uint32(279): /* cmd ::= DETACH database_kw_opt expr */
+ case uint32(281): /* cmd ::= DETACH database_kw_opt expr */
{
- Xsqlite3Detach(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + 4 /* &.minor */)))
+ Xsqlite3Detach(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + 4)))
}
break
- case uint32(282): /* cmd ::= REINDEX */
+ case uint32(284): /* cmd ::= REINDEX */
{
Xsqlite3Reindex(tls, pParse, uintptr(0), uintptr(0))
}
break
- case uint32(283): /* cmd ::= REINDEX nm dbnm */
+ case uint32(285): /* cmd ::= REINDEX nm dbnm */
{
- Xsqlite3Reindex(tls, pParse, (yymsp + libc.UintptrFromInt32(-1)*12 + 4 /* &.minor */ /* &.yy0 */), (yymsp + 4 /* &.minor */ /* &.yy0 */))
+ Xsqlite3Reindex(tls, pParse, yymsp+libc.UintptrFromInt32(-1)*12+4, yymsp+4)
}
break
- case uint32(284): /* cmd ::= ANALYZE */
+ case uint32(286): /* cmd ::= ANALYZE */
{
Xsqlite3Analyze(tls, pParse, uintptr(0), uintptr(0))
}
break
- case uint32(285): /* cmd ::= ANALYZE nm dbnm */
+ case uint32(287): /* cmd ::= ANALYZE nm dbnm */
{
- Xsqlite3Analyze(tls, pParse, (yymsp + libc.UintptrFromInt32(-1)*12 + 4 /* &.minor */ /* &.yy0 */), (yymsp + 4 /* &.minor */ /* &.yy0 */))
+ Xsqlite3Analyze(tls, pParse, yymsp+libc.UintptrFromInt32(-1)*12+4, yymsp+4)
}
break
- case uint32(286): /* cmd ::= ALTER TABLE fullname RENAME TO nm */
+ case uint32(288): /* cmd ::= ALTER TABLE fullname RENAME TO nm */
{
- Xsqlite3AlterRenameTable(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-3)*12 + 4 /* &.minor */)), (yymsp + 4 /* &.minor */ /* &.yy0 */))
+ Xsqlite3AlterRenameTable(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-3)*12 + 4)), yymsp+4)
}
break
- case uint32(287): /* cmd ::= ALTER TABLE add_column_fullname ADD kwcolumn_opt columnname carglist */
+ case uint32(289): /* cmd ::= ALTER TABLE add_column_fullname ADD kwcolumn_opt columnname carglist */
{
- (*Token)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*12 + 4 /* &.minor */)).Fn = (uint32(((int32((*Parse)(unsafe.Pointer(pParse)).FsLastToken.Fz) - int32((*Token)(unsafe.Pointer(yymsp+libc.UintptrFromInt32(-1)*12+4 /* &.minor */)).Fz)) / 1)) + (*Parse)(unsafe.Pointer(pParse)).FsLastToken.Fn)
- Xsqlite3AlterFinishAddColumn(tls, pParse, (yymsp + libc.UintptrFromInt32(-1)*12 + 4 /* &.minor */ /* &.yy0 */))
+ (*Token)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*12 + 4)).Fn = uint32((int32((*Parse)(unsafe.Pointer(pParse)).FsLastToken.Fz)-int32((*Token)(unsafe.Pointer(yymsp+libc.UintptrFromInt32(-1)*12+4)).Fz))/1) + (*Parse)(unsafe.Pointer(pParse)).FsLastToken.Fn
+ Xsqlite3AlterFinishAddColumn(tls, pParse, yymsp+libc.UintptrFromInt32(-1)*12+4)
}
break
- case uint32(288): /* cmd ::= ALTER TABLE fullname DROP kwcolumn_opt nm */
+ case uint32(290): /* cmd ::= ALTER TABLE fullname DROP kwcolumn_opt nm */
{
- Xsqlite3AlterDropColumn(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-3)*12 + 4 /* &.minor */)), (yymsp + 4 /* &.minor */ /* &.yy0 */))
+ Xsqlite3AlterDropColumn(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-3)*12 + 4)), yymsp+4)
}
break
- case uint32(289): /* add_column_fullname ::= fullname */
+ case uint32(291): /* add_column_fullname ::= fullname */
{
disableLookaside(tls, pParse)
- Xsqlite3AlterBeginAddColumn(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + 4 /* &.minor */)))
+ Xsqlite3AlterBeginAddColumn(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + 4)))
}
break
- case uint32(290): /* cmd ::= ALTER TABLE fullname RENAME kwcolumn_opt nm TO nm */
+ case uint32(292): /* cmd ::= ALTER TABLE fullname RENAME kwcolumn_opt nm TO nm */
{
- Xsqlite3AlterRenameColumn(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-5)*12 + 4 /* &.minor */)), (yymsp + libc.UintptrFromInt32(-2)*12 + 4 /* &.minor */ /* &.yy0 */), (yymsp + 4 /* &.minor */ /* &.yy0 */))
+ Xsqlite3AlterRenameColumn(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-5)*12 + 4)), yymsp+libc.UintptrFromInt32(-2)*12+4, yymsp+4)
}
break
- case uint32(291): /* cmd ::= create_vtab */
+ case uint32(293): /* cmd ::= create_vtab */
{
Xsqlite3VtabFinishParse(tls, pParse, uintptr(0))
}
break
- case uint32(292): /* cmd ::= create_vtab LP vtabarglist RP */
+ case uint32(294): /* cmd ::= create_vtab LP vtabarglist RP */
{
- Xsqlite3VtabFinishParse(tls, pParse, (yymsp + 4 /* &.minor */ /* &.yy0 */))
+ Xsqlite3VtabFinishParse(tls, pParse, yymsp+4)
}
break
- case uint32(293): /* create_vtab ::= createkw VIRTUAL TABLE ifnotexists nm dbnm USING nm */
+ case uint32(295): /* create_vtab ::= createkw VIRTUAL TABLE ifnotexists nm dbnm USING nm */
{
- Xsqlite3VtabBeginParse(tls, pParse, (yymsp + libc.UintptrFromInt32(-3)*12 + 4 /* &.minor */ /* &.yy0 */), (yymsp + libc.UintptrFromInt32(-2)*12 + 4 /* &.minor */ /* &.yy0 */), (yymsp + 4 /* &.minor */ /* &.yy0 */), *(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*12 + 4 /* &.minor */)))
+ Xsqlite3VtabBeginParse(tls, pParse, yymsp+libc.UintptrFromInt32(-3)*12+4, yymsp+libc.UintptrFromInt32(-2)*12+4, yymsp+4, *(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*12 + 4)))
}
break
- case uint32(294): /* vtabarg ::= */
+ case uint32(296): /* vtabarg ::= */
{
Xsqlite3VtabArgInit(tls, pParse)
}
break
- case uint32(295):
+ case uint32(297):
fallthrough // vtabargtoken ::= ANY
- case uint32(296): /* vtabargtoken ::= lp anylist RP */
+ case uint32(298): /* vtabargtoken ::= lp anylist RP */
fallthrough
- case uint32(297): /* lp ::= LP */
+ case uint32(299): /* lp ::= LP */
{
- Xsqlite3VtabArgExtend(tls, pParse, (yymsp + 4 /* &.minor */ /* &.yy0 */))
+ Xsqlite3VtabArgExtend(tls, pParse, yymsp+4)
}
break
- case uint32(298):
+ case uint32(300):
fallthrough // with ::= WITH wqlist
- case uint32(299): /* with ::= WITH RECURSIVE wqlist */
+ case uint32(301): /* with ::= WITH RECURSIVE wqlist */
{
- Xsqlite3WithPush(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + 4 /* &.minor */)), uint8(1))
+ Xsqlite3WithPush(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + 4)), uint8(1))
}
break
- case uint32(300): /* wqas ::= AS */
+ case uint32(302): /* wqas ::= AS */
{
- *(*U8)(unsafe.Pointer(yymsp + 4 /* &.minor */)) = U8(M10d_Any)
+ *(*U8)(unsafe.Pointer(yymsp + 4)) = U8(M10d_Any)
}
break
- case uint32(301): /* wqas ::= AS MATERIALIZED */
+ case uint32(303): /* wqas ::= AS MATERIALIZED */
{
- *(*U8)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*12 + 4 /* &.minor */)) = U8(M10d_Yes)
+ *(*U8)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*12 + 4)) = U8(M10d_Yes)
}
break
- case uint32(302): /* wqas ::= AS NOT MATERIALIZED */
+ case uint32(304): /* wqas ::= AS NOT MATERIALIZED */
{
- *(*U8)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*12 + 4 /* &.minor */)) = U8(M10d_No)
+ *(*U8)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*12 + 4)) = U8(M10d_No)
}
break
- case uint32(303): /* wqitem ::= nm eidlist_opt wqas LP select RP */
+ case uint32(305): /* wqitem ::= nm eidlist_opt wqas LP select RP */
{
- *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-5)*12 + 4 /* &.minor */)) = Xsqlite3CteNew(tls, pParse, (yymsp + libc.UintptrFromInt32(-5)*12 + 4 /* &.minor */ /* &.yy0 */), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*12 + 4 /* &.minor */)), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*12 + 4 /* &.minor */)), *(*U8)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-3)*12 + 4 /* &.minor */))) //A-overwrites-X
+ *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-5)*12 + 4)) = Xsqlite3CteNew(tls, pParse, yymsp+libc.UintptrFromInt32(-5)*12+4, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*12 + 4)), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*12 + 4)), *(*U8)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-3)*12 + 4))) //A-overwrites-X
}
break
- case uint32(304): /* wqlist ::= wqitem */
+ case uint32(306): /* wqlist ::= wqitem */
{
- *(*uintptr)(unsafe.Pointer(yymsp + 4 /* &.minor */)) = Xsqlite3WithAdd(tls, pParse, uintptr(0), *(*uintptr)(unsafe.Pointer(yymsp + 4 /* &.minor */))) //A-overwrites-X
+ *(*uintptr)(unsafe.Pointer(yymsp + 4)) = Xsqlite3WithAdd(tls, pParse, uintptr(0), *(*uintptr)(unsafe.Pointer(yymsp + 4))) //A-overwrites-X
}
break
- case uint32(305): /* wqlist ::= wqlist COMMA wqitem */
+ case uint32(307): /* wqlist ::= wqlist COMMA wqitem */
{
- *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*12 + 4 /* &.minor */)) = Xsqlite3WithAdd(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*12 + 4 /* &.minor */)), *(*uintptr)(unsafe.Pointer(yymsp + 4 /* &.minor */)))
+ *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*12 + 4)) = Xsqlite3WithAdd(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*12 + 4)), *(*uintptr)(unsafe.Pointer(yymsp + 4)))
}
break
- case uint32(306): /* windowdefn_list ::= windowdefn */
+ case uint32(308): /* windowdefn_list ::= windowdefn */
{
- *(*uintptr)(unsafe.Pointer(bp + 60 /* &yylhsminor */)) = *(*uintptr)(unsafe.Pointer(yymsp + 4 /* &.minor */))
+ *(*uintptr)(unsafe.Pointer(bp + 40 /* &yylhsminor */)) = *(*uintptr)(unsafe.Pointer(yymsp + 4))
}
- *(*uintptr)(unsafe.Pointer(yymsp + 4 /* &.minor */)) = *(*uintptr)(unsafe.Pointer(bp + 60 /* &yylhsminor */))
+ *(*uintptr)(unsafe.Pointer(yymsp + 4)) = *(*uintptr)(unsafe.Pointer(bp + 40 /* &yylhsminor */))
break
- case uint32(307): /* windowdefn_list ::= windowdefn_list COMMA windowdefn */
+ case uint32(309): /* windowdefn_list ::= windowdefn_list COMMA windowdefn */
{
- Xsqlite3WindowChain(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + 4 /* &.minor */)), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*12 + 4 /* &.minor */)))
- (*Window)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(yymsp + 4 /* &.minor */)))).FpNextWin = *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*12 + 4 /* &.minor */))
- *(*uintptr)(unsafe.Pointer(bp + 60 /* &yylhsminor */)) = *(*uintptr)(unsafe.Pointer(yymsp + 4 /* &.minor */))
+ Xsqlite3WindowChain(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + 4)), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*12 + 4)))
+ (*Window)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(yymsp + 4)))).FpNextWin = *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*12 + 4))
+ *(*uintptr)(unsafe.Pointer(bp + 40 /* &yylhsminor */)) = *(*uintptr)(unsafe.Pointer(yymsp + 4))
}
- *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*12 + 4 /* &.minor */)) = *(*uintptr)(unsafe.Pointer(bp + 60 /* &yylhsminor */))
+ *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*12 + 4)) = *(*uintptr)(unsafe.Pointer(bp + 40 /* &yylhsminor */))
break
- case uint32(308): /* windowdefn ::= nm AS LP window RP */
+ case uint32(310): /* windowdefn ::= nm AS LP window RP */
{
- if *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*12 + 4 /* &.minor */)) != 0 {
- (*Window)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*12 + 4 /* &.minor */)))).FzName = Xsqlite3DbStrNDup(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, (*Token)(unsafe.Pointer(yymsp+libc.UintptrFromInt32(-4)*12+4 /* &.minor */)).Fz, uint64((*Token)(unsafe.Pointer(yymsp+libc.UintptrFromInt32(-4)*12+4 /* &.minor */)).Fn))
+ if *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*12 + 4)) != 0 {
+ (*Window)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*12 + 4)))).FzName = Xsqlite3DbStrNDup(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, (*Token)(unsafe.Pointer(yymsp+libc.UintptrFromInt32(-4)*12+4)).Fz, uint64((*Token)(unsafe.Pointer(yymsp+libc.UintptrFromInt32(-4)*12+4)).Fn))
}
- *(*uintptr)(unsafe.Pointer(bp + 60 /* &yylhsminor */)) = *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*12 + 4 /* &.minor */))
+ *(*uintptr)(unsafe.Pointer(bp + 40 /* &yylhsminor */)) = *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*12 + 4))
}
- *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*12 + 4 /* &.minor */)) = *(*uintptr)(unsafe.Pointer(bp + 60 /* &yylhsminor */))
+ *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*12 + 4)) = *(*uintptr)(unsafe.Pointer(bp + 40 /* &yylhsminor */))
break
- case uint32(309): /* window ::= PARTITION BY nexprlist orderby_opt frame_opt */
+ case uint32(311): /* window ::= PARTITION BY nexprlist orderby_opt frame_opt */
{
- *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*12 + 4 /* &.minor */)) = Xsqlite3WindowAssemble(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + 4 /* &.minor */)), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*12 + 4 /* &.minor */)), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*12 + 4 /* &.minor */)), uintptr(0))
+ *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*12 + 4)) = Xsqlite3WindowAssemble(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + 4)), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*12 + 4)), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*12 + 4)), uintptr(0))
}
break
- case uint32(310): /* window ::= nm PARTITION BY nexprlist orderby_opt frame_opt */
+ case uint32(312): /* window ::= nm PARTITION BY nexprlist orderby_opt frame_opt */
{
- *(*uintptr)(unsafe.Pointer(bp + 60 /* &yylhsminor */)) = Xsqlite3WindowAssemble(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + 4 /* &.minor */)), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*12 + 4 /* &.minor */)), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*12 + 4 /* &.minor */)), (yymsp + libc.UintptrFromInt32(-5)*12 + 4 /* &.minor */ /* &.yy0 */))
+ *(*uintptr)(unsafe.Pointer(bp + 40 /* &yylhsminor */)) = Xsqlite3WindowAssemble(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + 4)), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*12 + 4)), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*12 + 4)), yymsp+libc.UintptrFromInt32(-5)*12+4)
}
- *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-5)*12 + 4 /* &.minor */)) = *(*uintptr)(unsafe.Pointer(bp + 60 /* &yylhsminor */))
+ *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-5)*12 + 4)) = *(*uintptr)(unsafe.Pointer(bp + 40 /* &yylhsminor */))
break
- case uint32(311): /* window ::= ORDER BY sortlist frame_opt */
+ case uint32(313): /* window ::= ORDER BY sortlist frame_opt */
{
- *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-3)*12 + 4 /* &.minor */)) = Xsqlite3WindowAssemble(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + 4 /* &.minor */)), uintptr(0), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*12 + 4 /* &.minor */)), uintptr(0))
+ *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-3)*12 + 4)) = Xsqlite3WindowAssemble(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + 4)), uintptr(0), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*12 + 4)), uintptr(0))
}
break
- case uint32(312): /* window ::= nm ORDER BY sortlist frame_opt */
+ case uint32(314): /* window ::= nm ORDER BY sortlist frame_opt */
{
- *(*uintptr)(unsafe.Pointer(bp + 60 /* &yylhsminor */)) = Xsqlite3WindowAssemble(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + 4 /* &.minor */)), uintptr(0), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*12 + 4 /* &.minor */)), (yymsp + libc.UintptrFromInt32(-4)*12 + 4 /* &.minor */ /* &.yy0 */))
+ *(*uintptr)(unsafe.Pointer(bp + 40 /* &yylhsminor */)) = Xsqlite3WindowAssemble(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + 4)), uintptr(0), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*12 + 4)), yymsp+libc.UintptrFromInt32(-4)*12+4)
}
- *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*12 + 4 /* &.minor */)) = *(*uintptr)(unsafe.Pointer(bp + 60 /* &yylhsminor */))
+ *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*12 + 4)) = *(*uintptr)(unsafe.Pointer(bp + 40 /* &yylhsminor */))
break
- case uint32(313):
+ case uint32(315):
fallthrough // window ::= frame_opt
- case uint32(332): /* filter_over ::= over_clause */
+ case uint32(334): /* filter_over ::= over_clause */
{
- *(*uintptr)(unsafe.Pointer(bp + 60 /* &yylhsminor */)) = *(*uintptr)(unsafe.Pointer(yymsp + 4 /* &.minor */))
+ *(*uintptr)(unsafe.Pointer(bp + 40 /* &yylhsminor */)) = *(*uintptr)(unsafe.Pointer(yymsp + 4))
}
- *(*uintptr)(unsafe.Pointer(yymsp + 4 /* &.minor */)) = *(*uintptr)(unsafe.Pointer(bp + 60 /* &yylhsminor */))
+ *(*uintptr)(unsafe.Pointer(yymsp + 4)) = *(*uintptr)(unsafe.Pointer(bp + 40 /* &yylhsminor */))
break
- case uint32(314): /* window ::= nm frame_opt */
+ case uint32(316): /* window ::= nm frame_opt */
{
- *(*uintptr)(unsafe.Pointer(bp + 60 /* &yylhsminor */)) = Xsqlite3WindowAssemble(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + 4 /* &.minor */)), uintptr(0), uintptr(0), (yymsp + libc.UintptrFromInt32(-1)*12 + 4 /* &.minor */ /* &.yy0 */))
+ *(*uintptr)(unsafe.Pointer(bp + 40 /* &yylhsminor */)) = Xsqlite3WindowAssemble(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + 4)), uintptr(0), uintptr(0), yymsp+libc.UintptrFromInt32(-1)*12+4)
}
- *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*12 + 4 /* &.minor */)) = *(*uintptr)(unsafe.Pointer(bp + 60 /* &yylhsminor */))
+ *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*12 + 4)) = *(*uintptr)(unsafe.Pointer(bp + 40 /* &yylhsminor */))
break
- case uint32(315): /* frame_opt ::= */
+ case uint32(317): /* frame_opt ::= */
{
- *(*uintptr)(unsafe.Pointer(yymsp + 1*12 + 4 /* &.minor */)) = Xsqlite3WindowAlloc(tls, pParse, 0, TK_UNBOUNDED, uintptr(0), TK_CURRENT, uintptr(0), uint8(0))
+ *(*uintptr)(unsafe.Pointer(yymsp + 1*12 + 4)) = Xsqlite3WindowAlloc(tls, pParse, 0, TK_UNBOUNDED, uintptr(0), TK_CURRENT, uintptr(0), uint8(0))
}
break
- case uint32(316): /* frame_opt ::= range_or_rows frame_bound_s frame_exclude_opt */
+ case uint32(318): /* frame_opt ::= range_or_rows frame_bound_s frame_exclude_opt */
{
- *(*uintptr)(unsafe.Pointer(bp + 60 /* &yylhsminor */)) = Xsqlite3WindowAlloc(tls, pParse, *(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*12 + 4 /* &.minor */)), (*FrameBound)(unsafe.Pointer(yymsp+libc.UintptrFromInt32(-1)*12+4 /* &.minor */)).FeType, (*FrameBound)(unsafe.Pointer(yymsp+libc.UintptrFromInt32(-1)*12+4 /* &.minor */)).FpExpr, TK_CURRENT, uintptr(0), *(*U8)(unsafe.Pointer(yymsp + 4 /* &.minor */)))
+ *(*uintptr)(unsafe.Pointer(bp + 40 /* &yylhsminor */)) = Xsqlite3WindowAlloc(tls, pParse, *(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*12 + 4)), (*FrameBound)(unsafe.Pointer(yymsp+libc.UintptrFromInt32(-1)*12+4)).FeType, (*FrameBound)(unsafe.Pointer(yymsp+libc.UintptrFromInt32(-1)*12+4)).FpExpr, TK_CURRENT, uintptr(0), *(*U8)(unsafe.Pointer(yymsp + 4)))
}
- *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*12 + 4 /* &.minor */)) = *(*uintptr)(unsafe.Pointer(bp + 60 /* &yylhsminor */))
+ *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*12 + 4)) = *(*uintptr)(unsafe.Pointer(bp + 40 /* &yylhsminor */))
break
- case uint32(317): /* frame_opt ::= range_or_rows BETWEEN frame_bound_s AND frame_bound_e frame_exclude_opt */
+ case uint32(319): /* frame_opt ::= range_or_rows BETWEEN frame_bound_s AND frame_bound_e frame_exclude_opt */
{
- *(*uintptr)(unsafe.Pointer(bp + 60 /* &yylhsminor */)) = Xsqlite3WindowAlloc(tls, pParse, *(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-5)*12 + 4 /* &.minor */)), (*FrameBound)(unsafe.Pointer(yymsp+libc.UintptrFromInt32(-3)*12+4 /* &.minor */)).FeType, (*FrameBound)(unsafe.Pointer(yymsp+libc.UintptrFromInt32(-3)*12+4 /* &.minor */)).FpExpr, (*FrameBound)(unsafe.Pointer(yymsp+libc.UintptrFromInt32(-1)*12+4 /* &.minor */)).FeType, (*FrameBound)(unsafe.Pointer(yymsp+libc.UintptrFromInt32(-1)*12+4 /* &.minor */)).FpExpr, *(*U8)(unsafe.Pointer(yymsp + 4 /* &.minor */)))
+ *(*uintptr)(unsafe.Pointer(bp + 40 /* &yylhsminor */)) = Xsqlite3WindowAlloc(tls, pParse, *(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-5)*12 + 4)), (*FrameBound)(unsafe.Pointer(yymsp+libc.UintptrFromInt32(-3)*12+4)).FeType, (*FrameBound)(unsafe.Pointer(yymsp+libc.UintptrFromInt32(-3)*12+4)).FpExpr, (*FrameBound)(unsafe.Pointer(yymsp+libc.UintptrFromInt32(-1)*12+4)).FeType, (*FrameBound)(unsafe.Pointer(yymsp+libc.UintptrFromInt32(-1)*12+4)).FpExpr, *(*U8)(unsafe.Pointer(yymsp + 4)))
}
- *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-5)*12 + 4 /* &.minor */)) = *(*uintptr)(unsafe.Pointer(bp + 60 /* &yylhsminor */))
+ *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-5)*12 + 4)) = *(*uintptr)(unsafe.Pointer(bp + 40 /* &yylhsminor */))
break
- case uint32(319):
+ case uint32(321):
fallthrough // frame_bound_s ::= frame_bound
- case uint32(321): /* frame_bound_e ::= frame_bound */
+ case uint32(323): /* frame_bound_e ::= frame_bound */
{
- *(*FrameBound)(unsafe.Pointer(bp + 60 /* &yylhsminor */)) = *(*FrameBound)(unsafe.Pointer(yymsp + 4 /* &.minor */))
+ *(*FrameBound)(unsafe.Pointer(bp + 40 /* &yylhsminor */)) = *(*FrameBound)(unsafe.Pointer(yymsp + 4))
}
- *(*FrameBound)(unsafe.Pointer(yymsp + 4 /* &.minor */)) = *(*FrameBound)(unsafe.Pointer(bp + 60 /* &yylhsminor */))
+ *(*FrameBound)(unsafe.Pointer(yymsp + 4)) = *(*FrameBound)(unsafe.Pointer(bp + 40 /* &yylhsminor */))
break
- case uint32(320):
+ case uint32(322):
fallthrough // frame_bound_s ::= UNBOUNDED PRECEDING
- case uint32(322): /* frame_bound_e ::= UNBOUNDED FOLLOWING */
+ case uint32(324): /* frame_bound_e ::= UNBOUNDED FOLLOWING */
fallthrough
- case uint32(324): /* frame_bound ::= CURRENT ROW */
+ case uint32(326): /* frame_bound ::= CURRENT ROW */
{
- (*FrameBound)(unsafe.Pointer(bp + 60 /* &yylhsminor */)).FeType = int32((*YyStackEntry)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*12)).Fmajor)
- (*FrameBound)(unsafe.Pointer(bp + 60 /* &yylhsminor */)).FpExpr = uintptr(0)
+ (*FrameBound)(unsafe.Pointer(bp + 40 /* &yylhsminor */)).FeType = int32((*YyStackEntry)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*12)).Fmajor)
+ (*FrameBound)(unsafe.Pointer(bp + 40 /* &yylhsminor */)).FpExpr = uintptr(0)
}
- *(*FrameBound)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*12 + 4 /* &.minor */)) = *(*FrameBound)(unsafe.Pointer(bp + 60 /* &yylhsminor */))
+ *(*FrameBound)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*12 + 4)) = *(*FrameBound)(unsafe.Pointer(bp + 40 /* &yylhsminor */))
break
- case uint32(323): /* frame_bound ::= expr PRECEDING|FOLLOWING */
+ case uint32(325): /* frame_bound ::= expr PRECEDING|FOLLOWING */
{
- (*FrameBound)(unsafe.Pointer(bp + 60 /* &yylhsminor */)).FeType = int32((*YyStackEntry)(unsafe.Pointer(yymsp)).Fmajor)
- (*FrameBound)(unsafe.Pointer(bp + 60 /* &yylhsminor */)).FpExpr = *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*12 + 4 /* &.minor */))
+ (*FrameBound)(unsafe.Pointer(bp + 40 /* &yylhsminor */)).FeType = int32((*YyStackEntry)(unsafe.Pointer(yymsp)).Fmajor)
+ (*FrameBound)(unsafe.Pointer(bp + 40 /* &yylhsminor */)).FpExpr = *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*12 + 4))
}
- *(*FrameBound)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*12 + 4 /* &.minor */)) = *(*FrameBound)(unsafe.Pointer(bp + 60 /* &yylhsminor */))
+ *(*FrameBound)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*12 + 4)) = *(*FrameBound)(unsafe.Pointer(bp + 40 /* &yylhsminor */))
break
- case uint32(325): /* frame_exclude_opt ::= */
+ case uint32(327): /* frame_exclude_opt ::= */
{
- *(*U8)(unsafe.Pointer(yymsp + 1*12 + 4 /* &.minor */)) = U8(0)
+ *(*U8)(unsafe.Pointer(yymsp + 1*12 + 4)) = U8(0)
}
break
- case uint32(326): /* frame_exclude_opt ::= EXCLUDE frame_exclude */
+ case uint32(328): /* frame_exclude_opt ::= EXCLUDE frame_exclude */
{
- *(*U8)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*12 + 4 /* &.minor */)) = *(*U8)(unsafe.Pointer(yymsp + 4 /* &.minor */))
+ *(*U8)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*12 + 4)) = *(*U8)(unsafe.Pointer(yymsp + 4))
}
break
- case uint32(327):
+ case uint32(329):
fallthrough // frame_exclude ::= NO OTHERS
- case uint32(328): /* frame_exclude ::= CURRENT ROW */
+ case uint32(330): /* frame_exclude ::= CURRENT ROW */
{
- *(*U8)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*12 + 4 /* &.minor */)) = U8((*YyStackEntry)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*12)).Fmajor) /*A-overwrites-X*/
+ *(*U8)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*12 + 4)) = U8((*YyStackEntry)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*12)).Fmajor) /*A-overwrites-X*/
}
break
- case uint32(329): /* frame_exclude ::= GROUP|TIES */
+ case uint32(331): /* frame_exclude ::= GROUP|TIES */
{
- *(*U8)(unsafe.Pointer(yymsp + 4 /* &.minor */)) = U8((*YyStackEntry)(unsafe.Pointer(yymsp)).Fmajor) /*A-overwrites-X*/
+ *(*U8)(unsafe.Pointer(yymsp + 4)) = U8((*YyStackEntry)(unsafe.Pointer(yymsp)).Fmajor) /*A-overwrites-X*/
}
break
- case uint32(330): /* window_clause ::= WINDOW windowdefn_list */
+ case uint32(332): /* window_clause ::= WINDOW windowdefn_list */
{
- *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*12 + 4 /* &.minor */)) = *(*uintptr)(unsafe.Pointer(yymsp + 4 /* &.minor */))
+ *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*12 + 4)) = *(*uintptr)(unsafe.Pointer(yymsp + 4))
}
break
- case uint32(331): /* filter_over ::= filter_clause over_clause */
+ case uint32(333): /* filter_over ::= filter_clause over_clause */
{
- if *(*uintptr)(unsafe.Pointer(yymsp + 4 /* &.minor */)) != 0 {
- (*Window)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(yymsp + 4 /* &.minor */)))).FpFilter = *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*12 + 4 /* &.minor */))
+ if *(*uintptr)(unsafe.Pointer(yymsp + 4)) != 0 {
+ (*Window)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(yymsp + 4)))).FpFilter = *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*12 + 4))
} else {
- Xsqlite3ExprDelete(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*12 + 4 /* &.minor */)))
+ Xsqlite3ExprDelete(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*12 + 4)))
}
- *(*uintptr)(unsafe.Pointer(bp + 60 /* &yylhsminor */)) = *(*uintptr)(unsafe.Pointer(yymsp + 4 /* &.minor */))
+ *(*uintptr)(unsafe.Pointer(bp + 40 /* &yylhsminor */)) = *(*uintptr)(unsafe.Pointer(yymsp + 4))
}
- *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*12 + 4 /* &.minor */)) = *(*uintptr)(unsafe.Pointer(bp + 60 /* &yylhsminor */))
+ *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*12 + 4)) = *(*uintptr)(unsafe.Pointer(bp + 40 /* &yylhsminor */))
break
- case uint32(333): /* filter_over ::= filter_clause */
+ case uint32(335): /* filter_over ::= filter_clause */
{
- *(*uintptr)(unsafe.Pointer(bp + 60 /* &yylhsminor */)) = Xsqlite3DbMallocZero(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, uint64(unsafe.Sizeof(Window{})))
- if *(*uintptr)(unsafe.Pointer(bp + 60 /* &yylhsminor */)) != 0 {
- (*Window)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 60 /* &yylhsminor */)))).FeFrmType = U8(TK_FILTER)
- (*Window)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 60 /* &yylhsminor */)))).FpFilter = *(*uintptr)(unsafe.Pointer(yymsp + 4 /* &.minor */))
+ *(*uintptr)(unsafe.Pointer(bp + 40 /* &yylhsminor */)) = Xsqlite3DbMallocZero(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, uint64(unsafe.Sizeof(Window{})))
+ if *(*uintptr)(unsafe.Pointer(bp + 40)) != 0 {
+ (*Window)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 40 /* &yylhsminor */)))).FeFrmType = U8(TK_FILTER)
+ (*Window)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 40 /* &yylhsminor */)))).FpFilter = *(*uintptr)(unsafe.Pointer(yymsp + 4))
} else {
- Xsqlite3ExprDelete(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, *(*uintptr)(unsafe.Pointer(yymsp + 4 /* &.minor */)))
+ Xsqlite3ExprDelete(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, *(*uintptr)(unsafe.Pointer(yymsp + 4)))
}
}
- *(*uintptr)(unsafe.Pointer(yymsp + 4 /* &.minor */)) = *(*uintptr)(unsafe.Pointer(bp + 60 /* &yylhsminor */))
+ *(*uintptr)(unsafe.Pointer(yymsp + 4)) = *(*uintptr)(unsafe.Pointer(bp + 40 /* &yylhsminor */))
break
- case uint32(334): /* over_clause ::= OVER LP window RP */
+ case uint32(336): /* over_clause ::= OVER LP window RP */
{
- *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-3)*12 + 4 /* &.minor */)) = *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*12 + 4 /* &.minor */))
+ *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-3)*12 + 4)) = *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*12 + 4))
}
break
- case uint32(335): /* over_clause ::= OVER nm */
+ case uint32(337): /* over_clause ::= OVER nm */
{
- *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*12 + 4 /* &.minor */)) = Xsqlite3DbMallocZero(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, uint64(unsafe.Sizeof(Window{})))
- if *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*12 + 4 /* &.minor */)) != 0 {
- (*Window)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*12 + 4 /* &.minor */)))).FzName = Xsqlite3DbStrNDup(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, (*Token)(unsafe.Pointer(yymsp+4 /* &.minor */)).Fz, uint64((*Token)(unsafe.Pointer(yymsp+4 /* &.minor */)).Fn))
+ *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*12 + 4)) = Xsqlite3DbMallocZero(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, uint64(unsafe.Sizeof(Window{})))
+ if *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*12 + 4)) != 0 {
+ (*Window)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*12 + 4)))).FzName = Xsqlite3DbStrNDup(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, (*Token)(unsafe.Pointer(yymsp+4)).Fz, uint64((*Token)(unsafe.Pointer(yymsp+4)).Fn))
}
}
break
- case uint32(336): /* filter_clause ::= FILTER LP WHERE expr RP */
+ case uint32(338): /* filter_clause ::= FILTER LP WHERE expr RP */
{
- *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*12 + 4 /* &.minor */)) = *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*12 + 4 /* &.minor */))
+ *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*12 + 4)) = *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*12 + 4))
}
break
default:
- /* (337) input ::= cmdlist */
- /* (338) cmdlist ::= cmdlist ecmd */
- /* (339) cmdlist ::= ecmd (OPTIMIZED OUT) */
- /* (340) ecmd ::= SEMI */
- /* (341) ecmd ::= cmdx SEMI */
- /* (342) ecmd ::= explain cmdx SEMI (NEVER REDUCES) */
- /* (343) trans_opt ::= */
- /* (344) trans_opt ::= TRANSACTION */
- /* (345) trans_opt ::= TRANSACTION nm */
- /* (346) savepoint_opt ::= SAVEPOINT */
- /* (347) savepoint_opt ::= */
- /* (348) cmd ::= create_table create_table_args */
- /* (349) columnlist ::= columnlist COMMA columnname carglist */
- /* (350) columnlist ::= columnname carglist */
- /* (351) nm ::= ID|INDEXED */
- /* (352) nm ::= STRING */
- /* (353) nm ::= JOIN_KW */
- /* (354) typetoken ::= typename */
- /* (355) typename ::= ID|STRING */
- /* (356) signed ::= plus_num (OPTIMIZED OUT) */
- /* (357) signed ::= minus_num (OPTIMIZED OUT) */
- /* (358) carglist ::= carglist ccons */
- /* (359) carglist ::= */
- /* (360) ccons ::= NULL onconf */
- /* (361) ccons ::= GENERATED ALWAYS AS generated */
- /* (362) ccons ::= AS generated */
- /* (363) conslist_opt ::= COMMA conslist */
- /* (364) conslist ::= conslist tconscomma tcons */
- /* (365) conslist ::= tcons (OPTIMIZED OUT) */
- /* (366) tconscomma ::= */
- /* (367) defer_subclause_opt ::= defer_subclause (OPTIMIZED OUT) */
- /* (368) resolvetype ::= raisetype (OPTIMIZED OUT) */
- /* (369) selectnowith ::= oneselect (OPTIMIZED OUT) */
- /* (370) oneselect ::= values */
- /* (371) sclp ::= selcollist COMMA */
- /* (372) as ::= ID|STRING */
- /* (373) returning ::= */
- /* (374) expr ::= term (OPTIMIZED OUT) */
- /* (375) likeop ::= LIKE_KW|MATCH */
- /* (376) exprlist ::= nexprlist */
- /* (377) nmnum ::= plus_num (OPTIMIZED OUT) */
- /* (378) nmnum ::= nm (OPTIMIZED OUT) */
- /* (379) nmnum ::= ON */
- /* (380) nmnum ::= DELETE */
- /* (381) nmnum ::= DEFAULT */
- /* (382) plus_num ::= INTEGER|FLOAT */
- /* (383) foreach_clause ::= */
- /* (384) foreach_clause ::= FOR EACH ROW */
- /* (385) trnm ::= nm */
- /* (386) tridxby ::= */
- /* (387) database_kw_opt ::= DATABASE */
- /* (388) database_kw_opt ::= */
- /* (389) kwcolumn_opt ::= */
- /* (390) kwcolumn_opt ::= COLUMNKW */
- /* (391) vtabarglist ::= vtabarg */
- /* (392) vtabarglist ::= vtabarglist COMMA vtabarg */
- /* (393) vtabarg ::= vtabarg vtabargtoken */
- /* (394) anylist ::= */
- /* (395) anylist ::= anylist LP anylist RP */
- /* (396) anylist ::= anylist ANY */
- /* (397) with ::= */
+ /* (339) input ::= cmdlist */
+ /* (340) cmdlist ::= cmdlist ecmd */
+ /* (341) cmdlist ::= ecmd (OPTIMIZED OUT) */
+ /* (342) ecmd ::= SEMI */
+ /* (343) ecmd ::= cmdx SEMI */
+ /* (344) ecmd ::= explain cmdx SEMI (NEVER REDUCES) */
+ /* (345) trans_opt ::= */
+ /* (346) trans_opt ::= TRANSACTION */
+ /* (347) trans_opt ::= TRANSACTION nm */
+ /* (348) savepoint_opt ::= SAVEPOINT */
+ /* (349) savepoint_opt ::= */
+ /* (350) cmd ::= create_table create_table_args */
+ /* (351) table_option_set ::= table_option (OPTIMIZED OUT) */
+ /* (352) columnlist ::= columnlist COMMA columnname carglist */
+ /* (353) columnlist ::= columnname carglist */
+ /* (354) nm ::= ID|INDEXED */
+ /* (355) nm ::= STRING */
+ /* (356) nm ::= JOIN_KW */
+ /* (357) typetoken ::= typename */
+ /* (358) typename ::= ID|STRING */
+ /* (359) signed ::= plus_num (OPTIMIZED OUT) */
+ /* (360) signed ::= minus_num (OPTIMIZED OUT) */
+ /* (361) carglist ::= carglist ccons */
+ /* (362) carglist ::= */
+ /* (363) ccons ::= NULL onconf */
+ /* (364) ccons ::= GENERATED ALWAYS AS generated */
+ /* (365) ccons ::= AS generated */
+ /* (366) conslist_opt ::= COMMA conslist */
+ /* (367) conslist ::= conslist tconscomma tcons */
+ /* (368) conslist ::= tcons (OPTIMIZED OUT) */
+ /* (369) tconscomma ::= */
+ /* (370) defer_subclause_opt ::= defer_subclause (OPTIMIZED OUT) */
+ /* (371) resolvetype ::= raisetype (OPTIMIZED OUT) */
+ /* (372) selectnowith ::= oneselect (OPTIMIZED OUT) */
+ /* (373) oneselect ::= values */
+ /* (374) sclp ::= selcollist COMMA */
+ /* (375) as ::= ID|STRING */
+ /* (376) returning ::= */
+ /* (377) expr ::= term (OPTIMIZED OUT) */
+ /* (378) likeop ::= LIKE_KW|MATCH */
+ /* (379) exprlist ::= nexprlist */
+ /* (380) nmnum ::= plus_num (OPTIMIZED OUT) */
+ /* (381) nmnum ::= nm (OPTIMIZED OUT) */
+ /* (382) nmnum ::= ON */
+ /* (383) nmnum ::= DELETE */
+ /* (384) nmnum ::= DEFAULT */
+ /* (385) plus_num ::= INTEGER|FLOAT */
+ /* (386) foreach_clause ::= */
+ /* (387) foreach_clause ::= FOR EACH ROW */
+ /* (388) trnm ::= nm */
+ /* (389) tridxby ::= */
+ /* (390) database_kw_opt ::= DATABASE */
+ /* (391) database_kw_opt ::= */
+ /* (392) kwcolumn_opt ::= */
+ /* (393) kwcolumn_opt ::= COLUMNKW */
+ /* (394) vtabarglist ::= vtabarg */
+ /* (395) vtabarglist ::= vtabarglist COMMA vtabarg */
+ /* (396) vtabarg ::= vtabarg vtabargtoken */
+ /* (397) anylist ::= */
+ /* (398) anylist ::= anylist LP anylist RP */
+ /* (399) anylist ::= anylist ANY */
+ /* (400) with ::= */
break
//********* End reduce actions ***********************************************
}
@@ -143514,7 +145628,7 @@ func yy_reduce(tls *libc.TLS, yypParser uintptr, yyruleno uint32, yyLookahead in
// It is not possible for a REDUCE to be followed by an error
- yymsp += 12 * (uintptr(yysize + 1))
+ yymsp += 12 * uintptr(yysize+1)
(*YyParser)(unsafe.Pointer(yypParser)).Fyytos = yymsp
(*YyStackEntry)(unsafe.Pointer(yymsp)).Fstateno = yyact
(*YyStackEntry)(unsafe.Pointer(yymsp)).Fmajor = uint16(yygoto)
@@ -143525,7 +145639,7 @@ func yy_reduce(tls *libc.TLS, yypParser uintptr, yyruleno uint32, yyLookahead in
// The following code executes when the parse fails
// The following code executes when a syntax error first occurs.
-func yy_syntax_error(tls *libc.TLS, yypParser uintptr, yymajor int32, yyminor Token) { /* sqlite3.c:163044:13: */
+func yy_syntax_error(tls *libc.TLS, yypParser uintptr, yymajor int32, yyminor Token) { /* sqlite3.c:164520:13: */
bp := tls.Alloc(16)
defer tls.Free(16)
*(*Token)(unsafe.Pointer(bp + 8)) = yyminor
@@ -143534,10 +145648,10 @@ func yy_syntax_error(tls *libc.TLS, yypParser uintptr, yymajor int32, yyminor To
//*********** Begin %syntax_error code ***************************************
_ = yymajor // Silence some compiler warnings
- if *(*uint8)(unsafe.Pointer((*Token)(unsafe.Pointer(bp + 8 /* &yyminor */)).Fz)) != 0 {
- Xsqlite3ErrorMsg(tls, pParse, ts+21275 /* "near \"%T\": synta..." */, libc.VaList(bp, bp+8 /* &yyminor */))
+ if *(*uint8)(unsafe.Pointer((*Token)(unsafe.Pointer(bp + 8)).Fz)) != 0 {
+ Xsqlite3ErrorMsg(tls, pParse, ts+22572 /* "near \"%T\": synta..." */, libc.VaList(bp, bp+8 /* &yyminor */))
} else {
- Xsqlite3ErrorMsg(tls, pParse, ts+21563 /* "incomplete input" */, 0)
+ Xsqlite3ErrorMsg(tls, pParse, ts+22860 /* "incomplete input" */, 0)
}
//*********** End %syntax_error code *****************************************
@@ -143545,7 +145659,7 @@ func yy_syntax_error(tls *libc.TLS, yypParser uintptr, yymajor int32, yyminor To
}
// The following is executed when the parser accepts
-func yy_accept(tls *libc.TLS, yypParser uintptr) { /* sqlite3.c:163068:13: */
+func yy_accept(tls *libc.TLS, yypParser uintptr) { /* sqlite3.c:164544:13: */
var pParse uintptr = (*YyParser)(unsafe.Pointer(yypParser)).FpParse
@@ -143575,7 +145689,7 @@ func yy_accept(tls *libc.TLS, yypParser uintptr) { /* sqlite3.c:163068:13: */
//
// Outputs:
// None.
-func Xsqlite3Parser(tls *libc.TLS, yyp uintptr, yymajor int32, yyminor Token) { /* sqlite3.c:163109:21: */
+func Xsqlite3Parser(tls *libc.TLS, yyp uintptr, yymajor int32, yyminor Token) { /* sqlite3.c:164585:21: */
bp := tls.Alloc(8)
defer tls.Free(8)
@@ -143591,7 +145705,7 @@ func Xsqlite3Parser(tls *libc.TLS, yyp uintptr, yymajor int32, yyminor Token) {
yyact = yy_find_shift_action(tls, uint16(yymajor), yyact)
if int32(yyact) >= YY_MIN_REDUCE {
- var yyruleno uint32 = (uint32(int32(yyact) - YY_MIN_REDUCE)) // Reduce by this rule
+ var yyruleno uint32 = uint32(int32(yyact) - YY_MIN_REDUCE) // Reduce by this rule
// Check that the stack is large enough to grow by a single entry
// if the RHS of the rule is empty. This ensures that there is room
@@ -143629,7 +145743,7 @@ func Xsqlite3Parser(tls *libc.TLS, yyp uintptr, yymajor int32, yyminor Token) {
// Return the fallback token corresponding to canonical token iToken, or
// 0 if iToken has no fallback.
-func Xsqlite3ParserFallback(tls *libc.TLS, iToken int32) int32 { /* sqlite3.c:163327:20: */
+func Xsqlite3ParserFallback(tls *libc.TLS, iToken int32) int32 { /* sqlite3.c:164802:20: */
return int32(yyFallback[iToken])
}
@@ -143680,7 +145794,7 @@ var aiClass = [256]uint8{
/* Dx */ uint8(27), uint8(27), uint8(27), uint8(27), uint8(27), uint8(27), uint8(27), uint8(27), uint8(27), uint8(27), uint8(27), uint8(27), uint8(27), uint8(27), uint8(27), uint8(27),
/* Ex */ uint8(27), uint8(27), uint8(27), uint8(27), uint8(27), uint8(27), uint8(27), uint8(27), uint8(27), uint8(27), uint8(27), uint8(27), uint8(27), uint8(27), uint8(27), uint8(30),
/* Fx */ uint8(27), uint8(27), uint8(27), uint8(27), uint8(27), uint8(27), uint8(27), uint8(27), uint8(27), uint8(27), uint8(27), uint8(27), uint8(27), uint8(27), uint8(27), uint8(27),
-} /* sqlite3.c:163399:28 */
+} /* sqlite3.c:164874:28 */
// The charMap() macro maps alphabetic characters (only) into their
// lower-case ASCII equivalent. On ASCII machines, this is just
@@ -143766,7 +145880,7 @@ var zKWText = [666]uint8{
uint8('W'), uint8('S'), uint8('U'), uint8('N'), uint8('B'), uint8('O'), uint8('U'), uint8('N'), uint8('D'), uint8('E'), uint8('D'), uint8('U'), uint8('N'), uint8('I'), uint8('O'), uint8('N'), uint8('U'), uint8('S'),
uint8('I'), uint8('N'), uint8('G'), uint8('V'), uint8('A'), uint8('C'), uint8('U'), uint8('U'), uint8('M'), uint8('V'), uint8('I'), uint8('E'), uint8('W'), uint8('I'), uint8('N'), uint8('D'), uint8('O'), uint8('W'),
uint8('B'), uint8('Y'), uint8('I'), uint8('N'), uint8('I'), uint8('T'), uint8('I'), uint8('A'), uint8('L'), uint8('L'), uint8('Y'), uint8('P'), uint8('R'), uint8('I'), uint8('M'), uint8('A'), uint8('R'), uint8('Y'),
-} /* sqlite3.c:163515:19 */
+} /* sqlite3.c:164990:19 */
// aKWHash[i] is the hash value for the i-th keyword
var aKWHash = [127]uint8{
uint8(84), uint8(92), uint8(134), uint8(82), uint8(105), uint8(29), uint8(0), uint8(0), uint8(94), uint8(0), uint8(85), uint8(72), uint8(0),
@@ -143779,7 +145893,7 @@ var aKWHash = [127]uint8{
uint8(50), uint8(124), uint8(0), uint8(100), uint8(0), uint8(18), uint8(121), uint8(144), uint8(56), uint8(130), uint8(139), uint8(88), uint8(83),
uint8(37), uint8(30), uint8(126), uint8(0), uint8(0), uint8(108), uint8(51), uint8(131), uint8(128), uint8(0), uint8(34), uint8(0), uint8(0),
uint8(132), uint8(0), uint8(98), uint8(38), uint8(39), uint8(0), uint8(20), uint8(45), uint8(117), uint8(93),
-} /* sqlite3.c:163555:28 */
+} /* sqlite3.c:165030:28 */
// aKWNext[] forms the hash collision chain. If aKWHash[i]==0
// then the i-th keyword has no more hash collisions. Otherwise,
// the next keyword with the same hash is aKWHash[i]-1.
@@ -143796,7 +145910,7 @@ var aKWNext = [147]uint8{
uint8(112), uint8(21), uint8(7), uint8(67), uint8(0), uint8(79), uint8(96), uint8(118), uint8(0), uint8(0), uint8(68), uint8(0), uint8(0),
uint8(99), uint8(44), uint8(0), uint8(55), uint8(0), uint8(76), uint8(0), uint8(95), uint8(32), uint8(33), uint8(57), uint8(25), uint8(0),
uint8(102), uint8(0), uint8(0), uint8(87),
-} /* sqlite3.c:163570:28 */
+} /* sqlite3.c:165045:28 */
// aKWLen[i] is the length (in bytes) of the i-th keyword
var aKWLen = [147]uint8{
uint8(7), uint8(7), uint8(5), uint8(4), uint8(6), uint8(4), uint8(5), uint8(3), uint8(6), uint8(7), uint8(3), uint8(6), uint8(6),
@@ -143811,7 +145925,7 @@ var aKWLen = [147]uint8{
uint8(4), uint8(4), uint8(6), uint8(7), uint8(5), uint8(9), uint8(4), uint8(4), uint8(5), uint8(2), uint8(5), uint8(8), uint8(6),
uint8(4), uint8(9), uint8(5), uint8(8), uint8(4), uint8(3), uint8(9), uint8(5), uint8(5), uint8(6), uint8(4), uint8(6), uint8(2),
uint8(2), uint8(9), uint8(3), uint8(7),
-} /* sqlite3.c:163585:28 */
+} /* sqlite3.c:165060:28 */
// aKWOffset[i] is the index into zKWText[] of the start of
// the text for the i-th keyword.
var aKWOffset = [147]uint16{
@@ -143827,7 +145941,7 @@ var aKWOffset = [147]uint16{
uint16(520), uint16(523), uint16(527), uint16(532), uint16(539), uint16(544), uint16(553), uint16(557), uint16(560), uint16(565), uint16(567), uint16(571), uint16(579),
uint16(585), uint16(588), uint16(597), uint16(602), uint16(610), uint16(610), uint16(614), uint16(623), uint16(628), uint16(633), uint16(639), uint16(642), uint16(645),
uint16(648), uint16(650), uint16(655), uint16(659),
-} /* sqlite3.c:163601:33 */
+} /* sqlite3.c:165076:33 */
// aKWCode[i] is the parser symbol code for the i-th keyword
var aKWCode = [147]uint8{
uint8(TK_REINDEX), uint8(TK_INDEXED), uint8(TK_INDEX), uint8(TK_DESC), uint8(TK_ESCAPE),
@@ -143860,7 +145974,7 @@ var aKWCode = [147]uint8{
uint8(TK_ROW), uint8(TK_UNBOUNDED), uint8(TK_UNION), uint8(TK_USING), uint8(TK_VACUUM),
uint8(TK_VIEW), uint8(TK_WINDOW), uint8(TK_DO), uint8(TK_BY), uint8(TK_INITIALLY),
uint8(TK_ALL), uint8(TK_PRIMARY),
-} /* sqlite3.c:163616:28 */
+} /* sqlite3.c:165091:28 */
// Hash table decoded:
// 0: INSERT
@@ -143993,25 +146107,25 @@ var aKWCode = [147]uint8{
// Check to see if z[0..n-1] is a keyword. If it is, write the
// parser symbol code for that keyword into *pType. Always
// return the integer n (the length of the token).
-func keywordCode(tls *libc.TLS, z uintptr, n int32, pType uintptr) int32 { /* sqlite3.c:163780:12: */
+func keywordCode(tls *libc.TLS, z uintptr, n int32, pType uintptr) int32 { /* sqlite3.c:165255:12: */
var i int32
var j int32
var zKW uintptr
if n >= 2 {
- i = ((((int32(Xsqlite3UpperToLower[uint8(*(*uint8)(unsafe.Pointer(z)))]) * 4) ^ (int32(Xsqlite3UpperToLower[uint8(*(*uint8)(unsafe.Pointer(z + uintptr((n - 1)))))]) * 3)) ^ (n * 1)) % 127)
- for i = ((int32(aKWHash[i])) - 1); i >= 0; i = ((int32(aKWNext[i])) - 1) {
+ i = (int32(Xsqlite3UpperToLower[uint8(*(*uint8)(unsafe.Pointer(z)))])*4 ^ int32(Xsqlite3UpperToLower[uint8(*(*uint8)(unsafe.Pointer(z + uintptr(n-1))))])*3 ^ n*1) % 127
+ for i = int32(aKWHash[i]) - 1; i >= 0; i = int32(aKWNext[i]) - 1 {
if int32(aKWLen[i]) != n {
continue
}
- zKW = (uintptr(unsafe.Pointer(&zKWText)) + uintptr(aKWOffset[i]))
- if (int32(*(*uint8)(unsafe.Pointer(z))) & libc.CplInt32(0x20)) != int32(*(*uint8)(unsafe.Pointer(zKW))) {
+ zKW = uintptr(unsafe.Pointer(&zKWText)) + uintptr(aKWOffset[i])
+ if int32(*(*uint8)(unsafe.Pointer(z)))&libc.CplInt32(0x20) != int32(*(*uint8)(unsafe.Pointer(zKW))) {
continue
}
- if (int32(*(*uint8)(unsafe.Pointer(z + 1))) & libc.CplInt32(0x20)) != int32(*(*uint8)(unsafe.Pointer(zKW + 1))) {
+ if int32(*(*uint8)(unsafe.Pointer(z + 1)))&libc.CplInt32(0x20) != int32(*(*uint8)(unsafe.Pointer(zKW + 1))) {
continue
}
j = 2
- for (j < n) && ((int32(*(*uint8)(unsafe.Pointer(z + uintptr(j)))) & libc.CplInt32(0x20)) == int32(*(*uint8)(unsafe.Pointer(zKW + uintptr(j))))) {
+ for j < n && int32(*(*uint8)(unsafe.Pointer(z + uintptr(j))))&libc.CplInt32(0x20) == int32(*(*uint8)(unsafe.Pointer(zKW + uintptr(j)))) {
j++
}
if j < n {
@@ -144171,7 +146285,7 @@ func keywordCode(tls *libc.TLS, z uintptr, n int32, pType uintptr) int32 { /* sq
return n
}
-func Xsqlite3KeywordCode(tls *libc.TLS, z uintptr, n int32) int32 { /* sqlite3.c:163954:20: */
+func Xsqlite3KeywordCode(tls *libc.TLS, z uintptr, n int32) int32 { /* sqlite3.c:165429:20: */
bp := tls.Alloc(4)
defer tls.Free(4)
@@ -144180,21 +146294,21 @@ func Xsqlite3KeywordCode(tls *libc.TLS, z uintptr, n int32) int32 { /* sqlite3.c
return *(*int32)(unsafe.Pointer(bp /* id */))
}
-func Xsqlite3_keyword_name(tls *libc.TLS, i int32, pzName uintptr, pnName uintptr) int32 { /* sqlite3.c:163960:16: */
- if (i < 0) || (i >= SQLITE_N_KEYWORD) {
+func Xsqlite3_keyword_name(tls *libc.TLS, i int32, pzName uintptr, pnName uintptr) int32 { /* sqlite3.c:165435:16: */
+ if i < 0 || i >= SQLITE_N_KEYWORD {
return SQLITE_ERROR
}
- *(*uintptr)(unsafe.Pointer(pzName)) = (uintptr(unsafe.Pointer(&zKWText)) + uintptr(aKWOffset[i]))
+ *(*uintptr)(unsafe.Pointer(pzName)) = uintptr(unsafe.Pointer(&zKWText)) + uintptr(aKWOffset[i])
*(*int32)(unsafe.Pointer(pnName)) = int32(aKWLen[i])
return SQLITE_OK
}
-func Xsqlite3_keyword_count(tls *libc.TLS) int32 { /* sqlite3.c:163966:16: */
+func Xsqlite3_keyword_count(tls *libc.TLS) int32 { /* sqlite3.c:165441:16: */
return SQLITE_N_KEYWORD
}
-func Xsqlite3_keyword_check(tls *libc.TLS, zName uintptr, nName int32) int32 { /* sqlite3.c:163967:16: */
- return (libc.Bool32(TK_ID != Xsqlite3KeywordCode(tls, zName, nName)))
+func Xsqlite3_keyword_check(tls *libc.TLS, zName uintptr, nName int32) int32 { /* sqlite3.c:165442:16: */
+ return libc.Bool32(TK_ID != Xsqlite3KeywordCode(tls, zName, nName))
}
//************* End of keywordhash.h ****************************************
@@ -144216,28 +146330,28 @@ func Xsqlite3_keyword_check(tls *libc.TLS, zName uintptr, nName int32) int32 { /
// But the feature is undocumented.
// Make the IdChar function accessible from ctime.c and alter.c
-func Xsqlite3IsIdChar(tls *libc.TLS, c U8) int32 { /* sqlite3.c:164014:20: */
- return (libc.Bool32((int32(Xsqlite3CtypeMap[c]) & 0x46) != 0))
+func Xsqlite3IsIdChar(tls *libc.TLS, c U8) int32 { /* sqlite3.c:165489:20: */
+ return libc.Bool32(int32(Xsqlite3CtypeMap[c])&0x46 != 0)
}
// Return the id of the next token in string (*pz). Before returning, set
// (*pz) to point to the byte following the parsed token.
-func getToken(tls *libc.TLS, pz uintptr) int32 { /* sqlite3.c:164021:12: */
+func getToken(tls *libc.TLS, pz uintptr) int32 { /* sqlite3.c:165496:12: */
bp := tls.Alloc(4)
defer tls.Free(4)
var z uintptr = *(*uintptr)(unsafe.Pointer(pz))
// var t int32 at bp, 4
// Token type to return
- for ok := true; ok; ok = (*(*int32)(unsafe.Pointer(bp /* t */)) == TK_SPACE) {
+ for ok := true; ok; ok = *(*int32)(unsafe.Pointer(bp)) == TK_SPACE {
z += uintptr(Xsqlite3GetToken(tls, z, bp /* &t */))
}
- if (((((*(*int32)(unsafe.Pointer(bp /* t */)) == TK_ID) ||
- (*(*int32)(unsafe.Pointer(bp /* t */)) == TK_STRING)) ||
- (*(*int32)(unsafe.Pointer(bp /* t */)) == TK_JOIN_KW)) ||
- (*(*int32)(unsafe.Pointer(bp /* t */)) == TK_WINDOW)) ||
- (*(*int32)(unsafe.Pointer(bp /* t */)) == TK_OVER)) ||
- (Xsqlite3ParserFallback(tls, *(*int32)(unsafe.Pointer(bp /* t */))) == TK_ID) {
+ if *(*int32)(unsafe.Pointer(bp)) == TK_ID ||
+ *(*int32)(unsafe.Pointer(bp)) == TK_STRING ||
+ *(*int32)(unsafe.Pointer(bp)) == TK_JOIN_KW ||
+ *(*int32)(unsafe.Pointer(bp)) == TK_WINDOW ||
+ *(*int32)(unsafe.Pointer(bp)) == TK_OVER ||
+ Xsqlite3ParserFallback(tls, *(*int32)(unsafe.Pointer(bp))) == TK_ID {
*(*int32)(unsafe.Pointer(bp /* t */)) = TK_ID
}
*(*uintptr)(unsafe.Pointer(pz)) = z
@@ -144272,7 +146386,7 @@ func getToken(tls *libc.TLS, pz uintptr) int32 { /* sqlite3.c:164021:12: */
//
// * the previous token was TK_RP, and
// * the next token is TK_LP.
-func analyzeWindowKeyword(tls *libc.TLS, z uintptr) int32 { /* sqlite3.c:164070:12: */
+func analyzeWindowKeyword(tls *libc.TLS, z uintptr) int32 { /* sqlite3.c:165545:12: */
bp := tls.Alloc(4)
defer tls.Free(4)
*(*uintptr)(unsafe.Pointer(bp)) = z
@@ -144289,26 +146403,26 @@ func analyzeWindowKeyword(tls *libc.TLS, z uintptr) int32 { /* sqlite3.c:164070:
return TK_WINDOW
}
-func analyzeOverKeyword(tls *libc.TLS, z uintptr, lastToken int32) int32 { /* sqlite3.c:164078:12: */
+func analyzeOverKeyword(tls *libc.TLS, z uintptr, lastToken int32) int32 { /* sqlite3.c:165553:12: */
bp := tls.Alloc(4)
defer tls.Free(4)
*(*uintptr)(unsafe.Pointer(bp)) = z
if lastToken == TK_RP {
var t int32 = getToken(tls, bp /* &z */)
- if (t == TK_LP) || (t == TK_ID) {
+ if t == TK_LP || t == TK_ID {
return TK_OVER
}
}
return TK_ID
}
-func analyzeFilterKeyword(tls *libc.TLS, z uintptr, lastToken int32) int32 { /* sqlite3.c:164085:12: */
+func analyzeFilterKeyword(tls *libc.TLS, z uintptr, lastToken int32) int32 { /* sqlite3.c:165560:12: */
bp := tls.Alloc(4)
defer tls.Free(4)
*(*uintptr)(unsafe.Pointer(bp)) = z
- if (lastToken == TK_RP) && (getToken(tls, bp /* &z */) == TK_LP) {
+ if lastToken == TK_RP && getToken(tls, bp) == TK_LP {
return TK_FILTER
}
return TK_ID
@@ -144316,7 +146430,7 @@ func analyzeFilterKeyword(tls *libc.TLS, z uintptr, lastToken int32) int32 { /*
// Return the length (in bytes) of the token that begins at z[0].
// Store the token type in *tokenType before returning.
-func Xsqlite3GetToken(tls *libc.TLS, z uintptr, tokenType uintptr) int32 { /* sqlite3.c:164097:20: */
+func Xsqlite3GetToken(tls *libc.TLS, z uintptr, tokenType uintptr) int32 { /* sqlite3.c:165572:20: */
var i int32
var c int32
switch int32(aiClass[*(*uint8)(unsafe.Pointer(z))]) { // Switch on the character-class of the first byte
@@ -144325,7 +146439,7 @@ func Xsqlite3GetToken(tls *libc.TLS, z uintptr, tokenType uintptr) int32 { /* sq
case CC_SPACE:
{
- for i = 1; (int32(Xsqlite3CtypeMap[*(*uint8)(unsafe.Pointer(z + uintptr(i)))]) & 0x01) != 0; i++ {
+ for i = 1; int32(Xsqlite3CtypeMap[*(*uint8)(unsafe.Pointer(z + uintptr(i)))])&0x01 != 0; i++ {
}
*(*int32)(unsafe.Pointer(tokenType)) = TK_SPACE
return i
@@ -144334,7 +146448,7 @@ func Xsqlite3GetToken(tls *libc.TLS, z uintptr, tokenType uintptr) int32 { /* sq
case CC_MINUS:
{
if int32(*(*uint8)(unsafe.Pointer(z + 1))) == '-' {
- for i = 2; ((libc.AssignInt32(&c, int32(*(*uint8)(unsafe.Pointer(z + uintptr(i)))))) != 0) && (c != '\n'); i++ {
+ for i = 2; libc.AssignInt32(&c, int32(*(*uint8)(unsafe.Pointer(z + uintptr(i))))) != 0 && c != '\n'; i++ {
}
*(*int32)(unsafe.Pointer(tokenType)) = TK_SPACE // IMP: R-22934-25134
return i
@@ -144375,13 +146489,13 @@ func Xsqlite3GetToken(tls *libc.TLS, z uintptr, tokenType uintptr) int32 { /* sq
}
case CC_SLASH:
{
- if (int32(*(*uint8)(unsafe.Pointer(z + 1))) != '*') || (int32(*(*uint8)(unsafe.Pointer(z + 2))) == 0) {
+ if int32(*(*uint8)(unsafe.Pointer(z + 1))) != '*' || int32(*(*uint8)(unsafe.Pointer(z + 2))) == 0 {
*(*int32)(unsafe.Pointer(tokenType)) = TK_SLASH
return 1
}
i = 3
c = int32(*(*uint8)(unsafe.Pointer(z + 2)))
- for ; ((c != '*') || (int32(*(*uint8)(unsafe.Pointer(z + uintptr(i)))) != '/')) && ((libc.AssignInt32(&c, int32(*(*uint8)(unsafe.Pointer(z + uintptr(i)))))) != 0); i++ {
+ for ; (c != '*' || int32(*(*uint8)(unsafe.Pointer(z + uintptr(i)))) != '/') && libc.AssignInt32(&c, int32(*(*uint8)(unsafe.Pointer(z + uintptr(i))))) != 0; i++ {
}
if c != 0 {
i++
@@ -144399,12 +146513,12 @@ func Xsqlite3GetToken(tls *libc.TLS, z uintptr, tokenType uintptr) int32 { /* sq
case CC_EQ:
{
*(*int32)(unsafe.Pointer(tokenType)) = TK_EQ
- return (1 + (libc.Bool32(int32(*(*uint8)(unsafe.Pointer(z + 1))) == '=')))
+ return 1 + libc.Bool32(int32(*(*uint8)(unsafe.Pointer(z + 1))) == '=')
}
case CC_LT:
{
- if (libc.AssignInt32(&c, int32(*(*uint8)(unsafe.Pointer(z + 1))))) == '=' {
+ if libc.AssignInt32(&c, int32(*(*uint8)(unsafe.Pointer(z + 1)))) == '=' {
*(*int32)(unsafe.Pointer(tokenType)) = TK_LE
return 2
} else if c == '>' {
@@ -144422,7 +146536,7 @@ func Xsqlite3GetToken(tls *libc.TLS, z uintptr, tokenType uintptr) int32 { /* sq
fallthrough
case CC_GT:
{
- if (libc.AssignInt32(&c, int32(*(*uint8)(unsafe.Pointer(z + 1))))) == '=' {
+ if libc.AssignInt32(&c, int32(*(*uint8)(unsafe.Pointer(z + 1)))) == '=' {
*(*int32)(unsafe.Pointer(tokenType)) = TK_GE
return 2
} else if c == '>' {
@@ -144481,9 +146595,9 @@ func Xsqlite3GetToken(tls *libc.TLS, z uintptr, tokenType uintptr) int32 { /* sq
{
var delim int32 = int32(*(*uint8)(unsafe.Pointer(z)))
- for i = 1; (libc.AssignInt32(&c, int32(*(*uint8)(unsafe.Pointer(z + uintptr(i)))))) != 0; i++ {
+ for i = 1; libc.AssignInt32(&c, int32(*(*uint8)(unsafe.Pointer(z + uintptr(i))))) != 0; i++ {
if c == delim {
- if int32(*(*uint8)(unsafe.Pointer(z + uintptr((i + 1))))) == delim {
+ if int32(*(*uint8)(unsafe.Pointer(z + uintptr(i+1)))) == delim {
i++
} else {
break
@@ -144492,10 +146606,10 @@ func Xsqlite3GetToken(tls *libc.TLS, z uintptr, tokenType uintptr) int32 { /* sq
}
if c == '\'' {
*(*int32)(unsafe.Pointer(tokenType)) = TK_STRING
- return (i + 1)
+ return i + 1
} else if c != 0 {
*(*int32)(unsafe.Pointer(tokenType)) = TK_ID
- return (i + 1)
+ return i + 1
} else {
*(*int32)(unsafe.Pointer(tokenType)) = TK_ILLEGAL
return i
@@ -144505,7 +146619,7 @@ func Xsqlite3GetToken(tls *libc.TLS, z uintptr, tokenType uintptr) int32 { /* sq
fallthrough
case CC_DOT:
{
- if !((int32(Xsqlite3CtypeMap[*(*uint8)(unsafe.Pointer(z + 1))]) & 0x04) != 0) {
+ if !(int32(Xsqlite3CtypeMap[*(*uint8)(unsafe.Pointer(z + 1))])&0x04 != 0) {
*(*int32)(unsafe.Pointer(tokenType)) = TK_DOT
return 1
}
@@ -144516,29 +146630,29 @@ func Xsqlite3GetToken(tls *libc.TLS, z uintptr, tokenType uintptr) int32 { /* sq
{
*(*int32)(unsafe.Pointer(tokenType)) = TK_INTEGER
- if ((int32(*(*uint8)(unsafe.Pointer(z))) == '0') && ((int32(*(*uint8)(unsafe.Pointer(z + 1))) == 'x') || (int32(*(*uint8)(unsafe.Pointer(z + 1))) == 'X'))) && ((int32(Xsqlite3CtypeMap[*(*uint8)(unsafe.Pointer(z + 2))]) & 0x08) != 0) {
- for i = 3; (int32(Xsqlite3CtypeMap[*(*uint8)(unsafe.Pointer(z + uintptr(i)))]) & 0x08) != 0; i++ {
+ if int32(*(*uint8)(unsafe.Pointer(z))) == '0' && (int32(*(*uint8)(unsafe.Pointer(z + 1))) == 'x' || int32(*(*uint8)(unsafe.Pointer(z + 1))) == 'X') && int32(Xsqlite3CtypeMap[*(*uint8)(unsafe.Pointer(z + 2))])&0x08 != 0 {
+ for i = 3; int32(Xsqlite3CtypeMap[*(*uint8)(unsafe.Pointer(z + uintptr(i)))])&0x08 != 0; i++ {
}
return i
}
- for i = 0; (int32(Xsqlite3CtypeMap[*(*uint8)(unsafe.Pointer(z + uintptr(i)))]) & 0x04) != 0; i++ {
+ for i = 0; int32(Xsqlite3CtypeMap[*(*uint8)(unsafe.Pointer(z + uintptr(i)))])&0x04 != 0; i++ {
}
if int32(*(*uint8)(unsafe.Pointer(z + uintptr(i)))) == '.' {
i++
- for (int32(Xsqlite3CtypeMap[*(*uint8)(unsafe.Pointer(z + uintptr(i)))]) & 0x04) != 0 {
+ for int32(Xsqlite3CtypeMap[*(*uint8)(unsafe.Pointer(z + uintptr(i)))])&0x04 != 0 {
i++
}
*(*int32)(unsafe.Pointer(tokenType)) = TK_FLOAT
}
- if ((int32(*(*uint8)(unsafe.Pointer(z + uintptr(i)))) == 'e') || (int32(*(*uint8)(unsafe.Pointer(z + uintptr(i)))) == 'E')) && (((int32(Xsqlite3CtypeMap[*(*uint8)(unsafe.Pointer(z + uintptr((i + 1))))]) & 0x04) != 0) ||
- (((int32(*(*uint8)(unsafe.Pointer(z + uintptr((i + 1))))) == '+') || (int32(*(*uint8)(unsafe.Pointer(z + uintptr((i + 1))))) == '-')) && ((int32(Xsqlite3CtypeMap[*(*uint8)(unsafe.Pointer(z + uintptr((i + 2))))]) & 0x04) != 0))) {
- i = i + (2)
- for (int32(Xsqlite3CtypeMap[*(*uint8)(unsafe.Pointer(z + uintptr(i)))]) & 0x04) != 0 {
+ if (int32(*(*uint8)(unsafe.Pointer(z + uintptr(i)))) == 'e' || int32(*(*uint8)(unsafe.Pointer(z + uintptr(i)))) == 'E') && (int32(Xsqlite3CtypeMap[*(*uint8)(unsafe.Pointer(z + uintptr(i+1)))])&0x04 != 0 ||
+ (int32(*(*uint8)(unsafe.Pointer(z + uintptr(i+1)))) == '+' || int32(*(*uint8)(unsafe.Pointer(z + uintptr(i+1)))) == '-') && int32(Xsqlite3CtypeMap[*(*uint8)(unsafe.Pointer(z + uintptr(i+2)))])&0x04 != 0) {
+ i = i + 2
+ for int32(Xsqlite3CtypeMap[*(*uint8)(unsafe.Pointer(z + uintptr(i)))])&0x04 != 0 {
i++
}
*(*int32)(unsafe.Pointer(tokenType)) = TK_FLOAT
}
- for (int32(Xsqlite3CtypeMap[*(*uint8)(unsafe.Pointer(z + uintptr(i)))]) & 0x46) != 0 {
+ for int32(Xsqlite3CtypeMap[*(*uint8)(unsafe.Pointer(z + uintptr(i)))])&0x46 != 0 {
*(*int32)(unsafe.Pointer(tokenType)) = TK_ILLEGAL
i++
}
@@ -144549,7 +146663,7 @@ func Xsqlite3GetToken(tls *libc.TLS, z uintptr, tokenType uintptr) int32 { /* sq
{
i = 1
c = int32(*(*uint8)(unsafe.Pointer(z)))
- for ; (c != ']') && ((libc.AssignInt32(&c, int32(*(*uint8)(unsafe.Pointer(z + uintptr(i)))))) != 0); i++ {
+ for ; c != ']' && libc.AssignInt32(&c, int32(*(*uint8)(unsafe.Pointer(z + uintptr(i))))) != 0; i++ {
}
*(*int32)(unsafe.Pointer(tokenType)) = func() int32 {
if c == ']' {
@@ -144563,7 +146677,7 @@ func Xsqlite3GetToken(tls *libc.TLS, z uintptr, tokenType uintptr) int32 { /* sq
case CC_VARNUM:
{
*(*int32)(unsafe.Pointer(tokenType)) = TK_VARIABLE
- for i = 1; (int32(Xsqlite3CtypeMap[*(*uint8)(unsafe.Pointer(z + uintptr(i)))]) & 0x04) != 0; i++ {
+ for i = 1; int32(Xsqlite3CtypeMap[*(*uint8)(unsafe.Pointer(z + uintptr(i)))])&0x04 != 0; i++ {
}
return i
@@ -144575,11 +146689,11 @@ func Xsqlite3GetToken(tls *libc.TLS, z uintptr, tokenType uintptr) int32 { /* sq
var n int32 = 0
*(*int32)(unsafe.Pointer(tokenType)) = TK_VARIABLE
- for i = 1; (libc.AssignInt32(&c, int32(*(*uint8)(unsafe.Pointer(z + uintptr(i)))))) != 0; i++ {
- if (int32(Xsqlite3CtypeMap[uint8(c)]) & 0x46) != 0 {
+ for i = 1; libc.AssignInt32(&c, int32(*(*uint8)(unsafe.Pointer(z + uintptr(i))))) != 0; i++ {
+ if int32(Xsqlite3CtypeMap[uint8(c)])&0x46 != 0 {
n++
- } else if (c == '(') && (n > 0) {
- for ok := true; ok; ok = ((((libc.AssignInt32(&c, int32(*(*uint8)(unsafe.Pointer(z + uintptr(i)))))) != 0) && !((int32(Xsqlite3CtypeMap[uint8(c)]) & 0x01) != 0)) && (c != ')')) {
+ } else if c == '(' && n > 0 {
+ for ok := true; ok; ok = libc.AssignInt32(&c, int32(*(*uint8)(unsafe.Pointer(z + uintptr(i))))) != 0 && !(int32(Xsqlite3CtypeMap[uint8(c)])&0x01 != 0) && c != ')' {
i++
}
if c == ')' {
@@ -144588,7 +146702,7 @@ func Xsqlite3GetToken(tls *libc.TLS, z uintptr, tokenType uintptr) int32 { /* sq
*(*int32)(unsafe.Pointer(tokenType)) = TK_ILLEGAL
}
break
- } else if (c == ':') && (int32(*(*uint8)(unsafe.Pointer(z + uintptr((i + 1))))) == ':') {
+ } else if c == ':' && int32(*(*uint8)(unsafe.Pointer(z + uintptr(i+1)))) == ':' {
i++
} else {
break
@@ -144604,7 +146718,7 @@ func Xsqlite3GetToken(tls *libc.TLS, z uintptr, tokenType uintptr) int32 { /* sq
{
for i = 1; int32(aiClass[*(*uint8)(unsafe.Pointer(z + uintptr(i)))]) <= CC_KYWD; i++ {
}
- if (int32(Xsqlite3CtypeMap[*(*uint8)(unsafe.Pointer(z + uintptr(i)))]) & 0x46) != 0 {
+ if int32(Xsqlite3CtypeMap[*(*uint8)(unsafe.Pointer(z + uintptr(i)))])&0x46 != 0 {
// This token started out using characters that can appear in keywords,
// but z[i] is a character not allowed within keywords, so this must
// be an identifier instead
@@ -144620,11 +146734,11 @@ func Xsqlite3GetToken(tls *libc.TLS, z uintptr, tokenType uintptr) int32 { /* sq
if int32(*(*uint8)(unsafe.Pointer(z + 1))) == '\'' {
*(*int32)(unsafe.Pointer(tokenType)) = TK_BLOB
- for i = 2; (int32(Xsqlite3CtypeMap[*(*uint8)(unsafe.Pointer(z + uintptr(i)))]) & 0x08) != 0; i++ {
+ for i = 2; int32(Xsqlite3CtypeMap[*(*uint8)(unsafe.Pointer(z + uintptr(i)))])&0x08 != 0; i++ {
}
- if (int32(*(*uint8)(unsafe.Pointer(z + uintptr(i)))) != '\'') || ((i % 2) != 0) {
+ if int32(*(*uint8)(unsafe.Pointer(z + uintptr(i)))) != '\'' || i%2 != 0 {
*(*int32)(unsafe.Pointer(tokenType)) = TK_ILLEGAL
- for (*(*uint8)(unsafe.Pointer(z + uintptr(i))) != 0) && (int32(*(*uint8)(unsafe.Pointer(z + uintptr(i)))) != '\'') {
+ for *(*uint8)(unsafe.Pointer(z + uintptr(i))) != 0 && int32(*(*uint8)(unsafe.Pointer(z + uintptr(i)))) != '\'' {
i++
}
}
@@ -144646,7 +146760,7 @@ func Xsqlite3GetToken(tls *libc.TLS, z uintptr, tokenType uintptr) int32 { /* sq
}
case CC_BOM:
{
- if (int32(*(*uint8)(unsafe.Pointer(z + 1))) == 0xbb) && (int32(*(*uint8)(unsafe.Pointer(z + 2))) == 0xbf) {
+ if int32(*(*uint8)(unsafe.Pointer(z + 1))) == 0xbb && int32(*(*uint8)(unsafe.Pointer(z + 2))) == 0xbf {
*(*int32)(unsafe.Pointer(tokenType)) = TK_SPACE
return 3
}
@@ -144667,7 +146781,7 @@ func Xsqlite3GetToken(tls *libc.TLS, z uintptr, tokenType uintptr) int32 { /* sq
}
}
- for (int32(Xsqlite3CtypeMap[*(*uint8)(unsafe.Pointer(z + uintptr(i)))]) & 0x46) != 0 {
+ for int32(Xsqlite3CtypeMap[*(*uint8)(unsafe.Pointer(z + uintptr(i)))])&0x46 != 0 {
i++
}
*(*int32)(unsafe.Pointer(tokenType)) = TK_ID
@@ -144679,7 +146793,7 @@ func Xsqlite3GetToken(tls *libc.TLS, z uintptr, tokenType uintptr) int32 { /* sq
// then an and attempt is made to write an error message into
// memory obtained from sqlite3_malloc() and to make *pzErrMsg point to that
// error message.
-func Xsqlite3RunParser(tls *libc.TLS, pParse uintptr, zSql uintptr, pzErrMsg uintptr) int32 { /* sqlite3.c:164392:20: */
+func Xsqlite3RunParser(tls *libc.TLS, pParse uintptr, zSql uintptr, pzErrMsg uintptr) int32 { /* sqlite3.c:165867:20: */
bp := tls.Alloc(1256)
defer tls.Free(1256)
@@ -144691,12 +146805,13 @@ func Xsqlite3RunParser(tls *libc.TLS, pParse uintptr, zSql uintptr, pzErrMsg uin
var lastTokenParsed int32 = -1 // type of the previous token
var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb // The database connection
var mxSqlLen int32 // Max length of an SQL string
+ var pParentParse uintptr = uintptr(0) // Outer parse context, if any
// var sEngine YyParser at bp+40, 1212
// Space to hold the Lemon-generated Parser object
- mxSqlLen = *(*int32)(unsafe.Pointer((db + 112 /* &.aLimit */) + 1*4))
+ mxSqlLen = *(*int32)(unsafe.Pointer(db + 120 + 1*4))
if (*Sqlite3)(unsafe.Pointer(db)).FnVdbeActive == 0 {
- libc.AtomicStoreNInt32((db + 288 /* &.u1 */ /* &.isInterrupted */), int32(0), 0)
+ libc.AtomicStoreNInt32(db+312, int32(0), 0)
}
(*Parse)(unsafe.Pointer(pParse)).Frc = SQLITE_OK
(*Parse)(unsafe.Pointer(pParse)).FzTail = zSql
@@ -144704,22 +146819,22 @@ func Xsqlite3RunParser(tls *libc.TLS, pParse uintptr, zSql uintptr, pzErrMsg uin
pEngine = bp + 40 /* &sEngine */
Xsqlite3ParserInit(tls, pEngine, pParse)
- (*Parse)(unsafe.Pointer(pParse)).FpParentParse = (*Sqlite3)(unsafe.Pointer(db)).FpParse
+ pParentParse = (*Sqlite3)(unsafe.Pointer(db)).FpParse
(*Sqlite3)(unsafe.Pointer(db)).FpParse = pParse
for 1 != 0 {
n = Xsqlite3GetToken(tls, zSql, bp+1252 /* &tokenType */)
- mxSqlLen = mxSqlLen - (n)
+ mxSqlLen = mxSqlLen - n
if mxSqlLen < 0 {
(*Parse)(unsafe.Pointer(pParse)).Frc = SQLITE_TOOBIG
break
}
- if *(*int32)(unsafe.Pointer(bp + 1252 /* tokenType */)) >= TK_WINDOW {
+ if *(*int32)(unsafe.Pointer(bp + 1252)) >= TK_WINDOW {
- if libc.AtomicLoadNInt32((db+288 /* &.u1 */ /* &.isInterrupted */), 0) != 0 {
+ if libc.AtomicLoadNInt32(db+312, 0) != 0 {
(*Parse)(unsafe.Pointer(pParse)).Frc = SQLITE_INTERRUPT
break
}
- if *(*int32)(unsafe.Pointer(bp + 1252 /* tokenType */)) == TK_SPACE {
+ if *(*int32)(unsafe.Pointer(bp + 1252)) == TK_SPACE {
zSql += uintptr(n)
continue
}
@@ -144734,17 +146849,17 @@ func Xsqlite3RunParser(tls *libc.TLS, pParse uintptr, zSql uintptr, pzErrMsg uin
*(*int32)(unsafe.Pointer(bp + 1252 /* tokenType */)) = TK_SEMI
}
n = 0
- } else if *(*int32)(unsafe.Pointer(bp + 1252 /* tokenType */)) == TK_WINDOW {
+ } else if *(*int32)(unsafe.Pointer(bp + 1252)) == TK_WINDOW {
- *(*int32)(unsafe.Pointer(bp + 1252 /* tokenType */)) = analyzeWindowKeyword(tls, (zSql + 6))
- } else if *(*int32)(unsafe.Pointer(bp + 1252 /* tokenType */)) == TK_OVER {
+ *(*int32)(unsafe.Pointer(bp + 1252 /* tokenType */)) = analyzeWindowKeyword(tls, zSql+6)
+ } else if *(*int32)(unsafe.Pointer(bp + 1252)) == TK_OVER {
- *(*int32)(unsafe.Pointer(bp + 1252 /* tokenType */)) = analyzeOverKeyword(tls, (zSql + 4), lastTokenParsed)
- } else if *(*int32)(unsafe.Pointer(bp + 1252 /* tokenType */)) == TK_FILTER {
+ *(*int32)(unsafe.Pointer(bp + 1252 /* tokenType */)) = analyzeOverKeyword(tls, zSql+4, lastTokenParsed)
+ } else if *(*int32)(unsafe.Pointer(bp + 1252)) == TK_FILTER {
- *(*int32)(unsafe.Pointer(bp + 1252 /* tokenType */)) = analyzeFilterKeyword(tls, (zSql + 6), lastTokenParsed)
+ *(*int32)(unsafe.Pointer(bp + 1252 /* tokenType */)) = analyzeFilterKeyword(tls, zSql+6, lastTokenParsed)
} else {
- Xsqlite3ErrorMsg(tls, pParse, ts+21580 /* "unrecognized tok..." */, libc.VaList(bp, n, zSql))
+ Xsqlite3ErrorMsg(tls, pParse, ts+22877 /* "unrecognized tok..." */, libc.VaList(bp, n, zSql))
break
}
}
@@ -144763,19 +146878,19 @@ func Xsqlite3RunParser(tls *libc.TLS, pParse uintptr, zSql uintptr, pzErrMsg uin
if (*Sqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 {
(*Parse)(unsafe.Pointer(pParse)).Frc = SQLITE_NOMEM
}
- if (((*Parse)(unsafe.Pointer(pParse)).Frc != SQLITE_OK) && ((*Parse)(unsafe.Pointer(pParse)).Frc != SQLITE_DONE)) && ((*Parse)(unsafe.Pointer(pParse)).FzErrMsg == uintptr(0)) {
- (*Parse)(unsafe.Pointer(pParse)).FzErrMsg = Xsqlite3MPrintf(tls, db, ts+2790 /* "%s" */, libc.VaList(bp+16, Xsqlite3ErrStr(tls, (*Parse)(unsafe.Pointer(pParse)).Frc)))
+ if (*Parse)(unsafe.Pointer(pParse)).Frc != SQLITE_OK && (*Parse)(unsafe.Pointer(pParse)).Frc != SQLITE_DONE && (*Parse)(unsafe.Pointer(pParse)).FzErrMsg == uintptr(0) {
+ (*Parse)(unsafe.Pointer(pParse)).FzErrMsg = Xsqlite3MPrintf(tls, db, ts+3601 /* "%s" */, libc.VaList(bp+16, Xsqlite3ErrStr(tls, (*Parse)(unsafe.Pointer(pParse)).Frc)))
}
if (*Parse)(unsafe.Pointer(pParse)).FzErrMsg != 0 {
*(*uintptr)(unsafe.Pointer(pzErrMsg)) = (*Parse)(unsafe.Pointer(pParse)).FzErrMsg
- Xsqlite3_log(tls, (*Parse)(unsafe.Pointer(pParse)).Frc, ts+21607, /* "%s in \"%s\"" */
+ Xsqlite3_log(tls, (*Parse)(unsafe.Pointer(pParse)).Frc, ts+22904, /* "%s in \"%s\"" */
libc.VaList(bp+24, *(*uintptr)(unsafe.Pointer(pzErrMsg)), (*Parse)(unsafe.Pointer(pParse)).FzTail))
(*Parse)(unsafe.Pointer(pParse)).FzErrMsg = uintptr(0)
nErr++
}
(*Parse)(unsafe.Pointer(pParse)).FzTail = zSql
- if (((*Parse)(unsafe.Pointer(pParse)).FpVdbe != 0) && ((*Parse)(unsafe.Pointer(pParse)).FnErr > 0)) && (int32((*Parse)(unsafe.Pointer(pParse)).Fnested) == 0) {
+ if (*Parse)(unsafe.Pointer(pParse)).FpVdbe != 0 && (*Parse)(unsafe.Pointer(pParse)).FnErr > 0 && int32((*Parse)(unsafe.Pointer(pParse)).Fnested) == 0 {
Xsqlite3VdbeDelete(tls, (*Parse)(unsafe.Pointer(pParse)).FpVdbe)
(*Parse)(unsafe.Pointer(pParse)).FpVdbe = uintptr(0)
}
@@ -144796,8 +146911,7 @@ func Xsqlite3RunParser(tls *libc.TLS, pParse uintptr, zSql uintptr, pzErrMsg uin
Xsqlite3DeleteTrigger(tls, db, (*Parse)(unsafe.Pointer(pParse)).FpNewTrigger)
}
Xsqlite3DbFree(tls, db, (*Parse)(unsafe.Pointer(pParse)).FpVList)
- (*Sqlite3)(unsafe.Pointer(db)).FpParse = (*Parse)(unsafe.Pointer(pParse)).FpParentParse
- (*Parse)(unsafe.Pointer(pParse)).FpParentParse = uintptr(0)
+ (*Sqlite3)(unsafe.Pointer(db)).FpParse = pParentParse
return nErr
}
@@ -144878,7 +146992,7 @@ func Xsqlite3RunParser(tls *libc.TLS, pParse uintptr, zSql uintptr, pzErrMsg uin
// If we compile with SQLITE_OMIT_TRIGGER, all of the computation needed
// to recognize the end of a trigger can be omitted. All we have to do
// is look for a semicolon that is not part of an string or comment.
-func Xsqlite3_complete(tls *libc.TLS, zSql uintptr) int32 { /* sqlite3.c:164796:16: */
+func Xsqlite3_complete(tls *libc.TLS, zSql uintptr) int32 { /* sqlite3.c:166271:16: */
var state U8 = U8(0) // Current state, using numbers defined in header comment
var token U8
@@ -144911,7 +147025,7 @@ func Xsqlite3_complete(tls *libc.TLS, zSql uintptr) int32 { /* sqlite3.c:164796:
break
}
zSql += uintptr(2)
- for (*(*uint8)(unsafe.Pointer(zSql)) != 0) && ((int32(*(*uint8)(unsafe.Pointer(zSql))) != '*') || (int32(*(*uint8)(unsafe.Pointer(zSql + 1))) != '/')) {
+ for *(*uint8)(unsafe.Pointer(zSql)) != 0 && (int32(*(*uint8)(unsafe.Pointer(zSql))) != '*' || int32(*(*uint8)(unsafe.Pointer(zSql + 1))) != '/') {
zSql++
}
if int32(*(*uint8)(unsafe.Pointer(zSql))) == 0 {
@@ -144928,11 +147042,11 @@ func Xsqlite3_complete(tls *libc.TLS, zSql uintptr) int32 { /* sqlite3.c:164796:
token = U8(TkOTHER)
break
}
- for (*(*uint8)(unsafe.Pointer(zSql)) != 0) && (int32(*(*uint8)(unsafe.Pointer(zSql))) != '\n') {
+ for *(*uint8)(unsafe.Pointer(zSql)) != 0 && int32(*(*uint8)(unsafe.Pointer(zSql))) != '\n' {
zSql++
}
if int32(*(*uint8)(unsafe.Pointer(zSql))) == 0 {
- return (libc.Bool32(int32(state) == 1))
+ return libc.Bool32(int32(state) == 1)
}
token = U8(TkWS)
break
@@ -144941,7 +147055,7 @@ func Xsqlite3_complete(tls *libc.TLS, zSql uintptr) int32 { /* sqlite3.c:164796:
case '[':
{ // Microsoft-style identifiers in [...]
zSql++
- for (*(*uint8)(unsafe.Pointer(zSql)) != 0) && (int32(*(*uint8)(unsafe.Pointer(zSql))) != ']') {
+ for *(*uint8)(unsafe.Pointer(zSql)) != 0 && int32(*(*uint8)(unsafe.Pointer(zSql))) != ']' {
zSql++
}
if int32(*(*uint8)(unsafe.Pointer(zSql))) == 0 {
@@ -144959,7 +147073,7 @@ func Xsqlite3_complete(tls *libc.TLS, zSql uintptr) int32 { /* sqlite3.c:164796:
{
var c int32 = int32(*(*uint8)(unsafe.Pointer(zSql)))
zSql++
- for (*(*uint8)(unsafe.Pointer(zSql)) != 0) && (int32(*(*uint8)(unsafe.Pointer(zSql))) != c) {
+ for *(*uint8)(unsafe.Pointer(zSql)) != 0 && int32(*(*uint8)(unsafe.Pointer(zSql))) != c {
zSql++
}
if int32(*(*uint8)(unsafe.Pointer(zSql))) == 0 {
@@ -144971,17 +147085,17 @@ func Xsqlite3_complete(tls *libc.TLS, zSql uintptr) int32 { /* sqlite3.c:164796:
}
default:
{
- if (int32(Xsqlite3CtypeMap[U8(*(*uint8)(unsafe.Pointer(zSql)))]) & 0x46) != 0 {
+ if int32(Xsqlite3CtypeMap[U8(*(*uint8)(unsafe.Pointer(zSql)))])&0x46 != 0 {
// Keywords and unquoted identifiers
var nId int32
- for nId = 1; (int32(Xsqlite3CtypeMap[uint8(*(*uint8)(unsafe.Pointer(zSql + uintptr(nId))))]) & 0x46) != 0; nId++ {
+ for nId = 1; int32(Xsqlite3CtypeMap[uint8(*(*uint8)(unsafe.Pointer(zSql + uintptr(nId))))])&0x46 != 0; nId++ {
}
switch int32(*(*uint8)(unsafe.Pointer(zSql))) {
case 'c':
fallthrough
case 'C':
{
- if (nId == 6) && (Xsqlite3_strnicmp(tls, zSql, ts+21618 /* "create" */, 6) == 0) {
+ if nId == 6 && Xsqlite3_strnicmp(tls, zSql, ts+22915, 6) == 0 {
token = U8(TkCREATE)
} else {
token = U8(TkOTHER)
@@ -144994,11 +147108,11 @@ func Xsqlite3_complete(tls *libc.TLS, zSql uintptr) int32 { /* sqlite3.c:164796:
fallthrough
case 'T':
{
- if (nId == 7) && (Xsqlite3_strnicmp(tls, zSql, ts+18331 /* "trigger" */, 7) == 0) {
+ if nId == 7 && Xsqlite3_strnicmp(tls, zSql, ts+19628, 7) == 0 {
token = U8(TkTRIGGER)
- } else if (nId == 4) && (Xsqlite3_strnicmp(tls, zSql, ts+21625 /* "temp" */, 4) == 0) {
+ } else if nId == 4 && Xsqlite3_strnicmp(tls, zSql, ts+22922, 4) == 0 {
token = U8(TkTEMP)
- } else if (nId == 9) && (Xsqlite3_strnicmp(tls, zSql, ts+21630 /* "temporary" */, 9) == 0) {
+ } else if nId == 9 && Xsqlite3_strnicmp(tls, zSql, ts+22927, 9) == 0 {
token = U8(TkTEMP)
} else {
token = U8(TkOTHER)
@@ -145011,9 +147125,9 @@ func Xsqlite3_complete(tls *libc.TLS, zSql uintptr) int32 { /* sqlite3.c:164796:
fallthrough
case 'E':
{
- if (nId == 3) && (Xsqlite3_strnicmp(tls, zSql, ts+21640 /* "end" */, 3) == 0) {
+ if nId == 3 && Xsqlite3_strnicmp(tls, zSql, ts+22937, 3) == 0 {
token = U8(TkEND)
- } else if (nId == 7) && (Xsqlite3_strnicmp(tls, zSql, ts+21644 /* "explain" */, 7) == 0) {
+ } else if nId == 7 && Xsqlite3_strnicmp(tls, zSql, ts+22941, 7) == 0 {
token = U8(TkEXPLAIN)
} else {
token = U8(TkOTHER)
@@ -145029,7 +147143,7 @@ func Xsqlite3_complete(tls *libc.TLS, zSql uintptr) int32 { /* sqlite3.c:164796:
}
}
- zSql += (uintptr(nId - 1))
+ zSql += uintptr(nId - 1)
} else {
// Operators and special symbols
token = U8(TkOTHER)
@@ -145038,10 +147152,10 @@ func Xsqlite3_complete(tls *libc.TLS, zSql uintptr) int32 { /* sqlite3.c:164796:
}
}
- state = *(*U8)(unsafe.Pointer((uintptr(unsafe.Pointer(&trans)) + uintptr(state)*8) + uintptr(token)))
+ state = *(*U8)(unsafe.Pointer(uintptr(unsafe.Pointer(&trans)) + uintptr(state)*8 + uintptr(token)))
zSql++
}
- return (libc.Bool32(int32(state) == 1))
+ return libc.Bool32(int32(state) == 1)
}
var trans = [8][8]U8{
@@ -145055,12 +147169,12 @@ var trans = [8][8]U8{
/* 5 TRIGGER: */ {U8(6), U8(5), U8(5), U8(5), U8(5), U8(5), U8(5), U8(5)},
/* 6 SEMI: */ {U8(6), U8(6), U8(5), U8(5), U8(5), U8(5), U8(5), U8(7)},
/* 7 END: */ {U8(1), U8(7), U8(5), U8(5), U8(5), U8(5), U8(5), U8(5)},
-} /* sqlite3.c:164804:19 */
+} /* sqlite3.c:166279:19 */
// This routine is the same as the sqlite3_complete() routine described
// above, except that the parameter is required to be UTF-16 encoded, not
// UTF-8.
-func Xsqlite3_complete16(tls *libc.TLS, zSql uintptr) int32 { /* sqlite3.c:164961:16: */
+func Xsqlite3_complete16(tls *libc.TLS, zSql uintptr) int32 { /* sqlite3.c:166436:16: */
var pVal uintptr
var zSql8 uintptr
var rc int32
@@ -145078,7 +147192,7 @@ func Xsqlite3_complete16(tls *libc.TLS, zSql uintptr) int32 { /* sqlite3.c:16496
rc = SQLITE_NOMEM
}
Xsqlite3ValueFree(tls, pVal)
- return (rc & 0xff)
+ return rc & 0xff
}
//************* End of rtree.h **********************************************
@@ -145087,7 +147201,7 @@ func Xsqlite3_complete16(tls *libc.TLS, zSql uintptr) int32 { /* sqlite3.c:16496
// This is an extension initializer that is a no-op and always
// succeeds, except that it fails if the fault-simulation is set
// to 500.
-func sqlite3TestExtInit(tls *libc.TLS, db uintptr) int32 { /* sqlite3.c:165113:12: */
+func sqlite3TestExtInit(tls *libc.TLS, db uintptr) int32 { /* sqlite3.c:166588:12: */
_ = db
return Xsqlite3FaultSim(tls, 500)
}
@@ -145099,11 +147213,11 @@ var sqlite3BuiltinExtensions = [4]uintptr{
0,
0,
0,
-} /* sqlite3.c:165143:12 */
+} /* sqlite3.c:166618:12 */
// IMPLEMENTATION-OF: R-53536-42575 The sqlite3_libversion() function returns
// a pointer to the to the sqlite3_version[] string constant.
-func Xsqlite3_libversion(tls *libc.TLS) uintptr { /* sqlite3.c:165190:23: */
+func Xsqlite3_libversion(tls *libc.TLS) uintptr { /* sqlite3.c:166665:23: */
return uintptr(unsafe.Pointer(&Xsqlite3_version))
}
@@ -145116,14 +147230,14 @@ func Xsqlite3_libversion(tls *libc.TLS) uintptr { /* sqlite3.c:165190:23: */
// IMPLEMENTATION-OF: R-35210-63508 The sqlite3_libversion_number() function
// returns an integer equal to SQLITE_VERSION_NUMBER.
-func Xsqlite3_libversion_number(tls *libc.TLS) int32 { /* sqlite3.c:165203:16: */
+func Xsqlite3_libversion_number(tls *libc.TLS) int32 { /* sqlite3.c:166678:16: */
return SQLITE_VERSION_NUMBER
}
// IMPLEMENTATION-OF: R-20790-14025 The sqlite3_threadsafe() function returns
// zero if and only if SQLite was compiled with mutexing code omitted due to
// the SQLITE_THREADSAFE compile-time option being set to 0.
-func Xsqlite3_threadsafe(tls *libc.TLS) int32 { /* sqlite3.c:165209:16: */
+func Xsqlite3_threadsafe(tls *libc.TLS) int32 { /* sqlite3.c:166684:16: */
return SQLITE_THREADSAFE
}
@@ -145136,14 +147250,14 @@ func Xsqlite3_threadsafe(tls *libc.TLS) int32 { /* sqlite3.c:165209:16: */
// temporary files.
//
// See also the "PRAGMA temp_store_directory" SQL command.
-var Xsqlite3_temp_directory uintptr = uintptr(0) /* sqlite3.c:165240:17 */
+var Xsqlite3_temp_directory uintptr = uintptr(0) /* sqlite3.c:166715:17 */
// If the following global variable points to a string which is the
// name of a directory, then that directory will be used to store
// all database files specified with a relative pathname.
//
// See also the "PRAGMA data_store_directory" SQL command.
-var Xsqlite3_data_directory uintptr = uintptr(0) /* sqlite3.c:165249:17 */
+var Xsqlite3_data_directory uintptr = uintptr(0) /* sqlite3.c:166724:17 */
// Initialize SQLite.
//
@@ -145174,7 +147288,7 @@ var Xsqlite3_data_directory uintptr = uintptr(0) /* sqlite3.c:165249:17 */
//
// * Recursive calls to this routine from thread X return immediately
// without blocking.
-func Xsqlite3_initialize(tls *libc.TLS) int32 { /* sqlite3.c:165282:16: */
+func Xsqlite3_initialize(tls *libc.TLS) int32 { /* sqlite3.c:166757:16: */
var pMainMtx uintptr // The main static mutex
var rc int32 // Result code
@@ -145218,7 +147332,7 @@ func Xsqlite3_initialize(tls *libc.TLS) int32 { /* sqlite3.c:165282:16: */
Xsqlite3Config.FisMallocInit = 1
if !(int32(Xsqlite3Config.FpInitMutex) != 0) {
Xsqlite3Config.FpInitMutex = Xsqlite3MutexAlloc(tls, SQLITE_MUTEX_RECURSIVE)
- if (Xsqlite3Config.FbCoreMutex != 0) && !(int32(Xsqlite3Config.FpInitMutex) != 0) {
+ if Xsqlite3Config.FbCoreMutex != 0 && !(int32(Xsqlite3Config.FpInitMutex) != 0) {
rc = SQLITE_NOMEM
}
}
@@ -145248,7 +147362,7 @@ func Xsqlite3_initialize(tls *libc.TLS) int32 { /* sqlite3.c:165282:16: */
// methods. The sqlite3_pcache_methods.xInit() all is embedded in the
// call to sqlite3PcacheInitialize().
Xsqlite3_mutex_enter(tls, Xsqlite3Config.FpInitMutex)
- if (Xsqlite3Config.FisInit == 0) && (Xsqlite3Config.FinProgress == 0) {
+ if Xsqlite3Config.FisInit == 0 && Xsqlite3Config.FinProgress == 0 {
Xsqlite3Config.FinProgress = 1
libc.Xmemset(tls, uintptr(unsafe.Pointer(&Xsqlite3BuiltinFunctions)), 0, uint32(unsafe.Sizeof(Xsqlite3BuiltinFunctions)))
Xsqlite3RegisterBuiltinFunctions(tls)
@@ -145300,7 +147414,7 @@ func Xsqlite3_initialize(tls *libc.TLS) int32 { /* sqlite3.c:165282:16: */
// routine is not threadsafe. But it is safe to invoke this routine
// on when SQLite is already shut down. If SQLite is already shut down
// when this routine is invoked, then this routine is a harmless no-op.
-func Xsqlite3_shutdown(tls *libc.TLS) int32 { /* sqlite3.c:165457:16: */
+func Xsqlite3_shutdown(tls *libc.TLS) int32 { /* sqlite3.c:166932:16: */
if Xsqlite3Config.FisInit != 0 {
Xsqlite3_os_end(tls)
@@ -145339,7 +147453,7 @@ func Xsqlite3_shutdown(tls *libc.TLS) int32 { /* sqlite3.c:165457:16: */
// database connections or memory allocations. This routine is not
// threadsafe. Failure to heed these warnings can lead to unpredictable
// behavior.
-func Xsqlite3_config(tls *libc.TLS, op int32, va uintptr) int32 { /* sqlite3.c:165511:16: */
+func Xsqlite3_config(tls *libc.TLS, op int32, va uintptr) int32 { /* sqlite3.c:166986:16: */
var ap Va_list
_ = ap
var rc int32 = SQLITE_OK
@@ -145347,7 +147461,7 @@ func Xsqlite3_config(tls *libc.TLS, op int32, va uintptr) int32 { /* sqlite3.c:1
// sqlite3_config() shall return SQLITE_MISUSE if it is invoked while
// the SQLite library is in use.
if Xsqlite3Config.FisInit != 0 {
- return Xsqlite3MisuseError(tls, 165517)
+ return Xsqlite3MisuseError(tls, 166992)
}
ap = va
@@ -145454,7 +147568,7 @@ func Xsqlite3_config(tls *libc.TLS, op int32, va uintptr) int32 { /* sqlite3.c:1
// a single parameter which is a pointer to an integer and writes into
// that integer the number of extra bytes per page required for each page
// in SQLITE_CONFIG_PAGECACHE.
- *(*int32)(unsafe.Pointer(libc.VaUintptr(&ap))) = ((Xsqlite3HeaderSizeBtree(tls) + Xsqlite3HeaderSizePcache(tls)) + Xsqlite3HeaderSizePcache1(tls))
+ *(*int32)(unsafe.Pointer(libc.VaUintptr(&ap))) = Xsqlite3HeaderSizeBtree(tls) + Xsqlite3HeaderSizePcache(tls) + Xsqlite3HeaderSizePcache1(tls)
break
}
@@ -145561,7 +147675,7 @@ func Xsqlite3_config(tls *libc.TLS, op int32, va uintptr) int32 { /* sqlite3.c:1
// silently truncated if necessary so that it does not exceed the
// compile-time maximum mmap size set by the SQLITE_MAX_MMAP_SIZE
// compile-time option.
- if (mxMmap < int64(0)) || (mxMmap > int64(SQLITE_MAX_MMAP_SIZE)) {
+ if mxMmap < int64(0) || mxMmap > int64(SQLITE_MAX_MMAP_SIZE) {
mxMmap = int64(SQLITE_MAX_MMAP_SIZE)
}
if szMmap < int64(0) {
@@ -145617,9 +147731,9 @@ func Xsqlite3_config(tls *libc.TLS, op int32, va uintptr) int32 { /* sqlite3.c:1
// space for the lookaside memory is obtained from sqlite3_malloc().
// If pStart is not NULL then it is sz*cnt bytes of memory to use for
// the lookaside memory.
-func setupLookaside(tls *libc.TLS, db uintptr, pBuf uintptr, sz int32, cnt int32) int32 { /* sqlite3.c:165829:12: */
+func setupLookaside(tls *libc.TLS, db uintptr, pBuf uintptr, sz int32, cnt int32) int32 { /* sqlite3.c:167304:12: */
var pStart uintptr
- var szAlloc Sqlite3_int64 = (Sqlite3_int64(sz) * Sqlite3_int64(cnt))
+ var szAlloc Sqlite3_int64 = Sqlite3_int64(sz) * Sqlite3_int64(cnt)
var nBig int32 // Number of full-size slots
var nSm int32 // Number smaller LOOKASIDE_SMALL-byte slots
@@ -145634,14 +147748,14 @@ func setupLookaside(tls *libc.TLS, db uintptr, pBuf uintptr, sz int32, cnt int32
}
// The size of a lookaside slot after ROUNDDOWN8 needs to be larger
// than a pointer to be useful.
- sz = ((sz) & libc.CplInt32(7)) // IMP: R-33038-09382
+ sz = sz & libc.CplInt32(7) // IMP: R-33038-09382
if sz <= int32(unsafe.Sizeof(uintptr(0))) {
sz = 0
}
if cnt < 0 {
cnt = 0
}
- if (sz == 0) || (cnt == 0) {
+ if sz == 0 || cnt == 0 {
sz = 0
pStart = uintptr(0)
} else if pBuf == uintptr(0) {
@@ -145654,14 +147768,14 @@ func setupLookaside(tls *libc.TLS, db uintptr, pBuf uintptr, sz int32, cnt int32
} else {
pStart = pBuf
}
- if sz >= (LOOKASIDE_SMALL * 3) {
- nBig = (int32(szAlloc / (Sqlite3_int64((3 * LOOKASIDE_SMALL) + sz))))
- nSm = (int32((szAlloc - (Sqlite3_int64(sz * nBig))) / int64(LOOKASIDE_SMALL)))
- } else if sz >= (LOOKASIDE_SMALL * 2) {
- nBig = (int32(szAlloc / (Sqlite3_int64(LOOKASIDE_SMALL + sz))))
- nSm = (int32((szAlloc - (Sqlite3_int64(sz * nBig))) / int64(LOOKASIDE_SMALL)))
+ if sz >= LOOKASIDE_SMALL*3 {
+ nBig = int32(szAlloc / Sqlite3_int64(3*LOOKASIDE_SMALL+sz))
+ nSm = int32((szAlloc - Sqlite3_int64(sz*nBig)) / int64(LOOKASIDE_SMALL))
+ } else if sz >= LOOKASIDE_SMALL*2 {
+ nBig = int32(szAlloc / Sqlite3_int64(LOOKASIDE_SMALL+sz))
+ nSm = int32((szAlloc - Sqlite3_int64(sz*nBig)) / int64(LOOKASIDE_SMALL))
} else if sz > 0 {
- nBig = (int32(szAlloc / Sqlite3_int64(sz)))
+ nBig = int32(szAlloc / Sqlite3_int64(sz))
nSm = 0
} else {
nBig = libc.AssignInt32(&nSm, 0)
@@ -145679,7 +147793,7 @@ func setupLookaside(tls *libc.TLS, db uintptr, pBuf uintptr, sz int32, cnt int32
for i = 0; i < nBig; i++ {
(*LookasideSlot)(unsafe.Pointer(p)).FpNext = (*Sqlite3)(unsafe.Pointer(db)).Flookaside.FpInit
(*Sqlite3)(unsafe.Pointer(db)).Flookaside.FpInit = p
- p = ((p) + uintptr(sz))
+ p = p + uintptr(sz)
}
(*Sqlite3)(unsafe.Pointer(db)).Flookaside.FpSmallInit = uintptr(0)
(*Sqlite3)(unsafe.Pointer(db)).Flookaside.FpSmallFree = uintptr(0)
@@ -145687,7 +147801,7 @@ func setupLookaside(tls *libc.TLS, db uintptr, pBuf uintptr, sz int32, cnt int32
for i = 0; i < nSm; i++ {
(*LookasideSlot)(unsafe.Pointer(p)).FpNext = (*Sqlite3)(unsafe.Pointer(db)).Flookaside.FpSmallInit
(*Sqlite3)(unsafe.Pointer(db)).Flookaside.FpSmallInit = p
- p = ((p) + 128)
+ p = p + 128
}
(*Sqlite3)(unsafe.Pointer(db)).Flookaside.FpEnd = p
@@ -145698,7 +147812,7 @@ func setupLookaside(tls *libc.TLS, db uintptr, pBuf uintptr, sz int32, cnt int32
}
return uint8(0)
}()
- (*Sqlite3)(unsafe.Pointer(db)).Flookaside.FnSlot = (U32(nBig + nSm))
+ (*Sqlite3)(unsafe.Pointer(db)).Flookaside.FnSlot = U32(nBig + nSm)
} else {
(*Sqlite3)(unsafe.Pointer(db)).Flookaside.FpStart = db
(*Sqlite3)(unsafe.Pointer(db)).Flookaside.FpSmallInit = uintptr(0)
@@ -145715,13 +147829,13 @@ func setupLookaside(tls *libc.TLS, db uintptr, pBuf uintptr, sz int32, cnt int32
}
// Return the mutex associated with a database connection.
-func Xsqlite3_db_mutex(tls *libc.TLS, db uintptr) uintptr { /* sqlite3.c:165929:26: */
+func Xsqlite3_db_mutex(tls *libc.TLS, db uintptr) uintptr { /* sqlite3.c:167404:26: */
return (*Sqlite3)(unsafe.Pointer(db)).Fmutex
}
// Free up as much memory as we can from the given database
// connection.
-func Xsqlite3_db_release_memory(tls *libc.TLS, db uintptr) int32 { /* sqlite3.c:165943:16: */
+func Xsqlite3_db_release_memory(tls *libc.TLS, db uintptr) int32 { /* sqlite3.c:167418:16: */
var i int32
Xsqlite3_mutex_enter(tls, (*Sqlite3)(unsafe.Pointer(db)).Fmutex)
@@ -145740,16 +147854,16 @@ func Xsqlite3_db_release_memory(tls *libc.TLS, db uintptr) int32 { /* sqlite3.c:
// Flush any dirty pages in the pager-cache for any attached database
// to disk.
-func Xsqlite3_db_cacheflush(tls *libc.TLS, db uintptr) int32 { /* sqlite3.c:165967:16: */
+func Xsqlite3_db_cacheflush(tls *libc.TLS, db uintptr) int32 { /* sqlite3.c:167442:16: */
var i int32
var rc int32 = SQLITE_OK
var bSeenBusy int32 = 0
Xsqlite3_mutex_enter(tls, (*Sqlite3)(unsafe.Pointer(db)).Fmutex)
Xsqlite3BtreeEnterAll(tls, db)
- for i = 0; (rc == SQLITE_OK) && (i < (*Sqlite3)(unsafe.Pointer(db)).FnDb); i++ {
+ for i = 0; rc == SQLITE_OK && i < (*Sqlite3)(unsafe.Pointer(db)).FnDb; i++ {
var pBt uintptr = (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb + uintptr(i)*16)).FpBt
- if (pBt != 0) && (Xsqlite3BtreeTxnState(tls, pBt) == SQLITE_TXN_WRITE) {
+ if pBt != 0 && Xsqlite3BtreeTxnState(tls, pBt) == SQLITE_TXN_WRITE {
var pPager uintptr = Xsqlite3BtreePager(tls, pBt)
rc = Xsqlite3PagerFlush(tls, pPager)
if rc == SQLITE_BUSY {
@@ -145761,7 +147875,7 @@ func Xsqlite3_db_cacheflush(tls *libc.TLS, db uintptr) int32 { /* sqlite3.c:1659
Xsqlite3BtreeLeaveAll(tls, db)
Xsqlite3_mutex_leave(tls, (*Sqlite3)(unsafe.Pointer(db)).Fmutex)
return func() int32 {
- if (rc == SQLITE_OK) && (bSeenBusy != 0) {
+ if rc == SQLITE_OK && bSeenBusy != 0 {
return SQLITE_BUSY
}
return rc
@@ -145769,7 +147883,7 @@ func Xsqlite3_db_cacheflush(tls *libc.TLS, db uintptr) int32 { /* sqlite3.c:1659
}
// Configuration settings for an individual database connection
-func Xsqlite3_db_config(tls *libc.TLS, db uintptr, op int32, va uintptr) int32 { /* sqlite3.c:165996:16: */
+func Xsqlite3_db_config(tls *libc.TLS, db uintptr, op int32, va uintptr) int32 { /* sqlite3.c:167471:16: */
var ap Va_list
_ = ap
var rc int32
@@ -145797,24 +147911,24 @@ func Xsqlite3_db_config(tls *libc.TLS, db uintptr, op int32, va uintptr) int32 {
{
var i uint32
rc = SQLITE_ERROR // IMP: R-42790-23372
- for i = uint32(0); i < (uint32((int32(uint32(unsafe.Sizeof(aFlagOp)) / uint32(unsafe.Sizeof(struct {
+ for i = uint32(0); i < uint32(int32(uint32(unsafe.Sizeof(aFlagOp))/uint32(unsafe.Sizeof(struct {
Fop int32
Fmask U32
- }{})))))); i++ {
+ }{})))); i++ {
if aFlagOp[i].Fop == op {
var onoff int32 = int32(libc.VaInt32(&ap))
var pRes uintptr = libc.VaUintptr(&ap)
var oldFlags U64 = (*Sqlite3)(unsafe.Pointer(db)).Fflags
if onoff > 0 {
- *(*U64)(unsafe.Pointer(db + 32 /* &.flags */)) |= (U64(aFlagOp[i].Fmask))
+ *(*U64)(unsafe.Pointer(db + 32)) |= U64(aFlagOp[i].Fmask)
} else if onoff == 0 {
- *(*U64)(unsafe.Pointer(db + 32 /* &.flags */)) &= (^U64(aFlagOp[i].Fmask))
+ *(*U64)(unsafe.Pointer(db + 32)) &= ^U64(aFlagOp[i].Fmask)
}
if oldFlags != (*Sqlite3)(unsafe.Pointer(db)).Fflags {
Xsqlite3ExpirePreparedStatements(tls, db, 0)
}
if pRes != 0 {
- *(*int32)(unsafe.Pointer(pRes)) = (libc.Bool32(((*Sqlite3)(unsafe.Pointer(db)).Fflags & U64(aFlagOp[i].Fmask)) != uint64(0)))
+ *(*int32)(unsafe.Pointer(pRes)) = libc.Bool32((*Sqlite3)(unsafe.Pointer(db)).Fflags&U64(aFlagOp[i].Fmask) != uint64(0))
}
rc = SQLITE_OK
break
@@ -145842,17 +147956,17 @@ var aFlagOp = [16]struct {
{Fop: SQLITE_DBCONFIG_TRIGGER_EQP, Fmask: U32(SQLITE_TriggerEQP)},
{Fop: SQLITE_DBCONFIG_RESET_DATABASE, Fmask: U32(SQLITE_ResetDatabase)},
{Fop: SQLITE_DBCONFIG_DEFENSIVE, Fmask: U32(SQLITE_Defensive)},
- {Fop: SQLITE_DBCONFIG_WRITABLE_SCHEMA, Fmask: (U32(SQLITE_WriteSchema | SQLITE_NoSchemaError))},
+ {Fop: SQLITE_DBCONFIG_WRITABLE_SCHEMA, Fmask: U32(SQLITE_WriteSchema | SQLITE_NoSchemaError)},
{Fop: SQLITE_DBCONFIG_LEGACY_ALTER_TABLE, Fmask: U32(SQLITE_LegacyAlter)},
{Fop: SQLITE_DBCONFIG_DQS_DDL, Fmask: U32(SQLITE_DqsDDL)},
{Fop: SQLITE_DBCONFIG_DQS_DML, Fmask: U32(SQLITE_DqsDML)},
{Fop: SQLITE_DBCONFIG_LEGACY_FILE_FORMAT, Fmask: U32(SQLITE_LegacyFileFmt)},
{Fop: SQLITE_DBCONFIG_TRUSTED_SCHEMA, Fmask: U32(SQLITE_TrustedSchema)},
-} /* sqlite3.c:166019:9 */
+} /* sqlite3.c:167494:9 */
// This is the default collating function named "BINARY" which is always
// available.
-func binCollFunc(tls *libc.TLS, NotUsed uintptr, nKey1 int32, pKey1 uintptr, nKey2 int32, pKey2 uintptr) int32 { /* sqlite3.c:166071:12: */
+func binCollFunc(tls *libc.TLS, NotUsed uintptr, nKey1 int32, pKey1 uintptr, nKey2 int32, pKey2 uintptr) int32 { /* sqlite3.c:167546:12: */
var rc int32
var n int32
_ = NotUsed
@@ -145867,31 +147981,31 @@ func binCollFunc(tls *libc.TLS, NotUsed uintptr, nKey1 int32, pKey1 uintptr, nKe
rc = libc.Xmemcmp(tls, pKey1, pKey2, uint32(n))
if rc == 0 {
- rc = (nKey1 - nKey2)
+ rc = nKey1 - nKey2
}
return rc
}
// This is the collating function named "RTRIM" which is always
// available. Ignore trailing spaces.
-func rtrimCollFunc(tls *libc.TLS, pUser uintptr, nKey1 int32, pKey1 uintptr, nKey2 int32, pKey2 uintptr) int32 { /* sqlite3.c:166094:12: */
+func rtrimCollFunc(tls *libc.TLS, pUser uintptr, nKey1 int32, pKey1 uintptr, nKey2 int32, pKey2 uintptr) int32 { /* sqlite3.c:167569:12: */
var pK1 uintptr = pKey1
var pK2 uintptr = pKey2
- for (nKey1 != 0) && (int32(*(*U8)(unsafe.Pointer(pK1 + uintptr((nKey1 - 1))))) == ' ') {
+ for nKey1 != 0 && int32(*(*U8)(unsafe.Pointer(pK1 + uintptr(nKey1-1)))) == ' ' {
nKey1--
}
- for (nKey2 != 0) && (int32(*(*U8)(unsafe.Pointer(pK2 + uintptr((nKey2 - 1))))) == ' ') {
+ for nKey2 != 0 && int32(*(*U8)(unsafe.Pointer(pK2 + uintptr(nKey2-1)))) == ' ' {
nKey2--
}
return binCollFunc(tls, pUser, nKey1, pKey1, nKey2, pKey2)
}
// Return true if CollSeq is the default built-in BINARY.
-func Xsqlite3IsBinary(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:166109:20: */
+func Xsqlite3IsBinary(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:167584:20: */
- return (libc.Bool32((p == uintptr(0)) || ((*CollSeq)(unsafe.Pointer(p)).FxCmp == *(*uintptr)(unsafe.Pointer(&struct {
+ return libc.Bool32(p == uintptr(0) || (*CollSeq)(unsafe.Pointer(p)).FxCmp == *(*uintptr)(unsafe.Pointer(&struct {
f func(*libc.TLS, uintptr, int32, uintptr, int32, uintptr) int32
- }{binCollFunc})))))
+ }{binCollFunc})))
}
// Another built-in collating sequence: NOCASE.
@@ -145901,7 +148015,7 @@ func Xsqlite3IsBinary(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:166109:20:
// extends only to the 26 characters used in the English language.
//
// At the moment there is only a UTF-8 implementation.
-func nocaseCollatingFunc(tls *libc.TLS, NotUsed uintptr, nKey1 int32, pKey1 uintptr, nKey2 int32, pKey2 uintptr) int32 { /* sqlite3.c:166123:12: */
+func nocaseCollatingFunc(tls *libc.TLS, NotUsed uintptr, nKey1 int32, pKey1 uintptr, nKey2 int32, pKey2 uintptr) int32 { /* sqlite3.c:167598:12: */
var r int32 = Xsqlite3_strnicmp(tls,
pKey1, pKey2, func() int32 {
if nKey1 < nKey2 {
@@ -145911,37 +148025,45 @@ func nocaseCollatingFunc(tls *libc.TLS, NotUsed uintptr, nKey1 int32, pKey1 uint
}())
_ = NotUsed
if 0 == r {
- r = (nKey1 - nKey2)
+ r = nKey1 - nKey2
}
return r
}
// Return the ROWID of the most recent insert
-func Xsqlite3_last_insert_rowid(tls *libc.TLS, db uintptr) Sqlite_int64 { /* sqlite3.c:166140:25: */
+func Xsqlite3_last_insert_rowid(tls *libc.TLS, db uintptr) Sqlite_int64 { /* sqlite3.c:167615:25: */
return (*Sqlite3)(unsafe.Pointer(db)).FlastRowid
}
// Set the value returned by the sqlite3_last_insert_rowid() API function.
-func Xsqlite3_set_last_insert_rowid(tls *libc.TLS, db uintptr, iRowid Sqlite3_int64) { /* sqlite3.c:166153:17: */
+func Xsqlite3_set_last_insert_rowid(tls *libc.TLS, db uintptr, iRowid Sqlite3_int64) { /* sqlite3.c:167628:17: */
Xsqlite3_mutex_enter(tls, (*Sqlite3)(unsafe.Pointer(db)).Fmutex)
(*Sqlite3)(unsafe.Pointer(db)).FlastRowid = iRowid
Xsqlite3_mutex_leave(tls, (*Sqlite3)(unsafe.Pointer(db)).Fmutex)
}
// Return the number of changes in the most recent call to sqlite3_exec().
-func Xsqlite3_changes(tls *libc.TLS, db uintptr) int32 { /* sqlite3.c:166168:16: */
+func Xsqlite3_changes64(tls *libc.TLS, db uintptr) Sqlite3_int64 { /* sqlite3.c:167643:26: */
return (*Sqlite3)(unsafe.Pointer(db)).FnChange
}
+func Xsqlite3_changes(tls *libc.TLS, db uintptr) int32 { /* sqlite3.c:167652:16: */
+ return int32(Xsqlite3_changes64(tls, db))
+}
+
// Return the number of changes since the database handle was opened.
-func Xsqlite3_total_changes(tls *libc.TLS, db uintptr) int32 { /* sqlite3.c:166181:16: */
+func Xsqlite3_total_changes64(tls *libc.TLS, db uintptr) Sqlite3_int64 { /* sqlite3.c:167659:26: */
return (*Sqlite3)(unsafe.Pointer(db)).FnTotalChange
}
+func Xsqlite3_total_changes(tls *libc.TLS, db uintptr) int32 { /* sqlite3.c:167668:16: */
+ return int32(Xsqlite3_total_changes64(tls, db))
+}
+
// Close all open savepoints. This function only manipulates fields of the
// database handle object, it does not close any savepoints that may be open
// at the b-tree/pager level.
-func Xsqlite3CloseSavepoints(tls *libc.TLS, db uintptr) { /* sqlite3.c:166196:21: */
+func Xsqlite3CloseSavepoints(tls *libc.TLS, db uintptr) { /* sqlite3.c:167677:21: */
for (*Sqlite3)(unsafe.Pointer(db)).FpSavepoint != 0 {
var pTmp uintptr = (*Sqlite3)(unsafe.Pointer(db)).FpSavepoint
(*Sqlite3)(unsafe.Pointer(db)).FpSavepoint = (*Savepoint)(unsafe.Pointer(pTmp)).FpNext
@@ -145956,8 +148078,10 @@ func Xsqlite3CloseSavepoints(tls *libc.TLS, db uintptr) { /* sqlite3.c:166196:21
// if this is not the last copy of the function, do not invoke it. Multiple
// copies of a single function are created when create_function() is called
// with SQLITE_ANY as the encoding.
-func functionDestroy(tls *libc.TLS, db uintptr, p uintptr) { /* sqlite3.c:166213:13: */
- var pDestructor uintptr = *(*uintptr)(unsafe.Pointer(p + 36 /* &.u */))
+func functionDestroy(tls *libc.TLS, db uintptr, p uintptr) { /* sqlite3.c:167694:13: */
+ var pDestructor uintptr
+
+ pDestructor = *(*uintptr)(unsafe.Pointer(p + 36))
if pDestructor != 0 {
(*FuncDestructor)(unsafe.Pointer(pDestructor)).FnRef--
if (*FuncDestructor)(unsafe.Pointer(pDestructor)).FnRef == 0 {
@@ -145969,22 +148093,22 @@ func functionDestroy(tls *libc.TLS, db uintptr, p uintptr) { /* sqlite3.c:166213
// Disconnect all sqlite3_vtab objects that belong to database connection
// db. This is called when db is being closed.
-func disconnectAllVtab(tls *libc.TLS, db uintptr) { /* sqlite3.c:166228:13: */
+func disconnectAllVtab(tls *libc.TLS, db uintptr) { /* sqlite3.c:167711:13: */
var i int32
var p uintptr
Xsqlite3BtreeEnterAll(tls, db)
for i = 0; i < (*Sqlite3)(unsafe.Pointer(db)).FnDb; i++ {
var pSchema uintptr = (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb + uintptr(i)*16)).FpSchema
if pSchema != 0 {
- for p = (*Hash)(unsafe.Pointer((pSchema + 8 /* &.tblHash */))).Ffirst; p != 0; p = (*HashElem)(unsafe.Pointer(p)).Fnext {
+ for p = (*Hash)(unsafe.Pointer(pSchema + 8)).Ffirst; p != 0; p = (*HashElem)(unsafe.Pointer(p)).Fnext {
var pTab uintptr = (*HashElem)(unsafe.Pointer(p)).Fdata
- if (*Table)(unsafe.Pointer(pTab)).FnModuleArg != 0 {
+ if int32((*Table)(unsafe.Pointer(pTab)).FeTabType) == TABTYP_VTAB {
Xsqlite3VtabDisconnect(tls, db, pTab)
}
}
}
}
- for p = (*Hash)(unsafe.Pointer((db + 376 /* &.aModule */))).Ffirst; p != 0; p = (*HashElem)(unsafe.Pointer(p)).Fnext {
+ for p = (*Hash)(unsafe.Pointer(db + 400)).Ffirst; p != 0; p = (*HashElem)(unsafe.Pointer(p)).Fnext {
var pMod uintptr = (*HashElem)(unsafe.Pointer(p)).Fdata
if (*Module)(unsafe.Pointer(pMod)).FpEpoTab != 0 {
Xsqlite3VtabDisconnect(tls, db, (*Module)(unsafe.Pointer(pMod)).FpEpoTab)
@@ -145996,7 +148120,7 @@ func disconnectAllVtab(tls *libc.TLS, db uintptr) { /* sqlite3.c:166228:13: */
// Return TRUE if database connection db has unfinalized prepared
// statements or unfinished sqlite3_backup objects.
-func connectionIsBusy(tls *libc.TLS, db uintptr) int32 { /* sqlite3.c:166259:12: */
+func connectionIsBusy(tls *libc.TLS, db uintptr) int32 { /* sqlite3.c:167742:12: */
var j int32
if (*Sqlite3)(unsafe.Pointer(db)).FpVdbe != 0 {
@@ -146004,7 +148128,7 @@ func connectionIsBusy(tls *libc.TLS, db uintptr) int32 { /* sqlite3.c:166259:12:
}
for j = 0; j < (*Sqlite3)(unsafe.Pointer(db)).FnDb; j++ {
var pBt uintptr = (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb + uintptr(j)*16)).FpBt
- if (pBt != 0) && (Xsqlite3BtreeIsInBackup(tls, pBt) != 0) {
+ if pBt != 0 && Xsqlite3BtreeIsInBackup(tls, pBt) != 0 {
return 1
}
}
@@ -146012,20 +148136,20 @@ func connectionIsBusy(tls *libc.TLS, db uintptr) int32 { /* sqlite3.c:166259:12:
}
// Close an existing SQLite database
-func sqlite3Close(tls *libc.TLS, db uintptr, forceZombie int32) int32 { /* sqlite3.c:166273:12: */
+func sqlite3Close(tls *libc.TLS, db uintptr, forceZombie int32) int32 { /* sqlite3.c:167756:12: */
if !(db != 0) {
// EVIDENCE-OF: R-63257-11740 Calling sqlite3_close() or
// sqlite3_close_v2() with a NULL pointer argument is a harmless no-op.
return SQLITE_OK
}
if !(Xsqlite3SafetyCheckSickOrOk(tls, db) != 0) {
- return Xsqlite3MisuseError(tls, 166280)
+ return Xsqlite3MisuseError(tls, 167763)
}
Xsqlite3_mutex_enter(tls, (*Sqlite3)(unsafe.Pointer(db)).Fmutex)
- if (int32((*Sqlite3)(unsafe.Pointer(db)).FmTrace) & SQLITE_TRACE_CLOSE) != 0 {
+ if int32((*Sqlite3)(unsafe.Pointer(db)).FmTrace)&SQLITE_TRACE_CLOSE != 0 {
(*struct {
f func(*libc.TLS, U32, uintptr, uintptr, uintptr) int32
- })(unsafe.Pointer(&struct{ uintptr }{*(*uintptr)(unsafe.Pointer(db + 208 /* &.trace */))})).f(tls, uint32(SQLITE_TRACE_CLOSE), (*Sqlite3)(unsafe.Pointer(db)).FpTraceArg, db, uintptr(0))
+ })(unsafe.Pointer(&struct{ uintptr }{*(*uintptr)(unsafe.Pointer(db + 216 /* &.trace */))})).f(tls, uint32(SQLITE_TRACE_CLOSE), (*Sqlite3)(unsafe.Pointer(db)).FpTraceArg, db, uintptr(0))
}
// Force xDisconnect calls on all virtual tables
@@ -146041,22 +148165,22 @@ func sqlite3Close(tls *libc.TLS, db uintptr, forceZombie int32) int32 { /* sqlit
// Legacy behavior (sqlite3_close() behavior) is to return
// SQLITE_BUSY if the connection can not be closed immediately.
- if !(forceZombie != 0) && (connectionIsBusy(tls, db) != 0) {
+ if !(forceZombie != 0) && connectionIsBusy(tls, db) != 0 {
Xsqlite3ErrorWithMsg(tls, db, SQLITE_BUSY,
- ts+21652 /* "unable to close ..." */, 0)
+ ts+22949 /* "unable to close ..." */, 0)
Xsqlite3_mutex_leave(tls, (*Sqlite3)(unsafe.Pointer(db)).Fmutex)
return SQLITE_BUSY
}
// Convert the connection into a zombie and then close it.
- (*Sqlite3)(unsafe.Pointer(db)).Fmagic = U32(SQLITE_MAGIC_ZOMBIE)
+ (*Sqlite3)(unsafe.Pointer(db)).FeOpenState = U8(SQLITE_STATE_ZOMBIE)
Xsqlite3LeaveMutexAndCloseZombie(tls, db)
return SQLITE_OK
}
// Return the transaction state for a single databse, or the maximum
// transaction state over all attached databases if zSchema is null.
-func Xsqlite3_txn_state(tls *libc.TLS, db uintptr, zSchema uintptr) int32 { /* sqlite3.c:166327:16: */
+func Xsqlite3_txn_state(tls *libc.TLS, db uintptr, zSchema uintptr) int32 { /* sqlite3.c:167810:16: */
var iDb int32
var nDb int32
var iTxn int32 = -1
@@ -146068,7 +148192,7 @@ func Xsqlite3_txn_state(tls *libc.TLS, db uintptr, zSchema uintptr) int32 { /* s
}
} else {
iDb = 0
- nDb = ((*Sqlite3)(unsafe.Pointer(db)).FnDb - 1)
+ nDb = (*Sqlite3)(unsafe.Pointer(db)).FnDb - 1
}
for ; iDb <= nDb; iDb++ {
var pBt uintptr = (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*16)).FpBt
@@ -146093,11 +148217,11 @@ func Xsqlite3_txn_state(tls *libc.TLS, db uintptr, zSchema uintptr) int32 { /* s
// version forces the connection to become a zombie if there are
// unclosed resources, and arranges for deallocation when the last
// prepare statement or sqlite3_backup closes.
-func Xsqlite3_close(tls *libc.TLS, db uintptr) int32 { /* sqlite3.c:166362:16: */
+func Xsqlite3_close(tls *libc.TLS, db uintptr) int32 { /* sqlite3.c:167845:16: */
return sqlite3Close(tls, db, 0)
}
-func Xsqlite3_close_v2(tls *libc.TLS, db uintptr) int32 { /* sqlite3.c:166363:16: */
+func Xsqlite3_close_v2(tls *libc.TLS, db uintptr) int32 { /* sqlite3.c:167846:16: */
return sqlite3Close(tls, db, 1)
}
@@ -146107,14 +148231,14 @@ func Xsqlite3_close_v2(tls *libc.TLS, db uintptr) int32 { /* sqlite3.c:166363:16
// has been a prior call to sqlite3_close(db) or sqlite3_close_v2(db)) and
// every sqlite3_stmt has now been finalized and every sqlite3_backup has
// finished, then free all resources.
-func Xsqlite3LeaveMutexAndCloseZombie(tls *libc.TLS, db uintptr) { /* sqlite3.c:166374:21: */
+func Xsqlite3LeaveMutexAndCloseZombie(tls *libc.TLS, db uintptr) { /* sqlite3.c:167857:21: */
var i uintptr // Hash table iterator
var j int32
// If there are outstanding sqlite3_stmt or sqlite3_backup objects
// or if the connection has not yet been closed by sqlite3_close_v2(),
// then just leave the mutex and return.
- if ((*Sqlite3)(unsafe.Pointer(db)).Fmagic != U32(SQLITE_MAGIC_ZOMBIE)) || (connectionIsBusy(tls, db) != 0) {
+ if int32((*Sqlite3)(unsafe.Pointer(db)).FeOpenState) != SQLITE_STATE_ZOMBIE || connectionIsBusy(tls, db) != 0 {
Xsqlite3_mutex_leave(tls, (*Sqlite3)(unsafe.Pointer(db)).Fmutex)
return
}
@@ -146135,7 +148259,7 @@ func Xsqlite3LeaveMutexAndCloseZombie(tls *libc.TLS, db uintptr) { /* sqlite3.c:
// Close all database connections
for j = 0; j < (*Sqlite3)(unsafe.Pointer(db)).FnDb; j++ {
- var pDb uintptr = ((*Sqlite3)(unsafe.Pointer(db)).FaDb + uintptr(j)*16)
+ var pDb uintptr = (*Sqlite3)(unsafe.Pointer(db)).FaDb + uintptr(j)*16
if (*Db1)(unsafe.Pointer(pDb)).FpBt != 0 {
Xsqlite3BtreeClose(tls, (*Db1)(unsafe.Pointer(pDb)).FpBt)
(*Db1)(unsafe.Pointer(pDb)).FpBt = uintptr(0)
@@ -146157,7 +148281,7 @@ func Xsqlite3LeaveMutexAndCloseZombie(tls *libc.TLS, db uintptr) { /* sqlite3.c:
// locks and does not require any further unlock-notify callbacks.
Xsqlite3ConnectionClosed(tls, db)
- for i = (*Hash)(unsafe.Pointer((db + 404 /* &.aFunc */))).Ffirst; i != 0; i = (*HashElem)(unsafe.Pointer(i)).Fnext {
+ for i = (*Hash)(unsafe.Pointer(db + 428)).Ffirst; i != 0; i = (*HashElem)(unsafe.Pointer(i)).Fnext {
var pNext uintptr
var p uintptr
p = (*HashElem)(unsafe.Pointer(i)).Fdata
@@ -146168,8 +148292,8 @@ func Xsqlite3LeaveMutexAndCloseZombie(tls *libc.TLS, db uintptr) { /* sqlite3.c:
p = pNext
}
}
- Xsqlite3HashClear(tls, (db + 404 /* &.aFunc */))
- for i = (*Hash)(unsafe.Pointer((db + 420 /* &.aCollSeq */))).Ffirst; i != 0; i = (*HashElem)(unsafe.Pointer(i)).Fnext {
+ Xsqlite3HashClear(tls, db+428)
+ for i = (*Hash)(unsafe.Pointer(db + 444)).Ffirst; i != 0; i = (*HashElem)(unsafe.Pointer(i)).Fnext {
var pColl uintptr = (*HashElem)(unsafe.Pointer(i)).Fdata
// Invoke any destructors registered for collation sequence user data.
for j = 0; j < 3; j++ {
@@ -146179,19 +148303,19 @@ func Xsqlite3LeaveMutexAndCloseZombie(tls *libc.TLS, db uintptr) { /* sqlite3.c:
}
Xsqlite3DbFree(tls, db, pColl)
}
- Xsqlite3HashClear(tls, (db + 420 /* &.aCollSeq */))
- for i = (*Hash)(unsafe.Pointer((db + 376 /* &.aModule */))).Ffirst; i != 0; i = (*HashElem)(unsafe.Pointer(i)).Fnext {
+ Xsqlite3HashClear(tls, db+444)
+ for i = (*Hash)(unsafe.Pointer(db + 400)).Ffirst; i != 0; i = (*HashElem)(unsafe.Pointer(i)).Fnext {
var pMod uintptr = (*HashElem)(unsafe.Pointer(i)).Fdata
Xsqlite3VtabEponymousTableClear(tls, db, pMod)
Xsqlite3VtabModuleUnref(tls, db, pMod)
}
- Xsqlite3HashClear(tls, (db + 376 /* &.aModule */))
+ Xsqlite3HashClear(tls, db+400)
Xsqlite3Error(tls, db, SQLITE_OK) // Deallocates any cached error strings.
Xsqlite3ValueFree(tls, (*Sqlite3)(unsafe.Pointer(db)).FpErr)
Xsqlite3CloseExtensions(tls, db)
- (*Sqlite3)(unsafe.Pointer(db)).Fmagic = SQLITE_MAGIC_ERROR
+ (*Sqlite3)(unsafe.Pointer(db)).FeOpenState = U8(SQLITE_STATE_ERROR)
// The temp-database schema is allocated differently from the other schema
// objects (using sqliteMalloc() directly, instead of sqlite3BtreeSchema()).
@@ -146199,8 +148323,11 @@ func Xsqlite3LeaveMutexAndCloseZombie(tls *libc.TLS, db uintptr) { /* sqlite3.c:
// the same sqliteMalloc() as the one that allocates the database
// structure?
Xsqlite3DbFree(tls, db, (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+1*16)).FpSchema)
+ if (*Sqlite3)(unsafe.Pointer(db)).FxAutovacDestr != 0 {
+ (*struct{ f func(*libc.TLS, uintptr) })(unsafe.Pointer(&struct{ uintptr }{(*Sqlite3)(unsafe.Pointer(db)).FxAutovacDestr})).f(tls, (*Sqlite3)(unsafe.Pointer(db)).FpAutovacPagesArg)
+ }
Xsqlite3_mutex_leave(tls, (*Sqlite3)(unsafe.Pointer(db)).Fmutex)
- (*Sqlite3)(unsafe.Pointer(db)).Fmagic = SQLITE_MAGIC_CLOSED
+ (*Sqlite3)(unsafe.Pointer(db)).FeOpenState = U8(SQLITE_STATE_CLOSED)
Xsqlite3_mutex_free(tls, (*Sqlite3)(unsafe.Pointer(db)).Fmutex)
if (*Sqlite3)(unsafe.Pointer(db)).Flookaside.FbMalloced != 0 {
@@ -146214,7 +148341,7 @@ func Xsqlite3LeaveMutexAndCloseZombie(tls *libc.TLS, db uintptr) { /* sqlite3.c:
// breaker") and made to return tripCode if there are any further
// attempts to use that cursor. Read cursors remain open and valid
// but are "saved" in case the table pages are moved around.
-func Xsqlite3RollbackAll(tls *libc.TLS, db uintptr, tripCode int32) { /* sqlite3.c:166494:21: */
+func Xsqlite3RollbackAll(tls *libc.TLS, db uintptr, tripCode int32) { /* sqlite3.c:167980:21: */
var i int32
var inTrans int32 = 0
var schemaChange int32
@@ -146228,7 +148355,7 @@ func Xsqlite3RollbackAll(tls *libc.TLS, db uintptr, tripCode int32) { /* sqlite3
// the database rollback and schema reset, which can cause false
// corruption reports in some cases.
Xsqlite3BtreeEnterAll(tls, db)
- schemaChange = (libc.Bool32((((*Sqlite3)(unsafe.Pointer(db)).FmDbFlags & U32(DBFLAG_SchemaChange)) != U32(0)) && (int32((*Sqlite3)(unsafe.Pointer(db)).Finit.Fbusy) == 0)))
+ schemaChange = libc.Bool32((*Sqlite3)(unsafe.Pointer(db)).FmDbFlags&U32(DBFLAG_SchemaChange) != U32(0) && int32((*Sqlite3)(unsafe.Pointer(db)).Finit.Fbusy) == 0)
for i = 0; i < (*Sqlite3)(unsafe.Pointer(db)).FnDb; i++ {
var p uintptr = (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb + uintptr(i)*16)).FpBt
@@ -146251,10 +148378,10 @@ func Xsqlite3RollbackAll(tls *libc.TLS, db uintptr, tripCode int32) { /* sqlite3
// Any deferred constraint violations have now been resolved.
(*Sqlite3)(unsafe.Pointer(db)).FnDeferredCons = int64(0)
(*Sqlite3)(unsafe.Pointer(db)).FnDeferredImmCons = int64(0)
- *(*U64)(unsafe.Pointer(db + 32 /* &.flags */)) &= (libc.CplUint64(uint64(SQLITE_DeferFKs)))
+ *(*U64)(unsafe.Pointer(db + 32)) &= libc.CplUint64(uint64(SQLITE_DeferFKs) | U64(uint64(0x00002))<<32)
// If one has been configured, invoke the rollback-hook callback
- if ((*Sqlite3)(unsafe.Pointer(db)).FxRollbackCallback != 0) && ((inTrans != 0) || !(int32((*Sqlite3)(unsafe.Pointer(db)).FautoCommit) != 0)) {
+ if (*Sqlite3)(unsafe.Pointer(db)).FxRollbackCallback != 0 && (inTrans != 0 || !(int32((*Sqlite3)(unsafe.Pointer(db)).FautoCommit) != 0)) {
(*struct{ f func(*libc.TLS, uintptr) })(unsafe.Pointer(&struct{ uintptr }{(*Sqlite3)(unsafe.Pointer(db)).FxRollbackCallback})).f(tls, (*Sqlite3)(unsafe.Pointer(db)).FpRollbackArg)
}
}
@@ -146264,31 +148391,31 @@ func Xsqlite3RollbackAll(tls *libc.TLS, db uintptr, tripCode int32) { /* sqlite3
// Return a static string that describes the kind of error specified in the
// argument.
-func Xsqlite3ErrStr(tls *libc.TLS, rc int32) uintptr { /* sqlite3.c:166655:27: */
- var zErr uintptr = ts + 21720 /* "unknown error" */
+func Xsqlite3ErrStr(tls *libc.TLS, rc int32) uintptr { /* sqlite3.c:168141:27: */
+ var zErr uintptr = ts + 23017 /* "unknown error" */
switch rc {
- case (SQLITE_ABORT | (int32(2) << 8)):
+ case SQLITE_ABORT | int32(2)<<8:
{
- zErr = ts + 21734 /* "abort due to ROL..." */
+ zErr = ts + 23031 /* "abort due to ROL..." */
break
}
case SQLITE_ROW:
{
- zErr = ts + 21756 /* "another row avai..." */
+ zErr = ts + 23053 /* "another row avai..." */
break
}
case SQLITE_DONE:
{
- zErr = ts + 21778 /* "no more rows ava..." */
+ zErr = ts + 23075 /* "no more rows ava..." */
break
}
default:
{
- rc = rc & (0xff)
- if ((rc >= 0) && (rc < (int32(uint32(unsafe.Sizeof(aMsg)) / uint32(unsafe.Sizeof(uintptr(0))))))) && (aMsg[rc] != uintptr(0)) {
+ rc = rc & 0xff
+ if rc >= 0 && rc < int32(uint32(unsafe.Sizeof(aMsg))/uint32(unsafe.Sizeof(uintptr(0)))) && aMsg[rc] != uintptr(0) {
zErr = aMsg[rc]
}
break
@@ -146299,36 +148426,36 @@ func Xsqlite3ErrStr(tls *libc.TLS, rc int32) uintptr { /* sqlite3.c:166655:27: *
}
var aMsg = [29]uintptr{
- /* SQLITE_OK */ ts + 21801, /* "not an error" */
- /* SQLITE_ERROR */ ts + 21814, /* "SQL logic error" */
+ /* SQLITE_OK */ ts + 23098, /* "not an error" */
+ /* SQLITE_ERROR */ ts + 23111, /* "SQL logic error" */
/* SQLITE_INTERNAL */ uintptr(0),
- /* SQLITE_PERM */ ts + 21830, /* "access permissio..." */
- /* SQLITE_ABORT */ ts + 21855, /* "query aborted" */
- /* SQLITE_BUSY */ ts + 21869, /* "database is lock..." */
- /* SQLITE_LOCKED */ ts + 21888, /* "database table i..." */
- /* SQLITE_NOMEM */ ts + 5181, /* "out of memory" */
- /* SQLITE_READONLY */ ts + 21913, /* "attempt to write..." */
- /* SQLITE_INTERRUPT */ ts + 21950, /* "interrupted" */
- /* SQLITE_IOERR */ ts + 21962, /* "disk I/O error" */
- /* SQLITE_CORRUPT */ ts + 21977, /* "database disk im..." */
- /* SQLITE_NOTFOUND */ ts + 22010, /* "unknown operatio..." */
- /* SQLITE_FULL */ ts + 22028, /* "database or disk..." */
- /* SQLITE_CANTOPEN */ ts + 22053, /* "unable to open d..." */
- /* SQLITE_PROTOCOL */ ts + 22082, /* "locking protocol" */
+ /* SQLITE_PERM */ ts + 23127, /* "access permissio..." */
+ /* SQLITE_ABORT */ ts + 23152, /* "query aborted" */
+ /* SQLITE_BUSY */ ts + 23166, /* "database is lock..." */
+ /* SQLITE_LOCKED */ ts + 23185, /* "database table i..." */
+ /* SQLITE_NOMEM */ ts + 6028, /* "out of memory" */
+ /* SQLITE_READONLY */ ts + 23210, /* "attempt to write..." */
+ /* SQLITE_INTERRUPT */ ts + 23247, /* "interrupted" */
+ /* SQLITE_IOERR */ ts + 23259, /* "disk I/O error" */
+ /* SQLITE_CORRUPT */ ts + 23274, /* "database disk im..." */
+ /* SQLITE_NOTFOUND */ ts + 23307, /* "unknown operatio..." */
+ /* SQLITE_FULL */ ts + 23325, /* "database or disk..." */
+ /* SQLITE_CANTOPEN */ ts + 23350, /* "unable to open d..." */
+ /* SQLITE_PROTOCOL */ ts + 23379, /* "locking protocol" */
/* SQLITE_EMPTY */ uintptr(0),
- /* SQLITE_SCHEMA */ ts + 4911, /* "database schema ..." */
- /* SQLITE_TOOBIG */ ts + 4448, /* "string or blob t..." */
- /* SQLITE_CONSTRAINT */ ts + 22099, /* "constraint faile..." */
- /* SQLITE_MISMATCH */ ts + 22117, /* "datatype mismatc..." */
- /* SQLITE_MISUSE */ ts + 22135, /* "bad parameter or..." */
+ /* SQLITE_SCHEMA */ ts + 5758, /* "database schema ..." */
+ /* SQLITE_TOOBIG */ ts + 5254, /* "string or blob t..." */
+ /* SQLITE_CONSTRAINT */ ts + 23396, /* "constraint faile..." */
+ /* SQLITE_MISMATCH */ ts + 23414, /* "datatype mismatc..." */
+ /* SQLITE_MISUSE */ ts + 23432, /* "bad parameter or..." */
/* SQLITE_NOLFS */ uintptr(0),
- /* SQLITE_AUTH */ ts + 22169, /* "authorization de..." */
+ /* SQLITE_AUTH */ ts + 23466, /* "authorization de..." */
/* SQLITE_FORMAT */ uintptr(0),
- /* SQLITE_RANGE */ ts + 22190, /* "column index out..." */
- /* SQLITE_NOTADB */ ts + 22216, /* "file is not a da..." */
- /* SQLITE_NOTICE */ ts + 22239, /* "notification mes..." */
- /* SQLITE_WARNING */ ts + 22260, /* "warning message" */
-} /* sqlite3.c:166656:20 */
+ /* SQLITE_RANGE */ ts + 23487, /* "column index out..." */
+ /* SQLITE_NOTADB */ ts + 23513, /* "file is not a da..." */
+ /* SQLITE_NOTICE */ ts + 23536, /* "notification mes..." */
+ /* SQLITE_WARNING */ ts + 23557, /* "warning message" */
+} /* sqlite3.c:168142:20 */
// This routine implements a busy callback that sleeps and tries
// again until a timeout value is reached. The timeout value is
@@ -146337,31 +148464,31 @@ var aMsg = [29]uintptr{
//
// Return non-zero to retry the lock. Return zero to stop trying
// and cause SQLite to return SQLITE_BUSY.
-func sqliteDefaultBusyCallback(tls *libc.TLS, ptr uintptr, count int32) int32 { /* sqlite3.c:166725:12: */
+func sqliteDefaultBusyCallback(tls *libc.TLS, ptr uintptr, count int32) int32 { /* sqlite3.c:168211:12: */
var db uintptr = ptr
var tmout int32 = (*Sqlite3)(unsafe.Pointer(db)).FbusyTimeout
var delay int32
var prior int32
- if count < (int32(uint32(unsafe.Sizeof(delays)) / uint32(unsafe.Sizeof(U8(0))))) {
+ if count < int32(uint32(unsafe.Sizeof(delays))/uint32(unsafe.Sizeof(U8(0)))) {
delay = int32(delays[count])
prior = int32(totals[count])
} else {
- delay = int32(delays[((int32(uint32(unsafe.Sizeof(delays)) / uint32(unsafe.Sizeof(U8(0))))) - 1)])
- prior = (int32(totals[((int32(uint32(unsafe.Sizeof(delays))/uint32(unsafe.Sizeof(U8(0)))))-1)]) + (delay * (count - ((int32(uint32(unsafe.Sizeof(delays)) / uint32(unsafe.Sizeof(U8(0))))) - 1))))
+ delay = int32(delays[int32(uint32(unsafe.Sizeof(delays))/uint32(unsafe.Sizeof(U8(0))))-1])
+ prior = int32(totals[int32(uint32(unsafe.Sizeof(delays))/uint32(unsafe.Sizeof(U8(0))))-1]) + delay*(count-(int32(uint32(unsafe.Sizeof(delays))/uint32(unsafe.Sizeof(U8(0))))-1))
}
- if (prior + delay) > tmout {
- delay = (tmout - prior)
+ if prior+delay > tmout {
+ delay = tmout - prior
if delay <= 0 {
return 0
}
}
- Xsqlite3OsSleep(tls, (*Sqlite3)(unsafe.Pointer(db)).FpVfs, (delay * 1000))
+ Xsqlite3OsSleep(tls, (*Sqlite3)(unsafe.Pointer(db)).FpVfs, delay*1000)
return 1
}
-var delays = [12]U8{U8(1), U8(2), U8(5), U8(10), U8(15), U8(20), U8(25), U8(25), U8(25), U8(50), U8(50), U8(100)} /* sqlite3.c:166732:19 */
-var totals = [12]U8{U8(0), U8(1), U8(3), U8(8), U8(18), U8(33), U8(53), U8(78), U8(103), U8(128), U8(178), U8(228)} /* sqlite3.c:166734:19 */
+var delays = [12]U8{U8(1), U8(2), U8(5), U8(10), U8(15), U8(20), U8(25), U8(25), U8(25), U8(50), U8(50), U8(100)} /* sqlite3.c:168218:19 */
+var totals = [12]U8{U8(0), U8(1), U8(3), U8(8), U8(18), U8(33), U8(53), U8(78), U8(103), U8(128), U8(178), U8(228)} /* sqlite3.c:168220:19 */
// Invoke the given busy handler.
//
@@ -146370,9 +148497,9 @@ var totals = [12]U8{U8(0), U8(1), U8(3), U8(8), U8(18), U8(33), U8(53), U8(78),
//
// If this routine returns non-zero, the lock is retried. If it
// returns 0, the operation aborts with an SQLITE_BUSY error.
-func Xsqlite3InvokeBusyHandler(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:166777:20: */
+func Xsqlite3InvokeBusyHandler(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:168263:20: */
var rc int32
- if ((*BusyHandler)(unsafe.Pointer(p)).FxBusyHandler == uintptr(0)) || ((*BusyHandler)(unsafe.Pointer(p)).FnBusy < 0) {
+ if (*BusyHandler)(unsafe.Pointer(p)).FxBusyHandler == uintptr(0) || (*BusyHandler)(unsafe.Pointer(p)).FnBusy < 0 {
return 0
}
rc = (*struct {
@@ -146388,7 +148515,7 @@ func Xsqlite3InvokeBusyHandler(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:16
// This routine sets the busy callback for an Sqlite database to the
// given callback function with the given argument.
-func Xsqlite3_busy_handler(tls *libc.TLS, db uintptr, xBusy uintptr, pArg uintptr) int32 { /* sqlite3.c:166793:16: */
+func Xsqlite3_busy_handler(tls *libc.TLS, db uintptr, xBusy uintptr, pArg uintptr) int32 { /* sqlite3.c:168279:16: */
Xsqlite3_mutex_enter(tls, (*Sqlite3)(unsafe.Pointer(db)).Fmutex)
(*Sqlite3)(unsafe.Pointer(db)).FbusyHandler.FxBusyHandler = xBusy
(*Sqlite3)(unsafe.Pointer(db)).FbusyHandler.FpBusyArg = pArg
@@ -146401,7 +148528,7 @@ func Xsqlite3_busy_handler(tls *libc.TLS, db uintptr, xBusy uintptr, pArg uintpt
// This routine sets the progress callback for an Sqlite database to the
// given callback function with the given argument. The progress callback will
// be invoked every nOps opcodes.
-func Xsqlite3_progress_handler(tls *libc.TLS, db uintptr, nOps int32, xProgress uintptr, pArg uintptr) { /* sqlite3.c:166816:17: */
+func Xsqlite3_progress_handler(tls *libc.TLS, db uintptr, nOps int32, xProgress uintptr, pArg uintptr) { /* sqlite3.c:168302:17: */
Xsqlite3_mutex_enter(tls, (*Sqlite3)(unsafe.Pointer(db)).Fmutex)
if nOps > 0 {
(*Sqlite3)(unsafe.Pointer(db)).FxProgress = xProgress
@@ -146417,7 +148544,7 @@ func Xsqlite3_progress_handler(tls *libc.TLS, db uintptr, nOps int32, xProgress
// This routine installs a default busy handler that waits for the
// specified number of milliseconds before returning 0.
-func Xsqlite3_busy_timeout(tls *libc.TLS, db uintptr, ms int32) int32 { /* sqlite3.c:166847:16: */
+func Xsqlite3_busy_timeout(tls *libc.TLS, db uintptr, ms int32) int32 { /* sqlite3.c:168333:16: */
if ms > 0 {
Xsqlite3_busy_handler(tls, db, *(*uintptr)(unsafe.Pointer(&struct {
f func(*libc.TLS, uintptr, int32) int32
@@ -146431,36 +148558,34 @@ func Xsqlite3_busy_timeout(tls *libc.TLS, db uintptr, ms int32) int32 { /* sqlit
}
// Cause any pending operation to stop at its earliest opportunity.
-func Xsqlite3_interrupt(tls *libc.TLS, db uintptr) { /* sqlite3.c:166864:17: */
- libc.AtomicStoreNInt32((db + 288 /* &.u1 */ /* &.isInterrupted */), int32(1), 0)
+func Xsqlite3_interrupt(tls *libc.TLS, db uintptr) { /* sqlite3.c:168350:17: */
+ libc.AtomicStoreNInt32(db+312, int32(1), 0)
}
// This function is exactly the same as sqlite3_create_function(), except
// that it is designed to be called by internal code. The difference is
// that if a malloc() fails in sqlite3_create_function(), an error code
// is returned and the mallocFailed flag cleared.
-func Xsqlite3CreateFunc(tls *libc.TLS, db uintptr, zFunctionName uintptr, nArg int32, enc int32, pUserData uintptr, xSFunc uintptr, xStep uintptr, xFinal uintptr, xValue uintptr, xInverse uintptr, pDestructor uintptr) int32 { /* sqlite3.c:166881:20: */
+func Xsqlite3CreateFunc(tls *libc.TLS, db uintptr, zFunctionName uintptr, nArg int32, enc int32, pUserData uintptr, xSFunc uintptr, xStep uintptr, xFinal uintptr, xValue uintptr, xInverse uintptr, pDestructor uintptr) int32 { /* sqlite3.c:168367:20: */
var p uintptr
- var nName int32
- _ = nName
var extraFlags int32
- if (((((zFunctionName == uintptr(0)) || // Must have a valid name
- ((xSFunc != uintptr(0)) && (xFinal != uintptr(0)))) || // Not both xSFunc and xFinal
- ((libc.Bool32(xFinal == uintptr(0))) != (libc.Bool32(xStep == uintptr(0))))) || // Both or neither of xFinal and xStep
- ((libc.Bool32(xValue == uintptr(0))) != (libc.Bool32(xInverse == uintptr(0))))) || // Both or neither of xValue, xInverse
- ((nArg < -1) || (nArg > SQLITE_MAX_FUNCTION_ARG))) ||
- (255 < (libc.AssignInt32(&nName, Xsqlite3Strlen30(tls, zFunctionName)))) {
- return Xsqlite3MisuseError(tls, 166907)
+ if zFunctionName == uintptr(0) ||
+ xSFunc != uintptr(0) && xFinal != uintptr(0) ||
+ libc.Bool32(xFinal == uintptr(0)) != libc.Bool32(xStep == uintptr(0)) ||
+ libc.Bool32(xValue == uintptr(0)) != libc.Bool32(xInverse == uintptr(0)) ||
+ (nArg < -1 || nArg > SQLITE_MAX_FUNCTION_ARG) ||
+ 255 < Xsqlite3Strlen30(tls, zFunctionName) {
+ return Xsqlite3MisuseError(tls, 168392)
}
- extraFlags = (enc & (((SQLITE_DETERMINISTIC | SQLITE_DIRECTONLY) | SQLITE_SUBTYPE) | SQLITE_INNOCUOUS))
+ extraFlags = enc & (SQLITE_DETERMINISTIC | SQLITE_DIRECTONLY | SQLITE_SUBTYPE | SQLITE_INNOCUOUS)
enc = enc & (SQLITE_FUNC_ENCMASK | SQLITE_ANY)
// The SQLITE_INNOCUOUS flag is the same bit as SQLITE_FUNC_UNSAFE. But
// the meaning is inverted. So flip the bit.
- extraFlags = extraFlags ^ (SQLITE_FUNC_UNSAFE)
+ extraFlags = extraFlags ^ SQLITE_FUNC_UNSAFE
// If SQLITE_UTF16 is specified as the encoding type, transform this
// to one of SQLITE_UTF16LE or SQLITE_UTF16BE using the
@@ -146468,22 +148593,37 @@ func Xsqlite3CreateFunc(tls *libc.TLS, db uintptr, zFunctionName uintptr, nArg i
//
// If SQLITE_ANY is specified, add three versions of the function
// to the hash table.
- if enc == SQLITE_UTF16 {
+ switch enc {
+ case SQLITE_UTF16:
enc = SQLITE_UTF16LE
- } else if enc == SQLITE_ANY {
- var rc int32
- rc = Xsqlite3CreateFunc(tls, db, zFunctionName, nArg,
- ((SQLITE_UTF8 | extraFlags) ^ SQLITE_FUNC_UNSAFE),
- pUserData, xSFunc, xStep, xFinal, xValue, xInverse, pDestructor)
- if rc == SQLITE_OK {
+ break
+ case SQLITE_ANY:
+ {
+ var rc int32
rc = Xsqlite3CreateFunc(tls, db, zFunctionName, nArg,
- ((SQLITE_UTF16LE | extraFlags) ^ SQLITE_FUNC_UNSAFE),
+ SQLITE_UTF8|extraFlags^SQLITE_FUNC_UNSAFE,
pUserData, xSFunc, xStep, xFinal, xValue, xInverse, pDestructor)
+ if rc == SQLITE_OK {
+ rc = Xsqlite3CreateFunc(tls, db, zFunctionName, nArg,
+ SQLITE_UTF16LE|extraFlags^SQLITE_FUNC_UNSAFE,
+ pUserData, xSFunc, xStep, xFinal, xValue, xInverse, pDestructor)
+ }
+ if rc != SQLITE_OK {
+ return rc
+ }
+ enc = SQLITE_UTF16BE
+ break
+
}
- if rc != SQLITE_OK {
- return rc
- }
- enc = SQLITE_UTF16BE
+ case SQLITE_UTF8:
+ fallthrough
+ case SQLITE_UTF16LE:
+ fallthrough
+ case SQLITE_UTF16BE:
+ break
+ default:
+ enc = SQLITE_UTF8
+ break
}
// Check if an existing function is being overridden or deleted. If so,
@@ -146491,16 +148631,16 @@ func Xsqlite3CreateFunc(tls *libc.TLS, db uintptr, zFunctionName uintptr, nArg i
// is being overridden/deleted but there are no active VMs, allow the
// operation to continue but invalidate all precompiled statements.
p = Xsqlite3FindFunction(tls, db, zFunctionName, nArg, U8(enc), uint8(0))
- if ((p != 0) && (((*FuncDef)(unsafe.Pointer(p)).FfuncFlags & U32(SQLITE_FUNC_ENCMASK)) == U32(enc))) && (int32((*FuncDef)(unsafe.Pointer(p)).FnArg) == nArg) {
+ if p != 0 && (*FuncDef)(unsafe.Pointer(p)).FfuncFlags&U32(SQLITE_FUNC_ENCMASK) == U32(enc) && int32((*FuncDef)(unsafe.Pointer(p)).FnArg) == nArg {
if (*Sqlite3)(unsafe.Pointer(db)).FnVdbeActive != 0 {
Xsqlite3ErrorWithMsg(tls, db, SQLITE_BUSY,
- ts+22276 /* "unable to delete..." */, 0)
+ ts+23573 /* "unable to delete..." */, 0)
return SQLITE_BUSY
} else {
Xsqlite3ExpirePreparedStatements(tls, db, 0)
}
- } else if (xSFunc == uintptr(0)) && (xFinal == uintptr(0)) {
+ } else if xSFunc == uintptr(0) && xFinal == uintptr(0) {
// Trying to delete a function that does not exist. This is a no-op.
// https://sqlite.org/forum/forumpost/726219164b
return SQLITE_OK
@@ -146519,8 +148659,8 @@ func Xsqlite3CreateFunc(tls *libc.TLS, db uintptr, zFunctionName uintptr, nArg i
if pDestructor != 0 {
(*FuncDestructor)(unsafe.Pointer(pDestructor)).FnRef++
}
- *(*uintptr)(unsafe.Pointer(p + 36 /* &.u */)) = pDestructor
- (*FuncDef)(unsafe.Pointer(p)).FfuncFlags = (((*FuncDef)(unsafe.Pointer(p)).FfuncFlags & U32(SQLITE_FUNC_ENCMASK)) | U32(extraFlags))
+ *(*uintptr)(unsafe.Pointer(p + 36)) = pDestructor
+ (*FuncDef)(unsafe.Pointer(p)).FfuncFlags = (*FuncDef)(unsafe.Pointer(p)).FfuncFlags&U32(SQLITE_FUNC_ENCMASK) | U32(extraFlags)
(*FuncDef)(unsafe.Pointer(p)).FxSFunc = func() uintptr {
if xSFunc != 0 {
@@ -146541,7 +148681,7 @@ func Xsqlite3CreateFunc(tls *libc.TLS, db uintptr, zFunctionName uintptr, nArg i
// sqlite3_create_function()
// sqlite3_create_function_v2()
// sqlite3_create_window_function()
-func createFunctionApi(tls *libc.TLS, db uintptr, zFunc uintptr, nArg int32, enc int32, p uintptr, xSFunc uintptr, xStep uintptr, xFinal uintptr, xValue uintptr, xInverse uintptr, xDestroy uintptr) int32 { /* sqlite3.c:167005:12: */
+func createFunctionApi(tls *libc.TLS, db uintptr, zFunc uintptr, nArg int32, enc int32, p uintptr, xSFunc uintptr, xStep uintptr, xFinal uintptr, xValue uintptr, xInverse uintptr, xDestroy uintptr) int32 { /* sqlite3.c:168501:12: */
var rc int32
var pArg uintptr
rc = SQLITE_ERROR
@@ -146552,7 +148692,7 @@ func createFunctionApi(tls *libc.TLS, db uintptr, zFunc uintptr, nArg int32, enc
goto __1
}
pArg = Xsqlite3Malloc(tls, uint64(unsafe.Sizeof(FuncDestructor{})))
- if !(!(pArg != 0)) {
+ if !!(pArg != 0) {
goto __2
}
Xsqlite3OomFault(tls, db)
@@ -146567,7 +148707,7 @@ __1:
;
rc = Xsqlite3CreateFunc(tls, db, zFunc, nArg, enc, p,
xSFunc, xStep, xFinal, xValue, xInverse, pArg)
- if !((pArg != 0) && ((*FuncDestructor)(unsafe.Pointer(pArg)).FnRef == 0)) {
+ if !(pArg != 0 && (*FuncDestructor)(unsafe.Pointer(pArg)).FnRef == 0) {
goto __3
}
@@ -146583,22 +148723,22 @@ out:
}
// Create new user functions.
-func Xsqlite3_create_function(tls *libc.TLS, db uintptr, zFunc uintptr, nArg int32, enc int32, p uintptr, xSFunc uintptr, xStep uintptr, xFinal uintptr) int32 { /* sqlite3.c:167056:16: */
+func Xsqlite3_create_function(tls *libc.TLS, db uintptr, zFunc uintptr, nArg int32, enc int32, p uintptr, xSFunc uintptr, xStep uintptr, xFinal uintptr) int32 { /* sqlite3.c:168552:16: */
return createFunctionApi(tls, db, zFunc, nArg, enc, p, xSFunc, xStep,
xFinal, uintptr(0), uintptr(0), uintptr(0))
}
-func Xsqlite3_create_function_v2(tls *libc.TLS, db uintptr, zFunc uintptr, nArg int32, enc int32, p uintptr, xSFunc uintptr, xStep uintptr, xFinal uintptr, xDestroy uintptr) int32 { /* sqlite3.c:167069:16: */
+func Xsqlite3_create_function_v2(tls *libc.TLS, db uintptr, zFunc uintptr, nArg int32, enc int32, p uintptr, xSFunc uintptr, xStep uintptr, xFinal uintptr, xDestroy uintptr) int32 { /* sqlite3.c:168565:16: */
return createFunctionApi(tls, db, zFunc, nArg, enc, p, xSFunc, xStep,
xFinal, uintptr(0), uintptr(0), xDestroy)
}
-func Xsqlite3_create_window_function(tls *libc.TLS, db uintptr, zFunc uintptr, nArg int32, enc int32, p uintptr, xStep uintptr, xFinal uintptr, xValue uintptr, xInverse uintptr, xDestroy uintptr) int32 { /* sqlite3.c:167083:16: */
+func Xsqlite3_create_window_function(tls *libc.TLS, db uintptr, zFunc uintptr, nArg int32, enc int32, p uintptr, xStep uintptr, xFinal uintptr, xValue uintptr, xInverse uintptr, xDestroy uintptr) int32 { /* sqlite3.c:168579:16: */
return createFunctionApi(tls, db, zFunc, nArg, enc, p, uintptr(0), xStep,
xFinal, xValue, xInverse, xDestroy)
}
-func Xsqlite3_create_function16(tls *libc.TLS, db uintptr, zFunctionName uintptr, nArg int32, eTextRep int32, p uintptr, xSFunc uintptr, xStep uintptr, xFinal uintptr) int32 { /* sqlite3.c:167100:16: */
+func Xsqlite3_create_function16(tls *libc.TLS, db uintptr, zFunctionName uintptr, nArg int32, eTextRep int32, p uintptr, xSFunc uintptr, xStep uintptr, xFinal uintptr) int32 { /* sqlite3.c:168596:16: */
var rc int32
var zFunc8 uintptr
@@ -146618,7 +148758,7 @@ func Xsqlite3_create_function16(tls *libc.TLS, db uintptr, zFunctionName uintptr
// SQL function that use this routine so that the functions will exist
// for name resolution but are actually overloaded by the xFindFunction
// method of virtual tables.
-func sqlite3InvalidFunction(tls *libc.TLS, context uintptr, NotUsed int32, NotUsed2 uintptr) { /* sqlite3.c:167136:13: */
+func sqlite3InvalidFunction(tls *libc.TLS, context uintptr, NotUsed int32, NotUsed2 uintptr) { /* sqlite3.c:168632:13: */
bp := tls.Alloc(8)
defer tls.Free(8)
@@ -146627,7 +148767,7 @@ func sqlite3InvalidFunction(tls *libc.TLS, context uintptr, NotUsed int32, NotUs
_ = NotUsed
_ = NotUsed2
zErr = Xsqlite3_mprintf(tls,
- ts+22339 /* "unable to use fu..." */, libc.VaList(bp, zName))
+ ts+23636 /* "unable to use fu..." */, libc.VaList(bp, zName))
Xsqlite3_result_error(tls, context, zErr, -1)
Xsqlite3_free(tls, zErr)
}
@@ -146642,12 +148782,12 @@ func sqlite3InvalidFunction(tls *libc.TLS, context uintptr, NotUsed int32, NotUs
// should call this routine to make sure the global function exists.
// A global function must exist in order for name resolution to work
// properly.
-func Xsqlite3_overload_function(tls *libc.TLS, db uintptr, zName uintptr, nArg int32) int32 { /* sqlite3.c:167162:16: */
+func Xsqlite3_overload_function(tls *libc.TLS, db uintptr, zName uintptr, nArg int32) int32 { /* sqlite3.c:168658:16: */
var rc int32
var zCopy uintptr
Xsqlite3_mutex_enter(tls, (*Sqlite3)(unsafe.Pointer(db)).Fmutex)
- rc = (libc.Bool32(Xsqlite3FindFunction(tls, db, zName, nArg, uint8(SQLITE_UTF8), uint8(0)) != uintptr(0)))
+ rc = libc.Bool32(Xsqlite3FindFunction(tls, db, zName, nArg, uint8(SQLITE_UTF8), uint8(0)) != uintptr(0))
Xsqlite3_mutex_leave(tls, (*Sqlite3)(unsafe.Pointer(db)).Fmutex)
if rc != 0 {
return SQLITE_OK
@@ -146668,7 +148808,7 @@ func Xsqlite3_overload_function(tls *libc.TLS, db uintptr, zName uintptr, nArg i
// A NULL trace function means that no tracing is executes. A non-NULL
// trace is a pointer to a function that is invoked at the start of each
// SQL statement.
-func Xsqlite3_trace(tls *libc.TLS, db uintptr, xTrace uintptr, pArg uintptr) uintptr { /* sqlite3.c:167195:17: */
+func Xsqlite3_trace(tls *libc.TLS, db uintptr, xTrace uintptr, pArg uintptr) uintptr { /* sqlite3.c:168691:17: */
var pOld uintptr
Xsqlite3_mutex_enter(tls, (*Sqlite3)(unsafe.Pointer(db)).Fmutex)
@@ -146679,14 +148819,14 @@ func Xsqlite3_trace(tls *libc.TLS, db uintptr, xTrace uintptr, pArg uintptr) uin
}
return uint8(0)
}()
- *(*uintptr)(unsafe.Pointer(db + 208 /* &.trace */)) = xTrace
+ *(*uintptr)(unsafe.Pointer(db + 216)) = xTrace
(*Sqlite3)(unsafe.Pointer(db)).FpTraceArg = pArg
Xsqlite3_mutex_leave(tls, (*Sqlite3)(unsafe.Pointer(db)).Fmutex)
return pOld
}
// Register a trace callback using the version-2 interface.
-func Xsqlite3_trace_v2(tls *libc.TLS, db uintptr, mTrace uint32, xTrace uintptr, pArg uintptr) int32 { /* sqlite3.c:167216:16: */
+func Xsqlite3_trace_v2(tls *libc.TLS, db uintptr, mTrace uint32, xTrace uintptr, pArg uintptr) int32 { /* sqlite3.c:168712:16: */
Xsqlite3_mutex_enter(tls, (*Sqlite3)(unsafe.Pointer(db)).Fmutex)
if mTrace == uint32(0) {
xTrace = uintptr(0)
@@ -146695,7 +148835,7 @@ func Xsqlite3_trace_v2(tls *libc.TLS, db uintptr, mTrace uint32, xTrace uintptr,
mTrace = uint32(0)
}
(*Sqlite3)(unsafe.Pointer(db)).FmTrace = U8(mTrace)
- *(*uintptr)(unsafe.Pointer(db + 208 /* &.trace */)) = xTrace
+ *(*uintptr)(unsafe.Pointer(db + 216)) = xTrace
(*Sqlite3)(unsafe.Pointer(db)).FpTraceArg = pArg
Xsqlite3_mutex_leave(tls, (*Sqlite3)(unsafe.Pointer(db)).Fmutex)
return SQLITE_OK
@@ -146707,16 +148847,16 @@ func Xsqlite3_trace_v2(tls *libc.TLS, db uintptr, mTrace uint32, xTrace uintptr,
// A NULL profile function means that no profiling is executes. A non-NULL
// profile is a pointer to a function that is invoked at the conclusion of
// each SQL statement that is run.
-func Xsqlite3_profile(tls *libc.TLS, db uintptr, xProfile uintptr, pArg uintptr) uintptr { /* sqlite3.c:167246:17: */
+func Xsqlite3_profile(tls *libc.TLS, db uintptr, xProfile uintptr, pArg uintptr) uintptr { /* sqlite3.c:168742:17: */
var pOld uintptr
Xsqlite3_mutex_enter(tls, (*Sqlite3)(unsafe.Pointer(db)).Fmutex)
pOld = (*Sqlite3)(unsafe.Pointer(db)).FpProfileArg
(*Sqlite3)(unsafe.Pointer(db)).FxProfile = xProfile
(*Sqlite3)(unsafe.Pointer(db)).FpProfileArg = pArg
- *(*U8)(unsafe.Pointer(db + 90 /* &.mTrace */)) &= U8((SQLITE_TRACE_NONLEGACY_MASK))
+ *(*U8)(unsafe.Pointer(db + 90)) &= U8(SQLITE_TRACE_NONLEGACY_MASK)
if (*Sqlite3)(unsafe.Pointer(db)).FxProfile != 0 {
- *(*U8)(unsafe.Pointer(db + 90 /* &.mTrace */)) |= U8((SQLITE_TRACE_XPROFILE))
+ *(*U8)(unsafe.Pointer(db + 90)) |= U8(SQLITE_TRACE_XPROFILE)
}
Xsqlite3_mutex_leave(tls, (*Sqlite3)(unsafe.Pointer(db)).Fmutex)
return pOld
@@ -146725,7 +148865,7 @@ func Xsqlite3_profile(tls *libc.TLS, db uintptr, xProfile uintptr, pArg uintptr)
// Register a function to be invoked when a transaction commits.
// If the invoked function returns non-zero, then the commit becomes a
// rollback.
-func Xsqlite3_commit_hook(tls *libc.TLS, db uintptr, xCallback uintptr, pArg uintptr) uintptr { /* sqlite3.c:167276:17: */
+func Xsqlite3_commit_hook(tls *libc.TLS, db uintptr, xCallback uintptr, pArg uintptr) uintptr { /* sqlite3.c:168772:17: */
var pOld uintptr
Xsqlite3_mutex_enter(tls, (*Sqlite3)(unsafe.Pointer(db)).Fmutex)
@@ -146738,7 +148878,7 @@ func Xsqlite3_commit_hook(tls *libc.TLS, db uintptr, xCallback uintptr, pArg uin
// Register a callback to be invoked each time a row is updated,
// inserted or deleted using this database connection.
-func Xsqlite3_update_hook(tls *libc.TLS, db uintptr, xCallback uintptr, pArg uintptr) uintptr { /* sqlite3.c:167301:17: */
+func Xsqlite3_update_hook(tls *libc.TLS, db uintptr, xCallback uintptr, pArg uintptr) uintptr { /* sqlite3.c:168797:17: */
var pRet uintptr
Xsqlite3_mutex_enter(tls, (*Sqlite3)(unsafe.Pointer(db)).Fmutex)
@@ -146751,7 +148891,7 @@ func Xsqlite3_update_hook(tls *libc.TLS, db uintptr, xCallback uintptr, pArg uin
// Register a callback to be invoked each time a transaction is rolled
// back by this database connection.
-func Xsqlite3_rollback_hook(tls *libc.TLS, db uintptr, xCallback uintptr, pArg uintptr) uintptr { /* sqlite3.c:167326:17: */
+func Xsqlite3_rollback_hook(tls *libc.TLS, db uintptr, xCallback uintptr, pArg uintptr) uintptr { /* sqlite3.c:168822:17: */
var pRet uintptr
Xsqlite3_mutex_enter(tls, (*Sqlite3)(unsafe.Pointer(db)).Fmutex)
@@ -146764,7 +148904,7 @@ func Xsqlite3_rollback_hook(tls *libc.TLS, db uintptr, xCallback uintptr, pArg u
// Register a callback to be invoked each time a row is updated,
// inserted or deleted using this database connection.
-func Xsqlite3_preupdate_hook(tls *libc.TLS, db uintptr, xCallback uintptr, pArg uintptr) uintptr { /* sqlite3.c:167352:17: */
+func Xsqlite3_preupdate_hook(tls *libc.TLS, db uintptr, xCallback uintptr, pArg uintptr) uintptr { /* sqlite3.c:168848:17: */
var pRet uintptr
Xsqlite3_mutex_enter(tls, (*Sqlite3)(unsafe.Pointer(db)).Fmutex)
pRet = (*Sqlite3)(unsafe.Pointer(db)).FpPreUpdateArg
@@ -146774,12 +148914,26 @@ func Xsqlite3_preupdate_hook(tls *libc.TLS, db uintptr, xCallback uintptr, pArg
return pRet
}
+// Register a function to be invoked prior to each autovacuum that
+// determines the number of pages to vacuum.
+func Xsqlite3_autovacuum_pages(tls *libc.TLS, db uintptr, xCallback uintptr, pArg uintptr, xDestructor uintptr) int32 { /* sqlite3.c:168868:16: */
+ Xsqlite3_mutex_enter(tls, (*Sqlite3)(unsafe.Pointer(db)).Fmutex)
+ if (*Sqlite3)(unsafe.Pointer(db)).FxAutovacDestr != 0 {
+ (*struct{ f func(*libc.TLS, uintptr) })(unsafe.Pointer(&struct{ uintptr }{(*Sqlite3)(unsafe.Pointer(db)).FxAutovacDestr})).f(tls, (*Sqlite3)(unsafe.Pointer(db)).FpAutovacPagesArg)
+ }
+ (*Sqlite3)(unsafe.Pointer(db)).FxAutovacPages = xCallback
+ (*Sqlite3)(unsafe.Pointer(db)).FpAutovacPagesArg = pArg
+ (*Sqlite3)(unsafe.Pointer(db)).FxAutovacDestr = xDestructor
+ Xsqlite3_mutex_leave(tls, (*Sqlite3)(unsafe.Pointer(db)).Fmutex)
+ return SQLITE_OK
+}
+
// The sqlite3_wal_hook() callback registered by sqlite3_wal_autocheckpoint().
// Invoke sqlite3_wal_checkpoint if the number of frames in the log file
// is greater than sqlite3.pWalArg cast to an integer (the value configured by
// wal_autocheckpoint()).
-func Xsqlite3WalDefaultHook(tls *libc.TLS, pClientData uintptr, db uintptr, zDb uintptr, nFrame int32) int32 { /* sqlite3.c:167375:20: */
- if nFrame >= (int32(pClientData)) {
+func Xsqlite3WalDefaultHook(tls *libc.TLS, pClientData uintptr, db uintptr, zDb uintptr, nFrame int32) int32 { /* sqlite3.c:168899:20: */
+ if nFrame >= int32(pClientData) {
Xsqlite3BeginBenignMalloc(tls)
Xsqlite3_wal_checkpoint(tls, db, zDb)
Xsqlite3EndBenignMalloc(tls)
@@ -146796,7 +148950,7 @@ func Xsqlite3WalDefaultHook(tls *libc.TLS, pClientData uintptr, db uintptr, zDb
// registered using sqlite3_wal_hook(). Likewise, registering a callback
// using sqlite3_wal_hook() disables the automatic checkpoint mechanism
// configured by this function.
-func Xsqlite3_wal_autocheckpoint(tls *libc.TLS, db uintptr, nFrame int32) int32 { /* sqlite3.c:167401:16: */
+func Xsqlite3_wal_autocheckpoint(tls *libc.TLS, db uintptr, nFrame int32) int32 { /* sqlite3.c:168925:16: */
if nFrame > 0 {
Xsqlite3_wal_hook(tls, db, *(*uintptr)(unsafe.Pointer(&struct {
f func(*libc.TLS, uintptr, uintptr, uintptr, int32) int32
@@ -146809,7 +148963,7 @@ func Xsqlite3_wal_autocheckpoint(tls *libc.TLS, db uintptr, nFrame int32) int32
// Register a callback to be invoked each time a transaction is written
// into the write-ahead-log by this database connection.
-func Xsqlite3_wal_hook(tls *libc.TLS, db uintptr, xCallback uintptr, pArg uintptr) uintptr { /* sqlite3.c:167422:17: */
+func Xsqlite3_wal_hook(tls *libc.TLS, db uintptr, xCallback uintptr, pArg uintptr) uintptr { /* sqlite3.c:168946:17: */
var pRet uintptr
Xsqlite3_mutex_enter(tls, (*Sqlite3)(unsafe.Pointer(db)).Fmutex)
pRet = (*Sqlite3)(unsafe.Pointer(db)).FpWalArg
@@ -146820,7 +148974,7 @@ func Xsqlite3_wal_hook(tls *libc.TLS, db uintptr, xCallback uintptr, pArg uintpt
}
// Checkpoint database zDb.
-func Xsqlite3_wal_checkpoint_v2(tls *libc.TLS, db uintptr, zDb uintptr, eMode int32, pnLog uintptr, pnCkpt uintptr) int32 { /* sqlite3.c:167449:16: */
+func Xsqlite3_wal_checkpoint_v2(tls *libc.TLS, db uintptr, zDb uintptr, eMode int32, pnLog uintptr, pnCkpt uintptr) int32 { /* sqlite3.c:168973:16: */
bp := tls.Alloc(8)
defer tls.Free(8)
@@ -146835,21 +148989,21 @@ func Xsqlite3_wal_checkpoint_v2(tls *libc.TLS, db uintptr, zDb uintptr, eMode in
*(*int32)(unsafe.Pointer(pnCkpt)) = -1
}
- if (eMode < SQLITE_CHECKPOINT_PASSIVE) || (eMode > SQLITE_CHECKPOINT_TRUNCATE) {
+ if eMode < SQLITE_CHECKPOINT_PASSIVE || eMode > SQLITE_CHECKPOINT_TRUNCATE {
// EVIDENCE-OF: R-03996-12088 The M parameter must be a valid checkpoint
// mode:
return SQLITE_MISUSE
}
Xsqlite3_mutex_enter(tls, (*Sqlite3)(unsafe.Pointer(db)).Fmutex)
- if (zDb != 0) && (*(*uint8)(unsafe.Pointer(zDb)) != 0) {
+ if zDb != 0 && *(*uint8)(unsafe.Pointer(zDb)) != 0 {
iDb = Xsqlite3FindDbName(tls, db, zDb)
} else {
- iDb = (SQLITE_MAX_ATTACHED + 2) // This means process all schemas
+ iDb = SQLITE_MAX_ATTACHED + 2 // This means process all schemas
}
if iDb < 0 {
rc = SQLITE_ERROR
- Xsqlite3ErrorWithMsg(tls, db, SQLITE_ERROR, ts+22390 /* "unknown database..." */, libc.VaList(bp, zDb))
+ Xsqlite3ErrorWithMsg(tls, db, SQLITE_ERROR, ts+23687 /* "unknown database..." */, libc.VaList(bp, zDb))
} else {
(*Sqlite3)(unsafe.Pointer(db)).FbusyHandler.FnBusy = 0
rc = Xsqlite3Checkpoint(tls, db, iDb, eMode, pnLog, pnCkpt)
@@ -146860,7 +149014,7 @@ func Xsqlite3_wal_checkpoint_v2(tls *libc.TLS, db uintptr, zDb uintptr, eMode in
// If there are no active statements, clear the interrupt flag at this
// point.
if (*Sqlite3)(unsafe.Pointer(db)).FnVdbeActive == 0 {
- libc.AtomicStoreNInt32((db + 288 /* &.u1 */ /* &.isInterrupted */), int32(0), 0)
+ libc.AtomicStoreNInt32(db+312, int32(0), 0)
}
Xsqlite3_mutex_leave(tls, (*Sqlite3)(unsafe.Pointer(db)).Fmutex)
@@ -146870,7 +149024,7 @@ func Xsqlite3_wal_checkpoint_v2(tls *libc.TLS, db uintptr, zDb uintptr, eMode in
// Checkpoint database zDb. If zDb is NULL, or if the buffer zDb points
// to contains a zero-length string, all attached databases are
// checkpointed.
-func Xsqlite3_wal_checkpoint(tls *libc.TLS, db uintptr, zDb uintptr) int32 { /* sqlite3.c:167513:16: */
+func Xsqlite3_wal_checkpoint(tls *libc.TLS, db uintptr, zDb uintptr) int32 { /* sqlite3.c:169037:16: */
// EVIDENCE-OF: R-41613-20553 The sqlite3_wal_checkpoint(D,X) is equivalent to
// sqlite3_wal_checkpoint_v2(D,X,SQLITE_CHECKPOINT_PASSIVE,0,0).
return Xsqlite3_wal_checkpoint_v2(tls, db, zDb, SQLITE_CHECKPOINT_PASSIVE, uintptr(0), uintptr(0))
@@ -146894,15 +149048,15 @@ func Xsqlite3_wal_checkpoint(tls *libc.TLS, db uintptr, zDb uintptr) int32 { /*
//
// Parameter eMode is one of SQLITE_CHECKPOINT_PASSIVE, FULL, RESTART
// or TRUNCATE.
-func Xsqlite3Checkpoint(tls *libc.TLS, db uintptr, iDb int32, eMode int32, pnLog uintptr, pnCkpt uintptr) int32 { /* sqlite3.c:167540:20: */
+func Xsqlite3Checkpoint(tls *libc.TLS, db uintptr, iDb int32, eMode int32, pnLog uintptr, pnCkpt uintptr) int32 { /* sqlite3.c:169064:20: */
var rc int32 = SQLITE_OK // Return code
var i int32 // Used to iterate through attached dbs
var bBusy int32 = 0 // True if SQLITE_BUSY has been encountered
// See forum post a006d86f72
- for i = 0; (i < (*Sqlite3)(unsafe.Pointer(db)).FnDb) && (rc == SQLITE_OK); i++ {
- if (i == iDb) || (iDb == (SQLITE_MAX_ATTACHED + 2)) {
+ for i = 0; i < (*Sqlite3)(unsafe.Pointer(db)).FnDb && rc == SQLITE_OK; i++ {
+ if i == iDb || iDb == SQLITE_MAX_ATTACHED+2 {
rc = Xsqlite3BtreeCheckpoint(tls, (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+uintptr(i)*16)).FpBt, eMode, pnLog, pnCkpt)
pnLog = uintptr(0)
pnCkpt = uintptr(0)
@@ -146913,7 +149067,7 @@ func Xsqlite3Checkpoint(tls *libc.TLS, db uintptr, iDb int32, eMode int32, pnLog
}
}
- if (rc == SQLITE_OK) && (bBusy != 0) {
+ if rc == SQLITE_OK && bBusy != 0 {
return SQLITE_BUSY
}
return rc
@@ -146936,19 +149090,19 @@ func Xsqlite3Checkpoint(tls *libc.TLS, db uintptr, iDb int32, eMode int32, pnLog
// 2 2 memory (return 1)
// 2 0 memory (return 1)
// 3 any memory (return 1)
-func Xsqlite3TempInMemory(tls *libc.TLS, db uintptr) int32 { /* sqlite3.c:167586:20: */
- return (libc.Bool32(int32((*Sqlite3)(unsafe.Pointer(db)).Ftemp_store) == 2))
+func Xsqlite3TempInMemory(tls *libc.TLS, db uintptr) int32 { /* sqlite3.c:169110:20: */
+ return libc.Bool32(int32((*Sqlite3)(unsafe.Pointer(db)).Ftemp_store) == 2)
}
// Return UTF-8 encoded English language explanation of the most recent
// error.
-func Xsqlite3_errmsg(tls *libc.TLS, db uintptr) uintptr { /* sqlite3.c:167607:23: */
+func Xsqlite3_errmsg(tls *libc.TLS, db uintptr) uintptr { /* sqlite3.c:169131:23: */
var z uintptr
if !(db != 0) {
return Xsqlite3ErrStr(tls, SQLITE_NOMEM)
}
if !(Xsqlite3SafetyCheckSickOrOk(tls, db) != 0) {
- return Xsqlite3ErrStr(tls, Xsqlite3MisuseError(tls, 167613))
+ return Xsqlite3ErrStr(tls, Xsqlite3MisuseError(tls, 169137))
}
Xsqlite3_mutex_enter(tls, (*Sqlite3)(unsafe.Pointer(db)).Fmutex)
if (*Sqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 {
@@ -146971,7 +149125,7 @@ func Xsqlite3_errmsg(tls *libc.TLS, db uintptr) uintptr { /* sqlite3.c:167607:23
// Return UTF-16 encoded English language explanation of the most recent
// error.
-func Xsqlite3_errmsg16(tls *libc.TLS, db uintptr) uintptr { /* sqlite3.c:167635:23: */
+func Xsqlite3_errmsg16(tls *libc.TLS, db uintptr) uintptr { /* sqlite3.c:169159:23: */
var z uintptr
if !(db != 0) {
return uintptr(uintptr(unsafe.Pointer(&outOfMem)))
@@ -147000,36 +149154,36 @@ func Xsqlite3_errmsg16(tls *libc.TLS, db uintptr) uintptr { /* sqlite3.c:167635:
var outOfMem = [14]U16{
U16('o'), U16('u'), U16('t'), U16(' '), U16('o'), U16('f'), U16(' '), U16('m'), U16('e'), U16('m'), U16('o'), U16('r'), U16('y'), U16(0),
-} /* sqlite3.c:167636:20 */
+} /* sqlite3.c:169160:20 */
var misuse = [34]U16{
U16('b'), U16('a'), U16('d'), U16(' '), U16('p'), U16('a'), U16('r'), U16('a'), U16('m'), U16('e'), U16('t'), U16('e'), U16('r'), U16(' '),
U16('o'), U16('r'), U16(' '), U16('o'), U16('t'), U16('h'), U16('e'), U16('r'), U16(' '), U16('A'), U16('P'), U16('I'), U16(' '),
U16('m'), U16('i'), U16('s'), U16('u'), U16('s'), U16('e'), U16(0),
-} /* sqlite3.c:167639:20 */
+} /* sqlite3.c:169163:20 */
// Return the most recent error code generated by an SQLite routine. If NULL is
// passed to this function, we assume a malloc() failed during sqlite3_open().
-func Xsqlite3_errcode(tls *libc.TLS, db uintptr) int32 { /* sqlite3.c:167677:16: */
- if (db != 0) && !(Xsqlite3SafetyCheckSickOrOk(tls, db) != 0) {
- return Xsqlite3MisuseError(tls, 167679)
+func Xsqlite3_errcode(tls *libc.TLS, db uintptr) int32 { /* sqlite3.c:169201:16: */
+ if db != 0 && !(Xsqlite3SafetyCheckSickOrOk(tls, db) != 0) {
+ return Xsqlite3MisuseError(tls, 169203)
}
- if !(db != 0) || ((*Sqlite3)(unsafe.Pointer(db)).FmallocFailed != 0) {
+ if !(db != 0) || (*Sqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 {
return SQLITE_NOMEM
}
- return ((*Sqlite3)(unsafe.Pointer(db)).FerrCode & (*Sqlite3)(unsafe.Pointer(db)).FerrMask)
+ return (*Sqlite3)(unsafe.Pointer(db)).FerrCode & (*Sqlite3)(unsafe.Pointer(db)).FerrMask
}
-func Xsqlite3_extended_errcode(tls *libc.TLS, db uintptr) int32 { /* sqlite3.c:167686:16: */
- if (db != 0) && !(Xsqlite3SafetyCheckSickOrOk(tls, db) != 0) {
- return Xsqlite3MisuseError(tls, 167688)
+func Xsqlite3_extended_errcode(tls *libc.TLS, db uintptr) int32 { /* sqlite3.c:169210:16: */
+ if db != 0 && !(Xsqlite3SafetyCheckSickOrOk(tls, db) != 0) {
+ return Xsqlite3MisuseError(tls, 169212)
}
- if !(db != 0) || ((*Sqlite3)(unsafe.Pointer(db)).FmallocFailed != 0) {
+ if !(db != 0) || (*Sqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 {
return SQLITE_NOMEM
}
return (*Sqlite3)(unsafe.Pointer(db)).FerrCode
}
-func Xsqlite3_system_errno(tls *libc.TLS, db uintptr) int32 { /* sqlite3.c:167695:16: */
+func Xsqlite3_system_errno(tls *libc.TLS, db uintptr) int32 { /* sqlite3.c:169219:16: */
if db != 0 {
return (*Sqlite3)(unsafe.Pointer(db)).FiSysErrno
}
@@ -147039,13 +149193,13 @@ func Xsqlite3_system_errno(tls *libc.TLS, db uintptr) int32 { /* sqlite3.c:16769
// Return a string that describes the kind of error specified in the
// argument. For now, this simply calls the internal sqlite3ErrStr()
// function.
-func Xsqlite3_errstr(tls *libc.TLS, rc int32) uintptr { /* sqlite3.c:167704:23: */
+func Xsqlite3_errstr(tls *libc.TLS, rc int32) uintptr { /* sqlite3.c:169228:23: */
return Xsqlite3ErrStr(tls, rc)
}
// Create a new collating function for database "db". The name is zName
// and the encoding is enc.
-func createCollation(tls *libc.TLS, db uintptr, zName uintptr, enc U8, pCtx uintptr, xCompare uintptr, xDel uintptr) int32 { /* sqlite3.c:167712:12: */
+func createCollation(tls *libc.TLS, db uintptr, zName uintptr, enc U8, pCtx uintptr, xCompare uintptr, xDel uintptr) int32 { /* sqlite3.c:169236:12: */
var pColl uintptr
var enc2 int32
@@ -147054,21 +149208,21 @@ func createCollation(tls *libc.TLS, db uintptr, zName uintptr, enc U8, pCtx uint
// SQLITE_UTF16NATIVE macro. SQLITE_UTF16 is not used internally.
enc2 = int32(enc)
- if (enc2 == SQLITE_UTF16) || (enc2 == SQLITE_UTF16_ALIGNED) {
+ if enc2 == SQLITE_UTF16 || enc2 == SQLITE_UTF16_ALIGNED {
enc2 = SQLITE_UTF16LE
}
- if (enc2 < SQLITE_UTF8) || (enc2 > SQLITE_UTF16BE) {
- return Xsqlite3MisuseError(tls, 167736)
+ if enc2 < SQLITE_UTF8 || enc2 > SQLITE_UTF16BE {
+ return Xsqlite3MisuseError(tls, 169260)
}
// Check if this call is removing or replacing an existing collation
// sequence. If so, and there are active VMs, return busy. If there
// are no active VMs, invalidate any pre-compiled statements.
pColl = Xsqlite3FindCollSeq(tls, db, U8(enc2), zName, 0)
- if (pColl != 0) && ((*CollSeq)(unsafe.Pointer(pColl)).FxCmp != 0) {
+ if pColl != 0 && (*CollSeq)(unsafe.Pointer(pColl)).FxCmp != 0 {
if (*Sqlite3)(unsafe.Pointer(db)).FnVdbeActive != 0 {
Xsqlite3ErrorWithMsg(tls, db, SQLITE_BUSY,
- ts+22411 /* "unable to delete..." */, 0)
+ ts+23708 /* "unable to delete..." */, 0)
return SQLITE_BUSY
}
Xsqlite3ExpirePreparedStatements(tls, db, 0)
@@ -147078,11 +149232,11 @@ func createCollation(tls *libc.TLS, db uintptr, zName uintptr, enc U8, pCtx uint
// then any copies made by synthCollSeq() need to be invalidated.
// Also, collation destructor - CollSeq.xDel() - function may need
// to be called.
- if (int32((*CollSeq)(unsafe.Pointer(pColl)).Fenc) & libc.CplInt32(SQLITE_UTF16_ALIGNED)) == enc2 {
- var aColl uintptr = Xsqlite3HashFind(tls, (db + 420 /* &.aCollSeq */), zName)
+ if int32((*CollSeq)(unsafe.Pointer(pColl)).Fenc)&libc.CplInt32(SQLITE_UTF16_ALIGNED) == enc2 {
+ var aColl uintptr = Xsqlite3HashFind(tls, db+444, zName)
var j int32
for j = 0; j < 3; j++ {
- var p uintptr = (aColl + uintptr(j)*20)
+ var p uintptr = aColl + uintptr(j)*20
if int32((*CollSeq)(unsafe.Pointer(p)).Fenc) == int32((*CollSeq)(unsafe.Pointer(pColl)).Fenc) {
if (*CollSeq)(unsafe.Pointer(p)).FxDel != 0 {
(*struct{ f func(*libc.TLS, uintptr) })(unsafe.Pointer(&struct{ uintptr }{(*CollSeq)(unsafe.Pointer(p)).FxDel})).f(tls, (*CollSeq)(unsafe.Pointer(p)).FpUser)
@@ -147100,7 +149254,7 @@ func createCollation(tls *libc.TLS, db uintptr, zName uintptr, enc U8, pCtx uint
(*CollSeq)(unsafe.Pointer(pColl)).FxCmp = xCompare
(*CollSeq)(unsafe.Pointer(pColl)).FpUser = pCtx
(*CollSeq)(unsafe.Pointer(pColl)).FxDel = xDel
- (*CollSeq)(unsafe.Pointer(pColl)).Fenc = (U8(enc2 | (int32(enc) & SQLITE_UTF16_ALIGNED)))
+ (*CollSeq)(unsafe.Pointer(pColl)).Fenc = U8(enc2 | int32(enc)&SQLITE_UTF16_ALIGNED)
Xsqlite3Error(tls, db, SQLITE_OK)
return SQLITE_OK
}
@@ -147121,7 +149275,7 @@ var aHardLimit = [12]int32{
SQLITE_MAX_VARIABLE_NUMBER, // IMP: R-38091-32352
SQLITE_MAX_TRIGGER_DEPTH,
SQLITE_MAX_WORKER_THREADS,
-} /* sqlite3.c:167789:18 */
+} /* sqlite3.c:169313:18 */
// Make sure the hard limits are set to reasonable values
@@ -147133,7 +149287,7 @@ var aHardLimit = [12]int32{
// A new lower limit does not shrink existing constructs.
// It merely prevents new constructs that exceed the limit
// from forming.
-func Xsqlite3_limit(tls *libc.TLS, db uintptr, limitId int32, newLimit int32) int32 { /* sqlite3.c:167852:16: */
+func Xsqlite3_limit(tls *libc.TLS, db uintptr, limitId int32, newLimit int32) int32 { /* sqlite3.c:169376:16: */
var oldLimit int32
// EVIDENCE-OF: R-30189-54097 For each limit category SQLITE_LIMIT_NAME
@@ -147141,15 +149295,15 @@ func Xsqlite3_limit(tls *libc.TLS, db uintptr, limitId int32, newLimit int32) in
// macro called SQLITE_MAX_NAME. (The "_LIMIT_" in the name is changed to
// "_MAX_".)
- if (limitId < 0) || (limitId >= (SQLITE_LIMIT_WORKER_THREADS + 1)) {
+ if limitId < 0 || limitId >= SQLITE_LIMIT_WORKER_THREADS+1 {
return -1
}
- oldLimit = *(*int32)(unsafe.Pointer((db + 112 /* &.aLimit */) + uintptr(limitId)*4))
+ oldLimit = *(*int32)(unsafe.Pointer(db + 120 + uintptr(limitId)*4))
if newLimit >= 0 { // IMP: R-52476-28732
if newLimit > aHardLimit[limitId] {
newLimit = aHardLimit[limitId] // IMP: R-51463-25634
}
- *(*int32)(unsafe.Pointer((db + 112 /* &.aLimit */) + uintptr(limitId)*4)) = newLimit
+ *(*int32)(unsafe.Pointer(db + 120 + uintptr(limitId)*4)) = newLimit
}
return oldLimit // IMP: R-53341-35419
}
@@ -147178,7 +149332,7 @@ func Xsqlite3_limit(tls *libc.TLS, db uintptr, limitId int32, newLimit int32) in
// may be set to point to a buffer containing an English language error
// message. It is the responsibility of the caller to eventually release
// this buffer by calling sqlite3_free().
-func Xsqlite3ParseUri(tls *libc.TLS, zDefaultVfs uintptr, zUri uintptr, pFlags uintptr, ppVfs uintptr, pzFile uintptr, pzErrMsg uintptr) int32 { /* sqlite3.c:167922:20: */
+func Xsqlite3ParseUri(tls *libc.TLS, zDefaultVfs uintptr, zUri uintptr, pFlags uintptr, ppVfs uintptr, pzFile uintptr, pzErrMsg uintptr) int32 { /* sqlite3.c:169446:20: */
bp := tls.Alloc(56)
defer tls.Free(56)
@@ -147209,24 +149363,24 @@ func Xsqlite3ParseUri(tls *libc.TLS, zDefaultVfs uintptr, zUri uintptr, pFlags u
zVfs = zDefaultVfs
nUri = Xsqlite3Strlen30(tls, zUri)
- if !(((((flags & uint32(SQLITE_OPEN_URI)) != 0) || // IMP: R-48725-32206
- (Xsqlite3Config.FbOpenUri != 0)) && // IMP: R-51689-46548
- (nUri >= 5)) && (libc.Xmemcmp(tls, zUri, ts+22479 /* "file:" */, uint32(5)) == 0)) {
+ if !((flags&uint32(SQLITE_OPEN_URI) != 0 ||
+ Xsqlite3Config.FbOpenUri != 0) &&
+ nUri >= 5 && libc.Xmemcmp(tls, zUri, ts+23776, uint32(5)) == 0) {
goto __1
} // Input character index
- iOut = 0 // Output character index
- nByte = (U64(nUri + 8)) // Bytes of space to allocate
+ iOut = 0 // Output character index
+ nByte = U64(nUri + 8) // Bytes of space to allocate
// Make sure the SQLITE_OPEN_URI flag is set to indicate to the VFS xOpen
// method that there may be extra parameters following the file-name.
- flags = flags | (uint32(SQLITE_OPEN_URI))
+ flags = flags | uint32(SQLITE_OPEN_URI)
iIn = 0
__3:
if !(iIn < nUri) {
goto __5
}
- nByte = nByte + (U64(libc.Bool32(int32(*(*uint8)(unsafe.Pointer(zUri + uintptr(iIn)))) == '&')))
+ nByte = nByte + U64(libc.Bool32(int32(*(*uint8)(unsafe.Pointer(zUri + uintptr(iIn)))) == '&'))
goto __4
__4:
iIn++
@@ -147235,7 +149389,7 @@ __4:
__5:
;
zFile = Xsqlite3_malloc64(tls, nByte)
- if !(!(zFile != 0)) {
+ if !!(zFile != 0) {
goto __6
}
return SQLITE_NOMEM
@@ -147247,23 +149401,23 @@ __6:
iIn = 5
// Discard the scheme and authority segments of the URI.
- if !((int32(*(*uint8)(unsafe.Pointer(zUri + 5))) == '/') && (int32(*(*uint8)(unsafe.Pointer(zUri + 6))) == '/')) {
+ if !(int32(*(*uint8)(unsafe.Pointer(zUri + 5))) == '/' && int32(*(*uint8)(unsafe.Pointer(zUri + 6))) == '/') {
goto __7
}
iIn = 7
__8:
- if !((*(*uint8)(unsafe.Pointer(zUri + uintptr(iIn))) != 0) && (int32(*(*uint8)(unsafe.Pointer(zUri + uintptr(iIn)))) != '/')) {
+ if !(*(*uint8)(unsafe.Pointer(zUri + uintptr(iIn))) != 0 && int32(*(*uint8)(unsafe.Pointer(zUri + uintptr(iIn)))) != '/') {
goto __9
}
iIn++
goto __8
__9:
;
- if !((iIn != 7) && ((iIn != 16) || (libc.Xmemcmp(tls, ts+22485 /* "localhost" */, (zUri+7), uint32(9)) != 0))) {
+ if !(iIn != 7 && (iIn != 16 || libc.Xmemcmp(tls, ts+23782, zUri+7, uint32(9)) != 0)) {
goto __10
}
- *(*uintptr)(unsafe.Pointer(pzErrMsg)) = Xsqlite3_mprintf(tls, ts+22495, /* "invalid uri auth..." */
- libc.VaList(bp, (iIn-7), (zUri+7)))
+ *(*uintptr)(unsafe.Pointer(pzErrMsg)) = Xsqlite3_mprintf(tls, ts+23792, /* "invalid uri auth..." */
+ libc.VaList(bp, iIn-7, zUri+7))
rc = SQLITE_ERROR
goto parse_uri_out
__10:
@@ -147282,17 +149436,17 @@ __7:
// 2: Parsing value section of a name=value query parameter.
eState = 0
__11:
- if !(((int32(libc.AssignUint8(&c, *(*uint8)(unsafe.Pointer(zUri + uintptr(iIn)))))) != 0) && (int32(c) != '#')) {
+ if !(int32(libc.AssignUint8(&c, *(*uint8)(unsafe.Pointer(zUri + uintptr(iIn))))) != 0 && int32(c) != '#') {
goto __12
}
iIn++
- if !(((int32(c) == '%') &&
- ((int32(Xsqlite3CtypeMap[uint8(*(*uint8)(unsafe.Pointer(zUri + uintptr(iIn))))]) & 0x08) != 0)) &&
- ((int32(Xsqlite3CtypeMap[uint8(*(*uint8)(unsafe.Pointer(zUri + uintptr((iIn + 1)))))]) & 0x08) != 0)) {
+ if !(int32(c) == '%' &&
+ int32(Xsqlite3CtypeMap[uint8(*(*uint8)(unsafe.Pointer(zUri + uintptr(iIn))))])&0x08 != 0 &&
+ int32(Xsqlite3CtypeMap[uint8(*(*uint8)(unsafe.Pointer(zUri + uintptr(iIn+1))))])&0x08 != 0) {
goto __13
}
- octet = (int32(Xsqlite3HexToInt(tls, int32(*(*uint8)(unsafe.Pointer(zUri + uintptr(libc.PostIncInt32(&iIn, 1))))))) << 4)
- octet = octet + (int32(Xsqlite3HexToInt(tls, int32(*(*uint8)(unsafe.Pointer(zUri + uintptr(libc.PostIncInt32(&iIn, 1))))))))
+ octet = int32(Xsqlite3HexToInt(tls, int32(*(*uint8)(unsafe.Pointer(zUri + uintptr(libc.PostIncInt32(&iIn, 1))))))) << 4
+ octet = octet + int32(Xsqlite3HexToInt(tls, int32(*(*uint8)(unsafe.Pointer(zUri + uintptr(libc.PostIncInt32(&iIn, 1)))))))
if !(octet == 0) {
goto __15
@@ -147302,10 +149456,10 @@ __11:
// value currently being parsed. So ignore the current character
// and skip to the next "?", "=" or "&", as appropriate.
__16:
- if !((((((int32(libc.AssignUint8(&c, *(*uint8)(unsafe.Pointer(zUri + uintptr(iIn)))))) != 0) && (int32(c) != '#')) &&
- ((eState != 0) || (int32(c) != '?'))) &&
- ((eState != 1) || ((int32(c) != '=') && (int32(c) != '&')))) &&
- ((eState != 2) || (int32(c) != '&'))) {
+ if !(int32(libc.AssignUint8(&c, *(*uint8)(unsafe.Pointer(zUri + uintptr(iIn))))) != 0 && int32(c) != '#' &&
+ (eState != 0 || int32(c) != '?') &&
+ (eState != 1 || int32(c) != '=' && int32(c) != '&') &&
+ (eState != 2 || int32(c) != '&')) {
goto __17
}
iIn++
@@ -147318,15 +149472,15 @@ __15:
c = uint8(octet)
goto __14
__13:
- if !((eState == 1) && ((int32(c) == '&') || (int32(c) == '='))) {
+ if !(eState == 1 && (int32(c) == '&' || int32(c) == '=')) {
goto __18
}
- if !(int32(*(*uint8)(unsafe.Pointer(zFile + uintptr((iOut - 1))))) == 0) {
+ if !(int32(*(*uint8)(unsafe.Pointer(zFile + uintptr(iOut-1)))) == 0) {
goto __20
}
// An empty option name. Ignore this option altogether.
__21:
- if !(((*(*uint8)(unsafe.Pointer(zUri + uintptr(iIn))) != 0) && (int32(*(*uint8)(unsafe.Pointer(zUri + uintptr(iIn)))) != '#')) && (int32(*(*uint8)(unsafe.Pointer(zUri + uintptr((iIn - 1))))) != '&')) {
+ if !(*(*uint8)(unsafe.Pointer(zUri + uintptr(iIn))) != 0 && int32(*(*uint8)(unsafe.Pointer(zUri + uintptr(iIn)))) != '#' && int32(*(*uint8)(unsafe.Pointer(zUri + uintptr(iIn-1)))) != '&') {
goto __22
}
iIn++
@@ -147348,7 +149502,7 @@ __24:
c = uint8(0)
goto __19
__18:
- if !(((eState == 0) && (int32(c) == '?')) || ((eState == 2) && (int32(c) == '&'))) {
+ if !(eState == 0 && int32(c) == '?' || eState == 2 && int32(c) == '&') {
goto __25
}
c = uint8(0)
@@ -147369,22 +149523,22 @@ __12:
*(*uint8)(unsafe.Pointer(zFile + uintptr(libc.PostIncInt32(&iOut, 1)))) = uint8(0)
__26:
;
- libc.Xmemset(tls, (zFile + uintptr(iOut)), 0, uint32(4)) // end-of-options + empty journal filenames
+ libc.Xmemset(tls, zFile+uintptr(iOut), 0, uint32(4)) // end-of-options + empty journal filenames
// Check if there were any options specified that should be interpreted
// here. Options that are interpreted here include "vfs" and those that
// correspond to flags that may be passed to the sqlite3_open_v2()
// method.
- zOpt = (zFile + uintptr((Xsqlite3Strlen30(tls, zFile) + 1)))
+ zOpt = zFile + uintptr(Xsqlite3Strlen30(tls, zFile)+1)
__27:
if !(*(*uint8)(unsafe.Pointer(zOpt)) != 0) {
goto __28
}
nOpt = Xsqlite3Strlen30(tls, zOpt)
- zVal = (zOpt + uintptr((nOpt + 1)))
+ zVal = zOpt + uintptr(nOpt+1)
nVal = Xsqlite3Strlen30(tls, zVal)
- if !((nOpt == 3) && (libc.Xmemcmp(tls, ts+22523 /* "vfs" */, zOpt, uint32(3)) == 0)) {
+ if !(nOpt == 3 && libc.Xmemcmp(tls, ts+23820, zOpt, uint32(3)) == 0) {
goto __29
}
zVfs = zVal
@@ -147395,25 +149549,25 @@ __29:
mask = 0
limit = 0
- if !((nOpt == 5) && (libc.Xmemcmp(tls, ts+22527 /* "cache" */, zOpt, uint32(5)) == 0)) {
+ if !(nOpt == 5 && libc.Xmemcmp(tls, ts+23824, zOpt, uint32(5)) == 0) {
goto __31
}
- mask = (SQLITE_OPEN_SHAREDCACHE | SQLITE_OPEN_PRIVATECACHE)
+ mask = SQLITE_OPEN_SHAREDCACHE | SQLITE_OPEN_PRIVATECACHE
aMode = uintptr(unsafe.Pointer(&aCacheMode))
limit = mask
- zModeType = ts + 22527 /* "cache" */
+ zModeType = ts + 23824 /* "cache" */
__31:
;
- if !((nOpt == 4) && (libc.Xmemcmp(tls, ts+22533 /* "mode" */, zOpt, uint32(4)) == 0)) {
+ if !(nOpt == 4 && libc.Xmemcmp(tls, ts+23830, zOpt, uint32(4)) == 0) {
goto __32
}
- mask = (((SQLITE_OPEN_READONLY | SQLITE_OPEN_READWRITE) |
- SQLITE_OPEN_CREATE) | SQLITE_OPEN_MEMORY)
+ mask = SQLITE_OPEN_READONLY | SQLITE_OPEN_READWRITE |
+ SQLITE_OPEN_CREATE | SQLITE_OPEN_MEMORY
aMode = uintptr(unsafe.Pointer(&aOpenMode))
- limit = (int32(uint32(mask) & flags))
- zModeType = ts + 2399 /* "access" */
+ limit = int32(uint32(mask) & flags)
+ zModeType = ts + 3210 /* "access" */
__32:
;
@@ -147427,7 +149581,7 @@ __34:
goto __36
}
z = (*OpenMode)(unsafe.Pointer(aMode + uintptr(i)*8)).Fz
- if !((nVal == Xsqlite3Strlen30(tls, z)) && (0 == libc.Xmemcmp(tls, zVal, z, uint32(nVal)))) {
+ if !(nVal == Xsqlite3Strlen30(tls, z) && 0 == libc.Xmemcmp(tls, zVal, z, uint32(nVal))) {
goto __37
}
mode = (*OpenMode)(unsafe.Pointer(aMode + uintptr(i)*8)).Fmode
@@ -147444,35 +149598,35 @@ __36:
if !(mode == 0) {
goto __38
}
- *(*uintptr)(unsafe.Pointer(pzErrMsg)) = Xsqlite3_mprintf(tls, ts+22538 /* "no such %s mode:..." */, libc.VaList(bp+16, zModeType, zVal))
+ *(*uintptr)(unsafe.Pointer(pzErrMsg)) = Xsqlite3_mprintf(tls, ts+23835 /* "no such %s mode:..." */, libc.VaList(bp+16, zModeType, zVal))
rc = SQLITE_ERROR
goto parse_uri_out
__38:
;
- if !((mode & libc.CplInt32(SQLITE_OPEN_MEMORY)) > limit) {
+ if !(mode&libc.CplInt32(SQLITE_OPEN_MEMORY) > limit) {
goto __39
}
- *(*uintptr)(unsafe.Pointer(pzErrMsg)) = Xsqlite3_mprintf(tls, ts+22558, /* "%s mode not allo..." */
+ *(*uintptr)(unsafe.Pointer(pzErrMsg)) = Xsqlite3_mprintf(tls, ts+23855, /* "%s mode not allo..." */
libc.VaList(bp+32, zModeType, zVal))
rc = SQLITE_PERM
goto parse_uri_out
__39:
;
- flags = ((flags & uint32(^mask)) | uint32(mode))
+ flags = flags&uint32(^mask) | uint32(mode)
__33:
;
__30:
;
- zOpt = (zVal + uintptr((nVal + 1)))
+ zOpt = zVal + uintptr(nVal+1)
goto __27
__28:
;
goto __2
__1:
- zFile = Xsqlite3_malloc64(tls, (uint64(nUri + 8)))
- if !(!(zFile != 0)) {
+ zFile = Xsqlite3_malloc64(tls, uint64(nUri+8))
+ if !!(zFile != 0) {
goto __40
}
return SQLITE_NOMEM
@@ -147486,8 +149640,8 @@ __40:
libc.Xmemcpy(tls, zFile, zUri, uint32(nUri))
__41:
;
- libc.Xmemset(tls, (zFile + uintptr(nUri)), 0, uint32(4))
- flags = flags & (libc.Uint32FromInt32(libc.CplInt32(SQLITE_OPEN_URI)))
+ libc.Xmemset(tls, zFile+uintptr(nUri), 0, uint32(4))
+ flags = flags & libc.Uint32FromInt32(libc.CplInt32(SQLITE_OPEN_URI))
__2:
;
@@ -147495,7 +149649,7 @@ __2:
if !(*(*uintptr)(unsafe.Pointer(ppVfs)) == uintptr(0)) {
goto __42
}
- *(*uintptr)(unsafe.Pointer(pzErrMsg)) = Xsqlite3_mprintf(tls, ts+22582 /* "no such vfs: %s" */, libc.VaList(bp+48, zVfs))
+ *(*uintptr)(unsafe.Pointer(pzErrMsg)) = Xsqlite3_mprintf(tls, ts+23879 /* "no such vfs: %s" */, libc.VaList(bp+48, zVfs))
rc = SQLITE_ERROR
__42:
;
@@ -147515,32 +149669,32 @@ __43:
type OpenMode = struct {
Fz uintptr
Fmode int32
-} /* sqlite3.c:168064:9 */
+} /* sqlite3.c:169588:9 */
var aCacheMode = [3]OpenMode{
- {Fz: ts + 22598 /* "shared" */, Fmode: SQLITE_OPEN_SHAREDCACHE},
- {Fz: ts + 22605 /* "private" */, Fmode: SQLITE_OPEN_PRIVATECACHE},
+ {Fz: ts + 23895 /* "shared" */, Fmode: SQLITE_OPEN_SHAREDCACHE},
+ {Fz: ts + 23902 /* "private" */, Fmode: SQLITE_OPEN_PRIVATECACHE},
{},
-} /* sqlite3.c:168073:34 */
+} /* sqlite3.c:169597:34 */
var aOpenMode = [5]OpenMode{
- {Fz: ts + 22613 /* "ro" */, Fmode: SQLITE_OPEN_READONLY},
- {Fz: ts + 22616 /* "rw" */, Fmode: SQLITE_OPEN_READWRITE},
- {Fz: ts + 22619 /* "rwc" */, Fmode: (SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE)},
- {Fz: ts + 15850 /* "memory" */, Fmode: SQLITE_OPEN_MEMORY},
+ {Fz: ts + 23910 /* "ro" */, Fmode: SQLITE_OPEN_READONLY},
+ {Fz: ts + 23913 /* "rw" */, Fmode: SQLITE_OPEN_READWRITE},
+ {Fz: ts + 23916 /* "rwc" */, Fmode: SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE},
+ {Fz: ts + 17060 /* "memory" */, Fmode: SQLITE_OPEN_MEMORY},
{},
-} /* sqlite3.c:168085:34 */
+} /* sqlite3.c:169609:34 */
// This routine does the core work of extracting URI parameters from a
// database filename for the sqlite3_uri_parameter() interface.
-func uriParameter(tls *libc.TLS, zFilename uintptr, zParam uintptr) uintptr { /* sqlite3.c:168159:19: */
- zFilename += (uintptr(Xsqlite3Strlen30(tls, zFilename) + 1))
- for *(*uint8)(unsafe.Pointer(zFilename)) != 0 {
+func uriParameter(tls *libc.TLS, zFilename uintptr, zParam uintptr) uintptr { /* sqlite3.c:169683:19: */
+ zFilename += uintptr(Xsqlite3Strlen30(tls, zFilename) + 1)
+ for zFilename != uintptr(0) && *(*uint8)(unsafe.Pointer(zFilename)) != 0 {
var x int32 = libc.Xstrcmp(tls, zFilename, zParam)
- zFilename += (uintptr(Xsqlite3Strlen30(tls, zFilename) + 1))
+ zFilename += uintptr(Xsqlite3Strlen30(tls, zFilename) + 1)
if x == 0 {
return zFilename
}
- zFilename += (uintptr(Xsqlite3Strlen30(tls, zFilename) + 1))
+ zFilename += uintptr(Xsqlite3Strlen30(tls, zFilename) + 1)
}
return uintptr(0)
}
@@ -147548,7 +149702,7 @@ func uriParameter(tls *libc.TLS, zFilename uintptr, zParam uintptr) uintptr { /*
// This routine does the work of opening a database on behalf of
// sqlite3_open() and sqlite3_open16(). The database filename "zFilename"
// is UTF-8 encoded.
-func openDatabase(tls *libc.TLS, zFilename uintptr, ppDb uintptr, flags uint32, zVfs uintptr) int32 { /* sqlite3.c:168177:12: */
+func openDatabase(tls *libc.TLS, zFilename uintptr, ppDb uintptr, flags uint32, zVfs uintptr) int32 { /* sqlite3.c:169701:12: */
bp := tls.Alloc(20)
defer tls.Free(20)
*(*uint32)(unsafe.Pointer(bp + 8)) = flags
@@ -147579,13 +149733,13 @@ __1:
isThreadsafe = 0
goto __3
__2:
- if !((*(*uint32)(unsafe.Pointer(bp + 8 /* flags */)) & uint32(SQLITE_OPEN_NOMUTEX)) != 0) {
+ if !(*(*uint32)(unsafe.Pointer(bp + 8))&uint32(SQLITE_OPEN_NOMUTEX) != 0) {
goto __4
}
isThreadsafe = 0
goto __5
__4:
- if !((*(*uint32)(unsafe.Pointer(bp + 8 /* flags */)) & uint32(SQLITE_OPEN_FULLMUTEX)) != 0) {
+ if !(*(*uint32)(unsafe.Pointer(bp + 8))&uint32(SQLITE_OPEN_FULLMUTEX) != 0) {
goto __6
}
isThreadsafe = 1
@@ -147599,7 +149753,7 @@ __5:
__3:
;
- if !((*(*uint32)(unsafe.Pointer(bp + 8 /* flags */)) & uint32(SQLITE_OPEN_PRIVATECACHE)) != 0) {
+ if !(*(*uint32)(unsafe.Pointer(bp + 8))&uint32(SQLITE_OPEN_PRIVATECACHE) != 0) {
goto __8
}
*(*uint32)(unsafe.Pointer(bp + 8 /* flags */)) &= libc.Uint32FromInt32(libc.CplInt32(SQLITE_OPEN_SHAREDCACHE))
@@ -147620,9 +149774,9 @@ __9:
// dealt with in the previous code block. Besides these, the only
// valid input flags for sqlite3_open_v2() are SQLITE_OPEN_READONLY,
// SQLITE_OPEN_READWRITE, SQLITE_OPEN_CREATE, SQLITE_OPEN_SHAREDCACHE,
- // SQLITE_OPEN_PRIVATECACHE, and some reserved bits. Silently mask
- // off all other flags.
- *(*uint32)(unsafe.Pointer(bp + 8 /* flags */)) &= libc.Uint32FromInt32(libc.CplInt32((((((((((((SQLITE_OPEN_DELETEONCLOSE | SQLITE_OPEN_EXCLUSIVE) | SQLITE_OPEN_MAIN_DB) | SQLITE_OPEN_TEMP_DB) | SQLITE_OPEN_TRANSIENT_DB) | SQLITE_OPEN_MAIN_JOURNAL) | SQLITE_OPEN_TEMP_JOURNAL) | SQLITE_OPEN_SUBJOURNAL) | SQLITE_OPEN_SUPER_JOURNAL) | SQLITE_OPEN_NOMUTEX) | SQLITE_OPEN_FULLMUTEX) | SQLITE_OPEN_WAL)))
+ // SQLITE_OPEN_PRIVATECACHE, SQLITE_OPEN_EXRESCODE, and some reserved
+ // bits. Silently mask off all other flags.
+ *(*uint32)(unsafe.Pointer(bp + 8 /* flags */)) &= libc.Uint32FromInt32(libc.CplInt32(SQLITE_OPEN_DELETEONCLOSE | SQLITE_OPEN_EXCLUSIVE | SQLITE_OPEN_MAIN_DB | SQLITE_OPEN_TEMP_DB | SQLITE_OPEN_TRANSIENT_DB | SQLITE_OPEN_MAIN_JOURNAL | SQLITE_OPEN_TEMP_JOURNAL | SQLITE_OPEN_SUBJOURNAL | SQLITE_OPEN_SUPER_JOURNAL | SQLITE_OPEN_NOMUTEX | SQLITE_OPEN_FULLMUTEX | SQLITE_OPEN_WAL))
// Allocate the sqlite data structure
db = Xsqlite3MallocZero(tls, uint64(unsafe.Sizeof(Sqlite3{})))
@@ -147653,45 +149807,37 @@ __14:
__12:
;
Xsqlite3_mutex_enter(tls, (*Sqlite3)(unsafe.Pointer(db)).Fmutex)
- (*Sqlite3)(unsafe.Pointer(db)).FerrMask = 0xff
+ (*Sqlite3)(unsafe.Pointer(db)).FerrMask = func() int32 {
+ if *(*uint32)(unsafe.Pointer(bp + 8))&uint32(SQLITE_OPEN_EXRESCODE) != uint32(0) {
+ return libc.Int32FromUint32(0xffffffff)
+ }
+ return 0xff
+ }()
(*Sqlite3)(unsafe.Pointer(db)).FnDb = 2
- (*Sqlite3)(unsafe.Pointer(db)).Fmagic = SQLITE_MAGIC_BUSY
- (*Sqlite3)(unsafe.Pointer(db)).FaDb = db + 448 /* &.aDbStatic */
+ (*Sqlite3)(unsafe.Pointer(db)).FeOpenState = U8(SQLITE_STATE_BUSY)
+ (*Sqlite3)(unsafe.Pointer(db)).FaDb = db + 472 /* &.aDbStatic */
(*Sqlite3)(unsafe.Pointer(db)).Flookaside.FbDisable = U32(1)
(*Sqlite3)(unsafe.Pointer(db)).Flookaside.Fsz = U16(0)
- libc.Xmemcpy(tls, db+112 /* &.aLimit */, uintptr(unsafe.Pointer(&aHardLimit)), uint32(unsafe.Sizeof([12]int32{})))
- *(*int32)(unsafe.Pointer((db + 112 /* &.aLimit */) + 11*4)) = SQLITE_DEFAULT_WORKER_THREADS
+ libc.Xmemcpy(tls, db+120, uintptr(unsafe.Pointer(&aHardLimit)), uint32(unsafe.Sizeof([12]int32{})))
+ *(*int32)(unsafe.Pointer(db + 120 + 11*4)) = SQLITE_DEFAULT_WORKER_THREADS
(*Sqlite3)(unsafe.Pointer(db)).FautoCommit = U8(1)
(*Sqlite3)(unsafe.Pointer(db)).FnextAutovac = int8(-1)
(*Sqlite3)(unsafe.Pointer(db)).FszMmap = Xsqlite3Config.FszMmap
(*Sqlite3)(unsafe.Pointer(db)).FnextPagesize = 0
- (*Sqlite3)(unsafe.Pointer(db)).FnMaxSorterMmap = 0x7FFFFFFF
- *(*U64)(unsafe.Pointer(db + 32 /* &.flags */)) |= (uint64(((((((uint32(SQLITE_ShortColNames |
- SQLITE_EnableTrigger)) |
- SQLITE_EnableView) |
- uint32(SQLITE_CacheSpill)) |
- uint32(SQLITE_TrustedSchema)) |
- // The SQLITE_DQS compile-time option determines the default settings
- // for SQLITE_DBCONFIG_DQS_DDL and SQLITE_DBCONFIG_DQS_DML.
- //
- // SQLITE_DQS SQLITE_DBCONFIG_DQS_DDL SQLITE_DBCONFIG_DQS_DML
- // ---------- ----------------------- -----------------------
- // undefined on on
- // 3 on on
- // 2 on off
- // 1 off on
- // 0 off off
- //
- // Legacy behavior is 3 (double-quoted string literals are allowed anywhere)
- // and so that is the default. But developers are encouranged to use
- // -DSQLITE_DQS=0 (best) or -DSQLITE_DQS=1 (second choice) if possible.
- uint32(SQLITE_DqsDML)) |
- uint32(SQLITE_DqsDDL)) |
+ (*Sqlite3)(unsafe.Pointer(db)).Finit.FazInit = uintptr(unsafe.Pointer(&Xsqlite3StdType)) // Any array of string ptrs will do
+ *(*U64)(unsafe.Pointer(db + 32)) |= uint64(uint32(SQLITE_ShortColNames|
+ SQLITE_EnableTrigger) |
+ SQLITE_EnableView |
+ uint32(SQLITE_CacheSpill) |
+ uint32(SQLITE_TrustedSchema) |
- uint32(SQLITE_AutoIndex)))
- Xsqlite3HashInit(tls, (db + 420 /* &.aCollSeq */))
- Xsqlite3HashInit(tls, (db + 376 /* &.aModule */))
+ uint32(SQLITE_DqsDML) |
+ uint32(SQLITE_DqsDDL) |
+
+ uint32(SQLITE_AutoIndex))
+ Xsqlite3HashInit(tls, db+444)
+ Xsqlite3HashInit(tls, db+400)
// Add the default collation sequence BINARY. BINARY works for both UTF-8
// and UTF-16, so add a version for each to avoid any unnecessary
@@ -147708,10 +149854,10 @@ __12:
createCollation(tls, db, uintptr(unsafe.Pointer(&Xsqlite3StrBINARY)), uint8(SQLITE_UTF16LE), uintptr(0), *(*uintptr)(unsafe.Pointer(&struct {
f func(*libc.TLS, uintptr, int32, uintptr, int32, uintptr) int32
}{binCollFunc})), uintptr(0))
- createCollation(tls, db, ts+20169 /* "NOCASE" */, uint8(SQLITE_UTF8), uintptr(0), *(*uintptr)(unsafe.Pointer(&struct {
+ createCollation(tls, db, ts+21466 /* "NOCASE" */, uint8(SQLITE_UTF8), uintptr(0), *(*uintptr)(unsafe.Pointer(&struct {
f func(*libc.TLS, uintptr, int32, uintptr, int32, uintptr) int32
}{nocaseCollatingFunc})), uintptr(0))
- createCollation(tls, db, ts+22623 /* "RTRIM" */, uint8(SQLITE_UTF8), uintptr(0), *(*uintptr)(unsafe.Pointer(&struct {
+ createCollation(tls, db, ts+23920 /* "RTRIM" */, uint8(SQLITE_UTF8), uintptr(0), *(*uintptr)(unsafe.Pointer(&struct {
f func(*libc.TLS, uintptr, int32, uintptr, int32, uintptr) int32
}{rtrimCollFunc})), uintptr(0))
if !((*Sqlite3)(unsafe.Pointer(db)).FmallocFailed != 0) {
@@ -147737,13 +149883,13 @@ __15:
// READONLY
// READWRITE
// READWRITE | CREATE
- if !(((int32(1) << (*(*uint32)(unsafe.Pointer(bp + 8 /* flags */)) & uint32(7))) & 0x46) == 0) {
+ if !(int32(1)<<(*(*uint32)(unsafe.Pointer(bp + 8))&uint32(7))&0x46 == 0) {
goto __16
}
- rc = Xsqlite3MisuseError(tls, 168382) // IMP: R-18321-05872
+ rc = Xsqlite3MisuseError(tls, 169914) // IMP: R-18321-05872
goto __17
__16:
- rc = Xsqlite3ParseUri(tls, zVfs, zFilename, bp+8 /* &flags */, (db /* &.pVfs */), bp+12 /* &zOpen */, bp+16 /* &zErrMsg */)
+ rc = Xsqlite3ParseUri(tls, zVfs, zFilename, bp+8 /* &flags */, db, bp+12 /* &zOpen */, bp+16 /* &zErrMsg */)
__17:
;
if !(rc != SQLITE_OK) {
@@ -147756,8 +149902,8 @@ __17:
__19:
;
Xsqlite3ErrorWithMsg(tls, db, rc, func() uintptr {
- if *(*uintptr)(unsafe.Pointer(bp + 16 /* zErrMsg */)) != 0 {
- return ts + 2790 /* "%s" */
+ if *(*uintptr)(unsafe.Pointer(bp + 16)) != 0 {
+ return ts + 3601 /* "%s" */
}
return uintptr(0)
}(), libc.VaList(bp, *(*uintptr)(unsafe.Pointer(bp + 16 /* zErrMsg */))))
@@ -147767,12 +149913,12 @@ __18:
;
// Open the backend database driver
- rc = Xsqlite3BtreeOpen(tls, (*Sqlite3)(unsafe.Pointer(db)).FpVfs, *(*uintptr)(unsafe.Pointer(bp + 12 /* zOpen */)), db, ((*Sqlite3)(unsafe.Pointer(db)).FaDb + 4 /* &.pBt */), 0,
- (int32(*(*uint32)(unsafe.Pointer(bp + 8 /* flags */)) | uint32(SQLITE_OPEN_MAIN_DB))))
+ rc = Xsqlite3BtreeOpen(tls, (*Sqlite3)(unsafe.Pointer(db)).FpVfs, *(*uintptr)(unsafe.Pointer(bp + 12 /* zOpen */)), db, (*Sqlite3)(unsafe.Pointer(db)).FaDb+4, 0,
+ int32(*(*uint32)(unsafe.Pointer(bp + 8))|uint32(SQLITE_OPEN_MAIN_DB)))
if !(rc != SQLITE_OK) {
goto __20
}
- if !(rc == (SQLITE_IOERR | (int32(12) << 8))) {
+ if !(rc == SQLITE_IOERR|int32(12)<<8) {
goto __21
}
rc = SQLITE_NOMEM
@@ -147784,10 +149930,10 @@ __20:
;
Xsqlite3BtreeEnter(tls, (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb)).FpBt)
(*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb)).FpSchema = Xsqlite3SchemaGet(tls, db, (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb)).FpBt)
- if !(!(int32((*Sqlite3)(unsafe.Pointer(db)).FmallocFailed) != 0)) {
+ if !!(int32((*Sqlite3)(unsafe.Pointer(db)).FmallocFailed) != 0) {
goto __22
}
- Xsqlite3SetTextEncoding(tls, db, (*Schema)(unsafe.Pointer((*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer((db))).FaDb)).FpSchema)).Fenc)
+ Xsqlite3SetTextEncoding(tls, db, (*Schema)(unsafe.Pointer((*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb)).FpSchema)).Fenc)
__22:
;
Xsqlite3BtreeLeave(tls, (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb)).FpBt)
@@ -147795,12 +149941,12 @@ __22:
// The default safety_level for the main database is FULL; for the temp
// database it is OFF. This matches the pager layer defaults.
- (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb)).FzDbSName = ts + 5458 /* "main" */
- (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb)).Fsafety_level = (U8(SQLITE_DEFAULT_SYNCHRONOUS + 1))
- (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb + 1*16)).FzDbSName = ts + 21625 /* "temp" */
+ (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb)).FzDbSName = ts + 6305 /* "main" */
+ (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb)).Fsafety_level = U8(SQLITE_DEFAULT_SYNCHRONOUS + 1)
+ (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb + 1*16)).FzDbSName = ts + 22922 /* "temp" */
(*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb + 1*16)).Fsafety_level = U8(PAGER_SYNCHRONOUS_OFF)
- (*Sqlite3)(unsafe.Pointer(db)).Fmagic = SQLITE_MAGIC_OPEN
+ (*Sqlite3)(unsafe.Pointer(db)).FeOpenState = U8(SQLITE_STATE_OPEN)
if !((*Sqlite3)(unsafe.Pointer(db)).FmallocFailed != 0) {
goto __23
}
@@ -147818,10 +149964,10 @@ __23:
// Load compiled-in extensions
i = 0
__24:
- if !((rc == SQLITE_OK) && (i < (int32(uint32(unsafe.Sizeof(sqlite3BuiltinExtensions)) / uint32(unsafe.Sizeof(uintptr(0))))))) {
+ if !(rc == SQLITE_OK && i < int32(uint32(unsafe.Sizeof(sqlite3BuiltinExtensions))/uint32(unsafe.Sizeof(uintptr(0))))) {
goto __26
}
- rc = (*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer((uintptr(unsafe.Pointer(&sqlite3BuiltinExtensions)) + uintptr(i)*4))))(tls, db)
+ rc = (*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3BuiltinExtensions)) + uintptr(i)*4)))(tls, db)
goto __25
__25:
i++
@@ -147873,7 +150019,7 @@ __30:
;
rc = Xsqlite3_errcode(tls, db)
- if !(rc == SQLITE_NOMEM) {
+ if !(rc&0xff == SQLITE_NOMEM) {
goto __31
}
Xsqlite3_close(tls, db)
@@ -147883,28 +150029,28 @@ __31:
if !(rc != SQLITE_OK) {
goto __33
}
- (*Sqlite3)(unsafe.Pointer(db)).Fmagic = U32(SQLITE_MAGIC_SICK)
+ (*Sqlite3)(unsafe.Pointer(db)).FeOpenState = U8(SQLITE_STATE_SICK)
__33:
;
__32:
;
*(*uintptr)(unsafe.Pointer(ppDb)) = db
Xsqlite3_free_filename(tls, *(*uintptr)(unsafe.Pointer(bp + 12 /* zOpen */)))
- return (rc & 0xff)
+ return rc
}
// Open a new database handle.
-func Xsqlite3_open(tls *libc.TLS, zFilename uintptr, ppDb uintptr) int32 { /* sqlite3.c:168504:16: */
+func Xsqlite3_open(tls *libc.TLS, zFilename uintptr, ppDb uintptr) int32 { /* sqlite3.c:170036:16: */
return openDatabase(tls, zFilename, ppDb,
- (uint32(SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE)), uintptr(0))
+ uint32(SQLITE_OPEN_READWRITE|SQLITE_OPEN_CREATE), uintptr(0))
}
-func Xsqlite3_open_v2(tls *libc.TLS, filename uintptr, ppDb uintptr, flags int32, zVfs uintptr) int32 { /* sqlite3.c:168511:16: */
+func Xsqlite3_open_v2(tls *libc.TLS, filename uintptr, ppDb uintptr, flags int32, zVfs uintptr) int32 { /* sqlite3.c:170043:16: */
return openDatabase(tls, filename, ppDb, uint32(flags), zVfs)
}
// Open a new database handle.
-func Xsqlite3_open16(tls *libc.TLS, zFilename uintptr, ppDb uintptr) int32 { /* sqlite3.c:168524:16: */
+func Xsqlite3_open16(tls *libc.TLS, zFilename uintptr, ppDb uintptr) int32 { /* sqlite3.c:170056:16: */
var zFilename8 uintptr // zFilename encoded in UTF-8 instead of UTF-16
var pVal uintptr
var rc int32
@@ -147915,33 +150061,33 @@ func Xsqlite3_open16(tls *libc.TLS, zFilename uintptr, ppDb uintptr) int32 { /*
return rc
}
if zFilename == uintptr(0) {
- zFilename = ts + 22629 /* "\x00\x00" */
+ zFilename = ts + 23926 /* "\x00\x00" */
}
pVal = Xsqlite3ValueNew(tls, uintptr(0))
Xsqlite3ValueSetStr(tls, pVal, -1, zFilename, uint8(SQLITE_UTF16LE), uintptr(0))
zFilename8 = Xsqlite3ValueText(tls, pVal, uint8(SQLITE_UTF8))
if zFilename8 != 0 {
rc = openDatabase(tls, zFilename8, ppDb,
- (uint32(SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE)), uintptr(0))
+ uint32(SQLITE_OPEN_READWRITE|SQLITE_OPEN_CREATE), uintptr(0))
- if (rc == SQLITE_OK) && !((int32((*Schema)(unsafe.Pointer((*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(ppDb))))).FaDb)).FpSchema)).FschemaFlags) & (DB_SchemaLoaded)) == (DB_SchemaLoaded)) {
- ((*Schema)(unsafe.Pointer((*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(ppDb))))).FaDb)).FpSchema)).Fenc) = libc.AssignPtrUint8(*(*uintptr)(unsafe.Pointer(ppDb))+80 /* &.enc */, U8(SQLITE_UTF16LE))
+ if rc == SQLITE_OK && !(int32((*Schema)(unsafe.Pointer((*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(ppDb)))).FaDb)).FpSchema)).FschemaFlags)&DB_SchemaLoaded == DB_SchemaLoaded) {
+ (*Schema)(unsafe.Pointer((*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(ppDb)))).FaDb)).FpSchema)).Fenc = libc.AssignPtrUint8(*(*uintptr)(unsafe.Pointer(ppDb))+80, U8(SQLITE_UTF16LE))
}
} else {
rc = SQLITE_NOMEM
}
Xsqlite3ValueFree(tls, pVal)
- return (rc & 0xff)
+ return rc & 0xff
}
// Register a new collation sequence with the database handle db.
-func Xsqlite3_create_collation(tls *libc.TLS, db uintptr, zName uintptr, enc int32, pCtx uintptr, xCompare uintptr) int32 { /* sqlite3.c:168563:16: */
+func Xsqlite3_create_collation(tls *libc.TLS, db uintptr, zName uintptr, enc int32, pCtx uintptr, xCompare uintptr) int32 { /* sqlite3.c:170095:16: */
return Xsqlite3_create_collation_v2(tls, db, zName, enc, pCtx, xCompare, uintptr(0))
}
// Register a new collation sequence with the database handle db.
-func Xsqlite3_create_collation_v2(tls *libc.TLS, db uintptr, zName uintptr, enc int32, pCtx uintptr, xCompare uintptr, xDel uintptr) int32 { /* sqlite3.c:168576:16: */
+func Xsqlite3_create_collation_v2(tls *libc.TLS, db uintptr, zName uintptr, enc int32, pCtx uintptr, xCompare uintptr, xDel uintptr) int32 { /* sqlite3.c:170108:16: */
var rc int32
Xsqlite3_mutex_enter(tls, (*Sqlite3)(unsafe.Pointer(db)).Fmutex)
@@ -147953,7 +150099,7 @@ func Xsqlite3_create_collation_v2(tls *libc.TLS, db uintptr, zName uintptr, enc
}
// Register a new collation sequence with the database handle db.
-func Xsqlite3_create_collation16(tls *libc.TLS, db uintptr, zName uintptr, enc int32, pCtx uintptr, xCompare uintptr) int32 { /* sqlite3.c:168601:16: */
+func Xsqlite3_create_collation16(tls *libc.TLS, db uintptr, zName uintptr, enc int32, pCtx uintptr, xCompare uintptr) int32 { /* sqlite3.c:170133:16: */
var rc int32 = SQLITE_OK
var zName8 uintptr
@@ -147971,7 +150117,7 @@ func Xsqlite3_create_collation16(tls *libc.TLS, db uintptr, zName uintptr, enc i
// Register a collation sequence factory callback with the database handle
// db. Replace any previously installed collation sequence factory.
-func Xsqlite3_collation_needed(tls *libc.TLS, db uintptr, pCollNeededArg uintptr, xCollNeeded uintptr) int32 { /* sqlite3.c:168631:16: */
+func Xsqlite3_collation_needed(tls *libc.TLS, db uintptr, pCollNeededArg uintptr, xCollNeeded uintptr) int32 { /* sqlite3.c:170163:16: */
Xsqlite3_mutex_enter(tls, (*Sqlite3)(unsafe.Pointer(db)).Fmutex)
(*Sqlite3)(unsafe.Pointer(db)).FxCollNeeded = xCollNeeded
(*Sqlite3)(unsafe.Pointer(db)).FxCollNeeded16 = uintptr(0)
@@ -147982,7 +150128,7 @@ func Xsqlite3_collation_needed(tls *libc.TLS, db uintptr, pCollNeededArg uintptr
// Register a collation sequence factory callback with the database handle
// db. Replace any previously installed collation sequence factory.
-func Xsqlite3_collation_needed16(tls *libc.TLS, db uintptr, pCollNeededArg uintptr, xCollNeeded16 uintptr) int32 { /* sqlite3.c:168652:16: */
+func Xsqlite3_collation_needed16(tls *libc.TLS, db uintptr, pCollNeededArg uintptr, xCollNeeded16 uintptr) int32 { /* sqlite3.c:170184:16: */
Xsqlite3_mutex_enter(tls, (*Sqlite3)(unsafe.Pointer(db)).Fmutex)
(*Sqlite3)(unsafe.Pointer(db)).FxCollNeeded = uintptr(0)
(*Sqlite3)(unsafe.Pointer(db)).FxCollNeeded16 = xCollNeeded16
@@ -147993,7 +150139,7 @@ func Xsqlite3_collation_needed16(tls *libc.TLS, db uintptr, pCollNeededArg uintp
// This function is now an anachronism. It used to be used to recover from a
// malloc() failure, but SQLite now does this automatically.
-func Xsqlite3_global_recover(tls *libc.TLS) int32 { /* sqlite3.c:168674:16: */
+func Xsqlite3_global_recover(tls *libc.TLS) int32 { /* sqlite3.c:170206:16: */
return SQLITE_OK
}
@@ -148001,7 +150147,7 @@ func Xsqlite3_global_recover(tls *libc.TLS) int32 { /* sqlite3.c:168674:16: */
// mode. Return TRUE if it is and FALSE if not. Autocommit mode is on
// by default. Autocommit is disabled by a BEGIN statement and reenabled
// by the next COMMIT or ROLLBACK.
-func Xsqlite3_get_autocommit(tls *libc.TLS, db uintptr) int32 { /* sqlite3.c:168685:16: */
+func Xsqlite3_get_autocommit(tls *libc.TLS, db uintptr) int32 { /* sqlite3.c:170217:16: */
return int32((*Sqlite3)(unsafe.Pointer(db)).FautoCommit)
}
@@ -148014,28 +150160,28 @@ func Xsqlite3_get_autocommit(tls *libc.TLS, db uintptr) int32 { /* sqlite3.c:168
//
// 2. Invoke sqlite3_log() to provide the source code location where
// a low-level error is first detected.
-func Xsqlite3ReportError(tls *libc.TLS, iErr int32, lineno int32, zType uintptr) int32 { /* sqlite3.c:168706:20: */
+func Xsqlite3ReportError(tls *libc.TLS, iErr int32, lineno int32, zType uintptr) int32 { /* sqlite3.c:170238:20: */
bp := tls.Alloc(24)
defer tls.Free(24)
- Xsqlite3_log(tls, iErr, ts+22632, /* "%s at line %d of..." */
- libc.VaList(bp, zType, lineno, (uintptr(20)+Xsqlite3_sourceid(tls))))
+ Xsqlite3_log(tls, iErr, ts+23929, /* "%s at line %d of..." */
+ libc.VaList(bp, zType, lineno, uintptr(20)+Xsqlite3_sourceid(tls)))
return iErr
}
-func Xsqlite3CorruptError(tls *libc.TLS, lineno int32) int32 { /* sqlite3.c:168711:20: */
+func Xsqlite3CorruptError(tls *libc.TLS, lineno int32) int32 { /* sqlite3.c:170243:20: */
- return Xsqlite3ReportError(tls, SQLITE_CORRUPT, lineno, ts+22657 /* "database corrupt..." */)
+ return Xsqlite3ReportError(tls, SQLITE_CORRUPT, lineno, ts+23954 /* "database corrupt..." */)
}
-func Xsqlite3MisuseError(tls *libc.TLS, lineno int32) int32 { /* sqlite3.c:168715:20: */
+func Xsqlite3MisuseError(tls *libc.TLS, lineno int32) int32 { /* sqlite3.c:170247:20: */
- return Xsqlite3ReportError(tls, SQLITE_MISUSE, lineno, ts+22677 /* "misuse" */)
+ return Xsqlite3ReportError(tls, SQLITE_MISUSE, lineno, ts+23974 /* "misuse" */)
}
-func Xsqlite3CantopenError(tls *libc.TLS, lineno int32) int32 { /* sqlite3.c:168719:20: */
+func Xsqlite3CantopenError(tls *libc.TLS, lineno int32) int32 { /* sqlite3.c:170251:20: */
- return Xsqlite3ReportError(tls, SQLITE_CANTOPEN, lineno, ts+22684 /* "cannot open file" */)
+ return Xsqlite3ReportError(tls, SQLITE_CANTOPEN, lineno, ts+23981 /* "cannot open file" */)
}
// This is a convenience routine that makes sure that all thread-specific
@@ -148043,12 +150189,12 @@ func Xsqlite3CantopenError(tls *libc.TLS, lineno int32) int32 { /* sqlite3.c:168
//
// SQLite no longer uses thread-specific data so this routine is now a
// no-op. It is retained for historical compatibility.
-func Xsqlite3_thread_cleanup(tls *libc.TLS) { /* sqlite3.c:168750:17: */
+func Xsqlite3_thread_cleanup(tls *libc.TLS) { /* sqlite3.c:170282:17: */
}
// Return meta information about a specific column of a database table.
// See comment in sqlite3.h (sqlite.h.in) for details.
-func Xsqlite3_table_column_metadata(tls *libc.TLS, db uintptr, zDbName uintptr, zTableName uintptr, zColumnName uintptr, pzDataType uintptr, pzCollSeq uintptr, pNotNull uintptr, pPrimaryKey uintptr, pAutoinc uintptr) int32 { /* sqlite3.c:168758:16: */
+func Xsqlite3_table_column_metadata(tls *libc.TLS, db uintptr, zDbName uintptr, zTableName uintptr, zColumnName uintptr, pzDataType uintptr, pzCollSeq uintptr, pNotNull uintptr, pPrimaryKey uintptr, pAutoinc uintptr) int32 { /* sqlite3.c:170290:16: */
bp := tls.Alloc(28)
defer tls.Free(28)
@@ -148086,7 +150232,7 @@ __1:
// Locate the table in question
pTab = Xsqlite3FindTable(tls, db, zTableName, zDbName)
- if !(!(pTab != 0) || ((*Table)(unsafe.Pointer(pTab)).FpSelect != 0)) {
+ if !(!(pTab != 0) || int32((*Table)(unsafe.Pointer(pTab)).FeTabType) == TABTYP_VIEW) {
goto __2
}
pTab = uintptr(0)
@@ -148106,8 +150252,8 @@ __5:
if !(iCol < int32((*Table)(unsafe.Pointer(pTab)).FnCol)) {
goto __7
}
- pCol = ((*Table)(unsafe.Pointer(pTab)).FaCol + uintptr(iCol)*20)
- if !(0 == Xsqlite3StrICmp(tls, (*Column)(unsafe.Pointer(pCol)).FzName, zColumnName)) {
+ pCol = (*Table)(unsafe.Pointer(pTab)).FaCol + uintptr(iCol)*16
+ if !(0 == Xsqlite3StrICmp(tls, (*Column)(unsafe.Pointer(pCol)).FzCnName, zColumnName)) {
goto __8
}
goto __7
@@ -148123,12 +150269,12 @@ __7:
if !(iCol == int32((*Table)(unsafe.Pointer(pTab)).FnCol)) {
goto __9
}
- if !((((*Table)(unsafe.Pointer((pTab))).FtabFlags & U32(TF_WithoutRowid)) == U32(0)) && (Xsqlite3IsRowid(tls, zColumnName) != 0)) {
+ if !((*Table)(unsafe.Pointer(pTab)).FtabFlags&U32(TF_WithoutRowid) == U32(0) && Xsqlite3IsRowid(tls, zColumnName) != 0) {
goto __10
}
iCol = int32((*Table)(unsafe.Pointer(pTab)).FiPKey)
if iCol >= 0 {
- pCol = ((*Table)(unsafe.Pointer(pTab)).FaCol + uintptr(iCol)*20)
+ pCol = (*Table)(unsafe.Pointer(pTab)).FaCol + uintptr(iCol)*16
} else {
pCol = uintptr(0)
}
@@ -148156,17 +150302,17 @@ __4:
goto __12
}
zDataType = Xsqlite3ColumnType(tls, pCol, uintptr(0))
- zCollSeq = (*Column)(unsafe.Pointer(pCol)).FzColl
- notnull = (libc.Bool32(int32((*Column)(unsafe.Pointer(pCol)).FnotNull) != 0))
- primarykey = (libc.Bool32((int32((*Column)(unsafe.Pointer(pCol)).FcolFlags) & COLFLAG_PRIMKEY) != 0))
- autoinc = (libc.Bool32((int32((*Table)(unsafe.Pointer(pTab)).FiPKey) == iCol) && (((*Table)(unsafe.Pointer(pTab)).FtabFlags & U32(TF_Autoincrement)) != U32(0))))
+ zCollSeq = Xsqlite3ColumnColl(tls, pCol)
+ notnull = libc.Bool32(int32(*(*uint8)(unsafe.Pointer(pCol + 4))&0xf>>0) != 0)
+ primarykey = libc.Bool32(int32((*Column)(unsafe.Pointer(pCol)).FcolFlags)&COLFLAG_PRIMKEY != 0)
+ autoinc = libc.Bool32(int32((*Table)(unsafe.Pointer(pTab)).FiPKey) == iCol && (*Table)(unsafe.Pointer(pTab)).FtabFlags&U32(TF_Autoincrement) != U32(0))
goto __13
__12:
- zDataType = ts + 11384 /* "INTEGER" */
+ zDataType = ts + 1090 /* "INTEGER" */
primarykey = 1
__13:
;
- if !(!(zCollSeq != 0)) {
+ if !!(zCollSeq != 0) {
goto __14
}
zCollSeq = uintptr(unsafe.Pointer(&Xsqlite3StrBINARY))
@@ -148210,18 +150356,18 @@ __18:
__19:
;
- if !((SQLITE_OK == rc) && !(pTab != 0)) {
+ if !(SQLITE_OK == rc && !(pTab != 0)) {
goto __20
}
Xsqlite3DbFree(tls, db, *(*uintptr)(unsafe.Pointer(bp + 24 /* zErrMsg */)))
- *(*uintptr)(unsafe.Pointer(bp + 24 /* zErrMsg */)) = Xsqlite3MPrintf(tls, db, ts+22701 /* "no such table co..." */, libc.VaList(bp, zTableName,
+ *(*uintptr)(unsafe.Pointer(bp + 24 /* zErrMsg */)) = Xsqlite3MPrintf(tls, db, ts+23998 /* "no such table co..." */, libc.VaList(bp, zTableName,
zColumnName))
rc = SQLITE_ERROR
__20:
;
Xsqlite3ErrorWithMsg(tls, db, rc, func() uintptr {
- if *(*uintptr)(unsafe.Pointer(bp + 24 /* zErrMsg */)) != 0 {
- return ts + 2790 /* "%s" */
+ if *(*uintptr)(unsafe.Pointer(bp + 24)) != 0 {
+ return ts + 3601 /* "%s" */
}
return uintptr(0)
}(), libc.VaList(bp+16, *(*uintptr)(unsafe.Pointer(bp + 24 /* zErrMsg */))))
@@ -148232,7 +150378,7 @@ __20:
}
// Sleep for a little while. Return the amount of time slept.
-func Xsqlite3_sleep(tls *libc.TLS, ms int32) int32 { /* sqlite3.c:168876:16: */
+func Xsqlite3_sleep(tls *libc.TLS, ms int32) int32 { /* sqlite3.c:170408:16: */
var pVfs uintptr
var rc int32
pVfs = Xsqlite3_vfs_find(tls, uintptr(0))
@@ -148242,12 +150388,12 @@ func Xsqlite3_sleep(tls *libc.TLS, ms int32) int32 { /* sqlite3.c:168876:16: */
// This function works in milliseconds, but the underlying OsSleep()
// API uses microseconds. Hence the 1000's.
- rc = (Xsqlite3OsSleep(tls, pVfs, (1000*ms)) / 1000)
+ rc = Xsqlite3OsSleep(tls, pVfs, 1000*ms) / 1000
return rc
}
// Enable or disable the extended result codes.
-func Xsqlite3_extended_result_codes(tls *libc.TLS, db uintptr, onoff int32) int32 { /* sqlite3.c:168892:16: */
+func Xsqlite3_extended_result_codes(tls *libc.TLS, db uintptr, onoff int32) int32 { /* sqlite3.c:170424:16: */
Xsqlite3_mutex_enter(tls, (*Sqlite3)(unsafe.Pointer(db)).Fmutex)
(*Sqlite3)(unsafe.Pointer(db)).FerrMask = func() int32 {
if onoff != 0 {
@@ -148260,7 +150406,7 @@ func Xsqlite3_extended_result_codes(tls *libc.TLS, db uintptr, onoff int32) int3
}
// Invoke the xFileControl method on a particular database.
-func Xsqlite3_file_control(tls *libc.TLS, db uintptr, zDbName uintptr, op int32, pArg uintptr) int32 { /* sqlite3.c:168905:16: */
+func Xsqlite3_file_control(tls *libc.TLS, db uintptr, zDbName uintptr, op int32, pArg uintptr) int32 { /* sqlite3.c:170437:16: */
var rc int32 = SQLITE_ERROR
var pBtree uintptr
@@ -148289,7 +150435,7 @@ func Xsqlite3_file_control(tls *libc.TLS, db uintptr, zDbName uintptr, op int32,
} else if op == SQLITE_FCNTL_RESERVE_BYTES {
var iNew int32 = *(*int32)(unsafe.Pointer(pArg))
*(*int32)(unsafe.Pointer(pArg)) = Xsqlite3BtreeGetRequestedReserve(tls, pBtree)
- if (iNew >= 0) && (iNew <= 255) {
+ if iNew >= 0 && iNew <= 255 {
Xsqlite3BtreeSetPageSize(tls, pBtree, 0, iNew, 0)
}
rc = SQLITE_OK
@@ -148305,7 +150451,7 @@ func Xsqlite3_file_control(tls *libc.TLS, db uintptr, zDbName uintptr, op int32,
}
// Interface to the testing logic.
-func Xsqlite3_test_control(tls *libc.TLS, op int32, va uintptr) int32 { /* sqlite3.c:168955:16: */
+func Xsqlite3_test_control(tls *libc.TLS, op int32, va uintptr) int32 { /* sqlite3.c:170487:16: */
var rc int32 = 0
var ap Va_list
_ = ap
@@ -148355,7 +150501,7 @@ func Xsqlite3_test_control(tls *libc.TLS, op int32, va uintptr) int32 { /* sqlit
var y int32
var db uintptr = libc.VaUintptr(&ap)
- if (db != 0) && ((libc.AssignInt32(&y, (*Schema)(unsafe.Pointer((*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb)).FpSchema)).Fschema_cookie)) != 0) {
+ if db != 0 && libc.AssignInt32(&y, (*Schema)(unsafe.Pointer((*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb)).FpSchema)).Fschema_cookie) != 0 {
x = y
}
Xsqlite3Config.FiPrngSeed = uint32(x)
@@ -148501,7 +150647,7 @@ func Xsqlite3_test_control(tls *libc.TLS, op int32, va uintptr) int32 { /* sqlit
// 123410 little-endian, determined at compile-time
case SQLITE_TESTCTRL_BYTEORDER:
{
- rc = (((SQLITE_BYTEORDER * 100) + (SQLITE_LITTLEENDIAN * 10)) + SQLITE_BIGENDIAN)
+ rc = SQLITE_BYTEORDER*100 + SQLITE_LITTLEENDIAN*10 + SQLITE_BIGENDIAN
break
}
@@ -148540,7 +150686,7 @@ func Xsqlite3_test_control(tls *libc.TLS, op int32, va uintptr) int32 { /* sqlit
case SQLITE_TESTCTRL_INTERNAL_FUNCTIONS:
{
var db uintptr = libc.VaUintptr(&ap)
- *(*U32)(unsafe.Pointer(db + 24 /* &.mDbFlags */)) ^= (U32(DBFLAG_InternalFunc))
+ *(*U32)(unsafe.Pointer(db + 24)) ^= U32(DBFLAG_InternalFunc)
break
}
@@ -148640,9 +150786,9 @@ func Xsqlite3_test_control(tls *libc.TLS, op int32, va uintptr) int32 { /* sqlit
var db uintptr = libc.VaUintptr(&ap)
Xsqlite3_mutex_enter(tls, (*Sqlite3)(unsafe.Pointer(db)).Fmutex)
(*Sqlite3)(unsafe.Pointer(db)).Finit.FiDb = U8(Xsqlite3FindDbName(tls, db, libc.VaUintptr(&ap)))
- (*Sqlite3)(unsafe.Pointer(db)).Finit.Fbusy = U8(libc.AssignBitFieldPtr8Uint32(db+164 /* &.init */ +8 /* &.imposterTable */, uint32(libc.VaInt32(&ap)), 1, 1, 0x2))
+ (*Sqlite3)(unsafe.Pointer(db)).Finit.Fbusy = U8(libc.AssignBitFieldPtr8Uint32(db+172+8, uint32(libc.VaInt32(&ap)), 1, 1, 0x2))
(*Sqlite3)(unsafe.Pointer(db)).Finit.FnewTnum = Pgno(libc.VaInt32(&ap))
- if (int32((*Sqlite3)(unsafe.Pointer(db)).Finit.Fbusy) == 0) && ((*Sqlite3)(unsafe.Pointer(db)).Finit.FnewTnum > Pgno(0)) {
+ if int32((*Sqlite3)(unsafe.Pointer(db)).Finit.Fbusy) == 0 && (*Sqlite3)(unsafe.Pointer(db)).Finit.FnewTnum > Pgno(0) {
Xsqlite3ResetAllSchemasOfConnection(tls, db)
}
Xsqlite3_mutex_leave(tls, (*Sqlite3)(unsafe.Pointer(db)).Fmutex)
@@ -148727,8 +150873,8 @@ func Xsqlite3_test_control(tls *libc.TLS, op int32, va uintptr) int32 { /* sqlit
// backwards for the first byte following four consecutive zero bytes.
//
// This only works if the filename passed in was obtained from the Pager.
-func databaseName(tls *libc.TLS, zName uintptr) uintptr { /* sqlite3.c:169409:19: */
- for (((int32(*(*uint8)(unsafe.Pointer(zName + libc.UintptrFromInt32(-1)))) != 0) || (int32(*(*uint8)(unsafe.Pointer(zName + libc.UintptrFromInt32(-2)))) != 0)) || (int32(*(*uint8)(unsafe.Pointer(zName + libc.UintptrFromInt32(-3)))) != 0)) || (int32(*(*uint8)(unsafe.Pointer(zName + libc.UintptrFromInt32(-4)))) != 0) {
+func databaseName(tls *libc.TLS, zName uintptr) uintptr { /* sqlite3.c:170941:19: */
+ for int32(*(*uint8)(unsafe.Pointer(zName + libc.UintptrFromInt32(-1)))) != 0 || int32(*(*uint8)(unsafe.Pointer(zName + libc.UintptrFromInt32(-2)))) != 0 || int32(*(*uint8)(unsafe.Pointer(zName + libc.UintptrFromInt32(-3)))) != 0 || int32(*(*uint8)(unsafe.Pointer(zName + libc.UintptrFromInt32(-4)))) != 0 {
zName--
}
return zName
@@ -148736,10 +150882,10 @@ func databaseName(tls *libc.TLS, zName uintptr) uintptr { /* sqlite3.c:169409:19
// Append text z[] to the end of p[]. Return a pointer to the first
// character after then zero terminator on the new text in p[].
-func appendText(tls *libc.TLS, p uintptr, z uintptr) uintptr { /* sqlite3.c:169420:13: */
+func appendText(tls *libc.TLS, p uintptr, z uintptr) uintptr { /* sqlite3.c:170952:13: */
var n Size_t = libc.Xstrlen(tls, z)
- libc.Xmemcpy(tls, p, z, (n + Size_t(1)))
- return ((p + uintptr(n)) + uintptr(1))
+ libc.Xmemcpy(tls, p, z, n+Size_t(1))
+ return p + uintptr(n) + uintptr(1)
}
// Allocate memory to hold names for a database, journal file, WAL file,
@@ -148749,14 +150895,14 @@ func appendText(tls *libc.TLS, p uintptr, z uintptr) uintptr { /* sqlite3.c:1694
//
// Memory layout must be compatible with that generated by the pager
// and expected by sqlite3_uri_parameter() and databaseName().
-func Xsqlite3_create_filename(tls *libc.TLS, zDatabase uintptr, zJournal uintptr, zWal uintptr, nParam int32, azParam uintptr) uintptr { /* sqlite3.c:169435:17: */
+func Xsqlite3_create_filename(tls *libc.TLS, zDatabase uintptr, zJournal uintptr, zWal uintptr, nParam int32, azParam uintptr) uintptr { /* sqlite3.c:170967:17: */
var nByte Sqlite3_int64
var i int32
var pResult uintptr
var p uintptr
- nByte = (Sqlite3_int64(((libc.Xstrlen(tls, zDatabase) + libc.Xstrlen(tls, zJournal)) + libc.Xstrlen(tls, zWal)) + Size_t(10)))
- for i = 0; i < (nParam * 2); i++ {
- nByte = nByte + (Sqlite3_int64(libc.Xstrlen(tls, *(*uintptr)(unsafe.Pointer(azParam + uintptr(i)*4))) + Size_t(1)))
+ nByte = Sqlite3_int64(libc.Xstrlen(tls, zDatabase) + libc.Xstrlen(tls, zJournal) + libc.Xstrlen(tls, zWal) + Size_t(10))
+ for i = 0; i < nParam*2; i++ {
+ nByte = nByte + Sqlite3_int64(libc.Xstrlen(tls, *(*uintptr)(unsafe.Pointer(azParam + uintptr(i)*4)))+Size_t(1))
}
pResult = libc.AssignUintptr(&p, Xsqlite3_malloc64(tls, uint64(nByte)))
if p == uintptr(0) {
@@ -148765,7 +150911,7 @@ func Xsqlite3_create_filename(tls *libc.TLS, zDatabase uintptr, zJournal uintptr
libc.Xmemset(tls, p, 0, uint32(4))
p += uintptr(4)
p = appendText(tls, p, zDatabase)
- for i = 0; i < (nParam * 2); i++ {
+ for i = 0; i < nParam*2; i++ {
p = appendText(tls, p, *(*uintptr)(unsafe.Pointer(azParam + uintptr(i)*4)))
}
*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&p, 1))) = uint8(0)
@@ -148774,18 +150920,18 @@ func Xsqlite3_create_filename(tls *libc.TLS, zDatabase uintptr, zJournal uintptr
*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&p, 1))) = uint8(0)
*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&p, 1))) = uint8(0)
- return (pResult + uintptr(4))
+ return pResult + uintptr(4)
}
// Free memory obtained from sqlite3_create_filename(). It is a severe
// error to call this routine with any parameter other than a pointer
// previously obtained from sqlite3_create_filename() or a NULL pointer.
-func Xsqlite3_free_filename(tls *libc.TLS, p uintptr) { /* sqlite3.c:169471:17: */
+func Xsqlite3_free_filename(tls *libc.TLS, p uintptr) { /* sqlite3.c:171003:17: */
if p == uintptr(0) {
return
}
p = databaseName(tls, p)
- Xsqlite3_free(tls, (p - uintptr(4)))
+ Xsqlite3_free(tls, p-uintptr(4))
}
// This is a utility routine, useful to VFS implementations, that checks
@@ -148797,8 +150943,8 @@ func Xsqlite3_free_filename(tls *libc.TLS, p uintptr) { /* sqlite3.c:169471:17:
// query parameter we seek. This routine returns the value of the zParam
// parameter if it exists. If the parameter does not exist, this routine
// returns a NULL pointer.
-func Xsqlite3_uri_parameter(tls *libc.TLS, zFilename uintptr, zParam uintptr) uintptr { /* sqlite3.c:169489:23: */
- if (zFilename == uintptr(0)) || (zParam == uintptr(0)) {
+func Xsqlite3_uri_parameter(tls *libc.TLS, zFilename uintptr, zParam uintptr) uintptr { /* sqlite3.c:171021:23: */
+ if zFilename == uintptr(0) || zParam == uintptr(0) {
return uintptr(0)
}
zFilename = databaseName(tls, zFilename)
@@ -148806,15 +150952,15 @@ func Xsqlite3_uri_parameter(tls *libc.TLS, zFilename uintptr, zParam uintptr) ui
}
// Return a pointer to the name of Nth query parameter of the filename.
-func Xsqlite3_uri_key(tls *libc.TLS, zFilename uintptr, N int32) uintptr { /* sqlite3.c:169498:23: */
- if (zFilename == uintptr(0)) || (N < 0) {
+func Xsqlite3_uri_key(tls *libc.TLS, zFilename uintptr, N int32) uintptr { /* sqlite3.c:171030:23: */
+ if zFilename == uintptr(0) || N < 0 {
return uintptr(0)
}
zFilename = databaseName(tls, zFilename)
- zFilename += (uintptr(Xsqlite3Strlen30(tls, zFilename) + 1))
- for (*(*uint8)(unsafe.Pointer(zFilename)) != 0) && ((libc.PostDecInt32(&N, 1)) > 0) {
- zFilename += (uintptr(Xsqlite3Strlen30(tls, zFilename) + 1))
- zFilename += (uintptr(Xsqlite3Strlen30(tls, zFilename) + 1))
+ zFilename += uintptr(Xsqlite3Strlen30(tls, zFilename) + 1)
+ for zFilename != 0 && *(*uint8)(unsafe.Pointer(zFilename)) != 0 && libc.PostDecInt32(&N, 1) > 0 {
+ zFilename += uintptr(Xsqlite3Strlen30(tls, zFilename) + 1)
+ zFilename += uintptr(Xsqlite3Strlen30(tls, zFilename) + 1)
}
if *(*uint8)(unsafe.Pointer(zFilename)) != 0 {
return zFilename
@@ -148823,9 +150969,9 @@ func Xsqlite3_uri_key(tls *libc.TLS, zFilename uintptr, N int32) uintptr { /* sq
}
// Return a boolean value for a query parameter.
-func Xsqlite3_uri_boolean(tls *libc.TLS, zFilename uintptr, zParam uintptr, bDflt int32) int32 { /* sqlite3.c:169512:16: */
+func Xsqlite3_uri_boolean(tls *libc.TLS, zFilename uintptr, zParam uintptr, bDflt int32) int32 { /* sqlite3.c:171044:16: */
var z uintptr = Xsqlite3_uri_parameter(tls, zFilename, zParam)
- bDflt = (libc.Bool32(bDflt != 0))
+ bDflt = libc.Bool32(bDflt != 0)
if z != 0 {
return int32(Xsqlite3GetBoolean(tls, z, uint8(bDflt)))
}
@@ -148833,14 +150979,14 @@ func Xsqlite3_uri_boolean(tls *libc.TLS, zFilename uintptr, zParam uintptr, bDfl
}
// Return a 64-bit integer value for a query parameter.
-func Xsqlite3_uri_int64(tls *libc.TLS, zFilename uintptr, zParam uintptr, bDflt Sqlite3_int64) Sqlite3_int64 { /* sqlite3.c:169521:26: */
+func Xsqlite3_uri_int64(tls *libc.TLS, zFilename uintptr, zParam uintptr, bDflt Sqlite3_int64) Sqlite3_int64 { /* sqlite3.c:171053:26: */
bp := tls.Alloc(8)
defer tls.Free(8)
var z uintptr = Xsqlite3_uri_parameter(tls, zFilename, zParam)
// var v Sqlite3_int64 at bp, 8
- if (z != 0) && (Xsqlite3DecOrHexToI64(tls, z, bp /* &v */) == 0) {
+ if z != 0 && Xsqlite3DecOrHexToI64(tls, z, bp) == 0 {
bDflt = *(*Sqlite3_int64)(unsafe.Pointer(bp /* v */))
}
return bDflt
@@ -148854,28 +151000,36 @@ func Xsqlite3_uri_int64(tls *libc.TLS, zFilename uintptr, zParam uintptr, bDflt
// passing free() a pointer that was not obtained from malloc() - it is
// an error that we cannot easily detect but that will likely cause memory
// corruption.
-func Xsqlite3_filename_database(tls *libc.TLS, zFilename uintptr) uintptr { /* sqlite3.c:169544:23: */
+func Xsqlite3_filename_database(tls *libc.TLS, zFilename uintptr) uintptr { /* sqlite3.c:171076:23: */
+ if zFilename == uintptr(0) {
+ return uintptr(0)
+ }
return databaseName(tls, zFilename)
}
-func Xsqlite3_filename_journal(tls *libc.TLS, zFilename uintptr) uintptr { /* sqlite3.c:169547:23: */
+func Xsqlite3_filename_journal(tls *libc.TLS, zFilename uintptr) uintptr { /* sqlite3.c:171080:23: */
+ if zFilename == uintptr(0) {
+ return uintptr(0)
+ }
zFilename = databaseName(tls, zFilename)
- zFilename += (uintptr(Xsqlite3Strlen30(tls, zFilename) + 1))
- for *(*uint8)(unsafe.Pointer(zFilename)) != 0 {
- zFilename += (uintptr(Xsqlite3Strlen30(tls, zFilename) + 1))
- zFilename += (uintptr(Xsqlite3Strlen30(tls, zFilename) + 1))
+ zFilename += uintptr(Xsqlite3Strlen30(tls, zFilename) + 1)
+ for zFilename != 0 && *(*uint8)(unsafe.Pointer(zFilename)) != 0 {
+ zFilename += uintptr(Xsqlite3Strlen30(tls, zFilename) + 1)
+ zFilename += uintptr(Xsqlite3Strlen30(tls, zFilename) + 1)
}
- return (zFilename + uintptr(1))
+ return zFilename + uintptr(1)
}
-func Xsqlite3_filename_wal(tls *libc.TLS, zFilename uintptr) uintptr { /* sqlite3.c:169556:23: */
+func Xsqlite3_filename_wal(tls *libc.TLS, zFilename uintptr) uintptr { /* sqlite3.c:171090:23: */
zFilename = Xsqlite3_filename_journal(tls, zFilename)
- zFilename += (uintptr(Xsqlite3Strlen30(tls, zFilename) + 1))
+ if zFilename != 0 {
+ zFilename += uintptr(Xsqlite3Strlen30(tls, zFilename) + 1)
+ }
return zFilename
}
// Return the Btree pointer identified by zDbName. Return NULL if not found.
-func Xsqlite3DbNameToBtree(tls *libc.TLS, db uintptr, zDbName uintptr) uintptr { /* sqlite3.c:169569:22: */
+func Xsqlite3DbNameToBtree(tls *libc.TLS, db uintptr, zDbName uintptr) uintptr { /* sqlite3.c:171103:22: */
var iDb int32
if zDbName != 0 {
iDb = Xsqlite3FindDbName(tls, db, zDbName)
@@ -148890,7 +151044,7 @@ func Xsqlite3DbNameToBtree(tls *libc.TLS, db uintptr, zDbName uintptr) uintptr {
// Return the filename of the database associated with a database
// connection.
-func Xsqlite3_db_filename(tls *libc.TLS, db uintptr, zDbName uintptr) uintptr { /* sqlite3.c:169578:23: */
+func Xsqlite3_db_filename(tls *libc.TLS, db uintptr, zDbName uintptr) uintptr { /* sqlite3.c:171112:23: */
var pBt uintptr
pBt = Xsqlite3DbNameToBtree(tls, db, zDbName)
if pBt != 0 {
@@ -148901,7 +151055,7 @@ func Xsqlite3_db_filename(tls *libc.TLS, db uintptr, zDbName uintptr) uintptr {
// Return 1 if database is read-only or 0 if read/write. Return -1 if
// no such database exists.
-func Xsqlite3_db_readonly(tls *libc.TLS, db uintptr, zDbName uintptr) int32 { /* sqlite3.c:169594:16: */
+func Xsqlite3_db_readonly(tls *libc.TLS, db uintptr, zDbName uintptr) int32 { /* sqlite3.c:171128:16: */
var pBt uintptr
pBt = Xsqlite3DbNameToBtree(tls, db, zDbName)
if pBt != 0 {
@@ -148912,14 +151066,14 @@ func Xsqlite3_db_readonly(tls *libc.TLS, db uintptr, zDbName uintptr) int32 { /*
// Obtain a snapshot handle for the snapshot of database zDb currently
// being read by handle db.
-func Xsqlite3_snapshot_get(tls *libc.TLS, db uintptr, zDb uintptr, ppSnapshot uintptr) int32 { /* sqlite3.c:169611:16: */
+func Xsqlite3_snapshot_get(tls *libc.TLS, db uintptr, zDb uintptr, ppSnapshot uintptr) int32 { /* sqlite3.c:171145:16: */
var rc int32 = SQLITE_ERROR
Xsqlite3_mutex_enter(tls, (*Sqlite3)(unsafe.Pointer(db)).Fmutex)
if int32((*Sqlite3)(unsafe.Pointer(db)).FautoCommit) == 0 {
var iDb int32 = Xsqlite3FindDbName(tls, db, zDb)
- if (iDb == 0) || (iDb > 1) {
+ if iDb == 0 || iDb > 1 {
var pBt uintptr = (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*16)).FpBt
if SQLITE_TXN_WRITE != Xsqlite3BtreeTxnState(tls, pBt) {
rc = Xsqlite3BtreeBeginTrans(tls, pBt, 0, uintptr(0))
@@ -148935,14 +151089,14 @@ func Xsqlite3_snapshot_get(tls *libc.TLS, db uintptr, zDb uintptr, ppSnapshot ui
}
// Open a read-transaction on the snapshot idendified by pSnapshot.
-func Xsqlite3_snapshot_open(tls *libc.TLS, db uintptr, zDb uintptr, pSnapshot uintptr) int32 { /* sqlite3.c:169647:16: */
+func Xsqlite3_snapshot_open(tls *libc.TLS, db uintptr, zDb uintptr, pSnapshot uintptr) int32 { /* sqlite3.c:171181:16: */
var rc int32 = SQLITE_ERROR
Xsqlite3_mutex_enter(tls, (*Sqlite3)(unsafe.Pointer(db)).Fmutex)
if int32((*Sqlite3)(unsafe.Pointer(db)).FautoCommit) == 0 {
var iDb int32
iDb = Xsqlite3FindDbName(tls, db, zDb)
- if (iDb == 0) || (iDb > 1) {
+ if iDb == 0 || iDb > 1 {
var pBt uintptr = (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*16)).FpBt
if Xsqlite3BtreeTxnState(tls, pBt) != SQLITE_TXN_WRITE {
var pPager uintptr = Xsqlite3BtreePager(tls, pBt)
@@ -148978,13 +151132,13 @@ func Xsqlite3_snapshot_open(tls *libc.TLS, db uintptr, zDb uintptr, pSnapshot ui
// Recover as many snapshots as possible from the wal file associated with
// schema zDb of database db.
-func Xsqlite3_snapshot_recover(tls *libc.TLS, db uintptr, zDb uintptr) int32 { /* sqlite3.c:169703:16: */
+func Xsqlite3_snapshot_recover(tls *libc.TLS, db uintptr, zDb uintptr) int32 { /* sqlite3.c:171237:16: */
var rc int32 = SQLITE_ERROR
var iDb int32
Xsqlite3_mutex_enter(tls, (*Sqlite3)(unsafe.Pointer(db)).Fmutex)
iDb = Xsqlite3FindDbName(tls, db, zDb)
- if (iDb == 0) || (iDb > 1) {
+ if iDb == 0 || iDb > 1 {
var pBt uintptr = (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*16)).FpBt
if SQLITE_TXN_NONE == Xsqlite3BtreeTxnState(tls, pBt) {
rc = Xsqlite3BtreeBeginTrans(tls, pBt, 0, uintptr(0))
@@ -148999,7 +151153,7 @@ func Xsqlite3_snapshot_recover(tls *libc.TLS, db uintptr, zDb uintptr) int32 { /
}
// Free a snapshot handle obtained from sqlite3_snapshot_get().
-func Xsqlite3_snapshot_free(tls *libc.TLS, pSnapshot uintptr) { /* sqlite3.c:169734:17: */
+func Xsqlite3_snapshot_free(tls *libc.TLS, pSnapshot uintptr) { /* sqlite3.c:171268:17: */
Xsqlite3_free(tls, pSnapshot)
}
@@ -149008,7 +151162,7 @@ func Xsqlite3_snapshot_free(tls *libc.TLS, pSnapshot uintptr) { /* sqlite3.c:169
//
// The name can optionally begin with "SQLITE_" but the "SQLITE_" prefix
// is not required for a match.
-func Xsqlite3_compileoption_used(tls *libc.TLS, zOptName uintptr) int32 { /* sqlite3.c:169747:16: */
+func Xsqlite3_compileoption_used(tls *libc.TLS, zOptName uintptr) int32 { /* sqlite3.c:171281:16: */
bp := tls.Alloc(4)
defer tls.Free(4)
@@ -149020,7 +151174,7 @@ func Xsqlite3_compileoption_used(tls *libc.TLS, zOptName uintptr) int32 { /* sql
azCompileOpt = Xsqlite3CompileOptions(tls, bp /* &nOpt */)
- if Xsqlite3_strnicmp(tls, zOptName, ts+22729 /* "SQLITE_" */, 7) == 0 {
+ if Xsqlite3_strnicmp(tls, zOptName, ts+24026, 7) == 0 {
zOptName += uintptr(7)
}
n = Xsqlite3Strlen30(tls, zOptName)
@@ -149028,8 +151182,8 @@ func Xsqlite3_compileoption_used(tls *libc.TLS, zOptName uintptr) int32 { /* sql
// Since nOpt is normally in single digits, a linear search is
// adequate. No need for a binary search.
for i = 0; i < *(*int32)(unsafe.Pointer(bp /* nOpt */)); i++ {
- if (Xsqlite3_strnicmp(tls, zOptName, *(*uintptr)(unsafe.Pointer(azCompileOpt + uintptr(i)*4)), n) == 0) &&
- (Xsqlite3IsIdChar(tls, uint8(*(*uint8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(azCompileOpt + uintptr(i)*4)) + uintptr(n))))) == 0) {
+ if Xsqlite3_strnicmp(tls, zOptName, *(*uintptr)(unsafe.Pointer(azCompileOpt + uintptr(i)*4)), n) == 0 &&
+ Xsqlite3IsIdChar(tls, uint8(*(*uint8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(azCompileOpt + uintptr(i)*4)) + uintptr(n))))) == 0 {
return 1
}
}
@@ -149038,7 +151192,7 @@ func Xsqlite3_compileoption_used(tls *libc.TLS, zOptName uintptr) int32 { /* sql
// Return the N-th compile-time option string. If N is out of range,
// return a NULL pointer.
-func Xsqlite3_compileoption_get(tls *libc.TLS, N int32) uintptr { /* sqlite3.c:169780:23: */
+func Xsqlite3_compileoption_get(tls *libc.TLS, N int32) uintptr { /* sqlite3.c:171314:23: */
bp := tls.Alloc(4)
defer tls.Free(4)
@@ -149046,7 +151200,7 @@ func Xsqlite3_compileoption_get(tls *libc.TLS, N int32) uintptr { /* sqlite3.c:1
var azCompileOpt uintptr
azCompileOpt = Xsqlite3CompileOptions(tls, bp /* &nOpt */)
- if (N >= 0) && (N < *(*int32)(unsafe.Pointer(bp /* nOpt */))) {
+ if N >= 0 && N < *(*int32)(unsafe.Pointer(bp)) {
return *(*uintptr)(unsafe.Pointer(azCompileOpt + uintptr(N)*4))
}
return uintptr(0)
@@ -149083,14 +151237,14 @@ func Xsqlite3_compileoption_get(tls *libc.TLS, N int32) uintptr { /* sqlite3.c:1
// for which either sqlite3.pBlockingConnection or sqlite3.pUnlockConnection
// is not NULL. This variable may only accessed while the STATIC_MAIN
// mutex is held.
-var sqlite3BlockedList uintptr = uintptr(0) /* sqlite3.c:169832:16 */
+var sqlite3BlockedList uintptr = uintptr(0) /* sqlite3.c:171366:16 */
// Remove connection db from the blocked connections list. If connection
// db is not currently a part of the list, this function is a no-op.
-func removeFromBlockedList(tls *libc.TLS, db uintptr) { /* sqlite3.c:169875:13: */
+func removeFromBlockedList(tls *libc.TLS, db uintptr) { /* sqlite3.c:171409:13: */
var pp uintptr
- for pp = uintptr(unsafe.Pointer(&sqlite3BlockedList)); *(*uintptr)(unsafe.Pointer(pp)) != 0; pp = (*(*uintptr)(unsafe.Pointer(pp)) + 540 /* &.pNextBlocked */) {
+ for pp = uintptr(unsafe.Pointer(&sqlite3BlockedList)); *(*uintptr)(unsafe.Pointer(pp)) != 0; pp = *(*uintptr)(unsafe.Pointer(pp)) + 564 {
if *(*uintptr)(unsafe.Pointer(pp)) == db {
*(*uintptr)(unsafe.Pointer(pp)) = (*Sqlite3)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pp)))).FpNextBlocked
break
@@ -149100,23 +151254,23 @@ func removeFromBlockedList(tls *libc.TLS, db uintptr) { /* sqlite3.c:169875:13:
// Add connection db to the blocked connections list. It is assumed
// that it is not already a part of the list.
-func addToBlockedList(tls *libc.TLS, db uintptr) { /* sqlite3.c:169890:13: */
+func addToBlockedList(tls *libc.TLS, db uintptr) { /* sqlite3.c:171424:13: */
var pp uintptr
- for pp = uintptr(unsafe.Pointer(&sqlite3BlockedList)); (*(*uintptr)(unsafe.Pointer(pp)) != 0) && ((*Sqlite3)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(pp))))).FxUnlockNotify != (*Sqlite3)(unsafe.Pointer(db)).FxUnlockNotify); pp = (*(*uintptr)(unsafe.Pointer(pp)) + 540 /* &.pNextBlocked */) {
+ for pp = uintptr(unsafe.Pointer(&sqlite3BlockedList)); *(*uintptr)(unsafe.Pointer(pp)) != 0 && (*Sqlite3)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pp)))).FxUnlockNotify != (*Sqlite3)(unsafe.Pointer(db)).FxUnlockNotify; pp = *(*uintptr)(unsafe.Pointer(pp)) + 564 {
}
(*Sqlite3)(unsafe.Pointer(db)).FpNextBlocked = *(*uintptr)(unsafe.Pointer(pp))
*(*uintptr)(unsafe.Pointer(pp)) = db
}
// Obtain the STATIC_MAIN mutex.
-func enterMutex(tls *libc.TLS) { /* sqlite3.c:169905:13: */
+func enterMutex(tls *libc.TLS) { /* sqlite3.c:171439:13: */
Xsqlite3_mutex_enter(tls, Xsqlite3MutexAlloc(tls, SQLITE_MUTEX_STATIC_MAIN))
}
// Release the STATIC_MAIN mutex.
-func leaveMutex(tls *libc.TLS) { /* sqlite3.c:169913:13: */
+func leaveMutex(tls *libc.TLS) { /* sqlite3.c:171447:13: */
Xsqlite3_mutex_leave(tls, Xsqlite3MutexAlloc(tls, SQLITE_MUTEX_STATIC_MAIN))
}
@@ -149140,7 +151294,7 @@ func leaveMutex(tls *libc.TLS) { /* sqlite3.c:169913:13: */
// Each call to this routine overrides any prior callbacks registered
// on the same "db". If xNotify==0 then any prior callbacks are immediately
// cancelled.
-func Xsqlite3_unlock_notify(tls *libc.TLS, db uintptr, xNotify uintptr, pArg uintptr) int32 { /* sqlite3.c:169940:16: */
+func Xsqlite3_unlock_notify(tls *libc.TLS, db uintptr, xNotify uintptr, pArg uintptr) int32 { /* sqlite3.c:171474:16: */
bp := tls.Alloc(4)
defer tls.Free(4)
*(*uintptr)(unsafe.Pointer(bp)) = pArg
@@ -149166,7 +151320,7 @@ func Xsqlite3_unlock_notify(tls *libc.TLS, db uintptr, xNotify uintptr, pArg uin
} else {
var p uintptr
- for p = (*Sqlite3)(unsafe.Pointer(db)).FpBlockingConnection; (p != 0) && (p != db); p = (*Sqlite3)(unsafe.Pointer(p)).FpUnlockConnection {
+ for p = (*Sqlite3)(unsafe.Pointer(db)).FpBlockingConnection; p != 0 && p != db; p = (*Sqlite3)(unsafe.Pointer(p)).FpUnlockConnection {
}
if p != 0 {
rc = SQLITE_LOCKED // Deadlock detected.
@@ -149183,7 +151337,7 @@ func Xsqlite3_unlock_notify(tls *libc.TLS, db uintptr, xNotify uintptr, pArg uin
Xsqlite3ErrorWithMsg(tls, db, rc, func() uintptr {
if rc != 0 {
- return ts + 22737 /* "database is dead..." */
+ return ts + 24034 /* "database is dead..." */
}
return uintptr(0)
}(), 0)
@@ -149195,9 +151349,9 @@ func Xsqlite3_unlock_notify(tls *libc.TLS, db uintptr, xNotify uintptr, pArg uin
// associated with connection db. The operation will return SQLITE_LOCKED
// to the user because it requires a lock that will not be available
// until connection pBlocker concludes its current transaction.
-func Xsqlite3ConnectionBlocked(tls *libc.TLS, db uintptr, pBlocker uintptr) { /* sqlite3.c:169990:21: */
+func Xsqlite3ConnectionBlocked(tls *libc.TLS, db uintptr, pBlocker uintptr) { /* sqlite3.c:171524:21: */
enterMutex(tls)
- if ((*Sqlite3)(unsafe.Pointer(db)).FpBlockingConnection == uintptr(0)) && ((*Sqlite3)(unsafe.Pointer(db)).FpUnlockConnection == uintptr(0)) {
+ if (*Sqlite3)(unsafe.Pointer(db)).FpBlockingConnection == uintptr(0) && (*Sqlite3)(unsafe.Pointer(db)).FpUnlockConnection == uintptr(0) {
addToBlockedList(tls, db)
}
(*Sqlite3)(unsafe.Pointer(db)).FpBlockingConnection = pBlocker
@@ -149221,7 +151375,7 @@ func Xsqlite3ConnectionBlocked(tls *libc.TLS, db uintptr, pBlocker uintptr) { /*
// 3) If the two steps above mean that pBlockingConnection==0 and
// pUnlockConnection==0, remove the entry from the blocked connections
// list.
-func Xsqlite3ConnectionUnlocked(tls *libc.TLS, db uintptr) { /* sqlite3.c:170018:21: */
+func Xsqlite3ConnectionUnlocked(tls *libc.TLS, db uintptr) { /* sqlite3.c:171552:21: */
bp := tls.Alloc(64)
defer tls.Free(64)
@@ -149248,7 +151402,7 @@ func Xsqlite3ConnectionUnlocked(tls *libc.TLS, db uintptr) { /* sqlite3.c:170018
// Step 2.
if (*Sqlite3)(unsafe.Pointer(p)).FpUnlockConnection == db {
- if ((*Sqlite3)(unsafe.Pointer(p)).FxUnlockNotify != xUnlockNotify) && (nArg != 0) {
+ if (*Sqlite3)(unsafe.Pointer(p)).FxUnlockNotify != xUnlockNotify && nArg != 0 {
(*struct {
f func(*libc.TLS, uintptr, int32)
})(unsafe.Pointer(&struct{ uintptr }{xUnlockNotify})).f(tls, aArg, nArg)
@@ -149257,12 +151411,12 @@ func Xsqlite3ConnectionUnlocked(tls *libc.TLS, db uintptr) { /* sqlite3.c:170018
Xsqlite3BeginBenignMalloc(tls)
- if (!(aDyn != 0) && (nArg == (int32(uint32(unsafe.Sizeof([16]uintptr{})) / uint32(unsafe.Sizeof(uintptr(0))))))) ||
- ((aDyn != 0) && (nArg == (int32(uint32(Xsqlite3MallocSize(tls, aDyn)) / uint32(unsafe.Sizeof(uintptr(0))))))) {
+ if !(aDyn != 0) && nArg == int32(uint32(unsafe.Sizeof([16]uintptr{}))/uint32(unsafe.Sizeof(uintptr(0)))) ||
+ aDyn != 0 && nArg == int32(uint32(Xsqlite3MallocSize(tls, aDyn))/uint32(unsafe.Sizeof(uintptr(0)))) {
// The aArg[] array needs to grow.
- var pNew uintptr = Xsqlite3Malloc(tls, (uint64((uint32(nArg) * uint32(unsafe.Sizeof(uintptr(0)))) * uint32(2))))
+ var pNew uintptr = Xsqlite3Malloc(tls, uint64(uint32(nArg)*uint32(unsafe.Sizeof(uintptr(0)))*uint32(2)))
if pNew != 0 {
- libc.Xmemcpy(tls, pNew, aArg, (uint32(nArg) * uint32(unsafe.Sizeof(uintptr(0)))))
+ libc.Xmemcpy(tls, pNew, aArg, uint32(nArg)*uint32(unsafe.Sizeof(uintptr(0))))
Xsqlite3_free(tls, aDyn)
aDyn = libc.AssignUintptr(&aArg, pNew)
} else {
@@ -149305,12 +151459,12 @@ func Xsqlite3ConnectionUnlocked(tls *libc.TLS, db uintptr) { /* sqlite3.c:170018
}
// Step 3.
- if ((*Sqlite3)(unsafe.Pointer(p)).FpBlockingConnection == uintptr(0)) && ((*Sqlite3)(unsafe.Pointer(p)).FpUnlockConnection == uintptr(0)) {
+ if (*Sqlite3)(unsafe.Pointer(p)).FpBlockingConnection == uintptr(0) && (*Sqlite3)(unsafe.Pointer(p)).FpUnlockConnection == uintptr(0) {
// Remove connection p from the blocked connections list.
*(*uintptr)(unsafe.Pointer(pp)) = (*Sqlite3)(unsafe.Pointer(p)).FpNextBlocked
(*Sqlite3)(unsafe.Pointer(p)).FpNextBlocked = uintptr(0)
} else {
- pp = (p + 540 /* &.pNextBlocked */)
+ pp = p + 564
}
}
@@ -149325,7 +151479,7 @@ func Xsqlite3ConnectionUnlocked(tls *libc.TLS, db uintptr) { /* sqlite3.c:170018
// This is called when the database connection passed as an argument is
// being closed. The connection is removed from the blocked list.
-func Xsqlite3ConnectionClosed(tls *libc.TLS, db uintptr) { /* sqlite3.c:170117:21: */
+func Xsqlite3ConnectionClosed(tls *libc.TLS, db uintptr) { /* sqlite3.c:171651:21: */
Xsqlite3ConnectionUnlocked(tls, db)
enterMutex(tls)
removeFromBlockedList(tls, db)
@@ -149942,7 +152096,12 @@ var jsonIsSpace = [256]uint8{
uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0),
uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0),
uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0),
-} /* sqlite3.c:189706:19 */
+} /* sqlite3.c:191253:19 */
+
+// Some of the testcase() macros in this file are problematic for gcov
+// in that they generate false-miss errors randomly. This is a gcov problem,
+// not a problem in this case. But to work around it, we disable the
+// problematic test cases for production builds.
// Objects
type JsonString1 = struct {
@@ -149954,19 +152113,25 @@ type JsonString1 = struct {
FbErr U8
FzSpace [100]uint8
F__ccgo_pad1 [2]byte
-} /* sqlite3.c:189736:9 */
+} /* sqlite3.c:191310:9 */
+
+// Some of the testcase() macros in this file are problematic for gcov
+// in that they generate false-miss errors randomly. This is a gcov problem,
+// not a problem in this case. But to work around it, we disable the
+// problematic test cases for production builds.
// Objects
-type JsonString = JsonString1 /* sqlite3.c:189736:27 */
+type JsonString = JsonString1 /* sqlite3.c:191310:27 */
type JsonNode1 = struct {
FeType U8
FjnFlags U8
- F__ccgo_pad1 [2]byte
+ FeU U8
+ F__ccgo_pad1 [1]byte
Fn U32
Fu struct{ FzJContent uintptr }
-} /* sqlite3.c:189737:9 */
+} /* sqlite3.c:191311:9 */
-type JsonNode = JsonNode1 /* sqlite3.c:189737:25 */
+type JsonNode = JsonNode1 /* sqlite3.c:191311:25 */
type JsonParse1 = struct {
FnNode U32
FnAlloc U32
@@ -149978,9 +152143,9 @@ type JsonParse1 = struct {
FiDepth U16
FnJson int32
FiHold U32
-} /* sqlite3.c:189738:9 */
+} /* sqlite3.c:191312:9 */
-type JsonParse = JsonParse1 /* sqlite3.c:189738:26 */
+type JsonParse = JsonParse1 /* sqlite3.c:191312:26 */
// JSON type values
@@ -149988,8 +152153,8 @@ type JsonParse = JsonParse1 /* sqlite3.c:189738:26 */
// Names of the various JSON types:
var jsonType = [8]uintptr{
- ts + 5258 /* "null" */, ts + 5770 /* "true" */, ts + 5775 /* "false" */, ts + 5268 /* "integer" */, ts + 5263 /* "real" */, ts + 13523 /* "text" */, ts + 22760 /* "array" */, ts + 22766, /* "object" */
-} /* sqlite3.c:189771:19 */
+ ts + 6105 /* "null" */, ts + 6617 /* "true" */, ts + 6622 /* "false" */, ts + 6115 /* "integer" */, ts + 6110 /* "real" */, ts + 7872 /* "text" */, ts + 24057 /* "array" */, ts + 24063, /* "object" */
+} /* sqlite3.c:191345:19 */
// Maximum nesting depth of JSON for this implementation.
//
@@ -150003,7 +152168,7 @@ var jsonType = [8]uintptr{
//
// Set the JsonString object to an empty string
-func jsonZero(tls *libc.TLS, p uintptr) { /* sqlite3.c:189831:13: */
+func jsonZero(tls *libc.TLS, p uintptr) { /* sqlite3.c:191406:13: */
(*JsonString)(unsafe.Pointer(p)).FzBuf = p + 26 /* &.zSpace */
(*JsonString)(unsafe.Pointer(p)).FnAlloc = U64(unsafe.Sizeof([100]uint8{}))
(*JsonString)(unsafe.Pointer(p)).FnUsed = uint64(0)
@@ -150011,7 +152176,7 @@ func jsonZero(tls *libc.TLS, p uintptr) { /* sqlite3.c:189831:13: */
}
// Initialize the JsonString object
-func jsonInit(tls *libc.TLS, p uintptr, pCtx uintptr) { /* sqlite3.c:189840:13: */
+func jsonInit(tls *libc.TLS, p uintptr, pCtx uintptr) { /* sqlite3.c:191415:13: */
(*JsonString)(unsafe.Pointer(p)).FpCtx = pCtx
(*JsonString)(unsafe.Pointer(p)).FbErr = U8(0)
jsonZero(tls, p)
@@ -150019,7 +152184,7 @@ func jsonInit(tls *libc.TLS, p uintptr, pCtx uintptr) { /* sqlite3.c:189840:13:
// Free all allocated memory and reset the JsonString object back to its
// initial state.
-func jsonReset(tls *libc.TLS, p uintptr) { /* sqlite3.c:189850:13: */
+func jsonReset(tls *libc.TLS, p uintptr) { /* sqlite3.c:191425:13: */
if !(int32((*JsonString)(unsafe.Pointer(p)).FbStatic) != 0) {
Xsqlite3_free(tls, (*JsonString)(unsafe.Pointer(p)).FzBuf)
}
@@ -150027,7 +152192,7 @@ func jsonReset(tls *libc.TLS, p uintptr) { /* sqlite3.c:189850:13: */
}
// Report an out-of-memory (OOM) condition
-func jsonOom(tls *libc.TLS, p uintptr) { /* sqlite3.c:189858:13: */
+func jsonOom(tls *libc.TLS, p uintptr) { /* sqlite3.c:191433:13: */
(*JsonString)(unsafe.Pointer(p)).FbErr = U8(1)
Xsqlite3_result_error_nomem(tls, (*JsonString)(unsafe.Pointer(p)).FpCtx)
jsonReset(tls, p)
@@ -150035,12 +152200,12 @@ func jsonOom(tls *libc.TLS, p uintptr) { /* sqlite3.c:189858:13: */
// Enlarge pJson->zBuf so that it can hold at least N more bytes.
// Return zero on success. Return non-zero on an OOM error
-func jsonGrow(tls *libc.TLS, p uintptr, N U32) int32 { /* sqlite3.c:189867:12: */
+func jsonGrow(tls *libc.TLS, p uintptr, N U32) int32 { /* sqlite3.c:191442:12: */
var nTotal U64
if U64(N) < (*JsonString)(unsafe.Pointer(p)).FnAlloc {
- nTotal = ((*JsonString)(unsafe.Pointer(p)).FnAlloc * uint64(2))
+ nTotal = (*JsonString)(unsafe.Pointer(p)).FnAlloc * uint64(2)
} else {
- nTotal = (((*JsonString)(unsafe.Pointer(p)).FnAlloc + U64(N)) + uint64(10))
+ nTotal = (*JsonString)(unsafe.Pointer(p)).FnAlloc + U64(N) + uint64(10)
}
var zNew uintptr
if (*JsonString)(unsafe.Pointer(p)).FbStatic != 0 {
@@ -150068,33 +152233,33 @@ func jsonGrow(tls *libc.TLS, p uintptr, N U32) int32 { /* sqlite3.c:189867:12: *
}
// Append N bytes from zIn onto the end of the JsonString string.
-func jsonAppendRaw(tls *libc.TLS, p uintptr, zIn uintptr, N U32) { /* sqlite3.c:189894:13: */
+func jsonAppendRaw(tls *libc.TLS, p uintptr, zIn uintptr, N U32) { /* sqlite3.c:191469:13: */
if N == U32(0) {
return
}
- if ((U64(N) + (*JsonString)(unsafe.Pointer(p)).FnUsed) >= (*JsonString)(unsafe.Pointer(p)).FnAlloc) && (jsonGrow(tls, p, N) != 0) {
+ if U64(N)+(*JsonString)(unsafe.Pointer(p)).FnUsed >= (*JsonString)(unsafe.Pointer(p)).FnAlloc && jsonGrow(tls, p, N) != 0 {
return
}
- libc.Xmemcpy(tls, ((*JsonString)(unsafe.Pointer(p)).FzBuf + uintptr((*JsonString)(unsafe.Pointer(p)).FnUsed)), zIn, N)
- *(*U64)(unsafe.Pointer(p + 16 /* &.nUsed */)) += (U64(N))
+ libc.Xmemcpy(tls, (*JsonString)(unsafe.Pointer(p)).FzBuf+uintptr((*JsonString)(unsafe.Pointer(p)).FnUsed), zIn, N)
+ *(*U64)(unsafe.Pointer(p + 16)) += U64(N)
}
// Append formatted text (not to exceed N bytes) to the JsonString.
-func jsonPrintf(tls *libc.TLS, N int32, p uintptr, zFormat uintptr, va uintptr) { /* sqlite3.c:189903:13: */
+func jsonPrintf(tls *libc.TLS, N int32, p uintptr, zFormat uintptr, va uintptr) { /* sqlite3.c:191478:13: */
var ap Va_list
_ = ap
- if (((*JsonString)(unsafe.Pointer(p)).FnUsed + U64(N)) >= (*JsonString)(unsafe.Pointer(p)).FnAlloc) && (jsonGrow(tls, p, uint32(N)) != 0) {
+ if (*JsonString)(unsafe.Pointer(p)).FnUsed+U64(N) >= (*JsonString)(unsafe.Pointer(p)).FnAlloc && jsonGrow(tls, p, uint32(N)) != 0 {
return
}
ap = va
- Xsqlite3_vsnprintf(tls, N, ((*JsonString)(unsafe.Pointer(p)).FzBuf + uintptr((*JsonString)(unsafe.Pointer(p)).FnUsed)), zFormat, ap)
+ Xsqlite3_vsnprintf(tls, N, (*JsonString)(unsafe.Pointer(p)).FzBuf+uintptr((*JsonString)(unsafe.Pointer(p)).FnUsed), zFormat, ap)
_ = ap
- *(*U64)(unsafe.Pointer(p + 16 /* &.nUsed */)) += (U64(int32(libc.Xstrlen(tls, ((*JsonString)(unsafe.Pointer(p)).FzBuf + uintptr((*JsonString)(unsafe.Pointer(p)).FnUsed))))))
+ *(*U64)(unsafe.Pointer(p + 16)) += U64(int32(libc.Xstrlen(tls, (*JsonString)(unsafe.Pointer(p)).FzBuf+uintptr((*JsonString)(unsafe.Pointer(p)).FnUsed))))
}
// Append a single character
-func jsonAppendChar(tls *libc.TLS, p uintptr, c uint8) { /* sqlite3.c:189914:13: */
- if ((*JsonString)(unsafe.Pointer(p)).FnUsed >= (*JsonString)(unsafe.Pointer(p)).FnAlloc) && (jsonGrow(tls, p, uint32(1)) != 0) {
+func jsonAppendChar(tls *libc.TLS, p uintptr, c uint8) { /* sqlite3.c:191489:13: */
+ if (*JsonString)(unsafe.Pointer(p)).FnUsed >= (*JsonString)(unsafe.Pointer(p)).FnAlloc && jsonGrow(tls, p, uint32(1)) != 0 {
return
}
*(*uint8)(unsafe.Pointer((*JsonString)(unsafe.Pointer(p)).FzBuf + uintptr(libc.PostIncUint64(&(*JsonString)(unsafe.Pointer(p)).FnUsed, 1)))) = c
@@ -150102,13 +152267,13 @@ func jsonAppendChar(tls *libc.TLS, p uintptr, c uint8) { /* sqlite3.c:189914:13:
// Append a comma separator to the output buffer, if the previous
// character is not '[' or '{'.
-func jsonAppendSeparator(tls *libc.TLS, p uintptr) { /* sqlite3.c:189922:13: */
+func jsonAppendSeparator(tls *libc.TLS, p uintptr) { /* sqlite3.c:191497:13: */
var c uint8
if (*JsonString)(unsafe.Pointer(p)).FnUsed == uint64(0) {
return
}
- c = *(*uint8)(unsafe.Pointer((*JsonString)(unsafe.Pointer(p)).FzBuf + uintptr(((*JsonString)(unsafe.Pointer(p)).FnUsed - uint64(1)))))
- if (int32(c) != '[') && (int32(c) != '{') {
+ c = *(*uint8)(unsafe.Pointer((*JsonString)(unsafe.Pointer(p)).FzBuf + uintptr((*JsonString)(unsafe.Pointer(p)).FnUsed-uint64(1))))
+ if int32(c) != '[' && int32(c) != '{' {
jsonAppendChar(tls, p, uint8(','))
}
}
@@ -150117,10 +152282,10 @@ func jsonAppendSeparator(tls *libc.TLS, p uintptr) { /* sqlite3.c:189922:13: */
// under construction. Enclose the string in "..." and escape
// any double-quotes or backslash characters contained within the
// string.
-func jsonAppendString(tls *libc.TLS, p uintptr, zIn uintptr, N U32) { /* sqlite3.c:189934:13: */
+func jsonAppendString(tls *libc.TLS, p uintptr, zIn uintptr, N U32) { /* sqlite3.c:191509:13: */
var i U32
var c uint8
- if !((zIn == uintptr(0)) || ((((U64(N) + (*JsonString)(unsafe.Pointer(p)).FnUsed) + uint64(2)) >= (*JsonString)(unsafe.Pointer(p)).FnAlloc) && (jsonGrow(tls, p, (N+U32(2))) != 0))) {
+ if !(zIn == uintptr(0) || U64(N)+(*JsonString)(unsafe.Pointer(p)).FnUsed+uint64(2) >= (*JsonString)(unsafe.Pointer(p)).FnAlloc && jsonGrow(tls, p, N+U32(2)) != 0) {
goto __1
}
return
@@ -150132,12 +152297,12 @@ __2:
if !(i < N) {
goto __4
}
- c = *(*uint8)(unsafe.Pointer((zIn) + uintptr(i)))
- if !((int32(c) == '"') || (int32(c) == '\\')) {
+ c = *(*uint8)(unsafe.Pointer(zIn + uintptr(i)))
+ if !(int32(c) == '"' || int32(c) == '\\') {
goto __5
}
json_simple_escape:
- if !((((((*JsonString)(unsafe.Pointer(p)).FnUsed + U64(N)) + uint64(3)) - U64(i)) > (*JsonString)(unsafe.Pointer(p)).FnAlloc) && (jsonGrow(tls, p, ((N+U32(3))-i)) != 0)) {
+ if !((*JsonString)(unsafe.Pointer(p)).FnUsed+U64(N)+uint64(3)-U64(i) > (*JsonString)(unsafe.Pointer(p)).FnAlloc && jsonGrow(tls, p, N+U32(3)-i) != 0) {
goto __7
}
return
@@ -150157,7 +152322,7 @@ __5:
goto json_simple_escape
__9:
;
- if !((((((*JsonString)(unsafe.Pointer(p)).FnUsed + U64(N)) + uint64(7)) + U64(i)) > (*JsonString)(unsafe.Pointer(p)).FnAlloc) && (jsonGrow(tls, p, ((N+U32(7))-i)) != 0)) {
+ if !((*JsonString)(unsafe.Pointer(p)).FnUsed+U64(N)+uint64(7)+U64(i) > (*JsonString)(unsafe.Pointer(p)).FnAlloc && jsonGrow(tls, p, N+U32(7)-i) != 0) {
goto __10
}
return
@@ -150167,8 +152332,8 @@ __10:
*(*uint8)(unsafe.Pointer((*JsonString)(unsafe.Pointer(p)).FzBuf + uintptr(libc.PostIncUint64(&(*JsonString)(unsafe.Pointer(p)).FnUsed, 1)))) = uint8('u')
*(*uint8)(unsafe.Pointer((*JsonString)(unsafe.Pointer(p)).FzBuf + uintptr(libc.PostIncUint64(&(*JsonString)(unsafe.Pointer(p)).FnUsed, 1)))) = uint8('0')
*(*uint8)(unsafe.Pointer((*JsonString)(unsafe.Pointer(p)).FzBuf + uintptr(libc.PostIncUint64(&(*JsonString)(unsafe.Pointer(p)).FnUsed, 1)))) = uint8('0')
- *(*uint8)(unsafe.Pointer((*JsonString)(unsafe.Pointer(p)).FzBuf + uintptr(libc.PostIncUint64(&(*JsonString)(unsafe.Pointer(p)).FnUsed, 1)))) = (uint8('0' + (int32(c) >> 4)))
- c = uint8(*(*uint8)(unsafe.Pointer(ts + 22773 /* "0123456789abcdef" */ + uintptr((int32(c) & 0xf)))))
+ *(*uint8)(unsafe.Pointer((*JsonString)(unsafe.Pointer(p)).FzBuf + uintptr(libc.PostIncUint64(&(*JsonString)(unsafe.Pointer(p)).FnUsed, 1)))) = uint8('0' + int32(c)>>4)
+ c = uint8(*(*uint8)(unsafe.Pointer(ts + 24070 /* "0123456789abcdef" */ + uintptr(int32(c)&0xf))))
__8:
;
__6:
@@ -150188,15 +152353,15 @@ __4:
var aSpecial = [32]uint8{
uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8('b'), uint8('t'), uint8('n'), uint8(0), uint8('f'), uint8('r'), uint8(0), uint8(0),
uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0),
-} /* sqlite3.c:189945:25 */
+} /* sqlite3.c:191520:25 */
// Append a function parameter value to the JSON string under
// construction.
-func jsonAppendValue(tls *libc.TLS, p uintptr, pValue uintptr) { /* sqlite3.c:189977:13: */
+func jsonAppendValue(tls *libc.TLS, p uintptr, pValue uintptr) { /* sqlite3.c:191552:13: */
switch Xsqlite3_value_type(tls, pValue) {
case SQLITE_NULL:
{
- jsonAppendRaw(tls, p, ts+5258 /* "null" */, uint32(4))
+ jsonAppendRaw(tls, p, ts+6105 /* "null" */, uint32(4))
break
}
@@ -150225,7 +152390,7 @@ func jsonAppendValue(tls *libc.TLS, p uintptr, pValue uintptr) { /* sqlite3.c:18
default:
{
if int32((*JsonString)(unsafe.Pointer(p)).FbErr) == 0 {
- Xsqlite3_result_error(tls, (*JsonString)(unsafe.Pointer(p)).FpCtx, ts+22790 /* "JSON cannot hold..." */, -1)
+ Xsqlite3_result_error(tls, (*JsonString)(unsafe.Pointer(p)).FpCtx, ts+24087 /* "JSON cannot hold..." */, -1)
(*JsonString)(unsafe.Pointer(p)).FbErr = U8(2)
jsonReset(tls, p)
}
@@ -150236,7 +152401,7 @@ func jsonAppendValue(tls *libc.TLS, p uintptr, pValue uintptr) { /* sqlite3.c:18
}
// Make the JSON in p the result of the SQL function.
-func jsonResult(tls *libc.TLS, p uintptr) { /* sqlite3.c:190017:13: */
+func jsonResult(tls *libc.TLS, p uintptr) { /* sqlite3.c:191592:13: */
if int32((*JsonString)(unsafe.Pointer(p)).FbErr) == 0 {
Xsqlite3_result_text64(tls, (*JsonString)(unsafe.Pointer(p)).FpCtx, (*JsonString)(unsafe.Pointer(p)).FzBuf, (*JsonString)(unsafe.Pointer(p)).FnUsed,
func() uintptr {
@@ -150263,16 +152428,16 @@ func jsonResult(tls *libc.TLS, p uintptr) { /* sqlite3.c:190017:13: */
// Appended elements are not counted. The value returned is the number
// by which the JsonNode counter should increment in order to go to the
// next peer value.
-func jsonNodeSize(tls *libc.TLS, pNode uintptr) U32 { /* sqlite3.c:190040:12: */
+func jsonNodeSize(tls *libc.TLS, pNode uintptr) U32 { /* sqlite3.c:191615:12: */
if int32((*JsonNode)(unsafe.Pointer(pNode)).FeType) >= JSON_ARRAY {
- return ((*JsonNode)(unsafe.Pointer(pNode)).Fn + U32(1))
+ return (*JsonNode)(unsafe.Pointer(pNode)).Fn + U32(1)
}
return uint32(1)
}
// Reclaim all memory allocated by a JsonParse object. But do not
// delete the JsonParse object itself.
-func jsonParseReset(tls *libc.TLS, pParse uintptr) { /* sqlite3.c:190048:13: */
+func jsonParseReset(tls *libc.TLS, pParse uintptr) { /* sqlite3.c:191623:13: */
Xsqlite3_free(tls, (*JsonParse)(unsafe.Pointer(pParse)).FaNode)
(*JsonParse)(unsafe.Pointer(pParse)).FaNode = uintptr(0)
(*JsonParse)(unsafe.Pointer(pParse)).FnNode = U32(0)
@@ -150282,7 +152447,7 @@ func jsonParseReset(tls *libc.TLS, pParse uintptr) { /* sqlite3.c:190048:13: */
}
// Free a JsonParse object that was obtained from sqlite3_malloc().
-func jsonParseFree(tls *libc.TLS, pParse uintptr) { /* sqlite3.c:190060:13: */
+func jsonParseFree(tls *libc.TLS, pParse uintptr) { /* sqlite3.c:191635:13: */
jsonParseReset(tls, pParse)
Xsqlite3_free(tls, pParse)
}
@@ -150290,38 +152455,42 @@ func jsonParseFree(tls *libc.TLS, pParse uintptr) { /* sqlite3.c:190060:13: */
// Convert the JsonNode pNode into a pure JSON string and
// append to pOut. Subsubstructure is also included. Return
// the number of JsonNode objects that are encoded.
-func jsonRenderNode(tls *libc.TLS, pNode uintptr, pOut uintptr, aReplace uintptr) { /* sqlite3.c:190070:13: */
- if (int32((*JsonNode)(unsafe.Pointer(pNode)).FjnFlags) & (JNODE_REPLACE | JNODE_PATCH)) != 0 {
- if (int32((*JsonNode)(unsafe.Pointer(pNode)).FjnFlags) & JNODE_REPLACE) != 0 {
- jsonAppendValue(tls, pOut, *(*uintptr)(unsafe.Pointer(aReplace + uintptr(*(*U32)(unsafe.Pointer(pNode + 8 /* &.u */)))*4)))
+func jsonRenderNode(tls *libc.TLS, pNode uintptr, pOut uintptr, aReplace uintptr) { /* sqlite3.c:191645:13: */
+
+ if int32((*JsonNode)(unsafe.Pointer(pNode)).FjnFlags)&(JNODE_REPLACE|JNODE_PATCH) != 0 {
+ if int32((*JsonNode)(unsafe.Pointer(pNode)).FjnFlags)&JNODE_REPLACE != 0 && aReplace != uintptr(0) {
+
+ jsonAppendValue(tls, pOut, *(*uintptr)(unsafe.Pointer(aReplace + uintptr(*(*U32)(unsafe.Pointer(pNode + 8)))*4)))
return
}
- pNode = *(*uintptr)(unsafe.Pointer(pNode + 8 /* &.u */))
+
+ pNode = *(*uintptr)(unsafe.Pointer(pNode + 8))
}
switch int32((*JsonNode)(unsafe.Pointer(pNode)).FeType) {
default:
{
- jsonAppendRaw(tls, pOut, ts+5258 /* "null" */, uint32(4))
+ jsonAppendRaw(tls, pOut, ts+6105 /* "null" */, uint32(4))
break
}
case JSON_TRUE:
{
- jsonAppendRaw(tls, pOut, ts+5770 /* "true" */, uint32(4))
+ jsonAppendRaw(tls, pOut, ts+6617 /* "true" */, uint32(4))
break
}
case JSON_FALSE:
{
- jsonAppendRaw(tls, pOut, ts+5775 /* "false" */, uint32(5))
+ jsonAppendRaw(tls, pOut, ts+6622 /* "false" */, uint32(5))
break
}
case JSON_STRING:
{
- if (int32((*JsonNode)(unsafe.Pointer(pNode)).FjnFlags) & JNODE_RAW) != 0 {
- jsonAppendString(tls, pOut, *(*uintptr)(unsafe.Pointer(pNode + 8 /* &.u */)), (*JsonNode)(unsafe.Pointer(pNode)).Fn)
+ if int32((*JsonNode)(unsafe.Pointer(pNode)).FjnFlags)&JNODE_RAW != 0 {
+
+ jsonAppendString(tls, pOut, *(*uintptr)(unsafe.Pointer(pNode + 8)), (*JsonNode)(unsafe.Pointer(pNode)).Fn)
break
}
@@ -150331,7 +152500,8 @@ func jsonRenderNode(tls *libc.TLS, pNode uintptr, pOut uintptr, aReplace uintptr
fallthrough
case JSON_INT:
{
- jsonAppendRaw(tls, pOut, *(*uintptr)(unsafe.Pointer(pNode + 8 /* &.u */)), (*JsonNode)(unsafe.Pointer(pNode)).Fn)
+
+ jsonAppendRaw(tls, pOut, *(*uintptr)(unsafe.Pointer(pNode + 8)), (*JsonNode)(unsafe.Pointer(pNode)).Fn)
break
}
@@ -150341,16 +152511,17 @@ func jsonRenderNode(tls *libc.TLS, pNode uintptr, pOut uintptr, aReplace uintptr
jsonAppendChar(tls, pOut, uint8('['))
for {
for j <= (*JsonNode)(unsafe.Pointer(pNode)).Fn {
- if (int32((*JsonNode)(unsafe.Pointer(pNode+uintptr(j)*12)).FjnFlags) & JNODE_REMOVE) == 0 {
+ if int32((*JsonNode)(unsafe.Pointer(pNode+uintptr(j)*12)).FjnFlags)&JNODE_REMOVE == 0 {
jsonAppendSeparator(tls, pOut)
- jsonRenderNode(tls, (pNode + uintptr(j)*12), pOut, aReplace)
+ jsonRenderNode(tls, pNode+uintptr(j)*12, pOut, aReplace)
}
- j = j + (jsonNodeSize(tls, (pNode + uintptr(j)*12)))
+ j = j + jsonNodeSize(tls, pNode+uintptr(j)*12)
}
- if (int32((*JsonNode)(unsafe.Pointer(pNode)).FjnFlags) & JNODE_APPEND) == 0 {
+ if int32((*JsonNode)(unsafe.Pointer(pNode)).FjnFlags)&JNODE_APPEND == 0 {
break
}
- pNode = (pNode + uintptr(*(*U32)(unsafe.Pointer(pNode + 8 /* &.u */)))*12)
+
+ pNode = pNode + uintptr(*(*U32)(unsafe.Pointer(pNode + 8)))*12
j = U32(1)
}
jsonAppendChar(tls, pOut, uint8(']'))
@@ -150363,18 +152534,19 @@ func jsonRenderNode(tls *libc.TLS, pNode uintptr, pOut uintptr, aReplace uintptr
jsonAppendChar(tls, pOut, uint8('{'))
for {
for j <= (*JsonNode)(unsafe.Pointer(pNode)).Fn {
- if (int32((*JsonNode)(unsafe.Pointer(pNode+uintptr((j+U32(1)))*12)).FjnFlags) & JNODE_REMOVE) == 0 {
+ if int32((*JsonNode)(unsafe.Pointer(pNode+uintptr(j+U32(1))*12)).FjnFlags)&JNODE_REMOVE == 0 {
jsonAppendSeparator(tls, pOut)
- jsonRenderNode(tls, (pNode + uintptr(j)*12), pOut, aReplace)
+ jsonRenderNode(tls, pNode+uintptr(j)*12, pOut, aReplace)
jsonAppendChar(tls, pOut, uint8(':'))
- jsonRenderNode(tls, (pNode + uintptr((j+U32(1)))*12), pOut, aReplace)
+ jsonRenderNode(tls, pNode+uintptr(j+U32(1))*12, pOut, aReplace)
}
- j = j + (U32(1) + jsonNodeSize(tls, (pNode+uintptr((j+U32(1)))*12)))
+ j = j + (U32(1) + jsonNodeSize(tls, pNode+uintptr(j+U32(1))*12))
}
- if (int32((*JsonNode)(unsafe.Pointer(pNode)).FjnFlags) & JNODE_APPEND) == 0 {
+ if int32((*JsonNode)(unsafe.Pointer(pNode)).FjnFlags)&JNODE_APPEND == 0 {
break
}
- pNode = (pNode + uintptr(*(*U32)(unsafe.Pointer(pNode + 8 /* &.u */)))*12)
+
+ pNode = pNode + uintptr(*(*U32)(unsafe.Pointer(pNode + 8)))*12
j = U32(1)
}
jsonAppendChar(tls, pOut, uint8('}'))
@@ -150385,7 +152557,7 @@ func jsonRenderNode(tls *libc.TLS, pNode uintptr, pOut uintptr, aReplace uintptr
}
// Return a JsonNode and all its descendents as a JSON string.
-func jsonReturnJson(tls *libc.TLS, pNode uintptr, pCtx uintptr, aReplace uintptr) { /* sqlite3.c:190152:13: */
+func jsonReturnJson(tls *libc.TLS, pNode uintptr, pCtx uintptr, aReplace uintptr) { /* sqlite3.c:191734:13: */
bp := tls.Alloc(128)
defer tls.Free(128)
@@ -150400,25 +152572,25 @@ func jsonReturnJson(tls *libc.TLS, pNode uintptr, pCtx uintptr, aReplace uintptr
// Translate a single byte of Hex into an integer.
// This routine only works if h really is a valid hexadecimal
// character: 0..9a..fA..F
-func jsonHexToInt(tls *libc.TLS, h int32) U8 { /* sqlite3.c:190169:11: */
+func jsonHexToInt(tls *libc.TLS, h int32) U8 { /* sqlite3.c:191751:11: */
- h = h + (9 * (1 & (h >> 6)))
- return (U8(h & 0xf))
+ h = h + 9*(1&(h>>6))
+ return U8(h & 0xf)
}
// Convert a 4-byte hex string into an integer
-func jsonHexToInt4(tls *libc.TLS, z uintptr) U32 { /* sqlite3.c:190182:12: */
+func jsonHexToInt4(tls *libc.TLS, z uintptr) U32 { /* sqlite3.c:191764:12: */
var v U32
- v = (U32((((int32(jsonHexToInt(tls, int32(*(*uint8)(unsafe.Pointer(z))))) << 12) +
- (int32(jsonHexToInt(tls, int32(*(*uint8)(unsafe.Pointer(z + 1))))) << 8)) +
- (int32(jsonHexToInt(tls, int32(*(*uint8)(unsafe.Pointer(z + 2))))) << 4)) +
- int32(jsonHexToInt(tls, int32(*(*uint8)(unsafe.Pointer(z + 3)))))))
+ v = U32(int32(jsonHexToInt(tls, int32(*(*uint8)(unsafe.Pointer(z)))))<<12 +
+ int32(jsonHexToInt(tls, int32(*(*uint8)(unsafe.Pointer(z + 1)))))<<8 +
+ int32(jsonHexToInt(tls, int32(*(*uint8)(unsafe.Pointer(z + 2)))))<<4 +
+ int32(jsonHexToInt(tls, int32(*(*uint8)(unsafe.Pointer(z + 3))))))
return v
}
// Make the JsonNode the return value of the function.
-func jsonReturn(tls *libc.TLS, pNode uintptr, pCtx uintptr, aReplace uintptr) { /* sqlite3.c:190198:13: */
+func jsonReturn(tls *libc.TLS, pNode uintptr, pCtx uintptr, aReplace uintptr) { /* sqlite3.c:191780:13: */
bp := tls.Alloc(8)
defer tls.Free(8)
@@ -150471,7 +152643,8 @@ __4:
__5:
i = int64(0)
- z = *(*uintptr)(unsafe.Pointer(pNode + 8 /* &.u */))
+
+ z = *(*uintptr)(unsafe.Pointer(pNode + 8))
if !(int32(*(*uint8)(unsafe.Pointer(z))) == '-') {
goto __10
}
@@ -150479,20 +152652,20 @@ __5:
__10:
;
__11:
- if !((int32(*(*uint8)(unsafe.Pointer(z))) >= '0') && (int32(*(*uint8)(unsafe.Pointer(z))) <= '9')) {
+ if !(int32(*(*uint8)(unsafe.Pointer(z))) >= '0' && int32(*(*uint8)(unsafe.Pointer(z))) <= '9') {
goto __12
}
- v = (uint32(int32(*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&z, 1)))) - '0'))
- if !(i >= ((int64(0xffffffff) | (I64((int64(0x7fffffff))) << 32)) / int64(10))) {
+ v = uint32(int32(*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&z, 1)))) - '0')
+ if !(i >= (int64(0xffffffff)|I64(int64(0x7fffffff))<<32)/int64(10)) {
goto __13
}
- if !(i > ((int64(0xffffffff) | (I64((int64(0x7fffffff))) << 32)) / int64(10))) {
+ if !(i > (int64(0xffffffff)|I64(int64(0x7fffffff))<<32)/int64(10)) {
goto __14
}
goto int_as_real
__14:
;
- if !((int32(*(*uint8)(unsafe.Pointer(z))) >= '0') && (int32(*(*uint8)(unsafe.Pointer(z))) <= '9')) {
+ if !(int32(*(*uint8)(unsafe.Pointer(z))) >= '0' && int32(*(*uint8)(unsafe.Pointer(z))) <= '9') {
goto __15
}
goto int_as_real
@@ -150507,10 +152680,10 @@ __16:
if !(v == uint32(8)) {
goto __17
}
- if !(int32(*(*uint8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pNode + 8 /* &.u */))))) == '-') {
+ if !(int32(*(*uint8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pNode + 8))))) == '-') {
goto __18
}
- Xsqlite3_result_int64(tls, pCtx, ((int64(-1)) - (int64(0xffffffff) | (I64((int64(0x7fffffff))) << 32))))
+ Xsqlite3_result_int64(tls, pCtx, int64(-1)-(int64(0xffffffff)|I64(int64(0x7fffffff))<<32))
goto int_done
goto __19
__18:
@@ -150521,11 +152694,11 @@ __17:
;
__13:
;
- i = ((i * int64(10)) + Sqlite3_int64(v))
+ i = i*int64(10) + Sqlite3_int64(v)
goto __11
__12:
;
- if !(int32(*(*uint8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pNode + 8 /* &.u */))))) == '-') {
+ if !(int32(*(*uint8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pNode + 8))))) == '-') {
goto __20
}
i = -i
@@ -150535,27 +152708,30 @@ __20:
int_done:
goto __1
int_as_real:
- i = int64(0)
+ ;
__6:
- z1 = *(*uintptr)(unsafe.Pointer(pNode + 8 /* &.u */))
+ ;
+ z1 = *(*uintptr)(unsafe.Pointer(pNode + 8))
Xsqlite3AtoF(tls, z1, bp /* &r */, Xsqlite3Strlen30(tls, z1), uint8(SQLITE_UTF8))
Xsqlite3_result_double(tls, pCtx, *(*float64)(unsafe.Pointer(bp /* r */)))
goto __1
__7:
;
- if !((int32((*JsonNode)(unsafe.Pointer(pNode)).FjnFlags) & JNODE_ESCAPE) == 0) {
+ if !(int32((*JsonNode)(unsafe.Pointer(pNode)).FjnFlags)&JNODE_ESCAPE == 0) {
goto __21
}
// JSON formatted without any backslash-escapes
- Xsqlite3_result_text(tls, pCtx, (*(*uintptr)(unsafe.Pointer(pNode + 8 /* &.u */)) + uintptr(1)), (int32((*JsonNode)(unsafe.Pointer(pNode)).Fn - U32(2))),
+
+ Xsqlite3_result_text(tls, pCtx, *(*uintptr)(unsafe.Pointer(pNode + 8))+uintptr(1), int32((*JsonNode)(unsafe.Pointer(pNode)).Fn-U32(2)),
libc.UintptrFromInt32(-1))
goto __22
__21:
n = (*JsonNode)(unsafe.Pointer(pNode)).Fn
- z2 = *(*uintptr)(unsafe.Pointer(pNode + 8 /* &.u */))
- zOut = Xsqlite3_malloc(tls, (int32(n + U32(1))))
+
+ z2 = *(*uintptr)(unsafe.Pointer(pNode + 8))
+ zOut = Xsqlite3_malloc(tls, int32(n+U32(1)))
if !(zOut == uintptr(0)) {
goto __23
}
@@ -150566,7 +152742,7 @@ __23:
i1 = U32(1)
j = U32(0)
__24:
- if !(i1 < (n - U32(1))) {
+ if !(i1 < n-U32(1)) {
goto __26
}
c = *(*uint8)(unsafe.Pointer(z2 + uintptr(i1)))
@@ -150580,8 +152756,8 @@ __27:
if !(int32(c) == 'u') {
goto __29
}
- v1 = jsonHexToInt4(tls, ((z2 + uintptr(i1)) + uintptr(1)))
- i1 = i1 + (U32(4))
+ v1 = jsonHexToInt4(tls, z2+uintptr(i1)+uintptr(1))
+ i1 = i1 + U32(4)
if !(v1 == U32(0)) {
goto __31
}
@@ -150597,29 +152773,29 @@ __32:
if !(v1 <= U32(0x7ff)) {
goto __34
}
- *(*uint8)(unsafe.Pointer(zOut + uintptr(libc.PostIncUint32(&j, 1)))) = (uint8(U32(0xc0) | (v1 >> 6)))
- *(*uint8)(unsafe.Pointer(zOut + uintptr(libc.PostIncUint32(&j, 1)))) = (uint8(U32(0x80) | (v1 & U32(0x3f))))
+ *(*uint8)(unsafe.Pointer(zOut + uintptr(libc.PostIncUint32(&j, 1)))) = uint8(U32(0xc0) | v1>>6)
+ *(*uint8)(unsafe.Pointer(zOut + uintptr(libc.PostIncUint32(&j, 1)))) = uint8(U32(0x80) | v1&U32(0x3f))
goto __35
__34:
- if !((((((v1 & U32(0xfc00)) == U32(0xd800)) &&
- (i1 < (n - U32(6)))) &&
- (int32(*(*uint8)(unsafe.Pointer(z2 + uintptr((i1 + U32(1)))))) == '\\')) &&
- (int32(*(*uint8)(unsafe.Pointer(z2 + uintptr((i1 + U32(2)))))) == 'u')) &&
- (((libc.AssignUint32(&vlo, jsonHexToInt4(tls, ((z2+uintptr(i1))+uintptr(3))))) & U32(0xfc00)) == U32(0xdc00))) {
+ if !(v1&U32(0xfc00) == U32(0xd800) &&
+ i1 < n-U32(6) &&
+ int32(*(*uint8)(unsafe.Pointer(z2 + uintptr(i1+U32(1))))) == '\\' &&
+ int32(*(*uint8)(unsafe.Pointer(z2 + uintptr(i1+U32(2))))) == 'u' &&
+ libc.AssignUint32(&vlo, jsonHexToInt4(tls, z2+uintptr(i1)+uintptr(3)))&U32(0xfc00) == U32(0xdc00)) {
goto __36
}
// We have a surrogate pair
- v1 = ((((v1 & U32(0x3ff)) << 10) + (vlo & U32(0x3ff))) + U32(0x10000))
- i1 = i1 + (U32(6))
- *(*uint8)(unsafe.Pointer(zOut + uintptr(libc.PostIncUint32(&j, 1)))) = (uint8(U32(0xf0) | (v1 >> 18)))
- *(*uint8)(unsafe.Pointer(zOut + uintptr(libc.PostIncUint32(&j, 1)))) = (uint8(U32(0x80) | ((v1 >> 12) & U32(0x3f))))
- *(*uint8)(unsafe.Pointer(zOut + uintptr(libc.PostIncUint32(&j, 1)))) = (uint8(U32(0x80) | ((v1 >> 6) & U32(0x3f))))
- *(*uint8)(unsafe.Pointer(zOut + uintptr(libc.PostIncUint32(&j, 1)))) = (uint8(U32(0x80) | (v1 & U32(0x3f))))
+ v1 = v1&U32(0x3ff)<<10 + vlo&U32(0x3ff) + U32(0x10000)
+ i1 = i1 + U32(6)
+ *(*uint8)(unsafe.Pointer(zOut + uintptr(libc.PostIncUint32(&j, 1)))) = uint8(U32(0xf0) | v1>>18)
+ *(*uint8)(unsafe.Pointer(zOut + uintptr(libc.PostIncUint32(&j, 1)))) = uint8(U32(0x80) | v1>>12&U32(0x3f))
+ *(*uint8)(unsafe.Pointer(zOut + uintptr(libc.PostIncUint32(&j, 1)))) = uint8(U32(0x80) | v1>>6&U32(0x3f))
+ *(*uint8)(unsafe.Pointer(zOut + uintptr(libc.PostIncUint32(&j, 1)))) = uint8(U32(0x80) | v1&U32(0x3f))
goto __37
__36:
- *(*uint8)(unsafe.Pointer(zOut + uintptr(libc.PostIncUint32(&j, 1)))) = (uint8(U32(0xe0) | (v1 >> 12)))
- *(*uint8)(unsafe.Pointer(zOut + uintptr(libc.PostIncUint32(&j, 1)))) = (uint8(U32(0x80) | ((v1 >> 6) & U32(0x3f))))
- *(*uint8)(unsafe.Pointer(zOut + uintptr(libc.PostIncUint32(&j, 1)))) = (uint8(U32(0x80) | (v1 & U32(0x3f))))
+ *(*uint8)(unsafe.Pointer(zOut + uintptr(libc.PostIncUint32(&j, 1)))) = uint8(U32(0xe0) | v1>>12)
+ *(*uint8)(unsafe.Pointer(zOut + uintptr(libc.PostIncUint32(&j, 1)))) = uint8(U32(0x80) | v1>>6&U32(0x3f))
+ *(*uint8)(unsafe.Pointer(zOut + uintptr(libc.PostIncUint32(&j, 1)))) = uint8(U32(0x80) | v1&U32(0x3f))
__37:
;
__35:
@@ -150695,15 +152871,15 @@ __1:
// A macro to hint to the compiler that a function should not be
// inlined.
-func jsonParseAddNodeExpand(tls *libc.TLS, pParse uintptr, eType U32, n U32, zContent uintptr) int32 { /* sqlite3.c:190362:26: */
+func jsonParseAddNodeExpand(tls *libc.TLS, pParse uintptr, eType U32, n U32, zContent uintptr) int32 { /* sqlite3.c:191953:26: */
var nNew U32
var pNew uintptr
if (*JsonParse)(unsafe.Pointer(pParse)).Foom != 0 {
return -1
}
- nNew = (((*JsonParse)(unsafe.Pointer(pParse)).FnAlloc * U32(2)) + U32(10))
- pNew = Xsqlite3_realloc64(tls, (*JsonParse)(unsafe.Pointer(pParse)).FaNode, (uint64(uint32(unsafe.Sizeof(JsonNode{})) * nNew)))
+ nNew = (*JsonParse)(unsafe.Pointer(pParse)).FnAlloc*U32(2) + U32(10)
+ pNew = Xsqlite3_realloc64(tls, (*JsonParse)(unsafe.Pointer(pParse)).FaNode, uint64(uint32(unsafe.Sizeof(JsonNode{}))*nNew))
if pNew == uintptr(0) {
(*JsonParse)(unsafe.Pointer(pParse)).Foom = U8(1)
return -1
@@ -150717,24 +152893,25 @@ func jsonParseAddNodeExpand(tls *libc.TLS, pParse uintptr, eType U32, n U32, zCo
// Create a new JsonNode instance based on the arguments and append that
// instance to the JsonParse. Return the index in pParse->aNode[] of the
// new node, or -1 if a memory allocation fails.
-func jsonParseAddNode(tls *libc.TLS, pParse uintptr, eType U32, n U32, zContent uintptr) int32 { /* sqlite3.c:190389:12: */
+func jsonParseAddNode(tls *libc.TLS, pParse uintptr, eType U32, n U32, zContent uintptr) int32 { /* sqlite3.c:191980:12: */
var p uintptr
- if (*JsonParse)(unsafe.Pointer(pParse)).FnNode >= (*JsonParse)(unsafe.Pointer(pParse)).FnAlloc {
+ if (*JsonParse)(unsafe.Pointer(pParse)).FaNode == uintptr(0) || (*JsonParse)(unsafe.Pointer(pParse)).FnNode >= (*JsonParse)(unsafe.Pointer(pParse)).FnAlloc {
return jsonParseAddNodeExpand(tls, pParse, eType, n, zContent)
}
- p = ((*JsonParse)(unsafe.Pointer(pParse)).FaNode + uintptr((*JsonParse)(unsafe.Pointer(pParse)).FnNode)*12)
+ p = (*JsonParse)(unsafe.Pointer(pParse)).FaNode + uintptr((*JsonParse)(unsafe.Pointer(pParse)).FnNode)*12
(*JsonNode)(unsafe.Pointer(p)).FeType = U8(eType)
(*JsonNode)(unsafe.Pointer(p)).FjnFlags = U8(0)
+
(*JsonNode)(unsafe.Pointer(p)).Fn = n
- *(*uintptr)(unsafe.Pointer(p + 8 /* &.u */)) = zContent
+ *(*uintptr)(unsafe.Pointer(p + 8)) = zContent
return int32(libc.PostIncUint32(&(*JsonParse)(unsafe.Pointer(pParse)).FnNode, 1))
}
// Return true if z[] begins with 4 (or more) hexadecimal digits
-func jsonIs4Hex(tls *libc.TLS, z uintptr) int32 { /* sqlite3.c:190410:12: */
+func jsonIs4Hex(tls *libc.TLS, z uintptr) int32 { /* sqlite3.c:192002:12: */
var i int32
for i = 0; i < 4; i++ {
- if !((int32(Xsqlite3CtypeMap[uint8(*(*uint8)(unsafe.Pointer(z + uintptr(i))))]) & 0x08) != 0) {
+ if !(int32(Xsqlite3CtypeMap[uint8(*(*uint8)(unsafe.Pointer(z + uintptr(i))))])&0x08 != 0) {
return 0
}
}
@@ -150747,7 +152924,7 @@ func jsonIs4Hex(tls *libc.TLS, z uintptr) int32 { /* sqlite3.c:190410:12: */
// Return negative for a syntax error. Special cases: return -2 if the
// first non-whitespace character is '}' and return -3 if the first
// non-whitespace character is ']'.
-func jsonParseValue(tls *libc.TLS, pParse uintptr, i U32) int32 { /* sqlite3.c:190424:12: */
+func jsonParseValue(tls *libc.TLS, pParse uintptr, i U32) int32 { /* sqlite3.c:192016:12: */
var c uint8
var j U32
var iThis int32
@@ -150757,13 +152934,13 @@ func jsonParseValue(tls *libc.TLS, pParse uintptr, i U32) int32 { /* sqlite3.c:1
for jsonIsSpace[uint8(*(*uint8)(unsafe.Pointer(z + uintptr(i))))] != 0 {
i++
}
- if (int32(libc.AssignUint8(&c, *(*uint8)(unsafe.Pointer(z + uintptr(i)))))) == '{' {
+ if int32(libc.AssignUint8(&c, *(*uint8)(unsafe.Pointer(z + uintptr(i))))) == '{' {
// Parse object
iThis = jsonParseAddNode(tls, pParse, uint32(JSON_OBJECT), uint32(0), uintptr(0))
if iThis < 0 {
return -1
}
- for j = (i + U32(1)); ; j++ {
+ for j = i + U32(1); ; j++ {
for jsonIsSpace[uint8(*(*uint8)(unsafe.Pointer(z + uintptr(j))))] != 0 {
j++
}
@@ -150773,19 +152950,19 @@ func jsonParseValue(tls *libc.TLS, pParse uintptr, i U32) int32 { /* sqlite3.c:1
x = jsonParseValue(tls, pParse, j)
if x < 0 {
(*JsonParse)(unsafe.Pointer(pParse)).FiDepth--
- if (x == (-2)) && ((*JsonParse)(unsafe.Pointer(pParse)).FnNode == (U32(iThis) + U32(1))) {
- return (int32(j + U32(1)))
+ if x == -2 && (*JsonParse)(unsafe.Pointer(pParse)).FnNode == U32(iThis)+U32(1) {
+ return int32(j + U32(1))
}
return -1
}
if (*JsonParse)(unsafe.Pointer(pParse)).Foom != 0 {
return -1
}
- pNode = ((*JsonParse)(unsafe.Pointer(pParse)).FaNode + uintptr(((*JsonParse)(unsafe.Pointer(pParse)).FnNode-U32(1)))*12)
+ pNode = (*JsonParse)(unsafe.Pointer(pParse)).FaNode + uintptr((*JsonParse)(unsafe.Pointer(pParse)).FnNode-U32(1))*12
if int32((*JsonNode)(unsafe.Pointer(pNode)).FeType) != JSON_STRING {
return -1
}
- *(*U8)(unsafe.Pointer(pNode + 1 /* &.jnFlags */)) |= U8((JNODE_LABEL))
+ *(*U8)(unsafe.Pointer(pNode + 1)) |= U8(JNODE_LABEL)
j = U32(x)
for jsonIsSpace[uint8(*(*uint8)(unsafe.Pointer(z + uintptr(j))))] != 0 {
j++
@@ -150812,15 +152989,16 @@ func jsonParseValue(tls *libc.TLS, pParse uintptr, i U32) int32 { /* sqlite3.c:1
}
break
}
- (*JsonNode)(unsafe.Pointer((*JsonParse)(unsafe.Pointer(pParse)).FaNode + uintptr(iThis)*12)).Fn = (((*JsonParse)(unsafe.Pointer(pParse)).FnNode - U32(iThis)) - U32(1))
- return (int32(j + U32(1)))
+ (*JsonNode)(unsafe.Pointer((*JsonParse)(unsafe.Pointer(pParse)).FaNode + uintptr(iThis)*12)).Fn = (*JsonParse)(unsafe.Pointer(pParse)).FnNode - U32(iThis) - U32(1)
+ return int32(j + U32(1))
} else if int32(c) == '[' {
// Parse array
iThis = jsonParseAddNode(tls, pParse, uint32(JSON_ARRAY), uint32(0), uintptr(0))
if iThis < 0 {
return -1
}
- for j = (i + U32(1)); ; j++ {
+ libc.Xmemset(tls, (*JsonParse)(unsafe.Pointer(pParse)).FaNode+uintptr(iThis)*12+8, 0, uint32(unsafe.Sizeof(struct{ FzJContent uintptr }{})))
+ for j = i + U32(1); ; j++ {
for jsonIsSpace[uint8(*(*uint8)(unsafe.Pointer(z + uintptr(j))))] != 0 {
j++
}
@@ -150830,8 +153008,8 @@ func jsonParseValue(tls *libc.TLS, pParse uintptr, i U32) int32 { /* sqlite3.c:1
x = jsonParseValue(tls, pParse, j)
(*JsonParse)(unsafe.Pointer(pParse)).FiDepth--
if x < 0 {
- if (x == (-3)) && ((*JsonParse)(unsafe.Pointer(pParse)).FnNode == (U32(iThis) + U32(1))) {
- return (int32(j + U32(1)))
+ if x == -3 && (*JsonParse)(unsafe.Pointer(pParse)).FnNode == U32(iThis)+U32(1) {
+ return int32(j + U32(1))
}
return -1
}
@@ -150848,23 +153026,23 @@ func jsonParseValue(tls *libc.TLS, pParse uintptr, i U32) int32 { /* sqlite3.c:1
}
break
}
- (*JsonNode)(unsafe.Pointer((*JsonParse)(unsafe.Pointer(pParse)).FaNode + uintptr(iThis)*12)).Fn = (((*JsonParse)(unsafe.Pointer(pParse)).FnNode - U32(iThis)) - U32(1))
- return (int32(j + U32(1)))
+ (*JsonNode)(unsafe.Pointer((*JsonParse)(unsafe.Pointer(pParse)).FaNode + uintptr(iThis)*12)).Fn = (*JsonParse)(unsafe.Pointer(pParse)).FnNode - U32(iThis) - U32(1)
+ return int32(j + U32(1))
} else if int32(c) == '"' {
// Parse string
var jnFlags U8 = U8(0)
- j = (i + U32(1))
+ j = i + U32(1)
for {
c = *(*uint8)(unsafe.Pointer(z + uintptr(j)))
- if (int32(c) & libc.CplInt32(0x1f)) == 0 {
+ if int32(c)&libc.CplInt32(0x1f) == 0 {
// Control characters are not allowed in strings
return -1
}
if int32(c) == '\\' {
c = *(*uint8)(unsafe.Pointer(z + uintptr(libc.PreIncUint32(&j, 1))))
- if ((((((((int32(c) == '"') || (int32(c) == '\\')) || (int32(c) == '/')) || (int32(c) == 'b')) || (int32(c) == 'f')) ||
- (int32(c) == 'n')) || (int32(c) == 'r')) || (int32(c) == 't')) ||
- ((int32(c) == 'u') && (jsonIs4Hex(tls, ((z+uintptr(j))+uintptr(1))) != 0)) {
+ if int32(c) == '"' || int32(c) == '\\' || int32(c) == '/' || int32(c) == 'b' || int32(c) == 'f' ||
+ int32(c) == 'n' || int32(c) == 'r' || int32(c) == 't' ||
+ int32(c) == 'u' && jsonIs4Hex(tls, z+uintptr(j)+uintptr(1)) != 0 {
jnFlags = U8(JNODE_ESCAPE)
} else {
return -1
@@ -150874,49 +153052,49 @@ func jsonParseValue(tls *libc.TLS, pParse uintptr, i U32) int32 { /* sqlite3.c:1
}
j++
}
- jsonParseAddNode(tls, pParse, uint32(JSON_STRING), ((j + U32(1)) - i), (z + uintptr(i)))
+ jsonParseAddNode(tls, pParse, uint32(JSON_STRING), j+U32(1)-i, z+uintptr(i))
if !(int32((*JsonParse)(unsafe.Pointer(pParse)).Foom) != 0) {
- (*JsonNode)(unsafe.Pointer((*JsonParse)(unsafe.Pointer(pParse)).FaNode + uintptr(((*JsonParse)(unsafe.Pointer(pParse)).FnNode-U32(1)))*12)).FjnFlags = jnFlags
+ (*JsonNode)(unsafe.Pointer((*JsonParse)(unsafe.Pointer(pParse)).FaNode + uintptr((*JsonParse)(unsafe.Pointer(pParse)).FnNode-U32(1))*12)).FjnFlags = jnFlags
}
- return (int32(j + U32(1)))
- } else if ((int32(c) == 'n') &&
- (libc.Xstrncmp(tls, (z+uintptr(i)), ts+5258 /* "null" */, uint32(4)) == 0)) &&
- !((int32(Xsqlite3CtypeMap[uint8(*(*uint8)(unsafe.Pointer(z + uintptr((i + U32(4))))))]) & 0x06) != 0) {
+ return int32(j + U32(1))
+ } else if int32(c) == 'n' &&
+ libc.Xstrncmp(tls, z+uintptr(i), ts+6105, uint32(4)) == 0 &&
+ !(int32(Xsqlite3CtypeMap[uint8(*(*uint8)(unsafe.Pointer(z + uintptr(i+U32(4)))))])&0x06 != 0) {
jsonParseAddNode(tls, pParse, uint32(JSON_NULL), uint32(0), uintptr(0))
- return (int32(i + U32(4)))
- } else if ((int32(c) == 't') &&
- (libc.Xstrncmp(tls, (z+uintptr(i)), ts+5770 /* "true" */, uint32(4)) == 0)) &&
- !((int32(Xsqlite3CtypeMap[uint8(*(*uint8)(unsafe.Pointer(z + uintptr((i + U32(4))))))]) & 0x06) != 0) {
+ return int32(i + U32(4))
+ } else if int32(c) == 't' &&
+ libc.Xstrncmp(tls, z+uintptr(i), ts+6617, uint32(4)) == 0 &&
+ !(int32(Xsqlite3CtypeMap[uint8(*(*uint8)(unsafe.Pointer(z + uintptr(i+U32(4)))))])&0x06 != 0) {
jsonParseAddNode(tls, pParse, uint32(JSON_TRUE), uint32(0), uintptr(0))
- return (int32(i + U32(4)))
- } else if ((int32(c) == 'f') &&
- (libc.Xstrncmp(tls, (z+uintptr(i)), ts+5775 /* "false" */, uint32(5)) == 0)) &&
- !((int32(Xsqlite3CtypeMap[uint8(*(*uint8)(unsafe.Pointer(z + uintptr((i + U32(5))))))]) & 0x06) != 0) {
+ return int32(i + U32(4))
+ } else if int32(c) == 'f' &&
+ libc.Xstrncmp(tls, z+uintptr(i), ts+6622, uint32(5)) == 0 &&
+ !(int32(Xsqlite3CtypeMap[uint8(*(*uint8)(unsafe.Pointer(z + uintptr(i+U32(5)))))])&0x06 != 0) {
jsonParseAddNode(tls, pParse, uint32(JSON_FALSE), uint32(0), uintptr(0))
- return (int32(i + U32(5)))
- } else if (int32(c) == '-') || ((int32(c) >= '0') && (int32(c) <= '9')) {
+ return int32(i + U32(5))
+ } else if int32(c) == '-' || int32(c) >= '0' && int32(c) <= '9' {
// Parse number
var seenDP U8 = U8(0)
var seenE U8 = U8(0)
if int32(c) <= '0' {
if int32(c) == '-' {
- j = (i + U32(1))
+ j = i + U32(1)
} else {
j = i
}
- if ((int32(*(*uint8)(unsafe.Pointer(z + uintptr(j)))) == '0') && (int32(*(*uint8)(unsafe.Pointer(z + uintptr((j + U32(1)))))) >= '0')) && (int32(*(*uint8)(unsafe.Pointer(z + uintptr((j + U32(1)))))) <= '9') {
+ if int32(*(*uint8)(unsafe.Pointer(z + uintptr(j)))) == '0' && int32(*(*uint8)(unsafe.Pointer(z + uintptr(j+U32(1))))) >= '0' && int32(*(*uint8)(unsafe.Pointer(z + uintptr(j+U32(1))))) <= '9' {
return -1
}
}
- j = (i + U32(1))
+ j = i + U32(1)
for ; ; j++ {
c = *(*uint8)(unsafe.Pointer(z + uintptr(j)))
- if (int32(c) >= '0') && (int32(c) <= '9') {
+ if int32(c) >= '0' && int32(c) <= '9' {
continue
}
if int32(c) == '.' {
- if int32(*(*uint8)(unsafe.Pointer(z + uintptr((j - U32(1)))))) == '-' {
+ if int32(*(*uint8)(unsafe.Pointer(z + uintptr(j-U32(1))))) == '-' {
return -1
}
if seenDP != 0 {
@@ -150925,27 +153103,27 @@ func jsonParseValue(tls *libc.TLS, pParse uintptr, i U32) int32 { /* sqlite3.c:1
seenDP = U8(1)
continue
}
- if (int32(c) == 'e') || (int32(c) == 'E') {
- if int32(*(*uint8)(unsafe.Pointer(z + uintptr((j - U32(1)))))) < '0' {
+ if int32(c) == 'e' || int32(c) == 'E' {
+ if int32(*(*uint8)(unsafe.Pointer(z + uintptr(j-U32(1))))) < '0' {
return -1
}
if seenE != 0 {
return -1
}
seenDP = libc.AssignUint8(&seenE, U8(1))
- c = *(*uint8)(unsafe.Pointer(z + uintptr((j + U32(1)))))
- if (int32(c) == '+') || (int32(c) == '-') {
+ c = *(*uint8)(unsafe.Pointer(z + uintptr(j+U32(1))))
+ if int32(c) == '+' || int32(c) == '-' {
j++
- c = *(*uint8)(unsafe.Pointer(z + uintptr((j + U32(1)))))
+ c = *(*uint8)(unsafe.Pointer(z + uintptr(j+U32(1))))
}
- if (int32(c) < '0') || (int32(c) > '9') {
+ if int32(c) < '0' || int32(c) > '9' {
return -1
}
continue
}
break
}
- if int32(*(*uint8)(unsafe.Pointer(z + uintptr((j - U32(1)))))) < '0' {
+ if int32(*(*uint8)(unsafe.Pointer(z + uintptr(j-U32(1))))) < '0' {
return -1
}
jsonParseAddNode(tls, pParse, func() uint32 {
@@ -150954,7 +153132,7 @@ func jsonParseValue(tls *libc.TLS, pParse uintptr, i U32) int32 { /* sqlite3.c:1
}
return uint32(JSON_INT)
}(),
- (j - i), (z + uintptr(i)))
+ j-i, z+uintptr(i))
return int32(j)
} else if int32(c) == '}' {
return -2 // End of {...}
@@ -150973,7 +153151,7 @@ func jsonParseValue(tls *libc.TLS, pParse uintptr, i U32) int32 { /* sqlite3.c:1
// pParse.
//
// pParse is uninitialized when this routine is called.
-func jsonParse(tls *libc.TLS, pParse uintptr, pCtx uintptr, zJson uintptr) int32 { /* sqlite3.c:190584:12: */
+func jsonParse(tls *libc.TLS, pParse uintptr, pCtx uintptr, zJson uintptr) int32 { /* sqlite3.c:192177:12: */
var i int32
libc.Xmemset(tls, pParse, 0, uint32(unsafe.Sizeof(JsonParse{})))
if zJson == uintptr(0) {
@@ -150998,7 +153176,7 @@ func jsonParse(tls *libc.TLS, pParse uintptr, pCtx uintptr, zJson uintptr) int32
if (*JsonParse)(unsafe.Pointer(pParse)).Foom != 0 {
Xsqlite3_result_error_nomem(tls, pCtx)
} else {
- Xsqlite3_result_error(tls, pCtx, ts+22819 /* "malformed JSON" */, -1)
+ Xsqlite3_result_error(tls, pCtx, ts+24116 /* "malformed JSON" */, -1)
}
}
jsonParseReset(tls, pParse)
@@ -151009,24 +153187,24 @@ func jsonParse(tls *libc.TLS, pParse uintptr, pCtx uintptr, zJson uintptr) int32
// Mark node i of pParse as being a child of iParent. Call recursively
// to fill in all the descendants of node i.
-func jsonParseFillInParentage(tls *libc.TLS, pParse uintptr, i U32, iParent U32) { /* sqlite3.c:190617:13: */
- var pNode uintptr = ((*JsonParse)(unsafe.Pointer(pParse)).FaNode + uintptr(i)*12)
+func jsonParseFillInParentage(tls *libc.TLS, pParse uintptr, i U32, iParent U32) { /* sqlite3.c:192210:13: */
+ var pNode uintptr = (*JsonParse)(unsafe.Pointer(pParse)).FaNode + uintptr(i)*12
var j U32
*(*U32)(unsafe.Pointer((*JsonParse)(unsafe.Pointer(pParse)).FaUp + uintptr(i)*4)) = iParent
switch int32((*JsonNode)(unsafe.Pointer(pNode)).FeType) {
case JSON_ARRAY:
{
- for j = U32(1); j <= (*JsonNode)(unsafe.Pointer(pNode)).Fn; j = j + (jsonNodeSize(tls, (pNode + uintptr(j)*12))) {
- jsonParseFillInParentage(tls, pParse, (i + j), i)
+ for j = U32(1); j <= (*JsonNode)(unsafe.Pointer(pNode)).Fn; j = j + jsonNodeSize(tls, pNode+uintptr(j)*12) {
+ jsonParseFillInParentage(tls, pParse, i+j, i)
}
break
}
case JSON_OBJECT:
{
- for j = U32(1); j <= (*JsonNode)(unsafe.Pointer(pNode)).Fn; j = j + (jsonNodeSize(tls, ((pNode+uintptr(j)*12)+uintptr(1)*12)) + U32(1)) {
- *(*U32)(unsafe.Pointer((*JsonParse)(unsafe.Pointer(pParse)).FaUp + uintptr((i+j))*4)) = i
- jsonParseFillInParentage(tls, pParse, ((i + j) + U32(1)), i)
+ for j = U32(1); j <= (*JsonNode)(unsafe.Pointer(pNode)).Fn; j = j + (jsonNodeSize(tls, pNode+uintptr(j)*12+uintptr(1)*12) + U32(1)) {
+ *(*U32)(unsafe.Pointer((*JsonParse)(unsafe.Pointer(pParse)).FaUp + uintptr(i+j)*4)) = i
+ jsonParseFillInParentage(tls, pParse, i+j+U32(1), i)
}
break
@@ -151040,10 +153218,10 @@ func jsonParseFillInParentage(tls *libc.TLS, pParse uintptr, i U32, iParent U32)
}
// Compute the parentage of all nodes in a completed parse.
-func jsonParseFindParents(tls *libc.TLS, pParse uintptr) int32 { /* sqlite3.c:190644:12: */
+func jsonParseFindParents(tls *libc.TLS, pParse uintptr) int32 { /* sqlite3.c:192237:12: */
var aUp uintptr
- aUp = libc.AssignPtrUintptr(pParse+16 /* &.aUp */, Xsqlite3_malloc64(tls, (uint64(uint32(unsafe.Sizeof(U32(0)))*(*JsonParse)(unsafe.Pointer(pParse)).FnNode))))
+ aUp = libc.AssignPtrUintptr(pParse+16, Xsqlite3_malloc64(tls, uint64(uint32(unsafe.Sizeof(U32(0)))*(*JsonParse)(unsafe.Pointer(pParse)).FnNode)))
if aUp == uintptr(0) {
(*JsonParse)(unsafe.Pointer(pParse)).Foom = U8(1)
return SQLITE_NOMEM
@@ -151060,7 +153238,7 @@ func jsonParseFindParents(tls *libc.TLS, pParse uintptr) int32 { /* sqlite3.c:19
// is no longer valid, parse the JSON again and return the new parse,
// and also register the new parse so that it will be available for
// future sqlite3_get_auxdata() calls.
-func jsonParseCached(tls *libc.TLS, pCtx uintptr, argv uintptr, pErrCtx uintptr) uintptr { /* sqlite3.c:190670:18: */
+func jsonParseCached(tls *libc.TLS, pCtx uintptr, argv uintptr, pErrCtx uintptr) uintptr { /* sqlite3.c:192263:18: */
var zJson uintptr = Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv)))
var nJson int32 = Xsqlite3_value_bytes(tls, *(*uintptr)(unsafe.Pointer(argv)))
var p uintptr
@@ -151073,14 +153251,14 @@ func jsonParseCached(tls *libc.TLS, pCtx uintptr, argv uintptr, pErrCtx uintptr)
return uintptr(0)
}
for iKey = 0; iKey < JSON_CACHE_SZ; iKey++ {
- p = Xsqlite3_get_auxdata(tls, pCtx, ((-429938) + iKey))
+ p = Xsqlite3_get_auxdata(tls, pCtx, -429938+iKey)
if p == uintptr(0) {
iMinKey = iKey
break
}
- if ((pMatch == uintptr(0)) &&
- ((*JsonParse)(unsafe.Pointer(p)).FnJson == nJson)) &&
- (libc.Xmemcmp(tls, (*JsonParse)(unsafe.Pointer(p)).FzJson, zJson, uint32(nJson)) == 0) {
+ if pMatch == uintptr(0) &&
+ (*JsonParse)(unsafe.Pointer(p)).FnJson == nJson &&
+ libc.Xmemcmp(tls, (*JsonParse)(unsafe.Pointer(p)).FzJson, zJson, uint32(nJson)) == 0 {
(*JsonParse)(unsafe.Pointer(p)).FnErr = U8(0)
pMatch = p
} else if (*JsonParse)(unsafe.Pointer(p)).FiHold < iMinHold {
@@ -151093,41 +153271,42 @@ func jsonParseCached(tls *libc.TLS, pCtx uintptr, argv uintptr, pErrCtx uintptr)
}
if pMatch != 0 {
(*JsonParse)(unsafe.Pointer(pMatch)).FnErr = U8(0)
- (*JsonParse)(unsafe.Pointer(pMatch)).FiHold = (iMaxHold + U32(1))
+ (*JsonParse)(unsafe.Pointer(pMatch)).FiHold = iMaxHold + U32(1)
return pMatch
}
- p = Xsqlite3_malloc64(tls, (uint64((uint32(unsafe.Sizeof(JsonParse{})) + uint32(nJson)) + uint32(1))))
+ p = Xsqlite3_malloc64(tls, uint64(uint32(unsafe.Sizeof(JsonParse{}))+uint32(nJson)+uint32(1)))
if p == uintptr(0) {
Xsqlite3_result_error_nomem(tls, pCtx)
return uintptr(0)
}
libc.Xmemset(tls, p, 0, uint32(unsafe.Sizeof(JsonParse{})))
- (*JsonParse)(unsafe.Pointer(p)).FzJson = (p + 1*32)
- libc.Xmemcpy(tls, (*JsonParse)(unsafe.Pointer(p)).FzJson, zJson, (uint32(nJson + 1)))
+ (*JsonParse)(unsafe.Pointer(p)).FzJson = p + 1*32
+ libc.Xmemcpy(tls, (*JsonParse)(unsafe.Pointer(p)).FzJson, zJson, uint32(nJson+1))
if jsonParse(tls, p, pErrCtx, (*JsonParse)(unsafe.Pointer(p)).FzJson) != 0 {
Xsqlite3_free(tls, p)
return uintptr(0)
}
(*JsonParse)(unsafe.Pointer(p)).FnJson = nJson
- (*JsonParse)(unsafe.Pointer(p)).FiHold = (iMaxHold + U32(1))
- Xsqlite3_set_auxdata(tls, pCtx, ((-429938) + iMinKey), p,
+ (*JsonParse)(unsafe.Pointer(p)).FiHold = iMaxHold + U32(1)
+ Xsqlite3_set_auxdata(tls, pCtx, -429938+iMinKey, p,
*(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{jsonParseFree})))
- return Xsqlite3_get_auxdata(tls, pCtx, ((-429938) + iMinKey))
+ return Xsqlite3_get_auxdata(tls, pCtx, -429938+iMinKey)
}
// Compare the OBJECT label at pNode against zKey,nKey. Return true on
// a match.
-func jsonLabelCompare(tls *libc.TLS, pNode uintptr, zKey uintptr, nKey U32) int32 { /* sqlite3.c:190732:12: */
- if (int32((*JsonNode)(unsafe.Pointer(pNode)).FjnFlags) & JNODE_RAW) != 0 {
+func jsonLabelCompare(tls *libc.TLS, pNode uintptr, zKey uintptr, nKey U32) int32 { /* sqlite3.c:192325:12: */
+
+ if int32((*JsonNode)(unsafe.Pointer(pNode)).FjnFlags)&JNODE_RAW != 0 {
if (*JsonNode)(unsafe.Pointer(pNode)).Fn != nKey {
return 0
}
- return (libc.Bool32(libc.Xstrncmp(tls, *(*uintptr)(unsafe.Pointer(pNode + 8 /* &.u */)), zKey, nKey) == 0))
+ return libc.Bool32(libc.Xstrncmp(tls, *(*uintptr)(unsafe.Pointer(pNode + 8)), zKey, nKey) == 0)
} else {
- if (*JsonNode)(unsafe.Pointer(pNode)).Fn != (nKey + U32(2)) {
+ if (*JsonNode)(unsafe.Pointer(pNode)).Fn != nKey+U32(2) {
return 0
}
- return (libc.Bool32(libc.Xstrncmp(tls, (*(*uintptr)(unsafe.Pointer(pNode + 8 /* &.u */))+uintptr(1)), zKey, nKey) == 0))
+ return libc.Bool32(libc.Xstrncmp(tls, *(*uintptr)(unsafe.Pointer(pNode + 8))+uintptr(1), zKey, nKey) == 0)
}
return int32(0)
}
@@ -151139,16 +153318,16 @@ func jsonLabelCompare(tls *libc.TLS, pNode uintptr, zKey uintptr, nKey U32) int3
// If pApnd!=0, then try to append new nodes to complete zPath if it is
// possible to do so and if no existing node corresponds to zPath. If
// new nodes are appended *pApnd is set to 1.
-func jsonLookupStep(tls *libc.TLS, pParse uintptr, iRoot U32, zPath uintptr, pApnd uintptr, pzErr uintptr) uintptr { /* sqlite3.c:190754:17: */
+func jsonLookupStep(tls *libc.TLS, pParse uintptr, iRoot U32, zPath uintptr, pApnd uintptr, pzErr uintptr) uintptr { /* sqlite3.c:192348:17: */
var i U32
var j U32
var nKey U32
var zKey uintptr
- var pRoot uintptr = ((*JsonParse)(unsafe.Pointer(pParse)).FaNode + uintptr(iRoot)*12)
+ var pRoot uintptr = (*JsonParse)(unsafe.Pointer(pParse)).FaNode + uintptr(iRoot)*12
if int32(*(*uint8)(unsafe.Pointer(zPath))) == 0 {
return pRoot
}
- if (int32((*JsonNode)(unsafe.Pointer(pRoot)).FjnFlags) & JNODE_REPLACE) != 0 {
+ if int32((*JsonNode)(unsafe.Pointer(pRoot)).FjnFlags)&JNODE_REPLACE != 0 {
return uintptr(0)
}
if int32(*(*uint8)(unsafe.Pointer(zPath))) == '.' {
@@ -151157,10 +153336,10 @@ func jsonLookupStep(tls *libc.TLS, pParse uintptr, iRoot U32, zPath uintptr, pAp
}
zPath++
if int32(*(*uint8)(unsafe.Pointer(zPath))) == '"' {
- zKey = (zPath + uintptr(1))
- for i = U32(1); (*(*uint8)(unsafe.Pointer(zPath + uintptr(i))) != 0) && (int32(*(*uint8)(unsafe.Pointer(zPath + uintptr(i)))) != '"'); i++ {
+ zKey = zPath + uintptr(1)
+ for i = U32(1); *(*uint8)(unsafe.Pointer(zPath + uintptr(i))) != 0 && int32(*(*uint8)(unsafe.Pointer(zPath + uintptr(i)))) != '"'; i++ {
}
- nKey = (i - U32(1))
+ nKey = i - U32(1)
if *(*uint8)(unsafe.Pointer(zPath + uintptr(i))) != 0 {
i++
} else {
@@ -151169,7 +153348,7 @@ func jsonLookupStep(tls *libc.TLS, pParse uintptr, iRoot U32, zPath uintptr, pAp
}
} else {
zKey = zPath
- for i = U32(0); ((*(*uint8)(unsafe.Pointer(zPath + uintptr(i))) != 0) && (int32(*(*uint8)(unsafe.Pointer(zPath + uintptr(i)))) != '.')) && (int32(*(*uint8)(unsafe.Pointer(zPath + uintptr(i)))) != '['); i++ {
+ for i = U32(0); *(*uint8)(unsafe.Pointer(zPath + uintptr(i))) != 0 && int32(*(*uint8)(unsafe.Pointer(zPath + uintptr(i)))) != '.' && int32(*(*uint8)(unsafe.Pointer(zPath + uintptr(i)))) != '['; i++ {
}
nKey = i
}
@@ -151180,17 +153359,18 @@ func jsonLookupStep(tls *libc.TLS, pParse uintptr, iRoot U32, zPath uintptr, pAp
j = U32(1)
for {
for j <= (*JsonNode)(unsafe.Pointer(pRoot)).Fn {
- if jsonLabelCompare(tls, (pRoot+uintptr(j)*12), zKey, nKey) != 0 {
- return jsonLookupStep(tls, pParse, ((iRoot + j) + U32(1)), (zPath + uintptr(i)), pApnd, pzErr)
+ if jsonLabelCompare(tls, pRoot+uintptr(j)*12, zKey, nKey) != 0 {
+ return jsonLookupStep(tls, pParse, iRoot+j+U32(1), zPath+uintptr(i), pApnd, pzErr)
}
j++
- j = j + (jsonNodeSize(tls, (pRoot + uintptr(j)*12)))
+ j = j + jsonNodeSize(tls, pRoot+uintptr(j)*12)
}
- if (int32((*JsonNode)(unsafe.Pointer(pRoot)).FjnFlags) & JNODE_APPEND) == 0 {
+ if int32((*JsonNode)(unsafe.Pointer(pRoot)).FjnFlags)&JNODE_APPEND == 0 {
break
}
- iRoot = iRoot + (*(*U32)(unsafe.Pointer(pRoot + 8 /* &.u */)))
- pRoot = ((*JsonParse)(unsafe.Pointer(pParse)).FaNode + uintptr(iRoot)*12)
+
+ iRoot = iRoot + *(*U32)(unsafe.Pointer(pRoot + 8))
+ pRoot = (*JsonParse)(unsafe.Pointer(pParse)).FaNode + uintptr(iRoot)*12
j = U32(1)
}
if pApnd != 0 {
@@ -151205,21 +153385,23 @@ func jsonLookupStep(tls *libc.TLS, pParse uintptr, iRoot U32, zPath uintptr, pAp
return uintptr(0)
}
if pNode != 0 {
- pRoot = ((*JsonParse)(unsafe.Pointer(pParse)).FaNode + uintptr(iRoot)*12)
- *(*U32)(unsafe.Pointer(pRoot + 8 /* &.u */)) = (iStart - iRoot)
- *(*U8)(unsafe.Pointer(pRoot + 1 /* &.jnFlags */)) |= U8((JNODE_APPEND))
- *(*U8)(unsafe.Pointer((*JsonParse)(unsafe.Pointer(pParse)).FaNode + uintptr(iLabel)*12 + 1 /* &.jnFlags */)) |= U8((JNODE_RAW))
+ pRoot = (*JsonParse)(unsafe.Pointer(pParse)).FaNode + uintptr(iRoot)*12
+
+ *(*U32)(unsafe.Pointer(pRoot + 8)) = iStart - iRoot
+ *(*U8)(unsafe.Pointer(pRoot + 1)) |= U8(JNODE_APPEND)
+
+ *(*U8)(unsafe.Pointer((*JsonParse)(unsafe.Pointer(pParse)).FaNode + uintptr(iLabel)*12 + 1)) |= U8(JNODE_RAW)
}
return pNode
}
} else if int32(*(*uint8)(unsafe.Pointer(zPath))) == '[' {
i = U32(0)
j = U32(1)
- for (int32(Xsqlite3CtypeMap[uint8(*(*uint8)(unsafe.Pointer(zPath + uintptr(j))))]) & 0x04) != 0 {
- i = (((i * U32(10)) + U32(*(*uint8)(unsafe.Pointer(zPath + uintptr(j))))) - U32('0'))
+ for int32(Xsqlite3CtypeMap[uint8(*(*uint8)(unsafe.Pointer(zPath + uintptr(j))))])&0x04 != 0 {
+ i = i*U32(10) + U32(*(*uint8)(unsafe.Pointer(zPath + uintptr(j)))) - U32('0')
j++
}
- if (j < U32(2)) || (int32(*(*uint8)(unsafe.Pointer(zPath + uintptr(j)))) != ']') {
+ if j < U32(2) || int32(*(*uint8)(unsafe.Pointer(zPath + uintptr(j)))) != ']' {
if int32(*(*uint8)(unsafe.Pointer(zPath + 1))) == '#' {
var pBase uintptr = pRoot
var iBase int32 = int32(iRoot)
@@ -151228,30 +153410,31 @@ func jsonLookupStep(tls *libc.TLS, pParse uintptr, iRoot U32, zPath uintptr, pAp
}
for {
for j <= (*JsonNode)(unsafe.Pointer(pBase)).Fn {
- if (int32((*JsonNode)(unsafe.Pointer(pBase+uintptr(j)*12)).FjnFlags) & JNODE_REMOVE) == 0 {
+ if int32((*JsonNode)(unsafe.Pointer(pBase+uintptr(j)*12)).FjnFlags)&JNODE_REMOVE == 0 {
i++
}
- j = j + (jsonNodeSize(tls, (pBase + uintptr(j)*12)))
+ j = j + jsonNodeSize(tls, pBase+uintptr(j)*12)
}
- if (int32((*JsonNode)(unsafe.Pointer(pBase)).FjnFlags) & JNODE_APPEND) == 0 {
+ if int32((*JsonNode)(unsafe.Pointer(pBase)).FjnFlags)&JNODE_APPEND == 0 {
break
}
- iBase = int32(U32(iBase) + (*(*U32)(unsafe.Pointer(pBase + 8 /* &.u */))))
- pBase = ((*JsonParse)(unsafe.Pointer(pParse)).FaNode + uintptr(iBase)*12)
+
+ iBase = int32(U32(iBase) + *(*U32)(unsafe.Pointer(pBase + 8)))
+ pBase = (*JsonParse)(unsafe.Pointer(pParse)).FaNode + uintptr(iBase)*12
j = U32(1)
}
j = U32(2)
- if (int32(*(*uint8)(unsafe.Pointer(zPath + 2))) == '-') && ((int32(Xsqlite3CtypeMap[uint8(*(*uint8)(unsafe.Pointer(zPath + 3)))]) & 0x04) != 0) {
+ if int32(*(*uint8)(unsafe.Pointer(zPath + 2))) == '-' && int32(Xsqlite3CtypeMap[uint8(*(*uint8)(unsafe.Pointer(zPath + 3)))])&0x04 != 0 {
var x uint32 = uint32(0)
j = U32(3)
- for ok := true; ok; ok = ((int32(Xsqlite3CtypeMap[uint8(*(*uint8)(unsafe.Pointer(zPath + uintptr(j))))]) & 0x04) != 0) {
- x = (((x * uint32(10)) + uint32(*(*uint8)(unsafe.Pointer(zPath + uintptr(j))))) - uint32('0'))
+ for ok := true; ok; ok = int32(Xsqlite3CtypeMap[uint8(*(*uint8)(unsafe.Pointer(zPath + uintptr(j))))])&0x04 != 0 {
+ x = x*uint32(10) + uint32(*(*uint8)(unsafe.Pointer(zPath + uintptr(j)))) - uint32('0')
j++
}
if x > i {
return uintptr(0)
}
- i = i - (x)
+ i = i - x
}
if int32(*(*uint8)(unsafe.Pointer(zPath + uintptr(j)))) != ']' {
*(*uintptr)(unsafe.Pointer(pzErr)) = zPath
@@ -151265,26 +153448,27 @@ func jsonLookupStep(tls *libc.TLS, pParse uintptr, iRoot U32, zPath uintptr, pAp
if int32((*JsonNode)(unsafe.Pointer(pRoot)).FeType) != JSON_ARRAY {
return uintptr(0)
}
- zPath += (uintptr(j + U32(1)))
+ zPath += uintptr(j + U32(1))
j = U32(1)
for {
- for (j <= (*JsonNode)(unsafe.Pointer(pRoot)).Fn) && ((i > U32(0)) || ((int32((*JsonNode)(unsafe.Pointer(pRoot+uintptr(j)*12)).FjnFlags) & JNODE_REMOVE) != 0)) {
- if (int32((*JsonNode)(unsafe.Pointer(pRoot+uintptr(j)*12)).FjnFlags) & JNODE_REMOVE) == 0 {
+ for j <= (*JsonNode)(unsafe.Pointer(pRoot)).Fn && (i > U32(0) || int32((*JsonNode)(unsafe.Pointer(pRoot+uintptr(j)*12)).FjnFlags)&JNODE_REMOVE != 0) {
+ if int32((*JsonNode)(unsafe.Pointer(pRoot+uintptr(j)*12)).FjnFlags)&JNODE_REMOVE == 0 {
i--
}
- j = j + (jsonNodeSize(tls, (pRoot + uintptr(j)*12)))
+ j = j + jsonNodeSize(tls, pRoot+uintptr(j)*12)
}
- if (int32((*JsonNode)(unsafe.Pointer(pRoot)).FjnFlags) & JNODE_APPEND) == 0 {
+ if int32((*JsonNode)(unsafe.Pointer(pRoot)).FjnFlags)&JNODE_APPEND == 0 {
break
}
- iRoot = iRoot + (*(*U32)(unsafe.Pointer(pRoot + 8 /* &.u */)))
- pRoot = ((*JsonParse)(unsafe.Pointer(pParse)).FaNode + uintptr(iRoot)*12)
+
+ iRoot = iRoot + *(*U32)(unsafe.Pointer(pRoot + 8))
+ pRoot = (*JsonParse)(unsafe.Pointer(pParse)).FaNode + uintptr(iRoot)*12
j = U32(1)
}
if j <= (*JsonNode)(unsafe.Pointer(pRoot)).Fn {
- return jsonLookupStep(tls, pParse, (iRoot + j), zPath, pApnd, pzErr)
+ return jsonLookupStep(tls, pParse, iRoot+j, zPath, pApnd, pzErr)
}
- if (i == U32(0)) && (pApnd != 0) {
+ if i == U32(0) && pApnd != 0 {
var iStart U32
var pNode uintptr
iStart = U32(jsonParseAddNode(tls, pParse, uint32(JSON_ARRAY), uint32(1), uintptr(0)))
@@ -151293,9 +153477,11 @@ func jsonLookupStep(tls *libc.TLS, pParse uintptr, iRoot U32, zPath uintptr, pAp
return uintptr(0)
}
if pNode != 0 {
- pRoot = ((*JsonParse)(unsafe.Pointer(pParse)).FaNode + uintptr(iRoot)*12)
- *(*U32)(unsafe.Pointer(pRoot + 8 /* &.u */)) = (iStart - iRoot)
- *(*U8)(unsafe.Pointer(pRoot + 1 /* &.jnFlags */)) |= U8((JNODE_APPEND))
+ pRoot = (*JsonParse)(unsafe.Pointer(pParse)).FaNode + uintptr(iRoot)*12
+
+ *(*U32)(unsafe.Pointer(pRoot + 8)) = iStart - iRoot
+ *(*U8)(unsafe.Pointer(pRoot + 1)) |= U8(JNODE_APPEND)
+
}
return pNode
}
@@ -151307,18 +153493,18 @@ func jsonLookupStep(tls *libc.TLS, pParse uintptr, iRoot U32, zPath uintptr, pAp
// Append content to pParse that will complete zPath. Return a pointer
// to the inserted node, or return NULL if the append fails.
-func jsonLookupAppend(tls *libc.TLS, pParse uintptr, zPath uintptr, pApnd uintptr, pzErr uintptr) uintptr { /* sqlite3.c:190899:17: */
+func jsonLookupAppend(tls *libc.TLS, pParse uintptr, zPath uintptr, pApnd uintptr, pzErr uintptr) uintptr { /* sqlite3.c:192500:17: */
*(*int32)(unsafe.Pointer(pApnd)) = 1
if int32(*(*uint8)(unsafe.Pointer(zPath))) == 0 {
jsonParseAddNode(tls, pParse, uint32(JSON_NULL), uint32(0), uintptr(0))
if (*JsonParse)(unsafe.Pointer(pParse)).Foom != 0 {
return uintptr(0)
}
- return ((*JsonParse)(unsafe.Pointer(pParse)).FaNode + uintptr(((*JsonParse)(unsafe.Pointer(pParse)).FnNode-U32(1)))*12)
+ return (*JsonParse)(unsafe.Pointer(pParse)).FaNode + uintptr((*JsonParse)(unsafe.Pointer(pParse)).FnNode-U32(1))*12
}
if int32(*(*uint8)(unsafe.Pointer(zPath))) == '.' {
jsonParseAddNode(tls, pParse, uint32(JSON_OBJECT), uint32(0), uintptr(0))
- } else if libc.Xstrncmp(tls, zPath, ts+22834 /* "[0]" */, uint32(3)) == 0 {
+ } else if libc.Xstrncmp(tls, zPath, ts+24131, uint32(3)) == 0 {
jsonParseAddNode(tls, pParse, uint32(JSON_ARRAY), uint32(0), uintptr(0))
} else {
return uintptr(0)
@@ -151326,16 +153512,16 @@ func jsonLookupAppend(tls *libc.TLS, pParse uintptr, zPath uintptr, pApnd uintpt
if (*JsonParse)(unsafe.Pointer(pParse)).Foom != 0 {
return uintptr(0)
}
- return jsonLookupStep(tls, pParse, ((*JsonParse)(unsafe.Pointer(pParse)).FnNode - U32(1)), zPath, pApnd, pzErr)
+ return jsonLookupStep(tls, pParse, (*JsonParse)(unsafe.Pointer(pParse)).FnNode-U32(1), zPath, pApnd, pzErr)
}
// Return the text of a syntax error message on a JSON path. Space is
// obtained from sqlite3_malloc().
-func jsonPathSyntaxError(tls *libc.TLS, zErr uintptr) uintptr { /* sqlite3.c:190925:13: */
+func jsonPathSyntaxError(tls *libc.TLS, zErr uintptr) uintptr { /* sqlite3.c:192526:13: */
bp := tls.Alloc(8)
defer tls.Free(8)
- return Xsqlite3_mprintf(tls, ts+22838 /* "JSON path error ..." */, libc.VaList(bp, zErr))
+ return Xsqlite3_mprintf(tls, ts+24135 /* "JSON path error ..." */, libc.VaList(bp, zErr))
}
// Do a node lookup using zPath. Return a pointer to the node on success.
@@ -151346,7 +153532,7 @@ func jsonPathSyntaxError(tls *libc.TLS, zErr uintptr) uintptr { /* sqlite3.c:190
//
// If pApnd!=NULL then try to append missing nodes and set *pApnd = 1 if
// nodes are appended.
-func jsonLookup(tls *libc.TLS, pParse uintptr, zPath uintptr, pApnd uintptr, pCtx uintptr) uintptr { /* sqlite3.c:190939:17: */
+func jsonLookup(tls *libc.TLS, pParse uintptr, zPath uintptr, pApnd uintptr, pCtx uintptr) uintptr { /* sqlite3.c:192540:17: */
bp := tls.Alloc(4)
defer tls.Free(4)
@@ -151372,7 +153558,7 @@ __2:
;
zPath++
pNode = jsonLookupStep(tls, pParse, uint32(0), zPath, pApnd, bp /* &zErr */)
- if !(*(*uintptr)(unsafe.Pointer(bp /* zErr */)) == uintptr(0)) {
+ if !(*(*uintptr)(unsafe.Pointer(bp)) == uintptr(0)) {
goto __3
}
return pNode
@@ -151398,29 +153584,29 @@ __5:
// Report the wrong number of arguments for json_insert(), json_replace()
// or json_set().
-func jsonWrongNumArgs(tls *libc.TLS, pCtx uintptr, zFuncName uintptr) { /* sqlite3.c:190976:13: */
+func jsonWrongNumArgs(tls *libc.TLS, pCtx uintptr, zFuncName uintptr) { /* sqlite3.c:192577:13: */
bp := tls.Alloc(8)
defer tls.Free(8)
- var zMsg uintptr = Xsqlite3_mprintf(tls, ts+22864, /* "json_%s() needs ..." */
+ var zMsg uintptr = Xsqlite3_mprintf(tls, ts+24161, /* "json_%s() needs ..." */
libc.VaList(bp, zFuncName))
Xsqlite3_result_error(tls, pCtx, zMsg, -1)
Xsqlite3_free(tls, zMsg)
}
// Mark all NULL entries in the Object passed in as JNODE_REMOVE.
-func jsonRemoveAllNulls(tls *libc.TLS, pNode uintptr) { /* sqlite3.c:190989:13: */
+func jsonRemoveAllNulls(tls *libc.TLS, pNode uintptr) { /* sqlite3.c:192590:13: */
var i int32
var n int32
n = int32((*JsonNode)(unsafe.Pointer(pNode)).Fn)
- for i = 2; i <= n; i = int32(U32(i) + (jsonNodeSize(tls, (pNode+uintptr(i)*12)) + U32(1))) {
+ for i = 2; i <= n; i = int32(U32(i) + (jsonNodeSize(tls, pNode+uintptr(i)*12) + U32(1))) {
switch int32((*JsonNode)(unsafe.Pointer(pNode + uintptr(i)*12)).FeType) {
case JSON_NULL:
- *(*U8)(unsafe.Pointer(pNode + uintptr(i)*12 + 1 /* &.jnFlags */)) |= U8((JNODE_REMOVE))
+ *(*U8)(unsafe.Pointer(pNode + uintptr(i)*12 + 1)) |= U8(JNODE_REMOVE)
break
case JSON_OBJECT:
- jsonRemoveAllNulls(tls, (pNode + uintptr(i)*12))
+ jsonRemoveAllNulls(tls, pNode+uintptr(i)*12)
break
}
}
@@ -151440,7 +153626,7 @@ func jsonRemoveAllNulls(tls *libc.TLS, pNode uintptr) { /* sqlite3.c:190989:13:
// corresponding to the SQL value input. Mostly this means putting
// double-quotes around strings and returning the unquoted string "null"
// when given a NULL input.
-func jsonQuoteFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { /* sqlite3.c:191074:13: */
+func jsonQuoteFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { /* sqlite3.c:192679:13: */
bp := tls.Alloc(128)
defer tls.Free(128)
@@ -151457,7 +153643,7 @@ func jsonQuoteFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { /* sq
// Implementation of the json_array(VALUE,...) function. Return a JSON
// array that contains all values given in arguments. Or if any argument
// is a BLOB, throw an error.
-func jsonArrayFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { /* sqlite3.c:191093:13: */
+func jsonArrayFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { /* sqlite3.c:192698:13: */
bp := tls.Alloc(128)
defer tls.Free(128)
@@ -151480,7 +153666,7 @@ func jsonArrayFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { /* sq
//
// Return the number of elements in the top-level JSON array.
// Return 0 if the input is not a well-formed JSON array.
-func jsonArrayLengthFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { /* sqlite3.c:191120:13: */
+func jsonArrayLengthFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { /* sqlite3.c:192725:13: */
var p uintptr // The parse
var n Sqlite3_int64 = int64(0)
var i U32
@@ -151503,7 +153689,7 @@ func jsonArrayLengthFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) {
if int32((*JsonNode)(unsafe.Pointer(pNode)).FeType) == JSON_ARRAY {
for i = U32(1); i <= (*JsonNode)(unsafe.Pointer(pNode)).Fn; n++ {
- i = i + (jsonNodeSize(tls, (pNode + uintptr(i)*12)))
+ i = i + jsonNodeSize(tls, pNode+uintptr(i)*12)
}
}
Xsqlite3_result_int64(tls, ctx, n)
@@ -151515,7 +153701,7 @@ func jsonArrayLengthFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) {
// PATH element. If there are multiple PATHs, then return a JSON array
// with the result from each path. Throw an error if the JSON or any PATH
// is malformed.
-func jsonExtractFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { /* sqlite3.c:191159:13: */
+func jsonExtractFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { /* sqlite3.c:192764:13: */
bp := tls.Alloc(128)
defer tls.Free(128)
@@ -151546,13 +153732,13 @@ func jsonExtractFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { /*
if pNode != 0 {
jsonRenderNode(tls, pNode, bp /* &jx */, uintptr(0))
} else {
- jsonAppendRaw(tls, bp /* &jx */, ts+5258 /* "null" */, uint32(4))
+ jsonAppendRaw(tls, bp /* &jx */, ts+6105 /* "null" */, uint32(4))
}
} else if pNode != 0 {
jsonReturn(tls, pNode, ctx, uintptr(0))
}
}
- if (argc > 2) && (i == argc) {
+ if argc > 2 && i == argc {
jsonAppendChar(tls, bp /* &jx */, uint8(']'))
jsonResult(tls, bp /* &jx */)
Xsqlite3_result_subtype(tls, ctx, uint32(JSON_SUBTYPE))
@@ -151561,7 +153747,7 @@ func jsonExtractFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { /*
}
// This is the RFC 7396 MergePatch algorithm.
-func jsonMergePatch(tls *libc.TLS, pParse uintptr, iTarget U32, pPatch uintptr) uintptr { /* sqlite3.c:191200:17: */
+func jsonMergePatch(tls *libc.TLS, pParse uintptr, iTarget U32, pPatch uintptr) uintptr { /* sqlite3.c:192805:17: */
var i U32
var j U32
var iRoot U32
@@ -151570,43 +153756,44 @@ func jsonMergePatch(tls *libc.TLS, pParse uintptr, iTarget U32, pPatch uintptr)
return pPatch
}
- pTarget = ((*JsonParse)(unsafe.Pointer(pParse)).FaNode + uintptr(iTarget)*12)
+ pTarget = (*JsonParse)(unsafe.Pointer(pParse)).FaNode + uintptr(iTarget)*12
if int32((*JsonNode)(unsafe.Pointer(pTarget)).FeType) != JSON_OBJECT {
jsonRemoveAllNulls(tls, pPatch)
return pPatch
}
iRoot = iTarget
- for i = U32(1); i < (*JsonNode)(unsafe.Pointer(pPatch)).Fn; i = i + (jsonNodeSize(tls, (pPatch+uintptr((i+U32(1)))*12)) + U32(1)) {
+ for i = U32(1); i < (*JsonNode)(unsafe.Pointer(pPatch)).Fn; i = i + (jsonNodeSize(tls, pPatch+uintptr(i+U32(1))*12) + U32(1)) {
var nKey U32
var zKey uintptr
nKey = (*JsonNode)(unsafe.Pointer(pPatch + uintptr(i)*12)).Fn
- zKey = *(*uintptr)(unsafe.Pointer(pPatch + uintptr(i)*12 + 8 /* &.u */))
+ zKey = *(*uintptr)(unsafe.Pointer(pPatch + uintptr(i)*12 + 8))
- for j = U32(1); j < (*JsonNode)(unsafe.Pointer(pTarget)).Fn; j = j + (jsonNodeSize(tls, (pTarget+uintptr((j+U32(1)))*12)) + U32(1)) {
+ for j = U32(1); j < (*JsonNode)(unsafe.Pointer(pTarget)).Fn; j = j + (jsonNodeSize(tls, pTarget+uintptr(j+U32(1))*12) + U32(1)) {
- if ((*JsonNode)(unsafe.Pointer(pTarget+uintptr(j)*12)).Fn == nKey) && (libc.Xstrncmp(tls, *(*uintptr)(unsafe.Pointer(pTarget + uintptr(j)*12 + 8 /* &.u */)), zKey, nKey) == 0) {
- if (int32((*JsonNode)(unsafe.Pointer(pTarget+uintptr((j+U32(1)))*12)).FjnFlags) & (JNODE_REMOVE | JNODE_PATCH)) != 0 {
+ if (*JsonNode)(unsafe.Pointer(pTarget+uintptr(j)*12)).Fn == nKey && libc.Xstrncmp(tls, *(*uintptr)(unsafe.Pointer(pTarget + uintptr(j)*12 + 8)), zKey, nKey) == 0 {
+ if int32((*JsonNode)(unsafe.Pointer(pTarget+uintptr(j+U32(1))*12)).FjnFlags)&(JNODE_REMOVE|JNODE_PATCH) != 0 {
break
}
- if int32((*JsonNode)(unsafe.Pointer(pPatch+uintptr((i+U32(1)))*12)).FeType) == JSON_NULL {
- *(*U8)(unsafe.Pointer(pTarget + uintptr((j+U32(1)))*12 + 1 /* &.jnFlags */)) |= U8((JNODE_REMOVE))
+ if int32((*JsonNode)(unsafe.Pointer(pPatch+uintptr(i+U32(1))*12)).FeType) == JSON_NULL {
+ *(*U8)(unsafe.Pointer(pTarget + uintptr(j+U32(1))*12 + 1)) |= U8(JNODE_REMOVE)
} else {
- var pNew uintptr = jsonMergePatch(tls, pParse, ((iTarget + j) + U32(1)), (pPatch + uintptr((i+U32(1)))*12))
+ var pNew uintptr = jsonMergePatch(tls, pParse, iTarget+j+U32(1), pPatch+uintptr(i+U32(1))*12)
if pNew == uintptr(0) {
return uintptr(0)
}
- pTarget = ((*JsonParse)(unsafe.Pointer(pParse)).FaNode + uintptr(iTarget)*12)
- if pNew != (pTarget + uintptr((j+U32(1)))*12) {
- *(*uintptr)(unsafe.Pointer(pTarget + uintptr((j+U32(1)))*12 + 8 /* &.u */)) = pNew
- *(*U8)(unsafe.Pointer(pTarget + uintptr((j+U32(1)))*12 + 1 /* &.jnFlags */)) |= U8((JNODE_PATCH))
+ pTarget = (*JsonParse)(unsafe.Pointer(pParse)).FaNode + uintptr(iTarget)*12
+ if pNew != pTarget+uintptr(j+U32(1))*12 {
+
+ *(*uintptr)(unsafe.Pointer(pTarget + uintptr(j+U32(1))*12 + 8)) = pNew
+ *(*U8)(unsafe.Pointer(pTarget + uintptr(j+U32(1))*12 + 1)) |= U8(JNODE_PATCH)
}
}
break
}
}
- if (j >= (*JsonNode)(unsafe.Pointer(pTarget)).Fn) && (int32((*JsonNode)(unsafe.Pointer(pPatch+uintptr((i+U32(1)))*12)).FeType) != JSON_NULL) {
+ if j >= (*JsonNode)(unsafe.Pointer(pTarget)).Fn && int32((*JsonNode)(unsafe.Pointer(pPatch+uintptr(i+U32(1))*12)).FeType) != JSON_NULL {
var iStart int32
var iPatch int32
iStart = jsonParseAddNode(tls, pParse, uint32(JSON_OBJECT), uint32(2), uintptr(0))
@@ -151616,12 +153803,15 @@ func jsonMergePatch(tls *libc.TLS, pParse uintptr, iTarget U32, pPatch uintptr)
return uintptr(0)
}
jsonRemoveAllNulls(tls, pPatch)
- pTarget = ((*JsonParse)(unsafe.Pointer(pParse)).FaNode + uintptr(iTarget)*12)
- *(*U8)(unsafe.Pointer((*JsonParse)(unsafe.Pointer(pParse)).FaNode + uintptr(iRoot)*12 + 1 /* &.jnFlags */)) |= U8((JNODE_APPEND))
- *(*U32)(unsafe.Pointer((*JsonParse)(unsafe.Pointer(pParse)).FaNode + uintptr(iRoot)*12 + 8 /* &.u */)) = (U32(iStart) - iRoot)
+ pTarget = (*JsonParse)(unsafe.Pointer(pParse)).FaNode + uintptr(iTarget)*12
+
+ *(*U8)(unsafe.Pointer((*JsonParse)(unsafe.Pointer(pParse)).FaNode + uintptr(iRoot)*12 + 1)) |= U8(JNODE_APPEND)
+
+ *(*U32)(unsafe.Pointer((*JsonParse)(unsafe.Pointer(pParse)).FaNode + uintptr(iRoot)*12 + 8)) = U32(iStart) - iRoot
iRoot = U32(iStart)
- *(*U8)(unsafe.Pointer((*JsonParse)(unsafe.Pointer(pParse)).FaNode + uintptr(iPatch)*12 + 1 /* &.jnFlags */)) |= U8((JNODE_PATCH))
- *(*uintptr)(unsafe.Pointer((*JsonParse)(unsafe.Pointer(pParse)).FaNode + uintptr(iPatch)*12 + 8 /* &.u */)) = (pPatch + uintptr((i+U32(1)))*12)
+
+ *(*U8)(unsafe.Pointer((*JsonParse)(unsafe.Pointer(pParse)).FaNode + uintptr(iPatch)*12 + 1)) |= U8(JNODE_PATCH)
+ *(*uintptr)(unsafe.Pointer((*JsonParse)(unsafe.Pointer(pParse)).FaNode + uintptr(iPatch)*12 + 8)) = pPatch + uintptr(i+U32(1))*12
}
}
return pTarget
@@ -151630,7 +153820,7 @@ func jsonMergePatch(tls *libc.TLS, pParse uintptr, iTarget U32, pPatch uintptr)
// Implementation of the json_mergepatch(JSON1,JSON2) function. Return a JSON
// object that is the result of running the RFC 7396 MergePatch() algorithm
// on the two arguments.
-func jsonPatchFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { /* sqlite3.c:191270:13: */
+func jsonPatchFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { /* sqlite3.c:192887:13: */
bp := tls.Alloc(64)
defer tls.Free(64)
@@ -151641,10 +153831,10 @@ func jsonPatchFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { /* sq
var pResult uintptr // The result of the merge
_ = argc
- if jsonParse(tls, bp /* &x */, ctx, Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv)))) != 0 {
+ if jsonParse(tls, bp, ctx, Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv)))) != 0 {
return
}
- if jsonParse(tls, bp+32 /* &y */, ctx, Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv + 1*4)))) != 0 {
+ if jsonParse(tls, bp+32, ctx, Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv + 1*4)))) != 0 {
jsonParseReset(tls, bp /* &x */)
return
}
@@ -151662,7 +153852,7 @@ func jsonPatchFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { /* sq
// Implementation of the json_object(NAME,VALUE,...) function. Return a JSON
// object that contains all name/value given in arguments. Or if any name
// is not a string or if any value is a BLOB, throw an error.
-func jsonObjectFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { /* sqlite3.c:191302:13: */
+func jsonObjectFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { /* sqlite3.c:192919:13: */
bp := tls.Alloc(128)
defer tls.Free(128)
@@ -151672,16 +153862,16 @@ func jsonObjectFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { /* s
var z uintptr
var n U32
- if (argc & 1) != 0 {
+ if argc&1 != 0 {
Xsqlite3_result_error(tls, ctx,
- ts+22907 /* "json_object() re..." */, -1)
+ ts+24204 /* "json_object() re..." */, -1)
return
}
jsonInit(tls, bp /* &jx */, ctx)
jsonAppendChar(tls, bp /* &jx */, uint8('{'))
- for i = 0; i < argc; i = i + (2) {
+ for i = 0; i < argc; i = i + 2 {
if Xsqlite3_value_type(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*4))) != SQLITE_TEXT {
- Xsqlite3_result_error(tls, ctx, ts+22958 /* "json_object() la..." */, -1)
+ Xsqlite3_result_error(tls, ctx, ts+24255 /* "json_object() la..." */, -1)
jsonReset(tls, bp /* &jx */)
return
}
@@ -151690,7 +153880,7 @@ func jsonObjectFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { /* s
n = U32(Xsqlite3_value_bytes(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*4))))
jsonAppendString(tls, bp /* &jx */, z, n)
jsonAppendChar(tls, bp /* &jx */, uint8(':'))
- jsonAppendValue(tls, bp /* &jx */, *(*uintptr)(unsafe.Pointer(argv + uintptr((i+1))*4)))
+ jsonAppendValue(tls, bp /* &jx */, *(*uintptr)(unsafe.Pointer(argv + uintptr(i+1)*4)))
}
jsonAppendChar(tls, bp /* &jx */, uint8('}'))
jsonResult(tls, bp /* &jx */)
@@ -151701,7 +153891,7 @@ func jsonObjectFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { /* s
//
// Remove the named elements from JSON and return the result. malformed
// JSON or PATH arguments result in an error.
-func jsonRemoveFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { /* sqlite3.c:191344:13: */
+func jsonRemoveFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { /* sqlite3.c:192961:13: */
bp := tls.Alloc(32)
defer tls.Free(32)
@@ -151717,7 +153907,7 @@ func jsonRemoveFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { /* s
return
__1:
;
- if !(jsonParse(tls, bp /* &x */, ctx, Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv)))) != 0) {
+ if !(jsonParse(tls, bp, ctx, Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv)))) != 0) {
goto __2
}
return
@@ -151737,7 +153927,7 @@ __3:
__6:
;
pNode = jsonLookup(tls, bp /* &x */, zPath, uintptr(0), ctx)
- if !((*JsonParse)(unsafe.Pointer(bp /* &x */)).FnErr != 0) {
+ if !((*JsonParse)(unsafe.Pointer(bp)).FnErr != 0) {
goto __7
}
goto remove_done
@@ -151746,7 +153936,7 @@ __7:
if !(pNode != 0) {
goto __8
}
- *(*U8)(unsafe.Pointer(pNode + 1 /* &.jnFlags */)) |= U8((JNODE_REMOVE))
+ *(*U8)(unsafe.Pointer(pNode + 1)) |= U8(JNODE_REMOVE)
__8:
;
goto __4
@@ -151756,7 +153946,7 @@ __4:
goto __5
__5:
;
- if !((int32((*JsonNode)(unsafe.Pointer((*JsonParse)(unsafe.Pointer(bp /* &x */)).FaNode)).FjnFlags) & JNODE_REMOVE) == 0) {
+ if !(int32((*JsonNode)(unsafe.Pointer((*JsonParse)(unsafe.Pointer(bp)).FaNode)).FjnFlags)&JNODE_REMOVE == 0) {
goto __9
}
jsonReturnJson(tls, (*JsonParse)(unsafe.Pointer(bp /* &x */)).FaNode, ctx, uintptr(0))
@@ -151770,7 +153960,7 @@ remove_done:
//
// Replace the value at PATH with VALUE. If PATH does not already exist,
// this routine is a no-op. If JSON or PATH is malformed, throw an error.
-func jsonReplaceFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { /* sqlite3.c:191377:13: */
+func jsonReplaceFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { /* sqlite3.c:192994:13: */
bp := tls.Alloc(32)
defer tls.Free(32)
@@ -151786,14 +153976,14 @@ func jsonReplaceFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { /*
return
__1:
;
- if !((argc & 1) == 0) {
+ if !(argc&1 == 0) {
goto __2
}
- jsonWrongNumArgs(tls, ctx, ts+14034 /* "replace" */)
+ jsonWrongNumArgs(tls, ctx, ts+15216 /* "replace" */)
return
__2:
;
- if !(jsonParse(tls, bp /* &x */, ctx, Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv)))) != 0) {
+ if !(jsonParse(tls, bp, ctx, Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv)))) != 0) {
goto __3
}
return
@@ -151807,7 +153997,7 @@ __4:
}
zPath = Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*4)))
pNode = jsonLookup(tls, bp /* &x */, zPath, uintptr(0), ctx)
- if !((*JsonParse)(unsafe.Pointer(bp /* &x */)).FnErr != 0) {
+ if !((*JsonParse)(unsafe.Pointer(bp)).FnErr != 0) {
goto __7
}
goto replace_err
@@ -151816,21 +154006,24 @@ __7:
if !(pNode != 0) {
goto __8
}
- *(*U8)(unsafe.Pointer(pNode + 1 /* &.jnFlags */)) |= U8((int32(U8(JNODE_REPLACE))))
- *(*U32)(unsafe.Pointer(pNode + 8 /* &.u */)) = (i + U32(1))
+
+ *(*U8)(unsafe.Pointer(pNode + 1)) |= U8(int32(U8(JNODE_REPLACE)))
+
+ *(*U32)(unsafe.Pointer(pNode + 8)) = i + U32(1)
__8:
;
goto __5
__5:
- i = i + (U32(2))
+ i = i + U32(2)
goto __4
goto __6
__6:
;
- if !((int32((*JsonNode)(unsafe.Pointer((*JsonParse)(unsafe.Pointer(bp /* &x */)).FaNode)).FjnFlags) & JNODE_REPLACE) != 0) {
+ if !(int32((*JsonNode)(unsafe.Pointer((*JsonParse)(unsafe.Pointer(bp)).FaNode)).FjnFlags)&JNODE_REPLACE != 0) {
goto __9
}
- Xsqlite3_result_value(tls, ctx, *(*uintptr)(unsafe.Pointer(argv + uintptr(*(*U32)(unsafe.Pointer((*JsonParse)(unsafe.Pointer(bp /* &x */)).FaNode + 8 /* &.u */)))*4)))
+
+ Xsqlite3_result_value(tls, ctx, *(*uintptr)(unsafe.Pointer(argv + uintptr(*(*U32)(unsafe.Pointer((*JsonParse)(unsafe.Pointer(bp)).FaNode + 8)))*4)))
goto __10
__9:
jsonReturnJson(tls, (*JsonParse)(unsafe.Pointer(bp /* &x */)).FaNode, ctx, argv)
@@ -151850,7 +154043,7 @@ replace_err:
//
// Create PATH and initialize it to VALUE. If PATH already exists, this
// routine is a no-op. If JSON or PATH is malformed, throw an error.
-func jsonSetFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { /* sqlite3.c:191424:13: */
+func jsonSetFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { /* sqlite3.c:193045:13: */
bp := tls.Alloc(36)
defer tls.Free(36)
@@ -151870,19 +154063,19 @@ func jsonSetFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { /* sqli
return
__1:
;
- if !((argc & 1) == 0) {
+ if !(argc&1 == 0) {
goto __2
}
jsonWrongNumArgs(tls, ctx, func() uintptr {
if bIsSet != 0 {
- return ts + 22992 /* "set" */
+ return ts + 24289 /* "set" */
}
- return ts + 22996 /* "insert" */
+ return ts + 24293 /* "insert" */
}())
return
__2:
;
- if !(jsonParse(tls, bp /* &x */, ctx, Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv)))) != 0) {
+ if !(jsonParse(tls, bp, ctx, Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv)))) != 0) {
goto __3
}
return
@@ -151897,24 +154090,25 @@ __4:
zPath = Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*4)))
*(*int32)(unsafe.Pointer(bp + 32 /* bApnd */)) = 0
pNode = jsonLookup(tls, bp /* &x */, zPath, bp+32 /* &bApnd */, ctx)
- if !((*JsonParse)(unsafe.Pointer(bp /* &x */)).Foom != 0) {
+ if !((*JsonParse)(unsafe.Pointer(bp)).Foom != 0) {
goto __7
}
Xsqlite3_result_error_nomem(tls, ctx)
goto jsonSetDone
goto __8
__7:
- if !((*JsonParse)(unsafe.Pointer(bp /* &x */)).FnErr != 0) {
+ if !((*JsonParse)(unsafe.Pointer(bp)).FnErr != 0) {
goto __9
}
goto jsonSetDone
goto __10
__9:
- if !((pNode != 0) && ((*(*int32)(unsafe.Pointer(bp + 32 /* bApnd */)) != 0) || (bIsSet != 0))) {
+ if !(pNode != 0 && (*(*int32)(unsafe.Pointer(bp + 32)) != 0 || bIsSet != 0)) {
goto __11
}
- *(*U8)(unsafe.Pointer(pNode + 1 /* &.jnFlags */)) |= U8((int32(U8(JNODE_REPLACE))))
- *(*U32)(unsafe.Pointer(pNode + 8 /* &.u */)) = (i + U32(1))
+
+ *(*U8)(unsafe.Pointer(pNode + 1)) |= U8(int32(U8(JNODE_REPLACE)))
+ *(*U32)(unsafe.Pointer(pNode + 8)) = i + U32(1)
__11:
;
__10:
@@ -151923,15 +154117,16 @@ __8:
;
goto __5
__5:
- i = i + (U32(2))
+ i = i + U32(2)
goto __4
goto __6
__6:
;
- if !((int32((*JsonNode)(unsafe.Pointer((*JsonParse)(unsafe.Pointer(bp /* &x */)).FaNode)).FjnFlags) & JNODE_REPLACE) != 0) {
+ if !(int32((*JsonNode)(unsafe.Pointer((*JsonParse)(unsafe.Pointer(bp)).FaNode)).FjnFlags)&JNODE_REPLACE != 0) {
goto __12
}
- Xsqlite3_result_value(tls, ctx, *(*uintptr)(unsafe.Pointer(argv + uintptr(*(*U32)(unsafe.Pointer((*JsonParse)(unsafe.Pointer(bp /* &x */)).FaNode + 8 /* &.u */)))*4)))
+
+ Xsqlite3_result_value(tls, ctx, *(*uintptr)(unsafe.Pointer(argv + uintptr(*(*U32)(unsafe.Pointer((*JsonParse)(unsafe.Pointer(bp)).FaNode + 8)))*4)))
goto __13
__12:
jsonReturnJson(tls, (*JsonParse)(unsafe.Pointer(bp /* &x */)).FaNode, ctx, argv)
@@ -151946,7 +154141,7 @@ jsonSetDone:
//
// Return the top-level "type" of a JSON string. Throw an error if
// either the JSON or PATH inputs are not well-formed.
-func jsonTypeFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { /* sqlite3.c:191473:13: */
+func jsonTypeFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { /* sqlite3.c:193098:13: */
var p uintptr // The parse
var zPath uintptr
var pNode uintptr
@@ -151970,11 +154165,11 @@ func jsonTypeFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { /* sql
//
// Return 1 if JSON is a well-formed JSON string according to RFC-7159.
// Return 0 otherwise.
-func jsonValidFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { /* sqlite3.c:191501:13: */
+func jsonValidFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { /* sqlite3.c:193126:13: */
var p uintptr // The parse
_ = argc
p = jsonParseCached(tls, ctx, argv, uintptr(0))
- Xsqlite3_result_int(tls, ctx, (libc.Bool32(p != uintptr(0))))
+ Xsqlite3_result_int(tls, ctx, libc.Bool32(p != uintptr(0)))
}
// ***************************************************************************
@@ -151984,7 +154179,7 @@ func jsonValidFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { /* sq
// json_group_array(VALUE)
//
// Return a JSON array composed of all values in the aggregate.
-func jsonArrayStep(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { /* sqlite3.c:191521:13: */
+func jsonArrayStep(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { /* sqlite3.c:193146:13: */
var pStr uintptr
_ = argc
pStr = Xsqlite3_aggregate_context(tls, ctx, int32(unsafe.Sizeof(JsonString{})))
@@ -152000,7 +154195,7 @@ func jsonArrayStep(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { /* sq
}
}
-func jsonArrayCompute(tls *libc.TLS, ctx uintptr, isFinal int32) { /* sqlite3.c:191540:13: */
+func jsonArrayCompute(tls *libc.TLS, ctx uintptr, isFinal int32) { /* sqlite3.c:193165:13: */
var pStr uintptr
pStr = Xsqlite3_aggregate_context(tls, ctx, 0)
if pStr != 0 {
@@ -152025,16 +154220,16 @@ func jsonArrayCompute(tls *libc.TLS, ctx uintptr, isFinal int32) { /* sqlite3.c:
(*JsonString)(unsafe.Pointer(pStr)).FnUsed--
}
} else {
- Xsqlite3_result_text(tls, ctx, ts+23003 /* "[]" */, 2, uintptr(0))
+ Xsqlite3_result_text(tls, ctx, ts+24300 /* "[]" */, 2, uintptr(0))
}
Xsqlite3_result_subtype(tls, ctx, uint32(JSON_SUBTYPE))
}
-func jsonArrayValue(tls *libc.TLS, ctx uintptr) { /* sqlite3.c:191562:13: */
+func jsonArrayValue(tls *libc.TLS, ctx uintptr) { /* sqlite3.c:193187:13: */
jsonArrayCompute(tls, ctx, 0)
}
-func jsonArrayFinal(tls *libc.TLS, ctx uintptr) { /* sqlite3.c:191565:13: */
+func jsonArrayFinal(tls *libc.TLS, ctx uintptr) { /* sqlite3.c:193190:13: */
jsonArrayCompute(tls, ctx, 1)
}
@@ -152042,7 +154237,7 @@ func jsonArrayFinal(tls *libc.TLS, ctx uintptr) { /* sqlite3.c:191565:13: */
// It works by removing the first element of the group by searching forward
// to the first comma (",") that is not within a string and deleting all
// text through that comma.
-func jsonGroupInverse(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { /* sqlite3.c:191576:13: */
+func jsonGroupInverse(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { /* sqlite3.c:193201:13: */
var i uint32
var inStr int32 = 0
var nNest int32 = 0
@@ -152058,23 +154253,23 @@ func jsonGroupInverse(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { /*
return
}
z = (*JsonString)(unsafe.Pointer(pStr)).FzBuf
- for i = uint32(1); (U64(i) < (*JsonString)(unsafe.Pointer(pStr)).FnUsed) && ((((int32(libc.AssignUint8(&c, *(*uint8)(unsafe.Pointer(z + uintptr(i)))))) != ',') || (inStr != 0)) || (nNest != 0)); i++ {
+ for i = uint32(1); U64(i) < (*JsonString)(unsafe.Pointer(pStr)).FnUsed && (int32(libc.AssignUint8(&c, *(*uint8)(unsafe.Pointer(z + uintptr(i))))) != ',' || inStr != 0 || nNest != 0); i++ {
if int32(c) == '"' {
inStr = libc.BoolInt32(!(inStr != 0))
} else if int32(c) == '\\' {
i++
} else if !(inStr != 0) {
- if (int32(c) == '{') || (int32(c) == '[') {
+ if int32(c) == '{' || int32(c) == '[' {
nNest++
}
- if (int32(c) == '}') || (int32(c) == ']') {
+ if int32(c) == '}' || int32(c) == ']' {
nNest--
}
}
}
if U64(i) < (*JsonString)(unsafe.Pointer(pStr)).FnUsed {
- *(*U64)(unsafe.Pointer(pStr + 16 /* &.nUsed */)) -= (U64(i))
- libc.Xmemmove(tls, (z + 1), (z + uintptr((i + uint32(1)))), (Size_t((*JsonString)(unsafe.Pointer(pStr)).FnUsed) - Size_t(1)))
+ *(*U64)(unsafe.Pointer(pStr + 16)) -= U64(i)
+ libc.Xmemmove(tls, z+1, z+uintptr(i+uint32(1)), Size_t((*JsonString)(unsafe.Pointer(pStr)).FnUsed)-Size_t(1))
*(*uint8)(unsafe.Pointer(z + uintptr((*JsonString)(unsafe.Pointer(pStr)).FnUsed))) = uint8(0)
} else {
(*JsonString)(unsafe.Pointer(pStr)).FnUsed = uint64(1)
@@ -152084,7 +154279,7 @@ func jsonGroupInverse(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { /*
// json_group_obj(NAME,VALUE)
//
// Return a JSON object composed of all names and values in the aggregate.
-func jsonObjectStep(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { /* sqlite3.c:191624:13: */
+func jsonObjectStep(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { /* sqlite3.c:193249:13: */
var pStr uintptr
var z uintptr
var n U32
@@ -152106,7 +154301,7 @@ func jsonObjectStep(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { /* s
}
}
-func jsonObjectCompute(tls *libc.TLS, ctx uintptr, isFinal int32) { /* sqlite3.c:191649:13: */
+func jsonObjectCompute(tls *libc.TLS, ctx uintptr, isFinal int32) { /* sqlite3.c:193274:13: */
var pStr uintptr
pStr = Xsqlite3_aggregate_context(tls, ctx, 0)
if pStr != 0 {
@@ -152130,16 +154325,16 @@ func jsonObjectCompute(tls *libc.TLS, ctx uintptr, isFinal int32) { /* sqlite3.c
(*JsonString)(unsafe.Pointer(pStr)).FnUsed--
}
} else {
- Xsqlite3_result_text(tls, ctx, ts+23006 /* "{}" */, 2, uintptr(0))
+ Xsqlite3_result_text(tls, ctx, ts+24303 /* "{}" */, 2, uintptr(0))
}
Xsqlite3_result_subtype(tls, ctx, uint32(JSON_SUBTYPE))
}
-func jsonObjectValue(tls *libc.TLS, ctx uintptr) { /* sqlite3.c:191670:13: */
+func jsonObjectValue(tls *libc.TLS, ctx uintptr) { /* sqlite3.c:193295:13: */
jsonObjectCompute(tls, ctx, 0)
}
-func jsonObjectFinal(tls *libc.TLS, ctx uintptr) { /* sqlite3.c:191673:13: */
+func jsonObjectFinal(tls *libc.TLS, ctx uintptr) { /* sqlite3.c:193298:13: */
jsonObjectCompute(tls, ctx, 1)
}
@@ -152159,16 +154354,16 @@ type JsonEachCursor1 = struct {
FzJson uintptr
FzRoot uintptr
FsParse JsonParse
-} /* sqlite3.c:191683:9 */
+} /* sqlite3.c:193308:9 */
// ***************************************************************************
//
// The json_each virtual table
//
-type JsonEachCursor = JsonEachCursor1 /* sqlite3.c:191683:31 */
+type JsonEachCursor = JsonEachCursor1 /* sqlite3.c:193308:31 */
// Constructor for the json_each virtual table
-func jsonEachConnect(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uintptr, ppVtab uintptr, pzErr uintptr) int32 { /* sqlite3.c:191698:12: */
+func jsonEachConnect(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uintptr, ppVtab uintptr, pzErr uintptr) int32 { /* sqlite3.c:193323:12: */
var pNew uintptr
var rc int32
@@ -152183,7 +154378,7 @@ func jsonEachConnect(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv u
_ = pAux
rc = Xsqlite3_declare_vtab(tls, db,
- ts+23009 /* "CREATE TABLE x(k..." */)
+ ts+24306 /* "CREATE TABLE x(k..." */)
if rc == SQLITE_OK {
pNew = libc.AssignPtrUintptr(ppVtab, Xsqlite3_malloc(tls, int32(unsafe.Sizeof(Sqlite3_vtab{}))))
if pNew == uintptr(0) {
@@ -152196,13 +154391,13 @@ func jsonEachConnect(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv u
}
// destructor for json_each virtual table
-func jsonEachDisconnect(tls *libc.TLS, pVtab uintptr) int32 { /* sqlite3.c:191740:12: */
+func jsonEachDisconnect(tls *libc.TLS, pVtab uintptr) int32 { /* sqlite3.c:193365:12: */
Xsqlite3_free(tls, pVtab)
return SQLITE_OK
}
// constructor for a JsonEachCursor object for json_each().
-func jsonEachOpenEach(tls *libc.TLS, p uintptr, ppCursor uintptr) int32 { /* sqlite3.c:191746:12: */
+func jsonEachOpenEach(tls *libc.TLS, p uintptr, ppCursor uintptr) int32 { /* sqlite3.c:193371:12: */
var pCur uintptr
_ = p
@@ -152211,12 +154406,12 @@ func jsonEachOpenEach(tls *libc.TLS, p uintptr, ppCursor uintptr) int32 { /* sql
return SQLITE_NOMEM
}
libc.Xmemset(tls, pCur, 0, uint32(unsafe.Sizeof(JsonEachCursor{})))
- *(*uintptr)(unsafe.Pointer(ppCursor)) = (pCur /* &.base */)
+ *(*uintptr)(unsafe.Pointer(ppCursor)) = pCur
return SQLITE_OK
}
// constructor for a JsonEachCursor object for json_tree().
-func jsonEachOpenTree(tls *libc.TLS, p uintptr, ppCursor uintptr) int32 { /* sqlite3.c:191758:12: */
+func jsonEachOpenTree(tls *libc.TLS, p uintptr, ppCursor uintptr) int32 { /* sqlite3.c:193383:12: */
var rc int32 = jsonEachOpenEach(tls, p, ppCursor)
if rc == SQLITE_OK {
var pCur uintptr = *(*uintptr)(unsafe.Pointer(ppCursor))
@@ -152227,10 +154422,10 @@ func jsonEachOpenTree(tls *libc.TLS, p uintptr, ppCursor uintptr) int32 { /* sql
// Reset a JsonEachCursor back to its original state. Free any memory
// held.
-func jsonEachCursorReset(tls *libc.TLS, p uintptr) { /* sqlite3.c:191769:13: */
+func jsonEachCursorReset(tls *libc.TLS, p uintptr) { /* sqlite3.c:193394:13: */
Xsqlite3_free(tls, (*JsonEachCursor)(unsafe.Pointer(p)).FzJson)
Xsqlite3_free(tls, (*JsonEachCursor)(unsafe.Pointer(p)).FzRoot)
- jsonParseReset(tls, (p + 32 /* &.sParse */))
+ jsonParseReset(tls, p+32)
(*JsonEachCursor)(unsafe.Pointer(p)).FiRowid = U32(0)
(*JsonEachCursor)(unsafe.Pointer(p)).Fi = U32(0)
(*JsonEachCursor)(unsafe.Pointer(p)).FiEnd = U32(0)
@@ -152240,7 +154435,7 @@ func jsonEachCursorReset(tls *libc.TLS, p uintptr) { /* sqlite3.c:191769:13: */
}
// Destructor for a jsonEachCursor object
-func jsonEachClose(tls *libc.TLS, cur uintptr) int32 { /* sqlite3.c:191782:12: */
+func jsonEachClose(tls *libc.TLS, cur uintptr) int32 { /* sqlite3.c:193407:12: */
var p uintptr = cur
jsonEachCursorReset(tls, p)
Xsqlite3_free(tls, cur)
@@ -152249,29 +154444,30 @@ func jsonEachClose(tls *libc.TLS, cur uintptr) int32 { /* sqlite3.c:191782:12: *
// Return TRUE if the jsonEachCursor object has been advanced off the end
// of the JSON object
-func jsonEachEof(tls *libc.TLS, cur uintptr) int32 { /* sqlite3.c:191791:12: */
+func jsonEachEof(tls *libc.TLS, cur uintptr) int32 { /* sqlite3.c:193416:12: */
var p uintptr = cur
- return (libc.Bool32((*JsonEachCursor)(unsafe.Pointer(p)).Fi >= (*JsonEachCursor)(unsafe.Pointer(p)).FiEnd))
+ return libc.Bool32((*JsonEachCursor)(unsafe.Pointer(p)).Fi >= (*JsonEachCursor)(unsafe.Pointer(p)).FiEnd)
}
// Advance the cursor to the next element for json_tree()
-func jsonEachNext(tls *libc.TLS, cur uintptr) int32 { /* sqlite3.c:191797:12: */
+func jsonEachNext(tls *libc.TLS, cur uintptr) int32 { /* sqlite3.c:193422:12: */
var p uintptr = cur
if (*JsonEachCursor)(unsafe.Pointer(p)).FbRecursive != 0 {
- if (int32((*JsonNode)(unsafe.Pointer((*JsonEachCursor)(unsafe.Pointer(p)).FsParse.FaNode+uintptr((*JsonEachCursor)(unsafe.Pointer(p)).Fi)*12)).FjnFlags) & JNODE_LABEL) != 0 {
+ if int32((*JsonNode)(unsafe.Pointer((*JsonEachCursor)(unsafe.Pointer(p)).FsParse.FaNode+uintptr((*JsonEachCursor)(unsafe.Pointer(p)).Fi)*12)).FjnFlags)&JNODE_LABEL != 0 {
(*JsonEachCursor)(unsafe.Pointer(p)).Fi++
}
(*JsonEachCursor)(unsafe.Pointer(p)).Fi++
(*JsonEachCursor)(unsafe.Pointer(p)).FiRowid++
if (*JsonEachCursor)(unsafe.Pointer(p)).Fi < (*JsonEachCursor)(unsafe.Pointer(p)).FiEnd {
var iUp U32 = *(*U32)(unsafe.Pointer((*JsonEachCursor)(unsafe.Pointer(p)).FsParse.FaUp + uintptr((*JsonEachCursor)(unsafe.Pointer(p)).Fi)*4))
- var pUp uintptr = ((*JsonEachCursor)(unsafe.Pointer(p)).FsParse.FaNode + uintptr(iUp)*12)
+ var pUp uintptr = (*JsonEachCursor)(unsafe.Pointer(p)).FsParse.FaNode + uintptr(iUp)*12
(*JsonEachCursor)(unsafe.Pointer(p)).FeType = (*JsonNode)(unsafe.Pointer(pUp)).FeType
if int32((*JsonNode)(unsafe.Pointer(pUp)).FeType) == JSON_ARRAY {
- if iUp == ((*JsonEachCursor)(unsafe.Pointer(p)).Fi - U32(1)) {
- *(*U32)(unsafe.Pointer(pUp + 8 /* &.u */)) = U32(0)
+
+ if iUp == (*JsonEachCursor)(unsafe.Pointer(p)).Fi-U32(1) {
+ *(*U32)(unsafe.Pointer(pUp + 8)) = U32(0)
} else {
- *(*U32)(unsafe.Pointer(pUp + 8 /* &.u */))++
+ *(*U32)(unsafe.Pointer(pUp + 8))++
}
}
}
@@ -152279,7 +154475,7 @@ func jsonEachNext(tls *libc.TLS, cur uintptr) int32 { /* sqlite3.c:191797:12: */
switch int32((*JsonEachCursor)(unsafe.Pointer(p)).FeType) {
case JSON_ARRAY:
{
- *(*U32)(unsafe.Pointer(p + 12 /* &.i */)) += (jsonNodeSize(tls, ((*JsonEachCursor)(unsafe.Pointer(p)).FsParse.FaNode + uintptr((*JsonEachCursor)(unsafe.Pointer(p)).Fi)*12)))
+ *(*U32)(unsafe.Pointer(p + 12)) += jsonNodeSize(tls, (*JsonEachCursor)(unsafe.Pointer(p)).FsParse.FaNode+uintptr((*JsonEachCursor)(unsafe.Pointer(p)).Fi)*12)
(*JsonEachCursor)(unsafe.Pointer(p)).FiRowid++
break
@@ -152287,7 +154483,7 @@ func jsonEachNext(tls *libc.TLS, cur uintptr) int32 { /* sqlite3.c:191797:12: */
fallthrough
case JSON_OBJECT:
{
- *(*U32)(unsafe.Pointer(p + 12 /* &.i */)) += (U32(1) + jsonNodeSize(tls, ((*JsonEachCursor)(unsafe.Pointer(p)).FsParse.FaNode+uintptr(((*JsonEachCursor)(unsafe.Pointer(p)).Fi+U32(1)))*12)))
+ *(*U32)(unsafe.Pointer(p + 12)) += U32(1) + jsonNodeSize(tls, (*JsonEachCursor)(unsafe.Pointer(p)).FsParse.FaNode+uintptr((*JsonEachCursor)(unsafe.Pointer(p)).Fi+U32(1))*12)
(*JsonEachCursor)(unsafe.Pointer(p)).FiRowid++
break
@@ -152305,7 +154501,7 @@ func jsonEachNext(tls *libc.TLS, cur uintptr) int32 { /* sqlite3.c:191797:12: */
}
// Append the name of the path for element i to pStr
-func jsonEachComputePath(tls *libc.TLS, p uintptr, pStr uintptr, i U32) { /* sqlite3.c:191838:13: */
+func jsonEachComputePath(tls *libc.TLS, p uintptr, pStr uintptr, i U32) { /* sqlite3.c:193466:13: */
bp := tls.Alloc(24)
defer tls.Free(24)
@@ -152318,27 +154514,28 @@ func jsonEachComputePath(tls *libc.TLS, p uintptr, pStr uintptr, i U32) { /* sql
}
iUp = *(*U32)(unsafe.Pointer((*JsonEachCursor)(unsafe.Pointer(p)).FsParse.FaUp + uintptr(i)*4))
jsonEachComputePath(tls, p, pStr, iUp)
- pNode = ((*JsonEachCursor)(unsafe.Pointer(p)).FsParse.FaNode + uintptr(i)*12)
- pUp = ((*JsonEachCursor)(unsafe.Pointer(p)).FsParse.FaNode + uintptr(iUp)*12)
+ pNode = (*JsonEachCursor)(unsafe.Pointer(p)).FsParse.FaNode + uintptr(i)*12
+ pUp = (*JsonEachCursor)(unsafe.Pointer(p)).FsParse.FaNode + uintptr(iUp)*12
if int32((*JsonNode)(unsafe.Pointer(pUp)).FeType) == JSON_ARRAY {
- jsonPrintf(tls, 30, pStr, ts+23092 /* "[%d]" */, libc.VaList(bp, *(*U32)(unsafe.Pointer(pUp + 8 /* &.u */))))
+
+ jsonPrintf(tls, 30, pStr, ts+24389 /* "[%d]" */, libc.VaList(bp, *(*U32)(unsafe.Pointer(pUp + 8))))
} else {
- if (int32((*JsonNode)(unsafe.Pointer(pNode)).FjnFlags) & JNODE_LABEL) == 0 {
+ if int32((*JsonNode)(unsafe.Pointer(pNode)).FjnFlags)&JNODE_LABEL == 0 {
pNode -= 12
}
- jsonPrintf(tls, (int32((*JsonNode)(unsafe.Pointer(pNode)).Fn + U32(1))), pStr, ts+23097 /* ".%.*s" */, libc.VaList(bp+8, ((*JsonNode)(unsafe.Pointer(pNode)).Fn-U32(2)), (*(*uintptr)(unsafe.Pointer(pNode + 8 /* &.u */))+uintptr(1))))
+ jsonPrintf(tls, int32((*JsonNode)(unsafe.Pointer(pNode)).Fn+U32(1)), pStr, ts+24394 /* ".%.*s" */, libc.VaList(bp+8, (*JsonNode)(unsafe.Pointer(pNode)).Fn-U32(2), *(*uintptr)(unsafe.Pointer(pNode + 8))+uintptr(1)))
}
}
// Return the value of a column
-func jsonEachColumn(tls *libc.TLS, cur uintptr, ctx uintptr, i int32) int32 { /* sqlite3.c:191865:12: */
+func jsonEachColumn(tls *libc.TLS, cur uintptr, ctx uintptr, i int32) int32 { /* sqlite3.c:193496:12: */
bp := tls.Alloc(280)
defer tls.Free(280)
var p uintptr = cur
- var pThis uintptr = ((*JsonEachCursor)(unsafe.Pointer(p)).FsParse.FaNode + uintptr((*JsonEachCursor)(unsafe.Pointer(p)).Fi)*12)
+ var pThis uintptr = (*JsonEachCursor)(unsafe.Pointer(p)).FsParse.FaNode + uintptr((*JsonEachCursor)(unsafe.Pointer(p)).Fi)*12
switch i {
case JEACH_KEY:
{
@@ -152353,7 +154550,8 @@ func jsonEachColumn(tls *libc.TLS, cur uintptr, ctx uintptr, i int32) int32 { /*
if (*JsonEachCursor)(unsafe.Pointer(p)).FiRowid == U32(0) {
break
}
- iKey = *(*U32)(unsafe.Pointer((*JsonEachCursor)(unsafe.Pointer(p)).FsParse.FaNode + uintptr(*(*U32)(unsafe.Pointer((*JsonEachCursor)(unsafe.Pointer(p)).FsParse.FaUp + uintptr((*JsonEachCursor)(unsafe.Pointer(p)).Fi)*4)))*12 + 8 /* &.u */))
+
+ iKey = *(*U32)(unsafe.Pointer((*JsonEachCursor)(unsafe.Pointer(p)).FsParse.FaNode + uintptr(*(*U32)(unsafe.Pointer((*JsonEachCursor)(unsafe.Pointer(p)).FsParse.FaUp + uintptr((*JsonEachCursor)(unsafe.Pointer(p)).Fi)*4)))*12 + 8))
} else {
iKey = (*JsonEachCursor)(unsafe.Pointer(p)).FiRowid
}
@@ -152364,7 +154562,7 @@ func jsonEachColumn(tls *libc.TLS, cur uintptr, ctx uintptr, i int32) int32 { /*
}
case JEACH_VALUE:
{
- if (int32((*JsonNode)(unsafe.Pointer(pThis)).FjnFlags) & JNODE_LABEL) != 0 {
+ if int32((*JsonNode)(unsafe.Pointer(pThis)).FjnFlags)&JNODE_LABEL != 0 {
pThis += 12
}
jsonReturn(tls, pThis, ctx, uintptr(0))
@@ -152373,7 +154571,7 @@ func jsonEachColumn(tls *libc.TLS, cur uintptr, ctx uintptr, i int32) int32 { /*
}
case JEACH_TYPE:
{
- if (int32((*JsonNode)(unsafe.Pointer(pThis)).FjnFlags) & JNODE_LABEL) != 0 {
+ if int32((*JsonNode)(unsafe.Pointer(pThis)).FjnFlags)&JNODE_LABEL != 0 {
pThis += 12
}
Xsqlite3_result_text(tls, ctx, jsonType[(*JsonNode)(unsafe.Pointer(pThis)).FeType], -1, uintptr(0))
@@ -152382,7 +154580,7 @@ func jsonEachColumn(tls *libc.TLS, cur uintptr, ctx uintptr, i int32) int32 { /*
}
case JEACH_ATOM:
{
- if (int32((*JsonNode)(unsafe.Pointer(pThis)).FjnFlags) & JNODE_LABEL) != 0 {
+ if int32((*JsonNode)(unsafe.Pointer(pThis)).FjnFlags)&JNODE_LABEL != 0 {
pThis += 12
}
if int32((*JsonNode)(unsafe.Pointer(pThis)).FeType) >= JSON_ARRAY {
@@ -152395,13 +154593,13 @@ func jsonEachColumn(tls *libc.TLS, cur uintptr, ctx uintptr, i int32) int32 { /*
case JEACH_ID:
{
Xsqlite3_result_int64(tls, ctx,
- (Sqlite3_int64((*JsonEachCursor)(unsafe.Pointer(p)).Fi) + (Sqlite3_int64(libc.Bool32((int32((*JsonNode)(unsafe.Pointer(pThis)).FjnFlags) & JNODE_LABEL) != 0)))))
+ Sqlite3_int64((*JsonEachCursor)(unsafe.Pointer(p)).Fi)+Sqlite3_int64(libc.Bool32(int32((*JsonNode)(unsafe.Pointer(pThis)).FjnFlags)&JNODE_LABEL != 0)))
break
}
case JEACH_PARENT:
{
- if ((*JsonEachCursor)(unsafe.Pointer(p)).Fi > (*JsonEachCursor)(unsafe.Pointer(p)).FiBegin) && ((*JsonEachCursor)(unsafe.Pointer(p)).FbRecursive != 0) {
+ if (*JsonEachCursor)(unsafe.Pointer(p)).Fi > (*JsonEachCursor)(unsafe.Pointer(p)).FiBegin && (*JsonEachCursor)(unsafe.Pointer(p)).FbRecursive != 0 {
Xsqlite3_result_int64(tls, ctx, Sqlite3_int64(*(*U32)(unsafe.Pointer((*JsonEachCursor)(unsafe.Pointer(p)).FsParse.FaUp + uintptr((*JsonEachCursor)(unsafe.Pointer(p)).Fi)*4))))
}
break
@@ -152421,9 +154619,10 @@ func jsonEachColumn(tls *libc.TLS, cur uintptr, ctx uintptr, i int32) int32 { /*
jsonAppendChar(tls, bp+24 /* &x */, uint8('$'))
}
if int32((*JsonEachCursor)(unsafe.Pointer(p)).FeType) == JSON_ARRAY {
- jsonPrintf(tls, 30, bp+24 /* &x */, ts+23092 /* "[%d]" */, libc.VaList(bp, (*JsonEachCursor)(unsafe.Pointer(p)).FiRowid))
+ jsonPrintf(tls, 30, bp+24 /* &x */, ts+24389 /* "[%d]" */, libc.VaList(bp, (*JsonEachCursor)(unsafe.Pointer(p)).FiRowid))
} else if int32((*JsonEachCursor)(unsafe.Pointer(p)).FeType) == JSON_OBJECT {
- jsonPrintf(tls, int32((*JsonNode)(unsafe.Pointer(pThis)).Fn), bp+24 /* &x */, ts+23097 /* ".%.*s" */, libc.VaList(bp+8, ((*JsonNode)(unsafe.Pointer(pThis)).Fn-U32(2)), (*(*uintptr)(unsafe.Pointer(pThis + 8 /* &.u */))+uintptr(1))))
+
+ jsonPrintf(tls, int32((*JsonNode)(unsafe.Pointer(pThis)).Fn), bp+24 /* &x */, ts+24394 /* ".%.*s" */, libc.VaList(bp+8, (*JsonNode)(unsafe.Pointer(pThis)).Fn-U32(2), *(*uintptr)(unsafe.Pointer(pThis + 8))+uintptr(1)))
}
}
jsonResult(tls, bp+24 /* &x */)
@@ -152447,7 +154646,7 @@ func jsonEachColumn(tls *libc.TLS, cur uintptr, ctx uintptr, i int32) int32 { /*
{
var zRoot uintptr = (*JsonEachCursor)(unsafe.Pointer(p)).FzRoot
if zRoot == uintptr(0) {
- zRoot = ts + 23103 /* "$" */
+ zRoot = ts + 24400 /* "$" */
}
Xsqlite3_result_text(tls, ctx, zRoot, -1, uintptr(0))
break
@@ -152465,7 +154664,7 @@ func jsonEachColumn(tls *libc.TLS, cur uintptr, ctx uintptr, i int32) int32 { /*
}
// Return the current rowid value
-func jsonEachRowid(tls *libc.TLS, cur uintptr, pRowid uintptr) int32 { /* sqlite3.c:191964:12: */
+func jsonEachRowid(tls *libc.TLS, cur uintptr, pRowid uintptr) int32 { /* sqlite3.c:193597:12: */
var p uintptr = cur
*(*Sqlite_int64)(unsafe.Pointer(pRowid)) = Sqlite_int64((*JsonEachCursor)(unsafe.Pointer(p)).FiRowid)
return SQLITE_OK
@@ -152475,7 +154674,7 @@ func jsonEachRowid(tls *libc.TLS, cur uintptr, pRowid uintptr) int32 { /* sqlite
// column. Without such a constraint, the table cannot operate. idxNum is
// 1 if the constraint is found, 3 if the constraint and zRoot are found,
// and 0 otherwise.
-func jsonEachBestIndex(tls *libc.TLS, tab uintptr, pIdxInfo uintptr) int32 { /* sqlite3.c:191975:12: */
+func jsonEachBestIndex(tls *libc.TLS, tab uintptr, pIdxInfo uintptr) int32 { /* sqlite3.c:193608:12: */
bp := tls.Alloc(8)
defer tls.Free(8)
@@ -152490,7 +154689,7 @@ func jsonEachBestIndex(tls *libc.TLS, tab uintptr, pIdxInfo uintptr) int32 { /*
// columns in the table
_ = tab
- *(*int32)(unsafe.Pointer(bp /* &aIdx[0] */)) = libc.AssignPtrInt32(bp /* &aIdx */ +1*4, -1)
+ *(*int32)(unsafe.Pointer(bp /* &aIdx[0] */)) = libc.AssignPtrInt32(bp+1*4, -1)
pConstraint = (*Sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FaConstraint
i = 0
__1:
@@ -152503,14 +154702,14 @@ __1:
if (*sqlite3_index_constraint)(unsafe.Pointer(pConstraint)).FiColumn < JEACH_JSON {
goto __2
}
- iCol = ((*sqlite3_index_constraint)(unsafe.Pointer(pConstraint)).FiColumn - JEACH_JSON)
+ iCol = (*sqlite3_index_constraint)(unsafe.Pointer(pConstraint)).FiColumn - JEACH_JSON
- iMask = (int32(1) << iCol)
+ iMask = int32(1) << iCol
if int32((*sqlite3_index_constraint)(unsafe.Pointer(pConstraint)).Fusable) == 0 {
- unusableMask = unusableMask | (iMask)
+ unusableMask = unusableMask | iMask
} else if int32((*sqlite3_index_constraint)(unsafe.Pointer(pConstraint)).Fop) == SQLITE_INDEX_CONSTRAINT_EQ {
*(*int32)(unsafe.Pointer(bp /* &aIdx[0] */ + uintptr(iCol)*4)) = i
- idxMask = idxMask | (iMask)
+ idxMask = idxMask | iMask
}
}
@@ -152522,12 +154721,12 @@ __2:
goto __3
__3:
;
- if (unusableMask & ^idxMask) != 0 {
+ if unusableMask & ^idxMask != 0 {
// If there are any unusable constraints on JSON or ROOT, then reject
// this entire plan
return SQLITE_CONSTRAINT
}
- if *(*int32)(unsafe.Pointer(bp /* &aIdx[0] */)) < 0 {
+ if *(*int32)(unsafe.Pointer(bp)) < 0 {
// No JSON input. Leave estimatedCost at the huge value that it was
// initialized to to discourage the query planner from selecting this
// plan.
@@ -152537,7 +154736,7 @@ __3:
i = *(*int32)(unsafe.Pointer(bp /* &aIdx[0] */))
(*sqlite3_index_constraint_usage)(unsafe.Pointer((*Sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FaConstraintUsage + uintptr(i)*8)).FargvIndex = 1
(*sqlite3_index_constraint_usage)(unsafe.Pointer((*Sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FaConstraintUsage + uintptr(i)*8)).Fomit = uint8(1)
- if *(*int32)(unsafe.Pointer(bp /* &aIdx[0] */ + 1*4)) < 0 {
+ if *(*int32)(unsafe.Pointer(bp + 1*4)) < 0 {
(*Sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FidxNum = 1 // Only JSON supplied. Plan 1
} else {
i = *(*int32)(unsafe.Pointer(bp /* &aIdx[0] */ + 1*4))
@@ -152550,7 +154749,7 @@ __3:
}
// Start a search on a new JSON string
-func jsonEachFilter(tls *libc.TLS, cur uintptr, idxNum int32, idxStr uintptr, argc int32, argv uintptr) int32 { /* sqlite3.c:192033:12: */
+func jsonEachFilter(tls *libc.TLS, cur uintptr, idxNum int32, idxStr uintptr, argc int32, argv uintptr) int32 { /* sqlite3.c:193667:12: */
bp := tls.Alloc(4)
defer tls.Free(4)
@@ -152570,23 +154769,23 @@ func jsonEachFilter(tls *libc.TLS, cur uintptr, idxNum int32, idxStr uintptr, ar
return SQLITE_OK
}
n = Sqlite3_int64(Xsqlite3_value_bytes(tls, *(*uintptr)(unsafe.Pointer(argv))))
- (*JsonEachCursor)(unsafe.Pointer(p)).FzJson = Xsqlite3_malloc64(tls, (uint64(n + int64(1))))
+ (*JsonEachCursor)(unsafe.Pointer(p)).FzJson = Xsqlite3_malloc64(tls, uint64(n+int64(1)))
if (*JsonEachCursor)(unsafe.Pointer(p)).FzJson == uintptr(0) {
return SQLITE_NOMEM
}
- libc.Xmemcpy(tls, (*JsonEachCursor)(unsafe.Pointer(p)).FzJson, z, (Size_t(n) + Size_t(1)))
- if jsonParse(tls, (p+32 /* &.sParse */), uintptr(0), (*JsonEachCursor)(unsafe.Pointer(p)).FzJson) != 0 {
+ libc.Xmemcpy(tls, (*JsonEachCursor)(unsafe.Pointer(p)).FzJson, z, Size_t(n)+Size_t(1))
+ if jsonParse(tls, p+32, uintptr(0), (*JsonEachCursor)(unsafe.Pointer(p)).FzJson) != 0 {
var rc int32 = SQLITE_NOMEM
if int32((*JsonEachCursor)(unsafe.Pointer(p)).FsParse.Foom) == 0 {
Xsqlite3_free(tls, (*Sqlite3_vtab)(unsafe.Pointer((*Sqlite3_vtab_cursor)(unsafe.Pointer(cur)).FpVtab)).FzErrMsg)
- (*Sqlite3_vtab)(unsafe.Pointer((*Sqlite3_vtab_cursor)(unsafe.Pointer(cur)).FpVtab)).FzErrMsg = Xsqlite3_mprintf(tls, ts+22819 /* "malformed JSON" */, 0)
+ (*Sqlite3_vtab)(unsafe.Pointer((*Sqlite3_vtab_cursor)(unsafe.Pointer(cur)).FpVtab)).FzErrMsg = Xsqlite3_mprintf(tls, ts+24116 /* "malformed JSON" */, 0)
if (*Sqlite3_vtab)(unsafe.Pointer((*Sqlite3_vtab_cursor)(unsafe.Pointer(cur)).FpVtab)).FzErrMsg != 0 {
rc = SQLITE_ERROR
}
}
jsonEachCursorReset(tls, p)
return rc
- } else if ((*JsonEachCursor)(unsafe.Pointer(p)).FbRecursive != 0) && (jsonParseFindParents(tls, (p+32 /* &.sParse */)) != 0) {
+ } else if (*JsonEachCursor)(unsafe.Pointer(p)).FbRecursive != 0 && jsonParseFindParents(tls, p+32) != 0 {
jsonEachCursorReset(tls, p)
return SQLITE_NOMEM
} else {
@@ -152598,17 +154797,17 @@ func jsonEachFilter(tls *libc.TLS, cur uintptr, idxNum int32, idxStr uintptr, ar
return SQLITE_OK
}
n = Sqlite3_int64(Xsqlite3_value_bytes(tls, *(*uintptr)(unsafe.Pointer(argv + 1*4))))
- (*JsonEachCursor)(unsafe.Pointer(p)).FzRoot = Xsqlite3_malloc64(tls, (uint64(n + int64(1))))
+ (*JsonEachCursor)(unsafe.Pointer(p)).FzRoot = Xsqlite3_malloc64(tls, uint64(n+int64(1)))
if (*JsonEachCursor)(unsafe.Pointer(p)).FzRoot == uintptr(0) {
return SQLITE_NOMEM
}
- libc.Xmemcpy(tls, (*JsonEachCursor)(unsafe.Pointer(p)).FzRoot, zRoot, (Size_t(n) + Size_t(1)))
+ libc.Xmemcpy(tls, (*JsonEachCursor)(unsafe.Pointer(p)).FzRoot, zRoot, Size_t(n)+Size_t(1))
if int32(*(*uint8)(unsafe.Pointer(zRoot))) != '$' {
*(*uintptr)(unsafe.Pointer(bp /* zErr */)) = zRoot
} else {
- pNode = jsonLookupStep(tls, (p + 32 /* &.sParse */), uint32(0), ((*JsonEachCursor)(unsafe.Pointer(p)).FzRoot + uintptr(1)), uintptr(0), bp /* &zErr */)
+ pNode = jsonLookupStep(tls, p+32, uint32(0), (*JsonEachCursor)(unsafe.Pointer(p)).FzRoot+uintptr(1), uintptr(0), bp /* &zErr */)
}
- if *(*uintptr)(unsafe.Pointer(bp /* zErr */)) != 0 {
+ if *(*uintptr)(unsafe.Pointer(bp)) != 0 {
Xsqlite3_free(tls, (*Sqlite3_vtab)(unsafe.Pointer((*Sqlite3_vtab_cursor)(unsafe.Pointer(cur)).FpVtab)).FzErrMsg)
(*Sqlite3_vtab)(unsafe.Pointer((*Sqlite3_vtab_cursor)(unsafe.Pointer(cur)).FpVtab)).FzErrMsg = jsonPathSyntaxError(tls, *(*uintptr)(unsafe.Pointer(bp /* zErr */)))
jsonEachCursorReset(tls, p)
@@ -152622,21 +154821,22 @@ func jsonEachFilter(tls *libc.TLS, cur uintptr, idxNum int32, idxStr uintptr, ar
} else {
pNode = (*JsonEachCursor)(unsafe.Pointer(p)).FsParse.FaNode
}
- (*JsonEachCursor)(unsafe.Pointer(p)).FiBegin = libc.AssignPtrUint32(p+12 /* &.i */, U32(((int32(pNode) - int32((*JsonEachCursor)(unsafe.Pointer(p)).FsParse.FaNode)) / 12)))
+ (*JsonEachCursor)(unsafe.Pointer(p)).FiBegin = libc.AssignPtrUint32(p+12, U32((int32(pNode)-int32((*JsonEachCursor)(unsafe.Pointer(p)).FsParse.FaNode))/12))
(*JsonEachCursor)(unsafe.Pointer(p)).FeType = (*JsonNode)(unsafe.Pointer(pNode)).FeType
if int32((*JsonEachCursor)(unsafe.Pointer(p)).FeType) >= JSON_ARRAY {
- *(*U32)(unsafe.Pointer(pNode + 8 /* &.u */)) = U32(0)
- (*JsonEachCursor)(unsafe.Pointer(p)).FiEnd = (((*JsonEachCursor)(unsafe.Pointer(p)).Fi + (*JsonNode)(unsafe.Pointer(pNode)).Fn) + U32(1))
+
+ *(*U32)(unsafe.Pointer(pNode + 8)) = U32(0)
+ (*JsonEachCursor)(unsafe.Pointer(p)).FiEnd = (*JsonEachCursor)(unsafe.Pointer(p)).Fi + (*JsonNode)(unsafe.Pointer(pNode)).Fn + U32(1)
if (*JsonEachCursor)(unsafe.Pointer(p)).FbRecursive != 0 {
(*JsonEachCursor)(unsafe.Pointer(p)).FeType = (*JsonNode)(unsafe.Pointer((*JsonEachCursor)(unsafe.Pointer(p)).FsParse.FaNode + uintptr(*(*U32)(unsafe.Pointer((*JsonEachCursor)(unsafe.Pointer(p)).FsParse.FaUp + uintptr((*JsonEachCursor)(unsafe.Pointer(p)).Fi)*4)))*12)).FeType
- if ((*JsonEachCursor)(unsafe.Pointer(p)).Fi > U32(0)) && ((int32((*JsonNode)(unsafe.Pointer((*JsonEachCursor)(unsafe.Pointer(p)).FsParse.FaNode+uintptr(((*JsonEachCursor)(unsafe.Pointer(p)).Fi-U32(1)))*12)).FjnFlags) & JNODE_LABEL) != 0) {
+ if (*JsonEachCursor)(unsafe.Pointer(p)).Fi > U32(0) && int32((*JsonNode)(unsafe.Pointer((*JsonEachCursor)(unsafe.Pointer(p)).FsParse.FaNode+uintptr((*JsonEachCursor)(unsafe.Pointer(p)).Fi-U32(1))*12)).FjnFlags)&JNODE_LABEL != 0 {
(*JsonEachCursor)(unsafe.Pointer(p)).Fi--
}
} else {
(*JsonEachCursor)(unsafe.Pointer(p)).Fi++
}
} else {
- (*JsonEachCursor)(unsafe.Pointer(p)).FiEnd = ((*JsonEachCursor)(unsafe.Pointer(p)).Fi + U32(1))
+ (*JsonEachCursor)(unsafe.Pointer(p)).FiEnd = (*JsonEachCursor)(unsafe.Pointer(p)).Fi + U32(1)
}
}
return SQLITE_OK
@@ -152654,7 +154854,7 @@ var jsonEachModule = Sqlite3_module{ // xCreate
FxEof: 0, // xEof - check for end of scan
FxColumn: 0, // xColumn - read data
FxRowid: 0, // xShadowName
-} /* sqlite3.c:192112:23 */
+} /* sqlite3.c:193748:23 */
// The methods of the json_tree virtual table.
var jsonTreeModule = Sqlite3_module{ // xCreate
@@ -152668,7 +154868,7 @@ var jsonTreeModule = Sqlite3_module{ // xCreate
FxEof: 0, // xEof - check for end of scan
FxColumn: 0, // xColumn - read data
FxRowid: 0, // xShadowName
-} /* sqlite3.c:192140:23 */
+} /* sqlite3.c:193776:23 */
// ***************************************************************************
//
@@ -152677,37 +154877,37 @@ var jsonTreeModule = Sqlite3_module{ // xCreate
// functions and the virtual table implemented by this file.
//
-func Xsqlite3Json1Init(tls *libc.TLS, db uintptr) int32 { /* sqlite3.c:192174:20: */
+func Xsqlite3Json1Init(tls *libc.TLS, db uintptr) int32 { /* sqlite3.c:193810:20: */
var rc int32 = SQLITE_OK
var i uint32
- for i = uint32(0); (i < (uint32(unsafe.Sizeof(aFunc)) / uint32(unsafe.Sizeof(struct {
+ for i = uint32(0); i < uint32(unsafe.Sizeof(aFunc))/uint32(unsafe.Sizeof(struct {
FzName uintptr
FnArg int32
Fflag int32
FxFunc uintptr
- }{})))) && (rc == SQLITE_OK); i++ {
+ }{})) && rc == SQLITE_OK; i++ {
rc = Xsqlite3_create_function(tls, db, aFunc[i].FzName, aFunc[i].FnArg, enc,
- (uintptr(unsafe.Pointer(&aFunc)) + uintptr(i)*16 + 8 /* &.flag */),
+ uintptr(unsafe.Pointer(&aFunc))+uintptr(i)*16+8,
aFunc[i].FxFunc, uintptr(0), uintptr(0))
}
- for i = uint32(0); (i < (uint32(unsafe.Sizeof(aAgg)) / uint32(unsafe.Sizeof(struct {
+ for i = uint32(0); i < uint32(unsafe.Sizeof(aAgg))/uint32(unsafe.Sizeof(struct {
FzName uintptr
FnArg int32
FxStep uintptr
FxFinal uintptr
FxValue uintptr
- }{})))) && (rc == SQLITE_OK); i++ {
+ }{})) && rc == SQLITE_OK; i++ {
rc = Xsqlite3_create_window_function(tls, db, aAgg[i].FzName, aAgg[i].FnArg,
- (SQLITE_SUBTYPE | enc), uintptr(0),
+ SQLITE_SUBTYPE|enc, uintptr(0),
aAgg[i].FxStep, aAgg[i].FxFinal,
aAgg[i].FxValue, *(*uintptr)(unsafe.Pointer(&struct {
f func(*libc.TLS, uintptr, int32, uintptr)
}{jsonGroupInverse})), uintptr(0))
}
- for i = uint32(0); (i < (uint32(unsafe.Sizeof(aMod)) / uint32(unsafe.Sizeof(struct {
+ for i = uint32(0); i < uint32(unsafe.Sizeof(aMod))/uint32(unsafe.Sizeof(struct {
FzName uintptr
FpModule uintptr
- }{})))) && (rc == SQLITE_OK); i++ {
+ }{})) && rc == SQLITE_OK; i++ {
rc = Xsqlite3_create_module(tls, db, aMod[i].FzName, aMod[i].FpModule, uintptr(0))
}
return rc
@@ -152719,22 +154919,22 @@ var aFunc = [15]struct {
Fflag int32
FxFunc uintptr
}{
- {FzName: ts + 23105 /* "json" */, FnArg: 1, FxFunc: 0},
- {FzName: ts + 23110 /* "json_array" */, FnArg: -1, FxFunc: 0},
- {FzName: ts + 23121 /* "json_array_lengt..." */, FnArg: 1, FxFunc: 0},
- {FzName: ts + 23121 /* "json_array_lengt..." */, FnArg: 2, FxFunc: 0},
- {FzName: ts + 23139 /* "json_extract" */, FnArg: -1, FxFunc: 0},
- {FzName: ts + 23152 /* "json_insert" */, FnArg: -1, FxFunc: 0},
- {FzName: ts + 23164 /* "json_object" */, FnArg: -1, FxFunc: 0},
- {FzName: ts + 23176 /* "json_patch" */, FnArg: 2, FxFunc: 0},
- {FzName: ts + 23187 /* "json_quote" */, FnArg: 1, FxFunc: 0},
- {FzName: ts + 23198 /* "json_remove" */, FnArg: -1, FxFunc: 0},
- {FzName: ts + 23210 /* "json_replace" */, FnArg: -1, FxFunc: 0},
- {FzName: ts + 23223 /* "json_set" */, FnArg: -1, Fflag: 1, FxFunc: 0},
- {FzName: ts + 23232 /* "json_type" */, FnArg: 1, FxFunc: 0},
- {FzName: ts + 23232 /* "json_type" */, FnArg: 2, FxFunc: 0},
- {FzName: ts + 23242 /* "json_valid" */, FnArg: 1, FxFunc: 0},
-} /* sqlite3.c:192182:5 */
+ {FzName: ts + 24402 /* "json" */, FnArg: 1, FxFunc: 0},
+ {FzName: ts + 24407 /* "json_array" */, FnArg: -1, FxFunc: 0},
+ {FzName: ts + 24418 /* "json_array_lengt..." */, FnArg: 1, FxFunc: 0},
+ {FzName: ts + 24418 /* "json_array_lengt..." */, FnArg: 2, FxFunc: 0},
+ {FzName: ts + 24436 /* "json_extract" */, FnArg: -1, FxFunc: 0},
+ {FzName: ts + 24449 /* "json_insert" */, FnArg: -1, FxFunc: 0},
+ {FzName: ts + 24461 /* "json_object" */, FnArg: -1, FxFunc: 0},
+ {FzName: ts + 24473 /* "json_patch" */, FnArg: 2, FxFunc: 0},
+ {FzName: ts + 24484 /* "json_quote" */, FnArg: 1, FxFunc: 0},
+ {FzName: ts + 24495 /* "json_remove" */, FnArg: -1, FxFunc: 0},
+ {FzName: ts + 24507 /* "json_replace" */, FnArg: -1, FxFunc: 0},
+ {FzName: ts + 24520 /* "json_set" */, FnArg: -1, Fflag: 1, FxFunc: 0},
+ {FzName: ts + 24529 /* "json_type" */, FnArg: 1, FxFunc: 0},
+ {FzName: ts + 24529 /* "json_type" */, FnArg: 2, FxFunc: 0},
+ {FzName: ts + 24539 /* "json_valid" */, FnArg: 1, FxFunc: 0},
+} /* sqlite3.c:193818:5 */
var aAgg = [2]struct {
FzName uintptr
FnArg int32
@@ -152742,19 +154942,22 @@ var aAgg = [2]struct {
FxFinal uintptr
FxValue uintptr
}{
- {FzName: ts + 23253 /* "json_group_array" */, FnArg: 1,
+ {FzName: ts + 24550 /* "json_group_array" */, FnArg: 1,
FxStep: 0, FxFinal: 0, FxValue: 0},
- {FzName: ts + 23270 /* "json_group_objec..." */, FnArg: 2,
+ {FzName: ts + 24567 /* "json_group_objec..." */, FnArg: 2,
FxStep: 0, FxFinal: 0, FxValue: 0},
-} /* sqlite3.c:192211:5 */
+} /* sqlite3.c:193847:5 */
var aMod = [2]struct {
FzName uintptr
FpModule uintptr
}{
- {FzName: ts + 23288 /* "json_each" */, FpModule: 0},
- {FzName: ts + 23298 /* "json_tree" */, FpModule: 0},
-} /* sqlite3.c:192221:5 */
-var enc int32 = ((SQLITE_UTF8 | SQLITE_DETERMINISTIC) | SQLITE_INNOCUOUS) /* sqlite3.c:192226:20 */ // In the SQLite core
+ {FzName: ts + 24585 /* "json_each" */, FpModule: 0},
+ {FzName: ts + 24595 /* "json_tree" */, FpModule: 0},
+} /* sqlite3.c:193857:5 */
+var enc int32 = SQLITE_UTF8 | SQLITE_DETERMINISTIC | SQLITE_INNOCUOUS /* sqlite3.c:193862:20 */ // In the SQLite core
+
+// If building separately, we will need some setup that is normally
+// found in sqliteInt.h
// #include <string.h>
// #include <stdio.h>
@@ -152797,10 +155000,13 @@ type Rtree1 = struct {
FpDeleteParent uintptr
FpWriteAux uintptr
FaHash [97]uintptr
-} /* sqlite3.c:192362:9 */
+} /* sqlite3.c:194015:9 */
// In the SQLite core
+// If building separately, we will need some setup that is normally
+// found in sqliteInt.h
+
// #include <string.h>
// #include <stdio.h>
// #include <assert.h>
@@ -152808,7 +155014,7 @@ type Rtree1 = struct {
// The following macro is used to suppress compiler warnings.
-type Rtree = Rtree1 /* sqlite3.c:192362:22 */
+type Rtree = Rtree1 /* sqlite3.c:194015:22 */
type RtreeCursor1 = struct {
Fbase Sqlite3_vtab_cursor
FatEOF U8
@@ -152826,9 +155032,9 @@ type RtreeCursor1 = struct {
FsPoint RtreeSearchPoint
FaNode [5]uintptr
FanQueue [41]U32
-} /* sqlite3.c:192363:9 */
+} /* sqlite3.c:194016:9 */
-type RtreeCursor = RtreeCursor1 /* sqlite3.c:192363:28 */
+type RtreeCursor = RtreeCursor1 /* sqlite3.c:194016:28 */
type RtreeNode1 = struct {
FpParent uintptr
F__ccgo_pad1 [4]byte
@@ -152837,24 +155043,24 @@ type RtreeNode1 = struct {
FisDirty int32
FzData uintptr
FpNext uintptr
-} /* sqlite3.c:192362:9 */
+} /* sqlite3.c:194015:9 */
-type RtreeNode = RtreeNode1 /* sqlite3.c:192364:26 */
+type RtreeNode = RtreeNode1 /* sqlite3.c:194017:26 */
type RtreeCell1 = struct {
FiRowid I64
FaCoord [10]RtreeCoord
-} /* sqlite3.c:192365:9 */
+} /* sqlite3.c:194018:9 */
-type RtreeCell = RtreeCell1 /* sqlite3.c:192365:26 */
+type RtreeCell = RtreeCell1 /* sqlite3.c:194018:26 */
type RtreeConstraint1 = struct {
FiCoord int32
Fop int32
Fu struct{ FrValue RtreeDValue }
FpInfo uintptr
F__ccgo_pad1 [4]byte
-} /* sqlite3.c:192363:9 */
+} /* sqlite3.c:194016:9 */
-type RtreeConstraint = RtreeConstraint1 /* sqlite3.c:192366:32 */
+type RtreeConstraint = RtreeConstraint1 /* sqlite3.c:194019:32 */
type RtreeMatchArg1 = struct {
FiSize U32
Fcb RtreeGeomCallback
@@ -152862,20 +155068,20 @@ type RtreeMatchArg1 = struct {
FapSqlParam uintptr
F__ccgo_pad1 [4]byte
FaParam [1]RtreeDValue
-} /* sqlite3.c:192367:9 */
+} /* sqlite3.c:194020:9 */
-type RtreeMatchArg = RtreeMatchArg1 /* sqlite3.c:192367:30 */
+type RtreeMatchArg = RtreeMatchArg1 /* sqlite3.c:194020:30 */
type RtreeGeomCallback1 = struct {
FxGeom uintptr
FxQueryFunc uintptr
FxDestructor uintptr
FpContext uintptr
-} /* sqlite3.c:192367:9 */
+} /* sqlite3.c:194020:9 */
-type RtreeGeomCallback = RtreeGeomCallback1 /* sqlite3.c:192368:34 */
-type RtreeCoord1 = struct{ Ff RtreeValue } /* sqlite3.c:192365:9 */
+type RtreeGeomCallback = RtreeGeomCallback1 /* sqlite3.c:194021:34 */
+type RtreeCoord1 = struct{ Ff RtreeValue } /* sqlite3.c:194018:9 */
-type RtreeCoord = RtreeCoord1 /* sqlite3.c:192369:26 */
+type RtreeCoord = RtreeCoord1 /* sqlite3.c:194022:26 */
type RtreeSearchPoint1 = struct {
FrScore RtreeDValue
Fid Sqlite3_int64
@@ -152883,17 +155089,17 @@ type RtreeSearchPoint1 = struct {
FeWithin U8
FiCell U8
F__ccgo_pad1 [5]byte
-} /* sqlite3.c:192363:9 */
+} /* sqlite3.c:194016:9 */
-type RtreeSearchPoint = RtreeSearchPoint1 /* sqlite3.c:192370:33 */
+type RtreeSearchPoint = RtreeSearchPoint1 /* sqlite3.c:194023:33 */
// Possible values for Rtree.eCoordType:
// If SQLITE_RTREE_INT_ONLY is defined, then this virtual table will
// only deal with integer coordinates. No floating point operations
// will be done.
-type RtreeDValue = float64 /* sqlite3.c:192465:18 */ // High accuracy coordinate
-type RtreeValue = float32 /* sqlite3.c:192466:17 */
+type RtreeDValue = float64 /* sqlite3.c:194120:18 */ // High accuracy coordinate
+type RtreeValue = float32 /* sqlite3.c:194121:17 */
// What version of GCC is being used. 0 means GCC is not being used .
// Note that the GCC_VERSION macro will also be set correctly when using
@@ -152919,16 +155125,16 @@ type RtreeValue = float32 /* sqlite3.c:192466:17 */
// Functions to deserialize a 16 bit integer, 32 bit real number and
// 64 bit integer. The deserialized value is returned.
-func readInt16(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:192745:12: */
- return ((int32(*(*U8)(unsafe.Pointer(p))) << 8) + int32(*(*U8)(unsafe.Pointer(p + 1))))
+func readInt16(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:194405:12: */
+ return int32(*(*U8)(unsafe.Pointer(p)))<<8 + int32(*(*U8)(unsafe.Pointer(p + 1)))
}
-func readCoord(tls *libc.TLS, p uintptr, pCoord uintptr) { /* sqlite3.c:192748:13: */
+func readCoord(tls *libc.TLS, p uintptr, pCoord uintptr) { /* sqlite3.c:194408:13: */
// p is always 4-byte aligned
- (*(*U32)(unsafe.Pointer(pCoord /* .Fu */))) = libc.X__builtin_bswap32(tls, *(*U32)(unsafe.Pointer(p)))
+ *(*U32)(unsafe.Pointer(pCoord)) = libc.X__builtin_bswap32(tls, *(*U32)(unsafe.Pointer(p)))
}
-func readInt64(tls *libc.TLS, p uintptr) I64 { /* sqlite3.c:192765:12: */
+func readInt64(tls *libc.TLS, p uintptr) I64 { /* sqlite3.c:194425:12: */
bp := tls.Alloc(8)
defer tls.Free(8)
@@ -152941,12 +155147,12 @@ func readInt64(tls *libc.TLS, p uintptr) I64 { /* sqlite3.c:192765:12: */
// Functions to serialize a 16 bit integer, 32 bit real number and
// 64 bit integer. The value returned is the number of bytes written
// to the argument buffer (always 2, 4 and 8 respectively).
-func writeInt16(tls *libc.TLS, p uintptr, i int32) { /* sqlite3.c:192797:13: */
- *(*U8)(unsafe.Pointer(p)) = (U8((i >> 8) & 0xFF))
- *(*U8)(unsafe.Pointer(p + 1)) = (U8((i >> 0) & 0xFF))
+func writeInt16(tls *libc.TLS, p uintptr, i int32) { /* sqlite3.c:194457:13: */
+ *(*U8)(unsafe.Pointer(p)) = U8(i >> 8 & 0xFF)
+ *(*U8)(unsafe.Pointer(p + 1)) = U8(i >> 0 & 0xFF)
}
-func writeCoord(tls *libc.TLS, p uintptr, pCoord uintptr) int32 { /* sqlite3.c:192801:12: */
+func writeCoord(tls *libc.TLS, p uintptr, pCoord uintptr) int32 { /* sqlite3.c:194461:12: */
bp := tls.Alloc(4)
defer tls.Free(4)
@@ -152959,7 +155165,7 @@ func writeCoord(tls *libc.TLS, p uintptr, pCoord uintptr) int32 { /* sqlite3.c:1
return 4
}
-func writeInt64(tls *libc.TLS, p uintptr, i I64) int32 { /* sqlite3.c:192824:12: */
+func writeInt64(tls *libc.TLS, p uintptr, i I64) int32 { /* sqlite3.c:194484:12: */
bp := tls.Alloc(8)
defer tls.Free(8)
*(*I64)(unsafe.Pointer(bp)) = i
@@ -152970,7 +155176,7 @@ func writeInt64(tls *libc.TLS, p uintptr, i I64) int32 { /* sqlite3.c:192824:12:
}
// Increment the reference count of node p.
-func nodeReference(tls *libc.TLS, p uintptr) { /* sqlite3.c:192849:13: */
+func nodeReference(tls *libc.TLS, p uintptr) { /* sqlite3.c:194509:13: */
if p != 0 {
(*RtreeNode)(unsafe.Pointer(p)).FnRef++
@@ -152978,41 +155184,41 @@ func nodeReference(tls *libc.TLS, p uintptr) { /* sqlite3.c:192849:13: */
}
// Clear the content of node p (set all bytes to 0x00).
-func nodeZero(tls *libc.TLS, pRtree uintptr, p uintptr) { /* sqlite3.c:192859:13: */
- libc.Xmemset(tls, ((*RtreeNode)(unsafe.Pointer(p)).FzData + 2), 0, (uint32((*Rtree)(unsafe.Pointer(pRtree)).FiNodeSize - 2)))
+func nodeZero(tls *libc.TLS, pRtree uintptr, p uintptr) { /* sqlite3.c:194519:13: */
+ libc.Xmemset(tls, (*RtreeNode)(unsafe.Pointer(p)).FzData+2, 0, uint32((*Rtree)(unsafe.Pointer(pRtree)).FiNodeSize-2))
(*RtreeNode)(unsafe.Pointer(p)).FisDirty = 1
}
// Given a node number iNode, return the corresponding key to use
// in the Rtree.aHash table.
-func nodeHash(tls *libc.TLS, iNode I64) uint32 { /* sqlite3.c:192868:21: */
- return ((uint32(iNode)) % uint32(HASHSIZE))
+func nodeHash(tls *libc.TLS, iNode I64) uint32 { /* sqlite3.c:194528:21: */
+ return uint32(iNode) % uint32(HASHSIZE)
}
// Search the node hash table for node iNode. If found, return a pointer
// to it. Otherwise, return 0.
-func nodeHashLookup(tls *libc.TLS, pRtree uintptr, iNode I64) uintptr { /* sqlite3.c:192876:18: */
+func nodeHashLookup(tls *libc.TLS, pRtree uintptr, iNode I64) uintptr { /* sqlite3.c:194536:18: */
var p uintptr
- for p = *(*uintptr)(unsafe.Pointer((pRtree + 116 /* &.aHash */) + uintptr(nodeHash(tls, iNode))*4)); (p != 0) && ((*RtreeNode)(unsafe.Pointer(p)).FiNode != iNode); p = (*RtreeNode)(unsafe.Pointer(p)).FpNext {
+ for p = *(*uintptr)(unsafe.Pointer(pRtree + 116 + uintptr(nodeHash(tls, iNode))*4)); p != 0 && (*RtreeNode)(unsafe.Pointer(p)).FiNode != iNode; p = (*RtreeNode)(unsafe.Pointer(p)).FpNext {
}
return p
}
// Add node pNode to the node hash table.
-func nodeHashInsert(tls *libc.TLS, pRtree uintptr, pNode uintptr) { /* sqlite3.c:192885:13: */
+func nodeHashInsert(tls *libc.TLS, pRtree uintptr, pNode uintptr) { /* sqlite3.c:194545:13: */
var iHash int32
iHash = int32(nodeHash(tls, (*RtreeNode)(unsafe.Pointer(pNode)).FiNode))
- (*RtreeNode)(unsafe.Pointer(pNode)).FpNext = *(*uintptr)(unsafe.Pointer((pRtree + 116 /* &.aHash */) + uintptr(iHash)*4))
- *(*uintptr)(unsafe.Pointer((pRtree + 116 /* &.aHash */) + uintptr(iHash)*4)) = pNode
+ (*RtreeNode)(unsafe.Pointer(pNode)).FpNext = *(*uintptr)(unsafe.Pointer(pRtree + 116 + uintptr(iHash)*4))
+ *(*uintptr)(unsafe.Pointer(pRtree + 116 + uintptr(iHash)*4)) = pNode
}
// Remove node pNode from the node hash table.
-func nodeHashDelete(tls *libc.TLS, pRtree uintptr, pNode uintptr) { /* sqlite3.c:192896:13: */
+func nodeHashDelete(tls *libc.TLS, pRtree uintptr, pNode uintptr) { /* sqlite3.c:194556:13: */
var pp uintptr
if (*RtreeNode)(unsafe.Pointer(pNode)).FiNode != int64(0) {
- pp = ((pRtree + 116 /* &.aHash */) + uintptr(nodeHash(tls, (*RtreeNode)(unsafe.Pointer(pNode)).FiNode))*4)
- for ; (*(*uintptr)(unsafe.Pointer(pp))) != pNode; pp = (*(*uintptr)(unsafe.Pointer(pp)) + 28 /* &.pNext */) {
+ pp = pRtree + 116 + uintptr(nodeHash(tls, (*RtreeNode)(unsafe.Pointer(pNode)).FiNode))*4
+ for ; *(*uintptr)(unsafe.Pointer(pp)) != pNode; pp = *(*uintptr)(unsafe.Pointer(pp)) + 28 {
}
*(*uintptr)(unsafe.Pointer(pp)) = (*RtreeNode)(unsafe.Pointer(pNode)).FpNext
(*RtreeNode)(unsafe.Pointer(pNode)).FpNext = uintptr(0)
@@ -153023,12 +155229,12 @@ func nodeHashDelete(tls *libc.TLS, pRtree uintptr, pNode uintptr) { /* sqlite3.c
// indicating that node has not yet been assigned a node number. It is
// assigned a node number when nodeWrite() is called to write the
// node contents out to the database.
-func nodeNew(tls *libc.TLS, pRtree uintptr, pParent uintptr) uintptr { /* sqlite3.c:192912:18: */
+func nodeNew(tls *libc.TLS, pRtree uintptr, pParent uintptr) uintptr { /* sqlite3.c:194572:18: */
var pNode uintptr
- pNode = Xsqlite3_malloc64(tls, (uint64(uint32(unsafe.Sizeof(RtreeNode{})) + uint32((*Rtree)(unsafe.Pointer(pRtree)).FiNodeSize))))
+ pNode = Xsqlite3_malloc64(tls, uint64(uint32(unsafe.Sizeof(RtreeNode{}))+uint32((*Rtree)(unsafe.Pointer(pRtree)).FiNodeSize)))
if pNode != 0 {
- libc.Xmemset(tls, pNode, 0, (uint32(unsafe.Sizeof(RtreeNode{})) + uint32((*Rtree)(unsafe.Pointer(pRtree)).FiNodeSize)))
- (*RtreeNode)(unsafe.Pointer(pNode)).FzData = (pNode + 1*32)
+ libc.Xmemset(tls, pNode, 0, uint32(unsafe.Sizeof(RtreeNode{}))+uint32((*Rtree)(unsafe.Pointer(pRtree)).FiNodeSize))
+ (*RtreeNode)(unsafe.Pointer(pNode)).FzData = pNode + 1*32
(*RtreeNode)(unsafe.Pointer(pNode)).FnRef = 1
(*Rtree)(unsafe.Pointer(pRtree)).FnNodeRef++
(*RtreeNode)(unsafe.Pointer(pNode)).FpParent = pParent
@@ -153039,28 +155245,16 @@ func nodeNew(tls *libc.TLS, pRtree uintptr, pParent uintptr) uintptr { /* sqlite
}
// Clear the Rtree.pNodeBlob object
-func nodeBlobReset(tls *libc.TLS, pRtree uintptr) { /* sqlite3.c:192930:13: */
- if (((*Rtree)(unsafe.Pointer(pRtree)).FpNodeBlob != 0) && (int32((*Rtree)(unsafe.Pointer(pRtree)).FinWrTrans) == 0)) && ((*Rtree)(unsafe.Pointer(pRtree)).FnCursor == U32(0)) {
+func nodeBlobReset(tls *libc.TLS, pRtree uintptr) { /* sqlite3.c:194590:13: */
+ if (*Rtree)(unsafe.Pointer(pRtree)).FpNodeBlob != 0 && int32((*Rtree)(unsafe.Pointer(pRtree)).FinWrTrans) == 0 && (*Rtree)(unsafe.Pointer(pRtree)).FnCursor == U32(0) {
var pBlob uintptr = (*Rtree)(unsafe.Pointer(pRtree)).FpNodeBlob
(*Rtree)(unsafe.Pointer(pRtree)).FpNodeBlob = uintptr(0)
Xsqlite3_blob_close(tls, pBlob)
}
}
-// Check to see if pNode is the same as pParent or any of the parents
-// of pParent.
-func nodeInParentChain(tls *libc.TLS, pNode uintptr, pParent uintptr) int32 { /* sqlite3.c:192942:12: */
- for ok := true; ok; ok = pParent != 0 {
- if pNode == pParent {
- return 1
- }
- pParent = (*RtreeNode)(unsafe.Pointer(pParent)).FpParent
- }
- return 0
-}
-
// Obtain a reference to an r-tree node.
-func nodeAcquire(tls *libc.TLS, pRtree uintptr, iNode I64, pParent uintptr, ppNode uintptr) int32 { /* sqlite3.c:192953:12: */
+func nodeAcquire(tls *libc.TLS, pRtree uintptr, iNode I64, pParent uintptr, ppNode uintptr) int32 { /* sqlite3.c:194601:12: */
bp := tls.Alloc(8)
defer tls.Free(8)
@@ -153069,17 +155263,10 @@ func nodeAcquire(tls *libc.TLS, pRtree uintptr, iNode I64, pParent uintptr, ppNo
// Check if the requested node is already in the hash table. If so,
// increase its reference count and return it.
- if (libc.AssignUintptr(&pNode, nodeHashLookup(tls, pRtree, iNode))) != uintptr(0) {
- if (pParent != 0) && !(int32((*RtreeNode)(unsafe.Pointer(pNode)).FpParent) != 0) {
- if nodeInParentChain(tls, pNode, pParent) != 0 {
+ if libc.AssignUintptr(&pNode, nodeHashLookup(tls, pRtree, iNode)) != uintptr(0) {
+ if pParent != 0 && pParent != (*RtreeNode)(unsafe.Pointer(pNode)).FpParent {
- return (SQLITE_CORRUPT | (int32(1) << 8))
- }
- (*RtreeNode)(unsafe.Pointer(pParent)).FnRef++
- (*RtreeNode)(unsafe.Pointer(pNode)).FpParent = pParent
- } else if ((pParent != 0) && ((*RtreeNode)(unsafe.Pointer(pNode)).FpParent != 0)) && (pParent != (*RtreeNode)(unsafe.Pointer(pNode)).FpParent) {
-
- return (SQLITE_CORRUPT | (int32(1) << 8))
+ return SQLITE_CORRUPT | int32(1)<<8
}
(*RtreeNode)(unsafe.Pointer(pNode)).FnRef++
*(*uintptr)(unsafe.Pointer(ppNode)) = pNode
@@ -153099,12 +155286,12 @@ func nodeAcquire(tls *libc.TLS, pRtree uintptr, iNode I64, pParent uintptr, ppNo
}
}
if (*Rtree)(unsafe.Pointer(pRtree)).FpNodeBlob == uintptr(0) {
- var zTab uintptr = Xsqlite3_mprintf(tls, ts+23308 /* "%s_node" */, libc.VaList(bp, (*Rtree)(unsafe.Pointer(pRtree)).FzName))
+ var zTab uintptr = Xsqlite3_mprintf(tls, ts+24605 /* "%s_node" */, libc.VaList(bp, (*Rtree)(unsafe.Pointer(pRtree)).FzName))
if zTab == uintptr(0) {
return SQLITE_NOMEM
}
- rc = Xsqlite3_blob_open(tls, (*Rtree)(unsafe.Pointer(pRtree)).Fdb, (*Rtree)(unsafe.Pointer(pRtree)).FzDb, zTab, ts+23316 /* "data" */, iNode, 0,
- (pRtree + 76 /* &.pNodeBlob */))
+ rc = Xsqlite3_blob_open(tls, (*Rtree)(unsafe.Pointer(pRtree)).Fdb, (*Rtree)(unsafe.Pointer(pRtree)).FzDb, zTab, ts+24613 /* "data" */, iNode, 0,
+ pRtree+76)
Xsqlite3_free(tls, zTab)
}
if rc != 0 {
@@ -153113,16 +155300,16 @@ func nodeAcquire(tls *libc.TLS, pRtree uintptr, iNode I64, pParent uintptr, ppNo
// If unable to open an sqlite3_blob on the desired row, that can only
// be because the shadow tables hold erroneous data.
if rc == SQLITE_ERROR {
- rc = (SQLITE_CORRUPT | (int32(1) << 8))
+ rc = SQLITE_CORRUPT | int32(1)<<8
}
} else if (*Rtree)(unsafe.Pointer(pRtree)).FiNodeSize == Xsqlite3_blob_bytes(tls, (*Rtree)(unsafe.Pointer(pRtree)).FpNodeBlob) {
- pNode = Xsqlite3_malloc64(tls, (uint64(uint32(unsafe.Sizeof(RtreeNode{})) + uint32((*Rtree)(unsafe.Pointer(pRtree)).FiNodeSize))))
+ pNode = Xsqlite3_malloc64(tls, uint64(uint32(unsafe.Sizeof(RtreeNode{}))+uint32((*Rtree)(unsafe.Pointer(pRtree)).FiNodeSize)))
if !(pNode != 0) {
rc = SQLITE_NOMEM
} else {
(*RtreeNode)(unsafe.Pointer(pNode)).FpParent = pParent
- (*RtreeNode)(unsafe.Pointer(pNode)).FzData = (pNode + 1*32)
+ (*RtreeNode)(unsafe.Pointer(pNode)).FzData = pNode + 1*32
(*RtreeNode)(unsafe.Pointer(pNode)).FnRef = 1
(*Rtree)(unsafe.Pointer(pRtree)).FnNodeRef++
(*RtreeNode)(unsafe.Pointer(pNode)).FiNode = iNode
@@ -153138,10 +155325,10 @@ func nodeAcquire(tls *libc.TLS, pRtree uintptr, iNode I64, pParent uintptr, ppNo
// the root node. A height of one means the children of the root node
// are the leaves, and so on. If the depth as specified on the root node
// is greater than RTREE_MAX_DEPTH, the r-tree structure must be corrupt.
- if ((pNode != 0) && (rc == SQLITE_OK)) && (iNode == int64(1)) {
+ if rc == SQLITE_OK && pNode != 0 && iNode == int64(1) {
(*Rtree)(unsafe.Pointer(pRtree)).FiDepth = readInt16(tls, (*RtreeNode)(unsafe.Pointer(pNode)).FzData)
if (*Rtree)(unsafe.Pointer(pRtree)).FiDepth > RTREE_MAX_DEPTH {
- rc = (SQLITE_CORRUPT | (int32(1) << 8))
+ rc = SQLITE_CORRUPT | int32(1)<<8
}
}
@@ -153149,9 +155336,9 @@ func nodeAcquire(tls *libc.TLS, pRtree uintptr, iNode I64, pParent uintptr, ppNo
// If no error has occurred so far, check if the "number of entries"
// field on the node is too large. If so, set the return code to
// SQLITE_CORRUPT_VTAB.
- if (pNode != 0) && (rc == SQLITE_OK) {
- if readInt16(tls, ((*RtreeNode)(unsafe.Pointer((pNode))).FzData+2)) > (((*Rtree)(unsafe.Pointer(pRtree)).FiNodeSize - 4) / int32((*Rtree)(unsafe.Pointer(pRtree)).FnBytesPerCell)) {
- rc = (SQLITE_CORRUPT | (int32(1) << 8))
+ if pNode != 0 && rc == SQLITE_OK {
+ if readInt16(tls, (*RtreeNode)(unsafe.Pointer(pNode)).FzData+2) > ((*Rtree)(unsafe.Pointer(pRtree)).FiNodeSize-4)/int32((*Rtree)(unsafe.Pointer(pRtree)).FnBytesPerCell) {
+ rc = SQLITE_CORRUPT | int32(1)<<8
}
}
@@ -153161,7 +155348,7 @@ func nodeAcquire(tls *libc.TLS, pRtree uintptr, iNode I64, pParent uintptr, ppNo
nodeReference(tls, pParent)
nodeHashInsert(tls, pRtree, pNode)
} else {
- rc = (SQLITE_CORRUPT | (int32(1) << 8))
+ rc = SQLITE_CORRUPT | int32(1)<<8
}
*(*uintptr)(unsafe.Pointer(ppNode)) = pNode
@@ -153177,23 +155364,23 @@ func nodeAcquire(tls *libc.TLS, pRtree uintptr, iNode I64, pParent uintptr, ppNo
}
// Overwrite cell iCell of node pNode with the contents of pCell.
-func nodeOverwriteCell(tls *libc.TLS, pRtree uintptr, pNode uintptr, pCell uintptr, iCell int32) { /* sqlite3.c:193073:13: */
+func nodeOverwriteCell(tls *libc.TLS, pRtree uintptr, pNode uintptr, pCell uintptr, iCell int32) { /* sqlite3.c:194714:13: */
var ii int32
- var p uintptr = ((*RtreeNode)(unsafe.Pointer(pNode)).FzData + uintptr((4 + (int32((*Rtree)(unsafe.Pointer(pRtree)).FnBytesPerCell) * iCell))))
+ var p uintptr = (*RtreeNode)(unsafe.Pointer(pNode)).FzData + uintptr(4+int32((*Rtree)(unsafe.Pointer(pRtree)).FnBytesPerCell)*iCell)
p += uintptr(writeInt64(tls, p, (*RtreeCell)(unsafe.Pointer(pCell)).FiRowid))
for ii = 0; ii < int32((*Rtree)(unsafe.Pointer(pRtree)).FnDim2); ii++ {
- p += uintptr(writeCoord(tls, p, ((pCell + 8 /* &.aCoord */) + uintptr(ii)*4)))
+ p += uintptr(writeCoord(tls, p, pCell+8+uintptr(ii)*4))
}
(*RtreeNode)(unsafe.Pointer(pNode)).FisDirty = 1
}
// Remove the cell with index iCell from node pNode.
-func nodeDeleteCell(tls *libc.TLS, pRtree uintptr, pNode uintptr, iCell int32) { /* sqlite3.c:193091:13: */
- var pDst uintptr = ((*RtreeNode)(unsafe.Pointer(pNode)).FzData + uintptr((4 + (int32((*Rtree)(unsafe.Pointer(pRtree)).FnBytesPerCell) * iCell))))
- var pSrc uintptr = (pDst + uintptr((*Rtree)(unsafe.Pointer(pRtree)).FnBytesPerCell))
- var nByte int32 = (((readInt16(tls, ((*RtreeNode)(unsafe.Pointer((pNode))).FzData+2)) - iCell) - 1) * int32((*Rtree)(unsafe.Pointer(pRtree)).FnBytesPerCell))
+func nodeDeleteCell(tls *libc.TLS, pRtree uintptr, pNode uintptr, iCell int32) { /* sqlite3.c:194732:13: */
+ var pDst uintptr = (*RtreeNode)(unsafe.Pointer(pNode)).FzData + uintptr(4+int32((*Rtree)(unsafe.Pointer(pRtree)).FnBytesPerCell)*iCell)
+ var pSrc uintptr = pDst + uintptr((*Rtree)(unsafe.Pointer(pRtree)).FnBytesPerCell)
+ var nByte int32 = (readInt16(tls, (*RtreeNode)(unsafe.Pointer(pNode)).FzData+2) - iCell - 1) * int32((*Rtree)(unsafe.Pointer(pRtree)).FnBytesPerCell)
libc.Xmemmove(tls, pDst, pSrc, uint32(nByte))
- writeInt16(tls, ((*RtreeNode)(unsafe.Pointer(pNode)).FzData + 2), (readInt16(tls, ((*RtreeNode)(unsafe.Pointer((pNode))).FzData+2)) - 1))
+ writeInt16(tls, (*RtreeNode)(unsafe.Pointer(pNode)).FzData+2, readInt16(tls, (*RtreeNode)(unsafe.Pointer(pNode)).FzData+2)-1)
(*RtreeNode)(unsafe.Pointer(pNode)).FisDirty = 1
}
@@ -153201,24 +155388,24 @@ func nodeDeleteCell(tls *libc.TLS, pRtree uintptr, pNode uintptr, iCell int32) {
// is successful, return SQLITE_OK.
//
// If there is not enough free space in pNode, return SQLITE_FULL.
-func nodeInsertCell(tls *libc.TLS, pRtree uintptr, pNode uintptr, pCell uintptr) int32 { /* sqlite3.c:193106:12: */
+func nodeInsertCell(tls *libc.TLS, pRtree uintptr, pNode uintptr, pCell uintptr) int32 { /* sqlite3.c:194747:12: */
var nCell int32 // Current number of cells in pNode
var nMaxCell int32 // Maximum number of cells for pNode
- nMaxCell = (((*Rtree)(unsafe.Pointer(pRtree)).FiNodeSize - 4) / int32((*Rtree)(unsafe.Pointer(pRtree)).FnBytesPerCell))
- nCell = readInt16(tls, ((*RtreeNode)(unsafe.Pointer((pNode))).FzData + 2))
+ nMaxCell = ((*Rtree)(unsafe.Pointer(pRtree)).FiNodeSize - 4) / int32((*Rtree)(unsafe.Pointer(pRtree)).FnBytesPerCell)
+ nCell = readInt16(tls, (*RtreeNode)(unsafe.Pointer(pNode)).FzData+2)
if nCell < nMaxCell {
nodeOverwriteCell(tls, pRtree, pNode, pCell, nCell)
- writeInt16(tls, ((*RtreeNode)(unsafe.Pointer(pNode)).FzData + 2), (nCell + 1))
+ writeInt16(tls, (*RtreeNode)(unsafe.Pointer(pNode)).FzData+2, nCell+1)
(*RtreeNode)(unsafe.Pointer(pNode)).FisDirty = 1
}
- return (libc.Bool32(nCell == nMaxCell))
+ return libc.Bool32(nCell == nMaxCell)
}
// If the node is dirty, write it out to the database.
-func nodeWrite(tls *libc.TLS, pRtree uintptr, pNode uintptr) int32 { /* sqlite3.c:193130:12: */
+func nodeWrite(tls *libc.TLS, pRtree uintptr, pNode uintptr) int32 { /* sqlite3.c:194771:12: */
var rc int32 = SQLITE_OK
if (*RtreeNode)(unsafe.Pointer(pNode)).FisDirty != 0 {
var p uintptr = (*Rtree)(unsafe.Pointer(pRtree)).FpWriteNode
@@ -153232,7 +155419,7 @@ func nodeWrite(tls *libc.TLS, pRtree uintptr, pNode uintptr) int32 { /* sqlite3.
(*RtreeNode)(unsafe.Pointer(pNode)).FisDirty = 0
rc = Xsqlite3_reset(tls, p)
Xsqlite3_bind_null(tls, p, 2)
- if ((*RtreeNode)(unsafe.Pointer(pNode)).FiNode == int64(0)) && (rc == SQLITE_OK) {
+ if (*RtreeNode)(unsafe.Pointer(pNode)).FiNode == int64(0) && rc == SQLITE_OK {
(*RtreeNode)(unsafe.Pointer(pNode)).FiNode = Xsqlite3_last_insert_rowid(tls, (*Rtree)(unsafe.Pointer(pRtree)).Fdb)
nodeHashInsert(tls, pRtree, pNode)
}
@@ -153242,7 +155429,7 @@ func nodeWrite(tls *libc.TLS, pRtree uintptr, pNode uintptr) int32 { /* sqlite3.
// Release a reference to a node. If the node is dirty and the reference
// count drops to zero, the node data is written to the database.
-func nodeRelease(tls *libc.TLS, pRtree uintptr, pNode uintptr) int32 { /* sqlite3.c:193156:12: */
+func nodeRelease(tls *libc.TLS, pRtree uintptr, pNode uintptr) int32 { /* sqlite3.c:194797:12: */
var rc int32 = SQLITE_OK
if pNode != 0 {
@@ -153268,51 +155455,51 @@ func nodeRelease(tls *libc.TLS, pRtree uintptr, pNode uintptr) int32 { /* sqlite
// Return the 64-bit integer value associated with cell iCell of
// node pNode. If pNode is a leaf node, this is a rowid. If it is
// an internal node, then the 64-bit integer is a child page number.
-func nodeGetRowid(tls *libc.TLS, pRtree uintptr, pNode uintptr, iCell int32) I64 { /* sqlite3.c:193185:12: */
+func nodeGetRowid(tls *libc.TLS, pRtree uintptr, pNode uintptr, iCell int32) I64 { /* sqlite3.c:194826:12: */
- return readInt64(tls, ((*RtreeNode)(unsafe.Pointer(pNode)).FzData + uintptr((4 + (int32((*Rtree)(unsafe.Pointer(pRtree)).FnBytesPerCell) * iCell)))))
+ return readInt64(tls, (*RtreeNode)(unsafe.Pointer(pNode)).FzData+uintptr(4+int32((*Rtree)(unsafe.Pointer(pRtree)).FnBytesPerCell)*iCell))
}
// Return coordinate iCoord from cell iCell in node pNode.
-func nodeGetCoord(tls *libc.TLS, pRtree uintptr, pNode uintptr, iCell int32, iCoord int32, pCoord uintptr) { /* sqlite3.c:193197:13: */
- readCoord(tls, ((*RtreeNode)(unsafe.Pointer(pNode)).FzData + uintptr(((12 + (int32((*Rtree)(unsafe.Pointer(pRtree)).FnBytesPerCell) * iCell)) + (4 * iCoord)))), pCoord)
+func nodeGetCoord(tls *libc.TLS, pRtree uintptr, pNode uintptr, iCell int32, iCoord int32, pCoord uintptr) { /* sqlite3.c:194838:13: */
+ readCoord(tls, (*RtreeNode)(unsafe.Pointer(pNode)).FzData+uintptr(12+int32((*Rtree)(unsafe.Pointer(pRtree)).FnBytesPerCell)*iCell+4*iCoord), pCoord)
}
// Deserialize cell iCell of node pNode. Populate the structure pointed
// to by pCell with the results.
-func nodeGetCell(tls *libc.TLS, pRtree uintptr, pNode uintptr, iCell int32, pCell uintptr) { /* sqlite3.c:193211:13: */
+func nodeGetCell(tls *libc.TLS, pRtree uintptr, pNode uintptr, iCell int32, pCell uintptr) { /* sqlite3.c:194852:13: */
var pData uintptr
var pCoord uintptr
var ii int32 = 0
(*RtreeCell)(unsafe.Pointer(pCell)).FiRowid = nodeGetRowid(tls, pRtree, pNode, iCell)
- pData = ((*RtreeNode)(unsafe.Pointer(pNode)).FzData + uintptr((12 + (int32((*Rtree)(unsafe.Pointer(pRtree)).FnBytesPerCell) * iCell))))
+ pData = (*RtreeNode)(unsafe.Pointer(pNode)).FzData + uintptr(12+int32((*Rtree)(unsafe.Pointer(pRtree)).FnBytesPerCell)*iCell)
pCoord = pCell + 8 /* &.aCoord */
- for ok := true; ok; ok = (ii < int32((*Rtree)(unsafe.Pointer(pRtree)).FnDim2)) {
- readCoord(tls, pData, (pCoord + uintptr(ii)*4))
- readCoord(tls, (pData + uintptr(4)), (pCoord + uintptr((ii+1))*4))
+ for ok := true; ok; ok = ii < int32((*Rtree)(unsafe.Pointer(pRtree)).FnDim2) {
+ readCoord(tls, pData, pCoord+uintptr(ii)*4)
+ readCoord(tls, pData+uintptr(4), pCoord+uintptr(ii+1)*4)
pData += uintptr(8)
- ii = ii + (2)
+ ii = ii + 2
}
}
// Rtree virtual table module xCreate method.
-func rtreeCreate(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uintptr, ppVtab uintptr, pzErr uintptr) int32 { /* sqlite3.c:193242:12: */
+func rtreeCreate(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uintptr, ppVtab uintptr, pzErr uintptr) int32 { /* sqlite3.c:194883:12: */
return rtreeInit(tls, db, pAux, argc, argv, ppVtab, pzErr, 1)
}
// Rtree virtual table module xConnect method.
-func rtreeConnect(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uintptr, ppVtab uintptr, pzErr uintptr) int32 { /* sqlite3.c:193255:12: */
+func rtreeConnect(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uintptr, ppVtab uintptr, pzErr uintptr) int32 { /* sqlite3.c:194896:12: */
return rtreeInit(tls, db, pAux, argc, argv, ppVtab, pzErr, 0)
}
// Increment the r-tree reference count.
-func rtreeReference(tls *libc.TLS, pRtree uintptr) { /* sqlite3.c:193268:13: */
+func rtreeReference(tls *libc.TLS, pRtree uintptr) { /* sqlite3.c:194909:13: */
(*Rtree)(unsafe.Pointer(pRtree)).FnBusy++
}
// Decrement the r-tree reference count. When the reference count reaches
// zero the structure is deleted.
-func rtreeRelease(tls *libc.TLS, pRtree uintptr) { /* sqlite3.c:193276:13: */
+func rtreeRelease(tls *libc.TLS, pRtree uintptr) { /* sqlite3.c:194917:13: */
(*Rtree)(unsafe.Pointer(pRtree)).FnBusy--
if (*Rtree)(unsafe.Pointer(pRtree)).FnBusy == U32(0) {
(*Rtree)(unsafe.Pointer(pRtree)).FinWrTrans = U8(0)
@@ -153334,13 +155521,13 @@ func rtreeRelease(tls *libc.TLS, pRtree uintptr) { /* sqlite3.c:193276:13: */
}
// Rtree virtual table module xDisconnect method.
-func rtreeDisconnect(tls *libc.TLS, pVtab uintptr) int32 { /* sqlite3.c:193300:12: */
+func rtreeDisconnect(tls *libc.TLS, pVtab uintptr) int32 { /* sqlite3.c:194941:12: */
rtreeRelease(tls, pVtab)
return SQLITE_OK
}
// Rtree virtual table module xDestroy method.
-func rtreeDestroy(tls *libc.TLS, pVtab uintptr) int32 { /* sqlite3.c:193308:12: */
+func rtreeDestroy(tls *libc.TLS, pVtab uintptr) int32 { /* sqlite3.c:194949:12: */
bp := tls.Alloc(48)
defer tls.Free(48)
@@ -153348,7 +155535,7 @@ func rtreeDestroy(tls *libc.TLS, pVtab uintptr) int32 { /* sqlite3.c:193308:12:
var rc int32
var zCreate uintptr = Xsqlite3_mprintf(tls,
- ts+23321, /* "DROP TABLE '%q'...." */
+ ts+24618, /* "DROP TABLE '%q'...." */
libc.VaList(bp, (*Rtree)(unsafe.Pointer(pRtree)).FzDb, (*Rtree)(unsafe.Pointer(pRtree)).FzName,
(*Rtree)(unsafe.Pointer(pRtree)).FzDb, (*Rtree)(unsafe.Pointer(pRtree)).FzName,
(*Rtree)(unsafe.Pointer(pRtree)).FzDb, (*Rtree)(unsafe.Pointer(pRtree)).FzName))
@@ -153367,7 +155554,7 @@ func rtreeDestroy(tls *libc.TLS, pVtab uintptr) int32 { /* sqlite3.c:193308:12:
}
// Rtree virtual table module xOpen method.
-func rtreeOpen(tls *libc.TLS, pVTab uintptr, ppCursor uintptr) int32 { /* sqlite3.c:193336:12: */
+func rtreeOpen(tls *libc.TLS, pVTab uintptr, ppCursor uintptr) int32 { /* sqlite3.c:194977:12: */
var rc int32 = SQLITE_NOMEM
var pRtree uintptr = pVTab
var pCsr uintptr
@@ -153385,7 +155572,7 @@ func rtreeOpen(tls *libc.TLS, pVTab uintptr, ppCursor uintptr) int32 { /* sqlite
}
// Reset a cursor back to its initial state.
-func resetCursor(tls *libc.TLS, pCsr uintptr) { /* sqlite3.c:193357:13: */
+func resetCursor(tls *libc.TLS, pCsr uintptr) { /* sqlite3.c:194998:13: */
var pRtree uintptr = (*RtreeCursor)(unsafe.Pointer(pCsr)).Fbase.FpVtab
var ii int32
var pStmt uintptr
@@ -153404,7 +155591,7 @@ func resetCursor(tls *libc.TLS, pCsr uintptr) { /* sqlite3.c:193357:13: */
(*RtreeCursor)(unsafe.Pointer(pCsr)).FaConstraint = uintptr(0)
}
for ii = 0; ii < RTREE_CACHE_SZ; ii++ {
- nodeRelease(tls, pRtree, *(*uintptr)(unsafe.Pointer((pCsr + 64 /* &.aNode */) + uintptr(ii)*4)))
+ nodeRelease(tls, pRtree, *(*uintptr)(unsafe.Pointer(pCsr + 64 + uintptr(ii)*4)))
}
Xsqlite3_free(tls, (*RtreeCursor)(unsafe.Pointer(pCsr)).FaPoint)
pStmt = (*RtreeCursor)(unsafe.Pointer(pCsr)).FpReadAux
@@ -153415,7 +155602,7 @@ func resetCursor(tls *libc.TLS, pCsr uintptr) { /* sqlite3.c:193357:13: */
}
// Rtree virtual table module xClose method.
-func rtreeClose(tls *libc.TLS, cur uintptr) int32 { /* sqlite3.c:193385:12: */
+func rtreeClose(tls *libc.TLS, cur uintptr) int32 { /* sqlite3.c:195026:12: */
var pRtree uintptr = (*Sqlite3_vtab_cursor)(unsafe.Pointer(cur)).FpVtab
var pCsr uintptr = cur
@@ -153431,7 +155618,7 @@ func rtreeClose(tls *libc.TLS, cur uintptr) int32 { /* sqlite3.c:193385:12: */
//
// Return non-zero if the cursor does not currently point to a valid
// record (i.e if the scan has finished), or zero otherwise.
-func rtreeEof(tls *libc.TLS, cur uintptr) int32 { /* sqlite3.c:193403:12: */
+func rtreeEof(tls *libc.TLS, cur uintptr) int32 { /* sqlite3.c:195044:12: */
var pCsr uintptr = cur
return int32((*RtreeCursor)(unsafe.Pointer(pCsr)).FatEOF)
}
@@ -153448,7 +155635,7 @@ func rtreeEof(tls *libc.TLS, cur uintptr) int32 { /* sqlite3.c:193403:12: */
// Check the RTree node or entry given by pCellData and p against the MATCH
// constraint pConstraint.
-func rtreeCallbackConstraint(tls *libc.TLS, pConstraint uintptr, eInt int32, pCellData uintptr, pSearch uintptr, prScore uintptr, peWithin uintptr) int32 { /* sqlite3.c:193458:12: */
+func rtreeCallbackConstraint(tls *libc.TLS, pConstraint uintptr, eInt int32, pCellData uintptr, pSearch uintptr, prScore uintptr, peWithin uintptr) int32 { /* sqlite3.c:195099:12: */
bp := tls.Alloc(92)
defer tls.Free(92)
@@ -153460,38 +155647,38 @@ func rtreeCallbackConstraint(tls *libc.TLS, pConstraint uintptr, eInt int32, pCe
// var aCoord [10]Sqlite3_rtree_dbl at bp+8, 80
// Decoded coordinates
- if ((*RtreeConstraint)(unsafe.Pointer(pConstraint)).Fop == RTREE_QUERY) && (int32((*RtreeSearchPoint)(unsafe.Pointer(pSearch)).FiLevel) == 1) {
+ if (*RtreeConstraint)(unsafe.Pointer(pConstraint)).Fop == RTREE_QUERY && int32((*RtreeSearchPoint)(unsafe.Pointer(pSearch)).FiLevel) == 1 {
(*Sqlite3_rtree_query_info)(unsafe.Pointer(pInfo)).FiRowid = readInt64(tls, pCellData)
}
pCellData += uintptr(8)
if eInt == 0 {
switch nCoord {
case 10:
- readCoord(tls, (pCellData + uintptr(36)), bp /* &c */)
+ readCoord(tls, pCellData+uintptr(36), bp /* &c */)
*(*Sqlite3_rtree_dbl)(unsafe.Pointer(bp + 8 /* &aCoord[0] */ + 9*8)) = Sqlite3_rtree_dbl(*(*RtreeValue)(unsafe.Pointer(bp /* &c */)))
- readCoord(tls, (pCellData + uintptr(32)), bp /* &c */)
+ readCoord(tls, pCellData+uintptr(32), bp /* &c */)
*(*Sqlite3_rtree_dbl)(unsafe.Pointer(bp + 8 /* &aCoord[0] */ + 8*8)) = Sqlite3_rtree_dbl(*(*RtreeValue)(unsafe.Pointer(bp /* &c */)))
fallthrough
case 8:
- readCoord(tls, (pCellData + uintptr(28)), bp /* &c */)
+ readCoord(tls, pCellData+uintptr(28), bp /* &c */)
*(*Sqlite3_rtree_dbl)(unsafe.Pointer(bp + 8 /* &aCoord[0] */ + 7*8)) = Sqlite3_rtree_dbl(*(*RtreeValue)(unsafe.Pointer(bp /* &c */)))
- readCoord(tls, (pCellData + uintptr(24)), bp /* &c */)
+ readCoord(tls, pCellData+uintptr(24), bp /* &c */)
*(*Sqlite3_rtree_dbl)(unsafe.Pointer(bp + 8 /* &aCoord[0] */ + 6*8)) = Sqlite3_rtree_dbl(*(*RtreeValue)(unsafe.Pointer(bp /* &c */)))
fallthrough
case 6:
- readCoord(tls, (pCellData + uintptr(20)), bp /* &c */)
+ readCoord(tls, pCellData+uintptr(20), bp /* &c */)
*(*Sqlite3_rtree_dbl)(unsafe.Pointer(bp + 8 /* &aCoord[0] */ + 5*8)) = Sqlite3_rtree_dbl(*(*RtreeValue)(unsafe.Pointer(bp /* &c */)))
- readCoord(tls, (pCellData + uintptr(16)), bp /* &c */)
+ readCoord(tls, pCellData+uintptr(16), bp /* &c */)
*(*Sqlite3_rtree_dbl)(unsafe.Pointer(bp + 8 /* &aCoord[0] */ + 4*8)) = Sqlite3_rtree_dbl(*(*RtreeValue)(unsafe.Pointer(bp /* &c */)))
fallthrough
case 4:
- readCoord(tls, (pCellData + uintptr(12)), bp /* &c */)
+ readCoord(tls, pCellData+uintptr(12), bp /* &c */)
*(*Sqlite3_rtree_dbl)(unsafe.Pointer(bp + 8 /* &aCoord[0] */ + 3*8)) = Sqlite3_rtree_dbl(*(*RtreeValue)(unsafe.Pointer(bp /* &c */)))
- readCoord(tls, (pCellData + uintptr(8)), bp /* &c */)
+ readCoord(tls, pCellData+uintptr(8), bp /* &c */)
*(*Sqlite3_rtree_dbl)(unsafe.Pointer(bp + 8 /* &aCoord[0] */ + 2*8)) = Sqlite3_rtree_dbl(*(*RtreeValue)(unsafe.Pointer(bp /* &c */)))
fallthrough
default:
- readCoord(tls, (pCellData + uintptr(4)), bp /* &c */)
+ readCoord(tls, pCellData+uintptr(4), bp /* &c */)
*(*Sqlite3_rtree_dbl)(unsafe.Pointer(bp + 8 /* &aCoord[0] */ + 1*8)) = Sqlite3_rtree_dbl(*(*RtreeValue)(unsafe.Pointer(bp /* &c */)))
readCoord(tls, pCellData, bp /* &c */)
*(*Sqlite3_rtree_dbl)(unsafe.Pointer(bp + 8 /* &aCoord[0] */)) = Sqlite3_rtree_dbl(*(*RtreeValue)(unsafe.Pointer(bp /* &c */)))
@@ -153499,31 +155686,31 @@ func rtreeCallbackConstraint(tls *libc.TLS, pConstraint uintptr, eInt int32, pCe
} else {
switch nCoord {
case 10:
- readCoord(tls, (pCellData + uintptr(36)), bp /* &c */)
+ readCoord(tls, pCellData+uintptr(36), bp /* &c */)
*(*Sqlite3_rtree_dbl)(unsafe.Pointer(bp + 8 /* &aCoord[0] */ + 9*8)) = Sqlite3_rtree_dbl(*(*int32)(unsafe.Pointer(bp /* &c */)))
- readCoord(tls, (pCellData + uintptr(32)), bp /* &c */)
+ readCoord(tls, pCellData+uintptr(32), bp /* &c */)
*(*Sqlite3_rtree_dbl)(unsafe.Pointer(bp + 8 /* &aCoord[0] */ + 8*8)) = Sqlite3_rtree_dbl(*(*int32)(unsafe.Pointer(bp /* &c */)))
fallthrough
case 8:
- readCoord(tls, (pCellData + uintptr(28)), bp /* &c */)
+ readCoord(tls, pCellData+uintptr(28), bp /* &c */)
*(*Sqlite3_rtree_dbl)(unsafe.Pointer(bp + 8 /* &aCoord[0] */ + 7*8)) = Sqlite3_rtree_dbl(*(*int32)(unsafe.Pointer(bp /* &c */)))
- readCoord(tls, (pCellData + uintptr(24)), bp /* &c */)
+ readCoord(tls, pCellData+uintptr(24), bp /* &c */)
*(*Sqlite3_rtree_dbl)(unsafe.Pointer(bp + 8 /* &aCoord[0] */ + 6*8)) = Sqlite3_rtree_dbl(*(*int32)(unsafe.Pointer(bp /* &c */)))
fallthrough
case 6:
- readCoord(tls, (pCellData + uintptr(20)), bp /* &c */)
+ readCoord(tls, pCellData+uintptr(20), bp /* &c */)
*(*Sqlite3_rtree_dbl)(unsafe.Pointer(bp + 8 /* &aCoord[0] */ + 5*8)) = Sqlite3_rtree_dbl(*(*int32)(unsafe.Pointer(bp /* &c */)))
- readCoord(tls, (pCellData + uintptr(16)), bp /* &c */)
+ readCoord(tls, pCellData+uintptr(16), bp /* &c */)
*(*Sqlite3_rtree_dbl)(unsafe.Pointer(bp + 8 /* &aCoord[0] */ + 4*8)) = Sqlite3_rtree_dbl(*(*int32)(unsafe.Pointer(bp /* &c */)))
fallthrough
case 4:
- readCoord(tls, (pCellData + uintptr(12)), bp /* &c */)
+ readCoord(tls, pCellData+uintptr(12), bp /* &c */)
*(*Sqlite3_rtree_dbl)(unsafe.Pointer(bp + 8 /* &aCoord[0] */ + 3*8)) = Sqlite3_rtree_dbl(*(*int32)(unsafe.Pointer(bp /* &c */)))
- readCoord(tls, (pCellData + uintptr(8)), bp /* &c */)
+ readCoord(tls, pCellData+uintptr(8), bp /* &c */)
*(*Sqlite3_rtree_dbl)(unsafe.Pointer(bp + 8 /* &aCoord[0] */ + 2*8)) = Sqlite3_rtree_dbl(*(*int32)(unsafe.Pointer(bp /* &c */)))
fallthrough
default:
- readCoord(tls, (pCellData + uintptr(4)), bp /* &c */)
+ readCoord(tls, pCellData+uintptr(4), bp /* &c */)
*(*Sqlite3_rtree_dbl)(unsafe.Pointer(bp + 8 /* &aCoord[0] */ + 1*8)) = Sqlite3_rtree_dbl(*(*int32)(unsafe.Pointer(bp /* &c */)))
readCoord(tls, pCellData, bp /* &c */)
*(*Sqlite3_rtree_dbl)(unsafe.Pointer(bp + 8 /* &aCoord[0] */)) = Sqlite3_rtree_dbl(*(*int32)(unsafe.Pointer(bp /* &c */)))
@@ -153535,22 +155722,22 @@ func rtreeCallbackConstraint(tls *libc.TLS, pConstraint uintptr, eInt int32, pCe
f func(*libc.TLS, uintptr, int32, uintptr, uintptr) int32
})(unsafe.Pointer(&struct{ uintptr }{*(*uintptr)(unsafe.Pointer(pConstraint + 8 /* &.u */))})).f(tls, pInfo,
nCoord, bp+8 /* &aCoord[0] */, bp+88 /* &eWithin */)
- if *(*int32)(unsafe.Pointer(bp + 88 /* eWithin */)) == 0 {
+ if *(*int32)(unsafe.Pointer(bp + 88)) == 0 {
*(*int32)(unsafe.Pointer(peWithin)) = NOT_WITHIN
}
*(*Sqlite3_rtree_dbl)(unsafe.Pointer(prScore)) = 0.0
} else {
(*Sqlite3_rtree_query_info)(unsafe.Pointer(pInfo)).FaCoord = bp + 8 /* &aCoord[0] */
- (*Sqlite3_rtree_query_info)(unsafe.Pointer(pInfo)).FiLevel = (int32((*RtreeSearchPoint)(unsafe.Pointer(pSearch)).FiLevel) - 1)
- (*Sqlite3_rtree_query_info)(unsafe.Pointer(pInfo)).FrScore = libc.AssignPtrFloat64(pInfo+48 /* &.rParentScore */, (*RtreeSearchPoint)(unsafe.Pointer(pSearch)).FrScore)
- (*Sqlite3_rtree_query_info)(unsafe.Pointer(pInfo)).FeWithin = libc.AssignPtrInt32(pInfo+56 /* &.eParentWithin */, int32((*RtreeSearchPoint)(unsafe.Pointer(pSearch)).FeWithin))
+ (*Sqlite3_rtree_query_info)(unsafe.Pointer(pInfo)).FiLevel = int32((*RtreeSearchPoint)(unsafe.Pointer(pSearch)).FiLevel) - 1
+ (*Sqlite3_rtree_query_info)(unsafe.Pointer(pInfo)).FrScore = libc.AssignPtrFloat64(pInfo+48, (*RtreeSearchPoint)(unsafe.Pointer(pSearch)).FrScore)
+ (*Sqlite3_rtree_query_info)(unsafe.Pointer(pInfo)).FeWithin = libc.AssignPtrInt32(pInfo+56, int32((*RtreeSearchPoint)(unsafe.Pointer(pSearch)).FeWithin))
rc = (*struct {
f func(*libc.TLS, uintptr) int32
})(unsafe.Pointer(&struct{ uintptr }{*(*uintptr)(unsafe.Pointer(pConstraint + 8 /* &.u */))})).f(tls, pInfo)
if (*Sqlite3_rtree_query_info)(unsafe.Pointer(pInfo)).FeWithin < *(*int32)(unsafe.Pointer(peWithin)) {
*(*int32)(unsafe.Pointer(peWithin)) = (*Sqlite3_rtree_query_info)(unsafe.Pointer(pInfo)).FeWithin
}
- if ((*Sqlite3_rtree_query_info)(unsafe.Pointer(pInfo)).FrScore < *(*Sqlite3_rtree_dbl)(unsafe.Pointer(prScore))) || (*(*Sqlite3_rtree_dbl)(unsafe.Pointer(prScore)) < 0.0) {
+ if (*Sqlite3_rtree_query_info)(unsafe.Pointer(pInfo)).FrScore < *(*Sqlite3_rtree_dbl)(unsafe.Pointer(prScore)) || *(*Sqlite3_rtree_dbl)(unsafe.Pointer(prScore)) < 0.0 {
*(*Sqlite3_rtree_dbl)(unsafe.Pointer(prScore)) = (*Sqlite3_rtree_query_info)(unsafe.Pointer(pInfo)).FrScore
}
}
@@ -153560,15 +155747,15 @@ func rtreeCallbackConstraint(tls *libc.TLS, pConstraint uintptr, eInt int32, pCe
// Check the internal RTree node given by pCellData against constraint p.
// If this constraint cannot be satisfied by any child within the node,
// set *peWithin to NOT_WITHIN.
-func rtreeNonleafConstraint(tls *libc.TLS, p uintptr, eInt int32, pCellData uintptr, peWithin uintptr) { /* sqlite3.c:193534:13: */
- bp := tls.Alloc(8)
- defer tls.Free(8)
+func rtreeNonleafConstraint(tls *libc.TLS, p uintptr, eInt int32, pCellData uintptr, peWithin uintptr) { /* sqlite3.c:195175:13: */
+ bp := tls.Alloc(16)
+ defer tls.Free(16)
var val Sqlite3_rtree_dbl // Coordinate value convert to a double
// p->iCoord might point to either a lower or upper bound coordinate
// in a coordinate pair. But make pCellData point to the lower bound.
- pCellData += (uintptr(8 + (4 * ((*RtreeConstraint)(unsafe.Pointer(p)).FiCoord & 0xfe))))
+ pCellData += uintptr(8 + 4*((*RtreeConstraint)(unsafe.Pointer(p)).FiCoord&0xfe))
// 4-byte aligned
switch (*RtreeConstraint)(unsafe.Pointer(p)).Fop {
@@ -153576,10 +155763,6 @@ func rtreeNonleafConstraint(tls *libc.TLS, p uintptr, eInt int32, pCellData uint
return // Always satisfied
case RTREE_FALSE:
break // Never satisfied
- case RTREE_LE:
- fallthrough
- case RTREE_LT:
- fallthrough
case RTREE_EQ:
{
// var c RtreeCoord at bp, 4
@@ -153593,32 +155776,63 @@ func rtreeNonleafConstraint(tls *libc.TLS, p uintptr, eInt int32, pCellData uint
}
// val now holds the lower bound of the coordinate pair
- if *(*RtreeDValue)(unsafe.Pointer(p + 8 /* &.u */)) >= val {
- return
+ if *(*RtreeDValue)(unsafe.Pointer(p + 8)) >= val {
+ pCellData += uintptr(4)
+ {
+ // var c RtreeCoord at bp+4, 4
+ /* Coordinate decoded */
+ *(*U32)(unsafe.Pointer(bp + 4 /* &c */)) = libc.X__builtin_bswap32(tls, *(*U32)(unsafe.Pointer(pCellData)))
+ if eInt != 0 {
+ val = Sqlite3_rtree_dbl(*(*int32)(unsafe.Pointer(bp + 4 /* &c */)))
+ } else {
+ val = Sqlite3_rtree_dbl(*(*RtreeValue)(unsafe.Pointer(bp + 4 /* &c */)))
+ }
+ }
+
+ // val now holds the upper bound of the coordinate pair
+ if *(*RtreeDValue)(unsafe.Pointer(p + 8)) <= val {
+ return
+ }
}
- if (*RtreeConstraint)(unsafe.Pointer(p)).Fop != RTREE_EQ {
- break
+ break
+ case RTREE_LE:
+ fallthrough
+ case RTREE_LT:
+ {
+ // var c RtreeCoord at bp+8, 4
+ /* Coordinate decoded */
+ *(*U32)(unsafe.Pointer(bp + 8 /* &c */)) = libc.X__builtin_bswap32(tls, *(*U32)(unsafe.Pointer(pCellData)))
+ if eInt != 0 {
+ val = Sqlite3_rtree_dbl(*(*int32)(unsafe.Pointer(bp + 8 /* &c */)))
+ } else {
+ val = Sqlite3_rtree_dbl(*(*RtreeValue)(unsafe.Pointer(bp + 8 /* &c */)))
+ }
}
- fallthrough // RTREE_LE and RTREE_LT end here
- // Fall through for the RTREE_EQ case
- default: // RTREE_GT or RTREE_GE, or fallthrough of RTREE_EQ
+ // val now holds the lower bound of the coordinate pair
+ if *(*RtreeDValue)(unsafe.Pointer(p + 8)) >= val {
+ return
+ }
+ break
+
+ default:
pCellData += uintptr(4)
{
- // var c RtreeCoord at bp+4, 4
+ // var c RtreeCoord at bp+12, 4
/* Coordinate decoded */
- *(*U32)(unsafe.Pointer(bp + 4 /* &c */)) = libc.X__builtin_bswap32(tls, *(*U32)(unsafe.Pointer(pCellData)))
+ *(*U32)(unsafe.Pointer(bp + 12 /* &c */)) = libc.X__builtin_bswap32(tls, *(*U32)(unsafe.Pointer(pCellData)))
if eInt != 0 {
- val = Sqlite3_rtree_dbl(*(*int32)(unsafe.Pointer(bp + 4 /* &c */)))
+ val = Sqlite3_rtree_dbl(*(*int32)(unsafe.Pointer(bp + 12 /* &c */)))
} else {
- val = Sqlite3_rtree_dbl(*(*RtreeValue)(unsafe.Pointer(bp + 4 /* &c */)))
+ val = Sqlite3_rtree_dbl(*(*RtreeValue)(unsafe.Pointer(bp + 12 /* &c */)))
}
}
// val now holds the upper bound of the coordinate pair
- if *(*RtreeDValue)(unsafe.Pointer(p + 8 /* &.u */)) <= val {
+ if *(*RtreeDValue)(unsafe.Pointer(p + 8)) <= val {
return
}
+ break
}
*(*int32)(unsafe.Pointer(peWithin)) = NOT_WITHIN
}
@@ -153631,13 +155845,13 @@ func rtreeNonleafConstraint(tls *libc.TLS, p uintptr, eInt int32, pCellData uint
//
// The op is given by p->op. The xN is p->iCoord-th coordinate in
// pCellData. $val is given by p->u.rValue.
-func rtreeLeafConstraint(tls *libc.TLS, p uintptr, eInt int32, pCellData uintptr, peWithin uintptr) { /* sqlite3.c:193582:13: */
+func rtreeLeafConstraint(tls *libc.TLS, p uintptr, eInt int32, pCellData uintptr, peWithin uintptr) { /* sqlite3.c:195232:13: */
bp := tls.Alloc(4)
defer tls.Free(4)
var xN RtreeDValue // Coordinate value converted to a double
- pCellData += (uintptr(8 + ((*RtreeConstraint)(unsafe.Pointer(p)).FiCoord * 4)))
+ pCellData += uintptr(8 + (*RtreeConstraint)(unsafe.Pointer(p)).FiCoord*4)
/* 4-byte aligned */
{
// var c RtreeCoord at bp, 4
@@ -153656,27 +155870,27 @@ func rtreeLeafConstraint(tls *libc.TLS, p uintptr, eInt int32, pCellData uintptr
case RTREE_FALSE:
break // Never satisfied
case RTREE_LE:
- if xN <= *(*RtreeDValue)(unsafe.Pointer(p + 8 /* &.u */)) {
+ if xN <= *(*RtreeDValue)(unsafe.Pointer(p + 8)) {
return
}
break
case RTREE_LT:
- if xN < *(*RtreeDValue)(unsafe.Pointer(p + 8 /* &.u */)) {
+ if xN < *(*RtreeDValue)(unsafe.Pointer(p + 8)) {
return
}
break
case RTREE_GE:
- if xN >= *(*RtreeDValue)(unsafe.Pointer(p + 8 /* &.u */)) {
+ if xN >= *(*RtreeDValue)(unsafe.Pointer(p + 8)) {
return
}
break
case RTREE_GT:
- if xN > *(*RtreeDValue)(unsafe.Pointer(p + 8 /* &.u */)) {
+ if xN > *(*RtreeDValue)(unsafe.Pointer(p + 8)) {
return
}
break
default:
- if xN == *(*RtreeDValue)(unsafe.Pointer(p + 8 /* &.u */)) {
+ if xN == *(*RtreeDValue)(unsafe.Pointer(p + 8)) {
return
}
break
@@ -153686,9 +155900,9 @@ func rtreeLeafConstraint(tls *libc.TLS, p uintptr, eInt int32, pCellData uintptr
// One of the cells in node pNode is guaranteed to have a 64-bit
// integer value equal to iRowid. Return the index of this cell.
-func nodeRowidIndex(tls *libc.TLS, pRtree uintptr, pNode uintptr, iRowid I64, piIndex uintptr) int32 { /* sqlite3.c:193612:12: */
+func nodeRowidIndex(tls *libc.TLS, pRtree uintptr, pNode uintptr, iRowid I64, piIndex uintptr) int32 { /* sqlite3.c:195262:12: */
var ii int32
- var nCell int32 = readInt16(tls, ((*RtreeNode)(unsafe.Pointer((pNode))).FzData + 2))
+ var nCell int32 = readInt16(tls, (*RtreeNode)(unsafe.Pointer(pNode)).FzData+2)
for ii = 0; ii < nCell; ii++ {
if nodeGetRowid(tls, pRtree, pNode, ii) == iRowid {
@@ -153697,18 +155911,20 @@ func nodeRowidIndex(tls *libc.TLS, pRtree uintptr, pNode uintptr, iRowid I64, pi
}
}
- return (SQLITE_CORRUPT | (int32(1) << 8))
+ return SQLITE_CORRUPT | int32(1)<<8
}
// Return the index of the cell containing a pointer to node pNode
// in its parent. If pNode is the root node, return -1.
-func nodeParentIndex(tls *libc.TLS, pRtree uintptr, pNode uintptr, piIndex uintptr) int32 { /* sqlite3.c:193635:12: */
+func nodeParentIndex(tls *libc.TLS, pRtree uintptr, pNode uintptr, piIndex uintptr) int32 { /* sqlite3.c:195285:12: */
var pParent uintptr = (*RtreeNode)(unsafe.Pointer(pNode)).FpParent
if pParent != 0 {
return nodeRowidIndex(tls, pRtree, pParent, (*RtreeNode)(unsafe.Pointer(pNode)).FiNode, piIndex)
+ } else {
+ *(*int32)(unsafe.Pointer(piIndex)) = -1
+ return SQLITE_OK
}
- *(*int32)(unsafe.Pointer(piIndex)) = -1
- return SQLITE_OK
+ return int32(0)
}
// Compare two search points. Return negative, zero, or positive if the first
@@ -153719,7 +155935,7 @@ func nodeParentIndex(tls *libc.TLS, pRtree uintptr, pNode uintptr, piIndex uintp
// iLevel values coming first. In this way, if rScore is the same for all
// SearchPoints, then iLevel becomes the deciding factor and the result
// is a depth-first search, which is the desired default behavior.
-func rtreeSearchPointCompare(tls *libc.TLS, pA uintptr, pB uintptr) int32 { /* sqlite3.c:193654:12: */
+func rtreeSearchPointCompare(tls *libc.TLS, pA uintptr, pB uintptr) int32 { /* sqlite3.c:195305:12: */
if (*RtreeSearchPoint)(unsafe.Pointer(pA)).FrScore < (*RtreeSearchPoint)(unsafe.Pointer(pB)).FrScore {
return -1
}
@@ -153736,7 +155952,7 @@ func rtreeSearchPointCompare(tls *libc.TLS, pA uintptr, pB uintptr) int32 { /* s
}
// Interchange two search points in a cursor.
-func rtreeSearchPointSwap(tls *libc.TLS, p uintptr, i int32, j int32) { /* sqlite3.c:193668:13: */
+func rtreeSearchPointSwap(tls *libc.TLS, p uintptr, i int32, j int32) { /* sqlite3.c:195319:13: */
var t = *(*RtreeSearchPoint)(unsafe.Pointer((*RtreeCursor)(unsafe.Pointer(p)).FaPoint + uintptr(i)*24))
*(*RtreeSearchPoint)(unsafe.Pointer((*RtreeCursor)(unsafe.Pointer(p)).FaPoint + uintptr(i)*24)) = *(*RtreeSearchPoint)(unsafe.Pointer((*RtreeCursor)(unsafe.Pointer(p)).FaPoint + uintptr(j)*24))
@@ -153745,20 +155961,20 @@ func rtreeSearchPointSwap(tls *libc.TLS, p uintptr, i int32, j int32) { /* sqlit
j++
if i < RTREE_CACHE_SZ {
if j >= RTREE_CACHE_SZ {
- nodeRelease(tls, (*RtreeCursor)(unsafe.Pointer((p))).Fbase.FpVtab, *(*uintptr)(unsafe.Pointer((p + 64 /* &.aNode */) + uintptr(i)*4)))
- *(*uintptr)(unsafe.Pointer((p + 64 /* &.aNode */) + uintptr(i)*4)) = uintptr(0)
+ nodeRelease(tls, (*RtreeCursor)(unsafe.Pointer(p)).Fbase.FpVtab, *(*uintptr)(unsafe.Pointer(p + 64 + uintptr(i)*4)))
+ *(*uintptr)(unsafe.Pointer(p + 64 + uintptr(i)*4)) = uintptr(0)
} else {
- var pTemp uintptr = *(*uintptr)(unsafe.Pointer((p + 64 /* &.aNode */) + uintptr(i)*4))
- *(*uintptr)(unsafe.Pointer((p + 64 /* &.aNode */) + uintptr(i)*4)) = *(*uintptr)(unsafe.Pointer((p + 64 /* &.aNode */) + uintptr(j)*4))
- *(*uintptr)(unsafe.Pointer((p + 64 /* &.aNode */) + uintptr(j)*4)) = pTemp
+ var pTemp uintptr = *(*uintptr)(unsafe.Pointer(p + 64 + uintptr(i)*4))
+ *(*uintptr)(unsafe.Pointer(p + 64 + uintptr(i)*4)) = *(*uintptr)(unsafe.Pointer(p + 64 + uintptr(j)*4))
+ *(*uintptr)(unsafe.Pointer(p + 64 + uintptr(j)*4)) = pTemp
}
}
}
// Return the search point with the lowest current score.
-func rtreeSearchPointFirst(tls *libc.TLS, pCur uintptr) uintptr { /* sqlite3.c:193689:25: */
+func rtreeSearchPointFirst(tls *libc.TLS, pCur uintptr) uintptr { /* sqlite3.c:195340:25: */
if (*RtreeCursor)(unsafe.Pointer(pCur)).FbPoint != 0 {
- return (pCur + 40 /* &.sPoint */)
+ return pCur + 40
}
if (*RtreeCursor)(unsafe.Pointer(pCur)).FnPoint != 0 {
return (*RtreeCursor)(unsafe.Pointer(pCur)).FaPoint
@@ -153767,30 +155983,30 @@ func rtreeSearchPointFirst(tls *libc.TLS, pCur uintptr) uintptr { /* sqlite3.c:1
}
// Get the RtreeNode for the search point with the lowest score.
-func rtreeNodeOfFirstSearchPoint(tls *libc.TLS, pCur uintptr, pRC uintptr) uintptr { /* sqlite3.c:193696:18: */
+func rtreeNodeOfFirstSearchPoint(tls *libc.TLS, pCur uintptr, pRC uintptr) uintptr { /* sqlite3.c:195347:18: */
var id Sqlite3_int64
- var ii int32 = (1 - int32((*RtreeCursor)(unsafe.Pointer(pCur)).FbPoint))
+ var ii int32 = 1 - int32((*RtreeCursor)(unsafe.Pointer(pCur)).FbPoint)
- if *(*uintptr)(unsafe.Pointer((pCur + 64 /* &.aNode */) + uintptr(ii)*4)) == uintptr(0) {
+ if *(*uintptr)(unsafe.Pointer(pCur + 64 + uintptr(ii)*4)) == uintptr(0) {
if ii != 0 {
id = (*RtreeSearchPoint)(unsafe.Pointer((*RtreeCursor)(unsafe.Pointer(pCur)).FaPoint)).Fid
} else {
id = (*RtreeCursor)(unsafe.Pointer(pCur)).FsPoint.Fid
}
- *(*int32)(unsafe.Pointer(pRC)) = nodeAcquire(tls, (*RtreeCursor)(unsafe.Pointer((pCur))).Fbase.FpVtab, id, uintptr(0), ((pCur + 64 /* &.aNode */) + uintptr(ii)*4))
+ *(*int32)(unsafe.Pointer(pRC)) = nodeAcquire(tls, (*RtreeCursor)(unsafe.Pointer(pCur)).Fbase.FpVtab, id, uintptr(0), pCur+64+uintptr(ii)*4)
}
- return *(*uintptr)(unsafe.Pointer((pCur + 64 /* &.aNode */) + uintptr(ii)*4))
+ return *(*uintptr)(unsafe.Pointer(pCur + 64 + uintptr(ii)*4))
}
// Push a new element onto the priority queue
-func rtreeEnqueue(tls *libc.TLS, pCur uintptr, rScore RtreeDValue, iLevel U8) uintptr { /* sqlite3.c:193712:25: */
+func rtreeEnqueue(tls *libc.TLS, pCur uintptr, rScore RtreeDValue, iLevel U8) uintptr { /* sqlite3.c:195363:25: */
var i int32
var j int32
var pNew uintptr
if (*RtreeCursor)(unsafe.Pointer(pCur)).FnPoint >= (*RtreeCursor)(unsafe.Pointer(pCur)).FnPointAlloc {
- var nNew int32 = (((*RtreeCursor)(unsafe.Pointer(pCur)).FnPointAlloc * 2) + 8)
- pNew = Xsqlite3_realloc64(tls, (*RtreeCursor)(unsafe.Pointer(pCur)).FaPoint, (uint64(uint32(nNew) * uint32(unsafe.Sizeof(RtreeSearchPoint{})))))
+ var nNew int32 = (*RtreeCursor)(unsafe.Pointer(pCur)).FnPointAlloc*2 + 8
+ pNew = Xsqlite3_realloc64(tls, (*RtreeCursor)(unsafe.Pointer(pCur)).FaPoint, uint64(uint32(nNew)*uint32(unsafe.Sizeof(RtreeSearchPoint{}))))
if pNew == uintptr(0) {
return uintptr(0)
}
@@ -153798,14 +156014,14 @@ func rtreeEnqueue(tls *libc.TLS, pCur uintptr, rScore RtreeDValue, iLevel U8) ui
(*RtreeCursor)(unsafe.Pointer(pCur)).FnPointAlloc = nNew
}
i = libc.PostIncInt32(&(*RtreeCursor)(unsafe.Pointer(pCur)).FnPoint, 1)
- pNew = ((*RtreeCursor)(unsafe.Pointer(pCur)).FaPoint + uintptr(i)*24)
+ pNew = (*RtreeCursor)(unsafe.Pointer(pCur)).FaPoint + uintptr(i)*24
(*RtreeSearchPoint)(unsafe.Pointer(pNew)).FrScore = rScore
(*RtreeSearchPoint)(unsafe.Pointer(pNew)).FiLevel = iLevel
for i > 0 {
var pParent uintptr
- j = ((i - 1) / 2)
- pParent = ((*RtreeCursor)(unsafe.Pointer(pCur)).FaPoint + uintptr(j)*24)
+ j = (i - 1) / 2
+ pParent = (*RtreeCursor)(unsafe.Pointer(pCur)).FaPoint + uintptr(j)*24
if rtreeSearchPointCompare(tls, pNew, pParent) >= 0 {
break
}
@@ -153818,34 +156034,35 @@ func rtreeEnqueue(tls *libc.TLS, pCur uintptr, rScore RtreeDValue, iLevel U8) ui
// Allocate a new RtreeSearchPoint and return a pointer to it. Return
// NULL if malloc fails.
-func rtreeSearchPointNew(tls *libc.TLS, pCur uintptr, rScore RtreeDValue, iLevel U8) uintptr { /* sqlite3.c:193747:25: */
+func rtreeSearchPointNew(tls *libc.TLS, pCur uintptr, rScore RtreeDValue, iLevel U8) uintptr { /* sqlite3.c:195398:25: */
var pNew uintptr
var pFirst uintptr
pFirst = rtreeSearchPointFirst(tls, pCur)
- *(*U32)(unsafe.Pointer((pCur + 84 /* &.anQueue */) + uintptr(iLevel)*4))++
- if ((pFirst == uintptr(0)) ||
- ((*RtreeSearchPoint)(unsafe.Pointer(pFirst)).FrScore > rScore)) ||
- (((*RtreeSearchPoint)(unsafe.Pointer(pFirst)).FrScore == rScore) && (int32((*RtreeSearchPoint)(unsafe.Pointer(pFirst)).FiLevel) > int32(iLevel))) {
+ *(*U32)(unsafe.Pointer(pCur + 84 + uintptr(iLevel)*4))++
+ if pFirst == uintptr(0) ||
+ (*RtreeSearchPoint)(unsafe.Pointer(pFirst)).FrScore > rScore ||
+ (*RtreeSearchPoint)(unsafe.Pointer(pFirst)).FrScore == rScore && int32((*RtreeSearchPoint)(unsafe.Pointer(pFirst)).FiLevel) > int32(iLevel) {
if (*RtreeCursor)(unsafe.Pointer(pCur)).FbPoint != 0 {
var ii int32
pNew = rtreeEnqueue(tls, pCur, rScore, iLevel)
if pNew == uintptr(0) {
return uintptr(0)
}
- ii = (((int32(pNew) - int32((*RtreeCursor)(unsafe.Pointer(pCur)).FaPoint)) / 24) + 1)
+ ii = (int32(pNew)-int32((*RtreeCursor)(unsafe.Pointer(pCur)).FaPoint))/24 + 1
+
if ii < RTREE_CACHE_SZ {
- *(*uintptr)(unsafe.Pointer((pCur + 64 /* &.aNode */) + uintptr(ii)*4)) = *(*uintptr)(unsafe.Pointer((pCur + 64 /* &.aNode */)))
+ *(*uintptr)(unsafe.Pointer(pCur + 64 + uintptr(ii)*4)) = *(*uintptr)(unsafe.Pointer(pCur + 64))
} else {
- nodeRelease(tls, (*RtreeCursor)(unsafe.Pointer((pCur))).Fbase.FpVtab, *(*uintptr)(unsafe.Pointer((pCur + 64 /* &.aNode */))))
+ nodeRelease(tls, (*RtreeCursor)(unsafe.Pointer(pCur)).Fbase.FpVtab, *(*uintptr)(unsafe.Pointer(pCur + 64)))
}
- *(*uintptr)(unsafe.Pointer((pCur + 64 /* &.aNode */))) = uintptr(0)
+ *(*uintptr)(unsafe.Pointer(pCur + 64)) = uintptr(0)
*(*RtreeSearchPoint)(unsafe.Pointer(pNew)) = (*RtreeCursor)(unsafe.Pointer(pCur)).FsPoint
}
(*RtreeCursor)(unsafe.Pointer(pCur)).FsPoint.FrScore = rScore
(*RtreeCursor)(unsafe.Pointer(pCur)).FsPoint.FiLevel = iLevel
(*RtreeCursor)(unsafe.Pointer(pCur)).FbPoint = U8(1)
- return (pCur + 40 /* &.sPoint */)
+ return pCur + 40
} else {
return rtreeEnqueue(tls, pCur, rScore, iLevel)
}
@@ -153853,40 +156070,40 @@ func rtreeSearchPointNew(tls *libc.TLS, pCur uintptr, rScore RtreeDValue, iLevel
}
// Remove the search point with the lowest current score.
-func rtreeSearchPointPop(tls *libc.TLS, p uintptr) { /* sqlite3.c:193814:13: */
+func rtreeSearchPointPop(tls *libc.TLS, p uintptr) { /* sqlite3.c:195466:13: */
var i int32
var j int32
var k int32
var n int32
- i = (1 - int32((*RtreeCursor)(unsafe.Pointer(p)).FbPoint))
+ i = 1 - int32((*RtreeCursor)(unsafe.Pointer(p)).FbPoint)
- if *(*uintptr)(unsafe.Pointer((p + 64 /* &.aNode */) + uintptr(i)*4)) != 0 {
- nodeRelease(tls, (*RtreeCursor)(unsafe.Pointer((p))).Fbase.FpVtab, *(*uintptr)(unsafe.Pointer((p + 64 /* &.aNode */) + uintptr(i)*4)))
- *(*uintptr)(unsafe.Pointer((p + 64 /* &.aNode */) + uintptr(i)*4)) = uintptr(0)
+ if *(*uintptr)(unsafe.Pointer(p + 64 + uintptr(i)*4)) != 0 {
+ nodeRelease(tls, (*RtreeCursor)(unsafe.Pointer(p)).Fbase.FpVtab, *(*uintptr)(unsafe.Pointer(p + 64 + uintptr(i)*4)))
+ *(*uintptr)(unsafe.Pointer(p + 64 + uintptr(i)*4)) = uintptr(0)
}
if (*RtreeCursor)(unsafe.Pointer(p)).FbPoint != 0 {
- *(*U32)(unsafe.Pointer((p + 84 /* &.anQueue */) + uintptr((*RtreeCursor)(unsafe.Pointer(p)).FsPoint.FiLevel)*4))--
+ *(*U32)(unsafe.Pointer(p + 84 + uintptr((*RtreeCursor)(unsafe.Pointer(p)).FsPoint.FiLevel)*4))--
(*RtreeCursor)(unsafe.Pointer(p)).FbPoint = U8(0)
} else if (*RtreeCursor)(unsafe.Pointer(p)).FnPoint != 0 {
- *(*U32)(unsafe.Pointer((p + 84 /* &.anQueue */) + uintptr((*RtreeSearchPoint)(unsafe.Pointer((*RtreeCursor)(unsafe.Pointer(p)).FaPoint)).FiLevel)*4))--
+ *(*U32)(unsafe.Pointer(p + 84 + uintptr((*RtreeSearchPoint)(unsafe.Pointer((*RtreeCursor)(unsafe.Pointer(p)).FaPoint)).FiLevel)*4))--
n = libc.PreDecInt32(&(*RtreeCursor)(unsafe.Pointer(p)).FnPoint, 1)
*(*RtreeSearchPoint)(unsafe.Pointer((*RtreeCursor)(unsafe.Pointer(p)).FaPoint)) = *(*RtreeSearchPoint)(unsafe.Pointer((*RtreeCursor)(unsafe.Pointer(p)).FaPoint + uintptr(n)*24))
- if n < (RTREE_CACHE_SZ - 1) {
- *(*uintptr)(unsafe.Pointer((p + 64 /* &.aNode */) + 1*4)) = *(*uintptr)(unsafe.Pointer((p + 64 /* &.aNode */) + uintptr((n+1))*4))
- *(*uintptr)(unsafe.Pointer((p + 64 /* &.aNode */) + uintptr((n+1))*4)) = uintptr(0)
+ if n < RTREE_CACHE_SZ-1 {
+ *(*uintptr)(unsafe.Pointer(p + 64 + 1*4)) = *(*uintptr)(unsafe.Pointer(p + 64 + uintptr(n+1)*4))
+ *(*uintptr)(unsafe.Pointer(p + 64 + uintptr(n+1)*4)) = uintptr(0)
}
i = 0
- for (libc.AssignInt32(&j, ((i * 2) + 1))) < n {
- k = (j + 1)
- if (k < n) && (rtreeSearchPointCompare(tls, ((*RtreeCursor)(unsafe.Pointer(p)).FaPoint+uintptr(k)*24), ((*RtreeCursor)(unsafe.Pointer(p)).FaPoint+uintptr(j)*24)) < 0) {
- if rtreeSearchPointCompare(tls, ((*RtreeCursor)(unsafe.Pointer(p)).FaPoint+uintptr(k)*24), ((*RtreeCursor)(unsafe.Pointer(p)).FaPoint+uintptr(i)*24)) < 0 {
+ for libc.AssignInt32(&j, i*2+1) < n {
+ k = j + 1
+ if k < n && rtreeSearchPointCompare(tls, (*RtreeCursor)(unsafe.Pointer(p)).FaPoint+uintptr(k)*24, (*RtreeCursor)(unsafe.Pointer(p)).FaPoint+uintptr(j)*24) < 0 {
+ if rtreeSearchPointCompare(tls, (*RtreeCursor)(unsafe.Pointer(p)).FaPoint+uintptr(k)*24, (*RtreeCursor)(unsafe.Pointer(p)).FaPoint+uintptr(i)*24) < 0 {
rtreeSearchPointSwap(tls, p, i, k)
i = k
} else {
break
}
} else {
- if rtreeSearchPointCompare(tls, ((*RtreeCursor)(unsafe.Pointer(p)).FaPoint+uintptr(j)*24), ((*RtreeCursor)(unsafe.Pointer(p)).FaPoint+uintptr(i)*24)) < 0 {
+ if rtreeSearchPointCompare(tls, (*RtreeCursor)(unsafe.Pointer(p)).FaPoint+uintptr(j)*24, (*RtreeCursor)(unsafe.Pointer(p)).FaPoint+uintptr(i)*24) < 0 {
rtreeSearchPointSwap(tls, p, i, j)
i = j
} else {
@@ -153901,12 +156118,12 @@ func rtreeSearchPointPop(tls *libc.TLS, p uintptr) { /* sqlite3.c:193814:13: */
// contains an entry suitable for returning as a result-set row,
// or until the RtreeSearchPoint queue is empty, indicating that the
// query has completed.
-func rtreeStepToLeaf(tls *libc.TLS, pCur uintptr) int32 { /* sqlite3.c:193862:12: */
+func rtreeStepToLeaf(tls *libc.TLS, pCur uintptr) int32 { /* sqlite3.c:195514:12: */
bp := tls.Alloc(20)
defer tls.Free(20)
var p uintptr
- var pRtree uintptr = (*RtreeCursor)(unsafe.Pointer((pCur))).Fbase.FpVtab
+ var pRtree uintptr = (*RtreeCursor)(unsafe.Pointer(pCur)).Fbase.FpVtab
var pNode uintptr
// var eWithin int32 at bp+16, 4
@@ -153917,25 +156134,25 @@ func rtreeStepToLeaf(tls *libc.TLS, pCur uintptr) int32 { /* sqlite3.c:193862:12
var eInt int32
var x RtreeSearchPoint
- eInt = (libc.Bool32(int32((*Rtree)(unsafe.Pointer(pRtree)).FeCoordType) == RTREE_COORD_INT32))
- for ((libc.AssignUintptr(&p, rtreeSearchPointFirst(tls, pCur))) != uintptr(0)) && (int32((*RtreeSearchPoint)(unsafe.Pointer(p)).FiLevel) > 0) {
+ eInt = libc.Bool32(int32((*Rtree)(unsafe.Pointer(pRtree)).FeCoordType) == RTREE_COORD_INT32)
+ for libc.AssignUintptr(&p, rtreeSearchPointFirst(tls, pCur)) != uintptr(0) && int32((*RtreeSearchPoint)(unsafe.Pointer(p)).FiLevel) > 0 {
var pCellData uintptr
pNode = rtreeNodeOfFirstSearchPoint(tls, pCur, bp /* &rc */)
- if *(*int32)(unsafe.Pointer(bp /* rc */)) != 0 {
+ if *(*int32)(unsafe.Pointer(bp)) != 0 {
return *(*int32)(unsafe.Pointer(bp /* rc */))
}
- nCell = readInt16(tls, ((*RtreeNode)(unsafe.Pointer((pNode))).FzData + 2))
+ nCell = readInt16(tls, (*RtreeNode)(unsafe.Pointer(pNode)).FzData+2)
- pCellData = ((*RtreeNode)(unsafe.Pointer(pNode)).FzData + uintptr((4 + (int32((*Rtree)(unsafe.Pointer(pRtree)).FnBytesPerCell) * int32((*RtreeSearchPoint)(unsafe.Pointer(p)).FiCell)))))
+ pCellData = (*RtreeNode)(unsafe.Pointer(pNode)).FzData + uintptr(4+int32((*Rtree)(unsafe.Pointer(pRtree)).FnBytesPerCell)*int32((*RtreeSearchPoint)(unsafe.Pointer(p)).FiCell))
for int32((*RtreeSearchPoint)(unsafe.Pointer(p)).FiCell) < nCell {
*(*Sqlite3_rtree_dbl)(unsafe.Pointer(bp + 8 /* rScore */)) = Sqlite3_rtree_dbl(-1)
*(*int32)(unsafe.Pointer(bp + 16 /* eWithin */)) = FULLY_WITHIN
for ii = 0; ii < nConstraint; ii++ {
- var pConstraint uintptr = ((*RtreeCursor)(unsafe.Pointer(pCur)).FaConstraint + uintptr(ii)*24)
+ var pConstraint uintptr = (*RtreeCursor)(unsafe.Pointer(pCur)).FaConstraint + uintptr(ii)*24
if (*RtreeConstraint)(unsafe.Pointer(pConstraint)).Fop >= RTREE_MATCH {
*(*int32)(unsafe.Pointer(bp /* rc */)) = rtreeCallbackConstraint(tls, pConstraint, eInt, pCellData, p,
bp+8 /* &rScore */, bp+16 /* &eWithin */)
- if *(*int32)(unsafe.Pointer(bp /* rc */)) != 0 {
+ if *(*int32)(unsafe.Pointer(bp)) != 0 {
return *(*int32)(unsafe.Pointer(bp /* rc */))
}
} else if int32((*RtreeSearchPoint)(unsafe.Pointer(p)).FiLevel) == 1 {
@@ -153943,35 +156160,35 @@ func rtreeStepToLeaf(tls *libc.TLS, pCur uintptr) int32 { /* sqlite3.c:193862:12
} else {
rtreeNonleafConstraint(tls, pConstraint, eInt, pCellData, bp+16 /* &eWithin */)
}
- if *(*int32)(unsafe.Pointer(bp + 16 /* eWithin */)) == NOT_WITHIN {
+ if *(*int32)(unsafe.Pointer(bp + 16)) == NOT_WITHIN {
(*RtreeSearchPoint)(unsafe.Pointer(p)).FiCell++
pCellData += uintptr((*Rtree)(unsafe.Pointer(pRtree)).FnBytesPerCell)
break
}
}
- if *(*int32)(unsafe.Pointer(bp + 16 /* eWithin */)) == NOT_WITHIN {
+ if *(*int32)(unsafe.Pointer(bp + 16)) == NOT_WITHIN {
continue
}
(*RtreeSearchPoint)(unsafe.Pointer(p)).FiCell++
- x.FiLevel = (U8(int32((*RtreeSearchPoint)(unsafe.Pointer(p)).FiLevel) - 1))
+ x.FiLevel = U8(int32((*RtreeSearchPoint)(unsafe.Pointer(p)).FiLevel) - 1)
if x.FiLevel != 0 {
x.Fid = readInt64(tls, pCellData)
for ii = 0; ii < (*RtreeCursor)(unsafe.Pointer(pCur)).FnPoint; ii++ {
if (*RtreeSearchPoint)(unsafe.Pointer((*RtreeCursor)(unsafe.Pointer(pCur)).FaPoint+uintptr(ii)*24)).Fid == x.Fid {
- return (SQLITE_CORRUPT | (int32(1) << 8))
+ return SQLITE_CORRUPT | int32(1)<<8
}
}
x.FiCell = U8(0)
} else {
x.Fid = (*RtreeSearchPoint)(unsafe.Pointer(p)).Fid
- x.FiCell = (U8(int32((*RtreeSearchPoint)(unsafe.Pointer(p)).FiCell) - 1))
+ x.FiCell = U8(int32((*RtreeSearchPoint)(unsafe.Pointer(p)).FiCell) - 1)
}
if int32((*RtreeSearchPoint)(unsafe.Pointer(p)).FiCell) >= nCell {
rtreeSearchPointPop(tls, pCur)
}
- if *(*Sqlite3_rtree_dbl)(unsafe.Pointer(bp + 8 /* rScore */)) < 0.0 {
+ if *(*Sqlite3_rtree_dbl)(unsafe.Pointer(bp + 8)) < 0.0 {
*(*Sqlite3_rtree_dbl)(unsafe.Pointer(bp + 8 /* rScore */)) = 0.0
}
p = rtreeSearchPointNew(tls, pCur, *(*Sqlite3_rtree_dbl)(unsafe.Pointer(bp + 8 /* rScore */)), x.FiLevel)
@@ -153989,12 +156206,12 @@ func rtreeStepToLeaf(tls *libc.TLS, pCur uintptr) int32 { /* sqlite3.c:193862:12
rtreeSearchPointPop(tls, pCur)
}
}
- (*RtreeCursor)(unsafe.Pointer(pCur)).FatEOF = (U8(libc.Bool32(p == uintptr(0))))
+ (*RtreeCursor)(unsafe.Pointer(pCur)).FatEOF = U8(libc.Bool32(p == uintptr(0)))
return SQLITE_OK
}
// Rtree virtual table module xNext method.
-func rtreeNext(tls *libc.TLS, pVtabCursor uintptr) int32 { /* sqlite3.c:193943:12: */
+func rtreeNext(tls *libc.TLS, pVtabCursor uintptr) int32 { /* sqlite3.c:195595:12: */
var pCsr uintptr = pVtabCursor
var rc int32 = SQLITE_OK
@@ -154010,7 +156227,7 @@ func rtreeNext(tls *libc.TLS, pVtabCursor uintptr) int32 { /* sqlite3.c:193943:1
}
// Rtree virtual table module xRowid method.
-func rtreeRowid(tls *libc.TLS, pVtabCursor uintptr, pRowid uintptr) int32 { /* sqlite3.c:193961:12: */
+func rtreeRowid(tls *libc.TLS, pVtabCursor uintptr, pRowid uintptr) int32 { /* sqlite3.c:195613:12: */
bp := tls.Alloc(4)
defer tls.Free(4)
@@ -154018,14 +156235,14 @@ func rtreeRowid(tls *libc.TLS, pVtabCursor uintptr, pRowid uintptr) int32 { /* s
var p uintptr = rtreeSearchPointFirst(tls, pCsr)
*(*int32)(unsafe.Pointer(bp /* rc */)) = SQLITE_OK
var pNode uintptr = rtreeNodeOfFirstSearchPoint(tls, pCsr, bp /* &rc */)
- if (*(*int32)(unsafe.Pointer(bp /* rc */)) == SQLITE_OK) && (p != 0) {
- *(*Sqlite_int64)(unsafe.Pointer(pRowid)) = nodeGetRowid(tls, (*RtreeCursor)(unsafe.Pointer((pCsr))).Fbase.FpVtab, pNode, int32((*RtreeSearchPoint)(unsafe.Pointer(p)).FiCell))
+ if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK && p != 0 {
+ *(*Sqlite_int64)(unsafe.Pointer(pRowid)) = nodeGetRowid(tls, (*RtreeCursor)(unsafe.Pointer(pCsr)).Fbase.FpVtab, pNode, int32((*RtreeSearchPoint)(unsafe.Pointer(p)).FiCell))
}
return *(*int32)(unsafe.Pointer(bp /* rc */))
}
// Rtree virtual table module xColumn method.
-func rtreeColumn(tls *libc.TLS, cur uintptr, ctx uintptr, i int32) int32 { /* sqlite3.c:193975:12: */
+func rtreeColumn(tls *libc.TLS, cur uintptr, ctx uintptr, i int32) int32 { /* sqlite3.c:195627:12: */
bp := tls.Alloc(8)
defer tls.Free(8)
@@ -154037,7 +156254,7 @@ func rtreeColumn(tls *libc.TLS, cur uintptr, ctx uintptr, i int32) int32 { /* sq
*(*int32)(unsafe.Pointer(bp /* rc */)) = SQLITE_OK
var pNode uintptr = rtreeNodeOfFirstSearchPoint(tls, pCsr, bp /* &rc */)
- if *(*int32)(unsafe.Pointer(bp /* rc */)) != 0 {
+ if *(*int32)(unsafe.Pointer(bp)) != 0 {
return *(*int32)(unsafe.Pointer(bp /* rc */))
}
if p == uintptr(0) {
@@ -154046,7 +156263,7 @@ func rtreeColumn(tls *libc.TLS, cur uintptr, ctx uintptr, i int32) int32 { /* sq
if i == 0 {
Xsqlite3_result_int64(tls, ctx, nodeGetRowid(tls, pRtree, pNode, int32((*RtreeSearchPoint)(unsafe.Pointer(p)).FiCell)))
} else if i <= int32((*Rtree)(unsafe.Pointer(pRtree)).FnDim2) {
- nodeGetCoord(tls, pRtree, pNode, int32((*RtreeSearchPoint)(unsafe.Pointer(p)).FiCell), (i - 1), bp+4 /* &c */)
+ nodeGetCoord(tls, pRtree, pNode, int32((*RtreeSearchPoint)(unsafe.Pointer(p)).FiCell), i-1, bp+4 /* &c */)
if int32((*Rtree)(unsafe.Pointer(pRtree)).FeCoordType) == RTREE_COORD_REAL32 {
Xsqlite3_result_double(tls, ctx, float64(*(*RtreeValue)(unsafe.Pointer(bp + 4 /* &c */))))
} else {
@@ -154057,26 +156274,26 @@ func rtreeColumn(tls *libc.TLS, cur uintptr, ctx uintptr, i int32) int32 { /* sq
if !(int32((*RtreeCursor)(unsafe.Pointer(pCsr)).FbAuxValid) != 0) {
if (*RtreeCursor)(unsafe.Pointer(pCsr)).FpReadAux == uintptr(0) {
*(*int32)(unsafe.Pointer(bp /* rc */)) = Xsqlite3_prepare_v3(tls, (*Rtree)(unsafe.Pointer(pRtree)).Fdb, (*Rtree)(unsafe.Pointer(pRtree)).FzReadAuxSql, -1, uint32(0),
- (pCsr + 36 /* &.pReadAux */), uintptr(0))
- if *(*int32)(unsafe.Pointer(bp /* rc */)) != 0 {
+ pCsr+36, uintptr(0))
+ if *(*int32)(unsafe.Pointer(bp)) != 0 {
return *(*int32)(unsafe.Pointer(bp /* rc */))
}
}
Xsqlite3_bind_int64(tls, (*RtreeCursor)(unsafe.Pointer(pCsr)).FpReadAux, 1,
nodeGetRowid(tls, pRtree, pNode, int32((*RtreeSearchPoint)(unsafe.Pointer(p)).FiCell)))
*(*int32)(unsafe.Pointer(bp /* rc */)) = Xsqlite3_step(tls, (*RtreeCursor)(unsafe.Pointer(pCsr)).FpReadAux)
- if *(*int32)(unsafe.Pointer(bp /* rc */)) == SQLITE_ROW {
+ if *(*int32)(unsafe.Pointer(bp)) == SQLITE_ROW {
(*RtreeCursor)(unsafe.Pointer(pCsr)).FbAuxValid = U8(1)
} else {
Xsqlite3_reset(tls, (*RtreeCursor)(unsafe.Pointer(pCsr)).FpReadAux)
- if *(*int32)(unsafe.Pointer(bp /* rc */)) == SQLITE_DONE {
+ if *(*int32)(unsafe.Pointer(bp)) == SQLITE_DONE {
*(*int32)(unsafe.Pointer(bp /* rc */)) = SQLITE_OK
}
return *(*int32)(unsafe.Pointer(bp /* rc */))
}
}
Xsqlite3_result_value(tls, ctx,
- Xsqlite3_column_value(tls, (*RtreeCursor)(unsafe.Pointer(pCsr)).FpReadAux, ((i-int32((*Rtree)(unsafe.Pointer(pRtree)).FnDim2))+1)))
+ Xsqlite3_column_value(tls, (*RtreeCursor)(unsafe.Pointer(pCsr)).FpReadAux, i-int32((*Rtree)(unsafe.Pointer(pRtree)).FnDim2)+1))
}
return SQLITE_OK
}
@@ -154086,7 +156303,7 @@ func rtreeColumn(tls *libc.TLS, cur uintptr, ctx uintptr, i int32) int32 { /* sq
// return SQLITE_OK. If there is no such record in the table, set
// *ppLeaf to 0 and return SQLITE_OK. If an error occurs, set *ppLeaf
// to zero and return an SQLite error code.
-func findLeafNode(tls *libc.TLS, pRtree uintptr, iRowid I64, ppLeaf uintptr, piNode uintptr) int32 { /* sqlite3.c:194029:12: */
+func findLeafNode(tls *libc.TLS, pRtree uintptr, iRowid I64, ppLeaf uintptr, piNode uintptr) int32 { /* sqlite3.c:195681:12: */
var rc int32
*(*uintptr)(unsafe.Pointer(ppLeaf)) = uintptr(0)
Xsqlite3_bind_int64(tls, (*Rtree)(unsafe.Pointer(pRtree)).FpReadRowid, 1, iRowid)
@@ -154107,21 +156324,21 @@ func findLeafNode(tls *libc.TLS, pRtree uintptr, iRowid I64, ppLeaf uintptr, piN
// as the second argument for a MATCH constraint. The value passed as the
// first argument to this function is the right-hand operand to the MATCH
// operator.
-func deserializeGeometry(tls *libc.TLS, pValue uintptr, pCons uintptr) int32 { /* sqlite3.c:194055:12: */
+func deserializeGeometry(tls *libc.TLS, pValue uintptr, pCons uintptr) int32 { /* sqlite3.c:195707:12: */
var pBlob uintptr
var pSrc uintptr // BLOB returned by geometry function
var pInfo uintptr // Callback information
- pSrc = Xsqlite3_value_pointer(tls, pValue, ts+23403 /* "RtreeMatchArg" */)
+ pSrc = Xsqlite3_value_pointer(tls, pValue, ts+24700 /* "RtreeMatchArg" */)
if pSrc == uintptr(0) {
return SQLITE_ERROR
}
- pInfo = Xsqlite3_malloc64(tls, (uint64(uint32(unsafe.Sizeof(Sqlite3_rtree_query_info{})) + (*RtreeMatchArg)(unsafe.Pointer(pSrc)).FiSize)))
+ pInfo = Xsqlite3_malloc64(tls, uint64(uint32(unsafe.Sizeof(Sqlite3_rtree_query_info{}))+(*RtreeMatchArg)(unsafe.Pointer(pSrc)).FiSize))
if !(pInfo != 0) {
return SQLITE_NOMEM
}
libc.Xmemset(tls, pInfo, 0, uint32(unsafe.Sizeof(Sqlite3_rtree_query_info{})))
- pBlob = (pInfo + 1*80)
+ pBlob = pInfo + 1*80
libc.Xmemcpy(tls, pBlob, pSrc, (*RtreeMatchArg)(unsafe.Pointer(pSrc)).FiSize)
(*Sqlite3_rtree_query_info)(unsafe.Pointer(pInfo)).FpContext = (*RtreeMatchArg)(unsafe.Pointer(pBlob)).Fcb.FpContext
(*Sqlite3_rtree_query_info)(unsafe.Pointer(pInfo)).FnParam = (*RtreeMatchArg)(unsafe.Pointer(pBlob)).FnParam
@@ -154129,17 +156346,17 @@ func deserializeGeometry(tls *libc.TLS, pValue uintptr, pCons uintptr) int32 { /
(*Sqlite3_rtree_query_info)(unsafe.Pointer(pInfo)).FapSqlParam = (*RtreeMatchArg)(unsafe.Pointer(pBlob)).FapSqlParam
if (*RtreeMatchArg)(unsafe.Pointer(pBlob)).Fcb.FxGeom != 0 {
- *(*uintptr)(unsafe.Pointer(pCons + 8 /* &.u */)) = (*RtreeMatchArg)(unsafe.Pointer(pBlob)).Fcb.FxGeom
+ *(*uintptr)(unsafe.Pointer(pCons + 8)) = (*RtreeMatchArg)(unsafe.Pointer(pBlob)).Fcb.FxGeom
} else {
(*RtreeConstraint)(unsafe.Pointer(pCons)).Fop = RTREE_QUERY
- *(*uintptr)(unsafe.Pointer(pCons + 8 /* &.u */)) = (*RtreeMatchArg)(unsafe.Pointer(pBlob)).Fcb.FxQueryFunc
+ *(*uintptr)(unsafe.Pointer(pCons + 8)) = (*RtreeMatchArg)(unsafe.Pointer(pBlob)).Fcb.FxQueryFunc
}
(*RtreeConstraint)(unsafe.Pointer(pCons)).FpInfo = pInfo
return SQLITE_OK
}
// Rtree virtual table module xFilter method.
-func rtreeFilter(tls *libc.TLS, pVtabCursor uintptr, idxNum int32, idxStr uintptr, argc int32, argv uintptr) int32 { /* sqlite3.c:194085:12: */
+func rtreeFilter(tls *libc.TLS, pVtabCursor uintptr, idxNum int32, idxStr uintptr, argc int32, argv uintptr) int32 { /* sqlite3.c:195737:12: */
bp := tls.Alloc(24)
defer tls.Free(24)
@@ -154164,17 +156381,17 @@ func rtreeFilter(tls *libc.TLS, pVtabCursor uintptr, idxNum int32, idxStr uintpt
var iRowid I64 = Xsqlite3_value_int64(tls, *(*uintptr)(unsafe.Pointer(argv)))
*(*I64)(unsafe.Pointer(bp + 8 /* iNode */)) = int64(0)
var eType int32 = Xsqlite3_value_numeric_type(tls, *(*uintptr)(unsafe.Pointer(argv)))
- if (eType == SQLITE_INTEGER) ||
- ((eType == SQLITE_FLOAT) && (Xsqlite3_value_double(tls, *(*uintptr)(unsafe.Pointer(argv))) == float64(iRowid))) {
+ if eType == SQLITE_INTEGER ||
+ eType == SQLITE_FLOAT && Xsqlite3_value_double(tls, *(*uintptr)(unsafe.Pointer(argv))) == float64(iRowid) {
rc = findLeafNode(tls, pRtree, iRowid, bp /* &pLeaf */, bp+8 /* &iNode */)
} else {
rc = SQLITE_OK
*(*uintptr)(unsafe.Pointer(bp /* pLeaf */)) = uintptr(0)
}
- if (rc == SQLITE_OK) && (*(*uintptr)(unsafe.Pointer(bp /* pLeaf */)) != uintptr(0)) {
+ if rc == SQLITE_OK && *(*uintptr)(unsafe.Pointer(bp)) != uintptr(0) {
p = rtreeSearchPointNew(tls, pCsr, 0.0, uint8(0))
// Always returns pCsr->sPoint
- *(*uintptr)(unsafe.Pointer((pCsr + 64 /* &.aNode */))) = *(*uintptr)(unsafe.Pointer(bp /* pLeaf */))
+ *(*uintptr)(unsafe.Pointer(pCsr + 64)) = *(*uintptr)(unsafe.Pointer(bp /* pLeaf */))
(*RtreeSearchPoint)(unsafe.Pointer(p)).Fid = *(*I64)(unsafe.Pointer(bp + 8 /* iNode */))
(*RtreeSearchPoint)(unsafe.Pointer(p)).FeWithin = U8(PARTLY_WITHIN)
rc = nodeRowidIndex(tls, pRtree, *(*uintptr)(unsafe.Pointer(bp /* pLeaf */)), iRowid, bp+16 /* &iCell */)
@@ -154187,20 +156404,20 @@ func rtreeFilter(tls *libc.TLS, pVtabCursor uintptr, idxNum int32, idxStr uintpt
// Normal case - r-tree scan. Set up the RtreeCursor.aConstraint array
// with the configured constraints.
rc = nodeAcquire(tls, pRtree, int64(1), uintptr(0), bp+20 /* &pRoot */)
- if (rc == SQLITE_OK) && (argc > 0) {
- (*RtreeCursor)(unsafe.Pointer(pCsr)).FaConstraint = Xsqlite3_malloc64(tls, (uint64(uint32(unsafe.Sizeof(RtreeConstraint{})) * uint32(argc))))
+ if rc == SQLITE_OK && argc > 0 {
+ (*RtreeCursor)(unsafe.Pointer(pCsr)).FaConstraint = Xsqlite3_malloc64(tls, uint64(uint32(unsafe.Sizeof(RtreeConstraint{}))*uint32(argc)))
(*RtreeCursor)(unsafe.Pointer(pCsr)).FnConstraint = argc
if !(int32((*RtreeCursor)(unsafe.Pointer(pCsr)).FaConstraint) != 0) {
rc = SQLITE_NOMEM
} else {
- libc.Xmemset(tls, (*RtreeCursor)(unsafe.Pointer(pCsr)).FaConstraint, 0, (uint32(unsafe.Sizeof(RtreeConstraint{})) * uint32(argc)))
- libc.Xmemset(tls, pCsr+84 /* &.anQueue */, 0, (uint32(unsafe.Sizeof(U32(0))) * (uint32((*Rtree)(unsafe.Pointer(pRtree)).FiDepth + 1))))
+ libc.Xmemset(tls, (*RtreeCursor)(unsafe.Pointer(pCsr)).FaConstraint, 0, uint32(unsafe.Sizeof(RtreeConstraint{}))*uint32(argc))
+ libc.Xmemset(tls, pCsr+84, 0, uint32(unsafe.Sizeof(U32(0)))*uint32((*Rtree)(unsafe.Pointer(pRtree)).FiDepth+1))
for ii = 0; ii < argc; ii++ {
- var p uintptr = ((*RtreeCursor)(unsafe.Pointer(pCsr)).FaConstraint + uintptr(ii)*24)
+ var p uintptr = (*RtreeCursor)(unsafe.Pointer(pCsr)).FaConstraint + uintptr(ii)*24
var eType int32 = Xsqlite3_value_numeric_type(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(ii)*4)))
- (*RtreeConstraint)(unsafe.Pointer(p)).Fop = int32(*(*uint8)(unsafe.Pointer(idxStr + uintptr((ii * 2)))))
- (*RtreeConstraint)(unsafe.Pointer(p)).FiCoord = (int32(*(*uint8)(unsafe.Pointer(idxStr + uintptr(((ii * 2) + 1))))) - '0')
+ (*RtreeConstraint)(unsafe.Pointer(p)).Fop = int32(*(*uint8)(unsafe.Pointer(idxStr + uintptr(ii*2))))
+ (*RtreeConstraint)(unsafe.Pointer(p)).FiCoord = int32(*(*uint8)(unsafe.Pointer(idxStr + uintptr(ii*2+1)))) - '0'
if (*RtreeConstraint)(unsafe.Pointer(p)).Fop >= RTREE_MATCH {
// A MATCH operator. The right-hand-side must be a blob that
// can be cast into an RtreeMatchArg object. One created using
@@ -154211,14 +156428,14 @@ func rtreeFilter(tls *libc.TLS, pVtabCursor uintptr, idxNum int32, idxStr uintpt
}
(*Sqlite3_rtree_query_info)(unsafe.Pointer((*RtreeConstraint)(unsafe.Pointer(p)).FpInfo)).FnCoord = int32((*Rtree)(unsafe.Pointer(pRtree)).FnDim2)
(*Sqlite3_rtree_query_info)(unsafe.Pointer((*RtreeConstraint)(unsafe.Pointer(p)).FpInfo)).FanQueue = pCsr + 84 /* &.anQueue */
- (*Sqlite3_rtree_query_info)(unsafe.Pointer((*RtreeConstraint)(unsafe.Pointer(p)).FpInfo)).FmxLevel = ((*Rtree)(unsafe.Pointer(pRtree)).FiDepth + 1)
- } else if (eType == SQLITE_INTEGER) || (eType == SQLITE_FLOAT) {
- *(*RtreeDValue)(unsafe.Pointer(p + 8 /* &.u */)) = Xsqlite3_value_double(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(ii)*4)))
+ (*Sqlite3_rtree_query_info)(unsafe.Pointer((*RtreeConstraint)(unsafe.Pointer(p)).FpInfo)).FmxLevel = (*Rtree)(unsafe.Pointer(pRtree)).FiDepth + 1
+ } else if eType == SQLITE_INTEGER || eType == SQLITE_FLOAT {
+ *(*RtreeDValue)(unsafe.Pointer(p + 8)) = Xsqlite3_value_double(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(ii)*4)))
} else {
- *(*RtreeDValue)(unsafe.Pointer(p + 8 /* &.u */)) = 0.0
+ *(*RtreeDValue)(unsafe.Pointer(p + 8)) = 0.0
if eType == SQLITE_NULL {
(*RtreeConstraint)(unsafe.Pointer(p)).Fop = RTREE_FALSE
- } else if ((*RtreeConstraint)(unsafe.Pointer(p)).Fop == RTREE_LT) || ((*RtreeConstraint)(unsafe.Pointer(p)).Fop == RTREE_LE) {
+ } else if (*RtreeConstraint)(unsafe.Pointer(p)).Fop == RTREE_LT || (*RtreeConstraint)(unsafe.Pointer(p)).Fop == RTREE_LE {
(*RtreeConstraint)(unsafe.Pointer(p)).Fop = RTREE_TRUE
} else {
(*RtreeConstraint)(unsafe.Pointer(p)).Fop = RTREE_FALSE
@@ -154229,15 +156446,16 @@ func rtreeFilter(tls *libc.TLS, pVtabCursor uintptr, idxNum int32, idxStr uintpt
}
if rc == SQLITE_OK {
var pNew uintptr
- pNew = rtreeSearchPointNew(tls, pCsr, 0.0, (U8((*Rtree)(unsafe.Pointer(pRtree)).FiDepth + 1)))
- if pNew == uintptr(0) {
+ // Due to the resetCursor() call above
+ pNew = rtreeSearchPointNew(tls, pCsr, 0.0, U8((*Rtree)(unsafe.Pointer(pRtree)).FiDepth+1))
+ if pNew == uintptr(0) { // Because pCsr->bPoint was FALSE
return SQLITE_NOMEM
}
(*RtreeSearchPoint)(unsafe.Pointer(pNew)).Fid = int64(1)
(*RtreeSearchPoint)(unsafe.Pointer(pNew)).FiCell = U8(0)
(*RtreeSearchPoint)(unsafe.Pointer(pNew)).FeWithin = U8(PARTLY_WITHIN)
- *(*uintptr)(unsafe.Pointer((pCsr + 64 /* &.aNode */))) = *(*uintptr)(unsafe.Pointer(bp + 20 /* pRoot */))
+ *(*uintptr)(unsafe.Pointer(pCsr + 64)) = *(*uintptr)(unsafe.Pointer(bp + 20 /* pRoot */))
*(*uintptr)(unsafe.Pointer(bp + 20 /* pRoot */)) = uintptr(0)
rc = rtreeStepToLeaf(tls, pCsr)
@@ -154281,7 +156499,7 @@ func rtreeFilter(tls *libc.TLS, pVtabCursor uintptr, idxNum int32, idxStr uintpt
// The second of each pair of bytes identifies the coordinate column
// to which the constraint applies. The leftmost coordinate column
// is 'a', the second from the left 'b' etc.
-func rtreeBestIndex(tls *libc.TLS, tab uintptr, pIdxInfo uintptr) int32 { /* sqlite3.c:194235:12: */
+func rtreeBestIndex(tls *libc.TLS, tab uintptr, pIdxInfo uintptr) int32 { /* sqlite3.c:195890:12: */
bp := tls.Alloc(49)
defer tls.Free(49)
@@ -154306,11 +156524,11 @@ func rtreeBestIndex(tls *libc.TLS, tab uintptr, pIdxInfo uintptr) int32 { /* sql
}
}
- for ii = 0; (ii < (*Sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FnConstraint) && (iIdx < (int32(uint32(unsafe.Sizeof([41]uint8{})) - uint32(1)))); ii++ {
- var p uintptr = ((*Sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FaConstraint + uintptr(ii)*12)
+ for ii = 0; ii < (*Sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FnConstraint && iIdx < int32(uint32(unsafe.Sizeof([41]uint8{}))-uint32(1)); ii++ {
+ var p uintptr = (*Sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FaConstraint + uintptr(ii)*12
- if (((bMatch == 0) && ((*sqlite3_index_constraint)(unsafe.Pointer(p)).Fusable != 0)) &&
- ((*sqlite3_index_constraint)(unsafe.Pointer(p)).FiColumn == 0)) && (int32((*sqlite3_index_constraint)(unsafe.Pointer(p)).Fop) == SQLITE_INDEX_CONSTRAINT_EQ) {
+ if bMatch == 0 && (*sqlite3_index_constraint)(unsafe.Pointer(p)).Fusable != 0 &&
+ (*sqlite3_index_constraint)(unsafe.Pointer(p)).FiColumn <= 0 && int32((*sqlite3_index_constraint)(unsafe.Pointer(p)).Fop) == SQLITE_INDEX_CONSTRAINT_EQ {
// We have an equality constraint on the rowid. Use strategy 1.
var jj int32
for jj = 0; jj < ii; jj++ {
@@ -154332,9 +156550,9 @@ func rtreeBestIndex(tls *libc.TLS, tab uintptr, pIdxInfo uintptr) int32 { /* sql
return SQLITE_OK
}
- if ((*sqlite3_index_constraint)(unsafe.Pointer(p)).Fusable != 0) &&
- ((((*sqlite3_index_constraint)(unsafe.Pointer(p)).FiColumn > 0) && ((*sqlite3_index_constraint)(unsafe.Pointer(p)).FiColumn <= int32((*Rtree)(unsafe.Pointer(pRtree)).FnDim2))) ||
- (int32((*sqlite3_index_constraint)(unsafe.Pointer(p)).Fop) == SQLITE_INDEX_CONSTRAINT_MATCH)) {
+ if (*sqlite3_index_constraint)(unsafe.Pointer(p)).Fusable != 0 &&
+ ((*sqlite3_index_constraint)(unsafe.Pointer(p)).FiColumn > 0 && (*sqlite3_index_constraint)(unsafe.Pointer(p)).FiColumn <= int32((*Rtree)(unsafe.Pointer(pRtree)).FnDim2) ||
+ int32((*sqlite3_index_constraint)(unsafe.Pointer(p)).Fop) == SQLITE_INDEX_CONSTRAINT_MATCH) {
var op U8
switch int32((*sqlite3_index_constraint)(unsafe.Pointer(p)).Fop) {
case SQLITE_INDEX_CONSTRAINT_EQ:
@@ -154367,8 +156585,8 @@ func rtreeBestIndex(tls *libc.TLS, tab uintptr, pIdxInfo uintptr) int32 { /* sql
}
if op != 0 {
*(*uint8)(unsafe.Pointer(bp + 8 /* &zIdxStr[0] */ + uintptr(libc.PostIncInt32(&iIdx, 1)))) = uint8(op)
- *(*uint8)(unsafe.Pointer(bp + 8 /* &zIdxStr[0] */ + uintptr(libc.PostIncInt32(&iIdx, 1)))) = (uint8(((*sqlite3_index_constraint)(unsafe.Pointer(p)).FiColumn - 1) + '0'))
- (*sqlite3_index_constraint_usage)(unsafe.Pointer((*Sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FaConstraintUsage + uintptr(ii)*8)).FargvIndex = (iIdx / 2)
+ *(*uint8)(unsafe.Pointer(bp + 8 /* &zIdxStr[0] */ + uintptr(libc.PostIncInt32(&iIdx, 1)))) = uint8((*sqlite3_index_constraint)(unsafe.Pointer(p)).FiColumn - 1 + '0')
+ (*sqlite3_index_constraint_usage)(unsafe.Pointer((*Sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FaConstraintUsage + uintptr(ii)*8)).FargvIndex = iIdx / 2
(*sqlite3_index_constraint_usage)(unsafe.Pointer((*Sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FaConstraintUsage + uintptr(ii)*8)).Fomit = uint8(1)
}
}
@@ -154376,54 +156594,54 @@ func rtreeBestIndex(tls *libc.TLS, tab uintptr, pIdxInfo uintptr) int32 { /* sql
(*Sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FidxNum = 2
(*Sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FneedToFreeIdxStr = 1
- if (iIdx > 0) && (uintptr(0) == (libc.AssignPtrUintptr(pIdxInfo+24 /* &.idxStr */, Xsqlite3_mprintf(tls, ts+2790 /* "%s" */, libc.VaList(bp, bp+8 /* &zIdxStr[0] */))))) {
+ if iIdx > 0 && uintptr(0) == libc.AssignPtrUintptr(pIdxInfo+24, Xsqlite3_mprintf(tls, ts+3601, libc.VaList(bp, bp+8))) {
return SQLITE_NOMEM
}
- nRow = ((*Rtree)(unsafe.Pointer(pRtree)).FnRowEst >> (iIdx / 2))
- (*Sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FestimatedCost = (6.0 * float64(nRow))
+ nRow = (*Rtree)(unsafe.Pointer(pRtree)).FnRowEst >> (iIdx / 2)
+ (*Sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FestimatedCost = 6.0 * float64(nRow)
(*Sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FestimatedRows = nRow
return rc
}
// Return the N-dimensional volumn of the cell stored in *p.
-func cellArea(tls *libc.TLS, pRtree uintptr, p uintptr) RtreeDValue { /* sqlite3.c:194324:20: */
+func cellArea(tls *libc.TLS, pRtree uintptr, p uintptr) RtreeDValue { /* sqlite3.c:195979:20: */
var area RtreeDValue = RtreeDValue(1)
if int32((*Rtree)(unsafe.Pointer(pRtree)).FeCoordType) == RTREE_COORD_REAL32 {
switch int32((*Rtree)(unsafe.Pointer(pRtree)).FnDim) {
case 5:
- area = (RtreeDValue(*(*RtreeValue)(unsafe.Pointer((p + 8 /* &.aCoord */) + 9*4)) - *(*RtreeValue)(unsafe.Pointer((p + 8 /* &.aCoord */) + 8*4))))
+ area = RtreeDValue(*(*RtreeValue)(unsafe.Pointer(p + 8 + 9*4)) - *(*RtreeValue)(unsafe.Pointer(p + 8 + 8*4)))
fallthrough
case 4:
- area = area * (float64(*(*RtreeValue)(unsafe.Pointer((p + 8 /* &.aCoord */) + 7*4)) - *(*RtreeValue)(unsafe.Pointer((p + 8 /* &.aCoord */) + 6*4))))
+ area = area * float64(*(*RtreeValue)(unsafe.Pointer(p + 8 + 7*4))-*(*RtreeValue)(unsafe.Pointer(p + 8 + 6*4)))
fallthrough
case 3:
- area = area * (float64(*(*RtreeValue)(unsafe.Pointer((p + 8 /* &.aCoord */) + 5*4)) - *(*RtreeValue)(unsafe.Pointer((p + 8 /* &.aCoord */) + 4*4))))
+ area = area * float64(*(*RtreeValue)(unsafe.Pointer(p + 8 + 5*4))-*(*RtreeValue)(unsafe.Pointer(p + 8 + 4*4)))
fallthrough
case 2:
- area = area * (float64(*(*RtreeValue)(unsafe.Pointer((p + 8 /* &.aCoord */) + 3*4)) - *(*RtreeValue)(unsafe.Pointer((p + 8 /* &.aCoord */) + 2*4))))
+ area = area * float64(*(*RtreeValue)(unsafe.Pointer(p + 8 + 3*4))-*(*RtreeValue)(unsafe.Pointer(p + 8 + 2*4)))
fallthrough
default:
- area = area * (float64(*(*RtreeValue)(unsafe.Pointer((p + 8 /* &.aCoord */) + 1*4)) - *(*RtreeValue)(unsafe.Pointer((p + 8 /* &.aCoord */)))))
+ area = area * float64(*(*RtreeValue)(unsafe.Pointer(p + 8 + 1*4))-*(*RtreeValue)(unsafe.Pointer(p + 8)))
}
} else {
switch int32((*Rtree)(unsafe.Pointer(pRtree)).FnDim) {
case 5:
- area = (RtreeDValue(I64(*(*int32)(unsafe.Pointer((p + 8 /* &.aCoord */) + 9*4))) - I64(*(*int32)(unsafe.Pointer((p + 8 /* &.aCoord */) + 8*4)))))
+ area = RtreeDValue(I64(*(*int32)(unsafe.Pointer(p + 8 + 9*4))) - I64(*(*int32)(unsafe.Pointer(p + 8 + 8*4))))
fallthrough
case 4:
- area = area * (float64(I64(*(*int32)(unsafe.Pointer((p + 8 /* &.aCoord */) + 7*4))) - I64(*(*int32)(unsafe.Pointer((p + 8 /* &.aCoord */) + 6*4)))))
+ area = area * float64(I64(*(*int32)(unsafe.Pointer(p + 8 + 7*4)))-I64(*(*int32)(unsafe.Pointer(p + 8 + 6*4))))
fallthrough
case 3:
- area = area * (float64(I64(*(*int32)(unsafe.Pointer((p + 8 /* &.aCoord */) + 5*4))) - I64(*(*int32)(unsafe.Pointer((p + 8 /* &.aCoord */) + 4*4)))))
+ area = area * float64(I64(*(*int32)(unsafe.Pointer(p + 8 + 5*4)))-I64(*(*int32)(unsafe.Pointer(p + 8 + 4*4))))
fallthrough
case 2:
- area = area * (float64(I64(*(*int32)(unsafe.Pointer((p + 8 /* &.aCoord */) + 3*4))) - I64(*(*int32)(unsafe.Pointer((p + 8 /* &.aCoord */) + 2*4)))))
+ area = area * float64(I64(*(*int32)(unsafe.Pointer(p + 8 + 3*4)))-I64(*(*int32)(unsafe.Pointer(p + 8 + 2*4))))
fallthrough
default:
- area = area * (float64(I64(*(*int32)(unsafe.Pointer((p + 8 /* &.aCoord */) + 1*4))) - I64(*(*int32)(unsafe.Pointer((p + 8 /* &.aCoord */))))))
+ area = area * float64(I64(*(*int32)(unsafe.Pointer(p + 8 + 1*4)))-I64(*(*int32)(unsafe.Pointer(p + 8))))
}
}
return area
@@ -154431,74 +156649,74 @@ func cellArea(tls *libc.TLS, pRtree uintptr, p uintptr) RtreeDValue { /* sqlite3
// Return the margin length of cell p. The margin length is the sum
// of the objects size in each dimension.
-func cellMargin(tls *libc.TLS, pRtree uintptr, p uintptr) RtreeDValue { /* sqlite3.c:194354:20: */
+func cellMargin(tls *libc.TLS, pRtree uintptr, p uintptr) RtreeDValue { /* sqlite3.c:196009:20: */
var margin RtreeDValue = RtreeDValue(0)
- var ii int32 = (int32((*Rtree)(unsafe.Pointer(pRtree)).FnDim2) - 2)
- for ok := true; ok; ok = (ii >= 0) {
- margin = margin + ((func() float64 {
+ var ii int32 = int32((*Rtree)(unsafe.Pointer(pRtree)).FnDim2) - 2
+ for ok := true; ok; ok = ii >= 0 {
+ margin = margin + (func() float64 {
if int32((*Rtree)(unsafe.Pointer(pRtree)).FeCoordType) == RTREE_COORD_REAL32 {
- return float64(*(*RtreeValue)(unsafe.Pointer((p + 8 /* &.aCoord */) + uintptr((ii+1))*4)))
+ return float64(*(*RtreeValue)(unsafe.Pointer(p + 8 + uintptr(ii+1)*4)))
}
- return float64(*(*int32)(unsafe.Pointer((p + 8 /* &.aCoord */) + uintptr((ii+1))*4)))
- }()) - (func() float64 {
+ return float64(*(*int32)(unsafe.Pointer(p + 8 + uintptr(ii+1)*4)))
+ }() - func() float64 {
if int32((*Rtree)(unsafe.Pointer(pRtree)).FeCoordType) == RTREE_COORD_REAL32 {
- return float64(*(*RtreeValue)(unsafe.Pointer((p + 8 /* &.aCoord */) + uintptr(ii)*4)))
+ return float64(*(*RtreeValue)(unsafe.Pointer(p + 8 + uintptr(ii)*4)))
}
- return float64(*(*int32)(unsafe.Pointer((p + 8 /* &.aCoord */) + uintptr(ii)*4)))
- }()))
- ii = ii - (2)
+ return float64(*(*int32)(unsafe.Pointer(p + 8 + uintptr(ii)*4)))
+ }())
+ ii = ii - 2
}
return margin
}
// Store the union of cells p1 and p2 in p1.
-func cellUnion(tls *libc.TLS, pRtree uintptr, p1 uintptr, p2 uintptr) { /* sqlite3.c:194367:13: */
+func cellUnion(tls *libc.TLS, pRtree uintptr, p1 uintptr, p2 uintptr) { /* sqlite3.c:196022:13: */
var ii int32 = 0
if int32((*Rtree)(unsafe.Pointer(pRtree)).FeCoordType) == RTREE_COORD_REAL32 {
- for ok := true; ok; ok = (ii < int32((*Rtree)(unsafe.Pointer(pRtree)).FnDim2)) {
- *(*RtreeValue)(unsafe.Pointer((p1 + 8 /* &.aCoord */) + uintptr(ii)*4)) = func() float32 {
- if (*(*RtreeValue)(unsafe.Pointer((p1 + 8 /* &.aCoord */) + uintptr(ii)*4))) < (*(*RtreeValue)(unsafe.Pointer((p2 + 8 /* &.aCoord */) + uintptr(ii)*4))) {
- return *(*RtreeValue)(unsafe.Pointer((p1 + 8 /* &.aCoord */) + uintptr(ii)*4))
+ for ok := true; ok; ok = ii < int32((*Rtree)(unsafe.Pointer(pRtree)).FnDim2) {
+ *(*RtreeValue)(unsafe.Pointer(p1 + 8 + uintptr(ii)*4)) = func() float32 {
+ if *(*RtreeValue)(unsafe.Pointer(p1 + 8 + uintptr(ii)*4)) < *(*RtreeValue)(unsafe.Pointer(p2 + 8 + uintptr(ii)*4)) {
+ return *(*RtreeValue)(unsafe.Pointer(p1 + 8 + uintptr(ii)*4))
}
- return *(*RtreeValue)(unsafe.Pointer((p2 + 8 /* &.aCoord */) + uintptr(ii)*4))
+ return *(*RtreeValue)(unsafe.Pointer(p2 + 8 + uintptr(ii)*4))
}()
- *(*RtreeValue)(unsafe.Pointer((p1 + 8 /* &.aCoord */) + uintptr((ii+1))*4)) = func() float32 {
- if (*(*RtreeValue)(unsafe.Pointer((p1 + 8 /* &.aCoord */) + uintptr((ii+1))*4))) > (*(*RtreeValue)(unsafe.Pointer((p2 + 8 /* &.aCoord */) + uintptr((ii+1))*4))) {
- return *(*RtreeValue)(unsafe.Pointer((p1 + 8 /* &.aCoord */) + uintptr((ii+1))*4))
+ *(*RtreeValue)(unsafe.Pointer(p1 + 8 + uintptr(ii+1)*4)) = func() float32 {
+ if *(*RtreeValue)(unsafe.Pointer(p1 + 8 + uintptr(ii+1)*4)) > *(*RtreeValue)(unsafe.Pointer(p2 + 8 + uintptr(ii+1)*4)) {
+ return *(*RtreeValue)(unsafe.Pointer(p1 + 8 + uintptr(ii+1)*4))
}
- return *(*RtreeValue)(unsafe.Pointer((p2 + 8 /* &.aCoord */) + uintptr((ii+1))*4))
+ return *(*RtreeValue)(unsafe.Pointer(p2 + 8 + uintptr(ii+1)*4))
}()
- ii = ii + (2)
+ ii = ii + 2
}
} else {
- for ok1 := true; ok1; ok1 = (ii < int32((*Rtree)(unsafe.Pointer(pRtree)).FnDim2)) {
- *(*int32)(unsafe.Pointer((p1 + 8 /* &.aCoord */) + uintptr(ii)*4)) = func() int32 {
- if (*(*int32)(unsafe.Pointer((p1 + 8 /* &.aCoord */) + uintptr(ii)*4))) < (*(*int32)(unsafe.Pointer((p2 + 8 /* &.aCoord */) + uintptr(ii)*4))) {
- return *(*int32)(unsafe.Pointer((p1 + 8 /* &.aCoord */) + uintptr(ii)*4))
+ for ok1 := true; ok1; ok1 = ii < int32((*Rtree)(unsafe.Pointer(pRtree)).FnDim2) {
+ *(*int32)(unsafe.Pointer(p1 + 8 + uintptr(ii)*4)) = func() int32 {
+ if *(*int32)(unsafe.Pointer(p1 + 8 + uintptr(ii)*4)) < *(*int32)(unsafe.Pointer(p2 + 8 + uintptr(ii)*4)) {
+ return *(*int32)(unsafe.Pointer(p1 + 8 + uintptr(ii)*4))
}
- return *(*int32)(unsafe.Pointer((p2 + 8 /* &.aCoord */) + uintptr(ii)*4))
+ return *(*int32)(unsafe.Pointer(p2 + 8 + uintptr(ii)*4))
}()
- *(*int32)(unsafe.Pointer((p1 + 8 /* &.aCoord */) + uintptr((ii+1))*4)) = func() int32 {
- if (*(*int32)(unsafe.Pointer((p1 + 8 /* &.aCoord */) + uintptr((ii+1))*4))) > (*(*int32)(unsafe.Pointer((p2 + 8 /* &.aCoord */) + uintptr((ii+1))*4))) {
- return *(*int32)(unsafe.Pointer((p1 + 8 /* &.aCoord */) + uintptr((ii+1))*4))
+ *(*int32)(unsafe.Pointer(p1 + 8 + uintptr(ii+1)*4)) = func() int32 {
+ if *(*int32)(unsafe.Pointer(p1 + 8 + uintptr(ii+1)*4)) > *(*int32)(unsafe.Pointer(p2 + 8 + uintptr(ii+1)*4)) {
+ return *(*int32)(unsafe.Pointer(p1 + 8 + uintptr(ii+1)*4))
}
- return *(*int32)(unsafe.Pointer((p2 + 8 /* &.aCoord */) + uintptr((ii+1))*4))
+ return *(*int32)(unsafe.Pointer(p2 + 8 + uintptr(ii+1)*4))
}()
- ii = ii + (2)
+ ii = ii + 2
}
}
}
// Return true if the area covered by p2 is a subset of the area covered
// by p1. False otherwise.
-func cellContains(tls *libc.TLS, pRtree uintptr, p1 uintptr, p2 uintptr) int32 { /* sqlite3.c:194388:12: */
+func cellContains(tls *libc.TLS, pRtree uintptr, p1 uintptr, p2 uintptr) int32 { /* sqlite3.c:196043:12: */
var ii int32
- var isInt int32 = (libc.Bool32(int32((*Rtree)(unsafe.Pointer(pRtree)).FeCoordType) == RTREE_COORD_INT32))
- for ii = 0; ii < int32((*Rtree)(unsafe.Pointer(pRtree)).FnDim2); ii = ii + (2) {
- var a1 uintptr = ((p1 + 8 /* &.aCoord */) + uintptr(ii)*4)
- var a2 uintptr = ((p2 + 8 /* &.aCoord */) + uintptr(ii)*4)
- if (!(isInt != 0) && ((*(*RtreeValue)(unsafe.Pointer(a2)) < *(*RtreeValue)(unsafe.Pointer(a1))) || (*(*RtreeValue)(unsafe.Pointer(a2 + 1*4)) > *(*RtreeValue)(unsafe.Pointer(a1 + 1*4))))) ||
- ((isInt != 0) && ((*(*int32)(unsafe.Pointer(a2)) < *(*int32)(unsafe.Pointer(a1))) || (*(*int32)(unsafe.Pointer(a2 + 1*4)) > *(*int32)(unsafe.Pointer(a1 + 1*4))))) {
+ var isInt int32 = libc.Bool32(int32((*Rtree)(unsafe.Pointer(pRtree)).FeCoordType) == RTREE_COORD_INT32)
+ for ii = 0; ii < int32((*Rtree)(unsafe.Pointer(pRtree)).FnDim2); ii = ii + 2 {
+ var a1 uintptr = p1 + 8 + uintptr(ii)*4
+ var a2 uintptr = p2 + 8 + uintptr(ii)*4
+ if !(isInt != 0) && (*(*RtreeValue)(unsafe.Pointer(a2)) < *(*RtreeValue)(unsafe.Pointer(a1)) || *(*RtreeValue)(unsafe.Pointer(a2 + 1*4)) > *(*RtreeValue)(unsafe.Pointer(a1 + 1*4))) ||
+ isInt != 0 && (*(*int32)(unsafe.Pointer(a2)) < *(*int32)(unsafe.Pointer(a1)) || *(*int32)(unsafe.Pointer(a2 + 1*4)) > *(*int32)(unsafe.Pointer(a1 + 1*4))) {
return 0
}
}
@@ -154506,7 +156724,7 @@ func cellContains(tls *libc.TLS, pRtree uintptr, p1 uintptr, p2 uintptr) int32 {
}
// Return the amount cell p would grow by if it were unioned with pCell.
-func cellGrowth(tls *libc.TLS, pRtree uintptr, p uintptr, pCell uintptr) RtreeDValue { /* sqlite3.c:194406:20: */
+func cellGrowth(tls *libc.TLS, pRtree uintptr, p uintptr, pCell uintptr) RtreeDValue { /* sqlite3.c:196061:20: */
bp := tls.Alloc(48)
defer tls.Free(48)
@@ -154516,85 +156734,85 @@ func cellGrowth(tls *libc.TLS, pRtree uintptr, p uintptr, pCell uintptr) RtreeDV
libc.Xmemcpy(tls, bp /* &cell */, p, uint32(unsafe.Sizeof(RtreeCell{})))
area = cellArea(tls, pRtree, bp /* &cell */)
cellUnion(tls, pRtree, bp /* &cell */, pCell)
- return (cellArea(tls, pRtree, bp /* &cell */) - area)
+ return cellArea(tls, pRtree, bp) - area
}
-func cellOverlap(tls *libc.TLS, pRtree uintptr, p uintptr, aCell uintptr, nCell int32) RtreeDValue { /* sqlite3.c:194415:20: */
+func cellOverlap(tls *libc.TLS, pRtree uintptr, p uintptr, aCell uintptr, nCell int32) RtreeDValue { /* sqlite3.c:196070:20: */
var ii int32
var overlap RtreeDValue = 0.0
for ii = 0; ii < nCell; ii++ {
var jj int32
var o RtreeDValue = RtreeDValue(1)
- for jj = 0; jj < int32((*Rtree)(unsafe.Pointer(pRtree)).FnDim2); jj = jj + (2) {
+ for jj = 0; jj < int32((*Rtree)(unsafe.Pointer(pRtree)).FnDim2); jj = jj + 2 {
var x1 RtreeDValue
var x2 RtreeDValue
x1 = func() float64 {
- if (func() float64 {
+ if func() float64 {
if int32((*Rtree)(unsafe.Pointer(pRtree)).FeCoordType) == RTREE_COORD_REAL32 {
- return float64(*(*RtreeValue)(unsafe.Pointer((p + 8 /* &.aCoord */) + uintptr(jj)*4)))
+ return float64(*(*RtreeValue)(unsafe.Pointer(p + 8 + uintptr(jj)*4)))
}
- return float64(*(*int32)(unsafe.Pointer((p + 8 /* &.aCoord */) + uintptr(jj)*4)))
- }()) > (func() float64 {
+ return float64(*(*int32)(unsafe.Pointer(p + 8 + uintptr(jj)*4)))
+ }() > func() float64 {
if int32((*Rtree)(unsafe.Pointer(pRtree)).FeCoordType) == RTREE_COORD_REAL32 {
- return float64(*(*RtreeValue)(unsafe.Pointer((aCell + uintptr(ii)*48 + 8 /* &.aCoord */) + uintptr(jj)*4)))
+ return float64(*(*RtreeValue)(unsafe.Pointer(aCell + uintptr(ii)*48 + 8 + uintptr(jj)*4)))
}
- return float64(*(*int32)(unsafe.Pointer((aCell + uintptr(ii)*48 + 8 /* &.aCoord */) + uintptr(jj)*4)))
- }()) {
+ return float64(*(*int32)(unsafe.Pointer(aCell + uintptr(ii)*48 + 8 + uintptr(jj)*4)))
+ }() {
return func() float64 {
if int32((*Rtree)(unsafe.Pointer(pRtree)).FeCoordType) == RTREE_COORD_REAL32 {
- return float64(*(*RtreeValue)(unsafe.Pointer((p + 8 /* &.aCoord */) + uintptr(jj)*4)))
+ return float64(*(*RtreeValue)(unsafe.Pointer(p + 8 + uintptr(jj)*4)))
}
- return float64(*(*int32)(unsafe.Pointer((p + 8 /* &.aCoord */) + uintptr(jj)*4)))
+ return float64(*(*int32)(unsafe.Pointer(p + 8 + uintptr(jj)*4)))
}()
}
return func() float64 {
if int32((*Rtree)(unsafe.Pointer(pRtree)).FeCoordType) == RTREE_COORD_REAL32 {
- return float64(*(*RtreeValue)(unsafe.Pointer((aCell + uintptr(ii)*48 + 8 /* &.aCoord */) + uintptr(jj)*4)))
+ return float64(*(*RtreeValue)(unsafe.Pointer(aCell + uintptr(ii)*48 + 8 + uintptr(jj)*4)))
}
- return float64(*(*int32)(unsafe.Pointer((aCell + uintptr(ii)*48 + 8 /* &.aCoord */) + uintptr(jj)*4)))
+ return float64(*(*int32)(unsafe.Pointer(aCell + uintptr(ii)*48 + 8 + uintptr(jj)*4)))
}()
}()
x2 = func() float64 {
- if (func() float64 {
+ if func() float64 {
if int32((*Rtree)(unsafe.Pointer(pRtree)).FeCoordType) == RTREE_COORD_REAL32 {
- return float64(*(*RtreeValue)(unsafe.Pointer((p + 8 /* &.aCoord */) + uintptr((jj+1))*4)))
+ return float64(*(*RtreeValue)(unsafe.Pointer(p + 8 + uintptr(jj+1)*4)))
}
- return float64(*(*int32)(unsafe.Pointer((p + 8 /* &.aCoord */) + uintptr((jj+1))*4)))
- }()) < (func() float64 {
+ return float64(*(*int32)(unsafe.Pointer(p + 8 + uintptr(jj+1)*4)))
+ }() < func() float64 {
if int32((*Rtree)(unsafe.Pointer(pRtree)).FeCoordType) == RTREE_COORD_REAL32 {
- return float64(*(*RtreeValue)(unsafe.Pointer((aCell + uintptr(ii)*48 + 8 /* &.aCoord */) + uintptr((jj+1))*4)))
+ return float64(*(*RtreeValue)(unsafe.Pointer(aCell + uintptr(ii)*48 + 8 + uintptr(jj+1)*4)))
}
- return float64(*(*int32)(unsafe.Pointer((aCell + uintptr(ii)*48 + 8 /* &.aCoord */) + uintptr((jj+1))*4)))
- }()) {
+ return float64(*(*int32)(unsafe.Pointer(aCell + uintptr(ii)*48 + 8 + uintptr(jj+1)*4)))
+ }() {
return func() float64 {
if int32((*Rtree)(unsafe.Pointer(pRtree)).FeCoordType) == RTREE_COORD_REAL32 {
- return float64(*(*RtreeValue)(unsafe.Pointer((p + 8 /* &.aCoord */) + uintptr((jj+1))*4)))
+ return float64(*(*RtreeValue)(unsafe.Pointer(p + 8 + uintptr(jj+1)*4)))
}
- return float64(*(*int32)(unsafe.Pointer((p + 8 /* &.aCoord */) + uintptr((jj+1))*4)))
+ return float64(*(*int32)(unsafe.Pointer(p + 8 + uintptr(jj+1)*4)))
}()
}
return func() float64 {
if int32((*Rtree)(unsafe.Pointer(pRtree)).FeCoordType) == RTREE_COORD_REAL32 {
- return float64(*(*RtreeValue)(unsafe.Pointer((aCell + uintptr(ii)*48 + 8 /* &.aCoord */) + uintptr((jj+1))*4)))
+ return float64(*(*RtreeValue)(unsafe.Pointer(aCell + uintptr(ii)*48 + 8 + uintptr(jj+1)*4)))
}
- return float64(*(*int32)(unsafe.Pointer((aCell + uintptr(ii)*48 + 8 /* &.aCoord */) + uintptr((jj+1))*4)))
+ return float64(*(*int32)(unsafe.Pointer(aCell + uintptr(ii)*48 + 8 + uintptr(jj+1)*4)))
}()
}()
if x2 < x1 {
o = RtreeDValue(0)
break
} else {
- o = (o * (x2 - x1))
+ o = o * (x2 - x1)
}
}
- overlap = overlap + (o)
+ overlap = overlap + o
}
return overlap
}
// This function implements the ChooseLeaf algorithm from Gutman[84].
// ChooseSubTree in r*tree terminology.
-func sChooseLeaf(tls *libc.TLS, pRtree uintptr, pCell uintptr, iHeight int32, ppLeaf uintptr) int32 { /* sqlite3.c:194447:12: */
+func sChooseLeaf(tls *libc.TLS, pRtree uintptr, pCell uintptr, iHeight int32, ppLeaf uintptr) int32 { /* sqlite3.c:196102:12: */
bp := tls.Alloc(60)
defer tls.Free(60)
@@ -154603,17 +156821,17 @@ func sChooseLeaf(tls *libc.TLS, pRtree uintptr, pCell uintptr, iHeight int32, pp
*(*uintptr)(unsafe.Pointer(bp /* pNode */)) = uintptr(0)
rc = nodeAcquire(tls, pRtree, int64(1), uintptr(0), bp /* &pNode */)
- for ii = 0; (rc == SQLITE_OK) && (ii < ((*Rtree)(unsafe.Pointer(pRtree)).FiDepth - iHeight)); ii++ {
+ for ii = 0; rc == SQLITE_OK && ii < (*Rtree)(unsafe.Pointer(pRtree)).FiDepth-iHeight; ii++ {
var iCell int32
var iBest Sqlite3_int64 = int64(0)
var fMinGrowth RtreeDValue = 0.0
var fMinArea RtreeDValue = 0.0
- var nCell int32 = readInt16(tls, ((*RtreeNode)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(bp /* pNode */))))).FzData + 2))
+ var nCell int32 = readInt16(tls, (*RtreeNode)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FzData+2)
// var cell RtreeCell at bp+8, 48
- // var pChild uintptr at bp+56, 4
+ *(*uintptr)(unsafe.Pointer(bp + 56 /* pChild */)) = uintptr(0)
var aCell uintptr = uintptr(0)
@@ -154627,7 +156845,7 @@ func sChooseLeaf(tls *libc.TLS, pRtree uintptr, pCell uintptr, iHeight int32, pp
nodeGetCell(tls, pRtree, *(*uintptr)(unsafe.Pointer(bp /* pNode */)), iCell, bp+8 /* &cell */)
growth = cellGrowth(tls, pRtree, bp+8 /* &cell */, pCell)
area = cellArea(tls, pRtree, bp+8 /* &cell */)
- if ((iCell == 0) || (growth < fMinGrowth)) || ((growth == fMinGrowth) && (area < fMinArea)) {
+ if iCell == 0 || growth < fMinGrowth || growth == fMinGrowth && area < fMinArea {
bBest = 1
}
if bBest != 0 {
@@ -154650,25 +156868,32 @@ func sChooseLeaf(tls *libc.TLS, pRtree uintptr, pCell uintptr, iHeight int32, pp
// A cell with the same content as pCell has just been inserted into
// the node pNode. This function updates the bounding box cells in
// all ancestor elements.
-func sAdjustTree(tls *libc.TLS, pRtree uintptr, pNode uintptr, pCell uintptr) int32 { /* sqlite3.c:194507:12: */
+func sAdjustTree(tls *libc.TLS, pRtree uintptr, pNode uintptr, pCell uintptr) int32 { /* sqlite3.c:196162:12: */
bp := tls.Alloc(56)
defer tls.Free(56)
var p uintptr = pNode
var cnt int32 = 0
+ var rc int32
for (*RtreeNode)(unsafe.Pointer(p)).FpParent != 0 {
var pParent uintptr = (*RtreeNode)(unsafe.Pointer(p)).FpParent
// var cell RtreeCell at bp+8, 48
// var iCell int32 at bp, 4
- if ((libc.PreIncInt32(&cnt, 1)) > 1000) || (nodeParentIndex(tls, pRtree, p, bp /* &iCell */) != 0) {
+ cnt++
+ if cnt > 100 {
- return (SQLITE_CORRUPT | (int32(1) << 8))
+ return SQLITE_CORRUPT | int32(1)<<8
+ }
+ rc = nodeParentIndex(tls, pRtree, p, bp /* &iCell */)
+ if rc != SQLITE_OK {
+
+ return SQLITE_CORRUPT | int32(1)<<8
}
nodeGetCell(tls, pRtree, pParent, *(*int32)(unsafe.Pointer(bp /* iCell */)), bp+8 /* &cell */)
- if !(cellContains(tls, pRtree, bp+8 /* &cell */, pCell) != 0) {
+ if !(cellContains(tls, pRtree, bp+8, pCell) != 0) {
cellUnion(tls, pRtree, bp+8 /* &cell */, pCell)
nodeOverwriteCell(tls, pRtree, pParent, bp+8 /* &cell */, *(*int32)(unsafe.Pointer(bp /* iCell */)))
}
@@ -154679,7 +156904,7 @@ func sAdjustTree(tls *libc.TLS, pRtree uintptr, pNode uintptr, pCell uintptr) in
}
// Write mapping (iRowid->iNode) to the <rtree>_rowid table.
-func rowidWrite(tls *libc.TLS, pRtree uintptr, iRowid Sqlite3_int64, iNode Sqlite3_int64) int32 { /* sqlite3.c:194538:12: */
+func rowidWrite(tls *libc.TLS, pRtree uintptr, iRowid Sqlite3_int64, iNode Sqlite3_int64) int32 { /* sqlite3.c:196200:12: */
Xsqlite3_bind_int64(tls, (*Rtree)(unsafe.Pointer(pRtree)).FpWriteRowid, 1, iRowid)
Xsqlite3_bind_int64(tls, (*Rtree)(unsafe.Pointer(pRtree)).FpWriteRowid, 2, iNode)
Xsqlite3_step(tls, (*Rtree)(unsafe.Pointer(pRtree)).FpWriteRowid)
@@ -154687,7 +156912,7 @@ func rowidWrite(tls *libc.TLS, pRtree uintptr, iRowid Sqlite3_int64, iNode Sqlit
}
// Write mapping (iNode->iPar) to the <rtree>_parent table.
-func parentWrite(tls *libc.TLS, pRtree uintptr, iNode Sqlite3_int64, iPar Sqlite3_int64) int32 { /* sqlite3.c:194548:12: */
+func parentWrite(tls *libc.TLS, pRtree uintptr, iNode Sqlite3_int64, iPar Sqlite3_int64) int32 { /* sqlite3.c:196210:12: */
Xsqlite3_bind_int64(tls, (*Rtree)(unsafe.Pointer(pRtree)).FpWriteParent, 1, iNode)
Xsqlite3_bind_int64(tls, (*Rtree)(unsafe.Pointer(pRtree)).FpWriteParent, 2, iPar)
Xsqlite3_step(tls, (*Rtree)(unsafe.Pointer(pRtree)).FpWriteParent)
@@ -154709,37 +156934,37 @@ func parentWrite(tls *libc.TLS, pRtree uintptr, iNode Sqlite3_int64, iPar Sqlite
//
// The aSpare array is used as temporary working space by the
// sorting algorithm.
-func sSortByDistance(tls *libc.TLS, aIdx uintptr, nIdx int32, aDistance uintptr, aSpare uintptr) { /* sqlite3.c:194575:13: */
+func sSortByDistance(tls *libc.TLS, aIdx uintptr, nIdx int32, aDistance uintptr, aSpare uintptr) { /* sqlite3.c:196237:13: */
if nIdx > 1 {
var iLeft int32 = 0
var iRight int32 = 0
- var nLeft int32 = (nIdx / 2)
- var nRight int32 = (nIdx - nLeft)
+ var nLeft int32 = nIdx / 2
+ var nRight int32 = nIdx - nLeft
var aLeft uintptr = aIdx
- var aRight uintptr = (aIdx + uintptr(nLeft)*4)
+ var aRight uintptr = aIdx + uintptr(nLeft)*4
sSortByDistance(tls, aLeft, nLeft, aDistance, aSpare)
sSortByDistance(tls, aRight, nRight, aDistance, aSpare)
- libc.Xmemcpy(tls, aSpare, aLeft, (uint32(unsafe.Sizeof(int32(0))) * uint32(nLeft)))
+ libc.Xmemcpy(tls, aSpare, aLeft, uint32(unsafe.Sizeof(int32(0)))*uint32(nLeft))
aLeft = aSpare
- for (iLeft < nLeft) || (iRight < nRight) {
+ for iLeft < nLeft || iRight < nRight {
if iLeft == nLeft {
- *(*int32)(unsafe.Pointer(aIdx + uintptr((iLeft+iRight))*4)) = *(*int32)(unsafe.Pointer(aRight + uintptr(iRight)*4))
+ *(*int32)(unsafe.Pointer(aIdx + uintptr(iLeft+iRight)*4)) = *(*int32)(unsafe.Pointer(aRight + uintptr(iRight)*4))
iRight++
} else if iRight == nRight {
- *(*int32)(unsafe.Pointer(aIdx + uintptr((iLeft+iRight))*4)) = *(*int32)(unsafe.Pointer(aLeft + uintptr(iLeft)*4))
+ *(*int32)(unsafe.Pointer(aIdx + uintptr(iLeft+iRight)*4)) = *(*int32)(unsafe.Pointer(aLeft + uintptr(iLeft)*4))
iLeft++
} else {
var fLeft RtreeDValue = *(*RtreeDValue)(unsafe.Pointer(aDistance + uintptr(*(*int32)(unsafe.Pointer(aLeft + uintptr(iLeft)*4)))*8))
var fRight RtreeDValue = *(*RtreeDValue)(unsafe.Pointer(aDistance + uintptr(*(*int32)(unsafe.Pointer(aRight + uintptr(iRight)*4)))*8))
if fLeft < fRight {
- *(*int32)(unsafe.Pointer(aIdx + uintptr((iLeft+iRight))*4)) = *(*int32)(unsafe.Pointer(aLeft + uintptr(iLeft)*4))
+ *(*int32)(unsafe.Pointer(aIdx + uintptr(iLeft+iRight)*4)) = *(*int32)(unsafe.Pointer(aLeft + uintptr(iLeft)*4))
iLeft++
} else {
- *(*int32)(unsafe.Pointer(aIdx + uintptr((iLeft+iRight))*4)) = *(*int32)(unsafe.Pointer(aRight + uintptr(iRight)*4))
+ *(*int32)(unsafe.Pointer(aIdx + uintptr(iLeft+iRight)*4)) = *(*int32)(unsafe.Pointer(aRight + uintptr(iRight)*4))
iRight++
}
}
@@ -154757,54 +156982,54 @@ func sSortByDistance(tls *libc.TLS, aIdx uintptr, nIdx int32, aDistance uintptr,
//
// The aSpare array is used as temporary working space by the
// sorting algorithm.
-func sSortByDimension(tls *libc.TLS, pRtree uintptr, aIdx uintptr, nIdx int32, iDim int32, aCell uintptr, aSpare uintptr) { /* sqlite3.c:194641:13: */
+func sSortByDimension(tls *libc.TLS, pRtree uintptr, aIdx uintptr, nIdx int32, iDim int32, aCell uintptr, aSpare uintptr) { /* sqlite3.c:196303:13: */
if nIdx > 1 {
var iLeft int32 = 0
var iRight int32 = 0
- var nLeft int32 = (nIdx / 2)
- var nRight int32 = (nIdx - nLeft)
+ var nLeft int32 = nIdx / 2
+ var nRight int32 = nIdx - nLeft
var aLeft uintptr = aIdx
- var aRight uintptr = (aIdx + uintptr(nLeft)*4)
+ var aRight uintptr = aIdx + uintptr(nLeft)*4
sSortByDimension(tls, pRtree, aLeft, nLeft, iDim, aCell, aSpare)
sSortByDimension(tls, pRtree, aRight, nRight, iDim, aCell, aSpare)
- libc.Xmemcpy(tls, aSpare, aLeft, (uint32(unsafe.Sizeof(int32(0))) * uint32(nLeft)))
+ libc.Xmemcpy(tls, aSpare, aLeft, uint32(unsafe.Sizeof(int32(0)))*uint32(nLeft))
aLeft = aSpare
- for (iLeft < nLeft) || (iRight < nRight) {
+ for iLeft < nLeft || iRight < nRight {
var xleft1 RtreeDValue = func() float64 {
if int32((*Rtree)(unsafe.Pointer(pRtree)).FeCoordType) == RTREE_COORD_REAL32 {
- return float64(*(*RtreeValue)(unsafe.Pointer((aCell + uintptr(*(*int32)(unsafe.Pointer(aLeft + uintptr(iLeft)*4)))*48 + 8 /* &.aCoord */) + uintptr((iDim*2))*4)))
+ return float64(*(*RtreeValue)(unsafe.Pointer(aCell + uintptr(*(*int32)(unsafe.Pointer(aLeft + uintptr(iLeft)*4)))*48 + 8 + uintptr(iDim*2)*4)))
}
- return float64(*(*int32)(unsafe.Pointer((aCell + uintptr(*(*int32)(unsafe.Pointer(aLeft + uintptr(iLeft)*4)))*48 + 8 /* &.aCoord */) + uintptr((iDim*2))*4)))
+ return float64(*(*int32)(unsafe.Pointer(aCell + uintptr(*(*int32)(unsafe.Pointer(aLeft + uintptr(iLeft)*4)))*48 + 8 + uintptr(iDim*2)*4)))
}()
var xleft2 RtreeDValue = func() float64 {
if int32((*Rtree)(unsafe.Pointer(pRtree)).FeCoordType) == RTREE_COORD_REAL32 {
- return float64(*(*RtreeValue)(unsafe.Pointer((aCell + uintptr(*(*int32)(unsafe.Pointer(aLeft + uintptr(iLeft)*4)))*48 + 8 /* &.aCoord */) + uintptr(((iDim*2)+1))*4)))
+ return float64(*(*RtreeValue)(unsafe.Pointer(aCell + uintptr(*(*int32)(unsafe.Pointer(aLeft + uintptr(iLeft)*4)))*48 + 8 + uintptr(iDim*2+1)*4)))
}
- return float64(*(*int32)(unsafe.Pointer((aCell + uintptr(*(*int32)(unsafe.Pointer(aLeft + uintptr(iLeft)*4)))*48 + 8 /* &.aCoord */) + uintptr(((iDim*2)+1))*4)))
+ return float64(*(*int32)(unsafe.Pointer(aCell + uintptr(*(*int32)(unsafe.Pointer(aLeft + uintptr(iLeft)*4)))*48 + 8 + uintptr(iDim*2+1)*4)))
}()
var xright1 RtreeDValue = func() float64 {
if int32((*Rtree)(unsafe.Pointer(pRtree)).FeCoordType) == RTREE_COORD_REAL32 {
- return float64(*(*RtreeValue)(unsafe.Pointer((aCell + uintptr(*(*int32)(unsafe.Pointer(aRight + uintptr(iRight)*4)))*48 + 8 /* &.aCoord */) + uintptr((iDim*2))*4)))
+ return float64(*(*RtreeValue)(unsafe.Pointer(aCell + uintptr(*(*int32)(unsafe.Pointer(aRight + uintptr(iRight)*4)))*48 + 8 + uintptr(iDim*2)*4)))
}
- return float64(*(*int32)(unsafe.Pointer((aCell + uintptr(*(*int32)(unsafe.Pointer(aRight + uintptr(iRight)*4)))*48 + 8 /* &.aCoord */) + uintptr((iDim*2))*4)))
+ return float64(*(*int32)(unsafe.Pointer(aCell + uintptr(*(*int32)(unsafe.Pointer(aRight + uintptr(iRight)*4)))*48 + 8 + uintptr(iDim*2)*4)))
}()
var xright2 RtreeDValue = func() float64 {
if int32((*Rtree)(unsafe.Pointer(pRtree)).FeCoordType) == RTREE_COORD_REAL32 {
- return float64(*(*RtreeValue)(unsafe.Pointer((aCell + uintptr(*(*int32)(unsafe.Pointer(aRight + uintptr(iRight)*4)))*48 + 8 /* &.aCoord */) + uintptr(((iDim*2)+1))*4)))
+ return float64(*(*RtreeValue)(unsafe.Pointer(aCell + uintptr(*(*int32)(unsafe.Pointer(aRight + uintptr(iRight)*4)))*48 + 8 + uintptr(iDim*2+1)*4)))
}
- return float64(*(*int32)(unsafe.Pointer((aCell + uintptr(*(*int32)(unsafe.Pointer(aRight + uintptr(iRight)*4)))*48 + 8 /* &.aCoord */) + uintptr(((iDim*2)+1))*4)))
+ return float64(*(*int32)(unsafe.Pointer(aCell + uintptr(*(*int32)(unsafe.Pointer(aRight + uintptr(iRight)*4)))*48 + 8 + uintptr(iDim*2+1)*4)))
}()
- if (iLeft != nLeft) && (((iRight == nRight) ||
- (xleft1 < xright1)) ||
- ((xleft1 == xright1) && (xleft2 < xright2))) {
- *(*int32)(unsafe.Pointer(aIdx + uintptr((iLeft+iRight))*4)) = *(*int32)(unsafe.Pointer(aLeft + uintptr(iLeft)*4))
+ if iLeft != nLeft && (iRight == nRight ||
+ xleft1 < xright1 ||
+ xleft1 == xright1 && xleft2 < xright2) {
+ *(*int32)(unsafe.Pointer(aIdx + uintptr(iLeft+iRight)*4)) = *(*int32)(unsafe.Pointer(aLeft + uintptr(iLeft)*4))
iLeft++
} else {
- *(*int32)(unsafe.Pointer(aIdx + uintptr((iLeft+iRight))*4)) = *(*int32)(unsafe.Pointer(aRight + uintptr(iRight)*4))
+ *(*int32)(unsafe.Pointer(aIdx + uintptr(iLeft+iRight)*4)) = *(*int32)(unsafe.Pointer(aRight + uintptr(iRight)*4))
iRight++
}
}
@@ -154813,7 +157038,7 @@ func sSortByDimension(tls *libc.TLS, pRtree uintptr, aIdx uintptr, nIdx int32, i
}
// Implementation of the R*-tree variant of SplitNode from Beckman[1990].
-func splitNodeStartree(tls *libc.TLS, pRtree uintptr, aCell uintptr, nCell int32, pLeft uintptr, pRight uintptr, pBboxLeft uintptr, pBboxRight uintptr) int32 { /* sqlite3.c:194700:12: */
+func splitNodeStartree(tls *libc.TLS, pRtree uintptr, aCell uintptr, nCell int32, pLeft uintptr, pRight uintptr, pBboxLeft uintptr, pBboxRight uintptr) int32 { /* sqlite3.c:196362:12: */
bp := tls.Alloc(96)
defer tls.Free(96)
@@ -154825,18 +157050,18 @@ func splitNodeStartree(tls *libc.TLS, pRtree uintptr, aCell uintptr, nCell int32
var iBestSplit int32 = 0
var fBestMargin RtreeDValue = 0.0
- var nByte Sqlite3_int64 = (Sqlite3_int64((uint32(int32((*Rtree)(unsafe.Pointer(pRtree)).FnDim) + 1)) * (uint32(unsafe.Sizeof(uintptr(0))) + (uint32(nCell) * uint32(unsafe.Sizeof(int32(0)))))))
+ var nByte Sqlite3_int64 = Sqlite3_int64(uint32(int32((*Rtree)(unsafe.Pointer(pRtree)).FnDim)+1) * (uint32(unsafe.Sizeof(uintptr(0))) + uint32(nCell)*uint32(unsafe.Sizeof(int32(0)))))
aaSorted = Xsqlite3_malloc64(tls, uint64(nByte))
if !(aaSorted != 0) {
return SQLITE_NOMEM
}
- aSpare = ((aaSorted + uintptr((*Rtree)(unsafe.Pointer(pRtree)).FnDim)*4) + uintptr((int32((*Rtree)(unsafe.Pointer(pRtree)).FnDim)*nCell))*4)
+ aSpare = aaSorted + uintptr((*Rtree)(unsafe.Pointer(pRtree)).FnDim)*4 + uintptr(int32((*Rtree)(unsafe.Pointer(pRtree)).FnDim)*nCell)*4
libc.Xmemset(tls, aaSorted, 0, uint32(nByte))
for ii = 0; ii < int32((*Rtree)(unsafe.Pointer(pRtree)).FnDim); ii++ {
var jj int32
- *(*uintptr)(unsafe.Pointer(aaSorted + uintptr(ii)*4)) = ((aaSorted + uintptr((*Rtree)(unsafe.Pointer(pRtree)).FnDim)*4) + uintptr((ii*nCell))*4)
+ *(*uintptr)(unsafe.Pointer(aaSorted + uintptr(ii)*4)) = aaSorted + uintptr((*Rtree)(unsafe.Pointer(pRtree)).FnDim)*4 + uintptr(ii*nCell)*4
for jj = 0; jj < nCell; jj++ {
*(*int32)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(aaSorted + uintptr(ii)*4)) + uintptr(jj)*4)) = jj
}
@@ -154850,7 +157075,7 @@ func splitNodeStartree(tls *libc.TLS, pRtree uintptr, aCell uintptr, nCell int32
var iBestLeft int32 = 0
var nLeft int32
- for nLeft = ((((*Rtree)(unsafe.Pointer((pRtree))).FiNodeSize - 4) / int32((*Rtree)(unsafe.Pointer((pRtree))).FnBytesPerCell)) / 3); nLeft <= (nCell - ((((*Rtree)(unsafe.Pointer((pRtree))).FiNodeSize - 4) / int32((*Rtree)(unsafe.Pointer((pRtree))).FnBytesPerCell)) / 3)); nLeft++ {
+ for nLeft = ((*Rtree)(unsafe.Pointer(pRtree)).FiNodeSize - 4) / int32((*Rtree)(unsafe.Pointer(pRtree)).FnBytesPerCell) / 3; nLeft <= nCell-((*Rtree)(unsafe.Pointer(pRtree)).FiNodeSize-4)/int32((*Rtree)(unsafe.Pointer(pRtree)).FnBytesPerCell)/3; nLeft++ {
// var left RtreeCell at bp, 48
// var right RtreeCell at bp+48, 48
@@ -154859,37 +157084,37 @@ func splitNodeStartree(tls *libc.TLS, pRtree uintptr, aCell uintptr, nCell int32
var overlap RtreeDValue
var area RtreeDValue
- libc.Xmemcpy(tls, bp /* &left */, (aCell + uintptr(*(*int32)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(aaSorted + uintptr(ii)*4)))))*48), uint32(unsafe.Sizeof(RtreeCell{})))
- libc.Xmemcpy(tls, bp+48 /* &right */, (aCell + uintptr(*(*int32)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(aaSorted + uintptr(ii)*4)) + uintptr((nCell-1))*4)))*48), uint32(unsafe.Sizeof(RtreeCell{})))
- for kk = 1; kk < (nCell - 1); kk++ {
+ libc.Xmemcpy(tls, bp /* &left */, aCell+uintptr(*(*int32)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(aaSorted + uintptr(ii)*4)))))*48, uint32(unsafe.Sizeof(RtreeCell{})))
+ libc.Xmemcpy(tls, bp+48 /* &right */, aCell+uintptr(*(*int32)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(aaSorted + uintptr(ii)*4)) + uintptr(nCell-1)*4)))*48, uint32(unsafe.Sizeof(RtreeCell{})))
+ for kk = 1; kk < nCell-1; kk++ {
if kk < nLeft {
- cellUnion(tls, pRtree, bp /* &left */, (aCell + uintptr(*(*int32)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(aaSorted + uintptr(ii)*4)) + uintptr(kk)*4)))*48))
+ cellUnion(tls, pRtree, bp /* &left */, aCell+uintptr(*(*int32)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(aaSorted + uintptr(ii)*4)) + uintptr(kk)*4)))*48)
} else {
- cellUnion(tls, pRtree, bp+48 /* &right */, (aCell + uintptr(*(*int32)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(aaSorted + uintptr(ii)*4)) + uintptr(kk)*4)))*48))
+ cellUnion(tls, pRtree, bp+48 /* &right */, aCell+uintptr(*(*int32)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(aaSorted + uintptr(ii)*4)) + uintptr(kk)*4)))*48)
}
}
- margin = margin + (cellMargin(tls, pRtree, bp /* &left */))
- margin = margin + (cellMargin(tls, pRtree, bp+48 /* &right */))
+ margin = margin + cellMargin(tls, pRtree, bp)
+ margin = margin + cellMargin(tls, pRtree, bp+48)
overlap = cellOverlap(tls, pRtree, bp /* &left */, bp+48 /* &right */, 1)
- area = (cellArea(tls, pRtree, bp /* &left */) + cellArea(tls, pRtree, bp+48 /* &right */))
- if ((nLeft == ((((*Rtree)(unsafe.Pointer((pRtree))).FiNodeSize - 4) / int32((*Rtree)(unsafe.Pointer((pRtree))).FnBytesPerCell)) / 3)) ||
- (overlap < fBestOverlap)) ||
- ((overlap == fBestOverlap) && (area < fBestArea)) {
+ area = cellArea(tls, pRtree, bp) + cellArea(tls, pRtree, bp+48)
+ if nLeft == ((*Rtree)(unsafe.Pointer(pRtree)).FiNodeSize-4)/int32((*Rtree)(unsafe.Pointer(pRtree)).FnBytesPerCell)/3 ||
+ overlap < fBestOverlap ||
+ overlap == fBestOverlap && area < fBestArea {
iBestLeft = nLeft
fBestOverlap = overlap
fBestArea = area
}
}
- if (ii == 0) || (margin < fBestMargin) {
+ if ii == 0 || margin < fBestMargin {
iBestDim = ii
fBestMargin = margin
iBestSplit = iBestLeft
}
}
- libc.Xmemcpy(tls, pBboxLeft, (aCell + uintptr(*(*int32)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(aaSorted + uintptr(iBestDim)*4)))))*48), uint32(unsafe.Sizeof(RtreeCell{})))
- libc.Xmemcpy(tls, pBboxRight, (aCell + uintptr(*(*int32)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(aaSorted + uintptr(iBestDim)*4)) + uintptr(iBestSplit)*4)))*48), uint32(unsafe.Sizeof(RtreeCell{})))
+ libc.Xmemcpy(tls, pBboxLeft, aCell+uintptr(*(*int32)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(aaSorted + uintptr(iBestDim)*4)))))*48, uint32(unsafe.Sizeof(RtreeCell{})))
+ libc.Xmemcpy(tls, pBboxRight, aCell+uintptr(*(*int32)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(aaSorted + uintptr(iBestDim)*4)) + uintptr(iBestSplit)*4)))*48, uint32(unsafe.Sizeof(RtreeCell{})))
for ii = 0; ii < nCell; ii++ {
var pTarget uintptr
if ii < iBestSplit {
@@ -154903,7 +157128,7 @@ func splitNodeStartree(tls *libc.TLS, pRtree uintptr, aCell uintptr, nCell int32
} else {
pBbox = pBboxRight
}
- var pCell uintptr = (aCell + uintptr(*(*int32)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(aaSorted + uintptr(iBestDim)*4)) + uintptr(ii)*4)))*48)
+ var pCell uintptr = aCell + uintptr(*(*int32)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(aaSorted + uintptr(iBestDim)*4)) + uintptr(ii)*4)))*48
nodeInsertCell(tls, pRtree, pTarget, pCell)
cellUnion(tls, pRtree, pBbox, pCell)
}
@@ -154912,7 +157137,7 @@ func splitNodeStartree(tls *libc.TLS, pRtree uintptr, aCell uintptr, nCell int32
return SQLITE_OK
}
-func updateMapping(tls *libc.TLS, pRtree uintptr, iRowid I64, pNode uintptr, iHeight int32) int32 { /* sqlite3.c:194798:12: */
+func updateMapping(tls *libc.TLS, pRtree uintptr, iRowid I64, pNode uintptr, iHeight int32) int32 { /* sqlite3.c:196460:12: */
var xSetMapping uintptr
xSetMapping = func() uintptr {
if iHeight == 0 {
@@ -154926,18 +157151,27 @@ func updateMapping(tls *libc.TLS, pRtree uintptr, iRowid I64, pNode uintptr, iHe
}()
if iHeight > 0 {
var pChild uintptr = nodeHashLookup(tls, pRtree, iRowid)
+ var p uintptr
+ for p = pNode; p != 0; p = (*RtreeNode)(unsafe.Pointer(p)).FpParent {
+ if p == pChild {
+ return SQLITE_CORRUPT | int32(1)<<8
+ }
+ }
if pChild != 0 {
nodeRelease(tls, pRtree, (*RtreeNode)(unsafe.Pointer(pChild)).FpParent)
nodeReference(tls, pNode)
(*RtreeNode)(unsafe.Pointer(pChild)).FpParent = pNode
}
}
+ if pNode == uintptr(0) {
+ return SQLITE_ERROR
+ }
return (*struct {
f func(*libc.TLS, uintptr, Sqlite3_int64, Sqlite3_int64) int32
})(unsafe.Pointer(&struct{ uintptr }{xSetMapping})).f(tls, pRtree, iRowid, (*RtreeNode)(unsafe.Pointer(pNode)).FiNode)
}
-func sSplitNode(tls *libc.TLS, pRtree uintptr, pNode uintptr, pCell uintptr, iHeight int32) int32 { /* sqlite3.c:194817:12: */
+func sSplitNode(tls *libc.TLS, pRtree uintptr, pNode uintptr, pCell uintptr, iHeight int32) int32 { /* sqlite3.c:196484:12: */
bp := tls.Alloc(100)
defer tls.Free(100)
@@ -154960,28 +157194,28 @@ func sSplitNode(tls *libc.TLS, pRtree uintptr, pNode uintptr, pCell uintptr, iHe
var iRowid1 I64
newCellIsRight = 0
rc = SQLITE_OK
- nCell = readInt16(tls, ((*RtreeNode)(unsafe.Pointer((pNode))).FzData + 2))
+ nCell = readInt16(tls, (*RtreeNode)(unsafe.Pointer(pNode)).FzData+2)
pLeft = uintptr(0)
pRight = uintptr(0)
// Allocate an array and populate it with a copy of pCell and
// all cells from node pLeft. Then zero the original node.
- aCell = Xsqlite3_malloc64(tls, (uint64((uint32(unsafe.Sizeof(RtreeCell{})) + uint32(unsafe.Sizeof(int32(0)))) * (uint32(nCell + 1)))))
- if !(!(aCell != 0)) {
+ aCell = Xsqlite3_malloc64(tls, uint64((uint32(unsafe.Sizeof(RtreeCell{}))+uint32(unsafe.Sizeof(int32(0))))*uint32(nCell+1)))
+ if !!(aCell != 0) {
goto __1
}
rc = SQLITE_NOMEM
goto splitnode_out
__1:
;
- aiUsed = (aCell + uintptr((nCell+1))*48)
- libc.Xmemset(tls, aiUsed, 0, (uint32(unsafe.Sizeof(int32(0))) * (uint32(nCell + 1))))
+ aiUsed = aCell + uintptr(nCell+1)*48
+ libc.Xmemset(tls, aiUsed, 0, uint32(unsafe.Sizeof(int32(0)))*uint32(nCell+1))
i = 0
__2:
if !(i < nCell) {
goto __4
}
- nodeGetCell(tls, pRtree, pNode, i, (aCell + uintptr(i)*48))
+ nodeGetCell(tls, pRtree, pNode, i, aCell+uintptr(i)*48)
goto __3
__3:
i++
@@ -154990,7 +157224,7 @@ __3:
__4:
;
nodeZero(tls, pRtree, pNode)
- libc.Xmemcpy(tls, (aCell + uintptr(nCell)*48), pCell, uint32(unsafe.Sizeof(RtreeCell{})))
+ libc.Xmemcpy(tls, aCell+uintptr(nCell)*48, pCell, uint32(unsafe.Sizeof(RtreeCell{})))
nCell++
if !((*RtreeNode)(unsafe.Pointer(pNode)).FiNode == int64(1)) {
@@ -155033,8 +157267,8 @@ __8:
// nodeWrite(). Node pRight always needs a node number, as it was created
// by nodeNew() above. But node pLeft sometimes already has a node number.
// In this case avoid the all to nodeWrite().
- if !((SQLITE_OK != (libc.AssignInt32(&rc, nodeWrite(tls, pRtree, pRight)))) ||
- ((int64(0) == (*RtreeNode)(unsafe.Pointer(pLeft)).FiNode) && (SQLITE_OK != (libc.AssignInt32(&rc, nodeWrite(tls, pRtree, pLeft)))))) {
+ if !(SQLITE_OK != libc.AssignInt32(&rc, nodeWrite(tls, pRtree, pRight)) ||
+ int64(0) == (*RtreeNode)(unsafe.Pointer(pLeft)).FiNode && SQLITE_OK != libc.AssignInt32(&rc, nodeWrite(tls, pRtree, pLeft))) {
goto __9
}
goto splitnode_out
@@ -155047,7 +157281,7 @@ __9:
if !((*RtreeNode)(unsafe.Pointer(pNode)).FiNode == int64(1)) {
goto __10
}
- rc = rtreeInsertCell(tls, pRtree, (*RtreeNode)(unsafe.Pointer(pLeft)).FpParent, bp /* &leftbbox */, (iHeight + 1))
+ rc = rtreeInsertCell(tls, pRtree, (*RtreeNode)(unsafe.Pointer(pLeft)).FpParent, bp /* &leftbbox */, iHeight+1)
if !(rc != SQLITE_OK) {
goto __12
}
@@ -155063,6 +157297,7 @@ __10:
}
nodeOverwriteCell(tls, pRtree, pParent, bp /* &leftbbox */, *(*int32)(unsafe.Pointer(bp + 96 /* iCell */)))
rc = sAdjustTree(tls, pRtree, pParent, bp /* &leftbbox */)
+
__13:
;
if !(rc != SQLITE_OK) {
@@ -155073,7 +157308,7 @@ __14:
;
__11:
;
- if !(libc.AssignInt32(&rc, rtreeInsertCell(tls, pRtree, (*RtreeNode)(unsafe.Pointer(pRight)).FpParent, bp+48 /* &rightbbox */, (iHeight+1))) != 0) {
+ if !(libc.AssignInt32(&rc, rtreeInsertCell(tls, pRtree, (*RtreeNode)(unsafe.Pointer(pRight)).FpParent, bp+48, iHeight+1)) != 0) {
goto __15
}
goto splitnode_out
@@ -155082,7 +157317,7 @@ __15:
i = 0
__16:
- if !(i < readInt16(tls, ((*RtreeNode)(unsafe.Pointer((pRight))).FzData+2))) {
+ if !(i < readInt16(tls, (*RtreeNode)(unsafe.Pointer(pRight)).FzData+2)) {
goto __18
}
iRowid = nodeGetRowid(tls, pRtree, pRight, i)
@@ -155111,7 +157346,7 @@ __18:
}
i = 0
__23:
- if !(i < readInt16(tls, ((*RtreeNode)(unsafe.Pointer((pLeft))).FzData+2))) {
+ if !(i < readInt16(tls, (*RtreeNode)(unsafe.Pointer(pLeft)).FzData+2)) {
goto __25
}
iRowid1 = nodeGetRowid(tls, pRtree, pLeft, i)
@@ -155171,10 +157406,10 @@ splitnode_out:
// rowid of the row to delete, which can be used to find the leaf on which
// the entry resides (argument pLeaf). Once the leaf is located, this
// function is called to determine its ancestry.
-func fixLeafParent(tls *libc.TLS, pRtree uintptr, pLeaf uintptr) int32 { /* sqlite3.c:194964:12: */
+func fixLeafParent(tls *libc.TLS, pRtree uintptr, pLeaf uintptr) int32 { /* sqlite3.c:196632:12: */
var rc int32 = SQLITE_OK
var pChild uintptr = pLeaf
- for ((rc == SQLITE_OK) && ((*RtreeNode)(unsafe.Pointer(pChild)).FiNode != int64(1))) && ((*RtreeNode)(unsafe.Pointer(pChild)).FpParent == uintptr(0)) {
+ for rc == SQLITE_OK && (*RtreeNode)(unsafe.Pointer(pChild)).FiNode != int64(1) && (*RtreeNode)(unsafe.Pointer(pChild)).FpParent == uintptr(0) {
var rc2 int32 = SQLITE_OK // sqlite3_reset() return code
Xsqlite3_bind_int64(tls, (*Rtree)(unsafe.Pointer(pRtree)).FpReadParent, 1, (*RtreeNode)(unsafe.Pointer(pChild)).FiNode)
rc = Xsqlite3_step(tls, (*Rtree)(unsafe.Pointer(pRtree)).FpReadParent)
@@ -155187,26 +157422,26 @@ func fixLeafParent(tls *libc.TLS, pRtree uintptr, pLeaf uintptr) int32 { /* sqli
// want to do this as it leads to a memory leak when trying to delete
// the referenced counted node structures.
iNode = Xsqlite3_column_int64(tls, (*Rtree)(unsafe.Pointer(pRtree)).FpReadParent, 0)
- for pTest = pLeaf; (pTest != 0) && ((*RtreeNode)(unsafe.Pointer(pTest)).FiNode != iNode); pTest = (*RtreeNode)(unsafe.Pointer(pTest)).FpParent {
+ for pTest = pLeaf; pTest != 0 && (*RtreeNode)(unsafe.Pointer(pTest)).FiNode != iNode; pTest = (*RtreeNode)(unsafe.Pointer(pTest)).FpParent {
}
- if !(pTest != 0) {
- rc2 = nodeAcquire(tls, pRtree, iNode, uintptr(0), (pChild /* &.pParent */))
+ if pTest == uintptr(0) {
+ rc2 = nodeAcquire(tls, pRtree, iNode, uintptr(0), pChild)
}
}
rc = Xsqlite3_reset(tls, (*Rtree)(unsafe.Pointer(pRtree)).FpReadParent)
if rc == SQLITE_OK {
rc = rc2
}
- if (rc == SQLITE_OK) && !(int32((*RtreeNode)(unsafe.Pointer(pChild)).FpParent) != 0) {
+ if rc == SQLITE_OK && !(int32((*RtreeNode)(unsafe.Pointer(pChild)).FpParent) != 0) {
- rc = (SQLITE_CORRUPT | (int32(1) << 8))
+ rc = SQLITE_CORRUPT | int32(1)<<8
}
pChild = (*RtreeNode)(unsafe.Pointer(pChild)).FpParent
}
return rc
}
-func removeNode(tls *libc.TLS, pRtree uintptr, pNode uintptr, iHeight int32) int32 { /* sqlite3.c:194999:12: */
+func removeNode(tls *libc.TLS, pRtree uintptr, pNode uintptr, iHeight int32) int32 { /* sqlite3.c:196667:12: */
bp := tls.Alloc(4)
defer tls.Free(4)
@@ -155220,7 +157455,8 @@ func removeNode(tls *libc.TLS, pRtree uintptr, pNode uintptr, iHeight int32) int
if rc == SQLITE_OK {
pParent = (*RtreeNode)(unsafe.Pointer(pNode)).FpParent
(*RtreeNode)(unsafe.Pointer(pNode)).FpParent = uintptr(0)
- rc = deleteCell(tls, pRtree, pParent, *(*int32)(unsafe.Pointer(bp /* iCell */)), (iHeight + 1))
+ rc = deleteCell(tls, pRtree, pParent, *(*int32)(unsafe.Pointer(bp /* iCell */)), iHeight+1)
+
}
rc2 = nodeRelease(tls, pRtree, pParent)
if rc == SQLITE_OK {
@@ -155233,14 +157469,14 @@ func removeNode(tls *libc.TLS, pRtree uintptr, pNode uintptr, iHeight int32) int
// Remove the xxx_node entry.
Xsqlite3_bind_int64(tls, (*Rtree)(unsafe.Pointer(pRtree)).FpDeleteNode, 1, (*RtreeNode)(unsafe.Pointer(pNode)).FiNode)
Xsqlite3_step(tls, (*Rtree)(unsafe.Pointer(pRtree)).FpDeleteNode)
- if SQLITE_OK != (libc.AssignInt32(&rc, Xsqlite3_reset(tls, (*Rtree)(unsafe.Pointer(pRtree)).FpDeleteNode))) {
+ if SQLITE_OK != libc.AssignInt32(&rc, Xsqlite3_reset(tls, (*Rtree)(unsafe.Pointer(pRtree)).FpDeleteNode)) {
return rc
}
// Remove the xxx_parent entry.
Xsqlite3_bind_int64(tls, (*Rtree)(unsafe.Pointer(pRtree)).FpDeleteParent, 1, (*RtreeNode)(unsafe.Pointer(pNode)).FiNode)
Xsqlite3_step(tls, (*Rtree)(unsafe.Pointer(pRtree)).FpDeleteParent)
- if SQLITE_OK != (libc.AssignInt32(&rc, Xsqlite3_reset(tls, (*Rtree)(unsafe.Pointer(pRtree)).FpDeleteParent))) {
+ if SQLITE_OK != libc.AssignInt32(&rc, Xsqlite3_reset(tls, (*Rtree)(unsafe.Pointer(pRtree)).FpDeleteParent)) {
return rc
}
@@ -155255,7 +157491,7 @@ func removeNode(tls *libc.TLS, pRtree uintptr, pNode uintptr, iHeight int32) int
return SQLITE_OK
}
-func fixBoundingBox(tls *libc.TLS, pRtree uintptr, pNode uintptr) int32 { /* sqlite3.c:195048:12: */
+func fixBoundingBox(tls *libc.TLS, pRtree uintptr, pNode uintptr) int32 { /* sqlite3.c:196717:12: */
bp := tls.Alloc(100)
defer tls.Free(100)
@@ -155264,7 +157500,7 @@ func fixBoundingBox(tls *libc.TLS, pRtree uintptr, pNode uintptr) int32 { /* sql
if pParent != 0 {
// var ii int32 at bp+96, 4
- var nCell int32 = readInt16(tls, ((*RtreeNode)(unsafe.Pointer((pNode))).FzData + 2))
+ var nCell int32 = readInt16(tls, (*RtreeNode)(unsafe.Pointer(pNode)).FzData+2)
// var box RtreeCell at bp, 48
// Bounding box for pNode
nodeGetCell(tls, pRtree, pNode, 0, bp /* &box */)
@@ -155286,11 +157522,11 @@ func fixBoundingBox(tls *libc.TLS, pRtree uintptr, pNode uintptr) int32 { /* sql
// Delete the cell at index iCell of node pNode. After removing the
// cell, adjust the r-tree data structure if required.
-func deleteCell(tls *libc.TLS, pRtree uintptr, pNode uintptr, iCell int32, iHeight int32) int32 { /* sqlite3.c:195075:12: */
+func deleteCell(tls *libc.TLS, pRtree uintptr, pNode uintptr, iCell int32, iHeight int32) int32 { /* sqlite3.c:196744:12: */
var pParent uintptr
var rc int32
- if SQLITE_OK != (libc.AssignInt32(&rc, fixLeafParent(tls, pRtree, pNode))) {
+ if SQLITE_OK != libc.AssignInt32(&rc, fixLeafParent(tls, pRtree, pNode)) {
return rc
}
@@ -155305,7 +157541,7 @@ func deleteCell(tls *libc.TLS, pRtree uintptr, pNode uintptr, iCell int32, iHeig
pParent = (*RtreeNode)(unsafe.Pointer(pNode)).FpParent
if pParent != 0 {
- if readInt16(tls, ((*RtreeNode)(unsafe.Pointer((pNode))).FzData+2)) < ((((*Rtree)(unsafe.Pointer((pRtree))).FiNodeSize - 4) / int32((*Rtree)(unsafe.Pointer((pRtree))).FnBytesPerCell)) / 3) {
+ if readInt16(tls, (*RtreeNode)(unsafe.Pointer(pNode)).FzData+2) < ((*Rtree)(unsafe.Pointer(pRtree)).FiNodeSize-4)/int32((*Rtree)(unsafe.Pointer(pRtree)).FnBytesPerCell)/3 {
rc = removeNode(tls, pRtree, pNode, iHeight)
} else {
rc = fixBoundingBox(tls, pRtree, pNode)
@@ -155315,7 +157551,7 @@ func deleteCell(tls *libc.TLS, pRtree uintptr, pNode uintptr, iCell int32, iHeig
return rc
}
-func sReinsert(tls *libc.TLS, pRtree uintptr, pNode uintptr, pCell uintptr, iHeight int32) int32 { /* sqlite3.c:195106:12: */
+func sReinsert(tls *libc.TLS, pRtree uintptr, pNode uintptr, pCell uintptr, iHeight int32) int32 { /* sqlite3.c:196775:12: */
bp := tls.Alloc(44)
defer tls.Free(44)
@@ -155331,70 +157567,70 @@ func sReinsert(tls *libc.TLS, pRtree uintptr, pNode uintptr, pCell uintptr, iHei
var rc int32 = SQLITE_OK
var n int32
- libc.Xmemset(tls, bp /* &aCenterCoord[0] */, 0, (uint32(unsafe.Sizeof(RtreeDValue(0))) * uint32(RTREE_MAX_DIMENSIONS)))
+ libc.Xmemset(tls, bp /* &aCenterCoord[0] */, 0, uint32(unsafe.Sizeof(RtreeDValue(0)))*uint32(RTREE_MAX_DIMENSIONS))
- nCell = (readInt16(tls, ((*RtreeNode)(unsafe.Pointer((pNode))).FzData+2)) + 1)
- n = ((nCell + 1) & (libc.CplInt32(1)))
+ nCell = readInt16(tls, (*RtreeNode)(unsafe.Pointer(pNode)).FzData+2) + 1
+ n = (nCell + 1) & libc.CplInt32(1)
// Allocate the buffers used by this operation. The allocation is
// relinquished before this function returns.
- aCell = Xsqlite3_malloc64(tls, (uint64(uint32(n) * (((uint32(unsafe.Sizeof(RtreeCell{})) + uint32(unsafe.Sizeof(int32(0)))) + uint32(unsafe.Sizeof(int32(0)))) + uint32(unsafe.Sizeof(RtreeDValue(0)))))))
+ aCell = Xsqlite3_malloc64(tls, uint64(uint32(n)*(uint32(unsafe.Sizeof(RtreeCell{}))+uint32(unsafe.Sizeof(int32(0)))+uint32(unsafe.Sizeof(int32(0)))+uint32(unsafe.Sizeof(RtreeDValue(0))))))
if !(aCell != 0) {
return SQLITE_NOMEM
}
- aOrder = (aCell + uintptr(n)*48)
- aSpare = (aOrder + uintptr(n)*4)
- aDistance = (aSpare + uintptr(n)*4)
+ aOrder = aCell + uintptr(n)*48
+ aSpare = aOrder + uintptr(n)*4
+ aDistance = aSpare + uintptr(n)*4
for ii = 0; ii < nCell; ii++ {
- if ii == (nCell - 1) {
- libc.Xmemcpy(tls, (aCell + uintptr(ii)*48), pCell, uint32(unsafe.Sizeof(RtreeCell{})))
+ if ii == nCell-1 {
+ libc.Xmemcpy(tls, aCell+uintptr(ii)*48, pCell, uint32(unsafe.Sizeof(RtreeCell{})))
} else {
- nodeGetCell(tls, pRtree, pNode, ii, (aCell + uintptr(ii)*48))
+ nodeGetCell(tls, pRtree, pNode, ii, aCell+uintptr(ii)*48)
}
*(*int32)(unsafe.Pointer(aOrder + uintptr(ii)*4)) = ii
for iDim = 0; iDim < int32((*Rtree)(unsafe.Pointer(pRtree)).FnDim); iDim++ {
- *(*RtreeDValue)(unsafe.Pointer(bp /* &aCenterCoord */ + uintptr(iDim)*8)) += (func() float64 {
+ *(*RtreeDValue)(unsafe.Pointer(bp + uintptr(iDim)*8)) += func() float64 {
if int32((*Rtree)(unsafe.Pointer(pRtree)).FeCoordType) == RTREE_COORD_REAL32 {
- return float64(*(*RtreeValue)(unsafe.Pointer((aCell + uintptr(ii)*48 + 8 /* &.aCoord */) + uintptr((iDim*2))*4)))
+ return float64(*(*RtreeValue)(unsafe.Pointer(aCell + uintptr(ii)*48 + 8 + uintptr(iDim*2)*4)))
}
- return float64(*(*int32)(unsafe.Pointer((aCell + uintptr(ii)*48 + 8 /* &.aCoord */) + uintptr((iDim*2))*4)))
- }())
- *(*RtreeDValue)(unsafe.Pointer(bp /* &aCenterCoord */ + uintptr(iDim)*8)) += (func() float64 {
+ return float64(*(*int32)(unsafe.Pointer(aCell + uintptr(ii)*48 + 8 + uintptr(iDim*2)*4)))
+ }()
+ *(*RtreeDValue)(unsafe.Pointer(bp + uintptr(iDim)*8)) += func() float64 {
if int32((*Rtree)(unsafe.Pointer(pRtree)).FeCoordType) == RTREE_COORD_REAL32 {
- return float64(*(*RtreeValue)(unsafe.Pointer((aCell + uintptr(ii)*48 + 8 /* &.aCoord */) + uintptr(((iDim*2)+1))*4)))
+ return float64(*(*RtreeValue)(unsafe.Pointer(aCell + uintptr(ii)*48 + 8 + uintptr(iDim*2+1)*4)))
}
- return float64(*(*int32)(unsafe.Pointer((aCell + uintptr(ii)*48 + 8 /* &.aCoord */) + uintptr(((iDim*2)+1))*4)))
- }())
+ return float64(*(*int32)(unsafe.Pointer(aCell + uintptr(ii)*48 + 8 + uintptr(iDim*2+1)*4)))
+ }()
}
}
for iDim = 0; iDim < int32((*Rtree)(unsafe.Pointer(pRtree)).FnDim); iDim++ {
- *(*RtreeDValue)(unsafe.Pointer(bp /* &aCenterCoord[0] */ + uintptr(iDim)*8)) = (*(*RtreeDValue)(unsafe.Pointer(bp /* &aCenterCoord[0] */ + uintptr(iDim)*8)) / (float64(nCell) * RtreeDValue(2)))
+ *(*RtreeDValue)(unsafe.Pointer(bp /* &aCenterCoord[0] */ + uintptr(iDim)*8)) = *(*RtreeDValue)(unsafe.Pointer(bp + uintptr(iDim)*8)) / (float64(nCell) * RtreeDValue(2))
}
for ii = 0; ii < nCell; ii++ {
*(*RtreeDValue)(unsafe.Pointer(aDistance + uintptr(ii)*8)) = 0.0
for iDim = 0; iDim < int32((*Rtree)(unsafe.Pointer(pRtree)).FnDim); iDim++ {
- var coord RtreeDValue = ((func() float64 {
+ var coord RtreeDValue = func() float64 {
if int32((*Rtree)(unsafe.Pointer(pRtree)).FeCoordType) == RTREE_COORD_REAL32 {
- return float64(*(*RtreeValue)(unsafe.Pointer((aCell + uintptr(ii)*48 + 8 /* &.aCoord */) + uintptr(((iDim*2)+1))*4)))
+ return float64(*(*RtreeValue)(unsafe.Pointer(aCell + uintptr(ii)*48 + 8 + uintptr(iDim*2+1)*4)))
}
- return float64(*(*int32)(unsafe.Pointer((aCell + uintptr(ii)*48 + 8 /* &.aCoord */) + uintptr(((iDim*2)+1))*4)))
- }()) - (func() float64 {
+ return float64(*(*int32)(unsafe.Pointer(aCell + uintptr(ii)*48 + 8 + uintptr(iDim*2+1)*4)))
+ }() - func() float64 {
if int32((*Rtree)(unsafe.Pointer(pRtree)).FeCoordType) == RTREE_COORD_REAL32 {
- return float64(*(*RtreeValue)(unsafe.Pointer((aCell + uintptr(ii)*48 + 8 /* &.aCoord */) + uintptr((iDim*2))*4)))
+ return float64(*(*RtreeValue)(unsafe.Pointer(aCell + uintptr(ii)*48 + 8 + uintptr(iDim*2)*4)))
}
- return float64(*(*int32)(unsafe.Pointer((aCell + uintptr(ii)*48 + 8 /* &.aCoord */) + uintptr((iDim*2))*4)))
- }()))
- *(*RtreeDValue)(unsafe.Pointer(aDistance + uintptr(ii)*8)) += ((coord - *(*RtreeDValue)(unsafe.Pointer(bp /* &aCenterCoord[0] */ + uintptr(iDim)*8))) * (coord - *(*RtreeDValue)(unsafe.Pointer(bp /* &aCenterCoord[0] */ + uintptr(iDim)*8))))
+ return float64(*(*int32)(unsafe.Pointer(aCell + uintptr(ii)*48 + 8 + uintptr(iDim*2)*4)))
+ }()
+ *(*RtreeDValue)(unsafe.Pointer(aDistance + uintptr(ii)*8)) += (coord - *(*RtreeDValue)(unsafe.Pointer(bp + uintptr(iDim)*8))) * (coord - *(*RtreeDValue)(unsafe.Pointer(bp + uintptr(iDim)*8)))
}
}
sSortByDistance(tls, aOrder, nCell, aDistance, aSpare)
nodeZero(tls, pRtree, pNode)
- for ii = 0; (rc == SQLITE_OK) && (ii < (nCell - (((((*Rtree)(unsafe.Pointer((pRtree))).FiNodeSize - 4) / int32((*Rtree)(unsafe.Pointer((pRtree))).FnBytesPerCell)) / 3) + 1))); ii++ {
- var p uintptr = (aCell + uintptr(*(*int32)(unsafe.Pointer(aOrder + uintptr(ii)*4)))*48)
+ for ii = 0; rc == SQLITE_OK && ii < nCell-(((*Rtree)(unsafe.Pointer(pRtree)).FiNodeSize-4)/int32((*Rtree)(unsafe.Pointer(pRtree)).FnBytesPerCell)/3+1); ii++ {
+ var p uintptr = aCell + uintptr(*(*int32)(unsafe.Pointer(aOrder + uintptr(ii)*4)))*48
nodeInsertCell(tls, pRtree, pNode, p)
if (*RtreeCell)(unsafe.Pointer(p)).FiRowid == (*RtreeCell)(unsafe.Pointer(pCell)).FiRowid {
if iHeight == 0 {
@@ -155407,12 +157643,12 @@ func sReinsert(tls *libc.TLS, pRtree uintptr, pNode uintptr, pCell uintptr, iHei
if rc == SQLITE_OK {
rc = fixBoundingBox(tls, pRtree, pNode)
}
- for ; (rc == SQLITE_OK) && (ii < nCell); ii++ {
+ for ; rc == SQLITE_OK && ii < nCell; ii++ {
// Find a node to store this cell in. pNode->iNode currently contains
// the height of the sub-tree headed by the cell.
// var pInsert uintptr at bp+40, 4
- var p uintptr = (aCell + uintptr(*(*int32)(unsafe.Pointer(aOrder + uintptr(ii)*4)))*48)
+ var p uintptr = aCell + uintptr(*(*int32)(unsafe.Pointer(aOrder + uintptr(ii)*4)))*48
rc = sChooseLeaf(tls, pRtree, p, iHeight, bp+40 /* &pInsert */)
if rc == SQLITE_OK {
var rc2 int32
@@ -155430,7 +157666,7 @@ func sReinsert(tls *libc.TLS, pRtree uintptr, pNode uintptr, pCell uintptr, iHei
// Insert cell pCell into node pNode. Node pNode is the head of a
// subtree iHeight high (leaf nodes have iHeight==0).
-func rtreeInsertCell(tls *libc.TLS, pRtree uintptr, pNode uintptr, pCell uintptr, iHeight int32) int32 { /* sqlite3.c:195211:12: */
+func rtreeInsertCell(tls *libc.TLS, pRtree uintptr, pNode uintptr, pCell uintptr, iHeight int32) int32 { /* sqlite3.c:196880:12: */
var rc int32 = SQLITE_OK
if iHeight > 0 {
var pChild uintptr = nodeHashLookup(tls, pRtree, (*RtreeCell)(unsafe.Pointer(pCell)).FiRowid)
@@ -155441,7 +157677,7 @@ func rtreeInsertCell(tls *libc.TLS, pRtree uintptr, pNode uintptr, pCell uintptr
}
}
if nodeInsertCell(tls, pRtree, pNode, pCell) != 0 {
- if (iHeight <= (*Rtree)(unsafe.Pointer(pRtree)).FiReinsertHeight) || ((*RtreeNode)(unsafe.Pointer(pNode)).FiNode == int64(1)) {
+ if iHeight <= (*Rtree)(unsafe.Pointer(pRtree)).FiReinsertHeight || (*RtreeNode)(unsafe.Pointer(pNode)).FiNode == int64(1) {
rc = sSplitNode(tls, pRtree, pNode, pCell, iHeight)
} else {
(*Rtree)(unsafe.Pointer(pRtree)).FiReinsertHeight = iHeight
@@ -155460,15 +157696,15 @@ func rtreeInsertCell(tls *libc.TLS, pRtree uintptr, pNode uintptr, pCell uintptr
return rc
}
-func reinsertNodeContent(tls *libc.TLS, pRtree uintptr, pNode uintptr) int32 { /* sqlite3.c:195246:12: */
+func reinsertNodeContent(tls *libc.TLS, pRtree uintptr, pNode uintptr) int32 { /* sqlite3.c:196915:12: */
bp := tls.Alloc(52)
defer tls.Free(52)
var ii int32
var rc int32 = SQLITE_OK
- var nCell int32 = readInt16(tls, ((*RtreeNode)(unsafe.Pointer((pNode))).FzData + 2))
+ var nCell int32 = readInt16(tls, (*RtreeNode)(unsafe.Pointer(pNode)).FzData+2)
- for ii = 0; (rc == SQLITE_OK) && (ii < nCell); ii++ {
+ for ii = 0; rc == SQLITE_OK && ii < nCell; ii++ {
// var pInsert uintptr at bp+48, 4
// var cell RtreeCell at bp, 48
@@ -155491,7 +157727,7 @@ func reinsertNodeContent(tls *libc.TLS, pRtree uintptr, pNode uintptr) int32 { /
}
// Select a currently unused rowid for a new r-tree record.
-func rtreeNewRowid(tls *libc.TLS, pRtree uintptr, piRowid uintptr) int32 { /* sqlite3.c:195275:12: */
+func rtreeNewRowid(tls *libc.TLS, pRtree uintptr, piRowid uintptr) int32 { /* sqlite3.c:196944:12: */
var rc int32
Xsqlite3_bind_null(tls, (*Rtree)(unsafe.Pointer(pRtree)).FpWriteRowid, 1)
Xsqlite3_bind_null(tls, (*Rtree)(unsafe.Pointer(pRtree)).FpWriteRowid, 2)
@@ -155502,7 +157738,7 @@ func rtreeNewRowid(tls *libc.TLS, pRtree uintptr, piRowid uintptr) int32 { /* sq
}
// Remove the entry with rowid=iDelete from the r-tree structure.
-func rtreeDeleteRowid(tls *libc.TLS, pRtree uintptr, iDelete Sqlite3_int64) int32 { /* sqlite3.c:195288:12: */
+func rtreeDeleteRowid(tls *libc.TLS, pRtree uintptr, iDelete Sqlite3_int64) int32 { /* sqlite3.c:196957:12: */
bp := tls.Alloc(16)
defer tls.Free(16)
@@ -155522,7 +157758,7 @@ func rtreeDeleteRowid(tls *libc.TLS, pRtree uintptr, iDelete Sqlite3_int64) int3
}
// Delete the cell in question from the leaf node.
- if (rc == SQLITE_OK) && (*(*uintptr)(unsafe.Pointer(bp + 4 /* pLeaf */)) != 0) {
+ if rc == SQLITE_OK && *(*uintptr)(unsafe.Pointer(bp + 4)) != 0 {
var rc2 int32
rc = nodeRowidIndex(tls, pRtree, *(*uintptr)(unsafe.Pointer(bp + 4 /* pLeaf */)), iDelete, bp+8 /* &iCell */)
if rc == SQLITE_OK {
@@ -155548,13 +157784,13 @@ func rtreeDeleteRowid(tls *libc.TLS, pRtree uintptr, iDelete Sqlite3_int64) int3
// This is equivalent to copying the contents of the child into
// the root node (the operation that Gutman's paper says to perform
// in this scenario).
- if ((rc == SQLITE_OK) && ((*Rtree)(unsafe.Pointer(pRtree)).FiDepth > 0)) && (readInt16(tls, ((*RtreeNode)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(bp /* pRoot */))))).FzData+2)) == 1) {
+ if rc == SQLITE_OK && (*Rtree)(unsafe.Pointer(pRtree)).FiDepth > 0 && readInt16(tls, (*RtreeNode)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FzData+2) == 1 {
var rc2 int32
*(*uintptr)(unsafe.Pointer(bp + 12 /* pChild */)) = uintptr(0)
var iChild I64 = nodeGetRowid(tls, pRtree, *(*uintptr)(unsafe.Pointer(bp /* pRoot */)), 0)
- rc = nodeAcquire(tls, pRtree, iChild, *(*uintptr)(unsafe.Pointer(bp /* pRoot */)), bp+12 /* &pChild */)
+ rc = nodeAcquire(tls, pRtree, iChild, *(*uintptr)(unsafe.Pointer(bp /* pRoot */)), bp+12 /* &pChild */) // tag-20210916a
if rc == SQLITE_OK {
- rc = removeNode(tls, pRtree, *(*uintptr)(unsafe.Pointer(bp + 12 /* pChild */)), ((*Rtree)(unsafe.Pointer(pRtree)).FiDepth - 1))
+ rc = removeNode(tls, pRtree, *(*uintptr)(unsafe.Pointer(bp + 12 /* pChild */)), (*Rtree)(unsafe.Pointer(pRtree)).FiDepth-1)
}
rc2 = nodeRelease(tls, pRtree, *(*uintptr)(unsafe.Pointer(bp + 12 /* pChild */)))
if rc == SQLITE_OK {
@@ -155591,30 +157827,30 @@ func rtreeDeleteRowid(tls *libc.TLS, pRtree uintptr, iDelete Sqlite3_int64) int3
// Convert an sqlite3_value into an RtreeValue (presumably a float)
// while taking care to round toward negative or positive, respectively.
-func rtreeValueDown(tls *libc.TLS, v uintptr) RtreeValue { /* sqlite3.c:195385:19: */
+func rtreeValueDown(tls *libc.TLS, v uintptr) RtreeValue { /* sqlite3.c:197054:19: */
var d float64 = Xsqlite3_value_double(tls, v)
var f float32 = float32(d)
if float64(f) > d {
- f = (float32(d * (func() float64 {
+ f = float32(d * func() float64 {
if d < float64(0) {
- return (float64(1.0) + (float64(1.0) / 8388608.0))
+ return float64(1.0) + float64(1.0)/8388608.0
}
- return (float64(1.0) - (float64(1.0) / 8388608.0))
- }())))
+ return float64(1.0) - float64(1.0)/8388608.0
+ }())
}
return f
}
-func rtreeValueUp(tls *libc.TLS, v uintptr) RtreeValue { /* sqlite3.c:195393:19: */
+func rtreeValueUp(tls *libc.TLS, v uintptr) RtreeValue { /* sqlite3.c:197062:19: */
var d float64 = Xsqlite3_value_double(tls, v)
var f float32 = float32(d)
if float64(f) < d {
- f = (float32(d * (func() float64 {
+ f = float32(d * func() float64 {
if d < float64(0) {
- return (float64(1.0) - (float64(1.0) / 8388608.0))
+ return float64(1.0) - float64(1.0)/8388608.0
}
- return (float64(1.0) + (float64(1.0) / 8388608.0))
- }())))
+ return float64(1.0) + float64(1.0)/8388608.0
+ }())
}
return f
}
@@ -155630,7 +157866,7 @@ func rtreeValueUp(tls *libc.TLS, v uintptr) RtreeValue { /* sqlite3.c:195393:19:
// (c1<=c2) constraint on columns iCol and iCol+1 that has failed.
//
// If an OOM occurs, SQLITE_NOMEM is returned instead of SQLITE_CONSTRAINT.
-func rtreeConstraintError(tls *libc.TLS, pRtree uintptr, iCol int32) int32 { /* sqlite3.c:195416:12: */
+func rtreeConstraintError(tls *libc.TLS, pRtree uintptr, iCol int32) int32 { /* sqlite3.c:197085:12: */
bp := tls.Alloc(60)
defer tls.Free(60)
@@ -155638,7 +157874,7 @@ func rtreeConstraintError(tls *libc.TLS, pRtree uintptr, iCol int32) int32 { /*
var zSql uintptr
var rc int32
- zSql = Xsqlite3_mprintf(tls, ts+23417 /* "SELECT * FROM %Q..." */, libc.VaList(bp, (*Rtree)(unsafe.Pointer(pRtree)).FzDb, (*Rtree)(unsafe.Pointer(pRtree)).FzName))
+ zSql = Xsqlite3_mprintf(tls, ts+24714 /* "SELECT * FROM %Q..." */, libc.VaList(bp, (*Rtree)(unsafe.Pointer(pRtree)).FzDb, (*Rtree)(unsafe.Pointer(pRtree)).FzName))
if zSql != 0 {
rc = Xsqlite3_prepare_v2(tls, (*Rtree)(unsafe.Pointer(pRtree)).Fdb, zSql, -1, bp+56 /* &pStmt */, uintptr(0))
} else {
@@ -155650,12 +157886,12 @@ func rtreeConstraintError(tls *libc.TLS, pRtree uintptr, iCol int32) int32 { /*
if iCol == 0 {
var zCol uintptr = Xsqlite3_column_name(tls, *(*uintptr)(unsafe.Pointer(bp + 56 /* pStmt */)), 0)
(*Rtree)(unsafe.Pointer(pRtree)).Fbase.FzErrMsg = Xsqlite3_mprintf(tls,
- ts+23437 /* "UNIQUE constrain..." */, libc.VaList(bp+16, (*Rtree)(unsafe.Pointer(pRtree)).FzName, zCol))
+ ts+24734 /* "UNIQUE constrain..." */, libc.VaList(bp+16, (*Rtree)(unsafe.Pointer(pRtree)).FzName, zCol))
} else {
var zCol1 uintptr = Xsqlite3_column_name(tls, *(*uintptr)(unsafe.Pointer(bp + 56 /* pStmt */)), iCol)
- var zCol2 uintptr = Xsqlite3_column_name(tls, *(*uintptr)(unsafe.Pointer(bp + 56 /* pStmt */)), (iCol + 1))
+ var zCol2 uintptr = Xsqlite3_column_name(tls, *(*uintptr)(unsafe.Pointer(bp + 56 /* pStmt */)), iCol+1)
(*Rtree)(unsafe.Pointer(pRtree)).Fbase.FzErrMsg = Xsqlite3_mprintf(tls,
- ts+23469 /* "rtree constraint..." */, libc.VaList(bp+32, (*Rtree)(unsafe.Pointer(pRtree)).FzName, zCol1, zCol2))
+ ts+24766 /* "rtree constraint..." */, libc.VaList(bp+32, (*Rtree)(unsafe.Pointer(pRtree)).FzName, zCol1, zCol2))
}
}
@@ -155669,7 +157905,7 @@ func rtreeConstraintError(tls *libc.TLS, pRtree uintptr, iCol int32) int32 { /*
}
// The xUpdate method for rtree module virtual tables.
-func rtreeUpdate(tls *libc.TLS, pVtab uintptr, nData int32, aData uintptr, pRowid uintptr) int32 { /* sqlite3.c:195454:12: */
+func rtreeUpdate(tls *libc.TLS, pVtab uintptr, nData int32, aData uintptr, pRowid uintptr) int32 { /* sqlite3.c:197123:12: */
bp := tls.Alloc(52)
defer tls.Free(52)
@@ -155696,7 +157932,7 @@ func rtreeUpdate(tls *libc.TLS, pVtab uintptr, nData int32, aData uintptr, pRowi
// Unable to write to the btree while another cursor is reading from it,
// since the write might do a rebalance which would disrupt the read
// cursor.
- return (SQLITE_LOCKED | (int32(2) << 8))
+ return SQLITE_LOCKED | int32(2)<<8
__1:
;
rtreeReference(tls, pRtree)
@@ -155716,7 +157952,7 @@ __1:
if !(nData > 1) {
goto __2
}
- nn = (nData - 4)
+ nn = nData - 4
if !(nn > int32((*Rtree)(unsafe.Pointer(pRtree)).FnDim2)) {
goto __3
@@ -155740,18 +157976,18 @@ __6:
if !(ii < nn) {
goto __8
}
- *(*RtreeValue)(unsafe.Pointer((bp /* &cell */ + 8 /* &.aCoord */) + uintptr(ii)*4)) = rtreeValueDown(tls, *(*uintptr)(unsafe.Pointer(aData + uintptr((ii+3))*4)))
- *(*RtreeValue)(unsafe.Pointer((bp /* &cell */ + 8 /* &.aCoord */) + uintptr((ii+1))*4)) = rtreeValueUp(tls, *(*uintptr)(unsafe.Pointer(aData + uintptr((ii+4))*4)))
- if !(*(*RtreeValue)(unsafe.Pointer((bp /* &cell */ + 8 /* &.aCoord */) + uintptr(ii)*4)) > *(*RtreeValue)(unsafe.Pointer((bp /* &cell */ + 8 /* &.aCoord */) + uintptr((ii+1))*4))) {
+ *(*RtreeValue)(unsafe.Pointer(bp + 8 + uintptr(ii)*4)) = rtreeValueDown(tls, *(*uintptr)(unsafe.Pointer(aData + uintptr(ii+3)*4)))
+ *(*RtreeValue)(unsafe.Pointer(bp + 8 + uintptr(ii+1)*4)) = rtreeValueUp(tls, *(*uintptr)(unsafe.Pointer(aData + uintptr(ii+4)*4)))
+ if !(*(*RtreeValue)(unsafe.Pointer(bp + 8 + uintptr(ii)*4)) > *(*RtreeValue)(unsafe.Pointer(bp + 8 + uintptr(ii+1)*4))) {
goto __9
}
- rc = rtreeConstraintError(tls, pRtree, (ii + 1))
+ rc = rtreeConstraintError(tls, pRtree, ii+1)
goto constraint
__9:
;
goto __7
__7:
- ii = ii + (2)
+ ii = ii + 2
goto __6
goto __8
__8:
@@ -155764,18 +158000,18 @@ __10:
if !(ii < nn) {
goto __12
}
- *(*int32)(unsafe.Pointer((bp /* &cell */ + 8 /* &.aCoord */) + uintptr(ii)*4)) = Xsqlite3_value_int(tls, *(*uintptr)(unsafe.Pointer(aData + uintptr((ii+3))*4)))
- *(*int32)(unsafe.Pointer((bp /* &cell */ + 8 /* &.aCoord */) + uintptr((ii+1))*4)) = Xsqlite3_value_int(tls, *(*uintptr)(unsafe.Pointer(aData + uintptr((ii+4))*4)))
- if !(*(*int32)(unsafe.Pointer((bp /* &cell */ + 8 /* &.aCoord */) + uintptr(ii)*4)) > *(*int32)(unsafe.Pointer((bp /* &cell */ + 8 /* &.aCoord */) + uintptr((ii+1))*4))) {
+ *(*int32)(unsafe.Pointer(bp + 8 + uintptr(ii)*4)) = Xsqlite3_value_int(tls, *(*uintptr)(unsafe.Pointer(aData + uintptr(ii+3)*4)))
+ *(*int32)(unsafe.Pointer(bp + 8 + uintptr(ii+1)*4)) = Xsqlite3_value_int(tls, *(*uintptr)(unsafe.Pointer(aData + uintptr(ii+4)*4)))
+ if !(*(*int32)(unsafe.Pointer(bp + 8 + uintptr(ii)*4)) > *(*int32)(unsafe.Pointer(bp + 8 + uintptr(ii+1)*4))) {
goto __13
}
- rc = rtreeConstraintError(tls, pRtree, (ii + 1))
+ rc = rtreeConstraintError(tls, pRtree, ii+1)
goto constraint
__13:
;
goto __11
__11:
- ii = ii + (2)
+ ii = ii + 2
goto __10
goto __12
__12:
@@ -155789,8 +158025,8 @@ __5:
goto __14
}
(*RtreeCell)(unsafe.Pointer(bp /* &cell */)).FiRowid = Xsqlite3_value_int64(tls, *(*uintptr)(unsafe.Pointer(aData + 2*4)))
- if !((Xsqlite3_value_type(tls, *(*uintptr)(unsafe.Pointer(aData))) == SQLITE_NULL) ||
- (Xsqlite3_value_int64(tls, *(*uintptr)(unsafe.Pointer(aData))) != (*RtreeCell)(unsafe.Pointer(bp /* &cell */)).FiRowid)) {
+ if !(Xsqlite3_value_type(tls, *(*uintptr)(unsafe.Pointer(aData))) == SQLITE_NULL ||
+ Xsqlite3_value_int64(tls, *(*uintptr)(unsafe.Pointer(aData))) != (*RtreeCell)(unsafe.Pointer(bp)).FiRowid) {
goto __15
}
Xsqlite3_bind_int64(tls, (*Rtree)(unsafe.Pointer(pRtree)).FpReadRowid, 1, (*RtreeCell)(unsafe.Pointer(bp /* &cell */)).FiRowid)
@@ -155832,7 +158068,7 @@ __19:
// If the aData[] array contains more than one element, elements
// (aData[2]..aData[argc-1]) contain a new record to insert into
// the r-tree structure.
- if !((rc == SQLITE_OK) && (nData > 1)) {
+ if !(rc == SQLITE_OK && nData > 1) {
goto __20
}
// Insert the new record into the r-tree
@@ -155842,7 +158078,7 @@ __19:
if !(bHaveRowid == 0) {
goto __21
}
- rc = rtreeNewRowid(tls, pRtree, (bp /* &cell */ /* &.iRowid */))
+ rc = rtreeNewRowid(tls, pRtree, bp)
__21:
;
*(*Sqlite_int64)(unsafe.Pointer(pRowid)) = (*RtreeCell)(unsafe.Pointer(bp /* &cell */)).FiRowid
@@ -155867,7 +158103,7 @@ __24:
;
__23:
;
- if !((rc == SQLITE_OK) && ((*Rtree)(unsafe.Pointer(pRtree)).FnAux != 0)) {
+ if !(rc == SQLITE_OK && (*Rtree)(unsafe.Pointer(pRtree)).FnAux != 0) {
goto __25
}
pUp = (*Rtree)(unsafe.Pointer(pRtree)).FpWriteAux
@@ -155877,7 +158113,7 @@ __26:
if !(jj < int32((*Rtree)(unsafe.Pointer(pRtree)).FnAux)) {
goto __28
}
- Xsqlite3_bind_value(tls, pUp, (jj + 2), *(*uintptr)(unsafe.Pointer(aData + uintptr(((int32((*Rtree)(unsafe.Pointer(pRtree)).FnDim2)+3)+jj))*4)))
+ Xsqlite3_bind_value(tls, pUp, jj+2, *(*uintptr)(unsafe.Pointer(aData + uintptr(int32((*Rtree)(unsafe.Pointer(pRtree)).FnDim2)+3+jj)*4)))
goto __27
__27:
jj++
@@ -155898,7 +158134,7 @@ constraint:
}
// Called when a transaction starts.
-func rtreeBeginTransaction(tls *libc.TLS, pVtab uintptr) int32 { /* sqlite3.c:195602:12: */
+func rtreeBeginTransaction(tls *libc.TLS, pVtab uintptr) int32 { /* sqlite3.c:197271:12: */
var pRtree uintptr = pVtab
(*Rtree)(unsafe.Pointer(pRtree)).FinWrTrans++
@@ -155907,7 +158143,7 @@ func rtreeBeginTransaction(tls *libc.TLS, pVtab uintptr) int32 { /* sqlite3.c:19
// Called when a transaction completes (either by COMMIT or ROLLBACK).
// The sqlite3_blob object should be released at this point.
-func rtreeEndTransaction(tls *libc.TLS, pVtab uintptr) int32 { /* sqlite3.c:195613:12: */
+func rtreeEndTransaction(tls *libc.TLS, pVtab uintptr) int32 { /* sqlite3.c:197282:12: */
var pRtree uintptr = pVtab
(*Rtree)(unsafe.Pointer(pRtree)).FinWrTrans = U8(0)
nodeBlobReset(tls, pRtree)
@@ -155915,7 +158151,7 @@ func rtreeEndTransaction(tls *libc.TLS, pVtab uintptr) int32 { /* sqlite3.c:1956
}
// The xRename method for rtree module virtual tables.
-func rtreeRename(tls *libc.TLS, pVtab uintptr, zNewName uintptr) int32 { /* sqlite3.c:195623:12: */
+func rtreeRename(tls *libc.TLS, pVtab uintptr, zNewName uintptr) int32 { /* sqlite3.c:197292:12: */
bp := tls.Alloc(72)
defer tls.Free(72)
@@ -155923,7 +158159,7 @@ func rtreeRename(tls *libc.TLS, pVtab uintptr, zNewName uintptr) int32 { /* sqli
var rc int32 = SQLITE_NOMEM
var zSql uintptr = Xsqlite3_mprintf(tls,
- ts+23506 /* "ALTER TABLE %Q.'..." */, libc.VaList(bp, (*Rtree)(unsafe.Pointer(pRtree)).FzDb, (*Rtree)(unsafe.Pointer(pRtree)).FzName, zNewName, (*Rtree)(unsafe.Pointer(pRtree)).FzDb, (*Rtree)(unsafe.Pointer(pRtree)).FzName, zNewName, (*Rtree)(unsafe.Pointer(pRtree)).FzDb, (*Rtree)(unsafe.Pointer(pRtree)).FzName, zNewName))
+ ts+24803 /* "ALTER TABLE %Q.'..." */, libc.VaList(bp, (*Rtree)(unsafe.Pointer(pRtree)).FzDb, (*Rtree)(unsafe.Pointer(pRtree)).FzName, zNewName, (*Rtree)(unsafe.Pointer(pRtree)).FzDb, (*Rtree)(unsafe.Pointer(pRtree)).FzName, zNewName, (*Rtree)(unsafe.Pointer(pRtree)).FzDb, (*Rtree)(unsafe.Pointer(pRtree)).FzName, zNewName))
if zSql != 0 {
nodeBlobReset(tls, pRtree)
rc = Xsqlite3_exec(tls, (*Rtree)(unsafe.Pointer(pRtree)).Fdb, zSql, uintptr(0), uintptr(0), uintptr(0))
@@ -155944,7 +158180,7 @@ func rtreeRename(tls *libc.TLS, pVtab uintptr, zNewName uintptr) int32 { /* sqli
// INSERT INTO rtree...
// DROP TABLE <tablename>; -- Would fail with SQLITE_LOCKED
// COMMIT;
-func rtreeSavepoint(tls *libc.TLS, pVtab uintptr, iSavepoint int32) int32 { /* sqlite3.c:195656:12: */
+func rtreeSavepoint(tls *libc.TLS, pVtab uintptr, iSavepoint int32) int32 { /* sqlite3.c:197325:12: */
var pRtree uintptr = pVtab
var iwt U8 = (*Rtree)(unsafe.Pointer(pRtree)).FinWrTrans
_ = iSavepoint
@@ -155957,19 +158193,19 @@ func rtreeSavepoint(tls *libc.TLS, pVtab uintptr, iSavepoint int32) int32 { /* s
// This function populates the pRtree->nRowEst variable with an estimate
// of the number of rows in the virtual table. If possible, this is based
// on sqlite_stat1 data. Otherwise, use RTREE_DEFAULT_ROWEST.
-func rtreeQueryStat1(tls *libc.TLS, db uintptr, pRtree uintptr) int32 { /* sqlite3.c:195671:12: */
+func rtreeQueryStat1(tls *libc.TLS, db uintptr, pRtree uintptr) int32 { /* sqlite3.c:197340:12: */
bp := tls.Alloc(20)
defer tls.Free(20)
- var zFmt uintptr = ts + 23651 /* "SELECT stat FROM..." */
+ var zFmt uintptr = ts + 24948 /* "SELECT stat FROM..." */
var zSql uintptr
// var p uintptr at bp+16, 4
var rc int32
- var nRow I64 = int64(0)
+ var nRow I64 = int64(RTREE_MIN_ROWEST)
rc = Xsqlite3_table_column_metadata(tls,
- db, (*Rtree)(unsafe.Pointer(pRtree)).FzDb, ts+10072 /* "sqlite_stat1" */, uintptr(0), uintptr(0), uintptr(0), uintptr(0), uintptr(0), uintptr(0))
+ db, (*Rtree)(unsafe.Pointer(pRtree)).FzDb, ts+11186 /* "sqlite_stat1" */, uintptr(0), uintptr(0), uintptr(0), uintptr(0), uintptr(0), uintptr(0))
if rc != SQLITE_OK {
(*Rtree)(unsafe.Pointer(pRtree)).FnRowEst = int64(RTREE_DEFAULT_ROWEST)
if rc == SQLITE_ERROR {
@@ -155983,37 +158219,27 @@ func rtreeQueryStat1(tls *libc.TLS, db uintptr, pRtree uintptr) int32 { /* sqlit
} else {
rc = Xsqlite3_prepare_v2(tls, db, zSql, -1, bp+16 /* &p */, uintptr(0))
if rc == SQLITE_OK {
- if Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp + 16 /* p */))) == SQLITE_ROW {
+ if Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp + 16))) == SQLITE_ROW {
nRow = Xsqlite3_column_int64(tls, *(*uintptr)(unsafe.Pointer(bp + 16 /* p */)), 0)
}
rc = Xsqlite3_finalize(tls, *(*uintptr)(unsafe.Pointer(bp + 16 /* p */)))
- } else if rc != SQLITE_NOMEM {
- rc = SQLITE_OK
- }
-
- if rc == SQLITE_OK {
- if nRow == int64(0) {
- (*Rtree)(unsafe.Pointer(pRtree)).FnRowEst = int64(RTREE_DEFAULT_ROWEST)
- } else {
- (*Rtree)(unsafe.Pointer(pRtree)).FnRowEst = func() int64 {
- if (nRow) > (int64(RTREE_MIN_ROWEST)) {
- return nRow
- }
- return int64(RTREE_MIN_ROWEST)
- }()
- }
}
Xsqlite3_free(tls, zSql)
}
-
+ (*Rtree)(unsafe.Pointer(pRtree)).FnRowEst = func() int64 {
+ if nRow > int64(RTREE_MIN_ROWEST) {
+ return nRow
+ }
+ return int64(RTREE_MIN_ROWEST)
+ }()
return rc
}
// Return true if zName is the extension on one of the shadow tables used
// by this module.
-func rtreeShadowName(tls *libc.TLS, zName uintptr) int32 { /* sqlite3.c:195715:12: */
+func rtreeShadowName(tls *libc.TLS, zName uintptr) int32 { /* sqlite3.c:197374:12: */
var i uint32
- for i = uint32(0); i < (uint32(unsafe.Sizeof(azName1)) / uint32(unsafe.Sizeof(uintptr(0)))); i++ {
+ for i = uint32(0); i < uint32(unsafe.Sizeof(azName1))/uint32(unsafe.Sizeof(uintptr(0))); i++ {
if Xsqlite3_stricmp(tls, zName, azName1[i]) == 0 {
return 1
}
@@ -156022,8 +158248,8 @@ func rtreeShadowName(tls *libc.TLS, zName uintptr) int32 { /* sqlite3.c:195715:1
}
var azName1 = [3]uintptr{
- ts + 23707 /* "node" */, ts + 4174 /* "parent" */, ts + 14757, /* "rowid" */
-} /* sqlite3.c:195716:21 */
+ ts + 25004 /* "node" */, ts + 4980 /* "parent" */, ts + 15961, /* "rowid" */
+} /* sqlite3.c:197375:21 */
var rtreeModule = Sqlite3_module{
FiVersion: 3, // iVersion
@@ -156047,9 +158273,9 @@ var rtreeModule = Sqlite3_module{
FxRename: 0, // xRename - rename the table
FxSavepoint: 0, // xRollbackTo
FxShadowName: 0, // xShadowName
-} /* sqlite3.c:195726:23 */
+} /* sqlite3.c:197385:23 */
-func rtreeSqlInit(tls *libc.TLS, pRtree uintptr, db uintptr, zDb uintptr, zPrefix uintptr, isCreate int32) int32 { /* sqlite3.c:195753:12: */
+func rtreeSqlInit(tls *libc.TLS, pRtree uintptr, db uintptr, zDb uintptr, zPrefix uintptr, isCreate int32) int32 { /* sqlite3.c:197412:12: */
bp := tls.Alloc(200)
defer tls.Free(200)
@@ -156057,7 +158283,7 @@ func rtreeSqlInit(tls *libc.TLS, pRtree uintptr, db uintptr, zDb uintptr, zPrefi
// var appStmt [8]uintptr at bp+168, 32
var i int32
- var f int32 = (SQLITE_PREPARE_PERSISTENT | SQLITE_PREPARE_NO_VTAB)
+ var f int32 = SQLITE_PREPARE_PERSISTENT | SQLITE_PREPARE_NO_VTAB
(*Rtree)(unsafe.Pointer(pRtree)).Fdb = db
@@ -156066,19 +158292,19 @@ func rtreeSqlInit(tls *libc.TLS, pRtree uintptr, db uintptr, zDb uintptr, zPrefi
var p uintptr = Xsqlite3_str_new(tls, db)
var ii int32
Xsqlite3_str_appendf(tls, p,
- ts+23712, /* "CREATE TABLE \"%w..." */
+ ts+25009, /* "CREATE TABLE \"%w..." */
libc.VaList(bp, zDb, zPrefix))
for ii = 0; ii < int32((*Rtree)(unsafe.Pointer(pRtree)).FnAux); ii++ {
- Xsqlite3_str_appendf(tls, p, ts+23774 /* ",a%d" */, libc.VaList(bp+16, ii))
+ Xsqlite3_str_appendf(tls, p, ts+25071 /* ",a%d" */, libc.VaList(bp+16, ii))
}
Xsqlite3_str_appendf(tls, p,
- ts+23779, /* ");CREATE TABLE \"..." */
+ ts+25076, /* ");CREATE TABLE \"..." */
libc.VaList(bp+24, zDb, zPrefix))
Xsqlite3_str_appendf(tls, p,
- ts+23843, /* "CREATE TABLE \"%w..." */
+ ts+25140, /* "CREATE TABLE \"%w..." */
libc.VaList(bp+40, zDb, zPrefix))
Xsqlite3_str_appendf(tls, p,
- ts+23913, /* "INSERT INTO \"%w\"..." */
+ ts+25210, /* "INSERT INTO \"%w\"..." */
libc.VaList(bp+56, zDb, zPrefix, (*Rtree)(unsafe.Pointer(pRtree)).FiNodeSize))
zCreate = Xsqlite3_str_finish(tls, p)
if !(zCreate != 0) {
@@ -156091,25 +158317,25 @@ func rtreeSqlInit(tls *libc.TLS, pRtree uintptr, db uintptr, zDb uintptr, zPrefi
}
}
- *(*uintptr)(unsafe.Pointer(bp + 168 /* &appStmt[0] */)) = (pRtree + 80 /* &.pWriteNode */)
- *(*uintptr)(unsafe.Pointer(bp + 168 /* &appStmt[0] */ + 1*4)) = (pRtree + 84 /* &.pDeleteNode */)
- *(*uintptr)(unsafe.Pointer(bp + 168 /* &appStmt[0] */ + 2*4)) = (pRtree + 88 /* &.pReadRowid */)
- *(*uintptr)(unsafe.Pointer(bp + 168 /* &appStmt[0] */ + 3*4)) = (pRtree + 92 /* &.pWriteRowid */)
- *(*uintptr)(unsafe.Pointer(bp + 168 /* &appStmt[0] */ + 4*4)) = (pRtree + 96 /* &.pDeleteRowid */)
- *(*uintptr)(unsafe.Pointer(bp + 168 /* &appStmt[0] */ + 5*4)) = (pRtree + 100 /* &.pReadParent */)
- *(*uintptr)(unsafe.Pointer(bp + 168 /* &appStmt[0] */ + 6*4)) = (pRtree + 104 /* &.pWriteParent */)
- *(*uintptr)(unsafe.Pointer(bp + 168 /* &appStmt[0] */ + 7*4)) = (pRtree + 108 /* &.pDeleteParent */)
+ *(*uintptr)(unsafe.Pointer(bp + 168 /* &appStmt[0] */)) = pRtree + 80
+ *(*uintptr)(unsafe.Pointer(bp + 168 /* &appStmt[0] */ + 1*4)) = pRtree + 84
+ *(*uintptr)(unsafe.Pointer(bp + 168 /* &appStmt[0] */ + 2*4)) = pRtree + 88
+ *(*uintptr)(unsafe.Pointer(bp + 168 /* &appStmt[0] */ + 3*4)) = pRtree + 92
+ *(*uintptr)(unsafe.Pointer(bp + 168 /* &appStmt[0] */ + 4*4)) = pRtree + 96
+ *(*uintptr)(unsafe.Pointer(bp + 168 /* &appStmt[0] */ + 5*4)) = pRtree + 100
+ *(*uintptr)(unsafe.Pointer(bp + 168 /* &appStmt[0] */ + 6*4)) = pRtree + 104
+ *(*uintptr)(unsafe.Pointer(bp + 168 /* &appStmt[0] */ + 7*4)) = pRtree + 108
rc = rtreeQueryStat1(tls, db, pRtree)
- for i = 0; (i < N_STATEMENT) && (rc == SQLITE_OK); i++ {
+ for i = 0; i < N_STATEMENT && rc == SQLITE_OK; i++ {
var zSql uintptr
var zFormat uintptr
- if (i != 3) || (int32((*Rtree)(unsafe.Pointer(pRtree)).FnAux) == 0) {
+ if i != 3 || int32((*Rtree)(unsafe.Pointer(pRtree)).FnAux) == 0 {
zFormat = azSql[i]
} else {
// An UPSERT is very slightly slower than REPLACE, but it is needed
// if there are auxiliary columns
- zFormat = ts + 23962 /* "INSERT INTO\"%w\"...." */
+ zFormat = ts + 25259 /* "INSERT INTO\"%w\"...." */
}
zSql = Xsqlite3_mprintf(tls, zFormat, libc.VaList(bp+80, zDb, zPrefix))
if zSql != 0 {
@@ -156121,7 +158347,7 @@ func rtreeSqlInit(tls *libc.TLS, pRtree uintptr, db uintptr, zDb uintptr, zPrefi
}
if (*Rtree)(unsafe.Pointer(pRtree)).FnAux != 0 {
(*Rtree)(unsafe.Pointer(pRtree)).FzReadAuxSql = Xsqlite3_mprintf(tls,
- ts+24070, /* "SELECT * FROM \"%..." */
+ ts+25367, /* "SELECT * FROM \"%..." */
libc.VaList(bp+96, zDb, zPrefix))
if (*Rtree)(unsafe.Pointer(pRtree)).FzReadAuxSql == uintptr(0) {
rc = SQLITE_NOMEM
@@ -156129,23 +158355,23 @@ func rtreeSqlInit(tls *libc.TLS, pRtree uintptr, db uintptr, zDb uintptr, zPrefi
var p uintptr = Xsqlite3_str_new(tls, db)
var ii int32
var zSql uintptr
- Xsqlite3_str_appendf(tls, p, ts+24115 /* "UPDATE \"%w\".\"%w_..." */, libc.VaList(bp+112, zDb, zPrefix))
+ Xsqlite3_str_appendf(tls, p, ts+25412 /* "UPDATE \"%w\".\"%w_..." */, libc.VaList(bp+112, zDb, zPrefix))
for ii = 0; ii < int32((*Rtree)(unsafe.Pointer(pRtree)).FnAux); ii++ {
if ii != 0 {
- Xsqlite3_str_append(tls, p, ts+11537 /* "," */, 1)
+ Xsqlite3_str_append(tls, p, ts+12660 /* "," */, 1)
}
if ii < int32((*Rtree)(unsafe.Pointer(pRtree)).FnAuxNotNull) {
- Xsqlite3_str_appendf(tls, p, ts+24142 /* "a%d=coalesce(?%d..." */, libc.VaList(bp+128, ii, (ii+2), ii))
+ Xsqlite3_str_appendf(tls, p, ts+25439 /* "a%d=coalesce(?%d..." */, libc.VaList(bp+128, ii, ii+2, ii))
} else {
- Xsqlite3_str_appendf(tls, p, ts+24164 /* "a%d=?%d" */, libc.VaList(bp+152, ii, (ii+2)))
+ Xsqlite3_str_appendf(tls, p, ts+25461 /* "a%d=?%d" */, libc.VaList(bp+152, ii, ii+2))
}
}
- Xsqlite3_str_appendf(tls, p, ts+24172 /* " WHERE rowid=?1" */, 0)
+ Xsqlite3_str_appendf(tls, p, ts+25469 /* " WHERE rowid=?1" */, 0)
zSql = Xsqlite3_str_finish(tls, p)
if zSql == uintptr(0) {
rc = SQLITE_NOMEM
} else {
- rc = Xsqlite3_prepare_v3(tls, db, zSql, -1, uint32(f), (pRtree + 112 /* &.pWriteAux */), uintptr(0))
+ rc = Xsqlite3_prepare_v3(tls, db, zSql, -1, uint32(f), pRtree+112, uintptr(0))
Xsqlite3_free(tls, zSql)
}
}
@@ -156156,26 +158382,26 @@ func rtreeSqlInit(tls *libc.TLS, pRtree uintptr, db uintptr, zDb uintptr, zPrefi
var azSql = [8]uintptr{
// Write the xxx_node table
- ts + 24188, /* "INSERT OR REPLAC..." */
- ts + 24241, /* "DELETE FROM '%q'..." */
+ ts + 25485, /* "INSERT OR REPLAC..." */
+ ts + 25538, /* "DELETE FROM '%q'..." */
// Read and write the xxx_rowid table
- ts + 24286, /* "SELECT nodeno FR..." */
- ts + 24338, /* "INSERT OR REPLAC..." */
- ts + 24392, /* "DELETE FROM '%q'..." */
+ ts + 25583, /* "SELECT nodeno FR..." */
+ ts + 25635, /* "INSERT OR REPLAC..." */
+ ts + 25689, /* "DELETE FROM '%q'..." */
// Read and write the xxx_parent table
- ts + 24437, /* "SELECT parentnod..." */
- ts + 24495, /* "INSERT OR REPLAC..." */
- ts + 24550, /* "DELETE FROM '%q'..." */
-} /* sqlite3.c:195763:21 */
+ ts + 25734, /* "SELECT parentnod..." */
+ ts + 25792, /* "INSERT OR REPLAC..." */
+ ts + 25847, /* "DELETE FROM '%q'..." */
+} /* sqlite3.c:197422:21 */
// The second argument to this function contains the text of an SQL statement
// that returns a single integer value. The statement is compiled and executed
// using database connection db. If successful, the integer value returned
// is written to *piVal and SQLITE_OK returned. Otherwise, an SQLite error
// code is returned and the value of *piVal after returning is not defined.
-func getIntFromStmt(tls *libc.TLS, db uintptr, zSql uintptr, piVal uintptr) int32 { /* sqlite3.c:195883:12: */
+func getIntFromStmt(tls *libc.TLS, db uintptr, zSql uintptr, piVal uintptr) int32 { /* sqlite3.c:197545:12: */
bp := tls.Alloc(4)
defer tls.Free(4)
@@ -156184,7 +158410,7 @@ func getIntFromStmt(tls *libc.TLS, db uintptr, zSql uintptr, piVal uintptr) int3
*(*uintptr)(unsafe.Pointer(bp /* pStmt */)) = uintptr(0)
rc = Xsqlite3_prepare_v2(tls, db, zSql, -1, bp /* &pStmt */, uintptr(0))
if rc == SQLITE_OK {
- if SQLITE_ROW == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp /* pStmt */))) {
+ if SQLITE_ROW == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp))) {
*(*int32)(unsafe.Pointer(piVal)) = Xsqlite3_column_int(tls, *(*uintptr)(unsafe.Pointer(bp /* pStmt */)), 0)
}
rc = Xsqlite3_finalize(tls, *(*uintptr)(unsafe.Pointer(bp /* pStmt */)))
@@ -156206,7 +158432,7 @@ func getIntFromStmt(tls *libc.TLS, db uintptr, zSql uintptr, piVal uintptr) int3
// This ensures that each node is stored on a single database page. If the
// database page-size is so large that more than RTREE_MAXCELLS entries
// would fit in a single node, use a smaller node-size.
-func getNodeSize(tls *libc.TLS, db uintptr, pRtree uintptr, isCreate int32, pzErr uintptr) int32 { /* sqlite3.c:195913:12: */
+func getNodeSize(tls *libc.TLS, db uintptr, pRtree uintptr, isCreate int32, pzErr uintptr) int32 { /* sqlite3.c:197575:12: */
bp := tls.Alloc(52)
defer tls.Free(52)
@@ -156214,27 +158440,27 @@ func getNodeSize(tls *libc.TLS, db uintptr, pRtree uintptr, isCreate int32, pzEr
var zSql uintptr
if isCreate != 0 {
*(*int32)(unsafe.Pointer(bp + 48 /* iPageSize */)) = 0
- zSql = Xsqlite3_mprintf(tls, ts+24597 /* "PRAGMA %Q.page_s..." */, libc.VaList(bp, (*Rtree)(unsafe.Pointer(pRtree)).FzDb))
+ zSql = Xsqlite3_mprintf(tls, ts+25894 /* "PRAGMA %Q.page_s..." */, libc.VaList(bp, (*Rtree)(unsafe.Pointer(pRtree)).FzDb))
rc = getIntFromStmt(tls, db, zSql, bp+48 /* &iPageSize */)
if rc == SQLITE_OK {
- (*Rtree)(unsafe.Pointer(pRtree)).FiNodeSize = (*(*int32)(unsafe.Pointer(bp + 48 /* iPageSize */)) - 64)
- if (4 + (int32((*Rtree)(unsafe.Pointer(pRtree)).FnBytesPerCell) * RTREE_MAXCELLS)) < (*Rtree)(unsafe.Pointer(pRtree)).FiNodeSize {
- (*Rtree)(unsafe.Pointer(pRtree)).FiNodeSize = (4 + (int32((*Rtree)(unsafe.Pointer(pRtree)).FnBytesPerCell) * RTREE_MAXCELLS))
+ (*Rtree)(unsafe.Pointer(pRtree)).FiNodeSize = *(*int32)(unsafe.Pointer(bp + 48)) - 64
+ if 4+int32((*Rtree)(unsafe.Pointer(pRtree)).FnBytesPerCell)*RTREE_MAXCELLS < (*Rtree)(unsafe.Pointer(pRtree)).FiNodeSize {
+ (*Rtree)(unsafe.Pointer(pRtree)).FiNodeSize = 4 + int32((*Rtree)(unsafe.Pointer(pRtree)).FnBytesPerCell)*RTREE_MAXCELLS
}
} else {
- *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, ts+2790 /* "%s" */, libc.VaList(bp+8, Xsqlite3_errmsg(tls, db)))
+ *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, ts+3601 /* "%s" */, libc.VaList(bp+8, Xsqlite3_errmsg(tls, db)))
}
} else {
zSql = Xsqlite3_mprintf(tls,
- ts+24617, /* "SELECT length(da..." */
+ ts+25914, /* "SELECT length(da..." */
libc.VaList(bp+16, (*Rtree)(unsafe.Pointer(pRtree)).FzDb, (*Rtree)(unsafe.Pointer(pRtree)).FzName))
- rc = getIntFromStmt(tls, db, zSql, (pRtree + 16 /* &.iNodeSize */))
+ rc = getIntFromStmt(tls, db, zSql, pRtree+16)
if rc != SQLITE_OK {
- *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, ts+2790 /* "%s" */, libc.VaList(bp+32, Xsqlite3_errmsg(tls, db)))
- } else if (*Rtree)(unsafe.Pointer(pRtree)).FiNodeSize < (512 - 64) {
- rc = (SQLITE_CORRUPT | (int32(1) << 8))
+ *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, ts+3601 /* "%s" */, libc.VaList(bp+32, Xsqlite3_errmsg(tls, db)))
+ } else if (*Rtree)(unsafe.Pointer(pRtree)).FiNodeSize < 512-64 {
+ rc = SQLITE_CORRUPT | int32(1)<<8
- *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, ts+24674, /* "undersize RTree ..." */
+ *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, ts+25971, /* "undersize RTree ..." */
libc.VaList(bp+40, (*Rtree)(unsafe.Pointer(pRtree)).FzName))
}
}
@@ -156244,7 +158470,7 @@ func getNodeSize(tls *libc.TLS, db uintptr, pRtree uintptr, isCreate int32, pzEr
}
// Return the length of a token
-func rtreeTokenLength(tls *libc.TLS, z uintptr) int32 { /* sqlite3.c:195956:12: */
+func rtreeTokenLength(tls *libc.TLS, z uintptr) int32 { /* sqlite3.c:197618:12: */
bp := tls.Alloc(4)
defer tls.Free(4)
@@ -156259,7 +158485,7 @@ func rtreeTokenLength(tls *libc.TLS, z uintptr) int32 { /* sqlite3.c:195956:12:
// argv[1] -> database name
// argv[2] -> table name
// argv[...] -> column names...
-func rtreeInit(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uintptr, ppVtab uintptr, pzErr uintptr, isCreate int32) int32 { /* sqlite3.c:195970:12: */
+func rtreeInit(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uintptr, ppVtab uintptr, pzErr uintptr, isCreate int32) int32 { /* sqlite3.c:197632:12: */
bp := tls.Alloc(116)
defer tls.Free(116)
@@ -156285,17 +158511,17 @@ func rtreeInit(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uintptr
ii = 4
*(*[5]uintptr)(unsafe.Pointer(bp + 96 /* aErrMsg */)) = [5]uintptr{
uintptr(0), // 0
- ts + 24709, /* "Wrong number of ..." */ // 1
- ts + 24752, /* "Too few columns ..." */ // 2
- ts + 24787, /* "Too many columns..." */ // 3
- ts + 24823, /* "Auxiliary rtree ..." */ // 4
+ ts + 26006, /* "Wrong number of ..." */ // 1
+ ts + 26049, /* "Too few columns ..." */ // 2
+ ts + 26084, /* "Too many columns..." */ // 3
+ ts + 26120, /* "Auxiliary rtree ..." */ // 4
}
// Aux columns counted by a u8
- if !((argc < 6) || (argc > (RTREE_MAX_AUX_COLUMN + 3))) {
+ if !(argc < 6 || argc > RTREE_MAX_AUX_COLUMN+3) {
goto __1
}
- *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, ts+2790 /* "%s" */, libc.VaList(bp, *(*uintptr)(unsafe.Pointer(bp + 96 /* &aErrMsg[0] */ + uintptr((2+(libc.Bool32(argc >= 6))))*4))))
+ *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, ts+3601 /* "%s" */, libc.VaList(bp, *(*uintptr)(unsafe.Pointer(bp + 96 /* &aErrMsg[0] */ + uintptr(2+libc.Bool32(argc >= 6))*4))))
return SQLITE_ERROR
__1:
;
@@ -156305,18 +158531,18 @@ __1:
// Allocate the sqlite3_vtab structure
nDb = int32(libc.Xstrlen(tls, *(*uintptr)(unsafe.Pointer(argv + 1*4))))
nName = int32(libc.Xstrlen(tls, *(*uintptr)(unsafe.Pointer(argv + 2*4))))
- pRtree = Xsqlite3_malloc64(tls, (uint64(((uint32(unsafe.Sizeof(Rtree{})) + uint32(nDb)) + uint32(nName)) + uint32(2))))
- if !(!(pRtree != 0)) {
+ pRtree = Xsqlite3_malloc64(tls, uint64(uint32(unsafe.Sizeof(Rtree{}))+uint32(nDb)+uint32(nName)+uint32(2)))
+ if !!(pRtree != 0) {
goto __2
}
return SQLITE_NOMEM
__2:
;
- libc.Xmemset(tls, pRtree, 0, (((uint32(unsafe.Sizeof(Rtree{})) + uint32(nDb)) + uint32(nName)) + uint32(2)))
+ libc.Xmemset(tls, pRtree, 0, uint32(unsafe.Sizeof(Rtree{}))+uint32(nDb)+uint32(nName)+uint32(2))
(*Rtree)(unsafe.Pointer(pRtree)).FnBusy = U32(1)
(*Rtree)(unsafe.Pointer(pRtree)).Fbase.FpModule = uintptr(unsafe.Pointer(&rtreeModule))
- (*Rtree)(unsafe.Pointer(pRtree)).FzDb = (pRtree + 1*504)
- (*Rtree)(unsafe.Pointer(pRtree)).FzName = ((*Rtree)(unsafe.Pointer(pRtree)).FzDb + uintptr((nDb + 1)))
+ (*Rtree)(unsafe.Pointer(pRtree)).FzDb = pRtree + 1*504
+ (*Rtree)(unsafe.Pointer(pRtree)).FzName = (*Rtree)(unsafe.Pointer(pRtree)).FzDb + uintptr(nDb+1)
(*Rtree)(unsafe.Pointer(pRtree)).FeCoordType = U8(eCoordType)
libc.Xmemcpy(tls, (*Rtree)(unsafe.Pointer(pRtree)).FzDb, *(*uintptr)(unsafe.Pointer(argv + 1*4)), uint32(nDb))
libc.Xmemcpy(tls, (*Rtree)(unsafe.Pointer(pRtree)).FzName, *(*uintptr)(unsafe.Pointer(argv + 2*4)), uint32(nName))
@@ -156325,7 +158551,7 @@ __2:
// that is successful, call sqlite3_declare_vtab() to configure
// the r-tree table schema.
pSql = Xsqlite3_str_new(tls, db)
- Xsqlite3_str_appendf(tls, pSql, ts+24860, /* "CREATE TABLE x(%..." */
+ Xsqlite3_str_appendf(tls, pSql, ts+26157, /* "CREATE TABLE x(%..." */
libc.VaList(bp+16, rtreeTokenLength(tls, *(*uintptr)(unsafe.Pointer(argv + 3*4))), *(*uintptr)(unsafe.Pointer(argv + 3*4))))
ii = 4
__3:
@@ -156337,7 +158563,7 @@ __3:
goto __6
}
(*Rtree)(unsafe.Pointer(pRtree)).FnAux++
- Xsqlite3_str_appendf(tls, pSql, ts+24884 /* ",%.*s" */, libc.VaList(bp+32, rtreeTokenLength(tls, (zArg+uintptr(1))), (zArg+uintptr(1))))
+ Xsqlite3_str_appendf(tls, pSql, ts+26181 /* ",%.*s" */, libc.VaList(bp+32, rtreeTokenLength(tls, zArg+uintptr(1)), zArg+uintptr(1)))
goto __7
__6:
if !(int32((*Rtree)(unsafe.Pointer(pRtree)).FnAux) > 0) {
@@ -156360,9 +158586,9 @@ __4:
goto __5
__5:
;
- Xsqlite3_str_appendf(tls, pSql, ts+24890 /* ");" */, 0)
+ Xsqlite3_str_appendf(tls, pSql, ts+26187 /* ");" */, 0)
zSql = Xsqlite3_str_finish(tls, pSql)
- if !(!(zSql != 0)) {
+ if !!(zSql != 0) {
goto __10
}
rc = SQLITE_NOMEM
@@ -156371,14 +158597,14 @@ __10:
if !(ii < argc) {
goto __12
}
- *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, ts+2790 /* "%s" */, libc.VaList(bp+64, *(*uintptr)(unsafe.Pointer(bp + 96 /* &aErrMsg[0] */ + 4*4))))
+ *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, ts+3601 /* "%s" */, libc.VaList(bp+64, *(*uintptr)(unsafe.Pointer(bp + 96 /* &aErrMsg[0] */ + 4*4))))
rc = SQLITE_ERROR
goto __13
__12:
- if !(SQLITE_OK != (libc.AssignInt32(&rc, Xsqlite3_declare_vtab(tls, db, zSql)))) {
+ if !(SQLITE_OK != libc.AssignInt32(&rc, Xsqlite3_declare_vtab(tls, db, zSql))) {
goto __14
}
- *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, ts+2790 /* "%s" */, libc.VaList(bp+72, Xsqlite3_errmsg(tls, db)))
+ *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, ts+3601 /* "%s" */, libc.VaList(bp+72, Xsqlite3_errmsg(tls, db)))
__14:
;
__13:
@@ -156392,20 +158618,20 @@ __11:
goto rtreeInit_fail
__15:
;
- (*Rtree)(unsafe.Pointer(pRtree)).FnDim = (U8(int32((*Rtree)(unsafe.Pointer(pRtree)).FnDim2) / 2))
+ (*Rtree)(unsafe.Pointer(pRtree)).FnDim = U8(int32((*Rtree)(unsafe.Pointer(pRtree)).FnDim2) / 2)
if !(int32((*Rtree)(unsafe.Pointer(pRtree)).FnDim) < 1) {
goto __16
}
iErr = 2
goto __17
__16:
- if !(int32((*Rtree)(unsafe.Pointer(pRtree)).FnDim2) > (RTREE_MAX_DIMENSIONS * 2)) {
+ if !(int32((*Rtree)(unsafe.Pointer(pRtree)).FnDim2) > RTREE_MAX_DIMENSIONS*2) {
goto __18
}
iErr = 3
goto __19
__18:
- if !((int32((*Rtree)(unsafe.Pointer(pRtree)).FnDim2) % 2) != 0) {
+ if !(int32((*Rtree)(unsafe.Pointer(pRtree)).FnDim2)%2 != 0) {
goto __20
}
iErr = 1
@@ -156421,11 +158647,11 @@ __17:
if !(iErr != 0) {
goto __22
}
- *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, ts+2790 /* "%s" */, libc.VaList(bp+80, *(*uintptr)(unsafe.Pointer(bp + 96 /* &aErrMsg[0] */ + uintptr(iErr)*4))))
+ *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, ts+3601 /* "%s" */, libc.VaList(bp+80, *(*uintptr)(unsafe.Pointer(bp + 96 /* &aErrMsg[0] */ + uintptr(iErr)*4))))
goto rtreeInit_fail
__22:
;
- (*Rtree)(unsafe.Pointer(pRtree)).FnBytesPerCell = (U8(8 + (int32((*Rtree)(unsafe.Pointer(pRtree)).FnDim2) * 4)))
+ (*Rtree)(unsafe.Pointer(pRtree)).FnBytesPerCell = U8(8 + int32((*Rtree)(unsafe.Pointer(pRtree)).FnDim2)*4)
// Figure out the node size to use.
rc = getNodeSize(tls, db, pRtree, isCreate, pzErr)
@@ -156439,7 +158665,7 @@ __23:
if !(rc != 0) {
goto __24
}
- *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, ts+2790 /* "%s" */, libc.VaList(bp+88, Xsqlite3_errmsg(tls, db)))
+ *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, ts+3601 /* "%s" */, libc.VaList(bp+88, Xsqlite3_errmsg(tls, db)))
goto rtreeInit_fail
__24:
;
@@ -156459,7 +158685,7 @@ __25:
return rc
}
-var azFormat = [2]uintptr{ts + 24893 /* ",%.*s REAL" */, ts + 24904 /* ",%.*s INT" */} /* sqlite3.c:196036:25 */
+var azFormat = [2]uintptr{ts + 26190 /* ",%.*s REAL" */, ts + 26201 /* ",%.*s INT" */} /* sqlite3.c:197698:25 */
// Implementation of a scalar function that decodes r-tree nodes to
// human readable strings. This can be used for debugging and analysis.
@@ -156475,7 +158701,7 @@ var azFormat = [2]uintptr{ts + 24893 /* ",%.*s REAL" */, ts + 24904 /* ",%.*s IN
// entry for each cell in the r-tree node. Each entry is itself a
// list, containing the 8-byte rowid/pageno followed by the
// <num-dimension>*2 coordinates.
-func rtreenode(tls *libc.TLS, ctx uintptr, nArg int32, apArg uintptr) { /* sqlite3.c:196107:13: */
+func rtreenode(tls *libc.TLS, ctx uintptr, nArg int32, apArg uintptr) { /* sqlite3.c:197769:13: */
bp := tls.Alloc(600)
defer tls.Free(600)
@@ -156492,35 +158718,38 @@ func rtreenode(tls *libc.TLS, ctx uintptr, nArg int32, apArg uintptr) { /* sqlit
libc.Xmemset(tls, bp+16 /* &node */, 0, uint32(unsafe.Sizeof(RtreeNode{})))
libc.Xmemset(tls, bp+48 /* &tree */, 0, uint32(unsafe.Sizeof(Rtree{})))
(*Rtree)(unsafe.Pointer(bp + 48 /* &tree */)).FnDim = U8(Xsqlite3_value_int(tls, *(*uintptr)(unsafe.Pointer(apArg))))
- if (int32((*Rtree)(unsafe.Pointer(bp+48 /* &tree */)).FnDim) < 1) || (int32((*Rtree)(unsafe.Pointer(bp+48 /* &tree */)).FnDim) > 5) {
+ if int32((*Rtree)(unsafe.Pointer(bp+48)).FnDim) < 1 || int32((*Rtree)(unsafe.Pointer(bp+48)).FnDim) > 5 {
return
}
- (*Rtree)(unsafe.Pointer(bp + 48 /* &tree */)).FnDim2 = (U8(int32((*Rtree)(unsafe.Pointer(bp+48 /* &tree */)).FnDim) * 2))
- (*Rtree)(unsafe.Pointer(bp + 48 /* &tree */)).FnBytesPerCell = (U8(8 + (8 * int32((*Rtree)(unsafe.Pointer(bp+48 /* &tree */)).FnDim))))
+ (*Rtree)(unsafe.Pointer(bp + 48 /* &tree */)).FnDim2 = U8(int32((*Rtree)(unsafe.Pointer(bp+48)).FnDim) * 2)
+ (*Rtree)(unsafe.Pointer(bp + 48 /* &tree */)).FnBytesPerCell = U8(8 + 8*int32((*Rtree)(unsafe.Pointer(bp+48)).FnDim))
(*RtreeNode)(unsafe.Pointer(bp + 16 /* &node */)).FzData = Xsqlite3_value_blob(tls, *(*uintptr)(unsafe.Pointer(apArg + 1*4)))
+ if (*RtreeNode)(unsafe.Pointer(bp+16)).FzData == uintptr(0) {
+ return
+ }
nData = Xsqlite3_value_bytes(tls, *(*uintptr)(unsafe.Pointer(apArg + 1*4)))
if nData < 4 {
return
}
- if nData < (readInt16(tls, ((*RtreeNode)(unsafe.Pointer((bp+16 /* &node */))).FzData+2)) * int32((*Rtree)(unsafe.Pointer(bp+48 /* &tree */)).FnBytesPerCell)) {
+ if nData < readInt16(tls, (*RtreeNode)(unsafe.Pointer(bp+16)).FzData+2)*int32((*Rtree)(unsafe.Pointer(bp+48)).FnBytesPerCell) {
return
}
pOut = Xsqlite3_str_new(tls, uintptr(0))
- for ii = 0; ii < readInt16(tls, ((*RtreeNode)(unsafe.Pointer((bp+16 /* &node */))).FzData+2)); ii++ {
+ for ii = 0; ii < readInt16(tls, (*RtreeNode)(unsafe.Pointer(bp+16 /* &node */)).FzData+2); ii++ {
// var cell RtreeCell at bp+552, 48
var jj int32
nodeGetCell(tls, bp+48 /* &tree */, bp+16 /* &node */, ii, bp+552 /* &cell */)
if ii > 0 {
- Xsqlite3_str_append(tls, pOut, ts+9652 /* " " */, 1)
+ Xsqlite3_str_append(tls, pOut, ts+10766 /* " " */, 1)
}
- Xsqlite3_str_appendf(tls, pOut, ts+24914 /* "{%lld" */, libc.VaList(bp, (*RtreeCell)(unsafe.Pointer(bp+552 /* &cell */)).FiRowid))
+ Xsqlite3_str_appendf(tls, pOut, ts+26211 /* "{%lld" */, libc.VaList(bp, (*RtreeCell)(unsafe.Pointer(bp+552 /* &cell */)).FiRowid))
for jj = 0; jj < int32((*Rtree)(unsafe.Pointer(bp+48 /* &tree */)).FnDim2); jj++ {
- Xsqlite3_str_appendf(tls, pOut, ts+24920 /* " %g" */, libc.VaList(bp+8, float64(*(*RtreeValue)(unsafe.Pointer((bp + 552 /* &cell */ + 8 /* &.aCoord */) + uintptr(jj)*4)))))
+ Xsqlite3_str_appendf(tls, pOut, ts+26217 /* " %g" */, libc.VaList(bp+8, float64(*(*RtreeValue)(unsafe.Pointer(bp + 552 + 8 + uintptr(jj)*4)))))
}
- Xsqlite3_str_append(tls, pOut, ts+24924 /* "}" */, 1)
+ Xsqlite3_str_append(tls, pOut, ts+26221 /* "}" */, 1)
}
errCode = Xsqlite3_str_errcode(tls, pOut)
Xsqlite3_result_text(tls, ctx, Xsqlite3_str_finish(tls, pOut), -1, *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{Xsqlite3_free})))
@@ -156535,11 +158764,11 @@ func rtreenode(tls *libc.TLS, ctx uintptr, nArg int32, apArg uintptr) { /* sqlit
// The depth value is 0 for all nodes other than the root node, and the root
// node always has nodeno=1, so the example above is the primary use for this
// routine. This routine is intended for testing and analysis only.
-func rtreedepth(tls *libc.TLS, ctx uintptr, nArg int32, apArg uintptr) { /* sqlite3.c:196158:13: */
+func rtreedepth(tls *libc.TLS, ctx uintptr, nArg int32, apArg uintptr) { /* sqlite3.c:197821:13: */
_ = nArg
- if (Xsqlite3_value_type(tls, *(*uintptr)(unsafe.Pointer(apArg))) != SQLITE_BLOB) ||
- (Xsqlite3_value_bytes(tls, *(*uintptr)(unsafe.Pointer(apArg))) < 2) {
- Xsqlite3_result_error(tls, ctx, ts+24926 /* "Invalid argument..." */, -1)
+ if Xsqlite3_value_type(tls, *(*uintptr)(unsafe.Pointer(apArg))) != SQLITE_BLOB ||
+ Xsqlite3_value_bytes(tls, *(*uintptr)(unsafe.Pointer(apArg))) < 2 {
+ Xsqlite3_result_error(tls, ctx, ts+26223 /* "Invalid argument..." */, -1)
} else {
var zBlob uintptr = Xsqlite3_value_blob(tls, *(*uintptr)(unsafe.Pointer(apArg)))
if zBlob != 0 {
@@ -156565,15 +158794,15 @@ type RtreeCheck1 = struct {
Frc int32
FzReport uintptr
FnErr int32
-} /* sqlite3.c:196179:9 */
+} /* sqlite3.c:197842:9 */
// Context object passed between the various routines that make up the
// implementation of integrity-check function rtreecheck().
-type RtreeCheck = RtreeCheck1 /* sqlite3.c:196179:27 */
+type RtreeCheck = RtreeCheck1 /* sqlite3.c:197842:27 */
// Reset SQL statement pStmt. If the sqlite3_reset() call returns an error,
// and RtreeCheck.rc==SQLITE_OK, set RtreeCheck.rc to the error code.
-func rtreeCheckReset(tls *libc.TLS, pCheck uintptr, pStmt uintptr) { /* sqlite3.c:196201:13: */
+func rtreeCheckReset(tls *libc.TLS, pCheck uintptr, pStmt uintptr) { /* sqlite3.c:197864:13: */
var rc int32 = Xsqlite3_reset(tls, pStmt)
if (*RtreeCheck)(unsafe.Pointer(pCheck)).Frc == SQLITE_OK {
(*RtreeCheck)(unsafe.Pointer(pCheck)).Frc = rc
@@ -156586,7 +158815,7 @@ func rtreeCheckReset(tls *libc.TLS, pCheck uintptr, pStmt uintptr) { /* sqlite3.
//
// If successful, a pointer to the new SQL statement is returned. Otherwise,
// NULL is returned and an error code left in RtreeCheck.rc.
-func rtreeCheckPrepare(tls *libc.TLS, pCheck uintptr, zFmt uintptr, va uintptr) uintptr { /* sqlite3.c:196214:21: */
+func rtreeCheckPrepare(tls *libc.TLS, pCheck uintptr, zFmt uintptr, va uintptr) uintptr { /* sqlite3.c:197877:21: */
bp := tls.Alloc(4)
defer tls.Free(4)
@@ -156614,24 +158843,24 @@ func rtreeCheckPrepare(tls *libc.TLS, pCheck uintptr, zFmt uintptr, va uintptr)
// The second and subsequent arguments to this function are a printf()
// style format string and arguments. This function formats the string and
// appends it to the report being accumuated in pCheck.
-func rtreeCheckAppendMsg(tls *libc.TLS, pCheck uintptr, zFmt uintptr, va uintptr) { /* sqlite3.c:196243:13: */
+func rtreeCheckAppendMsg(tls *libc.TLS, pCheck uintptr, zFmt uintptr, va uintptr) { /* sqlite3.c:197906:13: */
bp := tls.Alloc(24)
defer tls.Free(24)
var ap Va_list
_ = ap
ap = va
- if ((*RtreeCheck)(unsafe.Pointer(pCheck)).Frc == SQLITE_OK) && ((*RtreeCheck)(unsafe.Pointer(pCheck)).FnErr < RTREE_CHECK_MAX_ERROR) {
+ if (*RtreeCheck)(unsafe.Pointer(pCheck)).Frc == SQLITE_OK && (*RtreeCheck)(unsafe.Pointer(pCheck)).FnErr < RTREE_CHECK_MAX_ERROR {
var z uintptr = Xsqlite3_vmprintf(tls, zFmt, ap)
if z == uintptr(0) {
(*RtreeCheck)(unsafe.Pointer(pCheck)).Frc = SQLITE_NOMEM
} else {
- (*RtreeCheck)(unsafe.Pointer(pCheck)).FzReport = Xsqlite3_mprintf(tls, ts+24959, /* "%z%s%z" */
+ (*RtreeCheck)(unsafe.Pointer(pCheck)).FzReport = Xsqlite3_mprintf(tls, ts+26256, /* "%z%s%z" */
libc.VaList(bp, (*RtreeCheck)(unsafe.Pointer(pCheck)).FzReport, func() uintptr {
if (*RtreeCheck)(unsafe.Pointer(pCheck)).FzReport != 0 {
- return ts + 3171 /* "\n" */
+ return ts + 3982 /* "\n" */
}
- return ts + 755 /* "" */
+ return ts + 1543 /* "" */
}(), z))
if (*RtreeCheck)(unsafe.Pointer(pCheck)).FzReport == uintptr(0) {
(*RtreeCheck)(unsafe.Pointer(pCheck)).Frc = SQLITE_NOMEM
@@ -156654,15 +158883,15 @@ func rtreeCheckAppendMsg(tls *libc.TLS, pCheck uintptr, zFmt uintptr, va uintptr
// Or, if an error does occur, NULL is returned and an error code left
// in the RtreeCheck object. The final value of *pnNode is undefined in
// this case.
-func rtreeCheckGetNode(tls *libc.TLS, pCheck uintptr, iNode I64, pnNode uintptr) uintptr { /* sqlite3.c:196277:11: */
+func rtreeCheckGetNode(tls *libc.TLS, pCheck uintptr, iNode I64, pnNode uintptr) uintptr { /* sqlite3.c:197940:11: */
bp := tls.Alloc(24)
defer tls.Free(24)
var pRet uintptr = uintptr(0) // Return value
- if ((*RtreeCheck)(unsafe.Pointer(pCheck)).Frc == SQLITE_OK) && ((*RtreeCheck)(unsafe.Pointer(pCheck)).FpGetNode == uintptr(0)) {
+ if (*RtreeCheck)(unsafe.Pointer(pCheck)).Frc == SQLITE_OK && (*RtreeCheck)(unsafe.Pointer(pCheck)).FpGetNode == uintptr(0) {
(*RtreeCheck)(unsafe.Pointer(pCheck)).FpGetNode = rtreeCheckPrepare(tls, pCheck,
- ts+24966, /* "SELECT data FROM..." */
+ ts+26263, /* "SELECT data FROM..." */
libc.VaList(bp, (*RtreeCheck)(unsafe.Pointer(pCheck)).FzDb, (*RtreeCheck)(unsafe.Pointer(pCheck)).FzTab))
}
@@ -156680,8 +158909,8 @@ func rtreeCheckGetNode(tls *libc.TLS, pCheck uintptr, iNode I64, pnNode uintptr)
}
}
rtreeCheckReset(tls, pCheck, (*RtreeCheck)(unsafe.Pointer(pCheck)).FpGetNode)
- if ((*RtreeCheck)(unsafe.Pointer(pCheck)).Frc == SQLITE_OK) && (pRet == uintptr(0)) {
- rtreeCheckAppendMsg(tls, pCheck, ts+25011 /* "Node %lld missin..." */, libc.VaList(bp+16, iNode))
+ if (*RtreeCheck)(unsafe.Pointer(pCheck)).Frc == SQLITE_OK && pRet == uintptr(0) {
+ rtreeCheckAppendMsg(tls, pCheck, ts+26308 /* "Node %lld missin..." */, libc.VaList(bp+16, iNode))
}
}
@@ -156698,46 +158927,46 @@ func rtreeCheckGetNode(tls *libc.TLS, pCheck uintptr, iNode I64, pnNode uintptr)
// In both cases, this function checks that there exists an entry with
// IPK value iKey and the second column set to iVal.
//
-func rtreeCheckMapping(tls *libc.TLS, pCheck uintptr, bLeaf int32, iKey I64, iVal I64) { /* sqlite3.c:196321:13: */
+func rtreeCheckMapping(tls *libc.TLS, pCheck uintptr, bLeaf int32, iKey I64, iVal I64) { /* sqlite3.c:197984:13: */
bp := tls.Alloc(88)
defer tls.Free(88)
var rc int32
var pStmt uintptr
*(*[2]uintptr)(unsafe.Pointer(bp + 80 /* azSql */)) = [2]uintptr{
- ts + 25043, /* "SELECT parentnod..." */
- ts + 25097, /* "SELECT nodeno FR..." */
+ ts + 26340, /* "SELECT parentnod..." */
+ ts + 26394, /* "SELECT nodeno FR..." */
}
- if *(*uintptr)(unsafe.Pointer((pCheck + 24 /* &.aCheckMapping */) + uintptr(bLeaf)*4)) == uintptr(0) {
- *(*uintptr)(unsafe.Pointer((pCheck + 24 /* &.aCheckMapping */) + uintptr(bLeaf)*4)) = rtreeCheckPrepare(tls, pCheck,
+ if *(*uintptr)(unsafe.Pointer(pCheck + 24 + uintptr(bLeaf)*4)) == uintptr(0) {
+ *(*uintptr)(unsafe.Pointer(pCheck + 24 + uintptr(bLeaf)*4)) = rtreeCheckPrepare(tls, pCheck,
*(*uintptr)(unsafe.Pointer(bp + 80 /* &azSql[0] */ + uintptr(bLeaf)*4)), libc.VaList(bp, (*RtreeCheck)(unsafe.Pointer(pCheck)).FzDb, (*RtreeCheck)(unsafe.Pointer(pCheck)).FzTab))
}
if (*RtreeCheck)(unsafe.Pointer(pCheck)).Frc != SQLITE_OK {
return
}
- pStmt = *(*uintptr)(unsafe.Pointer((pCheck + 24 /* &.aCheckMapping */) + uintptr(bLeaf)*4))
+ pStmt = *(*uintptr)(unsafe.Pointer(pCheck + 24 + uintptr(bLeaf)*4))
Xsqlite3_bind_int64(tls, pStmt, 1, iKey)
rc = Xsqlite3_step(tls, pStmt)
if rc == SQLITE_DONE {
- rtreeCheckAppendMsg(tls, pCheck, ts+25145, /* "Mapping (%lld ->..." */
+ rtreeCheckAppendMsg(tls, pCheck, ts+26442, /* "Mapping (%lld ->..." */
libc.VaList(bp+16, iKey, iVal, func() uintptr {
if bLeaf != 0 {
- return ts + 25190 /* "%_rowid" */
+ return ts + 26487 /* "%_rowid" */
}
- return ts + 25198 /* "%_parent" */
+ return ts + 26495 /* "%_parent" */
}()))
} else if rc == SQLITE_ROW {
var ii I64 = Xsqlite3_column_int64(tls, pStmt, 0)
if ii != iVal {
rtreeCheckAppendMsg(tls, pCheck,
- ts+25207, /* "Found (%lld -> %..." */
+ ts+26504, /* "Found (%lld -> %..." */
libc.VaList(bp+40, iKey, ii, func() uintptr {
if bLeaf != 0 {
- return ts + 25190 /* "%_rowid" */
+ return ts + 26487 /* "%_rowid" */
}
- return ts + 25198 /* "%_parent" */
+ return ts + 26495 /* "%_parent" */
}(), iKey, iVal))
}
}
@@ -156754,7 +158983,7 @@ func rtreeCheckMapping(tls *libc.TLS, pCheck uintptr, bLeaf int32, iKey I64, iVa
// containing pCell. In this case it is also verified that the two
// sets of coordinates are mutually consistent and an error message added
// to the RtreeCheck object if they are not.
-func rtreeCheckCellCoord(tls *libc.TLS, pCheck uintptr, iNode I64, iCell int32, pCell uintptr, pParent uintptr) { /* sqlite3.c:196373:13: */
+func rtreeCheckCellCoord(tls *libc.TLS, pCheck uintptr, iNode I64, iCell int32, pCell uintptr, pParent uintptr) { /* sqlite3.c:198036:13: */
bp := tls.Alloc(64)
defer tls.Free(64)
@@ -156769,38 +158998,38 @@ func rtreeCheckCellCoord(tls *libc.TLS, pCheck uintptr, iNode I64, iCell int32,
var i int32
for i = 0; i < (*RtreeCheck)(unsafe.Pointer(pCheck)).FnDim; i++ {
- readCoord(tls, (pCell + uintptr(((4 * 2) * i))), bp+48 /* &c1 */)
- readCoord(tls, (pCell + uintptr((4 * ((2 * i) + 1)))), bp+52 /* &c2 */)
+ readCoord(tls, pCell+uintptr(4*2*i), bp+48 /* &c1 */)
+ readCoord(tls, pCell+uintptr(4*(2*i+1)), bp+52 /* &c2 */)
// printf("%e, %e\n", c1.u.f, c2.u.f);
if func() int32 {
if (*RtreeCheck)(unsafe.Pointer(pCheck)).FbInt != 0 {
- return (libc.Bool32(*(*int32)(unsafe.Pointer(bp + 48 /* &c1 */)) > *(*int32)(unsafe.Pointer(bp + 52 /* &c2 */))))
+ return libc.Bool32(*(*int32)(unsafe.Pointer(bp + 48)) > *(*int32)(unsafe.Pointer(bp + 52)))
}
- return (libc.Bool32(*(*RtreeValue)(unsafe.Pointer(bp + 48 /* &c1 */)) > *(*RtreeValue)(unsafe.Pointer(bp + 52 /* &c2 */))))
+ return libc.Bool32(*(*RtreeValue)(unsafe.Pointer(bp + 48)) > *(*RtreeValue)(unsafe.Pointer(bp + 52)))
}() != 0 {
rtreeCheckAppendMsg(tls, pCheck,
- ts+25265 /* "Dimension %d of ..." */, libc.VaList(bp, i, iCell, iNode))
+ ts+26562 /* "Dimension %d of ..." */, libc.VaList(bp, i, iCell, iNode))
}
if pParent != 0 {
- readCoord(tls, (pParent + uintptr(((4 * 2) * i))), bp+56 /* &p1 */)
- readCoord(tls, (pParent + uintptr((4 * ((2 * i) + 1)))), bp+60 /* &p2 */)
+ readCoord(tls, pParent+uintptr(4*2*i), bp+56 /* &p1 */)
+ readCoord(tls, pParent+uintptr(4*(2*i+1)), bp+60 /* &p2 */)
- if (func() int32 {
+ if func() int32 {
if (*RtreeCheck)(unsafe.Pointer(pCheck)).FbInt != 0 {
- return (libc.Bool32(*(*int32)(unsafe.Pointer(bp + 48 /* &c1 */)) < *(*int32)(unsafe.Pointer(bp + 56 /* &p1 */))))
+ return libc.Bool32(*(*int32)(unsafe.Pointer(bp + 48)) < *(*int32)(unsafe.Pointer(bp + 56)))
}
- return (libc.Bool32(*(*RtreeValue)(unsafe.Pointer(bp + 48 /* &c1 */)) < *(*RtreeValue)(unsafe.Pointer(bp + 56 /* &p1 */))))
- }() != 0) ||
- (func() int32 {
+ return libc.Bool32(*(*RtreeValue)(unsafe.Pointer(bp + 48)) < *(*RtreeValue)(unsafe.Pointer(bp + 56)))
+ }() != 0 ||
+ func() int32 {
if (*RtreeCheck)(unsafe.Pointer(pCheck)).FbInt != 0 {
- return (libc.Bool32(*(*int32)(unsafe.Pointer(bp + 52 /* &c2 */)) > *(*int32)(unsafe.Pointer(bp + 60 /* &p2 */))))
+ return libc.Bool32(*(*int32)(unsafe.Pointer(bp + 52)) > *(*int32)(unsafe.Pointer(bp + 60)))
}
- return (libc.Bool32(*(*RtreeValue)(unsafe.Pointer(bp + 52 /* &c2 */)) > *(*RtreeValue)(unsafe.Pointer(bp + 60 /* &p2 */))))
- }() != 0) {
+ return libc.Bool32(*(*RtreeValue)(unsafe.Pointer(bp + 52)) > *(*RtreeValue)(unsafe.Pointer(bp + 60)))
+ }() != 0 {
rtreeCheckAppendMsg(tls, pCheck,
- ts+25313 /* "Dimension %d of ..." */, libc.VaList(bp+24, i, iCell, iNode))
+ ts+26610 /* "Dimension %d of ..." */, libc.VaList(bp+24, i, iCell, iNode))
}
}
}
@@ -156812,7 +159041,7 @@ func rtreeCheckCellCoord(tls *libc.TLS, pCheck uintptr, iNode I64, iCell int32,
//
// If any problems are discovered, an error message is appended to the
// report accumulated in the RtreeCheck object.
-func rtreeCheckNode(tls *libc.TLS, pCheck uintptr, iDepth int32, aParent uintptr, iNode I64) { /* sqlite3.c:196419:13: */
+func rtreeCheckNode(tls *libc.TLS, pCheck uintptr, iDepth int32, aParent uintptr, iNode I64) { /* sqlite3.c:198082:13: */
bp := tls.Alloc(52)
defer tls.Free(52)
@@ -156821,34 +159050,34 @@ func rtreeCheckNode(tls *libc.TLS, pCheck uintptr, iDepth int32, aParent uintptr
aNode = rtreeCheckGetNode(tls, pCheck, iNode, bp+48 /* &nNode */)
if aNode != 0 {
- if *(*int32)(unsafe.Pointer(bp + 48 /* nNode */)) < 4 {
+ if *(*int32)(unsafe.Pointer(bp + 48)) < 4 {
rtreeCheckAppendMsg(tls, pCheck,
- ts+25380 /* "Node %lld is too..." */, libc.VaList(bp, iNode, *(*int32)(unsafe.Pointer(bp + 48 /* nNode */))))
+ ts+26677 /* "Node %lld is too..." */, libc.VaList(bp, iNode, *(*int32)(unsafe.Pointer(bp + 48 /* nNode */))))
} else {
var nCell int32 // Number of cells on page
var i int32 // Used to iterate through cells
if aParent == uintptr(0) {
iDepth = readInt16(tls, aNode)
if iDepth > RTREE_MAX_DEPTH {
- rtreeCheckAppendMsg(tls, pCheck, ts+25414 /* "Rtree depth out ..." */, libc.VaList(bp+16, iDepth))
+ rtreeCheckAppendMsg(tls, pCheck, ts+26711 /* "Rtree depth out ..." */, libc.VaList(bp+16, iDepth))
Xsqlite3_free(tls, aNode)
return
}
}
- nCell = readInt16(tls, (aNode + 2))
- if (4 + (nCell * (8 + (((*RtreeCheck)(unsafe.Pointer(pCheck)).FnDim * 2) * 4)))) > *(*int32)(unsafe.Pointer(bp + 48 /* nNode */)) {
+ nCell = readInt16(tls, aNode+2)
+ if 4+nCell*(8+(*RtreeCheck)(unsafe.Pointer(pCheck)).FnDim*2*4) > *(*int32)(unsafe.Pointer(bp + 48)) {
rtreeCheckAppendMsg(tls, pCheck,
- ts+25444, /* "Node %lld is too..." */
+ ts+26741, /* "Node %lld is too..." */
libc.VaList(bp+24, iNode, nCell, *(*int32)(unsafe.Pointer(bp + 48 /* nNode */))))
} else {
for i = 0; i < nCell; i++ {
- var pCell uintptr = (aNode + uintptr((4 + (i * (8 + (((*RtreeCheck)(unsafe.Pointer(pCheck)).FnDim * 2) * 4))))))
+ var pCell uintptr = aNode + uintptr(4+i*(8+(*RtreeCheck)(unsafe.Pointer(pCheck)).FnDim*2*4))
var iVal I64 = readInt64(tls, pCell)
- rtreeCheckCellCoord(tls, pCheck, iNode, i, (pCell + 8), aParent)
+ rtreeCheckCellCoord(tls, pCheck, iNode, i, pCell+8, aParent)
if iDepth > 0 {
rtreeCheckMapping(tls, pCheck, 0, iVal, iNode)
- rtreeCheckNode(tls, pCheck, (iDepth - 1), (pCell + 8), iVal)
+ rtreeCheckNode(tls, pCheck, iDepth-1, pCell+8, iVal)
(*RtreeCheck)(unsafe.Pointer(pCheck)).FnNonLeaf++
} else {
rtreeCheckMapping(tls, pCheck, 1, iVal, iNode)
@@ -156866,20 +159095,20 @@ func rtreeCheckNode(tls *libc.TLS, pCheck uintptr, iDepth int32, aParent uintptr
// %_rowid or %_parent table is exactly nExpect. If not, it adds
// an error message to the report in the RtreeCheck object indicated
// by the first argument.
-func rtreeCheckCount(tls *libc.TLS, pCheck uintptr, zTbl uintptr, nExpect I64) { /* sqlite3.c:196482:13: */
+func rtreeCheckCount(tls *libc.TLS, pCheck uintptr, zTbl uintptr, nExpect I64) { /* sqlite3.c:198145:13: */
bp := tls.Alloc(48)
defer tls.Free(48)
if (*RtreeCheck)(unsafe.Pointer(pCheck)).Frc == SQLITE_OK {
var pCount uintptr
- pCount = rtreeCheckPrepare(tls, pCheck, ts+25499, /* "SELECT count(*) ..." */
+ pCount = rtreeCheckPrepare(tls, pCheck, ts+26796, /* "SELECT count(*) ..." */
libc.VaList(bp, (*RtreeCheck)(unsafe.Pointer(pCheck)).FzDb, (*RtreeCheck)(unsafe.Pointer(pCheck)).FzTab, zTbl))
if pCount != 0 {
if Xsqlite3_step(tls, pCount) == SQLITE_ROW {
var nActual I64 = Xsqlite3_column_int64(tls, pCount, 0)
if nActual != nExpect {
rtreeCheckAppendMsg(tls, pCheck,
- ts+25530 /* "Wrong number of ..." */, libc.VaList(bp+24, zTbl, nExpect, nActual))
+ ts+26827 /* "Wrong number of ..." */, libc.VaList(bp+24, zTbl, nExpect, nActual))
}
}
(*RtreeCheck)(unsafe.Pointer(pCheck)).Frc = Xsqlite3_finalize(tls, pCount)
@@ -156889,7 +159118,7 @@ func rtreeCheckCount(tls *libc.TLS, pCheck uintptr, zTbl uintptr, nExpect I64) {
// This function does the bulk of the work for the rtree integrity-check.
// It is called by rtreecheck(), which is the SQL function implementation.
-func rtreeCheckTable(tls *libc.TLS, db uintptr, zDb uintptr, zTab uintptr, pzReport uintptr) int32 { /* sqlite3.c:196506:12: */
+func rtreeCheckTable(tls *libc.TLS, db uintptr, zDb uintptr, zTab uintptr, pzReport uintptr) int32 { /* sqlite3.c:198169:12: */
bp := tls.Alloc(84)
defer tls.Free(84)
@@ -156909,29 +159138,30 @@ func rtreeCheckTable(tls *libc.TLS, db uintptr, zDb uintptr, zTab uintptr, pzRep
// to ensure that the queries run as part of this integrity-check operate
// on a consistent snapshot.
if Xsqlite3_get_autocommit(tls, db) != 0 {
- (*RtreeCheck)(unsafe.Pointer(bp + 32 /* &check */)).Frc = Xsqlite3_exec(tls, db, ts+13213 /* "BEGIN" */, uintptr(0), uintptr(0), uintptr(0))
+ (*RtreeCheck)(unsafe.Pointer(bp + 32 /* &check */)).Frc = Xsqlite3_exec(tls, db, ts+14396 /* "BEGIN" */, uintptr(0), uintptr(0), uintptr(0))
bEnd = 1
}
// Find the number of auxiliary columns
- if (*RtreeCheck)(unsafe.Pointer(bp+32 /* &check */)).Frc == SQLITE_OK {
- pStmt = rtreeCheckPrepare(tls, bp+32 /* &check */, ts+25597 /* "SELECT * FROM %Q..." */, libc.VaList(bp, zDb, zTab))
+ if (*RtreeCheck)(unsafe.Pointer(bp+32)).Frc == SQLITE_OK {
+ pStmt = rtreeCheckPrepare(tls, bp+32 /* &check */, ts+26894 /* "SELECT * FROM %Q..." */, libc.VaList(bp, zDb, zTab))
if pStmt != 0 {
- nAux = (Xsqlite3_column_count(tls, pStmt) - 2)
+ nAux = Xsqlite3_column_count(tls, pStmt) - 2
Xsqlite3_finalize(tls, pStmt)
+ } else if (*RtreeCheck)(unsafe.Pointer(bp+32)).Frc != SQLITE_NOMEM {
+ (*RtreeCheck)(unsafe.Pointer(bp + 32 /* &check */)).Frc = SQLITE_OK
}
- (*RtreeCheck)(unsafe.Pointer(bp + 32 /* &check */)).Frc = SQLITE_OK
}
// Find number of dimensions in the rtree table.
- pStmt = rtreeCheckPrepare(tls, bp+32 /* &check */, ts+23417 /* "SELECT * FROM %Q..." */, libc.VaList(bp+16, zDb, zTab))
+ pStmt = rtreeCheckPrepare(tls, bp+32 /* &check */, ts+24714 /* "SELECT * FROM %Q..." */, libc.VaList(bp+16, zDb, zTab))
if pStmt != 0 {
var rc int32
- (*RtreeCheck)(unsafe.Pointer(bp + 32 /* &check */)).FnDim = (((Xsqlite3_column_count(tls, pStmt) - 1) - nAux) / 2)
- if (*RtreeCheck)(unsafe.Pointer(bp+32 /* &check */)).FnDim < 1 {
- rtreeCheckAppendMsg(tls, bp+32 /* &check */, ts+25625 /* "Schema corrupt o..." */, 0)
+ (*RtreeCheck)(unsafe.Pointer(bp + 32 /* &check */)).FnDim = (Xsqlite3_column_count(tls, pStmt) - 1 - nAux) / 2
+ if (*RtreeCheck)(unsafe.Pointer(bp+32)).FnDim < 1 {
+ rtreeCheckAppendMsg(tls, bp+32 /* &check */, ts+26922 /* "Schema corrupt o..." */, 0)
} else if SQLITE_ROW == Xsqlite3_step(tls, pStmt) {
- (*RtreeCheck)(unsafe.Pointer(bp + 32 /* &check */)).FbInt = (libc.Bool32(Xsqlite3_column_type(tls, pStmt, 1) == SQLITE_INTEGER))
+ (*RtreeCheck)(unsafe.Pointer(bp + 32 /* &check */)).FbInt = libc.Bool32(Xsqlite3_column_type(tls, pStmt, 1) == SQLITE_INTEGER)
}
rc = Xsqlite3_finalize(tls, pStmt)
if rc != SQLITE_CORRUPT {
@@ -156940,23 +159170,23 @@ func rtreeCheckTable(tls *libc.TLS, db uintptr, zDb uintptr, zTab uintptr, pzRep
}
// Do the actual integrity-check
- if (*RtreeCheck)(unsafe.Pointer(bp+32 /* &check */)).FnDim >= 1 {
- if (*RtreeCheck)(unsafe.Pointer(bp+32 /* &check */)).Frc == SQLITE_OK {
+ if (*RtreeCheck)(unsafe.Pointer(bp+32)).FnDim >= 1 {
+ if (*RtreeCheck)(unsafe.Pointer(bp+32)).Frc == SQLITE_OK {
rtreeCheckNode(tls, bp+32 /* &check */, 0, uintptr(0), int64(1))
}
- rtreeCheckCount(tls, bp+32 /* &check */, ts+25656 /* "_rowid" */, int64((*RtreeCheck)(unsafe.Pointer(bp+32 /* &check */)).FnLeaf))
- rtreeCheckCount(tls, bp+32 /* &check */, ts+25663 /* "_parent" */, int64((*RtreeCheck)(unsafe.Pointer(bp+32 /* &check */)).FnNonLeaf))
+ rtreeCheckCount(tls, bp+32 /* &check */, ts+26953 /* "_rowid" */, int64((*RtreeCheck)(unsafe.Pointer(bp+32 /* &check */)).FnLeaf))
+ rtreeCheckCount(tls, bp+32 /* &check */, ts+26960 /* "_parent" */, int64((*RtreeCheck)(unsafe.Pointer(bp+32 /* &check */)).FnNonLeaf))
}
// Finalize SQL statements used by the integrity-check
Xsqlite3_finalize(tls, (*RtreeCheck)(unsafe.Pointer(bp+32 /* &check */)).FpGetNode)
- Xsqlite3_finalize(tls, *(*uintptr)(unsafe.Pointer((bp + 32 /* &check */ + 24 /* &.aCheckMapping */))))
- Xsqlite3_finalize(tls, *(*uintptr)(unsafe.Pointer((bp + 32 /* &check */ + 24 /* &.aCheckMapping */) + 1*4)))
+ Xsqlite3_finalize(tls, *(*uintptr)(unsafe.Pointer(bp + 32 + 24)))
+ Xsqlite3_finalize(tls, *(*uintptr)(unsafe.Pointer(bp + 32 + 24 + 1*4)))
// If one was opened, close the transaction
if bEnd != 0 {
- var rc int32 = Xsqlite3_exec(tls, db, ts+25671 /* "END" */, uintptr(0), uintptr(0), uintptr(0))
- if (*RtreeCheck)(unsafe.Pointer(bp+32 /* &check */)).Frc == SQLITE_OK {
+ var rc int32 = Xsqlite3_exec(tls, db, ts+26968 /* "END" */, uintptr(0), uintptr(0), uintptr(0))
+ if (*RtreeCheck)(unsafe.Pointer(bp+32)).Frc == SQLITE_OK {
(*RtreeCheck)(unsafe.Pointer(bp + 32 /* &check */)).Frc = rc
}
}
@@ -156995,13 +159225,13 @@ func rtreeCheckTable(tls *libc.TLS, db uintptr, zDb uintptr, zTab uintptr, pzRep
// as there are non-leaf cells in the r-tree structure, and that
// there is a non-leaf cell that corresponds to each entry in the
// %_parent table.
-func rtreecheck(tls *libc.TLS, ctx uintptr, nArg int32, apArg uintptr) { /* sqlite3.c:196611:13: */
+func rtreecheck(tls *libc.TLS, ctx uintptr, nArg int32, apArg uintptr) { /* sqlite3.c:198276:13: */
bp := tls.Alloc(4)
defer tls.Free(4)
- if (nArg != 1) && (nArg != 2) {
+ if nArg != 1 && nArg != 2 {
Xsqlite3_result_error(tls, ctx,
- ts+25675 /* "wrong number of ..." */, -1)
+ ts+26972 /* "wrong number of ..." */, -1)
} else {
var rc int32
*(*uintptr)(unsafe.Pointer(bp /* zReport */)) = uintptr(0)
@@ -157009,17 +159239,17 @@ func rtreecheck(tls *libc.TLS, ctx uintptr, nArg int32, apArg uintptr) { /* sqli
var zTab uintptr
if nArg == 1 {
zTab = zDb
- zDb = ts + 5458 /* "main" */
+ zDb = ts + 6305 /* "main" */
} else {
zTab = Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(apArg + 1*4)))
}
rc = rtreeCheckTable(tls, Xsqlite3_context_db_handle(tls, ctx), zDb, zTab, bp /* &zReport */)
if rc == SQLITE_OK {
Xsqlite3_result_text(tls, ctx, func() uintptr {
- if *(*uintptr)(unsafe.Pointer(bp /* zReport */)) != 0 {
+ if *(*uintptr)(unsafe.Pointer(bp)) != 0 {
return *(*uintptr)(unsafe.Pointer(bp /* zReport */))
}
- return ts + 16336 /* "ok" */
+ return ts + 17602 /* "ok" */
}(), -1, libc.UintptrFromInt32(-1))
} else {
Xsqlite3_result_error_code(tls, ctx, rc)
@@ -157054,7 +159284,7 @@ func rtreecheck(tls *libc.TLS, ctx uintptr, nArg int32, apArg uintptr) { /* sqli
// Compiler and version
// Datatype for coordinates
-type GeoCoord = float32 /* sqlite3.c:196735:15 */
+type GeoCoord = float32 /* sqlite3.c:198400:15 */
// Internal representation of a polygon.
//
@@ -157080,7 +159310,7 @@ type GeoPoly1 = struct {
FnVertex int32
Fhdr [4]uint8
Fa [8]GeoCoord
-} /* sqlite3.c:196759:9 */
+} /* sqlite3.c:198424:9 */
// Internal representation of a polygon.
//
@@ -157102,7 +159332,7 @@ type GeoPoly1 = struct {
// warnings coming from some compiler (notably, clang). In reality, the size
// of each GeoPoly memory allocate is adjusted as necessary so that the
// GeoPoly.a[] array at the end is the appropriate size.
-type GeoPoly = GeoPoly1 /* sqlite3.c:196759:24 */
+type GeoPoly = GeoPoly1 /* sqlite3.c:198424:24 */
// The size of a memory allocation needed for a GeoPoly object sufficient
// to hold N coordinate pairs.
@@ -157118,7 +159348,7 @@ type GeoParse1 = struct {
FnAlloc int32
FnErr int32
Fa uintptr
-} /* sqlite3.c:196782:9 */
+} /* sqlite3.c:198447:9 */
// The size of a memory allocation needed for a GeoPoly object sufficient
// to hold N coordinate pairs.
@@ -157128,10 +159358,10 @@ type GeoParse1 = struct {
// to silence (incorrect) UBSAN warnings if the array index is too large.
// State of a parse of a GeoJSON input.
-type GeoParse = GeoParse1 /* sqlite3.c:196782:25 */
+type GeoParse = GeoParse1 /* sqlite3.c:198447:25 */
// Do a 4-byte byte swap
-func geopolySwab32(tls *libc.TLS, a uintptr) { /* sqlite3.c:196792:13: */
+func geopolySwab32(tls *libc.TLS, a uintptr) { /* sqlite3.c:198457:13: */
var t uint8 = *(*uint8)(unsafe.Pointer(a))
*(*uint8)(unsafe.Pointer(a)) = *(*uint8)(unsafe.Pointer(a + 3))
*(*uint8)(unsafe.Pointer(a + 3)) = t
@@ -157141,7 +159371,7 @@ func geopolySwab32(tls *libc.TLS, a uintptr) { /* sqlite3.c:196792:13: */
}
// Skip whitespace. Return the next non-whitespace character.
-func geopolySkipSpace(tls *libc.TLS, p uintptr) uint8 { /* sqlite3.c:196802:13: */
+func geopolySkipSpace(tls *libc.TLS, p uintptr) uint8 { /* sqlite3.c:198467:13: */
for jsonIsSpace[*(*uint8)(unsafe.Pointer((*GeoParse)(unsafe.Pointer(p)).Fz))] != 0 {
(*GeoParse)(unsafe.Pointer(p)).Fz++
}
@@ -157150,7 +159380,7 @@ func geopolySkipSpace(tls *libc.TLS, p uintptr) uint8 { /* sqlite3.c:196802:13:
// Parse out a number. Write the value into *pVal if pVal!=0.
// return non-zero on success and zero if the next token is not a number.
-func geopolyParseNumber(tls *libc.TLS, p uintptr, pVal uintptr) int32 { /* sqlite3.c:196810:12: */
+func geopolyParseNumber(tls *libc.TLS, p uintptr, pVal uintptr) int32 { /* sqlite3.c:198475:12: */
bp := tls.Alloc(8)
defer tls.Free(8)
@@ -157163,16 +159393,16 @@ func geopolyParseNumber(tls *libc.TLS, p uintptr, pVal uintptr) int32 { /* sqlit
j = 1
c = uint8(*(*uint8)(unsafe.Pointer(z + uintptr(j))))
}
- if ((int32(c) == '0') && (int32(*(*uint8)(unsafe.Pointer(z + uintptr((j + 1))))) >= '0')) && (int32(*(*uint8)(unsafe.Pointer(z + uintptr((j + 1))))) <= '9') {
+ if int32(c) == '0' && int32(*(*uint8)(unsafe.Pointer(z + uintptr(j+1)))) >= '0' && int32(*(*uint8)(unsafe.Pointer(z + uintptr(j+1)))) <= '9' {
return 0
}
for ; ; j++ {
c = uint8(*(*uint8)(unsafe.Pointer(z + uintptr(j))))
- if (int32(Xsqlite3CtypeMap[uint8(c)]) & 0x04) != 0 {
+ if int32(Xsqlite3CtypeMap[uint8(c)])&0x04 != 0 {
continue
}
if int32(c) == '.' {
- if int32(*(*uint8)(unsafe.Pointer(z + uintptr((j - 1))))) == '-' {
+ if int32(*(*uint8)(unsafe.Pointer(z + uintptr(j-1)))) == '-' {
return 0
}
if seenDP != 0 {
@@ -157181,27 +159411,27 @@ func geopolyParseNumber(tls *libc.TLS, p uintptr, pVal uintptr) int32 { /* sqlit
seenDP = 1
continue
}
- if (int32(c) == 'e') || (int32(c) == 'E') {
- if int32(*(*uint8)(unsafe.Pointer(z + uintptr((j - 1))))) < '0' {
+ if int32(c) == 'e' || int32(c) == 'E' {
+ if int32(*(*uint8)(unsafe.Pointer(z + uintptr(j-1)))) < '0' {
return 0
}
if seenE != 0 {
return -1
}
seenDP = libc.AssignInt32(&seenE, 1)
- c = uint8(*(*uint8)(unsafe.Pointer(z + uintptr((j + 1)))))
- if (int32(c) == '+') || (int32(c) == '-') {
+ c = uint8(*(*uint8)(unsafe.Pointer(z + uintptr(j+1))))
+ if int32(c) == '+' || int32(c) == '-' {
j++
- c = uint8(*(*uint8)(unsafe.Pointer(z + uintptr((j + 1)))))
+ c = uint8(*(*uint8)(unsafe.Pointer(z + uintptr(j+1))))
}
- if (int32(c) < '0') || (int32(c) > '9') {
+ if int32(c) < '0' || int32(c) > '9' {
return 0
}
continue
}
break
}
- if int32(*(*uint8)(unsafe.Pointer(z + uintptr((j - 1))))) < '0' {
+ if int32(*(*uint8)(unsafe.Pointer(z + uintptr(j-1)))) < '0' {
return 0
}
if pVal != 0 {
@@ -157212,7 +159442,7 @@ func geopolyParseNumber(tls *libc.TLS, p uintptr, pVal uintptr) int32 { /* sqlit
Xsqlite3AtoF(tls, (*GeoParse)(unsafe.Pointer(p)).Fz, bp /* &r */, j, uint8(SQLITE_UTF8))
*(*GeoCoord)(unsafe.Pointer(pVal)) = GeoCoord(*(*float64)(unsafe.Pointer(bp /* r */)))
}
- *(*uintptr)(unsafe.Pointer(p /* &.z */)) += (uintptr(j))
+ *(*uintptr)(unsafe.Pointer(p)) += uintptr(j)
return 1
}
@@ -157222,7 +159452,7 @@ func geopolyParseNumber(tls *libc.TLS, p uintptr, pVal uintptr) int32 { /* sqlit
// that object.
//
// If any error occurs, return NULL.
-func geopolyParseJson(tls *libc.TLS, z uintptr, pRc uintptr) uintptr { /* sqlite3.c:196868:16: */
+func geopolyParseJson(tls *libc.TLS, z uintptr, pRc uintptr) uintptr { /* sqlite3.c:198533:16: */
bp := tls.Alloc(24)
defer tls.Free(24)
@@ -157237,21 +159467,21 @@ func geopolyParseJson(tls *libc.TLS, z uintptr, pRc uintptr) uintptr { /* sqlite
rc = SQLITE_OK
libc.Xmemset(tls, bp /* &s */, 0, uint32(unsafe.Sizeof(GeoParse{})))
(*GeoParse)(unsafe.Pointer(bp /* &s */)).Fz = z
- if !(int32(geopolySkipSpace(tls, bp /* &s */)) == '[') {
+ if !(int32(geopolySkipSpace(tls, bp)) == '[') {
goto __1
}
(*GeoParse)(unsafe.Pointer(bp /* &s */)).Fz++
__2:
- if !(int32(geopolySkipSpace(tls, bp /* &s */)) == '[') {
+ if !(int32(geopolySkipSpace(tls, bp)) == '[') {
goto __3
}
ii = 0
(*GeoParse)(unsafe.Pointer(bp /* &s */)).Fz++
- if !((*GeoParse)(unsafe.Pointer(bp /* &s */)).FnVertex >= (*GeoParse)(unsafe.Pointer(bp /* &s */)).FnAlloc) {
+ if !((*GeoParse)(unsafe.Pointer(bp)).FnVertex >= (*GeoParse)(unsafe.Pointer(bp)).FnAlloc) {
goto __4
}
- (*GeoParse)(unsafe.Pointer(bp /* &s */)).FnAlloc = (((*GeoParse)(unsafe.Pointer(bp /* &s */)).FnAlloc * 2) + 16)
- aNew = Xsqlite3_realloc64(tls, (*GeoParse)(unsafe.Pointer(bp /* &s */)).Fa, (uint64((uint32((*GeoParse)(unsafe.Pointer(bp /* &s */)).FnAlloc) * uint32(unsafe.Sizeof(GeoCoord(0)))) * uint32(2))))
+ (*GeoParse)(unsafe.Pointer(bp /* &s */)).FnAlloc = (*GeoParse)(unsafe.Pointer(bp)).FnAlloc*2 + 16
+ aNew = Xsqlite3_realloc64(tls, (*GeoParse)(unsafe.Pointer(bp /* &s */)).Fa, uint64(uint32((*GeoParse)(unsafe.Pointer(bp)).FnAlloc)*uint32(unsafe.Sizeof(GeoCoord(0)))*uint32(2)))
if !(aNew == uintptr(0)) {
goto __5
}
@@ -157264,9 +159494,9 @@ __5:
__4:
;
__6:
- if !(geopolyParseNumber(tls, bp /* &s */, func() uintptr {
+ if !(geopolyParseNumber(tls, bp, func() uintptr {
if ii <= 1 {
- return ((*GeoParse)(unsafe.Pointer(bp /* &s */)).Fa + uintptr((((*GeoParse)(unsafe.Pointer(bp /* &s */)).FnVertex*2)+ii))*4)
+ return (*GeoParse)(unsafe.Pointer(bp)).Fa + uintptr((*GeoParse)(unsafe.Pointer(bp)).FnVertex*2+ii)*4
}
return uintptr(0)
}()) != 0) {
@@ -157287,7 +159517,7 @@ __8:
goto __6
__9:
;
- if !((int32(c) == ']') && (ii >= 2)) {
+ if !(int32(c) == ']' && ii >= 2) {
goto __10
}
goto __7
@@ -157299,7 +159529,7 @@ __10:
goto __6
__7:
;
- if !(int32(geopolySkipSpace(tls, bp /* &s */)) == ',') {
+ if !(int32(geopolySkipSpace(tls, bp)) == ',') {
goto __11
}
(*GeoParse)(unsafe.Pointer(bp /* &s */)).Fz++
@@ -157310,19 +159540,16 @@ __11:
goto __2
__3:
;
- if !(((((int32(geopolySkipSpace(tls, bp /* &s */)) == ']') &&
- ((*GeoParse)(unsafe.Pointer(bp /* &s */)).FnVertex >= 4)) &&
- (*(*GeoCoord)(unsafe.Pointer((*GeoParse)(unsafe.Pointer(bp /* &s */)).Fa)) == *(*GeoCoord)(unsafe.Pointer((*GeoParse)(unsafe.Pointer(bp /* &s */)).Fa + uintptr((((*GeoParse)(unsafe.Pointer(bp /* &s */)).FnVertex*2)-2))*4)))) &&
- (*(*GeoCoord)(unsafe.Pointer((*GeoParse)(unsafe.Pointer(bp /* &s */)).Fa + 1*4)) == *(*GeoCoord)(unsafe.Pointer((*GeoParse)(unsafe.Pointer(bp /* &s */)).Fa + uintptr((((*GeoParse)(unsafe.Pointer(bp /* &s */)).FnVertex*2)-1))*4)))) &&
- (func() bool {
- (*GeoParse)(unsafe.Pointer(bp /* &s */)).Fz++
- return (int32(geopolySkipSpace(tls, bp /* &s */)) == 0)
- }())) {
+ if !(int32(geopolySkipSpace(tls, bp)) == ']' &&
+ (*GeoParse)(unsafe.Pointer(bp)).FnVertex >= 4 &&
+ *(*GeoCoord)(unsafe.Pointer((*GeoParse)(unsafe.Pointer(bp)).Fa)) == *(*GeoCoord)(unsafe.Pointer((*GeoParse)(unsafe.Pointer(bp)).Fa + uintptr((*GeoParse)(unsafe.Pointer(bp)).FnVertex*2-2)*4)) &&
+ *(*GeoCoord)(unsafe.Pointer((*GeoParse)(unsafe.Pointer(bp)).Fa + 1*4)) == *(*GeoCoord)(unsafe.Pointer((*GeoParse)(unsafe.Pointer(bp)).Fa + uintptr((*GeoParse)(unsafe.Pointer(bp)).FnVertex*2-1)*4)) &&
+ func() bool { (*GeoParse)(unsafe.Pointer(bp)).Fz++; return int32(geopolySkipSpace(tls, bp)) == 0 }()) {
goto __12
}
*(*int32)(unsafe.Pointer(bp + 20 /* x */)) = 1
(*GeoParse)(unsafe.Pointer(bp /* &s */)).FnVertex-- // Remove the redundant vertex at the end
- pOut = Xsqlite3_malloc64(tls, (uint64(Sqlite3_int64(unsafe.Sizeof(GeoPoly{})) + ((int64(uint32(unsafe.Sizeof(GeoCoord(0))) * uint32(2))) * ((Sqlite3_int64((*GeoParse)(unsafe.Pointer(bp /* &s */)).FnVertex)) - int64(4))))))
+ pOut = Xsqlite3_malloc64(tls, uint64(Sqlite3_int64(unsafe.Sizeof(GeoPoly{}))+int64(uint32(unsafe.Sizeof(GeoCoord(0)))*uint32(2))*(Sqlite3_int64((*GeoParse)(unsafe.Pointer(bp)).FnVertex)-int64(4))))
*(*int32)(unsafe.Pointer(bp + 20 /* x */)) = 1
if !(pOut == uintptr(0)) {
goto __14
@@ -157331,11 +159558,11 @@ __3:
__14:
;
(*GeoPoly)(unsafe.Pointer(pOut)).FnVertex = (*GeoParse)(unsafe.Pointer(bp /* &s */)).FnVertex
- libc.Xmemcpy(tls, pOut+8 /* &.a */, (*GeoParse)(unsafe.Pointer(bp /* &s */)).Fa, ((uint32((*GeoParse)(unsafe.Pointer(bp /* &s */)).FnVertex * 2)) * uint32(unsafe.Sizeof(GeoCoord(0)))))
- *(*uint8)(unsafe.Pointer((pOut + 4 /* &.hdr */))) = *(*uint8)(unsafe.Pointer(bp + 20 /* &x */))
- *(*uint8)(unsafe.Pointer((pOut + 4 /* &.hdr */) + 1)) = (uint8(((*GeoParse)(unsafe.Pointer(bp /* &s */)).FnVertex >> 16) & 0xff))
- *(*uint8)(unsafe.Pointer((pOut + 4 /* &.hdr */) + 2)) = (uint8(((*GeoParse)(unsafe.Pointer(bp /* &s */)).FnVertex >> 8) & 0xff))
- *(*uint8)(unsafe.Pointer((pOut + 4 /* &.hdr */) + 3)) = (uint8((*GeoParse)(unsafe.Pointer(bp /* &s */)).FnVertex & 0xff))
+ libc.Xmemcpy(tls, pOut+8, (*GeoParse)(unsafe.Pointer(bp /* &s */)).Fa, uint32((*GeoParse)(unsafe.Pointer(bp)).FnVertex*2)*uint32(unsafe.Sizeof(GeoCoord(0))))
+ *(*uint8)(unsafe.Pointer(pOut + 4)) = *(*uint8)(unsafe.Pointer(bp + 20 /* &x */))
+ *(*uint8)(unsafe.Pointer(pOut + 4 + 1)) = uint8((*GeoParse)(unsafe.Pointer(bp)).FnVertex >> 16 & 0xff)
+ *(*uint8)(unsafe.Pointer(pOut + 4 + 2)) = uint8((*GeoParse)(unsafe.Pointer(bp)).FnVertex >> 8 & 0xff)
+ *(*uint8)(unsafe.Pointer(pOut + 4 + 3)) = uint8((*GeoParse)(unsafe.Pointer(bp)).FnVertex & 0xff)
Xsqlite3_free(tls, (*GeoParse)(unsafe.Pointer(bp /* &s */)).Fa)
if !(pRc != 0) {
goto __15
@@ -157367,24 +159594,27 @@ __16:
// in the binary format or JSON text. Compute a GeoPoly object and
// return a pointer to that object. Or if the input is not a well-formed
// polygon, put an error message in sqlite3_context and return NULL.
-func geopolyFuncParam(tls *libc.TLS, pCtx uintptr, pVal uintptr, pRc uintptr) uintptr { /* sqlite3.c:196945:16: */
+func geopolyFuncParam(tls *libc.TLS, pCtx uintptr, pVal uintptr, pRc uintptr) uintptr { /* sqlite3.c:198610:16: */
bp := tls.Alloc(4)
defer tls.Free(4)
var p uintptr = uintptr(0)
var nByte int32
- if (Xsqlite3_value_type(tls, pVal) == SQLITE_BLOB) &&
- ((uint32(libc.AssignInt32(&nByte, Xsqlite3_value_bytes(tls, pVal)))) >= (uint32(4) + (uint32(6) * uint32(unsafe.Sizeof(GeoCoord(0)))))) {
+
+ if Xsqlite3_value_type(tls, pVal) == SQLITE_BLOB &&
+ uint32(libc.AssignInt32(&nByte, Xsqlite3_value_bytes(tls, pVal))) >= uint32(4)+uint32(6)*uint32(unsafe.Sizeof(GeoCoord(0))) {
var a uintptr = Xsqlite3_value_blob(tls, pVal)
var nVertex int32
if a == uintptr(0) {
- Xsqlite3_result_error_nomem(tls, pCtx)
+ if pCtx != 0 {
+ Xsqlite3_result_error_nomem(tls, pCtx)
+ }
return uintptr(0)
}
- nVertex = (((int32(*(*uint8)(unsafe.Pointer(a + 1))) << 16) + (int32(*(*uint8)(unsafe.Pointer(a + 2))) << 8)) + int32(*(*uint8)(unsafe.Pointer(a + 3))))
- if ((int32(*(*uint8)(unsafe.Pointer(a))) == 0) || (int32(*(*uint8)(unsafe.Pointer(a))) == 1)) &&
- ((((uint32(nVertex * 2)) * uint32(unsafe.Sizeof(GeoCoord(0)))) + uint32(4)) == uint32(nByte)) {
- p = Xsqlite3_malloc64(tls, (uint64(uint32(unsafe.Sizeof(GeoPoly{})) + ((uint32((nVertex - 1) * 2)) * uint32(unsafe.Sizeof(GeoCoord(0)))))))
+ nVertex = int32(*(*uint8)(unsafe.Pointer(a + 1)))<<16 + int32(*(*uint8)(unsafe.Pointer(a + 2)))<<8 + int32(*(*uint8)(unsafe.Pointer(a + 3)))
+ if (int32(*(*uint8)(unsafe.Pointer(a))) == 0 || int32(*(*uint8)(unsafe.Pointer(a))) == 1) &&
+ uint32(nVertex*2)*uint32(unsafe.Sizeof(GeoCoord(0)))+uint32(4) == uint32(nByte) {
+ p = Xsqlite3_malloc64(tls, uint64(uint32(unsafe.Sizeof(GeoPoly{}))+uint32((nVertex-1)*2)*uint32(unsafe.Sizeof(GeoCoord(0)))))
if p == uintptr(0) {
if pRc != 0 {
*(*int32)(unsafe.Pointer(pRc)) = SQLITE_NOMEM
@@ -157395,14 +159625,14 @@ func geopolyFuncParam(tls *libc.TLS, pCtx uintptr, pVal uintptr, pRc uintptr) ui
} else {
*(*int32)(unsafe.Pointer(bp /* x */)) = 1
(*GeoPoly)(unsafe.Pointer(p)).FnVertex = nVertex
- libc.Xmemcpy(tls, p+4 /* &.hdr */, a, uint32(nByte))
- if int32(*(*uint8)(unsafe.Pointer(a))) != int32(*(*uint8)(unsafe.Pointer(bp /* &x */))) {
+ libc.Xmemcpy(tls, p+4, a, uint32(nByte))
+ if int32(*(*uint8)(unsafe.Pointer(a))) != int32(*(*uint8)(unsafe.Pointer(bp))) {
var ii int32
for ii = 0; ii < nVertex; ii++ {
- geopolySwab32(tls, ((p + 8 /* &.a */) + uintptr(((ii)*2))*4))
- geopolySwab32(tls, ((p + 8 /* &.a */) + uintptr((((ii)*2)+1))*4))
+ geopolySwab32(tls, p+8+uintptr(ii*2)*4)
+ geopolySwab32(tls, p+8+uintptr(ii*2+1)*4)
}
- *(*uint8)(unsafe.Pointer((p + 4 /* &.hdr */))) ^= uint8((1))
+ *(*uint8)(unsafe.Pointer(p + 4)) ^= uint8(1)
}
}
}
@@ -157433,11 +159663,11 @@ func geopolyFuncParam(tls *libc.TLS, pCtx uintptr, pVal uintptr, pRc uintptr) ui
// If the input is a well-formed Geopoly BLOB or JSON string
// then return the BLOB representation of the polygon. Otherwise
// return NULL.
-func geopolyBlobFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:197005:13: */
+func geopolyBlobFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:198671:13: */
var p uintptr = geopolyFuncParam(tls, context, *(*uintptr)(unsafe.Pointer(argv)), uintptr(0))
if p != 0 {
- Xsqlite3_result_blob(tls, context, p+4, /* &.hdr */
- (4 + (8 * (*GeoPoly)(unsafe.Pointer(p)).FnVertex)), libc.UintptrFromInt32(-1))
+ Xsqlite3_result_blob(tls, context, p+4,
+ 4+8*(*GeoPoly)(unsafe.Pointer(p)).FnVertex, libc.UintptrFromInt32(-1))
Xsqlite3_free(tls, p)
}
}
@@ -157446,7 +159676,7 @@ func geopolyBlobFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) {
//
// Interpret X as a polygon and render it as a JSON array
// of coordinates. Or, if X is not a valid polygon, return NULL.
-func geopolyJsonFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:197024:13: */
+func geopolyJsonFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:198690:13: */
bp := tls.Alloc(32)
defer tls.Free(32)
@@ -157455,11 +159685,11 @@ func geopolyJsonFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) {
var db uintptr = Xsqlite3_context_db_handle(tls, context)
var x uintptr = Xsqlite3_str_new(tls, db)
var i int32
- Xsqlite3_str_append(tls, x, ts+25726 /* "[" */, 1)
+ Xsqlite3_str_append(tls, x, ts+27023 /* "[" */, 1)
for i = 0; i < (*GeoPoly)(unsafe.Pointer(p)).FnVertex; i++ {
- Xsqlite3_str_appendf(tls, x, ts+25728 /* "[%!g,%!g]," */, libc.VaList(bp, float64(*(*GeoCoord)(unsafe.Pointer((p + 8 /* &.a */) + uintptr(((i)*2))*4))), float64(*(*GeoCoord)(unsafe.Pointer((p + 8 /* &.a */) + uintptr((((i)*2)+1))*4)))))
+ Xsqlite3_str_appendf(tls, x, ts+27025 /* "[%!g,%!g]," */, libc.VaList(bp, float64(*(*GeoCoord)(unsafe.Pointer(p + 8 + uintptr(i*2)*4))), float64(*(*GeoCoord)(unsafe.Pointer(p + 8 + uintptr(i*2+1)*4)))))
}
- Xsqlite3_str_appendf(tls, x, ts+25739 /* "[%!g,%!g]]" */, libc.VaList(bp+16, float64(*(*GeoCoord)(unsafe.Pointer((p + 8 /* &.a */)))), float64(*(*GeoCoord)(unsafe.Pointer((p + 8 /* &.a */) + 1*4)))))
+ Xsqlite3_str_appendf(tls, x, ts+27036 /* "[%!g,%!g]]" */, libc.VaList(bp+16, float64(*(*GeoCoord)(unsafe.Pointer(p + 8))), float64(*(*GeoCoord)(unsafe.Pointer(p + 8 + 1*4)))))
Xsqlite3_result_text(tls, context, Xsqlite3_str_finish(tls, x), -1, *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{Xsqlite3_free})))
Xsqlite3_free(tls, p)
}
@@ -157469,7 +159699,7 @@ func geopolyJsonFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) {
//
// Interpret X as a polygon and render it as a SVG <polyline>.
// Additional arguments are added as attributes to the <polyline>.
-func geopolySvgFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:197050:13: */
+func geopolySvgFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:198716:13: */
bp := tls.Alloc(48)
defer tls.Free(48)
@@ -157483,19 +159713,19 @@ func geopolySvgFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) {
var x uintptr = Xsqlite3_str_new(tls, db)
var i int32
var cSep uint8 = uint8('\'')
- Xsqlite3_str_appendf(tls, x, ts+25750 /* "<polyline points..." */, 0)
+ Xsqlite3_str_appendf(tls, x, ts+27047 /* "<polyline points..." */, 0)
for i = 0; i < (*GeoPoly)(unsafe.Pointer(p)).FnVertex; i++ {
- Xsqlite3_str_appendf(tls, x, ts+25768 /* "%c%g,%g" */, libc.VaList(bp, int32(cSep), float64(*(*GeoCoord)(unsafe.Pointer((p + 8 /* &.a */) + uintptr(((i)*2))*4))), float64(*(*GeoCoord)(unsafe.Pointer((p + 8 /* &.a */) + uintptr((((i)*2)+1))*4)))))
+ Xsqlite3_str_appendf(tls, x, ts+27065 /* "%c%g,%g" */, libc.VaList(bp, int32(cSep), float64(*(*GeoCoord)(unsafe.Pointer(p + 8 + uintptr(i*2)*4))), float64(*(*GeoCoord)(unsafe.Pointer(p + 8 + uintptr(i*2+1)*4)))))
cSep = uint8(' ')
}
- Xsqlite3_str_appendf(tls, x, ts+25776 /* " %g,%g'" */, libc.VaList(bp+24, float64(*(*GeoCoord)(unsafe.Pointer((p + 8 /* &.a */)))), float64(*(*GeoCoord)(unsafe.Pointer((p + 8 /* &.a */) + 1*4)))))
+ Xsqlite3_str_appendf(tls, x, ts+27073 /* " %g,%g'" */, libc.VaList(bp+24, float64(*(*GeoCoord)(unsafe.Pointer(p + 8))), float64(*(*GeoCoord)(unsafe.Pointer(p + 8 + 1*4)))))
for i = 1; i < argc; i++ {
var z uintptr = Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*4)))
- if (z != 0) && (*(*uint8)(unsafe.Pointer(z)) != 0) {
- Xsqlite3_str_appendf(tls, x, ts+25784 /* " %s" */, libc.VaList(bp+40, z))
+ if z != 0 && *(*uint8)(unsafe.Pointer(z)) != 0 {
+ Xsqlite3_str_appendf(tls, x, ts+27081 /* " %s" */, libc.VaList(bp+40, z))
}
}
- Xsqlite3_str_appendf(tls, x, ts+25788 /* "></polyline>" */, 0)
+ Xsqlite3_str_appendf(tls, x, ts+27085 /* "></polyline>" */, 0)
Xsqlite3_result_text(tls, context, Xsqlite3_str_finish(tls, x), -1, *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{Xsqlite3_free})))
Xsqlite3_free(tls, p)
}
@@ -157515,7 +159745,7 @@ func geopolySvgFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) {
// Rotate by R around the point (0,0):
//
// geopoly_xform(poly, cos(R), sin(R), -sin(R), cos(R), 0, 0)
-func geopolyXformFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:197097:13: */
+func geopolyXformFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:198763:13: */
var p uintptr = geopolyFuncParam(tls, context, *(*uintptr)(unsafe.Pointer(argv)), uintptr(0))
var A float64 = Xsqlite3_value_double(tls, *(*uintptr)(unsafe.Pointer(argv + 1*4)))
var B float64 = Xsqlite3_value_double(tls, *(*uintptr)(unsafe.Pointer(argv + 2*4)))
@@ -157530,15 +159760,15 @@ func geopolyXformFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr)
var ii int32
if p != 0 {
for ii = 0; ii < (*GeoPoly)(unsafe.Pointer(p)).FnVertex; ii++ {
- x0 = *(*GeoCoord)(unsafe.Pointer((p + 8 /* &.a */) + uintptr(((ii)*2))*4))
- y0 = *(*GeoCoord)(unsafe.Pointer((p + 8 /* &.a */) + uintptr((((ii)*2)+1))*4))
- x1 = (GeoCoord(((A * float64(x0)) + (B * float64(y0))) + E))
- y1 = (GeoCoord(((C * float64(x0)) + (D * float64(y0))) + F))
- (*(*GeoCoord)(unsafe.Pointer((p + 8 /* &.a */) + uintptr(((ii)*2))*4))) = x1
- (*(*GeoCoord)(unsafe.Pointer((p + 8 /* &.a */) + uintptr((((ii)*2)+1))*4))) = y1
- }
- Xsqlite3_result_blob(tls, context, p+4, /* &.hdr */
- (4 + (8 * (*GeoPoly)(unsafe.Pointer(p)).FnVertex)), libc.UintptrFromInt32(-1))
+ x0 = *(*GeoCoord)(unsafe.Pointer(p + 8 + uintptr(ii*2)*4))
+ y0 = *(*GeoCoord)(unsafe.Pointer(p + 8 + uintptr(ii*2+1)*4))
+ x1 = GeoCoord(A*float64(x0) + B*float64(y0) + E)
+ y1 = GeoCoord(C*float64(x0) + D*float64(y0) + F)
+ *(*GeoCoord)(unsafe.Pointer(p + 8 + uintptr(ii*2)*4)) = x1
+ *(*GeoCoord)(unsafe.Pointer(p + 8 + uintptr(ii*2+1)*4)) = y1
+ }
+ Xsqlite3_result_blob(tls, context, p+4,
+ 4+8*(*GeoPoly)(unsafe.Pointer(p)).FnVertex, libc.UintptrFromInt32(-1))
Xsqlite3_free(tls, p)
}
}
@@ -157548,17 +159778,17 @@ func geopolyXformFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr)
// This routine can also be used to detect polygons that rotate in
// the wrong direction. Polygons are suppose to be counter-clockwise (CCW).
// This routine returns a negative value for clockwise (CW) polygons.
-func geopolyArea(tls *libc.TLS, p uintptr) float64 { /* sqlite3.c:197133:15: */
+func geopolyArea(tls *libc.TLS, p uintptr) float64 { /* sqlite3.c:198799:15: */
var rArea float64 = 0.0
var ii int32
- for ii = 0; ii < ((*GeoPoly)(unsafe.Pointer(p)).FnVertex - 1); ii++ {
- rArea = rArea + ((float64(((*(*GeoCoord)(unsafe.Pointer((p + 8 /* &.a */) + uintptr(((ii)*2))*4))) - (*(*GeoCoord)(unsafe.Pointer((p + 8 /* &.a */) + uintptr(((ii+1)*2))*4)))) * // (x0 - x1)
- ((*(*GeoCoord)(unsafe.Pointer((p + 8 /* &.a */) + uintptr((((ii)*2)+1))*4))) + (*(*GeoCoord)(unsafe.Pointer((p + 8 /* &.a */) + uintptr((((ii+1)*2)+1))*4)))))) * // (y0 + y1)
- 0.5)
- }
- rArea = rArea + ((float64(((*(*GeoCoord)(unsafe.Pointer((p + 8 /* &.a */) + uintptr(((ii)*2))*4))) - (*(*GeoCoord)(unsafe.Pointer((p + 8 /* &.a */))))) * // (xN - x0)
- ((*(*GeoCoord)(unsafe.Pointer((p + 8 /* &.a */) + uintptr((((ii)*2)+1))*4))) + (*(*GeoCoord)(unsafe.Pointer((p + 8 /* &.a */) + 1*4)))))) * // (yN + y0)
- 0.5)
+ for ii = 0; ii < (*GeoPoly)(unsafe.Pointer(p)).FnVertex-1; ii++ {
+ rArea = rArea + float64((*(*GeoCoord)(unsafe.Pointer(p + 8 + uintptr(ii*2)*4))-*(*GeoCoord)(unsafe.Pointer(p + 8 + uintptr((ii+1)*2)*4)))*
+ (*(*GeoCoord)(unsafe.Pointer(p + 8 + uintptr(ii*2+1)*4))+*(*GeoCoord)(unsafe.Pointer(p + 8 + uintptr((ii+1)*2+1)*4))))*
+ 0.5
+ }
+ rArea = rArea + float64((*(*GeoCoord)(unsafe.Pointer(p + 8 + uintptr(ii*2)*4))-*(*GeoCoord)(unsafe.Pointer(p + 8)))*
+ (*(*GeoCoord)(unsafe.Pointer(p + 8 + uintptr(ii*2+1)*4))+*(*GeoCoord)(unsafe.Pointer(p + 8 + 1*4))))*
+ 0.5
return rArea
}
@@ -157568,7 +159798,7 @@ func geopolyArea(tls *libc.TLS, p uintptr) float64 { /* sqlite3.c:197133:15: */
// enclosed by the polygon. If the polygon circulates clockwise instead
// of counterclockwise (as it should) then return the negative of the
// enclosed area. Otherwise return NULL.
-func geopolyAreaFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:197155:13: */
+func geopolyAreaFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:198821:13: */
var p uintptr = geopolyFuncParam(tls, context, *(*uintptr)(unsafe.Pointer(argv)), uintptr(0))
if p != 0 {
Xsqlite3_result_double(tls, context, geopolyArea(tls, p))
@@ -157587,25 +159817,25 @@ func geopolyAreaFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) {
//
// Use this routine to sanitize historical inputs that that sometimes
// contain polygons that wind in the wrong direction.
-func geopolyCcwFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:197180:13: */
+func geopolyCcwFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:198846:13: */
var p uintptr = geopolyFuncParam(tls, context, *(*uintptr)(unsafe.Pointer(argv)), uintptr(0))
if p != 0 {
if geopolyArea(tls, p) < 0.0 {
var ii int32
var jj int32
ii = 1
- jj = ((*GeoPoly)(unsafe.Pointer(p)).FnVertex - 1)
+ jj = (*GeoPoly)(unsafe.Pointer(p)).FnVertex - 1
__1:
if !(ii < jj) {
goto __3
}
{
- var t GeoCoord = *(*GeoCoord)(unsafe.Pointer((p + 8 /* &.a */) + uintptr(((ii)*2))*4))
- (*(*GeoCoord)(unsafe.Pointer((p + 8 /* &.a */) + uintptr(((ii)*2))*4))) = *(*GeoCoord)(unsafe.Pointer((p + 8 /* &.a */) + uintptr(((jj)*2))*4))
- (*(*GeoCoord)(unsafe.Pointer((p + 8 /* &.a */) + uintptr(((jj)*2))*4))) = t
- t = *(*GeoCoord)(unsafe.Pointer((p + 8 /* &.a */) + uintptr((((ii)*2)+1))*4))
- (*(*GeoCoord)(unsafe.Pointer((p + 8 /* &.a */) + uintptr((((ii)*2)+1))*4))) = *(*GeoCoord)(unsafe.Pointer((p + 8 /* &.a */) + uintptr((((jj)*2)+1))*4))
- (*(*GeoCoord)(unsafe.Pointer((p + 8 /* &.a */) + uintptr((((jj)*2)+1))*4))) = t
+ var t GeoCoord = *(*GeoCoord)(unsafe.Pointer(p + 8 + uintptr(ii*2)*4))
+ *(*GeoCoord)(unsafe.Pointer(p + 8 + uintptr(ii*2)*4)) = *(*GeoCoord)(unsafe.Pointer(p + 8 + uintptr(jj*2)*4))
+ *(*GeoCoord)(unsafe.Pointer(p + 8 + uintptr(jj*2)*4)) = t
+ t = *(*GeoCoord)(unsafe.Pointer(p + 8 + uintptr(ii*2+1)*4))
+ *(*GeoCoord)(unsafe.Pointer(p + 8 + uintptr(ii*2+1)*4)) = *(*GeoCoord)(unsafe.Pointer(p + 8 + uintptr(jj*2+1)*4))
+ *(*GeoCoord)(unsafe.Pointer(p + 8 + uintptr(jj*2+1)*4)) = t
}
goto __2
@@ -157616,25 +159846,25 @@ func geopolyCcwFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) {
goto __3
__3:
}
- Xsqlite3_result_blob(tls, context, p+4, /* &.hdr */
- (4 + (8 * (*GeoPoly)(unsafe.Pointer(p)).FnVertex)), libc.UintptrFromInt32(-1))
+ Xsqlite3_result_blob(tls, context, p+4,
+ 4+8*(*GeoPoly)(unsafe.Pointer(p)).FnVertex, libc.UintptrFromInt32(-1))
Xsqlite3_free(tls, p)
}
}
// Fast approximation for sine(X) for X between -0.5*pi and 2*pi
-func geopolySine(tls *libc.TLS, r float64) float64 { /* sqlite3.c:197208:15: */
+func geopolySine(tls *libc.TLS, r float64) float64 { /* sqlite3.c:198874:15: */
- if r >= (float64(1.5) * 3.1415926535897932385) {
- r = r - (float64(2.0) * 3.1415926535897932385)
+ if r >= float64(1.5)*3.1415926535897932385 {
+ r = r - float64(2.0)*3.1415926535897932385
}
- if r >= (float64(0.5) * 3.1415926535897932385) {
- return -geopolySine(tls, (r - 3.1415926535897932385))
+ if r >= float64(0.5)*3.1415926535897932385 {
+ return -geopolySine(tls, r-3.1415926535897932385)
} else {
- var r2 float64 = (r * r)
- var r3 float64 = (r2 * r)
- var r5 float64 = (r3 * r2)
- return (((0.9996949 * r) - (0.1656700 * r3)) + (0.0075134 * r5))
+ var r2 float64 = r * r
+ var r3 float64 = r2 * r
+ var r5 float64 = r3 * r2
+ return 0.9996949*r - 0.1656700*r3 + 0.0075134*r5
}
return float64(0)
}
@@ -157643,7 +159873,7 @@ func geopolySine(tls *libc.TLS, r float64) float64 { /* sqlite3.c:197208:15: */
//
// Construct a simple, convex, regular polygon centered at X, Y
// with circumradius R and with N sides.
-func geopolyRegularFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:197229:13: */
+func geopolyRegularFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:198895:13: */
bp := tls.Alloc(4)
defer tls.Free(4)
@@ -157655,28 +159885,28 @@ func geopolyRegularFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr
var p uintptr
- if (n < 3) || (r <= 0.0) {
+ if n < 3 || r <= 0.0 {
return
}
if n > 1000 {
n = 1000
}
- p = Xsqlite3_malloc64(tls, (uint64(uint32(unsafe.Sizeof(GeoPoly{})) + ((uint32((n - 1) * 2)) * uint32(unsafe.Sizeof(GeoCoord(0)))))))
+ p = Xsqlite3_malloc64(tls, uint64(uint32(unsafe.Sizeof(GeoPoly{}))+uint32((n-1)*2)*uint32(unsafe.Sizeof(GeoCoord(0)))))
if p == uintptr(0) {
Xsqlite3_result_error_nomem(tls, context)
return
}
*(*int32)(unsafe.Pointer(bp /* i */)) = 1
- *(*uint8)(unsafe.Pointer((p + 4 /* &.hdr */))) = *(*uint8)(unsafe.Pointer(bp /* &i */))
- *(*uint8)(unsafe.Pointer((p + 4 /* &.hdr */) + 1)) = uint8(0)
- *(*uint8)(unsafe.Pointer((p + 4 /* &.hdr */) + 2)) = (uint8((n >> 8) & 0xff))
- *(*uint8)(unsafe.Pointer((p + 4 /* &.hdr */) + 3)) = (uint8(n & 0xff))
+ *(*uint8)(unsafe.Pointer(p + 4)) = *(*uint8)(unsafe.Pointer(bp /* &i */))
+ *(*uint8)(unsafe.Pointer(p + 4 + 1)) = uint8(0)
+ *(*uint8)(unsafe.Pointer(p + 4 + 2)) = uint8(n >> 8 & 0xff)
+ *(*uint8)(unsafe.Pointer(p + 4 + 3)) = uint8(n & 0xff)
for *(*int32)(unsafe.Pointer(bp /* i */)) = 0; *(*int32)(unsafe.Pointer(bp /* i */)) < n; *(*int32)(unsafe.Pointer(bp /* i */))++ {
- var rAngle float64 = (((float64(2.0) * 3.1415926535897932385) * float64(*(*int32)(unsafe.Pointer(bp /* i */)))) / float64(n))
- (*(*GeoCoord)(unsafe.Pointer((p + 8 /* &.a */) + uintptr(((*(*int32)(unsafe.Pointer(bp /* i */)))*2))*4))) = (GeoCoord(x - (r * geopolySine(tls, (rAngle-(float64(0.5)*3.1415926535897932385))))))
- (*(*GeoCoord)(unsafe.Pointer((p + 8 /* &.a */) + uintptr((((*(*int32)(unsafe.Pointer(bp /* i */)))*2)+1))*4))) = (GeoCoord(y + (r * geopolySine(tls, rAngle))))
+ var rAngle float64 = float64(2.0) * 3.1415926535897932385 * float64(*(*int32)(unsafe.Pointer(bp))) / float64(n)
+ *(*GeoCoord)(unsafe.Pointer(p + 8 + uintptr(*(*int32)(unsafe.Pointer(bp))*2)*4)) = GeoCoord(x - r*geopolySine(tls, rAngle-float64(0.5)*3.1415926535897932385))
+ *(*GeoCoord)(unsafe.Pointer(p + 8 + uintptr(*(*int32)(unsafe.Pointer(bp))*2+1)*4)) = GeoCoord(y + r*geopolySine(tls, rAngle))
}
- Xsqlite3_result_blob(tls, context, p+4 /* &.hdr */, (4 + (8 * n)), libc.UintptrFromInt32(-1))
+ Xsqlite3_result_blob(tls, context, p+4, 4+8*n, libc.UintptrFromInt32(-1))
Xsqlite3_free(tls, p)
}
@@ -157688,7 +159918,7 @@ func geopolyRegularFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr
//
// If pPoly is NULL but aCoord is not NULL, then compute a new GeoPoly from
// the bounding box in aCoord and return a pointer to that GeoPoly.
-func geopolyBBox(tls *libc.TLS, context uintptr, pPoly uintptr, aCoord uintptr, pRc uintptr) uintptr { /* sqlite3.c:197272:16: */
+func geopolyBBox(tls *libc.TLS, context uintptr, pPoly uintptr, aCoord uintptr, pRc uintptr) uintptr { /* sqlite3.c:198938:16: */
bp := tls.Alloc(4)
defer tls.Free(4)
@@ -157701,7 +159931,7 @@ func geopolyBBox(tls *libc.TLS, context uintptr, pPoly uintptr, aCoord uintptr,
var r float64
// var ii int32 at bp, 4
pOut = uintptr(0)
- if !((pPoly == uintptr(0)) && (aCoord != uintptr(0))) {
+ if !(pPoly == uintptr(0) && aCoord != uintptr(0)) {
goto __1
}
p = uintptr(0)
@@ -157718,14 +159948,14 @@ __2:
if !(p != 0) {
goto __3
}
- mnX = libc.AssignFloat32(&mxX, *(*GeoCoord)(unsafe.Pointer((p + 8 /* &.a */))))
- mnY = libc.AssignFloat32(&mxY, *(*GeoCoord)(unsafe.Pointer((p + 8 /* &.a */) + 1*4)))
+ mnX = libc.AssignFloat32(&mxX, *(*GeoCoord)(unsafe.Pointer(p + 8)))
+ mnY = libc.AssignFloat32(&mxY, *(*GeoCoord)(unsafe.Pointer(p + 8 + 1*4)))
*(*int32)(unsafe.Pointer(bp /* ii */)) = 1
__5:
- if !(*(*int32)(unsafe.Pointer(bp /* ii */)) < (*GeoPoly)(unsafe.Pointer(p)).FnVertex) {
+ if !(*(*int32)(unsafe.Pointer(bp)) < (*GeoPoly)(unsafe.Pointer(p)).FnVertex) {
goto __7
}
- r = float64(*(*GeoCoord)(unsafe.Pointer((p + 8 /* &.a */) + uintptr(((*(*int32)(unsafe.Pointer(bp /* ii */)))*2))*4)))
+ r = float64(*(*GeoCoord)(unsafe.Pointer(p + 8 + uintptr(*(*int32)(unsafe.Pointer(bp))*2)*4)))
if !(r < float64(mnX)) {
goto __8
}
@@ -157740,7 +159970,7 @@ __10:
;
__9:
;
- r = float64(*(*GeoCoord)(unsafe.Pointer((p + 8 /* &.a */) + uintptr((((*(*int32)(unsafe.Pointer(bp /* ii */)))*2)+1))*4)))
+ r = float64(*(*GeoCoord)(unsafe.Pointer(p + 8 + uintptr(*(*int32)(unsafe.Pointer(bp))*2+1)*4)))
if !(r < float64(mnY)) {
goto __11
}
@@ -157772,7 +160002,7 @@ __14:
goto __15
}
geopolyBboxFill:
- pOut = Xsqlite3_realloc64(tls, p, (uint64(uint32(unsafe.Sizeof(GeoPoly{})) + ((uint32(unsafe.Sizeof(GeoCoord(0))) * uint32(2)) * (uint32((4) - 4))))))
+ pOut = Xsqlite3_realloc64(tls, p, uint64(uint32(unsafe.Sizeof(GeoPoly{}))+uint32(unsafe.Sizeof(GeoCoord(0)))*uint32(2)*uint32(4-4)))
if !(pOut == uintptr(0)) {
goto __17
}
@@ -157794,18 +160024,18 @@ __17:
;
(*GeoPoly)(unsafe.Pointer(pOut)).FnVertex = 4
*(*int32)(unsafe.Pointer(bp /* ii */)) = 1
- *(*uint8)(unsafe.Pointer((pOut + 4 /* &.hdr */))) = *(*uint8)(unsafe.Pointer(bp /* &ii */))
- *(*uint8)(unsafe.Pointer((pOut + 4 /* &.hdr */) + 1)) = uint8(0)
- *(*uint8)(unsafe.Pointer((pOut + 4 /* &.hdr */) + 2)) = uint8(0)
- *(*uint8)(unsafe.Pointer((pOut + 4 /* &.hdr */) + 3)) = uint8(4)
- (*(*GeoCoord)(unsafe.Pointer((pOut + 8 /* &.a */)))) = mnX
- (*(*GeoCoord)(unsafe.Pointer((pOut + 8 /* &.a */) + 1*4))) = mnY
- (*(*GeoCoord)(unsafe.Pointer((pOut + 8 /* &.a */) + 2*4))) = mxX
- (*(*GeoCoord)(unsafe.Pointer((pOut + 8 /* &.a */) + 3*4))) = mnY
- (*(*GeoCoord)(unsafe.Pointer((pOut + 8 /* &.a */) + 4*4))) = mxX
- (*(*GeoCoord)(unsafe.Pointer((pOut + 8 /* &.a */) + 5*4))) = mxY
- (*(*GeoCoord)(unsafe.Pointer((pOut + 8 /* &.a */) + 6*4))) = mnX
- (*(*GeoCoord)(unsafe.Pointer((pOut + 8 /* &.a */) + 7*4))) = mxY
+ *(*uint8)(unsafe.Pointer(pOut + 4)) = *(*uint8)(unsafe.Pointer(bp /* &ii */))
+ *(*uint8)(unsafe.Pointer(pOut + 4 + 1)) = uint8(0)
+ *(*uint8)(unsafe.Pointer(pOut + 4 + 2)) = uint8(0)
+ *(*uint8)(unsafe.Pointer(pOut + 4 + 3)) = uint8(4)
+ *(*GeoCoord)(unsafe.Pointer(pOut + 8)) = mnX
+ *(*GeoCoord)(unsafe.Pointer(pOut + 8 + 1*4)) = mnY
+ *(*GeoCoord)(unsafe.Pointer(pOut + 8 + 2*4)) = mxX
+ *(*GeoCoord)(unsafe.Pointer(pOut + 8 + 3*4)) = mnY
+ *(*GeoCoord)(unsafe.Pointer(pOut + 8 + 4*4)) = mxX
+ *(*GeoCoord)(unsafe.Pointer(pOut + 8 + 5*4)) = mxY
+ *(*GeoCoord)(unsafe.Pointer(pOut + 8 + 6*4)) = mnX
+ *(*GeoCoord)(unsafe.Pointer(pOut + 8 + 7*4)) = mxY
goto __16
__15:
Xsqlite3_free(tls, p)
@@ -157820,7 +160050,7 @@ __3:
if !(aCoord != 0) {
goto __20
}
- libc.Xmemset(tls, aCoord, 0, (uint32(unsafe.Sizeof(RtreeCoord{})) * uint32(4)))
+ libc.Xmemset(tls, aCoord, 0, uint32(unsafe.Sizeof(RtreeCoord{}))*uint32(4))
__20:
;
__4:
@@ -157829,11 +160059,11 @@ __4:
}
// Implementation of the geopoly_bbox(X) SQL function.
-func geopolyBBoxFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:197343:13: */
+func geopolyBBoxFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:199009:13: */
var p uintptr = geopolyBBox(tls, context, *(*uintptr)(unsafe.Pointer(argv)), uintptr(0), uintptr(0))
if p != 0 {
- Xsqlite3_result_blob(tls, context, p+4, /* &.hdr */
- (4 + (8 * (*GeoPoly)(unsafe.Pointer(p)).FnVertex)), libc.UintptrFromInt32(-1))
+ Xsqlite3_result_blob(tls, context, p+4,
+ 4+8*(*GeoPoly)(unsafe.Pointer(p)).FnVertex, libc.UintptrFromInt32(-1))
Xsqlite3_free(tls, p)
}
}
@@ -157842,13 +160072,13 @@ func geopolyBBoxFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) {
type GeoBBox1 = struct {
FisInit int32
Fa [4]RtreeCoord
-} /* sqlite3.c:197359:9 */
+} /* sqlite3.c:199025:9 */
// State vector for the geopoly_group_bbox() aggregate function.
-type GeoBBox = GeoBBox1 /* sqlite3.c:197359:24 */
+type GeoBBox = GeoBBox1 /* sqlite3.c:199025:24 */
// Implementation of the geopoly_group_bbox(X) aggregate SQL function.
-func geopolyBBoxStep(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:197369:13: */
+func geopolyBBoxStep(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:199035:13: */
bp := tls.Alloc(20)
defer tls.Free(20)
@@ -157856,7 +160086,7 @@ func geopolyBBoxStep(tls *libc.TLS, context uintptr, argc int32, argv uintptr) {
*(*int32)(unsafe.Pointer(bp + 16 /* rc */)) = SQLITE_OK
geopolyBBox(tls, context, *(*uintptr)(unsafe.Pointer(argv)), bp /* &a[0] */, bp+16 /* &rc */)
- if *(*int32)(unsafe.Pointer(bp + 16 /* rc */)) == SQLITE_OK {
+ if *(*int32)(unsafe.Pointer(bp + 16)) == SQLITE_OK {
var pBBox uintptr
pBBox = Xsqlite3_aggregate_context(tls, context, int32(unsafe.Sizeof(GeoBBox{})))
if pBBox == uintptr(0) {
@@ -157864,35 +160094,35 @@ func geopolyBBoxStep(tls *libc.TLS, context uintptr, argc int32, argv uintptr) {
}
if (*GeoBBox)(unsafe.Pointer(pBBox)).FisInit == 0 {
(*GeoBBox)(unsafe.Pointer(pBBox)).FisInit = 1
- libc.Xmemcpy(tls, pBBox+4 /* &.a */, bp /* &a[0] */, (uint32(unsafe.Sizeof(RtreeCoord{})) * uint32(4)))
+ libc.Xmemcpy(tls, pBBox+4, bp /* &a[0] */, uint32(unsafe.Sizeof(RtreeCoord{}))*uint32(4))
} else {
- if *(*RtreeValue)(unsafe.Pointer(bp /* &a */)) < *(*RtreeValue)(unsafe.Pointer((pBBox + 4 /* &.a */))) {
- *(*RtreeCoord)(unsafe.Pointer((pBBox + 4 /* &.a */))) = *(*RtreeCoord)(unsafe.Pointer(bp /* &a[0] */))
+ if *(*RtreeValue)(unsafe.Pointer(bp)) < *(*RtreeValue)(unsafe.Pointer(pBBox + 4)) {
+ *(*RtreeCoord)(unsafe.Pointer(pBBox + 4)) = *(*RtreeCoord)(unsafe.Pointer(bp /* &a[0] */))
}
- if *(*RtreeValue)(unsafe.Pointer(bp /* &a */ + 1*4)) > *(*RtreeValue)(unsafe.Pointer((pBBox + 4 /* &.a */) + 1*4)) {
- *(*RtreeCoord)(unsafe.Pointer((pBBox + 4 /* &.a */) + 1*4)) = *(*RtreeCoord)(unsafe.Pointer(bp /* &a[0] */ + 1*4))
+ if *(*RtreeValue)(unsafe.Pointer(bp + 1*4)) > *(*RtreeValue)(unsafe.Pointer(pBBox + 4 + 1*4)) {
+ *(*RtreeCoord)(unsafe.Pointer(pBBox + 4 + 1*4)) = *(*RtreeCoord)(unsafe.Pointer(bp /* &a[0] */ + 1*4))
}
- if *(*RtreeValue)(unsafe.Pointer(bp /* &a */ + 2*4)) < *(*RtreeValue)(unsafe.Pointer((pBBox + 4 /* &.a */) + 2*4)) {
- *(*RtreeCoord)(unsafe.Pointer((pBBox + 4 /* &.a */) + 2*4)) = *(*RtreeCoord)(unsafe.Pointer(bp /* &a[0] */ + 2*4))
+ if *(*RtreeValue)(unsafe.Pointer(bp + 2*4)) < *(*RtreeValue)(unsafe.Pointer(pBBox + 4 + 2*4)) {
+ *(*RtreeCoord)(unsafe.Pointer(pBBox + 4 + 2*4)) = *(*RtreeCoord)(unsafe.Pointer(bp /* &a[0] */ + 2*4))
}
- if *(*RtreeValue)(unsafe.Pointer(bp /* &a */ + 3*4)) > *(*RtreeValue)(unsafe.Pointer((pBBox + 4 /* &.a */) + 3*4)) {
- *(*RtreeCoord)(unsafe.Pointer((pBBox + 4 /* &.a */) + 3*4)) = *(*RtreeCoord)(unsafe.Pointer(bp /* &a[0] */ + 3*4))
+ if *(*RtreeValue)(unsafe.Pointer(bp + 3*4)) > *(*RtreeValue)(unsafe.Pointer(pBBox + 4 + 3*4)) {
+ *(*RtreeCoord)(unsafe.Pointer(pBBox + 4 + 3*4)) = *(*RtreeCoord)(unsafe.Pointer(bp /* &a[0] */ + 3*4))
}
}
}
}
-func geopolyBBoxFinal(tls *libc.TLS, context uintptr) { /* sqlite3.c:197392:13: */
+func geopolyBBoxFinal(tls *libc.TLS, context uintptr) { /* sqlite3.c:199058:13: */
var p uintptr
var pBBox uintptr
pBBox = Xsqlite3_aggregate_context(tls, context, 0)
if pBBox == uintptr(0) {
return
}
- p = geopolyBBox(tls, context, uintptr(0), pBBox+4 /* &.a */, uintptr(0))
+ p = geopolyBBox(tls, context, uintptr(0), pBBox+4, uintptr(0))
if p != 0 {
- Xsqlite3_result_blob(tls, context, p+4, /* &.hdr */
- (4 + (8 * (*GeoPoly)(unsafe.Pointer(p)).FnVertex)), libc.UintptrFromInt32(-1))
+ Xsqlite3_result_blob(tls, context, p+4,
+ 4+8*(*GeoPoly)(unsafe.Pointer(p)).FnVertex, libc.UintptrFromInt32(-1))
Xsqlite3_free(tls, p)
}
}
@@ -157909,17 +160139,17 @@ func geopolyBBoxFinal(tls *libc.TLS, context uintptr) { /* sqlite3.c:197392:13:
//
// The left-most coordinate min(x1,x2) is not considered to be part of
// the line segment for the purposes of this analysis.
-func pointBeneathLine(tls *libc.TLS, x0 float64, y0 float64, x1 float64, y1 float64, x2 float64, y2 float64) int32 { /* sqlite3.c:197422:12: */
+func pointBeneathLine(tls *libc.TLS, x0 float64, y0 float64, x1 float64, y1 float64, x2 float64, y2 float64) int32 { /* sqlite3.c:199088:12: */
var y float64
- if (x0 == x1) && (y0 == y1) {
+ if x0 == x1 && y0 == y1 {
return 2
}
if x1 < x2 {
- if (x0 <= x1) || (x0 > x2) {
+ if x0 <= x1 || x0 > x2 {
return 0
}
} else if x1 > x2 {
- if (x0 <= x2) || (x0 > x1) {
+ if x0 <= x2 || x0 > x1 {
return 0
}
} else {
@@ -157927,15 +160157,15 @@ func pointBeneathLine(tls *libc.TLS, x0 float64, y0 float64, x1 float64, y1 floa
if x0 != x1 {
return 0
}
- if (y0 < y1) && (y0 < y2) {
+ if y0 < y1 && y0 < y2 {
return 0
}
- if (y0 > y1) && (y0 > y2) {
+ if y0 > y1 && y0 > y2 {
return 0
}
return 2
}
- y = (y1 + (((y2 - y1) * (x0 - x1)) / (x2 - x1)))
+ y = y1 + (y2-y1)*(x0-x1)/(x2-x1)
if y0 == y {
return 2
}
@@ -157950,7 +160180,7 @@ func pointBeneathLine(tls *libc.TLS, x0 float64, y0 float64, x1 float64, y1 floa
// Return +2 if point X,Y is within polygon P.
// Return +1 if point X,Y is on the polygon boundary.
// Return 0 if point X,Y is outside the polygon
-func geopolyContainsPointFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:197453:13: */
+func geopolyContainsPointFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:199119:13: */
var p1 uintptr = geopolyFuncParam(tls, context, *(*uintptr)(unsafe.Pointer(argv)), uintptr(0))
var x0 float64 = Xsqlite3_value_double(tls, *(*uintptr)(unsafe.Pointer(argv + 1*4)))
var y0 float64 = Xsqlite3_value_double(tls, *(*uintptr)(unsafe.Pointer(argv + 2*4)))
@@ -157960,21 +160190,21 @@ func geopolyContainsPointFunc(tls *libc.TLS, context uintptr, argc int32, argv u
if p1 == uintptr(0) {
return
}
- for ii = 0; ii < ((*GeoPoly)(unsafe.Pointer(p1)).FnVertex - 1); ii++ {
- v = pointBeneathLine(tls, x0, y0, float64(*(*GeoCoord)(unsafe.Pointer((p1 + 8 /* &.a */) + uintptr(((ii)*2))*4))), float64(*(*GeoCoord)(unsafe.Pointer((p1 + 8 /* &.a */) + uintptr((((ii)*2)+1))*4))),
- float64(*(*GeoCoord)(unsafe.Pointer((p1 + 8 /* &.a */) + uintptr(((ii+1)*2))*4))), float64(*(*GeoCoord)(unsafe.Pointer((p1 + 8 /* &.a */) + uintptr((((ii+1)*2)+1))*4))))
+ for ii = 0; ii < (*GeoPoly)(unsafe.Pointer(p1)).FnVertex-1; ii++ {
+ v = pointBeneathLine(tls, x0, y0, float64(*(*GeoCoord)(unsafe.Pointer(p1 + 8 + uintptr(ii*2)*4))), float64(*(*GeoCoord)(unsafe.Pointer(p1 + 8 + uintptr(ii*2+1)*4))),
+ float64(*(*GeoCoord)(unsafe.Pointer(p1 + 8 + uintptr((ii+1)*2)*4))), float64(*(*GeoCoord)(unsafe.Pointer(p1 + 8 + uintptr((ii+1)*2+1)*4))))
if v == 2 {
break
}
- cnt = cnt + (v)
+ cnt = cnt + v
}
if v != 2 {
- v = pointBeneathLine(tls, x0, y0, float64(*(*GeoCoord)(unsafe.Pointer((p1 + 8 /* &.a */) + uintptr(((ii)*2))*4))), float64(*(*GeoCoord)(unsafe.Pointer((p1 + 8 /* &.a */) + uintptr((((ii)*2)+1))*4))),
- float64(*(*GeoCoord)(unsafe.Pointer((p1 + 8 /* &.a */)))), float64(*(*GeoCoord)(unsafe.Pointer((p1 + 8 /* &.a */) + 1*4))))
+ v = pointBeneathLine(tls, x0, y0, float64(*(*GeoCoord)(unsafe.Pointer(p1 + 8 + uintptr(ii*2)*4))), float64(*(*GeoCoord)(unsafe.Pointer(p1 + 8 + uintptr(ii*2+1)*4))),
+ float64(*(*GeoCoord)(unsafe.Pointer(p1 + 8))), float64(*(*GeoCoord)(unsafe.Pointer(p1 + 8 + 1*4))))
}
if v == 2 {
Xsqlite3_result_int(tls, context, 1)
- } else if ((v + cnt) & 1) == 0 {
+ } else if (v+cnt)&1 == 0 {
Xsqlite3_result_int(tls, context, 0)
} else {
Xsqlite3_result_int(tls, context, 2)
@@ -157988,10 +160218,10 @@ func geopolyContainsPointFunc(tls *libc.TLS, context uintptr, argc int32, argv u
// Return +1 if P2 is contained within P1
// Return 0 if any part of P2 is on the outside of P1
//
-func geopolyWithinFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:197496:13: */
+func geopolyWithinFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:199162:13: */
var p1 uintptr = geopolyFuncParam(tls, context, *(*uintptr)(unsafe.Pointer(argv)), uintptr(0))
var p2 uintptr = geopolyFuncParam(tls, context, *(*uintptr)(unsafe.Pointer(argv + 1*4)), uintptr(0))
- if (p1 != 0) && (p2 != 0) {
+ if p1 != 0 && p2 != 0 {
var x int32 = geopolyOverlap(tls, p1, p2)
if x < 0 {
Xsqlite3_result_error_nomem(tls, context)
@@ -158020,10 +160250,10 @@ type GeoEvent1 = struct {
FpSeg uintptr
FpNext uintptr
F__ccgo_pad1 [4]byte
-} /* sqlite3.c:197516:9 */
+} /* sqlite3.c:199182:9 */
// Objects used by the overlap algorihm.
-type GeoEvent = GeoEvent1 /* sqlite3.c:197516:25 */
+type GeoEvent = GeoEvent1 /* sqlite3.c:199182:25 */
type GeoSegment1 = struct {
FC float64
FB float64
@@ -158033,20 +160263,20 @@ type GeoSegment1 = struct {
F__ccgo_pad1 [3]byte
Fidx uint32
FpNext uintptr
-} /* sqlite3.c:197516:9 */
+} /* sqlite3.c:199182:9 */
-type GeoSegment = GeoSegment1 /* sqlite3.c:197517:27 */
+type GeoSegment = GeoSegment1 /* sqlite3.c:199183:27 */
type GeoOverlap1 = struct {
FaEvent uintptr
FaSegment uintptr
FnEvent int32
FnSegment int32
-} /* sqlite3.c:197518:9 */
+} /* sqlite3.c:199184:9 */
-type GeoOverlap = GeoOverlap1 /* sqlite3.c:197518:27 */
+type GeoOverlap = GeoOverlap1 /* sqlite3.c:199184:27 */
// Add a single segment and its associated events.
-func geopolyAddOneSegment(tls *libc.TLS, p uintptr, x0 GeoCoord, y0 GeoCoord, x1 GeoCoord, y1 GeoCoord, side uint8, idx uint32) { /* sqlite3.c:197543:13: */
+func geopolyAddOneSegment(tls *libc.TLS, p uintptr, x0 GeoCoord, y0 GeoCoord, x1 GeoCoord, y1 GeoCoord, side uint8, idx uint32) { /* sqlite3.c:199209:13: */
var pSeg uintptr
var pEvent uintptr
if x0 == x1 {
@@ -158060,19 +160290,19 @@ func geopolyAddOneSegment(tls *libc.TLS, p uintptr, x0 GeoCoord, y0 GeoCoord, x1
y0 = y1
y1 = t
}
- pSeg = ((*GeoOverlap)(unsafe.Pointer(p)).FaSegment + uintptr((*GeoOverlap)(unsafe.Pointer(p)).FnSegment)*40)
+ pSeg = (*GeoOverlap)(unsafe.Pointer(p)).FaSegment + uintptr((*GeoOverlap)(unsafe.Pointer(p)).FnSegment)*40
(*GeoOverlap)(unsafe.Pointer(p)).FnSegment++
- (*GeoSegment)(unsafe.Pointer(pSeg)).FC = (float64((y1 - y0) / (x1 - x0)))
- (*GeoSegment)(unsafe.Pointer(pSeg)).FB = (float64(y1) - (float64(x1) * (*GeoSegment)(unsafe.Pointer(pSeg)).FC))
+ (*GeoSegment)(unsafe.Pointer(pSeg)).FC = float64((y1 - y0) / (x1 - x0))
+ (*GeoSegment)(unsafe.Pointer(pSeg)).FB = float64(y1) - float64(x1)*(*GeoSegment)(unsafe.Pointer(pSeg)).FC
(*GeoSegment)(unsafe.Pointer(pSeg)).Fy0 = y0
(*GeoSegment)(unsafe.Pointer(pSeg)).Fside = side
(*GeoSegment)(unsafe.Pointer(pSeg)).Fidx = idx
- pEvent = ((*GeoOverlap)(unsafe.Pointer(p)).FaEvent + uintptr((*GeoOverlap)(unsafe.Pointer(p)).FnEvent)*24)
+ pEvent = (*GeoOverlap)(unsafe.Pointer(p)).FaEvent + uintptr((*GeoOverlap)(unsafe.Pointer(p)).FnEvent)*24
(*GeoOverlap)(unsafe.Pointer(p)).FnEvent++
(*GeoEvent)(unsafe.Pointer(pEvent)).Fx = float64(x0)
(*GeoEvent)(unsafe.Pointer(pEvent)).FeType = 0
(*GeoEvent)(unsafe.Pointer(pEvent)).FpSeg = pSeg
- pEvent = ((*GeoOverlap)(unsafe.Pointer(p)).FaEvent + uintptr((*GeoOverlap)(unsafe.Pointer(p)).FnEvent)*24)
+ pEvent = (*GeoOverlap)(unsafe.Pointer(p)).FaEvent + uintptr((*GeoOverlap)(unsafe.Pointer(p)).FnEvent)*24
(*GeoOverlap)(unsafe.Pointer(p)).FnEvent++
(*GeoEvent)(unsafe.Pointer(pEvent)).Fx = float64(x1)
(*GeoEvent)(unsafe.Pointer(pEvent)).FeType = 1
@@ -158080,19 +160310,19 @@ func geopolyAddOneSegment(tls *libc.TLS, p uintptr, x0 GeoCoord, y0 GeoCoord, x1
}
// Insert all segments and events for polygon pPoly.
-func geopolyAddSegments(tls *libc.TLS, p uintptr, pPoly uintptr, side uint8) { /* sqlite3.c:197587:13: */
+func geopolyAddSegments(tls *libc.TLS, p uintptr, pPoly uintptr, side uint8) { /* sqlite3.c:199253:13: */
var i uint32
var x uintptr
- for i = uint32(0); i < (uint32((*GeoPoly)(unsafe.Pointer(pPoly)).FnVertex) - uint32(1)); i++ {
- x = ((pPoly + 8 /* &.a */) + uintptr(((i)*uint32(2)))*4)
+ for i = uint32(0); i < uint32((*GeoPoly)(unsafe.Pointer(pPoly)).FnVertex)-uint32(1); i++ {
+ x = pPoly + 8 + uintptr(i*uint32(2))*4
geopolyAddOneSegment(tls, p, *(*GeoCoord)(unsafe.Pointer(x)), *(*GeoCoord)(unsafe.Pointer(x + 1*4)), *(*GeoCoord)(unsafe.Pointer(x + 2*4)), *(*GeoCoord)(unsafe.Pointer(x + 3*4)), side, i)
}
- x = ((pPoly + 8 /* &.a */) + uintptr(((i)*uint32(2)))*4)
- geopolyAddOneSegment(tls, p, *(*GeoCoord)(unsafe.Pointer(x)), *(*GeoCoord)(unsafe.Pointer(x + 1*4)), *(*GeoCoord)(unsafe.Pointer((pPoly + 8 /* &.a */))), *(*GeoCoord)(unsafe.Pointer((pPoly + 8 /* &.a */) + 1*4)), side, i)
+ x = pPoly + 8 + uintptr(i*uint32(2))*4
+ geopolyAddOneSegment(tls, p, *(*GeoCoord)(unsafe.Pointer(x)), *(*GeoCoord)(unsafe.Pointer(x + 1*4)), *(*GeoCoord)(unsafe.Pointer(pPoly + 8)), *(*GeoCoord)(unsafe.Pointer(pPoly + 8 + 1*4)), side, i)
}
// Merge two lists of sorted events by X coordinate
-func geopolyEventMerge(tls *libc.TLS, pLeft uintptr, pRight uintptr) uintptr { /* sqlite3.c:197605:17: */
+func geopolyEventMerge(tls *libc.TLS, pLeft uintptr, pRight uintptr) uintptr { /* sqlite3.c:199271:17: */
bp := tls.Alloc(24)
defer tls.Free(24)
@@ -158101,7 +160331,7 @@ func geopolyEventMerge(tls *libc.TLS, pLeft uintptr, pRight uintptr) uintptr { /
var pLast uintptr
(*GeoEvent)(unsafe.Pointer(bp /* &head */)).FpNext = uintptr(0)
pLast = bp /* &head */
- for (pRight != 0) && (pLeft != 0) {
+ for pRight != 0 && pLeft != 0 {
if (*GeoEvent)(unsafe.Pointer(pRight)).Fx <= (*GeoEvent)(unsafe.Pointer(pLeft)).Fx {
(*GeoEvent)(unsafe.Pointer(pLast)).FpNext = pRight
pLast = pRight
@@ -158122,7 +160352,7 @@ func geopolyEventMerge(tls *libc.TLS, pLeft uintptr, pRight uintptr) uintptr { /
}
// Sort an array of nEvent event objects into a list.
-func geopolySortEventsByX(tls *libc.TLS, aEvent uintptr, nEvent int32) uintptr { /* sqlite3.c:197627:17: */
+func geopolySortEventsByX(tls *libc.TLS, aEvent uintptr, nEvent int32) uintptr { /* sqlite3.c:199293:17: */
bp := tls.Alloc(200)
defer tls.Free(200)
@@ -158133,15 +160363,15 @@ func geopolySortEventsByX(tls *libc.TLS, aEvent uintptr, nEvent int32) uintptr {
// var a [50]uintptr at bp, 200
for i = 0; i < nEvent; i++ {
- p = (aEvent + uintptr(i)*24)
+ p = aEvent + uintptr(i)*24
(*GeoEvent)(unsafe.Pointer(p)).FpNext = uintptr(0)
- for j = 0; (j < mx) && (*(*uintptr)(unsafe.Pointer(bp /* &a[0] */ + uintptr(j)*4)) != 0); j++ {
+ for j = 0; j < mx && *(*uintptr)(unsafe.Pointer(bp /* &a[0] */ + uintptr(j)*4)) != 0; j++ {
p = geopolyEventMerge(tls, *(*uintptr)(unsafe.Pointer(bp /* &a[0] */ + uintptr(j)*4)), p)
*(*uintptr)(unsafe.Pointer(bp /* &a[0] */ + uintptr(j)*4)) = uintptr(0)
}
*(*uintptr)(unsafe.Pointer(bp /* &a[0] */ + uintptr(j)*4)) = p
if j >= mx {
- mx = (j + 1)
+ mx = j + 1
}
}
p = uintptr(0)
@@ -158152,7 +160382,7 @@ func geopolySortEventsByX(tls *libc.TLS, aEvent uintptr, nEvent int32) uintptr {
}
// Merge two lists of sorted segments by Y, and then by C.
-func geopolySegmentMerge(tls *libc.TLS, pLeft uintptr, pRight uintptr) uintptr { /* sqlite3.c:197652:19: */
+func geopolySegmentMerge(tls *libc.TLS, pLeft uintptr, pRight uintptr) uintptr { /* sqlite3.c:199318:19: */
bp := tls.Alloc(40)
defer tls.Free(40)
@@ -158161,10 +160391,10 @@ func geopolySegmentMerge(tls *libc.TLS, pLeft uintptr, pRight uintptr) uintptr {
var pLast uintptr
(*GeoSegment)(unsafe.Pointer(bp /* &head */)).FpNext = uintptr(0)
pLast = bp /* &head */
- for (pRight != 0) && (pLeft != 0) {
- var r float64 = ((*GeoSegment)(unsafe.Pointer(pRight)).Fy - (*GeoSegment)(unsafe.Pointer(pLeft)).Fy)
+ for pRight != 0 && pLeft != 0 {
+ var r float64 = (*GeoSegment)(unsafe.Pointer(pRight)).Fy - (*GeoSegment)(unsafe.Pointer(pLeft)).Fy
if r == 0.0 {
- r = ((*GeoSegment)(unsafe.Pointer(pRight)).FC - (*GeoSegment)(unsafe.Pointer(pLeft)).FC)
+ r = (*GeoSegment)(unsafe.Pointer(pRight)).FC - (*GeoSegment)(unsafe.Pointer(pLeft)).FC
}
if r < 0.0 {
(*GeoSegment)(unsafe.Pointer(pLast)).FpNext = pRight
@@ -158187,7 +160417,7 @@ func geopolySegmentMerge(tls *libc.TLS, pLeft uintptr, pRight uintptr) uintptr {
// Sort a list of GeoSegments in order of increasing Y and in the event of
// a tie, increasing C (slope).
-func geopolySortSegmentsByYAndC(tls *libc.TLS, pList uintptr) uintptr { /* sqlite3.c:197677:19: */
+func geopolySortSegmentsByYAndC(tls *libc.TLS, pList uintptr) uintptr { /* sqlite3.c:199343:19: */
bp := tls.Alloc(200)
defer tls.Free(200)
@@ -158200,13 +160430,13 @@ func geopolySortSegmentsByYAndC(tls *libc.TLS, pList uintptr) uintptr { /* sqlit
p = pList
pList = (*GeoSegment)(unsafe.Pointer(pList)).FpNext
(*GeoSegment)(unsafe.Pointer(p)).FpNext = uintptr(0)
- for i = 0; (i < mx) && (*(*uintptr)(unsafe.Pointer(bp /* &a[0] */ + uintptr(i)*4)) != 0); i++ {
+ for i = 0; i < mx && *(*uintptr)(unsafe.Pointer(bp /* &a[0] */ + uintptr(i)*4)) != 0; i++ {
p = geopolySegmentMerge(tls, *(*uintptr)(unsafe.Pointer(bp /* &a[0] */ + uintptr(i)*4)), p)
*(*uintptr)(unsafe.Pointer(bp /* &a[0] */ + uintptr(i)*4)) = uintptr(0)
}
*(*uintptr)(unsafe.Pointer(bp /* &a[0] */ + uintptr(i)*4)) = p
if i >= mx {
- mx = (i + 1)
+ mx = i + 1
}
}
p = uintptr(0)
@@ -158217,7 +160447,7 @@ func geopolySortSegmentsByYAndC(tls *libc.TLS, pList uintptr) uintptr { /* sqlit
}
// Determine the overlap between two polygons
-func geopolyOverlap(tls *libc.TLS, p1 uintptr, p2 uintptr) int32 { /* sqlite3.c:197703:12: */
+func geopolyOverlap(tls *libc.TLS, p1 uintptr, p2 uintptr) int32 { /* sqlite3.c:199369:12: */
bp := tls.Alloc(4)
defer tls.Free(4)
@@ -158235,14 +160465,14 @@ func geopolyOverlap(tls *libc.TLS, p1 uintptr, p2 uintptr) int32 { /* sqlite3.c:
var y float64
var pPrev uintptr
var iMask int32
- nVertex = (Sqlite3_int64(((*GeoPoly)(unsafe.Pointer(p1)).FnVertex + (*GeoPoly)(unsafe.Pointer(p2)).FnVertex) + 2))
+ nVertex = Sqlite3_int64((*GeoPoly)(unsafe.Pointer(p1)).FnVertex + (*GeoPoly)(unsafe.Pointer(p2)).FnVertex + 2)
rc = 0
needSort = 0
pActive = uintptr(0)
- nByte = ((((Sqlite3_int64(unsafe.Sizeof(GeoEvent{})) * nVertex) * int64(2)) +
- (Sqlite3_int64(unsafe.Sizeof(GeoSegment{})) * nVertex)) +
- Sqlite3_int64(unsafe.Sizeof(GeoOverlap{})))
+ nByte = Sqlite3_int64(unsafe.Sizeof(GeoEvent{}))*nVertex*int64(2) +
+ Sqlite3_int64(unsafe.Sizeof(GeoSegment{}))*nVertex +
+ Sqlite3_int64(unsafe.Sizeof(GeoOverlap{}))
p = Xsqlite3_malloc64(tls, uint64(nByte))
if !(p == uintptr(0)) {
goto __1
@@ -158250,13 +160480,13 @@ func geopolyOverlap(tls *libc.TLS, p1 uintptr, p2 uintptr) int32 { /* sqlite3.c:
return -1
__1:
;
- (*GeoOverlap)(unsafe.Pointer(p)).FaEvent = (p + 1*16)
- (*GeoOverlap)(unsafe.Pointer(p)).FaSegment = ((*GeoOverlap)(unsafe.Pointer(p)).FaEvent + uintptr((nVertex*int64(2)))*24)
- (*GeoOverlap)(unsafe.Pointer(p)).FnEvent = libc.AssignPtrInt32(p+12 /* &.nSegment */, 0)
+ (*GeoOverlap)(unsafe.Pointer(p)).FaEvent = p + 1*16
+ (*GeoOverlap)(unsafe.Pointer(p)).FaSegment = (*GeoOverlap)(unsafe.Pointer(p)).FaEvent + uintptr(nVertex*int64(2))*24
+ (*GeoOverlap)(unsafe.Pointer(p)).FnEvent = libc.AssignPtrInt32(p+12, 0)
geopolyAddSegments(tls, p, p1, uint8(1))
geopolyAddSegments(tls, p, p2, uint8(2))
pThisEvent = geopolySortEventsByX(tls, (*GeoOverlap)(unsafe.Pointer(p)).FaEvent, (*GeoOverlap)(unsafe.Pointer(p)).FnEvent)
- if (pThisEvent != 0) && ((*GeoEvent)(unsafe.Pointer(pThisEvent)).Fx == 0.0) {
+ if pThisEvent != 0 && (*GeoEvent)(unsafe.Pointer(pThisEvent)).Fx == 0.0 {
rX = -1.0
} else {
rX = 0.0
@@ -158298,7 +160528,7 @@ __10:
;
__9:
;
- iMask = iMask ^ (int32((*GeoSegment)(unsafe.Pointer(pSeg)).Fside))
+ iMask = iMask ^ int32((*GeoSegment)(unsafe.Pointer(pSeg)).Fside)
pPrev = pSeg
goto __7
__7:
@@ -158313,13 +160543,13 @@ __11:
if !(pSeg != 0) {
goto __13
}
- y = (((*GeoSegment)(unsafe.Pointer(pSeg)).FC * rX) + (*GeoSegment)(unsafe.Pointer(pSeg)).FB)
+ y = (*GeoSegment)(unsafe.Pointer(pSeg)).FC*rX + (*GeoSegment)(unsafe.Pointer(pSeg)).FB
(*GeoSegment)(unsafe.Pointer(pSeg)).Fy = y
if !(pPrev != 0) {
goto __14
}
- if !(((*GeoSegment)(unsafe.Pointer(pPrev)).Fy > (*GeoSegment)(unsafe.Pointer(pSeg)).Fy) && (int32((*GeoSegment)(unsafe.Pointer(pPrev)).Fside) != int32((*GeoSegment)(unsafe.Pointer(pSeg)).Fside))) {
+ if !((*GeoSegment)(unsafe.Pointer(pPrev)).Fy > (*GeoSegment)(unsafe.Pointer(pSeg)).Fy && int32((*GeoSegment)(unsafe.Pointer(pPrev)).Fside) != int32((*GeoSegment)(unsafe.Pointer(pSeg)).Fside)) {
goto __15
}
rc = 1
@@ -158338,7 +160568,7 @@ __16:
;
__14:
;
- iMask = iMask ^ (int32((*GeoSegment)(unsafe.Pointer(pSeg)).Fside))
+ iMask = iMask ^ int32((*GeoSegment)(unsafe.Pointer(pSeg)).Fside)
pPrev = pSeg
goto __12
__12:
@@ -158365,7 +160595,11 @@ __18:
if !(pActive == (*GeoEvent)(unsafe.Pointer(pThisEvent)).FpSeg) {
goto __20
}
- pActive = (*GeoSegment)(unsafe.Pointer(pActive)).FpNext
+ if pActive != 0 {
+ pActive = (*GeoSegment)(unsafe.Pointer(pActive)).FpNext
+ } else {
+ pActive = uintptr(0)
+ }
goto __21
__20:
pSeg = pActive
@@ -158376,7 +160610,12 @@ __22:
if !((*GeoSegment)(unsafe.Pointer(pSeg)).FpNext == (*GeoEvent)(unsafe.Pointer(pThisEvent)).FpSeg) {
goto __25
}
- (*GeoSegment)(unsafe.Pointer(pSeg)).FpNext = (*GeoSegment)(unsafe.Pointer((*GeoSegment)(unsafe.Pointer(pSeg)).FpNext)).FpNext
+ (*GeoSegment)(unsafe.Pointer(pSeg)).FpNext = func() uintptr {
+ if (*GeoSegment)(unsafe.Pointer(pSeg)).FpNext != 0 {
+ return (*GeoSegment)(unsafe.Pointer((*GeoSegment)(unsafe.Pointer(pSeg)).FpNext)).FpNext
+ }
+ return uintptr(0)
+ }()
goto __24
__25:
;
@@ -158395,25 +160634,25 @@ __19:
goto __2
__3:
;
- if !(int32(*(*uint8)(unsafe.Pointer(bp /* &aOverlap[0] */ + 3))) == 0) {
+ if !(int32(*(*uint8)(unsafe.Pointer(bp + 3))) == 0) {
goto __26
}
rc = 0
goto __27
__26:
- if !((int32(*(*uint8)(unsafe.Pointer(bp /* &aOverlap[0] */ + 1))) != 0) && (int32(*(*uint8)(unsafe.Pointer(bp /* &aOverlap[0] */ + 2))) == 0)) {
+ if !(int32(*(*uint8)(unsafe.Pointer(bp + 1))) != 0 && int32(*(*uint8)(unsafe.Pointer(bp + 2))) == 0) {
goto __28
}
rc = 3
goto __29
__28:
- if !((int32(*(*uint8)(unsafe.Pointer(bp /* &aOverlap[0] */ + 1))) == 0) && (int32(*(*uint8)(unsafe.Pointer(bp /* &aOverlap[0] */ + 2))) != 0)) {
+ if !(int32(*(*uint8)(unsafe.Pointer(bp + 1))) == 0 && int32(*(*uint8)(unsafe.Pointer(bp + 2))) != 0) {
goto __30
}
rc = 2
goto __31
__30:
- if !((int32(*(*uint8)(unsafe.Pointer(bp /* &aOverlap[0] */ + 1))) == 0) && (int32(*(*uint8)(unsafe.Pointer(bp /* &aOverlap[0] */ + 2))) == 0)) {
+ if !(int32(*(*uint8)(unsafe.Pointer(bp + 1))) == 0 && int32(*(*uint8)(unsafe.Pointer(bp + 2))) == 0) {
goto __32
}
rc = 4
@@ -158444,10 +160683,10 @@ geopolyOverlapDone:
// 3 P2 is completely contained within P1
// 4 P1 and P2 are the same polygon
// NULL Either P1 or P2 or both are not valid polygons
-func geopolyOverlapFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:197826:13: */
+func geopolyOverlapFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:199492:13: */
var p1 uintptr = geopolyFuncParam(tls, context, *(*uintptr)(unsafe.Pointer(argv)), uintptr(0))
var p2 uintptr = geopolyFuncParam(tls, context, *(*uintptr)(unsafe.Pointer(argv + 1*4)), uintptr(0))
- if (p1 != 0) && (p2 != 0) {
+ if p1 != 0 && p2 != 0 {
var x int32 = geopolyOverlap(tls, p1, p2)
if x < 0 {
Xsqlite3_result_error_nomem(tls, context)
@@ -158460,7 +160699,7 @@ func geopolyOverlapFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr
}
// Enable or disable debugging output
-func geopolyDebugFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:197848:13: */
+func geopolyDebugFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:199514:13: */
}
// This function is the implementation of both the xConnect and xCreate
@@ -158470,7 +160709,7 @@ func geopolyDebugFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr)
// argv[1] -> database name
// argv[2] -> table name
// argv[...] -> column names...
-func geopolyInit(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uintptr, ppVtab uintptr, pzErr uintptr, isCreate int32) int32 { /* sqlite3.c:197867:12: */
+func geopolyInit(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uintptr, ppVtab uintptr, pzErr uintptr, isCreate int32) int32 { /* sqlite3.c:199533:12: */
bp := tls.Alloc(32)
defer tls.Free(32)
@@ -158488,18 +160727,18 @@ func geopolyInit(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uintp
// Allocate the sqlite3_vtab structure
nDb = Sqlite3_int64(libc.Xstrlen(tls, *(*uintptr)(unsafe.Pointer(argv + 1*4))))
nName = Sqlite3_int64(libc.Xstrlen(tls, *(*uintptr)(unsafe.Pointer(argv + 2*4))))
- pRtree = Xsqlite3_malloc64(tls, (uint64(((Sqlite3_int64(unsafe.Sizeof(Rtree{})) + nDb) + nName) + int64(2))))
- if !(!(pRtree != 0)) {
+ pRtree = Xsqlite3_malloc64(tls, uint64(Sqlite3_int64(unsafe.Sizeof(Rtree{}))+nDb+nName+int64(2)))
+ if !!(pRtree != 0) {
goto __1
}
return SQLITE_NOMEM
__1:
;
- libc.Xmemset(tls, pRtree, 0, (uint32(((Sqlite3_int64(unsafe.Sizeof(Rtree{})) + nDb) + nName) + int64(2))))
+ libc.Xmemset(tls, pRtree, 0, uint32(Sqlite3_int64(unsafe.Sizeof(Rtree{}))+nDb+nName+int64(2)))
(*Rtree)(unsafe.Pointer(pRtree)).FnBusy = U32(1)
(*Rtree)(unsafe.Pointer(pRtree)).Fbase.FpModule = uintptr(unsafe.Pointer(&rtreeModule))
- (*Rtree)(unsafe.Pointer(pRtree)).FzDb = (pRtree + 1*504)
- (*Rtree)(unsafe.Pointer(pRtree)).FzName = ((*Rtree)(unsafe.Pointer(pRtree)).FzDb + uintptr((nDb + int64(1))))
+ (*Rtree)(unsafe.Pointer(pRtree)).FzDb = pRtree + 1*504
+ (*Rtree)(unsafe.Pointer(pRtree)).FzName = (*Rtree)(unsafe.Pointer(pRtree)).FzDb + uintptr(nDb+int64(1))
(*Rtree)(unsafe.Pointer(pRtree)).FeCoordType = U8(RTREE_COORD_REAL32)
(*Rtree)(unsafe.Pointer(pRtree)).FnDim = U8(2)
(*Rtree)(unsafe.Pointer(pRtree)).FnDim2 = U8(4)
@@ -158510,7 +160749,7 @@ __1:
// that is successful, call sqlite3_declare_vtab() to configure
// the r-tree table schema.
pSql = Xsqlite3_str_new(tls, db)
- Xsqlite3_str_appendf(tls, pSql, ts+25801 /* "CREATE TABLE x(_..." */, 0)
+ Xsqlite3_str_appendf(tls, pSql, ts+27098 /* "CREATE TABLE x(_..." */, 0)
(*Rtree)(unsafe.Pointer(pRtree)).FnAux = U8(1) // Add one for _shape
(*Rtree)(unsafe.Pointer(pRtree)).FnAuxNotNull = U8(1) // The _shape column is always not-null
ii = 3
@@ -158519,7 +160758,7 @@ __2:
goto __4
}
(*Rtree)(unsafe.Pointer(pRtree)).FnAux++
- Xsqlite3_str_appendf(tls, pSql, ts+25823 /* ",%s" */, libc.VaList(bp+8, *(*uintptr)(unsafe.Pointer(argv + uintptr(ii)*4))))
+ Xsqlite3_str_appendf(tls, pSql, ts+27120 /* ",%s" */, libc.VaList(bp+8, *(*uintptr)(unsafe.Pointer(argv + uintptr(ii)*4))))
goto __3
__3:
ii++
@@ -158527,18 +160766,18 @@ __3:
goto __4
__4:
;
- Xsqlite3_str_appendf(tls, pSql, ts+24890 /* ");" */, 0)
+ Xsqlite3_str_appendf(tls, pSql, ts+26187 /* ");" */, 0)
zSql = Xsqlite3_str_finish(tls, pSql)
- if !(!(zSql != 0)) {
+ if !!(zSql != 0) {
goto __5
}
rc = SQLITE_NOMEM
goto __6
__5:
- if !(SQLITE_OK != (libc.AssignInt32(&rc, Xsqlite3_declare_vtab(tls, db, zSql)))) {
+ if !(SQLITE_OK != libc.AssignInt32(&rc, Xsqlite3_declare_vtab(tls, db, zSql))) {
goto __7
}
- *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, ts+2790 /* "%s" */, libc.VaList(bp+16, Xsqlite3_errmsg(tls, db)))
+ *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, ts+3601 /* "%s" */, libc.VaList(bp+16, Xsqlite3_errmsg(tls, db)))
__7:
;
__6:
@@ -158550,7 +160789,7 @@ __6:
goto geopolyInit_fail
__8:
;
- (*Rtree)(unsafe.Pointer(pRtree)).FnBytesPerCell = (U8(8 + (int32((*Rtree)(unsafe.Pointer(pRtree)).FnDim2) * 4)))
+ (*Rtree)(unsafe.Pointer(pRtree)).FnBytesPerCell = U8(8 + int32((*Rtree)(unsafe.Pointer(pRtree)).FnDim2)*4)
// Figure out the node size to use.
rc = getNodeSize(tls, db, pRtree, isCreate, pzErr)
@@ -158564,7 +160803,7 @@ __9:
if !(rc != 0) {
goto __10
}
- *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, ts+2790 /* "%s" */, libc.VaList(bp+24, Xsqlite3_errmsg(tls, db)))
+ *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, ts+3601 /* "%s" */, libc.VaList(bp+24, Xsqlite3_errmsg(tls, db)))
goto geopolyInit_fail
__10:
;
@@ -158585,12 +160824,12 @@ __11:
}
// GEOPOLY virtual table module xCreate method.
-func geopolyCreate(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uintptr, ppVtab uintptr, pzErr uintptr) int32 { /* sqlite3.c:197951:12: */
+func geopolyCreate(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uintptr, ppVtab uintptr, pzErr uintptr) int32 { /* sqlite3.c:199617:12: */
return geopolyInit(tls, db, pAux, argc, argv, ppVtab, pzErr, 1)
}
// GEOPOLY virtual table module xConnect method.
-func geopolyConnect(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uintptr, ppVtab uintptr, pzErr uintptr) int32 { /* sqlite3.c:197964:12: */
+func geopolyConnect(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uintptr, ppVtab uintptr, pzErr uintptr) int32 { /* sqlite3.c:199630:12: */
return geopolyInit(tls, db, pAux, argc, argv, ppVtab, pzErr, 0)
}
@@ -158604,7 +160843,7 @@ func geopolyConnect(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv ui
// 3 search for objects overlapping the same bounding box
// that contains polygon argv[0]
// 4 full table scan
-func geopolyFilter(tls *libc.TLS, pVtabCursor uintptr, idxNum int32, idxStr uintptr, argc int32, argv uintptr) int32 { /* sqlite3.c:197987:12: */
+func geopolyFilter(tls *libc.TLS, pVtabCursor uintptr, idxNum int32, idxStr uintptr, argc int32, argv uintptr) int32 { /* sqlite3.c:199653:12: */
bp := tls.Alloc(44)
defer tls.Free(44)
@@ -158645,12 +160884,12 @@ func geopolyFilter(tls *libc.TLS, pVtabCursor uintptr, idxNum int32, idxStr uint
iRowid = Xsqlite3_value_int64(tls, *(*uintptr)(unsafe.Pointer(argv)))
*(*I64)(unsafe.Pointer(bp + 8 /* iNode */)) = int64(0)
*(*int32)(unsafe.Pointer(bp + 40 /* rc */)) = findLeafNode(tls, pRtree, iRowid, bp /* &pLeaf */, bp+8 /* &iNode */)
- if !((*(*int32)(unsafe.Pointer(bp + 40 /* rc */)) == SQLITE_OK) && (*(*uintptr)(unsafe.Pointer(bp /* pLeaf */)) != uintptr(0))) {
+ if !(*(*int32)(unsafe.Pointer(bp + 40)) == SQLITE_OK && *(*uintptr)(unsafe.Pointer(bp)) != uintptr(0)) {
goto __3
}
p = rtreeSearchPointNew(tls, pCsr, 0.0, uint8(0))
// Always returns pCsr->sPoint
- *(*uintptr)(unsafe.Pointer((pCsr + 64 /* &.aNode */))) = *(*uintptr)(unsafe.Pointer(bp /* pLeaf */))
+ *(*uintptr)(unsafe.Pointer(pCsr + 64)) = *(*uintptr)(unsafe.Pointer(bp /* pLeaf */))
(*RtreeSearchPoint)(unsafe.Pointer(p)).Fid = *(*I64)(unsafe.Pointer(bp + 8 /* iNode */))
(*RtreeSearchPoint)(unsafe.Pointer(p)).FeWithin = U8(PARTLY_WITHIN)
*(*int32)(unsafe.Pointer(bp + 40 /* rc */)) = nodeRowidIndex(tls, pRtree, *(*uintptr)(unsafe.Pointer(bp /* pLeaf */)), iRowid, bp+16 /* &iCell */)
@@ -158666,18 +160905,18 @@ __1:
// Normal case - r-tree scan. Set up the RtreeCursor.aConstraint array
// with the configured constraints.
*(*int32)(unsafe.Pointer(bp + 40 /* rc */)) = nodeAcquire(tls, pRtree, int64(1), uintptr(0), bp+20 /* &pRoot */)
- if !((*(*int32)(unsafe.Pointer(bp + 40 /* rc */)) == SQLITE_OK) && (idxNum <= 3)) {
+ if !(*(*int32)(unsafe.Pointer(bp + 40)) == SQLITE_OK && idxNum <= 3) {
goto __5
}
geopolyBBox(tls, uintptr(0), *(*uintptr)(unsafe.Pointer(argv)), bp+24 /* &bbox[0] */, bp+40 /* &rc */)
- if !(*(*int32)(unsafe.Pointer(bp + 40 /* rc */)) != 0) {
+ if !(*(*int32)(unsafe.Pointer(bp + 40)) != 0) {
goto __6
}
goto geopoly_filter_end
__6:
;
- (*RtreeCursor)(unsafe.Pointer(pCsr)).FaConstraint = libc.AssignUintptr(&p1, Xsqlite3_malloc(tls, (int32(uint32(unsafe.Sizeof(RtreeConstraint{}))*uint32(4)))))
+ (*RtreeCursor)(unsafe.Pointer(pCsr)).FaConstraint = libc.AssignUintptr(&p1, Xsqlite3_malloc(tls, int32(uint32(unsafe.Sizeof(RtreeConstraint{}))*uint32(4))))
(*RtreeCursor)(unsafe.Pointer(pCsr)).FnConstraint = 4
if !(p1 == uintptr(0)) {
goto __7
@@ -158685,55 +160924,55 @@ __6:
*(*int32)(unsafe.Pointer(bp + 40 /* rc */)) = SQLITE_NOMEM
goto __8
__7:
- libc.Xmemset(tls, (*RtreeCursor)(unsafe.Pointer(pCsr)).FaConstraint, 0, (uint32(unsafe.Sizeof(RtreeConstraint{})) * uint32(4)))
- libc.Xmemset(tls, pCsr+84 /* &.anQueue */, 0, (uint32(unsafe.Sizeof(U32(0))) * (uint32((*Rtree)(unsafe.Pointer(pRtree)).FiDepth + 1))))
+ libc.Xmemset(tls, (*RtreeCursor)(unsafe.Pointer(pCsr)).FaConstraint, 0, uint32(unsafe.Sizeof(RtreeConstraint{}))*uint32(4))
+ libc.Xmemset(tls, pCsr+84, 0, uint32(unsafe.Sizeof(U32(0)))*uint32((*Rtree)(unsafe.Pointer(pRtree)).FiDepth+1))
if !(idxNum == 2) {
goto __9
}
// Overlap query
(*RtreeConstraint)(unsafe.Pointer(p1)).Fop = 'B'
(*RtreeConstraint)(unsafe.Pointer(p1)).FiCoord = 0
- *(*RtreeDValue)(unsafe.Pointer(p1 + 8 /* &.u */)) = RtreeDValue(*(*RtreeValue)(unsafe.Pointer(bp + 24 /* &bbox */ + 1*4)))
+ *(*RtreeDValue)(unsafe.Pointer(p1 + 8)) = RtreeDValue(*(*RtreeValue)(unsafe.Pointer(bp + 24 + 1*4)))
p1 += 24
(*RtreeConstraint)(unsafe.Pointer(p1)).Fop = 'D'
(*RtreeConstraint)(unsafe.Pointer(p1)).FiCoord = 1
- *(*RtreeDValue)(unsafe.Pointer(p1 + 8 /* &.u */)) = RtreeDValue(*(*RtreeValue)(unsafe.Pointer(bp + 24 /* &bbox */)))
+ *(*RtreeDValue)(unsafe.Pointer(p1 + 8)) = RtreeDValue(*(*RtreeValue)(unsafe.Pointer(bp + 24)))
p1 += 24
(*RtreeConstraint)(unsafe.Pointer(p1)).Fop = 'B'
(*RtreeConstraint)(unsafe.Pointer(p1)).FiCoord = 2
- *(*RtreeDValue)(unsafe.Pointer(p1 + 8 /* &.u */)) = RtreeDValue(*(*RtreeValue)(unsafe.Pointer(bp + 24 /* &bbox */ + 3*4)))
+ *(*RtreeDValue)(unsafe.Pointer(p1 + 8)) = RtreeDValue(*(*RtreeValue)(unsafe.Pointer(bp + 24 + 3*4)))
p1 += 24
(*RtreeConstraint)(unsafe.Pointer(p1)).Fop = 'D'
(*RtreeConstraint)(unsafe.Pointer(p1)).FiCoord = 3
- *(*RtreeDValue)(unsafe.Pointer(p1 + 8 /* &.u */)) = RtreeDValue(*(*RtreeValue)(unsafe.Pointer(bp + 24 /* &bbox */ + 2*4)))
+ *(*RtreeDValue)(unsafe.Pointer(p1 + 8)) = RtreeDValue(*(*RtreeValue)(unsafe.Pointer(bp + 24 + 2*4)))
goto __10
__9:
// Within query
(*RtreeConstraint)(unsafe.Pointer(p1)).Fop = 'D'
(*RtreeConstraint)(unsafe.Pointer(p1)).FiCoord = 0
- *(*RtreeDValue)(unsafe.Pointer(p1 + 8 /* &.u */)) = RtreeDValue(*(*RtreeValue)(unsafe.Pointer(bp + 24 /* &bbox */)))
+ *(*RtreeDValue)(unsafe.Pointer(p1 + 8)) = RtreeDValue(*(*RtreeValue)(unsafe.Pointer(bp + 24)))
p1 += 24
(*RtreeConstraint)(unsafe.Pointer(p1)).Fop = 'B'
(*RtreeConstraint)(unsafe.Pointer(p1)).FiCoord = 1
- *(*RtreeDValue)(unsafe.Pointer(p1 + 8 /* &.u */)) = RtreeDValue(*(*RtreeValue)(unsafe.Pointer(bp + 24 /* &bbox */ + 1*4)))
+ *(*RtreeDValue)(unsafe.Pointer(p1 + 8)) = RtreeDValue(*(*RtreeValue)(unsafe.Pointer(bp + 24 + 1*4)))
p1 += 24
(*RtreeConstraint)(unsafe.Pointer(p1)).Fop = 'D'
(*RtreeConstraint)(unsafe.Pointer(p1)).FiCoord = 2
- *(*RtreeDValue)(unsafe.Pointer(p1 + 8 /* &.u */)) = RtreeDValue(*(*RtreeValue)(unsafe.Pointer(bp + 24 /* &bbox */ + 2*4)))
+ *(*RtreeDValue)(unsafe.Pointer(p1 + 8)) = RtreeDValue(*(*RtreeValue)(unsafe.Pointer(bp + 24 + 2*4)))
p1 += 24
(*RtreeConstraint)(unsafe.Pointer(p1)).Fop = 'B'
(*RtreeConstraint)(unsafe.Pointer(p1)).FiCoord = 3
- *(*RtreeDValue)(unsafe.Pointer(p1 + 8 /* &.u */)) = RtreeDValue(*(*RtreeValue)(unsafe.Pointer(bp + 24 /* &bbox */ + 3*4)))
+ *(*RtreeDValue)(unsafe.Pointer(p1 + 8)) = RtreeDValue(*(*RtreeValue)(unsafe.Pointer(bp + 24 + 3*4)))
__10:
;
__8:
;
__5:
;
- if !(*(*int32)(unsafe.Pointer(bp + 40 /* rc */)) == SQLITE_OK) {
+ if !(*(*int32)(unsafe.Pointer(bp + 40)) == SQLITE_OK) {
goto __11
}
- pNew = rtreeSearchPointNew(tls, pCsr, 0.0, (U8((*Rtree)(unsafe.Pointer(pRtree)).FiDepth + 1)))
+ pNew = rtreeSearchPointNew(tls, pCsr, 0.0, U8((*Rtree)(unsafe.Pointer(pRtree)).FiDepth+1))
if !(pNew == uintptr(0)) {
goto __12
}
@@ -158745,7 +160984,7 @@ __12:
(*RtreeSearchPoint)(unsafe.Pointer(pNew)).FiCell = U8(0)
(*RtreeSearchPoint)(unsafe.Pointer(pNew)).FeWithin = U8(PARTLY_WITHIN)
- *(*uintptr)(unsafe.Pointer((pCsr + 64 /* &.aNode */))) = *(*uintptr)(unsafe.Pointer(bp + 20 /* pRoot */))
+ *(*uintptr)(unsafe.Pointer(pCsr + 64)) = *(*uintptr)(unsafe.Pointer(bp + 20 /* pRoot */))
*(*uintptr)(unsafe.Pointer(bp + 20 /* pRoot */)) = uintptr(0)
*(*int32)(unsafe.Pointer(bp + 40 /* rc */)) = rtreeStepToLeaf(tls, pCsr)
@@ -158771,33 +161010,33 @@ geopoly_filter_end:
// 3 "rtree" R-tree within query using geopoly_within()
// 4 "fullscan" full-table scan.
// ------------------------------------------------
-func geopolyBestIndex(tls *libc.TLS, tab uintptr, pIdxInfo uintptr) int32 { /* sqlite3.c:198118:12: */
+func geopolyBestIndex(tls *libc.TLS, tab uintptr, pIdxInfo uintptr) int32 { /* sqlite3.c:199785:12: */
var ii int32
var iRowidTerm int32 = -1
var iFuncTerm int32 = -1
var idxNum int32 = 0
for ii = 0; ii < (*Sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FnConstraint; ii++ {
- var p uintptr = ((*Sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FaConstraint + uintptr(ii)*12)
+ var p uintptr = (*Sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FaConstraint + uintptr(ii)*12
if !(int32((*sqlite3_index_constraint)(unsafe.Pointer(p)).Fusable) != 0) {
continue
}
- if ((*sqlite3_index_constraint)(unsafe.Pointer(p)).FiColumn < 0) && (int32((*sqlite3_index_constraint)(unsafe.Pointer(p)).Fop) == SQLITE_INDEX_CONSTRAINT_EQ) {
+ if (*sqlite3_index_constraint)(unsafe.Pointer(p)).FiColumn < 0 && int32((*sqlite3_index_constraint)(unsafe.Pointer(p)).Fop) == SQLITE_INDEX_CONSTRAINT_EQ {
iRowidTerm = ii
break
}
- if ((*sqlite3_index_constraint)(unsafe.Pointer(p)).FiColumn == 0) && (int32((*sqlite3_index_constraint)(unsafe.Pointer(p)).Fop) >= SQLITE_INDEX_CONSTRAINT_FUNCTION) {
+ if (*sqlite3_index_constraint)(unsafe.Pointer(p)).FiColumn == 0 && int32((*sqlite3_index_constraint)(unsafe.Pointer(p)).Fop) >= SQLITE_INDEX_CONSTRAINT_FUNCTION {
// p->op==SQLITE_INDEX_CONSTRAINT_FUNCTION for geopoly_overlap()
// p->op==(SQLITE_INDEX_CONTRAINT_FUNCTION+1) for geopoly_within().
// See geopolyFindFunction()
iFuncTerm = ii
- idxNum = ((int32((*sqlite3_index_constraint)(unsafe.Pointer(p)).Fop) - SQLITE_INDEX_CONSTRAINT_FUNCTION) + 2)
+ idxNum = int32((*sqlite3_index_constraint)(unsafe.Pointer(p)).Fop) - SQLITE_INDEX_CONSTRAINT_FUNCTION + 2
}
}
if iRowidTerm >= 0 {
(*Sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FidxNum = 1
- (*Sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FidxStr = ts + 14757 /* "rowid" */
+ (*Sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FidxStr = ts + 15961 /* "rowid" */
(*sqlite3_index_constraint_usage)(unsafe.Pointer((*Sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FaConstraintUsage + uintptr(iRowidTerm)*8)).FargvIndex = 1
(*sqlite3_index_constraint_usage)(unsafe.Pointer((*Sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FaConstraintUsage + uintptr(iRowidTerm)*8)).Fomit = uint8(1)
(*Sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FestimatedCost = 30.0
@@ -158807,7 +161046,7 @@ func geopolyBestIndex(tls *libc.TLS, tab uintptr, pIdxInfo uintptr) int32 { /* s
}
if iFuncTerm >= 0 {
(*Sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FidxNum = idxNum
- (*Sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FidxStr = ts + 25827 /* "rtree" */
+ (*Sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FidxStr = ts + 27124 /* "rtree" */
(*sqlite3_index_constraint_usage)(unsafe.Pointer((*Sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FaConstraintUsage + uintptr(iFuncTerm)*8)).FargvIndex = 1
(*sqlite3_index_constraint_usage)(unsafe.Pointer((*Sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FaConstraintUsage + uintptr(iFuncTerm)*8)).Fomit = uint8(0)
(*Sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FestimatedCost = 300.0
@@ -158815,14 +161054,14 @@ func geopolyBestIndex(tls *libc.TLS, tab uintptr, pIdxInfo uintptr) int32 { /* s
return SQLITE_OK
}
(*Sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FidxNum = 4
- (*Sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FidxStr = ts + 25833 /* "fullscan" */
+ (*Sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FidxStr = ts + 27130 /* "fullscan" */
(*Sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FestimatedCost = 3000000.0
(*Sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FestimatedRows = int64(100000)
return SQLITE_OK
}
// GEOPOLY virtual table module xColumn method.
-func geopolyColumn(tls *libc.TLS, cur uintptr, ctx uintptr, i int32) int32 { /* sqlite3.c:198170:12: */
+func geopolyColumn(tls *libc.TLS, cur uintptr, ctx uintptr, i int32) int32 { /* sqlite3.c:199837:12: */
bp := tls.Alloc(4)
defer tls.Free(4)
@@ -158832,38 +161071,38 @@ func geopolyColumn(tls *libc.TLS, cur uintptr, ctx uintptr, i int32) int32 { /*
*(*int32)(unsafe.Pointer(bp /* rc */)) = SQLITE_OK
var pNode uintptr = rtreeNodeOfFirstSearchPoint(tls, pCsr, bp /* &rc */)
- if *(*int32)(unsafe.Pointer(bp /* rc */)) != 0 {
+ if *(*int32)(unsafe.Pointer(bp)) != 0 {
return *(*int32)(unsafe.Pointer(bp /* rc */))
}
if p == uintptr(0) {
return SQLITE_OK
}
- if (i == 0) && (Xsqlite3_vtab_nochange(tls, ctx) != 0) {
+ if i == 0 && Xsqlite3_vtab_nochange(tls, ctx) != 0 {
return SQLITE_OK
}
if i <= int32((*Rtree)(unsafe.Pointer(pRtree)).FnAux) {
if !(int32((*RtreeCursor)(unsafe.Pointer(pCsr)).FbAuxValid) != 0) {
if (*RtreeCursor)(unsafe.Pointer(pCsr)).FpReadAux == uintptr(0) {
*(*int32)(unsafe.Pointer(bp /* rc */)) = Xsqlite3_prepare_v3(tls, (*Rtree)(unsafe.Pointer(pRtree)).Fdb, (*Rtree)(unsafe.Pointer(pRtree)).FzReadAuxSql, -1, uint32(0),
- (pCsr + 36 /* &.pReadAux */), uintptr(0))
- if *(*int32)(unsafe.Pointer(bp /* rc */)) != 0 {
+ pCsr+36, uintptr(0))
+ if *(*int32)(unsafe.Pointer(bp)) != 0 {
return *(*int32)(unsafe.Pointer(bp /* rc */))
}
}
Xsqlite3_bind_int64(tls, (*RtreeCursor)(unsafe.Pointer(pCsr)).FpReadAux, 1,
nodeGetRowid(tls, pRtree, pNode, int32((*RtreeSearchPoint)(unsafe.Pointer(p)).FiCell)))
*(*int32)(unsafe.Pointer(bp /* rc */)) = Xsqlite3_step(tls, (*RtreeCursor)(unsafe.Pointer(pCsr)).FpReadAux)
- if *(*int32)(unsafe.Pointer(bp /* rc */)) == SQLITE_ROW {
+ if *(*int32)(unsafe.Pointer(bp)) == SQLITE_ROW {
(*RtreeCursor)(unsafe.Pointer(pCsr)).FbAuxValid = U8(1)
} else {
Xsqlite3_reset(tls, (*RtreeCursor)(unsafe.Pointer(pCsr)).FpReadAux)
- if *(*int32)(unsafe.Pointer(bp /* rc */)) == SQLITE_DONE {
+ if *(*int32)(unsafe.Pointer(bp)) == SQLITE_DONE {
*(*int32)(unsafe.Pointer(bp /* rc */)) = SQLITE_OK
}
return *(*int32)(unsafe.Pointer(bp /* rc */))
}
}
- Xsqlite3_result_value(tls, ctx, Xsqlite3_column_value(tls, (*RtreeCursor)(unsafe.Pointer(pCsr)).FpReadAux, (i+2)))
+ Xsqlite3_result_value(tls, ctx, Xsqlite3_column_value(tls, (*RtreeCursor)(unsafe.Pointer(pCsr)).FpReadAux, i+2))
}
return SQLITE_OK
}
@@ -158887,7 +161126,7 @@ func geopolyColumn(tls *libc.TLS, cur uintptr, ctx uintptr, i int32) int32 { /*
// argv[1] = rowid after the change. Never NULL
// argv[2] = new value for _shape
// argv[3] = new value for first application-defined column....
-func geopolyUpdate(tls *libc.TLS, pVtab uintptr, nData int32, aData uintptr, pRowid uintptr) int32 { /* sqlite3.c:198225:12: */
+func geopolyUpdate(tls *libc.TLS, pVtab uintptr, nData int32, aData uintptr, pRowid uintptr) int32 { /* sqlite3.c:199892:12: */
bp := tls.Alloc(56)
defer tls.Free(56)
@@ -158920,19 +161159,19 @@ func geopolyUpdate(tls *libc.TLS, pVtab uintptr, nData int32, aData uintptr, pRo
// Unable to write to the btree while another cursor is reading from it,
// since the write might do a rebalance which would disrupt the read
// cursor.
- return (SQLITE_LOCKED | (int32(2) << 8))
+ return SQLITE_LOCKED | int32(2)<<8
__1:
;
rtreeReference(tls, pRtree)
- oldRowidValid = (libc.Bool32(Xsqlite3_value_type(tls, *(*uintptr)(unsafe.Pointer(aData))) != SQLITE_NULL))
+ oldRowidValid = libc.Bool32(Xsqlite3_value_type(tls, *(*uintptr)(unsafe.Pointer(aData))) != SQLITE_NULL)
if oldRowidValid != 0 {
oldRowid = Xsqlite3_value_int64(tls, *(*uintptr)(unsafe.Pointer(aData)))
} else {
oldRowid = int64(0)
}
- newRowidValid = (libc.Bool32((nData > 1) && (Xsqlite3_value_type(tls, *(*uintptr)(unsafe.Pointer(aData + 1*4))) != SQLITE_NULL)))
+ newRowidValid = libc.Bool32(nData > 1 && Xsqlite3_value_type(tls, *(*uintptr)(unsafe.Pointer(aData + 1*4))) != SQLITE_NULL)
if newRowidValid != 0 {
newRowid = Xsqlite3_value_int64(tls, *(*uintptr)(unsafe.Pointer(aData + 1*4)))
} else {
@@ -158940,20 +161179,21 @@ __1:
}
(*RtreeCell)(unsafe.Pointer(bp /* &cell */)).FiRowid = newRowid
- if !((nData > 1) && // not a DELETE
- ((!(oldRowidValid != 0) || // INSERT
- !(Xsqlite3_value_nochange(tls, *(*uintptr)(unsafe.Pointer(aData + 2*4))) != 0)) || // UPDATE _shape
- (oldRowid != newRowid))) {
+ if !(nData > 1 &&
+ (!(oldRowidValid != 0) ||
+ !(Xsqlite3_value_nochange(tls, *(*uintptr)(unsafe.Pointer(aData + 2*4))) != 0) ||
+ oldRowid != newRowid)) {
goto __2
}
- geopolyBBox(tls, uintptr(0), *(*uintptr)(unsafe.Pointer(aData + 2*4)), bp /* &cell */ +8 /* &.aCoord */, bp+48 /* &rc */)
- if !(*(*int32)(unsafe.Pointer(bp + 48 /* rc */)) != 0) {
+
+ geopolyBBox(tls, uintptr(0), *(*uintptr)(unsafe.Pointer(aData + 2*4)), bp+8, bp+48 /* &rc */)
+ if !(*(*int32)(unsafe.Pointer(bp + 48)) != 0) {
goto __3
}
- if !(*(*int32)(unsafe.Pointer(bp + 48 /* rc */)) == SQLITE_ERROR) {
+ if !(*(*int32)(unsafe.Pointer(bp + 48)) == SQLITE_ERROR) {
goto __4
}
- (*Sqlite3_vtab)(unsafe.Pointer(pVtab)).FzErrMsg = Xsqlite3_mprintf(tls, ts+25842 /* "_shape does not ..." */, 0)
+ (*Sqlite3_vtab)(unsafe.Pointer(pVtab)).FzErrMsg = Xsqlite3_mprintf(tls, ts+27139 /* "_shape does not ..." */, 0)
__4:
;
goto geopoly_update_end
@@ -158963,7 +161203,7 @@ __3:
// If a rowid value was supplied, check if it is already present in
// the table. If so, the constraint has failed.
- if !((newRowidValid != 0) && (!(oldRowidValid != 0) || (oldRowid != newRowid))) {
+ if !(newRowidValid != 0 && (!(oldRowidValid != 0) || oldRowid != newRowid)) {
goto __5
}
Xsqlite3_bind_int64(tls, (*Rtree)(unsafe.Pointer(pRtree)).FpReadRowid, 1, (*RtreeCell)(unsafe.Pointer(bp /* &cell */)).FiRowid)
@@ -158991,7 +161231,7 @@ __2:
// If aData[0] is not an SQL NULL value, it is the rowid of a
// record to delete from the r-tree table. The following block does
// just that.
- if !((*(*int32)(unsafe.Pointer(bp + 48 /* rc */)) == SQLITE_OK) && ((nData == 1) || ((coordChange != 0) && (oldRowidValid != 0)))) {
+ if !(*(*int32)(unsafe.Pointer(bp + 48)) == SQLITE_OK && (nData == 1 || coordChange != 0 && oldRowidValid != 0)) {
goto __9
}
*(*int32)(unsafe.Pointer(bp + 48 /* rc */)) = rtreeDeleteRowid(tls, pRtree, oldRowid)
@@ -159001,31 +161241,31 @@ __9:
// If the aData[] array contains more than one element, elements
// (aData[2]..aData[argc-1]) contain a new record to insert into
// the r-tree structure.
- if !(((*(*int32)(unsafe.Pointer(bp + 48 /* rc */)) == SQLITE_OK) && (nData > 1)) && (coordChange != 0)) {
+ if !(*(*int32)(unsafe.Pointer(bp + 48)) == SQLITE_OK && nData > 1 && coordChange != 0) {
goto __10
}
// Insert the new record into the r-tree
*(*uintptr)(unsafe.Pointer(bp + 52 /* pLeaf */)) = uintptr(0)
- if !(!(newRowidValid != 0)) {
+ if !!(newRowidValid != 0) {
goto __11
}
- *(*int32)(unsafe.Pointer(bp + 48 /* rc */)) = rtreeNewRowid(tls, pRtree, (bp /* &cell */ /* &.iRowid */))
+ *(*int32)(unsafe.Pointer(bp + 48 /* rc */)) = rtreeNewRowid(tls, pRtree, bp)
__11:
;
*(*Sqlite_int64)(unsafe.Pointer(pRowid)) = (*RtreeCell)(unsafe.Pointer(bp /* &cell */)).FiRowid
- if !(*(*int32)(unsafe.Pointer(bp + 48 /* rc */)) == SQLITE_OK) {
+ if !(*(*int32)(unsafe.Pointer(bp + 48)) == SQLITE_OK) {
goto __12
}
*(*int32)(unsafe.Pointer(bp + 48 /* rc */)) = sChooseLeaf(tls, pRtree, bp /* &cell */, 0, bp+52 /* &pLeaf */)
__12:
;
- if !(*(*int32)(unsafe.Pointer(bp + 48 /* rc */)) == SQLITE_OK) {
+ if !(*(*int32)(unsafe.Pointer(bp + 48)) == SQLITE_OK) {
goto __13
}
(*Rtree)(unsafe.Pointer(pRtree)).FiReinsertHeight = -1
*(*int32)(unsafe.Pointer(bp + 48 /* rc */)) = rtreeInsertCell(tls, pRtree, *(*uintptr)(unsafe.Pointer(bp + 52 /* pLeaf */)), bp /* &cell */, 0)
rc2 = nodeRelease(tls, pRtree, *(*uintptr)(unsafe.Pointer(bp + 52 /* pLeaf */)))
- if !(*(*int32)(unsafe.Pointer(bp + 48 /* rc */)) == SQLITE_OK) {
+ if !(*(*int32)(unsafe.Pointer(bp + 48)) == SQLITE_OK) {
goto __14
}
*(*int32)(unsafe.Pointer(bp + 48 /* rc */)) = rc2
@@ -159037,7 +161277,7 @@ __10:
;
// Change the data
- if !((*(*int32)(unsafe.Pointer(bp + 48 /* rc */)) == SQLITE_OK) && (nData > 1)) {
+ if !(*(*int32)(unsafe.Pointer(bp + 48)) == SQLITE_OK && nData > 1) {
goto __15
}
pUp = (*Rtree)(unsafe.Pointer(pRtree)).FpWriteAux
@@ -159051,12 +161291,12 @@ __10:
goto __17
__16:
p = uintptr(0)
- if !(((Xsqlite3_value_type(tls, *(*uintptr)(unsafe.Pointer(aData + 2*4))) == SQLITE_TEXT) &&
- ((libc.AssignUintptr(&p, geopolyFuncParam(tls, uintptr(0), *(*uintptr)(unsafe.Pointer(aData + 2*4)), bp+48 /* &rc */))) != uintptr(0))) &&
- (*(*int32)(unsafe.Pointer(bp + 48 /* rc */)) == SQLITE_OK)) {
+ if !(Xsqlite3_value_type(tls, *(*uintptr)(unsafe.Pointer(aData + 2*4))) == SQLITE_TEXT &&
+ libc.AssignUintptr(&p, geopolyFuncParam(tls, uintptr(0), *(*uintptr)(unsafe.Pointer(aData + 2*4)), bp+48)) != uintptr(0) &&
+ *(*int32)(unsafe.Pointer(bp + 48)) == SQLITE_OK) {
goto __18
}
- Xsqlite3_bind_blob(tls, pUp, 2, p+4 /* &.hdr */, (4 + (8 * (*GeoPoly)(unsafe.Pointer(p)).FnVertex)), libc.UintptrFromInt32(-1))
+ Xsqlite3_bind_blob(tls, pUp, 2, p+4, 4+8*(*GeoPoly)(unsafe.Pointer(p)).FnVertex, libc.UintptrFromInt32(-1))
goto __19
__18:
Xsqlite3_bind_value(tls, pUp, 2, *(*uintptr)(unsafe.Pointer(aData + 2*4)))
@@ -159072,7 +161312,7 @@ __20:
goto __22
}
nChange++
- Xsqlite3_bind_value(tls, pUp, (jj + 2), *(*uintptr)(unsafe.Pointer(aData + uintptr((jj+2))*4)))
+ Xsqlite3_bind_value(tls, pUp, jj+2, *(*uintptr)(unsafe.Pointer(aData + uintptr(jj+2)*4)))
goto __21
__21:
jj++
@@ -159097,20 +161337,20 @@ geopoly_update_end:
// Report that geopoly_overlap() is an overloaded function suitable
// for use in xBestIndex.
-func geopolyFindFunction(tls *libc.TLS, pVtab uintptr, nArg int32, zName uintptr, pxFunc uintptr, ppArg uintptr) int32 { /* sqlite3.c:198361:12: */
- if Xsqlite3_stricmp(tls, zName, ts+25882 /* "geopoly_overlap" */) == 0 {
+func geopolyFindFunction(tls *libc.TLS, pVtab uintptr, nArg int32, zName uintptr, pxFunc uintptr, ppArg uintptr) int32 { /* sqlite3.c:200029:12: */
+ if Xsqlite3_stricmp(tls, zName, ts+27179) == 0 {
*(*uintptr)(unsafe.Pointer(pxFunc)) = *(*uintptr)(unsafe.Pointer(&struct {
f func(*libc.TLS, uintptr, int32, uintptr)
}{geopolyOverlapFunc}))
*(*uintptr)(unsafe.Pointer(ppArg)) = uintptr(0)
return SQLITE_INDEX_CONSTRAINT_FUNCTION
}
- if Xsqlite3_stricmp(tls, zName, ts+25898 /* "geopoly_within" */) == 0 {
+ if Xsqlite3_stricmp(tls, zName, ts+27195) == 0 {
*(*uintptr)(unsafe.Pointer(pxFunc)) = *(*uintptr)(unsafe.Pointer(&struct {
f func(*libc.TLS, uintptr, int32, uintptr)
}{geopolyWithinFunc}))
*(*uintptr)(unsafe.Pointer(ppArg)) = uintptr(0)
- return (SQLITE_INDEX_CONSTRAINT_FUNCTION + 1)
+ return SQLITE_INDEX_CONSTRAINT_FUNCTION + 1
}
return 0
}
@@ -159138,39 +161378,39 @@ var geopolyModule = Sqlite3_module{
FxRename: 0, // xRename - rename the table
FxSavepoint: 0, // xRollbackTo
FxShadowName: 0, // xShadowName
-} /* sqlite3.c:198382:23 */
+} /* sqlite3.c:200050:23 */
-func sqlite3_geopoly_init(tls *libc.TLS, db uintptr) int32 { /* sqlite3.c:198409:12: */
+func sqlite3_geopoly_init(tls *libc.TLS, db uintptr) int32 { /* sqlite3.c:200077:12: */
var rc int32 = SQLITE_OK
var i int32
- for i = 0; (uint32(i) < (uint32(unsafe.Sizeof(aFunc1)) / uint32(unsafe.Sizeof(struct {
+ for i = 0; uint32(i) < uint32(unsafe.Sizeof(aFunc1))/uint32(unsafe.Sizeof(struct {
FxFunc uintptr
FnArg int8
FbPure uint8
F__ccgo_pad1 [2]byte
FzName uintptr
- }{})))) && (rc == SQLITE_OK); i++ {
+ }{})) && rc == SQLITE_OK; i++ {
var enc int32
if aFunc1[i].FbPure != 0 {
- enc = ((SQLITE_UTF8 | SQLITE_DETERMINISTIC) | SQLITE_INNOCUOUS)
+ enc = SQLITE_UTF8 | SQLITE_DETERMINISTIC | SQLITE_INNOCUOUS
} else {
- enc = (SQLITE_UTF8 | SQLITE_DIRECTONLY)
+ enc = SQLITE_UTF8 | SQLITE_DIRECTONLY
}
rc = Xsqlite3_create_function(tls, db, aFunc1[i].FzName, int32(aFunc1[i].FnArg),
enc, uintptr(0),
aFunc1[i].FxFunc, uintptr(0), uintptr(0))
}
- for i = 0; (uint32(i) < (uint32(unsafe.Sizeof(aAgg1)) / uint32(unsafe.Sizeof(struct {
+ for i = 0; uint32(i) < uint32(unsafe.Sizeof(aAgg1))/uint32(unsafe.Sizeof(struct {
FxStep uintptr
FxFinal uintptr
FzName uintptr
- }{})))) && (rc == SQLITE_OK); i++ {
+ }{})) && rc == SQLITE_OK; i++ {
rc = Xsqlite3_create_function(tls, db, aAgg1[i].FzName, 1,
- ((SQLITE_UTF8 | SQLITE_DETERMINISTIC) | SQLITE_INNOCUOUS), uintptr(0),
+ SQLITE_UTF8|SQLITE_DETERMINISTIC|SQLITE_INNOCUOUS, uintptr(0),
uintptr(0), aAgg1[i].FxStep, aAgg1[i].FxFinal)
}
if rc == SQLITE_OK {
- rc = Xsqlite3_create_module_v2(tls, db, ts+25913 /* "geopoly" */, uintptr(unsafe.Pointer(&geopolyModule)), uintptr(0), uintptr(0))
+ rc = Xsqlite3_create_module_v2(tls, db, ts+27210 /* "geopoly" */, uintptr(unsafe.Pointer(&geopolyModule)), uintptr(0), uintptr(0))
}
return rc
}
@@ -159182,26 +161422,26 @@ var aFunc1 = [12]struct {
F__ccgo_pad1 [2]byte
FzName uintptr
}{
- {FxFunc: 0, FnArg: int8(1), FbPure: uint8(1), FzName: ts + 25921 /* "geopoly_area" */},
- {FxFunc: 0, FnArg: int8(1), FbPure: uint8(1), FzName: ts + 25934 /* "geopoly_blob" */},
- {FxFunc: 0, FnArg: int8(1), FbPure: uint8(1), FzName: ts + 25947 /* "geopoly_json" */},
- {FxFunc: 0, FnArg: int8(-1), FbPure: uint8(1), FzName: ts + 25960 /* "geopoly_svg" */},
- {FxFunc: 0, FnArg: int8(2), FbPure: uint8(1), FzName: ts + 25898 /* "geopoly_within" */},
- {FxFunc: 0, FnArg: int8(3), FbPure: uint8(1), FzName: ts + 25972 /* "geopoly_contains..." */},
- {FxFunc: 0, FnArg: int8(2), FbPure: uint8(1), FzName: ts + 25882 /* "geopoly_overlap" */},
- {FxFunc: 0, FnArg: int8(1), FzName: ts + 25995 /* "geopoly_debug" */},
- {FxFunc: 0, FnArg: int8(1), FbPure: uint8(1), FzName: ts + 26009 /* "geopoly_bbox" */},
- {FxFunc: 0, FnArg: int8(7), FbPure: uint8(1), FzName: ts + 26022 /* "geopoly_xform" */},
- {FxFunc: 0, FnArg: int8(4), FbPure: uint8(1), FzName: ts + 26036 /* "geopoly_regular" */},
- {FxFunc: 0, FnArg: int8(1), FbPure: uint8(1), FzName: ts + 26052 /* "geopoly_ccw" */},
-} /* sqlite3.c:198416:5 */
+ {FxFunc: 0, FnArg: int8(1), FbPure: uint8(1), FzName: ts + 27218 /* "geopoly_area" */},
+ {FxFunc: 0, FnArg: int8(1), FbPure: uint8(1), FzName: ts + 27231 /* "geopoly_blob" */},
+ {FxFunc: 0, FnArg: int8(1), FbPure: uint8(1), FzName: ts + 27244 /* "geopoly_json" */},
+ {FxFunc: 0, FnArg: int8(-1), FbPure: uint8(1), FzName: ts + 27257 /* "geopoly_svg" */},
+ {FxFunc: 0, FnArg: int8(2), FbPure: uint8(1), FzName: ts + 27195 /* "geopoly_within" */},
+ {FxFunc: 0, FnArg: int8(3), FbPure: uint8(1), FzName: ts + 27269 /* "geopoly_contains..." */},
+ {FxFunc: 0, FnArg: int8(2), FbPure: uint8(1), FzName: ts + 27179 /* "geopoly_overlap" */},
+ {FxFunc: 0, FnArg: int8(1), FzName: ts + 27292 /* "geopoly_debug" */},
+ {FxFunc: 0, FnArg: int8(1), FbPure: uint8(1), FzName: ts + 27306 /* "geopoly_bbox" */},
+ {FxFunc: 0, FnArg: int8(7), FbPure: uint8(1), FzName: ts + 27319 /* "geopoly_xform" */},
+ {FxFunc: 0, FnArg: int8(4), FbPure: uint8(1), FzName: ts + 27333 /* "geopoly_regular" */},
+ {FxFunc: 0, FnArg: int8(1), FbPure: uint8(1), FzName: ts + 27349 /* "geopoly_ccw" */},
+} /* sqlite3.c:200084:5 */
var aAgg1 = [1]struct {
FxStep uintptr
FxFinal uintptr
FzName uintptr
}{
- {FxStep: 0, FxFinal: 0, FzName: ts + 26064 /* "geopoly_group_bb..." */},
-} /* sqlite3.c:198434:5 */
+ {FxStep: 0, FxFinal: 0, FzName: ts + 27361 /* "geopoly_group_bb..." */},
+} /* sqlite3.c:200102:5 */
//************* End of geopoly.c ********************************************
//************* Continuing where we left off in rtree.c *********************
@@ -159209,30 +161449,30 @@ var aAgg1 = [1]struct {
// Register the r-tree module with database handle db. This creates the
// virtual table module "rtree" and the debugging/analysis scalar
// function "rtreenode".
-func Xsqlite3RtreeInit(tls *libc.TLS, db uintptr) int32 { /* sqlite3.c:198469:20: */
+func Xsqlite3RtreeInit(tls *libc.TLS, db uintptr) int32 { /* sqlite3.c:200137:20: */
var utf8 int32 = SQLITE_UTF8
var rc int32
- rc = Xsqlite3_create_function(tls, db, ts+26083 /* "rtreenode" */, 2, utf8, uintptr(0), *(*uintptr)(unsafe.Pointer(&struct {
+ rc = Xsqlite3_create_function(tls, db, ts+27380 /* "rtreenode" */, 2, utf8, uintptr(0), *(*uintptr)(unsafe.Pointer(&struct {
f func(*libc.TLS, uintptr, int32, uintptr)
}{rtreenode})), uintptr(0), uintptr(0))
if rc == SQLITE_OK {
- rc = Xsqlite3_create_function(tls, db, ts+26093 /* "rtreedepth" */, 1, utf8, uintptr(0), *(*uintptr)(unsafe.Pointer(&struct {
+ rc = Xsqlite3_create_function(tls, db, ts+27390 /* "rtreedepth" */, 1, utf8, uintptr(0), *(*uintptr)(unsafe.Pointer(&struct {
f func(*libc.TLS, uintptr, int32, uintptr)
}{rtreedepth})), uintptr(0), uintptr(0))
}
if rc == SQLITE_OK {
- rc = Xsqlite3_create_function(tls, db, ts+26104 /* "rtreecheck" */, -1, utf8, uintptr(0), *(*uintptr)(unsafe.Pointer(&struct {
+ rc = Xsqlite3_create_function(tls, db, ts+27401 /* "rtreecheck" */, -1, utf8, uintptr(0), *(*uintptr)(unsafe.Pointer(&struct {
f func(*libc.TLS, uintptr, int32, uintptr)
}{rtreecheck})), uintptr(0), uintptr(0))
}
if rc == SQLITE_OK {
var c uintptr = uintptr(RTREE_COORD_REAL32)
- rc = Xsqlite3_create_module_v2(tls, db, ts+25827 /* "rtree" */, uintptr(unsafe.Pointer(&rtreeModule)), c, uintptr(0))
+ rc = Xsqlite3_create_module_v2(tls, db, ts+27124 /* "rtree" */, uintptr(unsafe.Pointer(&rtreeModule)), c, uintptr(0))
}
if rc == SQLITE_OK {
var c uintptr = uintptr(RTREE_COORD_INT32)
- rc = Xsqlite3_create_module_v2(tls, db, ts+26115 /* "rtree_i32" */, uintptr(unsafe.Pointer(&rtreeModule)), c, uintptr(0))
+ rc = Xsqlite3_create_module_v2(tls, db, ts+27412 /* "rtree_i32" */, uintptr(unsafe.Pointer(&rtreeModule)), c, uintptr(0))
}
if rc == SQLITE_OK {
rc = sqlite3_geopoly_init(tls, db)
@@ -159246,7 +161486,7 @@ func Xsqlite3RtreeInit(tls *libc.TLS, db uintptr) int32 { /* sqlite3.c:198469:20
// or sqlite3_rtree_query_callback(). In other words, this routine is the
// destructor for an RtreeGeomCallback objecct. This routine is called when
// the corresponding SQL function is deleted.
-func rtreeFreeCallback(tls *libc.TLS, p uintptr) { /* sqlite3.c:198508:13: */
+func rtreeFreeCallback(tls *libc.TLS, p uintptr) { /* sqlite3.c:200176:13: */
var pInfo uintptr = p
if (*RtreeGeomCallback)(unsafe.Pointer(pInfo)).FxDestructor != 0 {
(*struct{ f func(*libc.TLS, uintptr) })(unsafe.Pointer(&struct{ uintptr }{(*RtreeGeomCallback)(unsafe.Pointer(pInfo)).FxDestructor})).f(tls, (*RtreeGeomCallback)(unsafe.Pointer(pInfo)).FpContext)
@@ -159255,7 +161495,7 @@ func rtreeFreeCallback(tls *libc.TLS, p uintptr) { /* sqlite3.c:198508:13: */
}
// This routine frees the BLOB that is returned by geomCallback().
-func rtreeMatchArgFree(tls *libc.TLS, pArg uintptr) { /* sqlite3.c:198517:13: */
+func rtreeMatchArgFree(tls *libc.TLS, pArg uintptr) { /* sqlite3.c:200185:13: */
var i int32
var p uintptr = pArg
for i = 0; i < (*RtreeMatchArg)(unsafe.Pointer(p)).FnParam; i++ {
@@ -159276,14 +161516,14 @@ func rtreeMatchArgFree(tls *libc.TLS, pArg uintptr) { /* sqlite3.c:198517:13: */
// The R-Tree MATCH operator will read the returned BLOB, deserialize
// the RtreeMatchArg object, and use the RtreeMatchArg object to figure
// out which elements of the R-Tree should be returned by the query.
-func geomCallback(tls *libc.TLS, ctx uintptr, nArg int32, aArg uintptr) { /* sqlite3.c:198540:13: */
+func geomCallback(tls *libc.TLS, ctx uintptr, nArg int32, aArg uintptr) { /* sqlite3.c:200208:13: */
var pGeomCtx uintptr = Xsqlite3_user_data(tls, ctx)
var pBlob uintptr
var nBlob Sqlite3_int64
var memErr int32 = 0
- nBlob = (Sqlite3_int64((uint32(unsafe.Sizeof(RtreeMatchArg{})) + ((uint32(nArg - 1)) * uint32(unsafe.Sizeof(RtreeDValue(0))))) +
- (uint32(nArg) * uint32(unsafe.Sizeof(uintptr(0))))))
+ nBlob = Sqlite3_int64(uint32(unsafe.Sizeof(RtreeMatchArg{})) + uint32(nArg-1)*uint32(unsafe.Sizeof(RtreeDValue(0))) +
+ uint32(nArg)*uint32(unsafe.Sizeof(uintptr(0))))
pBlob = Xsqlite3_malloc64(tls, uint64(nBlob))
if !(pBlob != 0) {
Xsqlite3_result_error_nomem(tls, ctx)
@@ -159291,26 +161531,26 @@ func geomCallback(tls *libc.TLS, ctx uintptr, nArg int32, aArg uintptr) { /* sql
var i int32
(*RtreeMatchArg)(unsafe.Pointer(pBlob)).FiSize = U32(nBlob)
(*RtreeMatchArg)(unsafe.Pointer(pBlob)).Fcb = *(*RtreeGeomCallback)(unsafe.Pointer(pGeomCtx))
- (*RtreeMatchArg)(unsafe.Pointer(pBlob)).FapSqlParam = ((pBlob + 32 /* &.aParam */) + uintptr(nArg)*8)
+ (*RtreeMatchArg)(unsafe.Pointer(pBlob)).FapSqlParam = pBlob + 32 + uintptr(nArg)*8
(*RtreeMatchArg)(unsafe.Pointer(pBlob)).FnParam = nArg
for i = 0; i < nArg; i++ {
*(*uintptr)(unsafe.Pointer((*RtreeMatchArg)(unsafe.Pointer(pBlob)).FapSqlParam + uintptr(i)*4)) = Xsqlite3_value_dup(tls, *(*uintptr)(unsafe.Pointer(aArg + uintptr(i)*4)))
if *(*uintptr)(unsafe.Pointer((*RtreeMatchArg)(unsafe.Pointer(pBlob)).FapSqlParam + uintptr(i)*4)) == uintptr(0) {
memErr = 1
}
- *(*RtreeDValue)(unsafe.Pointer((pBlob + 32 /* &.aParam */) + uintptr(i)*8)) = Xsqlite3_value_double(tls, *(*uintptr)(unsafe.Pointer(aArg + uintptr(i)*4)))
+ *(*RtreeDValue)(unsafe.Pointer(pBlob + 32 + uintptr(i)*8)) = Xsqlite3_value_double(tls, *(*uintptr)(unsafe.Pointer(aArg + uintptr(i)*4)))
}
if memErr != 0 {
Xsqlite3_result_error_nomem(tls, ctx)
rtreeMatchArgFree(tls, pBlob)
} else {
- Xsqlite3_result_pointer(tls, ctx, pBlob, ts+23403 /* "RtreeMatchArg" */, *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{rtreeMatchArgFree})))
+ Xsqlite3_result_pointer(tls, ctx, pBlob, ts+24700 /* "RtreeMatchArg" */, *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{rtreeMatchArgFree})))
}
}
}
// Register a new geometry function for use with the r-tree MATCH operator.
-func Xsqlite3_rtree_geometry_callback(tls *libc.TLS, db uintptr, zGeom uintptr, xGeom uintptr, pContext uintptr) int32 { /* sqlite3.c:198578:16: */
+func Xsqlite3_rtree_geometry_callback(tls *libc.TLS, db uintptr, zGeom uintptr, xGeom uintptr, pContext uintptr) int32 { /* sqlite3.c:200246:16: */
var pGeomCtx uintptr // Context object for new user-function
// Allocate and populate the context object.
@@ -159330,12 +161570,15 @@ func Xsqlite3_rtree_geometry_callback(tls *libc.TLS, db uintptr, zGeom uintptr,
// Register a new 2nd-generation geometry function for use with the
// r-tree MATCH operator.
-func Xsqlite3_rtree_query_callback(tls *libc.TLS, db uintptr, zQueryFunc uintptr, xQueryFunc uintptr, pContext uintptr, xDestructor uintptr) int32 { /* sqlite3.c:198602:16: */
+func Xsqlite3_rtree_query_callback(tls *libc.TLS, db uintptr, zQueryFunc uintptr, xQueryFunc uintptr, pContext uintptr, xDestructor uintptr) int32 { /* sqlite3.c:200270:16: */
var pGeomCtx uintptr // Context object for new user-function
// Allocate and populate the context object.
pGeomCtx = Xsqlite3_malloc(tls, int32(unsafe.Sizeof(RtreeGeomCallback{})))
if !(pGeomCtx != 0) {
+ if xDestructor != 0 {
+ (*struct{ f func(*libc.TLS, uintptr) })(unsafe.Pointer(&struct{ uintptr }{xDestructor})).f(tls, pContext)
+ }
return SQLITE_NOMEM
}
(*RtreeGeomCallback)(unsafe.Pointer(pGeomCtx)).FxGeom = uintptr(0)
@@ -159779,7 +162022,7 @@ type sqlite3rbu = struct {
FszTempLimit I64
FnRbu int32
FpRbuFd uintptr
-} /* sqlite3.c:199829:9 */
+} /* sqlite3.c:201500:9 */
//************* End of rtree.c **********************************************
//************* Begin file icu.c ********************************************
@@ -160180,7 +162423,7 @@ type sqlite3rbu = struct {
// #include "sqlite3.h" ** Required for error code definitions **
-type Sqlite3rbu = sqlite3rbu /* sqlite3.c:199829:27 */
+type Sqlite3rbu = sqlite3rbu /* sqlite3.c:201500:27 */
//************* End of sqlite3rbu.h *****************************************
//************* Continuing where we left off in sqlite3rbu.c ****************
@@ -160192,6 +162435,9 @@ type Sqlite3rbu = sqlite3rbu /* sqlite3.c:199829:27 */
// Swap two objects of type TYPE.
+// Name of the URI option that causes RBU to take an exclusive lock as
+// part of the incremental checkpoint operation.
+
// The rbu_state table is used to save the state of a partially applied
// update so that it can be resumed later. The table consists of integer
// keys mapped to values as follows:
@@ -160242,7 +162488,7 @@ type Sqlite3rbu = sqlite3rbu /* sqlite3.c:199829:27 */
type RbuFrame1 = struct {
FiDbPage U32
FiWalFrame U32
-} /* sqlite3.c:199829:9 */
+} /* sqlite3.c:201500:9 */
//************* End of sqlite3rbu.h *****************************************
//************* Continuing where we left off in sqlite3rbu.c ****************
@@ -160254,6 +162500,9 @@ type RbuFrame1 = struct {
// Swap two objects of type TYPE.
+// Name of the URI option that causes RBU to take an exclusive lock as
+// part of the incremental checkpoint operation.
+
// The rbu_state table is used to save the state of a partially applied
// update so that it can be resumed later. The table consists of integer
// keys mapped to values as follows:
@@ -160301,7 +162550,7 @@ type RbuFrame1 = struct {
// Only valid if STAGE==1. The RBU database name of the table
// currently being read.
-type RbuFrame = RbuFrame1 /* sqlite3.c:200253:25 */
+type RbuFrame = RbuFrame1 /* sqlite3.c:201931:25 */
type RbuObjIter1 = struct {
FpTblIter uintptr
FpIdxIter uintptr
@@ -160330,9 +162579,9 @@ type RbuObjIter1 = struct {
FaIdxCol uintptr
FzIdxSql uintptr
FpRbuUpdate uintptr
-} /* sqlite3.c:199829:9 */
+} /* sqlite3.c:201500:9 */
-type RbuObjIter = RbuObjIter1 /* sqlite3.c:200254:27 */
+type RbuObjIter = RbuObjIter1 /* sqlite3.c:201932:27 */
type RbuState1 = struct {
FeStage int32
FzTbl uintptr
@@ -160346,15 +162595,15 @@ type RbuState1 = struct {
F__ccgo_pad2 [4]byte
FiOalSz I64
FnPhaseOneStep I64
-} /* sqlite3.c:200255:9 */
+} /* sqlite3.c:201933:9 */
-type RbuState = RbuState1 /* sqlite3.c:200255:25 */
+type RbuState = RbuState1 /* sqlite3.c:201933:25 */
type RbuSpan1 = struct {
FzSpan uintptr
FnSpan int32
-} /* sqlite3.c:199829:9 */
+} /* sqlite3.c:201500:9 */
-type RbuSpan = RbuSpan1 /* sqlite3.c:200256:24 */
+type RbuSpan = RbuSpan1 /* sqlite3.c:201934:24 */
type rbu_vfs = struct {
Fbase Sqlite3_vfs
FpRealVfs uintptr
@@ -160362,9 +162611,9 @@ type rbu_vfs = struct {
FpRbu uintptr
FpMain uintptr
FpMainRbu uintptr
-} /* sqlite3.c:199829:9 */
+} /* sqlite3.c:201500:9 */
-type Rbu_vfs = rbu_vfs /* sqlite3.c:200257:24 */
+type Rbu_vfs = rbu_vfs /* sqlite3.c:201935:24 */
type rbu_file = struct {
Fbase Sqlite3_file
FpReal uintptr
@@ -160383,16 +162632,16 @@ type rbu_file = struct {
FpWalFd uintptr
FpMainNext uintptr
FpMainRbuNext uintptr
-} /* sqlite3.c:199829:9 */
+} /* sqlite3.c:201500:9 */
-type Rbu_file = rbu_file /* sqlite3.c:200258:25 */
+type Rbu_file = rbu_file /* sqlite3.c:201936:25 */
type RbuUpdateStmt1 = struct {
FzMask uintptr
FpUpdate uintptr
FpNext uintptr
-} /* sqlite3.c:199829:9 */
+} /* sqlite3.c:201500:9 */
-type RbuUpdateStmt = RbuUpdateStmt1 /* sqlite3.c:200259:30 */
+type RbuUpdateStmt = RbuUpdateStmt1 /* sqlite3.c:201937:30 */
// True for an RBU vacuum handle, or false otherwise.
@@ -160411,16 +162660,16 @@ type RbuUpdateStmt = RbuUpdateStmt1 /* sqlite3.c:200259:30 */
// finished, leave *pz pointing to the first character past the end of
// the integer. The *pLen parameter holds the length of the string
// in *pz and is decremented once for each character in the integer.
-func rbuDeltaGetInt(tls *libc.TLS, pz uintptr, pLen uintptr) uint32 { /* sqlite3.c:200549:21: */
+func rbuDeltaGetInt(tls *libc.TLS, pz uintptr, pLen uintptr) uint32 { /* sqlite3.c:202227:21: */
var v uint32 = uint32(0)
var c int32
var z uintptr = *(*uintptr)(unsafe.Pointer(pz))
var zStart uintptr = z
- for (libc.AssignInt32(&c, int32(zValue[(0x7f&int32(*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&z, 1)))))]))) >= 0 {
- v = ((v << 6) + uint32(c))
+ for libc.AssignInt32(&c, int32(zValue[0x7f&int32(*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&z, 1))))])) >= 0 {
+ v = v<<6 + uint32(c)
}
z--
- *(*int32)(unsafe.Pointer(pLen)) -= ((int32(z) - int32(zStart)) / 1)
+ *(*int32)(unsafe.Pointer(pLen)) -= (int32(z) - int32(zStart)) / 1
*(*uintptr)(unsafe.Pointer(pz)) = z
return v
}
@@ -160434,7 +162683,7 @@ var zValue = [128]int8{
int8(25), int8(26), int8(27), int8(28), int8(29), int8(30), int8(31), int8(32), int8(33), int8(34), int8(35), int8(-1), int8(-1), int8(-1), int8(-1), int8(36),
int8(-1), int8(37), int8(38), int8(39), int8(40), int8(41), int8(42), int8(43), int8(44), int8(45), int8(46), int8(47), int8(48), int8(49), int8(50), int8(51),
int8(52), int8(53), int8(54), int8(55), int8(56), int8(57), int8(58), int8(59), int8(60), int8(61), int8(62), int8(-1), int8(-1), int8(-1), int8(63), int8(-1),
-} /* sqlite3.c:200550:28 */
+} /* sqlite3.c:202228:28 */
// Apply a delta.
//
@@ -160454,7 +162703,7 @@ var zValue = [128]int8{
//
// Refer to the delta_create() documentation above for a description
// of the delta file format.
-func rbuDeltaApply(tls *libc.TLS, zSrc uintptr, lenSrc int32, zDelta uintptr, lenDelta int32, zOut uintptr) int32 { /* sqlite3.c:200630:12: */
+func rbuDeltaApply(tls *libc.TLS, zSrc uintptr, lenSrc int32, zDelta uintptr, lenDelta int32, zOut uintptr) int32 { /* sqlite3.c:202308:12: */
bp := tls.Alloc(8)
defer tls.Free(8)
*(*uintptr)(unsafe.Pointer(bp)) = zDelta
@@ -160464,13 +162713,13 @@ func rbuDeltaApply(tls *libc.TLS, zSrc uintptr, lenSrc int32, zDelta uintptr, le
var total uint32 = uint32(0)
limit = rbuDeltaGetInt(tls, bp /* &zDelta */, bp+4 /* &lenDelta */)
- if int32(*(*uint8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* zDelta */))))) != '\n' {
+ if int32(*(*uint8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp))))) != '\n' {
// ERROR: size integer not terminated by "\n"
return -1
}
*(*uintptr)(unsafe.Pointer(bp /* zDelta */))++
*(*int32)(unsafe.Pointer(bp + 4 /* lenDelta */))--
- for (*(*uint8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* zDelta */)))) != 0) && (*(*int32)(unsafe.Pointer(bp + 4 /* lenDelta */)) > 0) {
+ for *(*uint8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))) != 0 && *(*int32)(unsafe.Pointer(bp + 4)) > 0 {
var cnt uint32
var ofst uint32
cnt = rbuDeltaGetInt(tls, bp /* &zDelta */, bp+4 /* &lenDelta */)
@@ -160480,22 +162729,22 @@ func rbuDeltaApply(tls *libc.TLS, zSrc uintptr, lenSrc int32, zDelta uintptr, le
*(*uintptr)(unsafe.Pointer(bp /* zDelta */))++
*(*int32)(unsafe.Pointer(bp + 4 /* lenDelta */))--
ofst = rbuDeltaGetInt(tls, bp /* &zDelta */, bp+4 /* &lenDelta */)
- if (*(*int32)(unsafe.Pointer(bp + 4 /* lenDelta */)) > 0) && (int32(*(*uint8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* zDelta */))))) != ',') {
+ if *(*int32)(unsafe.Pointer(bp + 4)) > 0 && int32(*(*uint8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp))))) != ',' {
// ERROR: copy command not terminated by ','
return -1
}
*(*uintptr)(unsafe.Pointer(bp /* zDelta */))++
*(*int32)(unsafe.Pointer(bp + 4 /* lenDelta */))--
- total = total + (cnt)
+ total = total + cnt
if total > limit {
// ERROR: copy exceeds output file size
return -1
}
- if (int32(ofst + cnt)) > lenSrc {
+ if int32(ofst+cnt) > lenSrc {
// ERROR: copy extends past end of input
return -1
}
- libc.Xmemcpy(tls, zOut, (zSrc + uintptr(ofst)), cnt)
+ libc.Xmemcpy(tls, zOut, zSrc+uintptr(ofst), cnt)
zOut += uintptr(cnt)
break
@@ -160504,12 +162753,12 @@ func rbuDeltaApply(tls *libc.TLS, zSrc uintptr, lenSrc int32, zDelta uintptr, le
{
*(*uintptr)(unsafe.Pointer(bp /* zDelta */))++
*(*int32)(unsafe.Pointer(bp + 4 /* lenDelta */))--
- total = total + (cnt)
+ total = total + cnt
if total > limit {
// ERROR: insert command gives an output larger than predicted
return -1
}
- if int32(cnt) > *(*int32)(unsafe.Pointer(bp + 4 /* lenDelta */)) {
+ if int32(cnt) > *(*int32)(unsafe.Pointer(bp + 4)) {
// ERROR: insert count exceeds size of delta
return -1
}
@@ -160544,7 +162793,7 @@ func rbuDeltaApply(tls *libc.TLS, zSrc uintptr, lenSrc int32, zDelta uintptr, le
return -1
}
-func rbuDeltaOutputSize(tls *libc.TLS, zDelta uintptr, lenDelta int32) int32 { /* sqlite3.c:200716:12: */
+func rbuDeltaOutputSize(tls *libc.TLS, zDelta uintptr, lenDelta int32) int32 { /* sqlite3.c:202394:12: */
bp := tls.Alloc(8)
defer tls.Free(8)
*(*uintptr)(unsafe.Pointer(bp)) = zDelta
@@ -160552,7 +162801,7 @@ func rbuDeltaOutputSize(tls *libc.TLS, zDelta uintptr, lenDelta int32) int32 { /
var size int32
size = int32(rbuDeltaGetInt(tls, bp /* &zDelta */, bp+4 /* &lenDelta */))
- if int32(*(*uint8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* zDelta */))))) != '\n' {
+ if int32(*(*uint8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp))))) != '\n' {
// ERROR: size integer not terminated by "\n"
return -1
}
@@ -160569,7 +162818,7 @@ func rbuDeltaOutputSize(tls *libc.TLS, zDelta uintptr, lenDelta int32) int32 { /
// arguments must be passed to this function. The first is the blob to
// patch and the second the patch to apply. If no error occurs, this
// function returns the patched blob.
-func rbuFossilDeltaFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:200738:13: */
+func rbuFossilDeltaFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:202416:13: */
var aDelta uintptr
var nDelta int32
var aOrig uintptr
@@ -160586,18 +162835,18 @@ func rbuFossilDeltaFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr
// Figure out the size of the output
nOut = rbuDeltaOutputSize(tls, aDelta, nDelta)
if nOut < 0 {
- Xsqlite3_result_error(tls, context, ts+26125 /* "corrupt fossil d..." */, -1)
+ Xsqlite3_result_error(tls, context, ts+27422 /* "corrupt fossil d..." */, -1)
return
}
- aOut = Xsqlite3_malloc(tls, (nOut + 1))
+ aOut = Xsqlite3_malloc(tls, nOut+1)
if aOut == uintptr(0) {
Xsqlite3_result_error_nomem(tls, context)
} else {
nOut2 = rbuDeltaApply(tls, aOrig, nOrig, aDelta, nDelta, aOut)
if nOut2 != nOut {
Xsqlite3_free(tls, aOut)
- Xsqlite3_result_error(tls, context, ts+26125 /* "corrupt fossil d..." */, -1)
+ Xsqlite3_result_error(tls, context, ts+27422 /* "corrupt fossil d..." */, -1)
} else {
Xsqlite3_result_blob(tls, context, aOut, nOut, *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{Xsqlite3_free})))
}
@@ -160612,13 +162861,13 @@ func rbuFossilDeltaFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr
// an SQLite error code. Additionally, set output variable *pzErrmsg to
// point to a buffer containing an error message. It is the responsibility
// of the caller to (eventually) free this buffer using sqlite3_free().
-func prepareAndCollectError(tls *libc.TLS, db uintptr, ppStmt uintptr, pzErrmsg uintptr, zSql uintptr) int32 { /* sqlite3.c:200791:12: */
+func prepareAndCollectError(tls *libc.TLS, db uintptr, ppStmt uintptr, pzErrmsg uintptr, zSql uintptr) int32 { /* sqlite3.c:202469:12: */
bp := tls.Alloc(8)
defer tls.Free(8)
var rc int32 = Xsqlite3_prepare_v2(tls, db, zSql, -1, ppStmt, uintptr(0))
if rc != SQLITE_OK {
- *(*uintptr)(unsafe.Pointer(pzErrmsg)) = Xsqlite3_mprintf(tls, ts+2790 /* "%s" */, libc.VaList(bp, Xsqlite3_errmsg(tls, db)))
+ *(*uintptr)(unsafe.Pointer(pzErrmsg)) = Xsqlite3_mprintf(tls, ts+3601 /* "%s" */, libc.VaList(bp, Xsqlite3_errmsg(tls, db)))
*(*uintptr)(unsafe.Pointer(ppStmt)) = uintptr(0)
}
return rc
@@ -160630,13 +162879,13 @@ func prepareAndCollectError(tls *libc.TLS, db uintptr, ppStmt uintptr, pzErrmsg
// If an error has occurred, then set *pzErrmsg to point to a buffer
// containing an error message. It is the responsibility of the caller
// to eventually free this buffer using sqlite3_free().
-func resetAndCollectError(tls *libc.TLS, pStmt uintptr, pzErrmsg uintptr) int32 { /* sqlite3.c:200813:12: */
+func resetAndCollectError(tls *libc.TLS, pStmt uintptr, pzErrmsg uintptr) int32 { /* sqlite3.c:202491:12: */
bp := tls.Alloc(8)
defer tls.Free(8)
var rc int32 = Xsqlite3_reset(tls, pStmt)
if rc != SQLITE_OK {
- *(*uintptr)(unsafe.Pointer(pzErrmsg)) = Xsqlite3_mprintf(tls, ts+2790 /* "%s" */, libc.VaList(bp, Xsqlite3_errmsg(tls, Xsqlite3_db_handle(tls, pStmt))))
+ *(*uintptr)(unsafe.Pointer(pzErrmsg)) = Xsqlite3_mprintf(tls, ts+3601 /* "%s" */, libc.VaList(bp, Xsqlite3_errmsg(tls, Xsqlite3_db_handle(tls, pStmt))))
}
return rc
}
@@ -160654,7 +162903,7 @@ func resetAndCollectError(tls *libc.TLS, pStmt uintptr, pzErrmsg uintptr) int32
//
// If argument zSql is NULL, this function assumes that an OOM has occurred.
// In this case SQLITE_NOMEM is returned and *ppStmt set to NULL.
-func prepareFreeAndCollectError(tls *libc.TLS, db uintptr, ppStmt uintptr, pzErrmsg uintptr, zSql uintptr) int32 { /* sqlite3.c:200836:12: */
+func prepareFreeAndCollectError(tls *libc.TLS, db uintptr, ppStmt uintptr, pzErrmsg uintptr, zSql uintptr) int32 { /* sqlite3.c:202514:12: */
var rc int32
if zSql == uintptr(0) {
@@ -160669,7 +162918,7 @@ func prepareFreeAndCollectError(tls *libc.TLS, db uintptr, ppStmt uintptr, pzErr
// Free the RbuObjIter.azTblCol[] and RbuObjIter.abTblPk[] arrays allocated
// by an earlier call to rbuObjIterCacheTableInfo().
-func rbuObjIterFreeCols(tls *libc.TLS, pIter uintptr) { /* sqlite3.c:200858:13: */
+func rbuObjIterFreeCols(tls *libc.TLS, pIter uintptr) { /* sqlite3.c:202536:13: */
var i int32
for i = 0; i < (*RbuObjIter)(unsafe.Pointer(pIter)).FnTblCol; i++ {
Xsqlite3_free(tls, *(*uintptr)(unsafe.Pointer((*RbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(i)*4)))
@@ -160687,7 +162936,7 @@ func rbuObjIterFreeCols(tls *libc.TLS, pIter uintptr) { /* sqlite3.c:200858:13:
// Finalize all statements and free all allocations that are specific to
// the current object (table/index pair).
-func rbuObjIterClearStatements(tls *libc.TLS, pIter uintptr) { /* sqlite3.c:200878:13: */
+func rbuObjIterClearStatements(tls *libc.TLS, pIter uintptr) { /* sqlite3.c:202556:13: */
var pUp uintptr
Xsqlite3_finalize(tls, (*RbuObjIter)(unsafe.Pointer(pIter)).FpSelect)
@@ -160717,7 +162966,7 @@ func rbuObjIterClearStatements(tls *libc.TLS, pIter uintptr) { /* sqlite3.c:2008
// Clean up any resources allocated as part of the iterator object passed
// as the only argument.
-func rbuObjIterFinalize(tls *libc.TLS, pIter uintptr) { /* sqlite3.c:200910:13: */
+func rbuObjIterFinalize(tls *libc.TLS, pIter uintptr) { /* sqlite3.c:202588:13: */
rbuObjIterClearStatements(tls, pIter)
Xsqlite3_finalize(tls, (*RbuObjIter)(unsafe.Pointer(pIter)).FpTblIter)
Xsqlite3_finalize(tls, (*RbuObjIter)(unsafe.Pointer(pIter)).FpIdxIter)
@@ -160731,7 +162980,7 @@ func rbuObjIterFinalize(tls *libc.TLS, pIter uintptr) { /* sqlite3.c:200910:13:
// pointing to the next entry. Otherwise, an error code and message is
// left in the RBU handle passed as the first argument. A copy of the
// error code is returned.
-func rbuObjIterNext(tls *libc.TLS, p uintptr, pIter uintptr) int32 { /* sqlite3.c:200926:12: */
+func rbuObjIterNext(tls *libc.TLS, p uintptr, pIter uintptr) int32 { /* sqlite3.c:202604:12: */
var rc int32 = (*Sqlite3rbu)(unsafe.Pointer(p)).Frc
if rc == SQLITE_OK {
@@ -160740,7 +162989,7 @@ func rbuObjIterNext(tls *libc.TLS, p uintptr, pIter uintptr) int32 { /* sqlite3.
if (*RbuObjIter)(unsafe.Pointer(pIter)).FzIdx == uintptr(0) {
rc = Xsqlite3_exec(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain,
- ts+26146 /* "DROP TRIGGER IF ..." */, uintptr(0), uintptr(0), (p + 36 /* &.zErrmsg */))
+ ts+27443 /* "DROP TRIGGER IF ..." */, uintptr(0), uintptr(0), p+36)
}
if rc == SQLITE_OK {
@@ -160749,12 +162998,12 @@ func rbuObjIterNext(tls *libc.TLS, p uintptr, pIter uintptr) int32 { /* sqlite3.
(*RbuObjIter)(unsafe.Pointer(pIter)).FbCleanup = 0
rc = Xsqlite3_step(tls, (*RbuObjIter)(unsafe.Pointer(pIter)).FpTblIter)
if rc != SQLITE_ROW {
- rc = resetAndCollectError(tls, (*RbuObjIter)(unsafe.Pointer(pIter)).FpTblIter, (p + 36 /* &.zErrmsg */))
+ rc = resetAndCollectError(tls, (*RbuObjIter)(unsafe.Pointer(pIter)).FpTblIter, p+36)
(*RbuObjIter)(unsafe.Pointer(pIter)).FzTbl = uintptr(0)
} else {
(*RbuObjIter)(unsafe.Pointer(pIter)).FzTbl = Xsqlite3_column_text(tls, (*RbuObjIter)(unsafe.Pointer(pIter)).FpTblIter, 0)
(*RbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl = Xsqlite3_column_text(tls, (*RbuObjIter)(unsafe.Pointer(pIter)).FpTblIter, 1)
- if ((*RbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl != 0) && ((*RbuObjIter)(unsafe.Pointer(pIter)).FzTbl != 0) {
+ if (*RbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl != 0 && (*RbuObjIter)(unsafe.Pointer(pIter)).FzTbl != 0 {
rc = SQLITE_OK
} else {
rc = SQLITE_NOMEM
@@ -160768,7 +163017,7 @@ func rbuObjIterNext(tls *libc.TLS, p uintptr, pIter uintptr) int32 { /* sqlite3.
if rc == SQLITE_OK {
rc = Xsqlite3_step(tls, (*RbuObjIter)(unsafe.Pointer(pIter)).FpIdxIter)
if rc != SQLITE_ROW {
- rc = resetAndCollectError(tls, (*RbuObjIter)(unsafe.Pointer(pIter)).FpIdxIter, (p + 36 /* &.zErrmsg */))
+ rc = resetAndCollectError(tls, (*RbuObjIter)(unsafe.Pointer(pIter)).FpIdxIter, p+36)
(*RbuObjIter)(unsafe.Pointer(pIter)).FbCleanup = 1
(*RbuObjIter)(unsafe.Pointer(pIter)).FzIdx = uintptr(0)
} else {
@@ -160812,24 +163061,24 @@ func rbuObjIterNext(tls *libc.TLS, p uintptr, pIter uintptr) int32 { /* sqlite3.
//
// For an rbu vacuum handle, a copy of the first argument is returned if
// the second argument is either missing or 0 (not a view).
-func rbuTargetNameFunc(tls *libc.TLS, pCtx uintptr, argc int32, argv uintptr) { /* sqlite3.c:201006:13: */
+func rbuTargetNameFunc(tls *libc.TLS, pCtx uintptr, argc int32, argv uintptr) { /* sqlite3.c:202684:13: */
var p uintptr = Xsqlite3_user_data(tls, pCtx)
var zIn uintptr
zIn = Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv)))
if zIn != 0 {
- if (*Sqlite3rbu)(unsafe.Pointer((p))).FzTarget == uintptr(0) {
+ if (*Sqlite3rbu)(unsafe.Pointer(p)).FzTarget == uintptr(0) {
- if (argc == 1) || (0 == Xsqlite3_value_int(tls, *(*uintptr)(unsafe.Pointer(argv + 1*4)))) {
+ if argc == 1 || 0 == Xsqlite3_value_int(tls, *(*uintptr)(unsafe.Pointer(argv + 1*4))) {
Xsqlite3_result_text(tls, pCtx, zIn, -1, uintptr(0))
}
} else {
- if (libc.Xstrlen(tls, zIn) > Size_t(4)) && (libc.Xmemcmp(tls, ts+23316 /* "data" */, zIn, uint32(4)) == 0) {
+ if libc.Xstrlen(tls, zIn) > Size_t(4) && libc.Xmemcmp(tls, ts+24613, zIn, uint32(4)) == 0 {
var i int32
- for i = 4; (int32(*(*uint8)(unsafe.Pointer(zIn + uintptr(i)))) >= '0') && (int32(*(*uint8)(unsafe.Pointer(zIn + uintptr(i)))) <= '9'); i++ {
+ for i = 4; int32(*(*uint8)(unsafe.Pointer(zIn + uintptr(i)))) >= '0' && int32(*(*uint8)(unsafe.Pointer(zIn + uintptr(i)))) <= '9'; i++ {
}
- if (int32(*(*uint8)(unsafe.Pointer(zIn + uintptr(i)))) == '_') && (*(*uint8)(unsafe.Pointer(zIn + uintptr((i + 1)))) != 0) {
- Xsqlite3_result_text(tls, pCtx, (zIn + uintptr((i + 1))), -1, uintptr(0))
+ if int32(*(*uint8)(unsafe.Pointer(zIn + uintptr(i)))) == '_' && *(*uint8)(unsafe.Pointer(zIn + uintptr(i+1))) != 0 {
+ Xsqlite3_result_text(tls, pCtx, zIn+uintptr(i+1), -1, uintptr(0))
}
}
}
@@ -160842,27 +163091,27 @@ func rbuTargetNameFunc(tls *libc.TLS, pCtx uintptr, argc int32, argv uintptr) {
// pointing to the first entry. Otherwise, an error code and message is
// left in the RBU handle passed as the first argument. A copy of the
// error code is returned.
-func rbuObjIterFirst(tls *libc.TLS, p uintptr, pIter uintptr) int32 { /* sqlite3.c:201042:12: */
+func rbuObjIterFirst(tls *libc.TLS, p uintptr, pIter uintptr) int32 { /* sqlite3.c:202720:12: */
bp := tls.Alloc(8)
defer tls.Free(8)
var rc int32
libc.Xmemset(tls, pIter, 0, uint32(unsafe.Sizeof(RbuObjIter{})))
- rc = prepareFreeAndCollectError(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbRbu, (pIter /* &.pTblIter */), (p + 36 /* &.zErrmsg */),
+ rc = prepareFreeAndCollectError(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbRbu, pIter, p+36,
Xsqlite3_mprintf(tls,
- ts+26317 /* "SELECT rbu_targe..." */, libc.VaList(bp, func() uintptr {
- if (*Sqlite3rbu)(unsafe.Pointer((p))).FzTarget == uintptr(0) {
- return ts + 26467 /* "AND rootpage!=0 ..." */
+ ts+27614 /* "SELECT rbu_targe..." */, libc.VaList(bp, func() uintptr {
+ if (*Sqlite3rbu)(unsafe.Pointer(p)).FzTarget == uintptr(0) {
+ return ts + 27764 /* "AND rootpage!=0 ..." */
}
- return ts + 755 /* "" */
+ return ts + 1543 /* "" */
}())))
if rc == SQLITE_OK {
- rc = prepareAndCollectError(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain, (pIter + 4 /* &.pIdxIter */), (p + 36 /* &.zErrmsg */),
+ rc = prepareAndCollectError(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain, pIter+4, p+36,
- ts+26508 /* "SELECT name, roo..." */)
+ ts+27805 /* "SELECT name, roo..." */)
}
(*RbuObjIter)(unsafe.Pointer(pIter)).FbCleanup = 1
@@ -160877,7 +163126,7 @@ func rbuObjIterFirst(tls *libc.TLS, p uintptr, pIter uintptr) int32 { /* sqlite3
// than SQLITE_OK), then this function returns NULL without modifying the
// stored error code. In this case it still calls sqlite3_free() on any
// printf() parameters associated with %z conversions.
-func rbuMPrintf(tls *libc.TLS, p uintptr, zFmt uintptr, va uintptr) uintptr { /* sqlite3.c:201077:13: */
+func rbuMPrintf(tls *libc.TLS, p uintptr, zFmt uintptr, va uintptr) uintptr { /* sqlite3.c:202755:13: */
var zSql uintptr = uintptr(0)
var ap Va_list
_ = ap
@@ -160903,7 +163152,7 @@ func rbuMPrintf(tls *libc.TLS, p uintptr, zFmt uintptr, va uintptr) uintptr { /*
// If an error occurs, an error code and error message is stored in the
// RBU handle. If an error has already occurred when this function is
// called, it is a no-op.
-func rbuMPrintfExec(tls *libc.TLS, p uintptr, db uintptr, zFmt uintptr, va uintptr) int32 { /* sqlite3.c:201102:12: */
+func rbuMPrintfExec(tls *libc.TLS, p uintptr, db uintptr, zFmt uintptr, va uintptr) int32 { /* sqlite3.c:202780:12: */
var ap Va_list
_ = ap
var zSql uintptr
@@ -160913,7 +163162,7 @@ func rbuMPrintfExec(tls *libc.TLS, p uintptr, db uintptr, zFmt uintptr, va uintp
if zSql == uintptr(0) {
(*Sqlite3rbu)(unsafe.Pointer(p)).Frc = SQLITE_NOMEM
} else {
- (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, db, zSql, uintptr(0), uintptr(0), (p + 36 /* &.zErrmsg */))
+ (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, db, zSql, uintptr(0), uintptr(0), p+36)
}
}
Xsqlite3_free(tls, zSql)
@@ -160929,7 +163178,7 @@ func rbuMPrintfExec(tls *libc.TLS, p uintptr, db uintptr, zFmt uintptr, va uintp
// error has already occurred when this function is called, return NULL
// immediately without attempting the allocation or modifying the stored
// error code.
-func rbuMalloc(tls *libc.TLS, p uintptr, nByte Sqlite3_int64) uintptr { /* sqlite3.c:201129:13: */
+func rbuMalloc(tls *libc.TLS, p uintptr, nByte Sqlite3_int64) uintptr { /* sqlite3.c:202807:13: */
var pRet uintptr = uintptr(0)
if (*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK {
@@ -160946,18 +163195,18 @@ func rbuMalloc(tls *libc.TLS, p uintptr, nByte Sqlite3_int64) uintptr { /* sqlit
// Allocate and zero the pIter->azTblCol[] and abTblPk[] arrays so that
// there is room for at least nCol elements. If an OOM occurs, store an
// error code in the RBU handle passed as the first argument.
-func rbuAllocateIterArrays(tls *libc.TLS, p uintptr, pIter uintptr, nCol int32) { /* sqlite3.c:201149:13: */
- var nByte Sqlite3_int64 = (Sqlite3_int64((((uint32(2) * uint32(unsafe.Sizeof(uintptr(0)))) + uint32(unsafe.Sizeof(int32(0)))) + (uint32(3) * uint32(unsafe.Sizeof(U8(0))))) * uint32(nCol)))
+func rbuAllocateIterArrays(tls *libc.TLS, p uintptr, pIter uintptr, nCol int32) { /* sqlite3.c:202827:13: */
+ var nByte Sqlite3_int64 = Sqlite3_int64((uint32(2)*uint32(unsafe.Sizeof(uintptr(0))) + uint32(unsafe.Sizeof(int32(0))) + uint32(3)*uint32(unsafe.Sizeof(U8(0)))) * uint32(nCol))
var azNew uintptr
azNew = rbuMalloc(tls, p, nByte)
if azNew != 0 {
(*RbuObjIter)(unsafe.Pointer(pIter)).FazTblCol = azNew
- (*RbuObjIter)(unsafe.Pointer(pIter)).FazTblType = (azNew + uintptr(nCol)*4)
- (*RbuObjIter)(unsafe.Pointer(pIter)).FaiSrcOrder = ((*RbuObjIter)(unsafe.Pointer(pIter)).FazTblType + uintptr(nCol)*4)
- (*RbuObjIter)(unsafe.Pointer(pIter)).FabTblPk = ((*RbuObjIter)(unsafe.Pointer(pIter)).FaiSrcOrder + uintptr(nCol)*4)
- (*RbuObjIter)(unsafe.Pointer(pIter)).FabNotNull = ((*RbuObjIter)(unsafe.Pointer(pIter)).FabTblPk + uintptr(nCol))
- (*RbuObjIter)(unsafe.Pointer(pIter)).FabIndexed = ((*RbuObjIter)(unsafe.Pointer(pIter)).FabNotNull + uintptr(nCol))
+ (*RbuObjIter)(unsafe.Pointer(pIter)).FazTblType = azNew + uintptr(nCol)*4
+ (*RbuObjIter)(unsafe.Pointer(pIter)).FaiSrcOrder = (*RbuObjIter)(unsafe.Pointer(pIter)).FazTblType + uintptr(nCol)*4
+ (*RbuObjIter)(unsafe.Pointer(pIter)).FabTblPk = (*RbuObjIter)(unsafe.Pointer(pIter)).FaiSrcOrder + uintptr(nCol)*4
+ (*RbuObjIter)(unsafe.Pointer(pIter)).FabNotNull = (*RbuObjIter)(unsafe.Pointer(pIter)).FabTblPk + uintptr(nCol)
+ (*RbuObjIter)(unsafe.Pointer(pIter)).FabIndexed = (*RbuObjIter)(unsafe.Pointer(pIter)).FabNotNull + uintptr(nCol)
}
}
@@ -160969,12 +163218,12 @@ func rbuAllocateIterArrays(tls *libc.TLS, p uintptr, pIter uintptr, nCol int32)
// If an OOM condition is encountered when attempting to allocate memory,
// output variable (*pRc) is set to SQLITE_NOMEM before returning. Otherwise,
// if the allocation succeeds, (*pRc) is left unchanged.
-func rbuStrndup(tls *libc.TLS, zStr uintptr, pRc uintptr) uintptr { /* sqlite3.c:201174:13: */
+func rbuStrndup(tls *libc.TLS, zStr uintptr, pRc uintptr) uintptr { /* sqlite3.c:202852:13: */
var zRet uintptr = uintptr(0)
if *(*int32)(unsafe.Pointer(pRc)) == SQLITE_OK {
if zStr != 0 {
- var nCopy Size_t = (libc.Xstrlen(tls, zStr) + Size_t(1))
+ var nCopy Size_t = libc.Xstrlen(tls, zStr) + Size_t(1)
zRet = Xsqlite3_malloc64(tls, uint64(nCopy))
if zRet != 0 {
libc.Xmemcpy(tls, zRet, zStr, nCopy)
@@ -160992,15 +163241,15 @@ func rbuStrndup(tls *libc.TLS, zStr uintptr, pRc uintptr) uintptr { /* sqlite3.c
// If the sqlite3_finalize() call indicates that an error occurs, and the
// rbu handle error code is not already set, set the error code and error
// message accordingly.
-func rbuFinalize(tls *libc.TLS, p uintptr, pStmt uintptr) { /* sqlite3.c:201199:13: */
+func rbuFinalize(tls *libc.TLS, p uintptr, pStmt uintptr) { /* sqlite3.c:202877:13: */
bp := tls.Alloc(8)
defer tls.Free(8)
var db uintptr = Xsqlite3_db_handle(tls, pStmt)
var rc int32 = Xsqlite3_finalize(tls, pStmt)
- if ((*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK) && (rc != SQLITE_OK) {
+ if (*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && rc != SQLITE_OK {
(*Sqlite3rbu)(unsafe.Pointer(p)).Frc = rc
- (*Sqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, ts+2790 /* "%s" */, libc.VaList(bp, Xsqlite3_errmsg(tls, db)))
+ (*Sqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, ts+3601 /* "%s" */, libc.VaList(bp, Xsqlite3_errmsg(tls, db)))
}
}
@@ -161042,7 +163291,7 @@ func rbuFinalize(tls *libc.TLS, p uintptr, pStmt uintptr) { /* sqlite3.c:201199:
// }else{
// return RBU_PK_NONE
// }
-func rbuTableType(tls *libc.TLS, p uintptr, zTab uintptr, peType uintptr, piTnum uintptr, piPk uintptr) { /* sqlite3.c:201247:13: */
+func rbuTableType(tls *libc.TLS, p uintptr, zTab uintptr, peType uintptr, piTnum uintptr, piPk uintptr) { /* sqlite3.c:202925:13: */
bp := tls.Alloc(48)
defer tls.Free(48)
@@ -161060,18 +163309,18 @@ func rbuTableType(tls *libc.TLS, p uintptr, zTab uintptr, peType uintptr, piTnum
*(*int32)(unsafe.Pointer(peType)) = RBU_PK_NOTABLE
*(*int32)(unsafe.Pointer(piPk)) = 0
- (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = prepareFreeAndCollectError(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain, (bp + 32 /* &aStmt */), (p + 36 /* &.zErrmsg */),
+ (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = prepareFreeAndCollectError(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp+32, p+36,
Xsqlite3_mprintf(tls,
- ts+26633 /* "SELECT (sql LIKE..." */, libc.VaList(bp, zTab)))
- if !(((*Sqlite3rbu)(unsafe.Pointer(p)).Frc != SQLITE_OK) || (Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp + 32 /* &aStmt[0] */))) != SQLITE_ROW)) {
+ ts+27930 /* "SELECT (sql COL..." */, libc.VaList(bp, zTab)))
+ if !((*Sqlite3rbu)(unsafe.Pointer(p)).Frc != SQLITE_OK || Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp + 32))) != SQLITE_ROW) {
goto __1
}
// Either an error, or no such table.
goto rbuTableType_end
__1:
;
- if !(Xsqlite3_column_int(tls, *(*uintptr)(unsafe.Pointer(bp + 32 /* &aStmt[0] */)), 0) != 0) {
+ if !(Xsqlite3_column_int(tls, *(*uintptr)(unsafe.Pointer(bp + 32)), 0) != 0) {
goto __2
}
*(*int32)(unsafe.Pointer(peType)) = RBU_PK_VTAB // virtual table
@@ -161080,8 +163329,8 @@ __2:
;
*(*int32)(unsafe.Pointer(piTnum)) = Xsqlite3_column_int(tls, *(*uintptr)(unsafe.Pointer(bp + 32 /* &aStmt[0] */)), 1)
- (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = prepareFreeAndCollectError(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain, (bp + 32 /* &aStmt */ + 1*4), (p + 36 /* &.zErrmsg */),
- Xsqlite3_mprintf(tls, ts+26714 /* "PRAGMA index_lis..." */, libc.VaList(bp+8, zTab)))
+ (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = prepareFreeAndCollectError(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp+32+1*4, p+36,
+ Xsqlite3_mprintf(tls, ts+28049 /* "PRAGMA index_lis..." */, libc.VaList(bp+8, zTab)))
if !((*Sqlite3rbu)(unsafe.Pointer(p)).Frc != 0) {
goto __3
}
@@ -161089,21 +163338,21 @@ __2:
__3:
;
__4:
- if !(Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp + 32 /* &aStmt[0] */ + 1*4))) == SQLITE_ROW) {
+ if !(Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp + 32 + 1*4))) == SQLITE_ROW) {
goto __5
}
zOrig = Xsqlite3_column_text(tls, *(*uintptr)(unsafe.Pointer(bp + 32 /* &aStmt[0] */ + 1*4)), 3)
zIdx = Xsqlite3_column_text(tls, *(*uintptr)(unsafe.Pointer(bp + 32 /* &aStmt[0] */ + 1*4)), 1)
- if !(((zOrig != 0) && (zIdx != 0)) && (int32(*(*U8)(unsafe.Pointer(zOrig))) == 'p')) {
+ if !(zOrig != 0 && zIdx != 0 && int32(*(*U8)(unsafe.Pointer(zOrig))) == 'p') {
goto __6
}
- (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = prepareFreeAndCollectError(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain, (bp + 32 /* &aStmt */ + 2*4), (p + 36 /* &.zErrmsg */),
+ (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = prepareFreeAndCollectError(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp+32+2*4, p+36,
Xsqlite3_mprintf(tls,
- ts+26735 /* "SELECT rootpage ..." */, libc.VaList(bp+16, zIdx)))
+ ts+28070 /* "SELECT rootpage ..." */, libc.VaList(bp+16, zIdx)))
if !((*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK) {
goto __7
}
- if !(Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp + 32 /* &aStmt[0] */ + 2*4))) == SQLITE_ROW) {
+ if !(Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp + 32 + 2*4))) == SQLITE_ROW) {
goto __8
}
*(*int32)(unsafe.Pointer(piPk)) = Xsqlite3_column_int(tls, *(*uintptr)(unsafe.Pointer(bp + 32 /* &aStmt[0] */ + 2*4)), 0)
@@ -161122,16 +163371,16 @@ __6:
__5:
;
- (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = prepareFreeAndCollectError(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain, (bp + 32 /* &aStmt */ + 3*4), (p + 36 /* &.zErrmsg */),
- Xsqlite3_mprintf(tls, ts+26786 /* "PRAGMA table_inf..." */, libc.VaList(bp+24, zTab)))
+ (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = prepareFreeAndCollectError(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp+32+3*4, p+36,
+ Xsqlite3_mprintf(tls, ts+28121 /* "PRAGMA table_inf..." */, libc.VaList(bp+24, zTab)))
if !((*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK) {
goto __10
}
__11:
- if !(Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp + 32 /* &aStmt[0] */ + 3*4))) == SQLITE_ROW) {
+ if !(Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp + 32 + 3*4))) == SQLITE_ROW) {
goto __12
}
- if !(Xsqlite3_column_int(tls, *(*uintptr)(unsafe.Pointer(bp + 32 /* &aStmt[0] */ + 3*4)), 5) > 0) {
+ if !(Xsqlite3_column_int(tls, *(*uintptr)(unsafe.Pointer(bp + 32 + 3*4)), 5) > 0) {
goto __13
}
*(*int32)(unsafe.Pointer(peType)) = RBU_PK_IPK // explicit IPK column
@@ -161148,7 +163397,7 @@ __10:
rbuTableType_end:
i = uint32(0)
__14:
- if !(i < (uint32(unsafe.Sizeof([4]uintptr{})) / uint32(unsafe.Sizeof(uintptr(0))))) {
+ if !(i < uint32(unsafe.Sizeof([4]uintptr{}))/uint32(unsafe.Sizeof(uintptr(0)))) {
goto __16
}
rbuFinalize(tls, p, *(*uintptr)(unsafe.Pointer(bp + 32 /* &aStmt[0] */ + uintptr(i)*4)))
@@ -161162,7 +163411,7 @@ __16:
// This is a helper function for rbuObjIterCacheTableInfo(). It populates
// the pIter->abIndexed[] array.
-func rbuObjIterCacheIndexedCols(tls *libc.TLS, p uintptr, pIter uintptr) { /* sqlite3.c:201331:13: */
+func rbuObjIterCacheIndexedCols(tls *libc.TLS, p uintptr, pIter uintptr) { /* sqlite3.c:203011:13: */
bp := tls.Alloc(24)
defer tls.Free(24)
@@ -161170,13 +163419,13 @@ func rbuObjIterCacheIndexedCols(tls *libc.TLS, p uintptr, pIter uintptr) { /* sq
var bIndex int32 = 0
if (*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK {
- libc.Xmemcpy(tls, (*RbuObjIter)(unsafe.Pointer(pIter)).FabIndexed, (*RbuObjIter)(unsafe.Pointer(pIter)).FabTblPk, (uint32(unsafe.Sizeof(U8(0))) * uint32((*RbuObjIter)(unsafe.Pointer(pIter)).FnTblCol)))
- (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = prepareFreeAndCollectError(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp+16 /* &pList */, (p + 36 /* &.zErrmsg */),
- Xsqlite3_mprintf(tls, ts+26807 /* "PRAGMA main.inde..." */, libc.VaList(bp, (*RbuObjIter)(unsafe.Pointer(pIter)).FzTbl)))
+ libc.Xmemcpy(tls, (*RbuObjIter)(unsafe.Pointer(pIter)).FabIndexed, (*RbuObjIter)(unsafe.Pointer(pIter)).FabTblPk, uint32(unsafe.Sizeof(U8(0)))*uint32((*RbuObjIter)(unsafe.Pointer(pIter)).FnTblCol))
+ (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = prepareFreeAndCollectError(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp+16 /* &pList */, p+36,
+ Xsqlite3_mprintf(tls, ts+28142 /* "PRAGMA main.inde..." */, libc.VaList(bp, (*RbuObjIter)(unsafe.Pointer(pIter)).FzTbl)))
}
(*RbuObjIter)(unsafe.Pointer(pIter)).FnIndex = 0
- for ((*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK) && (SQLITE_ROW == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp + 16 /* pList */)))) {
+ for (*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && SQLITE_ROW == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp + 16))) {
var zIdx uintptr = Xsqlite3_column_text(tls, *(*uintptr)(unsafe.Pointer(bp + 16 /* pList */)), 1)
var bPartial int32 = Xsqlite3_column_int(tls, *(*uintptr)(unsafe.Pointer(bp + 16 /* pList */)), 4)
*(*uintptr)(unsafe.Pointer(bp + 20 /* pXInfo */)) = uintptr(0)
@@ -161184,17 +163433,17 @@ func rbuObjIterCacheIndexedCols(tls *libc.TLS, p uintptr, pIter uintptr) { /* sq
break
}
if bPartial != 0 {
- libc.Xmemset(tls, (*RbuObjIter)(unsafe.Pointer(pIter)).FabIndexed, 0x01, (uint32(unsafe.Sizeof(U8(0))) * uint32((*RbuObjIter)(unsafe.Pointer(pIter)).FnTblCol)))
+ libc.Xmemset(tls, (*RbuObjIter)(unsafe.Pointer(pIter)).FabIndexed, 0x01, uint32(unsafe.Sizeof(U8(0)))*uint32((*RbuObjIter)(unsafe.Pointer(pIter)).FnTblCol))
}
- (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = prepareFreeAndCollectError(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp+20 /* &pXInfo */, (p + 36 /* &.zErrmsg */),
- Xsqlite3_mprintf(tls, ts+26835 /* "PRAGMA main.inde..." */, libc.VaList(bp+8, zIdx)))
- for ((*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK) && (SQLITE_ROW == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp + 20 /* pXInfo */)))) {
+ (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = prepareFreeAndCollectError(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp+20 /* &pXInfo */, p+36,
+ Xsqlite3_mprintf(tls, ts+28170 /* "PRAGMA main.inde..." */, libc.VaList(bp+8, zIdx)))
+ for (*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && SQLITE_ROW == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp + 20))) {
var iCid int32 = Xsqlite3_column_int(tls, *(*uintptr)(unsafe.Pointer(bp + 20 /* pXInfo */)), 1)
if iCid >= 0 {
*(*U8)(unsafe.Pointer((*RbuObjIter)(unsafe.Pointer(pIter)).FabIndexed + uintptr(iCid))) = U8(1)
}
if iCid == -2 {
- libc.Xmemset(tls, (*RbuObjIter)(unsafe.Pointer(pIter)).FabIndexed, 0x01, (uint32(unsafe.Sizeof(U8(0))) * uint32((*RbuObjIter)(unsafe.Pointer(pIter)).FnTblCol)))
+ libc.Xmemset(tls, (*RbuObjIter)(unsafe.Pointer(pIter)).FabIndexed, 0x01, uint32(unsafe.Sizeof(U8(0)))*uint32((*RbuObjIter)(unsafe.Pointer(pIter)).FnTblCol))
}
}
rbuFinalize(tls, p, *(*uintptr)(unsafe.Pointer(bp + 20 /* pXInfo */)))
@@ -161220,7 +163469,7 @@ func rbuObjIterCacheIndexedCols(tls *libc.TLS, p uintptr, pIter uintptr) { /* sq
// Return SQLITE_OK if successful, or an SQLite error code otherwise. If
// an error does occur, an error code and error message are also left in
// the RBU handle.
-func rbuObjIterCacheTableInfo(tls *libc.TLS, p uintptr, pIter uintptr) int32 { /* sqlite3.c:201385:12: */
+func rbuObjIterCacheTableInfo(tls *libc.TLS, p uintptr, pIter uintptr) int32 { /* sqlite3.c:203065:12: */
bp := tls.Alloc(64)
defer tls.Free(64)
@@ -161234,10 +163483,10 @@ func rbuObjIterCacheTableInfo(tls *libc.TLS, p uintptr, pIter uintptr) int32 { /
// Figure out the type of table this step will deal with.
- rbuTableType(tls, p, (*RbuObjIter)(unsafe.Pointer(pIter)).FzTbl, (pIter + 36 /* &.eType */), bp+56 /* &iTnum */, (pIter + 60 /* &.iPkTnum */))
- if ((*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK) && ((*RbuObjIter)(unsafe.Pointer(pIter)).FeType == RBU_PK_NOTABLE) {
+ rbuTableType(tls, p, (*RbuObjIter)(unsafe.Pointer(pIter)).FzTbl, pIter+36, bp+56 /* &iTnum */, pIter+60)
+ if (*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && (*RbuObjIter)(unsafe.Pointer(pIter)).FeType == RBU_PK_NOTABLE {
(*Sqlite3rbu)(unsafe.Pointer(p)).Frc = SQLITE_ERROR
- (*Sqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, ts+17857 /* "no such table: %..." */, libc.VaList(bp, (*RbuObjIter)(unsafe.Pointer(pIter)).FzTbl))
+ (*Sqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, ts+19154 /* "no such table: %..." */, libc.VaList(bp, (*RbuObjIter)(unsafe.Pointer(pIter)).FzTbl))
}
if (*Sqlite3rbu)(unsafe.Pointer(p)).Frc != 0 {
return (*Sqlite3rbu)(unsafe.Pointer(p)).Frc
@@ -161249,36 +163498,36 @@ func rbuObjIterCacheTableInfo(tls *libc.TLS, p uintptr, pIter uintptr) int32 { /
// Populate the azTblCol[] and nTblCol variables based on the columns
// of the input table. Ignore any input table columns that begin with
// "rbu_".
- (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = prepareFreeAndCollectError(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbRbu, bp+60 /* &pStmt */, (p + 36 /* &.zErrmsg */),
- Xsqlite3_mprintf(tls, ts+26864 /* "SELECT * FROM '%..." */, libc.VaList(bp+8, (*RbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl)))
+ (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = prepareFreeAndCollectError(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbRbu, bp+60 /* &pStmt */, p+36,
+ Xsqlite3_mprintf(tls, ts+28199 /* "SELECT * FROM '%..." */, libc.VaList(bp+8, (*RbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl)))
if (*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK {
nCol = Xsqlite3_column_count(tls, *(*uintptr)(unsafe.Pointer(bp + 60 /* pStmt */)))
rbuAllocateIterArrays(tls, p, pIter, nCol)
}
- for i = 0; ((*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK) && (i < nCol); i++ {
+ for i = 0; (*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && i < nCol; i++ {
var zName uintptr = Xsqlite3_column_name(tls, *(*uintptr)(unsafe.Pointer(bp + 60 /* pStmt */)), i)
- if Xsqlite3_strnicmp(tls, ts+26883 /* "rbu_" */, zName, 4) != 0 {
- var zCopy uintptr = rbuStrndup(tls, zName, (p + 32 /* &.rc */))
+ if Xsqlite3_strnicmp(tls, ts+28218, zName, 4) != 0 {
+ var zCopy uintptr = rbuStrndup(tls, zName, p+32)
*(*int32)(unsafe.Pointer((*RbuObjIter)(unsafe.Pointer(pIter)).FaiSrcOrder + uintptr((*RbuObjIter)(unsafe.Pointer(pIter)).FnTblCol)*4)) = (*RbuObjIter)(unsafe.Pointer(pIter)).FnTblCol
*(*uintptr)(unsafe.Pointer((*RbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(libc.PostIncInt32(&(*RbuObjIter)(unsafe.Pointer(pIter)).FnTblCol, 1))*4)) = zCopy
- } else if 0 == Xsqlite3_stricmp(tls, ts+26888 /* "rbu_rowid" */, zName) {
+ } else if 0 == Xsqlite3_stricmp(tls, ts+28223, zName) {
bRbuRowid = 1
}
}
Xsqlite3_finalize(tls, *(*uintptr)(unsafe.Pointer(bp + 60 /* pStmt */)))
*(*uintptr)(unsafe.Pointer(bp + 60 /* pStmt */)) = uintptr(0)
- if (((*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK) &&
- ((libc.Bool32((*Sqlite3rbu)(unsafe.Pointer((p))).FzTarget == uintptr(0))) == 0)) &&
- (bRbuRowid != (libc.Bool32(((*RbuObjIter)(unsafe.Pointer(pIter)).FeType == RBU_PK_VTAB) || ((*RbuObjIter)(unsafe.Pointer(pIter)).FeType == RBU_PK_NONE)))) {
+ if (*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK &&
+ libc.Bool32((*Sqlite3rbu)(unsafe.Pointer(p)).FzTarget == uintptr(0)) == 0 &&
+ bRbuRowid != libc.Bool32((*RbuObjIter)(unsafe.Pointer(pIter)).FeType == RBU_PK_VTAB || (*RbuObjIter)(unsafe.Pointer(pIter)).FeType == RBU_PK_NONE) {
(*Sqlite3rbu)(unsafe.Pointer(p)).Frc = SQLITE_ERROR
(*Sqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls,
- ts+26898 /* "table %q %s rbu_..." */, libc.VaList(bp+16, (*RbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl,
+ ts+28233 /* "table %q %s rbu_..." */, libc.VaList(bp+16, (*RbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl,
func() uintptr {
if bRbuRowid != 0 {
- return ts + 26927 /* "may not have" */
+ return ts + 28262 /* "may not have" */
}
- return ts + 26940 /* "requires" */
+ return ts + 28275 /* "requires" */
}()))
}
@@ -161286,10 +163535,10 @@ func rbuObjIterCacheTableInfo(tls *libc.TLS, p uintptr, pIter uintptr) int32 { /
// present in the input table. Populate the abTblPk[], azTblType[] and
// aiTblOrder[] arrays at the same time.
if (*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK {
- (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = prepareFreeAndCollectError(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp+60 /* &pStmt */, (p + 36 /* &.zErrmsg */),
- Xsqlite3_mprintf(tls, ts+26949 /* "PRAGMA table_inf..." */, libc.VaList(bp+32, (*RbuObjIter)(unsafe.Pointer(pIter)).FzTbl)))
+ (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = prepareFreeAndCollectError(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp+60 /* &pStmt */, p+36,
+ Xsqlite3_mprintf(tls, ts+28284 /* "PRAGMA table_inf..." */, libc.VaList(bp+32, (*RbuObjIter)(unsafe.Pointer(pIter)).FzTbl)))
}
- for ((*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK) && (SQLITE_ROW == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp + 60 /* pStmt */)))) {
+ for (*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && SQLITE_ROW == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp + 60))) {
var zName uintptr = Xsqlite3_column_text(tls, *(*uintptr)(unsafe.Pointer(bp + 60 /* pStmt */)), 1)
if zName == uintptr(0) {
break
@@ -161301,7 +163550,7 @@ func rbuObjIterCacheTableInfo(tls *libc.TLS, p uintptr, pIter uintptr) int32 { /
}
if i == (*RbuObjIter)(unsafe.Pointer(pIter)).FnTblCol {
(*Sqlite3rbu)(unsafe.Pointer(p)).Frc = SQLITE_ERROR
- (*Sqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, ts+26971, /* "column missing f..." */
+ (*Sqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, ts+28306, /* "column missing f..." */
libc.VaList(bp+40, (*RbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, zName))
} else {
var iPk int32 = Xsqlite3_column_int(tls, *(*uintptr)(unsafe.Pointer(bp + 60 /* pStmt */)), 5)
@@ -161323,10 +163572,10 @@ func rbuObjIterCacheTableInfo(tls *libc.TLS, p uintptr, pIter uintptr) int32 { /
}
- *(*uintptr)(unsafe.Pointer((*RbuObjIter)(unsafe.Pointer(pIter)).FazTblType + uintptr(iOrder)*4)) = rbuStrndup(tls, zType, (p + 32 /* &.rc */))
+ *(*uintptr)(unsafe.Pointer((*RbuObjIter)(unsafe.Pointer(pIter)).FazTblType + uintptr(iOrder)*4)) = rbuStrndup(tls, zType, p+32)
*(*U8)(unsafe.Pointer((*RbuObjIter)(unsafe.Pointer(pIter)).FabTblPk + uintptr(iOrder))) = U8(iPk)
- *(*U8)(unsafe.Pointer((*RbuObjIter)(unsafe.Pointer(pIter)).FabNotNull + uintptr(iOrder))) = (U8(libc.Bool32((U8(bNotNull) != 0) || (iPk != 0))))
+ *(*U8)(unsafe.Pointer((*RbuObjIter)(unsafe.Pointer(pIter)).FabNotNull + uintptr(iOrder))) = U8(libc.Bool32(U8(bNotNull) != 0 || iPk != 0))
iOrder++
}
}
@@ -161342,17 +163591,17 @@ func rbuObjIterCacheTableInfo(tls *libc.TLS, p uintptr, pIter uintptr) int32 { /
// This function constructs and returns a pointer to a nul-terminated
// string containing some SQL clause or list based on one or more of the
// column names currently stored in the pIter->azTblCol[] array.
-func rbuObjIterGetCollist(tls *libc.TLS, p uintptr, pIter uintptr) uintptr { /* sqlite3.c:201495:13: */
+func rbuObjIterGetCollist(tls *libc.TLS, p uintptr, pIter uintptr) uintptr { /* sqlite3.c:203175:13: */
bp := tls.Alloc(24)
defer tls.Free(24)
var zList uintptr = uintptr(0)
- var zSep uintptr = ts + 755 /* "" */
+ var zSep uintptr = ts + 1543 /* "" */
var i int32
for i = 0; i < (*RbuObjIter)(unsafe.Pointer(pIter)).FnTblCol; i++ {
var z uintptr = *(*uintptr)(unsafe.Pointer((*RbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(i)*4))
- zList = rbuMPrintf(tls, p, ts+26998 /* "%z%s\"%w\"" */, libc.VaList(bp, zList, zSep, z))
- zSep = ts + 13324 /* ", " */
+ zList = rbuMPrintf(tls, p, ts+28333 /* "%z%s\"%w\"" */, libc.VaList(bp, zList, zSep, z))
+ zSep = ts + 14507 /* ", " */
}
return zList
}
@@ -161361,19 +163610,19 @@ func rbuObjIterGetCollist(tls *libc.TLS, p uintptr, pIter uintptr) uintptr { /*
// in order, for the current table. Before each column name, add the text
// zPre. After each column name, add the zPost text. Use zSeparator as
// the separator text (usually ", ").
-func rbuObjIterGetPkList(tls *libc.TLS, p uintptr, pIter uintptr, zPre uintptr, zSeparator uintptr, zPost uintptr) uintptr { /* sqlite3.c:201516:13: */
+func rbuObjIterGetPkList(tls *libc.TLS, p uintptr, pIter uintptr, zPre uintptr, zSeparator uintptr, zPost uintptr) uintptr { /* sqlite3.c:203196:13: */
bp := tls.Alloc(40)
defer tls.Free(40)
var iPk int32 = 1
var zRet uintptr = uintptr(0)
- var zSep uintptr = ts + 755 /* "" */
+ var zSep uintptr = ts + 1543 /* "" */
for 1 != 0 {
var i int32
for i = 0; i < (*RbuObjIter)(unsafe.Pointer(pIter)).FnTblCol; i++ {
if int32(*(*U8)(unsafe.Pointer((*RbuObjIter)(unsafe.Pointer(pIter)).FabTblPk + uintptr(i)))) == iPk {
var zCol uintptr = *(*uintptr)(unsafe.Pointer((*RbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(i)*4))
- zRet = rbuMPrintf(tls, p, ts+27007 /* "%z%s%s\"%w\"%s" */, libc.VaList(bp, zRet, zSep, zPre, zCol, zPost))
+ zRet = rbuMPrintf(tls, p, ts+28342 /* "%z%s%s\"%w\"%s" */, libc.VaList(bp, zRet, zSep, zPre, zCol, zPost))
zSep = zSeparator
break
}
@@ -161403,34 +163652,34 @@ func rbuObjIterGetPkList(tls *libc.TLS, p uintptr, pIter uintptr, zPre uintptr,
//
// Instead of "?" placeholders, the actual WHERE clauses created by
// this function contain literal SQL values.
-func rbuVacuumTableStart(tls *libc.TLS, p uintptr, pIter uintptr, bRowid int32, zWrite uintptr) uintptr { /* sqlite3.c:201561:13: */
+func rbuVacuumTableStart(tls *libc.TLS, p uintptr, pIter uintptr, bRowid int32, zWrite uintptr) uintptr { /* sqlite3.c:203241:13: */
bp := tls.Alloc(76)
defer tls.Free(76)
*(*uintptr)(unsafe.Pointer(bp + 72 /* pMax */)) = uintptr(0)
var zRet uintptr = uintptr(0)
if bRowid != 0 {
- (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = prepareFreeAndCollectError(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp+72 /* &pMax */, (p + 36 /* &.zErrmsg */),
+ (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = prepareFreeAndCollectError(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp+72 /* &pMax */, p+36,
Xsqlite3_mprintf(tls,
- ts+27020 /* "SELECT max(_rowi..." */, libc.VaList(bp, zWrite, (*RbuObjIter)(unsafe.Pointer(pIter)).FzTbl)))
- if ((*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK) && (SQLITE_ROW == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp + 72 /* pMax */)))) {
+ ts+28355 /* "SELECT max(_rowi..." */, libc.VaList(bp, zWrite, (*RbuObjIter)(unsafe.Pointer(pIter)).FzTbl)))
+ if (*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && SQLITE_ROW == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp + 72))) {
var iMax Sqlite3_int64 = Xsqlite3_column_int64(tls, *(*uintptr)(unsafe.Pointer(bp + 72 /* pMax */)), 0)
- zRet = rbuMPrintf(tls, p, ts+27052 /* " WHERE _rowid_ >..." */, libc.VaList(bp+16, iMax))
+ zRet = rbuMPrintf(tls, p, ts+28387 /* " WHERE _rowid_ >..." */, libc.VaList(bp+16, iMax))
}
rbuFinalize(tls, p, *(*uintptr)(unsafe.Pointer(bp + 72 /* pMax */)))
} else {
- var zOrder uintptr = rbuObjIterGetPkList(tls, p, pIter, ts+755 /* "" */, ts+13324 /* ", " */, ts+27075 /* " DESC" */)
- var zSelect uintptr = rbuObjIterGetPkList(tls, p, pIter, ts+27081 /* "quote(" */, ts+27088 /* "||','||" */, ts+4066 /* ")" */)
- var zList uintptr = rbuObjIterGetPkList(tls, p, pIter, ts+755 /* "" */, ts+13324 /* ", " */, ts+755 /* "" */)
+ var zOrder uintptr = rbuObjIterGetPkList(tls, p, pIter, ts+1543 /* "" */, ts+14507 /* ", " */, ts+28410 /* " DESC" */)
+ var zSelect uintptr = rbuObjIterGetPkList(tls, p, pIter, ts+28416 /* "quote(" */, ts+28423 /* "||','||" */, ts+4877 /* ")" */)
+ var zList uintptr = rbuObjIterGetPkList(tls, p, pIter, ts+1543 /* "" */, ts+14507 /* ", " */, ts+1543 /* "" */)
if (*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK {
- (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = prepareFreeAndCollectError(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp+72 /* &pMax */, (p + 36 /* &.zErrmsg */),
+ (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = prepareFreeAndCollectError(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp+72 /* &pMax */, p+36,
Xsqlite3_mprintf(tls,
- ts+27096, /* "SELECT %s FROM \"..." */
+ ts+28431, /* "SELECT %s FROM \"..." */
libc.VaList(bp+24, zSelect, zWrite, (*RbuObjIter)(unsafe.Pointer(pIter)).FzTbl, zOrder)))
- if ((*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK) && (SQLITE_ROW == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp + 72 /* pMax */)))) {
+ if (*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && SQLITE_ROW == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp + 72))) {
var zVal uintptr = Xsqlite3_column_text(tls, *(*uintptr)(unsafe.Pointer(bp + 72 /* pMax */)), 0)
- zRet = rbuMPrintf(tls, p, ts+27138 /* " WHERE (%s) > (%..." */, libc.VaList(bp+56, zList, zVal))
+ zRet = rbuMPrintf(tls, p, ts+28473 /* " WHERE (%s) > (%..." */, libc.VaList(bp+56, zList, zVal))
}
rbuFinalize(tls, p, *(*uintptr)(unsafe.Pointer(bp + 72 /* pMax */)))
}
@@ -161462,7 +163711,7 @@ func rbuVacuumTableStart(tls *libc.TLS, p uintptr, pIter uintptr, bRowid int32,
// If the expression cannot be created, NULL is returned. In this case,
// the caller has to use an OFFSET clause to extract only the required
// rows from the sourct table, just as it does for an RBU update operation.
-func XrbuVacuumIndexStart(tls *libc.TLS, p uintptr, pIter uintptr) uintptr { /* sqlite3.c:201628:6: */
+func XrbuVacuumIndexStart(tls *libc.TLS, p uintptr, pIter uintptr) uintptr { /* sqlite3.c:203308:6: */
bp := tls.Alloc(184)
defer tls.Free(184)
@@ -161488,19 +163737,19 @@ func XrbuVacuumIndexStart(tls *libc.TLS, p uintptr, pIter uintptr) uintptr { /*
zVector = uintptr(0)
zRet = uintptr(0)
bFailed = 0
- zSep = ts + 755 /* "" */
+ zSep = ts + 1543 /* "" */
iCol = 0
*(*uintptr)(unsafe.Pointer(bp + 176 /* pXInfo */)) = uintptr(0)
- (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = prepareFreeAndCollectError(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp+176 /* &pXInfo */, (p + 36 /* &.zErrmsg */),
- Xsqlite3_mprintf(tls, ts+26835 /* "PRAGMA main.inde..." */, libc.VaList(bp, (*RbuObjIter)(unsafe.Pointer(pIter)).FzIdx)))
+ (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = prepareFreeAndCollectError(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp+176 /* &pXInfo */, p+36,
+ Xsqlite3_mprintf(tls, ts+28170 /* "PRAGMA main.inde..." */, libc.VaList(bp, (*RbuObjIter)(unsafe.Pointer(pIter)).FzIdx)))
__1:
- if !(((*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK) && (SQLITE_ROW == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp + 176 /* pXInfo */))))) {
+ if !((*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && SQLITE_ROW == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp + 176)))) {
goto __2
}
iCid = Xsqlite3_column_int(tls, *(*uintptr)(unsafe.Pointer(bp + 176 /* pXInfo */)), 1)
zCollate = Xsqlite3_column_text(tls, *(*uintptr)(unsafe.Pointer(bp + 176 /* pXInfo */)), 4)
- if !(Xsqlite3_column_int(tls, *(*uintptr)(unsafe.Pointer(bp + 176 /* pXInfo */)), 3) != 0) {
+ if !(Xsqlite3_column_int(tls, *(*uintptr)(unsafe.Pointer(bp + 176)), 3) != 0) {
goto __3
}
bFailed = 1
@@ -161530,7 +163779,7 @@ __10:
zCol = *(*uintptr)(unsafe.Pointer((*RbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(i)*4))
goto __7
__6:
- zCol = ts + 27158 /* "_rowid_" */
+ zCol = ts + 28493 /* "_rowid_" */
__7:
;
goto __5
@@ -161539,13 +163788,13 @@ __4:
__5:
;
- zLhs = rbuMPrintf(tls, p, ts+27166, /* "%z%s \"%w\" COLLAT..." */
+ zLhs = rbuMPrintf(tls, p, ts+28501, /* "%z%s \"%w\" COLLAT..." */
libc.VaList(bp+8, zLhs, zSep, zCol, zCollate))
- zOrder = rbuMPrintf(tls, p, ts+27187, /* "%z%s \"rbu_imp_%d..." */
+ zOrder = rbuMPrintf(tls, p, ts+28522, /* "%z%s \"rbu_imp_%d..." */
libc.VaList(bp+40, zOrder, zSep, iCol, zCol, zCollate))
- zSelect = rbuMPrintf(tls, p, ts+27223, /* "%z%s quote(\"rbu_..." */
+ zSelect = rbuMPrintf(tls, p, ts+28558, /* "%z%s quote(\"rbu_..." */
libc.VaList(bp+80, zSelect, zSep, iCol, zCol))
- zSep = ts + 13324 /* ", " */
+ zSep = ts + 14507 /* ", " */
iCol++
goto __1
__2:
@@ -161563,13 +163812,13 @@ __11:
}
*(*uintptr)(unsafe.Pointer(bp + 180 /* pSel */)) = uintptr(0)
- (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = prepareFreeAndCollectError(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp+180 /* &pSel */, (p + 36 /* &.zErrmsg */),
- Xsqlite3_mprintf(tls, ts+27250, /* "SELECT %s FROM \"..." */
+ (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = prepareFreeAndCollectError(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp+180 /* &pSel */, p+36,
+ Xsqlite3_mprintf(tls, ts+28585, /* "SELECT %s FROM \"..." */
libc.VaList(bp+112, zSelect, (*RbuObjIter)(unsafe.Pointer(pIter)).FzTbl, zOrder)))
- if !(((*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK) && (SQLITE_ROW == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp + 180 /* pSel */))))) {
+ if !((*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && SQLITE_ROW == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp + 180)))) {
goto __13
}
- zSep = ts + 755 /* "" */
+ zSep = ts + 1543 /* "" */
iCol = 0
__14:
if !(iCol < (*RbuObjIter)(unsafe.Pointer(pIter)).FnCol) {
@@ -161591,8 +163840,8 @@ __19:
;
__18:
;
- zVector = rbuMPrintf(tls, p, ts+27298 /* "%z%s%s" */, libc.VaList(bp+136, zVector, zSep, zQuoted))
- zSep = ts + 13324 /* ", " */
+ zVector = rbuMPrintf(tls, p, ts+28633 /* "%z%s%s" */, libc.VaList(bp+136, zVector, zSep, zQuoted))
+ zSep = ts + 14507 /* ", " */
goto __15
__15:
iCol++
@@ -161601,10 +163850,10 @@ __15:
__16:
;
- if !(!(bFailed != 0)) {
+ if !!(bFailed != 0) {
goto __20
}
- zRet = rbuMPrintf(tls, p, ts+27305 /* "(%s) > (%s)" */, libc.VaList(bp+160, zLhs, zVector))
+ zRet = rbuMPrintf(tls, p, ts+28640 /* "(%s) > (%s)" */, libc.VaList(bp+160, zLhs, zVector))
__20:
;
__13:
@@ -161643,7 +163892,7 @@ index_start_out:
// pzImposterCols: ...
// pzImposterPk: ...
// pzWhere: ...
-func rbuObjIterGetIndexCols(tls *libc.TLS, p uintptr, pIter uintptr, pzImposterCols uintptr, pzImposterPk uintptr, pzWhere uintptr, pnBind uintptr) uintptr { /* sqlite3.c:201743:13: */
+func rbuObjIterGetIndexCols(tls *libc.TLS, p uintptr, pIter uintptr, pzImposterCols uintptr, pzImposterPk uintptr, pzWhere uintptr, pnBind uintptr) uintptr { /* sqlite3.c:203423:13: */
bp := tls.Alloc(204)
defer tls.Free(204)
@@ -161654,17 +163903,17 @@ func rbuObjIterGetIndexCols(tls *libc.TLS, p uintptr, pIter uintptr, pzImposterC
var zImpPK uintptr = uintptr(0) // String to return via *pzImposterPK
var zWhere uintptr = uintptr(0) // String to return via *pzWhere
var nBind int32 = 0 // Value to return via *pnBind
- var zCom uintptr = ts + 755 /* "" */ // Set to ", " later on
- var zAnd uintptr = ts + 755 /* "" */ // Set to " AND " later on
+ var zCom uintptr = ts + 1543 /* "" */ // Set to ", " later on
+ var zAnd uintptr = ts + 1543 /* "" */ // Set to " AND " later on
*(*uintptr)(unsafe.Pointer(bp + 200 /* pXInfo */)) = uintptr(0) // PRAGMA index_xinfo = ?
if rc == SQLITE_OK {
- rc = prepareFreeAndCollectError(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp+200 /* &pXInfo */, (p + 36 /* &.zErrmsg */),
- Xsqlite3_mprintf(tls, ts+26835 /* "PRAGMA main.inde..." */, libc.VaList(bp, (*RbuObjIter)(unsafe.Pointer(pIter)).FzIdx)))
+ rc = prepareFreeAndCollectError(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp+200 /* &pXInfo */, p+36,
+ Xsqlite3_mprintf(tls, ts+28170 /* "PRAGMA main.inde..." */, libc.VaList(bp, (*RbuObjIter)(unsafe.Pointer(pIter)).FzIdx)))
}
- for (rc == SQLITE_OK) && (SQLITE_ROW == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp + 200 /* pXInfo */)))) {
+ for rc == SQLITE_OK && SQLITE_ROW == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp + 200))) {
var iCid int32 = Xsqlite3_column_int(tls, *(*uintptr)(unsafe.Pointer(bp + 200 /* pXInfo */)), 1)
var bDesc int32 = Xsqlite3_column_int(tls, *(*uintptr)(unsafe.Pointer(bp + 200 /* pXInfo */)), 3)
var zCollate uintptr = Xsqlite3_column_text(tls, *(*uintptr)(unsafe.Pointer(bp + 200 /* pXInfo */)), 4)
@@ -161673,9 +163922,9 @@ func rbuObjIterGetIndexCols(tls *libc.TLS, p uintptr, pIter uintptr, pzImposterC
if iCid == -2 {
var iSeq int32 = Xsqlite3_column_int(tls, *(*uintptr)(unsafe.Pointer(bp + 200 /* pXInfo */)), 0)
- zRet = Xsqlite3_mprintf(tls, ts+27317 /* "%z%s(%.*s) COLLA..." */, libc.VaList(bp+8, zRet, zCom,
+ zRet = Xsqlite3_mprintf(tls, ts+28652 /* "%z%s(%.*s) COLLA..." */, libc.VaList(bp+8, zRet, zCom,
(*RbuSpan)(unsafe.Pointer((*RbuObjIter)(unsafe.Pointer(pIter)).FaIdxCol+uintptr(iSeq)*8)).FnSpan, (*RbuSpan)(unsafe.Pointer((*RbuObjIter)(unsafe.Pointer(pIter)).FaIdxCol+uintptr(iSeq)*8)).FzSpan, zCollate))
- zType = ts + 755 /* "" */
+ zType = ts + 1543 /* "" */
} else {
if iCid < 0 {
// An integer primary key. If the table has an explicit IPK, use
@@ -161686,38 +163935,38 @@ func rbuObjIterGetIndexCols(tls *libc.TLS, p uintptr, pIter uintptr, pzImposterC
}
zCol = *(*uintptr)(unsafe.Pointer((*RbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(i)*4))
- } else if (*Sqlite3rbu)(unsafe.Pointer((p))).FzTarget == uintptr(0) {
- zCol = ts + 27158 /* "_rowid_" */
+ } else if (*Sqlite3rbu)(unsafe.Pointer(p)).FzTarget == uintptr(0) {
+ zCol = ts + 28493 /* "_rowid_" */
} else {
- zCol = ts + 26888 /* "rbu_rowid" */
+ zCol = ts + 28223 /* "rbu_rowid" */
}
- zType = ts + 11384 /* "INTEGER" */
+ zType = ts + 1090 /* "INTEGER" */
} else {
zCol = *(*uintptr)(unsafe.Pointer((*RbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(iCid)*4))
zType = *(*uintptr)(unsafe.Pointer((*RbuObjIter)(unsafe.Pointer(pIter)).FazTblType + uintptr(iCid)*4))
}
- zRet = Xsqlite3_mprintf(tls, ts+27339 /* "%z%s\"%w\" COLLATE..." */, libc.VaList(bp+48, zRet, zCom, zCol, zCollate))
+ zRet = Xsqlite3_mprintf(tls, ts+28674 /* "%z%s\"%w\" COLLATE..." */, libc.VaList(bp+48, zRet, zCom, zCol, zCollate))
}
- if ((*RbuObjIter)(unsafe.Pointer(pIter)).FbUnique == 0) || (Xsqlite3_column_int(tls, *(*uintptr)(unsafe.Pointer(bp + 200 /* pXInfo */)), 5) != 0) {
+ if (*RbuObjIter)(unsafe.Pointer(pIter)).FbUnique == 0 || Xsqlite3_column_int(tls, *(*uintptr)(unsafe.Pointer(bp + 200)), 5) != 0 {
var zOrder uintptr = func() uintptr {
if bDesc != 0 {
- return ts + 27075 /* " DESC" */
+ return ts + 28410
}
- return ts + 755 /* "" */
+ return ts + 1543
}()
- zImpPK = Xsqlite3_mprintf(tls, ts+27359, /* "%z%s\"rbu_imp_%d%..." */
+ zImpPK = Xsqlite3_mprintf(tls, ts+28694, /* "%z%s\"rbu_imp_%d%..." */
libc.VaList(bp+80, zImpPK, zCom, nBind, zCol, zOrder))
}
- zImpCols = Xsqlite3_mprintf(tls, ts+27380, /* "%z%s\"rbu_imp_%d%..." */
+ zImpCols = Xsqlite3_mprintf(tls, ts+28715, /* "%z%s\"rbu_imp_%d%..." */
libc.VaList(bp+120, zImpCols, zCom, nBind, zCol, zType, zCollate))
zWhere = Xsqlite3_mprintf(tls,
- ts+27413 /* "%z%s\"rbu_imp_%d%..." */, libc.VaList(bp+168, zWhere, zAnd, nBind, zCol))
- if (((zRet == uintptr(0)) || (zImpPK == uintptr(0))) || (zImpCols == uintptr(0))) || (zWhere == uintptr(0)) {
+ ts+28748 /* "%z%s\"rbu_imp_%d%..." */, libc.VaList(bp+168, zWhere, zAnd, nBind, zCol))
+ if zRet == uintptr(0) || zImpPK == uintptr(0) || zImpCols == uintptr(0) || zWhere == uintptr(0) {
rc = SQLITE_NOMEM
}
- zCom = ts + 13324 /* ", " */
- zAnd = ts + 19877 /* " AND " */
+ zCom = ts + 14507 /* ", " */
+ zAnd = ts + 21174 /* " AND " */
nBind++
}
@@ -161754,22 +164003,22 @@ func rbuObjIterGetIndexCols(tls *libc.TLS, p uintptr, pIter uintptr, pzImposterC
//
// For tables with implicit rowids - RBU_PK_EXTERNAL and RBU_PK_NONE, append
// the text ", old._rowid_" to the returned value.
-func rbuObjIterGetOldlist(tls *libc.TLS, p uintptr, pIter uintptr, zObj uintptr) uintptr { /* sqlite3.c:201855:13: */
+func rbuObjIterGetOldlist(tls *libc.TLS, p uintptr, pIter uintptr, zObj uintptr) uintptr { /* sqlite3.c:203535:13: */
bp := tls.Alloc(64)
defer tls.Free(64)
var zList uintptr = uintptr(0)
- if ((*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK) && ((*RbuObjIter)(unsafe.Pointer(pIter)).FabIndexed != 0) {
- var zS uintptr = ts + 755 /* "" */
+ if (*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && (*RbuObjIter)(unsafe.Pointer(pIter)).FabIndexed != 0 {
+ var zS uintptr = ts + 1543 /* "" */
var i int32
for i = 0; i < (*RbuObjIter)(unsafe.Pointer(pIter)).FnTblCol; i++ {
if *(*U8)(unsafe.Pointer((*RbuObjIter)(unsafe.Pointer(pIter)).FabIndexed + uintptr(i))) != 0 {
var zCol uintptr = *(*uintptr)(unsafe.Pointer((*RbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(i)*4))
- zList = Xsqlite3_mprintf(tls, ts+27437 /* "%z%s%s.\"%w\"" */, libc.VaList(bp, zList, zS, zObj, zCol))
+ zList = Xsqlite3_mprintf(tls, ts+28772 /* "%z%s%s.\"%w\"" */, libc.VaList(bp, zList, zS, zObj, zCol))
} else {
- zList = Xsqlite3_mprintf(tls, ts+27449 /* "%z%sNULL" */, libc.VaList(bp+32, zList, zS))
+ zList = Xsqlite3_mprintf(tls, ts+28784 /* "%z%sNULL" */, libc.VaList(bp+32, zList, zS))
}
- zS = ts + 13324 /* ", " */
+ zS = ts + 14507 /* ", " */
if zList == uintptr(0) {
(*Sqlite3rbu)(unsafe.Pointer(p)).Frc = SQLITE_NOMEM
break
@@ -161777,8 +164026,8 @@ func rbuObjIterGetOldlist(tls *libc.TLS, p uintptr, pIter uintptr, zObj uintptr)
}
// For a table with implicit rowids, append "old._rowid_" to the list.
- if ((*RbuObjIter)(unsafe.Pointer(pIter)).FeType == RBU_PK_EXTERNAL) || ((*RbuObjIter)(unsafe.Pointer(pIter)).FeType == RBU_PK_NONE) {
- zList = rbuMPrintf(tls, p, ts+27458 /* "%z, %s._rowid_" */, libc.VaList(bp+48, zList, zObj))
+ if (*RbuObjIter)(unsafe.Pointer(pIter)).FeType == RBU_PK_EXTERNAL || (*RbuObjIter)(unsafe.Pointer(pIter)).FeType == RBU_PK_NONE {
+ zList = rbuMPrintf(tls, p, ts+28793 /* "%z, %s._rowid_" */, libc.VaList(bp+48, zList, zObj))
}
}
return zList
@@ -161792,33 +164041,33 @@ func rbuObjIterGetOldlist(tls *libc.TLS, p uintptr, pIter uintptr, zObj uintptr)
// Return the string:
//
// "b = ?1 AND c = ?2"
-func rbuObjIterGetWhere(tls *libc.TLS, p uintptr, pIter uintptr) uintptr { /* sqlite3.c:201896:13: */
+func rbuObjIterGetWhere(tls *libc.TLS, p uintptr, pIter uintptr) uintptr { /* sqlite3.c:203576:13: */
bp := tls.Alloc(80)
defer tls.Free(80)
var zList uintptr = uintptr(0)
- if ((*RbuObjIter)(unsafe.Pointer(pIter)).FeType == RBU_PK_VTAB) || ((*RbuObjIter)(unsafe.Pointer(pIter)).FeType == RBU_PK_NONE) {
- zList = rbuMPrintf(tls, p, ts+27473 /* "_rowid_ = ?%d" */, libc.VaList(bp, ((*RbuObjIter)(unsafe.Pointer(pIter)).FnTblCol+1)))
+ if (*RbuObjIter)(unsafe.Pointer(pIter)).FeType == RBU_PK_VTAB || (*RbuObjIter)(unsafe.Pointer(pIter)).FeType == RBU_PK_NONE {
+ zList = rbuMPrintf(tls, p, ts+28808 /* "_rowid_ = ?%d" */, libc.VaList(bp, (*RbuObjIter)(unsafe.Pointer(pIter)).FnTblCol+1))
} else if (*RbuObjIter)(unsafe.Pointer(pIter)).FeType == RBU_PK_EXTERNAL {
- var zSep uintptr = ts + 755 /* "" */
+ var zSep uintptr = ts + 1543 /* "" */
var i int32
for i = 0; i < (*RbuObjIter)(unsafe.Pointer(pIter)).FnTblCol; i++ {
if *(*U8)(unsafe.Pointer((*RbuObjIter)(unsafe.Pointer(pIter)).FabTblPk + uintptr(i))) != 0 {
- zList = rbuMPrintf(tls, p, ts+27487 /* "%z%sc%d=?%d" */, libc.VaList(bp+8, zList, zSep, i, (i+1)))
- zSep = ts + 19877 /* " AND " */
+ zList = rbuMPrintf(tls, p, ts+28822 /* "%z%sc%d=?%d" */, libc.VaList(bp+8, zList, zSep, i, i+1))
+ zSep = ts + 21174 /* " AND " */
}
}
zList = rbuMPrintf(tls, p,
- ts+27499 /* "_rowid_ = (SELEC..." */, libc.VaList(bp+40, zList))
+ ts+28834 /* "_rowid_ = (SELEC..." */, libc.VaList(bp+40, zList))
} else {
- var zSep uintptr = ts + 755 /* "" */
+ var zSep uintptr = ts + 1543 /* "" */
var i int32
for i = 0; i < (*RbuObjIter)(unsafe.Pointer(pIter)).FnTblCol; i++ {
if *(*U8)(unsafe.Pointer((*RbuObjIter)(unsafe.Pointer(pIter)).FabTblPk + uintptr(i))) != 0 {
var zCol uintptr = *(*uintptr)(unsafe.Pointer((*RbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(i)*4))
- zList = rbuMPrintf(tls, p, ts+27549 /* "%z%s\"%w\"=?%d" */, libc.VaList(bp+48, zList, zSep, zCol, (i+1)))
- zSep = ts + 19877 /* " AND " */
+ zList = rbuMPrintf(tls, p, ts+28884 /* "%z%s\"%w\"=?%d" */, libc.VaList(bp+48, zList, zSep, zCol, i+1))
+ zSep = ts + 21174 /* " AND " */
}
}
}
@@ -161830,9 +164079,9 @@ func rbuObjIterGetWhere(tls *libc.TLS, p uintptr, pIter uintptr) uintptr { /* sq
// is something wrong with the rbu_control value in the rbu_control value
// stored in the (p->nCol+1)'th column. Set the error code and error message
// of the RBU handle to something reflecting this.
-func rbuBadControlError(tls *libc.TLS, p uintptr) { /* sqlite3.c:201937:13: */
+func rbuBadControlError(tls *libc.TLS, p uintptr) { /* sqlite3.c:203617:13: */
(*Sqlite3rbu)(unsafe.Pointer(p)).Frc = SQLITE_ERROR
- (*Sqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, ts+27562 /* "invalid rbu_cont..." */, 0)
+ (*Sqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, ts+28897 /* "invalid rbu_cont..." */, 0)
}
// Return a nul-terminated string containing the comma separated list of
@@ -161850,7 +164099,7 @@ func rbuBadControlError(tls *libc.TLS, p uintptr) { /* sqlite3.c:201937:13: */
// argument and NULL is returned. Or, if an error has already occurred
// when this function is called, NULL is returned immediately, without
// attempting the allocation or modifying the stored error code.
-func rbuObjIterGetSetlist(tls *libc.TLS, p uintptr, pIter uintptr, zMask uintptr) uintptr { /* sqlite3.c:201960:13: */
+func rbuObjIterGetSetlist(tls *libc.TLS, p uintptr, pIter uintptr, zMask uintptr) uintptr { /* sqlite3.c:203640:13: */
bp := tls.Alloc(112)
defer tls.Free(112)
@@ -161861,21 +164110,21 @@ func rbuObjIterGetSetlist(tls *libc.TLS, p uintptr, pIter uintptr, zMask uintptr
if int32(libc.Xstrlen(tls, zMask)) != (*RbuObjIter)(unsafe.Pointer(pIter)).FnTblCol {
rbuBadControlError(tls, p)
} else {
- var zSep uintptr = ts + 755 /* "" */
+ var zSep uintptr = ts + 1543 /* "" */
for i = 0; i < (*RbuObjIter)(unsafe.Pointer(pIter)).FnTblCol; i++ {
var c uint8 = *(*uint8)(unsafe.Pointer(zMask + uintptr(*(*int32)(unsafe.Pointer((*RbuObjIter)(unsafe.Pointer(pIter)).FaiSrcOrder + uintptr(i)*4)))))
if int32(c) == 'x' {
- zList = rbuMPrintf(tls, p, ts+27549, /* "%z%s\"%w\"=?%d" */
- libc.VaList(bp, zList, zSep, *(*uintptr)(unsafe.Pointer((*RbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(i)*4)), (i+1)))
- zSep = ts + 13324 /* ", " */
+ zList = rbuMPrintf(tls, p, ts+28884, /* "%z%s\"%w\"=?%d" */
+ libc.VaList(bp, zList, zSep, *(*uintptr)(unsafe.Pointer((*RbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(i)*4)), i+1))
+ zSep = ts + 14507 /* ", " */
} else if int32(c) == 'd' {
- zList = rbuMPrintf(tls, p, ts+27588, /* "%z%s\"%w\"=rbu_del..." */
- libc.VaList(bp+32, zList, zSep, *(*uintptr)(unsafe.Pointer((*RbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(i)*4)), *(*uintptr)(unsafe.Pointer((*RbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(i)*4)), (i+1)))
- zSep = ts + 13324 /* ", " */
+ zList = rbuMPrintf(tls, p, ts+28923, /* "%z%s\"%w\"=rbu_del..." */
+ libc.VaList(bp+32, zList, zSep, *(*uintptr)(unsafe.Pointer((*RbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(i)*4)), *(*uintptr)(unsafe.Pointer((*RbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(i)*4)), i+1))
+ zSep = ts + 14507 /* ", " */
} else if int32(c) == 'f' {
- zList = rbuMPrintf(tls, p, ts+27618, /* "%z%s\"%w\"=rbu_fos..." */
- libc.VaList(bp+72, zList, zSep, *(*uintptr)(unsafe.Pointer((*RbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(i)*4)), *(*uintptr)(unsafe.Pointer((*RbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(i)*4)), (i+1)))
- zSep = ts + 13324 /* ", " */
+ zList = rbuMPrintf(tls, p, ts+28953, /* "%z%s\"%w\"=rbu_fos..." */
+ libc.VaList(bp+72, zList, zSep, *(*uintptr)(unsafe.Pointer((*RbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(i)*4)), *(*uintptr)(unsafe.Pointer((*RbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(i)*4)), i+1))
+ zSep = ts + 14507 /* ", " */
}
}
}
@@ -161896,17 +164145,17 @@ func rbuObjIterGetSetlist(tls *libc.TLS, p uintptr, pIter uintptr, zMask uintptr
// argument and NULL is returned. Or, if an error has already occurred
// when this function is called, NULL is returned immediately, without
// attempting the allocation or modifying the stored error code.
-func rbuObjIterGetBindlist(tls *libc.TLS, p uintptr, nBind int32) uintptr { /* sqlite3.c:202014:13: */
+func rbuObjIterGetBindlist(tls *libc.TLS, p uintptr, nBind int32) uintptr { /* sqlite3.c:203694:13: */
var zRet uintptr = uintptr(0)
- var nByte Sqlite3_int64 = ((int64(2) * Sqlite3_int64(nBind)) + int64(1))
+ var nByte Sqlite3_int64 = int64(2)*Sqlite3_int64(nBind) + int64(1)
zRet = rbuMalloc(tls, p, nByte)
if zRet != 0 {
var i int32
for i = 0; i < nBind; i++ {
- *(*uint8)(unsafe.Pointer(zRet + uintptr((i * 2)))) = uint8('?')
- *(*uint8)(unsafe.Pointer(zRet + uintptr(((i * 2) + 1)))) = func() uint8 {
- if (i + 1) == nBind {
+ *(*uint8)(unsafe.Pointer(zRet + uintptr(i*2))) = uint8('?')
+ *(*uint8)(unsafe.Pointer(zRet + uintptr(i*2+1))) = func() uint8 {
+ if i+1 == nBind {
return uint8(0)
}
return uint8(',')
@@ -161926,47 +164175,47 @@ func rbuObjIterGetBindlist(tls *libc.TLS, p uintptr, nBind int32) uintptr { /* s
// this function returns:
//
// PRIMARY KEY("b", "a" DESC)
-func rbuWithoutRowidPK(tls *libc.TLS, p uintptr, pIter uintptr) uintptr { /* sqlite3.c:202041:13: */
+func rbuWithoutRowidPK(tls *libc.TLS, p uintptr, pIter uintptr) uintptr { /* sqlite3.c:203721:13: */
bp := tls.Alloc(64)
defer tls.Free(64)
var z uintptr = uintptr(0)
if (*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK {
- var zSep uintptr = ts + 27655 /* "PRIMARY KEY(" */
+ var zSep uintptr = ts + 28990 /* "PRIMARY KEY(" */
*(*uintptr)(unsafe.Pointer(bp + 56 /* pXList */)) = uintptr(0) // PRAGMA index_list = (pIter->zTbl)
*(*uintptr)(unsafe.Pointer(bp + 60 /* pXInfo */)) = uintptr(0) // PRAGMA index_xinfo = <pk-index>
- (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = prepareFreeAndCollectError(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp+56 /* &pXList */, (p + 36 /* &.zErrmsg */),
- Xsqlite3_mprintf(tls, ts+26807 /* "PRAGMA main.inde..." */, libc.VaList(bp, (*RbuObjIter)(unsafe.Pointer(pIter)).FzTbl)))
- for ((*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK) && (SQLITE_ROW == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp + 56 /* pXList */)))) {
+ (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = prepareFreeAndCollectError(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp+56 /* &pXList */, p+36,
+ Xsqlite3_mprintf(tls, ts+28142 /* "PRAGMA main.inde..." */, libc.VaList(bp, (*RbuObjIter)(unsafe.Pointer(pIter)).FzTbl)))
+ for (*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && SQLITE_ROW == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp + 56))) {
var zOrig uintptr = Xsqlite3_column_text(tls, *(*uintptr)(unsafe.Pointer(bp + 56 /* pXList */)), 3)
- if (zOrig != 0) && (libc.Xstrcmp(tls, zOrig, ts+14667 /* "pk" */) == 0) {
+ if zOrig != 0 && libc.Xstrcmp(tls, zOrig, ts+15849) == 0 {
var zIdx uintptr = Xsqlite3_column_text(tls, *(*uintptr)(unsafe.Pointer(bp + 56 /* pXList */)), 1)
if zIdx != 0 {
- (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = prepareFreeAndCollectError(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp+60 /* &pXInfo */, (p + 36 /* &.zErrmsg */),
- Xsqlite3_mprintf(tls, ts+26835 /* "PRAGMA main.inde..." */, libc.VaList(bp+8, zIdx)))
+ (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = prepareFreeAndCollectError(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp+60 /* &pXInfo */, p+36,
+ Xsqlite3_mprintf(tls, ts+28170 /* "PRAGMA main.inde..." */, libc.VaList(bp+8, zIdx)))
}
break
}
}
rbuFinalize(tls, p, *(*uintptr)(unsafe.Pointer(bp + 56 /* pXList */)))
- for ((*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK) && (SQLITE_ROW == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp + 60 /* pXInfo */)))) {
- if Xsqlite3_column_int(tls, *(*uintptr)(unsafe.Pointer(bp + 60 /* pXInfo */)), 5) != 0 {
+ for (*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && SQLITE_ROW == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp + 60))) {
+ if Xsqlite3_column_int(tls, *(*uintptr)(unsafe.Pointer(bp + 60)), 5) != 0 {
// int iCid = sqlite3_column_int(pXInfo, 0);
var zCol uintptr = Xsqlite3_column_text(tls, *(*uintptr)(unsafe.Pointer(bp + 60 /* pXInfo */)), 2)
var zDesc uintptr
- if Xsqlite3_column_int(tls, *(*uintptr)(unsafe.Pointer(bp + 60 /* pXInfo */)), 3) != 0 {
- zDesc = ts + 27075 /* " DESC" */
+ if Xsqlite3_column_int(tls, *(*uintptr)(unsafe.Pointer(bp + 60)), 3) != 0 {
+ zDesc = ts + 28410 /* " DESC" */
} else {
- zDesc = ts + 755 /* "" */
+ zDesc = ts + 1543 /* "" */
}
- z = rbuMPrintf(tls, p, ts+27668 /* "%z%s\"%w\"%s" */, libc.VaList(bp+16, z, zSep, zCol, zDesc))
- zSep = ts + 13324 /* ", " */
+ z = rbuMPrintf(tls, p, ts+29003 /* "%z%s\"%w\"%s" */, libc.VaList(bp+16, z, zSep, zCol, zDesc))
+ zSep = ts + 14507 /* ", " */
}
}
- z = rbuMPrintf(tls, p, ts+27679 /* "%z)" */, libc.VaList(bp+48, z))
+ z = rbuMPrintf(tls, p, ts+29014 /* "%z)" */, libc.VaList(bp+48, z))
rbuFinalize(tls, p, *(*uintptr)(unsafe.Pointer(bp + 60 /* pXInfo */)))
}
return z
@@ -161989,61 +164238,61 @@ func rbuWithoutRowidPK(tls *libc.TLS, p uintptr, pIter uintptr) uintptr { /* sql
//
// CREATE TABLE rbu_imposter2(c1 TEXT, c2 REAL, id INTEGER) WITHOUT ROWID;
//
-func rbuCreateImposterTable2(tls *libc.TLS, p uintptr, pIter uintptr) { /* sqlite3.c:202100:13: */
+func rbuCreateImposterTable2(tls *libc.TLS, p uintptr, pIter uintptr) { /* sqlite3.c:203780:13: */
bp := tls.Alloc(176)
defer tls.Free(176)
- if ((*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK) && ((*RbuObjIter)(unsafe.Pointer(pIter)).FeType == RBU_PK_EXTERNAL) {
+ if (*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && (*RbuObjIter)(unsafe.Pointer(pIter)).FeType == RBU_PK_EXTERNAL {
var tnum int32 = (*RbuObjIter)(unsafe.Pointer(pIter)).FiPkTnum // Root page of PK index
*(*uintptr)(unsafe.Pointer(bp + 168 /* pQuery */)) = uintptr(0) // SELECT name ... WHERE rootpage = $tnum
var zIdx uintptr = uintptr(0) // Name of PK index
*(*uintptr)(unsafe.Pointer(bp + 172 /* pXInfo */)) = uintptr(0) // PRAGMA main.index_xinfo = $zIdx
- var zComma uintptr = ts + 755 /* "" */
+ var zComma uintptr = ts + 1543 /* "" */
var zCols uintptr = uintptr(0) // Used to build up list of table cols
var zPk uintptr = 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.
- (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = prepareAndCollectError(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp+168 /* &pQuery */, (p + 36 /* &.zErrmsg */),
- ts+27683 /* "SELECT name FROM..." */)
+ (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = prepareAndCollectError(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp+168 /* &pQuery */, p+36,
+ ts+29018 /* "SELECT name FROM..." */)
if (*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK {
Xsqlite3_bind_int(tls, *(*uintptr)(unsafe.Pointer(bp + 168 /* pQuery */)), 1, tnum)
- if SQLITE_ROW == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp + 168 /* pQuery */))) {
+ if SQLITE_ROW == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp + 168))) {
zIdx = Xsqlite3_column_text(tls, *(*uintptr)(unsafe.Pointer(bp + 168 /* pQuery */)), 0)
}
}
if zIdx != 0 {
- (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = prepareFreeAndCollectError(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp+172 /* &pXInfo */, (p + 36 /* &.zErrmsg */),
- Xsqlite3_mprintf(tls, ts+26835 /* "PRAGMA main.inde..." */, libc.VaList(bp, zIdx)))
+ (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = prepareFreeAndCollectError(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp+172 /* &pXInfo */, p+36,
+ Xsqlite3_mprintf(tls, ts+28170 /* "PRAGMA main.inde..." */, libc.VaList(bp, zIdx)))
}
rbuFinalize(tls, p, *(*uintptr)(unsafe.Pointer(bp + 168 /* pQuery */)))
- for ((*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK) && (SQLITE_ROW == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp + 172 /* pXInfo */)))) {
+ for (*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && SQLITE_ROW == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp + 172))) {
var bKey int32 = Xsqlite3_column_int(tls, *(*uintptr)(unsafe.Pointer(bp + 172 /* pXInfo */)), 5)
if bKey != 0 {
var iCid int32 = Xsqlite3_column_int(tls, *(*uintptr)(unsafe.Pointer(bp + 172 /* pXInfo */)), 1)
var bDesc int32 = Xsqlite3_column_int(tls, *(*uintptr)(unsafe.Pointer(bp + 172 /* pXInfo */)), 3)
var zCollate uintptr = Xsqlite3_column_text(tls, *(*uintptr)(unsafe.Pointer(bp + 172 /* pXInfo */)), 4)
- zCols = rbuMPrintf(tls, p, ts+27733 /* "%z%sc%d %s COLLA..." */, libc.VaList(bp+8, zCols, zComma,
+ zCols = rbuMPrintf(tls, p, ts+29068 /* "%z%sc%d %s COLLA..." */, libc.VaList(bp+8, zCols, zComma,
iCid, *(*uintptr)(unsafe.Pointer((*RbuObjIter)(unsafe.Pointer(pIter)).FazTblType + uintptr(iCid)*4)), zCollate))
- zPk = rbuMPrintf(tls, p, ts+27755 /* "%z%sc%d%s" */, libc.VaList(bp+48, zPk, zComma, iCid, func() uintptr {
+ zPk = rbuMPrintf(tls, p, ts+29090 /* "%z%sc%d%s" */, libc.VaList(bp+48, zPk, zComma, iCid, func() uintptr {
if bDesc != 0 {
- return ts + 27075 /* " DESC" */
+ return ts + 28410 /* " DESC" */
}
- return ts + 755 /* "" */
+ return ts + 1543 /* "" */
}()))
- zComma = ts + 13324 /* ", " */
+ zComma = ts + 14507 /* ", " */
}
}
- zCols = rbuMPrintf(tls, p, ts+27765 /* "%z, id INTEGER" */, libc.VaList(bp+80, zCols))
+ zCols = rbuMPrintf(tls, p, ts+29100 /* "%z, id INTEGER" */, libc.VaList(bp+80, zCols))
rbuFinalize(tls, p, *(*uintptr)(unsafe.Pointer(bp + 172 /* pXInfo */)))
- Xsqlite3_test_control(tls, SQLITE_TESTCTRL_IMPOSTER, libc.VaList(bp+88, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain, ts+5458 /* "main" */, 1, tnum))
+ Xsqlite3_test_control(tls, SQLITE_TESTCTRL_IMPOSTER, libc.VaList(bp+88, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain, ts+6305 /* "main" */, 1, tnum))
rbuMPrintfExec(tls, p, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain,
- ts+27780, /* "CREATE TABLE rbu..." */
+ ts+29115, /* "CREATE TABLE rbu..." */
libc.VaList(bp+120, zCols, zPk))
- Xsqlite3_test_control(tls, SQLITE_TESTCTRL_IMPOSTER, libc.VaList(bp+136, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain, ts+5458 /* "main" */, 0, 0))
+ Xsqlite3_test_control(tls, SQLITE_TESTCTRL_IMPOSTER, libc.VaList(bp+136, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain, ts+6305 /* "main" */, 0, 0))
}
}
@@ -162065,58 +164314,58 @@ func rbuCreateImposterTable2(tls *libc.TLS, p uintptr, pIter uintptr) { /* sqlit
// More precisely, the "same schema" means the same columns, types,
// collation sequences. For tables that do not have an external PRIMARY
// KEY, it also means the same PRIMARY KEY declaration.
-func rbuCreateImposterTable(tls *libc.TLS, p uintptr, pIter uintptr) { /* sqlite3.c:202174:13: */
+func rbuCreateImposterTable(tls *libc.TLS, p uintptr, pIter uintptr) { /* sqlite3.c:203854:13: */
bp := tls.Alloc(196)
defer tls.Free(196)
- if ((*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK) && ((*RbuObjIter)(unsafe.Pointer(pIter)).FeType != RBU_PK_VTAB) {
+ if (*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && (*RbuObjIter)(unsafe.Pointer(pIter)).FeType != RBU_PK_VTAB {
var tnum int32 = (*RbuObjIter)(unsafe.Pointer(pIter)).FiTnum
- var zComma uintptr = ts + 755 /* "" */
+ var zComma uintptr = ts + 1543 /* "" */
var zSql uintptr = uintptr(0)
var iCol int32
- Xsqlite3_test_control(tls, SQLITE_TESTCTRL_IMPOSTER, libc.VaList(bp, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain, ts+5458 /* "main" */, 0, 1))
+ Xsqlite3_test_control(tls, SQLITE_TESTCTRL_IMPOSTER, libc.VaList(bp, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain, ts+6305 /* "main" */, 0, 1))
- for iCol = 0; ((*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK) && (iCol < (*RbuObjIter)(unsafe.Pointer(pIter)).FnTblCol); iCol++ {
- var zPk uintptr = ts + 755 /* "" */
+ for iCol = 0; (*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && iCol < (*RbuObjIter)(unsafe.Pointer(pIter)).FnTblCol; iCol++ {
+ var zPk uintptr = ts + 1543 /* "" */
var zCol uintptr = *(*uintptr)(unsafe.Pointer((*RbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(iCol)*4))
*(*uintptr)(unsafe.Pointer(bp + 192 /* zColl */)) = uintptr(0)
(*Sqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_table_column_metadata(tls,
- (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain, ts+5458 /* "main" */, (*RbuObjIter)(unsafe.Pointer(pIter)).FzTbl, zCol, uintptr(0), bp+192 /* &zColl */, uintptr(0), uintptr(0), uintptr(0))
+ (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain, ts+6305 /* "main" */, (*RbuObjIter)(unsafe.Pointer(pIter)).FzTbl, zCol, uintptr(0), bp+192 /* &zColl */, uintptr(0), uintptr(0), uintptr(0))
- if ((*RbuObjIter)(unsafe.Pointer(pIter)).FeType == RBU_PK_IPK) && (*(*U8)(unsafe.Pointer((*RbuObjIter)(unsafe.Pointer(pIter)).FabTblPk + uintptr(iCol))) != 0) {
+ if (*RbuObjIter)(unsafe.Pointer(pIter)).FeType == RBU_PK_IPK && *(*U8)(unsafe.Pointer((*RbuObjIter)(unsafe.Pointer(pIter)).FabTblPk + uintptr(iCol))) != 0 {
// If the target table column is an "INTEGER PRIMARY KEY", add
// "PRIMARY KEY" to the imposter table column declaration.
- zPk = ts + 27842 /* "PRIMARY KEY " */
+ zPk = ts + 29177 /* "PRIMARY KEY " */
}
- zSql = rbuMPrintf(tls, p, ts+27855, /* "%z%s\"%w\" %s %sCO..." */
+ zSql = rbuMPrintf(tls, p, ts+29190, /* "%z%s\"%w\" %s %sCO..." */
libc.VaList(bp+32, zSql, zComma, zCol, *(*uintptr)(unsafe.Pointer((*RbuObjIter)(unsafe.Pointer(pIter)).FazTblType + uintptr(iCol)*4)), zPk, *(*uintptr)(unsafe.Pointer(bp + 192 /* zColl */)),
func() uintptr {
if *(*U8)(unsafe.Pointer((*RbuObjIter)(unsafe.Pointer(pIter)).FabNotNull + uintptr(iCol))) != 0 {
- return ts + 27882 /* " NOT NULL" */
+ return ts + 29217 /* " NOT NULL" */
}
- return ts + 755 /* "" */
+ return ts + 1543 /* "" */
}()))
- zComma = ts + 13324 /* ", " */
+ zComma = ts + 14507 /* ", " */
}
if (*RbuObjIter)(unsafe.Pointer(pIter)).FeType == RBU_PK_WITHOUT_ROWID {
var zPk uintptr = rbuWithoutRowidPK(tls, p, pIter)
if zPk != 0 {
- zSql = rbuMPrintf(tls, p, ts+27892 /* "%z, %z" */, libc.VaList(bp+88, zSql, zPk))
+ zSql = rbuMPrintf(tls, p, ts+29227 /* "%z, %z" */, libc.VaList(bp+88, zSql, zPk))
}
}
- Xsqlite3_test_control(tls, SQLITE_TESTCTRL_IMPOSTER, libc.VaList(bp+104, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain, ts+5458 /* "main" */, 1, tnum))
- rbuMPrintfExec(tls, p, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain, ts+27899, /* "CREATE TABLE \"rb..." */
+ Xsqlite3_test_control(tls, SQLITE_TESTCTRL_IMPOSTER, libc.VaList(bp+104, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain, ts+6305 /* "main" */, 1, tnum))
+ rbuMPrintfExec(tls, p, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain, ts+29234, /* "CREATE TABLE \"rb..." */
libc.VaList(bp+136, (*RbuObjIter)(unsafe.Pointer(pIter)).FzTbl, zSql,
func() uintptr {
if (*RbuObjIter)(unsafe.Pointer(pIter)).FeType == RBU_PK_WITHOUT_ROWID {
- return ts + 27931 /* " WITHOUT ROWID" */
+ return ts + 29266 /* " WITHOUT ROWID" */
}
- return ts + 755 /* "" */
+ return ts + 1543 /* "" */
}()))
- Xsqlite3_test_control(tls, SQLITE_TESTCTRL_IMPOSTER, libc.VaList(bp+160, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain, ts+5458 /* "main" */, 0, 0))
+ Xsqlite3_test_control(tls, SQLITE_TESTCTRL_IMPOSTER, libc.VaList(bp+160, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain, ts+6305 /* "main" */, 0, 0))
}
}
@@ -162129,32 +164378,32 @@ func rbuCreateImposterTable(tls *libc.TLS, p uintptr, pIter uintptr) { /* sqlite
// the target table, plus one (for the rbu_control column), plus one more
// (for the rbu_rowid column) if the target table is an implicit IPK or
// virtual table.
-func rbuObjIterPrepareTmpInsert(tls *libc.TLS, p uintptr, pIter uintptr, zCollist uintptr, zRbuRowid uintptr) { /* sqlite3.c:202230:13: */
+func rbuObjIterPrepareTmpInsert(tls *libc.TLS, p uintptr, pIter uintptr, zCollist uintptr, zRbuRowid uintptr) { /* sqlite3.c:203910:13: */
bp := tls.Alloc(40)
defer tls.Free(40)
- var bRbuRowid int32 = (libc.Bool32(((*RbuObjIter)(unsafe.Pointer(pIter)).FeType == RBU_PK_EXTERNAL) || ((*RbuObjIter)(unsafe.Pointer(pIter)).FeType == RBU_PK_NONE)))
- var zBind uintptr = rbuObjIterGetBindlist(tls, p, (((*RbuObjIter)(unsafe.Pointer(pIter)).FnTblCol + 1) + bRbuRowid))
+ var bRbuRowid int32 = libc.Bool32((*RbuObjIter)(unsafe.Pointer(pIter)).FeType == RBU_PK_EXTERNAL || (*RbuObjIter)(unsafe.Pointer(pIter)).FeType == RBU_PK_NONE)
+ var zBind uintptr = rbuObjIterGetBindlist(tls, p, (*RbuObjIter)(unsafe.Pointer(pIter)).FnTblCol+1+bRbuRowid)
if zBind != 0 {
(*Sqlite3rbu)(unsafe.Pointer(p)).Frc = prepareFreeAndCollectError(tls,
- (*Sqlite3rbu)(unsafe.Pointer(p)).FdbRbu, (pIter + 88 /* &.pTmpInsert */), (p + 36 /* &.zErrmsg */), Xsqlite3_mprintf(tls,
- ts+27946, /* "INSERT INTO %s.'..." */
- libc.VaList(bp, p+24 /* &.zStateDb */, (*RbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, zCollist, zRbuRowid, zBind)))
+ (*Sqlite3rbu)(unsafe.Pointer(p)).FdbRbu, pIter+88, p+36, Xsqlite3_mprintf(tls,
+ ts+29281, /* "INSERT INTO %s.'..." */
+ libc.VaList(bp, p+24, (*RbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, zCollist, zRbuRowid, zBind)))
}
}
-func rbuTmpInsertFunc(tls *libc.TLS, pCtx uintptr, nVal int32, apVal uintptr) { /* sqlite3.c:202248:13: */
+func rbuTmpInsertFunc(tls *libc.TLS, pCtx uintptr, nVal int32, apVal uintptr) { /* sqlite3.c:203928:13: */
var p uintptr = Xsqlite3_user_data(tls, pCtx)
var rc int32 = SQLITE_OK
var i int32
if Xsqlite3_value_int(tls, *(*uintptr)(unsafe.Pointer(apVal))) != 0 {
- *(*I64)(unsafe.Pointer(p + 176 /* &.nPhaseOneStep */)) += (I64((*Sqlite3rbu)(unsafe.Pointer(p)).Fobjiter.FnIndex))
+ *(*I64)(unsafe.Pointer(p + 176)) += I64((*Sqlite3rbu)(unsafe.Pointer(p)).Fobjiter.FnIndex)
}
- for i = 0; (rc == SQLITE_OK) && (i < nVal); i++ {
- rc = Xsqlite3_bind_value(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).Fobjiter.FpTmpInsert, (i + 1), *(*uintptr)(unsafe.Pointer(apVal + uintptr(i)*4)))
+ for i = 0; rc == SQLITE_OK && i < nVal; i++ {
+ rc = Xsqlite3_bind_value(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).Fobjiter.FpTmpInsert, i+1, *(*uintptr)(unsafe.Pointer(apVal + uintptr(i)*4)))
}
if rc == SQLITE_OK {
Xsqlite3_step(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).Fobjiter.FpTmpInsert)
@@ -162166,7 +164415,7 @@ func rbuTmpInsertFunc(tls *libc.TLS, pCtx uintptr, nVal int32, apVal uintptr) {
}
}
-func rbuObjIterGetIndexWhere(tls *libc.TLS, p uintptr, pIter uintptr) uintptr { /* sqlite3.c:202278:13: */
+func rbuObjIterGetIndexWhere(tls *libc.TLS, p uintptr, pIter uintptr) uintptr { /* sqlite3.c:203958:13: */
bp := tls.Alloc(8)
defer tls.Free(8)
@@ -162174,14 +164423,14 @@ func rbuObjIterGetIndexWhere(tls *libc.TLS, p uintptr, pIter uintptr) uintptr {
*(*int32)(unsafe.Pointer(bp + 4 /* rc */)) = (*Sqlite3rbu)(unsafe.Pointer(p)).Frc
var zRet uintptr = uintptr(0)
- if *(*int32)(unsafe.Pointer(bp + 4 /* rc */)) == SQLITE_OK {
- *(*int32)(unsafe.Pointer(bp + 4 /* rc */)) = prepareAndCollectError(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp /* &pStmt */, (p + 36 /* &.zErrmsg */),
- ts+28003 /* "SELECT trim(sql)..." */)
+ if *(*int32)(unsafe.Pointer(bp + 4)) == SQLITE_OK {
+ *(*int32)(unsafe.Pointer(bp + 4 /* rc */)) = prepareAndCollectError(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp /* &pStmt */, p+36,
+ ts+29338 /* "SELECT trim(sql)..." */)
}
- if *(*int32)(unsafe.Pointer(bp + 4 /* rc */)) == SQLITE_OK {
+ if *(*int32)(unsafe.Pointer(bp + 4)) == SQLITE_OK {
var rc2 int32
*(*int32)(unsafe.Pointer(bp + 4 /* rc */)) = Xsqlite3_bind_text(tls, *(*uintptr)(unsafe.Pointer(bp /* pStmt */)), 1, (*RbuObjIter)(unsafe.Pointer(pIter)).FzIdx, -1, uintptr(0))
- if (*(*int32)(unsafe.Pointer(bp + 4 /* rc */)) == SQLITE_OK) && (SQLITE_ROW == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp /* pStmt */)))) {
+ if *(*int32)(unsafe.Pointer(bp + 4)) == SQLITE_OK && SQLITE_ROW == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp))) {
var zSql uintptr = Xsqlite3_column_text(tls, *(*uintptr)(unsafe.Pointer(bp /* pStmt */)), 0)
if zSql != 0 {
(*RbuObjIter)(unsafe.Pointer(pIter)).FzIdxSql = libc.AssignUintptr(&zSql, rbuStrndup(tls, zSql, bp+4 /* &rc */))
@@ -162197,37 +164446,37 @@ func rbuObjIterGetIndexWhere(tls *libc.TLS, p uintptr, pIter uintptr) uintptr {
// If necessary, grow the pIter->aIdxCol[] array
if iIdxCol == nIdxAlloc {
var aIdxCol uintptr = Xsqlite3_realloc(tls,
- (*RbuObjIter)(unsafe.Pointer(pIter)).FaIdxCol, (int32((uint32(nIdxAlloc + 16)) * uint32(unsafe.Sizeof(RbuSpan{})))))
+ (*RbuObjIter)(unsafe.Pointer(pIter)).FaIdxCol, int32(uint32(nIdxAlloc+16)*uint32(unsafe.Sizeof(RbuSpan{}))))
if aIdxCol == uintptr(0) {
*(*int32)(unsafe.Pointer(bp + 4 /* rc */)) = SQLITE_NOMEM
break
}
(*RbuObjIter)(unsafe.Pointer(pIter)).FaIdxCol = aIdxCol
- nIdxAlloc = nIdxAlloc + (16)
+ nIdxAlloc = nIdxAlloc + 16
}
if int32(c) == '(' {
if nParen == 0 {
- (*RbuSpan)(unsafe.Pointer((*RbuObjIter)(unsafe.Pointer(pIter)).FaIdxCol)).FzSpan = (zSql + uintptr((i + 1)))
+ (*RbuSpan)(unsafe.Pointer((*RbuObjIter)(unsafe.Pointer(pIter)).FaIdxCol)).FzSpan = zSql + uintptr(i+1)
}
nParen++
} else if int32(c) == ')' {
nParen--
if nParen == 0 {
- var nSpan int32 = ((int32((zSql + uintptr(i))) - int32((*RbuSpan)(unsafe.Pointer((*RbuObjIter)(unsafe.Pointer(pIter)).FaIdxCol+uintptr(iIdxCol)*8)).FzSpan)) / 1)
+ var nSpan int32 = (int32(zSql+uintptr(i)) - int32((*RbuSpan)(unsafe.Pointer((*RbuObjIter)(unsafe.Pointer(pIter)).FaIdxCol+uintptr(iIdxCol)*8)).FzSpan)) / 1
(*RbuSpan)(unsafe.Pointer((*RbuObjIter)(unsafe.Pointer(pIter)).FaIdxCol + uintptr(libc.PostIncInt32(&iIdxCol, 1))*8)).FnSpan = nSpan
i++
break
}
- } else if (int32(c) == ',') && (nParen == 1) {
- var nSpan int32 = ((int32((zSql + uintptr(i))) - int32((*RbuSpan)(unsafe.Pointer((*RbuObjIter)(unsafe.Pointer(pIter)).FaIdxCol+uintptr(iIdxCol)*8)).FzSpan)) / 1)
+ } else if int32(c) == ',' && nParen == 1 {
+ var nSpan int32 = (int32(zSql+uintptr(i)) - int32((*RbuSpan)(unsafe.Pointer((*RbuObjIter)(unsafe.Pointer(pIter)).FaIdxCol+uintptr(iIdxCol)*8)).FzSpan)) / 1
(*RbuSpan)(unsafe.Pointer((*RbuObjIter)(unsafe.Pointer(pIter)).FaIdxCol + uintptr(libc.PostIncInt32(&iIdxCol, 1))*8)).FnSpan = nSpan
- (*RbuSpan)(unsafe.Pointer((*RbuObjIter)(unsafe.Pointer(pIter)).FaIdxCol + uintptr(iIdxCol)*8)).FzSpan = (zSql + uintptr((i + 1)))
- } else if ((int32(c) == '"') || (int32(c) == '\'')) || (int32(c) == '`') {
+ (*RbuSpan)(unsafe.Pointer((*RbuObjIter)(unsafe.Pointer(pIter)).FaIdxCol + uintptr(iIdxCol)*8)).FzSpan = zSql + uintptr(i+1)
+ } else if int32(c) == '"' || int32(c) == '\'' || int32(c) == '`' {
for i++; 1 != 0; i++ {
if int32(*(*uint8)(unsafe.Pointer(zSql + uintptr(i)))) == int32(c) {
- if int32(*(*uint8)(unsafe.Pointer(zSql + uintptr((i + 1))))) != int32(c) {
+ if int32(*(*uint8)(unsafe.Pointer(zSql + uintptr(i+1)))) != int32(c) {
break
}
i++
@@ -162239,14 +164488,14 @@ func rbuObjIterGetIndexWhere(tls *libc.TLS, p uintptr, pIter uintptr) uintptr {
break
}
}
- } else if (int32(c) == '-') && (int32(*(*uint8)(unsafe.Pointer(zSql + uintptr((i + 1))))) == '-') {
- for i = (i + 2); (*(*uint8)(unsafe.Pointer(zSql + uintptr(i))) != 0) && (int32(*(*uint8)(unsafe.Pointer(zSql + uintptr(i)))) != '\n'); i++ {
+ } else if int32(c) == '-' && int32(*(*uint8)(unsafe.Pointer(zSql + uintptr(i+1)))) == '-' {
+ for i = i + 2; *(*uint8)(unsafe.Pointer(zSql + uintptr(i))) != 0 && int32(*(*uint8)(unsafe.Pointer(zSql + uintptr(i)))) != '\n'; i++ {
}
if int32(*(*uint8)(unsafe.Pointer(zSql + uintptr(i)))) == 0 {
break
}
- } else if (int32(c) == '/') && (int32(*(*uint8)(unsafe.Pointer(zSql + uintptr((i + 1))))) == '*') {
- for i = (i + 2); (*(*uint8)(unsafe.Pointer(zSql + uintptr(i))) != 0) && ((int32(*(*uint8)(unsafe.Pointer(zSql + uintptr(i)))) != '*') || (int32(*(*uint8)(unsafe.Pointer(zSql + uintptr((i + 1))))) != '/')); i++ {
+ } else if int32(c) == '/' && int32(*(*uint8)(unsafe.Pointer(zSql + uintptr(i+1)))) == '*' {
+ for i = i + 2; *(*uint8)(unsafe.Pointer(zSql + uintptr(i))) != 0 && (int32(*(*uint8)(unsafe.Pointer(zSql + uintptr(i)))) != '*' || int32(*(*uint8)(unsafe.Pointer(zSql + uintptr(i+1)))) != '/'); i++ {
}
if int32(*(*uint8)(unsafe.Pointer(zSql + uintptr(i)))) == 0 {
break
@@ -162255,14 +164504,14 @@ func rbuObjIterGetIndexWhere(tls *libc.TLS, p uintptr, pIter uintptr) uintptr {
}
}
if *(*uint8)(unsafe.Pointer(zSql + uintptr(i))) != 0 {
- zRet = rbuStrndup(tls, (zSql + uintptr(i)), bp+4 /* &rc */)
+ zRet = rbuStrndup(tls, zSql+uintptr(i), bp+4 /* &rc */)
}
(*RbuObjIter)(unsafe.Pointer(pIter)).FnIdxCol = iIdxCol
}
}
rc2 = Xsqlite3_finalize(tls, *(*uintptr)(unsafe.Pointer(bp /* pStmt */)))
- if *(*int32)(unsafe.Pointer(bp + 4 /* rc */)) == SQLITE_OK {
+ if *(*int32)(unsafe.Pointer(bp + 4)) == SQLITE_OK {
*(*int32)(unsafe.Pointer(bp + 4 /* rc */)) = rc2
}
}
@@ -162274,19 +164523,19 @@ func rbuObjIterGetIndexWhere(tls *libc.TLS, p uintptr, pIter uintptr) uintptr {
// Ensure that the SQLite statement handles required to update the
// target database object currently indicated by the iterator passed
// as the second argument are available.
-func rbuObjIterPrepareAll(tls *libc.TLS, p uintptr, pIter uintptr, nOffset int32) int32 { /* sqlite3.c:202378:12: */
+func rbuObjIterPrepareAll(tls *libc.TLS, p uintptr, pIter uintptr, nOffset int32) int32 { /* sqlite3.c:204058:12: */
bp := tls.Alloc(616)
defer tls.Free(616)
- if ((*RbuObjIter)(unsafe.Pointer(pIter)).FpSelect == uintptr(0)) && (rbuObjIterCacheTableInfo(tls, p, pIter) == SQLITE_OK) {
+ if (*RbuObjIter)(unsafe.Pointer(pIter)).FpSelect == uintptr(0) && rbuObjIterCacheTableInfo(tls, p, pIter) == SQLITE_OK {
var tnum int32 = (*RbuObjIter)(unsafe.Pointer(pIter)).FiTnum
var zCollist uintptr = uintptr(0) // List of indexed columns
- var pz uintptr = (p + 36 /* &.zErrmsg */)
+ var pz uintptr = p + 36
var zIdx uintptr = (*RbuObjIter)(unsafe.Pointer(pIter)).FzIdx
var zLimit uintptr = uintptr(0)
if nOffset != 0 {
- zLimit = Xsqlite3_mprintf(tls, ts+28069 /* " LIMIT -1 OFFSET..." */, libc.VaList(bp, nOffset))
+ zLimit = Xsqlite3_mprintf(tls, ts+29404 /* " LIMIT -1 OFFSET..." */, libc.VaList(bp, nOffset))
if !(zLimit != 0) {
(*Sqlite3rbu)(unsafe.Pointer(p)).Frc = SQLITE_NOMEM
}
@@ -162307,32 +164556,32 @@ func rbuObjIterPrepareAll(tls *libc.TLS, p uintptr, pIter uintptr, nOffset int32
zBind = rbuObjIterGetBindlist(tls, p, *(*int32)(unsafe.Pointer(bp + 612 /* nBind */)))
// Create the imposter table used to write to this index.
- Xsqlite3_test_control(tls, SQLITE_TESTCTRL_IMPOSTER, libc.VaList(bp+8, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain, ts+5458 /* "main" */, 0, 1))
- Xsqlite3_test_control(tls, SQLITE_TESTCTRL_IMPOSTER, libc.VaList(bp+40, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain, ts+5458 /* "main" */, 1, tnum))
+ Xsqlite3_test_control(tls, SQLITE_TESTCTRL_IMPOSTER, libc.VaList(bp+8, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain, ts+6305 /* "main" */, 0, 1))
+ Xsqlite3_test_control(tls, SQLITE_TESTCTRL_IMPOSTER, libc.VaList(bp+40, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain, ts+6305 /* "main" */, 1, tnum))
rbuMPrintfExec(tls, p, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain,
- ts+28089, /* "CREATE TABLE \"rb..." */
+ ts+29424, /* "CREATE TABLE \"rb..." */
libc.VaList(bp+72, zTbl, *(*uintptr)(unsafe.Pointer(bp + 600 /* zImposterCols */)), *(*uintptr)(unsafe.Pointer(bp + 604 /* zImposterPK */))))
- Xsqlite3_test_control(tls, SQLITE_TESTCTRL_IMPOSTER, libc.VaList(bp+96, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain, ts+5458 /* "main" */, 0, 0))
+ Xsqlite3_test_control(tls, SQLITE_TESTCTRL_IMPOSTER, libc.VaList(bp+96, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain, ts+6305 /* "main" */, 0, 0))
// Create the statement to insert index entries
(*RbuObjIter)(unsafe.Pointer(pIter)).FnCol = *(*int32)(unsafe.Pointer(bp + 612 /* nBind */))
if (*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK {
(*Sqlite3rbu)(unsafe.Pointer(p)).Frc = prepareFreeAndCollectError(tls,
- (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain, (pIter + 80 /* &.pInsert */), (p + 36 /* &.zErrmsg */),
- Xsqlite3_mprintf(tls, ts+28154 /* "INSERT INTO \"rbu..." */, libc.VaList(bp+128, zTbl, zBind)))
+ (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain, pIter+80, p+36,
+ Xsqlite3_mprintf(tls, ts+29489 /* "INSERT INTO \"rbu..." */, libc.VaList(bp+128, zTbl, zBind)))
}
// And to delete index entries
- if ((libc.Bool32((*Sqlite3rbu)(unsafe.Pointer((p))).FzTarget == uintptr(0))) == 0) && ((*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK) {
+ if libc.Bool32((*Sqlite3rbu)(unsafe.Pointer(p)).FzTarget == uintptr(0)) == 0 && (*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK {
(*Sqlite3rbu)(unsafe.Pointer(p)).Frc = prepareFreeAndCollectError(tls,
- (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain, (pIter + 84 /* &.pDelete */), (p + 36 /* &.zErrmsg */),
- Xsqlite3_mprintf(tls, ts+28190 /* "DELETE FROM \"rbu..." */, libc.VaList(bp+144, zTbl, *(*uintptr)(unsafe.Pointer(bp + 608 /* zWhere */)))))
+ (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain, pIter+84, p+36,
+ Xsqlite3_mprintf(tls, ts+29525 /* "DELETE FROM \"rbu..." */, libc.VaList(bp+144, zTbl, *(*uintptr)(unsafe.Pointer(bp + 608 /* zWhere */)))))
}
// Create the SELECT statement to read keys in sorted order
if (*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK {
var zSql uintptr
- if (*Sqlite3rbu)(unsafe.Pointer((p))).FzTarget == uintptr(0) {
+ if (*Sqlite3rbu)(unsafe.Pointer(p)).FzTarget == uintptr(0) {
var zStart uintptr = uintptr(0)
if nOffset != 0 {
zStart = XrbuVacuumIndexStart(tls, p, pIter)
@@ -162343,7 +164592,7 @@ func rbuObjIterPrepareAll(tls *libc.TLS, p uintptr, pIter uintptr, nOffset int32
}
zSql = Xsqlite3_mprintf(tls,
- ts+28224, /* "SELECT %s, 0 AS ..." */
+ ts+29559, /* "SELECT %s, 0 AS ..." */
libc.VaList(bp+160, zCollist,
(*RbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl,
zPart,
@@ -162351,37 +164600,37 @@ func rbuObjIterPrepareAll(tls *libc.TLS, p uintptr, pIter uintptr, nOffset int32
if zStart != 0 {
return func() uintptr {
if zPart != 0 {
- return ts + 28285 /* "AND" */
+ return ts + 29620 /* "AND" */
}
- return ts + 28289 /* "WHERE" */
+ return ts + 29624 /* "WHERE" */
}()
}
- return ts + 755 /* "" */
+ return ts + 1543 /* "" */
}(), zStart,
zCollist, zLimit))
Xsqlite3_free(tls, zStart)
- } else if ((*RbuObjIter)(unsafe.Pointer(pIter)).FeType == RBU_PK_EXTERNAL) || ((*RbuObjIter)(unsafe.Pointer(pIter)).FeType == RBU_PK_NONE) {
+ } else if (*RbuObjIter)(unsafe.Pointer(pIter)).FeType == RBU_PK_EXTERNAL || (*RbuObjIter)(unsafe.Pointer(pIter)).FeType == RBU_PK_NONE {
zSql = Xsqlite3_mprintf(tls,
- ts+28295, /* "SELECT %s, rbu_c..." */
- libc.VaList(bp+216, zCollist, p+24 /* &.zStateDb */, (*RbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl,
+ ts+29630, /* "SELECT %s, rbu_c..." */
+ libc.VaList(bp+216, zCollist, p+24, (*RbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl,
zPart, zCollist, zLimit))
} else {
zSql = Xsqlite3_mprintf(tls,
- ts+28356, /* "SELECT %s, rbu_c..." */
- libc.VaList(bp+264, zCollist, p+24 /* &.zStateDb */, (*RbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, zPart,
+ ts+29691, /* "SELECT %s, rbu_c..." */
+ libc.VaList(bp+264, zCollist, p+24, (*RbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, zPart,
zCollist, (*RbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl,
zPart,
func() uintptr {
if zPart != 0 {
- return ts + 28285 /* "AND" */
+ return ts + 29620 /* "AND" */
}
- return ts + 28289 /* "WHERE" */
+ return ts + 29624 /* "WHERE" */
}(),
zCollist, zLimit))
}
if (*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK {
- (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = prepareFreeAndCollectError(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbRbu, (pIter + 76 /* &.pSelect */), pz, zSql)
+ (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = prepareFreeAndCollectError(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbRbu, pIter+76, pz, zSql)
} else {
Xsqlite3_free(tls, zSql)
}
@@ -162393,16 +164642,16 @@ func rbuObjIterPrepareAll(tls *libc.TLS, p uintptr, pIter uintptr, nOffset int32
Xsqlite3_free(tls, zBind)
Xsqlite3_free(tls, zPart)
} else {
- var bRbuRowid int32 = (libc.Bool32((((*RbuObjIter)(unsafe.Pointer(pIter)).FeType == RBU_PK_VTAB) ||
- ((*RbuObjIter)(unsafe.Pointer(pIter)).FeType == RBU_PK_NONE)) ||
- (((*RbuObjIter)(unsafe.Pointer(pIter)).FeType == RBU_PK_EXTERNAL) && ((*Sqlite3rbu)(unsafe.Pointer((p))).FzTarget == uintptr(0)))))
+ var bRbuRowid int32 = libc.Bool32((*RbuObjIter)(unsafe.Pointer(pIter)).FeType == RBU_PK_VTAB ||
+ (*RbuObjIter)(unsafe.Pointer(pIter)).FeType == RBU_PK_NONE ||
+ (*RbuObjIter)(unsafe.Pointer(pIter)).FeType == RBU_PK_EXTERNAL && (*Sqlite3rbu)(unsafe.Pointer(p)).FzTarget == uintptr(0))
var zTbl uintptr = (*RbuObjIter)(unsafe.Pointer(pIter)).FzTbl // Table this step applies to
var zWrite uintptr // Imposter table name
- var zBindings uintptr = rbuObjIterGetBindlist(tls, p, ((*RbuObjIter)(unsafe.Pointer(pIter)).FnTblCol + bRbuRowid))
+ var zBindings uintptr = rbuObjIterGetBindlist(tls, p, (*RbuObjIter)(unsafe.Pointer(pIter)).FnTblCol+bRbuRowid)
var zWhere uintptr = rbuObjIterGetWhere(tls, p, pIter)
- var zOldlist uintptr = rbuObjIterGetOldlist(tls, p, pIter, ts+5467 /* "old" */)
- var zNewlist uintptr = rbuObjIterGetOldlist(tls, p, pIter, ts+5463 /* "new" */)
+ var zOldlist uintptr = rbuObjIterGetOldlist(tls, p, pIter, ts+6314 /* "old" */)
+ var zNewlist uintptr = rbuObjIterGetOldlist(tls, p, pIter, ts+6310 /* "new" */)
zCollist = rbuObjIterGetCollist(tls, p, pIter)
(*RbuObjIter)(unsafe.Pointer(pIter)).FnCol = (*RbuObjIter)(unsafe.Pointer(pIter)).FnTblCol
@@ -162412,60 +164661,60 @@ func rbuObjIterPrepareAll(tls *libc.TLS, p uintptr, pIter uintptr, nOffset int32
rbuCreateImposterTable2(tls, p, pIter)
zWrite = func() uintptr {
if (*RbuObjIter)(unsafe.Pointer(pIter)).FeType == RBU_PK_VTAB {
- return ts + 755 /* "" */
+ return ts + 1543
}
- return ts + 28515 /* "rbu_imp_" */
+ return ts + 29850
}()
// Create the INSERT statement to write to the target PK b-tree
if (*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK {
- (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = prepareFreeAndCollectError(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain, (pIter + 80 /* &.pInsert */), pz,
+ (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = prepareFreeAndCollectError(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain, pIter+80, pz,
Xsqlite3_mprintf(tls,
- ts+28524, /* "INSERT INTO \"%s%..." */
+ ts+29859, /* "INSERT INTO \"%s%..." */
libc.VaList(bp+344, zWrite, zTbl, zCollist, func() uintptr {
if bRbuRowid != 0 {
- return ts + 28560 /* ", _rowid_" */
+ return ts + 29895 /* ", _rowid_" */
}
- return ts + 755 /* "" */
+ return ts + 1543 /* "" */
}(), 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.Bool32((*Sqlite3rbu)(unsafe.Pointer((p))).FzTarget == uintptr(0))) == 0) && ((*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK) {
- (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = prepareFreeAndCollectError(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain, (pIter + 84 /* &.pDelete */), pz,
+ if libc.Bool32((*Sqlite3rbu)(unsafe.Pointer(p)).FzTarget == uintptr(0)) == 0 && (*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK {
+ (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = prepareFreeAndCollectError(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain, pIter+84, pz,
Xsqlite3_mprintf(tls,
- ts+28570 /* "DELETE FROM \"%s%..." */, libc.VaList(bp+384, zWrite, zTbl, zWhere)))
+ ts+29905 /* "DELETE FROM \"%s%..." */, libc.VaList(bp+384, zWrite, zTbl, zWhere)))
}
- if ((libc.Bool32((*Sqlite3rbu)(unsafe.Pointer((p))).FzTarget == uintptr(0))) == 0) && ((*RbuObjIter)(unsafe.Pointer(pIter)).FabIndexed != 0) {
- var zRbuRowid uintptr = ts + 755 /* "" */
- if ((*RbuObjIter)(unsafe.Pointer(pIter)).FeType == RBU_PK_EXTERNAL) || ((*RbuObjIter)(unsafe.Pointer(pIter)).FeType == RBU_PK_NONE) {
- zRbuRowid = ts + 28598 /* ", rbu_rowid" */
+ if libc.Bool32((*Sqlite3rbu)(unsafe.Pointer(p)).FzTarget == uintptr(0)) == 0 && (*RbuObjIter)(unsafe.Pointer(pIter)).FabIndexed != 0 {
+ var zRbuRowid uintptr = ts + 1543 /* "" */
+ if (*RbuObjIter)(unsafe.Pointer(pIter)).FeType == RBU_PK_EXTERNAL || (*RbuObjIter)(unsafe.Pointer(pIter)).FeType == RBU_PK_NONE {
+ zRbuRowid = ts + 29933 /* ", rbu_rowid" */
}
// Create the rbu_tmp_xxx table and the triggers to populate it.
rbuMPrintfExec(tls, p, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbRbu,
- ts+28610 /* "CREATE TABLE IF ..." */, libc.VaList(bp+408, p+24 /* &.zStateDb */, (*RbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, func() uintptr {
+ ts+29945 /* "CREATE TABLE IF ..." */, libc.VaList(bp+408, p+24, (*RbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, func() uintptr {
if (*RbuObjIter)(unsafe.Pointer(pIter)).FeType == RBU_PK_EXTERNAL {
- return ts + 28686 /* ", 0 AS rbu_rowid" */
+ return ts + 30021 /* ", 0 AS rbu_rowid" */
}
- return ts + 755 /* "" */
+ return ts + 1543 /* "" */
}(), (*RbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl))
rbuMPrintfExec(tls, p, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain,
- ts+28703, /* "CREATE TEMP TRIG..." */
+ ts+30038, /* "CREATE TEMP TRIG..." */
libc.VaList(bp+440, zWrite, zTbl, zOldlist,
zWrite, zTbl, zOldlist,
zWrite, zTbl, zNewlist))
- if ((*RbuObjIter)(unsafe.Pointer(pIter)).FeType == RBU_PK_EXTERNAL) || ((*RbuObjIter)(unsafe.Pointer(pIter)).FeType == RBU_PK_NONE) {
+ if (*RbuObjIter)(unsafe.Pointer(pIter)).FeType == RBU_PK_EXTERNAL || (*RbuObjIter)(unsafe.Pointer(pIter)).FeType == RBU_PK_NONE {
rbuMPrintfExec(tls, p, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain,
- ts+29002, /* "CREATE TEMP TRIG..." */
+ ts+30337, /* "CREATE TEMP TRIG..." */
libc.VaList(bp+512, zWrite, zTbl, zNewlist))
}
@@ -162474,18 +164723,18 @@ func rbuObjIterPrepareAll(tls *libc.TLS, p uintptr, pIter uintptr, nOffset int32
// Create the SELECT statement to read keys from data_xxx
if (*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK {
- var zRbuRowid uintptr = ts + 755 /* "" */
+ var zRbuRowid uintptr = ts + 1543 /* "" */
var zStart uintptr = uintptr(0)
var zOrder uintptr = uintptr(0)
if bRbuRowid != 0 {
- if (*Sqlite3rbu)(unsafe.Pointer((p))).FzTarget == uintptr(0) {
- zRbuRowid = ts + 29101 /* ",_rowid_ " */
+ if (*Sqlite3rbu)(unsafe.Pointer(p)).FzTarget == uintptr(0) {
+ zRbuRowid = ts + 30436 /* ",_rowid_ " */
} else {
- zRbuRowid = ts + 29111 /* ",rbu_rowid" */
+ zRbuRowid = ts + 30446 /* ",rbu_rowid" */
}
}
- if (*Sqlite3rbu)(unsafe.Pointer((p))).FzTarget == uintptr(0) {
+ if (*Sqlite3rbu)(unsafe.Pointer(p)).FzTarget == uintptr(0) {
if nOffset != 0 {
zStart = rbuVacuumTableStart(tls, p, pIter, bRbuRowid, zWrite)
if zStart != 0 {
@@ -162494,35 +164743,35 @@ func rbuObjIterPrepareAll(tls *libc.TLS, p uintptr, pIter uintptr, nOffset int32
}
}
if bRbuRowid != 0 {
- zOrder = rbuMPrintf(tls, p, ts+27158 /* "_rowid_" */, 0)
+ zOrder = rbuMPrintf(tls, p, ts+28493 /* "_rowid_" */, 0)
} else {
- zOrder = rbuObjIterGetPkList(tls, p, pIter, ts+755 /* "" */, ts+13324 /* ", " */, ts+755 /* "" */)
+ zOrder = rbuObjIterGetPkList(tls, p, pIter, ts+1543 /* "" */, ts+14507 /* ", " */, ts+1543 /* "" */)
}
}
if (*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK {
- (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = prepareFreeAndCollectError(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbRbu, (pIter + 76 /* &.pSelect */), pz,
+ (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = prepareFreeAndCollectError(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbRbu, pIter+76, pz,
Xsqlite3_mprintf(tls,
- ts+29122, /* "SELECT %s,%s rbu..." */
+ ts+30457, /* "SELECT %s,%s rbu..." */
libc.VaList(bp+536, zCollist,
func() uintptr {
- if (*Sqlite3rbu)(unsafe.Pointer((p))).FzTarget == uintptr(0) {
- return ts + 29170 /* "0 AS " */
+ if (*Sqlite3rbu)(unsafe.Pointer(p)).FzTarget == uintptr(0) {
+ return ts + 30505 /* "0 AS " */
}
- return ts + 755 /* "" */
+ return ts + 1543 /* "" */
}(),
zRbuRowid,
(*RbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, func() uintptr {
if zStart != 0 {
return zStart
}
- return ts + 755 /* "" */
+ return ts + 1543
}(),
func() uintptr {
if zOrder != 0 {
- return ts + 18211 /* "ORDER BY" */
+ return ts + 19508 /* "ORDER BY" */
}
- return ts + 755 /* "" */
+ return ts + 1543 /* "" */
}(), zOrder,
zLimit)))
}
@@ -162549,7 +164798,7 @@ func rbuObjIterPrepareAll(tls *libc.TLS, p uintptr, pIter uintptr, nOffset int32
//
// If the zMask string does not specify any columns to update, then this
// is not an error. Output variable *ppStmt is set to NULL in this case.
-func rbuGetUpdateStmt(tls *libc.TLS, p uintptr, pIter uintptr, zMask uintptr, ppStmt uintptr) int32 { /* sqlite3.c:202645:12: */
+func rbuGetUpdateStmt(tls *libc.TLS, p uintptr, pIter uintptr, zMask uintptr, ppStmt uintptr) int32 { /* sqlite3.c:204325:12: */
bp := tls.Alloc(32)
defer tls.Free(32)
@@ -162564,7 +164813,7 @@ func rbuGetUpdateStmt(tls *libc.TLS, p uintptr, pIter uintptr, zMask uintptr, pp
// of the LRU queue and return immediately. Otherwise, leave nUp pointing
// to the number of statements currently in the cache and pUp to the
// last object in the list.
- for pp = (pIter + 104 /* &.pRbuUpdate */); *(*uintptr)(unsafe.Pointer(pp)) != 0; pp = (*(*uintptr)(unsafe.Pointer(pp)) + 8 /* &.pNext */) {
+ for pp = pIter + 104; *(*uintptr)(unsafe.Pointer(pp)) != 0; pp = *(*uintptr)(unsafe.Pointer(pp)) + 8 {
pUp = *(*uintptr)(unsafe.Pointer(pp))
if libc.Xstrcmp(tls, (*RbuUpdateStmt)(unsafe.Pointer(pUp)).FzMask, zMask) == 0 {
*(*uintptr)(unsafe.Pointer(pp)) = (*RbuUpdateStmt)(unsafe.Pointer(pUp)).FpNext
@@ -162577,13 +164826,13 @@ func rbuGetUpdateStmt(tls *libc.TLS, p uintptr, pIter uintptr, zMask uintptr, pp
}
if nUp >= SQLITE_RBU_UPDATE_CACHESIZE {
- for pp = (pIter + 104 /* &.pRbuUpdate */); *(*uintptr)(unsafe.Pointer(pp)) != pUp; pp = (*(*uintptr)(unsafe.Pointer(pp)) + 8 /* &.pNext */) {
+ for pp = pIter + 104; *(*uintptr)(unsafe.Pointer(pp)) != pUp; pp = *(*uintptr)(unsafe.Pointer(pp)) + 8 {
}
*(*uintptr)(unsafe.Pointer(pp)) = uintptr(0)
Xsqlite3_finalize(tls, (*RbuUpdateStmt)(unsafe.Pointer(pUp)).FpUpdate)
(*RbuUpdateStmt)(unsafe.Pointer(pUp)).FpUpdate = uintptr(0)
} else {
- pUp = rbuMalloc(tls, p, (int64((uint32(unsafe.Sizeof(RbuUpdateStmt{})) + uint32((*RbuObjIter)(unsafe.Pointer(pIter)).FnTblCol)) + uint32(1))))
+ pUp = rbuMalloc(tls, p, int64(uint32(unsafe.Sizeof(RbuUpdateStmt{}))+uint32((*RbuObjIter)(unsafe.Pointer(pIter)).FnTblCol)+uint32(1)))
}
if pUp != 0 {
@@ -162591,21 +164840,21 @@ func rbuGetUpdateStmt(tls *libc.TLS, p uintptr, pIter uintptr, zMask uintptr, pp
var zSet uintptr = rbuObjIterGetSetlist(tls, p, pIter, zMask)
var zUpdate uintptr = uintptr(0)
- (*RbuUpdateStmt)(unsafe.Pointer(pUp)).FzMask = (pUp + 1*12)
+ (*RbuUpdateStmt)(unsafe.Pointer(pUp)).FzMask = pUp + 1*12
libc.Xmemcpy(tls, (*RbuUpdateStmt)(unsafe.Pointer(pUp)).FzMask, zMask, uint32((*RbuObjIter)(unsafe.Pointer(pIter)).FnTblCol))
(*RbuUpdateStmt)(unsafe.Pointer(pUp)).FpNext = (*RbuObjIter)(unsafe.Pointer(pIter)).FpRbuUpdate
(*RbuObjIter)(unsafe.Pointer(pIter)).FpRbuUpdate = pUp
if zSet != 0 {
- var zPrefix uintptr = ts + 755 /* "" */
+ var zPrefix uintptr = ts + 1543 /* "" */
if (*RbuObjIter)(unsafe.Pointer(pIter)).FeType != RBU_PK_VTAB {
- zPrefix = ts + 28515 /* "rbu_imp_" */
+ zPrefix = ts + 29850 /* "rbu_imp_" */
}
- zUpdate = Xsqlite3_mprintf(tls, ts+29176, /* "UPDATE \"%s%w\" SE..." */
+ zUpdate = Xsqlite3_mprintf(tls, ts+30511, /* "UPDATE \"%s%w\" SE..." */
libc.VaList(bp, zPrefix, (*RbuObjIter)(unsafe.Pointer(pIter)).FzTbl, zSet, zWhere))
(*Sqlite3rbu)(unsafe.Pointer(p)).Frc = prepareFreeAndCollectError(tls,
- (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain, (pUp + 4 /* &.pUpdate */), (p + 36 /* &.zErrmsg */), zUpdate)
+ (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain, pUp+4, p+36, zUpdate)
*(*uintptr)(unsafe.Pointer(ppStmt)) = (*RbuUpdateStmt)(unsafe.Pointer(pUp)).FpUpdate
}
Xsqlite3_free(tls, zWhere)
@@ -162615,13 +164864,13 @@ func rbuGetUpdateStmt(tls *libc.TLS, p uintptr, pIter uintptr, zMask uintptr, pp
return (*Sqlite3rbu)(unsafe.Pointer(p)).Frc
}
-func rbuOpenDbhandle(tls *libc.TLS, p uintptr, zName uintptr, bUseVfs int32) uintptr { /* sqlite3.c:202713:16: */
+func rbuOpenDbhandle(tls *libc.TLS, p uintptr, zName uintptr, bUseVfs int32) uintptr { /* sqlite3.c:204393:16: */
bp := tls.Alloc(12)
defer tls.Free(12)
*(*uintptr)(unsafe.Pointer(bp + 8 /* db */)) = uintptr(0)
if (*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK {
- var flags int32 = ((SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE) | SQLITE_OPEN_URI)
+ var flags int32 = SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE | SQLITE_OPEN_URI
(*Sqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_open_v2(tls, zName, bp+8 /* &db */, flags, func() uintptr {
if bUseVfs != 0 {
return (*Sqlite3rbu)(unsafe.Pointer(p)).FzVfsName
@@ -162629,7 +164878,7 @@ func rbuOpenDbhandle(tls *libc.TLS, p uintptr, zName uintptr, bUseVfs int32) uin
return uintptr(0)
}())
if (*Sqlite3rbu)(unsafe.Pointer(p)).Frc != 0 {
- (*Sqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, ts+2790 /* "%s" */, libc.VaList(bp, Xsqlite3_errmsg(tls, *(*uintptr)(unsafe.Pointer(bp + 8 /* db */)))))
+ (*Sqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, ts+3601 /* "%s" */, libc.VaList(bp, Xsqlite3_errmsg(tls, *(*uintptr)(unsafe.Pointer(bp + 8 /* db */)))))
Xsqlite3_close(tls, *(*uintptr)(unsafe.Pointer(bp + 8 /* db */)))
*(*uintptr)(unsafe.Pointer(bp + 8 /* db */)) = uintptr(0)
}
@@ -162638,7 +164887,7 @@ func rbuOpenDbhandle(tls *libc.TLS, p uintptr, zName uintptr, bUseVfs int32) uin
}
// Free an RbuState object allocated by rbuLoadState().
-func rbuFreeState(tls *libc.TLS, p uintptr) { /* sqlite3.c:202734:13: */
+func rbuFreeState(tls *libc.TLS, p uintptr) { /* sqlite3.c:204414:13: */
if p != 0 {
Xsqlite3_free(tls, (*RbuState)(unsafe.Pointer(p)).FzTbl)
Xsqlite3_free(tls, (*RbuState)(unsafe.Pointer(p)).FzDataTbl)
@@ -162654,7 +164903,7 @@ func rbuFreeState(tls *libc.TLS, p uintptr) { /* sqlite3.c:202734:13: */
//
// If an error occurs, leave an error code and message in the rbu handle
// and return NULL.
-func rbuLoadState(tls *libc.TLS, p uintptr) uintptr { /* sqlite3.c:202752:17: */
+func rbuLoadState(tls *libc.TLS, p uintptr) uintptr { /* sqlite3.c:204432:17: */
bp := tls.Alloc(16)
defer tls.Free(16)
@@ -162669,15 +164918,15 @@ func rbuLoadState(tls *libc.TLS, p uintptr) uintptr { /* sqlite3.c:202752:17: */
return uintptr(0)
}
- *(*int32)(unsafe.Pointer(bp + 12 /* rc */)) = prepareFreeAndCollectError(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbRbu, bp+8 /* &pStmt */, (p + 36 /* &.zErrmsg */),
- Xsqlite3_mprintf(tls, ts+29206 /* "SELECT k, v FROM..." */, libc.VaList(bp, p+24 /* &.zStateDb */)))
- for (*(*int32)(unsafe.Pointer(bp + 12 /* rc */)) == SQLITE_OK) && (SQLITE_ROW == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp + 8 /* pStmt */)))) {
+ *(*int32)(unsafe.Pointer(bp + 12 /* rc */)) = prepareFreeAndCollectError(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbRbu, bp+8 /* &pStmt */, p+36,
+ Xsqlite3_mprintf(tls, ts+30541 /* "SELECT k, v FROM..." */, libc.VaList(bp, p+24)))
+ for *(*int32)(unsafe.Pointer(bp + 12)) == SQLITE_OK && SQLITE_ROW == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp + 8))) {
switch Xsqlite3_column_int(tls, *(*uintptr)(unsafe.Pointer(bp + 8 /* pStmt */)), 0) {
case RBU_STATE_STAGE:
(*RbuState)(unsafe.Pointer(pRet)).FeStage = Xsqlite3_column_int(tls, *(*uintptr)(unsafe.Pointer(bp + 8 /* pStmt */)), 1)
- if (((*RbuState)(unsafe.Pointer(pRet)).FeStage != RBU_STAGE_OAL) &&
- ((*RbuState)(unsafe.Pointer(pRet)).FeStage != RBU_STAGE_MOVE)) &&
- ((*RbuState)(unsafe.Pointer(pRet)).FeStage != RBU_STAGE_CKPT) {
+ if (*RbuState)(unsafe.Pointer(pRet)).FeStage != RBU_STAGE_OAL &&
+ (*RbuState)(unsafe.Pointer(pRet)).FeStage != RBU_STAGE_MOVE &&
+ (*RbuState)(unsafe.Pointer(pRet)).FeStage != RBU_STAGE_CKPT {
(*Sqlite3rbu)(unsafe.Pointer(p)).Frc = SQLITE_CORRUPT
}
break
@@ -162707,7 +164956,7 @@ func rbuLoadState(tls *libc.TLS, p uintptr) uintptr { /* sqlite3.c:202752:17: */
break
case RBU_STATE_OALSZ:
- (*RbuState)(unsafe.Pointer(pRet)).FiOalSz = I64(U32(Xsqlite3_column_int64(tls, *(*uintptr)(unsafe.Pointer(bp + 8 /* pStmt */)), 1)))
+ (*RbuState)(unsafe.Pointer(pRet)).FiOalSz = Xsqlite3_column_int64(tls, *(*uintptr)(unsafe.Pointer(bp + 8 /* pStmt */)), 1)
break
case RBU_STATE_PHASEONESTEP:
@@ -162724,7 +164973,7 @@ func rbuLoadState(tls *libc.TLS, p uintptr) uintptr { /* sqlite3.c:202752:17: */
}
}
rc2 = Xsqlite3_finalize(tls, *(*uintptr)(unsafe.Pointer(bp + 8 /* pStmt */)))
- if *(*int32)(unsafe.Pointer(bp + 12 /* rc */)) == SQLITE_OK {
+ if *(*int32)(unsafe.Pointer(bp + 12)) == SQLITE_OK {
*(*int32)(unsafe.Pointer(bp + 12 /* rc */)) = rc2
}
@@ -162734,39 +164983,44 @@ func rbuLoadState(tls *libc.TLS, p uintptr) uintptr { /* sqlite3.c:202752:17: */
// Open the database handle and attach the RBU database as "rbu". If an
// error occurs, leave an error code and message in the RBU handle.
-func rbuOpenDatabase(tls *libc.TLS, p uintptr, pbRetry uintptr) { /* sqlite3.c:202829:13: */
+//
+// If argument dbMain is not NULL, then it is a database handle already
+// open on the target database. Use this handle instead of opening a new
+// one.
+func rbuOpenDatabase(tls *libc.TLS, p uintptr, dbMain uintptr, pbRetry uintptr) { /* sqlite3.c:204513:13: */
bp := tls.Alloc(56)
defer tls.Free(56)
// Open the RBU database
(*Sqlite3rbu)(unsafe.Pointer(p)).FdbRbu = rbuOpenDbhandle(tls, p, (*Sqlite3rbu)(unsafe.Pointer(p)).FzRbu, 1)
+ (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain = dbMain
- if ((*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK) && ((*Sqlite3rbu)(unsafe.Pointer((p))).FzTarget == uintptr(0)) {
- Xsqlite3_file_control(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbRbu, ts+5458 /* "main" */, SQLITE_FCNTL_RBUCNT, p)
+ if (*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && (*Sqlite3rbu)(unsafe.Pointer(p)).FzTarget == uintptr(0) {
+ Xsqlite3_file_control(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbRbu, ts+6305 /* "main" */, SQLITE_FCNTL_RBUCNT, p)
if (*Sqlite3rbu)(unsafe.Pointer(p)).FzState == uintptr(0) {
- var zFile uintptr = Xsqlite3_db_filename(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbRbu, ts+5458 /* "main" */)
- (*Sqlite3rbu)(unsafe.Pointer(p)).FzState = rbuMPrintf(tls, p, ts+29236 /* "file://%s-vacuum..." */, libc.VaList(bp, zFile, zFile))
+ var zFile uintptr = Xsqlite3_db_filename(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbRbu, ts+6305 /* "main" */)
+ (*Sqlite3rbu)(unsafe.Pointer(p)).FzState = rbuMPrintf(tls, p, ts+30571 /* "file://%s-vacuum..." */, libc.VaList(bp, zFile, zFile))
}
}
// If using separate RBU and state databases, attach the state database to
// the RBU db handle now.
if (*Sqlite3rbu)(unsafe.Pointer(p)).FzState != 0 {
- rbuMPrintfExec(tls, p, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbRbu, ts+29263 /* "ATTACH %Q AS sta..." */, libc.VaList(bp+16, (*Sqlite3rbu)(unsafe.Pointer(p)).FzState))
- libc.Xmemcpy(tls, p+24 /* &.zStateDb */, ts+2413 /* "stat" */, uint32(4))
+ rbuMPrintfExec(tls, p, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbRbu, ts+30598 /* "ATTACH %Q AS sta..." */, libc.VaList(bp+16, (*Sqlite3rbu)(unsafe.Pointer(p)).FzState))
+ libc.Xmemcpy(tls, p+24, ts+3224 /* "stat" */, uint32(4))
} else {
- libc.Xmemcpy(tls, p+24 /* &.zStateDb */, ts+5458 /* "main" */, uint32(4))
+ libc.Xmemcpy(tls, p+24, ts+6305 /* "main" */, uint32(4))
}
// If it has not already been created, create the rbu_state table
- rbuMPrintfExec(tls, p, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbRbu, ts+29281 /* "CREATE TABLE IF ..." */, libc.VaList(bp+24, p+24 /* &.zStateDb */))
+ rbuMPrintfExec(tls, p, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbRbu, ts+30616 /* "CREATE TABLE IF ..." */, libc.VaList(bp+24, p+24))
- if ((*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK) && ((*Sqlite3rbu)(unsafe.Pointer((p))).FzTarget == uintptr(0)) {
+ if (*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && (*Sqlite3rbu)(unsafe.Pointer(p)).FzTarget == uintptr(0) {
var bOpen int32 = 0
var rc int32
(*Sqlite3rbu)(unsafe.Pointer(p)).FnRbu = 0
(*Sqlite3rbu)(unsafe.Pointer(p)).FpRbuFd = uintptr(0)
- rc = Xsqlite3_file_control(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbRbu, ts+5458 /* "main" */, SQLITE_FCNTL_RBUCNT, p)
+ rc = Xsqlite3_file_control(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbRbu, ts+6305 /* "main" */, SQLITE_FCNTL_RBUCNT, p)
if rc != SQLITE_NOTFOUND {
(*Sqlite3rbu)(unsafe.Pointer(p)).Frc = rc
}
@@ -162775,18 +165029,18 @@ func rbuOpenDatabase(tls *libc.TLS, p uintptr, pbRetry uintptr) { /* sqlite3.c:2
} else {
var pState uintptr = rbuLoadState(tls, p)
if pState != 0 {
- bOpen = (libc.Bool32((*RbuState)(unsafe.Pointer(pState)).FeStage >= RBU_STAGE_MOVE))
+ bOpen = libc.Bool32((*RbuState)(unsafe.Pointer(pState)).FeStage >= RBU_STAGE_MOVE)
rbuFreeState(tls, pState)
}
}
if bOpen != 0 {
- (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain = rbuOpenDbhandle(tls, p, (*Sqlite3rbu)(unsafe.Pointer(p)).FzRbu, (libc.Bool32((*Sqlite3rbu)(unsafe.Pointer(p)).FnRbu <= 1)))
+ (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain = rbuOpenDbhandle(tls, p, (*Sqlite3rbu)(unsafe.Pointer(p)).FzRbu, libc.Bool32((*Sqlite3rbu)(unsafe.Pointer(p)).FnRbu <= 1))
}
}
(*Sqlite3rbu)(unsafe.Pointer(p)).FeStage = 0
- if ((*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK) && ((*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain == uintptr(0)) {
- if !((*Sqlite3rbu)(unsafe.Pointer((p))).FzTarget == uintptr(0)) {
+ if (*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain == uintptr(0) {
+ if !((*Sqlite3rbu)(unsafe.Pointer(p)).FzTarget == uintptr(0)) {
(*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain = rbuOpenDbhandle(tls, p, (*Sqlite3rbu)(unsafe.Pointer(p)).FzTarget, 1)
} else if (*Rbu_file)(unsafe.Pointer((*Sqlite3rbu)(unsafe.Pointer(p)).FpRbuFd)).FpWalFd != 0 {
if pbRetry != 0 {
@@ -162799,12 +165053,12 @@ func rbuOpenDatabase(tls *libc.TLS, p uintptr, pbRetry uintptr) { /* sqlite3.c:2
return
}
(*Sqlite3rbu)(unsafe.Pointer(p)).Frc = SQLITE_ERROR
- (*Sqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, ts+29347 /* "cannot vacuum wa..." */, 0)
+ (*Sqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, ts+30682 /* "cannot vacuum wa..." */, 0)
} else {
var zTarget uintptr
var zExtra uintptr = uintptr(0)
- if (libc.Xstrlen(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FzRbu) >= Size_t(5)) && (0 == libc.Xmemcmp(tls, ts+22479 /* "file:" */, (*Sqlite3rbu)(unsafe.Pointer(p)).FzRbu, uint32(5))) {
- zExtra = ((*Sqlite3rbu)(unsafe.Pointer(p)).FzRbu + 5)
+ if libc.Xstrlen(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FzRbu) >= Size_t(5) && 0 == libc.Xmemcmp(tls, ts+23776, (*Sqlite3rbu)(unsafe.Pointer(p)).FzRbu, uint32(5)) {
+ zExtra = (*Sqlite3rbu)(unsafe.Pointer(p)).FzRbu + 5
for *(*uint8)(unsafe.Pointer(zExtra)) != 0 {
if int32(*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&zExtra, 1)))) == '?' {
break
@@ -162815,16 +165069,16 @@ func rbuOpenDatabase(tls *libc.TLS, p uintptr, pbRetry uintptr) { /* sqlite3.c:2
}
}
- zTarget = Xsqlite3_mprintf(tls, ts+29379, /* "file:%s-vactmp?r..." */
- libc.VaList(bp+32, Xsqlite3_db_filename(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbRbu, ts+5458 /* "main" */),
+ zTarget = Xsqlite3_mprintf(tls, ts+30714, /* "file:%s-vactmp?r..." */
+ libc.VaList(bp+32, Xsqlite3_db_filename(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbRbu, ts+6305 /* "main" */),
func() uintptr {
if zExtra == uintptr(0) {
- return ts + 755 /* "" */
+ return ts + 1543 /* "" */
}
- return ts + 29411 /* "&" */
+ return ts + 30746 /* "&" */
}(), func() uintptr {
if zExtra == uintptr(0) {
- return ts + 755 /* "" */
+ return ts + 1543 /* "" */
}
return zExtra
}()))
@@ -162833,47 +165087,47 @@ func rbuOpenDatabase(tls *libc.TLS, p uintptr, pbRetry uintptr) { /* sqlite3.c:2
(*Sqlite3rbu)(unsafe.Pointer(p)).Frc = SQLITE_NOMEM
return
}
- (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain = rbuOpenDbhandle(tls, p, zTarget, (libc.Bool32((*Sqlite3rbu)(unsafe.Pointer(p)).FnRbu <= 1)))
+ (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain = rbuOpenDbhandle(tls, p, zTarget, libc.Bool32((*Sqlite3rbu)(unsafe.Pointer(p)).FnRbu <= 1))
Xsqlite3_free(tls, zTarget)
}
}
if (*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK {
(*Sqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_create_function(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain,
- ts+29413 /* "rbu_tmp_insert" */, -1, SQLITE_UTF8, p, *(*uintptr)(unsafe.Pointer(&struct {
+ ts+30748 /* "rbu_tmp_insert" */, -1, SQLITE_UTF8, p, *(*uintptr)(unsafe.Pointer(&struct {
f func(*libc.TLS, uintptr, int32, uintptr)
}{rbuTmpInsertFunc})), uintptr(0), uintptr(0))
}
if (*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK {
(*Sqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_create_function(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain,
- ts+29428 /* "rbu_fossil_delta" */, 2, SQLITE_UTF8, uintptr(0), *(*uintptr)(unsafe.Pointer(&struct {
+ ts+30763 /* "rbu_fossil_delta" */, 2, SQLITE_UTF8, uintptr(0), *(*uintptr)(unsafe.Pointer(&struct {
f func(*libc.TLS, uintptr, int32, uintptr)
}{rbuFossilDeltaFunc})), uintptr(0), uintptr(0))
}
if (*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK {
(*Sqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_create_function(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbRbu,
- ts+29445 /* "rbu_target_name" */, -1, SQLITE_UTF8, p, *(*uintptr)(unsafe.Pointer(&struct {
+ ts+30780 /* "rbu_target_name" */, -1, SQLITE_UTF8, p, *(*uintptr)(unsafe.Pointer(&struct {
f func(*libc.TLS, uintptr, int32, uintptr)
}{rbuTargetNameFunc})), uintptr(0), uintptr(0))
}
if (*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK {
- (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_file_control(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain, ts+5458 /* "main" */, SQLITE_FCNTL_RBU, p)
+ (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_file_control(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain, ts+6305 /* "main" */, SQLITE_FCNTL_RBU, p)
}
- rbuMPrintfExec(tls, p, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain, ts+29461 /* "SELECT * FROM sq..." */, 0)
+ rbuMPrintfExec(tls, p, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain, ts+30796 /* "SELECT * FROM sq..." */, 0)
// Mark the database file just opened as an RBU target database. If
// this call returns SQLITE_NOTFOUND, then the RBU vfs is not in use.
// This is an error.
if (*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK {
- (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_file_control(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain, ts+5458 /* "main" */, SQLITE_FCNTL_RBU, p)
+ (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_file_control(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain, ts+6305 /* "main" */, SQLITE_FCNTL_RBU, p)
}
if (*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_NOTFOUND {
(*Sqlite3rbu)(unsafe.Pointer(p)).Frc = SQLITE_ERROR
- (*Sqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, ts+29489 /* "rbu vfs not foun..." */, 0)
+ (*Sqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, ts+30824 /* "rbu vfs not foun..." */, 0)
}
}
@@ -162895,7 +165149,7 @@ func rbuOpenDatabase(tls *libc.TLS, p uintptr, pbRetry uintptr) { /* sqlite3.c:2
// test.db-wal => test.wal
// test.db-shm => test.shm
// test.db-mj7f3319fa => test.9fa
-func rbuFileSuffix3(tls *libc.TLS, zBase uintptr, z uintptr) { /* sqlite3.c:203008:13: */
+func rbuFileSuffix3(tls *libc.TLS, zBase uintptr, z uintptr) { /* sqlite3.c:204694:13: */
}
// Return the current wal-index header checksum for the target database
@@ -162903,7 +165157,7 @@ func rbuFileSuffix3(tls *libc.TLS, zBase uintptr, z uintptr) { /* sqlite3.c:2030
//
// The checksum is store in the first page of xShmMap memory as an 8-byte
// blob starting at byte offset 40.
-func rbuShmChecksum(tls *libc.TLS, p uintptr) I64 { /* sqlite3.c:203029:12: */
+func rbuShmChecksum(tls *libc.TLS, p uintptr) I64 { /* sqlite3.c:204715:12: */
bp := tls.Alloc(4)
defer tls.Free(4)
@@ -162914,9 +165168,9 @@ func rbuShmChecksum(tls *libc.TLS, p uintptr) I64 { /* sqlite3.c:203029:12: */
(*Sqlite3rbu)(unsafe.Pointer(p)).Frc = (*struct {
f func(*libc.TLS, uintptr, int32, int32, int32, uintptr) int32
- })(unsafe.Pointer(&struct{ uintptr }{(*sqlite3_io_methods)(unsafe.Pointer((*Sqlite3_file)(unsafe.Pointer(pDb)).FpMethods)).FxShmMap})).f(tls, pDb, 0, (32 * 1024), 0, bp /* &ptr */)
+ })(unsafe.Pointer(&struct{ uintptr }{(*sqlite3_io_methods)(unsafe.Pointer((*Sqlite3_file)(unsafe.Pointer(pDb)).FpMethods)).FxShmMap})).f(tls, pDb, 0, 32*1024, 0, bp /* &ptr */)
if (*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK {
- iRet = ((I64(*(*U32)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* ptr */)) + 10*4))) << 32) + I64(*(*U32)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* ptr */)) + 11*4))))
+ iRet = I64(*(*U32)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)) + 10*4)))<<32 + I64(*(*U32)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)) + 11*4)))
}
}
return iRet
@@ -162936,7 +165190,7 @@ func rbuShmChecksum(tls *libc.TLS, p uintptr) I64 { /* sqlite3.c:203029:12: */
// object, then the rbu handle is set to DONE state. This occurs if some
// other client appends a transaction to the wal file in the middle of
// an incremental checkpoint.
-func rbuSetupCheckpoint(tls *libc.TLS, p uintptr, pState uintptr) { /* sqlite3.c:203058:13: */
+func rbuSetupCheckpoint(tls *libc.TLS, p uintptr, pState uintptr) { /* sqlite3.c:204744:13: */
// If pState is NULL, then the wal file may not have been opened and
// recovered. Running a read-statement here to ensure that doing so
@@ -162944,7 +165198,7 @@ func rbuSetupCheckpoint(tls *libc.TLS, p uintptr, pState uintptr) { /* sqlite3.c
if pState == uintptr(0) {
(*Sqlite3rbu)(unsafe.Pointer(p)).FeStage = 0
if (*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK {
- (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain, ts+29461 /* "SELECT * FROM sq..." */, uintptr(0), uintptr(0), uintptr(0))
+ (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain, ts+30796 /* "SELECT * FROM sq..." */, uintptr(0), uintptr(0), uintptr(0))
}
}
@@ -162978,13 +165232,13 @@ func rbuSetupCheckpoint(tls *libc.TLS, p uintptr, pState uintptr) { /* sqlite3.c
if (*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK {
var rc2 int32
(*Sqlite3rbu)(unsafe.Pointer(p)).FeStage = RBU_STAGE_CAPTURE
- rc2 = Xsqlite3_exec(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain, ts+29507 /* "PRAGMA main.wal_..." */, uintptr(0), uintptr(0), uintptr(0))
+ rc2 = Xsqlite3_exec(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain, ts+30842 /* "PRAGMA main.wal_..." */, uintptr(0), uintptr(0), uintptr(0))
if rc2 != SQLITE_INTERNAL {
(*Sqlite3rbu)(unsafe.Pointer(p)).Frc = rc2
}
}
- if ((*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK) && ((*Sqlite3rbu)(unsafe.Pointer(p)).FnFrame > 0) {
+ if (*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && (*Sqlite3rbu)(unsafe.Pointer(p)).FnFrame > 0 {
(*Sqlite3rbu)(unsafe.Pointer(p)).FeStage = RBU_STAGE_CKPT
(*Sqlite3rbu)(unsafe.Pointer(p)).FnStep = func() int32 {
if pState != 0 {
@@ -162997,7 +165251,7 @@ func rbuSetupCheckpoint(tls *libc.TLS, p uintptr, pState uintptr) { /* sqlite3.c
}
if (*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK {
- if ((*Sqlite3rbu)(unsafe.Pointer(p)).FnFrame == 0) || ((pState != 0) && ((*RbuState)(unsafe.Pointer(pState)).FiWalCksum != (*Sqlite3rbu)(unsafe.Pointer(p)).FiWalCksum)) {
+ if (*Sqlite3rbu)(unsafe.Pointer(p)).FnFrame == 0 || pState != 0 && (*RbuState)(unsafe.Pointer(pState)).FiWalCksum != (*Sqlite3rbu)(unsafe.Pointer(p)).FiWalCksum {
(*Sqlite3rbu)(unsafe.Pointer(p)).Frc = SQLITE_DONE
(*Sqlite3rbu)(unsafe.Pointer(p)).FeStage = RBU_STAGE_DONE
} else {
@@ -163009,7 +165263,7 @@ func rbuSetupCheckpoint(tls *libc.TLS, p uintptr, pState uintptr) { /* sqlite3.c
f func(*libc.TLS, uintptr) int32
})(unsafe.Pointer(&struct{ uintptr }{(*sqlite3_io_methods)(unsafe.Pointer((*Sqlite3_file)(unsafe.Pointer(pDb)).FpMethods)).FxSectorSize})).f(tls, pDb)
if nSectorSize > (*Sqlite3rbu)(unsafe.Pointer(p)).Fpgsz {
- (*Sqlite3rbu)(unsafe.Pointer(p)).FnPagePerSector = (nSectorSize / (*Sqlite3rbu)(unsafe.Pointer(p)).Fpgsz)
+ (*Sqlite3rbu)(unsafe.Pointer(p)).FnPagePerSector = nSectorSize / (*Sqlite3rbu)(unsafe.Pointer(p)).Fpgsz
} else {
(*Sqlite3rbu)(unsafe.Pointer(p)).FnPagePerSector = 1
}
@@ -163028,8 +165282,8 @@ func rbuSetupCheckpoint(tls *libc.TLS, p uintptr, pState uintptr) { /* sqlite3.c
// Called when iAmt bytes are read from offset iOff of the wal file while
// the rbu object is in capture mode. Record the frame number of the frame
// being read in the aFrame[] array.
-func rbuCaptureWalRead(tls *libc.TLS, pRbu uintptr, iOff I64, iAmt int32) int32 { /* sqlite3.c:203142:12: */
- var mReq U32 = (U32(((int32(1) << WAL_LOCK_WRITE) | (int32(1) << WAL_LOCK_CKPT)) | (int32(1) << WAL_LOCK_READ0)))
+func rbuCaptureWalRead(tls *libc.TLS, pRbu uintptr, iOff I64, iAmt int32) int32 { /* sqlite3.c:204828:12: */
+ var mReq U32 = U32(int32(1)<<WAL_LOCK_WRITE | int32(1)<<WAL_LOCK_CKPT | int32(1)<<WAL_LOCK_READ0)
var iFrame U32
if (*Sqlite3rbu)(unsafe.Pointer(pRbu)).FmLock != mReq {
@@ -163039,14 +165293,14 @@ func rbuCaptureWalRead(tls *libc.TLS, pRbu uintptr, iOff I64, iAmt int32) int32
(*Sqlite3rbu)(unsafe.Pointer(pRbu)).Fpgsz = iAmt
if (*Sqlite3rbu)(unsafe.Pointer(pRbu)).FnFrame == (*Sqlite3rbu)(unsafe.Pointer(pRbu)).FnFrameAlloc {
- var nNew int32 = ((func() int32 {
+ var nNew int32 = func() int32 {
if (*Sqlite3rbu)(unsafe.Pointer(pRbu)).FnFrameAlloc != 0 {
return (*Sqlite3rbu)(unsafe.Pointer(pRbu)).FnFrameAlloc
}
return 64
- }()) * 2)
+ }() * 2
var aNew uintptr
- aNew = Xsqlite3_realloc64(tls, (*Sqlite3rbu)(unsafe.Pointer(pRbu)).FaFrame, (uint64(uint32(nNew) * uint32(unsafe.Sizeof(RbuFrame{})))))
+ aNew = Xsqlite3_realloc64(tls, (*Sqlite3rbu)(unsafe.Pointer(pRbu)).FaFrame, uint64(uint32(nNew)*uint32(unsafe.Sizeof(RbuFrame{}))))
if aNew == uintptr(0) {
return SQLITE_NOMEM
}
@@ -163054,7 +165308,7 @@ func rbuCaptureWalRead(tls *libc.TLS, pRbu uintptr, iOff I64, iAmt int32) int32
(*Sqlite3rbu)(unsafe.Pointer(pRbu)).FnFrameAlloc = nNew
}
- iFrame = ((U32((iOff - int64(32)) / (I64(iAmt + 24)))) + U32(1))
+ iFrame = U32((iOff-int64(32))/I64(iAmt+24)) + U32(1)
if (*Sqlite3rbu)(unsafe.Pointer(pRbu)).FiMaxFrame < iFrame {
(*Sqlite3rbu)(unsafe.Pointer(pRbu)).FiMaxFrame = iFrame
}
@@ -163067,20 +165321,20 @@ func rbuCaptureWalRead(tls *libc.TLS, pRbu uintptr, iOff I64, iAmt int32) int32
// Called when a page of data is written to offset iOff of the database
// file while the rbu handle is in capture mode. Record the page number
// of the page being written in the aFrame[] array.
-func rbuCaptureDbWrite(tls *libc.TLS, pRbu uintptr, iOff I64) int32 { /* sqlite3.c:203174:12: */
- (*RbuFrame)(unsafe.Pointer((*Sqlite3rbu)(unsafe.Pointer(pRbu)).FaFrame + uintptr(((*Sqlite3rbu)(unsafe.Pointer(pRbu)).FnFrame-1))*8)).FiDbPage = ((U32(iOff / I64((*Sqlite3rbu)(unsafe.Pointer(pRbu)).Fpgsz))) + U32(1))
+func rbuCaptureDbWrite(tls *libc.TLS, pRbu uintptr, iOff I64) int32 { /* sqlite3.c:204860:12: */
+ (*RbuFrame)(unsafe.Pointer((*Sqlite3rbu)(unsafe.Pointer(pRbu)).FaFrame + uintptr((*Sqlite3rbu)(unsafe.Pointer(pRbu)).FnFrame-1)*8)).FiDbPage = U32(iOff/I64((*Sqlite3rbu)(unsafe.Pointer(pRbu)).Fpgsz)) + U32(1)
return SQLITE_OK
}
// This is called as part of an incremental checkpoint operation. Copy
// a single frame of data from the wal file into the database file, as
// indicated by the RbuFrame object.
-func rbuCheckpointFrame(tls *libc.TLS, p uintptr, pFrame uintptr) { /* sqlite3.c:203184:13: */
+func rbuCheckpointFrame(tls *libc.TLS, p uintptr, pFrame uintptr) { /* sqlite3.c:204870:13: */
var pWal uintptr = (*Rbu_file)(unsafe.Pointer((*Rbu_file)(unsafe.Pointer((*Sqlite3rbu)(unsafe.Pointer(p)).FpTargetFd)).FpWalFd)).FpReal
var pDb uintptr = (*Rbu_file)(unsafe.Pointer((*Sqlite3rbu)(unsafe.Pointer(p)).FpTargetFd)).FpReal
var iOff I64
- iOff = ((((I64((*RbuFrame)(unsafe.Pointer(pFrame)).FiWalFrame - U32(1))) * (I64((*Sqlite3rbu)(unsafe.Pointer(p)).Fpgsz + 24))) + int64(32)) + int64(24))
+ iOff = I64((*RbuFrame)(unsafe.Pointer(pFrame)).FiWalFrame-U32(1))*I64((*Sqlite3rbu)(unsafe.Pointer(p)).Fpgsz+24) + int64(32) + int64(24)
(*Sqlite3rbu)(unsafe.Pointer(p)).Frc = (*struct {
f func(*libc.TLS, uintptr, uintptr, int32, Sqlite3_int64) int32
})(unsafe.Pointer(&struct{ uintptr }{(*sqlite3_io_methods)(unsafe.Pointer((*Sqlite3_file)(unsafe.Pointer(pWal)).FpMethods)).FxRead})).f(tls, pWal, (*Sqlite3rbu)(unsafe.Pointer(p)).FaBuf, (*Sqlite3rbu)(unsafe.Pointer(p)).Fpgsz, iOff)
@@ -163088,24 +165342,41 @@ func rbuCheckpointFrame(tls *libc.TLS, p uintptr, pFrame uintptr) { /* sqlite3.c
return
}
- iOff = ((I64((*RbuFrame)(unsafe.Pointer(pFrame)).FiDbPage - U32(1))) * I64((*Sqlite3rbu)(unsafe.Pointer(p)).Fpgsz))
+ iOff = I64((*RbuFrame)(unsafe.Pointer(pFrame)).FiDbPage-U32(1)) * I64((*Sqlite3rbu)(unsafe.Pointer(p)).Fpgsz)
(*Sqlite3rbu)(unsafe.Pointer(p)).Frc = (*struct {
f func(*libc.TLS, uintptr, uintptr, int32, Sqlite3_int64) int32
})(unsafe.Pointer(&struct{ uintptr }{(*sqlite3_io_methods)(unsafe.Pointer((*Sqlite3_file)(unsafe.Pointer(pDb)).FpMethods)).FxWrite})).f(tls, pDb, (*Sqlite3rbu)(unsafe.Pointer(p)).FaBuf, (*Sqlite3rbu)(unsafe.Pointer(p)).Fpgsz, iOff)
}
-// Take an EXCLUSIVE lock on the database file.
-func rbuLockDatabase(tls *libc.TLS, p uintptr) { /* sqlite3.c:203202:13: */
- var pReal uintptr = (*Rbu_file)(unsafe.Pointer((*Sqlite3rbu)(unsafe.Pointer(p)).FpTargetFd)).FpReal
+// Take an EXCLUSIVE lock on the database file. Return SQLITE_OK if
+// successful, or an SQLite error code otherwise.
+func rbuLockDatabase(tls *libc.TLS, db uintptr) int32 { /* sqlite3.c:204889:12: */
+ bp := tls.Alloc(4)
+ defer tls.Free(4)
+
+ var rc int32 = SQLITE_OK
+ *(*uintptr)(unsafe.Pointer(bp /* fd */)) = uintptr(0)
+ Xsqlite3_file_control(tls, db, ts+6305 /* "main" */, SQLITE_FCNTL_FILE_POINTER, bp /* &fd */)
- (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = (*struct {
- f func(*libc.TLS, uintptr, int32) int32
- })(unsafe.Pointer(&struct{ uintptr }{(*sqlite3_io_methods)(unsafe.Pointer((*Sqlite3_file)(unsafe.Pointer(pReal)).FpMethods)).FxLock})).f(tls, pReal, SQLITE_LOCK_SHARED)
- if (*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK {
- (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = (*struct {
+ if (*Sqlite3_file)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FpMethods != 0 {
+ rc = (*struct {
f func(*libc.TLS, uintptr, int32) int32
- })(unsafe.Pointer(&struct{ uintptr }{(*sqlite3_io_methods)(unsafe.Pointer((*Sqlite3_file)(unsafe.Pointer(pReal)).FpMethods)).FxLock})).f(tls, pReal, SQLITE_LOCK_EXCLUSIVE)
+ })(unsafe.Pointer(&struct{ uintptr }{(*sqlite3_io_methods)(unsafe.Pointer((*Sqlite3_file)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* fd */)))).FpMethods)).FxLock})).f(tls, *(*uintptr)(unsafe.Pointer(bp /* fd */)), SQLITE_LOCK_SHARED)
+ if rc == SQLITE_OK {
+ rc = (*struct {
+ f func(*libc.TLS, uintptr, int32) int32
+ })(unsafe.Pointer(&struct{ uintptr }{(*sqlite3_io_methods)(unsafe.Pointer((*Sqlite3_file)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* fd */)))).FpMethods)).FxLock})).f(tls, *(*uintptr)(unsafe.Pointer(bp /* fd */)), SQLITE_LOCK_EXCLUSIVE)
+ }
}
+ return rc
+}
+
+// Return true if the database handle passed as the only argument
+// was opened with the rbu_exclusive_checkpoint=1 URI parameter
+// specified. Or false otherwise.
+func rbuExclusiveCheckpoint(tls *libc.TLS, db uintptr) int32 { /* sqlite3.c:204908:12: */
+ var zUri uintptr = Xsqlite3_db_filename(tls, db, uintptr(0))
+ return Xsqlite3_uri_boolean(tls, zUri, ts+30877 /* "rbu_exclusive_ch..." */, 0)
}
// The RBU handle is currently in RBU_STAGE_OAL state, with a SHARED lock
@@ -163113,22 +165384,22 @@ func rbuLockDatabase(tls *libc.TLS, p uintptr) { /* sqlite3.c:203202:13: */
// then reopens the database file (this time in vanilla, non-oal, WAL mode).
// If an error occurs, leave an error code and error message in the rbu
// handle.
-func rbuMoveOalFile(tls *libc.TLS, p uintptr) { /* sqlite3.c:203242:13: */
+func rbuMoveOalFile(tls *libc.TLS, p uintptr) { /* sqlite3.c:204944:13: */
bp := tls.Alloc(16)
defer tls.Free(16)
- var zBase uintptr = Xsqlite3_db_filename(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain, ts+5458 /* "main" */)
+ var zBase uintptr = Xsqlite3_db_filename(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain, ts+6305 /* "main" */)
var zMove uintptr = zBase
var zOal uintptr
var zWal uintptr
- if (*Sqlite3rbu)(unsafe.Pointer((p))).FzTarget == uintptr(0) {
- zMove = Xsqlite3_db_filename(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbRbu, ts+5458 /* "main" */)
+ if (*Sqlite3rbu)(unsafe.Pointer(p)).FzTarget == uintptr(0) {
+ zMove = Xsqlite3_db_filename(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbRbu, ts+6305 /* "main" */)
}
- zOal = Xsqlite3_mprintf(tls, ts+29542 /* "%s-oal" */, libc.VaList(bp, zMove))
- zWal = Xsqlite3_mprintf(tls, ts+29549 /* "%s-wal" */, libc.VaList(bp+8, zMove))
+ zOal = Xsqlite3_mprintf(tls, ts+30902 /* "%s-oal" */, libc.VaList(bp, zMove))
+ zWal = Xsqlite3_mprintf(tls, ts+30909 /* "%s-wal" */, libc.VaList(bp+8, zMove))
- if (zWal == uintptr(0)) || (zOal == uintptr(0)) {
+ if zWal == uintptr(0) || zOal == uintptr(0) {
(*Sqlite3rbu)(unsafe.Pointer(p)).Frc = SQLITE_NOMEM
} else {
// Move the *-oal file to *-wal. At this point connection p->db is
@@ -163137,29 +165408,42 @@ func rbuMoveOalFile(tls *libc.TLS, p uintptr) { /* sqlite3.c:203242:13: */
//
// In order to ensure that there are no database readers, an EXCLUSIVE
// lock is obtained here before the *-oal is moved to *-wal.
- rbuLockDatabase(tls, p)
- if (*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK {
- rbuFileSuffix3(tls, zBase, zWal)
- rbuFileSuffix3(tls, zBase, zOal)
+ var dbMain uintptr = uintptr(0)
+ rbuFileSuffix3(tls, zBase, zWal)
+ rbuFileSuffix3(tls, zBase, zOal)
+
+ // Re-open the databases.
+ rbuObjIterFinalize(tls, p+48)
+ Xsqlite3_close(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbRbu)
+ Xsqlite3_close(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain)
+ (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain = uintptr(0)
+ (*Sqlite3rbu)(unsafe.Pointer(p)).FdbRbu = uintptr(0)
- // Re-open the databases.
- rbuObjIterFinalize(tls, (p + 48 /* &.objiter */))
- Xsqlite3_close(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbRbu)
- Xsqlite3_close(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain)
- (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain = uintptr(0)
- (*Sqlite3rbu)(unsafe.Pointer(p)).FdbRbu = uintptr(0)
+ dbMain = rbuOpenDbhandle(tls, p, (*Sqlite3rbu)(unsafe.Pointer(p)).FzTarget, 1)
+ if dbMain != 0 {
+ (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = rbuLockDatabase(tls, dbMain)
+ }
+
+ if (*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK {
(*Sqlite3rbu)(unsafe.Pointer(p)).Frc = func() int32 {
if libc.Xrename(tls, zOal, zWal) != 0 {
return SQLITE_IOERR
}
return SQLITE_OK
}()
+ }
- if (*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK {
- rbuOpenDatabase(tls, p, uintptr(0))
- rbuSetupCheckpoint(tls, p, uintptr(0))
- }
+ if (*Sqlite3rbu)(unsafe.Pointer(p)).Frc != SQLITE_OK ||
+ (*Sqlite3rbu)(unsafe.Pointer(p)).FzTarget == uintptr(0) ||
+ rbuExclusiveCheckpoint(tls, dbMain) == 0 {
+ Xsqlite3_close(tls, dbMain)
+ dbMain = uintptr(0)
+ }
+
+ if (*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK {
+ rbuOpenDatabase(tls, p, dbMain, uintptr(0))
+ rbuSetupCheckpoint(tls, p, uintptr(0))
}
}
@@ -163182,7 +165466,7 @@ func rbuMoveOalFile(tls *libc.TLS, p uintptr) { /* sqlite3.c:203242:13: */
//
// If the rbu_control field contains an invalid value, an error code and
// message are left in the RBU handle and zero returned.
-func rbuStepType(tls *libc.TLS, p uintptr, pzMask uintptr) int32 { /* sqlite3.c:203333:12: */
+func rbuStepType(tls *libc.TLS, p uintptr, pzMask uintptr) int32 { /* sqlite3.c:205049:12: */
var iCol int32 = (*Sqlite3rbu)(unsafe.Pointer(p)).Fobjiter.FnCol // Index of rbu_control column
var res int32 = 0 // Return value
@@ -163238,8 +165522,8 @@ func rbuStepType(tls *libc.TLS, p uintptr, pzMask uintptr) int32 { /* sqlite3.c:
// Argument eType must be one of RBU_INSERT, RBU_DELETE, RBU_IDX_INSERT or
// RBU_IDX_DELETE. This function performs the work of a single
// sqlite3rbu_step() call for the type of operation specified by eType.
-func rbuStepOneOp(tls *libc.TLS, p uintptr, eType int32) { /* sqlite3.c:203389:13: */
- var pIter uintptr = (p + 48 /* &.objiter */)
+func rbuStepOneOp(tls *libc.TLS, p uintptr, eType int32) { /* sqlite3.c:205105:13: */
+ var pIter uintptr = p + 48
var pVal uintptr
var pWriter uintptr
var i int32
@@ -163249,10 +165533,10 @@ func rbuStepOneOp(tls *libc.TLS, p uintptr, eType int32) { /* sqlite3.c:203389:1
// incremented by the same amount when SQL function rbu_tmp_insert()
// is invoked by the trigger.
if eType == RBU_DELETE {
- *(*I64)(unsafe.Pointer(p + 176 /* &.nPhaseOneStep */)) -= (I64((*Sqlite3rbu)(unsafe.Pointer(p)).Fobjiter.FnIndex))
+ *(*I64)(unsafe.Pointer(p + 176)) -= I64((*Sqlite3rbu)(unsafe.Pointer(p)).Fobjiter.FnIndex)
}
- if (eType == RBU_IDX_DELETE) || (eType == RBU_DELETE) {
+ if eType == RBU_IDX_DELETE || eType == RBU_DELETE {
pWriter = (*RbuObjIter)(unsafe.Pointer(pIter)).FpDelete
} else {
pWriter = (*RbuObjIter)(unsafe.Pointer(pIter)).FpInsert
@@ -163262,28 +165546,28 @@ func rbuStepOneOp(tls *libc.TLS, p uintptr, eType int32) { /* sqlite3.c:203389:1
// If this is an INSERT into a table b-tree and the table has an
// explicit INTEGER PRIMARY KEY, check that this is not an attempt
// to write a NULL into the IPK column. That is not permitted.
- if ((((eType == RBU_INSERT) &&
- ((*RbuObjIter)(unsafe.Pointer(pIter)).FzIdx == uintptr(0))) && ((*RbuObjIter)(unsafe.Pointer(pIter)).FeType == RBU_PK_IPK)) && (*(*U8)(unsafe.Pointer((*RbuObjIter)(unsafe.Pointer(pIter)).FabTblPk + uintptr(i))) != 0)) &&
- (Xsqlite3_column_type(tls, (*RbuObjIter)(unsafe.Pointer(pIter)).FpSelect, i) == SQLITE_NULL) {
+ if eType == RBU_INSERT &&
+ (*RbuObjIter)(unsafe.Pointer(pIter)).FzIdx == uintptr(0) && (*RbuObjIter)(unsafe.Pointer(pIter)).FeType == RBU_PK_IPK && *(*U8)(unsafe.Pointer((*RbuObjIter)(unsafe.Pointer(pIter)).FabTblPk + uintptr(i))) != 0 &&
+ Xsqlite3_column_type(tls, (*RbuObjIter)(unsafe.Pointer(pIter)).FpSelect, i) == SQLITE_NULL {
(*Sqlite3rbu)(unsafe.Pointer(p)).Frc = SQLITE_MISMATCH
- (*Sqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, ts+22117 /* "datatype mismatc..." */, 0)
+ (*Sqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, ts+23414 /* "datatype mismatc..." */, 0)
return
}
- if (eType == RBU_DELETE) && (int32(*(*U8)(unsafe.Pointer((*RbuObjIter)(unsafe.Pointer(pIter)).FabTblPk + uintptr(i)))) == 0) {
+ if eType == RBU_DELETE && int32(*(*U8)(unsafe.Pointer((*RbuObjIter)(unsafe.Pointer(pIter)).FabTblPk + uintptr(i)))) == 0 {
continue
}
pVal = Xsqlite3_column_value(tls, (*RbuObjIter)(unsafe.Pointer(pIter)).FpSelect, i)
- (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_bind_value(tls, pWriter, (i + 1), pVal)
+ (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_bind_value(tls, pWriter, i+1, pVal)
if (*Sqlite3rbu)(unsafe.Pointer(p)).Frc != 0 {
return
}
}
if (*RbuObjIter)(unsafe.Pointer(pIter)).FzIdx == uintptr(0) {
- if (((*RbuObjIter)(unsafe.Pointer(pIter)).FeType == RBU_PK_VTAB) ||
- ((*RbuObjIter)(unsafe.Pointer(pIter)).FeType == RBU_PK_NONE)) ||
- (((*RbuObjIter)(unsafe.Pointer(pIter)).FeType == RBU_PK_EXTERNAL) && ((*Sqlite3rbu)(unsafe.Pointer((p))).FzTarget == uintptr(0))) {
+ if (*RbuObjIter)(unsafe.Pointer(pIter)).FeType == RBU_PK_VTAB ||
+ (*RbuObjIter)(unsafe.Pointer(pIter)).FeType == RBU_PK_NONE ||
+ (*RbuObjIter)(unsafe.Pointer(pIter)).FeType == RBU_PK_EXTERNAL && (*Sqlite3rbu)(unsafe.Pointer(p)).FzTarget == uintptr(0) {
// For a virtual table, or a table with no primary key, the
// SELECT statement is:
//
@@ -163291,13 +165575,13 @@ func rbuStepOneOp(tls *libc.TLS, p uintptr, eType int32) { /* sqlite3.c:203389:1
//
// Hence column_value(pIter->nCol+1).
- pVal = Xsqlite3_column_value(tls, (*RbuObjIter)(unsafe.Pointer(pIter)).FpSelect, ((*RbuObjIter)(unsafe.Pointer(pIter)).FnCol + 1))
- (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_bind_value(tls, pWriter, ((*RbuObjIter)(unsafe.Pointer(pIter)).FnCol + 1), pVal)
+ pVal = Xsqlite3_column_value(tls, (*RbuObjIter)(unsafe.Pointer(pIter)).FpSelect, (*RbuObjIter)(unsafe.Pointer(pIter)).FnCol+1)
+ (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_bind_value(tls, pWriter, (*RbuObjIter)(unsafe.Pointer(pIter)).FnCol+1, pVal)
}
}
if (*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK {
Xsqlite3_step(tls, pWriter)
- (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = resetAndCollectError(tls, pWriter, (p + 36 /* &.zErrmsg */))
+ (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = resetAndCollectError(tls, pWriter, p+36)
}
}
@@ -163310,21 +165594,21 @@ func rbuStepOneOp(tls *libc.TLS, p uintptr, eType int32) { /* sqlite3.c:203389:1
// If no error occurs, SQLITE_OK is returned. Otherwise, an error code
// and message is left in the RBU handle and a copy of the error code
// returned.
-func rbuStep(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:203472:12: */
+func rbuStep(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:205188:12: */
bp := tls.Alloc(8)
defer tls.Free(8)
- var pIter uintptr = (p + 48 /* &.objiter */)
+ var pIter uintptr = p + 48
*(*uintptr)(unsafe.Pointer(bp /* zMask */)) = uintptr(0)
var eType int32 = rbuStepType(tls, p, bp /* &zMask */)
if eType != 0 {
- if ((*RbuObjIter)(unsafe.Pointer(pIter)).FzIdx == uintptr(0)) && ((eType == RBU_IDX_DELETE) || (eType == RBU_IDX_INSERT)) {
+ if (*RbuObjIter)(unsafe.Pointer(pIter)).FzIdx == uintptr(0) && (eType == RBU_IDX_DELETE || eType == RBU_IDX_INSERT) {
rbuBadControlError(tls, p)
} else if eType == RBU_REPLACE {
if (*RbuObjIter)(unsafe.Pointer(pIter)).FzIdx == uintptr(0) {
- *(*I64)(unsafe.Pointer(p + 176 /* &.nPhaseOneStep */)) += (I64((*Sqlite3rbu)(unsafe.Pointer(p)).Fobjiter.FnIndex))
+ *(*I64)(unsafe.Pointer(p + 176)) += I64((*Sqlite3rbu)(unsafe.Pointer(p)).Fobjiter.FnIndex)
rbuStepOneOp(tls, p, RBU_DELETE)
}
if (*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK {
@@ -163336,27 +165620,27 @@ func rbuStep(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:203472:12: */
var pVal uintptr
*(*uintptr)(unsafe.Pointer(bp + 4 /* pUpdate */)) = uintptr(0)
- *(*I64)(unsafe.Pointer(p + 176 /* &.nPhaseOneStep */)) -= (I64((*Sqlite3rbu)(unsafe.Pointer(p)).Fobjiter.FnIndex))
+ *(*I64)(unsafe.Pointer(p + 176)) -= I64((*Sqlite3rbu)(unsafe.Pointer(p)).Fobjiter.FnIndex)
rbuGetUpdateStmt(tls, p, pIter, *(*uintptr)(unsafe.Pointer(bp /* zMask */)), bp+4 /* &pUpdate */)
- if *(*uintptr)(unsafe.Pointer(bp + 4 /* pUpdate */)) != 0 {
+ if *(*uintptr)(unsafe.Pointer(bp + 4)) != 0 {
var i int32
- for i = 0; ((*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK) && (i < (*RbuObjIter)(unsafe.Pointer(pIter)).FnCol); i++ {
+ for i = 0; (*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && i < (*RbuObjIter)(unsafe.Pointer(pIter)).FnCol; i++ {
var c uint8 = *(*uint8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* zMask */)) + uintptr(*(*int32)(unsafe.Pointer((*RbuObjIter)(unsafe.Pointer(pIter)).FaiSrcOrder + uintptr(i)*4)))))
pVal = Xsqlite3_column_value(tls, (*RbuObjIter)(unsafe.Pointer(pIter)).FpSelect, i)
- if (*(*U8)(unsafe.Pointer((*RbuObjIter)(unsafe.Pointer(pIter)).FabTblPk + uintptr(i))) != 0) || (int32(c) != '.') {
- (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_bind_value(tls, *(*uintptr)(unsafe.Pointer(bp + 4 /* pUpdate */)), (i + 1), pVal)
+ if *(*U8)(unsafe.Pointer((*RbuObjIter)(unsafe.Pointer(pIter)).FabTblPk + uintptr(i))) != 0 || int32(c) != '.' {
+ (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_bind_value(tls, *(*uintptr)(unsafe.Pointer(bp + 4 /* pUpdate */)), i+1, pVal)
}
}
- if ((*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK) &&
- (((*RbuObjIter)(unsafe.Pointer(pIter)).FeType == RBU_PK_VTAB) || ((*RbuObjIter)(unsafe.Pointer(pIter)).FeType == RBU_PK_NONE)) {
+ if (*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK &&
+ ((*RbuObjIter)(unsafe.Pointer(pIter)).FeType == RBU_PK_VTAB || (*RbuObjIter)(unsafe.Pointer(pIter)).FeType == RBU_PK_NONE) {
// Bind the rbu_rowid value to column _rowid_
- pVal = Xsqlite3_column_value(tls, (*RbuObjIter)(unsafe.Pointer(pIter)).FpSelect, ((*RbuObjIter)(unsafe.Pointer(pIter)).FnCol + 1))
- (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_bind_value(tls, *(*uintptr)(unsafe.Pointer(bp + 4 /* pUpdate */)), ((*RbuObjIter)(unsafe.Pointer(pIter)).FnCol + 1), pVal)
+ pVal = Xsqlite3_column_value(tls, (*RbuObjIter)(unsafe.Pointer(pIter)).FpSelect, (*RbuObjIter)(unsafe.Pointer(pIter)).FnCol+1)
+ (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_bind_value(tls, *(*uintptr)(unsafe.Pointer(bp + 4 /* pUpdate */)), (*RbuObjIter)(unsafe.Pointer(pIter)).FnCol+1, pVal)
}
if (*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK {
Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp + 4 /* pUpdate */)))
- (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = resetAndCollectError(tls, *(*uintptr)(unsafe.Pointer(bp + 4 /* pUpdate */)), (p + 36 /* &.zErrmsg */))
+ (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = resetAndCollectError(tls, *(*uintptr)(unsafe.Pointer(bp + 4 /* pUpdate */)), p+36)
}
}
}
@@ -163369,13 +165653,13 @@ func rbuStep(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:203472:12: */
// Or, if this is an RBU vacuum, set the schema cookie of the main db
// opened by p->dbMain to one more than the schema cookie of the main
// db opened by p->dbRbu.
-func rbuIncrSchemaCookie(tls *libc.TLS, p uintptr) { /* sqlite3.c:203537:13: */
+func rbuIncrSchemaCookie(tls *libc.TLS, p uintptr) { /* sqlite3.c:205253:13: */
bp := tls.Alloc(12)
defer tls.Free(12)
if (*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK {
var dbread uintptr = func() uintptr {
- if (*Sqlite3rbu)(unsafe.Pointer((p))).FzTarget == uintptr(0) {
+ if (*Sqlite3rbu)(unsafe.Pointer(p)).FzTarget == uintptr(0) {
return (*Sqlite3rbu)(unsafe.Pointer(p)).FdbRbu
}
return (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain
@@ -163383,21 +165667,21 @@ func rbuIncrSchemaCookie(tls *libc.TLS, p uintptr) { /* sqlite3.c:203537:13: */
var iCookie int32 = 1000000
// var pStmt uintptr at bp+8, 4
- (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = prepareAndCollectError(tls, dbread, bp+8 /* &pStmt */, (p + 36 /* &.zErrmsg */),
- ts+29556 /* "PRAGMA schema_ve..." */)
+ (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = prepareAndCollectError(tls, dbread, bp+8 /* &pStmt */, p+36,
+ ts+30916 /* "PRAGMA schema_ve..." */)
if (*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK {
// Coverage: it may be that this sqlite3_step() cannot fail. There
// is already a transaction open, so the prepared statement cannot
// throw an SQLITE_SCHEMA exception. The only database page the
// statement reads is page 1, which is guaranteed to be in the cache.
// And no memory allocations are required.
- if SQLITE_ROW == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp + 8 /* pStmt */))) {
+ if SQLITE_ROW == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp + 8))) {
iCookie = Xsqlite3_column_int(tls, *(*uintptr)(unsafe.Pointer(bp + 8 /* pStmt */)), 0)
}
rbuFinalize(tls, p, *(*uintptr)(unsafe.Pointer(bp + 8 /* pStmt */)))
}
if (*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK {
- rbuMPrintfExec(tls, p, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain, ts+29578 /* "PRAGMA schema_ve..." */, libc.VaList(bp, (iCookie+1)))
+ rbuMPrintfExec(tls, p, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain, ts+30938 /* "PRAGMA schema_ve..." */, libc.VaList(bp, iCookie+1))
}
}
}
@@ -163405,25 +165689,25 @@ func rbuIncrSchemaCookie(tls *libc.TLS, p uintptr) { /* sqlite3.c:203537:13: */
// Update the contents of the rbu_state table within the rbu database. The
// value stored in the RBU_STATE_STAGE column is eStage. All other values
// are determined by inspecting the rbu handle passed as the first argument.
-func rbuSaveState(tls *libc.TLS, p uintptr, eStage int32) { /* sqlite3.c:203568:13: */
+func rbuSaveState(tls *libc.TLS, p uintptr, eStage int32) { /* sqlite3.c:205284:13: */
bp := tls.Alloc(172)
defer tls.Free(172)
- if ((*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK) || ((*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_DONE) {
+ if (*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK || (*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_DONE {
*(*uintptr)(unsafe.Pointer(bp + 168 /* pInsert */)) = uintptr(0)
var pFd uintptr = func() uintptr {
- if (*Sqlite3rbu)(unsafe.Pointer((p))).FzTarget == uintptr(0) {
+ if (*Sqlite3rbu)(unsafe.Pointer(p)).FzTarget == uintptr(0) {
return (*Sqlite3rbu)(unsafe.Pointer(p)).FpRbuFd
}
return (*Sqlite3rbu)(unsafe.Pointer(p)).FpTargetFd
}()
var rc int32
- rc = prepareFreeAndCollectError(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbRbu, bp+168 /* &pInsert */, (p + 36 /* &.zErrmsg */),
+ rc = prepareFreeAndCollectError(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbRbu, bp+168 /* &pInsert */, p+36,
Xsqlite3_mprintf(tls,
- ts+29605, /* "INSERT OR REPLAC..." */
- libc.VaList(bp, p+24, /* &.zStateDb */
+ ts+30965, /* "INSERT OR REPLAC..." */
+ libc.VaList(bp, p+24,
RBU_STATE_STAGE, eStage,
RBU_STATE_TBL, (*Sqlite3rbu)(unsafe.Pointer(p)).Fobjiter.FzTbl,
RBU_STATE_IDX, (*Sqlite3rbu)(unsafe.Pointer(p)).Fobjiter.FzIdx,
@@ -163460,16 +165744,16 @@ func rbuSaveState(tls *libc.TLS, p uintptr, eStage int32) { /* sqlite3.c:203568:
//
// In short, it copies the value of the specified PRAGMA setting from
// dbRbu to dbMain.
-func rbuCopyPragma(tls *libc.TLS, p uintptr, zPragma uintptr) { /* sqlite3.c:203629:13: */
+func rbuCopyPragma(tls *libc.TLS, p uintptr, zPragma uintptr) { /* sqlite3.c:205345:13: */
bp := tls.Alloc(28)
defer tls.Free(28)
if (*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK {
*(*uintptr)(unsafe.Pointer(bp + 24 /* pPragma */)) = uintptr(0)
- (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = prepareFreeAndCollectError(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbRbu, bp+24 /* &pPragma */, (p + 36 /* &.zErrmsg */),
- Xsqlite3_mprintf(tls, ts+29763 /* "PRAGMA main.%s" */, libc.VaList(bp, zPragma)))
- if ((*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK) && (SQLITE_ROW == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp + 24 /* pPragma */)))) {
- (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = rbuMPrintfExec(tls, p, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain, ts+29778, /* "PRAGMA main.%s =..." */
+ (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = prepareFreeAndCollectError(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbRbu, bp+24 /* &pPragma */, p+36,
+ Xsqlite3_mprintf(tls, ts+31123 /* "PRAGMA main.%s" */, libc.VaList(bp, zPragma)))
+ if (*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && SQLITE_ROW == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp + 24))) {
+ (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = rbuMPrintfExec(tls, p, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain, ts+31138, /* "PRAGMA main.%s =..." */
libc.VaList(bp+8, zPragma, Xsqlite3_column_int(tls, *(*uintptr)(unsafe.Pointer(bp + 24 /* pPragma */)), 0)))
}
rbuFinalize(tls, p, *(*uintptr)(unsafe.Pointer(bp + 24 /* pPragma */)))
@@ -163479,23 +165763,23 @@ func rbuCopyPragma(tls *libc.TLS, p uintptr, zPragma uintptr) { /* sqlite3.c:203
// The RBU handle passed as the only argument has just been opened and
// the state database is empty. If this RBU handle was opened for an
// RBU vacuum operation, create the schema in the target db.
-func rbuCreateTargetSchema(tls *libc.TLS, p uintptr) { /* sqlite3.c:203649:13: */
+func rbuCreateTargetSchema(tls *libc.TLS, p uintptr) { /* sqlite3.c:205365:13: */
bp := tls.Alloc(8)
defer tls.Free(8)
*(*uintptr)(unsafe.Pointer(bp /* pSql */)) = uintptr(0)
*(*uintptr)(unsafe.Pointer(bp + 4 /* pInsert */)) = uintptr(0)
- (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain, ts+29798 /* "PRAGMA writable_..." */, uintptr(0), uintptr(0), (p + 36 /* &.zErrmsg */))
+ (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain, ts+31158 /* "PRAGMA writable_..." */, uintptr(0), uintptr(0), p+36)
if (*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK {
- (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = prepareAndCollectError(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbRbu, bp /* &pSql */, (p + 36 /* &.zErrmsg */),
+ (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = prepareAndCollectError(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbRbu, bp /* &pSql */, p+36,
- ts+29823 /* "SELECT sql FROM ..." */)
+ ts+31183 /* "SELECT sql FROM ..." */)
}
- for ((*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK) && (Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp /* pSql */))) == SQLITE_ROW) {
+ for (*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp))) == SQLITE_ROW {
var zSql uintptr = Xsqlite3_column_text(tls, *(*uintptr)(unsafe.Pointer(bp /* pSql */)), 0)
- (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain, zSql, uintptr(0), uintptr(0), (p + 36 /* &.zErrmsg */))
+ (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain, zSql, uintptr(0), uintptr(0), p+36)
}
rbuFinalize(tls, p, *(*uintptr)(unsafe.Pointer(bp /* pSql */)))
if (*Sqlite3rbu)(unsafe.Pointer(p)).Frc != SQLITE_OK {
@@ -163503,25 +165787,25 @@ func rbuCreateTargetSchema(tls *libc.TLS, p uintptr) { /* sqlite3.c:203649:13: *
}
if (*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK {
- (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = prepareAndCollectError(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbRbu, bp /* &pSql */, (p + 36 /* &.zErrmsg */),
- ts+29931 /* "SELECT * FROM sq..." */)
+ (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = prepareAndCollectError(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbRbu, bp /* &pSql */, p+36,
+ ts+31291 /* "SELECT * FROM sq..." */)
}
if (*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK {
- (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = prepareAndCollectError(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp+4 /* &pInsert */, (p + 36 /* &.zErrmsg */),
- ts+29996 /* "INSERT INTO sqli..." */)
+ (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = prepareAndCollectError(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp+4 /* &pInsert */, p+36,
+ ts+31356 /* "INSERT INTO sqli..." */)
}
- for ((*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK) && (Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp /* pSql */))) == SQLITE_ROW) {
+ for (*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp))) == SQLITE_ROW {
var i int32
for i = 0; i < 5; i++ {
- Xsqlite3_bind_value(tls, *(*uintptr)(unsafe.Pointer(bp + 4 /* pInsert */)), (i + 1), Xsqlite3_column_value(tls, *(*uintptr)(unsafe.Pointer(bp /* pSql */)), i))
+ Xsqlite3_bind_value(tls, *(*uintptr)(unsafe.Pointer(bp + 4 /* pInsert */)), i+1, Xsqlite3_column_value(tls, *(*uintptr)(unsafe.Pointer(bp /* pSql */)), i))
}
Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp + 4 /* pInsert */)))
(*Sqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_reset(tls, *(*uintptr)(unsafe.Pointer(bp + 4 /* pInsert */)))
}
if (*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK {
- (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain, ts+30040 /* "PRAGMA writable_..." */, uintptr(0), uintptr(0), (p + 36 /* &.zErrmsg */))
+ (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain, ts+31400 /* "PRAGMA writable_..." */, uintptr(0), uintptr(0), p+36)
}
rbuFinalize(tls, p, *(*uintptr)(unsafe.Pointer(bp /* pSql */)))
@@ -163529,7 +165813,7 @@ func rbuCreateTargetSchema(tls *libc.TLS, p uintptr) { /* sqlite3.c:203649:13: *
}
// Step the RBU object.
-func Xsqlite3rbu_step(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:203701:16: */
+func Xsqlite3rbu_step(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:205417:16: */
bp := tls.Alloc(20)
defer tls.Free(20)
@@ -163537,25 +165821,25 @@ func Xsqlite3rbu_step(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:203701:16:
switch (*Sqlite3rbu)(unsafe.Pointer(p)).FeStage {
case RBU_STAGE_OAL:
{
- var pIter uintptr = (p + 48 /* &.objiter */)
+ var pIter uintptr = p + 48
// If this is an RBU vacuum operation and the state table was empty
// when this handle was opened, create the target database schema.
- if (((*Sqlite3rbu)(unsafe.Pointer((p))).FzTarget == uintptr(0)) && ((*Sqlite3rbu)(unsafe.Pointer(p)).FnProgress == 0)) && ((*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK) {
+ if (*Sqlite3rbu)(unsafe.Pointer(p)).FzTarget == uintptr(0) && (*Sqlite3rbu)(unsafe.Pointer(p)).FnProgress == 0 && (*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK {
rbuCreateTargetSchema(tls, p)
- rbuCopyPragma(tls, p, ts+15723 /* "user_version" */)
- rbuCopyPragma(tls, p, ts+14845 /* "application_id" */)
+ rbuCopyPragma(tls, p, ts+16938 /* "user_version" */)
+ rbuCopyPragma(tls, p, ts+16049 /* "application_id" */)
}
- for ((*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK) && ((*RbuObjIter)(unsafe.Pointer(pIter)).FzTbl != 0) {
+ for (*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && (*RbuObjIter)(unsafe.Pointer(pIter)).FzTbl != 0 {
if (*RbuObjIter)(unsafe.Pointer(pIter)).FbCleanup != 0 {
// Clean up the rbu_tmp_xxx table for the previous table. It
// cannot be dropped as there are currently active SQL statements.
// But the contents can be deleted.
- if ((libc.Bool32((*Sqlite3rbu)(unsafe.Pointer((p))).FzTarget == uintptr(0))) == 0) && ((*RbuObjIter)(unsafe.Pointer(pIter)).FabIndexed != 0) {
+ if libc.Bool32((*Sqlite3rbu)(unsafe.Pointer(p)).FzTarget == uintptr(0)) == 0 && (*RbuObjIter)(unsafe.Pointer(pIter)).FabIndexed != 0 {
rbuMPrintfExec(tls, p, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbRbu,
- ts+30065 /* "DELETE FROM %s.'..." */, libc.VaList(bp, p+24 /* &.zStateDb */, (*RbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl))
+ ts+31425 /* "DELETE FROM %s.'..." */, libc.VaList(bp, p+24, (*RbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl))
}
} else {
rbuObjIterPrepareAll(tls, p, pIter, 0)
@@ -163581,10 +165865,10 @@ func Xsqlite3rbu_step(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:203701:16:
rbuSaveState(tls, p, RBU_STAGE_MOVE)
rbuIncrSchemaCookie(tls, p)
if (*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK {
- (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain, ts+13228 /* "COMMIT" */, uintptr(0), uintptr(0), (p + 36 /* &.zErrmsg */))
+ (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain, ts+14411 /* "COMMIT" */, uintptr(0), uintptr(0), p+36)
}
if (*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK {
- (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbRbu, ts+13228 /* "COMMIT" */, uintptr(0), uintptr(0), (p + 36 /* &.zErrmsg */))
+ (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbRbu, ts+14411 /* "COMMIT" */, uintptr(0), uintptr(0), p+36)
}
(*Sqlite3rbu)(unsafe.Pointer(p)).FeStage = RBU_STAGE_MOVE
}
@@ -163621,9 +165905,9 @@ func Xsqlite3rbu_step(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:203701:16:
(*Sqlite3rbu)(unsafe.Pointer(p)).Frc = (*struct {
f func(*libc.TLS, uintptr, int32, int32, int32, uintptr) int32
- })(unsafe.Pointer(&struct{ uintptr }{(*sqlite3_io_methods)(unsafe.Pointer((*Sqlite3_file)(unsafe.Pointer(pDb)).FpMethods)).FxShmMap})).f(tls, pDb, 0, (32 * 1024), 0, bp+16 /* &ptr */)
+ })(unsafe.Pointer(&struct{ uintptr }{(*sqlite3_io_methods)(unsafe.Pointer((*Sqlite3_file)(unsafe.Pointer(pDb)).FpMethods)).FxShmMap})).f(tls, pDb, 0, 32*1024, 0, bp+16 /* &ptr */)
if (*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK {
- *(*U32)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(bp + 16 /* ptr */))) + 24*4)) = (*Sqlite3rbu)(unsafe.Pointer(p)).FiMaxFrame
+ *(*U32)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16)) + 24*4)) = (*Sqlite3rbu)(unsafe.Pointer(p)).FiMaxFrame
}
}
@@ -163643,11 +165927,11 @@ func Xsqlite3rbu_step(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:203701:16:
// this by checkpointing frames until the next page in the aFrame[]
// lies on a different disk sector to the current one.
var iSector U32
- for ok := true; ok; ok = ((((*Sqlite3rbu)(unsafe.Pointer(p)).FnStep < (*Sqlite3rbu)(unsafe.Pointer(p)).FnFrame) &&
- (iSector == (((*RbuFrame)(unsafe.Pointer((*Sqlite3rbu)(unsafe.Pointer(p)).FaFrame+uintptr((*Sqlite3rbu)(unsafe.Pointer(p)).FnStep)*8)).FiDbPage - U32(1)) / U32((*Sqlite3rbu)(unsafe.Pointer(p)).FnPagePerSector)))) &&
- ((*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK)) {
- var pFrame uintptr = ((*Sqlite3rbu)(unsafe.Pointer(p)).FaFrame + uintptr((*Sqlite3rbu)(unsafe.Pointer(p)).FnStep)*8)
- iSector = (((*RbuFrame)(unsafe.Pointer(pFrame)).FiDbPage - U32(1)) / U32((*Sqlite3rbu)(unsafe.Pointer(p)).FnPagePerSector))
+ for ok := true; ok; ok = (*Sqlite3rbu)(unsafe.Pointer(p)).FnStep < (*Sqlite3rbu)(unsafe.Pointer(p)).FnFrame &&
+ iSector == ((*RbuFrame)(unsafe.Pointer((*Sqlite3rbu)(unsafe.Pointer(p)).FaFrame+uintptr((*Sqlite3rbu)(unsafe.Pointer(p)).FnStep)*8)).FiDbPage-U32(1))/U32((*Sqlite3rbu)(unsafe.Pointer(p)).FnPagePerSector) &&
+ (*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK {
+ var pFrame uintptr = (*Sqlite3rbu)(unsafe.Pointer(p)).FaFrame + uintptr((*Sqlite3rbu)(unsafe.Pointer(p)).FnStep)*8
+ iSector = ((*RbuFrame)(unsafe.Pointer(pFrame)).FiDbPage - U32(1)) / U32((*Sqlite3rbu)(unsafe.Pointer(p)).FnPagePerSector)
rbuCheckpointFrame(tls, p, pFrame)
(*Sqlite3rbu)(unsafe.Pointer(p)).FnStep++
}
@@ -163672,14 +165956,14 @@ func Xsqlite3rbu_step(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:203701:16:
// Compare strings z1 and z2, returning 0 if they are identical, or non-zero
// otherwise. Either or both argument may be NULL. Two NULL values are
// considered equal, and NULL is considered distinct from all other values.
-func rbuStrCompare(tls *libc.TLS, z1 uintptr, z2 uintptr) int32 { /* sqlite3.c:203830:12: */
- if (z1 == uintptr(0)) && (z2 == uintptr(0)) {
+func rbuStrCompare(tls *libc.TLS, z1 uintptr, z2 uintptr) int32 { /* sqlite3.c:205546:12: */
+ if z1 == uintptr(0) && z2 == uintptr(0) {
return 0
}
- if (z1 == uintptr(0)) || (z2 == uintptr(0)) {
+ if z1 == uintptr(0) || z2 == uintptr(0) {
return 1
}
- return (libc.Bool32(Xsqlite3_stricmp(tls, z1, z2) != 0))
+ return libc.Bool32(Xsqlite3_stricmp(tls, z1, z2) != 0)
}
// This function is called as part of sqlite3rbu_open() when initializing
@@ -163690,27 +165974,27 @@ func rbuStrCompare(tls *libc.TLS, z1 uintptr, z2 uintptr) int32 { /* sqlite3.c:2
//
// If an error occurs, an error code and error message are left in the
// rbu handle passed as the first argument.
-func rbuSetupOal(tls *libc.TLS, p uintptr, pState uintptr) { /* sqlite3.c:203846:13: */
+func rbuSetupOal(tls *libc.TLS, p uintptr, pState uintptr) { /* sqlite3.c:205562:13: */
if (*RbuState)(unsafe.Pointer(pState)).FzTbl != 0 {
- var pIter uintptr = (p + 48 /* &.objiter */)
+ var pIter uintptr = p + 48
var rc int32 = SQLITE_OK
- for ((rc == SQLITE_OK) && ((*RbuObjIter)(unsafe.Pointer(pIter)).FzTbl != 0)) && (((((*RbuObjIter)(unsafe.Pointer(pIter)).FbCleanup != 0) ||
- (rbuStrCompare(tls, (*RbuObjIter)(unsafe.Pointer(pIter)).FzIdx, (*RbuState)(unsafe.Pointer(pState)).FzIdx) != 0)) ||
- (((*RbuState)(unsafe.Pointer(pState)).FzDataTbl == uintptr(0)) && (rbuStrCompare(tls, (*RbuObjIter)(unsafe.Pointer(pIter)).FzTbl, (*RbuState)(unsafe.Pointer(pState)).FzTbl) != 0))) ||
- (((*RbuState)(unsafe.Pointer(pState)).FzDataTbl != 0) && (rbuStrCompare(tls, (*RbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, (*RbuState)(unsafe.Pointer(pState)).FzDataTbl) != 0))) {
+ for rc == SQLITE_OK && (*RbuObjIter)(unsafe.Pointer(pIter)).FzTbl != 0 && ((*RbuObjIter)(unsafe.Pointer(pIter)).FbCleanup != 0 ||
+ rbuStrCompare(tls, (*RbuObjIter)(unsafe.Pointer(pIter)).FzIdx, (*RbuState)(unsafe.Pointer(pState)).FzIdx) != 0 ||
+ (*RbuState)(unsafe.Pointer(pState)).FzDataTbl == uintptr(0) && rbuStrCompare(tls, (*RbuObjIter)(unsafe.Pointer(pIter)).FzTbl, (*RbuState)(unsafe.Pointer(pState)).FzTbl) != 0 ||
+ (*RbuState)(unsafe.Pointer(pState)).FzDataTbl != 0 && rbuStrCompare(tls, (*RbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, (*RbuState)(unsafe.Pointer(pState)).FzDataTbl) != 0) {
rc = rbuObjIterNext(tls, p, pIter)
}
- if (rc == SQLITE_OK) && !(int32((*RbuObjIter)(unsafe.Pointer(pIter)).FzTbl) != 0) {
+ if rc == SQLITE_OK && !(int32((*RbuObjIter)(unsafe.Pointer(pIter)).FzTbl) != 0) {
rc = SQLITE_ERROR
- (*Sqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, ts+30093 /* "rbu_state mismat..." */, 0)
+ (*Sqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, ts+31453 /* "rbu_state mismat..." */, 0)
}
if rc == SQLITE_OK {
(*Sqlite3rbu)(unsafe.Pointer(p)).FnStep = (*RbuState)(unsafe.Pointer(pState)).FnRow
- rc = rbuObjIterPrepareAll(tls, p, (p + 48 /* &.objiter */), (*Sqlite3rbu)(unsafe.Pointer(p)).FnStep)
+ rc = rbuObjIterPrepareAll(tls, p, p+48, (*Sqlite3rbu)(unsafe.Pointer(p)).FnStep)
}
(*Sqlite3rbu)(unsafe.Pointer(p)).Frc = rc
@@ -163720,11 +166004,11 @@ func rbuSetupOal(tls *libc.TLS, p uintptr, pState uintptr) { /* sqlite3.c:203846
// If there is a "*-oal" file in the file-system corresponding to the
// target database in the file-system, delete it. If an error occurs,
// leave an error code and error message in the rbu handle.
-func rbuDeleteOalFile(tls *libc.TLS, p uintptr) { /* sqlite3.c:203879:13: */
+func rbuDeleteOalFile(tls *libc.TLS, p uintptr) { /* sqlite3.c:205595:13: */
bp := tls.Alloc(8)
defer tls.Free(8)
- var zOal uintptr = rbuMPrintf(tls, p, ts+29542 /* "%s-oal" */, libc.VaList(bp, (*Sqlite3rbu)(unsafe.Pointer(p)).FzTarget))
+ var zOal uintptr = rbuMPrintf(tls, p, ts+30902 /* "%s-oal" */, libc.VaList(bp, (*Sqlite3rbu)(unsafe.Pointer(p)).FzTarget))
if zOal != 0 {
var pVfs uintptr = Xsqlite3_vfs_find(tls, uintptr(0))
@@ -163739,7 +166023,7 @@ func rbuDeleteOalFile(tls *libc.TLS, p uintptr) { /* sqlite3.c:203879:13: */
// argument. This VFS will be used unless the call to sqlite3rbu_open()
// specified a URI with a vfs=? option in place of a target database
// file name.
-func rbuCreateVfs(tls *libc.TLS, p uintptr) { /* sqlite3.c:203895:13: */
+func rbuCreateVfs(tls *libc.TLS, p uintptr) { /* sqlite3.c:205611:13: */
bp := tls.Alloc(76)
defer tls.Free(76)
@@ -163748,7 +166032,7 @@ func rbuCreateVfs(tls *libc.TLS, p uintptr) { /* sqlite3.c:203895:13: */
// var zRnd [64]uint8 at bp+12, 64
Xsqlite3_randomness(tls, int32(unsafe.Sizeof(int32(0))), bp+8 /* &rnd */)
- Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([64]uint8{})), bp+12 /* &zRnd[0] */, ts+30118 /* "rbu_vfs_%d" */, libc.VaList(bp, *(*int32)(unsafe.Pointer(bp + 8 /* rnd */))))
+ Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([64]uint8{})), bp+12 /* &zRnd[0] */, ts+31478 /* "rbu_vfs_%d" */, libc.VaList(bp, *(*int32)(unsafe.Pointer(bp + 8 /* rnd */))))
(*Sqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3rbu_create_vfs(tls, bp+12 /* &zRnd[0] */, uintptr(0))
if (*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK {
var pVfs uintptr = Xsqlite3_vfs_find(tls, bp+12 /* &zRnd[0] */)
@@ -163760,7 +166044,7 @@ func rbuCreateVfs(tls *libc.TLS, p uintptr) { /* sqlite3.c:203895:13: */
// Destroy the private VFS created for the rbu handle passed as the only
// argument by an earlier call to rbuCreateVfs().
-func rbuDeleteVfs(tls *libc.TLS, p uintptr) { /* sqlite3.c:203915:13: */
+func rbuDeleteVfs(tls *libc.TLS, p uintptr) { /* sqlite3.c:205631:13: */
if (*Sqlite3rbu)(unsafe.Pointer(p)).FzVfsName != 0 {
Xsqlite3rbu_destroy_vfs(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FzVfsName)
(*Sqlite3rbu)(unsafe.Pointer(p)).FzVfsName = uintptr(0)
@@ -163770,7 +166054,7 @@ func rbuDeleteVfs(tls *libc.TLS, p uintptr) { /* sqlite3.c:203915:13: */
// This user-defined SQL function is invoked with a single argument - the
// name of a table expected to appear in the target database. It returns
// the number of auxilliary indexes on the table.
-func rbuIndexCntFunc(tls *libc.TLS, pCtx uintptr, nVal int32, apVal uintptr) { /* sqlite3.c:203927:13: */
+func rbuIndexCntFunc(tls *libc.TLS, pCtx uintptr, nVal int32, apVal uintptr) { /* sqlite3.c:205643:13: */
bp := tls.Alloc(16)
defer tls.Free(16)
@@ -163779,7 +166063,7 @@ func rbuIndexCntFunc(tls *libc.TLS, pCtx uintptr, nVal int32, apVal uintptr) { /
*(*uintptr)(unsafe.Pointer(bp + 12 /* zErrmsg */)) = uintptr(0)
var rc int32
var db uintptr = func() uintptr {
- if (*Sqlite3rbu)(unsafe.Pointer((p))).FzTarget == uintptr(0) {
+ if (*Sqlite3rbu)(unsafe.Pointer(p)).FzTarget == uintptr(0) {
return (*Sqlite3rbu)(unsafe.Pointer(p)).FdbRbu
}
return (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain
@@ -163787,12 +166071,12 @@ func rbuIndexCntFunc(tls *libc.TLS, pCtx uintptr, nVal int32, apVal uintptr) { /
rc = prepareFreeAndCollectError(tls, db, bp+8 /* &pStmt */, bp+12, /* &zErrmsg */
Xsqlite3_mprintf(tls,
- ts+30129 /* "SELECT count(*) ..." */, libc.VaList(bp, Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(apVal))))))
+ ts+31489 /* "SELECT count(*) ..." */, libc.VaList(bp, Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(apVal))))))
if rc != SQLITE_OK {
Xsqlite3_result_error(tls, pCtx, *(*uintptr)(unsafe.Pointer(bp + 12 /* zErrmsg */)), -1)
} else {
var nIndex int32 = 0
- if SQLITE_ROW == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp + 8 /* pStmt */))) {
+ if SQLITE_ROW == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp + 8))) {
nIndex = Xsqlite3_column_int(tls, *(*uintptr)(unsafe.Pointer(bp + 8 /* pStmt */)), 0)
}
rc = Xsqlite3_finalize(tls, *(*uintptr)(unsafe.Pointer(bp + 8 /* pStmt */)))
@@ -163819,7 +166103,7 @@ func rbuIndexCntFunc(tls *libc.TLS, pCtx uintptr, nVal int32, apVal uintptr) { /
// sqlite3rbu.nPhaseOneStep is initialized to the sum of (1 + nIndex) * cnt
// for all rows in the rbu_count table, where nIndex is the number of
// indexes on the corresponding target database table.
-func rbuInitPhaseOneSteps(tls *libc.TLS, p uintptr) { /* sqlite3.c:203977:13: */
+func rbuInitPhaseOneSteps(tls *libc.TLS, p uintptr) { /* sqlite3.c:205693:13: */
bp := tls.Alloc(4)
defer tls.Free(4)
@@ -163830,29 +166114,29 @@ func rbuInitPhaseOneSteps(tls *libc.TLS, p uintptr) { /* sqlite3.c:203977:13: */
(*Sqlite3rbu)(unsafe.Pointer(p)).FnPhaseOneStep = int64(-1)
(*Sqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_create_function(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbRbu,
- ts+30201 /* "rbu_index_cnt" */, 1, SQLITE_UTF8, p, *(*uintptr)(unsafe.Pointer(&struct {
+ ts+31561 /* "rbu_index_cnt" */, 1, SQLITE_UTF8, p, *(*uintptr)(unsafe.Pointer(&struct {
f func(*libc.TLS, uintptr, int32, uintptr)
}{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 (*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK {
- (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = prepareAndCollectError(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbRbu, bp /* &pStmt */, (p + 36 /* &.zErrmsg */),
- ts+30215 /* "SELECT 1 FROM sq..." */)
+ (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = prepareAndCollectError(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbRbu, bp /* &pStmt */, p+36,
+ ts+31575 /* "SELECT 1 FROM sq..." */)
}
if (*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK {
- if SQLITE_ROW == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp /* pStmt */))) {
+ if SQLITE_ROW == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp))) {
bExists = 1
}
(*Sqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_finalize(tls, *(*uintptr)(unsafe.Pointer(bp /* pStmt */)))
}
- if ((*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK) && (bExists != 0) {
- (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = prepareAndCollectError(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbRbu, bp /* &pStmt */, (p + 36 /* &.zErrmsg */),
+ if (*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && bExists != 0 {
+ (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = prepareAndCollectError(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbRbu, bp /* &pStmt */, p+36,
- ts+30272 /* "SELECT sum(cnt *..." */)
+ ts+31632 /* "SELECT sum(cnt *..." */)
if (*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK {
- if SQLITE_ROW == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp /* pStmt */))) {
+ if SQLITE_ROW == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp))) {
(*Sqlite3rbu)(unsafe.Pointer(p)).FnPhaseOneStep = Xsqlite3_column_int64(tls, *(*uintptr)(unsafe.Pointer(bp /* pStmt */)), 0)
}
(*Sqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_finalize(tls, *(*uintptr)(unsafe.Pointer(bp /* pStmt */)))
@@ -163861,7 +166145,7 @@ func rbuInitPhaseOneSteps(tls *libc.TLS, p uintptr) { /* sqlite3.c:203977:13: */
}
}
-func openRbuHandle(tls *libc.TLS, zTarget uintptr, zRbu uintptr, zState uintptr) uintptr { /* sqlite3.c:204018:19: */
+func openRbuHandle(tls *libc.TLS, zTarget uintptr, zRbu uintptr, zState uintptr) uintptr { /* sqlite3.c:205734:19: */
bp := tls.Alloc(20)
defer tls.Free(20)
@@ -163873,7 +166157,7 @@ func openRbuHandle(tls *libc.TLS, zTarget uintptr, zRbu uintptr, zState uintptr)
nTarget = uint32(0)
}
var nRbu Size_t = libc.Xstrlen(tls, zRbu)
- var nByte Size_t = ((((uint32(unsafe.Sizeof(Sqlite3rbu{})) + nTarget) + uint32(1)) + nRbu) + uint32(1))
+ var nByte Size_t = uint32(unsafe.Sizeof(Sqlite3rbu{})) + nTarget + uint32(1) + nRbu + uint32(1)
p = Xsqlite3_malloc64(tls, uint64(nByte))
if p != 0 {
@@ -163885,18 +166169,18 @@ func openRbuHandle(tls *libc.TLS, zTarget uintptr, zRbu uintptr, zState uintptr)
// Open the target, RBU and state databases
if (*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK {
- var pCsr uintptr = (p + 1*248)
+ var pCsr uintptr = p + 1*248
*(*int32)(unsafe.Pointer(bp + 16 /* bRetry */)) = 0
if zTarget != 0 {
(*Sqlite3rbu)(unsafe.Pointer(p)).FzTarget = pCsr
- libc.Xmemcpy(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FzTarget, zTarget, (nTarget + Size_t(1)))
- pCsr += (uintptr(nTarget + Size_t(1)))
+ libc.Xmemcpy(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FzTarget, zTarget, nTarget+Size_t(1))
+ pCsr += uintptr(nTarget + Size_t(1))
}
(*Sqlite3rbu)(unsafe.Pointer(p)).FzRbu = pCsr
- libc.Xmemcpy(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FzRbu, zRbu, (nRbu + Size_t(1)))
- pCsr += (uintptr(nRbu + Size_t(1)))
+ libc.Xmemcpy(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FzRbu, zRbu, nRbu+Size_t(1))
+ pCsr += uintptr(nRbu + Size_t(1))
if zState != 0 {
- (*Sqlite3rbu)(unsafe.Pointer(p)).FzState = rbuMPrintf(tls, p, ts+2790 /* "%s" */, libc.VaList(bp, zState))
+ (*Sqlite3rbu)(unsafe.Pointer(p)).FzState = rbuMPrintf(tls, p, ts+3601 /* "%s" */, libc.VaList(bp, zState))
}
// If the first attempt to open the database file fails and the bRetry
@@ -163906,9 +166190,9 @@ func openRbuHandle(tls *libc.TLS, zTarget uintptr, zRbu uintptr, zState uintptr)
// If this is the case, it will have been checkpointed and deleted
// when the handle was closed and a second attempt to open the
// database may succeed.
- rbuOpenDatabase(tls, p, bp+16 /* &bRetry */)
- if *(*int32)(unsafe.Pointer(bp + 16 /* bRetry */)) != 0 {
- rbuOpenDatabase(tls, p, uintptr(0))
+ rbuOpenDatabase(tls, p, uintptr(0), bp+16 /* &bRetry */)
+ if *(*int32)(unsafe.Pointer(bp + 16)) != 0 {
+ rbuOpenDatabase(tls, p, uintptr(0), uintptr(0))
}
}
@@ -163930,21 +166214,21 @@ func openRbuHandle(tls *libc.TLS, zTarget uintptr, zRbu uintptr, zState uintptr)
}
}
- if ((*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK) && ((*Rbu_file)(unsafe.Pointer((*Sqlite3rbu)(unsafe.Pointer(p)).FpTargetFd)).FpWalFd != 0) {
+ if (*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && (*Rbu_file)(unsafe.Pointer((*Sqlite3rbu)(unsafe.Pointer(p)).FpTargetFd)).FpWalFd != 0 {
if (*Sqlite3rbu)(unsafe.Pointer(p)).FeStage == RBU_STAGE_OAL {
(*Sqlite3rbu)(unsafe.Pointer(p)).Frc = SQLITE_ERROR
- (*Sqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, ts+30346 /* "cannot update wa..." */, 0)
+ (*Sqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, ts+31706 /* "cannot update wa..." */, 0)
} else if (*Sqlite3rbu)(unsafe.Pointer(p)).FeStage == RBU_STAGE_MOVE {
(*Sqlite3rbu)(unsafe.Pointer(p)).FeStage = RBU_STAGE_CKPT
(*Sqlite3rbu)(unsafe.Pointer(p)).FnStep = 0
}
}
- if (((*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK) &&
- (((*Sqlite3rbu)(unsafe.Pointer(p)).FeStage == RBU_STAGE_OAL) || ((*Sqlite3rbu)(unsafe.Pointer(p)).FeStage == RBU_STAGE_MOVE))) &&
- ((*RbuState)(unsafe.Pointer(pState)).FeStage != 0) {
+ if (*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK &&
+ ((*Sqlite3rbu)(unsafe.Pointer(p)).FeStage == RBU_STAGE_OAL || (*Sqlite3rbu)(unsafe.Pointer(p)).FeStage == RBU_STAGE_MOVE) &&
+ (*RbuState)(unsafe.Pointer(pState)).FeStage != 0 {
var pFd uintptr = func() uintptr {
- if (*Sqlite3rbu)(unsafe.Pointer((p))).FzTarget == uintptr(0) {
+ if (*Sqlite3rbu)(unsafe.Pointer(p)).FzTarget == uintptr(0) {
return (*Sqlite3rbu)(unsafe.Pointer(p)).FpRbuFd
}
return (*Sqlite3rbu)(unsafe.Pointer(p)).FpTargetFd
@@ -163955,12 +166239,12 @@ func openRbuHandle(tls *libc.TLS, zTarget uintptr, zRbu uintptr, zState uintptr)
// transaction is committed in rollback mode) currently stored on
// page 1 of the database file.
(*Sqlite3rbu)(unsafe.Pointer(p)).Frc = SQLITE_BUSY
- (*Sqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, ts+30378, /* "database modifie..." */
+ (*Sqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, ts+31738, /* "database modifie..." */
libc.VaList(bp+8, func() uintptr {
- if (*Sqlite3rbu)(unsafe.Pointer((p))).FzTarget == uintptr(0) {
- return ts + 30410 /* "vacuum" */
+ if (*Sqlite3rbu)(unsafe.Pointer(p)).FzTarget == uintptr(0) {
+ return ts + 31770 /* "vacuum" */
}
- return ts + 30417 /* "update" */
+ return ts + 31777 /* "update" */
}()))
}
}
@@ -163968,38 +166252,38 @@ func openRbuHandle(tls *libc.TLS, zTarget uintptr, zRbu uintptr, zState uintptr)
if (*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK {
if (*Sqlite3rbu)(unsafe.Pointer(p)).FeStage == RBU_STAGE_OAL {
var db uintptr = (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain
- (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbRbu, ts+13213 /* "BEGIN" */, uintptr(0), uintptr(0), (p + 36 /* &.zErrmsg */))
+ (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbRbu, ts+14396 /* "BEGIN" */, uintptr(0), uintptr(0), p+36)
// Point the object iterator at the first object
if (*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK {
- (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = rbuObjIterFirst(tls, p, (p + 48 /* &.objiter */))
+ (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = rbuObjIterFirst(tls, p, p+48)
}
// If the RBU database contains no data_xxx tables, declare the RBU
// update finished.
- if ((*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK) && ((*Sqlite3rbu)(unsafe.Pointer(p)).Fobjiter.FzTbl == uintptr(0)) {
+ if (*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && (*Sqlite3rbu)(unsafe.Pointer(p)).Fobjiter.FzTbl == uintptr(0) {
(*Sqlite3rbu)(unsafe.Pointer(p)).Frc = SQLITE_DONE
(*Sqlite3rbu)(unsafe.Pointer(p)).FeStage = RBU_STAGE_DONE
} else {
- if (((*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK) && ((*RbuState)(unsafe.Pointer(pState)).FeStage == 0)) && ((*Sqlite3rbu)(unsafe.Pointer((p))).FzTarget == uintptr(0)) {
- rbuCopyPragma(tls, p, ts+15448 /* "page_size" */)
- rbuCopyPragma(tls, p, ts+14860 /* "auto_vacuum" */)
+ if (*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && (*RbuState)(unsafe.Pointer(pState)).FeStage == 0 && (*Sqlite3rbu)(unsafe.Pointer(p)).FzTarget == uintptr(0) {
+ rbuCopyPragma(tls, p, ts+16652 /* "page_size" */)
+ rbuCopyPragma(tls, p, ts+16064 /* "auto_vacuum" */)
}
// Open transactions both databases. The *-oal file is opened or
// created at this point.
if (*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK {
- (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, db, ts+30424 /* "BEGIN IMMEDIATE" */, uintptr(0), uintptr(0), (p + 36 /* &.zErrmsg */))
+ (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, db, ts+31784 /* "BEGIN IMMEDIATE" */, uintptr(0), uintptr(0), p+36)
}
// Check if the main database is a zipvfs db. If it is, set the upper
// level pager to use "journal_mode=off". This prevents it from
// generating a large journal using a temp file.
if (*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK {
- var frc int32 = Xsqlite3_file_control(tls, db, ts+5458 /* "main" */, SQLITE_FCNTL_ZIPVFS, uintptr(0))
+ var frc int32 = Xsqlite3_file_control(tls, db, ts+6305 /* "main" */, SQLITE_FCNTL_ZIPVFS, uintptr(0))
if frc == SQLITE_OK {
(*Sqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls,
- db, ts+30440 /* "PRAGMA journal_m..." */, uintptr(0), uintptr(0), (p + 36 /* &.zErrmsg */))
+ db, ts+31800 /* "PRAGMA journal_m..." */, uintptr(0), uintptr(0), p+36)
}
}
@@ -164010,6 +166294,14 @@ func openRbuHandle(tls *libc.TLS, zTarget uintptr, zRbu uintptr, zState uintptr)
} else if (*Sqlite3rbu)(unsafe.Pointer(p)).FeStage == RBU_STAGE_MOVE {
// no-op
} else if (*Sqlite3rbu)(unsafe.Pointer(p)).FeStage == RBU_STAGE_CKPT {
+ if !((*Sqlite3rbu)(unsafe.Pointer(p)).FzTarget == uintptr(0)) && rbuExclusiveCheckpoint(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain) != 0 {
+ // If the rbu_exclusive_checkpoint=1 URI parameter was specified
+ // and an incremental checkpoint is being resumed, attempt an
+ // exclusive lock on the db file. If this fails, so be it.
+ (*Sqlite3rbu)(unsafe.Pointer(p)).FeStage = RBU_STAGE_DONE
+ rbuLockDatabase(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain)
+ (*Sqlite3rbu)(unsafe.Pointer(p)).FeStage = RBU_STAGE_CKPT
+ }
rbuSetupCheckpoint(tls, p, pState)
} else if (*Sqlite3rbu)(unsafe.Pointer(p)).FeStage == RBU_STAGE_DONE {
(*Sqlite3rbu)(unsafe.Pointer(p)).Frc = SQLITE_DONE
@@ -164026,7 +166318,7 @@ func openRbuHandle(tls *libc.TLS, zTarget uintptr, zRbu uintptr, zState uintptr)
// Allocate and return an RBU handle with all fields zeroed except for the
// error code, which is set to SQLITE_MISUSE.
-func rbuMisuseError(tls *libc.TLS) uintptr { /* sqlite3.c:204174:19: */
+func rbuMisuseError(tls *libc.TLS) uintptr { /* sqlite3.c:205898:19: */
var pRet uintptr
pRet = Xsqlite3_malloc64(tls, uint64(unsafe.Sizeof(Sqlite3rbu{})))
if pRet != 0 {
@@ -164037,22 +166329,21 @@ func rbuMisuseError(tls *libc.TLS) uintptr { /* sqlite3.c:204174:19: */
}
// Open and return a new RBU handle.
-func Xsqlite3rbu_open(tls *libc.TLS, zTarget uintptr, zRbu uintptr, zState uintptr) uintptr { /* sqlite3.c:204187:23: */
- if (zTarget == uintptr(0)) || (zRbu == uintptr(0)) {
+func Xsqlite3rbu_open(tls *libc.TLS, zTarget uintptr, zRbu uintptr, zState uintptr) uintptr { /* sqlite3.c:205911:23: */
+ if zTarget == uintptr(0) || zRbu == uintptr(0) {
return rbuMisuseError(tls)
}
- // TODO: Check that zTarget and zRbu are non-NULL
return openRbuHandle(tls, zTarget, zRbu, zState)
}
// Open a handle to begin or resume an RBU VACUUM operation.
-func Xsqlite3rbu_vacuum(tls *libc.TLS, zTarget uintptr, zState uintptr) uintptr { /* sqlite3.c:204200:23: */
+func Xsqlite3rbu_vacuum(tls *libc.TLS, zTarget uintptr, zState uintptr) uintptr { /* sqlite3.c:205923:23: */
if zTarget == uintptr(0) {
return rbuMisuseError(tls)
}
if zState != 0 {
var n int32 = int32(libc.Xstrlen(tls, zState))
- if (n >= 7) && (0 == libc.Xmemcmp(tls, ts+30464 /* "-vactmp" */, (zState+uintptr((n-7))), uint32(7))) {
+ if n >= 7 && 0 == libc.Xmemcmp(tls, ts+31824, zState+uintptr(n-7), uint32(7)) {
return rbuMisuseError(tls)
}
}
@@ -164061,7 +166352,7 @@ func Xsqlite3rbu_vacuum(tls *libc.TLS, zTarget uintptr, zState uintptr) uintptr
}
// Return the database handle used by pRbu.
-func Xsqlite3rbu_db(tls *libc.TLS, pRbu uintptr, bRbu int32) uintptr { /* sqlite3.c:204218:20: */
+func Xsqlite3rbu_db(tls *libc.TLS, pRbu uintptr, bRbu int32) uintptr { /* sqlite3.c:205941:20: */
var db uintptr = uintptr(0)
if pRbu != 0 {
db = func() uintptr {
@@ -164077,35 +166368,35 @@ func Xsqlite3rbu_db(tls *libc.TLS, pRbu uintptr, bRbu int32) uintptr { /* sqlite
// If the error code currently stored in the RBU handle is SQLITE_CONSTRAINT,
// then edit any error message string so as to remove all occurrences of
// the pattern "rbu_imp_[0-9]*".
-func rbuEditErrmsg(tls *libc.TLS, p uintptr) { /* sqlite3.c:204232:13: */
- if ((*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_CONSTRAINT) && ((*Sqlite3rbu)(unsafe.Pointer(p)).FzErrmsg != 0) {
+func rbuEditErrmsg(tls *libc.TLS, p uintptr) { /* sqlite3.c:205955:13: */
+ if (*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_CONSTRAINT && (*Sqlite3rbu)(unsafe.Pointer(p)).FzErrmsg != 0 {
var i uint32
var nErrmsg Size_t = libc.Xstrlen(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FzErrmsg)
- for i = uint32(0); i < (nErrmsg - Size_t(8)); i++ {
- if libc.Xmemcmp(tls, ((*Sqlite3rbu)(unsafe.Pointer(p)).FzErrmsg+uintptr(i)), ts+28515 /* "rbu_imp_" */, uint32(8)) == 0 {
+ for i = uint32(0); i < nErrmsg-Size_t(8); i++ {
+ if libc.Xmemcmp(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FzErrmsg+uintptr(i), ts+29850, uint32(8)) == 0 {
var nDel int32 = 8
- for (int32(*(*uint8)(unsafe.Pointer((*Sqlite3rbu)(unsafe.Pointer(p)).FzErrmsg + uintptr((i + uint32(nDel)))))) >= '0') && (int32(*(*uint8)(unsafe.Pointer((*Sqlite3rbu)(unsafe.Pointer(p)).FzErrmsg + uintptr((i + uint32(nDel)))))) <= '9') {
+ for int32(*(*uint8)(unsafe.Pointer((*Sqlite3rbu)(unsafe.Pointer(p)).FzErrmsg + uintptr(i+uint32(nDel))))) >= '0' && int32(*(*uint8)(unsafe.Pointer((*Sqlite3rbu)(unsafe.Pointer(p)).FzErrmsg + uintptr(i+uint32(nDel))))) <= '9' {
nDel++
}
- libc.Xmemmove(tls, ((*Sqlite3rbu)(unsafe.Pointer(p)).FzErrmsg + uintptr(i)), ((*Sqlite3rbu)(unsafe.Pointer(p)).FzErrmsg + uintptr((i + uint32(nDel)))), (((nErrmsg + Size_t(1)) - i) - Size_t(nDel)))
- nErrmsg = nErrmsg - (Size_t(nDel))
+ libc.Xmemmove(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FzErrmsg+uintptr(i), (*Sqlite3rbu)(unsafe.Pointer(p)).FzErrmsg+uintptr(i+uint32(nDel)), nErrmsg+Size_t(1)-i-Size_t(nDel))
+ nErrmsg = nErrmsg - Size_t(nDel)
}
}
}
}
// Close the RBU handle.
-func Xsqlite3rbu_close(tls *libc.TLS, p uintptr, pzErrmsg uintptr) int32 { /* sqlite3.c:204250:16: */
+func Xsqlite3rbu_close(tls *libc.TLS, p uintptr, pzErrmsg uintptr) int32 { /* sqlite3.c:205973:16: */
var rc int32
if p != 0 {
// Commit the transaction to the *-oal file.
- if ((*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK) && ((*Sqlite3rbu)(unsafe.Pointer(p)).FeStage == RBU_STAGE_OAL) {
- (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain, ts+13228 /* "COMMIT" */, uintptr(0), uintptr(0), (p + 36 /* &.zErrmsg */))
+ if (*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && (*Sqlite3rbu)(unsafe.Pointer(p)).FeStage == RBU_STAGE_OAL {
+ (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain, ts+14411 /* "COMMIT" */, uintptr(0), uintptr(0), p+36)
}
// Sync the db file if currently doing an incremental checkpoint
- if ((*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK) && ((*Sqlite3rbu)(unsafe.Pointer(p)).FeStage == RBU_STAGE_CKPT) {
+ if (*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && (*Sqlite3rbu)(unsafe.Pointer(p)).FeStage == RBU_STAGE_CKPT {
var pDb uintptr = (*Rbu_file)(unsafe.Pointer((*Sqlite3rbu)(unsafe.Pointer(p)).FpTargetFd)).FpReal
(*Sqlite3rbu)(unsafe.Pointer(p)).Frc = (*struct {
f func(*libc.TLS, uintptr, int32) int32
@@ -164114,21 +166405,21 @@ func Xsqlite3rbu_close(tls *libc.TLS, p uintptr, pzErrmsg uintptr) int32 { /* sq
rbuSaveState(tls, p, (*Sqlite3rbu)(unsafe.Pointer(p)).FeStage)
- if ((*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK) && ((*Sqlite3rbu)(unsafe.Pointer(p)).FeStage == RBU_STAGE_OAL) {
- (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbRbu, ts+13228 /* "COMMIT" */, uintptr(0), uintptr(0), (p + 36 /* &.zErrmsg */))
+ if (*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && (*Sqlite3rbu)(unsafe.Pointer(p)).FeStage == RBU_STAGE_OAL {
+ (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbRbu, ts+14411 /* "COMMIT" */, uintptr(0), uintptr(0), p+36)
}
// Close any open statement handles.
- rbuObjIterFinalize(tls, (p + 48 /* &.objiter */))
+ rbuObjIterFinalize(tls, p+48)
// 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 (((*Sqlite3rbu)(unsafe.Pointer((p))).FzTarget == uintptr(0)) && ((*Sqlite3rbu)(unsafe.Pointer(p)).Frc != SQLITE_OK)) && ((*Sqlite3rbu)(unsafe.Pointer(p)).FdbRbu != 0) {
- var rc2 int32 = Xsqlite3_exec(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbRbu, ts+30472 /* "DELETE FROM stat..." */, uintptr(0), uintptr(0), uintptr(0))
- if ((*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_DONE) && (rc2 != SQLITE_OK) {
+ if (*Sqlite3rbu)(unsafe.Pointer(p)).FzTarget == uintptr(0) && (*Sqlite3rbu)(unsafe.Pointer(p)).Frc != SQLITE_OK && (*Sqlite3rbu)(unsafe.Pointer(p)).FdbRbu != 0 {
+ var rc2 int32 = Xsqlite3_exec(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbRbu, ts+31832 /* "DELETE FROM stat..." */, uintptr(0), uintptr(0), uintptr(0))
+ if (*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_DONE && rc2 != SQLITE_OK {
(*Sqlite3rbu)(unsafe.Pointer(p)).Frc = rc2
}
}
@@ -164160,18 +166451,18 @@ func Xsqlite3rbu_close(tls *libc.TLS, p uintptr, pzErrmsg uintptr) int32 { /* sq
// Return the total number of key-value operations (inserts, deletes or
// updates) that have been performed on the target database since the
// current RBU update was started.
-func Xsqlite3rbu_progress(tls *libc.TLS, pRbu uintptr) Sqlite3_int64 { /* sqlite3.c:204313:26: */
+func Xsqlite3rbu_progress(tls *libc.TLS, pRbu uintptr) Sqlite3_int64 { /* sqlite3.c:206036:26: */
return Sqlite3_int64((*Sqlite3rbu)(unsafe.Pointer(pRbu)).FnProgress)
}
// Return permyriadage progress indications for the two main stages of
// an RBU update.
-func Xsqlite3rbu_bp_progress(tls *libc.TLS, p uintptr, pnOne uintptr, pnTwo uintptr) { /* sqlite3.c:204321:17: */
+func Xsqlite3rbu_bp_progress(tls *libc.TLS, p uintptr, pnOne uintptr, pnTwo uintptr) { /* sqlite3.c:206044:17: */
var MAX_PROGRESS int32 = 10000
switch (*Sqlite3rbu)(unsafe.Pointer(p)).FeStage {
case RBU_STAGE_OAL:
if (*Sqlite3rbu)(unsafe.Pointer(p)).FnPhaseOneStep > int64(0) {
- *(*int32)(unsafe.Pointer(pnOne)) = (int32((I64(MAX_PROGRESS) * I64((*Sqlite3rbu)(unsafe.Pointer(p)).FnProgress)) / (*Sqlite3rbu)(unsafe.Pointer(p)).FnPhaseOneStep))
+ *(*int32)(unsafe.Pointer(pnOne)) = int32(I64(MAX_PROGRESS) * I64((*Sqlite3rbu)(unsafe.Pointer(p)).FnProgress) / (*Sqlite3rbu)(unsafe.Pointer(p)).FnPhaseOneStep)
} else {
*(*int32)(unsafe.Pointer(pnOne)) = -1
}
@@ -164185,7 +166476,7 @@ func Xsqlite3rbu_bp_progress(tls *libc.TLS, p uintptr, pnOne uintptr, pnTwo uint
case RBU_STAGE_CKPT:
*(*int32)(unsafe.Pointer(pnOne)) = MAX_PROGRESS
- *(*int32)(unsafe.Pointer(pnTwo)) = (int32((I64(MAX_PROGRESS) * I64((*Sqlite3rbu)(unsafe.Pointer(p)).FnStep)) / I64((*Sqlite3rbu)(unsafe.Pointer(p)).FnFrame)))
+ *(*int32)(unsafe.Pointer(pnTwo)) = int32(I64(MAX_PROGRESS) * I64((*Sqlite3rbu)(unsafe.Pointer(p)).FnStep) / I64((*Sqlite3rbu)(unsafe.Pointer(p)).FnFrame))
break
case RBU_STAGE_DONE:
@@ -164199,7 +166490,7 @@ func Xsqlite3rbu_bp_progress(tls *libc.TLS, p uintptr, pnOne uintptr, pnTwo uint
}
// Return the current state of the RBU vacuum or update operation.
-func Xsqlite3rbu_state(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:204356:16: */
+func Xsqlite3rbu_state(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:206079:16: */
bp := tls.Alloc(24)
defer tls.Free(24)
@@ -164208,7 +166499,7 @@ func Xsqlite3rbu_state(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:204356:16:
0, SQLITE_RBU_STATE_CHECKPOINT, SQLITE_RBU_STATE_DONE,
}
- if ((*Sqlite3rbu)(unsafe.Pointer(p)).Frc != SQLITE_OK) && ((*Sqlite3rbu)(unsafe.Pointer(p)).Frc != SQLITE_DONE) {
+ if (*Sqlite3rbu)(unsafe.Pointer(p)).Frc != SQLITE_OK && (*Sqlite3rbu)(unsafe.Pointer(p)).Frc != SQLITE_DONE {
return SQLITE_RBU_STATE_ERROR
} else {
@@ -164217,7 +166508,7 @@ func Xsqlite3rbu_state(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:204356:16:
return int32(0)
}
-func Xsqlite3rbu_savestate(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:204384:16: */
+func Xsqlite3rbu_savestate(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:206107:16: */
var rc int32 = (*Sqlite3rbu)(unsafe.Pointer(p)).Frc
if rc == SQLITE_DONE {
return SQLITE_OK
@@ -164226,12 +166517,12 @@ func Xsqlite3rbu_savestate(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:204384
if (*Sqlite3rbu)(unsafe.Pointer(p)).FeStage == RBU_STAGE_OAL {
if rc == SQLITE_OK {
- rc = Xsqlite3_exec(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain, ts+13228 /* "COMMIT" */, uintptr(0), uintptr(0), uintptr(0))
+ rc = Xsqlite3_exec(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain, ts+14411 /* "COMMIT" */, uintptr(0), uintptr(0), uintptr(0))
}
}
// Sync the db file
- if (rc == SQLITE_OK) && ((*Sqlite3rbu)(unsafe.Pointer(p)).FeStage == RBU_STAGE_CKPT) {
+ if rc == SQLITE_OK && (*Sqlite3rbu)(unsafe.Pointer(p)).FeStage == RBU_STAGE_CKPT {
var pDb uintptr = (*Rbu_file)(unsafe.Pointer((*Sqlite3rbu)(unsafe.Pointer(p)).FpTargetFd)).FpReal
rc = (*struct {
f func(*libc.TLS, uintptr, int32) int32
@@ -164245,19 +166536,19 @@ func Xsqlite3rbu_savestate(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:204384
if (*Sqlite3rbu)(unsafe.Pointer(p)).FeStage == RBU_STAGE_OAL {
if rc == SQLITE_OK {
- rc = Xsqlite3_exec(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbRbu, ts+13228 /* "COMMIT" */, uintptr(0), uintptr(0), uintptr(0))
+ rc = Xsqlite3_exec(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbRbu, ts+14411 /* "COMMIT" */, uintptr(0), uintptr(0), uintptr(0))
}
if rc == SQLITE_OK {
var zBegin uintptr
- if (*Sqlite3rbu)(unsafe.Pointer((p))).FzTarget == uintptr(0) {
- zBegin = ts + 13213 /* "BEGIN" */
+ if (*Sqlite3rbu)(unsafe.Pointer(p)).FzTarget == uintptr(0) {
+ zBegin = ts + 14396 /* "BEGIN" */
} else {
- zBegin = ts + 30424 /* "BEGIN IMMEDIATE" */
+ zBegin = ts + 31784 /* "BEGIN IMMEDIATE" */
}
rc = Xsqlite3_exec(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbRbu, zBegin, uintptr(0), uintptr(0), uintptr(0))
}
if rc == SQLITE_OK {
- rc = Xsqlite3_exec(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain, ts+30424 /* "BEGIN IMMEDIATE" */, uintptr(0), uintptr(0), uintptr(0))
+ rc = Xsqlite3_exec(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain, ts+31784 /* "BEGIN IMMEDIATE" */, uintptr(0), uintptr(0), uintptr(0))
}
}
@@ -164324,16 +166615,16 @@ func Xsqlite3rbu_savestate(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:204384
// relinquished). Finally, calls to xSync() on the target database
// file fail with SQLITE_INTERNAL errors.
-func rbuUnlockShm(tls *libc.TLS, p uintptr) { /* sqlite3.c:204477:13: */
+func rbuUnlockShm(tls *libc.TLS, p uintptr) { /* sqlite3.c:206200:13: */
if (*Rbu_file)(unsafe.Pointer(p)).FpRbu != 0 {
var xShmLock uintptr = (*sqlite3_io_methods)(unsafe.Pointer((*Sqlite3_file)(unsafe.Pointer((*Rbu_file)(unsafe.Pointer(p)).FpReal)).FpMethods)).FxShmLock
var i int32
for i = 0; i < SQLITE_SHM_NLOCK; i++ {
- if ((U32(int32(1) << i)) & (*Sqlite3rbu)(unsafe.Pointer((*Rbu_file)(unsafe.Pointer(p)).FpRbu)).FmLock) != 0 {
+ if U32(int32(1)<<i)&(*Sqlite3rbu)(unsafe.Pointer((*Rbu_file)(unsafe.Pointer(p)).FpRbu)).FmLock != 0 {
(*struct {
f func(*libc.TLS, uintptr, int32, int32, int32) int32
- })(unsafe.Pointer(&struct{ uintptr }{xShmLock})).f(tls, (*Rbu_file)(unsafe.Pointer(p)).FpReal, i, 1, (SQLITE_SHM_UNLOCK | SQLITE_SHM_EXCLUSIVE))
+ })(unsafe.Pointer(&struct{ uintptr }{xShmLock})).f(tls, (*Rbu_file)(unsafe.Pointer(p)).FpReal, i, 1, SQLITE_SHM_UNLOCK|SQLITE_SHM_EXCLUSIVE)
}
}
(*Sqlite3rbu)(unsafe.Pointer((*Rbu_file)(unsafe.Pointer(p)).FpRbu)).FmLock = U32(0)
@@ -164341,13 +166632,13 @@ func rbuUnlockShm(tls *libc.TLS, p uintptr) { /* sqlite3.c:204477:13: */
}
//
-func rbuUpdateTempSize(tls *libc.TLS, pFd uintptr, nNew Sqlite3_int64) int32 { /* sqlite3.c:204493:12: */
+func rbuUpdateTempSize(tls *libc.TLS, pFd uintptr, nNew Sqlite3_int64) int32 { /* sqlite3.c:206216:12: */
var pRbu uintptr = (*Rbu_file)(unsafe.Pointer(pFd)).FpRbu
- var nDiff I64 = (nNew - (*Rbu_file)(unsafe.Pointer(pFd)).Fsz)
- *(*I64)(unsafe.Pointer(pRbu + 224 /* &.szTemp */)) += (nDiff)
+ var nDiff I64 = nNew - (*Rbu_file)(unsafe.Pointer(pFd)).Fsz
+ *(*I64)(unsafe.Pointer(pRbu + 224)) += nDiff
(*Rbu_file)(unsafe.Pointer(pFd)).Fsz = nNew
- if ((*Sqlite3rbu)(unsafe.Pointer(pRbu)).FszTempLimit != 0) && ((*Sqlite3rbu)(unsafe.Pointer(pRbu)).FszTemp > (*Sqlite3rbu)(unsafe.Pointer(pRbu)).FszTempLimit) {
+ if (*Sqlite3rbu)(unsafe.Pointer(pRbu)).FszTempLimit != 0 && (*Sqlite3rbu)(unsafe.Pointer(pRbu)).FszTemp > (*Sqlite3rbu)(unsafe.Pointer(pRbu)).FszTempLimit {
return SQLITE_FULL
}
return SQLITE_OK
@@ -164359,7 +166650,7 @@ func rbuUpdateTempSize(tls *libc.TLS, pFd uintptr, nNew Sqlite3_int64) int32 { /
// for all file descriptors with rbu_file.pDb!=0. If the argument has
// rbu_file.pDb!=0, then it is assumed to already be present on the
// main list and is only added to the pDb!=0 list.
-func rbuMainlistAdd(tls *libc.TLS, p uintptr) { /* sqlite3.c:204511:13: */
+func rbuMainlistAdd(tls *libc.TLS, p uintptr) { /* sqlite3.c:206234:13: */
var pRbuVfs uintptr = (*Rbu_file)(unsafe.Pointer(p)).FpRbuVfs
var pIter uintptr
@@ -164370,7 +166661,7 @@ func rbuMainlistAdd(tls *libc.TLS, p uintptr) { /* sqlite3.c:204511:13: */
(*Rbu_file)(unsafe.Pointer(p)).FpMainNext = (*Rbu_vfs)(unsafe.Pointer(pRbuVfs)).FpMain
(*Rbu_vfs)(unsafe.Pointer(pRbuVfs)).FpMain = p
} else {
- for pIter = (*Rbu_vfs)(unsafe.Pointer(pRbuVfs)).FpMainRbu; (pIter != 0) && (pIter != p); pIter = (*Rbu_file)(unsafe.Pointer(pIter)).FpMainRbuNext {
+ for pIter = (*Rbu_vfs)(unsafe.Pointer(pRbuVfs)).FpMainRbu; pIter != 0 && pIter != p; pIter = (*Rbu_file)(unsafe.Pointer(pIter)).FpMainRbuNext {
}
if pIter == uintptr(0) {
(*Rbu_file)(unsafe.Pointer(p)).FpMainRbuNext = (*Rbu_vfs)(unsafe.Pointer(pRbuVfs)).FpMainRbu
@@ -164381,16 +166672,16 @@ func rbuMainlistAdd(tls *libc.TLS, p uintptr) { /* sqlite3.c:204511:13: */
}
// Remove an item from the main-db lists.
-func rbuMainlistRemove(tls *libc.TLS, p uintptr) { /* sqlite3.c:204533:13: */
+func rbuMainlistRemove(tls *libc.TLS, p uintptr) { /* sqlite3.c:206256:13: */
var pp uintptr
Xsqlite3_mutex_enter(tls, (*Rbu_vfs)(unsafe.Pointer((*Rbu_file)(unsafe.Pointer(p)).FpRbuVfs)).Fmutex)
- for pp = ((*Rbu_file)(unsafe.Pointer(p)).FpRbuVfs + 100 /* &.pMain */); (*(*uintptr)(unsafe.Pointer(pp)) != 0) && (*(*uintptr)(unsafe.Pointer(pp)) != p); pp = (*(*uintptr)(unsafe.Pointer(pp)) + 56 /* &.pMainNext */) {
+ for pp = (*Rbu_file)(unsafe.Pointer(p)).FpRbuVfs + 100; *(*uintptr)(unsafe.Pointer(pp)) != 0 && *(*uintptr)(unsafe.Pointer(pp)) != p; pp = *(*uintptr)(unsafe.Pointer(pp)) + 56 {
}
if *(*uintptr)(unsafe.Pointer(pp)) != 0 {
*(*uintptr)(unsafe.Pointer(pp)) = (*Rbu_file)(unsafe.Pointer(p)).FpMainNext
}
(*Rbu_file)(unsafe.Pointer(p)).FpMainNext = uintptr(0)
- for pp = ((*Rbu_file)(unsafe.Pointer(p)).FpRbuVfs + 104 /* &.pMainRbu */); (*(*uintptr)(unsafe.Pointer(pp)) != 0) && (*(*uintptr)(unsafe.Pointer(pp)) != p); pp = (*(*uintptr)(unsafe.Pointer(pp)) + 60 /* &.pMainRbuNext */) {
+ for pp = (*Rbu_file)(unsafe.Pointer(p)).FpRbuVfs + 104; *(*uintptr)(unsafe.Pointer(pp)) != 0 && *(*uintptr)(unsafe.Pointer(pp)) != p; pp = *(*uintptr)(unsafe.Pointer(pp)) + 60 {
}
if *(*uintptr)(unsafe.Pointer(pp)) != 0 {
*(*uintptr)(unsafe.Pointer(pp)) = (*Rbu_file)(unsafe.Pointer(p)).FpMainRbuNext
@@ -164406,14 +166697,14 @@ func rbuMainlistRemove(tls *libc.TLS, p uintptr) { /* sqlite3.c:204533:13: */
//
// If parameter bRbu is true, only search for file-descriptors with
// rbu_file.pDb!=0.
-func rbuFindMaindb(tls *libc.TLS, pRbuVfs uintptr, zWal uintptr, bRbu int32) uintptr { /* sqlite3.c:204554:17: */
+func rbuFindMaindb(tls *libc.TLS, pRbuVfs uintptr, zWal uintptr, bRbu int32) uintptr { /* sqlite3.c:206277:17: */
var pDb uintptr
Xsqlite3_mutex_enter(tls, (*Rbu_vfs)(unsafe.Pointer(pRbuVfs)).Fmutex)
if bRbu != 0 {
- for pDb = (*Rbu_vfs)(unsafe.Pointer(pRbuVfs)).FpMainRbu; (pDb != 0) && ((*Rbu_file)(unsafe.Pointer(pDb)).FzWal != zWal); pDb = (*Rbu_file)(unsafe.Pointer(pDb)).FpMainRbuNext {
+ for pDb = (*Rbu_vfs)(unsafe.Pointer(pRbuVfs)).FpMainRbu; pDb != 0 && (*Rbu_file)(unsafe.Pointer(pDb)).FzWal != zWal; pDb = (*Rbu_file)(unsafe.Pointer(pDb)).FpMainRbuNext {
}
} else {
- for pDb = (*Rbu_vfs)(unsafe.Pointer(pRbuVfs)).FpMain; (pDb != 0) && ((*Rbu_file)(unsafe.Pointer(pDb)).FzWal != zWal); pDb = (*Rbu_file)(unsafe.Pointer(pDb)).FpMainNext {
+ for pDb = (*Rbu_vfs)(unsafe.Pointer(pRbuVfs)).FpMain; pDb != 0 && (*Rbu_file)(unsafe.Pointer(pDb)).FzWal != zWal; pDb = (*Rbu_file)(unsafe.Pointer(pDb)).FpMainNext {
}
}
Xsqlite3_mutex_leave(tls, (*Rbu_vfs)(unsafe.Pointer(pRbuVfs)).Fmutex)
@@ -164421,7 +166712,7 @@ func rbuFindMaindb(tls *libc.TLS, pRbuVfs uintptr, zWal uintptr, bRbu int32) uin
}
// Close an rbu file.
-func rbuVfsClose(tls *libc.TLS, pFile uintptr) int32 { /* sqlite3.c:204569:12: */
+func rbuVfsClose(tls *libc.TLS, pFile uintptr) int32 { /* sqlite3.c:206292:12: */
var p uintptr = pFile
var rc int32
var i int32
@@ -164434,13 +166725,13 @@ func rbuVfsClose(tls *libc.TLS, pFile uintptr) int32 { /* sqlite3.c:204569:12: *
(*Rbu_file)(unsafe.Pointer(p)).FapShm = uintptr(0)
Xsqlite3_free(tls, (*Rbu_file)(unsafe.Pointer(p)).FzDel)
- if ((*Rbu_file)(unsafe.Pointer(p)).FopenFlags & SQLITE_OPEN_MAIN_DB) != 0 {
+ if (*Rbu_file)(unsafe.Pointer(p)).FopenFlags&SQLITE_OPEN_MAIN_DB != 0 {
rbuMainlistRemove(tls, p)
rbuUnlockShm(tls, p)
(*struct {
f func(*libc.TLS, uintptr, int32) int32
})(unsafe.Pointer(&struct{ uintptr }{(*sqlite3_io_methods)(unsafe.Pointer((*Sqlite3_file)(unsafe.Pointer((*Rbu_file)(unsafe.Pointer(p)).FpReal)).FpMethods)).FxShmUnmap})).f(tls, (*Rbu_file)(unsafe.Pointer(p)).FpReal, 0)
- } else if (((*Rbu_file)(unsafe.Pointer(p)).FopenFlags & SQLITE_OPEN_DELETEONCLOSE) != 0) && ((*Rbu_file)(unsafe.Pointer(p)).FpRbu != 0) {
+ } else if (*Rbu_file)(unsafe.Pointer(p)).FopenFlags&SQLITE_OPEN_DELETEONCLOSE != 0 && (*Rbu_file)(unsafe.Pointer(p)).FpRbu != 0 {
rbuUpdateTempSize(tls, p, int64(0))
}
@@ -164453,40 +166744,40 @@ func rbuVfsClose(tls *libc.TLS, pFile uintptr) int32 { /* sqlite3.c:204569:12: *
// Read and return an unsigned 32-bit big-endian integer from the buffer
// passed as the only argument.
-func rbuGetU32(tls *libc.TLS, aBuf uintptr) U32 { /* sqlite3.c:204602:12: */
- return ((((U32(*(*U8)(unsafe.Pointer(aBuf))) << 24) +
- (U32(*(*U8)(unsafe.Pointer(aBuf + 1))) << 16)) +
- (U32(*(*U8)(unsafe.Pointer(aBuf + 2))) << 8)) +
- (U32(*(*U8)(unsafe.Pointer(aBuf + 3)))))
+func rbuGetU32(tls *libc.TLS, aBuf uintptr) U32 { /* sqlite3.c:206325:12: */
+ return U32(*(*U8)(unsafe.Pointer(aBuf)))<<24 +
+ U32(*(*U8)(unsafe.Pointer(aBuf + 1)))<<16 +
+ U32(*(*U8)(unsafe.Pointer(aBuf + 2)))<<8 +
+ U32(*(*U8)(unsafe.Pointer(aBuf + 3)))
}
// Write an unsigned 32-bit value in big-endian format to the supplied
// buffer.
-func rbuPutU32(tls *libc.TLS, aBuf uintptr, iVal U32) { /* sqlite3.c:204613:13: */
- *(*U8)(unsafe.Pointer(aBuf)) = (U8((iVal >> 24) & U32(0xFF)))
- *(*U8)(unsafe.Pointer(aBuf + 1)) = (U8((iVal >> 16) & U32(0xFF)))
- *(*U8)(unsafe.Pointer(aBuf + 2)) = (U8((iVal >> 8) & U32(0xFF)))
- *(*U8)(unsafe.Pointer(aBuf + 3)) = (U8((iVal >> 0) & U32(0xFF)))
+func rbuPutU32(tls *libc.TLS, aBuf uintptr, iVal U32) { /* sqlite3.c:206336:13: */
+ *(*U8)(unsafe.Pointer(aBuf)) = U8(iVal >> 24 & U32(0xFF))
+ *(*U8)(unsafe.Pointer(aBuf + 1)) = U8(iVal >> 16 & U32(0xFF))
+ *(*U8)(unsafe.Pointer(aBuf + 2)) = U8(iVal >> 8 & U32(0xFF))
+ *(*U8)(unsafe.Pointer(aBuf + 3)) = U8(iVal >> 0 & U32(0xFF))
}
-func rbuPutU16(tls *libc.TLS, aBuf uintptr, iVal U16) { /* sqlite3.c:204620:13: */
- *(*U8)(unsafe.Pointer(aBuf)) = (U8((int32(iVal) >> 8) & 0xFF))
- *(*U8)(unsafe.Pointer(aBuf + 1)) = (U8((int32(iVal) >> 0) & 0xFF))
+func rbuPutU16(tls *libc.TLS, aBuf uintptr, iVal U16) { /* sqlite3.c:206343:13: */
+ *(*U8)(unsafe.Pointer(aBuf)) = U8(int32(iVal) >> 8 & 0xFF)
+ *(*U8)(unsafe.Pointer(aBuf + 1)) = U8(int32(iVal) >> 0 & 0xFF)
}
// Read data from an rbuVfs-file.
-func rbuVfsRead(tls *libc.TLS, pFile uintptr, zBuf uintptr, iAmt int32, iOfst Sqlite_int64) int32 { /* sqlite3.c:204628:12: */
+func rbuVfsRead(tls *libc.TLS, pFile uintptr, zBuf uintptr, iAmt int32, iOfst Sqlite_int64) int32 { /* sqlite3.c:206351:12: */
var p uintptr = pFile
var pRbu uintptr = (*Rbu_file)(unsafe.Pointer(p)).FpRbu
var rc int32
- if (pRbu != 0) && ((*Sqlite3rbu)(unsafe.Pointer(pRbu)).FeStage == RBU_STAGE_CAPTURE) {
+ if pRbu != 0 && (*Sqlite3rbu)(unsafe.Pointer(pRbu)).FeStage == RBU_STAGE_CAPTURE {
rc = rbuCaptureWalRead(tls, (*Rbu_file)(unsafe.Pointer(p)).FpRbu, iOfst, iAmt)
} else {
- if (((pRbu != 0) && ((*Sqlite3rbu)(unsafe.Pointer(pRbu)).FeStage == RBU_STAGE_OAL)) &&
- (((*Rbu_file)(unsafe.Pointer(p)).FopenFlags & SQLITE_OPEN_WAL) != 0)) &&
- (iOfst >= (*Sqlite3rbu)(unsafe.Pointer(pRbu)).FiOalSz) {
+ if pRbu != 0 && (*Sqlite3rbu)(unsafe.Pointer(pRbu)).FeStage == RBU_STAGE_OAL &&
+ (*Rbu_file)(unsafe.Pointer(p)).FopenFlags&SQLITE_OPEN_WAL != 0 &&
+ iOfst >= (*Sqlite3rbu)(unsafe.Pointer(pRbu)).FiOalSz {
rc = SQLITE_OK
libc.Xmemset(tls, zBuf, 0, uint32(iAmt))
} else {
@@ -164497,10 +166788,10 @@ func rbuVfsRead(tls *libc.TLS, pFile uintptr, zBuf uintptr, iAmt int32, iOfst Sq
// database as part of an rbu vacuum operation, synthesize the
// contents of the first page if it does not yet exist. Otherwise,
// SQLite will not check for a *-wal file.
- if (((((pRbu != 0) && ((*Sqlite3rbu)(unsafe.Pointer((pRbu))).FzTarget == uintptr(0))) &&
- (rc == (SQLITE_IOERR | (int32(2) << 8)))) && (iOfst == int64(0))) &&
- (((*Rbu_file)(unsafe.Pointer(p)).FopenFlags & SQLITE_OPEN_MAIN_DB) != 0)) &&
- ((*Sqlite3rbu)(unsafe.Pointer(pRbu)).Frc == SQLITE_OK) {
+ if pRbu != 0 && (*Sqlite3rbu)(unsafe.Pointer(pRbu)).FzTarget == uintptr(0) &&
+ rc == SQLITE_IOERR|int32(2)<<8 && iOfst == int64(0) &&
+ (*Rbu_file)(unsafe.Pointer(p)).FopenFlags&SQLITE_OPEN_MAIN_DB != 0 &&
+ (*Sqlite3rbu)(unsafe.Pointer(pRbu)).Frc == SQLITE_OK {
var pFd uintptr = (*Sqlite3rbu)(unsafe.Pointer(pRbu)).FpRbuFd
rc = (*struct {
f func(*libc.TLS, uintptr, uintptr, int32, Sqlite3_int64) int32
@@ -164508,30 +166799,30 @@ func rbuVfsRead(tls *libc.TLS, pFile uintptr, zBuf uintptr, iAmt int32, iOfst Sq
if rc == SQLITE_OK {
var aBuf uintptr = zBuf
var iRoot U32
- if rbuGetU32(tls, (aBuf+52)) != 0 {
+ if rbuGetU32(tls, aBuf+52) != 0 {
iRoot = uint32(1)
} else {
iRoot = uint32(0)
}
- rbuPutU32(tls, (aBuf + 52), iRoot) // largest root page number
- rbuPutU32(tls, (aBuf + 36), uint32(0)) // number of free pages
- rbuPutU32(tls, (aBuf + 32), uint32(0)) // first page on free list trunk
- rbuPutU32(tls, (aBuf + 28), uint32(1)) // size of db file in pages
- rbuPutU32(tls, (aBuf + 24), ((*Rbu_file)(unsafe.Pointer((*Sqlite3rbu)(unsafe.Pointer(pRbu)).FpRbuFd)).FiCookie + U32(1))) // Change counter
+ rbuPutU32(tls, aBuf+52, iRoot) // largest root page number
+ rbuPutU32(tls, aBuf+36, uint32(0)) // number of free pages
+ rbuPutU32(tls, aBuf+32, uint32(0)) // first page on free list trunk
+ rbuPutU32(tls, aBuf+28, uint32(1)) // size of db file in pages
+ rbuPutU32(tls, aBuf+24, (*Rbu_file)(unsafe.Pointer((*Sqlite3rbu)(unsafe.Pointer(pRbu)).FpRbuFd)).FiCookie+U32(1)) // Change counter
if iAmt > 100 {
- libc.Xmemset(tls, (aBuf + 100), 0, (uint32(iAmt - 100)))
- rbuPutU16(tls, (aBuf + 105), (uint16(iAmt & 0xFFFF)))
+ libc.Xmemset(tls, aBuf+100, 0, uint32(iAmt-100))
+ rbuPutU16(tls, aBuf+105, uint16(iAmt&0xFFFF))
*(*U8)(unsafe.Pointer(aBuf + 100)) = U8(0x0D)
}
}
}
}
- if ((rc == SQLITE_OK) && (iOfst == int64(0))) && (((*Rbu_file)(unsafe.Pointer(p)).FopenFlags & SQLITE_OPEN_MAIN_DB) != 0) {
+ if rc == SQLITE_OK && iOfst == int64(0) && (*Rbu_file)(unsafe.Pointer(p)).FopenFlags&SQLITE_OPEN_MAIN_DB != 0 {
// These look like magic numbers. But they are stable, as they are part
// of the definition of the SQLite file format, which may not change.
var pBuf uintptr = zBuf
- (*Rbu_file)(unsafe.Pointer(p)).FiCookie = rbuGetU32(tls, (pBuf + 24))
+ (*Rbu_file)(unsafe.Pointer(p)).FiCookie = rbuGetU32(tls, pBuf+24)
(*Rbu_file)(unsafe.Pointer(p)).FiWriteVer = *(*U8)(unsafe.Pointer(pBuf + 19))
}
}
@@ -164539,22 +166830,22 @@ func rbuVfsRead(tls *libc.TLS, pFile uintptr, zBuf uintptr, iAmt int32, iOfst Sq
}
// Write data to an rbuVfs-file.
-func rbuVfsWrite(tls *libc.TLS, pFile uintptr, zBuf uintptr, iAmt int32, iOfst Sqlite_int64) int32 { /* sqlite3.c:204694:12: */
+func rbuVfsWrite(tls *libc.TLS, pFile uintptr, zBuf uintptr, iAmt int32, iOfst Sqlite_int64) int32 { /* sqlite3.c:206417:12: */
var p uintptr = pFile
var pRbu uintptr = (*Rbu_file)(unsafe.Pointer(p)).FpRbu
var rc int32
- if (pRbu != 0) && ((*Sqlite3rbu)(unsafe.Pointer(pRbu)).FeStage == RBU_STAGE_CAPTURE) {
+ if pRbu != 0 && (*Sqlite3rbu)(unsafe.Pointer(pRbu)).FeStage == RBU_STAGE_CAPTURE {
rc = rbuCaptureDbWrite(tls, (*Rbu_file)(unsafe.Pointer(p)).FpRbu, iOfst)
} else {
if pRbu != 0 {
- if (((*Sqlite3rbu)(unsafe.Pointer(pRbu)).FeStage == RBU_STAGE_OAL) &&
- (((*Rbu_file)(unsafe.Pointer(p)).FopenFlags & SQLITE_OPEN_WAL) != 0)) &&
- (iOfst >= (*Sqlite3rbu)(unsafe.Pointer(pRbu)).FiOalSz) {
- (*Sqlite3rbu)(unsafe.Pointer(pRbu)).FiOalSz = (Sqlite_int64(iAmt) + iOfst)
- } else if ((*Rbu_file)(unsafe.Pointer(p)).FopenFlags & SQLITE_OPEN_DELETEONCLOSE) != 0 {
- var szNew I64 = (Sqlite_int64(iAmt) + iOfst)
+ if (*Sqlite3rbu)(unsafe.Pointer(pRbu)).FeStage == RBU_STAGE_OAL &&
+ (*Rbu_file)(unsafe.Pointer(p)).FopenFlags&SQLITE_OPEN_WAL != 0 &&
+ iOfst >= (*Sqlite3rbu)(unsafe.Pointer(pRbu)).FiOalSz {
+ (*Sqlite3rbu)(unsafe.Pointer(pRbu)).FiOalSz = Sqlite_int64(iAmt) + iOfst
+ } else if (*Rbu_file)(unsafe.Pointer(p)).FopenFlags&SQLITE_OPEN_DELETEONCLOSE != 0 {
+ var szNew I64 = Sqlite_int64(iAmt) + iOfst
if szNew > (*Rbu_file)(unsafe.Pointer(p)).Fsz {
rc = rbuUpdateTempSize(tls, p, szNew)
if rc != SQLITE_OK {
@@ -164566,11 +166857,11 @@ func rbuVfsWrite(tls *libc.TLS, pFile uintptr, zBuf uintptr, iAmt int32, iOfst S
rc = (*struct {
f func(*libc.TLS, uintptr, uintptr, int32, Sqlite3_int64) int32
})(unsafe.Pointer(&struct{ uintptr }{(*sqlite3_io_methods)(unsafe.Pointer((*Sqlite3_file)(unsafe.Pointer((*Rbu_file)(unsafe.Pointer(p)).FpReal)).FpMethods)).FxWrite})).f(tls, (*Rbu_file)(unsafe.Pointer(p)).FpReal, zBuf, iAmt, iOfst)
- if ((rc == SQLITE_OK) && (iOfst == int64(0))) && (((*Rbu_file)(unsafe.Pointer(p)).FopenFlags & SQLITE_OPEN_MAIN_DB) != 0) {
+ if rc == SQLITE_OK && iOfst == int64(0) && (*Rbu_file)(unsafe.Pointer(p)).FopenFlags&SQLITE_OPEN_MAIN_DB != 0 {
// These look like magic numbers. But they are stable, as they are part
// of the definition of the SQLite file format, which may not change.
var pBuf uintptr = zBuf
- (*Rbu_file)(unsafe.Pointer(p)).FiCookie = rbuGetU32(tls, (pBuf + 24))
+ (*Rbu_file)(unsafe.Pointer(p)).FiCookie = rbuGetU32(tls, pBuf+24)
(*Rbu_file)(unsafe.Pointer(p)).FiWriteVer = *(*U8)(unsafe.Pointer(pBuf + 19))
}
}
@@ -164578,9 +166869,9 @@ func rbuVfsWrite(tls *libc.TLS, pFile uintptr, zBuf uintptr, iAmt int32, iOfst S
}
// Truncate an rbuVfs-file.
-func rbuVfsTruncate(tls *libc.TLS, pFile uintptr, size Sqlite_int64) int32 { /* sqlite3.c:204737:12: */
+func rbuVfsTruncate(tls *libc.TLS, pFile uintptr, size Sqlite_int64) int32 { /* sqlite3.c:206460:12: */
var p uintptr = pFile
- if (((*Rbu_file)(unsafe.Pointer(p)).FopenFlags & SQLITE_OPEN_DELETEONCLOSE) != 0) && ((*Rbu_file)(unsafe.Pointer(p)).FpRbu != 0) {
+ if (*Rbu_file)(unsafe.Pointer(p)).FopenFlags&SQLITE_OPEN_DELETEONCLOSE != 0 && (*Rbu_file)(unsafe.Pointer(p)).FpRbu != 0 {
var rc int32 = rbuUpdateTempSize(tls, p, size)
if rc != SQLITE_OK {
return rc
@@ -164592,10 +166883,10 @@ func rbuVfsTruncate(tls *libc.TLS, pFile uintptr, size Sqlite_int64) int32 { /*
}
// Sync an rbuVfs-file.
-func rbuVfsSync(tls *libc.TLS, pFile uintptr, flags int32) int32 { /* sqlite3.c:204749:12: */
+func rbuVfsSync(tls *libc.TLS, pFile uintptr, flags int32) int32 { /* sqlite3.c:206472:12: */
var p uintptr = pFile
- if ((*Rbu_file)(unsafe.Pointer(p)).FpRbu != 0) && ((*Sqlite3rbu)(unsafe.Pointer((*Rbu_file)(unsafe.Pointer(p)).FpRbu)).FeStage == RBU_STAGE_CAPTURE) {
- if ((*Rbu_file)(unsafe.Pointer(p)).FopenFlags & SQLITE_OPEN_MAIN_DB) != 0 {
+ if (*Rbu_file)(unsafe.Pointer(p)).FpRbu != 0 && (*Sqlite3rbu)(unsafe.Pointer((*Rbu_file)(unsafe.Pointer(p)).FpRbu)).FeStage == RBU_STAGE_CAPTURE {
+ if (*Rbu_file)(unsafe.Pointer(p)).FopenFlags&SQLITE_OPEN_MAIN_DB != 0 {
return SQLITE_INTERNAL
}
return SQLITE_OK
@@ -164606,7 +166897,7 @@ func rbuVfsSync(tls *libc.TLS, pFile uintptr, flags int32) int32 { /* sqlite3.c:
}
// Return the current file-size of an rbuVfs-file.
-func rbuVfsFileSize(tls *libc.TLS, pFile uintptr, pSize uintptr) int32 { /* sqlite3.c:204763:12: */
+func rbuVfsFileSize(tls *libc.TLS, pFile uintptr, pSize uintptr) int32 { /* sqlite3.c:206486:12: */
var p uintptr = pFile
var rc int32
rc = (*struct {
@@ -164617,22 +166908,22 @@ func rbuVfsFileSize(tls *libc.TLS, pFile uintptr, pSize uintptr) int32 { /* sqli
// pretend that it has at least one page. Otherwise, SQLite will not
// check for the existance of a *-wal file. rbuVfsRead() contains
// similar logic.
- if ((((rc == SQLITE_OK) && (*(*Sqlite_int64)(unsafe.Pointer(pSize)) == int64(0))) &&
- ((*Rbu_file)(unsafe.Pointer(p)).FpRbu != 0)) && ((*Sqlite3rbu)(unsafe.Pointer(((*Rbu_file)(unsafe.Pointer(p)).FpRbu))).FzTarget == uintptr(0))) &&
- (((*Rbu_file)(unsafe.Pointer(p)).FopenFlags & SQLITE_OPEN_MAIN_DB) != 0) {
+ if rc == SQLITE_OK && *(*Sqlite_int64)(unsafe.Pointer(pSize)) == int64(0) &&
+ (*Rbu_file)(unsafe.Pointer(p)).FpRbu != 0 && (*Sqlite3rbu)(unsafe.Pointer((*Rbu_file)(unsafe.Pointer(p)).FpRbu)).FzTarget == uintptr(0) &&
+ (*Rbu_file)(unsafe.Pointer(p)).FopenFlags&SQLITE_OPEN_MAIN_DB != 0 {
*(*Sqlite_int64)(unsafe.Pointer(pSize)) = int64(1024)
}
return rc
}
// Lock an rbuVfs-file.
-func rbuVfsLock(tls *libc.TLS, pFile uintptr, eLock int32) int32 { /* sqlite3.c:204784:12: */
+func rbuVfsLock(tls *libc.TLS, pFile uintptr, eLock int32) int32 { /* sqlite3.c:206507:12: */
var p uintptr = pFile
var pRbu uintptr = (*Rbu_file)(unsafe.Pointer(p)).FpRbu
var rc int32 = SQLITE_OK
- if (eLock == SQLITE_LOCK_EXCLUSIVE) &&
- (((*Rbu_file)(unsafe.Pointer(p)).FbNolock != 0) || ((pRbu != 0) && ((*Sqlite3rbu)(unsafe.Pointer(pRbu)).FeStage != RBU_STAGE_DONE))) {
+ if eLock == SQLITE_LOCK_EXCLUSIVE &&
+ ((*Rbu_file)(unsafe.Pointer(p)).FbNolock != 0 || pRbu != 0 && (*Sqlite3rbu)(unsafe.Pointer(pRbu)).FeStage != RBU_STAGE_DONE) {
// Do not allow EXCLUSIVE locks. Preventing SQLite from taking this
// prevents it from checkpointing the database from sqlite3_close().
rc = SQLITE_BUSY
@@ -164646,7 +166937,7 @@ func rbuVfsLock(tls *libc.TLS, pFile uintptr, eLock int32) int32 { /* sqlite3.c:
}
// Unlock an rbuVfs-file.
-func rbuVfsUnlock(tls *libc.TLS, pFile uintptr, eLock int32) int32 { /* sqlite3.c:204806:12: */
+func rbuVfsUnlock(tls *libc.TLS, pFile uintptr, eLock int32) int32 { /* sqlite3.c:206529:12: */
var p uintptr = pFile
return (*struct {
f func(*libc.TLS, uintptr, int32) int32
@@ -164654,7 +166945,7 @@ func rbuVfsUnlock(tls *libc.TLS, pFile uintptr, eLock int32) int32 { /* sqlite3.
}
// Check if another file-handle holds a RESERVED lock on an rbuVfs-file.
-func rbuVfsCheckReservedLock(tls *libc.TLS, pFile uintptr, pResOut uintptr) int32 { /* sqlite3.c:204814:12: */
+func rbuVfsCheckReservedLock(tls *libc.TLS, pFile uintptr, pResOut uintptr) int32 { /* sqlite3.c:206537:12: */
var p uintptr = pFile
return (*struct {
f func(*libc.TLS, uintptr, uintptr) int32
@@ -164662,7 +166953,7 @@ func rbuVfsCheckReservedLock(tls *libc.TLS, pFile uintptr, pResOut uintptr) int3
}
// File control method. For custom operations on an rbuVfs-file.
-func rbuVfsFileControl(tls *libc.TLS, pFile uintptr, op int32, pArg uintptr) int32 { /* sqlite3.c:204822:12: */
+func rbuVfsFileControl(tls *libc.TLS, pFile uintptr, op int32, pArg uintptr) int32 { /* sqlite3.c:206545:12: */
bp := tls.Alloc(20)
defer tls.Free(20)
@@ -164689,7 +166980,7 @@ func rbuVfsFileControl(tls *libc.TLS, pFile uintptr, op int32, pArg uintptr) int
})(unsafe.Pointer(&struct{ uintptr }{xControl})).f(tls, (*Rbu_file)(unsafe.Pointer(p)).FpReal, SQLITE_FCNTL_ZIPVFS, bp+16 /* &dummy */)
if rc == SQLITE_OK {
rc = SQLITE_ERROR
- (*Sqlite3rbu)(unsafe.Pointer(pRbu)).FzErrmsg = Xsqlite3_mprintf(tls, ts+30499 /* "rbu/zipvfs setup..." */, 0)
+ (*Sqlite3rbu)(unsafe.Pointer(pRbu)).FzErrmsg = Xsqlite3_mprintf(tls, ts+31859 /* "rbu/zipvfs setup..." */, 0)
} else if rc == SQLITE_NOTFOUND {
(*Sqlite3rbu)(unsafe.Pointer(pRbu)).FpTargetFd = p
(*Rbu_file)(unsafe.Pointer(p)).FpRbu = pRbu
@@ -164711,10 +167002,10 @@ func rbuVfsFileControl(tls *libc.TLS, pFile uintptr, op int32, pArg uintptr) int
rc = (*struct {
f func(*libc.TLS, uintptr, int32, uintptr) int32
})(unsafe.Pointer(&struct{ uintptr }{xControl})).f(tls, (*Rbu_file)(unsafe.Pointer(p)).FpReal, op, pArg)
- if (rc == SQLITE_OK) && (op == SQLITE_FCNTL_VFSNAME) {
+ if rc == SQLITE_OK && op == SQLITE_FCNTL_VFSNAME {
var pRbuVfs uintptr = (*Rbu_file)(unsafe.Pointer(p)).FpRbuVfs
var zIn uintptr = *(*uintptr)(unsafe.Pointer(pArg))
- var zOut uintptr = Xsqlite3_mprintf(tls, ts+30522 /* "rbu(%s)/%z" */, libc.VaList(bp, (*Rbu_vfs)(unsafe.Pointer(pRbuVfs)).Fbase.FzName, zIn))
+ var zOut uintptr = Xsqlite3_mprintf(tls, ts+31882 /* "rbu(%s)/%z" */, libc.VaList(bp, (*Rbu_vfs)(unsafe.Pointer(pRbuVfs)).Fbase.FzName, zIn))
*(*uintptr)(unsafe.Pointer(pArg)) = zOut
if zOut == uintptr(0) {
rc = SQLITE_NOMEM
@@ -164725,7 +167016,7 @@ func rbuVfsFileControl(tls *libc.TLS, pFile uintptr, op int32, pArg uintptr) int
}
// Return the sector-size in bytes for an rbuVfs-file.
-func rbuVfsSectorSize(tls *libc.TLS, pFile uintptr) int32 { /* sqlite3.c:204878:12: */
+func rbuVfsSectorSize(tls *libc.TLS, pFile uintptr) int32 { /* sqlite3.c:206601:12: */
var p uintptr = pFile
return (*struct {
f func(*libc.TLS, uintptr) int32
@@ -164733,7 +167024,7 @@ func rbuVfsSectorSize(tls *libc.TLS, pFile uintptr) int32 { /* sqlite3.c:204878:
}
// Return the device characteristic flags supported by an rbuVfs-file.
-func rbuVfsDeviceCharacteristics(tls *libc.TLS, pFile uintptr) int32 { /* sqlite3.c:204886:12: */
+func rbuVfsDeviceCharacteristics(tls *libc.TLS, pFile uintptr) int32 { /* sqlite3.c:206609:12: */
var p uintptr = pFile
return (*struct {
f func(*libc.TLS, uintptr) int32
@@ -164741,31 +167032,31 @@ func rbuVfsDeviceCharacteristics(tls *libc.TLS, pFile uintptr) int32 { /* sqlite
}
// Take or release a shared-memory lock.
-func rbuVfsShmLock(tls *libc.TLS, pFile uintptr, ofst int32, n int32, flags int32) int32 { /* sqlite3.c:204894:12: */
+func rbuVfsShmLock(tls *libc.TLS, pFile uintptr, ofst int32, n int32, flags int32) int32 { /* sqlite3.c:206617:12: */
var p uintptr = pFile
var pRbu uintptr = (*Rbu_file)(unsafe.Pointer(p)).FpRbu
var rc int32 = SQLITE_OK
- if (pRbu != 0) && ((((*Sqlite3rbu)(unsafe.Pointer(pRbu)).FeStage == RBU_STAGE_OAL) ||
- ((*Sqlite3rbu)(unsafe.Pointer(pRbu)).FeStage == RBU_STAGE_MOVE)) ||
- ((*Sqlite3rbu)(unsafe.Pointer(pRbu)).FeStage == RBU_STAGE_DONE)) {
+ if pRbu != 0 && ((*Sqlite3rbu)(unsafe.Pointer(pRbu)).FeStage == RBU_STAGE_OAL ||
+ (*Sqlite3rbu)(unsafe.Pointer(pRbu)).FeStage == RBU_STAGE_MOVE ||
+ (*Sqlite3rbu)(unsafe.Pointer(pRbu)).FeStage == RBU_STAGE_DONE) {
// Prevent SQLite from taking a shm-lock on the target file when it
// is supplying heap memory to the upper layer in place of *-shm
// segments.
- if (ofst == WAL_LOCK_CKPT) && (n == 1) {
+ if ofst == WAL_LOCK_CKPT && n == 1 {
rc = SQLITE_BUSY
}
} else {
var bCapture int32 = 0
- if (pRbu != 0) && ((*Sqlite3rbu)(unsafe.Pointer(pRbu)).FeStage == RBU_STAGE_CAPTURE) {
+ if pRbu != 0 && (*Sqlite3rbu)(unsafe.Pointer(pRbu)).FeStage == RBU_STAGE_CAPTURE {
bCapture = 1
}
- if (bCapture == 0) || (0 == (flags & SQLITE_SHM_UNLOCK)) {
+ if bCapture == 0 || 0 == flags&SQLITE_SHM_UNLOCK {
rc = (*struct {
f func(*libc.TLS, uintptr, int32, int32, int32) int32
})(unsafe.Pointer(&struct{ uintptr }{(*sqlite3_io_methods)(unsafe.Pointer((*Sqlite3_file)(unsafe.Pointer((*Rbu_file)(unsafe.Pointer(p)).FpReal)).FpMethods)).FxShmLock})).f(tls, (*Rbu_file)(unsafe.Pointer(p)).FpReal, ofst, n, flags)
- if (bCapture != 0) && (rc == SQLITE_OK) {
- *(*U32)(unsafe.Pointer(pRbu + 188 /* &.mLock */)) |= (U32(((int32(1) << n) - 1) << ofst))
+ if bCapture != 0 && rc == SQLITE_OK {
+ *(*U32)(unsafe.Pointer(pRbu + 188)) |= U32((int32(1)<<n - 1) << ofst)
}
}
}
@@ -164774,7 +167065,7 @@ func rbuVfsShmLock(tls *libc.TLS, pFile uintptr, ofst int32, n int32, flags int3
}
// Obtain a pointer to a mapping of a single 32KiB page of the *-shm file.
-func rbuVfsShmMap(tls *libc.TLS, pFile uintptr, iRegion int32, szRegion int32, isWrite int32, pp uintptr) int32 { /* sqlite3.c:204932:12: */
+func rbuVfsShmMap(tls *libc.TLS, pFile uintptr, iRegion int32, szRegion int32, isWrite int32, pp uintptr) int32 { /* sqlite3.c:206655:12: */
var p uintptr = pFile
var rc int32 = SQLITE_OK
var eStage int32 = func() int32 {
@@ -164789,7 +167080,7 @@ func rbuVfsShmMap(tls *libc.TLS, pFile uintptr, iRegion int32, szRegion int32, i
// instead of a file on disk.
if eStage == RBU_STAGE_OAL {
- var nByte Sqlite3_int64 = (Sqlite3_int64((uint32(iRegion + 1)) * uint32(unsafe.Sizeof(uintptr(0)))))
+ var nByte Sqlite3_int64 = Sqlite3_int64(uint32(iRegion+1) * uint32(unsafe.Sizeof(uintptr(0))))
var apNew uintptr = Xsqlite3_realloc64(tls, (*Rbu_file)(unsafe.Pointer(p)).FapShm, uint64(nByte))
// This is an RBU connection that uses its own heap memory for the
@@ -164800,9 +167091,9 @@ func rbuVfsShmMap(tls *libc.TLS, pFile uintptr, iRegion int32, szRegion int32, i
if apNew == uintptr(0) {
rc = SQLITE_NOMEM
} else {
- libc.Xmemset(tls, (apNew + uintptr((*Rbu_file)(unsafe.Pointer(p)).FnShm)*4), 0, (uint32(unsafe.Sizeof(uintptr(0))) * (uint32((1 + iRegion) - (*Rbu_file)(unsafe.Pointer(p)).FnShm))))
+ libc.Xmemset(tls, apNew+uintptr((*Rbu_file)(unsafe.Pointer(p)).FnShm)*4, 0, uint32(unsafe.Sizeof(uintptr(0)))*uint32(1+iRegion-(*Rbu_file)(unsafe.Pointer(p)).FnShm))
(*Rbu_file)(unsafe.Pointer(p)).FapShm = apNew
- (*Rbu_file)(unsafe.Pointer(p)).FnShm = (iRegion + 1)
+ (*Rbu_file)(unsafe.Pointer(p)).FnShm = iRegion + 1
}
if rc == SQLITE_OK {
@@ -164831,13 +167122,13 @@ func rbuVfsShmMap(tls *libc.TLS, pFile uintptr, iRegion int32, szRegion int32, i
}
// Memory barrier.
-func rbuVfsShmBarrier(tls *libc.TLS, pFile uintptr) { /* sqlite3.c:204990:13: */
+func rbuVfsShmBarrier(tls *libc.TLS, pFile uintptr) { /* sqlite3.c:206713:13: */
var p uintptr = pFile
(*struct{ f func(*libc.TLS, uintptr) })(unsafe.Pointer(&struct{ uintptr }{(*sqlite3_io_methods)(unsafe.Pointer((*Sqlite3_file)(unsafe.Pointer((*Rbu_file)(unsafe.Pointer(p)).FpReal)).FpMethods)).FxShmBarrier})).f(tls, (*Rbu_file)(unsafe.Pointer(p)).FpReal)
}
// The xShmUnmap method.
-func rbuVfsShmUnmap(tls *libc.TLS, pFile uintptr, delFlag int32) int32 { /* sqlite3.c:204998:12: */
+func rbuVfsShmUnmap(tls *libc.TLS, pFile uintptr, delFlag int32) int32 { /* sqlite3.c:206721:12: */
var p uintptr = pFile
var rc int32 = SQLITE_OK
var eStage int32 = func() int32 {
@@ -164847,7 +167138,7 @@ func rbuVfsShmUnmap(tls *libc.TLS, pFile uintptr, delFlag int32) int32 { /* sqli
return 0
}()
- if (eStage == RBU_STAGE_OAL) || (eStage == RBU_STAGE_MOVE) {
+ if eStage == RBU_STAGE_OAL || eStage == RBU_STAGE_MOVE {
// no-op
} else {
// Release the checkpointer and writer locks
@@ -164860,7 +167151,7 @@ func rbuVfsShmUnmap(tls *libc.TLS, pFile uintptr, delFlag int32) int32 { /* sqli
}
// Open an rbu file handle.
-func rbuVfsOpen(tls *libc.TLS, pVfs uintptr, zName uintptr, pFile uintptr, flags int32, pOutFlags uintptr) int32 { /* sqlite3.c:205017:12: */
+func rbuVfsOpen(tls *libc.TLS, pVfs uintptr, zName uintptr, pFile uintptr, flags int32, pOutFlags uintptr) int32 { /* sqlite3.c:206740:12: */
var pRbuVfs uintptr = pVfs
var pRealVfs uintptr = (*Rbu_vfs)(unsafe.Pointer(pRbuVfs)).FpRealVfs
var pFd uintptr = pFile
@@ -164869,29 +167160,29 @@ func rbuVfsOpen(tls *libc.TLS, pVfs uintptr, zName uintptr, pFile uintptr, flags
var oflags int32 = flags
libc.Xmemset(tls, pFd, 0, uint32(unsafe.Sizeof(Rbu_file{})))
- (*Rbu_file)(unsafe.Pointer(pFd)).FpReal = (pFd + 1*64)
+ (*Rbu_file)(unsafe.Pointer(pFd)).FpReal = pFd + 1*64
(*Rbu_file)(unsafe.Pointer(pFd)).FpRbuVfs = pRbuVfs
(*Rbu_file)(unsafe.Pointer(pFd)).FopenFlags = flags
if zName != 0 {
- if (flags & SQLITE_OPEN_MAIN_DB) != 0 {
+ if flags&SQLITE_OPEN_MAIN_DB != 0 {
// A main database has just been opened. The following block sets
// (pFd->zWal) to point to a buffer owned by SQLite that contains
// the name of the *-wal file this db connection will use. SQLite
// happens to pass a pointer to this buffer when using xAccess()
// or xOpen() to operate on the *-wal file.
(*Rbu_file)(unsafe.Pointer(pFd)).FzWal = Xsqlite3_filename_wal(tls, zName)
- } else if (flags & SQLITE_OPEN_WAL) != 0 {
+ } else if flags&SQLITE_OPEN_WAL != 0 {
var pDb uintptr = rbuFindMaindb(tls, pRbuVfs, zName, 0)
if pDb != 0 {
- if ((*Rbu_file)(unsafe.Pointer(pDb)).FpRbu != 0) && ((*Sqlite3rbu)(unsafe.Pointer((*Rbu_file)(unsafe.Pointer(pDb)).FpRbu)).FeStage == RBU_STAGE_OAL) {
+ if (*Rbu_file)(unsafe.Pointer(pDb)).FpRbu != 0 && (*Sqlite3rbu)(unsafe.Pointer((*Rbu_file)(unsafe.Pointer(pDb)).FpRbu)).FeStage == RBU_STAGE_OAL {
// This call is to open a *-wal file. Intead, open the *-oal.
var nOpen Size_t
- if (*Sqlite3rbu)(unsafe.Pointer(((*Rbu_file)(unsafe.Pointer(pDb)).FpRbu))).FzTarget == uintptr(0) {
- zOpen = Xsqlite3_db_filename(tls, (*Sqlite3rbu)(unsafe.Pointer((*Rbu_file)(unsafe.Pointer(pDb)).FpRbu)).FdbRbu, ts+5458 /* "main" */)
+ if (*Sqlite3rbu)(unsafe.Pointer((*Rbu_file)(unsafe.Pointer(pDb)).FpRbu)).FzTarget == uintptr(0) {
+ zOpen = Xsqlite3_db_filename(tls, (*Sqlite3rbu)(unsafe.Pointer((*Rbu_file)(unsafe.Pointer(pDb)).FpRbu)).FdbRbu, ts+6305 /* "main" */)
zOpen = Xsqlite3_filename_wal(tls, zOpen)
}
nOpen = libc.Xstrlen(tls, zOpen)
- *(*uint8)(unsafe.Pointer((zOpen) + uintptr((nOpen - Size_t(3))))) = uint8('o')
+ *(*uint8)(unsafe.Pointer(zOpen + uintptr(nOpen-Size_t(3)))) = uint8('o')
(*Rbu_file)(unsafe.Pointer(pFd)).FpRbu = (*Rbu_file)(unsafe.Pointer(pDb)).FpRbu
}
(*Rbu_file)(unsafe.Pointer(pDb)).FpWalFd = pFd
@@ -164901,10 +167192,10 @@ func rbuVfsOpen(tls *libc.TLS, pVfs uintptr, zName uintptr, pFile uintptr, flags
(*Rbu_file)(unsafe.Pointer(pFd)).FpRbu = (*Rbu_vfs)(unsafe.Pointer(pRbuVfs)).FpRbu
}
- if ((oflags & SQLITE_OPEN_MAIN_DB) != 0) &&
- (Xsqlite3_uri_boolean(tls, zName, ts+30533 /* "rbu_memory" */, 0) != 0) {
+ if oflags&SQLITE_OPEN_MAIN_DB != 0 &&
+ Xsqlite3_uri_boolean(tls, zName, ts+31893, 0) != 0 {
- oflags = ((((SQLITE_OPEN_TEMP_DB | SQLITE_OPEN_READWRITE) | SQLITE_OPEN_CREATE) | SQLITE_OPEN_EXCLUSIVE) | SQLITE_OPEN_DELETEONCLOSE)
+ oflags = SQLITE_OPEN_TEMP_DB | SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE | SQLITE_OPEN_EXCLUSIVE | SQLITE_OPEN_DELETEONCLOSE
zOpen = uintptr(0)
}
@@ -164918,7 +167209,7 @@ func rbuVfsOpen(tls *libc.TLS, pVfs uintptr, zName uintptr, pFile uintptr, flags
// pointer and, if the file is a main database file, link it into the
// mutex protected linked list of all such files.
(*Sqlite3_file)(unsafe.Pointer(pFile)).FpMethods = uintptr(unsafe.Pointer(&rbuvfs_io_methods))
- if (flags & SQLITE_OPEN_MAIN_DB) != 0 {
+ if flags&SQLITE_OPEN_MAIN_DB != 0 {
rbuMainlistAdd(tls, pFd)
}
} else {
@@ -164946,10 +167237,10 @@ var rbuvfs_io_methods = Sqlite3_io_methods{
FxShmLock: 0, // xShmLock
FxShmBarrier: 0, // xShmBarrier
FxShmUnmap: 0, // xFetch, xUnfetch
-} /* sqlite3.c:205024:29 */
+} /* sqlite3.c:206747:29 */
// Delete the file located at zPath.
-func rbuVfsDelete(tls *libc.TLS, pVfs uintptr, zPath uintptr, dirSync int32) int32 { /* sqlite3.c:205115:12: */
+func rbuVfsDelete(tls *libc.TLS, pVfs uintptr, zPath uintptr, dirSync int32) int32 { /* sqlite3.c:206838:12: */
var pRealVfs uintptr = (*Rbu_vfs)(unsafe.Pointer(pVfs)).FpRealVfs
return (*struct {
f func(*libc.TLS, uintptr, uintptr, int32) int32
@@ -164958,7 +167249,7 @@ func rbuVfsDelete(tls *libc.TLS, pVfs uintptr, zPath uintptr, dirSync int32) int
// Test for access permissions. Return true if the requested permission
// is available, or false otherwise.
-func rbuVfsAccess(tls *libc.TLS, pVfs uintptr, zPath uintptr, flags int32, pResOut uintptr) int32 { /* sqlite3.c:205124:12: */
+func rbuVfsAccess(tls *libc.TLS, pVfs uintptr, zPath uintptr, flags int32, pResOut uintptr) int32 { /* sqlite3.c:206847:12: */
bp := tls.Alloc(8)
defer tls.Free(8)
@@ -164983,16 +167274,16 @@ func rbuVfsAccess(tls *libc.TLS, pVfs uintptr, zPath uintptr, flags int32, pResO
// causing SQLite to call xOpen() to open it. This call will also
// be intercepted (see the rbuVfsOpen() function) and the *-oal
// file opened instead.
- if (rc == SQLITE_OK) && (flags == SQLITE_ACCESS_EXISTS) {
+ if rc == SQLITE_OK && flags == SQLITE_ACCESS_EXISTS {
var pDb uintptr = rbuFindMaindb(tls, pRbuVfs, zPath, 1)
- if (pDb != 0) && ((*Sqlite3rbu)(unsafe.Pointer((*Rbu_file)(unsafe.Pointer(pDb)).FpRbu)).FeStage == RBU_STAGE_OAL) {
+ if pDb != 0 && (*Sqlite3rbu)(unsafe.Pointer((*Rbu_file)(unsafe.Pointer(pDb)).FpRbu)).FeStage == RBU_STAGE_OAL {
if *(*int32)(unsafe.Pointer(pResOut)) != 0 {
rc = SQLITE_CANTOPEN
} else {
*(*Sqlite3_int64)(unsafe.Pointer(bp /* sz */)) = int64(0)
- rc = rbuVfsFileSize(tls, (pDb /* &.base */), bp /* &sz */)
- *(*int32)(unsafe.Pointer(pResOut)) = (libc.Bool32(*(*Sqlite3_int64)(unsafe.Pointer(bp /* sz */)) > int64(0)))
+ rc = rbuVfsFileSize(tls, pDb, bp /* &sz */)
+ *(*int32)(unsafe.Pointer(pResOut)) = libc.Bool32(*(*Sqlite3_int64)(unsafe.Pointer(bp)) > int64(0))
}
}
}
@@ -165003,7 +167294,7 @@ func rbuVfsAccess(tls *libc.TLS, pVfs uintptr, zPath uintptr, flags int32, pResO
// Populate buffer zOut with the full canonical pathname corresponding
// to the pathname in zPath. zOut is guaranteed to point to a buffer
// of at least (DEVSYM_MAX_PATHNAME+1) bytes.
-func rbuVfsFullPathname(tls *libc.TLS, pVfs uintptr, zPath uintptr, nOut int32, zOut uintptr) int32 { /* sqlite3.c:205172:12: */
+func rbuVfsFullPathname(tls *libc.TLS, pVfs uintptr, zPath uintptr, nOut int32, zOut uintptr) int32 { /* sqlite3.c:206895:12: */
var pRealVfs uintptr = (*Rbu_vfs)(unsafe.Pointer(pVfs)).FpRealVfs
return (*struct {
f func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32
@@ -165011,7 +167302,7 @@ func rbuVfsFullPathname(tls *libc.TLS, pVfs uintptr, zPath uintptr, nOut int32,
}
// Open the dynamic library located at zPath and return a handle.
-func rbuVfsDlOpen(tls *libc.TLS, pVfs uintptr, zPath uintptr) uintptr { /* sqlite3.c:205186:13: */
+func rbuVfsDlOpen(tls *libc.TLS, pVfs uintptr, zPath uintptr) uintptr { /* sqlite3.c:206909:13: */
var pRealVfs uintptr = (*Rbu_vfs)(unsafe.Pointer(pVfs)).FpRealVfs
return (*struct {
f func(*libc.TLS, uintptr, uintptr) uintptr
@@ -165021,7 +167312,7 @@ func rbuVfsDlOpen(tls *libc.TLS, pVfs uintptr, zPath uintptr) uintptr { /* sqlit
// Populate the buffer zErrMsg (size nByte bytes) with a human readable
// utf-8 string describing the most recent error encountered associated
// with dynamic libraries.
-func rbuVfsDlError(tls *libc.TLS, pVfs uintptr, nByte int32, zErrMsg uintptr) { /* sqlite3.c:205196:13: */
+func rbuVfsDlError(tls *libc.TLS, pVfs uintptr, nByte int32, zErrMsg uintptr) { /* sqlite3.c:206919:13: */
var pRealVfs uintptr = (*Rbu_vfs)(unsafe.Pointer(pVfs)).FpRealVfs
(*struct {
f func(*libc.TLS, uintptr, int32, uintptr)
@@ -165029,7 +167320,7 @@ func rbuVfsDlError(tls *libc.TLS, pVfs uintptr, nByte int32, zErrMsg uintptr) {
}
// Return a pointer to the symbol zSymbol in the dynamic library pHandle.
-func rbuVfsDlSym(tls *libc.TLS, pVfs uintptr, pArg uintptr, zSym uintptr) uintptr { /* sqlite3.c:205204:13: */
+func rbuVfsDlSym(tls *libc.TLS, pVfs uintptr, pArg uintptr, zSym uintptr) uintptr { /* sqlite3.c:206927:13: */
var pRealVfs uintptr = (*Rbu_vfs)(unsafe.Pointer(pVfs)).FpRealVfs
return (*struct {
f func(*libc.TLS, uintptr, uintptr, uintptr) uintptr
@@ -165037,7 +167328,7 @@ func rbuVfsDlSym(tls *libc.TLS, pVfs uintptr, pArg uintptr, zSym uintptr) uintpt
}
// Close the dynamic library handle pHandle.
-func rbuVfsDlClose(tls *libc.TLS, pVfs uintptr, pHandle uintptr) { /* sqlite3.c:205216:13: */
+func rbuVfsDlClose(tls *libc.TLS, pVfs uintptr, pHandle uintptr) { /* sqlite3.c:206939:13: */
var pRealVfs uintptr = (*Rbu_vfs)(unsafe.Pointer(pVfs)).FpRealVfs
(*struct {
f func(*libc.TLS, uintptr, uintptr)
@@ -165046,7 +167337,7 @@ func rbuVfsDlClose(tls *libc.TLS, pVfs uintptr, pHandle uintptr) { /* sqlite3.c:
// Populate the buffer pointed to by zBufOut with nByte bytes of
// random data.
-func rbuVfsRandomness(tls *libc.TLS, pVfs uintptr, nByte int32, zBufOut uintptr) int32 { /* sqlite3.c:205226:12: */
+func rbuVfsRandomness(tls *libc.TLS, pVfs uintptr, nByte int32, zBufOut uintptr) int32 { /* sqlite3.c:206949:12: */
var pRealVfs uintptr = (*Rbu_vfs)(unsafe.Pointer(pVfs)).FpRealVfs
return (*struct {
f func(*libc.TLS, uintptr, int32, uintptr) int32
@@ -165055,7 +167346,7 @@ func rbuVfsRandomness(tls *libc.TLS, pVfs uintptr, nByte int32, zBufOut uintptr)
// Sleep for nMicro microseconds. Return the number of microseconds
// actually slept.
-func rbuVfsSleep(tls *libc.TLS, pVfs uintptr, nMicro int32) int32 { /* sqlite3.c:205235:12: */
+func rbuVfsSleep(tls *libc.TLS, pVfs uintptr, nMicro int32) int32 { /* sqlite3.c:206958:12: */
var pRealVfs uintptr = (*Rbu_vfs)(unsafe.Pointer(pVfs)).FpRealVfs
return (*struct {
f func(*libc.TLS, uintptr, int32) int32
@@ -165063,7 +167354,7 @@ func rbuVfsSleep(tls *libc.TLS, pVfs uintptr, nMicro int32) int32 { /* sqlite3.c
}
// Return the current time as a Julian Day number in *pTimeOut.
-func rbuVfsCurrentTime(tls *libc.TLS, pVfs uintptr, pTimeOut uintptr) int32 { /* sqlite3.c:205243:12: */
+func rbuVfsCurrentTime(tls *libc.TLS, pVfs uintptr, pTimeOut uintptr) int32 { /* sqlite3.c:206966:12: */
var pRealVfs uintptr = (*Rbu_vfs)(unsafe.Pointer(pVfs)).FpRealVfs
return (*struct {
f func(*libc.TLS, uintptr, uintptr) int32
@@ -165071,17 +167362,17 @@ func rbuVfsCurrentTime(tls *libc.TLS, pVfs uintptr, pTimeOut uintptr) int32 { /*
}
// No-op.
-func rbuVfsGetLastError(tls *libc.TLS, pVfs uintptr, a int32, b uintptr) int32 { /* sqlite3.c:205251:12: */
+func rbuVfsGetLastError(tls *libc.TLS, pVfs uintptr, a int32, b uintptr) int32 { /* sqlite3.c:206974:12: */
return 0
}
// Deregister and destroy an RBU vfs created by an earlier call to
// sqlite3rbu_create_vfs().
-func Xsqlite3rbu_destroy_vfs(tls *libc.TLS, zName uintptr) { /* sqlite3.c:205259:17: */
+func Xsqlite3rbu_destroy_vfs(tls *libc.TLS, zName uintptr) { /* sqlite3.c:206982:17: */
var pVfs uintptr = Xsqlite3_vfs_find(tls, zName)
- if (pVfs != 0) && ((*Sqlite3_vfs)(unsafe.Pointer(pVfs)).FxOpen == *(*uintptr)(unsafe.Pointer(&struct {
+ if pVfs != 0 && (*Sqlite3_vfs)(unsafe.Pointer(pVfs)).FxOpen == *(*uintptr)(unsafe.Pointer(&struct {
f func(*libc.TLS, uintptr, uintptr, uintptr, int32, uintptr) int32
- }{rbuVfsOpen}))) {
+ }{rbuVfsOpen})) {
Xsqlite3_mutex_free(tls, (*Rbu_vfs)(unsafe.Pointer(pVfs)).Fmutex)
Xsqlite3_vfs_unregister(tls, pVfs)
Xsqlite3_free(tls, pVfs)
@@ -165091,7 +167382,7 @@ func Xsqlite3rbu_destroy_vfs(tls *libc.TLS, zName uintptr) { /* sqlite3.c:205259
// Create an RBU VFS named zName that accesses the underlying file-system
// via existing VFS zParent. The new object is registered as a non-default
// VFS with SQLite before returning.
-func Xsqlite3rbu_create_vfs(tls *libc.TLS, zName uintptr, zParent uintptr) int32 { /* sqlite3.c:205273:16: */
+func Xsqlite3rbu_create_vfs(tls *libc.TLS, zName uintptr, zParent uintptr) int32 { /* sqlite3.c:206996:16: */
var pNew uintptr = uintptr(0) // Newly allocated VFS
var rc int32 = SQLITE_OK
@@ -165099,7 +167390,7 @@ func Xsqlite3rbu_create_vfs(tls *libc.TLS, zName uintptr, zParent uintptr) int32
var nByte Size_t
nName = libc.Xstrlen(tls, zName)
- nByte = ((uint32(unsafe.Sizeof(Rbu_vfs{})) + nName) + uint32(1))
+ nByte = uint32(unsafe.Sizeof(Rbu_vfs{})) + nName + uint32(1)
pNew = Xsqlite3_malloc64(tls, uint64(nByte))
if pNew == uintptr(0) {
rc = SQLITE_NOMEM
@@ -165111,11 +167402,11 @@ func Xsqlite3rbu_create_vfs(tls *libc.TLS, zName uintptr, zParent uintptr) int32
rc = SQLITE_NOTFOUND
} else {
var zSpace uintptr
- libc.Xmemcpy(tls, (pNew /* &.base */), uintptr(unsafe.Pointer(&vfs_template)), uint32(unsafe.Sizeof(Sqlite3_vfs{})))
+ libc.Xmemcpy(tls, pNew, uintptr(unsafe.Pointer(&vfs_template)), uint32(unsafe.Sizeof(Sqlite3_vfs{})))
(*Rbu_vfs)(unsafe.Pointer(pNew)).Fbase.FmxPathname = (*Sqlite3_vfs)(unsafe.Pointer(pParent)).FmxPathname
- (*Rbu_vfs)(unsafe.Pointer(pNew)).Fbase.FszOsFile = (int32(uint32(unsafe.Sizeof(Rbu_file{})) + uint32((*Sqlite3_vfs)(unsafe.Pointer(pParent)).FszOsFile)))
+ (*Rbu_vfs)(unsafe.Pointer(pNew)).Fbase.FszOsFile = int32(uint32(unsafe.Sizeof(Rbu_file{})) + uint32((*Sqlite3_vfs)(unsafe.Pointer(pParent)).FszOsFile))
(*Rbu_vfs)(unsafe.Pointer(pNew)).FpRealVfs = pParent
- (*Rbu_vfs)(unsafe.Pointer(pNew)).Fbase.FzName = libc.AssignUintptr(&zSpace, (pNew + 1*108))
+ (*Rbu_vfs)(unsafe.Pointer(pNew)).Fbase.FzName = libc.AssignUintptr(&zSpace, pNew+1*108)
libc.Xmemcpy(tls, zSpace, zName, nName)
// Allocate the mutex and register the new VFS (not as the default)
@@ -165123,7 +167414,7 @@ func Xsqlite3rbu_create_vfs(tls *libc.TLS, zName uintptr, zParent uintptr) int32
if (*Rbu_vfs)(unsafe.Pointer(pNew)).Fmutex == uintptr(0) {
rc = SQLITE_NOMEM
} else {
- rc = Xsqlite3_vfs_register(tls, (pNew /* &.base */), 0)
+ rc = Xsqlite3_vfs_register(tls, pNew, 0)
}
}
@@ -165152,17 +167443,17 @@ var vfs_template = Sqlite3_vfs{
FxSleep: 0, // xSleep
FxCurrentTime: 0, // xCurrentTime
FxGetLastError: 0, // Unimplemented version 3 methods
-} /* sqlite3.c:205276:22 */
+} /* sqlite3.c:206999:22 */
// Configure the aggregate temp file size limit for this RBU handle.
-func Xsqlite3rbu_temp_size_limit(tls *libc.TLS, pRbu uintptr, n Sqlite3_int64) Sqlite3_int64 { /* sqlite3.c:205351:26: */
+func Xsqlite3rbu_temp_size_limit(tls *libc.TLS, pRbu uintptr, n Sqlite3_int64) Sqlite3_int64 { /* sqlite3.c:207074:26: */
if n >= int64(0) {
(*Sqlite3rbu)(unsafe.Pointer(pRbu)).FszTempLimit = n
}
return (*Sqlite3rbu)(unsafe.Pointer(pRbu)).FszTempLimit
}
-func Xsqlite3rbu_temp_size(tls *libc.TLS, pRbu uintptr) Sqlite3_int64 { /* sqlite3.c:205358:26: */
+func Xsqlite3rbu_temp_size(tls *libc.TLS, pRbu uintptr) Sqlite3_int64 { /* sqlite3.c:207081:26: */
return (*Sqlite3rbu)(unsafe.Pointer(pRbu)).FszTemp
}
@@ -165245,7 +167536,7 @@ type SessionTable1 = struct {
FnEntry int32
FnChange int32
FapChange uintptr
-} /* sqlite3.c:11155:9 */
+} /* sqlite3.c:10518:9 */
//************************************************************************
@@ -165316,7 +167607,7 @@ type SessionTable1 = struct {
// #include <assert.h>
// #include <string.h>
-type SessionTable = SessionTable1 /* sqlite3.c:206655:29 */
+type SessionTable = SessionTable1 /* sqlite3.c:208425:29 */
type SessionChange1 = struct {
Fop U8
FbIndirect U8
@@ -165325,16 +167616,16 @@ type SessionChange1 = struct {
FnRecord int32
FaRecord uintptr
FpNext uintptr
-} /* sqlite3.c:11155:9 */
+} /* sqlite3.c:10518:9 */
-type SessionChange = SessionChange1 /* sqlite3.c:206656:30 */
+type SessionChange = SessionChange1 /* sqlite3.c:208426:30 */
type SessionBuffer1 = struct {
FaBuf uintptr
FnBuf int32
FnAlloc int32
-} /* sqlite3.c:11163:9 */
+} /* sqlite3.c:10526:9 */
-type SessionBuffer = SessionBuffer1 /* sqlite3.c:206657:30 */
+type SessionBuffer = SessionBuffer1 /* sqlite3.c:208427:30 */
type SessionInput1 = struct {
FbNoDiscard int32
FiCurrent int32
@@ -165345,13 +167636,13 @@ type SessionInput1 = struct {
FxInput uintptr
FpIn uintptr
FbEof int32
-} /* sqlite3.c:11163:9 */
+} /* sqlite3.c:10526:9 */
-type SessionInput = SessionInput1 /* sqlite3.c:206658:29 */
+type SessionInput = SessionInput1 /* sqlite3.c:208428:29 */
// Minimum chunk size used by streaming versions of functions.
-var sessions_strm_chunk_size int32 = SESSIONS_STRM_CHUNK_SIZE /* sqlite3.c:206671:12 */
+var sessions_strm_chunk_size int32 = SESSIONS_STRM_CHUNK_SIZE /* sqlite3.c:208441:12 */
type SessionHook1 = struct {
FpCtx uintptr
@@ -165359,15 +167650,15 @@ type SessionHook1 = struct {
FxNew uintptr
FxCount uintptr
FxDepth uintptr
-} /* sqlite3.c:11155:9 */
+} /* sqlite3.c:10518:9 */
-type SessionHook = SessionHook1 /* sqlite3.c:206673:28 */
+type SessionHook = SessionHook1 /* sqlite3.c:208443:28 */
// Write a varint with value iVal into the buffer at aBuf. Return the
// number of bytes written.
-func sessionVarintPut(tls *libc.TLS, aBuf uintptr, iVal int32) int32 { /* sqlite3.c:206951:12: */
+func sessionVarintPut(tls *libc.TLS, aBuf uintptr, iVal int32) int32 { /* sqlite3.c:208721:12: */
return int32(func() uint8 {
- if (U32(iVal)) < U32(0x80) {
+ if U32(iVal) < U32(0x80) {
return uint8(func() int32 { *(*U8)(unsafe.Pointer(aBuf)) = uint8(iVal); return 1 }())
}
return uint8(Xsqlite3PutVarint(tls, aBuf, uint64(iVal)))
@@ -165375,16 +167666,16 @@ func sessionVarintPut(tls *libc.TLS, aBuf uintptr, iVal int32) int32 { /* sqlite
}
// Return the number of bytes required to store value iVal as a varint.
-func sessionVarintLen(tls *libc.TLS, iVal int32) int32 { /* sqlite3.c:206958:12: */
+func sessionVarintLen(tls *libc.TLS, iVal int32) int32 { /* sqlite3.c:208728:12: */
return Xsqlite3VarintLen(tls, uint64(iVal))
}
// Read a varint value from aBuf[] into *piVal. Return the number of
// bytes read.
-func sessionVarintGet(tls *libc.TLS, aBuf uintptr, piVal uintptr) int32 { /* sqlite3.c:206966:12: */
+func sessionVarintGet(tls *libc.TLS, aBuf uintptr, piVal uintptr) int32 { /* sqlite3.c:208736:12: */
return int32(func() uint8 {
if int32(*(*U8)(unsafe.Pointer(aBuf))) < int32(U8(0x80)) {
- return uint8(func() int32 { (*(*int32)(unsafe.Pointer(piVal))) = int32(U32(*(*U8)(unsafe.Pointer(aBuf)))); return 1 }())
+ return uint8(func() int32 { *(*int32)(unsafe.Pointer(piVal)) = int32(U32(*(*U8)(unsafe.Pointer(aBuf)))); return 1 }())
}
return Xsqlite3GetVarint32(tls, aBuf, piVal)
}())
@@ -165394,23 +167685,23 @@ func sessionVarintGet(tls *libc.TLS, aBuf uintptr, piVal uintptr) int32 { /* sql
// Read a 64-bit big-endian integer value from buffer aRec[]. Return
// the value read.
-func sessionGetI64(tls *libc.TLS, aRec uintptr) Sqlite3_int64 { /* sqlite3.c:206977:22: */
- var x U64 = (U64((((U32(*(*U8)(unsafe.Pointer((aRec)))) << 24) | (U32(int32(*(*U8)(unsafe.Pointer((aRec) + 1))) << 16))) | (U32(int32(*(*U8)(unsafe.Pointer((aRec) + 2))) << 8))) | U32(*(*U8)(unsafe.Pointer((aRec) + 3)))))
- var y U32 = ((((U32(*(*U8)(unsafe.Pointer((aRec + uintptr(4))))) << 24) | (U32(int32(*(*U8)(unsafe.Pointer((aRec + uintptr(4)) + 1))) << 16))) | (U32(int32(*(*U8)(unsafe.Pointer((aRec + uintptr(4)) + 2))) << 8))) | U32(*(*U8)(unsafe.Pointer((aRec + uintptr(4)) + 3))))
- x = ((x << 32) + U64(y))
+func sessionGetI64(tls *libc.TLS, aRec uintptr) Sqlite3_int64 { /* sqlite3.c:208747:22: */
+ var x U64 = U64(U32(*(*U8)(unsafe.Pointer(aRec)))<<24 | U32(int32(*(*U8)(unsafe.Pointer(aRec + 1)))<<16) | U32(int32(*(*U8)(unsafe.Pointer(aRec + 2)))<<8) | U32(*(*U8)(unsafe.Pointer(aRec + 3))))
+ var y U32 = U32(*(*U8)(unsafe.Pointer(aRec + uintptr(4))))<<24 | U32(int32(*(*U8)(unsafe.Pointer(aRec + uintptr(4) + 1)))<<16) | U32(int32(*(*U8)(unsafe.Pointer(aRec + uintptr(4) + 2)))<<8) | U32(*(*U8)(unsafe.Pointer(aRec + uintptr(4) + 3)))
+ x = x<<32 + U64(y)
return Sqlite3_int64(x)
}
// Write a 64-bit big-endian integer value to the buffer aBuf[].
-func sessionPutI64(tls *libc.TLS, aBuf uintptr, i Sqlite3_int64) { /* sqlite3.c:206987:13: */
- *(*U8)(unsafe.Pointer(aBuf)) = (U8((i >> 56) & int64(0xFF)))
- *(*U8)(unsafe.Pointer(aBuf + 1)) = (U8((i >> 48) & int64(0xFF)))
- *(*U8)(unsafe.Pointer(aBuf + 2)) = (U8((i >> 40) & int64(0xFF)))
- *(*U8)(unsafe.Pointer(aBuf + 3)) = (U8((i >> 32) & int64(0xFF)))
- *(*U8)(unsafe.Pointer(aBuf + 4)) = (U8((i >> 24) & int64(0xFF)))
- *(*U8)(unsafe.Pointer(aBuf + 5)) = (U8((i >> 16) & int64(0xFF)))
- *(*U8)(unsafe.Pointer(aBuf + 6)) = (U8((i >> 8) & int64(0xFF)))
- *(*U8)(unsafe.Pointer(aBuf + 7)) = (U8((i >> 0) & int64(0xFF)))
+func sessionPutI64(tls *libc.TLS, aBuf uintptr, i Sqlite3_int64) { /* sqlite3.c:208757:13: */
+ *(*U8)(unsafe.Pointer(aBuf)) = U8(i >> 56 & int64(0xFF))
+ *(*U8)(unsafe.Pointer(aBuf + 1)) = U8(i >> 48 & int64(0xFF))
+ *(*U8)(unsafe.Pointer(aBuf + 2)) = U8(i >> 40 & int64(0xFF))
+ *(*U8)(unsafe.Pointer(aBuf + 3)) = U8(i >> 32 & int64(0xFF))
+ *(*U8)(unsafe.Pointer(aBuf + 4)) = U8(i >> 24 & int64(0xFF))
+ *(*U8)(unsafe.Pointer(aBuf + 5)) = U8(i >> 16 & int64(0xFF))
+ *(*U8)(unsafe.Pointer(aBuf + 6)) = U8(i >> 8 & int64(0xFF))
+ *(*U8)(unsafe.Pointer(aBuf + 7)) = U8(i >> 0 & int64(0xFF))
}
// This function is used to serialize the contents of value pValue (see
@@ -165424,7 +167715,7 @@ func sessionPutI64(tls *libc.TLS, aBuf uintptr, i Sqlite3_int64) { /* sqlite3.c:
// If no error occurs, SQLITE_OK is returned. Or, if an OOM error occurs
// within a call to sqlite3_value_text() (may fail if the db is utf-16))
// SQLITE_NOMEM is returned.
-func sessionSerializeValue(tls *libc.TLS, aBuf uintptr, pValue uintptr, pnWrite uintptr) int32 { /* sqlite3.c:207011:12: */
+func sessionSerializeValue(tls *libc.TLS, aBuf uintptr, pValue uintptr, pnWrite uintptr) int32 { /* sqlite3.c:208781:12: */
bp := tls.Alloc(16)
defer tls.Free(16)
@@ -165461,7 +167752,7 @@ func sessionSerializeValue(tls *libc.TLS, aBuf uintptr, pValue uintptr, pnWrite
*(*float64)(unsafe.Pointer(bp + 8 /* r */)) = Xsqlite3_value_double(tls, pValue)
libc.Xmemcpy(tls, bp /* &i */, bp+8 /* &r */, uint32(8))
}
- sessionPutI64(tls, (aBuf + 1), int64(*(*U64)(unsafe.Pointer(bp /* i */))))
+ sessionPutI64(tls, aBuf+1, int64(*(*U64)(unsafe.Pointer(bp /* i */))))
}
nByte = 9
break
@@ -165479,19 +167770,19 @@ func sessionSerializeValue(tls *libc.TLS, aBuf uintptr, pValue uintptr, pnWrite
z = Xsqlite3_value_blob(tls, pValue)
}
n = Xsqlite3_value_bytes(tls, pValue)
- if (z == uintptr(0)) && ((eType != SQLITE_BLOB) || (n > 0)) {
+ if z == uintptr(0) && (eType != SQLITE_BLOB || n > 0) {
return SQLITE_NOMEM
}
nVarint = sessionVarintLen(tls, n)
if aBuf != 0 {
- sessionVarintPut(tls, (aBuf + 1), n)
- if n != 0 {
- libc.Xmemcpy(tls, (aBuf + uintptr((nVarint + 1))), z, uint32(n))
+ sessionVarintPut(tls, aBuf+1, n)
+ if n > 0 {
+ libc.Xmemcpy(tls, aBuf+uintptr(nVarint+1), z, uint32(n))
}
}
- nByte = ((1 + nVarint) + n)
+ nByte = 1 + nVarint + n
break
}
@@ -165504,7 +167795,7 @@ func sessionSerializeValue(tls *libc.TLS, aBuf uintptr, pValue uintptr, pnWrite
}
if pnWrite != 0 {
- *(*Sqlite3_int64)(unsafe.Pointer(pnWrite)) += (Sqlite3_int64(nByte))
+ *(*Sqlite3_int64)(unsafe.Pointer(pnWrite)) += Sqlite3_int64(nByte)
}
return SQLITE_OK
}
@@ -165512,10 +167803,10 @@ func sessionSerializeValue(tls *libc.TLS, aBuf uintptr, pValue uintptr, pnWrite
// Allocate and return a pointer to a buffer nByte bytes in size. If
// pSession is not NULL, increase the sqlite3_session.nMalloc variable
// by the number of bytes allocated.
-func sessionMalloc64(tls *libc.TLS, pSession uintptr, nByte I64) uintptr { /* sqlite3.c:207087:13: */
+func sessionMalloc64(tls *libc.TLS, pSession uintptr, nByte I64) uintptr { /* sqlite3.c:208857:13: */
var pRet uintptr = Xsqlite3_malloc64(tls, uint64(nByte))
if pSession != 0 {
- *(*I64)(unsafe.Pointer(pSession + 40 /* &.nMalloc */)) += I64((Xsqlite3_msize(tls, pRet)))
+ *(*I64)(unsafe.Pointer(pSession + 40)) += I64(Xsqlite3_msize(tls, pRet))
}
return pRet
}
@@ -165523,9 +167814,9 @@ func sessionMalloc64(tls *libc.TLS, pSession uintptr, nByte I64) uintptr { /* sq
// Free buffer pFree, which must have been allocated by an earlier
// call to sessionMalloc64(). If pSession is not NULL, decrease the
// sqlite3_session.nMalloc counter by the number of bytes freed.
-func sessionFree(tls *libc.TLS, pSession uintptr, pFree uintptr) { /* sqlite3.c:207098:13: */
+func sessionFree(tls *libc.TLS, pSession uintptr, pFree uintptr) { /* sqlite3.c:208868:13: */
if pSession != 0 {
- *(*I64)(unsafe.Pointer(pSession + 40 /* &.nMalloc */)) -= I64((Xsqlite3_msize(tls, pFree)))
+ *(*I64)(unsafe.Pointer(pSession + 40)) -= I64(Xsqlite3_msize(tls, pFree))
}
Xsqlite3_free(tls, pFree)
}
@@ -165546,25 +167837,25 @@ func sessionFree(tls *libc.TLS, pSession uintptr, pFree uintptr) { /* sqlite3.c:
// Append the hash of the 64-bit integer passed as the second argument to the
// hash-key value passed as the first. Return the new hash-key value.
-func sessionHashAppendI64(tls *libc.TLS, h uint32, i I64) uint32 { /* sqlite3.c:207124:21: */
- h = ((((h) << 3) ^ (h)) ^ (uint32(i & int64(0xFFFFFFFF))))
- return ((((h) << 3) ^ (h)) ^ (uint32((i >> 32) & int64(0xFFFFFFFF))))
+func sessionHashAppendI64(tls *libc.TLS, h uint32, i I64) uint32 { /* sqlite3.c:208894:21: */
+ h = h<<3 ^ h ^ uint32(i&int64(0xFFFFFFFF))
+ return h<<3 ^ h ^ uint32(i>>32&int64(0xFFFFFFFF))
}
// Append the hash of the blob passed via the second and third arguments to
// the hash-key value passed as the first. Return the new hash-key value.
-func sessionHashAppendBlob(tls *libc.TLS, h uint32, n int32, z uintptr) uint32 { /* sqlite3.c:207133:21: */
+func sessionHashAppendBlob(tls *libc.TLS, h uint32, n int32, z uintptr) uint32 { /* sqlite3.c:208903:21: */
var i int32
for i = 0; i < n; i++ {
- h = ((((h) << 3) ^ (h)) ^ (uint32(*(*U8)(unsafe.Pointer(z + uintptr(i))))))
+ h = h<<3 ^ h ^ uint32(*(*U8)(unsafe.Pointer(z + uintptr(i))))
}
return h
}
// Append the hash of the data type passed as the second argument to the
// hash-key value passed as the first. Return the new hash-key value.
-func sessionHashAppendType(tls *libc.TLS, h uint32, eType int32) uint32 { /* sqlite3.c:207143:21: */
- return ((((h) << 3) ^ (h)) ^ (uint32(eType)))
+func sessionHashAppendType(tls *libc.TLS, h uint32, eType int32) uint32 { /* sqlite3.c:208913:21: */
+ return h<<3 ^ h ^ uint32(eType)
}
// This function may only be called from within a pre-update callback.
@@ -165576,7 +167867,7 @@ func sessionHashAppendType(tls *libc.TLS, h uint32, eType int32) uint32 { /* sql
// If an error occurs, an SQLite error code is returned and the final values
// of *piHash asn *pbNullPK are undefined. Otherwise, SQLITE_OK is returned
// and the output variables are set as described above.
-func sessionPreupdateHash(tls *libc.TLS, pSession uintptr, pTab uintptr, bNew int32, piHash uintptr, pbNullPK uintptr) int32 { /* sqlite3.c:207158:12: */
+func sessionPreupdateHash(tls *libc.TLS, pSession uintptr, pTab uintptr, bNew int32, piHash uintptr, pbNullPK uintptr) int32 { /* sqlite3.c:208928:12: */
bp := tls.Alloc(24)
defer tls.Free(24)
@@ -165604,7 +167895,7 @@ func sessionPreupdateHash(tls *libc.TLS, pSession uintptr, pTab uintptr, bNew in
eType = Xsqlite3_value_type(tls, *(*uintptr)(unsafe.Pointer(bp /* pVal */)))
h = sessionHashAppendType(tls, h, eType)
- if (eType == SQLITE_INTEGER) || (eType == SQLITE_FLOAT) {
+ if eType == SQLITE_INTEGER || eType == SQLITE_FLOAT {
// var iVal I64 at bp+8, 8
if eType == SQLITE_INTEGER {
@@ -165615,7 +167906,7 @@ func sessionPreupdateHash(tls *libc.TLS, pSession uintptr, pTab uintptr, bNew in
libc.Xmemcpy(tls, bp+8 /* &iVal */, bp+16 /* &rVal */, uint32(8))
}
h = sessionHashAppendI64(tls, h, *(*I64)(unsafe.Pointer(bp + 8 /* iVal */)))
- } else if (eType == SQLITE_TEXT) || (eType == SQLITE_BLOB) {
+ } else if eType == SQLITE_TEXT || eType == SQLITE_BLOB {
var z uintptr
var n int32
if eType == SQLITE_TEXT {
@@ -165624,7 +167915,7 @@ func sessionPreupdateHash(tls *libc.TLS, pSession uintptr, pTab uintptr, bNew in
z = Xsqlite3_value_blob(tls, *(*uintptr)(unsafe.Pointer(bp /* pVal */)))
}
n = Xsqlite3_value_bytes(tls, *(*uintptr)(unsafe.Pointer(bp /* pVal */)))
- if !(z != 0) && ((eType != SQLITE_BLOB) || (n > 0)) {
+ if !(z != 0) && (eType != SQLITE_BLOB || n > 0) {
return SQLITE_NOMEM
}
h = sessionHashAppendBlob(tls, h, n, z)
@@ -165635,30 +167926,30 @@ func sessionPreupdateHash(tls *libc.TLS, pSession uintptr, pTab uintptr, bNew in
}
}
- *(*int32)(unsafe.Pointer(piHash)) = (int32(h % uint32((*SessionTable)(unsafe.Pointer(pTab)).FnChange)))
+ *(*int32)(unsafe.Pointer(piHash)) = int32(h % uint32((*SessionTable)(unsafe.Pointer(pTab)).FnChange))
return SQLITE_OK
}
// The buffer that the argument points to contains a serialized SQL value.
// Return the number of bytes of space occupied by the value (including
// the type byte).
-func sessionSerialLen(tls *libc.TLS, a uintptr) int32 { /* sqlite3.c:207223:12: */
+func sessionSerialLen(tls *libc.TLS, a uintptr) int32 { /* sqlite3.c:208993:12: */
bp := tls.Alloc(4)
defer tls.Free(4)
var e int32 = int32(*(*U8)(unsafe.Pointer(a)))
// var n int32 at bp, 4
- if (e == 0) || (e == 0xFF) {
+ if e == 0 || e == 0xFF {
return 1
}
if e == SQLITE_NULL {
return 1
}
- if (e == SQLITE_INTEGER) || (e == SQLITE_FLOAT) {
+ if e == SQLITE_INTEGER || e == SQLITE_FLOAT {
return 9
}
- return ((sessionVarintGet(tls, (a+1), bp /* &n */) + 1) + *(*int32)(unsafe.Pointer(bp /* n */)))
+ return sessionVarintGet(tls, a+1, bp) + 1 + *(*int32)(unsafe.Pointer(bp))
}
// Based on the primary key values stored in change aRecord, calculate a
@@ -165668,7 +167959,7 @@ func sessionSerialLen(tls *libc.TLS, a uintptr) int32 { /* sqlite3.c:207223:12:
//
// The bPkOnly argument is non-zero if the record at aRecord[] is from
// a patchset DELETE. In this case the non-PK fields are omitted entirely.
-func sessionChangeHash(tls *libc.TLS, pTab uintptr, bPkOnly int32, aRecord uintptr, nBucket int32) uint32 { /* sqlite3.c:207241:21: */
+func sessionChangeHash(tls *libc.TLS, pTab uintptr, bPkOnly int32, aRecord uintptr, nBucket int32) uint32 { /* sqlite3.c:209011:21: */
bp := tls.Alloc(4)
defer tls.Free(4)
@@ -165679,7 +167970,7 @@ func sessionChangeHash(tls *libc.TLS, pTab uintptr, bPkOnly int32, aRecord uintp
for i = 0; i < (*SessionTable)(unsafe.Pointer(pTab)).FnCol; i++ {
var eType int32 = int32(*(*U8)(unsafe.Pointer(a)))
var isPK int32 = int32(*(*U8)(unsafe.Pointer((*SessionTable)(unsafe.Pointer(pTab)).FabPK + uintptr(i))))
- if (bPkOnly != 0) && (isPK == 0) {
+ if bPkOnly != 0 && isPK == 0 {
continue
}
@@ -165690,7 +167981,7 @@ func sessionChangeHash(tls *libc.TLS, pTab uintptr, bPkOnly int32, aRecord uintp
if isPK != 0 {
a++
h = sessionHashAppendType(tls, h, eType)
- if (eType == SQLITE_INTEGER) || (eType == SQLITE_FLOAT) {
+ if eType == SQLITE_INTEGER || eType == SQLITE_FLOAT {
h = sessionHashAppendI64(tls, h, sessionGetI64(tls, a))
a += uintptr(8)
} else {
@@ -165704,14 +167995,14 @@ func sessionChangeHash(tls *libc.TLS, pTab uintptr, bPkOnly int32, aRecord uintp
a += uintptr(sessionSerialLen(tls, a))
}
}
- return (h % uint32(nBucket))
+ return h % uint32(nBucket)
}
// Arguments aLeft and aRight are pointers to change records for table pTab.
// This function returns true if the two records apply to the same row (i.e.
// have the same values stored in the primary key columns), or false
// otherwise.
-func sessionChangeEqual(tls *libc.TLS, pTab uintptr, bLeftPkOnly int32, aLeft uintptr, bRightPkOnly int32, aRight uintptr) int32 { /* sqlite3.c:207290:12: */
+func sessionChangeEqual(tls *libc.TLS, pTab uintptr, bLeftPkOnly int32, aLeft uintptr, bRightPkOnly int32, aRight uintptr) int32 { /* sqlite3.c:209060:12: */
var a1 uintptr = aLeft // Cursor to iterate through aLeft
var a2 uintptr = aRight // Cursor to iterate through aRight
var iCol int32 // Used to iterate through table columns
@@ -165721,7 +168012,7 @@ func sessionChangeEqual(tls *libc.TLS, pTab uintptr, bLeftPkOnly int32, aLeft ui
var n1 int32 = sessionSerialLen(tls, a1)
var n2 int32 = sessionSerialLen(tls, a2)
- if (n1 != n2) || (libc.Xmemcmp(tls, a1, a2, uint32(n1)) != 0) {
+ if n1 != n2 || libc.Xmemcmp(tls, a1, a2, uint32(n1)) != 0 {
return 0
}
a1 += uintptr(n1)
@@ -165750,7 +168041,7 @@ func sessionChangeEqual(tls *libc.TLS, pTab uintptr, bLeftPkOnly int32, aLeft ui
// their. Otherwise, if aLeft contains a value, copy it. If neither
// record contains a value for a given column, then neither does the
// output record.
-func sessionMergeRecord(tls *libc.TLS, paOut uintptr, nCol int32, aLeft uintptr, aRight uintptr) { /* sqlite3.c:207333:13: */
+func sessionMergeRecord(tls *libc.TLS, paOut uintptr, nCol int32, aLeft uintptr, aRight uintptr) { /* sqlite3.c:209103:13: */
var a1 uintptr = aLeft // Cursor used to iterate through aLeft
var a2 uintptr = aRight // Cursor used to iterate through aRight
var aOut uintptr = *(*uintptr)(unsafe.Pointer(paOut)) // Output cursor
@@ -165789,7 +168080,7 @@ func sessionMergeRecord(tls *libc.TLS, paOut uintptr, nCol int32, aLeft uintptr,
// if( *paTwo is valid ) return *paTwo;
// return *paOne;
//
-func sessionMergeValue(tls *libc.TLS, paOne uintptr, paTwo uintptr, pnVal uintptr) uintptr { /* sqlite3.c:207379:11: */
+func sessionMergeValue(tls *libc.TLS, paOne uintptr, paTwo uintptr, pnVal uintptr) uintptr { /* sqlite3.c:209149:11: */
var a1 uintptr = *(*uintptr)(unsafe.Pointer(paOne))
var a2 uintptr = *(*uintptr)(unsafe.Pointer(paTwo))
var pRet uintptr = uintptr(0)
@@ -165801,7 +168092,7 @@ func sessionMergeValue(tls *libc.TLS, paOne uintptr, paTwo uintptr, pnVal uintpt
*(*int32)(unsafe.Pointer(pnVal)) = n2
pRet = a2
}
- *(*uintptr)(unsafe.Pointer(paTwo)) = (a2 + uintptr(n2))
+ *(*uintptr)(unsafe.Pointer(paTwo)) = a2 + uintptr(n2)
}
n1 = sessionSerialLen(tls, a1)
@@ -165809,14 +168100,14 @@ func sessionMergeValue(tls *libc.TLS, paOne uintptr, paTwo uintptr, pnVal uintpt
*(*int32)(unsafe.Pointer(pnVal)) = n1
pRet = a1
}
- *(*uintptr)(unsafe.Pointer(paOne)) = (a1 + uintptr(n1))
+ *(*uintptr)(unsafe.Pointer(paOne)) = a1 + uintptr(n1)
return pRet
}
// This function is used by changeset_concat() to merge two UPDATE changes
// on the same row.
-func sessionMergeUpdate(tls *libc.TLS, paOut uintptr, pTab uintptr, bPatchset int32, aOldRecord1 uintptr, aOldRecord2 uintptr, aNewRecord1 uintptr, aNewRecord2 uintptr) int32 { /* sqlite3.c:207413:12: */
+func sessionMergeUpdate(tls *libc.TLS, paOut uintptr, pTab uintptr, bPatchset int32, aOldRecord1 uintptr, aOldRecord2 uintptr, aNewRecord1 uintptr, aNewRecord2 uintptr) int32 { /* sqlite3.c:209183:12: */
bp := tls.Alloc(32)
defer tls.Free(32)
@@ -165842,7 +168133,7 @@ func sessionMergeUpdate(tls *libc.TLS, paOut uintptr, pTab uintptr, bPatchset in
aOld = sessionMergeValue(tls, bp /* &aOld1 */, bp+4 /* &aOld2 */, bp+8 /* &nOld */)
aNew = sessionMergeValue(tls, bp+12 /* &aNew1 */, bp+16 /* &aNew2 */, bp+20 /* &nNew */)
- if ((*(*U8)(unsafe.Pointer((*SessionTable)(unsafe.Pointer(pTab)).FabPK + uintptr(i))) != 0) || (*(*int32)(unsafe.Pointer(bp + 8 /* nOld */)) != *(*int32)(unsafe.Pointer(bp + 20 /* nNew */)))) || (libc.Xmemcmp(tls, aOld, aNew, uint32(*(*int32)(unsafe.Pointer(bp + 20 /* nNew */)))) != 0) {
+ if *(*U8)(unsafe.Pointer((*SessionTable)(unsafe.Pointer(pTab)).FabPK + uintptr(i))) != 0 || *(*int32)(unsafe.Pointer(bp + 8)) != *(*int32)(unsafe.Pointer(bp + 20)) || libc.Xmemcmp(tls, aOld, aNew, uint32(*(*int32)(unsafe.Pointer(bp + 20)))) != 0 {
if int32(*(*U8)(unsafe.Pointer((*SessionTable)(unsafe.Pointer(pTab)).FabPK + uintptr(i)))) == 0 {
bRequired = 1
}
@@ -165873,8 +168164,8 @@ func sessionMergeUpdate(tls *libc.TLS, paOut uintptr, pTab uintptr, bPatchset in
aOld = sessionMergeValue(tls, bp /* &aOld1 */, bp+4 /* &aOld2 */, bp+24 /* &nOld */)
aNew = sessionMergeValue(tls, bp+12 /* &aNew1 */, bp+16 /* &aNew2 */, bp+28 /* &nNew */)
- if (bPatchset == 0) &&
- ((*(*U8)(unsafe.Pointer((*SessionTable)(unsafe.Pointer(pTab)).FabPK + uintptr(i))) != 0) || ((*(*int32)(unsafe.Pointer(bp + 24 /* nOld */)) == *(*int32)(unsafe.Pointer(bp + 28 /* nNew */))) && (0 == libc.Xmemcmp(tls, aOld, aNew, uint32(*(*int32)(unsafe.Pointer(bp + 28 /* nNew */))))))) {
+ if bPatchset == 0 &&
+ (*(*U8)(unsafe.Pointer((*SessionTable)(unsafe.Pointer(pTab)).FabPK + uintptr(i))) != 0 || *(*int32)(unsafe.Pointer(bp + 24)) == *(*int32)(unsafe.Pointer(bp + 28)) && 0 == libc.Xmemcmp(tls, aOld, aNew, uint32(*(*int32)(unsafe.Pointer(bp + 28))))) {
*(*U8)(unsafe.Pointer(libc.PostIncUintptr(&aOut, 1))) = U8(0)
} else {
libc.Xmemcpy(tls, aOut, aNew, uint32(*(*int32)(unsafe.Pointer(bp + 28 /* nNew */))))
@@ -165891,7 +168182,7 @@ func sessionMergeUpdate(tls *libc.TLS, paOut uintptr, pTab uintptr, bPatchset in
// as the change stored in argument pChange. If so, it returns true. Otherwise
// if the pre-update-hook does not affect the same row as pChange, it returns
// false.
-func sessionPreupdateEqual(tls *libc.TLS, pSession uintptr, pTab uintptr, pChange uintptr, op int32) int32 { /* sqlite3.c:207490:12: */
+func sessionPreupdateEqual(tls *libc.TLS, pSession uintptr, pTab uintptr, pChange uintptr, op int32) int32 { /* sqlite3.c:209260:12: */
bp := tls.Alloc(28)
defer tls.Free(28)
@@ -165925,24 +168216,24 @@ func sessionPreupdateEqual(tls *libc.TLS, pSession uintptr, pTab uintptr, pChang
})(unsafe.Pointer(&struct{ uintptr }{(*Sqlite3_session)(unsafe.Pointer(pSession)).Fhook.FxOld})).f(tls, (*Sqlite3_session)(unsafe.Pointer(pSession)).Fhook.FpCtx, iCol, bp /* &pVal */)
}
- if Xsqlite3_value_type(tls, *(*uintptr)(unsafe.Pointer(bp /* pVal */))) != eType {
+ if Xsqlite3_value_type(tls, *(*uintptr)(unsafe.Pointer(bp))) != eType {
return 0
}
// A SessionChange object never has a NULL value in a PK column
- if (eType == SQLITE_INTEGER) || (eType == SQLITE_FLOAT) {
+ if eType == SQLITE_INTEGER || eType == SQLITE_FLOAT {
*(*I64)(unsafe.Pointer(bp + 16 /* iVal */)) = sessionGetI64(tls, a)
a += uintptr(8)
if eType == SQLITE_INTEGER {
- if Xsqlite3_value_int64(tls, *(*uintptr)(unsafe.Pointer(bp /* pVal */))) != *(*I64)(unsafe.Pointer(bp + 16 /* iVal */)) {
+ if Xsqlite3_value_int64(tls, *(*uintptr)(unsafe.Pointer(bp))) != *(*I64)(unsafe.Pointer(bp + 16)) {
return 0
}
} else {
// var rVal float64 at bp+8, 8
libc.Xmemcpy(tls, bp+8 /* &rVal */, bp+16 /* &iVal */, uint32(8))
- if Xsqlite3_value_double(tls, *(*uintptr)(unsafe.Pointer(bp /* pVal */))) != *(*float64)(unsafe.Pointer(bp + 8 /* rVal */)) {
+ if Xsqlite3_value_double(tls, *(*uintptr)(unsafe.Pointer(bp))) != *(*float64)(unsafe.Pointer(bp + 8)) {
return 0
}
}
@@ -165951,7 +168242,7 @@ func sessionPreupdateEqual(tls *libc.TLS, pSession uintptr, pTab uintptr, pChang
var z uintptr
a += uintptr(sessionVarintGet(tls, a, bp+24 /* &n */))
- if Xsqlite3_value_bytes(tls, *(*uintptr)(unsafe.Pointer(bp /* pVal */))) != *(*int32)(unsafe.Pointer(bp + 24 /* n */)) {
+ if Xsqlite3_value_bytes(tls, *(*uintptr)(unsafe.Pointer(bp))) != *(*int32)(unsafe.Pointer(bp + 24)) {
return 0
}
if eType == SQLITE_TEXT {
@@ -165959,7 +168250,7 @@ func sessionPreupdateEqual(tls *libc.TLS, pSession uintptr, pTab uintptr, pChang
} else {
z = Xsqlite3_value_blob(tls, *(*uintptr)(unsafe.Pointer(bp /* pVal */)))
}
- if (*(*int32)(unsafe.Pointer(bp + 24 /* n */)) > 0) && (libc.Xmemcmp(tls, a, z, uint32(*(*int32)(unsafe.Pointer(bp + 24 /* n */)))) != 0) {
+ if *(*int32)(unsafe.Pointer(bp + 24)) > 0 && libc.Xmemcmp(tls, a, z, uint32(*(*int32)(unsafe.Pointer(bp + 24)))) != 0 {
return 0
}
a += uintptr(*(*int32)(unsafe.Pointer(bp + 24 /* n */)))
@@ -165979,32 +168270,32 @@ func sessionPreupdateEqual(tls *libc.TLS, pSession uintptr, pTab uintptr, pChang
// that case the hash-table does not grow, but SQLITE_OK is returned anyway.
// Growing the hash table in this case is a performance optimization only,
// it is not required for correct operation.
-func sessionGrowHash(tls *libc.TLS, pSession uintptr, bPatchset int32, pTab uintptr) int32 { /* sqlite3.c:207569:12: */
- if ((*SessionTable)(unsafe.Pointer(pTab)).FnChange == 0) || ((*SessionTable)(unsafe.Pointer(pTab)).FnEntry >= ((*SessionTable)(unsafe.Pointer(pTab)).FnChange / 2)) {
+func sessionGrowHash(tls *libc.TLS, pSession uintptr, bPatchset int32, pTab uintptr) int32 { /* sqlite3.c:209339:12: */
+ if (*SessionTable)(unsafe.Pointer(pTab)).FnChange == 0 || (*SessionTable)(unsafe.Pointer(pTab)).FnEntry >= (*SessionTable)(unsafe.Pointer(pTab)).FnChange/2 {
var i int32
var apNew uintptr
- var nNew Sqlite3_int64 = (int64(2) * (func() int64 {
+ var nNew Sqlite3_int64 = int64(2) * func() int64 {
if (*SessionTable)(unsafe.Pointer(pTab)).FnChange != 0 {
return int64((*SessionTable)(unsafe.Pointer(pTab)).FnChange)
}
return int64(128)
- }()))
+ }()
apNew = sessionMalloc64(tls,
- pSession, (Sqlite3_int64(unsafe.Sizeof(uintptr(0))) * nNew))
+ pSession, Sqlite3_int64(unsafe.Sizeof(uintptr(0)))*nNew)
if apNew == uintptr(0) {
if (*SessionTable)(unsafe.Pointer(pTab)).FnChange == 0 {
return SQLITE_ERROR
}
return SQLITE_OK
}
- libc.Xmemset(tls, apNew, 0, (uint32(Sqlite3_int64(unsafe.Sizeof(uintptr(0))) * nNew)))
+ libc.Xmemset(tls, apNew, 0, uint32(Sqlite3_int64(unsafe.Sizeof(uintptr(0)))*nNew))
for i = 0; i < (*SessionTable)(unsafe.Pointer(pTab)).FnChange; i++ {
var p uintptr
var pNext uintptr
for p = *(*uintptr)(unsafe.Pointer((*SessionTable)(unsafe.Pointer(pTab)).FapChange + uintptr(i)*4)); p != 0; p = pNext {
- var bPkOnly int32 = (libc.Bool32((int32((*SessionChange)(unsafe.Pointer(p)).Fop) == SQLITE_DELETE) && (bPatchset != 0)))
+ var bPkOnly int32 = libc.Bool32(int32((*SessionChange)(unsafe.Pointer(p)).Fop) == SQLITE_DELETE && bPatchset != 0)
var iHash int32 = int32(sessionChangeHash(tls, pTab, bPkOnly, (*SessionChange)(unsafe.Pointer(p)).FaRecord, int32(nNew)))
pNext = (*SessionChange)(unsafe.Pointer(p)).FpNext
(*SessionChange)(unsafe.Pointer(p)).FpNext = *(*uintptr)(unsafe.Pointer(apNew + uintptr(iHash)*4))
@@ -166043,7 +168334,7 @@ func sessionGrowHash(tls *libc.TLS, pSession uintptr, bPatchset int32, pTab uint
//
// 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, pabPK uintptr) int32 { /* sqlite3.c:207635:12: */
+func sessionTableInfo(tls *libc.TLS, pSession uintptr, db uintptr, zDb uintptr, zThis uintptr, pnCol uintptr, pzTab uintptr, pazCol uintptr, pabPK uintptr) int32 { /* sqlite3.c:209405:12: */
bp := tls.Alloc(20)
defer tls.Free(20)
@@ -166060,40 +168351,58 @@ func sessionTableInfo(tls *libc.TLS, pSession uintptr, db uintptr, zDb uintptr,
var abPK uintptr = uintptr(0)
nThis = Xsqlite3Strlen30(tls, zThis)
- if (nThis == 12) && (0 == Xsqlite3_stricmp(tls, ts+10072 /* "sqlite_stat1" */, zThis)) {
+ if nThis == 12 && 0 == Xsqlite3_stricmp(tls, ts+11186, 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,
- ts+30544 /* "SELECT 0, 'tbl',..." */, 0)
+ ts+31904 /* "SELECT 0, 'tbl',..." */, 0)
} else if rc == SQLITE_ERROR {
- zPragma = Xsqlite3_mprintf(tls, ts+755 /* "" */, 0)
+ zPragma = Xsqlite3_mprintf(tls, ts+1543 /* "" */, 0)
} else {
+ *(*uintptr)(unsafe.Pointer(pazCol)) = uintptr(0)
+ *(*uintptr)(unsafe.Pointer(pabPK)) = uintptr(0)
+ *(*int32)(unsafe.Pointer(pnCol)) = 0
+ if pzTab != 0 {
+ *(*uintptr)(unsafe.Pointer(pzTab)) = uintptr(0)
+ }
return rc
}
} else {
- zPragma = Xsqlite3_mprintf(tls, ts+30665 /* "PRAGMA '%q'.tabl..." */, libc.VaList(bp, zDb, zThis))
+ zPragma = Xsqlite3_mprintf(tls, ts+32025 /* "PRAGMA '%q'.tabl..." */, libc.VaList(bp, zDb, zThis))
}
if !(zPragma != 0) {
+ *(*uintptr)(unsafe.Pointer(pazCol)) = uintptr(0)
+ *(*uintptr)(unsafe.Pointer(pabPK)) = uintptr(0)
+ *(*int32)(unsafe.Pointer(pnCol)) = 0
+ if pzTab != 0 {
+ *(*uintptr)(unsafe.Pointer(pzTab)) = uintptr(0)
+ }
return SQLITE_NOMEM
}
rc = Xsqlite3_prepare_v2(tls, db, zPragma, -1, bp+16 /* &pStmt */, uintptr(0))
Xsqlite3_free(tls, zPragma)
if rc != SQLITE_OK {
+ *(*uintptr)(unsafe.Pointer(pazCol)) = uintptr(0)
+ *(*uintptr)(unsafe.Pointer(pabPK)) = uintptr(0)
+ *(*int32)(unsafe.Pointer(pnCol)) = 0
+ if pzTab != 0 {
+ *(*uintptr)(unsafe.Pointer(pzTab)) = uintptr(0)
+ }
return rc
}
- nByte = (Sqlite3_int64(nThis + 1))
- for SQLITE_ROW == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp + 16 /* pStmt */))) {
- nByte = nByte + (Sqlite3_int64(Xsqlite3_column_bytes(tls, *(*uintptr)(unsafe.Pointer(bp + 16 /* pStmt */)), 1)))
+ nByte = Sqlite3_int64(nThis + 1)
+ for SQLITE_ROW == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp + 16))) {
+ nByte = nByte + Sqlite3_int64(Xsqlite3_column_bytes(tls, *(*uintptr)(unsafe.Pointer(bp + 16)), 1))
nDbCol++
}
rc = Xsqlite3_reset(tls, *(*uintptr)(unsafe.Pointer(bp + 16 /* pStmt */)))
if rc == SQLITE_OK {
- nByte = nByte + (Sqlite3_int64(uint32(nDbCol) * ((uint32(unsafe.Sizeof(uintptr(0))) + uint32(unsafe.Sizeof(U8(0)))) + uint32(1))))
+ nByte = nByte + Sqlite3_int64(uint32(nDbCol)*(uint32(unsafe.Sizeof(uintptr(0)))+uint32(unsafe.Sizeof(U8(0)))+uint32(1)))
pAlloc = sessionMalloc64(tls, pSession, nByte)
if pAlloc == uintptr(0) {
rc = SQLITE_NOMEM
@@ -166101,25 +168410,25 @@ func sessionTableInfo(tls *libc.TLS, pSession uintptr, db uintptr, zDb uintptr,
}
if rc == SQLITE_OK {
azCol = pAlloc
- pAlloc = (azCol + uintptr(nDbCol)*4)
+ pAlloc = azCol + uintptr(nDbCol)*4
abPK = pAlloc
- pAlloc = (abPK + uintptr(nDbCol))
+ pAlloc = abPK + uintptr(nDbCol)
if pzTab != 0 {
- libc.Xmemcpy(tls, pAlloc, zThis, (uint32(nThis + 1)))
+ libc.Xmemcpy(tls, pAlloc, zThis, uint32(nThis+1))
*(*uintptr)(unsafe.Pointer(pzTab)) = pAlloc
- pAlloc += (uintptr(nThis + 1))
+ pAlloc += uintptr(nThis + 1)
}
i = 0
- for SQLITE_ROW == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp + 16 /* pStmt */))) {
+ for SQLITE_ROW == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp + 16))) {
var nName int32 = Xsqlite3_column_bytes(tls, *(*uintptr)(unsafe.Pointer(bp + 16 /* pStmt */)), 1)
var zName uintptr = Xsqlite3_column_text(tls, *(*uintptr)(unsafe.Pointer(bp + 16 /* pStmt */)), 1)
if zName == uintptr(0) {
break
}
- libc.Xmemcpy(tls, pAlloc, zName, (uint32(nName + 1)))
+ libc.Xmemcpy(tls, pAlloc, zName, uint32(nName+1))
*(*uintptr)(unsafe.Pointer(azCol + uintptr(i)*4)) = pAlloc
- pAlloc += (uintptr(nName + 1))
+ pAlloc += uintptr(nName + 1)
*(*U8)(unsafe.Pointer(abPK + uintptr(i))) = U8(Xsqlite3_column_int(tls, *(*uintptr)(unsafe.Pointer(bp + 16 /* pStmt */)), 5))
i++
}
@@ -166156,7 +168465,7 @@ func sessionTableInfo(tls *libc.TLS, pSession uintptr, db uintptr, zDb uintptr,
// key, sqlite3_session.rc is left set to SQLITE_OK and non-zero returned to
// indicate that updates on this table should be ignored. SessionTable.abPK
// is set to NULL in this case.
-func sessionInitTable(tls *libc.TLS, pSession uintptr, pTab uintptr) int32 { /* sqlite3.c:207752:12: */
+func sessionInitTable(tls *libc.TLS, pSession uintptr, pTab uintptr) int32 { /* sqlite3.c:209538:12: */
bp := tls.Alloc(4)
defer tls.Free(4)
@@ -166164,25 +168473,25 @@ func sessionInitTable(tls *libc.TLS, pSession uintptr, pTab uintptr) int32 { /*
// var abPK uintptr at bp, 4
(*Sqlite3_session)(unsafe.Pointer(pSession)).Frc = sessionTableInfo(tls, pSession, (*Sqlite3_session)(unsafe.Pointer(pSession)).Fdb, (*Sqlite3_session)(unsafe.Pointer(pSession)).FzDb,
- (*SessionTable)(unsafe.Pointer(pTab)).FzName, (pTab + 8 /* &.nCol */), uintptr(0), (pTab + 16 /* &.azCol */), bp /* &abPK */)
+ (*SessionTable)(unsafe.Pointer(pTab)).FzName, pTab+8, uintptr(0), pTab+16, bp /* &abPK */)
if (*Sqlite3_session)(unsafe.Pointer(pSession)).Frc == SQLITE_OK {
var i int32
for i = 0; i < (*SessionTable)(unsafe.Pointer(pTab)).FnCol; i++ {
- if *(*U8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* abPK */)) + uintptr(i))) != 0 {
+ if *(*U8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)) + uintptr(i))) != 0 {
(*SessionTable)(unsafe.Pointer(pTab)).FabPK = *(*uintptr)(unsafe.Pointer(bp /* abPK */))
break
}
}
- if 0 == Xsqlite3_stricmp(tls, ts+10072 /* "sqlite_stat1" */, (*SessionTable)(unsafe.Pointer(pTab)).FzName) {
+ if 0 == Xsqlite3_stricmp(tls, ts+11186, (*SessionTable)(unsafe.Pointer(pTab)).FzName) {
(*SessionTable)(unsafe.Pointer(pTab)).FbStat1 = 1
}
if (*Sqlite3_session)(unsafe.Pointer(pSession)).FbEnableSize != 0 {
- *(*I64)(unsafe.Pointer(pSession + 48 /* &.nMaxChangesetSize */)) += (I64(((Size_t((1 + sessionVarintLen(tls, (*SessionTable)(unsafe.Pointer(pTab)).FnCol)) + (*SessionTable)(unsafe.Pointer(pTab)).FnCol)) + libc.Xstrlen(tls, (*SessionTable)(unsafe.Pointer(pTab)).FzName)) + Size_t(1)))
+ *(*I64)(unsafe.Pointer(pSession + 48)) += I64(Size_t(1+sessionVarintLen(tls, (*SessionTable)(unsafe.Pointer(pTab)).FnCol)+(*SessionTable)(unsafe.Pointer(pTab)).FnCol) + libc.Xstrlen(tls, (*SessionTable)(unsafe.Pointer(pTab)).FzName) + Size_t(1))
}
}
}
- return (libc.Bool32(((*Sqlite3_session)(unsafe.Pointer(pSession)).Frc != 0) || ((*SessionTable)(unsafe.Pointer(pTab)).FabPK == uintptr(0))))
+ return libc.Bool32((*Sqlite3_session)(unsafe.Pointer(pSession)).Frc != 0 || (*SessionTable)(unsafe.Pointer(pTab)).FabPK == uintptr(0))
}
// Versions of the four methods in object SessionHook for use with the
@@ -166192,15 +168501,15 @@ func sessionInitTable(tls *libc.TLS, pSession uintptr, pTab uintptr) int32 { /*
type SessionStat1Ctx1 = struct {
Fhook SessionHook
FpSession uintptr
-} /* sqlite3.c:207787:9 */
+} /* sqlite3.c:209573:9 */
// Versions of the four methods in object SessionHook for use with the
// sqlite_stat1 table. The purpose of this is to substitute a zero-length
// blob each time a NULL value is read from the "idx" column of the
// sqlite_stat1 table.
-type SessionStat1Ctx = SessionStat1Ctx1 /* sqlite3.c:207787:32 */
+type SessionStat1Ctx = SessionStat1Ctx1 /* sqlite3.c:209573:32 */
-func sessionStat1Old(tls *libc.TLS, pCtx uintptr, iCol int32, ppVal uintptr) int32 { /* sqlite3.c:207792:12: */
+func sessionStat1Old(tls *libc.TLS, pCtx uintptr, iCol int32, ppVal uintptr) int32 { /* sqlite3.c:209578:12: */
bp := tls.Alloc(4)
defer tls.Free(4)
@@ -166209,14 +168518,14 @@ func sessionStat1Old(tls *libc.TLS, pCtx uintptr, iCol int32, ppVal uintptr) int
var rc int32 = (*struct {
f func(*libc.TLS, uintptr, int32, uintptr) int32
})(unsafe.Pointer(&struct{ uintptr }{(*SessionStat1Ctx)(unsafe.Pointer(p)).Fhook.FxOld})).f(tls, (*SessionStat1Ctx)(unsafe.Pointer(p)).Fhook.FpCtx, iCol, bp /* &pVal */)
- if ((rc == SQLITE_OK) && (iCol == 1)) && (Xsqlite3_value_type(tls, *(*uintptr)(unsafe.Pointer(bp /* pVal */))) == SQLITE_NULL) {
+ if rc == SQLITE_OK && iCol == 1 && Xsqlite3_value_type(tls, *(*uintptr)(unsafe.Pointer(bp))) == SQLITE_NULL {
*(*uintptr)(unsafe.Pointer(bp /* pVal */)) = (*Sqlite3_session)(unsafe.Pointer((*SessionStat1Ctx)(unsafe.Pointer(p)).FpSession)).FpZeroBlob
}
*(*uintptr)(unsafe.Pointer(ppVal)) = *(*uintptr)(unsafe.Pointer(bp /* pVal */))
return rc
}
-func sessionStat1New(tls *libc.TLS, pCtx uintptr, iCol int32, ppVal uintptr) int32 { /* sqlite3.c:207802:12: */
+func sessionStat1New(tls *libc.TLS, pCtx uintptr, iCol int32, ppVal uintptr) int32 { /* sqlite3.c:209588:12: */
bp := tls.Alloc(4)
defer tls.Free(4)
@@ -166225,28 +168534,28 @@ func sessionStat1New(tls *libc.TLS, pCtx uintptr, iCol int32, ppVal uintptr) int
var rc int32 = (*struct {
f func(*libc.TLS, uintptr, int32, uintptr) int32
})(unsafe.Pointer(&struct{ uintptr }{(*SessionStat1Ctx)(unsafe.Pointer(p)).Fhook.FxNew})).f(tls, (*SessionStat1Ctx)(unsafe.Pointer(p)).Fhook.FpCtx, iCol, bp /* &pVal */)
- if ((rc == SQLITE_OK) && (iCol == 1)) && (Xsqlite3_value_type(tls, *(*uintptr)(unsafe.Pointer(bp /* pVal */))) == SQLITE_NULL) {
+ if rc == SQLITE_OK && iCol == 1 && Xsqlite3_value_type(tls, *(*uintptr)(unsafe.Pointer(bp))) == SQLITE_NULL {
*(*uintptr)(unsafe.Pointer(bp /* pVal */)) = (*Sqlite3_session)(unsafe.Pointer((*SessionStat1Ctx)(unsafe.Pointer(p)).FpSession)).FpZeroBlob
}
*(*uintptr)(unsafe.Pointer(ppVal)) = *(*uintptr)(unsafe.Pointer(bp /* pVal */))
return rc
}
-func sessionStat1Count(tls *libc.TLS, pCtx uintptr) int32 { /* sqlite3.c:207812:12: */
+func sessionStat1Count(tls *libc.TLS, pCtx uintptr) int32 { /* sqlite3.c:209598:12: */
var p uintptr = pCtx
return (*struct {
f func(*libc.TLS, uintptr) int32
})(unsafe.Pointer(&struct{ uintptr }{(*SessionStat1Ctx)(unsafe.Pointer(p)).Fhook.FxCount})).f(tls, (*SessionStat1Ctx)(unsafe.Pointer(p)).Fhook.FpCtx)
}
-func sessionStat1Depth(tls *libc.TLS, pCtx uintptr) int32 { /* sqlite3.c:207816:12: */
+func sessionStat1Depth(tls *libc.TLS, pCtx uintptr) int32 { /* sqlite3.c:209602:12: */
var p uintptr = pCtx
return (*struct {
f func(*libc.TLS, uintptr) int32
})(unsafe.Pointer(&struct{ uintptr }{(*SessionStat1Ctx)(unsafe.Pointer(p)).Fhook.FxDepth})).f(tls, (*SessionStat1Ctx)(unsafe.Pointer(p)).Fhook.FpCtx)
}
-func sessionUpdateMaxSize(tls *libc.TLS, op int32, pSession uintptr, pTab uintptr, pC uintptr) int32 { /* sqlite3.c:207821:12: */
+func sessionUpdateMaxSize(tls *libc.TLS, op int32, pSession uintptr, pTab uintptr, pC uintptr) int32 { /* sqlite3.c:209607:12: */
bp := tls.Alloc(44)
defer tls.Free(44)
@@ -166278,14 +168587,14 @@ func sessionUpdateMaxSize(tls *libc.TLS, op int32, pSession uintptr, pTab uintpt
(*struct {
f func(*libc.TLS, uintptr, int32, uintptr) int32
})(unsafe.Pointer(&struct{ uintptr }{(*Sqlite3_session)(unsafe.Pointer(pSession)).Fhook.FxNew})).f(tls, (*Sqlite3_session)(unsafe.Pointer(pSession)).Fhook.FpCtx, ii, bp+16 /* &p */)
- if *(*uintptr)(unsafe.Pointer(bp + 16 /* p */)) == uintptr(0) {
+ if *(*uintptr)(unsafe.Pointer(bp + 16)) == uintptr(0) {
return SQLITE_NOMEM
}
eType = int32(*(*U8)(unsafe.Pointer(libc.PostIncUintptr(&pCsr, 1))))
switch eType {
case SQLITE_NULL:
- bChanged = (libc.Bool32(Xsqlite3_value_type(tls, *(*uintptr)(unsafe.Pointer(bp + 16 /* p */))) != SQLITE_NULL))
+ bChanged = libc.Bool32(Xsqlite3_value_type(tls, *(*uintptr)(unsafe.Pointer(bp + 16))) != SQLITE_NULL)
break
fallthrough
@@ -166293,15 +168602,15 @@ func sessionUpdateMaxSize(tls *libc.TLS, op int32, pSession uintptr, pTab uintpt
fallthrough
case SQLITE_INTEGER:
{
- if eType == Xsqlite3_value_type(tls, *(*uintptr)(unsafe.Pointer(bp + 16 /* p */))) {
+ if eType == Xsqlite3_value_type(tls, *(*uintptr)(unsafe.Pointer(bp + 16))) {
*(*Sqlite3_int64)(unsafe.Pointer(bp + 32 /* iVal */)) = sessionGetI64(tls, pCsr)
if eType == SQLITE_INTEGER {
- bChanged = (libc.Bool32(*(*Sqlite3_int64)(unsafe.Pointer(bp + 32 /* iVal */)) != Xsqlite3_value_int64(tls, *(*uintptr)(unsafe.Pointer(bp + 16 /* p */)))))
+ bChanged = libc.Bool32(*(*Sqlite3_int64)(unsafe.Pointer(bp + 32)) != Xsqlite3_value_int64(tls, *(*uintptr)(unsafe.Pointer(bp + 16))))
} else {
// var dVal float64 at bp+24, 8
libc.Xmemcpy(tls, bp+24 /* &dVal */, bp+32 /* &iVal */, uint32(8))
- bChanged = (libc.Bool32(*(*float64)(unsafe.Pointer(bp + 24 /* dVal */)) != Xsqlite3_value_double(tls, *(*uintptr)(unsafe.Pointer(bp + 16 /* p */)))))
+ bChanged = libc.Bool32(*(*float64)(unsafe.Pointer(bp + 24)) != Xsqlite3_value_double(tls, *(*uintptr)(unsafe.Pointer(bp + 16))))
}
}
nOld = 8
@@ -166317,11 +168626,11 @@ func sessionUpdateMaxSize(tls *libc.TLS, op int32, pSession uintptr, pTab uintpt
nOld = sessionVarintGet(tls, pCsr, bp+40 /* &nByte */)
pCsr += uintptr(nOld)
- nOld = nOld + (*(*int32)(unsafe.Pointer(bp + 40 /* nByte */)))
+ nOld = nOld + *(*int32)(unsafe.Pointer(bp + 40))
- if ((eType == Xsqlite3_value_type(tls, *(*uintptr)(unsafe.Pointer(bp + 16 /* p */)))) &&
- (*(*int32)(unsafe.Pointer(bp + 40 /* nByte */)) == Xsqlite3_value_bytes(tls, *(*uintptr)(unsafe.Pointer(bp + 16 /* p */))))) &&
- ((*(*int32)(unsafe.Pointer(bp + 40 /* nByte */)) == 0) || (0 == libc.Xmemcmp(tls, pCsr, Xsqlite3_value_blob(tls, *(*uintptr)(unsafe.Pointer(bp + 16 /* p */))), uint32(*(*int32)(unsafe.Pointer(bp + 40 /* nByte */)))))) {
+ if eType == Xsqlite3_value_type(tls, *(*uintptr)(unsafe.Pointer(bp + 16))) &&
+ *(*int32)(unsafe.Pointer(bp + 40)) == Xsqlite3_value_bytes(tls, *(*uintptr)(unsafe.Pointer(bp + 16))) &&
+ (*(*int32)(unsafe.Pointer(bp + 40)) == 0 || 0 == libc.Xmemcmp(tls, pCsr, Xsqlite3_value_blob(tls, *(*uintptr)(unsafe.Pointer(bp + 16))), uint32(*(*int32)(unsafe.Pointer(bp + 40))))) {
bChanged = 0
}
pCsr += uintptr(*(*int32)(unsafe.Pointer(bp + 40 /* nByte */)))
@@ -166330,26 +168639,26 @@ func sessionUpdateMaxSize(tls *libc.TLS, op int32, pSession uintptr, pTab uintpt
}
}
- if (bChanged != 0) && (*(*U8)(unsafe.Pointer((*SessionTable)(unsafe.Pointer(pTab)).FabPK + uintptr(ii))) != 0) {
- *(*I64)(unsafe.Pointer(bp + 8 /* nNew */)) = (I64((*SessionChange)(unsafe.Pointer(pC)).FnRecord + 2))
+ if bChanged != 0 && *(*U8)(unsafe.Pointer((*SessionTable)(unsafe.Pointer(pTab)).FabPK + uintptr(ii))) != 0 {
+ *(*I64)(unsafe.Pointer(bp + 8 /* nNew */)) = I64((*SessionChange)(unsafe.Pointer(pC)).FnRecord + 2)
break
}
if bChanged != 0 {
- *(*I64)(unsafe.Pointer(bp + 8 /* nNew */)) += (I64(1 + nOld))
+ *(*I64)(unsafe.Pointer(bp + 8 /* nNew */)) += I64(1 + nOld)
sessionSerializeValue(tls, uintptr(0), *(*uintptr)(unsafe.Pointer(bp + 16 /* p */)), bp+8 /* &nNew */)
} else if *(*U8)(unsafe.Pointer((*SessionTable)(unsafe.Pointer(pTab)).FabPK + uintptr(ii))) != 0 {
- *(*I64)(unsafe.Pointer(bp + 8 /* nNew */)) += (I64(2 + nOld))
+ *(*I64)(unsafe.Pointer(bp + 8 /* nNew */)) += I64(2 + nOld)
} else {
*(*I64)(unsafe.Pointer(bp + 8 /* nNew */)) += int64(2)
}
}
}
- if *(*I64)(unsafe.Pointer(bp + 8 /* nNew */)) > I64((*SessionChange)(unsafe.Pointer(pC)).FnMaxSize) {
- var nIncr int32 = (int32(*(*I64)(unsafe.Pointer(bp + 8 /* nNew */)) - I64((*SessionChange)(unsafe.Pointer(pC)).FnMaxSize)))
+ if *(*I64)(unsafe.Pointer(bp + 8)) > I64((*SessionChange)(unsafe.Pointer(pC)).FnMaxSize) {
+ var nIncr int32 = int32(*(*I64)(unsafe.Pointer(bp + 8)) - I64((*SessionChange)(unsafe.Pointer(pC)).FnMaxSize))
(*SessionChange)(unsafe.Pointer(pC)).FnMaxSize = int32(*(*I64)(unsafe.Pointer(bp + 8 /* nNew */)))
- *(*I64)(unsafe.Pointer(pSession + 48 /* &.nMaxChangesetSize */)) += (I64(nIncr))
+ *(*I64)(unsafe.Pointer(pSession + 48)) += I64(nIncr)
}
return SQLITE_OK
}
@@ -166360,7 +168669,7 @@ func sessionUpdateMaxSize(tls *libc.TLS, op int32, pSession uintptr, pTab uintpt
//
// Unless one is already present or an error occurs, an entry is added
// to the changed-rows hash table associated with table pTab.
-func sessionPreupdateOneChange(tls *libc.TLS, op int32, pSession uintptr, pTab uintptr) { /* sqlite3.c:207927:13: */
+func sessionPreupdateOneChange(tls *libc.TLS, op int32, pSession uintptr, pTab uintptr) { /* sqlite3.c:209713:13: */
bp := tls.Alloc(52)
defer tls.Free(52)
@@ -166453,7 +168762,7 @@ __4:
goto error_out
__7:
;
- Xsqlite3ValueSetStr(tls, p, 0, ts+755 /* "" */, uint8(0), uintptr(0))
+ Xsqlite3ValueSetStr(tls, p, 0, ts+1543 /* "" */, uint8(0), uintptr(0))
(*Sqlite3_session)(unsafe.Pointer(pSession)).FpZeroBlob = p
__6:
;
@@ -166463,7 +168772,7 @@ __5:
// Calculate the hash-key for this change. If the primary key of the row
// includes a NULL value, exit early. Such changes are ignored by the
// session module.
- rc = sessionPreupdateHash(tls, pSession, pTab, (libc.Bool32(op == SQLITE_INSERT)), bp+24 /* &iHash */, bp+28 /* &bNull */)
+ rc = sessionPreupdateHash(tls, pSession, pTab, libc.Bool32(op == SQLITE_INSERT), bp+24 /* &iHash */, bp+28 /* &bNull */)
if !(rc != SQLITE_OK) {
goto __8
}
@@ -166471,7 +168780,7 @@ __5:
__8:
;
- if !(*(*int32)(unsafe.Pointer(bp + 28 /* bNull */)) == 0) {
+ if !(*(*int32)(unsafe.Pointer(bp + 28)) == 0) {
goto __9
}
pC = *(*uintptr)(unsafe.Pointer((*SessionTable)(unsafe.Pointer(pTab)).FapChange + uintptr(*(*int32)(unsafe.Pointer(bp + 24 /* iHash */)))*4))
@@ -166547,7 +168856,7 @@ __18:
// Allocate the change object
pC = sessionMalloc64(tls, pSession, *(*Sqlite3_int64)(unsafe.Pointer(bp + 40 /* nByte */)))
- if !(!(pC != 0)) {
+ if !!(pC != 0) {
goto __23
}
rc = SQLITE_NOMEM
@@ -166555,7 +168864,7 @@ __18:
goto __24
__23:
libc.Xmemset(tls, pC, 0, uint32(unsafe.Sizeof(SessionChange{})))
- (*SessionChange)(unsafe.Pointer(pC)).FaRecord = (pC + 1*20)
+ (*SessionChange)(unsafe.Pointer(pC)).FaRecord = pC + 1*20
__24:
;
@@ -166588,7 +168897,7 @@ __30:
;
__29:
;
- sessionSerializeValue(tls, ((*SessionChange)(unsafe.Pointer(pC)).FaRecord + uintptr(*(*Sqlite3_int64)(unsafe.Pointer(bp + 40 /* nByte */)))), *(*uintptr)(unsafe.Pointer(bp + 48 /* p2 */)), bp+40 /* &nByte */)
+ sessionSerializeValue(tls, (*SessionChange)(unsafe.Pointer(pC)).FaRecord+uintptr(*(*Sqlite3_int64)(unsafe.Pointer(bp + 40))), *(*uintptr)(unsafe.Pointer(bp + 48 /* p2 */)), bp+40 /* &nByte */)
goto __26
__26:
i++
@@ -166598,9 +168907,9 @@ __27:
;
// Add the change to the hash-table
- if !(((*Sqlite3_session)(unsafe.Pointer(pSession)).FbIndirect != 0) || ((*struct {
+ if !((*Sqlite3_session)(unsafe.Pointer(pSession)).FbIndirect != 0 || (*struct {
f func(*libc.TLS, uintptr) int32
- })(unsafe.Pointer(&struct{ uintptr }{(*Sqlite3_session)(unsafe.Pointer(pSession)).Fhook.FxDepth})).f(tls, (*Sqlite3_session)(unsafe.Pointer(pSession)).Fhook.FpCtx) != 0)) {
+ })(unsafe.Pointer(&struct{ uintptr }{(*Sqlite3_session)(unsafe.Pointer(pSession)).Fhook.FxDepth})).f(tls, (*Sqlite3_session)(unsafe.Pointer(pSession)).Fhook.FpCtx) != 0) {
goto __31
}
(*SessionChange)(unsafe.Pointer(pC)).FbIndirect = U8(1)
@@ -166618,10 +168927,10 @@ __14:
}
// If the existing change is considered "indirect", but this current
// change is "direct", mark the change object as direct.
- if !(((*struct {
+ if !((*struct {
f func(*libc.TLS, uintptr) int32
- })(unsafe.Pointer(&struct{ uintptr }{(*Sqlite3_session)(unsafe.Pointer(pSession)).Fhook.FxDepth})).f(tls, (*Sqlite3_session)(unsafe.Pointer(pSession)).Fhook.FpCtx) == 0) &&
- ((*Sqlite3_session)(unsafe.Pointer(pSession)).FbIndirect == 0)) {
+ })(unsafe.Pointer(&struct{ uintptr }{(*Sqlite3_session)(unsafe.Pointer(pSession)).Fhook.FxDepth})).f(tls, (*Sqlite3_session)(unsafe.Pointer(pSession)).Fhook.FpCtx) == 0 &&
+ (*Sqlite3_session)(unsafe.Pointer(pSession)).FbIndirect == 0) {
goto __33
}
(*SessionChange)(unsafe.Pointer(pC)).FbIndirect = U8(0)
@@ -166656,28 +168965,30 @@ __35:
__36:
}
-func sessionFindTable(tls *libc.TLS, pSession uintptr, zName uintptr, ppTab uintptr) int32 { /* sqlite3.c:208076:12: */
+func sessionFindTable(tls *libc.TLS, pSession uintptr, zName uintptr, ppTab uintptr) int32 { /* sqlite3.c:209862:12: */
var rc int32 = SQLITE_OK
var nName int32 = Xsqlite3Strlen30(tls, zName)
var pRet uintptr
// Search for an existing table
for pRet = (*Sqlite3_session)(unsafe.Pointer(pSession)).FpTable; pRet != 0; pRet = (*SessionTable)(unsafe.Pointer(pRet)).FpNext {
- if 0 == Xsqlite3_strnicmp(tls, (*SessionTable)(unsafe.Pointer(pRet)).FzName, zName, (nName+1)) {
+ if 0 == Xsqlite3_strnicmp(tls, (*SessionTable)(unsafe.Pointer(pRet)).FzName, zName, nName+1) {
break
}
}
- if (pRet == uintptr(0)) && ((*Sqlite3_session)(unsafe.Pointer(pSession)).FbAutoAttach != 0) {
+ if pRet == uintptr(0) && (*Sqlite3_session)(unsafe.Pointer(pSession)).FbAutoAttach != 0 {
// If there is a table-filter configured, invoke it. If it returns 0,
// do not automatically add the new table.
- if ((*Sqlite3_session)(unsafe.Pointer(pSession)).FxTableFilter == uintptr(0)) ||
- ((*struct {
+ if (*Sqlite3_session)(unsafe.Pointer(pSession)).FxTableFilter == uintptr(0) ||
+ (*struct {
f func(*libc.TLS, uintptr, uintptr) int32
- })(unsafe.Pointer(&struct{ uintptr }{(*Sqlite3_session)(unsafe.Pointer(pSession)).FxTableFilter})).f(tls, (*Sqlite3_session)(unsafe.Pointer(pSession)).FpFilterCtx, zName) != 0) {
+ })(unsafe.Pointer(&struct{ uintptr }{(*Sqlite3_session)(unsafe.Pointer(pSession)).FxTableFilter})).f(tls, (*Sqlite3_session)(unsafe.Pointer(pSession)).FpFilterCtx, zName) != 0 {
rc = Xsqlite3session_attach(tls, pSession, zName)
if rc == SQLITE_OK {
- for pRet = (*Sqlite3_session)(unsafe.Pointer(pSession)).FpTable; (*SessionTable)(unsafe.Pointer(pRet)).FpNext != 0; pRet = (*SessionTable)(unsafe.Pointer(pRet)).FpNext {
+ pRet = (*Sqlite3_session)(unsafe.Pointer(pSession)).FpTable
+ for pRet != 0 && (*SessionTable)(unsafe.Pointer(pRet)).FpNext != 0 {
+ pRet = (*SessionTable)(unsafe.Pointer(pRet)).FpNext
}
}
@@ -166689,7 +169000,7 @@ func sessionFindTable(tls *libc.TLS, pSession uintptr, zName uintptr, ppTab uint
}
// The 'pre-update' hook registered by this module with SQLite databases.
-func xPreUpdate(tls *libc.TLS, pCtx uintptr, db uintptr, op int32, zDb uintptr, zName uintptr, iKey1 Sqlite3_int64, iKey2 Sqlite3_int64) { /* sqlite3.c:208112:13: */
+func xPreUpdate(tls *libc.TLS, pCtx uintptr, db uintptr, op int32, zDb uintptr, zName uintptr, iKey1 Sqlite3_int64, iKey2 Sqlite3_int64) { /* sqlite3.c:209902:13: */
bp := tls.Alloc(4)
defer tls.Free(4)
@@ -166708,12 +169019,12 @@ func xPreUpdate(tls *libc.TLS, pCtx uintptr, db uintptr, op int32, zDb uintptr,
if (*Sqlite3_session)(unsafe.Pointer(pSession)).Frc != 0 {
continue
}
- if Xsqlite3_strnicmp(tls, zDb, (*Sqlite3_session)(unsafe.Pointer(pSession)).FzDb, (nDb+1)) != 0 {
+ if Xsqlite3_strnicmp(tls, zDb, (*Sqlite3_session)(unsafe.Pointer(pSession)).FzDb, nDb+1) != 0 {
continue
}
(*Sqlite3_session)(unsafe.Pointer(pSession)).Frc = sessionFindTable(tls, pSession, zName, bp /* &pTab */)
- if *(*uintptr)(unsafe.Pointer(bp /* pTab */)) != 0 {
+ if *(*uintptr)(unsafe.Pointer(bp)) != 0 {
sessionPreupdateOneChange(tls, op, pSession, *(*uintptr)(unsafe.Pointer(bp /* pTab */)))
if op == SQLITE_UPDATE {
@@ -166724,25 +169035,25 @@ func xPreUpdate(tls *libc.TLS, pCtx uintptr, db uintptr, op int32, zDb uintptr,
}
// The pre-update hook implementations.
-func sessionPreupdateOld(tls *libc.TLS, pCtx uintptr, iVal int32, ppVal uintptr) int32 { /* sqlite3.c:208150:12: */
+func sessionPreupdateOld(tls *libc.TLS, pCtx uintptr, iVal int32, ppVal uintptr) int32 { /* sqlite3.c:209940:12: */
return Xsqlite3_preupdate_old(tls, pCtx, iVal, ppVal)
}
-func sessionPreupdateNew(tls *libc.TLS, pCtx uintptr, iVal int32, ppVal uintptr) int32 { /* sqlite3.c:208153:12: */
+func sessionPreupdateNew(tls *libc.TLS, pCtx uintptr, iVal int32, ppVal uintptr) int32 { /* sqlite3.c:209943:12: */
return Xsqlite3_preupdate_new(tls, pCtx, iVal, ppVal)
}
-func sessionPreupdateCount(tls *libc.TLS, pCtx uintptr) int32 { /* sqlite3.c:208156:12: */
+func sessionPreupdateCount(tls *libc.TLS, pCtx uintptr) int32 { /* sqlite3.c:209946:12: */
return Xsqlite3_preupdate_count(tls, pCtx)
}
-func sessionPreupdateDepth(tls *libc.TLS, pCtx uintptr) int32 { /* sqlite3.c:208159:12: */
+func sessionPreupdateDepth(tls *libc.TLS, pCtx uintptr) int32 { /* sqlite3.c:209949:12: */
return Xsqlite3_preupdate_depth(tls, pCtx)
}
// Install the pre-update hooks on the session object passed as the only
// argument.
-func sessionPreupdateHooks(tls *libc.TLS, pSession uintptr) { /* sqlite3.c:208167:13: */
+func sessionPreupdateHooks(tls *libc.TLS, pSession uintptr) { /* sqlite3.c:209957:13: */
(*Sqlite3_session)(unsafe.Pointer(pSession)).Fhook.FpCtx = (*Sqlite3_session)(unsafe.Pointer(pSession)).Fdb
(*Sqlite3_session)(unsafe.Pointer(pSession)).Fhook.FxOld = *(*uintptr)(unsafe.Pointer(&struct {
f func(*libc.TLS, uintptr, int32, uintptr) int32
@@ -166761,24 +169072,24 @@ func sessionPreupdateHooks(tls *libc.TLS, pSession uintptr) { /* sqlite3.c:20816
type SessionDiffCtx1 = struct {
FpStmt uintptr
FnOldOff int32
-} /* sqlite3.c:208177:9 */
+} /* sqlite3.c:209967:9 */
-type SessionDiffCtx = SessionDiffCtx1 /* sqlite3.c:208177:31 */
+type SessionDiffCtx = SessionDiffCtx1 /* sqlite3.c:209967:31 */
// The diff hook implementations.
-func sessionDiffOld(tls *libc.TLS, pCtx uintptr, iVal int32, ppVal uintptr) int32 { /* sqlite3.c:208186:12: */
+func sessionDiffOld(tls *libc.TLS, pCtx uintptr, iVal int32, ppVal uintptr) int32 { /* sqlite3.c:209976:12: */
var p uintptr = pCtx
- *(*uintptr)(unsafe.Pointer(ppVal)) = Xsqlite3_column_value(tls, (*SessionDiffCtx)(unsafe.Pointer(p)).FpStmt, (iVal + (*SessionDiffCtx)(unsafe.Pointer(p)).FnOldOff))
+ *(*uintptr)(unsafe.Pointer(ppVal)) = Xsqlite3_column_value(tls, (*SessionDiffCtx)(unsafe.Pointer(p)).FpStmt, iVal+(*SessionDiffCtx)(unsafe.Pointer(p)).FnOldOff)
return SQLITE_OK
}
-func sessionDiffNew(tls *libc.TLS, pCtx uintptr, iVal int32, ppVal uintptr) int32 { /* sqlite3.c:208191:12: */
+func sessionDiffNew(tls *libc.TLS, pCtx uintptr, iVal int32, ppVal uintptr) int32 { /* sqlite3.c:209981:12: */
var p uintptr = pCtx
*(*uintptr)(unsafe.Pointer(ppVal)) = Xsqlite3_column_value(tls, (*SessionDiffCtx)(unsafe.Pointer(p)).FpStmt, iVal)
return SQLITE_OK
}
-func sessionDiffCount(tls *libc.TLS, pCtx uintptr) int32 { /* sqlite3.c:208196:12: */
+func sessionDiffCount(tls *libc.TLS, pCtx uintptr) int32 { /* sqlite3.c:209986:12: */
var p uintptr = pCtx
if (*SessionDiffCtx)(unsafe.Pointer(p)).FnOldOff != 0 {
return (*SessionDiffCtx)(unsafe.Pointer(p)).FnOldOff
@@ -166786,13 +169097,13 @@ func sessionDiffCount(tls *libc.TLS, pCtx uintptr) int32 { /* sqlite3.c:208196:1
return Xsqlite3_column_count(tls, (*SessionDiffCtx)(unsafe.Pointer(p)).FpStmt)
}
-func sessionDiffDepth(tls *libc.TLS, pCtx uintptr) int32 { /* sqlite3.c:208200:12: */
+func sessionDiffDepth(tls *libc.TLS, pCtx uintptr) int32 { /* sqlite3.c:209990:12: */
return 0
}
// Install the diff hooks on the session object passed as the only
// argument.
-func sessionDiffHooks(tls *libc.TLS, pSession uintptr, pDiffCtx uintptr) { /* sqlite3.c:208208:13: */
+func sessionDiffHooks(tls *libc.TLS, pSession uintptr, pDiffCtx uintptr) { /* sqlite3.c:209998:13: */
(*Sqlite3_session)(unsafe.Pointer(pSession)).Fhook.FpCtx = pDiffCtx
(*Sqlite3_session)(unsafe.Pointer(pSession)).Fhook.FxOld = *(*uintptr)(unsafe.Pointer(&struct {
f func(*libc.TLS, uintptr, int32, uintptr) int32
@@ -166808,19 +169119,19 @@ func sessionDiffHooks(tls *libc.TLS, pSession uintptr, pDiffCtx uintptr) { /* sq
}{sessionDiffDepth}))
}
-func sessionExprComparePK(tls *libc.TLS, nCol int32, zDb1 uintptr, zDb2 uintptr, zTab uintptr, azCol uintptr, abPK uintptr) uintptr { /* sqlite3.c:208219:13: */
+func sessionExprComparePK(tls *libc.TLS, nCol int32, zDb1 uintptr, zDb2 uintptr, zTab uintptr, azCol uintptr, abPK uintptr) uintptr { /* sqlite3.c:210009:13: */
bp := tls.Alloc(64)
defer tls.Free(64)
var i int32
- var zSep uintptr = ts + 755 /* "" */
+ var zSep uintptr = ts + 1543 /* "" */
var zRet uintptr = uintptr(0)
for i = 0; i < nCol; i++ {
if *(*U8)(unsafe.Pointer(abPK + uintptr(i))) != 0 {
- zRet = Xsqlite3_mprintf(tls, ts+30694, /* "%z%s\"%w\".\"%w\".\"%..." */
+ zRet = Xsqlite3_mprintf(tls, ts+32054, /* "%z%s\"%w\".\"%w\".\"%..." */
libc.VaList(bp, zRet, zSep, zDb1, zTab, *(*uintptr)(unsafe.Pointer(azCol + uintptr(i)*4)), zDb2, zTab, *(*uintptr)(unsafe.Pointer(azCol + uintptr(i)*4))))
- zSep = ts + 19877 /* " AND " */
+ zSep = ts + 21174 /* " AND " */
if zRet == uintptr(0) {
break
}
@@ -166830,12 +169141,12 @@ func sessionExprComparePK(tls *libc.TLS, nCol int32, zDb1 uintptr, zDb2 uintptr,
return zRet
}
-func sessionExprCompareOther(tls *libc.TLS, nCol int32, zDb1 uintptr, zDb2 uintptr, zTab uintptr, azCol uintptr, abPK uintptr) uintptr { /* sqlite3.c:208242:13: */
+func sessionExprCompareOther(tls *libc.TLS, nCol int32, zDb1 uintptr, zDb2 uintptr, zTab uintptr, azCol uintptr, abPK uintptr) uintptr { /* sqlite3.c:210032:13: */
bp := tls.Alloc(64)
defer tls.Free(64)
var i int32
- var zSep uintptr = ts + 755 /* "" */
+ var zSep uintptr = ts + 1543 /* "" */
var zRet uintptr = uintptr(0)
var bHave int32 = 0
@@ -166843,9 +169154,9 @@ func sessionExprCompareOther(tls *libc.TLS, nCol int32, zDb1 uintptr, zDb2 uintp
if int32(*(*U8)(unsafe.Pointer(abPK + uintptr(i)))) == 0 {
bHave = 1
zRet = Xsqlite3_mprintf(tls,
- ts+30728, /* "%z%s\"%w\".\"%w\".\"%..." */
+ ts+32088, /* "%z%s\"%w\".\"%w\".\"%..." */
libc.VaList(bp, zRet, zSep, zDb1, zTab, *(*uintptr)(unsafe.Pointer(azCol + uintptr(i)*4)), zDb2, zTab, *(*uintptr)(unsafe.Pointer(azCol + uintptr(i)*4))))
- zSep = ts + 30769 /* " OR " */
+ zSep = ts + 32129 /* " OR " */
if zRet == uintptr(0) {
break
}
@@ -166854,24 +169165,24 @@ func sessionExprCompareOther(tls *libc.TLS, nCol int32, zDb1 uintptr, zDb2 uintp
if bHave == 0 {
- zRet = Xsqlite3_mprintf(tls, ts+6506 /* "0" */, 0)
+ zRet = Xsqlite3_mprintf(tls, ts+7399 /* "0" */, 0)
}
return zRet
}
-func sessionSelectFindNew(tls *libc.TLS, nCol int32, zDb1 uintptr, zDb2 uintptr, zTbl uintptr, zExpr uintptr) uintptr { /* sqlite3.c:208273:13: */
+func sessionSelectFindNew(tls *libc.TLS, nCol int32, zDb1 uintptr, zDb2 uintptr, zTbl uintptr, zExpr uintptr) uintptr { /* sqlite3.c:210063:13: */
bp := tls.Alloc(40)
defer tls.Free(40)
var zRet uintptr = Xsqlite3_mprintf(tls,
- ts+30774, /* "SELECT * FROM \"%..." */
+ ts+32134, /* "SELECT * FROM \"%..." */
libc.VaList(bp, zDb1, zTbl, zDb2, zTbl, zExpr))
return zRet
}
-func sessionDiffFindNew(tls *libc.TLS, op int32, pSession uintptr, pTab uintptr, zDb1 uintptr, zDb2 uintptr, zExpr uintptr) int32 { /* sqlite3.c:208289:12: */
+func sessionDiffFindNew(tls *libc.TLS, op int32, pSession uintptr, pTab uintptr, zDb1 uintptr, zDb2 uintptr, zExpr uintptr) int32 { /* sqlite3.c:210079:12: */
bp := tls.Alloc(4)
defer tls.Free(4)
@@ -166888,7 +169199,7 @@ func sessionDiffFindNew(tls *libc.TLS, op int32, pSession uintptr, pTab uintptr,
var pDiffCtx uintptr = (*Sqlite3_session)(unsafe.Pointer(pSession)).Fhook.FpCtx
(*SessionDiffCtx)(unsafe.Pointer(pDiffCtx)).FpStmt = *(*uintptr)(unsafe.Pointer(bp /* pStmt */))
(*SessionDiffCtx)(unsafe.Pointer(pDiffCtx)).FnOldOff = 0
- for SQLITE_ROW == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp /* pStmt */))) {
+ for SQLITE_ROW == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp))) {
sessionPreupdateOneChange(tls, op, pSession, pTab)
}
rc = Xsqlite3_finalize(tls, *(*uintptr)(unsafe.Pointer(bp /* pStmt */)))
@@ -166899,7 +169210,7 @@ func sessionDiffFindNew(tls *libc.TLS, op int32, pSession uintptr, pTab uintptr,
return rc
}
-func sessionDiffFindModified(tls *libc.TLS, pSession uintptr, pTab uintptr, zFrom uintptr, zExpr uintptr) int32 { /* sqlite3.c:208320:12: */
+func sessionDiffFindModified(tls *libc.TLS, pSession uintptr, pTab uintptr, zFrom uintptr, zExpr uintptr) int32 { /* sqlite3.c:210110:12: */
bp := tls.Alloc(52)
defer tls.Free(52)
@@ -166911,7 +169222,7 @@ func sessionDiffFindModified(tls *libc.TLS, pSession uintptr, pTab uintptr, zFro
rc = SQLITE_NOMEM
} else {
var zStmt uintptr = Xsqlite3_mprintf(tls,
- ts+30852, /* "SELECT * FROM \"%..." */
+ ts+32212, /* "SELECT * FROM \"%..." */
libc.VaList(bp, (*Sqlite3_session)(unsafe.Pointer(pSession)).FzDb, (*SessionTable)(unsafe.Pointer(pTab)).FzName, zFrom, (*SessionTable)(unsafe.Pointer(pTab)).FzName, zExpr, zExpr2))
if zStmt == uintptr(0) {
rc = SQLITE_NOMEM
@@ -166924,7 +169235,7 @@ func sessionDiffFindModified(tls *libc.TLS, pSession uintptr, pTab uintptr, zFro
var pDiffCtx uintptr = (*Sqlite3_session)(unsafe.Pointer(pSession)).Fhook.FpCtx
(*SessionDiffCtx)(unsafe.Pointer(pDiffCtx)).FpStmt = *(*uintptr)(unsafe.Pointer(bp + 48 /* pStmt */))
(*SessionDiffCtx)(unsafe.Pointer(pDiffCtx)).FnOldOff = (*SessionTable)(unsafe.Pointer(pTab)).FnCol
- for SQLITE_ROW == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp + 48 /* pStmt */))) {
+ for SQLITE_ROW == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp + 48))) {
sessionPreupdateOneChange(tls, SQLITE_UPDATE, pSession, pTab)
}
rc = Xsqlite3_finalize(tls, *(*uintptr)(unsafe.Pointer(bp + 48 /* pStmt */)))
@@ -166936,7 +169247,7 @@ func sessionDiffFindModified(tls *libc.TLS, pSession uintptr, pTab uintptr, zFro
return rc
}
-func Xsqlite3session_diff(tls *libc.TLS, pSession uintptr, zFrom uintptr, zTbl uintptr, pzErrMsg uintptr) int32 { /* sqlite3.c:208360:16: */
+func Xsqlite3session_diff(tls *libc.TLS, pSession uintptr, zFrom uintptr, zTbl uintptr, pzErrMsg uintptr) int32 { /* sqlite3.c:210150:16: */
bp := tls.Alloc(24)
defer tls.Free(24)
@@ -166977,13 +169288,13 @@ __1:
// Locate and if necessary initialize the target table object
rc = sessionFindTable(tls, pSession, zTbl, bp+8 /* &pTo */)
- if !(*(*uintptr)(unsafe.Pointer(bp + 8 /* pTo */)) == uintptr(0)) {
+ if !(*(*uintptr)(unsafe.Pointer(bp + 8)) == uintptr(0)) {
goto __3
}
goto diff_out
__3:
;
- if !(sessionInitTable(tls, pSession, *(*uintptr)(unsafe.Pointer(bp + 8 /* pTo */))) != 0) {
+ if !(sessionInitTable(tls, pSession, *(*uintptr)(unsafe.Pointer(bp + 8))) != 0) {
goto __4
}
rc = (*Sqlite3_session)(unsafe.Pointer(pSession)).Frc
@@ -167002,7 +169313,7 @@ __4:
if !(rc == SQLITE_OK) {
goto __6
}
- if !((*SessionTable)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8 /* pTo */)))).FnCol != *(*int32)(unsafe.Pointer(bp + 12 /* nCol */))) {
+ if !((*SessionTable)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)))).FnCol != *(*int32)(unsafe.Pointer(bp + 12))) {
goto __7
}
bMismatch = 1
@@ -167010,22 +169321,22 @@ __4:
__7:
i = 0
__9:
- if !(i < *(*int32)(unsafe.Pointer(bp + 12 /* nCol */))) {
+ if !(i < *(*int32)(unsafe.Pointer(bp + 12))) {
goto __11
}
- if !(int32(*(*U8)(unsafe.Pointer((*SessionTable)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8 /* pTo */)))).FabPK + uintptr(i)))) != int32(*(*U8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 20 /* abPK */)) + uintptr(i))))) {
+ if !(int32(*(*U8)(unsafe.Pointer((*SessionTable)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)))).FabPK + uintptr(i)))) != int32(*(*U8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 20)) + uintptr(i))))) {
goto __12
}
bMismatch = 1
__12:
;
- if !(Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16 /* azCol */)) + uintptr(i)*4)), *(*uintptr)(unsafe.Pointer((*SessionTable)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8 /* pTo */)))).FazCol + uintptr(i)*4))) != 0) {
+ if !(Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16)) + uintptr(i)*4)), *(*uintptr)(unsafe.Pointer((*SessionTable)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)))).FazCol + uintptr(i)*4))) != 0) {
goto __13
}
bMismatch = 1
__13:
;
- if !(*(*U8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 20 /* abPK */)) + uintptr(i))) != 0) {
+ if !(*(*U8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 20)) + uintptr(i))) != 0) {
goto __14
}
bHasPk = 1
@@ -167049,7 +169360,7 @@ __6:
if !(pzErrMsg != 0) {
goto __16
}
- *(*uintptr)(unsafe.Pointer(pzErrMsg)) = Xsqlite3_mprintf(tls, ts+30905 /* "table schemas do..." */, 0)
+ *(*uintptr)(unsafe.Pointer(pzErrMsg)) = Xsqlite3_mprintf(tls, ts+32265 /* "table schemas do..." */, 0)
__16:
;
rc = SQLITE_SCHEMA
@@ -167109,7 +169420,7 @@ diff_out:
// Create a session object. This session object will record changes to
// database zDb attached to connection db.
-func Xsqlite3session_create(tls *libc.TLS, db uintptr, zDb uintptr, ppSession uintptr) int32 { /* sqlite3.c:208455:16: */
+func Xsqlite3session_create(tls *libc.TLS, db uintptr, zDb uintptr, ppSession uintptr) int32 { /* sqlite3.c:210245:16: */
var pNew uintptr // Newly allocated session object
var pOld uintptr // Session object already attached to db
var nDb int32 = Xsqlite3Strlen30(tls, zDb) // Length of zDb in bytes
@@ -167118,15 +169429,15 @@ func Xsqlite3session_create(tls *libc.TLS, db uintptr, zDb uintptr, ppSession ui
*(*uintptr)(unsafe.Pointer(ppSession)) = uintptr(0)
// Allocate and populate the new session object.
- pNew = Xsqlite3_malloc64(tls, (uint64((uint32(unsafe.Sizeof(Sqlite3_session{})) + uint32(nDb)) + uint32(1))))
+ pNew = Xsqlite3_malloc64(tls, uint64(uint32(unsafe.Sizeof(Sqlite3_session{}))+uint32(nDb)+uint32(1)))
if !(pNew != 0) {
return SQLITE_NOMEM
}
libc.Xmemset(tls, pNew, 0, uint32(unsafe.Sizeof(Sqlite3_session{})))
(*Sqlite3_session)(unsafe.Pointer(pNew)).Fdb = db
- (*Sqlite3_session)(unsafe.Pointer(pNew)).FzDb = (pNew + 1*88)
+ (*Sqlite3_session)(unsafe.Pointer(pNew)).FzDb = pNew + 1*88
(*Sqlite3_session)(unsafe.Pointer(pNew)).FbEnable = 1
- libc.Xmemcpy(tls, (*Sqlite3_session)(unsafe.Pointer(pNew)).FzDb, zDb, (uint32(nDb + 1)))
+ libc.Xmemcpy(tls, (*Sqlite3_session)(unsafe.Pointer(pNew)).FzDb, zDb, uint32(nDb+1))
sessionPreupdateHooks(tls, pNew)
// Add the new session object to the linked list of session objects
@@ -167145,7 +169456,7 @@ func Xsqlite3session_create(tls *libc.TLS, db uintptr, zDb uintptr, ppSession ui
// Free the list of table objects passed as the first argument. The contents
// of the changed-rows hash tables are also deleted.
-func sessionDeleteTable(tls *libc.TLS, pSession uintptr, pList uintptr) { /* sqlite3.c:208493:13: */
+func sessionDeleteTable(tls *libc.TLS, pSession uintptr, pList uintptr) { /* sqlite3.c:210283:13: */
var pNext uintptr
var pTab uintptr
@@ -167167,7 +169478,7 @@ func sessionDeleteTable(tls *libc.TLS, pSession uintptr, pList uintptr) { /* sql
}
// Delete a session object previously allocated using sqlite3session_create().
-func Xsqlite3session_delete(tls *libc.TLS, pSession uintptr) { /* sqlite3.c:208517:17: */
+func Xsqlite3session_delete(tls *libc.TLS, pSession uintptr) { /* sqlite3.c:210307:17: */
bp := tls.Alloc(4)
defer tls.Free(4)
@@ -167180,10 +169491,10 @@ func Xsqlite3session_delete(tls *libc.TLS, pSession uintptr) { /* sqlite3.c:2085
// database handle. Hold the db mutex while doing so.
Xsqlite3_mutex_enter(tls, Xsqlite3_db_mutex(tls, db))
*(*uintptr)(unsafe.Pointer(bp /* pHead */)) = Xsqlite3_preupdate_hook(tls, db, uintptr(0), uintptr(0))
- for pp = bp; /* &pHead */ (*(*uintptr)(unsafe.Pointer(pp))) != uintptr(0); pp = (*(*uintptr)(unsafe.Pointer(pp)) + 60 /* &.pNext */) {
- if (*(*uintptr)(unsafe.Pointer(pp))) == pSession {
+ for pp = bp; /* &pHead */ *(*uintptr)(unsafe.Pointer(pp)) != uintptr(0); pp = *(*uintptr)(unsafe.Pointer(pp)) + 60 /* &.pNext */ {
+ if *(*uintptr)(unsafe.Pointer(pp)) == pSession {
*(*uintptr)(unsafe.Pointer(pp)) = (*Sqlite3_session)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pp)))).FpNext
- if *(*uintptr)(unsafe.Pointer(bp /* pHead */)) != 0 {
+ if *(*uintptr)(unsafe.Pointer(bp)) != 0 {
Xsqlite3_preupdate_hook(tls, db, *(*uintptr)(unsafe.Pointer(&struct {
f func(*libc.TLS, uintptr, uintptr, int32, uintptr, uintptr, Sqlite3_int64, Sqlite3_int64)
}{xPreUpdate})), *(*uintptr)(unsafe.Pointer(bp /* pHead */)))
@@ -167205,7 +169516,7 @@ func Xsqlite3session_delete(tls *libc.TLS, pSession uintptr) { /* sqlite3.c:2085
}
// Set a table filter on a Session Object.
-func Xsqlite3session_table_filter(tls *libc.TLS, pSession uintptr, xFilter uintptr, pCtx uintptr) { /* sqlite3.c:208549:17: */
+func Xsqlite3session_table_filter(tls *libc.TLS, pSession uintptr, xFilter uintptr, pCtx uintptr) { /* sqlite3.c:210339:17: */
(*Sqlite3_session)(unsafe.Pointer(pSession)).FbAutoAttach = 1
(*Sqlite3_session)(unsafe.Pointer(pSession)).FpFilterCtx = pCtx
(*Sqlite3_session)(unsafe.Pointer(pSession)).FxTableFilter = xFilter
@@ -167217,7 +169528,7 @@ func Xsqlite3session_table_filter(tls *libc.TLS, pSession uintptr, xFilter uintp
// Only tables that have a PRIMARY KEY defined may be attached. It does
// not matter if the PRIMARY KEY is an "INTEGER PRIMARY KEY" (rowid alias)
// or not.
-func Xsqlite3session_attach(tls *libc.TLS, pSession uintptr, zName uintptr) int32 { /* sqlite3.c:208567:16: */
+func Xsqlite3session_attach(tls *libc.TLS, pSession uintptr, zName uintptr) int32 { /* sqlite3.c:210357:16: */
var rc int32 = SQLITE_OK
Xsqlite3_mutex_enter(tls, Xsqlite3_db_mutex(tls, (*Sqlite3_session)(unsafe.Pointer(pSession)).Fdb))
@@ -167231,14 +169542,14 @@ func Xsqlite3session_attach(tls *libc.TLS, pSession uintptr, zName uintptr) int3
// a no-op. Return early.
nName = Xsqlite3Strlen30(tls, zName)
for pTab = (*Sqlite3_session)(unsafe.Pointer(pSession)).FpTable; pTab != 0; pTab = (*SessionTable)(unsafe.Pointer(pTab)).FpNext {
- if 0 == Xsqlite3_strnicmp(tls, (*SessionTable)(unsafe.Pointer(pTab)).FzName, zName, (nName+1)) {
+ if 0 == Xsqlite3_strnicmp(tls, (*SessionTable)(unsafe.Pointer(pTab)).FzName, zName, nName+1) {
break
}
}
if !(pTab != 0) {
// Allocate new SessionTable object.
- var nByte int32 = (int32((uint32(unsafe.Sizeof(SessionTable{})) + uint32(nName)) + uint32(1)))
+ var nByte int32 = int32(uint32(unsafe.Sizeof(SessionTable{})) + uint32(nName) + uint32(1))
pTab = sessionMalloc64(tls, pSession, int64(nByte))
if !(pTab != 0) {
rc = SQLITE_NOMEM
@@ -167250,9 +169561,9 @@ func Xsqlite3session_attach(tls *libc.TLS, pSession uintptr, zName uintptr) int3
// eventually generated.
var ppTab uintptr
libc.Xmemset(tls, pTab, 0, uint32(unsafe.Sizeof(SessionTable{})))
- (*SessionTable)(unsafe.Pointer(pTab)).FzName = (pTab + 1*36)
- libc.Xmemcpy(tls, (*SessionTable)(unsafe.Pointer(pTab)).FzName, zName, (uint32(nName + 1)))
- for ppTab = (pSession + 64 /* &.pTable */); *(*uintptr)(unsafe.Pointer(ppTab)) != 0; ppTab = (*(*uintptr)(unsafe.Pointer(ppTab)) /* &.pNext */) {
+ (*SessionTable)(unsafe.Pointer(pTab)).FzName = pTab + 1*36
+ libc.Xmemcpy(tls, (*SessionTable)(unsafe.Pointer(pTab)).FzName, zName, uint32(nName+1))
+ for ppTab = pSession + 64; *(*uintptr)(unsafe.Pointer(ppTab)) != 0; ppTab = *(*uintptr)(unsafe.Pointer(ppTab)) {
}
*(*uintptr)(unsafe.Pointer(ppTab)) = pTab
}
@@ -167268,9 +169579,9 @@ func Xsqlite3session_attach(tls *libc.TLS, pSession uintptr, zName uintptr) int3
//
// If successful, return zero. Otherwise, if an OOM condition is encountered,
// set *pRc to SQLITE_NOMEM and return non-zero.
-func sessionBufferGrow(tls *libc.TLS, p uintptr, nByte I64, pRc uintptr) int32 { /* sqlite3.c:208620:12: */
- var nReq I64 = (I64((*SessionBuffer)(unsafe.Pointer(p)).FnBuf) + nByte)
- if (*(*int32)(unsafe.Pointer(pRc)) == SQLITE_OK) && (nReq > I64((*SessionBuffer)(unsafe.Pointer(p)).FnAlloc)) {
+func sessionBufferGrow(tls *libc.TLS, p uintptr, nByte I64, pRc uintptr) int32 { /* sqlite3.c:210410:12: */
+ var nReq I64 = I64((*SessionBuffer)(unsafe.Pointer(p)).FnBuf) + nByte
+ if *(*int32)(unsafe.Pointer(pRc)) == SQLITE_OK && nReq > I64((*SessionBuffer)(unsafe.Pointer(p)).FnAlloc) {
var aNew uintptr
var nNew I64
if (*SessionBuffer)(unsafe.Pointer(p)).FnAlloc != 0 {
@@ -167279,8 +169590,8 @@ func sessionBufferGrow(tls *libc.TLS, p uintptr, nByte I64, pRc uintptr) int32 {
nNew = int64(128)
}
- for ok := true; ok; ok = (nNew < nReq) {
- nNew = (nNew * int64(2))
+ for ok := true; ok; ok = nNew < nReq {
+ nNew = nNew * int64(2)
}
// The value of SESSION_MAX_BUFFER_SZ is copied from the implementation
@@ -167288,8 +169599,8 @@ func sessionBufferGrow(tls *libc.TLS, p uintptr, nByte I64, pRc uintptr) int32 {
// always fail. It is used here to ensure that this routine can always
// allocate up to this limit - instead of up to the largest power of
// two smaller than the limit.
- if nNew > (int64(0x7FFFFF00 - 1)) {
- nNew = (int64(0x7FFFFF00 - 1))
+ if nNew > int64(0x7FFFFF00-1) {
+ nNew = int64(0x7FFFFF00 - 1)
if nNew < nReq {
*(*int32)(unsafe.Pointer(pRc)) = SQLITE_NOMEM
return 1
@@ -167304,7 +169615,7 @@ func sessionBufferGrow(tls *libc.TLS, p uintptr, nByte I64, pRc uintptr) int32 {
(*SessionBuffer)(unsafe.Pointer(p)).FnAlloc = int32(nNew)
}
}
- return (libc.Bool32(*(*int32)(unsafe.Pointer(pRc)) != SQLITE_OK))
+ return libc.Bool32(*(*int32)(unsafe.Pointer(pRc)) != SQLITE_OK)
}
// Append the value passed as the second argument to the buffer passed
@@ -167313,18 +169624,18 @@ func sessionBufferGrow(tls *libc.TLS, p uintptr, nByte I64, pRc uintptr) int32 {
// This function is a no-op if *pRc is non-zero when it is called.
// Otherwise, if an error occurs, *pRc is set to an SQLite error code
// before returning.
-func sessionAppendValue(tls *libc.TLS, p uintptr, pVal uintptr, pRc uintptr) { /* sqlite3.c:208663:13: */
+func sessionAppendValue(tls *libc.TLS, p uintptr, pVal uintptr, pRc uintptr) { /* sqlite3.c:210453:13: */
bp := tls.Alloc(12)
defer tls.Free(12)
*(*int32)(unsafe.Pointer(bp + 8 /* rc */)) = *(*int32)(unsafe.Pointer(pRc))
- if *(*int32)(unsafe.Pointer(bp + 8 /* rc */)) == SQLITE_OK {
+ if *(*int32)(unsafe.Pointer(bp + 8)) == SQLITE_OK {
*(*Sqlite3_int64)(unsafe.Pointer(bp /* nByte */)) = int64(0)
*(*int32)(unsafe.Pointer(bp + 8 /* rc */)) = sessionSerializeValue(tls, uintptr(0), pVal, bp /* &nByte */)
sessionBufferGrow(tls, p, *(*Sqlite3_int64)(unsafe.Pointer(bp /* nByte */)), bp+8 /* &rc */)
- if *(*int32)(unsafe.Pointer(bp + 8 /* rc */)) == SQLITE_OK {
- *(*int32)(unsafe.Pointer(bp + 8 /* rc */)) = sessionSerializeValue(tls, ((*SessionBuffer)(unsafe.Pointer(p)).FaBuf + uintptr((*SessionBuffer)(unsafe.Pointer(p)).FnBuf)), pVal, uintptr(0))
- *(*int32)(unsafe.Pointer(p + 4 /* &.nBuf */)) += int32((*(*Sqlite3_int64)(unsafe.Pointer(bp /* nByte */))))
+ if *(*int32)(unsafe.Pointer(bp + 8)) == SQLITE_OK {
+ *(*int32)(unsafe.Pointer(bp + 8 /* rc */)) = sessionSerializeValue(tls, (*SessionBuffer)(unsafe.Pointer(p)).FaBuf+uintptr((*SessionBuffer)(unsafe.Pointer(p)).FnBuf), pVal, uintptr(0))
+ *(*int32)(unsafe.Pointer(p + 4)) += int32(*(*Sqlite3_int64)(unsafe.Pointer(bp)))
} else {
*(*int32)(unsafe.Pointer(pRc)) = *(*int32)(unsafe.Pointer(bp + 8 /* rc */))
}
@@ -167336,7 +169647,7 @@ func sessionAppendValue(tls *libc.TLS, p uintptr, pVal uintptr, pRc uintptr) { /
//
// If an OOM condition is encountered, set *pRc to SQLITE_NOMEM before
// returning.
-func sessionAppendByte(tls *libc.TLS, p uintptr, v U8, pRc uintptr) { /* sqlite3.c:208685:13: */
+func sessionAppendByte(tls *libc.TLS, p uintptr, v U8, pRc uintptr) { /* sqlite3.c:210475:13: */
if 0 == sessionBufferGrow(tls, p, int64(1), pRc) {
*(*U8)(unsafe.Pointer((*SessionBuffer)(unsafe.Pointer(p)).FaBuf + uintptr(libc.PostIncInt32(&(*SessionBuffer)(unsafe.Pointer(p)).FnBuf, 1)))) = v
}
@@ -167347,9 +169658,9 @@ func sessionAppendByte(tls *libc.TLS, p uintptr, v U8, pRc uintptr) { /* sqlite3
//
// If an OOM condition is encountered, set *pRc to SQLITE_NOMEM before
// returning.
-func sessionAppendVarint(tls *libc.TLS, p uintptr, v int32, pRc uintptr) { /* sqlite3.c:208698:13: */
+func sessionAppendVarint(tls *libc.TLS, p uintptr, v int32, pRc uintptr) { /* sqlite3.c:210488:13: */
if 0 == sessionBufferGrow(tls, p, int64(9), pRc) {
- *(*int32)(unsafe.Pointer(p + 4 /* &.nBuf */)) += (sessionVarintPut(tls, ((*SessionBuffer)(unsafe.Pointer(p)).FaBuf + uintptr((*SessionBuffer)(unsafe.Pointer(p)).FnBuf)), v))
+ *(*int32)(unsafe.Pointer(p + 4)) += sessionVarintPut(tls, (*SessionBuffer)(unsafe.Pointer(p)).FaBuf+uintptr((*SessionBuffer)(unsafe.Pointer(p)).FnBuf), v)
}
}
@@ -167358,10 +169669,10 @@ func sessionAppendVarint(tls *libc.TLS, p uintptr, v int32, pRc uintptr) { /* sq
//
// If an OOM condition is encountered, set *pRc to SQLITE_NOMEM before
// returning.
-func sessionAppendBlob(tls *libc.TLS, p uintptr, aBlob uintptr, nBlob int32, pRc uintptr) { /* sqlite3.c:208711:13: */
- if (nBlob > 0) && (0 == sessionBufferGrow(tls, p, int64(nBlob), pRc)) {
- libc.Xmemcpy(tls, ((*SessionBuffer)(unsafe.Pointer(p)).FaBuf + uintptr((*SessionBuffer)(unsafe.Pointer(p)).FnBuf)), aBlob, uint32(nBlob))
- *(*int32)(unsafe.Pointer(p + 4 /* &.nBuf */)) += (nBlob)
+func sessionAppendBlob(tls *libc.TLS, p uintptr, aBlob uintptr, nBlob int32, pRc uintptr) { /* sqlite3.c:210501:13: */
+ if nBlob > 0 && 0 == sessionBufferGrow(tls, p, int64(nBlob), pRc) {
+ libc.Xmemcpy(tls, (*SessionBuffer)(unsafe.Pointer(p)).FaBuf+uintptr((*SessionBuffer)(unsafe.Pointer(p)).FnBuf), aBlob, uint32(nBlob))
+ *(*int32)(unsafe.Pointer(p + 4)) += nBlob
}
}
@@ -167371,11 +169682,11 @@ func sessionAppendBlob(tls *libc.TLS, p uintptr, aBlob uintptr, nBlob int32, pRc
//
// If an OOM condition is encountered, set *pRc to SQLITE_NOMEM before
// returning.
-func sessionAppendStr(tls *libc.TLS, p uintptr, zStr uintptr, pRc uintptr) { /* sqlite3.c:208731:13: */
+func sessionAppendStr(tls *libc.TLS, p uintptr, zStr uintptr, pRc uintptr) { /* sqlite3.c:210521:13: */
var nStr int32 = Xsqlite3Strlen30(tls, zStr)
if 0 == sessionBufferGrow(tls, p, int64(nStr), pRc) {
- libc.Xmemcpy(tls, ((*SessionBuffer)(unsafe.Pointer(p)).FaBuf + uintptr((*SessionBuffer)(unsafe.Pointer(p)).FnBuf)), zStr, uint32(nStr))
- *(*int32)(unsafe.Pointer(p + 4 /* &.nBuf */)) += (nStr)
+ libc.Xmemcpy(tls, (*SessionBuffer)(unsafe.Pointer(p)).FaBuf+uintptr((*SessionBuffer)(unsafe.Pointer(p)).FnBuf), zStr, uint32(nStr))
+ *(*int32)(unsafe.Pointer(p + 4)) += nStr
}
}
@@ -167385,13 +169696,13 @@ func sessionAppendStr(tls *libc.TLS, p uintptr, zStr uintptr, pRc uintptr) { /*
//
// If an OOM condition is encountered, set *pRc to SQLITE_NOMEM before
// returning.
-func sessionAppendInteger(tls *libc.TLS, p uintptr, iVal int32, pRc uintptr) { /* sqlite3.c:208751:13: */
+func sessionAppendInteger(tls *libc.TLS, p uintptr, iVal int32, pRc uintptr) { /* sqlite3.c:210541:13: */
bp := tls.Alloc(32)
defer tls.Free(32)
// var aBuf [24]uint8 at bp+8, 24
- Xsqlite3_snprintf(tls, (int32(uint32(unsafe.Sizeof([24]uint8{})) - uint32(1))), bp+8 /* &aBuf[0] */, ts+4089 /* "%d" */, libc.VaList(bp, iVal))
+ Xsqlite3_snprintf(tls, int32(uint32(unsafe.Sizeof([24]uint8{}))-uint32(1)), bp+8 /* &aBuf[0] */, ts+4895 /* "%d" */, libc.VaList(bp, iVal))
sessionAppendStr(tls, p, bp+8 /* &aBuf[0] */, pRc)
}
@@ -167402,10 +169713,10 @@ func sessionAppendInteger(tls *libc.TLS, p uintptr, iVal int32, pRc uintptr) { /
//
// If an OOM condition is encountered, set *pRc to SQLITE_NOMEM before
// returning.
-func sessionAppendIdent(tls *libc.TLS, p uintptr, zStr uintptr, pRc uintptr) { /* sqlite3.c:208770:13: */
- var nStr int32 = (((Xsqlite3Strlen30(tls, zStr) * 2) + 2) + 1)
+func sessionAppendIdent(tls *libc.TLS, p uintptr, zStr uintptr, pRc uintptr) { /* sqlite3.c:210560:13: */
+ var nStr int32 = Xsqlite3Strlen30(tls, zStr)*2 + 2 + 1
if 0 == sessionBufferGrow(tls, p, int64(nStr), pRc) {
- var zOut uintptr = ((*SessionBuffer)(unsafe.Pointer(p)).FaBuf + uintptr((*SessionBuffer)(unsafe.Pointer(p)).FnBuf))
+ var zOut uintptr = (*SessionBuffer)(unsafe.Pointer(p)).FaBuf + uintptr((*SessionBuffer)(unsafe.Pointer(p)).FnBuf)
var zIn uintptr = zStr
*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&zOut, 1))) = uint8('"')
for *(*uint8)(unsafe.Pointer(zIn)) != 0 {
@@ -167415,7 +169726,7 @@ func sessionAppendIdent(tls *libc.TLS, p uintptr, zStr uintptr, pRc uintptr) { /
*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&zOut, 1))) = *(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&zIn, 1)))
}
*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&zOut, 1))) = uint8('"')
- (*SessionBuffer)(unsafe.Pointer(p)).FnBuf = ((int32(zOut) - int32((*SessionBuffer)(unsafe.Pointer(p)).FaBuf)) / 1)
+ (*SessionBuffer)(unsafe.Pointer(p)).FnBuf = (int32(zOut) - int32((*SessionBuffer)(unsafe.Pointer(p)).FaBuf)) / 1
}
}
@@ -167423,14 +169734,14 @@ func sessionAppendIdent(tls *libc.TLS, p uintptr, zStr uintptr, pRc uintptr) { /
// called. Otherwse, it appends the serialized version of the value stored
// in column iCol of the row that SQL statement pStmt currently points
// to to the buffer.
-func sessionAppendCol(tls *libc.TLS, p uintptr, pStmt uintptr, iCol int32, pRc uintptr) { /* sqlite3.c:208795:13: */
+func sessionAppendCol(tls *libc.TLS, p uintptr, pStmt uintptr, iCol int32, pRc uintptr) { /* sqlite3.c:210585:13: */
bp := tls.Alloc(24)
defer tls.Free(24)
if *(*int32)(unsafe.Pointer(pRc)) == SQLITE_OK {
var eType int32 = Xsqlite3_column_type(tls, pStmt, iCol)
sessionAppendByte(tls, p, U8(eType), pRc)
- if (eType == SQLITE_INTEGER) || (eType == SQLITE_FLOAT) {
+ if eType == SQLITE_INTEGER || eType == SQLITE_FLOAT {
// var i Sqlite3_int64 at bp, 8
// var aBuf [8]U8 at bp+16, 8
@@ -167444,7 +169755,7 @@ func sessionAppendCol(tls *libc.TLS, p uintptr, pStmt uintptr, iCol int32, pRc u
sessionPutI64(tls, bp+16 /* &aBuf[0] */, *(*Sqlite3_int64)(unsafe.Pointer(bp /* i */)))
sessionAppendBlob(tls, p, bp+16 /* &aBuf[0] */, 8, pRc)
}
- if (eType == SQLITE_BLOB) || (eType == SQLITE_TEXT) {
+ if eType == SQLITE_BLOB || eType == SQLITE_TEXT {
var z uintptr
var nByte int32
if eType == SQLITE_BLOB {
@@ -167453,7 +169764,7 @@ func sessionAppendCol(tls *libc.TLS, p uintptr, pStmt uintptr, iCol int32, pRc u
z = Xsqlite3_column_text(tls, pStmt, iCol)
}
nByte = Xsqlite3_column_bytes(tls, pStmt, iCol)
- if (z != 0) || ((eType == SQLITE_BLOB) && (nByte == 0)) {
+ if z != 0 || eType == SQLITE_BLOB && nByte == 0 {
sessionAppendVarint(tls, p, nByte, pRc)
sessionAppendBlob(tls, p, z, nByte, pRc)
} else {
@@ -167483,7 +169794,7 @@ func sessionAppendCol(tls *libc.TLS, p uintptr, pStmt uintptr, iCol int32, pRc u
// Otherwise, the old.* record contains all primary key values and the
// original values of any fields that have been modified. The new.* record
// contains the new values of only those fields that have been modified.
-func sessionAppendUpdate(tls *libc.TLS, pBuf uintptr, bPatchset int32, pStmt uintptr, p uintptr, abPK uintptr) int32 { /* sqlite3.c:208857:12: */
+func sessionAppendUpdate(tls *libc.TLS, pBuf uintptr, bPatchset int32, pStmt uintptr, p uintptr, abPK uintptr) int32 { /* sqlite3.c:210647:12: */
bp := tls.Alloc(40)
defer tls.Free(40)
@@ -167514,16 +169825,16 @@ func sessionAppendUpdate(tls *libc.TLS, pBuf uintptr, bPatchset int32, pStmt uin
{
nAdvance = 9
if eType == Xsqlite3_column_type(tls, pStmt, i) {
- *(*Sqlite3_int64)(unsafe.Pointer(bp + 16 /* iVal */)) = sessionGetI64(tls, (pCsr + 1))
+ *(*Sqlite3_int64)(unsafe.Pointer(bp + 16 /* iVal */)) = sessionGetI64(tls, pCsr+1)
if eType == SQLITE_INTEGER {
- if *(*Sqlite3_int64)(unsafe.Pointer(bp + 16 /* iVal */)) == Xsqlite3_column_int64(tls, pStmt, i) {
+ if *(*Sqlite3_int64)(unsafe.Pointer(bp + 16)) == Xsqlite3_column_int64(tls, pStmt, i) {
break
}
} else {
// var dVal float64 at bp+8, 8
libc.Xmemcpy(tls, bp+8 /* &dVal */, bp+16 /* &iVal */, uint32(8))
- if *(*float64)(unsafe.Pointer(bp + 8 /* dVal */)) == Xsqlite3_column_double(tls, pStmt, i) {
+ if *(*float64)(unsafe.Pointer(bp + 8)) == Xsqlite3_column_double(tls, pStmt, i) {
break
}
}
@@ -167537,12 +169848,12 @@ func sessionAppendUpdate(tls *libc.TLS, pBuf uintptr, bPatchset int32, pStmt uin
{
// var n int32 at bp+24, 4
- var nHdr int32 = (1 + sessionVarintGet(tls, (pCsr+1), bp+24 /* &n */))
+ var nHdr int32 = 1 + sessionVarintGet(tls, pCsr+1, bp+24)
- nAdvance = (nHdr + *(*int32)(unsafe.Pointer(bp + 24 /* n */)))
- if ((eType == Xsqlite3_column_type(tls, pStmt, i)) &&
- (*(*int32)(unsafe.Pointer(bp + 24 /* n */)) == Xsqlite3_column_bytes(tls, pStmt, i))) &&
- ((*(*int32)(unsafe.Pointer(bp + 24 /* n */)) == 0) || (0 == libc.Xmemcmp(tls, (pCsr+uintptr(nHdr)), Xsqlite3_column_blob(tls, pStmt, i), uint32(*(*int32)(unsafe.Pointer(bp + 24 /* n */)))))) {
+ nAdvance = nHdr + *(*int32)(unsafe.Pointer(bp + 24))
+ if eType == Xsqlite3_column_type(tls, pStmt, i) &&
+ *(*int32)(unsafe.Pointer(bp + 24)) == Xsqlite3_column_bytes(tls, pStmt, i) &&
+ (*(*int32)(unsafe.Pointer(bp + 24)) == 0 || 0 == libc.Xmemcmp(tls, pCsr+uintptr(nHdr), Xsqlite3_column_blob(tls, pStmt, i), uint32(*(*int32)(unsafe.Pointer(bp + 24))))) {
break
}
bChanged = 1
@@ -167558,7 +169869,7 @@ func sessionAppendUpdate(tls *libc.TLS, pBuf uintptr, bPatchset int32, pStmt uin
// Add a field to the old.* record. This is omitted if this modules is
// currently generating a patchset.
if bPatchset == 0 {
- if (bChanged != 0) || (*(*U8)(unsafe.Pointer(abPK + uintptr(i))) != 0) {
+ if bChanged != 0 || *(*U8)(unsafe.Pointer(abPK + uintptr(i))) != 0 {
sessionAppendBlob(tls, pBuf, pCsr, nAdvance, bp /* &rc */)
} else {
sessionAppendByte(tls, pBuf, uint8(0), bp /* &rc */)
@@ -167567,7 +169878,7 @@ func sessionAppendUpdate(tls *libc.TLS, pBuf uintptr, bPatchset int32, pStmt uin
// Add a field to the new.* record. Or the only record if currently
// generating a patchset.
- if (bChanged != 0) || ((bPatchset != 0) && (*(*U8)(unsafe.Pointer(abPK + uintptr(i))) != 0)) {
+ if bChanged != 0 || bPatchset != 0 && *(*U8)(unsafe.Pointer(abPK + uintptr(i))) != 0 {
sessionAppendCol(tls, bp+28 /* &buf2 */, pStmt, i, bp /* &rc */)
} else {
sessionAppendByte(tls, bp+28 /* &buf2 */, uint8(0), bp /* &rc */)
@@ -167589,7 +169900,7 @@ func sessionAppendUpdate(tls *libc.TLS, pBuf uintptr, bPatchset int32, pStmt uin
// Append a DELETE change to the buffer passed as the first argument. Use
// the changeset format if argument bPatchset is zero, or the patchset
// format otherwise.
-func sessionAppendDelete(tls *libc.TLS, pBuf uintptr, bPatchset int32, p uintptr, nCol int32, abPK uintptr) int32 { /* sqlite3.c:208956:12: */
+func sessionAppendDelete(tls *libc.TLS, pBuf uintptr, bPatchset int32, p uintptr, nCol int32, abPK uintptr) int32 { /* sqlite3.c:210747:12: */
bp := tls.Alloc(8)
defer tls.Free(8)
@@ -167633,7 +169944,7 @@ func sessionAppendDelete(tls *libc.TLS, pBuf uintptr, bPatchset int32, p uintptr
}
}
if *(*U8)(unsafe.Pointer(abPK + uintptr(i))) != 0 {
- sessionAppendBlob(tls, pBuf, pStart, ((int32(a) - int32(pStart)) / 1), bp /* &rc */)
+ sessionAppendBlob(tls, pBuf, pStart, (int32(a)-int32(pStart))/1, bp /* &rc */)
}
}
@@ -167646,7 +169957,7 @@ func sessionAppendDelete(tls *libc.TLS, pBuf uintptr, bPatchset int32, p uintptr
// zTab in database zDb based on its primary key. i.e.
//
// SELECT * FROM zDb.zTab WHERE pk1 = ? AND pk2 = ? AND ...
-func sessionSelectStmt(tls *libc.TLS, db uintptr, zDb uintptr, zTab uintptr, nCol int32, azCol uintptr, abPK uintptr, ppStmt uintptr) int32 { /* sqlite3.c:209011:12: */
+func sessionSelectStmt(tls *libc.TLS, db uintptr, zDb uintptr, zTab uintptr, nCol int32, azCol uintptr, abPK uintptr, ppStmt uintptr) int32 { /* sqlite3.c:210802:12: */
bp := tls.Alloc(24)
defer tls.Free(24)
@@ -167654,37 +169965,37 @@ func sessionSelectStmt(tls *libc.TLS, db uintptr, zDb uintptr, zTab uintptr, nCo
var zSql uintptr = uintptr(0)
var nSql int32 = -1
- if 0 == Xsqlite3_stricmp(tls, ts+10072 /* "sqlite_stat1" */, zTab) {
+ if 0 == Xsqlite3_stricmp(tls, ts+11186, zTab) {
zSql = Xsqlite3_mprintf(tls,
- ts+30932 /* "SELECT tbl, ?2, ..." */, libc.VaList(bp, zDb))
+ ts+32292 /* "SELECT tbl, ?2, ..." */, libc.VaList(bp, zDb))
if zSql == uintptr(0) {
*(*int32)(unsafe.Pointer(bp + 20 /* rc */)) = SQLITE_NOMEM
}
} else {
var i int32
- var zSep uintptr = ts + 755 /* "" */
+ var zSep uintptr = ts + 1543 /* "" */
*(*SessionBuffer)(unsafe.Pointer(bp + 8 /* buf */)) = SessionBuffer{}
- sessionAppendStr(tls, bp+8 /* &buf */, ts+31042 /* "SELECT * FROM " */, bp+20 /* &rc */)
+ sessionAppendStr(tls, bp+8 /* &buf */, ts+32402 /* "SELECT * FROM " */, bp+20 /* &rc */)
sessionAppendIdent(tls, bp+8 /* &buf */, zDb, bp+20 /* &rc */)
- sessionAppendStr(tls, bp+8 /* &buf */, ts+768 /* "." */, bp+20 /* &rc */)
+ sessionAppendStr(tls, bp+8 /* &buf */, ts+1556 /* "." */, bp+20 /* &rc */)
sessionAppendIdent(tls, bp+8 /* &buf */, zTab, bp+20 /* &rc */)
- sessionAppendStr(tls, bp+8 /* &buf */, ts+31057 /* " WHERE " */, bp+20 /* &rc */)
+ sessionAppendStr(tls, bp+8 /* &buf */, ts+32417 /* " WHERE " */, bp+20 /* &rc */)
for i = 0; i < nCol; i++ {
if *(*U8)(unsafe.Pointer(abPK + uintptr(i))) != 0 {
sessionAppendStr(tls, bp+8 /* &buf */, zSep, bp+20 /* &rc */)
sessionAppendIdent(tls, bp+8 /* &buf */, *(*uintptr)(unsafe.Pointer(azCol + uintptr(i)*4)), bp+20 /* &rc */)
- sessionAppendStr(tls, bp+8 /* &buf */, ts+31065 /* " IS ?" */, bp+20 /* &rc */)
- sessionAppendInteger(tls, bp+8 /* &buf */, (i + 1), bp+20 /* &rc */)
- zSep = ts + 19877 /* " AND " */
+ sessionAppendStr(tls, bp+8 /* &buf */, ts+32425 /* " IS ?" */, bp+20 /* &rc */)
+ sessionAppendInteger(tls, bp+8 /* &buf */, i+1, bp+20 /* &rc */)
+ zSep = ts + 21174 /* " AND " */
}
}
zSql = (*SessionBuffer)(unsafe.Pointer(bp + 8 /* &buf */)).FaBuf
nSql = (*SessionBuffer)(unsafe.Pointer(bp + 8 /* &buf */)).FnBuf
}
- if *(*int32)(unsafe.Pointer(bp + 20 /* rc */)) == SQLITE_OK {
+ if *(*int32)(unsafe.Pointer(bp + 20)) == SQLITE_OK {
*(*int32)(unsafe.Pointer(bp + 20 /* rc */)) = Xsqlite3_prepare_v2(tls, db, zSql, nSql, ppStmt, uintptr(0))
}
Xsqlite3_free(tls, zSql)
@@ -167697,7 +170008,7 @@ func sessionSelectStmt(tls *libc.TLS, db uintptr, zDb uintptr, zTab uintptr, nCo
//
// Return SQLITE_OK if all PK values are successfully bound, or an SQLite
// error code (e.g. SQLITE_NOMEM) otherwise.
-func sessionSelectBind(tls *libc.TLS, pSelect uintptr, nCol int32, abPK uintptr, pChange uintptr) int32 { /* sqlite3.c:209068:12: */
+func sessionSelectBind(tls *libc.TLS, pSelect uintptr, nCol int32, abPK uintptr, pChange uintptr) int32 { /* sqlite3.c:210859:12: */
bp := tls.Alloc(24)
defer tls.Free(24)
@@ -167705,7 +170016,7 @@ func sessionSelectBind(tls *libc.TLS, pSelect uintptr, nCol int32, abPK uintptr,
var rc int32 = SQLITE_OK
var a uintptr = (*SessionChange)(unsafe.Pointer(pChange)).FaRecord
- for i = 0; (i < nCol) && (rc == SQLITE_OK); i++ {
+ for i = 0; i < nCol && rc == SQLITE_OK; i++ {
var eType int32 = int32(*(*U8)(unsafe.Pointer(libc.PostIncUintptr(&a, 1))))
switch eType {
@@ -167719,7 +170030,7 @@ func sessionSelectBind(tls *libc.TLS, pSelect uintptr, nCol int32, abPK uintptr,
{
if *(*U8)(unsafe.Pointer(abPK + uintptr(i))) != 0 {
var iVal I64 = sessionGetI64(tls, a)
- rc = Xsqlite3_bind_int64(tls, pSelect, (i + 1), iVal)
+ rc = Xsqlite3_bind_int64(tls, pSelect, i+1, iVal)
}
a += uintptr(8)
break
@@ -167733,7 +170044,7 @@ func sessionSelectBind(tls *libc.TLS, pSelect uintptr, nCol int32, abPK uintptr,
*(*I64)(unsafe.Pointer(bp + 8 /* iVal */)) = sessionGetI64(tls, a)
libc.Xmemcpy(tls, bp /* &rVal */, bp+8 /* &iVal */, uint32(8))
- rc = Xsqlite3_bind_double(tls, pSelect, (i + 1), *(*float64)(unsafe.Pointer(bp /* rVal */)))
+ rc = Xsqlite3_bind_double(tls, pSelect, i+1, *(*float64)(unsafe.Pointer(bp /* rVal */)))
}
a += uintptr(8)
break
@@ -167746,7 +170057,7 @@ func sessionSelectBind(tls *libc.TLS, pSelect uintptr, nCol int32, abPK uintptr,
a += uintptr(sessionVarintGet(tls, a, bp+16 /* &n */))
if *(*U8)(unsafe.Pointer(abPK + uintptr(i))) != 0 {
- rc = Xsqlite3_bind_text(tls, pSelect, (i + 1), a, *(*int32)(unsafe.Pointer(bp + 16 /* n */)), libc.UintptrFromInt32(-1))
+ rc = Xsqlite3_bind_text(tls, pSelect, i+1, a, *(*int32)(unsafe.Pointer(bp + 16 /* n */)), libc.UintptrFromInt32(-1))
}
a += uintptr(*(*int32)(unsafe.Pointer(bp + 16 /* n */)))
break
@@ -167759,7 +170070,7 @@ func sessionSelectBind(tls *libc.TLS, pSelect uintptr, nCol int32, abPK uintptr,
a += uintptr(sessionVarintGet(tls, a, bp+20 /* &n */))
if *(*U8)(unsafe.Pointer(abPK + uintptr(i))) != 0 {
- rc = Xsqlite3_bind_blob(tls, pSelect, (i + 1), a, *(*int32)(unsafe.Pointer(bp + 20 /* n */)), libc.UintptrFromInt32(-1))
+ rc = Xsqlite3_bind_blob(tls, pSelect, i+1, a, *(*int32)(unsafe.Pointer(bp + 20 /* n */)), libc.UintptrFromInt32(-1))
}
a += uintptr(*(*int32)(unsafe.Pointer(bp + 20 /* n */)))
break
@@ -167775,7 +170086,7 @@ func sessionSelectBind(tls *libc.TLS, pSelect uintptr, nCol int32, abPK uintptr,
// is called. Otherwise, append a serialized table header (part of the binary
// changeset format) to buffer *pBuf. If an error occurs, set *pRc to an
// SQLite error code before returning.
-func sessionAppendTableHdr(tls *libc.TLS, pBuf uintptr, bPatchset int32, pTab uintptr, pRc uintptr) { /* sqlite3.c:209139:13: */
+func sessionAppendTableHdr(tls *libc.TLS, pBuf uintptr, bPatchset int32, pTab uintptr, pRc uintptr) { /* sqlite3.c:210930:13: */
// Write a table header
sessionAppendByte(tls, pBuf, func() uint8 {
if bPatchset != 0 {
@@ -167785,7 +170096,7 @@ func sessionAppendTableHdr(tls *libc.TLS, pBuf uintptr, bPatchset int32, pTab ui
}(), pRc)
sessionAppendVarint(tls, pBuf, (*SessionTable)(unsafe.Pointer(pTab)).FnCol, pRc)
sessionAppendBlob(tls, pBuf, (*SessionTable)(unsafe.Pointer(pTab)).FabPK, (*SessionTable)(unsafe.Pointer(pTab)).FnCol, pRc)
- sessionAppendBlob(tls, pBuf, (*SessionTable)(unsafe.Pointer(pTab)).FzName, (int32(libc.Xstrlen(tls, (*SessionTable)(unsafe.Pointer(pTab)).FzName)) + 1), pRc)
+ sessionAppendBlob(tls, pBuf, (*SessionTable)(unsafe.Pointer(pTab)).FzName, int32(libc.Xstrlen(tls, (*SessionTable)(unsafe.Pointer(pTab)).FzName))+1, pRc)
}
// Generate either a changeset (if argument bPatchset is zero) or a patchset
@@ -167796,7 +170107,7 @@ func sessionAppendTableHdr(tls *libc.TLS, pBuf uintptr, bPatchset int32, pTab ui
// stored in output variables *pnChangeset and *ppChangeset. Or, if an error
// occurs, an SQLite error code is returned and both output variables set
// to 0.
-func sessionGenerateChangeset(tls *libc.TLS, pSession uintptr, bPatchset int32, xOutput uintptr, pOut uintptr, pnChangeset uintptr, ppChangeset uintptr) int32 { /* sqlite3.c:209162:12: */
+func sessionGenerateChangeset(tls *libc.TLS, pSession uintptr, bPatchset int32, xOutput uintptr, pOut uintptr, pnChangeset uintptr, ppChangeset uintptr) int32 { /* sqlite3.c:210953:12: */
bp := tls.Alloc(32)
defer tls.Free(32)
@@ -167810,6 +170121,7 @@ func sessionGenerateChangeset(tls *libc.TLS, pSession uintptr, bPatchset int32,
// object is already in the error state (sqlite3_session.rc != SQLITE_OK),
// this call will be a no-op.
if xOutput == uintptr(0) {
+
*(*int32)(unsafe.Pointer(pnChangeset)) = 0
*(*uintptr)(unsafe.Pointer(ppChangeset)) = uintptr(0)
}
@@ -167817,20 +170129,18 @@ func sessionGenerateChangeset(tls *libc.TLS, pSession uintptr, bPatchset int32,
if (*Sqlite3_session)(unsafe.Pointer(pSession)).Frc != 0 {
return (*Sqlite3_session)(unsafe.Pointer(pSession)).Frc
}
- *(*int32)(unsafe.Pointer(bp + 24 /* rc */)) = Xsqlite3_exec(tls, (*Sqlite3_session)(unsafe.Pointer(pSession)).Fdb, ts+31071 /* "SAVEPOINT change..." */, uintptr(0), uintptr(0), uintptr(0))
- if *(*int32)(unsafe.Pointer(bp + 24 /* rc */)) != SQLITE_OK {
+ *(*int32)(unsafe.Pointer(bp + 24 /* rc */)) = Xsqlite3_exec(tls, (*Sqlite3_session)(unsafe.Pointer(pSession)).Fdb, ts+32431 /* "SAVEPOINT change..." */, uintptr(0), uintptr(0), uintptr(0))
+ if *(*int32)(unsafe.Pointer(bp + 24)) != SQLITE_OK {
return *(*int32)(unsafe.Pointer(bp + 24 /* rc */))
}
Xsqlite3_mutex_enter(tls, Xsqlite3_db_mutex(tls, db))
- for pTab = (*Sqlite3_session)(unsafe.Pointer(pSession)).FpTable; (*(*int32)(unsafe.Pointer(bp + 24 /* rc */)) == SQLITE_OK) && (pTab != 0); pTab = (*SessionTable)(unsafe.Pointer(pTab)).FpNext {
+ for pTab = (*Sqlite3_session)(unsafe.Pointer(pSession)).FpTable; *(*int32)(unsafe.Pointer(bp + 24 /* rc */)) == SQLITE_OK && pTab != 0; pTab = (*SessionTable)(unsafe.Pointer(pTab)).FpNext {
if (*SessionTable)(unsafe.Pointer(pTab)).FnEntry != 0 {
var zName uintptr = (*SessionTable)(unsafe.Pointer(pTab)).FzName
- // var nCol int32 at bp, 4
- // Number of columns in table
- // var abPK uintptr at bp+8, 4
- // Primary key array
+ *(*int32)(unsafe.Pointer(bp /* nCol */)) = 0 // Number of columns in table
+ *(*uintptr)(unsafe.Pointer(bp + 8 /* abPK */)) = uintptr(0) // Primary key array
*(*uintptr)(unsafe.Pointer(bp + 4 /* azCol */)) = uintptr(0) // Table columns
var i int32 // Used to iterate through hash buckets
*(*uintptr)(unsafe.Pointer(bp + 28 /* pSel */)) = uintptr(0) // SELECT statement to query table pTab
@@ -167839,7 +170149,7 @@ func sessionGenerateChangeset(tls *libc.TLS, pSession uintptr, bPatchset int32,
// Check the table schema is still Ok.
*(*int32)(unsafe.Pointer(bp + 24 /* rc */)) = sessionTableInfo(tls, uintptr(0), db, (*Sqlite3_session)(unsafe.Pointer(pSession)).FzDb, zName, bp /* &nCol */, uintptr(0), bp+4 /* &azCol */, bp+8 /* &abPK */)
- if !(*(*int32)(unsafe.Pointer(bp + 24 /* rc */)) != 0) && (((*SessionTable)(unsafe.Pointer(pTab)).FnCol != *(*int32)(unsafe.Pointer(bp /* nCol */))) || (libc.Xmemcmp(tls, *(*uintptr)(unsafe.Pointer(bp + 8 /* abPK */)), (*SessionTable)(unsafe.Pointer(pTab)).FabPK, uint32(*(*int32)(unsafe.Pointer(bp /* nCol */)))) != 0)) {
+ if !(*(*int32)(unsafe.Pointer(bp + 24)) != 0) && ((*SessionTable)(unsafe.Pointer(pTab)).FnCol != *(*int32)(unsafe.Pointer(bp)) || libc.Xmemcmp(tls, *(*uintptr)(unsafe.Pointer(bp + 8)), (*SessionTable)(unsafe.Pointer(pTab)).FabPK, uint32(*(*int32)(unsafe.Pointer(bp)))) != 0) {
*(*int32)(unsafe.Pointer(bp + 24 /* rc */)) = SQLITE_SCHEMA
}
@@ -167847,21 +170157,21 @@ func sessionGenerateChangeset(tls *libc.TLS, pSession uintptr, bPatchset int32,
sessionAppendTableHdr(tls, bp+12 /* &buf */, bPatchset, pTab, bp+24 /* &rc */)
// Build and compile a statement to execute:
- if *(*int32)(unsafe.Pointer(bp + 24 /* rc */)) == SQLITE_OK {
+ if *(*int32)(unsafe.Pointer(bp + 24)) == SQLITE_OK {
*(*int32)(unsafe.Pointer(bp + 24 /* rc */)) = sessionSelectStmt(tls,
db, (*Sqlite3_session)(unsafe.Pointer(pSession)).FzDb, zName, *(*int32)(unsafe.Pointer(bp /* nCol */)), *(*uintptr)(unsafe.Pointer(bp + 4 /* azCol */)), *(*uintptr)(unsafe.Pointer(bp + 8 /* abPK */)), bp+28 /* &pSel */)
}
nNoop = (*SessionBuffer)(unsafe.Pointer(bp + 12 /* &buf */)).FnBuf
- for i = 0; (i < (*SessionTable)(unsafe.Pointer(pTab)).FnChange) && (*(*int32)(unsafe.Pointer(bp + 24 /* rc */)) == SQLITE_OK); i++ {
+ for i = 0; i < (*SessionTable)(unsafe.Pointer(pTab)).FnChange && *(*int32)(unsafe.Pointer(bp + 24 /* rc */)) == SQLITE_OK; i++ {
var p uintptr // Used to iterate through changes
- for p = *(*uintptr)(unsafe.Pointer((*SessionTable)(unsafe.Pointer(pTab)).FapChange + uintptr(i)*4)); (*(*int32)(unsafe.Pointer(bp + 24 /* rc */)) == SQLITE_OK) && (p != 0); p = (*SessionChange)(unsafe.Pointer(p)).FpNext {
+ for p = *(*uintptr)(unsafe.Pointer((*SessionTable)(unsafe.Pointer(pTab)).FapChange + uintptr(i)*4)); *(*int32)(unsafe.Pointer(bp + 24 /* rc */)) == SQLITE_OK && p != 0; p = (*SessionChange)(unsafe.Pointer(p)).FpNext {
*(*int32)(unsafe.Pointer(bp + 24 /* rc */)) = sessionSelectBind(tls, *(*uintptr)(unsafe.Pointer(bp + 28 /* pSel */)), *(*int32)(unsafe.Pointer(bp /* nCol */)), *(*uintptr)(unsafe.Pointer(bp + 8 /* abPK */)), p)
- if *(*int32)(unsafe.Pointer(bp + 24 /* rc */)) != SQLITE_OK {
+ if *(*int32)(unsafe.Pointer(bp + 24)) != SQLITE_OK {
continue
}
- if Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp + 28 /* pSel */))) == SQLITE_ROW {
+ if Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp + 28))) == SQLITE_ROW {
if int32((*SessionChange)(unsafe.Pointer(p)).Fop) == SQLITE_INSERT {
var iCol int32
sessionAppendByte(tls, bp+12 /* &buf */, uint8(SQLITE_INSERT), bp+24 /* &rc */)
@@ -167870,21 +170180,22 @@ func sessionGenerateChangeset(tls *libc.TLS, pSession uintptr, bPatchset int32,
sessionAppendCol(tls, bp+12 /* &buf */, *(*uintptr)(unsafe.Pointer(bp + 28 /* pSel */)), iCol, bp+24 /* &rc */)
}
} else {
+ // Because sessionSelectStmt() returned ok
*(*int32)(unsafe.Pointer(bp + 24 /* rc */)) = sessionAppendUpdate(tls, bp+12 /* &buf */, bPatchset, *(*uintptr)(unsafe.Pointer(bp + 28 /* pSel */)), p, *(*uintptr)(unsafe.Pointer(bp + 8 /* abPK */)))
}
} else if int32((*SessionChange)(unsafe.Pointer(p)).Fop) != SQLITE_INSERT {
*(*int32)(unsafe.Pointer(bp + 24 /* rc */)) = sessionAppendDelete(tls, bp+12 /* &buf */, bPatchset, p, *(*int32)(unsafe.Pointer(bp /* nCol */)), *(*uintptr)(unsafe.Pointer(bp + 8 /* abPK */)))
}
- if *(*int32)(unsafe.Pointer(bp + 24 /* rc */)) == SQLITE_OK {
+ if *(*int32)(unsafe.Pointer(bp + 24)) == SQLITE_OK {
*(*int32)(unsafe.Pointer(bp + 24 /* rc */)) = Xsqlite3_reset(tls, *(*uintptr)(unsafe.Pointer(bp + 28 /* pSel */)))
}
// If the buffer is now larger than sessions_strm_chunk_size, pass
// its contents to the xOutput() callback.
- if (((xOutput != 0) &&
- (*(*int32)(unsafe.Pointer(bp + 24 /* rc */)) == SQLITE_OK)) &&
- ((*SessionBuffer)(unsafe.Pointer(bp+12 /* &buf */)).FnBuf > nNoop)) &&
- ((*SessionBuffer)(unsafe.Pointer(bp+12 /* &buf */)).FnBuf > sessions_strm_chunk_size) {
+ if xOutput != 0 &&
+ *(*int32)(unsafe.Pointer(bp + 24)) == SQLITE_OK &&
+ (*SessionBuffer)(unsafe.Pointer(bp+12)).FnBuf > nNoop &&
+ (*SessionBuffer)(unsafe.Pointer(bp+12)).FnBuf > sessions_strm_chunk_size {
*(*int32)(unsafe.Pointer(bp + 24 /* rc */)) = (*struct {
f func(*libc.TLS, uintptr, uintptr, int32) int32
})(unsafe.Pointer(&struct{ uintptr }{xOutput})).f(tls, pOut, (*SessionBuffer)(unsafe.Pointer(bp+12 /* &buf */)).FaBuf, (*SessionBuffer)(unsafe.Pointer(bp+12 /* &buf */)).FnBuf)
@@ -167896,19 +170207,19 @@ func sessionGenerateChangeset(tls *libc.TLS, pSession uintptr, bPatchset int32,
}
Xsqlite3_finalize(tls, *(*uintptr)(unsafe.Pointer(bp + 28 /* pSel */)))
- if (*SessionBuffer)(unsafe.Pointer(bp+12 /* &buf */)).FnBuf == nNoop {
+ if (*SessionBuffer)(unsafe.Pointer(bp+12)).FnBuf == nNoop {
(*SessionBuffer)(unsafe.Pointer(bp + 12 /* &buf */)).FnBuf = nRewind
}
Xsqlite3_free(tls, *(*uintptr)(unsafe.Pointer(bp + 4 /* azCol */))) // cast works around VC++ bug
}
}
- if *(*int32)(unsafe.Pointer(bp + 24 /* rc */)) == SQLITE_OK {
+ if *(*int32)(unsafe.Pointer(bp + 24)) == SQLITE_OK {
if xOutput == uintptr(0) {
*(*int32)(unsafe.Pointer(pnChangeset)) = (*SessionBuffer)(unsafe.Pointer(bp + 12 /* &buf */)).FnBuf
*(*uintptr)(unsafe.Pointer(ppChangeset)) = (*SessionBuffer)(unsafe.Pointer(bp + 12 /* &buf */)).FaBuf
(*SessionBuffer)(unsafe.Pointer(bp + 12 /* &buf */)).FaBuf = uintptr(0)
- } else if (*SessionBuffer)(unsafe.Pointer(bp+12 /* &buf */)).FnBuf > 0 {
+ } else if (*SessionBuffer)(unsafe.Pointer(bp+12)).FnBuf > 0 {
*(*int32)(unsafe.Pointer(bp + 24 /* rc */)) = (*struct {
f func(*libc.TLS, uintptr, uintptr, int32) int32
})(unsafe.Pointer(&struct{ uintptr }{xOutput})).f(tls, pOut, (*SessionBuffer)(unsafe.Pointer(bp+12 /* &buf */)).FaBuf, (*SessionBuffer)(unsafe.Pointer(bp+12 /* &buf */)).FnBuf)
@@ -167916,7 +170227,7 @@ func sessionGenerateChangeset(tls *libc.TLS, pSession uintptr, bPatchset int32,
}
Xsqlite3_free(tls, (*SessionBuffer)(unsafe.Pointer(bp+12 /* &buf */)).FaBuf)
- Xsqlite3_exec(tls, db, ts+31091 /* "RELEASE changese..." */, uintptr(0), uintptr(0), uintptr(0))
+ Xsqlite3_exec(tls, db, ts+32451 /* "RELEASE changese..." */, uintptr(0), uintptr(0), uintptr(0))
Xsqlite3_mutex_leave(tls, Xsqlite3_db_mutex(tls, db))
return *(*int32)(unsafe.Pointer(bp + 24 /* rc */))
}
@@ -167926,19 +170237,30 @@ func sessionGenerateChangeset(tls *libc.TLS, pSession uintptr, bPatchset int32,
//
// It is the responsibility of the caller to eventually free the buffer
// using sqlite3_free().
-func Xsqlite3session_changeset(tls *libc.TLS, pSession uintptr, pnChangeset uintptr, ppChangeset uintptr) int32 { /* sqlite3.c:209288:16: */
- var rc int32 = sessionGenerateChangeset(tls, pSession, 0, uintptr(0), uintptr(0), pnChangeset, ppChangeset)
+func Xsqlite3session_changeset(tls *libc.TLS, pSession uintptr, pnChangeset uintptr, ppChangeset uintptr) int32 { /* sqlite3.c:211082:16: */
+ var rc int32
+
+ if pnChangeset == uintptr(0) || ppChangeset == uintptr(0) {
+ return SQLITE_MISUSE
+ }
+ rc = sessionGenerateChangeset(tls, pSession, 0, uintptr(0), uintptr(0), pnChangeset, ppChangeset)
return rc
}
// Streaming version of sqlite3session_changeset().
-func Xsqlite3session_changeset_strm(tls *libc.TLS, pSession uintptr, xOutput uintptr, pOut uintptr) int32 { /* sqlite3.c:209303:16: */
+func Xsqlite3session_changeset_strm(tls *libc.TLS, pSession uintptr, xOutput uintptr, pOut uintptr) int32 { /* sqlite3.c:211100:16: */
+ if xOutput == uintptr(0) {
+ return SQLITE_MISUSE
+ }
return sessionGenerateChangeset(tls, pSession, 0, xOutput, pOut, uintptr(0), uintptr(0))
}
// Streaming version of sqlite3session_patchset().
-func Xsqlite3session_patchset_strm(tls *libc.TLS, pSession uintptr, xOutput uintptr, pOut uintptr) int32 { /* sqlite3.c:209314:16: */
+func Xsqlite3session_patchset_strm(tls *libc.TLS, pSession uintptr, xOutput uintptr, pOut uintptr) int32 { /* sqlite3.c:211112:16: */
+ if xOutput == uintptr(0) {
+ return SQLITE_MISUSE
+ }
return sessionGenerateChangeset(tls, pSession, 1, xOutput, pOut, uintptr(0), uintptr(0))
}
@@ -167947,12 +170269,15 @@ func Xsqlite3session_patchset_strm(tls *libc.TLS, pSession uintptr, xOutput uint
//
// It is the responsibility of the caller to eventually free the buffer
// using sqlite3_free().
-func Xsqlite3session_patchset(tls *libc.TLS, pSession uintptr, pnPatchset uintptr, ppPatchset uintptr) int32 { /* sqlite3.c:209329:16: */
+func Xsqlite3session_patchset(tls *libc.TLS, pSession uintptr, pnPatchset uintptr, ppPatchset uintptr) int32 { /* sqlite3.c:211128:16: */
+ if pnPatchset == uintptr(0) || ppPatchset == uintptr(0) {
+ return SQLITE_MISUSE
+ }
return sessionGenerateChangeset(tls, pSession, 1, uintptr(0), uintptr(0), pnPatchset, ppPatchset)
}
// Enable or disable the session object passed as the first argument.
-func Xsqlite3session_enable(tls *libc.TLS, pSession uintptr, bEnable int32) int32 { /* sqlite3.c:209340:16: */
+func Xsqlite3session_enable(tls *libc.TLS, pSession uintptr, bEnable int32) int32 { /* sqlite3.c:211140:16: */
var ret int32
Xsqlite3_mutex_enter(tls, Xsqlite3_db_mutex(tls, (*Sqlite3_session)(unsafe.Pointer(pSession)).Fdb))
if bEnable >= 0 {
@@ -167964,7 +170289,7 @@ func Xsqlite3session_enable(tls *libc.TLS, pSession uintptr, bEnable int32) int3
}
// Enable or disable the session object passed as the first argument.
-func Xsqlite3session_indirect(tls *libc.TLS, pSession uintptr, bIndirect int32) int32 { /* sqlite3.c:209354:16: */
+func Xsqlite3session_indirect(tls *libc.TLS, pSession uintptr, bIndirect int32) int32 { /* sqlite3.c:211154:16: */
var ret int32
Xsqlite3_mutex_enter(tls, Xsqlite3_db_mutex(tls, (*Sqlite3_session)(unsafe.Pointer(pSession)).Fdb))
if bIndirect >= 0 {
@@ -167977,26 +170302,26 @@ func Xsqlite3session_indirect(tls *libc.TLS, pSession uintptr, bIndirect int32)
// Return true if there have been no changes to monitored tables recorded
// by the session object passed as the only argument.
-func Xsqlite3session_isempty(tls *libc.TLS, pSession uintptr) int32 { /* sqlite3.c:209369:16: */
+func Xsqlite3session_isempty(tls *libc.TLS, pSession uintptr) int32 { /* sqlite3.c:211169:16: */
var ret int32 = 0
var pTab uintptr
Xsqlite3_mutex_enter(tls, Xsqlite3_db_mutex(tls, (*Sqlite3_session)(unsafe.Pointer(pSession)).Fdb))
- for pTab = (*Sqlite3_session)(unsafe.Pointer(pSession)).FpTable; (pTab != 0) && (ret == 0); pTab = (*SessionTable)(unsafe.Pointer(pTab)).FpNext {
- ret = (libc.Bool32((*SessionTable)(unsafe.Pointer(pTab)).FnEntry > 0))
+ for pTab = (*Sqlite3_session)(unsafe.Pointer(pSession)).FpTable; pTab != 0 && ret == 0; pTab = (*SessionTable)(unsafe.Pointer(pTab)).FpNext {
+ ret = libc.Bool32((*SessionTable)(unsafe.Pointer(pTab)).FnEntry > 0)
}
Xsqlite3_mutex_leave(tls, Xsqlite3_db_mutex(tls, (*Sqlite3_session)(unsafe.Pointer(pSession)).Fdb))
- return (libc.Bool32(ret == 0))
+ return libc.Bool32(ret == 0)
}
// Return the amount of heap memory in use.
-func Xsqlite3session_memory_used(tls *libc.TLS, pSession uintptr) Sqlite3_int64 { /* sqlite3.c:209385:26: */
+func Xsqlite3session_memory_used(tls *libc.TLS, pSession uintptr) Sqlite3_int64 { /* sqlite3.c:211185:26: */
return (*Sqlite3_session)(unsafe.Pointer(pSession)).FnMalloc
}
// Configure the session object passed as the first argument.
-func Xsqlite3session_object_config(tls *libc.TLS, pSession uintptr, op int32, pArg uintptr) int32 { /* sqlite3.c:209392:16: */
+func Xsqlite3session_object_config(tls *libc.TLS, pSession uintptr, op int32, pArg uintptr) int32 { /* sqlite3.c:211192:16: */
var rc int32 = SQLITE_OK
switch op {
case SQLITE_SESSION_OBJCONFIG_SIZE:
@@ -168006,7 +170331,7 @@ func Xsqlite3session_object_config(tls *libc.TLS, pSession uintptr, op int32, pA
if (*Sqlite3_session)(unsafe.Pointer(pSession)).FpTable != 0 {
rc = SQLITE_MISUSE
} else {
- (*Sqlite3_session)(unsafe.Pointer(pSession)).FbEnableSize = (libc.Bool32(iArg != 0))
+ (*Sqlite3_session)(unsafe.Pointer(pSession)).FbEnableSize = libc.Bool32(iArg != 0)
}
}
*(*int32)(unsafe.Pointer(pArg)) = (*Sqlite3_session)(unsafe.Pointer(pSession)).FbEnableSize
@@ -168022,12 +170347,12 @@ func Xsqlite3session_object_config(tls *libc.TLS, pSession uintptr, op int32, pA
}
// Return the maximum size of sqlite3session_changeset() output.
-func Xsqlite3session_changeset_size(tls *libc.TLS, pSession uintptr) Sqlite3_int64 { /* sqlite3.c:209418:26: */
+func Xsqlite3session_changeset_size(tls *libc.TLS, pSession uintptr) Sqlite3_int64 { /* sqlite3.c:211218:26: */
return (*Sqlite3_session)(unsafe.Pointer(pSession)).FnMaxChangesetSize
}
// Do the work for either sqlite3changeset_start() or start_strm().
-func sessionChangesetStart(tls *libc.TLS, pp uintptr, xInput uintptr, pIn uintptr, nChangeset int32, pChangeset uintptr, bInvert int32, bSkipEmpty int32) int32 { /* sqlite3.c:209425:12: */
+func sessionChangesetStart(tls *libc.TLS, pp uintptr, xInput uintptr, pIn uintptr, nChangeset int32, pChangeset uintptr, bInvert int32, bSkipEmpty int32) int32 { /* sqlite3.c:211225:12: */
var pRet uintptr // Iterator to return
var nByte int32 // Number of bytes to allocate for iterator
@@ -168060,35 +170385,35 @@ func sessionChangesetStart(tls *libc.TLS, pp uintptr, xInput uintptr, pIn uintpt
}
// Create an iterator used to iterate through the contents of a changeset.
-func Xsqlite3changeset_start(tls *libc.TLS, pp uintptr, nChangeset int32, pChangeset uintptr) int32 { /* sqlite3.c:209463:16: */
+func Xsqlite3changeset_start(tls *libc.TLS, pp uintptr, nChangeset int32, pChangeset uintptr) int32 { /* sqlite3.c:211263:16: */
return sessionChangesetStart(tls, pp, uintptr(0), uintptr(0), nChangeset, pChangeset, 0, 0)
}
-func Xsqlite3changeset_start_v2(tls *libc.TLS, pp uintptr, nChangeset int32, pChangeset uintptr, flags int32) int32 { /* sqlite3.c:209470:16: */
- var bInvert int32 = libc.BoolInt32(!(!((flags & SQLITE_CHANGESETSTART_INVERT) != 0)))
+func Xsqlite3changeset_start_v2(tls *libc.TLS, pp uintptr, nChangeset int32, pChangeset uintptr, flags int32) int32 { /* sqlite3.c:211270:16: */
+ var bInvert int32 = libc.BoolInt32(!!(flags&SQLITE_CHANGESETSTART_INVERT != 0))
return sessionChangesetStart(tls, pp, uintptr(0), uintptr(0), nChangeset, pChangeset, bInvert, 0)
}
// Streaming version of sqlite3changeset_start().
-func Xsqlite3changeset_start_strm(tls *libc.TLS, pp uintptr, xInput uintptr, pIn uintptr) int32 { /* sqlite3.c:209483:16: */
+func Xsqlite3changeset_start_strm(tls *libc.TLS, pp uintptr, xInput uintptr, pIn uintptr) int32 { /* sqlite3.c:211283:16: */
return sessionChangesetStart(tls, pp, xInput, pIn, 0, uintptr(0), 0, 0)
}
-func Xsqlite3changeset_start_v2_strm(tls *libc.TLS, pp uintptr, xInput uintptr, pIn uintptr, flags int32) int32 { /* sqlite3.c:209490:16: */
- var bInvert int32 = libc.BoolInt32(!(!((flags & SQLITE_CHANGESETSTART_INVERT) != 0)))
+func Xsqlite3changeset_start_v2_strm(tls *libc.TLS, pp uintptr, xInput uintptr, pIn uintptr, flags int32) int32 { /* sqlite3.c:211290:16: */
+ var bInvert int32 = libc.BoolInt32(!!(flags&SQLITE_CHANGESETSTART_INVERT != 0))
return sessionChangesetStart(tls, pp, xInput, pIn, 0, uintptr(0), bInvert, 0)
}
// If the SessionInput object passed as the only argument is a streaming
// object and the buffer is full, discard some data to free up space.
-func sessionDiscardData(tls *libc.TLS, pIn uintptr) { /* sqlite3.c:209504:13: */
- if ((*SessionInput)(unsafe.Pointer(pIn)).FxInput != 0) && ((*SessionInput)(unsafe.Pointer(pIn)).FiNext >= sessions_strm_chunk_size) {
- var nMove int32 = ((*SessionInput)(unsafe.Pointer(pIn)).Fbuf.FnBuf - (*SessionInput)(unsafe.Pointer(pIn)).FiNext)
+func sessionDiscardData(tls *libc.TLS, pIn uintptr) { /* sqlite3.c:211304:13: */
+ if (*SessionInput)(unsafe.Pointer(pIn)).FxInput != 0 && (*SessionInput)(unsafe.Pointer(pIn)).FiNext >= sessions_strm_chunk_size {
+ var nMove int32 = (*SessionInput)(unsafe.Pointer(pIn)).Fbuf.FnBuf - (*SessionInput)(unsafe.Pointer(pIn)).FiNext
if nMove > 0 {
- libc.Xmemmove(tls, (*SessionInput)(unsafe.Pointer(pIn)).Fbuf.FaBuf, ((*SessionInput)(unsafe.Pointer(pIn)).Fbuf.FaBuf + uintptr((*SessionInput)(unsafe.Pointer(pIn)).FiNext)), uint32(nMove))
+ libc.Xmemmove(tls, (*SessionInput)(unsafe.Pointer(pIn)).Fbuf.FaBuf, (*SessionInput)(unsafe.Pointer(pIn)).Fbuf.FaBuf+uintptr((*SessionInput)(unsafe.Pointer(pIn)).FiNext), uint32(nMove))
}
- *(*int32)(unsafe.Pointer(pIn + 20 /* &.buf */ + 4 /* &.nBuf */)) -= ((*SessionInput)(unsafe.Pointer(pIn)).FiNext)
+ *(*int32)(unsafe.Pointer(pIn + 20 + 4)) -= (*SessionInput)(unsafe.Pointer(pIn)).FiNext
(*SessionInput)(unsafe.Pointer(pIn)).FiNext = 0
(*SessionInput)(unsafe.Pointer(pIn)).FnData = (*SessionInput)(unsafe.Pointer(pIn)).Fbuf.FnBuf
}
@@ -168099,26 +170424,26 @@ func sessionDiscardData(tls *libc.TLS, pIn uintptr) { /* sqlite3.c:209504:13: */
// data is in the buffer.
//
// Return an SQLite error code if an error occurs, or SQLITE_OK otherwise.
-func sessionInputBuffer(tls *libc.TLS, pIn uintptr, nByte int32) int32 { /* sqlite3.c:209524:12: */
+func sessionInputBuffer(tls *libc.TLS, pIn uintptr, nByte int32) int32 { /* sqlite3.c:211324:12: */
bp := tls.Alloc(8)
defer tls.Free(8)
*(*int32)(unsafe.Pointer(bp /* rc */)) = SQLITE_OK
if (*SessionInput)(unsafe.Pointer(pIn)).FxInput != 0 {
- for (!((*SessionInput)(unsafe.Pointer(pIn)).FbEof != 0) && (((*SessionInput)(unsafe.Pointer(pIn)).FiNext + nByte) >= (*SessionInput)(unsafe.Pointer(pIn)).FnData)) && (*(*int32)(unsafe.Pointer(bp /* rc */)) == SQLITE_OK) {
+ for !((*SessionInput)(unsafe.Pointer(pIn)).FbEof != 0) && (*SessionInput)(unsafe.Pointer(pIn)).FiNext+nByte >= (*SessionInput)(unsafe.Pointer(pIn)).FnData && *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK {
*(*int32)(unsafe.Pointer(bp + 4 /* nNew */)) = sessions_strm_chunk_size
if (*SessionInput)(unsafe.Pointer(pIn)).FbNoDiscard == 0 {
sessionDiscardData(tls, pIn)
}
- if SQLITE_OK == sessionBufferGrow(tls, (pIn+20 /* &.buf */), int64(*(*int32)(unsafe.Pointer(bp + 4 /* nNew */))), bp /* &rc */) {
+ if SQLITE_OK == sessionBufferGrow(tls, pIn+20, int64(*(*int32)(unsafe.Pointer(bp + 4))), bp) {
*(*int32)(unsafe.Pointer(bp /* rc */)) = (*struct {
f func(*libc.TLS, uintptr, uintptr, uintptr) int32
- })(unsafe.Pointer(&struct{ uintptr }{(*SessionInput)(unsafe.Pointer(pIn)).FxInput})).f(tls, (*SessionInput)(unsafe.Pointer(pIn)).FpIn, ((*SessionInput)(unsafe.Pointer(pIn)).Fbuf.FaBuf + uintptr((*SessionInput)(unsafe.Pointer(pIn)).Fbuf.FnBuf)), bp+4 /* &nNew */)
- if *(*int32)(unsafe.Pointer(bp + 4 /* nNew */)) == 0 {
+ })(unsafe.Pointer(&struct{ uintptr }{(*SessionInput)(unsafe.Pointer(pIn)).FxInput})).f(tls, (*SessionInput)(unsafe.Pointer(pIn)).FpIn, (*SessionInput)(unsafe.Pointer(pIn)).Fbuf.FaBuf+uintptr((*SessionInput)(unsafe.Pointer(pIn)).Fbuf.FnBuf), bp+4 /* &nNew */)
+ if *(*int32)(unsafe.Pointer(bp + 4)) == 0 {
(*SessionInput)(unsafe.Pointer(pIn)).FbEof = 1
} else {
- *(*int32)(unsafe.Pointer(pIn + 20 /* &.buf */ + 4 /* &.nBuf */)) += (*(*int32)(unsafe.Pointer(bp + 4 /* nNew */)))
+ *(*int32)(unsafe.Pointer(pIn + 20 + 4)) += *(*int32)(unsafe.Pointer(bp + 4))
}
}
@@ -168132,7 +170457,7 @@ func sessionInputBuffer(tls *libc.TLS, pIn uintptr, nByte int32) int32 { /* sqli
// When this function is called, *ppRec points to the start of a record
// that contains nCol values. This function advances the pointer *ppRec
// until it points to the byte immediately following that record.
-func sessionSkipRecord(tls *libc.TLS, ppRec uintptr, nCol int32) { /* sqlite3.c:209552:13: */
+func sessionSkipRecord(tls *libc.TLS, ppRec uintptr, nCol int32) { /* sqlite3.c:211352:13: */
bp := tls.Alloc(4)
defer tls.Free(4)
@@ -168140,12 +170465,12 @@ func sessionSkipRecord(tls *libc.TLS, ppRec uintptr, nCol int32) { /* sqlite3.c:
var i int32
for i = 0; i < nCol; i++ {
var eType int32 = int32(*(*U8)(unsafe.Pointer(libc.PostIncUintptr(&aRec, 1))))
- if (eType == SQLITE_TEXT) || (eType == SQLITE_BLOB) {
+ if eType == SQLITE_TEXT || eType == SQLITE_BLOB {
// var nByte int32 at bp, 4
aRec += uintptr(sessionVarintGet(tls, aRec, bp /* &nByte */))
aRec += uintptr(*(*int32)(unsafe.Pointer(bp /* nByte */)))
- } else if (eType == SQLITE_INTEGER) || (eType == SQLITE_FLOAT) {
+ } else if eType == SQLITE_INTEGER || eType == SQLITE_FLOAT {
aRec += uintptr(8)
}
}
@@ -168157,12 +170482,12 @@ func sessionSkipRecord(tls *libc.TLS, ppRec uintptr, nCol int32) { /* sqlite3.c:
// first argument to a copy of the string or blob held in the aData[]
// buffer. SQLITE_OK is returned if successful, or SQLITE_NOMEM if an OOM
// error occurs.
-func sessionValueSetStr(tls *libc.TLS, pVal uintptr, aData uintptr, nData int32, enc U8) int32 { /* sqlite3.c:209578:12: */
+func sessionValueSetStr(tls *libc.TLS, pVal uintptr, aData uintptr, nData int32, enc U8) int32 { /* sqlite3.c:211378:12: */
// In theory this code could just pass SQLITE_TRANSIENT as the final
// argument to sqlite3ValueSetStr() and have the copy created
// automatically. But doing so makes it difficult to detect any OOM
// error. Hence the code to create the copy externally.
- var aCopy uintptr = Xsqlite3_malloc64(tls, (uint64(Sqlite3_int64(nData) + int64(1))))
+ var aCopy uintptr = Xsqlite3_malloc64(tls, uint64(Sqlite3_int64(nData)+int64(1)))
if aCopy == uintptr(0) {
return SQLITE_NOMEM
}
@@ -168193,7 +170518,7 @@ func sessionValueSetStr(tls *libc.TLS, pVal uintptr, aData uintptr, nData int32,
//
// If an error occurs, an SQLite error code (e.g. SQLITE_NOMEM) is returned.
// The apOut[] array may have been partially populated in this case.
-func sessionReadRecord(tls *libc.TLS, pIn uintptr, nCol int32, abPK uintptr, apOut uintptr, pbEmpty uintptr) int32 { /* sqlite3.c:209619:12: */
+func sessionReadRecord(tls *libc.TLS, pIn uintptr, nCol int32, abPK uintptr, apOut uintptr, pbEmpty uintptr) int32 { /* sqlite3.c:211419:12: */
bp := tls.Alloc(24)
defer tls.Free(24)
@@ -168203,15 +170528,15 @@ func sessionReadRecord(tls *libc.TLS, pIn uintptr, nCol int32, abPK uintptr, apO
if pbEmpty != 0 {
*(*int32)(unsafe.Pointer(pbEmpty)) = 1
}
- for i = 0; (i < nCol) && (rc == SQLITE_OK); i++ {
+ for i = 0; i < nCol && rc == SQLITE_OK; i++ {
var eType int32 = 0 // Type of value (SQLITE_NULL, TEXT etc.)
- if (abPK != 0) && (int32(*(*U8)(unsafe.Pointer(abPK + uintptr(i)))) == 0) {
+ if abPK != 0 && int32(*(*U8)(unsafe.Pointer(abPK + uintptr(i)))) == 0 {
continue
}
rc = sessionInputBuffer(tls, pIn, 9)
if rc == SQLITE_OK {
if (*SessionInput)(unsafe.Pointer(pIn)).FiNext >= (*SessionInput)(unsafe.Pointer(pIn)).FnData {
- rc = Xsqlite3CorruptError(tls, 209637)
+ rc = Xsqlite3CorruptError(tls, 211437)
} else {
eType = int32(*(*U8)(unsafe.Pointer((*SessionInput)(unsafe.Pointer(pIn)).FaData + uintptr(libc.PostIncInt32(&(*SessionInput)(unsafe.Pointer(pIn)).FiNext, 1)))))
@@ -168228,15 +170553,15 @@ func sessionReadRecord(tls *libc.TLS, pIn uintptr, nCol int32, abPK uintptr, apO
}
if rc == SQLITE_OK {
- var aVal uintptr = ((*SessionInput)(unsafe.Pointer(pIn)).FaData + uintptr((*SessionInput)(unsafe.Pointer(pIn)).FiNext))
- if (eType == SQLITE_TEXT) || (eType == SQLITE_BLOB) {
+ var aVal uintptr = (*SessionInput)(unsafe.Pointer(pIn)).FaData + uintptr((*SessionInput)(unsafe.Pointer(pIn)).FiNext)
+ if eType == SQLITE_TEXT || eType == SQLITE_BLOB {
// var nByte int32 at bp, 4
- *(*int32)(unsafe.Pointer(pIn + 8 /* &.iNext */)) += (sessionVarintGet(tls, aVal, bp /* &nByte */))
+ *(*int32)(unsafe.Pointer(pIn + 8)) += sessionVarintGet(tls, aVal, bp)
rc = sessionInputBuffer(tls, pIn, *(*int32)(unsafe.Pointer(bp /* nByte */)))
if rc == SQLITE_OK {
- if (*(*int32)(unsafe.Pointer(bp /* nByte */)) < 0) || (*(*int32)(unsafe.Pointer(bp /* nByte */)) > ((*SessionInput)(unsafe.Pointer(pIn)).FnData - (*SessionInput)(unsafe.Pointer(pIn)).FiNext)) {
- rc = Xsqlite3CorruptError(tls, 209657)
+ if *(*int32)(unsafe.Pointer(bp)) < 0 || *(*int32)(unsafe.Pointer(bp)) > (*SessionInput)(unsafe.Pointer(pIn)).FnData-(*SessionInput)(unsafe.Pointer(pIn)).FiNext {
+ rc = Xsqlite3CorruptError(tls, 211457)
} else {
var enc U8 = func() uint8 {
if eType == SQLITE_TEXT {
@@ -168244,12 +170569,12 @@ func sessionReadRecord(tls *libc.TLS, pIn uintptr, nCol int32, abPK uintptr, apO
}
return uint8(0)
}()
- rc = sessionValueSetStr(tls, *(*uintptr)(unsafe.Pointer(apOut + uintptr(i)*4)), ((*SessionInput)(unsafe.Pointer(pIn)).FaData + uintptr((*SessionInput)(unsafe.Pointer(pIn)).FiNext)), *(*int32)(unsafe.Pointer(bp /* nByte */)), enc)
- *(*int32)(unsafe.Pointer(pIn + 8 /* &.iNext */)) += (*(*int32)(unsafe.Pointer(bp /* nByte */)))
+ rc = sessionValueSetStr(tls, *(*uintptr)(unsafe.Pointer(apOut + uintptr(i)*4)), (*SessionInput)(unsafe.Pointer(pIn)).FaData+uintptr((*SessionInput)(unsafe.Pointer(pIn)).FiNext), *(*int32)(unsafe.Pointer(bp /* nByte */)), enc)
+ *(*int32)(unsafe.Pointer(pIn + 8)) += *(*int32)(unsafe.Pointer(bp))
}
}
}
- if (eType == SQLITE_INTEGER) || (eType == SQLITE_FLOAT) {
+ if eType == SQLITE_INTEGER || eType == SQLITE_FLOAT {
*(*Sqlite3_int64)(unsafe.Pointer(bp + 16 /* v */)) = sessionGetI64(tls, aVal)
if eType == SQLITE_INTEGER {
Xsqlite3VdbeMemSetInt64(tls, *(*uintptr)(unsafe.Pointer(apOut + uintptr(i)*4)), *(*Sqlite3_int64)(unsafe.Pointer(bp + 16 /* v */)))
@@ -168259,7 +170584,7 @@ func sessionReadRecord(tls *libc.TLS, pIn uintptr, nCol int32, abPK uintptr, apO
libc.Xmemcpy(tls, bp+8 /* &d */, bp+16 /* &v */, uint32(8))
Xsqlite3VdbeMemSetDouble(tls, *(*uintptr)(unsafe.Pointer(apOut + uintptr(i)*4)), *(*float64)(unsafe.Pointer(bp + 8 /* d */)))
}
- *(*int32)(unsafe.Pointer(pIn + 8 /* &.iNext */)) += (8)
+ *(*int32)(unsafe.Pointer(pIn + 8)) += 8
}
}
}
@@ -168278,7 +170603,7 @@ func sessionReadRecord(tls *libc.TLS, pIn uintptr, nCol int32, abPK uintptr, apO
// buffer (i.e. that it can be accessed without any calls to xInput()).
// If successful, SQLITE_OK is returned. Otherwise, an SQLite error code.
// The input pointer is not moved.
-func sessionChangesetBufferTblhdr(tls *libc.TLS, pIn uintptr, pnByte uintptr) int32 { /* sqlite3.c:209695:12: */
+func sessionChangesetBufferTblhdr(tls *libc.TLS, pIn uintptr, pnByte uintptr) int32 { /* sqlite3.c:211495:12: */
bp := tls.Alloc(4)
defer tls.Free(4)
@@ -168288,7 +170613,7 @@ func sessionChangesetBufferTblhdr(tls *libc.TLS, pIn uintptr, pnByte uintptr) in
rc = sessionInputBuffer(tls, pIn, 9)
if rc == SQLITE_OK {
- nRead = nRead + (sessionVarintGet(tls, ((*SessionInput)(unsafe.Pointer(pIn)).FaData + uintptr(((*SessionInput)(unsafe.Pointer(pIn)).FiNext + nRead))), bp /* &nCol */))
+ nRead = nRead + sessionVarintGet(tls, (*SessionInput)(unsafe.Pointer(pIn)).FaData+uintptr((*SessionInput)(unsafe.Pointer(pIn)).FiNext+nRead), bp)
// The hard upper limit for the number of columns in an SQLite
// database table is, according to sqliteLimit.h, 32676. So
// consider any table-header that purports to have more than 65536
@@ -168296,24 +170621,24 @@ func sessionChangesetBufferTblhdr(tls *libc.TLS, pIn uintptr, pnByte uintptr) in
// if the (nCol>65536) condition below were omitted, a sufficiently
// large value for nCol may cause nRead to wrap around and become
// negative. Leading to a crash.
- if (*(*int32)(unsafe.Pointer(bp /* nCol */)) < 0) || (*(*int32)(unsafe.Pointer(bp /* nCol */)) > 65536) {
- rc = Xsqlite3CorruptError(tls, 209711)
+ if *(*int32)(unsafe.Pointer(bp)) < 0 || *(*int32)(unsafe.Pointer(bp)) > 65536 {
+ rc = Xsqlite3CorruptError(tls, 211511)
} else {
- rc = sessionInputBuffer(tls, pIn, ((nRead + *(*int32)(unsafe.Pointer(bp /* nCol */))) + 100))
- nRead = nRead + (*(*int32)(unsafe.Pointer(bp /* nCol */)))
+ rc = sessionInputBuffer(tls, pIn, nRead+*(*int32)(unsafe.Pointer(bp))+100)
+ nRead = nRead + *(*int32)(unsafe.Pointer(bp))
}
}
for rc == SQLITE_OK {
- for (((*SessionInput)(unsafe.Pointer(pIn)).FiNext + nRead) < (*SessionInput)(unsafe.Pointer(pIn)).FnData) && (*(*U8)(unsafe.Pointer((*SessionInput)(unsafe.Pointer(pIn)).FaData + uintptr(((*SessionInput)(unsafe.Pointer(pIn)).FiNext + nRead)))) != 0) {
+ for (*SessionInput)(unsafe.Pointer(pIn)).FiNext+nRead < (*SessionInput)(unsafe.Pointer(pIn)).FnData && *(*U8)(unsafe.Pointer((*SessionInput)(unsafe.Pointer(pIn)).FaData + uintptr((*SessionInput)(unsafe.Pointer(pIn)).FiNext+nRead))) != 0 {
nRead++
}
- if ((*SessionInput)(unsafe.Pointer(pIn)).FiNext + nRead) < (*SessionInput)(unsafe.Pointer(pIn)).FnData {
+ if (*SessionInput)(unsafe.Pointer(pIn)).FiNext+nRead < (*SessionInput)(unsafe.Pointer(pIn)).FnData {
break
}
- rc = sessionInputBuffer(tls, pIn, (nRead + 100))
+ rc = sessionInputBuffer(tls, pIn, nRead+100)
}
- *(*int32)(unsafe.Pointer(pnByte)) = (nRead + 1)
+ *(*int32)(unsafe.Pointer(pnByte)) = nRead + 1
return rc
}
@@ -168324,26 +170649,26 @@ func sessionChangesetBufferTblhdr(tls *libc.TLS, pIn uintptr, pnByte uintptr) in
// If successful, SQLITE_OK is returned and *pnByte is set to the size of
// the record in bytes. Otherwise, an SQLite error code is returned. The
// final value of *pnByte is undefined in this case.
-func sessionChangesetBufferRecord(tls *libc.TLS, pIn uintptr, nCol int32, pnByte uintptr) int32 { /* sqlite3.c:209738:12: */
+func sessionChangesetBufferRecord(tls *libc.TLS, pIn uintptr, nCol int32, pnByte uintptr) int32 { /* sqlite3.c:211538:12: */
bp := tls.Alloc(4)
defer tls.Free(4)
var rc int32 = SQLITE_OK
var nByte int32 = 0
var i int32
- for i = 0; (rc == SQLITE_OK) && (i < nCol); i++ {
+ for i = 0; rc == SQLITE_OK && i < nCol; i++ {
var eType int32
- rc = sessionInputBuffer(tls, pIn, (nByte + 10))
+ rc = sessionInputBuffer(tls, pIn, nByte+10)
if rc == SQLITE_OK {
- eType = int32(*(*U8)(unsafe.Pointer((*SessionInput)(unsafe.Pointer(pIn)).FaData + uintptr(((*SessionInput)(unsafe.Pointer(pIn)).FiNext + libc.PostIncInt32(&nByte, 1))))))
- if (eType == SQLITE_TEXT) || (eType == SQLITE_BLOB) {
+ eType = int32(*(*U8)(unsafe.Pointer((*SessionInput)(unsafe.Pointer(pIn)).FaData + uintptr((*SessionInput)(unsafe.Pointer(pIn)).FiNext+libc.PostIncInt32(&nByte, 1)))))
+ if eType == SQLITE_TEXT || eType == SQLITE_BLOB {
// var n int32 at bp, 4
- nByte = nByte + (sessionVarintGet(tls, ((*SessionInput)(unsafe.Pointer(pIn)).FaData + uintptr(((*SessionInput)(unsafe.Pointer(pIn)).FiNext + nByte))), bp /* &n */))
- nByte = nByte + (*(*int32)(unsafe.Pointer(bp /* n */)))
+ nByte = nByte + sessionVarintGet(tls, (*SessionInput)(unsafe.Pointer(pIn)).FaData+uintptr((*SessionInput)(unsafe.Pointer(pIn)).FiNext+nByte), bp)
+ nByte = nByte + *(*int32)(unsafe.Pointer(bp))
rc = sessionInputBuffer(tls, pIn, nByte)
- } else if (eType == SQLITE_INTEGER) || (eType == SQLITE_FLOAT) {
- nByte = nByte + (8)
+ } else if eType == SQLITE_INTEGER || eType == SQLITE_FLOAT {
+ nByte = nByte + 8
}
}
}
@@ -168366,7 +170691,7 @@ func sessionChangesetBufferRecord(tls *libc.TLS, pIn uintptr, nCol int32, pnByte
// If successful, SQLITE_OK is returned. Otherwise, an SQLite error code
// is returned and the final values of the various fields enumerated above
// are undefined.
-func sessionChangesetReadTblhdr(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:209782:12: */
+func sessionChangesetReadTblhdr(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:211582:12: */
bp := tls.Alloc(8)
defer tls.Free(8)
@@ -168374,27 +170699,27 @@ func sessionChangesetReadTblhdr(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:2
// var nCopy int32 at bp, 4
- *(*int32)(unsafe.Pointer(bp + 4 /* rc */)) = sessionChangesetBufferTblhdr(tls, (p /* &.in */), bp /* &nCopy */)
- if *(*int32)(unsafe.Pointer(bp + 4 /* rc */)) == SQLITE_OK {
+ *(*int32)(unsafe.Pointer(bp + 4 /* rc */)) = sessionChangesetBufferTblhdr(tls, p, bp /* &nCopy */)
+ if *(*int32)(unsafe.Pointer(bp + 4)) == SQLITE_OK {
var nByte int32
var nVarint int32
- nVarint = sessionVarintGet(tls, ((*Sqlite3_changeset_iter)(unsafe.Pointer(p)).Fin.FaData + uintptr((*Sqlite3_changeset_iter)(unsafe.Pointer(p)).Fin.FiNext)), (p + 80 /* &.nCol */))
+ nVarint = sessionVarintGet(tls, (*Sqlite3_changeset_iter)(unsafe.Pointer(p)).Fin.FaData+uintptr((*Sqlite3_changeset_iter)(unsafe.Pointer(p)).Fin.FiNext), p+80)
if (*Sqlite3_changeset_iter)(unsafe.Pointer(p)).FnCol > 0 {
*(*int32)(unsafe.Pointer(bp /* nCopy */)) -= nVarint
- *(*int32)(unsafe.Pointer(p /* &.in */ + 8 /* &.iNext */)) += (nVarint)
- nByte = (int32(((uint32((*Sqlite3_changeset_iter)(unsafe.Pointer(p)).FnCol) * uint32(unsafe.Sizeof(uintptr(0)))) * uint32(2)) + uint32(*(*int32)(unsafe.Pointer(bp /* nCopy */)))))
+ *(*int32)(unsafe.Pointer(p + 8)) += nVarint
+ nByte = int32(uint32((*Sqlite3_changeset_iter)(unsafe.Pointer(p)).FnCol)*uint32(unsafe.Sizeof(uintptr(0)))*uint32(2) + uint32(*(*int32)(unsafe.Pointer(bp))))
(*Sqlite3_changeset_iter)(unsafe.Pointer(p)).Ftblhdr.FnBuf = 0
- sessionBufferGrow(tls, (p + 44 /* &.tblhdr */), int64(nByte), bp+4 /* &rc */)
+ sessionBufferGrow(tls, p+44, int64(nByte), bp+4 /* &rc */)
} else {
- *(*int32)(unsafe.Pointer(bp + 4 /* rc */)) = Xsqlite3CorruptError(tls, 209799)
+ *(*int32)(unsafe.Pointer(bp + 4 /* rc */)) = Xsqlite3CorruptError(tls, 211599)
}
}
- if *(*int32)(unsafe.Pointer(bp + 4 /* rc */)) == SQLITE_OK {
- var iPK Size_t = ((uint32(unsafe.Sizeof(uintptr(0))) * uint32((*Sqlite3_changeset_iter)(unsafe.Pointer(p)).FnCol)) * uint32(2))
+ if *(*int32)(unsafe.Pointer(bp + 4)) == SQLITE_OK {
+ var iPK Size_t = uint32(unsafe.Sizeof(uintptr(0))) * uint32((*Sqlite3_changeset_iter)(unsafe.Pointer(p)).FnCol) * uint32(2)
libc.Xmemset(tls, (*Sqlite3_changeset_iter)(unsafe.Pointer(p)).Ftblhdr.FaBuf, 0, iPK)
- libc.Xmemcpy(tls, ((*Sqlite3_changeset_iter)(unsafe.Pointer(p)).Ftblhdr.FaBuf + uintptr(iPK)), ((*Sqlite3_changeset_iter)(unsafe.Pointer(p)).Fin.FaData + uintptr((*Sqlite3_changeset_iter)(unsafe.Pointer(p)).Fin.FiNext)), uint32(*(*int32)(unsafe.Pointer(bp /* nCopy */))))
- *(*int32)(unsafe.Pointer(p /* &.in */ + 8 /* &.iNext */)) += (*(*int32)(unsafe.Pointer(bp /* nCopy */)))
+ libc.Xmemcpy(tls, (*Sqlite3_changeset_iter)(unsafe.Pointer(p)).Ftblhdr.FaBuf+uintptr(iPK), (*Sqlite3_changeset_iter)(unsafe.Pointer(p)).Fin.FaData+uintptr((*Sqlite3_changeset_iter)(unsafe.Pointer(p)).Fin.FiNext), uint32(*(*int32)(unsafe.Pointer(bp /* nCopy */))))
+ *(*int32)(unsafe.Pointer(p + 8)) += *(*int32)(unsafe.Pointer(bp))
}
(*Sqlite3_changeset_iter)(unsafe.Pointer(p)).FapValue = (*Sqlite3_changeset_iter)(unsafe.Pointer(p)).Ftblhdr.FaBuf
@@ -168402,15 +170727,15 @@ func sessionChangesetReadTblhdr(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:2
(*Sqlite3_changeset_iter)(unsafe.Pointer(p)).FabPK = uintptr(0)
(*Sqlite3_changeset_iter)(unsafe.Pointer(p)).FzTab = uintptr(0)
} else {
- (*Sqlite3_changeset_iter)(unsafe.Pointer(p)).FabPK = ((*Sqlite3_changeset_iter)(unsafe.Pointer(p)).FapValue + uintptr(((*Sqlite3_changeset_iter)(unsafe.Pointer(p)).FnCol*2))*4)
+ (*Sqlite3_changeset_iter)(unsafe.Pointer(p)).FabPK = (*Sqlite3_changeset_iter)(unsafe.Pointer(p)).FapValue + uintptr((*Sqlite3_changeset_iter)(unsafe.Pointer(p)).FnCol*2)*4
(*Sqlite3_changeset_iter)(unsafe.Pointer(p)).FzTab = func() uintptr {
if (*Sqlite3_changeset_iter)(unsafe.Pointer(p)).FabPK != 0 {
- return ((*Sqlite3_changeset_iter)(unsafe.Pointer(p)).FabPK + uintptr((*Sqlite3_changeset_iter)(unsafe.Pointer(p)).FnCol))
+ return (*Sqlite3_changeset_iter)(unsafe.Pointer(p)).FabPK + uintptr((*Sqlite3_changeset_iter)(unsafe.Pointer(p)).FnCol)
}
return uintptr(0)
}()
}
- return libc.AssignPtrInt32(p+68 /* &.rc */, *(*int32)(unsafe.Pointer(bp + 4 /* rc */)))
+ return libc.AssignPtrInt32(p+68, *(*int32)(unsafe.Pointer(bp + 4)))
}
// Advance the changeset iterator to the next change. The differences between
@@ -168421,7 +170746,7 @@ func sessionChangesetReadTblhdr(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:2
//
// * If the iterator is configured to skip no-op UPDATEs,
// sessionChangesetNext() does that. This function does not.
-func sessionChangesetNextOne(tls *libc.TLS, p uintptr, paRec uintptr, pnRec uintptr, pbNew uintptr, pbEmpty uintptr) int32 { /* sqlite3.c:209831:12: */
+func sessionChangesetNextOne(tls *libc.TLS, p uintptr, paRec uintptr, pnRec uintptr, pbNew uintptr, pbEmpty uintptr) int32 { /* sqlite3.c:211631:12: */
var i int32
var op U8
@@ -168432,17 +170757,17 @@ func sessionChangesetNextOne(tls *libc.TLS, p uintptr, paRec uintptr, pnRec uint
// Free the current contents of p->apValue[], if any.
if (*Sqlite3_changeset_iter)(unsafe.Pointer(p)).FapValue != 0 {
- for i = 0; i < ((*Sqlite3_changeset_iter)(unsafe.Pointer(p)).FnCol * 2); i++ {
+ for i = 0; i < (*Sqlite3_changeset_iter)(unsafe.Pointer(p)).FnCol*2; i++ {
Xsqlite3ValueFree(tls, *(*uintptr)(unsafe.Pointer((*Sqlite3_changeset_iter)(unsafe.Pointer(p)).FapValue + uintptr(i)*4)))
}
- libc.Xmemset(tls, (*Sqlite3_changeset_iter)(unsafe.Pointer(p)).FapValue, 0, ((uint32(unsafe.Sizeof(uintptr(0))) * uint32((*Sqlite3_changeset_iter)(unsafe.Pointer(p)).FnCol)) * uint32(2)))
+ libc.Xmemset(tls, (*Sqlite3_changeset_iter)(unsafe.Pointer(p)).FapValue, 0, uint32(unsafe.Sizeof(uintptr(0)))*uint32((*Sqlite3_changeset_iter)(unsafe.Pointer(p)).FnCol)*uint32(2))
}
// Make sure the buffer contains at least 10 bytes of input data, or all
// remaining data if there are less than 10 bytes available. This is
// sufficient either for the 'T' or 'P' byte and the varint that follows
// it, or for the two single byte values otherwise.
- (*Sqlite3_changeset_iter)(unsafe.Pointer(p)).Frc = sessionInputBuffer(tls, (p /* &.in */), 2)
+ (*Sqlite3_changeset_iter)(unsafe.Pointer(p)).Frc = sessionInputBuffer(tls, p, 2)
if (*Sqlite3_changeset_iter)(unsafe.Pointer(p)).Frc != SQLITE_OK {
return (*Sqlite3_changeset_iter)(unsafe.Pointer(p)).Frc
}
@@ -168452,19 +170777,19 @@ func sessionChangesetNextOne(tls *libc.TLS, p uintptr, paRec uintptr, pnRec uint
return SQLITE_DONE
}
- sessionDiscardData(tls, (p /* &.in */))
+ sessionDiscardData(tls, p)
(*Sqlite3_changeset_iter)(unsafe.Pointer(p)).Fin.FiCurrent = (*Sqlite3_changeset_iter)(unsafe.Pointer(p)).Fin.FiNext
op = *(*U8)(unsafe.Pointer((*Sqlite3_changeset_iter)(unsafe.Pointer(p)).Fin.FaData + uintptr(libc.PostIncInt32(&(*Sqlite3_changeset_iter)(unsafe.Pointer(p)).Fin.FiNext, 1))))
- for (int32(op) == 'T') || (int32(op) == 'P') {
+ for int32(op) == 'T' || int32(op) == 'P' {
if pbNew != 0 {
*(*int32)(unsafe.Pointer(pbNew)) = 1
}
- (*Sqlite3_changeset_iter)(unsafe.Pointer(p)).FbPatchset = (libc.Bool32(int32(op) == 'P'))
+ (*Sqlite3_changeset_iter)(unsafe.Pointer(p)).FbPatchset = libc.Bool32(int32(op) == 'P')
if sessionChangesetReadTblhdr(tls, p) != 0 {
return (*Sqlite3_changeset_iter)(unsafe.Pointer(p)).Frc
}
- if libc.AssignPtrInt32(p+68 /* &.rc */, sessionInputBuffer(tls, (p /* &.in */), 2)) != 0 {
+ if libc.AssignPtrInt32(p+68, sessionInputBuffer(tls, p, 2)) != 0 {
return (*Sqlite3_changeset_iter)(unsafe.Pointer(p)).Frc
}
(*Sqlite3_changeset_iter)(unsafe.Pointer(p)).Fin.FiCurrent = (*Sqlite3_changeset_iter)(unsafe.Pointer(p)).Fin.FiNext
@@ -168474,24 +170799,24 @@ func sessionChangesetNextOne(tls *libc.TLS, p uintptr, paRec uintptr, pnRec uint
op = *(*U8)(unsafe.Pointer((*Sqlite3_changeset_iter)(unsafe.Pointer(p)).Fin.FaData + uintptr(libc.PostIncInt32(&(*Sqlite3_changeset_iter)(unsafe.Pointer(p)).Fin.FiNext, 1))))
}
- if ((*Sqlite3_changeset_iter)(unsafe.Pointer(p)).FzTab == uintptr(0)) || (((*Sqlite3_changeset_iter)(unsafe.Pointer(p)).FbPatchset != 0) && ((*Sqlite3_changeset_iter)(unsafe.Pointer(p)).FbInvert != 0)) {
+ if (*Sqlite3_changeset_iter)(unsafe.Pointer(p)).FzTab == uintptr(0) || (*Sqlite3_changeset_iter)(unsafe.Pointer(p)).FbPatchset != 0 && (*Sqlite3_changeset_iter)(unsafe.Pointer(p)).FbInvert != 0 {
// The first record in the changeset is not a table header. Must be a
// corrupt changeset.
- return libc.AssignPtrInt32(p+68 /* &.rc */, Xsqlite3CorruptError(tls, 209885))
+ return libc.AssignPtrInt32(p+68, Xsqlite3CorruptError(tls, 211685))
}
(*Sqlite3_changeset_iter)(unsafe.Pointer(p)).Fop = int32(op)
(*Sqlite3_changeset_iter)(unsafe.Pointer(p)).FbIndirect = int32(*(*U8)(unsafe.Pointer((*Sqlite3_changeset_iter)(unsafe.Pointer(p)).Fin.FaData + uintptr(libc.PostIncInt32(&(*Sqlite3_changeset_iter)(unsafe.Pointer(p)).Fin.FiNext, 1)))))
- if (((*Sqlite3_changeset_iter)(unsafe.Pointer(p)).Fop != SQLITE_UPDATE) && ((*Sqlite3_changeset_iter)(unsafe.Pointer(p)).Fop != SQLITE_DELETE)) && ((*Sqlite3_changeset_iter)(unsafe.Pointer(p)).Fop != SQLITE_INSERT) {
- return libc.AssignPtrInt32(p+68 /* &.rc */, Xsqlite3CorruptError(tls, 209891))
+ if (*Sqlite3_changeset_iter)(unsafe.Pointer(p)).Fop != SQLITE_UPDATE && (*Sqlite3_changeset_iter)(unsafe.Pointer(p)).Fop != SQLITE_DELETE && (*Sqlite3_changeset_iter)(unsafe.Pointer(p)).Fop != SQLITE_INSERT {
+ return libc.AssignPtrInt32(p+68, Xsqlite3CorruptError(tls, 211691))
}
if paRec != 0 {
var nVal int32 // Number of values to buffer
- if ((*Sqlite3_changeset_iter)(unsafe.Pointer(p)).FbPatchset == 0) && (int32(op) == SQLITE_UPDATE) {
- nVal = ((*Sqlite3_changeset_iter)(unsafe.Pointer(p)).FnCol * 2)
- } else if ((*Sqlite3_changeset_iter)(unsafe.Pointer(p)).FbPatchset != 0) && (int32(op) == SQLITE_DELETE) {
+ if (*Sqlite3_changeset_iter)(unsafe.Pointer(p)).FbPatchset == 0 && int32(op) == SQLITE_UPDATE {
+ nVal = (*Sqlite3_changeset_iter)(unsafe.Pointer(p)).FnCol * 2
+ } else if (*Sqlite3_changeset_iter)(unsafe.Pointer(p)).FbPatchset != 0 && int32(op) == SQLITE_DELETE {
nVal = 0
for i = 0; i < (*Sqlite3_changeset_iter)(unsafe.Pointer(p)).FnCol; i++ {
if *(*U8)(unsafe.Pointer((*Sqlite3_changeset_iter)(unsafe.Pointer(p)).FabPK + uintptr(i))) != 0 {
@@ -168501,16 +170826,16 @@ func sessionChangesetNextOne(tls *libc.TLS, p uintptr, paRec uintptr, pnRec uint
} else {
nVal = (*Sqlite3_changeset_iter)(unsafe.Pointer(p)).FnCol
}
- (*Sqlite3_changeset_iter)(unsafe.Pointer(p)).Frc = sessionChangesetBufferRecord(tls, (p /* &.in */), nVal, pnRec)
+ (*Sqlite3_changeset_iter)(unsafe.Pointer(p)).Frc = sessionChangesetBufferRecord(tls, p, nVal, pnRec)
if (*Sqlite3_changeset_iter)(unsafe.Pointer(p)).Frc != SQLITE_OK {
return (*Sqlite3_changeset_iter)(unsafe.Pointer(p)).Frc
}
- *(*uintptr)(unsafe.Pointer(paRec)) = ((*Sqlite3_changeset_iter)(unsafe.Pointer(p)).Fin.FaData + uintptr((*Sqlite3_changeset_iter)(unsafe.Pointer(p)).Fin.FiNext))
- *(*int32)(unsafe.Pointer(p /* &.in */ + 8 /* &.iNext */)) += (*(*int32)(unsafe.Pointer(pnRec)))
+ *(*uintptr)(unsafe.Pointer(paRec)) = (*Sqlite3_changeset_iter)(unsafe.Pointer(p)).Fin.FaData + uintptr((*Sqlite3_changeset_iter)(unsafe.Pointer(p)).Fin.FiNext)
+ *(*int32)(unsafe.Pointer(p + 8)) += *(*int32)(unsafe.Pointer(pnRec))
} else {
var apOld uintptr = func() uintptr {
if (*Sqlite3_changeset_iter)(unsafe.Pointer(p)).FbInvert != 0 {
- return ((*Sqlite3_changeset_iter)(unsafe.Pointer(p)).FapValue + uintptr((*Sqlite3_changeset_iter)(unsafe.Pointer(p)).FnCol)*4)
+ return (*Sqlite3_changeset_iter)(unsafe.Pointer(p)).FapValue + uintptr((*Sqlite3_changeset_iter)(unsafe.Pointer(p)).FnCol)*4
}
return (*Sqlite3_changeset_iter)(unsafe.Pointer(p)).FapValue
}()
@@ -168518,18 +170843,18 @@ func sessionChangesetNextOne(tls *libc.TLS, p uintptr, paRec uintptr, pnRec uint
if (*Sqlite3_changeset_iter)(unsafe.Pointer(p)).FbInvert != 0 {
return (*Sqlite3_changeset_iter)(unsafe.Pointer(p)).FapValue
}
- return ((*Sqlite3_changeset_iter)(unsafe.Pointer(p)).FapValue + uintptr((*Sqlite3_changeset_iter)(unsafe.Pointer(p)).FnCol)*4)
+ return (*Sqlite3_changeset_iter)(unsafe.Pointer(p)).FapValue + uintptr((*Sqlite3_changeset_iter)(unsafe.Pointer(p)).FnCol)*4
}()
// If this is an UPDATE or DELETE, read the old.* record.
- if ((*Sqlite3_changeset_iter)(unsafe.Pointer(p)).Fop != SQLITE_INSERT) && (((*Sqlite3_changeset_iter)(unsafe.Pointer(p)).FbPatchset == 0) || ((*Sqlite3_changeset_iter)(unsafe.Pointer(p)).Fop == SQLITE_DELETE)) {
+ if (*Sqlite3_changeset_iter)(unsafe.Pointer(p)).Fop != SQLITE_INSERT && ((*Sqlite3_changeset_iter)(unsafe.Pointer(p)).FbPatchset == 0 || (*Sqlite3_changeset_iter)(unsafe.Pointer(p)).Fop == SQLITE_DELETE) {
var abPK uintptr
if (*Sqlite3_changeset_iter)(unsafe.Pointer(p)).FbPatchset != 0 {
abPK = (*Sqlite3_changeset_iter)(unsafe.Pointer(p)).FabPK
} else {
abPK = uintptr(0)
}
- (*Sqlite3_changeset_iter)(unsafe.Pointer(p)).Frc = sessionReadRecord(tls, (p /* &.in */), (*Sqlite3_changeset_iter)(unsafe.Pointer(p)).FnCol, abPK, apOld, uintptr(0))
+ (*Sqlite3_changeset_iter)(unsafe.Pointer(p)).Frc = sessionReadRecord(tls, p, (*Sqlite3_changeset_iter)(unsafe.Pointer(p)).FnCol, abPK, apOld, uintptr(0))
if (*Sqlite3_changeset_iter)(unsafe.Pointer(p)).Frc != SQLITE_OK {
return (*Sqlite3_changeset_iter)(unsafe.Pointer(p)).Frc
}
@@ -168537,13 +170862,13 @@ func sessionChangesetNextOne(tls *libc.TLS, p uintptr, paRec uintptr, pnRec uint
// If this is an INSERT or UPDATE, read the new.* record.
if (*Sqlite3_changeset_iter)(unsafe.Pointer(p)).Fop != SQLITE_DELETE {
- (*Sqlite3_changeset_iter)(unsafe.Pointer(p)).Frc = sessionReadRecord(tls, (p /* &.in */), (*Sqlite3_changeset_iter)(unsafe.Pointer(p)).FnCol, uintptr(0), apNew, pbEmpty)
+ (*Sqlite3_changeset_iter)(unsafe.Pointer(p)).Frc = sessionReadRecord(tls, p, (*Sqlite3_changeset_iter)(unsafe.Pointer(p)).FnCol, uintptr(0), apNew, pbEmpty)
if (*Sqlite3_changeset_iter)(unsafe.Pointer(p)).Frc != SQLITE_OK {
return (*Sqlite3_changeset_iter)(unsafe.Pointer(p)).Frc
}
}
- if (((*Sqlite3_changeset_iter)(unsafe.Pointer(p)).FbPatchset != 0) || ((*Sqlite3_changeset_iter)(unsafe.Pointer(p)).FbInvert != 0)) && ((*Sqlite3_changeset_iter)(unsafe.Pointer(p)).Fop == SQLITE_UPDATE) {
+ if ((*Sqlite3_changeset_iter)(unsafe.Pointer(p)).FbPatchset != 0 || (*Sqlite3_changeset_iter)(unsafe.Pointer(p)).FbInvert != 0) && (*Sqlite3_changeset_iter)(unsafe.Pointer(p)).Fop == SQLITE_UPDATE {
// If this is an UPDATE that is part of a patchset, then all PK and
// modified fields are present in the new.* record. The old.* record
// is currently completely empty. This block shifts the PK fields from
@@ -168552,11 +170877,11 @@ func sessionChangesetNextOne(tls *libc.TLS, p uintptr, paRec uintptr, pnRec uint
if *(*U8)(unsafe.Pointer((*Sqlite3_changeset_iter)(unsafe.Pointer(p)).FabPK + uintptr(i))) != 0 {
- *(*uintptr)(unsafe.Pointer((*Sqlite3_changeset_iter)(unsafe.Pointer(p)).FapValue + uintptr(i)*4)) = *(*uintptr)(unsafe.Pointer((*Sqlite3_changeset_iter)(unsafe.Pointer(p)).FapValue + uintptr((i+(*Sqlite3_changeset_iter)(unsafe.Pointer(p)).FnCol))*4))
+ *(*uintptr)(unsafe.Pointer((*Sqlite3_changeset_iter)(unsafe.Pointer(p)).FapValue + uintptr(i)*4)) = *(*uintptr)(unsafe.Pointer((*Sqlite3_changeset_iter)(unsafe.Pointer(p)).FapValue + uintptr(i+(*Sqlite3_changeset_iter)(unsafe.Pointer(p)).FnCol)*4))
if *(*uintptr)(unsafe.Pointer((*Sqlite3_changeset_iter)(unsafe.Pointer(p)).FapValue + uintptr(i)*4)) == uintptr(0) {
- return libc.AssignPtrInt32(p+68 /* &.rc */, Xsqlite3CorruptError(tls, 209935))
+ return libc.AssignPtrInt32(p+68, Xsqlite3CorruptError(tls, 211735))
}
- *(*uintptr)(unsafe.Pointer((*Sqlite3_changeset_iter)(unsafe.Pointer(p)).FapValue + uintptr((i+(*Sqlite3_changeset_iter)(unsafe.Pointer(p)).FnCol))*4)) = uintptr(0)
+ *(*uintptr)(unsafe.Pointer((*Sqlite3_changeset_iter)(unsafe.Pointer(p)).FapValue + uintptr(i+(*Sqlite3_changeset_iter)(unsafe.Pointer(p)).FnCol)*4)) = uintptr(0)
}
}
} else if (*Sqlite3_changeset_iter)(unsafe.Pointer(p)).FbInvert != 0 {
@@ -168585,14 +170910,14 @@ func sessionChangesetNextOne(tls *libc.TLS, p uintptr, paRec uintptr, pnRec uint
// successfully advanced to the next change in the changeset, an SQLite
// error code if an error occurs, or SQLITE_DONE if there are no further
// changes in the changeset.
-func sessionChangesetNext(tls *libc.TLS, p uintptr, paRec uintptr, pnRec uintptr, pbNew uintptr) int32 { /* sqlite3.c:209964:12: */
+func sessionChangesetNext(tls *libc.TLS, p uintptr, paRec uintptr, pnRec uintptr, pbNew uintptr) int32 { /* sqlite3.c:211764:12: */
bp := tls.Alloc(4)
defer tls.Free(4)
// var bEmpty int32 at bp, 4
var rc int32
- for ok := true; ok; ok = (((rc == SQLITE_ROW) && ((*Sqlite3_changeset_iter)(unsafe.Pointer(p)).FbSkipEmpty != 0)) && (*(*int32)(unsafe.Pointer(bp /* bEmpty */)) != 0)) {
+ for ok := true; ok; ok = rc == SQLITE_ROW && (*Sqlite3_changeset_iter)(unsafe.Pointer(p)).FbSkipEmpty != 0 && *(*int32)(unsafe.Pointer(bp)) != 0 {
*(*int32)(unsafe.Pointer(bp /* bEmpty */)) = 0
rc = sessionChangesetNextOne(tls, p, paRec, pnRec, pbNew, bp /* &bEmpty */)
}
@@ -168605,14 +170930,14 @@ func sessionChangesetNext(tls *libc.TLS, p uintptr, paRec uintptr, pnRec uintptr
//
// This function may not be called on iterators passed to a conflict handler
// callback by changeset_apply().
-func Xsqlite3changeset_next(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:209987:16: */
+func Xsqlite3changeset_next(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:211787:16: */
return sessionChangesetNext(tls, p, uintptr(0), uintptr(0), uintptr(0))
}
// The following function extracts information on the current change
// from a changeset iterator. It may only be called after changeset_next()
// has returned SQLITE_ROW.
-func Xsqlite3changeset_op(tls *libc.TLS, pIter uintptr, pzTab uintptr, pnCol uintptr, pOp uintptr, pbIndirect uintptr) int32 { /* sqlite3.c:209996:16: */
+func Xsqlite3changeset_op(tls *libc.TLS, pIter uintptr, pzTab uintptr, pnCol uintptr, pOp uintptr, pbIndirect uintptr) int32 { /* sqlite3.c:211796:16: */
*(*int32)(unsafe.Pointer(pOp)) = (*Sqlite3_changeset_iter)(unsafe.Pointer(pIter)).Fop
*(*int32)(unsafe.Pointer(pnCol)) = (*Sqlite3_changeset_iter)(unsafe.Pointer(pIter)).FnCol
*(*uintptr)(unsafe.Pointer(pzTab)) = (*Sqlite3_changeset_iter)(unsafe.Pointer(pIter)).FzTab
@@ -168626,7 +170951,7 @@ func Xsqlite3changeset_op(tls *libc.TLS, pIter uintptr, pzTab uintptr, pnCol uin
// the database table affected by the change that pIter currently points
// to. This function may only be called after changeset_next() returns
// SQLITE_ROW.
-func Xsqlite3changeset_pk(tls *libc.TLS, pIter uintptr, pabPK uintptr, pnCol uintptr) int32 { /* sqlite3.c:210016:16: */
+func Xsqlite3changeset_pk(tls *libc.TLS, pIter uintptr, pabPK uintptr, pnCol uintptr) int32 { /* sqlite3.c:211816:16: */
*(*uintptr)(unsafe.Pointer(pabPK)) = (*Sqlite3_changeset_iter)(unsafe.Pointer(pIter)).FabPK
if pnCol != 0 {
*(*int32)(unsafe.Pointer(pnCol)) = (*Sqlite3_changeset_iter)(unsafe.Pointer(pIter)).FnCol
@@ -168645,11 +170970,11 @@ func Xsqlite3changeset_pk(tls *libc.TLS, pIter uintptr, pabPK uintptr, pnCol uin
//
// If value iVal is out-of-range, SQLITE_RANGE is returned and *ppValue is
// not modified. Otherwise, SQLITE_OK.
-func Xsqlite3changeset_old(tls *libc.TLS, pIter uintptr, iVal int32, ppValue uintptr) int32 { /* sqlite3.c:210039:16: */
- if ((*Sqlite3_changeset_iter)(unsafe.Pointer(pIter)).Fop != SQLITE_UPDATE) && ((*Sqlite3_changeset_iter)(unsafe.Pointer(pIter)).Fop != SQLITE_DELETE) {
+func Xsqlite3changeset_old(tls *libc.TLS, pIter uintptr, iVal int32, ppValue uintptr) int32 { /* sqlite3.c:211839:16: */
+ if (*Sqlite3_changeset_iter)(unsafe.Pointer(pIter)).Fop != SQLITE_UPDATE && (*Sqlite3_changeset_iter)(unsafe.Pointer(pIter)).Fop != SQLITE_DELETE {
return SQLITE_MISUSE
}
- if (iVal < 0) || (iVal >= (*Sqlite3_changeset_iter)(unsafe.Pointer(pIter)).FnCol) {
+ if iVal < 0 || iVal >= (*Sqlite3_changeset_iter)(unsafe.Pointer(pIter)).FnCol {
return SQLITE_RANGE
}
*(*uintptr)(unsafe.Pointer(ppValue)) = *(*uintptr)(unsafe.Pointer((*Sqlite3_changeset_iter)(unsafe.Pointer(pIter)).FapValue + uintptr(iVal)*4))
@@ -168667,14 +170992,14 @@ func Xsqlite3changeset_old(tls *libc.TLS, pIter uintptr, iVal int32, ppValue uin
//
// If value iVal is out-of-range, SQLITE_RANGE is returned and *ppValue is
// not modified. Otherwise, SQLITE_OK.
-func Xsqlite3changeset_new(tls *libc.TLS, pIter uintptr, iVal int32, ppValue uintptr) int32 { /* sqlite3.c:210067:16: */
- if ((*Sqlite3_changeset_iter)(unsafe.Pointer(pIter)).Fop != SQLITE_UPDATE) && ((*Sqlite3_changeset_iter)(unsafe.Pointer(pIter)).Fop != SQLITE_INSERT) {
+func Xsqlite3changeset_new(tls *libc.TLS, pIter uintptr, iVal int32, ppValue uintptr) int32 { /* sqlite3.c:211867:16: */
+ if (*Sqlite3_changeset_iter)(unsafe.Pointer(pIter)).Fop != SQLITE_UPDATE && (*Sqlite3_changeset_iter)(unsafe.Pointer(pIter)).Fop != SQLITE_INSERT {
return SQLITE_MISUSE
}
- if (iVal < 0) || (iVal >= (*Sqlite3_changeset_iter)(unsafe.Pointer(pIter)).FnCol) {
+ if iVal < 0 || iVal >= (*Sqlite3_changeset_iter)(unsafe.Pointer(pIter)).FnCol {
return SQLITE_RANGE
}
- *(*uintptr)(unsafe.Pointer(ppValue)) = *(*uintptr)(unsafe.Pointer((*Sqlite3_changeset_iter)(unsafe.Pointer(pIter)).FapValue + uintptr(((*Sqlite3_changeset_iter)(unsafe.Pointer(pIter)).FnCol+iVal))*4))
+ *(*uintptr)(unsafe.Pointer(ppValue)) = *(*uintptr)(unsafe.Pointer((*Sqlite3_changeset_iter)(unsafe.Pointer(pIter)).FapValue + uintptr((*Sqlite3_changeset_iter)(unsafe.Pointer(pIter)).FnCol+iVal)*4))
return SQLITE_OK
}
@@ -168691,11 +171016,11 @@ func Xsqlite3changeset_new(tls *libc.TLS, pIter uintptr, iVal int32, ppValue uin
//
// If value iVal is out-of-range or some other error occurs, an SQLite error
// code is returned. Otherwise, SQLITE_OK.
-func Xsqlite3changeset_conflict(tls *libc.TLS, pIter uintptr, iVal int32, ppValue uintptr) int32 { /* sqlite3.c:210101:16: */
+func Xsqlite3changeset_conflict(tls *libc.TLS, pIter uintptr, iVal int32, ppValue uintptr) int32 { /* sqlite3.c:211901:16: */
if !(int32((*Sqlite3_changeset_iter)(unsafe.Pointer(pIter)).FpConflict) != 0) {
return SQLITE_MISUSE
}
- if (iVal < 0) || (iVal >= (*Sqlite3_changeset_iter)(unsafe.Pointer(pIter)).FnCol) {
+ if iVal < 0 || iVal >= (*Sqlite3_changeset_iter)(unsafe.Pointer(pIter)).FnCol {
return SQLITE_RANGE
}
*(*uintptr)(unsafe.Pointer(ppValue)) = Xsqlite3_column_value(tls, (*Sqlite3_changeset_iter)(unsafe.Pointer(pIter)).FpConflict, iVal)
@@ -168708,8 +171033,8 @@ func Xsqlite3changeset_conflict(tls *libc.TLS, pIter uintptr, iVal int32, ppValu
// violations in the destination database and returns SQLITE_OK.
//
// In all other cases this function returns SQLITE_MISUSE.
-func Xsqlite3changeset_fk_conflicts(tls *libc.TLS, pIter uintptr, pnOut uintptr) int32 { /* sqlite3.c:210124:16: */
- if ((*Sqlite3_changeset_iter)(unsafe.Pointer(pIter)).FpConflict != 0) || ((*Sqlite3_changeset_iter)(unsafe.Pointer(pIter)).FapValue != 0) {
+func Xsqlite3changeset_fk_conflicts(tls *libc.TLS, pIter uintptr, pnOut uintptr) int32 { /* sqlite3.c:211924:16: */
+ if (*Sqlite3_changeset_iter)(unsafe.Pointer(pIter)).FpConflict != 0 || (*Sqlite3_changeset_iter)(unsafe.Pointer(pIter)).FapValue != 0 {
return SQLITE_MISUSE
}
*(*int32)(unsafe.Pointer(pnOut)) = (*Sqlite3_changeset_iter)(unsafe.Pointer(pIter)).FnCol
@@ -168720,13 +171045,13 @@ func Xsqlite3changeset_fk_conflicts(tls *libc.TLS, pIter uintptr, pnOut uintptr)
//
// This function may not be called on iterators passed to a conflict handler
// callback by changeset_apply().
-func Xsqlite3changeset_finalize(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:210142:16: */
+func Xsqlite3changeset_finalize(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:211942:16: */
var rc int32 = SQLITE_OK
if p != 0 {
var i int32 // Used to iterate through p->apValue[]
rc = (*Sqlite3_changeset_iter)(unsafe.Pointer(p)).Frc
if (*Sqlite3_changeset_iter)(unsafe.Pointer(p)).FapValue != 0 {
- for i = 0; i < ((*Sqlite3_changeset_iter)(unsafe.Pointer(p)).FnCol * 2); i++ {
+ for i = 0; i < (*Sqlite3_changeset_iter)(unsafe.Pointer(p)).FnCol*2; i++ {
Xsqlite3ValueFree(tls, *(*uintptr)(unsafe.Pointer((*Sqlite3_changeset_iter)(unsafe.Pointer(p)).FapValue + uintptr(i)*4)))
}
}
@@ -168737,7 +171062,7 @@ func Xsqlite3changeset_finalize(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:2
return rc
}
-func sessionChangesetInvert(tls *libc.TLS, pInput uintptr, xOutput uintptr, pOut uintptr, pnInverted uintptr, ppInverted uintptr) int32 { /* sqlite3.c:210157:12: */
+func sessionChangesetInvert(tls *libc.TLS, pInput uintptr, xOutput uintptr, pOut uintptr, pnInverted uintptr, ppInverted uintptr) int32 { /* sqlite3.c:211957:12: */
bp := tls.Alloc(40)
defer tls.Free(40)
@@ -168792,7 +171117,7 @@ __2:
}
// Test for EOF.
- if !(libc.AssignPtrInt32(bp+32 /* rc */, sessionInputBuffer(tls, pInput, 2)) != 0) {
+ if !(libc.AssignPtrInt32(bp+32, sessionInputBuffer(tls, pInput, 2)) != 0) {
goto __4
}
goto finished_invert
@@ -168824,25 +171149,25 @@ __5:
goto __6
__7:
(*SessionInput)(unsafe.Pointer(pInput)).FiNext++
- if !(libc.AssignPtrInt32(bp+32 /* rc */, sessionChangesetBufferTblhdr(tls, pInput, bp+12 /* &nByte */)) != 0) {
+ if !(libc.AssignPtrInt32(bp+32, sessionChangesetBufferTblhdr(tls, pInput, bp+12)) != 0) {
goto __12
}
goto finished_invert
__12:
;
- nVar = sessionVarintGet(tls, ((*SessionInput)(unsafe.Pointer(pInput)).FaData + uintptr((*SessionInput)(unsafe.Pointer(pInput)).FiNext)), bp+16 /* &nCol */)
+ nVar = sessionVarintGet(tls, (*SessionInput)(unsafe.Pointer(pInput)).FaData+uintptr((*SessionInput)(unsafe.Pointer(pInput)).FiNext), bp+16 /* &nCol */)
(*SessionBuffer)(unsafe.Pointer(bp + 20 /* &sPK */)).FnBuf = 0
- sessionAppendBlob(tls, bp+20 /* &sPK */, ((*SessionInput)(unsafe.Pointer(pInput)).FaData + uintptr(((*SessionInput)(unsafe.Pointer(pInput)).FiNext + nVar))), *(*int32)(unsafe.Pointer(bp + 16 /* nCol */)), bp+32 /* &rc */)
+ sessionAppendBlob(tls, bp+20 /* &sPK */, (*SessionInput)(unsafe.Pointer(pInput)).FaData+uintptr((*SessionInput)(unsafe.Pointer(pInput)).FiNext+nVar), *(*int32)(unsafe.Pointer(bp + 16 /* nCol */)), bp+32 /* &rc */)
sessionAppendByte(tls, bp /* &sOut */, eType, bp+32 /* &rc */)
- sessionAppendBlob(tls, bp /* &sOut */, ((*SessionInput)(unsafe.Pointer(pInput)).FaData + uintptr((*SessionInput)(unsafe.Pointer(pInput)).FiNext)), *(*int32)(unsafe.Pointer(bp + 12 /* nByte */)), bp+32 /* &rc */)
- if !(*(*int32)(unsafe.Pointer(bp + 32 /* rc */)) != 0) {
+ sessionAppendBlob(tls, bp /* &sOut */, (*SessionInput)(unsafe.Pointer(pInput)).FaData+uintptr((*SessionInput)(unsafe.Pointer(pInput)).FiNext), *(*int32)(unsafe.Pointer(bp + 12 /* nByte */)), bp+32 /* &rc */)
+ if !(*(*int32)(unsafe.Pointer(bp + 32)) != 0) {
goto __13
}
goto finished_invert
__13:
;
- *(*int32)(unsafe.Pointer(pInput + 8 /* &.iNext */)) += (*(*int32)(unsafe.Pointer(bp + 12 /* nByte */)))
+ *(*int32)(unsafe.Pointer(pInput + 8)) += *(*int32)(unsafe.Pointer(bp + 12))
Xsqlite3_free(tls, apVal)
apVal = uintptr(0)
abPK = (*SessionBuffer)(unsafe.Pointer(bp + 20 /* &sPK */)).FaBuf
@@ -168850,21 +171175,21 @@ __13:
__8:
__9:
- bIndirect = int32(*(*U8)(unsafe.Pointer((*SessionInput)(unsafe.Pointer(pInput)).FaData + uintptr(((*SessionInput)(unsafe.Pointer(pInput)).FiNext + 1)))))
+ bIndirect = int32(*(*U8)(unsafe.Pointer((*SessionInput)(unsafe.Pointer(pInput)).FaData + uintptr((*SessionInput)(unsafe.Pointer(pInput)).FiNext+1))))
eType2 = func() int32 {
if int32(eType) == SQLITE_DELETE {
return SQLITE_INSERT
}
return SQLITE_DELETE
}()
- *(*int32)(unsafe.Pointer(pInput + 8 /* &.iNext */)) += (2)
+ *(*int32)(unsafe.Pointer(pInput + 8)) += 2
*(*int32)(unsafe.Pointer(bp + 32 /* rc */)) = sessionChangesetBufferRecord(tls, pInput, *(*int32)(unsafe.Pointer(bp + 16 /* nCol */)), bp+36 /* &nByte1 */)
sessionAppendByte(tls, bp /* &sOut */, uint8(eType2), bp+32 /* &rc */)
sessionAppendByte(tls, bp /* &sOut */, uint8(bIndirect), bp+32 /* &rc */)
- sessionAppendBlob(tls, bp /* &sOut */, ((*SessionInput)(unsafe.Pointer(pInput)).FaData + uintptr((*SessionInput)(unsafe.Pointer(pInput)).FiNext)), *(*int32)(unsafe.Pointer(bp + 36 /* nByte1 */)), bp+32 /* &rc */)
- *(*int32)(unsafe.Pointer(pInput + 8 /* &.iNext */)) += (*(*int32)(unsafe.Pointer(bp + 36 /* nByte1 */)))
- if !(*(*int32)(unsafe.Pointer(bp + 32 /* rc */)) != 0) {
+ sessionAppendBlob(tls, bp /* &sOut */, (*SessionInput)(unsafe.Pointer(pInput)).FaData+uintptr((*SessionInput)(unsafe.Pointer(pInput)).FiNext), *(*int32)(unsafe.Pointer(bp + 36 /* nByte1 */)), bp+32 /* &rc */)
+ *(*int32)(unsafe.Pointer(pInput + 8)) += *(*int32)(unsafe.Pointer(bp + 36))
+ if !(*(*int32)(unsafe.Pointer(bp + 32)) != 0) {
goto __14
}
goto finished_invert
@@ -168877,7 +171202,7 @@ __10:
if !(uintptr(0) == apVal) {
goto __15
}
- apVal = Xsqlite3_malloc64(tls, (uint64((uint32(unsafe.Sizeof(uintptr(0))) * uint32(*(*int32)(unsafe.Pointer(bp + 16 /* nCol */)))) * uint32(2))))
+ apVal = Xsqlite3_malloc64(tls, uint64(uint32(unsafe.Sizeof(uintptr(0)))*uint32(*(*int32)(unsafe.Pointer(bp + 16)))*uint32(2)))
if !(uintptr(0) == apVal) {
goto __16
}
@@ -168885,21 +171210,21 @@ __10:
goto finished_invert
__16:
;
- libc.Xmemset(tls, apVal, 0, ((uint32(unsafe.Sizeof(uintptr(0))) * uint32(*(*int32)(unsafe.Pointer(bp + 16 /* nCol */)))) * uint32(2)))
+ libc.Xmemset(tls, apVal, 0, uint32(unsafe.Sizeof(uintptr(0)))*uint32(*(*int32)(unsafe.Pointer(bp + 16)))*uint32(2))
__15:
;
// Write the header for the new UPDATE change. Same as the original.
sessionAppendByte(tls, bp /* &sOut */, eType, bp+32 /* &rc */)
- sessionAppendByte(tls, bp /* &sOut */, *(*U8)(unsafe.Pointer((*SessionInput)(unsafe.Pointer(pInput)).FaData + uintptr(((*SessionInput)(unsafe.Pointer(pInput)).FiNext + 1)))), bp+32 /* &rc */)
+ sessionAppendByte(tls, bp /* &sOut */, *(*U8)(unsafe.Pointer((*SessionInput)(unsafe.Pointer(pInput)).FaData + uintptr((*SessionInput)(unsafe.Pointer(pInput)).FiNext+1))), bp+32 /* &rc */)
// Read the old.* and new.* records for the update change.
- *(*int32)(unsafe.Pointer(pInput + 8 /* &.iNext */)) += (2)
- *(*int32)(unsafe.Pointer(bp + 32 /* rc */)) = sessionReadRecord(tls, pInput, *(*int32)(unsafe.Pointer(bp + 16 /* nCol */)), uintptr(0), (apVal), uintptr(0))
- if !(*(*int32)(unsafe.Pointer(bp + 32 /* rc */)) == SQLITE_OK) {
+ *(*int32)(unsafe.Pointer(pInput + 8)) += 2
+ *(*int32)(unsafe.Pointer(bp + 32 /* rc */)) = sessionReadRecord(tls, pInput, *(*int32)(unsafe.Pointer(bp + 16 /* nCol */)), uintptr(0), apVal, uintptr(0))
+ if !(*(*int32)(unsafe.Pointer(bp + 32)) == SQLITE_OK) {
goto __17
}
- *(*int32)(unsafe.Pointer(bp + 32 /* rc */)) = sessionReadRecord(tls, pInput, *(*int32)(unsafe.Pointer(bp + 16 /* nCol */)), uintptr(0), (apVal + uintptr(*(*int32)(unsafe.Pointer(bp + 16 /* nCol */)))*4), uintptr(0))
+ *(*int32)(unsafe.Pointer(bp + 32 /* rc */)) = sessionReadRecord(tls, pInput, *(*int32)(unsafe.Pointer(bp + 16 /* nCol */)), uintptr(0), apVal+uintptr(*(*int32)(unsafe.Pointer(bp + 16)))*4, uintptr(0))
__17:
;
@@ -168908,15 +171233,15 @@ __17:
// new.* record.
iCol = 0
__18:
- if !(iCol < *(*int32)(unsafe.Pointer(bp + 16 /* nCol */))) {
+ if !(iCol < *(*int32)(unsafe.Pointer(bp + 16))) {
goto __20
}
- pVal = *(*uintptr)(unsafe.Pointer(apVal + uintptr((iCol+(func() int32 {
+ pVal = *(*uintptr)(unsafe.Pointer(apVal + uintptr(iCol+func() int32 {
if *(*U8)(unsafe.Pointer(abPK + uintptr(iCol))) != 0 {
return 0
}
- return *(*int32)(unsafe.Pointer(bp + 16 /* nCol */))
- }())))*4))
+ return *(*int32)(unsafe.Pointer(bp + 16))
+ }())*4))
sessionAppendValue(tls, bp /* &sOut */, pVal, bp+32 /* &rc */)
goto __19
__19:
@@ -168931,7 +171256,7 @@ __20:
// are set to "undefined".
iCol = 0
__21:
- if !(iCol < *(*int32)(unsafe.Pointer(bp + 16 /* nCol */))) {
+ if !(iCol < *(*int32)(unsafe.Pointer(bp + 16))) {
goto __23
}
pVal1 = func() uintptr {
@@ -168951,7 +171276,7 @@ __23:
iCol = 0
__24:
- if !(iCol < (*(*int32)(unsafe.Pointer(bp + 16 /* nCol */)) * 2)) {
+ if !(iCol < *(*int32)(unsafe.Pointer(bp + 16))*2) {
goto __26
}
Xsqlite3ValueFree(tls, *(*uintptr)(unsafe.Pointer(apVal + uintptr(iCol)*4)))
@@ -168962,8 +171287,8 @@ __25:
goto __26
__26:
;
- libc.Xmemset(tls, apVal, 0, ((uint32(unsafe.Sizeof(uintptr(0))) * uint32(*(*int32)(unsafe.Pointer(bp + 16 /* nCol */)))) * uint32(2)))
- if !(*(*int32)(unsafe.Pointer(bp + 32 /* rc */)) != SQLITE_OK) {
+ libc.Xmemset(tls, apVal, 0, uint32(unsafe.Sizeof(uintptr(0)))*uint32(*(*int32)(unsafe.Pointer(bp + 16)))*uint32(2))
+ if !(*(*int32)(unsafe.Pointer(bp + 32)) != SQLITE_OK) {
goto __27
}
goto finished_invert
@@ -168973,19 +171298,19 @@ __27:
goto __6
__11:
- *(*int32)(unsafe.Pointer(bp + 32 /* rc */)) = Xsqlite3CorruptError(tls, 210284)
+ *(*int32)(unsafe.Pointer(bp + 32 /* rc */)) = Xsqlite3CorruptError(tls, 212084)
goto finished_invert
__6:
;
- if !((xOutput != 0) && ((*SessionBuffer)(unsafe.Pointer(bp /* &sOut */)).FnBuf >= sessions_strm_chunk_size)) {
+ if !(xOutput != 0 && (*SessionBuffer)(unsafe.Pointer(bp)).FnBuf >= sessions_strm_chunk_size) {
goto __28
}
*(*int32)(unsafe.Pointer(bp + 32 /* rc */)) = (*struct {
f func(*libc.TLS, uintptr, uintptr, int32) int32
})(unsafe.Pointer(&struct{ uintptr }{xOutput})).f(tls, pOut, (*SessionBuffer)(unsafe.Pointer(bp /* &sOut */)).FaBuf, (*SessionBuffer)(unsafe.Pointer(bp /* &sOut */)).FnBuf)
(*SessionBuffer)(unsafe.Pointer(bp /* &sOut */)).FnBuf = 0
- if !(*(*int32)(unsafe.Pointer(bp + 32 /* rc */)) != SQLITE_OK) {
+ if !(*(*int32)(unsafe.Pointer(bp + 32)) != SQLITE_OK) {
goto __29
}
goto finished_invert
@@ -168997,7 +171322,7 @@ __28:
__3:
;
- if !(pnInverted != 0) {
+ if !(pnInverted != 0 && ppInverted != 0) {
goto __30
}
*(*int32)(unsafe.Pointer(pnInverted)) = (*SessionBuffer)(unsafe.Pointer(bp /* &sOut */)).FnBuf
@@ -169005,7 +171330,7 @@ __3:
(*SessionBuffer)(unsafe.Pointer(bp /* &sOut */)).FaBuf = uintptr(0)
goto __31
__30:
- if !((*SessionBuffer)(unsafe.Pointer(bp /* &sOut */)).FnBuf > 0) {
+ if !((*SessionBuffer)(unsafe.Pointer(bp)).FnBuf > 0 && xOutput != uintptr(0)) {
goto __32
}
*(*int32)(unsafe.Pointer(bp + 32 /* rc */)) = (*struct {
@@ -169024,7 +171349,7 @@ finished_invert:
}
// Invert a changeset object.
-func Xsqlite3changeset_invert(tls *libc.TLS, nChangeset int32, pChangeset uintptr, pnInverted uintptr, ppInverted uintptr) int32 { /* sqlite3.c:210316:16: */
+func Xsqlite3changeset_invert(tls *libc.TLS, nChangeset int32, pChangeset uintptr, pnInverted uintptr, ppInverted uintptr) int32 { /* sqlite3.c:212116:16: */
bp := tls.Alloc(44)
defer tls.Free(44)
@@ -169039,7 +171364,7 @@ func Xsqlite3changeset_invert(tls *libc.TLS, nChangeset int32, pChangeset uintpt
}
// Streaming version of sqlite3changeset_invert().
-func Xsqlite3changeset_invert_strm(tls *libc.TLS, xInput uintptr, pIn uintptr, xOutput uintptr, pOut uintptr) int32 { /* sqlite3.c:210335:16: */
+func Xsqlite3changeset_invert_strm(tls *libc.TLS, xInput uintptr, pIn uintptr, xOutput uintptr, pOut uintptr) int32 { /* sqlite3.c:212135:16: */
bp := tls.Alloc(44)
defer tls.Free(44)
@@ -169061,9 +171386,9 @@ type SessionUpdate1 = struct {
FpStmt uintptr
FaMask uintptr
FpNext uintptr
-} /* sqlite3.c:210355:9 */
+} /* sqlite3.c:212155:9 */
-type SessionUpdate = SessionUpdate1 /* sqlite3.c:210355:30 */
+type SessionUpdate = SessionUpdate1 /* sqlite3.c:212155:30 */
type SessionApplyCtx1 = struct {
Fdb uintptr
@@ -169083,9 +171408,9 @@ type SessionApplyCtx1 = struct {
FbRebaseStarted U8
FbRebase U8
F__ccgo_pad1 [2]byte
-} /* sqlite3.c:210362:9 */
+} /* sqlite3.c:212162:9 */
-type SessionApplyCtx = SessionApplyCtx1 /* sqlite3.c:210362:32 */
+type SessionApplyCtx = SessionApplyCtx1 /* sqlite3.c:212162:32 */
// Number of prepared UPDATE statements to cache.
@@ -169093,45 +171418,45 @@ type SessionApplyCtx = SessionApplyCtx1 /* sqlite3.c:210362:32 */
// being visited by the iterator. The UPDATE is of the form:
//
// UPDATE tbl SET col = ?, col2 = ? WHERE pk1 IS ? AND pk2 IS ?
-func sessionUpdateFind(tls *libc.TLS, pIter uintptr, p uintptr, bPatchset int32, ppStmt uintptr) int32 { /* sqlite3.c:210391:12: */
+func sessionUpdateFind(tls *libc.TLS, pIter uintptr, p uintptr, bPatchset int32, ppStmt uintptr) int32 { /* sqlite3.c:212191:12: */
bp := tls.Alloc(16)
defer tls.Free(16)
*(*int32)(unsafe.Pointer(bp + 12 /* rc */)) = SQLITE_OK
var pUp uintptr = uintptr(0)
var nCol int32 = (*Sqlite3_changeset_iter)(unsafe.Pointer(pIter)).FnCol
- var nU32 int32 = (((*Sqlite3_changeset_iter)(unsafe.Pointer(pIter)).FnCol + 33) / 32)
+ var nU32 int32 = ((*Sqlite3_changeset_iter)(unsafe.Pointer(pIter)).FnCol + 33) / 32
var ii int32
if (*SessionApplyCtx)(unsafe.Pointer(p)).FaUpdateMask == uintptr(0) {
- (*SessionApplyCtx)(unsafe.Pointer(p)).FaUpdateMask = Xsqlite3_malloc(tls, (int32(uint32(nU32) * uint32(unsafe.Sizeof(U32(0))))))
+ (*SessionApplyCtx)(unsafe.Pointer(p)).FaUpdateMask = Xsqlite3_malloc(tls, int32(uint32(nU32)*uint32(unsafe.Sizeof(U32(0)))))
if (*SessionApplyCtx)(unsafe.Pointer(p)).FaUpdateMask == uintptr(0) {
*(*int32)(unsafe.Pointer(bp + 12 /* rc */)) = SQLITE_NOMEM
}
}
- if *(*int32)(unsafe.Pointer(bp + 12 /* rc */)) == SQLITE_OK {
- libc.Xmemset(tls, (*SessionApplyCtx)(unsafe.Pointer(p)).FaUpdateMask, 0, (uint32(nU32) * uint32(unsafe.Sizeof(U32(0)))))
+ if *(*int32)(unsafe.Pointer(bp + 12)) == SQLITE_OK {
+ libc.Xmemset(tls, (*SessionApplyCtx)(unsafe.Pointer(p)).FaUpdateMask, 0, uint32(nU32)*uint32(unsafe.Sizeof(U32(0))))
*(*int32)(unsafe.Pointer(bp + 12 /* rc */)) = SQLITE_CORRUPT
for ii = 0; ii < (*Sqlite3_changeset_iter)(unsafe.Pointer(pIter)).FnCol; ii++ {
- if *(*uintptr)(unsafe.Pointer((*Sqlite3_changeset_iter)(unsafe.Pointer((pIter))).FapValue + uintptr(((*Sqlite3_changeset_iter)(unsafe.Pointer((pIter))).FnCol+(ii)))*4)) != 0 {
- *(*U32)(unsafe.Pointer((*SessionApplyCtx)(unsafe.Pointer(p)).FaUpdateMask + uintptr((ii/32))*4)) |= (U32(int32(1) << (ii % 32)))
+ if *(*uintptr)(unsafe.Pointer((*Sqlite3_changeset_iter)(unsafe.Pointer(pIter)).FapValue + uintptr((*Sqlite3_changeset_iter)(unsafe.Pointer(pIter)).FnCol+ii)*4)) != 0 {
+ *(*U32)(unsafe.Pointer((*SessionApplyCtx)(unsafe.Pointer(p)).FaUpdateMask + uintptr(ii/32)*4)) |= U32(int32(1) << (ii % 32))
*(*int32)(unsafe.Pointer(bp + 12 /* rc */)) = SQLITE_OK
}
}
}
- if *(*int32)(unsafe.Pointer(bp + 12 /* rc */)) == SQLITE_OK {
+ if *(*int32)(unsafe.Pointer(bp + 12)) == SQLITE_OK {
if bPatchset != 0 {
- *(*U32)(unsafe.Pointer((*SessionApplyCtx)(unsafe.Pointer(p)).FaUpdateMask + uintptr((nCol/32))*4)) |= (U32(int32(1) << (nCol % 32)))
+ *(*U32)(unsafe.Pointer((*SessionApplyCtx)(unsafe.Pointer(p)).FaUpdateMask + uintptr(nCol/32)*4)) |= U32(int32(1) << (nCol % 32))
}
if (*SessionApplyCtx)(unsafe.Pointer(p)).FpUp != 0 {
var nUp int32 = 0
- var pp uintptr = (p + 32 /* &.pUp */)
+ var pp uintptr = p + 32
for 1 != 0 {
nUp++
- if 0 == libc.Xmemcmp(tls, (*SessionApplyCtx)(unsafe.Pointer(p)).FaUpdateMask, (*SessionUpdate)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pp)))).FaMask, (uint32(nU32)*uint32(unsafe.Sizeof(U32(0))))) {
+ if 0 == libc.Xmemcmp(tls, (*SessionApplyCtx)(unsafe.Pointer(p)).FaUpdateMask, (*SessionUpdate)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pp)))).FaMask, uint32(nU32)*uint32(unsafe.Sizeof(U32(0)))) {
pUp = *(*uintptr)(unsafe.Pointer(pp))
*(*uintptr)(unsafe.Pointer(pp)) = (*SessionUpdate)(unsafe.Pointer(pUp)).FpNext
(*SessionUpdate)(unsafe.Pointer(pUp)).FpNext = (*SessionApplyCtx)(unsafe.Pointer(p)).FpUp
@@ -169140,7 +171465,7 @@ func sessionUpdateFind(tls *libc.TLS, pIter uintptr, p uintptr, bPatchset int32,
}
if (*SessionUpdate)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pp)))).FpNext != 0 {
- pp = (*(*uintptr)(unsafe.Pointer(pp)) + 8 /* &.pNext */)
+ pp = *(*uintptr)(unsafe.Pointer(pp)) + 8
} else {
if nUp >= SESSION_UPDATE_CACHE_SZ {
Xsqlite3_finalize(tls, (*SessionUpdate)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pp)))).FpStmt)
@@ -169153,60 +171478,60 @@ func sessionUpdateFind(tls *libc.TLS, pIter uintptr, p uintptr, bPatchset int32,
}
if pUp == uintptr(0) {
- var nByte int32 = (int32((uint32(unsafe.Sizeof(SessionUpdate{})) * uint32(nU32)) * uint32(unsafe.Sizeof(U32(0)))))
- var bStat1 int32 = (libc.Bool32(Xsqlite3_stricmp(tls, (*Sqlite3_changeset_iter)(unsafe.Pointer(pIter)).FzTab, ts+10072 /* "sqlite_stat1" */) == 0))
+ var nByte int32 = int32(uint32(unsafe.Sizeof(SessionUpdate{})) * uint32(nU32) * uint32(unsafe.Sizeof(U32(0))))
+ var bStat1 int32 = libc.Bool32(Xsqlite3_stricmp(tls, (*Sqlite3_changeset_iter)(unsafe.Pointer(pIter)).FzTab, ts+11186) == 0)
pUp = Xsqlite3_malloc(tls, nByte)
if pUp == uintptr(0) {
*(*int32)(unsafe.Pointer(bp + 12 /* rc */)) = SQLITE_NOMEM
} else {
- var zSep uintptr = ts + 755 /* "" */
+ var zSep uintptr = ts + 1543 /* "" */
// var buf SessionBuffer at bp, 12
libc.Xmemset(tls, bp /* &buf */, 0, uint32(unsafe.Sizeof(SessionBuffer{})))
- (*SessionUpdate)(unsafe.Pointer(pUp)).FaMask = (pUp + 1*12)
- libc.Xmemcpy(tls, (*SessionUpdate)(unsafe.Pointer(pUp)).FaMask, (*SessionApplyCtx)(unsafe.Pointer(p)).FaUpdateMask, (uint32(nU32) * uint32(unsafe.Sizeof(U32(0)))))
+ (*SessionUpdate)(unsafe.Pointer(pUp)).FaMask = pUp + 1*12
+ libc.Xmemcpy(tls, (*SessionUpdate)(unsafe.Pointer(pUp)).FaMask, (*SessionApplyCtx)(unsafe.Pointer(p)).FaUpdateMask, uint32(nU32)*uint32(unsafe.Sizeof(U32(0))))
- sessionAppendStr(tls, bp /* &buf */, ts+31109 /* "UPDATE main." */, bp+12 /* &rc */)
+ sessionAppendStr(tls, bp /* &buf */, ts+32469 /* "UPDATE main." */, bp+12 /* &rc */)
sessionAppendIdent(tls, bp /* &buf */, (*Sqlite3_changeset_iter)(unsafe.Pointer(pIter)).FzTab, bp+12 /* &rc */)
- sessionAppendStr(tls, bp /* &buf */, ts+31122 /* " SET " */, bp+12 /* &rc */)
+ sessionAppendStr(tls, bp /* &buf */, ts+32482 /* " SET " */, bp+12 /* &rc */)
// Create the assignments part of the UPDATE
for ii = 0; ii < (*Sqlite3_changeset_iter)(unsafe.Pointer(pIter)).FnCol; ii++ {
- if (int32(*(*U8)(unsafe.Pointer((*SessionApplyCtx)(unsafe.Pointer(p)).FabPK + uintptr(ii)))) == 0) && (*(*uintptr)(unsafe.Pointer((*Sqlite3_changeset_iter)(unsafe.Pointer((pIter))).FapValue + uintptr(((*Sqlite3_changeset_iter)(unsafe.Pointer((pIter))).FnCol+(ii)))*4)) != 0) {
+ if int32(*(*U8)(unsafe.Pointer((*SessionApplyCtx)(unsafe.Pointer(p)).FabPK + uintptr(ii)))) == 0 && *(*uintptr)(unsafe.Pointer((*Sqlite3_changeset_iter)(unsafe.Pointer(pIter)).FapValue + uintptr((*Sqlite3_changeset_iter)(unsafe.Pointer(pIter)).FnCol+ii)*4)) != 0 {
sessionAppendStr(tls, bp /* &buf */, zSep, bp+12 /* &rc */)
sessionAppendIdent(tls, bp /* &buf */, *(*uintptr)(unsafe.Pointer((*SessionApplyCtx)(unsafe.Pointer(p)).FazCol + uintptr(ii)*4)), bp+12 /* &rc */)
- sessionAppendStr(tls, bp /* &buf */, ts+31128 /* " = ?" */, bp+12 /* &rc */)
- sessionAppendInteger(tls, bp /* &buf */, ((ii * 2) + 1), bp+12 /* &rc */)
- zSep = ts + 13324 /* ", " */
+ sessionAppendStr(tls, bp /* &buf */, ts+32488 /* " = ?" */, bp+12 /* &rc */)
+ sessionAppendInteger(tls, bp /* &buf */, ii*2+1, bp+12 /* &rc */)
+ zSep = ts + 14507 /* ", " */
}
}
// Create the WHERE clause part of the UPDATE
- zSep = ts + 755 /* "" */
- sessionAppendStr(tls, bp /* &buf */, ts+31057 /* " WHERE " */, bp+12 /* &rc */)
+ zSep = ts + 1543 /* "" */
+ sessionAppendStr(tls, bp /* &buf */, ts+32417 /* " WHERE " */, bp+12 /* &rc */)
for ii = 0; ii < (*Sqlite3_changeset_iter)(unsafe.Pointer(pIter)).FnCol; ii++ {
- if (*(*U8)(unsafe.Pointer((*SessionApplyCtx)(unsafe.Pointer(p)).FabPK + uintptr(ii))) != 0) || ((bPatchset == 0) && (*(*uintptr)(unsafe.Pointer((*Sqlite3_changeset_iter)(unsafe.Pointer((pIter))).FapValue + uintptr(ii)*4)) != 0)) {
+ if *(*U8)(unsafe.Pointer((*SessionApplyCtx)(unsafe.Pointer(p)).FabPK + uintptr(ii))) != 0 || bPatchset == 0 && *(*uintptr)(unsafe.Pointer((*Sqlite3_changeset_iter)(unsafe.Pointer(pIter)).FapValue + uintptr(ii)*4)) != 0 {
sessionAppendStr(tls, bp /* &buf */, zSep, bp+12 /* &rc */)
- if (bStat1 != 0) && (ii == 1) {
+ if bStat1 != 0 && ii == 1 {
sessionAppendStr(tls, bp, /* &buf */
- ts+31133 /* "idx IS CASE WHEN..." */, bp+12 /* &rc */)
+ ts+32493 /* "idx IS CASE WHEN..." */, bp+12 /* &rc */)
} else {
sessionAppendIdent(tls, bp /* &buf */, *(*uintptr)(unsafe.Pointer((*SessionApplyCtx)(unsafe.Pointer(p)).FazCol + uintptr(ii)*4)), bp+12 /* &rc */)
- sessionAppendStr(tls, bp /* &buf */, ts+31065 /* " IS ?" */, bp+12 /* &rc */)
- sessionAppendInteger(tls, bp /* &buf */, ((ii * 2) + 2), bp+12 /* &rc */)
+ sessionAppendStr(tls, bp /* &buf */, ts+32425 /* " IS ?" */, bp+12 /* &rc */)
+ sessionAppendInteger(tls, bp /* &buf */, ii*2+2, bp+12 /* &rc */)
}
- zSep = ts + 19877 /* " AND " */
+ zSep = ts + 21174 /* " AND " */
}
}
- if *(*int32)(unsafe.Pointer(bp + 12 /* rc */)) == SQLITE_OK {
+ if *(*int32)(unsafe.Pointer(bp + 12)) == SQLITE_OK {
var zSql uintptr = (*SessionBuffer)(unsafe.Pointer(bp /* &buf */)).FaBuf
- *(*int32)(unsafe.Pointer(bp + 12 /* rc */)) = Xsqlite3_prepare_v2(tls, (*SessionApplyCtx)(unsafe.Pointer(p)).Fdb, zSql, (*SessionBuffer)(unsafe.Pointer(bp /* &buf */)).FnBuf, (pUp /* &.pStmt */), uintptr(0))
+ *(*int32)(unsafe.Pointer(bp + 12 /* rc */)) = Xsqlite3_prepare_v2(tls, (*SessionApplyCtx)(unsafe.Pointer(p)).Fdb, zSql, (*SessionBuffer)(unsafe.Pointer(bp /* &buf */)).FnBuf, pUp, uintptr(0))
}
- if *(*int32)(unsafe.Pointer(bp + 12 /* rc */)) != SQLITE_OK {
+ if *(*int32)(unsafe.Pointer(bp + 12)) != SQLITE_OK {
Xsqlite3_free(tls, pUp)
pUp = uintptr(0)
} else {
@@ -169227,7 +171552,7 @@ func sessionUpdateFind(tls *libc.TLS, pIter uintptr, p uintptr, bPatchset int32,
}
// Free all cached UPDATE statements.
-func sessionUpdateFree(tls *libc.TLS, p uintptr) { /* sqlite3.c:210530:13: */
+func sessionUpdateFree(tls *libc.TLS, p uintptr) { /* sqlite3.c:212330:13: */
var pUp uintptr
var pNext uintptr
for pUp = (*SessionApplyCtx)(unsafe.Pointer(p)).FpUp; pUp != 0; pUp = pNext {
@@ -169255,51 +171580,51 @@ func sessionUpdateFree(tls *libc.TLS, p uintptr) { /* sqlite3.c:210530:13: */
//
// If successful, SQLITE_OK is returned and SessionApplyCtx.pDelete is left
// pointing to the prepared version of the SQL statement.
-func sessionDeleteRow(tls *libc.TLS, db uintptr, zTab uintptr, p uintptr) int32 { /* sqlite3.c:210560:12: */
+func sessionDeleteRow(tls *libc.TLS, db uintptr, zTab uintptr, p uintptr) int32 { /* sqlite3.c:212360:12: */
bp := tls.Alloc(16)
defer tls.Free(16)
var i int32
- var zSep uintptr = ts + 755 /* "" */
+ var zSep uintptr = ts + 1543 /* "" */
*(*int32)(unsafe.Pointer(bp + 12 /* rc */)) = SQLITE_OK
*(*SessionBuffer)(unsafe.Pointer(bp /* buf */)) = SessionBuffer{}
var nPk int32 = 0
- sessionAppendStr(tls, bp /* &buf */, ts+31208 /* "DELETE FROM main..." */, bp+12 /* &rc */)
+ sessionAppendStr(tls, bp /* &buf */, ts+32568 /* "DELETE FROM main..." */, bp+12 /* &rc */)
sessionAppendIdent(tls, bp /* &buf */, zTab, bp+12 /* &rc */)
- sessionAppendStr(tls, bp /* &buf */, ts+31057 /* " WHERE " */, bp+12 /* &rc */)
+ sessionAppendStr(tls, bp /* &buf */, ts+32417 /* " WHERE " */, bp+12 /* &rc */)
for i = 0; i < (*SessionApplyCtx)(unsafe.Pointer(p)).FnCol; i++ {
if *(*U8)(unsafe.Pointer((*SessionApplyCtx)(unsafe.Pointer(p)).FabPK + uintptr(i))) != 0 {
nPk++
sessionAppendStr(tls, bp /* &buf */, zSep, bp+12 /* &rc */)
sessionAppendIdent(tls, bp /* &buf */, *(*uintptr)(unsafe.Pointer((*SessionApplyCtx)(unsafe.Pointer(p)).FazCol + uintptr(i)*4)), bp+12 /* &rc */)
- sessionAppendStr(tls, bp /* &buf */, ts+31128 /* " = ?" */, bp+12 /* &rc */)
- sessionAppendInteger(tls, bp /* &buf */, (i + 1), bp+12 /* &rc */)
- zSep = ts + 19877 /* " AND " */
+ sessionAppendStr(tls, bp /* &buf */, ts+32488 /* " = ?" */, bp+12 /* &rc */)
+ sessionAppendInteger(tls, bp /* &buf */, i+1, bp+12 /* &rc */)
+ zSep = ts + 21174 /* " AND " */
}
}
if nPk < (*SessionApplyCtx)(unsafe.Pointer(p)).FnCol {
- sessionAppendStr(tls, bp /* &buf */, ts+31226 /* " AND (?" */, bp+12 /* &rc */)
- sessionAppendInteger(tls, bp /* &buf */, ((*SessionApplyCtx)(unsafe.Pointer(p)).FnCol + 1), bp+12 /* &rc */)
- sessionAppendStr(tls, bp /* &buf */, ts+30769 /* " OR " */, bp+12 /* &rc */)
+ sessionAppendStr(tls, bp /* &buf */, ts+32586 /* " AND (?" */, bp+12 /* &rc */)
+ sessionAppendInteger(tls, bp /* &buf */, (*SessionApplyCtx)(unsafe.Pointer(p)).FnCol+1, bp+12 /* &rc */)
+ sessionAppendStr(tls, bp /* &buf */, ts+32129 /* " OR " */, bp+12 /* &rc */)
- zSep = ts + 755 /* "" */
+ zSep = ts + 1543 /* "" */
for i = 0; i < (*SessionApplyCtx)(unsafe.Pointer(p)).FnCol; i++ {
if !(int32(*(*U8)(unsafe.Pointer((*SessionApplyCtx)(unsafe.Pointer(p)).FabPK + uintptr(i)))) != 0) {
sessionAppendStr(tls, bp /* &buf */, zSep, bp+12 /* &rc */)
sessionAppendIdent(tls, bp /* &buf */, *(*uintptr)(unsafe.Pointer((*SessionApplyCtx)(unsafe.Pointer(p)).FazCol + uintptr(i)*4)), bp+12 /* &rc */)
- sessionAppendStr(tls, bp /* &buf */, ts+31065 /* " IS ?" */, bp+12 /* &rc */)
- sessionAppendInteger(tls, bp /* &buf */, (i + 1), bp+12 /* &rc */)
- zSep = ts + 31234 /* "AND " */
+ sessionAppendStr(tls, bp /* &buf */, ts+32425 /* " IS ?" */, bp+12 /* &rc */)
+ sessionAppendInteger(tls, bp /* &buf */, i+1, bp+12 /* &rc */)
+ zSep = ts + 32594 /* "AND " */
}
}
- sessionAppendStr(tls, bp /* &buf */, ts+4066 /* ")" */, bp+12 /* &rc */)
+ sessionAppendStr(tls, bp /* &buf */, ts+4877 /* ")" */, bp+12 /* &rc */)
}
- if *(*int32)(unsafe.Pointer(bp + 12 /* rc */)) == SQLITE_OK {
- *(*int32)(unsafe.Pointer(bp + 12 /* rc */)) = Xsqlite3_prepare_v2(tls, db, (*SessionBuffer)(unsafe.Pointer(bp /* &buf */)).FaBuf, (*SessionBuffer)(unsafe.Pointer(bp /* &buf */)).FnBuf, (p + 4 /* &.pDelete */), uintptr(0))
+ if *(*int32)(unsafe.Pointer(bp + 12)) == SQLITE_OK {
+ *(*int32)(unsafe.Pointer(bp + 12 /* rc */)) = Xsqlite3_prepare_v2(tls, db, (*SessionBuffer)(unsafe.Pointer(bp /* &buf */)).FaBuf, (*SessionBuffer)(unsafe.Pointer(bp /* &buf */)).FnBuf, p+4, uintptr(0))
}
Xsqlite3_free(tls, (*SessionBuffer)(unsafe.Pointer(bp /* &buf */)).FaBuf)
@@ -169317,9 +171642,9 @@ func sessionDeleteRow(tls *libc.TLS, db uintptr, zTab uintptr, p uintptr) int32
//
// If successful, SQLITE_OK is returned and SessionApplyCtx.pSelect is left
// pointing to the prepared version of the SQL statement.
-func sessionSelectRow(tls *libc.TLS, db uintptr, zTab uintptr, p uintptr) int32 { /* sqlite3.c:210625:12: */
+func sessionSelectRow(tls *libc.TLS, db uintptr, zTab uintptr, p uintptr) int32 { /* sqlite3.c:212425:12: */
return sessionSelectStmt(tls,
- db, ts+5458 /* "main" */, zTab, (*SessionApplyCtx)(unsafe.Pointer(p)).FnCol, (*SessionApplyCtx)(unsafe.Pointer(p)).FazCol, (*SessionApplyCtx)(unsafe.Pointer(p)).FabPK, (p + 12 /* &.pSelect */))
+ db, ts+6305 /* "main" */, zTab, (*SessionApplyCtx)(unsafe.Pointer(p)).FnCol, (*SessionApplyCtx)(unsafe.Pointer(p)).FazCol, (*SessionApplyCtx)(unsafe.Pointer(p)).FabPK, p+12)
}
// Formulate and prepare an INSERT statement to add a record to table zTab.
@@ -169329,7 +171654,7 @@ func sessionSelectRow(tls *libc.TLS, db uintptr, zTab uintptr, p uintptr) int32
//
// If successful, SQLITE_OK is returned and SessionApplyCtx.pInsert is left
// pointing to the prepared version of the SQL statement.
-func sessionInsertRow(tls *libc.TLS, db uintptr, zTab uintptr, p uintptr) int32 { /* sqlite3.c:210643:12: */
+func sessionInsertRow(tls *libc.TLS, db uintptr, zTab uintptr, p uintptr) int32 { /* sqlite3.c:212443:12: */
bp := tls.Alloc(16)
defer tls.Free(16)
@@ -169337,30 +171662,30 @@ func sessionInsertRow(tls *libc.TLS, db uintptr, zTab uintptr, p uintptr) int32
var i int32
*(*SessionBuffer)(unsafe.Pointer(bp /* buf */)) = SessionBuffer{}
- sessionAppendStr(tls, bp /* &buf */, ts+31239 /* "INSERT INTO main..." */, bp+12 /* &rc */)
+ sessionAppendStr(tls, bp /* &buf */, ts+32599 /* "INSERT INTO main..." */, bp+12 /* &rc */)
sessionAppendIdent(tls, bp /* &buf */, zTab, bp+12 /* &rc */)
- sessionAppendStr(tls, bp /* &buf */, ts+19883 /* "(" */, bp+12 /* &rc */)
+ sessionAppendStr(tls, bp /* &buf */, ts+21180 /* "(" */, bp+12 /* &rc */)
for i = 0; i < (*SessionApplyCtx)(unsafe.Pointer(p)).FnCol; i++ {
if i != 0 {
- sessionAppendStr(tls, bp /* &buf */, ts+13324 /* ", " */, bp+12 /* &rc */)
+ sessionAppendStr(tls, bp /* &buf */, ts+14507 /* ", " */, bp+12 /* &rc */)
}
sessionAppendIdent(tls, bp /* &buf */, *(*uintptr)(unsafe.Pointer((*SessionApplyCtx)(unsafe.Pointer(p)).FazCol + uintptr(i)*4)), bp+12 /* &rc */)
}
- sessionAppendStr(tls, bp /* &buf */, ts+31257 /* ") VALUES(?" */, bp+12 /* &rc */)
+ sessionAppendStr(tls, bp /* &buf */, ts+32617 /* ") VALUES(?" */, bp+12 /* &rc */)
for i = 1; i < (*SessionApplyCtx)(unsafe.Pointer(p)).FnCol; i++ {
- sessionAppendStr(tls, bp /* &buf */, ts+31268 /* ", ?" */, bp+12 /* &rc */)
+ sessionAppendStr(tls, bp /* &buf */, ts+32628 /* ", ?" */, bp+12 /* &rc */)
}
- sessionAppendStr(tls, bp /* &buf */, ts+4066 /* ")" */, bp+12 /* &rc */)
+ sessionAppendStr(tls, bp /* &buf */, ts+4877 /* ")" */, bp+12 /* &rc */)
- if *(*int32)(unsafe.Pointer(bp + 12 /* rc */)) == SQLITE_OK {
- *(*int32)(unsafe.Pointer(bp + 12 /* rc */)) = Xsqlite3_prepare_v2(tls, db, (*SessionBuffer)(unsafe.Pointer(bp /* &buf */)).FaBuf, (*SessionBuffer)(unsafe.Pointer(bp /* &buf */)).FnBuf, (p + 8 /* &.pInsert */), uintptr(0))
+ if *(*int32)(unsafe.Pointer(bp + 12)) == SQLITE_OK {
+ *(*int32)(unsafe.Pointer(bp + 12 /* rc */)) = Xsqlite3_prepare_v2(tls, db, (*SessionBuffer)(unsafe.Pointer(bp /* &buf */)).FaBuf, (*SessionBuffer)(unsafe.Pointer(bp /* &buf */)).FnBuf, p+8, uintptr(0))
}
Xsqlite3_free(tls, (*SessionBuffer)(unsafe.Pointer(bp /* &buf */)).FaBuf)
return *(*int32)(unsafe.Pointer(bp + 12 /* rc */))
}
-func sessionPrepare(tls *libc.TLS, db uintptr, pp uintptr, zSql uintptr) int32 { /* sqlite3.c:210673:12: */
+func sessionPrepare(tls *libc.TLS, db uintptr, pp uintptr, zSql uintptr) int32 { /* sqlite3.c:212473:12: */
return Xsqlite3_prepare_v2(tls, db, zSql, -1, pp, uintptr(0))
}
@@ -169368,30 +171693,30 @@ func sessionPrepare(tls *libc.TLS, db uintptr, pp uintptr, zSql uintptr) int32 {
// These are similar to those created by sessionSelectRow(),
// sessionInsertRow(), sessionUpdateRow() and sessionDeleteRow() for
// other tables.
-func sessionStat1Sql(tls *libc.TLS, db uintptr, p uintptr) int32 { /* sqlite3.c:210683:12: */
- var rc int32 = sessionSelectRow(tls, db, ts+10072 /* "sqlite_stat1" */, p)
+func sessionStat1Sql(tls *libc.TLS, db uintptr, p uintptr) int32 { /* sqlite3.c:212483:12: */
+ var rc int32 = sessionSelectRow(tls, db, ts+11186 /* "sqlite_stat1" */, p)
if rc == SQLITE_OK {
- rc = sessionPrepare(tls, db, (p + 8 /* &.pInsert */),
+ rc = sessionPrepare(tls, db, p+8,
- ts+31272 /* "INSERT INTO main..." */)
+ ts+32632 /* "INSERT INTO main..." */)
}
if rc == SQLITE_OK {
- rc = sessionPrepare(tls, db, (p + 4 /* &.pDelete */),
+ rc = sessionPrepare(tls, db, p+4,
- ts+31385 /* "DELETE FROM main..." */)
+ ts+32745 /* "DELETE FROM main..." */)
}
return rc
}
// A wrapper around sqlite3_bind_value() that detects an extra problem.
// See comments in the body of this function for details.
-func sessionBindValue(tls *libc.TLS, pStmt uintptr, i int32, pVal uintptr) int32 { /* sqlite3.c:210706:12: */
+func sessionBindValue(tls *libc.TLS, pStmt uintptr, i int32, pVal uintptr) int32 { /* sqlite3.c:212506:12: */
var eType int32 = Xsqlite3_value_type(tls, pVal)
// COVERAGE: The (pVal->z==0) branch is never true using current versions
// of SQLite. If a malloc fails in an sqlite3_value_xxx() function, either
// the (pVal->z) variable remains as it was or the type of the value is
// set to SQLITE_NULL.
- if ((eType == SQLITE_TEXT) || (eType == SQLITE_BLOB)) && ((*Sqlite3_value)(unsafe.Pointer(pVal)).Fz == uintptr(0)) {
+ if (eType == SQLITE_TEXT || eType == SQLITE_BLOB) && (*Sqlite3_value)(unsafe.Pointer(pVal)).Fz == uintptr(0) {
// This condition occurs when an earlier OOM in a call to
// sqlite3_value_text() or sqlite3_value_blob() (perhaps from within
// a conflict-handler) has zeroed the pVal->z pointer. Return NOMEM.
@@ -169412,7 +171737,7 @@ func sessionBindValue(tls *libc.TLS, pStmt uintptr, i int32, pVal uintptr) int32
// statement.
//
// An SQLite error code is returned if an error occurs. Otherwise, SQLITE_OK.
-func sessionBindRow(tls *libc.TLS, pIter uintptr, xValue uintptr, nCol int32, abPK uintptr, pStmt uintptr) int32 { /* sqlite3.c:210739:12: */
+func sessionBindRow(tls *libc.TLS, pIter uintptr, xValue uintptr, nCol int32, abPK uintptr, pStmt uintptr) int32 { /* sqlite3.c:212539:12: */
bp := tls.Alloc(4)
defer tls.Free(4)
@@ -169424,19 +171749,18 @@ func sessionBindRow(tls *libc.TLS, pIter uintptr, xValue uintptr, nCol int32, ab
// is one of these to guarantee that it is safe to ignore the return
// in the code below.
- for i = 0; (rc == SQLITE_OK) && (i < nCol); i++ {
- if !(abPK != 0) || (*(*U8)(unsafe.Pointer(abPK + uintptr(i))) != 0) {
- // var pVal uintptr at bp, 4
-
+ for i = 0; rc == SQLITE_OK && i < nCol; i++ {
+ if !(abPK != 0) || *(*U8)(unsafe.Pointer(abPK + uintptr(i))) != 0 {
+ *(*uintptr)(unsafe.Pointer(bp /* pVal */)) = uintptr(0)
(*struct {
f func(*libc.TLS, uintptr, int32, uintptr) int32
})(unsafe.Pointer(&struct{ uintptr }{xValue})).f(tls, pIter, i, bp /* &pVal */)
- if *(*uintptr)(unsafe.Pointer(bp /* pVal */)) == uintptr(0) {
+ if *(*uintptr)(unsafe.Pointer(bp)) == uintptr(0) {
// The value in the changeset was "undefined". This indicates a
// corrupt changeset blob.
- rc = Xsqlite3CorruptError(tls, 210762)
+ rc = Xsqlite3CorruptError(tls, 212562)
} else {
- rc = sessionBindValue(tls, pStmt, (i + 1), *(*uintptr)(unsafe.Pointer(bp /* pVal */)))
+ rc = sessionBindValue(tls, pStmt, i+1, *(*uintptr)(unsafe.Pointer(bp /* pVal */)))
}
}
}
@@ -169458,7 +171782,7 @@ func sessionBindRow(tls *libc.TLS, pIter uintptr, xValue uintptr, nCol int32, ab
// If the iterator currently points to an INSERT record, bind values from the
// new.* record to the SELECT statement. Or, if it points to a DELETE or
// UPDATE, bind values from the old.* record.
-func sessionSeekToRow(tls *libc.TLS, db uintptr, pIter uintptr, abPK uintptr, pSelect uintptr) int32 { /* sqlite3.c:210788:12: */
+func sessionSeekToRow(tls *libc.TLS, db uintptr, pIter uintptr, abPK uintptr, pSelect uintptr) int32 { /* sqlite3.c:212588:12: */
bp := tls.Alloc(12)
defer tls.Free(12)
@@ -169473,7 +171797,7 @@ func sessionSeekToRow(tls *libc.TLS, db uintptr, pIter uintptr, abPK uintptr, pS
Xsqlite3changeset_op(tls, pIter, bp /* &zDummy */, bp+4 /* &nCol */, bp+8 /* &op */, uintptr(0))
rc = sessionBindRow(tls, pIter,
func() uintptr {
- if *(*int32)(unsafe.Pointer(bp + 8 /* op */)) == SQLITE_INSERT {
+ if *(*int32)(unsafe.Pointer(bp + 8)) == SQLITE_INSERT {
return *(*uintptr)(unsafe.Pointer(&struct {
f func(*libc.TLS, uintptr, int32, uintptr) int32
}{Xsqlite3changeset_new}))
@@ -169502,7 +171826,7 @@ func sessionSeekToRow(tls *libc.TLS, db uintptr, pIter uintptr, abPK uintptr, pS
// of apply_v2() as the "rebase" buffer.
//
// Return SQLITE_OK if successful, or an SQLite error code otherwise.
-func sessionRebaseAdd(tls *libc.TLS, p uintptr, eType int32, pIter uintptr) int32 { /* sqlite3.c:210823:12: */
+func sessionRebaseAdd(tls *libc.TLS, p uintptr, eType int32, pIter uintptr) int32 { /* sqlite3.c:212623:12: */
bp := tls.Alloc(8)
defer tls.Free(8)
@@ -169513,29 +171837,29 @@ func sessionRebaseAdd(tls *libc.TLS, p uintptr, eType int32, pIter uintptr) int3
if int32((*SessionApplyCtx)(unsafe.Pointer(p)).FbRebaseStarted) == 0 {
// Append a table-header to the rebase buffer
var zTab uintptr = (*Sqlite3_changeset_iter)(unsafe.Pointer(pIter)).FzTab
- sessionAppendByte(tls, (p + 60 /* &.rebase */), uint8('T'), bp /* &rc */)
- sessionAppendVarint(tls, (p + 60 /* &.rebase */), (*SessionApplyCtx)(unsafe.Pointer(p)).FnCol, bp /* &rc */)
- sessionAppendBlob(tls, (p + 60 /* &.rebase */), (*SessionApplyCtx)(unsafe.Pointer(p)).FabPK, (*SessionApplyCtx)(unsafe.Pointer(p)).FnCol, bp /* &rc */)
- sessionAppendBlob(tls, (p + 60 /* &.rebase */), zTab, (int32(libc.Xstrlen(tls, zTab)) + 1), bp /* &rc */)
+ sessionAppendByte(tls, p+60, uint8('T'), bp /* &rc */)
+ sessionAppendVarint(tls, p+60, (*SessionApplyCtx)(unsafe.Pointer(p)).FnCol, bp /* &rc */)
+ sessionAppendBlob(tls, p+60, (*SessionApplyCtx)(unsafe.Pointer(p)).FabPK, (*SessionApplyCtx)(unsafe.Pointer(p)).FnCol, bp /* &rc */)
+ sessionAppendBlob(tls, p+60, zTab, int32(libc.Xstrlen(tls, zTab))+1, bp /* &rc */)
(*SessionApplyCtx)(unsafe.Pointer(p)).FbRebaseStarted = U8(1)
}
- sessionAppendByte(tls, (p + 60 /* &.rebase */),
+ sessionAppendByte(tls, p+60,
func() uint8 {
if eOp == SQLITE_DELETE {
return uint8(SQLITE_DELETE)
}
return uint8(SQLITE_INSERT)
- }(), bp /* &rc */)
- sessionAppendByte(tls, (p + 60 /* &.rebase */), (uint8(libc.Bool32(eType == SQLITE_CHANGESET_REPLACE))), bp /* &rc */)
+ }(), bp)
+ sessionAppendByte(tls, p+60, uint8(libc.Bool32(eType == SQLITE_CHANGESET_REPLACE)), bp /* &rc */)
for i = 0; i < (*SessionApplyCtx)(unsafe.Pointer(p)).FnCol; i++ {
*(*uintptr)(unsafe.Pointer(bp + 4 /* pVal */)) = uintptr(0)
- if (eOp == SQLITE_DELETE) || ((eOp == SQLITE_UPDATE) && (*(*U8)(unsafe.Pointer((*SessionApplyCtx)(unsafe.Pointer(p)).FabPK + uintptr(i))) != 0)) {
+ if eOp == SQLITE_DELETE || eOp == SQLITE_UPDATE && *(*U8)(unsafe.Pointer((*SessionApplyCtx)(unsafe.Pointer(p)).FabPK + uintptr(i))) != 0 {
Xsqlite3changeset_old(tls, pIter, i, bp+4 /* &pVal */)
} else {
Xsqlite3changeset_new(tls, pIter, i, bp+4 /* &pVal */)
}
- sessionAppendValue(tls, (p + 60 /* &.rebase */), *(*uintptr)(unsafe.Pointer(bp + 4 /* pVal */)), bp /* &rc */)
+ sessionAppendValue(tls, p+60, *(*uintptr)(unsafe.Pointer(bp + 4 /* pVal */)), bp /* &rc */)
}
}
return *(*int32)(unsafe.Pointer(bp /* rc */))
@@ -169574,7 +171898,7 @@ func sessionRebaseAdd(tls *libc.TLS, p uintptr, eType int32, pIter uintptr) int3
// returned. Or, if the conflict handler returns an invalid value,
// SQLITE_MISUSE. If the conflict handler returns SQLITE_CHANGESET_OMIT,
// this function returns SQLITE_OK.
-func sessionConflictHandler(tls *libc.TLS, eType int32, p uintptr, pIter uintptr, xConflict uintptr, pCtx uintptr, pbReplace uintptr) int32 { /* sqlite3.c:210897:12: */
+func sessionConflictHandler(tls *libc.TLS, eType int32, p uintptr, pIter uintptr, xConflict uintptr, pCtx uintptr, pbReplace uintptr) int32 { /* sqlite3.c:212697:12: */
bp := tls.Alloc(16)
defer tls.Free(16)
@@ -169596,7 +171920,7 @@ func sessionConflictHandler(tls *libc.TLS, eType int32, p uintptr, pIter uintptr
*(*int32)(unsafe.Pointer(bp + 12 /* rc */)) = SQLITE_OK
}
- if *(*int32)(unsafe.Pointer(bp + 12 /* rc */)) == SQLITE_ROW {
+ if *(*int32)(unsafe.Pointer(bp + 12)) == SQLITE_ROW {
// There exists another row with the new.* primary key.
(*Sqlite3_changeset_iter)(unsafe.Pointer(pIter)).FpConflict = (*SessionApplyCtx)(unsafe.Pointer(p)).FpSelect
res = (*struct {
@@ -169604,26 +171928,26 @@ func sessionConflictHandler(tls *libc.TLS, eType int32, p uintptr, pIter uintptr
})(unsafe.Pointer(&struct{ uintptr }{xConflict})).f(tls, pCtx, eType, pIter)
(*Sqlite3_changeset_iter)(unsafe.Pointer(pIter)).FpConflict = uintptr(0)
*(*int32)(unsafe.Pointer(bp + 12 /* rc */)) = Xsqlite3_reset(tls, (*SessionApplyCtx)(unsafe.Pointer(p)).FpSelect)
- } else if *(*int32)(unsafe.Pointer(bp + 12 /* rc */)) == SQLITE_OK {
- if ((*SessionApplyCtx)(unsafe.Pointer(p)).FbDeferConstraints != 0) && (eType == SQLITE_CHANGESET_CONFLICT) {
+ } else if *(*int32)(unsafe.Pointer(bp + 12)) == SQLITE_OK {
+ if (*SessionApplyCtx)(unsafe.Pointer(p)).FbDeferConstraints != 0 && eType == SQLITE_CHANGESET_CONFLICT {
// Instead of invoking the conflict handler, append the change blob
// to the SessionApplyCtx.constraints buffer.
- var aBlob uintptr = ((*Sqlite3_changeset_iter)(unsafe.Pointer(pIter)).Fin.FaData + uintptr((*Sqlite3_changeset_iter)(unsafe.Pointer(pIter)).Fin.FiCurrent))
- var nBlob int32 = ((*Sqlite3_changeset_iter)(unsafe.Pointer(pIter)).Fin.FiNext - (*Sqlite3_changeset_iter)(unsafe.Pointer(pIter)).Fin.FiCurrent)
- sessionAppendBlob(tls, (p + 48 /* &.constraints */), aBlob, nBlob, bp+12 /* &rc */)
+ var aBlob uintptr = (*Sqlite3_changeset_iter)(unsafe.Pointer(pIter)).Fin.FaData + uintptr((*Sqlite3_changeset_iter)(unsafe.Pointer(pIter)).Fin.FiCurrent)
+ var nBlob int32 = (*Sqlite3_changeset_iter)(unsafe.Pointer(pIter)).Fin.FiNext - (*Sqlite3_changeset_iter)(unsafe.Pointer(pIter)).Fin.FiCurrent
+ sessionAppendBlob(tls, p+48, aBlob, nBlob, bp+12 /* &rc */)
return SQLITE_OK
} else {
// No other row with the new.* primary key.
res = (*struct {
f func(*libc.TLS, uintptr, int32, uintptr) int32
- })(unsafe.Pointer(&struct{ uintptr }{xConflict})).f(tls, pCtx, (eType + 1), pIter)
+ })(unsafe.Pointer(&struct{ uintptr }{xConflict})).f(tls, pCtx, eType+1, pIter)
if res == SQLITE_CHANGESET_REPLACE {
*(*int32)(unsafe.Pointer(bp + 12 /* rc */)) = SQLITE_MISUSE
}
}
}
- if *(*int32)(unsafe.Pointer(bp + 12 /* rc */)) == SQLITE_OK {
+ if *(*int32)(unsafe.Pointer(bp + 12)) == SQLITE_OK {
switch res {
case SQLITE_CHANGESET_REPLACE:
@@ -169644,7 +171968,7 @@ func sessionConflictHandler(tls *libc.TLS, eType int32, p uintptr, pIter uintptr
*(*int32)(unsafe.Pointer(bp + 12 /* rc */)) = SQLITE_MISUSE
break
}
- if *(*int32)(unsafe.Pointer(bp + 12 /* rc */)) == SQLITE_OK {
+ if *(*int32)(unsafe.Pointer(bp + 12)) == SQLITE_OK {
*(*int32)(unsafe.Pointer(bp + 12 /* rc */)) = sessionRebaseAdd(tls, p, res, pIter)
}
}
@@ -169674,7 +171998,7 @@ func sessionConflictHandler(tls *libc.TLS, eType int32, p uintptr, pIter uintptr
// If any conflict handler returns SQLITE_CHANGESET_ABORT, this function
// returns SQLITE_ABORT. Otherwise, if no error occurs, SQLITE_OK is
// returned.
-func sessionApplyOneOp(tls *libc.TLS, pIter uintptr, p uintptr, xConflict uintptr, pCtx uintptr, pbReplace uintptr, pbRetry uintptr) int32 { /* sqlite3.c:210995:12: */
+func sessionApplyOneOp(tls *libc.TLS, pIter uintptr, p uintptr, xConflict uintptr, pCtx uintptr, pbReplace uintptr, pbRetry uintptr) int32 { /* sqlite3.c:212795:12: */
bp := tls.Alloc(16)
defer tls.Free(16)
@@ -169688,7 +172012,7 @@ func sessionApplyOneOp(tls *libc.TLS, pIter uintptr, p uintptr, xConflict uintpt
Xsqlite3changeset_op(tls, pIter, bp /* &zDummy */, bp+4 /* &nCol */, bp+8 /* &op */, uintptr(0))
- if *(*int32)(unsafe.Pointer(bp + 8 /* op */)) == SQLITE_DELETE {
+ if *(*int32)(unsafe.Pointer(bp + 8)) == SQLITE_DELETE {
// Bind values to the DELETE statement. If conflict handling is required,
// bind values for all columns and set bound variable (nCol+1) to true.
@@ -169709,8 +172033,8 @@ func sessionApplyOneOp(tls *libc.TLS, pIter uintptr, p uintptr, xConflict uintpt
rc = sessionBindRow(tls, pIter, *(*uintptr)(unsafe.Pointer(&struct {
f func(*libc.TLS, uintptr, int32, uintptr) int32
}{Xsqlite3changeset_old})), *(*int32)(unsafe.Pointer(bp + 4 /* nCol */)), abPK, (*SessionApplyCtx)(unsafe.Pointer(p)).FpDelete)
- if (rc == SQLITE_OK) && (Xsqlite3_bind_parameter_count(tls, (*SessionApplyCtx)(unsafe.Pointer(p)).FpDelete) > *(*int32)(unsafe.Pointer(bp + 4 /* nCol */))) {
- rc = Xsqlite3_bind_int(tls, (*SessionApplyCtx)(unsafe.Pointer(p)).FpDelete, (*(*int32)(unsafe.Pointer(bp + 4 /* nCol */)) + 1), (libc.Bool32((pbRetry == uintptr(0)) || (abPK != 0))))
+ if rc == SQLITE_OK && Xsqlite3_bind_parameter_count(tls, (*SessionApplyCtx)(unsafe.Pointer(p)).FpDelete) > *(*int32)(unsafe.Pointer(bp + 4)) {
+ rc = Xsqlite3_bind_int(tls, (*SessionApplyCtx)(unsafe.Pointer(p)).FpDelete, *(*int32)(unsafe.Pointer(bp + 4))+1, libc.Bool32(pbRetry == uintptr(0) || abPK != 0))
}
if rc != SQLITE_OK {
return rc
@@ -169718,30 +172042,30 @@ func sessionApplyOneOp(tls *libc.TLS, pIter uintptr, p uintptr, xConflict uintpt
Xsqlite3_step(tls, (*SessionApplyCtx)(unsafe.Pointer(p)).FpDelete)
rc = Xsqlite3_reset(tls, (*SessionApplyCtx)(unsafe.Pointer(p)).FpDelete)
- if (rc == SQLITE_OK) && (Xsqlite3_changes(tls, (*SessionApplyCtx)(unsafe.Pointer(p)).Fdb) == 0) {
+ if rc == SQLITE_OK && Xsqlite3_changes(tls, (*SessionApplyCtx)(unsafe.Pointer(p)).Fdb) == 0 {
rc = sessionConflictHandler(tls,
SQLITE_CHANGESET_DATA, p, pIter, xConflict, pCtx, pbRetry)
- } else if (rc & 0xff) == SQLITE_CONSTRAINT {
+ } else if rc&0xff == SQLITE_CONSTRAINT {
rc = sessionConflictHandler(tls,
SQLITE_CHANGESET_CONFLICT, p, pIter, xConflict, pCtx, uintptr(0))
}
- } else if *(*int32)(unsafe.Pointer(bp + 8 /* op */)) == SQLITE_UPDATE {
+ } else if *(*int32)(unsafe.Pointer(bp + 8)) == SQLITE_UPDATE {
var i int32
*(*uintptr)(unsafe.Pointer(bp + 12 /* pUp */)) = uintptr(0)
- var bPatchset int32 = (libc.Bool32((pbRetry == uintptr(0)) || ((*Sqlite3_changeset_iter)(unsafe.Pointer(pIter)).FbPatchset != 0)))
+ var bPatchset int32 = libc.Bool32(pbRetry == uintptr(0) || (*Sqlite3_changeset_iter)(unsafe.Pointer(pIter)).FbPatchset != 0)
rc = sessionUpdateFind(tls, pIter, p, bPatchset, bp+12 /* &pUp */)
// Bind values to the UPDATE statement.
- for i = 0; (rc == SQLITE_OK) && (i < *(*int32)(unsafe.Pointer(bp + 4 /* nCol */))); i++ {
- var pOld uintptr = *(*uintptr)(unsafe.Pointer((*Sqlite3_changeset_iter)(unsafe.Pointer((pIter))).FapValue + uintptr(i)*4))
- var pNew uintptr = *(*uintptr)(unsafe.Pointer((*Sqlite3_changeset_iter)(unsafe.Pointer((pIter))).FapValue + uintptr(((*Sqlite3_changeset_iter)(unsafe.Pointer((pIter))).FnCol+(i)))*4))
- if (*(*U8)(unsafe.Pointer((*SessionApplyCtx)(unsafe.Pointer(p)).FabPK + uintptr(i))) != 0) || ((bPatchset == 0) && (pOld != 0)) {
- rc = sessionBindValue(tls, *(*uintptr)(unsafe.Pointer(bp + 12 /* pUp */)), ((i * 2) + 2), pOld)
+ for i = 0; rc == SQLITE_OK && i < *(*int32)(unsafe.Pointer(bp + 4 /* nCol */)); i++ {
+ var pOld uintptr = *(*uintptr)(unsafe.Pointer((*Sqlite3_changeset_iter)(unsafe.Pointer(pIter)).FapValue + uintptr(i)*4))
+ var pNew uintptr = *(*uintptr)(unsafe.Pointer((*Sqlite3_changeset_iter)(unsafe.Pointer(pIter)).FapValue + uintptr((*Sqlite3_changeset_iter)(unsafe.Pointer(pIter)).FnCol+i)*4))
+ if *(*U8)(unsafe.Pointer((*SessionApplyCtx)(unsafe.Pointer(p)).FabPK + uintptr(i))) != 0 || bPatchset == 0 && pOld != 0 {
+ rc = sessionBindValue(tls, *(*uintptr)(unsafe.Pointer(bp + 12 /* pUp */)), i*2+2, pOld)
}
- if (rc == SQLITE_OK) && (pNew != 0) {
- rc = sessionBindValue(tls, *(*uintptr)(unsafe.Pointer(bp + 12 /* pUp */)), ((i * 2) + 1), pNew)
+ if rc == SQLITE_OK && pNew != 0 {
+ rc = sessionBindValue(tls, *(*uintptr)(unsafe.Pointer(bp + 12 /* pUp */)), i*2+1, pNew)
}
}
if rc != SQLITE_OK {
@@ -169753,7 +172077,7 @@ func sessionApplyOneOp(tls *libc.TLS, pIter uintptr, p uintptr, xConflict uintpt
Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp + 12 /* pUp */)))
rc = Xsqlite3_reset(tls, *(*uintptr)(unsafe.Pointer(bp + 12 /* pUp */)))
- if (rc == SQLITE_OK) && (Xsqlite3_changes(tls, (*SessionApplyCtx)(unsafe.Pointer(p)).Fdb) == 0) {
+ if rc == SQLITE_OK && Xsqlite3_changes(tls, (*SessionApplyCtx)(unsafe.Pointer(p)).Fdb) == 0 {
// A NOTFOUND or DATA error. Search the table to see if it contains
// a row with a matching primary key. If so, this is a DATA conflict.
// Otherwise, if there is no primary key match, it is a NOTFOUND.
@@ -169761,7 +172085,7 @@ func sessionApplyOneOp(tls *libc.TLS, pIter uintptr, p uintptr, xConflict uintpt
rc = sessionConflictHandler(tls,
SQLITE_CHANGESET_DATA, p, pIter, xConflict, pCtx, pbRetry)
- } else if (rc & 0xff) == SQLITE_CONSTRAINT {
+ } else if rc&0xff == SQLITE_CONSTRAINT {
// This is always a CONSTRAINT conflict.
rc = sessionConflictHandler(tls,
SQLITE_CHANGESET_CONFLICT, p, pIter, xConflict, pCtx, uintptr(0))
@@ -169792,7 +172116,7 @@ func sessionApplyOneOp(tls *libc.TLS, pIter uintptr, p uintptr, xConflict uintpt
rc = Xsqlite3_reset(tls, (*SessionApplyCtx)(unsafe.Pointer(p)).FpInsert)
}
- if (rc & 0xff) == SQLITE_CONSTRAINT {
+ if rc&0xff == SQLITE_CONSTRAINT {
rc = sessionConflictHandler(tls,
SQLITE_CHANGESET_CONFLICT, p, pIter, xConflict, pCtx, pbReplace)
}
@@ -169809,7 +172133,7 @@ func sessionApplyOneOp(tls *libc.TLS, pIter uintptr, p uintptr, xConflict uintpt
// function handles the case where the conflict-handler is invoked and
// returns SQLITE_CHANGESET_REPLACE - indicating that the change should be
// retried in some manner.
-func sessionApplyOneWithRetry(tls *libc.TLS, db uintptr, pIter uintptr, pApply uintptr, xConflict uintptr, pCtx uintptr) int32 { /* sqlite3.c:211128:12: */
+func sessionApplyOneWithRetry(tls *libc.TLS, db uintptr, pIter uintptr, pApply uintptr, xConflict uintptr, pCtx uintptr) int32 { /* sqlite3.c:212928:12: */
bp := tls.Alloc(8)
defer tls.Free(8)
@@ -169826,18 +172150,18 @@ func sessionApplyOneWithRetry(tls *libc.TLS, db uintptr, pIter uintptr, pApply u
// returned SQLITE_CHANGESET_REPLACE. In this case retry the operation,
// but pass NULL as the final argument so that sessionApplyOneOp() ignores
// the SQLITE_CHANGESET_DATA problem.
- if *(*int32)(unsafe.Pointer(bp + 4 /* bRetry */)) != 0 {
+ if *(*int32)(unsafe.Pointer(bp + 4)) != 0 {
rc = sessionApplyOneOp(tls, pIter, pApply, xConflict, pCtx, uintptr(0), uintptr(0))
- } else if *(*int32)(unsafe.Pointer(bp /* bReplace */)) != 0 {
+ } else if *(*int32)(unsafe.Pointer(bp)) != 0 {
- rc = Xsqlite3_exec(tls, db, ts+31529 /* "SAVEPOINT replac..." */, uintptr(0), uintptr(0), uintptr(0))
+ rc = Xsqlite3_exec(tls, db, ts+32889 /* "SAVEPOINT replac..." */, uintptr(0), uintptr(0), uintptr(0))
if rc == SQLITE_OK {
rc = sessionBindRow(tls, pIter,
*(*uintptr)(unsafe.Pointer(&struct {
f func(*libc.TLS, uintptr, int32, uintptr) int32
}{Xsqlite3changeset_new})), (*SessionApplyCtx)(unsafe.Pointer(pApply)).FnCol, (*SessionApplyCtx)(unsafe.Pointer(pApply)).FabPK, (*SessionApplyCtx)(unsafe.Pointer(pApply)).FpDelete)
- Xsqlite3_bind_int(tls, (*SessionApplyCtx)(unsafe.Pointer(pApply)).FpDelete, ((*SessionApplyCtx)(unsafe.Pointer(pApply)).FnCol + 1), 1)
+ Xsqlite3_bind_int(tls, (*SessionApplyCtx)(unsafe.Pointer(pApply)).FpDelete, (*SessionApplyCtx)(unsafe.Pointer(pApply)).FnCol+1, 1)
}
if rc == SQLITE_OK {
Xsqlite3_step(tls, (*SessionApplyCtx)(unsafe.Pointer(pApply)).FpDelete)
@@ -169847,7 +172171,7 @@ func sessionApplyOneWithRetry(tls *libc.TLS, db uintptr, pIter uintptr, pApply u
rc = sessionApplyOneOp(tls, pIter, pApply, xConflict, pCtx, uintptr(0), uintptr(0))
}
if rc == SQLITE_OK {
- rc = Xsqlite3_exec(tls, db, ts+31550 /* "RELEASE replace_..." */, uintptr(0), uintptr(0), uintptr(0))
+ rc = Xsqlite3_exec(tls, db, ts+32910 /* "RELEASE replace_..." */, uintptr(0), uintptr(0), uintptr(0))
}
}
}
@@ -169856,7 +172180,7 @@ func sessionApplyOneWithRetry(tls *libc.TLS, db uintptr, pIter uintptr, pApply u
}
// Retry the changes accumulated in the pApply->constraints buffer.
-func sessionRetryConstraints(tls *libc.TLS, db uintptr, bPatchset int32, zTab uintptr, pApply uintptr, xConflict uintptr, pCtx uintptr) int32 { /* sqlite3.c:211185:12: */
+func sessionRetryConstraints(tls *libc.TLS, db uintptr, bPatchset int32, zTab uintptr, pApply uintptr, xConflict uintptr, pCtx uintptr) int32 { /* sqlite3.c:212985:12: */
bp := tls.Alloc(8)
defer tls.Free(8)
@@ -169865,35 +172189,35 @@ func sessionRetryConstraints(tls *libc.TLS, db uintptr, bPatchset int32, zTab ui
for (*SessionApplyCtx)(unsafe.Pointer(pApply)).Fconstraints.FnBuf != 0 {
*(*uintptr)(unsafe.Pointer(bp /* pIter2 */)) = uintptr(0)
var cons = (*SessionApplyCtx)(unsafe.Pointer(pApply)).Fconstraints
- libc.Xmemset(tls, (pApply + 48 /* &.constraints */), 0, uint32(unsafe.Sizeof(SessionBuffer{})))
+ libc.Xmemset(tls, pApply+48, 0, uint32(unsafe.Sizeof(SessionBuffer{})))
*(*int32)(unsafe.Pointer(bp + 4 /* rc */)) = sessionChangesetStart(tls,
bp /* &pIter2 */, uintptr(0), uintptr(0), cons.FnBuf, cons.FaBuf, (*SessionApplyCtx)(unsafe.Pointer(pApply)).FbInvertConstraints, 1)
- if *(*int32)(unsafe.Pointer(bp + 4 /* rc */)) == SQLITE_OK {
- var nByte Size_t = ((uint32(2 * (*SessionApplyCtx)(unsafe.Pointer(pApply)).FnCol)) * uint32(unsafe.Sizeof(uintptr(0))))
+ if *(*int32)(unsafe.Pointer(bp + 4)) == SQLITE_OK {
+ var nByte Size_t = uint32(2*(*SessionApplyCtx)(unsafe.Pointer(pApply)).FnCol) * uint32(unsafe.Sizeof(uintptr(0)))
var rc2 int32
(*Sqlite3_changeset_iter)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* pIter2 */)))).FbPatchset = bPatchset
(*Sqlite3_changeset_iter)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* pIter2 */)))).FzTab = zTab
(*Sqlite3_changeset_iter)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* pIter2 */)))).FnCol = (*SessionApplyCtx)(unsafe.Pointer(pApply)).FnCol
(*Sqlite3_changeset_iter)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* pIter2 */)))).FabPK = (*SessionApplyCtx)(unsafe.Pointer(pApply)).FabPK
- sessionBufferGrow(tls, (*(*uintptr)(unsafe.Pointer(bp /* pIter2 */)) + 44 /* &.tblhdr */), int64(nByte), bp+4 /* &rc */)
+ sessionBufferGrow(tls, *(*uintptr)(unsafe.Pointer(bp))+44, int64(nByte), bp+4 /* &rc */)
(*Sqlite3_changeset_iter)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* pIter2 */)))).FapValue = (*Sqlite3_changeset_iter)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* pIter2 */)))).Ftblhdr.FaBuf
- if *(*int32)(unsafe.Pointer(bp + 4 /* rc */)) == SQLITE_OK {
+ if *(*int32)(unsafe.Pointer(bp + 4)) == SQLITE_OK {
libc.Xmemset(tls, (*Sqlite3_changeset_iter)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* pIter2 */)))).FapValue, 0, nByte)
}
- for (*(*int32)(unsafe.Pointer(bp + 4 /* rc */)) == SQLITE_OK) && (SQLITE_ROW == Xsqlite3changeset_next(tls, *(*uintptr)(unsafe.Pointer(bp /* pIter2 */)))) {
+ for *(*int32)(unsafe.Pointer(bp + 4)) == SQLITE_OK && SQLITE_ROW == Xsqlite3changeset_next(tls, *(*uintptr)(unsafe.Pointer(bp))) {
*(*int32)(unsafe.Pointer(bp + 4 /* rc */)) = sessionApplyOneWithRetry(tls, db, *(*uintptr)(unsafe.Pointer(bp /* pIter2 */)), pApply, xConflict, pCtx)
}
rc2 = Xsqlite3changeset_finalize(tls, *(*uintptr)(unsafe.Pointer(bp /* pIter2 */)))
- if *(*int32)(unsafe.Pointer(bp + 4 /* rc */)) == SQLITE_OK {
+ if *(*int32)(unsafe.Pointer(bp + 4)) == SQLITE_OK {
*(*int32)(unsafe.Pointer(bp + 4 /* rc */)) = rc2
}
}
Xsqlite3_free(tls, cons.FaBuf)
- if *(*int32)(unsafe.Pointer(bp + 4 /* rc */)) != SQLITE_OK {
+ if *(*int32)(unsafe.Pointer(bp + 4)) != SQLITE_OK {
break
}
if (*SessionApplyCtx)(unsafe.Pointer(pApply)).Fconstraints.FnBuf >= cons.FnBuf {
@@ -169910,7 +172234,7 @@ func sessionRetryConstraints(tls *libc.TLS, db uintptr, bPatchset int32, zTab ui
// changeset to the main database attached to handle "db". The supplied
// conflict handler callback is invoked to resolve any conflicts encountered
// while applying the change.
-func sessionChangesetApply(tls *libc.TLS, db uintptr, pIter uintptr, xFilter uintptr, xConflict uintptr, pCtx uintptr, ppRebase uintptr, pnRebase uintptr, flags int32) int32 { /* sqlite3.c:211241:12: */
+func sessionChangesetApply(tls *libc.TLS, db uintptr, pIter uintptr, xFilter uintptr, xConflict uintptr, pCtx uintptr, ppRebase uintptr, pnRebase uintptr, flags int32) int32 { /* sqlite3.c:213041:12: */
bp := tls.Alloc(252)
defer tls.Free(252)
@@ -169924,16 +172248,16 @@ func sessionChangesetApply(tls *libc.TLS, db uintptr, pIter uintptr, xFilter uin
(*Sqlite3_changeset_iter)(unsafe.Pointer(pIter)).Fin.FbNoDiscard = 1
libc.Xmemset(tls, bp+48 /* &sApply */, 0, uint32(unsafe.Sizeof(SessionApplyCtx{})))
- (*SessionApplyCtx)(unsafe.Pointer(bp + 48 /* &sApply */)).FbRebase = (U8(libc.Bool32((ppRebase != 0) && (pnRebase != 0))))
- (*SessionApplyCtx)(unsafe.Pointer(bp + 48 /* &sApply */)).FbInvertConstraints = libc.BoolInt32(!(!((flags & SQLITE_CHANGESETAPPLY_INVERT) != 0)))
+ (*SessionApplyCtx)(unsafe.Pointer(bp + 48 /* &sApply */)).FbRebase = U8(libc.Bool32(ppRebase != 0 && pnRebase != 0))
+ (*SessionApplyCtx)(unsafe.Pointer(bp + 48 /* &sApply */)).FbInvertConstraints = libc.BoolInt32(!!(flags&SQLITE_CHANGESETAPPLY_INVERT != 0))
Xsqlite3_mutex_enter(tls, Xsqlite3_db_mutex(tls, db))
- if (flags & SQLITE_CHANGESETAPPLY_NOSAVEPOINT) == 0 {
- rc = Xsqlite3_exec(tls, db, ts+31569 /* "SAVEPOINT change..." */, uintptr(0), uintptr(0), uintptr(0))
+ if flags&SQLITE_CHANGESETAPPLY_NOSAVEPOINT == 0 {
+ rc = Xsqlite3_exec(tls, db, ts+32929 /* "SAVEPOINT change..." */, uintptr(0), uintptr(0), uintptr(0))
}
if rc == SQLITE_OK {
- rc = Xsqlite3_exec(tls, db, ts+31595 /* "PRAGMA defer_for..." */, uintptr(0), uintptr(0), uintptr(0))
+ rc = Xsqlite3_exec(tls, db, ts+32955 /* "PRAGMA defer_for..." */, uintptr(0), uintptr(0), uintptr(0))
}
- for (rc == SQLITE_OK) && (SQLITE_ROW == Xsqlite3changeset_next(tls, pIter)) {
+ for rc == SQLITE_OK && SQLITE_ROW == Xsqlite3changeset_next(tls, pIter) {
// var nCol int32 at bp+128, 4
// var op int32 at bp+132, 4
@@ -169942,7 +172266,7 @@ func sessionChangesetApply(tls *libc.TLS, db uintptr, pIter uintptr, xFilter uin
Xsqlite3changeset_op(tls, pIter, bp+124 /* &zNew */, bp+128 /* &nCol */, bp+132 /* &op */, uintptr(0))
- if (*(*uintptr)(unsafe.Pointer(bp + 140 /* zTab */)) == uintptr(0)) || (Xsqlite3_strnicmp(tls, *(*uintptr)(unsafe.Pointer(bp + 124 /* zNew */)), *(*uintptr)(unsafe.Pointer(bp + 140 /* zTab */)), (nTab+1)) != 0) {
+ if *(*uintptr)(unsafe.Pointer(bp + 140)) == uintptr(0) || Xsqlite3_strnicmp(tls, *(*uintptr)(unsafe.Pointer(bp + 124)), *(*uintptr)(unsafe.Pointer(bp + 140)), nTab+1) != 0 {
// var abPK uintptr at bp+136, 4
rc = sessionRetryConstraints(tls,
@@ -169966,17 +172290,17 @@ func sessionChangesetApply(tls *libc.TLS, db uintptr, pIter uintptr, xFilter uin
(*SessionApplyCtx)(unsafe.Pointer(bp + 48 /* &sApply */)).FbStat1 = 0
(*SessionApplyCtx)(unsafe.Pointer(bp + 48 /* &sApply */)).FbDeferConstraints = 1
(*SessionApplyCtx)(unsafe.Pointer(bp + 48 /* &sApply */)).FbRebaseStarted = U8(0)
- libc.Xmemset(tls, (bp + 48 /* &sApply */ + 48 /* &.constraints */), 0, uint32(unsafe.Sizeof(SessionBuffer{})))
+ libc.Xmemset(tls, bp+48+48, 0, uint32(unsafe.Sizeof(SessionBuffer{})))
// If an xFilter() callback was specified, invoke it now. If the
// xFilter callback returns zero, skip this table. If it returns
// non-zero, proceed.
- schemaMismatch = (libc.Bool32((xFilter != 0) && (0 == (*struct {
+ schemaMismatch = libc.Bool32(xFilter != 0 && 0 == (*struct {
f func(*libc.TLS, uintptr, uintptr) int32
- })(unsafe.Pointer(&struct{ uintptr }{xFilter})).f(tls, pCtx, *(*uintptr)(unsafe.Pointer(bp + 124 /* zNew */))))))
+ })(unsafe.Pointer(&struct{ uintptr }{xFilter})).f(tls, pCtx, *(*uintptr)(unsafe.Pointer(bp + 124))))
if schemaMismatch != 0 {
- *(*uintptr)(unsafe.Pointer(bp + 140 /* zTab */)) = Xsqlite3_mprintf(tls, ts+2790 /* "%s" */, libc.VaList(bp, *(*uintptr)(unsafe.Pointer(bp + 124 /* zNew */))))
- if *(*uintptr)(unsafe.Pointer(bp + 140 /* zTab */)) == uintptr(0) {
+ *(*uintptr)(unsafe.Pointer(bp + 140 /* zTab */)) = Xsqlite3_mprintf(tls, ts+3601 /* "%s" */, libc.VaList(bp, *(*uintptr)(unsafe.Pointer(bp + 124 /* zNew */))))
+ if *(*uintptr)(unsafe.Pointer(bp + 140)) == uintptr(0) {
rc = SQLITE_NOMEM
break
}
@@ -169988,41 +172312,41 @@ func sessionChangesetApply(tls *libc.TLS, db uintptr, pIter uintptr, xFilter uin
Xsqlite3changeset_pk(tls, pIter, bp+136 /* &abPK */, uintptr(0))
rc = sessionTableInfo(tls, uintptr(0),
- db, ts+5458 /* "main" */, *(*uintptr)(unsafe.Pointer(bp + 124 /* zNew */)), (bp + 48 /* &sApply */ + 16 /* &.nCol */), bp+140 /* &zTab */, (bp + 48 /* &sApply */ + 20 /* &.azCol */), (bp + 48 /* &sApply */ + 24 /* &.abPK */))
+ db, ts+6305 /* "main" */, *(*uintptr)(unsafe.Pointer(bp + 124 /* zNew */)), bp+48+16, bp+140 /* &zTab */, bp+48+20, bp+48+24)
if rc != SQLITE_OK {
break
}
for i = 0; i < (*SessionApplyCtx)(unsafe.Pointer(bp+48 /* &sApply */)).FnCol; i++ {
- if *(*U8)(unsafe.Pointer((*SessionApplyCtx)(unsafe.Pointer(bp+48 /* &sApply */)).FabPK + uintptr(i))) != 0 {
- nMinCol = (i + 1)
+ if *(*U8)(unsafe.Pointer((*SessionApplyCtx)(unsafe.Pointer(bp+48)).FabPK + uintptr(i))) != 0 {
+ nMinCol = i + 1
}
}
- if (*SessionApplyCtx)(unsafe.Pointer(bp+48 /* &sApply */)).FnCol == 0 {
+ if (*SessionApplyCtx)(unsafe.Pointer(bp+48)).FnCol == 0 {
schemaMismatch = 1
Xsqlite3_log(tls, SQLITE_SCHEMA,
- ts+31625 /* "sqlite3changeset..." */, libc.VaList(bp+8, *(*uintptr)(unsafe.Pointer(bp + 140 /* zTab */))))
- } else if (*SessionApplyCtx)(unsafe.Pointer(bp+48 /* &sApply */)).FnCol < *(*int32)(unsafe.Pointer(bp + 128 /* nCol */)) {
+ ts+32985 /* "sqlite3changeset..." */, libc.VaList(bp+8, *(*uintptr)(unsafe.Pointer(bp + 140 /* zTab */))))
+ } else if (*SessionApplyCtx)(unsafe.Pointer(bp+48)).FnCol < *(*int32)(unsafe.Pointer(bp + 128)) {
schemaMismatch = 1
Xsqlite3_log(tls, SQLITE_SCHEMA,
- ts+31669, /* "sqlite3changeset..." */
+ ts+33029, /* "sqlite3changeset..." */
libc.VaList(bp+16, *(*uintptr)(unsafe.Pointer(bp + 140 /* zTab */)), (*SessionApplyCtx)(unsafe.Pointer(bp+48 /* &sApply */)).FnCol, *(*int32)(unsafe.Pointer(bp + 128 /* nCol */))))
- } else if (*(*int32)(unsafe.Pointer(bp + 128 /* nCol */)) < nMinCol) || (libc.Xmemcmp(tls, (*SessionApplyCtx)(unsafe.Pointer(bp+48 /* &sApply */)).FabPK, *(*uintptr)(unsafe.Pointer(bp + 136 /* abPK */)), uint32(*(*int32)(unsafe.Pointer(bp + 128 /* nCol */)))) != 0) {
+ } else if *(*int32)(unsafe.Pointer(bp + 128)) < nMinCol || libc.Xmemcmp(tls, (*SessionApplyCtx)(unsafe.Pointer(bp+48)).FabPK, *(*uintptr)(unsafe.Pointer(bp + 136)), uint32(*(*int32)(unsafe.Pointer(bp + 128)))) != 0 {
schemaMismatch = 1
Xsqlite3_log(tls, SQLITE_SCHEMA,
- ts+31740 /* "sqlite3changeset..." */, libc.VaList(bp+40, *(*uintptr)(unsafe.Pointer(bp + 140 /* zTab */))))
+ ts+33100 /* "sqlite3changeset..." */, libc.VaList(bp+40, *(*uintptr)(unsafe.Pointer(bp + 140 /* zTab */))))
} else {
(*SessionApplyCtx)(unsafe.Pointer(bp + 48 /* &sApply */)).FnCol = *(*int32)(unsafe.Pointer(bp + 128 /* nCol */))
- if 0 == Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(bp + 140 /* zTab */)), ts+10072 /* "sqlite_stat1" */) {
- if libc.AssignInt32(&rc, sessionStat1Sql(tls, db, bp+48 /* &sApply */)) != 0 {
+ if 0 == Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(bp + 140)), ts+11186) {
+ if libc.AssignInt32(&rc, sessionStat1Sql(tls, db, bp+48)) != 0 {
break
}
(*SessionApplyCtx)(unsafe.Pointer(bp + 48 /* &sApply */)).FbStat1 = 1
} else {
- if ((libc.AssignInt32(&rc, sessionSelectRow(tls, db, *(*uintptr)(unsafe.Pointer(bp + 140 /* zTab */)), bp+48 /* &sApply */)) != 0) ||
- (libc.AssignInt32(&rc, sessionDeleteRow(tls, db, *(*uintptr)(unsafe.Pointer(bp + 140 /* zTab */)), bp+48 /* &sApply */)) != 0)) ||
- (libc.AssignInt32(&rc, sessionInsertRow(tls, db, *(*uintptr)(unsafe.Pointer(bp + 140 /* zTab */)), bp+48 /* &sApply */)) != 0) {
+ if libc.AssignInt32(&rc, sessionSelectRow(tls, db, *(*uintptr)(unsafe.Pointer(bp + 140)), bp+48)) != 0 ||
+ libc.AssignInt32(&rc, sessionDeleteRow(tls, db, *(*uintptr)(unsafe.Pointer(bp + 140)), bp+48)) != 0 ||
+ libc.AssignInt32(&rc, sessionInsertRow(tls, db, *(*uintptr)(unsafe.Pointer(bp + 140)), bp+48)) != 0 {
break
}
(*SessionApplyCtx)(unsafe.Pointer(bp + 48 /* &sApply */)).FbStat1 = 0
@@ -170058,7 +172382,7 @@ func sessionChangesetApply(tls *libc.TLS, db uintptr, pIter uintptr, xFilter uin
// var notUsed int32 at bp+148, 4
Xsqlite3_db_status(tls, db, SQLITE_DBSTATUS_DEFERRED_FKS, bp+144 /* &nFk */, bp+148 /* &notUsed */, 0)
- if *(*int32)(unsafe.Pointer(bp + 144 /* nFk */)) != 0 {
+ if *(*int32)(unsafe.Pointer(bp + 144)) != 0 {
var res int32 = SQLITE_CHANGESET_ABORT
// var sIter Sqlite3_changeset_iter at bp+152, 100
@@ -170072,18 +172396,18 @@ func sessionChangesetApply(tls *libc.TLS, db uintptr, pIter uintptr, xFilter uin
}
}
}
- Xsqlite3_exec(tls, db, ts+31800 /* "PRAGMA defer_for..." */, uintptr(0), uintptr(0), uintptr(0))
+ Xsqlite3_exec(tls, db, ts+33160 /* "PRAGMA defer_for..." */, uintptr(0), uintptr(0), uintptr(0))
- if (flags & SQLITE_CHANGESETAPPLY_NOSAVEPOINT) == 0 {
+ if flags&SQLITE_CHANGESETAPPLY_NOSAVEPOINT == 0 {
if rc == SQLITE_OK {
- rc = Xsqlite3_exec(tls, db, ts+31830 /* "RELEASE changese..." */, uintptr(0), uintptr(0), uintptr(0))
+ rc = Xsqlite3_exec(tls, db, ts+33190 /* "RELEASE changese..." */, uintptr(0), uintptr(0), uintptr(0))
} else {
- Xsqlite3_exec(tls, db, ts+31854 /* "ROLLBACK TO chan..." */, uintptr(0), uintptr(0), uintptr(0))
- Xsqlite3_exec(tls, db, ts+31830 /* "RELEASE changese..." */, uintptr(0), uintptr(0), uintptr(0))
+ Xsqlite3_exec(tls, db, ts+33214 /* "ROLLBACK TO chan..." */, uintptr(0), uintptr(0), uintptr(0))
+ Xsqlite3_exec(tls, db, ts+33190 /* "RELEASE changese..." */, uintptr(0), uintptr(0), uintptr(0))
}
}
- if ((rc == SQLITE_OK) && (bPatchset == 0)) && ((*SessionApplyCtx)(unsafe.Pointer(bp+48 /* &sApply */)).FbRebase != 0) {
+ if rc == SQLITE_OK && bPatchset == 0 && (*SessionApplyCtx)(unsafe.Pointer(bp+48)).FbRebase != 0 {
*(*uintptr)(unsafe.Pointer(ppRebase)) = (*SessionApplyCtx)(unsafe.Pointer(bp + 48 /* &sApply */)).Frebase.FaBuf
*(*int32)(unsafe.Pointer(pnRebase)) = (*SessionApplyCtx)(unsafe.Pointer(bp + 48 /* &sApply */)).Frebase.FnBuf
(*SessionApplyCtx)(unsafe.Pointer(bp + 48 /* &sApply */)).Frebase.FaBuf = uintptr(0)
@@ -170101,13 +172425,13 @@ func sessionChangesetApply(tls *libc.TLS, db uintptr, pIter uintptr, xFilter uin
// Apply the changeset passed via pChangeset/nChangeset to the main
// database attached to handle "db".
-func Xsqlite3changeset_apply_v2(tls *libc.TLS, db uintptr, nChangeset int32, pChangeset uintptr, xFilter uintptr, xConflict uintptr, pCtx uintptr, ppRebase uintptr, pnRebase uintptr, flags int32) int32 { /* sqlite3.c:211439:16: */
+func Xsqlite3changeset_apply_v2(tls *libc.TLS, db uintptr, nChangeset int32, pChangeset uintptr, xFilter uintptr, xConflict uintptr, pCtx uintptr, ppRebase uintptr, pnRebase uintptr, flags int32) int32 { /* sqlite3.c:213239:16: */
bp := tls.Alloc(4)
defer tls.Free(4)
// var pIter uintptr at bp, 4
// Iterator to skip through changeset
- var bInv int32 = libc.BoolInt32(!(!((flags & SQLITE_CHANGESETAPPLY_INVERT) != 0)))
+ var bInv int32 = libc.BoolInt32(!!(flags&SQLITE_CHANGESETAPPLY_INVERT != 0))
var rc int32 = sessionChangesetStart(tls, bp /* &pIter */, uintptr(0), uintptr(0), nChangeset, pChangeset, bInv, 1)
if rc == SQLITE_OK {
rc = sessionChangesetApply(tls,
@@ -170119,7 +172443,7 @@ func Xsqlite3changeset_apply_v2(tls *libc.TLS, db uintptr, nChangeset int32, pCh
// Apply the changeset passed via pChangeset/nChangeset to the main database
// attached to handle "db". Invoke the supplied conflict handler callback
// to resolve any conflicts encountered while applying the change.
-func Xsqlite3changeset_apply(tls *libc.TLS, db uintptr, nChangeset int32, pChangeset uintptr, xFilter uintptr, xConflict uintptr, pCtx uintptr) int32 { /* sqlite3.c:211472:16: */
+func Xsqlite3changeset_apply(tls *libc.TLS, db uintptr, nChangeset int32, pChangeset uintptr, xFilter uintptr, xConflict uintptr, pCtx uintptr) int32 { /* sqlite3.c:213272:16: */
return Xsqlite3changeset_apply_v2(tls,
db, nChangeset, pChangeset, xFilter, xConflict, pCtx, uintptr(0), uintptr(0), 0)
}
@@ -170127,13 +172451,13 @@ func Xsqlite3changeset_apply(tls *libc.TLS, db uintptr, nChangeset int32, pChang
// Apply the changeset passed via xInput/pIn to the main database
// attached to handle "db". Invoke the supplied conflict handler callback
// to resolve any conflicts encountered while applying the change.
-func Xsqlite3changeset_apply_v2_strm(tls *libc.TLS, db uintptr, xInput uintptr, pIn uintptr, xFilter uintptr, xConflict uintptr, pCtx uintptr, ppRebase uintptr, pnRebase uintptr, flags int32) int32 { /* sqlite3.c:211497:16: */
+func Xsqlite3changeset_apply_v2_strm(tls *libc.TLS, db uintptr, xInput uintptr, pIn uintptr, xFilter uintptr, xConflict uintptr, pCtx uintptr, ppRebase uintptr, pnRebase uintptr, flags int32) int32 { /* sqlite3.c:213297:16: */
bp := tls.Alloc(4)
defer tls.Free(4)
// var pIter uintptr at bp, 4
// Iterator to skip through changeset
- var bInverse int32 = libc.BoolInt32(!(!((flags & SQLITE_CHANGESETAPPLY_INVERT) != 0)))
+ var bInverse int32 = libc.BoolInt32(!!(flags&SQLITE_CHANGESETAPPLY_INVERT != 0))
var rc int32 = sessionChangesetStart(tls, bp /* &pIter */, xInput, pIn, 0, uintptr(0), bInverse, 1)
if rc == SQLITE_OK {
rc = sessionChangesetApply(tls,
@@ -170142,7 +172466,7 @@ func Xsqlite3changeset_apply_v2_strm(tls *libc.TLS, db uintptr, xInput uintptr,
return rc
}
-func Xsqlite3changeset_apply_strm(tls *libc.TLS, db uintptr, xInput uintptr, pIn uintptr, xFilter uintptr, xConflict uintptr, pCtx uintptr) int32 { /* sqlite3.c:211524:16: */
+func Xsqlite3changeset_apply_strm(tls *libc.TLS, db uintptr, xInput uintptr, pIn uintptr, xFilter uintptr, xConflict uintptr, pCtx uintptr) int32 { /* sqlite3.c:213324:16: */
return Xsqlite3changeset_apply_v2_strm(tls,
db, xInput, pIn, xFilter, xConflict, pCtx, uintptr(0), uintptr(0), 0)
}
@@ -170150,7 +172474,7 @@ func Xsqlite3changeset_apply_strm(tls *libc.TLS, db uintptr, xInput uintptr, pIn
// This function is called to merge two changes to the same row together as
// part of an sqlite3changeset_concat() operation. A new change object is
// allocated and a pointer to it stored in *ppNew.
-func sessionChangeMerge(tls *libc.TLS, pTab uintptr, bRebase int32, bPatchset int32, pExist uintptr, op2 int32, bIndirect int32, aRec uintptr, nRec int32, ppNew uintptr) int32 { /* sqlite3.c:211558:12: */
+func sessionChangeMerge(tls *libc.TLS, pTab uintptr, bRebase int32, bPatchset int32, pExist uintptr, op2 int32, bIndirect int32, aRec uintptr, nRec int32, ppNew uintptr) int32 { /* sqlite3.c:213358:12: */
bp := tls.Alloc(16)
defer tls.Free(16)
@@ -170158,15 +172482,15 @@ func sessionChangeMerge(tls *libc.TLS, pTab uintptr, bRebase int32, bPatchset in
var rc int32 = SQLITE_OK
if !(pExist != 0) {
- pNew = Xsqlite3_malloc64(tls, (uint64(uint32(unsafe.Sizeof(SessionChange{})) + uint32(nRec))))
+ pNew = Xsqlite3_malloc64(tls, uint64(uint32(unsafe.Sizeof(SessionChange{}))+uint32(nRec)))
if !(pNew != 0) {
return SQLITE_NOMEM
}
libc.Xmemset(tls, pNew, 0, uint32(unsafe.Sizeof(SessionChange{})))
(*SessionChange)(unsafe.Pointer(pNew)).Fop = U8(op2)
(*SessionChange)(unsafe.Pointer(pNew)).FbIndirect = U8(bIndirect)
- (*SessionChange)(unsafe.Pointer(pNew)).FaRecord = (pNew + 1*20)
- if (bIndirect == 0) || (bRebase == 0) {
+ (*SessionChange)(unsafe.Pointer(pNew)).FaRecord = pNew + 1*20
+ if bIndirect == 0 || bRebase == 0 {
(*SessionChange)(unsafe.Pointer(pNew)).FnRecord = nRec
libc.Xmemcpy(tls, (*SessionChange)(unsafe.Pointer(pNew)).FaRecord, aRec, uint32(nRec))
} else {
@@ -170185,13 +172509,13 @@ func sessionChangeMerge(tls *libc.TLS, pTab uintptr, bRebase int32, bPatchset in
}
pIn += uintptr(nIn)
}
- (*SessionChange)(unsafe.Pointer(pNew)).FnRecord = ((int32(pOut) - int32((*SessionChange)(unsafe.Pointer(pNew)).FaRecord)) / 1)
+ (*SessionChange)(unsafe.Pointer(pNew)).FnRecord = (int32(pOut) - int32((*SessionChange)(unsafe.Pointer(pNew)).FaRecord)) / 1
}
} else if bRebase != 0 {
- if (int32((*SessionChange)(unsafe.Pointer(pExist)).Fop) == SQLITE_DELETE) && ((*SessionChange)(unsafe.Pointer(pExist)).FbIndirect != 0) {
+ if int32((*SessionChange)(unsafe.Pointer(pExist)).Fop) == SQLITE_DELETE && (*SessionChange)(unsafe.Pointer(pExist)).FbIndirect != 0 {
*(*uintptr)(unsafe.Pointer(ppNew)) = pExist
} else {
- var nByte Sqlite3_int64 = (Sqlite3_int64((uint32(nRec + (*SessionChange)(unsafe.Pointer(pExist)).FnRecord)) + uint32(unsafe.Sizeof(SessionChange{}))))
+ var nByte Sqlite3_int64 = Sqlite3_int64(uint32(nRec+(*SessionChange)(unsafe.Pointer(pExist)).FnRecord) + uint32(unsafe.Sizeof(SessionChange{})))
pNew = Xsqlite3_malloc64(tls, uint64(nByte))
if pNew == uintptr(0) {
rc = SQLITE_NOMEM
@@ -170202,14 +172526,14 @@ func sessionChangeMerge(tls *libc.TLS, pTab uintptr, bRebase int32, bPatchset in
var pOut uintptr
libc.Xmemset(tls, pNew, 0, uint32(nByte))
- (*SessionChange)(unsafe.Pointer(pNew)).FbIndirect = (U8(libc.Bool32((bIndirect != 0) || ((*SessionChange)(unsafe.Pointer(pExist)).FbIndirect != 0))))
+ (*SessionChange)(unsafe.Pointer(pNew)).FbIndirect = U8(libc.Bool32(bIndirect != 0 || (*SessionChange)(unsafe.Pointer(pExist)).FbIndirect != 0))
(*SessionChange)(unsafe.Pointer(pNew)).Fop = U8(op2)
- pOut = libc.AssignPtrUintptr(pNew+12 /* &.aRecord */, (pNew + 1*20))
+ pOut = libc.AssignPtrUintptr(pNew+12, pNew+1*20)
for i = 0; i < (*SessionTable)(unsafe.Pointer(pTab)).FnCol; i++ {
var n1 int32 = sessionSerialLen(tls, a1)
var n2 int32 = sessionSerialLen(tls, a2)
- if (int32(*(*U8)(unsafe.Pointer(a1))) == 0xFF) || ((int32(*(*U8)(unsafe.Pointer((*SessionTable)(unsafe.Pointer(pTab)).FabPK + uintptr(i)))) == 0) && (bIndirect != 0)) {
+ if int32(*(*U8)(unsafe.Pointer(a1))) == 0xFF || int32(*(*U8)(unsafe.Pointer((*SessionTable)(unsafe.Pointer(pTab)).FabPK + uintptr(i)))) == 0 && bIndirect != 0 {
*(*U8)(unsafe.Pointer(libc.PostIncUintptr(&pOut, 1))) = U8(0xFF)
} else if int32(*(*U8)(unsafe.Pointer(a2))) == 0 {
libc.Xmemcpy(tls, pOut, a1, uint32(n1))
@@ -170221,7 +172545,7 @@ func sessionChangeMerge(tls *libc.TLS, pTab uintptr, bRebase int32, bPatchset in
a1 += uintptr(n1)
a2 += uintptr(n2)
}
- (*SessionChange)(unsafe.Pointer(pNew)).FnRecord = ((int32(pOut) - int32((*SessionChange)(unsafe.Pointer(pNew)).FaRecord)) / 1)
+ (*SessionChange)(unsafe.Pointer(pNew)).FnRecord = (int32(pOut) - int32((*SessionChange)(unsafe.Pointer(pNew)).FaRecord)) / 1
}
Xsqlite3_free(tls, pExist)
}
@@ -170239,12 +172563,12 @@ func sessionChangeMerge(tls *libc.TLS, pTab uintptr, bRebase int32, bPatchset in
// op1=DELETE, op2=INSERT -> UPDATE.
// op1=DELETE, op2=UPDATE -> Unsupported. Discard op2.
// op1=DELETE, op2=DELETE -> Unsupported. Discard op2.
- if ((((op1 == SQLITE_INSERT) && (op2 == SQLITE_INSERT)) ||
- ((op1 == SQLITE_UPDATE) && (op2 == SQLITE_INSERT))) ||
- ((op1 == SQLITE_DELETE) && (op2 == SQLITE_UPDATE))) ||
- ((op1 == SQLITE_DELETE) && (op2 == SQLITE_DELETE)) {
+ if op1 == SQLITE_INSERT && op2 == SQLITE_INSERT ||
+ op1 == SQLITE_UPDATE && op2 == SQLITE_INSERT ||
+ op1 == SQLITE_DELETE && op2 == SQLITE_UPDATE ||
+ op1 == SQLITE_DELETE && op2 == SQLITE_DELETE {
pNew = pExist
- } else if (op1 == SQLITE_INSERT) && (op2 == SQLITE_DELETE) {
+ } else if op1 == SQLITE_INSERT && op2 == SQLITE_DELETE {
Xsqlite3_free(tls, pExist)
} else {
@@ -170255,15 +172579,15 @@ func sessionChangeMerge(tls *libc.TLS, pTab uintptr, bRebase int32, bPatchset in
// Allocate a new SessionChange object. Ensure that the aRecord[]
// buffer of the new object is large enough to hold any record that
// may be generated by combining the input records.
- nByte = (Sqlite3_int64((uint32(unsafe.Sizeof(SessionChange{})) + uint32((*SessionChange)(unsafe.Pointer(pExist)).FnRecord)) + uint32(nRec)))
+ nByte = Sqlite3_int64(uint32(unsafe.Sizeof(SessionChange{})) + uint32((*SessionChange)(unsafe.Pointer(pExist)).FnRecord) + uint32(nRec))
pNew = Xsqlite3_malloc64(tls, uint64(nByte))
if !(pNew != 0) {
Xsqlite3_free(tls, pExist)
return SQLITE_NOMEM
}
libc.Xmemset(tls, pNew, 0, uint32(unsafe.Sizeof(SessionChange{})))
- (*SessionChange)(unsafe.Pointer(pNew)).FbIndirect = (U8(libc.Bool32((bIndirect != 0) && ((*SessionChange)(unsafe.Pointer(pExist)).FbIndirect != 0))))
- *(*uintptr)(unsafe.Pointer(bp + 4 /* aCsr */)) = libc.AssignPtrUintptr(pNew+12 /* &.aRecord */, (pNew + 1*20))
+ (*SessionChange)(unsafe.Pointer(pNew)).FbIndirect = U8(libc.Bool32(bIndirect != 0 && (*SessionChange)(unsafe.Pointer(pExist)).FbIndirect != 0))
+ *(*uintptr)(unsafe.Pointer(bp + 4 /* aCsr */)) = libc.AssignPtrUintptr(pNew+12, pNew+1*20)
if op1 == SQLITE_INSERT { // INSERT + UPDATE
*(*uintptr)(unsafe.Pointer(bp /* a1 */)) = aRec
@@ -170280,7 +172604,7 @@ func sessionChangeMerge(tls *libc.TLS, pTab uintptr, bRebase int32, bPatchset in
libc.Xmemcpy(tls, *(*uintptr)(unsafe.Pointer(bp + 4 /* aCsr */)), aRec, uint32(nRec))
*(*uintptr)(unsafe.Pointer(bp + 4 /* aCsr */)) += uintptr(nRec)
} else {
- if 0 == sessionMergeUpdate(tls, bp+4 /* &aCsr */, pTab, bPatchset, aExist, uintptr(0), aRec, uintptr(0)) {
+ if 0 == sessionMergeUpdate(tls, bp+4, pTab, bPatchset, aExist, uintptr(0), aRec, uintptr(0)) {
Xsqlite3_free(tls, pNew)
pNew = uintptr(0)
}
@@ -170294,7 +172618,7 @@ func sessionChangeMerge(tls *libc.TLS, pTab uintptr, bRebase int32, bPatchset in
sessionSkipRecord(tls, bp+12 /* &a2 */, (*SessionTable)(unsafe.Pointer(pTab)).FnCol)
}
(*SessionChange)(unsafe.Pointer(pNew)).Fop = U8(SQLITE_UPDATE)
- if 0 == sessionMergeUpdate(tls, bp+4 /* &aCsr */, pTab, bPatchset, aRec, aExist, *(*uintptr)(unsafe.Pointer(bp + 8 /* a1 */)), *(*uintptr)(unsafe.Pointer(bp + 12 /* a2 */))) {
+ if 0 == sessionMergeUpdate(tls, bp+4, pTab, bPatchset, aRec, aExist, *(*uintptr)(unsafe.Pointer(bp + 8)), *(*uintptr)(unsafe.Pointer(bp + 12))) {
Xsqlite3_free(tls, pNew)
pNew = uintptr(0)
}
@@ -170310,7 +172634,7 @@ func sessionChangeMerge(tls *libc.TLS, pTab uintptr, bRebase int32, bPatchset in
}
if pNew != 0 {
- (*SessionChange)(unsafe.Pointer(pNew)).FnRecord = ((int32(*(*uintptr)(unsafe.Pointer(bp + 4 /* aCsr */))) - int32((*SessionChange)(unsafe.Pointer(pNew)).FaRecord)) / 1)
+ (*SessionChange)(unsafe.Pointer(pNew)).FnRecord = (int32(*(*uintptr)(unsafe.Pointer(bp + 4))) - int32((*SessionChange)(unsafe.Pointer(pNew)).FaRecord)) / 1
}
Xsqlite3_free(tls, pExist)
}
@@ -170322,7 +172646,7 @@ func sessionChangeMerge(tls *libc.TLS, pTab uintptr, bRebase int32, bPatchset in
// Add all changes in the changeset traversed by the iterator passed as
// the first argument to the changegroup hash tables.
-func sessionChangesetToHash(tls *libc.TLS, pIter uintptr, pGrp uintptr, bRebase int32) int32 { /* sqlite3.c:211740:12: */
+func sessionChangesetToHash(tls *libc.TLS, pIter uintptr, pGrp uintptr, bRebase int32) int32 { /* sqlite3.c:213540:12: */
bp := tls.Alloc(32)
defer tls.Free(32)
@@ -170333,7 +172657,7 @@ func sessionChangesetToHash(tls *libc.TLS, pIter uintptr, pGrp uintptr, bRebase
var rc int32 = SQLITE_OK
var pTab uintptr = uintptr(0)
- for SQLITE_ROW == sessionChangesetNext(tls, pIter, bp /* &aRec */, bp+4 /* &nRec */, uintptr(0)) {
+ for SQLITE_ROW == sessionChangesetNext(tls, pIter, bp, bp+4, uintptr(0)) {
// var zNew uintptr at bp+8, 4
// var nCol int32 at bp+12, 4
@@ -170356,40 +172680,40 @@ func sessionChangesetToHash(tls *libc.TLS, pIter uintptr, pGrp uintptr, bRebase
}
Xsqlite3changeset_op(tls, pIter, bp+8 /* &zNew */, bp+12 /* &nCol */, bp+16 /* &op */, bp+20 /* &bIndirect */)
- if !(pTab != 0) || (Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(bp + 8 /* zNew */)), (*SessionTable)(unsafe.Pointer(pTab)).FzName) != 0) {
+ if !(pTab != 0) || Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(bp + 8)), (*SessionTable)(unsafe.Pointer(pTab)).FzName) != 0 {
// Search the list for a matching table
var nNew int32 = int32(libc.Xstrlen(tls, *(*uintptr)(unsafe.Pointer(bp + 8 /* zNew */))))
// var abPK uintptr at bp+24, 4
Xsqlite3changeset_pk(tls, pIter, bp+24 /* &abPK */, uintptr(0))
for pTab = (*Sqlite3_changegroup)(unsafe.Pointer(pGrp)).FpList; pTab != 0; pTab = (*SessionTable)(unsafe.Pointer(pTab)).FpNext {
- if 0 == Xsqlite3_strnicmp(tls, (*SessionTable)(unsafe.Pointer(pTab)).FzName, *(*uintptr)(unsafe.Pointer(bp + 8 /* zNew */)), (nNew+1)) {
+ if 0 == Xsqlite3_strnicmp(tls, (*SessionTable)(unsafe.Pointer(pTab)).FzName, *(*uintptr)(unsafe.Pointer(bp + 8)), nNew+1) {
break
}
}
if !(pTab != 0) {
var ppTab uintptr
- pTab = Xsqlite3_malloc64(tls, (uint64(((uint32(unsafe.Sizeof(SessionTable{})) + uint32(*(*int32)(unsafe.Pointer(bp + 12 /* nCol */)))) + uint32(nNew)) + uint32(1))))
+ pTab = Xsqlite3_malloc64(tls, uint64(uint32(unsafe.Sizeof(SessionTable{}))+uint32(*(*int32)(unsafe.Pointer(bp + 12)))+uint32(nNew)+uint32(1)))
if !(pTab != 0) {
rc = SQLITE_NOMEM
break
}
libc.Xmemset(tls, pTab, 0, uint32(unsafe.Sizeof(SessionTable{})))
(*SessionTable)(unsafe.Pointer(pTab)).FnCol = *(*int32)(unsafe.Pointer(bp + 12 /* nCol */))
- (*SessionTable)(unsafe.Pointer(pTab)).FabPK = (pTab + 1*36)
+ (*SessionTable)(unsafe.Pointer(pTab)).FabPK = pTab + 1*36
libc.Xmemcpy(tls, (*SessionTable)(unsafe.Pointer(pTab)).FabPK, *(*uintptr)(unsafe.Pointer(bp + 24 /* abPK */)), uint32(*(*int32)(unsafe.Pointer(bp + 12 /* nCol */))))
- (*SessionTable)(unsafe.Pointer(pTab)).FzName = ((*SessionTable)(unsafe.Pointer(pTab)).FabPK + uintptr(*(*int32)(unsafe.Pointer(bp + 12 /* nCol */))))
- libc.Xmemcpy(tls, (*SessionTable)(unsafe.Pointer(pTab)).FzName, *(*uintptr)(unsafe.Pointer(bp + 8 /* zNew */)), (uint32(nNew + 1)))
+ (*SessionTable)(unsafe.Pointer(pTab)).FzName = (*SessionTable)(unsafe.Pointer(pTab)).FabPK + uintptr(*(*int32)(unsafe.Pointer(bp + 12)))
+ libc.Xmemcpy(tls, (*SessionTable)(unsafe.Pointer(pTab)).FzName, *(*uintptr)(unsafe.Pointer(bp + 8 /* zNew */)), uint32(nNew+1))
// The new object must be linked on to the end of the list, not
// simply added to the start of it. This is to ensure that the
// tables within the output of sqlite3changegroup_output() are in
// the right order.
- for ppTab = (pGrp + 8 /* &.pList */); *(*uintptr)(unsafe.Pointer(ppTab)) != 0; ppTab = (*(*uintptr)(unsafe.Pointer(ppTab)) /* &.pNext */) {
+ for ppTab = pGrp + 8; *(*uintptr)(unsafe.Pointer(ppTab)) != 0; ppTab = *(*uintptr)(unsafe.Pointer(ppTab)) {
}
*(*uintptr)(unsafe.Pointer(ppTab)) = pTab
- } else if ((*SessionTable)(unsafe.Pointer(pTab)).FnCol != *(*int32)(unsafe.Pointer(bp + 12 /* nCol */))) || (libc.Xmemcmp(tls, (*SessionTable)(unsafe.Pointer(pTab)).FabPK, *(*uintptr)(unsafe.Pointer(bp + 24 /* abPK */)), uint32(*(*int32)(unsafe.Pointer(bp + 12 /* nCol */)))) != 0) {
+ } else if (*SessionTable)(unsafe.Pointer(pTab)).FnCol != *(*int32)(unsafe.Pointer(bp + 12)) || libc.Xmemcmp(tls, (*SessionTable)(unsafe.Pointer(pTab)).FabPK, *(*uintptr)(unsafe.Pointer(bp + 24)), uint32(*(*int32)(unsafe.Pointer(bp + 12)))) != 0 {
rc = SQLITE_SCHEMA
break
}
@@ -170400,18 +172724,18 @@ func sessionChangesetToHash(tls *libc.TLS, pIter uintptr, pGrp uintptr, bRebase
break
}
iHash = int32(sessionChangeHash(tls,
- pTab, (libc.Bool32(((*Sqlite3_changeset_iter)(unsafe.Pointer(pIter)).FbPatchset != 0) && (*(*int32)(unsafe.Pointer(bp + 16 /* op */)) == SQLITE_DELETE))), *(*uintptr)(unsafe.Pointer(bp /* aRec */)), (*SessionTable)(unsafe.Pointer(pTab)).FnChange))
+ pTab, libc.Bool32((*Sqlite3_changeset_iter)(unsafe.Pointer(pIter)).FbPatchset != 0 && *(*int32)(unsafe.Pointer(bp + 16)) == SQLITE_DELETE), *(*uintptr)(unsafe.Pointer(bp /* aRec */)), (*SessionTable)(unsafe.Pointer(pTab)).FnChange))
// Search for existing entry. If found, remove it from the hash table.
// Code below may link it back in.
- for pp = ((*SessionTable)(unsafe.Pointer(pTab)).FapChange + uintptr(iHash)*4); *(*uintptr)(unsafe.Pointer(pp)) != 0; pp = (*(*uintptr)(unsafe.Pointer(pp)) + 16 /* &.pNext */) {
+ for pp = (*SessionTable)(unsafe.Pointer(pTab)).FapChange + uintptr(iHash)*4; *(*uintptr)(unsafe.Pointer(pp)) != 0; pp = *(*uintptr)(unsafe.Pointer(pp)) + 16 {
var bPkOnly1 int32 = 0
var bPkOnly2 int32 = 0
if (*Sqlite3_changeset_iter)(unsafe.Pointer(pIter)).FbPatchset != 0 {
- bPkOnly1 = (libc.Bool32(int32((*SessionChange)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(pp))))).Fop) == SQLITE_DELETE))
- bPkOnly2 = (libc.Bool32(*(*int32)(unsafe.Pointer(bp + 16 /* op */)) == SQLITE_DELETE))
+ bPkOnly1 = libc.Bool32(int32((*SessionChange)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pp)))).Fop) == SQLITE_DELETE)
+ bPkOnly2 = libc.Bool32(*(*int32)(unsafe.Pointer(bp + 16)) == SQLITE_DELETE)
}
- if sessionChangeEqual(tls, pTab, bPkOnly1, (*SessionChange)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pp)))).FaRecord, bPkOnly2, *(*uintptr)(unsafe.Pointer(bp /* aRec */))) != 0 {
+ if sessionChangeEqual(tls, pTab, bPkOnly1, (*SessionChange)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pp)))).FaRecord, bPkOnly2, *(*uintptr)(unsafe.Pointer(bp))) != 0 {
pExist = *(*uintptr)(unsafe.Pointer(pp))
*(*uintptr)(unsafe.Pointer(pp)) = (*SessionChange)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pp)))).FpNext
(*SessionTable)(unsafe.Pointer(pTab)).FnEntry--
@@ -170424,7 +172748,7 @@ func sessionChangesetToHash(tls *libc.TLS, pIter uintptr, pGrp uintptr, bRebase
if rc != 0 {
break
}
- if *(*uintptr)(unsafe.Pointer(bp + 28 /* pChange */)) != 0 {
+ if *(*uintptr)(unsafe.Pointer(bp + 28)) != 0 {
(*SessionChange)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 28 /* pChange */)))).FpNext = *(*uintptr)(unsafe.Pointer((*SessionTable)(unsafe.Pointer(pTab)).FapChange + uintptr(iHash)*4))
*(*uintptr)(unsafe.Pointer((*SessionTable)(unsafe.Pointer(pTab)).FapChange + uintptr(iHash)*4)) = *(*uintptr)(unsafe.Pointer(bp + 28 /* pChange */))
(*SessionTable)(unsafe.Pointer(pTab)).FnEntry++
@@ -170453,7 +172777,7 @@ func sessionChangesetToHash(tls *libc.TLS, pIter uintptr, pGrp uintptr, bRebase
// If successful, SQLITE_OK is returned. Or, if an error occurs, an SQLite
// error code. If an error occurs and xOutput is NULL, (*ppOut) and (*pnOut)
// are both set to 0 before returning.
-func sessionChangegroupOutput(tls *libc.TLS, pGrp uintptr, xOutput uintptr, pOut uintptr, pnOut uintptr, ppOut uintptr) int32 { /* sqlite3.c:211863:12: */
+func sessionChangegroupOutput(tls *libc.TLS, pGrp uintptr, xOutput uintptr, pOut uintptr, pnOut uintptr, ppOut uintptr) int32 { /* sqlite3.c:213663:12: */
bp := tls.Alloc(16)
defer tls.Free(16)
@@ -170463,7 +172787,7 @@ func sessionChangegroupOutput(tls *libc.TLS, pGrp uintptr, xOutput uintptr, pOut
// Create the serialized output changeset based on the contents of the
// hash tables attached to the SessionTable objects in list p->pList.
- for pTab = (*Sqlite3_changegroup)(unsafe.Pointer(pGrp)).FpList; (*(*int32)(unsafe.Pointer(bp + 12 /* rc */)) == SQLITE_OK) && (pTab != 0); pTab = (*SessionTable)(unsafe.Pointer(pTab)).FpNext {
+ for pTab = (*Sqlite3_changegroup)(unsafe.Pointer(pGrp)).FpList; *(*int32)(unsafe.Pointer(bp + 12 /* rc */)) == SQLITE_OK && pTab != 0; pTab = (*SessionTable)(unsafe.Pointer(pTab)).FpNext {
var i int32
if (*SessionTable)(unsafe.Pointer(pTab)).FnEntry == 0 {
continue
@@ -170476,7 +172800,7 @@ func sessionChangegroupOutput(tls *libc.TLS, pGrp uintptr, xOutput uintptr, pOut
sessionAppendByte(tls, bp /* &buf */, (*SessionChange)(unsafe.Pointer(p)).Fop, bp+12 /* &rc */)
sessionAppendByte(tls, bp /* &buf */, (*SessionChange)(unsafe.Pointer(p)).FbIndirect, bp+12 /* &rc */)
sessionAppendBlob(tls, bp /* &buf */, (*SessionChange)(unsafe.Pointer(p)).FaRecord, (*SessionChange)(unsafe.Pointer(p)).FnRecord, bp+12 /* &rc */)
- if ((*(*int32)(unsafe.Pointer(bp + 12 /* rc */)) == SQLITE_OK) && (xOutput != 0)) && ((*SessionBuffer)(unsafe.Pointer(bp /* &buf */)).FnBuf >= sessions_strm_chunk_size) {
+ if *(*int32)(unsafe.Pointer(bp + 12)) == SQLITE_OK && xOutput != 0 && (*SessionBuffer)(unsafe.Pointer(bp)).FnBuf >= sessions_strm_chunk_size {
*(*int32)(unsafe.Pointer(bp + 12 /* rc */)) = (*struct {
f func(*libc.TLS, uintptr, uintptr, int32) int32
})(unsafe.Pointer(&struct{ uintptr }{xOutput})).f(tls, pOut, (*SessionBuffer)(unsafe.Pointer(bp /* &buf */)).FaBuf, (*SessionBuffer)(unsafe.Pointer(bp /* &buf */)).FnBuf)
@@ -170486,16 +172810,18 @@ func sessionChangegroupOutput(tls *libc.TLS, pGrp uintptr, xOutput uintptr, pOut
}
}
- if *(*int32)(unsafe.Pointer(bp + 12 /* rc */)) == SQLITE_OK {
+ if *(*int32)(unsafe.Pointer(bp + 12)) == SQLITE_OK {
if xOutput != 0 {
- if (*SessionBuffer)(unsafe.Pointer(bp /* &buf */)).FnBuf > 0 {
+ if (*SessionBuffer)(unsafe.Pointer(bp)).FnBuf > 0 {
*(*int32)(unsafe.Pointer(bp + 12 /* rc */)) = (*struct {
f func(*libc.TLS, uintptr, uintptr, int32) int32
})(unsafe.Pointer(&struct{ uintptr }{xOutput})).f(tls, pOut, (*SessionBuffer)(unsafe.Pointer(bp /* &buf */)).FaBuf, (*SessionBuffer)(unsafe.Pointer(bp /* &buf */)).FnBuf)
}
- } else {
+ } else if ppOut != 0 {
*(*uintptr)(unsafe.Pointer(ppOut)) = (*SessionBuffer)(unsafe.Pointer(bp /* &buf */)).FaBuf
- *(*int32)(unsafe.Pointer(pnOut)) = (*SessionBuffer)(unsafe.Pointer(bp /* &buf */)).FnBuf
+ if pnOut != 0 {
+ *(*int32)(unsafe.Pointer(pnOut)) = (*SessionBuffer)(unsafe.Pointer(bp /* &buf */)).FnBuf
+ }
(*SessionBuffer)(unsafe.Pointer(bp /* &buf */)).FaBuf = uintptr(0)
}
}
@@ -170505,7 +172831,7 @@ func sessionChangegroupOutput(tls *libc.TLS, pGrp uintptr, xOutput uintptr, pOut
}
// Allocate a new, empty, sqlite3_changegroup.
-func Xsqlite3changegroup_new(tls *libc.TLS, pp uintptr) int32 { /* sqlite3.c:211914:16: */
+func Xsqlite3changegroup_new(tls *libc.TLS, pp uintptr) int32 { /* sqlite3.c:213714:16: */
var rc int32 = SQLITE_OK // Return code
var p uintptr // New object
p = Xsqlite3_malloc(tls, int32(unsafe.Sizeof(Sqlite3_changegroup{})))
@@ -170520,7 +172846,7 @@ func Xsqlite3changegroup_new(tls *libc.TLS, pp uintptr) int32 { /* sqlite3.c:211
// Add the changeset currently stored in buffer pData, size nData bytes,
// to changeset-group p.
-func Xsqlite3changegroup_add(tls *libc.TLS, pGrp uintptr, nData int32, pData uintptr) int32 { /* sqlite3.c:211931:16: */
+func Xsqlite3changegroup_add(tls *libc.TLS, pGrp uintptr, nData int32, pData uintptr) int32 { /* sqlite3.c:213731:16: */
bp := tls.Alloc(4)
defer tls.Free(4)
@@ -170538,12 +172864,12 @@ func Xsqlite3changegroup_add(tls *libc.TLS, pGrp uintptr, nData int32, pData uin
// Obtain a buffer containing a changeset representing the concatenation
// of all changesets added to the group so far.
-func Xsqlite3changegroup_output(tls *libc.TLS, pGrp uintptr, pnData uintptr, ppData uintptr) int32 { /* sqlite3.c:211947:16: */
+func Xsqlite3changegroup_output(tls *libc.TLS, pGrp uintptr, pnData uintptr, ppData uintptr) int32 { /* sqlite3.c:213747:16: */
return sessionChangegroupOutput(tls, pGrp, uintptr(0), uintptr(0), pnData, ppData)
}
// Streaming versions of changegroup_add().
-func Xsqlite3changegroup_add_strm(tls *libc.TLS, pGrp uintptr, xInput uintptr, pIn uintptr) int32 { /* sqlite3.c:211958:16: */
+func Xsqlite3changegroup_add_strm(tls *libc.TLS, pGrp uintptr, xInput uintptr, pIn uintptr) int32 { /* sqlite3.c:213758:16: */
bp := tls.Alloc(4)
defer tls.Free(4)
@@ -170560,12 +172886,12 @@ func Xsqlite3changegroup_add_strm(tls *libc.TLS, pGrp uintptr, xInput uintptr, p
}
// Streaming versions of changegroup_output().
-func Xsqlite3changegroup_output_strm(tls *libc.TLS, pGrp uintptr, xOutput uintptr, pOut uintptr) int32 { /* sqlite3.c:211977:16: */
+func Xsqlite3changegroup_output_strm(tls *libc.TLS, pGrp uintptr, xOutput uintptr, pOut uintptr) int32 { /* sqlite3.c:213777:16: */
return sessionChangegroupOutput(tls, pGrp, xOutput, pOut, uintptr(0), uintptr(0))
}
// Delete a changegroup object.
-func Xsqlite3changegroup_delete(tls *libc.TLS, pGrp uintptr) { /* sqlite3.c:211988:17: */
+func Xsqlite3changegroup_delete(tls *libc.TLS, pGrp uintptr) { /* sqlite3.c:213788:17: */
if pGrp != 0 {
sessionDeleteTable(tls, uintptr(0), (*Sqlite3_changegroup)(unsafe.Pointer(pGrp)).FpList)
Xsqlite3_free(tls, pGrp)
@@ -170573,7 +172899,7 @@ func Xsqlite3changegroup_delete(tls *libc.TLS, pGrp uintptr) { /* sqlite3.c:2119
}
// Combine two changesets together.
-func Xsqlite3changeset_concat(tls *libc.TLS, nLeft int32, pLeft uintptr, nRight int32, pRight uintptr, pnOut uintptr, ppOut uintptr) int32 { /* sqlite3.c:211998:16: */
+func Xsqlite3changeset_concat(tls *libc.TLS, nLeft int32, pLeft uintptr, nRight int32, pRight uintptr, pnOut uintptr, ppOut uintptr) int32 { /* sqlite3.c:213798:16: */
bp := tls.Alloc(4)
defer tls.Free(4)
@@ -170597,7 +172923,7 @@ func Xsqlite3changeset_concat(tls *libc.TLS, nLeft int32, pLeft uintptr, nRight
}
// Streaming version of sqlite3changeset_concat().
-func Xsqlite3changeset_concat_strm(tls *libc.TLS, xInputA uintptr, pInA uintptr, xInputB uintptr, pInB uintptr, xOutput uintptr, pOut uintptr) int32 { /* sqlite3.c:212027:16: */
+func Xsqlite3changeset_concat_strm(tls *libc.TLS, xInputA uintptr, pInA uintptr, xInputB uintptr, pInB uintptr, xOutput uintptr, pOut uintptr) int32 { /* sqlite3.c:213827:16: */
bp := tls.Alloc(4)
defer tls.Free(4)
@@ -170624,15 +172950,15 @@ func Xsqlite3changeset_concat_strm(tls *libc.TLS, xInputA uintptr, pInA uintptr,
// fields in size. This function appends an nCol sessions module
// record to buffer pBuf that is a copy of a1, except that for
// each field that is undefined in a1[], swap in the field from a2[].
-func sessionAppendRecordMerge(tls *libc.TLS, pBuf uintptr, nCol int32, a1 uintptr, n1 int32, a2 uintptr, n2 int32, pRc uintptr) { /* sqlite3.c:212066:13: */
- sessionBufferGrow(tls, pBuf, (int64(n1 + n2)), pRc)
+func sessionAppendRecordMerge(tls *libc.TLS, pBuf uintptr, nCol int32, a1 uintptr, n1 int32, a2 uintptr, n2 int32, pRc uintptr) { /* sqlite3.c:213866:13: */
+ sessionBufferGrow(tls, pBuf, int64(n1+n2), pRc)
if *(*int32)(unsafe.Pointer(pRc)) == SQLITE_OK {
var i int32
- var pOut uintptr = ((*SessionBuffer)(unsafe.Pointer(pBuf)).FaBuf + uintptr((*SessionBuffer)(unsafe.Pointer(pBuf)).FnBuf))
+ var pOut uintptr = (*SessionBuffer)(unsafe.Pointer(pBuf)).FaBuf + uintptr((*SessionBuffer)(unsafe.Pointer(pBuf)).FnBuf)
for i = 0; i < nCol; i++ {
var nn1 int32 = sessionSerialLen(tls, a1)
var nn2 int32 = sessionSerialLen(tls, a2)
- if (int32(*(*U8)(unsafe.Pointer(a1))) == 0) || (int32(*(*U8)(unsafe.Pointer(a1))) == 0xFF) {
+ if int32(*(*U8)(unsafe.Pointer(a1))) == 0 || int32(*(*U8)(unsafe.Pointer(a1))) == 0xFF {
libc.Xmemcpy(tls, pOut, a2, uint32(nn2))
pOut += uintptr(nn2)
} else {
@@ -170643,7 +172969,7 @@ func sessionAppendRecordMerge(tls *libc.TLS, pBuf uintptr, nCol int32, a1 uintpt
a2 += uintptr(nn2)
}
- (*SessionBuffer)(unsafe.Pointer(pBuf)).FnBuf = ((int32(pOut) - int32((*SessionBuffer)(unsafe.Pointer(pBuf)).FaBuf)) / 1)
+ (*SessionBuffer)(unsafe.Pointer(pBuf)).FnBuf = (int32(pOut) - int32((*SessionBuffer)(unsafe.Pointer(pBuf)).FaBuf)) / 1
}
}
@@ -170665,11 +172991,11 @@ func sessionAppendRecordMerge(tls *libc.TLS, pBuf uintptr, nCol int32, a1 uintpt
// corresponding field in the rebase buffer is not "undefined" (0x00)
// or "replaced" (0xFF), the old.* value is replaced by the value
// in the rebase buffer.
-func sessionAppendPartialUpdate(tls *libc.TLS, pBuf uintptr, pIter uintptr, aRec uintptr, nRec int32, aChange uintptr, nChange int32, pRc uintptr) { /* sqlite3.c:212115:13: */
- sessionBufferGrow(tls, pBuf, (int64((2 + nRec) + nChange)), pRc)
+func sessionAppendPartialUpdate(tls *libc.TLS, pBuf uintptr, pIter uintptr, aRec uintptr, nRec int32, aChange uintptr, nChange int32, pRc uintptr) { /* sqlite3.c:213915:13: */
+ sessionBufferGrow(tls, pBuf, int64(2+nRec+nChange), pRc)
if *(*int32)(unsafe.Pointer(pRc)) == SQLITE_OK {
var bData int32 = 0
- var pOut uintptr = ((*SessionBuffer)(unsafe.Pointer(pBuf)).FaBuf + uintptr((*SessionBuffer)(unsafe.Pointer(pBuf)).FnBuf))
+ var pOut uintptr = (*SessionBuffer)(unsafe.Pointer(pBuf)).FaBuf + uintptr((*SessionBuffer)(unsafe.Pointer(pBuf)).FnBuf)
var i int32
var a1 uintptr = aRec
var a2 uintptr = aChange
@@ -170679,8 +173005,8 @@ func sessionAppendPartialUpdate(tls *libc.TLS, pBuf uintptr, pIter uintptr, aRec
for i = 0; i < (*Sqlite3_changeset_iter)(unsafe.Pointer(pIter)).FnCol; i++ {
var n1 int32 = sessionSerialLen(tls, a1)
var n2 int32 = sessionSerialLen(tls, a2)
- if (*(*U8)(unsafe.Pointer((*Sqlite3_changeset_iter)(unsafe.Pointer(pIter)).FabPK + uintptr(i))) != 0) || (int32(*(*U8)(unsafe.Pointer(a2))) == 0) {
- if !(int32(*(*U8)(unsafe.Pointer((*Sqlite3_changeset_iter)(unsafe.Pointer(pIter)).FabPK + uintptr(i)))) != 0) && (*(*U8)(unsafe.Pointer(a1)) != 0) {
+ if *(*U8)(unsafe.Pointer((*Sqlite3_changeset_iter)(unsafe.Pointer(pIter)).FabPK + uintptr(i))) != 0 || int32(*(*U8)(unsafe.Pointer(a2))) == 0 {
+ if !(int32(*(*U8)(unsafe.Pointer((*Sqlite3_changeset_iter)(unsafe.Pointer(pIter)).FabPK + uintptr(i)))) != 0) && *(*U8)(unsafe.Pointer(a1)) != 0 {
bData = 1
}
libc.Xmemcpy(tls, pOut, a1, uint32(n1))
@@ -170700,7 +173026,7 @@ func sessionAppendPartialUpdate(tls *libc.TLS, pBuf uintptr, pIter uintptr, aRec
for i = 0; i < (*Sqlite3_changeset_iter)(unsafe.Pointer(pIter)).FnCol; i++ {
var n1 int32 = sessionSerialLen(tls, a1)
var n2 int32 = sessionSerialLen(tls, a2)
- if (*(*U8)(unsafe.Pointer((*Sqlite3_changeset_iter)(unsafe.Pointer(pIter)).FabPK + uintptr(i))) != 0) || (int32(*(*U8)(unsafe.Pointer(a2))) != 0xFF) {
+ if *(*U8)(unsafe.Pointer((*Sqlite3_changeset_iter)(unsafe.Pointer(pIter)).FabPK + uintptr(i))) != 0 || int32(*(*U8)(unsafe.Pointer(a2))) != 0xFF {
libc.Xmemcpy(tls, pOut, a1, uint32(n1))
pOut += uintptr(n1)
} else {
@@ -170709,7 +173035,7 @@ func sessionAppendPartialUpdate(tls *libc.TLS, pBuf uintptr, pIter uintptr, aRec
a1 += uintptr(n1)
a2 += uintptr(n2)
}
- (*SessionBuffer)(unsafe.Pointer(pBuf)).FnBuf = ((int32(pOut) - int32((*SessionBuffer)(unsafe.Pointer(pBuf)).FaBuf)) / 1)
+ (*SessionBuffer)(unsafe.Pointer(pBuf)).FnBuf = (int32(pOut) - int32((*SessionBuffer)(unsafe.Pointer(pBuf)).FaBuf)) / 1
}
}
}
@@ -170727,7 +173053,7 @@ func sessionAppendPartialUpdate(tls *libc.TLS, pBuf uintptr, pIter uintptr, aRec
// If an error occurs, an SQLite error code is returned. If ppOut and
// pnOut are not NULL, then the two output parameters are set to 0 before
// returning.
-func sessionRebase(tls *libc.TLS, p uintptr, pIter uintptr, xOutput uintptr, pOut uintptr, pnOut uintptr, ppOut uintptr) int32 { /* sqlite3.c:212183:12: */
+func sessionRebase(tls *libc.TLS, p uintptr, pIter uintptr, xOutput uintptr, pOut uintptr, pnOut uintptr, ppOut uintptr) int32 { /* sqlite3.c:213983:12: */
bp := tls.Alloc(32)
defer tls.Free(32)
@@ -170738,11 +173064,11 @@ func sessionRebase(tls *libc.TLS, p uintptr, pIter uintptr, xOutput uintptr, pOu
var pTab uintptr = uintptr(0)
*(*SessionBuffer)(unsafe.Pointer(bp + 12 /* sOut */)) = SessionBuffer{}
- for SQLITE_ROW == sessionChangesetNext(tls, pIter, bp /* &aRec */, bp+4 /* &nRec */, bp+8 /* &bNew */) {
+ for SQLITE_ROW == sessionChangesetNext(tls, pIter, bp, bp+4, bp+8) {
var pChange uintptr = uintptr(0)
var bDone int32 = 0
- if *(*int32)(unsafe.Pointer(bp + 8 /* bNew */)) != 0 {
+ if *(*int32)(unsafe.Pointer(bp + 8)) != 0 {
var zTab uintptr = (*Sqlite3_changeset_iter)(unsafe.Pointer(pIter)).FzTab
for pTab = (*Sqlite3_rebaser)(unsafe.Pointer(p)).Fgrp.FpList; pTab != 0; pTab = (*SessionTable)(unsafe.Pointer(pTab)).FpNext {
if 0 == Xsqlite3_stricmp(tls, (*SessionTable)(unsafe.Pointer(pTab)).FzName, zTab) {
@@ -170765,14 +173091,14 @@ func sessionRebase(tls *libc.TLS, p uintptr, pIter uintptr, xOutput uintptr, pOu
}(), bp+24 /* &rc */)
sessionAppendVarint(tls, bp+12 /* &sOut */, (*Sqlite3_changeset_iter)(unsafe.Pointer(pIter)).FnCol, bp+24 /* &rc */)
sessionAppendBlob(tls, bp+12 /* &sOut */, (*Sqlite3_changeset_iter)(unsafe.Pointer(pIter)).FabPK, (*Sqlite3_changeset_iter)(unsafe.Pointer(pIter)).FnCol, bp+24 /* &rc */)
- sessionAppendBlob(tls, bp+12 /* &sOut */, (*Sqlite3_changeset_iter)(unsafe.Pointer(pIter)).FzTab, (int32(libc.Xstrlen(tls, (*Sqlite3_changeset_iter)(unsafe.Pointer(pIter)).FzTab)) + 1), bp+24 /* &rc */)
+ sessionAppendBlob(tls, bp+12 /* &sOut */, (*Sqlite3_changeset_iter)(unsafe.Pointer(pIter)).FzTab, int32(libc.Xstrlen(tls, (*Sqlite3_changeset_iter)(unsafe.Pointer(pIter)).FzTab))+1, bp+24 /* &rc */)
}
- if (pTab != 0) && (*(*int32)(unsafe.Pointer(bp + 24 /* rc */)) == SQLITE_OK) {
+ if pTab != 0 && *(*int32)(unsafe.Pointer(bp + 24)) == SQLITE_OK {
var iHash int32 = int32(sessionChangeHash(tls, pTab, 0, *(*uintptr)(unsafe.Pointer(bp /* aRec */)), (*SessionTable)(unsafe.Pointer(pTab)).FnChange))
for pChange = *(*uintptr)(unsafe.Pointer((*SessionTable)(unsafe.Pointer(pTab)).FapChange + uintptr(iHash)*4)); pChange != 0; pChange = (*SessionChange)(unsafe.Pointer(pChange)).FpNext {
- if sessionChangeEqual(tls, pTab, 0, *(*uintptr)(unsafe.Pointer(bp /* aRec */)), 0, (*SessionChange)(unsafe.Pointer(pChange)).FaRecord) != 0 {
+ if sessionChangeEqual(tls, pTab, 0, *(*uintptr)(unsafe.Pointer(bp)), 0, (*SessionChange)(unsafe.Pointer(pChange)).FaRecord) != 0 {
break
}
}
@@ -170803,7 +173129,7 @@ func sessionRebase(tls *libc.TLS, p uintptr, pIter uintptr, xOutput uintptr, pOu
sessionAppendByte(tls, bp+12 /* &sOut */, uint8(SQLITE_INSERT), bp+24 /* &rc */)
sessionAppendByte(tls, bp+12 /* &sOut */, uint8((*Sqlite3_changeset_iter)(unsafe.Pointer(pIter)).FbIndirect), bp+24 /* &rc */)
sessionAppendRecordMerge(tls, bp+12 /* &sOut */, (*Sqlite3_changeset_iter)(unsafe.Pointer(pIter)).FnCol,
- *(*uintptr)(unsafe.Pointer(bp + 28 /* pCsr */)), (*(*int32)(unsafe.Pointer(bp + 4 /* nRec */)) - ((int32(*(*uintptr)(unsafe.Pointer(bp + 28 /* pCsr */))) - int32(*(*uintptr)(unsafe.Pointer(bp /* aRec */)))) / 1)),
+ *(*uintptr)(unsafe.Pointer(bp + 28 /* pCsr */)), *(*int32)(unsafe.Pointer(bp + 4))-(int32(*(*uintptr)(unsafe.Pointer(bp + 28)))-int32(*(*uintptr)(unsafe.Pointer(bp))))/1,
(*SessionChange)(unsafe.Pointer(pChange)).FaRecord, (*SessionChange)(unsafe.Pointer(pChange)).FnRecord, bp+24 /* &rc */)
}
} else {
@@ -170831,30 +173157,30 @@ func sessionRebase(tls *libc.TLS, p uintptr, pIter uintptr, xOutput uintptr, pOu
sessionAppendByte(tls, bp+12 /* &sOut */, uint8((*Sqlite3_changeset_iter)(unsafe.Pointer(pIter)).FbIndirect), bp+24 /* &rc */)
sessionAppendBlob(tls, bp+12 /* &sOut */, *(*uintptr)(unsafe.Pointer(bp /* aRec */)), *(*int32)(unsafe.Pointer(bp + 4 /* nRec */)), bp+24 /* &rc */)
}
- if ((*(*int32)(unsafe.Pointer(bp + 24 /* rc */)) == SQLITE_OK) && (xOutput != 0)) && ((*SessionBuffer)(unsafe.Pointer(bp+12 /* &sOut */)).FnBuf > sessions_strm_chunk_size) {
+ if *(*int32)(unsafe.Pointer(bp + 24)) == SQLITE_OK && xOutput != 0 && (*SessionBuffer)(unsafe.Pointer(bp+12)).FnBuf > sessions_strm_chunk_size {
*(*int32)(unsafe.Pointer(bp + 24 /* rc */)) = (*struct {
f func(*libc.TLS, uintptr, uintptr, int32) int32
})(unsafe.Pointer(&struct{ uintptr }{xOutput})).f(tls, pOut, (*SessionBuffer)(unsafe.Pointer(bp+12 /* &sOut */)).FaBuf, (*SessionBuffer)(unsafe.Pointer(bp+12 /* &sOut */)).FnBuf)
(*SessionBuffer)(unsafe.Pointer(bp + 12 /* &sOut */)).FnBuf = 0
}
- if *(*int32)(unsafe.Pointer(bp + 24 /* rc */)) != 0 {
+ if *(*int32)(unsafe.Pointer(bp + 24)) != 0 {
break
}
}
- if *(*int32)(unsafe.Pointer(bp + 24 /* rc */)) != SQLITE_OK {
+ if *(*int32)(unsafe.Pointer(bp + 24)) != SQLITE_OK {
Xsqlite3_free(tls, (*SessionBuffer)(unsafe.Pointer(bp+12 /* &sOut */)).FaBuf)
libc.Xmemset(tls, bp+12 /* &sOut */, 0, uint32(unsafe.Sizeof(SessionBuffer{})))
}
- if *(*int32)(unsafe.Pointer(bp + 24 /* rc */)) == SQLITE_OK {
+ if *(*int32)(unsafe.Pointer(bp + 24)) == SQLITE_OK {
if xOutput != 0 {
- if (*SessionBuffer)(unsafe.Pointer(bp+12 /* &sOut */)).FnBuf > 0 {
+ if (*SessionBuffer)(unsafe.Pointer(bp+12)).FnBuf > 0 {
*(*int32)(unsafe.Pointer(bp + 24 /* rc */)) = (*struct {
f func(*libc.TLS, uintptr, uintptr, int32) int32
})(unsafe.Pointer(&struct{ uintptr }{xOutput})).f(tls, pOut, (*SessionBuffer)(unsafe.Pointer(bp+12 /* &sOut */)).FaBuf, (*SessionBuffer)(unsafe.Pointer(bp+12 /* &sOut */)).FnBuf)
}
- } else {
+ } else if ppOut != 0 {
*(*uintptr)(unsafe.Pointer(ppOut)) = (*SessionBuffer)(unsafe.Pointer(bp + 12 /* &sOut */)).FaBuf
*(*int32)(unsafe.Pointer(pnOut)) = (*SessionBuffer)(unsafe.Pointer(bp + 12 /* &sOut */)).FnBuf
(*SessionBuffer)(unsafe.Pointer(bp + 12 /* &sOut */)).FaBuf = uintptr(0)
@@ -170865,7 +173191,7 @@ func sessionRebase(tls *libc.TLS, p uintptr, pIter uintptr, xOutput uintptr, pOu
}
// Create a new rebaser object.
-func Xsqlite3rebaser_create(tls *libc.TLS, ppNew uintptr) int32 { /* sqlite3.c:212315:16: */
+func Xsqlite3rebaser_create(tls *libc.TLS, ppNew uintptr) int32 { /* sqlite3.c:214115:16: */
var rc int32 = SQLITE_OK
var pNew uintptr
@@ -170880,7 +173206,7 @@ func Xsqlite3rebaser_create(tls *libc.TLS, ppNew uintptr) int32 { /* sqlite3.c:2
}
// Call this one or more times to configure a rebaser.
-func Xsqlite3rebaser_configure(tls *libc.TLS, p uintptr, nRebase int32, pRebase uintptr) int32 { /* sqlite3.c:212332:16: */
+func Xsqlite3rebaser_configure(tls *libc.TLS, p uintptr, nRebase int32, pRebase uintptr) int32 { /* sqlite3.c:214132:16: */
bp := tls.Alloc(4)
defer tls.Free(4)
@@ -170888,14 +173214,14 @@ func Xsqlite3rebaser_configure(tls *libc.TLS, p uintptr, nRebase int32, pRebase
var rc int32 // Return code
rc = Xsqlite3changeset_start(tls, bp /* &pIter */, nRebase, pRebase)
if rc == SQLITE_OK {
- rc = sessionChangesetToHash(tls, *(*uintptr)(unsafe.Pointer(bp /* pIter */)), (p /* &.grp */), 1)
+ rc = sessionChangesetToHash(tls, *(*uintptr)(unsafe.Pointer(bp /* pIter */)), p, 1)
}
Xsqlite3changeset_finalize(tls, *(*uintptr)(unsafe.Pointer(bp /* pIter */)))
return rc
}
// Rebase a changeset according to current rebaser configuration
-func Xsqlite3rebaser_rebase(tls *libc.TLS, p uintptr, nIn int32, pIn uintptr, pnOut uintptr, ppOut uintptr) int32 { /* sqlite3.c:212349:16: */
+func Xsqlite3rebaser_rebase(tls *libc.TLS, p uintptr, nIn int32, pIn uintptr, pnOut uintptr, ppOut uintptr) int32 { /* sqlite3.c:214149:16: */
bp := tls.Alloc(4)
defer tls.Free(4)
@@ -170911,7 +173237,7 @@ func Xsqlite3rebaser_rebase(tls *libc.TLS, p uintptr, nIn int32, pIn uintptr, pn
}
// Rebase a changeset according to current rebaser configuration
-func Xsqlite3rebaser_rebase_strm(tls *libc.TLS, p uintptr, xInput uintptr, pIn uintptr, xOutput uintptr, pOut uintptr) int32 { /* sqlite3.c:212368:16: */
+func Xsqlite3rebaser_rebase_strm(tls *libc.TLS, p uintptr, xInput uintptr, pIn uintptr, xOutput uintptr, pOut uintptr) int32 { /* sqlite3.c:214168:16: */
bp := tls.Alloc(4)
defer tls.Free(4)
@@ -170927,7 +173253,7 @@ func Xsqlite3rebaser_rebase_strm(tls *libc.TLS, p uintptr, xInput uintptr, pIn u
}
// Destroy a rebaser object
-func Xsqlite3rebaser_delete(tls *libc.TLS, p uintptr) { /* sqlite3.c:212389:17: */
+func Xsqlite3rebaser_delete(tls *libc.TLS, p uintptr) { /* sqlite3.c:214189:17: */
if p != 0 {
sessionDeleteTable(tls, uintptr(0), (*Sqlite3_rebaser)(unsafe.Pointer(p)).Fgrp.FpList)
Xsqlite3_free(tls, p)
@@ -170935,7 +173261,7 @@ func Xsqlite3rebaser_delete(tls *libc.TLS, p uintptr) { /* sqlite3.c:212389:17:
}
// Global configuration
-func Xsqlite3session_config(tls *libc.TLS, op int32, pArg uintptr) int32 { /* sqlite3.c:212399:16: */
+func Xsqlite3session_config(tls *libc.TLS, op int32, pArg uintptr) int32 { /* sqlite3.c:214199:16: */
var rc int32 = SQLITE_OK
switch op {
case SQLITE_SESSION_CONFIG_STRMSIZE:
@@ -171024,7 +173350,7 @@ type Fts5Global1 = struct {
FpTok uintptr
FpDfltTok uintptr
FpCsr uintptr
-} /* sqlite3.c:213118:9 */
+} /* sqlite3.c:214930:9 */
//************* End of sqlite3session.c *************************************
//************* Begin file fts5.c *******************************************
@@ -171086,13 +173412,13 @@ type Fts5Global1 = struct {
// Mark a function parameter as unused, to suppress nuisance compiler
// warnings.
-type Fts5Global = Fts5Global1 /* sqlite3.c:213118:27 */
+type Fts5Global = Fts5Global1 /* sqlite3.c:214930:27 */
type Fts5Colset1 = struct {
FnCol int32
FaiCol [1]int32
-} /* sqlite3.c:213118:9 */
+} /* sqlite3.c:214930:9 */
-type Fts5Colset = Fts5Colset1 /* sqlite3.c:213119:27 */
+type Fts5Colset = Fts5Colset1 /* sqlite3.c:214931:27 */
// *************************************************************************
//
@@ -171127,14 +173453,14 @@ type Fts5Config1 = struct {
FzRank uintptr
FzRankArgs uintptr
FpzErrmsg uintptr
-} /* sqlite3.c:213118:9 */
+} /* sqlite3.c:214930:9 */
// *************************************************************************
//
// Interface to code in fts5_config.c. fts5_config.c contains contains code
// to parse the arguments passed to the CREATE VIRTUAL TABLE statement.
-type Fts5Config = Fts5Config1 /* sqlite3.c:213139:27 */
+type Fts5Config = Fts5Config1 /* sqlite3.c:214951:27 */
//
// End of interface to code in fts5_config.c.
@@ -171149,7 +173475,7 @@ type Fts5Buffer1 = struct {
Fp uintptr
Fn int32
FnSpace int32
-} /* sqlite3.c:213118:9 */
+} /* sqlite3.c:214930:9 */
//
// End of interface to code in fts5_config.c.
@@ -171160,7 +173486,7 @@ type Fts5Buffer1 = struct {
// Interface to code in fts5_buffer.c.
// Buffer object for the incremental building of string data.
-type Fts5Buffer = Fts5Buffer1 /* sqlite3.c:213265:27 */
+type Fts5Buffer = Fts5Buffer1 /* sqlite3.c:215077:27 */
type Fts5PoslistReader1 = struct {
Fa uintptr
@@ -171170,19 +173496,19 @@ type Fts5PoslistReader1 = struct {
FbEof U8
F__ccgo_pad1 [2]byte
FiPos I64
-} /* sqlite3.c:213118:9 */
+} /* sqlite3.c:214930:9 */
-type Fts5PoslistReader = Fts5PoslistReader1 /* sqlite3.c:213301:34 */
+type Fts5PoslistReader = Fts5PoslistReader1 /* sqlite3.c:215113:34 */
-type Fts5PoslistWriter1 = struct{ FiPrev I64 } /* sqlite3.c:213320:9 */
+type Fts5PoslistWriter1 = struct{ FiPrev I64 } /* sqlite3.c:215132:9 */
-type Fts5PoslistWriter = Fts5PoslistWriter1 /* sqlite3.c:213320:34 */
+type Fts5PoslistWriter = Fts5PoslistWriter1 /* sqlite3.c:215132:34 */
// Bucket of terms object used by the integrity-check in offsets=0 mode.
-type Fts5Termset1 = struct{ FapHash [512]uintptr } /* sqlite3.c:213342:9 */
+type Fts5Termset1 = struct{ FapHash [512]uintptr } /* sqlite3.c:215154:9 */
// Bucket of terms object used by the integrity-check in offsets=0 mode.
-type Fts5Termset = Fts5Termset1 /* sqlite3.c:213342:28 */
+type Fts5Termset = Fts5Termset1 /* sqlite3.c:215154:28 */
//
// End of interface to code in fts5_buffer.c.
@@ -171214,7 +173540,7 @@ type Fts5Index1 = struct {
FiStructVersion I64
FpStruct uintptr
F__ccgo_pad2 [4]byte
-} /* sqlite3.c:213118:9 */
+} /* sqlite3.c:214930:9 */
//
// End of interface to code in fts5_buffer.c.
@@ -171225,16 +173551,16 @@ type Fts5Index1 = struct {
// Interface to code in fts5_index.c. fts5_index.c contains contains code
// to access the data stored in the %_data table.
-type Fts5Index = Fts5Index1 /* sqlite3.c:213356:26 */
+type Fts5Index = Fts5Index1 /* sqlite3.c:215168:26 */
type Fts5IndexIter1 = struct {
FiRowid I64
FpData uintptr
FnData int32
FbEof U8
F__ccgo_pad1 [7]byte
-} /* sqlite3.c:213118:9 */
+} /* sqlite3.c:214930:9 */
-type Fts5IndexIter = Fts5IndexIter1 /* sqlite3.c:213357:30 */
+type Fts5IndexIter = Fts5IndexIter1 /* sqlite3.c:215169:30 */
//
// End of interface to code in fts5_varint.c.
@@ -171249,7 +173575,7 @@ type Fts5Table1 = struct {
Fbase Sqlite3_vtab
FpConfig uintptr
FpIndex uintptr
-} /* sqlite3.c:213556:9 */
+} /* sqlite3.c:215371:9 */
//
// End of interface to code in fts5_varint.c.
@@ -171260,7 +173586,7 @@ type Fts5Table1 = struct {
// Interface to code in fts5_main.c.
// Virtual-table object.
-type Fts5Table = Fts5Table1 /* sqlite3.c:213556:26 */
+type Fts5Table = Fts5Table1 /* sqlite3.c:215371:26 */
//
// End of interface to code in fts5.c.
@@ -171276,7 +173602,7 @@ type Fts5Hash1 = struct {
FnSlot int32
FpScan uintptr
FaSlot uintptr
-} /* sqlite3.c:213118:9 */
+} /* sqlite3.c:214930:9 */
//
// End of interface to code in fts5.c.
@@ -171285,7 +173611,7 @@ type Fts5Hash1 = struct {
// *************************************************************************
//
// Interface to code in fts5_hash.c.
-type Fts5Hash = Fts5Hash1 /* sqlite3.c:213582:25 */
+type Fts5Hash = Fts5Hash1 /* sqlite3.c:215397:25 */
//
// End of interface to code in fts5_hash.c.
@@ -171304,7 +173630,7 @@ type Fts5Storage1 = struct {
FnTotalRow I64
FaTotalSize uintptr
FaStmt [11]uintptr
-} /* sqlite3.c:213638:9 */
+} /* sqlite3.c:215453:9 */
//
// End of interface to code in fts5_hash.c.
@@ -171315,7 +173641,7 @@ type Fts5Storage1 = struct {
// Interface to code in fts5_storage.c. fts5_storage.c contains contains
// code to access the data stored in the %_content and %_docsize tables.
-type Fts5Storage = Fts5Storage1 /* sqlite3.c:213638:28 */
+type Fts5Storage = Fts5Storage1 /* sqlite3.c:215453:28 */
//
// End of interface to code in fts5_storage.c.
@@ -171331,7 +173657,7 @@ type Fts5Expr1 = struct {
FbDesc int32
FnPhrase int32
FapExprPhrase uintptr
-} /* sqlite3.c:213118:9 */
+} /* sqlite3.c:214930:9 */
//
// End of interface to code in fts5_storage.c.
@@ -171340,7 +173666,7 @@ type Fts5Expr1 = struct {
// *************************************************************************
//
// Interface to code in fts5_expr.c.
-type Fts5Expr = Fts5Expr1 /* sqlite3.c:213681:25 */
+type Fts5Expr = Fts5Expr1 /* sqlite3.c:215496:25 */
type Fts5ExprNode1 = struct {
FeType int32
FbEof int32
@@ -171351,9 +173677,9 @@ type Fts5ExprNode1 = struct {
FnChild int32
FapChild [1]uintptr
F__ccgo_pad1 [4]byte
-} /* sqlite3.c:213118:9 */
+} /* sqlite3.c:214930:9 */
-type Fts5ExprNode = Fts5ExprNode1 /* sqlite3.c:213682:29 */
+type Fts5ExprNode = Fts5ExprNode1 /* sqlite3.c:215497:29 */
type Fts5Parse1 = struct {
FpConfig uintptr
FzErr uintptr
@@ -171362,39 +173688,39 @@ type Fts5Parse1 = struct {
FapPhrase uintptr
FpExpr uintptr
FbPhraseToAnd int32
-} /* sqlite3.c:213683:9 */
+} /* sqlite3.c:215498:9 */
-type Fts5Parse = Fts5Parse1 /* sqlite3.c:213683:26 */
+type Fts5Parse = Fts5Parse1 /* sqlite3.c:215498:26 */
type Fts5Token1 = struct {
Fp uintptr
Fn int32
-} /* sqlite3.c:213684:9 */
+} /* sqlite3.c:215499:9 */
-type Fts5Token = Fts5Token1 /* sqlite3.c:213684:26 */
+type Fts5Token = Fts5Token1 /* sqlite3.c:215499:26 */
type Fts5ExprPhrase1 = struct {
FpNode uintptr
Fposlist Fts5Buffer
FnTerm int32
FaTerm [1]Fts5ExprTerm
-} /* sqlite3.c:213118:9 */
+} /* sqlite3.c:214930:9 */
-type Fts5ExprPhrase = Fts5ExprPhrase1 /* sqlite3.c:213685:31 */
+type Fts5ExprPhrase = Fts5ExprPhrase1 /* sqlite3.c:215500:31 */
type Fts5ExprNearset1 = struct {
FnNear int32
FpColset uintptr
FnPhrase int32
FapPhrase [1]uintptr
-} /* sqlite3.c:213118:9 */
+} /* sqlite3.c:214930:9 */
-type Fts5ExprNearset = Fts5ExprNearset1 /* sqlite3.c:213686:32 */
+type Fts5ExprNearset = Fts5ExprNearset1 /* sqlite3.c:215501:32 */
type Fts5PoslistPopulator1 = struct {
Fwriter Fts5PoslistWriter
FbOk int32
FbMiss int32
-} /* sqlite3.c:213734:9 */
+} /* sqlite3.c:215549:9 */
-type Fts5PoslistPopulator = Fts5PoslistPopulator1 /* sqlite3.c:213734:37 */
+type Fts5PoslistPopulator = Fts5PoslistPopulator1 /* sqlite3.c:215549:37 */
//
// End of interface to code in fts5_unicode2.c.
//
@@ -171498,7 +173824,7 @@ type Fts5PoslistPopulator = Fts5PoslistPopulator1 /* sqlite3.c:213734:37 */
type Fts5YYMINORTYPE = struct {
Ffts5yyinit int32
F__ccgo_pad1 [4]byte
-} /* sqlite3.c:214010:3 */
+} /* sqlite3.c:215825:3 */
//************ End control #defines ******************************************
// Define the fts5yytestcase() macro to be a no-op if is not already defined
@@ -171571,7 +173897,7 @@ var fts5yy_action = [105]uint8{
/* 80 */ uint8(5), uint8(3), uint8(63), uint8(5), uint8(3), uint8(62), uint8(12), uint8(2), uint8(86), uint8(13),
/* 90 */ uint8(9), uint8(30), uint8(10), uint8(10), uint8(54), uint8(57), uint8(75), uint8(78), uint8(78), uint8(53),
/* 100 */ uint8(57), uint8(15), uint8(82), uint8(82), uint8(71),
-} /* sqlite3.c:214103:31 */
+} /* sqlite3.c:215918:31 */
var fts5yy_lookahead = [121]uint8{
/* 0 */ uint8(16), uint8(17), uint8(18), uint8(19), uint8(20), uint8(22), uint8(22), uint8(24), uint8(24), uint8(17),
/* 10 */ uint8(18), uint8(19), uint8(20), uint8(7), uint8(22), uint8(9), uint8(24), uint8(17), uint8(18), uint8(19),
@@ -171586,23 +173912,23 @@ var fts5yy_lookahead = [121]uint8{
/* 100 */ uint8(9), uint8(9), uint8(27), uint8(27), uint8(11), uint8(27), uint8(27), uint8(27), uint8(27), uint8(27),
/* 110 */ uint8(27), uint8(27), uint8(27), uint8(27), uint8(27), uint8(27), uint8(27), uint8(27), uint8(27), uint8(27),
/* 120 */ uint8(27),
-} /* sqlite3.c:214116:29 */
+} /* sqlite3.c:215931:29 */
var fts5yy_shift_ofst = [35]uint8{
/* 0 */ uint8(44), uint8(44), uint8(44), uint8(44), uint8(44), uint8(44), uint8(51), uint8(77), uint8(43), uint8(12),
/* 10 */ uint8(14), uint8(83), uint8(82), uint8(14), uint8(23), uint8(23), uint8(31), uint8(31), uint8(71), uint8(74),
/* 20 */ uint8(78), uint8(81), uint8(86), uint8(91), uint8(6), uint8(53), uint8(53), uint8(60), uint8(64), uint8(68),
/* 30 */ uint8(53), uint8(87), uint8(92), uint8(53), uint8(93),
-} /* sqlite3.c:214134:28 */
+} /* sqlite3.c:215949:28 */
var fts5yy_reduce_ofst = [18]int8{
/* 0 */ int8(-16), int8(-8), int8(0), int8(9), int8(17), int8(25), int8(46), int8(-17), int8(-17), int8(37),
/* 10 */ int8(67), int8(4), int8(4), int8(8), int8(4), int8(20), int8(27), int8(38),
-} /* sqlite3.c:214143:26 */
+} /* sqlite3.c:215958:26 */
var fts5yy_default = [35]uint8{
/* 0 */ uint8(80), uint8(80), uint8(80), uint8(80), uint8(80), uint8(80), uint8(95), uint8(80), uint8(80), uint8(105),
/* 10 */ uint8(80), uint8(110), uint8(110), uint8(80), uint8(110), uint8(110), uint8(80), uint8(80), uint8(80), uint8(80),
/* 20 */ uint8(80), uint8(91), uint8(80), uint8(80), uint8(80), uint8(101), uint8(100), uint8(80), uint8(80), uint8(90),
/* 30 */ uint8(103), uint8(80), uint8(80), uint8(104), uint8(80),
-} /* sqlite3.c:214147:31 */
+} /* sqlite3.c:215962:31 */
//********* End of lemon-generated parsing tables ****************************
// The next table maps tokens (terminal symbols) into fallback tokens.
@@ -171639,9 +173965,9 @@ type fts5yyStackEntry = struct {
Fmajor uint8
F__ccgo_pad1 [2]byte
Fminor Fts5YYMINORTYPE
-} /* sqlite3.c:214190:1 */
+} /* sqlite3.c:216005:1 */
-type Fts5yyStackEntry = fts5yyStackEntry /* sqlite3.c:214197:33 */
+type Fts5yyStackEntry = fts5yyStackEntry /* sqlite3.c:216012:33 */
// The state of the parser is completely contained in an instance of
// the following structure
@@ -171650,9 +173976,11 @@ type fts5yyParser = struct {
FpParse uintptr
Ffts5yystack [100]Fts5yyStackEntry
Ffts5yystackEnd uintptr
-} /* sqlite3.c:214201:1 */
+} /* sqlite3.c:216016:1 */
+
+type Fts5yyParser = fts5yyParser /* sqlite3.c:216035:29 */
-type Fts5yyParser = fts5yyParser /* sqlite3.c:214220:29 */
+// #include <assert.h>
// Datatype of the argument to the memory allocated passed as the
// second argument to sqlite3Fts5ParserAlloc() below. This can be changed by
@@ -171660,13 +173988,13 @@ type Fts5yyParser = fts5yyParser /* sqlite3.c:214220:29 */
// grammar.
// Initialize a new parser that has already been allocated.
-func sqlite3Fts5ParserInit(tls *libc.TLS, fts5yypRawParser uintptr) { /* sqlite3.c:214369:13: */
+func sqlite3Fts5ParserInit(tls *libc.TLS, fts5yypRawParser uintptr) { /* sqlite3.c:216184:13: */
var fts5yypParser uintptr = fts5yypRawParser
(*Fts5yyParser)(unsafe.Pointer(fts5yypParser)).Ffts5yytos = fts5yypParser + 8 /* &.fts5yystack */
- (*Fts5yyStackEntry)(unsafe.Pointer((fts5yypParser + 8 /* &.fts5yystack */))).Fstateno = uint8(0)
- (*Fts5yyStackEntry)(unsafe.Pointer((fts5yypParser + 8 /* &.fts5yystack */))).Fmajor = uint8(0)
- (*Fts5yyParser)(unsafe.Pointer(fts5yypParser)).Ffts5yystackEnd = ((fts5yypParser + 8 /* &.fts5yystack */) + 99*12)
+ (*Fts5yyStackEntry)(unsafe.Pointer(fts5yypParser + 8)).Fstateno = uint8(0)
+ (*Fts5yyStackEntry)(unsafe.Pointer(fts5yypParser + 8)).Fmajor = uint8(0)
+ (*Fts5yyParser)(unsafe.Pointer(fts5yypParser)).Ffts5yystackEnd = fts5yypParser + 8 + 99*12
}
// This function allocates a new parser.
@@ -171679,7 +174007,7 @@ func sqlite3Fts5ParserInit(tls *libc.TLS, fts5yypRawParser uintptr) { /* sqlite3
// Outputs:
// A pointer to a parser. This pointer is used in subsequent calls
// to sqlite3Fts5Parser and sqlite3Fts5ParserFree.
-func sqlite3Fts5ParserAlloc(tls *libc.TLS, mallocProc uintptr) uintptr { /* sqlite3.c:214408:13: */
+func sqlite3Fts5ParserAlloc(tls *libc.TLS, mallocProc uintptr) uintptr { /* sqlite3.c:216223:13: */
var fts5yypParser uintptr
fts5yypParser = (*struct{ f func(*libc.TLS, U64) uintptr })(unsafe.Pointer(&struct{ uintptr }{mallocProc})).f(tls, U64(unsafe.Sizeof(Fts5yyParser{})))
if fts5yypParser != 0 {
@@ -171695,7 +174023,7 @@ func sqlite3Fts5ParserAlloc(tls *libc.TLS, mallocProc uintptr) uintptr { /* sqli
// a pointer to the value to be deleted. The code used to do the
// deletions is derived from the %destructor and/or %token_destructor
// directives of the input grammar.
-func fts5yy_destructor(tls *libc.TLS, fts5yypParser uintptr, fts5yymajor uint8, fts5yypminor uintptr) { /* sqlite3.c:214427:13: */
+func fts5yy_destructor(tls *libc.TLS, fts5yypParser uintptr, fts5yymajor uint8, fts5yypminor uintptr) { /* sqlite3.c:216242:13: */
var pParse uintptr = (*Fts5yyParser)(unsafe.Pointer(fts5yypParser)).FpParse
_ = pParse
@@ -171721,26 +174049,26 @@ func fts5yy_destructor(tls *libc.TLS, fts5yypParser uintptr, fts5yymajor uint8,
fallthrough // cnearset
case 19: /* exprlist */
{
- sqlite3Fts5ParseNodeFree(tls, *(*uintptr)(unsafe.Pointer(fts5yypminor /* .Ffts5yy24 */)))
+ sqlite3Fts5ParseNodeFree(tls, *(*uintptr)(unsafe.Pointer(fts5yypminor)))
}
break
case 20:
fallthrough // colset
case 21: /* colsetlist */
{
- Xsqlite3_free(tls, *(*uintptr)(unsafe.Pointer(fts5yypminor /* .Ffts5yy11 */)))
+ Xsqlite3_free(tls, *(*uintptr)(unsafe.Pointer(fts5yypminor)))
}
break
case 22:
fallthrough // nearset
case 23: /* nearphrases */
{
- sqlite3Fts5ParseNearsetFree(tls, *(*uintptr)(unsafe.Pointer(fts5yypminor /* .Ffts5yy46 */)))
+ sqlite3Fts5ParseNearsetFree(tls, *(*uintptr)(unsafe.Pointer(fts5yypminor)))
}
break
case 24: /* phrase */
{
- sqlite3Fts5ParsePhraseFree(tls, *(*uintptr)(unsafe.Pointer(fts5yypminor /* .Ffts5yy53 */)))
+ sqlite3Fts5ParsePhraseFree(tls, *(*uintptr)(unsafe.Pointer(fts5yypminor)))
}
break
//******** End destructor definitions ****************************************
@@ -171753,17 +174081,17 @@ func fts5yy_destructor(tls *libc.TLS, fts5yypParser uintptr, fts5yymajor uint8,
//
// If there is a destructor routine associated with the token which
// is popped from the stack, then call it.
-func fts5yy_pop_parser_stack(tls *libc.TLS, pParser uintptr) { /* sqlite3.c:214486:13: */
+func fts5yy_pop_parser_stack(tls *libc.TLS, pParser uintptr) { /* sqlite3.c:216301:13: */
var fts5yytos uintptr
fts5yytos = libc.PostDecUintptr(&(*Fts5yyParser)(unsafe.Pointer(pParser)).Ffts5yytos, 12)
- fts5yy_destructor(tls, pParser, (*Fts5yyStackEntry)(unsafe.Pointer(fts5yytos)).Fmajor, (fts5yytos + 4 /* &.minor */))
+ fts5yy_destructor(tls, pParser, (*Fts5yyStackEntry)(unsafe.Pointer(fts5yytos)).Fmajor, fts5yytos+4)
}
// Clear all secondary memory allocations from the parser
-func sqlite3Fts5ParserFinalize(tls *libc.TLS, p uintptr) { /* sqlite3.c:214504:13: */
+func sqlite3Fts5ParserFinalize(tls *libc.TLS, p uintptr) { /* sqlite3.c:216319:13: */
var pParser uintptr = p
- for (*Fts5yyParser)(unsafe.Pointer(pParser)).Ffts5yytos > pParser+8 /* &.fts5yystack */ {
+ for (*Fts5yyParser)(unsafe.Pointer(pParser)).Ffts5yytos > pParser+8 {
fts5yy_pop_parser_stack(tls, pParser)
}
}
@@ -171774,7 +174102,7 @@ func sqlite3Fts5ParserFinalize(tls *libc.TLS, p uintptr) { /* sqlite3.c:214504:1
// If the fts5YYPARSEFREENEVERNULL macro exists (for example because it
// is defined in a %include section of the input grammar) then it is
// assumed that the input pointer is never NULL.
-func sqlite3Fts5ParserFree(tls *libc.TLS, p uintptr, freeProc uintptr) { /* sqlite3.c:214521:13: */
+func sqlite3Fts5ParserFree(tls *libc.TLS, p uintptr, freeProc uintptr) { /* sqlite3.c:216336:13: */
if p == uintptr(0) {
return
}
@@ -171798,7 +174126,7 @@ func sqlite3Fts5ParserFree(tls *libc.TLS, p uintptr, freeProc uintptr) { /* sqli
// Find the appropriate action for a parser given the terminal
// look-ahead token iLookAhead.
-func fts5yy_find_shift_action(tls *libc.TLS, iLookAhead uint8, stateno uint8) uint8 { /* sqlite3.c:214584:25: */
+func fts5yy_find_shift_action(tls *libc.TLS, iLookAhead uint8, stateno uint8) uint8 { /* sqlite3.c:216399:25: */
var i int32
if int32(stateno) > Fts5YY_MAX_SHIFT {
@@ -171808,7 +174136,7 @@ func fts5yy_find_shift_action(tls *libc.TLS, iLookAhead uint8, stateno uint8) ui
for ok := true; ok; ok = 1 != 0 {
i = int32(fts5yy_shift_ofst[stateno])
- i = i + (int32(iLookAhead))
+ i = i + int32(iLookAhead)
if int32(fts5yy_lookahead[i]) != int32(iLookAhead) {
return fts5yy_default[stateno]
@@ -171822,28 +174150,28 @@ func fts5yy_find_shift_action(tls *libc.TLS, iLookAhead uint8, stateno uint8) ui
// Find the appropriate action for a parser given the non-terminal
// look-ahead token iLookAhead.
-func fts5yy_find_reduce_action(tls *libc.TLS, stateno uint8, iLookAhead uint8) uint8 { /* sqlite3.c:214649:25: */
+func fts5yy_find_reduce_action(tls *libc.TLS, stateno uint8, iLookAhead uint8) uint8 { /* sqlite3.c:216464:25: */
var i int32
i = int32(fts5yy_reduce_ofst[stateno])
- i = i + (int32(iLookAhead))
+ i = i + int32(iLookAhead)
return fts5yy_action[i]
}
// The following routine is called if the stack overflows.
-func fts5yyStackOverflow(tls *libc.TLS, fts5yypParser uintptr) { /* sqlite3.c:214678:13: */
+func fts5yyStackOverflow(tls *libc.TLS, fts5yypParser uintptr) { /* sqlite3.c:216493:13: */
var pParse uintptr = (*Fts5yyParser)(unsafe.Pointer(fts5yypParser)).FpParse
- for (*Fts5yyParser)(unsafe.Pointer(fts5yypParser)).Ffts5yytos > fts5yypParser+8 /* &.fts5yystack */ {
+ for (*Fts5yyParser)(unsafe.Pointer(fts5yypParser)).Ffts5yytos > fts5yypParser+8 {
fts5yy_pop_parser_stack(tls, fts5yypParser)
}
// Here code is inserted which will execute if the parser
// stack every overflows
//******* Begin %stack_overflow code *****************************************
- sqlite3Fts5ParseError(tls, pParse, ts+31882 /* "fts5: parser sta..." */, 0)
+ sqlite3Fts5ParseError(tls, pParse, ts+33242 /* "fts5: parser sta..." */, 0)
//******* End %stack_overflow code *******************************************
(*Fts5yyParser)(unsafe.Pointer(fts5yypParser)).FpParse = pParse // Suppress warning about unused %extra_argument var
@@ -171852,7 +174180,7 @@ func fts5yyStackOverflow(tls *libc.TLS, fts5yypParser uintptr) { /* sqlite3.c:21
// Print tracing information for a SHIFT action
// Perform a shift action.
-func fts5yy_shift(tls *libc.TLS, fts5yypParser uintptr, fts5yyNewState uint8, fts5yyMajor uint8, fts5yyMinor Fts5Token) { /* sqlite3.c:214721:13: */
+func fts5yy_shift(tls *libc.TLS, fts5yypParser uintptr, fts5yyNewState uint8, fts5yyMajor uint8, fts5yyMinor Fts5Token) { /* sqlite3.c:216536:13: */
var fts5yytos uintptr
(*Fts5yyParser)(unsafe.Pointer(fts5yypParser)).Ffts5yytos += 12
if (*Fts5yyParser)(unsafe.Pointer(fts5yypParser)).Ffts5yytos > (*Fts5yyParser)(unsafe.Pointer(fts5yypParser)).Ffts5yystackEnd {
@@ -171866,7 +174194,7 @@ func fts5yy_shift(tls *libc.TLS, fts5yypParser uintptr, fts5yyNewState uint8, ft
fts5yytos = (*Fts5yyParser)(unsafe.Pointer(fts5yypParser)).Ffts5yytos
(*Fts5yyStackEntry)(unsafe.Pointer(fts5yytos)).Fstateno = fts5yyNewState
(*Fts5yyStackEntry)(unsafe.Pointer(fts5yytos)).Fmajor = fts5yyMajor
- *(*Fts5Token)(unsafe.Pointer(fts5yytos + 4 /* &.minor */)) = fts5yyMinor
+ *(*Fts5Token)(unsafe.Pointer(fts5yytos + 4)) = fts5yyMinor
}
@@ -171901,7 +174229,7 @@ var fts5yyRuleInfoLhs = [28]uint8{
uint8(24), // (25) phrase ::= STRING star_opt
uint8(26), // (26) star_opt ::= STAR
uint8(26), // (27) star_opt ::=
-} /* sqlite3.c:214762:29 */
+} /* sqlite3.c:216577:29 */
// For rule J, fts5yyRuleInfoNRhs[J] contains the negative of the number
// of symbols on the right-hand side of that rule.
@@ -171934,7 +174262,7 @@ var fts5yyRuleInfoNRhs = [28]int8{
int8(-2), // (25) phrase ::= STRING star_opt
int8(-1), // (26) star_opt ::= STAR
int8(0), // (27) star_opt ::=
-} /* sqlite3.c:214795:26 */
+} /* sqlite3.c:216610:26 */
// Forward Declaration
@@ -171946,7 +174274,7 @@ var fts5yyRuleInfoNRhs = [28]int8{
// if the lookahead token has already been consumed. As this procedure is
// only called from one place, optimizing compilers will in-line it, which
// means that the extra parameters have no performance impact.
-func fts5yy_reduce(tls *libc.TLS, fts5yypParser uintptr, fts5yyruleno uint32, fts5yyLookahead int32, fts5yyLookaheadToken Fts5Token) uint8 { /* sqlite3.c:214838:25: */
+func fts5yy_reduce(tls *libc.TLS, fts5yypParser uintptr, fts5yyruleno uint32, fts5yyLookahead int32, fts5yyLookaheadToken Fts5Token) uint8 { /* sqlite3.c:216653:25: */
bp := tls.Alloc(8)
defer tls.Free(8)
@@ -171972,163 +174300,163 @@ func fts5yy_reduce(tls *libc.TLS, fts5yypParser uintptr, fts5yyruleno uint32, ft
case uint32(0): /* input ::= expr */
{
- sqlite3Fts5ParseFinished(tls, pParse, *(*uintptr)(unsafe.Pointer(fts5yymsp + 4 /* &.minor */)))
+ sqlite3Fts5ParseFinished(tls, pParse, *(*uintptr)(unsafe.Pointer(fts5yymsp + 4)))
}
break
case uint32(1): /* colset ::= MINUS LCP colsetlist RCP */
{
- *(*uintptr)(unsafe.Pointer(fts5yymsp + libc.UintptrFromInt32(-3)*12 + 4 /* &.minor */)) = sqlite3Fts5ParseColsetInvert(tls, pParse, *(*uintptr)(unsafe.Pointer(fts5yymsp + libc.UintptrFromInt32(-1)*12 + 4 /* &.minor */)))
+ *(*uintptr)(unsafe.Pointer(fts5yymsp + libc.UintptrFromInt32(-3)*12 + 4)) = sqlite3Fts5ParseColsetInvert(tls, pParse, *(*uintptr)(unsafe.Pointer(fts5yymsp + libc.UintptrFromInt32(-1)*12 + 4)))
}
break
case uint32(2): /* colset ::= LCP colsetlist RCP */
{
- *(*uintptr)(unsafe.Pointer(fts5yymsp + libc.UintptrFromInt32(-2)*12 + 4 /* &.minor */)) = *(*uintptr)(unsafe.Pointer(fts5yymsp + libc.UintptrFromInt32(-1)*12 + 4 /* &.minor */))
+ *(*uintptr)(unsafe.Pointer(fts5yymsp + libc.UintptrFromInt32(-2)*12 + 4)) = *(*uintptr)(unsafe.Pointer(fts5yymsp + libc.UintptrFromInt32(-1)*12 + 4))
}
break
case uint32(3): /* colset ::= STRING */
{
- *(*uintptr)(unsafe.Pointer(bp /* &fts5yylhsminor */)) = sqlite3Fts5ParseColset(tls, pParse, uintptr(0), (fts5yymsp + 4 /* &.minor */ /* &.fts5yy0 */))
+ *(*uintptr)(unsafe.Pointer(bp /* &fts5yylhsminor */)) = sqlite3Fts5ParseColset(tls, pParse, uintptr(0), fts5yymsp+4)
}
- *(*uintptr)(unsafe.Pointer(fts5yymsp + 4 /* &.minor */)) = *(*uintptr)(unsafe.Pointer(bp /* &fts5yylhsminor */))
+ *(*uintptr)(unsafe.Pointer(fts5yymsp + 4)) = *(*uintptr)(unsafe.Pointer(bp /* &fts5yylhsminor */))
break
case uint32(4): /* colset ::= MINUS STRING */
{
- *(*uintptr)(unsafe.Pointer(fts5yymsp + libc.UintptrFromInt32(-1)*12 + 4 /* &.minor */)) = sqlite3Fts5ParseColset(tls, pParse, uintptr(0), (fts5yymsp + 4 /* &.minor */ /* &.fts5yy0 */))
- *(*uintptr)(unsafe.Pointer(fts5yymsp + libc.UintptrFromInt32(-1)*12 + 4 /* &.minor */)) = sqlite3Fts5ParseColsetInvert(tls, pParse, *(*uintptr)(unsafe.Pointer(fts5yymsp + libc.UintptrFromInt32(-1)*12 + 4 /* &.minor */)))
+ *(*uintptr)(unsafe.Pointer(fts5yymsp + libc.UintptrFromInt32(-1)*12 + 4)) = sqlite3Fts5ParseColset(tls, pParse, uintptr(0), fts5yymsp+4)
+ *(*uintptr)(unsafe.Pointer(fts5yymsp + libc.UintptrFromInt32(-1)*12 + 4)) = sqlite3Fts5ParseColsetInvert(tls, pParse, *(*uintptr)(unsafe.Pointer(fts5yymsp + libc.UintptrFromInt32(-1)*12 + 4)))
}
break
case uint32(5): /* colsetlist ::= colsetlist STRING */
{
- *(*uintptr)(unsafe.Pointer(bp /* &fts5yylhsminor */)) = sqlite3Fts5ParseColset(tls, pParse, *(*uintptr)(unsafe.Pointer(fts5yymsp + libc.UintptrFromInt32(-1)*12 + 4 /* &.minor */)), (fts5yymsp + 4 /* &.minor */ /* &.fts5yy0 */))
+ *(*uintptr)(unsafe.Pointer(bp /* &fts5yylhsminor */)) = sqlite3Fts5ParseColset(tls, pParse, *(*uintptr)(unsafe.Pointer(fts5yymsp + libc.UintptrFromInt32(-1)*12 + 4)), fts5yymsp+4)
}
- *(*uintptr)(unsafe.Pointer(fts5yymsp + libc.UintptrFromInt32(-1)*12 + 4 /* &.minor */)) = *(*uintptr)(unsafe.Pointer(bp /* &fts5yylhsminor */))
+ *(*uintptr)(unsafe.Pointer(fts5yymsp + libc.UintptrFromInt32(-1)*12 + 4)) = *(*uintptr)(unsafe.Pointer(bp /* &fts5yylhsminor */))
break
case uint32(6): /* colsetlist ::= STRING */
{
- *(*uintptr)(unsafe.Pointer(bp /* &fts5yylhsminor */)) = sqlite3Fts5ParseColset(tls, pParse, uintptr(0), (fts5yymsp + 4 /* &.minor */ /* &.fts5yy0 */))
+ *(*uintptr)(unsafe.Pointer(bp /* &fts5yylhsminor */)) = sqlite3Fts5ParseColset(tls, pParse, uintptr(0), fts5yymsp+4)
}
- *(*uintptr)(unsafe.Pointer(fts5yymsp + 4 /* &.minor */)) = *(*uintptr)(unsafe.Pointer(bp /* &fts5yylhsminor */))
+ *(*uintptr)(unsafe.Pointer(fts5yymsp + 4)) = *(*uintptr)(unsafe.Pointer(bp /* &fts5yylhsminor */))
break
case uint32(7): /* expr ::= expr AND expr */
{
- *(*uintptr)(unsafe.Pointer(bp /* &fts5yylhsminor */)) = sqlite3Fts5ParseNode(tls, pParse, FTS5_AND, *(*uintptr)(unsafe.Pointer(fts5yymsp + libc.UintptrFromInt32(-2)*12 + 4 /* &.minor */)), *(*uintptr)(unsafe.Pointer(fts5yymsp + 4 /* &.minor */)), uintptr(0))
+ *(*uintptr)(unsafe.Pointer(bp /* &fts5yylhsminor */)) = sqlite3Fts5ParseNode(tls, pParse, FTS5_AND, *(*uintptr)(unsafe.Pointer(fts5yymsp + libc.UintptrFromInt32(-2)*12 + 4)), *(*uintptr)(unsafe.Pointer(fts5yymsp + 4)), uintptr(0))
}
- *(*uintptr)(unsafe.Pointer(fts5yymsp + libc.UintptrFromInt32(-2)*12 + 4 /* &.minor */)) = *(*uintptr)(unsafe.Pointer(bp /* &fts5yylhsminor */))
+ *(*uintptr)(unsafe.Pointer(fts5yymsp + libc.UintptrFromInt32(-2)*12 + 4)) = *(*uintptr)(unsafe.Pointer(bp /* &fts5yylhsminor */))
break
case uint32(8): /* expr ::= expr OR expr */
{
- *(*uintptr)(unsafe.Pointer(bp /* &fts5yylhsminor */)) = sqlite3Fts5ParseNode(tls, pParse, FTS5_OR, *(*uintptr)(unsafe.Pointer(fts5yymsp + libc.UintptrFromInt32(-2)*12 + 4 /* &.minor */)), *(*uintptr)(unsafe.Pointer(fts5yymsp + 4 /* &.minor */)), uintptr(0))
+ *(*uintptr)(unsafe.Pointer(bp /* &fts5yylhsminor */)) = sqlite3Fts5ParseNode(tls, pParse, FTS5_OR, *(*uintptr)(unsafe.Pointer(fts5yymsp + libc.UintptrFromInt32(-2)*12 + 4)), *(*uintptr)(unsafe.Pointer(fts5yymsp + 4)), uintptr(0))
}
- *(*uintptr)(unsafe.Pointer(fts5yymsp + libc.UintptrFromInt32(-2)*12 + 4 /* &.minor */)) = *(*uintptr)(unsafe.Pointer(bp /* &fts5yylhsminor */))
+ *(*uintptr)(unsafe.Pointer(fts5yymsp + libc.UintptrFromInt32(-2)*12 + 4)) = *(*uintptr)(unsafe.Pointer(bp /* &fts5yylhsminor */))
break
case uint32(9): /* expr ::= expr NOT expr */
{
- *(*uintptr)(unsafe.Pointer(bp /* &fts5yylhsminor */)) = sqlite3Fts5ParseNode(tls, pParse, FTS5_NOT, *(*uintptr)(unsafe.Pointer(fts5yymsp + libc.UintptrFromInt32(-2)*12 + 4 /* &.minor */)), *(*uintptr)(unsafe.Pointer(fts5yymsp + 4 /* &.minor */)), uintptr(0))
+ *(*uintptr)(unsafe.Pointer(bp /* &fts5yylhsminor */)) = sqlite3Fts5ParseNode(tls, pParse, FTS5_NOT, *(*uintptr)(unsafe.Pointer(fts5yymsp + libc.UintptrFromInt32(-2)*12 + 4)), *(*uintptr)(unsafe.Pointer(fts5yymsp + 4)), uintptr(0))
}
- *(*uintptr)(unsafe.Pointer(fts5yymsp + libc.UintptrFromInt32(-2)*12 + 4 /* &.minor */)) = *(*uintptr)(unsafe.Pointer(bp /* &fts5yylhsminor */))
+ *(*uintptr)(unsafe.Pointer(fts5yymsp + libc.UintptrFromInt32(-2)*12 + 4)) = *(*uintptr)(unsafe.Pointer(bp /* &fts5yylhsminor */))
break
case uint32(10): /* expr ::= colset COLON LP expr RP */
{
- sqlite3Fts5ParseSetColset(tls, pParse, *(*uintptr)(unsafe.Pointer(fts5yymsp + libc.UintptrFromInt32(-1)*12 + 4 /* &.minor */)), *(*uintptr)(unsafe.Pointer(fts5yymsp + libc.UintptrFromInt32(-4)*12 + 4 /* &.minor */)))
- *(*uintptr)(unsafe.Pointer(bp /* &fts5yylhsminor */)) = *(*uintptr)(unsafe.Pointer(fts5yymsp + libc.UintptrFromInt32(-1)*12 + 4 /* &.minor */))
+ sqlite3Fts5ParseSetColset(tls, pParse, *(*uintptr)(unsafe.Pointer(fts5yymsp + libc.UintptrFromInt32(-1)*12 + 4)), *(*uintptr)(unsafe.Pointer(fts5yymsp + libc.UintptrFromInt32(-4)*12 + 4)))
+ *(*uintptr)(unsafe.Pointer(bp /* &fts5yylhsminor */)) = *(*uintptr)(unsafe.Pointer(fts5yymsp + libc.UintptrFromInt32(-1)*12 + 4))
}
- *(*uintptr)(unsafe.Pointer(fts5yymsp + libc.UintptrFromInt32(-4)*12 + 4 /* &.minor */)) = *(*uintptr)(unsafe.Pointer(bp /* &fts5yylhsminor */))
+ *(*uintptr)(unsafe.Pointer(fts5yymsp + libc.UintptrFromInt32(-4)*12 + 4)) = *(*uintptr)(unsafe.Pointer(bp /* &fts5yylhsminor */))
break
case uint32(11): /* expr ::= LP expr RP */
{
- *(*uintptr)(unsafe.Pointer(fts5yymsp + libc.UintptrFromInt32(-2)*12 + 4 /* &.minor */)) = *(*uintptr)(unsafe.Pointer(fts5yymsp + libc.UintptrFromInt32(-1)*12 + 4 /* &.minor */))
+ *(*uintptr)(unsafe.Pointer(fts5yymsp + libc.UintptrFromInt32(-2)*12 + 4)) = *(*uintptr)(unsafe.Pointer(fts5yymsp + libc.UintptrFromInt32(-1)*12 + 4))
}
break
case uint32(12):
fallthrough // expr ::= exprlist
case uint32(13): /* exprlist ::= cnearset */
{
- *(*uintptr)(unsafe.Pointer(bp /* &fts5yylhsminor */)) = *(*uintptr)(unsafe.Pointer(fts5yymsp + 4 /* &.minor */))
+ *(*uintptr)(unsafe.Pointer(bp /* &fts5yylhsminor */)) = *(*uintptr)(unsafe.Pointer(fts5yymsp + 4))
}
- *(*uintptr)(unsafe.Pointer(fts5yymsp + 4 /* &.minor */)) = *(*uintptr)(unsafe.Pointer(bp /* &fts5yylhsminor */))
+ *(*uintptr)(unsafe.Pointer(fts5yymsp + 4)) = *(*uintptr)(unsafe.Pointer(bp /* &fts5yylhsminor */))
break
case uint32(14): /* exprlist ::= exprlist cnearset */
{
- *(*uintptr)(unsafe.Pointer(bp /* &fts5yylhsminor */)) = sqlite3Fts5ParseImplicitAnd(tls, pParse, *(*uintptr)(unsafe.Pointer(fts5yymsp + libc.UintptrFromInt32(-1)*12 + 4 /* &.minor */)), *(*uintptr)(unsafe.Pointer(fts5yymsp + 4 /* &.minor */)))
+ *(*uintptr)(unsafe.Pointer(bp /* &fts5yylhsminor */)) = sqlite3Fts5ParseImplicitAnd(tls, pParse, *(*uintptr)(unsafe.Pointer(fts5yymsp + libc.UintptrFromInt32(-1)*12 + 4)), *(*uintptr)(unsafe.Pointer(fts5yymsp + 4)))
}
- *(*uintptr)(unsafe.Pointer(fts5yymsp + libc.UintptrFromInt32(-1)*12 + 4 /* &.minor */)) = *(*uintptr)(unsafe.Pointer(bp /* &fts5yylhsminor */))
+ *(*uintptr)(unsafe.Pointer(fts5yymsp + libc.UintptrFromInt32(-1)*12 + 4)) = *(*uintptr)(unsafe.Pointer(bp /* &fts5yylhsminor */))
break
case uint32(15): /* cnearset ::= nearset */
{
- *(*uintptr)(unsafe.Pointer(bp /* &fts5yylhsminor */)) = sqlite3Fts5ParseNode(tls, pParse, FTS5_STRING, uintptr(0), uintptr(0), *(*uintptr)(unsafe.Pointer(fts5yymsp + 4 /* &.minor */)))
+ *(*uintptr)(unsafe.Pointer(bp /* &fts5yylhsminor */)) = sqlite3Fts5ParseNode(tls, pParse, FTS5_STRING, uintptr(0), uintptr(0), *(*uintptr)(unsafe.Pointer(fts5yymsp + 4)))
}
- *(*uintptr)(unsafe.Pointer(fts5yymsp + 4 /* &.minor */)) = *(*uintptr)(unsafe.Pointer(bp /* &fts5yylhsminor */))
+ *(*uintptr)(unsafe.Pointer(fts5yymsp + 4)) = *(*uintptr)(unsafe.Pointer(bp /* &fts5yylhsminor */))
break
case uint32(16): /* cnearset ::= colset COLON nearset */
{
- *(*uintptr)(unsafe.Pointer(bp /* &fts5yylhsminor */)) = sqlite3Fts5ParseNode(tls, pParse, FTS5_STRING, uintptr(0), uintptr(0), *(*uintptr)(unsafe.Pointer(fts5yymsp + 4 /* &.minor */)))
- sqlite3Fts5ParseSetColset(tls, pParse, *(*uintptr)(unsafe.Pointer(bp /* &fts5yylhsminor */)), *(*uintptr)(unsafe.Pointer(fts5yymsp + libc.UintptrFromInt32(-2)*12 + 4 /* &.minor */)))
+ *(*uintptr)(unsafe.Pointer(bp /* &fts5yylhsminor */)) = sqlite3Fts5ParseNode(tls, pParse, FTS5_STRING, uintptr(0), uintptr(0), *(*uintptr)(unsafe.Pointer(fts5yymsp + 4)))
+ sqlite3Fts5ParseSetColset(tls, pParse, *(*uintptr)(unsafe.Pointer(bp /* &fts5yylhsminor */)), *(*uintptr)(unsafe.Pointer(fts5yymsp + libc.UintptrFromInt32(-2)*12 + 4)))
}
- *(*uintptr)(unsafe.Pointer(fts5yymsp + libc.UintptrFromInt32(-2)*12 + 4 /* &.minor */)) = *(*uintptr)(unsafe.Pointer(bp /* &fts5yylhsminor */))
+ *(*uintptr)(unsafe.Pointer(fts5yymsp + libc.UintptrFromInt32(-2)*12 + 4)) = *(*uintptr)(unsafe.Pointer(bp /* &fts5yylhsminor */))
break
case uint32(17): /* nearset ::= phrase */
{
- *(*uintptr)(unsafe.Pointer(bp /* &fts5yylhsminor */)) = sqlite3Fts5ParseNearset(tls, pParse, uintptr(0), *(*uintptr)(unsafe.Pointer(fts5yymsp + 4 /* &.minor */)))
+ *(*uintptr)(unsafe.Pointer(bp /* &fts5yylhsminor */)) = sqlite3Fts5ParseNearset(tls, pParse, uintptr(0), *(*uintptr)(unsafe.Pointer(fts5yymsp + 4)))
}
- *(*uintptr)(unsafe.Pointer(fts5yymsp + 4 /* &.minor */)) = *(*uintptr)(unsafe.Pointer(bp /* &fts5yylhsminor */))
+ *(*uintptr)(unsafe.Pointer(fts5yymsp + 4)) = *(*uintptr)(unsafe.Pointer(bp /* &fts5yylhsminor */))
break
case uint32(18): /* nearset ::= CARET phrase */
{
- sqlite3Fts5ParseSetCaret(tls, *(*uintptr)(unsafe.Pointer(fts5yymsp + 4 /* &.minor */)))
- *(*uintptr)(unsafe.Pointer(fts5yymsp + libc.UintptrFromInt32(-1)*12 + 4 /* &.minor */)) = sqlite3Fts5ParseNearset(tls, pParse, uintptr(0), *(*uintptr)(unsafe.Pointer(fts5yymsp + 4 /* &.minor */)))
+ sqlite3Fts5ParseSetCaret(tls, *(*uintptr)(unsafe.Pointer(fts5yymsp + 4)))
+ *(*uintptr)(unsafe.Pointer(fts5yymsp + libc.UintptrFromInt32(-1)*12 + 4)) = sqlite3Fts5ParseNearset(tls, pParse, uintptr(0), *(*uintptr)(unsafe.Pointer(fts5yymsp + 4)))
}
break
case uint32(19): /* nearset ::= STRING LP nearphrases neardist_opt RP */
{
- sqlite3Fts5ParseNear(tls, pParse, (fts5yymsp + libc.UintptrFromInt32(-4)*12 + 4 /* &.minor */ /* &.fts5yy0 */))
- sqlite3Fts5ParseSetDistance(tls, pParse, *(*uintptr)(unsafe.Pointer(fts5yymsp + libc.UintptrFromInt32(-2)*12 + 4 /* &.minor */)), (fts5yymsp + libc.UintptrFromInt32(-1)*12 + 4 /* &.minor */ /* &.fts5yy0 */))
- *(*uintptr)(unsafe.Pointer(bp /* &fts5yylhsminor */)) = *(*uintptr)(unsafe.Pointer(fts5yymsp + libc.UintptrFromInt32(-2)*12 + 4 /* &.minor */))
+ sqlite3Fts5ParseNear(tls, pParse, fts5yymsp+libc.UintptrFromInt32(-4)*12+4)
+ sqlite3Fts5ParseSetDistance(tls, pParse, *(*uintptr)(unsafe.Pointer(fts5yymsp + libc.UintptrFromInt32(-2)*12 + 4)), fts5yymsp+libc.UintptrFromInt32(-1)*12+4)
+ *(*uintptr)(unsafe.Pointer(bp /* &fts5yylhsminor */)) = *(*uintptr)(unsafe.Pointer(fts5yymsp + libc.UintptrFromInt32(-2)*12 + 4))
}
- *(*uintptr)(unsafe.Pointer(fts5yymsp + libc.UintptrFromInt32(-4)*12 + 4 /* &.minor */)) = *(*uintptr)(unsafe.Pointer(bp /* &fts5yylhsminor */))
+ *(*uintptr)(unsafe.Pointer(fts5yymsp + libc.UintptrFromInt32(-4)*12 + 4)) = *(*uintptr)(unsafe.Pointer(bp /* &fts5yylhsminor */))
break
case uint32(20): /* nearphrases ::= phrase */
{
- *(*uintptr)(unsafe.Pointer(bp /* &fts5yylhsminor */)) = sqlite3Fts5ParseNearset(tls, pParse, uintptr(0), *(*uintptr)(unsafe.Pointer(fts5yymsp + 4 /* &.minor */)))
+ *(*uintptr)(unsafe.Pointer(bp /* &fts5yylhsminor */)) = sqlite3Fts5ParseNearset(tls, pParse, uintptr(0), *(*uintptr)(unsafe.Pointer(fts5yymsp + 4)))
}
- *(*uintptr)(unsafe.Pointer(fts5yymsp + 4 /* &.minor */)) = *(*uintptr)(unsafe.Pointer(bp /* &fts5yylhsminor */))
+ *(*uintptr)(unsafe.Pointer(fts5yymsp + 4)) = *(*uintptr)(unsafe.Pointer(bp /* &fts5yylhsminor */))
break
case uint32(21): /* nearphrases ::= nearphrases phrase */
{
- *(*uintptr)(unsafe.Pointer(bp /* &fts5yylhsminor */)) = sqlite3Fts5ParseNearset(tls, pParse, *(*uintptr)(unsafe.Pointer(fts5yymsp + libc.UintptrFromInt32(-1)*12 + 4 /* &.minor */)), *(*uintptr)(unsafe.Pointer(fts5yymsp + 4 /* &.minor */)))
+ *(*uintptr)(unsafe.Pointer(bp /* &fts5yylhsminor */)) = sqlite3Fts5ParseNearset(tls, pParse, *(*uintptr)(unsafe.Pointer(fts5yymsp + libc.UintptrFromInt32(-1)*12 + 4)), *(*uintptr)(unsafe.Pointer(fts5yymsp + 4)))
}
- *(*uintptr)(unsafe.Pointer(fts5yymsp + libc.UintptrFromInt32(-1)*12 + 4 /* &.minor */)) = *(*uintptr)(unsafe.Pointer(bp /* &fts5yylhsminor */))
+ *(*uintptr)(unsafe.Pointer(fts5yymsp + libc.UintptrFromInt32(-1)*12 + 4)) = *(*uintptr)(unsafe.Pointer(bp /* &fts5yylhsminor */))
break
case uint32(22): /* neardist_opt ::= */
{
- (*Fts5Token)(unsafe.Pointer(fts5yymsp + 1*12 + 4 /* &.minor */)).Fp = uintptr(0)
- (*Fts5Token)(unsafe.Pointer(fts5yymsp + 1*12 + 4 /* &.minor */)).Fn = 0
+ (*Fts5Token)(unsafe.Pointer(fts5yymsp + 1*12 + 4)).Fp = uintptr(0)
+ (*Fts5Token)(unsafe.Pointer(fts5yymsp + 1*12 + 4)).Fn = 0
}
break
case uint32(23): /* neardist_opt ::= COMMA STRING */
{
- *(*Fts5Token)(unsafe.Pointer(fts5yymsp + libc.UintptrFromInt32(-1)*12 + 4 /* &.minor */)) = *(*Fts5Token)(unsafe.Pointer(fts5yymsp + 4 /* &.minor */))
+ *(*Fts5Token)(unsafe.Pointer(fts5yymsp + libc.UintptrFromInt32(-1)*12 + 4)) = *(*Fts5Token)(unsafe.Pointer(fts5yymsp + 4))
}
break
case uint32(24): /* phrase ::= phrase PLUS STRING star_opt */
{
- *(*uintptr)(unsafe.Pointer(bp /* &fts5yylhsminor */)) = sqlite3Fts5ParseTerm(tls, pParse, *(*uintptr)(unsafe.Pointer(fts5yymsp + libc.UintptrFromInt32(-3)*12 + 4 /* &.minor */)), (fts5yymsp + libc.UintptrFromInt32(-1)*12 + 4 /* &.minor */ /* &.fts5yy0 */), *(*int32)(unsafe.Pointer(fts5yymsp + 4 /* &.minor */)))
+ *(*uintptr)(unsafe.Pointer(bp /* &fts5yylhsminor */)) = sqlite3Fts5ParseTerm(tls, pParse, *(*uintptr)(unsafe.Pointer(fts5yymsp + libc.UintptrFromInt32(-3)*12 + 4)), fts5yymsp+libc.UintptrFromInt32(-1)*12+4, *(*int32)(unsafe.Pointer(fts5yymsp + 4)))
}
- *(*uintptr)(unsafe.Pointer(fts5yymsp + libc.UintptrFromInt32(-3)*12 + 4 /* &.minor */)) = *(*uintptr)(unsafe.Pointer(bp /* &fts5yylhsminor */))
+ *(*uintptr)(unsafe.Pointer(fts5yymsp + libc.UintptrFromInt32(-3)*12 + 4)) = *(*uintptr)(unsafe.Pointer(bp /* &fts5yylhsminor */))
break
case uint32(25): /* phrase ::= STRING star_opt */
{
- *(*uintptr)(unsafe.Pointer(bp /* &fts5yylhsminor */)) = sqlite3Fts5ParseTerm(tls, pParse, uintptr(0), (fts5yymsp + libc.UintptrFromInt32(-1)*12 + 4 /* &.minor */ /* &.fts5yy0 */), *(*int32)(unsafe.Pointer(fts5yymsp + 4 /* &.minor */)))
+ *(*uintptr)(unsafe.Pointer(bp /* &fts5yylhsminor */)) = sqlite3Fts5ParseTerm(tls, pParse, uintptr(0), fts5yymsp+libc.UintptrFromInt32(-1)*12+4, *(*int32)(unsafe.Pointer(fts5yymsp + 4)))
}
- *(*uintptr)(unsafe.Pointer(fts5yymsp + libc.UintptrFromInt32(-1)*12 + 4 /* &.minor */)) = *(*uintptr)(unsafe.Pointer(bp /* &fts5yylhsminor */))
+ *(*uintptr)(unsafe.Pointer(fts5yymsp + libc.UintptrFromInt32(-1)*12 + 4)) = *(*uintptr)(unsafe.Pointer(bp /* &fts5yylhsminor */))
break
case uint32(26): /* star_opt ::= STAR */
{
- *(*int32)(unsafe.Pointer(fts5yymsp + 4 /* &.minor */)) = 1
+ *(*int32)(unsafe.Pointer(fts5yymsp + 4)) = 1
}
break
case uint32(27): /* star_opt ::= */
{
- *(*int32)(unsafe.Pointer(fts5yymsp + 1*12 + 4 /* &.minor */)) = 0
+ *(*int32)(unsafe.Pointer(fts5yymsp + 1*12 + 4)) = 0
}
break
default:
@@ -172145,7 +174473,7 @@ func fts5yy_reduce(tls *libc.TLS, fts5yypParser uintptr, fts5yyruleno uint32, ft
// It is not possible for a REDUCE to be followed by an error
- fts5yymsp += 12 * (uintptr(fts5yysize + 1))
+ fts5yymsp += 12 * uintptr(fts5yysize+1)
(*Fts5yyParser)(unsafe.Pointer(fts5yypParser)).Ffts5yytos = fts5yymsp
(*Fts5yyStackEntry)(unsafe.Pointer(fts5yymsp)).Fstateno = fts5yyact
(*Fts5yyStackEntry)(unsafe.Pointer(fts5yymsp)).Fmajor = uint8(fts5yygoto)
@@ -172156,7 +174484,7 @@ func fts5yy_reduce(tls *libc.TLS, fts5yypParser uintptr, fts5yyruleno uint32, ft
// The following code executes when the parse fails
// The following code executes when a syntax error first occurs.
-func fts5yy_syntax_error(tls *libc.TLS, fts5yypParser uintptr, fts5yymajor int32, fts5yyminor Fts5Token) { /* sqlite3.c:215056:13: */
+func fts5yy_syntax_error(tls *libc.TLS, fts5yypParser uintptr, fts5yymajor int32, fts5yyminor Fts5Token) { /* sqlite3.c:216871:13: */
bp := tls.Alloc(16)
defer tls.Free(16)
@@ -172166,14 +174494,14 @@ func fts5yy_syntax_error(tls *libc.TLS, fts5yypParser uintptr, fts5yymajor int32
_ = fts5yymajor // Silence a compiler warning
sqlite3Fts5ParseError(tls,
- pParse, ts+31910 /* "fts5: syntax err..." */, libc.VaList(bp, fts5yyminor.Fn, fts5yyminor.Fp))
+ pParse, ts+33270 /* "fts5: syntax err..." */, libc.VaList(bp, fts5yyminor.Fn, fts5yyminor.Fp))
//*********** End %syntax_error code *****************************************
(*Fts5yyParser)(unsafe.Pointer(fts5yypParser)).FpParse = pParse // Suppress warning about unused %extra_argument variable
}
// The following is executed when the parser accepts
-func fts5yy_accept(tls *libc.TLS, fts5yypParser uintptr) { /* sqlite3.c:215078:13: */
+func fts5yy_accept(tls *libc.TLS, fts5yypParser uintptr) { /* sqlite3.c:216893:13: */
var pParse uintptr = (*Fts5yyParser)(unsafe.Pointer(fts5yypParser)).FpParse
// Here code is inserted which will be executed whenever the
@@ -172202,7 +174530,7 @@ func fts5yy_accept(tls *libc.TLS, fts5yypParser uintptr) { /* sqlite3.c:215078:1
//
// Outputs:
// None.
-func sqlite3Fts5Parser(tls *libc.TLS, fts5yyp uintptr, fts5yymajor int32, fts5yyminor Fts5Token, pParse uintptr) { /* sqlite3.c:215119:13: */
+func sqlite3Fts5Parser(tls *libc.TLS, fts5yyp uintptr, fts5yymajor int32, fts5yyminor Fts5Token, pParse uintptr) { /* sqlite3.c:216934:13: */
bp := tls.Alloc(8)
defer tls.Free(8)
@@ -172219,7 +174547,7 @@ func sqlite3Fts5Parser(tls *libc.TLS, fts5yyp uintptr, fts5yymajor int32, fts5yy
fts5yyact = fts5yy_find_shift_action(tls, uint8(fts5yymajor), fts5yyact)
if int32(fts5yyact) >= Fts5YY_MIN_REDUCE {
- var fts5yyruleno uint32 = (uint32(int32(fts5yyact) - Fts5YY_MIN_REDUCE)) // Reduce by this rule
+ var fts5yyruleno uint32 = uint32(int32(fts5yyact) - Fts5YY_MIN_REDUCE) // Reduce by this rule
// Check that the stack is large enough to grow by a single entry
// if the RHS of the rule is empty. This ensures that there is room
@@ -172257,7 +174585,7 @@ func sqlite3Fts5Parser(tls *libc.TLS, fts5yyp uintptr, fts5yymajor int32, fts5yy
// Return the fallback token corresponding to canonical token iToken, or
// 0 if iToken has no fallback.
-func sqlite3Fts5ParserFallback(tls *libc.TLS, iToken int32) int32 { /* sqlite3.c:215337:12: */
+func sqlite3Fts5ParserFallback(tls *libc.TLS, iToken int32) int32 { /* sqlite3.c:217151:12: */
_ = iToken
return 0
}
@@ -172275,7 +174603,7 @@ func sqlite3Fts5ParserFallback(tls *libc.TLS, iToken int32) int32 { /* sqlite3.c
// #include "fts5Int.h"
// Declarations for math functions.
-// Copyright (C) 1991-2018 Free Software Foundation, Inc.
+// Copyright (C) 1991-2020 Free Software Foundation, Inc.
// This file is part of the GNU C Library.
//
// The GNU C Library is free software; you can redistribute it and/or
@@ -172290,7 +174618,7 @@ func sqlite3Fts5ParserFallback(tls *libc.TLS, iToken int32) int32 { /* sqlite3.c
//
// You should have received a copy of the GNU Lesser General Public
// License along with the GNU C Library; if not, see
-// <http://www.gnu.org/licenses/>.
+// <https://www.gnu.org/licenses/>.
// ISO C99 Standard: 7.12 Mathematics <math.h>
@@ -172319,7 +174647,7 @@ type CInstIter1 = struct {
FnInst int32
FiStart int32
FiEnd int32
-} /* sqlite3.c:215383:9 */
+} /* sqlite3.c:217197:9 */
// 2014 May 31
//
@@ -172334,7 +174662,7 @@ type CInstIter1 = struct {
// #include "fts5Int.h"
// Declarations for math functions.
-// Copyright (C) 1991-2018 Free Software Foundation, Inc.
+// Copyright (C) 1991-2020 Free Software Foundation, Inc.
// This file is part of the GNU C Library.
//
// The GNU C Library is free software; you can redistribute it and/or
@@ -172349,7 +174677,7 @@ type CInstIter1 = struct {
//
// You should have received a copy of the GNU Lesser General Public
// License along with the GNU C Library; if not, see
-// <http://www.gnu.org/licenses/>.
+// <https://www.gnu.org/licenses/>.
// ISO C99 Standard: 7.12 Mathematics <math.h>
@@ -172370,11 +174698,11 @@ type CInstIter1 = struct {
// printf("instance starts at %d, ends at %d\n", iter.iStart, iter.iEnd);
// }
//
-type CInstIter = CInstIter1 /* sqlite3.c:215383:26 */
+type CInstIter = CInstIter1 /* sqlite3.c:217197:26 */
// Advance the iterator to the next coalesced phrase instance. Return
// an SQLite error code if an error occurs, or SQLITE_OK otherwise.
-func fts5CInstIterNext(tls *libc.TLS, pIter uintptr) int32 { /* sqlite3.c:215400:12: */
+func fts5CInstIterNext(tls *libc.TLS, pIter uintptr) int32 { /* sqlite3.c:217214:12: */
bp := tls.Alloc(12)
defer tls.Free(12)
@@ -172382,7 +174710,7 @@ func fts5CInstIterNext(tls *libc.TLS, pIter uintptr) int32 { /* sqlite3.c:215400
(*CInstIter)(unsafe.Pointer(pIter)).FiStart = -1
(*CInstIter)(unsafe.Pointer(pIter)).FiEnd = -1
- for (rc == SQLITE_OK) && ((*CInstIter)(unsafe.Pointer(pIter)).FiInst < (*CInstIter)(unsafe.Pointer(pIter)).FnInst) {
+ for rc == SQLITE_OK && (*CInstIter)(unsafe.Pointer(pIter)).FiInst < (*CInstIter)(unsafe.Pointer(pIter)).FnInst {
// var ip int32 at bp, 4
// var ic int32 at bp+4, 4
@@ -172393,14 +174721,14 @@ func fts5CInstIterNext(tls *libc.TLS, pIter uintptr) int32 { /* sqlite3.c:215400
f func(*libc.TLS, uintptr, int32, uintptr, uintptr, uintptr) int32
})(unsafe.Pointer(&struct{ uintptr }{(*Fts5ExtensionApi)(unsafe.Pointer((*CInstIter)(unsafe.Pointer(pIter)).FpApi)).FxInst})).f(tls, (*CInstIter)(unsafe.Pointer(pIter)).FpFts, (*CInstIter)(unsafe.Pointer(pIter)).FiInst, bp /* &ip */, bp+4 /* &ic */, bp+8 /* &io */)
if rc == SQLITE_OK {
- if *(*int32)(unsafe.Pointer(bp + 4 /* ic */)) == (*CInstIter)(unsafe.Pointer(pIter)).FiCol {
- var iEnd int32 = ((*(*int32)(unsafe.Pointer(bp + 8 /* io */)) - 1) + (*struct {
+ if *(*int32)(unsafe.Pointer(bp + 4)) == (*CInstIter)(unsafe.Pointer(pIter)).FiCol {
+ var iEnd int32 = *(*int32)(unsafe.Pointer(bp + 8)) - 1 + (*struct {
f func(*libc.TLS, uintptr, int32) int32
- })(unsafe.Pointer(&struct{ uintptr }{(*Fts5ExtensionApi)(unsafe.Pointer((*CInstIter)(unsafe.Pointer(pIter)).FpApi)).FxPhraseSize})).f(tls, (*CInstIter)(unsafe.Pointer(pIter)).FpFts, *(*int32)(unsafe.Pointer(bp /* ip */))))
+ })(unsafe.Pointer(&struct{ uintptr }{(*Fts5ExtensionApi)(unsafe.Pointer((*CInstIter)(unsafe.Pointer(pIter)).FpApi)).FxPhraseSize})).f(tls, (*CInstIter)(unsafe.Pointer(pIter)).FpFts, *(*int32)(unsafe.Pointer(bp)))
if (*CInstIter)(unsafe.Pointer(pIter)).FiStart < 0 {
(*CInstIter)(unsafe.Pointer(pIter)).FiStart = *(*int32)(unsafe.Pointer(bp + 8 /* io */))
(*CInstIter)(unsafe.Pointer(pIter)).FiEnd = iEnd
- } else if *(*int32)(unsafe.Pointer(bp + 8 /* io */)) <= (*CInstIter)(unsafe.Pointer(pIter)).FiEnd {
+ } else if *(*int32)(unsafe.Pointer(bp + 8)) <= (*CInstIter)(unsafe.Pointer(pIter)).FiEnd {
if iEnd > (*CInstIter)(unsafe.Pointer(pIter)).FiEnd {
(*CInstIter)(unsafe.Pointer(pIter)).FiEnd = iEnd
}
@@ -172417,7 +174745,7 @@ func fts5CInstIterNext(tls *libc.TLS, pIter uintptr) int32 { /* sqlite3.c:215400
// Initialize the iterator object indicated by the final parameter to
// iterate through coalesced phrase instances in column iCol.
-func fts5CInstIterInit(tls *libc.TLS, pApi uintptr, pFts uintptr, iCol int32, pIter uintptr) int32 { /* sqlite3.c:215431:12: */
+func fts5CInstIterInit(tls *libc.TLS, pApi uintptr, pFts uintptr, iCol int32, pIter uintptr) int32 { /* sqlite3.c:217245:12: */
var rc int32
libc.Xmemset(tls, pIter, 0, uint32(unsafe.Sizeof(CInstIter{})))
@@ -172426,7 +174754,7 @@ func fts5CInstIterInit(tls *libc.TLS, pApi uintptr, pFts uintptr, iCol int32, pI
(*CInstIter)(unsafe.Pointer(pIter)).FiCol = iCol
rc = (*struct {
f func(*libc.TLS, uintptr, uintptr) int32
- })(unsafe.Pointer(&struct{ uintptr }{(*Fts5ExtensionApi)(unsafe.Pointer(pApi)).FxInstCount})).f(tls, pFts, (pIter + 16 /* &.nInst */))
+ })(unsafe.Pointer(&struct{ uintptr }{(*Fts5ExtensionApi)(unsafe.Pointer(pApi)).FxInstCount})).f(tls, pFts, pIter+16 /* &.nInst */)
if rc == SQLITE_OK {
rc = fts5CInstIterNext(tls, pIter)
@@ -172449,12 +174777,12 @@ type HighlightContext1 = struct {
FnIn int32
FiOff int32
FzOut uintptr
-} /* sqlite3.c:215457:9 */
+} /* sqlite3.c:217271:9 */
// ************************************************************************
//
// Start of highlight() implementation.
-type HighlightContext = HighlightContext1 /* sqlite3.c:215457:33 */
+type HighlightContext = HighlightContext1 /* sqlite3.c:217271:33 */
// Append text to the HighlightContext output string - p->zOut. Argument
// z points to a buffer containing n bytes of text to append. If n is
@@ -172463,15 +174791,15 @@ type HighlightContext = HighlightContext1 /* sqlite3.c:215457:33 */
// If *pRc is set to any value other than SQLITE_OK when this function is
// called, it is a no-op. If an error (i.e. an OOM condition) is encountered,
// *pRc is set to an error code before returning.
-func fts5HighlightAppend(tls *libc.TLS, pRc uintptr, p uintptr, z uintptr, n int32) { /* sqlite3.c:215480:13: */
+func fts5HighlightAppend(tls *libc.TLS, pRc uintptr, p uintptr, z uintptr, n int32) { /* sqlite3.c:217294:13: */
bp := tls.Alloc(24)
defer tls.Free(24)
- if (*(*int32)(unsafe.Pointer(pRc)) == SQLITE_OK) && (z != 0) {
+ if *(*int32)(unsafe.Pointer(pRc)) == SQLITE_OK && z != 0 {
if n < 0 {
n = int32(libc.Xstrlen(tls, z))
}
- (*HighlightContext)(unsafe.Pointer(p)).FzOut = Xsqlite3_mprintf(tls, ts+31941 /* "%z%.*s" */, libc.VaList(bp, (*HighlightContext)(unsafe.Pointer(p)).FzOut, n, z))
+ (*HighlightContext)(unsafe.Pointer(p)).FzOut = Xsqlite3_mprintf(tls, ts+33301 /* "%z%.*s" */, libc.VaList(bp, (*HighlightContext)(unsafe.Pointer(p)).FzOut, n, z))
if (*HighlightContext)(unsafe.Pointer(p)).FzOut == uintptr(0) {
*(*int32)(unsafe.Pointer(pRc)) = SQLITE_NOMEM
}
@@ -172479,7 +174807,7 @@ func fts5HighlightAppend(tls *libc.TLS, pRc uintptr, p uintptr, z uintptr, n int
}
// Tokenizer callback used by implementation of highlight() function.
-func fts5HighlightCb(tls *libc.TLS, pContext uintptr, tflags int32, pToken uintptr, nToken int32, iStartOff int32, iEndOff int32) int32 { /* sqlite3.c:215495:12: */
+func fts5HighlightCb(tls *libc.TLS, pContext uintptr, tflags int32, pToken uintptr, nToken int32, iStartOff int32, iEndOff int32) int32 { /* sqlite3.c:217309:12: */
bp := tls.Alloc(4)
defer tls.Free(4)
@@ -172490,42 +174818,42 @@ func fts5HighlightCb(tls *libc.TLS, pContext uintptr, tflags int32, pToken uintp
_ = pToken
_ = nToken
- if (tflags & FTS5_TOKEN_COLOCATED) != 0 {
+ if tflags&FTS5_TOKEN_COLOCATED != 0 {
return SQLITE_OK
}
iPos = libc.PostIncInt32(&(*HighlightContext)(unsafe.Pointer(p)).FiPos, 1)
if (*HighlightContext)(unsafe.Pointer(p)).FiRangeEnd > 0 {
- if (iPos < (*HighlightContext)(unsafe.Pointer(p)).FiRangeStart) || (iPos > (*HighlightContext)(unsafe.Pointer(p)).FiRangeEnd) {
+ if iPos < (*HighlightContext)(unsafe.Pointer(p)).FiRangeStart || iPos > (*HighlightContext)(unsafe.Pointer(p)).FiRangeEnd {
return SQLITE_OK
}
- if ((*HighlightContext)(unsafe.Pointer(p)).FiRangeStart != 0) && (iPos == (*HighlightContext)(unsafe.Pointer(p)).FiRangeStart) {
+ if (*HighlightContext)(unsafe.Pointer(p)).FiRangeStart != 0 && iPos == (*HighlightContext)(unsafe.Pointer(p)).FiRangeStart {
(*HighlightContext)(unsafe.Pointer(p)).FiOff = iStartOff
}
}
if iPos == (*HighlightContext)(unsafe.Pointer(p)).Fiter.FiStart {
- fts5HighlightAppend(tls, bp /* &rc */, p, ((*HighlightContext)(unsafe.Pointer(p)).FzIn + uintptr((*HighlightContext)(unsafe.Pointer(p)).FiOff)), (iStartOff - (*HighlightContext)(unsafe.Pointer(p)).FiOff))
+ fts5HighlightAppend(tls, bp /* &rc */, p, (*HighlightContext)(unsafe.Pointer(p)).FzIn+uintptr((*HighlightContext)(unsafe.Pointer(p)).FiOff), iStartOff-(*HighlightContext)(unsafe.Pointer(p)).FiOff)
fts5HighlightAppend(tls, bp /* &rc */, p, (*HighlightContext)(unsafe.Pointer(p)).FzOpen, -1)
(*HighlightContext)(unsafe.Pointer(p)).FiOff = iStartOff
}
if iPos == (*HighlightContext)(unsafe.Pointer(p)).Fiter.FiEnd {
- if ((*HighlightContext)(unsafe.Pointer(p)).FiRangeEnd != 0) && ((*HighlightContext)(unsafe.Pointer(p)).Fiter.FiStart < (*HighlightContext)(unsafe.Pointer(p)).FiRangeStart) {
+ if (*HighlightContext)(unsafe.Pointer(p)).FiRangeEnd != 0 && (*HighlightContext)(unsafe.Pointer(p)).Fiter.FiStart < (*HighlightContext)(unsafe.Pointer(p)).FiRangeStart {
fts5HighlightAppend(tls, bp /* &rc */, p, (*HighlightContext)(unsafe.Pointer(p)).FzOpen, -1)
}
- fts5HighlightAppend(tls, bp /* &rc */, p, ((*HighlightContext)(unsafe.Pointer(p)).FzIn + uintptr((*HighlightContext)(unsafe.Pointer(p)).FiOff)), (iEndOff - (*HighlightContext)(unsafe.Pointer(p)).FiOff))
+ fts5HighlightAppend(tls, bp /* &rc */, p, (*HighlightContext)(unsafe.Pointer(p)).FzIn+uintptr((*HighlightContext)(unsafe.Pointer(p)).FiOff), iEndOff-(*HighlightContext)(unsafe.Pointer(p)).FiOff)
fts5HighlightAppend(tls, bp /* &rc */, p, (*HighlightContext)(unsafe.Pointer(p)).FzClose, -1)
(*HighlightContext)(unsafe.Pointer(p)).FiOff = iEndOff
- if *(*int32)(unsafe.Pointer(bp /* rc */)) == SQLITE_OK {
- *(*int32)(unsafe.Pointer(bp /* rc */)) = fts5CInstIterNext(tls, (p /* &.iter */))
+ if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK {
+ *(*int32)(unsafe.Pointer(bp /* rc */)) = fts5CInstIterNext(tls, p)
}
}
- if ((*HighlightContext)(unsafe.Pointer(p)).FiRangeEnd > 0) && (iPos == (*HighlightContext)(unsafe.Pointer(p)).FiRangeEnd) {
- fts5HighlightAppend(tls, bp /* &rc */, p, ((*HighlightContext)(unsafe.Pointer(p)).FzIn + uintptr((*HighlightContext)(unsafe.Pointer(p)).FiOff)), (iEndOff - (*HighlightContext)(unsafe.Pointer(p)).FiOff))
+ if (*HighlightContext)(unsafe.Pointer(p)).FiRangeEnd > 0 && iPos == (*HighlightContext)(unsafe.Pointer(p)).FiRangeEnd {
+ fts5HighlightAppend(tls, bp /* &rc */, p, (*HighlightContext)(unsafe.Pointer(p)).FzIn+uintptr((*HighlightContext)(unsafe.Pointer(p)).FiOff), iEndOff-(*HighlightContext)(unsafe.Pointer(p)).FiOff)
(*HighlightContext)(unsafe.Pointer(p)).FiOff = iEndOff
- if (iPos >= (*HighlightContext)(unsafe.Pointer(p)).Fiter.FiStart) && (iPos < (*HighlightContext)(unsafe.Pointer(p)).Fiter.FiEnd) {
+ if iPos >= (*HighlightContext)(unsafe.Pointer(p)).Fiter.FiStart && iPos < (*HighlightContext)(unsafe.Pointer(p)).Fiter.FiEnd {
fts5HighlightAppend(tls, bp /* &rc */, p, (*HighlightContext)(unsafe.Pointer(p)).FzClose, -1)
}
}
@@ -172534,7 +174862,7 @@ func fts5HighlightCb(tls *libc.TLS, pContext uintptr, tflags int32, pToken uintp
}
// Implementation of highlight() function.
-func fts5HighlightFunction(tls *libc.TLS, pApi uintptr, pFts uintptr, pCtx uintptr, nVal int32, apVal uintptr) { /* sqlite3.c:215549:13: */
+func fts5HighlightFunction(tls *libc.TLS, pApi uintptr, pFts uintptr, pCtx uintptr, nVal int32, apVal uintptr) { /* sqlite3.c:217363:13: */
bp := tls.Alloc(68)
defer tls.Free(68)
@@ -172545,7 +174873,7 @@ func fts5HighlightFunction(tls *libc.TLS, pApi uintptr, pFts uintptr, pCtx uintp
var iCol int32
if nVal != 3 {
- var zErr uintptr = ts + 31948 /* "wrong number of ..." */
+ var zErr uintptr = ts + 33308 /* "wrong number of ..." */
Xsqlite3_result_error(tls, pCtx, zErr, -1)
return
}
@@ -172556,28 +174884,28 @@ func fts5HighlightFunction(tls *libc.TLS, pApi uintptr, pFts uintptr, pCtx uintp
(*HighlightContext)(unsafe.Pointer(bp /* &ctx */)).FzClose = Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(apVal + 2*4)))
*(*int32)(unsafe.Pointer(bp + 64 /* rc */)) = (*struct {
f func(*libc.TLS, uintptr, int32, uintptr, uintptr) int32
- })(unsafe.Pointer(&struct{ uintptr }{(*Fts5ExtensionApi)(unsafe.Pointer(pApi)).FxColumnText})).f(tls, pFts, iCol, (bp /* &ctx */ + 48 /* &.zIn */), (bp /* &ctx */ + 52 /* &.nIn */))
+ })(unsafe.Pointer(&struct{ uintptr }{(*Fts5ExtensionApi)(unsafe.Pointer(pApi)).FxColumnText})).f(tls, pFts, iCol, bp /* &ctx */ +48 /* &.zIn */, bp /* &ctx */ +52 /* &.nIn */)
- if (*HighlightContext)(unsafe.Pointer(bp /* &ctx */)).FzIn != 0 {
- if *(*int32)(unsafe.Pointer(bp + 64 /* rc */)) == SQLITE_OK {
- *(*int32)(unsafe.Pointer(bp + 64 /* rc */)) = fts5CInstIterInit(tls, pApi, pFts, iCol, (bp /* &ctx */ /* &.iter */))
+ if (*HighlightContext)(unsafe.Pointer(bp)).FzIn != 0 {
+ if *(*int32)(unsafe.Pointer(bp + 64)) == SQLITE_OK {
+ *(*int32)(unsafe.Pointer(bp + 64 /* rc */)) = fts5CInstIterInit(tls, pApi, pFts, iCol, bp)
}
- if *(*int32)(unsafe.Pointer(bp + 64 /* rc */)) == SQLITE_OK {
+ if *(*int32)(unsafe.Pointer(bp + 64)) == SQLITE_OK {
*(*int32)(unsafe.Pointer(bp + 64 /* rc */)) = (*struct {
f func(*libc.TLS, uintptr, uintptr, int32, uintptr, uintptr) int32
})(unsafe.Pointer(&struct{ uintptr }{(*Fts5ExtensionApi)(unsafe.Pointer(pApi)).FxTokenize})).f(tls, pFts, (*HighlightContext)(unsafe.Pointer(bp /* &ctx */)).FzIn, (*HighlightContext)(unsafe.Pointer(bp /* &ctx */)).FnIn, bp /* &ctx */, *(*uintptr)(unsafe.Pointer(&struct {
f func(*libc.TLS, uintptr, int32, uintptr, int32, int32, int32) int32
}{fts5HighlightCb})))
}
- fts5HighlightAppend(tls, bp+64 /* &rc */, bp /* &ctx */, ((*HighlightContext)(unsafe.Pointer(bp /* &ctx */)).FzIn + uintptr((*HighlightContext)(unsafe.Pointer(bp /* &ctx */)).FiOff)), ((*HighlightContext)(unsafe.Pointer(bp /* &ctx */)).FnIn - (*HighlightContext)(unsafe.Pointer(bp /* &ctx */)).FiOff))
+ fts5HighlightAppend(tls, bp+64 /* &rc */, bp /* &ctx */, (*HighlightContext)(unsafe.Pointer(bp)).FzIn+uintptr((*HighlightContext)(unsafe.Pointer(bp)).FiOff), (*HighlightContext)(unsafe.Pointer(bp)).FnIn-(*HighlightContext)(unsafe.Pointer(bp)).FiOff)
- if *(*int32)(unsafe.Pointer(bp + 64 /* rc */)) == SQLITE_OK {
+ if *(*int32)(unsafe.Pointer(bp + 64)) == SQLITE_OK {
Xsqlite3_result_text(tls, pCtx, (*HighlightContext)(unsafe.Pointer(bp /* &ctx */)).FzOut, -1, libc.UintptrFromInt32(-1))
}
Xsqlite3_free(tls, (*HighlightContext)(unsafe.Pointer(bp /* &ctx */)).FzOut)
}
- if *(*int32)(unsafe.Pointer(bp + 64 /* rc */)) != SQLITE_OK {
+ if *(*int32)(unsafe.Pointer(bp + 64)) != SQLITE_OK {
Xsqlite3_result_error_code(tls, pCtx, *(*int32)(unsafe.Pointer(bp + 64 /* rc */)))
}
}
@@ -172593,29 +174921,29 @@ type Fts5SFinder1 = struct {
FnFirst int32
FaFirst uintptr
FzDoc uintptr
-} /* sqlite3.c:215598:9 */
+} /* sqlite3.c:217412:9 */
//
// End of highlight() implementation.
//
// Context object passed to the fts5SentenceFinderCb() function.
-type Fts5SFinder = Fts5SFinder1 /* sqlite3.c:215598:28 */
+type Fts5SFinder = Fts5SFinder1 /* sqlite3.c:217412:28 */
// Add an entry to the Fts5SFinder.aFirst[] array. Grow the array if
// necessary. Return SQLITE_OK if successful, or SQLITE_NOMEM if an
// error occurs.
-func fts5SentenceFinderAdd(tls *libc.TLS, p uintptr, iAdd int32) int32 { /* sqlite3.c:215612:12: */
+func fts5SentenceFinderAdd(tls *libc.TLS, p uintptr, iAdd int32) int32 { /* sqlite3.c:217426:12: */
if (*Fts5SFinder)(unsafe.Pointer(p)).FnFirstAlloc == (*Fts5SFinder)(unsafe.Pointer(p)).FnFirst {
var nNew int32
if (*Fts5SFinder)(unsafe.Pointer(p)).FnFirstAlloc != 0 {
- nNew = ((*Fts5SFinder)(unsafe.Pointer(p)).FnFirstAlloc * 2)
+ nNew = (*Fts5SFinder)(unsafe.Pointer(p)).FnFirstAlloc * 2
} else {
nNew = 64
}
var aNew uintptr
- aNew = Xsqlite3_realloc64(tls, (*Fts5SFinder)(unsafe.Pointer(p)).FaFirst, (uint64(uint32(nNew) * uint32(unsafe.Sizeof(int32(0))))))
+ aNew = Xsqlite3_realloc64(tls, (*Fts5SFinder)(unsafe.Pointer(p)).FaFirst, uint64(uint32(nNew)*uint32(unsafe.Sizeof(int32(0)))))
if aNew == uintptr(0) {
return SQLITE_NOMEM
}
@@ -172629,25 +174957,25 @@ func fts5SentenceFinderAdd(tls *libc.TLS, p uintptr, iAdd int32) int32 { /* sqli
// This function is an xTokenize() callback used by the auxiliary snippet()
// function. Its job is to identify tokens that are the first in a sentence.
// For each such token, an entry is added to the SFinder.aFirst[] array.
-func fts5SentenceFinderCb(tls *libc.TLS, pContext uintptr, tflags int32, pToken uintptr, nToken int32, iStartOff int32, iEndOff int32) int32 { /* sqlite3.c:215631:12: */
+func fts5SentenceFinderCb(tls *libc.TLS, pContext uintptr, tflags int32, pToken uintptr, nToken int32, iStartOff int32, iEndOff int32) int32 { /* sqlite3.c:217445:12: */
var rc int32 = SQLITE_OK
_ = pToken
_ = nToken
_ = iEndOff
- if (tflags & FTS5_TOKEN_COLOCATED) == 0 {
+ if tflags&FTS5_TOKEN_COLOCATED == 0 {
var p uintptr = pContext
if (*Fts5SFinder)(unsafe.Pointer(p)).FiPos > 0 {
var i int32
var c uint8 = uint8(0)
- for i = (iStartOff - 1); i >= 0; i-- {
+ for i = iStartOff - 1; i >= 0; i-- {
c = *(*uint8)(unsafe.Pointer((*Fts5SFinder)(unsafe.Pointer(p)).FzDoc + uintptr(i)))
- if (((int32(c) != ' ') && (int32(c) != '\t')) && (int32(c) != '\n')) && (int32(c) != '\r') {
+ if int32(c) != ' ' && int32(c) != '\t' && int32(c) != '\n' && int32(c) != '\r' {
break
}
}
- if (i != (iStartOff - 1)) && ((int32(c) == '.') || (int32(c) == ':')) {
+ if i != iStartOff-1 && (int32(c) == '.' || int32(c) == ':') {
rc = fts5SentenceFinderAdd(tls, p, (*Fts5SFinder)(unsafe.Pointer(p)).FiPos)
}
} else {
@@ -172658,7 +174986,7 @@ func fts5SentenceFinderCb(tls *libc.TLS, pContext uintptr, tflags int32, pToken
return rc
}
-func fts5SnippetScore(tls *libc.TLS, pApi uintptr, pFts uintptr, nDocsize int32, aSeen uintptr, iCol int32, iPos int32, nToken int32, pnScore uintptr, piPos uintptr) int32 { /* sqlite3.c:215664:12: */
+func fts5SnippetScore(tls *libc.TLS, pApi uintptr, pFts uintptr, nDocsize int32, aSeen uintptr, iCol int32, iPos int32, nToken int32, pnScore uintptr, piPos uintptr) int32 { /* sqlite3.c:217478:12: */
bp := tls.Alloc(16)
defer tls.Free(16)
@@ -172672,37 +175000,37 @@ func fts5SnippetScore(tls *libc.TLS, pApi uintptr, pFts uintptr, nDocsize int32,
var nScore int32 = 0
var iLast int32 = 0
- var iEnd Sqlite3_int64 = (Sqlite3_int64(iPos) + Sqlite3_int64(nToken))
+ var iEnd Sqlite3_int64 = Sqlite3_int64(iPos) + Sqlite3_int64(nToken)
rc = (*struct {
f func(*libc.TLS, uintptr, uintptr) int32
})(unsafe.Pointer(&struct{ uintptr }{(*Fts5ExtensionApi)(unsafe.Pointer(pApi)).FxInstCount})).f(tls, pFts, bp /* &nInst */)
- for i = 0; (i < *(*int32)(unsafe.Pointer(bp /* nInst */))) && (rc == SQLITE_OK); i++ {
+ for i = 0; i < *(*int32)(unsafe.Pointer(bp /* nInst */)) && rc == SQLITE_OK; i++ {
rc = (*struct {
f func(*libc.TLS, uintptr, int32, uintptr, uintptr, uintptr) int32
})(unsafe.Pointer(&struct{ uintptr }{(*Fts5ExtensionApi)(unsafe.Pointer(pApi)).FxInst})).f(tls, pFts, i, bp+4 /* &ip */, bp+8 /* &ic */, bp+12 /* &iOff */)
- if (((rc == SQLITE_OK) && (*(*int32)(unsafe.Pointer(bp + 8 /* ic */)) == iCol)) && (*(*int32)(unsafe.Pointer(bp + 12 /* iOff */)) >= iPos)) && (Sqlite3_int64(*(*int32)(unsafe.Pointer(bp + 12 /* iOff */))) < iEnd) {
- nScore = nScore + (func() int32 {
- if *(*uint8)(unsafe.Pointer(aSeen + uintptr(*(*int32)(unsafe.Pointer(bp + 4 /* ip */))))) != 0 {
+ if rc == SQLITE_OK && *(*int32)(unsafe.Pointer(bp + 8)) == iCol && *(*int32)(unsafe.Pointer(bp + 12)) >= iPos && Sqlite3_int64(*(*int32)(unsafe.Pointer(bp + 12))) < iEnd {
+ nScore = nScore + func() int32 {
+ if *(*uint8)(unsafe.Pointer(aSeen + uintptr(*(*int32)(unsafe.Pointer(bp + 4))))) != 0 {
return 1
}
return 1000
- }())
+ }()
*(*uint8)(unsafe.Pointer(aSeen + uintptr(*(*int32)(unsafe.Pointer(bp + 4 /* ip */))))) = uint8(1)
if iFirst < 0 {
iFirst = *(*int32)(unsafe.Pointer(bp + 12 /* iOff */))
}
- iLast = (*(*int32)(unsafe.Pointer(bp + 12 /* iOff */)) + (*struct {
+ iLast = *(*int32)(unsafe.Pointer(bp + 12)) + (*struct {
f func(*libc.TLS, uintptr, int32) int32
- })(unsafe.Pointer(&struct{ uintptr }{(*Fts5ExtensionApi)(unsafe.Pointer(pApi)).FxPhraseSize})).f(tls, pFts, *(*int32)(unsafe.Pointer(bp + 4 /* ip */))))
+ })(unsafe.Pointer(&struct{ uintptr }{(*Fts5ExtensionApi)(unsafe.Pointer(pApi)).FxPhraseSize})).f(tls, pFts, *(*int32)(unsafe.Pointer(bp + 4)))
}
}
*(*int32)(unsafe.Pointer(pnScore)) = nScore
if piPos != 0 {
- var iAdj Sqlite3_int64 = (Sqlite3_int64(iFirst - ((nToken - (iLast - iFirst)) / 2)))
- if (iAdj + Sqlite3_int64(nToken)) > Sqlite3_int64(nDocsize) {
- iAdj = (Sqlite3_int64(nDocsize - nToken))
+ var iAdj Sqlite3_int64 = Sqlite3_int64(iFirst - (nToken-(iLast-iFirst))/2)
+ if iAdj+Sqlite3_int64(nToken) > Sqlite3_int64(nDocsize) {
+ iAdj = Sqlite3_int64(nDocsize - nToken)
}
if iAdj < int64(0) {
iAdj = int64(0)
@@ -172716,16 +175044,16 @@ func fts5SnippetScore(tls *libc.TLS, pApi uintptr, pFts uintptr, nDocsize int32,
// Return the value in pVal interpreted as utf-8 text. Except, if pVal
// contains a NULL value, return a pointer to a static string zero
// bytes in length instead of a NULL pointer.
-func fts5ValueToText(tls *libc.TLS, pVal uintptr) uintptr { /* sqlite3.c:215713:19: */
+func fts5ValueToText(tls *libc.TLS, pVal uintptr) uintptr { /* sqlite3.c:217527:19: */
var zRet uintptr = Xsqlite3_value_text(tls, pVal)
if zRet != 0 {
return zRet
}
- return ts + 755 /* "" */
+ return ts + 1543 /* "" */
}
// Implementation of snippet() function.
-func fts5SnippetFunction(tls *libc.TLS, pApi uintptr, pFts uintptr, pCtx uintptr, nVal int32, apVal uintptr) { /* sqlite3.c:215721:13: */
+func fts5SnippetFunction(tls *libc.TLS, pApi uintptr, pFts uintptr, pCtx uintptr, nVal int32, apVal uintptr) { /* sqlite3.c:217535:13: */
bp := tls.Alloc(124)
defer tls.Free(124)
@@ -172748,7 +175076,7 @@ func fts5SnippetFunction(tls *libc.TLS, pApi uintptr, pFts uintptr, pCtx uintptr
var nCol int32
if nVal != 5 {
- var zErr uintptr = ts + 31998 /* "wrong number of ..." */
+ var zErr uintptr = ts + 33358 /* "wrong number of ..." */
Xsqlite3_result_error(tls, pCtx, zErr, -1)
return
}
@@ -172776,7 +175104,7 @@ func fts5SnippetFunction(tls *libc.TLS, pApi uintptr, pFts uintptr, pCtx uintptr
if aSeen == uintptr(0) {
*(*int32)(unsafe.Pointer(bp + 120 /* rc */)) = SQLITE_NOMEM
}
- if *(*int32)(unsafe.Pointer(bp + 120 /* rc */)) == SQLITE_OK {
+ if *(*int32)(unsafe.Pointer(bp + 120)) == SQLITE_OK {
*(*int32)(unsafe.Pointer(bp + 120 /* rc */)) = (*struct {
f func(*libc.TLS, uintptr, uintptr) int32
})(unsafe.Pointer(&struct{ uintptr }{(*Fts5ExtensionApi)(unsafe.Pointer(pApi)).FxInstCount})).f(tls, pFts, bp+64 /* &nInst */)
@@ -172784,7 +175112,7 @@ func fts5SnippetFunction(tls *libc.TLS, pApi uintptr, pFts uintptr, pCtx uintptr
libc.Xmemset(tls, bp+68 /* &sFinder */, 0, uint32(unsafe.Sizeof(Fts5SFinder{})))
for i = 0; i < nCol; i++ {
- if (iCol < 0) || (iCol == i) {
+ if iCol < 0 || iCol == i {
// var nDoc int32 at bp+88, 4
// var nDocsize int32 at bp+92, 4
@@ -172794,8 +175122,8 @@ func fts5SnippetFunction(tls *libc.TLS, pApi uintptr, pFts uintptr, pCtx uintptr
(*Fts5SFinder)(unsafe.Pointer(bp + 68 /* &sFinder */)).FnFirst = 0
*(*int32)(unsafe.Pointer(bp + 120 /* rc */)) = (*struct {
f func(*libc.TLS, uintptr, int32, uintptr, uintptr) int32
- })(unsafe.Pointer(&struct{ uintptr }{(*Fts5ExtensionApi)(unsafe.Pointer(pApi)).FxColumnText})).f(tls, pFts, i, (bp + 68 /* &sFinder */ + 16 /* &.zDoc */), bp+88 /* &nDoc */)
- if *(*int32)(unsafe.Pointer(bp + 120 /* rc */)) != SQLITE_OK {
+ })(unsafe.Pointer(&struct{ uintptr }{(*Fts5ExtensionApi)(unsafe.Pointer(pApi)).FxColumnText})).f(tls, pFts, i, bp+68 /* &sFinder */ +16 /* &.zDoc */, bp+88 /* &nDoc */)
+ if *(*int32)(unsafe.Pointer(bp + 120)) != SQLITE_OK {
break
}
*(*int32)(unsafe.Pointer(bp + 120 /* rc */)) = (*struct {
@@ -172804,17 +175132,17 @@ func fts5SnippetFunction(tls *libc.TLS, pApi uintptr, pFts uintptr, pCtx uintptr
(*Fts5SFinder)(unsafe.Pointer(bp+68 /* &sFinder */)).FzDoc, *(*int32)(unsafe.Pointer(bp + 88 /* nDoc */)), bp+68 /* &sFinder */, *(*uintptr)(unsafe.Pointer(&struct {
f func(*libc.TLS, uintptr, int32, uintptr, int32, int32, int32) int32
}{fts5SentenceFinderCb})))
- if *(*int32)(unsafe.Pointer(bp + 120 /* rc */)) != SQLITE_OK {
+ if *(*int32)(unsafe.Pointer(bp + 120)) != SQLITE_OK {
break
}
*(*int32)(unsafe.Pointer(bp + 120 /* rc */)) = (*struct {
f func(*libc.TLS, uintptr, int32, uintptr) int32
})(unsafe.Pointer(&struct{ uintptr }{(*Fts5ExtensionApi)(unsafe.Pointer(pApi)).FxColumnSize})).f(tls, pFts, i, bp+92 /* &nDocsize */)
- if *(*int32)(unsafe.Pointer(bp + 120 /* rc */)) != SQLITE_OK {
+ if *(*int32)(unsafe.Pointer(bp + 120)) != SQLITE_OK {
break
}
- for ii = 0; (*(*int32)(unsafe.Pointer(bp + 120 /* rc */)) == SQLITE_OK) && (ii < *(*int32)(unsafe.Pointer(bp + 64 /* nInst */))); ii++ {
+ for ii = 0; *(*int32)(unsafe.Pointer(bp + 120 /* rc */)) == SQLITE_OK && ii < *(*int32)(unsafe.Pointer(bp + 64 /* nInst */)); ii++ {
// var ip int32 at bp+96, 4
// var ic int32 at bp+100, 4
@@ -172830,44 +175158,44 @@ func fts5SnippetFunction(tls *libc.TLS, pApi uintptr, pFts uintptr, pCtx uintptr
*(*int32)(unsafe.Pointer(bp + 120 /* rc */)) = (*struct {
f func(*libc.TLS, uintptr, int32, uintptr, uintptr, uintptr) int32
})(unsafe.Pointer(&struct{ uintptr }{(*Fts5ExtensionApi)(unsafe.Pointer(pApi)).FxInst})).f(tls, pFts, ii, bp+96 /* &ip */, bp+100 /* &ic */, bp+104 /* &io */)
- if *(*int32)(unsafe.Pointer(bp + 100 /* ic */)) != i {
+ if *(*int32)(unsafe.Pointer(bp + 100)) != i {
continue
}
- if *(*int32)(unsafe.Pointer(bp + 104 /* io */)) > *(*int32)(unsafe.Pointer(bp + 92 /* nDocsize */)) {
- *(*int32)(unsafe.Pointer(bp + 120 /* rc */)) = (SQLITE_CORRUPT | (int32(1) << 8))
+ if *(*int32)(unsafe.Pointer(bp + 104)) > *(*int32)(unsafe.Pointer(bp + 92)) {
+ *(*int32)(unsafe.Pointer(bp + 120 /* rc */)) = SQLITE_CORRUPT | int32(1)<<8
}
- if *(*int32)(unsafe.Pointer(bp + 120 /* rc */)) != SQLITE_OK {
+ if *(*int32)(unsafe.Pointer(bp + 120)) != SQLITE_OK {
continue
}
libc.Xmemset(tls, aSeen, 0, uint32(nPhrase))
*(*int32)(unsafe.Pointer(bp + 120 /* rc */)) = fts5SnippetScore(tls, pApi, pFts, *(*int32)(unsafe.Pointer(bp + 92 /* nDocsize */)), aSeen, i,
*(*int32)(unsafe.Pointer(bp + 104 /* io */)), nToken, bp+108 /* &nScore */, bp+112 /* &iAdj */)
- if (*(*int32)(unsafe.Pointer(bp + 120 /* rc */)) == SQLITE_OK) && (*(*int32)(unsafe.Pointer(bp + 108 /* nScore */)) > nBestScore) {
+ if *(*int32)(unsafe.Pointer(bp + 120)) == SQLITE_OK && *(*int32)(unsafe.Pointer(bp + 108)) > nBestScore {
nBestScore = *(*int32)(unsafe.Pointer(bp + 108 /* nScore */))
iBestCol = i
iBestStart = *(*int32)(unsafe.Pointer(bp + 112 /* iAdj */))
*(*int32)(unsafe.Pointer(bp + 116 /* nColSize */)) = *(*int32)(unsafe.Pointer(bp + 92 /* nDocsize */))
}
- if ((*(*int32)(unsafe.Pointer(bp + 120 /* rc */)) == SQLITE_OK) && ((*Fts5SFinder)(unsafe.Pointer(bp+68 /* &sFinder */)).FnFirst != 0)) && (*(*int32)(unsafe.Pointer(bp + 92 /* nDocsize */)) > nToken) {
- for jj = 0; jj < ((*Fts5SFinder)(unsafe.Pointer(bp+68 /* &sFinder */)).FnFirst - 1); jj++ {
- if *(*int32)(unsafe.Pointer((*Fts5SFinder)(unsafe.Pointer(bp+68 /* &sFinder */)).FaFirst + uintptr((jj+1))*4)) > *(*int32)(unsafe.Pointer(bp + 104 /* io */)) {
+ if *(*int32)(unsafe.Pointer(bp + 120)) == SQLITE_OK && (*Fts5SFinder)(unsafe.Pointer(bp+68)).FnFirst != 0 && *(*int32)(unsafe.Pointer(bp + 92)) > nToken {
+ for jj = 0; jj < (*Fts5SFinder)(unsafe.Pointer(bp+68 /* &sFinder */)).FnFirst-1; jj++ {
+ if *(*int32)(unsafe.Pointer((*Fts5SFinder)(unsafe.Pointer(bp+68)).FaFirst + uintptr(jj+1)*4)) > *(*int32)(unsafe.Pointer(bp + 104)) {
break
}
}
- if *(*int32)(unsafe.Pointer((*Fts5SFinder)(unsafe.Pointer(bp+68 /* &sFinder */)).FaFirst + uintptr(jj)*4)) < *(*int32)(unsafe.Pointer(bp + 104 /* io */)) {
+ if *(*int32)(unsafe.Pointer((*Fts5SFinder)(unsafe.Pointer(bp+68)).FaFirst + uintptr(jj)*4)) < *(*int32)(unsafe.Pointer(bp + 104)) {
libc.Xmemset(tls, aSeen, 0, uint32(nPhrase))
*(*int32)(unsafe.Pointer(bp + 120 /* rc */)) = fts5SnippetScore(tls, pApi, pFts, *(*int32)(unsafe.Pointer(bp + 92 /* nDocsize */)), aSeen, i,
*(*int32)(unsafe.Pointer((*Fts5SFinder)(unsafe.Pointer(bp+68 /* &sFinder */)).FaFirst + uintptr(jj)*4)), nToken, bp+108 /* &nScore */, uintptr(0))
*(*int32)(unsafe.Pointer(bp + 108 /* nScore */)) += func() int32 {
- if *(*int32)(unsafe.Pointer((*Fts5SFinder)(unsafe.Pointer(bp+68 /* &sFinder */)).FaFirst + uintptr(jj)*4)) == 0 {
+ if *(*int32)(unsafe.Pointer((*Fts5SFinder)(unsafe.Pointer(bp+68)).FaFirst + uintptr(jj)*4)) == 0 {
return 120
}
return 100
}()
- if (*(*int32)(unsafe.Pointer(bp + 120 /* rc */)) == SQLITE_OK) && (*(*int32)(unsafe.Pointer(bp + 108 /* nScore */)) > nBestScore) {
+ if *(*int32)(unsafe.Pointer(bp + 120)) == SQLITE_OK && *(*int32)(unsafe.Pointer(bp + 108)) > nBestScore {
nBestScore = *(*int32)(unsafe.Pointer(bp + 108 /* nScore */))
iBestCol = i
iBestStart = *(*int32)(unsafe.Pointer((*Fts5SFinder)(unsafe.Pointer(bp+68 /* &sFinder */)).FaFirst + uintptr(jj)*4))
@@ -172879,23 +175207,23 @@ func fts5SnippetFunction(tls *libc.TLS, pApi uintptr, pFts uintptr, pCtx uintptr
}
}
- if *(*int32)(unsafe.Pointer(bp + 120 /* rc */)) == SQLITE_OK {
+ if *(*int32)(unsafe.Pointer(bp + 120)) == SQLITE_OK {
*(*int32)(unsafe.Pointer(bp + 120 /* rc */)) = (*struct {
f func(*libc.TLS, uintptr, int32, uintptr, uintptr) int32
- })(unsafe.Pointer(&struct{ uintptr }{(*Fts5ExtensionApi)(unsafe.Pointer(pApi)).FxColumnText})).f(tls, pFts, iBestCol, (bp /* &ctx */ + 48 /* &.zIn */), (bp /* &ctx */ + 52 /* &.nIn */))
+ })(unsafe.Pointer(&struct{ uintptr }{(*Fts5ExtensionApi)(unsafe.Pointer(pApi)).FxColumnText})).f(tls, pFts, iBestCol, bp /* &ctx */ +48 /* &.zIn */, bp /* &ctx */ +52 /* &.nIn */)
}
- if (*(*int32)(unsafe.Pointer(bp + 120 /* rc */)) == SQLITE_OK) && (*(*int32)(unsafe.Pointer(bp + 116 /* nColSize */)) == 0) {
+ if *(*int32)(unsafe.Pointer(bp + 120)) == SQLITE_OK && *(*int32)(unsafe.Pointer(bp + 116)) == 0 {
*(*int32)(unsafe.Pointer(bp + 120 /* rc */)) = (*struct {
f func(*libc.TLS, uintptr, int32, uintptr) int32
})(unsafe.Pointer(&struct{ uintptr }{(*Fts5ExtensionApi)(unsafe.Pointer(pApi)).FxColumnSize})).f(tls, pFts, iBestCol, bp+116 /* &nColSize */)
}
- if (*HighlightContext)(unsafe.Pointer(bp /* &ctx */)).FzIn != 0 {
- if *(*int32)(unsafe.Pointer(bp + 120 /* rc */)) == SQLITE_OK {
- *(*int32)(unsafe.Pointer(bp + 120 /* rc */)) = fts5CInstIterInit(tls, pApi, pFts, iBestCol, (bp /* &ctx */ /* &.iter */))
+ if (*HighlightContext)(unsafe.Pointer(bp)).FzIn != 0 {
+ if *(*int32)(unsafe.Pointer(bp + 120)) == SQLITE_OK {
+ *(*int32)(unsafe.Pointer(bp + 120 /* rc */)) = fts5CInstIterInit(tls, pApi, pFts, iBestCol, bp)
}
(*HighlightContext)(unsafe.Pointer(bp /* &ctx */)).FiRangeStart = iBestStart
- (*HighlightContext)(unsafe.Pointer(bp /* &ctx */)).FiRangeEnd = ((iBestStart + nToken) - 1)
+ (*HighlightContext)(unsafe.Pointer(bp /* &ctx */)).FiRangeEnd = iBestStart + nToken - 1
if iBestStart > 0 {
fts5HighlightAppend(tls, bp+120 /* &rc */, bp /* &ctx */, zEllips, -1)
@@ -172903,24 +175231,24 @@ func fts5SnippetFunction(tls *libc.TLS, pApi uintptr, pFts uintptr, pCtx uintptr
// Advance iterator ctx.iter so that it points to the first coalesced
// phrase instance at or following position iBestStart.
- for (((*HighlightContext)(unsafe.Pointer(bp /* &ctx */)).Fiter.FiStart >= 0) && ((*HighlightContext)(unsafe.Pointer(bp /* &ctx */)).Fiter.FiStart < iBestStart)) && (*(*int32)(unsafe.Pointer(bp + 120 /* rc */)) == SQLITE_OK) {
- *(*int32)(unsafe.Pointer(bp + 120 /* rc */)) = fts5CInstIterNext(tls, (bp /* &ctx */ /* &.iter */))
+ for (*HighlightContext)(unsafe.Pointer(bp)).Fiter.FiStart >= 0 && (*HighlightContext)(unsafe.Pointer(bp)).Fiter.FiStart < iBestStart && *(*int32)(unsafe.Pointer(bp + 120)) == SQLITE_OK {
+ *(*int32)(unsafe.Pointer(bp + 120 /* rc */)) = fts5CInstIterNext(tls, bp)
}
- if *(*int32)(unsafe.Pointer(bp + 120 /* rc */)) == SQLITE_OK {
+ if *(*int32)(unsafe.Pointer(bp + 120)) == SQLITE_OK {
*(*int32)(unsafe.Pointer(bp + 120 /* rc */)) = (*struct {
f func(*libc.TLS, uintptr, uintptr, int32, uintptr, uintptr) int32
})(unsafe.Pointer(&struct{ uintptr }{(*Fts5ExtensionApi)(unsafe.Pointer(pApi)).FxTokenize})).f(tls, pFts, (*HighlightContext)(unsafe.Pointer(bp /* &ctx */)).FzIn, (*HighlightContext)(unsafe.Pointer(bp /* &ctx */)).FnIn, bp /* &ctx */, *(*uintptr)(unsafe.Pointer(&struct {
f func(*libc.TLS, uintptr, int32, uintptr, int32, int32, int32) int32
}{fts5HighlightCb})))
}
- if (*HighlightContext)(unsafe.Pointer(bp /* &ctx */)).FiRangeEnd >= (*(*int32)(unsafe.Pointer(bp + 116 /* nColSize */)) - 1) {
- fts5HighlightAppend(tls, bp+120 /* &rc */, bp /* &ctx */, ((*HighlightContext)(unsafe.Pointer(bp /* &ctx */)).FzIn + uintptr((*HighlightContext)(unsafe.Pointer(bp /* &ctx */)).FiOff)), ((*HighlightContext)(unsafe.Pointer(bp /* &ctx */)).FnIn - (*HighlightContext)(unsafe.Pointer(bp /* &ctx */)).FiOff))
+ if (*HighlightContext)(unsafe.Pointer(bp)).FiRangeEnd >= *(*int32)(unsafe.Pointer(bp + 116))-1 {
+ fts5HighlightAppend(tls, bp+120 /* &rc */, bp /* &ctx */, (*HighlightContext)(unsafe.Pointer(bp)).FzIn+uintptr((*HighlightContext)(unsafe.Pointer(bp)).FiOff), (*HighlightContext)(unsafe.Pointer(bp)).FnIn-(*HighlightContext)(unsafe.Pointer(bp)).FiOff)
} else {
fts5HighlightAppend(tls, bp+120 /* &rc */, bp /* &ctx */, zEllips, -1)
}
}
- if *(*int32)(unsafe.Pointer(bp + 120 /* rc */)) == SQLITE_OK {
+ if *(*int32)(unsafe.Pointer(bp + 120)) == SQLITE_OK {
Xsqlite3_result_text(tls, pCtx, (*HighlightContext)(unsafe.Pointer(bp /* &ctx */)).FzOut, -1, libc.UintptrFromInt32(-1))
} else {
Xsqlite3_result_error_code(tls, pCtx, *(*int32)(unsafe.Pointer(bp + 120 /* rc */)))
@@ -172940,28 +175268,28 @@ type Fts5Bm25Data1 = struct {
Favgdl float64
FaIDF uintptr
FaFreq uintptr
-} /* sqlite3.c:215879:9 */
+} /* sqlite3.c:217693:9 */
//**********************************************************************
// The first time the bm25() function is called for a query, an instance
// of the following structure is allocated and populated.
-type Fts5Bm25Data = Fts5Bm25Data1 /* sqlite3.c:215879:29 */
+type Fts5Bm25Data = Fts5Bm25Data1 /* sqlite3.c:217693:29 */
// Callback used by fts5Bm25GetData() to count the number of rows in the
// table matched by each individual phrase within the query.
-func fts5CountCb(tls *libc.TLS, pApi uintptr, pFts uintptr, pUserData uintptr) int32 { /* sqlite3.c:215891:12: */
+func fts5CountCb(tls *libc.TLS, pApi uintptr, pFts uintptr, pUserData uintptr) int32 { /* sqlite3.c:217705:12: */
var pn uintptr = pUserData
_ = pApi
_ = pFts
- (*(*Sqlite3_int64)(unsafe.Pointer(pn)))++
+ *(*Sqlite3_int64)(unsafe.Pointer(pn))++
return SQLITE_OK
}
// Set *ppData to point to the Fts5Bm25Data object for the current query.
// If the object has not already been allocated, allocate and populate it
// now.
-func fts5Bm25GetData(tls *libc.TLS, pApi uintptr, pFts uintptr, ppData uintptr) int32 { /* sqlite3.c:215907:12: */
+func fts5Bm25GetData(tls *libc.TLS, pApi uintptr, pFts uintptr, ppData uintptr) int32 { /* sqlite3.c:217721:12: */
bp := tls.Alloc(24)
defer tls.Free(24)
@@ -172982,15 +175310,15 @@ func fts5Bm25GetData(tls *libc.TLS, pApi uintptr, pFts uintptr, ppData uintptr)
nPhrase = (*struct {
f func(*libc.TLS, uintptr) int32
})(unsafe.Pointer(&struct{ uintptr }{(*Fts5ExtensionApi)(unsafe.Pointer(pApi)).FxPhraseCount})).f(tls, pFts)
- nByte = (Sqlite3_int64(uint32(unsafe.Sizeof(Fts5Bm25Data{})) + ((uint32(nPhrase * 2)) * uint32(unsafe.Sizeof(float64(0))))))
+ nByte = Sqlite3_int64(uint32(unsafe.Sizeof(Fts5Bm25Data{})) + uint32(nPhrase*2)*uint32(unsafe.Sizeof(float64(0))))
p = Xsqlite3_malloc64(tls, uint64(nByte))
if p == uintptr(0) {
rc = SQLITE_NOMEM
} else {
libc.Xmemset(tls, p, 0, Size_t(nByte))
(*Fts5Bm25Data)(unsafe.Pointer(p)).FnPhrase = nPhrase
- (*Fts5Bm25Data)(unsafe.Pointer(p)).FaIDF = (p + 1*24)
- (*Fts5Bm25Data)(unsafe.Pointer(p)).FaFreq = ((*Fts5Bm25Data)(unsafe.Pointer(p)).FaIDF + uintptr(nPhrase)*8)
+ (*Fts5Bm25Data)(unsafe.Pointer(p)).FaIDF = p + 1*24
+ (*Fts5Bm25Data)(unsafe.Pointer(p)).FaFreq = (*Fts5Bm25Data)(unsafe.Pointer(p)).FaIDF + uintptr(nPhrase)*8
}
// Calculate the average document length for this FTS5 table
@@ -173006,11 +175334,11 @@ func fts5Bm25GetData(tls *libc.TLS, pApi uintptr, pFts uintptr, ppData uintptr)
})(unsafe.Pointer(&struct{ uintptr }{(*Fts5ExtensionApi)(unsafe.Pointer(pApi)).FxColumnTotalSize})).f(tls, pFts, -1, bp+8 /* &nToken */)
}
if rc == SQLITE_OK {
- (*Fts5Bm25Data)(unsafe.Pointer(p)).Favgdl = (float64(*(*Sqlite3_int64)(unsafe.Pointer(bp + 8 /* nToken */))) / float64(*(*Sqlite3_int64)(unsafe.Pointer(bp /* nRow */))))
+ (*Fts5Bm25Data)(unsafe.Pointer(p)).Favgdl = float64(*(*Sqlite3_int64)(unsafe.Pointer(bp + 8))) / float64(*(*Sqlite3_int64)(unsafe.Pointer(bp /* nRow */)))
}
// Calculate an IDF for each phrase in the query
- for i = 0; (rc == SQLITE_OK) && (i < nPhrase); i++ {
+ for i = 0; rc == SQLITE_OK && i < nPhrase; i++ {
*(*Sqlite3_int64)(unsafe.Pointer(bp + 16 /* nHit */)) = int64(0)
rc = (*struct {
f func(*libc.TLS, uintptr, int32, uintptr, uintptr) int32
@@ -173031,7 +175359,7 @@ func fts5Bm25GetData(tls *libc.TLS, pApi uintptr, pFts uintptr, ppData uintptr)
// negative. Which is undesirable. So the mimimum allowable IDF is
// (1e-6) - roughly the same as a term that appears in just over
// half of set of 5,000,000 documents.
- var idf float64 = libc.Xlog(tls, (((float64(*(*Sqlite3_int64)(unsafe.Pointer(bp /* nRow */)) - *(*Sqlite3_int64)(unsafe.Pointer(bp + 16 /* nHit */)))) + 0.5) / (float64(*(*Sqlite3_int64)(unsafe.Pointer(bp + 16 /* nHit */))) + 0.5)))
+ var idf float64 = libc.Xlog(tls, (float64(*(*Sqlite3_int64)(unsafe.Pointer(bp))-*(*Sqlite3_int64)(unsafe.Pointer(bp + 16)))+0.5)/(float64(*(*Sqlite3_int64)(unsafe.Pointer(bp + 16)))+0.5))
if idf <= 0.0 {
idf = 1e-6
}
@@ -173055,7 +175383,7 @@ func fts5Bm25GetData(tls *libc.TLS, pApi uintptr, pFts uintptr, ppData uintptr)
}
// Implementation of bm25() function.
-func fts5Bm25Function(tls *libc.TLS, pApi uintptr, pFts uintptr, pCtx uintptr, nVal int32, apVal uintptr) { /* sqlite3.c:215980:13: */
+func fts5Bm25Function(tls *libc.TLS, pApi uintptr, pFts uintptr, pCtx uintptr, nVal int32, apVal uintptr) { /* sqlite3.c:217794:13: */
bp := tls.Alloc(24)
defer tls.Free(24)
@@ -173075,12 +175403,12 @@ func fts5Bm25Function(tls *libc.TLS, pApi uintptr, pFts uintptr, pCtx uintptr, n
rc = fts5Bm25GetData(tls, pApi, pFts, bp /* &pData */)
if rc == SQLITE_OK {
aFreq = (*Fts5Bm25Data)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* pData */)))).FaFreq
- libc.Xmemset(tls, aFreq, 0, (uint32(unsafe.Sizeof(float64(0))) * uint32((*Fts5Bm25Data)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* pData */)))).FnPhrase)))
+ libc.Xmemset(tls, aFreq, 0, uint32(unsafe.Sizeof(float64(0)))*uint32((*Fts5Bm25Data)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FnPhrase))
rc = (*struct {
f func(*libc.TLS, uintptr, uintptr) int32
})(unsafe.Pointer(&struct{ uintptr }{(*Fts5ExtensionApi)(unsafe.Pointer(pApi)).FxInstCount})).f(tls, pFts, bp+4 /* &nInst */)
}
- for i = 0; (rc == SQLITE_OK) && (i < *(*int32)(unsafe.Pointer(bp + 4 /* nInst */))); i++ {
+ for i = 0; rc == SQLITE_OK && i < *(*int32)(unsafe.Pointer(bp + 4 /* nInst */)); i++ {
// var ip int32 at bp+8, 4
// var ic int32 at bp+12, 4
@@ -173092,12 +175420,12 @@ func fts5Bm25Function(tls *libc.TLS, pApi uintptr, pFts uintptr, pCtx uintptr, n
})(unsafe.Pointer(&struct{ uintptr }{(*Fts5ExtensionApi)(unsafe.Pointer(pApi)).FxInst})).f(tls, pFts, i, bp+8 /* &ip */, bp+12 /* &ic */, bp+16 /* &io */)
if rc == SQLITE_OK {
var w float64
- if nVal > *(*int32)(unsafe.Pointer(bp + 12 /* ic */)) {
+ if nVal > *(*int32)(unsafe.Pointer(bp + 12)) {
w = Xsqlite3_value_double(tls, *(*uintptr)(unsafe.Pointer(apVal + uintptr(*(*int32)(unsafe.Pointer(bp + 12 /* ic */)))*4)))
} else {
w = 1.0
}
- *(*float64)(unsafe.Pointer(aFreq + uintptr(*(*int32)(unsafe.Pointer(bp + 8 /* ip */)))*8)) += (w)
+ *(*float64)(unsafe.Pointer(aFreq + uintptr(*(*int32)(unsafe.Pointer(bp + 8)))*8)) += w
}
}
@@ -173115,33 +175443,33 @@ func fts5Bm25Function(tls *libc.TLS, pApi uintptr, pFts uintptr, pCtx uintptr, n
// error has occurred, throw an exception.
if rc == SQLITE_OK {
for i = 0; i < (*Fts5Bm25Data)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* pData */)))).FnPhrase; i++ {
- score = score + (*(*float64)(unsafe.Pointer((*Fts5Bm25Data)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* pData */)))).FaIDF + uintptr(i)*8)) * ((*(*float64)(unsafe.Pointer(aFreq + uintptr(i)*8)) * (k1 + 1.0)) / (*(*float64)(unsafe.Pointer(aFreq + uintptr(i)*8)) + (k1 * ((float64(1) - b) + ((b * D) / (*Fts5Bm25Data)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* pData */)))).Favgdl))))))
+ score = score + *(*float64)(unsafe.Pointer((*Fts5Bm25Data)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FaIDF + uintptr(i)*8))*(*(*float64)(unsafe.Pointer(aFreq + uintptr(i)*8))*(k1+1.0)/(*(*float64)(unsafe.Pointer(aFreq + uintptr(i)*8))+k1*(float64(1)-b+b*D/(*Fts5Bm25Data)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).Favgdl)))
}
- Xsqlite3_result_double(tls, pCtx, (-1.0 * score))
+ Xsqlite3_result_double(tls, pCtx, -1.0*score)
} else {
Xsqlite3_result_error_code(tls, pCtx, rc)
}
}
-func sqlite3Fts5AuxInit(tls *libc.TLS, pApi uintptr) int32 { /* sqlite3.c:216036:12: */
+func sqlite3Fts5AuxInit(tls *libc.TLS, pApi uintptr) int32 { /* sqlite3.c:217850:12: */
bp := tls.Alloc(48)
defer tls.Free(48)
*(*[3]Builtin)(unsafe.Pointer(bp /* aBuiltin */)) = [3]Builtin{
- {FzFunc: ts + 32046 /* "snippet" */, FxFunc: *(*uintptr)(unsafe.Pointer(&struct {
+ {FzFunc: ts + 33406 /* "snippet" */, FxFunc: *(*uintptr)(unsafe.Pointer(&struct {
f func(*libc.TLS, uintptr, uintptr, uintptr, int32, uintptr)
}{fts5SnippetFunction}))},
- {FzFunc: ts + 32054 /* "highlight" */, FxFunc: *(*uintptr)(unsafe.Pointer(&struct {
+ {FzFunc: ts + 33414 /* "highlight" */, FxFunc: *(*uintptr)(unsafe.Pointer(&struct {
f func(*libc.TLS, uintptr, uintptr, uintptr, int32, uintptr)
}{fts5HighlightFunction}))},
- {FzFunc: ts + 32064 /* "bm25" */, FxFunc: *(*uintptr)(unsafe.Pointer(&struct {
+ {FzFunc: ts + 33424 /* "bm25" */, FxFunc: *(*uintptr)(unsafe.Pointer(&struct {
f func(*libc.TLS, uintptr, uintptr, uintptr, int32, uintptr)
}{fts5Bm25Function}))},
}
var rc int32 = SQLITE_OK // Return code
var i int32 // To iterate through builtin functions
- for i = 0; (rc == SQLITE_OK) && (i < (int32(uint32(unsafe.Sizeof([3]Builtin{})) / uint32(unsafe.Sizeof(Builtin{}))))); i++ {
+ for i = 0; rc == SQLITE_OK && i < int32(uint32(unsafe.Sizeof([3]Builtin{}))/uint32(unsafe.Sizeof(Builtin{}))); i++ {
rc = (*struct {
f func(*libc.TLS, uintptr, uintptr, uintptr, Fts5_extension_function, uintptr) int32
})(unsafe.Pointer(&struct{ uintptr }{(*Fts5_api)(unsafe.Pointer(pApi)).FxCreateFunction})).f(tls, pApi,
@@ -173159,7 +175487,7 @@ type Builtin = struct {
FpUserData uintptr
FxFunc Fts5_extension_function
FxDestroy uintptr
-} /* sqlite3.c:216037:3 */
+} /* sqlite3.c:217851:3 */
// 2014 May 31
//
@@ -173174,7 +175502,7 @@ type Builtin = struct {
// #include "fts5Int.h"
-func sqlite3Fts5BufferSize(tls *libc.TLS, pRc uintptr, pBuf uintptr, nByte U32) int32 { /* sqlite3.c:216079:12: */
+func sqlite3Fts5BufferSize(tls *libc.TLS, pRc uintptr, pBuf uintptr, nByte U32) int32 { /* sqlite3.c:217893:12: */
if U32((*Fts5Buffer)(unsafe.Pointer(pBuf)).FnSpace) < nByte {
var nNew U64
if (*Fts5Buffer)(unsafe.Pointer(pBuf)).FnSpace != 0 {
@@ -173184,7 +175512,7 @@ func sqlite3Fts5BufferSize(tls *libc.TLS, pRc uintptr, pBuf uintptr, nByte U32)
}
var pNew uintptr
for nNew < U64(nByte) {
- nNew = (nNew * uint64(2))
+ nNew = nNew * uint64(2)
}
pNew = Xsqlite3_realloc64(tls, (*Fts5Buffer)(unsafe.Pointer(pBuf)).Fp, nNew)
if pNew == uintptr(0) {
@@ -173200,54 +175528,53 @@ func sqlite3Fts5BufferSize(tls *libc.TLS, pRc uintptr, pBuf uintptr, nByte U32)
// Encode value iVal as an SQLite varint and append it to the buffer object
// pBuf. If an OOM error occurs, set the error code in p.
-func sqlite3Fts5BufferAppendVarint(tls *libc.TLS, pRc uintptr, pBuf uintptr, iVal I64) { /* sqlite3.c:216103:13: */
+func sqlite3Fts5BufferAppendVarint(tls *libc.TLS, pRc uintptr, pBuf uintptr, iVal I64) { /* sqlite3.c:217917:13: */
if func() int32 {
- if ((U32((*Fts5Buffer)(unsafe.Pointer(pBuf)).Fn)) + (U32(9))) <= (U32((*Fts5Buffer)(unsafe.Pointer(pBuf)).FnSpace)) {
+ if U32((*Fts5Buffer)(unsafe.Pointer(pBuf)).Fn)+U32(9) <= U32((*Fts5Buffer)(unsafe.Pointer(pBuf)).FnSpace) {
return 0
}
- return sqlite3Fts5BufferSize(tls, pRc, pBuf, (uint32((9) + (*Fts5Buffer)(unsafe.Pointer((pBuf))).Fn)))
+ return sqlite3Fts5BufferSize(tls, pRc, pBuf, uint32(9+(*Fts5Buffer)(unsafe.Pointer(pBuf)).Fn))
}() != 0 {
return
}
- *(*int32)(unsafe.Pointer(pBuf + 4 /* &.n */)) += (sqlite3Fts5PutVarint(tls, ((*Fts5Buffer)(unsafe.Pointer(pBuf)).Fp + uintptr((*Fts5Buffer)(unsafe.Pointer(pBuf)).Fn)), uint64(iVal)))
+ *(*int32)(unsafe.Pointer(pBuf + 4)) += sqlite3Fts5PutVarint(tls, (*Fts5Buffer)(unsafe.Pointer(pBuf)).Fp+uintptr((*Fts5Buffer)(unsafe.Pointer(pBuf)).Fn), uint64(iVal))
}
-func sqlite3Fts5Put32(tls *libc.TLS, aBuf uintptr, iVal int32) { /* sqlite3.c:216108:13: */
- *(*U8)(unsafe.Pointer(aBuf)) = (U8((iVal >> 24) & 0x00FF))
- *(*U8)(unsafe.Pointer(aBuf + 1)) = (U8((iVal >> 16) & 0x00FF))
- *(*U8)(unsafe.Pointer(aBuf + 2)) = (U8((iVal >> 8) & 0x00FF))
- *(*U8)(unsafe.Pointer(aBuf + 3)) = (U8((iVal >> 0) & 0x00FF))
+func sqlite3Fts5Put32(tls *libc.TLS, aBuf uintptr, iVal int32) { /* sqlite3.c:217922:13: */
+ *(*U8)(unsafe.Pointer(aBuf)) = U8(iVal >> 24 & 0x00FF)
+ *(*U8)(unsafe.Pointer(aBuf + 1)) = U8(iVal >> 16 & 0x00FF)
+ *(*U8)(unsafe.Pointer(aBuf + 2)) = U8(iVal >> 8 & 0x00FF)
+ *(*U8)(unsafe.Pointer(aBuf + 3)) = U8(iVal >> 0 & 0x00FF)
}
-func sqlite3Fts5Get32(tls *libc.TLS, aBuf uintptr) int32 { /* sqlite3.c:216115:12: */
- return (int32(((((U32(*(*U8)(unsafe.Pointer(aBuf)))) << 24) + (U32(int32(*(*U8)(unsafe.Pointer(aBuf + 1))) << 16))) + (U32(int32(*(*U8)(unsafe.Pointer(aBuf + 2))) << 8))) + U32(*(*U8)(unsafe.Pointer(aBuf + 3)))))
+func sqlite3Fts5Get32(tls *libc.TLS, aBuf uintptr) int32 { /* sqlite3.c:217929:12: */
+ return int32(U32(*(*U8)(unsafe.Pointer(aBuf)))<<24 + U32(int32(*(*U8)(unsafe.Pointer(aBuf + 1)))<<16) + U32(int32(*(*U8)(unsafe.Pointer(aBuf + 2)))<<8) + U32(*(*U8)(unsafe.Pointer(aBuf + 3))))
}
// Append buffer nData/pData to buffer pBuf. If an OOM error occurs, set
// the error code in p. If an error has already occurred when this function
// is called, it is a no-op.
-func sqlite3Fts5BufferAppendBlob(tls *libc.TLS, pRc uintptr, pBuf uintptr, nData U32, pData uintptr) { /* sqlite3.c:216124:13: */
-
+func sqlite3Fts5BufferAppendBlob(tls *libc.TLS, pRc uintptr, pBuf uintptr, nData U32, pData uintptr) { /* sqlite3.c:217938:13: */
if nData != 0 {
if func() int32 {
- if ((U32((*Fts5Buffer)(unsafe.Pointer(pBuf)).Fn)) + (nData)) <= (U32((*Fts5Buffer)(unsafe.Pointer(pBuf)).FnSpace)) {
+ if U32((*Fts5Buffer)(unsafe.Pointer(pBuf)).Fn)+nData <= U32((*Fts5Buffer)(unsafe.Pointer(pBuf)).FnSpace) {
return 0
}
- return sqlite3Fts5BufferSize(tls, pRc, pBuf, ((nData) + U32((*Fts5Buffer)(unsafe.Pointer((pBuf))).Fn)))
+ return sqlite3Fts5BufferSize(tls, pRc, pBuf, nData+U32((*Fts5Buffer)(unsafe.Pointer(pBuf)).Fn))
}() != 0 {
return
}
- libc.Xmemcpy(tls, ((*Fts5Buffer)(unsafe.Pointer(pBuf)).Fp + uintptr((*Fts5Buffer)(unsafe.Pointer(pBuf)).Fn)), pData, nData)
- *(*int32)(unsafe.Pointer(pBuf + 4 /* &.n */)) += int32((nData))
+ libc.Xmemcpy(tls, (*Fts5Buffer)(unsafe.Pointer(pBuf)).Fp+uintptr((*Fts5Buffer)(unsafe.Pointer(pBuf)).Fn), pData, nData)
+ *(*int32)(unsafe.Pointer(pBuf + 4)) += int32(nData)
}
}
// Append the nul-terminated string zStr to the buffer pBuf. This function
// ensures that the byte following the buffer data is set to 0x00, even
// though this byte is not included in the pBuf->n count.
-func sqlite3Fts5BufferAppendString(tls *libc.TLS, pRc uintptr, pBuf uintptr, zStr uintptr) { /* sqlite3.c:216143:13: */
+func sqlite3Fts5BufferAppendString(tls *libc.TLS, pRc uintptr, pBuf uintptr, zStr uintptr) { /* sqlite3.c:217956:13: */
var nStr int32 = int32(libc.Xstrlen(tls, zStr))
- sqlite3Fts5BufferAppendBlob(tls, pRc, pBuf, (uint32(nStr + 1)), zStr)
+ sqlite3Fts5BufferAppendBlob(tls, pRc, pBuf, uint32(nStr+1), zStr)
(*Fts5Buffer)(unsafe.Pointer(pBuf)).Fn--
}
@@ -173257,7 +175584,7 @@ func sqlite3Fts5BufferAppendString(tls *libc.TLS, pRc uintptr, pBuf uintptr, zSt
// Like sqlite3Fts5BufferAppendString(), this function ensures that the byte
// following the buffer data is set to 0x00, even though this byte is not
// included in the pBuf->n count.
-func sqlite3Fts5BufferAppendPrintf(tls *libc.TLS, pRc uintptr, pBuf uintptr, zFmt uintptr, va uintptr) { /* sqlite3.c:216161:13: */
+func sqlite3Fts5BufferAppendPrintf(tls *libc.TLS, pRc uintptr, pBuf uintptr, zFmt uintptr, va uintptr) { /* sqlite3.c:217974:13: */
if *(*int32)(unsafe.Pointer(pRc)) == SQLITE_OK {
var zTmp uintptr
var ap Va_list
@@ -173275,7 +175602,7 @@ func sqlite3Fts5BufferAppendPrintf(tls *libc.TLS, pRc uintptr, pBuf uintptr, zFm
}
}
-func sqlite3Fts5Mprintf(tls *libc.TLS, pRc uintptr, zFmt uintptr, va uintptr) uintptr { /* sqlite3.c:216182:13: */
+func sqlite3Fts5Mprintf(tls *libc.TLS, pRc uintptr, zFmt uintptr, va uintptr) uintptr { /* sqlite3.c:217995:13: */
var zRet uintptr = uintptr(0)
if *(*int32)(unsafe.Pointer(pRc)) == SQLITE_OK {
var ap Va_list
@@ -173291,26 +175618,26 @@ func sqlite3Fts5Mprintf(tls *libc.TLS, pRc uintptr, zFmt uintptr, va uintptr) ui
}
// Free any buffer allocated by pBuf. Zero the structure before returning.
-func sqlite3Fts5BufferFree(tls *libc.TLS, pBuf uintptr) { /* sqlite3.c:216200:13: */
+func sqlite3Fts5BufferFree(tls *libc.TLS, pBuf uintptr) { /* sqlite3.c:218013:13: */
Xsqlite3_free(tls, (*Fts5Buffer)(unsafe.Pointer(pBuf)).Fp)
libc.Xmemset(tls, pBuf, 0, uint32(unsafe.Sizeof(Fts5Buffer{})))
}
// Zero the contents of the buffer object. But do not free the associated
// memory allocation.
-func sqlite3Fts5BufferZero(tls *libc.TLS, pBuf uintptr) { /* sqlite3.c:216209:13: */
+func sqlite3Fts5BufferZero(tls *libc.TLS, pBuf uintptr) { /* sqlite3.c:218022:13: */
(*Fts5Buffer)(unsafe.Pointer(pBuf)).Fn = 0
}
// Set the buffer to contain nData/pData. If an OOM error occurs, leave an
// the error code in p. If an error has already occurred when this function
// is called, it is a no-op.
-func sqlite3Fts5BufferSet(tls *libc.TLS, pRc uintptr, pBuf uintptr, nData int32, pData uintptr) { /* sqlite3.c:216218:13: */
+func sqlite3Fts5BufferSet(tls *libc.TLS, pRc uintptr, pBuf uintptr, nData int32, pData uintptr) { /* sqlite3.c:218031:13: */
(*Fts5Buffer)(unsafe.Pointer(pBuf)).Fn = 0
sqlite3Fts5BufferAppendBlob(tls, pRc, pBuf, uint32(nData), pData)
}
-func sqlite3Fts5PoslistNext64(tls *libc.TLS, a uintptr, n int32, pi uintptr, piOff uintptr) int32 { /* sqlite3.c:216228:12: */
+func sqlite3Fts5PoslistNext64(tls *libc.TLS, a uintptr, n int32, pi uintptr, piOff uintptr) int32 { /* sqlite3.c:218041:12: */
bp := tls.Alloc(4)
defer tls.Free(4)
@@ -173321,46 +175648,47 @@ func sqlite3Fts5PoslistNext64(tls *libc.TLS, a uintptr, n int32, pi uintptr, piO
return 1
} else {
var iOff I64 = *(*I64)(unsafe.Pointer(piOff))
- // var iVal int32 at bp, 4
+ // var iVal U32 at bp, 4
{
- *(*int32)(unsafe.Pointer(bp /* iVal */)) = int32(*(*U8)(unsafe.Pointer((a) + uintptr(libc.PostIncInt32(&i, 1)))))
- if (*(*int32)(unsafe.Pointer(bp /* iVal */)) & 0x80) != 0 {
+ *(*U32)(unsafe.Pointer(bp /* iVal */)) = U32(*(*U8)(unsafe.Pointer(a + uintptr(libc.PostIncInt32(&i, 1)))))
+ if *(*U32)(unsafe.Pointer(bp))&U32(0x80) != 0 {
i--
- i = i + (sqlite3Fts5GetVarint32(tls, ((a) + uintptr(i)), bp /* &iVal */))
+ i = i + sqlite3Fts5GetVarint32(tls, a+uintptr(i), bp)
}
}
- if *(*int32)(unsafe.Pointer(bp /* iVal */)) <= 1 {
- if *(*int32)(unsafe.Pointer(bp /* iVal */)) == 0 {
+ if *(*U32)(unsafe.Pointer(bp)) <= U32(1) {
+ if *(*U32)(unsafe.Pointer(bp)) == U32(0) {
*(*int32)(unsafe.Pointer(pi)) = i
return 0
}
{
- *(*int32)(unsafe.Pointer(bp /* iVal */)) = int32(*(*U8)(unsafe.Pointer((a) + uintptr(libc.PostIncInt32(&i, 1)))))
- if (*(*int32)(unsafe.Pointer(bp /* iVal */)) & 0x80) != 0 {
+ *(*U32)(unsafe.Pointer(bp /* iVal */)) = U32(*(*U8)(unsafe.Pointer(a + uintptr(libc.PostIncInt32(&i, 1)))))
+ if *(*U32)(unsafe.Pointer(bp))&U32(0x80) != 0 {
i--
- i = i + (sqlite3Fts5GetVarint32(tls, ((a) + uintptr(i)), bp /* &iVal */))
+ i = i + sqlite3Fts5GetVarint32(tls, a+uintptr(i), bp)
}
}
- iOff = ((I64(*(*int32)(unsafe.Pointer(bp /* iVal */)))) << 32)
+ iOff = I64(*(*U32)(unsafe.Pointer(bp))) << 32
+
{
- *(*int32)(unsafe.Pointer(bp /* iVal */)) = int32(*(*U8)(unsafe.Pointer((a) + uintptr(libc.PostIncInt32(&i, 1)))))
- if (*(*int32)(unsafe.Pointer(bp /* iVal */)) & 0x80) != 0 {
+ *(*U32)(unsafe.Pointer(bp /* iVal */)) = U32(*(*U8)(unsafe.Pointer(a + uintptr(libc.PostIncInt32(&i, 1)))))
+ if *(*U32)(unsafe.Pointer(bp))&U32(0x80) != 0 {
i--
- i = i + (sqlite3Fts5GetVarint32(tls, ((a) + uintptr(i)), bp /* &iVal */))
+ i = i + sqlite3Fts5GetVarint32(tls, a+uintptr(i), bp)
}
}
- if *(*int32)(unsafe.Pointer(bp /* iVal */)) < 2 {
+ if *(*U32)(unsafe.Pointer(bp)) < U32(2) {
// This is a corrupt record. So stop parsing it here.
*(*I64)(unsafe.Pointer(piOff)) = int64(-1)
return 1
}
- *(*I64)(unsafe.Pointer(piOff)) = (iOff + (I64((*(*int32)(unsafe.Pointer(bp /* iVal */)) - 2) & 0x7FFFFFFF)))
+ *(*I64)(unsafe.Pointer(piOff)) = iOff + I64((*(*U32)(unsafe.Pointer(bp))-U32(2))&U32(0x7FFFFFFF))
} else {
- *(*I64)(unsafe.Pointer(piOff)) = ((iOff & (I64(int64(0x7FFFFFFF)) << 32)) + ((iOff + (I64(*(*int32)(unsafe.Pointer(bp /* iVal */)) - 2))) & int64(0x7FFFFFFF)))
+ *(*I64)(unsafe.Pointer(piOff)) = iOff&(I64(int64(0x7FFFFFFF))<<32) + (iOff+I64(*(*U32)(unsafe.Pointer(bp))-U32(2)))&int64(0x7FFFFFFF)
}
*(*int32)(unsafe.Pointer(pi)) = i
@@ -173371,14 +175699,14 @@ func sqlite3Fts5PoslistNext64(tls *libc.TLS, a uintptr, n int32, pi uintptr, piO
// Advance the iterator object passed as the only argument. Return true
// if the iterator reaches EOF, or false otherwise.
-func sqlite3Fts5PoslistReaderNext(tls *libc.TLS, pIter uintptr) int32 { /* sqlite3.c:216271:12: */
- if sqlite3Fts5PoslistNext64(tls, (*Fts5PoslistReader)(unsafe.Pointer(pIter)).Fa, (*Fts5PoslistReader)(unsafe.Pointer(pIter)).Fn, (pIter+8 /* &.i */), (pIter+16 /* &.iPos */)) != 0 {
+func sqlite3Fts5PoslistReaderNext(tls *libc.TLS, pIter uintptr) int32 { /* sqlite3.c:218084:12: */
+ if sqlite3Fts5PoslistNext64(tls, (*Fts5PoslistReader)(unsafe.Pointer(pIter)).Fa, (*Fts5PoslistReader)(unsafe.Pointer(pIter)).Fn, pIter+8, pIter+16) != 0 {
(*Fts5PoslistReader)(unsafe.Pointer(pIter)).FbEof = U8(1)
}
return int32((*Fts5PoslistReader)(unsafe.Pointer(pIter)).FbEof)
}
-func sqlite3Fts5PoslistReaderInit(tls *libc.TLS, a uintptr, n int32, pIter uintptr) int32 { /* sqlite3.c:216278:12: */
+func sqlite3Fts5PoslistReaderInit(tls *libc.TLS, a uintptr, n int32, pIter uintptr) int32 { /* sqlite3.c:218091:12: */
libc.Xmemset(tls, pIter, 0, uint32(unsafe.Sizeof(Fts5PoslistReader{})))
(*Fts5PoslistReader)(unsafe.Pointer(pIter)).Fa = a
(*Fts5PoslistReader)(unsafe.Pointer(pIter)).Fn = n
@@ -173390,38 +175718,38 @@ func sqlite3Fts5PoslistReaderInit(tls *libc.TLS, a uintptr, n int32, pIter uintp
// pBuf, which must be already be large enough to hold the new data.
// The previous position written to this list is *piPrev. *piPrev is set
// to iPos before returning.
-func sqlite3Fts5PoslistSafeAppend(tls *libc.TLS, pBuf uintptr, piPrev uintptr, iPos I64) { /* sqlite3.c:216295:13: */
+func sqlite3Fts5PoslistSafeAppend(tls *libc.TLS, pBuf uintptr, piPrev uintptr, iPos I64) { /* sqlite3.c:218108:13: */
if iPos >= *(*I64)(unsafe.Pointer(piPrev)) {
- if (iPos & colmask) != (*(*I64)(unsafe.Pointer(piPrev)) & colmask) {
+ if iPos&colmask != *(*I64)(unsafe.Pointer(piPrev))&colmask {
*(*U8)(unsafe.Pointer((*Fts5Buffer)(unsafe.Pointer(pBuf)).Fp + uintptr(libc.PostIncInt32(&(*Fts5Buffer)(unsafe.Pointer(pBuf)).Fn, 1)))) = U8(1)
- *(*int32)(unsafe.Pointer(pBuf + 4 /* &.n */)) += (sqlite3Fts5PutVarint(tls, ((*Fts5Buffer)(unsafe.Pointer(pBuf)).Fp + uintptr((*Fts5Buffer)(unsafe.Pointer(pBuf)).Fn)), (uint64(iPos >> 32))))
- *(*I64)(unsafe.Pointer(piPrev)) = (iPos & colmask)
+ *(*int32)(unsafe.Pointer(pBuf + 4)) += sqlite3Fts5PutVarint(tls, (*Fts5Buffer)(unsafe.Pointer(pBuf)).Fp+uintptr((*Fts5Buffer)(unsafe.Pointer(pBuf)).Fn), uint64(iPos>>32))
+ *(*I64)(unsafe.Pointer(piPrev)) = iPos & colmask
}
- *(*int32)(unsafe.Pointer(pBuf + 4 /* &.n */)) += (sqlite3Fts5PutVarint(tls, ((*Fts5Buffer)(unsafe.Pointer(pBuf)).Fp + uintptr((*Fts5Buffer)(unsafe.Pointer(pBuf)).Fn)), (uint64((iPos - *(*I64)(unsafe.Pointer(piPrev))) + int64(2)))))
+ *(*int32)(unsafe.Pointer(pBuf + 4)) += sqlite3Fts5PutVarint(tls, (*Fts5Buffer)(unsafe.Pointer(pBuf)).Fp+uintptr((*Fts5Buffer)(unsafe.Pointer(pBuf)).Fn), uint64(iPos-*(*I64)(unsafe.Pointer(piPrev))+int64(2)))
*(*I64)(unsafe.Pointer(piPrev)) = iPos
}
}
-var colmask I64 = (I64((int64(0x7FFFFFFF))) << 32) /* sqlite3.c:216301:22 */
+var colmask I64 = I64(int64(0x7FFFFFFF)) << 32 /* sqlite3.c:218114:22 */
-func sqlite3Fts5PoslistWriterAppend(tls *libc.TLS, pBuf uintptr, pWriter uintptr, iPos I64) int32 { /* sqlite3.c:216312:12: */
+func sqlite3Fts5PoslistWriterAppend(tls *libc.TLS, pBuf uintptr, pWriter uintptr, iPos I64) int32 { /* sqlite3.c:218125:12: */
bp := tls.Alloc(4)
defer tls.Free(4)
*(*int32)(unsafe.Pointer(bp /* rc */)) = 0 // Initialized only to suppress erroneous warning from Clang
if func() int32 {
- if ((U32((*Fts5Buffer)(unsafe.Pointer(pBuf)).Fn)) + (U32((5 + 5) + 5))) <= (U32((*Fts5Buffer)(unsafe.Pointer(pBuf)).FnSpace)) {
+ if U32((*Fts5Buffer)(unsafe.Pointer(pBuf)).Fn)+U32(5+5+5) <= U32((*Fts5Buffer)(unsafe.Pointer(pBuf)).FnSpace) {
return 0
}
- return sqlite3Fts5BufferSize(tls, bp /* &rc */, pBuf, (uint32(((5 + 5) + 5) + (*Fts5Buffer)(unsafe.Pointer((pBuf))).Fn)))
+ return sqlite3Fts5BufferSize(tls, bp, pBuf, uint32(5+5+5+(*Fts5Buffer)(unsafe.Pointer(pBuf)).Fn))
}() != 0 {
return *(*int32)(unsafe.Pointer(bp /* rc */))
}
- sqlite3Fts5PoslistSafeAppend(tls, pBuf, (pWriter /* &.iPrev */), iPos)
+ sqlite3Fts5PoslistSafeAppend(tls, pBuf, pWriter, iPos)
return SQLITE_OK
}
-func sqlite3Fts5MallocZero(tls *libc.TLS, pRc uintptr, nByte Sqlite3_int64) uintptr { /* sqlite3.c:216323:13: */
+func sqlite3Fts5MallocZero(tls *libc.TLS, pRc uintptr, nByte Sqlite3_int64) uintptr { /* sqlite3.c:218136:13: */
var pRet uintptr = uintptr(0)
if *(*int32)(unsafe.Pointer(pRc)) == SQLITE_OK {
pRet = Xsqlite3_malloc64(tls, uint64(nByte))
@@ -173442,13 +175770,13 @@ func sqlite3Fts5MallocZero(tls *libc.TLS, pRc uintptr, nByte Sqlite3_int64) uint
//
// It is the responsibility of the caller to eventually free the returned
// buffer using sqlite3_free(). If an OOM error occurs, NULL is returned.
-func sqlite3Fts5Strndup(tls *libc.TLS, pRc uintptr, pIn uintptr, nIn int32) uintptr { /* sqlite3.c:216344:13: */
+func sqlite3Fts5Strndup(tls *libc.TLS, pRc uintptr, pIn uintptr, nIn int32) uintptr { /* sqlite3.c:218157:13: */
var zRet uintptr = uintptr(0)
if *(*int32)(unsafe.Pointer(pRc)) == SQLITE_OK {
if nIn < 0 {
nIn = int32(libc.Xstrlen(tls, pIn))
}
- zRet = Xsqlite3_malloc(tls, (nIn + 1))
+ zRet = Xsqlite3_malloc(tls, nIn+1)
if zRet != 0 {
libc.Xmemcpy(tls, zRet, pIn, uint32(nIn))
*(*uint8)(unsafe.Pointer(zRet + uintptr(nIn))) = uint8(0)
@@ -173467,7 +175795,7 @@ func sqlite3Fts5Strndup(tls *libc.TLS, pRc uintptr, pIn uintptr, nIn int32) uint
// * The 10 integer ASCII characters.
// * The underscore character "_" (0x5F).
// * The unicode "subsitute" character (0x1A).
-func sqlite3Fts5IsBareword(tls *libc.TLS, t uint8) int32 { /* sqlite3.c:216372:12: */
+func sqlite3Fts5IsBareword(tls *libc.TLS, t uint8) int32 { /* sqlite3.c:218185:12: */
bp := tls.Alloc(128)
defer tls.Free(128)
@@ -173482,7 +175810,7 @@ func sqlite3Fts5IsBareword(tls *libc.TLS, t uint8) int32 { /* sqlite3.c:216372:1
U8(1), U8(1), U8(1), U8(1), U8(1), U8(1), U8(1), U8(1), U8(1), U8(1), U8(1), U8(0), U8(0), U8(0), U8(0), U8(0), // 0x70 .. 0x7F
}
- return (libc.Bool32(((int32(t) & 0x80) != 0) || (*(*U8)(unsafe.Pointer(bp /* &aBareword[0] */ + uintptr(int32(t)))) != 0)))
+ return libc.Bool32(int32(t)&0x80 != 0 || *(*U8)(unsafe.Pointer(bp + uintptr(int32(t)))) != 0)
}
// ************************************************************************
@@ -173492,13 +175820,13 @@ type Fts5TermsetEntry1 = struct {
FnTerm int32
FiIdx int32
FpNext uintptr
-} /* sqlite3.c:213342:9 */
+} /* sqlite3.c:215154:9 */
// ************************************************************************
//
-type Fts5TermsetEntry = Fts5TermsetEntry1 /* sqlite3.c:216390:33 */
+type Fts5TermsetEntry = Fts5TermsetEntry1 /* sqlite3.c:218203:33 */
-func sqlite3Fts5TermsetNew(tls *libc.TLS, pp uintptr) int32 { /* sqlite3.c:216402:12: */
+func sqlite3Fts5TermsetNew(tls *libc.TLS, pp uintptr) int32 { /* sqlite3.c:218215:12: */
bp := tls.Alloc(4)
defer tls.Free(4)
@@ -173507,7 +175835,7 @@ func sqlite3Fts5TermsetNew(tls *libc.TLS, pp uintptr) int32 { /* sqlite3.c:21640
return *(*int32)(unsafe.Pointer(bp /* rc */))
}
-func sqlite3Fts5TermsetAdd(tls *libc.TLS, p uintptr, iIdx int32, pTerm uintptr, nTerm int32, pbPresent uintptr) int32 { /* sqlite3.c:216408:12: */
+func sqlite3Fts5TermsetAdd(tls *libc.TLS, p uintptr, iIdx int32, pTerm uintptr, nTerm int32, pbPresent uintptr) int32 { /* sqlite3.c:218221:12: */
bp := tls.Alloc(4)
defer tls.Free(4)
@@ -173522,30 +175850,30 @@ func sqlite3Fts5TermsetAdd(tls *libc.TLS, p uintptr, iIdx int32, pTerm uintptr,
// used by the fts5_hash.c module. This is not important for correct
// operation of the module, but is necessary to ensure that some tests
// designed to produce hash table collisions really do work.
- for i = (nTerm - 1); i >= 0; i-- {
- hash = (((hash << 3) ^ hash) ^ U32(*(*uint8)(unsafe.Pointer(pTerm + uintptr(i)))))
+ for i = nTerm - 1; i >= 0; i-- {
+ hash = hash<<3 ^ hash ^ U32(*(*uint8)(unsafe.Pointer(pTerm + uintptr(i))))
}
- hash = (((hash << 3) ^ hash) ^ U32(iIdx))
- hash = (hash % (U32((int32(uint32(unsafe.Sizeof([512]uintptr{})) / uint32(unsafe.Sizeof(uintptr(0))))))))
+ hash = hash<<3 ^ hash ^ U32(iIdx)
+ hash = hash % U32(int32(uint32(unsafe.Sizeof([512]uintptr{}))/uint32(unsafe.Sizeof(uintptr(0)))))
- for pEntry = *(*uintptr)(unsafe.Pointer((p /* &.apHash */) + uintptr(hash)*4)); pEntry != 0; pEntry = (*Fts5TermsetEntry)(unsafe.Pointer(pEntry)).FpNext {
- if (((*Fts5TermsetEntry)(unsafe.Pointer(pEntry)).FiIdx == iIdx) &&
- ((*Fts5TermsetEntry)(unsafe.Pointer(pEntry)).FnTerm == nTerm)) &&
- (libc.Xmemcmp(tls, (*Fts5TermsetEntry)(unsafe.Pointer(pEntry)).FpTerm, pTerm, uint32(nTerm)) == 0) {
+ for pEntry = *(*uintptr)(unsafe.Pointer(p + uintptr(hash)*4)); pEntry != 0; pEntry = (*Fts5TermsetEntry)(unsafe.Pointer(pEntry)).FpNext {
+ if (*Fts5TermsetEntry)(unsafe.Pointer(pEntry)).FiIdx == iIdx &&
+ (*Fts5TermsetEntry)(unsafe.Pointer(pEntry)).FnTerm == nTerm &&
+ libc.Xmemcmp(tls, (*Fts5TermsetEntry)(unsafe.Pointer(pEntry)).FpTerm, pTerm, uint32(nTerm)) == 0 {
*(*int32)(unsafe.Pointer(pbPresent)) = 1
break
}
}
if pEntry == uintptr(0) {
- pEntry = sqlite3Fts5MallocZero(tls, bp /* &rc */, (int64(uint32(unsafe.Sizeof(Fts5TermsetEntry{})) + uint32(nTerm))))
+ pEntry = sqlite3Fts5MallocZero(tls, bp /* &rc */, int64(uint32(unsafe.Sizeof(Fts5TermsetEntry{}))+uint32(nTerm)))
if pEntry != 0 {
- (*Fts5TermsetEntry)(unsafe.Pointer(pEntry)).FpTerm = (pEntry + 1*16)
+ (*Fts5TermsetEntry)(unsafe.Pointer(pEntry)).FpTerm = pEntry + 1*16
(*Fts5TermsetEntry)(unsafe.Pointer(pEntry)).FnTerm = nTerm
(*Fts5TermsetEntry)(unsafe.Pointer(pEntry)).FiIdx = iIdx
libc.Xmemcpy(tls, (*Fts5TermsetEntry)(unsafe.Pointer(pEntry)).FpTerm, pTerm, uint32(nTerm))
- (*Fts5TermsetEntry)(unsafe.Pointer(pEntry)).FpNext = *(*uintptr)(unsafe.Pointer((p /* &.apHash */) + uintptr(hash)*4))
- *(*uintptr)(unsafe.Pointer((p /* &.apHash */) + uintptr(hash)*4)) = pEntry
+ (*Fts5TermsetEntry)(unsafe.Pointer(pEntry)).FpNext = *(*uintptr)(unsafe.Pointer(p + uintptr(hash)*4))
+ *(*uintptr)(unsafe.Pointer(p + uintptr(hash)*4)) = pEntry
}
}
}
@@ -173553,11 +175881,11 @@ func sqlite3Fts5TermsetAdd(tls *libc.TLS, p uintptr, iIdx int32, pTerm uintptr,
return *(*int32)(unsafe.Pointer(bp /* rc */))
}
-func sqlite3Fts5TermsetFree(tls *libc.TLS, p uintptr) { /* sqlite3.c:216457:13: */
+func sqlite3Fts5TermsetFree(tls *libc.TLS, p uintptr) { /* sqlite3.c:218270:13: */
if p != 0 {
var i U32
- for i = U32(0); i < (U32((int32(uint32(unsafe.Sizeof([512]uintptr{})) / uint32(unsafe.Sizeof(uintptr(0))))))); i++ {
- var pEntry uintptr = *(*uintptr)(unsafe.Pointer((p /* &.apHash */) + uintptr(i)*4))
+ for i = U32(0); i < U32(int32(uint32(unsafe.Sizeof([512]uintptr{}))/uint32(unsafe.Sizeof(uintptr(0))))); i++ {
+ var pEntry uintptr = *(*uintptr)(unsafe.Pointer(p + uintptr(i)*4))
for pEntry != 0 {
var pDel uintptr = pEntry
pEntry = (*Fts5TermsetEntry)(unsafe.Pointer(pEntry)).FpNext
@@ -173585,18 +175913,18 @@ func sqlite3Fts5TermsetFree(tls *libc.TLS, p uintptr) { /* sqlite3.c:216457:13:
// Maximum allowed page size
-func fts5_iswhitespace(tls *libc.TLS, x uint8) int32 { /* sqlite3.c:216499:12: */
- return (libc.Bool32(int32(x) == ' '))
+func fts5_iswhitespace(tls *libc.TLS, x uint8) int32 { /* sqlite3.c:218312:12: */
+ return libc.Bool32(int32(x) == ' ')
}
-func fts5_isopenquote(tls *libc.TLS, x uint8) int32 { /* sqlite3.c:216503:12: */
- return (libc.Bool32((((int32(x) == '"') || (int32(x) == '\'')) || (int32(x) == '[')) || (int32(x) == '`')))
+func fts5_isopenquote(tls *libc.TLS, x uint8) int32 { /* sqlite3.c:218316:12: */
+ return libc.Bool32(int32(x) == '"' || int32(x) == '\'' || int32(x) == '[' || int32(x) == '`')
}
// Argument pIn points to a character that is part of a nul-terminated
// string. Return a pointer to the first character following *pIn in
// the string that is not a white-space character.
-func fts5ConfigSkipWhitespace(tls *libc.TLS, pIn uintptr) uintptr { /* sqlite3.c:216512:19: */
+func fts5ConfigSkipWhitespace(tls *libc.TLS, pIn uintptr) uintptr { /* sqlite3.c:218325:19: */
var p uintptr = pIn
if p != 0 {
for fts5_iswhitespace(tls, *(*uint8)(unsafe.Pointer(p))) != 0 {
@@ -173609,7 +175937,7 @@ func fts5ConfigSkipWhitespace(tls *libc.TLS, pIn uintptr) uintptr { /* sqlite3.c
// Argument pIn points to a character that is part of a nul-terminated
// string. Return a pointer to the first character following *pIn in
// the string that is not a "bareword" character.
-func fts5ConfigSkipBareword(tls *libc.TLS, pIn uintptr) uintptr { /* sqlite3.c:216525:19: */
+func fts5ConfigSkipBareword(tls *libc.TLS, pIn uintptr) uintptr { /* sqlite3.c:218338:19: */
var p uintptr = pIn
for sqlite3Fts5IsBareword(tls, *(*uint8)(unsafe.Pointer(p))) != 0 {
p++
@@ -173620,18 +175948,18 @@ func fts5ConfigSkipBareword(tls *libc.TLS, pIn uintptr) uintptr { /* sqlite3.c:2
return p
}
-func fts5_isdigit(tls *libc.TLS, a uint8) int32 { /* sqlite3.c:216532:12: */
- return (libc.Bool32((int32(a) >= '0') && (int32(a) <= '9')))
+func fts5_isdigit(tls *libc.TLS, a uint8) int32 { /* sqlite3.c:218345:12: */
+ return libc.Bool32(int32(a) >= '0' && int32(a) <= '9')
}
-func fts5ConfigSkipLiteral(tls *libc.TLS, pIn uintptr) uintptr { /* sqlite3.c:216538:19: */
+func fts5ConfigSkipLiteral(tls *libc.TLS, pIn uintptr) uintptr { /* sqlite3.c:218351:19: */
var p uintptr = pIn
switch int32(*(*uint8)(unsafe.Pointer(p))) {
case 'n':
fallthrough
case 'N':
- if Xsqlite3_strnicmp(tls, ts+5258 /* "null" */, p, 4) == 0 {
- p = (p + 4)
+ if Xsqlite3_strnicmp(tls, ts+6105, p, 4) == 0 {
+ p = p + 4
} else {
p = uintptr(0)
}
@@ -173643,12 +175971,12 @@ func fts5ConfigSkipLiteral(tls *libc.TLS, pIn uintptr) uintptr { /* sqlite3.c:21
p++
if int32(*(*uint8)(unsafe.Pointer(p))) == '\'' {
p++
- for (((int32(*(*uint8)(unsafe.Pointer(p))) >= 'a') && (int32(*(*uint8)(unsafe.Pointer(p))) <= 'f')) ||
- ((int32(*(*uint8)(unsafe.Pointer(p))) >= 'A') && (int32(*(*uint8)(unsafe.Pointer(p))) <= 'F'))) ||
- ((int32(*(*uint8)(unsafe.Pointer(p))) >= '0') && (int32(*(*uint8)(unsafe.Pointer(p))) <= '9')) {
+ for int32(*(*uint8)(unsafe.Pointer(p))) >= 'a' && int32(*(*uint8)(unsafe.Pointer(p))) <= 'f' ||
+ int32(*(*uint8)(unsafe.Pointer(p))) >= 'A' && int32(*(*uint8)(unsafe.Pointer(p))) <= 'F' ||
+ int32(*(*uint8)(unsafe.Pointer(p))) >= '0' && int32(*(*uint8)(unsafe.Pointer(p))) <= '9' {
p++
}
- if (int32(*(*uint8)(unsafe.Pointer(p))) == '\'') && (0 == (((int32(p) - int32(pIn)) / 1) % 2)) {
+ if int32(*(*uint8)(unsafe.Pointer(p))) == '\'' && 0 == (int32(p)-int32(pIn))/1%2 {
p++
} else {
p = uintptr(0)
@@ -173676,7 +176004,7 @@ func fts5ConfigSkipLiteral(tls *libc.TLS, pIn uintptr) uintptr { /* sqlite3.c:21
default:
// maybe a number
- if (int32(*(*uint8)(unsafe.Pointer(p))) == '+') || (int32(*(*uint8)(unsafe.Pointer(p))) == '-') {
+ if int32(*(*uint8)(unsafe.Pointer(p))) == '+' || int32(*(*uint8)(unsafe.Pointer(p))) == '-' {
p++
}
for fts5_isdigit(tls, *(*uint8)(unsafe.Pointer(p))) != 0 {
@@ -173686,7 +176014,7 @@ func fts5ConfigSkipLiteral(tls *libc.TLS, pIn uintptr) uintptr { /* sqlite3.c:21
// At this point, if the literal was an integer, the parse is
// finished. Or, if it is a floating point value, it may continue
// with either a decimal point or an 'E' character.
- if (int32(*(*uint8)(unsafe.Pointer(p))) == '.') && (fts5_isdigit(tls, *(*uint8)(unsafe.Pointer(p + 1))) != 0) {
+ if int32(*(*uint8)(unsafe.Pointer(p))) == '.' && fts5_isdigit(tls, *(*uint8)(unsafe.Pointer(p + 1))) != 0 {
p += uintptr(2)
for fts5_isdigit(tls, *(*uint8)(unsafe.Pointer(p))) != 0 {
p++
@@ -173713,7 +176041,7 @@ func fts5ConfigSkipLiteral(tls *libc.TLS, pIn uintptr) uintptr { /* sqlite3.c:21
// the character immediately following it. Or, if the close-quote is not
// found, -1 is returned. If -1 is returned, the buffer is left in an
// undefined state.
-func fts5Dequote(tls *libc.TLS, z uintptr) int32 { /* sqlite3.c:216614:12: */
+func fts5Dequote(tls *libc.TLS, z uintptr) int32 { /* sqlite3.c:218427:12: */
var q uint8
var iIn int32 = 1
var iOut int32 = 0
@@ -173727,7 +176055,7 @@ func fts5Dequote(tls *libc.TLS, z uintptr) int32 { /* sqlite3.c:216614:12: */
for *(*uint8)(unsafe.Pointer(z + uintptr(iIn))) != 0 {
if int32(*(*uint8)(unsafe.Pointer(z + uintptr(iIn)))) == int32(q) {
- if int32(*(*uint8)(unsafe.Pointer(z + uintptr((iIn + 1))))) != int32(q) {
+ if int32(*(*uint8)(unsafe.Pointer(z + uintptr(iIn+1)))) != int32(q) {
// Character iIn was the close quote.
iIn++
break
@@ -173735,7 +176063,7 @@ func fts5Dequote(tls *libc.TLS, z uintptr) int32 { /* sqlite3.c:216614:12: */
// Character iIn and iIn+1 form an escaped quote character. Skip
// the input cursor past both and copy a single quote character
// to the output buffer.
- iIn = iIn + (2)
+ iIn = iIn + 2
*(*uint8)(unsafe.Pointer(z + uintptr(libc.PostIncInt32(&iOut, 1)))) = q
}
} else {
@@ -173758,11 +176086,11 @@ func fts5Dequote(tls *libc.TLS, z uintptr) int32 { /* sqlite3.c:216614:12: */
// 'xyz' becomes xyz
// [pqr] becomes pqr
// `mno` becomes mno
-func sqlite3Fts5Dequote(tls *libc.TLS, z uintptr) { /* sqlite3.c:216659:13: */
+func sqlite3Fts5Dequote(tls *libc.TLS, z uintptr) { /* sqlite3.c:218472:13: */
var quote uint8 // Quote character (if any )
quote = *(*uint8)(unsafe.Pointer(z))
- if (((int32(quote) == '[') || (int32(quote) == '\'')) || (int32(quote) == '"')) || (int32(quote) == '`') {
+ if int32(quote) == '[' || int32(quote) == '\'' || int32(quote) == '"' || int32(quote) == '`' {
fts5Dequote(tls, z)
}
}
@@ -173770,11 +176098,11 @@ func sqlite3Fts5Dequote(tls *libc.TLS, z uintptr) { /* sqlite3.c:216659:13: */
type Fts5Enum1 = struct {
FzName uintptr
FeVal int32
-} /* sqlite3.c:216670:1 */
+} /* sqlite3.c:218483:1 */
-type Fts5Enum = Fts5Enum1 /* sqlite3.c:216674:25 */
+type Fts5Enum = Fts5Enum1 /* sqlite3.c:218487:25 */
-func fts5ConfigSetEnum(tls *libc.TLS, aEnum uintptr, zEnum uintptr, peVal uintptr) int32 { /* sqlite3.c:216676:12: */
+func fts5ConfigSetEnum(tls *libc.TLS, aEnum uintptr, zEnum uintptr, peVal uintptr) int32 { /* sqlite3.c:218489:12: */
var nEnum int32 = int32(libc.Xstrlen(tls, zEnum))
var i int32
var iVal int32 = -1
@@ -173802,19 +176130,19 @@ func fts5ConfigSetEnum(tls *libc.TLS, aEnum uintptr, zEnum uintptr, peVal uintpt
// an error occurs, an SQLite error code is returned and an error message
// may be left in *pzErr. It is the responsibility of the caller to
// eventually free any such error message using sqlite3_free().
-func fts5ConfigParseSpecial(tls *libc.TLS, pGlobal uintptr, pConfig uintptr, zCmd uintptr, zArg uintptr, pzErr uintptr) int32 { /* sqlite3.c:216705:12: */
+func fts5ConfigParseSpecial(tls *libc.TLS, pGlobal uintptr, pConfig uintptr, zCmd uintptr, zArg uintptr, pzErr uintptr) int32 { /* sqlite3.c:218518:12: */
bp := tls.Alloc(76)
defer tls.Free(76)
*(*int32)(unsafe.Pointer(bp + 40 /* rc */)) = SQLITE_OK
var nCmd int32 = int32(libc.Xstrlen(tls, zCmd))
- if Xsqlite3_strnicmp(tls, ts+32069 /* "prefix" */, zCmd, nCmd) == 0 {
- var nByte int32 = (int32(uint32(unsafe.Sizeof(int32(0))) * uint32(FTS5_MAX_PREFIX_INDEXES)))
+ if Xsqlite3_strnicmp(tls, ts+33429, zCmd, nCmd) == 0 {
+ var nByte int32 = int32(uint32(unsafe.Sizeof(int32(0))) * uint32(FTS5_MAX_PREFIX_INDEXES))
var p uintptr
var bFirst int32 = 1
if (*Fts5Config)(unsafe.Pointer(pConfig)).FaPrefix == uintptr(0) {
(*Fts5Config)(unsafe.Pointer(pConfig)).FaPrefix = sqlite3Fts5MallocZero(tls, bp+40 /* &rc */, int64(nByte))
- if *(*int32)(unsafe.Pointer(bp + 40 /* rc */)) != 0 {
+ if *(*int32)(unsafe.Pointer(bp + 40)) != 0 {
return *(*int32)(unsafe.Pointer(bp + 40 /* rc */))
}
}
@@ -173826,7 +176154,7 @@ func fts5ConfigParseSpecial(tls *libc.TLS, pGlobal uintptr, pConfig uintptr, zCm
for int32(*(*uint8)(unsafe.Pointer(p))) == ' ' {
p++
}
- if (bFirst == 0) && (int32(*(*uint8)(unsafe.Pointer(p))) == ',') {
+ if bFirst == 0 && int32(*(*uint8)(unsafe.Pointer(p))) == ',' {
p++
for int32(*(*uint8)(unsafe.Pointer(p))) == ' ' {
p++
@@ -173834,26 +176162,26 @@ func fts5ConfigParseSpecial(tls *libc.TLS, pGlobal uintptr, pConfig uintptr, zCm
} else if int32(*(*uint8)(unsafe.Pointer(p))) == 0 {
break
}
- if (int32(*(*uint8)(unsafe.Pointer(p))) < '0') || (int32(*(*uint8)(unsafe.Pointer(p))) > '9') {
- *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, ts+32076 /* "malformed prefix..." */, 0)
+ if int32(*(*uint8)(unsafe.Pointer(p))) < '0' || int32(*(*uint8)(unsafe.Pointer(p))) > '9' {
+ *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, ts+33436 /* "malformed prefix..." */, 0)
*(*int32)(unsafe.Pointer(bp + 40 /* rc */)) = SQLITE_ERROR
break
}
if (*Fts5Config)(unsafe.Pointer(pConfig)).FnPrefix == FTS5_MAX_PREFIX_INDEXES {
*(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls,
- ts+32107 /* "too many prefix ..." */, libc.VaList(bp, FTS5_MAX_PREFIX_INDEXES))
+ ts+33467 /* "too many prefix ..." */, libc.VaList(bp, FTS5_MAX_PREFIX_INDEXES))
*(*int32)(unsafe.Pointer(bp + 40 /* rc */)) = SQLITE_ERROR
break
}
- for ((int32(*(*uint8)(unsafe.Pointer(p))) >= '0') && (int32(*(*uint8)(unsafe.Pointer(p))) <= '9')) && (nPre < 1000) {
- nPre = ((nPre * 10) + (int32(*(*uint8)(unsafe.Pointer(p))) - '0'))
+ for int32(*(*uint8)(unsafe.Pointer(p))) >= '0' && int32(*(*uint8)(unsafe.Pointer(p))) <= '9' && nPre < 1000 {
+ nPre = nPre*10 + (int32(*(*uint8)(unsafe.Pointer(p))) - '0')
p++
}
- if (nPre <= 0) || (nPre >= 1000) {
- *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, ts+32140 /* "prefix length ou..." */, 0)
+ if nPre <= 0 || nPre >= 1000 {
+ *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, ts+33500 /* "prefix length ou..." */, 0)
*(*int32)(unsafe.Pointer(bp + 40 /* rc */)) = SQLITE_ERROR
break
}
@@ -173866,19 +176194,19 @@ func fts5ConfigParseSpecial(tls *libc.TLS, pGlobal uintptr, pConfig uintptr, zCm
return *(*int32)(unsafe.Pointer(bp + 40 /* rc */))
}
- if Xsqlite3_strnicmp(tls, ts+32177 /* "tokenize" */, zCmd, nCmd) == 0 {
+ if Xsqlite3_strnicmp(tls, ts+33537, zCmd, nCmd) == 0 {
var p uintptr = zArg
- var nArg Sqlite3_int64 = (Sqlite3_int64(libc.Xstrlen(tls, zArg) + Size_t(1)))
- var azArg uintptr = sqlite3Fts5MallocZero(tls, bp+40 /* &rc */, (Sqlite3_int64(unsafe.Sizeof(uintptr(0))) * nArg))
- var pDel uintptr = sqlite3Fts5MallocZero(tls, bp+40 /* &rc */, (nArg * int64(2)))
+ var nArg Sqlite3_int64 = Sqlite3_int64(libc.Xstrlen(tls, zArg) + Size_t(1))
+ var azArg uintptr = sqlite3Fts5MallocZero(tls, bp+40 /* &rc */, Sqlite3_int64(unsafe.Sizeof(uintptr(0)))*nArg)
+ var pDel uintptr = sqlite3Fts5MallocZero(tls, bp+40 /* &rc */, nArg*int64(2))
var pSpace uintptr = pDel
- if (azArg != 0) && (pSpace != 0) {
+ if azArg != 0 && pSpace != 0 {
if (*Fts5Config)(unsafe.Pointer(pConfig)).FpTok != 0 {
- *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, ts+32186 /* "multiple tokeniz..." */, 0)
+ *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, ts+33546 /* "multiple tokeniz..." */, 0)
*(*int32)(unsafe.Pointer(bp + 40 /* rc */)) = SQLITE_ERROR
} else {
- for nArg = int64(0); (p != 0) && (*(*uint8)(unsafe.Pointer(p)) != 0); nArg++ {
+ for nArg = int64(0); p != 0 && *(*uint8)(unsafe.Pointer(p)) != 0; nArg++ {
var p2 uintptr = fts5ConfigSkipWhitespace(tls, p)
if int32(*(*uint8)(unsafe.Pointer(p2))) == '\'' {
p = fts5ConfigSkipLiteral(tls, p2)
@@ -173886,15 +176214,15 @@ func fts5ConfigParseSpecial(tls *libc.TLS, pGlobal uintptr, pConfig uintptr, zCm
p = fts5ConfigSkipBareword(tls, p2)
}
if p != 0 {
- libc.Xmemcpy(tls, pSpace, p2, (uint32((int32(p) - int32(p2)) / 1)))
+ libc.Xmemcpy(tls, pSpace, p2, uint32((int32(p)-int32(p2))/1))
*(*uintptr)(unsafe.Pointer(azArg + uintptr(nArg)*4)) = pSpace
sqlite3Fts5Dequote(tls, pSpace)
- pSpace += (uintptr(((int32(p) - int32(p2)) / 1) + 1))
+ pSpace += uintptr((int32(p)-int32(p2))/1 + 1)
p = fts5ConfigSkipWhitespace(tls, p)
}
}
if p == uintptr(0) {
- *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, ts+32219 /* "parse error in t..." */, 0)
+ *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, ts+33579 /* "parse error in t..." */, 0)
*(*int32)(unsafe.Pointer(bp + 40 /* rc */)) = SQLITE_ERROR
} else {
*(*int32)(unsafe.Pointer(bp + 40 /* rc */)) = sqlite3Fts5GetTokenizer(tls, pGlobal,
@@ -173909,14 +176237,14 @@ func fts5ConfigParseSpecial(tls *libc.TLS, pGlobal uintptr, pConfig uintptr, zCm
return *(*int32)(unsafe.Pointer(bp + 40 /* rc */))
}
- if Xsqlite3_strnicmp(tls, ts+32253 /* "content" */, zCmd, nCmd) == 0 {
+ if Xsqlite3_strnicmp(tls, ts+33613, zCmd, nCmd) == 0 {
if (*Fts5Config)(unsafe.Pointer(pConfig)).FeContent != FTS5_CONTENT_NORMAL {
- *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, ts+32261 /* "multiple content..." */, 0)
+ *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, ts+33621 /* "multiple content..." */, 0)
*(*int32)(unsafe.Pointer(bp + 40 /* rc */)) = SQLITE_ERROR
} else {
if *(*uint8)(unsafe.Pointer(zArg)) != 0 {
(*Fts5Config)(unsafe.Pointer(pConfig)).FeContent = FTS5_CONTENT_EXTERNAL
- (*Fts5Config)(unsafe.Pointer(pConfig)).FzContent = sqlite3Fts5Mprintf(tls, bp+40 /* &rc */, ts+32293 /* "%Q.%Q" */, libc.VaList(bp+8, (*Fts5Config)(unsafe.Pointer(pConfig)).FzDb, zArg))
+ (*Fts5Config)(unsafe.Pointer(pConfig)).FzContent = sqlite3Fts5Mprintf(tls, bp+40 /* &rc */, ts+33653 /* "%Q.%Q" */, libc.VaList(bp+8, (*Fts5Config)(unsafe.Pointer(pConfig)).FzDb, zArg))
} else {
(*Fts5Config)(unsafe.Pointer(pConfig)).FeContent = FTS5_CONTENT_NONE
}
@@ -173924,9 +176252,9 @@ func fts5ConfigParseSpecial(tls *libc.TLS, pGlobal uintptr, pConfig uintptr, zCm
return *(*int32)(unsafe.Pointer(bp + 40 /* rc */))
}
- if Xsqlite3_strnicmp(tls, ts+32299 /* "content_rowid" */, zCmd, nCmd) == 0 {
+ if Xsqlite3_strnicmp(tls, ts+33659, zCmd, nCmd) == 0 {
if (*Fts5Config)(unsafe.Pointer(pConfig)).FzContentRowid != 0 {
- *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, ts+32313 /* "multiple content..." */, 0)
+ *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, ts+33673 /* "multiple content..." */, 0)
*(*int32)(unsafe.Pointer(bp + 40 /* rc */)) = SQLITE_ERROR
} else {
(*Fts5Config)(unsafe.Pointer(pConfig)).FzContentRowid = sqlite3Fts5Strndup(tls, bp+40 /* &rc */, zArg, -1)
@@ -173934,38 +176262,38 @@ func fts5ConfigParseSpecial(tls *libc.TLS, pGlobal uintptr, pConfig uintptr, zCm
return *(*int32)(unsafe.Pointer(bp + 40 /* rc */))
}
- if Xsqlite3_strnicmp(tls, ts+32351 /* "columnsize" */, zCmd, nCmd) == 0 {
- if ((int32(*(*uint8)(unsafe.Pointer(zArg))) != '0') && (int32(*(*uint8)(unsafe.Pointer(zArg))) != '1')) || (int32(*(*uint8)(unsafe.Pointer(zArg + 1))) != 0) {
- *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, ts+32362 /* "malformed column..." */, 0)
+ if Xsqlite3_strnicmp(tls, ts+33711, zCmd, nCmd) == 0 {
+ if int32(*(*uint8)(unsafe.Pointer(zArg))) != '0' && int32(*(*uint8)(unsafe.Pointer(zArg))) != '1' || int32(*(*uint8)(unsafe.Pointer(zArg + 1))) != 0 {
+ *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, ts+33722 /* "malformed column..." */, 0)
*(*int32)(unsafe.Pointer(bp + 40 /* rc */)) = SQLITE_ERROR
} else {
- (*Fts5Config)(unsafe.Pointer(pConfig)).FbColumnsize = (libc.Bool32(int32(*(*uint8)(unsafe.Pointer(zArg))) == '1'))
+ (*Fts5Config)(unsafe.Pointer(pConfig)).FbColumnsize = libc.Bool32(int32(*(*uint8)(unsafe.Pointer(zArg))) == '1')
}
return *(*int32)(unsafe.Pointer(bp + 40 /* rc */))
}
- if Xsqlite3_strnicmp(tls, ts+4189 /* "detail" */, zCmd, nCmd) == 0 {
+ if Xsqlite3_strnicmp(tls, ts+4995, zCmd, nCmd) == 0 {
*(*[4]Fts5Enum)(unsafe.Pointer(bp + 44 /* aDetail */)) = [4]Fts5Enum{
- {FzName: ts + 15828 /* "none" */, FeVal: FTS5_DETAIL_NONE},
- {FzName: ts + 15833 /* "full" */},
- {FzName: ts + 32397 /* "columns" */, FeVal: FTS5_DETAIL_COLUMNS},
+ {FzName: ts + 7885 /* "none" */, FeVal: FTS5_DETAIL_NONE},
+ {FzName: ts + 17043 /* "full" */},
+ {FzName: ts + 33757 /* "columns" */, FeVal: FTS5_DETAIL_COLUMNS},
{},
}
- if libc.AssignPtrInt32(bp+40 /* rc */, fts5ConfigSetEnum(tls, bp+44 /* &aDetail[0] */, zArg, (pConfig+48 /* &.eDetail */))) != 0 {
- *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, ts+32405 /* "malformed detail..." */, 0)
+ if libc.AssignPtrInt32(bp+40, fts5ConfigSetEnum(tls, bp+44, zArg, pConfig+48)) != 0 {
+ *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, ts+33765 /* "malformed detail..." */, 0)
}
return *(*int32)(unsafe.Pointer(bp + 40 /* rc */))
}
- *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, ts+32436 /* "unrecognized opt..." */, libc.VaList(bp+24, nCmd, zCmd))
+ *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, ts+33796 /* "unrecognized opt..." */, libc.VaList(bp+24, nCmd, zCmd))
return SQLITE_ERROR
}
// Allocate an instance of the default tokenizer ("simple") at
// Fts5Config.pTokenizer. Return SQLITE_OK if successful, or an SQLite error
// code if an error occurs.
-func fts5ConfigDefaultTokenizer(tls *libc.TLS, pGlobal uintptr, pConfig uintptr) int32 { /* sqlite3.c:216869:12: */
+func fts5ConfigDefaultTokenizer(tls *libc.TLS, pGlobal uintptr, pConfig uintptr) int32 { /* sqlite3.c:218682:12: */
return sqlite3Fts5GetTokenizer(tls, pGlobal, uintptr(0), 0, pConfig, uintptr(0))
}
@@ -173983,11 +176311,11 @@ func fts5ConfigDefaultTokenizer(tls *libc.TLS, pGlobal uintptr, pConfig uintptr)
// a no-op (NULL is returned). Otherwise, if an OOM occurs within this
// function, *pRc is set to SQLITE_NOMEM before returning. *pRc is *not*
// set if a parse error (failed to find close quote) occurs.
-func fts5ConfigGobbleWord(tls *libc.TLS, pRc uintptr, zIn uintptr, pzOut uintptr, pbQuoted uintptr) uintptr { /* sqlite3.c:216889:19: */
+func fts5ConfigGobbleWord(tls *libc.TLS, pRc uintptr, zIn uintptr, pzOut uintptr, pbQuoted uintptr) uintptr { /* sqlite3.c:218702:19: */
var zRet uintptr = uintptr(0)
var nIn Sqlite3_int64 = Sqlite3_int64(libc.Xstrlen(tls, zIn))
- var zOut uintptr = Xsqlite3_malloc64(tls, (uint64(nIn + int64(1))))
+ var zOut uintptr = Xsqlite3_malloc64(tls, uint64(nIn+int64(1)))
*(*int32)(unsafe.Pointer(pbQuoted)) = 0
*(*uintptr)(unsafe.Pointer(pzOut)) = uintptr(0)
@@ -173995,15 +176323,15 @@ func fts5ConfigGobbleWord(tls *libc.TLS, pRc uintptr, zIn uintptr, pzOut uintptr
if zOut == uintptr(0) {
*(*int32)(unsafe.Pointer(pRc)) = SQLITE_NOMEM
} else {
- libc.Xmemcpy(tls, zOut, zIn, (Size_t(nIn + int64(1))))
+ libc.Xmemcpy(tls, zOut, zIn, Size_t(nIn+int64(1)))
if fts5_isopenquote(tls, *(*uint8)(unsafe.Pointer(zOut))) != 0 {
var ii int32 = fts5Dequote(tls, zOut)
- zRet = (zIn + uintptr(ii))
+ zRet = zIn + uintptr(ii)
*(*int32)(unsafe.Pointer(pbQuoted)) = 1
} else {
zRet = fts5ConfigSkipBareword(tls, zIn)
if zRet != 0 {
- *(*uint8)(unsafe.Pointer(zOut + uintptr(((int32(zRet) - int32(zIn)) / 1)))) = uint8(0)
+ *(*uint8)(unsafe.Pointer(zOut + uintptr((int32(zRet)-int32(zIn))/1))) = uint8(0)
}
}
}
@@ -174017,20 +176345,20 @@ func fts5ConfigGobbleWord(tls *libc.TLS, pRc uintptr, zIn uintptr, pzOut uintptr
return zRet
}
-func fts5ConfigParseColumn(tls *libc.TLS, p uintptr, zCol uintptr, zArg uintptr, pzErr uintptr) int32 { /* sqlite3.c:216929:12: */
+func fts5ConfigParseColumn(tls *libc.TLS, p uintptr, zCol uintptr, zArg uintptr, pzErr uintptr) int32 { /* sqlite3.c:218742:12: */
bp := tls.Alloc(16)
defer tls.Free(16)
var rc int32 = SQLITE_OK
- if (0 == Xsqlite3_stricmp(tls, zCol, ts+20497 /* "rank" */)) ||
- (0 == Xsqlite3_stricmp(tls, zCol, ts+14757 /* "rowid" */)) {
- *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, ts+32464 /* "reserved fts5 co..." */, libc.VaList(bp, zCol))
+ if 0 == Xsqlite3_stricmp(tls, zCol, ts+21794) ||
+ 0 == Xsqlite3_stricmp(tls, zCol, ts+15961) {
+ *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, ts+33824 /* "reserved fts5 co..." */, libc.VaList(bp, zCol))
rc = SQLITE_ERROR
} else if zArg != 0 {
- if 0 == Xsqlite3_stricmp(tls, zArg, ts+32494 /* "unindexed" */) {
+ if 0 == Xsqlite3_stricmp(tls, zArg, ts+33854) {
*(*U8)(unsafe.Pointer((*Fts5Config)(unsafe.Pointer(p)).FabUnindexed + uintptr((*Fts5Config)(unsafe.Pointer(p)).FnCol))) = U8(1)
} else {
- *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, ts+32504 /* "unrecognized col..." */, libc.VaList(bp+8, zArg))
+ *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, ts+33864 /* "unrecognized col..." */, libc.VaList(bp+8, zArg))
rc = SQLITE_ERROR
}
}
@@ -174040,7 +176368,7 @@ func fts5ConfigParseColumn(tls *libc.TLS, p uintptr, zCol uintptr, zArg uintptr,
}
// Populate the Fts5Config.zContentExprlist string.
-func fts5ConfigMakeExprlist(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:216957:12: */
+func fts5ConfigMakeExprlist(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:218770:12: */
bp := tls.Alloc(40)
defer tls.Free(40)
@@ -174048,13 +176376,13 @@ func fts5ConfigMakeExprlist(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:21695
*(*int32)(unsafe.Pointer(bp + 24 /* rc */)) = SQLITE_OK
*(*Fts5Buffer)(unsafe.Pointer(bp + 28 /* buf */)) = Fts5Buffer{}
- sqlite3Fts5BufferAppendPrintf(tls, bp+24 /* &rc */, bp+28 /* &buf */, ts+32535 /* "T.%Q" */, libc.VaList(bp, (*Fts5Config)(unsafe.Pointer(p)).FzContentRowid))
+ sqlite3Fts5BufferAppendPrintf(tls, bp+24 /* &rc */, bp+28 /* &buf */, ts+33895 /* "T.%Q" */, libc.VaList(bp, (*Fts5Config)(unsafe.Pointer(p)).FzContentRowid))
if (*Fts5Config)(unsafe.Pointer(p)).FeContent != FTS5_CONTENT_NONE {
for i = 0; i < (*Fts5Config)(unsafe.Pointer(p)).FnCol; i++ {
if (*Fts5Config)(unsafe.Pointer(p)).FeContent == FTS5_CONTENT_EXTERNAL {
- sqlite3Fts5BufferAppendPrintf(tls, bp+24 /* &rc */, bp+28 /* &buf */, ts+32540 /* ", T.%Q" */, libc.VaList(bp+8, *(*uintptr)(unsafe.Pointer((*Fts5Config)(unsafe.Pointer(p)).FazCol + uintptr(i)*4))))
+ sqlite3Fts5BufferAppendPrintf(tls, bp+24 /* &rc */, bp+28 /* &buf */, ts+33900 /* ", T.%Q" */, libc.VaList(bp+8, *(*uintptr)(unsafe.Pointer((*Fts5Config)(unsafe.Pointer(p)).FazCol + uintptr(i)*4))))
} else {
- sqlite3Fts5BufferAppendPrintf(tls, bp+24 /* &rc */, bp+28 /* &buf */, ts+32547 /* ", T.c%d" */, libc.VaList(bp+16, i))
+ sqlite3Fts5BufferAppendPrintf(tls, bp+24 /* &rc */, bp+28 /* &buf */, ts+33907 /* ", T.c%d" */, libc.VaList(bp+16, i))
}
}
}
@@ -174073,7 +176401,7 @@ func fts5ConfigMakeExprlist(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:21695
// returned, *ppOut is set to NULL and an error message may be left in
// *pzErr. It is the responsibility of the caller to eventually free any
// such error message using sqlite3_free().
-func sqlite3Fts5ConfigParse(tls *libc.TLS, pGlobal uintptr, db uintptr, nArg int32, azArg uintptr, ppOut uintptr, pzErr uintptr) int32 { /* sqlite3.c:216990:12: */
+func sqlite3Fts5ConfigParse(tls *libc.TLS, pGlobal uintptr, db uintptr, nArg int32, azArg uintptr, ppOut uintptr, pzErr uintptr) int32 { /* sqlite3.c:218803:12: */
bp := tls.Alloc(60)
defer tls.Free(60)
@@ -174090,11 +176418,11 @@ func sqlite3Fts5ConfigParse(tls *libc.TLS, pGlobal uintptr, db uintptr, nArg int
(*Fts5Config)(unsafe.Pointer(pRet)).Fdb = db
(*Fts5Config)(unsafe.Pointer(pRet)).FiCookie = -1
- nByte = (Sqlite3_int64(uint32(nArg) * (uint32(unsafe.Sizeof(uintptr(0))) + uint32(unsafe.Sizeof(U8(0))))))
+ nByte = Sqlite3_int64(uint32(nArg) * (uint32(unsafe.Sizeof(uintptr(0))) + uint32(unsafe.Sizeof(U8(0)))))
(*Fts5Config)(unsafe.Pointer(pRet)).FazCol = sqlite3Fts5MallocZero(tls, bp+40 /* &rc */, nByte)
(*Fts5Config)(unsafe.Pointer(pRet)).FabUnindexed = func() uintptr {
if (*Fts5Config)(unsafe.Pointer(pRet)).FazCol != 0 {
- return ((*Fts5Config)(unsafe.Pointer(pRet)).FazCol + uintptr(nArg)*4)
+ return (*Fts5Config)(unsafe.Pointer(pRet)).FazCol + uintptr(nArg)*4
}
return uintptr(0)
}()
@@ -174102,12 +176430,12 @@ func sqlite3Fts5ConfigParse(tls *libc.TLS, pGlobal uintptr, db uintptr, nArg int
(*Fts5Config)(unsafe.Pointer(pRet)).FzName = sqlite3Fts5Strndup(tls, bp+40 /* &rc */, *(*uintptr)(unsafe.Pointer(azArg + 2*4)), -1)
(*Fts5Config)(unsafe.Pointer(pRet)).FbColumnsize = 1
(*Fts5Config)(unsafe.Pointer(pRet)).FeDetail = FTS5_DETAIL_FULL
- if (*(*int32)(unsafe.Pointer(bp + 40 /* rc */)) == SQLITE_OK) && (Xsqlite3_stricmp(tls, (*Fts5Config)(unsafe.Pointer(pRet)).FzName, ts+20497 /* "rank" */) == 0) {
- *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, ts+32555 /* "reserved fts5 ta..." */, libc.VaList(bp, (*Fts5Config)(unsafe.Pointer(pRet)).FzName))
+ if *(*int32)(unsafe.Pointer(bp + 40)) == SQLITE_OK && Xsqlite3_stricmp(tls, (*Fts5Config)(unsafe.Pointer(pRet)).FzName, ts+21794) == 0 {
+ *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, ts+33915 /* "reserved fts5 ta..." */, libc.VaList(bp, (*Fts5Config)(unsafe.Pointer(pRet)).FzName))
*(*int32)(unsafe.Pointer(bp + 40 /* rc */)) = SQLITE_ERROR
}
- for i = 3; (*(*int32)(unsafe.Pointer(bp + 40 /* rc */)) == SQLITE_OK) && (i < nArg); i++ {
+ for i = 3; *(*int32)(unsafe.Pointer(bp + 40 /* rc */)) == SQLITE_OK && i < nArg; i++ {
var zOrig uintptr = *(*uintptr)(unsafe.Pointer(azArg + uintptr(i)*4))
var z uintptr
*(*uintptr)(unsafe.Pointer(bp + 44 /* zOne */)) = uintptr(0)
@@ -174117,35 +176445,44 @@ func sqlite3Fts5ConfigParse(tls *libc.TLS, pGlobal uintptr, db uintptr, nArg int
z = fts5ConfigGobbleWord(tls, bp+40 /* &rc */, zOrig, bp+44 /* &zOne */, bp+48 /* &bMustBeCol */)
z = fts5ConfigSkipWhitespace(tls, z)
- if (z != 0) && (int32(*(*uint8)(unsafe.Pointer(z))) == '=') {
+ if z != 0 && int32(*(*uint8)(unsafe.Pointer(z))) == '=' {
bOption = 1
+
z++
- if *(*int32)(unsafe.Pointer(bp + 48 /* bMustBeCol */)) != 0 {
+ if *(*int32)(unsafe.Pointer(bp + 48)) != 0 {
z = uintptr(0)
}
}
z = fts5ConfigSkipWhitespace(tls, z)
- if (z != 0) && (*(*uint8)(unsafe.Pointer(z)) != 0) {
+ if z != 0 && *(*uint8)(unsafe.Pointer(z)) != 0 {
// var bDummy int32 at bp+56, 4
z = fts5ConfigGobbleWord(tls, bp+40 /* &rc */, z, bp+52 /* &zTwo */, bp+56 /* &bDummy */)
- if (z != 0) && (*(*uint8)(unsafe.Pointer(z)) != 0) {
+ if z != 0 && *(*uint8)(unsafe.Pointer(z)) != 0 {
z = uintptr(0)
}
}
- if *(*int32)(unsafe.Pointer(bp + 40 /* rc */)) == SQLITE_OK {
+ if *(*int32)(unsafe.Pointer(bp + 40)) == SQLITE_OK {
if z == uintptr(0) {
- *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, ts+32584 /* "parse error in \"..." */, libc.VaList(bp+8, zOrig))
+ *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, ts+33944 /* "parse error in \"..." */, libc.VaList(bp+8, zOrig))
*(*int32)(unsafe.Pointer(bp + 40 /* rc */)) = SQLITE_ERROR
} else {
if bOption != 0 {
- *(*int32)(unsafe.Pointer(bp + 40 /* rc */)) = fts5ConfigParseSpecial(tls, pGlobal, pRet, *(*uintptr)(unsafe.Pointer(bp + 44 /* zOne */)), func() uintptr {
- if *(*uintptr)(unsafe.Pointer(bp + 52 /* zTwo */)) != 0 {
- return *(*uintptr)(unsafe.Pointer(bp + 52 /* zTwo */))
- }
- return ts + 755 /* "" */
- }(), pzErr)
+ *(*int32)(unsafe.Pointer(bp + 40 /* rc */)) = fts5ConfigParseSpecial(tls, pGlobal, pRet,
+ func() uintptr {
+ if *(*uintptr)(unsafe.Pointer(bp + 44)) != 0 {
+ return *(*uintptr)(unsafe.Pointer(bp + 44 /* zOne */))
+ }
+ return ts + 1543 /* "" */
+ }(),
+ func() uintptr {
+ if *(*uintptr)(unsafe.Pointer(bp + 52)) != 0 {
+ return *(*uintptr)(unsafe.Pointer(bp + 52 /* zTwo */))
+ }
+ return ts + 1543 /* "" */
+ }(),
+ pzErr)
} else {
*(*int32)(unsafe.Pointer(bp + 40 /* rc */)) = fts5ConfigParseColumn(tls, pRet, *(*uintptr)(unsafe.Pointer(bp + 44 /* zOne */)), *(*uintptr)(unsafe.Pointer(bp + 52 /* zTwo */)), pzErr)
*(*uintptr)(unsafe.Pointer(bp + 44 /* zOne */)) = uintptr(0)
@@ -174160,36 +176497,36 @@ func sqlite3Fts5ConfigParse(tls *libc.TLS, pGlobal uintptr, db uintptr, nArg int
// 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 + 40 /* rc */)) == SQLITE_OK) && ((*Fts5Config)(unsafe.Pointer(pRet)).FpTok == uintptr(0)) {
+ if *(*int32)(unsafe.Pointer(bp + 40)) == SQLITE_OK && (*Fts5Config)(unsafe.Pointer(pRet)).FpTok == uintptr(0) {
*(*int32)(unsafe.Pointer(bp + 40 /* rc */)) = fts5ConfigDefaultTokenizer(tls, pGlobal, pRet)
}
// If no zContent option was specified, fill in the default values.
- if (*(*int32)(unsafe.Pointer(bp + 40 /* rc */)) == SQLITE_OK) && ((*Fts5Config)(unsafe.Pointer(pRet)).FzContent == uintptr(0)) {
+ if *(*int32)(unsafe.Pointer(bp + 40)) == SQLITE_OK && (*Fts5Config)(unsafe.Pointer(pRet)).FzContent == uintptr(0) {
var zTail uintptr = uintptr(0)
if (*Fts5Config)(unsafe.Pointer(pRet)).FeContent == FTS5_CONTENT_NORMAL {
- zTail = ts + 32253 /* "content" */
+ zTail = ts + 33613 /* "content" */
} else if (*Fts5Config)(unsafe.Pointer(pRet)).FbColumnsize != 0 {
- zTail = ts + 32604 /* "docsize" */
+ zTail = ts + 33964 /* "docsize" */
}
if zTail != 0 {
(*Fts5Config)(unsafe.Pointer(pRet)).FzContent = sqlite3Fts5Mprintf(tls,
- bp+40 /* &rc */, ts+32612 /* "%Q.'%q_%s'" */, libc.VaList(bp+16, (*Fts5Config)(unsafe.Pointer(pRet)).FzDb, (*Fts5Config)(unsafe.Pointer(pRet)).FzName, zTail))
+ bp+40 /* &rc */, ts+33972 /* "%Q.'%q_%s'" */, libc.VaList(bp+16, (*Fts5Config)(unsafe.Pointer(pRet)).FzDb, (*Fts5Config)(unsafe.Pointer(pRet)).FzName, zTail))
}
}
- if (*(*int32)(unsafe.Pointer(bp + 40 /* rc */)) == SQLITE_OK) && ((*Fts5Config)(unsafe.Pointer(pRet)).FzContentRowid == uintptr(0)) {
- (*Fts5Config)(unsafe.Pointer(pRet)).FzContentRowid = sqlite3Fts5Strndup(tls, bp+40 /* &rc */, ts+14757 /* "rowid" */, -1)
+ if *(*int32)(unsafe.Pointer(bp + 40)) == SQLITE_OK && (*Fts5Config)(unsafe.Pointer(pRet)).FzContentRowid == uintptr(0) {
+ (*Fts5Config)(unsafe.Pointer(pRet)).FzContentRowid = sqlite3Fts5Strndup(tls, bp+40 /* &rc */, ts+15961 /* "rowid" */, -1)
}
// Formulate the zContentExprlist text
- if *(*int32)(unsafe.Pointer(bp + 40 /* rc */)) == SQLITE_OK {
+ if *(*int32)(unsafe.Pointer(bp + 40)) == SQLITE_OK {
*(*int32)(unsafe.Pointer(bp + 40 /* rc */)) = fts5ConfigMakeExprlist(tls, pRet)
}
- if *(*int32)(unsafe.Pointer(bp + 40 /* rc */)) != SQLITE_OK {
+ if *(*int32)(unsafe.Pointer(bp + 40)) != SQLITE_OK {
sqlite3Fts5ConfigFree(tls, pRet)
*(*uintptr)(unsafe.Pointer(ppOut)) = uintptr(0)
}
@@ -174197,7 +176534,7 @@ func sqlite3Fts5ConfigParse(tls *libc.TLS, pGlobal uintptr, db uintptr, nArg int
}
// Free the configuration object passed as the only argument.
-func sqlite3Fts5ConfigFree(tls *libc.TLS, pConfig uintptr) { /* sqlite3.c:217109:13: */
+func sqlite3Fts5ConfigFree(tls *libc.TLS, pConfig uintptr) { /* sqlite3.c:218927:13: */
if pConfig != 0 {
var i int32
if (*Fts5Config)(unsafe.Pointer(pConfig)).FpTok != 0 {
@@ -174222,7 +176559,7 @@ func sqlite3Fts5ConfigFree(tls *libc.TLS, pConfig uintptr) { /* sqlite3.c:217109
// Call sqlite3_declare_vtab() based on the contents of the configuration
// object passed as the only argument. Return SQLITE_OK if successful, or
// an SQLite error code if an error occurs.
-func sqlite3Fts5ConfigDeclareVtab(tls *libc.TLS, pConfig uintptr) int32 { /* sqlite3.c:217136:12: */
+func sqlite3Fts5ConfigDeclareVtab(tls *libc.TLS, pConfig uintptr) int32 { /* sqlite3.c:218954:12: */
bp := tls.Alloc(52)
defer tls.Free(52)
@@ -174230,18 +176567,18 @@ func sqlite3Fts5ConfigDeclareVtab(tls *libc.TLS, pConfig uintptr) int32 { /* sql
*(*int32)(unsafe.Pointer(bp + 48 /* rc */)) = SQLITE_OK
var zSql uintptr
- zSql = sqlite3Fts5Mprintf(tls, bp+48 /* &rc */, ts+32623 /* "CREATE TABLE x(" */, 0)
- for i = 0; (zSql != 0) && (i < (*Fts5Config)(unsafe.Pointer(pConfig)).FnCol); i++ {
+ zSql = sqlite3Fts5Mprintf(tls, bp+48 /* &rc */, ts+33983 /* "CREATE TABLE x(" */, 0)
+ for i = 0; zSql != 0 && i < (*Fts5Config)(unsafe.Pointer(pConfig)).FnCol; i++ {
var zSep uintptr = func() uintptr {
if i == 0 {
- return ts + 755 /* "" */
+ return ts + 1543
}
- return ts + 13324 /* ", " */
+ return ts + 14507
}()
- zSql = sqlite3Fts5Mprintf(tls, bp+48 /* &rc */, ts+32639 /* "%z%s%Q" */, libc.VaList(bp, zSql, zSep, *(*uintptr)(unsafe.Pointer((*Fts5Config)(unsafe.Pointer(pConfig)).FazCol + uintptr(i)*4))))
+ zSql = sqlite3Fts5Mprintf(tls, bp+48 /* &rc */, ts+33999 /* "%z%s%Q" */, libc.VaList(bp, zSql, zSep, *(*uintptr)(unsafe.Pointer((*Fts5Config)(unsafe.Pointer(pConfig)).FazCol + uintptr(i)*4))))
}
- zSql = sqlite3Fts5Mprintf(tls, bp+48 /* &rc */, ts+32646, /* "%z, %Q HIDDEN, %..." */
- libc.VaList(bp+24, zSql, (*Fts5Config)(unsafe.Pointer(pConfig)).FzName, ts+20497 /* "rank" */))
+ zSql = sqlite3Fts5Mprintf(tls, bp+48 /* &rc */, ts+34006, /* "%z, %Q HIDDEN, %..." */
+ libc.VaList(bp+24, zSql, (*Fts5Config)(unsafe.Pointer(pConfig)).FzName, ts+21794 /* "rank" */))
if zSql != 0 {
*(*int32)(unsafe.Pointer(bp + 48 /* rc */)) = Xsqlite3_declare_vtab(tls, (*Fts5Config)(unsafe.Pointer(pConfig)).Fdb, zSql)
@@ -174272,7 +176609,7 @@ func sqlite3Fts5ConfigDeclareVtab(tls *libc.TLS, pConfig uintptr) int32 { /* sql
// still returns SQLITE_OK. Or, if the tokenization was abandoned early
// because the callback returned another non-zero value, it is assumed
// to be an SQLite error code and returned to the caller.
-func sqlite3Fts5Tokenize(tls *libc.TLS, pConfig uintptr, flags int32, pText uintptr, nText int32, pCtx uintptr, xToken uintptr) int32 { /* sqlite3.c:217182:12: */
+func sqlite3Fts5Tokenize(tls *libc.TLS, pConfig uintptr, flags int32, pText uintptr, nText int32, pCtx uintptr, xToken uintptr) int32 { /* sqlite3.c:219000:12: */
if pText == uintptr(0) {
return SQLITE_OK
}
@@ -174286,14 +176623,14 @@ func sqlite3Fts5Tokenize(tls *libc.TLS, pConfig uintptr, flags int32, pText uint
// a comma-separated list of SQL literals followed by a ')' character.
// If it actually is this, return a pointer to the ')'. Otherwise, return
// NULL to indicate a parse error.
-func fts5ConfigSkipArgs(tls *libc.TLS, pIn uintptr) uintptr { /* sqlite3.c:217201:19: */
+func fts5ConfigSkipArgs(tls *libc.TLS, pIn uintptr) uintptr { /* sqlite3.c:219019:19: */
var p uintptr = pIn
for 1 != 0 {
p = fts5ConfigSkipWhitespace(tls, p)
p = fts5ConfigSkipLiteral(tls, p)
p = fts5ConfigSkipWhitespace(tls, p)
- if (p == uintptr(0)) || (int32(*(*uint8)(unsafe.Pointer(p))) == ')') {
+ if p == uintptr(0) || int32(*(*uint8)(unsafe.Pointer(p))) == ')' {
break
}
if int32(*(*uint8)(unsafe.Pointer(p))) != ',' {
@@ -174313,7 +176650,7 @@ func fts5ConfigSkipArgs(tls *libc.TLS, pIn uintptr) uintptr { /* sqlite3.c:21720
// + Open parenthesis - "("
// + Zero or more SQL literals in a comma separated list
// + Close parenthesis - ")"
-func sqlite3Fts5ConfigParseRank(tls *libc.TLS, zIn uintptr, pzRank uintptr, pzRankArgs uintptr) int32 { /* sqlite3.c:217228:12: */
+func sqlite3Fts5ConfigParseRank(tls *libc.TLS, zIn uintptr, pzRank uintptr, pzRankArgs uintptr) int32 { /* sqlite3.c:219046:12: */
bp := tls.Alloc(4)
defer tls.Free(4)
@@ -174334,22 +176671,22 @@ func sqlite3Fts5ConfigParseRank(tls *libc.TLS, zIn uintptr, pzRank uintptr, pzRa
p = fts5ConfigSkipBareword(tls, p)
if p != 0 {
- zRank = sqlite3Fts5MallocZero(tls, bp /* &rc */, (int64(((int32(uintptr(1) + p)) - int32(pRank)) / 1)))
+ zRank = sqlite3Fts5MallocZero(tls, bp /* &rc */, int64((int32(uintptr(1)+p)-int32(pRank))/1))
if zRank != 0 {
- libc.Xmemcpy(tls, zRank, pRank, (uint32((int32(p) - int32(pRank)) / 1)))
+ libc.Xmemcpy(tls, zRank, pRank, uint32((int32(p)-int32(pRank))/1))
}
} else {
*(*int32)(unsafe.Pointer(bp /* rc */)) = SQLITE_ERROR
}
- if *(*int32)(unsafe.Pointer(bp /* rc */)) == SQLITE_OK {
+ if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK {
p = fts5ConfigSkipWhitespace(tls, p)
if int32(*(*uint8)(unsafe.Pointer(p))) != '(' {
*(*int32)(unsafe.Pointer(bp /* rc */)) = SQLITE_ERROR
}
p++
}
- if *(*int32)(unsafe.Pointer(bp /* rc */)) == SQLITE_OK {
+ if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK {
var pArgs uintptr
p = fts5ConfigSkipWhitespace(tls, p)
pArgs = p
@@ -174358,16 +176695,16 @@ func sqlite3Fts5ConfigParseRank(tls *libc.TLS, zIn uintptr, pzRank uintptr, pzRa
if p == uintptr(0) {
*(*int32)(unsafe.Pointer(bp /* rc */)) = SQLITE_ERROR
} else {
- zRankArgs = sqlite3Fts5MallocZero(tls, bp /* &rc */, (int64(((int32(uintptr(1) + p)) - int32(pArgs)) / 1)))
+ zRankArgs = sqlite3Fts5MallocZero(tls, bp /* &rc */, int64((int32(uintptr(1)+p)-int32(pArgs))/1))
if zRankArgs != 0 {
- libc.Xmemcpy(tls, zRankArgs, pArgs, (uint32((int32(p) - int32(pArgs)) / 1)))
+ libc.Xmemcpy(tls, zRankArgs, pArgs, uint32((int32(p)-int32(pArgs))/1))
}
}
}
}
}
- if *(*int32)(unsafe.Pointer(bp /* rc */)) != SQLITE_OK {
+ if *(*int32)(unsafe.Pointer(bp)) != SQLITE_OK {
Xsqlite3_free(tls, zRank)
} else {
@@ -174377,23 +176714,23 @@ func sqlite3Fts5ConfigParseRank(tls *libc.TLS, zIn uintptr, pzRank uintptr, pzRa
return *(*int32)(unsafe.Pointer(bp /* rc */))
}
-func sqlite3Fts5ConfigSetValue(tls *libc.TLS, pConfig uintptr, zKey uintptr, pVal uintptr, pbBadkey uintptr) int32 { /* sqlite3.c:217287:12: */
+func sqlite3Fts5ConfigSetValue(tls *libc.TLS, pConfig uintptr, zKey uintptr, pVal uintptr, pbBadkey uintptr) int32 { /* sqlite3.c:219105:12: */
bp := tls.Alloc(8)
defer tls.Free(8)
var rc int32 = SQLITE_OK
- if 0 == Xsqlite3_stricmp(tls, zKey, ts+32672 /* "pgsz" */) {
+ if 0 == Xsqlite3_stricmp(tls, zKey, ts+34032) {
var pgsz int32 = 0
if SQLITE_INTEGER == Xsqlite3_value_numeric_type(tls, pVal) {
pgsz = Xsqlite3_value_int(tls, pVal)
}
- if (pgsz < 32) || (pgsz > (64 * 1024)) {
+ if pgsz < 32 || pgsz > 64*1024 {
*(*int32)(unsafe.Pointer(pbBadkey)) = 1
} else {
(*Fts5Config)(unsafe.Pointer(pConfig)).Fpgsz = pgsz
}
- } else if 0 == Xsqlite3_stricmp(tls, zKey, ts+32677 /* "hashsize" */) {
+ } else if 0 == Xsqlite3_stricmp(tls, zKey, ts+34037) {
var nHashSize int32 = -1
if SQLITE_INTEGER == Xsqlite3_value_numeric_type(tls, pVal) {
nHashSize = Xsqlite3_value_int(tls, pVal)
@@ -174403,12 +176740,12 @@ func sqlite3Fts5ConfigSetValue(tls *libc.TLS, pConfig uintptr, zKey uintptr, pVa
} else {
(*Fts5Config)(unsafe.Pointer(pConfig)).FnHashSize = nHashSize
}
- } else if 0 == Xsqlite3_stricmp(tls, zKey, ts+32686 /* "automerge" */) {
+ } else if 0 == Xsqlite3_stricmp(tls, zKey, ts+34046) {
var nAutomerge int32 = -1
if SQLITE_INTEGER == Xsqlite3_value_numeric_type(tls, pVal) {
nAutomerge = Xsqlite3_value_int(tls, pVal)
}
- if (nAutomerge < 0) || (nAutomerge > 64) {
+ if nAutomerge < 0 || nAutomerge > 64 {
*(*int32)(unsafe.Pointer(pbBadkey)) = 1
} else {
if nAutomerge == 1 {
@@ -174416,17 +176753,17 @@ func sqlite3Fts5ConfigSetValue(tls *libc.TLS, pConfig uintptr, zKey uintptr, pVa
}
(*Fts5Config)(unsafe.Pointer(pConfig)).FnAutomerge = nAutomerge
}
- } else if 0 == Xsqlite3_stricmp(tls, zKey, ts+32696 /* "usermerge" */) {
+ } else if 0 == Xsqlite3_stricmp(tls, zKey, ts+34056) {
var nUsermerge int32 = -1
if SQLITE_INTEGER == Xsqlite3_value_numeric_type(tls, pVal) {
nUsermerge = Xsqlite3_value_int(tls, pVal)
}
- if (nUsermerge < 2) || (nUsermerge > 16) {
+ if nUsermerge < 2 || nUsermerge > 16 {
*(*int32)(unsafe.Pointer(pbBadkey)) = 1
} else {
(*Fts5Config)(unsafe.Pointer(pConfig)).FnUsermerge = nUsermerge
}
- } else if 0 == Xsqlite3_stricmp(tls, zKey, ts+32706 /* "crisismerge" */) {
+ } else if 0 == Xsqlite3_stricmp(tls, zKey, ts+34066) {
var nCrisisMerge int32 = -1
if SQLITE_INTEGER == Xsqlite3_value_numeric_type(tls, pVal) {
nCrisisMerge = Xsqlite3_value_int(tls, pVal)
@@ -174438,11 +176775,11 @@ func sqlite3Fts5ConfigSetValue(tls *libc.TLS, pConfig uintptr, zKey uintptr, pVa
nCrisisMerge = FTS5_DEFAULT_CRISISMERGE
}
if nCrisisMerge >= FTS5_MAX_SEGMENT {
- nCrisisMerge = (FTS5_MAX_SEGMENT - 1)
+ nCrisisMerge = FTS5_MAX_SEGMENT - 1
}
(*Fts5Config)(unsafe.Pointer(pConfig)).FnCrisisMerge = nCrisisMerge
}
- } else if 0 == Xsqlite3_stricmp(tls, zKey, ts+20497 /* "rank" */) {
+ } else if 0 == Xsqlite3_stricmp(tls, zKey, ts+21794) {
var zIn uintptr = Xsqlite3_value_text(tls, pVal)
// var zRank uintptr at bp, 4
@@ -174465,11 +176802,11 @@ func sqlite3Fts5ConfigSetValue(tls *libc.TLS, pConfig uintptr, zKey uintptr, pVa
}
// Load the contents of the %_config table into memory.
-func sqlite3Fts5ConfigLoad(tls *libc.TLS, pConfig uintptr, iCookie int32) int32 { /* sqlite3.c:217381:12: */
+func sqlite3Fts5ConfigLoad(tls *libc.TLS, pConfig uintptr, iCookie int32) int32 { /* sqlite3.c:219199:12: */
bp := tls.Alloc(44)
defer tls.Free(44)
- var zSelect uintptr = ts + 32718 /* "SELECT k, v FROM..." */
+ var zSelect uintptr = ts + 34078 /* "SELECT k, v FROM..." */
var zSql uintptr
*(*uintptr)(unsafe.Pointer(bp + 36 /* p */)) = uintptr(0)
*(*int32)(unsafe.Pointer(bp + 32 /* rc */)) = SQLITE_OK
@@ -174480,7 +176817,7 @@ func sqlite3Fts5ConfigLoad(tls *libc.TLS, pConfig uintptr, iCookie int32) int32
(*Fts5Config)(unsafe.Pointer(pConfig)).FnAutomerge = FTS5_DEFAULT_AUTOMERGE
(*Fts5Config)(unsafe.Pointer(pConfig)).FnUsermerge = FTS5_DEFAULT_USERMERGE
(*Fts5Config)(unsafe.Pointer(pConfig)).FnCrisisMerge = FTS5_DEFAULT_CRISISMERGE
- (*Fts5Config)(unsafe.Pointer(pConfig)).FnHashSize = (1024 * 1024)
+ (*Fts5Config)(unsafe.Pointer(pConfig)).FnHashSize = 1024 * 1024
zSql = sqlite3Fts5Mprintf(tls, bp+32 /* &rc */, zSelect, libc.VaList(bp, (*Fts5Config)(unsafe.Pointer(pConfig)).FzDb, (*Fts5Config)(unsafe.Pointer(pConfig)).FzName))
if zSql != 0 {
@@ -174488,11 +176825,11 @@ func sqlite3Fts5ConfigLoad(tls *libc.TLS, pConfig uintptr, iCookie int32) int32
Xsqlite3_free(tls, zSql)
}
- if *(*int32)(unsafe.Pointer(bp + 32 /* rc */)) == SQLITE_OK {
- for SQLITE_ROW == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp + 36 /* p */))) {
+ if *(*int32)(unsafe.Pointer(bp + 32)) == SQLITE_OK {
+ for SQLITE_ROW == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp + 36))) {
var zK uintptr = Xsqlite3_column_text(tls, *(*uintptr)(unsafe.Pointer(bp + 36 /* p */)), 0)
var pVal uintptr = Xsqlite3_column_value(tls, *(*uintptr)(unsafe.Pointer(bp + 36 /* p */)), 1)
- if 0 == Xsqlite3_stricmp(tls, zK, ts+32750 /* "version" */) {
+ if 0 == Xsqlite3_stricmp(tls, zK, ts+34110) {
iVersion = Xsqlite3_value_int(tls, pVal)
} else {
*(*int32)(unsafe.Pointer(bp + 40 /* bDummy */)) = 0
@@ -174502,17 +176839,17 @@ func sqlite3Fts5ConfigLoad(tls *libc.TLS, pConfig uintptr, iCookie int32) int32
*(*int32)(unsafe.Pointer(bp + 32 /* rc */)) = Xsqlite3_finalize(tls, *(*uintptr)(unsafe.Pointer(bp + 36 /* p */)))
}
- if (*(*int32)(unsafe.Pointer(bp + 32 /* rc */)) == SQLITE_OK) && (iVersion != FTS5_CURRENT_VERSION) {
+ if *(*int32)(unsafe.Pointer(bp + 32)) == SQLITE_OK && iVersion != FTS5_CURRENT_VERSION {
*(*int32)(unsafe.Pointer(bp + 32 /* rc */)) = SQLITE_ERROR
if (*Fts5Config)(unsafe.Pointer(pConfig)).FpzErrmsg != 0 {
*(*uintptr)(unsafe.Pointer((*Fts5Config)(unsafe.Pointer(pConfig)).FpzErrmsg)) = Xsqlite3_mprintf(tls,
- ts+32758, /* "invalid fts5 fil..." */
+ ts+34118, /* "invalid fts5 fil..." */
libc.VaList(bp+16, iVersion, FTS5_CURRENT_VERSION))
}
}
- if *(*int32)(unsafe.Pointer(bp + 32 /* rc */)) == SQLITE_OK {
+ if *(*int32)(unsafe.Pointer(bp + 32)) == SQLITE_OK {
(*Fts5Config)(unsafe.Pointer(pConfig)).FiCookie = iCookie
}
return *(*int32)(unsafe.Pointer(bp + 32 /* rc */))
@@ -174542,7 +176879,7 @@ type Fts5ExprTerm1 = struct {
FzTerm uintptr
FpIter uintptr
FpSynonym uintptr
-} /* sqlite3.c:213118:9 */
+} /* sqlite3.c:214930:9 */
// 2014 May 31
//
@@ -174561,25 +176898,26 @@ type Fts5ExprTerm1 = struct {
// All token types in the generated fts5parse.h file are greater than 0.
-type Fts5ExprTerm = Fts5ExprTerm1 /* sqlite3.c:217459:29 */
+type Fts5ExprTerm = Fts5ExprTerm1 /* sqlite3.c:219277:29 */
-func sqlite3Fts5ParseError(tls *libc.TLS, pParse uintptr, zFmt uintptr, va uintptr) { /* sqlite3.c:217566:13: */
+func sqlite3Fts5ParseError(tls *libc.TLS, pParse uintptr, zFmt uintptr, va uintptr) { /* sqlite3.c:219384:13: */
var ap Va_list
_ = ap
ap = va
if (*Fts5Parse)(unsafe.Pointer(pParse)).Frc == SQLITE_OK {
+
(*Fts5Parse)(unsafe.Pointer(pParse)).FzErr = Xsqlite3_vmprintf(tls, zFmt, ap)
(*Fts5Parse)(unsafe.Pointer(pParse)).Frc = SQLITE_ERROR
}
_ = ap
}
-func fts5ExprIsspace(tls *libc.TLS, t uint8) int32 { /* sqlite3.c:217576:12: */
- return (libc.Bool32((((int32(t) == ' ') || (int32(t) == '\t')) || (int32(t) == '\n')) || (int32(t) == '\r')))
+func fts5ExprIsspace(tls *libc.TLS, t uint8) int32 { /* sqlite3.c:219395:12: */
+ return libc.Bool32(int32(t) == ' ' || int32(t) == '\t' || int32(t) == '\n' || int32(t) == '\r')
}
// Read the first token from the nul-terminated string at *pz.
-func fts5ExprGetToken(tls *libc.TLS, pParse uintptr, pz uintptr, pToken uintptr) int32 { /* sqlite3.c:217583:12: */
+func fts5ExprGetToken(tls *libc.TLS, pParse uintptr, pz uintptr, pToken uintptr) int32 { /* sqlite3.c:219402:12: */
bp := tls.Alloc(8)
defer tls.Free(8)
@@ -174633,7 +176971,7 @@ func fts5ExprGetToken(tls *libc.TLS, pParse uintptr, pz uintptr, pToken uintptr)
var z2 uintptr
tok = FTS5_STRING
- for z2 = (z + 1); 1 != 0; z2++ {
+ for z2 = z + 1; 1 != 0; z2++ {
if int32(*(*uint8)(unsafe.Pointer(z2))) == '"' {
z2++
if int32(*(*uint8)(unsafe.Pointer(z2))) != '"' {
@@ -174641,11 +176979,11 @@ func fts5ExprGetToken(tls *libc.TLS, pParse uintptr, pz uintptr, pToken uintptr)
}
}
if int32(*(*uint8)(unsafe.Pointer(z2))) == 0 {
- sqlite3Fts5ParseError(tls, pParse, ts+32823 /* "unterminated str..." */, 0)
+ sqlite3Fts5ParseError(tls, pParse, ts+34183 /* "unterminated str..." */, 0)
return FTS5_EOF
}
}
- (*Fts5Token)(unsafe.Pointer(pToken)).Fn = ((int32(z2) - int32(z)) / 1)
+ (*Fts5Token)(unsafe.Pointer(pToken)).Fn = (int32(z2) - int32(z)) / 1
break
}
@@ -174654,20 +176992,20 @@ func fts5ExprGetToken(tls *libc.TLS, pParse uintptr, pz uintptr, pToken uintptr)
{
var z2 uintptr
if sqlite3Fts5IsBareword(tls, *(*uint8)(unsafe.Pointer(z))) == 0 {
- sqlite3Fts5ParseError(tls, pParse, ts+32843 /* "fts5: syntax err..." */, libc.VaList(bp, z))
+ sqlite3Fts5ParseError(tls, pParse, ts+34203 /* "fts5: syntax err..." */, libc.VaList(bp, z))
return FTS5_EOF
}
tok = FTS5_STRING
- for z2 = (z + 1); sqlite3Fts5IsBareword(tls, *(*uint8)(unsafe.Pointer(z2))) != 0; z2++ {
+ for z2 = z + 1; sqlite3Fts5IsBareword(tls, *(*uint8)(unsafe.Pointer(z2))) != 0; z2++ {
}
- (*Fts5Token)(unsafe.Pointer(pToken)).Fn = ((int32(z2) - int32(z)) / 1)
- if ((*Fts5Token)(unsafe.Pointer(pToken)).Fn == 2) && (libc.Xmemcmp(tls, (*Fts5Token)(unsafe.Pointer(pToken)).Fp, ts+32874 /* "OR" */, uint32(2)) == 0) {
+ (*Fts5Token)(unsafe.Pointer(pToken)).Fn = (int32(z2) - int32(z)) / 1
+ if (*Fts5Token)(unsafe.Pointer(pToken)).Fn == 2 && libc.Xmemcmp(tls, (*Fts5Token)(unsafe.Pointer(pToken)).Fp, ts+34234, uint32(2)) == 0 {
tok = FTS5_OR
}
- if ((*Fts5Token)(unsafe.Pointer(pToken)).Fn == 3) && (libc.Xmemcmp(tls, (*Fts5Token)(unsafe.Pointer(pToken)).Fp, ts+32877 /* "NOT" */, uint32(3)) == 0) {
+ if (*Fts5Token)(unsafe.Pointer(pToken)).Fn == 3 && libc.Xmemcmp(tls, (*Fts5Token)(unsafe.Pointer(pToken)).Fp, ts+34237, uint32(3)) == 0 {
tok = FTS5_NOT
}
- if ((*Fts5Token)(unsafe.Pointer(pToken)).Fn == 3) && (libc.Xmemcmp(tls, (*Fts5Token)(unsafe.Pointer(pToken)).Fp, ts+28285 /* "AND" */, uint32(3)) == 0) {
+ if (*Fts5Token)(unsafe.Pointer(pToken)).Fn == 3 && libc.Xmemcmp(tls, (*Fts5Token)(unsafe.Pointer(pToken)).Fp, ts+29620, uint32(3)) == 0 {
tok = FTS5_AND
}
break
@@ -174675,19 +177013,19 @@ func fts5ExprGetToken(tls *libc.TLS, pParse uintptr, pz uintptr, pToken uintptr)
}
}
- *(*uintptr)(unsafe.Pointer(pz)) = ((*Fts5Token)(unsafe.Pointer(pToken)).Fp + uintptr((*Fts5Token)(unsafe.Pointer(pToken)).Fn))
+ *(*uintptr)(unsafe.Pointer(pz)) = (*Fts5Token)(unsafe.Pointer(pToken)).Fp + uintptr((*Fts5Token)(unsafe.Pointer(pToken)).Fn)
return tok
}
-func fts5ParseAlloc(tls *libc.TLS, t U64) uintptr { /* sqlite3.c:217647:13: */
+func fts5ParseAlloc(tls *libc.TLS, t U64) uintptr { /* sqlite3.c:219466:13: */
return Xsqlite3_malloc64(tls, uint64(Sqlite3_int64(t)))
}
-func fts5ParseFree(tls *libc.TLS, p uintptr) { /* sqlite3.c:217648:13: */
+func fts5ParseFree(tls *libc.TLS, p uintptr) { /* sqlite3.c:219467:13: */
Xsqlite3_free(tls, p)
}
-func sqlite3Fts5ExprNew(tls *libc.TLS, pConfig uintptr, bPhraseToAnd int32, iCol int32, zExpr uintptr, ppNew uintptr, pzErr uintptr) int32 { /* sqlite3.c:217650:12: */
+func sqlite3Fts5ExprNew(tls *libc.TLS, pConfig uintptr, bPhraseToAnd int32, iCol int32, zExpr uintptr, ppNew uintptr, pzErr uintptr) int32 { /* sqlite3.c:219469:12: */
bp := tls.Alloc(40)
defer tls.Free(40)
@@ -174710,7 +177048,7 @@ func sqlite3Fts5ExprNew(tls *libc.TLS, pConfig uintptr, bPhraseToAnd int32, iCol
}
(*Fts5Parse)(unsafe.Pointer(bp /* &sParse */)).FpConfig = pConfig
- for ok := true; ok; ok = (((*Fts5Parse)(unsafe.Pointer(bp /* &sParse */)).Frc == SQLITE_OK) && (t != FTS5_EOF)) {
+ for ok := true; ok; ok = (*Fts5Parse)(unsafe.Pointer(bp)).Frc == SQLITE_OK && t != FTS5_EOF {
t = fts5ExprGetToken(tls, bp /* &sParse */, bp+28 /* &z */, bp+32 /* &token */)
sqlite3Fts5Parser(tls, pEngine, t, *(*Fts5Token)(unsafe.Pointer(bp + 32 /* token */)), bp /* &sParse */)
}
@@ -174718,25 +177056,25 @@ func sqlite3Fts5ExprNew(tls *libc.TLS, pConfig uintptr, bPhraseToAnd int32, iCol
// If the LHS of the MATCH expression was a user column, apply the
// implicit column-filter.
- if ((iCol < (*Fts5Config)(unsafe.Pointer(pConfig)).FnCol) && ((*Fts5Parse)(unsafe.Pointer(bp /* &sParse */)).FpExpr != 0)) && ((*Fts5Parse)(unsafe.Pointer(bp /* &sParse */)).Frc == SQLITE_OK) {
+ if iCol < (*Fts5Config)(unsafe.Pointer(pConfig)).FnCol && (*Fts5Parse)(unsafe.Pointer(bp)).FpExpr != 0 && (*Fts5Parse)(unsafe.Pointer(bp)).Frc == SQLITE_OK {
var n int32 = int32(unsafe.Sizeof(Fts5Colset{}))
- var pColset uintptr = sqlite3Fts5MallocZero(tls, (bp /* &sParse */ + 8 /* &.rc */), int64(n))
+ var pColset uintptr = sqlite3Fts5MallocZero(tls, bp+8, int64(n))
if pColset != 0 {
(*Fts5Colset)(unsafe.Pointer(pColset)).FnCol = 1
- *(*int32)(unsafe.Pointer((pColset + 4 /* &.aiCol */))) = iCol
+ *(*int32)(unsafe.Pointer(pColset + 4)) = iCol
sqlite3Fts5ParseSetColset(tls, bp /* &sParse */, (*Fts5Parse)(unsafe.Pointer(bp /* &sParse */)).FpExpr, pColset)
}
}
- if (*Fts5Parse)(unsafe.Pointer(bp /* &sParse */)).Frc == SQLITE_OK {
+ if (*Fts5Parse)(unsafe.Pointer(bp)).Frc == SQLITE_OK {
*(*uintptr)(unsafe.Pointer(ppNew)) = libc.AssignUintptr(&pNew, Xsqlite3_malloc(tls, int32(unsafe.Sizeof(Fts5Expr{}))))
if pNew == uintptr(0) {
(*Fts5Parse)(unsafe.Pointer(bp /* &sParse */)).Frc = SQLITE_NOMEM
sqlite3Fts5ParseNodeFree(tls, (*Fts5Parse)(unsafe.Pointer(bp /* &sParse */)).FpExpr)
} else {
- if !(int32((*Fts5Parse)(unsafe.Pointer(bp /* &sParse */)).FpExpr) != 0) {
+ if !(int32((*Fts5Parse)(unsafe.Pointer(bp)).FpExpr) != 0) {
var nByte int32 = int32(unsafe.Sizeof(Fts5ExprNode{}))
- (*Fts5Expr)(unsafe.Pointer(pNew)).FpRoot = sqlite3Fts5MallocZero(tls, (bp /* &sParse */ + 8 /* &.rc */), int64(nByte))
+ (*Fts5Expr)(unsafe.Pointer(pNew)).FpRoot = sqlite3Fts5MallocZero(tls, bp+8, int64(nByte))
if (*Fts5Expr)(unsafe.Pointer(pNew)).FpRoot != 0 {
(*Fts5ExprNode)(unsafe.Pointer((*Fts5Expr)(unsafe.Pointer(pNew)).FpRoot)).FbEof = 1
}
@@ -174765,12 +177103,12 @@ func sqlite3Fts5ExprNew(tls *libc.TLS, pConfig uintptr, bPhraseToAnd int32, iCol
// expression that will match a superset of the rows matched by the LIKE or
// GLOB. If successful, SQLITE_OK is returned. Otherwise, an SQLite error
// code.
-func sqlite3Fts5ExprPattern(tls *libc.TLS, pConfig uintptr, bGlob int32, iCol int32, zText uintptr, pp uintptr) int32 { /* sqlite3.c:217731:12: */
+func sqlite3Fts5ExprPattern(tls *libc.TLS, pConfig uintptr, bGlob int32, iCol int32, zText uintptr, pp uintptr) int32 { /* sqlite3.c:219550:12: */
bp := tls.Alloc(3)
defer tls.Free(3)
var nText I64 = I64(libc.Xstrlen(tls, zText))
- var zExpr uintptr = Xsqlite3_malloc64(tls, (uint64((nText * int64(4)) + int64(1))))
+ var zExpr uintptr = Xsqlite3_malloc64(tls, uint64(nText*int64(4)+int64(1)))
var rc int32 = SQLITE_OK
if zExpr == uintptr(0) {
@@ -174793,9 +177131,9 @@ func sqlite3Fts5ExprPattern(tls *libc.TLS, pConfig uintptr, bGlob int32, iCol in
}
for I64(i) <= nText {
- if (((I64(i) == nText) ||
- (int32(*(*uint8)(unsafe.Pointer(zText + uintptr(i)))) == int32(*(*uint8)(unsafe.Pointer(bp /* &aSpec[0] */))))) || (int32(*(*uint8)(unsafe.Pointer(zText + uintptr(i)))) == int32(*(*uint8)(unsafe.Pointer(bp /* &aSpec[0] */ + 1))))) || (int32(*(*uint8)(unsafe.Pointer(zText + uintptr(i)))) == int32(*(*uint8)(unsafe.Pointer(bp /* &aSpec[0] */ + 2)))) {
- if (i - iFirst) >= 3 {
+ if I64(i) == nText ||
+ int32(*(*uint8)(unsafe.Pointer(zText + uintptr(i)))) == int32(*(*uint8)(unsafe.Pointer(bp))) || int32(*(*uint8)(unsafe.Pointer(zText + uintptr(i)))) == int32(*(*uint8)(unsafe.Pointer(bp + 1))) || int32(*(*uint8)(unsafe.Pointer(zText + uintptr(i)))) == int32(*(*uint8)(unsafe.Pointer(bp + 2))) {
+ if i-iFirst >= 3 {
var jj int32
*(*uint8)(unsafe.Pointer(zExpr + uintptr(libc.PostIncInt32(&iOut, 1)))) = uint8('"')
for jj = iFirst; jj < i; jj++ {
@@ -174807,16 +177145,16 @@ func sqlite3Fts5ExprPattern(tls *libc.TLS, pConfig uintptr, bGlob int32, iCol in
*(*uint8)(unsafe.Pointer(zExpr + uintptr(libc.PostIncInt32(&iOut, 1)))) = uint8('"')
*(*uint8)(unsafe.Pointer(zExpr + uintptr(libc.PostIncInt32(&iOut, 1)))) = uint8(' ')
}
- if int32(*(*uint8)(unsafe.Pointer(zText + uintptr(i)))) == int32(*(*uint8)(unsafe.Pointer(bp /* &aSpec[0] */ + 2))) {
- i = i + (2)
- if int32(*(*uint8)(unsafe.Pointer(zText + uintptr((i - 1))))) == '^' {
+ if int32(*(*uint8)(unsafe.Pointer(zText + uintptr(i)))) == int32(*(*uint8)(unsafe.Pointer(bp + 2))) {
+ i = i + 2
+ if int32(*(*uint8)(unsafe.Pointer(zText + uintptr(i-1)))) == '^' {
i++
}
- for (I64(i) < nText) && (int32(*(*uint8)(unsafe.Pointer(zText + uintptr(i)))) != ']') {
+ for I64(i) < nText && int32(*(*uint8)(unsafe.Pointer(zText + uintptr(i)))) != ']' {
i++
}
}
- iFirst = (i + 1)
+ iFirst = i + 1
}
i++
}
@@ -174840,11 +177178,11 @@ func sqlite3Fts5ExprPattern(tls *libc.TLS, pConfig uintptr, bGlob int32, iCol in
}
// Free the expression node object passed as the only argument.
-func sqlite3Fts5ParseNodeFree(tls *libc.TLS, p uintptr) { /* sqlite3.c:217801:13: */
+func sqlite3Fts5ParseNodeFree(tls *libc.TLS, p uintptr) { /* sqlite3.c:219620:13: */
if p != 0 {
var i int32
for i = 0; i < (*Fts5ExprNode)(unsafe.Pointer(p)).FnChild; i++ {
- sqlite3Fts5ParseNodeFree(tls, *(*uintptr)(unsafe.Pointer((p + 32 /* &.apChild */) + uintptr(i)*4)))
+ sqlite3Fts5ParseNodeFree(tls, *(*uintptr)(unsafe.Pointer(p + 32 + uintptr(i)*4)))
}
sqlite3Fts5ParseNearsetFree(tls, (*Fts5ExprNode)(unsafe.Pointer(p)).FpNear)
Xsqlite3_free(tls, p)
@@ -174852,7 +177190,7 @@ func sqlite3Fts5ParseNodeFree(tls *libc.TLS, p uintptr) { /* sqlite3.c:217801:13
}
// Free the expression object passed as the only argument.
-func sqlite3Fts5ExprFree(tls *libc.TLS, p uintptr) { /* sqlite3.c:217815:13: */
+func sqlite3Fts5ExprFree(tls *libc.TLS, p uintptr) { /* sqlite3.c:219634:13: */
if p != 0 {
sqlite3Fts5ParseNodeFree(tls, (*Fts5Expr)(unsafe.Pointer(p)).FpRoot)
Xsqlite3_free(tls, (*Fts5Expr)(unsafe.Pointer(p)).FapExprPhrase)
@@ -174860,7 +177198,7 @@ func sqlite3Fts5ExprFree(tls *libc.TLS, p uintptr) { /* sqlite3.c:217815:13: */
}
}
-func sqlite3Fts5ExprAnd(tls *libc.TLS, pp1 uintptr, p2 uintptr) int32 { /* sqlite3.c:217823:12: */
+func sqlite3Fts5ExprAnd(tls *libc.TLS, pp1 uintptr, p2 uintptr) int32 { /* sqlite3.c:219642:12: */
bp := tls.Alloc(28)
defer tls.Free(28)
@@ -174870,19 +177208,19 @@ func sqlite3Fts5ExprAnd(tls *libc.TLS, pp1 uintptr, p2 uintptr) int32 { /* sqlit
if *(*uintptr)(unsafe.Pointer(pp1)) != 0 {
var p1 uintptr = *(*uintptr)(unsafe.Pointer(pp1))
- var nPhrase int32 = ((*Fts5Expr)(unsafe.Pointer(p1)).FnPhrase + (*Fts5Expr)(unsafe.Pointer(p2)).FnPhrase)
+ var nPhrase int32 = (*Fts5Expr)(unsafe.Pointer(p1)).FnPhrase + (*Fts5Expr)(unsafe.Pointer(p2)).FnPhrase
(*Fts5Expr)(unsafe.Pointer(p1)).FpRoot = sqlite3Fts5ParseNode(tls, bp /* &sParse */, FTS5_AND, (*Fts5Expr)(unsafe.Pointer(p1)).FpRoot, (*Fts5Expr)(unsafe.Pointer(p2)).FpRoot, uintptr(0))
(*Fts5Expr)(unsafe.Pointer(p2)).FpRoot = uintptr(0)
- if (*Fts5Parse)(unsafe.Pointer(bp /* &sParse */)).Frc == SQLITE_OK {
+ if (*Fts5Parse)(unsafe.Pointer(bp)).Frc == SQLITE_OK {
var ap uintptr = Xsqlite3_realloc(tls,
- (*Fts5Expr)(unsafe.Pointer(p1)).FapExprPhrase, (int32(uint32(nPhrase) * uint32(unsafe.Sizeof(uintptr(0))))))
+ (*Fts5Expr)(unsafe.Pointer(p1)).FapExprPhrase, int32(uint32(nPhrase)*uint32(unsafe.Sizeof(uintptr(0)))))
if ap == uintptr(0) {
(*Fts5Parse)(unsafe.Pointer(bp /* &sParse */)).Frc = SQLITE_NOMEM
} else {
var i int32
- libc.Xmemmove(tls, (ap + uintptr((*Fts5Expr)(unsafe.Pointer(p2)).FnPhrase)*4), ap, (uint32((*Fts5Expr)(unsafe.Pointer(p1)).FnPhrase) * uint32(unsafe.Sizeof(uintptr(0)))))
+ libc.Xmemmove(tls, ap+uintptr((*Fts5Expr)(unsafe.Pointer(p2)).FnPhrase)*4, ap, uint32((*Fts5Expr)(unsafe.Pointer(p1)).FnPhrase)*uint32(unsafe.Sizeof(uintptr(0))))
for i = 0; i < (*Fts5Expr)(unsafe.Pointer(p2)).FnPhrase; i++ {
*(*uintptr)(unsafe.Pointer(ap + uintptr(i)*4)) = *(*uintptr)(unsafe.Pointer((*Fts5Expr)(unsafe.Pointer(p2)).FapExprPhrase + uintptr(i)*4))
}
@@ -174901,29 +177239,29 @@ func sqlite3Fts5ExprAnd(tls *libc.TLS, pp1 uintptr, p2 uintptr) int32 { /* sqlit
// Argument pTerm must be a synonym iterator. Return the current rowid
// that it points to.
-func fts5ExprSynonymRowid(tls *libc.TLS, pTerm uintptr, bDesc int32, pbEof uintptr) I64 { /* sqlite3.c:217863:12: */
+func fts5ExprSynonymRowid(tls *libc.TLS, pTerm uintptr, bDesc int32, pbEof uintptr) I64 { /* sqlite3.c:219682:12: */
var iRet I64 = int64(0)
var bRetValid int32 = 0
var p uintptr
for p = pTerm; p != 0; p = (*Fts5ExprTerm)(unsafe.Pointer(p)).FpSynonym {
- if 0 == (int32((*Fts5IndexIter)(unsafe.Pointer((*Fts5ExprTerm)(unsafe.Pointer(p)).FpIter)).FbEof)) {
+ if 0 == int32((*Fts5IndexIter)(unsafe.Pointer((*Fts5ExprTerm)(unsafe.Pointer(p)).FpIter)).FbEof) {
var iRowid I64 = (*Fts5IndexIter)(unsafe.Pointer((*Fts5ExprTerm)(unsafe.Pointer(p)).FpIter)).FiRowid
- if (bRetValid == 0) || (bDesc != (libc.Bool32(iRowid < iRet))) {
+ if bRetValid == 0 || bDesc != libc.Bool32(iRowid < iRet) {
iRet = iRowid
bRetValid = 1
}
}
}
- if (pbEof != 0) && (bRetValid == 0) {
+ if pbEof != 0 && bRetValid == 0 {
*(*int32)(unsafe.Pointer(pbEof)) = 1
}
return iRet
}
// Argument pTerm must be a synonym iterator.
-func fts5ExprSynonymList(tls *libc.TLS, pTerm uintptr, iRowid I64, pBuf uintptr, pa uintptr, pn uintptr) int32 { /* sqlite3.c:217887:12: */
+func fts5ExprSynonymList(tls *libc.TLS, pTerm uintptr, iRowid I64, pBuf uintptr, pa uintptr, pn uintptr) int32 { /* sqlite3.c:219707:12: */
bp := tls.Alloc(104)
defer tls.Free(104)
@@ -174953,7 +177291,7 @@ __1:
goto __3
}
pIter = (*Fts5ExprTerm)(unsafe.Pointer(p)).FpIter
- if !(((int32((*Fts5IndexIter)(unsafe.Pointer(pIter)).FbEof)) == 0) && ((*Fts5IndexIter)(unsafe.Pointer(pIter)).FiRowid == iRowid)) {
+ if !(int32((*Fts5IndexIter)(unsafe.Pointer(pIter)).FbEof) == 0 && (*Fts5IndexIter)(unsafe.Pointer(pIter)).FiRowid == iRowid) {
goto __4
}
if !((*Fts5IndexIter)(unsafe.Pointer(pIter)).FnData == 0) {
@@ -174965,7 +177303,7 @@ __5:
if !(nIter == nAlloc) {
goto __6
}
- nByte = (Sqlite3_int64((uint32(unsafe.Sizeof(Fts5PoslistReader{})) * uint32(nAlloc)) * uint32(2)))
+ nByte = Sqlite3_int64(uint32(unsafe.Sizeof(Fts5PoslistReader{})) * uint32(nAlloc) * uint32(2))
aNew = Xsqlite3_malloc64(tls, uint64(nByte))
if !(aNew == uintptr(0)) {
goto __7
@@ -174974,9 +177312,9 @@ __5:
goto synonym_poslist_out
__7:
;
- libc.Xmemcpy(tls, aNew, aIter, (uint32(unsafe.Sizeof(Fts5PoslistReader{})) * uint32(nIter)))
- nAlloc = (nAlloc * 2)
- if !(aIter != bp /* aStatic */) {
+ libc.Xmemcpy(tls, aNew, aIter, uint32(unsafe.Sizeof(Fts5PoslistReader{}))*uint32(nIter))
+ nAlloc = nAlloc * 2
+ if !(aIter != bp) {
goto __8
}
Xsqlite3_free(tls, aIter)
@@ -174985,7 +177323,7 @@ __8:
aIter = aNew
__6:
;
- sqlite3Fts5PoslistReaderInit(tls, (*Fts5IndexIter)(unsafe.Pointer(pIter)).FpData, (*Fts5IndexIter)(unsafe.Pointer(pIter)).FnData, (aIter + uintptr(nIter)*24))
+ sqlite3Fts5PoslistReaderInit(tls, (*Fts5IndexIter)(unsafe.Pointer(pIter)).FpData, (*Fts5IndexIter)(unsafe.Pointer(pIter)).FnData, aIter+uintptr(nIter)*24)
nIter++
__4:
@@ -175012,7 +177350,7 @@ __11:
if !(1 != 0) {
goto __12
}
- iMin = (int64(0xffffffff) | (I64((int64(0x7fffffff))) << 32))
+ iMin = int64(0xffffffff) | I64(int64(0x7fffffff))<<32
i = 0
__13:
if !(i < nIter) {
@@ -175024,7 +177362,7 @@ __13:
if !((*Fts5PoslistReader)(unsafe.Pointer(aIter+uintptr(i)*24)).FiPos == iPrev) {
goto __17
}
- if !(sqlite3Fts5PoslistReaderNext(tls, (aIter+uintptr(i)*24)) != 0) {
+ if !(sqlite3Fts5PoslistReaderNext(tls, aIter+uintptr(i)*24) != 0) {
goto __18
}
goto __14
@@ -175047,7 +177385,7 @@ __14:
goto __15
__15:
;
- if !((iMin == (int64(0xffffffff) | (I64((int64(0x7fffffff))) << 32))) || (rc != SQLITE_OK)) {
+ if !(iMin == int64(0xffffffff)|I64(int64(0x7fffffff))<<32 || rc != SQLITE_OK) {
goto __20
}
goto __12
@@ -175069,7 +177407,7 @@ __10:
;
synonym_poslist_out:
- if !(aIter != bp /* aStatic */) {
+ if !(aIter != bp) {
goto __22
}
Xsqlite3_free(tls, aIter)
@@ -175087,7 +177425,7 @@ __22:
// SQLITE_OK is returned if an error occurs, or an SQLite error code
// otherwise. It is not considered an error code if the current rowid is
// not a match.
-func fts5ExprPhraseIsMatch(tls *libc.TLS, pNode uintptr, pPhrase uintptr, pbMatch uintptr) int32 { /* sqlite3.c:217970:12: */
+func fts5ExprPhraseIsMatch(tls *libc.TLS, pNode uintptr, pPhrase uintptr, pbMatch uintptr) int32 { /* sqlite3.c:219790:12: */
bp := tls.Alloc(128)
defer tls.Free(128)
@@ -175115,18 +177453,18 @@ func fts5ExprPhraseIsMatch(tls *libc.TLS, pNode uintptr, pPhrase uintptr, pbMatc
*(*Fts5PoslistWriter)(unsafe.Pointer(bp + 120 /* writer */)) = Fts5PoslistWriter{}
aIter = bp /* aStatic */
rc = SQLITE_OK
- bFirst = int32((*Fts5ExprTerm)(unsafe.Pointer((pPhrase + 20 /* &.aTerm */))).FbFirst)
+ bFirst = int32((*Fts5ExprTerm)(unsafe.Pointer(pPhrase + 20 /* &.aTerm */)).FbFirst)
- sqlite3Fts5BufferZero(tls, (pPhrase + 4 /* &.poslist */))
+ sqlite3Fts5BufferZero(tls, pPhrase+4)
// If the aStatic[] array is not large enough, allocate a large array
// using sqlite3_malloc(). This approach could be improved upon.
- if !((*Fts5ExprPhrase)(unsafe.Pointer(pPhrase)).FnTerm > (int32(uint32(unsafe.Sizeof([4]Fts5PoslistReader{})) / uint32(unsafe.Sizeof(Fts5PoslistReader{}))))) {
+ if !((*Fts5ExprPhrase)(unsafe.Pointer(pPhrase)).FnTerm > int32(uint32(unsafe.Sizeof([4]Fts5PoslistReader{}))/uint32(unsafe.Sizeof(Fts5PoslistReader{})))) {
goto __1
}
- nByte = (Sqlite3_int64(uint32(unsafe.Sizeof(Fts5PoslistReader{})) * uint32((*Fts5ExprPhrase)(unsafe.Pointer(pPhrase)).FnTerm)))
+ nByte = Sqlite3_int64(uint32(unsafe.Sizeof(Fts5PoslistReader{})) * uint32((*Fts5ExprPhrase)(unsafe.Pointer(pPhrase)).FnTerm))
aIter = Xsqlite3_malloc64(tls, uint64(nByte))
- if !(!(aIter != 0)) {
+ if !!(aIter != 0) {
goto __2
}
return SQLITE_NOMEM
@@ -175134,7 +177472,7 @@ __2:
;
__1:
;
- libc.Xmemset(tls, aIter, 0, (uint32(unsafe.Sizeof(Fts5PoslistReader{})) * uint32((*Fts5ExprPhrase)(unsafe.Pointer(pPhrase)).FnTerm)))
+ libc.Xmemset(tls, aIter, 0, uint32(unsafe.Sizeof(Fts5PoslistReader{}))*uint32((*Fts5ExprPhrase)(unsafe.Pointer(pPhrase)).FnTerm))
// Initialize a term iterator for each term in the phrase
i = 0
@@ -175142,7 +177480,7 @@ __3:
if !(i < (*Fts5ExprPhrase)(unsafe.Pointer(pPhrase)).FnTerm) {
goto __5
}
- pTerm = ((pPhrase + 20 /* &.aTerm */) + uintptr(i)*16)
+ pTerm = pPhrase + 20 + uintptr(i)*16
*(*int32)(unsafe.Pointer(bp + 112 /* n */)) = 0
bFlag = 0
*(*uintptr)(unsafe.Pointer(bp + 108 /* a */)) = uintptr(0)
@@ -175158,7 +177496,7 @@ __3:
goto ismatch_out
__8:
;
- if !(*(*uintptr)(unsafe.Pointer(bp + 108 /* a */)) == (*Fts5Buffer)(unsafe.Pointer(bp+96 /* &buf */)).Fp) {
+ if !(*(*uintptr)(unsafe.Pointer(bp + 108)) == (*Fts5Buffer)(unsafe.Pointer(bp+96)).Fp) {
goto __9
}
bFlag = 1
@@ -175170,7 +177508,7 @@ __6:
*(*int32)(unsafe.Pointer(bp + 112 /* n */)) = (*Fts5IndexIter)(unsafe.Pointer((*Fts5ExprTerm)(unsafe.Pointer(pTerm)).FpIter)).FnData
__7:
;
- sqlite3Fts5PoslistReaderInit(tls, *(*uintptr)(unsafe.Pointer(bp + 108 /* a */)), *(*int32)(unsafe.Pointer(bp + 112 /* n */)), (aIter + uintptr(i)*24))
+ sqlite3Fts5PoslistReaderInit(tls, *(*uintptr)(unsafe.Pointer(bp + 108 /* a */)), *(*int32)(unsafe.Pointer(bp + 112 /* n */)), aIter+uintptr(i)*24)
(*Fts5PoslistReader)(unsafe.Pointer(aIter + uintptr(i)*24)).FbFlag = U8(bFlag)
if !((*Fts5PoslistReader)(unsafe.Pointer(aIter+uintptr(i)*24)).FbEof != 0) {
goto __10
@@ -175198,8 +177536,8 @@ __16:
if !(i < (*Fts5ExprPhrase)(unsafe.Pointer(pPhrase)).FnTerm) {
goto __18
}
- pPos = (aIter + uintptr(i)*24)
- iAdj = (iPos + I64(i))
+ pPos = aIter + uintptr(i)*24
+ iAdj = iPos + I64(i)
if !((*Fts5PoslistReader)(unsafe.Pointer(pPos)).FiPos != iAdj) {
goto __19
}
@@ -175220,7 +177558,7 @@ __21:
if !((*Fts5PoslistReader)(unsafe.Pointer(pPos)).FiPos > iAdj) {
goto __23
}
- iPos = ((*Fts5PoslistReader)(unsafe.Pointer(pPos)).FiPos - I64(i))
+ iPos = (*Fts5PoslistReader)(unsafe.Pointer(pPos)).FiPos - I64(i)
__23:
;
__19:
@@ -175242,10 +177580,10 @@ __15:
;
// Append position iPos to the output
- if !((bFirst == 0) || ((int32(iPos & int64(0x7FFFFFFF))) == 0)) {
+ if !(bFirst == 0 || int32(iPos&int64(0x7FFFFFFF)) == 0) {
goto __24
}
- rc = sqlite3Fts5PoslistWriterAppend(tls, (pPhrase + 4 /* &.poslist */), bp+120 /* &writer */, iPos)
+ rc = sqlite3Fts5PoslistWriterAppend(tls, pPhrase+4, bp+120 /* &writer */, iPos)
if !(rc != SQLITE_OK) {
goto __25
}
@@ -175260,7 +177598,7 @@ __26:
if !(i < (*Fts5ExprPhrase)(unsafe.Pointer(pPhrase)).FnTerm) {
goto __28
}
- if !(sqlite3Fts5PoslistReaderNext(tls, (aIter+uintptr(i)*24)) != 0) {
+ if !(sqlite3Fts5PoslistReaderNext(tls, aIter+uintptr(i)*24) != 0) {
goto __29
}
goto ismatch_out
@@ -175278,7 +177616,7 @@ __12:
;
ismatch_out:
- *(*int32)(unsafe.Pointer(pbMatch)) = (libc.Bool32((*Fts5ExprPhrase)(unsafe.Pointer(pPhrase)).Fposlist.Fn > 0))
+ *(*int32)(unsafe.Pointer(pbMatch)) = libc.Bool32((*Fts5ExprPhrase)(unsafe.Pointer(pPhrase)).Fposlist.Fn > 0)
i = 0
__30:
if !(i < (*Fts5ExprPhrase)(unsafe.Pointer(pPhrase)).FnTerm) {
@@ -175297,7 +177635,7 @@ __31:
goto __32
__32:
;
- if !(aIter != bp /* aStatic */) {
+ if !(aIter != bp) {
goto __34
}
Xsqlite3_free(tls, aIter)
@@ -175313,19 +177651,19 @@ type Fts5LookaheadReader1 = struct {
F__ccgo_pad1 [4]byte
FiPos I64
FiLookahead I64
-} /* sqlite3.c:218054:9 */
+} /* sqlite3.c:219874:9 */
-type Fts5LookaheadReader = Fts5LookaheadReader1 /* sqlite3.c:218054:36 */
+type Fts5LookaheadReader = Fts5LookaheadReader1 /* sqlite3.c:219874:36 */
-func fts5LookaheadReaderNext(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:218065:12: */
+func fts5LookaheadReaderNext(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:219885:12: */
(*Fts5LookaheadReader)(unsafe.Pointer(p)).FiPos = (*Fts5LookaheadReader)(unsafe.Pointer(p)).FiLookahead
- if sqlite3Fts5PoslistNext64(tls, (*Fts5LookaheadReader)(unsafe.Pointer(p)).Fa, (*Fts5LookaheadReader)(unsafe.Pointer(p)).Fn, (p+8 /* &.i */), (p+24 /* &.iLookahead */)) != 0 {
- (*Fts5LookaheadReader)(unsafe.Pointer(p)).FiLookahead = (I64((int64(1))) << 62)
+ if sqlite3Fts5PoslistNext64(tls, (*Fts5LookaheadReader)(unsafe.Pointer(p)).Fa, (*Fts5LookaheadReader)(unsafe.Pointer(p)).Fn, p+8, p+24) != 0 {
+ (*Fts5LookaheadReader)(unsafe.Pointer(p)).FiLookahead = I64(int64(1)) << 62
}
- return (libc.Bool32((*Fts5LookaheadReader)(unsafe.Pointer(p)).FiPos == (I64((int64(1))) << 62)))
+ return libc.Bool32((*Fts5LookaheadReader)(unsafe.Pointer(p)).FiPos == I64(int64(1))<<62)
}
-func fts5LookaheadReaderInit(tls *libc.TLS, a uintptr, n int32, p uintptr) int32 { /* sqlite3.c:218073:12: */
+func fts5LookaheadReaderInit(tls *libc.TLS, a uintptr, n int32, p uintptr) int32 { /* sqlite3.c:219893:12: */
libc.Xmemset(tls, p, 0, uint32(unsafe.Sizeof(Fts5LookaheadReader{})))
(*Fts5LookaheadReader)(unsafe.Pointer(p)).Fa = a
(*Fts5LookaheadReader)(unsafe.Pointer(p)).Fn = n
@@ -175338,9 +177676,9 @@ type Fts5NearTrimmer1 = struct {
Fwriter Fts5PoslistWriter
FpOut uintptr
F__ccgo_pad1 [4]byte
-} /* sqlite3.c:218084:9 */
+} /* sqlite3.c:219904:9 */
-type Fts5NearTrimmer = Fts5NearTrimmer1 /* sqlite3.c:218084:32 */
+type Fts5NearTrimmer = Fts5NearTrimmer1 /* sqlite3.c:219904:32 */
// The near-set object passed as the first argument contains more than
// one phrase. All phrases currently point to the same row. The
@@ -175357,7 +177695,7 @@ type Fts5NearTrimmer = Fts5NearTrimmer1 /* sqlite3.c:218084:32 */
// If no error occurs and non-zero (a match) is returned, the position-list
// of each phrase object is edited to contain only those entries that
// meet the constraint before returning.
-func fts5ExprNearIsMatch(tls *libc.TLS, pRc uintptr, pNear uintptr) int32 { /* sqlite3.c:218108:12: */
+func fts5ExprNearIsMatch(tls *libc.TLS, pRc uintptr, pNear uintptr) int32 { /* sqlite3.c:219928:12: */
bp := tls.Alloc(196)
defer tls.Free(196)
@@ -175384,17 +177722,17 @@ func fts5ExprNearIsMatch(tls *libc.TLS, pRc uintptr, pNear uintptr) int32 { /* s
// If the aStatic[] array is not large enough, allocate a large array
// using sqlite3_malloc(). This approach could be improved upon.
- if !((*Fts5ExprNearset)(unsafe.Pointer(pNear)).FnPhrase > (int32(uint32(unsafe.Sizeof([4]Fts5NearTrimmer{})) / uint32(unsafe.Sizeof(Fts5NearTrimmer{}))))) {
+ if !((*Fts5ExprNearset)(unsafe.Pointer(pNear)).FnPhrase > int32(uint32(unsafe.Sizeof([4]Fts5NearTrimmer{}))/uint32(unsafe.Sizeof(Fts5NearTrimmer{})))) {
goto __1
}
- nByte = (Sqlite3_int64(uint32(unsafe.Sizeof(Fts5NearTrimmer{})) * uint32((*Fts5ExprNearset)(unsafe.Pointer(pNear)).FnPhrase)))
+ nByte = Sqlite3_int64(uint32(unsafe.Sizeof(Fts5NearTrimmer{})) * uint32((*Fts5ExprNearset)(unsafe.Pointer(pNear)).FnPhrase))
a = sqlite3Fts5MallocZero(tls, bp+192 /* &rc */, nByte)
goto __2
__1:
libc.Xmemset(tls, bp /* &aStatic[0] */, 0, uint32(unsafe.Sizeof([4]Fts5NearTrimmer{})))
__2:
;
- if !(*(*int32)(unsafe.Pointer(bp + 192 /* rc */)) != SQLITE_OK) {
+ if !(*(*int32)(unsafe.Pointer(bp + 192)) != SQLITE_OK) {
goto __3
}
*(*int32)(unsafe.Pointer(pRc)) = *(*int32)(unsafe.Pointer(bp + 192 /* rc */))
@@ -175415,8 +177753,8 @@ __4:
if !(i < (*Fts5ExprNearset)(unsafe.Pointer(pNear)).FnPhrase) {
goto __6
}
- pPoslist = (*(*uintptr)(unsafe.Pointer(apPhrase + uintptr(i)*4)) + 4 /* &.poslist */)
- fts5LookaheadReaderInit(tls, (*Fts5Buffer)(unsafe.Pointer(pPoslist)).Fp, (*Fts5Buffer)(unsafe.Pointer(pPoslist)).Fn, (a + uintptr(i)*48 /* &.reader */))
+ pPoslist = *(*uintptr)(unsafe.Pointer(apPhrase + uintptr(i)*4)) + 4
+ fts5LookaheadReaderInit(tls, (*Fts5Buffer)(unsafe.Pointer(pPoslist)).Fp, (*Fts5Buffer)(unsafe.Pointer(pPoslist)).Fn, a+uintptr(i)*48)
(*Fts5Buffer)(unsafe.Pointer(pPoslist)).Fn = 0
(*Fts5NearTrimmer)(unsafe.Pointer(a + uintptr(i)*48)).FpOut = pPoslist
goto __5
@@ -175442,9 +177780,9 @@ __12:
if !(i < (*Fts5ExprNearset)(unsafe.Pointer(pNear)).FnPhrase) {
goto __14
}
- pPos = (a + uintptr(i)*48 /* &.reader */)
- iMin = ((iMax - I64((*Fts5ExprPhrase)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((pNear + 12 /* &.apPhrase */) + uintptr(i)*4)))).FnTerm)) - I64((*Fts5ExprNearset)(unsafe.Pointer(pNear)).FnNear))
- if !(((*Fts5LookaheadReader)(unsafe.Pointer(pPos)).FiPos < iMin) || ((*Fts5LookaheadReader)(unsafe.Pointer(pPos)).FiPos > iMax)) {
+ pPos = a + uintptr(i)*48
+ iMin = iMax - I64((*Fts5ExprPhrase)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pNear + 12 + uintptr(i)*4)))).FnTerm) - I64((*Fts5ExprNearset)(unsafe.Pointer(pNear)).FnNear)
+ if !((*Fts5LookaheadReader)(unsafe.Pointer(pPos)).FiPos < iMin || (*Fts5LookaheadReader)(unsafe.Pointer(pPos)).FiPos > iMax) {
goto __15
}
bMatch = 0
@@ -175492,8 +177830,8 @@ __20:
goto __22
}
iPos = (*Fts5NearTrimmer)(unsafe.Pointer(a + uintptr(i)*48)).Freader.FiPos
- pWriter = (a + uintptr(i)*48 + 32 /* &.writer */)
- if !(((*Fts5Buffer)(unsafe.Pointer((*Fts5NearTrimmer)(unsafe.Pointer(a+uintptr(i)*48)).FpOut)).Fn == 0) || (iPos != (*Fts5PoslistWriter)(unsafe.Pointer(pWriter)).FiPrev)) {
+ pWriter = a + uintptr(i)*48 + 32
+ if !((*Fts5Buffer)(unsafe.Pointer((*Fts5NearTrimmer)(unsafe.Pointer(a+uintptr(i)*48)).FpOut)).Fn == 0 || iPos != (*Fts5PoslistWriter)(unsafe.Pointer(pWriter)).FiPrev) {
goto __23
}
sqlite3Fts5PoslistWriterAppend(tls, (*Fts5NearTrimmer)(unsafe.Pointer(a+uintptr(i)*48)).FpOut, pWriter, iPos)
@@ -175528,7 +177866,7 @@ __25:
goto __26
__26:
;
- if !(fts5LookaheadReaderNext(tls, (a+uintptr(iAdv)*48 /* &.reader */)) != 0) {
+ if !(fts5LookaheadReaderNext(tls, a+uintptr(iAdv)*48) != 0) {
goto __28
}
goto ismatch_out
@@ -175539,9 +177877,9 @@ __8:
;
ismatch_out:
- bRet = (libc.Bool32((*Fts5Buffer)(unsafe.Pointer((*Fts5NearTrimmer)(unsafe.Pointer(a)).FpOut)).Fn > 0))
+ bRet = libc.Bool32((*Fts5Buffer)(unsafe.Pointer((*Fts5NearTrimmer)(unsafe.Pointer(a)).FpOut)).Fn > 0)
*(*int32)(unsafe.Pointer(pRc)) = *(*int32)(unsafe.Pointer(bp + 192 /* rc */))
- if !(a != bp /* aStatic */) {
+ if !(a != bp) {
goto __29
}
Xsqlite3_free(tls, a)
@@ -175559,14 +177897,14 @@ __29:
// If the iterator reaches EOF, set *pbEof to true before returning. If
// an error occurs, set *pRc to an error code. If either *pbEof or *pRc
// are set, return a non-zero value. Otherwise, return zero.
-func fts5ExprAdvanceto(tls *libc.TLS, pIter uintptr, bDesc int32, piLast uintptr, pRc uintptr, pbEof uintptr) int32 { /* sqlite3.c:218207:12: */
+func fts5ExprAdvanceto(tls *libc.TLS, pIter uintptr, bDesc int32, piLast uintptr, pRc uintptr, pbEof uintptr) int32 { /* sqlite3.c:220027:12: */
var iLast I64 = *(*I64)(unsafe.Pointer(piLast))
var iRowid I64
iRowid = (*Fts5IndexIter)(unsafe.Pointer(pIter)).FiRowid
- if ((bDesc == 0) && (iLast > iRowid)) || ((bDesc != 0) && (iLast < iRowid)) {
+ if bDesc == 0 && iLast > iRowid || bDesc != 0 && iLast < iRowid {
var rc int32 = sqlite3Fts5IterNextFrom(tls, pIter, iLast)
- if (rc != 0) || ((*Fts5IndexIter)(unsafe.Pointer(pIter)).FbEof != 0) {
+ if rc != 0 || (*Fts5IndexIter)(unsafe.Pointer(pIter)).FbEof != 0 {
*(*int32)(unsafe.Pointer(pRc)) = rc
*(*int32)(unsafe.Pointer(pbEof)) = 1
return 1
@@ -175579,7 +177917,7 @@ func fts5ExprAdvanceto(tls *libc.TLS, pIter uintptr, bDesc int32, piLast uintptr
return 0
}
-func fts5ExprSynonymAdvanceto(tls *libc.TLS, pTerm uintptr, bDesc int32, piLast uintptr, pRc uintptr) int32 { /* sqlite3.c:218233:12: */
+func fts5ExprSynonymAdvanceto(tls *libc.TLS, pTerm uintptr, bDesc int32, piLast uintptr, pRc uintptr) int32 { /* sqlite3.c:220053:12: */
bp := tls.Alloc(4)
defer tls.Free(4)
@@ -175588,10 +177926,10 @@ func fts5ExprSynonymAdvanceto(tls *libc.TLS, pTerm uintptr, bDesc int32, piLast
var p uintptr
*(*int32)(unsafe.Pointer(bp /* bEof */)) = 0
- for p = pTerm; (rc == SQLITE_OK) && (p != 0); p = (*Fts5ExprTerm)(unsafe.Pointer(p)).FpSynonym {
- if (int32((*Fts5IndexIter)(unsafe.Pointer((*Fts5ExprTerm)(unsafe.Pointer(p)).FpIter)).FbEof)) == 0 {
+ for p = pTerm; rc == SQLITE_OK && p != 0; p = (*Fts5ExprTerm)(unsafe.Pointer(p)).FpSynonym {
+ if int32((*Fts5IndexIter)(unsafe.Pointer((*Fts5ExprTerm)(unsafe.Pointer(p)).FpIter)).FbEof) == 0 {
var iRowid I64 = (*Fts5IndexIter)(unsafe.Pointer((*Fts5ExprTerm)(unsafe.Pointer(p)).FpIter)).FiRowid
- if ((bDesc == 0) && (iLast > iRowid)) || ((bDesc != 0) && (iLast < iRowid)) {
+ if bDesc == 0 && iLast > iRowid || bDesc != 0 && iLast < iRowid {
rc = sqlite3Fts5IterNextFrom(tls, (*Fts5ExprTerm)(unsafe.Pointer(p)).FpIter, iLast)
}
}
@@ -175606,7 +177944,7 @@ func fts5ExprSynonymAdvanceto(tls *libc.TLS, pTerm uintptr, bDesc int32, piLast
return *(*int32)(unsafe.Pointer(bp /* bEof */))
}
-func fts5ExprNearTest(tls *libc.TLS, pRc uintptr, pExpr uintptr, pNode uintptr) int32 { /* sqlite3.c:218263:12: */
+func fts5ExprNearTest(tls *libc.TLS, pRc uintptr, pExpr uintptr, pNode uintptr) int32 { /* sqlite3.c:220083:12: */
bp := tls.Alloc(8)
defer tls.Free(8)
@@ -175615,12 +177953,12 @@ func fts5ExprNearTest(tls *libc.TLS, pRc uintptr, pExpr uintptr, pNode uintptr)
if (*Fts5Config)(unsafe.Pointer((*Fts5Expr)(unsafe.Pointer(pExpr)).FpConfig)).FeDetail != FTS5_DETAIL_FULL {
var pTerm uintptr
- var pPhrase uintptr = *(*uintptr)(unsafe.Pointer((pNear + 12 /* &.apPhrase */)))
+ var pPhrase uintptr = *(*uintptr)(unsafe.Pointer(pNear + 12))
(*Fts5ExprPhrase)(unsafe.Pointer(pPhrase)).Fposlist.Fn = 0
- for pTerm = (pPhrase + 20 /* &.aTerm */); pTerm != 0; pTerm = (*Fts5ExprTerm)(unsafe.Pointer(pTerm)).FpSynonym {
+ for pTerm = pPhrase + 20; pTerm != 0; pTerm = (*Fts5ExprTerm)(unsafe.Pointer(pTerm)).FpSynonym {
var pIter uintptr = (*Fts5ExprTerm)(unsafe.Pointer(pTerm)).FpIter
- if (int32((*Fts5IndexIter)(unsafe.Pointer(pIter)).FbEof)) == 0 {
- if ((*Fts5IndexIter)(unsafe.Pointer(pIter)).FiRowid == (*Fts5ExprNode)(unsafe.Pointer(pNode)).FiRowid) && ((*Fts5IndexIter)(unsafe.Pointer(pIter)).FnData > 0) {
+ if int32((*Fts5IndexIter)(unsafe.Pointer(pIter)).FbEof) == 0 {
+ if (*Fts5IndexIter)(unsafe.Pointer(pIter)).FiRowid == (*Fts5ExprNode)(unsafe.Pointer(pNode)).FiRowid && (*Fts5IndexIter)(unsafe.Pointer(pIter)).FnData > 0 {
(*Fts5ExprPhrase)(unsafe.Pointer(pPhrase)).Fposlist.Fn = 1
}
}
@@ -175632,23 +177970,23 @@ func fts5ExprNearTest(tls *libc.TLS, pRc uintptr, pExpr uintptr, pNode uintptr)
// Check that each phrase in the nearset matches the current row.
// Populate the pPhrase->poslist buffers at the same time. If any
// phrase is not a match, break out of the loop early.
- for i = 0; (*(*int32)(unsafe.Pointer(bp + 4 /* rc */)) == SQLITE_OK) && (i < (*Fts5ExprNearset)(unsafe.Pointer(pNear)).FnPhrase); i++ {
- var pPhrase uintptr = *(*uintptr)(unsafe.Pointer((pNear + 12 /* &.apPhrase */) + uintptr(i)*4))
- if ((((*Fts5ExprPhrase)(unsafe.Pointer(pPhrase)).FnTerm > 1) || ((*Fts5ExprTerm)(unsafe.Pointer((pPhrase + 20 /* &.aTerm */))).FpSynonym != 0)) ||
- ((*Fts5ExprNearset)(unsafe.Pointer(pNear)).FpColset != 0)) || ((*Fts5ExprTerm)(unsafe.Pointer((pPhrase + 20 /* &.aTerm */))).FbFirst != 0) {
+ for i = 0; *(*int32)(unsafe.Pointer(bp + 4 /* rc */)) == SQLITE_OK && i < (*Fts5ExprNearset)(unsafe.Pointer(pNear)).FnPhrase; i++ {
+ var pPhrase uintptr = *(*uintptr)(unsafe.Pointer(pNear + 12 + uintptr(i)*4))
+ if (*Fts5ExprPhrase)(unsafe.Pointer(pPhrase)).FnTerm > 1 || (*Fts5ExprTerm)(unsafe.Pointer(pPhrase+20)).FpSynonym != 0 ||
+ (*Fts5ExprNearset)(unsafe.Pointer(pNear)).FpColset != 0 || (*Fts5ExprTerm)(unsafe.Pointer(pPhrase+20)).FbFirst != 0 {
*(*int32)(unsafe.Pointer(bp /* bMatch */)) = 0
*(*int32)(unsafe.Pointer(bp + 4 /* rc */)) = fts5ExprPhraseIsMatch(tls, pNode, pPhrase, bp /* &bMatch */)
- if *(*int32)(unsafe.Pointer(bp /* bMatch */)) == 0 {
+ if *(*int32)(unsafe.Pointer(bp)) == 0 {
break
}
} else {
- var pIter uintptr = (*Fts5ExprTerm)(unsafe.Pointer((pPhrase + 20 /* &.aTerm */))).FpIter
- sqlite3Fts5BufferSet(tls, bp+4 /* &rc */, (pPhrase + 4 /* &.poslist */), (*Fts5IndexIter)(unsafe.Pointer(pIter)).FnData, (*Fts5IndexIter)(unsafe.Pointer(pIter)).FpData)
+ var pIter uintptr = (*Fts5ExprTerm)(unsafe.Pointer(pPhrase + 20)).FpIter
+ sqlite3Fts5BufferSet(tls, bp+4 /* &rc */, pPhrase+4, (*Fts5IndexIter)(unsafe.Pointer(pIter)).FnData, (*Fts5IndexIter)(unsafe.Pointer(pIter)).FpData)
}
}
*(*int32)(unsafe.Pointer(pRc)) = *(*int32)(unsafe.Pointer(bp + 4 /* rc */))
- if (i == (*Fts5ExprNearset)(unsafe.Pointer(pNear)).FnPhrase) && ((i == 1) || (fts5ExprNearIsMatch(tls, pRc, pNear) != 0)) {
+ if i == (*Fts5ExprNearset)(unsafe.Pointer(pNear)).FnPhrase && (i == 1 || fts5ExprNearIsMatch(tls, pRc, pNear) != 0) {
return 1
}
return 0
@@ -175663,19 +178001,19 @@ func fts5ExprNearTest(tls *libc.TLS, pRc uintptr, pExpr uintptr, pNode uintptr)
// If an error occurs, return an SQLite error code. Otherwise, return
// SQLITE_OK. It is not considered an error if some term matches zero
// documents.
-func fts5ExprNearInitAll(tls *libc.TLS, pExpr uintptr, pNode uintptr) int32 { /* sqlite3.c:218322:12: */
+func fts5ExprNearInitAll(tls *libc.TLS, pExpr uintptr, pNode uintptr) int32 { /* sqlite3.c:220142:12: */
var pNear uintptr = (*Fts5ExprNode)(unsafe.Pointer(pNode)).FpNear
var i int32
for i = 0; i < (*Fts5ExprNearset)(unsafe.Pointer(pNear)).FnPhrase; i++ {
- var pPhrase uintptr = *(*uintptr)(unsafe.Pointer((pNear + 12 /* &.apPhrase */) + uintptr(i)*4))
+ var pPhrase uintptr = *(*uintptr)(unsafe.Pointer(pNear + 12 + uintptr(i)*4))
if (*Fts5ExprPhrase)(unsafe.Pointer(pPhrase)).FnTerm == 0 {
(*Fts5ExprNode)(unsafe.Pointer(pNode)).FbEof = 1
return SQLITE_OK
} else {
var j int32
for j = 0; j < (*Fts5ExprPhrase)(unsafe.Pointer(pPhrase)).FnTerm; j++ {
- var pTerm uintptr = ((pPhrase + 20 /* &.aTerm */) + uintptr(j)*16)
+ var pTerm uintptr = pPhrase + 20 + uintptr(j)*16
var p uintptr
var bHit int32 = 0
@@ -175687,24 +178025,24 @@ func fts5ExprNearInitAll(tls *libc.TLS, pExpr uintptr, pNode uintptr) int32 { /*
}
rc = sqlite3Fts5IndexQuery(tls,
(*Fts5Expr)(unsafe.Pointer(pExpr)).FpIndex, (*Fts5ExprTerm)(unsafe.Pointer(p)).FzTerm, int32(libc.Xstrlen(tls, (*Fts5ExprTerm)(unsafe.Pointer(p)).FzTerm)),
- ((func() int32 {
+ func() int32 {
if (*Fts5ExprTerm)(unsafe.Pointer(pTerm)).FbPrefix != 0 {
return FTS5INDEX_QUERY_PREFIX
}
return 0
- }()) | (func() int32 {
+ }()|func() int32 {
if (*Fts5Expr)(unsafe.Pointer(pExpr)).FbDesc != 0 {
return FTS5INDEX_QUERY_DESC
}
return 0
- }())),
+ }(),
(*Fts5ExprNearset)(unsafe.Pointer(pNear)).FpColset,
- (p + 8 /* &.pIter */))
+ p+8)
if rc != SQLITE_OK {
return rc
}
- if 0 == (int32((*Fts5IndexIter)(unsafe.Pointer((*Fts5ExprTerm)(unsafe.Pointer(p)).FpIter)).FbEof)) {
+ if 0 == int32((*Fts5IndexIter)(unsafe.Pointer((*Fts5ExprTerm)(unsafe.Pointer(p)).FpIter)).FbEof) {
bHit = 1
}
}
@@ -175729,43 +178067,43 @@ func fts5ExprNearInitAll(tls *libc.TLS, pExpr uintptr, pNode uintptr) int32 { /*
// Otherwise, if this is a DESC iterator, the opposite is returned:
//
// (iRhs - iLhs)
-func fts5RowidCmp(tls *libc.TLS, pExpr uintptr, iLhs I64, iRhs I64) int32 { /* sqlite3.c:218384:12: */
+func fts5RowidCmp(tls *libc.TLS, pExpr uintptr, iLhs I64, iRhs I64) int32 { /* sqlite3.c:220204:12: */
if (*Fts5Expr)(unsafe.Pointer(pExpr)).FbDesc == 0 {
if iLhs < iRhs {
return -1
}
- return (libc.Bool32(iLhs > iRhs))
+ return libc.Bool32(iLhs > iRhs)
} else {
if iLhs > iRhs {
return -1
}
- return (libc.Bool32(iLhs < iRhs))
+ return libc.Bool32(iLhs < iRhs)
}
return int32(0)
}
-func fts5ExprSetEof(tls *libc.TLS, pNode uintptr) { /* sqlite3.c:218399:13: */
+func fts5ExprSetEof(tls *libc.TLS, pNode uintptr) { /* sqlite3.c:220219:13: */
var i int32
(*Fts5ExprNode)(unsafe.Pointer(pNode)).FbEof = 1
(*Fts5ExprNode)(unsafe.Pointer(pNode)).FbNomatch = 0
for i = 0; i < (*Fts5ExprNode)(unsafe.Pointer(pNode)).FnChild; i++ {
- fts5ExprSetEof(tls, *(*uintptr)(unsafe.Pointer((pNode + 32 /* &.apChild */) + uintptr(i)*4)))
+ fts5ExprSetEof(tls, *(*uintptr)(unsafe.Pointer(pNode + 32 + uintptr(i)*4)))
}
}
-func fts5ExprNodeZeroPoslist(tls *libc.TLS, pNode uintptr) { /* sqlite3.c:218408:13: */
- if ((*Fts5ExprNode)(unsafe.Pointer(pNode)).FeType == FTS5_STRING) || ((*Fts5ExprNode)(unsafe.Pointer(pNode)).FeType == FTS5_TERM) {
+func fts5ExprNodeZeroPoslist(tls *libc.TLS, pNode uintptr) { /* sqlite3.c:220228:13: */
+ if (*Fts5ExprNode)(unsafe.Pointer(pNode)).FeType == FTS5_STRING || (*Fts5ExprNode)(unsafe.Pointer(pNode)).FeType == FTS5_TERM {
var pNear uintptr = (*Fts5ExprNode)(unsafe.Pointer(pNode)).FpNear
var i int32
for i = 0; i < (*Fts5ExprNearset)(unsafe.Pointer(pNear)).FnPhrase; i++ {
- var pPhrase uintptr = *(*uintptr)(unsafe.Pointer((pNear + 12 /* &.apPhrase */) + uintptr(i)*4))
+ var pPhrase uintptr = *(*uintptr)(unsafe.Pointer(pNear + 12 + uintptr(i)*4))
(*Fts5ExprPhrase)(unsafe.Pointer(pPhrase)).Fposlist.Fn = 0
}
} else {
var i int32
for i = 0; i < (*Fts5ExprNode)(unsafe.Pointer(pNode)).FnChild; i++ {
- fts5ExprNodeZeroPoslist(tls, *(*uintptr)(unsafe.Pointer((pNode + 32 /* &.apChild */) + uintptr(i)*4)))
+ fts5ExprNodeZeroPoslist(tls, *(*uintptr)(unsafe.Pointer(pNode + 32 + uintptr(i)*4)))
}
}
}
@@ -175780,7 +178118,7 @@ func fts5ExprNodeZeroPoslist(tls *libc.TLS, pNode uintptr) { /* sqlite3.c:218408
// This means that if the iteration order is ASC, then numerically larger
// rowids are considered larger. Or if it is the default DESC, numerically
// smaller rowids are larger.
-func fts5NodeCompare(tls *libc.TLS, pExpr uintptr, p1 uintptr, p2 uintptr) int32 { /* sqlite3.c:218438:12: */
+func fts5NodeCompare(tls *libc.TLS, pExpr uintptr, p1 uintptr, p2 uintptr) int32 { /* sqlite3.c:220258:12: */
if (*Fts5ExprNode)(unsafe.Pointer(p2)).FbEof != 0 {
return -1
}
@@ -175799,12 +178137,12 @@ func fts5NodeCompare(tls *libc.TLS, pExpr uintptr, p1 uintptr, p2 uintptr) int32
// SQLITE_OK is returned if an error occurs, or an SQLite error code
// otherwise. It is not considered an error code if an iterator reaches
// EOF.
-func fts5ExprNodeTest_STRING(tls *libc.TLS, pExpr uintptr, pNode uintptr) int32 { /* sqlite3.c:218459:12: */
+func fts5ExprNodeTest_STRING(tls *libc.TLS, pExpr uintptr, pNode uintptr) int32 { /* sqlite3.c:220279:12: */
bp := tls.Alloc(12)
defer tls.Free(12)
var pNear uintptr = (*Fts5ExprNode)(unsafe.Pointer(pNode)).FpNear
- var pLeft uintptr = *(*uintptr)(unsafe.Pointer((pNear + 12 /* &.apPhrase */)))
+ var pLeft uintptr = *(*uintptr)(unsafe.Pointer(pNear + 12))
*(*int32)(unsafe.Pointer(bp + 8 /* rc */)) = SQLITE_OK
// var iLast I64 at bp, 8
// Lastest rowid any iterator points to
@@ -175819,36 +178157,36 @@ func fts5ExprNodeTest_STRING(tls *libc.TLS, pExpr uintptr, pNode uintptr) int32
// iterator skips through rowids in the default ascending order, this means
// the maximum rowid. Or, if the iterator is "ORDER BY rowid DESC", then it
// means the minimum rowid.
- if (*Fts5ExprTerm)(unsafe.Pointer((pLeft + 20 /* &.aTerm */))).FpSynonym != 0 {
- *(*I64)(unsafe.Pointer(bp /* iLast */)) = fts5ExprSynonymRowid(tls, (pLeft + 20 /* &.aTerm */), bDesc, uintptr(0))
+ if (*Fts5ExprTerm)(unsafe.Pointer(pLeft+20)).FpSynonym != 0 {
+ *(*I64)(unsafe.Pointer(bp /* iLast */)) = fts5ExprSynonymRowid(tls, pLeft+20, bDesc, uintptr(0))
} else {
- *(*I64)(unsafe.Pointer(bp /* iLast */)) = (*Fts5IndexIter)(unsafe.Pointer((*Fts5ExprTerm)(unsafe.Pointer((pLeft + 20 /* &.aTerm */))).FpIter)).FiRowid
+ *(*I64)(unsafe.Pointer(bp /* iLast */)) = (*Fts5IndexIter)(unsafe.Pointer((*Fts5ExprTerm)(unsafe.Pointer(pLeft + 20)).FpIter)).FiRowid
}
- for ok := true; ok; ok = (bMatch == 0) {
+ for ok := true; ok; ok = bMatch == 0 {
bMatch = 1
for i = 0; i < (*Fts5ExprNearset)(unsafe.Pointer(pNear)).FnPhrase; i++ {
- var pPhrase uintptr = *(*uintptr)(unsafe.Pointer((pNear + 12 /* &.apPhrase */) + uintptr(i)*4))
+ var pPhrase uintptr = *(*uintptr)(unsafe.Pointer(pNear + 12 + uintptr(i)*4))
for j = 0; j < (*Fts5ExprPhrase)(unsafe.Pointer(pPhrase)).FnTerm; j++ {
- var pTerm uintptr = ((pPhrase + 20 /* &.aTerm */) + uintptr(j)*16)
+ var pTerm uintptr = pPhrase + 20 + uintptr(j)*16
if (*Fts5ExprTerm)(unsafe.Pointer(pTerm)).FpSynonym != 0 {
var iRowid I64 = fts5ExprSynonymRowid(tls, pTerm, bDesc, uintptr(0))
- if iRowid == *(*I64)(unsafe.Pointer(bp /* iLast */)) {
+ if iRowid == *(*I64)(unsafe.Pointer(bp)) {
continue
}
bMatch = 0
- if fts5ExprSynonymAdvanceto(tls, pTerm, bDesc, bp /* &iLast */, bp+8 /* &rc */) != 0 {
+ if fts5ExprSynonymAdvanceto(tls, pTerm, bDesc, bp, bp+8) != 0 {
(*Fts5ExprNode)(unsafe.Pointer(pNode)).FbNomatch = 0
(*Fts5ExprNode)(unsafe.Pointer(pNode)).FbEof = 1
return *(*int32)(unsafe.Pointer(bp + 8 /* rc */))
}
} else {
- var pIter uintptr = (*Fts5ExprTerm)(unsafe.Pointer((pPhrase + 20 /* &.aTerm */) + uintptr(j)*16)).FpIter
- if ((*Fts5IndexIter)(unsafe.Pointer(pIter)).FiRowid == *(*I64)(unsafe.Pointer(bp /* iLast */))) || ((*Fts5IndexIter)(unsafe.Pointer(pIter)).FbEof != 0) {
+ var pIter uintptr = (*Fts5ExprTerm)(unsafe.Pointer(pPhrase + 20 + uintptr(j)*16)).FpIter
+ if (*Fts5IndexIter)(unsafe.Pointer(pIter)).FiRowid == *(*I64)(unsafe.Pointer(bp)) || (*Fts5IndexIter)(unsafe.Pointer(pIter)).FbEof != 0 {
continue
}
bMatch = 0
- if fts5ExprAdvanceto(tls, pIter, bDesc, bp /* &iLast */, bp+8 /* &rc */, (pNode+4 /* &.bEof */)) != 0 {
+ if fts5ExprAdvanceto(tls, pIter, bDesc, bp, bp+8, pNode+4) != 0 {
return *(*int32)(unsafe.Pointer(bp + 8 /* rc */))
}
}
@@ -175857,7 +178195,7 @@ func fts5ExprNodeTest_STRING(tls *libc.TLS, pExpr uintptr, pNode uintptr) int32
}
(*Fts5ExprNode)(unsafe.Pointer(pNode)).FiRowid = *(*I64)(unsafe.Pointer(bp /* iLast */))
- (*Fts5ExprNode)(unsafe.Pointer(pNode)).FbNomatch = (libc.Bool32((0 == fts5ExprNearTest(tls, bp+8 /* &rc */, pExpr, pNode)) && (*(*int32)(unsafe.Pointer(bp + 8 /* rc */)) == SQLITE_OK)))
+ (*Fts5ExprNode)(unsafe.Pointer(pNode)).FbNomatch = libc.Bool32(0 == fts5ExprNearTest(tls, bp+8, pExpr, pNode) && *(*int32)(unsafe.Pointer(bp + 8)) == SQLITE_OK)
return *(*int32)(unsafe.Pointer(bp + 8 /* rc */))
}
@@ -175867,8 +178205,8 @@ func fts5ExprNodeTest_STRING(tls *libc.TLS, pExpr uintptr, pNode uintptr) int32
//
// Return SQLITE_OK if successful, or an SQLite error code if an error
// occurs.
-func fts5ExprNodeNext_STRING(tls *libc.TLS, pExpr uintptr, pNode uintptr, bFromValid int32, iFrom I64) int32 { /* sqlite3.c:218529:12: */
- var pTerm uintptr = (*(*uintptr)(unsafe.Pointer(((*Fts5ExprNode)(unsafe.Pointer(pNode)).FpNear + 12 /* &.apPhrase */))) + 20 /* &.aTerm */)
+func fts5ExprNodeNext_STRING(tls *libc.TLS, pExpr uintptr, pNode uintptr, bFromValid int32, iFrom I64) int32 { /* sqlite3.c:220349:12: */
+ var pTerm uintptr = *(*uintptr)(unsafe.Pointer((*Fts5ExprNode)(unsafe.Pointer(pNode)).FpNear + 12)) + 20
var rc int32 = SQLITE_OK
(*Fts5ExprNode)(unsafe.Pointer(pNode)).FbNomatch = 0
@@ -175882,10 +178220,10 @@ func fts5ExprNodeNext_STRING(tls *libc.TLS, pExpr uintptr, pNode uintptr, bFromV
// Advance each iterator that currently points to iRowid. Or, if iFrom
// is valid - each iterator that points to a rowid before iFrom.
for p = pTerm; p != 0; p = (*Fts5ExprTerm)(unsafe.Pointer(p)).FpSynonym {
- if (int32((*Fts5IndexIter)(unsafe.Pointer((*Fts5ExprTerm)(unsafe.Pointer(p)).FpIter)).FbEof)) == 0 {
+ if int32((*Fts5IndexIter)(unsafe.Pointer((*Fts5ExprTerm)(unsafe.Pointer(p)).FpIter)).FbEof) == 0 {
var ii I64 = (*Fts5IndexIter)(unsafe.Pointer((*Fts5ExprTerm)(unsafe.Pointer(p)).FpIter)).FiRowid
- if (ii == iRowid) ||
- (((bFromValid != 0) && (ii != iFrom)) && ((libc.Bool32(ii > iFrom)) == (*Fts5Expr)(unsafe.Pointer(pExpr)).FbDesc)) {
+ if ii == iRowid ||
+ bFromValid != 0 && ii != iFrom && libc.Bool32(ii > iFrom) == (*Fts5Expr)(unsafe.Pointer(pExpr)).FbDesc {
if bFromValid != 0 {
rc = sqlite3Fts5IterNextFrom(tls, (*Fts5ExprTerm)(unsafe.Pointer(p)).FpIter, iFrom)
} else {
@@ -175894,7 +178232,7 @@ func fts5ExprNodeNext_STRING(tls *libc.TLS, pExpr uintptr, pNode uintptr, bFromV
if rc != SQLITE_OK {
break
}
- if (int32((*Fts5IndexIter)(unsafe.Pointer((*Fts5ExprTerm)(unsafe.Pointer(p)).FpIter)).FbEof)) == 0 {
+ if int32((*Fts5IndexIter)(unsafe.Pointer((*Fts5ExprTerm)(unsafe.Pointer(p)).FpIter)).FbEof) == 0 {
bEof = 0
}
} else {
@@ -175905,7 +178243,7 @@ func fts5ExprNodeNext_STRING(tls *libc.TLS, pExpr uintptr, pNode uintptr, bFromV
// Set the EOF flag if either all synonym iterators are at EOF or an
// error has occurred.
- (*Fts5ExprNode)(unsafe.Pointer(pNode)).FbEof = (libc.Bool32((rc != 0) || (bEof != 0)))
+ (*Fts5ExprNode)(unsafe.Pointer(pNode)).FbEof = libc.Bool32(rc != 0 || bEof != 0)
} else {
var pIter uintptr = (*Fts5ExprTerm)(unsafe.Pointer(pTerm)).FpIter
@@ -175915,7 +178253,7 @@ func fts5ExprNodeNext_STRING(tls *libc.TLS, pExpr uintptr, pNode uintptr, bFromV
rc = sqlite3Fts5IterNext(tls, pIter)
}
- (*Fts5ExprNode)(unsafe.Pointer(pNode)).FbEof = (libc.Bool32((rc != 0) || ((*Fts5IndexIter)(unsafe.Pointer(pIter)).FbEof != 0)))
+ (*Fts5ExprNode)(unsafe.Pointer(pNode)).FbEof = libc.Bool32(rc != 0 || (*Fts5IndexIter)(unsafe.Pointer(pIter)).FbEof != 0)
}
if (*Fts5ExprNode)(unsafe.Pointer(pNode)).FbEof == 0 {
@@ -175926,35 +178264,35 @@ func fts5ExprNodeNext_STRING(tls *libc.TLS, pExpr uintptr, pNode uintptr, bFromV
return rc
}
-func fts5ExprNodeTest_TERM(tls *libc.TLS, pExpr uintptr, pNode uintptr) int32 { /* sqlite3.c:218594:12: */
+func fts5ExprNodeTest_TERM(tls *libc.TLS, pExpr uintptr, pNode uintptr) int32 { /* sqlite3.c:220414:12: */
// As this "NEAR" object is actually a single phrase that consists
// of a single term only, grab pointers into the poslist managed by the
// fts5_index.c iterator object. This is much faster than synthesizing
// a new poslist the way we have to for more complicated phrase or NEAR
// expressions.
- var pPhrase uintptr = *(*uintptr)(unsafe.Pointer(((*Fts5ExprNode)(unsafe.Pointer(pNode)).FpNear + 12 /* &.apPhrase */)))
- var pIter uintptr = (*Fts5ExprTerm)(unsafe.Pointer((pPhrase + 20 /* &.aTerm */))).FpIter
+ var pPhrase uintptr = *(*uintptr)(unsafe.Pointer((*Fts5ExprNode)(unsafe.Pointer(pNode)).FpNear + 12))
+ var pIter uintptr = (*Fts5ExprTerm)(unsafe.Pointer(pPhrase + 20)).FpIter
(*Fts5ExprPhrase)(unsafe.Pointer(pPhrase)).Fposlist.Fn = (*Fts5IndexIter)(unsafe.Pointer(pIter)).FnData
if (*Fts5Config)(unsafe.Pointer((*Fts5Expr)(unsafe.Pointer(pExpr)).FpConfig)).FeDetail == FTS5_DETAIL_FULL {
(*Fts5ExprPhrase)(unsafe.Pointer(pPhrase)).Fposlist.Fp = (*Fts5IndexIter)(unsafe.Pointer(pIter)).FpData
}
(*Fts5ExprNode)(unsafe.Pointer(pNode)).FiRowid = (*Fts5IndexIter)(unsafe.Pointer(pIter)).FiRowid
- (*Fts5ExprNode)(unsafe.Pointer(pNode)).FbNomatch = (libc.Bool32((*Fts5ExprPhrase)(unsafe.Pointer(pPhrase)).Fposlist.Fn == 0))
+ (*Fts5ExprNode)(unsafe.Pointer(pNode)).FbNomatch = libc.Bool32((*Fts5ExprPhrase)(unsafe.Pointer(pPhrase)).Fposlist.Fn == 0)
return SQLITE_OK
}
// xNext() method for a node of type FTS5_TERM.
-func fts5ExprNodeNext_TERM(tls *libc.TLS, pExpr uintptr, pNode uintptr, bFromValid int32, iFrom I64) int32 { /* sqlite3.c:218622:12: */
+func fts5ExprNodeNext_TERM(tls *libc.TLS, pExpr uintptr, pNode uintptr, bFromValid int32, iFrom I64) int32 { /* sqlite3.c:220442:12: */
var rc int32
- var pIter uintptr = (*Fts5ExprTerm)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(((*Fts5ExprNode)(unsafe.Pointer(pNode)).FpNear + 12 /* &.apPhrase */))) + 20 /* &.aTerm */))).FpIter
+ var pIter uintptr = (*Fts5ExprTerm)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((*Fts5ExprNode)(unsafe.Pointer(pNode)).FpNear + 12)) + 20)).FpIter
if bFromValid != 0 {
rc = sqlite3Fts5IterNextFrom(tls, pIter, iFrom)
} else {
rc = sqlite3Fts5IterNext(tls, pIter)
}
- if (rc == SQLITE_OK) && ((int32((*Fts5IndexIter)(unsafe.Pointer(pIter)).FbEof)) == 0) {
+ if rc == SQLITE_OK && int32((*Fts5IndexIter)(unsafe.Pointer(pIter)).FbEof) == 0 {
rc = fts5ExprNodeTest_TERM(tls, pExpr, pNode)
} else {
(*Fts5ExprNode)(unsafe.Pointer(pNode)).FbEof = 1
@@ -175963,14 +178301,14 @@ func fts5ExprNodeNext_TERM(tls *libc.TLS, pExpr uintptr, pNode uintptr, bFromVal
return rc
}
-func fts5ExprNodeTest_OR(tls *libc.TLS, pExpr uintptr, pNode uintptr) { /* sqlite3.c:218646:13: */
- var pNext uintptr = *(*uintptr)(unsafe.Pointer((pNode + 32 /* &.apChild */)))
+func fts5ExprNodeTest_OR(tls *libc.TLS, pExpr uintptr, pNode uintptr) { /* sqlite3.c:220466:13: */
+ var pNext uintptr = *(*uintptr)(unsafe.Pointer(pNode + 32))
var i int32
for i = 1; i < (*Fts5ExprNode)(unsafe.Pointer(pNode)).FnChild; i++ {
- var pChild uintptr = *(*uintptr)(unsafe.Pointer((pNode + 32 /* &.apChild */) + uintptr(i)*4))
+ var pChild uintptr = *(*uintptr)(unsafe.Pointer(pNode + 32 + uintptr(i)*4))
var cmp int32 = fts5NodeCompare(tls, pExpr, pNext, pChild)
- if (cmp > 0) || ((cmp == 0) && ((*Fts5ExprNode)(unsafe.Pointer(pChild)).FbNomatch == 0)) {
+ if cmp > 0 || cmp == 0 && (*Fts5ExprNode)(unsafe.Pointer(pChild)).FbNomatch == 0 {
pNext = pChild
}
}
@@ -175979,19 +178317,19 @@ func fts5ExprNodeTest_OR(tls *libc.TLS, pExpr uintptr, pNode uintptr) { /* sqlit
(*Fts5ExprNode)(unsafe.Pointer(pNode)).FbNomatch = (*Fts5ExprNode)(unsafe.Pointer(pNext)).FbNomatch
}
-func fts5ExprNodeNext_OR(tls *libc.TLS, pExpr uintptr, pNode uintptr, bFromValid int32, iFrom I64) int32 { /* sqlite3.c:218665:12: */
+func fts5ExprNodeNext_OR(tls *libc.TLS, pExpr uintptr, pNode uintptr, bFromValid int32, iFrom I64) int32 { /* sqlite3.c:220485:12: */
var i int32
var iLast I64 = (*Fts5ExprNode)(unsafe.Pointer(pNode)).FiRowid
for i = 0; i < (*Fts5ExprNode)(unsafe.Pointer(pNode)).FnChild; i++ {
- var p1 uintptr = *(*uintptr)(unsafe.Pointer((pNode + 32 /* &.apChild */) + uintptr(i)*4))
+ var p1 uintptr = *(*uintptr)(unsafe.Pointer(pNode + 32 + uintptr(i)*4))
if (*Fts5ExprNode)(unsafe.Pointer(p1)).FbEof == 0 {
- if ((*Fts5ExprNode)(unsafe.Pointer(p1)).FiRowid == iLast) ||
- ((bFromValid != 0) && (fts5RowidCmp(tls, pExpr, (*Fts5ExprNode)(unsafe.Pointer(p1)).FiRowid, iFrom) < 0)) {
+ if (*Fts5ExprNode)(unsafe.Pointer(p1)).FiRowid == iLast ||
+ bFromValid != 0 && fts5RowidCmp(tls, pExpr, (*Fts5ExprNode)(unsafe.Pointer(p1)).FiRowid, iFrom) < 0 {
var rc int32 = (*struct {
f func(*libc.TLS, uintptr, uintptr, int32, I64) int32
- })(unsafe.Pointer(&struct{ uintptr }{(*Fts5ExprNode)(unsafe.Pointer((p1))).FxNext})).f(tls, pExpr, p1, bFromValid, iFrom)
+ })(unsafe.Pointer(&struct{ uintptr }{(*Fts5ExprNode)(unsafe.Pointer(p1)).FxNext})).f(tls, pExpr, p1, bFromValid, iFrom)
if rc != SQLITE_OK {
(*Fts5ExprNode)(unsafe.Pointer(pNode)).FbNomatch = 0
return rc
@@ -176005,23 +178343,23 @@ func fts5ExprNodeNext_OR(tls *libc.TLS, pExpr uintptr, pNode uintptr, bFromValid
}
// Argument pNode is an FTS5_AND node.
-func fts5ExprNodeTest_AND(tls *libc.TLS, pExpr uintptr, pAnd uintptr) int32 { /* sqlite3.c:218697:12: */
+func fts5ExprNodeTest_AND(tls *libc.TLS, pExpr uintptr, pAnd uintptr) int32 { /* sqlite3.c:220517:12: */
var iChild int32
var iLast I64 = (*Fts5ExprNode)(unsafe.Pointer(pAnd)).FiRowid
var rc int32 = SQLITE_OK
var bMatch int32
- for ok := true; ok; ok = (bMatch == 0) {
+ for ok := true; ok; ok = bMatch == 0 {
(*Fts5ExprNode)(unsafe.Pointer(pAnd)).FbNomatch = 0
bMatch = 1
for iChild = 0; iChild < (*Fts5ExprNode)(unsafe.Pointer(pAnd)).FnChild; iChild++ {
- var pChild uintptr = *(*uintptr)(unsafe.Pointer((pAnd + 32 /* &.apChild */) + uintptr(iChild)*4))
+ var pChild uintptr = *(*uintptr)(unsafe.Pointer(pAnd + 32 + uintptr(iChild)*4))
var cmp int32 = fts5RowidCmp(tls, pExpr, iLast, (*Fts5ExprNode)(unsafe.Pointer(pChild)).FiRowid)
if cmp > 0 {
// Advance pChild until it points to iLast or laster
rc = (*struct {
f func(*libc.TLS, uintptr, uintptr, int32, I64) int32
- })(unsafe.Pointer(&struct{ uintptr }{(*Fts5ExprNode)(unsafe.Pointer((pChild))).FxNext})).f(tls, pExpr, pChild, 1, iLast)
+ })(unsafe.Pointer(&struct{ uintptr }{(*Fts5ExprNode)(unsafe.Pointer(pChild)).FxNext})).f(tls, pExpr, pChild, 1, iLast)
if rc != SQLITE_OK {
(*Fts5ExprNode)(unsafe.Pointer(pAnd)).FbNomatch = 0
return rc
@@ -176048,17 +178386,17 @@ func fts5ExprNodeTest_AND(tls *libc.TLS, pExpr uintptr, pAnd uintptr) int32 { /*
}
}
- if ((*Fts5ExprNode)(unsafe.Pointer(pAnd)).FbNomatch != 0) && (pAnd != (*Fts5Expr)(unsafe.Pointer(pExpr)).FpRoot) {
+ if (*Fts5ExprNode)(unsafe.Pointer(pAnd)).FbNomatch != 0 && pAnd != (*Fts5Expr)(unsafe.Pointer(pExpr)).FpRoot {
fts5ExprNodeZeroPoslist(tls, pAnd)
}
(*Fts5ExprNode)(unsafe.Pointer(pAnd)).FiRowid = iLast
return SQLITE_OK
}
-func fts5ExprNodeNext_AND(tls *libc.TLS, pExpr uintptr, pNode uintptr, bFromValid int32, iFrom I64) int32 { /* sqlite3.c:218749:12: */
+func fts5ExprNodeNext_AND(tls *libc.TLS, pExpr uintptr, pNode uintptr, bFromValid int32, iFrom I64) int32 { /* sqlite3.c:220569:12: */
var rc int32 = (*struct {
f func(*libc.TLS, uintptr, uintptr, int32, I64) int32
- })(unsafe.Pointer(&struct{ uintptr }{(*Fts5ExprNode)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer((pNode + 32 /* &.apChild */)))))).FxNext})).f(tls, pExpr, *(*uintptr)(unsafe.Pointer((pNode + 32 /* &.apChild */))), bFromValid, iFrom)
+ })(unsafe.Pointer(&struct{ uintptr }{(*Fts5ExprNode)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pNode + 32 /* &.apChild */)))).FxNext})).f(tls, pExpr, *(*uintptr)(unsafe.Pointer(pNode + 32 /* &.apChild */)), bFromValid, iFrom)
if rc == SQLITE_OK {
rc = fts5ExprNodeTest_AND(tls, pExpr, pNode)
} else {
@@ -176067,26 +178405,26 @@ func fts5ExprNodeNext_AND(tls *libc.TLS, pExpr uintptr, pNode uintptr, bFromVali
return rc
}
-func fts5ExprNodeTest_NOT(tls *libc.TLS, pExpr uintptr, pNode uintptr) int32 { /* sqlite3.c:218764:12: */
+func fts5ExprNodeTest_NOT(tls *libc.TLS, pExpr uintptr, pNode uintptr) int32 { /* sqlite3.c:220584:12: */
var rc int32 = SQLITE_OK
- var p1 uintptr = *(*uintptr)(unsafe.Pointer((pNode + 32 /* &.apChild */)))
- var p2 uintptr = *(*uintptr)(unsafe.Pointer((pNode + 32 /* &.apChild */) + 1*4))
+ var p1 uintptr = *(*uintptr)(unsafe.Pointer(pNode + 32))
+ var p2 uintptr = *(*uintptr)(unsafe.Pointer(pNode + 32 + 1*4))
- for (rc == SQLITE_OK) && ((*Fts5ExprNode)(unsafe.Pointer(p1)).FbEof == 0) {
+ for rc == SQLITE_OK && (*Fts5ExprNode)(unsafe.Pointer(p1)).FbEof == 0 {
var cmp int32 = fts5NodeCompare(tls, pExpr, p1, p2)
if cmp > 0 {
rc = (*struct {
f func(*libc.TLS, uintptr, uintptr, int32, I64) int32
- })(unsafe.Pointer(&struct{ uintptr }{(*Fts5ExprNode)(unsafe.Pointer((p2))).FxNext})).f(tls, pExpr, p2, 1, (*Fts5ExprNode)(unsafe.Pointer(p1)).FiRowid)
+ })(unsafe.Pointer(&struct{ uintptr }{(*Fts5ExprNode)(unsafe.Pointer(p2)).FxNext})).f(tls, pExpr, p2, 1, (*Fts5ExprNode)(unsafe.Pointer(p1)).FiRowid)
cmp = fts5NodeCompare(tls, pExpr, p1, p2)
}
- if (cmp != 0) || ((*Fts5ExprNode)(unsafe.Pointer(p2)).FbNomatch != 0) {
+ if cmp != 0 || (*Fts5ExprNode)(unsafe.Pointer(p2)).FbNomatch != 0 {
break
}
rc = (*struct {
f func(*libc.TLS, uintptr, uintptr, int32, I64) int32
- })(unsafe.Pointer(&struct{ uintptr }{(*Fts5ExprNode)(unsafe.Pointer((p1))).FxNext})).f(tls, pExpr, p1, 0, int64(0))
+ })(unsafe.Pointer(&struct{ uintptr }{(*Fts5ExprNode)(unsafe.Pointer(p1)).FxNext})).f(tls, pExpr, p1, 0, int64(0))
}
(*Fts5ExprNode)(unsafe.Pointer(pNode)).FbEof = (*Fts5ExprNode)(unsafe.Pointer(p1)).FbEof
(*Fts5ExprNode)(unsafe.Pointer(pNode)).FbNomatch = (*Fts5ExprNode)(unsafe.Pointer(p1)).FbNomatch
@@ -176097,10 +178435,10 @@ func fts5ExprNodeTest_NOT(tls *libc.TLS, pExpr uintptr, pNode uintptr) int32 { /
return rc
}
-func fts5ExprNodeNext_NOT(tls *libc.TLS, pExpr uintptr, pNode uintptr, bFromValid int32, iFrom I64) int32 { /* sqlite3.c:218792:12: */
+func fts5ExprNodeNext_NOT(tls *libc.TLS, pExpr uintptr, pNode uintptr, bFromValid int32, iFrom I64) int32 { /* sqlite3.c:220612:12: */
var rc int32 = (*struct {
f func(*libc.TLS, uintptr, uintptr, int32, I64) int32
- })(unsafe.Pointer(&struct{ uintptr }{(*Fts5ExprNode)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer((pNode + 32 /* &.apChild */)))))).FxNext})).f(tls, pExpr, *(*uintptr)(unsafe.Pointer((pNode + 32 /* &.apChild */))), bFromValid, iFrom)
+ })(unsafe.Pointer(&struct{ uintptr }{(*Fts5ExprNode)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pNode + 32 /* &.apChild */)))).FxNext})).f(tls, pExpr, *(*uintptr)(unsafe.Pointer(pNode + 32 /* &.apChild */)), bFromValid, iFrom)
if rc == SQLITE_OK {
rc = fts5ExprNodeTest_NOT(tls, pExpr, pNode)
}
@@ -176113,7 +178451,7 @@ func fts5ExprNodeNext_NOT(tls *libc.TLS, pExpr uintptr, pNode uintptr, bFromVali
// If pNode currently points to a match, this function returns SQLITE_OK
// without modifying it. Otherwise, pNode is advanced until it does point
// to a match or EOF is reached.
-func fts5ExprNodeTest(tls *libc.TLS, pExpr uintptr, pNode uintptr) int32 { /* sqlite3.c:218813:12: */
+func fts5ExprNodeTest(tls *libc.TLS, pExpr uintptr, pNode uintptr) int32 { /* sqlite3.c:220633:12: */
var rc int32 = SQLITE_OK
if (*Fts5ExprNode)(unsafe.Pointer(pNode)).FbEof == 0 {
switch (*Fts5ExprNode)(unsafe.Pointer(pNode)).FeType {
@@ -176166,12 +178504,12 @@ func fts5ExprNodeTest(tls *libc.TLS, pExpr uintptr, pNode uintptr) int32 { /* sq
//
// Return an SQLite error code if an error occurs, or SQLITE_OK otherwise.
// It is not an error if there are no matches.
-func fts5ExprNodeFirst(tls *libc.TLS, pExpr uintptr, pNode uintptr) int32 { /* sqlite3.c:218858:12: */
+func fts5ExprNodeFirst(tls *libc.TLS, pExpr uintptr, pNode uintptr) int32 { /* sqlite3.c:220678:12: */
var rc int32 = SQLITE_OK
(*Fts5ExprNode)(unsafe.Pointer(pNode)).FbEof = 0
(*Fts5ExprNode)(unsafe.Pointer(pNode)).FbNomatch = 0
- if ((*Fts5ExprNode)(unsafe.Pointer((pNode))).FeType == FTS5_TERM) || ((*Fts5ExprNode)(unsafe.Pointer((pNode))).FeType == FTS5_STRING) {
+ if (*Fts5ExprNode)(unsafe.Pointer(pNode)).FeType == FTS5_TERM || (*Fts5ExprNode)(unsafe.Pointer(pNode)).FeType == FTS5_STRING {
// Initialize all term iterators in the NEAR object.
rc = fts5ExprNearInitAll(tls, pExpr, pNode)
} else if (*Fts5ExprNode)(unsafe.Pointer(pNode)).FxNext == uintptr(0) {
@@ -176179,13 +178517,13 @@ func fts5ExprNodeFirst(tls *libc.TLS, pExpr uintptr, pNode uintptr) int32 { /* s
} else {
var i int32
var nEof int32 = 0
- for i = 0; (i < (*Fts5ExprNode)(unsafe.Pointer(pNode)).FnChild) && (rc == SQLITE_OK); i++ {
- var pChild uintptr = *(*uintptr)(unsafe.Pointer((pNode + 32 /* &.apChild */) + uintptr(i)*4))
- rc = fts5ExprNodeFirst(tls, pExpr, *(*uintptr)(unsafe.Pointer((pNode + 32 /* &.apChild */) + uintptr(i)*4)))
+ for i = 0; i < (*Fts5ExprNode)(unsafe.Pointer(pNode)).FnChild && rc == SQLITE_OK; i++ {
+ var pChild uintptr = *(*uintptr)(unsafe.Pointer(pNode + 32 + uintptr(i)*4))
+ rc = fts5ExprNodeFirst(tls, pExpr, *(*uintptr)(unsafe.Pointer(pNode + 32 + uintptr(i)*4)))
- nEof = nEof + ((*Fts5ExprNode)(unsafe.Pointer(pChild)).FbEof)
+ nEof = nEof + (*Fts5ExprNode)(unsafe.Pointer(pChild)).FbEof
}
- (*Fts5ExprNode)(unsafe.Pointer(pNode)).FiRowid = (*Fts5ExprNode)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((pNode + 32 /* &.apChild */))))).FiRowid
+ (*Fts5ExprNode)(unsafe.Pointer(pNode)).FiRowid = (*Fts5ExprNode)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pNode + 32)))).FiRowid
switch (*Fts5ExprNode)(unsafe.Pointer(pNode)).FeType {
case FTS5_AND:
@@ -176204,7 +178542,7 @@ func fts5ExprNodeFirst(tls *libc.TLS, pExpr uintptr, pNode uintptr) int32 { /* s
default:
- (*Fts5ExprNode)(unsafe.Pointer(pNode)).FbEof = (*Fts5ExprNode)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((pNode + 32 /* &.apChild */))))).FbEof
+ (*Fts5ExprNode)(unsafe.Pointer(pNode)).FbEof = (*Fts5ExprNode)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pNode + 32)))).FbEof
break
}
}
@@ -176228,7 +178566,7 @@ func fts5ExprNodeFirst(tls *libc.TLS, pExpr uintptr, pNode uintptr) int32 { /* s
//
// Return SQLITE_OK if successful, or an SQLite error code otherwise. It
// is not considered an error if the query does not match any documents.
-func sqlite3Fts5ExprFirst(tls *libc.TLS, p uintptr, pIdx uintptr, iFirst I64, bDesc int32) int32 { /* sqlite3.c:218917:12: */
+func sqlite3Fts5ExprFirst(tls *libc.TLS, p uintptr, pIdx uintptr, iFirst I64, bDesc int32) int32 { /* sqlite3.c:220737:12: */
var pRoot uintptr = (*Fts5Expr)(unsafe.Pointer(p)).FpRoot
var rc int32 // Return code
@@ -176238,20 +178576,20 @@ func sqlite3Fts5ExprFirst(tls *libc.TLS, p uintptr, pIdx uintptr, iFirst I64, bD
// If not at EOF but the current rowid occurs earlier than iFirst in
// the iteration order, move to document iFirst or later.
- if ((rc == SQLITE_OK) &&
- (0 == (*Fts5ExprNode)(unsafe.Pointer(pRoot)).FbEof)) &&
- (fts5RowidCmp(tls, p, (*Fts5ExprNode)(unsafe.Pointer(pRoot)).FiRowid, iFirst) < 0) {
+ if rc == SQLITE_OK &&
+ 0 == (*Fts5ExprNode)(unsafe.Pointer(pRoot)).FbEof &&
+ fts5RowidCmp(tls, p, (*Fts5ExprNode)(unsafe.Pointer(pRoot)).FiRowid, iFirst) < 0 {
rc = (*struct {
f func(*libc.TLS, uintptr, uintptr, int32, I64) int32
- })(unsafe.Pointer(&struct{ uintptr }{(*Fts5ExprNode)(unsafe.Pointer((pRoot))).FxNext})).f(tls, p, pRoot, 1, iFirst)
+ })(unsafe.Pointer(&struct{ uintptr }{(*Fts5ExprNode)(unsafe.Pointer(pRoot)).FxNext})).f(tls, p, pRoot, 1, iFirst)
}
// If the iterator is not at a real match, skip forward until it is.
- for ((*Fts5ExprNode)(unsafe.Pointer(pRoot)).FbNomatch != 0) && (rc == SQLITE_OK) {
+ for (*Fts5ExprNode)(unsafe.Pointer(pRoot)).FbNomatch != 0 && rc == SQLITE_OK {
rc = (*struct {
f func(*libc.TLS, uintptr, uintptr, int32, I64) int32
- })(unsafe.Pointer(&struct{ uintptr }{(*Fts5ExprNode)(unsafe.Pointer((pRoot))).FxNext})).f(tls, p, pRoot, 0, int64(0))
+ })(unsafe.Pointer(&struct{ uintptr }{(*Fts5ExprNode)(unsafe.Pointer(pRoot)).FxNext})).f(tls, p, pRoot, 0, int64(0))
}
return rc
}
@@ -176260,14 +178598,14 @@ func sqlite3Fts5ExprFirst(tls *libc.TLS, p uintptr, pIdx uintptr, iFirst I64, bD
//
// Return SQLITE_OK if successful, or an SQLite error code otherwise. It
// is not considered an error if the query does not match any documents.
-func sqlite3Fts5ExprNext(tls *libc.TLS, p uintptr, iLast I64) int32 { /* sqlite3.c:218948:12: */
+func sqlite3Fts5ExprNext(tls *libc.TLS, p uintptr, iLast I64) int32 { /* sqlite3.c:220768:12: */
var rc int32
var pRoot uintptr = (*Fts5Expr)(unsafe.Pointer(p)).FpRoot
for ok := true; ok; ok = (*Fts5ExprNode)(unsafe.Pointer(pRoot)).FbNomatch != 0 {
rc = (*struct {
f func(*libc.TLS, uintptr, uintptr, int32, I64) int32
- })(unsafe.Pointer(&struct{ uintptr }{(*Fts5ExprNode)(unsafe.Pointer((pRoot))).FxNext})).f(tls, p, pRoot, 0, int64(0))
+ })(unsafe.Pointer(&struct{ uintptr }{(*Fts5ExprNode)(unsafe.Pointer(pRoot)).FxNext})).f(tls, p, pRoot, 0, int64(0))
}
if fts5RowidCmp(tls, p, (*Fts5ExprNode)(unsafe.Pointer(pRoot)).FiRowid, iLast) > 0 {
@@ -176276,15 +178614,15 @@ func sqlite3Fts5ExprNext(tls *libc.TLS, p uintptr, iLast I64) int32 { /* sqlite3
return rc
}
-func sqlite3Fts5ExprEof(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:218962:12: */
+func sqlite3Fts5ExprEof(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:220782:12: */
return (*Fts5ExprNode)(unsafe.Pointer((*Fts5Expr)(unsafe.Pointer(p)).FpRoot)).FbEof
}
-func sqlite3Fts5ExprRowid(tls *libc.TLS, p uintptr) I64 { /* sqlite3.c:218966:12: */
+func sqlite3Fts5ExprRowid(tls *libc.TLS, p uintptr) I64 { /* sqlite3.c:220786:12: */
return (*Fts5ExprNode)(unsafe.Pointer((*Fts5Expr)(unsafe.Pointer(p)).FpRoot)).FiRowid
}
-func fts5ParseStringFromToken(tls *libc.TLS, pToken uintptr, pz uintptr) int32 { /* sqlite3.c:218970:12: */
+func fts5ParseStringFromToken(tls *libc.TLS, pToken uintptr, pz uintptr) int32 { /* sqlite3.c:220790:12: */
bp := tls.Alloc(4)
defer tls.Free(4)
@@ -176294,24 +178632,24 @@ func fts5ParseStringFromToken(tls *libc.TLS, pToken uintptr, pz uintptr) int32 {
}
// Free the phrase object passed as the only argument.
-func fts5ExprPhraseFree(tls *libc.TLS, pPhrase uintptr) { /* sqlite3.c:218979:13: */
+func fts5ExprPhraseFree(tls *libc.TLS, pPhrase uintptr) { /* sqlite3.c:220799:13: */
if pPhrase != 0 {
var i int32
for i = 0; i < (*Fts5ExprPhrase)(unsafe.Pointer(pPhrase)).FnTerm; i++ {
var pSyn uintptr
var pNext uintptr
- var pTerm uintptr = ((pPhrase + 20 /* &.aTerm */) + uintptr(i)*16)
+ var pTerm uintptr = pPhrase + 20 + uintptr(i)*16
Xsqlite3_free(tls, (*Fts5ExprTerm)(unsafe.Pointer(pTerm)).FzTerm)
sqlite3Fts5IterClose(tls, (*Fts5ExprTerm)(unsafe.Pointer(pTerm)).FpIter)
for pSyn = (*Fts5ExprTerm)(unsafe.Pointer(pTerm)).FpSynonym; pSyn != 0; pSyn = pNext {
pNext = (*Fts5ExprTerm)(unsafe.Pointer(pSyn)).FpSynonym
sqlite3Fts5IterClose(tls, (*Fts5ExprTerm)(unsafe.Pointer(pSyn)).FpIter)
- sqlite3Fts5BufferFree(tls, (pSyn + 1*16))
+ sqlite3Fts5BufferFree(tls, pSyn+1*16)
Xsqlite3_free(tls, pSyn)
}
}
if (*Fts5ExprPhrase)(unsafe.Pointer(pPhrase)).Fposlist.FnSpace > 0 {
- sqlite3Fts5BufferFree(tls, (pPhrase + 4 /* &.poslist */))
+ sqlite3Fts5BufferFree(tls, pPhrase+4)
}
Xsqlite3_free(tls, pPhrase)
}
@@ -176319,9 +178657,9 @@ func fts5ExprPhraseFree(tls *libc.TLS, pPhrase uintptr) { /* sqlite3.c:218979:13
// Set the "bFirst" flag on the first token of the phrase passed as the
// only argument.
-func sqlite3Fts5ParseSetCaret(tls *libc.TLS, pPhrase uintptr) { /* sqlite3.c:219004:13: */
- if (pPhrase != 0) && ((*Fts5ExprPhrase)(unsafe.Pointer(pPhrase)).FnTerm != 0) {
- (*Fts5ExprTerm)(unsafe.Pointer((pPhrase + 20 /* &.aTerm */))).FbFirst = U8(1)
+func sqlite3Fts5ParseSetCaret(tls *libc.TLS, pPhrase uintptr) { /* sqlite3.c:220824:13: */
+ if pPhrase != 0 && (*Fts5ExprPhrase)(unsafe.Pointer(pPhrase)).FnTerm != 0 {
+ (*Fts5ExprTerm)(unsafe.Pointer(pPhrase + 20)).FbFirst = U8(1)
}
}
@@ -176331,7 +178669,7 @@ func sqlite3Fts5ParseSetCaret(tls *libc.TLS, pPhrase uintptr) { /* sqlite3.c:219
//
// If an OOM error occurs, both the pNear and pPhrase objects are freed and
// NULL returned.
-func sqlite3Fts5ParseNearset(tls *libc.TLS, pParse uintptr, pNear uintptr, pPhrase uintptr) uintptr { /* sqlite3.c:219018:24: */
+func sqlite3Fts5ParseNearset(tls *libc.TLS, pParse uintptr, pNear uintptr, pPhrase uintptr) uintptr { /* sqlite3.c:220838:24: */
var SZALLOC int32 = 8
var pRet uintptr = uintptr(0)
@@ -176341,18 +178679,18 @@ func sqlite3Fts5ParseNearset(tls *libc.TLS, pParse uintptr, pNear uintptr, pPhra
}
if pNear == uintptr(0) {
var nByte Sqlite3_int64
- nByte = (Sqlite3_int64(uint32(unsafe.Sizeof(Fts5ExprNearset{})) + (uint32(SZALLOC) * uint32(unsafe.Sizeof(uintptr(0))))))
+ nByte = Sqlite3_int64(uint32(unsafe.Sizeof(Fts5ExprNearset{})) + uint32(SZALLOC)*uint32(unsafe.Sizeof(uintptr(0))))
pRet = Xsqlite3_malloc64(tls, uint64(nByte))
if pRet == uintptr(0) {
(*Fts5Parse)(unsafe.Pointer(pParse)).Frc = SQLITE_NOMEM
} else {
libc.Xmemset(tls, pRet, 0, Size_t(nByte))
}
- } else if ((*Fts5ExprNearset)(unsafe.Pointer(pNear)).FnPhrase % SZALLOC) == 0 {
- var nNew int32 = ((*Fts5ExprNearset)(unsafe.Pointer(pNear)).FnPhrase + SZALLOC)
+ } else if (*Fts5ExprNearset)(unsafe.Pointer(pNear)).FnPhrase%SZALLOC == 0 {
+ var nNew int32 = (*Fts5ExprNearset)(unsafe.Pointer(pNear)).FnPhrase + SZALLOC
var nByte Sqlite3_int64
- nByte = (Sqlite3_int64(uint32(unsafe.Sizeof(Fts5ExprNearset{})) + (uint32(nNew) * uint32(unsafe.Sizeof(uintptr(0))))))
+ nByte = Sqlite3_int64(uint32(unsafe.Sizeof(Fts5ExprNearset{})) + uint32(nNew)*uint32(unsafe.Sizeof(uintptr(0))))
pRet = Xsqlite3_realloc64(tls, pNear, uint64(nByte))
if pRet == uintptr(0) {
(*Fts5Parse)(unsafe.Pointer(pParse)).Frc = SQLITE_NOMEM
@@ -176368,7 +178706,7 @@ func sqlite3Fts5ParseNearset(tls *libc.TLS, pParse uintptr, pNear uintptr, pPhra
sqlite3Fts5ParsePhraseFree(tls, pPhrase)
} else {
if (*Fts5ExprNearset)(unsafe.Pointer(pRet)).FnPhrase > 0 {
- var pLast uintptr = *(*uintptr)(unsafe.Pointer((pRet + 12 /* &.apPhrase */) + uintptr(((*Fts5ExprNearset)(unsafe.Pointer(pRet)).FnPhrase-1))*4))
+ var pLast uintptr = *(*uintptr)(unsafe.Pointer(pRet + 12 + uintptr((*Fts5ExprNearset)(unsafe.Pointer(pRet)).FnPhrase-1)*4))
if (*Fts5ExprPhrase)(unsafe.Pointer(pPhrase)).FnTerm == 0 {
fts5ExprPhraseFree(tls, pPhrase)
@@ -176377,12 +178715,12 @@ func sqlite3Fts5ParseNearset(tls *libc.TLS, pParse uintptr, pNear uintptr, pPhra
pPhrase = pLast
} else if (*Fts5ExprPhrase)(unsafe.Pointer(pLast)).FnTerm == 0 {
fts5ExprPhraseFree(tls, pLast)
- *(*uintptr)(unsafe.Pointer((*Fts5Parse)(unsafe.Pointer(pParse)).FapPhrase + uintptr(((*Fts5Parse)(unsafe.Pointer(pParse)).FnPhrase-2))*4)) = pPhrase
+ *(*uintptr)(unsafe.Pointer((*Fts5Parse)(unsafe.Pointer(pParse)).FapPhrase + uintptr((*Fts5Parse)(unsafe.Pointer(pParse)).FnPhrase-2)*4)) = pPhrase
(*Fts5Parse)(unsafe.Pointer(pParse)).FnPhrase--
(*Fts5ExprNearset)(unsafe.Pointer(pRet)).FnPhrase--
}
}
- *(*uintptr)(unsafe.Pointer((pRet + 12 /* &.apPhrase */) + uintptr(libc.PostIncInt32(&(*Fts5ExprNearset)(unsafe.Pointer(pRet)).FnPhrase, 1))*4)) = pPhrase
+ *(*uintptr)(unsafe.Pointer(pRet + 12 + uintptr(libc.PostIncInt32(&(*Fts5ExprNearset)(unsafe.Pointer(pRet)).FnPhrase, 1))*4)) = pPhrase
}
return pRet
}
@@ -176390,12 +178728,12 @@ func sqlite3Fts5ParseNearset(tls *libc.TLS, pParse uintptr, pNear uintptr, pPhra
type TokenCtx1 = struct {
FpPhrase uintptr
Frc int32
-} /* sqlite3.c:219078:9 */
+} /* sqlite3.c:220898:9 */
-type TokenCtx = TokenCtx1 /* sqlite3.c:219078:25 */
+type TokenCtx = TokenCtx1 /* sqlite3.c:220898:25 */
// Callback for tokenizing terms used by ParseTerm().
-func fts5ParseTokenize(tls *libc.TLS, pContext uintptr, tflags int32, pToken uintptr, nToken int32, iUnused1 int32, iUnused2 int32) int32 { /* sqlite3.c:219087:12: */
+func fts5ParseTokenize(tls *libc.TLS, pContext uintptr, tflags int32, pToken uintptr, nToken int32, iUnused1 int32, iUnused2 int32) int32 { /* sqlite3.c:220907:12: */
bp := tls.Alloc(4)
defer tls.Free(4)
@@ -176415,32 +178753,32 @@ func fts5ParseTokenize(tls *libc.TLS, pContext uintptr, tflags int32, pToken uin
nToken = FTS5_MAX_TOKEN_SIZE
}
- if ((pPhrase != 0) && ((*Fts5ExprPhrase)(unsafe.Pointer(pPhrase)).FnTerm > 0)) && ((tflags & FTS5_TOKEN_COLOCATED) != 0) {
+ if pPhrase != 0 && (*Fts5ExprPhrase)(unsafe.Pointer(pPhrase)).FnTerm > 0 && tflags&FTS5_TOKEN_COLOCATED != 0 {
var pSyn uintptr
- var nByte Sqlite3_int64 = (Sqlite3_int64(((uint32(unsafe.Sizeof(Fts5ExprTerm{})) + uint32(unsafe.Sizeof(Fts5Buffer{}))) + uint32(nToken)) + uint32(1)))
+ var nByte Sqlite3_int64 = Sqlite3_int64(uint32(unsafe.Sizeof(Fts5ExprTerm{})) + uint32(unsafe.Sizeof(Fts5Buffer{})) + uint32(nToken) + uint32(1))
pSyn = Xsqlite3_malloc64(tls, uint64(nByte))
if pSyn == uintptr(0) {
*(*int32)(unsafe.Pointer(bp /* rc */)) = SQLITE_NOMEM
} else {
libc.Xmemset(tls, pSyn, 0, Size_t(nByte))
- (*Fts5ExprTerm)(unsafe.Pointer(pSyn)).FzTerm = (((pSyn) + uintptr(uint32(unsafe.Sizeof(Fts5ExprTerm{})))) + uintptr(uint32(unsafe.Sizeof(Fts5Buffer{}))))
+ (*Fts5ExprTerm)(unsafe.Pointer(pSyn)).FzTerm = pSyn + uintptr(uint32(unsafe.Sizeof(Fts5ExprTerm{}))) + uintptr(uint32(unsafe.Sizeof(Fts5Buffer{})))
libc.Xmemcpy(tls, (*Fts5ExprTerm)(unsafe.Pointer(pSyn)).FzTerm, pToken, uint32(nToken))
- (*Fts5ExprTerm)(unsafe.Pointer(pSyn)).FpSynonym = (*Fts5ExprTerm)(unsafe.Pointer((pPhrase + 20 /* &.aTerm */) + uintptr(((*Fts5ExprPhrase)(unsafe.Pointer(pPhrase)).FnTerm-1))*16)).FpSynonym
- (*Fts5ExprTerm)(unsafe.Pointer((pPhrase + 20 /* &.aTerm */) + uintptr(((*Fts5ExprPhrase)(unsafe.Pointer(pPhrase)).FnTerm-1))*16)).FpSynonym = pSyn
+ (*Fts5ExprTerm)(unsafe.Pointer(pSyn)).FpSynonym = (*Fts5ExprTerm)(unsafe.Pointer(pPhrase + 20 + uintptr((*Fts5ExprPhrase)(unsafe.Pointer(pPhrase)).FnTerm-1)*16)).FpSynonym
+ (*Fts5ExprTerm)(unsafe.Pointer(pPhrase + 20 + uintptr((*Fts5ExprPhrase)(unsafe.Pointer(pPhrase)).FnTerm-1)*16)).FpSynonym = pSyn
}
} else {
var pTerm uintptr
- if (pPhrase == uintptr(0)) || (((*Fts5ExprPhrase)(unsafe.Pointer(pPhrase)).FnTerm % SZALLOC) == 0) {
+ if pPhrase == uintptr(0) || (*Fts5ExprPhrase)(unsafe.Pointer(pPhrase)).FnTerm%SZALLOC == 0 {
var pNew uintptr
- var nNew int32 = (SZALLOC + (func() int32 {
+ var nNew int32 = SZALLOC + func() int32 {
if pPhrase != 0 {
return (*Fts5ExprPhrase)(unsafe.Pointer(pPhrase)).FnTerm
}
return 0
- }()))
+ }()
pNew = Xsqlite3_realloc64(tls, pPhrase,
- (uint64(uint32(unsafe.Sizeof(Fts5ExprPhrase{})) + (uint32(unsafe.Sizeof(Fts5ExprTerm{})) * uint32(nNew)))))
+ uint64(uint32(unsafe.Sizeof(Fts5ExprPhrase{}))+uint32(unsafe.Sizeof(Fts5ExprTerm{}))*uint32(nNew)))
if pNew == uintptr(0) {
*(*int32)(unsafe.Pointer(bp /* rc */)) = SQLITE_NOMEM
} else {
@@ -176448,12 +178786,12 @@ func fts5ParseTokenize(tls *libc.TLS, pContext uintptr, tflags int32, pToken uin
libc.Xmemset(tls, pNew, 0, uint32(unsafe.Sizeof(Fts5ExprPhrase{})))
}
(*TokenCtx)(unsafe.Pointer(pCtx)).FpPhrase = libc.AssignUintptr(&pPhrase, pNew)
- (*Fts5ExprPhrase)(unsafe.Pointer(pNew)).FnTerm = (nNew - SZALLOC)
+ (*Fts5ExprPhrase)(unsafe.Pointer(pNew)).FnTerm = nNew - SZALLOC
}
}
- if *(*int32)(unsafe.Pointer(bp /* rc */)) == SQLITE_OK {
- pTerm = ((pPhrase + 20 /* &.aTerm */) + uintptr(libc.PostIncInt32(&(*Fts5ExprPhrase)(unsafe.Pointer(pPhrase)).FnTerm, 1))*16)
+ if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK {
+ pTerm = pPhrase + 20 + uintptr(libc.PostIncInt32(&(*Fts5ExprPhrase)(unsafe.Pointer(pPhrase)).FnTerm, 1))*16
libc.Xmemset(tls, pTerm, 0, uint32(unsafe.Sizeof(Fts5ExprTerm{})))
(*Fts5ExprTerm)(unsafe.Pointer(pTerm)).FzTerm = sqlite3Fts5Strndup(tls, bp /* &rc */, pToken, nToken)
}
@@ -176464,30 +178802,30 @@ func fts5ParseTokenize(tls *libc.TLS, pContext uintptr, tflags int32, pToken uin
}
// Free the phrase object passed as the only argument.
-func sqlite3Fts5ParsePhraseFree(tls *libc.TLS, pPhrase uintptr) { /* sqlite3.c:219152:13: */
+func sqlite3Fts5ParsePhraseFree(tls *libc.TLS, pPhrase uintptr) { /* sqlite3.c:220972:13: */
fts5ExprPhraseFree(tls, pPhrase)
}
// Free the phrase object passed as the second argument.
-func sqlite3Fts5ParseNearsetFree(tls *libc.TLS, pNear uintptr) { /* sqlite3.c:219159:13: */
+func sqlite3Fts5ParseNearsetFree(tls *libc.TLS, pNear uintptr) { /* sqlite3.c:220979:13: */
if pNear != 0 {
var i int32
for i = 0; i < (*Fts5ExprNearset)(unsafe.Pointer(pNear)).FnPhrase; i++ {
- fts5ExprPhraseFree(tls, *(*uintptr)(unsafe.Pointer((pNear + 12 /* &.apPhrase */) + uintptr(i)*4)))
+ fts5ExprPhraseFree(tls, *(*uintptr)(unsafe.Pointer(pNear + 12 + uintptr(i)*4)))
}
Xsqlite3_free(tls, (*Fts5ExprNearset)(unsafe.Pointer(pNear)).FpColset)
Xsqlite3_free(tls, pNear)
}
}
-func sqlite3Fts5ParseFinished(tls *libc.TLS, pParse uintptr, p uintptr) { /* sqlite3.c:219170:13: */
+func sqlite3Fts5ParseFinished(tls *libc.TLS, pParse uintptr, p uintptr) { /* sqlite3.c:220990:13: */
(*Fts5Parse)(unsafe.Pointer(pParse)).FpExpr = p
}
-func parseGrowPhraseArray(tls *libc.TLS, pParse uintptr) int32 { /* sqlite3.c:219175:12: */
- if ((*Fts5Parse)(unsafe.Pointer(pParse)).FnPhrase % 8) == 0 {
- var nByte Sqlite3_int64 = (Sqlite3_int64(uint32(unsafe.Sizeof(uintptr(0))) * (uint32((*Fts5Parse)(unsafe.Pointer(pParse)).FnPhrase + 8))))
+func parseGrowPhraseArray(tls *libc.TLS, pParse uintptr) int32 { /* sqlite3.c:220995:12: */
+ if (*Fts5Parse)(unsafe.Pointer(pParse)).FnPhrase%8 == 0 {
+ var nByte Sqlite3_int64 = Sqlite3_int64(uint32(unsafe.Sizeof(uintptr(0))) * uint32((*Fts5Parse)(unsafe.Pointer(pParse)).FnPhrase+8))
var apNew uintptr
apNew = Xsqlite3_realloc64(tls, (*Fts5Parse)(unsafe.Pointer(pParse)).FapPhrase, uint64(nByte))
if apNew == uintptr(0) {
@@ -176502,7 +178840,7 @@ func parseGrowPhraseArray(tls *libc.TLS, pParse uintptr) int32 { /* sqlite3.c:21
// This function is called by the parser to process a string token. The
// string may or may not be quoted. In any case it is tokenized and a
// phrase object consisting of all tokens returned.
-func sqlite3Fts5ParseTerm(tls *libc.TLS, pParse uintptr, pAppend uintptr, pToken uintptr, bPrefix int32) uintptr { /* sqlite3.c:219194:23: */
+func sqlite3Fts5ParseTerm(tls *libc.TLS, pParse uintptr, pAppend uintptr, pToken uintptr, bPrefix int32) uintptr { /* sqlite3.c:221014:23: */
bp := tls.Alloc(12)
defer tls.Free(12)
@@ -176517,12 +178855,12 @@ func sqlite3Fts5ParseTerm(tls *libc.TLS, pParse uintptr, pAppend uintptr, pToken
rc = fts5ParseStringFromToken(tls, pToken, bp+8 /* &z */)
if rc == SQLITE_OK {
- var flags int32 = (FTS5_TOKENIZE_QUERY | (func() int32 {
+ var flags int32 = FTS5_TOKENIZE_QUERY | func() int32 {
if bPrefix != 0 {
return FTS5_TOKENIZE_PREFIX
}
return 0
- }()))
+ }()
var n int32
sqlite3Fts5Dequote(tls, *(*uintptr)(unsafe.Pointer(bp + 8 /* z */)))
n = int32(libc.Xstrlen(tls, *(*uintptr)(unsafe.Pointer(bp + 8 /* z */))))
@@ -176531,7 +178869,7 @@ func sqlite3Fts5ParseTerm(tls *libc.TLS, pParse uintptr, pAppend uintptr, pToken
}{fts5ParseTokenize})))
}
Xsqlite3_free(tls, *(*uintptr)(unsafe.Pointer(bp + 8 /* z */)))
- if (rc != 0) || (libc.AssignInt32(&rc, (*TokenCtx)(unsafe.Pointer(bp /* &sCtx */)).Frc) != 0) {
+ if rc != 0 || libc.AssignInt32(&rc, (*TokenCtx)(unsafe.Pointer(bp)).Frc) != 0 {
(*Fts5Parse)(unsafe.Pointer(pParse)).Frc = rc
fts5ExprPhraseFree(tls, (*TokenCtx)(unsafe.Pointer(bp /* &sCtx */)).FpPhrase)
(*TokenCtx)(unsafe.Pointer(bp /* &sCtx */)).FpPhrase = uintptr(0)
@@ -176545,14 +178883,14 @@ func sqlite3Fts5ParseTerm(tls *libc.TLS, pParse uintptr, pAppend uintptr, pToken
(*Fts5Parse)(unsafe.Pointer(pParse)).FnPhrase++
}
- if (*TokenCtx)(unsafe.Pointer(bp /* &sCtx */)).FpPhrase == uintptr(0) {
+ if (*TokenCtx)(unsafe.Pointer(bp)).FpPhrase == uintptr(0) {
// This happens when parsing a token or quoted phrase that contains
// no token characters at all. (e.g ... MATCH '""').
- (*TokenCtx)(unsafe.Pointer(bp /* &sCtx */)).FpPhrase = sqlite3Fts5MallocZero(tls, (pParse + 8 /* &.rc */), int64(unsafe.Sizeof(Fts5ExprPhrase{})))
- } else if (*Fts5ExprPhrase)(unsafe.Pointer((*TokenCtx)(unsafe.Pointer(bp /* &sCtx */)).FpPhrase)).FnTerm != 0 {
- (*Fts5ExprTerm)(unsafe.Pointer(((*TokenCtx)(unsafe.Pointer(bp /* &sCtx */)).FpPhrase + 20 /* &.aTerm */) + uintptr(((*Fts5ExprPhrase)(unsafe.Pointer((*TokenCtx)(unsafe.Pointer(bp /* &sCtx */)).FpPhrase)).FnTerm-1))*16)).FbPrefix = U8(bPrefix)
+ (*TokenCtx)(unsafe.Pointer(bp /* &sCtx */)).FpPhrase = sqlite3Fts5MallocZero(tls, pParse+8, int64(unsafe.Sizeof(Fts5ExprPhrase{})))
+ } else if (*Fts5ExprPhrase)(unsafe.Pointer((*TokenCtx)(unsafe.Pointer(bp)).FpPhrase)).FnTerm != 0 {
+ (*Fts5ExprTerm)(unsafe.Pointer((*TokenCtx)(unsafe.Pointer(bp)).FpPhrase + 20 + uintptr((*Fts5ExprPhrase)(unsafe.Pointer((*TokenCtx)(unsafe.Pointer(bp)).FpPhrase)).FnTerm-1)*16)).FbPrefix = U8(bPrefix)
}
- *(*uintptr)(unsafe.Pointer((*Fts5Parse)(unsafe.Pointer(pParse)).FapPhrase + uintptr(((*Fts5Parse)(unsafe.Pointer(pParse)).FnPhrase-1))*4)) = (*TokenCtx)(unsafe.Pointer(bp /* &sCtx */)).FpPhrase
+ *(*uintptr)(unsafe.Pointer((*Fts5Parse)(unsafe.Pointer(pParse)).FapPhrase + uintptr((*Fts5Parse)(unsafe.Pointer(pParse)).FnPhrase-1)*4)) = (*TokenCtx)(unsafe.Pointer(bp /* &sCtx */)).FpPhrase
}
return (*TokenCtx)(unsafe.Pointer(bp /* &sCtx */)).FpPhrase
@@ -176560,7 +178898,7 @@ func sqlite3Fts5ParseTerm(tls *libc.TLS, pParse uintptr, pAppend uintptr, pToken
// Create a new FTS5 expression by cloning phrase iPhrase of the
// expression passed as the second argument.
-func sqlite3Fts5ExprClonePhrase(tls *libc.TLS, pExpr uintptr, iPhrase int32, ppNew uintptr) int32 { /* sqlite3.c:219248:12: */
+func sqlite3Fts5ExprClonePhrase(tls *libc.TLS, pExpr uintptr, iPhrase int32, ppNew uintptr) int32 { /* sqlite3.c:221068:12: */
bp := tls.Alloc(12)
defer tls.Free(12)
@@ -176571,24 +178909,24 @@ func sqlite3Fts5ExprClonePhrase(tls *libc.TLS, pExpr uintptr, iPhrase int32, ppN
pOrig = *(*uintptr)(unsafe.Pointer((*Fts5Expr)(unsafe.Pointer(pExpr)).FapExprPhrase + uintptr(iPhrase)*4))
pNew = sqlite3Fts5MallocZero(tls, bp /* &rc */, int64(unsafe.Sizeof(Fts5Expr{})))
- if *(*int32)(unsafe.Pointer(bp /* rc */)) == SQLITE_OK {
+ if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK {
(*Fts5Expr)(unsafe.Pointer(pNew)).FapExprPhrase = sqlite3Fts5MallocZero(tls, bp, /* &rc */
int64(unsafe.Sizeof(uintptr(0))))
}
- if *(*int32)(unsafe.Pointer(bp /* rc */)) == SQLITE_OK {
+ if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK {
(*Fts5Expr)(unsafe.Pointer(pNew)).FpRoot = sqlite3Fts5MallocZero(tls, bp, /* &rc */
int64(unsafe.Sizeof(Fts5ExprNode{})))
}
- if *(*int32)(unsafe.Pointer(bp /* rc */)) == SQLITE_OK {
+ if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK {
(*Fts5ExprNode)(unsafe.Pointer((*Fts5Expr)(unsafe.Pointer(pNew)).FpRoot)).FpNear = sqlite3Fts5MallocZero(tls, bp, /* &rc */
- (int64(uint32(unsafe.Sizeof(Fts5ExprNearset{})) + uint32(unsafe.Sizeof(uintptr(0))))))
+ int64(uint32(unsafe.Sizeof(Fts5ExprNearset{}))+uint32(unsafe.Sizeof(uintptr(0)))))
}
- if *(*int32)(unsafe.Pointer(bp /* rc */)) == SQLITE_OK {
+ if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK {
var pColsetOrig uintptr = (*Fts5ExprNearset)(unsafe.Pointer((*Fts5ExprNode)(unsafe.Pointer((*Fts5ExprPhrase)(unsafe.Pointer(pOrig)).FpNode)).FpNear)).FpColset
if pColsetOrig != 0 {
var nByte Sqlite3_int64
var pColset uintptr
- nByte = (Sqlite3_int64(uint32(unsafe.Sizeof(Fts5Colset{})) + ((uint32((*Fts5Colset)(unsafe.Pointer(pColsetOrig)).FnCol - 1)) * uint32(unsafe.Sizeof(int32(0))))))
+ nByte = Sqlite3_int64(uint32(unsafe.Sizeof(Fts5Colset{})) + uint32((*Fts5Colset)(unsafe.Pointer(pColsetOrig)).FnCol-1)*uint32(unsafe.Sizeof(int32(0))))
pColset = sqlite3Fts5MallocZero(tls, bp /* &rc */, nByte)
if pColset != 0 {
libc.Xmemcpy(tls, pColset, pColsetOrig, Size_t(nByte))
@@ -176599,18 +178937,18 @@ func sqlite3Fts5ExprClonePhrase(tls *libc.TLS, pExpr uintptr, iPhrase int32, ppN
if (*Fts5ExprPhrase)(unsafe.Pointer(pOrig)).FnTerm != 0 {
var i int32 // Used to iterate through phrase terms
- for i = 0; (*(*int32)(unsafe.Pointer(bp /* rc */)) == SQLITE_OK) && (i < (*Fts5ExprPhrase)(unsafe.Pointer(pOrig)).FnTerm); i++ {
+ for i = 0; *(*int32)(unsafe.Pointer(bp /* rc */)) == SQLITE_OK && i < (*Fts5ExprPhrase)(unsafe.Pointer(pOrig)).FnTerm; i++ {
var tflags int32 = 0
var p uintptr
- for p = ((pOrig + 20 /* &.aTerm */) + uintptr(i)*16); (p != 0) && (*(*int32)(unsafe.Pointer(bp /* rc */)) == SQLITE_OK); p = (*Fts5ExprTerm)(unsafe.Pointer(p)).FpSynonym {
+ for p = pOrig + 20 + uintptr(i)*16; p != 0 && *(*int32)(unsafe.Pointer(bp /* rc */)) == SQLITE_OK; p = (*Fts5ExprTerm)(unsafe.Pointer(p)).FpSynonym {
var zTerm uintptr = (*Fts5ExprTerm)(unsafe.Pointer(p)).FzTerm
*(*int32)(unsafe.Pointer(bp /* rc */)) = fts5ParseTokenize(tls, bp+4 /* &sCtx */, tflags, zTerm, int32(libc.Xstrlen(tls, zTerm)),
0, 0)
tflags = FTS5_TOKEN_COLOCATED
}
- if *(*int32)(unsafe.Pointer(bp /* rc */)) == SQLITE_OK {
- (*Fts5ExprTerm)(unsafe.Pointer(((*TokenCtx)(unsafe.Pointer(bp+4 /* &sCtx */)).FpPhrase + 20 /* &.aTerm */) + uintptr(i)*16)).FbPrefix = (*Fts5ExprTerm)(unsafe.Pointer((pOrig + 20 /* &.aTerm */) + uintptr(i)*16)).FbPrefix
- (*Fts5ExprTerm)(unsafe.Pointer(((*TokenCtx)(unsafe.Pointer(bp+4 /* &sCtx */)).FpPhrase + 20 /* &.aTerm */) + uintptr(i)*16)).FbFirst = (*Fts5ExprTerm)(unsafe.Pointer((pOrig + 20 /* &.aTerm */) + uintptr(i)*16)).FbFirst
+ if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK {
+ (*Fts5ExprTerm)(unsafe.Pointer((*TokenCtx)(unsafe.Pointer(bp+4)).FpPhrase + 20 + uintptr(i)*16)).FbPrefix = (*Fts5ExprTerm)(unsafe.Pointer(pOrig + 20 + uintptr(i)*16)).FbPrefix
+ (*Fts5ExprTerm)(unsafe.Pointer((*TokenCtx)(unsafe.Pointer(bp+4)).FpPhrase + 20 + uintptr(i)*16)).FbFirst = (*Fts5ExprTerm)(unsafe.Pointer(pOrig + 20 + uintptr(i)*16)).FbFirst
}
}
} else {
@@ -176619,19 +178957,19 @@ func sqlite3Fts5ExprClonePhrase(tls *libc.TLS, pExpr uintptr, iPhrase int32, ppN
(*TokenCtx)(unsafe.Pointer(bp + 4 /* &sCtx */)).FpPhrase = sqlite3Fts5MallocZero(tls, bp /* &rc */, int64(unsafe.Sizeof(Fts5ExprPhrase{})))
}
- if *(*int32)(unsafe.Pointer(bp /* rc */)) == SQLITE_OK {
+ if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK && (*TokenCtx)(unsafe.Pointer(bp+4)).FpPhrase != 0 {
// All the allocations succeeded. Put the expression object together.
(*Fts5Expr)(unsafe.Pointer(pNew)).FpIndex = (*Fts5Expr)(unsafe.Pointer(pExpr)).FpIndex
(*Fts5Expr)(unsafe.Pointer(pNew)).FpConfig = (*Fts5Expr)(unsafe.Pointer(pExpr)).FpConfig
(*Fts5Expr)(unsafe.Pointer(pNew)).FnPhrase = 1
*(*uintptr)(unsafe.Pointer((*Fts5Expr)(unsafe.Pointer(pNew)).FapExprPhrase)) = (*TokenCtx)(unsafe.Pointer(bp + 4 /* &sCtx */)).FpPhrase
- *(*uintptr)(unsafe.Pointer(((*Fts5ExprNode)(unsafe.Pointer((*Fts5Expr)(unsafe.Pointer(pNew)).FpRoot)).FpNear + 12 /* &.apPhrase */))) = (*TokenCtx)(unsafe.Pointer(bp + 4 /* &sCtx */)).FpPhrase
+ *(*uintptr)(unsafe.Pointer((*Fts5ExprNode)(unsafe.Pointer((*Fts5Expr)(unsafe.Pointer(pNew)).FpRoot)).FpNear + 12)) = (*TokenCtx)(unsafe.Pointer(bp + 4 /* &sCtx */)).FpPhrase
(*Fts5ExprNearset)(unsafe.Pointer((*Fts5ExprNode)(unsafe.Pointer((*Fts5Expr)(unsafe.Pointer(pNew)).FpRoot)).FpNear)).FnPhrase = 1
(*Fts5ExprPhrase)(unsafe.Pointer((*TokenCtx)(unsafe.Pointer(bp + 4 /* &sCtx */)).FpPhrase)).FpNode = (*Fts5Expr)(unsafe.Pointer(pNew)).FpRoot
- if (((*Fts5ExprPhrase)(unsafe.Pointer(pOrig)).FnTerm == 1) &&
- ((*Fts5ExprTerm)(unsafe.Pointer((pOrig + 20 /* &.aTerm */))).FpSynonym == uintptr(0))) &&
- (int32((*Fts5ExprTerm)(unsafe.Pointer((pOrig + 20 /* &.aTerm */))).FbFirst) == 0) {
+ if (*Fts5ExprPhrase)(unsafe.Pointer(pOrig)).FnTerm == 1 &&
+ (*Fts5ExprTerm)(unsafe.Pointer(pOrig+20)).FpSynonym == uintptr(0) &&
+ int32((*Fts5ExprTerm)(unsafe.Pointer(pOrig+20)).FbFirst) == 0 {
(*Fts5ExprNode)(unsafe.Pointer((*Fts5Expr)(unsafe.Pointer(pNew)).FpRoot)).FeType = FTS5_TERM
(*Fts5ExprNode)(unsafe.Pointer((*Fts5Expr)(unsafe.Pointer(pNew)).FpRoot)).FxNext = *(*uintptr)(unsafe.Pointer(&struct {
f func(*libc.TLS, uintptr, uintptr, int32, I64) int32
@@ -176655,17 +178993,17 @@ func sqlite3Fts5ExprClonePhrase(tls *libc.TLS, pExpr uintptr, iPhrase int32, ppN
// Token pTok has appeared in a MATCH expression where the NEAR operator
// is expected. If token pTok does not contain "NEAR", store an error
// in the pParse object.
-func sqlite3Fts5ParseNear(tls *libc.TLS, pParse uintptr, pTok uintptr) { /* sqlite3.c:219344:13: */
+func sqlite3Fts5ParseNear(tls *libc.TLS, pParse uintptr, pTok uintptr) { /* sqlite3.c:221164:13: */
bp := tls.Alloc(16)
defer tls.Free(16)
- if ((*Fts5Token)(unsafe.Pointer(pTok)).Fn != 4) || (libc.Xmemcmp(tls, ts+32881 /* "NEAR" */, (*Fts5Token)(unsafe.Pointer(pTok)).Fp, uint32(4)) != 0) {
+ if (*Fts5Token)(unsafe.Pointer(pTok)).Fn != 4 || libc.Xmemcmp(tls, ts+34241, (*Fts5Token)(unsafe.Pointer(pTok)).Fp, uint32(4)) != 0 {
sqlite3Fts5ParseError(tls,
- pParse, ts+31910 /* "fts5: syntax err..." */, libc.VaList(bp, (*Fts5Token)(unsafe.Pointer(pTok)).Fn, (*Fts5Token)(unsafe.Pointer(pTok)).Fp))
+ pParse, ts+33270 /* "fts5: syntax err..." */, libc.VaList(bp, (*Fts5Token)(unsafe.Pointer(pTok)).Fn, (*Fts5Token)(unsafe.Pointer(pTok)).Fp))
}
}
-func sqlite3Fts5ParseSetDistance(tls *libc.TLS, pParse uintptr, pNear uintptr, p uintptr) { /* sqlite3.c:219352:13: */
+func sqlite3Fts5ParseSetDistance(tls *libc.TLS, pParse uintptr, pNear uintptr, p uintptr) { /* sqlite3.c:221172:13: */
bp := tls.Alloc(16)
defer tls.Free(16)
@@ -176675,12 +179013,12 @@ func sqlite3Fts5ParseSetDistance(tls *libc.TLS, pParse uintptr, pNear uintptr, p
if (*Fts5Token)(unsafe.Pointer(p)).Fn != 0 {
for i = 0; i < (*Fts5Token)(unsafe.Pointer(p)).Fn; i++ {
var c uint8 = *(*uint8)(unsafe.Pointer((*Fts5Token)(unsafe.Pointer(p)).Fp + uintptr(i)))
- if (int32(c) < '0') || (int32(c) > '9') {
+ if int32(c) < '0' || int32(c) > '9' {
sqlite3Fts5ParseError(tls,
- pParse, ts+32886 /* "expected integer..." */, libc.VaList(bp, (*Fts5Token)(unsafe.Pointer(p)).Fn, (*Fts5Token)(unsafe.Pointer(p)).Fp))
+ pParse, ts+34246 /* "expected integer..." */, libc.VaList(bp, (*Fts5Token)(unsafe.Pointer(p)).Fn, (*Fts5Token)(unsafe.Pointer(p)).Fp))
return
}
- nNear = ((nNear * 10) + (int32(*(*uint8)(unsafe.Pointer((*Fts5Token)(unsafe.Pointer(p)).Fp + uintptr(i)))) - '0'))
+ nNear = nNear*10 + (int32(*(*uint8)(unsafe.Pointer((*Fts5Token)(unsafe.Pointer(p)).Fp + uintptr(i)))) - '0')
}
} else {
nNear = FTS5_DEFAULT_NEARDIST
@@ -176696,7 +179034,7 @@ func sqlite3Fts5ParseSetDistance(tls *libc.TLS, pParse uintptr, pNear uintptr, p
//
// If an OOM error occurs, store an error code in pParse and return NULL.
// The old colset object (if any) is not freed in this case.
-func fts5ParseColset(tls *libc.TLS, pParse uintptr, p uintptr, iCol int32) uintptr { /* sqlite3.c:219387:19: */
+func fts5ParseColset(tls *libc.TLS, pParse uintptr, p uintptr, iCol int32) uintptr { /* sqlite3.c:221207:19: */
var nCol int32
if p != 0 {
nCol = (*Fts5Colset)(unsafe.Pointer(p)).FnCol
@@ -176705,7 +179043,7 @@ func fts5ParseColset(tls *libc.TLS, pParse uintptr, p uintptr, iCol int32) uintp
} // Num. columns already in colset object
var pNew uintptr // New colset object to return
- pNew = Xsqlite3_realloc64(tls, p, (uint64(uint32(unsafe.Sizeof(Fts5Colset{})) + (uint32(unsafe.Sizeof(int32(0))) * uint32(nCol)))))
+ pNew = Xsqlite3_realloc64(tls, p, uint64(uint32(unsafe.Sizeof(Fts5Colset{}))+uint32(unsafe.Sizeof(int32(0)))*uint32(nCol)))
if pNew == uintptr(0) {
(*Fts5Parse)(unsafe.Pointer(pParse)).Frc = SQLITE_NOMEM
} else {
@@ -176721,10 +179059,10 @@ func fts5ParseColset(tls *libc.TLS, pParse uintptr, p uintptr, iCol int32) uintp
}
}
for j = nCol; j > i; j-- {
- *(*int32)(unsafe.Pointer(aiCol + uintptr(j)*4)) = *(*int32)(unsafe.Pointer(aiCol + uintptr((j-1))*4))
+ *(*int32)(unsafe.Pointer(aiCol + uintptr(j)*4)) = *(*int32)(unsafe.Pointer(aiCol + uintptr(j-1)*4))
}
*(*int32)(unsafe.Pointer(aiCol + uintptr(i)*4)) = iCol
- (*Fts5Colset)(unsafe.Pointer(pNew)).FnCol = (nCol + 1)
+ (*Fts5Colset)(unsafe.Pointer(pNew)).FnCol = nCol + 1
}
@@ -176734,18 +179072,18 @@ func fts5ParseColset(tls *libc.TLS, pParse uintptr, p uintptr, iCol int32) uintp
// Allocate and return an Fts5Colset object specifying the inverse of
// the colset passed as the second argument. Free the colset passed
// as the second argument before returning.
-func sqlite3Fts5ParseColsetInvert(tls *libc.TLS, pParse uintptr, p uintptr) uintptr { /* sqlite3.c:219428:19: */
+func sqlite3Fts5ParseColsetInvert(tls *libc.TLS, pParse uintptr, p uintptr) uintptr { /* sqlite3.c:221248:19: */
var pRet uintptr
var nCol int32 = (*Fts5Config)(unsafe.Pointer((*Fts5Parse)(unsafe.Pointer(pParse)).FpConfig)).FnCol
- pRet = sqlite3Fts5MallocZero(tls, (pParse + 8 /* &.rc */),
- (int64(uint32(unsafe.Sizeof(Fts5Colset{})) + (uint32(unsafe.Sizeof(int32(0))) * uint32(nCol)))))
+ pRet = sqlite3Fts5MallocZero(tls, pParse+8,
+ int64(uint32(unsafe.Sizeof(Fts5Colset{}))+uint32(unsafe.Sizeof(int32(0)))*uint32(nCol)))
if pRet != 0 {
var i int32
var iOld int32 = 0
for i = 0; i < nCol; i++ {
- if (iOld >= (*Fts5Colset)(unsafe.Pointer(p)).FnCol) || (*(*int32)(unsafe.Pointer((p + 4 /* &.aiCol */) + uintptr(iOld)*4)) != i) {
- *(*int32)(unsafe.Pointer((pRet + 4 /* &.aiCol */) + uintptr(libc.PostIncInt32(&(*Fts5Colset)(unsafe.Pointer(pRet)).FnCol, 1))*4)) = i
+ if iOld >= (*Fts5Colset)(unsafe.Pointer(p)).FnCol || *(*int32)(unsafe.Pointer(p + 4 + uintptr(iOld)*4)) != i {
+ *(*int32)(unsafe.Pointer(pRet + 4 + uintptr(libc.PostIncInt32(&(*Fts5Colset)(unsafe.Pointer(pRet)).FnCol, 1))*4)) = i
} else {
iOld++
}
@@ -176756,7 +179094,7 @@ func sqlite3Fts5ParseColsetInvert(tls *libc.TLS, pParse uintptr, p uintptr) uint
return pRet
}
-func sqlite3Fts5ParseColset(tls *libc.TLS, pParse uintptr, pColset uintptr, p uintptr) uintptr { /* sqlite3.c:219451:19: */
+func sqlite3Fts5ParseColset(tls *libc.TLS, pParse uintptr, pColset uintptr, p uintptr) uintptr { /* sqlite3.c:221271:19: */
bp := tls.Alloc(8)
defer tls.Free(8)
@@ -176764,7 +179102,7 @@ func sqlite3Fts5ParseColset(tls *libc.TLS, pParse uintptr, pColset uintptr, p ui
var iCol int32
var z uintptr // Dequoted copy of token p
- z = sqlite3Fts5Strndup(tls, (pParse + 8 /* &.rc */), (*Fts5Token)(unsafe.Pointer(p)).Fp, (*Fts5Token)(unsafe.Pointer(p)).Fn)
+ z = sqlite3Fts5Strndup(tls, pParse+8, (*Fts5Token)(unsafe.Pointer(p)).Fp, (*Fts5Token)(unsafe.Pointer(p)).Fn)
if (*Fts5Parse)(unsafe.Pointer(pParse)).Frc == SQLITE_OK {
var pConfig uintptr = (*Fts5Parse)(unsafe.Pointer(pParse)).FpConfig
sqlite3Fts5Dequote(tls, z)
@@ -176774,7 +179112,7 @@ func sqlite3Fts5ParseColset(tls *libc.TLS, pParse uintptr, pColset uintptr, p ui
}
}
if iCol == (*Fts5Config)(unsafe.Pointer(pConfig)).FnCol {
- sqlite3Fts5ParseError(tls, pParse, ts+18880 /* "no such column: ..." */, libc.VaList(bp, z))
+ sqlite3Fts5ParseError(tls, pParse, ts+20177 /* "no such column: ..." */, libc.VaList(bp, z))
} else {
pRet = fts5ParseColset(tls, pParse, pColset, iCol)
}
@@ -176795,10 +179133,10 @@ func sqlite3Fts5ParseColset(tls *libc.TLS, pParse uintptr, pColset uintptr, p ui
// Otherwise, a copy of (*pOrig) is made into memory obtained from
// sqlite3Fts5MallocZero() and a pointer to it returned. If the allocation
// fails, (*pRc) is set to SQLITE_NOMEM and NULL is returned.
-func fts5CloneColset(tls *libc.TLS, pRc uintptr, pOrig uintptr) uintptr { /* sqlite3.c:219491:19: */
+func fts5CloneColset(tls *libc.TLS, pRc uintptr, pOrig uintptr) uintptr { /* sqlite3.c:221311:19: */
var pRet uintptr
if pOrig != 0 {
- var nByte Sqlite3_int64 = (Sqlite3_int64(uint32(unsafe.Sizeof(Fts5Colset{})) + ((uint32((*Fts5Colset)(unsafe.Pointer(pOrig)).FnCol - 1)) * uint32(unsafe.Sizeof(int32(0))))))
+ var nByte Sqlite3_int64 = Sqlite3_int64(uint32(unsafe.Sizeof(Fts5Colset{})) + uint32((*Fts5Colset)(unsafe.Pointer(pOrig)).FnCol-1)*uint32(unsafe.Sizeof(int32(0))))
pRet = sqlite3Fts5MallocZero(tls, pRc, nByte)
if pRet != 0 {
libc.Xmemcpy(tls, pRet, pOrig, Size_t(nByte))
@@ -176810,15 +179148,15 @@ func fts5CloneColset(tls *libc.TLS, pRc uintptr, pOrig uintptr) uintptr { /* sql
}
// Remove from colset pColset any columns that are not also in colset pMerge.
-func fts5MergeColset(tls *libc.TLS, pColset uintptr, pMerge uintptr) { /* sqlite3.c:219508:13: */
+func fts5MergeColset(tls *libc.TLS, pColset uintptr, pMerge uintptr) { /* sqlite3.c:221328:13: */
var iIn int32 = 0 // Next input in pColset
var iMerge int32 = 0 // Next input in pMerge
var iOut int32 = 0 // Next output slot in pColset
- for (iIn < (*Fts5Colset)(unsafe.Pointer(pColset)).FnCol) && (iMerge < (*Fts5Colset)(unsafe.Pointer(pMerge)).FnCol) {
- var iDiff int32 = (*(*int32)(unsafe.Pointer((pColset + 4 /* &.aiCol */) + uintptr(iIn)*4)) - *(*int32)(unsafe.Pointer((pMerge + 4 /* &.aiCol */) + uintptr(iMerge)*4)))
+ for iIn < (*Fts5Colset)(unsafe.Pointer(pColset)).FnCol && iMerge < (*Fts5Colset)(unsafe.Pointer(pMerge)).FnCol {
+ var iDiff int32 = *(*int32)(unsafe.Pointer(pColset + 4 + uintptr(iIn)*4)) - *(*int32)(unsafe.Pointer(pMerge + 4 + uintptr(iMerge)*4))
if iDiff == 0 {
- *(*int32)(unsafe.Pointer((pColset + 4 /* &.aiCol */) + uintptr(libc.PostIncInt32(&iOut, 1))*4)) = *(*int32)(unsafe.Pointer((pMerge + 4 /* &.aiCol */) + uintptr(iMerge)*4))
+ *(*int32)(unsafe.Pointer(pColset + 4 + uintptr(libc.PostIncInt32(&iOut, 1))*4)) = *(*int32)(unsafe.Pointer(pMerge + 4 + uintptr(iMerge)*4))
iMerge++
iIn++
} else if iDiff > 0 {
@@ -176834,10 +179172,10 @@ func fts5MergeColset(tls *libc.TLS, pColset uintptr, pMerge uintptr) { /* sqlite
// its decendents. If (*ppFree) is not NULL, it contains a spare copy
// of pColset. This function may use the spare copy and set (*ppFree) to
// zero, or it may create copies of pColset using fts5CloneColset().
-func fts5ParseSetColset(tls *libc.TLS, pParse uintptr, pNode uintptr, pColset uintptr, ppFree uintptr) { /* sqlite3.c:219534:13: */
+func fts5ParseSetColset(tls *libc.TLS, pParse uintptr, pNode uintptr, pColset uintptr, ppFree uintptr) { /* sqlite3.c:221354:13: */
if (*Fts5Parse)(unsafe.Pointer(pParse)).Frc == SQLITE_OK {
- if ((*Fts5ExprNode)(unsafe.Pointer(pNode)).FeType == FTS5_STRING) || ((*Fts5ExprNode)(unsafe.Pointer(pNode)).FeType == FTS5_TERM) {
+ if (*Fts5ExprNode)(unsafe.Pointer(pNode)).FeType == FTS5_STRING || (*Fts5ExprNode)(unsafe.Pointer(pNode)).FeType == FTS5_TERM {
var pNear uintptr = (*Fts5ExprNode)(unsafe.Pointer(pNode)).FpNear
if (*Fts5ExprNearset)(unsafe.Pointer(pNear)).FpColset != 0 {
fts5MergeColset(tls, (*Fts5ExprNearset)(unsafe.Pointer(pNear)).FpColset, pColset)
@@ -176849,42 +179187,41 @@ func fts5ParseSetColset(tls *libc.TLS, pParse uintptr, pNode uintptr, pColset ui
(*Fts5ExprNearset)(unsafe.Pointer(pNear)).FpColset = pColset
*(*uintptr)(unsafe.Pointer(ppFree)) = uintptr(0)
} else {
- (*Fts5ExprNearset)(unsafe.Pointer(pNear)).FpColset = fts5CloneColset(tls, (pParse + 8 /* &.rc */), pColset)
+ (*Fts5ExprNearset)(unsafe.Pointer(pNear)).FpColset = fts5CloneColset(tls, pParse+8, pColset)
}
} else {
var i int32
for i = 0; i < (*Fts5ExprNode)(unsafe.Pointer(pNode)).FnChild; i++ {
- fts5ParseSetColset(tls, pParse, *(*uintptr)(unsafe.Pointer((pNode + 32 /* &.apChild */) + uintptr(i)*4)), pColset, ppFree)
+ fts5ParseSetColset(tls, pParse, *(*uintptr)(unsafe.Pointer(pNode + 32 + uintptr(i)*4)), pColset, ppFree)
}
}
}
}
// Apply colset pColset to expression node pExpr and all of its descendents.
-func sqlite3Fts5ParseSetColset(tls *libc.TLS, pParse uintptr, pExpr uintptr, pColset uintptr) { /* sqlite3.c:219572:13: */
+func sqlite3Fts5ParseSetColset(tls *libc.TLS, pParse uintptr, pExpr uintptr, pColset uintptr) { /* sqlite3.c:221392:13: */
bp := tls.Alloc(4)
defer tls.Free(4)
*(*uintptr)(unsafe.Pointer(bp /* pFree */)) = pColset
if (*Fts5Config)(unsafe.Pointer((*Fts5Parse)(unsafe.Pointer(pParse)).FpConfig)).FeDetail == FTS5_DETAIL_NONE {
- (*Fts5Parse)(unsafe.Pointer(pParse)).Frc = SQLITE_ERROR
- (*Fts5Parse)(unsafe.Pointer(pParse)).FzErr = Xsqlite3_mprintf(tls,
- ts+32915 /* "fts5: column que..." */, 0)
+ sqlite3Fts5ParseError(tls, pParse,
+ ts+34275 /* "fts5: column que..." */, 0)
} else {
fts5ParseSetColset(tls, pParse, pExpr, pColset, bp /* &pFree */)
}
Xsqlite3_free(tls, *(*uintptr)(unsafe.Pointer(bp /* pFree */)))
}
-func fts5ExprAssignXNext(tls *libc.TLS, pNode uintptr) { /* sqlite3.c:219589:13: */
+func fts5ExprAssignXNext(tls *libc.TLS, pNode uintptr) { /* sqlite3.c:221408:13: */
switch (*Fts5ExprNode)(unsafe.Pointer(pNode)).FeType {
case FTS5_STRING:
{
var pNear uintptr = (*Fts5ExprNode)(unsafe.Pointer(pNode)).FpNear
- if ((((*Fts5ExprNearset)(unsafe.Pointer(pNear)).FnPhrase == 1) && ((*Fts5ExprPhrase)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((pNear + 12 /* &.apPhrase */))))).FnTerm == 1)) &&
- ((*Fts5ExprTerm)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer((pNear + 12 /* &.apPhrase */))) + 20 /* &.aTerm */))).FpSynonym == uintptr(0))) &&
- (int32((*Fts5ExprTerm)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer((pNear + 12 /* &.apPhrase */))) + 20 /* &.aTerm */))).FbFirst) == 0) {
+ if (*Fts5ExprNearset)(unsafe.Pointer(pNear)).FnPhrase == 1 && (*Fts5ExprPhrase)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pNear + 12)))).FnTerm == 1 &&
+ (*Fts5ExprTerm)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pNear + 12))+20)).FpSynonym == uintptr(0) &&
+ int32((*Fts5ExprTerm)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pNear + 12))+20)).FbFirst) == 0 {
(*Fts5ExprNode)(unsafe.Pointer(pNode)).FeType = FTS5_TERM
(*Fts5ExprNode)(unsafe.Pointer(pNode)).FxNext = *(*uintptr)(unsafe.Pointer(&struct {
f func(*libc.TLS, uintptr, uintptr, int32, I64) int32
@@ -176928,14 +179265,14 @@ func fts5ExprAssignXNext(tls *libc.TLS, pNode uintptr) { /* sqlite3.c:219589:13:
}
}
-func fts5ExprAddChildren(tls *libc.TLS, p uintptr, pSub uintptr) { /* sqlite3.c:219622:13: */
- if ((*Fts5ExprNode)(unsafe.Pointer(p)).FeType != FTS5_NOT) && ((*Fts5ExprNode)(unsafe.Pointer(pSub)).FeType == (*Fts5ExprNode)(unsafe.Pointer(p)).FeType) {
- var nByte int32 = (int32(uint32(unsafe.Sizeof(uintptr(0))) * uint32((*Fts5ExprNode)(unsafe.Pointer(pSub)).FnChild)))
- libc.Xmemcpy(tls, ((p + 32 /* &.apChild */) + uintptr((*Fts5ExprNode)(unsafe.Pointer(p)).FnChild)*4), pSub+32 /* &.apChild */, uint32(nByte))
- *(*int32)(unsafe.Pointer(p + 28 /* &.nChild */)) += ((*Fts5ExprNode)(unsafe.Pointer(pSub)).FnChild)
+func fts5ExprAddChildren(tls *libc.TLS, p uintptr, pSub uintptr) { /* sqlite3.c:221441:13: */
+ if (*Fts5ExprNode)(unsafe.Pointer(p)).FeType != FTS5_NOT && (*Fts5ExprNode)(unsafe.Pointer(pSub)).FeType == (*Fts5ExprNode)(unsafe.Pointer(p)).FeType {
+ var nByte int32 = int32(uint32(unsafe.Sizeof(uintptr(0))) * uint32((*Fts5ExprNode)(unsafe.Pointer(pSub)).FnChild))
+ libc.Xmemcpy(tls, p+32+uintptr((*Fts5ExprNode)(unsafe.Pointer(p)).FnChild)*4, pSub+32, uint32(nByte))
+ *(*int32)(unsafe.Pointer(p + 28)) += (*Fts5ExprNode)(unsafe.Pointer(pSub)).FnChild
Xsqlite3_free(tls, pSub)
} else {
- *(*uintptr)(unsafe.Pointer((p + 32 /* &.apChild */) + uintptr(libc.PostIncInt32(&(*Fts5ExprNode)(unsafe.Pointer(p)).FnChild, 1))*4)) = pSub
+ *(*uintptr)(unsafe.Pointer(p + 32 + uintptr(libc.PostIncInt32(&(*Fts5ExprNode)(unsafe.Pointer(p)).FnChild, 1))*4)) = pSub
}
}
@@ -176948,14 +179285,14 @@ func fts5ExprAddChildren(tls *libc.TLS, p uintptr, pSub uintptr) { /* sqlite3.c:
// into an AND tree:
//
// abc AND def AND ghi
-func fts5ParsePhraseToAnd(tls *libc.TLS, pParse uintptr, pNear uintptr) uintptr { /* sqlite3.c:219644:21: */
- var nTerm int32 = (*Fts5ExprPhrase)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((pNear + 12 /* &.apPhrase */))))).FnTerm
+func fts5ParsePhraseToAnd(tls *libc.TLS, pParse uintptr, pNear uintptr) uintptr { /* sqlite3.c:221463:21: */
+ var nTerm int32 = (*Fts5ExprPhrase)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pNear + 12)))).FnTerm
var ii int32
var nByte int32
var pRet uintptr
- nByte = (int32(uint32(unsafe.Sizeof(Fts5ExprNode{})) + (uint32(nTerm) * uint32(unsafe.Sizeof(uintptr(0))))))
- pRet = sqlite3Fts5MallocZero(tls, (pParse + 8 /* &.rc */), int64(nByte))
+ nByte = int32(uint32(unsafe.Sizeof(Fts5ExprNode{})) + uint32(nTerm)*uint32(unsafe.Sizeof(uintptr(0))))
+ pRet = sqlite3Fts5MallocZero(tls, pParse+8, int64(nByte))
if pRet != 0 {
(*Fts5ExprNode)(unsafe.Pointer(pRet)).FeType = FTS5_AND
(*Fts5ExprNode)(unsafe.Pointer(pRet)).FnChild = nTerm
@@ -176963,16 +179300,16 @@ func fts5ParsePhraseToAnd(tls *libc.TLS, pParse uintptr, pNear uintptr) uintptr
(*Fts5Parse)(unsafe.Pointer(pParse)).FnPhrase--
for ii = 0; ii < nTerm; ii++ {
var pPhrase uintptr = sqlite3Fts5MallocZero(tls,
- (pParse + 8 /* &.rc */), int64(unsafe.Sizeof(Fts5ExprPhrase{})))
+ pParse+8, int64(unsafe.Sizeof(Fts5ExprPhrase{})))
if pPhrase != 0 {
if parseGrowPhraseArray(tls, pParse) != 0 {
fts5ExprPhraseFree(tls, pPhrase)
} else {
*(*uintptr)(unsafe.Pointer((*Fts5Parse)(unsafe.Pointer(pParse)).FapPhrase + uintptr(libc.PostIncInt32(&(*Fts5Parse)(unsafe.Pointer(pParse)).FnPhrase, 1))*4)) = pPhrase
(*Fts5ExprPhrase)(unsafe.Pointer(pPhrase)).FnTerm = 1
- (*Fts5ExprTerm)(unsafe.Pointer((pPhrase + 20 /* &.aTerm */))).FzTerm = sqlite3Fts5Strndup(tls,
- (pParse + 8 /* &.rc */), (*Fts5ExprTerm)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer((pNear + 12 /* &.apPhrase */)))+20 /* &.aTerm */)+uintptr(ii)*16)).FzTerm, -1)
- *(*uintptr)(unsafe.Pointer((pRet + 32 /* &.apChild */) + uintptr(ii)*4)) = sqlite3Fts5ParseNode(tls, pParse, FTS5_STRING,
+ (*Fts5ExprTerm)(unsafe.Pointer(pPhrase + 20)).FzTerm = sqlite3Fts5Strndup(tls,
+ pParse+8, (*Fts5ExprTerm)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pNear + 12))+20+uintptr(ii)*16)).FzTerm, -1)
+ *(*uintptr)(unsafe.Pointer(pRet + 32 + uintptr(ii)*4)) = sqlite3Fts5ParseNode(tls, pParse, FTS5_STRING,
uintptr(0), uintptr(0), sqlite3Fts5ParseNearset(tls, pParse, uintptr(0), pPhrase))
}
}
@@ -176991,7 +179328,7 @@ func fts5ParsePhraseToAnd(tls *libc.TLS, pParse uintptr, pNear uintptr) uintptr
// Allocate and return a new expression object. If anything goes wrong (i.e.
// OOM error), leave an error code in pParse and return NULL.
-func sqlite3Fts5ParseNode(tls *libc.TLS, pParse uintptr, eType int32, pLeft uintptr, pRight uintptr, pNear uintptr) uintptr { /* sqlite3.c:219698:21: */
+func sqlite3Fts5ParseNode(tls *libc.TLS, pParse uintptr, eType int32, pLeft uintptr, pRight uintptr, pNear uintptr) uintptr { /* sqlite3.c:221517:21: */
bp := tls.Alloc(8)
defer tls.Free(8)
@@ -177001,24 +179338,24 @@ func sqlite3Fts5ParseNode(tls *libc.TLS, pParse uintptr, eType int32, pLeft uint
var nChild int32 = 0 // Number of children of returned node
var nByte Sqlite3_int64 // Bytes of space to allocate for this node
- if (eType == FTS5_STRING) && (pNear == uintptr(0)) {
+ if eType == FTS5_STRING && pNear == uintptr(0) {
return uintptr(0)
}
- if (eType != FTS5_STRING) && (pLeft == uintptr(0)) {
+ if eType != FTS5_STRING && pLeft == uintptr(0) {
return pRight
}
- if (eType != FTS5_STRING) && (pRight == uintptr(0)) {
+ if eType != FTS5_STRING && pRight == uintptr(0) {
return pLeft
}
- if ((eType == FTS5_STRING) &&
- ((*Fts5Parse)(unsafe.Pointer(pParse)).FbPhraseToAnd != 0)) &&
- ((*Fts5ExprPhrase)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((pNear + 12 /* &.apPhrase */))))).FnTerm > 1) {
+ if eType == FTS5_STRING &&
+ (*Fts5Parse)(unsafe.Pointer(pParse)).FbPhraseToAnd != 0 &&
+ (*Fts5ExprPhrase)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pNear + 12)))).FnTerm > 1 {
pRet = fts5ParsePhraseToAnd(tls, pParse, pNear)
} else {
if eType == FTS5_NOT {
nChild = 2
- } else if (eType == FTS5_AND) || (eType == FTS5_OR) {
+ } else if eType == FTS5_AND || eType == FTS5_OR {
nChild = 2
if (*Fts5ExprNode)(unsafe.Pointer(pLeft)).FeType == eType {
nChild = nChild + ((*Fts5ExprNode)(unsafe.Pointer(pLeft)).FnChild - 1)
@@ -177028,8 +179365,8 @@ func sqlite3Fts5ParseNode(tls *libc.TLS, pParse uintptr, eType int32, pLeft uint
}
}
- nByte = (Sqlite3_int64(uint32(unsafe.Sizeof(Fts5ExprNode{})) + (uint32(unsafe.Sizeof(uintptr(0))) * (uint32(nChild - 1)))))
- pRet = sqlite3Fts5MallocZero(tls, (pParse + 8 /* &.rc */), nByte)
+ nByte = Sqlite3_int64(uint32(unsafe.Sizeof(Fts5ExprNode{})) + uint32(unsafe.Sizeof(uintptr(0)))*uint32(nChild-1))
+ pRet = sqlite3Fts5MallocZero(tls, pParse+8, nByte)
if pRet != 0 {
(*Fts5ExprNode)(unsafe.Pointer(pRet)).FeType = eType
@@ -177038,28 +179375,25 @@ func sqlite3Fts5ParseNode(tls *libc.TLS, pParse uintptr, eType int32, pLeft uint
if eType == FTS5_STRING {
var iPhrase int32
for iPhrase = 0; iPhrase < (*Fts5ExprNearset)(unsafe.Pointer(pNear)).FnPhrase; iPhrase++ {
- (*Fts5ExprPhrase)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((pNear + 12 /* &.apPhrase */) + uintptr(iPhrase)*4)))).FpNode = pRet
- if (*Fts5ExprPhrase)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((pNear + 12 /* &.apPhrase */) + uintptr(iPhrase)*4)))).FnTerm == 0 {
+ (*Fts5ExprPhrase)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pNear + 12 + uintptr(iPhrase)*4)))).FpNode = pRet
+ if (*Fts5ExprPhrase)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pNear + 12 + uintptr(iPhrase)*4)))).FnTerm == 0 {
(*Fts5ExprNode)(unsafe.Pointer(pRet)).FxNext = uintptr(0)
(*Fts5ExprNode)(unsafe.Pointer(pRet)).FeType = FTS5_EOF
}
}
if (*Fts5Config)(unsafe.Pointer((*Fts5Parse)(unsafe.Pointer(pParse)).FpConfig)).FeDetail != FTS5_DETAIL_FULL {
- var pPhrase uintptr = *(*uintptr)(unsafe.Pointer((pNear + 12 /* &.apPhrase */)))
- if (((*Fts5ExprNearset)(unsafe.Pointer(pNear)).FnPhrase != 1) ||
- ((*Fts5ExprPhrase)(unsafe.Pointer(pPhrase)).FnTerm > 1)) ||
- (((*Fts5ExprPhrase)(unsafe.Pointer(pPhrase)).FnTerm > 0) && ((*Fts5ExprTerm)(unsafe.Pointer((pPhrase + 20 /* &.aTerm */))).FbFirst != 0)) {
-
- (*Fts5Parse)(unsafe.Pointer(pParse)).Frc = SQLITE_ERROR
-
- (*Fts5Parse)(unsafe.Pointer(pParse)).FzErr = Xsqlite3_mprintf(tls,
- ts+32968, /* "fts5: %s queries..." */
+ var pPhrase uintptr = *(*uintptr)(unsafe.Pointer(pNear + 12))
+ if (*Fts5ExprNearset)(unsafe.Pointer(pNear)).FnPhrase != 1 ||
+ (*Fts5ExprPhrase)(unsafe.Pointer(pPhrase)).FnTerm > 1 ||
+ (*Fts5ExprPhrase)(unsafe.Pointer(pPhrase)).FnTerm > 0 && (*Fts5ExprTerm)(unsafe.Pointer(pPhrase+20)).FbFirst != 0 {
+ sqlite3Fts5ParseError(tls, pParse,
+ ts+34328, /* "fts5: %s queries..." */
libc.VaList(bp, func() uintptr {
if (*Fts5ExprNearset)(unsafe.Pointer(pNear)).FnPhrase == 1 {
- return ts + 33018 /* "phrase" */
+ return ts + 34378 /* "phrase" */
}
- return ts + 32881 /* "NEAR" */
+ return ts + 34241 /* "NEAR" */
}()))
Xsqlite3_free(tls, pRet)
pRet = uintptr(0)
@@ -177082,7 +179416,7 @@ func sqlite3Fts5ParseNode(tls *libc.TLS, pParse uintptr, eType int32, pLeft uint
return pRet
}
-func sqlite3Fts5ParseImplicitAnd(tls *libc.TLS, pParse uintptr, pLeft uintptr, pRight uintptr) uintptr { /* sqlite3.c:219783:21: */
+func sqlite3Fts5ParseImplicitAnd(tls *libc.TLS, pParse uintptr, pLeft uintptr, pRight uintptr) uintptr { /* sqlite3.c:221599:21: */
var pRet uintptr = uintptr(0)
var pPrev uintptr
@@ -177092,7 +179426,7 @@ func sqlite3Fts5ParseImplicitAnd(tls *libc.TLS, pParse uintptr, pLeft uintptr, p
} else {
if (*Fts5ExprNode)(unsafe.Pointer(pLeft)).FeType == FTS5_AND {
- pPrev = *(*uintptr)(unsafe.Pointer((pLeft + 32 /* &.apChild */) + uintptr(((*Fts5ExprNode)(unsafe.Pointer(pLeft)).FnChild-1))*4))
+ pPrev = *(*uintptr)(unsafe.Pointer(pLeft + 32 + uintptr((*Fts5ExprNode)(unsafe.Pointer(pLeft)).FnChild-1)*4))
} else {
pPrev = pLeft
}
@@ -177108,13 +179442,13 @@ func sqlite3Fts5ParseImplicitAnd(tls *libc.TLS, pParse uintptr, pLeft uintptr, p
if pPrev == pLeft {
pRet = pRight
} else {
- *(*uintptr)(unsafe.Pointer((pLeft + 32 /* &.apChild */) + uintptr(((*Fts5ExprNode)(unsafe.Pointer(pLeft)).FnChild-1))*4)) = pRight
+ *(*uintptr)(unsafe.Pointer(pLeft + 32 + uintptr((*Fts5ExprNode)(unsafe.Pointer(pLeft)).FnChild-1)*4)) = pRight
pRet = pLeft
}
- ap = ((*Fts5Parse)(unsafe.Pointer(pParse)).FapPhrase + uintptr((((*Fts5Parse)(unsafe.Pointer(pParse)).FnPhrase-1)-(*Fts5ExprNearset)(unsafe.Pointer((*Fts5ExprNode)(unsafe.Pointer(pRight)).FpNear)).FnPhrase))*4)
+ ap = (*Fts5Parse)(unsafe.Pointer(pParse)).FapPhrase + uintptr((*Fts5Parse)(unsafe.Pointer(pParse)).FnPhrase-1-(*Fts5ExprNearset)(unsafe.Pointer((*Fts5ExprNode)(unsafe.Pointer(pRight)).FpNear)).FnPhrase)*4
- libc.Xmemmove(tls, ap, (ap + 1*4), (uint32(unsafe.Sizeof(uintptr(0))) * uint32((*Fts5ExprNearset)(unsafe.Pointer((*Fts5ExprNode)(unsafe.Pointer(pRight)).FpNear)).FnPhrase)))
+ libc.Xmemmove(tls, ap, ap+1*4, uint32(unsafe.Sizeof(uintptr(0)))*uint32((*Fts5ExprNearset)(unsafe.Pointer((*Fts5ExprNode)(unsafe.Pointer(pRight)).FpNear)).FnPhrase))
(*Fts5Parse)(unsafe.Pointer(pParse)).FnPhrase--
sqlite3Fts5ParseNodeFree(tls, pPrev)
@@ -177128,7 +179462,7 @@ func sqlite3Fts5ParseImplicitAnd(tls *libc.TLS, pParse uintptr, pLeft uintptr, p
// This is called during initialization to register the fts5_expr() scalar
// UDF with the SQLite handle passed as the only argument.
-func sqlite3Fts5ExprInit(tls *libc.TLS, pGlobal uintptr, db uintptr) int32 { /* sqlite3.c:220220:12: */
+func sqlite3Fts5ExprInit(tls *libc.TLS, pGlobal uintptr, db uintptr) int32 { /* sqlite3.c:222036:12: */
var rc int32 = SQLITE_OK
_ = pGlobal
_ = db
@@ -177141,7 +179475,7 @@ func sqlite3Fts5ExprInit(tls *libc.TLS, pGlobal uintptr, db uintptr) int32 { /*
}
// Return the number of phrases in expression pExpr.
-func sqlite3Fts5ExprPhraseCount(tls *libc.TLS, pExpr uintptr) int32 { /* sqlite3.c:220257:12: */
+func sqlite3Fts5ExprPhraseCount(tls *libc.TLS, pExpr uintptr) int32 { /* sqlite3.c:222073:12: */
return func() int32 {
if pExpr != 0 {
return (*Fts5Expr)(unsafe.Pointer(pExpr)).FnPhrase
@@ -177151,8 +179485,8 @@ func sqlite3Fts5ExprPhraseCount(tls *libc.TLS, pExpr uintptr) int32 { /* sqlite3
}
// Return the number of terms in the iPhrase'th phrase in pExpr.
-func sqlite3Fts5ExprPhraseSize(tls *libc.TLS, pExpr uintptr, iPhrase int32) int32 { /* sqlite3.c:220264:12: */
- if (iPhrase < 0) || (iPhrase >= (*Fts5Expr)(unsafe.Pointer(pExpr)).FnPhrase) {
+func sqlite3Fts5ExprPhraseSize(tls *libc.TLS, pExpr uintptr, iPhrase int32) int32 { /* sqlite3.c:222080:12: */
+ if iPhrase < 0 || iPhrase >= (*Fts5Expr)(unsafe.Pointer(pExpr)).FnPhrase {
return 0
}
return (*Fts5ExprPhrase)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((*Fts5Expr)(unsafe.Pointer(pExpr)).FapExprPhrase + uintptr(iPhrase)*4)))).FnTerm
@@ -177160,11 +179494,11 @@ func sqlite3Fts5ExprPhraseSize(tls *libc.TLS, pExpr uintptr, iPhrase int32) int3
// This function is used to access the current position list for phrase
// iPhrase.
-func sqlite3Fts5ExprPoslist(tls *libc.TLS, pExpr uintptr, iPhrase int32, pa uintptr) int32 { /* sqlite3.c:220273:12: */
+func sqlite3Fts5ExprPoslist(tls *libc.TLS, pExpr uintptr, iPhrase int32, pa uintptr) int32 { /* sqlite3.c:222089:12: */
var nRet int32
var pPhrase uintptr = *(*uintptr)(unsafe.Pointer((*Fts5Expr)(unsafe.Pointer(pExpr)).FapExprPhrase + uintptr(iPhrase)*4))
var pNode uintptr = (*Fts5ExprPhrase)(unsafe.Pointer(pPhrase)).FpNode
- if ((*Fts5ExprNode)(unsafe.Pointer(pNode)).FbEof == 0) && ((*Fts5ExprNode)(unsafe.Pointer(pNode)).FiRowid == (*Fts5ExprNode)(unsafe.Pointer((*Fts5Expr)(unsafe.Pointer(pExpr)).FpRoot)).FiRowid) {
+ if (*Fts5ExprNode)(unsafe.Pointer(pNode)).FbEof == 0 && (*Fts5ExprNode)(unsafe.Pointer(pNode)).FiRowid == (*Fts5ExprNode)(unsafe.Pointer((*Fts5Expr)(unsafe.Pointer(pExpr)).FpRoot)).FiRowid {
*(*uintptr)(unsafe.Pointer(pa)) = (*Fts5ExprPhrase)(unsafe.Pointer(pPhrase)).Fposlist.Fp
nRet = (*Fts5ExprPhrase)(unsafe.Pointer(pPhrase)).Fposlist.Fn
} else {
@@ -177174,17 +179508,24 @@ func sqlite3Fts5ExprPoslist(tls *libc.TLS, pExpr uintptr, iPhrase int32, pa uint
return nRet
}
-func sqlite3Fts5ExprClearPoslists(tls *libc.TLS, pExpr uintptr, bLive int32) uintptr { /* sqlite3.c:220293:29: */
+// Clear the position lists associated with all phrases in the expression
+// passed as the first argument. Argument bLive is true if the expression
+// might be pointing to a real entry, otherwise it has just been reset.
+//
+// At present this function is only used for detail=col and detail=none
+// fts5 tables. This implies that all phrases must be at most 1 token
+// in size, as phrase matches are not supported without detail=full.
+func sqlite3Fts5ExprClearPoslists(tls *libc.TLS, pExpr uintptr, bLive int32) uintptr { /* sqlite3.c:222118:29: */
var pRet uintptr
- pRet = Xsqlite3_malloc64(tls, (uint64(uint32(unsafe.Sizeof(Fts5PoslistPopulator{})) * uint32((*Fts5Expr)(unsafe.Pointer(pExpr)).FnPhrase))))
+ pRet = Xsqlite3_malloc64(tls, uint64(uint32(unsafe.Sizeof(Fts5PoslistPopulator{}))*uint32((*Fts5Expr)(unsafe.Pointer(pExpr)).FnPhrase)))
if pRet != 0 {
var i int32
- libc.Xmemset(tls, pRet, 0, (uint32(unsafe.Sizeof(Fts5PoslistPopulator{})) * uint32((*Fts5Expr)(unsafe.Pointer(pExpr)).FnPhrase)))
+ libc.Xmemset(tls, pRet, 0, uint32(unsafe.Sizeof(Fts5PoslistPopulator{}))*uint32((*Fts5Expr)(unsafe.Pointer(pExpr)).FnPhrase))
for i = 0; i < (*Fts5Expr)(unsafe.Pointer(pExpr)).FnPhrase; i++ {
- var pBuf uintptr = (*(*uintptr)(unsafe.Pointer((*Fts5Expr)(unsafe.Pointer(pExpr)).FapExprPhrase + uintptr(i)*4)) + 4 /* &.poslist */)
+ var pBuf uintptr = *(*uintptr)(unsafe.Pointer((*Fts5Expr)(unsafe.Pointer(pExpr)).FapExprPhrase + uintptr(i)*4)) + 4
var pNode uintptr = (*Fts5ExprPhrase)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((*Fts5Expr)(unsafe.Pointer(pExpr)).FapExprPhrase + uintptr(i)*4)))).FpNode
- if (bLive != 0) && ((((*Fts5Buffer)(unsafe.Pointer(pBuf)).Fn == 0) || ((*Fts5ExprNode)(unsafe.Pointer(pNode)).FiRowid != (*Fts5ExprNode)(unsafe.Pointer((*Fts5Expr)(unsafe.Pointer(pExpr)).FpRoot)).FiRowid)) || ((*Fts5ExprNode)(unsafe.Pointer(pNode)).FbEof != 0)) {
+ if bLive != 0 && ((*Fts5Buffer)(unsafe.Pointer(pBuf)).Fn == 0 || (*Fts5ExprNode)(unsafe.Pointer(pNode)).FiRowid != (*Fts5ExprNode)(unsafe.Pointer((*Fts5Expr)(unsafe.Pointer(pExpr)).FpRoot)).FiRowid || (*Fts5ExprNode)(unsafe.Pointer(pNode)).FbEof != 0) {
(*Fts5PoslistPopulator)(unsafe.Pointer(pRet + uintptr(i)*16)).FbMiss = 1
} else {
(*Fts5Buffer)(unsafe.Pointer(pBuf)).Fn = 0
@@ -177198,22 +179539,22 @@ type Fts5ExprCtx1 = struct {
FpExpr uintptr
FaPopulator uintptr
FiOff I64
-} /* sqlite3.c:220315:1 */
+} /* sqlite3.c:222140:1 */
-type Fts5ExprCtx = Fts5ExprCtx1 /* sqlite3.c:220320:28 */
+type Fts5ExprCtx = Fts5ExprCtx1 /* sqlite3.c:222145:28 */
// TODO: Make this more efficient!
-func fts5ExprColsetTest(tls *libc.TLS, pColset uintptr, iCol int32) int32 { /* sqlite3.c:220325:12: */
+func fts5ExprColsetTest(tls *libc.TLS, pColset uintptr, iCol int32) int32 { /* sqlite3.c:222150:12: */
var i int32
for i = 0; i < (*Fts5Colset)(unsafe.Pointer(pColset)).FnCol; i++ {
- if *(*int32)(unsafe.Pointer((pColset + 4 /* &.aiCol */) + uintptr(i)*4)) == iCol {
+ if *(*int32)(unsafe.Pointer(pColset + 4 + uintptr(i)*4)) == iCol {
return 1
}
}
return 0
}
-func fts5ExprPopulatePoslistsCb(tls *libc.TLS, pCtx uintptr, tflags int32, pToken uintptr, nToken int32, iUnused1 int32, iUnused2 int32) int32 { /* sqlite3.c:220333:12: */
+func fts5ExprPopulatePoslistsCb(tls *libc.TLS, pCtx uintptr, tflags int32, pToken uintptr, nToken int32, iUnused1 int32, iUnused2 int32) int32 { /* sqlite3.c:222158:12: */
var p uintptr = pCtx
var pExpr uintptr = (*Fts5ExprCtx)(unsafe.Pointer(p)).FpExpr
var i int32
@@ -177224,7 +179565,7 @@ func fts5ExprPopulatePoslistsCb(tls *libc.TLS, pCtx uintptr, tflags int32, pToke
if nToken > FTS5_MAX_TOKEN_SIZE {
nToken = FTS5_MAX_TOKEN_SIZE
}
- if (tflags & FTS5_TOKEN_COLOCATED) == 0 {
+ if tflags&FTS5_TOKEN_COLOCATED == 0 {
(*Fts5ExprCtx)(unsafe.Pointer(p)).FiOff++
}
for i = 0; i < (*Fts5Expr)(unsafe.Pointer(pExpr)).FnPhrase; i++ {
@@ -177232,12 +179573,12 @@ func fts5ExprPopulatePoslistsCb(tls *libc.TLS, pCtx uintptr, tflags int32, pToke
if (*Fts5PoslistPopulator)(unsafe.Pointer((*Fts5ExprCtx)(unsafe.Pointer(p)).FaPopulator+uintptr(i)*16)).FbOk == 0 {
continue
}
- for pTerm = (*(*uintptr)(unsafe.Pointer((*Fts5Expr)(unsafe.Pointer(pExpr)).FapExprPhrase + uintptr(i)*4)) + 20 /* &.aTerm */); pTerm != 0; pTerm = (*Fts5ExprTerm)(unsafe.Pointer(pTerm)).FpSynonym {
+ for pTerm = *(*uintptr)(unsafe.Pointer((*Fts5Expr)(unsafe.Pointer(pExpr)).FapExprPhrase + uintptr(i)*4)) + 20; pTerm != 0; pTerm = (*Fts5ExprTerm)(unsafe.Pointer(pTerm)).FpSynonym {
var nTerm int32 = int32(libc.Xstrlen(tls, (*Fts5ExprTerm)(unsafe.Pointer(pTerm)).FzTerm))
- if ((nTerm == nToken) || ((nTerm < nToken) && ((*Fts5ExprTerm)(unsafe.Pointer(pTerm)).FbPrefix != 0))) &&
- (libc.Xmemcmp(tls, (*Fts5ExprTerm)(unsafe.Pointer(pTerm)).FzTerm, pToken, uint32(nTerm)) == 0) {
+ if (nTerm == nToken || nTerm < nToken && (*Fts5ExprTerm)(unsafe.Pointer(pTerm)).FbPrefix != 0) &&
+ libc.Xmemcmp(tls, (*Fts5ExprTerm)(unsafe.Pointer(pTerm)).FzTerm, pToken, uint32(nTerm)) == 0 {
var rc int32 = sqlite3Fts5PoslistWriterAppend(tls,
- (*(*uintptr)(unsafe.Pointer((*Fts5Expr)(unsafe.Pointer(pExpr)).FapExprPhrase + uintptr(i)*4)) + 4 /* &.poslist */), ((*Fts5ExprCtx)(unsafe.Pointer(p)).FaPopulator + uintptr(i)*16 /* &.writer */), (*Fts5ExprCtx)(unsafe.Pointer(p)).FiOff)
+ *(*uintptr)(unsafe.Pointer((*Fts5Expr)(unsafe.Pointer(pExpr)).FapExprPhrase + uintptr(i)*4))+4, (*Fts5ExprCtx)(unsafe.Pointer(p)).FaPopulator+uintptr(i)*16, (*Fts5ExprCtx)(unsafe.Pointer(p)).FiOff)
if rc != 0 {
return rc
}
@@ -177248,7 +179589,7 @@ func fts5ExprPopulatePoslistsCb(tls *libc.TLS, pCtx uintptr, tflags int32, pToke
return SQLITE_OK
}
-func sqlite3Fts5ExprPopulatePoslists(tls *libc.TLS, pConfig uintptr, pExpr uintptr, aPopulator uintptr, iCol int32, z uintptr, n int32) int32 { /* sqlite3.c:220368:12: */
+func sqlite3Fts5ExprPopulatePoslists(tls *libc.TLS, pConfig uintptr, pExpr uintptr, aPopulator uintptr, iCol int32, z uintptr, n int32) int32 { /* sqlite3.c:222193:12: */
bp := tls.Alloc(16)
defer tls.Free(16)
@@ -177257,13 +179598,13 @@ func sqlite3Fts5ExprPopulatePoslists(tls *libc.TLS, pConfig uintptr, pExpr uintp
(*Fts5ExprCtx)(unsafe.Pointer(bp /* &sCtx */)).FpExpr = pExpr
(*Fts5ExprCtx)(unsafe.Pointer(bp /* &sCtx */)).FaPopulator = aPopulator
- (*Fts5ExprCtx)(unsafe.Pointer(bp /* &sCtx */)).FiOff = (((I64(iCol)) << 32) - int64(1))
+ (*Fts5ExprCtx)(unsafe.Pointer(bp /* &sCtx */)).FiOff = I64(iCol)<<32 - int64(1)
for i = 0; i < (*Fts5Expr)(unsafe.Pointer(pExpr)).FnPhrase; i++ {
var pNode uintptr = (*Fts5ExprPhrase)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((*Fts5Expr)(unsafe.Pointer(pExpr)).FapExprPhrase + uintptr(i)*4)))).FpNode
var pColset uintptr = (*Fts5ExprNearset)(unsafe.Pointer((*Fts5ExprNode)(unsafe.Pointer(pNode)).FpNear)).FpColset
- if ((pColset != 0) && (0 == fts5ExprColsetTest(tls, pColset, iCol))) ||
- ((*Fts5PoslistPopulator)(unsafe.Pointer(aPopulator+uintptr(i)*16)).FbMiss != 0) {
+ if pColset != 0 && 0 == fts5ExprColsetTest(tls, pColset, iCol) ||
+ (*Fts5PoslistPopulator)(unsafe.Pointer(aPopulator+uintptr(i)*16)).FbMiss != 0 {
(*Fts5PoslistPopulator)(unsafe.Pointer(aPopulator + uintptr(i)*16)).FbOk = 0
} else {
(*Fts5PoslistPopulator)(unsafe.Pointer(aPopulator + uintptr(i)*16)).FbOk = 1
@@ -177276,31 +179617,31 @@ func sqlite3Fts5ExprPopulatePoslists(tls *libc.TLS, pConfig uintptr, pExpr uintp
}{fts5ExprPopulatePoslistsCb})))
}
-func fts5ExprClearPoslists(tls *libc.TLS, pNode uintptr) { /* sqlite3.c:220398:13: */
- if ((*Fts5ExprNode)(unsafe.Pointer(pNode)).FeType == FTS5_TERM) || ((*Fts5ExprNode)(unsafe.Pointer(pNode)).FeType == FTS5_STRING) {
- (*Fts5ExprPhrase)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(((*Fts5ExprNode)(unsafe.Pointer(pNode)).FpNear + 12 /* &.apPhrase */))))).Fposlist.Fn = 0
+func fts5ExprClearPoslists(tls *libc.TLS, pNode uintptr) { /* sqlite3.c:222223:13: */
+ if (*Fts5ExprNode)(unsafe.Pointer(pNode)).FeType == FTS5_TERM || (*Fts5ExprNode)(unsafe.Pointer(pNode)).FeType == FTS5_STRING {
+ (*Fts5ExprPhrase)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((*Fts5ExprNode)(unsafe.Pointer(pNode)).FpNear + 12)))).Fposlist.Fn = 0
} else {
var i int32
for i = 0; i < (*Fts5ExprNode)(unsafe.Pointer(pNode)).FnChild; i++ {
- fts5ExprClearPoslists(tls, *(*uintptr)(unsafe.Pointer((pNode + 32 /* &.apChild */) + uintptr(i)*4)))
+ fts5ExprClearPoslists(tls, *(*uintptr)(unsafe.Pointer(pNode + 32 + uintptr(i)*4)))
}
}
}
-func fts5ExprCheckPoslists(tls *libc.TLS, pNode uintptr, iRowid I64) int32 { /* sqlite3.c:220409:12: */
+func fts5ExprCheckPoslists(tls *libc.TLS, pNode uintptr, iRowid I64) int32 { /* sqlite3.c:222234:12: */
(*Fts5ExprNode)(unsafe.Pointer(pNode)).FiRowid = iRowid
(*Fts5ExprNode)(unsafe.Pointer(pNode)).FbEof = 0
switch (*Fts5ExprNode)(unsafe.Pointer(pNode)).FeType {
case FTS5_TERM:
fallthrough
case FTS5_STRING:
- return (libc.Bool32((*Fts5ExprPhrase)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(((*Fts5ExprNode)(unsafe.Pointer(pNode)).FpNear + 12 /* &.apPhrase */))))).Fposlist.Fn > 0))
+ return libc.Bool32((*Fts5ExprPhrase)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((*Fts5ExprNode)(unsafe.Pointer(pNode)).FpNear + 12)))).Fposlist.Fn > 0)
case FTS5_AND:
{
var i int32
for i = 0; i < (*Fts5ExprNode)(unsafe.Pointer(pNode)).FnChild; i++ {
- if fts5ExprCheckPoslists(tls, *(*uintptr)(unsafe.Pointer((pNode + 32 /* &.apChild */) + uintptr(i)*4)), iRowid) == 0 {
+ if fts5ExprCheckPoslists(tls, *(*uintptr)(unsafe.Pointer(pNode + 32 + uintptr(i)*4)), iRowid) == 0 {
fts5ExprClearPoslists(tls, pNode)
return 0
}
@@ -177314,7 +179655,7 @@ func fts5ExprCheckPoslists(tls *libc.TLS, pNode uintptr, iRowid I64) int32 { /*
var i int32
var bRet int32 = 0
for i = 0; i < (*Fts5ExprNode)(unsafe.Pointer(pNode)).FnChild; i++ {
- if fts5ExprCheckPoslists(tls, *(*uintptr)(unsafe.Pointer((pNode + 32 /* &.apChild */) + uintptr(i)*4)), iRowid) != 0 {
+ if fts5ExprCheckPoslists(tls, *(*uintptr)(unsafe.Pointer(pNode + 32 + uintptr(i)*4)), iRowid) != 0 {
bRet = 1
}
}
@@ -177325,8 +179666,8 @@ func fts5ExprCheckPoslists(tls *libc.TLS, pNode uintptr, iRowid I64) int32 { /*
default:
{
- if (0 == fts5ExprCheckPoslists(tls, *(*uintptr)(unsafe.Pointer((pNode + 32 /* &.apChild */))), iRowid)) ||
- (0 != fts5ExprCheckPoslists(tls, *(*uintptr)(unsafe.Pointer((pNode + 32 /* &.apChild */) + 1*4)), iRowid)) {
+ if 0 == fts5ExprCheckPoslists(tls, *(*uintptr)(unsafe.Pointer(pNode + 32)), iRowid) ||
+ 0 != fts5ExprCheckPoslists(tls, *(*uintptr)(unsafe.Pointer(pNode + 32 + 1*4)), iRowid) {
fts5ExprClearPoslists(tls, pNode)
return 0
}
@@ -177337,27 +179678,27 @@ func fts5ExprCheckPoslists(tls *libc.TLS, pNode uintptr, iRowid I64) int32 { /*
return 1
}
-func sqlite3Fts5ExprCheckPoslists(tls *libc.TLS, pExpr uintptr, iRowid I64) { /* sqlite3.c:220453:13: */
+func sqlite3Fts5ExprCheckPoslists(tls *libc.TLS, pExpr uintptr, iRowid I64) { /* sqlite3.c:222278:13: */
fts5ExprCheckPoslists(tls, (*Fts5Expr)(unsafe.Pointer(pExpr)).FpRoot, iRowid)
}
// This function is only called for detail=columns tables.
-func sqlite3Fts5ExprPhraseCollist(tls *libc.TLS, pExpr uintptr, iPhrase int32, ppCollist uintptr, pnCollist uintptr) int32 { /* sqlite3.c:220460:12: */
+func sqlite3Fts5ExprPhraseCollist(tls *libc.TLS, pExpr uintptr, iPhrase int32, ppCollist uintptr, pnCollist uintptr) int32 { /* sqlite3.c:222285:12: */
var pPhrase uintptr = *(*uintptr)(unsafe.Pointer((*Fts5Expr)(unsafe.Pointer(pExpr)).FapExprPhrase + uintptr(iPhrase)*4))
var pNode uintptr = (*Fts5ExprPhrase)(unsafe.Pointer(pPhrase)).FpNode
var rc int32 = SQLITE_OK
- if (((*Fts5ExprNode)(unsafe.Pointer(pNode)).FbEof == 0) &&
- ((*Fts5ExprNode)(unsafe.Pointer(pNode)).FiRowid == (*Fts5ExprNode)(unsafe.Pointer((*Fts5Expr)(unsafe.Pointer(pExpr)).FpRoot)).FiRowid)) &&
- ((*Fts5ExprPhrase)(unsafe.Pointer(pPhrase)).Fposlist.Fn > 0) {
- var pTerm uintptr = (pPhrase + 20 /* &.aTerm */)
+ if (*Fts5ExprNode)(unsafe.Pointer(pNode)).FbEof == 0 &&
+ (*Fts5ExprNode)(unsafe.Pointer(pNode)).FiRowid == (*Fts5ExprNode)(unsafe.Pointer((*Fts5Expr)(unsafe.Pointer(pExpr)).FpRoot)).FiRowid &&
+ (*Fts5ExprPhrase)(unsafe.Pointer(pPhrase)).Fposlist.Fn > 0 {
+ var pTerm uintptr = pPhrase + 20
if (*Fts5ExprTerm)(unsafe.Pointer(pTerm)).FpSynonym != 0 {
- var pBuf uintptr = ((*Fts5ExprTerm)(unsafe.Pointer(pTerm)).FpSynonym + 1*16)
+ var pBuf uintptr = (*Fts5ExprTerm)(unsafe.Pointer(pTerm)).FpSynonym + 1*16
rc = fts5ExprSynonymList(tls,
pTerm, (*Fts5ExprNode)(unsafe.Pointer(pNode)).FiRowid, pBuf, ppCollist, pnCollist)
} else {
- *(*uintptr)(unsafe.Pointer(ppCollist)) = (*Fts5IndexIter)(unsafe.Pointer((*Fts5ExprTerm)(unsafe.Pointer((pPhrase + 20 /* &.aTerm */))).FpIter)).FpData
- *(*int32)(unsafe.Pointer(pnCollist)) = (*Fts5IndexIter)(unsafe.Pointer((*Fts5ExprTerm)(unsafe.Pointer((pPhrase + 20 /* &.aTerm */))).FpIter)).FnData
+ *(*uintptr)(unsafe.Pointer(ppCollist)) = (*Fts5IndexIter)(unsafe.Pointer((*Fts5ExprTerm)(unsafe.Pointer(pPhrase + 20)).FpIter)).FpData
+ *(*int32)(unsafe.Pointer(pnCollist)) = (*Fts5IndexIter)(unsafe.Pointer((*Fts5ExprTerm)(unsafe.Pointer(pPhrase + 20)).FpIter)).FnData
}
} else {
*(*uintptr)(unsafe.Pointer(ppCollist)) = uintptr(0)
@@ -177393,7 +179734,7 @@ type Fts5HashEntry1 = struct {
FiCol I16
FiPos int32
FiRowid I64
-} /* sqlite3.c:213118:9 */
+} /* sqlite3.c:214930:9 */
// 2014 August 11
//
@@ -177409,14 +179750,14 @@ type Fts5HashEntry1 = struct {
// #include "fts5Int.h"
-type Fts5HashEntry = Fts5HashEntry1 /* sqlite3.c:220513:30 */
+type Fts5HashEntry = Fts5HashEntry1 /* sqlite3.c:222338:30 */
// Eqivalent to:
//
// char *fts5EntryKey(Fts5HashEntry *pEntry){ return zKey; }
// Allocate a new hash table.
-func sqlite3Fts5HashNew(tls *libc.TLS, pConfig uintptr, ppNew uintptr, pnByte uintptr) int32 { /* sqlite3.c:220579:12: */
+func sqlite3Fts5HashNew(tls *libc.TLS, pConfig uintptr, ppNew uintptr, pnByte uintptr) int32 { /* sqlite3.c:222404:12: */
var rc int32 = SQLITE_OK
var pNew uintptr
@@ -177430,7 +179771,7 @@ func sqlite3Fts5HashNew(tls *libc.TLS, pConfig uintptr, ppNew uintptr, pnByte ui
(*Fts5Hash)(unsafe.Pointer(pNew)).FeDetail = (*Fts5Config)(unsafe.Pointer(pConfig)).FeDetail
(*Fts5Hash)(unsafe.Pointer(pNew)).FnSlot = 1024
- nByte = (Sqlite3_int64(uint32(unsafe.Sizeof(uintptr(0))) * uint32((*Fts5Hash)(unsafe.Pointer(pNew)).FnSlot)))
+ nByte = Sqlite3_int64(uint32(unsafe.Sizeof(uintptr(0))) * uint32((*Fts5Hash)(unsafe.Pointer(pNew)).FnSlot))
(*Fts5Hash)(unsafe.Pointer(pNew)).FaSlot = Xsqlite3_malloc64(tls, uint64(nByte))
if (*Fts5Hash)(unsafe.Pointer(pNew)).FaSlot == uintptr(0) {
Xsqlite3_free(tls, pNew)
@@ -177444,7 +179785,7 @@ func sqlite3Fts5HashNew(tls *libc.TLS, pConfig uintptr, ppNew uintptr, pnByte ui
}
// Free a hash table object.
-func sqlite3Fts5HashFree(tls *libc.TLS, pHash uintptr) { /* sqlite3.c:220609:13: */
+func sqlite3Fts5HashFree(tls *libc.TLS, pHash uintptr) { /* sqlite3.c:222434:13: */
if pHash != 0 {
sqlite3Fts5HashClear(tls, pHash)
Xsqlite3_free(tls, (*Fts5Hash)(unsafe.Pointer(pHash)).FaSlot)
@@ -177453,7 +179794,7 @@ func sqlite3Fts5HashFree(tls *libc.TLS, pHash uintptr) { /* sqlite3.c:220609:13:
}
// Empty (but do not delete) a hash table.
-func sqlite3Fts5HashClear(tls *libc.TLS, pHash uintptr) { /* sqlite3.c:220620:13: */
+func sqlite3Fts5HashClear(tls *libc.TLS, pHash uintptr) { /* sqlite3.c:222445:13: */
var i int32
for i = 0; i < (*Fts5Hash)(unsafe.Pointer(pHash)).FnSlot; i++ {
var pNext uintptr
@@ -177463,49 +179804,49 @@ func sqlite3Fts5HashClear(tls *libc.TLS, pHash uintptr) { /* sqlite3.c:220620:13
Xsqlite3_free(tls, pSlot)
}
}
- libc.Xmemset(tls, (*Fts5Hash)(unsafe.Pointer(pHash)).FaSlot, 0, (uint32((*Fts5Hash)(unsafe.Pointer(pHash)).FnSlot) * uint32(unsafe.Sizeof(uintptr(0)))))
+ libc.Xmemset(tls, (*Fts5Hash)(unsafe.Pointer(pHash)).FaSlot, 0, uint32((*Fts5Hash)(unsafe.Pointer(pHash)).FnSlot)*uint32(unsafe.Sizeof(uintptr(0))))
(*Fts5Hash)(unsafe.Pointer(pHash)).FnEntry = 0
}
-func fts5HashKey(tls *libc.TLS, nSlot int32, p uintptr, n int32) uint32 { /* sqlite3.c:220634:21: */
+func fts5HashKey(tls *libc.TLS, nSlot int32, p uintptr, n int32) uint32 { /* sqlite3.c:222459:21: */
var i int32
var h uint32 = uint32(13)
- for i = (n - 1); i >= 0; i-- {
- h = (((h << 3) ^ h) ^ uint32(*(*U8)(unsafe.Pointer(p + uintptr(i)))))
+ for i = n - 1; i >= 0; i-- {
+ h = h<<3 ^ h ^ uint32(*(*U8)(unsafe.Pointer(p + uintptr(i))))
}
- return (h % uint32(nSlot))
+ return h % uint32(nSlot)
}
-func fts5HashKey2(tls *libc.TLS, nSlot int32, b U8, p uintptr, n int32) uint32 { /* sqlite3.c:220643:21: */
+func fts5HashKey2(tls *libc.TLS, nSlot int32, b U8, p uintptr, n int32) uint32 { /* sqlite3.c:222468:21: */
var i int32
var h uint32 = uint32(13)
- for i = (n - 1); i >= 0; i-- {
- h = (((h << 3) ^ h) ^ uint32(*(*U8)(unsafe.Pointer(p + uintptr(i)))))
+ for i = n - 1; i >= 0; i-- {
+ h = h<<3 ^ h ^ uint32(*(*U8)(unsafe.Pointer(p + uintptr(i))))
}
- h = (((h << 3) ^ h) ^ uint32(b))
- return (h % uint32(nSlot))
+ h = h<<3 ^ h ^ uint32(b)
+ return h % uint32(nSlot)
}
// Resize the hash table by doubling the number of slots.
-func fts5HashResize(tls *libc.TLS, pHash uintptr) int32 { /* sqlite3.c:220656:12: */
- var nNew int32 = ((*Fts5Hash)(unsafe.Pointer(pHash)).FnSlot * 2)
+func fts5HashResize(tls *libc.TLS, pHash uintptr) int32 { /* sqlite3.c:222481:12: */
+ var nNew int32 = (*Fts5Hash)(unsafe.Pointer(pHash)).FnSlot * 2
var i int32
var apNew uintptr
var apOld uintptr = (*Fts5Hash)(unsafe.Pointer(pHash)).FaSlot
- apNew = Xsqlite3_malloc64(tls, (uint64(uint32(nNew) * uint32(unsafe.Sizeof(uintptr(0))))))
+ apNew = Xsqlite3_malloc64(tls, uint64(uint32(nNew)*uint32(unsafe.Sizeof(uintptr(0)))))
if !(apNew != 0) {
return SQLITE_NOMEM
}
- libc.Xmemset(tls, apNew, 0, (uint32(nNew) * uint32(unsafe.Sizeof(uintptr(0)))))
+ libc.Xmemset(tls, apNew, 0, uint32(nNew)*uint32(unsafe.Sizeof(uintptr(0))))
for i = 0; i < (*Fts5Hash)(unsafe.Pointer(pHash)).FnSlot; i++ {
for *(*uintptr)(unsafe.Pointer(apOld + uintptr(i)*4)) != 0 {
var iHash uint32
var p uintptr = *(*uintptr)(unsafe.Pointer(apOld + uintptr(i)*4))
*(*uintptr)(unsafe.Pointer(apOld + uintptr(i)*4)) = (*Fts5HashEntry)(unsafe.Pointer(p)).FpHashNext
- iHash = fts5HashKey(tls, nNew, ((p) + 1*40),
- int32(libc.Xstrlen(tls, ((p)+1*40))))
+ iHash = fts5HashKey(tls, nNew, p+1*40,
+ int32(libc.Xstrlen(tls, p+1*40)))
(*Fts5HashEntry)(unsafe.Pointer(p)).FpHashNext = *(*uintptr)(unsafe.Pointer(apNew + uintptr(iHash)*4))
*(*uintptr)(unsafe.Pointer(apNew + uintptr(iHash)*4)) = p
}
@@ -177517,7 +179858,7 @@ func fts5HashResize(tls *libc.TLS, pHash uintptr) int32 { /* sqlite3.c:220656:12
return SQLITE_OK
}
-func fts5HashAddPoslistSize(tls *libc.TLS, pHash uintptr, p uintptr, p2 uintptr) int32 { /* sqlite3.c:220684:12: */
+func fts5HashAddPoslistSize(tls *libc.TLS, pHash uintptr, p uintptr, p2 uintptr) int32 { /* sqlite3.c:222509:12: */
var nRet int32 = 0
if (*Fts5HashEntry)(unsafe.Pointer(p)).FiSzPoslist != 0 {
var pPtr uintptr
@@ -177536,20 +179877,20 @@ func fts5HashAddPoslistSize(tls *libc.TLS, pHash uintptr, p uintptr, p2 uintptr)
}
}
} else {
- var nSz int32 = ((nData - (*Fts5HashEntry)(unsafe.Pointer(p)).FiSzPoslist) - 1) // Size in bytes
- var nPos int32 = ((nSz * 2) + int32((*Fts5HashEntry)(unsafe.Pointer(p)).FbDel)) // Value of nPos field
+ var nSz int32 = nData - (*Fts5HashEntry)(unsafe.Pointer(p)).FiSzPoslist - 1 // Size in bytes
+ var nPos int32 = nSz*2 + int32((*Fts5HashEntry)(unsafe.Pointer(p)).FbDel) // Value of nPos field
if nPos <= 127 {
*(*U8)(unsafe.Pointer(pPtr + uintptr((*Fts5HashEntry)(unsafe.Pointer(p)).FiSzPoslist))) = U8(nPos)
} else {
var nByte int32 = sqlite3Fts5GetVarintLen(tls, U32(nPos))
- libc.Xmemmove(tls, (pPtr + uintptr(((*Fts5HashEntry)(unsafe.Pointer(p)).FiSzPoslist + nByte))), (pPtr + uintptr(((*Fts5HashEntry)(unsafe.Pointer(p)).FiSzPoslist + 1))), uint32(nSz))
- sqlite3Fts5PutVarint(tls, (pPtr + uintptr((*Fts5HashEntry)(unsafe.Pointer(p)).FiSzPoslist)), uint64(nPos))
+ libc.Xmemmove(tls, pPtr+uintptr((*Fts5HashEntry)(unsafe.Pointer(p)).FiSzPoslist+nByte), pPtr+uintptr((*Fts5HashEntry)(unsafe.Pointer(p)).FiSzPoslist+1), uint32(nSz))
+ sqlite3Fts5PutVarint(tls, pPtr+uintptr((*Fts5HashEntry)(unsafe.Pointer(p)).FiSzPoslist), uint64(nPos))
nData = nData + (nByte - 1)
}
}
- nRet = (nData - (*Fts5HashEntry)(unsafe.Pointer(p)).FnData)
+ nRet = nData - (*Fts5HashEntry)(unsafe.Pointer(p)).FnData
if p2 == uintptr(0) {
(*Fts5HashEntry)(unsafe.Pointer(p)).FiSzPoslist = 0
(*Fts5HashEntry)(unsafe.Pointer(p)).FbDel = U8(0)
@@ -177566,22 +179907,22 @@ func fts5HashAddPoslistSize(tls *libc.TLS, pHash uintptr, p uintptr, p2 uintptr)
// (bByte || pToken) -> (iRowid,iCol,iPos)
//
// Or, if iCol is negative, then the value is a delete marker.
-func sqlite3Fts5HashWrite(tls *libc.TLS, pHash uintptr, iRowid I64, iCol int32, iPos int32, bByte uint8, pToken uintptr, nToken int32) int32 { /* sqlite3.c:220735:12: */
+func sqlite3Fts5HashWrite(tls *libc.TLS, pHash uintptr, iRowid I64, iCol int32, iPos int32, bByte uint8, pToken uintptr, nToken int32) int32 { /* sqlite3.c:222560:12: */
var iHash uint32
var p uintptr
var pPtr uintptr
var nIncr int32 = 0 // Amount to increment (*pHash->pnByte) by
var bNew int32 // If non-delete entry should be written
- bNew = (libc.Bool32((*Fts5Hash)(unsafe.Pointer(pHash)).FeDetail == FTS5_DETAIL_FULL))
+ bNew = libc.Bool32((*Fts5Hash)(unsafe.Pointer(pHash)).FeDetail == FTS5_DETAIL_FULL)
// Attempt to locate an existing hash entry
iHash = fts5HashKey2(tls, (*Fts5Hash)(unsafe.Pointer(pHash)).FnSlot, U8(bByte), pToken, nToken)
for p = *(*uintptr)(unsafe.Pointer((*Fts5Hash)(unsafe.Pointer(pHash)).FaSlot + uintptr(iHash)*4)); p != 0; p = (*Fts5HashEntry)(unsafe.Pointer(p)).FpHashNext {
- var zKey uintptr = ((p) + 1*40)
- if ((int32(*(*uint8)(unsafe.Pointer(zKey))) == int32(bByte)) &&
- ((*Fts5HashEntry)(unsafe.Pointer(p)).FnKey == nToken)) &&
- (libc.Xmemcmp(tls, (zKey+1), pToken, uint32(nToken)) == 0) {
+ var zKey uintptr = p + 1*40
+ if int32(*(*uint8)(unsafe.Pointer(zKey))) == int32(bByte) &&
+ (*Fts5HashEntry)(unsafe.Pointer(p)).FnKey == nToken &&
+ libc.Xmemcmp(tls, zKey+1, pToken, uint32(nToken)) == 0 {
break
}
}
@@ -177590,13 +179931,13 @@ func sqlite3Fts5HashWrite(tls *libc.TLS, pHash uintptr, iRowid I64, iCol int32,
if p == uintptr(0) {
// Figure out how much space to allocate
var zKey uintptr
- var nByte Sqlite3_int64 = (Sqlite3_int64(((uint32(unsafe.Sizeof(Fts5HashEntry{})) + (uint32(nToken + 1))) + uint32(1)) + uint32(64)))
+ var nByte Sqlite3_int64 = Sqlite3_int64(uint32(unsafe.Sizeof(Fts5HashEntry{})) + uint32(nToken+1) + uint32(1) + uint32(64))
if nByte < int64(128) {
nByte = int64(128)
}
// Grow the Fts5Hash.aSlot[] array if necessary.
- if ((*Fts5Hash)(unsafe.Pointer(pHash)).FnEntry * 2) >= (*Fts5Hash)(unsafe.Pointer(pHash)).FnSlot {
+ if (*Fts5Hash)(unsafe.Pointer(pHash)).FnEntry*2 >= (*Fts5Hash)(unsafe.Pointer(pHash)).FnSlot {
var rc int32 = fts5HashResize(tls, pHash)
if rc != SQLITE_OK {
return rc
@@ -177611,24 +179952,24 @@ func sqlite3Fts5HashWrite(tls *libc.TLS, pHash uintptr, iRowid I64, iCol int32,
}
libc.Xmemset(tls, p, 0, uint32(unsafe.Sizeof(Fts5HashEntry{})))
(*Fts5HashEntry)(unsafe.Pointer(p)).FnAlloc = int32(nByte)
- zKey = ((p) + 1*40)
+ zKey = p + 1*40
*(*uint8)(unsafe.Pointer(zKey)) = bByte
- libc.Xmemcpy(tls, (zKey + 1), pToken, uint32(nToken))
+ libc.Xmemcpy(tls, zKey+1, pToken, uint32(nToken))
(*Fts5HashEntry)(unsafe.Pointer(p)).FnKey = nToken
- *(*uint8)(unsafe.Pointer(zKey + uintptr((nToken + 1)))) = uint8(0)
- (*Fts5HashEntry)(unsafe.Pointer(p)).FnData = (int32((uint32((nToken + 1) + 1)) + uint32(unsafe.Sizeof(Fts5HashEntry{}))))
+ *(*uint8)(unsafe.Pointer(zKey + uintptr(nToken+1))) = uint8(0)
+ (*Fts5HashEntry)(unsafe.Pointer(p)).FnData = int32(uint32(nToken+1+1) + uint32(unsafe.Sizeof(Fts5HashEntry{})))
(*Fts5HashEntry)(unsafe.Pointer(p)).FpHashNext = *(*uintptr)(unsafe.Pointer((*Fts5Hash)(unsafe.Pointer(pHash)).FaSlot + uintptr(iHash)*4))
*(*uintptr)(unsafe.Pointer((*Fts5Hash)(unsafe.Pointer(pHash)).FaSlot + uintptr(iHash)*4)) = p
(*Fts5Hash)(unsafe.Pointer(pHash)).FnEntry++
// Add the first rowid field to the hash-entry
- *(*int32)(unsafe.Pointer(p + 16 /* &.nData */)) += (sqlite3Fts5PutVarint(tls, ((p) + uintptr((*Fts5HashEntry)(unsafe.Pointer(p)).FnData)), uint64(iRowid)))
+ *(*int32)(unsafe.Pointer(p + 16)) += sqlite3Fts5PutVarint(tls, p+uintptr((*Fts5HashEntry)(unsafe.Pointer(p)).FnData), uint64(iRowid))
(*Fts5HashEntry)(unsafe.Pointer(p)).FiRowid = iRowid
(*Fts5HashEntry)(unsafe.Pointer(p)).FiSzPoslist = (*Fts5HashEntry)(unsafe.Pointer(p)).FnData
if (*Fts5Hash)(unsafe.Pointer(pHash)).FeDetail != FTS5_DETAIL_NONE {
- *(*int32)(unsafe.Pointer(p + 16 /* &.nData */)) += (1)
+ *(*int32)(unsafe.Pointer(p + 16)) += 1
(*Fts5HashEntry)(unsafe.Pointer(p)).FiCol = func() int16 {
if (*Fts5Hash)(unsafe.Pointer(pHash)).FeDetail == FTS5_DETAIL_FULL {
return int16(0)
@@ -177648,8 +179989,8 @@ func sqlite3Fts5HashWrite(tls *libc.TLS, pHash uintptr, iRowid I64, iCol int32,
// + 1 byte for a "new column" byte,
// + 3 bytes for a new column number (16-bit max) as a varint,
// + 5 bytes for the new position offset (32-bit max).
- if ((*Fts5HashEntry)(unsafe.Pointer(p)).FnAlloc - (*Fts5HashEntry)(unsafe.Pointer(p)).FnData) < ((((9 + 4) + 1) + 3) + 5) {
- var nNew Sqlite3_int64 = (Sqlite3_int64((*Fts5HashEntry)(unsafe.Pointer(p)).FnAlloc * 2))
+ if (*Fts5HashEntry)(unsafe.Pointer(p)).FnAlloc-(*Fts5HashEntry)(unsafe.Pointer(p)).FnData < 9+4+1+3+5 {
+ var nNew Sqlite3_int64 = Sqlite3_int64((*Fts5HashEntry)(unsafe.Pointer(p)).FnAlloc * 2)
var pNew uintptr
var pp uintptr
pNew = Xsqlite3_realloc64(tls, p, uint64(nNew))
@@ -177657,12 +179998,12 @@ func sqlite3Fts5HashWrite(tls *libc.TLS, pHash uintptr, iRowid I64, iCol int32,
return SQLITE_NOMEM
}
(*Fts5HashEntry)(unsafe.Pointer(pNew)).FnAlloc = int32(nNew)
- for pp = ((*Fts5Hash)(unsafe.Pointer(pHash)).FaSlot + uintptr(iHash)*4); *(*uintptr)(unsafe.Pointer(pp)) != p; pp = (*(*uintptr)(unsafe.Pointer(pp)) /* &.pHashNext */) {
+ for pp = (*Fts5Hash)(unsafe.Pointer(pHash)).FaSlot + uintptr(iHash)*4; *(*uintptr)(unsafe.Pointer(pp)) != p; pp = *(*uintptr)(unsafe.Pointer(pp)) {
}
*(*uintptr)(unsafe.Pointer(pp)) = pNew
p = pNew
}
- nIncr = nIncr - ((*Fts5HashEntry)(unsafe.Pointer(p)).FnData)
+ nIncr = nIncr - (*Fts5HashEntry)(unsafe.Pointer(p)).FnData
}
pPtr = p
@@ -177670,14 +180011,14 @@ func sqlite3Fts5HashWrite(tls *libc.TLS, pHash uintptr, iRowid I64, iCol int32,
// If this is a new rowid, append the 4-byte size field for the previous
// entry, and the new rowid for this entry.
if iRowid != (*Fts5HashEntry)(unsafe.Pointer(p)).FiRowid {
- var iDiff U64 = (U64(iRowid) - U64((*Fts5HashEntry)(unsafe.Pointer(p)).FiRowid))
+ var iDiff U64 = U64(iRowid) - U64((*Fts5HashEntry)(unsafe.Pointer(p)).FiRowid)
fts5HashAddPoslistSize(tls, pHash, p, uintptr(0))
- *(*int32)(unsafe.Pointer(p + 16 /* &.nData */)) += (sqlite3Fts5PutVarint(tls, (pPtr + uintptr((*Fts5HashEntry)(unsafe.Pointer(p)).FnData)), iDiff))
+ *(*int32)(unsafe.Pointer(p + 16)) += sqlite3Fts5PutVarint(tls, pPtr+uintptr((*Fts5HashEntry)(unsafe.Pointer(p)).FnData), iDiff)
(*Fts5HashEntry)(unsafe.Pointer(p)).FiRowid = iRowid
bNew = 1
(*Fts5HashEntry)(unsafe.Pointer(p)).FiSzPoslist = (*Fts5HashEntry)(unsafe.Pointer(p)).FnData
if (*Fts5Hash)(unsafe.Pointer(pHash)).FeDetail != FTS5_DETAIL_NONE {
- *(*int32)(unsafe.Pointer(p + 16 /* &.nData */)) += (1)
+ *(*int32)(unsafe.Pointer(p + 16)) += 1
(*Fts5HashEntry)(unsafe.Pointer(p)).FiCol = func() int16 {
if (*Fts5Hash)(unsafe.Pointer(pHash)).FeDetail == FTS5_DETAIL_FULL {
return int16(0)
@@ -177697,7 +180038,7 @@ func sqlite3Fts5HashWrite(tls *libc.TLS, pHash uintptr, iRowid I64, iCol int32,
if iCol != int32((*Fts5HashEntry)(unsafe.Pointer(p)).FiCol) {
if (*Fts5Hash)(unsafe.Pointer(pHash)).FeDetail == FTS5_DETAIL_FULL {
*(*U8)(unsafe.Pointer(pPtr + uintptr(libc.PostIncInt32(&(*Fts5HashEntry)(unsafe.Pointer(p)).FnData, 1)))) = U8(0x01)
- *(*int32)(unsafe.Pointer(p + 16 /* &.nData */)) += (sqlite3Fts5PutVarint(tls, (pPtr + uintptr((*Fts5HashEntry)(unsafe.Pointer(p)).FnData)), uint64(iCol)))
+ *(*int32)(unsafe.Pointer(p + 16)) += sqlite3Fts5PutVarint(tls, pPtr+uintptr((*Fts5HashEntry)(unsafe.Pointer(p)).FnData), uint64(iCol))
(*Fts5HashEntry)(unsafe.Pointer(p)).FiCol = I16(iCol)
(*Fts5HashEntry)(unsafe.Pointer(p)).FiPos = 0
} else {
@@ -177708,7 +180049,7 @@ func sqlite3Fts5HashWrite(tls *libc.TLS, pHash uintptr, iRowid I64, iCol int32,
// Append the new position offset, if necessary
if bNew != 0 {
- *(*int32)(unsafe.Pointer(p + 16 /* &.nData */)) += (sqlite3Fts5PutVarint(tls, (pPtr + uintptr((*Fts5HashEntry)(unsafe.Pointer(p)).FnData)), (uint64((iPos - (*Fts5HashEntry)(unsafe.Pointer(p)).FiPos) + 2))))
+ *(*int32)(unsafe.Pointer(p + 16)) += sqlite3Fts5PutVarint(tls, pPtr+uintptr((*Fts5HashEntry)(unsafe.Pointer(p)).FnData), uint64(iPos-(*Fts5HashEntry)(unsafe.Pointer(p)).FiPos+2))
(*Fts5HashEntry)(unsafe.Pointer(p)).FiPos = iPos
}
}
@@ -177717,15 +180058,15 @@ func sqlite3Fts5HashWrite(tls *libc.TLS, pHash uintptr, iRowid I64, iCol int32,
(*Fts5HashEntry)(unsafe.Pointer(p)).FbDel = U8(1)
}
- nIncr = nIncr + ((*Fts5HashEntry)(unsafe.Pointer(p)).FnData)
- *(*int32)(unsafe.Pointer((*Fts5Hash)(unsafe.Pointer(pHash)).FpnByte)) += (nIncr)
+ nIncr = nIncr + (*Fts5HashEntry)(unsafe.Pointer(p)).FnData
+ *(*int32)(unsafe.Pointer((*Fts5Hash)(unsafe.Pointer(pHash)).FpnByte)) += nIncr
return SQLITE_OK
}
// Arguments pLeft and pRight point to linked-lists of hash-entry objects,
// each sorted in key order. This function merges the two lists into a
// single list and returns a pointer to its first element.
-func fts5HashEntryMerge(tls *libc.TLS, pLeft uintptr, pRight uintptr) uintptr { /* sqlite3.c:220888:22: */
+func fts5HashEntryMerge(tls *libc.TLS, pLeft uintptr, pRight uintptr) uintptr { /* sqlite3.c:222713:22: */
bp := tls.Alloc(4)
defer tls.Free(4)
@@ -177734,7 +180075,7 @@ func fts5HashEntryMerge(tls *libc.TLS, pLeft uintptr, pRight uintptr) uintptr {
*(*uintptr)(unsafe.Pointer(bp /* pRet */)) = uintptr(0)
var ppOut uintptr = bp /* &pRet */
- for (p1 != 0) || (p2 != 0) {
+ for p1 != 0 || p2 != 0 {
if p1 == uintptr(0) {
*(*uintptr)(unsafe.Pointer(ppOut)) = p2
p2 = uintptr(0)
@@ -177743,21 +180084,21 @@ func fts5HashEntryMerge(tls *libc.TLS, pLeft uintptr, pRight uintptr) uintptr {
p1 = uintptr(0)
} else {
var i int32 = 0
- var zKey1 uintptr = ((p1) + 1*40)
- var zKey2 uintptr = ((p2) + 1*40)
+ var zKey1 uintptr = p1 + 1*40
+ var zKey2 uintptr = p2 + 1*40
for int32(*(*uint8)(unsafe.Pointer(zKey1 + uintptr(i)))) == int32(*(*uint8)(unsafe.Pointer(zKey2 + uintptr(i)))) {
i++
}
- if (int32(U8(*(*uint8)(unsafe.Pointer(zKey1 + uintptr(i)))))) > (int32(U8(*(*uint8)(unsafe.Pointer(zKey2 + uintptr(i)))))) {
+ if int32(U8(*(*uint8)(unsafe.Pointer(zKey1 + uintptr(i))))) > int32(U8(*(*uint8)(unsafe.Pointer(zKey2 + uintptr(i))))) {
// p2 is smaller
*(*uintptr)(unsafe.Pointer(ppOut)) = p2
- ppOut = (p2 + 4 /* &.pScanNext */)
+ ppOut = p2 + 4
p2 = (*Fts5HashEntry)(unsafe.Pointer(p2)).FpScanNext
} else {
// p1 is smaller
*(*uintptr)(unsafe.Pointer(ppOut)) = p1
- ppOut = (p1 + 4 /* &.pScanNext */)
+ ppOut = p1 + 4
p1 = (*Fts5HashEntry)(unsafe.Pointer(p1)).FpScanNext
}
*(*uintptr)(unsafe.Pointer(ppOut)) = uintptr(0)
@@ -177771,7 +180112,7 @@ func fts5HashEntryMerge(tls *libc.TLS, pLeft uintptr, pRight uintptr) uintptr {
// in sorted order. The hash table is cleared before returning. It is
// the responsibility of the caller to free the elements of the returned
// list.
-func fts5HashEntrySort(tls *libc.TLS, pHash uintptr, pTerm uintptr, nTerm int32, ppSorted uintptr) int32 { /* sqlite3.c:220934:12: */
+func fts5HashEntrySort(tls *libc.TLS, pHash uintptr, pTerm uintptr, nTerm int32, ppSorted uintptr) int32 { /* sqlite3.c:222759:12: */
var nMergeSlot int32 = 32
var ap uintptr
var pList uintptr
@@ -177779,17 +180120,17 @@ func fts5HashEntrySort(tls *libc.TLS, pHash uintptr, pTerm uintptr, nTerm int32,
var i int32
*(*uintptr)(unsafe.Pointer(ppSorted)) = uintptr(0)
- ap = Xsqlite3_malloc64(tls, (uint64(uint32(unsafe.Sizeof(uintptr(0))) * uint32(nMergeSlot))))
+ ap = Xsqlite3_malloc64(tls, uint64(uint32(unsafe.Sizeof(uintptr(0)))*uint32(nMergeSlot)))
if !(ap != 0) {
return SQLITE_NOMEM
}
- libc.Xmemset(tls, ap, 0, (uint32(unsafe.Sizeof(uintptr(0))) * uint32(nMergeSlot)))
+ libc.Xmemset(tls, ap, 0, uint32(unsafe.Sizeof(uintptr(0)))*uint32(nMergeSlot))
for iSlot = 0; iSlot < (*Fts5Hash)(unsafe.Pointer(pHash)).FnSlot; iSlot++ {
var pIter uintptr
for pIter = *(*uintptr)(unsafe.Pointer((*Fts5Hash)(unsafe.Pointer(pHash)).FaSlot + uintptr(iSlot)*4)); pIter != 0; pIter = (*Fts5HashEntry)(unsafe.Pointer(pIter)).FpHashNext {
- if (pTerm == uintptr(0)) ||
- ((((*Fts5HashEntry)(unsafe.Pointer(pIter)).FnKey + 1) >= nTerm) && (0 == libc.Xmemcmp(tls, ((pIter)+1*40), pTerm, uint32(nTerm)))) {
+ if pTerm == uintptr(0) ||
+ (*Fts5HashEntry)(unsafe.Pointer(pIter)).FnKey+1 >= nTerm && 0 == libc.Xmemcmp(tls, pIter+1*40, pTerm, uint32(nTerm)) {
var pEntry uintptr = pIter
(*Fts5HashEntry)(unsafe.Pointer(pEntry)).FpScanNext = uintptr(0)
for i = 0; *(*uintptr)(unsafe.Pointer(ap + uintptr(i)*4)) != 0; i++ {
@@ -177813,27 +180154,27 @@ func fts5HashEntrySort(tls *libc.TLS, pHash uintptr, pTerm uintptr, nTerm int32,
}
// Query the hash table for a doclist associated with term pTerm/nTerm.
-func sqlite3Fts5HashQuery(tls *libc.TLS, pHash uintptr, nPre int32, pTerm uintptr, nTerm int32, ppOut uintptr, pnDoclist uintptr) int32 { /* sqlite3.c:220981:12: */
+func sqlite3Fts5HashQuery(tls *libc.TLS, pHash uintptr, nPre int32, pTerm uintptr, nTerm int32, ppOut uintptr, pnDoclist uintptr) int32 { /* sqlite3.c:222806:12: */
var iHash uint32 = fts5HashKey(tls, (*Fts5Hash)(unsafe.Pointer(pHash)).FnSlot, pTerm, nTerm)
var zKey uintptr = uintptr(0)
var p uintptr
for p = *(*uintptr)(unsafe.Pointer((*Fts5Hash)(unsafe.Pointer(pHash)).FaSlot + uintptr(iHash)*4)); p != 0; p = (*Fts5HashEntry)(unsafe.Pointer(p)).FpHashNext {
- zKey = ((p) + 1*40)
+ zKey = p + 1*40
- if (nTerm == ((*Fts5HashEntry)(unsafe.Pointer(p)).FnKey + 1)) && (libc.Xmemcmp(tls, zKey, pTerm, uint32(nTerm)) == 0) {
+ if nTerm == (*Fts5HashEntry)(unsafe.Pointer(p)).FnKey+1 && libc.Xmemcmp(tls, zKey, pTerm, uint32(nTerm)) == 0 {
break
}
}
if p != 0 {
- var nHashPre int32 = (int32((uint32(unsafe.Sizeof(Fts5HashEntry{})) + uint32(nTerm)) + uint32(1)))
- var nList int32 = ((*Fts5HashEntry)(unsafe.Pointer(p)).FnData - nHashPre)
- var pRet uintptr = libc.AssignPtrUintptr(ppOut, Xsqlite3_malloc64(tls, (uint64((nPre+nList)+10))))
+ var nHashPre int32 = int32(uint32(unsafe.Sizeof(Fts5HashEntry{})) + uint32(nTerm) + uint32(1))
+ var nList int32 = (*Fts5HashEntry)(unsafe.Pointer(p)).FnData - nHashPre
+ var pRet uintptr = libc.AssignPtrUintptr(ppOut, Xsqlite3_malloc64(tls, uint64(nPre+nList+10)))
if pRet != 0 {
- var pFaux uintptr = (pRet + uintptr((nPre - nHashPre)))
- libc.Xmemcpy(tls, (pRet + uintptr(nPre)), ((p) + uintptr(nHashPre)), uint32(nList))
- nList = nList + (fts5HashAddPoslistSize(tls, pHash, p, pFaux))
+ var pFaux uintptr = pRet + uintptr(nPre-nHashPre)
+ libc.Xmemcpy(tls, pRet+uintptr(nPre), p+uintptr(nHashPre), uint32(nList))
+ nList = nList + fts5HashAddPoslistSize(tls, pHash, p, pFaux)
*(*int32)(unsafe.Pointer(pnDoclist)) = nList
} else {
*(*int32)(unsafe.Pointer(pnDoclist)) = 0
@@ -177847,28 +180188,28 @@ func sqlite3Fts5HashQuery(tls *libc.TLS, pHash uintptr, nPre int32, pTerm uintpt
return SQLITE_OK
}
-func sqlite3Fts5HashScanInit(tls *libc.TLS, p uintptr, pTerm uintptr, nTerm int32) int32 { /* sqlite3.c:221019:12: */
- return fts5HashEntrySort(tls, p, pTerm, nTerm, (p + 16 /* &.pScan */))
+func sqlite3Fts5HashScanInit(tls *libc.TLS, p uintptr, pTerm uintptr, nTerm int32) int32 { /* sqlite3.c:222844:12: */
+ return fts5HashEntrySort(tls, p, pTerm, nTerm, p+16)
}
-func sqlite3Fts5HashScanNext(tls *libc.TLS, p uintptr) { /* sqlite3.c:221026:13: */
+func sqlite3Fts5HashScanNext(tls *libc.TLS, p uintptr) { /* sqlite3.c:222851:13: */
(*Fts5Hash)(unsafe.Pointer(p)).FpScan = (*Fts5HashEntry)(unsafe.Pointer((*Fts5Hash)(unsafe.Pointer(p)).FpScan)).FpScanNext
}
-func sqlite3Fts5HashScanEof(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:221031:12: */
- return (libc.Bool32((*Fts5Hash)(unsafe.Pointer(p)).FpScan == uintptr(0)))
+func sqlite3Fts5HashScanEof(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:222856:12: */
+ return libc.Bool32((*Fts5Hash)(unsafe.Pointer(p)).FpScan == uintptr(0))
}
-func sqlite3Fts5HashScanEntry(tls *libc.TLS, pHash uintptr, pzTerm uintptr, ppDoclist uintptr, pnDoclist uintptr) { /* sqlite3.c:221035:13: */
+func sqlite3Fts5HashScanEntry(tls *libc.TLS, pHash uintptr, pzTerm uintptr, ppDoclist uintptr, pnDoclist uintptr) { /* sqlite3.c:222860:13: */
var p uintptr
if libc.AssignUintptr(&p, (*Fts5Hash)(unsafe.Pointer(pHash)).FpScan) != 0 {
- var zKey uintptr = ((p) + 1*40)
+ var zKey uintptr = p + 1*40
var nTerm int32 = int32(libc.Xstrlen(tls, zKey))
fts5HashAddPoslistSize(tls, pHash, p, uintptr(0))
*(*uintptr)(unsafe.Pointer(pzTerm)) = zKey
- *(*uintptr)(unsafe.Pointer(ppDoclist)) = (zKey + uintptr((nTerm + 1)))
- *(*int32)(unsafe.Pointer(pnDoclist)) = (int32(uint32((*Fts5HashEntry)(unsafe.Pointer(p)).FnData) - ((uint32(unsafe.Sizeof(Fts5HashEntry{})) + uint32(nTerm)) + uint32(1))))
+ *(*uintptr)(unsafe.Pointer(ppDoclist)) = zKey + uintptr(nTerm+1)
+ *(*int32)(unsafe.Pointer(pnDoclist)) = int32(uint32((*Fts5HashEntry)(unsafe.Pointer(p)).FnData) - (uint32(unsafe.Sizeof(Fts5HashEntry{})) + uint32(nTerm) + uint32(1)))
} else {
*(*uintptr)(unsafe.Pointer(pzTerm)) = uintptr(0)
*(*uintptr)(unsafe.Pointer(ppDoclist)) = uintptr(0)
@@ -178086,7 +180427,7 @@ type Fts5Data1 = struct {
Fp uintptr
Fnn int32
FszLeaf int32
-} /* sqlite3.c:221310:9 */
+} /* sqlite3.c:223135:9 */
// 2014 May 31
//
@@ -178294,14 +180635,14 @@ type Fts5Data1 = struct {
// many zero bytes. This makes it easier to decode the various record formats
// without overreading if the records are corrupt.
-type Fts5Data = Fts5Data1 /* sqlite3.c:221310:25 */
+type Fts5Data = Fts5Data1 /* sqlite3.c:223135:25 */
type Fts5DlidxIter1 = struct {
FnLvl int32
FiSegid int32
FaLvl [1]Fts5DlidxLvl
-} /* sqlite3.c:221311:9 */
+} /* sqlite3.c:223136:9 */
-type Fts5DlidxIter = Fts5DlidxIter1 /* sqlite3.c:221311:30 */
+type Fts5DlidxIter = Fts5DlidxIter1 /* sqlite3.c:223136:30 */
type Fts5DlidxLvl1 = struct {
FpData uintptr
FiOff int32
@@ -178310,18 +180651,18 @@ type Fts5DlidxLvl1 = struct {
FiLeafPgno int32
F__ccgo_pad1 [4]byte
FiRowid I64
-} /* sqlite3.c:221311:9 */
+} /* sqlite3.c:223136:9 */
-type Fts5DlidxLvl = Fts5DlidxLvl1 /* sqlite3.c:221312:29 */
+type Fts5DlidxLvl = Fts5DlidxLvl1 /* sqlite3.c:223137:29 */
type Fts5DlidxWriter1 = struct {
Fpgno int32
FbPrevValid int32
FiPrev I64
Fbuf Fts5Buffer
F__ccgo_pad1 [4]byte
-} /* sqlite3.c:221313:9 */
+} /* sqlite3.c:223138:9 */
-type Fts5DlidxWriter = Fts5DlidxWriter1 /* sqlite3.c:221313:32 */
+type Fts5DlidxWriter = Fts5DlidxWriter1 /* sqlite3.c:223138:32 */
type Fts5Iter1 = struct {
Fbase Fts5IndexIter
FpIndex uintptr
@@ -178336,18 +180677,18 @@ type Fts5Iter1 = struct {
FaFirst uintptr
F__ccgo_pad2 [4]byte
FaSeg [1]Fts5SegIter
-} /* sqlite3.c:221314:9 */
+} /* sqlite3.c:223139:9 */
-type Fts5Iter = Fts5Iter1 /* sqlite3.c:221314:25 */
+type Fts5Iter = Fts5Iter1 /* sqlite3.c:223139:25 */
type Fts5PageWriter1 = struct {
Fpgno int32
FiPrevPgidx int32
Fbuf Fts5Buffer
Fpgidx Fts5Buffer
Fterm Fts5Buffer
-} /* sqlite3.c:221315:9 */
+} /* sqlite3.c:223140:9 */
-type Fts5PageWriter = Fts5PageWriter1 /* sqlite3.c:221315:31 */
+type Fts5PageWriter = Fts5PageWriter1 /* sqlite3.c:223140:31 */
type Fts5SegIter1 = struct {
FpSeg uintptr
Fflags int32
@@ -178370,9 +180711,9 @@ type Fts5SegIter1 = struct {
FnPos int32
FbDel U8
F__ccgo_pad2 [3]byte
-} /* sqlite3.c:221314:9 */
+} /* sqlite3.c:223139:9 */
-type Fts5SegIter = Fts5SegIter1 /* sqlite3.c:221316:28 */
+type Fts5SegIter = Fts5SegIter1 /* sqlite3.c:223141:28 */
type Fts5DoclistIter1 = struct {
FaEof uintptr
F__ccgo_pad1 [4]byte
@@ -178381,9 +180722,9 @@ type Fts5DoclistIter1 = struct {
FnPoslist int32
FnSize int32
F__ccgo_pad2 [4]byte
-} /* sqlite3.c:221317:9 */
+} /* sqlite3.c:223142:9 */
-type Fts5DoclistIter = Fts5DoclistIter1 /* sqlite3.c:221317:32 */
+type Fts5DoclistIter = Fts5DoclistIter1 /* sqlite3.c:223142:32 */
type Fts5SegWriter1 = struct {
FiSegid int32
Fwriter Fts5PageWriter
@@ -178399,9 +180740,9 @@ type Fts5SegWriter1 = struct {
Fbtterm Fts5Buffer
FiBtPage int32
F__ccgo_pad2 [4]byte
-} /* sqlite3.c:221318:9 */
+} /* sqlite3.c:223143:9 */
-type Fts5SegWriter = Fts5SegWriter1 /* sqlite3.c:221318:30 */
+type Fts5SegWriter = Fts5SegWriter1 /* sqlite3.c:223143:30 */
type Fts5Structure1 = struct {
FnRef int32
F__ccgo_pad1 [4]byte
@@ -178410,47 +180751,47 @@ type Fts5Structure1 = struct {
FnLevel int32
FaLevel [1]Fts5StructureLevel
F__ccgo_pad2 [4]byte
-} /* sqlite3.c:213118:9 */
+} /* sqlite3.c:214930:9 */
-type Fts5Structure = Fts5Structure1 /* sqlite3.c:221319:30 */
+type Fts5Structure = Fts5Structure1 /* sqlite3.c:223144:30 */
type Fts5StructureLevel1 = struct {
FnMerge int32
FnSeg int32
FaSeg uintptr
-} /* sqlite3.c:213118:9 */
+} /* sqlite3.c:214930:9 */
-type Fts5StructureLevel = Fts5StructureLevel1 /* sqlite3.c:221320:35 */
+type Fts5StructureLevel = Fts5StructureLevel1 /* sqlite3.c:223145:35 */
type Fts5StructureSegment1 = struct {
FiSegid int32
FpgnoFirst int32
FpgnoLast int32
-} /* sqlite3.c:213118:9 */
+} /* sqlite3.c:214930:9 */
-type Fts5StructureSegment = Fts5StructureSegment1 /* sqlite3.c:221321:37 */
+type Fts5StructureSegment = Fts5StructureSegment1 /* sqlite3.c:223146:37 */
type Fts5CResult1 = struct {
FiFirst U16
FbTermEq U8
F__ccgo_pad1 [1]byte
-} /* sqlite3.c:221314:9 */
+} /* sqlite3.c:223139:9 */
-type Fts5CResult = Fts5CResult1 /* sqlite3.c:221431:28 */
+type Fts5CResult = Fts5CResult1 /* sqlite3.c:223256:28 */
-func fts5PutU16(tls *libc.TLS, aOut uintptr, iVal U16) { /* sqlite3.c:221610:13: */
- *(*U8)(unsafe.Pointer(aOut)) = (U8(int32(iVal) >> 8))
- *(*U8)(unsafe.Pointer(aOut + 1)) = (U8(int32(iVal) & 0xFF))
+func fts5PutU16(tls *libc.TLS, aOut uintptr, iVal U16) { /* sqlite3.c:223435:13: */
+ *(*U8)(unsafe.Pointer(aOut)) = U8(int32(iVal) >> 8)
+ *(*U8)(unsafe.Pointer(aOut + 1)) = U8(int32(iVal) & 0xFF)
}
-func fts5GetU16(tls *libc.TLS, aIn uintptr) U16 { /* sqlite3.c:221615:12: */
- return (U16((int32(U16(*(*U8)(unsafe.Pointer(aIn)))) << 8) + int32(*(*U8)(unsafe.Pointer(aIn + 1)))))
+func fts5GetU16(tls *libc.TLS, aIn uintptr) U16 { /* sqlite3.c:223440:12: */
+ return U16(int32(U16(*(*U8)(unsafe.Pointer(aIn))))<<8 + int32(*(*U8)(unsafe.Pointer(aIn + 1))))
}
// Allocate and return a buffer at least nByte bytes in size.
//
// If an OOM error is encountered, return NULL and set the error code in
// the Fts5Index handle passed as the first argument.
-func fts5IdxMalloc(tls *libc.TLS, p uintptr, nByte Sqlite3_int64) uintptr { /* sqlite3.c:221625:13: */
- return sqlite3Fts5MallocZero(tls, (p + 36 /* &.rc */), nByte)
+func fts5IdxMalloc(tls *libc.TLS, p uintptr, nByte Sqlite3_int64) uintptr { /* sqlite3.c:223450:13: */
+ return sqlite3Fts5MallocZero(tls, p+36, nByte)
}
// Compare the contents of the pLeft buffer with the pRight/nRight blob.
@@ -178467,39 +180808,42 @@ func fts5IdxMalloc(tls *libc.TLS, p uintptr, nByte Sqlite3_int64) uintptr { /* s
// +ve if pRight is smaller than pLeft. In other words:
//
// res = *pLeft - *pRight
-func fts5BufferCompare(tls *libc.TLS, pLeft uintptr, pRight uintptr) int32 { /* sqlite3.c:221657:12: */
- var nCmp int32 = func() int32 {
- if ((*Fts5Buffer)(unsafe.Pointer(pLeft)).Fn) < ((*Fts5Buffer)(unsafe.Pointer(pRight)).Fn) {
+func fts5BufferCompare(tls *libc.TLS, pLeft uintptr, pRight uintptr) int32 { /* sqlite3.c:223482:12: */
+ var nCmp int32
+ var res int32
+ nCmp = func() int32 {
+ if (*Fts5Buffer)(unsafe.Pointer(pLeft)).Fn < (*Fts5Buffer)(unsafe.Pointer(pRight)).Fn {
return (*Fts5Buffer)(unsafe.Pointer(pLeft)).Fn
}
return (*Fts5Buffer)(unsafe.Pointer(pRight)).Fn
}()
- var res int32 = func() int32 {
- if (nCmp) == 0 {
+
+ res = func() int32 {
+ if nCmp <= 0 {
return 0
}
return libc.Xmemcmp(tls, (*Fts5Buffer)(unsafe.Pointer(pLeft)).Fp, (*Fts5Buffer)(unsafe.Pointer(pRight)).Fp, uint32(nCmp))
}()
return func() int32 {
if res == 0 {
- return ((*Fts5Buffer)(unsafe.Pointer(pLeft)).Fn - (*Fts5Buffer)(unsafe.Pointer(pRight)).Fn)
+ return (*Fts5Buffer)(unsafe.Pointer(pLeft)).Fn - (*Fts5Buffer)(unsafe.Pointer(pRight)).Fn
}
return res
}()
}
-func fts5LeafFirstTermOff(tls *libc.TLS, pLeaf uintptr) int32 { /* sqlite3.c:221663:12: */
+func fts5LeafFirstTermOff(tls *libc.TLS, pLeaf uintptr) int32 { /* sqlite3.c:223491:12: */
bp := tls.Alloc(4)
defer tls.Free(4)
// var ret int32 at bp, 4
- sqlite3Fts5GetVarint32(tls, ((*Fts5Data)(unsafe.Pointer(pLeaf)).Fp + uintptr((*Fts5Data)(unsafe.Pointer(pLeaf)).FszLeaf)), bp /* &ret */)
+ sqlite3Fts5GetVarint32(tls, (*Fts5Data)(unsafe.Pointer(pLeaf)).Fp+uintptr((*Fts5Data)(unsafe.Pointer(pLeaf)).FszLeaf), bp /* &ret */)
return *(*int32)(unsafe.Pointer(bp /* ret */))
}
// Close the read-only blob handle, if it is open.
-func sqlite3Fts5IndexCloseReader(tls *libc.TLS, p uintptr) { /* sqlite3.c:221672:13: */
+func sqlite3Fts5IndexCloseReader(tls *libc.TLS, p uintptr) { /* sqlite3.c:223500:13: */
if (*Fts5Index)(unsafe.Pointer(p)).FpReader != 0 {
var pReader uintptr = (*Fts5Index)(unsafe.Pointer(p)).FpReader
(*Fts5Index)(unsafe.Pointer(p)).FpReader = uintptr(0)
@@ -178511,7 +180855,7 @@ func sqlite3Fts5IndexCloseReader(tls *libc.TLS, p uintptr) { /* sqlite3.c:221672
//
// If an error occurs, NULL is returned and an error left in the
// Fts5Index object.
-func fts5DataRead(tls *libc.TLS, p uintptr, iRowid I64) uintptr { /* sqlite3.c:221686:17: */
+func fts5DataRead(tls *libc.TLS, p uintptr, iRowid I64) uintptr { /* sqlite3.c:223514:17: */
var pRet uintptr = uintptr(0)
if (*Fts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK {
var rc int32 = SQLITE_OK
@@ -178535,10 +180879,10 @@ func fts5DataRead(tls *libc.TLS, p uintptr, iRowid I64) uintptr { /* sqlite3.c:2
// If the blob handle is not open at this point, open it and seek
// to the requested entry.
- if ((*Fts5Index)(unsafe.Pointer(p)).FpReader == uintptr(0)) && (rc == SQLITE_OK) {
+ if (*Fts5Index)(unsafe.Pointer(p)).FpReader == uintptr(0) && rc == SQLITE_OK {
var pConfig uintptr = (*Fts5Index)(unsafe.Pointer(p)).FpConfig
rc = Xsqlite3_blob_open(tls, (*Fts5Config)(unsafe.Pointer(pConfig)).Fdb,
- (*Fts5Config)(unsafe.Pointer(pConfig)).FzDb, (*Fts5Index)(unsafe.Pointer(p)).FzDataTbl, ts+33025 /* "block" */, iRowid, 0, (p + 40 /* &.pReader */))
+ (*Fts5Config)(unsafe.Pointer(pConfig)).FzDb, (*Fts5Index)(unsafe.Pointer(p)).FzDataTbl, ts+34385 /* "block" */, iRowid, 0, p+40)
}
// If either of the sqlite3_blob_open() or sqlite3_blob_reopen() calls
@@ -178547,17 +180891,17 @@ func fts5DataRead(tls *libc.TLS, p uintptr, iRowid I64) uintptr { /* sqlite3.c:2
// table, missing row, non-blob/text in block column - indicate
// backing store corruption.
if rc == SQLITE_ERROR {
- rc = (SQLITE_CORRUPT | (int32(1) << 8))
+ rc = SQLITE_CORRUPT | int32(1)<<8
}
if rc == SQLITE_OK {
var aOut uintptr = uintptr(0) // Read blob data into this buffer
var nByte int32 = Xsqlite3_blob_bytes(tls, (*Fts5Index)(unsafe.Pointer(p)).FpReader)
- var nAlloc Sqlite3_int64 = (Sqlite3_int64((uint32(unsafe.Sizeof(Fts5Data{})) + uint32(nByte)) + uint32(FTS5_DATA_PADDING)))
+ var nAlloc Sqlite3_int64 = Sqlite3_int64(uint32(unsafe.Sizeof(Fts5Data{})) + uint32(nByte) + uint32(FTS5_DATA_PADDING))
pRet = Xsqlite3_malloc64(tls, uint64(nAlloc))
if pRet != 0 {
(*Fts5Data)(unsafe.Pointer(pRet)).Fnn = nByte
- aOut = libc.AssignPtrUintptr(pRet /* &.p */, (pRet + 1*12))
+ aOut = libc.AssignPtrUintptr(pRet, pRet+1*12)
} else {
rc = SQLITE_NOMEM
}
@@ -178571,8 +180915,8 @@ func fts5DataRead(tls *libc.TLS, p uintptr, iRowid I64) uintptr { /* sqlite3.c:2
} else {
// TODO1: Fix this
*(*U8)(unsafe.Pointer((*Fts5Data)(unsafe.Pointer(pRet)).Fp + uintptr(nByte))) = U8(0x00)
- *(*U8)(unsafe.Pointer((*Fts5Data)(unsafe.Pointer(pRet)).Fp + uintptr((nByte + 1)))) = U8(0x00)
- (*Fts5Data)(unsafe.Pointer(pRet)).FszLeaf = int32(fts5GetU16(tls, ((*Fts5Data)(unsafe.Pointer(pRet)).Fp + 2)))
+ *(*U8)(unsafe.Pointer((*Fts5Data)(unsafe.Pointer(pRet)).Fp + uintptr(nByte+1))) = U8(0x00)
+ (*Fts5Data)(unsafe.Pointer(pRet)).FszLeaf = int32(fts5GetU16(tls, (*Fts5Data)(unsafe.Pointer(pRet)).Fp+2))
}
}
(*Fts5Index)(unsafe.Pointer(p)).Frc = rc
@@ -178584,15 +180928,15 @@ func fts5DataRead(tls *libc.TLS, p uintptr, iRowid I64) uintptr { /* sqlite3.c:2
// Release a reference to data record returned by an earlier call to
// fts5DataRead().
-func fts5DataRelease(tls *libc.TLS, pData uintptr) { /* sqlite3.c:221759:13: */
+func fts5DataRelease(tls *libc.TLS, pData uintptr) { /* sqlite3.c:223588:13: */
Xsqlite3_free(tls, pData)
}
-func fts5LeafRead(tls *libc.TLS, p uintptr, iRowid I64) uintptr { /* sqlite3.c:221763:17: */
+func fts5LeafRead(tls *libc.TLS, p uintptr, iRowid I64) uintptr { /* sqlite3.c:223592:17: */
var pRet uintptr = fts5DataRead(tls, p, iRowid)
if pRet != 0 {
- if ((*Fts5Data)(unsafe.Pointer(pRet)).Fnn < 4) || ((*Fts5Data)(unsafe.Pointer(pRet)).FszLeaf > (*Fts5Data)(unsafe.Pointer(pRet)).Fnn) {
- (*Fts5Index)(unsafe.Pointer(p)).Frc = (SQLITE_CORRUPT | (int32(1) << 8))
+ if (*Fts5Data)(unsafe.Pointer(pRet)).Fnn < 4 || (*Fts5Data)(unsafe.Pointer(pRet)).FszLeaf > (*Fts5Data)(unsafe.Pointer(pRet)).Fnn {
+ (*Fts5Index)(unsafe.Pointer(p)).Frc = SQLITE_CORRUPT | int32(1)<<8
fts5DataRelease(tls, pRet)
pRet = uintptr(0)
}
@@ -178600,11 +180944,11 @@ func fts5LeafRead(tls *libc.TLS, p uintptr, iRowid I64) uintptr { /* sqlite3.c:2
return pRet
}
-func fts5IndexPrepareStmt(tls *libc.TLS, p uintptr, ppStmt uintptr, zSql uintptr) int32 { /* sqlite3.c:221775:12: */
+func fts5IndexPrepareStmt(tls *libc.TLS, p uintptr, ppStmt uintptr, zSql uintptr) int32 { /* sqlite3.c:223604:12: */
if (*Fts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK {
if zSql != 0 {
(*Fts5Index)(unsafe.Pointer(p)).Frc = Xsqlite3_prepare_v3(tls, (*Fts5Config)(unsafe.Pointer((*Fts5Index)(unsafe.Pointer(p)).FpConfig)).Fdb, zSql, -1,
- (uint32(SQLITE_PREPARE_PERSISTENT | SQLITE_PREPARE_NO_VTAB)),
+ uint32(SQLITE_PREPARE_PERSISTENT|SQLITE_PREPARE_NO_VTAB),
ppStmt, uintptr(0))
} else {
(*Fts5Index)(unsafe.Pointer(p)).Frc = SQLITE_NOMEM
@@ -178615,7 +180959,7 @@ func fts5IndexPrepareStmt(tls *libc.TLS, p uintptr, ppStmt uintptr, zSql uintptr
}
// INSERT OR REPLACE a record into the %_data table.
-func fts5DataWrite(tls *libc.TLS, p uintptr, iRowid I64, pData uintptr, nData int32) { /* sqlite3.c:221797:13: */
+func fts5DataWrite(tls *libc.TLS, p uintptr, iRowid I64, pData uintptr, nData int32) { /* sqlite3.c:223626:13: */
bp := tls.Alloc(16)
defer tls.Free(16)
@@ -178625,8 +180969,8 @@ func fts5DataWrite(tls *libc.TLS, p uintptr, iRowid I64, pData uintptr, nData in
if (*Fts5Index)(unsafe.Pointer(p)).FpWriter == uintptr(0) {
var pConfig uintptr = (*Fts5Index)(unsafe.Pointer(p)).FpConfig
- fts5IndexPrepareStmt(tls, p, (p + 44 /* &.pWriter */), Xsqlite3_mprintf(tls,
- ts+33031, /* "REPLACE INTO '%q..." */
+ fts5IndexPrepareStmt(tls, p, p+44, Xsqlite3_mprintf(tls,
+ ts+34391, /* "REPLACE INTO '%q..." */
libc.VaList(bp, (*Fts5Config)(unsafe.Pointer(pConfig)).FzDb, (*Fts5Config)(unsafe.Pointer(pConfig)).FzName)))
if (*Fts5Index)(unsafe.Pointer(p)).Frc != 0 {
return
@@ -178643,7 +180987,7 @@ func fts5DataWrite(tls *libc.TLS, p uintptr, iRowid I64, pData uintptr, nData in
// Execute the following SQL:
//
// DELETE FROM %_data WHERE id BETWEEN $iFirst AND $iLast
-func fts5DataDelete(tls *libc.TLS, p uintptr, iFirst I64, iLast I64) { /* sqlite3.c:221821:13: */
+func fts5DataDelete(tls *libc.TLS, p uintptr, iFirst I64, iLast I64) { /* sqlite3.c:223650:13: */
bp := tls.Alloc(16)
defer tls.Free(16)
@@ -178654,9 +180998,9 @@ func fts5DataDelete(tls *libc.TLS, p uintptr, iFirst I64, iLast I64) { /* sqlite
if (*Fts5Index)(unsafe.Pointer(p)).FpDeleter == uintptr(0) {
var pConfig uintptr = (*Fts5Index)(unsafe.Pointer(p)).FpConfig
var zSql uintptr = Xsqlite3_mprintf(tls,
- ts+33082, /* "DELETE FROM '%q'..." */
+ ts+34442, /* "DELETE FROM '%q'..." */
libc.VaList(bp, (*Fts5Config)(unsafe.Pointer(pConfig)).FzDb, (*Fts5Config)(unsafe.Pointer(pConfig)).FzName))
- if fts5IndexPrepareStmt(tls, p, (p+48 /* &.pDeleter */), zSql) != 0 {
+ if fts5IndexPrepareStmt(tls, p, p+48, zSql) != 0 {
return
}
}
@@ -178668,17 +181012,17 @@ func fts5DataDelete(tls *libc.TLS, p uintptr, iFirst I64, iLast I64) { /* sqlite
}
// Remove all records associated with segment iSegid.
-func fts5DataRemoveSegment(tls *libc.TLS, p uintptr, iSegid int32) { /* sqlite3.c:221842:13: */
+func fts5DataRemoveSegment(tls *libc.TLS, p uintptr, iSegid int32) { /* sqlite3.c:223671:13: */
bp := tls.Alloc(16)
defer tls.Free(16)
- var iFirst I64 = (((((I64(iSegid)) << ((FTS5_DATA_PAGE_B + FTS5_DATA_HEIGHT_B) + FTS5_DATA_DLI_B)) + (I64((int64(0))) << (FTS5_DATA_PAGE_B + FTS5_DATA_HEIGHT_B))) + (I64((int64(0))) << (FTS5_DATA_PAGE_B))) + (int64(0)))
- var iLast I64 = ((((((I64(iSegid + 1)) << ((FTS5_DATA_PAGE_B + FTS5_DATA_HEIGHT_B) + FTS5_DATA_DLI_B)) + (I64((int64(0))) << (FTS5_DATA_PAGE_B + FTS5_DATA_HEIGHT_B))) + (I64((int64(0))) << (FTS5_DATA_PAGE_B))) + (int64(0))) - int64(1))
+ var iFirst I64 = I64(iSegid)<<(FTS5_DATA_PAGE_B+FTS5_DATA_HEIGHT_B+FTS5_DATA_DLI_B) + I64(int64(0))<<(FTS5_DATA_PAGE_B+FTS5_DATA_HEIGHT_B) + I64(int64(0))<<FTS5_DATA_PAGE_B + int64(0)
+ var iLast I64 = I64(iSegid+1)<<(FTS5_DATA_PAGE_B+FTS5_DATA_HEIGHT_B+FTS5_DATA_DLI_B) + I64(int64(0))<<(FTS5_DATA_PAGE_B+FTS5_DATA_HEIGHT_B) + I64(int64(0))<<FTS5_DATA_PAGE_B + int64(0) - int64(1)
fts5DataDelete(tls, p, iFirst, iLast)
if (*Fts5Index)(unsafe.Pointer(p)).FpIdxDeleter == uintptr(0) {
var pConfig uintptr = (*Fts5Index)(unsafe.Pointer(p)).FpConfig
- fts5IndexPrepareStmt(tls, p, (p + 56 /* &.pIdxDeleter */), Xsqlite3_mprintf(tls,
- ts+33131, /* "DELETE FROM '%q'..." */
+ fts5IndexPrepareStmt(tls, p, p+56, Xsqlite3_mprintf(tls,
+ ts+34491, /* "DELETE FROM '%q'..." */
libc.VaList(bp, (*Fts5Config)(unsafe.Pointer(pConfig)).FzDb, (*Fts5Config)(unsafe.Pointer(pConfig)).FzName)))
}
if (*Fts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK {
@@ -178690,21 +181034,75 @@ func fts5DataRemoveSegment(tls *libc.TLS, p uintptr, iSegid int32) { /* sqlite3.
// Release a reference to an Fts5Structure object returned by an earlier
// call to fts5StructureRead() or fts5StructureDecode().
-func fts5StructureRelease(tls *libc.TLS, pStruct uintptr) { /* sqlite3.c:221864:13: */
- if (pStruct != 0) && (0 >= (libc.PreDecInt32(&(*Fts5Structure)(unsafe.Pointer(pStruct)).FnRef, 1))) {
+func fts5StructureRelease(tls *libc.TLS, pStruct uintptr) { /* sqlite3.c:223693:13: */
+ if pStruct != 0 && 0 >= libc.PreDecInt32(&(*Fts5Structure)(unsafe.Pointer(pStruct)).FnRef, 1) {
var i int32
for i = 0; i < (*Fts5Structure)(unsafe.Pointer(pStruct)).FnLevel; i++ {
- Xsqlite3_free(tls, (*Fts5StructureLevel)(unsafe.Pointer((pStruct+24 /* &.aLevel */)+uintptr(i)*12)).FaSeg)
+ Xsqlite3_free(tls, (*Fts5StructureLevel)(unsafe.Pointer(pStruct+24+uintptr(i)*12)).FaSeg)
}
Xsqlite3_free(tls, pStruct)
}
}
-func fts5StructureRef(tls *libc.TLS, pStruct uintptr) { /* sqlite3.c:221875:13: */
+func fts5StructureRef(tls *libc.TLS, pStruct uintptr) { /* sqlite3.c:223704:13: */
(*Fts5Structure)(unsafe.Pointer(pStruct)).FnRef++
}
+func sqlite3Fts5StructureRef(tls *libc.TLS, p uintptr) uintptr { /* sqlite3.c:223708:13: */
+ fts5StructureRef(tls, (*Fts5Index)(unsafe.Pointer(p)).FpStruct)
+ return (*Fts5Index)(unsafe.Pointer(p)).FpStruct
+}
+
+func sqlite3Fts5StructureRelease(tls *libc.TLS, p uintptr) { /* sqlite3.c:223712:13: */
+ if p != 0 {
+ fts5StructureRelease(tls, p)
+ }
+}
+
+func sqlite3Fts5StructureTest(tls *libc.TLS, p uintptr, pStruct uintptr) int32 { /* sqlite3.c:223717:12: */
+ if (*Fts5Index)(unsafe.Pointer(p)).FpStruct != pStruct {
+ return SQLITE_ABORT
+ }
+ return SQLITE_OK
+}
+
+// Ensure that structure object (*pp) is writable.
+//
+// This function is a no-op if (*pRc) is not SQLITE_OK when it is called. If
+// an error occurs, (*pRc) is set to an SQLite error code before returning.
+func fts5StructureMakeWritable(tls *libc.TLS, pRc uintptr, pp uintptr) { /* sqlite3.c:223730:13: */
+ var p uintptr = *(*uintptr)(unsafe.Pointer(pp))
+ if *(*int32)(unsafe.Pointer(pRc)) == SQLITE_OK && (*Fts5Structure)(unsafe.Pointer(p)).FnRef > 1 {
+ var nByte I64 = I64(uint32(unsafe.Sizeof(Fts5Structure{})) + uint32((*Fts5Structure)(unsafe.Pointer(p)).FnLevel-1)*uint32(unsafe.Sizeof(Fts5StructureLevel{})))
+ var pNew uintptr
+ pNew = sqlite3Fts5MallocZero(tls, pRc, nByte)
+ if pNew != 0 {
+ var i int32
+ libc.Xmemcpy(tls, pNew, p, uint32(nByte))
+ for i = 0; i < (*Fts5Structure)(unsafe.Pointer(p)).FnLevel; i++ {
+ (*Fts5StructureLevel)(unsafe.Pointer(pNew + 24 + uintptr(i)*12)).FaSeg = uintptr(0)
+ }
+ for i = 0; i < (*Fts5Structure)(unsafe.Pointer(p)).FnLevel; i++ {
+ var pLvl uintptr = pNew + 24 + uintptr(i)*12
+ nByte = I64(uint32(unsafe.Sizeof(Fts5StructureSegment{})) * uint32((*Fts5StructureLevel)(unsafe.Pointer(pNew+24+uintptr(i)*12)).FnSeg))
+ (*Fts5StructureLevel)(unsafe.Pointer(pLvl)).FaSeg = sqlite3Fts5MallocZero(tls, pRc, nByte)
+ if (*Fts5StructureLevel)(unsafe.Pointer(pLvl)).FaSeg == uintptr(0) {
+ for i = 0; i < (*Fts5Structure)(unsafe.Pointer(p)).FnLevel; i++ {
+ Xsqlite3_free(tls, (*Fts5StructureLevel)(unsafe.Pointer(pNew+24+uintptr(i)*12)).FaSeg)
+ }
+ Xsqlite3_free(tls, pNew)
+ return
+ }
+ libc.Xmemcpy(tls, (*Fts5StructureLevel)(unsafe.Pointer(pLvl)).FaSeg, (*Fts5StructureLevel)(unsafe.Pointer(p+24+uintptr(i)*12)).FaSeg, uint32(nByte))
+ }
+ (*Fts5Structure)(unsafe.Pointer(p)).FnRef--
+ (*Fts5Structure)(unsafe.Pointer(pNew)).FnRef = 1
+ }
+ *(*uintptr)(unsafe.Pointer(pp)) = pNew
+ }
+}
+
// Deserialize and return the structure record currently stored in serialized
// form within buffer pData/nData.
//
@@ -178715,7 +181113,7 @@ func fts5StructureRef(tls *libc.TLS, pStruct uintptr) { /* sqlite3.c:221875:13:
// If an error occurs, *ppOut is set to NULL and an SQLite error code
// returned. Otherwise, *ppOut is set to point to the new object and
// SQLITE_OK returned.
-func fts5StructureDecode(tls *libc.TLS, pData uintptr, nData int32, piCookie uintptr, ppOut uintptr) int32 { /* sqlite3.c:221891:12: */
+func fts5StructureDecode(tls *libc.TLS, pData uintptr, nData int32, piCookie uintptr, ppOut uintptr) int32 { /* sqlite3.c:223772:12: */
bp := tls.Alloc(16)
defer tls.Free(16)
@@ -178735,68 +181133,68 @@ func fts5StructureDecode(tls *libc.TLS, pData uintptr, nData int32, piCookie uin
// Read the total number of levels and segments from the start of the
// structure record.
- i = i + (sqlite3Fts5GetVarint32(tls, (pData + uintptr(i)), bp /* &nLevel */))
- i = i + (sqlite3Fts5GetVarint32(tls, (pData + uintptr(i)), bp+4 /* &nSegment */))
- if (((*(*int32)(unsafe.Pointer(bp /* nLevel */)) > FTS5_MAX_SEGMENT) || (*(*int32)(unsafe.Pointer(bp /* nLevel */)) < 0)) ||
- (*(*int32)(unsafe.Pointer(bp + 4 /* nSegment */)) > FTS5_MAX_SEGMENT)) || (*(*int32)(unsafe.Pointer(bp + 4 /* nSegment */)) < 0) {
- return (SQLITE_CORRUPT | (int32(1) << 8))
+ i = i + sqlite3Fts5GetVarint32(tls, pData+uintptr(i), bp)
+ i = i + sqlite3Fts5GetVarint32(tls, pData+uintptr(i), bp+4)
+ if *(*int32)(unsafe.Pointer(bp)) > FTS5_MAX_SEGMENT || *(*int32)(unsafe.Pointer(bp)) < 0 ||
+ *(*int32)(unsafe.Pointer(bp + 4)) > FTS5_MAX_SEGMENT || *(*int32)(unsafe.Pointer(bp + 4)) < 0 {
+ return SQLITE_CORRUPT | int32(1)<<8
}
- nByte = (Sqlite3_int64(uint32(unsafe.Sizeof(Fts5Structure{})) + (uint32(unsafe.Sizeof(Fts5StructureLevel{})) * (uint32(*(*int32)(unsafe.Pointer(bp /* nLevel */)) - 1)))))
+ nByte = Sqlite3_int64(uint32(unsafe.Sizeof(Fts5Structure{})) + uint32(unsafe.Sizeof(Fts5StructureLevel{}))*uint32(*(*int32)(unsafe.Pointer(bp))-1))
pRet = sqlite3Fts5MallocZero(tls, bp+8 /* &rc */, nByte)
if pRet != 0 {
(*Fts5Structure)(unsafe.Pointer(pRet)).FnRef = 1
(*Fts5Structure)(unsafe.Pointer(pRet)).FnLevel = *(*int32)(unsafe.Pointer(bp /* nLevel */))
(*Fts5Structure)(unsafe.Pointer(pRet)).FnSegment = *(*int32)(unsafe.Pointer(bp + 4 /* nSegment */))
- i = i + (int32(sqlite3Fts5GetVarint(tls, (pData + uintptr(i)), (pRet + 8 /* &.nWriteCounter */))))
+ i = i + int32(sqlite3Fts5GetVarint(tls, pData+uintptr(i), pRet+8))
- for iLvl = 0; (*(*int32)(unsafe.Pointer(bp + 8 /* rc */)) == SQLITE_OK) && (iLvl < *(*int32)(unsafe.Pointer(bp /* nLevel */))); iLvl++ {
- var pLvl uintptr = ((pRet + 24 /* &.aLevel */) + uintptr(iLvl)*12)
+ for iLvl = 0; *(*int32)(unsafe.Pointer(bp + 8 /* rc */)) == SQLITE_OK && iLvl < *(*int32)(unsafe.Pointer(bp /* nLevel */)); iLvl++ {
+ var pLvl uintptr = pRet + 24 + uintptr(iLvl)*12
*(*int32)(unsafe.Pointer(bp + 12 /* nTotal */)) = 0
var iSeg int32
if i >= nData {
- *(*int32)(unsafe.Pointer(bp + 8 /* rc */)) = (SQLITE_CORRUPT | (int32(1) << 8))
+ *(*int32)(unsafe.Pointer(bp + 8 /* rc */)) = SQLITE_CORRUPT | int32(1)<<8
} else {
- i = i + (sqlite3Fts5GetVarint32(tls, (pData + uintptr(i)), (pLvl /* &.nMerge */)))
- i = i + (sqlite3Fts5GetVarint32(tls, (pData + uintptr(i)), bp+12 /* &nTotal */))
- if *(*int32)(unsafe.Pointer(bp + 12 /* nTotal */)) < (*Fts5StructureLevel)(unsafe.Pointer(pLvl)).FnMerge {
- *(*int32)(unsafe.Pointer(bp + 8 /* rc */)) = (SQLITE_CORRUPT | (int32(1) << 8))
+ i = i + sqlite3Fts5GetVarint32(tls, pData+uintptr(i), pLvl)
+ i = i + sqlite3Fts5GetVarint32(tls, pData+uintptr(i), bp+12)
+ if *(*int32)(unsafe.Pointer(bp + 12)) < (*Fts5StructureLevel)(unsafe.Pointer(pLvl)).FnMerge {
+ *(*int32)(unsafe.Pointer(bp + 8 /* rc */)) = SQLITE_CORRUPT | int32(1)<<8
}
(*Fts5StructureLevel)(unsafe.Pointer(pLvl)).FaSeg = sqlite3Fts5MallocZero(tls, bp+8, /* &rc */
- (int64(uint32(*(*int32)(unsafe.Pointer(bp + 12 /* nTotal */))) * uint32(unsafe.Sizeof(Fts5StructureSegment{})))))
+ int64(uint32(*(*int32)(unsafe.Pointer(bp + 12)))*uint32(unsafe.Sizeof(Fts5StructureSegment{}))))
*(*int32)(unsafe.Pointer(bp + 4 /* nSegment */)) -= *(*int32)(unsafe.Pointer(bp + 12 /* nTotal */))
}
- if *(*int32)(unsafe.Pointer(bp + 8 /* rc */)) == SQLITE_OK {
+ if *(*int32)(unsafe.Pointer(bp + 8)) == SQLITE_OK {
(*Fts5StructureLevel)(unsafe.Pointer(pLvl)).FnSeg = *(*int32)(unsafe.Pointer(bp + 12 /* nTotal */))
for iSeg = 0; iSeg < *(*int32)(unsafe.Pointer(bp + 12 /* nTotal */)); iSeg++ {
- var pSeg uintptr = ((*Fts5StructureLevel)(unsafe.Pointer(pLvl)).FaSeg + uintptr(iSeg)*12)
+ var pSeg uintptr = (*Fts5StructureLevel)(unsafe.Pointer(pLvl)).FaSeg + uintptr(iSeg)*12
if i >= nData {
- *(*int32)(unsafe.Pointer(bp + 8 /* rc */)) = (SQLITE_CORRUPT | (int32(1) << 8))
+ *(*int32)(unsafe.Pointer(bp + 8 /* rc */)) = SQLITE_CORRUPT | int32(1)<<8
break
}
- i = i + (sqlite3Fts5GetVarint32(tls, (pData + uintptr(i)), (pSeg /* &.iSegid */)))
- i = i + (sqlite3Fts5GetVarint32(tls, (pData + uintptr(i)), (pSeg + 4 /* &.pgnoFirst */)))
- i = i + (sqlite3Fts5GetVarint32(tls, (pData + uintptr(i)), (pSeg + 8 /* &.pgnoLast */)))
+ i = i + sqlite3Fts5GetVarint32(tls, pData+uintptr(i), pSeg)
+ i = i + sqlite3Fts5GetVarint32(tls, pData+uintptr(i), pSeg+4)
+ i = i + sqlite3Fts5GetVarint32(tls, pData+uintptr(i), pSeg+8)
if (*Fts5StructureSegment)(unsafe.Pointer(pSeg)).FpgnoLast < (*Fts5StructureSegment)(unsafe.Pointer(pSeg)).FpgnoFirst {
- *(*int32)(unsafe.Pointer(bp + 8 /* rc */)) = (SQLITE_CORRUPT | (int32(1) << 8))
+ *(*int32)(unsafe.Pointer(bp + 8 /* rc */)) = SQLITE_CORRUPT | int32(1)<<8
break
}
}
- if ((iLvl > 0) && ((*Fts5StructureLevel)(unsafe.Pointer(pLvl+libc.UintptrFromInt32(-1)*12)).FnMerge != 0)) && (*(*int32)(unsafe.Pointer(bp + 12 /* nTotal */)) == 0) {
- *(*int32)(unsafe.Pointer(bp + 8 /* rc */)) = (SQLITE_CORRUPT | (int32(1) << 8))
+ if iLvl > 0 && (*Fts5StructureLevel)(unsafe.Pointer(pLvl+libc.UintptrFromInt32(-1)*12)).FnMerge != 0 && *(*int32)(unsafe.Pointer(bp + 12)) == 0 {
+ *(*int32)(unsafe.Pointer(bp + 8 /* rc */)) = SQLITE_CORRUPT | int32(1)<<8
}
- if (iLvl == (*(*int32)(unsafe.Pointer(bp /* nLevel */)) - 1)) && ((*Fts5StructureLevel)(unsafe.Pointer(pLvl)).FnMerge != 0) {
- *(*int32)(unsafe.Pointer(bp + 8 /* rc */)) = (SQLITE_CORRUPT | (int32(1) << 8))
+ if iLvl == *(*int32)(unsafe.Pointer(bp))-1 && (*Fts5StructureLevel)(unsafe.Pointer(pLvl)).FnMerge != 0 {
+ *(*int32)(unsafe.Pointer(bp + 8 /* rc */)) = SQLITE_CORRUPT | int32(1)<<8
}
}
}
- if (*(*int32)(unsafe.Pointer(bp + 4 /* nSegment */)) != 0) && (*(*int32)(unsafe.Pointer(bp + 8 /* rc */)) == SQLITE_OK) {
- *(*int32)(unsafe.Pointer(bp + 8 /* rc */)) = (SQLITE_CORRUPT | (int32(1) << 8))
+ if *(*int32)(unsafe.Pointer(bp + 4)) != 0 && *(*int32)(unsafe.Pointer(bp + 8)) == SQLITE_OK {
+ *(*int32)(unsafe.Pointer(bp + 8 /* rc */)) = SQLITE_CORRUPT | int32(1)<<8
}
- if *(*int32)(unsafe.Pointer(bp + 8 /* rc */)) != SQLITE_OK {
+ if *(*int32)(unsafe.Pointer(bp + 8)) != SQLITE_OK {
fts5StructureRelease(tls, pRet)
pRet = uintptr(0)
}
@@ -178806,16 +181204,18 @@ func fts5StructureDecode(tls *libc.TLS, pData uintptr, nData int32, piCookie uin
return *(*int32)(unsafe.Pointer(bp + 8 /* rc */))
}
-//
-func fts5StructureAddLevel(tls *libc.TLS, pRc uintptr, ppStruct uintptr) { /* sqlite3.c:221982:13: */
+// Add a level to the Fts5Structure.aLevel[] array of structure object
+// (*ppStruct).
+func fts5StructureAddLevel(tls *libc.TLS, pRc uintptr, ppStruct uintptr) { /* sqlite3.c:223864:13: */
+ fts5StructureMakeWritable(tls, pRc, ppStruct)
if *(*int32)(unsafe.Pointer(pRc)) == SQLITE_OK {
var pStruct uintptr = *(*uintptr)(unsafe.Pointer(ppStruct))
var nLevel int32 = (*Fts5Structure)(unsafe.Pointer(pStruct)).FnLevel
- var nByte Sqlite3_int64 = (Sqlite3_int64(uint32(unsafe.Sizeof(Fts5Structure{})) + (uint32(unsafe.Sizeof(Fts5StructureLevel{})) * (uint32(nLevel + 1)))))
+ var nByte Sqlite3_int64 = Sqlite3_int64(uint32(unsafe.Sizeof(Fts5Structure{})) + uint32(unsafe.Sizeof(Fts5StructureLevel{}))*uint32(nLevel+1))
pStruct = Xsqlite3_realloc64(tls, pStruct, uint64(nByte))
if pStruct != 0 {
- libc.Xmemset(tls, ((pStruct + 24 /* &.aLevel */) + uintptr(nLevel)*12), 0, uint32(unsafe.Sizeof(Fts5StructureLevel{})))
+ libc.Xmemset(tls, pStruct+24+uintptr(nLevel)*12, 0, uint32(unsafe.Sizeof(Fts5StructureLevel{})))
(*Fts5Structure)(unsafe.Pointer(pStruct)).FnLevel++
*(*uintptr)(unsafe.Pointer(ppStruct)) = pStruct
} else {
@@ -178826,21 +181226,21 @@ func fts5StructureAddLevel(tls *libc.TLS, pRc uintptr, ppStruct uintptr) { /* sq
// Extend level iLvl so that there is room for at least nExtra more
// segments.
-func fts5StructureExtendLevel(tls *libc.TLS, pRc uintptr, pStruct uintptr, iLvl int32, nExtra int32, bInsert int32) { /* sqlite3.c:222006:13: */
+func fts5StructureExtendLevel(tls *libc.TLS, pRc uintptr, pStruct uintptr, iLvl int32, nExtra int32, bInsert int32) { /* sqlite3.c:223889:13: */
if *(*int32)(unsafe.Pointer(pRc)) == SQLITE_OK {
- var pLvl uintptr = ((pStruct + 24 /* &.aLevel */) + uintptr(iLvl)*12)
+ var pLvl uintptr = pStruct + 24 + uintptr(iLvl)*12
var aNew uintptr
var nByte Sqlite3_int64
- nByte = (Sqlite3_int64((uint32((*Fts5StructureLevel)(unsafe.Pointer(pLvl)).FnSeg + nExtra)) * uint32(unsafe.Sizeof(Fts5StructureSegment{}))))
+ nByte = Sqlite3_int64(uint32((*Fts5StructureLevel)(unsafe.Pointer(pLvl)).FnSeg+nExtra) * uint32(unsafe.Sizeof(Fts5StructureSegment{})))
aNew = Xsqlite3_realloc64(tls, (*Fts5StructureLevel)(unsafe.Pointer(pLvl)).FaSeg, uint64(nByte))
if aNew != 0 {
if bInsert == 0 {
- libc.Xmemset(tls, (aNew + uintptr((*Fts5StructureLevel)(unsafe.Pointer(pLvl)).FnSeg)*12), 0, (uint32(unsafe.Sizeof(Fts5StructureSegment{})) * uint32(nExtra)))
+ libc.Xmemset(tls, aNew+uintptr((*Fts5StructureLevel)(unsafe.Pointer(pLvl)).FnSeg)*12, 0, uint32(unsafe.Sizeof(Fts5StructureSegment{}))*uint32(nExtra))
} else {
- var nMove int32 = (int32(uint32((*Fts5StructureLevel)(unsafe.Pointer(pLvl)).FnSeg) * uint32(unsafe.Sizeof(Fts5StructureSegment{}))))
- libc.Xmemmove(tls, (aNew + uintptr(nExtra)*12), aNew, uint32(nMove))
- libc.Xmemset(tls, aNew, 0, (uint32(unsafe.Sizeof(Fts5StructureSegment{})) * uint32(nExtra)))
+ var nMove int32 = int32(uint32((*Fts5StructureLevel)(unsafe.Pointer(pLvl)).FnSeg) * uint32(unsafe.Sizeof(Fts5StructureSegment{})))
+ libc.Xmemmove(tls, aNew+uintptr(nExtra)*12, aNew, uint32(nMove))
+ libc.Xmemset(tls, aNew, 0, uint32(unsafe.Sizeof(Fts5StructureSegment{}))*uint32(nExtra))
}
(*Fts5StructureLevel)(unsafe.Pointer(pLvl)).FaSeg = aNew
} else {
@@ -178849,7 +181249,7 @@ func fts5StructureExtendLevel(tls *libc.TLS, pRc uintptr, pStruct uintptr, iLvl
}
}
-func fts5StructureReadUncached(tls *libc.TLS, p uintptr) uintptr { /* sqlite3.c:222035:22: */
+func fts5StructureReadUncached(tls *libc.TLS, p uintptr) uintptr { /* sqlite3.c:223918:22: */
bp := tls.Alloc(8)
defer tls.Free(8)
@@ -178862,9 +181262,9 @@ func fts5StructureReadUncached(tls *libc.TLS, p uintptr) uintptr { /* sqlite3.c:
pData = fts5DataRead(tls, p, int64(FTS5_STRUCTURE_ROWID))
if (*Fts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK {
// TODO: Do we need this if the leaf-index is appended? Probably...
- libc.Xmemset(tls, ((*Fts5Data)(unsafe.Pointer(pData)).Fp + uintptr((*Fts5Data)(unsafe.Pointer(pData)).Fnn)), 0, uint32(FTS5_DATA_PADDING))
+ libc.Xmemset(tls, (*Fts5Data)(unsafe.Pointer(pData)).Fp+uintptr((*Fts5Data)(unsafe.Pointer(pData)).Fnn), 0, uint32(FTS5_DATA_PADDING))
(*Fts5Index)(unsafe.Pointer(p)).Frc = fts5StructureDecode(tls, (*Fts5Data)(unsafe.Pointer(pData)).Fp, (*Fts5Data)(unsafe.Pointer(pData)).Fnn, bp /* &iCookie */, bp+4 /* &pRet */)
- if ((*Fts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK) && (((*Fts5Config)(unsafe.Pointer(pConfig)).Fpgsz == 0) || ((*Fts5Config)(unsafe.Pointer(pConfig)).FiCookie != *(*int32)(unsafe.Pointer(bp /* iCookie */)))) {
+ if (*Fts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK && ((*Fts5Config)(unsafe.Pointer(pConfig)).Fpgsz == 0 || (*Fts5Config)(unsafe.Pointer(pConfig)).FiCookie != *(*int32)(unsafe.Pointer(bp))) {
(*Fts5Index)(unsafe.Pointer(p)).Frc = sqlite3Fts5ConfigLoad(tls, pConfig, *(*int32)(unsafe.Pointer(bp /* iCookie */)))
}
fts5DataRelease(tls, pData)
@@ -178877,7 +181277,7 @@ func fts5StructureReadUncached(tls *libc.TLS, p uintptr) uintptr { /* sqlite3.c:
return *(*uintptr)(unsafe.Pointer(bp + 4 /* pRet */))
}
-func fts5IndexDataVersion(tls *libc.TLS, p uintptr) I64 { /* sqlite3.c:222059:12: */
+func fts5IndexDataVersion(tls *libc.TLS, p uintptr) I64 { /* sqlite3.c:223942:12: */
bp := tls.Alloc(8)
defer tls.Free(8)
@@ -178885,8 +181285,8 @@ func fts5IndexDataVersion(tls *libc.TLS, p uintptr) I64 { /* sqlite3.c:222059:12
if (*Fts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK {
if (*Fts5Index)(unsafe.Pointer(p)).FpDataVersion == uintptr(0) {
- (*Fts5Index)(unsafe.Pointer(p)).Frc = fts5IndexPrepareStmt(tls, p, (p + 68 /* &.pDataVersion */),
- Xsqlite3_mprintf(tls, ts+33171 /* "PRAGMA %Q.data_v..." */, libc.VaList(bp, (*Fts5Config)(unsafe.Pointer((*Fts5Index)(unsafe.Pointer(p)).FpConfig)).FzDb)))
+ (*Fts5Index)(unsafe.Pointer(p)).Frc = fts5IndexPrepareStmt(tls, p, p+68,
+ Xsqlite3_mprintf(tls, ts+34531 /* "PRAGMA %Q.data_v..." */, libc.VaList(bp, (*Fts5Config)(unsafe.Pointer((*Fts5Index)(unsafe.Pointer(p)).FpConfig)).FzDb)))
if (*Fts5Index)(unsafe.Pointer(p)).Frc != 0 {
return int64(0)
}
@@ -178910,7 +181310,7 @@ func fts5IndexDataVersion(tls *libc.TLS, p uintptr) I64 { /* sqlite3.c:222059:12
// If an error occurs, NULL is returned and an error code left in the
// Fts5Index handle. If an error has already occurred when this function
// is called, it is a no-op.
-func fts5StructureRead(tls *libc.TLS, p uintptr) uintptr { /* sqlite3.c:222090:22: */
+func fts5StructureRead(tls *libc.TLS, p uintptr) uintptr { /* sqlite3.c:223973:22: */
if (*Fts5Index)(unsafe.Pointer(p)).FpStruct == uintptr(0) {
(*Fts5Index)(unsafe.Pointer(p)).FiStructVersion = fts5IndexDataVersion(tls, p)
@@ -178927,7 +181327,7 @@ func fts5StructureRead(tls *libc.TLS, p uintptr) uintptr { /* sqlite3.c:222090:2
return (*Fts5Index)(unsafe.Pointer(p)).FpStruct
}
-func fts5StructureInvalidate(tls *libc.TLS, p uintptr) { /* sqlite3.c:222129:13: */
+func fts5StructureInvalidate(tls *libc.TLS, p uintptr) { /* sqlite3.c:224012:13: */
if (*Fts5Index)(unsafe.Pointer(p)).FpStruct != 0 {
fts5StructureRelease(tls, (*Fts5Index)(unsafe.Pointer(p)).FpStruct)
(*Fts5Index)(unsafe.Pointer(p)).FpStruct = uintptr(0)
@@ -178941,7 +181341,7 @@ func fts5StructureInvalidate(tls *libc.TLS, p uintptr) { /* sqlite3.c:222129:13:
//
// If an error occurs, leave an error code in the Fts5Index object. If an
// error has already occurred, this function is a no-op.
-func fts5StructureWrite(tls *libc.TLS, p uintptr, pStruct uintptr) { /* sqlite3.c:222172:13: */
+func fts5StructureWrite(tls *libc.TLS, p uintptr, pStruct uintptr) { /* sqlite3.c:224055:13: */
bp := tls.Alloc(12)
defer tls.Free(12)
@@ -178959,33 +181359,33 @@ func fts5StructureWrite(tls *libc.TLS, p uintptr, pStruct uintptr) { /* sqlite3.
iCookie = 0
}
- if 0 == sqlite3Fts5BufferSize(tls, (p+36 /* &.rc */), bp /* &buf */, (uint32(((4+9)+9)+9))) {
+ if 0 == sqlite3Fts5BufferSize(tls, p+36, bp, uint32(4+9+9+9)) {
sqlite3Fts5Put32(tls, (*Fts5Buffer)(unsafe.Pointer(bp /* &buf */)).Fp, iCookie)
(*Fts5Buffer)(unsafe.Pointer(bp /* &buf */)).Fn = 4
{
- *(*int32)(unsafe.Pointer(bp /* &buf */ + 4 /* &.n */)) += (sqlite3Fts5PutVarint(tls, ((*Fts5Buffer)(unsafe.Pointer((bp /* &buf */))).Fp + uintptr((*Fts5Buffer)(unsafe.Pointer((bp /* &buf */))).Fn)), uint64((*Fts5Structure)(unsafe.Pointer(pStruct)).FnLevel)))
+ *(*int32)(unsafe.Pointer(bp + 4)) += sqlite3Fts5PutVarint(tls, (*Fts5Buffer)(unsafe.Pointer(bp)).Fp+uintptr((*Fts5Buffer)(unsafe.Pointer(bp)).Fn), uint64((*Fts5Structure)(unsafe.Pointer(pStruct)).FnLevel))
}
{
- *(*int32)(unsafe.Pointer(bp /* &buf */ + 4 /* &.n */)) += (sqlite3Fts5PutVarint(tls, ((*Fts5Buffer)(unsafe.Pointer((bp /* &buf */))).Fp + uintptr((*Fts5Buffer)(unsafe.Pointer((bp /* &buf */))).Fn)), uint64((*Fts5Structure)(unsafe.Pointer(pStruct)).FnSegment)))
+ *(*int32)(unsafe.Pointer(bp + 4)) += sqlite3Fts5PutVarint(tls, (*Fts5Buffer)(unsafe.Pointer(bp)).Fp+uintptr((*Fts5Buffer)(unsafe.Pointer(bp)).Fn), uint64((*Fts5Structure)(unsafe.Pointer(pStruct)).FnSegment))
}
{
- *(*int32)(unsafe.Pointer(bp /* &buf */ + 4 /* &.n */)) += (sqlite3Fts5PutVarint(tls, ((*Fts5Buffer)(unsafe.Pointer((bp /* &buf */))).Fp + uintptr((*Fts5Buffer)(unsafe.Pointer((bp /* &buf */))).Fn)), uint64(I64((*Fts5Structure)(unsafe.Pointer(pStruct)).FnWriteCounter))))
+ *(*int32)(unsafe.Pointer(bp + 4)) += sqlite3Fts5PutVarint(tls, (*Fts5Buffer)(unsafe.Pointer(bp)).Fp+uintptr((*Fts5Buffer)(unsafe.Pointer(bp)).Fn), uint64(I64((*Fts5Structure)(unsafe.Pointer(pStruct)).FnWriteCounter)))
}
}
for iLvl = 0; iLvl < (*Fts5Structure)(unsafe.Pointer(pStruct)).FnLevel; iLvl++ {
var iSeg int32 // Used to iterate through segments
- var pLvl uintptr = ((pStruct + 24 /* &.aLevel */) + uintptr(iLvl)*12)
- sqlite3Fts5BufferAppendVarint(tls, (p + 36 /* &.rc */), bp /* &buf */, int64((*Fts5StructureLevel)(unsafe.Pointer(pLvl)).FnMerge))
- sqlite3Fts5BufferAppendVarint(tls, (p + 36 /* &.rc */), bp /* &buf */, int64((*Fts5StructureLevel)(unsafe.Pointer(pLvl)).FnSeg))
+ var pLvl uintptr = pStruct + 24 + uintptr(iLvl)*12
+ sqlite3Fts5BufferAppendVarint(tls, p+36, bp /* &buf */, int64((*Fts5StructureLevel)(unsafe.Pointer(pLvl)).FnMerge))
+ sqlite3Fts5BufferAppendVarint(tls, p+36, bp /* &buf */, int64((*Fts5StructureLevel)(unsafe.Pointer(pLvl)).FnSeg))
for iSeg = 0; iSeg < (*Fts5StructureLevel)(unsafe.Pointer(pLvl)).FnSeg; iSeg++ {
- sqlite3Fts5BufferAppendVarint(tls, (p + 36 /* &.rc */), bp /* &buf */, int64((*Fts5StructureSegment)(unsafe.Pointer((*Fts5StructureLevel)(unsafe.Pointer(pLvl)).FaSeg+uintptr(iSeg)*12)).FiSegid))
- sqlite3Fts5BufferAppendVarint(tls, (p + 36 /* &.rc */), bp /* &buf */, int64((*Fts5StructureSegment)(unsafe.Pointer((*Fts5StructureLevel)(unsafe.Pointer(pLvl)).FaSeg+uintptr(iSeg)*12)).FpgnoFirst))
- sqlite3Fts5BufferAppendVarint(tls, (p + 36 /* &.rc */), bp /* &buf */, int64((*Fts5StructureSegment)(unsafe.Pointer((*Fts5StructureLevel)(unsafe.Pointer(pLvl)).FaSeg+uintptr(iSeg)*12)).FpgnoLast))
+ sqlite3Fts5BufferAppendVarint(tls, p+36, bp /* &buf */, int64((*Fts5StructureSegment)(unsafe.Pointer((*Fts5StructureLevel)(unsafe.Pointer(pLvl)).FaSeg+uintptr(iSeg)*12)).FiSegid))
+ sqlite3Fts5BufferAppendVarint(tls, p+36, bp /* &buf */, int64((*Fts5StructureSegment)(unsafe.Pointer((*Fts5StructureLevel)(unsafe.Pointer(pLvl)).FaSeg+uintptr(iSeg)*12)).FpgnoFirst))
+ sqlite3Fts5BufferAppendVarint(tls, p+36, bp /* &buf */, int64((*Fts5StructureSegment)(unsafe.Pointer((*Fts5StructureLevel)(unsafe.Pointer(pLvl)).FaSeg+uintptr(iSeg)*12)).FpgnoLast))
}
}
@@ -178994,34 +181394,34 @@ func fts5StructureWrite(tls *libc.TLS, p uintptr, pStruct uintptr) { /* sqlite3.
}
}
-func fts5SegmentSize(tls *libc.TLS, pSeg uintptr) int32 { /* sqlite3.c:222227:12: */
- return ((1 + (*Fts5StructureSegment)(unsafe.Pointer(pSeg)).FpgnoLast) - (*Fts5StructureSegment)(unsafe.Pointer(pSeg)).FpgnoFirst)
+func fts5SegmentSize(tls *libc.TLS, pSeg uintptr) int32 { /* sqlite3.c:224110:12: */
+ return 1 + (*Fts5StructureSegment)(unsafe.Pointer(pSeg)).FpgnoLast - (*Fts5StructureSegment)(unsafe.Pointer(pSeg)).FpgnoFirst
}
// Return a copy of index structure pStruct. Except, promote as many
// segments as possible to level iPromote. If an OOM occurs, NULL is
// returned.
-func fts5StructurePromoteTo(tls *libc.TLS, p uintptr, iPromote int32, szPromote int32, pStruct uintptr) { /* sqlite3.c:222236:13: */
+func fts5StructurePromoteTo(tls *libc.TLS, p uintptr, iPromote int32, szPromote int32, pStruct uintptr) { /* sqlite3.c:224119:13: */
var il int32
var is int32
- var pOut uintptr = ((pStruct + 24 /* &.aLevel */) + uintptr(iPromote)*12)
+ var pOut uintptr = pStruct + 24 + uintptr(iPromote)*12
if (*Fts5StructureLevel)(unsafe.Pointer(pOut)).FnMerge == 0 {
- for il = (iPromote + 1); il < (*Fts5Structure)(unsafe.Pointer(pStruct)).FnLevel; il++ {
- var pLvl uintptr = ((pStruct + 24 /* &.aLevel */) + uintptr(il)*12)
+ for il = iPromote + 1; il < (*Fts5Structure)(unsafe.Pointer(pStruct)).FnLevel; il++ {
+ var pLvl uintptr = pStruct + 24 + uintptr(il)*12
if (*Fts5StructureLevel)(unsafe.Pointer(pLvl)).FnMerge != 0 {
return
}
- for is = ((*Fts5StructureLevel)(unsafe.Pointer(pLvl)).FnSeg - 1); is >= 0; is-- {
- var sz int32 = fts5SegmentSize(tls, ((*Fts5StructureLevel)(unsafe.Pointer(pLvl)).FaSeg + uintptr(is)*12))
+ for is = (*Fts5StructureLevel)(unsafe.Pointer(pLvl)).FnSeg - 1; is >= 0; is-- {
+ var sz int32 = fts5SegmentSize(tls, (*Fts5StructureLevel)(unsafe.Pointer(pLvl)).FaSeg+uintptr(is)*12)
if sz > szPromote {
return
}
- fts5StructureExtendLevel(tls, (p + 36 /* &.rc */), pStruct, iPromote, 1, 1)
+ fts5StructureExtendLevel(tls, p+36, pStruct, iPromote, 1, 1)
if (*Fts5Index)(unsafe.Pointer(p)).Frc != 0 {
return
}
- libc.Xmemcpy(tls, (*Fts5StructureLevel)(unsafe.Pointer(pOut)).FaSeg, ((*Fts5StructureLevel)(unsafe.Pointer(pLvl)).FaSeg + uintptr(is)*12), uint32(unsafe.Sizeof(Fts5StructureSegment{})))
+ libc.Xmemcpy(tls, (*Fts5StructureLevel)(unsafe.Pointer(pOut)).FaSeg, (*Fts5StructureLevel)(unsafe.Pointer(pLvl)).FaSeg+uintptr(is)*12, uint32(unsafe.Sizeof(Fts5StructureSegment{})))
(*Fts5StructureLevel)(unsafe.Pointer(pOut)).FnSeg++
(*Fts5StructureLevel)(unsafe.Pointer(pLvl)).FnSeg--
}
@@ -179044,31 +181444,31 @@ func fts5StructurePromoteTo(tls *libc.TLS, p uintptr, iPromote int32, szPromote
//
// If one or more segments are promoted, the structure object is updated
// to reflect this.
-func fts5StructurePromote(tls *libc.TLS, p uintptr, iLvl int32, pStruct uintptr) { /* sqlite3.c:222279:13: */
+func fts5StructurePromote(tls *libc.TLS, p uintptr, iLvl int32, pStruct uintptr) { /* sqlite3.c:224162:13: */
if (*Fts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK {
var iTst int32
var iPromote int32 = -1
var szPromote int32 = 0 // Promote anything this size or smaller
var pSeg uintptr // Segment just written
var szSeg int32 // Size of segment just written
- var nSeg int32 = (*Fts5StructureLevel)(unsafe.Pointer((pStruct + 24 /* &.aLevel */) + uintptr(iLvl)*12)).FnSeg
+ var nSeg int32 = (*Fts5StructureLevel)(unsafe.Pointer(pStruct + 24 + uintptr(iLvl)*12)).FnSeg
if nSeg == 0 {
return
}
- pSeg = ((*Fts5StructureLevel)(unsafe.Pointer((pStruct+24 /* &.aLevel */)+uintptr(iLvl)*12)).FaSeg + uintptr(((*Fts5StructureLevel)(unsafe.Pointer((pStruct+24 /* &.aLevel */)+uintptr(iLvl)*12)).FnSeg-1))*12)
- szSeg = ((1 + (*Fts5StructureSegment)(unsafe.Pointer(pSeg)).FpgnoLast) - (*Fts5StructureSegment)(unsafe.Pointer(pSeg)).FpgnoFirst)
+ pSeg = (*Fts5StructureLevel)(unsafe.Pointer(pStruct+24+uintptr(iLvl)*12)).FaSeg + uintptr((*Fts5StructureLevel)(unsafe.Pointer(pStruct+24+uintptr(iLvl)*12)).FnSeg-1)*12
+ szSeg = 1 + (*Fts5StructureSegment)(unsafe.Pointer(pSeg)).FpgnoLast - (*Fts5StructureSegment)(unsafe.Pointer(pSeg)).FpgnoFirst
// Check for condition (a)
- for iTst = (iLvl - 1); (iTst >= 0) && ((*Fts5StructureLevel)(unsafe.Pointer((pStruct+24 /* &.aLevel */)+uintptr(iTst)*12)).FnSeg == 0); iTst-- {
+ for iTst = iLvl - 1; iTst >= 0 && (*Fts5StructureLevel)(unsafe.Pointer(pStruct+24 /* &.aLevel */ +uintptr(iTst)*12)).FnSeg == 0; iTst-- {
}
if iTst >= 0 {
var i int32
var szMax int32 = 0
- var pTst uintptr = ((pStruct + 24 /* &.aLevel */) + uintptr(iTst)*12)
+ var pTst uintptr = pStruct + 24 + uintptr(iTst)*12
for i = 0; i < (*Fts5StructureLevel)(unsafe.Pointer(pTst)).FnSeg; i++ {
- var sz int32 = (((*Fts5StructureSegment)(unsafe.Pointer((*Fts5StructureLevel)(unsafe.Pointer(pTst)).FaSeg+uintptr(i)*12)).FpgnoLast - (*Fts5StructureSegment)(unsafe.Pointer((*Fts5StructureLevel)(unsafe.Pointer(pTst)).FaSeg+uintptr(i)*12)).FpgnoFirst) + 1)
+ var sz int32 = (*Fts5StructureSegment)(unsafe.Pointer((*Fts5StructureLevel)(unsafe.Pointer(pTst)).FaSeg+uintptr(i)*12)).FpgnoLast - (*Fts5StructureSegment)(unsafe.Pointer((*Fts5StructureLevel)(unsafe.Pointer(pTst)).FaSeg+uintptr(i)*12)).FpgnoFirst + 1
if sz > szMax {
szMax = sz
}
@@ -179093,7 +181493,7 @@ func fts5StructurePromote(tls *libc.TLS, p uintptr, iLvl int32, pStruct uintptr)
// Advance the iterator passed as the only argument. If the end of the
// doclist-index page is reached, return non-zero.
-func fts5DlidxLvlNext(tls *libc.TLS, pLvl uintptr) int32 { /* sqlite3.c:222330:12: */
+func fts5DlidxLvlNext(tls *libc.TLS, pLvl uintptr) int32 { /* sqlite3.c:224213:12: */
bp := tls.Alloc(8)
defer tls.Free(8)
@@ -179102,8 +181502,8 @@ func fts5DlidxLvlNext(tls *libc.TLS, pLvl uintptr) int32 { /* sqlite3.c:222330:1
if (*Fts5DlidxLvl)(unsafe.Pointer(pLvl)).FiOff == 0 {
(*Fts5DlidxLvl)(unsafe.Pointer(pLvl)).FiOff = 1
- *(*int32)(unsafe.Pointer(pLvl + 4 /* &.iOff */)) += (sqlite3Fts5GetVarint32(tls, ((*Fts5Data)(unsafe.Pointer(pData)).Fp + 1), (pLvl + 16 /* &.iLeafPgno */)))
- *(*int32)(unsafe.Pointer(pLvl + 4 /* &.iOff */)) += (int32(sqlite3Fts5GetVarint(tls, ((*Fts5Data)(unsafe.Pointer(pData)).Fp + uintptr((*Fts5DlidxLvl)(unsafe.Pointer(pLvl)).FiOff)), (pLvl + 24 /* &.iRowid */))))
+ *(*int32)(unsafe.Pointer(pLvl + 4)) += sqlite3Fts5GetVarint32(tls, (*Fts5Data)(unsafe.Pointer(pData)).Fp+1, pLvl+16)
+ *(*int32)(unsafe.Pointer(pLvl + 4)) += int32(sqlite3Fts5GetVarint(tls, (*Fts5Data)(unsafe.Pointer(pData)).Fp+uintptr((*Fts5DlidxLvl)(unsafe.Pointer(pLvl)).FiOff), pLvl+24))
(*Fts5DlidxLvl)(unsafe.Pointer(pLvl)).FiFirstOff = (*Fts5DlidxLvl)(unsafe.Pointer(pLvl)).FiOff
} else {
var iOff int32
@@ -179116,9 +181516,9 @@ func fts5DlidxLvlNext(tls *libc.TLS, pLvl uintptr) int32 { /* sqlite3.c:222330:1
if iOff < (*Fts5Data)(unsafe.Pointer(pData)).Fnn {
// var iVal I64 at bp, 8
- *(*int32)(unsafe.Pointer(pLvl + 16 /* &.iLeafPgno */)) += ((iOff - (*Fts5DlidxLvl)(unsafe.Pointer(pLvl)).FiOff) + 1)
- iOff = iOff + (int32(sqlite3Fts5GetVarint(tls, ((*Fts5Data)(unsafe.Pointer(pData)).Fp + uintptr(iOff)), bp /* &iVal */)))
- *(*I64)(unsafe.Pointer(pLvl + 24 /* &.iRowid */)) += (*(*I64)(unsafe.Pointer(bp /* iVal */)))
+ *(*int32)(unsafe.Pointer(pLvl + 16)) += iOff - (*Fts5DlidxLvl)(unsafe.Pointer(pLvl)).FiOff + 1
+ iOff = iOff + int32(sqlite3Fts5GetVarint(tls, (*Fts5Data)(unsafe.Pointer(pData)).Fp+uintptr(iOff), bp))
+ *(*I64)(unsafe.Pointer(pLvl + 24)) += *(*I64)(unsafe.Pointer(bp))
(*Fts5DlidxLvl)(unsafe.Pointer(pLvl)).FiOff = iOff
} else {
(*Fts5DlidxLvl)(unsafe.Pointer(pLvl)).FbEof = 1
@@ -179129,17 +181529,17 @@ func fts5DlidxLvlNext(tls *libc.TLS, pLvl uintptr) int32 { /* sqlite3.c:222330:1
}
// Advance the iterator passed as the only argument.
-func fts5DlidxIterNextR(tls *libc.TLS, p uintptr, pIter uintptr, iLvl int32) int32 { /* sqlite3.c:222362:12: */
- var pLvl uintptr = ((pIter + 8 /* &.aLvl */) + uintptr(iLvl)*32)
+func fts5DlidxIterNextR(tls *libc.TLS, p uintptr, pIter uintptr, iLvl int32) int32 { /* sqlite3.c:224245:12: */
+ var pLvl uintptr = pIter + 8 + uintptr(iLvl)*32
if fts5DlidxLvlNext(tls, pLvl) != 0 {
- if (iLvl + 1) < (*Fts5DlidxIter)(unsafe.Pointer(pIter)).FnLvl {
- fts5DlidxIterNextR(tls, p, pIter, (iLvl + 1))
+ if iLvl+1 < (*Fts5DlidxIter)(unsafe.Pointer(pIter)).FnLvl {
+ fts5DlidxIterNextR(tls, p, pIter, iLvl+1)
if (*Fts5DlidxLvl)(unsafe.Pointer(pLvl+1*32)).FbEof == 0 {
fts5DataRelease(tls, (*Fts5DlidxLvl)(unsafe.Pointer(pLvl)).FpData)
libc.Xmemset(tls, pLvl, 0, uint32(unsafe.Sizeof(Fts5DlidxLvl{})))
(*Fts5DlidxLvl)(unsafe.Pointer(pLvl)).FpData = fts5DataRead(tls, p,
- (((((I64((*Fts5DlidxIter)(unsafe.Pointer(pIter)).FiSegid)) << ((FTS5_DATA_PAGE_B + FTS5_DATA_HEIGHT_B) + FTS5_DATA_DLI_B)) + (I64((int64(1))) << (FTS5_DATA_PAGE_B + FTS5_DATA_HEIGHT_B))) + ((I64(iLvl)) << (FTS5_DATA_PAGE_B))) + (I64((*Fts5DlidxLvl)(unsafe.Pointer(pLvl + 1*32)).FiLeafPgno))))
+ I64((*Fts5DlidxIter)(unsafe.Pointer(pIter)).FiSegid)<<(FTS5_DATA_PAGE_B+FTS5_DATA_HEIGHT_B+FTS5_DATA_DLI_B)+I64(int64(1))<<(FTS5_DATA_PAGE_B+FTS5_DATA_HEIGHT_B)+I64(iLvl)<<FTS5_DATA_PAGE_B+I64((*Fts5DlidxLvl)(unsafe.Pointer(pLvl+1*32)).FiLeafPgno))
if (*Fts5DlidxLvl)(unsafe.Pointer(pLvl)).FpData != 0 {
fts5DlidxLvlNext(tls, pLvl)
}
@@ -179147,10 +181547,10 @@ func fts5DlidxIterNextR(tls *libc.TLS, p uintptr, pIter uintptr, iLvl int32) int
}
}
- return (*Fts5DlidxLvl)(unsafe.Pointer((pIter + 8 /* &.aLvl */))).FbEof
+ return (*Fts5DlidxLvl)(unsafe.Pointer(pIter + 8)).FbEof
}
-func fts5DlidxIterNext(tls *libc.TLS, p uintptr, pIter uintptr) int32 { /* sqlite3.c:222382:12: */
+func fts5DlidxIterNext(tls *libc.TLS, p uintptr, pIter uintptr) int32 { /* sqlite3.c:224265:12: */
return fts5DlidxIterNextR(tls, p, pIter, 0)
}
@@ -179163,40 +181563,40 @@ func fts5DlidxIterNext(tls *libc.TLS, p uintptr, pIter uintptr) int32 { /* sqlit
//
// When this function is called pIter->iLeafPgno is the page number the
// doclist is associated with (the one featuring the term).
-func fts5DlidxIterFirst(tls *libc.TLS, pIter uintptr) int32 { /* sqlite3.c:222397:12: */
+func fts5DlidxIterFirst(tls *libc.TLS, pIter uintptr) int32 { /* sqlite3.c:224280:12: */
var i int32
for i = 0; i < (*Fts5DlidxIter)(unsafe.Pointer(pIter)).FnLvl; i++ {
- fts5DlidxLvlNext(tls, ((pIter + 8 /* &.aLvl */) + uintptr(i)*32))
+ fts5DlidxLvlNext(tls, pIter+8+uintptr(i)*32)
}
- return (*Fts5DlidxLvl)(unsafe.Pointer((pIter + 8 /* &.aLvl */))).FbEof
+ return (*Fts5DlidxLvl)(unsafe.Pointer(pIter + 8)).FbEof
}
-func fts5DlidxIterEof(tls *libc.TLS, p uintptr, pIter uintptr) int32 { /* sqlite3.c:222406:12: */
- return (libc.Bool32(((*Fts5Index)(unsafe.Pointer(p)).Frc != SQLITE_OK) || ((*Fts5DlidxLvl)(unsafe.Pointer((pIter + 8 /* &.aLvl */))).FbEof != 0)))
+func fts5DlidxIterEof(tls *libc.TLS, p uintptr, pIter uintptr) int32 { /* sqlite3.c:224289:12: */
+ return libc.Bool32((*Fts5Index)(unsafe.Pointer(p)).Frc != SQLITE_OK || (*Fts5DlidxLvl)(unsafe.Pointer(pIter+8)).FbEof != 0)
}
-func fts5DlidxIterLast(tls *libc.TLS, p uintptr, pIter uintptr) { /* sqlite3.c:222410:13: */
+func fts5DlidxIterLast(tls *libc.TLS, p uintptr, pIter uintptr) { /* sqlite3.c:224293:13: */
var i int32
// Advance each level to the last entry on the last page
- for i = ((*Fts5DlidxIter)(unsafe.Pointer(pIter)).FnLvl - 1); ((*Fts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK) && (i >= 0); i-- {
- var pLvl uintptr = ((pIter + 8 /* &.aLvl */) + uintptr(i)*32)
+ for i = (*Fts5DlidxIter)(unsafe.Pointer(pIter)).FnLvl - 1; (*Fts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK && i >= 0; i-- {
+ var pLvl uintptr = pIter + 8 + uintptr(i)*32
for fts5DlidxLvlNext(tls, pLvl) == 0 {
}
(*Fts5DlidxLvl)(unsafe.Pointer(pLvl)).FbEof = 0
if i > 0 {
- var pChild uintptr = (pLvl + libc.UintptrFromInt32(-1)*32)
+ var pChild uintptr = pLvl + libc.UintptrFromInt32(-1)*32
fts5DataRelease(tls, (*Fts5DlidxLvl)(unsafe.Pointer(pChild)).FpData)
libc.Xmemset(tls, pChild, 0, uint32(unsafe.Sizeof(Fts5DlidxLvl{})))
(*Fts5DlidxLvl)(unsafe.Pointer(pChild)).FpData = fts5DataRead(tls, p,
- (((((I64((*Fts5DlidxIter)(unsafe.Pointer(pIter)).FiSegid)) << ((FTS5_DATA_PAGE_B + FTS5_DATA_HEIGHT_B) + FTS5_DATA_DLI_B)) + (I64((int64(1))) << (FTS5_DATA_PAGE_B + FTS5_DATA_HEIGHT_B))) + ((I64(i - 1)) << (FTS5_DATA_PAGE_B))) + (I64((*Fts5DlidxLvl)(unsafe.Pointer(pLvl)).FiLeafPgno))))
+ I64((*Fts5DlidxIter)(unsafe.Pointer(pIter)).FiSegid)<<(FTS5_DATA_PAGE_B+FTS5_DATA_HEIGHT_B+FTS5_DATA_DLI_B)+I64(int64(1))<<(FTS5_DATA_PAGE_B+FTS5_DATA_HEIGHT_B)+I64(i-1)<<FTS5_DATA_PAGE_B+I64((*Fts5DlidxLvl)(unsafe.Pointer(pLvl)).FiLeafPgno))
}
}
}
// Move the iterator passed as the only argument to the previous entry.
-func fts5DlidxLvlPrev(tls *libc.TLS, pLvl uintptr) int32 { /* sqlite3.c:222433:12: */
+func fts5DlidxLvlPrev(tls *libc.TLS, pLvl uintptr) int32 { /* sqlite3.c:224316:12: */
bp := tls.Alloc(8)
defer tls.Free(8)
@@ -179218,57 +181618,57 @@ func fts5DlidxLvlPrev(tls *libc.TLS, pLvl uintptr) int32 { /* sqlite3.c:222433:1
// before the buffer in memory.
iLimit = func() int32 {
if iOff > 9 {
- return (iOff - 9)
+ return iOff - 9
}
return 0
}()
for iOff--; iOff > iLimit; iOff-- {
- if (int32(*(*U8)(unsafe.Pointer(a + uintptr((iOff - 1))))) & 0x80) == 0 {
+ if int32(*(*U8)(unsafe.Pointer(a + uintptr(iOff-1))))&0x80 == 0 {
break
}
}
- sqlite3Fts5GetVarint(tls, (a + uintptr(iOff)), bp /* &iVal */)
- *(*I64)(unsafe.Pointer(pLvl + 24 /* &.iRowid */)) -= (*(*I64)(unsafe.Pointer(bp /* iVal */)))
+ sqlite3Fts5GetVarint(tls, a+uintptr(iOff), bp /* &iVal */)
+ *(*I64)(unsafe.Pointer(pLvl + 24)) -= *(*I64)(unsafe.Pointer(bp))
(*Fts5DlidxLvl)(unsafe.Pointer(pLvl)).FiLeafPgno--
// Skip backwards past any 0x00 varints.
- for ii = (iOff - 1); (ii >= (*Fts5DlidxLvl)(unsafe.Pointer(pLvl)).FiFirstOff) && (int32(*(*U8)(unsafe.Pointer(a + uintptr(ii)))) == 0x00); ii-- {
+ for ii = iOff - 1; ii >= (*Fts5DlidxLvl)(unsafe.Pointer(pLvl)).FiFirstOff && int32(*(*U8)(unsafe.Pointer(a + uintptr(ii)))) == 0x00; ii-- {
nZero++
}
- if (ii >= (*Fts5DlidxLvl)(unsafe.Pointer(pLvl)).FiFirstOff) && ((int32(*(*U8)(unsafe.Pointer(a + uintptr(ii)))) & 0x80) != 0) {
+ if ii >= (*Fts5DlidxLvl)(unsafe.Pointer(pLvl)).FiFirstOff && int32(*(*U8)(unsafe.Pointer(a + uintptr(ii))))&0x80 != 0 {
// The byte immediately before the last 0x00 byte has the 0x80 bit
// set. So the last 0x00 is only a varint 0 if there are 8 more 0x80
// bytes before a[ii].
var bZero int32 = 0 // True if last 0x00 counts
- if (ii - 8) >= (*Fts5DlidxLvl)(unsafe.Pointer(pLvl)).FiFirstOff {
+ if ii-8 >= (*Fts5DlidxLvl)(unsafe.Pointer(pLvl)).FiFirstOff {
var j int32
- for j = 1; (j <= 8) && ((int32(*(*U8)(unsafe.Pointer(a + uintptr((ii - j))))) & 0x80) != 0); j++ {
+ for j = 1; j <= 8 && int32(*(*U8)(unsafe.Pointer(a + uintptr(ii-j))))&0x80 != 0; j++ {
}
- bZero = (libc.Bool32(j > 8))
+ bZero = libc.Bool32(j > 8)
}
if bZero == 0 {
nZero--
}
}
- *(*int32)(unsafe.Pointer(pLvl + 16 /* &.iLeafPgno */)) -= (nZero)
- (*Fts5DlidxLvl)(unsafe.Pointer(pLvl)).FiOff = (iOff - nZero)
+ *(*int32)(unsafe.Pointer(pLvl + 16)) -= nZero
+ (*Fts5DlidxLvl)(unsafe.Pointer(pLvl)).FiOff = iOff - nZero
}
return (*Fts5DlidxLvl)(unsafe.Pointer(pLvl)).FbEof
}
-func fts5DlidxIterPrevR(tls *libc.TLS, p uintptr, pIter uintptr, iLvl int32) int32 { /* sqlite3.c:222482:12: */
- var pLvl uintptr = ((pIter + 8 /* &.aLvl */) + uintptr(iLvl)*32)
+func fts5DlidxIterPrevR(tls *libc.TLS, p uintptr, pIter uintptr, iLvl int32) int32 { /* sqlite3.c:224365:12: */
+ var pLvl uintptr = pIter + 8 + uintptr(iLvl)*32
if fts5DlidxLvlPrev(tls, pLvl) != 0 {
- if (iLvl + 1) < (*Fts5DlidxIter)(unsafe.Pointer(pIter)).FnLvl {
- fts5DlidxIterPrevR(tls, p, pIter, (iLvl + 1))
+ if iLvl+1 < (*Fts5DlidxIter)(unsafe.Pointer(pIter)).FnLvl {
+ fts5DlidxIterPrevR(tls, p, pIter, iLvl+1)
if (*Fts5DlidxLvl)(unsafe.Pointer(pLvl+1*32)).FbEof == 0 {
fts5DataRelease(tls, (*Fts5DlidxLvl)(unsafe.Pointer(pLvl)).FpData)
libc.Xmemset(tls, pLvl, 0, uint32(unsafe.Sizeof(Fts5DlidxLvl{})))
(*Fts5DlidxLvl)(unsafe.Pointer(pLvl)).FpData = fts5DataRead(tls, p,
- (((((I64((*Fts5DlidxIter)(unsafe.Pointer(pIter)).FiSegid)) << ((FTS5_DATA_PAGE_B + FTS5_DATA_HEIGHT_B) + FTS5_DATA_DLI_B)) + (I64((int64(1))) << (FTS5_DATA_PAGE_B + FTS5_DATA_HEIGHT_B))) + ((I64(iLvl)) << (FTS5_DATA_PAGE_B))) + (I64((*Fts5DlidxLvl)(unsafe.Pointer(pLvl + 1*32)).FiLeafPgno))))
+ I64((*Fts5DlidxIter)(unsafe.Pointer(pIter)).FiSegid)<<(FTS5_DATA_PAGE_B+FTS5_DATA_HEIGHT_B+FTS5_DATA_DLI_B)+I64(int64(1))<<(FTS5_DATA_PAGE_B+FTS5_DATA_HEIGHT_B)+I64(iLvl)<<FTS5_DATA_PAGE_B+I64((*Fts5DlidxLvl)(unsafe.Pointer(pLvl+1*32)).FiLeafPgno))
if (*Fts5DlidxLvl)(unsafe.Pointer(pLvl)).FpData != 0 {
for fts5DlidxLvlNext(tls, pLvl) == 0 {
}
@@ -179278,46 +181678,46 @@ func fts5DlidxIterPrevR(tls *libc.TLS, p uintptr, pIter uintptr, iLvl int32) int
}
}
- return (*Fts5DlidxLvl)(unsafe.Pointer((pIter + 8 /* &.aLvl */))).FbEof
+ return (*Fts5DlidxLvl)(unsafe.Pointer(pIter + 8)).FbEof
}
-func fts5DlidxIterPrev(tls *libc.TLS, p uintptr, pIter uintptr) int32 { /* sqlite3.c:222505:12: */
+func fts5DlidxIterPrev(tls *libc.TLS, p uintptr, pIter uintptr) int32 { /* sqlite3.c:224388:12: */
return fts5DlidxIterPrevR(tls, p, pIter, 0)
}
// Free a doclist-index iterator object allocated by fts5DlidxIterInit().
-func fts5DlidxIterFree(tls *libc.TLS, pIter uintptr) { /* sqlite3.c:222512:13: */
+func fts5DlidxIterFree(tls *libc.TLS, pIter uintptr) { /* sqlite3.c:224395:13: */
if pIter != 0 {
var i int32
for i = 0; i < (*Fts5DlidxIter)(unsafe.Pointer(pIter)).FnLvl; i++ {
- fts5DataRelease(tls, (*Fts5DlidxLvl)(unsafe.Pointer((pIter+8 /* &.aLvl */)+uintptr(i)*32)).FpData)
+ fts5DataRelease(tls, (*Fts5DlidxLvl)(unsafe.Pointer(pIter+8+uintptr(i)*32)).FpData)
}
Xsqlite3_free(tls, pIter)
}
}
-func fts5DlidxIterInit(tls *libc.TLS, p uintptr, bRev int32, iSegid int32, iLeafPg int32) uintptr { /* sqlite3.c:222522:22: */
+func fts5DlidxIterInit(tls *libc.TLS, p uintptr, bRev int32, iSegid int32, iLeafPg int32) uintptr { /* sqlite3.c:224405:22: */
var pIter uintptr = uintptr(0)
var i int32
var bDone int32 = 0
- for i = 0; ((*Fts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK) && (bDone == 0); i++ {
- var nByte Sqlite3_int64 = (Sqlite3_int64(uint32(unsafe.Sizeof(Fts5DlidxIter{})) + (uint32(i) * uint32(unsafe.Sizeof(Fts5DlidxLvl{})))))
+ for i = 0; (*Fts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK && bDone == 0; i++ {
+ var nByte Sqlite3_int64 = Sqlite3_int64(uint32(unsafe.Sizeof(Fts5DlidxIter{})) + uint32(i)*uint32(unsafe.Sizeof(Fts5DlidxLvl{})))
var pNew uintptr
pNew = Xsqlite3_realloc64(tls, pIter, uint64(nByte))
if pNew == uintptr(0) {
(*Fts5Index)(unsafe.Pointer(p)).Frc = SQLITE_NOMEM
} else {
- var iRowid I64 = (((((I64(iSegid)) << ((FTS5_DATA_PAGE_B + FTS5_DATA_HEIGHT_B) + FTS5_DATA_DLI_B)) + (I64((int64(1))) << (FTS5_DATA_PAGE_B + FTS5_DATA_HEIGHT_B))) + ((I64(i)) << (FTS5_DATA_PAGE_B))) + (I64(iLeafPg)))
- var pLvl uintptr = ((pNew + 8 /* &.aLvl */) + uintptr(i)*32)
+ var iRowid I64 = I64(iSegid)<<(FTS5_DATA_PAGE_B+FTS5_DATA_HEIGHT_B+FTS5_DATA_DLI_B) + I64(int64(1))<<(FTS5_DATA_PAGE_B+FTS5_DATA_HEIGHT_B) + I64(i)<<FTS5_DATA_PAGE_B + I64(iLeafPg)
+ var pLvl uintptr = pNew + 8 + uintptr(i)*32
pIter = pNew
libc.Xmemset(tls, pLvl, 0, uint32(unsafe.Sizeof(Fts5DlidxLvl{})))
(*Fts5DlidxLvl)(unsafe.Pointer(pLvl)).FpData = fts5DataRead(tls, p, iRowid)
- if ((*Fts5DlidxLvl)(unsafe.Pointer(pLvl)).FpData != 0) && ((int32(*(*U8)(unsafe.Pointer((*Fts5Data)(unsafe.Pointer((*Fts5DlidxLvl)(unsafe.Pointer(pLvl)).FpData)).Fp))) & 0x0001) == 0) {
+ if (*Fts5DlidxLvl)(unsafe.Pointer(pLvl)).FpData != 0 && int32(*(*U8)(unsafe.Pointer((*Fts5Data)(unsafe.Pointer((*Fts5DlidxLvl)(unsafe.Pointer(pLvl)).FpData)).Fp)))&0x0001 == 0 {
bDone = 1
}
- (*Fts5DlidxIter)(unsafe.Pointer(pIter)).FnLvl = (i + 1)
+ (*Fts5DlidxIter)(unsafe.Pointer(pIter)).FnLvl = i + 1
}
}
@@ -179338,16 +181738,16 @@ func fts5DlidxIterInit(tls *libc.TLS, p uintptr, bRev int32, iSegid int32, iLeaf
return pIter
}
-func fts5DlidxIterRowid(tls *libc.TLS, pIter uintptr) I64 { /* sqlite3.c:222569:12: */
- return (*Fts5DlidxLvl)(unsafe.Pointer((pIter + 8 /* &.aLvl */))).FiRowid
+func fts5DlidxIterRowid(tls *libc.TLS, pIter uintptr) I64 { /* sqlite3.c:224452:12: */
+ return (*Fts5DlidxLvl)(unsafe.Pointer(pIter + 8)).FiRowid
}
-func fts5DlidxIterPgno(tls *libc.TLS, pIter uintptr) int32 { /* sqlite3.c:222572:12: */
- return (*Fts5DlidxLvl)(unsafe.Pointer((pIter + 8 /* &.aLvl */))).FiLeafPgno
+func fts5DlidxIterPgno(tls *libc.TLS, pIter uintptr) int32 { /* sqlite3.c:224455:12: */
+ return (*Fts5DlidxLvl)(unsafe.Pointer(pIter + 8)).FiLeafPgno
}
// Load the next leaf page into the segment iterator.
-func fts5SegIterNextPage(tls *libc.TLS, p uintptr, pIter uintptr) { /* sqlite3.c:222579:13: */
+func fts5SegIterNextPage(tls *libc.TLS, p uintptr, pIter uintptr) { /* sqlite3.c:224462:13: */
var pLeaf uintptr
var pSeg uintptr = (*Fts5SegIter)(unsafe.Pointer(pIter)).FpSeg
fts5DataRelease(tls, (*Fts5SegIter)(unsafe.Pointer(pIter)).FpLeaf)
@@ -179357,7 +181757,7 @@ func fts5SegIterNextPage(tls *libc.TLS, p uintptr, pIter uintptr) { /* sqlite3.c
(*Fts5SegIter)(unsafe.Pointer(pIter)).FpNextLeaf = uintptr(0)
} else if (*Fts5SegIter)(unsafe.Pointer(pIter)).FiLeafPgno <= (*Fts5StructureSegment)(unsafe.Pointer(pSeg)).FpgnoLast {
(*Fts5SegIter)(unsafe.Pointer(pIter)).FpLeaf = fts5LeafRead(tls, p,
- (((((I64((*Fts5StructureSegment)(unsafe.Pointer(pSeg)).FiSegid)) << ((FTS5_DATA_PAGE_B + FTS5_DATA_HEIGHT_B) + FTS5_DATA_DLI_B)) + (I64((int64(0))) << (FTS5_DATA_PAGE_B + FTS5_DATA_HEIGHT_B))) + (I64((int64(0))) << (FTS5_DATA_PAGE_B))) + (I64((*Fts5SegIter)(unsafe.Pointer(pIter)).FiLeafPgno))))
+ I64((*Fts5StructureSegment)(unsafe.Pointer(pSeg)).FiSegid)<<(FTS5_DATA_PAGE_B+FTS5_DATA_HEIGHT_B+FTS5_DATA_DLI_B)+I64(int64(0))<<(FTS5_DATA_PAGE_B+FTS5_DATA_HEIGHT_B)+I64(int64(0))<<FTS5_DATA_PAGE_B+I64((*Fts5SegIter)(unsafe.Pointer(pIter)).FiLeafPgno))
} else {
(*Fts5SegIter)(unsafe.Pointer(pIter)).FpLeaf = uintptr(0)
}
@@ -179365,10 +181765,10 @@ func fts5SegIterNextPage(tls *libc.TLS, p uintptr, pIter uintptr) { /* sqlite3.c
if pLeaf != 0 {
(*Fts5SegIter)(unsafe.Pointer(pIter)).FiPgidxOff = (*Fts5Data)(unsafe.Pointer(pLeaf)).FszLeaf
- if (*Fts5Data)(unsafe.Pointer((pLeaf))).FszLeaf >= (*Fts5Data)(unsafe.Pointer((pLeaf))).Fnn {
- (*Fts5SegIter)(unsafe.Pointer(pIter)).FiEndofDoclist = ((*Fts5Data)(unsafe.Pointer(pLeaf)).Fnn + 1)
+ if (*Fts5Data)(unsafe.Pointer(pLeaf)).FszLeaf >= (*Fts5Data)(unsafe.Pointer(pLeaf)).Fnn {
+ (*Fts5SegIter)(unsafe.Pointer(pIter)).FiEndofDoclist = (*Fts5Data)(unsafe.Pointer(pLeaf)).Fnn + 1
} else {
- *(*int32)(unsafe.Pointer(pIter + 44 /* &.iPgidxOff */)) += (sqlite3Fts5GetVarint32(tls, ((*Fts5Data)(unsafe.Pointer(pLeaf)).Fp + uintptr((*Fts5SegIter)(unsafe.Pointer(pIter)).FiPgidxOff)), (pIter + 48 /* &.iEndofDoclist */)))
+ *(*int32)(unsafe.Pointer(pIter + 44)) += sqlite3Fts5GetVarint32(tls, (*Fts5Data)(unsafe.Pointer(pLeaf)).Fp+uintptr((*Fts5SegIter)(unsafe.Pointer(pIter)).FiPgidxOff), pIter+48)
}
}
}
@@ -179377,7 +181777,7 @@ func fts5SegIterNextPage(tls *libc.TLS, p uintptr, pIter uintptr) { /* sqlite3.c
// position list size field. Read the varint and return the number of bytes
// read. Before returning, set *pnSz to the number of bytes in the position
// list, and *pbDel to true if the delete flag is set, or false otherwise.
-func fts5GetPoslistSize(tls *libc.TLS, p uintptr, pnSz uintptr, pbDel uintptr) int32 { /* sqlite3.c:222617:12: */
+func fts5GetPoslistSize(tls *libc.TLS, p uintptr, pnSz uintptr, pbDel uintptr) int32 { /* sqlite3.c:224500:12: */
bp := tls.Alloc(4)
defer tls.Free(4)
@@ -179385,15 +181785,15 @@ func fts5GetPoslistSize(tls *libc.TLS, p uintptr, pnSz uintptr, pbDel uintptr) i
var n int32 = 0
{
- *(*int32)(unsafe.Pointer(bp /* nSz */)) = int32(*(*U8)(unsafe.Pointer((p) + uintptr(libc.PostIncInt32(&n, 1)))))
- if (*(*int32)(unsafe.Pointer(bp /* nSz */)) & 0x80) != 0 {
+ *(*int32)(unsafe.Pointer(bp /* nSz */)) = int32(*(*U8)(unsafe.Pointer(p + uintptr(libc.PostIncInt32(&n, 1)))))
+ if *(*int32)(unsafe.Pointer(bp))&0x80 != 0 {
n--
- n = n + (sqlite3Fts5GetVarint32(tls, ((p) + uintptr(n)), bp /* &nSz */))
+ n = n + sqlite3Fts5GetVarint32(tls, p+uintptr(n), bp)
}
}
- *(*int32)(unsafe.Pointer(pnSz)) = (*(*int32)(unsafe.Pointer(bp /* nSz */)) / 2)
- *(*int32)(unsafe.Pointer(pbDel)) = (*(*int32)(unsafe.Pointer(bp /* nSz */)) & 0x0001)
+ *(*int32)(unsafe.Pointer(pnSz)) = *(*int32)(unsafe.Pointer(bp)) / 2
+ *(*int32)(unsafe.Pointer(pbDel)) = *(*int32)(unsafe.Pointer(bp)) & 0x0001
return n
}
@@ -179406,7 +181806,7 @@ func fts5GetPoslistSize(tls *libc.TLS, p uintptr, pnSz uintptr, pbDel uintptr) i
//
// Leave Fts5SegIter.iLeafOffset pointing to the first byte of the
// position list content (if any).
-func fts5SegIterLoadNPos(tls *libc.TLS, p uintptr, pIter uintptr) { /* sqlite3.c:222638:13: */
+func fts5SegIterLoadNPos(tls *libc.TLS, p uintptr, pIter uintptr) { /* sqlite3.c:224521:13: */
bp := tls.Alloc(4)
defer tls.Free(4)
@@ -179415,17 +181815,17 @@ func fts5SegIterLoadNPos(tls *libc.TLS, p uintptr, pIter uintptr) { /* sqlite3.c
if (*Fts5Config)(unsafe.Pointer((*Fts5Index)(unsafe.Pointer(p)).FpConfig)).FeDetail == FTS5_DETAIL_NONE {
var iEod int32 = func() int32 {
- if ((*Fts5SegIter)(unsafe.Pointer(pIter)).FiEndofDoclist) < ((*Fts5Data)(unsafe.Pointer((*Fts5SegIter)(unsafe.Pointer(pIter)).FpLeaf)).FszLeaf) {
+ if (*Fts5SegIter)(unsafe.Pointer(pIter)).FiEndofDoclist < (*Fts5Data)(unsafe.Pointer((*Fts5SegIter)(unsafe.Pointer(pIter)).FpLeaf)).FszLeaf {
return (*Fts5SegIter)(unsafe.Pointer(pIter)).FiEndofDoclist
}
return (*Fts5Data)(unsafe.Pointer((*Fts5SegIter)(unsafe.Pointer(pIter)).FpLeaf)).FszLeaf
}()
(*Fts5SegIter)(unsafe.Pointer(pIter)).FbDel = U8(0)
(*Fts5SegIter)(unsafe.Pointer(pIter)).FnPos = 1
- if (iOff < iEod) && (int32(*(*U8)(unsafe.Pointer((*Fts5Data)(unsafe.Pointer((*Fts5SegIter)(unsafe.Pointer(pIter)).FpLeaf)).Fp + uintptr(iOff)))) == 0) {
+ if iOff < iEod && int32(*(*U8)(unsafe.Pointer((*Fts5Data)(unsafe.Pointer((*Fts5SegIter)(unsafe.Pointer(pIter)).FpLeaf)).Fp + uintptr(iOff)))) == 0 {
(*Fts5SegIter)(unsafe.Pointer(pIter)).FbDel = U8(1)
iOff++
- if (iOff < iEod) && (int32(*(*U8)(unsafe.Pointer((*Fts5Data)(unsafe.Pointer((*Fts5SegIter)(unsafe.Pointer(pIter)).FpLeaf)).Fp + uintptr(iOff)))) == 0) {
+ if iOff < iEod && int32(*(*U8)(unsafe.Pointer((*Fts5Data)(unsafe.Pointer((*Fts5SegIter)(unsafe.Pointer(pIter)).FpLeaf)).Fp + uintptr(iOff)))) == 0 {
(*Fts5SegIter)(unsafe.Pointer(pIter)).FnPos = 1
iOff++
} else {
@@ -179436,22 +181836,22 @@ func fts5SegIterLoadNPos(tls *libc.TLS, p uintptr, pIter uintptr) { /* sqlite3.c
// var nSz int32 at bp, 4
{
- *(*int32)(unsafe.Pointer(bp /* nSz */)) = int32(*(*U8)(unsafe.Pointer(((*Fts5Data)(unsafe.Pointer((*Fts5SegIter)(unsafe.Pointer(pIter)).FpLeaf)).Fp) + uintptr(libc.PostIncInt32(&iOff, 1)))))
- if (*(*int32)(unsafe.Pointer(bp /* nSz */)) & 0x80) != 0 {
+ *(*int32)(unsafe.Pointer(bp /* nSz */)) = int32(*(*U8)(unsafe.Pointer((*Fts5Data)(unsafe.Pointer((*Fts5SegIter)(unsafe.Pointer(pIter)).FpLeaf)).Fp + uintptr(libc.PostIncInt32(&iOff, 1)))))
+ if *(*int32)(unsafe.Pointer(bp))&0x80 != 0 {
iOff--
- iOff = iOff + (sqlite3Fts5GetVarint32(tls, (((*Fts5Data)(unsafe.Pointer((*Fts5SegIter)(unsafe.Pointer(pIter)).FpLeaf)).Fp) + uintptr(iOff)), bp /* &nSz */))
+ iOff = iOff + sqlite3Fts5GetVarint32(tls, (*Fts5Data)(unsafe.Pointer((*Fts5SegIter)(unsafe.Pointer(pIter)).FpLeaf)).Fp+uintptr(iOff), bp)
}
}
- (*Fts5SegIter)(unsafe.Pointer(pIter)).FbDel = (U8(*(*int32)(unsafe.Pointer(bp /* nSz */)) & 0x0001))
- (*Fts5SegIter)(unsafe.Pointer(pIter)).FnPos = (*(*int32)(unsafe.Pointer(bp /* nSz */)) >> 1)
+ (*Fts5SegIter)(unsafe.Pointer(pIter)).FbDel = U8(*(*int32)(unsafe.Pointer(bp)) & 0x0001)
+ (*Fts5SegIter)(unsafe.Pointer(pIter)).FnPos = *(*int32)(unsafe.Pointer(bp)) >> 1
}
(*Fts5SegIter)(unsafe.Pointer(pIter)).FiLeafOffset = I64(iOff)
}
}
-func fts5SegIterLoadRowid(tls *libc.TLS, p uintptr, pIter uintptr) { /* sqlite3.c:222667:13: */
+func fts5SegIterLoadRowid(tls *libc.TLS, p uintptr, pIter uintptr) { /* sqlite3.c:224550:13: */
var a uintptr = (*Fts5Data)(unsafe.Pointer((*Fts5SegIter)(unsafe.Pointer(pIter)).FpLeaf)).Fp // Buffer to read data from
var iOff I64 = (*Fts5SegIter)(unsafe.Pointer(pIter)).FiLeafOffset
@@ -179459,14 +181859,14 @@ func fts5SegIterLoadRowid(tls *libc.TLS, p uintptr, pIter uintptr) { /* sqlite3.
fts5SegIterNextPage(tls, p, pIter)
if (*Fts5SegIter)(unsafe.Pointer(pIter)).FpLeaf == uintptr(0) {
if (*Fts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK {
- (*Fts5Index)(unsafe.Pointer(p)).Frc = (SQLITE_CORRUPT | (int32(1) << 8))
+ (*Fts5Index)(unsafe.Pointer(p)).Frc = SQLITE_CORRUPT | int32(1)<<8
}
return
}
iOff = int64(4)
a = (*Fts5Data)(unsafe.Pointer((*Fts5SegIter)(unsafe.Pointer(pIter)).FpLeaf)).Fp
}
- iOff = iOff + (I64(sqlite3Fts5GetVarint(tls, (a + uintptr(iOff)), (pIter + 80 /* &.iRowid */))))
+ iOff = iOff + I64(sqlite3Fts5GetVarint(tls, a+uintptr(iOff), pIter+80))
(*Fts5SegIter)(unsafe.Pointer(pIter)).FiLeafOffset = iOff
}
@@ -179483,7 +181883,7 @@ func fts5SegIterLoadRowid(tls *libc.TLS, p uintptr, pIter uintptr) { /* sqlite3.
// accordingly and leaves (Fts5SegIter.iLeafOffset) set to the content of
// the first position list. The position list belonging to document
// (Fts5SegIter.iRowid).
-func fts5SegIterLoadTerm(tls *libc.TLS, p uintptr, pIter uintptr, nKeep int32) { /* sqlite3.c:222700:13: */
+func fts5SegIterLoadTerm(tls *libc.TLS, p uintptr, pIter uintptr, nKeep int32) { /* sqlite3.c:224583:13: */
bp := tls.Alloc(8)
defer tls.Free(8)
@@ -179492,33 +181892,33 @@ func fts5SegIterLoadTerm(tls *libc.TLS, p uintptr, pIter uintptr, nKeep int32) {
// var nNew int32 at bp, 4
// Bytes of new data
- iOff = iOff + (I64(sqlite3Fts5GetVarint32(tls, (a + uintptr(iOff)), bp /* &nNew */)))
- if (((iOff + I64(*(*int32)(unsafe.Pointer(bp /* nNew */)))) > I64((*Fts5Data)(unsafe.Pointer((*Fts5SegIter)(unsafe.Pointer(pIter)).FpLeaf)).FszLeaf)) || (nKeep > (*Fts5SegIter)(unsafe.Pointer(pIter)).Fterm.Fn)) || (*(*int32)(unsafe.Pointer(bp /* nNew */)) == 0) {
- (*Fts5Index)(unsafe.Pointer(p)).Frc = (SQLITE_CORRUPT | (int32(1) << 8))
+ iOff = iOff + I64(sqlite3Fts5GetVarint32(tls, a+uintptr(iOff), bp))
+ if iOff+I64(*(*int32)(unsafe.Pointer(bp))) > I64((*Fts5Data)(unsafe.Pointer((*Fts5SegIter)(unsafe.Pointer(pIter)).FpLeaf)).FszLeaf) || nKeep > (*Fts5SegIter)(unsafe.Pointer(pIter)).Fterm.Fn || *(*int32)(unsafe.Pointer(bp)) == 0 {
+ (*Fts5Index)(unsafe.Pointer(p)).Frc = SQLITE_CORRUPT | int32(1)<<8
return
}
(*Fts5SegIter)(unsafe.Pointer(pIter)).Fterm.Fn = nKeep
- sqlite3Fts5BufferAppendBlob(tls, (p + 36 /* &.rc */), (pIter + 68 /* &.term */), uint32(*(*int32)(unsafe.Pointer(bp /* nNew */))), (a + uintptr(iOff)))
+ sqlite3Fts5BufferAppendBlob(tls, p+36, pIter+68, uint32(*(*int32)(unsafe.Pointer(bp /* nNew */))), a+uintptr(iOff))
- iOff = iOff + (I64(*(*int32)(unsafe.Pointer(bp /* nNew */))))
+ iOff = iOff + I64(*(*int32)(unsafe.Pointer(bp)))
(*Fts5SegIter)(unsafe.Pointer(pIter)).FiTermLeafOffset = int32(iOff)
(*Fts5SegIter)(unsafe.Pointer(pIter)).FiTermLeafPgno = (*Fts5SegIter)(unsafe.Pointer(pIter)).FiLeafPgno
(*Fts5SegIter)(unsafe.Pointer(pIter)).FiLeafOffset = iOff
if (*Fts5SegIter)(unsafe.Pointer(pIter)).FiPgidxOff >= (*Fts5Data)(unsafe.Pointer((*Fts5SegIter)(unsafe.Pointer(pIter)).FpLeaf)).Fnn {
- (*Fts5SegIter)(unsafe.Pointer(pIter)).FiEndofDoclist = ((*Fts5Data)(unsafe.Pointer((*Fts5SegIter)(unsafe.Pointer(pIter)).FpLeaf)).Fnn + 1)
+ (*Fts5SegIter)(unsafe.Pointer(pIter)).FiEndofDoclist = (*Fts5Data)(unsafe.Pointer((*Fts5SegIter)(unsafe.Pointer(pIter)).FpLeaf)).Fnn + 1
} else {
// var nExtra int32 at bp+4, 4
- *(*int32)(unsafe.Pointer(pIter + 44 /* &.iPgidxOff */)) += (sqlite3Fts5GetVarint32(tls, (a + uintptr((*Fts5SegIter)(unsafe.Pointer(pIter)).FiPgidxOff)), bp+4 /* &nExtra */))
- *(*int32)(unsafe.Pointer(pIter + 48 /* &.iEndofDoclist */)) += (*(*int32)(unsafe.Pointer(bp + 4 /* nExtra */)))
+ *(*int32)(unsafe.Pointer(pIter + 44)) += sqlite3Fts5GetVarint32(tls, a+uintptr((*Fts5SegIter)(unsafe.Pointer(pIter)).FiPgidxOff), bp+4)
+ *(*int32)(unsafe.Pointer(pIter + 48)) += *(*int32)(unsafe.Pointer(bp + 4))
}
fts5SegIterLoadRowid(tls, p, pIter)
}
-func fts5SegIterSetNext(tls *libc.TLS, p uintptr, pIter uintptr) { /* sqlite3.c:222733:13: */
- if ((*Fts5SegIter)(unsafe.Pointer(pIter)).Fflags & FTS5_SEGITER_REVERSE) != 0 {
+func fts5SegIterSetNext(tls *libc.TLS, p uintptr, pIter uintptr) { /* sqlite3.c:224616:13: */
+ if (*Fts5SegIter)(unsafe.Pointer(pIter)).Fflags&FTS5_SEGITER_REVERSE != 0 {
(*Fts5SegIter)(unsafe.Pointer(pIter)).FxNext = *(*uintptr)(unsafe.Pointer(&struct {
f func(*libc.TLS, uintptr, uintptr, uintptr)
}{fts5SegIterNext_Reverse}))
@@ -179539,7 +181939,7 @@ func fts5SegIterSetNext(tls *libc.TLS, p uintptr, pIter uintptr) { /* sqlite3.c:
//
// If an error occurs, Fts5Index.rc is set to an appropriate error code. If
// an error has already occurred when this function is called, it is a no-op.
-func fts5SegIterInit(tls *libc.TLS, p uintptr, pSeg uintptr, pIter uintptr) { /* sqlite3.c:222751:13: */
+func fts5SegIterInit(tls *libc.TLS, p uintptr, pSeg uintptr, pIter uintptr) { /* sqlite3.c:224634:13: */
if (*Fts5StructureSegment)(unsafe.Pointer(pSeg)).FpgnoFirst == 0 {
// This happens if the segment is being used as an input to an incremental
// merge and all data has already been "trimmed". See function
@@ -179554,14 +181954,14 @@ func fts5SegIterInit(tls *libc.TLS, p uintptr, pSeg uintptr, pIter uintptr) { /*
libc.Xmemset(tls, pIter, 0, uint32(unsafe.Sizeof(Fts5SegIter{})))
fts5SegIterSetNext(tls, p, pIter)
(*Fts5SegIter)(unsafe.Pointer(pIter)).FpSeg = pSeg
- (*Fts5SegIter)(unsafe.Pointer(pIter)).FiLeafPgno = ((*Fts5StructureSegment)(unsafe.Pointer(pSeg)).FpgnoFirst - 1)
+ (*Fts5SegIter)(unsafe.Pointer(pIter)).FiLeafPgno = (*Fts5StructureSegment)(unsafe.Pointer(pSeg)).FpgnoFirst - 1
fts5SegIterNextPage(tls, p, pIter)
}
if (*Fts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK {
(*Fts5SegIter)(unsafe.Pointer(pIter)).FiLeafOffset = int64(4)
- (*Fts5SegIter)(unsafe.Pointer(pIter)).FiPgidxOff = ((*Fts5Data)(unsafe.Pointer((*Fts5SegIter)(unsafe.Pointer(pIter)).FpLeaf)).FszLeaf + 1)
+ (*Fts5SegIter)(unsafe.Pointer(pIter)).FiPgidxOff = (*Fts5Data)(unsafe.Pointer((*Fts5SegIter)(unsafe.Pointer(pIter)).FpLeaf)).FszLeaf + 1
fts5SegIterLoadTerm(tls, p, pIter, 0)
fts5SegIterLoadNPos(tls, p, pIter)
}
@@ -179580,7 +181980,7 @@ func fts5SegIterInit(tls *libc.TLS, p uintptr, pSeg uintptr, pIter uintptr) { /*
// aRowidOffset[] and iRowidOffset variables. At this point the iterator
// is in its regular state - Fts5SegIter.iLeafOffset points to the first
// byte of the position list content associated with said rowid.
-func fts5SegIterReverseInitPage(tls *libc.TLS, p uintptr, pIter uintptr) { /* sqlite3.c:222799:13: */
+func fts5SegIterReverseInitPage(tls *libc.TLS, p uintptr, pIter uintptr) { /* sqlite3.c:224683:13: */
bp := tls.Alloc(16)
defer tls.Free(16)
@@ -179599,9 +181999,9 @@ func fts5SegIterReverseInitPage(tls *libc.TLS, p uintptr, pIter uintptr) { /* sq
if eDetail == FTS5_DETAIL_NONE {
// todo
- if (i < n) && (int32(*(*U8)(unsafe.Pointer(a + uintptr(i)))) == 0) {
+ if i < n && int32(*(*U8)(unsafe.Pointer(a + uintptr(i)))) == 0 {
i++
- if (i < n) && (int32(*(*U8)(unsafe.Pointer(a + uintptr(i)))) == 0) {
+ if i < n && int32(*(*U8)(unsafe.Pointer(a + uintptr(i)))) == 0 {
i++
}
}
@@ -179610,19 +182010,19 @@ func fts5SegIterReverseInitPage(tls *libc.TLS, p uintptr, pIter uintptr) { /* sq
// var bDummy int32 at bp+4, 4
- i = i + (fts5GetPoslistSize(tls, (a + uintptr(i)), bp /* &nPos */, bp+4 /* &bDummy */))
- i = i + (*(*int32)(unsafe.Pointer(bp /* nPos */)))
+ i = i + fts5GetPoslistSize(tls, a+uintptr(i), bp, bp+4)
+ i = i + *(*int32)(unsafe.Pointer(bp))
}
if i >= n {
break
}
- i = i + (int32(sqlite3Fts5GetVarint(tls, (a + uintptr(i)), bp+8 /* &iDelta */)))
- *(*I64)(unsafe.Pointer(pIter + 80 /* &.iRowid */)) += I64((*(*U64)(unsafe.Pointer(bp + 8 /* iDelta */))))
+ i = i + int32(sqlite3Fts5GetVarint(tls, a+uintptr(i), bp+8))
+ *(*I64)(unsafe.Pointer(pIter + 80)) += I64(*(*U64)(unsafe.Pointer(bp + 8)))
// If necessary, grow the pIter->aRowidOffset[] array.
if iRowidOffset >= (*Fts5SegIter)(unsafe.Pointer(pIter)).FnRowidOffset {
- var nNew int32 = ((*Fts5SegIter)(unsafe.Pointer(pIter)).FnRowidOffset + 8)
- var aNew uintptr = Xsqlite3_realloc64(tls, (*Fts5SegIter)(unsafe.Pointer(pIter)).FaRowidOffset, (uint64(uint32(nNew) * uint32(unsafe.Sizeof(int32(0))))))
+ var nNew int32 = (*Fts5SegIter)(unsafe.Pointer(pIter)).FnRowidOffset + 8
+ var aNew uintptr = Xsqlite3_realloc64(tls, (*Fts5SegIter)(unsafe.Pointer(pIter)).FaRowidOffset, uint64(uint32(nNew)*uint32(unsafe.Sizeof(int32(0)))))
if aNew == uintptr(0) {
(*Fts5Index)(unsafe.Pointer(p)).Frc = SQLITE_NOMEM
break
@@ -179639,14 +182039,14 @@ func fts5SegIterReverseInitPage(tls *libc.TLS, p uintptr, pIter uintptr) { /* sq
}
//
-func fts5SegIterReverseNewPage(tls *libc.TLS, p uintptr, pIter uintptr) { /* sqlite3.c:222852:13: */
+func fts5SegIterReverseNewPage(tls *libc.TLS, p uintptr, pIter uintptr) { /* sqlite3.c:224736:13: */
fts5DataRelease(tls, (*Fts5SegIter)(unsafe.Pointer(pIter)).FpLeaf)
(*Fts5SegIter)(unsafe.Pointer(pIter)).FpLeaf = uintptr(0)
- for ((*Fts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK) && ((*Fts5SegIter)(unsafe.Pointer(pIter)).FiLeafPgno > (*Fts5SegIter)(unsafe.Pointer(pIter)).FiTermLeafPgno) {
+ for (*Fts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK && (*Fts5SegIter)(unsafe.Pointer(pIter)).FiLeafPgno > (*Fts5SegIter)(unsafe.Pointer(pIter)).FiTermLeafPgno {
var pNew uintptr
(*Fts5SegIter)(unsafe.Pointer(pIter)).FiLeafPgno--
- pNew = fts5DataRead(tls, p, (((((I64((*Fts5StructureSegment)(unsafe.Pointer((*Fts5SegIter)(unsafe.Pointer(pIter)).FpSeg)).FiSegid)) << ((FTS5_DATA_PAGE_B + FTS5_DATA_HEIGHT_B) + FTS5_DATA_DLI_B)) + (I64((int64(0))) << (FTS5_DATA_PAGE_B + FTS5_DATA_HEIGHT_B))) + (I64((int64(0))) << (FTS5_DATA_PAGE_B))) + (I64((*Fts5SegIter)(unsafe.Pointer(pIter)).FiLeafPgno))))
+ pNew = fts5DataRead(tls, p, I64((*Fts5StructureSegment)(unsafe.Pointer((*Fts5SegIter)(unsafe.Pointer(pIter)).FpSeg)).FiSegid)<<(FTS5_DATA_PAGE_B+FTS5_DATA_HEIGHT_B+FTS5_DATA_DLI_B)+I64(int64(0))<<(FTS5_DATA_PAGE_B+FTS5_DATA_HEIGHT_B)+I64(int64(0))<<FTS5_DATA_PAGE_B+I64((*Fts5SegIter)(unsafe.Pointer(pIter)).FiLeafPgno))
if pNew != 0 {
// iTermLeafOffset may be equal to szLeaf if the term is the last
// thing on the page - i.e. the first rowid is on the following page.
@@ -179667,8 +182067,8 @@ func fts5SegIterReverseNewPage(tls *libc.TLS, p uintptr, pIter uintptr) { /* sql
}
if (*Fts5SegIter)(unsafe.Pointer(pIter)).FpLeaf != 0 {
- var a uintptr = ((*Fts5Data)(unsafe.Pointer((*Fts5SegIter)(unsafe.Pointer(pIter)).FpLeaf)).Fp + uintptr((*Fts5SegIter)(unsafe.Pointer(pIter)).FiLeafOffset))
- *(*I64)(unsafe.Pointer(pIter + 24 /* &.iLeafOffset */)) += (I64(sqlite3Fts5GetVarint(tls, a, (pIter + 80 /* &.iRowid */))))
+ var a uintptr = (*Fts5Data)(unsafe.Pointer((*Fts5SegIter)(unsafe.Pointer(pIter)).FpLeaf)).Fp + uintptr((*Fts5SegIter)(unsafe.Pointer(pIter)).FiLeafOffset)
+ *(*I64)(unsafe.Pointer(pIter + 24)) += I64(sqlite3Fts5GetVarint(tls, a, pIter+80))
break
} else {
fts5DataRelease(tls, pNew)
@@ -179677,7 +182077,7 @@ func fts5SegIterReverseNewPage(tls *libc.TLS, p uintptr, pIter uintptr) { /* sql
}
if (*Fts5SegIter)(unsafe.Pointer(pIter)).FpLeaf != 0 {
- (*Fts5SegIter)(unsafe.Pointer(pIter)).FiEndofDoclist = ((*Fts5Data)(unsafe.Pointer((*Fts5SegIter)(unsafe.Pointer(pIter)).FpLeaf)).Fnn + 1)
+ (*Fts5SegIter)(unsafe.Pointer(pIter)).FiEndofDoclist = (*Fts5Data)(unsafe.Pointer((*Fts5SegIter)(unsafe.Pointer(pIter)).FpLeaf)).Fnn + 1
fts5SegIterReverseInitPage(tls, p, pIter)
}
}
@@ -179685,15 +182085,15 @@ func fts5SegIterReverseNewPage(tls *libc.TLS, p uintptr, pIter uintptr) { /* sql
// Return true if the iterator passed as the second argument currently
// points to a delete marker. A delete marker is an entry with a 0 byte
// position-list.
-func fts5MultiIterIsEmpty(tls *libc.TLS, p uintptr, pIter uintptr) int32 { /* sqlite3.c:222904:12: */
- var pSeg uintptr = ((pIter + 80 /* &.aSeg */) + uintptr((*Fts5CResult)(unsafe.Pointer((*Fts5Iter)(unsafe.Pointer(pIter)).FaFirst+1*4)).FiFirst)*96)
- return (libc.Bool32((((*Fts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK) && ((*Fts5SegIter)(unsafe.Pointer(pSeg)).FpLeaf != 0)) && ((*Fts5SegIter)(unsafe.Pointer(pSeg)).FnPos == 0)))
+func fts5MultiIterIsEmpty(tls *libc.TLS, p uintptr, pIter uintptr) int32 { /* sqlite3.c:224788:12: */
+ var pSeg uintptr = pIter + 80 + uintptr((*Fts5CResult)(unsafe.Pointer((*Fts5Iter)(unsafe.Pointer(pIter)).FaFirst+1*4)).FiFirst)*96
+ return libc.Bool32((*Fts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK && (*Fts5SegIter)(unsafe.Pointer(pSeg)).FpLeaf != 0 && (*Fts5SegIter)(unsafe.Pointer(pSeg)).FnPos == 0)
}
// Advance iterator pIter to the next entry.
//
// This version of fts5SegIterNext() is only used by reverse iterators.
-func fts5SegIterNext_Reverse(tls *libc.TLS, p uintptr, pIter uintptr, pbUnused uintptr) { /* sqlite3.c:222914:13: */
+func fts5SegIterNext_Reverse(tls *libc.TLS, p uintptr, pIter uintptr, pbUnused uintptr) { /* sqlite3.c:224798:13: */
bp := tls.Alloc(8)
defer tls.Free(8)
@@ -179709,10 +182109,10 @@ func fts5SegIterNext_Reverse(tls *libc.TLS, p uintptr, pIter uintptr, pbUnused u
fts5SegIterLoadNPos(tls, p, pIter)
iOff = int32((*Fts5SegIter)(unsafe.Pointer(pIter)).FiLeafOffset)
if (*Fts5Config)(unsafe.Pointer((*Fts5Index)(unsafe.Pointer(p)).FpConfig)).FeDetail != FTS5_DETAIL_NONE {
- iOff = iOff + ((*Fts5SegIter)(unsafe.Pointer(pIter)).FnPos)
+ iOff = iOff + (*Fts5SegIter)(unsafe.Pointer(pIter)).FnPos
}
- sqlite3Fts5GetVarint(tls, (a + uintptr(iOff)), bp /* &iDelta */)
- *(*I64)(unsafe.Pointer(pIter + 80 /* &.iRowid */)) -= I64((*(*U64)(unsafe.Pointer(bp /* iDelta */))))
+ sqlite3Fts5GetVarint(tls, a+uintptr(iOff), bp /* &iDelta */)
+ *(*I64)(unsafe.Pointer(pIter + 80)) -= I64(*(*U64)(unsafe.Pointer(bp)))
} else {
fts5SegIterReverseNewPage(tls, p, pIter)
}
@@ -179722,7 +182122,7 @@ func fts5SegIterNext_Reverse(tls *libc.TLS, p uintptr, pIter uintptr, pbUnused u
//
// This version of fts5SegIterNext() is only used if detail=none and the
// iterator is not a reverse direction iterator.
-func fts5SegIterNext_None(tls *libc.TLS, p uintptr, pIter uintptr, pbNewTerm uintptr) { /* sqlite3.c:222948:13: */
+func fts5SegIterNext_None(tls *libc.TLS, p uintptr, pIter uintptr, pbNewTerm uintptr) { /* sqlite3.c:224832:13: */
bp := tls.Alloc(24)
defer tls.Free(24)
@@ -179741,11 +182141,11 @@ func fts5SegIterNext_None(tls *libc.TLS, p uintptr, pIter uintptr, pbNewTerm uin
iOff = int32((*Fts5SegIter)(unsafe.Pointer(pIter)).FiLeafOffset)
// Next entry is on the next page
- if !(((*Fts5SegIter)(unsafe.Pointer(pIter)).FpSeg != 0) && (iOff >= (*Fts5Data)(unsafe.Pointer((*Fts5SegIter)(unsafe.Pointer(pIter)).FpLeaf)).FszLeaf)) {
+ if !((*Fts5SegIter)(unsafe.Pointer(pIter)).FpSeg != 0 && iOff >= (*Fts5Data)(unsafe.Pointer((*Fts5SegIter)(unsafe.Pointer(pIter)).FpLeaf)).FszLeaf) {
goto __1
}
fts5SegIterNextPage(tls, p, pIter)
- if !(((*Fts5Index)(unsafe.Pointer(p)).Frc != 0) || ((*Fts5SegIter)(unsafe.Pointer(pIter)).FpLeaf == uintptr(0))) {
+ if !((*Fts5Index)(unsafe.Pointer(p)).Frc != 0 || (*Fts5SegIter)(unsafe.Pointer(pIter)).FpLeaf == uintptr(0)) {
goto __2
}
return
@@ -179759,12 +182159,12 @@ __1:
if !(iOff < (*Fts5SegIter)(unsafe.Pointer(pIter)).FiEndofDoclist) {
goto __3
}
- iOff = iOff + (int32(sqlite3Fts5GetVarint(tls, ((*Fts5Data)(unsafe.Pointer((*Fts5SegIter)(unsafe.Pointer(pIter)).FpLeaf)).Fp + uintptr(iOff)), bp /* &iDelta */)))
+ iOff = iOff + int32(sqlite3Fts5GetVarint(tls, (*Fts5Data)(unsafe.Pointer((*Fts5SegIter)(unsafe.Pointer(pIter)).FpLeaf)).Fp+uintptr(iOff), bp))
(*Fts5SegIter)(unsafe.Pointer(pIter)).FiLeafOffset = I64(iOff)
- *(*I64)(unsafe.Pointer(pIter + 80 /* &.iRowid */)) += (*(*I64)(unsafe.Pointer(bp /* iDelta */)))
+ *(*I64)(unsafe.Pointer(pIter + 80)) += *(*I64)(unsafe.Pointer(bp))
goto __4
__3:
- if !(((*Fts5SegIter)(unsafe.Pointer(pIter)).Fflags & FTS5_SEGITER_ONETERM) == 0) {
+ if !((*Fts5SegIter)(unsafe.Pointer(pIter)).Fflags&FTS5_SEGITER_ONETERM == 0) {
goto __5
}
if !((*Fts5SegIter)(unsafe.Pointer(pIter)).FpSeg != 0) {
@@ -179774,7 +182174,7 @@ __3:
if !(iOff != fts5LeafFirstTermOff(tls, (*Fts5SegIter)(unsafe.Pointer(pIter)).FpLeaf)) {
goto __9
}
- iOff = iOff + (sqlite3Fts5GetVarint32(tls, ((*Fts5Data)(unsafe.Pointer((*Fts5SegIter)(unsafe.Pointer(pIter)).FpLeaf)).Fp + uintptr(iOff)), bp+8 /* &nKeep */))
+ iOff = iOff + sqlite3Fts5GetVarint32(tls, (*Fts5Data)(unsafe.Pointer((*Fts5SegIter)(unsafe.Pointer(pIter)).FpLeaf)).Fp+uintptr(iOff), bp+8)
__9:
;
(*Fts5SegIter)(unsafe.Pointer(pIter)).FiLeafOffset = I64(iOff)
@@ -179785,7 +182185,7 @@ __7:
*(*uintptr)(unsafe.Pointer(bp + 12 /* zTerm */)) = uintptr(0)
sqlite3Fts5HashScanNext(tls, (*Fts5Index)(unsafe.Pointer(p)).FpHash)
sqlite3Fts5HashScanEntry(tls, (*Fts5Index)(unsafe.Pointer(p)).FpHash, bp+12 /* &zTerm */, bp+16 /* &pList */, bp+20 /* &nList */)
- if !(*(*uintptr)(unsafe.Pointer(bp + 16 /* pList */)) == uintptr(0)) {
+ if !(*(*uintptr)(unsafe.Pointer(bp + 16)) == uintptr(0)) {
goto __10
}
goto next_none_eof
@@ -179795,8 +182195,8 @@ __10:
(*Fts5Data)(unsafe.Pointer((*Fts5SegIter)(unsafe.Pointer(pIter)).FpLeaf)).Fnn = *(*int32)(unsafe.Pointer(bp + 20 /* nList */))
(*Fts5Data)(unsafe.Pointer((*Fts5SegIter)(unsafe.Pointer(pIter)).FpLeaf)).FszLeaf = *(*int32)(unsafe.Pointer(bp + 20 /* nList */))
(*Fts5SegIter)(unsafe.Pointer(pIter)).FiEndofDoclist = *(*int32)(unsafe.Pointer(bp + 20 /* nList */))
- sqlite3Fts5BufferSet(tls, (p + 36 /* &.rc */), (pIter + 68 /* &.term */), int32(libc.Xstrlen(tls, *(*uintptr)(unsafe.Pointer(bp + 12 /* zTerm */)))), *(*uintptr)(unsafe.Pointer(bp + 12 /* zTerm */)))
- (*Fts5SegIter)(unsafe.Pointer(pIter)).FiLeafOffset = I64(sqlite3Fts5GetVarint(tls, *(*uintptr)(unsafe.Pointer(bp + 16 /* pList */)), (pIter + 80 /* &.iRowid */)))
+ sqlite3Fts5BufferSet(tls, p+36, pIter+68, int32(libc.Xstrlen(tls, *(*uintptr)(unsafe.Pointer(bp + 12 /* zTerm */)))), *(*uintptr)(unsafe.Pointer(bp + 12 /* zTerm */)))
+ (*Fts5SegIter)(unsafe.Pointer(pIter)).FiLeafOffset = I64(sqlite3Fts5GetVarint(tls, *(*uintptr)(unsafe.Pointer(bp + 16 /* pList */)), pIter+80))
__8:
;
@@ -179827,7 +182227,7 @@ next_none_eof:
// If an error occurs, Fts5Index.rc is set to an appropriate error code. It
// is not considered an error if the iterator reaches EOF. If an error has
// already occurred when this function is called, it is a no-op.
-func fts5SegIterNext(tls *libc.TLS, p uintptr, pIter uintptr, pbNewTerm uintptr) { /* sqlite3.c:223020:13: */
+func fts5SegIterNext(tls *libc.TLS, p uintptr, pIter uintptr, pbNewTerm uintptr) { /* sqlite3.c:224904:13: */
bp := tls.Alloc(36)
defer tls.Free(36)
@@ -179843,21 +182243,21 @@ func fts5SegIterNext(tls *libc.TLS, p uintptr, pIter uintptr, pbNewTerm uintptr)
a = (*Fts5Data)(unsafe.Pointer(pLeaf)).Fp
n = (*Fts5Data)(unsafe.Pointer(pLeaf)).FszLeaf
- *(*int32)(unsafe.Pointer(bp + 28 /* iOff */)) = (int32((*Fts5SegIter)(unsafe.Pointer(pIter)).FiLeafOffset + I64((*Fts5SegIter)(unsafe.Pointer(pIter)).FnPos)))
+ *(*int32)(unsafe.Pointer(bp + 28 /* iOff */)) = int32((*Fts5SegIter)(unsafe.Pointer(pIter)).FiLeafOffset + I64((*Fts5SegIter)(unsafe.Pointer(pIter)).FnPos))
- if *(*int32)(unsafe.Pointer(bp + 28 /* iOff */)) < n {
+ if *(*int32)(unsafe.Pointer(bp + 28)) < n {
// The next entry is on the current page.
- if *(*int32)(unsafe.Pointer(bp + 28 /* iOff */)) >= (*Fts5SegIter)(unsafe.Pointer(pIter)).FiEndofDoclist {
+ if *(*int32)(unsafe.Pointer(bp + 28)) >= (*Fts5SegIter)(unsafe.Pointer(pIter)).FiEndofDoclist {
bNewTerm = 1
- if *(*int32)(unsafe.Pointer(bp + 28 /* iOff */)) != fts5LeafFirstTermOff(tls, pLeaf) {
- *(*int32)(unsafe.Pointer(bp + 28 /* iOff */)) += sqlite3Fts5GetVarint32(tls, (a + uintptr(*(*int32)(unsafe.Pointer(bp + 28 /* iOff */)))), bp /* &nKeep */)
+ if *(*int32)(unsafe.Pointer(bp + 28)) != fts5LeafFirstTermOff(tls, pLeaf) {
+ *(*int32)(unsafe.Pointer(bp + 28 /* iOff */)) += sqlite3Fts5GetVarint32(tls, a+uintptr(*(*int32)(unsafe.Pointer(bp + 28))), bp /* &nKeep */)
}
} else {
// var iDelta U64 at bp+8, 8
- *(*int32)(unsafe.Pointer(bp + 28 /* iOff */)) += int32(sqlite3Fts5GetVarint(tls, (a + uintptr(*(*int32)(unsafe.Pointer(bp + 28 /* iOff */)))), bp+8 /* &iDelta */))
- *(*I64)(unsafe.Pointer(pIter + 80 /* &.iRowid */)) += I64((*(*U64)(unsafe.Pointer(bp + 8 /* iDelta */))))
+ *(*int32)(unsafe.Pointer(bp + 28 /* iOff */)) += int32(sqlite3Fts5GetVarint(tls, a+uintptr(*(*int32)(unsafe.Pointer(bp + 28))), bp+8 /* &iDelta */))
+ *(*I64)(unsafe.Pointer(pIter + 80)) += I64(*(*U64)(unsafe.Pointer(bp + 8)))
}
(*Fts5SegIter)(unsafe.Pointer(pIter)).FiLeafOffset = I64(*(*int32)(unsafe.Pointer(bp + 28 /* iOff */)))
@@ -179867,49 +182267,49 @@ func fts5SegIterNext(tls *libc.TLS, p uintptr, pIter uintptr, pbNewTerm uintptr)
*(*uintptr)(unsafe.Pointer(bp + 16 /* zTerm */)) = uintptr(0)
*(*int32)(unsafe.Pointer(bp + 24 /* nList */)) = 0
- if 0 == ((*Fts5SegIter)(unsafe.Pointer(pIter)).Fflags & FTS5_SEGITER_ONETERM) {
+ if 0 == (*Fts5SegIter)(unsafe.Pointer(pIter)).Fflags&FTS5_SEGITER_ONETERM {
sqlite3Fts5HashScanNext(tls, (*Fts5Index)(unsafe.Pointer(p)).FpHash)
sqlite3Fts5HashScanEntry(tls, (*Fts5Index)(unsafe.Pointer(p)).FpHash, bp+16 /* &zTerm */, bp+20 /* &pList */, bp+24 /* &nList */)
}
- if *(*uintptr)(unsafe.Pointer(bp + 20 /* pList */)) == uintptr(0) {
+ if *(*uintptr)(unsafe.Pointer(bp + 20)) == uintptr(0) {
fts5DataRelease(tls, (*Fts5SegIter)(unsafe.Pointer(pIter)).FpLeaf)
(*Fts5SegIter)(unsafe.Pointer(pIter)).FpLeaf = uintptr(0)
} else {
(*Fts5Data)(unsafe.Pointer((*Fts5SegIter)(unsafe.Pointer(pIter)).FpLeaf)).Fp = *(*uintptr)(unsafe.Pointer(bp + 20 /* pList */))
(*Fts5Data)(unsafe.Pointer((*Fts5SegIter)(unsafe.Pointer(pIter)).FpLeaf)).Fnn = *(*int32)(unsafe.Pointer(bp + 24 /* nList */))
(*Fts5Data)(unsafe.Pointer((*Fts5SegIter)(unsafe.Pointer(pIter)).FpLeaf)).FszLeaf = *(*int32)(unsafe.Pointer(bp + 24 /* nList */))
- (*Fts5SegIter)(unsafe.Pointer(pIter)).FiEndofDoclist = (*(*int32)(unsafe.Pointer(bp + 24 /* nList */)) + 1)
- sqlite3Fts5BufferSet(tls, (p + 36 /* &.rc */), (pIter + 68 /* &.term */), int32(libc.Xstrlen(tls, *(*uintptr)(unsafe.Pointer(bp + 16 /* zTerm */)))),
+ (*Fts5SegIter)(unsafe.Pointer(pIter)).FiEndofDoclist = *(*int32)(unsafe.Pointer(bp + 24)) + 1
+ sqlite3Fts5BufferSet(tls, p+36, pIter+68, int32(libc.Xstrlen(tls, *(*uintptr)(unsafe.Pointer(bp + 16 /* zTerm */)))),
*(*uintptr)(unsafe.Pointer(bp + 16 /* zTerm */)))
- (*Fts5SegIter)(unsafe.Pointer(pIter)).FiLeafOffset = I64(sqlite3Fts5GetVarint(tls, *(*uintptr)(unsafe.Pointer(bp + 20 /* pList */)), (pIter + 80 /* &.iRowid */)))
+ (*Fts5SegIter)(unsafe.Pointer(pIter)).FiLeafOffset = I64(sqlite3Fts5GetVarint(tls, *(*uintptr)(unsafe.Pointer(bp + 20 /* pList */)), pIter+80))
*(*int32)(unsafe.Pointer(pbNewTerm)) = 1
}
} else {
*(*int32)(unsafe.Pointer(bp + 28 /* iOff */)) = 0
// Next entry is not on the current page
- for *(*int32)(unsafe.Pointer(bp + 28 /* iOff */)) == 0 {
+ for *(*int32)(unsafe.Pointer(bp + 28)) == 0 {
fts5SegIterNextPage(tls, p, pIter)
pLeaf = (*Fts5SegIter)(unsafe.Pointer(pIter)).FpLeaf
if pLeaf == uintptr(0) {
break
}
- if (libc.AssignPtrInt32(bp+28 /* iOff */, int32(fts5GetU16(tls, (*Fts5Data)(unsafe.Pointer(pLeaf)).Fp))) != 0) && (*(*int32)(unsafe.Pointer(bp + 28 /* iOff */)) < (*Fts5Data)(unsafe.Pointer(pLeaf)).FszLeaf) {
- *(*int32)(unsafe.Pointer(bp + 28 /* iOff */)) += int32(sqlite3Fts5GetVarint(tls, ((*Fts5Data)(unsafe.Pointer(pLeaf)).Fp + uintptr(*(*int32)(unsafe.Pointer(bp + 28 /* iOff */)))), (pIter + 80 /* &.iRowid */)))
+ if libc.AssignPtrInt32(bp+28, int32(fts5GetU16(tls, (*Fts5Data)(unsafe.Pointer(pLeaf)).Fp))) != 0 && *(*int32)(unsafe.Pointer(bp + 28)) < (*Fts5Data)(unsafe.Pointer(pLeaf)).FszLeaf {
+ *(*int32)(unsafe.Pointer(bp + 28 /* iOff */)) += int32(sqlite3Fts5GetVarint(tls, (*Fts5Data)(unsafe.Pointer(pLeaf)).Fp+uintptr(*(*int32)(unsafe.Pointer(bp + 28))), pIter+80))
(*Fts5SegIter)(unsafe.Pointer(pIter)).FiLeafOffset = I64(*(*int32)(unsafe.Pointer(bp + 28 /* iOff */)))
if (*Fts5Data)(unsafe.Pointer(pLeaf)).Fnn > (*Fts5Data)(unsafe.Pointer(pLeaf)).FszLeaf {
- (*Fts5SegIter)(unsafe.Pointer(pIter)).FiPgidxOff = ((*Fts5Data)(unsafe.Pointer(pLeaf)).FszLeaf + sqlite3Fts5GetVarint32(tls, ((*Fts5Data)(unsafe.Pointer(pLeaf)).Fp+uintptr((*Fts5Data)(unsafe.Pointer(pLeaf)).FszLeaf)), (pIter+48 /* &.iEndofDoclist */)))
+ (*Fts5SegIter)(unsafe.Pointer(pIter)).FiPgidxOff = (*Fts5Data)(unsafe.Pointer(pLeaf)).FszLeaf + sqlite3Fts5GetVarint32(tls, (*Fts5Data)(unsafe.Pointer(pLeaf)).Fp+uintptr((*Fts5Data)(unsafe.Pointer(pLeaf)).FszLeaf), pIter+48)
}
} else if (*Fts5Data)(unsafe.Pointer(pLeaf)).Fnn > (*Fts5Data)(unsafe.Pointer(pLeaf)).FszLeaf {
- (*Fts5SegIter)(unsafe.Pointer(pIter)).FiPgidxOff = ((*Fts5Data)(unsafe.Pointer(pLeaf)).FszLeaf + sqlite3Fts5GetVarint32(tls, ((*Fts5Data)(unsafe.Pointer(pLeaf)).Fp+uintptr((*Fts5Data)(unsafe.Pointer(pLeaf)).FszLeaf)), bp+28 /* &iOff */))
+ (*Fts5SegIter)(unsafe.Pointer(pIter)).FiPgidxOff = (*Fts5Data)(unsafe.Pointer(pLeaf)).FszLeaf + sqlite3Fts5GetVarint32(tls, (*Fts5Data)(unsafe.Pointer(pLeaf)).Fp+uintptr((*Fts5Data)(unsafe.Pointer(pLeaf)).FszLeaf), bp+28)
(*Fts5SegIter)(unsafe.Pointer(pIter)).FiLeafOffset = I64(*(*int32)(unsafe.Pointer(bp + 28 /* iOff */)))
(*Fts5SegIter)(unsafe.Pointer(pIter)).FiEndofDoclist = *(*int32)(unsafe.Pointer(bp + 28 /* iOff */))
bNewTerm = 1
}
- if *(*int32)(unsafe.Pointer(bp + 28 /* iOff */)) > (*Fts5Data)(unsafe.Pointer(pLeaf)).FszLeaf {
- (*Fts5Index)(unsafe.Pointer(p)).Frc = (SQLITE_CORRUPT | (int32(1) << 8))
+ if *(*int32)(unsafe.Pointer(bp + 28)) > (*Fts5Data)(unsafe.Pointer(pLeaf)).FszLeaf {
+ (*Fts5Index)(unsafe.Pointer(p)).Frc = SQLITE_CORRUPT | int32(1)<<8
return
}
}
@@ -179918,7 +182318,7 @@ func fts5SegIterNext(tls *libc.TLS, p uintptr, pIter uintptr, pbNewTerm uintptr)
// Check if the iterator is now at EOF. If so, return early.
if (*Fts5SegIter)(unsafe.Pointer(pIter)).FpLeaf != 0 {
if bNewTerm != 0 {
- if ((*Fts5SegIter)(unsafe.Pointer(pIter)).Fflags & FTS5_SEGITER_ONETERM) != 0 {
+ if (*Fts5SegIter)(unsafe.Pointer(pIter)).Fflags&FTS5_SEGITER_ONETERM != 0 {
fts5DataRelease(tls, (*Fts5SegIter)(unsafe.Pointer(pIter)).FpLeaf)
(*Fts5SegIter)(unsafe.Pointer(pIter)).FpLeaf = uintptr(0)
} else {
@@ -179935,15 +182335,15 @@ func fts5SegIterNext(tls *libc.TLS, p uintptr, pIter uintptr, pbNewTerm uintptr)
// var nSz int32 at bp+32, 4
{
- *(*int32)(unsafe.Pointer(bp + 32 /* nSz */)) = int32(*(*U8)(unsafe.Pointer(((*Fts5Data)(unsafe.Pointer((*Fts5SegIter)(unsafe.Pointer(pIter)).FpLeaf)).Fp) + uintptr(libc.PostIncInt64(&(*Fts5SegIter)(unsafe.Pointer(pIter)).FiLeafOffset, 1)))))
- if (*(*int32)(unsafe.Pointer(bp + 32 /* nSz */)) & 0x80) != 0 {
+ *(*int32)(unsafe.Pointer(bp + 32 /* nSz */)) = int32(*(*U8)(unsafe.Pointer((*Fts5Data)(unsafe.Pointer((*Fts5SegIter)(unsafe.Pointer(pIter)).FpLeaf)).Fp + uintptr(libc.PostIncInt64(&(*Fts5SegIter)(unsafe.Pointer(pIter)).FiLeafOffset, 1)))))
+ if *(*int32)(unsafe.Pointer(bp + 32))&0x80 != 0 {
(*Fts5SegIter)(unsafe.Pointer(pIter)).FiLeafOffset--
- *(*I64)(unsafe.Pointer(pIter + 24 /* &.iLeafOffset */)) += (I64(sqlite3Fts5GetVarint32(tls, (((*Fts5Data)(unsafe.Pointer((*Fts5SegIter)(unsafe.Pointer(pIter)).FpLeaf)).Fp) + uintptr((*Fts5SegIter)(unsafe.Pointer(pIter)).FiLeafOffset)), bp+32 /* &nSz */)))
+ *(*I64)(unsafe.Pointer(pIter + 24)) += I64(sqlite3Fts5GetVarint32(tls, (*Fts5Data)(unsafe.Pointer((*Fts5SegIter)(unsafe.Pointer(pIter)).FpLeaf)).Fp+uintptr((*Fts5SegIter)(unsafe.Pointer(pIter)).FiLeafOffset), bp+32))
}
}
- (*Fts5SegIter)(unsafe.Pointer(pIter)).FbDel = (U8(*(*int32)(unsafe.Pointer(bp + 32 /* nSz */)) & 0x0001))
- (*Fts5SegIter)(unsafe.Pointer(pIter)).FnPos = (*(*int32)(unsafe.Pointer(bp + 32 /* nSz */)) >> 1)
+ (*Fts5SegIter)(unsafe.Pointer(pIter)).FbDel = U8(*(*int32)(unsafe.Pointer(bp + 32)) & 0x0001)
+ (*Fts5SegIter)(unsafe.Pointer(pIter)).FnPos = *(*int32)(unsafe.Pointer(bp + 32)) >> 1
}
}
@@ -179952,7 +182352,7 @@ func fts5SegIterNext(tls *libc.TLS, p uintptr, pIter uintptr, pbNewTerm uintptr)
// Iterator pIter currently points to the first rowid in a doclist. This
// function sets the iterator up so that iterates in reverse order through
// the doclist.
-func fts5SegIterReverse(tls *libc.TLS, p uintptr, pIter uintptr) { /* sqlite3.c:223151:13: */
+func fts5SegIterReverse(tls *libc.TLS, p uintptr, pIter uintptr) { /* sqlite3.c:225035:13: */
var pDlidx uintptr = (*Fts5SegIter)(unsafe.Pointer(pIter)).FpDlidx
var pLast uintptr = uintptr(0)
var pgnoLast int32 = 0
@@ -179960,7 +182360,7 @@ func fts5SegIterReverse(tls *libc.TLS, p uintptr, pIter uintptr) { /* sqlite3.c:
if pDlidx != 0 {
var iSegid int32 = (*Fts5StructureSegment)(unsafe.Pointer((*Fts5SegIter)(unsafe.Pointer(pIter)).FpSeg)).FiSegid
pgnoLast = fts5DlidxIterPgno(tls, pDlidx)
- pLast = fts5DataRead(tls, p, (((((I64(iSegid)) << ((FTS5_DATA_PAGE_B + FTS5_DATA_HEIGHT_B) + FTS5_DATA_DLI_B)) + (I64((int64(0))) << (FTS5_DATA_PAGE_B + FTS5_DATA_HEIGHT_B))) + (I64((int64(0))) << (FTS5_DATA_PAGE_B))) + (I64(pgnoLast))))
+ pLast = fts5LeafRead(tls, p, I64(iSegid)<<(FTS5_DATA_PAGE_B+FTS5_DATA_HEIGHT_B+FTS5_DATA_DLI_B)+I64(int64(0))<<(FTS5_DATA_PAGE_B+FTS5_DATA_HEIGHT_B)+I64(int64(0))<<FTS5_DATA_PAGE_B+I64(pgnoLast))
} else {
var pLeaf uintptr = (*Fts5SegIter)(unsafe.Pointer(pIter)).FpLeaf // Current leaf data
@@ -179974,8 +182374,8 @@ func fts5SegIterReverse(tls *libc.TLS, p uintptr, pIter uintptr) { /* sqlite3.c:
iPoslist = 4
}
{
- var iEnd int32 = (iPoslist + 9)
- for ((int32(*(*U8)(unsafe.Pointer((*Fts5Data)(unsafe.Pointer(pLeaf)).Fp + uintptr(libc.PostIncInt32(&iPoslist, 1))))) & 0x80) != 0) && (iPoslist < iEnd) {
+ var iEnd int32 = iPoslist + 9
+ for int32(*(*U8)(unsafe.Pointer((*Fts5Data)(unsafe.Pointer(pLeaf)).Fp + uintptr(libc.PostIncInt32(&iPoslist, 1)))))&0x80 != 0 && iPoslist < iEnd {
}
}
@@ -179990,14 +182390,14 @@ func fts5SegIterReverse(tls *libc.TLS, p uintptr, pIter uintptr) { /* sqlite3.c:
// The last rowid in the doclist may not be on the current page. Search
// forward to find the page containing the last rowid.
- for pgno = ((*Fts5SegIter)(unsafe.Pointer(pIter)).FiLeafPgno + 1); !((*Fts5Index)(unsafe.Pointer(p)).Frc != 0) && (pgno <= (*Fts5StructureSegment)(unsafe.Pointer(pSeg)).FpgnoLast); pgno++ {
- var iAbs I64 = (((((I64((*Fts5StructureSegment)(unsafe.Pointer(pSeg)).FiSegid)) << ((FTS5_DATA_PAGE_B + FTS5_DATA_HEIGHT_B) + FTS5_DATA_DLI_B)) + (I64((int64(0))) << (FTS5_DATA_PAGE_B + FTS5_DATA_HEIGHT_B))) + (I64((int64(0))) << (FTS5_DATA_PAGE_B))) + (I64(pgno)))
- var pNew uintptr = fts5DataRead(tls, p, iAbs)
+ for pgno = (*Fts5SegIter)(unsafe.Pointer(pIter)).FiLeafPgno + 1; !((*Fts5Index)(unsafe.Pointer(p)).Frc != 0) && pgno <= (*Fts5StructureSegment)(unsafe.Pointer(pSeg)).FpgnoLast; pgno++ {
+ var iAbs I64 = I64((*Fts5StructureSegment)(unsafe.Pointer(pSeg)).FiSegid)<<(FTS5_DATA_PAGE_B+FTS5_DATA_HEIGHT_B+FTS5_DATA_DLI_B) + I64(int64(0))<<(FTS5_DATA_PAGE_B+FTS5_DATA_HEIGHT_B) + I64(int64(0))<<FTS5_DATA_PAGE_B + I64(pgno)
+ var pNew uintptr = fts5LeafRead(tls, p, iAbs)
if pNew != 0 {
var iRowid int32
var bTermless int32
iRowid = int32(fts5GetU16(tls, (*Fts5Data)(unsafe.Pointer(pNew)).Fp))
- bTermless = (libc.Bool32((*Fts5Data)(unsafe.Pointer((pNew))).FszLeaf >= (*Fts5Data)(unsafe.Pointer((pNew))).Fnn))
+ bTermless = libc.Bool32((*Fts5Data)(unsafe.Pointer(pNew)).FszLeaf >= (*Fts5Data)(unsafe.Pointer(pNew)).Fnn)
if iRowid != 0 {
{
var tmp uintptr
@@ -180031,15 +182431,18 @@ func fts5SegIterReverse(tls *libc.TLS, p uintptr, pIter uintptr) { /* sqlite3.c:
(*Fts5SegIter)(unsafe.Pointer(pIter)).FpLeaf = pLast
(*Fts5SegIter)(unsafe.Pointer(pIter)).FiLeafPgno = pgnoLast
iOff = int32(fts5GetU16(tls, (*Fts5Data)(unsafe.Pointer(pLast)).Fp))
- iOff = iOff + (int32(sqlite3Fts5GetVarint(tls, ((*Fts5Data)(unsafe.Pointer(pLast)).Fp + uintptr(iOff)), (pIter + 80 /* &.iRowid */))))
+ if iOff > (*Fts5Data)(unsafe.Pointer(pLast)).FszLeaf {
+ (*Fts5Index)(unsafe.Pointer(p)).Frc = SQLITE_CORRUPT | int32(1)<<8
+ return
+ }
+ iOff = iOff + int32(sqlite3Fts5GetVarint(tls, (*Fts5Data)(unsafe.Pointer(pLast)).Fp+uintptr(iOff), pIter+80))
(*Fts5SegIter)(unsafe.Pointer(pIter)).FiLeafOffset = I64(iOff)
- if (*Fts5Data)(unsafe.Pointer((pLast))).FszLeaf >= (*Fts5Data)(unsafe.Pointer((pLast))).Fnn {
- (*Fts5SegIter)(unsafe.Pointer(pIter)).FiEndofDoclist = ((*Fts5Data)(unsafe.Pointer(pLast)).Fnn + 1)
+ if (*Fts5Data)(unsafe.Pointer(pLast)).FszLeaf >= (*Fts5Data)(unsafe.Pointer(pLast)).Fnn {
+ (*Fts5SegIter)(unsafe.Pointer(pIter)).FiEndofDoclist = (*Fts5Data)(unsafe.Pointer(pLast)).Fnn + 1
} else {
(*Fts5SegIter)(unsafe.Pointer(pIter)).FiEndofDoclist = fts5LeafFirstTermOff(tls, pLast)
}
-
}
fts5SegIterReverseInitPage(tls, p, pIter)
@@ -180049,16 +182452,16 @@ func fts5SegIterReverse(tls *libc.TLS, p uintptr, pIter uintptr) { /* sqlite3.c:
// There is a doclist-index associated with the final term on the current
// page. If the current term is the last term on the page, load the
// doclist-index from disk and initialize an iterator at (pIter->pDlidx).
-func fts5SegIterLoadDlidx(tls *libc.TLS, p uintptr, pIter uintptr) { /* sqlite3.c:223237:13: */
+func fts5SegIterLoadDlidx(tls *libc.TLS, p uintptr, pIter uintptr) { /* sqlite3.c:225124:13: */
var iSeg int32 = (*Fts5StructureSegment)(unsafe.Pointer((*Fts5SegIter)(unsafe.Pointer(pIter)).FpSeg)).FiSegid
- var bRev int32 = ((*Fts5SegIter)(unsafe.Pointer(pIter)).Fflags & FTS5_SEGITER_REVERSE)
+ var bRev int32 = (*Fts5SegIter)(unsafe.Pointer(pIter)).Fflags & FTS5_SEGITER_REVERSE
var pLeaf uintptr = (*Fts5SegIter)(unsafe.Pointer(pIter)).FpLeaf // Current leaf data
// Check if the current doclist ends on this page. If it does, return
// early without loading the doclist-index (as it belongs to a different
// term.
- if ((*Fts5SegIter)(unsafe.Pointer(pIter)).FiTermLeafPgno == (*Fts5SegIter)(unsafe.Pointer(pIter)).FiLeafPgno) &&
- ((*Fts5SegIter)(unsafe.Pointer(pIter)).FiEndofDoclist < (*Fts5Data)(unsafe.Pointer(pLeaf)).FszLeaf) {
+ if (*Fts5SegIter)(unsafe.Pointer(pIter)).FiTermLeafPgno == (*Fts5SegIter)(unsafe.Pointer(pIter)).FiLeafPgno &&
+ (*Fts5SegIter)(unsafe.Pointer(pIter)).FiEndofDoclist < (*Fts5Data)(unsafe.Pointer(pLeaf)).FszLeaf {
return
}
@@ -180077,15 +182480,14 @@ func fts5SegIterLoadDlidx(tls *libc.TLS, p uintptr, pIter uintptr) { /* sqlite3.
// iterator is left pointing to the smallest term in the segment that
// is larger than the specified term, even if this term is not on the
// current page.
-func fts5LeafSeek(tls *libc.TLS, p uintptr, bGe int32, pIter uintptr, pTerm uintptr, nTerm int32) { /* sqlite3.c:223271:13: */
+func fts5LeafSeek(tls *libc.TLS, p uintptr, bGe int32, pIter uintptr, pTerm uintptr, nTerm int32) { /* sqlite3.c:225158:13: */
bp := tls.Alloc(20)
defer tls.Free(20)
- // var iOff int32 at bp+12, 4
+ // var iOff U32 at bp+12, 4
var a uintptr
- var szLeaf int32
- var n int32
+ var n U32
var nMatch U32
// var nKeep U32 at bp+8, 4
@@ -180093,26 +182495,25 @@ func fts5LeafSeek(tls *libc.TLS, p uintptr, bGe int32, pIter uintptr, pTerm uint
// var iTermOff U32 at bp, 4
- var iPgidx int32 // Current offset in pgidx
+ var iPgidx U32 // Current offset in pgidx
var bEndOfPage int32
var nCmp U32
var i U32
// var nExtra int32 at bp+16, 4
a = (*Fts5Data)(unsafe.Pointer((*Fts5SegIter)(unsafe.Pointer(pIter)).FpLeaf)).Fp
- szLeaf = (*Fts5Data)(unsafe.Pointer((*Fts5SegIter)(unsafe.Pointer(pIter)).FpLeaf)).FszLeaf
- n = (*Fts5Data)(unsafe.Pointer((*Fts5SegIter)(unsafe.Pointer(pIter)).FpLeaf)).Fnn
+ n = U32((*Fts5Data)(unsafe.Pointer((*Fts5SegIter)(unsafe.Pointer(pIter)).FpLeaf)).Fnn)
nMatch = U32(0)
*(*U32)(unsafe.Pointer(bp + 8 /* nKeep */)) = U32(0)
*(*U32)(unsafe.Pointer(bp + 4 /* nNew */)) = U32(0)
bEndOfPage = 0
- iPgidx = szLeaf
- iPgidx = iPgidx + (sqlite3Fts5GetVarint32(tls, (a + uintptr(iPgidx)), bp /* &iTermOff */))
- *(*int32)(unsafe.Pointer(bp + 12 /* iOff */)) = int32(*(*U32)(unsafe.Pointer(bp /* iTermOff */)))
- if !(*(*int32)(unsafe.Pointer(bp + 12 /* iOff */)) > n) {
+ iPgidx = U32((*Fts5Data)(unsafe.Pointer((*Fts5SegIter)(unsafe.Pointer(pIter)).FpLeaf)).FszLeaf)
+ iPgidx = iPgidx + U32(sqlite3Fts5GetVarint32(tls, a+uintptr(iPgidx), bp))
+ *(*U32)(unsafe.Pointer(bp + 12 /* iOff */)) = *(*U32)(unsafe.Pointer(bp /* iTermOff */))
+ if !(*(*U32)(unsafe.Pointer(bp + 12)) > n) {
goto __1
}
- (*Fts5Index)(unsafe.Pointer(p)).Frc = (SQLITE_CORRUPT | (int32(1) << 8))
+ (*Fts5Index)(unsafe.Pointer(p)).Frc = SQLITE_CORRUPT | int32(1)<<8
return
__1:
;
@@ -180123,37 +182524,37 @@ __2:
}
/* Figure out how many new bytes are in this term */
- *(*U32)(unsafe.Pointer(bp + 4 /* nNew */)) = U32(*(*U8)(unsafe.Pointer((a) + uintptr(libc.PostIncInt32(&*(*int32)(unsafe.Pointer(bp + 12 /* iOff */)), 1)))))
- if !((*(*U32)(unsafe.Pointer(bp + 4 /* nNew */)) & U32(0x80)) != 0) {
+ *(*U32)(unsafe.Pointer(bp + 4 /* nNew */)) = U32(*(*U8)(unsafe.Pointer(a + uintptr(libc.PostIncUint32(&*(*U32)(unsafe.Pointer(bp + 12 /* iOff */)), 1)))))
+ if !(*(*U32)(unsafe.Pointer(bp + 4))&U32(0x80) != 0) {
goto __4
}
- *(*int32)(unsafe.Pointer(bp + 12 /* iOff */))--
- *(*int32)(unsafe.Pointer(bp + 12 /* iOff */)) += sqlite3Fts5GetVarint32(tls, ((a) + uintptr(*(*int32)(unsafe.Pointer(bp + 12 /* iOff */)))), bp+4 /* &nNew */)
+ *(*U32)(unsafe.Pointer(bp + 12 /* iOff */))--
+ *(*U32)(unsafe.Pointer(bp + 12 /* iOff */)) += U32(sqlite3Fts5GetVarint32(tls, a+uintptr(*(*U32)(unsafe.Pointer(bp + 12))), bp+4 /* &nNew */))
__4:
;
- if !(*(*U32)(unsafe.Pointer(bp + 8 /* nKeep */)) < nMatch) {
+ if !(*(*U32)(unsafe.Pointer(bp + 8)) < nMatch) {
goto __5
}
goto search_failed
__5:
;
- if !(*(*U32)(unsafe.Pointer(bp + 8 /* nKeep */)) == nMatch) {
+ if !(*(*U32)(unsafe.Pointer(bp + 8)) == nMatch) {
goto __6
}
nCmp = func() uint32 {
- if (*(*U32)(unsafe.Pointer(bp + 4 /* nNew */))) < (U32(nTerm) - nMatch) {
- return *(*U32)(unsafe.Pointer(bp + 4 /* nNew */))
+ if *(*U32)(unsafe.Pointer(bp + 4)) < U32(nTerm)-nMatch {
+ return *(*U32)(unsafe.Pointer(bp + 4))
}
- return (U32(nTerm) - nMatch)
+ return U32(nTerm) - nMatch
}()
i = U32(0)
__7:
if !(i < nCmp) {
goto __9
}
- if !(int32(*(*U8)(unsafe.Pointer(a + uintptr((U32(*(*int32)(unsafe.Pointer(bp + 12 /* iOff */))) + i))))) != int32(*(*U8)(unsafe.Pointer(pTerm + uintptr((nMatch + i)))))) {
+ if !(int32(*(*U8)(unsafe.Pointer(a + uintptr(*(*U32)(unsafe.Pointer(bp + 12))+i)))) != int32(*(*U8)(unsafe.Pointer(pTerm + uintptr(nMatch+i))))) {
goto __10
}
goto __9
@@ -180166,12 +182567,12 @@ __8:
goto __9
__9:
;
- nMatch = nMatch + (i)
+ nMatch = nMatch + i
if !(U32(nTerm) == nMatch) {
goto __11
}
- if !(i == *(*U32)(unsafe.Pointer(bp + 4 /* nNew */))) {
+ if !(i == *(*U32)(unsafe.Pointer(bp + 4))) {
goto __13
}
goto search_success
@@ -180182,7 +182583,7 @@ __14:
;
goto __12
__11:
- if !((i < *(*U32)(unsafe.Pointer(bp + 4 /* nNew */))) && (int32(*(*U8)(unsafe.Pointer(a + uintptr((U32(*(*int32)(unsafe.Pointer(bp + 12 /* iOff */))) + i))))) > int32(*(*U8)(unsafe.Pointer(pTerm + uintptr(nMatch)))))) {
+ if !(i < *(*U32)(unsafe.Pointer(bp + 4)) && int32(*(*U8)(unsafe.Pointer(a + uintptr(*(*U32)(unsafe.Pointer(bp + 12))+i)))) > int32(*(*U8)(unsafe.Pointer(pTerm + uintptr(nMatch))))) {
goto __15
}
goto search_failed
@@ -180201,25 +182602,25 @@ __6:
__16:
;
- iPgidx = iPgidx + (sqlite3Fts5GetVarint32(tls, (a + uintptr(iPgidx)), bp+8 /* &nKeep */))
+ iPgidx = iPgidx + U32(sqlite3Fts5GetVarint32(tls, a+uintptr(iPgidx), bp+8))
*(*U32)(unsafe.Pointer(bp /* iTermOff */)) += *(*U32)(unsafe.Pointer(bp + 8 /* nKeep */))
- *(*int32)(unsafe.Pointer(bp + 12 /* iOff */)) = int32(*(*U32)(unsafe.Pointer(bp /* iTermOff */)))
+ *(*U32)(unsafe.Pointer(bp + 12 /* iOff */)) = *(*U32)(unsafe.Pointer(bp /* iTermOff */))
- if !(*(*int32)(unsafe.Pointer(bp + 12 /* iOff */)) >= n) {
+ if !(*(*U32)(unsafe.Pointer(bp + 12)) >= n) {
goto __17
}
- (*Fts5Index)(unsafe.Pointer(p)).Frc = (SQLITE_CORRUPT | (int32(1) << 8))
+ (*Fts5Index)(unsafe.Pointer(p)).Frc = SQLITE_CORRUPT | int32(1)<<8
return
__17:
;
/* Read the nKeep field of the next term. */
- *(*U32)(unsafe.Pointer(bp + 8 /* nKeep */)) = U32(*(*U8)(unsafe.Pointer((a) + uintptr(libc.PostIncInt32(&*(*int32)(unsafe.Pointer(bp + 12 /* iOff */)), 1)))))
- if !((*(*U32)(unsafe.Pointer(bp + 8 /* nKeep */)) & U32(0x80)) != 0) {
+ *(*U32)(unsafe.Pointer(bp + 8 /* nKeep */)) = U32(*(*U8)(unsafe.Pointer(a + uintptr(libc.PostIncUint32(&*(*U32)(unsafe.Pointer(bp + 12 /* iOff */)), 1)))))
+ if !(*(*U32)(unsafe.Pointer(bp + 8))&U32(0x80) != 0) {
goto __18
}
- *(*int32)(unsafe.Pointer(bp + 12 /* iOff */))--
- *(*int32)(unsafe.Pointer(bp + 12 /* iOff */)) += sqlite3Fts5GetVarint32(tls, ((a) + uintptr(*(*int32)(unsafe.Pointer(bp + 12 /* iOff */)))), bp+8 /* &nKeep */)
+ *(*U32)(unsafe.Pointer(bp + 12 /* iOff */))--
+ *(*U32)(unsafe.Pointer(bp + 12 /* iOff */)) += U32(sqlite3Fts5GetVarint32(tls, a+uintptr(*(*U32)(unsafe.Pointer(bp + 12))), bp+8 /* &nKeep */))
__18:
;
@@ -180248,22 +182649,22 @@ __22:
__25:
;
a = (*Fts5Data)(unsafe.Pointer((*Fts5SegIter)(unsafe.Pointer(pIter)).FpLeaf)).Fp
- if !((libc.Bool32((*Fts5Data)(unsafe.Pointer(((*Fts5SegIter)(unsafe.Pointer(pIter)).FpLeaf))).FszLeaf >= (*Fts5Data)(unsafe.Pointer(((*Fts5SegIter)(unsafe.Pointer(pIter)).FpLeaf))).Fnn)) == 0) {
+ if !(libc.Bool32((*Fts5Data)(unsafe.Pointer((*Fts5SegIter)(unsafe.Pointer(pIter)).FpLeaf)).FszLeaf >= (*Fts5Data)(unsafe.Pointer((*Fts5SegIter)(unsafe.Pointer(pIter)).FpLeaf)).Fnn) == 0) {
goto __26
}
- iPgidx = (*Fts5Data)(unsafe.Pointer((*Fts5SegIter)(unsafe.Pointer(pIter)).FpLeaf)).FszLeaf
- iPgidx = iPgidx + (sqlite3Fts5GetVarint32(tls, ((*Fts5Data)(unsafe.Pointer((*Fts5SegIter)(unsafe.Pointer(pIter)).FpLeaf)).Fp + uintptr(iPgidx)), bp+12 /* &iOff */))
- if !((*(*int32)(unsafe.Pointer(bp + 12 /* iOff */)) < 4) || (*(*int32)(unsafe.Pointer(bp + 12 /* iOff */)) >= (*Fts5Data)(unsafe.Pointer((*Fts5SegIter)(unsafe.Pointer(pIter)).FpLeaf)).FszLeaf)) {
+ iPgidx = U32((*Fts5Data)(unsafe.Pointer((*Fts5SegIter)(unsafe.Pointer(pIter)).FpLeaf)).FszLeaf)
+ iPgidx = iPgidx + U32(sqlite3Fts5GetVarint32(tls, (*Fts5Data)(unsafe.Pointer((*Fts5SegIter)(unsafe.Pointer(pIter)).FpLeaf)).Fp+uintptr(iPgidx), bp+12))
+ if !(*(*U32)(unsafe.Pointer(bp + 12)) < U32(4) || I64(*(*U32)(unsafe.Pointer(bp + 12))) >= I64((*Fts5Data)(unsafe.Pointer((*Fts5SegIter)(unsafe.Pointer(pIter)).FpLeaf)).FszLeaf)) {
goto __27
}
- (*Fts5Index)(unsafe.Pointer(p)).Frc = (SQLITE_CORRUPT | (int32(1) << 8))
+ (*Fts5Index)(unsafe.Pointer(p)).Frc = SQLITE_CORRUPT | int32(1)<<8
return
goto __28
__27:
*(*U32)(unsafe.Pointer(bp + 8 /* nKeep */)) = U32(0)
- *(*U32)(unsafe.Pointer(bp /* iTermOff */)) = U32(*(*int32)(unsafe.Pointer(bp + 12 /* iOff */)))
- n = (*Fts5Data)(unsafe.Pointer((*Fts5SegIter)(unsafe.Pointer(pIter)).FpLeaf)).Fnn
- *(*int32)(unsafe.Pointer(bp + 12 /* iOff */)) += sqlite3Fts5GetVarint32(tls, (a + uintptr(*(*int32)(unsafe.Pointer(bp + 12 /* iOff */)))), bp+4 /* &nNew */)
+ *(*U32)(unsafe.Pointer(bp /* iTermOff */)) = *(*U32)(unsafe.Pointer(bp + 12 /* iOff */))
+ n = U32((*Fts5Data)(unsafe.Pointer((*Fts5SegIter)(unsafe.Pointer(pIter)).FpLeaf)).Fnn)
+ *(*U32)(unsafe.Pointer(bp + 12 /* iOff */)) += U32(sqlite3Fts5GetVarint32(tls, a+uintptr(*(*U32)(unsafe.Pointer(bp + 12))), bp+4 /* &nNew */))
goto __24
__28:
;
@@ -180283,45 +182684,45 @@ __20:
;
search_success:
- if !(((I64(*(*int32)(unsafe.Pointer(bp + 12 /* iOff */))) + I64(*(*U32)(unsafe.Pointer(bp + 4 /* nNew */)))) > I64(n)) || (*(*U32)(unsafe.Pointer(bp + 4 /* nNew */)) < U32(1))) {
+ if !(I64(*(*U32)(unsafe.Pointer(bp + 12)))+I64(*(*U32)(unsafe.Pointer(bp + 4))) > I64(n) || *(*U32)(unsafe.Pointer(bp + 4)) < U32(1)) {
goto __29
}
- (*Fts5Index)(unsafe.Pointer(p)).Frc = (SQLITE_CORRUPT | (int32(1) << 8))
+ (*Fts5Index)(unsafe.Pointer(p)).Frc = SQLITE_CORRUPT | int32(1)<<8
return
__29:
;
- (*Fts5SegIter)(unsafe.Pointer(pIter)).FiLeafOffset = (I64(U32(*(*int32)(unsafe.Pointer(bp + 12 /* iOff */))) + *(*U32)(unsafe.Pointer(bp + 4 /* nNew */))))
+ (*Fts5SegIter)(unsafe.Pointer(pIter)).FiLeafOffset = I64(*(*U32)(unsafe.Pointer(bp + 12)) + *(*U32)(unsafe.Pointer(bp + 4)))
(*Fts5SegIter)(unsafe.Pointer(pIter)).FiTermLeafOffset = int32((*Fts5SegIter)(unsafe.Pointer(pIter)).FiLeafOffset)
(*Fts5SegIter)(unsafe.Pointer(pIter)).FiTermLeafPgno = (*Fts5SegIter)(unsafe.Pointer(pIter)).FiLeafPgno
- sqlite3Fts5BufferSet(tls, (p + 36 /* &.rc */), (pIter + 68 /* &.term */), int32(*(*U32)(unsafe.Pointer(bp + 8 /* nKeep */))), pTerm)
- sqlite3Fts5BufferAppendBlob(tls, (p + 36 /* &.rc */), (pIter + 68 /* &.term */), *(*U32)(unsafe.Pointer(bp + 4 /* nNew */)), (a + uintptr(*(*int32)(unsafe.Pointer(bp + 12 /* iOff */)))))
+ sqlite3Fts5BufferSet(tls, p+36, pIter+68, int32(*(*U32)(unsafe.Pointer(bp + 8 /* nKeep */))), pTerm)
+ sqlite3Fts5BufferAppendBlob(tls, p+36, pIter+68, *(*U32)(unsafe.Pointer(bp + 4 /* nNew */)), a+uintptr(*(*U32)(unsafe.Pointer(bp + 12))))
if !(iPgidx >= n) {
goto __30
}
- (*Fts5SegIter)(unsafe.Pointer(pIter)).FiEndofDoclist = ((*Fts5Data)(unsafe.Pointer((*Fts5SegIter)(unsafe.Pointer(pIter)).FpLeaf)).Fnn + 1)
+ (*Fts5SegIter)(unsafe.Pointer(pIter)).FiEndofDoclist = (*Fts5Data)(unsafe.Pointer((*Fts5SegIter)(unsafe.Pointer(pIter)).FpLeaf)).Fnn + 1
goto __31
__30:
- iPgidx = iPgidx + (sqlite3Fts5GetVarint32(tls, (a + uintptr(iPgidx)), bp+16 /* &nExtra */))
- (*Fts5SegIter)(unsafe.Pointer(pIter)).FiEndofDoclist = (int32(*(*U32)(unsafe.Pointer(bp /* iTermOff */)) + U32(*(*int32)(unsafe.Pointer(bp + 16 /* nExtra */)))))
+ iPgidx = iPgidx + U32(sqlite3Fts5GetVarint32(tls, a+uintptr(iPgidx), bp+16))
+ (*Fts5SegIter)(unsafe.Pointer(pIter)).FiEndofDoclist = int32(*(*U32)(unsafe.Pointer(bp)) + U32(*(*int32)(unsafe.Pointer(bp + 16))))
__31:
;
- (*Fts5SegIter)(unsafe.Pointer(pIter)).FiPgidxOff = iPgidx
+ (*Fts5SegIter)(unsafe.Pointer(pIter)).FiPgidxOff = int32(iPgidx)
fts5SegIterLoadRowid(tls, p, pIter)
fts5SegIterLoadNPos(tls, p, pIter)
}
-func fts5IdxSelectStmt(tls *libc.TLS, p uintptr) uintptr { /* sqlite3.c:223398:21: */
+func fts5IdxSelectStmt(tls *libc.TLS, p uintptr) uintptr { /* sqlite3.c:225284:21: */
bp := tls.Alloc(16)
defer tls.Free(16)
if (*Fts5Index)(unsafe.Pointer(p)).FpIdxSelect == uintptr(0) {
var pConfig uintptr = (*Fts5Index)(unsafe.Pointer(p)).FpConfig
- fts5IndexPrepareStmt(tls, p, (p + 60 /* &.pIdxSelect */), Xsqlite3_mprintf(tls,
+ fts5IndexPrepareStmt(tls, p, p+60, Xsqlite3_mprintf(tls,
- ts+33194, /* "SELECT pgno FROM..." */
+ ts+34554, /* "SELECT pgno FROM..." */
libc.VaList(bp, (*Fts5Config)(unsafe.Pointer(pConfig)).FzDb, (*Fts5Config)(unsafe.Pointer(pConfig)).FzName)))
}
return (*Fts5Index)(unsafe.Pointer(p)).FpIdxSelect
@@ -180332,9 +182733,9 @@ func fts5IdxSelectStmt(tls *libc.TLS, p uintptr) uintptr { /* sqlite3.c:223398:2
//
// If an error occurs, Fts5Index.rc is set to an appropriate error code. If
// an error has already occurred when this function is called, it is a no-op.
-func fts5SegIterSeekInit(tls *libc.TLS, p uintptr, pTerm uintptr, nTerm int32, flags int32, pSeg uintptr, pIter uintptr) { /* sqlite3.c:223417:13: */
+func fts5SegIterSeekInit(tls *libc.TLS, p uintptr, pTerm uintptr, nTerm int32, flags int32, pSeg uintptr, pIter uintptr) { /* sqlite3.c:225303:13: */
var iPg int32 = 1
- var bGe int32 = (flags & FTS5INDEX_QUERY_SCAN)
+ var bGe int32 = flags & FTS5INDEX_QUERY_SCAN
var bDlidx int32 = 0 // True if there is a doclist-index
var pIdxSelect uintptr = uintptr(0)
@@ -180351,8 +182752,8 @@ func fts5SegIterSeekInit(tls *libc.TLS, p uintptr, pTerm uintptr, nTerm int32, f
Xsqlite3_bind_blob(tls, pIdxSelect, 2, pTerm, nTerm, uintptr(0))
if SQLITE_ROW == Xsqlite3_step(tls, pIdxSelect) {
var val I64 = I64(Xsqlite3_column_int(tls, pIdxSelect, 0))
- iPg = (int32(val >> 1))
- bDlidx = (int32(val & int64(0x0001)))
+ iPg = int32(val >> 1)
+ bDlidx = int32(val & int64(0x0001))
}
(*Fts5Index)(unsafe.Pointer(p)).Frc = Xsqlite3_reset(tls, pIdxSelect)
Xsqlite3_bind_null(tls, pIdxSelect, 2)
@@ -180362,23 +182763,23 @@ func fts5SegIterSeekInit(tls *libc.TLS, p uintptr, pTerm uintptr, nTerm int32, f
bDlidx = 0
}
- (*Fts5SegIter)(unsafe.Pointer(pIter)).FiLeafPgno = (iPg - 1)
+ (*Fts5SegIter)(unsafe.Pointer(pIter)).FiLeafPgno = iPg - 1
fts5SegIterNextPage(tls, p, pIter)
if (*Fts5SegIter)(unsafe.Pointer(pIter)).FpLeaf != 0 {
fts5LeafSeek(tls, p, bGe, pIter, pTerm, nTerm)
}
- if ((*Fts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK) && (bGe == 0) {
- *(*int32)(unsafe.Pointer(pIter + 4 /* &.flags */)) |= (FTS5_SEGITER_ONETERM)
+ if (*Fts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK && bGe == 0 {
+ *(*int32)(unsafe.Pointer(pIter + 4)) |= FTS5_SEGITER_ONETERM
if (*Fts5SegIter)(unsafe.Pointer(pIter)).FpLeaf != 0 {
- if (flags & FTS5INDEX_QUERY_DESC) != 0 {
- *(*int32)(unsafe.Pointer(pIter + 4 /* &.flags */)) |= (FTS5_SEGITER_REVERSE)
+ if flags&FTS5INDEX_QUERY_DESC != 0 {
+ *(*int32)(unsafe.Pointer(pIter + 4)) |= FTS5_SEGITER_REVERSE
}
if bDlidx != 0 {
fts5SegIterLoadDlidx(tls, p, pIter)
}
- if (flags & FTS5INDEX_QUERY_DESC) != 0 {
+ if flags&FTS5INDEX_QUERY_DESC != 0 {
fts5SegIterReverse(tls, p, pIter)
}
}
@@ -180402,7 +182803,7 @@ func fts5SegIterSeekInit(tls *libc.TLS, p uintptr, pTerm uintptr, nTerm int32, f
//
// If an error occurs, Fts5Index.rc is set to an appropriate error code. If
// an error has already occurred when this function is called, it is a no-op.
-func fts5SegIterHashInit(tls *libc.TLS, p uintptr, pTerm uintptr, nTerm int32, flags int32, pIter uintptr) { /* sqlite3.c:223500:13: */
+func fts5SegIterHashInit(tls *libc.TLS, p uintptr, pTerm uintptr, nTerm int32, flags int32, pIter uintptr) { /* sqlite3.c:225386:13: */
bp := tls.Alloc(16)
defer tls.Free(16)
@@ -180411,43 +182812,43 @@ func fts5SegIterHashInit(tls *libc.TLS, p uintptr, pTerm uintptr, nTerm int32, f
var n int32 = 0
*(*uintptr)(unsafe.Pointer(bp + 12 /* pLeaf */)) = uintptr(0)
- if (pTerm == uintptr(0)) || ((flags & FTS5INDEX_QUERY_SCAN) != 0) {
+ if pTerm == uintptr(0) || flags&FTS5INDEX_QUERY_SCAN != 0 {
*(*uintptr)(unsafe.Pointer(bp + 4 /* pList */)) = uintptr(0)
(*Fts5Index)(unsafe.Pointer(p)).Frc = sqlite3Fts5HashScanInit(tls, (*Fts5Index)(unsafe.Pointer(p)).FpHash, pTerm, nTerm)
sqlite3Fts5HashScanEntry(tls, (*Fts5Index)(unsafe.Pointer(p)).FpHash, bp /* &z */, bp+4 /* &pList */, bp+8 /* &nList */)
n = func() int32 {
- if *(*uintptr)(unsafe.Pointer(bp /* z */)) != 0 {
- return int32(libc.Xstrlen(tls, *(*uintptr)(unsafe.Pointer(bp /* z */))))
+ if *(*uintptr)(unsafe.Pointer(bp)) != 0 {
+ return int32(libc.Xstrlen(tls, *(*uintptr)(unsafe.Pointer(bp))))
}
return 0
}()
- if *(*uintptr)(unsafe.Pointer(bp + 4 /* pList */)) != 0 {
+ if *(*uintptr)(unsafe.Pointer(bp + 4)) != 0 {
*(*uintptr)(unsafe.Pointer(bp + 12 /* pLeaf */)) = fts5IdxMalloc(tls, p, int64(unsafe.Sizeof(Fts5Data{})))
- if *(*uintptr)(unsafe.Pointer(bp + 12 /* pLeaf */)) != 0 {
+ if *(*uintptr)(unsafe.Pointer(bp + 12)) != 0 {
(*Fts5Data)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 12 /* pLeaf */)))).Fp = *(*uintptr)(unsafe.Pointer(bp + 4 /* pList */))
}
}
} else {
(*Fts5Index)(unsafe.Pointer(p)).Frc = sqlite3Fts5HashQuery(tls, (*Fts5Index)(unsafe.Pointer(p)).FpHash, int32(unsafe.Sizeof(Fts5Data{})),
pTerm, nTerm, bp+12 /* &pLeaf */, bp+8 /* &nList */)
- if *(*uintptr)(unsafe.Pointer(bp + 12 /* pLeaf */)) != 0 {
- (*Fts5Data)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 12 /* pLeaf */)))).Fp = (*(*uintptr)(unsafe.Pointer(bp + 12 /* pLeaf */)) + 1*12)
+ if *(*uintptr)(unsafe.Pointer(bp + 12)) != 0 {
+ (*Fts5Data)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 12 /* pLeaf */)))).Fp = *(*uintptr)(unsafe.Pointer(bp + 12)) + 1*12
}
*(*uintptr)(unsafe.Pointer(bp /* z */)) = pTerm
n = nTerm
- *(*int32)(unsafe.Pointer(pIter + 4 /* &.flags */)) |= (FTS5_SEGITER_ONETERM)
+ *(*int32)(unsafe.Pointer(pIter + 4)) |= FTS5_SEGITER_ONETERM
}
- if *(*uintptr)(unsafe.Pointer(bp + 12 /* pLeaf */)) != 0 {
- sqlite3Fts5BufferSet(tls, (p + 36 /* &.rc */), (pIter + 68 /* &.term */), n, *(*uintptr)(unsafe.Pointer(bp /* z */)))
- (*Fts5Data)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 12 /* pLeaf */)))).Fnn = libc.AssignPtrInt32(*(*uintptr)(unsafe.Pointer(bp + 12 /* pLeaf */))+8 /* &.szLeaf */, *(*int32)(unsafe.Pointer(bp + 8 /* nList */)))
+ if *(*uintptr)(unsafe.Pointer(bp + 12)) != 0 {
+ sqlite3Fts5BufferSet(tls, p+36, pIter+68, n, *(*uintptr)(unsafe.Pointer(bp /* z */)))
+ (*Fts5Data)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 12 /* pLeaf */)))).Fnn = libc.AssignPtrInt32(*(*uintptr)(unsafe.Pointer(bp + 12))+8, *(*int32)(unsafe.Pointer(bp + 8 /* nList */)))
(*Fts5SegIter)(unsafe.Pointer(pIter)).FpLeaf = *(*uintptr)(unsafe.Pointer(bp + 12 /* pLeaf */))
- (*Fts5SegIter)(unsafe.Pointer(pIter)).FiLeafOffset = I64(sqlite3Fts5GetVarint(tls, (*Fts5Data)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 12 /* pLeaf */)))).Fp, (pIter + 80 /* &.iRowid */)))
+ (*Fts5SegIter)(unsafe.Pointer(pIter)).FiLeafOffset = I64(sqlite3Fts5GetVarint(tls, (*Fts5Data)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 12 /* pLeaf */)))).Fp, pIter+80))
(*Fts5SegIter)(unsafe.Pointer(pIter)).FiEndofDoclist = (*Fts5Data)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 12 /* pLeaf */)))).Fnn
- if (flags & FTS5INDEX_QUERY_DESC) != 0 {
- *(*int32)(unsafe.Pointer(pIter + 4 /* &.flags */)) |= (FTS5_SEGITER_REVERSE)
+ if flags&FTS5INDEX_QUERY_DESC != 0 {
+ *(*int32)(unsafe.Pointer(pIter + 4)) |= FTS5_SEGITER_REVERSE
fts5SegIterReverseInitPage(tls, p, pIter)
} else {
fts5SegIterLoadNPos(tls, p, pIter)
@@ -180458,8 +182859,8 @@ func fts5SegIterHashInit(tls *libc.TLS, p uintptr, pTerm uintptr, nTerm int32, f
}
// Zero the iterator passed as the only argument.
-func fts5SegIterClear(tls *libc.TLS, pIter uintptr) { /* sqlite3.c:223559:13: */
- sqlite3Fts5BufferFree(tls, (pIter + 68 /* &.term */))
+func fts5SegIterClear(tls *libc.TLS, pIter uintptr) { /* sqlite3.c:225445:13: */
+ sqlite3Fts5BufferFree(tls, pIter+68)
fts5DataRelease(tls, (*Fts5SegIter)(unsafe.Pointer(pIter)).FpLeaf)
fts5DataRelease(tls, (*Fts5SegIter)(unsafe.Pointer(pIter)).FpNextLeaf)
fts5DlidxIterFree(tls, (*Fts5SegIter)(unsafe.Pointer(pIter)).FpDlidx)
@@ -180473,23 +182874,23 @@ func fts5SegIterClear(tls *libc.TLS, pIter uintptr) { /* sqlite3.c:223559:13: */
// in the pIter->aSeg[] array that is (a) not at EOF, and (b) pointing
// to a key that is a duplicate of another, higher priority,
// segment-iterator in the pSeg->aSeg[] array.
-func fts5MultiIterDoCompare(tls *libc.TLS, pIter uintptr, iOut int32) int32 { /* sqlite3.c:223663:12: */
+func fts5MultiIterDoCompare(tls *libc.TLS, pIter uintptr, iOut int32) int32 { /* sqlite3.c:225549:12: */
var i1 int32 // Index of left-hand Fts5SegIter
var i2 int32 // Index of right-hand Fts5SegIter
var iRes int32
var p1 uintptr // Left-hand Fts5SegIter
var p2 uintptr // Right-hand Fts5SegIter
- var pRes uintptr = ((*Fts5Iter)(unsafe.Pointer(pIter)).FaFirst + uintptr(iOut)*4)
+ var pRes uintptr = (*Fts5Iter)(unsafe.Pointer(pIter)).FaFirst + uintptr(iOut)*4
- if iOut >= ((*Fts5Iter)(unsafe.Pointer(pIter)).FnSeg / 2) {
- i1 = ((iOut - ((*Fts5Iter)(unsafe.Pointer(pIter)).FnSeg / 2)) * 2)
- i2 = (i1 + 1)
+ if iOut >= (*Fts5Iter)(unsafe.Pointer(pIter)).FnSeg/2 {
+ i1 = (iOut - (*Fts5Iter)(unsafe.Pointer(pIter)).FnSeg/2) * 2
+ i2 = i1 + 1
} else {
- i1 = int32((*Fts5CResult)(unsafe.Pointer((*Fts5Iter)(unsafe.Pointer(pIter)).FaFirst + uintptr((iOut*2))*4)).FiFirst)
- i2 = int32((*Fts5CResult)(unsafe.Pointer((*Fts5Iter)(unsafe.Pointer(pIter)).FaFirst + uintptr(((iOut*2)+1))*4)).FiFirst)
+ i1 = int32((*Fts5CResult)(unsafe.Pointer((*Fts5Iter)(unsafe.Pointer(pIter)).FaFirst + uintptr(iOut*2)*4)).FiFirst)
+ i2 = int32((*Fts5CResult)(unsafe.Pointer((*Fts5Iter)(unsafe.Pointer(pIter)).FaFirst + uintptr(iOut*2+1)*4)).FiFirst)
}
- p1 = ((pIter + 80 /* &.aSeg */) + uintptr(i1)*96)
- p2 = ((pIter + 80 /* &.aSeg */) + uintptr(i2)*96)
+ p1 = pIter + 80 + uintptr(i1)*96
+ p2 = pIter + 80 + uintptr(i2)*96
(*Fts5CResult)(unsafe.Pointer(pRes)).FbTermEq = U8(0)
if (*Fts5SegIter)(unsafe.Pointer(p1)).FpLeaf == uintptr(0) { // If p1 is at EOF
@@ -180497,7 +182898,7 @@ func fts5MultiIterDoCompare(tls *libc.TLS, pIter uintptr, iOut int32) int32 { /*
} else if (*Fts5SegIter)(unsafe.Pointer(p2)).FpLeaf == uintptr(0) { // If p2 is at EOF
iRes = i1
} else {
- var res int32 = fts5BufferCompare(tls, (p1 + 68 /* &.term */), (p2 + 68 /* &.term */))
+ var res int32 = fts5BufferCompare(tls, p1+68, p2+68)
if res == 0 {
(*Fts5CResult)(unsafe.Pointer(pRes)).FbTermEq = U8(1)
@@ -180505,7 +182906,7 @@ func fts5MultiIterDoCompare(tls *libc.TLS, pIter uintptr, iOut int32) int32 { /*
(*Fts5SegIter)(unsafe.Pointer(p1)).FbDel = (*Fts5SegIter)(unsafe.Pointer(p2)).FbDel
return i2
}
- if (libc.Bool32((*Fts5SegIter)(unsafe.Pointer(p1)).FiRowid > (*Fts5SegIter)(unsafe.Pointer(p2)).FiRowid)) == (*Fts5Iter)(unsafe.Pointer(pIter)).FbRev {
+ if libc.Bool32((*Fts5SegIter)(unsafe.Pointer(p1)).FiRowid > (*Fts5SegIter)(unsafe.Pointer(p2)).FiRowid) == (*Fts5Iter)(unsafe.Pointer(pIter)).FbRev {
res = -1
} else {
res = +1
@@ -180525,26 +182926,26 @@ func fts5MultiIterDoCompare(tls *libc.TLS, pIter uintptr, iOut int32) int32 { /*
// Move the seg-iter so that it points to the first rowid on page iLeafPgno.
// It is an error if leaf iLeafPgno does not exist or contains no rowids.
-func fts5SegIterGotoPage(tls *libc.TLS, p uintptr, pIter uintptr, iLeafPgno int32) { /* sqlite3.c:223717:13: */
+func fts5SegIterGotoPage(tls *libc.TLS, p uintptr, pIter uintptr, iLeafPgno int32) { /* sqlite3.c:225603:13: */
if iLeafPgno > (*Fts5StructureSegment)(unsafe.Pointer((*Fts5SegIter)(unsafe.Pointer(pIter)).FpSeg)).FpgnoLast {
- (*Fts5Index)(unsafe.Pointer(p)).Frc = (SQLITE_CORRUPT | (int32(1) << 8))
+ (*Fts5Index)(unsafe.Pointer(p)).Frc = SQLITE_CORRUPT | int32(1)<<8
} else {
fts5DataRelease(tls, (*Fts5SegIter)(unsafe.Pointer(pIter)).FpNextLeaf)
(*Fts5SegIter)(unsafe.Pointer(pIter)).FpNextLeaf = uintptr(0)
- (*Fts5SegIter)(unsafe.Pointer(pIter)).FiLeafPgno = (iLeafPgno - 1)
+ (*Fts5SegIter)(unsafe.Pointer(pIter)).FiLeafPgno = iLeafPgno - 1
fts5SegIterNextPage(tls, p, pIter)
- if (*Fts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK {
+ if (*Fts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK && (*Fts5SegIter)(unsafe.Pointer(pIter)).FpLeaf != uintptr(0) {
var iOff int32
var a uintptr = (*Fts5Data)(unsafe.Pointer((*Fts5SegIter)(unsafe.Pointer(pIter)).FpLeaf)).Fp
var n int32 = (*Fts5Data)(unsafe.Pointer((*Fts5SegIter)(unsafe.Pointer(pIter)).FpLeaf)).FszLeaf
iOff = int32(fts5GetU16(tls, (*Fts5Data)(unsafe.Pointer((*Fts5SegIter)(unsafe.Pointer(pIter)).FpLeaf)).Fp))
- if (iOff < 4) || (iOff >= n) {
- (*Fts5Index)(unsafe.Pointer(p)).Frc = (SQLITE_CORRUPT | (int32(1) << 8))
+ if iOff < 4 || iOff >= n {
+ (*Fts5Index)(unsafe.Pointer(p)).Frc = SQLITE_CORRUPT | int32(1)<<8
} else {
- iOff = iOff + (int32(sqlite3Fts5GetVarint(tls, (a + uintptr(iOff)), (pIter + 80 /* &.iRowid */))))
+ iOff = iOff + int32(sqlite3Fts5GetVarint(tls, a+uintptr(iOff), pIter+80))
(*Fts5SegIter)(unsafe.Pointer(pIter)).FiLeafOffset = I64(iOff)
fts5SegIterLoadNPos(tls, p, pIter)
}
@@ -180555,14 +182956,14 @@ func fts5SegIterGotoPage(tls *libc.TLS, p uintptr, pIter uintptr, iLeafPgno int3
// Advance the iterator passed as the second argument until it is at or
// past rowid iFrom. Regardless of the value of iFrom, the iterator is
// always advanced at least once.
-func fts5SegIterNextFrom(tls *libc.TLS, p uintptr, pIter uintptr, iMatch I64) { /* sqlite3.c:223755:13: */
- var bRev int32 = ((*Fts5SegIter)(unsafe.Pointer(pIter)).Fflags & FTS5_SEGITER_REVERSE)
+func fts5SegIterNextFrom(tls *libc.TLS, p uintptr, pIter uintptr, iMatch I64) { /* sqlite3.c:225641:13: */
+ var bRev int32 = (*Fts5SegIter)(unsafe.Pointer(pIter)).Fflags & FTS5_SEGITER_REVERSE
var pDlidx uintptr = (*Fts5SegIter)(unsafe.Pointer(pIter)).FpDlidx
var iLeafPgno int32 = (*Fts5SegIter)(unsafe.Pointer(pIter)).FiLeafPgno
var bMove int32 = 1
if bRev == 0 {
- for !(fts5DlidxIterEof(tls, p, pDlidx) != 0) && (iMatch > fts5DlidxIterRowid(tls, pDlidx)) {
+ for !(fts5DlidxIterEof(tls, p, pDlidx) != 0) && iMatch > fts5DlidxIterRowid(tls, pDlidx) {
iLeafPgno = fts5DlidxIterPgno(tls, pDlidx)
fts5DlidxIterNext(tls, p, pDlidx)
}
@@ -180573,20 +182974,20 @@ func fts5SegIterNextFrom(tls *libc.TLS, p uintptr, pIter uintptr, iMatch I64) {
}
} else {
- for !(fts5DlidxIterEof(tls, p, pDlidx) != 0) && (iMatch < fts5DlidxIterRowid(tls, pDlidx)) {
+ for !(fts5DlidxIterEof(tls, p, pDlidx) != 0) && iMatch < fts5DlidxIterRowid(tls, pDlidx) {
fts5DlidxIterPrev(tls, p, pDlidx)
}
iLeafPgno = fts5DlidxIterPgno(tls, pDlidx)
if iLeafPgno < (*Fts5SegIter)(unsafe.Pointer(pIter)).FiLeafPgno {
- (*Fts5SegIter)(unsafe.Pointer(pIter)).FiLeafPgno = (iLeafPgno + 1)
+ (*Fts5SegIter)(unsafe.Pointer(pIter)).FiLeafPgno = iLeafPgno + 1
fts5SegIterReverseNewPage(tls, p, pIter)
bMove = 0
}
}
- for ok := true; ok; ok = ((*Fts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK) {
- if (bMove != 0) && ((*Fts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK) {
+ for ok := true; ok; ok = (*Fts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK {
+ if bMove != 0 && (*Fts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK {
(*struct {
f func(*libc.TLS, uintptr, uintptr, uintptr)
})(unsafe.Pointer(&struct{ uintptr }{(*Fts5SegIter)(unsafe.Pointer(pIter)).FxNext})).f(tls, p, pIter, uintptr(0))
@@ -180594,10 +182995,10 @@ func fts5SegIterNextFrom(tls *libc.TLS, p uintptr, pIter uintptr, iMatch I64) {
if (*Fts5SegIter)(unsafe.Pointer(pIter)).FpLeaf == uintptr(0) {
break
}
- if (bRev == 0) && ((*Fts5SegIter)(unsafe.Pointer(pIter)).FiRowid >= iMatch) {
+ if bRev == 0 && (*Fts5SegIter)(unsafe.Pointer(pIter)).FiRowid >= iMatch {
break
}
- if (bRev != 0) && ((*Fts5SegIter)(unsafe.Pointer(pIter)).FiRowid <= iMatch) {
+ if bRev != 0 && (*Fts5SegIter)(unsafe.Pointer(pIter)).FiRowid <= iMatch {
break
}
bMove = 1
@@ -180605,28 +183006,28 @@ func fts5SegIterNextFrom(tls *libc.TLS, p uintptr, pIter uintptr, iMatch I64) {
}
// Free the iterator object passed as the second argument.
-func fts5MultiIterFree(tls *libc.TLS, pIter uintptr) { /* sqlite3.c:223809:13: */
+func fts5MultiIterFree(tls *libc.TLS, pIter uintptr) { /* sqlite3.c:225695:13: */
if pIter != 0 {
var i int32
for i = 0; i < (*Fts5Iter)(unsafe.Pointer(pIter)).FnSeg; i++ {
- fts5SegIterClear(tls, ((pIter + 80 /* &.aSeg */) + uintptr(i)*96))
+ fts5SegIterClear(tls, pIter+80+uintptr(i)*96)
}
- sqlite3Fts5BufferFree(tls, (pIter + 28 /* &.poslist */))
+ sqlite3Fts5BufferFree(tls, pIter+28)
Xsqlite3_free(tls, pIter)
}
}
-func fts5MultiIterAdvanced(tls *libc.TLS, p uintptr, pIter uintptr, iChanged int32, iMinset int32) { /* sqlite3.c:223820:13: */
+func fts5MultiIterAdvanced(tls *libc.TLS, p uintptr, pIter uintptr, iChanged int32, iMinset int32) { /* sqlite3.c:225706:13: */
var i int32
- for i = (((*Fts5Iter)(unsafe.Pointer(pIter)).FnSeg + iChanged) / 2); (i >= iMinset) && ((*Fts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK); i = (i / 2) {
+ for i = ((*Fts5Iter)(unsafe.Pointer(pIter)).FnSeg + iChanged) / 2; i >= iMinset && (*Fts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK; i = i / 2 {
var iEq int32
if libc.AssignInt32(&iEq, fts5MultiIterDoCompare(tls, pIter, i)) != 0 {
- var pSeg uintptr = ((pIter + 80 /* &.aSeg */) + uintptr(iEq)*96)
+ var pSeg uintptr = pIter + 80 + uintptr(iEq)*96
(*struct {
f func(*libc.TLS, uintptr, uintptr, uintptr)
})(unsafe.Pointer(&struct{ uintptr }{(*Fts5SegIter)(unsafe.Pointer(pSeg)).FxNext})).f(tls, p, pSeg, uintptr(0))
- i = ((*Fts5Iter)(unsafe.Pointer(pIter)).FnSeg + iEq)
+ i = (*Fts5Iter)(unsafe.Pointer(pIter)).FnSeg + iEq
}
}
}
@@ -180639,38 +183040,38 @@ func fts5MultiIterAdvanced(tls *libc.TLS, p uintptr, pIter uintptr, iChanged int
// If non-zero is returned, the caller should call fts5MultiIterAdvanced()
// on the iterator instead. That function does the same as this one, except
// that it deals with more complicated cases as well.
-func fts5MultiIterAdvanceRowid(tls *libc.TLS, pIter uintptr, iChanged int32, ppFirst uintptr) int32 { /* sqlite3.c:223848:12: */
- var pNew uintptr = ((pIter + 80 /* &.aSeg */) + uintptr(iChanged)*96)
+func fts5MultiIterAdvanceRowid(tls *libc.TLS, pIter uintptr, iChanged int32, ppFirst uintptr) int32 { /* sqlite3.c:225734:12: */
+ var pNew uintptr = pIter + 80 + uintptr(iChanged)*96
- if ((*Fts5SegIter)(unsafe.Pointer(pNew)).FiRowid == (*Fts5Iter)(unsafe.Pointer(pIter)).FiSwitchRowid) ||
- ((libc.Bool32((*Fts5SegIter)(unsafe.Pointer(pNew)).FiRowid < (*Fts5Iter)(unsafe.Pointer(pIter)).FiSwitchRowid)) == (*Fts5Iter)(unsafe.Pointer(pIter)).FbRev) {
+ if (*Fts5SegIter)(unsafe.Pointer(pNew)).FiRowid == (*Fts5Iter)(unsafe.Pointer(pIter)).FiSwitchRowid ||
+ libc.Bool32((*Fts5SegIter)(unsafe.Pointer(pNew)).FiRowid < (*Fts5Iter)(unsafe.Pointer(pIter)).FiSwitchRowid) == (*Fts5Iter)(unsafe.Pointer(pIter)).FbRev {
var i int32
- var pOther uintptr = ((pIter + 80 /* &.aSeg */) + uintptr((iChanged^0x0001))*96)
+ var pOther uintptr = pIter + 80 + uintptr(iChanged^0x0001)*96
(*Fts5Iter)(unsafe.Pointer(pIter)).FiSwitchRowid = func() int64 {
if (*Fts5Iter)(unsafe.Pointer(pIter)).FbRev != 0 {
- return ((int64(-1)) - (int64(0xffffffff) | (I64((int64(0x7fffffff))) << 32)))
+ return int64(-1) - (int64(0xffffffff) | I64(int64(0x7fffffff))<<32)
}
- return (int64(0xffffffff) | (I64((int64(0x7fffffff))) << 32))
+ return int64(0xffffffff) | I64(int64(0x7fffffff))<<32
}()
- for i = (((*Fts5Iter)(unsafe.Pointer(pIter)).FnSeg + iChanged) / 2); 1 != 0; i = (i / 2) {
- var pRes uintptr = ((*Fts5Iter)(unsafe.Pointer(pIter)).FaFirst + uintptr(i)*4)
+ for i = ((*Fts5Iter)(unsafe.Pointer(pIter)).FnSeg + iChanged) / 2; 1 != 0; i = i / 2 {
+ var pRes uintptr = (*Fts5Iter)(unsafe.Pointer(pIter)).FaFirst + uintptr(i)*4
if (*Fts5CResult)(unsafe.Pointer(pRes)).FbTermEq != 0 {
if (*Fts5SegIter)(unsafe.Pointer(pNew)).FiRowid == (*Fts5SegIter)(unsafe.Pointer(pOther)).FiRowid {
return 1
- } else if (libc.Bool32((*Fts5SegIter)(unsafe.Pointer(pOther)).FiRowid > (*Fts5SegIter)(unsafe.Pointer(pNew)).FiRowid)) == (*Fts5Iter)(unsafe.Pointer(pIter)).FbRev {
+ } else if libc.Bool32((*Fts5SegIter)(unsafe.Pointer(pOther)).FiRowid > (*Fts5SegIter)(unsafe.Pointer(pNew)).FiRowid) == (*Fts5Iter)(unsafe.Pointer(pIter)).FbRev {
(*Fts5Iter)(unsafe.Pointer(pIter)).FiSwitchRowid = (*Fts5SegIter)(unsafe.Pointer(pOther)).FiRowid
pNew = pOther
- } else if (libc.Bool32((*Fts5SegIter)(unsafe.Pointer(pOther)).FiRowid > (*Fts5Iter)(unsafe.Pointer(pIter)).FiSwitchRowid)) == (*Fts5Iter)(unsafe.Pointer(pIter)).FbRev {
+ } else if libc.Bool32((*Fts5SegIter)(unsafe.Pointer(pOther)).FiRowid > (*Fts5Iter)(unsafe.Pointer(pIter)).FiSwitchRowid) == (*Fts5Iter)(unsafe.Pointer(pIter)).FbRev {
(*Fts5Iter)(unsafe.Pointer(pIter)).FiSwitchRowid = (*Fts5SegIter)(unsafe.Pointer(pOther)).FiRowid
}
}
- (*Fts5CResult)(unsafe.Pointer(pRes)).FiFirst = (U16(int32((pNew - (pIter + 80 /* &.aSeg */)) / 96)))
+ (*Fts5CResult)(unsafe.Pointer(pRes)).FiFirst = U16(int32((pNew - (pIter + 80)) / 96))
if i == 1 {
break
}
- pOther = ((pIter + 80 /* &.aSeg */) + uintptr((*Fts5CResult)(unsafe.Pointer((*Fts5Iter)(unsafe.Pointer(pIter)).FaFirst+uintptr((i^0x0001))*4)).FiFirst)*96)
+ pOther = pIter + 80 + uintptr((*Fts5CResult)(unsafe.Pointer((*Fts5Iter)(unsafe.Pointer(pIter)).FaFirst+uintptr(i^0x0001)*4)).FiFirst)*96
}
}
@@ -180679,9 +183080,9 @@ func fts5MultiIterAdvanceRowid(tls *libc.TLS, pIter uintptr, iChanged int32, ppF
}
// Set the pIter->bEof variable based on the state of the sub-iterators.
-func fts5MultiIterSetEof(tls *libc.TLS, pIter uintptr) { /* sqlite3.c:223891:13: */
- var pSeg uintptr = ((pIter + 80 /* &.aSeg */) + uintptr((*Fts5CResult)(unsafe.Pointer((*Fts5Iter)(unsafe.Pointer(pIter)).FaFirst+1*4)).FiFirst)*96)
- (*Fts5Iter)(unsafe.Pointer(pIter)).Fbase.FbEof = (U8(libc.Bool32((*Fts5SegIter)(unsafe.Pointer(pSeg)).FpLeaf == uintptr(0))))
+func fts5MultiIterSetEof(tls *libc.TLS, pIter uintptr) { /* sqlite3.c:225777:13: */
+ var pSeg uintptr = pIter + 80 + uintptr((*Fts5CResult)(unsafe.Pointer((*Fts5Iter)(unsafe.Pointer(pIter)).FaFirst+1*4)).FiFirst)*96
+ (*Fts5Iter)(unsafe.Pointer(pIter)).Fbase.FbEof = U8(libc.Bool32((*Fts5SegIter)(unsafe.Pointer(pSeg)).FpLeaf == uintptr(0)))
(*Fts5Iter)(unsafe.Pointer(pIter)).FiSwitchRowid = (*Fts5SegIter)(unsafe.Pointer(pSeg)).FiRowid
}
@@ -180690,7 +183091,7 @@ func fts5MultiIterSetEof(tls *libc.TLS, pIter uintptr) { /* sqlite3.c:223891:13:
// If an error occurs, an error code is left in Fts5Index.rc. It is not
// considered an error if the iterator reaches EOF, or if it is already at
// EOF when this function is called.
-func fts5MultiIterNext(tls *libc.TLS, p uintptr, pIter uintptr, bFrom int32, iFrom I64) { /* sqlite3.c:223904:13: */
+func fts5MultiIterNext(tls *libc.TLS, p uintptr, pIter uintptr, bFrom int32, iFrom I64) { /* sqlite3.c:225790:13: */
bp := tls.Alloc(8)
defer tls.Free(8)
@@ -180699,9 +183100,9 @@ func fts5MultiIterNext(tls *libc.TLS, p uintptr, pIter uintptr, bFrom int32, iFr
for (*Fts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK {
var iFirst int32 = int32((*Fts5CResult)(unsafe.Pointer((*Fts5Iter)(unsafe.Pointer(pIter)).FaFirst + 1*4)).FiFirst)
*(*int32)(unsafe.Pointer(bp /* bNewTerm */)) = 0
- *(*uintptr)(unsafe.Pointer(bp + 4 /* pSeg */)) = ((pIter + 80 /* &.aSeg */) + uintptr(iFirst)*96)
+ *(*uintptr)(unsafe.Pointer(bp + 4 /* pSeg */)) = pIter + 80 + uintptr(iFirst)*96
- if (bUseFrom != 0) && ((*Fts5SegIter)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 4 /* pSeg */)))).FpDlidx != 0) {
+ if bUseFrom != 0 && (*Fts5SegIter)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 4)))).FpDlidx != 0 {
fts5SegIterNextFrom(tls, p, *(*uintptr)(unsafe.Pointer(bp + 4 /* pSeg */)), iFrom)
} else {
(*struct {
@@ -180709,17 +183110,17 @@ func fts5MultiIterNext(tls *libc.TLS, p uintptr, pIter uintptr, bFrom int32, iFr
})(unsafe.Pointer(&struct{ uintptr }{(*Fts5SegIter)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 4 /* pSeg */)))).FxNext})).f(tls, p, *(*uintptr)(unsafe.Pointer(bp + 4 /* pSeg */)), bp /* &bNewTerm */)
}
- if (((*Fts5SegIter)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 4 /* pSeg */)))).FpLeaf == uintptr(0)) || (*(*int32)(unsafe.Pointer(bp /* bNewTerm */)) != 0)) ||
- (fts5MultiIterAdvanceRowid(tls, pIter, iFirst, bp+4 /* &pSeg */) != 0) {
+ if (*Fts5SegIter)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 4)))).FpLeaf == uintptr(0) || *(*int32)(unsafe.Pointer(bp)) != 0 ||
+ fts5MultiIterAdvanceRowid(tls, pIter, iFirst, bp+4) != 0 {
fts5MultiIterAdvanced(tls, p, pIter, iFirst, 1)
fts5MultiIterSetEof(tls, pIter)
- *(*uintptr)(unsafe.Pointer(bp + 4 /* pSeg */)) = ((pIter + 80 /* &.aSeg */) + uintptr((*Fts5CResult)(unsafe.Pointer((*Fts5Iter)(unsafe.Pointer(pIter)).FaFirst+1*4)).FiFirst)*96)
- if (*Fts5SegIter)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 4 /* pSeg */)))).FpLeaf == uintptr(0) {
+ *(*uintptr)(unsafe.Pointer(bp + 4 /* pSeg */)) = pIter + 80 + uintptr((*Fts5CResult)(unsafe.Pointer((*Fts5Iter)(unsafe.Pointer(pIter)).FaFirst+1*4)).FiFirst)*96
+ if (*Fts5SegIter)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 4)))).FpLeaf == uintptr(0) {
return
}
}
- if (int32((*Fts5Iter)(unsafe.Pointer(pIter)).FbSkipEmpty) == 0) || ((*Fts5SegIter)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 4 /* pSeg */)))).FnPos != 0) {
+ if int32((*Fts5Iter)(unsafe.Pointer(pIter)).FbSkipEmpty) == 0 || (*Fts5SegIter)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 4)))).FnPos != 0 {
(*struct {
f func(*libc.TLS, uintptr, uintptr)
})(unsafe.Pointer(&struct{ uintptr }{(*Fts5Iter)(unsafe.Pointer(pIter)).FxSetOutputs})).f(tls, pIter, *(*uintptr)(unsafe.Pointer(bp + 4 /* pSeg */)))
@@ -180729,7 +183130,7 @@ func fts5MultiIterNext(tls *libc.TLS, p uintptr, pIter uintptr, bFrom int32, iFr
}
}
-func fts5MultiIterNext2(tls *libc.TLS, p uintptr, pIter uintptr, pbNewTerm uintptr) { /* sqlite3.c:223942:13: */
+func fts5MultiIterNext2(tls *libc.TLS, p uintptr, pIter uintptr, pbNewTerm uintptr) { /* sqlite3.c:225828:13: */
bp := tls.Alloc(8)
defer tls.Free(8)
@@ -180737,14 +183138,14 @@ func fts5MultiIterNext2(tls *libc.TLS, p uintptr, pIter uintptr, pbNewTerm uintp
*(*int32)(unsafe.Pointer(pbNewTerm)) = 0
for ok := true; ok; ok = fts5MultiIterIsEmpty(tls, p, pIter) != 0 {
var iFirst int32 = int32((*Fts5CResult)(unsafe.Pointer((*Fts5Iter)(unsafe.Pointer(pIter)).FaFirst + 1*4)).FiFirst)
- *(*uintptr)(unsafe.Pointer(bp + 4 /* pSeg */)) = ((pIter + 80 /* &.aSeg */) + uintptr(iFirst)*96)
+ *(*uintptr)(unsafe.Pointer(bp + 4 /* pSeg */)) = pIter + 80 + uintptr(iFirst)*96
*(*int32)(unsafe.Pointer(bp /* bNewTerm */)) = 0
(*struct {
f func(*libc.TLS, uintptr, uintptr, uintptr)
})(unsafe.Pointer(&struct{ uintptr }{(*Fts5SegIter)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 4 /* pSeg */)))).FxNext})).f(tls, p, *(*uintptr)(unsafe.Pointer(bp + 4 /* pSeg */)), bp /* &bNewTerm */)
- if (((*Fts5SegIter)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 4 /* pSeg */)))).FpLeaf == uintptr(0)) || (*(*int32)(unsafe.Pointer(bp /* bNewTerm */)) != 0)) ||
- (fts5MultiIterAdvanceRowid(tls, pIter, iFirst, bp+4 /* &pSeg */) != 0) {
+ if (*Fts5SegIter)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 4)))).FpLeaf == uintptr(0) || *(*int32)(unsafe.Pointer(bp)) != 0 ||
+ fts5MultiIterAdvanceRowid(tls, pIter, iFirst, bp+4) != 0 {
fts5MultiIterAdvanced(tls, p, pIter, iFirst, 1)
fts5MultiIterSetEof(tls, pIter)
*(*int32)(unsafe.Pointer(pbNewTerm)) = 1
@@ -180754,22 +183155,22 @@ func fts5MultiIterNext2(tls *libc.TLS, p uintptr, pIter uintptr, pbNewTerm uintp
}
}
-func fts5IterSetOutputs_Noop(tls *libc.TLS, pUnused1 uintptr, pUnused2 uintptr) { /* sqlite3.c:223970:13: */
+func fts5IterSetOutputs_Noop(tls *libc.TLS, pUnused1 uintptr, pUnused2 uintptr) { /* sqlite3.c:225856:13: */
_ = pUnused1
_ = pUnused2
}
-func fts5MultiIterAlloc(tls *libc.TLS, p uintptr, nSeg int32) uintptr { /* sqlite3.c:223974:17: */
+func fts5MultiIterAlloc(tls *libc.TLS, p uintptr, nSeg int32) uintptr { /* sqlite3.c:225860:17: */
var pNew uintptr
var nSlot int32 // Power of two >= nSeg
- for nSlot = 2; nSlot < nSeg; nSlot = (nSlot * 2) {
+ for nSlot = 2; nSlot < nSeg; nSlot = nSlot * 2 {
}
pNew = fts5IdxMalloc(tls, p,
- (int64((uint32(unsafe.Sizeof(Fts5Iter{})) + (uint32(unsafe.Sizeof(Fts5SegIter{})) * (uint32(nSlot - 1)))) + (uint32(unsafe.Sizeof(Fts5CResult{})) * uint32(nSlot)))))
+ int64(uint32(unsafe.Sizeof(Fts5Iter{}))+uint32(unsafe.Sizeof(Fts5SegIter{}))*uint32(nSlot-1)+uint32(unsafe.Sizeof(Fts5CResult{}))*uint32(nSlot)))
if pNew != 0 {
(*Fts5Iter)(unsafe.Pointer(pNew)).FnSeg = nSlot
- (*Fts5Iter)(unsafe.Pointer(pNew)).FaFirst = ((pNew + 80 /* &.aSeg */) + uintptr(nSlot)*96)
+ (*Fts5Iter)(unsafe.Pointer(pNew)).FaFirst = pNew + 80 + uintptr(nSlot)*96
(*Fts5Iter)(unsafe.Pointer(pNew)).FpIndex = p
(*Fts5Iter)(unsafe.Pointer(pNew)).FxSetOutputs = *(*uintptr)(unsafe.Pointer(&struct {
f func(*libc.TLS, uintptr, uintptr)
@@ -180778,13 +183179,13 @@ func fts5MultiIterAlloc(tls *libc.TLS, p uintptr, nSeg int32) uintptr { /* sqlit
return pNew
}
-func fts5PoslistCallback(tls *libc.TLS, pUnused uintptr, pContext uintptr, pChunk uintptr, nChunk int32) { /* sqlite3.c:223996:13: */
+func fts5PoslistCallback(tls *libc.TLS, pUnused uintptr, pContext uintptr, pChunk uintptr, nChunk int32) { /* sqlite3.c:225882:13: */
_ = pUnused
if nChunk > 0 {
{
- libc.Xmemcpy(tls, ((*Fts5Buffer)(unsafe.Pointer((pContext))).Fp + uintptr((*Fts5Buffer)(unsafe.Pointer((pContext))).Fn)), pChunk, uint32(nChunk))
- *(*int32)(unsafe.Pointer(pContext + 4 /* &.n */)) += (nChunk)
+ libc.Xmemcpy(tls, (*Fts5Buffer)(unsafe.Pointer(pContext)).Fp+uintptr((*Fts5Buffer)(unsafe.Pointer(pContext)).Fn), pChunk, uint32(nChunk))
+ *(*int32)(unsafe.Pointer(pContext + 4)) += nChunk
}
}
@@ -180794,31 +183195,31 @@ type PoslistCallbackCtx1 = struct {
FpBuf uintptr
FpColset uintptr
FeState int32
-} /* sqlite3.c:224008:9 */
+} /* sqlite3.c:225894:9 */
-type PoslistCallbackCtx = PoslistCallbackCtx1 /* sqlite3.c:224008:35 */
+type PoslistCallbackCtx = PoslistCallbackCtx1 /* sqlite3.c:225894:35 */
type PoslistOffsetsCtx1 = struct {
FpBuf uintptr
FpColset uintptr
FiRead int32
FiWrite int32
-} /* sqlite3.c:224015:9 */
+} /* sqlite3.c:225901:9 */
-type PoslistOffsetsCtx = PoslistOffsetsCtx1 /* sqlite3.c:224015:34 */
+type PoslistOffsetsCtx = PoslistOffsetsCtx1 /* sqlite3.c:225901:34 */
// TODO: Make this more efficient!
-func fts5IndexColsetTest(tls *libc.TLS, pColset uintptr, iCol int32) int32 { /* sqlite3.c:224026:12: */
+func fts5IndexColsetTest(tls *libc.TLS, pColset uintptr, iCol int32) int32 { /* sqlite3.c:225912:12: */
var i int32
for i = 0; i < (*Fts5Colset)(unsafe.Pointer(pColset)).FnCol; i++ {
- if *(*int32)(unsafe.Pointer((pColset + 4 /* &.aiCol */) + uintptr(i)*4)) == iCol {
+ if *(*int32)(unsafe.Pointer(pColset + 4 + uintptr(i)*4)) == iCol {
return 1
}
}
return 0
}
-func fts5PoslistOffsetsCallback(tls *libc.TLS, pUnused uintptr, pContext uintptr, pChunk uintptr, nChunk int32) { /* sqlite3.c:224034:13: */
+func fts5PoslistOffsetsCallback(tls *libc.TLS, pUnused uintptr, pContext uintptr, pChunk uintptr, nChunk int32) { /* sqlite3.c:225920:13: */
bp := tls.Alloc(4)
defer tls.Free(4)
@@ -180830,12 +183231,12 @@ func fts5PoslistOffsetsCallback(tls *libc.TLS, pUnused uintptr, pContext uintptr
for i < nChunk {
// var iVal int32 at bp, 4
- i = i + (sqlite3Fts5GetVarint32(tls, (pChunk + uintptr(i)), bp /* &iVal */))
- *(*int32)(unsafe.Pointer(bp /* iVal */)) += ((*PoslistOffsetsCtx)(unsafe.Pointer(pCtx)).FiRead - 2)
+ i = i + sqlite3Fts5GetVarint32(tls, pChunk+uintptr(i), bp)
+ *(*int32)(unsafe.Pointer(bp /* iVal */)) += (*PoslistOffsetsCtx)(unsafe.Pointer(pCtx)).FiRead - 2
(*PoslistOffsetsCtx)(unsafe.Pointer(pCtx)).FiRead = *(*int32)(unsafe.Pointer(bp /* iVal */))
- if fts5IndexColsetTest(tls, (*PoslistOffsetsCtx)(unsafe.Pointer(pCtx)).FpColset, *(*int32)(unsafe.Pointer(bp /* iVal */))) != 0 {
+ if fts5IndexColsetTest(tls, (*PoslistOffsetsCtx)(unsafe.Pointer(pCtx)).FpColset, *(*int32)(unsafe.Pointer(bp))) != 0 {
{
- *(*int32)(unsafe.Pointer((*PoslistOffsetsCtx)(unsafe.Pointer(pCtx)).FpBuf + 4 /* &.n */)) += (sqlite3Fts5PutVarint(tls, ((*Fts5Buffer)(unsafe.Pointer(((*PoslistOffsetsCtx)(unsafe.Pointer(pCtx)).FpBuf))).Fp + uintptr((*Fts5Buffer)(unsafe.Pointer(((*PoslistOffsetsCtx)(unsafe.Pointer(pCtx)).FpBuf))).Fn)), (uint64((*(*int32)(unsafe.Pointer(bp /* iVal */)) + 2) - (*PoslistOffsetsCtx)(unsafe.Pointer(pCtx)).FiWrite))))
+ *(*int32)(unsafe.Pointer((*PoslistOffsetsCtx)(unsafe.Pointer(pCtx)).FpBuf + 4)) += sqlite3Fts5PutVarint(tls, (*Fts5Buffer)(unsafe.Pointer((*PoslistOffsetsCtx)(unsafe.Pointer(pCtx)).FpBuf)).Fp+uintptr((*Fts5Buffer)(unsafe.Pointer((*PoslistOffsetsCtx)(unsafe.Pointer(pCtx)).FpBuf)).Fn), uint64(*(*int32)(unsafe.Pointer(bp))+2-(*PoslistOffsetsCtx)(unsafe.Pointer(pCtx)).FiWrite))
}
(*PoslistOffsetsCtx)(unsafe.Pointer(pCtx)).FiWrite = *(*int32)(unsafe.Pointer(bp /* iVal */))
@@ -180844,7 +183245,7 @@ func fts5PoslistOffsetsCallback(tls *libc.TLS, pUnused uintptr, pContext uintptr
}
}
-func fts5PoslistFilterCallback(tls *libc.TLS, pUnused uintptr, pContext uintptr, pChunk uintptr, nChunk int32) { /* sqlite3.c:224057:13: */
+func fts5PoslistFilterCallback(tls *libc.TLS, pUnused uintptr, pContext uintptr, pChunk uintptr, nChunk int32) { /* sqlite3.c:225943:13: */
bp := tls.Alloc(8)
defer tls.Free(8)
@@ -180861,17 +183262,17 @@ func fts5PoslistFilterCallback(tls *libc.TLS, pUnused uintptr, pContext uintptr,
// var iCol int32 at bp, 4
{
- *(*int32)(unsafe.Pointer(bp /* iCol */)) = int32(*(*U8)(unsafe.Pointer((pChunk) + uintptr(libc.PostIncInt32(&i, 1)))))
- if (*(*int32)(unsafe.Pointer(bp /* iCol */)) & 0x80) != 0 {
+ *(*int32)(unsafe.Pointer(bp /* iCol */)) = int32(*(*U8)(unsafe.Pointer(pChunk + uintptr(libc.PostIncInt32(&i, 1)))))
+ if *(*int32)(unsafe.Pointer(bp))&0x80 != 0 {
i--
- i = i + (sqlite3Fts5GetVarint32(tls, ((pChunk) + uintptr(i)), bp /* &iCol */))
+ i = i + sqlite3Fts5GetVarint32(tls, pChunk+uintptr(i), bp)
}
}
- if fts5IndexColsetTest(tls, (*PoslistCallbackCtx)(unsafe.Pointer(pCtx)).FpColset, *(*int32)(unsafe.Pointer(bp /* iCol */))) != 0 {
+ if fts5IndexColsetTest(tls, (*PoslistCallbackCtx)(unsafe.Pointer(pCtx)).FpColset, *(*int32)(unsafe.Pointer(bp))) != 0 {
(*PoslistCallbackCtx)(unsafe.Pointer(pCtx)).FeState = 1
{
- *(*int32)(unsafe.Pointer((*PoslistCallbackCtx)(unsafe.Pointer(pCtx)).FpBuf + 4 /* &.n */)) += (sqlite3Fts5PutVarint(tls, ((*Fts5Buffer)(unsafe.Pointer(((*PoslistCallbackCtx)(unsafe.Pointer(pCtx)).FpBuf))).Fp + uintptr((*Fts5Buffer)(unsafe.Pointer(((*PoslistCallbackCtx)(unsafe.Pointer(pCtx)).FpBuf))).Fn)), uint64(1)))
+ *(*int32)(unsafe.Pointer((*PoslistCallbackCtx)(unsafe.Pointer(pCtx)).FpBuf + 4)) += sqlite3Fts5PutVarint(tls, (*Fts5Buffer)(unsafe.Pointer((*PoslistCallbackCtx)(unsafe.Pointer(pCtx)).FpBuf)).Fp+uintptr((*Fts5Buffer)(unsafe.Pointer((*PoslistCallbackCtx)(unsafe.Pointer(pCtx)).FpBuf)).Fn), uint64(1))
}
} else {
@@ -180879,17 +183280,17 @@ func fts5PoslistFilterCallback(tls *libc.TLS, pUnused uintptr, pContext uintptr,
}
}
- for ok := true; ok; ok = (i < nChunk) {
- for (i < nChunk) && (int32(*(*U8)(unsafe.Pointer(pChunk + uintptr(i)))) != 0x01) {
- for (int32(*(*U8)(unsafe.Pointer(pChunk + uintptr(i)))) & 0x80) != 0 {
+ for ok := true; ok; ok = i < nChunk {
+ for i < nChunk && int32(*(*U8)(unsafe.Pointer(pChunk + uintptr(i)))) != 0x01 {
+ for int32(*(*U8)(unsafe.Pointer(pChunk + uintptr(i))))&0x80 != 0 {
i++
}
i++
}
if (*PoslistCallbackCtx)(unsafe.Pointer(pCtx)).FeState != 0 {
{
- libc.Xmemcpy(tls, ((*Fts5Buffer)(unsafe.Pointer(((*PoslistCallbackCtx)(unsafe.Pointer(pCtx)).FpBuf))).Fp + uintptr((*Fts5Buffer)(unsafe.Pointer(((*PoslistCallbackCtx)(unsafe.Pointer(pCtx)).FpBuf))).Fn)), (pChunk + uintptr(iStart)), (uint32(i - iStart)))
- *(*int32)(unsafe.Pointer((*PoslistCallbackCtx)(unsafe.Pointer(pCtx)).FpBuf + 4 /* &.n */)) += (i - iStart)
+ libc.Xmemcpy(tls, (*Fts5Buffer)(unsafe.Pointer((*PoslistCallbackCtx)(unsafe.Pointer(pCtx)).FpBuf)).Fp+uintptr((*Fts5Buffer)(unsafe.Pointer((*PoslistCallbackCtx)(unsafe.Pointer(pCtx)).FpBuf)).Fn), pChunk+uintptr(iStart), uint32(i-iStart))
+ *(*int32)(unsafe.Pointer((*PoslistCallbackCtx)(unsafe.Pointer(pCtx)).FpBuf + 4)) += i - iStart
}
}
@@ -180902,18 +183303,18 @@ func fts5PoslistFilterCallback(tls *libc.TLS, pUnused uintptr, pContext uintptr,
(*PoslistCallbackCtx)(unsafe.Pointer(pCtx)).FeState = 2
} else {
{
- *(*int32)(unsafe.Pointer(bp + 4 /* iCol */)) = int32(*(*U8)(unsafe.Pointer((pChunk) + uintptr(libc.PostIncInt32(&i, 1)))))
- if (*(*int32)(unsafe.Pointer(bp + 4 /* iCol */)) & 0x80) != 0 {
+ *(*int32)(unsafe.Pointer(bp + 4 /* iCol */)) = int32(*(*U8)(unsafe.Pointer(pChunk + uintptr(libc.PostIncInt32(&i, 1)))))
+ if *(*int32)(unsafe.Pointer(bp + 4))&0x80 != 0 {
i--
- i = i + (sqlite3Fts5GetVarint32(tls, ((pChunk) + uintptr(i)), bp+4 /* &iCol */))
+ i = i + sqlite3Fts5GetVarint32(tls, pChunk+uintptr(i), bp+4)
}
}
(*PoslistCallbackCtx)(unsafe.Pointer(pCtx)).FeState = fts5IndexColsetTest(tls, (*PoslistCallbackCtx)(unsafe.Pointer(pCtx)).FpColset, *(*int32)(unsafe.Pointer(bp + 4 /* iCol */)))
if (*PoslistCallbackCtx)(unsafe.Pointer(pCtx)).FeState != 0 {
{
- libc.Xmemcpy(tls, ((*Fts5Buffer)(unsafe.Pointer(((*PoslistCallbackCtx)(unsafe.Pointer(pCtx)).FpBuf))).Fp + uintptr((*Fts5Buffer)(unsafe.Pointer(((*PoslistCallbackCtx)(unsafe.Pointer(pCtx)).FpBuf))).Fn)), (pChunk + uintptr(iStart)), (uint32(i - iStart)))
- *(*int32)(unsafe.Pointer((*PoslistCallbackCtx)(unsafe.Pointer(pCtx)).FpBuf + 4 /* &.n */)) += (i - iStart)
+ libc.Xmemcpy(tls, (*Fts5Buffer)(unsafe.Pointer((*PoslistCallbackCtx)(unsafe.Pointer(pCtx)).FpBuf)).Fp+uintptr((*Fts5Buffer)(unsafe.Pointer((*PoslistCallbackCtx)(unsafe.Pointer(pCtx)).FpBuf)).Fn), pChunk+uintptr(iStart), uint32(i-iStart))
+ *(*int32)(unsafe.Pointer((*PoslistCallbackCtx)(unsafe.Pointer(pCtx)).FpBuf + 4)) += i - iStart
}
iStart = i
@@ -180924,48 +183325,48 @@ func fts5PoslistFilterCallback(tls *libc.TLS, pUnused uintptr, pContext uintptr,
}
}
-func fts5ChunkIterate(tls *libc.TLS, p uintptr, pSeg uintptr, pCtx uintptr, xChunk uintptr) { /* sqlite3.c:224109:13: */
+func fts5ChunkIterate(tls *libc.TLS, p uintptr, pSeg uintptr, pCtx uintptr, xChunk uintptr) { /* sqlite3.c:225995:13: */
var nRem int32 = (*Fts5SegIter)(unsafe.Pointer(pSeg)).FnPos // Number of bytes still to come
var pData uintptr = uintptr(0)
- var pChunk uintptr = ((*Fts5Data)(unsafe.Pointer((*Fts5SegIter)(unsafe.Pointer(pSeg)).FpLeaf)).Fp + uintptr((*Fts5SegIter)(unsafe.Pointer(pSeg)).FiLeafOffset))
+ var pChunk uintptr = (*Fts5Data)(unsafe.Pointer((*Fts5SegIter)(unsafe.Pointer(pSeg)).FpLeaf)).Fp + uintptr((*Fts5SegIter)(unsafe.Pointer(pSeg)).FiLeafOffset)
var nChunk int32 = func() int32 {
- if (I64(nRem)) < (I64((*Fts5Data)(unsafe.Pointer((*Fts5SegIter)(unsafe.Pointer(pSeg)).FpLeaf)).FszLeaf) - (*Fts5SegIter)(unsafe.Pointer(pSeg)).FiLeafOffset) {
+ if I64(nRem) < I64((*Fts5Data)(unsafe.Pointer((*Fts5SegIter)(unsafe.Pointer(pSeg)).FpLeaf)).FszLeaf)-(*Fts5SegIter)(unsafe.Pointer(pSeg)).FiLeafOffset {
return nRem
}
- return (int32(I64((*Fts5Data)(unsafe.Pointer((*Fts5SegIter)(unsafe.Pointer(pSeg)).FpLeaf)).FszLeaf) - (*Fts5SegIter)(unsafe.Pointer(pSeg)).FiLeafOffset))
+ return int32(I64((*Fts5Data)(unsafe.Pointer((*Fts5SegIter)(unsafe.Pointer(pSeg)).FpLeaf)).FszLeaf) - (*Fts5SegIter)(unsafe.Pointer(pSeg)).FiLeafOffset)
}()
var pgno int32 = (*Fts5SegIter)(unsafe.Pointer(pSeg)).FiLeafPgno
var pgnoSave int32 = 0
// This function does not work with detail=none databases.
- if ((*Fts5SegIter)(unsafe.Pointer(pSeg)).Fflags & FTS5_SEGITER_REVERSE) == 0 {
- pgnoSave = (pgno + 1)
+ if (*Fts5SegIter)(unsafe.Pointer(pSeg)).Fflags&FTS5_SEGITER_REVERSE == 0 {
+ pgnoSave = pgno + 1
}
for 1 != 0 {
(*struct {
f func(*libc.TLS, uintptr, uintptr, uintptr, int32)
})(unsafe.Pointer(&struct{ uintptr }{xChunk})).f(tls, p, pCtx, pChunk, nChunk)
- nRem = nRem - (nChunk)
+ nRem = nRem - nChunk
fts5DataRelease(tls, pData)
if nRem <= 0 {
break
} else if (*Fts5SegIter)(unsafe.Pointer(pSeg)).FpSeg == uintptr(0) {
- (*Fts5Index)(unsafe.Pointer(p)).Frc = (SQLITE_CORRUPT | (int32(1) << 8))
+ (*Fts5Index)(unsafe.Pointer(p)).Frc = SQLITE_CORRUPT | int32(1)<<8
return
} else {
pgno++
- pData = fts5LeafRead(tls, p, (((((I64((*Fts5StructureSegment)(unsafe.Pointer((*Fts5SegIter)(unsafe.Pointer(pSeg)).FpSeg)).FiSegid)) << ((FTS5_DATA_PAGE_B + FTS5_DATA_HEIGHT_B) + FTS5_DATA_DLI_B)) + (I64((int64(0))) << (FTS5_DATA_PAGE_B + FTS5_DATA_HEIGHT_B))) + (I64((int64(0))) << (FTS5_DATA_PAGE_B))) + (I64(pgno))))
+ pData = fts5LeafRead(tls, p, I64((*Fts5StructureSegment)(unsafe.Pointer((*Fts5SegIter)(unsafe.Pointer(pSeg)).FpSeg)).FiSegid)<<(FTS5_DATA_PAGE_B+FTS5_DATA_HEIGHT_B+FTS5_DATA_DLI_B)+I64(int64(0))<<(FTS5_DATA_PAGE_B+FTS5_DATA_HEIGHT_B)+I64(int64(0))<<FTS5_DATA_PAGE_B+I64(pgno))
if pData == uintptr(0) {
break
}
- pChunk = ((*Fts5Data)(unsafe.Pointer(pData)).Fp + 4)
+ pChunk = (*Fts5Data)(unsafe.Pointer(pData)).Fp + 4
nChunk = func() int32 {
- if (nRem) < ((*Fts5Data)(unsafe.Pointer(pData)).FszLeaf - 4) {
+ if nRem < (*Fts5Data)(unsafe.Pointer(pData)).FszLeaf-4 {
return nRem
}
- return ((*Fts5Data)(unsafe.Pointer(pData)).FszLeaf - 4)
+ return (*Fts5Data)(unsafe.Pointer(pData)).FszLeaf - 4
}()
if pgno == pgnoSave {
@@ -180980,17 +183381,18 @@ func fts5ChunkIterate(tls *libc.TLS, p uintptr, pSeg uintptr, pCtx uintptr, xChu
// function appends the position list data for the current entry to
// buffer pBuf. It does not make a copy of the position-list size
// field.
-func fts5SegiterPoslist(tls *libc.TLS, p uintptr, pSeg uintptr, pColset uintptr, pBuf uintptr) { /* sqlite3.c:224159:13: */
+func fts5SegiterPoslist(tls *libc.TLS, p uintptr, pSeg uintptr, pColset uintptr, pBuf uintptr) { /* sqlite3.c:226045:13: */
bp := tls.Alloc(28)
defer tls.Free(28)
- if 0 == (func() int32 {
- if ((U32((*Fts5Buffer)(unsafe.Pointer(pBuf)).Fn)) + (U32((*Fts5SegIter)(unsafe.Pointer(pSeg)).FnPos + FTS5_DATA_ZERO_PADDING))) <= (U32((*Fts5Buffer)(unsafe.Pointer(pBuf)).FnSpace)) {
+ if 0 == func() int32 {
+ if U32((*Fts5Buffer)(unsafe.Pointer(pBuf)).Fn)+U32((*Fts5SegIter)(unsafe.Pointer(pSeg)).FnPos+FTS5_DATA_ZERO_PADDING) <= U32((*Fts5Buffer)(unsafe.Pointer(pBuf)).FnSpace) {
return 0
}
- return sqlite3Fts5BufferSize(tls, (p + 36 /* &.rc */), pBuf, (uint32(((*Fts5SegIter)(unsafe.Pointer(pSeg)).FnPos + FTS5_DATA_ZERO_PADDING) + (*Fts5Buffer)(unsafe.Pointer((pBuf))).Fn)))
- }()) {
- libc.Xmemset(tls, ((*Fts5Buffer)(unsafe.Pointer(pBuf)).Fp + uintptr(((*Fts5Buffer)(unsafe.Pointer(pBuf)).Fn + (*Fts5SegIter)(unsafe.Pointer(pSeg)).FnPos))), 0, uint32(FTS5_DATA_ZERO_PADDING))
+ return sqlite3Fts5BufferSize(tls, p+36, pBuf, uint32((*Fts5SegIter)(unsafe.Pointer(pSeg)).FnPos+FTS5_DATA_ZERO_PADDING+(*Fts5Buffer)(unsafe.Pointer(pBuf)).Fn))
+ }() {
+
+ libc.Xmemset(tls, (*Fts5Buffer)(unsafe.Pointer(pBuf)).Fp+uintptr((*Fts5Buffer)(unsafe.Pointer(pBuf)).Fn+(*Fts5SegIter)(unsafe.Pointer(pSeg)).FnPos), 0, uint32(FTS5_DATA_ZERO_PADDING))
if pColset == uintptr(0) {
fts5ChunkIterate(tls, p, pSeg, pBuf, *(*uintptr)(unsafe.Pointer(&struct {
f func(*libc.TLS, uintptr, uintptr, uintptr, int32)
@@ -181030,23 +183432,23 @@ func fts5SegiterPoslist(tls *libc.TLS, p uintptr, pSeg uintptr, pColset uintptr,
// This function is a no-op if *pRc is other than SQLITE_OK when it is
// called. If an OOM error is encountered, *pRc is set to SQLITE_NOMEM
// before returning.
-func fts5IndexExtractColset(tls *libc.TLS, pRc uintptr, pColset uintptr, pPos uintptr, nPos int32, pIter uintptr) { /* sqlite3.c:224200:13: */
+func fts5IndexExtractColset(tls *libc.TLS, pRc uintptr, pColset uintptr, pPos uintptr, nPos int32, pIter uintptr) { /* sqlite3.c:226090:13: */
bp := tls.Alloc(4)
defer tls.Free(4)
if *(*int32)(unsafe.Pointer(pRc)) == SQLITE_OK {
var p uintptr = pPos
var aCopy uintptr = p
- var pEnd uintptr = (p + uintptr(nPos)) // One byte past end of position list
+ var pEnd uintptr = p + uintptr(nPos) // One byte past end of position list
var i int32 = 0
*(*int32)(unsafe.Pointer(bp /* iCurrent */)) = 0
- if ((*Fts5Colset)(unsafe.Pointer(pColset)).FnCol > 1) && (sqlite3Fts5BufferSize(tls, pRc, (pIter+28 /* &.poslist */), uint32(nPos)) != 0) {
+ if (*Fts5Colset)(unsafe.Pointer(pColset)).FnCol > 1 && sqlite3Fts5BufferSize(tls, pRc, pIter+28, uint32(nPos)) != 0 {
return
}
for 1 != 0 {
- for *(*int32)(unsafe.Pointer((pColset + 4 /* &.aiCol */) + uintptr(i)*4)) < *(*int32)(unsafe.Pointer(bp /* iCurrent */)) {
+ for *(*int32)(unsafe.Pointer(pColset + 4 + uintptr(i)*4)) < *(*int32)(unsafe.Pointer(bp)) {
i++
if i == (*Fts5Colset)(unsafe.Pointer(pColset)).FnCol {
(*Fts5Iter)(unsafe.Pointer(pIter)).Fbase.FpData = (*Fts5Iter)(unsafe.Pointer(pIter)).Fposlist.Fp
@@ -181057,20 +183459,20 @@ func fts5IndexExtractColset(tls *libc.TLS, pRc uintptr, pColset uintptr, pPos ui
// Advance pointer p until it points to pEnd or an 0x01 byte that is
// not part of a varint
- for (p < pEnd) && (int32(*(*U8)(unsafe.Pointer(p))) != 0x01) {
- for (int32(*(*U8)(unsafe.Pointer(libc.PostIncUintptr(&p, 1)))) & 0x80) != 0 {
+ for p < pEnd && int32(*(*U8)(unsafe.Pointer(p))) != 0x01 {
+ for int32(*(*U8)(unsafe.Pointer(libc.PostIncUintptr(&p, 1))))&0x80 != 0 {
}
}
- if *(*int32)(unsafe.Pointer((pColset + 4 /* &.aiCol */) + uintptr(i)*4)) == *(*int32)(unsafe.Pointer(bp /* iCurrent */)) {
+ if *(*int32)(unsafe.Pointer(pColset + 4 + uintptr(i)*4)) == *(*int32)(unsafe.Pointer(bp)) {
if (*Fts5Colset)(unsafe.Pointer(pColset)).FnCol == 1 {
(*Fts5Iter)(unsafe.Pointer(pIter)).Fbase.FpData = aCopy
- (*Fts5Iter)(unsafe.Pointer(pIter)).Fbase.FnData = ((int32(p) - int32(aCopy)) / 1)
+ (*Fts5Iter)(unsafe.Pointer(pIter)).Fbase.FnData = (int32(p) - int32(aCopy)) / 1
return
}
{
- libc.Xmemcpy(tls, ((*Fts5Buffer)(unsafe.Pointer((pIter + 28 /* &.poslist */))).Fp + uintptr((*Fts5Buffer)(unsafe.Pointer((pIter + 28 /* &.poslist */))).Fn)), aCopy, (uint32((int32(p) - int32(aCopy)) / 1)))
- *(*int32)(unsafe.Pointer((pIter + 28 /* &.poslist */) + 4 /* &.n */)) += ((int32(p) - int32(aCopy)) / 1)
+ libc.Xmemcpy(tls, (*Fts5Buffer)(unsafe.Pointer(pIter+28)).Fp+uintptr((*Fts5Buffer)(unsafe.Pointer(pIter+28)).Fn), aCopy, uint32((int32(p)-int32(aCopy))/1))
+ *(*int32)(unsafe.Pointer(pIter + 28 + 4)) += (int32(p) - int32(aCopy)) / 1
}
}
@@ -181081,7 +183483,7 @@ func fts5IndexExtractColset(tls *libc.TLS, pRc uintptr, pColset uintptr, pPos ui
}
aCopy = libc.PostIncUintptr(&p, 1)
*(*int32)(unsafe.Pointer(bp /* iCurrent */)) = int32(*(*U8)(unsafe.Pointer(libc.PostIncUintptr(&p, 1))))
- if (*(*int32)(unsafe.Pointer(bp /* iCurrent */)) & 0x80) != 0 {
+ if *(*int32)(unsafe.Pointer(bp))&0x80 != 0 {
p--
p += uintptr(sqlite3Fts5GetVarint32(tls, p, bp /* &iCurrent */))
}
@@ -181091,7 +183493,7 @@ func fts5IndexExtractColset(tls *libc.TLS, pRc uintptr, pColset uintptr, pPos ui
}
// xSetOutputs callback used by detail=none tables.
-func fts5IterSetOutputs_None(tls *libc.TLS, pIter uintptr, pSeg uintptr) { /* sqlite3.c:224260:13: */
+func fts5IterSetOutputs_None(tls *libc.TLS, pIter uintptr, pSeg uintptr) { /* sqlite3.c:226150:13: */
(*Fts5Iter)(unsafe.Pointer(pIter)).Fbase.FiRowid = (*Fts5SegIter)(unsafe.Pointer(pSeg)).FiRowid
(*Fts5Iter)(unsafe.Pointer(pIter)).Fbase.FnData = (*Fts5SegIter)(unsafe.Pointer(pSeg)).FnPos
@@ -181099,27 +183501,27 @@ func fts5IterSetOutputs_None(tls *libc.TLS, pIter uintptr, pSeg uintptr) { /* sq
// xSetOutputs callback used by detail=full and detail=col tables when no
// column filters are specified.
-func fts5IterSetOutputs_Nocolset(tls *libc.TLS, pIter uintptr, pSeg uintptr) { /* sqlite3.c:224270:13: */
+func fts5IterSetOutputs_Nocolset(tls *libc.TLS, pIter uintptr, pSeg uintptr) { /* sqlite3.c:226160:13: */
(*Fts5Iter)(unsafe.Pointer(pIter)).Fbase.FiRowid = (*Fts5SegIter)(unsafe.Pointer(pSeg)).FiRowid
(*Fts5Iter)(unsafe.Pointer(pIter)).Fbase.FnData = (*Fts5SegIter)(unsafe.Pointer(pSeg)).FnPos
- if ((*Fts5SegIter)(unsafe.Pointer(pSeg)).FiLeafOffset + I64((*Fts5SegIter)(unsafe.Pointer(pSeg)).FnPos)) <= I64((*Fts5Data)(unsafe.Pointer((*Fts5SegIter)(unsafe.Pointer(pSeg)).FpLeaf)).FszLeaf) {
+ if (*Fts5SegIter)(unsafe.Pointer(pSeg)).FiLeafOffset+I64((*Fts5SegIter)(unsafe.Pointer(pSeg)).FnPos) <= I64((*Fts5Data)(unsafe.Pointer((*Fts5SegIter)(unsafe.Pointer(pSeg)).FpLeaf)).FszLeaf) {
// All data is stored on the current page. Populate the output
// variables to point into the body of the page object.
- (*Fts5Iter)(unsafe.Pointer(pIter)).Fbase.FpData = ((*Fts5Data)(unsafe.Pointer((*Fts5SegIter)(unsafe.Pointer(pSeg)).FpLeaf)).Fp + uintptr((*Fts5SegIter)(unsafe.Pointer(pSeg)).FiLeafOffset))
+ (*Fts5Iter)(unsafe.Pointer(pIter)).Fbase.FpData = (*Fts5Data)(unsafe.Pointer((*Fts5SegIter)(unsafe.Pointer(pSeg)).FpLeaf)).Fp + uintptr((*Fts5SegIter)(unsafe.Pointer(pSeg)).FiLeafOffset)
} else {
// The data is distributed over two or more pages. Copy it into the
// Fts5Iter.poslist buffer and then set the output pointer to point
// to this buffer.
- sqlite3Fts5BufferZero(tls, (pIter + 28 /* &.poslist */))
- fts5SegiterPoslist(tls, (*Fts5Iter)(unsafe.Pointer(pIter)).FpIndex, pSeg, uintptr(0), (pIter + 28 /* &.poslist */))
+ sqlite3Fts5BufferZero(tls, pIter+28)
+ fts5SegiterPoslist(tls, (*Fts5Iter)(unsafe.Pointer(pIter)).FpIndex, pSeg, uintptr(0), pIter+28)
(*Fts5Iter)(unsafe.Pointer(pIter)).Fbase.FpData = (*Fts5Iter)(unsafe.Pointer(pIter)).Fposlist.Fp
}
}
// xSetOutputs callback used when the Fts5Colset object has nCol==0 (match
// against no columns at all).
-func fts5IterSetOutputs_ZeroColset(tls *libc.TLS, pIter uintptr, pSeg uintptr) { /* sqlite3.c:224295:13: */
+func fts5IterSetOutputs_ZeroColset(tls *libc.TLS, pIter uintptr, pSeg uintptr) { /* sqlite3.c:226185:13: */
_ = pSeg
(*Fts5Iter)(unsafe.Pointer(pIter)).Fbase.FnData = 0
}
@@ -181127,9 +183529,9 @@ func fts5IterSetOutputs_ZeroColset(tls *libc.TLS, pIter uintptr, pSeg uintptr) {
// xSetOutputs callback used by detail=col when there is a column filter
// and there are 100 or more columns. Also called as a fallback from
// fts5IterSetOutputs_Col100 if the column-list spans more than one page.
-func fts5IterSetOutputs_Col(tls *libc.TLS, pIter uintptr, pSeg uintptr) { /* sqlite3.c:224305:13: */
- sqlite3Fts5BufferZero(tls, (pIter + 28 /* &.poslist */))
- fts5SegiterPoslist(tls, (*Fts5Iter)(unsafe.Pointer(pIter)).FpIndex, pSeg, (*Fts5Iter)(unsafe.Pointer(pIter)).FpColset, (pIter + 28 /* &.poslist */))
+func fts5IterSetOutputs_Col(tls *libc.TLS, pIter uintptr, pSeg uintptr) { /* sqlite3.c:226195:13: */
+ sqlite3Fts5BufferZero(tls, pIter+28)
+ fts5SegiterPoslist(tls, (*Fts5Iter)(unsafe.Pointer(pIter)).FpIndex, pSeg, (*Fts5Iter)(unsafe.Pointer(pIter)).FpColset, pIter+28)
(*Fts5Iter)(unsafe.Pointer(pIter)).Fbase.FiRowid = (*Fts5SegIter)(unsafe.Pointer(pSeg)).FiRowid
(*Fts5Iter)(unsafe.Pointer(pIter)).Fbase.FpData = (*Fts5Iter)(unsafe.Pointer(pIter)).Fposlist.Fp
(*Fts5Iter)(unsafe.Pointer(pIter)).Fbase.FnData = (*Fts5Iter)(unsafe.Pointer(pIter)).Fposlist.Fn
@@ -181143,7 +183545,7 @@ func fts5IterSetOutputs_Col(tls *libc.TLS, pIter uintptr, pSeg uintptr) { /* sql
//
// The last point is to ensure all column numbers are stored as
// single-byte varints.
-func fts5IterSetOutputs_Col100(tls *libc.TLS, pIter uintptr, pSeg uintptr) { /* sqlite3.c:224323:13: */
+func fts5IterSetOutputs_Col100(tls *libc.TLS, pIter uintptr, pSeg uintptr) { /* sqlite3.c:226213:13: */
var a uintptr
var pEnd uintptr
var iPrev int32
@@ -181152,17 +183554,17 @@ func fts5IterSetOutputs_Col100(tls *libc.TLS, pIter uintptr, pSeg uintptr) { /*
var aOut uintptr
var iPrevOut int32
- if !(((*Fts5SegIter)(unsafe.Pointer(pSeg)).FiLeafOffset + I64((*Fts5SegIter)(unsafe.Pointer(pSeg)).FnPos)) > I64((*Fts5Data)(unsafe.Pointer((*Fts5SegIter)(unsafe.Pointer(pSeg)).FpLeaf)).FszLeaf)) {
+ if !((*Fts5SegIter)(unsafe.Pointer(pSeg)).FiLeafOffset+I64((*Fts5SegIter)(unsafe.Pointer(pSeg)).FnPos) > I64((*Fts5Data)(unsafe.Pointer((*Fts5SegIter)(unsafe.Pointer(pSeg)).FpLeaf)).FszLeaf)) {
goto __1
}
fts5IterSetOutputs_Col(tls, pIter, pSeg)
goto __2
__1:
- a = ((*Fts5Data)(unsafe.Pointer((*Fts5SegIter)(unsafe.Pointer(pSeg)).FpLeaf)).Fp + uintptr((*Fts5SegIter)(unsafe.Pointer(pSeg)).FiLeafOffset))
- pEnd = (a + uintptr((*Fts5SegIter)(unsafe.Pointer(pSeg)).FnPos))
+ a = (*Fts5Data)(unsafe.Pointer((*Fts5SegIter)(unsafe.Pointer(pSeg)).FpLeaf)).Fp + uintptr((*Fts5SegIter)(unsafe.Pointer(pSeg)).FiLeafOffset)
+ pEnd = a + uintptr((*Fts5SegIter)(unsafe.Pointer(pSeg)).FnPos)
iPrev = 0
aiCol = (*Fts5Iter)(unsafe.Pointer(pIter)).FpColset + 4 /* &.aiCol */
- aiColEnd = (aiCol + uintptr((*Fts5Colset)(unsafe.Pointer((*Fts5Iter)(unsafe.Pointer(pIter)).FpColset)).FnCol)*4)
+ aiColEnd = aiCol + uintptr((*Fts5Colset)(unsafe.Pointer((*Fts5Iter)(unsafe.Pointer(pIter)).FpColset)).FnCol)*4
aOut = (*Fts5Iter)(unsafe.Pointer(pIter)).Fposlist.Fp
iPrevOut = 0
@@ -181190,7 +183592,7 @@ __6:
if !(*(*int32)(unsafe.Pointer(aiCol)) == iPrev) {
goto __8
}
- *(*U8)(unsafe.Pointer(libc.PostIncUintptr(&aOut, 1))) = (U8((iPrev - iPrevOut) + 2))
+ *(*U8)(unsafe.Pointer(libc.PostIncUintptr(&aOut, 1))) = U8(iPrev - iPrevOut + 2)
iPrevOut = iPrev
__8:
;
@@ -181200,34 +183602,35 @@ __4:
setoutputs_col_out:
(*Fts5Iter)(unsafe.Pointer(pIter)).Fbase.FpData = (*Fts5Iter)(unsafe.Pointer(pIter)).Fposlist.Fp
- (*Fts5Iter)(unsafe.Pointer(pIter)).Fbase.FnData = ((int32(aOut) - int32((*Fts5Iter)(unsafe.Pointer(pIter)).Fposlist.Fp)) / 1)
+ (*Fts5Iter)(unsafe.Pointer(pIter)).Fbase.FnData = (int32(aOut) - int32((*Fts5Iter)(unsafe.Pointer(pIter)).Fposlist.Fp)) / 1
__2:
}
// xSetOutputs callback used by detail=full when there is a column filter.
-func fts5IterSetOutputs_Full(tls *libc.TLS, pIter uintptr, pSeg uintptr) { /* sqlite3.c:224363:13: */
+func fts5IterSetOutputs_Full(tls *libc.TLS, pIter uintptr, pSeg uintptr) { /* sqlite3.c:226253:13: */
var pColset uintptr = (*Fts5Iter)(unsafe.Pointer(pIter)).FpColset
(*Fts5Iter)(unsafe.Pointer(pIter)).Fbase.FiRowid = (*Fts5SegIter)(unsafe.Pointer(pSeg)).FiRowid
- if ((*Fts5SegIter)(unsafe.Pointer(pSeg)).FiLeafOffset + I64((*Fts5SegIter)(unsafe.Pointer(pSeg)).FnPos)) <= I64((*Fts5Data)(unsafe.Pointer((*Fts5SegIter)(unsafe.Pointer(pSeg)).FpLeaf)).FszLeaf) {
+ if (*Fts5SegIter)(unsafe.Pointer(pSeg)).FiLeafOffset+I64((*Fts5SegIter)(unsafe.Pointer(pSeg)).FnPos) <= I64((*Fts5Data)(unsafe.Pointer((*Fts5SegIter)(unsafe.Pointer(pSeg)).FpLeaf)).FszLeaf) {
// All data is stored on the current page. Populate the output
// variables to point into the body of the page object.
- var a uintptr = ((*Fts5Data)(unsafe.Pointer((*Fts5SegIter)(unsafe.Pointer(pSeg)).FpLeaf)).Fp + uintptr((*Fts5SegIter)(unsafe.Pointer(pSeg)).FiLeafOffset))
- var pRc uintptr = ((*Fts5Iter)(unsafe.Pointer(pIter)).FpIndex + 36 /* &.rc */)
- sqlite3Fts5BufferZero(tls, (pIter + 28 /* &.poslist */))
+ var a uintptr = (*Fts5Data)(unsafe.Pointer((*Fts5SegIter)(unsafe.Pointer(pSeg)).FpLeaf)).Fp + uintptr((*Fts5SegIter)(unsafe.Pointer(pSeg)).FiLeafOffset)
+ var pRc uintptr = (*Fts5Iter)(unsafe.Pointer(pIter)).FpIndex + 36
+ sqlite3Fts5BufferZero(tls, pIter+28)
fts5IndexExtractColset(tls, pRc, pColset, a, (*Fts5SegIter)(unsafe.Pointer(pSeg)).FnPos, pIter)
} else {
// The data is distributed over two or more pages. Copy it into the
// Fts5Iter.poslist buffer and then set the output pointer to point
// to this buffer.
- sqlite3Fts5BufferZero(tls, (pIter + 28 /* &.poslist */))
- fts5SegiterPoslist(tls, (*Fts5Iter)(unsafe.Pointer(pIter)).FpIndex, pSeg, pColset, (pIter + 28 /* &.poslist */))
+ sqlite3Fts5BufferZero(tls, pIter+28)
+ fts5SegiterPoslist(tls, (*Fts5Iter)(unsafe.Pointer(pIter)).FpIndex, pSeg, pColset, pIter+28)
(*Fts5Iter)(unsafe.Pointer(pIter)).Fbase.FpData = (*Fts5Iter)(unsafe.Pointer(pIter)).Fposlist.Fp
(*Fts5Iter)(unsafe.Pointer(pIter)).Fbase.FnData = (*Fts5Iter)(unsafe.Pointer(pIter)).Fposlist.Fn
}
}
-func fts5IterSetOutputCb(tls *libc.TLS, pRc uintptr, pIter uintptr) { /* sqlite3.c:224388:13: */
+func fts5IterSetOutputCb(tls *libc.TLS, pRc uintptr, pIter uintptr) { /* sqlite3.c:226278:13: */
+
if *(*int32)(unsafe.Pointer(pRc)) == SQLITE_OK {
var pConfig uintptr = (*Fts5Index)(unsafe.Pointer((*Fts5Iter)(unsafe.Pointer(pIter)).FpIndex)).FpConfig
if (*Fts5Config)(unsafe.Pointer(pConfig)).FeDetail == FTS5_DETAIL_NONE {
@@ -181252,7 +183655,7 @@ func fts5IterSetOutputCb(tls *libc.TLS, pRc uintptr, pIter uintptr) { /* sqlite3
(*Fts5Iter)(unsafe.Pointer(pIter)).FxSetOutputs = *(*uintptr)(unsafe.Pointer(&struct {
f func(*libc.TLS, uintptr, uintptr)
}{fts5IterSetOutputs_Col100}))
- sqlite3Fts5BufferSize(tls, pRc, (pIter + 28 /* &.poslist */), uint32((*Fts5Config)(unsafe.Pointer(pConfig)).FnCol))
+ sqlite3Fts5BufferSize(tls, pRc, pIter+28, uint32((*Fts5Config)(unsafe.Pointer(pConfig)).FnCol))
} else {
(*Fts5Iter)(unsafe.Pointer(pIter)).FxSetOutputs = *(*uintptr)(unsafe.Pointer(&struct {
f func(*libc.TLS, uintptr, uintptr)
@@ -181271,124 +183674,224 @@ func fts5IterSetOutputCb(tls *libc.TLS, pRc uintptr, pIter uintptr) { /* sqlite3
//
// The iterator initially points to the first term/rowid entry in the
// iterated data.
-func fts5MultiIterNew(tls *libc.TLS, p uintptr, pStruct uintptr, flags int32, pColset uintptr, pTerm uintptr, nTerm int32, iLevel int32, nSegment int32, ppOut uintptr) { /* sqlite3.c:224431:13: */
- var nSeg int32 = 0 // Number of segment-iters in use
- var iIter int32 = 0 //
- var iSeg int32 // Used to iterate through segments
+func fts5MultiIterNew(tls *libc.TLS, p uintptr, pStruct uintptr, flags int32, pColset uintptr, pTerm uintptr, nTerm int32, iLevel int32, nSegment int32, ppOut uintptr) { /* sqlite3.c:226322:13: */
+ var nSeg int32 // Number of segment-iters in use
+ var iIter int32 //
+ var iSeg int32 // Used to iterate through segments
var pLvl uintptr
var pNew uintptr
+ // Add a segment iterator for the current contents of the hash table.
+ var pIter uintptr
+ var pSeg uintptr
+ var pIter1 uintptr
+ var pEnd uintptr
+ var pSeg1 uintptr
+ var iEq int32
+ var pSeg2 uintptr
+ nSeg = 0
+ iIter = 0
// Allocate space for the new multi-seg-iterator.
- if (*Fts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK {
- if iLevel < 0 {
+ if !((*Fts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK) {
+ goto __1
+ }
+ if !(iLevel < 0) {
+ goto __2
+ }
- nSeg = (*Fts5Structure)(unsafe.Pointer(pStruct)).FnSegment
- nSeg = nSeg + (func() int32 {
- if (*Fts5Index)(unsafe.Pointer(p)).FpHash != 0 {
- return 1
- }
- return 0
- }())
- } else {
- nSeg = func() int32 {
- if ((*Fts5StructureLevel)(unsafe.Pointer((pStruct + 24 /* &.aLevel */) + uintptr(iLevel)*12)).FnSeg) < (nSegment) {
- return (*Fts5StructureLevel)(unsafe.Pointer((pStruct + 24 /* &.aLevel */) + uintptr(iLevel)*12)).FnSeg
- }
- return nSegment
- }()
+ nSeg = (*Fts5Structure)(unsafe.Pointer(pStruct)).FnSegment
+ nSeg = nSeg + func() int32 {
+ if (*Fts5Index)(unsafe.Pointer(p)).FpHash != 0 {
+ return 1
}
- }
+ return 0
+ }()
+ goto __3
+__2:
+ nSeg = func() int32 {
+ if (*Fts5StructureLevel)(unsafe.Pointer(pStruct+24+uintptr(iLevel)*12)).FnSeg < nSegment {
+ return (*Fts5StructureLevel)(unsafe.Pointer(pStruct + 24 + uintptr(iLevel)*12)).FnSeg
+ }
+ return nSegment
+ }()
+__3:
+ ;
+__1:
+ ;
*(*uintptr)(unsafe.Pointer(ppOut)) = libc.AssignUintptr(&pNew, fts5MultiIterAlloc(tls, p, nSeg))
- if pNew == uintptr(0) {
- return
+ if !(pNew == uintptr(0)) {
+ goto __4
}
- (*Fts5Iter)(unsafe.Pointer(pNew)).FbRev = (libc.Bool32(0 != (flags & FTS5INDEX_QUERY_DESC)))
- (*Fts5Iter)(unsafe.Pointer(pNew)).FbSkipEmpty = (U8(libc.Bool32(0 != (flags & FTS5INDEX_QUERY_SKIPEMPTY))))
+
+ goto fts5MultiIterNew_post_check
+__4:
+ ;
+ (*Fts5Iter)(unsafe.Pointer(pNew)).FbRev = libc.Bool32(0 != flags&FTS5INDEX_QUERY_DESC)
+ (*Fts5Iter)(unsafe.Pointer(pNew)).FbSkipEmpty = U8(libc.Bool32(0 != flags&FTS5INDEX_QUERY_SKIPEMPTY))
(*Fts5Iter)(unsafe.Pointer(pNew)).FpColset = pColset
- if (flags & FTS5INDEX_QUERY_NOOUTPUT) == 0 {
- fts5IterSetOutputCb(tls, (p + 36 /* &.rc */), pNew)
+ if !(flags&FTS5INDEX_QUERY_NOOUTPUT == 0) {
+ goto __5
}
+ fts5IterSetOutputCb(tls, p+36, pNew)
+__5:
+ ;
// Initialize each of the component segment iterators.
- if (*Fts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK {
- if iLevel < 0 {
- var pEnd uintptr = ((pStruct + 24 /* &.aLevel */) + uintptr((*Fts5Structure)(unsafe.Pointer(pStruct)).FnLevel)*12)
- if (*Fts5Index)(unsafe.Pointer(p)).FpHash != 0 {
- // Add a segment iterator for the current contents of the hash table.
- var pIter uintptr = ((pNew + 80 /* &.aSeg */) + uintptr(libc.PostIncInt32(&iIter, 1))*96)
- fts5SegIterHashInit(tls, p, pTerm, nTerm, flags, pIter)
- }
- for pLvl = (pStruct + 24 /* &.aLevel */); pLvl < pEnd; pLvl += 12 {
- for iSeg = ((*Fts5StructureLevel)(unsafe.Pointer(pLvl)).FnSeg - 1); iSeg >= 0; iSeg-- {
- var pSeg uintptr = ((*Fts5StructureLevel)(unsafe.Pointer(pLvl)).FaSeg + uintptr(iSeg)*12)
- var pIter uintptr = ((pNew + 80 /* &.aSeg */) + uintptr(libc.PostIncInt32(&iIter, 1))*96)
- if pTerm == uintptr(0) {
- fts5SegIterInit(tls, p, pSeg, pIter)
- } else {
- fts5SegIterSeekInit(tls, p, pTerm, nTerm, flags, pSeg, pIter)
- }
- }
- }
- } else {
- pLvl = ((pStruct + 24 /* &.aLevel */) + uintptr(iLevel)*12)
- for iSeg = (nSeg - 1); iSeg >= 0; iSeg-- {
- fts5SegIterInit(tls, p, ((*Fts5StructureLevel)(unsafe.Pointer(pLvl)).FaSeg + uintptr(iSeg)*12), ((pNew + 80 /* &.aSeg */) + uintptr(libc.PostIncInt32(&iIter, 1))*96))
- }
- }
-
+ if !((*Fts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK) {
+ goto __6
+ }
+ if !(iLevel < 0) {
+ goto __7
+ }
+ pEnd = pStruct + 24 + uintptr((*Fts5Structure)(unsafe.Pointer(pStruct)).FnLevel)*12
+ if !((*Fts5Index)(unsafe.Pointer(p)).FpHash != 0) {
+ goto __9
}
+ // Add a segment iterator for the current contents of the hash table.
+ pIter = pNew + 80 + uintptr(libc.PostIncInt32(&iIter, 1))*96
+ fts5SegIterHashInit(tls, p, pTerm, nTerm, flags, pIter)
+__9:
+ ;
+ pLvl = pStruct + 24
+__10:
+ if !(pLvl < pEnd) {
+ goto __12
+ }
+ iSeg = (*Fts5StructureLevel)(unsafe.Pointer(pLvl)).FnSeg - 1
+__13:
+ if !(iSeg >= 0) {
+ goto __15
+ }
+ pSeg = (*Fts5StructureLevel)(unsafe.Pointer(pLvl)).FaSeg + uintptr(iSeg)*12
+ pIter1 = pNew + 80 + uintptr(libc.PostIncInt32(&iIter, 1))*96
+ if !(pTerm == uintptr(0)) {
+ goto __16
+ }
+ fts5SegIterInit(tls, p, pSeg, pIter1)
+ goto __17
+__16:
+ fts5SegIterSeekInit(tls, p, pTerm, nTerm, flags, pSeg, pIter1)
+__17:
+ ;
+ goto __14
+__14:
+ iSeg--
+ goto __13
+ goto __15
+__15:
+ ;
+ goto __11
+__11:
+ pLvl += 12
+ goto __10
+ goto __12
+__12:
+ ;
+ goto __8
+__7:
+ pLvl = pStruct + 24 + uintptr(iLevel)*12
+ iSeg = nSeg - 1
+__18:
+ if !(iSeg >= 0) {
+ goto __20
+ }
+ fts5SegIterInit(tls, p, (*Fts5StructureLevel)(unsafe.Pointer(pLvl)).FaSeg+uintptr(iSeg)*12, pNew+80+uintptr(libc.PostIncInt32(&iIter, 1))*96)
+ goto __19
+__19:
+ iSeg--
+ goto __18
+ goto __20
+__20:
+ ;
+__8:
+ ;
+
+__6:
+ ;
// If the above was successful, each component iterators now points
// to the first entry in its segment. In this case initialize the
// aFirst[] array. Or, if an error has occurred, free the iterator
// object and set the output variable to NULL.
- if (*Fts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK {
- for iIter = ((*Fts5Iter)(unsafe.Pointer(pNew)).FnSeg - 1); iIter > 0; iIter-- {
- var iEq int32
- if libc.AssignInt32(&iEq, fts5MultiIterDoCompare(tls, pNew, iIter)) != 0 {
- var pSeg uintptr = ((pNew + 80 /* &.aSeg */) + uintptr(iEq)*96)
- if (*Fts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK {
- (*struct {
- f func(*libc.TLS, uintptr, uintptr, uintptr)
- })(unsafe.Pointer(&struct{ uintptr }{(*Fts5SegIter)(unsafe.Pointer(pSeg)).FxNext})).f(tls, p, pSeg, uintptr(0))
- }
- fts5MultiIterAdvanced(tls, p, pNew, iEq, iIter)
- }
- }
- fts5MultiIterSetEof(tls, pNew)
-
- if ((*Fts5Iter)(unsafe.Pointer(pNew)).FbSkipEmpty != 0) && (fts5MultiIterIsEmpty(tls, p, pNew) != 0) {
- fts5MultiIterNext(tls, p, pNew, 0, int64(0))
- } else if int32((*Fts5Iter)(unsafe.Pointer(pNew)).Fbase.FbEof) == 0 {
- var pSeg uintptr = ((pNew + 80 /* &.aSeg */) + uintptr((*Fts5CResult)(unsafe.Pointer((*Fts5Iter)(unsafe.Pointer(pNew)).FaFirst+1*4)).FiFirst)*96)
- (*struct {
- f func(*libc.TLS, uintptr, uintptr)
- })(unsafe.Pointer(&struct{ uintptr }{(*Fts5Iter)(unsafe.Pointer(pNew)).FxSetOutputs})).f(tls, pNew, pSeg)
- }
+ if !((*Fts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK) {
+ goto __21
+ }
+ iIter = (*Fts5Iter)(unsafe.Pointer(pNew)).FnSeg - 1
+__23:
+ if !(iIter > 0) {
+ goto __25
+ }
+ if !(libc.AssignInt32(&iEq, fts5MultiIterDoCompare(tls, pNew, iIter)) != 0) {
+ goto __26
+ }
+ pSeg1 = pNew + 80 + uintptr(iEq)*96
+ if !((*Fts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK) {
+ goto __27
+ }
+ (*struct {
+ f func(*libc.TLS, uintptr, uintptr, uintptr)
+ })(unsafe.Pointer(&struct{ uintptr }{(*Fts5SegIter)(unsafe.Pointer(pSeg1)).FxNext})).f(tls, p, pSeg1, uintptr(0))
+__27:
+ ;
+ fts5MultiIterAdvanced(tls, p, pNew, iEq, iIter)
+__26:
+ ;
+ goto __24
+__24:
+ iIter--
+ goto __23
+ goto __25
+__25:
+ ;
+ fts5MultiIterSetEof(tls, pNew)
- } else {
- fts5MultiIterFree(tls, pNew)
- *(*uintptr)(unsafe.Pointer(ppOut)) = uintptr(0)
+ if !((*Fts5Iter)(unsafe.Pointer(pNew)).FbSkipEmpty != 0 && fts5MultiIterIsEmpty(tls, p, pNew) != 0) {
+ goto __28
}
+ fts5MultiIterNext(tls, p, pNew, 0, int64(0))
+ goto __29
+__28:
+ if !(int32((*Fts5Iter)(unsafe.Pointer(pNew)).Fbase.FbEof) == 0) {
+ goto __30
+ }
+ pSeg2 = pNew + 80 + uintptr((*Fts5CResult)(unsafe.Pointer((*Fts5Iter)(unsafe.Pointer(pNew)).FaFirst+1*4)).FiFirst)*96
+ (*struct {
+ f func(*libc.TLS, uintptr, uintptr)
+ })(unsafe.Pointer(&struct{ uintptr }{(*Fts5Iter)(unsafe.Pointer(pNew)).FxSetOutputs})).f(tls, pNew, pSeg2)
+__30:
+ ;
+__29:
+ ;
+
+ goto __22
+__21:
+ fts5MultiIterFree(tls, pNew)
+ *(*uintptr)(unsafe.Pointer(ppOut)) = uintptr(0)
+__22:
+ ;
+
+fts5MultiIterNew_post_check:
+ ;
+ return
}
// Create an Fts5Iter that iterates through the doclist provided
// as the second argument.
-func fts5MultiIterNew2(tls *libc.TLS, p uintptr, pData uintptr, bDesc int32, ppOut uintptr) { /* sqlite3.c:224530:13: */
+func fts5MultiIterNew2(tls *libc.TLS, p uintptr, pData uintptr, bDesc int32, ppOut uintptr) { /* sqlite3.c:226428:13: */
var pNew uintptr
pNew = fts5MultiIterAlloc(tls, p, 2)
if pNew != 0 {
- var pIter uintptr = ((pNew + 80 /* &.aSeg */) + 1*96)
+ var pIter uintptr = pNew + 80 + 1*96
(*Fts5SegIter)(unsafe.Pointer(pIter)).Fflags = FTS5_SEGITER_ONETERM
if (*Fts5Data)(unsafe.Pointer(pData)).FszLeaf > 0 {
(*Fts5SegIter)(unsafe.Pointer(pIter)).FpLeaf = pData
- (*Fts5SegIter)(unsafe.Pointer(pIter)).FiLeafOffset = I64(sqlite3Fts5GetVarint(tls, (*Fts5Data)(unsafe.Pointer(pData)).Fp, (pIter + 80 /* &.iRowid */)))
+ (*Fts5SegIter)(unsafe.Pointer(pIter)).FiLeafOffset = I64(sqlite3Fts5GetVarint(tls, (*Fts5Data)(unsafe.Pointer(pData)).Fp, pIter+80))
(*Fts5SegIter)(unsafe.Pointer(pIter)).FiEndofDoclist = (*Fts5Data)(unsafe.Pointer(pData)).Fnn
(*Fts5CResult)(unsafe.Pointer((*Fts5Iter)(unsafe.Pointer(pNew)).FaFirst + 1*4)).FiFirst = U16(1)
if bDesc != 0 {
(*Fts5Iter)(unsafe.Pointer(pNew)).FbRev = 1
- *(*int32)(unsafe.Pointer(pIter + 4 /* &.flags */)) |= (FTS5_SEGITER_REVERSE)
+ *(*int32)(unsafe.Pointer(pIter + 4)) |= FTS5_SEGITER_REVERSE
fts5SegIterReverseInitPage(tls, p, pIter)
} else {
fts5SegIterLoadNPos(tls, p, pIter)
@@ -181407,21 +183910,21 @@ func fts5MultiIterNew2(tls *libc.TLS, p uintptr, pData uintptr, bDesc int32, ppO
// Return true if the iterator is at EOF or if an error has occurred.
// False otherwise.
-func fts5MultiIterEof(tls *libc.TLS, p uintptr, pIter uintptr) int32 { /* sqlite3.c:224570:12: */
+func fts5MultiIterEof(tls *libc.TLS, p uintptr, pIter uintptr) int32 { /* sqlite3.c:226468:12: */
- return (libc.Bool32(((*Fts5Index)(unsafe.Pointer(p)).Frc != 0) || ((*Fts5Iter)(unsafe.Pointer(pIter)).Fbase.FbEof != 0)))
+ return libc.Bool32((*Fts5Index)(unsafe.Pointer(p)).Frc != 0 || (*Fts5Iter)(unsafe.Pointer(pIter)).Fbase.FbEof != 0)
}
// Return the rowid of the entry that the iterator currently points
// to. If the iterator points to EOF when this function is called the
// results are undefined.
-func fts5MultiIterRowid(tls *libc.TLS, pIter uintptr) I64 { /* sqlite3.c:224582:12: */
+func fts5MultiIterRowid(tls *libc.TLS, pIter uintptr) I64 { /* sqlite3.c:226481:12: */
- return (*Fts5SegIter)(unsafe.Pointer((pIter + 80 /* &.aSeg */) + uintptr((*Fts5CResult)(unsafe.Pointer((*Fts5Iter)(unsafe.Pointer(pIter)).FaFirst+1*4)).FiFirst)*96)).FiRowid
+ return (*Fts5SegIter)(unsafe.Pointer(pIter + 80 + uintptr((*Fts5CResult)(unsafe.Pointer((*Fts5Iter)(unsafe.Pointer(pIter)).FaFirst+1*4)).FiFirst)*96)).FiRowid
}
// Move the iterator to the next entry at or following iMatch.
-func fts5MultiIterNextFrom(tls *libc.TLS, p uintptr, pIter uintptr, iMatch I64) { /* sqlite3.c:224590:13: */
+func fts5MultiIterNextFrom(tls *libc.TLS, p uintptr, pIter uintptr, iMatch I64) { /* sqlite3.c:226489:13: */
for 1 != 0 {
var iRowid I64
fts5MultiIterNext(tls, p, pIter, 1, iMatch)
@@ -181429,10 +183932,10 @@ func fts5MultiIterNextFrom(tls *libc.TLS, p uintptr, pIter uintptr, iMatch I64)
break
}
iRowid = fts5MultiIterRowid(tls, pIter)
- if ((*Fts5Iter)(unsafe.Pointer(pIter)).FbRev == 0) && (iRowid >= iMatch) {
+ if (*Fts5Iter)(unsafe.Pointer(pIter)).FbRev == 0 && iRowid >= iMatch {
break
}
- if ((*Fts5Iter)(unsafe.Pointer(pIter)).FbRev != 0) && (iRowid <= iMatch) {
+ if (*Fts5Iter)(unsafe.Pointer(pIter)).FbRev != 0 && iRowid <= iMatch {
break
}
}
@@ -181440,8 +183943,8 @@ func fts5MultiIterNextFrom(tls *libc.TLS, p uintptr, pIter uintptr, iMatch I64)
// Return a pointer to a buffer containing the term associated with the
// entry that the iterator currently points to.
-func fts5MultiIterTerm(tls *libc.TLS, pIter uintptr, pn uintptr) uintptr { /* sqlite3.c:224609:17: */
- var p uintptr = ((pIter + 80 /* &.aSeg */) + uintptr((*Fts5CResult)(unsafe.Pointer((*Fts5Iter)(unsafe.Pointer(pIter)).FaFirst+1*4)).FiFirst)*96)
+func fts5MultiIterTerm(tls *libc.TLS, pIter uintptr, pn uintptr) uintptr { /* sqlite3.c:226508:17: */
+ var p uintptr = pIter + 80 + uintptr((*Fts5CResult)(unsafe.Pointer((*Fts5Iter)(unsafe.Pointer(pIter)).FaFirst+1*4)).FiFirst)*96
*(*int32)(unsafe.Pointer(pn)) = (*Fts5SegIter)(unsafe.Pointer(p)).Fterm.Fn
return (*Fts5SegIter)(unsafe.Pointer(p)).Fterm.Fp
}
@@ -181453,7 +183956,7 @@ func fts5MultiIterTerm(tls *libc.TLS, pIter uintptr, pn uintptr) uintptr { /* sq
//
// If an error has already occurred, this function is a no-op. 0 is
// returned in this case.
-func fts5AllocateSegid(tls *libc.TLS, p uintptr, pStruct uintptr) int32 { /* sqlite3.c:224624:12: */
+func fts5AllocateSegid(tls *libc.TLS, p uintptr, pStruct uintptr) int32 { /* sqlite3.c:226523:12: */
bp := tls.Alloc(252)
defer tls.Free(252)
@@ -181473,10 +183976,10 @@ func fts5AllocateSegid(tls *libc.TLS, p uintptr, pStruct uintptr) int32 { /* sql
var mask U32
libc.Xmemset(tls, bp /* &aUsed[0] */, 0, uint32(unsafe.Sizeof([63]U32{})))
for iLvl = 0; iLvl < (*Fts5Structure)(unsafe.Pointer(pStruct)).FnLevel; iLvl++ {
- for iSeg = 0; iSeg < (*Fts5StructureLevel)(unsafe.Pointer((pStruct+24 /* &.aLevel */)+uintptr(iLvl)*12)).FnSeg; iSeg++ {
- var iId int32 = (*Fts5StructureSegment)(unsafe.Pointer((*Fts5StructureLevel)(unsafe.Pointer((pStruct+24 /* &.aLevel */)+uintptr(iLvl)*12)).FaSeg + uintptr(iSeg)*12)).FiSegid
- if (iId <= FTS5_MAX_SEGMENT) && (iId > 0) {
- *(*U32)(unsafe.Pointer(bp /* &aUsed */ + uintptr(((iId-1)/32))*4)) |= (U32(U32(1)) << ((iId - 1) % 32))
+ for iSeg = 0; iSeg < (*Fts5StructureLevel)(unsafe.Pointer(pStruct+24 /* &.aLevel */ +uintptr(iLvl)*12)).FnSeg; iSeg++ {
+ var iId int32 = (*Fts5StructureSegment)(unsafe.Pointer((*Fts5StructureLevel)(unsafe.Pointer(pStruct+24+uintptr(iLvl)*12)).FaSeg + uintptr(iSeg)*12)).FiSegid
+ if iId <= FTS5_MAX_SEGMENT && iId > 0 {
+ *(*U32)(unsafe.Pointer(bp + uintptr((iId-1)/32)*4)) |= U32(U32(1)) << ((iId - 1) % 32)
}
}
}
@@ -181484,9 +183987,9 @@ func fts5AllocateSegid(tls *libc.TLS, p uintptr, pStruct uintptr) int32 { /* sql
for i = 0; *(*U32)(unsafe.Pointer(bp /* &aUsed[0] */ + uintptr(i)*4)) == 0xFFFFFFFF; i++ {
}
mask = *(*U32)(unsafe.Pointer(bp /* &aUsed[0] */ + uintptr(i)*4))
- for iSegid = 0; (mask & (U32(U32(1)) << iSegid)) != 0; iSegid++ {
+ for iSegid = 0; mask&(U32(U32(1))<<iSegid) != 0; iSegid++ {
}
- iSegid = iSegid + (1 + (i * 32))
+ iSegid = iSegid + (1 + i*32)
}
}
@@ -181495,7 +183998,7 @@ func fts5AllocateSegid(tls *libc.TLS, p uintptr, pStruct uintptr) int32 { /* sql
}
// Discard all data currently cached in the hash-tables.
-func fts5IndexDiscardData(tls *libc.TLS, p uintptr) { /* sqlite3.c:224681:13: */
+func fts5IndexDiscardData(tls *libc.TLS, p uintptr) { /* sqlite3.c:226580:13: */
if (*Fts5Index)(unsafe.Pointer(p)).FpHash != 0 {
sqlite3Fts5HashClear(tls, (*Fts5Index)(unsafe.Pointer(p)).FpHash)
@@ -181508,7 +184011,7 @@ func fts5IndexDiscardData(tls *libc.TLS, p uintptr) { /* sqlite3.c:224681:13: */
//
// Buffer (pNew/<length-unknown>) is guaranteed to be greater
// than buffer (pOld/nOld).
-func fts5PrefixCompress(tls *libc.TLS, nOld int32, pOld uintptr, pNew uintptr) int32 { /* sqlite3.c:224696:12: */
+func fts5PrefixCompress(tls *libc.TLS, nOld int32, pOld uintptr, pNew uintptr) int32 { /* sqlite3.c:226595:12: */
var i int32
for i = 0; i < nOld; i++ {
if int32(*(*U8)(unsafe.Pointer(pOld + uintptr(i)))) != int32(*(*U8)(unsafe.Pointer(pNew + uintptr(i)))) {
@@ -181518,36 +184021,36 @@ func fts5PrefixCompress(tls *libc.TLS, nOld int32, pOld uintptr, pNew uintptr) i
return i
}
-func fts5WriteDlidxClear(tls *libc.TLS, p uintptr, pWriter uintptr, bFlush int32) { /* sqlite3.c:224704:13: */
+func fts5WriteDlidxClear(tls *libc.TLS, p uintptr, pWriter uintptr, bFlush int32) { /* sqlite3.c:226603:13: */
var i int32
for i = 0; i < (*Fts5SegWriter)(unsafe.Pointer(pWriter)).FnDlidx; i++ {
- var pDlidx uintptr = ((*Fts5SegWriter)(unsafe.Pointer(pWriter)).FaDlidx + uintptr(i)*32)
+ var pDlidx uintptr = (*Fts5SegWriter)(unsafe.Pointer(pWriter)).FaDlidx + uintptr(i)*32
if (*Fts5DlidxWriter)(unsafe.Pointer(pDlidx)).Fbuf.Fn == 0 {
break
}
if bFlush != 0 {
fts5DataWrite(tls, p,
- (((((I64((*Fts5SegWriter)(unsafe.Pointer(pWriter)).FiSegid)) << ((FTS5_DATA_PAGE_B + FTS5_DATA_HEIGHT_B) + FTS5_DATA_DLI_B)) + (I64((int64(1))) << (FTS5_DATA_PAGE_B + FTS5_DATA_HEIGHT_B))) + ((I64(i)) << (FTS5_DATA_PAGE_B))) + (I64((*Fts5DlidxWriter)(unsafe.Pointer(pDlidx)).Fpgno))),
+ I64((*Fts5SegWriter)(unsafe.Pointer(pWriter)).FiSegid)<<(FTS5_DATA_PAGE_B+FTS5_DATA_HEIGHT_B+FTS5_DATA_DLI_B)+I64(int64(1))<<(FTS5_DATA_PAGE_B+FTS5_DATA_HEIGHT_B)+I64(i)<<FTS5_DATA_PAGE_B+I64((*Fts5DlidxWriter)(unsafe.Pointer(pDlidx)).Fpgno),
(*Fts5DlidxWriter)(unsafe.Pointer(pDlidx)).Fbuf.Fp, (*Fts5DlidxWriter)(unsafe.Pointer(pDlidx)).Fbuf.Fn)
}
- sqlite3Fts5BufferZero(tls, (pDlidx + 16 /* &.buf */))
+ sqlite3Fts5BufferZero(tls, pDlidx+16)
(*Fts5DlidxWriter)(unsafe.Pointer(pDlidx)).FbPrevValid = 0
}
}
// Grow the pWriter->aDlidx[] array to at least nLvl elements in size.
// Any new array elements are zeroed before returning.
-func fts5WriteDlidxGrow(tls *libc.TLS, p uintptr, pWriter uintptr, nLvl int32) int32 { /* sqlite3.c:224730:12: */
- if ((*Fts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK) && (nLvl >= (*Fts5SegWriter)(unsafe.Pointer(pWriter)).FnDlidx) {
+func fts5WriteDlidxGrow(tls *libc.TLS, p uintptr, pWriter uintptr, nLvl int32) int32 { /* sqlite3.c:226629:12: */
+ if (*Fts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK && nLvl >= (*Fts5SegWriter)(unsafe.Pointer(pWriter)).FnDlidx {
var aDlidx uintptr = Xsqlite3_realloc64(tls,
- (*Fts5SegWriter)(unsafe.Pointer(pWriter)).FaDlidx, (uint64(uint32(unsafe.Sizeof(Fts5DlidxWriter{})) * uint32(nLvl))))
+ (*Fts5SegWriter)(unsafe.Pointer(pWriter)).FaDlidx, uint64(uint32(unsafe.Sizeof(Fts5DlidxWriter{}))*uint32(nLvl)))
if aDlidx == uintptr(0) {
(*Fts5Index)(unsafe.Pointer(p)).Frc = SQLITE_NOMEM
} else {
- var nByte Size_t = (uint32(unsafe.Sizeof(Fts5DlidxWriter{})) * (uint32(nLvl - (*Fts5SegWriter)(unsafe.Pointer(pWriter)).FnDlidx)))
- libc.Xmemset(tls, (aDlidx + uintptr((*Fts5SegWriter)(unsafe.Pointer(pWriter)).FnDlidx)*32), 0, nByte)
+ var nByte Size_t = uint32(unsafe.Sizeof(Fts5DlidxWriter{})) * uint32(nLvl-(*Fts5SegWriter)(unsafe.Pointer(pWriter)).FnDlidx)
+ libc.Xmemset(tls, aDlidx+uintptr((*Fts5SegWriter)(unsafe.Pointer(pWriter)).FnDlidx)*32, 0, nByte)
(*Fts5SegWriter)(unsafe.Pointer(pWriter)).FaDlidx = aDlidx
(*Fts5SegWriter)(unsafe.Pointer(pWriter)).FnDlidx = nLvl
}
@@ -181558,12 +184061,12 @@ func fts5WriteDlidxGrow(tls *libc.TLS, p uintptr, pWriter uintptr, nLvl int32) i
// If the current doclist-index accumulating in pWriter->aDlidx[] is large
// enough, flush it to disk and return 1. Otherwise discard it and return
// zero.
-func fts5WriteFlushDlidx(tls *libc.TLS, p uintptr, pWriter uintptr) int32 { /* sqlite3.c:224756:12: */
+func fts5WriteFlushDlidx(tls *libc.TLS, p uintptr, pWriter uintptr) int32 { /* sqlite3.c:226655:12: */
var bFlag int32 = 0
// If there were FTS5_MIN_DLIDX_SIZE or more empty leaf pages written
// to the database, also write the doclist-index to disk.
- if ((*Fts5DlidxWriter)(unsafe.Pointer((*Fts5SegWriter)(unsafe.Pointer(pWriter)).FaDlidx)).Fbuf.Fn > 0) && ((*Fts5SegWriter)(unsafe.Pointer(pWriter)).FnEmpty >= FTS5_MIN_DLIDX_SIZE) {
+ if (*Fts5DlidxWriter)(unsafe.Pointer((*Fts5SegWriter)(unsafe.Pointer(pWriter)).FaDlidx)).Fbuf.Fn > 0 && (*Fts5SegWriter)(unsafe.Pointer(pWriter)).FnEmpty >= FTS5_MIN_DLIDX_SIZE {
bFlag = 1
}
fts5WriteDlidxClear(tls, p, pWriter, bFlag)
@@ -181580,7 +184083,7 @@ func fts5WriteFlushDlidx(tls *libc.TLS, p uintptr, pWriter uintptr) int32 { /* s
// it.
//
// Fts5SegWriter.btterm currently contains the first term on page iBtPage.
-func fts5WriteFlushBtree(tls *libc.TLS, p uintptr, pWriter uintptr) { /* sqlite3.c:224780:13: */
+func fts5WriteFlushBtree(tls *libc.TLS, p uintptr, pWriter uintptr) { /* sqlite3.c:226679:13: */
var bFlag int32
if (*Fts5SegWriter)(unsafe.Pointer(pWriter)).FiBtPage == 0 {
@@ -181593,12 +184096,12 @@ func fts5WriteFlushBtree(tls *libc.TLS, p uintptr, pWriter uintptr) { /* sqlite3
if (*Fts5SegWriter)(unsafe.Pointer(pWriter)).Fbtterm.Fn > 0 {
return (*Fts5SegWriter)(unsafe.Pointer(pWriter)).Fbtterm.Fp
}
- return ts + 755 /* "" */
+ return ts + 1543
}()
// The following was already done in fts5WriteInit():
// sqlite3_bind_int(p->pIdxWriter, 1, pWriter->iSegid);
Xsqlite3_bind_blob(tls, (*Fts5Index)(unsafe.Pointer(p)).FpIdxWriter, 2, z, (*Fts5SegWriter)(unsafe.Pointer(pWriter)).Fbtterm.Fn, uintptr(0))
- Xsqlite3_bind_int64(tls, (*Fts5Index)(unsafe.Pointer(p)).FpIdxWriter, 3, (I64(bFlag) + (I64((*Fts5SegWriter)(unsafe.Pointer(pWriter)).FiBtPage) << 1)))
+ Xsqlite3_bind_int64(tls, (*Fts5Index)(unsafe.Pointer(p)).FpIdxWriter, 3, I64(bFlag)+I64((*Fts5SegWriter)(unsafe.Pointer(pWriter)).FiBtPage)<<1)
Xsqlite3_step(tls, (*Fts5Index)(unsafe.Pointer(p)).FpIdxWriter)
(*Fts5Index)(unsafe.Pointer(p)).Frc = Xsqlite3_reset(tls, (*Fts5Index)(unsafe.Pointer(p)).FpIdxWriter)
Xsqlite3_bind_null(tls, (*Fts5Index)(unsafe.Pointer(p)).FpIdxWriter, 2)
@@ -181613,30 +184116,30 @@ func fts5WriteFlushBtree(tls *libc.TLS, p uintptr, pWriter uintptr) { /* sqlite3
//
// If an error occurs, an error code is left in Fts5Index.rc. If an error
// has already occurred when this function is called, it is a no-op.
-func fts5WriteBtreeTerm(tls *libc.TLS, p uintptr, pWriter uintptr, nTerm int32, pTerm uintptr) { /* sqlite3.c:224809:13: */
+func fts5WriteBtreeTerm(tls *libc.TLS, p uintptr, pWriter uintptr, nTerm int32, pTerm uintptr) { /* sqlite3.c:226708:13: */
fts5WriteFlushBtree(tls, p, pWriter)
if (*Fts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK {
- sqlite3Fts5BufferSet(tls, (p + 36 /* &.rc */), (pWriter + 76 /* &.btterm */), nTerm, pTerm)
+ sqlite3Fts5BufferSet(tls, p+36, pWriter+76, nTerm, pTerm)
(*Fts5SegWriter)(unsafe.Pointer(pWriter)).FiBtPage = (*Fts5SegWriter)(unsafe.Pointer(pWriter)).Fwriter.Fpgno
}
}
// This function is called when flushing a leaf page that contains no
// terms at all to disk.
-func fts5WriteBtreeNoTerm(tls *libc.TLS, p uintptr, pWriter uintptr) { /* sqlite3.c:224825:13: */
+func fts5WriteBtreeNoTerm(tls *libc.TLS, p uintptr, pWriter uintptr) { /* sqlite3.c:226724:13: */
// If there were no rowids on the leaf page either and the doclist-index
// has already been started, append an 0x00 byte to it.
- if ((*Fts5SegWriter)(unsafe.Pointer(pWriter)).FbFirstRowidInPage != 0) && ((*Fts5DlidxWriter)(unsafe.Pointer((*Fts5SegWriter)(unsafe.Pointer(pWriter)).FaDlidx)).Fbuf.Fn > 0) {
- var pDlidx uintptr = ((*Fts5SegWriter)(unsafe.Pointer(pWriter)).FaDlidx)
+ if (*Fts5SegWriter)(unsafe.Pointer(pWriter)).FbFirstRowidInPage != 0 && (*Fts5DlidxWriter)(unsafe.Pointer((*Fts5SegWriter)(unsafe.Pointer(pWriter)).FaDlidx)).Fbuf.Fn > 0 {
+ var pDlidx uintptr = (*Fts5SegWriter)(unsafe.Pointer(pWriter)).FaDlidx
- sqlite3Fts5BufferAppendVarint(tls, (p + 36 /* &.rc */), (pDlidx + 16 /* &.buf */), int64(0))
+ sqlite3Fts5BufferAppendVarint(tls, p+36, pDlidx+16, int64(0))
}
// Increment the "number of sequential leaves without a term" counter.
(*Fts5SegWriter)(unsafe.Pointer(pWriter)).FnEmpty++
}
-func fts5DlidxExtractFirstRowid(tls *libc.TLS, pBuf uintptr) I64 { /* sqlite3.c:224841:12: */
+func fts5DlidxExtractFirstRowid(tls *libc.TLS, pBuf uintptr) I64 { /* sqlite3.c:226740:12: */
bp := tls.Alloc(8)
defer tls.Free(8)
@@ -181644,21 +184147,21 @@ func fts5DlidxExtractFirstRowid(tls *libc.TLS, pBuf uintptr) I64 { /* sqlite3.c:
var iOff int32
- iOff = (1 + int32(sqlite3Fts5GetVarint(tls, ((*Fts5Buffer)(unsafe.Pointer(pBuf)).Fp+1), bp /* &iRowid */)))
- sqlite3Fts5GetVarint(tls, ((*Fts5Buffer)(unsafe.Pointer(pBuf)).Fp + uintptr(iOff)), bp /* &iRowid */)
+ iOff = 1 + int32(sqlite3Fts5GetVarint(tls, (*Fts5Buffer)(unsafe.Pointer(pBuf)).Fp+1, bp))
+ sqlite3Fts5GetVarint(tls, (*Fts5Buffer)(unsafe.Pointer(pBuf)).Fp+uintptr(iOff), bp /* &iRowid */)
return *(*I64)(unsafe.Pointer(bp /* iRowid */))
}
// Rowid iRowid has just been appended to the current leaf page. It is the
// first on the page. This function appends an appropriate entry to the current
// doclist-index.
-func fts5WriteDlidxAppend(tls *libc.TLS, p uintptr, pWriter uintptr, iRowid I64) { /* sqlite3.c:224855:13: */
+func fts5WriteDlidxAppend(tls *libc.TLS, p uintptr, pWriter uintptr, iRowid I64) { /* sqlite3.c:226754:13: */
var i int32
var bDone int32 = 0
- for i = 0; ((*Fts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK) && (bDone == 0); i++ {
+ for i = 0; (*Fts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK && bDone == 0; i++ {
var iVal I64
- var pDlidx uintptr = ((*Fts5SegWriter)(unsafe.Pointer(pWriter)).FaDlidx + uintptr(i)*32)
+ var pDlidx uintptr = (*Fts5SegWriter)(unsafe.Pointer(pWriter)).FaDlidx + uintptr(i)*32
if (*Fts5DlidxWriter)(unsafe.Pointer(pDlidx)).Fbuf.Fn >= (*Fts5Config)(unsafe.Pointer((*Fts5Index)(unsafe.Pointer(p)).FpConfig)).Fpgsz {
// The current doclist-index page is full. Write it to disk and push
@@ -181668,23 +184171,23 @@ func fts5WriteDlidxAppend(tls *libc.TLS, p uintptr, pWriter uintptr, iRowid I64)
// also push its first rowid upwards.
*(*U8)(unsafe.Pointer((*Fts5DlidxWriter)(unsafe.Pointer(pDlidx)).Fbuf.Fp)) = U8(0x01) // Not the root node
fts5DataWrite(tls, p,
- (((((I64((*Fts5SegWriter)(unsafe.Pointer(pWriter)).FiSegid)) << ((FTS5_DATA_PAGE_B + FTS5_DATA_HEIGHT_B) + FTS5_DATA_DLI_B)) + (I64((int64(1))) << (FTS5_DATA_PAGE_B + FTS5_DATA_HEIGHT_B))) + ((I64(i)) << (FTS5_DATA_PAGE_B))) + (I64((*Fts5DlidxWriter)(unsafe.Pointer(pDlidx)).Fpgno))),
+ I64((*Fts5SegWriter)(unsafe.Pointer(pWriter)).FiSegid)<<(FTS5_DATA_PAGE_B+FTS5_DATA_HEIGHT_B+FTS5_DATA_DLI_B)+I64(int64(1))<<(FTS5_DATA_PAGE_B+FTS5_DATA_HEIGHT_B)+I64(i)<<FTS5_DATA_PAGE_B+I64((*Fts5DlidxWriter)(unsafe.Pointer(pDlidx)).Fpgno),
(*Fts5DlidxWriter)(unsafe.Pointer(pDlidx)).Fbuf.Fp, (*Fts5DlidxWriter)(unsafe.Pointer(pDlidx)).Fbuf.Fn)
- fts5WriteDlidxGrow(tls, p, pWriter, (i + 2))
- pDlidx = ((*Fts5SegWriter)(unsafe.Pointer(pWriter)).FaDlidx + uintptr(i)*32)
- if ((*Fts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK) && ((*Fts5DlidxWriter)(unsafe.Pointer(pDlidx+1*32)).Fbuf.Fn == 0) {
- var iFirst I64 = fts5DlidxExtractFirstRowid(tls, (pDlidx + 16 /* &.buf */))
+ fts5WriteDlidxGrow(tls, p, pWriter, i+2)
+ pDlidx = (*Fts5SegWriter)(unsafe.Pointer(pWriter)).FaDlidx + uintptr(i)*32
+ if (*Fts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK && (*Fts5DlidxWriter)(unsafe.Pointer(pDlidx+1*32)).Fbuf.Fn == 0 {
+ var iFirst I64 = fts5DlidxExtractFirstRowid(tls, pDlidx+16)
// This was the root node. Push its first rowid up to the new root.
(*Fts5DlidxWriter)(unsafe.Pointer(pDlidx + 1*32)).Fpgno = (*Fts5DlidxWriter)(unsafe.Pointer(pDlidx)).Fpgno
- sqlite3Fts5BufferAppendVarint(tls, (p + 36 /* &.rc */), (pDlidx + 1*32 + 16 /* &.buf */), int64(0))
- sqlite3Fts5BufferAppendVarint(tls, (p + 36 /* &.rc */), (pDlidx + 1*32 + 16 /* &.buf */), int64((*Fts5DlidxWriter)(unsafe.Pointer(pDlidx)).Fpgno))
- sqlite3Fts5BufferAppendVarint(tls, (p + 36 /* &.rc */), (pDlidx + 1*32 + 16 /* &.buf */), iFirst)
+ sqlite3Fts5BufferAppendVarint(tls, p+36, pDlidx+1*32+16, int64(0))
+ sqlite3Fts5BufferAppendVarint(tls, p+36, pDlidx+1*32+16, int64((*Fts5DlidxWriter)(unsafe.Pointer(pDlidx)).Fpgno))
+ sqlite3Fts5BufferAppendVarint(tls, p+36, pDlidx+1*32+16, iFirst)
(*Fts5DlidxWriter)(unsafe.Pointer(pDlidx + 1*32)).FbPrevValid = 1
(*Fts5DlidxWriter)(unsafe.Pointer(pDlidx + 1*32)).FiPrev = iFirst
}
- sqlite3Fts5BufferZero(tls, (pDlidx + 16 /* &.buf */))
+ sqlite3Fts5BufferZero(tls, pDlidx+16)
(*Fts5DlidxWriter)(unsafe.Pointer(pDlidx)).FbPrevValid = 0
(*Fts5DlidxWriter)(unsafe.Pointer(pDlidx)).Fpgno++
} else {
@@ -181692,7 +184195,7 @@ func fts5WriteDlidxAppend(tls *libc.TLS, p uintptr, pWriter uintptr, iRowid I64)
}
if (*Fts5DlidxWriter)(unsafe.Pointer(pDlidx)).FbPrevValid != 0 {
- iVal = (iRowid - (*Fts5DlidxWriter)(unsafe.Pointer(pDlidx)).FiPrev)
+ iVal = iRowid - (*Fts5DlidxWriter)(unsafe.Pointer(pDlidx)).FiPrev
} else {
var iPgno I64 = func() int64 {
if i == 0 {
@@ -181701,24 +184204,24 @@ func fts5WriteDlidxAppend(tls *libc.TLS, p uintptr, pWriter uintptr, iRowid I64)
return int64((*Fts5DlidxWriter)(unsafe.Pointer(pDlidx + libc.UintptrFromInt32(-1)*32)).Fpgno)
}()
- sqlite3Fts5BufferAppendVarint(tls, (p + 36 /* &.rc */), (pDlidx + 16 /* &.buf */), libc.BoolInt64(!(bDone != 0)))
- sqlite3Fts5BufferAppendVarint(tls, (p + 36 /* &.rc */), (pDlidx + 16 /* &.buf */), iPgno)
+ sqlite3Fts5BufferAppendVarint(tls, p+36, pDlidx+16, libc.BoolInt64(!(bDone != 0)))
+ sqlite3Fts5BufferAppendVarint(tls, p+36, pDlidx+16, iPgno)
iVal = iRowid
}
- sqlite3Fts5BufferAppendVarint(tls, (p + 36 /* &.rc */), (pDlidx + 16 /* &.buf */), iVal)
+ sqlite3Fts5BufferAppendVarint(tls, p+36, pDlidx+16, iVal)
(*Fts5DlidxWriter)(unsafe.Pointer(pDlidx)).FbPrevValid = 1
(*Fts5DlidxWriter)(unsafe.Pointer(pDlidx)).FiPrev = iRowid
}
}
-func fts5WriteFlushLeaf(tls *libc.TLS, p uintptr, pWriter uintptr) { /* sqlite3.c:224915:13: */
- var pPage uintptr = (pWriter + 4 /* &.writer */)
+func fts5WriteFlushLeaf(tls *libc.TLS, p uintptr, pWriter uintptr) { /* sqlite3.c:226814:13: */
+ var pPage uintptr = pWriter + 4
var iRowid I64
// Set the szLeaf header field.
- fts5PutU16(tls, ((*Fts5PageWriter)(unsafe.Pointer(pPage)).Fbuf.Fp + 2), U16((*Fts5PageWriter)(unsafe.Pointer(pPage)).Fbuf.Fn))
+ fts5PutU16(tls, (*Fts5PageWriter)(unsafe.Pointer(pPage)).Fbuf.Fp+2, U16((*Fts5PageWriter)(unsafe.Pointer(pPage)).Fbuf.Fn))
if (*Fts5SegWriter)(unsafe.Pointer(pWriter)).FbFirstTermInPage != 0 {
// No term was written to this page.
@@ -181726,17 +184229,17 @@ func fts5WriteFlushLeaf(tls *libc.TLS, p uintptr, pWriter uintptr) { /* sqlite3.
fts5WriteBtreeNoTerm(tls, p, pWriter)
} else {
// Append the pgidx to the page buffer. Set the szLeaf header field.
- sqlite3Fts5BufferAppendBlob(tls, (p + 36 /* &.rc */), (pPage + 8 /* &.buf */), uint32((*Fts5PageWriter)(unsafe.Pointer(pPage)).Fpgidx.Fn), (*Fts5PageWriter)(unsafe.Pointer(pPage)).Fpgidx.Fp)
+ sqlite3Fts5BufferAppendBlob(tls, p+36, pPage+8, uint32((*Fts5PageWriter)(unsafe.Pointer(pPage)).Fpgidx.Fn), (*Fts5PageWriter)(unsafe.Pointer(pPage)).Fpgidx.Fp)
}
// Write the page out to disk
- iRowid = (((((I64((*Fts5SegWriter)(unsafe.Pointer(pWriter)).FiSegid)) << ((FTS5_DATA_PAGE_B + FTS5_DATA_HEIGHT_B) + FTS5_DATA_DLI_B)) + (I64((int64(0))) << (FTS5_DATA_PAGE_B + FTS5_DATA_HEIGHT_B))) + (I64((int64(0))) << (FTS5_DATA_PAGE_B))) + (I64((*Fts5PageWriter)(unsafe.Pointer(pPage)).Fpgno)))
+ iRowid = I64((*Fts5SegWriter)(unsafe.Pointer(pWriter)).FiSegid)<<(FTS5_DATA_PAGE_B+FTS5_DATA_HEIGHT_B+FTS5_DATA_DLI_B) + I64(int64(0))<<(FTS5_DATA_PAGE_B+FTS5_DATA_HEIGHT_B) + I64(int64(0))<<FTS5_DATA_PAGE_B + I64((*Fts5PageWriter)(unsafe.Pointer(pPage)).Fpgno)
fts5DataWrite(tls, p, iRowid, (*Fts5PageWriter)(unsafe.Pointer(pPage)).Fbuf.Fp, (*Fts5PageWriter)(unsafe.Pointer(pPage)).Fbuf.Fn)
// Initialize the next page.
- sqlite3Fts5BufferZero(tls, (pPage + 8 /* &.buf */))
- sqlite3Fts5BufferZero(tls, (pPage + 20 /* &.pgidx */))
- sqlite3Fts5BufferAppendBlob(tls, (p + 36 /* &.rc */), (pPage + 8 /* &.buf */), uint32(4), uintptr(unsafe.Pointer(&zero)))
+ sqlite3Fts5BufferZero(tls, pPage+8)
+ sqlite3Fts5BufferZero(tls, pPage+20)
+ sqlite3Fts5BufferAppendBlob(tls, p+36, pPage+8, uint32(4), uintptr(unsafe.Pointer(&zero)))
(*Fts5PageWriter)(unsafe.Pointer(pPage)).FiPrevPgidx = 0
(*Fts5PageWriter)(unsafe.Pointer(pPage)).Fpgno++
@@ -181748,40 +184251,40 @@ func fts5WriteFlushLeaf(tls *libc.TLS, p uintptr, pWriter uintptr) { /* sqlite3.
(*Fts5SegWriter)(unsafe.Pointer(pWriter)).FbFirstRowidInPage = U8(1)
}
-var zero = [4]U8{U8(0x00), U8(0x00), U8(0x00), U8(0x00)} /* sqlite3.c:224916:19 */
+var zero = [4]U8{U8(0x00), U8(0x00), U8(0x00), U8(0x00)} /* sqlite3.c:226815:19 */
// Append term pTerm/nTerm to the segment being written by the writer passed
// as the second argument.
//
// If an error occurs, set the Fts5Index.rc error code. If an error has
// already occurred, this function is a no-op.
-func fts5WriteAppendTerm(tls *libc.TLS, p uintptr, pWriter uintptr, nTerm int32, pTerm uintptr) { /* sqlite3.c:224961:13: */
+func fts5WriteAppendTerm(tls *libc.TLS, p uintptr, pWriter uintptr, nTerm int32, pTerm uintptr) { /* sqlite3.c:226860:13: */
var nPrefix int32 // Bytes of prefix compression for term
- var pPage uintptr = (pWriter + 4 /* &.writer */)
- var pPgidx uintptr = (pWriter + 4 /* &.writer */ + 20 /* &.pgidx */)
+ var pPage uintptr = pWriter + 4
+ var pPgidx uintptr = pWriter + 4 + 20
var nMin int32 = func() int32 {
- if ((*Fts5PageWriter)(unsafe.Pointer(pPage)).Fterm.Fn) < (nTerm) {
+ if (*Fts5PageWriter)(unsafe.Pointer(pPage)).Fterm.Fn < nTerm {
return (*Fts5PageWriter)(unsafe.Pointer(pPage)).Fterm.Fn
}
return nTerm
}()
// If the current leaf page is full, flush it to disk.
- if ((((*Fts5PageWriter)(unsafe.Pointer(pPage)).Fbuf.Fn + (*Fts5Buffer)(unsafe.Pointer(pPgidx)).Fn) + nTerm) + 2) >= (*Fts5Config)(unsafe.Pointer((*Fts5Index)(unsafe.Pointer(p)).FpConfig)).Fpgsz {
+ if (*Fts5PageWriter)(unsafe.Pointer(pPage)).Fbuf.Fn+(*Fts5Buffer)(unsafe.Pointer(pPgidx)).Fn+nTerm+2 >= (*Fts5Config)(unsafe.Pointer((*Fts5Index)(unsafe.Pointer(p)).FpConfig)).Fpgsz {
if (*Fts5PageWriter)(unsafe.Pointer(pPage)).Fbuf.Fn > 4 {
fts5WriteFlushLeaf(tls, p, pWriter)
if (*Fts5Index)(unsafe.Pointer(p)).Frc != SQLITE_OK {
return
}
}
- if !(((U32((*Fts5Buffer)(unsafe.Pointer((pPage + 8 /* &.buf */))).Fn)) + (U32(nTerm + FTS5_DATA_PADDING))) <= (U32((*Fts5Buffer)(unsafe.Pointer((pPage + 8 /* &.buf */))).FnSpace))) {
- sqlite3Fts5BufferSize(tls, (p + 36 /* &.rc */), (pPage + 8 /* &.buf */), (uint32((nTerm + FTS5_DATA_PADDING) + (*Fts5Buffer)(unsafe.Pointer((pPage + 8 /* &.buf */))).Fn)))
+ if !(U32((*Fts5Buffer)(unsafe.Pointer(pPage+8)).Fn)+U32(nTerm+FTS5_DATA_PADDING) <= U32((*Fts5Buffer)(unsafe.Pointer(pPage+8)).FnSpace)) {
+ sqlite3Fts5BufferSize(tls, p+36, pPage+8, uint32(nTerm+FTS5_DATA_PADDING+(*Fts5Buffer)(unsafe.Pointer(pPage+8)).Fn))
}
}
// TODO1: Updating pgidx here.
- *(*int32)(unsafe.Pointer(pPgidx + 4 /* &.n */)) += (sqlite3Fts5PutVarint(tls,
- ((*Fts5Buffer)(unsafe.Pointer(pPgidx)).Fp + uintptr((*Fts5Buffer)(unsafe.Pointer(pPgidx)).Fn)), (uint64((*Fts5PageWriter)(unsafe.Pointer(pPage)).Fbuf.Fn - (*Fts5PageWriter)(unsafe.Pointer(pPage)).FiPrevPgidx))))
+ *(*int32)(unsafe.Pointer(pPgidx + 4)) += sqlite3Fts5PutVarint(tls,
+ (*Fts5Buffer)(unsafe.Pointer(pPgidx)).Fp+uintptr((*Fts5Buffer)(unsafe.Pointer(pPgidx)).Fn), uint64((*Fts5PageWriter)(unsafe.Pointer(pPage)).Fbuf.Fn-(*Fts5PageWriter)(unsafe.Pointer(pPage)).FiPrevPgidx))
(*Fts5PageWriter)(unsafe.Pointer(pPage)).FiPrevPgidx = (*Fts5PageWriter)(unsafe.Pointer(pPage)).Fbuf.Fn
if (*Fts5SegWriter)(unsafe.Pointer(pWriter)).FbFirstTermInPage != 0 {
@@ -181802,26 +184305,26 @@ func fts5WriteAppendTerm(tls *libc.TLS, p uintptr, pWriter uintptr, nTerm int32,
// inefficient, but still correct.
var n int32 = nTerm
if (*Fts5PageWriter)(unsafe.Pointer(pPage)).Fterm.Fn != 0 {
- n = (1 + fts5PrefixCompress(tls, nMin, (*Fts5PageWriter)(unsafe.Pointer(pPage)).Fterm.Fp, pTerm))
+ n = 1 + fts5PrefixCompress(tls, nMin, (*Fts5PageWriter)(unsafe.Pointer(pPage)).Fterm.Fp, pTerm)
}
fts5WriteBtreeTerm(tls, p, pWriter, n, pTerm)
if (*Fts5Index)(unsafe.Pointer(p)).Frc != SQLITE_OK {
return
}
- pPage = (pWriter + 4 /* &.writer */)
+ pPage = pWriter + 4
}
} else {
nPrefix = fts5PrefixCompress(tls, nMin, (*Fts5PageWriter)(unsafe.Pointer(pPage)).Fterm.Fp, pTerm)
- sqlite3Fts5BufferAppendVarint(tls, (p + 36 /* &.rc */), (pPage + 8 /* &.buf */), int64(nPrefix))
+ sqlite3Fts5BufferAppendVarint(tls, p+36, pPage+8, int64(nPrefix))
}
// Append the number of bytes of new data, then the term data itself
// to the page.
- sqlite3Fts5BufferAppendVarint(tls, (p + 36 /* &.rc */), (pPage + 8 /* &.buf */), (int64(nTerm - nPrefix)))
- sqlite3Fts5BufferAppendBlob(tls, (p + 36 /* &.rc */), (pPage + 8 /* &.buf */), (uint32(nTerm - nPrefix)), (pTerm + uintptr(nPrefix)))
+ sqlite3Fts5BufferAppendVarint(tls, p+36, pPage+8, int64(nTerm-nPrefix))
+ sqlite3Fts5BufferAppendBlob(tls, p+36, pPage+8, uint32(nTerm-nPrefix), pTerm+uintptr(nPrefix))
// Update the Fts5PageWriter.term field.
- sqlite3Fts5BufferSet(tls, (p + 36 /* &.rc */), (pPage + 32 /* &.term */), nTerm, pTerm)
+ sqlite3Fts5BufferSet(tls, p+36, pPage+32, nTerm, pTerm)
(*Fts5SegWriter)(unsafe.Pointer(pWriter)).FbFirstTermInPage = U8(0)
(*Fts5SegWriter)(unsafe.Pointer(pWriter)).FbFirstRowidInPage = U8(0)
@@ -181831,11 +184334,11 @@ func fts5WriteAppendTerm(tls *libc.TLS, p uintptr, pWriter uintptr, nTerm int32,
}
// Append a rowid and position-list size field to the writers output.
-func fts5WriteAppendRowid(tls *libc.TLS, p uintptr, pWriter uintptr, iRowid I64) { /* sqlite3.c:225042:13: */
+func fts5WriteAppendRowid(tls *libc.TLS, p uintptr, pWriter uintptr, iRowid I64) { /* sqlite3.c:226941:13: */
if (*Fts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK {
- var pPage uintptr = (pWriter + 4 /* &.writer */)
+ var pPage uintptr = pWriter + 4
- if ((*Fts5PageWriter)(unsafe.Pointer(pPage)).Fbuf.Fn + (*Fts5PageWriter)(unsafe.Pointer(pPage)).Fpgidx.Fn) >= (*Fts5Config)(unsafe.Pointer((*Fts5Index)(unsafe.Pointer(p)).FpConfig)).Fpgsz {
+ if (*Fts5PageWriter)(unsafe.Pointer(pPage)).Fbuf.Fn+(*Fts5PageWriter)(unsafe.Pointer(pPage)).Fpgidx.Fn >= (*Fts5Config)(unsafe.Pointer((*Fts5Index)(unsafe.Pointer(p)).FpConfig)).Fpgsz {
fts5WriteFlushLeaf(tls, p, pWriter)
}
@@ -181848,11 +184351,11 @@ func fts5WriteAppendRowid(tls *libc.TLS, p uintptr, pWriter uintptr, iRowid I64)
}
// Write the rowid.
- if ((*Fts5SegWriter)(unsafe.Pointer(pWriter)).FbFirstRowidInDoclist != 0) || ((*Fts5SegWriter)(unsafe.Pointer(pWriter)).FbFirstRowidInPage != 0) {
- sqlite3Fts5BufferAppendVarint(tls, (p + 36 /* &.rc */), (pPage + 8 /* &.buf */), iRowid)
+ if (*Fts5SegWriter)(unsafe.Pointer(pWriter)).FbFirstRowidInDoclist != 0 || (*Fts5SegWriter)(unsafe.Pointer(pWriter)).FbFirstRowidInPage != 0 {
+ sqlite3Fts5BufferAppendVarint(tls, p+36, pPage+8, iRowid)
} else {
- sqlite3Fts5BufferAppendVarint(tls, (p + 36 /* &.rc */), (pPage + 8 /* &.buf */), (iRowid - (*Fts5SegWriter)(unsafe.Pointer(pWriter)).FiPrevRowid))
+ sqlite3Fts5BufferAppendVarint(tls, p+36, pPage+8, iRowid-(*Fts5SegWriter)(unsafe.Pointer(pWriter)).FiPrevRowid)
}
(*Fts5SegWriter)(unsafe.Pointer(pWriter)).FiPrevRowid = iRowid
(*Fts5SegWriter)(unsafe.Pointer(pWriter)).FbFirstRowidInDoclist = U8(0)
@@ -181860,64 +184363,64 @@ func fts5WriteAppendRowid(tls *libc.TLS, p uintptr, pWriter uintptr, iRowid I64)
}
}
-func fts5WriteAppendPoslistData(tls *libc.TLS, p uintptr, pWriter uintptr, aData uintptr, nData int32) { /* sqlite3.c:225075:13: */
+func fts5WriteAppendPoslistData(tls *libc.TLS, p uintptr, pWriter uintptr, aData uintptr, nData int32) { /* sqlite3.c:226974:13: */
bp := tls.Alloc(8)
defer tls.Free(8)
- var pPage uintptr = (pWriter + 4 /* &.writer */)
+ var pPage uintptr = pWriter + 4
var a uintptr = aData
var n int32 = nData
- for ((*Fts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK) &&
- ((((*Fts5PageWriter)(unsafe.Pointer(pPage)).Fbuf.Fn + (*Fts5PageWriter)(unsafe.Pointer(pPage)).Fpgidx.Fn) + n) >= (*Fts5Config)(unsafe.Pointer((*Fts5Index)(unsafe.Pointer(p)).FpConfig)).Fpgsz) {
- var nReq int32 = (((*Fts5Config)(unsafe.Pointer((*Fts5Index)(unsafe.Pointer(p)).FpConfig)).Fpgsz - (*Fts5PageWriter)(unsafe.Pointer(pPage)).Fbuf.Fn) - (*Fts5PageWriter)(unsafe.Pointer(pPage)).Fpgidx.Fn)
+ for (*Fts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK &&
+ (*Fts5PageWriter)(unsafe.Pointer(pPage)).Fbuf.Fn+(*Fts5PageWriter)(unsafe.Pointer(pPage)).Fpgidx.Fn+n >= (*Fts5Config)(unsafe.Pointer((*Fts5Index)(unsafe.Pointer(p)).FpConfig)).Fpgsz {
+ var nReq int32 = (*Fts5Config)(unsafe.Pointer((*Fts5Index)(unsafe.Pointer(p)).FpConfig)).Fpgsz - (*Fts5PageWriter)(unsafe.Pointer(pPage)).Fbuf.Fn - (*Fts5PageWriter)(unsafe.Pointer(pPage)).Fpgidx.Fn
var nCopy int32 = 0
for nCopy < nReq {
// var dummy I64 at bp, 8
- nCopy = nCopy + (int32(sqlite3Fts5GetVarint(tls, (a + uintptr(nCopy)), bp /* &dummy */)))
+ nCopy = nCopy + int32(sqlite3Fts5GetVarint(tls, a+uintptr(nCopy), bp))
}
- sqlite3Fts5BufferAppendBlob(tls, (p + 36 /* &.rc */), (pPage + 8 /* &.buf */), uint32(nCopy), a)
+ sqlite3Fts5BufferAppendBlob(tls, p+36, pPage+8, uint32(nCopy), a)
a += uintptr(nCopy)
- n = n - (nCopy)
+ n = n - nCopy
fts5WriteFlushLeaf(tls, p, pWriter)
}
if n > 0 {
- sqlite3Fts5BufferAppendBlob(tls, (p + 36 /* &.rc */), (pPage + 8 /* &.buf */), uint32(n), a)
+ sqlite3Fts5BufferAppendBlob(tls, p+36, pPage+8, uint32(n), a)
}
}
// Flush any data cached by the writer object to the database. Free any
// allocations associated with the writer.
-func fts5WriteFinish(tls *libc.TLS, p uintptr, pWriter uintptr, pnLeaf uintptr) { /* sqlite3.c:225109:13: */
+func fts5WriteFinish(tls *libc.TLS, p uintptr, pWriter uintptr, pnLeaf uintptr) { /* sqlite3.c:227008:13: */
var i int32
- var pLeaf uintptr = (pWriter + 4 /* &.writer */)
+ var pLeaf uintptr = pWriter + 4
if (*Fts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK {
if (*Fts5PageWriter)(unsafe.Pointer(pLeaf)).Fbuf.Fn > 4 {
fts5WriteFlushLeaf(tls, p, pWriter)
}
- *(*int32)(unsafe.Pointer(pnLeaf)) = ((*Fts5PageWriter)(unsafe.Pointer(pLeaf)).Fpgno - 1)
+ *(*int32)(unsafe.Pointer(pnLeaf)) = (*Fts5PageWriter)(unsafe.Pointer(pLeaf)).Fpgno - 1
if (*Fts5PageWriter)(unsafe.Pointer(pLeaf)).Fpgno > 1 {
fts5WriteFlushBtree(tls, p, pWriter)
}
}
- sqlite3Fts5BufferFree(tls, (pLeaf + 32 /* &.term */))
- sqlite3Fts5BufferFree(tls, (pLeaf + 8 /* &.buf */))
- sqlite3Fts5BufferFree(tls, (pLeaf + 20 /* &.pgidx */))
- sqlite3Fts5BufferFree(tls, (pWriter + 76 /* &.btterm */))
+ sqlite3Fts5BufferFree(tls, pLeaf+32)
+ sqlite3Fts5BufferFree(tls, pLeaf+8)
+ sqlite3Fts5BufferFree(tls, pLeaf+20)
+ sqlite3Fts5BufferFree(tls, pWriter+76)
for i = 0; i < (*Fts5SegWriter)(unsafe.Pointer(pWriter)).FnDlidx; i++ {
- sqlite3Fts5BufferFree(tls, ((*Fts5SegWriter)(unsafe.Pointer(pWriter)).FaDlidx + uintptr(i)*32 + 16 /* &.buf */))
+ sqlite3Fts5BufferFree(tls, (*Fts5SegWriter)(unsafe.Pointer(pWriter)).FaDlidx+uintptr(i)*32+16)
}
Xsqlite3_free(tls, (*Fts5SegWriter)(unsafe.Pointer(pWriter)).FaDlidx)
}
-func fts5WriteInit(tls *libc.TLS, p uintptr, pWriter uintptr, iSegid int32) { /* sqlite3.c:225137:13: */
+func fts5WriteInit(tls *libc.TLS, p uintptr, pWriter uintptr, iSegid int32) { /* sqlite3.c:227036:13: */
bp := tls.Alloc(16)
defer tls.Free(16)
- var nBuffer int32 = ((*Fts5Config)(unsafe.Pointer((*Fts5Index)(unsafe.Pointer(p)).FpConfig)).Fpgsz + FTS5_DATA_PADDING)
+ var nBuffer int32 = (*Fts5Config)(unsafe.Pointer((*Fts5Index)(unsafe.Pointer(p)).FpConfig)).Fpgsz + FTS5_DATA_PADDING
libc.Xmemset(tls, pWriter, 0, uint32(unsafe.Sizeof(Fts5SegWriter{})))
(*Fts5SegWriter)(unsafe.Pointer(pWriter)).FiSegid = iSegid
@@ -181928,13 +184431,13 @@ func fts5WriteInit(tls *libc.TLS, p uintptr, pWriter uintptr, iSegid int32) { /*
(*Fts5SegWriter)(unsafe.Pointer(pWriter)).FiBtPage = 1
// Grow the two buffers to pgsz + padding bytes in size.
- sqlite3Fts5BufferSize(tls, (p + 36 /* &.rc */), (pWriter + 4 /* &.writer */ + 20 /* &.pgidx */), uint32(nBuffer))
- sqlite3Fts5BufferSize(tls, (p + 36 /* &.rc */), (pWriter + 4 /* &.writer */ + 8 /* &.buf */), uint32(nBuffer))
+ sqlite3Fts5BufferSize(tls, p+36, pWriter+4+20, uint32(nBuffer))
+ sqlite3Fts5BufferSize(tls, p+36, pWriter+4+8, uint32(nBuffer))
if (*Fts5Index)(unsafe.Pointer(p)).FpIdxWriter == uintptr(0) {
var pConfig uintptr = (*Fts5Index)(unsafe.Pointer(p)).FpConfig
- fts5IndexPrepareStmt(tls, p, (p + 52 /* &.pIdxWriter */), Xsqlite3_mprintf(tls,
- ts+33278, /* "INSERT INTO '%q'..." */
+ fts5IndexPrepareStmt(tls, p, p+52, Xsqlite3_mprintf(tls,
+ ts+34638, /* "INSERT INTO '%q'..." */
libc.VaList(bp, (*Fts5Config)(unsafe.Pointer(pConfig)).FzDb, (*Fts5Config)(unsafe.Pointer(pConfig)).FzName)))
}
@@ -181953,7 +184456,7 @@ func fts5WriteInit(tls *libc.TLS, p uintptr, pWriter uintptr, iSegid int32) { /*
// Iterator pIter was used to iterate through the input segments of on an
// incremental merge operation. This function is called if the incremental
// merge step has finished but the input has not been completely exhausted.
-func fts5TrimSegments(tls *libc.TLS, p uintptr, pIter uintptr) { /* sqlite3.c:225184:13: */
+func fts5TrimSegments(tls *libc.TLS, p uintptr, pIter uintptr) { /* sqlite3.c:227083:13: */
bp := tls.Alloc(16)
defer tls.Free(16)
@@ -181961,8 +184464,8 @@ func fts5TrimSegments(tls *libc.TLS, p uintptr, pIter uintptr) { /* sqlite3.c:22
// var buf Fts5Buffer at bp, 12
libc.Xmemset(tls, bp /* &buf */, 0, uint32(unsafe.Sizeof(Fts5Buffer{})))
- for i = 0; (i < (*Fts5Iter)(unsafe.Pointer(pIter)).FnSeg) && ((*Fts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK); i++ {
- var pSeg uintptr = ((pIter + 80 /* &.aSeg */) + uintptr(i)*96)
+ for i = 0; i < (*Fts5Iter)(unsafe.Pointer(pIter)).FnSeg && (*Fts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK; i++ {
+ var pSeg uintptr = pIter + 80 + uintptr(i)*96
if (*Fts5SegIter)(unsafe.Pointer(pSeg)).FpSeg == uintptr(0) {
// no-op
} else if (*Fts5SegIter)(unsafe.Pointer(pSeg)).FpLeaf == uintptr(0) {
@@ -181978,7 +184481,7 @@ func fts5TrimSegments(tls *libc.TLS, p uintptr, pIter uintptr) { /* sqlite3.c:22
var iId int32 = (*Fts5StructureSegment)(unsafe.Pointer((*Fts5SegIter)(unsafe.Pointer(pSeg)).FpSeg)).FiSegid
*(*[4]U8)(unsafe.Pointer(bp + 12 /* aHdr */)) = [4]U8{U8(0x00), U8(0x00), U8(0x00), U8(0x00)}
- iLeafRowid = (((((I64(iId)) << ((FTS5_DATA_PAGE_B + FTS5_DATA_HEIGHT_B) + FTS5_DATA_DLI_B)) + (I64((int64(0))) << (FTS5_DATA_PAGE_B + FTS5_DATA_HEIGHT_B))) + (I64((int64(0))) << (FTS5_DATA_PAGE_B))) + (I64((*Fts5SegIter)(unsafe.Pointer(pSeg)).FiTermLeafPgno)))
+ iLeafRowid = I64(iId)<<(FTS5_DATA_PAGE_B+FTS5_DATA_HEIGHT_B+FTS5_DATA_DLI_B) + I64(int64(0))<<(FTS5_DATA_PAGE_B+FTS5_DATA_HEIGHT_B) + I64(int64(0))<<FTS5_DATA_PAGE_B + I64((*Fts5SegIter)(unsafe.Pointer(pSeg)).FiTermLeafPgno)
pData = fts5LeafRead(tls, p, iLeafRowid)
if pData != 0 {
if iOff > (*Fts5Data)(unsafe.Pointer(pData)).FszLeaf {
@@ -181986,33 +184489,33 @@ func fts5TrimSegments(tls *libc.TLS, p uintptr, pIter uintptr) { /* sqlite3.c:22
// a single page has been assigned to more than one segment. In
// this case a prior iteration of this loop may have corrupted the
// segment currently being trimmed.
- (*Fts5Index)(unsafe.Pointer(p)).Frc = (SQLITE_CORRUPT | (int32(1) << 8))
+ (*Fts5Index)(unsafe.Pointer(p)).Frc = SQLITE_CORRUPT | int32(1)<<8
} else {
sqlite3Fts5BufferZero(tls, bp /* &buf */)
- if !(((U32((*Fts5Buffer)(unsafe.Pointer(bp /* &buf */)).Fn)) + (U32((*Fts5Data)(unsafe.Pointer(pData)).Fnn))) <= (U32((*Fts5Buffer)(unsafe.Pointer(bp /* &buf */)).FnSpace))) {
- sqlite3Fts5BufferSize(tls, (p + 36 /* &.rc */), bp /* &buf */, (uint32(((*Fts5Data)(unsafe.Pointer(pData)).Fnn) + (*Fts5Buffer)(unsafe.Pointer((bp /* &buf */))).Fn)))
+ if !(U32((*Fts5Buffer)(unsafe.Pointer(bp)).Fn)+U32((*Fts5Data)(unsafe.Pointer(pData)).Fnn) <= U32((*Fts5Buffer)(unsafe.Pointer(bp)).FnSpace)) {
+ sqlite3Fts5BufferSize(tls, p+36, bp, uint32((*Fts5Data)(unsafe.Pointer(pData)).Fnn+(*Fts5Buffer)(unsafe.Pointer(bp)).Fn))
}
- sqlite3Fts5BufferAppendBlob(tls, (p + 36 /* &.rc */), bp /* &buf */, uint32(unsafe.Sizeof([4]U8{})), bp+12 /* &aHdr[0] */)
- sqlite3Fts5BufferAppendVarint(tls, (p + 36 /* &.rc */), bp /* &buf */, int64((*Fts5SegIter)(unsafe.Pointer(pSeg)).Fterm.Fn))
- sqlite3Fts5BufferAppendBlob(tls, (p + 36 /* &.rc */), bp /* &buf */, uint32((*Fts5SegIter)(unsafe.Pointer(pSeg)).Fterm.Fn), (*Fts5SegIter)(unsafe.Pointer(pSeg)).Fterm.Fp)
- sqlite3Fts5BufferAppendBlob(tls, (p + 36 /* &.rc */), bp /* &buf */, (uint32((*Fts5Data)(unsafe.Pointer(pData)).FszLeaf - iOff)), ((*Fts5Data)(unsafe.Pointer(pData)).Fp + uintptr(iOff)))
+ sqlite3Fts5BufferAppendBlob(tls, p+36, bp /* &buf */, uint32(unsafe.Sizeof([4]U8{})), bp+12 /* &aHdr[0] */)
+ sqlite3Fts5BufferAppendVarint(tls, p+36, bp /* &buf */, int64((*Fts5SegIter)(unsafe.Pointer(pSeg)).Fterm.Fn))
+ sqlite3Fts5BufferAppendBlob(tls, p+36, bp /* &buf */, uint32((*Fts5SegIter)(unsafe.Pointer(pSeg)).Fterm.Fn), (*Fts5SegIter)(unsafe.Pointer(pSeg)).Fterm.Fp)
+ sqlite3Fts5BufferAppendBlob(tls, p+36, bp /* &buf */, uint32((*Fts5Data)(unsafe.Pointer(pData)).FszLeaf-iOff), (*Fts5Data)(unsafe.Pointer(pData)).Fp+uintptr(iOff))
if (*Fts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK {
// Set the szLeaf field
- fts5PutU16(tls, ((*Fts5Buffer)(unsafe.Pointer(bp /* &buf */)).Fp + 2), U16((*Fts5Buffer)(unsafe.Pointer(bp /* &buf */)).Fn))
+ fts5PutU16(tls, (*Fts5Buffer)(unsafe.Pointer(bp)).Fp+2, U16((*Fts5Buffer)(unsafe.Pointer(bp /* &buf */)).Fn))
}
// Set up the new page-index array
- sqlite3Fts5BufferAppendVarint(tls, (p + 36 /* &.rc */), bp /* &buf */, int64(4))
- if (((*Fts5SegIter)(unsafe.Pointer(pSeg)).FiLeafPgno == (*Fts5SegIter)(unsafe.Pointer(pSeg)).FiTermLeafPgno) &&
- ((*Fts5SegIter)(unsafe.Pointer(pSeg)).FiEndofDoclist < (*Fts5Data)(unsafe.Pointer(pData)).FszLeaf)) &&
- ((*Fts5SegIter)(unsafe.Pointer(pSeg)).FiPgidxOff <= (*Fts5Data)(unsafe.Pointer(pData)).Fnn) {
- var nDiff int32 = ((*Fts5Data)(unsafe.Pointer(pData)).FszLeaf - (*Fts5SegIter)(unsafe.Pointer(pSeg)).FiEndofDoclist)
- sqlite3Fts5BufferAppendVarint(tls, (p + 36 /* &.rc */), bp /* &buf */, (int64((((*Fts5Buffer)(unsafe.Pointer(bp /* &buf */)).Fn - 1) - nDiff) - 4)))
- sqlite3Fts5BufferAppendBlob(tls, (p + 36 /* &.rc */), bp /* &buf */, (uint32((*Fts5Data)(unsafe.Pointer(pData)).Fnn - (*Fts5SegIter)(unsafe.Pointer(pSeg)).FiPgidxOff)), ((*Fts5Data)(unsafe.Pointer(pData)).Fp + uintptr((*Fts5SegIter)(unsafe.Pointer(pSeg)).FiPgidxOff)))
+ sqlite3Fts5BufferAppendVarint(tls, p+36, bp /* &buf */, int64(4))
+ if (*Fts5SegIter)(unsafe.Pointer(pSeg)).FiLeafPgno == (*Fts5SegIter)(unsafe.Pointer(pSeg)).FiTermLeafPgno &&
+ (*Fts5SegIter)(unsafe.Pointer(pSeg)).FiEndofDoclist < (*Fts5Data)(unsafe.Pointer(pData)).FszLeaf &&
+ (*Fts5SegIter)(unsafe.Pointer(pSeg)).FiPgidxOff <= (*Fts5Data)(unsafe.Pointer(pData)).Fnn {
+ var nDiff int32 = (*Fts5Data)(unsafe.Pointer(pData)).FszLeaf - (*Fts5SegIter)(unsafe.Pointer(pSeg)).FiEndofDoclist
+ sqlite3Fts5BufferAppendVarint(tls, p+36, bp /* &buf */, int64((*Fts5Buffer)(unsafe.Pointer(bp)).Fn-1-nDiff-4))
+ sqlite3Fts5BufferAppendBlob(tls, p+36, bp /* &buf */, uint32((*Fts5Data)(unsafe.Pointer(pData)).Fnn-(*Fts5SegIter)(unsafe.Pointer(pSeg)).FiPgidxOff), (*Fts5Data)(unsafe.Pointer(pData)).Fp+uintptr((*Fts5SegIter)(unsafe.Pointer(pSeg)).FiPgidxOff))
}
(*Fts5StructureSegment)(unsafe.Pointer((*Fts5SegIter)(unsafe.Pointer(pSeg)).FpSeg)).FpgnoFirst = (*Fts5SegIter)(unsafe.Pointer(pSeg)).FiTermLeafPgno
- fts5DataDelete(tls, p, (((((I64(iId)) << ((FTS5_DATA_PAGE_B + FTS5_DATA_HEIGHT_B) + FTS5_DATA_DLI_B)) + (I64((int64(0))) << (FTS5_DATA_PAGE_B + FTS5_DATA_HEIGHT_B))) + (I64((int64(0))) << (FTS5_DATA_PAGE_B))) + (int64(1))), iLeafRowid)
+ fts5DataDelete(tls, p, I64(iId)<<(FTS5_DATA_PAGE_B+FTS5_DATA_HEIGHT_B+FTS5_DATA_DLI_B)+I64(int64(0))<<(FTS5_DATA_PAGE_B+FTS5_DATA_HEIGHT_B)+I64(int64(0))<<FTS5_DATA_PAGE_B+int64(1), iLeafRowid)
fts5DataWrite(tls, p, iLeafRowid, (*Fts5Buffer)(unsafe.Pointer(bp /* &buf */)).Fp, (*Fts5Buffer)(unsafe.Pointer(bp /* &buf */)).Fn)
}
fts5DataRelease(tls, pData)
@@ -182022,18 +184525,18 @@ func fts5TrimSegments(tls *libc.TLS, p uintptr, pIter uintptr) { /* sqlite3.c:22
sqlite3Fts5BufferFree(tls, bp /* &buf */)
}
-func fts5MergeChunkCallback(tls *libc.TLS, p uintptr, pCtx uintptr, pChunk uintptr, nChunk int32) { /* sqlite3.c:225250:13: */
+func fts5MergeChunkCallback(tls *libc.TLS, p uintptr, pCtx uintptr, pChunk uintptr, nChunk int32) { /* sqlite3.c:227149:13: */
var pWriter uintptr = pCtx
fts5WriteAppendPoslistData(tls, p, pWriter, pChunk, nChunk)
}
//
-func fts5IndexMergeLevel(tls *libc.TLS, p uintptr, ppStruct uintptr, iLvl int32, pnRem uintptr) { /* sqlite3.c:225262:13: */
+func fts5IndexMergeLevel(tls *libc.TLS, p uintptr, ppStruct uintptr, iLvl int32, pnRem uintptr) { /* sqlite3.c:227161:13: */
bp := tls.Alloc(116)
defer tls.Free(116)
var pStruct uintptr = *(*uintptr)(unsafe.Pointer(ppStruct))
- var pLvl uintptr = ((pStruct + 24 /* &.aLevel */) + uintptr(iLvl)*12)
+ var pLvl uintptr = pStruct + 24 + uintptr(iLvl)*12
var pLvlOut uintptr
*(*uintptr)(unsafe.Pointer(bp + 108 /* pIter */)) = uintptr(0) // Iterator to read input data
var nRem int32
@@ -182056,34 +184559,34 @@ func fts5IndexMergeLevel(tls *libc.TLS, p uintptr, ppStruct uintptr, iLvl int32,
libc.Xmemset(tls, bp /* &writer */, 0, uint32(unsafe.Sizeof(Fts5SegWriter{})))
libc.Xmemset(tls, bp+96 /* &term */, 0, uint32(unsafe.Sizeof(Fts5Buffer{})))
if (*Fts5StructureLevel)(unsafe.Pointer(pLvl)).FnMerge != 0 {
- pLvlOut = ((pStruct + 24 /* &.aLevel */) + uintptr((iLvl+1))*12)
+ pLvlOut = pStruct + 24 + uintptr(iLvl+1)*12
nInput = (*Fts5StructureLevel)(unsafe.Pointer(pLvl)).FnMerge
- pSeg = ((*Fts5StructureLevel)(unsafe.Pointer(pLvlOut)).FaSeg + uintptr(((*Fts5StructureLevel)(unsafe.Pointer(pLvlOut)).FnSeg-1))*12)
+ pSeg = (*Fts5StructureLevel)(unsafe.Pointer(pLvlOut)).FaSeg + uintptr((*Fts5StructureLevel)(unsafe.Pointer(pLvlOut)).FnSeg-1)*12
fts5WriteInit(tls, p, bp /* &writer */, (*Fts5StructureSegment)(unsafe.Pointer(pSeg)).FiSegid)
- (*Fts5SegWriter)(unsafe.Pointer(bp /* &writer */)).Fwriter.Fpgno = ((*Fts5StructureSegment)(unsafe.Pointer(pSeg)).FpgnoLast + 1)
+ (*Fts5SegWriter)(unsafe.Pointer(bp /* &writer */)).Fwriter.Fpgno = (*Fts5StructureSegment)(unsafe.Pointer(pSeg)).FpgnoLast + 1
(*Fts5SegWriter)(unsafe.Pointer(bp /* &writer */)).FiBtPage = 0
} else {
var iSegid int32 = fts5AllocateSegid(tls, p, pStruct)
// Extend the Fts5Structure object as required to ensure the output
// segment exists.
- if iLvl == ((*Fts5Structure)(unsafe.Pointer(pStruct)).FnLevel - 1) {
- fts5StructureAddLevel(tls, (p + 36 /* &.rc */), ppStruct)
+ if iLvl == (*Fts5Structure)(unsafe.Pointer(pStruct)).FnLevel-1 {
+ fts5StructureAddLevel(tls, p+36, ppStruct)
pStruct = *(*uintptr)(unsafe.Pointer(ppStruct))
}
- fts5StructureExtendLevel(tls, (p + 36 /* &.rc */), pStruct, (iLvl + 1), 1, 0)
+ fts5StructureExtendLevel(tls, p+36, pStruct, iLvl+1, 1, 0)
if (*Fts5Index)(unsafe.Pointer(p)).Frc != 0 {
return
}
- pLvl = ((pStruct + 24 /* &.aLevel */) + uintptr(iLvl)*12)
- pLvlOut = ((pStruct + 24 /* &.aLevel */) + uintptr((iLvl+1))*12)
+ pLvl = pStruct + 24 + uintptr(iLvl)*12
+ pLvlOut = pStruct + 24 + uintptr(iLvl+1)*12
fts5WriteInit(tls, p, bp /* &writer */, iSegid)
// Add the new segment to the output level
- pSeg = ((*Fts5StructureLevel)(unsafe.Pointer(pLvlOut)).FaSeg + uintptr((*Fts5StructureLevel)(unsafe.Pointer(pLvlOut)).FnSeg)*12)
+ pSeg = (*Fts5StructureLevel)(unsafe.Pointer(pLvlOut)).FaSeg + uintptr((*Fts5StructureLevel)(unsafe.Pointer(pLvlOut)).FnSeg)*12
(*Fts5StructureLevel)(unsafe.Pointer(pLvlOut)).FnSeg++
(*Fts5StructureSegment)(unsafe.Pointer(pSeg)).FpgnoFirst = 1
(*Fts5StructureSegment)(unsafe.Pointer(pSeg)).FiSegid = iSegid
@@ -182092,35 +184595,35 @@ func fts5IndexMergeLevel(tls *libc.TLS, p uintptr, ppStruct uintptr, iLvl int32,
// Read input from all segments in the input level
nInput = (*Fts5StructureLevel)(unsafe.Pointer(pLvl)).FnSeg
}
- bOldest = (libc.Bool32(((*Fts5StructureLevel)(unsafe.Pointer(pLvlOut)).FnSeg == 1) && ((*Fts5Structure)(unsafe.Pointer(pStruct)).FnLevel == (iLvl + 2))))
+ bOldest = libc.Bool32((*Fts5StructureLevel)(unsafe.Pointer(pLvlOut)).FnSeg == 1 && (*Fts5Structure)(unsafe.Pointer(pStruct)).FnLevel == iLvl+2)
for fts5MultiIterNew(tls, p, pStruct, flags, uintptr(0), uintptr(0), 0, iLvl, nInput, bp+108 /* &pIter */); fts5MultiIterEof(tls, p, *(*uintptr)(unsafe.Pointer(bp + 108 /* pIter */))) == 0; fts5MultiIterNext(tls, p, *(*uintptr)(unsafe.Pointer(bp + 108 /* pIter */)), 0, int64(0)) {
- var pSegIter uintptr = ((*(*uintptr)(unsafe.Pointer(bp + 108 /* pIter */)) + 80 /* &.aSeg */) + uintptr((*Fts5CResult)(unsafe.Pointer((*Fts5Iter)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 108 /* pIter */)))).FaFirst+1*4)).FiFirst)*96)
+ var pSegIter uintptr = *(*uintptr)(unsafe.Pointer(bp + 108)) + 80 + uintptr((*Fts5CResult)(unsafe.Pointer((*Fts5Iter)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 108)))).FaFirst+1*4)).FiFirst)*96
var nPos int32 // position-list size field value
// var nTerm int32 at bp+112, 4
var pTerm uintptr
pTerm = fts5MultiIterTerm(tls, *(*uintptr)(unsafe.Pointer(bp + 108 /* pIter */)), bp+112 /* &nTerm */)
- if (*(*int32)(unsafe.Pointer(bp + 112 /* nTerm */)) != (*Fts5Buffer)(unsafe.Pointer(bp+96 /* &term */)).Fn) || (func() int32 {
- if (*(*int32)(unsafe.Pointer(bp + 112 /* nTerm */))) == 0 {
+ if *(*int32)(unsafe.Pointer(bp + 112)) != (*Fts5Buffer)(unsafe.Pointer(bp+96)).Fn || func() int32 {
+ if *(*int32)(unsafe.Pointer(bp + 112)) <= 0 {
return 0
}
- return libc.Xmemcmp(tls, pTerm, (*Fts5Buffer)(unsafe.Pointer(bp+96 /* &term */)).Fp, uint32(*(*int32)(unsafe.Pointer(bp + 112 /* nTerm */))))
- }() != 0) {
- if (pnRem != 0) && ((*Fts5SegWriter)(unsafe.Pointer(bp /* &writer */)).FnLeafWritten > nRem) {
+ return libc.Xmemcmp(tls, pTerm, (*Fts5Buffer)(unsafe.Pointer(bp+96)).Fp, uint32(*(*int32)(unsafe.Pointer(bp + 112))))
+ }() != 0 {
+ if pnRem != 0 && (*Fts5SegWriter)(unsafe.Pointer(bp)).FnLeafWritten > nRem {
break
}
- sqlite3Fts5BufferSet(tls, (p + 36 /* &.rc */), bp+96 /* &term */, *(*int32)(unsafe.Pointer(bp + 112 /* nTerm */)), pTerm)
+ sqlite3Fts5BufferSet(tls, p+36, bp+96 /* &term */, *(*int32)(unsafe.Pointer(bp + 112 /* nTerm */)), pTerm)
bTermWritten = 0
}
// Check for key annihilation.
- if ((*Fts5SegIter)(unsafe.Pointer(pSegIter)).FnPos == 0) && ((bOldest != 0) || (int32((*Fts5SegIter)(unsafe.Pointer(pSegIter)).FbDel) == 0)) {
+ if (*Fts5SegIter)(unsafe.Pointer(pSegIter)).FnPos == 0 && (bOldest != 0 || int32((*Fts5SegIter)(unsafe.Pointer(pSegIter)).FbDel) == 0) {
continue
}
- if ((*Fts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK) && (bTermWritten == 0) {
+ if (*Fts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK && bTermWritten == 0 {
// This is a new term. Append a term to the output segment.
fts5WriteAppendTerm(tls, p, bp /* &writer */, *(*int32)(unsafe.Pointer(bp + 112 /* nTerm */)), pTerm)
bTermWritten = 1
@@ -182132,15 +184635,15 @@ func fts5IndexMergeLevel(tls *libc.TLS, p uintptr, ppStruct uintptr, iLvl int32,
if eDetail == FTS5_DETAIL_NONE {
if (*Fts5SegIter)(unsafe.Pointer(pSegIter)).FbDel != 0 {
- sqlite3Fts5BufferAppendVarint(tls, (p + 36 /* &.rc */), (bp /* &writer */ + 4 /* &.writer */ + 8 /* &.buf */), int64(0))
+ sqlite3Fts5BufferAppendVarint(tls, p+36, bp+4+8, int64(0))
if (*Fts5SegIter)(unsafe.Pointer(pSegIter)).FnPos > 0 {
- sqlite3Fts5BufferAppendVarint(tls, (p + 36 /* &.rc */), (bp /* &writer */ + 4 /* &.writer */ + 8 /* &.buf */), int64(0))
+ sqlite3Fts5BufferAppendVarint(tls, p+36, bp+4+8, int64(0))
}
}
} else {
// Append the position-list data to the output
- nPos = (((*Fts5SegIter)(unsafe.Pointer(pSegIter)).FnPos * 2) + int32((*Fts5SegIter)(unsafe.Pointer(pSegIter)).FbDel))
- sqlite3Fts5BufferAppendVarint(tls, (p + 36 /* &.rc */), (bp /* &writer */ + 4 /* &.writer */ + 8 /* &.buf */), int64(nPos))
+ nPos = (*Fts5SegIter)(unsafe.Pointer(pSegIter)).FnPos*2 + int32((*Fts5SegIter)(unsafe.Pointer(pSegIter)).FbDel)
+ sqlite3Fts5BufferAppendVarint(tls, p+36, bp+4+8, int64(nPos))
fts5ChunkIterate(tls, p, pSegIter, bp /* &writer */, *(*uintptr)(unsafe.Pointer(&struct {
f func(*libc.TLS, uintptr, uintptr, uintptr, int32)
}{fts5MergeChunkCallback})))
@@ -182149,9 +184652,9 @@ func fts5IndexMergeLevel(tls *libc.TLS, p uintptr, ppStruct uintptr, iLvl int32,
// Flush the last leaf page to disk. Set the output segment b-tree height
// and last leaf page number at the same time.
- fts5WriteFinish(tls, p, bp /* &writer */, (pSeg + 8 /* &.pgnoLast */))
+ fts5WriteFinish(tls, p, bp /* &writer */, pSeg+8)
- if fts5MultiIterEof(tls, p, *(*uintptr)(unsafe.Pointer(bp + 108 /* pIter */))) != 0 {
+ if fts5MultiIterEof(tls, p, *(*uintptr)(unsafe.Pointer(bp + 108))) != 0 {
var i int32
// Remove the redundant segments from the %_data table
@@ -182161,11 +184664,11 @@ func fts5IndexMergeLevel(tls *libc.TLS, p uintptr, ppStruct uintptr, iLvl int32,
// Remove the redundant segments from the input level
if (*Fts5StructureLevel)(unsafe.Pointer(pLvl)).FnSeg != nInput {
- var nMove int32 = (int32((uint32((*Fts5StructureLevel)(unsafe.Pointer(pLvl)).FnSeg - nInput)) * uint32(unsafe.Sizeof(Fts5StructureSegment{}))))
- libc.Xmemmove(tls, (*Fts5StructureLevel)(unsafe.Pointer(pLvl)).FaSeg, ((*Fts5StructureLevel)(unsafe.Pointer(pLvl)).FaSeg + uintptr(nInput)*12), uint32(nMove))
+ var nMove int32 = int32(uint32((*Fts5StructureLevel)(unsafe.Pointer(pLvl)).FnSeg-nInput) * uint32(unsafe.Sizeof(Fts5StructureSegment{})))
+ libc.Xmemmove(tls, (*Fts5StructureLevel)(unsafe.Pointer(pLvl)).FaSeg, (*Fts5StructureLevel)(unsafe.Pointer(pLvl)).FaSeg+uintptr(nInput)*12, uint32(nMove))
}
- *(*int32)(unsafe.Pointer(pStruct + 16 /* &.nSegment */)) -= (nInput)
- *(*int32)(unsafe.Pointer(pLvl + 4 /* &.nSeg */)) -= (nInput)
+ *(*int32)(unsafe.Pointer(pStruct + 16)) -= nInput
+ *(*int32)(unsafe.Pointer(pLvl + 4)) -= nInput
(*Fts5StructureLevel)(unsafe.Pointer(pLvl)).FnMerge = 0
if (*Fts5StructureSegment)(unsafe.Pointer(pSeg)).FpgnoLast == 0 {
(*Fts5StructureLevel)(unsafe.Pointer(pLvlOut)).FnSeg--
@@ -182180,21 +184683,21 @@ func fts5IndexMergeLevel(tls *libc.TLS, p uintptr, ppStruct uintptr, iLvl int32,
fts5MultiIterFree(tls, *(*uintptr)(unsafe.Pointer(bp + 108 /* pIter */)))
sqlite3Fts5BufferFree(tls, bp+96 /* &term */)
if pnRem != 0 {
- *(*int32)(unsafe.Pointer(pnRem)) -= ((*Fts5SegWriter)(unsafe.Pointer(bp /* &writer */)).FnLeafWritten)
+ *(*int32)(unsafe.Pointer(pnRem)) -= (*Fts5SegWriter)(unsafe.Pointer(bp)).FnLeafWritten
}
}
// Do up to nPg pages of automerge work on the index.
//
// Return true if any changes were actually made, or false otherwise.
-func fts5IndexMerge(tls *libc.TLS, p uintptr, ppStruct uintptr, nPg int32, nMin int32) int32 { /* sqlite3.c:225411:12: */
+func fts5IndexMerge(tls *libc.TLS, p uintptr, ppStruct uintptr, nPg int32, nMin int32) int32 { /* sqlite3.c:227311:12: */
bp := tls.Alloc(8)
defer tls.Free(8)
*(*int32)(unsafe.Pointer(bp + 4 /* nRem */)) = nPg
var bRet int32 = 0
*(*uintptr)(unsafe.Pointer(bp /* pStruct */)) = *(*uintptr)(unsafe.Pointer(ppStruct))
- for (*(*int32)(unsafe.Pointer(bp + 4 /* nRem */)) > 0) && ((*Fts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK) {
+ for *(*int32)(unsafe.Pointer(bp + 4)) > 0 && (*Fts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK {
var iLvl int32 // To iterate through levels
var iBestLvl int32 = 0 // Level offering the most input segments
var nBest int32 = 0 // Number of input segments on best level
@@ -182202,7 +184705,7 @@ func fts5IndexMerge(tls *libc.TLS, p uintptr, ppStruct uintptr, nPg int32, nMin
// Set iBestLvl to the level to read input segments from.
for iLvl = 0; iLvl < (*Fts5Structure)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* pStruct */)))).FnLevel; iLvl++ {
- var pLvl uintptr = ((*(*uintptr)(unsafe.Pointer(bp /* pStruct */)) + 24 /* &.aLevel */) + uintptr(iLvl)*12)
+ var pLvl uintptr = *(*uintptr)(unsafe.Pointer(bp)) + 24 + uintptr(iLvl)*12
if (*Fts5StructureLevel)(unsafe.Pointer(pLvl)).FnMerge != 0 {
if (*Fts5StructureLevel)(unsafe.Pointer(pLvl)).FnMerge > nBest {
iBestLvl = iLvl
@@ -182218,13 +184721,13 @@ func fts5IndexMerge(tls *libc.TLS, p uintptr, ppStruct uintptr, nPg int32, nMin
// If nBest is still 0, then the index must be empty.
- if (nBest < nMin) && ((*Fts5StructureLevel)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(bp /* pStruct */))+24 /* &.aLevel */)+uintptr(iBestLvl)*12)).FnMerge == 0) {
+ if nBest < nMin && (*Fts5StructureLevel)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp))+24+uintptr(iBestLvl)*12)).FnMerge == 0 {
break
}
bRet = 1
fts5IndexMergeLevel(tls, p, bp /* &pStruct */, iBestLvl, bp+4 /* &nRem */)
- if ((*Fts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK) && ((*Fts5StructureLevel)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(bp /* pStruct */))+24 /* &.aLevel */)+uintptr(iBestLvl)*12)).FnMerge == 0) {
- fts5StructurePromote(tls, p, (iBestLvl + 1), *(*uintptr)(unsafe.Pointer(bp /* pStruct */)))
+ if (*Fts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK && (*Fts5StructureLevel)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp))+24+uintptr(iBestLvl)*12)).FnMerge == 0 {
+ fts5StructurePromote(tls, p, iBestLvl+1, *(*uintptr)(unsafe.Pointer(bp /* pStruct */)))
}
}
*(*uintptr)(unsafe.Pointer(ppStruct)) = *(*uintptr)(unsafe.Pointer(bp /* pStruct */))
@@ -182237,8 +184740,8 @@ func fts5IndexMerge(tls *libc.TLS, p uintptr, ppStruct uintptr, nPg int32, nMin
//
// If an error occurs, set the Fts5Index.rc error code. If an error has
// already occurred, this function is a no-op.
-func fts5IndexAutomerge(tls *libc.TLS, p uintptr, ppStruct uintptr, nLeaf int32) { /* sqlite3.c:225470:13: */
- if ((*Fts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK) && ((*Fts5Config)(unsafe.Pointer((*Fts5Index)(unsafe.Pointer(p)).FpConfig)).FnAutomerge > 0) {
+func fts5IndexAutomerge(tls *libc.TLS, p uintptr, ppStruct uintptr, nLeaf int32) { /* sqlite3.c:227370:13: */
+ if (*Fts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK && (*Fts5Config)(unsafe.Pointer((*Fts5Index)(unsafe.Pointer(p)).FpConfig)).FnAutomerge > 0 && *(*uintptr)(unsafe.Pointer(ppStruct)) != uintptr(0) {
var pStruct uintptr = *(*uintptr)(unsafe.Pointer(ppStruct))
var nWrite U64 // Initial value of write-counter
var nWork int32 // Number of work-quanta to perform
@@ -182246,15 +184749,15 @@ func fts5IndexAutomerge(tls *libc.TLS, p uintptr, ppStruct uintptr, nLeaf int32)
// Update the write-counter. While doing so, set nWork.
nWrite = (*Fts5Structure)(unsafe.Pointer(pStruct)).FnWriteCounter
- nWork = (int32(((nWrite + U64(nLeaf)) / U64((*Fts5Index)(unsafe.Pointer(p)).FnWorkUnit)) - (nWrite / U64((*Fts5Index)(unsafe.Pointer(p)).FnWorkUnit))))
- *(*U64)(unsafe.Pointer(pStruct + 8 /* &.nWriteCounter */)) += (U64(nLeaf))
- nRem = (((*Fts5Index)(unsafe.Pointer(p)).FnWorkUnit * nWork) * (*Fts5Structure)(unsafe.Pointer(pStruct)).FnLevel)
+ nWork = int32((nWrite+U64(nLeaf))/U64((*Fts5Index)(unsafe.Pointer(p)).FnWorkUnit) - nWrite/U64((*Fts5Index)(unsafe.Pointer(p)).FnWorkUnit))
+ *(*U64)(unsafe.Pointer(pStruct + 8)) += U64(nLeaf)
+ nRem = (*Fts5Index)(unsafe.Pointer(p)).FnWorkUnit * nWork * (*Fts5Structure)(unsafe.Pointer(pStruct)).FnLevel
fts5IndexMerge(tls, p, ppStruct, nRem, (*Fts5Config)(unsafe.Pointer((*Fts5Index)(unsafe.Pointer(p)).FpConfig)).FnAutomerge)
}
}
-func fts5IndexCrisismerge(tls *libc.TLS, p uintptr, ppStruct uintptr) { /* sqlite3.c:225491:13: */
+func fts5IndexCrisismerge(tls *libc.TLS, p uintptr, ppStruct uintptr) { /* sqlite3.c:227391:13: */
bp := tls.Alloc(4)
defer tls.Free(4)
@@ -182262,16 +184765,16 @@ func fts5IndexCrisismerge(tls *libc.TLS, p uintptr, ppStruct uintptr) { /* sqlit
*(*uintptr)(unsafe.Pointer(bp /* pStruct */)) = *(*uintptr)(unsafe.Pointer(ppStruct))
var iLvl int32 = 0
- for ((*Fts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK) && ((*Fts5StructureLevel)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(bp /* pStruct */))+24 /* &.aLevel */)+uintptr(iLvl)*12)).FnSeg >= nCrisis) {
+ for (*Fts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK && (*Fts5StructureLevel)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp))+24+uintptr(iLvl)*12)).FnSeg >= nCrisis {
fts5IndexMergeLevel(tls, p, bp /* &pStruct */, iLvl, uintptr(0))
- fts5StructurePromote(tls, p, (iLvl + 1), *(*uintptr)(unsafe.Pointer(bp /* pStruct */)))
+ fts5StructurePromote(tls, p, iLvl+1, *(*uintptr)(unsafe.Pointer(bp /* pStruct */)))
iLvl++
}
*(*uintptr)(unsafe.Pointer(ppStruct)) = *(*uintptr)(unsafe.Pointer(bp /* pStruct */))
}
-func fts5IndexReturn(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:225509:12: */
+func fts5IndexReturn(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:227409:12: */
var rc int32 = (*Fts5Index)(unsafe.Pointer(p)).Frc
(*Fts5Index)(unsafe.Pointer(p)).Frc = SQLITE_OK
return rc
@@ -182281,14 +184784,14 @@ type Fts5FlushCtx1 = struct {
FpIdx uintptr
F__ccgo_pad1 [4]byte
Fwriter Fts5SegWriter
-} /* sqlite3.c:225515:9 */
+} /* sqlite3.c:227415:9 */
-type Fts5FlushCtx = Fts5FlushCtx1 /* sqlite3.c:225515:29 */
+type Fts5FlushCtx = Fts5FlushCtx1 /* sqlite3.c:227415:29 */
// Buffer aBuf[] contains a list of varints, all small enough to fit
// in a 32-bit integer. Return the size of the largest prefix of this
// list nMax bytes or less in size.
-func fts5PoslistPrefix(tls *libc.TLS, aBuf uintptr, nMax int32) int32 { /* sqlite3.c:225526:12: */
+func fts5PoslistPrefix(tls *libc.TLS, aBuf uintptr, nMax int32) int32 { /* sqlite3.c:227426:12: */
bp := tls.Alloc(4)
defer tls.Free(4)
@@ -182298,11 +184801,11 @@ func fts5PoslistPrefix(tls *libc.TLS, aBuf uintptr, nMax int32) int32 { /* sqlit
ret = sqlite3Fts5GetVarint32(tls, aBuf, bp /* &dummy */)
if ret < nMax {
for 1 != 0 {
- var i int32 = sqlite3Fts5GetVarint32(tls, (aBuf + uintptr(ret)), bp /* &dummy */)
- if (ret + i) > nMax {
+ var i int32 = sqlite3Fts5GetVarint32(tls, aBuf+uintptr(ret), bp /* &dummy */)
+ if ret+i > nMax {
break
}
- ret = ret + (i)
+ ret = ret + i
}
}
return ret
@@ -182313,7 +184816,7 @@ func fts5PoslistPrefix(tls *libc.TLS, aBuf uintptr, nMax int32) int32 { /* sqlit
//
// If an error occurs, set the Fts5Index.rc error code. If an error has
// already occurred, this function is a no-op.
-func fts5FlushOneHash(tls *libc.TLS, p uintptr) { /* sqlite3.c:225547:13: */
+func fts5FlushOneHash(tls *libc.TLS, p uintptr) { /* sqlite3.c:227447:13: */
bp := tls.Alloc(136)
defer tls.Free(136)
@@ -182340,8 +184843,8 @@ func fts5FlushOneHash(tls *libc.TLS, p uintptr) { /* sqlite3.c:225547:13: */
fts5WriteInit(tls, p, bp /* &writer */, iSegid)
- pBuf = (bp /* &writer */ + 4 /* &.writer */ + 8 /* &.buf */)
- pPgidx = (bp /* &writer */ + 4 /* &.writer */ + 20 /* &.pgidx */)
+ pBuf = bp + 4 + 8
+ pPgidx = bp + 4 + 20
// fts5WriteInit() should have initialized the buffers to (most likely)
// the maximum space required.
@@ -182351,7 +184854,7 @@ func fts5FlushOneHash(tls *libc.TLS, p uintptr) { /* sqlite3.c:225547:13: */
if (*Fts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK {
(*Fts5Index)(unsafe.Pointer(p)).Frc = sqlite3Fts5HashScanInit(tls, pHash, uintptr(0), 0)
}
- for ((*Fts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK) && (0 == sqlite3Fts5HashScanEof(tls, pHash)) {
+ for (*Fts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK && 0 == sqlite3Fts5HashScanEof(tls, pHash) {
// var zTerm uintptr at bp+96, 4
// Buffer containing term
// var pDoclist uintptr at bp+100, 4
@@ -182366,11 +184869,11 @@ func fts5FlushOneHash(tls *libc.TLS, p uintptr) { /* sqlite3.c:225547:13: */
break
}
- if pgsz >= ((((*Fts5Buffer)(unsafe.Pointer(pBuf)).Fn + (*Fts5Buffer)(unsafe.Pointer(pPgidx)).Fn) + *(*int32)(unsafe.Pointer(bp + 104 /* nDoclist */))) + 1) {
+ if pgsz >= (*Fts5Buffer)(unsafe.Pointer(pBuf)).Fn+(*Fts5Buffer)(unsafe.Pointer(pPgidx)).Fn+*(*int32)(unsafe.Pointer(bp + 104))+1 {
/* The entire doclist will fit on the current leaf. */
{
- libc.Xmemcpy(tls, ((*Fts5Buffer)(unsafe.Pointer((pBuf))).Fp + uintptr((*Fts5Buffer)(unsafe.Pointer((pBuf))).Fn)), *(*uintptr)(unsafe.Pointer(bp + 100 /* pDoclist */)), uint32(*(*int32)(unsafe.Pointer(bp + 104 /* nDoclist */))))
- *(*int32)(unsafe.Pointer(pBuf + 4 /* &.n */)) += (*(*int32)(unsafe.Pointer(bp + 104 /* nDoclist */)))
+ libc.Xmemcpy(tls, (*Fts5Buffer)(unsafe.Pointer(pBuf)).Fp+uintptr((*Fts5Buffer)(unsafe.Pointer(pBuf)).Fn), *(*uintptr)(unsafe.Pointer(bp + 100 /* pDoclist */)), uint32(*(*int32)(unsafe.Pointer(bp + 104 /* nDoclist */))))
+ *(*int32)(unsafe.Pointer(pBuf + 4)) += *(*int32)(unsafe.Pointer(bp + 104))
}
} else {
@@ -182381,32 +184884,32 @@ func fts5FlushOneHash(tls *libc.TLS, p uintptr) { /* sqlite3.c:225547:13: */
// The entire doclist will not fit on this leaf. The following
// loop iterates through the poslists that make up the current
// doclist.
- for ((*Fts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK) && (iOff < *(*int32)(unsafe.Pointer(bp + 104 /* nDoclist */))) {
- iOff = iOff + (int32(sqlite3Fts5GetVarint(tls, (*(*uintptr)(unsafe.Pointer(bp + 100 /* pDoclist */)) + uintptr(iOff)), bp+112 /* &iDelta */)))
- iRowid = I64(U64(iRowid) + (*(*U64)(unsafe.Pointer(bp + 112 /* iDelta */))))
+ for (*Fts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK && iOff < *(*int32)(unsafe.Pointer(bp + 104)) {
+ iOff = iOff + int32(sqlite3Fts5GetVarint(tls, *(*uintptr)(unsafe.Pointer(bp + 100))+uintptr(iOff), bp+112))
+ iRowid = I64(U64(iRowid) + *(*U64)(unsafe.Pointer(bp + 112)))
- if (*Fts5SegWriter)(unsafe.Pointer(bp /* &writer */)).FbFirstRowidInPage != 0 {
- fts5PutU16(tls, ((*Fts5Buffer)(unsafe.Pointer(pBuf)).Fp), U16((*Fts5Buffer)(unsafe.Pointer(pBuf)).Fn)) // first rowid on page
- *(*int32)(unsafe.Pointer(pBuf + 4 /* &.n */)) += (sqlite3Fts5PutVarint(tls, ((*Fts5Buffer)(unsafe.Pointer(pBuf)).Fp + uintptr((*Fts5Buffer)(unsafe.Pointer(pBuf)).Fn)), uint64(iRowid)))
+ if (*Fts5SegWriter)(unsafe.Pointer(bp)).FbFirstRowidInPage != 0 {
+ fts5PutU16(tls, (*Fts5Buffer)(unsafe.Pointer(pBuf)).Fp, U16((*Fts5Buffer)(unsafe.Pointer(pBuf)).Fn)) // first rowid on page
+ *(*int32)(unsafe.Pointer(pBuf + 4)) += sqlite3Fts5PutVarint(tls, (*Fts5Buffer)(unsafe.Pointer(pBuf)).Fp+uintptr((*Fts5Buffer)(unsafe.Pointer(pBuf)).Fn), uint64(iRowid))
(*Fts5SegWriter)(unsafe.Pointer(bp /* &writer */)).FbFirstRowidInPage = U8(0)
fts5WriteDlidxAppend(tls, p, bp /* &writer */, iRowid)
if (*Fts5Index)(unsafe.Pointer(p)).Frc != SQLITE_OK {
break
}
} else {
- *(*int32)(unsafe.Pointer(pBuf + 4 /* &.n */)) += (sqlite3Fts5PutVarint(tls, ((*Fts5Buffer)(unsafe.Pointer(pBuf)).Fp + uintptr((*Fts5Buffer)(unsafe.Pointer(pBuf)).Fn)), *(*U64)(unsafe.Pointer(bp + 112 /* iDelta */))))
+ *(*int32)(unsafe.Pointer(pBuf + 4)) += sqlite3Fts5PutVarint(tls, (*Fts5Buffer)(unsafe.Pointer(pBuf)).Fp+uintptr((*Fts5Buffer)(unsafe.Pointer(pBuf)).Fn), *(*U64)(unsafe.Pointer(bp + 112)))
}
if eDetail == FTS5_DETAIL_NONE {
- if (iOff < *(*int32)(unsafe.Pointer(bp + 104 /* nDoclist */))) && (int32(*(*U8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 100 /* pDoclist */)) + uintptr(iOff)))) == 0) {
+ if iOff < *(*int32)(unsafe.Pointer(bp + 104)) && int32(*(*U8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 100)) + uintptr(iOff)))) == 0 {
*(*U8)(unsafe.Pointer((*Fts5Buffer)(unsafe.Pointer(pBuf)).Fp + uintptr(libc.PostIncInt32(&(*Fts5Buffer)(unsafe.Pointer(pBuf)).Fn, 1)))) = U8(0)
iOff++
- if (iOff < *(*int32)(unsafe.Pointer(bp + 104 /* nDoclist */))) && (int32(*(*U8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 100 /* pDoclist */)) + uintptr(iOff)))) == 0) {
+ if iOff < *(*int32)(unsafe.Pointer(bp + 104)) && int32(*(*U8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 100)) + uintptr(iOff)))) == 0 {
*(*U8)(unsafe.Pointer((*Fts5Buffer)(unsafe.Pointer(pBuf)).Fp + uintptr(libc.PostIncInt32(&(*Fts5Buffer)(unsafe.Pointer(pBuf)).Fn, 1)))) = U8(0)
iOff++
}
}
- if ((*Fts5Buffer)(unsafe.Pointer(pBuf)).Fn + (*Fts5Buffer)(unsafe.Pointer(pPgidx)).Fn) >= pgsz {
+ if (*Fts5Buffer)(unsafe.Pointer(pBuf)).Fn+(*Fts5Buffer)(unsafe.Pointer(pPgidx)).Fn >= pgsz {
fts5WriteFlushLeaf(tls, p, bp /* &writer */)
}
} else {
@@ -182414,38 +184917,38 @@ func fts5FlushOneHash(tls *libc.TLS, p uintptr) { /* sqlite3.c:225547:13: */
// var nPos int32 at bp+120, 4
- var nCopy int32 = fts5GetPoslistSize(tls, (*(*uintptr)(unsafe.Pointer(bp + 100 /* pDoclist */)) + uintptr(iOff)), bp+120 /* &nPos */, bp+124 /* &bDummy */)
- nCopy = nCopy + (*(*int32)(unsafe.Pointer(bp + 120 /* nPos */)))
- if (((*Fts5Buffer)(unsafe.Pointer(pBuf)).Fn + (*Fts5Buffer)(unsafe.Pointer(pPgidx)).Fn) + nCopy) <= pgsz {
+ var nCopy int32 = fts5GetPoslistSize(tls, *(*uintptr)(unsafe.Pointer(bp + 100))+uintptr(iOff), bp+120 /* &nPos */, bp+124 /* &bDummy */)
+ nCopy = nCopy + *(*int32)(unsafe.Pointer(bp + 120))
+ if (*Fts5Buffer)(unsafe.Pointer(pBuf)).Fn+(*Fts5Buffer)(unsafe.Pointer(pPgidx)).Fn+nCopy <= pgsz {
/* The entire poslist will fit on the current leaf. So copy
** it in one go. */
{
- libc.Xmemcpy(tls, ((*Fts5Buffer)(unsafe.Pointer((pBuf))).Fp + uintptr((*Fts5Buffer)(unsafe.Pointer((pBuf))).Fn)), (*(*uintptr)(unsafe.Pointer(bp + 100 /* pDoclist */)) + uintptr(iOff)), uint32(nCopy))
- *(*int32)(unsafe.Pointer(pBuf + 4 /* &.n */)) += (nCopy)
+ libc.Xmemcpy(tls, (*Fts5Buffer)(unsafe.Pointer(pBuf)).Fp+uintptr((*Fts5Buffer)(unsafe.Pointer(pBuf)).Fn), *(*uintptr)(unsafe.Pointer(bp + 100))+uintptr(iOff), uint32(nCopy))
+ *(*int32)(unsafe.Pointer(pBuf + 4)) += nCopy
}
} else {
// The entire poslist will not fit on this leaf. So it needs
// to be broken into sections. The only qualification being
// that each varint must be stored contiguously.
- var pPoslist uintptr = (*(*uintptr)(unsafe.Pointer(bp + 100 /* pDoclist */)) + uintptr(iOff))
+ var pPoslist uintptr = *(*uintptr)(unsafe.Pointer(bp + 100)) + uintptr(iOff)
var iPos int32 = 0
for (*Fts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK {
- var nSpace int32 = ((pgsz - (*Fts5Buffer)(unsafe.Pointer(pBuf)).Fn) - (*Fts5Buffer)(unsafe.Pointer(pPgidx)).Fn)
+ var nSpace int32 = pgsz - (*Fts5Buffer)(unsafe.Pointer(pBuf)).Fn - (*Fts5Buffer)(unsafe.Pointer(pPgidx)).Fn
var n int32 = 0
- if (nCopy - iPos) <= nSpace {
- n = (nCopy - iPos)
+ if nCopy-iPos <= nSpace {
+ n = nCopy - iPos
} else {
- n = fts5PoslistPrefix(tls, (pPoslist + uintptr(iPos)), nSpace)
+ n = fts5PoslistPrefix(tls, pPoslist+uintptr(iPos), nSpace)
}
{
- libc.Xmemcpy(tls, ((*Fts5Buffer)(unsafe.Pointer((pBuf))).Fp + uintptr((*Fts5Buffer)(unsafe.Pointer((pBuf))).Fn)), (pPoslist + uintptr(iPos)), uint32(n))
- *(*int32)(unsafe.Pointer(pBuf + 4 /* &.n */)) += (n)
+ libc.Xmemcpy(tls, (*Fts5Buffer)(unsafe.Pointer(pBuf)).Fp+uintptr((*Fts5Buffer)(unsafe.Pointer(pBuf)).Fn), pPoslist+uintptr(iPos), uint32(n))
+ *(*int32)(unsafe.Pointer(pBuf + 4)) += n
}
- iPos = iPos + (n)
- if ((*Fts5Buffer)(unsafe.Pointer(pBuf)).Fn + (*Fts5Buffer)(unsafe.Pointer(pPgidx)).Fn) >= pgsz {
+ iPos = iPos + n
+ if (*Fts5Buffer)(unsafe.Pointer(pBuf)).Fn+(*Fts5Buffer)(unsafe.Pointer(pPgidx)).Fn >= pgsz {
fts5WriteFlushLeaf(tls, p, bp /* &writer */)
}
if iPos >= nCopy {
@@ -182453,7 +184956,7 @@ func fts5FlushOneHash(tls *libc.TLS, p uintptr) { /* sqlite3.c:225547:13: */
}
}
}
- iOff = iOff + (nCopy)
+ iOff = iOff + nCopy
}
}
}
@@ -182470,12 +184973,12 @@ func fts5FlushOneHash(tls *libc.TLS, p uintptr) { /* sqlite3.c:225547:13: */
// Update the Fts5Structure. It is written back to the database by the
// fts5StructureRelease() call below.
- if (*Fts5Structure)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 132 /* pStruct */)))).FnLevel == 0 {
- fts5StructureAddLevel(tls, (p + 36 /* &.rc */), bp+132 /* &pStruct */)
+ if (*Fts5Structure)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 132)))).FnLevel == 0 {
+ fts5StructureAddLevel(tls, p+36, bp+132 /* &pStruct */)
}
- fts5StructureExtendLevel(tls, (p + 36 /* &.rc */), *(*uintptr)(unsafe.Pointer(bp + 132 /* pStruct */)), 0, 1, 0)
+ fts5StructureExtendLevel(tls, p+36, *(*uintptr)(unsafe.Pointer(bp + 132 /* pStruct */)), 0, 1, 0)
if (*Fts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK {
- pSeg = ((*Fts5StructureLevel)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(bp + 132 /* pStruct */)) + 24 /* &.aLevel */))).FaSeg + uintptr(libc.PostIncInt32(&(*Fts5StructureLevel)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(bp + 132 /* pStruct */))+24 /* &.aLevel */))).FnSeg, 1))*12)
+ pSeg = (*Fts5StructureLevel)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 132))+24)).FaSeg + uintptr(libc.PostIncInt32(&(*Fts5StructureLevel)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 132))+24)).FnSeg, 1))*12
(*Fts5StructureSegment)(unsafe.Pointer(pSeg)).FiSegid = iSegid
(*Fts5StructureSegment)(unsafe.Pointer(pSeg)).FpgnoFirst = 1
(*Fts5StructureSegment)(unsafe.Pointer(pSeg)).FpgnoLast = *(*int32)(unsafe.Pointer(bp + 128 /* pgnoLast */))
@@ -182491,7 +184994,7 @@ func fts5FlushOneHash(tls *libc.TLS, p uintptr) { /* sqlite3.c:225547:13: */
}
// Flush any data stored in the in-memory hash tables to the database.
-func fts5IndexFlush(tls *libc.TLS, p uintptr) { /* sqlite3.c:225701:13: */
+func fts5IndexFlush(tls *libc.TLS, p uintptr) { /* sqlite3.c:227601:13: */
// Unless it is empty, flush the hash table to disk
if (*Fts5Index)(unsafe.Pointer(p)).FnPendingData != 0 {
@@ -182500,7 +185003,7 @@ func fts5IndexFlush(tls *libc.TLS, p uintptr) { /* sqlite3.c:225701:13: */
}
}
-func fts5IndexOptimizeStruct(tls *libc.TLS, p uintptr, pStruct uintptr) uintptr { /* sqlite3.c:225710:22: */
+func fts5IndexOptimizeStruct(tls *libc.TLS, p uintptr, pStruct uintptr) uintptr { /* sqlite3.c:227610:22: */
var pNew uintptr = uintptr(0)
var nByte Sqlite3_int64 = Sqlite3_int64(unsafe.Sizeof(Fts5Structure{}))
var nSeg int32 = (*Fts5Structure)(unsafe.Pointer(pStruct)).FnSegment
@@ -182519,25 +185022,25 @@ func fts5IndexOptimizeStruct(tls *libc.TLS, p uintptr, pStruct uintptr) uintptr
return uintptr(0)
}
for i = 0; i < (*Fts5Structure)(unsafe.Pointer(pStruct)).FnLevel; i++ {
- var nThis int32 = (*Fts5StructureLevel)(unsafe.Pointer((pStruct + 24 /* &.aLevel */) + uintptr(i)*12)).FnSeg
- if (nThis == nSeg) || ((nThis == (nSeg - 1)) && ((*Fts5StructureLevel)(unsafe.Pointer((pStruct+24 /* &.aLevel */)+uintptr(i)*12)).FnMerge == nThis)) {
+ var nThis int32 = (*Fts5StructureLevel)(unsafe.Pointer(pStruct + 24 + uintptr(i)*12)).FnSeg
+ if nThis == nSeg || nThis == nSeg-1 && (*Fts5StructureLevel)(unsafe.Pointer(pStruct+24+uintptr(i)*12)).FnMerge == nThis {
fts5StructureRef(tls, pStruct)
return pStruct
}
}
- nByte = nByte + (Sqlite3_int64((uint32((*Fts5Structure)(unsafe.Pointer(pStruct)).FnLevel + 1)) * uint32(unsafe.Sizeof(Fts5StructureLevel{}))))
- pNew = sqlite3Fts5MallocZero(tls, (p + 36 /* &.rc */), nByte)
+ nByte = nByte + Sqlite3_int64(uint32((*Fts5Structure)(unsafe.Pointer(pStruct)).FnLevel+1)*uint32(unsafe.Sizeof(Fts5StructureLevel{})))
+ pNew = sqlite3Fts5MallocZero(tls, p+36, nByte)
if pNew != 0 {
var pLvl uintptr
- nByte = (Sqlite3_int64(uint32(nSeg) * uint32(unsafe.Sizeof(Fts5StructureSegment{}))))
- (*Fts5Structure)(unsafe.Pointer(pNew)).FnLevel = ((*Fts5Structure)(unsafe.Pointer(pStruct)).FnLevel + 1)
+ nByte = Sqlite3_int64(uint32(nSeg) * uint32(unsafe.Sizeof(Fts5StructureSegment{})))
+ (*Fts5Structure)(unsafe.Pointer(pNew)).FnLevel = (*Fts5Structure)(unsafe.Pointer(pStruct)).FnLevel + 1
(*Fts5Structure)(unsafe.Pointer(pNew)).FnRef = 1
(*Fts5Structure)(unsafe.Pointer(pNew)).FnWriteCounter = (*Fts5Structure)(unsafe.Pointer(pStruct)).FnWriteCounter
- pLvl = ((pNew + 24 /* &.aLevel */) + uintptr((*Fts5Structure)(unsafe.Pointer(pStruct)).FnLevel)*12)
- (*Fts5StructureLevel)(unsafe.Pointer(pLvl)).FaSeg = sqlite3Fts5MallocZero(tls, (p + 36 /* &.rc */), nByte)
+ pLvl = pNew + 24 + uintptr((*Fts5Structure)(unsafe.Pointer(pStruct)).FnLevel)*12
+ (*Fts5StructureLevel)(unsafe.Pointer(pLvl)).FaSeg = sqlite3Fts5MallocZero(tls, p+36, nByte)
if (*Fts5StructureLevel)(unsafe.Pointer(pLvl)).FaSeg != 0 {
var iLvl int32
var iSeg int32
@@ -182545,13 +185048,13 @@ func fts5IndexOptimizeStruct(tls *libc.TLS, p uintptr, pStruct uintptr) uintptr
// Iterate through all segments, from oldest to newest. Add them to
// the new Fts5Level object so that pLvl->aSeg[0] is the oldest
// segment in the data structure.
- for iLvl = ((*Fts5Structure)(unsafe.Pointer(pStruct)).FnLevel - 1); iLvl >= 0; iLvl-- {
- for iSeg = 0; iSeg < (*Fts5StructureLevel)(unsafe.Pointer((pStruct+24 /* &.aLevel */)+uintptr(iLvl)*12)).FnSeg; iSeg++ {
- *(*Fts5StructureSegment)(unsafe.Pointer((*Fts5StructureLevel)(unsafe.Pointer(pLvl)).FaSeg + uintptr(iSegOut)*12)) = *(*Fts5StructureSegment)(unsafe.Pointer((*Fts5StructureLevel)(unsafe.Pointer((pStruct+24 /* &.aLevel */)+uintptr(iLvl)*12)).FaSeg + uintptr(iSeg)*12))
+ for iLvl = (*Fts5Structure)(unsafe.Pointer(pStruct)).FnLevel - 1; iLvl >= 0; iLvl-- {
+ for iSeg = 0; iSeg < (*Fts5StructureLevel)(unsafe.Pointer(pStruct+24 /* &.aLevel */ +uintptr(iLvl)*12)).FnSeg; iSeg++ {
+ *(*Fts5StructureSegment)(unsafe.Pointer((*Fts5StructureLevel)(unsafe.Pointer(pLvl)).FaSeg + uintptr(iSegOut)*12)) = *(*Fts5StructureSegment)(unsafe.Pointer((*Fts5StructureLevel)(unsafe.Pointer(pStruct+24+uintptr(iLvl)*12)).FaSeg + uintptr(iSeg)*12))
iSegOut++
}
}
- (*Fts5Structure)(unsafe.Pointer(pNew)).FnSegment = libc.AssignPtrInt32(pLvl+4 /* &.nSeg */, nSeg)
+ (*Fts5Structure)(unsafe.Pointer(pNew)).FnSegment = libc.AssignPtrInt32(pLvl+4, nSeg)
} else {
Xsqlite3_free(tls, pNew)
pNew = uintptr(0)
@@ -182561,7 +185064,7 @@ func fts5IndexOptimizeStruct(tls *libc.TLS, p uintptr, pStruct uintptr) uintptr
return pNew
}
-func sqlite3Fts5IndexOptimize(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:225772:12: */
+func sqlite3Fts5IndexOptimize(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:227672:12: */
bp := tls.Alloc(8)
defer tls.Free(8)
@@ -182577,11 +185080,11 @@ func sqlite3Fts5IndexOptimize(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:225
}
fts5StructureRelease(tls, pStruct)
- if *(*uintptr)(unsafe.Pointer(bp /* pNew */)) != 0 {
+ if *(*uintptr)(unsafe.Pointer(bp)) != 0 {
var iLvl int32
- for iLvl = 0; (*Fts5StructureLevel)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(bp /* pNew */))+24 /* &.aLevel */)+uintptr(iLvl)*12)).FnSeg == 0; iLvl++ {
+ for iLvl = 0; (*Fts5StructureLevel)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* pNew */))+24 /* &.aLevel */ +uintptr(iLvl)*12)).FnSeg == 0; iLvl++ {
}
- for ((*Fts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK) && ((*Fts5StructureLevel)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(bp /* pNew */))+24 /* &.aLevel */)+uintptr(iLvl)*12)).FnSeg > 0) {
+ for (*Fts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK && (*Fts5StructureLevel)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp))+24+uintptr(iLvl)*12)).FnSeg > 0 {
*(*int32)(unsafe.Pointer(bp + 4 /* nRem */)) = FTS5_OPT_WORK_UNIT
fts5IndexMergeLevel(tls, p, bp /* &pNew */, iLvl, bp+4 /* &nRem */)
}
@@ -182595,12 +185098,12 @@ func sqlite3Fts5IndexOptimize(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:225
// This is called to implement the special "VALUES('merge', $nMerge)"
// INSERT command.
-func sqlite3Fts5IndexMerge(tls *libc.TLS, p uintptr, nMerge int32) int32 { /* sqlite3.c:225806:12: */
+func sqlite3Fts5IndexMerge(tls *libc.TLS, p uintptr, nMerge int32) int32 { /* sqlite3.c:227706:12: */
bp := tls.Alloc(4)
defer tls.Free(4)
*(*uintptr)(unsafe.Pointer(bp /* pStruct */)) = fts5StructureRead(tls, p)
- if *(*uintptr)(unsafe.Pointer(bp /* pStruct */)) != 0 {
+ if *(*uintptr)(unsafe.Pointer(bp)) != 0 {
var nMin int32 = (*Fts5Config)(unsafe.Pointer((*Fts5Index)(unsafe.Pointer(p)).FpConfig)).FnUsermerge
fts5StructureInvalidate(tls, p)
if nMerge < 0 {
@@ -182608,10 +185111,10 @@ func sqlite3Fts5IndexMerge(tls *libc.TLS, p uintptr, nMerge int32) int32 { /* sq
fts5StructureRelease(tls, *(*uintptr)(unsafe.Pointer(bp /* pStruct */)))
*(*uintptr)(unsafe.Pointer(bp /* pStruct */)) = pNew
nMin = 2
- nMerge = (nMerge * -1)
+ nMerge = nMerge * -1
}
- if (*(*uintptr)(unsafe.Pointer(bp /* pStruct */)) != 0) && ((*Fts5Structure)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* pStruct */)))).FnLevel != 0) {
- if fts5IndexMerge(tls, p, bp /* &pStruct */, nMerge, nMin) != 0 {
+ if *(*uintptr)(unsafe.Pointer(bp)) != 0 && (*Fts5Structure)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FnLevel != 0 {
+ if fts5IndexMerge(tls, p, bp, nMerge, nMin) != 0 {
fts5StructureWrite(tls, p, *(*uintptr)(unsafe.Pointer(bp /* pStruct */)))
}
}
@@ -182620,43 +185123,43 @@ func sqlite3Fts5IndexMerge(tls *libc.TLS, p uintptr, nMerge int32) int32 { /* sq
return fts5IndexReturn(tls, p)
}
-func fts5AppendRowid(tls *libc.TLS, p uintptr, iDelta I64, pUnused uintptr, pBuf uintptr) { /* sqlite3.c:225828:13: */
+func fts5AppendRowid(tls *libc.TLS, p uintptr, iDelta I64, pUnused uintptr, pBuf uintptr) { /* sqlite3.c:227728:13: */
_ = pUnused
- sqlite3Fts5BufferAppendVarint(tls, (p + 36 /* &.rc */), pBuf, iDelta)
+ sqlite3Fts5BufferAppendVarint(tls, p+36, pBuf, iDelta)
}
-func fts5AppendPoslist(tls *libc.TLS, p uintptr, iDelta I64, pMulti uintptr, pBuf uintptr) { /* sqlite3.c:225838:13: */
+func fts5AppendPoslist(tls *libc.TLS, p uintptr, iDelta I64, pMulti uintptr, pBuf uintptr) { /* sqlite3.c:227738:13: */
var nData int32 = (*Fts5Iter)(unsafe.Pointer(pMulti)).Fbase.FnData
- var nByte int32 = (((nData + 9) + 9) + FTS5_DATA_ZERO_PADDING)
+ var nByte int32 = nData + 9 + 9 + FTS5_DATA_ZERO_PADDING
- if ((*Fts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK) && (0 == (func() int32 {
- if ((U32((*Fts5Buffer)(unsafe.Pointer(pBuf)).Fn)) + (U32(nByte))) <= (U32((*Fts5Buffer)(unsafe.Pointer(pBuf)).FnSpace)) {
+ if (*Fts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK && 0 == func() int32 {
+ if U32((*Fts5Buffer)(unsafe.Pointer(pBuf)).Fn)+U32(nByte) <= U32((*Fts5Buffer)(unsafe.Pointer(pBuf)).FnSpace) {
return 0
}
- return sqlite3Fts5BufferSize(tls, (p + 36 /* &.rc */), pBuf, (uint32((nByte) + (*Fts5Buffer)(unsafe.Pointer((pBuf))).Fn)))
- }())) {
+ return sqlite3Fts5BufferSize(tls, p+36, pBuf, uint32(nByte+(*Fts5Buffer)(unsafe.Pointer(pBuf)).Fn))
+ }() {
{
- *(*int32)(unsafe.Pointer(pBuf + 4 /* &.n */)) += (sqlite3Fts5PutVarint(tls, ((*Fts5Buffer)(unsafe.Pointer((pBuf))).Fp + uintptr((*Fts5Buffer)(unsafe.Pointer((pBuf))).Fn)), uint64(iDelta)))
+ *(*int32)(unsafe.Pointer(pBuf + 4)) += sqlite3Fts5PutVarint(tls, (*Fts5Buffer)(unsafe.Pointer(pBuf)).Fp+uintptr((*Fts5Buffer)(unsafe.Pointer(pBuf)).Fn), uint64(iDelta))
}
{
- *(*int32)(unsafe.Pointer(pBuf + 4 /* &.n */)) += (sqlite3Fts5PutVarint(tls, ((*Fts5Buffer)(unsafe.Pointer((pBuf))).Fp + uintptr((*Fts5Buffer)(unsafe.Pointer((pBuf))).Fn)), (uint64(nData * 2))))
+ *(*int32)(unsafe.Pointer(pBuf + 4)) += sqlite3Fts5PutVarint(tls, (*Fts5Buffer)(unsafe.Pointer(pBuf)).Fp+uintptr((*Fts5Buffer)(unsafe.Pointer(pBuf)).Fn), uint64(nData*2))
}
{
- libc.Xmemcpy(tls, ((*Fts5Buffer)(unsafe.Pointer((pBuf))).Fp + uintptr((*Fts5Buffer)(unsafe.Pointer((pBuf))).Fn)), (*Fts5Iter)(unsafe.Pointer(pMulti)).Fbase.FpData, uint32(nData))
- *(*int32)(unsafe.Pointer(pBuf + 4 /* &.n */)) += (nData)
+ libc.Xmemcpy(tls, (*Fts5Buffer)(unsafe.Pointer(pBuf)).Fp+uintptr((*Fts5Buffer)(unsafe.Pointer(pBuf)).Fn), (*Fts5Iter)(unsafe.Pointer(pMulti)).Fbase.FpData, uint32(nData))
+ *(*int32)(unsafe.Pointer(pBuf + 4)) += nData
}
- libc.Xmemset(tls, ((*Fts5Buffer)(unsafe.Pointer(pBuf)).Fp + uintptr((*Fts5Buffer)(unsafe.Pointer(pBuf)).Fn)), 0, uint32(FTS5_DATA_ZERO_PADDING))
+ libc.Xmemset(tls, (*Fts5Buffer)(unsafe.Pointer(pBuf)).Fp+uintptr((*Fts5Buffer)(unsafe.Pointer(pBuf)).Fn), 0, uint32(FTS5_DATA_ZERO_PADDING))
}
}
-func fts5DoclistIterNext(tls *libc.TLS, pIter uintptr) { /* sqlite3.c:225856:13: */
+func fts5DoclistIterNext(tls *libc.TLS, pIter uintptr) { /* sqlite3.c:227756:13: */
bp := tls.Alloc(12)
defer tls.Free(12)
- var p uintptr = (((*Fts5DoclistIter)(unsafe.Pointer(pIter)).FaPoslist + uintptr((*Fts5DoclistIter)(unsafe.Pointer(pIter)).FnSize)) + uintptr((*Fts5DoclistIter)(unsafe.Pointer(pIter)).FnPoslist))
+ var p uintptr = (*Fts5DoclistIter)(unsafe.Pointer(pIter)).FaPoslist + uintptr((*Fts5DoclistIter)(unsafe.Pointer(pIter)).FnSize) + uintptr((*Fts5DoclistIter)(unsafe.Pointer(pIter)).FnPoslist)
if p >= (*Fts5DoclistIter)(unsafe.Pointer(pIter)).FaEof {
(*Fts5DoclistIter)(unsafe.Pointer(pIter)).FaPoslist = uintptr(0)
@@ -182664,43 +185167,43 @@ func fts5DoclistIterNext(tls *libc.TLS, pIter uintptr) { /* sqlite3.c:225856:13:
// var iDelta I64 at bp, 8
p += uintptr(sqlite3Fts5GetVarint(tls, p, bp /* &iDelta */))
- *(*I64)(unsafe.Pointer(pIter + 8 /* &.iRowid */)) += (*(*I64)(unsafe.Pointer(bp /* iDelta */)))
+ *(*I64)(unsafe.Pointer(pIter + 8)) += *(*I64)(unsafe.Pointer(bp))
// Read position list size
- if (int32(*(*U8)(unsafe.Pointer(p))) & 0x80) != 0 {
+ if int32(*(*U8)(unsafe.Pointer(p)))&0x80 != 0 {
// var nPos int32 at bp+8, 4
(*Fts5DoclistIter)(unsafe.Pointer(pIter)).FnSize = sqlite3Fts5GetVarint32(tls, p, bp+8 /* &nPos */)
- (*Fts5DoclistIter)(unsafe.Pointer(pIter)).FnPoslist = (*(*int32)(unsafe.Pointer(bp + 8 /* nPos */)) >> 1)
+ (*Fts5DoclistIter)(unsafe.Pointer(pIter)).FnPoslist = *(*int32)(unsafe.Pointer(bp + 8)) >> 1
} else {
- (*Fts5DoclistIter)(unsafe.Pointer(pIter)).FnPoslist = ((int32(*(*U8)(unsafe.Pointer(p)))) >> 1)
+ (*Fts5DoclistIter)(unsafe.Pointer(pIter)).FnPoslist = int32(*(*U8)(unsafe.Pointer(p))) >> 1
(*Fts5DoclistIter)(unsafe.Pointer(pIter)).FnSize = 1
}
(*Fts5DoclistIter)(unsafe.Pointer(pIter)).FaPoslist = p
- if ((*Fts5DoclistIter)(unsafe.Pointer(pIter)).FaPoslist + uintptr((*Fts5DoclistIter)(unsafe.Pointer(pIter)).FnPoslist)) > (*Fts5DoclistIter)(unsafe.Pointer(pIter)).FaEof {
+ if (*Fts5DoclistIter)(unsafe.Pointer(pIter)).FaPoslist+uintptr((*Fts5DoclistIter)(unsafe.Pointer(pIter)).FnPoslist) > (*Fts5DoclistIter)(unsafe.Pointer(pIter)).FaEof {
(*Fts5DoclistIter)(unsafe.Pointer(pIter)).FaPoslist = uintptr(0)
}
}
}
-func fts5DoclistIterInit(tls *libc.TLS, pBuf uintptr, pIter uintptr) { /* sqlite3.c:225885:13: */
+func fts5DoclistIterInit(tls *libc.TLS, pBuf uintptr, pIter uintptr) { /* sqlite3.c:227785:13: */
libc.Xmemset(tls, pIter, 0, uint32(unsafe.Sizeof(Fts5DoclistIter{})))
if (*Fts5Buffer)(unsafe.Pointer(pBuf)).Fn > 0 {
(*Fts5DoclistIter)(unsafe.Pointer(pIter)).FaPoslist = (*Fts5Buffer)(unsafe.Pointer(pBuf)).Fp
- (*Fts5DoclistIter)(unsafe.Pointer(pIter)).FaEof = ((*Fts5Buffer)(unsafe.Pointer(pBuf)).Fp + uintptr((*Fts5Buffer)(unsafe.Pointer(pBuf)).Fn))
+ (*Fts5DoclistIter)(unsafe.Pointer(pIter)).FaEof = (*Fts5Buffer)(unsafe.Pointer(pBuf)).Fp + uintptr((*Fts5Buffer)(unsafe.Pointer(pBuf)).Fn)
fts5DoclistIterNext(tls, pIter)
}
}
// Swap the contents of buffer *p1 with that of *p2.
-func fts5BufferSwap(tls *libc.TLS, p1 uintptr, p2 uintptr) { /* sqlite3.c:225924:13: */
+func fts5BufferSwap(tls *libc.TLS, p1 uintptr, p2 uintptr) { /* sqlite3.c:227824:13: */
var tmp = *(*Fts5Buffer)(unsafe.Pointer(p1))
*(*Fts5Buffer)(unsafe.Pointer(p1)) = *(*Fts5Buffer)(unsafe.Pointer(p2))
*(*Fts5Buffer)(unsafe.Pointer(p2)) = tmp
}
-func fts5NextRowid(tls *libc.TLS, pBuf uintptr, piOff uintptr, piRowid uintptr) { /* sqlite3.c:225930:13: */
+func fts5NextRowid(tls *libc.TLS, pBuf uintptr, piOff uintptr, piRowid uintptr) { /* sqlite3.c:227830:13: */
bp := tls.Alloc(8)
defer tls.Free(8)
@@ -182710,14 +185213,14 @@ func fts5NextRowid(tls *libc.TLS, pBuf uintptr, piOff uintptr, piRowid uintptr)
} else {
// var iVal U64 at bp, 8
- *(*int32)(unsafe.Pointer(piOff)) = (i + int32(sqlite3Fts5GetVarint(tls, ((*Fts5Buffer)(unsafe.Pointer(pBuf)).Fp+uintptr(i)), bp /* &iVal */)))
- *(*I64)(unsafe.Pointer(piRowid)) += I64((*(*U64)(unsafe.Pointer(bp /* iVal */))))
+ *(*int32)(unsafe.Pointer(piOff)) = i + int32(sqlite3Fts5GetVarint(tls, (*Fts5Buffer)(unsafe.Pointer(pBuf)).Fp+uintptr(i), bp))
+ *(*I64)(unsafe.Pointer(piRowid)) += I64(*(*U64)(unsafe.Pointer(bp)))
}
}
// This is the equivalent of fts5MergePrefixLists() for detail=none mode.
// In this case the buffers consist of a delta-encoded list of rowids only.
-func fts5MergeRowidLists(tls *libc.TLS, p uintptr, p1 uintptr, nBuf int32, aBuf uintptr) { /* sqlite3.c:225945:13: */
+func fts5MergeRowidLists(tls *libc.TLS, p uintptr, p1 uintptr, nBuf int32, aBuf uintptr) { /* sqlite3.c:227845:13: */
bp := tls.Alloc(40)
defer tls.Free(40)
@@ -182726,24 +185229,24 @@ func fts5MergeRowidLists(tls *libc.TLS, p uintptr, p1 uintptr, nBuf int32, aBuf
*(*I64)(unsafe.Pointer(bp + 16 /* iRowid1 */)) = int64(0)
*(*I64)(unsafe.Pointer(bp + 32 /* iRowid2 */)) = int64(0)
var iOut I64 = int64(0)
- var p2 uintptr = (aBuf)
+ var p2 uintptr = aBuf
// var out Fts5Buffer at bp, 12
_ = nBuf
libc.Xmemset(tls, bp /* &out */, 0, uint32(unsafe.Sizeof(Fts5Buffer{})))
- sqlite3Fts5BufferSize(tls, (p + 36 /* &.rc */), bp /* &out */, (uint32((*Fts5Buffer)(unsafe.Pointer(p1)).Fn + (*Fts5Buffer)(unsafe.Pointer(p2)).Fn)))
+ sqlite3Fts5BufferSize(tls, p+36, bp /* &out */, uint32((*Fts5Buffer)(unsafe.Pointer(p1)).Fn+(*Fts5Buffer)(unsafe.Pointer(p2)).Fn))
if (*Fts5Index)(unsafe.Pointer(p)).Frc != 0 {
return
}
fts5NextRowid(tls, p1, bp+12 /* &i1 */, bp+16 /* &iRowid1 */)
fts5NextRowid(tls, p2, bp+24 /* &i2 */, bp+32 /* &iRowid2 */)
- for (*(*int32)(unsafe.Pointer(bp + 12 /* i1 */)) >= 0) || (*(*int32)(unsafe.Pointer(bp + 24 /* i2 */)) >= 0) {
- if (*(*int32)(unsafe.Pointer(bp + 12 /* i1 */)) >= 0) && ((*(*int32)(unsafe.Pointer(bp + 24 /* i2 */)) < 0) || (*(*I64)(unsafe.Pointer(bp + 16 /* iRowid1 */)) < *(*I64)(unsafe.Pointer(bp + 32 /* iRowid2 */)))) {
+ for *(*int32)(unsafe.Pointer(bp + 12)) >= 0 || *(*int32)(unsafe.Pointer(bp + 24)) >= 0 {
+ if *(*int32)(unsafe.Pointer(bp + 12)) >= 0 && (*(*int32)(unsafe.Pointer(bp + 24)) < 0 || *(*I64)(unsafe.Pointer(bp + 16)) < *(*I64)(unsafe.Pointer(bp + 32))) {
{
- *(*int32)(unsafe.Pointer(bp /* &out */ + 4 /* &.n */)) += (sqlite3Fts5PutVarint(tls, ((*Fts5Buffer)(unsafe.Pointer((bp /* &out */))).Fp + uintptr((*Fts5Buffer)(unsafe.Pointer((bp /* &out */))).Fn)), (uint64(*(*I64)(unsafe.Pointer(bp + 16 /* iRowid1 */)) - iOut))))
+ *(*int32)(unsafe.Pointer(bp + 4)) += sqlite3Fts5PutVarint(tls, (*Fts5Buffer)(unsafe.Pointer(bp)).Fp+uintptr((*Fts5Buffer)(unsafe.Pointer(bp)).Fn), uint64(*(*I64)(unsafe.Pointer(bp + 16))-iOut))
}
iOut = *(*I64)(unsafe.Pointer(bp + 16 /* iRowid1 */))
@@ -182751,11 +185254,11 @@ func fts5MergeRowidLists(tls *libc.TLS, p uintptr, p1 uintptr, nBuf int32, aBuf
} else {
{
- *(*int32)(unsafe.Pointer(bp /* &out */ + 4 /* &.n */)) += (sqlite3Fts5PutVarint(tls, ((*Fts5Buffer)(unsafe.Pointer((bp /* &out */))).Fp + uintptr((*Fts5Buffer)(unsafe.Pointer((bp /* &out */))).Fn)), (uint64(*(*I64)(unsafe.Pointer(bp + 32 /* iRowid2 */)) - iOut))))
+ *(*int32)(unsafe.Pointer(bp + 4)) += sqlite3Fts5PutVarint(tls, (*Fts5Buffer)(unsafe.Pointer(bp)).Fp+uintptr((*Fts5Buffer)(unsafe.Pointer(bp)).Fn), uint64(*(*I64)(unsafe.Pointer(bp + 32))-iOut))
}
iOut = *(*I64)(unsafe.Pointer(bp + 32 /* iRowid2 */))
- if (*(*int32)(unsafe.Pointer(bp + 12 /* i1 */)) >= 0) && (*(*I64)(unsafe.Pointer(bp + 16 /* iRowid1 */)) == *(*I64)(unsafe.Pointer(bp + 32 /* iRowid2 */))) {
+ if *(*int32)(unsafe.Pointer(bp + 12)) >= 0 && *(*I64)(unsafe.Pointer(bp + 16)) == *(*I64)(unsafe.Pointer(bp + 32)) {
fts5NextRowid(tls, p1, bp+12 /* &i1 */, bp+16 /* &iRowid1 */)
}
fts5NextRowid(tls, p2, bp+24 /* &i2 */, bp+32 /* &iRowid2 */)
@@ -182773,26 +185276,26 @@ type PrefixMerger1 = struct {
FaPos uintptr
FpNext uintptr
F__ccgo_pad1 [4]byte
-} /* sqlite3.c:225988:9 */
+} /* sqlite3.c:227888:9 */
-type PrefixMerger = PrefixMerger1 /* sqlite3.c:225988:29 */
+type PrefixMerger = PrefixMerger1 /* sqlite3.c:227888:29 */
-func fts5PrefixMergerInsertByRowid(tls *libc.TLS, ppHead uintptr, p uintptr) { /* sqlite3.c:225997:13: */
+func fts5PrefixMergerInsertByRowid(tls *libc.TLS, ppHead uintptr, p uintptr) { /* sqlite3.c:227897:13: */
if (*PrefixMerger)(unsafe.Pointer(p)).Fiter.FaPoslist != 0 {
var pp uintptr = ppHead
- for (*(*uintptr)(unsafe.Pointer(pp)) != 0) && ((*PrefixMerger)(unsafe.Pointer(p)).Fiter.FiRowid > (*PrefixMerger)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(pp))))).Fiter.FiRowid) {
- pp = (*(*uintptr)(unsafe.Pointer(pp)) + 48 /* &.pNext */)
+ for *(*uintptr)(unsafe.Pointer(pp)) != 0 && (*PrefixMerger)(unsafe.Pointer(p)).Fiter.FiRowid > (*PrefixMerger)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pp)))).Fiter.FiRowid {
+ pp = *(*uintptr)(unsafe.Pointer(pp)) + 48
}
(*PrefixMerger)(unsafe.Pointer(p)).FpNext = *(*uintptr)(unsafe.Pointer(pp))
*(*uintptr)(unsafe.Pointer(pp)) = p
}
}
-func fts5PrefixMergerInsertByPosition(tls *libc.TLS, ppHead uintptr, p uintptr) { /* sqlite3.c:226011:13: */
+func fts5PrefixMergerInsertByPosition(tls *libc.TLS, ppHead uintptr, p uintptr) { /* sqlite3.c:227911:13: */
if (*PrefixMerger)(unsafe.Pointer(p)).FiPos >= int64(0) {
var pp uintptr = ppHead
- for (*(*uintptr)(unsafe.Pointer(pp)) != 0) && ((*PrefixMerger)(unsafe.Pointer(p)).FiPos > (*PrefixMerger)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(pp))))).FiPos) {
- pp = (*(*uintptr)(unsafe.Pointer(pp)) + 48 /* &.pNext */)
+ for *(*uintptr)(unsafe.Pointer(pp)) != 0 && (*PrefixMerger)(unsafe.Pointer(p)).FiPos > (*PrefixMerger)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pp)))).FiPos {
+ pp = *(*uintptr)(unsafe.Pointer(pp)) + 48
}
(*PrefixMerger)(unsafe.Pointer(p)).FpNext = *(*uintptr)(unsafe.Pointer(pp))
*(*uintptr)(unsafe.Pointer(pp)) = p
@@ -182801,7 +185304,7 @@ func fts5PrefixMergerInsertByPosition(tls *libc.TLS, ppHead uintptr, p uintptr)
// Array aBuf[] contains nBuf doclists. These are all merged in with the
// doclist in buffer p1.
-func fts5MergePrefixLists(tls *libc.TLS, p uintptr, p1 uintptr, nBuf int32, aBuf uintptr) { /* sqlite3.c:226030:13: */
+func fts5MergePrefixLists(tls *libc.TLS, p uintptr, p1 uintptr, nBuf int32, aBuf uintptr) { /* sqlite3.c:227930:13: */
bp := tls.Alloc(936)
defer tls.Free(936)
@@ -182818,18 +185321,18 @@ func fts5MergePrefixLists(tls *libc.TLS, p uintptr, p1 uintptr, nBuf int32, aBuf
// a linked-list starting at pHead in ascending order of rowid. Avoid
// linking any iterators already at EOF into the linked list at all.
- libc.Xmemset(tls, bp /* &aMerger[0] */, 0, (uint32(unsafe.Sizeof(PrefixMerger{})) * (uint32(nBuf + 1))))
- *(*uintptr)(unsafe.Pointer(bp + 896 /* pHead */)) = (bp /* &aMerger */ + uintptr(nBuf)*56)
- fts5DoclistIterInit(tls, p1, (*(*uintptr)(unsafe.Pointer(bp + 896 /* pHead */)) /* &.iter */))
+ libc.Xmemset(tls, bp /* &aMerger[0] */, 0, uint32(unsafe.Sizeof(PrefixMerger{}))*uint32(nBuf+1))
+ *(*uintptr)(unsafe.Pointer(bp + 896 /* pHead */)) = bp + uintptr(nBuf)*56
+ fts5DoclistIterInit(tls, p1, *(*uintptr)(unsafe.Pointer(bp + 896)))
for i = 0; i < nBuf; i++ {
- fts5DoclistIterInit(tls, (aBuf + uintptr(i)*12), (bp /* &aMerger */ + uintptr(i)*56 /* &.iter */))
- fts5PrefixMergerInsertByRowid(tls, bp+896 /* &pHead */, (bp /* &aMerger */ + uintptr(i)*56))
- nOut = nOut + ((*Fts5Buffer)(unsafe.Pointer(aBuf + uintptr(i)*12)).Fn)
+ fts5DoclistIterInit(tls, aBuf+uintptr(i)*12, bp+uintptr(i)*56)
+ fts5PrefixMergerInsertByRowid(tls, bp+896 /* &pHead */, bp+uintptr(i)*56)
+ nOut = nOut + (*Fts5Buffer)(unsafe.Pointer(aBuf+uintptr(i)*12)).Fn
}
if nOut == 0 {
return
}
- nOut = nOut + (((*Fts5Buffer)(unsafe.Pointer(p1)).Fn + 9) + (10 * nBuf))
+ nOut = nOut + ((*Fts5Buffer)(unsafe.Pointer(p1)).Fn + 9 + 10*nBuf)
// The maximum size of the output is equal to the sum of the
// input sizes + 1 varint (9 bytes). The extra varint is because if the
@@ -182843,19 +185346,19 @@ func fts5MergePrefixLists(tls *libc.TLS, p uintptr, p1 uintptr, nBuf int32, aBuf
// (the value PoslistNext64() uses for EOF) as a position and appending
// it to the output. This can happen at most once for each input
// position-list, hence (nBuf+1) 10 byte paddings.
- if sqlite3Fts5BufferSize(tls, (p+36 /* &.rc */), bp+900 /* &out */, uint32(nOut)) != 0 {
+ if sqlite3Fts5BufferSize(tls, p+36, bp+900, uint32(nOut)) != 0 {
return
}
- for *(*uintptr)(unsafe.Pointer(bp + 896 /* pHead */)) != 0 {
+ for *(*uintptr)(unsafe.Pointer(bp + 896)) != 0 {
{
{
- *(*int32)(unsafe.Pointer(bp + 900 /* &out */ + 4 /* &.n */)) += (sqlite3Fts5PutVarint(tls, ((*Fts5Buffer)(unsafe.Pointer((bp + 900 /* &out */))).Fp + uintptr((*Fts5Buffer)(unsafe.Pointer((bp + 900 /* &out */))).Fn)), (uint64(((*PrefixMerger)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 896 /* pHead */)))).Fiter.FiRowid) - (iLastRowid)))))
+ *(*int32)(unsafe.Pointer(bp + 900 + 4)) += sqlite3Fts5PutVarint(tls, (*Fts5Buffer)(unsafe.Pointer(bp+900)).Fp+uintptr((*Fts5Buffer)(unsafe.Pointer(bp+900)).Fn), uint64((*PrefixMerger)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 896)))).Fiter.FiRowid-iLastRowid))
}
- (iLastRowid) = (*PrefixMerger)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 896 /* pHead */)))).Fiter.FiRowid
+ iLastRowid = (*PrefixMerger)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 896)))).Fiter.FiRowid
}
- if ((*PrefixMerger)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 896 /* pHead */)))).FpNext != 0) && (iLastRowid == (*PrefixMerger)(unsafe.Pointer((*PrefixMerger)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 896 /* pHead */)))).FpNext)).Fiter.FiRowid) {
+ if (*PrefixMerger)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 896)))).FpNext != 0 && iLastRowid == (*PrefixMerger)(unsafe.Pointer((*PrefixMerger)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 896)))).FpNext)).Fiter.FiRowid {
// Merge data from two or more poslists
*(*I64)(unsafe.Pointer(bp + 928 /* iPrev */)) = int64(0)
var nTmp int32 = FTS5_DATA_ZERO_PADDING
@@ -182865,27 +185368,27 @@ func fts5MergePrefixLists(tls *libc.TLS, p uintptr, p1 uintptr, nBuf int32, aBuf
var nTail int32 = 0
*(*uintptr)(unsafe.Pointer(bp + 896 /* pHead */)) = uintptr(0)
- for (pSave != 0) && ((*PrefixMerger)(unsafe.Pointer(pSave)).Fiter.FiRowid == iLastRowid) {
+ for pSave != 0 && (*PrefixMerger)(unsafe.Pointer(pSave)).Fiter.FiRowid == iLastRowid {
var pNext uintptr = (*PrefixMerger)(unsafe.Pointer(pSave)).FpNext
(*PrefixMerger)(unsafe.Pointer(pSave)).FiOff = 0
(*PrefixMerger)(unsafe.Pointer(pSave)).FiPos = int64(0)
- (*PrefixMerger)(unsafe.Pointer(pSave)).FaPos = ((*PrefixMerger)(unsafe.Pointer(pSave)).Fiter.FaPoslist + uintptr((*PrefixMerger)(unsafe.Pointer(pSave)).Fiter.FnSize))
- sqlite3Fts5PoslistNext64(tls, (*PrefixMerger)(unsafe.Pointer(pSave)).FaPos, (*PrefixMerger)(unsafe.Pointer((pSave))).Fiter.FnPoslist, (pSave + 40 /* &.iOff */), (pSave + 32 /* &.iPos */))
+ (*PrefixMerger)(unsafe.Pointer(pSave)).FaPos = (*PrefixMerger)(unsafe.Pointer(pSave)).Fiter.FaPoslist + uintptr((*PrefixMerger)(unsafe.Pointer(pSave)).Fiter.FnSize)
+ sqlite3Fts5PoslistNext64(tls, (*PrefixMerger)(unsafe.Pointer(pSave)).FaPos, (*PrefixMerger)(unsafe.Pointer(pSave)).Fiter.FnPoslist, pSave+40, pSave+32)
nTmp = nTmp + ((*PrefixMerger)(unsafe.Pointer(pSave)).Fiter.FnPoslist + 10)
nMerge++
fts5PrefixMergerInsertByPosition(tls, bp+896 /* &pHead */, pSave)
pSave = pNext
}
- if (*(*uintptr)(unsafe.Pointer(bp + 896 /* pHead */)) == uintptr(0)) || ((*PrefixMerger)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 896 /* pHead */)))).FpNext == uintptr(0)) {
- (*Fts5Index)(unsafe.Pointer(p)).Frc = (SQLITE_CORRUPT | (int32(1) << 8))
+ if *(*uintptr)(unsafe.Pointer(bp + 896)) == uintptr(0) || (*PrefixMerger)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 896)))).FpNext == uintptr(0) {
+ (*Fts5Index)(unsafe.Pointer(p)).Frc = SQLITE_CORRUPT | int32(1)<<8
break
}
// See the earlier comment in this function for an explanation of why
// corrupt input position lists might cause the output to consume
// at most nMerge*10 bytes of unexpected space.
- if sqlite3Fts5BufferSize(tls, (p+36 /* &.rc */), bp+912 /* &tmp */, (uint32(nTmp+(nMerge*10)))) != 0 {
+ if sqlite3Fts5BufferSize(tls, p+36, bp+912, uint32(nTmp+nMerge*10)) != 0 {
break
}
sqlite3Fts5BufferZero(tls, bp+912 /* &tmp */)
@@ -182893,54 +185396,54 @@ func fts5MergePrefixLists(tls *libc.TLS, p uintptr, p1 uintptr, nBuf int32, aBuf
pThis = *(*uintptr)(unsafe.Pointer(bp + 896 /* pHead */))
*(*uintptr)(unsafe.Pointer(bp + 896 /* pHead */)) = (*PrefixMerger)(unsafe.Pointer(pThis)).FpNext
sqlite3Fts5PoslistSafeAppend(tls, bp+912 /* &tmp */, bp+928 /* &iPrev */, (*PrefixMerger)(unsafe.Pointer(pThis)).FiPos)
- sqlite3Fts5PoslistNext64(tls, (*PrefixMerger)(unsafe.Pointer(pThis)).FaPos, (*PrefixMerger)(unsafe.Pointer((pThis))).Fiter.FnPoslist, (pThis + 40 /* &.iOff */), (pThis + 32 /* &.iPos */))
+ sqlite3Fts5PoslistNext64(tls, (*PrefixMerger)(unsafe.Pointer(pThis)).FaPos, (*PrefixMerger)(unsafe.Pointer(pThis)).Fiter.FnPoslist, pThis+40, pThis+32)
fts5PrefixMergerInsertByPosition(tls, bp+896 /* &pHead */, pThis)
- for (*PrefixMerger)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 896 /* pHead */)))).FpNext != 0 {
+ for (*PrefixMerger)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 896)))).FpNext != 0 {
pThis = *(*uintptr)(unsafe.Pointer(bp + 896 /* pHead */))
- if (*PrefixMerger)(unsafe.Pointer(pThis)).FiPos != *(*I64)(unsafe.Pointer(bp + 928 /* iPrev */)) {
+ if (*PrefixMerger)(unsafe.Pointer(pThis)).FiPos != *(*I64)(unsafe.Pointer(bp + 928)) {
sqlite3Fts5PoslistSafeAppend(tls, bp+912 /* &tmp */, bp+928 /* &iPrev */, (*PrefixMerger)(unsafe.Pointer(pThis)).FiPos)
}
- sqlite3Fts5PoslistNext64(tls, (*PrefixMerger)(unsafe.Pointer(pThis)).FaPos, (*PrefixMerger)(unsafe.Pointer((pThis))).Fiter.FnPoslist, (pThis + 40 /* &.iOff */), (pThis + 32 /* &.iPos */))
+ sqlite3Fts5PoslistNext64(tls, (*PrefixMerger)(unsafe.Pointer(pThis)).FaPos, (*PrefixMerger)(unsafe.Pointer(pThis)).Fiter.FnPoslist, pThis+40, pThis+32)
*(*uintptr)(unsafe.Pointer(bp + 896 /* pHead */)) = (*PrefixMerger)(unsafe.Pointer(pThis)).FpNext
fts5PrefixMergerInsertByPosition(tls, bp+896 /* &pHead */, pThis)
}
- if (*PrefixMerger)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 896 /* pHead */)))).FiPos != *(*I64)(unsafe.Pointer(bp + 928 /* iPrev */)) {
+ if (*PrefixMerger)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 896)))).FiPos != *(*I64)(unsafe.Pointer(bp + 928)) {
sqlite3Fts5PoslistSafeAppend(tls, bp+912 /* &tmp */, bp+928 /* &iPrev */, (*PrefixMerger)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 896 /* pHead */)))).FiPos)
}
- nTail = ((*PrefixMerger)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 896 /* pHead */)))).Fiter.FnPoslist - (*PrefixMerger)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 896 /* pHead */)))).FiOff)
+ nTail = (*PrefixMerger)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 896)))).Fiter.FnPoslist - (*PrefixMerger)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 896)))).FiOff
// WRITEPOSLISTSIZE
- if ((*Fts5Buffer)(unsafe.Pointer(bp+912 /* &tmp */)).Fn + nTail) > (nTmp - FTS5_DATA_ZERO_PADDING) {
+ if (*Fts5Buffer)(unsafe.Pointer(bp+912)).Fn+nTail > nTmp-FTS5_DATA_ZERO_PADDING {
if (*Fts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK {
- (*Fts5Index)(unsafe.Pointer(p)).Frc = (SQLITE_CORRUPT | (int32(1) << 8))
+ (*Fts5Index)(unsafe.Pointer(p)).Frc = SQLITE_CORRUPT | int32(1)<<8
}
break
}
{
- *(*int32)(unsafe.Pointer(bp + 900 /* &out */ + 4 /* &.n */)) += (sqlite3Fts5PutVarint(tls, ((*Fts5Buffer)(unsafe.Pointer((bp + 900 /* &out */))).Fp + uintptr((*Fts5Buffer)(unsafe.Pointer((bp + 900 /* &out */))).Fn)), (uint64(((*Fts5Buffer)(unsafe.Pointer(bp+912 /* &tmp */)).Fn + nTail) * 2))))
+ *(*int32)(unsafe.Pointer(bp + 900 + 4)) += sqlite3Fts5PutVarint(tls, (*Fts5Buffer)(unsafe.Pointer(bp+900)).Fp+uintptr((*Fts5Buffer)(unsafe.Pointer(bp+900)).Fn), uint64(((*Fts5Buffer)(unsafe.Pointer(bp+912)).Fn+nTail)*2))
}
{
- libc.Xmemcpy(tls, ((*Fts5Buffer)(unsafe.Pointer((bp + 900 /* &out */))).Fp + uintptr((*Fts5Buffer)(unsafe.Pointer((bp + 900 /* &out */))).Fn)), (*Fts5Buffer)(unsafe.Pointer(bp+912 /* &tmp */)).Fp, uint32((*Fts5Buffer)(unsafe.Pointer(bp+912 /* &tmp */)).Fn))
- *(*int32)(unsafe.Pointer(bp + 900 /* &out */ + 4 /* &.n */)) += ((*Fts5Buffer)(unsafe.Pointer(bp + 912 /* &tmp */)).Fn)
+ libc.Xmemcpy(tls, (*Fts5Buffer)(unsafe.Pointer(bp+900)).Fp+uintptr((*Fts5Buffer)(unsafe.Pointer(bp+900)).Fn), (*Fts5Buffer)(unsafe.Pointer(bp+912 /* &tmp */)).Fp, uint32((*Fts5Buffer)(unsafe.Pointer(bp+912 /* &tmp */)).Fn))
+ *(*int32)(unsafe.Pointer(bp + 900 + 4)) += (*Fts5Buffer)(unsafe.Pointer(bp + 912)).Fn
}
if nTail > 0 {
{
- libc.Xmemcpy(tls, ((*Fts5Buffer)(unsafe.Pointer((bp + 900 /* &out */))).Fp + uintptr((*Fts5Buffer)(unsafe.Pointer((bp + 900 /* &out */))).Fn)), ((*PrefixMerger)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 896 /* pHead */)))).FaPos + uintptr((*PrefixMerger)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 896 /* pHead */)))).FiOff)), uint32(nTail))
- *(*int32)(unsafe.Pointer(bp + 900 /* &out */ + 4 /* &.n */)) += (nTail)
+ libc.Xmemcpy(tls, (*Fts5Buffer)(unsafe.Pointer(bp+900)).Fp+uintptr((*Fts5Buffer)(unsafe.Pointer(bp+900)).Fn), (*PrefixMerger)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 896)))).FaPos+uintptr((*PrefixMerger)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 896)))).FiOff), uint32(nTail))
+ *(*int32)(unsafe.Pointer(bp + 900 + 4)) += nTail
}
}
*(*uintptr)(unsafe.Pointer(bp + 896 /* pHead */)) = pSave
- for i = 0; i < (nBuf + 1); i++ {
- var pX uintptr = (bp /* &aMerger */ + uintptr(i)*56)
- if ((*PrefixMerger)(unsafe.Pointer(pX)).Fiter.FaPoslist != 0) && ((*PrefixMerger)(unsafe.Pointer(pX)).Fiter.FiRowid == iLastRowid) {
- fts5DoclistIterNext(tls, (pX /* &.iter */))
+ for i = 0; i < nBuf+1; i++ {
+ var pX uintptr = bp + uintptr(i)*56
+ if (*PrefixMerger)(unsafe.Pointer(pX)).Fiter.FaPoslist != 0 && (*PrefixMerger)(unsafe.Pointer(pX)).Fiter.FiRowid == iLastRowid {
+ fts5DoclistIterNext(tls, pX)
fts5PrefixMergerInsertByRowid(tls, bp+896 /* &pHead */, pX)
}
}
@@ -182948,10 +185451,10 @@ func fts5MergePrefixLists(tls *libc.TLS, p uintptr, p1 uintptr, nBuf int32, aBuf
} else {
// Copy poslist from pHead to output
var pThis uintptr = *(*uintptr)(unsafe.Pointer(bp + 896 /* pHead */))
- var pI uintptr = (pThis /* &.iter */)
+ var pI uintptr = pThis
{
- libc.Xmemcpy(tls, ((*Fts5Buffer)(unsafe.Pointer((bp + 900 /* &out */))).Fp + uintptr((*Fts5Buffer)(unsafe.Pointer((bp + 900 /* &out */))).Fn)), (*Fts5DoclistIter)(unsafe.Pointer(pI)).FaPoslist, (uint32((*Fts5DoclistIter)(unsafe.Pointer(pI)).FnPoslist + (*Fts5DoclistIter)(unsafe.Pointer(pI)).FnSize)))
- *(*int32)(unsafe.Pointer(bp + 900 /* &out */ + 4 /* &.n */)) += ((*Fts5DoclistIter)(unsafe.Pointer(pI)).FnPoslist + (*Fts5DoclistIter)(unsafe.Pointer(pI)).FnSize)
+ libc.Xmemcpy(tls, (*Fts5Buffer)(unsafe.Pointer(bp+900)).Fp+uintptr((*Fts5Buffer)(unsafe.Pointer(bp+900)).Fn), (*Fts5DoclistIter)(unsafe.Pointer(pI)).FaPoslist, uint32((*Fts5DoclistIter)(unsafe.Pointer(pI)).FnPoslist+(*Fts5DoclistIter)(unsafe.Pointer(pI)).FnSize))
+ *(*int32)(unsafe.Pointer(bp + 900 + 4)) += (*Fts5DoclistIter)(unsafe.Pointer(pI)).FnPoslist + (*Fts5DoclistIter)(unsafe.Pointer(pI)).FnSize
}
fts5DoclistIterNext(tls, pI)
@@ -182962,11 +185465,11 @@ func fts5MergePrefixLists(tls *libc.TLS, p uintptr, p1 uintptr, nBuf int32, aBuf
sqlite3Fts5BufferFree(tls, p1)
sqlite3Fts5BufferFree(tls, bp+912 /* &tmp */)
- libc.Xmemset(tls, ((*Fts5Buffer)(unsafe.Pointer(bp+900 /* &out */)).Fp + uintptr((*Fts5Buffer)(unsafe.Pointer(bp+900 /* &out */)).Fn)), 0, uint32(FTS5_DATA_ZERO_PADDING))
+ libc.Xmemset(tls, (*Fts5Buffer)(unsafe.Pointer(bp+900)).Fp+uintptr((*Fts5Buffer)(unsafe.Pointer(bp+900)).Fn), 0, uint32(FTS5_DATA_ZERO_PADDING))
*(*Fts5Buffer)(unsafe.Pointer(p1)) = *(*Fts5Buffer)(unsafe.Pointer(bp + 900 /* out */))
}
-func fts5SetupPrefixIter(tls *libc.TLS, p uintptr, bDesc int32, iIdx int32, pToken uintptr, nToken int32, pColset uintptr, ppIter uintptr) { /* sqlite3.c:226174:13: */
+func fts5SetupPrefixIter(tls *libc.TLS, p uintptr, bDesc int32, iIdx int32, pToken uintptr, nToken int32, pColset uintptr, ppIter uintptr) { /* sqlite3.c:228074:13: */
bp := tls.Alloc(24)
defer tls.Free(24)
@@ -182984,8 +185487,8 @@ func fts5SetupPrefixIter(tls *libc.TLS, p uintptr, bDesc int32, iIdx int32, pTok
f func(*libc.TLS, uintptr, I64, uintptr, uintptr)
}{fts5AppendRowid}))
} else {
- nMerge = (FTS5_MERGE_NLIST - 1)
- nBuf = (nMerge * 8) // Sufficient to merge (16^8)==(2^32) lists
+ nMerge = FTS5_MERGE_NLIST - 1
+ nBuf = nMerge * 8 // Sufficient to merge (16^8)==(2^32) lists
xMerge = *(*uintptr)(unsafe.Pointer(&struct {
f func(*libc.TLS, uintptr, uintptr, int32, uintptr)
}{fts5MergePrefixLists}))
@@ -182994,13 +185497,13 @@ func fts5SetupPrefixIter(tls *libc.TLS, p uintptr, bDesc int32, iIdx int32, pTok
}{fts5AppendPoslist}))
}
- aBuf = fts5IdxMalloc(tls, p, (int64(uint32(unsafe.Sizeof(Fts5Buffer{})) * uint32(nBuf))))
+ aBuf = fts5IdxMalloc(tls, p, int64(uint32(unsafe.Sizeof(Fts5Buffer{}))*uint32(nBuf)))
pStruct = fts5StructureRead(tls, p)
- if (aBuf != 0) && (pStruct != 0) {
- var flags int32 = ((FTS5INDEX_QUERY_SCAN |
- FTS5INDEX_QUERY_SKIPEMPTY) |
- FTS5INDEX_QUERY_NOOUTPUT)
+ if aBuf != 0 && pStruct != 0 {
+ var flags int32 = FTS5INDEX_QUERY_SCAN |
+ FTS5INDEX_QUERY_SKIPEMPTY |
+ FTS5INDEX_QUERY_NOOUTPUT
var i int32
var iLastRowid I64 = int64(0)
*(*uintptr)(unsafe.Pointer(bp + 12 /* p1 */)) = uintptr(0) // Iterator used to gather data from index
@@ -183012,64 +185515,64 @@ func fts5SetupPrefixIter(tls *libc.TLS, p uintptr, bDesc int32, iIdx int32, pTok
libc.Xmemset(tls, bp /* &doclist */, 0, uint32(unsafe.Sizeof(Fts5Buffer{})))
if iIdx != 0 {
*(*int32)(unsafe.Pointer(bp + 16 /* dummy */)) = 0
- var f2 int32 = (FTS5INDEX_QUERY_SKIPEMPTY | FTS5INDEX_QUERY_NOOUTPUT)
+ var f2 int32 = FTS5INDEX_QUERY_SKIPEMPTY | FTS5INDEX_QUERY_NOOUTPUT
*(*U8)(unsafe.Pointer(pToken)) = U8('0')
fts5MultiIterNew(tls, p, pStruct, f2, pColset, pToken, nToken, -1, 0, bp+12 /* &p1 */)
- fts5IterSetOutputCb(tls, (p + 36 /* &.rc */), *(*uintptr)(unsafe.Pointer(bp + 12 /* p1 */)))
- for ; fts5MultiIterEof(tls, p, *(*uintptr)(unsafe.Pointer(bp + 12 /* p1 */))) == 0; fts5MultiIterNext2(tls, p, *(*uintptr)(unsafe.Pointer(bp + 12 /* p1 */)), bp+16 /* &dummy */) {
- var pSeg uintptr = ((*(*uintptr)(unsafe.Pointer(bp + 12 /* p1 */)) + 80 /* &.aSeg */) + uintptr((*Fts5CResult)(unsafe.Pointer((*Fts5Iter)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 12 /* p1 */)))).FaFirst+1*4)).FiFirst)*96)
+ fts5IterSetOutputCb(tls, p+36, *(*uintptr)(unsafe.Pointer(bp + 12 /* p1 */)))
+ for ; fts5MultiIterEof(tls, p, *(*uintptr)(unsafe.Pointer(bp + 12))) == 0; fts5MultiIterNext2(tls, p, *(*uintptr)(unsafe.Pointer(bp + 12 /* p1 */)), bp+16 /* &dummy */) {
+ var pSeg uintptr = *(*uintptr)(unsafe.Pointer(bp + 12)) + 80 + uintptr((*Fts5CResult)(unsafe.Pointer((*Fts5Iter)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 12)))).FaFirst+1*4)).FiFirst)*96
(*struct {
f func(*libc.TLS, uintptr, uintptr)
})(unsafe.Pointer(&struct{ uintptr }{(*Fts5Iter)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 12 /* p1 */)))).FxSetOutputs})).f(tls, *(*uintptr)(unsafe.Pointer(bp + 12 /* p1 */)), pSeg)
- if (*Fts5Iter)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 12 /* p1 */)))).Fbase.FnData != 0 {
+ if (*Fts5Iter)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 12)))).Fbase.FnData != 0 {
(*struct {
f func(*libc.TLS, uintptr, I64, uintptr, uintptr)
- })(unsafe.Pointer(&struct{ uintptr }{xAppend})).f(tls, p, ((*Fts5Iter)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 12 /* p1 */)))).Fbase.FiRowid - iLastRowid), *(*uintptr)(unsafe.Pointer(bp + 12 /* p1 */)), bp /* &doclist */)
+ })(unsafe.Pointer(&struct{ uintptr }{xAppend})).f(tls, p, (*Fts5Iter)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 12 /* p1 */)))).Fbase.FiRowid-iLastRowid, *(*uintptr)(unsafe.Pointer(bp + 12 /* p1 */)), bp /* &doclist */)
iLastRowid = (*Fts5Iter)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 12 /* p1 */)))).Fbase.FiRowid
}
}
fts5MultiIterFree(tls, *(*uintptr)(unsafe.Pointer(bp + 12 /* p1 */)))
}
- *(*U8)(unsafe.Pointer(pToken)) = (U8('0' + iIdx))
+ *(*U8)(unsafe.Pointer(pToken)) = U8('0' + iIdx)
fts5MultiIterNew(tls, p, pStruct, flags, pColset, pToken, nToken, -1, 0, bp+12 /* &p1 */)
- fts5IterSetOutputCb(tls, (p + 36 /* &.rc */), *(*uintptr)(unsafe.Pointer(bp + 12 /* p1 */)))
- for ; fts5MultiIterEof(tls, p, *(*uintptr)(unsafe.Pointer(bp + 12 /* p1 */))) == 0; fts5MultiIterNext2(tls, p, *(*uintptr)(unsafe.Pointer(bp + 12 /* p1 */)), bp+20 /* &bNewTerm */) {
- var pSeg uintptr = ((*(*uintptr)(unsafe.Pointer(bp + 12 /* p1 */)) + 80 /* &.aSeg */) + uintptr((*Fts5CResult)(unsafe.Pointer((*Fts5Iter)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 12 /* p1 */)))).FaFirst+1*4)).FiFirst)*96)
+ fts5IterSetOutputCb(tls, p+36, *(*uintptr)(unsafe.Pointer(bp + 12 /* p1 */)))
+ for ; fts5MultiIterEof(tls, p, *(*uintptr)(unsafe.Pointer(bp + 12))) == 0; fts5MultiIterNext2(tls, p, *(*uintptr)(unsafe.Pointer(bp + 12 /* p1 */)), bp+20 /* &bNewTerm */) {
+ var pSeg uintptr = *(*uintptr)(unsafe.Pointer(bp + 12)) + 80 + uintptr((*Fts5CResult)(unsafe.Pointer((*Fts5Iter)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 12)))).FaFirst+1*4)).FiFirst)*96
var nTerm int32 = (*Fts5SegIter)(unsafe.Pointer(pSeg)).Fterm.Fn
var pTerm uintptr = (*Fts5SegIter)(unsafe.Pointer(pSeg)).Fterm.Fp
(*struct {
f func(*libc.TLS, uintptr, uintptr)
})(unsafe.Pointer(&struct{ uintptr }{(*Fts5Iter)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 12 /* p1 */)))).FxSetOutputs})).f(tls, *(*uintptr)(unsafe.Pointer(bp + 12 /* p1 */)), pSeg)
- if *(*int32)(unsafe.Pointer(bp + 20 /* bNewTerm */)) != 0 {
- if (nTerm < nToken) || (libc.Xmemcmp(tls, pToken, pTerm, uint32(nToken)) != 0) {
+ if *(*int32)(unsafe.Pointer(bp + 20)) != 0 {
+ if nTerm < nToken || libc.Xmemcmp(tls, pToken, pTerm, uint32(nToken)) != 0 {
break
}
}
- if (*Fts5Iter)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 12 /* p1 */)))).Fbase.FnData == 0 {
+ if (*Fts5Iter)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 12)))).Fbase.FnData == 0 {
continue
}
- if ((*Fts5Iter)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 12 /* p1 */)))).Fbase.FiRowid <= iLastRowid) && ((*Fts5Buffer)(unsafe.Pointer(bp /* &doclist */)).Fn > 0) {
- for i = 0; ((*Fts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK) && ((*Fts5Buffer)(unsafe.Pointer(bp /* &doclist */)).Fn != 0); i++ {
- var i1 int32 = (i * nMerge)
+ if (*Fts5Iter)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 12)))).Fbase.FiRowid <= iLastRowid && (*Fts5Buffer)(unsafe.Pointer(bp)).Fn > 0 {
+ for i = 0; (*Fts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK && (*Fts5Buffer)(unsafe.Pointer(bp /* &doclist */)).Fn != 0; i++ {
+ var i1 int32 = i * nMerge
var iStore int32
- for iStore = i1; iStore < (i1 + nMerge); iStore++ {
+ for iStore = i1; iStore < i1+nMerge; iStore++ {
if (*Fts5Buffer)(unsafe.Pointer(aBuf+uintptr(iStore)*12)).Fn == 0 {
- fts5BufferSwap(tls, bp /* &doclist */, (aBuf + uintptr(iStore)*12))
+ fts5BufferSwap(tls, bp /* &doclist */, aBuf+uintptr(iStore)*12)
sqlite3Fts5BufferZero(tls, bp /* &doclist */)
break
}
}
- if iStore == (i1 + nMerge) {
+ if iStore == i1+nMerge {
(*struct {
f func(*libc.TLS, uintptr, uintptr, int32, uintptr)
- })(unsafe.Pointer(&struct{ uintptr }{xMerge})).f(tls, p, bp /* &doclist */, nMerge, (aBuf + uintptr(i1)*12))
- for iStore = i1; iStore < (i1 + nMerge); iStore++ {
- sqlite3Fts5BufferZero(tls, (aBuf + uintptr(iStore)*12))
+ })(unsafe.Pointer(&struct{ uintptr }{xMerge})).f(tls, p, bp /* &doclist */, nMerge, aBuf+uintptr(i1)*12)
+ for iStore = i1; iStore < i1+nMerge; iStore++ {
+ sqlite3Fts5BufferZero(tls, aBuf+uintptr(iStore)*12)
}
}
}
@@ -183078,28 +185581,28 @@ func fts5SetupPrefixIter(tls *libc.TLS, p uintptr, bDesc int32, iIdx int32, pTok
(*struct {
f func(*libc.TLS, uintptr, I64, uintptr, uintptr)
- })(unsafe.Pointer(&struct{ uintptr }{xAppend})).f(tls, p, ((*Fts5Iter)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 12 /* p1 */)))).Fbase.FiRowid - iLastRowid), *(*uintptr)(unsafe.Pointer(bp + 12 /* p1 */)), bp /* &doclist */)
+ })(unsafe.Pointer(&struct{ uintptr }{xAppend})).f(tls, p, (*Fts5Iter)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 12 /* p1 */)))).Fbase.FiRowid-iLastRowid, *(*uintptr)(unsafe.Pointer(bp + 12 /* p1 */)), bp /* &doclist */)
iLastRowid = (*Fts5Iter)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 12 /* p1 */)))).Fbase.FiRowid
}
- for i = 0; i < nBuf; i = i + (nMerge) {
+ for i = 0; i < nBuf; i = i + nMerge {
var iFree int32
if (*Fts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK {
(*struct {
f func(*libc.TLS, uintptr, uintptr, int32, uintptr)
- })(unsafe.Pointer(&struct{ uintptr }{xMerge})).f(tls, p, bp /* &doclist */, nMerge, (aBuf + uintptr(i)*12))
+ })(unsafe.Pointer(&struct{ uintptr }{xMerge})).f(tls, p, bp /* &doclist */, nMerge, aBuf+uintptr(i)*12)
}
- for iFree = i; iFree < (i + nMerge); iFree++ {
- sqlite3Fts5BufferFree(tls, (aBuf + uintptr(iFree)*12))
+ for iFree = i; iFree < i+nMerge; iFree++ {
+ sqlite3Fts5BufferFree(tls, aBuf+uintptr(iFree)*12)
}
}
fts5MultiIterFree(tls, *(*uintptr)(unsafe.Pointer(bp + 12 /* p1 */)))
- pData = fts5IdxMalloc(tls, p, (int64((uint32(unsafe.Sizeof(Fts5Data{})) + uint32((*Fts5Buffer)(unsafe.Pointer(bp /* &doclist */)).Fn)) + uint32(FTS5_DATA_ZERO_PADDING))))
+ pData = fts5IdxMalloc(tls, p, int64(uint32(unsafe.Sizeof(Fts5Data{}))+uint32((*Fts5Buffer)(unsafe.Pointer(bp)).Fn)+uint32(FTS5_DATA_ZERO_PADDING)))
if pData != 0 {
- (*Fts5Data)(unsafe.Pointer(pData)).Fp = (pData + 1*12)
- (*Fts5Data)(unsafe.Pointer(pData)).Fnn = libc.AssignPtrInt32(pData+8 /* &.szLeaf */, (*Fts5Buffer)(unsafe.Pointer(bp /* &doclist */)).Fn)
- if (*Fts5Buffer)(unsafe.Pointer(bp /* &doclist */)).Fn != 0 {
+ (*Fts5Data)(unsafe.Pointer(pData)).Fp = pData + 1*12
+ (*Fts5Data)(unsafe.Pointer(pData)).Fnn = libc.AssignPtrInt32(pData+8, (*Fts5Buffer)(unsafe.Pointer(bp /* &doclist */)).Fn)
+ if (*Fts5Buffer)(unsafe.Pointer(bp)).Fn != 0 {
libc.Xmemcpy(tls, (*Fts5Data)(unsafe.Pointer(pData)).Fp, (*Fts5Buffer)(unsafe.Pointer(bp /* &doclist */)).Fp, uint32((*Fts5Buffer)(unsafe.Pointer(bp /* &doclist */)).Fn))
}
fts5MultiIterNew2(tls, p, pData, bDesc, ppIter)
@@ -183113,17 +185616,17 @@ func fts5SetupPrefixIter(tls *libc.TLS, p uintptr, bDesc int32, iIdx int32, pTok
// Indicate that all subsequent calls to sqlite3Fts5IndexWrite() pertain
// to the document with rowid iRowid.
-func sqlite3Fts5IndexBeginWrite(tls *libc.TLS, p uintptr, bDelete int32, iRowid I64) int32 { /* sqlite3.c:226311:12: */
+func sqlite3Fts5IndexBeginWrite(tls *libc.TLS, p uintptr, bDelete int32, iRowid I64) int32 { /* sqlite3.c:228211:12: */
// Allocate the hash table if it has not already been allocated
if (*Fts5Index)(unsafe.Pointer(p)).FpHash == uintptr(0) {
- (*Fts5Index)(unsafe.Pointer(p)).Frc = sqlite3Fts5HashNew(tls, (*Fts5Index)(unsafe.Pointer(p)).FpConfig, (p + 12 /* &.pHash */), (p + 16 /* &.nPendingData */))
+ (*Fts5Index)(unsafe.Pointer(p)).Frc = sqlite3Fts5HashNew(tls, (*Fts5Index)(unsafe.Pointer(p)).FpConfig, p+12, p+16)
}
// Flush the hash table to disk if required
- if ((iRowid < (*Fts5Index)(unsafe.Pointer(p)).FiWriteRowid) ||
- ((iRowid == (*Fts5Index)(unsafe.Pointer(p)).FiWriteRowid) && ((*Fts5Index)(unsafe.Pointer(p)).FbDelete == 0))) ||
- ((*Fts5Index)(unsafe.Pointer(p)).FnPendingData > (*Fts5Config)(unsafe.Pointer((*Fts5Index)(unsafe.Pointer(p)).FpConfig)).FnHashSize) {
+ if iRowid < (*Fts5Index)(unsafe.Pointer(p)).FiWriteRowid ||
+ iRowid == (*Fts5Index)(unsafe.Pointer(p)).FiWriteRowid && (*Fts5Index)(unsafe.Pointer(p)).FbDelete == 0 ||
+ (*Fts5Index)(unsafe.Pointer(p)).FnPendingData > (*Fts5Config)(unsafe.Pointer((*Fts5Index)(unsafe.Pointer(p)).FpConfig)).FnHashSize {
fts5IndexFlush(tls, p)
}
@@ -183133,7 +185636,7 @@ func sqlite3Fts5IndexBeginWrite(tls *libc.TLS, p uintptr, bDelete int32, iRowid
}
// Commit data to disk.
-func sqlite3Fts5IndexSync(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:226335:12: */
+func sqlite3Fts5IndexSync(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:228235:12: */
fts5IndexFlush(tls, p)
sqlite3Fts5IndexCloseReader(tls, p)
@@ -183144,7 +185647,7 @@ func sqlite3Fts5IndexSync(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:226335:
// to the database. Additionally, assume that the contents of the %_data
// table may have changed on disk. So any in-memory caches of %_data
// records must be invalidated.
-func sqlite3Fts5IndexRollback(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:226348:12: */
+func sqlite3Fts5IndexRollback(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:228248:12: */
sqlite3Fts5IndexCloseReader(tls, p)
fts5IndexDiscardData(tls, p)
fts5StructureInvalidate(tls, p)
@@ -183155,7 +185658,7 @@ func sqlite3Fts5IndexRollback(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:226
// The %_data table is completely empty when this function is called. This
// function populates it with the initial structure objects for each index,
// and the initial version of the "averages" record (a zero-byte blob).
-func sqlite3Fts5IndexReinit(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:226361:12: */
+func sqlite3Fts5IndexReinit(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:228261:12: */
bp := tls.Alloc(40)
defer tls.Free(40)
@@ -183164,7 +185667,7 @@ func sqlite3Fts5IndexReinit(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:22636
fts5StructureInvalidate(tls, p)
fts5IndexDiscardData(tls, p)
libc.Xmemset(tls, bp /* &s */, 0, uint32(unsafe.Sizeof(Fts5Structure{})))
- fts5DataWrite(tls, p, int64(FTS5_AVERAGES_ROWID), ts+755 /* "" */, 0)
+ fts5DataWrite(tls, p, int64(FTS5_AVERAGES_ROWID), ts+1543 /* "" */, 0)
fts5StructureWrite(tls, p, bp /* &s */)
return fts5IndexReturn(tls, p)
}
@@ -183174,7 +185677,7 @@ func sqlite3Fts5IndexReinit(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:22636
//
// If successful, set *pp to point to the new object and return SQLITE_OK.
// Otherwise, set *pp to NULL and return an SQLite error code.
-func sqlite3Fts5IndexOpen(tls *libc.TLS, pConfig uintptr, bCreate int32, pp uintptr, pzErr uintptr) int32 { /* sqlite3.c:226378:12: */
+func sqlite3Fts5IndexOpen(tls *libc.TLS, pConfig uintptr, bCreate int32, pp uintptr, pzErr uintptr) int32 { /* sqlite3.c:228278:12: */
bp := tls.Alloc(12)
defer tls.Free(12)
@@ -183182,25 +185685,25 @@ func sqlite3Fts5IndexOpen(tls *libc.TLS, pConfig uintptr, bCreate int32, pp uint
var p uintptr // New object
*(*uintptr)(unsafe.Pointer(pp)) = libc.AssignUintptr(&p, sqlite3Fts5MallocZero(tls, bp+8 /* &rc */, int64(unsafe.Sizeof(Fts5Index{}))))
- if *(*int32)(unsafe.Pointer(bp + 8 /* rc */)) == SQLITE_OK {
+ if *(*int32)(unsafe.Pointer(bp + 8)) == SQLITE_OK {
(*Fts5Index)(unsafe.Pointer(p)).FpConfig = pConfig
(*Fts5Index)(unsafe.Pointer(p)).FnWorkUnit = FTS5_WORK_UNIT
- (*Fts5Index)(unsafe.Pointer(p)).FzDataTbl = sqlite3Fts5Mprintf(tls, bp+8 /* &rc */, ts+33335 /* "%s_data" */, libc.VaList(bp, (*Fts5Config)(unsafe.Pointer(pConfig)).FzName))
- if ((*Fts5Index)(unsafe.Pointer(p)).FzDataTbl != 0) && (bCreate != 0) {
+ (*Fts5Index)(unsafe.Pointer(p)).FzDataTbl = sqlite3Fts5Mprintf(tls, bp+8 /* &rc */, ts+34695 /* "%s_data" */, libc.VaList(bp, (*Fts5Config)(unsafe.Pointer(pConfig)).FzName))
+ if (*Fts5Index)(unsafe.Pointer(p)).FzDataTbl != 0 && bCreate != 0 {
*(*int32)(unsafe.Pointer(bp + 8 /* rc */)) = sqlite3Fts5CreateTable(tls,
- pConfig, ts+23316 /* "data" */, ts+33343 /* "id INTEGER PRIMA..." */, 0, pzErr)
- if *(*int32)(unsafe.Pointer(bp + 8 /* rc */)) == SQLITE_OK {
- *(*int32)(unsafe.Pointer(bp + 8 /* rc */)) = sqlite3Fts5CreateTable(tls, pConfig, ts+10212, /* "idx" */
- ts+33378, /* "segid, term, pgn..." */
+ pConfig, ts+24613 /* "data" */, ts+34703 /* "id INTEGER PRIMA..." */, 0, pzErr)
+ if *(*int32)(unsafe.Pointer(bp + 8)) == SQLITE_OK {
+ *(*int32)(unsafe.Pointer(bp + 8 /* rc */)) = sqlite3Fts5CreateTable(tls, pConfig, ts+11326, /* "idx" */
+ ts+34738, /* "segid, term, pgn..." */
1, pzErr)
}
- if *(*int32)(unsafe.Pointer(bp + 8 /* rc */)) == SQLITE_OK {
+ if *(*int32)(unsafe.Pointer(bp + 8)) == SQLITE_OK {
*(*int32)(unsafe.Pointer(bp + 8 /* rc */)) = sqlite3Fts5IndexReinit(tls, p)
}
}
}
- if *(*int32)(unsafe.Pointer(bp + 8 /* rc */)) != 0 {
+ if *(*int32)(unsafe.Pointer(bp + 8)) != 0 {
sqlite3Fts5IndexClose(tls, p)
*(*uintptr)(unsafe.Pointer(pp)) = uintptr(0)
}
@@ -183208,7 +185711,7 @@ func sqlite3Fts5IndexOpen(tls *libc.TLS, pConfig uintptr, bCreate int32, pp uint
}
// Close a handle opened by an earlier call to sqlite3Fts5IndexOpen().
-func sqlite3Fts5IndexClose(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:226419:12: */
+func sqlite3Fts5IndexClose(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:228319:12: */
var rc int32 = SQLITE_OK
if p != 0 {
@@ -183229,7 +185732,7 @@ func sqlite3Fts5IndexClose(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:226419
// Argument p points to a buffer containing utf-8 text that is n bytes in
// size. Return the number of bytes in the nChar character prefix of the
// buffer, or 0 if there are less than nChar characters in total.
-func sqlite3Fts5IndexCharlenToBytelen(tls *libc.TLS, p uintptr, nByte int32, nChar int32) int32 { /* sqlite3.c:226442:12: */
+func sqlite3Fts5IndexCharlenToBytelen(tls *libc.TLS, p uintptr, nByte int32, nChar int32) int32 { /* sqlite3.c:228342:12: */
var n int32 = 0
var i int32
for i = 0; i < nChar; i++ {
@@ -183240,10 +185743,10 @@ func sqlite3Fts5IndexCharlenToBytelen(tls *libc.TLS, p uintptr, nByte int32, nCh
if n >= nByte {
return 0
}
- for (int32(*(*uint8)(unsafe.Pointer(p + uintptr(n)))) & 0xc0) == 0x80 {
+ for int32(*(*uint8)(unsafe.Pointer(p + uintptr(n))))&0xc0 == 0x80 {
n++
if n >= nByte {
- if (i + 1) == nChar {
+ if i+1 == nChar {
break
}
return 0
@@ -183256,12 +185759,12 @@ func sqlite3Fts5IndexCharlenToBytelen(tls *libc.TLS, p uintptr, nByte int32, nCh
// pIn is a UTF-8 encoded string, nIn bytes in size. Return the number of
// unicode characters in the string.
-func fts5IndexCharlen(tls *libc.TLS, pIn uintptr, nIn int32) int32 { /* sqlite3.c:226469:12: */
+func fts5IndexCharlen(tls *libc.TLS, pIn uintptr, nIn int32) int32 { /* sqlite3.c:228369:12: */
var nChar int32 = 0
var i int32 = 0
for i < nIn {
if int32(uint8(*(*uint8)(unsafe.Pointer(pIn + uintptr(libc.PostIncInt32(&i, 1)))))) >= 0xc0 {
- for (i < nIn) && ((int32(*(*uint8)(unsafe.Pointer(pIn + uintptr(i)))) & 0xc0) == 0x80) {
+ for i < nIn && int32(*(*uint8)(unsafe.Pointer(pIn + uintptr(i))))&0xc0 == 0x80 {
i++
}
}
@@ -183278,7 +185781,7 @@ func fts5IndexCharlen(tls *libc.TLS, pIn uintptr, nIn int32) int32 { /* sqlite3.
// If the operation is a delete, it must be called (at least) once for each
// unique token in the document with an iCol value less than zero. The iPos
// argument is ignored for a delete.
-func sqlite3Fts5IndexWrite(tls *libc.TLS, p uintptr, iCol int32, iPos int32, pToken uintptr, nToken int32) int32 { /* sqlite3.c:226491:12: */
+func sqlite3Fts5IndexWrite(tls *libc.TLS, p uintptr, iCol int32, iPos int32, pToken uintptr, nToken int32) int32 { /* sqlite3.c:228391:12: */
var i int32 // Used to iterate through indexes
var rc int32 = SQLITE_OK // Return code
var pConfig uintptr = (*Fts5Index)(unsafe.Pointer(p)).FpConfig
@@ -183287,12 +185790,12 @@ func sqlite3Fts5IndexWrite(tls *libc.TLS, p uintptr, iCol int32, iPos int32, pTo
rc = sqlite3Fts5HashWrite(tls,
(*Fts5Index)(unsafe.Pointer(p)).FpHash, (*Fts5Index)(unsafe.Pointer(p)).FiWriteRowid, iCol, iPos, uint8('0'), pToken, nToken)
- for i = 0; (i < (*Fts5Config)(unsafe.Pointer(pConfig)).FnPrefix) && (rc == SQLITE_OK); i++ {
+ for i = 0; i < (*Fts5Config)(unsafe.Pointer(pConfig)).FnPrefix && rc == SQLITE_OK; i++ {
var nChar int32 = *(*int32)(unsafe.Pointer((*Fts5Config)(unsafe.Pointer(pConfig)).FaPrefix + uintptr(i)*4))
var nByte int32 = sqlite3Fts5IndexCharlenToBytelen(tls, pToken, nToken, nChar)
if nByte != 0 {
rc = sqlite3Fts5HashWrite(tls, (*Fts5Index)(unsafe.Pointer(p)).FpHash,
- (*Fts5Index)(unsafe.Pointer(p)).FiWriteRowid, iCol, iPos, (uint8(('0' + i) + 1)), pToken,
+ (*Fts5Index)(unsafe.Pointer(p)).FiWriteRowid, iCol, iPos, uint8('0'+i+1), pToken,
nByte)
}
}
@@ -183302,7 +185805,7 @@ func sqlite3Fts5IndexWrite(tls *libc.TLS, p uintptr, iCol int32, iPos int32, pTo
// Open a new iterator to iterate though all rowid that match the
// specified token or token prefix.
-func sqlite3Fts5IndexQuery(tls *libc.TLS, p uintptr, pToken uintptr, nToken int32, flags int32, pColset uintptr, ppIter uintptr) int32 { /* sqlite3.c:226527:12: */
+func sqlite3Fts5IndexQuery(tls *libc.TLS, p uintptr, pToken uintptr, nToken int32, flags int32, pColset uintptr, ppIter uintptr) int32 { /* sqlite3.c:228427:12: */
bp := tls.Alloc(16)
defer tls.Free(16)
@@ -183312,11 +185815,11 @@ func sqlite3Fts5IndexQuery(tls *libc.TLS, p uintptr, pToken uintptr, nToken int3
// If the QUERY_SCAN flag is set, all other flags must be clear.
- if sqlite3Fts5BufferSize(tls, (p+36 /* &.rc */), bp /* &buf */, (uint32(nToken+1))) == 0 {
+ if sqlite3Fts5BufferSize(tls, p+36, bp, uint32(nToken+1)) == 0 {
var iIdx int32 = 0 // Index to search
var iPrefixIdx int32 = 0 // +1 prefix index
if nToken != 0 {
- libc.Xmemcpy(tls, ((*Fts5Buffer)(unsafe.Pointer(bp /* &buf */)).Fp + 1), pToken, uint32(nToken))
+ libc.Xmemcpy(tls, (*Fts5Buffer)(unsafe.Pointer(bp)).Fp+1, pToken, uint32(nToken))
}
// Figure out which index to search and set iIdx accordingly. If this
@@ -183329,14 +185832,14 @@ func sqlite3Fts5IndexQuery(tls *libc.TLS, p uintptr, pToken uintptr, nToken int3
// evaluate the prefix query using the main FTS index. This is used
// for internal sanity checking by the integrity-check in debug
// mode only.
- if (flags & FTS5INDEX_QUERY_PREFIX) != 0 {
+ if flags&FTS5INDEX_QUERY_PREFIX != 0 {
var nChar int32 = fts5IndexCharlen(tls, pToken, nToken)
for iIdx = 1; iIdx <= (*Fts5Config)(unsafe.Pointer(pConfig)).FnPrefix; iIdx++ {
- var nIdxChar int32 = *(*int32)(unsafe.Pointer((*Fts5Config)(unsafe.Pointer(pConfig)).FaPrefix + uintptr((iIdx-1))*4))
+ var nIdxChar int32 = *(*int32)(unsafe.Pointer((*Fts5Config)(unsafe.Pointer(pConfig)).FaPrefix + uintptr(iIdx-1)*4))
if nIdxChar == nChar {
break
}
- if nIdxChar == (nChar + 1) {
+ if nIdxChar == nChar+1 {
iPrefixIdx = iIdx
}
}
@@ -183345,24 +185848,28 @@ func sqlite3Fts5IndexQuery(tls *libc.TLS, p uintptr, pToken uintptr, nToken int3
if iIdx <= (*Fts5Config)(unsafe.Pointer(pConfig)).FnPrefix {
// Straight index lookup
var pStruct uintptr = fts5StructureRead(tls, p)
- *(*U8)(unsafe.Pointer((*Fts5Buffer)(unsafe.Pointer(bp /* &buf */)).Fp)) = (U8('0' + iIdx))
+ *(*U8)(unsafe.Pointer((*Fts5Buffer)(unsafe.Pointer(bp /* &buf */)).Fp)) = U8('0' + iIdx)
if pStruct != 0 {
- fts5MultiIterNew(tls, p, pStruct, (flags | FTS5INDEX_QUERY_SKIPEMPTY),
- pColset, (*Fts5Buffer)(unsafe.Pointer(bp /* &buf */)).Fp, (nToken + 1), -1, 0, bp+12 /* &pRet */)
+ fts5MultiIterNew(tls, p, pStruct, flags|FTS5INDEX_QUERY_SKIPEMPTY,
+ pColset, (*Fts5Buffer)(unsafe.Pointer(bp /* &buf */)).Fp, nToken+1, -1, 0, bp+12 /* &pRet */)
fts5StructureRelease(tls, pStruct)
}
} else {
// Scan multiple terms in the main index
- var bDesc int32 = (libc.Bool32((flags & FTS5INDEX_QUERY_DESC) != 0))
- fts5SetupPrefixIter(tls, p, bDesc, iPrefixIdx, (*Fts5Buffer)(unsafe.Pointer(bp /* &buf */)).Fp, (nToken + 1), pColset, bp+12 /* &pRet */)
+ var bDesc int32 = libc.Bool32(flags&FTS5INDEX_QUERY_DESC != 0)
+ fts5SetupPrefixIter(tls, p, bDesc, iPrefixIdx, (*Fts5Buffer)(unsafe.Pointer(bp /* &buf */)).Fp, nToken+1, pColset, bp+12 /* &pRet */)
+ if *(*uintptr)(unsafe.Pointer(bp + 12)) == uintptr(0) {
- fts5IterSetOutputCb(tls, (p + 36 /* &.rc */), *(*uintptr)(unsafe.Pointer(bp + 12 /* pRet */)))
- if (*Fts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK {
- var pSeg uintptr = ((*(*uintptr)(unsafe.Pointer(bp + 12 /* pRet */)) + 80 /* &.aSeg */) + uintptr((*Fts5CResult)(unsafe.Pointer((*Fts5Iter)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 12 /* pRet */)))).FaFirst+1*4)).FiFirst)*96)
- if (*Fts5SegIter)(unsafe.Pointer(pSeg)).FpLeaf != 0 {
- (*struct {
- f func(*libc.TLS, uintptr, uintptr)
- })(unsafe.Pointer(&struct{ uintptr }{(*Fts5Iter)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 12 /* pRet */)))).FxSetOutputs})).f(tls, *(*uintptr)(unsafe.Pointer(bp + 12 /* pRet */)), pSeg)
+ } else {
+
+ fts5IterSetOutputCb(tls, p+36, *(*uintptr)(unsafe.Pointer(bp + 12 /* pRet */)))
+ if (*Fts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK {
+ var pSeg uintptr = *(*uintptr)(unsafe.Pointer(bp + 12)) + 80 + uintptr((*Fts5CResult)(unsafe.Pointer((*Fts5Iter)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 12)))).FaFirst+1*4)).FiFirst)*96
+ if (*Fts5SegIter)(unsafe.Pointer(pSeg)).FpLeaf != 0 {
+ (*struct {
+ f func(*libc.TLS, uintptr, uintptr)
+ })(unsafe.Pointer(&struct{ uintptr }{(*Fts5Iter)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 12 /* pRet */)))).FxSetOutputs})).f(tls, *(*uintptr)(unsafe.Pointer(bp + 12 /* pRet */)), pSeg)
+ }
}
}
}
@@ -183381,7 +185888,7 @@ func sqlite3Fts5IndexQuery(tls *libc.TLS, p uintptr, pToken uintptr, nToken int3
// Return true if the iterator passed as the only argument is at EOF.
// Move to the next matching rowid.
-func sqlite3Fts5IterNext(tls *libc.TLS, pIndexIter uintptr) int32 { /* sqlite3.c:226611:12: */
+func sqlite3Fts5IterNext(tls *libc.TLS, pIndexIter uintptr) int32 { /* sqlite3.c:228515:12: */
var pIter uintptr = pIndexIter
fts5MultiIterNext(tls, (*Fts5Iter)(unsafe.Pointer(pIter)).FpIndex, pIter, 0, int64(0))
@@ -183389,14 +185896,14 @@ func sqlite3Fts5IterNext(tls *libc.TLS, pIndexIter uintptr) int32 { /* sqlite3.c
}
// Move to the next matching term/rowid. Used by the fts5vocab module.
-func sqlite3Fts5IterNextScan(tls *libc.TLS, pIndexIter uintptr) int32 { /* sqlite3.c:226621:12: */
+func sqlite3Fts5IterNextScan(tls *libc.TLS, pIndexIter uintptr) int32 { /* sqlite3.c:228525:12: */
var pIter uintptr = pIndexIter
var p uintptr = (*Fts5Iter)(unsafe.Pointer(pIter)).FpIndex
fts5MultiIterNext(tls, p, pIter, 0, int64(0))
if (*Fts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK {
- var pSeg uintptr = ((pIter + 80 /* &.aSeg */) + uintptr((*Fts5CResult)(unsafe.Pointer((*Fts5Iter)(unsafe.Pointer(pIter)).FaFirst+1*4)).FiFirst)*96)
- if ((*Fts5SegIter)(unsafe.Pointer(pSeg)).FpLeaf != 0) && (int32(*(*U8)(unsafe.Pointer((*Fts5SegIter)(unsafe.Pointer(pSeg)).Fterm.Fp))) != '0') {
+ var pSeg uintptr = pIter + 80 + uintptr((*Fts5CResult)(unsafe.Pointer((*Fts5Iter)(unsafe.Pointer(pIter)).FaFirst+1*4)).FiFirst)*96
+ if (*Fts5SegIter)(unsafe.Pointer(pSeg)).FpLeaf != 0 && int32(*(*U8)(unsafe.Pointer((*Fts5SegIter)(unsafe.Pointer(pSeg)).Fterm.Fp))) != '0' {
fts5DataRelease(tls, (*Fts5SegIter)(unsafe.Pointer(pSeg)).FpLeaf)
(*Fts5SegIter)(unsafe.Pointer(pSeg)).FpLeaf = uintptr(0)
(*Fts5Iter)(unsafe.Pointer(pIter)).Fbase.FbEof = U8(1)
@@ -183409,14 +185916,14 @@ func sqlite3Fts5IterNextScan(tls *libc.TLS, pIndexIter uintptr) int32 { /* sqlit
// Move to the next matching rowid that occurs at or after iMatch. The
// definition of "at or after" depends on whether this iterator iterates
// in ascending or descending rowid order.
-func sqlite3Fts5IterNextFrom(tls *libc.TLS, pIndexIter uintptr, iMatch I64) int32 { /* sqlite3.c:226645:12: */
+func sqlite3Fts5IterNextFrom(tls *libc.TLS, pIndexIter uintptr, iMatch I64) int32 { /* sqlite3.c:228549:12: */
var pIter uintptr = pIndexIter
fts5MultiIterNextFrom(tls, (*Fts5Iter)(unsafe.Pointer(pIter)).FpIndex, pIter, iMatch)
return fts5IndexReturn(tls, (*Fts5Iter)(unsafe.Pointer(pIter)).FpIndex)
}
// Return the current term.
-func sqlite3Fts5IterTerm(tls *libc.TLS, pIndexIter uintptr, pn uintptr) uintptr { /* sqlite3.c:226654:19: */
+func sqlite3Fts5IterTerm(tls *libc.TLS, pIndexIter uintptr, pn uintptr) uintptr { /* sqlite3.c:228558:19: */
bp := tls.Alloc(4)
defer tls.Free(4)
@@ -183424,17 +185931,17 @@ func sqlite3Fts5IterTerm(tls *libc.TLS, pIndexIter uintptr, pn uintptr) uintptr
var z uintptr = fts5MultiIterTerm(tls, pIndexIter, bp /* &n */)
- *(*int32)(unsafe.Pointer(pn)) = (*(*int32)(unsafe.Pointer(bp /* n */)) - 1)
+ *(*int32)(unsafe.Pointer(pn)) = *(*int32)(unsafe.Pointer(bp)) - 1
return func() uintptr {
if z != 0 {
- return (z + 1)
+ return z + 1
}
return uintptr(0)
}()
}
// Close an iterator opened by an earlier call to sqlite3Fts5IndexQuery().
-func sqlite3Fts5IterClose(tls *libc.TLS, pIndexIter uintptr) { /* sqlite3.c:226665:13: */
+func sqlite3Fts5IterClose(tls *libc.TLS, pIndexIter uintptr) { /* sqlite3.c:228569:13: */
if pIndexIter != 0 {
var pIter uintptr = pIndexIter
var pIndex uintptr = (*Fts5Iter)(unsafe.Pointer(pIter)).FpIndex
@@ -183447,19 +185954,19 @@ func sqlite3Fts5IterClose(tls *libc.TLS, pIndexIter uintptr) { /* sqlite3.c:2266
//
// Parameter anSize must point to an array of size nCol, where nCol is
// the number of user defined columns in the FTS table.
-func sqlite3Fts5IndexGetAverages(tls *libc.TLS, p uintptr, pnRow uintptr, anSize uintptr) int32 { /* sqlite3.c:226680:12: */
+func sqlite3Fts5IndexGetAverages(tls *libc.TLS, p uintptr, pnRow uintptr, anSize uintptr) int32 { /* sqlite3.c:228584:12: */
var nCol int32 = (*Fts5Config)(unsafe.Pointer((*Fts5Index)(unsafe.Pointer(p)).FpConfig)).FnCol
var pData uintptr
*(*I64)(unsafe.Pointer(pnRow)) = int64(0)
- libc.Xmemset(tls, anSize, 0, (uint32(unsafe.Sizeof(I64(0))) * uint32(nCol)))
+ libc.Xmemset(tls, anSize, 0, uint32(unsafe.Sizeof(I64(0)))*uint32(nCol))
pData = fts5DataRead(tls, p, int64(FTS5_AVERAGES_ROWID))
- if ((*Fts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK) && ((*Fts5Data)(unsafe.Pointer(pData)).Fnn != 0) {
+ if (*Fts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK && (*Fts5Data)(unsafe.Pointer(pData)).Fnn != 0 {
var i int32 = 0
var iCol int32
- i = i + (int32(sqlite3Fts5GetVarint(tls, ((*Fts5Data)(unsafe.Pointer(pData)).Fp + uintptr(i)), pnRow)))
- for iCol = 0; (i < (*Fts5Data)(unsafe.Pointer(pData)).Fnn) && (iCol < nCol); iCol++ {
- i = i + (int32(sqlite3Fts5GetVarint(tls, ((*Fts5Data)(unsafe.Pointer(pData)).Fp + uintptr(i)), (anSize + uintptr(iCol)*8))))
+ i = i + int32(sqlite3Fts5GetVarint(tls, (*Fts5Data)(unsafe.Pointer(pData)).Fp+uintptr(i), pnRow))
+ for iCol = 0; i < (*Fts5Data)(unsafe.Pointer(pData)).Fnn && iCol < nCol; iCol++ {
+ i = i + int32(sqlite3Fts5GetVarint(tls, (*Fts5Data)(unsafe.Pointer(pData)).Fp+uintptr(i), anSize+uintptr(iCol)*8))
}
}
@@ -183469,7 +185976,7 @@ func sqlite3Fts5IndexGetAverages(tls *libc.TLS, p uintptr, pnRow uintptr, anSize
// Replace the current "averages" record with the contents of the buffer
// supplied as the second argument.
-func sqlite3Fts5IndexSetAverages(tls *libc.TLS, p uintptr, pData uintptr, nData int32) int32 { /* sqlite3.c:226704:12: */
+func sqlite3Fts5IndexSetAverages(tls *libc.TLS, p uintptr, pData uintptr, nData int32) int32 { /* sqlite3.c:228608:12: */
fts5DataWrite(tls, p, int64(FTS5_AVERAGES_ROWID), pData, nData)
return fts5IndexReturn(tls, p)
@@ -183477,7 +185984,7 @@ func sqlite3Fts5IndexSetAverages(tls *libc.TLS, p uintptr, pData uintptr, nData
// Return the total number of blocks this module has read from the %_data
// table since it was created.
-func sqlite3Fts5IndexReads(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:226714:12: */
+func sqlite3Fts5IndexReads(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:228618:12: */
return (*Fts5Index)(unsafe.Pointer(p)).FnRead
}
@@ -183486,7 +185993,7 @@ func sqlite3Fts5IndexReads(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:226714
//
// Return SQLITE_OK if successful, or an SQLite error code if an error
// occurs.
-func sqlite3Fts5IndexSetCookie(tls *libc.TLS, p uintptr, iNew int32) int32 { /* sqlite3.c:226725:12: */
+func sqlite3Fts5IndexSetCookie(tls *libc.TLS, p uintptr, iNew int32) int32 { /* sqlite3.c:228629:12: */
bp := tls.Alloc(8)
defer tls.Free(8)
@@ -183499,7 +186006,7 @@ func sqlite3Fts5IndexSetCookie(tls *libc.TLS, p uintptr, iNew int32) int32 { /*
sqlite3Fts5Put32(tls, bp /* &aCookie[0] */, iNew)
rc = Xsqlite3_blob_open(tls, (*Fts5Config)(unsafe.Pointer(pConfig)).Fdb, (*Fts5Config)(unsafe.Pointer(pConfig)).FzDb, (*Fts5Index)(unsafe.Pointer(p)).FzDataTbl,
- ts+33025 /* "block" */, int64(FTS5_STRUCTURE_ROWID), 1, bp+4 /* &pBlob */)
+ ts+34385 /* "block" */, int64(FTS5_STRUCTURE_ROWID), 1, bp+4 /* &pBlob */)
if rc == SQLITE_OK {
Xsqlite3_blob_write(tls, *(*uintptr)(unsafe.Pointer(bp + 4 /* pBlob */)), bp /* &aCookie[0] */, 4, 0)
rc = Xsqlite3_blob_close(tls, *(*uintptr)(unsafe.Pointer(bp + 4 /* pBlob */)))
@@ -183508,7 +186015,7 @@ func sqlite3Fts5IndexSetCookie(tls *libc.TLS, p uintptr, iNew int32) int32 { /*
return rc
}
-func sqlite3Fts5IndexLoadConfig(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:226745:12: */
+func sqlite3Fts5IndexLoadConfig(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:228649:12: */
var pStruct uintptr
pStruct = fts5StructureRead(tls, p)
fts5StructureRelease(tls, pStruct)
@@ -183522,16 +186029,16 @@ func sqlite3Fts5IndexLoadConfig(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:2
// functionality.
// Return a simple checksum value based on the arguments.
-func sqlite3Fts5IndexEntryCksum(tls *libc.TLS, iRowid I64, iCol int32, iPos int32, iIdx int32, pTerm uintptr, nTerm int32) U64 { /* sqlite3.c:226762:12: */
+func sqlite3Fts5IndexEntryCksum(tls *libc.TLS, iRowid I64, iCol int32, iPos int32, iIdx int32, pTerm uintptr, nTerm int32) U64 { /* sqlite3.c:228666:12: */
var i int32
var ret U64 = U64(iRowid)
- ret = ret + ((ret << 3) + U64(iCol))
- ret = ret + ((ret << 3) + U64(iPos))
+ ret = ret + (ret<<3 + U64(iCol))
+ ret = ret + (ret<<3 + U64(iPos))
if iIdx >= 0 {
- ret = ret + ((ret << 3) + (U64('0' + iIdx)))
+ ret = ret + (ret<<3 + U64('0'+iIdx))
}
for i = 0; i < nTerm; i++ {
- ret = ret + ((ret << 3) + U64(*(*uint8)(unsafe.Pointer(pTerm + uintptr(i)))))
+ ret = ret + (ret<<3 + U64(*(*uint8)(unsafe.Pointer(pTerm + uintptr(i)))))
}
return ret
}
@@ -183542,26 +186049,26 @@ func sqlite3Fts5IndexEntryCksum(tls *libc.TLS, iRowid I64, iCol int32, iPos int3
// contain zero terms.
// 2) All leaves of pSeg between iNoRowid and iLast (inclusive) exist and
// contain zero rowids.
-func fts5IndexIntegrityCheckEmpty(tls *libc.TLS, p uintptr, pSeg uintptr, iFirst int32, iNoRowid int32, iLast int32) { /* sqlite3.c:226980:13: */
+func fts5IndexIntegrityCheckEmpty(tls *libc.TLS, p uintptr, pSeg uintptr, iFirst int32, iNoRowid int32, iLast int32) { /* sqlite3.c:228884:13: */
var i int32
// Now check that the iter.nEmpty leaves following the current leaf
// (a) exist and (b) contain no terms.
- for i = iFirst; ((*Fts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK) && (i <= iLast); i++ {
- var pLeaf uintptr = fts5DataRead(tls, p, (((((I64((*Fts5StructureSegment)(unsafe.Pointer(pSeg)).FiSegid)) << ((FTS5_DATA_PAGE_B + FTS5_DATA_HEIGHT_B) + FTS5_DATA_DLI_B)) + (I64((int64(0))) << (FTS5_DATA_PAGE_B + FTS5_DATA_HEIGHT_B))) + (I64((int64(0))) << (FTS5_DATA_PAGE_B))) + (I64(i))))
+ for i = iFirst; (*Fts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK && i <= iLast; i++ {
+ var pLeaf uintptr = fts5DataRead(tls, p, I64((*Fts5StructureSegment)(unsafe.Pointer(pSeg)).FiSegid)<<(FTS5_DATA_PAGE_B+FTS5_DATA_HEIGHT_B+FTS5_DATA_DLI_B)+I64(int64(0))<<(FTS5_DATA_PAGE_B+FTS5_DATA_HEIGHT_B)+I64(int64(0))<<FTS5_DATA_PAGE_B+I64(i))
if pLeaf != 0 {
- if !((*Fts5Data)(unsafe.Pointer((pLeaf))).FszLeaf >= (*Fts5Data)(unsafe.Pointer((pLeaf))).Fnn) {
- (*Fts5Index)(unsafe.Pointer(p)).Frc = (SQLITE_CORRUPT | (int32(1) << 8))
+ if !((*Fts5Data)(unsafe.Pointer(pLeaf)).FszLeaf >= (*Fts5Data)(unsafe.Pointer(pLeaf)).Fnn) {
+ (*Fts5Index)(unsafe.Pointer(p)).Frc = SQLITE_CORRUPT | int32(1)<<8
}
- if (i >= iNoRowid) && (0 != (int32(fts5GetU16(tls, (*Fts5Data)(unsafe.Pointer(pLeaf)).Fp)))) {
- (*Fts5Index)(unsafe.Pointer(p)).Frc = (SQLITE_CORRUPT | (int32(1) << 8))
+ if i >= iNoRowid && 0 != int32(fts5GetU16(tls, (*Fts5Data)(unsafe.Pointer(pLeaf)).Fp)) {
+ (*Fts5Index)(unsafe.Pointer(p)).Frc = SQLITE_CORRUPT | int32(1)<<8
}
}
fts5DataRelease(tls, pLeaf)
}
}
-func fts5IntegrityCheckPgidx(tls *libc.TLS, p uintptr, pLeaf uintptr) { /* sqlite3.c:227001:13: */
+func fts5IntegrityCheckPgidx(tls *libc.TLS, p uintptr, pLeaf uintptr) { /* sqlite3.c:228905:13: */
bp := tls.Alloc(40)
defer tls.Free(40)
@@ -183572,62 +186079,62 @@ func fts5IntegrityCheckPgidx(tls *libc.TLS, p uintptr, pLeaf uintptr) { /* sqlit
*(*Fts5Buffer)(unsafe.Pointer(bp + 28 /* buf2 */)) = Fts5Buffer{}
ii = (*Fts5Data)(unsafe.Pointer(pLeaf)).FszLeaf
- for (ii < (*Fts5Data)(unsafe.Pointer(pLeaf)).Fnn) && ((*Fts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK) {
+ for ii < (*Fts5Data)(unsafe.Pointer(pLeaf)).Fnn && (*Fts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK {
var res int32
var iOff int32
// var nIncr int32 at bp, 4
- ii = ii + (sqlite3Fts5GetVarint32(tls, ((*Fts5Data)(unsafe.Pointer(pLeaf)).Fp + uintptr(ii)), bp /* &nIncr */))
- iTermOff = iTermOff + (*(*int32)(unsafe.Pointer(bp /* nIncr */)))
+ ii = ii + sqlite3Fts5GetVarint32(tls, (*Fts5Data)(unsafe.Pointer(pLeaf)).Fp+uintptr(ii), bp)
+ iTermOff = iTermOff + *(*int32)(unsafe.Pointer(bp))
iOff = iTermOff
if iOff >= (*Fts5Data)(unsafe.Pointer(pLeaf)).FszLeaf {
- (*Fts5Index)(unsafe.Pointer(p)).Frc = (SQLITE_CORRUPT | (int32(1) << 8))
- } else if iTermOff == *(*int32)(unsafe.Pointer(bp /* nIncr */)) {
+ (*Fts5Index)(unsafe.Pointer(p)).Frc = SQLITE_CORRUPT | int32(1)<<8
+ } else if iTermOff == *(*int32)(unsafe.Pointer(bp)) {
// var nByte int32 at bp+4, 4
- iOff = iOff + (sqlite3Fts5GetVarint32(tls, ((*Fts5Data)(unsafe.Pointer(pLeaf)).Fp + uintptr(iOff)), bp+4 /* &nByte */))
- if (iOff + *(*int32)(unsafe.Pointer(bp + 4 /* nByte */))) > (*Fts5Data)(unsafe.Pointer(pLeaf)).FszLeaf {
- (*Fts5Index)(unsafe.Pointer(p)).Frc = (SQLITE_CORRUPT | (int32(1) << 8))
+ iOff = iOff + sqlite3Fts5GetVarint32(tls, (*Fts5Data)(unsafe.Pointer(pLeaf)).Fp+uintptr(iOff), bp+4)
+ if iOff+*(*int32)(unsafe.Pointer(bp + 4)) > (*Fts5Data)(unsafe.Pointer(pLeaf)).FszLeaf {
+ (*Fts5Index)(unsafe.Pointer(p)).Frc = SQLITE_CORRUPT | int32(1)<<8
} else {
- sqlite3Fts5BufferSet(tls, (p + 36 /* &.rc */), bp+8 /* &buf1 */, *(*int32)(unsafe.Pointer(bp + 4 /* nByte */)), ((*Fts5Data)(unsafe.Pointer(pLeaf)).Fp + uintptr(iOff)))
+ sqlite3Fts5BufferSet(tls, p+36, bp+8 /* &buf1 */, *(*int32)(unsafe.Pointer(bp + 4 /* nByte */)), (*Fts5Data)(unsafe.Pointer(pLeaf)).Fp+uintptr(iOff))
}
} else {
// var nKeep int32 at bp+20, 4
// var nByte int32 at bp+24, 4
- iOff = iOff + (sqlite3Fts5GetVarint32(tls, ((*Fts5Data)(unsafe.Pointer(pLeaf)).Fp + uintptr(iOff)), bp+20 /* &nKeep */))
- iOff = iOff + (sqlite3Fts5GetVarint32(tls, ((*Fts5Data)(unsafe.Pointer(pLeaf)).Fp + uintptr(iOff)), bp+24 /* &nByte */))
- if (*(*int32)(unsafe.Pointer(bp + 20 /* nKeep */)) > (*Fts5Buffer)(unsafe.Pointer(bp+8 /* &buf1 */)).Fn) || ((iOff + *(*int32)(unsafe.Pointer(bp + 24 /* nByte */))) > (*Fts5Data)(unsafe.Pointer(pLeaf)).FszLeaf) {
- (*Fts5Index)(unsafe.Pointer(p)).Frc = (SQLITE_CORRUPT | (int32(1) << 8))
+ iOff = iOff + sqlite3Fts5GetVarint32(tls, (*Fts5Data)(unsafe.Pointer(pLeaf)).Fp+uintptr(iOff), bp+20)
+ iOff = iOff + sqlite3Fts5GetVarint32(tls, (*Fts5Data)(unsafe.Pointer(pLeaf)).Fp+uintptr(iOff), bp+24)
+ if *(*int32)(unsafe.Pointer(bp + 20)) > (*Fts5Buffer)(unsafe.Pointer(bp+8)).Fn || iOff+*(*int32)(unsafe.Pointer(bp + 24)) > (*Fts5Data)(unsafe.Pointer(pLeaf)).FszLeaf {
+ (*Fts5Index)(unsafe.Pointer(p)).Frc = SQLITE_CORRUPT | int32(1)<<8
} else {
(*Fts5Buffer)(unsafe.Pointer(bp + 8 /* &buf1 */)).Fn = *(*int32)(unsafe.Pointer(bp + 20 /* nKeep */))
- sqlite3Fts5BufferAppendBlob(tls, (p + 36 /* &.rc */), bp+8 /* &buf1 */, uint32(*(*int32)(unsafe.Pointer(bp + 24 /* nByte */))), ((*Fts5Data)(unsafe.Pointer(pLeaf)).Fp + uintptr(iOff)))
+ sqlite3Fts5BufferAppendBlob(tls, p+36, bp+8 /* &buf1 */, uint32(*(*int32)(unsafe.Pointer(bp + 24 /* nByte */))), (*Fts5Data)(unsafe.Pointer(pLeaf)).Fp+uintptr(iOff))
}
if (*Fts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK {
res = fts5BufferCompare(tls, bp+8 /* &buf1 */, bp+28 /* &buf2 */)
if res <= 0 {
- (*Fts5Index)(unsafe.Pointer(p)).Frc = (SQLITE_CORRUPT | (int32(1) << 8))
+ (*Fts5Index)(unsafe.Pointer(p)).Frc = SQLITE_CORRUPT | int32(1)<<8
}
}
}
- sqlite3Fts5BufferSet(tls, (p + 36 /* &.rc */), bp+28 /* &buf2 */, (*Fts5Buffer)(unsafe.Pointer(bp+8 /* &buf1 */)).Fn, (*Fts5Buffer)(unsafe.Pointer(bp+8 /* &buf1 */)).Fp)
+ sqlite3Fts5BufferSet(tls, p+36, bp+28 /* &buf2 */, (*Fts5Buffer)(unsafe.Pointer(bp+8 /* &buf1 */)).Fn, (*Fts5Buffer)(unsafe.Pointer(bp+8 /* &buf1 */)).Fp)
}
sqlite3Fts5BufferFree(tls, bp+8 /* &buf1 */)
sqlite3Fts5BufferFree(tls, bp+28 /* &buf2 */)
}
-func fts5IndexIntegrityCheckSegment(tls *libc.TLS, p uintptr, pSeg uintptr) { /* sqlite3.c:227051:13: */
+func fts5IndexIntegrityCheckSegment(tls *libc.TLS, p uintptr, pSeg uintptr) { /* sqlite3.c:228955:13: */
bp := tls.Alloc(40)
defer tls.Free(40)
var pConfig uintptr = (*Fts5Index)(unsafe.Pointer(p)).FpConfig
*(*uintptr)(unsafe.Pointer(bp + 24 /* pStmt */)) = uintptr(0)
var rc2 int32
- var iIdxPrevLeaf int32 = ((*Fts5StructureSegment)(unsafe.Pointer(pSeg)).FpgnoFirst - 1)
+ var iIdxPrevLeaf int32 = (*Fts5StructureSegment)(unsafe.Pointer(pSeg)).FpgnoFirst - 1
var iDlidxPrevLeaf int32 = (*Fts5StructureSegment)(unsafe.Pointer(pSeg)).FpgnoLast
if (*Fts5StructureSegment)(unsafe.Pointer(pSeg)).FpgnoFirst == 0 {
@@ -183636,11 +186143,11 @@ func fts5IndexIntegrityCheckSegment(tls *libc.TLS, p uintptr, pSeg uintptr) { /*
fts5IndexPrepareStmt(tls, p, bp+24 /* &pStmt */, Xsqlite3_mprintf(tls,
- ts+33422, /* "SELECT segid, te..." */
+ ts+34782, /* "SELECT segid, te..." */
libc.VaList(bp, (*Fts5Config)(unsafe.Pointer(pConfig)).FzDb, (*Fts5Config)(unsafe.Pointer(pConfig)).FzName, (*Fts5StructureSegment)(unsafe.Pointer(pSeg)).FiSegid)))
// Iterate through the b-tree hierarchy.
- for ((*Fts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK) && (SQLITE_ROW == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp + 24 /* pStmt */)))) {
+ for (*Fts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK && SQLITE_ROW == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp + 24))) {
var iRow I64 // Rowid for this leaf
var pLeaf uintptr // Data for this leaf
@@ -183654,7 +186161,7 @@ func fts5IndexIntegrityCheckSegment(tls *libc.TLS, p uintptr, pSeg uintptr) { /*
if iIdxLeaf < (*Fts5StructureSegment)(unsafe.Pointer(pSeg)).FpgnoFirst {
continue
}
- iRow = (((((I64((*Fts5StructureSegment)(unsafe.Pointer(pSeg)).FiSegid)) << ((FTS5_DATA_PAGE_B + FTS5_DATA_HEIGHT_B) + FTS5_DATA_DLI_B)) + (I64((int64(0))) << (FTS5_DATA_PAGE_B + FTS5_DATA_HEIGHT_B))) + (I64((int64(0))) << (FTS5_DATA_PAGE_B))) + (I64(iIdxLeaf)))
+ iRow = I64((*Fts5StructureSegment)(unsafe.Pointer(pSeg)).FiSegid)<<(FTS5_DATA_PAGE_B+FTS5_DATA_HEIGHT_B+FTS5_DATA_DLI_B) + I64(int64(0))<<(FTS5_DATA_PAGE_B+FTS5_DATA_HEIGHT_B) + I64(int64(0))<<FTS5_DATA_PAGE_B + I64(iIdxLeaf)
pLeaf = fts5LeafRead(tls, p, iRow)
if pLeaf == uintptr(0) {
break
@@ -183665,7 +186172,7 @@ func fts5IndexIntegrityCheckSegment(tls *libc.TLS, p uintptr, pSeg uintptr) { /*
// is also a rowid pointer within the leaf page header, it points to a
// location before the term.
if (*Fts5Data)(unsafe.Pointer(pLeaf)).Fnn <= (*Fts5Data)(unsafe.Pointer(pLeaf)).FszLeaf {
- (*Fts5Index)(unsafe.Pointer(p)).Frc = (SQLITE_CORRUPT | (int32(1) << 8))
+ (*Fts5Index)(unsafe.Pointer(p)).Frc = SQLITE_CORRUPT | int32(1)<<8
} else {
var iOff int32 // Offset of first term on leaf
var iRowidOff int32 // Offset of first rowid on leaf
@@ -183675,31 +186182,31 @@ func fts5IndexIntegrityCheckSegment(tls *libc.TLS, p uintptr, pSeg uintptr) { /*
iOff = fts5LeafFirstTermOff(tls, pLeaf)
iRowidOff = int32(fts5GetU16(tls, (*Fts5Data)(unsafe.Pointer(pLeaf)).Fp))
- if (iRowidOff >= iOff) || (iOff >= (*Fts5Data)(unsafe.Pointer(pLeaf)).FszLeaf) {
- (*Fts5Index)(unsafe.Pointer(p)).Frc = (SQLITE_CORRUPT | (int32(1) << 8))
+ if iRowidOff >= iOff || iOff >= (*Fts5Data)(unsafe.Pointer(pLeaf)).FszLeaf {
+ (*Fts5Index)(unsafe.Pointer(p)).Frc = SQLITE_CORRUPT | int32(1)<<8
} else {
- iOff = iOff + (sqlite3Fts5GetVarint32(tls, ((*Fts5Data)(unsafe.Pointer(pLeaf)).Fp + uintptr(iOff)), bp+28 /* &nTerm */))
+ iOff = iOff + sqlite3Fts5GetVarint32(tls, (*Fts5Data)(unsafe.Pointer(pLeaf)).Fp+uintptr(iOff), bp+28)
res = func() int32 {
- if (func() int32 {
- if (*(*int32)(unsafe.Pointer(bp + 28 /* nTerm */))) < (nIdxTerm) {
- return *(*int32)(unsafe.Pointer(bp + 28 /* nTerm */))
+ if func() int32 {
+ if *(*int32)(unsafe.Pointer(bp + 28)) < nIdxTerm {
+ return *(*int32)(unsafe.Pointer(bp + 28))
}
return nIdxTerm
- }()) == 0 {
+ }() <= 0 {
return 0
}
- return libc.Xmemcmp(tls, ((*Fts5Data)(unsafe.Pointer(pLeaf)).Fp + uintptr(iOff)), zIdxTerm, func() uint32 {
- if (*(*int32)(unsafe.Pointer(bp + 28 /* nTerm */))) < (nIdxTerm) {
- return uint32(*(*int32)(unsafe.Pointer(bp + 28 /* nTerm */)))
+ return libc.Xmemcmp(tls, (*Fts5Data)(unsafe.Pointer(pLeaf)).Fp+uintptr(iOff), zIdxTerm, func() uint32 {
+ if *(*int32)(unsafe.Pointer(bp + 28)) < nIdxTerm {
+ return uint32(*(*int32)(unsafe.Pointer(bp + 28)))
}
return uint32(nIdxTerm)
}())
}()
if res == 0 {
- res = (*(*int32)(unsafe.Pointer(bp + 28 /* nTerm */)) - nIdxTerm)
+ res = *(*int32)(unsafe.Pointer(bp + 28)) - nIdxTerm
}
if res < 0 {
- (*Fts5Index)(unsafe.Pointer(p)).Frc = (SQLITE_CORRUPT | (int32(1) << 8))
+ (*Fts5Index)(unsafe.Pointer(p)).Frc = SQLITE_CORRUPT | int32(1)<<8
}
}
@@ -183713,7 +186220,7 @@ func fts5IndexIntegrityCheckSegment(tls *libc.TLS, p uintptr, pSeg uintptr) { /*
// Now check that the iter.nEmpty leaves following the current leaf
// (a) exist and (b) contain no terms.
fts5IndexIntegrityCheckEmpty(tls,
- p, pSeg, (iIdxPrevLeaf + 1), (iDlidxPrevLeaf + 1), (iIdxLeaf - 1))
+ p, pSeg, iIdxPrevLeaf+1, iDlidxPrevLeaf+1, iIdxLeaf-1)
if (*Fts5Index)(unsafe.Pointer(p)).Frc != 0 {
break
}
@@ -183729,12 +186236,12 @@ func fts5IndexIntegrityCheckSegment(tls *libc.TLS, p uintptr, pSeg uintptr) { /*
for pDlidx = fts5DlidxIterInit(tls, p, 0, iSegid, iIdxLeaf); fts5DlidxIterEof(tls, p, pDlidx) == 0; fts5DlidxIterNext(tls, p, pDlidx) {
// Check any rowid-less pages that occur before the current leaf.
- for iPg = (iPrevLeaf + 1); iPg < fts5DlidxIterPgno(tls, pDlidx); iPg++ {
- iKey = (((((I64(iSegid)) << ((FTS5_DATA_PAGE_B + FTS5_DATA_HEIGHT_B) + FTS5_DATA_DLI_B)) + (I64((int64(0))) << (FTS5_DATA_PAGE_B + FTS5_DATA_HEIGHT_B))) + (I64((int64(0))) << (FTS5_DATA_PAGE_B))) + (I64(iPg)))
+ for iPg = iPrevLeaf + 1; iPg < fts5DlidxIterPgno(tls, pDlidx); iPg++ {
+ iKey = I64(iSegid)<<(FTS5_DATA_PAGE_B+FTS5_DATA_HEIGHT_B+FTS5_DATA_DLI_B) + I64(int64(0))<<(FTS5_DATA_PAGE_B+FTS5_DATA_HEIGHT_B) + I64(int64(0))<<FTS5_DATA_PAGE_B + I64(iPg)
pLeaf = fts5DataRead(tls, p, iKey)
if pLeaf != 0 {
- if (int32(fts5GetU16(tls, (*Fts5Data)(unsafe.Pointer(pLeaf)).Fp))) != 0 {
- (*Fts5Index)(unsafe.Pointer(p)).Frc = (SQLITE_CORRUPT | (int32(1) << 8))
+ if int32(fts5GetU16(tls, (*Fts5Data)(unsafe.Pointer(pLeaf)).Fp)) != 0 {
+ (*Fts5Index)(unsafe.Pointer(p)).Frc = SQLITE_CORRUPT | int32(1)<<8
}
fts5DataRelease(tls, pLeaf)
}
@@ -183743,7 +186250,7 @@ func fts5IndexIntegrityCheckSegment(tls *libc.TLS, p uintptr, pSeg uintptr) { /*
// Check that the leaf page indicated by the iterator really does
// contain the rowid suggested by the same.
- iKey = (((((I64(iSegid)) << ((FTS5_DATA_PAGE_B + FTS5_DATA_HEIGHT_B) + FTS5_DATA_DLI_B)) + (I64((int64(0))) << (FTS5_DATA_PAGE_B + FTS5_DATA_HEIGHT_B))) + (I64((int64(0))) << (FTS5_DATA_PAGE_B))) + (I64(iPrevLeaf)))
+ iKey = I64(iSegid)<<(FTS5_DATA_PAGE_B+FTS5_DATA_HEIGHT_B+FTS5_DATA_DLI_B) + I64(int64(0))<<(FTS5_DATA_PAGE_B+FTS5_DATA_HEIGHT_B) + I64(int64(0))<<FTS5_DATA_PAGE_B + I64(iPrevLeaf)
pLeaf = fts5DataRead(tls, p, iKey)
if pLeaf != 0 {
// var iRowid I64 at bp+32, 8
@@ -183751,11 +186258,11 @@ func fts5IndexIntegrityCheckSegment(tls *libc.TLS, p uintptr, pSeg uintptr) { /*
var iRowidOff int32 = int32(fts5GetU16(tls, (*Fts5Data)(unsafe.Pointer(pLeaf)).Fp))
if iRowidOff >= (*Fts5Data)(unsafe.Pointer(pLeaf)).FszLeaf {
- (*Fts5Index)(unsafe.Pointer(p)).Frc = (SQLITE_CORRUPT | (int32(1) << 8))
+ (*Fts5Index)(unsafe.Pointer(p)).Frc = SQLITE_CORRUPT | int32(1)<<8
} else {
- sqlite3Fts5GetVarint(tls, ((*Fts5Data)(unsafe.Pointer(pLeaf)).Fp + uintptr(iRowidOff)), bp+32 /* &iRowid */)
- if *(*I64)(unsafe.Pointer(bp + 32 /* iRowid */)) != fts5DlidxIterRowid(tls, pDlidx) {
- (*Fts5Index)(unsafe.Pointer(p)).Frc = (SQLITE_CORRUPT | (int32(1) << 8))
+ sqlite3Fts5GetVarint(tls, (*Fts5Data)(unsafe.Pointer(pLeaf)).Fp+uintptr(iRowidOff), bp+32 /* &iRowid */)
+ if *(*I64)(unsafe.Pointer(bp + 32)) != fts5DlidxIterRowid(tls, pDlidx) {
+ (*Fts5Index)(unsafe.Pointer(p)).Frc = SQLITE_CORRUPT | int32(1)<<8
}
}
fts5DataRelease(tls, pLeaf)
@@ -183789,7 +186296,7 @@ func fts5IndexIntegrityCheckSegment(tls *libc.TLS, p uintptr, pSeg uintptr) { /*
// checksum does not match. Return SQLITE_OK if all checks pass without
// error, or some other SQLite error code if another error (e.g. OOM)
// occurs.
-func sqlite3Fts5IndexIntegrityCheck(tls *libc.TLS, p uintptr, cksum U64, bUseCksum int32) int32 { /* sqlite3.c:227196:12: */
+func sqlite3Fts5IndexIntegrityCheck(tls *libc.TLS, p uintptr, cksum U64, bUseCksum int32) int32 { /* sqlite3.c:229100:12: */
bp := tls.Alloc(32)
defer tls.Free(32)
@@ -183799,21 +186306,23 @@ func sqlite3Fts5IndexIntegrityCheck(tls *libc.TLS, p uintptr, cksum U64, bUseCks
// var pIter uintptr at bp, 4
// Used to iterate through entire index
var pStruct uintptr // Index structure
+ var iLvl int32
+ var iSeg int32
var flags int32 = FTS5INDEX_QUERY_NOOUTPUT
// Load the FTS index structure
pStruct = fts5StructureRead(tls, p)
+ if pStruct == uintptr(0) {
+
+ return fts5IndexReturn(tls, p)
+ }
// Check that the internal nodes of each segment match the leaves
- if pStruct != 0 {
- var iLvl int32
- var iSeg int32
- for iLvl = 0; iLvl < (*Fts5Structure)(unsafe.Pointer(pStruct)).FnLevel; iLvl++ {
- for iSeg = 0; iSeg < (*Fts5StructureLevel)(unsafe.Pointer((pStruct+24 /* &.aLevel */)+uintptr(iLvl)*12)).FnSeg; iSeg++ {
- var pSeg uintptr = ((*Fts5StructureLevel)(unsafe.Pointer((pStruct+24 /* &.aLevel */)+uintptr(iLvl)*12)).FaSeg + uintptr(iSeg)*12)
- fts5IndexIntegrityCheckSegment(tls, p, pSeg)
- }
+ for iLvl = 0; iLvl < (*Fts5Structure)(unsafe.Pointer(pStruct)).FnLevel; iLvl++ {
+ for iSeg = 0; iSeg < (*Fts5StructureLevel)(unsafe.Pointer(pStruct+24 /* &.aLevel */ +uintptr(iLvl)*12)).FnSeg; iSeg++ {
+ var pSeg uintptr = (*Fts5StructureLevel)(unsafe.Pointer(pStruct+24+uintptr(iLvl)*12)).FaSeg + uintptr(iSeg)*12
+ fts5IndexIntegrityCheckSegment(tls, p, pSeg)
}
}
@@ -183840,24 +186349,24 @@ func sqlite3Fts5IndexIntegrityCheck(tls *libc.TLS, p uintptr, cksum U64, bUseCks
// If this is a new term, query for it. Update cksum3 with the results.
if eDetail == FTS5_DETAIL_NONE {
- if 0 == fts5MultiIterIsEmpty(tls, p, *(*uintptr)(unsafe.Pointer(bp /* pIter */))) {
- cksum2 = cksum2 ^ (sqlite3Fts5IndexEntryCksum(tls, iRowid, 0, 0, -1, z, *(*int32)(unsafe.Pointer(bp + 4 /* n */))))
+ if 0 == fts5MultiIterIsEmpty(tls, p, *(*uintptr)(unsafe.Pointer(bp))) {
+ cksum2 = cksum2 ^ sqlite3Fts5IndexEntryCksum(tls, iRowid, 0, 0, -1, z, *(*int32)(unsafe.Pointer(bp + 4)))
}
} else {
(*Fts5Buffer)(unsafe.Pointer(bp + 8 /* &poslist */)).Fn = 0
- fts5SegiterPoslist(tls, p, ((*(*uintptr)(unsafe.Pointer(bp /* pIter */)) + 80 /* &.aSeg */) + uintptr((*Fts5CResult)(unsafe.Pointer((*Fts5Iter)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* pIter */)))).FaFirst+1*4)).FiFirst)*96), uintptr(0), bp+8 /* &poslist */)
- sqlite3Fts5BufferAppendBlob(tls, (p + 36 /* &.rc */), bp+8 /* &poslist */, uint32(4), ts+33508 /* "\x00\x00\x00\x00" */)
- for 0 == sqlite3Fts5PoslistNext64(tls, (*Fts5Buffer)(unsafe.Pointer(bp+8 /* &poslist */)).Fp, (*Fts5Buffer)(unsafe.Pointer(bp+8 /* &poslist */)).Fn, bp+20 /* &iOff */, bp+24 /* &iPos */) {
- var iCol int32 = (int32(*(*I64)(unsafe.Pointer(bp + 24 /* iPos */)) >> 32))
- var iTokOff int32 = (int32(*(*I64)(unsafe.Pointer(bp + 24 /* iPos */)) & int64(0x7FFFFFFF)))
- cksum2 = cksum2 ^ (sqlite3Fts5IndexEntryCksum(tls, iRowid, iCol, iTokOff, -1, z, *(*int32)(unsafe.Pointer(bp + 4 /* n */))))
+ fts5SegiterPoslist(tls, p, *(*uintptr)(unsafe.Pointer(bp))+80+uintptr((*Fts5CResult)(unsafe.Pointer((*Fts5Iter)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FaFirst+1*4)).FiFirst)*96, uintptr(0), bp+8 /* &poslist */)
+ sqlite3Fts5BufferAppendBlob(tls, p+36, bp+8 /* &poslist */, uint32(4), ts+34868 /* "\x00\x00\x00\x00" */)
+ for 0 == sqlite3Fts5PoslistNext64(tls, (*Fts5Buffer)(unsafe.Pointer(bp+8)).Fp, (*Fts5Buffer)(unsafe.Pointer(bp+8)).Fn, bp+20, bp+24) {
+ var iCol int32 = int32(*(*I64)(unsafe.Pointer(bp + 24)) >> 32)
+ var iTokOff int32 = int32(*(*I64)(unsafe.Pointer(bp + 24)) & int64(0x7FFFFFFF))
+ cksum2 = cksum2 ^ sqlite3Fts5IndexEntryCksum(tls, iRowid, iCol, iTokOff, -1, z, *(*int32)(unsafe.Pointer(bp + 4)))
}
}
}
fts5MultiIterFree(tls, *(*uintptr)(unsafe.Pointer(bp /* pIter */)))
- if (((*Fts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK) && (bUseCksum != 0)) && (cksum != cksum2) {
- (*Fts5Index)(unsafe.Pointer(p)).Frc = (SQLITE_CORRUPT | (int32(1) << 8))
+ if (*Fts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK && bUseCksum != 0 && cksum != cksum2 {
+ (*Fts5Index)(unsafe.Pointer(p)).Frc = SQLITE_CORRUPT | int32(1)<<8
}
fts5StructureRelease(tls, pStruct)
@@ -183877,13 +186386,13 @@ func sqlite3Fts5IndexIntegrityCheck(tls *libc.TLS, p uintptr, cksum U64, bUseCks
//
// If successful, SQLITE_OK is returned. If an error occurs, some other
// SQLite error code is returned instead.
-func sqlite3Fts5IndexInit(tls *libc.TLS, db uintptr) int32 { /* sqlite3.c:227757:12: */
+func sqlite3Fts5IndexInit(tls *libc.TLS, db uintptr) int32 { /* sqlite3.c:229663:12: */
return SQLITE_OK
_ = db
return int32(0)
}
-func sqlite3Fts5IndexReset(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:227783:12: */
+func sqlite3Fts5IndexReset(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:229689:12: */
if fts5IndexDataVersion(tls, p) != (*Fts5Index)(unsafe.Pointer(p)).FiStructVersion {
fts5StructureInvalidate(tls, p)
@@ -183916,7 +186425,7 @@ type Fts5Auxdata1 = struct {
FpPtr uintptr
FxDelete uintptr
FpNext uintptr
-} /* sqlite3.c:213118:9 */
+} /* sqlite3.c:214930:9 */
// 2014 Jun 09
//
@@ -183938,7 +186447,7 @@ type Fts5Auxdata1 = struct {
// assert() conditions in the fts5 code are activated - conditions that are
// only true if it is guaranteed that the fts5 database is not corrupt.
-type Fts5Auxdata = Fts5Auxdata1 /* sqlite3.c:227820:28 */
+type Fts5Auxdata = Fts5Auxdata1 /* sqlite3.c:229726:28 */
type Fts5Auxiliary1 = struct {
FpGlobal uintptr
FzFunc uintptr
@@ -183946,9 +186455,9 @@ type Fts5Auxiliary1 = struct {
FxFunc Fts5_extension_function
FxDestroy uintptr
FpNext uintptr
-} /* sqlite3.c:213118:9 */
+} /* sqlite3.c:214930:9 */
-type Fts5Auxiliary = Fts5Auxiliary1 /* sqlite3.c:227821:30 */
+type Fts5Auxiliary = Fts5Auxiliary1 /* sqlite3.c:229727:30 */
type Fts5Cursor1 = struct {
Fbase Sqlite3_vtab_cursor
FpNext uintptr
@@ -183976,17 +186485,17 @@ type Fts5Cursor1 = struct {
FnInstAlloc int32
FnInstCount int32
FaInst uintptr
-} /* sqlite3.c:213118:9 */
+} /* sqlite3.c:214930:9 */
-type Fts5Cursor = Fts5Cursor1 /* sqlite3.c:227822:27 */
+type Fts5Cursor = Fts5Cursor1 /* sqlite3.c:229728:27 */
type Fts5FullTable1 = struct {
Fp Fts5Table
FpStorage uintptr
FpGlobal uintptr
FpSortCsr uintptr
-} /* sqlite3.c:227823:9 */
+} /* sqlite3.c:229729:9 */
-type Fts5FullTable = Fts5FullTable1 /* sqlite3.c:227823:30 */
+type Fts5FullTable = Fts5FullTable1 /* sqlite3.c:229729:30 */
type Fts5Sorter1 = struct {
FpStmt uintptr
F__ccgo_pad1 [4]byte
@@ -183995,18 +186504,18 @@ type Fts5Sorter1 = struct {
FnIdx int32
FaIdx [1]int32
F__ccgo_pad2 [4]byte
-} /* sqlite3.c:213118:9 */
+} /* sqlite3.c:214930:9 */
-type Fts5Sorter = Fts5Sorter1 /* sqlite3.c:227824:27 */
+type Fts5Sorter = Fts5Sorter1 /* sqlite3.c:229730:27 */
type Fts5TokenizerModule1 = struct {
FzName uintptr
FpUserData uintptr
Fx Fts5_tokenizer
FxDestroy uintptr
FpNext uintptr
-} /* sqlite3.c:213118:9 */
+} /* sqlite3.c:214930:9 */
-type Fts5TokenizerModule = Fts5TokenizerModule1 /* sqlite3.c:227825:36 */
+type Fts5TokenizerModule = Fts5TokenizerModule1 /* sqlite3.c:229731:36 */
// NOTES ON TRANSACTIONS:
//
@@ -184040,20 +186549,20 @@ type Fts5TokenizerModule = Fts5TokenizerModule1 /* sqlite3.c:227825:36 */
type Fts5TransactionState = struct {
FeState int32
FiSavepoint int32
-} /* sqlite3.c:227858:1 */
+} /* sqlite3.c:229764:1 */
type Fts5MatchPhrase = struct {
FpPoslist uintptr
FnTerm int32
-} /* sqlite3.c:227915:1 */
+} /* sqlite3.c:229821:1 */
// Return true if pTab is a contentless table.
-func fts5IsContentless(tls *libc.TLS, pTab uintptr) int32 { /* sqlite3.c:228099:12: */
- return (libc.Bool32((*Fts5Config)(unsafe.Pointer((*Fts5FullTable)(unsafe.Pointer(pTab)).Fp.FpConfig)).FeContent == FTS5_CONTENT_NONE))
+func fts5IsContentless(tls *libc.TLS, pTab uintptr) int32 { /* sqlite3.c:230005:12: */
+ return libc.Bool32((*Fts5Config)(unsafe.Pointer((*Fts5FullTable)(unsafe.Pointer(pTab)).Fp.FpConfig)).FeContent == FTS5_CONTENT_NONE)
}
// Delete a virtual table handle allocated by fts5InitVtab().
-func fts5FreeVtab(tls *libc.TLS, pTab uintptr) { /* sqlite3.c:228106:13: */
+func fts5FreeVtab(tls *libc.TLS, pTab uintptr) { /* sqlite3.c:230012:13: */
if pTab != 0 {
sqlite3Fts5IndexClose(tls, (*Fts5FullTable)(unsafe.Pointer(pTab)).Fp.FpIndex)
sqlite3Fts5StorageClose(tls, (*Fts5FullTable)(unsafe.Pointer(pTab)).FpStorage)
@@ -184063,13 +186572,13 @@ func fts5FreeVtab(tls *libc.TLS, pTab uintptr) { /* sqlite3.c:228106:13: */
}
// The xDisconnect() virtual table method.
-func fts5DisconnectMethod(tls *libc.TLS, pVtab uintptr) int32 { /* sqlite3.c:228118:12: */
+func fts5DisconnectMethod(tls *libc.TLS, pVtab uintptr) int32 { /* sqlite3.c:230024:12: */
fts5FreeVtab(tls, pVtab)
return SQLITE_OK
}
// The xDestroy() virtual table method.
-func fts5DestroyMethod(tls *libc.TLS, pVtab uintptr) int32 { /* sqlite3.c:228126:12: */
+func fts5DestroyMethod(tls *libc.TLS, pVtab uintptr) int32 { /* sqlite3.c:230032:12: */
var pTab uintptr = pVtab
var rc int32 = sqlite3Fts5DropAll(tls, (*Fts5Table)(unsafe.Pointer(pTab)).FpConfig)
if rc == SQLITE_OK {
@@ -184087,7 +186596,7 @@ func fts5DestroyMethod(tls *libc.TLS, pVtab uintptr) int32 { /* sqlite3.c:228126
// argv[1] -> database name
// argv[2] -> table name
// argv[...] -> "column name" and other module argument fields.
-func fts5InitVtab(tls *libc.TLS, bCreate int32, db uintptr, pAux uintptr, argc int32, argv uintptr, ppVTab uintptr, pzErr uintptr) int32 { /* sqlite3.c:228146:12: */
+func fts5InitVtab(tls *libc.TLS, bCreate int32, db uintptr, pAux uintptr, argc int32, argv uintptr, ppVTab uintptr, pzErr uintptr) int32 { /* sqlite3.c:230052:12: */
bp := tls.Alloc(8)
defer tls.Free(8)
@@ -184099,33 +186608,33 @@ func fts5InitVtab(tls *libc.TLS, bCreate int32, db uintptr, pAux uintptr, argc i
// Allocate the new vtab object and parse the configuration
pTab = sqlite3Fts5MallocZero(tls, bp /* &rc */, int64(unsafe.Sizeof(Fts5FullTable{})))
- if *(*int32)(unsafe.Pointer(bp /* rc */)) == SQLITE_OK {
+ if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK {
*(*int32)(unsafe.Pointer(bp /* rc */)) = sqlite3Fts5ConfigParse(tls, pGlobal, db, argc, azConfig, bp+4 /* &pConfig */, pzErr)
}
- if *(*int32)(unsafe.Pointer(bp /* rc */)) == SQLITE_OK {
+ if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK {
(*Fts5FullTable)(unsafe.Pointer(pTab)).Fp.FpConfig = *(*uintptr)(unsafe.Pointer(bp + 4 /* pConfig */))
(*Fts5FullTable)(unsafe.Pointer(pTab)).FpGlobal = pGlobal
}
// Open the index sub-system
- if *(*int32)(unsafe.Pointer(bp /* rc */)) == SQLITE_OK {
- *(*int32)(unsafe.Pointer(bp /* rc */)) = sqlite3Fts5IndexOpen(tls, *(*uintptr)(unsafe.Pointer(bp + 4 /* pConfig */)), bCreate, (pTab /* &.p */ + 16 /* &.pIndex */), pzErr)
+ if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK {
+ *(*int32)(unsafe.Pointer(bp /* rc */)) = sqlite3Fts5IndexOpen(tls, *(*uintptr)(unsafe.Pointer(bp + 4 /* pConfig */)), bCreate, pTab+16, pzErr)
}
// Open the storage sub-system
- if *(*int32)(unsafe.Pointer(bp /* rc */)) == SQLITE_OK {
+ if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK {
*(*int32)(unsafe.Pointer(bp /* rc */)) = sqlite3Fts5StorageOpen(tls,
- *(*uintptr)(unsafe.Pointer(bp + 4 /* pConfig */)), (*Fts5FullTable)(unsafe.Pointer(pTab)).Fp.FpIndex, bCreate, (pTab + 20 /* &.pStorage */), pzErr)
+ *(*uintptr)(unsafe.Pointer(bp + 4 /* pConfig */)), (*Fts5FullTable)(unsafe.Pointer(pTab)).Fp.FpIndex, bCreate, pTab+20, pzErr)
}
// Call sqlite3_declare_vtab()
- if *(*int32)(unsafe.Pointer(bp /* rc */)) == SQLITE_OK {
+ if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK {
*(*int32)(unsafe.Pointer(bp /* rc */)) = sqlite3Fts5ConfigDeclareVtab(tls, *(*uintptr)(unsafe.Pointer(bp + 4 /* pConfig */)))
}
// Load the initial configuration
- if *(*int32)(unsafe.Pointer(bp /* rc */)) == SQLITE_OK {
+ if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK {
(*Fts5Config)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 4 /* pConfig */)))).FpzErrmsg = pzErr
*(*int32)(unsafe.Pointer(bp /* rc */)) = sqlite3Fts5IndexLoadConfig(tls, (*Fts5FullTable)(unsafe.Pointer(pTab)).Fp.FpIndex)
@@ -184133,7 +186642,7 @@ func fts5InitVtab(tls *libc.TLS, bCreate int32, db uintptr, pAux uintptr, argc i
(*Fts5Config)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 4 /* pConfig */)))).FpzErrmsg = uintptr(0)
}
- if *(*int32)(unsafe.Pointer(bp /* rc */)) != SQLITE_OK {
+ if *(*int32)(unsafe.Pointer(bp)) != SQLITE_OK {
fts5FreeVtab(tls, pTab)
pTab = uintptr(0)
} else if bCreate != 0 {
@@ -184145,11 +186654,11 @@ func fts5InitVtab(tls *libc.TLS, bCreate int32, db uintptr, pAux uintptr, argc i
// The xConnect() and xCreate() methods for the virtual table. All the
// work is done in function fts5InitVtab().
-func fts5ConnectMethod(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uintptr, ppVtab uintptr, pzErr uintptr) int32 { /* sqlite3.c:228212:12: */
+func fts5ConnectMethod(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uintptr, ppVtab uintptr, pzErr uintptr) int32 { /* sqlite3.c:230118:12: */
return fts5InitVtab(tls, 0, db, pAux, argc, argv, ppVtab, pzErr)
}
-func fts5CreateMethod(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uintptr, ppVtab uintptr, pzErr uintptr) int32 { /* sqlite3.c:228222:12: */
+func fts5CreateMethod(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uintptr, ppVtab uintptr, pzErr uintptr) int32 { /* sqlite3.c:230128:12: */
return fts5InitVtab(tls, 1, db, pAux, argc, argv, ppVtab, pzErr)
}
@@ -184158,20 +186667,20 @@ func fts5CreateMethod(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv
// Set the SQLITE_INDEX_SCAN_UNIQUE flag in pIdxInfo->flags. Unless this
// extension is currently being used by a version of SQLite too old to
// support index-info flags. In that case this function is a no-op.
-func fts5SetUniqueFlag(tls *libc.TLS, pIdxInfo uintptr) { /* sqlite3.c:228248:13: */
+func fts5SetUniqueFlag(tls *libc.TLS, pIdxInfo uintptr) { /* sqlite3.c:230154:13: */
{
- *(*int32)(unsafe.Pointer(pIdxInfo + 56 /* &.idxFlags */)) |= (SQLITE_INDEX_SCAN_UNIQUE)
+ *(*int32)(unsafe.Pointer(pIdxInfo + 56)) |= SQLITE_INDEX_SCAN_UNIQUE
}
}
-func fts5UsePatternMatch(tls *libc.TLS, pConfig uintptr, p uintptr) int32 { /* sqlite3.c:228259:12: */
+func fts5UsePatternMatch(tls *libc.TLS, pConfig uintptr, p uintptr) int32 { /* sqlite3.c:230165:12: */
- if ((*Fts5Config)(unsafe.Pointer(pConfig)).FePattern == FTS5_PATTERN_GLOB) && (int32((*sqlite3_index_constraint)(unsafe.Pointer(p)).Fop) == FTS5_PATTERN_GLOB) {
+ if (*Fts5Config)(unsafe.Pointer(pConfig)).FePattern == FTS5_PATTERN_GLOB && int32((*sqlite3_index_constraint)(unsafe.Pointer(p)).Fop) == FTS5_PATTERN_GLOB {
return 1
}
- if ((*Fts5Config)(unsafe.Pointer(pConfig)).FePattern == FTS5_PATTERN_LIKE) &&
- ((int32((*sqlite3_index_constraint)(unsafe.Pointer(p)).Fop) == FTS5_PATTERN_LIKE) || (int32((*sqlite3_index_constraint)(unsafe.Pointer(p)).Fop) == FTS5_PATTERN_GLOB)) {
+ if (*Fts5Config)(unsafe.Pointer(pConfig)).FePattern == FTS5_PATTERN_LIKE &&
+ (int32((*sqlite3_index_constraint)(unsafe.Pointer(p)).Fop) == FTS5_PATTERN_LIKE || int32((*sqlite3_index_constraint)(unsafe.Pointer(p)).Fop) == FTS5_PATTERN_GLOB) {
return 1
}
return 0
@@ -184236,7 +186745,7 @@ func fts5UsePatternMatch(tls *libc.TLS, pConfig uintptr, p uintptr) int32 { /* s
// * An == rowid constraint: cost=10.0
//
// Costs are not modified by the ORDER BY clause.
-func fts5BestIndexMethod(tls *libc.TLS, pVTab uintptr, pInfo uintptr) int32 { /* sqlite3.c:228337:12: */
+func fts5BestIndexMethod(tls *libc.TLS, pVTab uintptr, pInfo uintptr) int32 { /* sqlite3.c:230243:12: */
bp := tls.Alloc(16)
defer tls.Free(16)
@@ -184257,11 +186766,11 @@ func fts5BestIndexMethod(tls *libc.TLS, pVTab uintptr, pInfo uintptr) int32 { /*
if (*Fts5Config)(unsafe.Pointer(pConfig)).FbLock != 0 {
(*Fts5Table)(unsafe.Pointer(pTab)).Fbase.FzErrMsg = Xsqlite3_mprintf(tls,
- ts+33513 /* "recursively defi..." */, 0)
+ ts+34873 /* "recursively defi..." */, 0)
return SQLITE_ERROR
}
- idxStr = Xsqlite3_malloc(tls, (((*Sqlite3_index_info)(unsafe.Pointer(pInfo)).FnConstraint * 8) + 1))
+ idxStr = Xsqlite3_malloc(tls, (*Sqlite3_index_info)(unsafe.Pointer(pInfo)).FnConstraint*8+1)
if idxStr == uintptr(0) {
return SQLITE_NOMEM
}
@@ -184269,12 +186778,12 @@ func fts5BestIndexMethod(tls *libc.TLS, pVTab uintptr, pInfo uintptr) int32 { /*
(*Sqlite3_index_info)(unsafe.Pointer(pInfo)).FneedToFreeIdxStr = 1
for i = 0; i < (*Sqlite3_index_info)(unsafe.Pointer(pInfo)).FnConstraint; i++ {
- var p uintptr = ((*Sqlite3_index_info)(unsafe.Pointer(pInfo)).FaConstraint + uintptr(i)*12)
+ var p uintptr = (*Sqlite3_index_info)(unsafe.Pointer(pInfo)).FaConstraint + uintptr(i)*12
var iCol int32 = (*sqlite3_index_constraint)(unsafe.Pointer(p)).FiColumn
- if (int32((*sqlite3_index_constraint)(unsafe.Pointer(p)).Fop) == SQLITE_INDEX_CONSTRAINT_MATCH) ||
- ((int32((*sqlite3_index_constraint)(unsafe.Pointer(p)).Fop) == SQLITE_INDEX_CONSTRAINT_EQ) && (iCol >= nCol)) {
+ if int32((*sqlite3_index_constraint)(unsafe.Pointer(p)).Fop) == SQLITE_INDEX_CONSTRAINT_MATCH ||
+ int32((*sqlite3_index_constraint)(unsafe.Pointer(p)).Fop) == SQLITE_INDEX_CONSTRAINT_EQ && iCol >= nCol {
// A MATCH operator or equivalent
- if (int32((*sqlite3_index_constraint)(unsafe.Pointer(p)).Fusable) == 0) || (iCol < 0) {
+ if int32((*sqlite3_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.
(*Sqlite3_index_info)(unsafe.Pointer(pInfo)).FestimatedCost = 1e50
@@ -184282,7 +186791,7 @@ func fts5BestIndexMethod(tls *libc.TLS, pVTab uintptr, pInfo uintptr) int32 { /*
*(*uint8)(unsafe.Pointer(idxStr + uintptr(iIdxStr))) = uint8(0)
return SQLITE_OK
} else {
- if iCol == (nCol + 1) {
+ if iCol == nCol+1 {
if bSeenRank != 0 {
continue
}
@@ -184291,15 +186800,15 @@ func fts5BestIndexMethod(tls *libc.TLS, pVTab uintptr, pInfo uintptr) int32 { /*
} else if iCol >= 0 {
bSeenMatch = 1
*(*uint8)(unsafe.Pointer(idxStr + uintptr(libc.PostIncInt32(&iIdxStr, 1)))) = uint8('M')
- Xsqlite3_snprintf(tls, 6, (idxStr + uintptr(iIdxStr)), ts+4089 /* "%d" */, libc.VaList(bp, iCol))
- idxStr += uintptr(libc.Xstrlen(tls, (idxStr + uintptr(iIdxStr))))
+ Xsqlite3_snprintf(tls, 6, idxStr+uintptr(iIdxStr), ts+4895 /* "%d" */, libc.VaList(bp, iCol))
+ idxStr += uintptr(libc.Xstrlen(tls, idxStr+uintptr(iIdxStr)))
}
(*sqlite3_index_constraint_usage)(unsafe.Pointer((*Sqlite3_index_info)(unsafe.Pointer(pInfo)).FaConstraintUsage + uintptr(i)*8)).FargvIndex = libc.PreIncInt32(&iCons, 1)
(*sqlite3_index_constraint_usage)(unsafe.Pointer((*Sqlite3_index_info)(unsafe.Pointer(pInfo)).FaConstraintUsage + uintptr(i)*8)).Fomit = uint8(1)
}
} else if (*sqlite3_index_constraint)(unsafe.Pointer(p)).Fusable != 0 {
- if ((iCol >= 0) && (iCol < nCol)) && (fts5UsePatternMatch(tls, pConfig, p) != 0) {
+ if iCol >= 0 && iCol < nCol && fts5UsePatternMatch(tls, pConfig, p) != 0 {
*(*uint8)(unsafe.Pointer(idxStr + uintptr(libc.PostIncInt32(&iIdxStr, 1)))) = func() uint8 {
if int32((*sqlite3_index_constraint)(unsafe.Pointer(p)).Fop) == FTS5_PATTERN_LIKE {
@@ -184307,11 +186816,11 @@ func fts5BestIndexMethod(tls *libc.TLS, pVTab uintptr, pInfo uintptr) int32 { /*
}
return uint8('G')
}()
- Xsqlite3_snprintf(tls, 6, (idxStr + uintptr(iIdxStr)), ts+4089 /* "%d" */, libc.VaList(bp+8, iCol))
- idxStr += uintptr(libc.Xstrlen(tls, (idxStr + uintptr(iIdxStr))))
+ Xsqlite3_snprintf(tls, 6, idxStr+uintptr(iIdxStr), ts+4895 /* "%d" */, libc.VaList(bp+8, iCol))
+ idxStr += uintptr(libc.Xstrlen(tls, idxStr+uintptr(iIdxStr)))
(*sqlite3_index_constraint_usage)(unsafe.Pointer((*Sqlite3_index_info)(unsafe.Pointer(pInfo)).FaConstraintUsage + uintptr(i)*8)).FargvIndex = libc.PreIncInt32(&iCons, 1)
- } else if ((bSeenEq == 0) && (int32((*sqlite3_index_constraint)(unsafe.Pointer(p)).Fop) == SQLITE_INDEX_CONSTRAINT_EQ)) && (iCol < 0) {
+ } else if bSeenEq == 0 && int32((*sqlite3_index_constraint)(unsafe.Pointer(p)).Fop) == SQLITE_INDEX_CONSTRAINT_EQ && iCol < 0 {
*(*uint8)(unsafe.Pointer(idxStr + uintptr(libc.PostIncInt32(&iIdxStr, 1)))) = uint8('=')
bSeenEq = 1
(*sqlite3_index_constraint_usage)(unsafe.Pointer((*Sqlite3_index_info)(unsafe.Pointer(pInfo)).FaConstraintUsage + uintptr(i)*8)).FargvIndex = libc.PreIncInt32(&iCons, 1)
@@ -184321,17 +186830,17 @@ func fts5BestIndexMethod(tls *libc.TLS, pVTab uintptr, pInfo uintptr) int32 { /*
if bSeenEq == 0 {
for i = 0; i < (*Sqlite3_index_info)(unsafe.Pointer(pInfo)).FnConstraint; i++ {
- var p uintptr = ((*Sqlite3_index_info)(unsafe.Pointer(pInfo)).FaConstraint + uintptr(i)*12)
- if ((*sqlite3_index_constraint)(unsafe.Pointer(p)).FiColumn < 0) && ((*sqlite3_index_constraint)(unsafe.Pointer(p)).Fusable != 0) {
+ var p uintptr = (*Sqlite3_index_info)(unsafe.Pointer(pInfo)).FaConstraint + uintptr(i)*12
+ if (*sqlite3_index_constraint)(unsafe.Pointer(p)).FiColumn < 0 && (*sqlite3_index_constraint)(unsafe.Pointer(p)).Fusable != 0 {
var op int32 = int32((*sqlite3_index_constraint)(unsafe.Pointer(p)).Fop)
- if (op == SQLITE_INDEX_CONSTRAINT_LT) || (op == SQLITE_INDEX_CONSTRAINT_LE) {
+ if op == SQLITE_INDEX_CONSTRAINT_LT || op == SQLITE_INDEX_CONSTRAINT_LE {
if bSeenLt != 0 {
continue
}
*(*uint8)(unsafe.Pointer(idxStr + uintptr(libc.PostIncInt32(&iIdxStr, 1)))) = uint8('<')
(*sqlite3_index_constraint_usage)(unsafe.Pointer((*Sqlite3_index_info)(unsafe.Pointer(pInfo)).FaConstraintUsage + uintptr(i)*8)).FargvIndex = libc.PreIncInt32(&iCons, 1)
bSeenLt = 1
- } else if (op == SQLITE_INDEX_CONSTRAINT_GT) || (op == SQLITE_INDEX_CONSTRAINT_GE) {
+ } else if op == SQLITE_INDEX_CONSTRAINT_GT || op == SQLITE_INDEX_CONSTRAINT_GE {
if bSeenGt != 0 {
continue
}
@@ -184347,15 +186856,15 @@ func fts5BestIndexMethod(tls *libc.TLS, pVTab uintptr, pInfo uintptr) int32 { /*
// Set idxFlags flags for the ORDER BY clause
if (*Sqlite3_index_info)(unsafe.Pointer(pInfo)).FnOrderBy == 1 {
var iSort int32 = (*sqlite3_index_orderby)(unsafe.Pointer((*Sqlite3_index_info)(unsafe.Pointer(pInfo)).FaOrderBy)).FiColumn
- if (iSort == ((*Fts5Config)(unsafe.Pointer(pConfig)).FnCol + 1)) && (bSeenMatch != 0) {
- idxFlags = idxFlags | (FTS5_BI_ORDER_RANK)
+ if iSort == (*Fts5Config)(unsafe.Pointer(pConfig)).FnCol+1 && bSeenMatch != 0 {
+ idxFlags = idxFlags | FTS5_BI_ORDER_RANK
} else if iSort == -1 {
- idxFlags = idxFlags | (FTS5_BI_ORDER_ROWID)
+ idxFlags = idxFlags | FTS5_BI_ORDER_ROWID
}
- if ((idxFlags) & (FTS5_BI_ORDER_RANK | FTS5_BI_ORDER_ROWID)) != 0 {
+ if idxFlags&(FTS5_BI_ORDER_RANK|FTS5_BI_ORDER_ROWID) != 0 {
(*Sqlite3_index_info)(unsafe.Pointer(pInfo)).ForderByConsumed = 1
if (*sqlite3_index_orderby)(unsafe.Pointer((*Sqlite3_index_info)(unsafe.Pointer(pInfo)).FaOrderBy)).Fdesc != 0 {
- idxFlags = idxFlags | (FTS5_BI_ORDER_DESC)
+ idxFlags = idxFlags | FTS5_BI_ORDER_DESC
}
}
}
@@ -184371,14 +186880,14 @@ func fts5BestIndexMethod(tls *libc.TLS, pVTab uintptr, pInfo uintptr) int32 { /*
if bSeenMatch == 0 {
fts5SetUniqueFlag(tls, pInfo)
}
- } else if (bSeenLt != 0) && (bSeenGt != 0) {
+ } else if bSeenLt != 0 && bSeenGt != 0 {
(*Sqlite3_index_info)(unsafe.Pointer(pInfo)).FestimatedCost = func() float64 {
if bSeenMatch != 0 {
return 500.0
}
return 250000.0
}()
- } else if (bSeenLt != 0) || (bSeenGt != 0) {
+ } else if bSeenLt != 0 || bSeenGt != 0 {
(*Sqlite3_index_info)(unsafe.Pointer(pInfo)).FestimatedCost = func() float64 {
if bSeenMatch != 0 {
return 750.0
@@ -184398,7 +186907,7 @@ func fts5BestIndexMethod(tls *libc.TLS, pVTab uintptr, pInfo uintptr) int32 { /*
return SQLITE_OK
}
-func fts5NewTransaction(tls *libc.TLS, pTab uintptr) int32 { /* sqlite3.c:228472:12: */
+func fts5NewTransaction(tls *libc.TLS, pTab uintptr) int32 { /* sqlite3.c:230378:12: */
var pCsr uintptr
for pCsr = (*Fts5Global)(unsafe.Pointer((*Fts5FullTable)(unsafe.Pointer(pTab)).FpGlobal)).FpCsr; pCsr != 0; pCsr = (*Fts5Cursor)(unsafe.Pointer(pCsr)).FpNext {
if (*Fts5Cursor)(unsafe.Pointer(pCsr)).Fbase.FpVtab == pTab {
@@ -184409,7 +186918,7 @@ func fts5NewTransaction(tls *libc.TLS, pTab uintptr) int32 { /* sqlite3.c:228472
}
// Implementation of xOpen method.
-func fts5OpenMethod(tls *libc.TLS, pVTab uintptr, ppCsr uintptr) int32 { /* sqlite3.c:228483:12: */
+func fts5OpenMethod(tls *libc.TLS, pVTab uintptr, ppCsr uintptr) int32 { /* sqlite3.c:230389:12: */
var pTab uintptr = pVTab
var pConfig uintptr = (*Fts5FullTable)(unsafe.Pointer(pTab)).Fp.FpConfig
var pCsr uintptr = uintptr(0) // New cursor object
@@ -184418,12 +186927,12 @@ func fts5OpenMethod(tls *libc.TLS, pVTab uintptr, ppCsr uintptr) int32 { /* sqli
rc = fts5NewTransaction(tls, pTab)
if rc == SQLITE_OK {
- nByte = (Sqlite3_int64(uint32(unsafe.Sizeof(Fts5Cursor{})) + (uint32((*Fts5Config)(unsafe.Pointer(pConfig)).FnCol) * uint32(unsafe.Sizeof(int32(0))))))
+ nByte = Sqlite3_int64(uint32(unsafe.Sizeof(Fts5Cursor{})) + uint32((*Fts5Config)(unsafe.Pointer(pConfig)).FnCol)*uint32(unsafe.Sizeof(int32(0))))
pCsr = Xsqlite3_malloc64(tls, uint64(nByte))
if pCsr != 0 {
var pGlobal uintptr = (*Fts5FullTable)(unsafe.Pointer(pTab)).FpGlobal
libc.Xmemset(tls, pCsr, 0, Size_t(nByte))
- (*Fts5Cursor)(unsafe.Pointer(pCsr)).FaColumnSize = (pCsr + 1*120)
+ (*Fts5Cursor)(unsafe.Pointer(pCsr)).FaColumnSize = pCsr + 1*120
(*Fts5Cursor)(unsafe.Pointer(pCsr)).FpNext = (*Fts5Global)(unsafe.Pointer(pGlobal)).FpCsr
(*Fts5Global)(unsafe.Pointer(pGlobal)).FpCsr = pCsr
(*Fts5Cursor)(unsafe.Pointer(pCsr)).FiCsrId = libc.PreIncInt64(&(*Fts5Global)(unsafe.Pointer(pGlobal)).FiNextId, 1)
@@ -184435,7 +186944,7 @@ func fts5OpenMethod(tls *libc.TLS, pVTab uintptr, ppCsr uintptr) int32 { /* sqli
return rc
}
-func fts5StmtType(tls *libc.TLS, pCsr uintptr) int32 { /* sqlite3.c:228509:12: */
+func fts5StmtType(tls *libc.TLS, pCsr uintptr) int32 { /* sqlite3.c:230415:12: */
if (*Fts5Cursor)(unsafe.Pointer(pCsr)).FePlan == FTS5_PLAN_SCAN {
if (*Fts5Cursor)(unsafe.Pointer(pCsr)).FbDesc != 0 {
return FTS5_STMT_SCAN_DESC
@@ -184448,11 +186957,11 @@ func fts5StmtType(tls *libc.TLS, pCsr uintptr) int32 { /* sqlite3.c:228509:12: *
// This function is called after the cursor passed as the only argument
// is moved to point at a different row. It clears all cached data
// specific to the previous row stored by the cursor object.
-func fts5CsrNewrow(tls *libc.TLS, pCsr uintptr) { /* sqlite3.c:228521:13: */
- *(*int32)(unsafe.Pointer(pCsr + 60 /* &.csrflags */)) |= (((FTS5CSR_REQUIRE_CONTENT | FTS5CSR_REQUIRE_DOCSIZE) | FTS5CSR_REQUIRE_INST) | FTS5CSR_REQUIRE_POSLIST)
+func fts5CsrNewrow(tls *libc.TLS, pCsr uintptr) { /* sqlite3.c:230427:13: */
+ *(*int32)(unsafe.Pointer(pCsr + 60)) |= FTS5CSR_REQUIRE_CONTENT | FTS5CSR_REQUIRE_DOCSIZE | FTS5CSR_REQUIRE_INST | FTS5CSR_REQUIRE_POSLIST
}
-func fts5FreeCursorComponents(tls *libc.TLS, pCsr uintptr) { /* sqlite3.c:228530:13: */
+func fts5FreeCursorComponents(tls *libc.TLS, pCsr uintptr) { /* sqlite3.c:230436:13: */
var pTab uintptr = (*Fts5Cursor)(unsafe.Pointer(pCsr)).Fbase.FpVtab
var pData uintptr
var pNext uintptr
@@ -184484,18 +186993,18 @@ func fts5FreeCursorComponents(tls *libc.TLS, pCsr uintptr) { /* sqlite3.c:228530
Xsqlite3_finalize(tls, (*Fts5Cursor)(unsafe.Pointer(pCsr)).FpRankArgStmt)
Xsqlite3_free(tls, (*Fts5Cursor)(unsafe.Pointer(pCsr)).FapRankArg)
- if ((*Fts5Cursor)(unsafe.Pointer((pCsr))).Fcsrflags & (FTS5CSR_FREE_ZRANK)) != 0 {
+ if (*Fts5Cursor)(unsafe.Pointer(pCsr)).Fcsrflags&FTS5CSR_FREE_ZRANK != 0 {
Xsqlite3_free(tls, (*Fts5Cursor)(unsafe.Pointer(pCsr)).FzRank)
Xsqlite3_free(tls, (*Fts5Cursor)(unsafe.Pointer(pCsr)).FzRankArgs)
}
sqlite3Fts5IndexCloseReader(tls, (*Fts5FullTable)(unsafe.Pointer(pTab)).Fp.FpIndex)
- libc.Xmemset(tls, (pCsr + 24 /* &.ePlan */), 0, (uint32(unsafe.Sizeof(Fts5Cursor{})) - (uint32((int32((pCsr + 24 /* &.ePlan */)) - int32(pCsr)) / 1))))
+ libc.Xmemset(tls, pCsr+24, 0, uint32(unsafe.Sizeof(Fts5Cursor{}))-uint32((int32(pCsr+24)-int32(pCsr))/1))
}
// Close the cursor. For additional information see the documentation
// on the xClose method of the virtual table interface.
-func fts5CloseMethod(tls *libc.TLS, pCursor uintptr) int32 { /* sqlite3.c:228574:12: */
+func fts5CloseMethod(tls *libc.TLS, pCursor uintptr) int32 { /* sqlite3.c:230480:12: */
if pCursor != 0 {
var pTab uintptr = (*Sqlite3_vtab_cursor)(unsafe.Pointer(pCursor)).FpVtab
var pCsr uintptr = pCursor
@@ -184503,7 +187012,7 @@ func fts5CloseMethod(tls *libc.TLS, pCursor uintptr) int32 { /* sqlite3.c:228574
fts5FreeCursorComponents(tls, pCsr)
// Remove the cursor from the Fts5Global.pCsr list
- for pp = ((*Fts5FullTable)(unsafe.Pointer(pTab)).FpGlobal + 44 /* &.pCsr */); (*(*uintptr)(unsafe.Pointer(pp))) != pCsr; pp = (*(*uintptr)(unsafe.Pointer(pp)) + 4 /* &.pNext */) {
+ for pp = (*Fts5FullTable)(unsafe.Pointer(pTab)).FpGlobal + 44; *(*uintptr)(unsafe.Pointer(pp)) != pCsr; pp = *(*uintptr)(unsafe.Pointer(pp)) + 4 {
}
*(*uintptr)(unsafe.Pointer(pp)) = (*Fts5Cursor)(unsafe.Pointer(pCsr)).FpNext
@@ -184512,7 +187021,7 @@ func fts5CloseMethod(tls *libc.TLS, pCursor uintptr) int32 { /* sqlite3.c:228574
return SQLITE_OK
}
-func fts5SorterNext(tls *libc.TLS, pCsr uintptr) int32 { /* sqlite3.c:228590:12: */
+func fts5SorterNext(tls *libc.TLS, pCsr uintptr) int32 { /* sqlite3.c:230496:12: */
bp := tls.Alloc(4)
defer tls.Free(4)
@@ -184522,7 +187031,7 @@ func fts5SorterNext(tls *libc.TLS, pCsr uintptr) int32 { /* sqlite3.c:228590:12:
rc = Xsqlite3_step(tls, (*Fts5Sorter)(unsafe.Pointer(pSorter)).FpStmt)
if rc == SQLITE_DONE {
rc = SQLITE_OK
- *(*int32)(unsafe.Pointer(pCsr + 60 /* &.csrflags */)) |= (FTS5CSR_EOF)
+ *(*int32)(unsafe.Pointer(pCsr + 60)) |= FTS5CSR_EOF
} else if rc == SQLITE_ROW {
var a uintptr
var aBlob uintptr
@@ -184537,14 +187046,14 @@ func fts5SorterNext(tls *libc.TLS, pCsr uintptr) int32 { /* sqlite3.c:228590:12:
// nBlob==0 in detail=none mode.
if nBlob > 0 {
- for i = 0; i < ((*Fts5Sorter)(unsafe.Pointer(pSorter)).FnIdx - 1); i++ {
+ for i = 0; i < (*Fts5Sorter)(unsafe.Pointer(pSorter)).FnIdx-1; i++ {
// var iVal int32 at bp, 4
a += uintptr(sqlite3Fts5GetVarint32(tls, a, bp /* &iVal */))
- iOff = iOff + (*(*int32)(unsafe.Pointer(bp /* iVal */)))
- *(*int32)(unsafe.Pointer((pSorter + 24 /* &.aIdx */) + uintptr(i)*4)) = iOff
+ iOff = iOff + *(*int32)(unsafe.Pointer(bp))
+ *(*int32)(unsafe.Pointer(pSorter + 24 + uintptr(i)*4)) = iOff
}
- *(*int32)(unsafe.Pointer((pSorter + 24 /* &.aIdx */) + uintptr(i)*4)) = ((int32((aBlob + uintptr(nBlob))) - int32(a)) / 1)
+ *(*int32)(unsafe.Pointer(pSorter + 24 + uintptr(i)*4)) = (int32(aBlob+uintptr(nBlob)) - int32(a)) / 1
(*Fts5Sorter)(unsafe.Pointer(pSorter)).FaPoslist = a
}
@@ -184556,12 +187065,12 @@ func fts5SorterNext(tls *libc.TLS, pCsr uintptr) int32 { /* sqlite3.c:228590:12:
// Set the FTS5CSR_REQUIRE_RESEEK flag on all FTS5_PLAN_MATCH cursors
// open on table pTab.
-func fts5TripCursors(tls *libc.TLS, pTab uintptr) { /* sqlite3.c:228633:13: */
+func fts5TripCursors(tls *libc.TLS, pTab uintptr) { /* sqlite3.c:230539:13: */
var pCsr uintptr
for pCsr = (*Fts5Global)(unsafe.Pointer((*Fts5FullTable)(unsafe.Pointer(pTab)).FpGlobal)).FpCsr; pCsr != 0; pCsr = (*Fts5Cursor)(unsafe.Pointer(pCsr)).FpNext {
- if ((*Fts5Cursor)(unsafe.Pointer(pCsr)).FePlan == FTS5_PLAN_MATCH) &&
- ((*Fts5Cursor)(unsafe.Pointer(pCsr)).Fbase.FpVtab == pTab) {
- *(*int32)(unsafe.Pointer(pCsr + 60 /* &.csrflags */)) |= (FTS5CSR_REQUIRE_RESEEK)
+ if (*Fts5Cursor)(unsafe.Pointer(pCsr)).FePlan == FTS5_PLAN_MATCH &&
+ (*Fts5Cursor)(unsafe.Pointer(pCsr)).Fbase.FpVtab == pTab {
+ *(*int32)(unsafe.Pointer(pCsr + 60)) |= FTS5CSR_REQUIRE_RESEEK
}
}
}
@@ -184576,23 +187085,23 @@ func fts5TripCursors(tls *libc.TLS, pTab uintptr) { /* sqlite3.c:228633:13: */
//
// Return SQLITE_OK if successful or if no reseek was required, or an
// error code if an error occurred.
-func fts5CursorReseek(tls *libc.TLS, pCsr uintptr, pbSkip uintptr) int32 { /* sqlite3.c:228656:12: */
+func fts5CursorReseek(tls *libc.TLS, pCsr uintptr, pbSkip uintptr) int32 { /* sqlite3.c:230562:12: */
var rc int32 = SQLITE_OK
- if ((*Fts5Cursor)(unsafe.Pointer((pCsr))).Fcsrflags & (FTS5CSR_REQUIRE_RESEEK)) != 0 {
+ if (*Fts5Cursor)(unsafe.Pointer(pCsr)).Fcsrflags&FTS5CSR_REQUIRE_RESEEK != 0 {
var pTab uintptr = (*Fts5Cursor)(unsafe.Pointer(pCsr)).Fbase.FpVtab
var bDesc int32 = (*Fts5Cursor)(unsafe.Pointer(pCsr)).FbDesc
var iRowid I64 = sqlite3Fts5ExprRowid(tls, (*Fts5Cursor)(unsafe.Pointer(pCsr)).FpExpr)
rc = sqlite3Fts5ExprFirst(tls, (*Fts5Cursor)(unsafe.Pointer(pCsr)).FpExpr, (*Fts5FullTable)(unsafe.Pointer(pTab)).Fp.FpIndex, iRowid, bDesc)
- if (rc == SQLITE_OK) && (iRowid != sqlite3Fts5ExprRowid(tls, (*Fts5Cursor)(unsafe.Pointer(pCsr)).FpExpr)) {
+ if rc == SQLITE_OK && iRowid != sqlite3Fts5ExprRowid(tls, (*Fts5Cursor)(unsafe.Pointer(pCsr)).FpExpr) {
*(*int32)(unsafe.Pointer(pbSkip)) = 1
}
- *(*int32)(unsafe.Pointer(pCsr + 60 /* &.csrflags */)) &= (libc.CplInt32(FTS5CSR_REQUIRE_RESEEK))
+ *(*int32)(unsafe.Pointer(pCsr + 60)) &= libc.CplInt32(FTS5CSR_REQUIRE_RESEEK)
fts5CsrNewrow(tls, pCsr)
if sqlite3Fts5ExprEof(tls, (*Fts5Cursor)(unsafe.Pointer(pCsr)).FpExpr) != 0 {
- *(*int32)(unsafe.Pointer(pCsr + 60 /* &.csrflags */)) |= (FTS5CSR_EOF)
+ *(*int32)(unsafe.Pointer(pCsr + 60)) |= FTS5CSR_EOF
*(*int32)(unsafe.Pointer(pbSkip)) = 1
}
}
@@ -184605,7 +187114,7 @@ func fts5CursorReseek(tls *libc.TLS, pCsr uintptr, pbSkip uintptr) int32 { /* sq
// Return SQLITE_OK if nothing goes wrong. SQLITE_OK is returned
// even if we reach end-of-file. The fts5EofMethod() will be called
// subsequently to determine whether or not an EOF was hit.
-func fts5NextMethod(tls *libc.TLS, pCursor uintptr) int32 { /* sqlite3.c:228688:12: */
+func fts5NextMethod(tls *libc.TLS, pCursor uintptr) int32 { /* sqlite3.c:230594:12: */
bp := tls.Alloc(12)
defer tls.Free(12)
@@ -184614,17 +187123,17 @@ func fts5NextMethod(tls *libc.TLS, pCursor uintptr) int32 { /* sqlite3.c:228688:
if (*Fts5Cursor)(unsafe.Pointer(pCsr)).FePlan < 3 {
*(*int32)(unsafe.Pointer(bp + 8 /* bSkip */)) = 0
- if (libc.AssignInt32(&rc, fts5CursorReseek(tls, pCsr, bp+8 /* &bSkip */)) != 0) || (*(*int32)(unsafe.Pointer(bp + 8 /* bSkip */)) != 0) {
+ if libc.AssignInt32(&rc, fts5CursorReseek(tls, pCsr, bp+8)) != 0 || *(*int32)(unsafe.Pointer(bp + 8)) != 0 {
return rc
}
rc = sqlite3Fts5ExprNext(tls, (*Fts5Cursor)(unsafe.Pointer(pCsr)).FpExpr, (*Fts5Cursor)(unsafe.Pointer(pCsr)).FiLastRowid)
- *(*int32)(unsafe.Pointer(pCsr + 60 /* &.csrflags */)) |= (sqlite3Fts5ExprEof(tls, (*Fts5Cursor)(unsafe.Pointer(pCsr)).FpExpr))
+ *(*int32)(unsafe.Pointer(pCsr + 60)) |= sqlite3Fts5ExprEof(tls, (*Fts5Cursor)(unsafe.Pointer(pCsr)).FpExpr)
fts5CsrNewrow(tls, pCsr)
} else {
switch (*Fts5Cursor)(unsafe.Pointer(pCsr)).FePlan {
case FTS5_PLAN_SPECIAL:
{
- *(*int32)(unsafe.Pointer(pCsr + 60 /* &.csrflags */)) |= (FTS5CSR_EOF)
+ *(*int32)(unsafe.Pointer(pCsr + 60)) |= FTS5CSR_EOF
rc = SQLITE_OK
break
@@ -184646,11 +187155,11 @@ func fts5NextMethod(tls *libc.TLS, pCursor uintptr) int32 { /* sqlite3.c:228688:
rc = Xsqlite3_step(tls, (*Fts5Cursor)(unsafe.Pointer(pCsr)).FpStmt)
(*Fts5Config)(unsafe.Pointer(pConfig)).FbLock--
if rc != SQLITE_ROW {
- *(*int32)(unsafe.Pointer(pCsr + 60 /* &.csrflags */)) |= (FTS5CSR_EOF)
+ *(*int32)(unsafe.Pointer(pCsr + 60)) |= FTS5CSR_EOF
rc = Xsqlite3_reset(tls, (*Fts5Cursor)(unsafe.Pointer(pCsr)).FpStmt)
if rc != SQLITE_OK {
(*Sqlite3_vtab)(unsafe.Pointer((*Sqlite3_vtab_cursor)(unsafe.Pointer(pCursor)).FpVtab)).FzErrMsg = Xsqlite3_mprintf(tls,
- ts+2790 /* "%s" */, libc.VaList(bp, Xsqlite3_errmsg(tls, (*Fts5Config)(unsafe.Pointer(pConfig)).Fdb)))
+ ts+3601 /* "%s" */, libc.VaList(bp, Xsqlite3_errmsg(tls, (*Fts5Config)(unsafe.Pointer(pConfig)).Fdb)))
}
} else {
rc = SQLITE_OK
@@ -184664,7 +187173,7 @@ func fts5NextMethod(tls *libc.TLS, pCursor uintptr) int32 { /* sqlite3.c:228688:
return rc
}
-func fts5PrepareStatement(tls *libc.TLS, ppStmt uintptr, pConfig uintptr, zFmt uintptr, va uintptr) int32 { /* sqlite3.c:228741:12: */
+func fts5PrepareStatement(tls *libc.TLS, ppStmt uintptr, pConfig uintptr, zFmt uintptr, va uintptr) int32 { /* sqlite3.c:230647:12: */
bp := tls.Alloc(12)
defer tls.Free(12)
@@ -184682,7 +187191,7 @@ func fts5PrepareStatement(tls *libc.TLS, ppStmt uintptr, pConfig uintptr, zFmt u
rc = Xsqlite3_prepare_v3(tls, (*Fts5Config)(unsafe.Pointer(pConfig)).Fdb, zSql, -1,
uint32(SQLITE_PREPARE_PERSISTENT), bp+8 /* &pRet */, uintptr(0))
if rc != SQLITE_OK {
- *(*uintptr)(unsafe.Pointer((*Fts5Config)(unsafe.Pointer(pConfig)).FpzErrmsg)) = Xsqlite3_mprintf(tls, ts+2790 /* "%s" */, libc.VaList(bp, Xsqlite3_errmsg(tls, (*Fts5Config)(unsafe.Pointer(pConfig)).Fdb)))
+ *(*uintptr)(unsafe.Pointer((*Fts5Config)(unsafe.Pointer(pConfig)).FpzErrmsg)) = Xsqlite3_mprintf(tls, ts+3601 /* "%s" */, libc.VaList(bp, Xsqlite3_errmsg(tls, (*Fts5Config)(unsafe.Pointer(pConfig)).Fdb)))
}
Xsqlite3_free(tls, zSql)
}
@@ -184692,7 +187201,7 @@ func fts5PrepareStatement(tls *libc.TLS, ppStmt uintptr, pConfig uintptr, zFmt u
return rc
}
-func fts5CursorFirstSorted(tls *libc.TLS, pTab uintptr, pCsr uintptr, bDesc int32) int32 { /* sqlite3.c:228770:12: */
+func fts5CursorFirstSorted(tls *libc.TLS, pTab uintptr, pCsr uintptr, bDesc int32) int32 { /* sqlite3.c:230676:12: */
bp := tls.Alloc(56)
defer tls.Free(56)
@@ -184705,7 +187214,7 @@ func fts5CursorFirstSorted(tls *libc.TLS, pTab uintptr, pCsr uintptr, bDesc int3
var zRankArgs uintptr = (*Fts5Cursor)(unsafe.Pointer(pCsr)).FzRankArgs
nPhrase = sqlite3Fts5ExprPhraseCount(tls, (*Fts5Cursor)(unsafe.Pointer(pCsr)).FpExpr)
- nByte = (Sqlite3_int64(uint32(unsafe.Sizeof(Fts5Sorter{})) + (uint32(unsafe.Sizeof(int32(0))) * (uint32(nPhrase - 1)))))
+ nByte = Sqlite3_int64(uint32(unsafe.Sizeof(Fts5Sorter{})) + uint32(unsafe.Sizeof(int32(0)))*uint32(nPhrase-1))
pSorter = Xsqlite3_malloc64(tls, uint64(nByte))
if pSorter == uintptr(0) {
return SQLITE_NOMEM
@@ -184720,26 +187229,26 @@ func fts5CursorFirstSorted(tls *libc.TLS, pTab uintptr, pCsr uintptr, bDesc int3
// table, saving it creates a circular reference.
//
// If SQLite a built-in statement cache, this wouldn't be a problem.
- rc = fts5PrepareStatement(tls, (pSorter /* &.pStmt */), pConfig,
- ts+33552, /* "SELECT rowid, ra..." */
+ rc = fts5PrepareStatement(tls, pSorter, pConfig,
+ ts+34912, /* "SELECT rowid, ra..." */
libc.VaList(bp, (*Fts5Config)(unsafe.Pointer(pConfig)).FzDb, (*Fts5Config)(unsafe.Pointer(pConfig)).FzName, zRank, (*Fts5Config)(unsafe.Pointer(pConfig)).FzName,
func() uintptr {
if zRankArgs != 0 {
- return ts + 13324 /* ", " */
+ return ts + 14507 /* ", " */
}
- return ts + 755 /* "" */
+ return ts + 1543 /* "" */
}(),
func() uintptr {
if zRankArgs != 0 {
return zRankArgs
}
- return ts + 755 /* "" */
+ return ts + 1543
}(),
func() uintptr {
if bDesc != 0 {
- return ts + 33607 /* "DESC" */
+ return ts + 34967 /* "DESC" */
}
- return ts + 33612 /* "ASC" */
+ return ts + 34972 /* "ASC" */
}()))
(*Fts5Cursor)(unsafe.Pointer(pCsr)).FpSorter = pSorter
@@ -184759,12 +187268,12 @@ func fts5CursorFirstSorted(tls *libc.TLS, pTab uintptr, pCsr uintptr, bDesc int3
return rc
}
-func fts5CursorFirst(tls *libc.TLS, pTab uintptr, pCsr uintptr, bDesc int32) int32 { /* sqlite3.c:228822:12: */
+func fts5CursorFirst(tls *libc.TLS, pTab uintptr, pCsr uintptr, bDesc int32) int32 { /* sqlite3.c:230728:12: */
var rc int32
var pExpr uintptr = (*Fts5Cursor)(unsafe.Pointer(pCsr)).FpExpr
rc = sqlite3Fts5ExprFirst(tls, pExpr, (*Fts5FullTable)(unsafe.Pointer(pTab)).Fp.FpIndex, (*Fts5Cursor)(unsafe.Pointer(pCsr)).FiFirstRowid, bDesc)
if sqlite3Fts5ExprEof(tls, pExpr) != 0 {
- *(*int32)(unsafe.Pointer(pCsr + 60 /* &.csrflags */)) |= (FTS5CSR_EOF)
+ *(*int32)(unsafe.Pointer(pCsr + 60)) |= FTS5CSR_EOF
}
fts5CsrNewrow(tls, pCsr)
return rc
@@ -184774,7 +187283,7 @@ func fts5CursorFirst(tls *libc.TLS, pTab uintptr, pCsr uintptr, bDesc int32) int
// MATCH expression that begins with a '*' character. The remainder of
// the text passed to the MATCH operator are used as the special query
// parameters.
-func fts5SpecialMatch(tls *libc.TLS, pTab uintptr, pCsr uintptr, zQuery uintptr) int32 { /* sqlite3.c:228839:12: */
+func fts5SpecialMatch(tls *libc.TLS, pTab uintptr, pCsr uintptr, zQuery uintptr) int32 { /* sqlite3.c:230745:12: */
bp := tls.Alloc(16)
defer tls.Free(16)
@@ -184785,18 +187294,18 @@ func fts5SpecialMatch(tls *libc.TLS, pTab uintptr, pCsr uintptr, zQuery uintptr)
for int32(*(*uint8)(unsafe.Pointer(z))) == ' ' {
z++
}
- for n = 0; (*(*uint8)(unsafe.Pointer(z + uintptr(n))) != 0) && (int32(*(*uint8)(unsafe.Pointer(z + uintptr(n)))) != ' '); n++ {
+ for n = 0; *(*uint8)(unsafe.Pointer(z + uintptr(n))) != 0 && int32(*(*uint8)(unsafe.Pointer(z + uintptr(n)))) != ' '; n++ {
}
(*Fts5Cursor)(unsafe.Pointer(pCsr)).FePlan = FTS5_PLAN_SPECIAL
- if (n == 5) && (0 == Xsqlite3_strnicmp(tls, ts+33616 /* "reads" */, z, n)) {
+ if n == 5 && 0 == Xsqlite3_strnicmp(tls, ts+34976, z, n) {
(*Fts5Cursor)(unsafe.Pointer(pCsr)).FiSpecial = I64(sqlite3Fts5IndexReads(tls, (*Fts5FullTable)(unsafe.Pointer(pTab)).Fp.FpIndex))
- } else if (n == 2) && (0 == Xsqlite3_strnicmp(tls, ts+4171 /* "id" */, z, n)) {
+ } else if n == 2 && 0 == Xsqlite3_strnicmp(tls, ts+4977, z, n) {
(*Fts5Cursor)(unsafe.Pointer(pCsr)).FiSpecial = (*Fts5Cursor)(unsafe.Pointer(pCsr)).FiCsrId
} else {
// An unrecognized directive. Return an error message.
- (*Fts5FullTable)(unsafe.Pointer(pTab)).Fp.Fbase.FzErrMsg = Xsqlite3_mprintf(tls, ts+33622 /* "unknown special ..." */, libc.VaList(bp, n, z))
+ (*Fts5FullTable)(unsafe.Pointer(pTab)).Fp.Fbase.FzErrMsg = Xsqlite3_mprintf(tls, ts+34982 /* "unknown special ..." */, libc.VaList(bp, n, z))
rc = SQLITE_ERROR
}
@@ -184806,7 +187315,7 @@ func fts5SpecialMatch(tls *libc.TLS, pTab uintptr, pCsr uintptr, zQuery uintptr)
// Search for an auxiliary function named zName that can be used with table
// pTab. If one is found, return a pointer to the corresponding Fts5Auxiliary
// structure. Otherwise, if no such function exists, return NULL.
-func fts5FindAuxiliary(tls *libc.TLS, pTab uintptr, zName uintptr) uintptr { /* sqlite3.c:228874:22: */
+func fts5FindAuxiliary(tls *libc.TLS, pTab uintptr, zName uintptr) uintptr { /* sqlite3.c:230780:22: */
var pAux uintptr
for pAux = (*Fts5Global)(unsafe.Pointer((*Fts5FullTable)(unsafe.Pointer(pTab)).FpGlobal)).FpAux; pAux != 0; pAux = (*Fts5Auxiliary)(unsafe.Pointer(pAux)).FpNext {
@@ -184819,7 +187328,7 @@ func fts5FindAuxiliary(tls *libc.TLS, pTab uintptr, zName uintptr) uintptr { /*
return uintptr(0)
}
-func fts5FindRankFunction(tls *libc.TLS, pCsr uintptr) int32 { /* sqlite3.c:228886:12: */
+func fts5FindRankFunction(tls *libc.TLS, pCsr uintptr) int32 { /* sqlite3.c:230792:12: */
bp := tls.Alloc(24)
defer tls.Free(24)
@@ -184831,20 +187340,20 @@ func fts5FindRankFunction(tls *libc.TLS, pCsr uintptr) int32 { /* sqlite3.c:2288
var zRankArgs uintptr = (*Fts5Cursor)(unsafe.Pointer(pCsr)).FzRankArgs
if zRankArgs != 0 {
- var zSql uintptr = sqlite3Fts5Mprintf(tls, bp+16 /* &rc */, ts+33650 /* "SELECT %s" */, libc.VaList(bp, zRankArgs))
+ var zSql uintptr = sqlite3Fts5Mprintf(tls, bp+16 /* &rc */, ts+35010 /* "SELECT %s" */, libc.VaList(bp, zRankArgs))
if zSql != 0 {
*(*uintptr)(unsafe.Pointer(bp + 20 /* pStmt */)) = uintptr(0)
*(*int32)(unsafe.Pointer(bp + 16 /* rc */)) = Xsqlite3_prepare_v3(tls, (*Fts5Config)(unsafe.Pointer(pConfig)).Fdb, zSql, -1,
uint32(SQLITE_PREPARE_PERSISTENT), bp+20 /* &pStmt */, uintptr(0))
Xsqlite3_free(tls, zSql)
- if *(*int32)(unsafe.Pointer(bp + 16 /* rc */)) == SQLITE_OK {
- if SQLITE_ROW == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp + 20 /* pStmt */))) {
+ if *(*int32)(unsafe.Pointer(bp + 16)) == SQLITE_OK {
+ if SQLITE_ROW == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp + 20))) {
var nByte Sqlite3_int64
(*Fts5Cursor)(unsafe.Pointer(pCsr)).FnRankArg = Xsqlite3_column_count(tls, *(*uintptr)(unsafe.Pointer(bp + 20 /* pStmt */)))
- nByte = (Sqlite3_int64(uint32(unsafe.Sizeof(uintptr(0))) * uint32((*Fts5Cursor)(unsafe.Pointer(pCsr)).FnRankArg)))
+ nByte = Sqlite3_int64(uint32(unsafe.Sizeof(uintptr(0))) * uint32((*Fts5Cursor)(unsafe.Pointer(pCsr)).FnRankArg))
(*Fts5Cursor)(unsafe.Pointer(pCsr)).FapRankArg = sqlite3Fts5MallocZero(tls, bp+16 /* &rc */, nByte)
- if *(*int32)(unsafe.Pointer(bp + 16 /* rc */)) == SQLITE_OK {
+ if *(*int32)(unsafe.Pointer(bp + 16)) == SQLITE_OK {
var i int32
for i = 0; i < (*Fts5Cursor)(unsafe.Pointer(pCsr)).FnRankArg; i++ {
*(*uintptr)(unsafe.Pointer((*Fts5Cursor)(unsafe.Pointer(pCsr)).FapRankArg + uintptr(i)*4)) = Xsqlite3_column_value(tls, *(*uintptr)(unsafe.Pointer(bp + 20 /* pStmt */)), i)
@@ -184859,11 +187368,11 @@ func fts5FindRankFunction(tls *libc.TLS, pCsr uintptr) int32 { /* sqlite3.c:2288
}
}
- if *(*int32)(unsafe.Pointer(bp + 16 /* rc */)) == SQLITE_OK {
+ if *(*int32)(unsafe.Pointer(bp + 16)) == SQLITE_OK {
pAux = fts5FindAuxiliary(tls, pTab, zRank)
if pAux == uintptr(0) {
- (*Fts5FullTable)(unsafe.Pointer(pTab)).Fp.Fbase.FzErrMsg = Xsqlite3_mprintf(tls, ts+33660 /* "no such function..." */, libc.VaList(bp+8, zRank))
+ (*Fts5FullTable)(unsafe.Pointer(pTab)).Fp.Fbase.FzErrMsg = Xsqlite3_mprintf(tls, ts+35020 /* "no such function..." */, libc.VaList(bp+8, zRank))
*(*int32)(unsafe.Pointer(bp + 16 /* rc */)) = SQLITE_ERROR
}
}
@@ -184872,7 +187381,7 @@ func fts5FindRankFunction(tls *libc.TLS, pCsr uintptr) int32 { /* sqlite3.c:2288
return *(*int32)(unsafe.Pointer(bp + 16 /* rc */))
}
-func fts5CursorParseRank(tls *libc.TLS, pConfig uintptr, pCsr uintptr, pRank uintptr) int32 { /* sqlite3.c:228937:12: */
+func fts5CursorParseRank(tls *libc.TLS, pConfig uintptr, pCsr uintptr, pRank uintptr) int32 { /* sqlite3.c:230843:12: */
bp := tls.Alloc(16)
defer tls.Free(16)
@@ -184892,24 +187401,24 @@ func fts5CursorParseRank(tls *libc.TLS, pConfig uintptr, pCsr uintptr, pRank uin
if rc == SQLITE_OK {
(*Fts5Cursor)(unsafe.Pointer(pCsr)).FzRank = *(*uintptr)(unsafe.Pointer(bp + 8 /* zRank */))
(*Fts5Cursor)(unsafe.Pointer(pCsr)).FzRankArgs = *(*uintptr)(unsafe.Pointer(bp + 12 /* zRankArgs */))
- *(*int32)(unsafe.Pointer(pCsr + 60 /* &.csrflags */)) |= (FTS5CSR_FREE_ZRANK)
+ *(*int32)(unsafe.Pointer(pCsr + 60)) |= FTS5CSR_FREE_ZRANK
} else if rc == SQLITE_ERROR {
(*Sqlite3_vtab)(unsafe.Pointer((*Fts5Cursor)(unsafe.Pointer(pCsr)).Fbase.FpVtab)).FzErrMsg = Xsqlite3_mprintf(tls,
- ts+33681 /* "parse error in r..." */, libc.VaList(bp, z))
+ ts+35041 /* "parse error in r..." */, libc.VaList(bp, z))
}
} else {
if (*Fts5Config)(unsafe.Pointer(pConfig)).FzRank != 0 {
(*Fts5Cursor)(unsafe.Pointer(pCsr)).FzRank = (*Fts5Config)(unsafe.Pointer(pConfig)).FzRank
(*Fts5Cursor)(unsafe.Pointer(pCsr)).FzRankArgs = (*Fts5Config)(unsafe.Pointer(pConfig)).FzRankArgs
} else {
- (*Fts5Cursor)(unsafe.Pointer(pCsr)).FzRank = ts + 32064 /* "bm25" */
+ (*Fts5Cursor)(unsafe.Pointer(pCsr)).FzRank = ts + 33424 /* "bm25" */
(*Fts5Cursor)(unsafe.Pointer(pCsr)).FzRankArgs = uintptr(0)
}
}
return rc
}
-func fts5GetRowidLimit(tls *libc.TLS, pVal uintptr, iDefault I64) I64 { /* sqlite3.c:228974:12: */
+func fts5GetRowidLimit(tls *libc.TLS, pVal uintptr, iDefault I64) I64 { /* sqlite3.c:230880:12: */
if pVal != 0 {
var eType int32 = Xsqlite3_value_numeric_type(tls, pVal)
if eType == SQLITE_INTEGER {
@@ -184928,7 +187437,7 @@ func fts5GetRowidLimit(tls *libc.TLS, pVal uintptr, iDefault I64) I64 { /* sqlit
// 1. Full-text search using a MATCH operator.
// 2. A by-rowid lookup.
// 3. A full-table scan.
-func fts5FilterMethod(tls *libc.TLS, pCursor uintptr, idxNum int32, idxStr uintptr, nVal int32, apVal uintptr) int32 { /* sqlite3.c:228995:12: */
+func fts5FilterMethod(tls *libc.TLS, pCursor uintptr, idxNum int32, idxStr uintptr, nVal int32, apVal uintptr) int32 { /* sqlite3.c:230901:12: */
bp := tls.Alloc(12)
defer tls.Free(12)
@@ -184968,7 +187477,7 @@ func fts5FilterMethod(tls *libc.TLS, pCursor uintptr, idxNum int32, idxStr uintp
goto __1
}
(*Fts5FullTable)(unsafe.Pointer(pTab)).Fp.Fbase.FzErrMsg = Xsqlite3_mprintf(tls,
- ts+33513 /* "recursively defi..." */, 0)
+ ts+34873 /* "recursively defi..." */, 0)
return SQLITE_ERROR
__1:
;
@@ -184977,11 +187486,11 @@ __1:
goto __2
}
fts5FreeCursorComponents(tls, pCsr)
- libc.Xmemset(tls, (pCsr + 24 /* &.ePlan */), 0, (uint32(unsafe.Sizeof(Fts5Cursor{})) - (uint32((int32((pCsr + 24 /* &.ePlan */)) - int32(pCsr)) / 1))))
+ libc.Xmemset(tls, pCsr+24, 0, uint32(unsafe.Sizeof(Fts5Cursor{}))-uint32((int32(pCsr+24)-int32(pCsr))/1))
__2:
;
- (*Fts5Config)(unsafe.Pointer(pConfig)).FpzErrmsg = (pTab /* &.p */ /* &.base */ + 8 /* &.zErrMsg */)
+ (*Fts5Config)(unsafe.Pointer(pConfig)).FpzErrmsg = pTab + 8
// Decode the arguments passed through to this function.
i = 0
@@ -185014,16 +187523,16 @@ __8:
if !(zText == uintptr(0)) {
goto __14
}
- zText = ts + 755 /* "" */
+ zText = ts + 1543 /* "" */
__14:
;
iCol = 0
__15:
- iCol = ((iCol * 10) + (int32(*(*uint8)(unsafe.Pointer(idxStr + uintptr(iIdxStr)))) - '0'))
+ iCol = iCol*10 + (int32(*(*uint8)(unsafe.Pointer(idxStr + uintptr(iIdxStr)))) - '0')
iIdxStr++
goto __16
__16:
- if (int32(*(*uint8)(unsafe.Pointer(idxStr + uintptr(iIdxStr)))) >= '0') && (int32(*(*uint8)(unsafe.Pointer(idxStr + uintptr(iIdxStr)))) <= '9') {
+ if int32(*(*uint8)(unsafe.Pointer(idxStr + uintptr(iIdxStr)))) >= '0' && int32(*(*uint8)(unsafe.Pointer(idxStr + uintptr(iIdxStr)))) <= '9' {
goto __15
}
goto __17
@@ -185036,16 +187545,16 @@ __17:
// 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))
+ rc = fts5SpecialMatch(tls, pTab, pCsr, zText+1)
goto filter_out
goto __19
__18:
- pzErr = (pTab /* &.p */ /* &.base */ + 8 /* &.zErrMsg */)
+ pzErr = pTab + 8
rc = sqlite3Fts5ExprNew(tls, pConfig, 0, iCol, zText, bp+8 /* &pExpr */, pzErr)
if !(rc == SQLITE_OK) {
goto __20
}
- rc = sqlite3Fts5ExprAnd(tls, (pCsr + 52 /* &.pExpr */), *(*uintptr)(unsafe.Pointer(bp + 8 /* pExpr */)))
+ rc = sqlite3Fts5ExprAnd(tls, pCsr+52, *(*uintptr)(unsafe.Pointer(bp + 8 /* pExpr */)))
*(*uintptr)(unsafe.Pointer(bp + 8 /* pExpr */)) = uintptr(0)
__20:
;
@@ -185062,15 +187571,15 @@ __19:
__9:
__10:
- bGlob = (libc.Bool32(int32(*(*uint8)(unsafe.Pointer(idxStr + uintptr((iIdxStr - 1))))) == 'G'))
+ bGlob = libc.Bool32(int32(*(*uint8)(unsafe.Pointer(idxStr + uintptr(iIdxStr-1)))) == 'G')
zText1 = Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(apVal + uintptr(i)*4)))
iCol = 0
__22:
- iCol = ((iCol * 10) + (int32(*(*uint8)(unsafe.Pointer(idxStr + uintptr(iIdxStr)))) - '0'))
+ iCol = iCol*10 + (int32(*(*uint8)(unsafe.Pointer(idxStr + uintptr(iIdxStr)))) - '0')
iIdxStr++
goto __23
__23:
- if (int32(*(*uint8)(unsafe.Pointer(idxStr + uintptr(iIdxStr)))) >= '0') && (int32(*(*uint8)(unsafe.Pointer(idxStr + uintptr(iIdxStr)))) <= '9') {
+ if int32(*(*uint8)(unsafe.Pointer(idxStr + uintptr(iIdxStr)))) >= '0' && int32(*(*uint8)(unsafe.Pointer(idxStr + uintptr(iIdxStr)))) <= '9' {
goto __22
}
goto __24
@@ -185085,7 +187594,7 @@ __25:
if !(rc == SQLITE_OK) {
goto __26
}
- rc = sqlite3Fts5ExprAnd(tls, (pCsr + 52 /* &.pExpr */), *(*uintptr)(unsafe.Pointer(bp + 8 /* pExpr */)))
+ rc = sqlite3Fts5ExprAnd(tls, pCsr+52, *(*uintptr)(unsafe.Pointer(bp + 8 /* pExpr */)))
*(*uintptr)(unsafe.Pointer(bp + 8 /* pExpr */)) = uintptr(0)
__26:
;
@@ -185117,13 +187626,13 @@ __4:
__5:
;
bOrderByRank = func() int32 {
- if (idxNum & FTS5_BI_ORDER_RANK) != 0 {
+ if idxNum&FTS5_BI_ORDER_RANK != 0 {
return 1
}
return 0
}()
(*Fts5Cursor)(unsafe.Pointer(pCsr)).FbDesc = libc.AssignInt32(&bDesc, func() int32 {
- if (idxNum & FTS5_BI_ORDER_DESC) != 0 {
+ if idxNum&FTS5_BI_ORDER_DESC != 0 {
return 1
}
return 0
@@ -185142,12 +187651,12 @@ __28:
if !(bDesc != 0) {
goto __29
}
- (*Fts5Cursor)(unsafe.Pointer(pCsr)).FiFirstRowid = fts5GetRowidLimit(tls, pRowidLe, (int64(0xffffffff) | (I64((int64(0x7fffffff))) << 32)))
- (*Fts5Cursor)(unsafe.Pointer(pCsr)).FiLastRowid = fts5GetRowidLimit(tls, pRowidGe, ((int64(-1)) - (int64(0xffffffff) | (I64((int64(0x7fffffff))) << 32))))
+ (*Fts5Cursor)(unsafe.Pointer(pCsr)).FiFirstRowid = fts5GetRowidLimit(tls, pRowidLe, int64(0xffffffff)|I64(int64(0x7fffffff))<<32)
+ (*Fts5Cursor)(unsafe.Pointer(pCsr)).FiLastRowid = fts5GetRowidLimit(tls, pRowidGe, int64(-1)-(int64(0xffffffff)|I64(int64(0x7fffffff))<<32))
goto __30
__29:
- (*Fts5Cursor)(unsafe.Pointer(pCsr)).FiLastRowid = fts5GetRowidLimit(tls, pRowidLe, (int64(0xffffffff) | (I64((int64(0x7fffffff))) << 32)))
- (*Fts5Cursor)(unsafe.Pointer(pCsr)).FiFirstRowid = fts5GetRowidLimit(tls, pRowidGe, ((int64(-1)) - (int64(0xffffffff) | (I64((int64(0x7fffffff))) << 32))))
+ (*Fts5Cursor)(unsafe.Pointer(pCsr)).FiLastRowid = fts5GetRowidLimit(tls, pRowidLe, int64(0xffffffff)|I64(int64(0x7fffffff))<<32)
+ (*Fts5Cursor)(unsafe.Pointer(pCsr)).FiFirstRowid = fts5GetRowidLimit(tls, pRowidGe, int64(-1)-(int64(0xffffffff)|I64(int64(0x7fffffff))<<32))
__30:
;
@@ -185203,7 +187712,7 @@ __35:
goto __40
}
*(*uintptr)(unsafe.Pointer((*Fts5Config)(unsafe.Pointer(pConfig)).FpzErrmsg)) = Xsqlite3_mprintf(tls,
- ts+33714 /* "%s: table does n..." */, libc.VaList(bp, (*Fts5Config)(unsafe.Pointer(pConfig)).FzName))
+ ts+35074 /* "%s: table does n..." */, libc.VaList(bp, (*Fts5Config)(unsafe.Pointer(pConfig)).FzName))
rc = SQLITE_ERROR
goto __41
__40:
@@ -185216,13 +187725,14 @@ __40:
return FTS5_PLAN_SCAN
}()
rc = sqlite3Fts5StorageStmt(tls,
- (*Fts5FullTable)(unsafe.Pointer(pTab)).FpStorage, fts5StmtType(tls, pCsr), (pCsr + 48 /* &.pStmt */), (pTab /* &.p */ /* &.base */ + 8 /* &.zErrMsg */))
+ (*Fts5FullTable)(unsafe.Pointer(pTab)).FpStorage, fts5StmtType(tls, pCsr), pCsr+48, pTab+8)
if !(rc == SQLITE_OK) {
goto __42
}
- if !((*Fts5Cursor)(unsafe.Pointer(pCsr)).FePlan == FTS5_PLAN_ROWID) {
+ if !(pRowidEq != uintptr(0)) {
goto __43
}
+
Xsqlite3_bind_value(tls, (*Fts5Cursor)(unsafe.Pointer(pCsr)).FpStmt, 1, pRowidEq)
goto __44
__43:
@@ -185248,10 +187758,10 @@ filter_out:
// This is the xEof method of the virtual table. SQLite calls this
// routine to find out if it has reached the end of a result set.
-func fts5EofMethod(tls *libc.TLS, pCursor uintptr) int32 { /* sqlite3.c:229187:12: */
+func fts5EofMethod(tls *libc.TLS, pCursor uintptr) int32 { /* sqlite3.c:231094:12: */
var pCsr uintptr = pCursor
return func() int32 {
- if ((*Fts5Cursor)(unsafe.Pointer((pCsr))).Fcsrflags & (FTS5CSR_EOF)) != 0 {
+ if (*Fts5Cursor)(unsafe.Pointer(pCsr)).Fcsrflags&FTS5CSR_EOF != 0 {
return 1
}
return 0
@@ -185259,7 +187769,7 @@ func fts5EofMethod(tls *libc.TLS, pCursor uintptr) int32 { /* sqlite3.c:229187:1
}
// Return the rowid that the cursor currently points to.
-func fts5CursorRowid(tls *libc.TLS, pCsr uintptr) I64 { /* sqlite3.c:229195:12: */
+func fts5CursorRowid(tls *libc.TLS, pCsr uintptr) I64 { /* sqlite3.c:231102:12: */
if (*Fts5Cursor)(unsafe.Pointer(pCsr)).FpSorter != 0 {
return (*Fts5Sorter)(unsafe.Pointer((*Fts5Cursor)(unsafe.Pointer(pCsr)).FpSorter)).FiRowid
@@ -185273,7 +187783,7 @@ func fts5CursorRowid(tls *libc.TLS, pCsr uintptr) I64 { /* sqlite3.c:229195:12:
// retrieve the rowid for the current row of the result set. fts5
// exposes %_content.rowid as the rowid for the virtual table. The
// rowid should be written to *pRowid.
-func fts5RowidMethod(tls *libc.TLS, pCursor uintptr, pRowid uintptr) int32 { /* sqlite3.c:229213:12: */
+func fts5RowidMethod(tls *libc.TLS, pCursor uintptr, pRowid uintptr) int32 { /* sqlite3.c:231120:12: */
var pCsr uintptr = pCursor
var ePlan int32 = (*Fts5Cursor)(unsafe.Pointer(pCsr)).FePlan
@@ -185303,7 +187813,7 @@ func fts5RowidMethod(tls *libc.TLS, pCursor uintptr, pRowid uintptr) int32 { /*
//
// If argument bErrormsg is true and an error occurs, an error message may
// be left in sqlite3_vtab.zErrMsg.
-func fts5SeekCursor(tls *libc.TLS, pCsr uintptr, bErrormsg int32) int32 { /* sqlite3.c:229244:12: */
+func fts5SeekCursor(tls *libc.TLS, pCsr uintptr, bErrormsg int32) int32 { /* sqlite3.c:231151:12: */
bp := tls.Alloc(8)
defer tls.Free(8)
@@ -185314,16 +187824,16 @@ func fts5SeekCursor(tls *libc.TLS, pCsr uintptr, bErrormsg int32) int32 { /* sql
var pTab uintptr = (*Fts5Cursor)(unsafe.Pointer(pCsr)).Fbase.FpVtab
var eStmt int32 = fts5StmtType(tls, pCsr)
rc = sqlite3Fts5StorageStmt(tls,
- (*Fts5FullTable)(unsafe.Pointer(pTab)).FpStorage, eStmt, (pCsr + 48 /* &.pStmt */), func() uintptr {
+ (*Fts5FullTable)(unsafe.Pointer(pTab)).FpStorage, eStmt, pCsr+48, func() uintptr {
if bErrormsg != 0 {
- return (pTab /* &.p */ /* &.base */ + 8 /* &.zErrMsg */)
+ return pTab + 8
}
return uintptr(0)
}())
}
- if (rc == SQLITE_OK) && (((*Fts5Cursor)(unsafe.Pointer((pCsr))).Fcsrflags & (FTS5CSR_REQUIRE_CONTENT)) != 0) {
+ if rc == SQLITE_OK && (*Fts5Cursor)(unsafe.Pointer(pCsr)).Fcsrflags&FTS5CSR_REQUIRE_CONTENT != 0 {
var pTab uintptr = (*Fts5Cursor)(unsafe.Pointer(pCsr)).Fbase.FpVtab
Xsqlite3_reset(tls, (*Fts5Cursor)(unsafe.Pointer(pCsr)).FpStmt)
@@ -185333,21 +187843,21 @@ func fts5SeekCursor(tls *libc.TLS, pCsr uintptr, bErrormsg int32) int32 { /* sql
(*Fts5Config)(unsafe.Pointer((*Fts5Table)(unsafe.Pointer(pTab)).FpConfig)).FbLock--
if rc == SQLITE_ROW {
rc = SQLITE_OK
- *(*int32)(unsafe.Pointer(pCsr + 60 /* &.csrflags */)) &= (libc.CplInt32(FTS5CSR_REQUIRE_CONTENT))
+ *(*int32)(unsafe.Pointer(pCsr + 60)) &= libc.CplInt32(FTS5CSR_REQUIRE_CONTENT)
} else {
rc = Xsqlite3_reset(tls, (*Fts5Cursor)(unsafe.Pointer(pCsr)).FpStmt)
if rc == SQLITE_OK {
- rc = (SQLITE_CORRUPT | (int32(1) << 8))
+ rc = SQLITE_CORRUPT | int32(1)<<8
} else if (*Fts5Config)(unsafe.Pointer((*Fts5Table)(unsafe.Pointer(pTab)).FpConfig)).FpzErrmsg != 0 {
*(*uintptr)(unsafe.Pointer((*Fts5Config)(unsafe.Pointer((*Fts5Table)(unsafe.Pointer(pTab)).FpConfig)).FpzErrmsg)) = Xsqlite3_mprintf(tls,
- ts+2790 /* "%s" */, libc.VaList(bp, Xsqlite3_errmsg(tls, (*Fts5Config)(unsafe.Pointer((*Fts5Table)(unsafe.Pointer(pTab)).FpConfig)).Fdb)))
+ ts+3601 /* "%s" */, libc.VaList(bp, Xsqlite3_errmsg(tls, (*Fts5Config)(unsafe.Pointer((*Fts5Table)(unsafe.Pointer(pTab)).FpConfig)).Fdb)))
}
}
}
return rc
}
-func fts5SetVtabError(tls *libc.TLS, p uintptr, zFormat uintptr, va uintptr) { /* sqlite3.c:229283:13: */
+func fts5SetVtabError(tls *libc.TLS, p uintptr, zFormat uintptr, va uintptr) { /* sqlite3.c:231190:13: */
var ap Va_list
_ = ap // ... printf arguments
ap = va
@@ -185369,7 +187879,7 @@ func fts5SetVtabError(tls *libc.TLS, p uintptr, zFormat uintptr, va uintptr) { /
// The commands implemented by this function are documented in the "Special
// INSERT Directives" section of the documentation. It should be updated if
// more commands are added to this function.
-func fts5SpecialInsert(tls *libc.TLS, pTab uintptr, zCmd uintptr, pVal uintptr) int32 { /* sqlite3.c:229306:12: */
+func fts5SpecialInsert(tls *libc.TLS, pTab uintptr, zCmd uintptr, pVal uintptr) int32 { /* sqlite3.c:231213:12: */
bp := tls.Alloc(4)
defer tls.Free(4)
@@ -185377,29 +187887,29 @@ func fts5SpecialInsert(tls *libc.TLS, pTab uintptr, zCmd uintptr, pVal uintptr)
var rc int32 = SQLITE_OK
*(*int32)(unsafe.Pointer(bp /* bError */)) = 0
- if 0 == Xsqlite3_stricmp(tls, ts+33750 /* "delete-all" */, zCmd) {
+ if 0 == Xsqlite3_stricmp(tls, ts+35110, zCmd) {
if (*Fts5Config)(unsafe.Pointer(pConfig)).FeContent == FTS5_CONTENT_NORMAL {
fts5SetVtabError(tls, pTab,
- ts+33761 /* "'delete-all' may..." */, 0)
+ ts+35121 /* "'delete-all' may..." */, 0)
rc = SQLITE_ERROR
} else {
rc = sqlite3Fts5StorageDeleteAll(tls, (*Fts5FullTable)(unsafe.Pointer(pTab)).FpStorage)
}
- } else if 0 == Xsqlite3_stricmp(tls, ts+33841 /* "rebuild" */, zCmd) {
+ } else if 0 == Xsqlite3_stricmp(tls, ts+35201, zCmd) {
if (*Fts5Config)(unsafe.Pointer(pConfig)).FeContent == FTS5_CONTENT_NONE {
fts5SetVtabError(tls, pTab,
- ts+33849 /* "'rebuild' may no..." */, 0)
+ ts+35209 /* "'rebuild' may no..." */, 0)
rc = SQLITE_ERROR
} else {
rc = sqlite3Fts5StorageRebuild(tls, (*Fts5FullTable)(unsafe.Pointer(pTab)).FpStorage)
}
- } else if 0 == Xsqlite3_stricmp(tls, ts+15428 /* "optimize" */, zCmd) {
+ } else if 0 == Xsqlite3_stricmp(tls, ts+16632, zCmd) {
rc = sqlite3Fts5StorageOptimize(tls, (*Fts5FullTable)(unsafe.Pointer(pTab)).FpStorage)
- } else if 0 == Xsqlite3_stricmp(tls, ts+33905 /* "merge" */, zCmd) {
+ } else if 0 == Xsqlite3_stricmp(tls, ts+35265, zCmd) {
var nMerge int32 = Xsqlite3_value_int(tls, pVal)
rc = sqlite3Fts5StorageMerge(tls, (*Fts5FullTable)(unsafe.Pointer(pTab)).FpStorage, nMerge)
- } else if 0 == Xsqlite3_stricmp(tls, ts+33911 /* "integrity-check" */, zCmd) {
+ } else if 0 == Xsqlite3_stricmp(tls, ts+35271, zCmd) {
var iArg int32 = Xsqlite3_value_int(tls, pVal)
rc = sqlite3Fts5StorageIntegrity(tls, (*Fts5FullTable)(unsafe.Pointer(pTab)).FpStorage, iArg)
} else {
@@ -185408,7 +187918,7 @@ func fts5SpecialInsert(tls *libc.TLS, pTab uintptr, zCmd uintptr, pVal uintptr)
rc = sqlite3Fts5ConfigSetValue(tls, (*Fts5FullTable)(unsafe.Pointer(pTab)).Fp.FpConfig, zCmd, pVal, bp /* &bError */)
}
if rc == SQLITE_OK {
- if *(*int32)(unsafe.Pointer(bp /* bError */)) != 0 {
+ if *(*int32)(unsafe.Pointer(bp)) != 0 {
rc = SQLITE_ERROR
} else {
rc = sqlite3Fts5StorageConfigValue(tls, (*Fts5FullTable)(unsafe.Pointer(pTab)).FpStorage, zCmd, pVal, 0)
@@ -185418,17 +187928,17 @@ func fts5SpecialInsert(tls *libc.TLS, pTab uintptr, zCmd uintptr, pVal uintptr)
return rc
}
-func fts5SpecialDelete(tls *libc.TLS, pTab uintptr, apVal uintptr) int32 { /* sqlite3.c:229362:12: */
+func fts5SpecialDelete(tls *libc.TLS, pTab uintptr, apVal uintptr) int32 { /* sqlite3.c:231269:12: */
var rc int32 = SQLITE_OK
var eType1 int32 = Xsqlite3_value_type(tls, *(*uintptr)(unsafe.Pointer(apVal + 1*4)))
if eType1 == SQLITE_INTEGER {
var iDel Sqlite3_int64 = Xsqlite3_value_int64(tls, *(*uintptr)(unsafe.Pointer(apVal + 1*4)))
- rc = sqlite3Fts5StorageDelete(tls, (*Fts5FullTable)(unsafe.Pointer(pTab)).FpStorage, iDel, (apVal + 2*4))
+ rc = sqlite3Fts5StorageDelete(tls, (*Fts5FullTable)(unsafe.Pointer(pTab)).FpStorage, iDel, apVal+2*4)
}
return rc
}
-func fts5StorageInsert(tls *libc.TLS, pRc uintptr, pTab uintptr, apVal uintptr, piRowid uintptr) { /* sqlite3.c:229375:13: */
+func fts5StorageInsert(tls *libc.TLS, pRc uintptr, pTab uintptr, apVal uintptr, piRowid uintptr) { /* sqlite3.c:231282:13: */
var rc int32 = *(*int32)(unsafe.Pointer(pRc))
if rc == SQLITE_OK {
rc = sqlite3Fts5StorageContentInsert(tls, (*Fts5FullTable)(unsafe.Pointer(pTab)).FpStorage, apVal, piRowid)
@@ -185451,7 +187961,7 @@ func fts5StorageInsert(tls *libc.TLS, pRc uintptr, pTab uintptr, apVal uintptr,
// 2. The "new" rowid.
// 3. Values for each of the nCol matchable columns.
// 4. Values for the two hidden columns (<tablename> and "rank").
-func fts5UpdateMethod(tls *libc.TLS, pVtab uintptr, nArg int32, apVal uintptr, pRowid uintptr) int32 { /* sqlite3.c:229405:12: */
+func fts5UpdateMethod(tls *libc.TLS, pVtab uintptr, nArg int32, apVal uintptr, pRowid uintptr) int32 { /* sqlite3.c:231312:12: */
bp := tls.Alloc(20)
defer tls.Free(20)
@@ -185462,21 +187972,21 @@ func fts5UpdateMethod(tls *libc.TLS, pVtab uintptr, nArg int32, apVal uintptr, p
// A transaction must be open when this is called.
- (*Fts5Config)(unsafe.Pointer((*Fts5FullTable)(unsafe.Pointer(pTab)).Fp.FpConfig)).FpzErrmsg = (pTab /* &.p */ /* &.base */ + 8 /* &.zErrMsg */)
+ (*Fts5Config)(unsafe.Pointer((*Fts5FullTable)(unsafe.Pointer(pTab)).Fp.FpConfig)).FpzErrmsg = pTab + 8
// Put any active cursors into REQUIRE_SEEK state.
fts5TripCursors(tls, pTab)
eType0 = Xsqlite3_value_type(tls, *(*uintptr)(unsafe.Pointer(apVal)))
- if (eType0 == SQLITE_NULL) &&
- (Xsqlite3_value_type(tls, *(*uintptr)(unsafe.Pointer(apVal + uintptr((2+(*Fts5Config)(unsafe.Pointer(pConfig)).FnCol))*4))) != SQLITE_NULL) {
+ if eType0 == SQLITE_NULL &&
+ Xsqlite3_value_type(tls, *(*uintptr)(unsafe.Pointer(apVal + uintptr(2+(*Fts5Config)(unsafe.Pointer(pConfig)).FnCol)*4))) != SQLITE_NULL {
// A "special" INSERT op. These are handled separately.
- var z uintptr = Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(apVal + uintptr((2+(*Fts5Config)(unsafe.Pointer(pConfig)).FnCol))*4)))
- if ((*Fts5Config)(unsafe.Pointer(pConfig)).FeContent != FTS5_CONTENT_NORMAL) &&
- (0 == Xsqlite3_stricmp(tls, ts+15967 /* "delete" */, z)) {
+ var z uintptr = Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(apVal + uintptr(2+(*Fts5Config)(unsafe.Pointer(pConfig)).FnCol)*4)))
+ if (*Fts5Config)(unsafe.Pointer(pConfig)).FeContent != FTS5_CONTENT_NORMAL &&
+ 0 == Xsqlite3_stricmp(tls, ts+17177, z) {
*(*int32)(unsafe.Pointer(bp + 16 /* rc */)) = fts5SpecialDelete(tls, pTab, apVal)
} else {
- *(*int32)(unsafe.Pointer(bp + 16 /* rc */)) = fts5SpecialInsert(tls, pTab, z, *(*uintptr)(unsafe.Pointer(apVal + uintptr(((2+(*Fts5Config)(unsafe.Pointer(pConfig)).FnCol)+1))*4)))
+ *(*int32)(unsafe.Pointer(bp + 16 /* rc */)) = fts5SpecialInsert(tls, pTab, z, *(*uintptr)(unsafe.Pointer(apVal + uintptr(2+(*Fts5Config)(unsafe.Pointer(pConfig)).FnCol+1)*4)))
}
} else {
// A regular INSERT, UPDATE or DELETE statement. The trick here is that
@@ -185496,14 +188006,14 @@ func fts5UpdateMethod(tls *libc.TLS, pVtab uintptr, nArg int32, apVal uintptr, p
// Filter out attempts to run UPDATE or DELETE on contentless tables.
// This is not suported.
- if (eType0 == SQLITE_INTEGER) && (fts5IsContentless(tls, pTab) != 0) {
+ if eType0 == SQLITE_INTEGER && fts5IsContentless(tls, pTab) != 0 {
(*Fts5FullTable)(unsafe.Pointer(pTab)).Fp.Fbase.FzErrMsg = Xsqlite3_mprintf(tls,
- ts+33927, /* "cannot %s conten..." */
+ ts+35287, /* "cannot %s conten..." */
libc.VaList(bp, func() uintptr {
if nArg > 1 {
- return ts + 18781 /* "UPDATE" */
+ return ts + 20078 /* "UPDATE" */
}
- return ts + 33964 /* "DELETE from" */
+ return ts + 35324 /* "DELETE from" */
}(), (*Fts5Config)(unsafe.Pointer(pConfig)).FzName))
*(*int32)(unsafe.Pointer(bp + 16 /* rc */)) = SQLITE_ERROR
} else if nArg == 1 {
@@ -185512,11 +188022,11 @@ func fts5UpdateMethod(tls *libc.TLS, pVtab uintptr, nArg int32, apVal uintptr, p
} else {
var eType1 int32 = Xsqlite3_value_numeric_type(tls, *(*uintptr)(unsafe.Pointer(apVal + 1*4)))
- if (eType1 != SQLITE_INTEGER) && (eType1 != SQLITE_NULL) {
+ if eType1 != SQLITE_INTEGER && eType1 != SQLITE_NULL {
*(*int32)(unsafe.Pointer(bp + 16 /* rc */)) = SQLITE_MISMATCH
} else if eType0 != SQLITE_INTEGER {
// If this is a REPLACE, first remove the current entry (if any)
- if (eConflict == SQLITE_REPLACE) && (eType1 == SQLITE_INTEGER) {
+ if eConflict == SQLITE_REPLACE && eType1 == SQLITE_INTEGER {
var iNew I64 = Xsqlite3_value_int64(tls, *(*uintptr)(unsafe.Pointer(apVal + 1*4))) // Rowid to delete
*(*int32)(unsafe.Pointer(bp + 16 /* rc */)) = sqlite3Fts5StorageDelete(tls, (*Fts5FullTable)(unsafe.Pointer(pTab)).FpStorage, iNew, uintptr(0))
}
@@ -185524,19 +188034,19 @@ func fts5UpdateMethod(tls *libc.TLS, pVtab uintptr, nArg int32, apVal uintptr, p
} else {
var iOld I64 = Xsqlite3_value_int64(tls, *(*uintptr)(unsafe.Pointer(apVal))) // Old rowid
var iNew I64 = Xsqlite3_value_int64(tls, *(*uintptr)(unsafe.Pointer(apVal + 1*4))) // New rowid
- if (eType1 == SQLITE_INTEGER) && (iOld != iNew) {
+ if eType1 == SQLITE_INTEGER && iOld != iNew {
if eConflict == SQLITE_REPLACE {
*(*int32)(unsafe.Pointer(bp + 16 /* rc */)) = sqlite3Fts5StorageDelete(tls, (*Fts5FullTable)(unsafe.Pointer(pTab)).FpStorage, iOld, uintptr(0))
- if *(*int32)(unsafe.Pointer(bp + 16 /* rc */)) == SQLITE_OK {
+ if *(*int32)(unsafe.Pointer(bp + 16)) == SQLITE_OK {
*(*int32)(unsafe.Pointer(bp + 16 /* rc */)) = sqlite3Fts5StorageDelete(tls, (*Fts5FullTable)(unsafe.Pointer(pTab)).FpStorage, iNew, uintptr(0))
}
fts5StorageInsert(tls, bp+16 /* &rc */, pTab, apVal, pRowid)
} else {
*(*int32)(unsafe.Pointer(bp + 16 /* rc */)) = sqlite3Fts5StorageContentInsert(tls, (*Fts5FullTable)(unsafe.Pointer(pTab)).FpStorage, apVal, pRowid)
- if *(*int32)(unsafe.Pointer(bp + 16 /* rc */)) == SQLITE_OK {
+ if *(*int32)(unsafe.Pointer(bp + 16)) == SQLITE_OK {
*(*int32)(unsafe.Pointer(bp + 16 /* rc */)) = sqlite3Fts5StorageDelete(tls, (*Fts5FullTable)(unsafe.Pointer(pTab)).FpStorage, iOld, uintptr(0))
}
- if *(*int32)(unsafe.Pointer(bp + 16 /* rc */)) == SQLITE_OK {
+ if *(*int32)(unsafe.Pointer(bp + 16)) == SQLITE_OK {
*(*int32)(unsafe.Pointer(bp + 16 /* rc */)) = sqlite3Fts5StorageIndexInsert(tls, (*Fts5FullTable)(unsafe.Pointer(pTab)).FpStorage, apVal, *(*Sqlite_int64)(unsafe.Pointer(pRowid)))
}
}
@@ -185553,11 +188063,11 @@ func fts5UpdateMethod(tls *libc.TLS, pVtab uintptr, nArg int32, apVal uintptr, p
}
// Implementation of xSync() method.
-func fts5SyncMethod(tls *libc.TLS, pVtab uintptr) int32 { /* sqlite3.c:229531:12: */
+func fts5SyncMethod(tls *libc.TLS, pVtab uintptr) int32 { /* sqlite3.c:231438:12: */
var rc int32
var pTab uintptr = pVtab
- (*Fts5Config)(unsafe.Pointer((*Fts5FullTable)(unsafe.Pointer(pTab)).Fp.FpConfig)).FpzErrmsg = (pTab /* &.p */ /* &.base */ + 8 /* &.zErrMsg */)
+ (*Fts5Config)(unsafe.Pointer((*Fts5FullTable)(unsafe.Pointer(pTab)).Fp.FpConfig)).FpzErrmsg = pTab + 8
fts5TripCursors(tls, pTab)
rc = sqlite3Fts5StorageSync(tls, (*Fts5FullTable)(unsafe.Pointer(pTab)).FpStorage)
(*Fts5Config)(unsafe.Pointer((*Fts5FullTable)(unsafe.Pointer(pTab)).Fp.FpConfig)).FpzErrmsg = uintptr(0)
@@ -185565,7 +188075,7 @@ func fts5SyncMethod(tls *libc.TLS, pVtab uintptr) int32 { /* sqlite3.c:229531:12
}
// Implementation of xBegin() method.
-func fts5BeginMethod(tls *libc.TLS, pVtab uintptr) int32 { /* sqlite3.c:229545:12: */
+func fts5BeginMethod(tls *libc.TLS, pVtab uintptr) int32 { /* sqlite3.c:231452:12: */
fts5NewTransaction(tls, pVtab)
return SQLITE_OK
@@ -185574,7 +188084,7 @@ func fts5BeginMethod(tls *libc.TLS, pVtab uintptr) int32 { /* sqlite3.c:229545:1
// Implementation of xCommit() method. This is a no-op. The contents of
// the pending-terms hash-table have already been flushed into the database
// by fts5SyncMethod().
-func fts5CommitMethod(tls *libc.TLS, pVtab uintptr) int32 { /* sqlite3.c:229556:12: */
+func fts5CommitMethod(tls *libc.TLS, pVtab uintptr) int32 { /* sqlite3.c:231463:12: */
_ = pVtab // Call below is a no-op for NDEBUG builds
return SQLITE_OK
@@ -185582,7 +188092,7 @@ func fts5CommitMethod(tls *libc.TLS, pVtab uintptr) int32 { /* sqlite3.c:229556:
// Implementation of xRollback(). Discard the contents of the pending-terms
// hash-table. Any changes made to the database are reverted by SQLite.
-func fts5RollbackMethod(tls *libc.TLS, pVtab uintptr) int32 { /* sqlite3.c:229566:12: */
+func fts5RollbackMethod(tls *libc.TLS, pVtab uintptr) int32 { /* sqlite3.c:231473:12: */
var rc int32
var pTab uintptr = pVtab
@@ -185590,71 +188100,71 @@ func fts5RollbackMethod(tls *libc.TLS, pVtab uintptr) int32 { /* sqlite3.c:22956
return rc
}
-func fts5ApiUserData(tls *libc.TLS, pCtx uintptr) uintptr { /* sqlite3.c:229576:13: */
+func fts5ApiUserData(tls *libc.TLS, pCtx uintptr) uintptr { /* sqlite3.c:231483:13: */
var pCsr uintptr = pCtx
return (*Fts5Auxiliary)(unsafe.Pointer((*Fts5Cursor)(unsafe.Pointer(pCsr)).FpAux)).FpUserData
}
-func fts5ApiColumnCount(tls *libc.TLS, pCtx uintptr) int32 { /* sqlite3.c:229581:12: */
+func fts5ApiColumnCount(tls *libc.TLS, pCtx uintptr) int32 { /* sqlite3.c:231488:12: */
var pCsr uintptr = pCtx
return (*Fts5Config)(unsafe.Pointer((*Fts5Table)(unsafe.Pointer((*Fts5Cursor)(unsafe.Pointer(pCsr)).Fbase.FpVtab)).FpConfig)).FnCol
}
-func fts5ApiColumnTotalSize(tls *libc.TLS, pCtx uintptr, iCol int32, pnToken uintptr) int32 { /* sqlite3.c:229586:12: */
+func fts5ApiColumnTotalSize(tls *libc.TLS, pCtx uintptr, iCol int32, pnToken uintptr) int32 { /* sqlite3.c:231493:12: */
var pCsr uintptr = pCtx
var pTab uintptr = (*Fts5Cursor)(unsafe.Pointer(pCsr)).Fbase.FpVtab
return sqlite3Fts5StorageSize(tls, (*Fts5FullTable)(unsafe.Pointer(pTab)).FpStorage, iCol, pnToken)
}
-func fts5ApiRowCount(tls *libc.TLS, pCtx uintptr, pnRow uintptr) int32 { /* sqlite3.c:229596:12: */
+func fts5ApiRowCount(tls *libc.TLS, pCtx uintptr, pnRow uintptr) int32 { /* sqlite3.c:231503:12: */
var pCsr uintptr = pCtx
var pTab uintptr = (*Fts5Cursor)(unsafe.Pointer(pCsr)).Fbase.FpVtab
return sqlite3Fts5StorageRowCount(tls, (*Fts5FullTable)(unsafe.Pointer(pTab)).FpStorage, pnRow)
}
-func fts5ApiTokenize(tls *libc.TLS, pCtx uintptr, pText uintptr, nText int32, pUserData uintptr, xToken uintptr) int32 { /* sqlite3.c:229602:12: */
+func fts5ApiTokenize(tls *libc.TLS, pCtx uintptr, pText uintptr, nText int32, pUserData uintptr, xToken uintptr) int32 { /* sqlite3.c:231509:12: */
var pCsr uintptr = pCtx
var pTab uintptr = (*Fts5Cursor)(unsafe.Pointer(pCsr)).Fbase.FpVtab
return sqlite3Fts5Tokenize(tls,
(*Fts5Table)(unsafe.Pointer(pTab)).FpConfig, FTS5_TOKENIZE_AUX, pText, nText, pUserData, xToken)
}
-func fts5ApiPhraseCount(tls *libc.TLS, pCtx uintptr) int32 { /* sqlite3.c:229615:12: */
+func fts5ApiPhraseCount(tls *libc.TLS, pCtx uintptr) int32 { /* sqlite3.c:231522:12: */
var pCsr uintptr = pCtx
return sqlite3Fts5ExprPhraseCount(tls, (*Fts5Cursor)(unsafe.Pointer(pCsr)).FpExpr)
}
-func fts5ApiPhraseSize(tls *libc.TLS, pCtx uintptr, iPhrase int32) int32 { /* sqlite3.c:229620:12: */
+func fts5ApiPhraseSize(tls *libc.TLS, pCtx uintptr, iPhrase int32) int32 { /* sqlite3.c:231527:12: */
var pCsr uintptr = pCtx
return sqlite3Fts5ExprPhraseSize(tls, (*Fts5Cursor)(unsafe.Pointer(pCsr)).FpExpr, iPhrase)
}
-func fts5ApiColumnText(tls *libc.TLS, pCtx uintptr, iCol int32, pz uintptr, pn uintptr) int32 { /* sqlite3.c:229625:12: */
+func fts5ApiColumnText(tls *libc.TLS, pCtx uintptr, iCol int32, pz uintptr, pn uintptr) int32 { /* sqlite3.c:231532:12: */
var rc int32 = SQLITE_OK
var pCsr uintptr = pCtx
- if (fts5IsContentless(tls, (*Fts5Cursor)(unsafe.Pointer(pCsr)).Fbase.FpVtab) != 0) ||
- ((*Fts5Cursor)(unsafe.Pointer(pCsr)).FePlan == FTS5_PLAN_SPECIAL) {
+ if fts5IsContentless(tls, (*Fts5Cursor)(unsafe.Pointer(pCsr)).Fbase.FpVtab) != 0 ||
+ (*Fts5Cursor)(unsafe.Pointer(pCsr)).FePlan == FTS5_PLAN_SPECIAL {
*(*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, (*Fts5Cursor)(unsafe.Pointer(pCsr)).FpStmt, (iCol + 1))
- *(*int32)(unsafe.Pointer(pn)) = Xsqlite3_column_bytes(tls, (*Fts5Cursor)(unsafe.Pointer(pCsr)).FpStmt, (iCol + 1))
+ *(*uintptr)(unsafe.Pointer(pz)) = Xsqlite3_column_text(tls, (*Fts5Cursor)(unsafe.Pointer(pCsr)).FpStmt, iCol+1)
+ *(*int32)(unsafe.Pointer(pn)) = Xsqlite3_column_bytes(tls, (*Fts5Cursor)(unsafe.Pointer(pCsr)).FpStmt, iCol+1)
}
}
return rc
}
-func fts5CsrPoslist(tls *libc.TLS, pCsr uintptr, iPhrase int32, pa uintptr, pn uintptr) int32 { /* sqlite3.c:229648:12: */
+func fts5CsrPoslist(tls *libc.TLS, pCsr uintptr, iPhrase int32, pa uintptr, pn uintptr) int32 { /* sqlite3.c:231555:12: */
bp := tls.Alloc(8)
defer tls.Free(8)
var pConfig uintptr = (*Fts5Table)(unsafe.Pointer((*Fts5Cursor)(unsafe.Pointer(pCsr)).Fbase.FpVtab)).FpConfig
var rc int32 = SQLITE_OK
- var bLive int32 = (libc.Bool32((*Fts5Cursor)(unsafe.Pointer(pCsr)).FpSorter == uintptr(0)))
+ var bLive int32 = libc.Bool32((*Fts5Cursor)(unsafe.Pointer(pCsr)).FpSorter == uintptr(0))
- if ((*Fts5Cursor)(unsafe.Pointer((pCsr))).Fcsrflags & (FTS5CSR_REQUIRE_POSLIST)) != 0 {
+ if (*Fts5Cursor)(unsafe.Pointer(pCsr)).Fcsrflags&FTS5CSR_REQUIRE_POSLIST != 0 {
if (*Fts5Config)(unsafe.Pointer(pConfig)).FeDetail != FTS5_DETAIL_FULL {
var aPopulator uintptr
@@ -185663,7 +188173,7 @@ func fts5CsrPoslist(tls *libc.TLS, pCsr uintptr, iPhrase int32, pa uintptr, pn u
if aPopulator == uintptr(0) {
rc = SQLITE_NOMEM
}
- for i = 0; (i < (*Fts5Config)(unsafe.Pointer(pConfig)).FnCol) && (rc == SQLITE_OK); i++ {
+ for i = 0; i < (*Fts5Config)(unsafe.Pointer(pConfig)).FnCol && rc == SQLITE_OK; i++ {
// var n int32 at bp+4, 4
// var z uintptr at bp, 4
@@ -185680,19 +188190,19 @@ func fts5CsrPoslist(tls *libc.TLS, pCsr uintptr, iPhrase int32, pa uintptr, pn u
sqlite3Fts5ExprCheckPoslists(tls, (*Fts5Cursor)(unsafe.Pointer(pCsr)).FpExpr, (*Fts5Sorter)(unsafe.Pointer((*Fts5Cursor)(unsafe.Pointer(pCsr)).FpSorter)).FiRowid)
}
}
- *(*int32)(unsafe.Pointer(pCsr + 60 /* &.csrflags */)) &= (libc.CplInt32(FTS5CSR_REQUIRE_POSLIST))
+ *(*int32)(unsafe.Pointer(pCsr + 60)) &= libc.CplInt32(FTS5CSR_REQUIRE_POSLIST)
}
- if ((*Fts5Cursor)(unsafe.Pointer(pCsr)).FpSorter != 0) && ((*Fts5Config)(unsafe.Pointer(pConfig)).FeDetail == FTS5_DETAIL_FULL) {
+ if (*Fts5Cursor)(unsafe.Pointer(pCsr)).FpSorter != 0 && (*Fts5Config)(unsafe.Pointer(pConfig)).FeDetail == FTS5_DETAIL_FULL {
var pSorter uintptr = (*Fts5Cursor)(unsafe.Pointer(pCsr)).FpSorter
var i1 int32 = func() int32 {
if iPhrase == 0 {
return 0
}
- return *(*int32)(unsafe.Pointer((pSorter + 24 /* &.aIdx */) + uintptr((iPhrase-1))*4))
+ return *(*int32)(unsafe.Pointer(pSorter + 24 + uintptr(iPhrase-1)*4))
}()
- *(*int32)(unsafe.Pointer(pn)) = (*(*int32)(unsafe.Pointer((pSorter + 24 /* &.aIdx */) + uintptr(iPhrase)*4)) - i1)
- *(*uintptr)(unsafe.Pointer(pa)) = ((*Fts5Sorter)(unsafe.Pointer(pSorter)).FaPoslist + uintptr(i1))
+ *(*int32)(unsafe.Pointer(pn)) = *(*int32)(unsafe.Pointer(pSorter + 24 + uintptr(iPhrase)*4)) - i1
+ *(*uintptr)(unsafe.Pointer(pa)) = (*Fts5Sorter)(unsafe.Pointer(pSorter)).FaPoslist + uintptr(i1)
} else {
*(*int32)(unsafe.Pointer(pn)) = sqlite3Fts5ExprPoslist(tls, (*Fts5Cursor)(unsafe.Pointer(pCsr)).FpExpr, iPhrase, pa)
}
@@ -185703,7 +188213,7 @@ func fts5CsrPoslist(tls *libc.TLS, pCsr uintptr, iPhrase int32, pa uintptr, pn u
// Ensure that the Fts5Cursor.nInstCount and aInst[] variables are populated
// correctly for the current view. Return SQLITE_OK if successful, or an
// SQLite error code otherwise.
-func fts5CacheInstArray(tls *libc.TLS, pCsr uintptr) int32 { /* sqlite3.c:229700:12: */
+func fts5CacheInstArray(tls *libc.TLS, pCsr uintptr) int32 { /* sqlite3.c:231607:12: */
bp := tls.Alloc(12)
defer tls.Free(12)
@@ -185714,7 +188224,7 @@ func fts5CacheInstArray(tls *libc.TLS, pCsr uintptr) int32 { /* sqlite3.c:229700
nIter = sqlite3Fts5ExprPhraseCount(tls, (*Fts5Cursor)(unsafe.Pointer(pCsr)).FpExpr)
if (*Fts5Cursor)(unsafe.Pointer(pCsr)).FaInstIter == uintptr(0) {
- var nByte Sqlite3_int64 = (Sqlite3_int64(uint32(unsafe.Sizeof(Fts5PoslistReader{})) * uint32(nIter)))
+ var nByte Sqlite3_int64 = Sqlite3_int64(uint32(unsafe.Sizeof(Fts5PoslistReader{})) * uint32(nIter))
(*Fts5Cursor)(unsafe.Pointer(pCsr)).FaInstIter = sqlite3Fts5MallocZero(tls, bp /* &rc */, nByte)
}
aIter = (*Fts5Cursor)(unsafe.Pointer(pCsr)).FaInstIter
@@ -185724,24 +188234,24 @@ func fts5CacheInstArray(tls *libc.TLS, pCsr uintptr) int32 { /* sqlite3.c:229700
var i int32
// Initialize all iterators
- for i = 0; (i < nIter) && (*(*int32)(unsafe.Pointer(bp /* rc */)) == SQLITE_OK); i++ {
+ for i = 0; i < nIter && *(*int32)(unsafe.Pointer(bp /* rc */)) == SQLITE_OK; i++ {
// var a uintptr at bp+4, 4
// var n int32 at bp+8, 4
*(*int32)(unsafe.Pointer(bp /* rc */)) = fts5CsrPoslist(tls, pCsr, i, bp+4 /* &a */, bp+8 /* &n */)
- if *(*int32)(unsafe.Pointer(bp /* rc */)) == SQLITE_OK {
- sqlite3Fts5PoslistReaderInit(tls, *(*uintptr)(unsafe.Pointer(bp + 4 /* a */)), *(*int32)(unsafe.Pointer(bp + 8 /* n */)), (aIter + uintptr(i)*24))
+ if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK {
+ sqlite3Fts5PoslistReaderInit(tls, *(*uintptr)(unsafe.Pointer(bp + 4 /* a */)), *(*int32)(unsafe.Pointer(bp + 8 /* n */)), aIter+uintptr(i)*24)
}
}
- if *(*int32)(unsafe.Pointer(bp /* rc */)) == SQLITE_OK {
+ if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK {
for 1 != 0 {
var aInst uintptr
var iBest int32 = -1
for i = 0; i < nIter; i++ {
- if (int32((*Fts5PoslistReader)(unsafe.Pointer(aIter+uintptr(i)*24)).FbEof) == 0) &&
- ((iBest < 0) || ((*Fts5PoslistReader)(unsafe.Pointer(aIter+uintptr(i)*24)).FiPos < (*Fts5PoslistReader)(unsafe.Pointer(aIter+uintptr(iBest)*24)).FiPos)) {
+ if int32((*Fts5PoslistReader)(unsafe.Pointer(aIter+uintptr(i)*24)).FbEof) == 0 &&
+ (iBest < 0 || (*Fts5PoslistReader)(unsafe.Pointer(aIter+uintptr(i)*24)).FiPos < (*Fts5PoslistReader)(unsafe.Pointer(aIter+uintptr(iBest)*24)).FiPos) {
iBest = i
}
}
@@ -185753,12 +188263,12 @@ func fts5CacheInstArray(tls *libc.TLS, pCsr uintptr) int32 { /* sqlite3.c:229700
if nInst >= (*Fts5Cursor)(unsafe.Pointer(pCsr)).FnInstAlloc {
var nNewSize int32
if (*Fts5Cursor)(unsafe.Pointer(pCsr)).FnInstAlloc != 0 {
- nNewSize = ((*Fts5Cursor)(unsafe.Pointer(pCsr)).FnInstAlloc * 2)
+ nNewSize = (*Fts5Cursor)(unsafe.Pointer(pCsr)).FnInstAlloc * 2
} else {
nNewSize = 32
}
aInst = Xsqlite3_realloc64(tls,
- (*Fts5Cursor)(unsafe.Pointer(pCsr)).FaInst, (uint64((uint32(nNewSize) * uint32(unsafe.Sizeof(int32(0)))) * uint32(3))))
+ (*Fts5Cursor)(unsafe.Pointer(pCsr)).FaInst, uint64(uint32(nNewSize)*uint32(unsafe.Sizeof(int32(0)))*uint32(3)))
if aInst != 0 {
(*Fts5Cursor)(unsafe.Pointer(pCsr)).FaInst = aInst
(*Fts5Cursor)(unsafe.Pointer(pCsr)).FnInstAlloc = nNewSize
@@ -185769,67 +188279,67 @@ func fts5CacheInstArray(tls *libc.TLS, pCsr uintptr) int32 { /* sqlite3.c:229700
}
}
- aInst = ((*Fts5Cursor)(unsafe.Pointer(pCsr)).FaInst + uintptr((3*(nInst-1)))*4)
+ aInst = (*Fts5Cursor)(unsafe.Pointer(pCsr)).FaInst + uintptr(3*(nInst-1))*4
*(*int32)(unsafe.Pointer(aInst)) = iBest
- *(*int32)(unsafe.Pointer(aInst + 1*4)) = (int32((*Fts5PoslistReader)(unsafe.Pointer(aIter+uintptr(iBest)*24)).FiPos >> 32))
- *(*int32)(unsafe.Pointer(aInst + 2*4)) = (int32((*Fts5PoslistReader)(unsafe.Pointer(aIter+uintptr(iBest)*24)).FiPos & int64(0x7FFFFFFF)))
- if (*(*int32)(unsafe.Pointer(aInst + 1*4)) < 0) || (*(*int32)(unsafe.Pointer(aInst + 1*4)) >= nCol) {
- *(*int32)(unsafe.Pointer(bp /* rc */)) = (SQLITE_CORRUPT | (int32(1) << 8))
+ *(*int32)(unsafe.Pointer(aInst + 1*4)) = int32((*Fts5PoslistReader)(unsafe.Pointer(aIter+uintptr(iBest)*24)).FiPos >> 32)
+ *(*int32)(unsafe.Pointer(aInst + 2*4)) = int32((*Fts5PoslistReader)(unsafe.Pointer(aIter+uintptr(iBest)*24)).FiPos & int64(0x7FFFFFFF))
+ if *(*int32)(unsafe.Pointer(aInst + 1*4)) < 0 || *(*int32)(unsafe.Pointer(aInst + 1*4)) >= nCol {
+ *(*int32)(unsafe.Pointer(bp /* rc */)) = SQLITE_CORRUPT | int32(1)<<8
break
}
- sqlite3Fts5PoslistReaderNext(tls, (aIter + uintptr(iBest)*24))
+ sqlite3Fts5PoslistReaderNext(tls, aIter+uintptr(iBest)*24)
}
}
(*Fts5Cursor)(unsafe.Pointer(pCsr)).FnInstCount = nInst
- *(*int32)(unsafe.Pointer(pCsr + 60 /* &.csrflags */)) &= (libc.CplInt32(FTS5CSR_REQUIRE_INST))
+ *(*int32)(unsafe.Pointer(pCsr + 60)) &= libc.CplInt32(FTS5CSR_REQUIRE_INST)
}
return *(*int32)(unsafe.Pointer(bp /* rc */))
}
-func fts5ApiInstCount(tls *libc.TLS, pCtx uintptr, pnInst uintptr) int32 { /* sqlite3.c:229774:12: */
+func fts5ApiInstCount(tls *libc.TLS, pCtx uintptr, pnInst uintptr) int32 { /* sqlite3.c:231681:12: */
var pCsr uintptr = pCtx
var rc int32 = SQLITE_OK
- if (((*Fts5Cursor)(unsafe.Pointer((pCsr))).Fcsrflags & (FTS5CSR_REQUIRE_INST)) == 0) ||
- (SQLITE_OK == (libc.AssignInt32(&rc, fts5CacheInstArray(tls, pCsr)))) {
+ if (*Fts5Cursor)(unsafe.Pointer(pCsr)).Fcsrflags&FTS5CSR_REQUIRE_INST == 0 ||
+ SQLITE_OK == libc.AssignInt32(&rc, fts5CacheInstArray(tls, pCsr)) {
*(*int32)(unsafe.Pointer(pnInst)) = (*Fts5Cursor)(unsafe.Pointer(pCsr)).FnInstCount
}
return rc
}
-func fts5ApiInst(tls *libc.TLS, pCtx uintptr, iIdx int32, piPhrase uintptr, piCol uintptr, piOff uintptr) int32 { /* sqlite3.c:229784:12: */
+func fts5ApiInst(tls *libc.TLS, pCtx uintptr, iIdx int32, piPhrase uintptr, piCol uintptr, piOff uintptr) int32 { /* sqlite3.c:231691:12: */
var pCsr uintptr = pCtx
var rc int32 = SQLITE_OK
- if (((*Fts5Cursor)(unsafe.Pointer((pCsr))).Fcsrflags & (FTS5CSR_REQUIRE_INST)) == 0) ||
- (SQLITE_OK == (libc.AssignInt32(&rc, fts5CacheInstArray(tls, pCsr)))) {
- if (iIdx < 0) || (iIdx >= (*Fts5Cursor)(unsafe.Pointer(pCsr)).FnInstCount) {
+ if (*Fts5Cursor)(unsafe.Pointer(pCsr)).Fcsrflags&FTS5CSR_REQUIRE_INST == 0 ||
+ SQLITE_OK == libc.AssignInt32(&rc, fts5CacheInstArray(tls, pCsr)) {
+ if iIdx < 0 || iIdx >= (*Fts5Cursor)(unsafe.Pointer(pCsr)).FnInstCount {
rc = SQLITE_RANGE
} else {
- *(*int32)(unsafe.Pointer(piPhrase)) = *(*int32)(unsafe.Pointer((*Fts5Cursor)(unsafe.Pointer(pCsr)).FaInst + uintptr((iIdx*3))*4))
- *(*int32)(unsafe.Pointer(piCol)) = *(*int32)(unsafe.Pointer((*Fts5Cursor)(unsafe.Pointer(pCsr)).FaInst + uintptr(((iIdx*3)+1))*4))
- *(*int32)(unsafe.Pointer(piOff)) = *(*int32)(unsafe.Pointer((*Fts5Cursor)(unsafe.Pointer(pCsr)).FaInst + uintptr(((iIdx*3)+2))*4))
+ *(*int32)(unsafe.Pointer(piPhrase)) = *(*int32)(unsafe.Pointer((*Fts5Cursor)(unsafe.Pointer(pCsr)).FaInst + uintptr(iIdx*3)*4))
+ *(*int32)(unsafe.Pointer(piCol)) = *(*int32)(unsafe.Pointer((*Fts5Cursor)(unsafe.Pointer(pCsr)).FaInst + uintptr(iIdx*3+1)*4))
+ *(*int32)(unsafe.Pointer(piOff)) = *(*int32)(unsafe.Pointer((*Fts5Cursor)(unsafe.Pointer(pCsr)).FaInst + uintptr(iIdx*3+2)*4))
}
}
return rc
}
-func fts5ApiRowid(tls *libc.TLS, pCtx uintptr) Sqlite3_int64 { /* sqlite3.c:229813:22: */
+func fts5ApiRowid(tls *libc.TLS, pCtx uintptr) Sqlite3_int64 { /* sqlite3.c:231720:22: */
return fts5CursorRowid(tls, pCtx)
}
-func fts5ColumnSizeCb(tls *libc.TLS, pContext uintptr, tflags int32, pUnused uintptr, nUnused int32, iUnused1 int32, iUnused2 int32) int32 { /* sqlite3.c:229817:12: */
+func fts5ColumnSizeCb(tls *libc.TLS, pContext uintptr, tflags int32, pUnused uintptr, nUnused int32, iUnused1 int32, iUnused2 int32) int32 { /* sqlite3.c:231724:12: */
var pCnt uintptr = pContext
_ = pUnused
_ = nUnused
_ = iUnused1
_ = iUnused2
- if (tflags & FTS5_TOKEN_COLOCATED) == 0 {
- (*(*int32)(unsafe.Pointer(pCnt)))++
+ if tflags&FTS5_TOKEN_COLOCATED == 0 {
+ *(*int32)(unsafe.Pointer(pCnt))++
}
return SQLITE_OK
}
-func fts5ApiColumnSize(tls *libc.TLS, pCtx uintptr, iCol int32, pnToken uintptr) int32 { /* sqlite3.c:229834:12: */
+func fts5ApiColumnSize(tls *libc.TLS, pCtx uintptr, iCol int32, pnToken uintptr) int32 { /* sqlite3.c:231741:12: */
bp := tls.Alloc(8)
defer tls.Free(8)
@@ -185838,7 +188348,7 @@ func fts5ApiColumnSize(tls *libc.TLS, pCtx uintptr, iCol int32, pnToken uintptr)
var pConfig uintptr = (*Fts5FullTable)(unsafe.Pointer(pTab)).Fp.FpConfig
var rc int32 = SQLITE_OK
- if ((*Fts5Cursor)(unsafe.Pointer((pCsr))).Fcsrflags & (FTS5CSR_REQUIRE_DOCSIZE)) != 0 {
+ if (*Fts5Cursor)(unsafe.Pointer(pCsr)).Fcsrflags&FTS5CSR_REQUIRE_DOCSIZE != 0 {
if (*Fts5Config)(unsafe.Pointer(pConfig)).FbColumnsize != 0 {
var iRowid I64 = fts5CursorRowid(tls, pCsr)
rc = sqlite3Fts5StorageDocsize(tls, (*Fts5FullTable)(unsafe.Pointer(pTab)).FpStorage, iRowid, (*Fts5Cursor)(unsafe.Pointer(pCsr)).FaColumnSize)
@@ -185851,13 +188361,13 @@ func fts5ApiColumnSize(tls *libc.TLS, pCtx uintptr, iCol int32, pnToken uintptr)
}
} else {
var i int32
- for i = 0; (rc == SQLITE_OK) && (i < (*Fts5Config)(unsafe.Pointer(pConfig)).FnCol); i++ {
+ for i = 0; rc == SQLITE_OK && i < (*Fts5Config)(unsafe.Pointer(pConfig)).FnCol; i++ {
if int32(*(*U8)(unsafe.Pointer((*Fts5Config)(unsafe.Pointer(pConfig)).FabUnindexed + uintptr(i)))) == 0 {
// var z uintptr at bp, 4
// var n int32 at bp+4, 4
- var p uintptr = ((*Fts5Cursor)(unsafe.Pointer(pCsr)).FaColumnSize + uintptr(i)*4)
+ var p uintptr = (*Fts5Cursor)(unsafe.Pointer(pCsr)).FaColumnSize + uintptr(i)*4
*(*int32)(unsafe.Pointer((*Fts5Cursor)(unsafe.Pointer(pCsr)).FaColumnSize + uintptr(i)*4)) = 0
rc = fts5ApiColumnText(tls, pCtx, i, bp /* &z */, bp+4 /* &n */)
if rc == SQLITE_OK {
@@ -185869,13 +188379,13 @@ func fts5ApiColumnSize(tls *libc.TLS, pCtx uintptr, iCol int32, pnToken uintptr)
}
}
}
- *(*int32)(unsafe.Pointer(pCsr + 60 /* &.csrflags */)) &= (libc.CplInt32(FTS5CSR_REQUIRE_DOCSIZE))
+ *(*int32)(unsafe.Pointer(pCsr + 60)) &= libc.CplInt32(FTS5CSR_REQUIRE_DOCSIZE)
}
if iCol < 0 {
var i int32
*(*int32)(unsafe.Pointer(pnToken)) = 0
for i = 0; i < (*Fts5Config)(unsafe.Pointer(pConfig)).FnCol; i++ {
- *(*int32)(unsafe.Pointer(pnToken)) += (*(*int32)(unsafe.Pointer((*Fts5Cursor)(unsafe.Pointer(pCsr)).FaColumnSize + uintptr(i)*4)))
+ *(*int32)(unsafe.Pointer(pnToken)) += *(*int32)(unsafe.Pointer((*Fts5Cursor)(unsafe.Pointer(pCsr)).FaColumnSize + uintptr(i)*4))
}
} else if iCol < (*Fts5Config)(unsafe.Pointer(pConfig)).FnCol {
*(*int32)(unsafe.Pointer(pnToken)) = *(*int32)(unsafe.Pointer((*Fts5Cursor)(unsafe.Pointer(pCsr)).FaColumnSize + uintptr(iCol)*4))
@@ -185887,7 +188397,7 @@ func fts5ApiColumnSize(tls *libc.TLS, pCtx uintptr, iCol int32, pnToken uintptr)
}
// Implementation of the xSetAuxdata() method.
-func fts5ApiSetAuxdata(tls *libc.TLS, pCtx uintptr, pPtr uintptr, xDelete uintptr) int32 { /* sqlite3.c:229887:12: */
+func fts5ApiSetAuxdata(tls *libc.TLS, pCtx uintptr, pPtr uintptr, xDelete uintptr) int32 { /* sqlite3.c:231794:12: */
bp := tls.Alloc(4)
defer tls.Free(4)
@@ -185925,7 +188435,7 @@ func fts5ApiSetAuxdata(tls *libc.TLS, pCtx uintptr, pPtr uintptr, xDelete uintpt
return SQLITE_OK
}
-func fts5ApiGetAuxdata(tls *libc.TLS, pCtx uintptr, bClear int32) uintptr { /* sqlite3.c:229922:13: */
+func fts5ApiGetAuxdata(tls *libc.TLS, pCtx uintptr, bClear int32) uintptr { /* sqlite3.c:231829:13: */
var pCsr uintptr = pCtx
var pData uintptr
var pRet uintptr = uintptr(0)
@@ -185947,7 +188457,7 @@ func fts5ApiGetAuxdata(tls *libc.TLS, pCtx uintptr, bClear int32) uintptr { /* s
return pRet
}
-func fts5ApiPhraseNext(tls *libc.TLS, pUnused uintptr, pIter uintptr, piCol uintptr, piOff uintptr) { /* sqlite3.c:229942:13: */
+func fts5ApiPhraseNext(tls *libc.TLS, pUnused uintptr, pIter uintptr, piCol uintptr, piOff uintptr) { /* sqlite3.c:231849:13: */
bp := tls.Alloc(4)
defer tls.Free(4)
@@ -185958,30 +188468,30 @@ func fts5ApiPhraseNext(tls *libc.TLS, pUnused uintptr, pIter uintptr, piCol uint
} else {
// var iVal int32 at bp, 4
- *(*uintptr)(unsafe.Pointer(pIter /* &.a */)) += (uintptr(sqlite3Fts5GetVarint32(tls, (*Fts5PhraseIter)(unsafe.Pointer(pIter)).Fa, bp /* &iVal */)))
- if *(*int32)(unsafe.Pointer(bp /* iVal */)) == 1 {
- *(*uintptr)(unsafe.Pointer(pIter /* &.a */)) += (uintptr(sqlite3Fts5GetVarint32(tls, (*Fts5PhraseIter)(unsafe.Pointer(pIter)).Fa, bp /* &iVal */)))
+ *(*uintptr)(unsafe.Pointer(pIter)) += uintptr(sqlite3Fts5GetVarint32(tls, (*Fts5PhraseIter)(unsafe.Pointer(pIter)).Fa, bp))
+ if *(*int32)(unsafe.Pointer(bp)) == 1 {
+ *(*uintptr)(unsafe.Pointer(pIter)) += uintptr(sqlite3Fts5GetVarint32(tls, (*Fts5PhraseIter)(unsafe.Pointer(pIter)).Fa, bp))
*(*int32)(unsafe.Pointer(piCol)) = *(*int32)(unsafe.Pointer(bp /* iVal */))
*(*int32)(unsafe.Pointer(piOff)) = 0
- *(*uintptr)(unsafe.Pointer(pIter /* &.a */)) += (uintptr(sqlite3Fts5GetVarint32(tls, (*Fts5PhraseIter)(unsafe.Pointer(pIter)).Fa, bp /* &iVal */)))
+ *(*uintptr)(unsafe.Pointer(pIter)) += uintptr(sqlite3Fts5GetVarint32(tls, (*Fts5PhraseIter)(unsafe.Pointer(pIter)).Fa, bp))
}
- *(*int32)(unsafe.Pointer(piOff)) += (*(*int32)(unsafe.Pointer(bp /* iVal */)) - 2)
+ *(*int32)(unsafe.Pointer(piOff)) += *(*int32)(unsafe.Pointer(bp)) - 2
}
}
-func fts5ApiPhraseFirst(tls *libc.TLS, pCtx uintptr, iPhrase int32, pIter uintptr, piCol uintptr, piOff uintptr) int32 { /* sqlite3.c:229964:12: */
+func fts5ApiPhraseFirst(tls *libc.TLS, pCtx uintptr, iPhrase int32, pIter uintptr, piCol uintptr, piOff uintptr) int32 { /* sqlite3.c:231871:12: */
bp := tls.Alloc(4)
defer tls.Free(4)
var pCsr uintptr = pCtx
// var n int32 at bp, 4
- var rc int32 = fts5CsrPoslist(tls, pCsr, iPhrase, (pIter /* &.a */), bp /* &n */)
+ var rc int32 = fts5CsrPoslist(tls, pCsr, iPhrase, pIter, bp /* &n */)
if rc == SQLITE_OK {
(*Fts5PhraseIter)(unsafe.Pointer(pIter)).Fb = func() uintptr {
if (*Fts5PhraseIter)(unsafe.Pointer(pIter)).Fa != 0 {
- return ((*Fts5PhraseIter)(unsafe.Pointer(pIter)).Fa + uintptr(*(*int32)(unsafe.Pointer(bp /* n */))))
+ return (*Fts5PhraseIter)(unsafe.Pointer(pIter)).Fa + uintptr(*(*int32)(unsafe.Pointer(bp)))
}
return uintptr(0)
}()
@@ -185992,7 +188502,7 @@ func fts5ApiPhraseFirst(tls *libc.TLS, pCtx uintptr, iPhrase int32, pIter uintpt
return rc
}
-func fts5ApiPhraseNextColumn(tls *libc.TLS, pCtx uintptr, pIter uintptr, piCol uintptr) { /* sqlite3.c:229983:13: */
+func fts5ApiPhraseNextColumn(tls *libc.TLS, pCtx uintptr, pIter uintptr, piCol uintptr) { /* sqlite3.c:231890:13: */
bp := tls.Alloc(8)
defer tls.Free(8)
@@ -186005,8 +188515,8 @@ func fts5ApiPhraseNextColumn(tls *libc.TLS, pCtx uintptr, pIter uintptr, piCol u
} else {
// var iIncr int32 at bp, 4
- *(*uintptr)(unsafe.Pointer(pIter /* &.a */)) += (uintptr(sqlite3Fts5GetVarint32(tls, ((*Fts5PhraseIter)(unsafe.Pointer(pIter)).Fa), bp /* &iIncr */)))
- *(*int32)(unsafe.Pointer(piCol)) += (*(*int32)(unsafe.Pointer(bp /* iIncr */)) - 2)
+ *(*uintptr)(unsafe.Pointer(pIter)) += uintptr(sqlite3Fts5GetVarint32(tls, (*Fts5PhraseIter)(unsafe.Pointer(pIter)).Fa, bp))
+ *(*int32)(unsafe.Pointer(piCol)) += *(*int32)(unsafe.Pointer(bp)) - 2
}
} else {
for 1 != 0 {
@@ -186019,13 +188529,13 @@ func fts5ApiPhraseNextColumn(tls *libc.TLS, pCtx uintptr, pIter uintptr, piCol u
if int32(*(*uint8)(unsafe.Pointer((*Fts5PhraseIter)(unsafe.Pointer(pIter)).Fa))) == 0x01 {
break
}
- *(*uintptr)(unsafe.Pointer(pIter /* &.a */)) += (uintptr(sqlite3Fts5GetVarint32(tls, (*Fts5PhraseIter)(unsafe.Pointer(pIter)).Fa, bp+4 /* &dummy */)))
+ *(*uintptr)(unsafe.Pointer(pIter)) += uintptr(sqlite3Fts5GetVarint32(tls, (*Fts5PhraseIter)(unsafe.Pointer(pIter)).Fa, bp+4))
}
- *(*uintptr)(unsafe.Pointer(pIter /* &.a */)) += (uintptr(1 + sqlite3Fts5GetVarint32(tls, ((*Fts5PhraseIter)(unsafe.Pointer(pIter)).Fa+1), piCol)))
+ *(*uintptr)(unsafe.Pointer(pIter)) += uintptr(1 + sqlite3Fts5GetVarint32(tls, (*Fts5PhraseIter)(unsafe.Pointer(pIter)).Fa+1, piCol))
}
}
-func fts5ApiPhraseFirstColumn(tls *libc.TLS, pCtx uintptr, iPhrase int32, pIter uintptr, piCol uintptr) int32 { /* sqlite3.c:230013:12: */
+func fts5ApiPhraseFirstColumn(tls *libc.TLS, pCtx uintptr, iPhrase int32, pIter uintptr, piCol uintptr) int32 { /* sqlite3.c:231920:12: */
bp := tls.Alloc(8)
defer tls.Free(8)
@@ -186042,18 +188552,18 @@ func fts5ApiPhraseFirstColumn(tls *libc.TLS, pCtx uintptr, iPhrase int32, pIter
if iPhrase == 0 {
return 0
}
- return *(*int32)(unsafe.Pointer((pSorter + 24 /* &.aIdx */) + uintptr((iPhrase-1))*4))
+ return *(*int32)(unsafe.Pointer(pSorter + 24 + uintptr(iPhrase-1)*4))
}()
- *(*int32)(unsafe.Pointer(bp /* n */)) = (*(*int32)(unsafe.Pointer((pSorter + 24 /* &.aIdx */) + uintptr(iPhrase)*4)) - i1)
- (*Fts5PhraseIter)(unsafe.Pointer(pIter)).Fa = ((*Fts5Sorter)(unsafe.Pointer(pSorter)).FaPoslist + uintptr(i1))
+ *(*int32)(unsafe.Pointer(bp /* n */)) = *(*int32)(unsafe.Pointer(pSorter + 24 + uintptr(iPhrase)*4)) - i1
+ (*Fts5PhraseIter)(unsafe.Pointer(pIter)).Fa = (*Fts5Sorter)(unsafe.Pointer(pSorter)).FaPoslist + uintptr(i1)
} else {
- rc = sqlite3Fts5ExprPhraseCollist(tls, (*Fts5Cursor)(unsafe.Pointer(pCsr)).FpExpr, iPhrase, (pIter /* &.a */), bp /* &n */)
+ rc = sqlite3Fts5ExprPhraseCollist(tls, (*Fts5Cursor)(unsafe.Pointer(pCsr)).FpExpr, iPhrase, pIter, bp /* &n */)
}
if rc == SQLITE_OK {
(*Fts5PhraseIter)(unsafe.Pointer(pIter)).Fb = func() uintptr {
if (*Fts5PhraseIter)(unsafe.Pointer(pIter)).Fa != 0 {
- return ((*Fts5PhraseIter)(unsafe.Pointer(pIter)).Fa + uintptr(*(*int32)(unsafe.Pointer(bp /* n */))))
+ return (*Fts5PhraseIter)(unsafe.Pointer(pIter)).Fa + uintptr(*(*int32)(unsafe.Pointer(bp)))
}
return uintptr(0)
}()
@@ -186063,19 +188573,19 @@ func fts5ApiPhraseFirstColumn(tls *libc.TLS, pCtx uintptr, iPhrase int32, pIter
} else {
// var n int32 at bp+4, 4
- rc = fts5CsrPoslist(tls, pCsr, iPhrase, (pIter /* &.a */), bp+4 /* &n */)
+ rc = fts5CsrPoslist(tls, pCsr, iPhrase, pIter, bp+4 /* &n */)
if rc == SQLITE_OK {
(*Fts5PhraseIter)(unsafe.Pointer(pIter)).Fb = func() uintptr {
if (*Fts5PhraseIter)(unsafe.Pointer(pIter)).Fa != 0 {
- return ((*Fts5PhraseIter)(unsafe.Pointer(pIter)).Fa + uintptr(*(*int32)(unsafe.Pointer(bp + 4 /* n */))))
+ return (*Fts5PhraseIter)(unsafe.Pointer(pIter)).Fa + uintptr(*(*int32)(unsafe.Pointer(bp + 4)))
}
return uintptr(0)
}()
- if *(*int32)(unsafe.Pointer(bp + 4 /* n */)) <= 0 {
+ if *(*int32)(unsafe.Pointer(bp + 4)) <= 0 {
*(*int32)(unsafe.Pointer(piCol)) = -1
} else if int32(*(*uint8)(unsafe.Pointer((*Fts5PhraseIter)(unsafe.Pointer(pIter)).Fa))) == 0x01 {
- *(*uintptr)(unsafe.Pointer(pIter /* &.a */)) += (uintptr(1 + sqlite3Fts5GetVarint32(tls, ((*Fts5PhraseIter)(unsafe.Pointer(pIter)).Fa+1), piCol)))
+ *(*uintptr)(unsafe.Pointer(pIter)) += uintptr(1 + sqlite3Fts5GetVarint32(tls, (*Fts5PhraseIter)(unsafe.Pointer(pIter)).Fa+1, piCol))
} else {
*(*int32)(unsafe.Pointer(piCol)) = 0
}
@@ -186106,10 +188616,10 @@ var sFts5Api = Fts5ExtensionApi{
FxPhraseNext: 0,
FxPhraseFirstColumn: 0,
FxPhraseNextColumn: 0,
-} /* sqlite3.c:230063:31 */
+} /* sqlite3.c:231970:31 */
// Implementation of API function xQueryPhrase().
-func fts5ApiQueryPhrase(tls *libc.TLS, pCtx uintptr, iPhrase int32, pUserData uintptr, xCallback uintptr) int32 { /* sqlite3.c:230089:12: */
+func fts5ApiQueryPhrase(tls *libc.TLS, pCtx uintptr, iPhrase int32, pUserData uintptr, xCallback uintptr) int32 { /* sqlite3.c:231996:12: */
bp := tls.Alloc(4)
defer tls.Free(4)
@@ -186121,14 +188631,14 @@ func fts5ApiQueryPhrase(tls *libc.TLS, pCtx uintptr, iPhrase int32, pUserData ui
rc = fts5OpenMethod(tls, (*Fts5Cursor)(unsafe.Pointer(pCsr)).Fbase.FpVtab, bp /* &pNew */)
if rc == SQLITE_OK {
(*Fts5Cursor)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* pNew */)))).FePlan = FTS5_PLAN_MATCH
- (*Fts5Cursor)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* pNew */)))).FiFirstRowid = ((int64(-1)) - (int64(0xffffffff) | (I64((int64(0x7fffffff))) << 32)))
- (*Fts5Cursor)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* pNew */)))).FiLastRowid = (int64(0xffffffff) | (I64((int64(0x7fffffff))) << 32))
+ (*Fts5Cursor)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* pNew */)))).FiFirstRowid = int64(-1) - (int64(0xffffffff) | I64(int64(0x7fffffff))<<32)
+ (*Fts5Cursor)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* pNew */)))).FiLastRowid = int64(0xffffffff) | I64(int64(0x7fffffff))<<32
(*Fts5Cursor)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* pNew */)))).Fbase.FpVtab = pTab
- rc = sqlite3Fts5ExprClonePhrase(tls, (*Fts5Cursor)(unsafe.Pointer(pCsr)).FpExpr, iPhrase, (*(*uintptr)(unsafe.Pointer(bp /* pNew */)) + 52 /* &.pExpr */))
+ rc = sqlite3Fts5ExprClonePhrase(tls, (*Fts5Cursor)(unsafe.Pointer(pCsr)).FpExpr, iPhrase, *(*uintptr)(unsafe.Pointer(bp))+52)
}
if rc == SQLITE_OK {
- for rc = fts5CursorFirst(tls, pTab, *(*uintptr)(unsafe.Pointer(bp /* pNew */)), 0); (rc == SQLITE_OK) && (((*Fts5Cursor)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(bp /* pNew */))))).Fcsrflags & (FTS5CSR_EOF)) == 0); rc = fts5NextMethod(tls, *(*uintptr)(unsafe.Pointer(bp /* pNew */))) {
+ for rc = fts5CursorFirst(tls, pTab, *(*uintptr)(unsafe.Pointer(bp /* pNew */)), 0); rc == SQLITE_OK && (*Fts5Cursor)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* pNew */)))).Fcsrflags&FTS5CSR_EOF == 0; rc = fts5NextMethod(tls, *(*uintptr)(unsafe.Pointer(bp /* pNew */))) {
rc = (*struct {
f func(*libc.TLS, uintptr, uintptr, uintptr) int32
})(unsafe.Pointer(&struct{ uintptr }{xCallback})).f(tls, uintptr(unsafe.Pointer(&sFts5Api)), *(*uintptr)(unsafe.Pointer(bp /* pNew */)), pUserData)
@@ -186145,7 +188655,7 @@ func fts5ApiQueryPhrase(tls *libc.TLS, pCtx uintptr, iPhrase int32, pUserData ui
return rc
}
-func fts5ApiInvoke(tls *libc.TLS, pAux uintptr, pCsr uintptr, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:230126:13: */
+func fts5ApiInvoke(tls *libc.TLS, pAux uintptr, pCsr uintptr, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:232033:13: */
(*Fts5Cursor)(unsafe.Pointer(pCsr)).FpAux = pAux
(*struct {
@@ -186154,7 +188664,7 @@ func fts5ApiInvoke(tls *libc.TLS, pAux uintptr, pCsr uintptr, context uintptr, a
(*Fts5Cursor)(unsafe.Pointer(pCsr)).FpAux = uintptr(0)
}
-func fts5CursorFromCsrid(tls *libc.TLS, pGlobal uintptr, iCsrId I64) uintptr { /* sqlite3.c:230139:19: */
+func fts5CursorFromCsrid(tls *libc.TLS, pGlobal uintptr, iCsrId I64) uintptr { /* sqlite3.c:232046:19: */
var pCsr uintptr
for pCsr = (*Fts5Global)(unsafe.Pointer(pGlobal)).FpCsr; pCsr != 0; pCsr = (*Fts5Cursor)(unsafe.Pointer(pCsr)).FpNext {
if (*Fts5Cursor)(unsafe.Pointer(pCsr)).FiCsrId == iCsrId {
@@ -186164,7 +188674,7 @@ func fts5CursorFromCsrid(tls *libc.TLS, pGlobal uintptr, iCsrId I64) uintptr { /
return pCsr
}
-func fts5ApiCallback(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:230147:13: */
+func fts5ApiCallback(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:232054:13: */
bp := tls.Alloc(8)
defer tls.Free(8)
@@ -186176,18 +188686,18 @@ func fts5ApiCallback(tls *libc.TLS, context uintptr, argc int32, argv uintptr) {
iCsrId = Xsqlite3_value_int64(tls, *(*uintptr)(unsafe.Pointer(argv)))
pCsr = fts5CursorFromCsrid(tls, (*Fts5Auxiliary)(unsafe.Pointer(pAux)).FpGlobal, iCsrId)
- if (pCsr == uintptr(0)) || ((*Fts5Cursor)(unsafe.Pointer(pCsr)).FePlan == 0) {
- var zErr uintptr = Xsqlite3_mprintf(tls, ts+33976 /* "no such cursor: ..." */, libc.VaList(bp, iCsrId))
+ if pCsr == uintptr(0) || (*Fts5Cursor)(unsafe.Pointer(pCsr)).FePlan == 0 {
+ var zErr uintptr = Xsqlite3_mprintf(tls, ts+35336 /* "no such cursor: ..." */, libc.VaList(bp, iCsrId))
Xsqlite3_result_error(tls, context, zErr, -1)
Xsqlite3_free(tls, zErr)
} else {
- fts5ApiInvoke(tls, pAux, pCsr, context, (argc - 1), (argv + 1*4))
+ fts5ApiInvoke(tls, pAux, pCsr, context, argc-1, argv+1*4)
}
}
// Given cursor id iId, return a pointer to the corresponding Fts5Table
// object. Or NULL If the cursor id does not exist.
-func sqlite3Fts5TableFromCsrid(tls *libc.TLS, pGlobal uintptr, iCsrId I64) uintptr { /* sqlite3.c:230176:18: */
+func sqlite3Fts5TableFromCsrid(tls *libc.TLS, pGlobal uintptr, iCsrId I64) uintptr { /* sqlite3.c:232083:18: */
var pCsr uintptr
pCsr = fts5CursorFromCsrid(tls, pGlobal, iCsrId)
if pCsr != 0 {
@@ -186209,7 +188719,7 @@ func sqlite3Fts5TableFromCsrid(tls *libc.TLS, pGlobal uintptr, iCsrId I64) uintp
// for phrase 0. The second (same disclaimer) contains the size of position
// list 1. And so on. There is no size field for the final position list,
// as it can be derived from the total size of the blob.
-func fts5PoslistBlob(tls *libc.TLS, pCtx uintptr, pCsr uintptr) int32 { /* sqlite3.c:230203:12: */
+func fts5PoslistBlob(tls *libc.TLS, pCtx uintptr, pCsr uintptr) int32 { /* sqlite3.c:232110:12: */
bp := tls.Alloc(40)
defer tls.Free(40)
@@ -186223,7 +188733,7 @@ func fts5PoslistBlob(tls *libc.TLS, pCtx uintptr, pCsr uintptr) int32 { /* sqlit
case FTS5_DETAIL_FULL:
// Append the varints
- for i = 0; i < (nPhrase - 1); i++ {
+ for i = 0; i < nPhrase-1; i++ {
// var dummy uintptr at bp+12, 4
var nByte int32 = sqlite3Fts5ExprPoslist(tls, (*Fts5Cursor)(unsafe.Pointer(pCsr)).FpExpr, i, bp+12 /* &dummy */)
@@ -186243,7 +188753,7 @@ func fts5PoslistBlob(tls *libc.TLS, pCtx uintptr, pCsr uintptr) int32 { /* sqlit
case FTS5_DETAIL_COLUMNS:
// Append the varints
- for i = 0; (*(*int32)(unsafe.Pointer(bp + 16 /* rc */)) == SQLITE_OK) && (i < (nPhrase - 1)); i++ {
+ for i = 0; *(*int32)(unsafe.Pointer(bp + 16 /* rc */)) == SQLITE_OK && i < nPhrase-1; i++ {
// var dummy uintptr at bp+24, 4
// var nByte int32 at bp+28, 4
@@ -186253,7 +188763,7 @@ func fts5PoslistBlob(tls *libc.TLS, pCtx uintptr, pCsr uintptr) int32 { /* sqlit
}
// Append the position lists
- for i = 0; (*(*int32)(unsafe.Pointer(bp + 16 /* rc */)) == SQLITE_OK) && (i < nPhrase); i++ {
+ for i = 0; *(*int32)(unsafe.Pointer(bp + 16 /* rc */)) == SQLITE_OK && i < nPhrase; i++ {
// var pPoslist uintptr at bp+32, 4
// var nPoslist int32 at bp+36, 4
@@ -186273,7 +188783,7 @@ func fts5PoslistBlob(tls *libc.TLS, pCtx uintptr, pCsr uintptr) int32 { /* sqlit
// This is the xColumn method, called by SQLite to request a value from
// the row that the supplied cursor currently points to.
-func fts5ColumnMethod(tls *libc.TLS, pCursor uintptr, pCtx uintptr, iCol int32) int32 { /* sqlite3.c:230260:12: */
+func fts5ColumnMethod(tls *libc.TLS, pCursor uintptr, pCtx uintptr, iCol int32) int32 { /* sqlite3.c:232167:12: */
var pTab uintptr = (*Sqlite3_vtab_cursor)(unsafe.Pointer(pCursor)).FpVtab
var pConfig uintptr = (*Fts5FullTable)(unsafe.Pointer(pTab)).Fp.FpConfig
var pCsr uintptr = pCursor
@@ -186289,22 +188799,22 @@ func fts5ColumnMethod(tls *libc.TLS, pCursor uintptr, pCtx uintptr, iCol int32)
// useful in that it may be passed as the first argument to an FTS5
// auxiliary function.
Xsqlite3_result_int64(tls, pCtx, (*Fts5Cursor)(unsafe.Pointer(pCsr)).FiCsrId)
- } else if iCol == ((*Fts5Config)(unsafe.Pointer(pConfig)).FnCol + 1) {
+ } else if iCol == (*Fts5Config)(unsafe.Pointer(pConfig)).FnCol+1 {
// The value of the "rank" column.
if (*Fts5Cursor)(unsafe.Pointer(pCsr)).FePlan == FTS5_PLAN_SOURCE {
fts5PoslistBlob(tls, pCtx, pCsr)
- } else if ((*Fts5Cursor)(unsafe.Pointer(pCsr)).FePlan == FTS5_PLAN_MATCH) ||
- ((*Fts5Cursor)(unsafe.Pointer(pCsr)).FePlan == FTS5_PLAN_SORTED_MATCH) {
- if ((*Fts5Cursor)(unsafe.Pointer(pCsr)).FpRank != 0) || (SQLITE_OK == (libc.AssignInt32(&rc, fts5FindRankFunction(tls, pCsr)))) {
+ } else if (*Fts5Cursor)(unsafe.Pointer(pCsr)).FePlan == FTS5_PLAN_MATCH ||
+ (*Fts5Cursor)(unsafe.Pointer(pCsr)).FePlan == FTS5_PLAN_SORTED_MATCH {
+ if (*Fts5Cursor)(unsafe.Pointer(pCsr)).FpRank != 0 || SQLITE_OK == libc.AssignInt32(&rc, fts5FindRankFunction(tls, pCsr)) {
fts5ApiInvoke(tls, (*Fts5Cursor)(unsafe.Pointer(pCsr)).FpRank, pCsr, pCtx, (*Fts5Cursor)(unsafe.Pointer(pCsr)).FnRankArg, (*Fts5Cursor)(unsafe.Pointer(pCsr)).FapRankArg)
}
}
} else if !(fts5IsContentless(tls, pTab) != 0) {
- (*Fts5Config)(unsafe.Pointer(pConfig)).FpzErrmsg = (pTab /* &.p */ /* &.base */ + 8 /* &.zErrMsg */)
+ (*Fts5Config)(unsafe.Pointer(pConfig)).FpzErrmsg = pTab + 8
rc = fts5SeekCursor(tls, pCsr, 1)
if rc == SQLITE_OK {
- Xsqlite3_result_value(tls, pCtx, Xsqlite3_column_value(tls, (*Fts5Cursor)(unsafe.Pointer(pCsr)).FpStmt, (iCol+1)))
+ Xsqlite3_result_value(tls, pCtx, Xsqlite3_column_value(tls, (*Fts5Cursor)(unsafe.Pointer(pCsr)).FpStmt, iCol+1))
}
(*Fts5Config)(unsafe.Pointer(pConfig)).FpzErrmsg = uintptr(0)
}
@@ -186313,7 +188823,7 @@ func fts5ColumnMethod(tls *libc.TLS, pCursor uintptr, pCtx uintptr, iCol int32)
// This routine implements the xFindFunction method for the FTS3
// virtual table.
-func fts5FindFunctionMethod(tls *libc.TLS, pVtab uintptr, nUnused int32, zName uintptr, pxFunc uintptr, ppArg uintptr) int32 { /* sqlite3.c:230313:12: */
+func fts5FindFunctionMethod(tls *libc.TLS, pVtab uintptr, nUnused int32, zName uintptr, pxFunc uintptr, ppArg uintptr) int32 { /* sqlite3.c:232220:12: */
var pTab uintptr = pVtab
var pAux uintptr
@@ -186332,12 +188842,12 @@ func fts5FindFunctionMethod(tls *libc.TLS, pVtab uintptr, nUnused int32, zName u
}
// Implementation of FTS5 xRename method. Rename an fts5 table.
-func fts5RenameMethod(tls *libc.TLS, pVtab uintptr, zName uintptr) int32 { /* sqlite3.c:230338:12: */
+func fts5RenameMethod(tls *libc.TLS, pVtab uintptr, zName uintptr) int32 { /* sqlite3.c:232245:12: */
var pTab uintptr = pVtab
return sqlite3Fts5StorageRename(tls, (*Fts5FullTable)(unsafe.Pointer(pTab)).FpStorage, zName)
}
-func sqlite3Fts5FlushToDisk(tls *libc.TLS, pTab uintptr) int32 { /* sqlite3.c:230346:12: */
+func sqlite3Fts5FlushToDisk(tls *libc.TLS, pTab uintptr) int32 { /* sqlite3.c:232253:12: */
fts5TripCursors(tls, pTab)
return sqlite3Fts5StorageSync(tls, (*Fts5FullTable)(unsafe.Pointer(pTab)).FpStorage)
}
@@ -186345,7 +188855,7 @@ func sqlite3Fts5FlushToDisk(tls *libc.TLS, pTab uintptr) int32 { /* sqlite3.c:23
// The xSavepoint() method.
//
// Flush the contents of the pending-terms table to disk.
-func fts5SavepointMethod(tls *libc.TLS, pVtab uintptr, iSavepoint int32) int32 { /* sqlite3.c:230356:12: */
+func fts5SavepointMethod(tls *libc.TLS, pVtab uintptr, iSavepoint int32) int32 { /* sqlite3.c:232263:12: */
_ = iSavepoint // Call below is a no-op for NDEBUG builds
return sqlite3Fts5FlushToDisk(tls, pVtab)
@@ -186354,7 +188864,7 @@ func fts5SavepointMethod(tls *libc.TLS, pVtab uintptr, iSavepoint int32) int32 {
// The xRelease() method.
//
// This is a no-op.
-func fts5ReleaseMethod(tls *libc.TLS, pVtab uintptr, iSavepoint int32) int32 { /* sqlite3.c:230367:12: */
+func fts5ReleaseMethod(tls *libc.TLS, pVtab uintptr, iSavepoint int32) int32 { /* sqlite3.c:232274:12: */
_ = iSavepoint // Call below is a no-op for NDEBUG builds
return sqlite3Fts5FlushToDisk(tls, pVtab)
@@ -186363,7 +188873,7 @@ func fts5ReleaseMethod(tls *libc.TLS, pVtab uintptr, iSavepoint int32) int32 { /
// The xRollbackTo() method.
//
// Discard the contents of the pending terms table.
-func fts5RollbackToMethod(tls *libc.TLS, pVtab uintptr, iSavepoint int32) int32 { /* sqlite3.c:230378:12: */
+func fts5RollbackToMethod(tls *libc.TLS, pVtab uintptr, iSavepoint int32) int32 { /* sqlite3.c:232285:12: */
var pTab uintptr = pVtab
_ = iSavepoint // Call below is a no-op for NDEBUG builds
@@ -186372,7 +188882,7 @@ func fts5RollbackToMethod(tls *libc.TLS, pVtab uintptr, iSavepoint int32) int32
}
// Register a new auxiliary function with global context pGlobal.
-func fts5CreateAux(tls *libc.TLS, pApi uintptr, zName uintptr, pUserData uintptr, xFunc Fts5_extension_function, xDestroy uintptr) int32 { /* sqlite3.c:230389:12: */
+func fts5CreateAux(tls *libc.TLS, pApi uintptr, zName uintptr, pUserData uintptr, xFunc Fts5_extension_function, xDestroy uintptr) int32 { /* sqlite3.c:232296:12: */
var pGlobal uintptr = pApi
var rc int32 = Xsqlite3_overload_function(tls, (*Fts5Global)(unsafe.Pointer(pGlobal)).Fdb, zName, -1)
if rc == SQLITE_OK {
@@ -186380,12 +188890,12 @@ func fts5CreateAux(tls *libc.TLS, pApi uintptr, zName uintptr, pUserData uintptr
var nName Sqlite3_int64 // Size of zName in bytes, including \0
var nByte Sqlite3_int64 // Bytes of space to allocate
- nName = (Sqlite3_int64(libc.Xstrlen(tls, zName) + Size_t(1)))
- nByte = (Sqlite3_int64(unsafe.Sizeof(Fts5Auxiliary{})) + nName)
+ nName = Sqlite3_int64(libc.Xstrlen(tls, zName) + Size_t(1))
+ nByte = Sqlite3_int64(unsafe.Sizeof(Fts5Auxiliary{})) + nName
pAux = Xsqlite3_malloc64(tls, uint64(nByte))
if pAux != 0 {
libc.Xmemset(tls, pAux, 0, Size_t(nByte))
- (*Fts5Auxiliary)(unsafe.Pointer(pAux)).FzFunc = (pAux + 1*24)
+ (*Fts5Auxiliary)(unsafe.Pointer(pAux)).FzFunc = pAux + 1*24
libc.Xmemcpy(tls, (*Fts5Auxiliary)(unsafe.Pointer(pAux)).FzFunc, zName, uint32(nName))
(*Fts5Auxiliary)(unsafe.Pointer(pAux)).FpGlobal = pGlobal
(*Fts5Auxiliary)(unsafe.Pointer(pAux)).FpUserData = pUserData
@@ -186403,19 +188913,19 @@ func fts5CreateAux(tls *libc.TLS, pApi uintptr, zName uintptr, pUserData uintptr
// Register a new tokenizer. This is the implementation of the
// fts5_api.xCreateTokenizer() method.
-func fts5CreateTokenizer(tls *libc.TLS, pApi uintptr, zName uintptr, pUserData uintptr, pTokenizer uintptr, xDestroy uintptr) int32 { /* sqlite3.c:230428:12: */
+func fts5CreateTokenizer(tls *libc.TLS, pApi uintptr, zName uintptr, pUserData uintptr, pTokenizer uintptr, xDestroy uintptr) int32 { /* sqlite3.c:232335:12: */
var pGlobal uintptr = pApi
var pNew uintptr
var nName Sqlite3_int64 // Size of zName and its \0 terminator
var nByte Sqlite3_int64 // Bytes of space to allocate
var rc int32 = SQLITE_OK
- nName = (Sqlite3_int64(libc.Xstrlen(tls, zName) + Size_t(1)))
- nByte = (Sqlite3_int64(unsafe.Sizeof(Fts5TokenizerModule{})) + nName)
+ nName = Sqlite3_int64(libc.Xstrlen(tls, zName) + Size_t(1))
+ nByte = Sqlite3_int64(unsafe.Sizeof(Fts5TokenizerModule{})) + nName
pNew = Xsqlite3_malloc64(tls, uint64(nByte))
if pNew != 0 {
libc.Xmemset(tls, pNew, 0, Size_t(nByte))
- (*Fts5TokenizerModule)(unsafe.Pointer(pNew)).FzName = (pNew + 1*28)
+ (*Fts5TokenizerModule)(unsafe.Pointer(pNew)).FzName = pNew + 1*28
libc.Xmemcpy(tls, (*Fts5TokenizerModule)(unsafe.Pointer(pNew)).FzName, zName, uint32(nName))
(*Fts5TokenizerModule)(unsafe.Pointer(pNew)).FpUserData = pUserData
(*Fts5TokenizerModule)(unsafe.Pointer(pNew)).Fx = *(*Fts5_tokenizer)(unsafe.Pointer(pTokenizer))
@@ -186432,7 +188942,7 @@ func fts5CreateTokenizer(tls *libc.TLS, pApi uintptr, zName uintptr, pUserData u
return rc
}
-func fts5LocateTokenizer(tls *libc.TLS, pGlobal uintptr, zName uintptr) uintptr { /* sqlite3.c:230463:28: */
+func fts5LocateTokenizer(tls *libc.TLS, pGlobal uintptr, zName uintptr) uintptr { /* sqlite3.c:232370:28: */
var pMod uintptr = uintptr(0)
if zName == uintptr(0) {
@@ -186450,7 +188960,7 @@ func fts5LocateTokenizer(tls *libc.TLS, pGlobal uintptr, zName uintptr) uintptr
// Find a tokenizer. This is the implementation of the
// fts5_api.xFindTokenizer() method.
-func fts5FindTokenizer(tls *libc.TLS, pApi uintptr, zName uintptr, ppUserData uintptr, pTokenizer uintptr) int32 { /* sqlite3.c:230484:12: */
+func fts5FindTokenizer(tls *libc.TLS, pApi uintptr, zName uintptr, ppUserData uintptr, pTokenizer uintptr) int32 { /* sqlite3.c:232391:12: */
var rc int32 = SQLITE_OK
var pMod uintptr
@@ -186466,7 +188976,7 @@ func fts5FindTokenizer(tls *libc.TLS, pApi uintptr, zName uintptr, ppUserData ui
return rc
}
-func sqlite3Fts5GetTokenizer(tls *libc.TLS, pGlobal uintptr, azArg uintptr, nArg int32, pConfig uintptr, pzErr uintptr) int32 { /* sqlite3.c:230505:12: */
+func sqlite3Fts5GetTokenizer(tls *libc.TLS, pGlobal uintptr, azArg uintptr, nArg int32, pConfig uintptr, pzErr uintptr) int32 { /* sqlite3.c:232412:12: */
bp := tls.Alloc(8)
defer tls.Free(8)
@@ -186482,26 +188992,26 @@ func sqlite3Fts5GetTokenizer(tls *libc.TLS, pGlobal uintptr, azArg uintptr, nArg
if pMod == uintptr(0) {
rc = SQLITE_ERROR
- *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, ts+33997 /* "no such tokenize..." */, libc.VaList(bp, *(*uintptr)(unsafe.Pointer(azArg))))
+ *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, ts+35357 /* "no such tokenize..." */, libc.VaList(bp, *(*uintptr)(unsafe.Pointer(azArg))))
} else {
rc = (*struct {
f func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32
})(unsafe.Pointer(&struct{ uintptr }{(*Fts5TokenizerModule)(unsafe.Pointer(pMod)).Fx.FxCreate})).f(tls,
(*Fts5TokenizerModule)(unsafe.Pointer(pMod)).FpUserData, func() uintptr {
if azArg != 0 {
- return (azArg + 1*4)
+ return azArg + 1*4
}
return uintptr(0)
}(), func() int32 {
if nArg != 0 {
- return (nArg - 1)
+ return nArg - 1
}
return 0
- }(), (pConfig + 56 /* &.pTok */))
- (*Fts5Config)(unsafe.Pointer(pConfig)).FpTokApi = (pMod + 8 /* &.x */)
+ }(), pConfig+56)
+ (*Fts5Config)(unsafe.Pointer(pConfig)).FpTokApi = pMod + 8
if rc != SQLITE_OK {
if pzErr != 0 {
- *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, ts+34019 /* "error in tokeniz..." */, 0)
+ *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, ts+35379 /* "error in tokeniz..." */, 0)
}
} else {
(*Fts5Config)(unsafe.Pointer(pConfig)).FePattern = sqlite3Fts5TokenizerPattern(tls,
@@ -186517,7 +189027,7 @@ func sqlite3Fts5GetTokenizer(tls *libc.TLS, pGlobal uintptr, azArg uintptr, nArg
return rc
}
-func fts5ModuleDestroy(tls *libc.TLS, pCtx uintptr) { /* sqlite3.c:230542:13: */
+func fts5ModuleDestroy(tls *libc.TLS, pCtx uintptr) { /* sqlite3.c:232449:13: */
var pTok uintptr
var pNextTok uintptr
var pAux uintptr
@@ -186543,30 +189053,30 @@ func fts5ModuleDestroy(tls *libc.TLS, pCtx uintptr) { /* sqlite3.c:230542:13: */
Xsqlite3_free(tls, pGlobal)
}
-func fts5Fts5Func(tls *libc.TLS, pCtx uintptr, nArg int32, apArg uintptr) { /* sqlite3.c:230562:13: */
+func fts5Fts5Func(tls *libc.TLS, pCtx uintptr, nArg int32, apArg uintptr) { /* sqlite3.c:232469:13: */
var pGlobal uintptr = Xsqlite3_user_data(tls, pCtx)
var ppApi uintptr
_ = nArg
- ppApi = Xsqlite3_value_pointer(tls, *(*uintptr)(unsafe.Pointer(apArg)), ts+34050 /* "fts5_api_ptr" */)
+ ppApi = Xsqlite3_value_pointer(tls, *(*uintptr)(unsafe.Pointer(apArg)), ts+35410 /* "fts5_api_ptr" */)
if ppApi != 0 {
- *(*uintptr)(unsafe.Pointer(ppApi)) = (pGlobal /* &.api */)
+ *(*uintptr)(unsafe.Pointer(ppApi)) = pGlobal
}
}
// Implementation of fts5_source_id() function.
-func fts5SourceIdFunc(tls *libc.TLS, pCtx uintptr, nArg int32, apUnused uintptr) { /* sqlite3.c:230578:13: */
+func fts5SourceIdFunc(tls *libc.TLS, pCtx uintptr, nArg int32, apUnused uintptr) { /* sqlite3.c:232485:13: */
_ = nArg
_ = apUnused
- Xsqlite3_result_text(tls, pCtx, ts+34063 /* "fts5: 2021-06-18..." */, -1, libc.UintptrFromInt32(-1))
+ Xsqlite3_result_text(tls, pCtx, ts+35423 /* "fts5: 2021-11-27..." */, -1, libc.UintptrFromInt32(-1))
}
// Return true if zName is the extension on one of the shadow tables used
// by this module.
-func fts5ShadowName(tls *libc.TLS, zName uintptr) int32 { /* sqlite3.c:230592:12: */
+func fts5ShadowName(tls *libc.TLS, zName uintptr) int32 { /* sqlite3.c:232499:12: */
var i uint32
- for i = uint32(0); i < (uint32(unsafe.Sizeof(azName2)) / uint32(unsafe.Sizeof(uintptr(0)))); i++ {
+ for i = uint32(0); i < uint32(unsafe.Sizeof(azName2))/uint32(unsafe.Sizeof(uintptr(0))); i++ {
if Xsqlite3_stricmp(tls, zName, azName2[i]) == 0 {
return 1
}
@@ -186575,10 +189085,10 @@ func fts5ShadowName(tls *libc.TLS, zName uintptr) int32 { /* sqlite3.c:230592:12
}
var azName2 = [5]uintptr{
- ts + 34154 /* "config" */, ts + 32253 /* "content" */, ts + 23316 /* "data" */, ts + 32604 /* "docsize" */, ts + 10212, /* "idx" */
-} /* sqlite3.c:230593:21 */
+ ts + 35514 /* "config" */, ts + 33613 /* "content" */, ts + 24613 /* "data" */, ts + 33964 /* "docsize" */, ts + 11326, /* "idx" */
+} /* sqlite3.c:232500:21 */
-func fts5Init(tls *libc.TLS, db uintptr) int32 { /* sqlite3.c:230603:12: */
+func fts5Init(tls *libc.TLS, db uintptr) int32 { /* sqlite3.c:232510:12: */
var rc int32
var pGlobal uintptr = uintptr(0)
@@ -186599,7 +189109,7 @@ func fts5Init(tls *libc.TLS, db uintptr) int32 { /* sqlite3.c:230603:12: */
(*Fts5Global)(unsafe.Pointer(pGlobal)).Fapi.FxFindTokenizer = *(*uintptr)(unsafe.Pointer(&struct {
f func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) int32
}{fts5FindTokenizer}))
- rc = Xsqlite3_create_module_v2(tls, db, ts+34161 /* "fts5" */, uintptr(unsafe.Pointer(&fts5Mod)), p, *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{fts5ModuleDestroy})))
+ rc = Xsqlite3_create_module_v2(tls, db, ts+35521 /* "fts5" */, uintptr(unsafe.Pointer(&fts5Mod)), p, *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{fts5ModuleDestroy})))
if rc == SQLITE_OK {
rc = sqlite3Fts5IndexInit(tls, db)
}
@@ -186607,23 +189117,23 @@ func fts5Init(tls *libc.TLS, db uintptr) int32 { /* sqlite3.c:230603:12: */
rc = sqlite3Fts5ExprInit(tls, pGlobal, db)
}
if rc == SQLITE_OK {
- rc = sqlite3Fts5AuxInit(tls, (pGlobal /* &.api */))
+ rc = sqlite3Fts5AuxInit(tls, pGlobal)
}
if rc == SQLITE_OK {
- rc = sqlite3Fts5TokenizerInit(tls, (pGlobal /* &.api */))
+ rc = sqlite3Fts5TokenizerInit(tls, pGlobal)
}
if rc == SQLITE_OK {
rc = sqlite3Fts5VocabInit(tls, pGlobal, db)
}
if rc == SQLITE_OK {
rc = Xsqlite3_create_function(tls,
- db, ts+34161 /* "fts5" */, 1, SQLITE_UTF8, p, *(*uintptr)(unsafe.Pointer(&struct {
+ db, ts+35521 /* "fts5" */, 1, SQLITE_UTF8, p, *(*uintptr)(unsafe.Pointer(&struct {
f func(*libc.TLS, uintptr, int32, uintptr)
}{fts5Fts5Func})), uintptr(0), uintptr(0))
}
if rc == SQLITE_OK {
rc = Xsqlite3_create_function(tls,
- db, ts+34166 /* "fts5_source_id" */, 0, SQLITE_UTF8, p, *(*uintptr)(unsafe.Pointer(&struct {
+ db, ts+35526 /* "fts5_source_id" */, 0, SQLITE_UTF8, p, *(*uintptr)(unsafe.Pointer(&struct {
f func(*libc.TLS, uintptr, int32, uintptr)
}{fts5SourceIdFunc})), uintptr(0), uintptr(0))
}
@@ -186661,7 +189171,7 @@ var fts5Mod = Sqlite3_module{
/* xRelease */ FxRelease: 0,
/* xRollbackTo */ FxRollbackTo: 0,
/* xShadowName */ FxShadowName: 0,
-} /* sqlite3.c:230604:31 */
+} /* sqlite3.c:232511:31 */
// The following functions are used to register the module with SQLite. If
// this module is being built as part of the SQLite core (SQLITE_CORE is
@@ -186670,7 +189180,7 @@ var fts5Mod = Sqlite3_module{
// Or, if this module is being built as a loadable extension,
// sqlite3Fts5Init() is omitted and the two standard entry points
// sqlite3_fts_init() and sqlite3_fts5_init() defined instead.
-func Xsqlite3Fts5Init(tls *libc.TLS, db uintptr) int32 { /* sqlite3.c:230712:20: */
+func Xsqlite3Fts5Init(tls *libc.TLS, db uintptr) int32 { /* sqlite3.c:232619:20: */
return fts5Init(tls, db)
}
@@ -186678,7 +189188,7 @@ func Xsqlite3Fts5Init(tls *libc.TLS, db uintptr) int32 { /* sqlite3.c:230712:20:
// Fts5Storage.pInsertDocsize - if they have not already been prepared.
// Return SQLITE_OK if successful, or an SQLite error code if an error
// occurs.
-func fts5StorageGetStmt(tls *libc.TLS, p uintptr, eStmt int32, ppStmt uintptr, pzErrMsg uintptr) int32 { /* sqlite3.c:230770:12: */
+func fts5StorageGetStmt(tls *libc.TLS, p uintptr, eStmt int32, ppStmt uintptr, pzErrMsg uintptr) int32 { /* sqlite3.c:232677:12: */
bp := tls.Alloc(172)
defer tls.Free(172)
@@ -186687,22 +189197,22 @@ func fts5StorageGetStmt(tls *libc.TLS, p uintptr, eStmt int32, ppStmt uintptr, p
// If there is no %_docsize table, there should be no requests for
// statements to operate on it.
- if *(*uintptr)(unsafe.Pointer((p + 28 /* &.aStmt */) + uintptr(eStmt)*4)) == uintptr(0) {
+ if *(*uintptr)(unsafe.Pointer(p + 28 + uintptr(eStmt)*4)) == uintptr(0) {
*(*[11]uintptr)(unsafe.Pointer(bp + 128 /* azStmt */)) = [11]uintptr{
- ts + 34181, /* "SELECT %s FROM %..." */
- ts + 34249, /* "SELECT %s FROM %..." */
- ts + 34318, /* "SELECT %s FROM %..." */ // LOOKUP
+ ts + 35541, /* "SELECT %s FROM %..." */
+ ts + 35609, /* "SELECT %s FROM %..." */
+ ts + 35678, /* "SELECT %s FROM %..." */ // LOOKUP
- ts + 34351, /* "INSERT INTO %Q.'..." */ // INSERT_CONTENT
- ts + 34390, /* "REPLACE INTO %Q...." */ // REPLACE_CONTENT
- ts + 34430, /* "DELETE FROM %Q.'..." */ // DELETE_CONTENT
- ts + 34469, /* "REPLACE INTO %Q...." */ // REPLACE_DOCSIZE
- ts + 34510, /* "DELETE FROM %Q.'..." */ // DELETE_DOCSIZE
+ ts + 35711, /* "INSERT INTO %Q.'..." */ // INSERT_CONTENT
+ ts + 35750, /* "REPLACE INTO %Q...." */ // REPLACE_CONTENT
+ ts + 35790, /* "DELETE FROM %Q.'..." */ // DELETE_CONTENT
+ ts + 35829, /* "REPLACE INTO %Q...." */ // REPLACE_DOCSIZE
+ ts + 35870, /* "DELETE FROM %Q.'..." */ // DELETE_DOCSIZE
- ts + 34549, /* "SELECT sz FROM %..." */ // LOOKUP_DOCSIZE
+ ts + 35909, /* "SELECT sz FROM %..." */ // LOOKUP_DOCSIZE
- ts + 34591, /* "REPLACE INTO %Q...." */ // REPLACE_CONFIG
- ts + 34631, /* "SELECT %s FROM %..." */ // SCAN
+ ts + 35951, /* "REPLACE INTO %Q...." */ // REPLACE_CONFIG
+ ts + 35991, /* "SELECT %s FROM %..." */ // SCAN
}
var pC uintptr = (*Fts5Storage)(unsafe.Pointer(p)).FpConfig
var zSql uintptr = uintptr(0)
@@ -186733,17 +189243,17 @@ func fts5StorageGetStmt(tls *libc.TLS, p uintptr, eStmt int32, ppStmt uintptr, p
fallthrough
case FTS5_STMT_REPLACE_CONTENT:
{
- var nCol int32 = ((*Fts5Config)(unsafe.Pointer(pC)).FnCol + 1)
+ var nCol int32 = (*Fts5Config)(unsafe.Pointer(pC)).FnCol + 1
var zBind uintptr
var i int32
- zBind = Xsqlite3_malloc64(tls, (uint64(1 + (nCol * 2))))
+ zBind = Xsqlite3_malloc64(tls, uint64(1+nCol*2))
if zBind != 0 {
for i = 0; i < nCol; i++ {
- *(*uint8)(unsafe.Pointer(zBind + uintptr((i * 2)))) = uint8('?')
- *(*uint8)(unsafe.Pointer(zBind + uintptr(((i * 2) + 1)))) = uint8(',')
+ *(*uint8)(unsafe.Pointer(zBind + uintptr(i*2))) = uint8('?')
+ *(*uint8)(unsafe.Pointer(zBind + uintptr(i*2+1))) = uint8(',')
}
- *(*uint8)(unsafe.Pointer(zBind + uintptr(((i * 2) - 1)))) = uint8(0)
+ *(*uint8)(unsafe.Pointer(zBind + uintptr(i*2-1))) = uint8(0)
zSql = Xsqlite3_mprintf(tls, *(*uintptr)(unsafe.Pointer(bp + 128 /* &azStmt[0] */ + uintptr(eStmt)*4)), libc.VaList(bp+80, (*Fts5Config)(unsafe.Pointer(pC)).FzDb, (*Fts5Config)(unsafe.Pointer(pC)).FzName, zBind))
Xsqlite3_free(tls, zBind)
}
@@ -186762,24 +189272,24 @@ func fts5StorageGetStmt(tls *libc.TLS, p uintptr, eStmt int32, ppStmt uintptr, p
} else {
var f int32 = SQLITE_PREPARE_PERSISTENT
if eStmt > FTS5_STMT_LOOKUP {
- f = f | (SQLITE_PREPARE_NO_VTAB)
+ f = f | SQLITE_PREPARE_NO_VTAB
}
(*Fts5Config)(unsafe.Pointer((*Fts5Storage)(unsafe.Pointer(p)).FpConfig)).FbLock++
- rc = Xsqlite3_prepare_v3(tls, (*Fts5Config)(unsafe.Pointer(pC)).Fdb, zSql, -1, uint32(f), ((p + 28 /* &.aStmt */) + uintptr(eStmt)*4), uintptr(0))
+ rc = Xsqlite3_prepare_v3(tls, (*Fts5Config)(unsafe.Pointer(pC)).Fdb, zSql, -1, uint32(f), p+28+uintptr(eStmt)*4, uintptr(0))
(*Fts5Config)(unsafe.Pointer((*Fts5Storage)(unsafe.Pointer(p)).FpConfig)).FbLock--
Xsqlite3_free(tls, zSql)
- if (rc != SQLITE_OK) && (pzErrMsg != 0) {
- *(*uintptr)(unsafe.Pointer(pzErrMsg)) = Xsqlite3_mprintf(tls, ts+2790 /* "%s" */, libc.VaList(bp+120, Xsqlite3_errmsg(tls, (*Fts5Config)(unsafe.Pointer(pC)).Fdb)))
+ if rc != SQLITE_OK && pzErrMsg != 0 {
+ *(*uintptr)(unsafe.Pointer(pzErrMsg)) = Xsqlite3_mprintf(tls, ts+3601 /* "%s" */, libc.VaList(bp+120, Xsqlite3_errmsg(tls, (*Fts5Config)(unsafe.Pointer(pC)).Fdb)))
}
}
}
- *(*uintptr)(unsafe.Pointer(ppStmt)) = *(*uintptr)(unsafe.Pointer((p + 28 /* &.aStmt */) + uintptr(eStmt)*4))
+ *(*uintptr)(unsafe.Pointer(ppStmt)) = *(*uintptr)(unsafe.Pointer(p + 28 + uintptr(eStmt)*4))
Xsqlite3_reset(tls, *(*uintptr)(unsafe.Pointer(ppStmt)))
return rc
}
-func fts5ExecPrintf(tls *libc.TLS, db uintptr, pzErr uintptr, zFormat uintptr, va uintptr) int32 { /* sqlite3.c:230873:12: */
+func fts5ExecPrintf(tls *libc.TLS, db uintptr, pzErr uintptr, zFormat uintptr, va uintptr) int32 { /* sqlite3.c:232780:12: */
var rc int32
var ap Va_list
_ = ap // ... printf arguments
@@ -186801,79 +189311,79 @@ func fts5ExecPrintf(tls *libc.TLS, db uintptr, pzErr uintptr, zFormat uintptr, v
// Drop all shadow tables. Return SQLITE_OK if successful or an SQLite error
// code otherwise.
-func sqlite3Fts5DropAll(tls *libc.TLS, pConfig uintptr) int32 { /* sqlite3.c:230901:12: */
+func sqlite3Fts5DropAll(tls *libc.TLS, pConfig uintptr) int32 { /* sqlite3.c:232808:12: */
bp := tls.Alloc(80)
defer tls.Free(80)
var rc int32 = fts5ExecPrintf(tls, (*Fts5Config)(unsafe.Pointer(pConfig)).Fdb, uintptr(0),
- ts+34654, /* "DROP TABLE IF EX..." */
+ ts+36014, /* "DROP TABLE IF EX..." */
libc.VaList(bp, (*Fts5Config)(unsafe.Pointer(pConfig)).FzDb, (*Fts5Config)(unsafe.Pointer(pConfig)).FzName,
(*Fts5Config)(unsafe.Pointer(pConfig)).FzDb, (*Fts5Config)(unsafe.Pointer(pConfig)).FzName,
(*Fts5Config)(unsafe.Pointer(pConfig)).FzDb, (*Fts5Config)(unsafe.Pointer(pConfig)).FzName))
- if (rc == SQLITE_OK) && ((*Fts5Config)(unsafe.Pointer(pConfig)).FbColumnsize != 0) {
+ if rc == SQLITE_OK && (*Fts5Config)(unsafe.Pointer(pConfig)).FbColumnsize != 0 {
rc = fts5ExecPrintf(tls, (*Fts5Config)(unsafe.Pointer(pConfig)).Fdb, uintptr(0),
- ts+34758, /* "DROP TABLE IF EX..." */
+ ts+36118, /* "DROP TABLE IF EX..." */
libc.VaList(bp+48, (*Fts5Config)(unsafe.Pointer(pConfig)).FzDb, (*Fts5Config)(unsafe.Pointer(pConfig)).FzName))
}
- if (rc == SQLITE_OK) && ((*Fts5Config)(unsafe.Pointer(pConfig)).FeContent == FTS5_CONTENT_NORMAL) {
+ if rc == SQLITE_OK && (*Fts5Config)(unsafe.Pointer(pConfig)).FeContent == FTS5_CONTENT_NORMAL {
rc = fts5ExecPrintf(tls, (*Fts5Config)(unsafe.Pointer(pConfig)).Fdb, uintptr(0),
- ts+34796, /* "DROP TABLE IF EX..." */
+ ts+36156, /* "DROP TABLE IF EX..." */
libc.VaList(bp+64, (*Fts5Config)(unsafe.Pointer(pConfig)).FzDb, (*Fts5Config)(unsafe.Pointer(pConfig)).FzName))
}
return rc
}
-func fts5StorageRenameOne(tls *libc.TLS, pConfig uintptr, pRc uintptr, zTail uintptr, zName uintptr) { /* sqlite3.c:230925:13: */
+func fts5StorageRenameOne(tls *libc.TLS, pConfig uintptr, pRc uintptr, zTail uintptr, zName uintptr) { /* sqlite3.c:232832:13: */
bp := tls.Alloc(40)
defer tls.Free(40)
if *(*int32)(unsafe.Pointer(pRc)) == SQLITE_OK {
*(*int32)(unsafe.Pointer(pRc)) = fts5ExecPrintf(tls, (*Fts5Config)(unsafe.Pointer(pConfig)).Fdb, uintptr(0),
- ts+34834, /* "ALTER TABLE %Q.'..." */
+ ts+36194, /* "ALTER TABLE %Q.'..." */
libc.VaList(bp, (*Fts5Config)(unsafe.Pointer(pConfig)).FzDb, (*Fts5Config)(unsafe.Pointer(pConfig)).FzName, zTail, zName, zTail))
}
}
-func sqlite3Fts5StorageRename(tls *libc.TLS, pStorage uintptr, zName uintptr) int32 { /* sqlite3.c:230939:12: */
+func sqlite3Fts5StorageRename(tls *libc.TLS, pStorage uintptr, zName uintptr) int32 { /* sqlite3.c:232846:12: */
bp := tls.Alloc(4)
defer tls.Free(4)
var pConfig uintptr = (*Fts5Storage)(unsafe.Pointer(pStorage)).FpConfig
*(*int32)(unsafe.Pointer(bp /* rc */)) = sqlite3Fts5StorageSync(tls, pStorage)
- fts5StorageRenameOne(tls, pConfig, bp /* &rc */, ts+23316 /* "data" */, zName)
- fts5StorageRenameOne(tls, pConfig, bp /* &rc */, ts+10212 /* "idx" */, zName)
- fts5StorageRenameOne(tls, pConfig, bp /* &rc */, ts+34154 /* "config" */, zName)
+ fts5StorageRenameOne(tls, pConfig, bp /* &rc */, ts+24613 /* "data" */, zName)
+ fts5StorageRenameOne(tls, pConfig, bp /* &rc */, ts+11326 /* "idx" */, zName)
+ fts5StorageRenameOne(tls, pConfig, bp /* &rc */, ts+35514 /* "config" */, zName)
if (*Fts5Config)(unsafe.Pointer(pConfig)).FbColumnsize != 0 {
- fts5StorageRenameOne(tls, pConfig, bp /* &rc */, ts+32604 /* "docsize" */, zName)
+ fts5StorageRenameOne(tls, pConfig, bp /* &rc */, ts+33964 /* "docsize" */, zName)
}
if (*Fts5Config)(unsafe.Pointer(pConfig)).FeContent == FTS5_CONTENT_NORMAL {
- fts5StorageRenameOne(tls, pConfig, bp /* &rc */, ts+32253 /* "content" */, zName)
+ fts5StorageRenameOne(tls, pConfig, bp /* &rc */, ts+33613 /* "content" */, zName)
}
return *(*int32)(unsafe.Pointer(bp /* rc */))
}
// Create the shadow table named zPost, with definition zDefn. Return
// SQLITE_OK if successful, or an SQLite error code otherwise.
-func sqlite3Fts5CreateTable(tls *libc.TLS, pConfig uintptr, zPost uintptr, zDefn uintptr, bWithout int32, pzErr uintptr) int32 { /* sqlite3.c:230959:12: */
+func sqlite3Fts5CreateTable(tls *libc.TLS, pConfig uintptr, zPost uintptr, zDefn uintptr, bWithout int32, pzErr uintptr) int32 { /* sqlite3.c:232866:12: */
bp := tls.Alloc(68)
defer tls.Free(68)
var rc int32
*(*uintptr)(unsafe.Pointer(bp + 64 /* zErr */)) = uintptr(0)
- rc = fts5ExecPrintf(tls, (*Fts5Config)(unsafe.Pointer(pConfig)).Fdb, bp+64 /* &zErr */, ts+34876, /* "CREATE TABLE %Q...." */
+ rc = fts5ExecPrintf(tls, (*Fts5Config)(unsafe.Pointer(pConfig)).Fdb, bp+64 /* &zErr */, ts+36236, /* "CREATE TABLE %Q...." */
libc.VaList(bp, (*Fts5Config)(unsafe.Pointer(pConfig)).FzDb, (*Fts5Config)(unsafe.Pointer(pConfig)).FzName, zPost, zDefn,
func() uintptr {
if bWithout != 0 {
- return ts + 27931 /* " WITHOUT ROWID" */
+ return ts + 29266 /* " WITHOUT ROWID" */
}
- return ts + 755 /* "" */
+ return ts + 1543 /* "" */
}()))
- if *(*uintptr)(unsafe.Pointer(bp + 64 /* zErr */)) != 0 {
+ if *(*uintptr)(unsafe.Pointer(bp + 64)) != 0 {
*(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls,
- ts+34906, /* "fts5: error crea..." */
+ ts+36266, /* "fts5: error crea..." */
libc.VaList(bp+40, (*Fts5Config)(unsafe.Pointer(pConfig)).FzName, zPost, *(*uintptr)(unsafe.Pointer(bp + 64 /* zErr */))))
Xsqlite3_free(tls, *(*uintptr)(unsafe.Pointer(bp + 64 /* zErr */)))
}
@@ -186886,7 +189396,7 @@ func sqlite3Fts5CreateTable(tls *libc.TLS, pConfig uintptr, zPost uintptr, zDefn
//
// If successful, set *pp to point to the new object and return SQLITE_OK.
// Otherwise, set *pp to NULL and return an SQLite error code.
-func sqlite3Fts5StorageOpen(tls *libc.TLS, pConfig uintptr, pIndex uintptr, bCreate int32, pp uintptr, pzErr uintptr) int32 { /* sqlite3.c:230994:12: */
+func sqlite3Fts5StorageOpen(tls *libc.TLS, pConfig uintptr, pIndex uintptr, bCreate int32, pp uintptr, pzErr uintptr) int32 { /* sqlite3.c:232901:12: */
bp := tls.Alloc(8)
defer tls.Free(8)
@@ -186894,48 +189404,48 @@ func sqlite3Fts5StorageOpen(tls *libc.TLS, pConfig uintptr, pIndex uintptr, bCre
var p uintptr // New object
var nByte Sqlite3_int64 // Bytes of space to allocate
- nByte = (Sqlite3_int64(uint32(unsafe.Sizeof(Fts5Storage{})) + // Fts5Storage object
- (uint32((*Fts5Config)(unsafe.Pointer(pConfig)).FnCol) * uint32(unsafe.Sizeof(I64(0)))))) // Fts5Storage.aTotalSize[]
+ nByte = Sqlite3_int64(uint32(unsafe.Sizeof(Fts5Storage{})) +
+ uint32((*Fts5Config)(unsafe.Pointer(pConfig)).FnCol)*uint32(unsafe.Sizeof(I64(0)))) // Fts5Storage.aTotalSize[]
*(*uintptr)(unsafe.Pointer(pp)) = libc.AssignUintptr(&p, Xsqlite3_malloc64(tls, uint64(nByte)))
if !(p != 0) {
return SQLITE_NOMEM
}
libc.Xmemset(tls, p, 0, Size_t(nByte))
- (*Fts5Storage)(unsafe.Pointer(p)).FaTotalSize = (p + 1*72)
+ (*Fts5Storage)(unsafe.Pointer(p)).FaTotalSize = p + 1*72
(*Fts5Storage)(unsafe.Pointer(p)).FpConfig = pConfig
(*Fts5Storage)(unsafe.Pointer(p)).FpIndex = pIndex
if bCreate != 0 {
if (*Fts5Config)(unsafe.Pointer(pConfig)).FeContent == FTS5_CONTENT_NORMAL {
- var nDefn int32 = (32 + ((*Fts5Config)(unsafe.Pointer(pConfig)).FnCol * 10))
- var zDefn uintptr = Xsqlite3_malloc64(tls, (uint64(int64(32) + (Sqlite3_int64((*Fts5Config)(unsafe.Pointer(pConfig)).FnCol) * int64(10)))))
+ var nDefn int32 = 32 + (*Fts5Config)(unsafe.Pointer(pConfig)).FnCol*10
+ var zDefn uintptr = Xsqlite3_malloc64(tls, uint64(int64(32)+Sqlite3_int64((*Fts5Config)(unsafe.Pointer(pConfig)).FnCol)*int64(10)))
if zDefn == uintptr(0) {
rc = SQLITE_NOMEM
} else {
var i int32
var iOff int32
- Xsqlite3_snprintf(tls, nDefn, zDefn, ts+34950 /* "id INTEGER PRIMA..." */, 0)
+ Xsqlite3_snprintf(tls, nDefn, zDefn, ts+36310 /* "id INTEGER PRIMA..." */, 0)
iOff = int32(libc.Xstrlen(tls, zDefn))
for i = 0; i < (*Fts5Config)(unsafe.Pointer(pConfig)).FnCol; i++ {
- Xsqlite3_snprintf(tls, (nDefn - iOff), (zDefn + uintptr(iOff)), ts+34973 /* ", c%d" */, libc.VaList(bp, i))
- iOff = iOff + (int32(libc.Xstrlen(tls, (zDefn + uintptr(iOff)))))
+ Xsqlite3_snprintf(tls, nDefn-iOff, zDefn+uintptr(iOff), ts+36333 /* ", c%d" */, libc.VaList(bp, i))
+ iOff = iOff + int32(libc.Xstrlen(tls, zDefn+uintptr(iOff)))
}
- rc = sqlite3Fts5CreateTable(tls, pConfig, ts+32253 /* "content" */, zDefn, 0, pzErr)
+ rc = sqlite3Fts5CreateTable(tls, pConfig, ts+33613 /* "content" */, zDefn, 0, pzErr)
}
Xsqlite3_free(tls, zDefn)
}
- if (rc == SQLITE_OK) && ((*Fts5Config)(unsafe.Pointer(pConfig)).FbColumnsize != 0) {
+ if rc == SQLITE_OK && (*Fts5Config)(unsafe.Pointer(pConfig)).FbColumnsize != 0 {
rc = sqlite3Fts5CreateTable(tls,
- pConfig, ts+32604 /* "docsize" */, ts+34979 /* "id INTEGER PRIMA..." */, 0, pzErr)
+ pConfig, ts+33964 /* "docsize" */, ts+36339 /* "id INTEGER PRIMA..." */, 0, pzErr)
}
if rc == SQLITE_OK {
rc = sqlite3Fts5CreateTable(tls,
- pConfig, ts+34154 /* "config" */, ts+35011 /* "k PRIMARY KEY, v" */, 1, pzErr)
+ pConfig, ts+35514 /* "config" */, ts+36371 /* "k PRIMARY KEY, v" */, 1, pzErr)
}
if rc == SQLITE_OK {
- rc = sqlite3Fts5StorageConfigValue(tls, p, ts+32750 /* "version" */, uintptr(0), FTS5_CURRENT_VERSION)
+ rc = sqlite3Fts5StorageConfigValue(tls, p, ts+34110 /* "version" */, uintptr(0), FTS5_CURRENT_VERSION)
}
}
@@ -186947,14 +189457,14 @@ func sqlite3Fts5StorageOpen(tls *libc.TLS, pConfig uintptr, pIndex uintptr, bCre
}
// Close a handle opened by an earlier call to sqlite3Fts5StorageOpen().
-func sqlite3Fts5StorageClose(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:231060:12: */
+func sqlite3Fts5StorageClose(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:232967:12: */
var rc int32 = SQLITE_OK
if p != 0 {
var i int32
// Finalize all SQL statements
- for i = 0; i < (int32(uint32(unsafe.Sizeof([11]uintptr{})) / uint32(unsafe.Sizeof(uintptr(0))))); i++ {
- Xsqlite3_finalize(tls, *(*uintptr)(unsafe.Pointer((p + 28 /* &.aStmt */) + uintptr(i)*4)))
+ for i = 0; i < int32(uint32(unsafe.Sizeof([11]uintptr{}))/uint32(unsafe.Sizeof(uintptr(0)))); i++ {
+ Xsqlite3_finalize(tls, *(*uintptr)(unsafe.Pointer(p + 28 + uintptr(i)*4)))
}
Xsqlite3_free(tls, p)
@@ -186966,12 +189476,12 @@ type Fts5InsertCtx1 = struct {
FpStorage uintptr
FiCol int32
FszCol int32
-} /* sqlite3.c:231075:9 */
+} /* sqlite3.c:232982:9 */
-type Fts5InsertCtx = Fts5InsertCtx1 /* sqlite3.c:231075:30 */
+type Fts5InsertCtx = Fts5InsertCtx1 /* sqlite3.c:232982:30 */
// Tokenization callback used when inserting tokens into the FTS index.
-func fts5StorageInsertCallback(tls *libc.TLS, pContext uintptr, tflags int32, pToken uintptr, nToken int32, iUnused1 int32, iUnused2 int32) int32 { /* sqlite3.c:231085:12: */
+func fts5StorageInsertCallback(tls *libc.TLS, pContext uintptr, tflags int32, pToken uintptr, nToken int32, iUnused1 int32, iUnused2 int32) int32 { /* sqlite3.c:232992:12: */
var pCtx uintptr = pContext
var pIdx uintptr = (*Fts5Storage)(unsafe.Pointer((*Fts5InsertCtx)(unsafe.Pointer(pCtx)).FpStorage)).FpIndex
_ = iUnused1
@@ -186979,16 +189489,16 @@ func fts5StorageInsertCallback(tls *libc.TLS, pContext uintptr, tflags int32, pT
if nToken > FTS5_MAX_TOKEN_SIZE {
nToken = FTS5_MAX_TOKEN_SIZE
}
- if ((tflags & FTS5_TOKEN_COLOCATED) == 0) || ((*Fts5InsertCtx)(unsafe.Pointer(pCtx)).FszCol == 0) {
+ if tflags&FTS5_TOKEN_COLOCATED == 0 || (*Fts5InsertCtx)(unsafe.Pointer(pCtx)).FszCol == 0 {
(*Fts5InsertCtx)(unsafe.Pointer(pCtx)).FszCol++
}
- return sqlite3Fts5IndexWrite(tls, pIdx, (*Fts5InsertCtx)(unsafe.Pointer(pCtx)).FiCol, ((*Fts5InsertCtx)(unsafe.Pointer(pCtx)).FszCol - 1), pToken, nToken)
+ return sqlite3Fts5IndexWrite(tls, pIdx, (*Fts5InsertCtx)(unsafe.Pointer(pCtx)).FiCol, (*Fts5InsertCtx)(unsafe.Pointer(pCtx)).FszCol-1, pToken, nToken)
}
// If a row with rowid iDel is present in the %_content table, add the
// delete-markers to the FTS index necessary to delete it. Do not actually
// remove the %_content row at this time though.
-func fts5StorageDeleteFromIndex(tls *libc.TLS, p uintptr, iDel I64, apVal uintptr) int32 { /* sqlite3.c:231108:12: */
+func fts5StorageDeleteFromIndex(tls *libc.TLS, p uintptr, iDel I64, apVal uintptr) int32 { /* sqlite3.c:233015:12: */
bp := tls.Alloc(16)
defer tls.Free(16)
@@ -187005,7 +189515,7 @@ func fts5StorageDeleteFromIndex(tls *libc.TLS, p uintptr, iDel I64, apVal uintpt
return rc
}
Xsqlite3_bind_int64(tls, *(*uintptr)(unsafe.Pointer(bp /* pSeek */)), 1, iDel)
- if Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp /* pSeek */))) != SQLITE_ROW {
+ if Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp))) != SQLITE_ROW {
return Xsqlite3_reset(tls, *(*uintptr)(unsafe.Pointer(bp /* pSeek */)))
}
}
@@ -187013,30 +189523,33 @@ func fts5StorageDeleteFromIndex(tls *libc.TLS, p uintptr, iDel I64, apVal uintpt
(*Fts5InsertCtx)(unsafe.Pointer(bp + 4 /* &ctx */)).FpStorage = p
(*Fts5InsertCtx)(unsafe.Pointer(bp + 4 /* &ctx */)).FiCol = -1
rc = sqlite3Fts5IndexBeginWrite(tls, (*Fts5Storage)(unsafe.Pointer(p)).FpIndex, 1, iDel)
- for iCol = 1; (rc == SQLITE_OK) && (iCol <= (*Fts5Config)(unsafe.Pointer(pConfig)).FnCol); iCol++ {
- if int32(*(*U8)(unsafe.Pointer((*Fts5Config)(unsafe.Pointer(pConfig)).FabUnindexed + uintptr((iCol - 1))))) == 0 {
+ for iCol = 1; rc == SQLITE_OK && iCol <= (*Fts5Config)(unsafe.Pointer(pConfig)).FnCol; iCol++ {
+ if int32(*(*U8)(unsafe.Pointer((*Fts5Config)(unsafe.Pointer(pConfig)).FabUnindexed + uintptr(iCol-1)))) == 0 {
var zText uintptr
var nText int32
- if *(*uintptr)(unsafe.Pointer(bp /* pSeek */)) != 0 {
+
+ if *(*uintptr)(unsafe.Pointer(bp)) != 0 {
zText = Xsqlite3_column_text(tls, *(*uintptr)(unsafe.Pointer(bp /* pSeek */)), iCol)
nText = Xsqlite3_column_bytes(tls, *(*uintptr)(unsafe.Pointer(bp /* pSeek */)), iCol)
+ } else if apVal != 0 {
+ zText = Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(apVal + uintptr(iCol-1)*4)))
+ nText = Xsqlite3_value_bytes(tls, *(*uintptr)(unsafe.Pointer(apVal + uintptr(iCol-1)*4)))
} else {
- zText = Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(apVal + uintptr((iCol-1))*4)))
- nText = Xsqlite3_value_bytes(tls, *(*uintptr)(unsafe.Pointer(apVal + uintptr((iCol-1))*4)))
+ continue
}
(*Fts5InsertCtx)(unsafe.Pointer(bp + 4 /* &ctx */)).FszCol = 0
rc = sqlite3Fts5Tokenize(tls, pConfig, FTS5_TOKENIZE_DOCUMENT,
zText, nText, bp+4 /* &ctx */, *(*uintptr)(unsafe.Pointer(&struct {
f func(*libc.TLS, uintptr, int32, uintptr, int32, int32, int32) int32
}{fts5StorageInsertCallback})))
- *(*I64)(unsafe.Pointer((*Fts5Storage)(unsafe.Pointer(p)).FaTotalSize + uintptr((iCol-1))*8)) -= (I64((*Fts5InsertCtx)(unsafe.Pointer(bp + 4 /* &ctx */)).FszCol))
- if *(*I64)(unsafe.Pointer((*Fts5Storage)(unsafe.Pointer(p)).FaTotalSize + uintptr((iCol-1))*8)) < int64(0) {
- rc = (SQLITE_CORRUPT | (int32(1) << 8))
+ *(*I64)(unsafe.Pointer((*Fts5Storage)(unsafe.Pointer(p)).FaTotalSize + uintptr(iCol-1)*8)) -= I64((*Fts5InsertCtx)(unsafe.Pointer(bp + 4)).FszCol)
+ if *(*I64)(unsafe.Pointer((*Fts5Storage)(unsafe.Pointer(p)).FaTotalSize + uintptr(iCol-1)*8)) < int64(0) {
+ rc = SQLITE_CORRUPT | int32(1)<<8
}
}
}
- if (rc == SQLITE_OK) && ((*Fts5Storage)(unsafe.Pointer(p)).FnTotalRow < int64(1)) {
- rc = (SQLITE_CORRUPT | (int32(1) << 8))
+ if rc == SQLITE_OK && (*Fts5Storage)(unsafe.Pointer(p)).FnTotalRow < int64(1) {
+ rc = SQLITE_CORRUPT | int32(1)<<8
} else {
(*Fts5Storage)(unsafe.Pointer(p)).FnTotalRow--
}
@@ -187054,7 +189567,7 @@ func fts5StorageDeleteFromIndex(tls *libc.TLS, p uintptr, iDel I64, apVal uintpt
//
// If there is no %_docsize table (as happens if the columnsize=0 option
// is specified when the FTS5 table is created), this function is a no-op.
-func fts5StorageInsertDocsize(tls *libc.TLS, p uintptr, iRowid I64, pBuf uintptr) int32 { /* sqlite3.c:231173:12: */
+func fts5StorageInsertDocsize(tls *libc.TLS, p uintptr, iRowid I64, pBuf uintptr) int32 { /* sqlite3.c:233084:12: */
bp := tls.Alloc(4)
defer tls.Free(4)
@@ -187081,10 +189594,10 @@ func fts5StorageInsertDocsize(tls *libc.TLS, p uintptr, iRowid I64, pBuf uintptr
//
// Return SQLITE_OK if successful, or an SQLite error code if an error
// occurs.
-func fts5StorageLoadTotals(tls *libc.TLS, p uintptr, bCache int32) int32 { /* sqlite3.c:231203:12: */
+func fts5StorageLoadTotals(tls *libc.TLS, p uintptr, bCache int32) int32 { /* sqlite3.c:233114:12: */
var rc int32 = SQLITE_OK
if (*Fts5Storage)(unsafe.Pointer(p)).FbTotalsValid == 0 {
- rc = sqlite3Fts5IndexGetAverages(tls, (*Fts5Storage)(unsafe.Pointer(p)).FpIndex, (p + 16 /* &.nTotalRow */), (*Fts5Storage)(unsafe.Pointer(p)).FaTotalSize)
+ rc = sqlite3Fts5IndexGetAverages(tls, (*Fts5Storage)(unsafe.Pointer(p)).FpIndex, p+16, (*Fts5Storage)(unsafe.Pointer(p)).FaTotalSize)
(*Fts5Storage)(unsafe.Pointer(p)).FbTotalsValid = bCache
}
return rc
@@ -187095,7 +189608,7 @@ func fts5StorageLoadTotals(tls *libc.TLS, p uintptr, bCache int32) int32 { /* sq
//
// Return SQLITE_OK if successful, or an SQLite error code if an error
// occurs.
-func fts5StorageSaveTotals(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:231219:12: */
+func fts5StorageSaveTotals(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:233130:12: */
bp := tls.Alloc(16)
defer tls.Free(16)
@@ -187110,7 +189623,7 @@ func fts5StorageSaveTotals(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:231219
for i = 0; i < nCol; i++ {
sqlite3Fts5BufferAppendVarint(tls, bp+12 /* &rc */, bp /* &buf */, *(*I64)(unsafe.Pointer((*Fts5Storage)(unsafe.Pointer(p)).FaTotalSize + uintptr(i)*8)))
}
- if *(*int32)(unsafe.Pointer(bp + 12 /* rc */)) == SQLITE_OK {
+ if *(*int32)(unsafe.Pointer(bp + 12)) == SQLITE_OK {
*(*int32)(unsafe.Pointer(bp + 12 /* rc */)) = sqlite3Fts5IndexSetAverages(tls, (*Fts5Storage)(unsafe.Pointer(p)).FpIndex, (*Fts5Buffer)(unsafe.Pointer(bp /* &buf */)).Fp, (*Fts5Buffer)(unsafe.Pointer(bp /* &buf */)).Fn)
}
Xsqlite3_free(tls, (*Fts5Buffer)(unsafe.Pointer(bp /* &buf */)).Fp)
@@ -187119,7 +189632,7 @@ func fts5StorageSaveTotals(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:231219
}
// Remove a row from the FTS table.
-func sqlite3Fts5StorageDelete(tls *libc.TLS, p uintptr, iDel I64, apVal uintptr) int32 { /* sqlite3.c:231241:12: */
+func sqlite3Fts5StorageDelete(tls *libc.TLS, p uintptr, iDel I64, apVal uintptr) int32 { /* sqlite3.c:233152:12: */
bp := tls.Alloc(4)
defer tls.Free(4)
@@ -187135,7 +189648,7 @@ func sqlite3Fts5StorageDelete(tls *libc.TLS, p uintptr, iDel I64, apVal uintptr)
}
// Delete the %_docsize record
- if (rc == SQLITE_OK) && ((*Fts5Config)(unsafe.Pointer(pConfig)).FbColumnsize != 0) {
+ if rc == SQLITE_OK && (*Fts5Config)(unsafe.Pointer(pConfig)).FbColumnsize != 0 {
rc = fts5StorageGetStmt(tls, p, FTS5_STMT_DELETE_DOCSIZE, bp /* &pDel */, uintptr(0))
if rc == SQLITE_OK {
Xsqlite3_bind_int64(tls, *(*uintptr)(unsafe.Pointer(bp /* pDel */)), 1, iDel)
@@ -187160,7 +189673,7 @@ func sqlite3Fts5StorageDelete(tls *libc.TLS, p uintptr, iDel I64, apVal uintptr)
}
// Delete all entries in the FTS5 index.
-func sqlite3Fts5StorageDeleteAll(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:231282:12: */
+func sqlite3Fts5StorageDeleteAll(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:233193:12: */
bp := tls.Alloc(48)
defer tls.Free(48)
@@ -187172,12 +189685,12 @@ func sqlite3Fts5StorageDeleteAll(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:
// Delete the contents of the %_data and %_docsize tables.
rc = fts5ExecPrintf(tls, (*Fts5Config)(unsafe.Pointer(pConfig)).Fdb, uintptr(0),
- ts+35028, /* "DELETE FROM %Q.'..." */
+ ts+36388, /* "DELETE FROM %Q.'..." */
libc.VaList(bp, (*Fts5Config)(unsafe.Pointer(pConfig)).FzDb, (*Fts5Config)(unsafe.Pointer(pConfig)).FzName,
(*Fts5Config)(unsafe.Pointer(pConfig)).FzDb, (*Fts5Config)(unsafe.Pointer(pConfig)).FzName))
- if (rc == SQLITE_OK) && ((*Fts5Config)(unsafe.Pointer(pConfig)).FbColumnsize != 0) {
+ if rc == SQLITE_OK && (*Fts5Config)(unsafe.Pointer(pConfig)).FbColumnsize != 0 {
rc = fts5ExecPrintf(tls, (*Fts5Config)(unsafe.Pointer(pConfig)).Fdb, uintptr(0),
- ts+35078, /* "DELETE FROM %Q.'..." */
+ ts+36438, /* "DELETE FROM %Q.'..." */
libc.VaList(bp+32, (*Fts5Config)(unsafe.Pointer(pConfig)).FzDb, (*Fts5Config)(unsafe.Pointer(pConfig)).FzName))
}
@@ -187187,12 +189700,12 @@ func sqlite3Fts5StorageDeleteAll(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:
rc = sqlite3Fts5IndexReinit(tls, (*Fts5Storage)(unsafe.Pointer(p)).FpIndex)
}
if rc == SQLITE_OK {
- rc = sqlite3Fts5StorageConfigValue(tls, p, ts+32750 /* "version" */, uintptr(0), FTS5_CURRENT_VERSION)
+ rc = sqlite3Fts5StorageConfigValue(tls, p, ts+34110 /* "version" */, uintptr(0), FTS5_CURRENT_VERSION)
}
return rc
}
-func sqlite3Fts5StorageRebuild(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:231313:12: */
+func sqlite3Fts5StorageRebuild(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:233224:12: */
bp := tls.Alloc(32)
defer tls.Free(32)
@@ -187208,24 +189721,24 @@ func sqlite3Fts5StorageRebuild(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:23
libc.Xmemset(tls, bp /* &ctx */, 0, uint32(unsafe.Sizeof(Fts5InsertCtx{})))
(*Fts5InsertCtx)(unsafe.Pointer(bp /* &ctx */)).FpStorage = p
*(*int32)(unsafe.Pointer(bp + 28 /* rc */)) = sqlite3Fts5StorageDeleteAll(tls, p)
- if *(*int32)(unsafe.Pointer(bp + 28 /* rc */)) == SQLITE_OK {
+ if *(*int32)(unsafe.Pointer(bp + 28)) == SQLITE_OK {
*(*int32)(unsafe.Pointer(bp + 28 /* rc */)) = fts5StorageLoadTotals(tls, p, 1)
}
- if *(*int32)(unsafe.Pointer(bp + 28 /* rc */)) == SQLITE_OK {
+ if *(*int32)(unsafe.Pointer(bp + 28)) == SQLITE_OK {
*(*int32)(unsafe.Pointer(bp + 28 /* rc */)) = fts5StorageGetStmt(tls, p, FTS5_STMT_SCAN, bp+12 /* &pScan */, uintptr(0))
}
- for (*(*int32)(unsafe.Pointer(bp + 28 /* rc */)) == SQLITE_OK) && (SQLITE_ROW == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp + 12 /* pScan */)))) {
+ for *(*int32)(unsafe.Pointer(bp + 28)) == SQLITE_OK && SQLITE_ROW == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp + 12))) {
var iRowid I64 = Xsqlite3_column_int64(tls, *(*uintptr)(unsafe.Pointer(bp + 12 /* pScan */)), 0)
sqlite3Fts5BufferZero(tls, bp+16 /* &buf */)
*(*int32)(unsafe.Pointer(bp + 28 /* rc */)) = sqlite3Fts5IndexBeginWrite(tls, (*Fts5Storage)(unsafe.Pointer(p)).FpIndex, 0, iRowid)
- for (*Fts5InsertCtx)(unsafe.Pointer(bp /* &ctx */)).FiCol = 0; (*(*int32)(unsafe.Pointer(bp + 28 /* rc */)) == SQLITE_OK) && ((*Fts5InsertCtx)(unsafe.Pointer(bp /* &ctx */)).FiCol < (*Fts5Config)(unsafe.Pointer(pConfig)).FnCol); (*Fts5InsertCtx)(unsafe.Pointer(bp /* &ctx */)).FiCol++ {
+ for (*Fts5InsertCtx)(unsafe.Pointer(bp /* &ctx */)).FiCol = 0; *(*int32)(unsafe.Pointer(bp + 28 /* rc */)) == SQLITE_OK && (*Fts5InsertCtx)(unsafe.Pointer(bp /* &ctx */)).FiCol < (*Fts5Config)(unsafe.Pointer(pConfig)).FnCol; (*Fts5InsertCtx)(unsafe.Pointer(bp /* &ctx */)).FiCol++ {
(*Fts5InsertCtx)(unsafe.Pointer(bp /* &ctx */)).FszCol = 0
- if int32(*(*U8)(unsafe.Pointer((*Fts5Config)(unsafe.Pointer(pConfig)).FabUnindexed + uintptr((*Fts5InsertCtx)(unsafe.Pointer(bp /* &ctx */)).FiCol)))) == 0 {
- var zText uintptr = Xsqlite3_column_text(tls, *(*uintptr)(unsafe.Pointer(bp + 12 /* pScan */)), ((*Fts5InsertCtx)(unsafe.Pointer(bp /* &ctx */)).FiCol + 1))
- var nText int32 = Xsqlite3_column_bytes(tls, *(*uintptr)(unsafe.Pointer(bp + 12 /* pScan */)), ((*Fts5InsertCtx)(unsafe.Pointer(bp /* &ctx */)).FiCol + 1))
+ if int32(*(*U8)(unsafe.Pointer((*Fts5Config)(unsafe.Pointer(pConfig)).FabUnindexed + uintptr((*Fts5InsertCtx)(unsafe.Pointer(bp)).FiCol)))) == 0 {
+ var zText uintptr = Xsqlite3_column_text(tls, *(*uintptr)(unsafe.Pointer(bp + 12 /* pScan */)), (*Fts5InsertCtx)(unsafe.Pointer(bp)).FiCol+1)
+ var nText int32 = Xsqlite3_column_bytes(tls, *(*uintptr)(unsafe.Pointer(bp + 12 /* pScan */)), (*Fts5InsertCtx)(unsafe.Pointer(bp)).FiCol+1)
*(*int32)(unsafe.Pointer(bp + 28 /* rc */)) = sqlite3Fts5Tokenize(tls, pConfig,
FTS5_TOKENIZE_DOCUMENT,
zText, nText,
@@ -187235,36 +189748,36 @@ func sqlite3Fts5StorageRebuild(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:23
}{fts5StorageInsertCallback})))
}
sqlite3Fts5BufferAppendVarint(tls, bp+28 /* &rc */, bp+16 /* &buf */, int64((*Fts5InsertCtx)(unsafe.Pointer(bp /* &ctx */)).FszCol))
- *(*I64)(unsafe.Pointer((*Fts5Storage)(unsafe.Pointer(p)).FaTotalSize + uintptr((*Fts5InsertCtx)(unsafe.Pointer(bp /* &ctx */)).FiCol)*8)) += (I64((*Fts5InsertCtx)(unsafe.Pointer(bp /* &ctx */)).FszCol))
+ *(*I64)(unsafe.Pointer((*Fts5Storage)(unsafe.Pointer(p)).FaTotalSize + uintptr((*Fts5InsertCtx)(unsafe.Pointer(bp)).FiCol)*8)) += I64((*Fts5InsertCtx)(unsafe.Pointer(bp)).FszCol)
}
(*Fts5Storage)(unsafe.Pointer(p)).FnTotalRow++
- if *(*int32)(unsafe.Pointer(bp + 28 /* rc */)) == SQLITE_OK {
+ if *(*int32)(unsafe.Pointer(bp + 28)) == SQLITE_OK {
*(*int32)(unsafe.Pointer(bp + 28 /* rc */)) = fts5StorageInsertDocsize(tls, p, iRowid, bp+16 /* &buf */)
}
}
Xsqlite3_free(tls, (*Fts5Buffer)(unsafe.Pointer(bp+16 /* &buf */)).Fp)
rc2 = Xsqlite3_reset(tls, *(*uintptr)(unsafe.Pointer(bp + 12 /* pScan */)))
- if *(*int32)(unsafe.Pointer(bp + 28 /* rc */)) == SQLITE_OK {
+ if *(*int32)(unsafe.Pointer(bp + 28)) == SQLITE_OK {
*(*int32)(unsafe.Pointer(bp + 28 /* rc */)) = rc2
}
// Write the averages record
- if *(*int32)(unsafe.Pointer(bp + 28 /* rc */)) == SQLITE_OK {
+ if *(*int32)(unsafe.Pointer(bp + 28)) == SQLITE_OK {
*(*int32)(unsafe.Pointer(bp + 28 /* rc */)) = fts5StorageSaveTotals(tls, p)
}
return *(*int32)(unsafe.Pointer(bp + 28 /* rc */))
}
-func sqlite3Fts5StorageOptimize(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:231368:12: */
+func sqlite3Fts5StorageOptimize(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:233279:12: */
return sqlite3Fts5IndexOptimize(tls, (*Fts5Storage)(unsafe.Pointer(p)).FpIndex)
}
-func sqlite3Fts5StorageMerge(tls *libc.TLS, p uintptr, nMerge int32) int32 { /* sqlite3.c:231372:12: */
+func sqlite3Fts5StorageMerge(tls *libc.TLS, p uintptr, nMerge int32) int32 { /* sqlite3.c:233283:12: */
return sqlite3Fts5IndexMerge(tls, (*Fts5Storage)(unsafe.Pointer(p)).FpIndex, nMerge)
}
-func sqlite3Fts5StorageReset(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:231376:12: */
+func sqlite3Fts5StorageReset(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:233287:12: */
return sqlite3Fts5IndexReset(tls, (*Fts5Storage)(unsafe.Pointer(p)).FpIndex)
}
@@ -187275,7 +189788,7 @@ func sqlite3Fts5StorageReset(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:2313
//
// If the %_docsize table does not exist, SQLITE_MISMATCH is returned. In
// this case the user is required to provide a rowid explicitly.
-func fts5StorageNewRowid(tls *libc.TLS, p uintptr, piRowid uintptr) int32 { /* sqlite3.c:231389:12: */
+func fts5StorageNewRowid(tls *libc.TLS, p uintptr, piRowid uintptr) int32 { /* sqlite3.c:233300:12: */
bp := tls.Alloc(4)
defer tls.Free(4)
@@ -187297,7 +189810,7 @@ func fts5StorageNewRowid(tls *libc.TLS, p uintptr, piRowid uintptr) int32 { /* s
}
// Insert a new row into the FTS content table.
-func sqlite3Fts5StorageContentInsert(tls *libc.TLS, p uintptr, apVal uintptr, piRowid uintptr) int32 { /* sqlite3.c:231410:12: */
+func sqlite3Fts5StorageContentInsert(tls *libc.TLS, p uintptr, apVal uintptr, piRowid uintptr) int32 { /* sqlite3.c:233321:12: */
bp := tls.Alloc(4)
defer tls.Free(4)
@@ -187315,7 +189828,7 @@ func sqlite3Fts5StorageContentInsert(tls *libc.TLS, p uintptr, apVal uintptr, pi
*(*uintptr)(unsafe.Pointer(bp /* pInsert */)) = uintptr(0) // Statement to write %_content table
var i int32 // Counter variable
rc = fts5StorageGetStmt(tls, p, FTS5_STMT_INSERT_CONTENT, bp /* &pInsert */, uintptr(0))
- for i = 1; (rc == SQLITE_OK) && (i <= ((*Fts5Config)(unsafe.Pointer(pConfig)).FnCol + 1)); i++ {
+ for i = 1; rc == SQLITE_OK && i <= (*Fts5Config)(unsafe.Pointer(pConfig)).FnCol+1; i++ {
rc = Xsqlite3_bind_value(tls, *(*uintptr)(unsafe.Pointer(bp /* pInsert */)), i, *(*uintptr)(unsafe.Pointer(apVal + uintptr(i)*4)))
}
if rc == SQLITE_OK {
@@ -187329,7 +189842,7 @@ func sqlite3Fts5StorageContentInsert(tls *libc.TLS, p uintptr, apVal uintptr, pi
}
// Insert new entries into the FTS index and %_docsize table.
-func sqlite3Fts5StorageIndexInsert(tls *libc.TLS, p uintptr, apVal uintptr, iRowid I64) int32 { /* sqlite3.c:231445:12: */
+func sqlite3Fts5StorageIndexInsert(tls *libc.TLS, p uintptr, apVal uintptr, iRowid I64) int32 { /* sqlite3.c:233356:12: */
bp := tls.Alloc(28)
defer tls.Free(28)
@@ -187344,14 +189857,14 @@ func sqlite3Fts5StorageIndexInsert(tls *libc.TLS, p uintptr, apVal uintptr, iRow
(*Fts5InsertCtx)(unsafe.Pointer(bp + 12 /* &ctx */)).FpStorage = p
*(*int32)(unsafe.Pointer(bp + 24 /* rc */)) = fts5StorageLoadTotals(tls, p, 1)
- if *(*int32)(unsafe.Pointer(bp + 24 /* rc */)) == SQLITE_OK {
+ if *(*int32)(unsafe.Pointer(bp + 24)) == SQLITE_OK {
*(*int32)(unsafe.Pointer(bp + 24 /* rc */)) = sqlite3Fts5IndexBeginWrite(tls, (*Fts5Storage)(unsafe.Pointer(p)).FpIndex, 0, iRowid)
}
- for (*Fts5InsertCtx)(unsafe.Pointer(bp + 12 /* &ctx */)).FiCol = 0; (*(*int32)(unsafe.Pointer(bp + 24 /* rc */)) == SQLITE_OK) && ((*Fts5InsertCtx)(unsafe.Pointer(bp+12 /* &ctx */)).FiCol < (*Fts5Config)(unsafe.Pointer(pConfig)).FnCol); (*Fts5InsertCtx)(unsafe.Pointer(bp+12 /* &ctx */)).FiCol++ {
+ for (*Fts5InsertCtx)(unsafe.Pointer(bp + 12 /* &ctx */)).FiCol = 0; *(*int32)(unsafe.Pointer(bp + 24 /* rc */)) == SQLITE_OK && (*Fts5InsertCtx)(unsafe.Pointer(bp+12 /* &ctx */)).FiCol < (*Fts5Config)(unsafe.Pointer(pConfig)).FnCol; (*Fts5InsertCtx)(unsafe.Pointer(bp+12 /* &ctx */)).FiCol++ {
(*Fts5InsertCtx)(unsafe.Pointer(bp + 12 /* &ctx */)).FszCol = 0
- if int32(*(*U8)(unsafe.Pointer((*Fts5Config)(unsafe.Pointer(pConfig)).FabUnindexed + uintptr((*Fts5InsertCtx)(unsafe.Pointer(bp+12 /* &ctx */)).FiCol)))) == 0 {
- var zText uintptr = Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(apVal + uintptr(((*Fts5InsertCtx)(unsafe.Pointer(bp+12 /* &ctx */)).FiCol+2))*4)))
- var nText int32 = Xsqlite3_value_bytes(tls, *(*uintptr)(unsafe.Pointer(apVal + uintptr(((*Fts5InsertCtx)(unsafe.Pointer(bp+12 /* &ctx */)).FiCol+2))*4)))
+ if int32(*(*U8)(unsafe.Pointer((*Fts5Config)(unsafe.Pointer(pConfig)).FabUnindexed + uintptr((*Fts5InsertCtx)(unsafe.Pointer(bp+12)).FiCol)))) == 0 {
+ var zText uintptr = Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(apVal + uintptr((*Fts5InsertCtx)(unsafe.Pointer(bp+12)).FiCol+2)*4)))
+ var nText int32 = Xsqlite3_value_bytes(tls, *(*uintptr)(unsafe.Pointer(apVal + uintptr((*Fts5InsertCtx)(unsafe.Pointer(bp+12)).FiCol+2)*4)))
*(*int32)(unsafe.Pointer(bp + 24 /* rc */)) = sqlite3Fts5Tokenize(tls, pConfig,
FTS5_TOKENIZE_DOCUMENT,
zText, nText,
@@ -187361,12 +189874,12 @@ func sqlite3Fts5StorageIndexInsert(tls *libc.TLS, p uintptr, apVal uintptr, iRow
}{fts5StorageInsertCallback})))
}
sqlite3Fts5BufferAppendVarint(tls, bp+24 /* &rc */, bp /* &buf */, int64((*Fts5InsertCtx)(unsafe.Pointer(bp+12 /* &ctx */)).FszCol))
- *(*I64)(unsafe.Pointer((*Fts5Storage)(unsafe.Pointer(p)).FaTotalSize + uintptr((*Fts5InsertCtx)(unsafe.Pointer(bp+12 /* &ctx */)).FiCol)*8)) += (I64((*Fts5InsertCtx)(unsafe.Pointer(bp + 12 /* &ctx */)).FszCol))
+ *(*I64)(unsafe.Pointer((*Fts5Storage)(unsafe.Pointer(p)).FaTotalSize + uintptr((*Fts5InsertCtx)(unsafe.Pointer(bp+12)).FiCol)*8)) += I64((*Fts5InsertCtx)(unsafe.Pointer(bp + 12)).FszCol)
}
(*Fts5Storage)(unsafe.Pointer(p)).FnTotalRow++
// Write the %_docsize record
- if *(*int32)(unsafe.Pointer(bp + 24 /* rc */)) == SQLITE_OK {
+ if *(*int32)(unsafe.Pointer(bp + 24)) == SQLITE_OK {
*(*int32)(unsafe.Pointer(bp + 24 /* rc */)) = fts5StorageInsertDocsize(tls, p, iRowid, bp /* &buf */)
}
Xsqlite3_free(tls, (*Fts5Buffer)(unsafe.Pointer(bp /* &buf */)).Fp)
@@ -187374,7 +189887,7 @@ func sqlite3Fts5StorageIndexInsert(tls *libc.TLS, p uintptr, apVal uintptr, iRow
return *(*int32)(unsafe.Pointer(bp + 24 /* rc */))
}
-func fts5StorageCount(tls *libc.TLS, p uintptr, zSuffix uintptr, pnRow uintptr) int32 { /* sqlite3.c:231488:12: */
+func fts5StorageCount(tls *libc.TLS, p uintptr, zSuffix uintptr, pnRow uintptr) int32 { /* sqlite3.c:233399:12: */
bp := tls.Alloc(28)
defer tls.Free(28)
@@ -187382,7 +189895,7 @@ func fts5StorageCount(tls *libc.TLS, p uintptr, zSuffix uintptr, pnRow uintptr)
var zSql uintptr
var rc int32
- zSql = Xsqlite3_mprintf(tls, ts+35107, /* "SELECT count(*) ..." */
+ zSql = Xsqlite3_mprintf(tls, ts+36467, /* "SELECT count(*) ..." */
libc.VaList(bp, (*Fts5Config)(unsafe.Pointer(pConfig)).FzDb, (*Fts5Config)(unsafe.Pointer(pConfig)).FzName, zSuffix))
if zSql == uintptr(0) {
rc = SQLITE_NOMEM
@@ -187390,7 +189903,7 @@ func fts5StorageCount(tls *libc.TLS, p uintptr, zSuffix uintptr, pnRow uintptr)
*(*uintptr)(unsafe.Pointer(bp + 24 /* pCnt */)) = uintptr(0)
rc = Xsqlite3_prepare_v2(tls, (*Fts5Config)(unsafe.Pointer(pConfig)).Fdb, zSql, -1, bp+24 /* &pCnt */, uintptr(0))
if rc == SQLITE_OK {
- if SQLITE_ROW == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp + 24 /* pCnt */))) {
+ if SQLITE_ROW == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp + 24))) {
*(*I64)(unsafe.Pointer(pnRow)) = Xsqlite3_column_int64(tls, *(*uintptr)(unsafe.Pointer(bp + 24 /* pCnt */)), 0)
}
rc = Xsqlite3_finalize(tls, *(*uintptr)(unsafe.Pointer(bp + 24 /* pCnt */)))
@@ -187409,13 +189922,13 @@ type Fts5IntegrityCtx1 = struct {
Fcksum U64
FpTermset uintptr
FpConfig uintptr
-} /* sqlite3.c:231516:9 */
+} /* sqlite3.c:233427:9 */
// Context object used by sqlite3Fts5StorageIntegrity().
-type Fts5IntegrityCtx = Fts5IntegrityCtx1 /* sqlite3.c:231516:33 */
+type Fts5IntegrityCtx = Fts5IntegrityCtx1 /* sqlite3.c:233427:33 */
// Tokenization callback used by integrity check.
-func fts5StorageIntegrityCallback(tls *libc.TLS, pContext uintptr, tflags int32, pToken uintptr, nToken int32, iUnused1 int32, iUnused2 int32) int32 { /* sqlite3.c:231530:12: */
+func fts5StorageIntegrityCallback(tls *libc.TLS, pContext uintptr, tflags int32, pToken uintptr, nToken int32, iUnused1 int32, iUnused2 int32) int32 { /* sqlite3.c:233441:12: */
bp := tls.Alloc(4)
defer tls.Free(4)
@@ -187434,13 +189947,13 @@ func fts5StorageIntegrityCallback(tls *libc.TLS, pContext uintptr, tflags int32,
nToken = FTS5_MAX_TOKEN_SIZE
}
- if ((tflags & FTS5_TOKEN_COLOCATED) == 0) || ((*Fts5IntegrityCtx)(unsafe.Pointer(pCtx)).FszCol == 0) {
+ if tflags&FTS5_TOKEN_COLOCATED == 0 || (*Fts5IntegrityCtx)(unsafe.Pointer(pCtx)).FszCol == 0 {
(*Fts5IntegrityCtx)(unsafe.Pointer(pCtx)).FszCol++
}
switch (*Fts5Config)(unsafe.Pointer((*Fts5IntegrityCtx)(unsafe.Pointer(pCtx)).FpConfig)).FeDetail {
case FTS5_DETAIL_FULL:
- iPos = ((*Fts5IntegrityCtx)(unsafe.Pointer(pCtx)).FszCol - 1)
+ iPos = (*Fts5IntegrityCtx)(unsafe.Pointer(pCtx)).FszCol - 1
iCol = (*Fts5IntegrityCtx)(unsafe.Pointer(pCtx)).FiCol
break
@@ -187457,19 +189970,19 @@ func fts5StorageIntegrityCallback(tls *libc.TLS, pContext uintptr, tflags int32,
}
rc = sqlite3Fts5TermsetAdd(tls, pTermset, 0, pToken, nToken, bp /* &bPresent */)
- if (rc == SQLITE_OK) && (*(*int32)(unsafe.Pointer(bp /* bPresent */)) == 0) {
- *(*U64)(unsafe.Pointer(pCtx + 16 /* &.cksum */)) ^= (sqlite3Fts5IndexEntryCksum(tls,
- (*Fts5IntegrityCtx)(unsafe.Pointer(pCtx)).FiRowid, iCol, iPos, 0, pToken, nToken))
+ if rc == SQLITE_OK && *(*int32)(unsafe.Pointer(bp)) == 0 {
+ *(*U64)(unsafe.Pointer(pCtx + 16)) ^= sqlite3Fts5IndexEntryCksum(tls,
+ (*Fts5IntegrityCtx)(unsafe.Pointer(pCtx)).FiRowid, iCol, iPos, 0, pToken, nToken)
}
- for ii = 0; (rc == SQLITE_OK) && (ii < (*Fts5Config)(unsafe.Pointer((*Fts5IntegrityCtx)(unsafe.Pointer(pCtx)).FpConfig)).FnPrefix); ii++ {
+ for ii = 0; rc == SQLITE_OK && ii < (*Fts5Config)(unsafe.Pointer((*Fts5IntegrityCtx)(unsafe.Pointer(pCtx)).FpConfig)).FnPrefix; ii++ {
var nChar int32 = *(*int32)(unsafe.Pointer((*Fts5Config)(unsafe.Pointer((*Fts5IntegrityCtx)(unsafe.Pointer(pCtx)).FpConfig)).FaPrefix + uintptr(ii)*4))
var nByte int32 = sqlite3Fts5IndexCharlenToBytelen(tls, pToken, nToken, nChar)
if nByte != 0 {
- rc = sqlite3Fts5TermsetAdd(tls, pTermset, (ii + 1), pToken, nByte, bp /* &bPresent */)
- if *(*int32)(unsafe.Pointer(bp /* bPresent */)) == 0 {
- *(*U64)(unsafe.Pointer(pCtx + 16 /* &.cksum */)) ^= (sqlite3Fts5IndexEntryCksum(tls,
- (*Fts5IntegrityCtx)(unsafe.Pointer(pCtx)).FiRowid, iCol, iPos, (ii + 1), pToken, nByte))
+ rc = sqlite3Fts5TermsetAdd(tls, pTermset, ii+1, pToken, nByte, bp /* &bPresent */)
+ if *(*int32)(unsafe.Pointer(bp)) == 0 {
+ *(*U64)(unsafe.Pointer(pCtx + 16)) ^= sqlite3Fts5IndexEntryCksum(tls,
+ (*Fts5IntegrityCtx)(unsafe.Pointer(pCtx)).FiRowid, iCol, iPos, ii+1, pToken, nByte)
}
}
}
@@ -187481,7 +189994,7 @@ func fts5StorageIntegrityCallback(tls *libc.TLS, pContext uintptr, tflags int32,
// table. Return SQLITE_OK if they do, or SQLITE_CORRUPT if not. Return
// some other SQLite error code if an error occurs while attempting to
// determine this.
-func sqlite3Fts5StorageIntegrity(tls *libc.TLS, p uintptr, iArg int32) int32 { /* sqlite3.c:231600:12: */
+func sqlite3Fts5StorageIntegrity(tls *libc.TLS, p uintptr, iArg int32) int32 { /* sqlite3.c:233511:12: */
bp := tls.Alloc(56)
defer tls.Free(56)
@@ -187497,43 +190010,43 @@ func sqlite3Fts5StorageIntegrity(tls *libc.TLS, p uintptr, iArg int32) int32 { /
libc.Xmemset(tls, bp /* &ctx */, 0, uint32(unsafe.Sizeof(Fts5IntegrityCtx{})))
(*Fts5IntegrityCtx)(unsafe.Pointer(bp /* &ctx */)).FpConfig = (*Fts5Storage)(unsafe.Pointer(p)).FpConfig
- aTotalSize = Xsqlite3_malloc64(tls, (uint64(uint32((*Fts5Config)(unsafe.Pointer(pConfig)).FnCol) * (uint32(unsafe.Sizeof(int32(0))) + uint32(unsafe.Sizeof(I64(0)))))))
+ aTotalSize = Xsqlite3_malloc64(tls, uint64(uint32((*Fts5Config)(unsafe.Pointer(pConfig)).FnCol)*(uint32(unsafe.Sizeof(int32(0)))+uint32(unsafe.Sizeof(I64(0))))))
if !(aTotalSize != 0) {
return SQLITE_NOMEM
}
- aColSize = (aTotalSize + uintptr((*Fts5Config)(unsafe.Pointer(pConfig)).FnCol)*8)
- libc.Xmemset(tls, aTotalSize, 0, (uint32(unsafe.Sizeof(I64(0))) * uint32((*Fts5Config)(unsafe.Pointer(pConfig)).FnCol)))
+ aColSize = aTotalSize + uintptr((*Fts5Config)(unsafe.Pointer(pConfig)).FnCol)*8
+ libc.Xmemset(tls, aTotalSize, 0, uint32(unsafe.Sizeof(I64(0)))*uint32((*Fts5Config)(unsafe.Pointer(pConfig)).FnCol))
- bUseCksum = (libc.Bool32(((*Fts5Config)(unsafe.Pointer(pConfig)).FeContent == FTS5_CONTENT_NORMAL) ||
- (((*Fts5Config)(unsafe.Pointer(pConfig)).FeContent == FTS5_CONTENT_EXTERNAL) && (iArg != 0))))
+ bUseCksum = libc.Bool32((*Fts5Config)(unsafe.Pointer(pConfig)).FeContent == FTS5_CONTENT_NORMAL ||
+ (*Fts5Config)(unsafe.Pointer(pConfig)).FeContent == FTS5_CONTENT_EXTERNAL && iArg != 0)
if bUseCksum != 0 {
// Generate the expected index checksum based on the contents of the
// %_content table. This block stores the checksum in ctx.cksum.
rc = fts5StorageGetStmt(tls, p, FTS5_STMT_SCAN, bp+32 /* &pScan */, uintptr(0))
if rc == SQLITE_OK {
var rc2 int32
- for SQLITE_ROW == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp + 32 /* pScan */))) {
+ for SQLITE_ROW == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp + 32))) {
var i int32
(*Fts5IntegrityCtx)(unsafe.Pointer(bp /* &ctx */)).FiRowid = Xsqlite3_column_int64(tls, *(*uintptr)(unsafe.Pointer(bp + 32 /* pScan */)), 0)
(*Fts5IntegrityCtx)(unsafe.Pointer(bp /* &ctx */)).FszCol = 0
if (*Fts5Config)(unsafe.Pointer(pConfig)).FbColumnsize != 0 {
rc = sqlite3Fts5StorageDocsize(tls, p, (*Fts5IntegrityCtx)(unsafe.Pointer(bp /* &ctx */)).FiRowid, aColSize)
}
- if (rc == SQLITE_OK) && ((*Fts5Config)(unsafe.Pointer(pConfig)).FeDetail == FTS5_DETAIL_NONE) {
- rc = sqlite3Fts5TermsetNew(tls, (bp /* &ctx */ + 24 /* &.pTermset */))
+ if rc == SQLITE_OK && (*Fts5Config)(unsafe.Pointer(pConfig)).FeDetail == FTS5_DETAIL_NONE {
+ rc = sqlite3Fts5TermsetNew(tls, bp+24)
}
- for i = 0; (rc == SQLITE_OK) && (i < (*Fts5Config)(unsafe.Pointer(pConfig)).FnCol); i++ {
+ for i = 0; rc == SQLITE_OK && i < (*Fts5Config)(unsafe.Pointer(pConfig)).FnCol; i++ {
if *(*U8)(unsafe.Pointer((*Fts5Config)(unsafe.Pointer(pConfig)).FabUnindexed + uintptr(i))) != 0 {
continue
}
(*Fts5IntegrityCtx)(unsafe.Pointer(bp /* &ctx */)).FiCol = i
(*Fts5IntegrityCtx)(unsafe.Pointer(bp /* &ctx */)).FszCol = 0
if (*Fts5Config)(unsafe.Pointer(pConfig)).FeDetail == FTS5_DETAIL_COLUMNS {
- rc = sqlite3Fts5TermsetNew(tls, (bp /* &ctx */ + 24 /* &.pTermset */))
+ rc = sqlite3Fts5TermsetNew(tls, bp+24)
}
if rc == SQLITE_OK {
- var zText uintptr = Xsqlite3_column_text(tls, *(*uintptr)(unsafe.Pointer(bp + 32 /* pScan */)), (i + 1))
- var nText int32 = Xsqlite3_column_bytes(tls, *(*uintptr)(unsafe.Pointer(bp + 32 /* pScan */)), (i + 1))
+ var zText uintptr = Xsqlite3_column_text(tls, *(*uintptr)(unsafe.Pointer(bp + 32 /* pScan */)), i+1)
+ var nText int32 = Xsqlite3_column_bytes(tls, *(*uintptr)(unsafe.Pointer(bp + 32 /* pScan */)), i+1)
rc = sqlite3Fts5Tokenize(tls, pConfig,
FTS5_TOKENIZE_DOCUMENT,
zText, nText,
@@ -187542,10 +190055,10 @@ func sqlite3Fts5StorageIntegrity(tls *libc.TLS, p uintptr, iArg int32) int32 { /
f func(*libc.TLS, uintptr, int32, uintptr, int32, int32, int32) int32
}{fts5StorageIntegrityCallback})))
}
- if ((rc == SQLITE_OK) && ((*Fts5Config)(unsafe.Pointer(pConfig)).FbColumnsize != 0)) && ((*Fts5IntegrityCtx)(unsafe.Pointer(bp /* &ctx */)).FszCol != *(*int32)(unsafe.Pointer(aColSize + uintptr(i)*4))) {
- rc = (SQLITE_CORRUPT | (int32(1) << 8))
+ if rc == SQLITE_OK && (*Fts5Config)(unsafe.Pointer(pConfig)).FbColumnsize != 0 && (*Fts5IntegrityCtx)(unsafe.Pointer(bp)).FszCol != *(*int32)(unsafe.Pointer(aColSize + uintptr(i)*4)) {
+ rc = SQLITE_CORRUPT | int32(1)<<8
}
- *(*I64)(unsafe.Pointer(aTotalSize + uintptr(i)*8)) += (I64((*Fts5IntegrityCtx)(unsafe.Pointer(bp /* &ctx */)).FszCol))
+ *(*I64)(unsafe.Pointer(aTotalSize + uintptr(i)*8)) += I64((*Fts5IntegrityCtx)(unsafe.Pointer(bp)).FszCol)
if (*Fts5Config)(unsafe.Pointer(pConfig)).FeDetail == FTS5_DETAIL_COLUMNS {
sqlite3Fts5TermsetFree(tls, (*Fts5IntegrityCtx)(unsafe.Pointer(bp /* &ctx */)).FpTermset)
(*Fts5IntegrityCtx)(unsafe.Pointer(bp /* &ctx */)).FpTermset = uintptr(0)
@@ -187568,27 +190081,27 @@ func sqlite3Fts5StorageIntegrity(tls *libc.TLS, p uintptr, iArg int32) int32 { /
if rc == SQLITE_OK {
var i int32
rc = fts5StorageLoadTotals(tls, p, 0)
- for i = 0; (rc == SQLITE_OK) && (i < (*Fts5Config)(unsafe.Pointer(pConfig)).FnCol); i++ {
+ for i = 0; rc == SQLITE_OK && i < (*Fts5Config)(unsafe.Pointer(pConfig)).FnCol; i++ {
if *(*I64)(unsafe.Pointer((*Fts5Storage)(unsafe.Pointer(p)).FaTotalSize + uintptr(i)*8)) != *(*I64)(unsafe.Pointer(aTotalSize + uintptr(i)*8)) {
- rc = (SQLITE_CORRUPT | (int32(1) << 8))
+ rc = SQLITE_CORRUPT | int32(1)<<8
}
}
}
// Check that the %_docsize and %_content tables contain the expected
// number of rows.
- if (rc == SQLITE_OK) && ((*Fts5Config)(unsafe.Pointer(pConfig)).FeContent == FTS5_CONTENT_NORMAL) {
+ if rc == SQLITE_OK && (*Fts5Config)(unsafe.Pointer(pConfig)).FeContent == FTS5_CONTENT_NORMAL {
*(*I64)(unsafe.Pointer(bp + 40 /* nRow */)) = int64(0)
- rc = fts5StorageCount(tls, p, ts+32253 /* "content" */, bp+40 /* &nRow */)
- if (rc == SQLITE_OK) && (*(*I64)(unsafe.Pointer(bp + 40 /* nRow */)) != (*Fts5Storage)(unsafe.Pointer(p)).FnTotalRow) {
- rc = (SQLITE_CORRUPT | (int32(1) << 8))
+ rc = fts5StorageCount(tls, p, ts+33613 /* "content" */, bp+40 /* &nRow */)
+ if rc == SQLITE_OK && *(*I64)(unsafe.Pointer(bp + 40)) != (*Fts5Storage)(unsafe.Pointer(p)).FnTotalRow {
+ rc = SQLITE_CORRUPT | int32(1)<<8
}
}
- if (rc == SQLITE_OK) && ((*Fts5Config)(unsafe.Pointer(pConfig)).FbColumnsize != 0) {
+ if rc == SQLITE_OK && (*Fts5Config)(unsafe.Pointer(pConfig)).FbColumnsize != 0 {
*(*I64)(unsafe.Pointer(bp + 48 /* nRow */)) = int64(0)
- rc = fts5StorageCount(tls, p, ts+32604 /* "docsize" */, bp+48 /* &nRow */)
- if (rc == SQLITE_OK) && (*(*I64)(unsafe.Pointer(bp + 48 /* nRow */)) != (*Fts5Storage)(unsafe.Pointer(p)).FnTotalRow) {
- rc = (SQLITE_CORRUPT | (int32(1) << 8))
+ rc = fts5StorageCount(tls, p, ts+33964 /* "docsize" */, bp+48 /* &nRow */)
+ if rc == SQLITE_OK && *(*I64)(unsafe.Pointer(bp + 48)) != (*Fts5Storage)(unsafe.Pointer(p)).FnTotalRow {
+ rc = SQLITE_CORRUPT | int32(1)<<8
}
}
}
@@ -187606,13 +190119,13 @@ func sqlite3Fts5StorageIntegrity(tls *libc.TLS, p uintptr, iArg int32) int32 { /
// Obtain an SQLite statement handle that may be used to read data from the
// %_content table.
-func sqlite3Fts5StorageStmt(tls *libc.TLS, p uintptr, eStmt int32, pp uintptr, pzErrMsg uintptr) int32 { /* sqlite3.c:231708:12: */
+func sqlite3Fts5StorageStmt(tls *libc.TLS, p uintptr, eStmt int32, pp uintptr, pzErrMsg uintptr) int32 { /* sqlite3.c:233619:12: */
var rc int32
rc = fts5StorageGetStmt(tls, p, eStmt, pp, pzErrMsg)
if rc == SQLITE_OK {
- *(*uintptr)(unsafe.Pointer((p + 28 /* &.aStmt */) + uintptr(eStmt)*4)) = uintptr(0)
+ *(*uintptr)(unsafe.Pointer(p + 28 + uintptr(eStmt)*4)) = uintptr(0)
}
return rc
}
@@ -187620,26 +190133,26 @@ func sqlite3Fts5StorageStmt(tls *libc.TLS, p uintptr, eStmt int32, pp uintptr, p
// Release an SQLite statement handle obtained via an earlier call to
// sqlite3Fts5StorageStmt(). The eStmt parameter passed to this function
// must match that passed to the sqlite3Fts5StorageStmt() call.
-func sqlite3Fts5StorageStmtRelease(tls *libc.TLS, p uintptr, eStmt int32, pStmt uintptr) { /* sqlite3.c:231732:13: */
+func sqlite3Fts5StorageStmtRelease(tls *libc.TLS, p uintptr, eStmt int32, pStmt uintptr) { /* sqlite3.c:233643:13: */
- if *(*uintptr)(unsafe.Pointer((p + 28 /* &.aStmt */) + uintptr(eStmt)*4)) == uintptr(0) {
+ if *(*uintptr)(unsafe.Pointer(p + 28 + uintptr(eStmt)*4)) == uintptr(0) {
Xsqlite3_reset(tls, pStmt)
- *(*uintptr)(unsafe.Pointer((p + 28 /* &.aStmt */) + uintptr(eStmt)*4)) = pStmt
+ *(*uintptr)(unsafe.Pointer(p + 28 + uintptr(eStmt)*4)) = pStmt
} else {
Xsqlite3_finalize(tls, pStmt)
}
}
-func fts5StorageDecodeSizeArray(tls *libc.TLS, aCol uintptr, nCol int32, aBlob uintptr, nBlob int32) int32 { /* sqlite3.c:231749:12: */
+func fts5StorageDecodeSizeArray(tls *libc.TLS, aCol uintptr, nCol int32, aBlob uintptr, nBlob int32) int32 { /* sqlite3.c:233660:12: */
var i int32
var iOff int32 = 0
for i = 0; i < nCol; i++ {
if iOff >= nBlob {
return 1
}
- iOff = iOff + (sqlite3Fts5GetVarint32(tls, (aBlob + uintptr(iOff)), (aCol + uintptr(i)*4)))
+ iOff = iOff + sqlite3Fts5GetVarint32(tls, aBlob+uintptr(iOff), aCol+uintptr(i)*4)
}
- return (libc.Bool32(iOff != nBlob))
+ return libc.Bool32(iOff != nBlob)
}
// Argument aCol points to an array of integers containing one entry for
@@ -187648,7 +190161,7 @@ func fts5StorageDecodeSizeArray(tls *libc.TLS, aCol uintptr, nCol int32, aBlob u
//
// An SQLite error code is returned if an error occurs, or SQLITE_OK
// otherwise.
-func sqlite3Fts5StorageDocsize(tls *libc.TLS, p uintptr, iRowid I64, aCol uintptr) int32 { /* sqlite3.c:231770:12: */
+func sqlite3Fts5StorageDocsize(tls *libc.TLS, p uintptr, iRowid I64, aCol uintptr) int32 { /* sqlite3.c:233681:12: */
bp := tls.Alloc(4)
defer tls.Free(4)
@@ -187657,10 +190170,11 @@ func sqlite3Fts5StorageDocsize(tls *libc.TLS, p uintptr, iRowid I64, aCol uintpt
var rc int32 // Return Code
rc = fts5StorageGetStmt(tls, p, FTS5_STMT_LOOKUP_DOCSIZE, bp /* &pLookup */, uintptr(0))
- if rc == SQLITE_OK {
+ if *(*uintptr)(unsafe.Pointer(bp)) != 0 {
var bCorrupt int32 = 1
+
Xsqlite3_bind_int64(tls, *(*uintptr)(unsafe.Pointer(bp /* pLookup */)), 1, iRowid)
- if SQLITE_ROW == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp /* pLookup */))) {
+ if SQLITE_ROW == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp))) {
var aBlob uintptr = Xsqlite3_column_blob(tls, *(*uintptr)(unsafe.Pointer(bp /* pLookup */)), 0)
var nBlob int32 = Xsqlite3_column_bytes(tls, *(*uintptr)(unsafe.Pointer(bp /* pLookup */)), 0)
if 0 == fts5StorageDecodeSizeArray(tls, aCol, nCol, aBlob, nBlob) {
@@ -187668,22 +190182,24 @@ func sqlite3Fts5StorageDocsize(tls *libc.TLS, p uintptr, iRowid I64, aCol uintpt
}
}
rc = Xsqlite3_reset(tls, *(*uintptr)(unsafe.Pointer(bp /* pLookup */)))
- if (bCorrupt != 0) && (rc == SQLITE_OK) {
- rc = (SQLITE_CORRUPT | (int32(1) << 8))
+ if bCorrupt != 0 && rc == SQLITE_OK {
+ rc = SQLITE_CORRUPT | int32(1)<<8
}
+ } else {
+
}
return rc
}
-func sqlite3Fts5StorageSize(tls *libc.TLS, p uintptr, iCol int32, pnToken uintptr) int32 { /* sqlite3.c:231796:12: */
+func sqlite3Fts5StorageSize(tls *libc.TLS, p uintptr, iCol int32, pnToken uintptr) int32 { /* sqlite3.c:233710:12: */
var rc int32 = fts5StorageLoadTotals(tls, p, 0)
if rc == SQLITE_OK {
*(*I64)(unsafe.Pointer(pnToken)) = int64(0)
if iCol < 0 {
var i int32
for i = 0; i < (*Fts5Config)(unsafe.Pointer((*Fts5Storage)(unsafe.Pointer(p)).FpConfig)).FnCol; i++ {
- *(*I64)(unsafe.Pointer(pnToken)) += (*(*I64)(unsafe.Pointer((*Fts5Storage)(unsafe.Pointer(p)).FaTotalSize + uintptr(i)*8)))
+ *(*I64)(unsafe.Pointer(pnToken)) += *(*I64)(unsafe.Pointer((*Fts5Storage)(unsafe.Pointer(p)).FaTotalSize + uintptr(i)*8))
}
} else if iCol < (*Fts5Config)(unsafe.Pointer((*Fts5Storage)(unsafe.Pointer(p)).FpConfig)).FnCol {
*(*I64)(unsafe.Pointer(pnToken)) = *(*I64)(unsafe.Pointer((*Fts5Storage)(unsafe.Pointer(p)).FaTotalSize + uintptr(iCol)*8))
@@ -187694,7 +190210,7 @@ func sqlite3Fts5StorageSize(tls *libc.TLS, p uintptr, iCol int32, pnToken uintpt
return rc
}
-func sqlite3Fts5StorageRowCount(tls *libc.TLS, p uintptr, pnRow uintptr) int32 { /* sqlite3.c:231814:12: */
+func sqlite3Fts5StorageRowCount(tls *libc.TLS, p uintptr, pnRow uintptr) int32 { /* sqlite3.c:233728:12: */
var rc int32 = fts5StorageLoadTotals(tls, p, 0)
if rc == SQLITE_OK {
// nTotalRow being zero does not necessarily indicate a corrupt
@@ -187704,14 +190220,14 @@ func sqlite3Fts5StorageRowCount(tls *libc.TLS, p uintptr, pnRow uintptr) int32 {
// no rows. Hence the FTS5_CORRUPT return.
*(*I64)(unsafe.Pointer(pnRow)) = (*Fts5Storage)(unsafe.Pointer(p)).FnTotalRow
if (*Fts5Storage)(unsafe.Pointer(p)).FnTotalRow <= int64(0) {
- rc = (SQLITE_CORRUPT | (int32(1) << 8))
+ rc = SQLITE_CORRUPT | int32(1)<<8
}
}
return rc
}
// Flush any data currently held in-memory to disk.
-func sqlite3Fts5StorageSync(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:231831:12: */
+func sqlite3Fts5StorageSync(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:233745:12: */
var rc int32 = SQLITE_OK
var iLastRowid I64 = Xsqlite3_last_insert_rowid(tls, (*Fts5Config)(unsafe.Pointer((*Fts5Storage)(unsafe.Pointer(p)).FpConfig)).Fdb)
if (*Fts5Storage)(unsafe.Pointer(p)).FbTotalsValid != 0 {
@@ -187725,12 +190241,12 @@ func sqlite3Fts5StorageSync(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:23183
return rc
}
-func sqlite3Fts5StorageRollback(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:231845:12: */
+func sqlite3Fts5StorageRollback(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:233759:12: */
(*Fts5Storage)(unsafe.Pointer(p)).FbTotalsValid = 0
return sqlite3Fts5IndexRollback(tls, (*Fts5Storage)(unsafe.Pointer(p)).FpIndex)
}
-func sqlite3Fts5StorageConfigValue(tls *libc.TLS, p uintptr, z uintptr, pVal uintptr, iVal int32) int32 { /* sqlite3.c:231850:12: */
+func sqlite3Fts5StorageConfigValue(tls *libc.TLS, p uintptr, z uintptr, pVal uintptr, iVal int32) int32 { /* sqlite3.c:233764:12: */
bp := tls.Alloc(4)
defer tls.Free(4)
@@ -187747,8 +190263,8 @@ func sqlite3Fts5StorageConfigValue(tls *libc.TLS, p uintptr, z uintptr, pVal uin
rc = Xsqlite3_reset(tls, *(*uintptr)(unsafe.Pointer(bp /* pReplace */)))
Xsqlite3_bind_null(tls, *(*uintptr)(unsafe.Pointer(bp /* pReplace */)), 1)
}
- if (rc == SQLITE_OK) && (pVal != 0) {
- var iNew int32 = ((*Fts5Config)(unsafe.Pointer((*Fts5Storage)(unsafe.Pointer(p)).FpConfig)).FiCookie + 1)
+ if rc == SQLITE_OK && pVal != 0 {
+ var iNew int32 = (*Fts5Config)(unsafe.Pointer((*Fts5Storage)(unsafe.Pointer(p)).FpConfig)).FiCookie + 1
rc = sqlite3Fts5IndexSetCookie(tls, (*Fts5Storage)(unsafe.Pointer(p)).FpIndex, iNew)
if rc == SQLITE_OK {
(*Fts5Config)(unsafe.Pointer((*Fts5Storage)(unsafe.Pointer(p)).FpConfig)).FiCookie = iNew
@@ -187785,32 +190301,32 @@ var aAsciiTokenChar = [128]uint8{
uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), // 0x50..0x5F
uint8(0), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), // 0x60..0x6F
uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), // 0x70..0x7F
-} /* sqlite3.c:231903:22 */
+} /* sqlite3.c:233817:22 */
-type AsciiTokenizer1 = struct{ FaTokenChar [128]uint8 } /* sqlite3.c:231914:9 */
+type AsciiTokenizer1 = struct{ FaTokenChar [128]uint8 } /* sqlite3.c:233828:9 */
-type AsciiTokenizer = AsciiTokenizer1 /* sqlite3.c:231914:31 */
+type AsciiTokenizer = AsciiTokenizer1 /* sqlite3.c:233828:31 */
-func fts5AsciiAddExceptions(tls *libc.TLS, p uintptr, zArg uintptr, bTokenChars int32) { /* sqlite3.c:231919:13: */
+func fts5AsciiAddExceptions(tls *libc.TLS, p uintptr, zArg uintptr, bTokenChars int32) { /* sqlite3.c:233833:13: */
var i int32
for i = 0; *(*uint8)(unsafe.Pointer(zArg + uintptr(i))) != 0; i++ {
- if (int32(*(*uint8)(unsafe.Pointer(zArg + uintptr(i)))) & 0x80) == 0 {
- *(*uint8)(unsafe.Pointer((p /* &.aTokenChar */) + uintptr(int32(*(*uint8)(unsafe.Pointer(zArg + uintptr(i))))))) = uint8(bTokenChars)
+ if int32(*(*uint8)(unsafe.Pointer(zArg + uintptr(i))))&0x80 == 0 {
+ *(*uint8)(unsafe.Pointer(p + uintptr(int32(*(*uint8)(unsafe.Pointer(zArg + uintptr(i))))))) = uint8(bTokenChars)
}
}
}
// Delete a "ascii" tokenizer.
-func fts5AsciiDelete(tls *libc.TLS, p uintptr) { /* sqlite3.c:231935:13: */
+func fts5AsciiDelete(tls *libc.TLS, p uintptr) { /* sqlite3.c:233849:13: */
Xsqlite3_free(tls, p)
}
// Create an "ascii" tokenizer.
-func fts5AsciiCreate(tls *libc.TLS, pUnused uintptr, azArg uintptr, nArg int32, ppOut uintptr) int32 { /* sqlite3.c:231942:12: */
+func fts5AsciiCreate(tls *libc.TLS, pUnused uintptr, azArg uintptr, nArg int32, ppOut uintptr) int32 { /* sqlite3.c:233856:12: */
var rc int32 = SQLITE_OK
var p uintptr = uintptr(0)
_ = pUnused
- if (nArg % 2) != 0 {
+ if nArg%2 != 0 {
rc = SQLITE_ERROR
} else {
p = Xsqlite3_malloc(tls, int32(unsafe.Sizeof(AsciiTokenizer{})))
@@ -187819,12 +190335,12 @@ func fts5AsciiCreate(tls *libc.TLS, pUnused uintptr, azArg uintptr, nArg int32,
} else {
var i int32
libc.Xmemset(tls, p, 0, uint32(unsafe.Sizeof(AsciiTokenizer{})))
- libc.Xmemcpy(tls, p /* &.aTokenChar */, uintptr(unsafe.Pointer(&aAsciiTokenChar)), uint32(unsafe.Sizeof(aAsciiTokenChar)))
- for i = 0; (rc == SQLITE_OK) && (i < nArg); i = i + (2) {
- var zArg uintptr = *(*uintptr)(unsafe.Pointer(azArg + uintptr((i+1))*4))
- if 0 == Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(azArg + uintptr(i)*4)), ts+35139 /* "tokenchars" */) {
+ libc.Xmemcpy(tls, p, uintptr(unsafe.Pointer(&aAsciiTokenChar)), uint32(unsafe.Sizeof(aAsciiTokenChar)))
+ for i = 0; rc == SQLITE_OK && i < nArg; i = i + 2 {
+ var zArg uintptr = *(*uintptr)(unsafe.Pointer(azArg + uintptr(i+1)*4))
+ if 0 == Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(azArg + uintptr(i)*4)), ts+36499) {
fts5AsciiAddExceptions(tls, p, zArg, 1)
- } else if 0 == Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(azArg + uintptr(i)*4)), ts+35150 /* "separators" */) {
+ } else if 0 == Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(azArg + uintptr(i)*4)), ts+36510) {
fts5AsciiAddExceptions(tls, p, zArg, 0)
} else {
rc = SQLITE_ERROR
@@ -187841,19 +190357,19 @@ func fts5AsciiCreate(tls *libc.TLS, pUnused uintptr, azArg uintptr, nArg int32,
return rc
}
-func asciiFold(tls *libc.TLS, aOut uintptr, aIn uintptr, nByte int32) { /* sqlite3.c:231983:13: */
+func asciiFold(tls *libc.TLS, aOut uintptr, aIn uintptr, nByte int32) { /* sqlite3.c:233897:13: */
var i int32
for i = 0; i < nByte; i++ {
var c uint8 = *(*uint8)(unsafe.Pointer(aIn + uintptr(i)))
- if (int32(c) >= 'A') && (int32(c) <= 'Z') {
- c = uint8(int32(c) + (32))
+ if int32(c) >= 'A' && int32(c) <= 'Z' {
+ c = uint8(int32(c) + 32)
}
*(*uint8)(unsafe.Pointer(aOut + uintptr(i))) = c
}
}
// Tokenize some text using the ascii tokenizer.
-func fts5AsciiTokenize(tls *libc.TLS, pTokenizer uintptr, pCtx uintptr, iUnused int32, pText uintptr, nText int32, xToken uintptr) int32 { /* sqlite3.c:231995:12: */
+func fts5AsciiTokenize(tls *libc.TLS, pTokenizer uintptr, pCtx uintptr, iUnused int32, pText uintptr, nText int32, xToken uintptr) int32 { /* sqlite3.c:233909:12: */
bp := tls.Alloc(64)
defer tls.Free(64)
@@ -187869,11 +190385,11 @@ func fts5AsciiTokenize(tls *libc.TLS, pTokenizer uintptr, pCtx uintptr, iUnused
_ = iUnused
- for (is < nText) && (rc == SQLITE_OK) {
+ for is < nText && rc == SQLITE_OK {
var nByte int32
// Skip any leading divider characters.
- for (is < nText) && (((int32(*(*uint8)(unsafe.Pointer(pText + uintptr(is)))) & 0x80) == 0) && (int32(*(*uint8)(unsafe.Pointer(a + uintptr(int32(*(*uint8)(unsafe.Pointer(pText + uintptr(is)))))))) == 0)) {
+ for is < nText && (int32(*(*uint8)(unsafe.Pointer(pText + uintptr(is))))&0x80 == 0 && int32(*(*uint8)(unsafe.Pointer(a + uintptr(int32(*(*uint8)(unsafe.Pointer(pText + uintptr(is)))))))) == 0) {
is++
}
if is == nText {
@@ -187881,34 +190397,34 @@ func fts5AsciiTokenize(tls *libc.TLS, pTokenizer uintptr, pCtx uintptr, iUnused
}
// Count the token characters
- ie = (is + 1)
- for (ie < nText) && (((int32(*(*uint8)(unsafe.Pointer(pText + uintptr(ie)))) & 0x80) != 0) || (*(*uint8)(unsafe.Pointer(a + uintptr(int32(*(*uint8)(unsafe.Pointer(pText + uintptr(ie))))))) != 0)) {
+ ie = is + 1
+ for ie < nText && (int32(*(*uint8)(unsafe.Pointer(pText + uintptr(ie))))&0x80 != 0 || *(*uint8)(unsafe.Pointer(a + uintptr(int32(*(*uint8)(unsafe.Pointer(pText + uintptr(ie))))))) != 0) {
ie++
}
// Fold to lower case
- nByte = (ie - is)
+ nByte = ie - is
if nByte > nFold {
- if pFold != bp /* aFold */ {
+ if pFold != bp {
Xsqlite3_free(tls, pFold)
}
- pFold = Xsqlite3_malloc64(tls, (uint64(Sqlite3_int64(nByte) * int64(2))))
+ pFold = Xsqlite3_malloc64(tls, uint64(Sqlite3_int64(nByte)*int64(2)))
if pFold == uintptr(0) {
rc = SQLITE_NOMEM
break
}
- nFold = (nByte * 2)
+ nFold = nByte * 2
}
- asciiFold(tls, pFold, (pText + uintptr(is)), nByte)
+ asciiFold(tls, pFold, pText+uintptr(is), nByte)
// Invoke the token callback
rc = (*struct {
f func(*libc.TLS, uintptr, int32, uintptr, int32, int32, int32) int32
})(unsafe.Pointer(&struct{ uintptr }{xToken})).f(tls, pCtx, 0, pFold, nByte, is, ie)
- is = (ie + 1)
+ is = ie + 1
}
- if pFold != bp /* aFold */ {
+ if pFold != bp {
Xsqlite3_free(tls, pFold)
}
if rc == SQLITE_DONE {
@@ -187933,7 +190449,7 @@ type Unicode61Tokenizer1 = struct {
FnException int32
FaiException uintptr
FaCategory [32]uint8
-} /* sqlite3.c:232110:9 */
+} /* sqlite3.c:234024:9 */
// *************************************************************************
//
@@ -187943,49 +190459,49 @@ type Unicode61Tokenizer1 = struct {
// from the sqlite3 source file utf.c. If this file is compiled as part
// of the amalgamation, they are not required.
-type Unicode61Tokenizer = Unicode61Tokenizer1 /* sqlite3.c:232110:35 */
+type Unicode61Tokenizer = Unicode61Tokenizer1 /* sqlite3.c:234024:35 */
// Values for eRemoveDiacritic (must match internals of fts5_unicode2.c)
-func fts5UnicodeAddExceptions(tls *libc.TLS, p uintptr, z uintptr, bTokenChars int32) int32 { /* sqlite3.c:232127:12: */
+func fts5UnicodeAddExceptions(tls *libc.TLS, p uintptr, z uintptr, bTokenChars int32) int32 { /* sqlite3.c:234041:12: */
var rc int32 = SQLITE_OK
var n int32 = int32(libc.Xstrlen(tls, z))
var aNew uintptr
if n > 0 {
aNew = Xsqlite3_realloc64(tls, (*Unicode61Tokenizer)(unsafe.Pointer(p)).FaiException,
- (uint64((uint32(n + (*Unicode61Tokenizer)(unsafe.Pointer(p)).FnException)) * uint32(unsafe.Sizeof(int32(0))))))
+ uint64(uint32(n+(*Unicode61Tokenizer)(unsafe.Pointer(p)).FnException)*uint32(unsafe.Sizeof(int32(0)))))
if aNew != 0 {
var nNew int32 = (*Unicode61Tokenizer)(unsafe.Pointer(p)).FnException
var zCsr uintptr = z
- var zTerm uintptr = (z + uintptr(n))
+ var zTerm uintptr = z + uintptr(n)
for zCsr < zTerm {
var iCode U32
var bToken int32
iCode = U32(*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&zCsr, 1))))
if iCode >= U32(0xc0) {
- iCode = U32(sqlite3Utf8Trans1[(iCode - U32(0xc0))])
- for (zCsr != zTerm) && ((int32(*(*uint8)(unsafe.Pointer(zCsr))) & 0xc0) == 0x80) {
- iCode = ((iCode << 6) + (U32(0x3f & int32(*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&zCsr, 1)))))))
+ iCode = U32(sqlite3Utf8Trans1[iCode-U32(0xc0)])
+ for zCsr != zTerm && int32(*(*uint8)(unsafe.Pointer(zCsr)))&0xc0 == 0x80 {
+ iCode = iCode<<6 + U32(0x3f&int32(*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&zCsr, 1)))))
}
- if ((iCode < U32(0x80)) || ((iCode & 0xFFFFF800) == U32(0xD800))) || ((iCode & 0xFFFFFFFE) == U32(0xFFFE)) {
+ if iCode < U32(0x80) || iCode&0xFFFFF800 == U32(0xD800) || iCode&0xFFFFFFFE == U32(0xFFFE) {
iCode = U32(0xFFFD)
}
}
if iCode < U32(128) {
- *(*uint8)(unsafe.Pointer((p /* &.aTokenChar */) + uintptr(iCode))) = uint8(bTokenChars)
+ *(*uint8)(unsafe.Pointer(p + uintptr(iCode))) = uint8(bTokenChars)
} else {
- bToken = int32(*(*uint8)(unsafe.Pointer((p + 148 /* &.aCategory */) + uintptr(sqlite3Fts5UnicodeCategory(tls, iCode)))))
+ bToken = int32(*(*uint8)(unsafe.Pointer(p + 148 + uintptr(sqlite3Fts5UnicodeCategory(tls, iCode)))))
- if (bToken != bTokenChars) && (sqlite3Fts5UnicodeIsdiacritic(tls, int32(iCode)) == 0) {
+ if bToken != bTokenChars && sqlite3Fts5UnicodeIsdiacritic(tls, int32(iCode)) == 0 {
var i int32
for i = 0; i < nNew; i++ {
if U32(*(*int32)(unsafe.Pointer(aNew + uintptr(i)*4))) > iCode {
break
}
}
- libc.Xmemmove(tls, (aNew + uintptr((i+1))*4), (aNew + uintptr(i)*4), ((uint32(nNew - i)) * uint32(unsafe.Sizeof(int32(0)))))
+ libc.Xmemmove(tls, aNew+uintptr(i+1)*4, aNew+uintptr(i)*4, uint32(nNew-i)*uint32(unsafe.Sizeof(int32(0))))
*(*int32)(unsafe.Pointer(aNew + uintptr(i)*4)) = int32(iCode)
nNew++
}
@@ -188002,20 +190518,20 @@ func fts5UnicodeAddExceptions(tls *libc.TLS, p uintptr, z uintptr, bTokenChars i
}
// Return true if the p->aiException[] array contains the value iCode.
-func fts5UnicodeIsException(tls *libc.TLS, p uintptr, iCode int32) int32 { /* sqlite3.c:232177:12: */
+func fts5UnicodeIsException(tls *libc.TLS, p uintptr, iCode int32) int32 { /* sqlite3.c:234091:12: */
if (*Unicode61Tokenizer)(unsafe.Pointer(p)).FnException > 0 {
var a uintptr = (*Unicode61Tokenizer)(unsafe.Pointer(p)).FaiException
var iLo int32 = 0
- var iHi int32 = ((*Unicode61Tokenizer)(unsafe.Pointer(p)).FnException - 1)
+ var iHi int32 = (*Unicode61Tokenizer)(unsafe.Pointer(p)).FnException - 1
for iHi >= iLo {
- var iTest int32 = ((iHi + iLo) / 2)
+ var iTest int32 = (iHi + iLo) / 2
if iCode == *(*int32)(unsafe.Pointer(a + uintptr(iTest)*4)) {
return 1
} else if iCode > *(*int32)(unsafe.Pointer(a + uintptr(iTest)*4)) {
- iLo = (iTest + 1)
+ iLo = iTest + 1
} else {
- iHi = (iTest - 1)
+ iHi = iTest - 1
}
}
}
@@ -188024,7 +190540,7 @@ func fts5UnicodeIsException(tls *libc.TLS, p uintptr, iCode int32) int32 { /* sq
}
// Delete a "unicode61" tokenizer.
-func fts5UnicodeDelete(tls *libc.TLS, pTok uintptr) { /* sqlite3.c:232201:13: */
+func fts5UnicodeDelete(tls *libc.TLS, pTok uintptr) { /* sqlite3.c:234115:13: */
if pTok != 0 {
var p uintptr = pTok
Xsqlite3_free(tls, (*Unicode61Tokenizer)(unsafe.Pointer(p)).FaiException)
@@ -188034,52 +190550,52 @@ func fts5UnicodeDelete(tls *libc.TLS, pTok uintptr) { /* sqlite3.c:232201:13: */
return
}
-func unicodeSetCategories(tls *libc.TLS, p uintptr, zCat uintptr) int32 { /* sqlite3.c:232211:12: */
+func unicodeSetCategories(tls *libc.TLS, p uintptr, zCat uintptr) int32 { /* sqlite3.c:234125:12: */
var z uintptr = zCat
for *(*uint8)(unsafe.Pointer(z)) != 0 {
- for (int32(*(*uint8)(unsafe.Pointer(z))) == ' ') || (int32(*(*uint8)(unsafe.Pointer(z))) == '\t') {
+ for int32(*(*uint8)(unsafe.Pointer(z))) == ' ' || int32(*(*uint8)(unsafe.Pointer(z))) == '\t' {
z++
}
- if (*(*uint8)(unsafe.Pointer(z)) != 0) && (sqlite3Fts5UnicodeCatParse(tls, z, p+148 /* &.aCategory */) != 0) {
+ if *(*uint8)(unsafe.Pointer(z)) != 0 && sqlite3Fts5UnicodeCatParse(tls, z, p+148) != 0 {
return SQLITE_ERROR
}
- for ((int32(*(*uint8)(unsafe.Pointer(z))) != ' ') && (int32(*(*uint8)(unsafe.Pointer(z))) != '\t')) && (int32(*(*uint8)(unsafe.Pointer(z))) != 0) {
+ for int32(*(*uint8)(unsafe.Pointer(z))) != ' ' && int32(*(*uint8)(unsafe.Pointer(z))) != '\t' && int32(*(*uint8)(unsafe.Pointer(z))) != 0 {
z++
}
}
- sqlite3Fts5UnicodeAscii(tls, p+148 /* &.aCategory */, p /* &.aTokenChar */)
+ sqlite3Fts5UnicodeAscii(tls, p+148, p)
return SQLITE_OK
}
// Create a "unicode61" tokenizer.
-func fts5UnicodeCreate(tls *libc.TLS, pUnused uintptr, azArg uintptr, nArg int32, ppOut uintptr) int32 { /* sqlite3.c:232229:12: */
+func fts5UnicodeCreate(tls *libc.TLS, pUnused uintptr, azArg uintptr, nArg int32, ppOut uintptr) int32 { /* sqlite3.c:234143:12: */
var rc int32 = SQLITE_OK // Return code
var p uintptr = uintptr(0) // New tokenizer object
_ = pUnused
- if (nArg % 2) != 0 {
+ if nArg%2 != 0 {
rc = SQLITE_ERROR
} else {
p = Xsqlite3_malloc(tls, int32(unsafe.Sizeof(Unicode61Tokenizer{})))
if p != 0 {
- var zCat uintptr = ts + 35161 /* "L* N* Co" */
+ var zCat uintptr = ts + 36521 /* "L* N* Co" */
var i int32
libc.Xmemset(tls, p, 0, uint32(unsafe.Sizeof(Unicode61Tokenizer{})))
(*Unicode61Tokenizer)(unsafe.Pointer(p)).FeRemoveDiacritic = FTS5_REMOVE_DIACRITICS_SIMPLE
(*Unicode61Tokenizer)(unsafe.Pointer(p)).FnFold = 64
- (*Unicode61Tokenizer)(unsafe.Pointer(p)).FaFold = Xsqlite3_malloc64(tls, (uint64(uint32((*Unicode61Tokenizer)(unsafe.Pointer(p)).FnFold) * uint32(unsafe.Sizeof(uint8(0))))))
+ (*Unicode61Tokenizer)(unsafe.Pointer(p)).FaFold = Xsqlite3_malloc64(tls, uint64(uint32((*Unicode61Tokenizer)(unsafe.Pointer(p)).FnFold)*uint32(unsafe.Sizeof(uint8(0)))))
if (*Unicode61Tokenizer)(unsafe.Pointer(p)).FaFold == uintptr(0) {
rc = SQLITE_NOMEM
}
// Search for a "categories" argument
- for i = 0; (rc == SQLITE_OK) && (i < nArg); i = i + (2) {
- if 0 == Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(azArg + uintptr(i)*4)), ts+35170 /* "categories" */) {
- zCat = *(*uintptr)(unsafe.Pointer(azArg + uintptr((i+1))*4))
+ for i = 0; rc == SQLITE_OK && i < nArg; i = i + 2 {
+ if 0 == Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(azArg + uintptr(i)*4)), ts+36530) {
+ zCat = *(*uintptr)(unsafe.Pointer(azArg + uintptr(i+1)*4))
}
}
@@ -188087,20 +190603,20 @@ func fts5UnicodeCreate(tls *libc.TLS, pUnused uintptr, azArg uintptr, nArg int32
rc = unicodeSetCategories(tls, p, zCat)
}
- for i = 0; (rc == SQLITE_OK) && (i < nArg); i = i + (2) {
- var zArg uintptr = *(*uintptr)(unsafe.Pointer(azArg + uintptr((i+1))*4))
- if 0 == Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(azArg + uintptr(i)*4)), ts+35181 /* "remove_diacritic..." */) {
- if (((int32(*(*uint8)(unsafe.Pointer(zArg))) != '0') && (int32(*(*uint8)(unsafe.Pointer(zArg))) != '1')) && (int32(*(*uint8)(unsafe.Pointer(zArg))) != '2')) || (*(*uint8)(unsafe.Pointer(zArg + 1)) != 0) {
+ for i = 0; rc == SQLITE_OK && i < nArg; i = i + 2 {
+ var zArg uintptr = *(*uintptr)(unsafe.Pointer(azArg + uintptr(i+1)*4))
+ if 0 == Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(azArg + uintptr(i)*4)), ts+36541) {
+ if int32(*(*uint8)(unsafe.Pointer(zArg))) != '0' && int32(*(*uint8)(unsafe.Pointer(zArg))) != '1' && int32(*(*uint8)(unsafe.Pointer(zArg))) != '2' || *(*uint8)(unsafe.Pointer(zArg + 1)) != 0 {
rc = SQLITE_ERROR
} else {
- (*Unicode61Tokenizer)(unsafe.Pointer(p)).FeRemoveDiacritic = (int32(*(*uint8)(unsafe.Pointer(zArg))) - '0')
+ (*Unicode61Tokenizer)(unsafe.Pointer(p)).FeRemoveDiacritic = int32(*(*uint8)(unsafe.Pointer(zArg))) - '0'
}
- } else if 0 == Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(azArg + uintptr(i)*4)), ts+35139 /* "tokenchars" */) {
+ } else if 0 == Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(azArg + uintptr(i)*4)), ts+36499) {
rc = fts5UnicodeAddExceptions(tls, p, zArg, 1)
- } else if 0 == Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(azArg + uintptr(i)*4)), ts+35150 /* "separators" */) {
+ } else if 0 == Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(azArg + uintptr(i)*4)), ts+36510) {
rc = fts5UnicodeAddExceptions(tls, p, zArg, 0)
- } else if 0 == Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(azArg + uintptr(i)*4)), ts+35170 /* "categories" */) {
+ } else if 0 == Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(azArg + uintptr(i)*4)), ts+36530) {
// no-op
} else {
rc = SQLITE_ERROR
@@ -188122,12 +190638,12 @@ func fts5UnicodeCreate(tls *libc.TLS, pUnused uintptr, azArg uintptr, nArg int32
// Return true if, for the purposes of tokenizing with the tokenizer
// passed as the first argument, codepoint iCode is considered a token
// character (not a separator).
-func fts5UnicodeIsAlnum(tls *libc.TLS, p uintptr, iCode int32) int32 { /* sqlite3.c:232309:12: */
- return (int32(*(*uint8)(unsafe.Pointer((p + 148 /* &.aCategory */) + uintptr(sqlite3Fts5UnicodeCategory(tls, U32(iCode)))))) ^
- fts5UnicodeIsException(tls, p, iCode))
+func fts5UnicodeIsAlnum(tls *libc.TLS, p uintptr, iCode int32) int32 { /* sqlite3.c:234223:12: */
+ return int32(*(*uint8)(unsafe.Pointer(p + 148 + uintptr(sqlite3Fts5UnicodeCategory(tls, U32(iCode)))))) ^
+ fts5UnicodeIsException(tls, p, iCode)
}
-func fts5UnicodeTokenize(tls *libc.TLS, pTokenizer uintptr, pCtx uintptr, iUnused int32, pText uintptr, nText int32, xToken uintptr) int32 { /* sqlite3.c:232316:12: */
+func fts5UnicodeTokenize(tls *libc.TLS, pTokenizer uintptr, pCtx uintptr, iUnused int32, pText uintptr, nText int32, xToken uintptr) int32 { /* sqlite3.c:234230:12: */
var p uintptr
var rc int32
var a uintptr
@@ -188145,11 +190661,11 @@ func fts5UnicodeTokenize(tls *libc.TLS, pTokenizer uintptr, pCtx uintptr, iUnuse
p = pTokenizer
rc = SQLITE_OK
a = p /* &.aTokenChar */
- zTerm = (pText + uintptr(nText))
+ zTerm = pText + uintptr(nText)
zCsr = pText
aFold = (*Unicode61Tokenizer)(unsafe.Pointer(p)).FaFold
nFold = (*Unicode61Tokenizer)(unsafe.Pointer(p)).FnFold
- pEnd = (aFold + uintptr((nFold - 6)))
+ pEnd = aFold + uintptr(nFold-6)
_ = iUnused
@@ -188172,26 +190688,26 @@ __3:
goto tokenize_done
__5:
;
- if !((int32(*(*uint8)(unsafe.Pointer(zCsr))) & 0x80) != 0) {
+ if !(int32(*(*uint8)(unsafe.Pointer(zCsr)))&0x80 != 0) {
goto __6
}
// A character outside of the ascii range. Skip past it if it is
// a separator character. Or break out of the loop if it is not.
- is = ((int32(zCsr) - int32(pText)) / 1)
+ is = (int32(zCsr) - int32(pText)) / 1
iCode = U32(*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&zCsr, 1))))
if !(iCode >= U32(0xc0)) {
goto __8
}
- iCode = U32(sqlite3Utf8Trans1[(iCode - U32(0xc0))])
+ iCode = U32(sqlite3Utf8Trans1[iCode-U32(0xc0)])
__9:
- if !((zCsr != zTerm) && ((int32(*(*uint8)(unsafe.Pointer(zCsr))) & 0xc0) == 0x80)) {
+ if !(zCsr != zTerm && int32(*(*uint8)(unsafe.Pointer(zCsr)))&0xc0 == 0x80) {
goto __10
}
- iCode = ((iCode << 6) + (U32(0x3f & int32(*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&zCsr, 1)))))))
+ iCode = iCode<<6 + U32(0x3f&int32(*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&zCsr, 1)))))
goto __9
__10:
;
- if !(((iCode < U32(0x80)) || ((iCode & 0xFFFFF800) == U32(0xD800))) || ((iCode & 0xFFFFFFFE) == U32(0xFFFE))) {
+ if !(iCode < U32(0x80) || iCode&0xFFFFF800 == U32(0xD800) || iCode&0xFFFFFFFE == U32(0xFFFE)) {
goto __11
}
iCode = U32(0xFFFD)
@@ -188211,7 +190727,7 @@ __6:
if !(*(*uint8)(unsafe.Pointer(a + uintptr(*(*uint8)(unsafe.Pointer(zCsr))))) != 0) {
goto __13
}
- is = ((int32(zCsr) - int32(pText)) / 1)
+ is = (int32(zCsr) - int32(pText)) / 1
goto ascii_tokenchar
__13:
;
@@ -188234,7 +190750,7 @@ __14:
if !(zOut > pEnd) {
goto __16
}
- aFold = Xsqlite3_malloc64(tls, (uint64(Sqlite3_int64(nFold) * int64(2))))
+ aFold = Xsqlite3_malloc64(tls, uint64(Sqlite3_int64(nFold)*int64(2)))
if !(aFold == uintptr(0)) {
goto __17
}
@@ -188242,16 +190758,16 @@ __14:
goto tokenize_done
__17:
;
- zOut = (aFold + uintptr(((int32(zOut) - int32((*Unicode61Tokenizer)(unsafe.Pointer(p)).FaFold)) / 1)))
+ zOut = aFold + uintptr((int32(zOut)-int32((*Unicode61Tokenizer)(unsafe.Pointer(p)).FaFold))/1)
libc.Xmemcpy(tls, aFold, (*Unicode61Tokenizer)(unsafe.Pointer(p)).FaFold, uint32(nFold))
Xsqlite3_free(tls, (*Unicode61Tokenizer)(unsafe.Pointer(p)).FaFold)
(*Unicode61Tokenizer)(unsafe.Pointer(p)).FaFold = aFold
- (*Unicode61Tokenizer)(unsafe.Pointer(p)).FnFold = libc.AssignInt32(&nFold, (nFold * 2))
- pEnd = (aFold + uintptr((nFold - 6)))
+ (*Unicode61Tokenizer)(unsafe.Pointer(p)).FnFold = libc.AssignInt32(&nFold, nFold*2)
+ pEnd = aFold + uintptr(nFold-6)
__16:
;
- if !((int32(*(*uint8)(unsafe.Pointer(zCsr))) & 0x80) != 0) {
+ if !(int32(*(*uint8)(unsafe.Pointer(zCsr)))&0x80 != 0) {
goto __18
}
// An non-ascii-range character. Fold it into the output buffer if
@@ -188260,16 +190776,16 @@ __16:
if !(iCode >= U32(0xc0)) {
goto __20
}
- iCode = U32(sqlite3Utf8Trans1[(iCode - U32(0xc0))])
+ iCode = U32(sqlite3Utf8Trans1[iCode-U32(0xc0)])
__21:
- if !((zCsr != zTerm) && ((int32(*(*uint8)(unsafe.Pointer(zCsr))) & 0xc0) == 0x80)) {
+ if !(zCsr != zTerm && int32(*(*uint8)(unsafe.Pointer(zCsr)))&0xc0 == 0x80) {
goto __22
}
- iCode = ((iCode << 6) + (U32(0x3f & int32(*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&zCsr, 1)))))))
+ iCode = iCode<<6 + U32(0x3f&int32(*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&zCsr, 1)))))
goto __21
__22:
;
- if !(((iCode < U32(0x80)) || ((iCode & 0xFFFFF800) == U32(0xD800))) || ((iCode & 0xFFFFFFFE) == U32(0xFFFE))) {
+ if !(iCode < U32(0x80) || iCode&0xFFFFF800 == U32(0xD800) || iCode&0xFFFFFFFE == U32(0xFFFE)) {
goto __23
}
iCode = U32(0xFFFD)
@@ -188278,7 +190794,7 @@ __23:
__20:
;
- if !((fts5UnicodeIsAlnum(tls, p, int32(iCode)) != 0) || (sqlite3Fts5UnicodeIsdiacritic(tls, int32(iCode)) != 0)) {
+ if !(fts5UnicodeIsAlnum(tls, p, int32(iCode)) != 0 || sqlite3Fts5UnicodeIsdiacritic(tls, int32(iCode)) != 0) {
goto __24
}
non_ascii_tokenchar:
@@ -188289,28 +190805,28 @@ non_ascii_tokenchar:
if !(iCode < U32(0x00080)) {
goto __27
}
- *(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&zOut, 1))) = uint8((U8(iCode & U32(0xFF))))
+ *(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&zOut, 1))) = uint8(U8(iCode & U32(0xFF)))
goto __28
__27:
if !(iCode < U32(0x00800)) {
goto __29
}
- *(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&zOut, 1))) = (uint8(0xC0 + int32((U8((iCode >> 6) & U32(0x1F))))))
- *(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&zOut, 1))) = (uint8(0x80 + int32((U8(iCode & U32(0x3F))))))
+ *(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&zOut, 1))) = uint8(0xC0 + int32(U8(iCode>>6&U32(0x1F))))
+ *(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&zOut, 1))) = uint8(0x80 + int32(U8(iCode&U32(0x3F))))
goto __30
__29:
if !(iCode < U32(0x10000)) {
goto __31
}
- *(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&zOut, 1))) = (uint8(0xE0 + int32((U8((iCode >> 12) & U32(0x0F))))))
- *(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&zOut, 1))) = (uint8(0x80 + int32((U8((iCode >> 6) & U32(0x3F))))))
- *(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&zOut, 1))) = (uint8(0x80 + int32((U8(iCode & U32(0x3F))))))
+ *(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&zOut, 1))) = uint8(0xE0 + int32(U8(iCode>>12&U32(0x0F))))
+ *(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&zOut, 1))) = uint8(0x80 + int32(U8(iCode>>6&U32(0x3F))))
+ *(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&zOut, 1))) = uint8(0x80 + int32(U8(iCode&U32(0x3F))))
goto __32
__31:
- *(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&zOut, 1))) = (uint8(0xF0 + int32((U8((iCode >> 18) & U32(0x07))))))
- *(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&zOut, 1))) = (uint8(0x80 + int32((U8((iCode >> 12) & U32(0x3F))))))
- *(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&zOut, 1))) = (uint8(0x80 + int32((U8((iCode >> 6) & U32(0x3F))))))
- *(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&zOut, 1))) = (uint8(0x80 + int32((U8(iCode & U32(0x3F))))))
+ *(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&zOut, 1))) = uint8(0xF0 + int32(U8(iCode>>18&U32(0x07))))
+ *(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&zOut, 1))) = uint8(0x80 + int32(U8(iCode>>12&U32(0x3F))))
+ *(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&zOut, 1))) = uint8(0x80 + int32(U8(iCode>>6&U32(0x3F))))
+ *(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&zOut, 1))) = uint8(0x80 + int32(U8(iCode&U32(0x3F))))
__32:
;
__30:
@@ -188335,10 +190851,10 @@ __18:
goto __34
__33:
ascii_tokenchar:
- if !((int32(*(*uint8)(unsafe.Pointer(zCsr))) >= 'A') && (int32(*(*uint8)(unsafe.Pointer(zCsr))) <= 'Z')) {
+ if !(int32(*(*uint8)(unsafe.Pointer(zCsr))) >= 'A' && int32(*(*uint8)(unsafe.Pointer(zCsr))) <= 'Z') {
goto __35
}
- *(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&zOut, 1))) = (uint8(int32(*(*uint8)(unsafe.Pointer(zCsr))) + 32))
+ *(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&zOut, 1))) = uint8(int32(*(*uint8)(unsafe.Pointer(zCsr))) + 32)
goto __36
__35:
*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&zOut, 1))) = uint8(*(*uint8)(unsafe.Pointer(zCsr)))
@@ -188349,7 +190865,7 @@ __34:
;
__19:
;
- ie = ((int32(zCsr) - int32(pText)) / 1)
+ ie = (int32(zCsr) - int32(pText)) / 1
goto __14
__15:
;
@@ -188357,7 +190873,7 @@ __15:
// Invoke the token callback
rc = (*struct {
f func(*libc.TLS, uintptr, int32, uintptr, int32, int32, int32) int32
- })(unsafe.Pointer(&struct{ uintptr }{xToken})).f(tls, pCtx, 0, aFold, ((int32(zOut) - int32(aFold)) / 1), is, ie)
+ })(unsafe.Pointer(&struct{ uintptr }{xToken})).f(tls, pCtx, 0, aFold, (int32(zOut)-int32(aFold))/1, is, ie)
goto __1
__2:
;
@@ -188383,7 +190899,7 @@ type PorterTokenizer1 = struct {
Ftokenizer Fts5_tokenizer
FpTokenizer uintptr
FaBuf [128]uint8
-} /* sqlite3.c:232428:9 */
+} /* sqlite3.c:234342:9 */
// *************************************************************************
//
@@ -188392,10 +190908,10 @@ type PorterTokenizer1 = struct {
// Any tokens larger than this (in bytes) are passed through without
// stemming.
-type PorterTokenizer = PorterTokenizer1 /* sqlite3.c:232428:32 */
+type PorterTokenizer = PorterTokenizer1 /* sqlite3.c:234342:32 */
// Delete a "porter" tokenizer.
-func fts5PorterDelete(tls *libc.TLS, pTok uintptr) { /* sqlite3.c:232438:13: */
+func fts5PorterDelete(tls *libc.TLS, pTok uintptr) { /* sqlite3.c:234352:13: */
if pTok != 0 {
var p uintptr = pTok
if (*PorterTokenizer)(unsafe.Pointer(p)).FpTokenizer != 0 {
@@ -188406,7 +190922,7 @@ func fts5PorterDelete(tls *libc.TLS, pTok uintptr) { /* sqlite3.c:232438:13: */
}
// Create a "porter" tokenizer.
-func fts5PorterCreate(tls *libc.TLS, pCtx uintptr, azArg uintptr, nArg int32, ppOut uintptr) int32 { /* sqlite3.c:232451:12: */
+func fts5PorterCreate(tls *libc.TLS, pCtx uintptr, azArg uintptr, nArg int32, ppOut uintptr) int32 { /* sqlite3.c:234365:12: */
bp := tls.Alloc(4)
defer tls.Free(4)
@@ -188414,7 +190930,7 @@ func fts5PorterCreate(tls *libc.TLS, pCtx uintptr, azArg uintptr, nArg int32, pp
var rc int32 = SQLITE_OK
var pRet uintptr
*(*uintptr)(unsafe.Pointer(bp /* pUserdata */)) = uintptr(0)
- var zBase uintptr = ts + 35199 /* "unicode61" */
+ var zBase uintptr = ts + 36559 /* "unicode61" */
if nArg > 0 {
zBase = *(*uintptr)(unsafe.Pointer(azArg))
@@ -188425,26 +190941,26 @@ func fts5PorterCreate(tls *libc.TLS, pCtx uintptr, azArg uintptr, nArg int32, pp
libc.Xmemset(tls, pRet, 0, uint32(unsafe.Sizeof(PorterTokenizer{})))
rc = (*struct {
f func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) int32
- })(unsafe.Pointer(&struct{ uintptr }{(*Fts5_api)(unsafe.Pointer(pApi)).FxFindTokenizer})).f(tls, pApi, zBase, bp /* &pUserdata */, (pRet /* &.tokenizer */))
+ })(unsafe.Pointer(&struct{ uintptr }{(*Fts5_api)(unsafe.Pointer(pApi)).FxFindTokenizer})).f(tls, pApi, zBase, bp /* &pUserdata */, pRet /* &.tokenizer */)
} else {
rc = SQLITE_NOMEM
}
if rc == SQLITE_OK {
var nArg2 int32 = func() int32 {
if nArg > 0 {
- return (nArg - 1)
+ return nArg - 1
}
return 0
}()
var azArg2 uintptr = func() uintptr {
if nArg2 != 0 {
- return (azArg + 1*4)
+ return azArg + 1*4
}
return uintptr(0)
}()
rc = (*struct {
f func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32
- })(unsafe.Pointer(&struct{ uintptr }{(*PorterTokenizer)(unsafe.Pointer(pRet)).Ftokenizer.FxCreate})).f(tls, *(*uintptr)(unsafe.Pointer(bp /* pUserdata */)), azArg2, nArg2, (pRet + 12 /* &.pTokenizer */))
+ })(unsafe.Pointer(&struct{ uintptr }{(*PorterTokenizer)(unsafe.Pointer(pRet)).Ftokenizer.FxCreate})).f(tls, *(*uintptr)(unsafe.Pointer(bp /* pUserdata */)), azArg2, nArg2, pRet+12 /* &.pTokenizer */)
}
if rc != SQLITE_OK {
@@ -188459,9 +190975,9 @@ type PorterContext1 = struct {
FpCtx uintptr
FxToken uintptr
FaBuf uintptr
-} /* sqlite3.c:232487:9 */
+} /* sqlite3.c:234401:9 */
-type PorterContext = PorterContext1 /* sqlite3.c:232487:30 */
+type PorterContext = PorterContext1 /* sqlite3.c:234401:30 */
type PorterRule1 = struct {
FzSuffix uintptr
@@ -188469,21 +190985,21 @@ type PorterRule1 = struct {
FxCond uintptr
FzOutput uintptr
FnOutput int32
-} /* sqlite3.c:232494:9 */
+} /* sqlite3.c:234408:9 */
-type PorterRule = PorterRule1 /* sqlite3.c:232494:27 */
+type PorterRule = PorterRule1 /* sqlite3.c:234408:27 */
-func fts5PorterIsVowel(tls *libc.TLS, c uint8, bYIsVowel int32) int32 { /* sqlite3.c:232529:12: */
- return (libc.Bool32((((((int32(c) == 'a') || (int32(c) == 'e')) || (int32(c) == 'i')) || (int32(c) == 'o')) || (int32(c) == 'u')) || ((bYIsVowel != 0) && (int32(c) == 'y'))))
+func fts5PorterIsVowel(tls *libc.TLS, c uint8, bYIsVowel int32) int32 { /* sqlite3.c:234443:12: */
+ return libc.Bool32(int32(c) == 'a' || int32(c) == 'e' || int32(c) == 'i' || int32(c) == 'o' || int32(c) == 'u' || bYIsVowel != 0 && int32(c) == 'y')
}
-func fts5PorterGobbleVC(tls *libc.TLS, zStem uintptr, nStem int32, bPrevCons int32) int32 { /* sqlite3.c:232535:12: */
+func fts5PorterGobbleVC(tls *libc.TLS, zStem uintptr, nStem int32, bPrevCons int32) int32 { /* sqlite3.c:234449:12: */
var i int32
var bCons int32 = bPrevCons
// Scan for a vowel
for i = 0; i < nStem; i++ {
- if 0 == (libc.AssignInt32(&bCons, libc.BoolInt32(!(fts5PorterIsVowel(tls, *(*uint8)(unsafe.Pointer(zStem + uintptr(i))), bCons) != 0)))) {
+ if 0 == libc.AssignInt32(&bCons, libc.BoolInt32(!(fts5PorterIsVowel(tls, *(*uint8)(unsafe.Pointer(zStem + uintptr(i))), bCons) != 0))) {
break
}
}
@@ -188491,40 +191007,40 @@ func fts5PorterGobbleVC(tls *libc.TLS, zStem uintptr, nStem int32, bPrevCons int
// Scan for a consonent
for i++; i < nStem; i++ {
if libc.AssignInt32(&bCons, libc.BoolInt32(!(fts5PorterIsVowel(tls, *(*uint8)(unsafe.Pointer(zStem + uintptr(i))), bCons) != 0))) != 0 {
- return (i + 1)
+ return i + 1
}
}
return 0
}
// porter rule condition: (m > 0)
-func fts5Porter_MGt0(tls *libc.TLS, zStem uintptr, nStem int32) int32 { /* sqlite3.c:232552:12: */
- return libc.BoolInt32(!(!(fts5PorterGobbleVC(tls, zStem, nStem, 0) != 0)))
+func fts5Porter_MGt0(tls *libc.TLS, zStem uintptr, nStem int32) int32 { /* sqlite3.c:234466:12: */
+ return libc.BoolInt32(!!(fts5PorterGobbleVC(tls, zStem, nStem, 0) != 0))
}
// porter rule condition: (m > 1)
-func fts5Porter_MGt1(tls *libc.TLS, zStem uintptr, nStem int32) int32 { /* sqlite3.c:232557:12: */
+func fts5Porter_MGt1(tls *libc.TLS, zStem uintptr, nStem int32) int32 { /* sqlite3.c:234471:12: */
var n int32
n = fts5PorterGobbleVC(tls, zStem, nStem, 0)
- if (n != 0) && (fts5PorterGobbleVC(tls, (zStem+uintptr(n)), (nStem-n), 1) != 0) {
+ if n != 0 && fts5PorterGobbleVC(tls, zStem+uintptr(n), nStem-n, 1) != 0 {
return 1
}
return 0
}
// porter rule condition: (m = 1)
-func fts5Porter_MEq1(tls *libc.TLS, zStem uintptr, nStem int32) int32 { /* sqlite3.c:232567:12: */
+func fts5Porter_MEq1(tls *libc.TLS, zStem uintptr, nStem int32) int32 { /* sqlite3.c:234481:12: */
var n int32
n = fts5PorterGobbleVC(tls, zStem, nStem, 0)
- if (n != 0) && (0 == fts5PorterGobbleVC(tls, (zStem+uintptr(n)), (nStem-n), 1)) {
+ if n != 0 && 0 == fts5PorterGobbleVC(tls, zStem+uintptr(n), nStem-n, 1) {
return 1
}
return 0
}
// porter rule condition: (*o)
-func fts5Porter_Ostar(tls *libc.TLS, zStem uintptr, nStem int32) int32 { /* sqlite3.c:232577:12: */
- if ((int32(*(*uint8)(unsafe.Pointer(zStem + uintptr((nStem - 1))))) == 'w') || (int32(*(*uint8)(unsafe.Pointer(zStem + uintptr((nStem - 1))))) == 'x')) || (int32(*(*uint8)(unsafe.Pointer(zStem + uintptr((nStem - 1))))) == 'y') {
+func fts5Porter_Ostar(tls *libc.TLS, zStem uintptr, nStem int32) int32 { /* sqlite3.c:234491:12: */
+ if int32(*(*uint8)(unsafe.Pointer(zStem + uintptr(nStem-1)))) == 'w' || int32(*(*uint8)(unsafe.Pointer(zStem + uintptr(nStem-1)))) == 'x' || int32(*(*uint8)(unsafe.Pointer(zStem + uintptr(nStem-1)))) == 'y' {
return 0
} else {
var i int32
@@ -188533,25 +191049,25 @@ func fts5Porter_Ostar(tls *libc.TLS, zStem uintptr, nStem int32) int32 { /* sqli
for i = 0; i < nStem; i++ {
bCons = libc.BoolInt32(!(fts5PorterIsVowel(tls, *(*uint8)(unsafe.Pointer(zStem + uintptr(i))), bCons) != 0))
- mask = ((mask << 1) + bCons)
+ mask = mask<<1 + bCons
}
- return (libc.Bool32((mask & 0x0007) == 0x0005))
+ return libc.Bool32(mask&0x0007 == 0x0005)
}
return int32(0)
}
// porter rule condition: (m > 1 and (*S or *T))
-func fts5Porter_MGt1_and_S_or_T(tls *libc.TLS, zStem uintptr, nStem int32) int32 { /* sqlite3.c:232594:12: */
+func fts5Porter_MGt1_and_S_or_T(tls *libc.TLS, zStem uintptr, nStem int32) int32 { /* sqlite3.c:234508:12: */
- return (libc.Bool32(((int32(*(*uint8)(unsafe.Pointer(zStem + uintptr((nStem - 1))))) == 's') || (int32(*(*uint8)(unsafe.Pointer(zStem + uintptr((nStem - 1))))) == 't')) &&
- (fts5Porter_MGt1(tls, zStem, nStem) != 0)))
+ return libc.Bool32((int32(*(*uint8)(unsafe.Pointer(zStem + uintptr(nStem-1)))) == 's' || int32(*(*uint8)(unsafe.Pointer(zStem + uintptr(nStem-1)))) == 't') &&
+ fts5Porter_MGt1(tls, zStem, nStem) != 0)
}
// porter rule condition: (*v*)
-func fts5Porter_Vowel(tls *libc.TLS, zStem uintptr, nStem int32) int32 { /* sqlite3.c:232601:12: */
+func fts5Porter_Vowel(tls *libc.TLS, zStem uintptr, nStem int32) int32 { /* sqlite3.c:234515:12: */
var i int32
for i = 0; i < nStem; i++ {
- if fts5PorterIsVowel(tls, *(*uint8)(unsafe.Pointer(zStem + uintptr(i))), (libc.Bool32(i > 0))) != 0 {
+ if fts5PorterIsVowel(tls, *(*uint8)(unsafe.Pointer(zStem + uintptr(i))), libc.Bool32(i > 0)) != 0 {
return 1
}
}
@@ -188563,131 +191079,131 @@ func fts5Porter_Vowel(tls *libc.TLS, zStem uintptr, nStem int32) int32 { /* sqli
//
// GENERATED CODE STARTS HERE (mkportersteps.tcl)
-func fts5PorterStep4(tls *libc.TLS, aBuf uintptr, pnBuf uintptr) int32 { /* sqlite3.c:232617:12: */
+func fts5PorterStep4(tls *libc.TLS, aBuf uintptr, pnBuf uintptr) int32 { /* sqlite3.c:234531:12: */
var ret int32 = 0
var nBuf int32 = *(*int32)(unsafe.Pointer(pnBuf))
- switch int32(*(*uint8)(unsafe.Pointer(aBuf + uintptr((nBuf - 2))))) {
+ switch int32(*(*uint8)(unsafe.Pointer(aBuf + uintptr(nBuf-2)))) {
case 'a':
- if (nBuf > 2) && (0 == libc.Xmemcmp(tls, ts+35209 /* "al" */, (aBuf+uintptr((nBuf-2))), uint32(2))) {
- if fts5Porter_MGt1(tls, aBuf, (nBuf-2)) != 0 {
- *(*int32)(unsafe.Pointer(pnBuf)) = (nBuf - 2)
+ if nBuf > 2 && 0 == libc.Xmemcmp(tls, ts+36569, aBuf+uintptr(nBuf-2), uint32(2)) {
+ if fts5Porter_MGt1(tls, aBuf, nBuf-2) != 0 {
+ *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - 2
}
}
break
case 'c':
- if (nBuf > 4) && (0 == libc.Xmemcmp(tls, ts+35212 /* "ance" */, (aBuf+uintptr((nBuf-4))), uint32(4))) {
- if fts5Porter_MGt1(tls, aBuf, (nBuf-4)) != 0 {
- *(*int32)(unsafe.Pointer(pnBuf)) = (nBuf - 4)
+ if nBuf > 4 && 0 == libc.Xmemcmp(tls, ts+36572, aBuf+uintptr(nBuf-4), uint32(4)) {
+ if fts5Porter_MGt1(tls, aBuf, nBuf-4) != 0 {
+ *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - 4
}
- } else if (nBuf > 4) && (0 == libc.Xmemcmp(tls, ts+35217 /* "ence" */, (aBuf+uintptr((nBuf-4))), uint32(4))) {
- if fts5Porter_MGt1(tls, aBuf, (nBuf-4)) != 0 {
- *(*int32)(unsafe.Pointer(pnBuf)) = (nBuf - 4)
+ } else if nBuf > 4 && 0 == libc.Xmemcmp(tls, ts+36577, aBuf+uintptr(nBuf-4), uint32(4)) {
+ if fts5Porter_MGt1(tls, aBuf, nBuf-4) != 0 {
+ *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - 4
}
}
break
case 'e':
- if (nBuf > 2) && (0 == libc.Xmemcmp(tls, ts+35222 /* "er" */, (aBuf+uintptr((nBuf-2))), uint32(2))) {
- if fts5Porter_MGt1(tls, aBuf, (nBuf-2)) != 0 {
- *(*int32)(unsafe.Pointer(pnBuf)) = (nBuf - 2)
+ if nBuf > 2 && 0 == libc.Xmemcmp(tls, ts+36582, aBuf+uintptr(nBuf-2), uint32(2)) {
+ if fts5Porter_MGt1(tls, aBuf, nBuf-2) != 0 {
+ *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - 2
}
}
break
case 'i':
- if (nBuf > 2) && (0 == libc.Xmemcmp(tls, ts+35225 /* "ic" */, (aBuf+uintptr((nBuf-2))), uint32(2))) {
- if fts5Porter_MGt1(tls, aBuf, (nBuf-2)) != 0 {
- *(*int32)(unsafe.Pointer(pnBuf)) = (nBuf - 2)
+ if nBuf > 2 && 0 == libc.Xmemcmp(tls, ts+36585, aBuf+uintptr(nBuf-2), uint32(2)) {
+ if fts5Porter_MGt1(tls, aBuf, nBuf-2) != 0 {
+ *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - 2
}
}
break
case 'l':
- if (nBuf > 4) && (0 == libc.Xmemcmp(tls, ts+35228 /* "able" */, (aBuf+uintptr((nBuf-4))), uint32(4))) {
- if fts5Porter_MGt1(tls, aBuf, (nBuf-4)) != 0 {
- *(*int32)(unsafe.Pointer(pnBuf)) = (nBuf - 4)
+ if nBuf > 4 && 0 == libc.Xmemcmp(tls, ts+36588, aBuf+uintptr(nBuf-4), uint32(4)) {
+ if fts5Porter_MGt1(tls, aBuf, nBuf-4) != 0 {
+ *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - 4
}
- } else if (nBuf > 4) && (0 == libc.Xmemcmp(tls, ts+35233 /* "ible" */, (aBuf+uintptr((nBuf-4))), uint32(4))) {
- if fts5Porter_MGt1(tls, aBuf, (nBuf-4)) != 0 {
- *(*int32)(unsafe.Pointer(pnBuf)) = (nBuf - 4)
+ } else if nBuf > 4 && 0 == libc.Xmemcmp(tls, ts+36593, aBuf+uintptr(nBuf-4), uint32(4)) {
+ if fts5Porter_MGt1(tls, aBuf, nBuf-4) != 0 {
+ *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - 4
}
}
break
case 'n':
- if (nBuf > 3) && (0 == libc.Xmemcmp(tls, ts+35238 /* "ant" */, (aBuf+uintptr((nBuf-3))), uint32(3))) {
- if fts5Porter_MGt1(tls, aBuf, (nBuf-3)) != 0 {
- *(*int32)(unsafe.Pointer(pnBuf)) = (nBuf - 3)
+ if nBuf > 3 && 0 == libc.Xmemcmp(tls, ts+36598, aBuf+uintptr(nBuf-3), uint32(3)) {
+ if fts5Porter_MGt1(tls, aBuf, nBuf-3) != 0 {
+ *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - 3
}
- } else if (nBuf > 5) && (0 == libc.Xmemcmp(tls, ts+35242 /* "ement" */, (aBuf+uintptr((nBuf-5))), uint32(5))) {
- if fts5Porter_MGt1(tls, aBuf, (nBuf-5)) != 0 {
- *(*int32)(unsafe.Pointer(pnBuf)) = (nBuf - 5)
+ } else if nBuf > 5 && 0 == libc.Xmemcmp(tls, ts+36602, aBuf+uintptr(nBuf-5), uint32(5)) {
+ if fts5Porter_MGt1(tls, aBuf, nBuf-5) != 0 {
+ *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - 5
}
- } else if (nBuf > 4) && (0 == libc.Xmemcmp(tls, ts+35248 /* "ment" */, (aBuf+uintptr((nBuf-4))), uint32(4))) {
- if fts5Porter_MGt1(tls, aBuf, (nBuf-4)) != 0 {
- *(*int32)(unsafe.Pointer(pnBuf)) = (nBuf - 4)
+ } else if nBuf > 4 && 0 == libc.Xmemcmp(tls, ts+36608, aBuf+uintptr(nBuf-4), uint32(4)) {
+ if fts5Porter_MGt1(tls, aBuf, nBuf-4) != 0 {
+ *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - 4
}
- } else if (nBuf > 3) && (0 == libc.Xmemcmp(tls, ts+35253 /* "ent" */, (aBuf+uintptr((nBuf-3))), uint32(3))) {
- if fts5Porter_MGt1(tls, aBuf, (nBuf-3)) != 0 {
- *(*int32)(unsafe.Pointer(pnBuf)) = (nBuf - 3)
+ } else if nBuf > 3 && 0 == libc.Xmemcmp(tls, ts+36613, aBuf+uintptr(nBuf-3), uint32(3)) {
+ if fts5Porter_MGt1(tls, aBuf, nBuf-3) != 0 {
+ *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - 3
}
}
break
case 'o':
- if (nBuf > 3) && (0 == libc.Xmemcmp(tls, ts+35257 /* "ion" */, (aBuf+uintptr((nBuf-3))), uint32(3))) {
- if fts5Porter_MGt1_and_S_or_T(tls, aBuf, (nBuf-3)) != 0 {
- *(*int32)(unsafe.Pointer(pnBuf)) = (nBuf - 3)
+ if nBuf > 3 && 0 == libc.Xmemcmp(tls, ts+36617, aBuf+uintptr(nBuf-3), uint32(3)) {
+ if fts5Porter_MGt1_and_S_or_T(tls, aBuf, nBuf-3) != 0 {
+ *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - 3
}
- } else if (nBuf > 2) && (0 == libc.Xmemcmp(tls, ts+35261 /* "ou" */, (aBuf+uintptr((nBuf-2))), uint32(2))) {
- if fts5Porter_MGt1(tls, aBuf, (nBuf-2)) != 0 {
- *(*int32)(unsafe.Pointer(pnBuf)) = (nBuf - 2)
+ } else if nBuf > 2 && 0 == libc.Xmemcmp(tls, ts+36621, aBuf+uintptr(nBuf-2), uint32(2)) {
+ if fts5Porter_MGt1(tls, aBuf, nBuf-2) != 0 {
+ *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - 2
}
}
break
case 's':
- if (nBuf > 3) && (0 == libc.Xmemcmp(tls, ts+35264 /* "ism" */, (aBuf+uintptr((nBuf-3))), uint32(3))) {
- if fts5Porter_MGt1(tls, aBuf, (nBuf-3)) != 0 {
- *(*int32)(unsafe.Pointer(pnBuf)) = (nBuf - 3)
+ if nBuf > 3 && 0 == libc.Xmemcmp(tls, ts+36624, aBuf+uintptr(nBuf-3), uint32(3)) {
+ if fts5Porter_MGt1(tls, aBuf, nBuf-3) != 0 {
+ *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - 3
}
}
break
case 't':
- if (nBuf > 3) && (0 == libc.Xmemcmp(tls, ts+35268 /* "ate" */, (aBuf+uintptr((nBuf-3))), uint32(3))) {
- if fts5Porter_MGt1(tls, aBuf, (nBuf-3)) != 0 {
- *(*int32)(unsafe.Pointer(pnBuf)) = (nBuf - 3)
+ if nBuf > 3 && 0 == libc.Xmemcmp(tls, ts+36628, aBuf+uintptr(nBuf-3), uint32(3)) {
+ if fts5Porter_MGt1(tls, aBuf, nBuf-3) != 0 {
+ *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - 3
}
- } else if (nBuf > 3) && (0 == libc.Xmemcmp(tls, ts+35272 /* "iti" */, (aBuf+uintptr((nBuf-3))), uint32(3))) {
- if fts5Porter_MGt1(tls, aBuf, (nBuf-3)) != 0 {
- *(*int32)(unsafe.Pointer(pnBuf)) = (nBuf - 3)
+ } else if nBuf > 3 && 0 == libc.Xmemcmp(tls, ts+36632, aBuf+uintptr(nBuf-3), uint32(3)) {
+ if fts5Porter_MGt1(tls, aBuf, nBuf-3) != 0 {
+ *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - 3
}
}
break
case 'u':
- if (nBuf > 3) && (0 == libc.Xmemcmp(tls, ts+35276 /* "ous" */, (aBuf+uintptr((nBuf-3))), uint32(3))) {
- if fts5Porter_MGt1(tls, aBuf, (nBuf-3)) != 0 {
- *(*int32)(unsafe.Pointer(pnBuf)) = (nBuf - 3)
+ if nBuf > 3 && 0 == libc.Xmemcmp(tls, ts+36636, aBuf+uintptr(nBuf-3), uint32(3)) {
+ if fts5Porter_MGt1(tls, aBuf, nBuf-3) != 0 {
+ *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - 3
}
}
break
case 'v':
- if (nBuf > 3) && (0 == libc.Xmemcmp(tls, ts+35280 /* "ive" */, (aBuf+uintptr((nBuf-3))), uint32(3))) {
- if fts5Porter_MGt1(tls, aBuf, (nBuf-3)) != 0 {
- *(*int32)(unsafe.Pointer(pnBuf)) = (nBuf - 3)
+ if nBuf > 3 && 0 == libc.Xmemcmp(tls, ts+36640, aBuf+uintptr(nBuf-3), uint32(3)) {
+ if fts5Porter_MGt1(tls, aBuf, nBuf-3) != 0 {
+ *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - 3
}
}
break
case 'z':
- if (nBuf > 3) && (0 == libc.Xmemcmp(tls, ts+35284 /* "ize" */, (aBuf+uintptr((nBuf-3))), uint32(3))) {
- if fts5Porter_MGt1(tls, aBuf, (nBuf-3)) != 0 {
- *(*int32)(unsafe.Pointer(pnBuf)) = (nBuf - 3)
+ if nBuf > 3 && 0 == libc.Xmemcmp(tls, ts+36644, aBuf+uintptr(nBuf-3), uint32(3)) {
+ if fts5Porter_MGt1(tls, aBuf, nBuf-3) != 0 {
+ *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - 3
}
}
break
@@ -188696,31 +191212,31 @@ func fts5PorterStep4(tls *libc.TLS, aBuf uintptr, pnBuf uintptr) int32 { /* sqli
return ret
}
-func fts5PorterStep1B2(tls *libc.TLS, aBuf uintptr, pnBuf uintptr) int32 { /* sqlite3.c:232751:12: */
+func fts5PorterStep1B2(tls *libc.TLS, aBuf uintptr, pnBuf uintptr) int32 { /* sqlite3.c:234665:12: */
var ret int32 = 0
var nBuf int32 = *(*int32)(unsafe.Pointer(pnBuf))
- switch int32(*(*uint8)(unsafe.Pointer(aBuf + uintptr((nBuf - 2))))) {
+ switch int32(*(*uint8)(unsafe.Pointer(aBuf + uintptr(nBuf-2)))) {
case 'a':
- if (nBuf > 2) && (0 == libc.Xmemcmp(tls, ts+35288 /* "at" */, (aBuf+uintptr((nBuf-2))), uint32(2))) {
- libc.Xmemcpy(tls, (aBuf + uintptr((nBuf - 2))), ts+35268 /* "ate" */, uint32(3))
- *(*int32)(unsafe.Pointer(pnBuf)) = ((nBuf - 2) + 3)
+ if nBuf > 2 && 0 == libc.Xmemcmp(tls, ts+36648, aBuf+uintptr(nBuf-2), uint32(2)) {
+ libc.Xmemcpy(tls, aBuf+uintptr(nBuf-2), ts+36628 /* "ate" */, uint32(3))
+ *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - 2 + 3
ret = 1
}
break
case 'b':
- if (nBuf > 2) && (0 == libc.Xmemcmp(tls, ts+35291 /* "bl" */, (aBuf+uintptr((nBuf-2))), uint32(2))) {
- libc.Xmemcpy(tls, (aBuf + uintptr((nBuf - 2))), ts+35294 /* "ble" */, uint32(3))
- *(*int32)(unsafe.Pointer(pnBuf)) = ((nBuf - 2) + 3)
+ if nBuf > 2 && 0 == libc.Xmemcmp(tls, ts+36651, aBuf+uintptr(nBuf-2), uint32(2)) {
+ libc.Xmemcpy(tls, aBuf+uintptr(nBuf-2), ts+36654 /* "ble" */, uint32(3))
+ *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - 2 + 3
ret = 1
}
break
case 'i':
- if (nBuf > 2) && (0 == libc.Xmemcmp(tls, ts+35298 /* "iz" */, (aBuf+uintptr((nBuf-2))), uint32(2))) {
- libc.Xmemcpy(tls, (aBuf + uintptr((nBuf - 2))), ts+35284 /* "ize" */, uint32(3))
- *(*int32)(unsafe.Pointer(pnBuf)) = ((nBuf - 2) + 3)
+ if nBuf > 2 && 0 == libc.Xmemcmp(tls, ts+36658, aBuf+uintptr(nBuf-2), uint32(2)) {
+ libc.Xmemcpy(tls, aBuf+uintptr(nBuf-2), ts+36644 /* "ize" */, uint32(3))
+ *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - 2 + 3
ret = 1
}
break
@@ -188729,144 +191245,144 @@ func fts5PorterStep1B2(tls *libc.TLS, aBuf uintptr, pnBuf uintptr) int32 { /* sq
return ret
}
-func fts5PorterStep2(tls *libc.TLS, aBuf uintptr, pnBuf uintptr) int32 { /* sqlite3.c:232785:12: */
+func fts5PorterStep2(tls *libc.TLS, aBuf uintptr, pnBuf uintptr) int32 { /* sqlite3.c:234699:12: */
var ret int32 = 0
var nBuf int32 = *(*int32)(unsafe.Pointer(pnBuf))
- switch int32(*(*uint8)(unsafe.Pointer(aBuf + uintptr((nBuf - 2))))) {
+ switch int32(*(*uint8)(unsafe.Pointer(aBuf + uintptr(nBuf-2)))) {
case 'a':
- if (nBuf > 7) && (0 == libc.Xmemcmp(tls, ts+35301 /* "ational" */, (aBuf+uintptr((nBuf-7))), uint32(7))) {
- if fts5Porter_MGt0(tls, aBuf, (nBuf-7)) != 0 {
- libc.Xmemcpy(tls, (aBuf + uintptr((nBuf - 7))), ts+35268 /* "ate" */, uint32(3))
- *(*int32)(unsafe.Pointer(pnBuf)) = ((nBuf - 7) + 3)
+ if nBuf > 7 && 0 == libc.Xmemcmp(tls, ts+36661, aBuf+uintptr(nBuf-7), uint32(7)) {
+ if fts5Porter_MGt0(tls, aBuf, nBuf-7) != 0 {
+ libc.Xmemcpy(tls, aBuf+uintptr(nBuf-7), ts+36628 /* "ate" */, uint32(3))
+ *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - 7 + 3
}
- } else if (nBuf > 6) && (0 == libc.Xmemcmp(tls, ts+35309 /* "tional" */, (aBuf+uintptr((nBuf-6))), uint32(6))) {
- if fts5Porter_MGt0(tls, aBuf, (nBuf-6)) != 0 {
- libc.Xmemcpy(tls, (aBuf + uintptr((nBuf - 6))), ts+35316 /* "tion" */, uint32(4))
- *(*int32)(unsafe.Pointer(pnBuf)) = ((nBuf - 6) + 4)
+ } else if nBuf > 6 && 0 == libc.Xmemcmp(tls, ts+36669, aBuf+uintptr(nBuf-6), uint32(6)) {
+ if fts5Porter_MGt0(tls, aBuf, nBuf-6) != 0 {
+ libc.Xmemcpy(tls, aBuf+uintptr(nBuf-6), ts+36676 /* "tion" */, uint32(4))
+ *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - 6 + 4
}
}
break
case 'c':
- if (nBuf > 4) && (0 == libc.Xmemcmp(tls, ts+35321 /* "enci" */, (aBuf+uintptr((nBuf-4))), uint32(4))) {
- if fts5Porter_MGt0(tls, aBuf, (nBuf-4)) != 0 {
- libc.Xmemcpy(tls, (aBuf + uintptr((nBuf - 4))), ts+35217 /* "ence" */, uint32(4))
- *(*int32)(unsafe.Pointer(pnBuf)) = ((nBuf - 4) + 4)
+ if nBuf > 4 && 0 == libc.Xmemcmp(tls, ts+36681, aBuf+uintptr(nBuf-4), uint32(4)) {
+ if fts5Porter_MGt0(tls, aBuf, nBuf-4) != 0 {
+ libc.Xmemcpy(tls, aBuf+uintptr(nBuf-4), ts+36577 /* "ence" */, uint32(4))
+ *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - 4 + 4
}
- } else if (nBuf > 4) && (0 == libc.Xmemcmp(tls, ts+35326 /* "anci" */, (aBuf+uintptr((nBuf-4))), uint32(4))) {
- if fts5Porter_MGt0(tls, aBuf, (nBuf-4)) != 0 {
- libc.Xmemcpy(tls, (aBuf + uintptr((nBuf - 4))), ts+35212 /* "ance" */, uint32(4))
- *(*int32)(unsafe.Pointer(pnBuf)) = ((nBuf - 4) + 4)
+ } else if nBuf > 4 && 0 == libc.Xmemcmp(tls, ts+36686, aBuf+uintptr(nBuf-4), uint32(4)) {
+ if fts5Porter_MGt0(tls, aBuf, nBuf-4) != 0 {
+ libc.Xmemcpy(tls, aBuf+uintptr(nBuf-4), ts+36572 /* "ance" */, uint32(4))
+ *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - 4 + 4
}
}
break
case 'e':
- if (nBuf > 4) && (0 == libc.Xmemcmp(tls, ts+35331 /* "izer" */, (aBuf+uintptr((nBuf-4))), uint32(4))) {
- if fts5Porter_MGt0(tls, aBuf, (nBuf-4)) != 0 {
- libc.Xmemcpy(tls, (aBuf + uintptr((nBuf - 4))), ts+35284 /* "ize" */, uint32(3))
- *(*int32)(unsafe.Pointer(pnBuf)) = ((nBuf - 4) + 3)
+ if nBuf > 4 && 0 == libc.Xmemcmp(tls, ts+36691, aBuf+uintptr(nBuf-4), uint32(4)) {
+ if fts5Porter_MGt0(tls, aBuf, nBuf-4) != 0 {
+ libc.Xmemcpy(tls, aBuf+uintptr(nBuf-4), ts+36644 /* "ize" */, uint32(3))
+ *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - 4 + 3
}
}
break
case 'g':
- if (nBuf > 4) && (0 == libc.Xmemcmp(tls, ts+35336 /* "logi" */, (aBuf+uintptr((nBuf-4))), uint32(4))) {
- if fts5Porter_MGt0(tls, aBuf, (nBuf-4)) != 0 {
- libc.Xmemcpy(tls, (aBuf + uintptr((nBuf - 4))), ts+14778 /* "log" */, uint32(3))
- *(*int32)(unsafe.Pointer(pnBuf)) = ((nBuf - 4) + 3)
+ if nBuf > 4 && 0 == libc.Xmemcmp(tls, ts+36696, aBuf+uintptr(nBuf-4), uint32(4)) {
+ if fts5Porter_MGt0(tls, aBuf, nBuf-4) != 0 {
+ libc.Xmemcpy(tls, aBuf+uintptr(nBuf-4), ts+15982 /* "log" */, uint32(3))
+ *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - 4 + 3
}
}
break
case 'l':
- if (nBuf > 3) && (0 == libc.Xmemcmp(tls, ts+35341 /* "bli" */, (aBuf+uintptr((nBuf-3))), uint32(3))) {
- if fts5Porter_MGt0(tls, aBuf, (nBuf-3)) != 0 {
- libc.Xmemcpy(tls, (aBuf + uintptr((nBuf - 3))), ts+35294 /* "ble" */, uint32(3))
- *(*int32)(unsafe.Pointer(pnBuf)) = ((nBuf - 3) + 3)
+ if nBuf > 3 && 0 == libc.Xmemcmp(tls, ts+36701, aBuf+uintptr(nBuf-3), uint32(3)) {
+ if fts5Porter_MGt0(tls, aBuf, nBuf-3) != 0 {
+ libc.Xmemcpy(tls, aBuf+uintptr(nBuf-3), ts+36654 /* "ble" */, uint32(3))
+ *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - 3 + 3
}
- } else if (nBuf > 4) && (0 == libc.Xmemcmp(tls, ts+35345 /* "alli" */, (aBuf+uintptr((nBuf-4))), uint32(4))) {
- if fts5Porter_MGt0(tls, aBuf, (nBuf-4)) != 0 {
- libc.Xmemcpy(tls, (aBuf + uintptr((nBuf - 4))), ts+35209 /* "al" */, uint32(2))
- *(*int32)(unsafe.Pointer(pnBuf)) = ((nBuf - 4) + 2)
+ } else if nBuf > 4 && 0 == libc.Xmemcmp(tls, ts+36705, aBuf+uintptr(nBuf-4), uint32(4)) {
+ if fts5Porter_MGt0(tls, aBuf, nBuf-4) != 0 {
+ libc.Xmemcpy(tls, aBuf+uintptr(nBuf-4), ts+36569 /* "al" */, uint32(2))
+ *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - 4 + 2
}
- } else if (nBuf > 5) && (0 == libc.Xmemcmp(tls, ts+35350 /* "entli" */, (aBuf+uintptr((nBuf-5))), uint32(5))) {
- if fts5Porter_MGt0(tls, aBuf, (nBuf-5)) != 0 {
- libc.Xmemcpy(tls, (aBuf + uintptr((nBuf - 5))), ts+35253 /* "ent" */, uint32(3))
- *(*int32)(unsafe.Pointer(pnBuf)) = ((nBuf - 5) + 3)
+ } else if nBuf > 5 && 0 == libc.Xmemcmp(tls, ts+36710, aBuf+uintptr(nBuf-5), uint32(5)) {
+ if fts5Porter_MGt0(tls, aBuf, nBuf-5) != 0 {
+ libc.Xmemcpy(tls, aBuf+uintptr(nBuf-5), ts+36613 /* "ent" */, uint32(3))
+ *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - 5 + 3
}
- } else if (nBuf > 3) && (0 == libc.Xmemcmp(tls, ts+35356 /* "eli" */, (aBuf+uintptr((nBuf-3))), uint32(3))) {
- if fts5Porter_MGt0(tls, aBuf, (nBuf-3)) != 0 {
- libc.Xmemcpy(tls, (aBuf + uintptr((nBuf - 3))), ts+35360 /* "e" */, uint32(1))
- *(*int32)(unsafe.Pointer(pnBuf)) = ((nBuf - 3) + 1)
+ } else if nBuf > 3 && 0 == libc.Xmemcmp(tls, ts+36716, aBuf+uintptr(nBuf-3), uint32(3)) {
+ if fts5Porter_MGt0(tls, aBuf, nBuf-3) != 0 {
+ libc.Xmemcpy(tls, aBuf+uintptr(nBuf-3), ts+36720 /* "e" */, uint32(1))
+ *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - 3 + 1
}
- } else if (nBuf > 5) && (0 == libc.Xmemcmp(tls, ts+35362 /* "ousli" */, (aBuf+uintptr((nBuf-5))), uint32(5))) {
- if fts5Porter_MGt0(tls, aBuf, (nBuf-5)) != 0 {
- libc.Xmemcpy(tls, (aBuf + uintptr((nBuf - 5))), ts+35276 /* "ous" */, uint32(3))
- *(*int32)(unsafe.Pointer(pnBuf)) = ((nBuf - 5) + 3)
+ } else if nBuf > 5 && 0 == libc.Xmemcmp(tls, ts+36722, aBuf+uintptr(nBuf-5), uint32(5)) {
+ if fts5Porter_MGt0(tls, aBuf, nBuf-5) != 0 {
+ libc.Xmemcpy(tls, aBuf+uintptr(nBuf-5), ts+36636 /* "ous" */, uint32(3))
+ *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - 5 + 3
}
}
break
case 'o':
- if (nBuf > 7) && (0 == libc.Xmemcmp(tls, ts+35368 /* "ization" */, (aBuf+uintptr((nBuf-7))), uint32(7))) {
- if fts5Porter_MGt0(tls, aBuf, (nBuf-7)) != 0 {
- libc.Xmemcpy(tls, (aBuf + uintptr((nBuf - 7))), ts+35284 /* "ize" */, uint32(3))
- *(*int32)(unsafe.Pointer(pnBuf)) = ((nBuf - 7) + 3)
+ if nBuf > 7 && 0 == libc.Xmemcmp(tls, ts+36728, aBuf+uintptr(nBuf-7), uint32(7)) {
+ if fts5Porter_MGt0(tls, aBuf, nBuf-7) != 0 {
+ libc.Xmemcpy(tls, aBuf+uintptr(nBuf-7), ts+36644 /* "ize" */, uint32(3))
+ *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - 7 + 3
}
- } else if (nBuf > 5) && (0 == libc.Xmemcmp(tls, ts+35376 /* "ation" */, (aBuf+uintptr((nBuf-5))), uint32(5))) {
- if fts5Porter_MGt0(tls, aBuf, (nBuf-5)) != 0 {
- libc.Xmemcpy(tls, (aBuf + uintptr((nBuf - 5))), ts+35268 /* "ate" */, uint32(3))
- *(*int32)(unsafe.Pointer(pnBuf)) = ((nBuf - 5) + 3)
+ } else if nBuf > 5 && 0 == libc.Xmemcmp(tls, ts+36736, aBuf+uintptr(nBuf-5), uint32(5)) {
+ if fts5Porter_MGt0(tls, aBuf, nBuf-5) != 0 {
+ libc.Xmemcpy(tls, aBuf+uintptr(nBuf-5), ts+36628 /* "ate" */, uint32(3))
+ *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - 5 + 3
}
- } else if (nBuf > 4) && (0 == libc.Xmemcmp(tls, ts+35382 /* "ator" */, (aBuf+uintptr((nBuf-4))), uint32(4))) {
- if fts5Porter_MGt0(tls, aBuf, (nBuf-4)) != 0 {
- libc.Xmemcpy(tls, (aBuf + uintptr((nBuf - 4))), ts+35268 /* "ate" */, uint32(3))
- *(*int32)(unsafe.Pointer(pnBuf)) = ((nBuf - 4) + 3)
+ } else if nBuf > 4 && 0 == libc.Xmemcmp(tls, ts+36742, aBuf+uintptr(nBuf-4), uint32(4)) {
+ if fts5Porter_MGt0(tls, aBuf, nBuf-4) != 0 {
+ libc.Xmemcpy(tls, aBuf+uintptr(nBuf-4), ts+36628 /* "ate" */, uint32(3))
+ *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - 4 + 3
}
}
break
case 's':
- if (nBuf > 5) && (0 == libc.Xmemcmp(tls, ts+35387 /* "alism" */, (aBuf+uintptr((nBuf-5))), uint32(5))) {
- if fts5Porter_MGt0(tls, aBuf, (nBuf-5)) != 0 {
- libc.Xmemcpy(tls, (aBuf + uintptr((nBuf - 5))), ts+35209 /* "al" */, uint32(2))
- *(*int32)(unsafe.Pointer(pnBuf)) = ((nBuf - 5) + 2)
+ if nBuf > 5 && 0 == libc.Xmemcmp(tls, ts+36747, aBuf+uintptr(nBuf-5), uint32(5)) {
+ if fts5Porter_MGt0(tls, aBuf, nBuf-5) != 0 {
+ libc.Xmemcpy(tls, aBuf+uintptr(nBuf-5), ts+36569 /* "al" */, uint32(2))
+ *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - 5 + 2
}
- } else if (nBuf > 7) && (0 == libc.Xmemcmp(tls, ts+35393 /* "iveness" */, (aBuf+uintptr((nBuf-7))), uint32(7))) {
- if fts5Porter_MGt0(tls, aBuf, (nBuf-7)) != 0 {
- libc.Xmemcpy(tls, (aBuf + uintptr((nBuf - 7))), ts+35280 /* "ive" */, uint32(3))
- *(*int32)(unsafe.Pointer(pnBuf)) = ((nBuf - 7) + 3)
+ } else if nBuf > 7 && 0 == libc.Xmemcmp(tls, ts+36753, aBuf+uintptr(nBuf-7), uint32(7)) {
+ if fts5Porter_MGt0(tls, aBuf, nBuf-7) != 0 {
+ libc.Xmemcpy(tls, aBuf+uintptr(nBuf-7), ts+36640 /* "ive" */, uint32(3))
+ *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - 7 + 3
}
- } else if (nBuf > 7) && (0 == libc.Xmemcmp(tls, ts+35401 /* "fulness" */, (aBuf+uintptr((nBuf-7))), uint32(7))) {
- if fts5Porter_MGt0(tls, aBuf, (nBuf-7)) != 0 {
- libc.Xmemcpy(tls, (aBuf + uintptr((nBuf - 7))), ts+35409 /* "ful" */, uint32(3))
- *(*int32)(unsafe.Pointer(pnBuf)) = ((nBuf - 7) + 3)
+ } else if nBuf > 7 && 0 == libc.Xmemcmp(tls, ts+36761, aBuf+uintptr(nBuf-7), uint32(7)) {
+ if fts5Porter_MGt0(tls, aBuf, nBuf-7) != 0 {
+ libc.Xmemcpy(tls, aBuf+uintptr(nBuf-7), ts+36769 /* "ful" */, uint32(3))
+ *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - 7 + 3
}
- } else if (nBuf > 7) && (0 == libc.Xmemcmp(tls, ts+35413 /* "ousness" */, (aBuf+uintptr((nBuf-7))), uint32(7))) {
- if fts5Porter_MGt0(tls, aBuf, (nBuf-7)) != 0 {
- libc.Xmemcpy(tls, (aBuf + uintptr((nBuf - 7))), ts+35276 /* "ous" */, uint32(3))
- *(*int32)(unsafe.Pointer(pnBuf)) = ((nBuf - 7) + 3)
+ } else if nBuf > 7 && 0 == libc.Xmemcmp(tls, ts+36773, aBuf+uintptr(nBuf-7), uint32(7)) {
+ if fts5Porter_MGt0(tls, aBuf, nBuf-7) != 0 {
+ libc.Xmemcpy(tls, aBuf+uintptr(nBuf-7), ts+36636 /* "ous" */, uint32(3))
+ *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - 7 + 3
}
}
break
case 't':
- if (nBuf > 5) && (0 == libc.Xmemcmp(tls, ts+35421 /* "aliti" */, (aBuf+uintptr((nBuf-5))), uint32(5))) {
- if fts5Porter_MGt0(tls, aBuf, (nBuf-5)) != 0 {
- libc.Xmemcpy(tls, (aBuf + uintptr((nBuf - 5))), ts+35209 /* "al" */, uint32(2))
- *(*int32)(unsafe.Pointer(pnBuf)) = ((nBuf - 5) + 2)
+ if nBuf > 5 && 0 == libc.Xmemcmp(tls, ts+36781, aBuf+uintptr(nBuf-5), uint32(5)) {
+ if fts5Porter_MGt0(tls, aBuf, nBuf-5) != 0 {
+ libc.Xmemcpy(tls, aBuf+uintptr(nBuf-5), ts+36569 /* "al" */, uint32(2))
+ *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - 5 + 2
}
- } else if (nBuf > 5) && (0 == libc.Xmemcmp(tls, ts+35427 /* "iviti" */, (aBuf+uintptr((nBuf-5))), uint32(5))) {
- if fts5Porter_MGt0(tls, aBuf, (nBuf-5)) != 0 {
- libc.Xmemcpy(tls, (aBuf + uintptr((nBuf - 5))), ts+35280 /* "ive" */, uint32(3))
- *(*int32)(unsafe.Pointer(pnBuf)) = ((nBuf - 5) + 3)
+ } else if nBuf > 5 && 0 == libc.Xmemcmp(tls, ts+36787, aBuf+uintptr(nBuf-5), uint32(5)) {
+ if fts5Porter_MGt0(tls, aBuf, nBuf-5) != 0 {
+ libc.Xmemcpy(tls, aBuf+uintptr(nBuf-5), ts+36640 /* "ive" */, uint32(3))
+ *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - 5 + 3
}
- } else if (nBuf > 6) && (0 == libc.Xmemcmp(tls, ts+35433 /* "biliti" */, (aBuf+uintptr((nBuf-6))), uint32(6))) {
- if fts5Porter_MGt0(tls, aBuf, (nBuf-6)) != 0 {
- libc.Xmemcpy(tls, (aBuf + uintptr((nBuf - 6))), ts+35294 /* "ble" */, uint32(3))
- *(*int32)(unsafe.Pointer(pnBuf)) = ((nBuf - 6) + 3)
+ } else if nBuf > 6 && 0 == libc.Xmemcmp(tls, ts+36793, aBuf+uintptr(nBuf-6), uint32(6)) {
+ if fts5Porter_MGt0(tls, aBuf, nBuf-6) != 0 {
+ libc.Xmemcpy(tls, aBuf+uintptr(nBuf-6), ts+36654 /* "ble" */, uint32(3))
+ *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - 6 + 3
}
}
break
@@ -188875,63 +191391,63 @@ func fts5PorterStep2(tls *libc.TLS, aBuf uintptr, pnBuf uintptr) int32 { /* sqli
return ret
}
-func fts5PorterStep3(tls *libc.TLS, aBuf uintptr, pnBuf uintptr) int32 { /* sqlite3.c:232932:12: */
+func fts5PorterStep3(tls *libc.TLS, aBuf uintptr, pnBuf uintptr) int32 { /* sqlite3.c:234846:12: */
var ret int32 = 0
var nBuf int32 = *(*int32)(unsafe.Pointer(pnBuf))
- switch int32(*(*uint8)(unsafe.Pointer(aBuf + uintptr((nBuf - 2))))) {
+ switch int32(*(*uint8)(unsafe.Pointer(aBuf + uintptr(nBuf-2)))) {
case 'a':
- if (nBuf > 4) && (0 == libc.Xmemcmp(tls, ts+35440 /* "ical" */, (aBuf+uintptr((nBuf-4))), uint32(4))) {
- if fts5Porter_MGt0(tls, aBuf, (nBuf-4)) != 0 {
- libc.Xmemcpy(tls, (aBuf + uintptr((nBuf - 4))), ts+35225 /* "ic" */, uint32(2))
- *(*int32)(unsafe.Pointer(pnBuf)) = ((nBuf - 4) + 2)
+ if nBuf > 4 && 0 == libc.Xmemcmp(tls, ts+36800, aBuf+uintptr(nBuf-4), uint32(4)) {
+ if fts5Porter_MGt0(tls, aBuf, nBuf-4) != 0 {
+ libc.Xmemcpy(tls, aBuf+uintptr(nBuf-4), ts+36585 /* "ic" */, uint32(2))
+ *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - 4 + 2
}
}
break
case 's':
- if (nBuf > 4) && (0 == libc.Xmemcmp(tls, ts+35445 /* "ness" */, (aBuf+uintptr((nBuf-4))), uint32(4))) {
- if fts5Porter_MGt0(tls, aBuf, (nBuf-4)) != 0 {
- *(*int32)(unsafe.Pointer(pnBuf)) = (nBuf - 4)
+ if nBuf > 4 && 0 == libc.Xmemcmp(tls, ts+36805, aBuf+uintptr(nBuf-4), uint32(4)) {
+ if fts5Porter_MGt0(tls, aBuf, nBuf-4) != 0 {
+ *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - 4
}
}
break
case 't':
- if (nBuf > 5) && (0 == libc.Xmemcmp(tls, ts+35450 /* "icate" */, (aBuf+uintptr((nBuf-5))), uint32(5))) {
- if fts5Porter_MGt0(tls, aBuf, (nBuf-5)) != 0 {
- libc.Xmemcpy(tls, (aBuf + uintptr((nBuf - 5))), ts+35225 /* "ic" */, uint32(2))
- *(*int32)(unsafe.Pointer(pnBuf)) = ((nBuf - 5) + 2)
+ if nBuf > 5 && 0 == libc.Xmemcmp(tls, ts+36810, aBuf+uintptr(nBuf-5), uint32(5)) {
+ if fts5Porter_MGt0(tls, aBuf, nBuf-5) != 0 {
+ libc.Xmemcpy(tls, aBuf+uintptr(nBuf-5), ts+36585 /* "ic" */, uint32(2))
+ *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - 5 + 2
}
- } else if (nBuf > 5) && (0 == libc.Xmemcmp(tls, ts+35456 /* "iciti" */, (aBuf+uintptr((nBuf-5))), uint32(5))) {
- if fts5Porter_MGt0(tls, aBuf, (nBuf-5)) != 0 {
- libc.Xmemcpy(tls, (aBuf + uintptr((nBuf - 5))), ts+35225 /* "ic" */, uint32(2))
- *(*int32)(unsafe.Pointer(pnBuf)) = ((nBuf - 5) + 2)
+ } else if nBuf > 5 && 0 == libc.Xmemcmp(tls, ts+36816, aBuf+uintptr(nBuf-5), uint32(5)) {
+ if fts5Porter_MGt0(tls, aBuf, nBuf-5) != 0 {
+ libc.Xmemcpy(tls, aBuf+uintptr(nBuf-5), ts+36585 /* "ic" */, uint32(2))
+ *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - 5 + 2
}
}
break
case 'u':
- if (nBuf > 3) && (0 == libc.Xmemcmp(tls, ts+35409 /* "ful" */, (aBuf+uintptr((nBuf-3))), uint32(3))) {
- if fts5Porter_MGt0(tls, aBuf, (nBuf-3)) != 0 {
- *(*int32)(unsafe.Pointer(pnBuf)) = (nBuf - 3)
+ if nBuf > 3 && 0 == libc.Xmemcmp(tls, ts+36769, aBuf+uintptr(nBuf-3), uint32(3)) {
+ if fts5Porter_MGt0(tls, aBuf, nBuf-3) != 0 {
+ *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - 3
}
}
break
case 'v':
- if (nBuf > 5) && (0 == libc.Xmemcmp(tls, ts+35462 /* "ative" */, (aBuf+uintptr((nBuf-5))), uint32(5))) {
- if fts5Porter_MGt0(tls, aBuf, (nBuf-5)) != 0 {
- *(*int32)(unsafe.Pointer(pnBuf)) = (nBuf - 5)
+ if nBuf > 5 && 0 == libc.Xmemcmp(tls, ts+36822, aBuf+uintptr(nBuf-5), uint32(5)) {
+ if fts5Porter_MGt0(tls, aBuf, nBuf-5) != 0 {
+ *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - 5
}
}
break
case 'z':
- if (nBuf > 5) && (0 == libc.Xmemcmp(tls, ts+35468 /* "alize" */, (aBuf+uintptr((nBuf-5))), uint32(5))) {
- if fts5Porter_MGt0(tls, aBuf, (nBuf-5)) != 0 {
- libc.Xmemcpy(tls, (aBuf + uintptr((nBuf - 5))), ts+35209 /* "al" */, uint32(2))
- *(*int32)(unsafe.Pointer(pnBuf)) = ((nBuf - 5) + 2)
+ if nBuf > 5 && 0 == libc.Xmemcmp(tls, ts+36828, aBuf+uintptr(nBuf-5), uint32(5)) {
+ if fts5Porter_MGt0(tls, aBuf, nBuf-5) != 0 {
+ libc.Xmemcpy(tls, aBuf+uintptr(nBuf-5), ts+36569 /* "al" */, uint32(2))
+ *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - 5 + 2
}
}
break
@@ -188940,29 +191456,29 @@ func fts5PorterStep3(tls *libc.TLS, aBuf uintptr, pnBuf uintptr) int32 { /* sqli
return ret
}
-func fts5PorterStep1B(tls *libc.TLS, aBuf uintptr, pnBuf uintptr) int32 { /* sqlite3.c:232998:12: */
+func fts5PorterStep1B(tls *libc.TLS, aBuf uintptr, pnBuf uintptr) int32 { /* sqlite3.c:234912:12: */
var ret int32 = 0
var nBuf int32 = *(*int32)(unsafe.Pointer(pnBuf))
- switch int32(*(*uint8)(unsafe.Pointer(aBuf + uintptr((nBuf - 2))))) {
+ switch int32(*(*uint8)(unsafe.Pointer(aBuf + uintptr(nBuf-2)))) {
case 'e':
- if (nBuf > 3) && (0 == libc.Xmemcmp(tls, ts+35474 /* "eed" */, (aBuf+uintptr((nBuf-3))), uint32(3))) {
- if fts5Porter_MGt0(tls, aBuf, (nBuf-3)) != 0 {
- libc.Xmemcpy(tls, (aBuf + uintptr((nBuf - 3))), ts+35478 /* "ee" */, uint32(2))
- *(*int32)(unsafe.Pointer(pnBuf)) = ((nBuf - 3) + 2)
- }
- } else if (nBuf > 2) && (0 == libc.Xmemcmp(tls, ts+35481 /* "ed" */, (aBuf+uintptr((nBuf-2))), uint32(2))) {
- if fts5Porter_Vowel(tls, aBuf, (nBuf-2)) != 0 {
- *(*int32)(unsafe.Pointer(pnBuf)) = (nBuf - 2)
+ if nBuf > 3 && 0 == libc.Xmemcmp(tls, ts+36834, aBuf+uintptr(nBuf-3), uint32(3)) {
+ if fts5Porter_MGt0(tls, aBuf, nBuf-3) != 0 {
+ libc.Xmemcpy(tls, aBuf+uintptr(nBuf-3), ts+36838 /* "ee" */, uint32(2))
+ *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - 3 + 2
+ }
+ } else if nBuf > 2 && 0 == libc.Xmemcmp(tls, ts+36841, aBuf+uintptr(nBuf-2), uint32(2)) {
+ if fts5Porter_Vowel(tls, aBuf, nBuf-2) != 0 {
+ *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - 2
ret = 1
}
}
break
case 'n':
- if (nBuf > 3) && (0 == libc.Xmemcmp(tls, ts+35484 /* "ing" */, (aBuf+uintptr((nBuf-3))), uint32(3))) {
- if fts5Porter_Vowel(tls, aBuf, (nBuf-3)) != 0 {
- *(*int32)(unsafe.Pointer(pnBuf)) = (nBuf - 3)
+ if nBuf > 3 && 0 == libc.Xmemcmp(tls, ts+36844, aBuf+uintptr(nBuf-3), uint32(3)) {
+ if fts5Porter_Vowel(tls, aBuf, nBuf-3) != 0 {
+ *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - 3
ret = 1
}
}
@@ -188977,23 +191493,23 @@ func fts5PorterStep1B(tls *libc.TLS, aBuf uintptr, pnBuf uintptr) int32 { /* sql
//
//
-func fts5PorterStep1A(tls *libc.TLS, aBuf uintptr, pnBuf uintptr) { /* sqlite3.c:233035:13: */
+func fts5PorterStep1A(tls *libc.TLS, aBuf uintptr, pnBuf uintptr) { /* sqlite3.c:234949:13: */
var nBuf int32 = *(*int32)(unsafe.Pointer(pnBuf))
- if int32(*(*uint8)(unsafe.Pointer(aBuf + uintptr((nBuf - 1))))) == 's' {
- if int32(*(*uint8)(unsafe.Pointer(aBuf + uintptr((nBuf - 2))))) == 'e' {
- if (((nBuf > 4) && (int32(*(*uint8)(unsafe.Pointer(aBuf + uintptr((nBuf - 4))))) == 's')) && (int32(*(*uint8)(unsafe.Pointer(aBuf + uintptr((nBuf - 3))))) == 's')) ||
- ((nBuf > 3) && (int32(*(*uint8)(unsafe.Pointer(aBuf + uintptr((nBuf - 3))))) == 'i')) {
- *(*int32)(unsafe.Pointer(pnBuf)) = (nBuf - 2)
+ if int32(*(*uint8)(unsafe.Pointer(aBuf + uintptr(nBuf-1)))) == 's' {
+ if int32(*(*uint8)(unsafe.Pointer(aBuf + uintptr(nBuf-2)))) == 'e' {
+ if nBuf > 4 && int32(*(*uint8)(unsafe.Pointer(aBuf + uintptr(nBuf-4)))) == 's' && int32(*(*uint8)(unsafe.Pointer(aBuf + uintptr(nBuf-3)))) == 's' ||
+ nBuf > 3 && int32(*(*uint8)(unsafe.Pointer(aBuf + uintptr(nBuf-3)))) == 'i' {
+ *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - 2
} else {
- *(*int32)(unsafe.Pointer(pnBuf)) = (nBuf - 1)
+ *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - 1
}
- } else if int32(*(*uint8)(unsafe.Pointer(aBuf + uintptr((nBuf - 2))))) != 's' {
- *(*int32)(unsafe.Pointer(pnBuf)) = (nBuf - 1)
+ } else if int32(*(*uint8)(unsafe.Pointer(aBuf + uintptr(nBuf-2)))) != 's' {
+ *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - 1
}
}
}
-func fts5PorterCb(tls *libc.TLS, pCtx uintptr, tflags int32, pToken uintptr, nToken int32, iStart int32, iEnd int32) int32 { /* sqlite3.c:233053:12: */
+func fts5PorterCb(tls *libc.TLS, pCtx uintptr, tflags int32, pToken uintptr, nToken int32, iStart int32, iEnd int32) int32 { /* sqlite3.c:234967:12: */
bp := tls.Alloc(4)
defer tls.Free(4)
@@ -189004,7 +191520,7 @@ func fts5PorterCb(tls *libc.TLS, pCtx uintptr, tflags int32, pToken uintptr, nTo
var c uint8
p = pCtx
- if !((nToken > FTS5_PORTER_MAX_TOKEN) || (nToken < 3)) {
+ if !(nToken > FTS5_PORTER_MAX_TOKEN || nToken < 3) {
goto __1
}
goto pass_through
@@ -189016,21 +191532,21 @@ __1:
// Step 1.
fts5PorterStep1A(tls, aBuf, bp /* &nBuf */)
- if !(fts5PorterStep1B(tls, aBuf, bp /* &nBuf */) != 0) {
+ if !(fts5PorterStep1B(tls, aBuf, bp) != 0) {
goto __2
}
- if !(fts5PorterStep1B2(tls, aBuf, bp /* &nBuf */) == 0) {
+ if !(fts5PorterStep1B2(tls, aBuf, bp) == 0) {
goto __3
}
- c = *(*uint8)(unsafe.Pointer(aBuf + uintptr((*(*int32)(unsafe.Pointer(bp /* nBuf */)) - 1))))
- if !(((((fts5PorterIsVowel(tls, c, 0) == 0) &&
- (int32(c) != 'l')) && (int32(c) != 's')) && (int32(c) != 'z')) && (int32(c) == int32(*(*uint8)(unsafe.Pointer(aBuf + uintptr((*(*int32)(unsafe.Pointer(bp /* nBuf */)) - 2))))))) {
+ c = *(*uint8)(unsafe.Pointer(aBuf + uintptr(*(*int32)(unsafe.Pointer(bp))-1)))
+ if !(fts5PorterIsVowel(tls, c, 0) == 0 &&
+ int32(c) != 'l' && int32(c) != 's' && int32(c) != 'z' && int32(c) == int32(*(*uint8)(unsafe.Pointer(aBuf + uintptr(*(*int32)(unsafe.Pointer(bp))-2))))) {
goto __4
}
*(*int32)(unsafe.Pointer(bp /* nBuf */))--
goto __5
__4:
- if !((fts5Porter_MEq1(tls, aBuf, *(*int32)(unsafe.Pointer(bp /* nBuf */))) != 0) && (fts5Porter_Ostar(tls, aBuf, *(*int32)(unsafe.Pointer(bp /* nBuf */))) != 0)) {
+ if !(fts5Porter_MEq1(tls, aBuf, *(*int32)(unsafe.Pointer(bp))) != 0 && fts5Porter_Ostar(tls, aBuf, *(*int32)(unsafe.Pointer(bp))) != 0) {
goto __6
}
*(*uint8)(unsafe.Pointer(aBuf + uintptr(libc.PostIncInt32(&*(*int32)(unsafe.Pointer(bp /* nBuf */)), 1)))) = uint8('e')
@@ -189044,10 +191560,10 @@ __2:
;
// Step 1C.
- if !((int32(*(*uint8)(unsafe.Pointer(aBuf + uintptr((*(*int32)(unsafe.Pointer(bp /* nBuf */)) - 1))))) == 'y') && (fts5Porter_Vowel(tls, aBuf, (*(*int32)(unsafe.Pointer(bp /* nBuf */))-1)) != 0)) {
+ if !(int32(*(*uint8)(unsafe.Pointer(aBuf + uintptr(*(*int32)(unsafe.Pointer(bp))-1)))) == 'y' && fts5Porter_Vowel(tls, aBuf, *(*int32)(unsafe.Pointer(bp))-1) != 0) {
goto __7
}
- *(*uint8)(unsafe.Pointer(aBuf + uintptr((*(*int32)(unsafe.Pointer(bp /* nBuf */)) - 1)))) = uint8('i')
+ *(*uint8)(unsafe.Pointer(aBuf + uintptr(*(*int32)(unsafe.Pointer(bp))-1))) = uint8('i')
__7:
;
@@ -189058,11 +191574,11 @@ __7:
// Step 5a.
- if !(int32(*(*uint8)(unsafe.Pointer(aBuf + uintptr((*(*int32)(unsafe.Pointer(bp /* nBuf */)) - 1))))) == 'e') {
+ if !(int32(*(*uint8)(unsafe.Pointer(aBuf + uintptr(*(*int32)(unsafe.Pointer(bp))-1)))) == 'e') {
goto __8
}
- if !((fts5Porter_MGt1(tls, aBuf, (*(*int32)(unsafe.Pointer(bp /* nBuf */))-1)) != 0) ||
- ((fts5Porter_MEq1(tls, aBuf, (*(*int32)(unsafe.Pointer(bp /* nBuf */))-1)) != 0) && !(fts5Porter_Ostar(tls, aBuf, (*(*int32)(unsafe.Pointer(bp /* nBuf */))-1)) != 0))) {
+ if !(fts5Porter_MGt1(tls, aBuf, *(*int32)(unsafe.Pointer(bp))-1) != 0 ||
+ fts5Porter_MEq1(tls, aBuf, *(*int32)(unsafe.Pointer(bp))-1) != 0 && !(fts5Porter_Ostar(tls, aBuf, *(*int32)(unsafe.Pointer(bp))-1) != 0)) {
goto __9
}
*(*int32)(unsafe.Pointer(bp /* nBuf */))--
@@ -189072,8 +191588,8 @@ __8:
;
// Step 5b.
- if !((((*(*int32)(unsafe.Pointer(bp /* nBuf */)) > 1) && (int32(*(*uint8)(unsafe.Pointer(aBuf + uintptr((*(*int32)(unsafe.Pointer(bp /* nBuf */)) - 1))))) == 'l')) &&
- (int32(*(*uint8)(unsafe.Pointer(aBuf + uintptr((*(*int32)(unsafe.Pointer(bp /* nBuf */)) - 2))))) == 'l')) && (fts5Porter_MGt1(tls, aBuf, (*(*int32)(unsafe.Pointer(bp /* nBuf */))-1)) != 0)) {
+ if !(*(*int32)(unsafe.Pointer(bp)) > 1 && int32(*(*uint8)(unsafe.Pointer(aBuf + uintptr(*(*int32)(unsafe.Pointer(bp))-1)))) == 'l' &&
+ int32(*(*uint8)(unsafe.Pointer(aBuf + uintptr(*(*int32)(unsafe.Pointer(bp))-2)))) == 'l' && fts5Porter_MGt1(tls, aBuf, *(*int32)(unsafe.Pointer(bp))-1) != 0) {
goto __10
}
*(*int32)(unsafe.Pointer(bp /* nBuf */))--
@@ -189091,7 +191607,7 @@ pass_through:
}
// Tokenize using the porter tokenizer.
-func fts5PorterTokenize(tls *libc.TLS, pTokenizer uintptr, pCtx uintptr, flags int32, pText uintptr, nText int32, xToken uintptr) int32 { /* sqlite3.c:233122:12: */
+func fts5PorterTokenize(tls *libc.TLS, pTokenizer uintptr, pCtx uintptr, flags int32, pText uintptr, nText int32, xToken uintptr) int32 { /* sqlite3.c:235036:12: */
bp := tls.Alloc(12)
defer tls.Free(12)
@@ -189112,20 +191628,20 @@ func fts5PorterTokenize(tls *libc.TLS, pTokenizer uintptr, pCtx uintptr, flags i
// *************************************************************************
//
// Start of trigram implementation.
-type TrigramTokenizer1 = struct{ FbFold int32 } /* sqlite3.c:233142:9 */
+type TrigramTokenizer1 = struct{ FbFold int32 } /* sqlite3.c:235056:9 */
// *************************************************************************
//
// Start of trigram implementation.
-type TrigramTokenizer = TrigramTokenizer1 /* sqlite3.c:233142:33 */
+type TrigramTokenizer = TrigramTokenizer1 /* sqlite3.c:235056:33 */
// Free a trigram tokenizer.
-func fts5TriDelete(tls *libc.TLS, p uintptr) { /* sqlite3.c:233150:13: */
+func fts5TriDelete(tls *libc.TLS, p uintptr) { /* sqlite3.c:235064:13: */
Xsqlite3_free(tls, p)
}
// Allocate a trigram tokenizer.
-func fts5TriCreate(tls *libc.TLS, pUnused uintptr, azArg uintptr, nArg int32, ppOut uintptr) int32 { /* sqlite3.c:233157:12: */
+func fts5TriCreate(tls *libc.TLS, pUnused uintptr, azArg uintptr, nArg int32, ppOut uintptr) int32 { /* sqlite3.c:235071:12: */
var rc int32 = SQLITE_OK
var pNew uintptr = Xsqlite3_malloc(tls, int32(unsafe.Sizeof(TrigramTokenizer{})))
_ = pUnused
@@ -189134,13 +191650,13 @@ func fts5TriCreate(tls *libc.TLS, pUnused uintptr, azArg uintptr, nArg int32, pp
} else {
var i int32
(*TrigramTokenizer)(unsafe.Pointer(pNew)).FbFold = 1
- for i = 0; (rc == SQLITE_OK) && (i < nArg); i = i + (2) {
- var zArg uintptr = *(*uintptr)(unsafe.Pointer(azArg + uintptr((i+1))*4))
- if 0 == Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(azArg + uintptr(i)*4)), ts+35488 /* "case_sensitive" */) {
- if ((int32(*(*uint8)(unsafe.Pointer(zArg))) != '0') && (int32(*(*uint8)(unsafe.Pointer(zArg))) != '1')) || (*(*uint8)(unsafe.Pointer(zArg + 1)) != 0) {
+ for i = 0; rc == SQLITE_OK && i < nArg; i = i + 2 {
+ var zArg uintptr = *(*uintptr)(unsafe.Pointer(azArg + uintptr(i+1)*4))
+ if 0 == Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(azArg + uintptr(i)*4)), ts+36848) {
+ if int32(*(*uint8)(unsafe.Pointer(zArg))) != '0' && int32(*(*uint8)(unsafe.Pointer(zArg))) != '1' || *(*uint8)(unsafe.Pointer(zArg + 1)) != 0 {
rc = SQLITE_ERROR
} else {
- (*TrigramTokenizer)(unsafe.Pointer(pNew)).FbFold = (libc.Bool32(int32(*(*uint8)(unsafe.Pointer(zArg))) == '0'))
+ (*TrigramTokenizer)(unsafe.Pointer(pNew)).FbFold = libc.Bool32(int32(*(*uint8)(unsafe.Pointer(zArg))) == '0')
}
} else {
rc = SQLITE_ERROR
@@ -189156,7 +191672,7 @@ func fts5TriCreate(tls *libc.TLS, pUnused uintptr, azArg uintptr, nArg int32, pp
}
// Trigram tokenizer tokenize routine.
-func fts5TriTokenize(tls *libc.TLS, pTok uintptr, pCtx uintptr, unusedFlags int32, pText uintptr, nText int32, xToken uintptr) int32 { /* sqlite3.c:233195:12: */
+func fts5TriTokenize(tls *libc.TLS, pTok uintptr, pCtx uintptr, unusedFlags int32, pText uintptr, nText int32, xToken uintptr) int32 { /* sqlite3.c:235109:12: */
bp := tls.Alloc(32)
defer tls.Free(32)
@@ -189165,22 +191681,22 @@ func fts5TriTokenize(tls *libc.TLS, pTok uintptr, pCtx uintptr, unusedFlags int3
// var aBuf [32]uint8 at bp, 32
var zIn uintptr = pText
- var zEof uintptr = (zIn + uintptr(nText))
+ var zEof uintptr = zIn + uintptr(nText)
var iCode U32
_ = unusedFlags
for 1 != 0 {
var zOut uintptr = bp /* aBuf */
- var iStart int32 = ((int32(zIn) - int32(pText)) / 1)
+ var iStart int32 = (int32(zIn) - int32(pText)) / 1
var zNext uintptr
iCode = U32(*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&zIn, 1))))
if iCode >= U32(0xc0) {
- iCode = U32(sqlite3Utf8Trans1[(iCode - U32(0xc0))])
- for (zIn != zEof) && ((int32(*(*uint8)(unsafe.Pointer(zIn))) & 0xc0) == 0x80) {
- iCode = ((iCode << 6) + (U32(0x3f & int32(*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&zIn, 1)))))))
+ iCode = U32(sqlite3Utf8Trans1[iCode-U32(0xc0)])
+ for zIn != zEof && int32(*(*uint8)(unsafe.Pointer(zIn)))&0xc0 == 0x80 {
+ iCode = iCode<<6 + U32(0x3f&int32(*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&zIn, 1)))))
}
- if ((iCode < U32(0x80)) || ((iCode & 0xFFFFF800) == U32(0xD800))) || ((iCode & 0xFFFFFFFE) == U32(0xFFFE)) {
+ if iCode < U32(0x80) || iCode&0xFFFFF800 == U32(0xD800) || iCode&0xFFFFFFFE == U32(0xFFFE) {
iCode = U32(0xFFFD)
}
}
@@ -189195,29 +191711,29 @@ func fts5TriTokenize(tls *libc.TLS, pTok uintptr, pCtx uintptr, unusedFlags int3
}
{
if iCode < U32(0x00080) {
- *(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&zOut, 1))) = uint8((U8(iCode & U32(0xFF))))
+ *(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&zOut, 1))) = uint8(U8(iCode & U32(0xFF)))
} else if iCode < U32(0x00800) {
- *(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&zOut, 1))) = (uint8(0xC0 + int32((U8((iCode >> 6) & U32(0x1F))))))
- *(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&zOut, 1))) = (uint8(0x80 + int32((U8(iCode & U32(0x3F))))))
+ *(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&zOut, 1))) = uint8(0xC0 + int32(U8(iCode>>6&U32(0x1F))))
+ *(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&zOut, 1))) = uint8(0x80 + int32(U8(iCode&U32(0x3F))))
} else if iCode < U32(0x10000) {
- *(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&zOut, 1))) = (uint8(0xE0 + int32((U8((iCode >> 12) & U32(0x0F))))))
- *(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&zOut, 1))) = (uint8(0x80 + int32((U8((iCode >> 6) & U32(0x3F))))))
- *(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&zOut, 1))) = (uint8(0x80 + int32((U8(iCode & U32(0x3F))))))
+ *(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&zOut, 1))) = uint8(0xE0 + int32(U8(iCode>>12&U32(0x0F))))
+ *(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&zOut, 1))) = uint8(0x80 + int32(U8(iCode>>6&U32(0x3F))))
+ *(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&zOut, 1))) = uint8(0x80 + int32(U8(iCode&U32(0x3F))))
} else {
- *(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&zOut, 1))) = (uint8(0xF0 + int32((U8((iCode >> 18) & U32(0x07))))))
- *(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&zOut, 1))) = (uint8(0x80 + int32((U8((iCode >> 12) & U32(0x3F))))))
- *(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&zOut, 1))) = (uint8(0x80 + int32((U8((iCode >> 6) & U32(0x3F))))))
- *(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&zOut, 1))) = (uint8(0x80 + int32((U8(iCode & U32(0x3F))))))
+ *(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&zOut, 1))) = uint8(0xF0 + int32(U8(iCode>>18&U32(0x07))))
+ *(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&zOut, 1))) = uint8(0x80 + int32(U8(iCode>>12&U32(0x3F))))
+ *(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&zOut, 1))) = uint8(0x80 + int32(U8(iCode>>6&U32(0x3F))))
+ *(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&zOut, 1))) = uint8(0x80 + int32(U8(iCode&U32(0x3F))))
}
}
iCode = U32(*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&zIn, 1))))
if iCode >= U32(0xc0) {
- iCode = U32(sqlite3Utf8Trans1[(iCode - U32(0xc0))])
- for (zIn != zEof) && ((int32(*(*uint8)(unsafe.Pointer(zIn))) & 0xc0) == 0x80) {
- iCode = ((iCode << 6) + (U32(0x3f & int32(*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&zIn, 1)))))))
+ iCode = U32(sqlite3Utf8Trans1[iCode-U32(0xc0)])
+ for zIn != zEof && int32(*(*uint8)(unsafe.Pointer(zIn)))&0xc0 == 0x80 {
+ iCode = iCode<<6 + U32(0x3f&int32(*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&zIn, 1)))))
}
- if ((iCode < U32(0x80)) || ((iCode & 0xFFFFF800) == U32(0xD800))) || ((iCode & 0xFFFFFFFE) == U32(0xFFFE)) {
+ if iCode < U32(0x80) || iCode&0xFFFFF800 == U32(0xD800) || iCode&0xFFFFFFFE == U32(0xFFFE) {
iCode = U32(0xFFFD)
}
}
@@ -189234,29 +191750,29 @@ func fts5TriTokenize(tls *libc.TLS, pTok uintptr, pCtx uintptr, unusedFlags int3
}
{
if iCode < U32(0x00080) {
- *(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&zOut, 1))) = uint8((U8(iCode & U32(0xFF))))
+ *(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&zOut, 1))) = uint8(U8(iCode & U32(0xFF)))
} else if iCode < U32(0x00800) {
- *(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&zOut, 1))) = (uint8(0xC0 + int32((U8((iCode >> 6) & U32(0x1F))))))
- *(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&zOut, 1))) = (uint8(0x80 + int32((U8(iCode & U32(0x3F))))))
+ *(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&zOut, 1))) = uint8(0xC0 + int32(U8(iCode>>6&U32(0x1F))))
+ *(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&zOut, 1))) = uint8(0x80 + int32(U8(iCode&U32(0x3F))))
} else if iCode < U32(0x10000) {
- *(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&zOut, 1))) = (uint8(0xE0 + int32((U8((iCode >> 12) & U32(0x0F))))))
- *(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&zOut, 1))) = (uint8(0x80 + int32((U8((iCode >> 6) & U32(0x3F))))))
- *(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&zOut, 1))) = (uint8(0x80 + int32((U8(iCode & U32(0x3F))))))
+ *(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&zOut, 1))) = uint8(0xE0 + int32(U8(iCode>>12&U32(0x0F))))
+ *(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&zOut, 1))) = uint8(0x80 + int32(U8(iCode>>6&U32(0x3F))))
+ *(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&zOut, 1))) = uint8(0x80 + int32(U8(iCode&U32(0x3F))))
} else {
- *(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&zOut, 1))) = (uint8(0xF0 + int32((U8((iCode >> 18) & U32(0x07))))))
- *(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&zOut, 1))) = (uint8(0x80 + int32((U8((iCode >> 12) & U32(0x3F))))))
- *(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&zOut, 1))) = (uint8(0x80 + int32((U8((iCode >> 6) & U32(0x3F))))))
- *(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&zOut, 1))) = (uint8(0x80 + int32((U8(iCode & U32(0x3F))))))
+ *(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&zOut, 1))) = uint8(0xF0 + int32(U8(iCode>>18&U32(0x07))))
+ *(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&zOut, 1))) = uint8(0x80 + int32(U8(iCode>>12&U32(0x3F))))
+ *(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&zOut, 1))) = uint8(0x80 + int32(U8(iCode>>6&U32(0x3F))))
+ *(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&zOut, 1))) = uint8(0x80 + int32(U8(iCode&U32(0x3F))))
}
}
iCode = U32(*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&zIn, 1))))
if iCode >= U32(0xc0) {
- iCode = U32(sqlite3Utf8Trans1[(iCode - U32(0xc0))])
- for (zIn != zEof) && ((int32(*(*uint8)(unsafe.Pointer(zIn))) & 0xc0) == 0x80) {
- iCode = ((iCode << 6) + (U32(0x3f & int32(*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&zIn, 1)))))))
+ iCode = U32(sqlite3Utf8Trans1[iCode-U32(0xc0)])
+ for zIn != zEof && int32(*(*uint8)(unsafe.Pointer(zIn)))&0xc0 == 0x80 {
+ iCode = iCode<<6 + U32(0x3f&int32(*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&zIn, 1)))))
}
- if ((iCode < U32(0x80)) || ((iCode & 0xFFFFF800) == U32(0xD800))) || ((iCode & 0xFFFFFFFE) == U32(0xFFFE)) {
+ if iCode < U32(0x80) || iCode&0xFFFFF800 == U32(0xD800) || iCode&0xFFFFFFFE == U32(0xFFFE) {
iCode = U32(0xFFFD)
}
}
@@ -189269,19 +191785,19 @@ func fts5TriTokenize(tls *libc.TLS, pTok uintptr, pCtx uintptr, unusedFlags int3
}
{
if iCode < U32(0x00080) {
- *(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&zOut, 1))) = uint8((U8(iCode & U32(0xFF))))
+ *(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&zOut, 1))) = uint8(U8(iCode & U32(0xFF)))
} else if iCode < U32(0x00800) {
- *(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&zOut, 1))) = (uint8(0xC0 + int32((U8((iCode >> 6) & U32(0x1F))))))
- *(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&zOut, 1))) = (uint8(0x80 + int32((U8(iCode & U32(0x3F))))))
+ *(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&zOut, 1))) = uint8(0xC0 + int32(U8(iCode>>6&U32(0x1F))))
+ *(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&zOut, 1))) = uint8(0x80 + int32(U8(iCode&U32(0x3F))))
} else if iCode < U32(0x10000) {
- *(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&zOut, 1))) = (uint8(0xE0 + int32((U8((iCode >> 12) & U32(0x0F))))))
- *(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&zOut, 1))) = (uint8(0x80 + int32((U8((iCode >> 6) & U32(0x3F))))))
- *(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&zOut, 1))) = (uint8(0x80 + int32((U8(iCode & U32(0x3F))))))
+ *(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&zOut, 1))) = uint8(0xE0 + int32(U8(iCode>>12&U32(0x0F))))
+ *(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&zOut, 1))) = uint8(0x80 + int32(U8(iCode>>6&U32(0x3F))))
+ *(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&zOut, 1))) = uint8(0x80 + int32(U8(iCode&U32(0x3F))))
} else {
- *(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&zOut, 1))) = (uint8(0xF0 + int32((U8((iCode >> 18) & U32(0x07))))))
- *(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&zOut, 1))) = (uint8(0x80 + int32((U8((iCode >> 12) & U32(0x3F))))))
- *(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&zOut, 1))) = (uint8(0x80 + int32((U8((iCode >> 6) & U32(0x3F))))))
- *(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&zOut, 1))) = (uint8(0x80 + int32((U8(iCode & U32(0x3F))))))
+ *(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&zOut, 1))) = uint8(0xF0 + int32(U8(iCode>>18&U32(0x07))))
+ *(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&zOut, 1))) = uint8(0x80 + int32(U8(iCode>>12&U32(0x3F))))
+ *(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&zOut, 1))) = uint8(0x80 + int32(U8(iCode>>6&U32(0x3F))))
+ *(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&zOut, 1))) = uint8(0x80 + int32(U8(iCode&U32(0x3F))))
}
}
@@ -189290,7 +191806,7 @@ func fts5TriTokenize(tls *libc.TLS, pTok uintptr, pCtx uintptr, unusedFlags int3
}
rc = (*struct {
f func(*libc.TLS, uintptr, int32, uintptr, int32, int32, int32) int32
- })(unsafe.Pointer(&struct{ uintptr }{xToken})).f(tls, pCtx, 0, bp /* &aBuf[0] */, (int32((zOut - bp /* &aBuf[0] */) / 1)), iStart, (int32(((uintptr(iStart) + zOut) - bp /* &aBuf[0] */) / 1)))
+ })(unsafe.Pointer(&struct{ uintptr }{xToken})).f(tls, pCtx, 0, bp /* &aBuf[0] */, int32((zOut-bp) /* &aBuf[0] */ /1), iStart, int32((uintptr(iStart)+zOut-bp) /* &aBuf[0] */ /1))
if rc != SQLITE_OK {
break
}
@@ -189309,7 +191825,7 @@ func fts5TriTokenize(tls *libc.TLS, pTok uintptr, pCtx uintptr, unusedFlags int3
// "trigram" tokenizer, case_sensitive=1 - FTS5_PATTERN_GLOB
// "trigram" tokenizer, case_sensitive=0 (the default) - FTS5_PATTERN_LIKE
// all other tokenizers - FTS5_PATTERN_NONE
-func sqlite3Fts5TokenizerPattern(tls *libc.TLS, xCreate uintptr, pTok uintptr) int32 { /* sqlite3.c:233255:12: */
+func sqlite3Fts5TokenizerPattern(tls *libc.TLS, xCreate uintptr, pTok uintptr) int32 { /* sqlite3.c:235169:12: */
if xCreate == *(*uintptr)(unsafe.Pointer(&struct {
f func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32
}{fts5TriCreate})) {
@@ -189323,27 +191839,27 @@ func sqlite3Fts5TokenizerPattern(tls *libc.TLS, xCreate uintptr, pTok uintptr) i
}
// Register all built-in tokenizers with FTS5.
-func sqlite3Fts5TokenizerInit(tls *libc.TLS, pApi uintptr) int32 { /* sqlite3.c:233269:12: */
+func sqlite3Fts5TokenizerInit(tls *libc.TLS, pApi uintptr) int32 { /* sqlite3.c:235183:12: */
bp := tls.Alloc(64)
defer tls.Free(64)
*(*[4]BuiltinTokenizer)(unsafe.Pointer(bp /* aBuiltin */)) = [4]BuiltinTokenizer{
- {FzName: ts + 35199 /* "unicode61" */, Fx: Fts5_tokenizer{FxCreate: *(*uintptr)(unsafe.Pointer(&struct {
+ {FzName: ts + 36559 /* "unicode61" */, Fx: Fts5_tokenizer{FxCreate: *(*uintptr)(unsafe.Pointer(&struct {
f func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32
}{fts5UnicodeCreate})), FxDelete: *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{fts5UnicodeDelete})), FxTokenize: *(*uintptr)(unsafe.Pointer(&struct {
f func(*libc.TLS, uintptr, uintptr, int32, uintptr, int32, uintptr) int32
}{fts5UnicodeTokenize}))}},
- {FzName: ts + 35503 /* "ascii" */, Fx: Fts5_tokenizer{FxCreate: *(*uintptr)(unsafe.Pointer(&struct {
+ {FzName: ts + 36863 /* "ascii" */, Fx: Fts5_tokenizer{FxCreate: *(*uintptr)(unsafe.Pointer(&struct {
f func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32
}{fts5AsciiCreate})), FxDelete: *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{fts5AsciiDelete})), FxTokenize: *(*uintptr)(unsafe.Pointer(&struct {
f func(*libc.TLS, uintptr, uintptr, int32, uintptr, int32, uintptr) int32
}{fts5AsciiTokenize}))}},
- {FzName: ts + 35509 /* "porter" */, Fx: Fts5_tokenizer{FxCreate: *(*uintptr)(unsafe.Pointer(&struct {
+ {FzName: ts + 36869 /* "porter" */, Fx: Fts5_tokenizer{FxCreate: *(*uintptr)(unsafe.Pointer(&struct {
f func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32
}{fts5PorterCreate})), FxDelete: *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{fts5PorterDelete})), FxTokenize: *(*uintptr)(unsafe.Pointer(&struct {
f func(*libc.TLS, uintptr, uintptr, int32, uintptr, int32, uintptr) int32
}{fts5PorterTokenize}))}},
- {FzName: ts + 35516 /* "trigram" */, Fx: Fts5_tokenizer{FxCreate: *(*uintptr)(unsafe.Pointer(&struct {
+ {FzName: ts + 36876 /* "trigram" */, Fx: Fts5_tokenizer{FxCreate: *(*uintptr)(unsafe.Pointer(&struct {
f func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32
}{fts5TriCreate})), FxDelete: *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{fts5TriDelete})), FxTokenize: *(*uintptr)(unsafe.Pointer(&struct {
f func(*libc.TLS, uintptr, uintptr, int32, uintptr, int32, uintptr) int32
@@ -189353,13 +191869,13 @@ func sqlite3Fts5TokenizerInit(tls *libc.TLS, pApi uintptr) int32 { /* sqlite3.c:
var rc int32 = SQLITE_OK // Return code
var i int32 // To iterate through builtin functions
- for i = 0; (rc == SQLITE_OK) && (i < (int32(uint32(unsafe.Sizeof([4]BuiltinTokenizer{})) / uint32(unsafe.Sizeof(BuiltinTokenizer{}))))); i++ {
+ for i = 0; rc == SQLITE_OK && i < int32(uint32(unsafe.Sizeof([4]BuiltinTokenizer{}))/uint32(unsafe.Sizeof(BuiltinTokenizer{}))); i++ {
rc = (*struct {
f func(*libc.TLS, uintptr, uintptr, uintptr, uintptr, uintptr) int32
})(unsafe.Pointer(&struct{ uintptr }{(*Fts5_api)(unsafe.Pointer(pApi)).FxCreateTokenizer})).f(tls, pApi,
(*BuiltinTokenizer)(unsafe.Pointer(bp /* &aBuiltin */ +uintptr(i)*16)).FzName,
pApi,
- (bp /* &aBuiltin */ + uintptr(i)*16 + 4 /* &.x */),
+ bp+uintptr(i)*16+4,
uintptr(0))
}
@@ -189369,7 +191885,7 @@ func sqlite3Fts5TokenizerInit(tls *libc.TLS, pApi uintptr) int32 { /* sqlite3.c:
type BuiltinTokenizer = struct {
FzName uintptr
Fx Fts5_tokenizer
-} /* sqlite3.c:233270:3 */
+} /* sqlite3.c:235184:3 */
// 2012-05-25
//
@@ -189392,7 +191908,7 @@ type BuiltinTokenizer = struct {
// SMALL LETTER E WITH DIAERESIS" - return 65 ("LATIN SMALL LETTER
// E"). The resuls of passing a codepoint that corresponds to an
// uppercase letter are undefined.
-func fts5_remove_diacritic(tls *libc.TLS, c int32, bComplex int32) int32 { /* sqlite3.c:233325:12: */
+func fts5_remove_diacritic(tls *libc.TLS, c int32, bComplex int32) int32 { /* sqlite3.c:235239:12: */
bp := tls.Alloc(378)
defer tls.Free(378)
@@ -189421,58 +191937,58 @@ func fts5_remove_diacritic(tls *libc.TLS, c int32, bComplex int32) int32 { /* sq
uint8('j'), uint8('k'), uint8('l'), uint8('n'), uint8('o'), uint8('r'),
uint8('s'), uint8('t'), uint8('u'), uint8('u'), uint8('w'), uint8('y'),
uint8('z'), uint8('o'), uint8('u'), uint8('a'), uint8('i'), uint8('o'),
- uint8('u'), (uint8('u' | (int32(uint8(0x80))))), (uint8('a' | (int32(uint8(0x80))))), uint8('g'), uint8('k'), uint8('o'),
- (uint8('o' | (int32(uint8(0x80))))), uint8('j'), uint8('g'), uint8('n'), (uint8('a' | (int32(uint8(0x80))))), uint8('a'),
+ uint8('u'), uint8('u' | int32(uint8(0x80))), uint8('a' | int32(uint8(0x80))), uint8('g'), uint8('k'), uint8('o'),
+ uint8('o' | int32(uint8(0x80))), uint8('j'), uint8('g'), uint8('n'), uint8('a' | int32(uint8(0x80))), uint8('a'),
uint8('e'), uint8('i'), uint8('o'), uint8('r'), uint8('u'), uint8('s'),
- uint8('t'), uint8('h'), uint8('a'), uint8('e'), (uint8('o' | (int32(uint8(0x80))))), uint8('o'),
- (uint8('o' | (int32(uint8(0x80))))), uint8('y'), uint8(0), uint8(0), uint8(0), uint8(0),
+ uint8('t'), uint8('h'), uint8('a'), uint8('e'), uint8('o' | int32(uint8(0x80))), uint8('o'),
+ uint8('o' | int32(uint8(0x80))), uint8('y'), uint8(0), uint8(0), uint8(0), uint8(0),
uint8(0), uint8(0), uint8(0), uint8(0), uint8('a'), uint8('b'),
- (uint8('c' | (int32(uint8(0x80))))), uint8('d'), uint8('d'), (uint8('e' | (int32(uint8(0x80))))), uint8('e'), (uint8('e' | (int32(uint8(0x80))))),
- uint8('f'), uint8('g'), uint8('h'), uint8('h'), uint8('i'), (uint8('i' | (int32(uint8(0x80))))),
- uint8('k'), uint8('l'), (uint8('l' | (int32(uint8(0x80))))), uint8('l'), uint8('m'), uint8('n'),
- (uint8('o' | (int32(uint8(0x80))))), uint8('p'), uint8('r'), (uint8('r' | (int32(uint8(0x80))))), uint8('r'), uint8('s'),
- (uint8('s' | (int32(uint8(0x80))))), uint8('t'), uint8('u'), (uint8('u' | (int32(uint8(0x80))))), uint8('v'), uint8('w'),
+ uint8('c' | int32(uint8(0x80))), uint8('d'), uint8('d'), uint8('e' | int32(uint8(0x80))), uint8('e'), uint8('e' | int32(uint8(0x80))),
+ uint8('f'), uint8('g'), uint8('h'), uint8('h'), uint8('i'), uint8('i' | int32(uint8(0x80))),
+ uint8('k'), uint8('l'), uint8('l' | int32(uint8(0x80))), uint8('l'), uint8('m'), uint8('n'),
+ uint8('o' | int32(uint8(0x80))), uint8('p'), uint8('r'), uint8('r' | int32(uint8(0x80))), uint8('r'), uint8('s'),
+ uint8('s' | int32(uint8(0x80))), uint8('t'), uint8('u'), uint8('u' | int32(uint8(0x80))), uint8('v'), uint8('w'),
uint8('w'), uint8('x'), uint8('y'), uint8('z'), uint8('h'), uint8('t'),
- uint8('w'), uint8('y'), uint8('a'), (uint8('a' | (int32(uint8(0x80))))), (uint8('a' | (int32(uint8(0x80))))), (uint8('a' | (int32(uint8(0x80))))),
- uint8('e'), (uint8('e' | (int32(uint8(0x80))))), (uint8('e' | (int32(uint8(0x80))))), uint8('i'), uint8('o'), (uint8('o' | (int32(uint8(0x80))))),
- (uint8('o' | (int32(uint8(0x80))))), (uint8('o' | (int32(uint8(0x80))))), uint8('u'), (uint8('u' | (int32(uint8(0x80))))), (uint8('u' | (int32(uint8(0x80))))), uint8('y'),
+ uint8('w'), uint8('y'), uint8('a'), uint8('a' | int32(uint8(0x80))), uint8('a' | int32(uint8(0x80))), uint8('a' | int32(uint8(0x80))),
+ uint8('e'), uint8('e' | int32(uint8(0x80))), uint8('e' | int32(uint8(0x80))), uint8('i'), uint8('o'), uint8('o' | int32(uint8(0x80))),
+ uint8('o' | int32(uint8(0x80))), uint8('o' | int32(uint8(0x80))), uint8('u'), uint8('u' | int32(uint8(0x80))), uint8('u' | int32(uint8(0x80))), uint8('y'),
}
- var key uint32 = (((uint32(c)) << 3) | uint32(0x00000007))
+ var key uint32 = uint32(c)<<3 | uint32(0x00000007)
var iRes int32 = 0
- var iHi int32 = (int32((uint32(unsafe.Sizeof([126]uint16{})) / uint32(unsafe.Sizeof(uint16(0)))) - uint32(1)))
+ var iHi int32 = int32(uint32(unsafe.Sizeof([126]uint16{}))/uint32(unsafe.Sizeof(uint16(0))) - uint32(1))
var iLo int32 = 0
for iHi >= iLo {
- var iTest int32 = ((iHi + iLo) / 2)
- if key >= uint32(*(*uint16)(unsafe.Pointer(bp /* &aDia[0] */ + uintptr(iTest)*2))) {
+ var iTest int32 = (iHi + iLo) / 2
+ if key >= uint32(*(*uint16)(unsafe.Pointer(bp + uintptr(iTest)*2))) {
iRes = iTest
- iLo = (iTest + 1)
+ iLo = iTest + 1
} else {
- iHi = (iTest - 1)
+ iHi = iTest - 1
}
}
- if (bComplex == 0) && ((int32(*(*uint8)(unsafe.Pointer(bp + 252 /* &aChar[0] */ + uintptr(iRes)))) & 0x80) != 0) {
+ if bComplex == 0 && int32(*(*uint8)(unsafe.Pointer(bp + 252 + uintptr(iRes))))&0x80 != 0 {
return c
}
- if c > ((int32(*(*uint16)(unsafe.Pointer(bp /* &aDia[0] */ + uintptr(iRes)*2))) >> 3) + (int32(*(*uint16)(unsafe.Pointer(bp /* &aDia[0] */ + uintptr(iRes)*2))) & 0x07)) {
+ if c > int32(*(*uint16)(unsafe.Pointer(bp + uintptr(iRes)*2)))>>3+int32(*(*uint16)(unsafe.Pointer(bp + uintptr(iRes)*2)))&0x07 {
return c
}
- return (int32(*(*uint8)(unsafe.Pointer(bp + 252 /* &aChar[0] */ + uintptr(iRes)))) & 0x7F)
+ return int32(*(*uint8)(unsafe.Pointer(bp + 252 + uintptr(iRes)))) & 0x7F
}
// Return true if the argument interpreted as a unicode codepoint
// is a diacritical modifier character.
-func sqlite3Fts5UnicodeIsdiacritic(tls *libc.TLS, c int32) int32 { /* sqlite3.c:233392:12: */
+func sqlite3Fts5UnicodeIsdiacritic(tls *libc.TLS, c int32) int32 { /* sqlite3.c:235306:12: */
var mask0 uint32 = uint32(0x08029FDF)
var mask1 uint32 = uint32(0x000361F8)
- if (c < 768) || (c > 817) {
+ if c < 768 || c > 817 {
return 0
}
- if c < (768 + 32) {
- return (int32(mask0 & (uint32(uint32(1)) << (c - 768))))
+ if c < 768+32 {
+ return int32(mask0 & (uint32(uint32(1)) << (c - 768)))
}
- return (int32(mask1 & (uint32(uint32(1)) << ((c - 768) - 32))))
+ return int32(mask1 & (uint32(uint32(1)) << (c - 768 - 32)))
}
// Interpret the argument as a unicode codepoint. If the codepoint
@@ -189482,42 +191998,42 @@ func sqlite3Fts5UnicodeIsdiacritic(tls *libc.TLS, c int32) int32 { /* sqlite3.c:
//
// The results are undefined if the value passed to this function
// is less than zero.
-func sqlite3Fts5UnicodeFold(tls *libc.TLS, c int32, eRemoveDiacritic int32) int32 { /* sqlite3.c:233411:12: */
+func sqlite3Fts5UnicodeFold(tls *libc.TLS, c int32, eRemoveDiacritic int32) int32 { /* sqlite3.c:235325:12: */
var ret int32 = c
if c < 128 {
- if (c >= 'A') && (c <= 'Z') {
- ret = (c + ('a' - 'A'))
+ if c >= 'A' && c <= 'Z' {
+ ret = c + ('a' - 'A')
}
} else if c < 65536 {
var p uintptr
- var iHi int32 = (int32((uint32(unsafe.Sizeof(aEntry)) / uint32(unsafe.Sizeof(TableEntry{}))) - uint32(1)))
+ var iHi int32 = int32(uint32(unsafe.Sizeof(aEntry))/uint32(unsafe.Sizeof(TableEntry{})) - uint32(1))
var iLo int32 = 0
var iRes int32 = -1
for iHi >= iLo {
- var iTest int32 = ((iHi + iLo) / 2)
- var cmp int32 = (c - int32(aEntry[iTest].FiCode))
+ var iTest int32 = (iHi + iLo) / 2
+ var cmp int32 = c - int32(aEntry[iTest].FiCode)
if cmp >= 0 {
iRes = iTest
- iLo = (iTest + 1)
+ iLo = iTest + 1
} else {
- iHi = (iTest - 1)
+ iHi = iTest - 1
}
}
- p = (uintptr(unsafe.Pointer(&aEntry)) + uintptr(iRes)*4)
- if (c < (int32((*TableEntry)(unsafe.Pointer(p)).FiCode) + int32((*TableEntry)(unsafe.Pointer(p)).FnRange))) && (0 == ((0x01 & int32((*TableEntry)(unsafe.Pointer(p)).Fflags)) & (int32((*TableEntry)(unsafe.Pointer(p)).FiCode) ^ c))) {
- ret = ((c + (int32(aiOff[(int32((*TableEntry)(unsafe.Pointer(p)).Fflags) >> 1)]))) & 0x0000FFFF)
+ p = uintptr(unsafe.Pointer(&aEntry)) + uintptr(iRes)*4
+ if c < int32((*TableEntry)(unsafe.Pointer(p)).FiCode)+int32((*TableEntry)(unsafe.Pointer(p)).FnRange) && 0 == 0x01&int32((*TableEntry)(unsafe.Pointer(p)).Fflags)&(int32((*TableEntry)(unsafe.Pointer(p)).FiCode)^c) {
+ ret = (c + int32(aiOff[int32((*TableEntry)(unsafe.Pointer(p)).Fflags)>>1])) & 0x0000FFFF
}
if eRemoveDiacritic != 0 {
- ret = fts5_remove_diacritic(tls, ret, (libc.Bool32(eRemoveDiacritic == 2)))
+ ret = fts5_remove_diacritic(tls, ret, libc.Bool32(eRemoveDiacritic == 2))
}
- } else if (c >= 66560) && (c < 66600) {
- ret = (c + 40)
+ } else if c >= 66560 && c < 66600 {
+ ret = c + 40
}
return ret
@@ -189543,7 +192059,7 @@ type TableEntry = struct {
FiCode uint16
Fflags uint8
FnRange uint8
-} /* sqlite3.c:233429:16 */
+} /* sqlite3.c:235343:16 */
var aEntry = [163]TableEntry{
{FiCode: uint16(65), Fflags: uint8(14), FnRange: uint8(26)}, {FiCode: uint16(181), Fflags: uint8(64), FnRange: uint8(1)}, {FiCode: uint16(192), Fflags: uint8(14), FnRange: uint8(23)},
@@ -189601,7 +192117,7 @@ var aEntry = [163]TableEntry{
{FiCode: uint16(42878), Fflags: uint8(1), FnRange: uint8(10)}, {FiCode: uint16(42891), FnRange: uint8(1)}, {FiCode: uint16(42893), Fflags: uint8(74), FnRange: uint8(1)},
{FiCode: uint16(42896), Fflags: uint8(1), FnRange: uint8(4)}, {FiCode: uint16(42912), Fflags: uint8(1), FnRange: uint8(10)}, {FiCode: uint16(42922), Fflags: uint8(72), FnRange: uint8(1)},
{FiCode: uint16(65313), Fflags: uint8(14), FnRange: uint8(26)},
-} /* sqlite3.c:233433:5 */
+} /* sqlite3.c:235347:5 */
var aiOff = [77]uint16{
uint16(1), uint16(2), uint16(8), uint16(15), uint16(16), uint16(26), uint16(28), uint16(32),
uint16(37), uint16(38), uint16(40), uint16(48), uint16(63), uint16(64), uint16(69), uint16(71),
@@ -189613,9 +192129,9 @@ var aiOff = [77]uint16{
uint16(65408), uint16(65410), uint16(65415), uint16(65424), uint16(65436), uint16(65439), uint16(65450), uint16(65462),
uint16(65472), uint16(65476), uint16(65478), uint16(65480), uint16(65482), uint16(65488), uint16(65506), uint16(65511),
uint16(65514), uint16(65521), uint16(65527), uint16(65528), uint16(65529),
-} /* sqlite3.c:233490:31 */
+} /* sqlite3.c:235404:31 */
-func sqlite3Fts5UnicodeCatParse(tls *libc.TLS, zCat uintptr, aArray uintptr) int32 { /* sqlite3.c:233547:12: */
+func sqlite3Fts5UnicodeCatParse(tls *libc.TLS, zCat uintptr, aArray uintptr) int32 { /* sqlite3.c:235461:12: */
*(*U8)(unsafe.Pointer(aArray)) = U8(1)
switch int32(*(*uint8)(unsafe.Pointer(zCat))) {
case 'C':
@@ -189812,7 +192328,7 @@ func sqlite3Fts5UnicodeCatParse(tls *libc.TLS, zCat uintptr, aArray uintptr) int
var aFts5UnicodeBlock = [17]U16{
U16(0), U16(1471), U16(1753), U16(1760), U16(1760), U16(1760), U16(1760), U16(1760), U16(1760), U16(1760),
U16(1760), U16(1760), U16(1760), U16(1760), U16(1760), U16(1763), U16(1765),
-} /* sqlite3.c:233665:12 */
+} /* sqlite3.c:235579:12 */
var aFts5UnicodeMap = [1765]U16{
U16(0), U16(32), U16(33), U16(36), U16(37), U16(40), U16(41), U16(42), U16(43), U16(44),
U16(45), U16(46), U16(48), U16(58), U16(60), U16(63), U16(65), U16(91), U16(92), U16(93),
@@ -189991,7 +192507,7 @@ var aFts5UnicodeMap = [1765]U16{
U16(62406), U16(62432), U16(62464), U16(62528), U16(62530), U16(62713), U16(62720), U16(62784), U16(62800), U16(62971),
U16(63045), U16(63104), U16(63232), U16(0), U16(42710), U16(42752), U16(46900), U16(46912), U16(47133), U16(63488),
U16(1), U16(32), U16(256), U16(0), U16(65533),
-} /* sqlite3.c:233669:12 */
+} /* sqlite3.c:235583:12 */
var aFts5UnicodeData = [1765]U16{
U16(1025), U16(61), U16(117), U16(55), U16(117), U16(54), U16(50), U16(53), U16(57), U16(53),
U16(49), U16(85), U16(333), U16(85), U16(121), U16(85), U16(841), U16(54), U16(53), U16(50),
@@ -190170,27 +192686,27 @@ var aFts5UnicodeData = [1765]U16{
U16(186), U16(570), U16(2042), U16(58), U16(5850), U16(154), U16(2010), U16(154), U16(794), U16(2266),
U16(378), U16(2266), U16(3738), U16(39), U16(39), U16(39), U16(39), U16(39), U16(39), U16(17351),
U16(34), U16(3074), U16(7692), U16(63), U16(63),
-} /* sqlite3.c:233848:12 */
+} /* sqlite3.c:235762:12 */
-func sqlite3Fts5UnicodeCategory(tls *libc.TLS, iCode U32) int32 { /* sqlite3.c:234028:12: */
+func sqlite3Fts5UnicodeCategory(tls *libc.TLS, iCode U32) int32 { /* sqlite3.c:235942:12: */
var iRes int32 = -1
var iHi int32
var iLo int32
var ret int32
var iKey U16
- if iCode >= (U32(int32(1) << 20)) {
+ if iCode >= U32(int32(1)<<20) {
return 0
}
- iLo = int32(aFts5UnicodeBlock[(iCode >> 16)])
- iHi = int32(aFts5UnicodeBlock[(U32(1) + (iCode >> 16))])
- iKey = (U16(iCode & U32(0xFFFF)))
+ iLo = int32(aFts5UnicodeBlock[iCode>>16])
+ iHi = int32(aFts5UnicodeBlock[U32(1)+iCode>>16])
+ iKey = U16(iCode & U32(0xFFFF))
for iHi > iLo {
- var iTest int32 = ((iHi + iLo) / 2)
+ var iTest int32 = (iHi + iLo) / 2
if int32(iKey) >= int32(aFts5UnicodeMap[iTest]) {
iRes = iTest
- iLo = (iTest + 1)
+ iLo = iTest + 1
} else {
iHi = iTest
}
@@ -190199,26 +192715,26 @@ func sqlite3Fts5UnicodeCategory(tls *libc.TLS, iCode U32) int32 { /* sqlite3.c:2
if iRes < 0 {
return 0
}
- if int32(iKey) >= (int32(aFts5UnicodeMap[iRes]) + (int32(aFts5UnicodeData[iRes]) >> 5)) {
+ if int32(iKey) >= int32(aFts5UnicodeMap[iRes])+int32(aFts5UnicodeData[iRes])>>5 {
return 0
}
- ret = (int32(aFts5UnicodeData[iRes]) & 0x1F)
+ ret = int32(aFts5UnicodeData[iRes]) & 0x1F
if ret != 30 {
return ret
}
- if ((int32(iKey) - int32(aFts5UnicodeMap[iRes])) & 0x01) != 0 {
+ if (int32(iKey)-int32(aFts5UnicodeMap[iRes]))&0x01 != 0 {
return 5
}
return 9
}
-func sqlite3Fts5UnicodeAscii(tls *libc.TLS, aArray uintptr, aAscii uintptr) { /* sqlite3.c:234059:13: */
+func sqlite3Fts5UnicodeAscii(tls *libc.TLS, aArray uintptr, aAscii uintptr) { /* sqlite3.c:235973:13: */
var i int32 = 0
var iTbl int32 = 0
for i < 128 {
- var bToken int32 = int32(*(*U8)(unsafe.Pointer(aArray + uintptr((int32(aFts5UnicodeData[iTbl]) & 0x1F)))))
- var n int32 = ((int32(aFts5UnicodeData[iTbl]) >> 5) + i)
- for ; (i < 128) && (i < n); i++ {
+ var bToken int32 = int32(*(*U8)(unsafe.Pointer(aArray + uintptr(int32(aFts5UnicodeData[iTbl])&0x1F))))
+ var n int32 = int32(aFts5UnicodeData[iTbl])>>5 + i
+ for ; i < 128 && i < n; i++ {
*(*U8)(unsafe.Pointer(aAscii + uintptr(i))) = U8(bToken)
}
iTbl++
@@ -190244,7 +192760,7 @@ func sqlite3Fts5UnicodeAscii(tls *libc.TLS, aArray uintptr, aAscii uintptr) { /*
// This is a copy of the sqlite3GetVarint32() routine from the SQLite core.
// Except, this version does handle the single byte case that the core
// version depends on being handled before its function is called.
-func sqlite3Fts5GetVarint32(tls *libc.TLS, p uintptr, v uintptr) int32 { /* sqlite3.c:234097:12: */
+func sqlite3Fts5GetVarint32(tls *libc.TLS, p uintptr, v uintptr) int32 { /* sqlite3.c:236011:12: */
bp := tls.Alloc(8)
defer tls.Free(8)
@@ -190254,7 +192770,7 @@ func sqlite3Fts5GetVarint32(tls *libc.TLS, p uintptr, v uintptr) int32 { /* sqli
// The 1-byte case. Overwhelmingly the most common.
a = U32(*(*uint8)(unsafe.Pointer(p)))
// a: p0 (unmasked)
- if !((a & U32(0x80)) != 0) {
+ if !(a&U32(0x80) != 0) {
// Values between 0 and 127
*(*U32)(unsafe.Pointer(v)) = a
return 1
@@ -190264,25 +192780,25 @@ func sqlite3Fts5GetVarint32(tls *libc.TLS, p uintptr, v uintptr) int32 { /* sqli
p++
b = U32(*(*uint8)(unsafe.Pointer(p)))
// b: p1 (unmasked)
- if !((b & U32(0x80)) != 0) {
+ if !(b&U32(0x80) != 0) {
// Values between 128 and 16383
- a = a & (U32(0x7f))
- a = (a << 7)
- *(*U32)(unsafe.Pointer(v)) = (a | b)
+ a = a & U32(0x7f)
+ a = a << 7
+ *(*U32)(unsafe.Pointer(v)) = a | b
return 2
}
// The 3-byte case
p++
- a = (a << 14)
- a = a | (U32(*(*uint8)(unsafe.Pointer(p))))
+ a = a << 14
+ a = a | U32(*(*uint8)(unsafe.Pointer(p)))
// a: p0<<14 | p2 (unmasked)
- if !((a & U32(0x80)) != 0) {
+ if !(a&U32(0x80) != 0) {
// Values between 16384 and 2097151
- a = a & (U32((int32(0x7f) << 14) | (0x7f)))
- b = b & (U32(0x7f))
- b = (b << 7)
- *(*U32)(unsafe.Pointer(v)) = (a | b)
+ a = a & U32(int32(0x7f)<<14|0x7f)
+ b = b & U32(0x7f)
+ b = b << 7
+ *(*U32)(unsafe.Pointer(v)) = a | b
return 3
}
@@ -190301,7 +192817,7 @@ func sqlite3Fts5GetVarint32(tls *libc.TLS, p uintptr, v uintptr) int32 { /* sqli
var n U8
p -= uintptr(2)
n = sqlite3Fts5GetVarint(tls, p, bp /* &v64 */)
- *(*U32)(unsafe.Pointer(v)) = ((U32(*(*U64)(unsafe.Pointer(bp /* v64 */)))) & U32(0x7FFFFFFF))
+ *(*U32)(unsafe.Pointer(v)) = U32(*(*U64)(unsafe.Pointer(bp))) & U32(0x7FFFFFFF)
return int32(n)
@@ -190319,14 +192835,14 @@ func sqlite3Fts5GetVarint32(tls *libc.TLS, p uintptr, v uintptr) int32 { /* sqli
// Read a 64-bit variable-length integer from memory starting at p[0].
// Return the number of bytes read. The value is stored in *v.
-func sqlite3Fts5GetVarint(tls *libc.TLS, p uintptr, v uintptr) U8 { /* sqlite3.c:234175:11: */
+func sqlite3Fts5GetVarint(tls *libc.TLS, p uintptr, v uintptr) U8 { /* sqlite3.c:236089:11: */
var a U32
var b U32
var s U32
a = U32(*(*uint8)(unsafe.Pointer(p)))
// a: p0 (unmasked)
- if !((a & U32(0x80)) != 0) {
+ if !(a&U32(0x80) != 0) {
*(*U64)(unsafe.Pointer(v)) = U64(a)
return U8(1)
}
@@ -190334,10 +192850,10 @@ func sqlite3Fts5GetVarint(tls *libc.TLS, p uintptr, v uintptr) U8 { /* sqlite3.c
p++
b = U32(*(*uint8)(unsafe.Pointer(p)))
// b: p1 (unmasked)
- if !((b & U32(0x80)) != 0) {
- a = a & (U32(0x7f))
- a = (a << 7)
- a = a | (b)
+ if !(b&U32(0x80) != 0) {
+ a = a & U32(0x7f)
+ a = a << 7
+ a = a | b
*(*U64)(unsafe.Pointer(v)) = U64(a)
return U8(2)
}
@@ -190345,30 +192861,30 @@ func sqlite3Fts5GetVarint(tls *libc.TLS, p uintptr, v uintptr) U8 { /* sqlite3.c
// Verify that constants are precomputed correctly
p++
- a = (a << 14)
- a = a | (U32(*(*uint8)(unsafe.Pointer(p))))
+ a = a << 14
+ a = a | U32(*(*uint8)(unsafe.Pointer(p)))
// a: p0<<14 | p2 (unmasked)
- if !((a & U32(0x80)) != 0) {
- a = a & (U32(SLOT_2_0))
- b = b & (U32(0x7f))
- b = (b << 7)
- a = a | (b)
+ if !(a&U32(0x80) != 0) {
+ a = a & U32(SLOT_2_0)
+ b = b & U32(0x7f)
+ b = b << 7
+ a = a | b
*(*U64)(unsafe.Pointer(v)) = U64(a)
return U8(3)
}
// CSE1 from below
- a = a & (U32(SLOT_2_0))
+ a = a & U32(SLOT_2_0)
p++
- b = (b << 14)
- b = b | (U32(*(*uint8)(unsafe.Pointer(p))))
+ b = b << 14
+ b = b | U32(*(*uint8)(unsafe.Pointer(p)))
// b: p1<<14 | p3 (unmasked)
- if !((b & U32(0x80)) != 0) {
- b = b & (U32(SLOT_2_0))
+ if !(b&U32(0x80) != 0) {
+ b = b & U32(SLOT_2_0)
// moved CSE1 up
// a &= (0x7f<<14)|(0x7f);
- a = (a << 7)
- a = a | (b)
+ a = a << 7
+ a = a | b
*(*U64)(unsafe.Pointer(v)) = U64(a)
return U8(4)
}
@@ -190378,94 +192894,94 @@ func sqlite3Fts5GetVarint(tls *libc.TLS, p uintptr, v uintptr) U8 { /* sqlite3.c
// 1:save off p0<<21 | p1<<14 | p2<<7 | p3 (masked)
// moved CSE1 up
// a &= (0x7f<<14)|(0x7f);
- b = b & (U32(SLOT_2_0))
+ b = b & U32(SLOT_2_0)
s = a
// s: p0<<14 | p2 (masked)
p++
- a = (a << 14)
- a = a | (U32(*(*uint8)(unsafe.Pointer(p))))
+ a = a << 14
+ a = a | U32(*(*uint8)(unsafe.Pointer(p)))
// a: p0<<28 | p2<<14 | p4 (unmasked)
- if !((a & U32(0x80)) != 0) {
+ if !(a&U32(0x80) != 0) {
// we can skip these cause they were (effectively) done above in calc'ing s
// a &= (0x7f<<28)|(0x7f<<14)|(0x7f);
// b &= (0x7f<<14)|(0x7f);
- b = (b << 7)
- a = a | (b)
- s = (s >> 18)
- *(*U64)(unsafe.Pointer(v)) = (((U64(s)) << 32) | U64(a))
+ b = b << 7
+ a = a | b
+ s = s >> 18
+ *(*U64)(unsafe.Pointer(v)) = U64(s)<<32 | U64(a)
return U8(5)
}
// 2:save off p0<<21 | p1<<14 | p2<<7 | p3 (masked)
- s = (s << 7)
- s = s | (b)
+ s = s << 7
+ s = s | b
// s: p0<<21 | p1<<14 | p2<<7 | p3 (masked)
p++
- b = (b << 14)
- b = b | (U32(*(*uint8)(unsafe.Pointer(p))))
+ b = b << 14
+ b = b | U32(*(*uint8)(unsafe.Pointer(p)))
// b: p1<<28 | p3<<14 | p5 (unmasked)
- if !((b & U32(0x80)) != 0) {
+ if !(b&U32(0x80) != 0) {
// we can skip this cause it was (effectively) done above in calc'ing s
// b &= (0x7f<<28)|(0x7f<<14)|(0x7f);
- a = a & (U32(SLOT_2_0))
- a = (a << 7)
- a = a | (b)
- s = (s >> 18)
- *(*U64)(unsafe.Pointer(v)) = (((U64(s)) << 32) | U64(a))
+ a = a & U32(SLOT_2_0)
+ a = a << 7
+ a = a | b
+ s = s >> 18
+ *(*U64)(unsafe.Pointer(v)) = U64(s)<<32 | U64(a)
return U8(6)
}
p++
- a = (a << 14)
- a = a | (U32(*(*uint8)(unsafe.Pointer(p))))
+ a = a << 14
+ a = a | U32(*(*uint8)(unsafe.Pointer(p)))
// a: p2<<28 | p4<<14 | p6 (unmasked)
- if !((a & U32(0x80)) != 0) {
- a = a & (SLOT_4_2_0)
- b = b & (U32(SLOT_2_0))
- b = (b << 7)
- a = a | (b)
- s = (s >> 11)
- *(*U64)(unsafe.Pointer(v)) = (((U64(s)) << 32) | U64(a))
+ if !(a&U32(0x80) != 0) {
+ a = a & SLOT_4_2_0
+ b = b & U32(SLOT_2_0)
+ b = b << 7
+ a = a | b
+ s = s >> 11
+ *(*U64)(unsafe.Pointer(v)) = U64(s)<<32 | U64(a)
return U8(7)
}
// CSE2 from below
- a = a & (U32(SLOT_2_0))
+ a = a & U32(SLOT_2_0)
p++
- b = (b << 14)
- b = b | (U32(*(*uint8)(unsafe.Pointer(p))))
+ b = b << 14
+ b = b | U32(*(*uint8)(unsafe.Pointer(p)))
// b: p3<<28 | p5<<14 | p7 (unmasked)
- if !((b & U32(0x80)) != 0) {
- b = b & (SLOT_4_2_0)
+ if !(b&U32(0x80) != 0) {
+ b = b & SLOT_4_2_0
// moved CSE2 up
// a &= (0x7f<<14)|(0x7f);
- a = (a << 7)
- a = a | (b)
- s = (s >> 4)
- *(*U64)(unsafe.Pointer(v)) = (((U64(s)) << 32) | U64(a))
+ a = a << 7
+ a = a | b
+ s = s >> 4
+ *(*U64)(unsafe.Pointer(v)) = U64(s)<<32 | U64(a)
return U8(8)
}
p++
- a = (a << 15)
- a = a | (U32(*(*uint8)(unsafe.Pointer(p))))
+ a = a << 15
+ a = a | U32(*(*uint8)(unsafe.Pointer(p)))
// a: p4<<29 | p6<<15 | p8 (unmasked)
// moved CSE2 up
// a &= (0x7f<<29)|(0x7f<<15)|(0xff);
- b = b & (U32(SLOT_2_0))
- b = (b << 8)
- a = a | (b)
+ b = b & U32(SLOT_2_0)
+ b = b << 8
+ a = a | b
- s = (s << 4)
+ s = s << 4
b = U32(*(*uint8)(unsafe.Pointer(p + libc.UintptrFromInt32(-4))))
- b = b & (U32(0x7f))
- b = (b >> 3)
- s = s | (b)
+ b = b & U32(0x7f)
+ b = b >> 3
+ s = s | b
- *(*U64)(unsafe.Pointer(v)) = (((U64(s)) << 32) | U64(a))
+ *(*U64)(unsafe.Pointer(v)) = U64(s)<<32 | U64(a)
return U8(9)
}
@@ -190495,7 +193011,7 @@ func sqlite3Fts5GetVarint(tls *libc.TLS, p uintptr, v uintptr) U8 { /* sqlite3.c
// for all bytes that have the 8th bit set and one byte with the 8th
// bit clear. Except, if we get to the 9th byte, it stores the full
// 8 bits and is the last byte.
-func fts5PutVarint64(tls *libc.TLS, p uintptr, v U64) int32 { /* sqlite3.c:234369:26: */
+func fts5PutVarint64(tls *libc.TLS, p uintptr, v U64) int32 { /* sqlite3.c:236283:26: */
bp := tls.Alloc(10)
defer tls.Free(10)
@@ -190504,24 +193020,24 @@ func fts5PutVarint64(tls *libc.TLS, p uintptr, v U64) int32 { /* sqlite3.c:23436
var n int32
// var buf [10]U8 at bp, 10
- if (v & (U64((uint64(0xff000000))) << 32)) != 0 {
+ if v&(U64(uint64(0xff000000))<<32) != 0 {
*(*uint8)(unsafe.Pointer(p + 8)) = U8(v)
v >>= 8
for i = 7; i >= 0; i-- {
- *(*uint8)(unsafe.Pointer(p + uintptr(i))) = (U8((v & uint64(0x7f)) | uint64(0x80)))
+ *(*uint8)(unsafe.Pointer(p + uintptr(i))) = U8(v&uint64(0x7f) | uint64(0x80))
v >>= 7
}
return 9
}
n = 0
- for ok := true; ok; ok = (v != uint64(0)) {
- *(*U8)(unsafe.Pointer(bp /* &buf[0] */ + uintptr(libc.PostIncInt32(&n, 1)))) = (U8((v & uint64(0x7f)) | uint64(0x80)))
+ for ok := true; ok; ok = v != uint64(0) {
+ *(*U8)(unsafe.Pointer(bp /* &buf[0] */ + uintptr(libc.PostIncInt32(&n, 1)))) = U8(v&uint64(0x7f) | uint64(0x80))
v >>= 7
}
- *(*U8)(unsafe.Pointer(bp /* &buf */)) &= U8((0x7f))
+ *(*U8)(unsafe.Pointer(bp)) &= U8(0x7f)
i = 0
- j = (n - 1)
+ j = n - 1
__1:
if !(j >= 0) {
goto __3
@@ -190541,28 +193057,28 @@ __3:
return n
}
-func sqlite3Fts5PutVarint(tls *libc.TLS, p uintptr, v U64) int32 { /* sqlite3.c:234394:12: */
+func sqlite3Fts5PutVarint(tls *libc.TLS, p uintptr, v U64) int32 { /* sqlite3.c:236308:12: */
if v <= uint64(0x7f) {
- *(*uint8)(unsafe.Pointer(p)) = (uint8(v & uint64(0x7f)))
+ *(*uint8)(unsafe.Pointer(p)) = uint8(v & uint64(0x7f))
return 1
}
if v <= uint64(0x3fff) {
- *(*uint8)(unsafe.Pointer(p)) = (uint8(((v >> 7) & uint64(0x7f)) | uint64(0x80)))
- *(*uint8)(unsafe.Pointer(p + 1)) = (uint8(v & uint64(0x7f)))
+ *(*uint8)(unsafe.Pointer(p)) = uint8(v>>7&uint64(0x7f) | uint64(0x80))
+ *(*uint8)(unsafe.Pointer(p + 1)) = uint8(v & uint64(0x7f))
return 2
}
return fts5PutVarint64(tls, p, v)
}
-func sqlite3Fts5GetVarintLen(tls *libc.TLS, iVal U32) int32 { /* sqlite3.c:234408:12: */
+func sqlite3Fts5GetVarintLen(tls *libc.TLS, iVal U32) int32 { /* sqlite3.c:236322:12: */
- if iVal < (U32(int32(1) << 14)) {
+ if iVal < U32(int32(1)<<14) {
return 2
}
- if iVal < (U32(int32(1) << 21)) {
+ if iVal < U32(int32(1)<<21) {
return 3
}
- if iVal < (U32(int32(1) << 28)) {
+ if iVal < U32(int32(1)<<28) {
return 4
}
return 5
@@ -190614,7 +193130,7 @@ type Fts5VocabTable1 = struct {
FpGlobal uintptr
FeType int32
FbBusy uint32
-} /* sqlite3.c:234461:9 */
+} /* sqlite3.c:236375:9 */
// 2015 May 08
//
@@ -190654,27 +193170,29 @@ type Fts5VocabTable1 = struct {
// #include "fts5Int.h"
-type Fts5VocabTable = Fts5VocabTable1 /* sqlite3.c:234461:31 */
+type Fts5VocabTable = Fts5VocabTable1 /* sqlite3.c:236375:31 */
type Fts5VocabCursor1 = struct {
Fbase Sqlite3_vtab_cursor
FpStmt uintptr
FpFts5 uintptr
FbEof int32
FpIter uintptr
+ FpStruct uintptr
FnLeTerm int32
FzLeTerm uintptr
FiCol int32
FaCnt uintptr
FaDoc uintptr
+ F__ccgo_pad1 [4]byte
Frowid I64
Fterm Fts5Buffer
- F__ccgo_pad1 [4]byte
+ F__ccgo_pad2 [4]byte
FiInstPos I64
FiInstOff int32
- F__ccgo_pad2 [4]byte
-} /* sqlite3.c:234462:9 */
+ F__ccgo_pad3 [4]byte
+} /* sqlite3.c:236376:9 */
-type Fts5VocabCursor = Fts5VocabCursor1 /* sqlite3.c:234462:32 */
+type Fts5VocabCursor = Fts5VocabCursor1 /* sqlite3.c:236376:32 */
// Bits for the mask used as the idxNum value by xBestIndex/xFilter.
@@ -190682,22 +193200,22 @@ type Fts5VocabCursor = Fts5VocabCursor1 /* sqlite3.c:234462:32 */
// FTS5_VOCAB_XXX constant. If successful, set *peType to the output
// value and return SQLITE_OK. Otherwise, set *pzErr to an error message
// and return SQLITE_ERROR.
-func fts5VocabTableType(tls *libc.TLS, zType uintptr, pzErr uintptr, peType uintptr) int32 { /* sqlite3.c:234521:12: */
+func fts5VocabTableType(tls *libc.TLS, zType uintptr, pzErr uintptr, peType uintptr) int32 { /* sqlite3.c:236436:12: */
bp := tls.Alloc(12)
defer tls.Free(12)
*(*int32)(unsafe.Pointer(bp + 8 /* rc */)) = SQLITE_OK
var zCopy uintptr = sqlite3Fts5Strndup(tls, bp+8 /* &rc */, zType, -1)
- if *(*int32)(unsafe.Pointer(bp + 8 /* rc */)) == SQLITE_OK {
+ if *(*int32)(unsafe.Pointer(bp + 8)) == SQLITE_OK {
sqlite3Fts5Dequote(tls, zCopy)
- if Xsqlite3_stricmp(tls, zCopy, ts+35524 /* "col" */) == 0 {
+ if Xsqlite3_stricmp(tls, zCopy, ts+36884) == 0 {
*(*int32)(unsafe.Pointer(peType)) = FTS5_VOCAB_COL
- } else if Xsqlite3_stricmp(tls, zCopy, ts+35528 /* "row" */) == 0 {
+ } else if Xsqlite3_stricmp(tls, zCopy, ts+36888) == 0 {
*(*int32)(unsafe.Pointer(peType)) = FTS5_VOCAB_ROW
- } else if Xsqlite3_stricmp(tls, zCopy, ts+35532 /* "instance" */) == 0 {
+ } else if Xsqlite3_stricmp(tls, zCopy, ts+36892) == 0 {
*(*int32)(unsafe.Pointer(peType)) = FTS5_VOCAB_INSTANCE
} else {
- *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, ts+35541 /* "fts5vocab: unkno..." */, libc.VaList(bp, zCopy))
+ *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, ts+36901 /* "fts5vocab: unkno..." */, libc.VaList(bp, zCopy))
*(*int32)(unsafe.Pointer(bp + 8 /* rc */)) = SQLITE_ERROR
}
Xsqlite3_free(tls, zCopy)
@@ -190707,14 +193225,14 @@ func fts5VocabTableType(tls *libc.TLS, zType uintptr, pzErr uintptr, peType uint
}
// The xDisconnect() virtual table method.
-func fts5VocabDisconnectMethod(tls *libc.TLS, pVtab uintptr) int32 { /* sqlite3.c:234550:12: */
+func fts5VocabDisconnectMethod(tls *libc.TLS, pVtab uintptr) int32 { /* sqlite3.c:236465:12: */
var pTab uintptr = pVtab
Xsqlite3_free(tls, pTab)
return SQLITE_OK
}
// The xDestroy() virtual table method.
-func fts5VocabDestroyMethod(tls *libc.TLS, pVtab uintptr) int32 { /* sqlite3.c:234559:12: */
+func fts5VocabDestroyMethod(tls *libc.TLS, pVtab uintptr) int32 { /* sqlite3.c:236474:12: */
var pTab uintptr = pVtab
Xsqlite3_free(tls, pTab)
return SQLITE_OK
@@ -190739,24 +193257,24 @@ func fts5VocabDestroyMethod(tls *libc.TLS, pVtab uintptr) int32 { /* sqlite3.c:2
// argv[3] -> name of fts5 tables database
// argv[4] -> name of fts5 table
// argv[5] -> type of fts5vocab table
-func fts5VocabInitVtab(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uintptr, ppVTab uintptr, pzErr uintptr) int32 { /* sqlite3.c:234586:12: */
+func fts5VocabInitVtab(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uintptr, ppVTab uintptr, pzErr uintptr) int32 { /* sqlite3.c:236501:12: */
bp := tls.Alloc(20)
defer tls.Free(20)
*(*[3]uintptr)(unsafe.Pointer(bp + 4 /* azSchema */)) = [3]uintptr{
- ts + 35575, /* "CREATE TABlE voc..." */
- ts + 35615, /* "CREATE TABlE voc..." */
- ts + 35650, /* "CREATE TABlE voc..." */
+ ts + 36935, /* "CREATE TABlE voc..." */
+ ts + 36975, /* "CREATE TABlE voc..." */
+ ts + 37010, /* "CREATE TABlE voc..." */
}
var pRet uintptr = uintptr(0)
*(*int32)(unsafe.Pointer(bp + 16 /* rc */)) = SQLITE_OK // Return code
var bDb int32
- bDb = (libc.Bool32(((argc == 6) && (libc.Xstrlen(tls, *(*uintptr)(unsafe.Pointer(argv + 1*4))) == Size_t(4))) && (libc.Xmemcmp(tls, ts+21625 /* "temp" */, *(*uintptr)(unsafe.Pointer(argv + 1*4)), uint32(4)) == 0)))
+ bDb = libc.Bool32(argc == 6 && libc.Xstrlen(tls, *(*uintptr)(unsafe.Pointer(argv + 1*4))) == Size_t(4) && libc.Xmemcmp(tls, ts+22922, *(*uintptr)(unsafe.Pointer(argv + 1*4)), uint32(4)) == 0)
- if (argc != 5) && (bDb == 0) {
- *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, ts+35693 /* "wrong number of ..." */, 0)
+ if argc != 5 && bDb == 0 {
+ *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, ts+37053 /* "wrong number of ..." */, 0)
*(*int32)(unsafe.Pointer(bp + 16 /* rc */)) = SQLITE_ERROR
} else {
var nByte int32 // Bytes of space to allocate
@@ -190778,24 +193296,24 @@ func fts5VocabInitVtab(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv
} else {
zType = *(*uintptr)(unsafe.Pointer(argv + 4*4))
}
- var nDb int32 = (int32(libc.Xstrlen(tls, zDb)) + 1)
- var nTab int32 = (int32(libc.Xstrlen(tls, zTab)) + 1)
+ var nDb int32 = int32(libc.Xstrlen(tls, zDb)) + 1
+ var nTab int32 = int32(libc.Xstrlen(tls, zTab)) + 1
*(*int32)(unsafe.Pointer(bp /* eType */)) = 0
*(*int32)(unsafe.Pointer(bp + 16 /* rc */)) = fts5VocabTableType(tls, zType, pzErr, bp /* &eType */)
- if *(*int32)(unsafe.Pointer(bp + 16 /* rc */)) == SQLITE_OK {
+ if *(*int32)(unsafe.Pointer(bp + 16)) == SQLITE_OK {
*(*int32)(unsafe.Pointer(bp + 16 /* rc */)) = Xsqlite3_declare_vtab(tls, db, *(*uintptr)(unsafe.Pointer(bp + 4 /* &azSchema[0] */ + uintptr(*(*int32)(unsafe.Pointer(bp /* eType */)))*4)))
}
- nByte = (int32((uint32(unsafe.Sizeof(Fts5VocabTable{})) + uint32(nDb)) + uint32(nTab)))
+ nByte = int32(uint32(unsafe.Sizeof(Fts5VocabTable{})) + uint32(nDb) + uint32(nTab))
pRet = sqlite3Fts5MallocZero(tls, bp+16 /* &rc */, int64(nByte))
if pRet != 0 {
(*Fts5VocabTable)(unsafe.Pointer(pRet)).FpGlobal = pAux
(*Fts5VocabTable)(unsafe.Pointer(pRet)).FeType = *(*int32)(unsafe.Pointer(bp /* eType */))
(*Fts5VocabTable)(unsafe.Pointer(pRet)).Fdb = db
- (*Fts5VocabTable)(unsafe.Pointer(pRet)).FzFts5Tbl = (pRet + 1*36)
- (*Fts5VocabTable)(unsafe.Pointer(pRet)).FzFts5Db = ((*Fts5VocabTable)(unsafe.Pointer(pRet)).FzFts5Tbl + uintptr(nTab))
+ (*Fts5VocabTable)(unsafe.Pointer(pRet)).FzFts5Tbl = pRet + 1*36
+ (*Fts5VocabTable)(unsafe.Pointer(pRet)).FzFts5Db = (*Fts5VocabTable)(unsafe.Pointer(pRet)).FzFts5Tbl + uintptr(nTab)
libc.Xmemcpy(tls, (*Fts5VocabTable)(unsafe.Pointer(pRet)).FzFts5Tbl, zTab, uint32(nTab))
libc.Xmemcpy(tls, (*Fts5VocabTable)(unsafe.Pointer(pRet)).FzFts5Db, zDb, uint32(nDb))
sqlite3Fts5Dequote(tls, (*Fts5VocabTable)(unsafe.Pointer(pRet)).FzFts5Tbl)
@@ -190809,11 +193327,11 @@ func fts5VocabInitVtab(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv
// The xConnect() and xCreate() methods for the virtual table. All the
// work is done in function fts5VocabInitVtab().
-func fts5VocabConnectMethod(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uintptr, ppVtab uintptr, pzErr uintptr) int32 { /* sqlite3.c:234648:12: */
+func fts5VocabConnectMethod(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uintptr, ppVtab uintptr, pzErr uintptr) int32 { /* sqlite3.c:236563:12: */
return fts5VocabInitVtab(tls, db, pAux, argc, argv, ppVtab, pzErr)
}
-func fts5VocabCreateMethod(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uintptr, ppVtab uintptr, pzErr uintptr) int32 { /* sqlite3.c:234658:12: */
+func fts5VocabCreateMethod(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uintptr, ppVtab uintptr, pzErr uintptr) int32 { /* sqlite3.c:236573:12: */
return fts5VocabInitVtab(tls, db, pAux, argc, argv, ppVtab, pzErr)
}
@@ -190827,7 +193345,7 @@ func fts5VocabCreateMethod(tls *libc.TLS, db uintptr, pAux uintptr, argc int32,
//
// are interpreted. Less-than and less-than-or-equal are treated
// identically, as are greater-than and greater-than-or-equal.
-func fts5VocabBestIndexMethod(tls *libc.TLS, pUnused uintptr, pInfo uintptr) int32 { /* sqlite3.c:234681:12: */
+func fts5VocabBestIndexMethod(tls *libc.TLS, pUnused uintptr, pInfo uintptr) int32 { /* sqlite3.c:236596:12: */
var i int32
var iTermEq int32 = -1
var iTermGe int32 = -1
@@ -190838,7 +193356,7 @@ func fts5VocabBestIndexMethod(tls *libc.TLS, pUnused uintptr, pInfo uintptr) int
_ = pUnused
for i = 0; i < (*Sqlite3_index_info)(unsafe.Pointer(pInfo)).FnConstraint; i++ {
- var p uintptr = ((*Sqlite3_index_info)(unsafe.Pointer(pInfo)).FaConstraint + uintptr(i)*12)
+ var p uintptr = (*Sqlite3_index_info)(unsafe.Pointer(pInfo)).FaConstraint + uintptr(i)*12
if int32((*sqlite3_index_constraint)(unsafe.Pointer(p)).Fusable) == 0 {
continue
}
@@ -190862,20 +193380,20 @@ func fts5VocabBestIndexMethod(tls *libc.TLS, pUnused uintptr, pInfo uintptr) int
}
if iTermEq >= 0 {
- idxNum = idxNum | (FTS5_VOCAB_TERM_EQ)
+ idxNum = idxNum | FTS5_VOCAB_TERM_EQ
(*sqlite3_index_constraint_usage)(unsafe.Pointer((*Sqlite3_index_info)(unsafe.Pointer(pInfo)).FaConstraintUsage + uintptr(iTermEq)*8)).FargvIndex = libc.PreIncInt32(&nArg, 1)
(*Sqlite3_index_info)(unsafe.Pointer(pInfo)).FestimatedCost = float64(100)
} else {
(*Sqlite3_index_info)(unsafe.Pointer(pInfo)).FestimatedCost = float64(1000000)
if iTermGe >= 0 {
- idxNum = idxNum | (FTS5_VOCAB_TERM_GE)
+ idxNum = idxNum | FTS5_VOCAB_TERM_GE
(*sqlite3_index_constraint_usage)(unsafe.Pointer((*Sqlite3_index_info)(unsafe.Pointer(pInfo)).FaConstraintUsage + uintptr(iTermGe)*8)).FargvIndex = libc.PreIncInt32(&nArg, 1)
- (*Sqlite3_index_info)(unsafe.Pointer(pInfo)).FestimatedCost = ((*Sqlite3_index_info)(unsafe.Pointer(pInfo)).FestimatedCost / float64(2))
+ (*Sqlite3_index_info)(unsafe.Pointer(pInfo)).FestimatedCost = (*Sqlite3_index_info)(unsafe.Pointer(pInfo)).FestimatedCost / float64(2)
}
if iTermLe >= 0 {
- idxNum = idxNum | (FTS5_VOCAB_TERM_LE)
+ idxNum = idxNum | FTS5_VOCAB_TERM_LE
(*sqlite3_index_constraint_usage)(unsafe.Pointer((*Sqlite3_index_info)(unsafe.Pointer(pInfo)).FaConstraintUsage + uintptr(iTermLe)*8)).FargvIndex = libc.PreIncInt32(&nArg, 1)
- (*Sqlite3_index_info)(unsafe.Pointer(pInfo)).FestimatedCost = ((*Sqlite3_index_info)(unsafe.Pointer(pInfo)).FestimatedCost / float64(2))
+ (*Sqlite3_index_info)(unsafe.Pointer(pInfo)).FestimatedCost = (*Sqlite3_index_info)(unsafe.Pointer(pInfo)).FestimatedCost / float64(2)
}
}
@@ -190884,9 +193402,9 @@ func fts5VocabBestIndexMethod(tls *libc.TLS, pUnused uintptr, pInfo uintptr) int
// specifically - "ORDER BY term" or "ORDER BY term ASC" - set the
// sqlite3_index_info.orderByConsumed flag to tell the core the results
// are already in sorted order.
- if (((*Sqlite3_index_info)(unsafe.Pointer(pInfo)).FnOrderBy == 1) &&
- ((*sqlite3_index_orderby)(unsafe.Pointer((*Sqlite3_index_info)(unsafe.Pointer(pInfo)).FaOrderBy)).FiColumn == 0)) &&
- (int32((*sqlite3_index_orderby)(unsafe.Pointer((*Sqlite3_index_info)(unsafe.Pointer(pInfo)).FaOrderBy)).Fdesc) == 0) {
+ if (*Sqlite3_index_info)(unsafe.Pointer(pInfo)).FnOrderBy == 1 &&
+ (*sqlite3_index_orderby)(unsafe.Pointer((*Sqlite3_index_info)(unsafe.Pointer(pInfo)).FaOrderBy)).FiColumn == 0 &&
+ int32((*sqlite3_index_orderby)(unsafe.Pointer((*Sqlite3_index_info)(unsafe.Pointer(pInfo)).FaOrderBy)).Fdesc) == 0 {
(*Sqlite3_index_info)(unsafe.Pointer(pInfo)).ForderByConsumed = 1
}
@@ -190895,7 +193413,7 @@ func fts5VocabBestIndexMethod(tls *libc.TLS, pUnused uintptr, pInfo uintptr) int
}
// Implementation of xOpen method.
-func fts5VocabOpenMethod(tls *libc.TLS, pVTab uintptr, ppCsr uintptr) int32 { /* sqlite3.c:234743:12: */
+func fts5VocabOpenMethod(tls *libc.TLS, pVTab uintptr, ppCsr uintptr) int32 { /* sqlite3.c:236658:12: */
bp := tls.Alloc(72)
defer tls.Free(72)
@@ -190908,35 +193426,35 @@ func fts5VocabOpenMethod(tls *libc.TLS, pVTab uintptr, ppCsr uintptr) int32 { /*
if (*Fts5VocabTable)(unsafe.Pointer(pTab)).FbBusy != 0 {
(*Sqlite3_vtab)(unsafe.Pointer(pVTab)).FzErrMsg = Xsqlite3_mprintf(tls,
- ts+35726 /* "recursive defini..." */, libc.VaList(bp, (*Fts5VocabTable)(unsafe.Pointer(pTab)).FzFts5Db, (*Fts5VocabTable)(unsafe.Pointer(pTab)).FzFts5Tbl))
+ ts+37086 /* "recursive defini..." */, libc.VaList(bp, (*Fts5VocabTable)(unsafe.Pointer(pTab)).FzFts5Db, (*Fts5VocabTable)(unsafe.Pointer(pTab)).FzFts5Tbl))
return SQLITE_ERROR
}
zSql = sqlite3Fts5Mprintf(tls, bp+64, /* &rc */
- ts+35757, /* "SELECT t.%Q FROM..." */
+ ts+37117, /* "SELECT t.%Q FROM..." */
libc.VaList(bp+16, (*Fts5VocabTable)(unsafe.Pointer(pTab)).FzFts5Tbl, (*Fts5VocabTable)(unsafe.Pointer(pTab)).FzFts5Db, (*Fts5VocabTable)(unsafe.Pointer(pTab)).FzFts5Tbl, (*Fts5VocabTable)(unsafe.Pointer(pTab)).FzFts5Tbl))
if zSql != 0 {
*(*int32)(unsafe.Pointer(bp + 64 /* rc */)) = Xsqlite3_prepare_v2(tls, (*Fts5VocabTable)(unsafe.Pointer(pTab)).Fdb, zSql, -1, bp+68 /* &pStmt */, uintptr(0))
}
Xsqlite3_free(tls, zSql)
- if *(*int32)(unsafe.Pointer(bp + 64 /* rc */)) == SQLITE_ERROR {
+ if *(*int32)(unsafe.Pointer(bp + 64)) == SQLITE_ERROR {
*(*int32)(unsafe.Pointer(bp + 64 /* rc */)) = SQLITE_OK
}
(*Fts5VocabTable)(unsafe.Pointer(pTab)).FbBusy = uint32(1)
- if (*(*uintptr)(unsafe.Pointer(bp + 68 /* pStmt */)) != 0) && (Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp + 68 /* pStmt */))) == SQLITE_ROW) {
+ if *(*uintptr)(unsafe.Pointer(bp + 68)) != 0 && Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp + 68))) == SQLITE_ROW {
var iId I64 = Xsqlite3_column_int64(tls, *(*uintptr)(unsafe.Pointer(bp + 68 /* pStmt */)), 0)
pFts5 = sqlite3Fts5TableFromCsrid(tls, (*Fts5VocabTable)(unsafe.Pointer(pTab)).FpGlobal, iId)
}
(*Fts5VocabTable)(unsafe.Pointer(pTab)).FbBusy = uint32(0)
- if *(*int32)(unsafe.Pointer(bp + 64 /* rc */)) == SQLITE_OK {
+ if *(*int32)(unsafe.Pointer(bp + 64)) == SQLITE_OK {
if pFts5 == uintptr(0) {
*(*int32)(unsafe.Pointer(bp + 64 /* rc */)) = Xsqlite3_finalize(tls, *(*uintptr)(unsafe.Pointer(bp + 68 /* pStmt */)))
*(*uintptr)(unsafe.Pointer(bp + 68 /* pStmt */)) = uintptr(0)
- if *(*int32)(unsafe.Pointer(bp + 64 /* rc */)) == SQLITE_OK {
+ if *(*int32)(unsafe.Pointer(bp + 64)) == SQLITE_OK {
(*Sqlite3_vtab)(unsafe.Pointer(pVTab)).FzErrMsg = Xsqlite3_mprintf(tls,
- ts+35808 /* "no such fts5 tab..." */, libc.VaList(bp+48, (*Fts5VocabTable)(unsafe.Pointer(pTab)).FzFts5Db, (*Fts5VocabTable)(unsafe.Pointer(pTab)).FzFts5Tbl))
+ ts+37168 /* "no such fts5 tab..." */, libc.VaList(bp+48, (*Fts5VocabTable)(unsafe.Pointer(pTab)).FzFts5Db, (*Fts5VocabTable)(unsafe.Pointer(pTab)).FzFts5Tbl))
*(*int32)(unsafe.Pointer(bp + 64 /* rc */)) = SQLITE_ERROR
}
} else {
@@ -190944,16 +193462,16 @@ func fts5VocabOpenMethod(tls *libc.TLS, pVTab uintptr, ppCsr uintptr) int32 { /*
}
}
- if *(*int32)(unsafe.Pointer(bp + 64 /* rc */)) == SQLITE_OK {
- var nByte int32 = (int32(((uint32((*Fts5Config)(unsafe.Pointer((*Fts5Table)(unsafe.Pointer(pFts5)).FpConfig)).FnCol) * uint32(unsafe.Sizeof(I64(0)))) * uint32(2)) + uint32(unsafe.Sizeof(Fts5VocabCursor{}))))
- pCsr = sqlite3Fts5MallocZero(tls, bp+64 /* &rc */, int64(nByte))
+ if *(*int32)(unsafe.Pointer(bp + 64)) == SQLITE_OK {
+ var nByte I64 = I64(uint32((*Fts5Config)(unsafe.Pointer((*Fts5Table)(unsafe.Pointer(pFts5)).FpConfig)).FnCol)*uint32(unsafe.Sizeof(I64(0)))*uint32(2) + uint32(unsafe.Sizeof(Fts5VocabCursor{})))
+ pCsr = sqlite3Fts5MallocZero(tls, bp+64 /* &rc */, nByte)
}
if pCsr != 0 {
(*Fts5VocabCursor)(unsafe.Pointer(pCsr)).FpFts5 = pFts5
(*Fts5VocabCursor)(unsafe.Pointer(pCsr)).FpStmt = *(*uintptr)(unsafe.Pointer(bp + 68 /* pStmt */))
- (*Fts5VocabCursor)(unsafe.Pointer(pCsr)).FaCnt = (pCsr + 1*80)
- (*Fts5VocabCursor)(unsafe.Pointer(pCsr)).FaDoc = ((*Fts5VocabCursor)(unsafe.Pointer(pCsr)).FaCnt + uintptr((*Fts5Config)(unsafe.Pointer((*Fts5Table)(unsafe.Pointer(pFts5)).FpConfig)).FnCol)*8)
+ (*Fts5VocabCursor)(unsafe.Pointer(pCsr)).FaCnt = pCsr + 1*88
+ (*Fts5VocabCursor)(unsafe.Pointer(pCsr)).FaDoc = (*Fts5VocabCursor)(unsafe.Pointer(pCsr)).FaCnt + uintptr((*Fts5Config)(unsafe.Pointer((*Fts5Table)(unsafe.Pointer(pFts5)).FpConfig)).FnCol)*8
} else {
Xsqlite3_finalize(tls, *(*uintptr)(unsafe.Pointer(bp + 68 /* pStmt */)))
}
@@ -190962,9 +193480,11 @@ func fts5VocabOpenMethod(tls *libc.TLS, pVTab uintptr, ppCsr uintptr) int32 { /*
return *(*int32)(unsafe.Pointer(bp + 64 /* rc */))
}
-func fts5VocabResetCursor(tls *libc.TLS, pCsr uintptr) { /* sqlite3.c:234811:13: */
+func fts5VocabResetCursor(tls *libc.TLS, pCsr uintptr) { /* sqlite3.c:236726:13: */
(*Fts5VocabCursor)(unsafe.Pointer(pCsr)).Frowid = int64(0)
sqlite3Fts5IterClose(tls, (*Fts5VocabCursor)(unsafe.Pointer(pCsr)).FpIter)
+ sqlite3Fts5StructureRelease(tls, (*Fts5VocabCursor)(unsafe.Pointer(pCsr)).FpStruct)
+ (*Fts5VocabCursor)(unsafe.Pointer(pCsr)).FpStruct = uintptr(0)
(*Fts5VocabCursor)(unsafe.Pointer(pCsr)).FpIter = uintptr(0)
Xsqlite3_free(tls, (*Fts5VocabCursor)(unsafe.Pointer(pCsr)).FzLeTerm)
(*Fts5VocabCursor)(unsafe.Pointer(pCsr)).FnLeTerm = -1
@@ -190974,16 +193494,16 @@ func fts5VocabResetCursor(tls *libc.TLS, pCsr uintptr) { /* sqlite3.c:234811:13:
// Close the cursor. For additional information see the documentation
// on the xClose method of the virtual table interface.
-func fts5VocabCloseMethod(tls *libc.TLS, pCursor uintptr) int32 { /* sqlite3.c:234825:12: */
+func fts5VocabCloseMethod(tls *libc.TLS, pCursor uintptr) int32 { /* sqlite3.c:236742:12: */
var pCsr uintptr = pCursor
fts5VocabResetCursor(tls, pCsr)
- sqlite3Fts5BufferFree(tls, (pCsr + 48 /* &.term */))
+ sqlite3Fts5BufferFree(tls, pCsr+56)
Xsqlite3_finalize(tls, (*Fts5VocabCursor)(unsafe.Pointer(pCsr)).FpStmt)
Xsqlite3_free(tls, pCsr)
return SQLITE_OK
}
-func fts5VocabInstanceNewTerm(tls *libc.TLS, pCsr uintptr) int32 { /* sqlite3.c:234834:12: */
+func fts5VocabInstanceNewTerm(tls *libc.TLS, pCsr uintptr) int32 { /* sqlite3.c:236751:12: */
bp := tls.Alloc(8)
defer tls.Free(8)
@@ -190998,38 +193518,38 @@ func fts5VocabInstanceNewTerm(tls *libc.TLS, pCsr uintptr) int32 { /* sqlite3.c:
zTerm = sqlite3Fts5IterTerm(tls, (*Fts5VocabCursor)(unsafe.Pointer(pCsr)).FpIter, bp /* &nTerm */)
if (*Fts5VocabCursor)(unsafe.Pointer(pCsr)).FnLeTerm >= 0 {
var nCmp int32 = func() int32 {
- if (*(*int32)(unsafe.Pointer(bp /* nTerm */))) < ((*Fts5VocabCursor)(unsafe.Pointer(pCsr)).FnLeTerm) {
- return *(*int32)(unsafe.Pointer(bp /* nTerm */))
+ if *(*int32)(unsafe.Pointer(bp)) < (*Fts5VocabCursor)(unsafe.Pointer(pCsr)).FnLeTerm {
+ return *(*int32)(unsafe.Pointer(bp))
}
return (*Fts5VocabCursor)(unsafe.Pointer(pCsr)).FnLeTerm
}()
var bCmp int32 = libc.Xmemcmp(tls, (*Fts5VocabCursor)(unsafe.Pointer(pCsr)).FzLeTerm, zTerm, uint32(nCmp))
- if (bCmp < 0) || ((bCmp == 0) && ((*Fts5VocabCursor)(unsafe.Pointer(pCsr)).FnLeTerm < *(*int32)(unsafe.Pointer(bp /* nTerm */)))) {
+ if bCmp < 0 || bCmp == 0 && (*Fts5VocabCursor)(unsafe.Pointer(pCsr)).FnLeTerm < *(*int32)(unsafe.Pointer(bp)) {
(*Fts5VocabCursor)(unsafe.Pointer(pCsr)).FbEof = 1
}
}
- sqlite3Fts5BufferSet(tls, bp+4 /* &rc */, (pCsr + 48 /* &.term */), *(*int32)(unsafe.Pointer(bp /* nTerm */)), zTerm)
+ sqlite3Fts5BufferSet(tls, bp+4 /* &rc */, pCsr+56, *(*int32)(unsafe.Pointer(bp /* nTerm */)), zTerm)
}
return *(*int32)(unsafe.Pointer(bp + 4 /* rc */))
}
-func fts5VocabInstanceNext(tls *libc.TLS, pCsr uintptr) int32 { /* sqlite3.c:234856:12: */
+func fts5VocabInstanceNext(tls *libc.TLS, pCsr uintptr) int32 { /* sqlite3.c:236773:12: */
var eDetail int32 = (*Fts5Config)(unsafe.Pointer((*Fts5Table)(unsafe.Pointer((*Fts5VocabCursor)(unsafe.Pointer(pCsr)).FpFts5)).FpConfig)).FeDetail
var rc int32 = SQLITE_OK
var pIter uintptr = (*Fts5VocabCursor)(unsafe.Pointer(pCsr)).FpIter
- var pp uintptr = (pCsr + 64 /* &.iInstPos */)
- var po uintptr = (pCsr + 72 /* &.iInstOff */)
+ var pp uintptr = pCsr + 72
+ var po uintptr = pCsr + 80
- for (eDetail == FTS5_DETAIL_NONE) ||
- (sqlite3Fts5PoslistNext64(tls, (*Fts5IndexIter)(unsafe.Pointer(pIter)).FpData, (*Fts5IndexIter)(unsafe.Pointer(pIter)).FnData, po, pp) != 0) {
+ for eDetail == FTS5_DETAIL_NONE ||
+ sqlite3Fts5PoslistNext64(tls, (*Fts5IndexIter)(unsafe.Pointer(pIter)).FpData, (*Fts5IndexIter)(unsafe.Pointer(pIter)).FnData, po, pp) != 0 {
(*Fts5VocabCursor)(unsafe.Pointer(pCsr)).FiInstPos = int64(0)
(*Fts5VocabCursor)(unsafe.Pointer(pCsr)).FiInstOff = 0
rc = sqlite3Fts5IterNextScan(tls, (*Fts5VocabCursor)(unsafe.Pointer(pCsr)).FpIter)
if rc == SQLITE_OK {
rc = fts5VocabInstanceNewTerm(tls, pCsr)
- if ((*Fts5VocabCursor)(unsafe.Pointer(pCsr)).FbEof != 0) || (eDetail == FTS5_DETAIL_NONE) {
+ if (*Fts5VocabCursor)(unsafe.Pointer(pCsr)).FbEof != 0 || eDetail == FTS5_DETAIL_NONE {
break
}
}
@@ -191043,15 +193563,19 @@ func fts5VocabInstanceNext(tls *libc.TLS, pCsr uintptr) int32 { /* sqlite3.c:234
}
// Advance the cursor to the next row in the table.
-func fts5VocabNextMethod(tls *libc.TLS, pCursor uintptr) int32 { /* sqlite3.c:234888:12: */
+func fts5VocabNextMethod(tls *libc.TLS, pCursor uintptr) int32 { /* sqlite3.c:236805:12: */
bp := tls.Alloc(24)
defer tls.Free(24)
var pCsr uintptr = pCursor
var pTab uintptr = (*Sqlite3_vtab_cursor)(unsafe.Pointer(pCursor)).FpVtab
- *(*int32)(unsafe.Pointer(bp + 4 /* rc */)) = SQLITE_OK
var nCol int32 = (*Fts5Config)(unsafe.Pointer((*Fts5Table)(unsafe.Pointer((*Fts5VocabCursor)(unsafe.Pointer(pCsr)).FpFts5)).FpConfig)).FnCol
+ // var rc int32 at bp+4, 4
+ *(*int32)(unsafe.Pointer(bp + 4 /* rc */)) = sqlite3Fts5StructureTest(tls, (*Fts5Table)(unsafe.Pointer((*Fts5VocabCursor)(unsafe.Pointer(pCsr)).FpFts5)).FpIndex, (*Fts5VocabCursor)(unsafe.Pointer(pCsr)).FpStruct)
+ if *(*int32)(unsafe.Pointer(bp + 4)) != SQLITE_OK {
+ return *(*int32)(unsafe.Pointer(bp + 4 /* rc */))
+ }
(*Fts5VocabCursor)(unsafe.Pointer(pCsr)).Frowid++
if (*Fts5VocabTable)(unsafe.Pointer(pTab)).FeType == FTS5_VOCAB_INSTANCE {
@@ -191066,7 +193590,7 @@ func fts5VocabNextMethod(tls *libc.TLS, pCursor uintptr) int32 { /* sqlite3.c:23
}
}
- if ((*Fts5VocabTable)(unsafe.Pointer(pTab)).FeType != FTS5_VOCAB_COL) || ((*Fts5VocabCursor)(unsafe.Pointer(pCsr)).FiCol >= nCol) {
+ if (*Fts5VocabTable)(unsafe.Pointer(pTab)).FeType != FTS5_VOCAB_COL || (*Fts5VocabCursor)(unsafe.Pointer(pCsr)).FiCol >= nCol {
if (*Fts5IndexIter)(unsafe.Pointer((*Fts5VocabCursor)(unsafe.Pointer(pCsr)).FpIter)).FbEof != 0 {
(*Fts5VocabCursor)(unsafe.Pointer(pCsr)).FbEof = 1
} else {
@@ -191077,24 +193601,24 @@ func fts5VocabNextMethod(tls *libc.TLS, pCursor uintptr) int32 { /* sqlite3.c:23
if (*Fts5VocabCursor)(unsafe.Pointer(pCsr)).FnLeTerm >= 0 {
var nCmp int32 = func() int32 {
- if (*(*int32)(unsafe.Pointer(bp /* nTerm */))) < ((*Fts5VocabCursor)(unsafe.Pointer(pCsr)).FnLeTerm) {
- return *(*int32)(unsafe.Pointer(bp /* nTerm */))
+ if *(*int32)(unsafe.Pointer(bp)) < (*Fts5VocabCursor)(unsafe.Pointer(pCsr)).FnLeTerm {
+ return *(*int32)(unsafe.Pointer(bp))
}
return (*Fts5VocabCursor)(unsafe.Pointer(pCsr)).FnLeTerm
}()
var bCmp int32 = libc.Xmemcmp(tls, (*Fts5VocabCursor)(unsafe.Pointer(pCsr)).FzLeTerm, zTerm, uint32(nCmp))
- if (bCmp < 0) || ((bCmp == 0) && ((*Fts5VocabCursor)(unsafe.Pointer(pCsr)).FnLeTerm < *(*int32)(unsafe.Pointer(bp /* nTerm */)))) {
+ if bCmp < 0 || bCmp == 0 && (*Fts5VocabCursor)(unsafe.Pointer(pCsr)).FnLeTerm < *(*int32)(unsafe.Pointer(bp)) {
(*Fts5VocabCursor)(unsafe.Pointer(pCsr)).FbEof = 1
return SQLITE_OK
}
}
- sqlite3Fts5BufferSet(tls, bp+4 /* &rc */, (pCsr + 48 /* &.term */), *(*int32)(unsafe.Pointer(bp /* nTerm */)), zTerm)
- libc.Xmemset(tls, (*Fts5VocabCursor)(unsafe.Pointer(pCsr)).FaCnt, 0, (uint32(nCol) * uint32(unsafe.Sizeof(I64(0)))))
- libc.Xmemset(tls, (*Fts5VocabCursor)(unsafe.Pointer(pCsr)).FaDoc, 0, (uint32(nCol) * uint32(unsafe.Sizeof(I64(0)))))
+ sqlite3Fts5BufferSet(tls, bp+4 /* &rc */, pCsr+56, *(*int32)(unsafe.Pointer(bp /* nTerm */)), zTerm)
+ libc.Xmemset(tls, (*Fts5VocabCursor)(unsafe.Pointer(pCsr)).FaCnt, 0, uint32(nCol)*uint32(unsafe.Sizeof(I64(0))))
+ libc.Xmemset(tls, (*Fts5VocabCursor)(unsafe.Pointer(pCsr)).FaDoc, 0, uint32(nCol)*uint32(unsafe.Sizeof(I64(0))))
(*Fts5VocabCursor)(unsafe.Pointer(pCsr)).FiCol = 0
- for *(*int32)(unsafe.Pointer(bp + 4 /* rc */)) == SQLITE_OK {
+ for *(*int32)(unsafe.Pointer(bp + 4)) == SQLITE_OK {
var eDetail int32 = (*Fts5Config)(unsafe.Pointer((*Fts5Table)(unsafe.Pointer((*Fts5VocabCursor)(unsafe.Pointer(pCsr)).FpFts5)).FpConfig)).FeDetail
var pPos uintptr
var nPos int32 // Position list
@@ -191107,7 +193631,7 @@ func fts5VocabNextMethod(tls *libc.TLS, pCursor uintptr) int32 { /* sqlite3.c:23
switch (*Fts5VocabTable)(unsafe.Pointer(pTab)).FeType {
case FTS5_VOCAB_ROW:
if eDetail == FTS5_DETAIL_FULL {
- for 0 == sqlite3Fts5PoslistNext64(tls, pPos, nPos, bp+8 /* &iOff */, bp+16 /* &iPos */) {
+ for 0 == sqlite3Fts5PoslistNext64(tls, pPos, nPos, bp+8, bp+16) {
*(*I64)(unsafe.Pointer((*Fts5VocabCursor)(unsafe.Pointer(pCsr)).FaCnt))++
}
}
@@ -191118,11 +193642,11 @@ func fts5VocabNextMethod(tls *libc.TLS, pCursor uintptr) int32 { /* sqlite3.c:23
case FTS5_VOCAB_COL:
if eDetail == FTS5_DETAIL_FULL {
var iCol int32 = -1
- for 0 == sqlite3Fts5PoslistNext64(tls, pPos, nPos, bp+8 /* &iOff */, bp+16 /* &iPos */) {
- var ii int32 = (int32(*(*I64)(unsafe.Pointer(bp + 16 /* iPos */)) >> 32))
+ for 0 == sqlite3Fts5PoslistNext64(tls, pPos, nPos, bp+8, bp+16) {
+ var ii int32 = int32(*(*I64)(unsafe.Pointer(bp + 16)) >> 32)
if iCol != ii {
if ii >= nCol {
- *(*int32)(unsafe.Pointer(bp + 4 /* rc */)) = (SQLITE_CORRUPT | (int32(1) << 8))
+ *(*int32)(unsafe.Pointer(bp + 4 /* rc */)) = SQLITE_CORRUPT | int32(1)<<8
break
}
*(*I64)(unsafe.Pointer((*Fts5VocabCursor)(unsafe.Pointer(pCsr)).FaDoc + uintptr(ii)*8))++
@@ -191131,10 +193655,10 @@ func fts5VocabNextMethod(tls *libc.TLS, pCursor uintptr) int32 { /* sqlite3.c:23
*(*I64)(unsafe.Pointer((*Fts5VocabCursor)(unsafe.Pointer(pCsr)).FaCnt + uintptr(ii)*8))++
}
} else if eDetail == FTS5_DETAIL_COLUMNS {
- for 0 == sqlite3Fts5PoslistNext64(tls, pPos, nPos, bp+8 /* &iOff */, bp+16 /* &iPos */) {
+ for 0 == sqlite3Fts5PoslistNext64(tls, pPos, nPos, bp+8, bp+16) {
- if *(*I64)(unsafe.Pointer(bp + 16 /* iPos */)) >= I64(nCol) {
- *(*int32)(unsafe.Pointer(bp + 4 /* rc */)) = (SQLITE_CORRUPT | (int32(1) << 8))
+ if *(*I64)(unsafe.Pointer(bp + 16)) >= I64(nCol) {
+ *(*int32)(unsafe.Pointer(bp + 4 /* rc */)) = SQLITE_CORRUPT | int32(1)<<8
break
}
*(*I64)(unsafe.Pointer((*Fts5VocabCursor)(unsafe.Pointer(pCsr)).FaDoc + uintptr(*(*I64)(unsafe.Pointer(bp + 16 /* iPos */)))*8))++
@@ -191151,17 +193675,17 @@ func fts5VocabNextMethod(tls *libc.TLS, pCursor uintptr) int32 { /* sqlite3.c:23
break
}
- if *(*int32)(unsafe.Pointer(bp + 4 /* rc */)) == SQLITE_OK {
+ if *(*int32)(unsafe.Pointer(bp + 4)) == SQLITE_OK {
*(*int32)(unsafe.Pointer(bp + 4 /* rc */)) = sqlite3Fts5IterNextScan(tls, (*Fts5VocabCursor)(unsafe.Pointer(pCsr)).FpIter)
}
if (*Fts5VocabTable)(unsafe.Pointer(pTab)).FeType == FTS5_VOCAB_INSTANCE {
break
}
- if *(*int32)(unsafe.Pointer(bp + 4 /* rc */)) == SQLITE_OK {
+ if *(*int32)(unsafe.Pointer(bp + 4)) == SQLITE_OK {
zTerm = sqlite3Fts5IterTerm(tls, (*Fts5VocabCursor)(unsafe.Pointer(pCsr)).FpIter, bp /* &nTerm */)
- if (*(*int32)(unsafe.Pointer(bp /* nTerm */)) != (*Fts5VocabCursor)(unsafe.Pointer(pCsr)).Fterm.Fn) ||
- ((*(*int32)(unsafe.Pointer(bp /* nTerm */)) > 0) && (libc.Xmemcmp(tls, zTerm, (*Fts5VocabCursor)(unsafe.Pointer(pCsr)).Fterm.Fp, uint32(*(*int32)(unsafe.Pointer(bp /* nTerm */)))) != 0)) {
+ if *(*int32)(unsafe.Pointer(bp)) != (*Fts5VocabCursor)(unsafe.Pointer(pCsr)).Fterm.Fn ||
+ *(*int32)(unsafe.Pointer(bp)) > 0 && libc.Xmemcmp(tls, zTerm, (*Fts5VocabCursor)(unsafe.Pointer(pCsr)).Fterm.Fp, uint32(*(*int32)(unsafe.Pointer(bp)))) != 0 {
break
}
if (*Fts5IndexIter)(unsafe.Pointer((*Fts5VocabCursor)(unsafe.Pointer(pCsr)).FpIter)).FbEof != 0 {
@@ -191172,18 +193696,18 @@ func fts5VocabNextMethod(tls *libc.TLS, pCursor uintptr) int32 { /* sqlite3.c:23
}
}
- if ((*(*int32)(unsafe.Pointer(bp + 4 /* rc */)) == SQLITE_OK) && ((*Fts5VocabCursor)(unsafe.Pointer(pCsr)).FbEof == 0)) && ((*Fts5VocabTable)(unsafe.Pointer(pTab)).FeType == FTS5_VOCAB_COL) {
- for ; ((*Fts5VocabCursor)(unsafe.Pointer(pCsr)).FiCol < nCol) && (*(*I64)(unsafe.Pointer((*Fts5VocabCursor)(unsafe.Pointer(pCsr)).FaDoc + uintptr((*Fts5VocabCursor)(unsafe.Pointer(pCsr)).FiCol)*8)) == int64(0)); (*Fts5VocabCursor)(unsafe.Pointer(pCsr)).FiCol++ {
+ if *(*int32)(unsafe.Pointer(bp + 4)) == SQLITE_OK && (*Fts5VocabCursor)(unsafe.Pointer(pCsr)).FbEof == 0 && (*Fts5VocabTable)(unsafe.Pointer(pTab)).FeType == FTS5_VOCAB_COL {
+ for ; (*Fts5VocabCursor)(unsafe.Pointer(pCsr)).FiCol < nCol && *(*I64)(unsafe.Pointer((*Fts5VocabCursor)(unsafe.Pointer(pCsr)).FaDoc + uintptr((*Fts5VocabCursor)(unsafe.Pointer(pCsr)).FiCol)*8)) == int64(0); (*Fts5VocabCursor)(unsafe.Pointer(pCsr)).FiCol++ {
}
if (*Fts5VocabCursor)(unsafe.Pointer(pCsr)).FiCol == nCol {
- *(*int32)(unsafe.Pointer(bp + 4 /* rc */)) = (SQLITE_CORRUPT | (int32(1) << 8))
+ *(*int32)(unsafe.Pointer(bp + 4 /* rc */)) = SQLITE_CORRUPT | int32(1)<<8
}
}
return *(*int32)(unsafe.Pointer(bp + 4 /* rc */))
}
// This is the xFilter implementation for the virtual table.
-func fts5VocabFilterMethod(tls *libc.TLS, pCursor uintptr, idxNum int32, zUnused uintptr, nUnused int32, apVal uintptr) int32 { /* sqlite3.c:235014:12: */
+func fts5VocabFilterMethod(tls *libc.TLS, pCursor uintptr, idxNum int32, zUnused uintptr, nUnused int32, apVal uintptr) int32 { /* sqlite3.c:236933:12: */
var pTab uintptr = (*Sqlite3_vtab_cursor)(unsafe.Pointer(pCursor)).FpVtab
var pCsr uintptr = pCursor
var eType int32 = (*Fts5VocabTable)(unsafe.Pointer(pTab)).FeType
@@ -191202,13 +193726,13 @@ func fts5VocabFilterMethod(tls *libc.TLS, pCursor uintptr, idxNum int32, zUnused
_ = nUnused
fts5VocabResetCursor(tls, pCsr)
- if (idxNum & FTS5_VOCAB_TERM_EQ) != 0 {
+ if idxNum&FTS5_VOCAB_TERM_EQ != 0 {
pEq = *(*uintptr)(unsafe.Pointer(apVal + uintptr(libc.PostIncInt32(&iVal, 1))*4))
}
- if (idxNum & FTS5_VOCAB_TERM_GE) != 0 {
+ if idxNum&FTS5_VOCAB_TERM_GE != 0 {
pGe = *(*uintptr)(unsafe.Pointer(apVal + uintptr(libc.PostIncInt32(&iVal, 1))*4))
}
- if (idxNum & FTS5_VOCAB_TERM_LE) != 0 {
+ if idxNum&FTS5_VOCAB_TERM_LE != 0 {
pLe = *(*uintptr)(unsafe.Pointer(apVal + uintptr(libc.PostIncInt32(&iVal, 1))*4))
}
@@ -191224,28 +193748,31 @@ func fts5VocabFilterMethod(tls *libc.TLS, pCursor uintptr, idxNum int32, zUnused
if pLe != 0 {
var zCopy uintptr = Xsqlite3_value_text(tls, pLe)
if zCopy == uintptr(0) {
- zCopy = ts + 755 /* "" */
+ zCopy = ts + 1543 /* "" */
}
(*Fts5VocabCursor)(unsafe.Pointer(pCsr)).FnLeTerm = Xsqlite3_value_bytes(tls, pLe)
- (*Fts5VocabCursor)(unsafe.Pointer(pCsr)).FzLeTerm = Xsqlite3_malloc(tls, ((*Fts5VocabCursor)(unsafe.Pointer(pCsr)).FnLeTerm + 1))
+ (*Fts5VocabCursor)(unsafe.Pointer(pCsr)).FzLeTerm = Xsqlite3_malloc(tls, (*Fts5VocabCursor)(unsafe.Pointer(pCsr)).FnLeTerm+1)
if (*Fts5VocabCursor)(unsafe.Pointer(pCsr)).FzLeTerm == uintptr(0) {
rc = SQLITE_NOMEM
} else {
- libc.Xmemcpy(tls, (*Fts5VocabCursor)(unsafe.Pointer(pCsr)).FzLeTerm, zCopy, (uint32((*Fts5VocabCursor)(unsafe.Pointer(pCsr)).FnLeTerm + 1)))
+ libc.Xmemcpy(tls, (*Fts5VocabCursor)(unsafe.Pointer(pCsr)).FzLeTerm, zCopy, uint32((*Fts5VocabCursor)(unsafe.Pointer(pCsr)).FnLeTerm+1))
}
}
}
if rc == SQLITE_OK {
var pIndex uintptr = (*Fts5Table)(unsafe.Pointer((*Fts5VocabCursor)(unsafe.Pointer(pCsr)).FpFts5)).FpIndex
- rc = sqlite3Fts5IndexQuery(tls, pIndex, zTerm, nTerm, f, uintptr(0), (pCsr + 16 /* &.pIter */))
+ rc = sqlite3Fts5IndexQuery(tls, pIndex, zTerm, nTerm, f, uintptr(0), pCsr+16)
+ if rc == SQLITE_OK {
+ (*Fts5VocabCursor)(unsafe.Pointer(pCsr)).FpStruct = sqlite3Fts5StructureRef(tls, pIndex)
+ }
}
- if (rc == SQLITE_OK) && (eType == FTS5_VOCAB_INSTANCE) {
+ if rc == SQLITE_OK && eType == FTS5_VOCAB_INSTANCE {
rc = fts5VocabInstanceNewTerm(tls, pCsr)
}
- if ((rc == SQLITE_OK) && !((*Fts5VocabCursor)(unsafe.Pointer(pCsr)).FbEof != 0)) &&
- ((eType != FTS5_VOCAB_INSTANCE) ||
- ((*Fts5Config)(unsafe.Pointer((*Fts5Table)(unsafe.Pointer((*Fts5VocabCursor)(unsafe.Pointer(pCsr)).FpFts5)).FpConfig)).FeDetail != FTS5_DETAIL_NONE)) {
+ if rc == SQLITE_OK && !((*Fts5VocabCursor)(unsafe.Pointer(pCsr)).FbEof != 0) &&
+ (eType != FTS5_VOCAB_INSTANCE ||
+ (*Fts5Config)(unsafe.Pointer((*Fts5Table)(unsafe.Pointer((*Fts5VocabCursor)(unsafe.Pointer(pCsr)).FpFts5)).FpConfig)).FeDetail != FTS5_DETAIL_NONE) {
rc = fts5VocabNextMethod(tls, pCursor)
}
@@ -191254,12 +193781,12 @@ func fts5VocabFilterMethod(tls *libc.TLS, pCursor uintptr, idxNum int32, zUnused
// This is the xEof method of the virtual table. SQLite calls this
// routine to find out if it has reached the end of a result set.
-func fts5VocabEofMethod(tls *libc.TLS, pCursor uintptr) int32 { /* sqlite3.c:235085:12: */
+func fts5VocabEofMethod(tls *libc.TLS, pCursor uintptr) int32 { /* sqlite3.c:237007:12: */
var pCsr uintptr = pCursor
return (*Fts5VocabCursor)(unsafe.Pointer(pCsr)).FbEof
}
-func fts5VocabColumnMethod(tls *libc.TLS, pCursor uintptr, pCtx uintptr, iCol int32) int32 { /* sqlite3.c:235090:12: */
+func fts5VocabColumnMethod(tls *libc.TLS, pCursor uintptr, pCtx uintptr, iCol int32) int32 { /* sqlite3.c:237012:12: */
var pCsr uintptr = pCursor
var eDetail int32 = (*Fts5Config)(unsafe.Pointer((*Fts5Table)(unsafe.Pointer((*Fts5VocabCursor)(unsafe.Pointer(pCsr)).FpFts5)).FpConfig)).FeDetail
var eType int32 = (*Fts5VocabTable)(unsafe.Pointer((*Sqlite3_vtab_cursor)(unsafe.Pointer(pCursor)).FpVtab)).FeType
@@ -191298,11 +193825,11 @@ func fts5VocabColumnMethod(tls *libc.TLS, pCursor uintptr, pCtx uintptr, iCol in
{
var ii int32 = -1
if eDetail == FTS5_DETAIL_FULL {
- ii = (int32((*Fts5VocabCursor)(unsafe.Pointer(pCsr)).FiInstPos >> 32))
+ ii = int32((*Fts5VocabCursor)(unsafe.Pointer(pCsr)).FiInstPos >> 32)
} else if eDetail == FTS5_DETAIL_COLUMNS {
ii = int32((*Fts5VocabCursor)(unsafe.Pointer(pCsr)).FiInstPos)
}
- if (ii >= 0) && (ii < (*Fts5Config)(unsafe.Pointer((*Fts5Table)(unsafe.Pointer((*Fts5VocabCursor)(unsafe.Pointer(pCsr)).FpFts5)).FpConfig)).FnCol) {
+ if ii >= 0 && ii < (*Fts5Config)(unsafe.Pointer((*Fts5Table)(unsafe.Pointer((*Fts5VocabCursor)(unsafe.Pointer(pCsr)).FpFts5)).FpConfig)).FnCol {
var z uintptr = *(*uintptr)(unsafe.Pointer((*Fts5Config)(unsafe.Pointer((*Fts5Table)(unsafe.Pointer((*Fts5VocabCursor)(unsafe.Pointer(pCsr)).FpFts5)).FpConfig)).FazCol + uintptr(ii)*4))
Xsqlite3_result_text(tls, pCtx, z, -1, uintptr(0))
}
@@ -191314,7 +193841,7 @@ func fts5VocabColumnMethod(tls *libc.TLS, pCursor uintptr, pCtx uintptr, iCol in
{
if eDetail == FTS5_DETAIL_FULL {
- var ii int32 = (int32((*Fts5VocabCursor)(unsafe.Pointer(pCsr)).FiInstPos & int64(0x7FFFFFFF)))
+ var ii int32 = int32((*Fts5VocabCursor)(unsafe.Pointer(pCsr)).FiInstPos & int64(0x7FFFFFFF))
Xsqlite3_result_int(tls, pCtx, ii)
}
break
@@ -191332,16 +193859,16 @@ func fts5VocabColumnMethod(tls *libc.TLS, pCursor uintptr, pCtx uintptr, iCol in
// This is the xRowid method. The SQLite core calls this routine to
// retrieve the rowid for the current row of the result set. The
// rowid should be written to *pRowid.
-func fts5VocabRowidMethod(tls *libc.TLS, pCursor uintptr, pRowid uintptr) int32 { /* sqlite3.c:235162:12: */
+func fts5VocabRowidMethod(tls *libc.TLS, pCursor uintptr, pRowid uintptr) int32 { /* sqlite3.c:237084:12: */
var pCsr uintptr = pCursor
*(*Sqlite_int64)(unsafe.Pointer(pRowid)) = (*Fts5VocabCursor)(unsafe.Pointer(pCsr)).Frowid
return SQLITE_OK
}
-func sqlite3Fts5VocabInit(tls *libc.TLS, pGlobal uintptr, db uintptr) int32 { /* sqlite3.c:235171:12: */
+func sqlite3Fts5VocabInit(tls *libc.TLS, pGlobal uintptr, db uintptr) int32 { /* sqlite3.c:237093:12: */
var p uintptr = pGlobal
- return Xsqlite3_create_module_v2(tls, db, ts+35834 /* "fts5vocab" */, uintptr(unsafe.Pointer(&fts5Vocab)), p, uintptr(0))
+ return Xsqlite3_create_module_v2(tls, db, ts+37194 /* "fts5vocab" */, uintptr(unsafe.Pointer(&fts5Vocab)), p, uintptr(0))
}
var fts5Vocab = Sqlite3_module{
@@ -191358,7 +193885,7 @@ var fts5Vocab = Sqlite3_module{
/* xEof */ FxEof: 0,
/* xColumn */ FxColumn: 0,
/* xRowid */ FxRowid: 0,
-} /* sqlite3.c:235172:31 */
+} /* sqlite3.c:237094:31 */
//************* End of fts5.c ***********************************************
//************* Begin file stmt.c *******************************************
@@ -191385,894 +193912,898 @@ var fts5Vocab = Sqlite3_module{
//************* End of stmt.c ***********************************************
// Return the source-id for this library
-func Xsqlite3_sourceid(tls *libc.TLS) uintptr { /* sqlite3.c:235516:23: */
- return ts + 35844 /* "2021-06-18 18:36..." */
+func Xsqlite3_sourceid(tls *libc.TLS) uintptr { /* sqlite3.c:237434:23: */
+ return ts + 37204 /* "2021-11-27 14:13..." */
}
//************************* End of sqlite3.c *****************************
func init() {
- *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&Xsqlite3aEQb)) + 0)) = (uintptr(unsafe.Pointer(&Xsqlite3UpperToLower)) + 210) // sqlite3.c:20881:51:
- *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&Xsqlite3aGTb)) + 0)) = (uintptr(unsafe.Pointer(&Xsqlite3UpperToLower)) + 216) // sqlite3.c:20882:51:
- *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&Xsqlite3aLTb)) + 0)) = (uintptr(unsafe.Pointer(&Xsqlite3UpperToLower)) + 204) // sqlite3.c:20880:51:
- *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aAgg)) + 8 /* .xStep */)) = jsonArrayStep // sqlite3.c:192213:7:
- *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aAgg)) + 12 /* .xFinal */)) = jsonArrayFinal // sqlite3.c:192213:24:
- *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aAgg)) + 16 /* .xValue */)) = jsonArrayValue // sqlite3.c:192213:41:
- *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aAgg)) + 28 /* .xStep */)) = jsonObjectStep // sqlite3.c:192215:7:
- *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aAgg)) + 32 /* .xFinal */)) = jsonObjectFinal // sqlite3.c:192215:24:
- *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aAgg)) + 36 /* .xValue */)) = jsonObjectValue // sqlite3.c:192215:41:
- *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aAgg1)) + 0 /* .xStep */)) = geopolyBBoxStep // sqlite3.c:198435:8:
- *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aAgg1)) + 4 /* .xFinal */)) = geopolyBBoxFinal // sqlite3.c:198435:25:
- *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aAlterTableFuncs)) + 16 /* .xSFunc */)) = renameColumnFunc // sqlite3.c:109586:5:
- *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aAlterTableFuncs)) + 56 /* .xSFunc */)) = renameTableFunc // sqlite3.c:109587:5:
- *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aAlterTableFuncs)) + 96 /* .xSFunc */)) = renameTableTest // sqlite3.c:109588:5:
- *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aAlterTableFuncs)) + 136 /* .xSFunc */)) = dropColumnFunc // sqlite3.c:109589:5:
- *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aAlterTableFuncs)) + 176 /* .xSFunc */)) = renameQuotefixFunc // sqlite3.c:109590:5:
- *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 16 /* .xSFunc */)) = versionFunc // sqlite3.c:121440:5:
- *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 56 /* .xSFunc */)) = versionFunc // sqlite3.c:121441:5:
- *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 96 /* .xSFunc */)) = versionFunc // sqlite3.c:121442:5:
- *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 136 /* .xSFunc */)) = soundexFunc // sqlite3.c:121448:5:
- *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 176 /* .xSFunc */)) = loadExt // sqlite3.c:121451:5:
- *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 216 /* .xSFunc */)) = loadExt // sqlite3.c:121452:5:
- *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 256 /* .xSFunc */)) = compileoptionusedFunc // sqlite3.c:121458:5:
- *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 296 /* .xSFunc */)) = compileoptiongetFunc // sqlite3.c:121459:5:
- *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 336 /* .xSFunc */)) = versionFunc // sqlite3.c:121461:5:
- *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 376 /* .xSFunc */)) = versionFunc // sqlite3.c:121462:5:
- *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 416 /* .xSFunc */)) = versionFunc // sqlite3.c:121463:5:
- *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 456 /* .xSFunc */)) = versionFunc // sqlite3.c:121465:5:
- *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 496 /* .xSFunc */)) = trimFunc // sqlite3.c:121468:5:
- *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 536 /* .xSFunc */)) = trimFunc // sqlite3.c:121469:5:
- *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 576 /* .xSFunc */)) = trimFunc // sqlite3.c:121470:5:
- *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 616 /* .xSFunc */)) = trimFunc // sqlite3.c:121471:5:
- *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 656 /* .xSFunc */)) = trimFunc // sqlite3.c:121472:5:
- *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 696 /* .xSFunc */)) = trimFunc // sqlite3.c:121473:5:
- *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 736 /* .xSFunc */)) = minmaxFunc // sqlite3.c:121474:5:
- *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 816 /* .xSFunc */)) = minmaxStep // sqlite3.c:121476:5:
- *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 820 /* .xFinalize */)) = minMaxFinalize // sqlite3.c:121476:5:
- *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 824 /* .xValue */)) = minMaxValue // sqlite3.c:121476:5:
- *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 856 /* .xSFunc */)) = minmaxFunc // sqlite3.c:121478:5:
- *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 936 /* .xSFunc */)) = minmaxStep // sqlite3.c:121480:5:
- *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 940 /* .xFinalize */)) = minMaxFinalize // sqlite3.c:121480:5:
- *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 944 /* .xValue */)) = minMaxValue // sqlite3.c:121480:5:
- *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 976 /* .xSFunc */)) = typeofFunc // sqlite3.c:121482:5:
- *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 1016 /* .xSFunc */)) = lengthFunc // sqlite3.c:121483:5:
- *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 1056 /* .xSFunc */)) = instrFunc // sqlite3.c:121484:5:
- *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 1096 /* .xSFunc */)) = printfFunc // sqlite3.c:121485:5:
- *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 1136 /* .xSFunc */)) = unicodeFunc // sqlite3.c:121486:5:
- *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 1176 /* .xSFunc */)) = charFunc // sqlite3.c:121487:5:
- *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 1216 /* .xSFunc */)) = absFunc // sqlite3.c:121488:5:
- *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 1256 /* .xSFunc */)) = roundFunc // sqlite3.c:121490:5:
- *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 1296 /* .xSFunc */)) = roundFunc // sqlite3.c:121491:5:
- *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 1336 /* .xSFunc */)) = upperFunc // sqlite3.c:121493:5:
- *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 1376 /* .xSFunc */)) = lowerFunc // sqlite3.c:121494:5:
- *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 1416 /* .xSFunc */)) = hexFunc // sqlite3.c:121495:5:
- *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 1456 /* .xSFunc */)) = versionFunc // sqlite3.c:121496:5:
- *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 1496 /* .xSFunc */)) = randomFunc // sqlite3.c:121497:5:
- *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 1536 /* .xSFunc */)) = randomBlob // sqlite3.c:121498:5:
- *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 1576 /* .xSFunc */)) = nullifFunc // sqlite3.c:121499:5:
- *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 1616 /* .xSFunc */)) = versionFunc // sqlite3.c:121500:5:
- *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 1656 /* .xSFunc */)) = sourceidFunc // sqlite3.c:121501:5:
- *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 1696 /* .xSFunc */)) = errlogFunc // sqlite3.c:121502:5:
- *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 1736 /* .xSFunc */)) = quoteFunc // sqlite3.c:121503:5:
- *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 1776 /* .xSFunc */)) = last_insert_rowid // sqlite3.c:121504:5:
- *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 1816 /* .xSFunc */)) = changes // sqlite3.c:121505:5:
- *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 1856 /* .xSFunc */)) = total_changes // sqlite3.c:121506:5:
- *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 1896 /* .xSFunc */)) = replaceFunc // sqlite3.c:121507:5:
- *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 1936 /* .xSFunc */)) = zeroblobFunc // sqlite3.c:121508:5:
- *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 1976 /* .xSFunc */)) = substrFunc // sqlite3.c:121509:5:
- *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 2016 /* .xSFunc */)) = substrFunc // sqlite3.c:121510:5:
- *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 2056 /* .xSFunc */)) = substrFunc // sqlite3.c:121511:5:
- *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 2096 /* .xSFunc */)) = substrFunc // sqlite3.c:121512:5:
- *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 2136 /* .xSFunc */)) = sumStep // sqlite3.c:121513:5:
- *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 2140 /* .xFinalize */)) = sumFinalize // sqlite3.c:121513:5:
- *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 2144 /* .xValue */)) = sumFinalize // sqlite3.c:121513:5:
- *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 2148 /* .xInverse */)) = sumInverse // sqlite3.c:121513:5:
- *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 2176 /* .xSFunc */)) = sumStep // sqlite3.c:121514:5:
- *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 2180 /* .xFinalize */)) = totalFinalize // sqlite3.c:121514:5:
- *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 2184 /* .xValue */)) = totalFinalize // sqlite3.c:121514:5:
- *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 2188 /* .xInverse */)) = sumInverse // sqlite3.c:121514:5:
- *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 2216 /* .xSFunc */)) = sumStep // sqlite3.c:121515:5:
- *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 2220 /* .xFinalize */)) = avgFinalize // sqlite3.c:121515:5:
- *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 2224 /* .xValue */)) = avgFinalize // sqlite3.c:121515:5:
- *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 2228 /* .xInverse */)) = sumInverse // sqlite3.c:121515:5:
- *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 2256 /* .xSFunc */)) = countStep // sqlite3.c:121516:5:
- *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 2260 /* .xFinalize */)) = countFinalize // sqlite3.c:121516:5:
- *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 2264 /* .xValue */)) = countFinalize // sqlite3.c:121516:5:
- *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 2268 /* .xInverse */)) = countInverse // sqlite3.c:121516:5:
- *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 2296 /* .xSFunc */)) = countStep // sqlite3.c:121518:5:
- *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 2300 /* .xFinalize */)) = countFinalize // sqlite3.c:121518:5:
- *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 2304 /* .xValue */)) = countFinalize // sqlite3.c:121518:5:
- *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 2308 /* .xInverse */)) = countInverse // sqlite3.c:121518:5:
- *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 2336 /* .xSFunc */)) = groupConcatStep // sqlite3.c:121520:5:
- *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 2340 /* .xFinalize */)) = groupConcatFinalize // sqlite3.c:121520:5:
- *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 2344 /* .xValue */)) = groupConcatValue // sqlite3.c:121520:5:
- *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 2348 /* .xInverse */)) = groupConcatInverse // sqlite3.c:121520:5:
- *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 2376 /* .xSFunc */)) = groupConcatStep // sqlite3.c:121522:5:
- *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 2380 /* .xFinalize */)) = groupConcatFinalize // sqlite3.c:121522:5:
- *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 2384 /* .xValue */)) = groupConcatValue // sqlite3.c:121522:5:
- *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 2388 /* .xInverse */)) = groupConcatInverse // sqlite3.c:121522:5:
- *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 2408 /* .pUserData */)) = uintptr(unsafe.Pointer(&globInfo)) // sqlite3.c:121525:5:
- *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 2416 /* .xSFunc */)) = likeFunc // sqlite3.c:121525:5:
- *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 2448 /* .pUserData */)) = uintptr(unsafe.Pointer(&likeInfoNorm)) // sqlite3.c:121530:5:
- *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 2456 /* .xSFunc */)) = likeFunc // sqlite3.c:121530:5:
- *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 2488 /* .pUserData */)) = uintptr(unsafe.Pointer(&likeInfoNorm)) // sqlite3.c:121531:5:
- *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 2496 /* .xSFunc */)) = likeFunc // sqlite3.c:121531:5:
- *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 2616 /* .xSFunc */)) = signFunc // sqlite3.c:121574:5:
- *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 2656 /* .xSFunc */)) = versionFunc // sqlite3.c:121575:5:
- *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 2696 /* .xSFunc */)) = versionFunc // sqlite3.c:121576:5:
- *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aDateTimeFuncs)) + 8 /* .pUserData */)) = uintptr(unsafe.Pointer(&Xsqlite3Config)) // sqlite3.c:23407:5:
- *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aDateTimeFuncs)) + 16 /* .xSFunc */)) = juliandayFunc // sqlite3.c:23407:5:
- *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aDateTimeFuncs)) + 48 /* .pUserData */)) = uintptr(unsafe.Pointer(&Xsqlite3Config)) // sqlite3.c:23408:5:
- *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aDateTimeFuncs)) + 56 /* .xSFunc */)) = dateFunc // sqlite3.c:23408:5:
- *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aDateTimeFuncs)) + 88 /* .pUserData */)) = uintptr(unsafe.Pointer(&Xsqlite3Config)) // sqlite3.c:23409:5:
- *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aDateTimeFuncs)) + 96 /* .xSFunc */)) = timeFunc // sqlite3.c:23409:5:
- *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aDateTimeFuncs)) + 128 /* .pUserData */)) = uintptr(unsafe.Pointer(&Xsqlite3Config)) // sqlite3.c:23410:5:
- *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aDateTimeFuncs)) + 136 /* .xSFunc */)) = datetimeFunc // sqlite3.c:23410:5:
- *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aDateTimeFuncs)) + 168 /* .pUserData */)) = uintptr(unsafe.Pointer(&Xsqlite3Config)) // sqlite3.c:23411:5:
- *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aDateTimeFuncs)) + 176 /* .xSFunc */)) = strftimeFunc // sqlite3.c:23411:5:
- *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aDateTimeFuncs)) + 216 /* .xSFunc */)) = ctimeFunc // sqlite3.c:23412:5:
- *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aDateTimeFuncs)) + 256 /* .xSFunc */)) = ctimestampFunc // sqlite3.c:23413:5:
- *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aDateTimeFuncs)) + 296 /* .xSFunc */)) = cdateFunc // sqlite3.c:23414:5:
- *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aFunc)) + 12 /* .xFunc */)) = jsonRemoveFunc // sqlite3.c:192183:39:
- *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aFunc)) + 28 /* .xFunc */)) = jsonArrayFunc // sqlite3.c:192184:39:
- *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aFunc)) + 44 /* .xFunc */)) = jsonArrayLengthFunc // sqlite3.c:192185:39:
- *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aFunc)) + 60 /* .xFunc */)) = jsonArrayLengthFunc // sqlite3.c:192186:39:
- *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aFunc)) + 76 /* .xFunc */)) = jsonExtractFunc // sqlite3.c:192187:39:
- *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aFunc)) + 92 /* .xFunc */)) = jsonSetFunc // sqlite3.c:192188:39:
- *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aFunc)) + 108 /* .xFunc */)) = jsonObjectFunc // sqlite3.c:192189:39:
- *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aFunc)) + 124 /* .xFunc */)) = jsonPatchFunc // sqlite3.c:192190:39:
- *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aFunc)) + 140 /* .xFunc */)) = jsonQuoteFunc // sqlite3.c:192191:39:
- *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aFunc)) + 156 /* .xFunc */)) = jsonRemoveFunc // sqlite3.c:192192:39:
- *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aFunc)) + 172 /* .xFunc */)) = jsonReplaceFunc // sqlite3.c:192193:39:
- *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aFunc)) + 188 /* .xFunc */)) = jsonSetFunc // sqlite3.c:192194:39:
- *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aFunc)) + 204 /* .xFunc */)) = jsonTypeFunc // sqlite3.c:192195:39:
- *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aFunc)) + 220 /* .xFunc */)) = jsonTypeFunc // sqlite3.c:192196:39:
- *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aFunc)) + 236 /* .xFunc */)) = jsonValidFunc // sqlite3.c:192197:39:
- *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aFunc1)) + 0 /* .xFunc */)) = geopolyAreaFunc // sqlite3.c:198417:8:
- *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aFunc1)) + 12 /* .xFunc */)) = geopolyBlobFunc // sqlite3.c:198418:8:
- *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aFunc1)) + 24 /* .xFunc */)) = geopolyJsonFunc // sqlite3.c:198419:8:
- *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aFunc1)) + 36 /* .xFunc */)) = geopolySvgFunc // sqlite3.c:198420:8:
- *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aFunc1)) + 48 /* .xFunc */)) = geopolyWithinFunc // sqlite3.c:198421:8:
- *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aFunc1)) + 60 /* .xFunc */)) = geopolyContainsPointFunc // sqlite3.c:198422:8:
- *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aFunc1)) + 72 /* .xFunc */)) = geopolyOverlapFunc // sqlite3.c:198423:8:
- *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aFunc1)) + 84 /* .xFunc */)) = geopolyDebugFunc // sqlite3.c:198424:8:
- *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aFunc1)) + 96 /* .xFunc */)) = geopolyBBoxFunc // sqlite3.c:198425:8:
- *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aFunc1)) + 108 /* .xFunc */)) = geopolyXformFunc // sqlite3.c:198426:8:
- *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aFunc1)) + 120 /* .xFunc */)) = geopolyRegularFunc // sqlite3.c:198427:8:
- *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aFunc1)) + 132 /* .xFunc */)) = geopolyCcwFunc // sqlite3.c:198428:8:
- *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aMod)) + 4 /* .pModule */)) = uintptr(unsafe.Pointer(&jsonEachModule)) // sqlite3.c:192222:31:
- *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aMod)) + 12 /* .pModule */)) = uintptr(unsafe.Pointer(&jsonTreeModule)) // sqlite3.c:192223:31:
+ *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&Xsqlite3aEQb)) + 0)) = uintptr(unsafe.Pointer(&Xsqlite3UpperToLower)) + 210 // sqlite3.c:21341:51:
+ *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&Xsqlite3aGTb)) + 0)) = uintptr(unsafe.Pointer(&Xsqlite3UpperToLower)) + 216 // sqlite3.c:21342:51:
+ *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&Xsqlite3aLTb)) + 0)) = uintptr(unsafe.Pointer(&Xsqlite3UpperToLower)) + 204 // sqlite3.c:21340:51:
+ *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aAgg)) + 8)) = jsonArrayStep // sqlite3.c:193849:7:
+ *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aAgg)) + 12)) = jsonArrayFinal // sqlite3.c:193849:24:
+ *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aAgg)) + 16)) = jsonArrayValue // sqlite3.c:193849:41:
+ *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aAgg)) + 28)) = jsonObjectStep // sqlite3.c:193851:7:
+ *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aAgg)) + 32)) = jsonObjectFinal // sqlite3.c:193851:24:
+ *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aAgg)) + 36)) = jsonObjectValue // sqlite3.c:193851:41:
+ *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aAgg1)) + 0)) = geopolyBBoxStep // sqlite3.c:200103:8:
+ *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aAgg1)) + 4)) = geopolyBBoxFinal // sqlite3.c:200103:25:
+ *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aAlterTableFuncs)) + 16)) = renameColumnFunc // sqlite3.c:110206:5:
+ *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aAlterTableFuncs)) + 56)) = renameTableFunc // sqlite3.c:110207:5:
+ *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aAlterTableFuncs)) + 96)) = renameTableTest // sqlite3.c:110208:5:
+ *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aAlterTableFuncs)) + 136)) = dropColumnFunc // sqlite3.c:110209:5:
+ *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aAlterTableFuncs)) + 176)) = renameQuotefixFunc // sqlite3.c:110210:5:
+ *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 16)) = versionFunc // sqlite3.c:122368:5:
+ *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 56)) = versionFunc // sqlite3.c:122369:5:
+ *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 96)) = versionFunc // sqlite3.c:122370:5:
+ *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 136)) = versionFunc // sqlite3.c:122371:5:
+ *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 176)) = soundexFunc // sqlite3.c:122375:5:
+ *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 216)) = loadExt // sqlite3.c:122378:5:
+ *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 256)) = loadExt // sqlite3.c:122379:5:
+ *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 296)) = compileoptionusedFunc // sqlite3.c:122385:5:
+ *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 336)) = compileoptiongetFunc // sqlite3.c:122386:5:
+ *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 376)) = versionFunc // sqlite3.c:122388:5:
+ *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 416)) = versionFunc // sqlite3.c:122389:5:
+ *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 456)) = versionFunc // sqlite3.c:122390:5:
+ *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 496)) = versionFunc // sqlite3.c:122392:5:
+ *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 536)) = trimFunc // sqlite3.c:122395:5:
+ *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 576)) = trimFunc // sqlite3.c:122396:5:
+ *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 616)) = trimFunc // sqlite3.c:122397:5:
+ *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 656)) = trimFunc // sqlite3.c:122398:5:
+ *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 696)) = trimFunc // sqlite3.c:122399:5:
+ *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 736)) = trimFunc // sqlite3.c:122400:5:
+ *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 776)) = minmaxFunc // sqlite3.c:122401:5:
+ *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 856)) = minmaxStep // sqlite3.c:122403:5:
+ *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 860)) = minMaxFinalize // sqlite3.c:122403:5:
+ *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 864)) = minMaxValue // sqlite3.c:122403:5:
+ *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 896)) = minmaxFunc // sqlite3.c:122405:5:
+ *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 976)) = minmaxStep // sqlite3.c:122407:5:
+ *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 980)) = minMaxFinalize // sqlite3.c:122407:5:
+ *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 984)) = minMaxValue // sqlite3.c:122407:5:
+ *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 1016)) = typeofFunc // sqlite3.c:122409:5:
+ *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 1056)) = lengthFunc // sqlite3.c:122410:5:
+ *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 1096)) = instrFunc // sqlite3.c:122411:5:
+ *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 1136)) = printfFunc // sqlite3.c:122412:5:
+ *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 1176)) = unicodeFunc // sqlite3.c:122413:5:
+ *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 1216)) = charFunc // sqlite3.c:122414:5:
+ *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 1256)) = absFunc // sqlite3.c:122415:5:
+ *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 1296)) = roundFunc // sqlite3.c:122417:5:
+ *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 1336)) = roundFunc // sqlite3.c:122418:5:
+ *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 1376)) = upperFunc // sqlite3.c:122420:5:
+ *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 1416)) = lowerFunc // sqlite3.c:122421:5:
+ *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 1456)) = hexFunc // sqlite3.c:122422:5:
+ *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 1496)) = versionFunc // sqlite3.c:122423:5:
+ *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 1536)) = randomFunc // sqlite3.c:122424:5:
+ *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 1576)) = randomBlob // sqlite3.c:122425:5:
+ *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 1616)) = nullifFunc // sqlite3.c:122426:5:
+ *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 1656)) = versionFunc // sqlite3.c:122427:5:
+ *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 1696)) = sourceidFunc // sqlite3.c:122428:5:
+ *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 1736)) = errlogFunc // sqlite3.c:122429:5:
+ *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 1776)) = quoteFunc // sqlite3.c:122430:5:
+ *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 1816)) = last_insert_rowid // sqlite3.c:122431:5:
+ *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 1856)) = changes // sqlite3.c:122432:5:
+ *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 1896)) = total_changes // sqlite3.c:122433:5:
+ *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 1936)) = replaceFunc // sqlite3.c:122434:5:
+ *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 1976)) = zeroblobFunc // sqlite3.c:122435:5:
+ *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 2016)) = substrFunc // sqlite3.c:122436:5:
+ *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 2056)) = substrFunc // sqlite3.c:122437:5:
+ *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 2096)) = substrFunc // sqlite3.c:122438:5:
+ *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 2136)) = substrFunc // sqlite3.c:122439:5:
+ *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 2176)) = sumStep // sqlite3.c:122440:5:
+ *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 2180)) = sumFinalize // sqlite3.c:122440:5:
+ *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 2184)) = sumFinalize // sqlite3.c:122440:5:
+ *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 2188)) = sumInverse // sqlite3.c:122440:5:
+ *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 2216)) = sumStep // sqlite3.c:122441:5:
+ *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 2220)) = totalFinalize // sqlite3.c:122441:5:
+ *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 2224)) = totalFinalize // sqlite3.c:122441:5:
+ *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 2228)) = sumInverse // sqlite3.c:122441:5:
+ *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 2256)) = sumStep // sqlite3.c:122442:5:
+ *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 2260)) = avgFinalize // sqlite3.c:122442:5:
+ *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 2264)) = avgFinalize // sqlite3.c:122442:5:
+ *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 2268)) = sumInverse // sqlite3.c:122442:5:
+ *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 2296)) = countStep // sqlite3.c:122443:5:
+ *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 2300)) = countFinalize // sqlite3.c:122443:5:
+ *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 2304)) = countFinalize // sqlite3.c:122443:5:
+ *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 2308)) = countInverse // sqlite3.c:122443:5:
+ *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 2336)) = countStep // sqlite3.c:122446:5:
+ *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 2340)) = countFinalize // sqlite3.c:122446:5:
+ *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 2344)) = countFinalize // sqlite3.c:122446:5:
+ *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 2348)) = countInverse // sqlite3.c:122446:5:
+ *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 2376)) = groupConcatStep // sqlite3.c:122448:5:
+ *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 2380)) = groupConcatFinalize // sqlite3.c:122448:5:
+ *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 2384)) = groupConcatValue // sqlite3.c:122448:5:
+ *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 2388)) = groupConcatInverse // sqlite3.c:122448:5:
+ *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 2416)) = groupConcatStep // sqlite3.c:122450:5:
+ *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 2420)) = groupConcatFinalize // sqlite3.c:122450:5:
+ *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 2424)) = groupConcatValue // sqlite3.c:122450:5:
+ *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 2428)) = groupConcatInverse // sqlite3.c:122450:5:
+ *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 2448 /* .pUserData */)) = uintptr(unsafe.Pointer(&globInfo)) // sqlite3.c:122453:5:
+ *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 2456)) = likeFunc // sqlite3.c:122453:5:
+ *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 2488 /* .pUserData */)) = uintptr(unsafe.Pointer(&likeInfoNorm)) // sqlite3.c:122458:5:
+ *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 2496)) = likeFunc // sqlite3.c:122458:5:
+ *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 2528 /* .pUserData */)) = uintptr(unsafe.Pointer(&likeInfoNorm)) // sqlite3.c:122459:5:
+ *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 2536)) = likeFunc // sqlite3.c:122459:5:
+ *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 2656)) = signFunc // sqlite3.c:122502:5:
+ *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 2696)) = versionFunc // sqlite3.c:122503:5:
+ *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 2736)) = versionFunc // sqlite3.c:122504:5:
+ *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aDateTimeFuncs)) + 8 /* .pUserData */)) = uintptr(unsafe.Pointer(&Xsqlite3Config)) // sqlite3.c:23895:5:
+ *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aDateTimeFuncs)) + 16)) = juliandayFunc // sqlite3.c:23895:5:
+ *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aDateTimeFuncs)) + 48 /* .pUserData */)) = uintptr(unsafe.Pointer(&Xsqlite3Config)) // sqlite3.c:23896:5:
+ *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aDateTimeFuncs)) + 56)) = dateFunc // sqlite3.c:23896:5:
+ *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aDateTimeFuncs)) + 88 /* .pUserData */)) = uintptr(unsafe.Pointer(&Xsqlite3Config)) // sqlite3.c:23897:5:
+ *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aDateTimeFuncs)) + 96)) = timeFunc // sqlite3.c:23897:5:
+ *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aDateTimeFuncs)) + 128 /* .pUserData */)) = uintptr(unsafe.Pointer(&Xsqlite3Config)) // sqlite3.c:23898:5:
+ *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aDateTimeFuncs)) + 136)) = datetimeFunc // sqlite3.c:23898:5:
+ *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aDateTimeFuncs)) + 168 /* .pUserData */)) = uintptr(unsafe.Pointer(&Xsqlite3Config)) // sqlite3.c:23899:5:
+ *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aDateTimeFuncs)) + 176)) = strftimeFunc // sqlite3.c:23899:5:
+ *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aDateTimeFuncs)) + 216)) = ctimeFunc // sqlite3.c:23900:5:
+ *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aDateTimeFuncs)) + 256)) = ctimestampFunc // sqlite3.c:23901:5:
+ *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aDateTimeFuncs)) + 296)) = cdateFunc // sqlite3.c:23902:5:
+ *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aFunc)) + 12)) = jsonRemoveFunc // sqlite3.c:193819:39:
+ *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aFunc)) + 28)) = jsonArrayFunc // sqlite3.c:193820:39:
+ *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aFunc)) + 44)) = jsonArrayLengthFunc // sqlite3.c:193821:39:
+ *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aFunc)) + 60)) = jsonArrayLengthFunc // sqlite3.c:193822:39:
+ *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aFunc)) + 76)) = jsonExtractFunc // sqlite3.c:193823:39:
+ *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aFunc)) + 92)) = jsonSetFunc // sqlite3.c:193824:39:
+ *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aFunc)) + 108)) = jsonObjectFunc // sqlite3.c:193825:39:
+ *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aFunc)) + 124)) = jsonPatchFunc // sqlite3.c:193826:39:
+ *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aFunc)) + 140)) = jsonQuoteFunc // sqlite3.c:193827:39:
+ *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aFunc)) + 156)) = jsonRemoveFunc // sqlite3.c:193828:39:
+ *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aFunc)) + 172)) = jsonReplaceFunc // sqlite3.c:193829:39:
+ *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aFunc)) + 188)) = jsonSetFunc // sqlite3.c:193830:39:
+ *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aFunc)) + 204)) = jsonTypeFunc // sqlite3.c:193831:39:
+ *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aFunc)) + 220)) = jsonTypeFunc // sqlite3.c:193832:39:
+ *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aFunc)) + 236)) = jsonValidFunc // sqlite3.c:193833:39:
+ *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aFunc1)) + 0)) = geopolyAreaFunc // sqlite3.c:200085:8:
+ *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aFunc1)) + 12)) = geopolyBlobFunc // sqlite3.c:200086:8:
+ *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aFunc1)) + 24)) = geopolyJsonFunc // sqlite3.c:200087:8:
+ *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aFunc1)) + 36)) = geopolySvgFunc // sqlite3.c:200088:8:
+ *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aFunc1)) + 48)) = geopolyWithinFunc // sqlite3.c:200089:8:
+ *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aFunc1)) + 60)) = geopolyContainsPointFunc // sqlite3.c:200090:8:
+ *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aFunc1)) + 72)) = geopolyOverlapFunc // sqlite3.c:200091:8:
+ *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aFunc1)) + 84)) = geopolyDebugFunc // sqlite3.c:200092:8:
+ *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aFunc1)) + 96)) = geopolyBBoxFunc // sqlite3.c:200093:8:
+ *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aFunc1)) + 108)) = geopolyXformFunc // sqlite3.c:200094:8:
+ *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aFunc1)) + 120)) = geopolyRegularFunc // sqlite3.c:200095:8:
+ *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aFunc1)) + 132)) = geopolyCcwFunc // sqlite3.c:200096:8:
+ *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aMod)) + 4 /* .pModule */)) = uintptr(unsafe.Pointer(&jsonEachModule)) // sqlite3.c:193858:31:
+ *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aMod)) + 12 /* .pModule */)) = uintptr(unsafe.Pointer(&jsonTreeModule)) // sqlite3.c:193859:31:
*(*Sqlite3_syscall_ptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aSyscall)) + 4 /* .pCurrent */)) = *(*uintptr)(unsafe.Pointer(&struct {
f func(*libc.TLS, uintptr, int32, int32) int32
- }{posixOpen})) // sqlite3.c:34447:21:
- *(*Sqlite3_syscall_ptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aSyscall)) + 16 /* .pCurrent */)) = *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, int32) int32 }{libc.Xclose})) // sqlite3.c:34450:21:
+ }{posixOpen})) // sqlite3.c:34623:21:
+ *(*Sqlite3_syscall_ptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aSyscall)) + 16 /* .pCurrent */)) = *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, int32) int32 }{libc.Xclose})) // sqlite3.c:34626:21:
*(*Sqlite3_syscall_ptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aSyscall)) + 28 /* .pCurrent */)) = *(*uintptr)(unsafe.Pointer(&struct {
f func(*libc.TLS, uintptr, int32) int32
- }{libc.Xaccess})) // sqlite3.c:34453:21:
+ }{libc.Xaccess})) // sqlite3.c:34629:21:
*(*Sqlite3_syscall_ptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aSyscall)) + 40 /* .pCurrent */)) = *(*uintptr)(unsafe.Pointer(&struct {
f func(*libc.TLS, uintptr, Size_t) uintptr
- }{libc.Xgetcwd})) // sqlite3.c:34456:21:
+ }{libc.Xgetcwd})) // sqlite3.c:34632:21:
*(*Sqlite3_syscall_ptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aSyscall)) + 52 /* .pCurrent */)) = *(*uintptr)(unsafe.Pointer(&struct {
f func(*libc.TLS, uintptr, uintptr) int32
- }{libc.Xstat})) // sqlite3.c:34459:21:
+ }{libc.Xstat})) // sqlite3.c:34635:21:
*(*Sqlite3_syscall_ptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aSyscall)) + 64 /* .pCurrent */)) = *(*uintptr)(unsafe.Pointer(&struct {
f func(*libc.TLS, int32, uintptr) int32
- }{libc.Xfstat})) // sqlite3.c:34472:21:
+ }{libc.Xfstat})) // sqlite3.c:34648:21:
*(*Sqlite3_syscall_ptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aSyscall)) + 76 /* .pCurrent */)) = *(*uintptr)(unsafe.Pointer(&struct {
f func(*libc.TLS, int32, X__off64_t) int32
- }{libc.Xftruncate})) // sqlite3.c:34476:21:
+ }{libc.Xftruncate})) // sqlite3.c:34652:21:
*(*Sqlite3_syscall_ptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aSyscall)) + 88 /* .pCurrent */)) = *(*uintptr)(unsafe.Pointer(&struct {
f func(*libc.TLS, int32, int32, uintptr) int32
- }{libc.Xfcntl})) // sqlite3.c:34479:21:
+ }{libc.Xfcntl})) // sqlite3.c:34655:21:
*(*Sqlite3_syscall_ptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aSyscall)) + 100 /* .pCurrent */)) = *(*uintptr)(unsafe.Pointer(&struct {
f func(*libc.TLS, int32, uintptr, Size_t) Ssize_t
- }{libc.Xread})) // sqlite3.c:34482:21:
+ }{libc.Xread})) // sqlite3.c:34658:21:
*(*Sqlite3_syscall_ptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aSyscall)) + 136 /* .pCurrent */)) = *(*uintptr)(unsafe.Pointer(&struct {
f func(*libc.TLS, int32, uintptr, Size_t) Ssize_t
- }{libc.Xwrite})) // sqlite3.c:34499:21:
+ }{libc.Xwrite})) // sqlite3.c:34675:21:
*(*Sqlite3_syscall_ptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aSyscall)) + 172 /* .pCurrent */)) = *(*uintptr)(unsafe.Pointer(&struct {
f func(*libc.TLS, int32, X__mode_t) int32
- }{libc.Xfchmod})) // sqlite3.c:34518:21:
+ }{libc.Xfchmod})) // sqlite3.c:34694:21:
*(*Sqlite3_syscall_ptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aSyscall)) + 196 /* .pCurrent */)) = *(*uintptr)(unsafe.Pointer(&struct {
f func(*libc.TLS, uintptr) int32
- }{libc.Xunlink})) // sqlite3.c:34528:21:
+ }{libc.Xunlink})) // sqlite3.c:34704:21:
*(*Sqlite3_syscall_ptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aSyscall)) + 208 /* .pCurrent */)) = *(*uintptr)(unsafe.Pointer(&struct {
f func(*libc.TLS, uintptr, uintptr) int32
- }{openDirectory})) // sqlite3.c:34531:25:
+ }{openDirectory})) // sqlite3.c:34707:25:
*(*Sqlite3_syscall_ptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aSyscall)) + 220 /* .pCurrent */)) = *(*uintptr)(unsafe.Pointer(&struct {
f func(*libc.TLS, uintptr, X__mode_t) int32
- }{libc.Xmkdir})) // sqlite3.c:34534:21:
+ }{libc.Xmkdir})) // sqlite3.c:34710:21:
*(*Sqlite3_syscall_ptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aSyscall)) + 232 /* .pCurrent */)) = *(*uintptr)(unsafe.Pointer(&struct {
f func(*libc.TLS, uintptr) int32
- }{libc.Xrmdir})) // sqlite3.c:34537:21:
+ }{libc.Xrmdir})) // sqlite3.c:34713:21:
*(*Sqlite3_syscall_ptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aSyscall)) + 244 /* .pCurrent */)) = *(*uintptr)(unsafe.Pointer(&struct {
f func(*libc.TLS, int32, X__uid_t, X__gid_t) int32
- }{libc.Xfchown})) // sqlite3.c:34541:21:
- *(*Sqlite3_syscall_ptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aSyscall)) + 256 /* .pCurrent */)) = *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS) X__uid_t }{libc.Xgeteuid})) // sqlite3.c:34548:21:
+ }{libc.Xfchown})) // sqlite3.c:34717:21:
+ *(*Sqlite3_syscall_ptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aSyscall)) + 256 /* .pCurrent */)) = *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS) X__uid_t }{libc.Xgeteuid})) // sqlite3.c:34724:21:
*(*Sqlite3_syscall_ptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aSyscall)) + 268 /* .pCurrent */)) = *(*uintptr)(unsafe.Pointer(&struct {
f func(*libc.TLS, uintptr, Size_t, int32, int32, int32, X__off64_t) uintptr
- }{libc.Xmmap})) // sqlite3.c:34555:21:
+ }{libc.Xmmap})) // sqlite3.c:34731:21:
*(*Sqlite3_syscall_ptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aSyscall)) + 280 /* .pCurrent */)) = *(*uintptr)(unsafe.Pointer(&struct {
f func(*libc.TLS, uintptr, Size_t) int32
- }{libc.Xmunmap})) // sqlite3.c:34562:21:
+ }{libc.Xmunmap})) // sqlite3.c:34738:21:
*(*Sqlite3_syscall_ptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aSyscall)) + 292 /* .pCurrent */)) = *(*uintptr)(unsafe.Pointer(&struct {
f func(*libc.TLS, uintptr, Size_t, Size_t, int32, uintptr) uintptr
- }{libc.Xmremap})) // sqlite3.c:34569:21:
- *(*Sqlite3_syscall_ptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aSyscall)) + 304 /* .pCurrent */)) = *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS) int32 }{unixGetpagesize})) // sqlite3.c:34576:21:
+ }{libc.Xmremap})) // sqlite3.c:34745:21:
+ *(*Sqlite3_syscall_ptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aSyscall)) + 304 /* .pCurrent */)) = *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS) int32 }{unixGetpagesize})) // sqlite3.c:34752:21:
*(*Sqlite3_syscall_ptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aSyscall)) + 316 /* .pCurrent */)) = *(*uintptr)(unsafe.Pointer(&struct {
f func(*libc.TLS, uintptr, uintptr, Size_t) Ssize_t
- }{libc.Xreadlink})) // sqlite3.c:34583:21:
+ }{libc.Xreadlink})) // sqlite3.c:34759:21:
*(*Sqlite3_syscall_ptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aSyscall)) + 328 /* .pCurrent */)) = *(*uintptr)(unsafe.Pointer(&struct {
f func(*libc.TLS, uintptr, uintptr) int32
- }{libc.Xlstat})) // sqlite3.c:34590:22:
- *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 20 /* .pAppData */)) = uintptr(unsafe.Pointer(&posixIoFinder)) // sqlite3.c:42097:5:
- *(*func(*libc.TLS, uintptr, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 24 /* .xOpen */)) = unixOpen // sqlite3.c:42097:5:
- *(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 28 /* .xDelete */)) = unixDelete // sqlite3.c:42097:5:
- *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 32 /* .xAccess */)) = unixAccess // sqlite3.c:42097:5:
- *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 36 /* .xFullPathname */)) = unixFullPathname // sqlite3.c:42097:5:
- *(*func(*libc.TLS, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 40 /* .xDlOpen */)) = unixDlOpen // sqlite3.c:42097:5:
- *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 44 /* .xDlError */)) = unixDlError // sqlite3.c:42097:5:
- *(*func(*libc.TLS, uintptr, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 48 /* .xDlSym */)) = unixDlSym // sqlite3.c:42097:5:
- *(*func(*libc.TLS, uintptr, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 52 /* .xDlClose */)) = unixDlClose // sqlite3.c:42097:5:
- *(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 56 /* .xRandomness */)) = unixRandomness // sqlite3.c:42097:5:
- *(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 60 /* .xSleep */)) = unixSleep // sqlite3.c:42097:5:
- *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 64 /* .xCurrentTime */)) = unixCurrentTime // sqlite3.c:42097:5:
- *(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 68 /* .xGetLastError */)) = unixGetLastError // sqlite3.c:42097:5:
- *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 72 /* .xCurrentTimeInt64 */)) = unixCurrentTimeInt64 // sqlite3.c:42097:5:
- *(*func(*libc.TLS, uintptr, uintptr, Sqlite3_syscall_ptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 76 /* .xSetSystemCall */)) = unixSetSystemCall // sqlite3.c:42097:5:
- *(*func(*libc.TLS, uintptr, uintptr) Sqlite3_syscall_ptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 80 /* .xGetSystemCall */)) = unixGetSystemCall // sqlite3.c:42097:5:
- *(*func(*libc.TLS, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 84 /* .xNextSystemCall */)) = unixNextSystemCall // sqlite3.c:42097:5:
- *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 108 /* .pAppData */)) = uintptr(unsafe.Pointer(&nolockIoFinder)) // sqlite3.c:42099:5:
- *(*func(*libc.TLS, uintptr, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 112 /* .xOpen */)) = unixOpen // sqlite3.c:42099:5:
- *(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 116 /* .xDelete */)) = unixDelete // sqlite3.c:42099:5:
- *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 120 /* .xAccess */)) = unixAccess // sqlite3.c:42099:5:
- *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 124 /* .xFullPathname */)) = unixFullPathname // sqlite3.c:42099:5:
- *(*func(*libc.TLS, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 128 /* .xDlOpen */)) = unixDlOpen // sqlite3.c:42099:5:
- *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 132 /* .xDlError */)) = unixDlError // sqlite3.c:42099:5:
- *(*func(*libc.TLS, uintptr, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 136 /* .xDlSym */)) = unixDlSym // sqlite3.c:42099:5:
- *(*func(*libc.TLS, uintptr, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 140 /* .xDlClose */)) = unixDlClose // sqlite3.c:42099:5:
- *(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 144 /* .xRandomness */)) = unixRandomness // sqlite3.c:42099:5:
- *(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 148 /* .xSleep */)) = unixSleep // sqlite3.c:42099:5:
- *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 152 /* .xCurrentTime */)) = unixCurrentTime // sqlite3.c:42099:5:
- *(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 156 /* .xGetLastError */)) = unixGetLastError // sqlite3.c:42099:5:
- *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 160 /* .xCurrentTimeInt64 */)) = unixCurrentTimeInt64 // sqlite3.c:42099:5:
- *(*func(*libc.TLS, uintptr, uintptr, Sqlite3_syscall_ptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 164 /* .xSetSystemCall */)) = unixSetSystemCall // sqlite3.c:42099:5:
- *(*func(*libc.TLS, uintptr, uintptr) Sqlite3_syscall_ptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 168 /* .xGetSystemCall */)) = unixGetSystemCall // sqlite3.c:42099:5:
- *(*func(*libc.TLS, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 172 /* .xNextSystemCall */)) = unixNextSystemCall // sqlite3.c:42099:5:
- *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 196 /* .pAppData */)) = uintptr(unsafe.Pointer(&dotlockIoFinder)) // sqlite3.c:42100:5:
- *(*func(*libc.TLS, uintptr, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 200 /* .xOpen */)) = unixOpen // sqlite3.c:42100:5:
- *(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 204 /* .xDelete */)) = unixDelete // sqlite3.c:42100:5:
- *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 208 /* .xAccess */)) = unixAccess // sqlite3.c:42100:5:
- *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 212 /* .xFullPathname */)) = unixFullPathname // sqlite3.c:42100:5:
- *(*func(*libc.TLS, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 216 /* .xDlOpen */)) = unixDlOpen // sqlite3.c:42100:5:
- *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 220 /* .xDlError */)) = unixDlError // sqlite3.c:42100:5:
- *(*func(*libc.TLS, uintptr, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 224 /* .xDlSym */)) = unixDlSym // sqlite3.c:42100:5:
- *(*func(*libc.TLS, uintptr, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 228 /* .xDlClose */)) = unixDlClose // sqlite3.c:42100:5:
- *(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 232 /* .xRandomness */)) = unixRandomness // sqlite3.c:42100:5:
- *(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 236 /* .xSleep */)) = unixSleep // sqlite3.c:42100:5:
- *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 240 /* .xCurrentTime */)) = unixCurrentTime // sqlite3.c:42100:5:
- *(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 244 /* .xGetLastError */)) = unixGetLastError // sqlite3.c:42100:5:
- *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 248 /* .xCurrentTimeInt64 */)) = unixCurrentTimeInt64 // sqlite3.c:42100:5:
- *(*func(*libc.TLS, uintptr, uintptr, Sqlite3_syscall_ptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 252 /* .xSetSystemCall */)) = unixSetSystemCall // sqlite3.c:42100:5:
- *(*func(*libc.TLS, uintptr, uintptr) Sqlite3_syscall_ptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 256 /* .xGetSystemCall */)) = unixGetSystemCall // sqlite3.c:42100:5:
- *(*func(*libc.TLS, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 260 /* .xNextSystemCall */)) = unixNextSystemCall // sqlite3.c:42100:5:
- *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 284 /* .pAppData */)) = uintptr(unsafe.Pointer(&posixIoFinder)) // sqlite3.c:42101:5:
- *(*func(*libc.TLS, uintptr, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 288 /* .xOpen */)) = unixOpen // sqlite3.c:42101:5:
- *(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 292 /* .xDelete */)) = unixDelete // sqlite3.c:42101:5:
- *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 296 /* .xAccess */)) = unixAccess // sqlite3.c:42101:5:
- *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 300 /* .xFullPathname */)) = unixFullPathname // sqlite3.c:42101:5:
- *(*func(*libc.TLS, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 304 /* .xDlOpen */)) = unixDlOpen // sqlite3.c:42101:5:
- *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 308 /* .xDlError */)) = unixDlError // sqlite3.c:42101:5:
- *(*func(*libc.TLS, uintptr, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 312 /* .xDlSym */)) = unixDlSym // sqlite3.c:42101:5:
- *(*func(*libc.TLS, uintptr, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 316 /* .xDlClose */)) = unixDlClose // sqlite3.c:42101:5:
- *(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 320 /* .xRandomness */)) = unixRandomness // sqlite3.c:42101:5:
- *(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 324 /* .xSleep */)) = unixSleep // sqlite3.c:42101:5:
- *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 328 /* .xCurrentTime */)) = unixCurrentTime // sqlite3.c:42101:5:
- *(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 332 /* .xGetLastError */)) = unixGetLastError // sqlite3.c:42101:5:
- *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 336 /* .xCurrentTimeInt64 */)) = unixCurrentTimeInt64 // sqlite3.c:42101:5:
- *(*func(*libc.TLS, uintptr, uintptr, Sqlite3_syscall_ptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 340 /* .xSetSystemCall */)) = unixSetSystemCall // sqlite3.c:42101:5:
- *(*func(*libc.TLS, uintptr, uintptr) Sqlite3_syscall_ptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 344 /* .xGetSystemCall */)) = unixGetSystemCall // sqlite3.c:42101:5:
- *(*func(*libc.TLS, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 348 /* .xNextSystemCall */)) = unixNextSystemCall // sqlite3.c:42101:5:
- *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 16 /* .xSFunc */)) = row_numberStepFunc // sqlite3.c:155523:5:
- *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 20 /* .xFinalize */)) = row_numberValueFunc // sqlite3.c:155523:5:
- *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 24 /* .xValue */)) = row_numberValueFunc // sqlite3.c:155523:5:
- *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 28 /* .xInverse */)) = noopStepFunc // sqlite3.c:155523:5:
- *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 32 /* .zName */)) = uintptr(unsafe.Pointer(&row_numberName)) // sqlite3.c:155523:5:
- *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 56 /* .xSFunc */)) = dense_rankStepFunc // sqlite3.c:155524:5:
- *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 60 /* .xFinalize */)) = dense_rankValueFunc // sqlite3.c:155524:5:
- *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 64 /* .xValue */)) = dense_rankValueFunc // sqlite3.c:155524:5:
- *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 68 /* .xInverse */)) = noopStepFunc // sqlite3.c:155524:5:
- *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 72 /* .zName */)) = uintptr(unsafe.Pointer(&dense_rankName)) // sqlite3.c:155524:5:
- *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 96 /* .xSFunc */)) = rankStepFunc // sqlite3.c:155525:5:
- *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 100 /* .xFinalize */)) = rankValueFunc // sqlite3.c:155525:5:
- *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 104 /* .xValue */)) = rankValueFunc // sqlite3.c:155525:5:
- *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 108 /* .xInverse */)) = noopStepFunc // sqlite3.c:155525:5:
- *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 112 /* .zName */)) = uintptr(unsafe.Pointer(&rankName)) // sqlite3.c:155525:5:
- *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 136 /* .xSFunc */)) = percent_rankStepFunc // sqlite3.c:155526:5:
- *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 140 /* .xFinalize */)) = percent_rankValueFunc // sqlite3.c:155526:5:
- *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 144 /* .xValue */)) = percent_rankValueFunc // sqlite3.c:155526:5:
- *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 148 /* .xInverse */)) = percent_rankInvFunc // sqlite3.c:155526:5:
- *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 152 /* .zName */)) = uintptr(unsafe.Pointer(&percent_rankName)) // sqlite3.c:155526:5:
- *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 176 /* .xSFunc */)) = cume_distStepFunc // sqlite3.c:155527:5:
- *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 180 /* .xFinalize */)) = cume_distValueFunc // sqlite3.c:155527:5:
- *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 184 /* .xValue */)) = cume_distValueFunc // sqlite3.c:155527:5:
- *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 188 /* .xInverse */)) = cume_distInvFunc // sqlite3.c:155527:5:
- *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 192 /* .zName */)) = uintptr(unsafe.Pointer(&cume_distName)) // sqlite3.c:155527:5:
- *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 216 /* .xSFunc */)) = ntileStepFunc // sqlite3.c:155528:5:
- *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 220 /* .xFinalize */)) = ntileValueFunc // sqlite3.c:155528:5:
- *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 224 /* .xValue */)) = ntileValueFunc // sqlite3.c:155528:5:
- *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 228 /* .xInverse */)) = ntileInvFunc // sqlite3.c:155528:5:
- *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 232 /* .zName */)) = uintptr(unsafe.Pointer(&ntileName)) // sqlite3.c:155528:5:
- *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 256 /* .xSFunc */)) = last_valueStepFunc // sqlite3.c:155529:5:
- *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 260 /* .xFinalize */)) = last_valueFinalizeFunc // sqlite3.c:155529:5:
- *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 264 /* .xValue */)) = last_valueValueFunc // sqlite3.c:155529:5:
- *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 268 /* .xInverse */)) = last_valueInvFunc // sqlite3.c:155529:5:
- *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 272 /* .zName */)) = uintptr(unsafe.Pointer(&last_valueName)) // sqlite3.c:155529:5:
- *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 296 /* .xSFunc */)) = nth_valueStepFunc // sqlite3.c:155530:5:
- *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 300 /* .xFinalize */)) = nth_valueFinalizeFunc // sqlite3.c:155530:5:
- *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 304 /* .xValue */)) = noopValueFunc // sqlite3.c:155530:5:
- *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 308 /* .xInverse */)) = noopStepFunc // sqlite3.c:155530:5:
- *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 312 /* .zName */)) = uintptr(unsafe.Pointer(&nth_valueName)) // sqlite3.c:155530:5:
- *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 336 /* .xSFunc */)) = first_valueStepFunc // sqlite3.c:155531:5:
- *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 340 /* .xFinalize */)) = first_valueFinalizeFunc // sqlite3.c:155531:5:
- *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 344 /* .xValue */)) = noopValueFunc // sqlite3.c:155531:5:
- *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 348 /* .xInverse */)) = noopStepFunc // sqlite3.c:155531:5:
- *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 352 /* .zName */)) = uintptr(unsafe.Pointer(&first_valueName)) // sqlite3.c:155531:5:
- *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 376 /* .xSFunc */)) = noopStepFunc // sqlite3.c:155532:5:
- *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 380 /* .xFinalize */)) = noopValueFunc // sqlite3.c:155532:5:
- *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 384 /* .xValue */)) = noopValueFunc // sqlite3.c:155532:5:
- *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 388 /* .xInverse */)) = noopStepFunc // sqlite3.c:155532:5:
- *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 392 /* .zName */)) = uintptr(unsafe.Pointer(&leadName)) // sqlite3.c:155532:5:
- *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 416 /* .xSFunc */)) = noopStepFunc // sqlite3.c:155533:5:
- *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 420 /* .xFinalize */)) = noopValueFunc // sqlite3.c:155533:5:
- *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 424 /* .xValue */)) = noopValueFunc // sqlite3.c:155533:5:
- *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 428 /* .xInverse */)) = noopStepFunc // sqlite3.c:155533:5:
- *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 432 /* .zName */)) = uintptr(unsafe.Pointer(&leadName)) // sqlite3.c:155533:5:
- *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 456 /* .xSFunc */)) = noopStepFunc // sqlite3.c:155534:5:
- *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 460 /* .xFinalize */)) = noopValueFunc // sqlite3.c:155534:5:
- *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 464 /* .xValue */)) = noopValueFunc // sqlite3.c:155534:5:
- *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 468 /* .xInverse */)) = noopStepFunc // sqlite3.c:155534:5:
- *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 472 /* .zName */)) = uintptr(unsafe.Pointer(&leadName)) // sqlite3.c:155534:5:
- *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 496 /* .xSFunc */)) = noopStepFunc // sqlite3.c:155535:5:
- *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 500 /* .xFinalize */)) = noopValueFunc // sqlite3.c:155535:5:
- *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 504 /* .xValue */)) = noopValueFunc // sqlite3.c:155535:5:
- *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 508 /* .xInverse */)) = noopStepFunc // sqlite3.c:155535:5:
- *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 512 /* .zName */)) = uintptr(unsafe.Pointer(&lagName)) // sqlite3.c:155535:5:
- *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 536 /* .xSFunc */)) = noopStepFunc // sqlite3.c:155536:5:
- *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 540 /* .xFinalize */)) = noopValueFunc // sqlite3.c:155536:5:
- *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 544 /* .xValue */)) = noopValueFunc // sqlite3.c:155536:5:
- *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 548 /* .xInverse */)) = noopStepFunc // sqlite3.c:155536:5:
- *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 552 /* .zName */)) = uintptr(unsafe.Pointer(&lagName)) // sqlite3.c:155536:5:
- *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 576 /* .xSFunc */)) = noopStepFunc // sqlite3.c:155537:5:
- *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 580 /* .xFinalize */)) = noopValueFunc // sqlite3.c:155537:5:
- *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 584 /* .xValue */)) = noopValueFunc // sqlite3.c:155537:5:
- *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 588 /* .xInverse */)) = noopStepFunc // sqlite3.c:155537:5:
- *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 592 /* .zName */)) = uintptr(unsafe.Pointer(&lagName)) // sqlite3.c:155537:5:
- *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&attach_func)) + 16 /* .xSFunc */)) = attachFunc // sqlite3.c:111969:5:
- *(*func(*libc.TLS, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&defaultMethods)) + 0 /* .xMalloc */)) = sqlite3MemMalloc // sqlite3.c:24299:6:
- *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&defaultMethods)) + 4 /* .xFree */)) = sqlite3MemFree // sqlite3.c:24300:6:
- *(*func(*libc.TLS, uintptr, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&defaultMethods)) + 8 /* .xRealloc */)) = sqlite3MemRealloc // sqlite3.c:24301:6:
- *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&defaultMethods)) + 12 /* .xSize */)) = sqlite3MemSize // sqlite3.c:24302:6:
- *(*func(*libc.TLS, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&defaultMethods)) + 16 /* .xRoundup */)) = sqlite3MemRoundup // sqlite3.c:24303:6:
- *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&defaultMethods)) + 20 /* .xInit */)) = sqlite3MemInit // sqlite3.c:24304:6:
- *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&defaultMethods)) + 24 /* .xShutdown */)) = sqlite3MemShutdown // sqlite3.c:24305:6:
- *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&defaultMethods1)) + 8 /* .xInit */)) = pcache1Init // sqlite3.c:51891:5:
- *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&defaultMethods1)) + 12 /* .xShutdown */)) = pcache1Shutdown // sqlite3.c:51892:5:
- *(*func(*libc.TLS, int32, int32, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&defaultMethods1)) + 16 /* .xCreate */)) = pcache1Create // sqlite3.c:51893:5:
- *(*func(*libc.TLS, uintptr, int32))(unsafe.Pointer(uintptr(unsafe.Pointer(&defaultMethods1)) + 20 /* .xCachesize */)) = pcache1Cachesize // sqlite3.c:51894:5:
- *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&defaultMethods1)) + 24 /* .xPagecount */)) = pcache1Pagecount // sqlite3.c:51895:5:
- *(*func(*libc.TLS, uintptr, uint32, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&defaultMethods1)) + 28 /* .xFetch */)) = pcache1Fetch // sqlite3.c:51896:5:
- *(*func(*libc.TLS, uintptr, uintptr, int32))(unsafe.Pointer(uintptr(unsafe.Pointer(&defaultMethods1)) + 32 /* .xUnpin */)) = pcache1Unpin // sqlite3.c:51897:5:
- *(*func(*libc.TLS, uintptr, uintptr, uint32, uint32))(unsafe.Pointer(uintptr(unsafe.Pointer(&defaultMethods1)) + 36 /* .xRekey */)) = pcache1Rekey // sqlite3.c:51898:5:
- *(*func(*libc.TLS, uintptr, uint32))(unsafe.Pointer(uintptr(unsafe.Pointer(&defaultMethods1)) + 40 /* .xTruncate */)) = pcache1Truncate // sqlite3.c:51899:5:
- *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&defaultMethods1)) + 44 /* .xDestroy */)) = pcache1Destroy // sqlite3.c:51900:5:
- *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&defaultMethods1)) + 48 /* .xShrink */)) = pcache1Shrink // sqlite3.c:51901:5:
- *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&detach_func)) + 16 /* .xSFunc */)) = detachFunc // sqlite3.c:111949:5:
- *(*func(*libc.TLS, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&dotlockIoFinder)) + 0)) = dotlockIoFinderImpl // sqlite3.c:39472:1:
- *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&dotlockIoMethods)) + 4 /* .xClose */)) = dotlockClose // sqlite3.c:39472:1:
- *(*func(*libc.TLS, uintptr, uintptr, int32, Sqlite3_int64) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&dotlockIoMethods)) + 8 /* .xRead */)) = unixRead // sqlite3.c:39472:1:
- *(*func(*libc.TLS, uintptr, uintptr, int32, Sqlite3_int64) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&dotlockIoMethods)) + 12 /* .xWrite */)) = unixWrite // sqlite3.c:39472:1:
- *(*func(*libc.TLS, uintptr, I64) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&dotlockIoMethods)) + 16 /* .xTruncate */)) = unixTruncate // sqlite3.c:39472:1:
- *(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&dotlockIoMethods)) + 20 /* .xSync */)) = unixSync // sqlite3.c:39472:1:
- *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&dotlockIoMethods)) + 24 /* .xFileSize */)) = unixFileSize // sqlite3.c:39472:1:
- *(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&dotlockIoMethods)) + 28 /* .xLock */)) = dotlockLock // sqlite3.c:39472:1:
- *(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&dotlockIoMethods)) + 32 /* .xUnlock */)) = dotlockUnlock // sqlite3.c:39472:1:
- *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&dotlockIoMethods)) + 36 /* .xCheckReservedLock */)) = dotlockCheckReservedLock // sqlite3.c:39472:1:
- *(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&dotlockIoMethods)) + 40 /* .xFileControl */)) = unixFileControl // sqlite3.c:39472:1:
- *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&dotlockIoMethods)) + 44 /* .xSectorSize */)) = unixSectorSize // sqlite3.c:39472:1:
- *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&dotlockIoMethods)) + 48 /* .xDeviceCharacteristics */)) = unixDeviceCharacteristics // sqlite3.c:39472:1:
- *(*func(*libc.TLS, uintptr, int32, int32, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&dotlockIoMethods)) + 56 /* .xShmLock */)) = unixShmLock // sqlite3.c:39472:1:
- *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&dotlockIoMethods)) + 60 /* .xShmBarrier */)) = unixShmBarrier // sqlite3.c:39472:1:
- *(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&dotlockIoMethods)) + 64 /* .xShmUnmap */)) = unixShmUnmap // sqlite3.c:39472:1:
- *(*func(*libc.TLS, uintptr, I64, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&dotlockIoMethods)) + 68 /* .xFetch */)) = unixFetch // sqlite3.c:39472:1:
- *(*func(*libc.TLS, uintptr, I64, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&dotlockIoMethods)) + 72 /* .xUnfetch */)) = unixUnfetch // sqlite3.c:39472:1:
- *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fts5Mod)) + 4 /* .xCreate */)) = fts5CreateMethod // sqlite3.c:230606:25:
- *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fts5Mod)) + 8 /* .xConnect */)) = fts5ConnectMethod // sqlite3.c:230607:25:
- *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fts5Mod)) + 12 /* .xBestIndex */)) = fts5BestIndexMethod // sqlite3.c:230608:25:
- *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fts5Mod)) + 16 /* .xDisconnect */)) = fts5DisconnectMethod // sqlite3.c:230609:25:
- *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fts5Mod)) + 20 /* .xDestroy */)) = fts5DestroyMethod // sqlite3.c:230610:25:
- *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fts5Mod)) + 24 /* .xOpen */)) = fts5OpenMethod // sqlite3.c:230611:25:
- *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fts5Mod)) + 28 /* .xClose */)) = fts5CloseMethod // sqlite3.c:230612:25:
- *(*func(*libc.TLS, uintptr, int32, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fts5Mod)) + 32 /* .xFilter */)) = fts5FilterMethod // sqlite3.c:230613:25:
- *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fts5Mod)) + 36 /* .xNext */)) = fts5NextMethod // sqlite3.c:230614:25:
- *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fts5Mod)) + 40 /* .xEof */)) = fts5EofMethod // sqlite3.c:230615:25:
- *(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fts5Mod)) + 44 /* .xColumn */)) = fts5ColumnMethod // sqlite3.c:230616:25:
- *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fts5Mod)) + 48 /* .xRowid */)) = fts5RowidMethod // sqlite3.c:230617:25:
- *(*func(*libc.TLS, uintptr, int32, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fts5Mod)) + 52 /* .xUpdate */)) = fts5UpdateMethod // sqlite3.c:230618:25:
- *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fts5Mod)) + 56 /* .xBegin */)) = fts5BeginMethod // sqlite3.c:230619:25:
- *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fts5Mod)) + 60 /* .xSync */)) = fts5SyncMethod // sqlite3.c:230620:25:
- *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fts5Mod)) + 64 /* .xCommit */)) = fts5CommitMethod // sqlite3.c:230621:25:
- *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fts5Mod)) + 68 /* .xRollback */)) = fts5RollbackMethod // sqlite3.c:230622:25:
- *(*func(*libc.TLS, uintptr, int32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fts5Mod)) + 72 /* .xFindFunction */)) = fts5FindFunctionMethod // sqlite3.c:230623:25:
- *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fts5Mod)) + 76 /* .xRename */)) = fts5RenameMethod // sqlite3.c:230624:25:
- *(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fts5Mod)) + 80 /* .xSavepoint */)) = fts5SavepointMethod // sqlite3.c:230625:25:
- *(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fts5Mod)) + 84 /* .xRelease */)) = fts5ReleaseMethod // sqlite3.c:230626:25:
- *(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fts5Mod)) + 88 /* .xRollbackTo */)) = fts5RollbackToMethod // sqlite3.c:230627:25:
- *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fts5Mod)) + 92 /* .xShadowName */)) = fts5ShadowName // sqlite3.c:230628:25:
- *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fts5Vocab)) + 4 /* .xCreate */)) = fts5VocabCreateMethod // sqlite3.c:235174:25:
- *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fts5Vocab)) + 8 /* .xConnect */)) = fts5VocabConnectMethod // sqlite3.c:235175:25:
- *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fts5Vocab)) + 12 /* .xBestIndex */)) = fts5VocabBestIndexMethod // sqlite3.c:235176:25:
- *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fts5Vocab)) + 16 /* .xDisconnect */)) = fts5VocabDisconnectMethod // sqlite3.c:235177:25:
- *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fts5Vocab)) + 20 /* .xDestroy */)) = fts5VocabDestroyMethod // sqlite3.c:235178:25:
- *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fts5Vocab)) + 24 /* .xOpen */)) = fts5VocabOpenMethod // sqlite3.c:235179:25:
- *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fts5Vocab)) + 28 /* .xClose */)) = fts5VocabCloseMethod // sqlite3.c:235180:25:
- *(*func(*libc.TLS, uintptr, int32, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fts5Vocab)) + 32 /* .xFilter */)) = fts5VocabFilterMethod // sqlite3.c:235181:25:
- *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fts5Vocab)) + 36 /* .xNext */)) = fts5VocabNextMethod // sqlite3.c:235182:25:
- *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fts5Vocab)) + 40 /* .xEof */)) = fts5VocabEofMethod // sqlite3.c:235183:25:
- *(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fts5Vocab)) + 44 /* .xColumn */)) = fts5VocabColumnMethod // sqlite3.c:235184:25:
- *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fts5Vocab)) + 48 /* .xRowid */)) = fts5VocabRowidMethod // sqlite3.c:235185:25:
- *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&geopolyModule)) + 4 /* .xCreate */)) = geopolyCreate // sqlite3.c:198384:3:
- *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&geopolyModule)) + 8 /* .xConnect */)) = geopolyConnect // sqlite3.c:198385:3:
- *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&geopolyModule)) + 12 /* .xBestIndex */)) = geopolyBestIndex // sqlite3.c:198386:3:
- *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&geopolyModule)) + 16 /* .xDisconnect */)) = rtreeDisconnect // sqlite3.c:198387:3:
- *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&geopolyModule)) + 20 /* .xDestroy */)) = rtreeDestroy // sqlite3.c:198388:3:
- *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&geopolyModule)) + 24 /* .xOpen */)) = rtreeOpen // sqlite3.c:198389:3:
- *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&geopolyModule)) + 28 /* .xClose */)) = rtreeClose // sqlite3.c:198390:3:
- *(*func(*libc.TLS, uintptr, int32, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&geopolyModule)) + 32 /* .xFilter */)) = geopolyFilter // sqlite3.c:198391:3:
- *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&geopolyModule)) + 36 /* .xNext */)) = rtreeNext // sqlite3.c:198392:3:
- *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&geopolyModule)) + 40 /* .xEof */)) = rtreeEof // sqlite3.c:198393:3:
- *(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&geopolyModule)) + 44 /* .xColumn */)) = geopolyColumn // sqlite3.c:198394:3:
- *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&geopolyModule)) + 48 /* .xRowid */)) = rtreeRowid // sqlite3.c:198395:3:
- *(*func(*libc.TLS, uintptr, int32, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&geopolyModule)) + 52 /* .xUpdate */)) = geopolyUpdate // sqlite3.c:198396:3:
- *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&geopolyModule)) + 56 /* .xBegin */)) = rtreeBeginTransaction // sqlite3.c:198397:3:
- *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&geopolyModule)) + 60 /* .xSync */)) = rtreeEndTransaction // sqlite3.c:198398:3:
- *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&geopolyModule)) + 64 /* .xCommit */)) = rtreeEndTransaction // sqlite3.c:198399:3:
- *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&geopolyModule)) + 68 /* .xRollback */)) = rtreeEndTransaction // sqlite3.c:198400:3:
- *(*func(*libc.TLS, uintptr, int32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&geopolyModule)) + 72 /* .xFindFunction */)) = geopolyFindFunction // sqlite3.c:198401:3:
- *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&geopolyModule)) + 76 /* .xRename */)) = rtreeRename // sqlite3.c:198402:3:
- *(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&geopolyModule)) + 80 /* .xSavepoint */)) = rtreeSavepoint // sqlite3.c:198403:3:
- *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&geopolyModule)) + 92 /* .xShadowName */)) = rtreeShadowName // sqlite3.c:198406:3:
- *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&jsonEachModule)) + 8 /* .xConnect */)) = jsonEachConnect // sqlite3.c:192115:3:
- *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&jsonEachModule)) + 12 /* .xBestIndex */)) = jsonEachBestIndex // sqlite3.c:192116:3:
- *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&jsonEachModule)) + 16 /* .xDisconnect */)) = jsonEachDisconnect // sqlite3.c:192117:3:
- *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&jsonEachModule)) + 24 /* .xOpen */)) = jsonEachOpenEach // sqlite3.c:192119:3:
- *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&jsonEachModule)) + 28 /* .xClose */)) = jsonEachClose // sqlite3.c:192120:3:
- *(*func(*libc.TLS, uintptr, int32, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&jsonEachModule)) + 32 /* .xFilter */)) = jsonEachFilter // sqlite3.c:192121:3:
- *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&jsonEachModule)) + 36 /* .xNext */)) = jsonEachNext // sqlite3.c:192122:3:
- *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&jsonEachModule)) + 40 /* .xEof */)) = jsonEachEof // sqlite3.c:192123:3:
- *(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&jsonEachModule)) + 44 /* .xColumn */)) = jsonEachColumn // sqlite3.c:192124:3:
- *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&jsonEachModule)) + 48 /* .xRowid */)) = jsonEachRowid // sqlite3.c:192125:3:
- *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&jsonTreeModule)) + 8 /* .xConnect */)) = jsonEachConnect // sqlite3.c:192143:3:
- *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&jsonTreeModule)) + 12 /* .xBestIndex */)) = jsonEachBestIndex // sqlite3.c:192144:3:
- *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&jsonTreeModule)) + 16 /* .xDisconnect */)) = jsonEachDisconnect // sqlite3.c:192145:3:
- *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&jsonTreeModule)) + 24 /* .xOpen */)) = jsonEachOpenTree // sqlite3.c:192147:3:
- *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&jsonTreeModule)) + 28 /* .xClose */)) = jsonEachClose // sqlite3.c:192148:3:
- *(*func(*libc.TLS, uintptr, int32, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&jsonTreeModule)) + 32 /* .xFilter */)) = jsonEachFilter // sqlite3.c:192149:3:
- *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&jsonTreeModule)) + 36 /* .xNext */)) = jsonEachNext // sqlite3.c:192150:3:
- *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&jsonTreeModule)) + 40 /* .xEof */)) = jsonEachEof // sqlite3.c:192151:3:
- *(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&jsonTreeModule)) + 44 /* .xColumn */)) = jsonEachColumn // sqlite3.c:192152:3:
- *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&jsonTreeModule)) + 48 /* .xRowid */)) = jsonEachRowid // sqlite3.c:192153:3:
- *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&memdb_io_methods)) + 4 /* .xClose */)) = memdbClose // sqlite3.c:48683:3:
- *(*func(*libc.TLS, uintptr, uintptr, int32, Sqlite3_int64) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&memdb_io_methods)) + 8 /* .xRead */)) = memdbRead // sqlite3.c:48684:3:
- *(*func(*libc.TLS, uintptr, uintptr, int32, Sqlite3_int64) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&memdb_io_methods)) + 12 /* .xWrite */)) = memdbWrite // sqlite3.c:48685:3:
- *(*func(*libc.TLS, uintptr, Sqlite3_int64) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&memdb_io_methods)) + 16 /* .xTruncate */)) = memdbTruncate // sqlite3.c:48686:3:
- *(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&memdb_io_methods)) + 20 /* .xSync */)) = memdbSync // sqlite3.c:48687:3:
- *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&memdb_io_methods)) + 24 /* .xFileSize */)) = memdbFileSize // sqlite3.c:48688:3:
- *(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&memdb_io_methods)) + 28 /* .xLock */)) = memdbLock // sqlite3.c:48689:3:
- *(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&memdb_io_methods)) + 32 /* .xUnlock */)) = memdbLock // sqlite3.c:48690:3:
- *(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&memdb_io_methods)) + 40 /* .xFileControl */)) = memdbFileControl // sqlite3.c:48692:3:
- *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&memdb_io_methods)) + 48 /* .xDeviceCharacteristics */)) = memdbDeviceCharacteristics // sqlite3.c:48694:3:
- *(*func(*libc.TLS, uintptr, Sqlite3_int64, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&memdb_io_methods)) + 68 /* .xFetch */)) = memdbFetch // sqlite3.c:48699:3:
- *(*func(*libc.TLS, uintptr, Sqlite3_int64, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&memdb_io_methods)) + 72 /* .xUnfetch */)) = memdbUnfetch // sqlite3.c:48700:3:
- *(*func(*libc.TLS, uintptr, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&memdb_vfs)) + 24 /* .xOpen */)) = memdbOpen // sqlite3.c:48663:3:
- *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&memdb_vfs)) + 32 /* .xAccess */)) = memdbAccess // sqlite3.c:48665:3:
- *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&memdb_vfs)) + 36 /* .xFullPathname */)) = memdbFullPathname // sqlite3.c:48666:3:
- *(*func(*libc.TLS, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&memdb_vfs)) + 40 /* .xDlOpen */)) = memdbDlOpen // sqlite3.c:48667:3:
- *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&memdb_vfs)) + 44 /* .xDlError */)) = memdbDlError // sqlite3.c:48668:3:
- *(*func(*libc.TLS, uintptr, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&memdb_vfs)) + 48 /* .xDlSym */)) = memdbDlSym // sqlite3.c:48669:3:
- *(*func(*libc.TLS, uintptr, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&memdb_vfs)) + 52 /* .xDlClose */)) = memdbDlClose // sqlite3.c:48670:3:
- *(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&memdb_vfs)) + 56 /* .xRandomness */)) = memdbRandomness // sqlite3.c:48671:3:
- *(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&memdb_vfs)) + 60 /* .xSleep */)) = memdbSleep // sqlite3.c:48672:3:
- *(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&memdb_vfs)) + 68 /* .xGetLastError */)) = memdbGetLastError // sqlite3.c:48674:3:
- *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&memdb_vfs)) + 72 /* .xCurrentTimeInt64 */)) = memdbCurrentTimeInt64 // sqlite3.c:48675:3:
- *(*func(*libc.TLS, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&nolockIoFinder)) + 0)) = nolockIoFinderImpl // sqlite3.c:39462:1:
- *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&nolockIoMethods)) + 4 /* .xClose */)) = nolockClose // sqlite3.c:39462:1:
- *(*func(*libc.TLS, uintptr, uintptr, int32, Sqlite3_int64) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&nolockIoMethods)) + 8 /* .xRead */)) = unixRead // sqlite3.c:39462:1:
- *(*func(*libc.TLS, uintptr, uintptr, int32, Sqlite3_int64) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&nolockIoMethods)) + 12 /* .xWrite */)) = unixWrite // sqlite3.c:39462:1:
- *(*func(*libc.TLS, uintptr, I64) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&nolockIoMethods)) + 16 /* .xTruncate */)) = unixTruncate // sqlite3.c:39462:1:
- *(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&nolockIoMethods)) + 20 /* .xSync */)) = unixSync // sqlite3.c:39462:1:
- *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&nolockIoMethods)) + 24 /* .xFileSize */)) = unixFileSize // sqlite3.c:39462:1:
- *(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&nolockIoMethods)) + 28 /* .xLock */)) = nolockLock // sqlite3.c:39462:1:
- *(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&nolockIoMethods)) + 32 /* .xUnlock */)) = nolockUnlock // sqlite3.c:39462:1:
- *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&nolockIoMethods)) + 36 /* .xCheckReservedLock */)) = nolockCheckReservedLock // sqlite3.c:39462:1:
- *(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&nolockIoMethods)) + 40 /* .xFileControl */)) = unixFileControl // sqlite3.c:39462:1:
- *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&nolockIoMethods)) + 44 /* .xSectorSize */)) = unixSectorSize // sqlite3.c:39462:1:
- *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&nolockIoMethods)) + 48 /* .xDeviceCharacteristics */)) = unixDeviceCharacteristics // sqlite3.c:39462:1:
- *(*func(*libc.TLS, uintptr, int32, int32, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&nolockIoMethods)) + 56 /* .xShmLock */)) = unixShmLock // sqlite3.c:39462:1:
- *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&nolockIoMethods)) + 60 /* .xShmBarrier */)) = unixShmBarrier // sqlite3.c:39462:1:
- *(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&nolockIoMethods)) + 64 /* .xShmUnmap */)) = unixShmUnmap // sqlite3.c:39462:1:
- *(*func(*libc.TLS, uintptr, I64, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&nolockIoMethods)) + 68 /* .xFetch */)) = unixFetch // sqlite3.c:39462:1:
- *(*func(*libc.TLS, uintptr, I64, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&nolockIoMethods)) + 72 /* .xUnfetch */)) = unixUnfetch // sqlite3.c:39462:1:
- *(*func(*libc.TLS, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&posixIoFinder)) + 0)) = posixIoFinderImpl // sqlite3.c:39452:1:
- *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&posixIoMethods)) + 4 /* .xClose */)) = unixClose // sqlite3.c:39452:1:
- *(*func(*libc.TLS, uintptr, uintptr, int32, Sqlite3_int64) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&posixIoMethods)) + 8 /* .xRead */)) = unixRead // sqlite3.c:39452:1:
- *(*func(*libc.TLS, uintptr, uintptr, int32, Sqlite3_int64) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&posixIoMethods)) + 12 /* .xWrite */)) = unixWrite // sqlite3.c:39452:1:
- *(*func(*libc.TLS, uintptr, I64) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&posixIoMethods)) + 16 /* .xTruncate */)) = unixTruncate // sqlite3.c:39452:1:
- *(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&posixIoMethods)) + 20 /* .xSync */)) = unixSync // sqlite3.c:39452:1:
- *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&posixIoMethods)) + 24 /* .xFileSize */)) = unixFileSize // sqlite3.c:39452:1:
- *(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&posixIoMethods)) + 28 /* .xLock */)) = unixLock // sqlite3.c:39452:1:
- *(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&posixIoMethods)) + 32 /* .xUnlock */)) = unixUnlock // sqlite3.c:39452:1:
- *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&posixIoMethods)) + 36 /* .xCheckReservedLock */)) = unixCheckReservedLock // sqlite3.c:39452:1:
- *(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&posixIoMethods)) + 40 /* .xFileControl */)) = unixFileControl // sqlite3.c:39452:1:
- *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&posixIoMethods)) + 44 /* .xSectorSize */)) = unixSectorSize // sqlite3.c:39452:1:
- *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&posixIoMethods)) + 48 /* .xDeviceCharacteristics */)) = unixDeviceCharacteristics // sqlite3.c:39452:1:
- *(*func(*libc.TLS, uintptr, int32, int32, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&posixIoMethods)) + 52 /* .xShmMap */)) = unixShmMap // sqlite3.c:39452:1:
- *(*func(*libc.TLS, uintptr, int32, int32, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&posixIoMethods)) + 56 /* .xShmLock */)) = unixShmLock // sqlite3.c:39452:1:
- *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&posixIoMethods)) + 60 /* .xShmBarrier */)) = unixShmBarrier // sqlite3.c:39452:1:
- *(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&posixIoMethods)) + 64 /* .xShmUnmap */)) = unixShmUnmap // sqlite3.c:39452:1:
- *(*func(*libc.TLS, uintptr, I64, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&posixIoMethods)) + 68 /* .xFetch */)) = unixFetch // sqlite3.c:39452:1:
- *(*func(*libc.TLS, uintptr, I64, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&posixIoMethods)) + 72 /* .xUnfetch */)) = unixUnfetch // sqlite3.c:39452:1:
- *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&pragmaVtabModule)) + 8 /* .xConnect */)) = pragmaVtabConnect // sqlite3.c:131005:3:
- *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&pragmaVtabModule)) + 12 /* .xBestIndex */)) = pragmaVtabBestIndex // sqlite3.c:131006:3:
- *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&pragmaVtabModule)) + 16 /* .xDisconnect */)) = pragmaVtabDisconnect // sqlite3.c:131007:3:
- *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&pragmaVtabModule)) + 24 /* .xOpen */)) = pragmaVtabOpen // sqlite3.c:131009:3:
- *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&pragmaVtabModule)) + 28 /* .xClose */)) = pragmaVtabClose // sqlite3.c:131010:3:
- *(*func(*libc.TLS, uintptr, int32, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&pragmaVtabModule)) + 32 /* .xFilter */)) = pragmaVtabFilter // sqlite3.c:131011:3:
- *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&pragmaVtabModule)) + 36 /* .xNext */)) = pragmaVtabNext // sqlite3.c:131012:3:
- *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&pragmaVtabModule)) + 40 /* .xEof */)) = pragmaVtabEof // sqlite3.c:131013:3:
- *(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&pragmaVtabModule)) + 44 /* .xColumn */)) = pragmaVtabColumn // sqlite3.c:131014:3:
- *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&pragmaVtabModule)) + 48 /* .xRowid */)) = pragmaVtabRowid // sqlite3.c:131015:3:
- *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&rbuvfs_io_methods)) + 4 /* .xClose */)) = rbuVfsClose // sqlite3.c:205026:5:
- *(*func(*libc.TLS, uintptr, uintptr, int32, Sqlite_int64) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&rbuvfs_io_methods)) + 8 /* .xRead */)) = rbuVfsRead // sqlite3.c:205027:5:
- *(*func(*libc.TLS, uintptr, uintptr, int32, Sqlite_int64) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&rbuvfs_io_methods)) + 12 /* .xWrite */)) = rbuVfsWrite // sqlite3.c:205028:5:
- *(*func(*libc.TLS, uintptr, Sqlite_int64) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&rbuvfs_io_methods)) + 16 /* .xTruncate */)) = rbuVfsTruncate // sqlite3.c:205029:5:
- *(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&rbuvfs_io_methods)) + 20 /* .xSync */)) = rbuVfsSync // sqlite3.c:205030:5:
- *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&rbuvfs_io_methods)) + 24 /* .xFileSize */)) = rbuVfsFileSize // sqlite3.c:205031:5:
- *(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&rbuvfs_io_methods)) + 28 /* .xLock */)) = rbuVfsLock // sqlite3.c:205032:5:
- *(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&rbuvfs_io_methods)) + 32 /* .xUnlock */)) = rbuVfsUnlock // sqlite3.c:205033:5:
- *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&rbuvfs_io_methods)) + 36 /* .xCheckReservedLock */)) = rbuVfsCheckReservedLock // sqlite3.c:205034:5:
- *(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&rbuvfs_io_methods)) + 40 /* .xFileControl */)) = rbuVfsFileControl // sqlite3.c:205035:5:
- *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&rbuvfs_io_methods)) + 44 /* .xSectorSize */)) = rbuVfsSectorSize // sqlite3.c:205036:5:
- *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&rbuvfs_io_methods)) + 48 /* .xDeviceCharacteristics */)) = rbuVfsDeviceCharacteristics // sqlite3.c:205037:5:
- *(*func(*libc.TLS, uintptr, int32, int32, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&rbuvfs_io_methods)) + 52 /* .xShmMap */)) = rbuVfsShmMap // sqlite3.c:205038:5:
- *(*func(*libc.TLS, uintptr, int32, int32, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&rbuvfs_io_methods)) + 56 /* .xShmLock */)) = rbuVfsShmLock // sqlite3.c:205039:5:
- *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&rbuvfs_io_methods)) + 60 /* .xShmBarrier */)) = rbuVfsShmBarrier // sqlite3.c:205040:5:
- *(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&rbuvfs_io_methods)) + 64 /* .xShmUnmap */)) = rbuVfsShmUnmap // sqlite3.c:205041:5:
- *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&rtreeModule)) + 4 /* .xCreate */)) = rtreeCreate // sqlite3.c:195728:3:
- *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&rtreeModule)) + 8 /* .xConnect */)) = rtreeConnect // sqlite3.c:195729:3:
- *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&rtreeModule)) + 12 /* .xBestIndex */)) = rtreeBestIndex // sqlite3.c:195730:3:
- *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&rtreeModule)) + 16 /* .xDisconnect */)) = rtreeDisconnect // sqlite3.c:195731:3:
- *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&rtreeModule)) + 20 /* .xDestroy */)) = rtreeDestroy // sqlite3.c:195732:3:
- *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&rtreeModule)) + 24 /* .xOpen */)) = rtreeOpen // sqlite3.c:195733:3:
- *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&rtreeModule)) + 28 /* .xClose */)) = rtreeClose // sqlite3.c:195734:3:
- *(*func(*libc.TLS, uintptr, int32, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&rtreeModule)) + 32 /* .xFilter */)) = rtreeFilter // sqlite3.c:195735:3:
- *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&rtreeModule)) + 36 /* .xNext */)) = rtreeNext // sqlite3.c:195736:3:
- *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&rtreeModule)) + 40 /* .xEof */)) = rtreeEof // sqlite3.c:195737:3:
- *(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&rtreeModule)) + 44 /* .xColumn */)) = rtreeColumn // sqlite3.c:195738:3:
- *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&rtreeModule)) + 48 /* .xRowid */)) = rtreeRowid // sqlite3.c:195739:3:
- *(*func(*libc.TLS, uintptr, int32, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&rtreeModule)) + 52 /* .xUpdate */)) = rtreeUpdate // sqlite3.c:195740:3:
- *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&rtreeModule)) + 56 /* .xBegin */)) = rtreeBeginTransaction // sqlite3.c:195741:3:
- *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&rtreeModule)) + 60 /* .xSync */)) = rtreeEndTransaction // sqlite3.c:195742:3:
- *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&rtreeModule)) + 64 /* .xCommit */)) = rtreeEndTransaction // sqlite3.c:195743:3:
- *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&rtreeModule)) + 68 /* .xRollback */)) = rtreeEndTransaction // sqlite3.c:195744:3:
- *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&rtreeModule)) + 76 /* .xRename */)) = rtreeRename // sqlite3.c:195746:3:
- *(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&rtreeModule)) + 80 /* .xSavepoint */)) = rtreeSavepoint // sqlite3.c:195747:3:
- *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&rtreeModule)) + 92 /* .xShadowName */)) = rtreeShadowName // sqlite3.c:195750:3:
- *(*func(*libc.TLS, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sFts5Api)) + 4 /* .xUserData */)) = fts5ApiUserData // sqlite3.c:230065:3:
- *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sFts5Api)) + 8 /* .xColumnCount */)) = fts5ApiColumnCount // sqlite3.c:230066:3:
- *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sFts5Api)) + 12 /* .xRowCount */)) = fts5ApiRowCount // sqlite3.c:230067:3:
- *(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sFts5Api)) + 16 /* .xColumnTotalSize */)) = fts5ApiColumnTotalSize // sqlite3.c:230068:3:
- *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sFts5Api)) + 20 /* .xTokenize */)) = fts5ApiTokenize // sqlite3.c:230069:3:
- *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sFts5Api)) + 24 /* .xPhraseCount */)) = fts5ApiPhraseCount // sqlite3.c:230070:3:
- *(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sFts5Api)) + 28 /* .xPhraseSize */)) = fts5ApiPhraseSize // sqlite3.c:230071:3:
- *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sFts5Api)) + 32 /* .xInstCount */)) = fts5ApiInstCount // sqlite3.c:230072:3:
- *(*func(*libc.TLS, uintptr, int32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sFts5Api)) + 36 /* .xInst */)) = fts5ApiInst // sqlite3.c:230073:3:
- *(*func(*libc.TLS, uintptr) Sqlite3_int64)(unsafe.Pointer(uintptr(unsafe.Pointer(&sFts5Api)) + 40 /* .xRowid */)) = fts5ApiRowid // sqlite3.c:230074:3:
- *(*func(*libc.TLS, uintptr, int32, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sFts5Api)) + 44 /* .xColumnText */)) = fts5ApiColumnText // sqlite3.c:230075:3:
- *(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sFts5Api)) + 48 /* .xColumnSize */)) = fts5ApiColumnSize // sqlite3.c:230076:3:
- *(*func(*libc.TLS, uintptr, int32, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sFts5Api)) + 52 /* .xQueryPhrase */)) = fts5ApiQueryPhrase // sqlite3.c:230077:3:
- *(*func(*libc.TLS, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sFts5Api)) + 56 /* .xSetAuxdata */)) = fts5ApiSetAuxdata // sqlite3.c:230078:3:
- *(*func(*libc.TLS, uintptr, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sFts5Api)) + 60 /* .xGetAuxdata */)) = fts5ApiGetAuxdata // sqlite3.c:230079:3:
- *(*func(*libc.TLS, uintptr, int32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sFts5Api)) + 64 /* .xPhraseFirst */)) = fts5ApiPhraseFirst // sqlite3.c:230080:3:
- *(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&sFts5Api)) + 68 /* .xPhraseNext */)) = fts5ApiPhraseNext // sqlite3.c:230081:3:
- *(*func(*libc.TLS, uintptr, int32, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sFts5Api)) + 72 /* .xPhraseFirstColumn */)) = fts5ApiPhraseFirstColumn // sqlite3.c:230082:3:
- *(*func(*libc.TLS, uintptr, uintptr, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&sFts5Api)) + 76 /* .xPhraseNextColumn */)) = fts5ApiPhraseNextColumn // sqlite3.c:230083:3:
- *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sMemJournalMethods)) + 4 /* .xClose */)) = memjrnlClose // sqlite3.c:98830:3:
- *(*func(*libc.TLS, uintptr, uintptr, int32, Sqlite_int64) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sMemJournalMethods)) + 8 /* .xRead */)) = memjrnlRead // sqlite3.c:98831:3:
- *(*func(*libc.TLS, uintptr, uintptr, int32, Sqlite_int64) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sMemJournalMethods)) + 12 /* .xWrite */)) = memjrnlWrite // sqlite3.c:98832:3:
- *(*func(*libc.TLS, uintptr, Sqlite_int64) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sMemJournalMethods)) + 16 /* .xTruncate */)) = memjrnlTruncate // sqlite3.c:98833:3:
- *(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sMemJournalMethods)) + 20 /* .xSync */)) = memjrnlSync // sqlite3.c:98834:3:
- *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sMemJournalMethods)) + 24 /* .xFileSize */)) = memjrnlFileSize // sqlite3.c:98835:3:
- *(*func(*libc.TLS) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sMutex)) + 0 /* .xMutexInit */)) = noopMutexInit // sqlite3.c:26532:5:
- *(*func(*libc.TLS) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sMutex)) + 4 /* .xMutexEnd */)) = noopMutexEnd // sqlite3.c:26533:5:
- *(*func(*libc.TLS, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sMutex)) + 8 /* .xMutexAlloc */)) = noopMutexAlloc // sqlite3.c:26534:5:
- *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&sMutex)) + 12 /* .xMutexFree */)) = noopMutexFree // sqlite3.c:26535:5:
- *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&sMutex)) + 16 /* .xMutexEnter */)) = noopMutexEnter // sqlite3.c:26536:5:
- *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sMutex)) + 20 /* .xMutexTry */)) = noopMutexTry // sqlite3.c:26537:5:
- *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&sMutex)) + 24 /* .xMutexLeave */)) = noopMutexLeave // sqlite3.c:26538:5:
- *(*func(*libc.TLS, uintptr, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 0 /* .aggregate_context */)) = Xsqlite3_aggregate_context // sqlite3.c:127068:3:
- *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 4 /* .aggregate_count */)) = Xsqlite3_aggregate_count // sqlite3.c:127070:3:
- *(*func(*libc.TLS, uintptr, int32, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 8 /* .bind_blob */)) = Xsqlite3_bind_blob // sqlite3.c:127074:3:
- *(*func(*libc.TLS, uintptr, int32, float64) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 12 /* .bind_double */)) = Xsqlite3_bind_double // sqlite3.c:127075:3:
- *(*func(*libc.TLS, uintptr, int32, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 16 /* .bind_int */)) = Xsqlite3_bind_int // sqlite3.c:127076:3:
- *(*func(*libc.TLS, uintptr, int32, Sqlite_int64) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 20 /* .bind_int64 */)) = Xsqlite3_bind_int64 // sqlite3.c:127077:3:
- *(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 24 /* .bind_null */)) = Xsqlite3_bind_null // sqlite3.c:127078:3:
- *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 28 /* .bind_parameter_count */)) = Xsqlite3_bind_parameter_count // sqlite3.c:127079:3:
- *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 32 /* .bind_parameter_index */)) = Xsqlite3_bind_parameter_index // sqlite3.c:127080:3:
- *(*func(*libc.TLS, uintptr, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 36 /* .bind_parameter_name */)) = Xsqlite3_bind_parameter_name // sqlite3.c:127081:3:
- *(*func(*libc.TLS, uintptr, int32, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 40 /* .bind_text */)) = Xsqlite3_bind_text // sqlite3.c:127082:3:
- *(*func(*libc.TLS, uintptr, int32, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 44 /* .bind_text16 */)) = Xsqlite3_bind_text16 // sqlite3.c:127083:3:
- *(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 48 /* .bind_value */)) = Xsqlite3_bind_value // sqlite3.c:127084:3:
- *(*func(*libc.TLS, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 52 /* .busy_handler */)) = Xsqlite3_busy_handler // sqlite3.c:127085:3:
- *(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 56 /* .busy_timeout */)) = Xsqlite3_busy_timeout // sqlite3.c:127086:3:
- *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 60 /* .changes */)) = Xsqlite3_changes // sqlite3.c:127087:3:
- *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 64 /* .close */)) = Xsqlite3_close // sqlite3.c:127088:3:
- *(*func(*libc.TLS, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 68 /* .collation_needed */)) = Xsqlite3_collation_needed // sqlite3.c:127089:3:
- *(*func(*libc.TLS, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 72 /* .collation_needed16 */)) = Xsqlite3_collation_needed16 // sqlite3.c:127090:3:
- *(*func(*libc.TLS, uintptr, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 76 /* .column_blob */)) = Xsqlite3_column_blob // sqlite3.c:127091:3:
- *(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 80 /* .column_bytes */)) = Xsqlite3_column_bytes // sqlite3.c:127092:3:
- *(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 84 /* .column_bytes16 */)) = Xsqlite3_column_bytes16 // sqlite3.c:127093:3:
- *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 88 /* .column_count */)) = Xsqlite3_column_count // sqlite3.c:127094:3:
- *(*func(*libc.TLS, uintptr, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 92 /* .column_database_name */)) = Xsqlite3_column_database_name // sqlite3.c:127095:3:
- *(*func(*libc.TLS, uintptr, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 96 /* .column_database_name16 */)) = Xsqlite3_column_database_name16 // sqlite3.c:127096:3:
- *(*func(*libc.TLS, uintptr, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 100 /* .column_decltype */)) = Xsqlite3_column_decltype // sqlite3.c:127097:3:
- *(*func(*libc.TLS, uintptr, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 104 /* .column_decltype16 */)) = Xsqlite3_column_decltype16 // sqlite3.c:127098:3:
- *(*func(*libc.TLS, uintptr, int32) float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 108 /* .column_double */)) = Xsqlite3_column_double // sqlite3.c:127099:3:
- *(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 112 /* .column_int */)) = Xsqlite3_column_int // sqlite3.c:127100:3:
- *(*func(*libc.TLS, uintptr, int32) Sqlite_int64)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 116 /* .column_int64 */)) = Xsqlite3_column_int64 // sqlite3.c:127101:3:
- *(*func(*libc.TLS, uintptr, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 120 /* .column_name */)) = Xsqlite3_column_name // sqlite3.c:127102:3:
- *(*func(*libc.TLS, uintptr, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 124 /* .column_name16 */)) = Xsqlite3_column_name16 // sqlite3.c:127103:3:
- *(*func(*libc.TLS, uintptr, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 128 /* .column_origin_name */)) = Xsqlite3_column_origin_name // sqlite3.c:127104:3:
- *(*func(*libc.TLS, uintptr, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 132 /* .column_origin_name16 */)) = Xsqlite3_column_origin_name16 // sqlite3.c:127105:3:
- *(*func(*libc.TLS, uintptr, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 136 /* .column_table_name */)) = Xsqlite3_column_table_name // sqlite3.c:127106:3:
- *(*func(*libc.TLS, uintptr, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 140 /* .column_table_name16 */)) = Xsqlite3_column_table_name16 // sqlite3.c:127107:3:
- *(*func(*libc.TLS, uintptr, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 144 /* .column_text */)) = Xsqlite3_column_text // sqlite3.c:127108:3:
- *(*func(*libc.TLS, uintptr, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 148 /* .column_text16 */)) = Xsqlite3_column_text16 // sqlite3.c:127109:3:
- *(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 152 /* .column_type */)) = Xsqlite3_column_type // sqlite3.c:127110:3:
- *(*func(*libc.TLS, uintptr, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 156 /* .column_value */)) = Xsqlite3_column_value // sqlite3.c:127111:3:
- *(*func(*libc.TLS, uintptr, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 160 /* .commit_hook */)) = Xsqlite3_commit_hook // sqlite3.c:127112:3:
- *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 164 /* .complete */)) = Xsqlite3_complete // sqlite3.c:127113:3:
- *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 168 /* .complete16 */)) = Xsqlite3_complete16 // sqlite3.c:127114:3:
- *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 172 /* .create_collation */)) = Xsqlite3_create_collation // sqlite3.c:127115:3:
- *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 176 /* .create_collation16 */)) = Xsqlite3_create_collation16 // sqlite3.c:127116:3:
- *(*func(*libc.TLS, uintptr, uintptr, int32, int32, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 180 /* .create_function */)) = Xsqlite3_create_function // sqlite3.c:127117:3:
- *(*func(*libc.TLS, uintptr, uintptr, int32, int32, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 184 /* .create_function16 */)) = Xsqlite3_create_function16 // sqlite3.c:127118:3:
- *(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 188 /* .create_module */)) = Xsqlite3_create_module // sqlite3.c:127119:3:
- *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 192 /* .data_count */)) = Xsqlite3_data_count // sqlite3.c:127120:3:
- *(*func(*libc.TLS, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 196 /* .db_handle */)) = Xsqlite3_db_handle // sqlite3.c:127121:3:
- *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 200 /* .declare_vtab */)) = Xsqlite3_declare_vtab // sqlite3.c:127122:3:
- *(*func(*libc.TLS, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 204 /* .enable_shared_cache */)) = Xsqlite3_enable_shared_cache // sqlite3.c:127123:3:
- *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 208 /* .errcode */)) = Xsqlite3_errcode // sqlite3.c:127124:3:
- *(*func(*libc.TLS, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 212 /* .errmsg */)) = Xsqlite3_errmsg // sqlite3.c:127125:3:
- *(*func(*libc.TLS, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 216 /* .errmsg16 */)) = Xsqlite3_errmsg16 // sqlite3.c:127126:3:
- *(*func(*libc.TLS, uintptr, uintptr, Sqlite3_callback, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 220 /* .exec */)) = Xsqlite3_exec // sqlite3.c:127127:3:
- *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 224 /* .expired */)) = Xsqlite3_expired // sqlite3.c:127129:3:
- *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 228 /* .finalize */)) = Xsqlite3_finalize // sqlite3.c:127133:3:
- *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 232 /* .free */)) = Xsqlite3_free // sqlite3.c:127134:3:
- *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 236 /* .free_table */)) = Xsqlite3_free_table // sqlite3.c:127135:3:
- *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 240 /* .get_autocommit */)) = Xsqlite3_get_autocommit // sqlite3.c:127136:3:
- *(*func(*libc.TLS, uintptr, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 244 /* .get_auxdata */)) = Xsqlite3_get_auxdata // sqlite3.c:127137:3:
- *(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 248 /* .get_table */)) = Xsqlite3_get_table // sqlite3.c:127138:3:
- *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 256 /* .interruptx */)) = Xsqlite3_interrupt // sqlite3.c:127140:3:
- *(*func(*libc.TLS, uintptr) Sqlite3_int64)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 260 /* .last_insert_rowid */)) = Xsqlite3_last_insert_rowid // sqlite3.c:127141:3:
- *(*func(*libc.TLS) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 264 /* .libversion */)) = Xsqlite3_libversion // sqlite3.c:127142:3:
- *(*func(*libc.TLS) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 268 /* .libversion_number */)) = Xsqlite3_libversion_number // sqlite3.c:127143:3:
- *(*func(*libc.TLS, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 272 /* .malloc */)) = Xsqlite3_malloc // sqlite3.c:127144:3:
- *(*func(*libc.TLS, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 276 /* .mprintf */)) = Xsqlite3_mprintf // sqlite3.c:127145:3:
- *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 280 /* .open */)) = Xsqlite3_open // sqlite3.c:127146:3:
- *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 284 /* .open16 */)) = Xsqlite3_open16 // sqlite3.c:127147:3:
- *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 288 /* .prepare */)) = Xsqlite3_prepare // sqlite3.c:127148:3:
- *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 292 /* .prepare16 */)) = Xsqlite3_prepare16 // sqlite3.c:127149:3:
- *(*func(*libc.TLS, uintptr, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 296 /* .profile */)) = Xsqlite3_profile // sqlite3.c:127150:3:
- *(*func(*libc.TLS, uintptr, int32, uintptr, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 300 /* .progress_handler */)) = Xsqlite3_progress_handler // sqlite3.c:127151:3:
- *(*func(*libc.TLS, uintptr, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 304 /* .realloc */)) = Xsqlite3_realloc // sqlite3.c:127152:3:
- *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 308 /* .reset */)) = Xsqlite3_reset // sqlite3.c:127153:3:
- *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 312 /* .result_blob */)) = Xsqlite3_result_blob // sqlite3.c:127154:3:
- *(*func(*libc.TLS, uintptr, float64))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 316 /* .result_double */)) = Xsqlite3_result_double // sqlite3.c:127155:3:
- *(*func(*libc.TLS, uintptr, uintptr, int32))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 320 /* .result_error */)) = Xsqlite3_result_error // sqlite3.c:127156:3:
- *(*func(*libc.TLS, uintptr, uintptr, int32))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 324 /* .result_error16 */)) = Xsqlite3_result_error16 // sqlite3.c:127157:3:
- *(*func(*libc.TLS, uintptr, int32))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 328 /* .result_int */)) = Xsqlite3_result_int // sqlite3.c:127158:3:
- *(*func(*libc.TLS, uintptr, I64))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 332 /* .result_int64 */)) = Xsqlite3_result_int64 // sqlite3.c:127159:3:
- *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 336 /* .result_null */)) = Xsqlite3_result_null // sqlite3.c:127160:3:
- *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 340 /* .result_text */)) = Xsqlite3_result_text // sqlite3.c:127161:3:
- *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 344 /* .result_text16 */)) = Xsqlite3_result_text16 // sqlite3.c:127162:3:
- *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 348 /* .result_text16be */)) = Xsqlite3_result_text16be // sqlite3.c:127163:3:
- *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 352 /* .result_text16le */)) = Xsqlite3_result_text16le // sqlite3.c:127164:3:
- *(*func(*libc.TLS, uintptr, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 356 /* .result_value */)) = Xsqlite3_result_value // sqlite3.c:127165:3:
- *(*func(*libc.TLS, uintptr, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 360 /* .rollback_hook */)) = Xsqlite3_rollback_hook // sqlite3.c:127166:3:
- *(*func(*libc.TLS, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 364 /* .set_authorizer */)) = Xsqlite3_set_authorizer // sqlite3.c:127167:3:
- *(*func(*libc.TLS, uintptr, int32, uintptr, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 368 /* .set_auxdata */)) = Xsqlite3_set_auxdata // sqlite3.c:127168:3:
- *(*func(*libc.TLS, int32, uintptr, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 372 /* .xsnprintf */)) = Xsqlite3_snprintf // sqlite3.c:127169:3:
- *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 376 /* .step */)) = Xsqlite3_step // sqlite3.c:127170:3:
- *(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr, uintptr, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 380 /* .table_column_metadata */)) = Xsqlite3_table_column_metadata // sqlite3.c:127171:3:
- *(*func(*libc.TLS))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 384 /* .thread_cleanup */)) = Xsqlite3_thread_cleanup // sqlite3.c:127173:3:
- *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 388 /* .total_changes */)) = Xsqlite3_total_changes // sqlite3.c:127177:3:
- *(*func(*libc.TLS, uintptr, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 392 /* .trace */)) = Xsqlite3_trace // sqlite3.c:127178:3:
- *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 396 /* .transfer_bindings */)) = Xsqlite3_transfer_bindings // sqlite3.c:127180:3:
- *(*func(*libc.TLS, uintptr, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 400 /* .update_hook */)) = Xsqlite3_update_hook // sqlite3.c:127184:3:
- *(*func(*libc.TLS, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 404 /* .user_data */)) = Xsqlite3_user_data // sqlite3.c:127185:3:
- *(*func(*libc.TLS, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 408 /* .value_blob */)) = Xsqlite3_value_blob // sqlite3.c:127186:3:
- *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 412 /* .value_bytes */)) = Xsqlite3_value_bytes // sqlite3.c:127187:3:
- *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 416 /* .value_bytes16 */)) = Xsqlite3_value_bytes16 // sqlite3.c:127188:3:
- *(*func(*libc.TLS, uintptr) float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 420 /* .value_double */)) = Xsqlite3_value_double // sqlite3.c:127189:3:
- *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 424 /* .value_int */)) = Xsqlite3_value_int // sqlite3.c:127190:3:
- *(*func(*libc.TLS, uintptr) Sqlite_int64)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 428 /* .value_int64 */)) = Xsqlite3_value_int64 // sqlite3.c:127191:3:
- *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 432 /* .value_numeric_type */)) = Xsqlite3_value_numeric_type // sqlite3.c:127192:3:
- *(*func(*libc.TLS, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 436 /* .value_text */)) = Xsqlite3_value_text // sqlite3.c:127193:3:
- *(*func(*libc.TLS, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 440 /* .value_text16 */)) = Xsqlite3_value_text16 // sqlite3.c:127194:3:
- *(*func(*libc.TLS, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 444 /* .value_text16be */)) = Xsqlite3_value_text16be // sqlite3.c:127195:3:
- *(*func(*libc.TLS, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 448 /* .value_text16le */)) = Xsqlite3_value_text16le // sqlite3.c:127196:3:
- *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 452 /* .value_type */)) = Xsqlite3_value_type // sqlite3.c:127197:3:
- *(*func(*libc.TLS, uintptr, Va_list) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 456 /* .vmprintf */)) = Xsqlite3_vmprintf // sqlite3.c:127198:3:
- *(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 460 /* .overload_function */)) = Xsqlite3_overload_function // sqlite3.c:127207:3:
- *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 464 /* .prepare_v2 */)) = Xsqlite3_prepare_v2 // sqlite3.c:127212:3:
- *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 468 /* .prepare16_v2 */)) = Xsqlite3_prepare16_v2 // sqlite3.c:127213:3:
- *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 472 /* .clear_bindings */)) = Xsqlite3_clear_bindings // sqlite3.c:127214:3:
- *(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 476 /* .create_module_v2 */)) = Xsqlite3_create_module_v2 // sqlite3.c:127219:3:
- *(*func(*libc.TLS, uintptr, int32, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 480 /* .bind_zeroblob */)) = Xsqlite3_bind_zeroblob // sqlite3.c:127224:3:
- *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 484 /* .blob_bytes */)) = Xsqlite3_blob_bytes // sqlite3.c:127225:3:
- *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 488 /* .blob_close */)) = Xsqlite3_blob_close // sqlite3.c:127226:3:
- *(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr, Sqlite_int64, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 492 /* .blob_open */)) = Xsqlite3_blob_open // sqlite3.c:127227:3:
- *(*func(*libc.TLS, uintptr, uintptr, int32, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 496 /* .blob_read */)) = Xsqlite3_blob_read // sqlite3.c:127228:3:
- *(*func(*libc.TLS, uintptr, uintptr, int32, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 500 /* .blob_write */)) = Xsqlite3_blob_write // sqlite3.c:127229:3:
- *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 504 /* .create_collation_v2 */)) = Xsqlite3_create_collation_v2 // sqlite3.c:127230:3:
- *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 508 /* .file_control */)) = Xsqlite3_file_control // sqlite3.c:127231:3:
- *(*func(*libc.TLS, int32) Sqlite3_int64)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 512 /* .memory_highwater */)) = Xsqlite3_memory_highwater // sqlite3.c:127232:3:
- *(*func(*libc.TLS) Sqlite3_int64)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 516 /* .memory_used */)) = Xsqlite3_memory_used // sqlite3.c:127233:3:
- *(*func(*libc.TLS, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 520 /* .mutex_alloc */)) = Xsqlite3_mutex_alloc // sqlite3.c:127241:3:
- *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 524 /* .mutex_enter */)) = Xsqlite3_mutex_enter // sqlite3.c:127242:3:
- *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 528 /* .mutex_free */)) = Xsqlite3_mutex_free // sqlite3.c:127243:3:
- *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 532 /* .mutex_leave */)) = Xsqlite3_mutex_leave // sqlite3.c:127244:3:
- *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 536 /* .mutex_try */)) = Xsqlite3_mutex_try // sqlite3.c:127245:3:
- *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 540 /* .open_v2 */)) = Xsqlite3_open_v2 // sqlite3.c:127247:3:
- *(*func(*libc.TLS, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 544 /* .release_memory */)) = Xsqlite3_release_memory // sqlite3.c:127248:3:
- *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 548 /* .result_error_nomem */)) = Xsqlite3_result_error_nomem // sqlite3.c:127249:3:
- *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 552 /* .result_error_toobig */)) = Xsqlite3_result_error_toobig // sqlite3.c:127250:3:
- *(*func(*libc.TLS, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 556 /* .sleep */)) = Xsqlite3_sleep // sqlite3.c:127251:3:
- *(*func(*libc.TLS, int32))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 560 /* .soft_heap_limit */)) = Xsqlite3_soft_heap_limit // sqlite3.c:127252:3:
- *(*func(*libc.TLS, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 564 /* .vfs_find */)) = Xsqlite3_vfs_find // sqlite3.c:127253:3:
- *(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 568 /* .vfs_register */)) = Xsqlite3_vfs_register // sqlite3.c:127254:3:
- *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 572 /* .vfs_unregister */)) = Xsqlite3_vfs_unregister // sqlite3.c:127255:3:
- *(*func(*libc.TLS) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 576 /* .xthreadsafe */)) = Xsqlite3_threadsafe // sqlite3.c:127260:3:
- *(*func(*libc.TLS, uintptr, int32))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 580 /* .result_zeroblob */)) = Xsqlite3_result_zeroblob // sqlite3.c:127261:3:
- *(*func(*libc.TLS, uintptr, int32))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 584 /* .result_error_code */)) = Xsqlite3_result_error_code // sqlite3.c:127262:3:
- *(*func(*libc.TLS, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 588 /* .test_control */)) = Xsqlite3_test_control // sqlite3.c:127263:3:
- *(*func(*libc.TLS, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 592 /* .randomness */)) = Xsqlite3_randomness // sqlite3.c:127264:3:
- *(*func(*libc.TLS, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 596 /* .context_db_handle */)) = Xsqlite3_context_db_handle // sqlite3.c:127265:3:
- *(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 600 /* .extended_result_codes */)) = Xsqlite3_extended_result_codes // sqlite3.c:127270:3:
- *(*func(*libc.TLS, uintptr, int32, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 604 /* .limit */)) = Xsqlite3_limit // sqlite3.c:127271:3:
- *(*func(*libc.TLS, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 608 /* .next_stmt */)) = Xsqlite3_next_stmt // sqlite3.c:127272:3:
- *(*func(*libc.TLS, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 612 /* .sql */)) = Xsqlite3_sql // sqlite3.c:127273:3:
- *(*func(*libc.TLS, int32, uintptr, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 616 /* .status */)) = Xsqlite3_status // sqlite3.c:127274:3:
- *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 620 /* .backup_finish */)) = Xsqlite3_backup_finish // sqlite3.c:127279:3:
- *(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 624 /* .backup_init */)) = Xsqlite3_backup_init // sqlite3.c:127280:3:
- *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 628 /* .backup_pagecount */)) = Xsqlite3_backup_pagecount // sqlite3.c:127281:3:
- *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 632 /* .backup_remaining */)) = Xsqlite3_backup_remaining // sqlite3.c:127282:3:
- *(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 636 /* .backup_step */)) = Xsqlite3_backup_step // sqlite3.c:127283:3:
- *(*func(*libc.TLS, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 640 /* .compileoption_get */)) = Xsqlite3_compileoption_get // sqlite3.c:127285:3:
- *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 644 /* .compileoption_used */)) = Xsqlite3_compileoption_used // sqlite3.c:127286:3:
- *(*func(*libc.TLS, uintptr, uintptr, int32, int32, uintptr, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 648 /* .create_function_v2 */)) = Xsqlite3_create_function_v2 // sqlite3.c:127291:3:
- *(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 652 /* .db_config */)) = Xsqlite3_db_config // sqlite3.c:127292:3:
- *(*func(*libc.TLS, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 656 /* .db_mutex */)) = Xsqlite3_db_mutex // sqlite3.c:127293:3:
- *(*func(*libc.TLS, uintptr, int32, uintptr, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 660 /* .db_status */)) = Xsqlite3_db_status // sqlite3.c:127294:3:
- *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 664 /* .extended_errcode */)) = Xsqlite3_extended_errcode // sqlite3.c:127295:3:
- *(*func(*libc.TLS, int32, uintptr, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 668 /* .log */)) = Xsqlite3_log // sqlite3.c:127296:3:
- *(*func(*libc.TLS, Sqlite3_int64) Sqlite3_int64)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 672 /* .soft_heap_limit64 */)) = Xsqlite3_soft_heap_limit64 // sqlite3.c:127297:3:
- *(*func(*libc.TLS) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 676 /* .sourceid */)) = Xsqlite3_sourceid // sqlite3.c:127298:3:
- *(*func(*libc.TLS, uintptr, int32, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 680 /* .stmt_status */)) = Xsqlite3_stmt_status // sqlite3.c:127299:3:
- *(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 684 /* .strnicmp */)) = Xsqlite3_strnicmp // sqlite3.c:127300:3:
- *(*func(*libc.TLS, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 688 /* .unlock_notify */)) = Xsqlite3_unlock_notify // sqlite3.c:127302:3:
- *(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 692 /* .wal_autocheckpoint */)) = Xsqlite3_wal_autocheckpoint // sqlite3.c:127307:3:
- *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 696 /* .wal_checkpoint */)) = Xsqlite3_wal_checkpoint // sqlite3.c:127308:3:
- *(*func(*libc.TLS, uintptr, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 700 /* .wal_hook */)) = Xsqlite3_wal_hook // sqlite3.c:127309:3:
- *(*func(*libc.TLS, uintptr, Sqlite3_int64) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 704 /* .blob_reopen */)) = Xsqlite3_blob_reopen // sqlite3.c:127315:3:
- *(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 708 /* .vtab_config */)) = Xsqlite3_vtab_config // sqlite3.c:127316:3:
- *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 712 /* .vtab_on_conflict */)) = Xsqlite3_vtab_on_conflict // sqlite3.c:127317:3:
- *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 716 /* .close_v2 */)) = Xsqlite3_close_v2 // sqlite3.c:127318:3:
- *(*func(*libc.TLS, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 720 /* .db_filename */)) = Xsqlite3_db_filename // sqlite3.c:127319:3:
- *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 724 /* .db_readonly */)) = Xsqlite3_db_readonly // sqlite3.c:127320:3:
- *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 728 /* .db_release_memory */)) = Xsqlite3_db_release_memory // sqlite3.c:127321:3:
- *(*func(*libc.TLS, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 732 /* .errstr */)) = Xsqlite3_errstr // sqlite3.c:127322:3:
- *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 736 /* .stmt_busy */)) = Xsqlite3_stmt_busy // sqlite3.c:127323:3:
- *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 740 /* .stmt_readonly */)) = Xsqlite3_stmt_readonly // sqlite3.c:127324:3:
- *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 744 /* .stricmp */)) = Xsqlite3_stricmp // sqlite3.c:127325:3:
- *(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 748 /* .uri_boolean */)) = Xsqlite3_uri_boolean // sqlite3.c:127326:3:
- *(*func(*libc.TLS, uintptr, uintptr, Sqlite3_int64) Sqlite3_int64)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 752 /* .uri_int64 */)) = Xsqlite3_uri_int64 // sqlite3.c:127327:3:
- *(*func(*libc.TLS, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 756 /* .uri_parameter */)) = Xsqlite3_uri_parameter // sqlite3.c:127328:3:
- *(*func(*libc.TLS, int32, uintptr, uintptr, Va_list) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 760 /* .xvsnprintf */)) = Xsqlite3_vsnprintf // sqlite3.c:127329:3:
- *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 764 /* .wal_checkpoint_v2 */)) = Xsqlite3_wal_checkpoint_v2 // sqlite3.c:127330:3:
- *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 768 /* .auto_extension */)) = Xsqlite3_auto_extension // sqlite3.c:127332:3:
- *(*func(*libc.TLS, uintptr, int32, uintptr, Sqlite3_uint64, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 772 /* .bind_blob64 */)) = Xsqlite3_bind_blob64 // sqlite3.c:127333:3:
- *(*func(*libc.TLS, uintptr, int32, uintptr, Sqlite3_uint64, uintptr, uint8) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 776 /* .bind_text64 */)) = Xsqlite3_bind_text64 // sqlite3.c:127334:3:
- *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 780 /* .cancel_auto_extension */)) = Xsqlite3_cancel_auto_extension // sqlite3.c:127335:3:
- *(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 784 /* .load_extension */)) = Xsqlite3_load_extension // sqlite3.c:127336:3:
- *(*func(*libc.TLS, Sqlite3_uint64) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 788 /* .malloc64 */)) = Xsqlite3_malloc64 // sqlite3.c:127337:3:
- *(*func(*libc.TLS, uintptr) Sqlite3_uint64)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 792 /* .msize */)) = Xsqlite3_msize // sqlite3.c:127338:3:
- *(*func(*libc.TLS, uintptr, Sqlite3_uint64) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 796 /* .realloc64 */)) = Xsqlite3_realloc64 // sqlite3.c:127339:3:
- *(*func(*libc.TLS))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 800 /* .reset_auto_extension */)) = Xsqlite3_reset_auto_extension // sqlite3.c:127340:3:
- *(*func(*libc.TLS, uintptr, uintptr, Sqlite3_uint64, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 804 /* .result_blob64 */)) = Xsqlite3_result_blob64 // sqlite3.c:127341:3:
- *(*func(*libc.TLS, uintptr, uintptr, Sqlite3_uint64, uintptr, uint8))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 808 /* .result_text64 */)) = Xsqlite3_result_text64 // sqlite3.c:127342:3:
- *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 812 /* .strglob */)) = Xsqlite3_strglob // sqlite3.c:127343:3:
+ }{libc.Xlstat})) // sqlite3.c:34766:22:
+ *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 20 /* .pAppData */)) = uintptr(unsafe.Pointer(&posixIoFinder)) // sqlite3.c:42295:5:
+ *(*func(*libc.TLS, uintptr, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 24)) = unixOpen // sqlite3.c:42295:5:
+ *(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 28)) = unixDelete // sqlite3.c:42295:5:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 32)) = unixAccess // sqlite3.c:42295:5:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 36)) = unixFullPathname // sqlite3.c:42295:5:
+ *(*func(*libc.TLS, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 40)) = unixDlOpen // sqlite3.c:42295:5:
+ *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 44)) = unixDlError // sqlite3.c:42295:5:
+ *(*func(*libc.TLS, uintptr, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 48)) = unixDlSym // sqlite3.c:42295:5:
+ *(*func(*libc.TLS, uintptr, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 52)) = unixDlClose // sqlite3.c:42295:5:
+ *(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 56)) = unixRandomness // sqlite3.c:42295:5:
+ *(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 60)) = unixSleep // sqlite3.c:42295:5:
+ *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 64)) = unixCurrentTime // sqlite3.c:42295:5:
+ *(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 68)) = unixGetLastError // sqlite3.c:42295:5:
+ *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 72)) = unixCurrentTimeInt64 // sqlite3.c:42295:5:
+ *(*func(*libc.TLS, uintptr, uintptr, Sqlite3_syscall_ptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 76)) = unixSetSystemCall // sqlite3.c:42295:5:
+ *(*func(*libc.TLS, uintptr, uintptr) Sqlite3_syscall_ptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 80)) = unixGetSystemCall // sqlite3.c:42295:5:
+ *(*func(*libc.TLS, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 84)) = unixNextSystemCall // sqlite3.c:42295:5:
+ *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 108 /* .pAppData */)) = uintptr(unsafe.Pointer(&nolockIoFinder)) // sqlite3.c:42297:5:
+ *(*func(*libc.TLS, uintptr, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 112)) = unixOpen // sqlite3.c:42297:5:
+ *(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 116)) = unixDelete // sqlite3.c:42297:5:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 120)) = unixAccess // sqlite3.c:42297:5:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 124)) = unixFullPathname // sqlite3.c:42297:5:
+ *(*func(*libc.TLS, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 128)) = unixDlOpen // sqlite3.c:42297:5:
+ *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 132)) = unixDlError // sqlite3.c:42297:5:
+ *(*func(*libc.TLS, uintptr, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 136)) = unixDlSym // sqlite3.c:42297:5:
+ *(*func(*libc.TLS, uintptr, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 140)) = unixDlClose // sqlite3.c:42297:5:
+ *(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 144)) = unixRandomness // sqlite3.c:42297:5:
+ *(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 148)) = unixSleep // sqlite3.c:42297:5:
+ *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 152)) = unixCurrentTime // sqlite3.c:42297:5:
+ *(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 156)) = unixGetLastError // sqlite3.c:42297:5:
+ *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 160)) = unixCurrentTimeInt64 // sqlite3.c:42297:5:
+ *(*func(*libc.TLS, uintptr, uintptr, Sqlite3_syscall_ptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 164)) = unixSetSystemCall // sqlite3.c:42297:5:
+ *(*func(*libc.TLS, uintptr, uintptr) Sqlite3_syscall_ptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 168)) = unixGetSystemCall // sqlite3.c:42297:5:
+ *(*func(*libc.TLS, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 172)) = unixNextSystemCall // sqlite3.c:42297:5:
+ *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 196 /* .pAppData */)) = uintptr(unsafe.Pointer(&dotlockIoFinder)) // sqlite3.c:42298:5:
+ *(*func(*libc.TLS, uintptr, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 200)) = unixOpen // sqlite3.c:42298:5:
+ *(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 204)) = unixDelete // sqlite3.c:42298:5:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 208)) = unixAccess // sqlite3.c:42298:5:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 212)) = unixFullPathname // sqlite3.c:42298:5:
+ *(*func(*libc.TLS, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 216)) = unixDlOpen // sqlite3.c:42298:5:
+ *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 220)) = unixDlError // sqlite3.c:42298:5:
+ *(*func(*libc.TLS, uintptr, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 224)) = unixDlSym // sqlite3.c:42298:5:
+ *(*func(*libc.TLS, uintptr, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 228)) = unixDlClose // sqlite3.c:42298:5:
+ *(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 232)) = unixRandomness // sqlite3.c:42298:5:
+ *(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 236)) = unixSleep // sqlite3.c:42298:5:
+ *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 240)) = unixCurrentTime // sqlite3.c:42298:5:
+ *(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 244)) = unixGetLastError // sqlite3.c:42298:5:
+ *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 248)) = unixCurrentTimeInt64 // sqlite3.c:42298:5:
+ *(*func(*libc.TLS, uintptr, uintptr, Sqlite3_syscall_ptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 252)) = unixSetSystemCall // sqlite3.c:42298:5:
+ *(*func(*libc.TLS, uintptr, uintptr) Sqlite3_syscall_ptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 256)) = unixGetSystemCall // sqlite3.c:42298:5:
+ *(*func(*libc.TLS, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 260)) = unixNextSystemCall // sqlite3.c:42298:5:
+ *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 284 /* .pAppData */)) = uintptr(unsafe.Pointer(&posixIoFinder)) // sqlite3.c:42299:5:
+ *(*func(*libc.TLS, uintptr, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 288)) = unixOpen // sqlite3.c:42299:5:
+ *(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 292)) = unixDelete // sqlite3.c:42299:5:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 296)) = unixAccess // sqlite3.c:42299:5:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 300)) = unixFullPathname // sqlite3.c:42299:5:
+ *(*func(*libc.TLS, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 304)) = unixDlOpen // sqlite3.c:42299:5:
+ *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 308)) = unixDlError // sqlite3.c:42299:5:
+ *(*func(*libc.TLS, uintptr, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 312)) = unixDlSym // sqlite3.c:42299:5:
+ *(*func(*libc.TLS, uintptr, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 316)) = unixDlClose // sqlite3.c:42299:5:
+ *(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 320)) = unixRandomness // sqlite3.c:42299:5:
+ *(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 324)) = unixSleep // sqlite3.c:42299:5:
+ *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 328)) = unixCurrentTime // sqlite3.c:42299:5:
+ *(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 332)) = unixGetLastError // sqlite3.c:42299:5:
+ *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 336)) = unixCurrentTimeInt64 // sqlite3.c:42299:5:
+ *(*func(*libc.TLS, uintptr, uintptr, Sqlite3_syscall_ptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 340)) = unixSetSystemCall // sqlite3.c:42299:5:
+ *(*func(*libc.TLS, uintptr, uintptr) Sqlite3_syscall_ptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 344)) = unixGetSystemCall // sqlite3.c:42299:5:
+ *(*func(*libc.TLS, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 348)) = unixNextSystemCall // sqlite3.c:42299:5:
+ *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 16)) = row_numberStepFunc // sqlite3.c:156935:5:
+ *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 20)) = row_numberValueFunc // sqlite3.c:156935:5:
+ *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 24)) = row_numberValueFunc // sqlite3.c:156935:5:
+ *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 28)) = noopStepFunc // sqlite3.c:156935:5:
+ *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 32 /* .zName */)) = uintptr(unsafe.Pointer(&row_numberName)) // sqlite3.c:156935:5:
+ *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 56)) = dense_rankStepFunc // sqlite3.c:156936:5:
+ *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 60)) = dense_rankValueFunc // sqlite3.c:156936:5:
+ *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 64)) = dense_rankValueFunc // sqlite3.c:156936:5:
+ *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 68)) = noopStepFunc // sqlite3.c:156936:5:
+ *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 72 /* .zName */)) = uintptr(unsafe.Pointer(&dense_rankName)) // sqlite3.c:156936:5:
+ *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 96)) = rankStepFunc // sqlite3.c:156937:5:
+ *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 100)) = rankValueFunc // sqlite3.c:156937:5:
+ *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 104)) = rankValueFunc // sqlite3.c:156937:5:
+ *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 108)) = noopStepFunc // sqlite3.c:156937:5:
+ *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 112 /* .zName */)) = uintptr(unsafe.Pointer(&rankName)) // sqlite3.c:156937:5:
+ *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 136)) = percent_rankStepFunc // sqlite3.c:156938:5:
+ *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 140)) = percent_rankValueFunc // sqlite3.c:156938:5:
+ *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 144)) = percent_rankValueFunc // sqlite3.c:156938:5:
+ *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 148)) = percent_rankInvFunc // sqlite3.c:156938:5:
+ *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 152 /* .zName */)) = uintptr(unsafe.Pointer(&percent_rankName)) // sqlite3.c:156938:5:
+ *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 176)) = cume_distStepFunc // sqlite3.c:156939:5:
+ *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 180)) = cume_distValueFunc // sqlite3.c:156939:5:
+ *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 184)) = cume_distValueFunc // sqlite3.c:156939:5:
+ *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 188)) = cume_distInvFunc // sqlite3.c:156939:5:
+ *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 192 /* .zName */)) = uintptr(unsafe.Pointer(&cume_distName)) // sqlite3.c:156939:5:
+ *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 216)) = ntileStepFunc // sqlite3.c:156940:5:
+ *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 220)) = ntileValueFunc // sqlite3.c:156940:5:
+ *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 224)) = ntileValueFunc // sqlite3.c:156940:5:
+ *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 228)) = ntileInvFunc // sqlite3.c:156940:5:
+ *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 232 /* .zName */)) = uintptr(unsafe.Pointer(&ntileName)) // sqlite3.c:156940:5:
+ *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 256)) = last_valueStepFunc // sqlite3.c:156941:5:
+ *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 260)) = last_valueFinalizeFunc // sqlite3.c:156941:5:
+ *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 264)) = last_valueValueFunc // sqlite3.c:156941:5:
+ *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 268)) = last_valueInvFunc // sqlite3.c:156941:5:
+ *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 272 /* .zName */)) = uintptr(unsafe.Pointer(&last_valueName)) // sqlite3.c:156941:5:
+ *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 296)) = nth_valueStepFunc // sqlite3.c:156942:5:
+ *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 300)) = nth_valueFinalizeFunc // sqlite3.c:156942:5:
+ *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 304)) = noopValueFunc // sqlite3.c:156942:5:
+ *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 308)) = noopStepFunc // sqlite3.c:156942:5:
+ *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 312 /* .zName */)) = uintptr(unsafe.Pointer(&nth_valueName)) // sqlite3.c:156942:5:
+ *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 336)) = first_valueStepFunc // sqlite3.c:156943:5:
+ *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 340)) = first_valueFinalizeFunc // sqlite3.c:156943:5:
+ *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 344)) = noopValueFunc // sqlite3.c:156943:5:
+ *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 348)) = noopStepFunc // sqlite3.c:156943:5:
+ *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 352 /* .zName */)) = uintptr(unsafe.Pointer(&first_valueName)) // sqlite3.c:156943:5:
+ *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 376)) = noopStepFunc // sqlite3.c:156944:5:
+ *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 380)) = noopValueFunc // sqlite3.c:156944:5:
+ *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 384)) = noopValueFunc // sqlite3.c:156944:5:
+ *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 388)) = noopStepFunc // sqlite3.c:156944:5:
+ *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 392 /* .zName */)) = uintptr(unsafe.Pointer(&leadName)) // sqlite3.c:156944:5:
+ *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 416)) = noopStepFunc // sqlite3.c:156945:5:
+ *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 420)) = noopValueFunc // sqlite3.c:156945:5:
+ *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 424)) = noopValueFunc // sqlite3.c:156945:5:
+ *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 428)) = noopStepFunc // sqlite3.c:156945:5:
+ *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 432 /* .zName */)) = uintptr(unsafe.Pointer(&leadName)) // sqlite3.c:156945:5:
+ *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 456)) = noopStepFunc // sqlite3.c:156946:5:
+ *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 460)) = noopValueFunc // sqlite3.c:156946:5:
+ *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 464)) = noopValueFunc // sqlite3.c:156946:5:
+ *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 468)) = noopStepFunc // sqlite3.c:156946:5:
+ *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 472 /* .zName */)) = uintptr(unsafe.Pointer(&leadName)) // sqlite3.c:156946:5:
+ *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 496)) = noopStepFunc // sqlite3.c:156947:5:
+ *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 500)) = noopValueFunc // sqlite3.c:156947:5:
+ *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 504)) = noopValueFunc // sqlite3.c:156947:5:
+ *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 508)) = noopStepFunc // sqlite3.c:156947:5:
+ *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 512 /* .zName */)) = uintptr(unsafe.Pointer(&lagName)) // sqlite3.c:156947:5:
+ *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 536)) = noopStepFunc // sqlite3.c:156948:5:
+ *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 540)) = noopValueFunc // sqlite3.c:156948:5:
+ *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 544)) = noopValueFunc // sqlite3.c:156948:5:
+ *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 548)) = noopStepFunc // sqlite3.c:156948:5:
+ *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 552 /* .zName */)) = uintptr(unsafe.Pointer(&lagName)) // sqlite3.c:156948:5:
+ *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 576)) = noopStepFunc // sqlite3.c:156949:5:
+ *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 580)) = noopValueFunc // sqlite3.c:156949:5:
+ *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 584)) = noopValueFunc // sqlite3.c:156949:5:
+ *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 588)) = noopStepFunc // sqlite3.c:156949:5:
+ *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 592 /* .zName */)) = uintptr(unsafe.Pointer(&lagName)) // sqlite3.c:156949:5:
+ *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&attach_func)) + 16)) = attachFunc // sqlite3.c:112577:5:
+ *(*func(*libc.TLS, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&defaultMethods)) + 0)) = sqlite3MemMalloc // sqlite3.c:24791:6:
+ *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&defaultMethods)) + 4)) = sqlite3MemFree // sqlite3.c:24792:6:
+ *(*func(*libc.TLS, uintptr, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&defaultMethods)) + 8)) = sqlite3MemRealloc // sqlite3.c:24793:6:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&defaultMethods)) + 12)) = sqlite3MemSize // sqlite3.c:24794:6:
+ *(*func(*libc.TLS, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&defaultMethods)) + 16)) = sqlite3MemRoundup // sqlite3.c:24795:6:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&defaultMethods)) + 20)) = sqlite3MemInit // sqlite3.c:24796:6:
+ *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&defaultMethods)) + 24)) = sqlite3MemShutdown // sqlite3.c:24797:6:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&defaultMethods1)) + 8)) = pcache1Init // sqlite3.c:51905:5:
+ *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&defaultMethods1)) + 12)) = pcache1Shutdown // sqlite3.c:51906:5:
+ *(*func(*libc.TLS, int32, int32, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&defaultMethods1)) + 16)) = pcache1Create // sqlite3.c:51907:5:
+ *(*func(*libc.TLS, uintptr, int32))(unsafe.Pointer(uintptr(unsafe.Pointer(&defaultMethods1)) + 20)) = pcache1Cachesize // sqlite3.c:51908:5:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&defaultMethods1)) + 24)) = pcache1Pagecount // sqlite3.c:51909:5:
+ *(*func(*libc.TLS, uintptr, uint32, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&defaultMethods1)) + 28)) = pcache1Fetch // sqlite3.c:51910:5:
+ *(*func(*libc.TLS, uintptr, uintptr, int32))(unsafe.Pointer(uintptr(unsafe.Pointer(&defaultMethods1)) + 32)) = pcache1Unpin // sqlite3.c:51911:5:
+ *(*func(*libc.TLS, uintptr, uintptr, uint32, uint32))(unsafe.Pointer(uintptr(unsafe.Pointer(&defaultMethods1)) + 36)) = pcache1Rekey // sqlite3.c:51912:5:
+ *(*func(*libc.TLS, uintptr, uint32))(unsafe.Pointer(uintptr(unsafe.Pointer(&defaultMethods1)) + 40)) = pcache1Truncate // sqlite3.c:51913:5:
+ *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&defaultMethods1)) + 44)) = pcache1Destroy // sqlite3.c:51914:5:
+ *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&defaultMethods1)) + 48)) = pcache1Shrink // sqlite3.c:51915:5:
+ *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&detach_func)) + 16)) = detachFunc // sqlite3.c:112557:5:
+ *(*func(*libc.TLS, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&dotlockIoFinder)) + 0)) = dotlockIoFinderImpl // sqlite3.c:39655:1:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&dotlockIoMethods)) + 4)) = dotlockClose // sqlite3.c:39655:1:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, Sqlite3_int64) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&dotlockIoMethods)) + 8)) = unixRead // sqlite3.c:39655:1:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, Sqlite3_int64) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&dotlockIoMethods)) + 12)) = unixWrite // sqlite3.c:39655:1:
+ *(*func(*libc.TLS, uintptr, I64) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&dotlockIoMethods)) + 16)) = unixTruncate // sqlite3.c:39655:1:
+ *(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&dotlockIoMethods)) + 20)) = unixSync // sqlite3.c:39655:1:
+ *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&dotlockIoMethods)) + 24)) = unixFileSize // sqlite3.c:39655:1:
+ *(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&dotlockIoMethods)) + 28)) = dotlockLock // sqlite3.c:39655:1:
+ *(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&dotlockIoMethods)) + 32)) = dotlockUnlock // sqlite3.c:39655:1:
+ *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&dotlockIoMethods)) + 36)) = dotlockCheckReservedLock // sqlite3.c:39655:1:
+ *(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&dotlockIoMethods)) + 40)) = unixFileControl // sqlite3.c:39655:1:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&dotlockIoMethods)) + 44)) = unixSectorSize // sqlite3.c:39655:1:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&dotlockIoMethods)) + 48)) = unixDeviceCharacteristics // sqlite3.c:39655:1:
+ *(*func(*libc.TLS, uintptr, int32, int32, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&dotlockIoMethods)) + 56)) = unixShmLock // sqlite3.c:39655:1:
+ *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&dotlockIoMethods)) + 60)) = unixShmBarrier // sqlite3.c:39655:1:
+ *(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&dotlockIoMethods)) + 64)) = unixShmUnmap // sqlite3.c:39655:1:
+ *(*func(*libc.TLS, uintptr, I64, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&dotlockIoMethods)) + 68)) = unixFetch // sqlite3.c:39655:1:
+ *(*func(*libc.TLS, uintptr, I64, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&dotlockIoMethods)) + 72)) = unixUnfetch // sqlite3.c:39655:1:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fts5Mod)) + 4)) = fts5CreateMethod // sqlite3.c:232513:25:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fts5Mod)) + 8)) = fts5ConnectMethod // sqlite3.c:232514:25:
+ *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fts5Mod)) + 12)) = fts5BestIndexMethod // sqlite3.c:232515:25:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fts5Mod)) + 16)) = fts5DisconnectMethod // sqlite3.c:232516:25:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fts5Mod)) + 20)) = fts5DestroyMethod // sqlite3.c:232517:25:
+ *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fts5Mod)) + 24)) = fts5OpenMethod // sqlite3.c:232518:25:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fts5Mod)) + 28)) = fts5CloseMethod // sqlite3.c:232519:25:
+ *(*func(*libc.TLS, uintptr, int32, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fts5Mod)) + 32)) = fts5FilterMethod // sqlite3.c:232520:25:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fts5Mod)) + 36)) = fts5NextMethod // sqlite3.c:232521:25:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fts5Mod)) + 40)) = fts5EofMethod // sqlite3.c:232522:25:
+ *(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fts5Mod)) + 44)) = fts5ColumnMethod // sqlite3.c:232523:25:
+ *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fts5Mod)) + 48)) = fts5RowidMethod // sqlite3.c:232524:25:
+ *(*func(*libc.TLS, uintptr, int32, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fts5Mod)) + 52)) = fts5UpdateMethod // sqlite3.c:232525:25:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fts5Mod)) + 56)) = fts5BeginMethod // sqlite3.c:232526:25:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fts5Mod)) + 60)) = fts5SyncMethod // sqlite3.c:232527:25:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fts5Mod)) + 64)) = fts5CommitMethod // sqlite3.c:232528:25:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fts5Mod)) + 68)) = fts5RollbackMethod // sqlite3.c:232529:25:
+ *(*func(*libc.TLS, uintptr, int32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fts5Mod)) + 72)) = fts5FindFunctionMethod // sqlite3.c:232530:25:
+ *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fts5Mod)) + 76)) = fts5RenameMethod // sqlite3.c:232531:25:
+ *(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fts5Mod)) + 80)) = fts5SavepointMethod // sqlite3.c:232532:25:
+ *(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fts5Mod)) + 84)) = fts5ReleaseMethod // sqlite3.c:232533:25:
+ *(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fts5Mod)) + 88)) = fts5RollbackToMethod // sqlite3.c:232534:25:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fts5Mod)) + 92)) = fts5ShadowName // sqlite3.c:232535:25:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fts5Vocab)) + 4)) = fts5VocabCreateMethod // sqlite3.c:237096:25:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fts5Vocab)) + 8)) = fts5VocabConnectMethod // sqlite3.c:237097:25:
+ *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fts5Vocab)) + 12)) = fts5VocabBestIndexMethod // sqlite3.c:237098:25:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fts5Vocab)) + 16)) = fts5VocabDisconnectMethod // sqlite3.c:237099:25:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fts5Vocab)) + 20)) = fts5VocabDestroyMethod // sqlite3.c:237100:25:
+ *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fts5Vocab)) + 24)) = fts5VocabOpenMethod // sqlite3.c:237101:25:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fts5Vocab)) + 28)) = fts5VocabCloseMethod // sqlite3.c:237102:25:
+ *(*func(*libc.TLS, uintptr, int32, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fts5Vocab)) + 32)) = fts5VocabFilterMethod // sqlite3.c:237103:25:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fts5Vocab)) + 36)) = fts5VocabNextMethod // sqlite3.c:237104:25:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fts5Vocab)) + 40)) = fts5VocabEofMethod // sqlite3.c:237105:25:
+ *(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fts5Vocab)) + 44)) = fts5VocabColumnMethod // sqlite3.c:237106:25:
+ *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fts5Vocab)) + 48)) = fts5VocabRowidMethod // sqlite3.c:237107:25:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&geopolyModule)) + 4)) = geopolyCreate // sqlite3.c:200052:3:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&geopolyModule)) + 8)) = geopolyConnect // sqlite3.c:200053:3:
+ *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&geopolyModule)) + 12)) = geopolyBestIndex // sqlite3.c:200054:3:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&geopolyModule)) + 16)) = rtreeDisconnect // sqlite3.c:200055:3:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&geopolyModule)) + 20)) = rtreeDestroy // sqlite3.c:200056:3:
+ *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&geopolyModule)) + 24)) = rtreeOpen // sqlite3.c:200057:3:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&geopolyModule)) + 28)) = rtreeClose // sqlite3.c:200058:3:
+ *(*func(*libc.TLS, uintptr, int32, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&geopolyModule)) + 32)) = geopolyFilter // sqlite3.c:200059:3:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&geopolyModule)) + 36)) = rtreeNext // sqlite3.c:200060:3:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&geopolyModule)) + 40)) = rtreeEof // sqlite3.c:200061:3:
+ *(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&geopolyModule)) + 44)) = geopolyColumn // sqlite3.c:200062:3:
+ *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&geopolyModule)) + 48)) = rtreeRowid // sqlite3.c:200063:3:
+ *(*func(*libc.TLS, uintptr, int32, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&geopolyModule)) + 52)) = geopolyUpdate // sqlite3.c:200064:3:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&geopolyModule)) + 56)) = rtreeBeginTransaction // sqlite3.c:200065:3:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&geopolyModule)) + 60)) = rtreeEndTransaction // sqlite3.c:200066:3:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&geopolyModule)) + 64)) = rtreeEndTransaction // sqlite3.c:200067:3:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&geopolyModule)) + 68)) = rtreeEndTransaction // sqlite3.c:200068:3:
+ *(*func(*libc.TLS, uintptr, int32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&geopolyModule)) + 72)) = geopolyFindFunction // sqlite3.c:200069:3:
+ *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&geopolyModule)) + 76)) = rtreeRename // sqlite3.c:200070:3:
+ *(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&geopolyModule)) + 80)) = rtreeSavepoint // sqlite3.c:200071:3:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&geopolyModule)) + 92)) = rtreeShadowName // sqlite3.c:200074:3:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&jsonEachModule)) + 8)) = jsonEachConnect // sqlite3.c:193751:3:
+ *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&jsonEachModule)) + 12)) = jsonEachBestIndex // sqlite3.c:193752:3:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&jsonEachModule)) + 16)) = jsonEachDisconnect // sqlite3.c:193753:3:
+ *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&jsonEachModule)) + 24)) = jsonEachOpenEach // sqlite3.c:193755:3:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&jsonEachModule)) + 28)) = jsonEachClose // sqlite3.c:193756:3:
+ *(*func(*libc.TLS, uintptr, int32, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&jsonEachModule)) + 32)) = jsonEachFilter // sqlite3.c:193757:3:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&jsonEachModule)) + 36)) = jsonEachNext // sqlite3.c:193758:3:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&jsonEachModule)) + 40)) = jsonEachEof // sqlite3.c:193759:3:
+ *(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&jsonEachModule)) + 44)) = jsonEachColumn // sqlite3.c:193760:3:
+ *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&jsonEachModule)) + 48)) = jsonEachRowid // sqlite3.c:193761:3:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&jsonTreeModule)) + 8)) = jsonEachConnect // sqlite3.c:193779:3:
+ *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&jsonTreeModule)) + 12)) = jsonEachBestIndex // sqlite3.c:193780:3:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&jsonTreeModule)) + 16)) = jsonEachDisconnect // sqlite3.c:193781:3:
+ *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&jsonTreeModule)) + 24)) = jsonEachOpenTree // sqlite3.c:193783:3:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&jsonTreeModule)) + 28)) = jsonEachClose // sqlite3.c:193784:3:
+ *(*func(*libc.TLS, uintptr, int32, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&jsonTreeModule)) + 32)) = jsonEachFilter // sqlite3.c:193785:3:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&jsonTreeModule)) + 36)) = jsonEachNext // sqlite3.c:193786:3:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&jsonTreeModule)) + 40)) = jsonEachEof // sqlite3.c:193787:3:
+ *(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&jsonTreeModule)) + 44)) = jsonEachColumn // sqlite3.c:193788:3:
+ *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&jsonTreeModule)) + 48)) = jsonEachRowid // sqlite3.c:193789:3:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&memdb_io_methods)) + 4)) = memdbClose // sqlite3.c:48686:3:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, Sqlite3_int64) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&memdb_io_methods)) + 8)) = memdbRead // sqlite3.c:48687:3:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, Sqlite3_int64) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&memdb_io_methods)) + 12)) = memdbWrite // sqlite3.c:48688:3:
+ *(*func(*libc.TLS, uintptr, Sqlite3_int64) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&memdb_io_methods)) + 16)) = memdbTruncate // sqlite3.c:48689:3:
+ *(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&memdb_io_methods)) + 20)) = memdbSync // sqlite3.c:48690:3:
+ *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&memdb_io_methods)) + 24)) = memdbFileSize // sqlite3.c:48691:3:
+ *(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&memdb_io_methods)) + 28)) = memdbLock // sqlite3.c:48692:3:
+ *(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&memdb_io_methods)) + 32)) = memdbLock // sqlite3.c:48693:3:
+ *(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&memdb_io_methods)) + 40)) = memdbFileControl // sqlite3.c:48695:3:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&memdb_io_methods)) + 48)) = memdbDeviceCharacteristics // sqlite3.c:48697:3:
+ *(*func(*libc.TLS, uintptr, Sqlite3_int64, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&memdb_io_methods)) + 68)) = memdbFetch // sqlite3.c:48702:3:
+ *(*func(*libc.TLS, uintptr, Sqlite3_int64, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&memdb_io_methods)) + 72)) = memdbUnfetch // sqlite3.c:48703:3:
+ *(*func(*libc.TLS, uintptr, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&memdb_vfs)) + 24)) = memdbOpen // sqlite3.c:48666:3:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&memdb_vfs)) + 32)) = memdbAccess // sqlite3.c:48668:3:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&memdb_vfs)) + 36)) = memdbFullPathname // sqlite3.c:48669:3:
+ *(*func(*libc.TLS, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&memdb_vfs)) + 40)) = memdbDlOpen // sqlite3.c:48670:3:
+ *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&memdb_vfs)) + 44)) = memdbDlError // sqlite3.c:48671:3:
+ *(*func(*libc.TLS, uintptr, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&memdb_vfs)) + 48)) = memdbDlSym // sqlite3.c:48672:3:
+ *(*func(*libc.TLS, uintptr, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&memdb_vfs)) + 52)) = memdbDlClose // sqlite3.c:48673:3:
+ *(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&memdb_vfs)) + 56)) = memdbRandomness // sqlite3.c:48674:3:
+ *(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&memdb_vfs)) + 60)) = memdbSleep // sqlite3.c:48675:3:
+ *(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&memdb_vfs)) + 68)) = memdbGetLastError // sqlite3.c:48677:3:
+ *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&memdb_vfs)) + 72)) = memdbCurrentTimeInt64 // sqlite3.c:48678:3:
+ *(*func(*libc.TLS, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&nolockIoFinder)) + 0)) = nolockIoFinderImpl // sqlite3.c:39645:1:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&nolockIoMethods)) + 4)) = nolockClose // sqlite3.c:39645:1:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, Sqlite3_int64) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&nolockIoMethods)) + 8)) = unixRead // sqlite3.c:39645:1:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, Sqlite3_int64) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&nolockIoMethods)) + 12)) = unixWrite // sqlite3.c:39645:1:
+ *(*func(*libc.TLS, uintptr, I64) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&nolockIoMethods)) + 16)) = unixTruncate // sqlite3.c:39645:1:
+ *(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&nolockIoMethods)) + 20)) = unixSync // sqlite3.c:39645:1:
+ *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&nolockIoMethods)) + 24)) = unixFileSize // sqlite3.c:39645:1:
+ *(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&nolockIoMethods)) + 28)) = nolockLock // sqlite3.c:39645:1:
+ *(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&nolockIoMethods)) + 32)) = nolockUnlock // sqlite3.c:39645:1:
+ *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&nolockIoMethods)) + 36)) = nolockCheckReservedLock // sqlite3.c:39645:1:
+ *(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&nolockIoMethods)) + 40)) = unixFileControl // sqlite3.c:39645:1:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&nolockIoMethods)) + 44)) = unixSectorSize // sqlite3.c:39645:1:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&nolockIoMethods)) + 48)) = unixDeviceCharacteristics // sqlite3.c:39645:1:
+ *(*func(*libc.TLS, uintptr, int32, int32, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&nolockIoMethods)) + 56)) = unixShmLock // sqlite3.c:39645:1:
+ *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&nolockIoMethods)) + 60)) = unixShmBarrier // sqlite3.c:39645:1:
+ *(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&nolockIoMethods)) + 64)) = unixShmUnmap // sqlite3.c:39645:1:
+ *(*func(*libc.TLS, uintptr, I64, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&nolockIoMethods)) + 68)) = unixFetch // sqlite3.c:39645:1:
+ *(*func(*libc.TLS, uintptr, I64, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&nolockIoMethods)) + 72)) = unixUnfetch // sqlite3.c:39645:1:
+ *(*func(*libc.TLS, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&posixIoFinder)) + 0)) = posixIoFinderImpl // sqlite3.c:39635:1:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&posixIoMethods)) + 4)) = unixClose // sqlite3.c:39635:1:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, Sqlite3_int64) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&posixIoMethods)) + 8)) = unixRead // sqlite3.c:39635:1:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, Sqlite3_int64) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&posixIoMethods)) + 12)) = unixWrite // sqlite3.c:39635:1:
+ *(*func(*libc.TLS, uintptr, I64) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&posixIoMethods)) + 16)) = unixTruncate // sqlite3.c:39635:1:
+ *(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&posixIoMethods)) + 20)) = unixSync // sqlite3.c:39635:1:
+ *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&posixIoMethods)) + 24)) = unixFileSize // sqlite3.c:39635:1:
+ *(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&posixIoMethods)) + 28)) = unixLock // sqlite3.c:39635:1:
+ *(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&posixIoMethods)) + 32)) = unixUnlock // sqlite3.c:39635:1:
+ *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&posixIoMethods)) + 36)) = unixCheckReservedLock // sqlite3.c:39635:1:
+ *(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&posixIoMethods)) + 40)) = unixFileControl // sqlite3.c:39635:1:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&posixIoMethods)) + 44)) = unixSectorSize // sqlite3.c:39635:1:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&posixIoMethods)) + 48)) = unixDeviceCharacteristics // sqlite3.c:39635:1:
+ *(*func(*libc.TLS, uintptr, int32, int32, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&posixIoMethods)) + 52)) = unixShmMap // sqlite3.c:39635:1:
+ *(*func(*libc.TLS, uintptr, int32, int32, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&posixIoMethods)) + 56)) = unixShmLock // sqlite3.c:39635:1:
+ *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&posixIoMethods)) + 60)) = unixShmBarrier // sqlite3.c:39635:1:
+ *(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&posixIoMethods)) + 64)) = unixShmUnmap // sqlite3.c:39635:1:
+ *(*func(*libc.TLS, uintptr, I64, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&posixIoMethods)) + 68)) = unixFetch // sqlite3.c:39635:1:
+ *(*func(*libc.TLS, uintptr, I64, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&posixIoMethods)) + 72)) = unixUnfetch // sqlite3.c:39635:1:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&pragmaVtabModule)) + 8)) = pragmaVtabConnect // sqlite3.c:132153:3:
+ *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&pragmaVtabModule)) + 12)) = pragmaVtabBestIndex // sqlite3.c:132154:3:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&pragmaVtabModule)) + 16)) = pragmaVtabDisconnect // sqlite3.c:132155:3:
+ *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&pragmaVtabModule)) + 24)) = pragmaVtabOpen // sqlite3.c:132157:3:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&pragmaVtabModule)) + 28)) = pragmaVtabClose // sqlite3.c:132158:3:
+ *(*func(*libc.TLS, uintptr, int32, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&pragmaVtabModule)) + 32)) = pragmaVtabFilter // sqlite3.c:132159:3:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&pragmaVtabModule)) + 36)) = pragmaVtabNext // sqlite3.c:132160:3:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&pragmaVtabModule)) + 40)) = pragmaVtabEof // sqlite3.c:132161:3:
+ *(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&pragmaVtabModule)) + 44)) = pragmaVtabColumn // sqlite3.c:132162:3:
+ *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&pragmaVtabModule)) + 48)) = pragmaVtabRowid // sqlite3.c:132163:3:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&rbuvfs_io_methods)) + 4)) = rbuVfsClose // sqlite3.c:206749:5:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, Sqlite_int64) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&rbuvfs_io_methods)) + 8)) = rbuVfsRead // sqlite3.c:206750:5:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, Sqlite_int64) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&rbuvfs_io_methods)) + 12)) = rbuVfsWrite // sqlite3.c:206751:5:
+ *(*func(*libc.TLS, uintptr, Sqlite_int64) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&rbuvfs_io_methods)) + 16)) = rbuVfsTruncate // sqlite3.c:206752:5:
+ *(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&rbuvfs_io_methods)) + 20)) = rbuVfsSync // sqlite3.c:206753:5:
+ *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&rbuvfs_io_methods)) + 24)) = rbuVfsFileSize // sqlite3.c:206754:5:
+ *(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&rbuvfs_io_methods)) + 28)) = rbuVfsLock // sqlite3.c:206755:5:
+ *(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&rbuvfs_io_methods)) + 32)) = rbuVfsUnlock // sqlite3.c:206756:5:
+ *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&rbuvfs_io_methods)) + 36)) = rbuVfsCheckReservedLock // sqlite3.c:206757:5:
+ *(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&rbuvfs_io_methods)) + 40)) = rbuVfsFileControl // sqlite3.c:206758:5:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&rbuvfs_io_methods)) + 44)) = rbuVfsSectorSize // sqlite3.c:206759:5:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&rbuvfs_io_methods)) + 48)) = rbuVfsDeviceCharacteristics // sqlite3.c:206760:5:
+ *(*func(*libc.TLS, uintptr, int32, int32, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&rbuvfs_io_methods)) + 52)) = rbuVfsShmMap // sqlite3.c:206761:5:
+ *(*func(*libc.TLS, uintptr, int32, int32, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&rbuvfs_io_methods)) + 56)) = rbuVfsShmLock // sqlite3.c:206762:5:
+ *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&rbuvfs_io_methods)) + 60)) = rbuVfsShmBarrier // sqlite3.c:206763:5:
+ *(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&rbuvfs_io_methods)) + 64)) = rbuVfsShmUnmap // sqlite3.c:206764:5:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&rtreeModule)) + 4)) = rtreeCreate // sqlite3.c:197387:3:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&rtreeModule)) + 8)) = rtreeConnect // sqlite3.c:197388:3:
+ *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&rtreeModule)) + 12)) = rtreeBestIndex // sqlite3.c:197389:3:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&rtreeModule)) + 16)) = rtreeDisconnect // sqlite3.c:197390:3:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&rtreeModule)) + 20)) = rtreeDestroy // sqlite3.c:197391:3:
+ *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&rtreeModule)) + 24)) = rtreeOpen // sqlite3.c:197392:3:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&rtreeModule)) + 28)) = rtreeClose // sqlite3.c:197393:3:
+ *(*func(*libc.TLS, uintptr, int32, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&rtreeModule)) + 32)) = rtreeFilter // sqlite3.c:197394:3:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&rtreeModule)) + 36)) = rtreeNext // sqlite3.c:197395:3:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&rtreeModule)) + 40)) = rtreeEof // sqlite3.c:197396:3:
+ *(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&rtreeModule)) + 44)) = rtreeColumn // sqlite3.c:197397:3:
+ *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&rtreeModule)) + 48)) = rtreeRowid // sqlite3.c:197398:3:
+ *(*func(*libc.TLS, uintptr, int32, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&rtreeModule)) + 52)) = rtreeUpdate // sqlite3.c:197399:3:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&rtreeModule)) + 56)) = rtreeBeginTransaction // sqlite3.c:197400:3:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&rtreeModule)) + 60)) = rtreeEndTransaction // sqlite3.c:197401:3:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&rtreeModule)) + 64)) = rtreeEndTransaction // sqlite3.c:197402:3:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&rtreeModule)) + 68)) = rtreeEndTransaction // sqlite3.c:197403:3:
+ *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&rtreeModule)) + 76)) = rtreeRename // sqlite3.c:197405:3:
+ *(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&rtreeModule)) + 80)) = rtreeSavepoint // sqlite3.c:197406:3:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&rtreeModule)) + 92)) = rtreeShadowName // sqlite3.c:197409:3:
+ *(*func(*libc.TLS, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sFts5Api)) + 4)) = fts5ApiUserData // sqlite3.c:231972:3:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sFts5Api)) + 8)) = fts5ApiColumnCount // sqlite3.c:231973:3:
+ *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sFts5Api)) + 12)) = fts5ApiRowCount // sqlite3.c:231974:3:
+ *(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sFts5Api)) + 16)) = fts5ApiColumnTotalSize // sqlite3.c:231975:3:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sFts5Api)) + 20)) = fts5ApiTokenize // sqlite3.c:231976:3:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sFts5Api)) + 24)) = fts5ApiPhraseCount // sqlite3.c:231977:3:
+ *(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sFts5Api)) + 28)) = fts5ApiPhraseSize // sqlite3.c:231978:3:
+ *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sFts5Api)) + 32)) = fts5ApiInstCount // sqlite3.c:231979:3:
+ *(*func(*libc.TLS, uintptr, int32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sFts5Api)) + 36)) = fts5ApiInst // sqlite3.c:231980:3:
+ *(*func(*libc.TLS, uintptr) Sqlite3_int64)(unsafe.Pointer(uintptr(unsafe.Pointer(&sFts5Api)) + 40)) = fts5ApiRowid // sqlite3.c:231981:3:
+ *(*func(*libc.TLS, uintptr, int32, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sFts5Api)) + 44)) = fts5ApiColumnText // sqlite3.c:231982:3:
+ *(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sFts5Api)) + 48)) = fts5ApiColumnSize // sqlite3.c:231983:3:
+ *(*func(*libc.TLS, uintptr, int32, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sFts5Api)) + 52)) = fts5ApiQueryPhrase // sqlite3.c:231984:3:
+ *(*func(*libc.TLS, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sFts5Api)) + 56)) = fts5ApiSetAuxdata // sqlite3.c:231985:3:
+ *(*func(*libc.TLS, uintptr, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sFts5Api)) + 60)) = fts5ApiGetAuxdata // sqlite3.c:231986:3:
+ *(*func(*libc.TLS, uintptr, int32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sFts5Api)) + 64)) = fts5ApiPhraseFirst // sqlite3.c:231987:3:
+ *(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&sFts5Api)) + 68)) = fts5ApiPhraseNext // sqlite3.c:231988:3:
+ *(*func(*libc.TLS, uintptr, int32, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sFts5Api)) + 72)) = fts5ApiPhraseFirstColumn // sqlite3.c:231989:3:
+ *(*func(*libc.TLS, uintptr, uintptr, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&sFts5Api)) + 76)) = fts5ApiPhraseNextColumn // sqlite3.c:231990:3:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sMemJournalMethods)) + 4)) = memjrnlClose // sqlite3.c:99197:3:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, Sqlite_int64) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sMemJournalMethods)) + 8)) = memjrnlRead // sqlite3.c:99198:3:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, Sqlite_int64) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sMemJournalMethods)) + 12)) = memjrnlWrite // sqlite3.c:99199:3:
+ *(*func(*libc.TLS, uintptr, Sqlite_int64) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sMemJournalMethods)) + 16)) = memjrnlTruncate // sqlite3.c:99200:3:
+ *(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sMemJournalMethods)) + 20)) = memjrnlSync // sqlite3.c:99201:3:
+ *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sMemJournalMethods)) + 24)) = memjrnlFileSize // sqlite3.c:99202:3:
+ *(*func(*libc.TLS) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sMutex)) + 0)) = noopMutexInit // sqlite3.c:27024:5:
+ *(*func(*libc.TLS) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sMutex)) + 4)) = noopMutexEnd // sqlite3.c:27025:5:
+ *(*func(*libc.TLS, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sMutex)) + 8)) = noopMutexAlloc // sqlite3.c:27026:5:
+ *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&sMutex)) + 12)) = noopMutexFree // sqlite3.c:27027:5:
+ *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&sMutex)) + 16)) = noopMutexEnter // sqlite3.c:27028:5:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sMutex)) + 20)) = noopMutexTry // sqlite3.c:27029:5:
+ *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&sMutex)) + 24)) = noopMutexLeave // sqlite3.c:27030:5:
+ *(*func(*libc.TLS, uintptr, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 0)) = Xsqlite3_aggregate_context // sqlite3.c:128077:3:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 4)) = Xsqlite3_aggregate_count // sqlite3.c:128079:3:
+ *(*func(*libc.TLS, uintptr, int32, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 8)) = Xsqlite3_bind_blob // sqlite3.c:128083:3:
+ *(*func(*libc.TLS, uintptr, int32, float64) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 12)) = Xsqlite3_bind_double // sqlite3.c:128084:3:
+ *(*func(*libc.TLS, uintptr, int32, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 16)) = Xsqlite3_bind_int // sqlite3.c:128085:3:
+ *(*func(*libc.TLS, uintptr, int32, Sqlite_int64) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 20)) = Xsqlite3_bind_int64 // sqlite3.c:128086:3:
+ *(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 24)) = Xsqlite3_bind_null // sqlite3.c:128087:3:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 28)) = Xsqlite3_bind_parameter_count // sqlite3.c:128088:3:
+ *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 32)) = Xsqlite3_bind_parameter_index // sqlite3.c:128089:3:
+ *(*func(*libc.TLS, uintptr, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 36)) = Xsqlite3_bind_parameter_name // sqlite3.c:128090:3:
+ *(*func(*libc.TLS, uintptr, int32, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 40)) = Xsqlite3_bind_text // sqlite3.c:128091:3:
+ *(*func(*libc.TLS, uintptr, int32, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 44)) = Xsqlite3_bind_text16 // sqlite3.c:128092:3:
+ *(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 48)) = Xsqlite3_bind_value // sqlite3.c:128093:3:
+ *(*func(*libc.TLS, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 52)) = Xsqlite3_busy_handler // sqlite3.c:128094:3:
+ *(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 56)) = Xsqlite3_busy_timeout // sqlite3.c:128095:3:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 60)) = Xsqlite3_changes // sqlite3.c:128096:3:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 64)) = Xsqlite3_close // sqlite3.c:128097:3:
+ *(*func(*libc.TLS, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 68)) = Xsqlite3_collation_needed // sqlite3.c:128098:3:
+ *(*func(*libc.TLS, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 72)) = Xsqlite3_collation_needed16 // sqlite3.c:128099:3:
+ *(*func(*libc.TLS, uintptr, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 76)) = Xsqlite3_column_blob // sqlite3.c:128100:3:
+ *(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 80)) = Xsqlite3_column_bytes // sqlite3.c:128101:3:
+ *(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 84)) = Xsqlite3_column_bytes16 // sqlite3.c:128102:3:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 88)) = Xsqlite3_column_count // sqlite3.c:128103:3:
+ *(*func(*libc.TLS, uintptr, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 92)) = Xsqlite3_column_database_name // sqlite3.c:128104:3:
+ *(*func(*libc.TLS, uintptr, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 96)) = Xsqlite3_column_database_name16 // sqlite3.c:128105:3:
+ *(*func(*libc.TLS, uintptr, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 100)) = Xsqlite3_column_decltype // sqlite3.c:128106:3:
+ *(*func(*libc.TLS, uintptr, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 104)) = Xsqlite3_column_decltype16 // sqlite3.c:128107:3:
+ *(*func(*libc.TLS, uintptr, int32) float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 108)) = Xsqlite3_column_double // sqlite3.c:128108:3:
+ *(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 112)) = Xsqlite3_column_int // sqlite3.c:128109:3:
+ *(*func(*libc.TLS, uintptr, int32) Sqlite_int64)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 116)) = Xsqlite3_column_int64 // sqlite3.c:128110:3:
+ *(*func(*libc.TLS, uintptr, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 120)) = Xsqlite3_column_name // sqlite3.c:128111:3:
+ *(*func(*libc.TLS, uintptr, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 124)) = Xsqlite3_column_name16 // sqlite3.c:128112:3:
+ *(*func(*libc.TLS, uintptr, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 128)) = Xsqlite3_column_origin_name // sqlite3.c:128113:3:
+ *(*func(*libc.TLS, uintptr, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 132)) = Xsqlite3_column_origin_name16 // sqlite3.c:128114:3:
+ *(*func(*libc.TLS, uintptr, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 136)) = Xsqlite3_column_table_name // sqlite3.c:128115:3:
+ *(*func(*libc.TLS, uintptr, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 140)) = Xsqlite3_column_table_name16 // sqlite3.c:128116:3:
+ *(*func(*libc.TLS, uintptr, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 144)) = Xsqlite3_column_text // sqlite3.c:128117:3:
+ *(*func(*libc.TLS, uintptr, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 148)) = Xsqlite3_column_text16 // sqlite3.c:128118:3:
+ *(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 152)) = Xsqlite3_column_type // sqlite3.c:128119:3:
+ *(*func(*libc.TLS, uintptr, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 156)) = Xsqlite3_column_value // sqlite3.c:128120:3:
+ *(*func(*libc.TLS, uintptr, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 160)) = Xsqlite3_commit_hook // sqlite3.c:128121:3:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 164)) = Xsqlite3_complete // sqlite3.c:128122:3:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 168)) = Xsqlite3_complete16 // sqlite3.c:128123:3:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 172)) = Xsqlite3_create_collation // sqlite3.c:128124:3:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 176)) = Xsqlite3_create_collation16 // sqlite3.c:128125:3:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, int32, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 180)) = Xsqlite3_create_function // sqlite3.c:128126:3:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, int32, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 184)) = Xsqlite3_create_function16 // sqlite3.c:128127:3:
+ *(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 188)) = Xsqlite3_create_module // sqlite3.c:128128:3:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 192)) = Xsqlite3_data_count // sqlite3.c:128129:3:
+ *(*func(*libc.TLS, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 196)) = Xsqlite3_db_handle // sqlite3.c:128130:3:
+ *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 200)) = Xsqlite3_declare_vtab // sqlite3.c:128131:3:
+ *(*func(*libc.TLS, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 204)) = Xsqlite3_enable_shared_cache // sqlite3.c:128132:3:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 208)) = Xsqlite3_errcode // sqlite3.c:128133:3:
+ *(*func(*libc.TLS, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 212)) = Xsqlite3_errmsg // sqlite3.c:128134:3:
+ *(*func(*libc.TLS, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 216)) = Xsqlite3_errmsg16 // sqlite3.c:128135:3:
+ *(*func(*libc.TLS, uintptr, uintptr, Sqlite3_callback, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 220)) = Xsqlite3_exec // sqlite3.c:128136:3:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 224)) = Xsqlite3_expired // sqlite3.c:128138:3:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 228)) = Xsqlite3_finalize // sqlite3.c:128142:3:
+ *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 232)) = Xsqlite3_free // sqlite3.c:128143:3:
+ *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 236)) = Xsqlite3_free_table // sqlite3.c:128144:3:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 240)) = Xsqlite3_get_autocommit // sqlite3.c:128145:3:
+ *(*func(*libc.TLS, uintptr, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 244)) = Xsqlite3_get_auxdata // sqlite3.c:128146:3:
+ *(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 248)) = Xsqlite3_get_table // sqlite3.c:128147:3:
+ *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 256)) = Xsqlite3_interrupt // sqlite3.c:128149:3:
+ *(*func(*libc.TLS, uintptr) Sqlite3_int64)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 260)) = Xsqlite3_last_insert_rowid // sqlite3.c:128150:3:
+ *(*func(*libc.TLS) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 264)) = Xsqlite3_libversion // sqlite3.c:128151:3:
+ *(*func(*libc.TLS) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 268)) = Xsqlite3_libversion_number // sqlite3.c:128152:3:
+ *(*func(*libc.TLS, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 272)) = Xsqlite3_malloc // sqlite3.c:128153:3:
+ *(*func(*libc.TLS, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 276)) = Xsqlite3_mprintf // sqlite3.c:128154:3:
+ *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 280)) = Xsqlite3_open // sqlite3.c:128155:3:
+ *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 284)) = Xsqlite3_open16 // sqlite3.c:128156:3:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 288)) = Xsqlite3_prepare // sqlite3.c:128157:3:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 292)) = Xsqlite3_prepare16 // sqlite3.c:128158:3:
+ *(*func(*libc.TLS, uintptr, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 296)) = Xsqlite3_profile // sqlite3.c:128159:3:
+ *(*func(*libc.TLS, uintptr, int32, uintptr, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 300)) = Xsqlite3_progress_handler // sqlite3.c:128160:3:
+ *(*func(*libc.TLS, uintptr, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 304)) = Xsqlite3_realloc // sqlite3.c:128161:3:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 308)) = Xsqlite3_reset // sqlite3.c:128162:3:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 312)) = Xsqlite3_result_blob // sqlite3.c:128163:3:
+ *(*func(*libc.TLS, uintptr, float64))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 316)) = Xsqlite3_result_double // sqlite3.c:128164:3:
+ *(*func(*libc.TLS, uintptr, uintptr, int32))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 320)) = Xsqlite3_result_error // sqlite3.c:128165:3:
+ *(*func(*libc.TLS, uintptr, uintptr, int32))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 324)) = Xsqlite3_result_error16 // sqlite3.c:128166:3:
+ *(*func(*libc.TLS, uintptr, int32))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 328)) = Xsqlite3_result_int // sqlite3.c:128167:3:
+ *(*func(*libc.TLS, uintptr, I64))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 332)) = Xsqlite3_result_int64 // sqlite3.c:128168:3:
+ *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 336)) = Xsqlite3_result_null // sqlite3.c:128169:3:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 340)) = Xsqlite3_result_text // sqlite3.c:128170:3:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 344)) = Xsqlite3_result_text16 // sqlite3.c:128171:3:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 348)) = Xsqlite3_result_text16be // sqlite3.c:128172:3:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 352)) = Xsqlite3_result_text16le // sqlite3.c:128173:3:
+ *(*func(*libc.TLS, uintptr, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 356)) = Xsqlite3_result_value // sqlite3.c:128174:3:
+ *(*func(*libc.TLS, uintptr, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 360)) = Xsqlite3_rollback_hook // sqlite3.c:128175:3:
+ *(*func(*libc.TLS, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 364)) = Xsqlite3_set_authorizer // sqlite3.c:128176:3:
+ *(*func(*libc.TLS, uintptr, int32, uintptr, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 368)) = Xsqlite3_set_auxdata // sqlite3.c:128177:3:
+ *(*func(*libc.TLS, int32, uintptr, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 372)) = Xsqlite3_snprintf // sqlite3.c:128178:3:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 376)) = Xsqlite3_step // sqlite3.c:128179:3:
+ *(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr, uintptr, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 380)) = Xsqlite3_table_column_metadata // sqlite3.c:128180:3:
+ *(*func(*libc.TLS))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 384)) = Xsqlite3_thread_cleanup // sqlite3.c:128182:3:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 388)) = Xsqlite3_total_changes // sqlite3.c:128186:3:
+ *(*func(*libc.TLS, uintptr, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 392)) = Xsqlite3_trace // sqlite3.c:128187:3:
+ *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 396)) = Xsqlite3_transfer_bindings // sqlite3.c:128189:3:
+ *(*func(*libc.TLS, uintptr, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 400)) = Xsqlite3_update_hook // sqlite3.c:128193:3:
+ *(*func(*libc.TLS, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 404)) = Xsqlite3_user_data // sqlite3.c:128194:3:
+ *(*func(*libc.TLS, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 408)) = Xsqlite3_value_blob // sqlite3.c:128195:3:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 412)) = Xsqlite3_value_bytes // sqlite3.c:128196:3:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 416)) = Xsqlite3_value_bytes16 // sqlite3.c:128197:3:
+ *(*func(*libc.TLS, uintptr) float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 420)) = Xsqlite3_value_double // sqlite3.c:128198:3:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 424)) = Xsqlite3_value_int // sqlite3.c:128199:3:
+ *(*func(*libc.TLS, uintptr) Sqlite_int64)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 428)) = Xsqlite3_value_int64 // sqlite3.c:128200:3:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 432)) = Xsqlite3_value_numeric_type // sqlite3.c:128201:3:
+ *(*func(*libc.TLS, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 436)) = Xsqlite3_value_text // sqlite3.c:128202:3:
+ *(*func(*libc.TLS, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 440)) = Xsqlite3_value_text16 // sqlite3.c:128203:3:
+ *(*func(*libc.TLS, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 444)) = Xsqlite3_value_text16be // sqlite3.c:128204:3:
+ *(*func(*libc.TLS, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 448)) = Xsqlite3_value_text16le // sqlite3.c:128205:3:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 452)) = Xsqlite3_value_type // sqlite3.c:128206:3:
+ *(*func(*libc.TLS, uintptr, Va_list) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 456)) = Xsqlite3_vmprintf // sqlite3.c:128207:3:
+ *(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 460)) = Xsqlite3_overload_function // sqlite3.c:128216:3:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 464)) = Xsqlite3_prepare_v2 // sqlite3.c:128221:3:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 468)) = Xsqlite3_prepare16_v2 // sqlite3.c:128222:3:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 472)) = Xsqlite3_clear_bindings // sqlite3.c:128223:3:
+ *(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 476)) = Xsqlite3_create_module_v2 // sqlite3.c:128228:3:
+ *(*func(*libc.TLS, uintptr, int32, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 480)) = Xsqlite3_bind_zeroblob // sqlite3.c:128233:3:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 484)) = Xsqlite3_blob_bytes // sqlite3.c:128234:3:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 488)) = Xsqlite3_blob_close // sqlite3.c:128235:3:
+ *(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr, Sqlite_int64, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 492)) = Xsqlite3_blob_open // sqlite3.c:128236:3:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 496)) = Xsqlite3_blob_read // sqlite3.c:128237:3:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 500)) = Xsqlite3_blob_write // sqlite3.c:128238:3:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 504)) = Xsqlite3_create_collation_v2 // sqlite3.c:128239:3:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 508)) = Xsqlite3_file_control // sqlite3.c:128240:3:
+ *(*func(*libc.TLS, int32) Sqlite3_int64)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 512)) = Xsqlite3_memory_highwater // sqlite3.c:128241:3:
+ *(*func(*libc.TLS) Sqlite3_int64)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 516)) = Xsqlite3_memory_used // sqlite3.c:128242:3:
+ *(*func(*libc.TLS, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 520)) = Xsqlite3_mutex_alloc // sqlite3.c:128250:3:
+ *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 524)) = Xsqlite3_mutex_enter // sqlite3.c:128251:3:
+ *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 528)) = Xsqlite3_mutex_free // sqlite3.c:128252:3:
+ *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 532)) = Xsqlite3_mutex_leave // sqlite3.c:128253:3:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 536)) = Xsqlite3_mutex_try // sqlite3.c:128254:3:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 540)) = Xsqlite3_open_v2 // sqlite3.c:128256:3:
+ *(*func(*libc.TLS, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 544)) = Xsqlite3_release_memory // sqlite3.c:128257:3:
+ *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 548)) = Xsqlite3_result_error_nomem // sqlite3.c:128258:3:
+ *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 552)) = Xsqlite3_result_error_toobig // sqlite3.c:128259:3:
+ *(*func(*libc.TLS, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 556)) = Xsqlite3_sleep // sqlite3.c:128260:3:
+ *(*func(*libc.TLS, int32))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 560)) = Xsqlite3_soft_heap_limit // sqlite3.c:128261:3:
+ *(*func(*libc.TLS, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 564)) = Xsqlite3_vfs_find // sqlite3.c:128262:3:
+ *(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 568)) = Xsqlite3_vfs_register // sqlite3.c:128263:3:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 572)) = Xsqlite3_vfs_unregister // sqlite3.c:128264:3:
+ *(*func(*libc.TLS) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 576)) = Xsqlite3_threadsafe // sqlite3.c:128269:3:
+ *(*func(*libc.TLS, uintptr, int32))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 580)) = Xsqlite3_result_zeroblob // sqlite3.c:128270:3:
+ *(*func(*libc.TLS, uintptr, int32))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 584)) = Xsqlite3_result_error_code // sqlite3.c:128271:3:
+ *(*func(*libc.TLS, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 588)) = Xsqlite3_test_control // sqlite3.c:128272:3:
+ *(*func(*libc.TLS, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 592)) = Xsqlite3_randomness // sqlite3.c:128273:3:
+ *(*func(*libc.TLS, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 596)) = Xsqlite3_context_db_handle // sqlite3.c:128274:3:
+ *(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 600)) = Xsqlite3_extended_result_codes // sqlite3.c:128279:3:
+ *(*func(*libc.TLS, uintptr, int32, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 604)) = Xsqlite3_limit // sqlite3.c:128280:3:
+ *(*func(*libc.TLS, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 608)) = Xsqlite3_next_stmt // sqlite3.c:128281:3:
+ *(*func(*libc.TLS, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 612)) = Xsqlite3_sql // sqlite3.c:128282:3:
+ *(*func(*libc.TLS, int32, uintptr, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 616)) = Xsqlite3_status // sqlite3.c:128283:3:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 620)) = Xsqlite3_backup_finish // sqlite3.c:128288:3:
+ *(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 624)) = Xsqlite3_backup_init // sqlite3.c:128289:3:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 628)) = Xsqlite3_backup_pagecount // sqlite3.c:128290:3:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 632)) = Xsqlite3_backup_remaining // sqlite3.c:128291:3:
+ *(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 636)) = Xsqlite3_backup_step // sqlite3.c:128292:3:
+ *(*func(*libc.TLS, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 640)) = Xsqlite3_compileoption_get // sqlite3.c:128294:3:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 644)) = Xsqlite3_compileoption_used // sqlite3.c:128295:3:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, int32, uintptr, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 648)) = Xsqlite3_create_function_v2 // sqlite3.c:128300:3:
+ *(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 652)) = Xsqlite3_db_config // sqlite3.c:128301:3:
+ *(*func(*libc.TLS, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 656)) = Xsqlite3_db_mutex // sqlite3.c:128302:3:
+ *(*func(*libc.TLS, uintptr, int32, uintptr, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 660)) = Xsqlite3_db_status // sqlite3.c:128303:3:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 664)) = Xsqlite3_extended_errcode // sqlite3.c:128304:3:
+ *(*func(*libc.TLS, int32, uintptr, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 668)) = Xsqlite3_log // sqlite3.c:128305:3:
+ *(*func(*libc.TLS, Sqlite3_int64) Sqlite3_int64)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 672)) = Xsqlite3_soft_heap_limit64 // sqlite3.c:128306:3:
+ *(*func(*libc.TLS) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 676)) = Xsqlite3_sourceid // sqlite3.c:128307:3:
+ *(*func(*libc.TLS, uintptr, int32, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 680)) = Xsqlite3_stmt_status // sqlite3.c:128308:3:
+ *(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 684)) = Xsqlite3_strnicmp // sqlite3.c:128309:3:
+ *(*func(*libc.TLS, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 688)) = Xsqlite3_unlock_notify // sqlite3.c:128311:3:
+ *(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 692)) = Xsqlite3_wal_autocheckpoint // sqlite3.c:128316:3:
+ *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 696)) = Xsqlite3_wal_checkpoint // sqlite3.c:128317:3:
+ *(*func(*libc.TLS, uintptr, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 700)) = Xsqlite3_wal_hook // sqlite3.c:128318:3:
+ *(*func(*libc.TLS, uintptr, Sqlite3_int64) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 704)) = Xsqlite3_blob_reopen // sqlite3.c:128324:3:
+ *(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 708)) = Xsqlite3_vtab_config // sqlite3.c:128325:3:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 712)) = Xsqlite3_vtab_on_conflict // sqlite3.c:128326:3:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 716)) = Xsqlite3_close_v2 // sqlite3.c:128327:3:
+ *(*func(*libc.TLS, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 720)) = Xsqlite3_db_filename // sqlite3.c:128328:3:
+ *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 724)) = Xsqlite3_db_readonly // sqlite3.c:128329:3:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 728)) = Xsqlite3_db_release_memory // sqlite3.c:128330:3:
+ *(*func(*libc.TLS, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 732)) = Xsqlite3_errstr // sqlite3.c:128331:3:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 736)) = Xsqlite3_stmt_busy // sqlite3.c:128332:3:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 740)) = Xsqlite3_stmt_readonly // sqlite3.c:128333:3:
+ *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 744)) = Xsqlite3_stricmp // sqlite3.c:128334:3:
+ *(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 748)) = Xsqlite3_uri_boolean // sqlite3.c:128335:3:
+ *(*func(*libc.TLS, uintptr, uintptr, Sqlite3_int64) Sqlite3_int64)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 752)) = Xsqlite3_uri_int64 // sqlite3.c:128336:3:
+ *(*func(*libc.TLS, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 756)) = Xsqlite3_uri_parameter // sqlite3.c:128337:3:
+ *(*func(*libc.TLS, int32, uintptr, uintptr, Va_list) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 760)) = Xsqlite3_vsnprintf // sqlite3.c:128338:3:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 764)) = Xsqlite3_wal_checkpoint_v2 // sqlite3.c:128339:3:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 768)) = Xsqlite3_auto_extension // sqlite3.c:128341:3:
+ *(*func(*libc.TLS, uintptr, int32, uintptr, Sqlite3_uint64, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 772)) = Xsqlite3_bind_blob64 // sqlite3.c:128342:3:
+ *(*func(*libc.TLS, uintptr, int32, uintptr, Sqlite3_uint64, uintptr, uint8) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 776)) = Xsqlite3_bind_text64 // sqlite3.c:128343:3:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 780)) = Xsqlite3_cancel_auto_extension // sqlite3.c:128344:3:
+ *(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 784)) = Xsqlite3_load_extension // sqlite3.c:128345:3:
+ *(*func(*libc.TLS, Sqlite3_uint64) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 788)) = Xsqlite3_malloc64 // sqlite3.c:128346:3:
+ *(*func(*libc.TLS, uintptr) Sqlite3_uint64)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 792)) = Xsqlite3_msize // sqlite3.c:128347:3:
+ *(*func(*libc.TLS, uintptr, Sqlite3_uint64) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 796)) = Xsqlite3_realloc64 // sqlite3.c:128348:3:
+ *(*func(*libc.TLS))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 800)) = Xsqlite3_reset_auto_extension // sqlite3.c:128349:3:
+ *(*func(*libc.TLS, uintptr, uintptr, Sqlite3_uint64, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 804)) = Xsqlite3_result_blob64 // sqlite3.c:128350:3:
+ *(*func(*libc.TLS, uintptr, uintptr, Sqlite3_uint64, uintptr, uint8))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 808)) = Xsqlite3_result_text64 // sqlite3.c:128351:3:
+ *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 812)) = Xsqlite3_strglob // sqlite3.c:128352:3:
*(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 816 /* .value_dup */)) = *(*uintptr)(unsafe.Pointer(&struct {
f func(*libc.TLS, uintptr) uintptr
- }{Xsqlite3_value_dup})) // sqlite3.c:127345:3:
- *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 820 /* .value_free */)) = Xsqlite3_value_free // sqlite3.c:127346:3:
- *(*func(*libc.TLS, uintptr, U64) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 824 /* .result_zeroblob64 */)) = Xsqlite3_result_zeroblob64 // sqlite3.c:127347:3:
- *(*func(*libc.TLS, uintptr, int32, Sqlite3_uint64) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 828 /* .bind_zeroblob64 */)) = Xsqlite3_bind_zeroblob64 // sqlite3.c:127348:3:
- *(*func(*libc.TLS, uintptr) uint32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 832 /* .value_subtype */)) = Xsqlite3_value_subtype // sqlite3.c:127350:3:
- *(*func(*libc.TLS, uintptr, uint32))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 836 /* .result_subtype */)) = Xsqlite3_result_subtype // sqlite3.c:127351:3:
- *(*func(*libc.TLS, int32, uintptr, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 840 /* .status64 */)) = Xsqlite3_status64 // sqlite3.c:127353:3:
- *(*func(*libc.TLS, uintptr, uintptr, uint32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 844 /* .strlike */)) = Xsqlite3_strlike // sqlite3.c:127354:3:
- *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 848 /* .db_cacheflush */)) = Xsqlite3_db_cacheflush // sqlite3.c:127355:3:
- *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 852 /* .system_errno */)) = Xsqlite3_system_errno // sqlite3.c:127357:3:
- *(*func(*libc.TLS, uintptr, uint32, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 856 /* .trace_v2 */)) = Xsqlite3_trace_v2 // sqlite3.c:127359:3:
- *(*func(*libc.TLS, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 860 /* .expanded_sql */)) = Xsqlite3_expanded_sql // sqlite3.c:127360:3:
- *(*func(*libc.TLS, uintptr, Sqlite3_int64))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 864 /* .set_last_insert_rowid */)) = Xsqlite3_set_last_insert_rowid // sqlite3.c:127362:3:
- *(*func(*libc.TLS, uintptr, uintptr, int32, uint32, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 868 /* .prepare_v3 */)) = Xsqlite3_prepare_v3 // sqlite3.c:127364:3:
- *(*func(*libc.TLS, uintptr, uintptr, int32, uint32, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 872 /* .prepare16_v3 */)) = Xsqlite3_prepare16_v3 // sqlite3.c:127365:3:
- *(*func(*libc.TLS, uintptr, int32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 876 /* .bind_pointer */)) = Xsqlite3_bind_pointer // sqlite3.c:127366:3:
- *(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 880 /* .result_pointer */)) = Xsqlite3_result_pointer // sqlite3.c:127367:3:
- *(*func(*libc.TLS, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 884 /* .value_pointer */)) = Xsqlite3_value_pointer // sqlite3.c:127368:3:
- *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 888 /* .vtab_nochange */)) = Xsqlite3_vtab_nochange // sqlite3.c:127370:3:
- *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 892 /* .value_nochange */)) = Xsqlite3_value_nochange // sqlite3.c:127371:3:
- *(*func(*libc.TLS, uintptr, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 896 /* .vtab_collation */)) = Xsqlite3_vtab_collation // sqlite3.c:127372:3:
- *(*func(*libc.TLS) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 900 /* .keyword_count */)) = Xsqlite3_keyword_count // sqlite3.c:127374:3:
- *(*func(*libc.TLS, int32, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 904 /* .keyword_name */)) = Xsqlite3_keyword_name // sqlite3.c:127375:3:
- *(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 908 /* .keyword_check */)) = Xsqlite3_keyword_check // sqlite3.c:127376:3:
- *(*func(*libc.TLS, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 912 /* .str_new */)) = Xsqlite3_str_new // sqlite3.c:127377:3:
- *(*func(*libc.TLS, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 916 /* .str_finish */)) = Xsqlite3_str_finish // sqlite3.c:127378:3:
- *(*func(*libc.TLS, uintptr, uintptr, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 920 /* .str_appendf */)) = Xsqlite3_str_appendf // sqlite3.c:127379:3:
- *(*func(*libc.TLS, uintptr, uintptr, Va_list))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 924 /* .str_vappendf */)) = Xsqlite3_str_vappendf // sqlite3.c:127380:3:
- *(*func(*libc.TLS, uintptr, uintptr, int32))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 928 /* .str_append */)) = Xsqlite3_str_append // sqlite3.c:127381:3:
- *(*func(*libc.TLS, uintptr, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 932 /* .str_appendall */)) = Xsqlite3_str_appendall // sqlite3.c:127382:3:
- *(*func(*libc.TLS, uintptr, int32, uint8))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 936 /* .str_appendchar */)) = Xsqlite3_str_appendchar // sqlite3.c:127383:3:
- *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 940 /* .str_reset */)) = Xsqlite3_str_reset // sqlite3.c:127384:3:
- *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 944 /* .str_errcode */)) = Xsqlite3_str_errcode // sqlite3.c:127385:3:
- *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 948 /* .str_length */)) = Xsqlite3_str_length // sqlite3.c:127386:3:
- *(*func(*libc.TLS, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 952 /* .str_value */)) = Xsqlite3_str_value // sqlite3.c:127387:3:
- *(*func(*libc.TLS, uintptr, uintptr, int32, int32, uintptr, uintptr, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 956 /* .create_window_function */)) = Xsqlite3_create_window_function // sqlite3.c:127389:3:
- *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 964 /* .stmt_isexplain */)) = Xsqlite3_stmt_isexplain // sqlite3.c:127397:3:
- *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 968 /* .value_frombind */)) = Xsqlite3_value_frombind // sqlite3.c:127398:3:
- *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 972 /* .drop_modules */)) = Xsqlite3_drop_modules // sqlite3.c:127401:3:
- *(*func(*libc.TLS, Sqlite3_int64) Sqlite3_int64)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 976 /* .hard_heap_limit64 */)) = Xsqlite3_hard_heap_limit64 // sqlite3.c:127406:3:
- *(*func(*libc.TLS, uintptr, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 980 /* .uri_key */)) = Xsqlite3_uri_key // sqlite3.c:127407:3:
- *(*func(*libc.TLS, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 984 /* .filename_database */)) = Xsqlite3_filename_database // sqlite3.c:127408:3:
- *(*func(*libc.TLS, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 988 /* .filename_journal */)) = Xsqlite3_filename_journal // sqlite3.c:127409:3:
- *(*func(*libc.TLS, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 992 /* .filename_wal */)) = Xsqlite3_filename_wal // sqlite3.c:127410:3:
- *(*func(*libc.TLS, uintptr, uintptr, uintptr, int32, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 996 /* .create_filename */)) = Xsqlite3_create_filename // sqlite3.c:127412:3:
- *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1000 /* .free_filename */)) = Xsqlite3_free_filename // sqlite3.c:127413:3:
- *(*func(*libc.TLS, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1004 /* .database_file_object */)) = Xsqlite3_database_file_object // sqlite3.c:127414:3:
- *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1008 /* .txn_state */)) = Xsqlite3_txn_state // sqlite3.c:127416:3:
- *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3BuiltinExtensions)) + 0)) = Xsqlite3Fts5Init // sqlite3.c:165154:3:
- *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3BuiltinExtensions)) + 4)) = Xsqlite3RtreeInit // sqlite3.c:165160:3:
- *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3BuiltinExtensions)) + 8)) = sqlite3TestExtInit // sqlite3.c:165168:3:
- *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3BuiltinExtensions)) + 12)) = Xsqlite3Json1Init // sqlite3.c:165170:3:
- *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&statGetFuncdef)) + 16 /* .xSFunc */)) = statGet // sqlite3.c:110531:3:
- *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&statInitFuncdef)) + 16 /* .xSFunc */)) = statInit // sqlite3.c:110089:3:
- *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&statPushFuncdef)) + 16 /* .xSFunc */)) = statPush // sqlite3.c:110379:3:
- *(*func(*libc.TLS, uintptr, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&vfs_template)) + 24 /* .xOpen */)) = rbuVfsOpen // sqlite3.c:205283:5:
- *(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&vfs_template)) + 28 /* .xDelete */)) = rbuVfsDelete // sqlite3.c:205284:5:
- *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&vfs_template)) + 32 /* .xAccess */)) = rbuVfsAccess // sqlite3.c:205285:5:
- *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&vfs_template)) + 36 /* .xFullPathname */)) = rbuVfsFullPathname // sqlite3.c:205286:5:
- *(*func(*libc.TLS, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&vfs_template)) + 40 /* .xDlOpen */)) = rbuVfsDlOpen // sqlite3.c:205289:5:
- *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&vfs_template)) + 44 /* .xDlError */)) = rbuVfsDlError // sqlite3.c:205290:5:
- *(*func(*libc.TLS, uintptr, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&vfs_template)) + 48 /* .xDlSym */)) = rbuVfsDlSym // sqlite3.c:205291:5:
- *(*func(*libc.TLS, uintptr, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&vfs_template)) + 52 /* .xDlClose */)) = rbuVfsDlClose // sqlite3.c:205292:5:
- *(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&vfs_template)) + 56 /* .xRandomness */)) = rbuVfsRandomness // sqlite3.c:205297:5:
- *(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&vfs_template)) + 60 /* .xSleep */)) = rbuVfsSleep // sqlite3.c:205298:5:
- *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&vfs_template)) + 64 /* .xCurrentTime */)) = rbuVfsCurrentTime // sqlite3.c:205299:5:
- *(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&vfs_template)) + 68 /* .xGetLastError */)) = rbuVfsGetLastError // sqlite3.c:205300:5:
-}
-
-var ts1 = "COMPILER=gcc-8.3.0\x00ENABLE_COLUMN_METADATA\x00ENABLE_FTS5\x00ENABLE_GEOPOLY\x00ENABLE_JSON1\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\x00MUTEX_NOOP\x00SOUNDEX\x00SYSTEM_MALLOC\x00THREADSAFE=1\x003.36.0\x00BINARY\x0020b:20e\x0020c:20e\x0020e\x0040f-21a-21d\x00now\x00local time unavailable\x00second\x00minute\x00hour\x00day\x00month\x00year\x00localtime\x00unixepoch\x00utc\x00weekday \x00start of \x00%04d-%02d-%02d %02d:%02d:%02d\x00%02d:%02d:%02d\x00%04d-%02d-%02d\x00%02d\x00%06.3f\x00%03d\x00%.16g\x00%04d\x00julianday\x00date\x00time\x00datetime\x00strftime\x00current_time\x00current_timestamp\x00current_date\x00failed to allocate %u bytes of memory\x00failed memory resize %u to %u bytes\x000123456789ABCDEF0123456789abcdef\x00-x0\x00X0\x00%\x00NaN\x00Inf\x00\x00NULL\x00(NULL)\x00.\x00SUBQUERY %u\x00thstndrd\x00922337203685477580\x00API call with %s database connection pointer\x00unopened\x00invalid\x00Savepoint\x00AutoCommit\x00Transaction\x00SorterNext\x00Prev\x00Next\x00Checkpoint\x00JournalMode\x00Vacuum\x00VFilter\x00VUpdate\x00Goto\x00Gosub\x00InitCoroutine\x00Yield\x00MustBeInt\x00Jump\x00Once\x00If\x00Not\x00IfNot\x00IfNullRow\x00SeekLT\x00SeekLE\x00SeekGE\x00SeekGT\x00IfNotOpen\x00IfNoHope\x00NoConflict\x00NotFound\x00Found\x00SeekRowid\x00NotExists\x00Last\x00IfSmaller\x00SorterSort\x00Sort\x00Rewind\x00IdxLE\x00IdxGT\x00IdxLT\x00IdxGE\x00RowSetRead\x00Or\x00And\x00RowSetTest\x00Program\x00FkIfZero\x00IfPos\x00IfNotZero\x00IsNull\x00NotNull\x00Ne\x00Eq\x00Gt\x00Le\x00Lt\x00Ge\x00ElseEq\x00DecrJumpZero\x00IncrVacuum\x00VNext\x00Init\x00PureFunc\x00Function\x00Return\x00EndCoroutine\x00HaltIfNull\x00Halt\x00Integer\x00Int64\x00String\x00Null\x00SoftNull\x00Blob\x00Variable\x00Move\x00Copy\x00SCopy\x00IntCopy\x00ChngCntRow\x00ResultRow\x00CollSeq\x00AddImm\x00RealAffinity\x00Cast\x00Permutation\x00Compare\x00IsTrue\x00ZeroOrNull\x00Offset\x00Column\x00Affinity\x00MakeRecord\x00Count\x00ReadCookie\x00SetCookie\x00ReopenIdx\x00OpenRead\x00OpenWrite\x00OpenDup\x00OpenAutoindex\x00BitAnd\x00BitOr\x00ShiftLeft\x00ShiftRight\x00Add\x00Subtract\x00Multiply\x00Divide\x00Remainder\x00Concat\x00OpenEphemeral\x00BitNot\x00SorterOpen\x00SequenceTest\x00String8\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\x00IntegrityCk\x00RowSetAdd\x00Real\x00Param\x00FkCounter\x00MemMax\x00OffsetLimit\x00AggInverse\x00AggStep\x00AggStep1\x00AggValue\x00AggFinal\x00Expire\x00CursorLock\x00CursorUnlock\x00TableLock\x00VBegin\x00VCreate\x00VDestroy\x00VOpen\x00VColumn\x00VRename\x00Pagecount\x00MaxPgcnt\x00Trace\x00CursorHint\x00ReleaseReg\x00Noop\x00Explain\x00Abortable\x00open\x00close\x00access\x00getcwd\x00stat\x00fstat\x00ftruncate\x00fcntl\x00read\x00pread\x00pread64\x00write\x00pwrite\x00pwrite64\x00fchmod\x00fallocate\x00unlink\x00openDirectory\x00mkdir\x00rmdir\x00fchown\x00geteuid\x00mmap\x00munmap\x00mremap\x00getpagesize\x00readlink\x00lstat\x00ioctl\x00attempt to open \"%s\" as file descriptor %d\x00/dev/null\x00os_unix.c:%d: (%d) %s(%s) - %s\x00cannot fstat db file %s\x00file unlinked while open: %s\x00multiple links to file: %s\x00file renamed while open: %s\x00%s\x00full_fsync\x00%s-shm\x00readonly_shm\x00psow\x00unix-excl\x00%s.lock\x00SQLITE_TMPDIR\x00TMPDIR\x00/var/tmp\x00/usr/tmp\x00/tmp\x00%s/etilqs_%llx%c\x00modeof\x00fsync\x00/dev/urandom\x00unix\x00unix-none\x00unix-dotfile\x00memdb\x00memdb(%p,%lld)\x00PRAGMA \"%w\".page_count\x00ATTACH x AS %Q\x00recovered %d pages from %s\x00-journal\x00-wal\x00nolock\x00immutable\x00recovered %d frames from WAL file %s\x00cannot limit WAL size: %s\x00SQLite format 3\x00:memory:\x00@ \x00\n\x00invalid page number %d\x002nd reference to page %d\x00Failed to read ptrmap key=%d\x00Bad ptr map entry key=%d expected=(%d,%d) got=(%d,%d)\x00failed to get page %d\x00freelist leaf count too big on page %d\x00%s is %d but should be %d\x00size\x00overflow list length\x00Page %u: \x00unable to get the page. error code=%d\x00btreeInitPage() returns error code %d\x00free space corruption\x00On tree page %u cell %d: \x00On page %u at right child: \x00Offset %d out of range %d..%d\x00Extends off end of page\x00Rowid %lld out of order\x00Child page depth differs\x00Multiple uses for byte %u of page %u\x00Fragmentation of %d bytes reported as %d on page %u\x00Main freelist: \x00max rootpage (%d) disagrees with header (%d)\x00incremental_vacuum enabled with a max rootpage of zero\x00Page %d is never used\x00Pointer map page %d is referenced\x00unknown database %s\x00destination database is in use\x00source and destination must be distinct\x00%!.15g\x00-\x00%s%s\x00k(%d\x00B\x00,%s%s%s\x00N.\x00)\x00%.18s-%s\x00%s(%d)\x00%lld\x00%d\x00(blob)\x00vtab:%p\x00%c%u\x00]\x00program\x00?\x008\x0016LE\x0016BE\x00addr\x00opcode\x00p1\x00p2\x00p3\x00p4\x00p5\x00comment\x00id\x00parent\x00notused\x00detail\x00%.4c%s%.16c\x00MJ delete: %s\x00MJ collide: %s\x00-mj%06X9%02X\x00FOREIGN KEY constraint failed\x00a CHECK constraint\x00a generated column\x00an index\x00non-deterministic use of %s() in %s\x00API called with finalized prepared statement\x00API called with NULL prepared statement\x00string or blob too big\x00bind on a busy prepared statement: [%s]\x00-- \x00'%.*q'\x00zeroblob(%d)\x00x'\x00%02x\x00'\x00%s constraint failed\x00%z: %s\x00abort at %d in [%s]: %s\x00cannot open savepoint - SQL statements in progress\x00no such savepoint: %s\x00cannot release savepoint - SQL statements in progress\x00cannot commit transaction - SQL statements in progress\x00cannot start a transaction within a transaction\x00cannot rollback - no transaction is active\x00cannot commit - no transaction is active\x00database schema has changed\x00index corruption\x00sqlite_master\x00SELECT*FROM\"%w\".%s WHERE %s ORDER BY rowid\x00too many levels of trigger recursion\x00cannot change %s wal mode from within a transaction\x00into\x00out of\x00database table is locked: %s\x00-- %s\x00statement aborts at %d: [%s] %s\x00out of memory\x00NOT NULL\x00UNIQUE\x00CHECK\x00FOREIGN KEY\x00cannot open value of type %s\x00null\x00real\x00integer\x00no such rowid: %lld\x00cannot open virtual table: %s\x00cannot open table without rowid: %s\x00cannot open view: %s\x00no such column: \"%s\"\x00foreign key\x00indexed\x00cannot open %s column for writing\x00main\x00new\x00old\x00excluded\x00misuse of aliased aggregate %s\x00misuse of aliased window function %s\x00row value misused\x00double-quoted string literal: \"%w\"\x00no such column\x00ambiguous column name\x00%s: %s.%s.%s\x00%s: %s.%s\x00%s: %s\x00partial index WHERE clauses\x00index expressions\x00CHECK constraints\x00generated columns\x00%s prohibited in %s\x00true\x00false\x00the \".\" operator\x00second argument to likelihood() must be a constant between 0.0 and 1.0\x00not authorized to use function: %s\x00non-deterministic functions\x00%.*s() may not be used as a window function\x00window\x00aggregate\x00misuse of %s function %.*s()\x00no such function: %.*s\x00wrong number of arguments to function %.*s()\x00FILTER may not be used with non-aggregate %.*s()\x00subqueries\x00parameters\x00%r %s BY term out of range - should be between 1 and %d\x00too many terms in ORDER BY clause\x00ORDER\x00%r ORDER BY term does not match any column in the result set\x00too many terms in %s BY clause\x00a GROUP BY clause is required before HAVING\x00GROUP\x00aggregate functions are not allowed in the GROUP BY clause\x00Expression tree is too large (maximum depth %d)\x000\x00too many arguments on function %T\x00unsafe use of %s()\x00variable number must be between ?1 and ?%d\x00too many SQL variables\x00%d columns assigned %d values\x00too many columns in %s\x00_ROWID_\x00ROWID\x00OID\x00USING ROWID SEARCH ON TABLE %s FOR IN-OPERATOR\x00USING INDEX %s FOR IN-OPERATOR\x00sub-select returns %d columns - expected %d\x00REUSE LIST SUBQUERY %d\x00%sLIST SUBQUERY %d\x00CORRELATED \x00REUSE SUBQUERY %d\x00%sSCALAR SUBQUERY %d\x001\x000x\x00hex literal too big: %s%s\x00generated column loop on \"%s\"\x00misuse of aggregate: %s()\x00unknown function: %s()\x00RAISE() may only be used within a trigger-program\x00B\x00C\x00D\x00E\x00sqlite_\x00table %s may not be altered\x00SELECT 1 FROM \"%w\".sqlite_master WHERE name NOT LIKE 'sqliteX_%%' ESCAPE 'X' AND sql NOT LIKE 'create virtual%%' AND sqlite_rename_test(%Q, sql, type, name, %d, %Q, %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\x00virtual tables may not be altered\x00Cannot add a column to a view\x00sqlite_altertab_%s\x00view\x00virtual table\x00cannot %s %s \"%s\"\x00drop column from\x00rename columns of\x00UPDATE \"%w\".sqlite_master SET sql = sqlite_rename_column(sql, type, name, %Q, %Q, %d, %Q, %d, %d) WHERE name NOT LIKE 'sqliteX_%%' ESCAPE 'X' AND (type != 'index' OR tbl_name = %Q) AND sql NOT LIKE 'create virtual%%'\x00UPDATE temp.sqlite_master SET sql = sqlite_rename_column(sql, type, name, %Q, %Q, %d, %Q, %d, 1) WHERE type IN ('trigger', 'view')\x00error in %s %s%s%s: %s\x00 \x00\"%w\" \x00%Q%s\x00%.*s%s\x00cannot drop %s column: \"%s\"\x00PRIMARY KEY\x00cannot drop column \"%s\": no other columns exist\x00UPDATE \"%w\".sqlite_master SET sql = sqlite_drop_column(%d, sql, %d) WHERE (type=='table' AND tbl_name=%Q COLLATE nocase)\x00after drop column\x00sqlite_rename_column\x00sqlite_rename_table\x00sqlite_rename_test\x00sqlite_drop_column\x00sqlite_rename_quotefix\x00CREATE TABLE %Q.%s(%s)\x00DELETE FROM %Q.%s WHERE %s=%Q\x00DELETE FROM %Q.%s\x00sqlite_stat1\x00tbl,idx,stat\x00sqlite_stat4\x00tbl,idx,neq,nlt,ndlt,sample\x00sqlite_stat3\x00stat_init\x00stat_push\x00%llu\x00 %llu\x00%llu \x00stat_get\x00sqlite\\_%\x00BBB\x00idx\x00tbl\x00unordered*\x00sz=[0-9]*\x00noskipscan*\x00SELECT idx,count(*) FROM %Q.sqlite_stat4 GROUP BY idx\x00SELECT idx,neq,nlt,ndlt,sample FROM %Q.sqlite_stat4\x00SELECT tbl,idx,stat FROM %Q.sqlite_stat1\x00x\x00\x00too many attached databases - max %d\x00database %s is already in use\x00database is already attached\x00attached databases must use the same text encoding as main database\x00unable to open database: %s\x00no such database: %s\x00cannot detach database %s\x00database %s is locked\x00sqlite_detach\x00sqlite_attach\x00%s cannot use variables\x00%s %T cannot reference objects in database %s\x00authorizer malfunction\x00%s.%s\x00%s.%z\x00access to %z is prohibited\x00not authorized\x00sqlite_temp_schema\x00sqlite_schema\x00sqlite_temp_master\x00pragma_\x00no such view\x00no such table\x00corrupt database\x00unknown database %T\x00object name reserved for internal use: %s\x00temporary table name must be unqualified\x00table %T already exists\x00there is already an index named %s\x00sqlite_returning\x00cannot use RETURNING in a trigger\x00too many columns on %s\x00duplicate column name: %s\x00default value of column [%s] is not constant\x00cannot use DEFAULT on a generated column\x00generated columns cannot be part of the PRIMARY KEY\x00table \"%s\" has more than one primary key\x00INTEGER\x00AUTOINCREMENT is only allowed on an INTEGER PRIMARY KEY\x00virtual tables cannot use computed columns\x00virtual\x00stored\x00error in generated column \"%s\"\x00,\x00\n \x00,\n \x00\n)\x00CREATE TABLE \x00 TEXT\x00 NUM\x00 INT\x00 REAL\x00AUTOINCREMENT not allowed on WITHOUT ROWID tables\x00PRIMARY KEY missing on table %s\x00must have at least one non-generated column\x00TABLE\x00VIEW\x00CREATE %s %.*s\x00UPDATE %Q.sqlite_master SET type='%s', name=%Q, tbl_name=%Q, rootpage=#%d, sql=%Q WHERE rowid=#%d\x00CREATE TABLE %Q.sqlite_sequence(name,seq)\x00tbl_name='%q' AND type!='trigger'\x00parameters are not allowed in views\x00view %s is circularly defined\x00corrupt schema\x00UPDATE %Q.sqlite_master SET rootpage=%d WHERE #%d AND rootpage=#%d\x00sqlite_stat%d\x00DELETE FROM %Q.sqlite_sequence WHERE name=%Q\x00DELETE FROM %Q.sqlite_master WHERE tbl_name=%Q and type!='trigger'\x00table %s may not be dropped\x00use DROP TABLE to delete table %s\x00use DROP VIEW to delete view %s\x00foreign key on %s should reference only one column of table %T\x00number of columns in foreign key does not match the number of columns in the referenced table\x00unknown column \"%s\" in foreign key definition\x00unsupported use of NULLS %s\x00FIRST\x00LAST\x00index\x00cannot create a TEMP index on non-TEMP table \"%s\"\x00table %s may not be indexed\x00views may not be indexed\x00virtual tables may not be indexed\x00there is already a table named %s\x00index %s already exists\x00sqlite_autoindex_%s_%d\x00expressions prohibited in PRIMARY KEY and UNIQUE constraints\x00conflicting ON CONFLICT clauses specified\x00invalid rootpage\x00CREATE%s INDEX %.*s\x00 UNIQUE\x00INSERT INTO %Q.sqlite_master VALUES('index',%Q,%Q,#%d,%Q);\x00name='%q' AND type='index'\x00no such index: %S\x00index associated with UNIQUE or PRIMARY KEY constraint cannot be dropped\x00DELETE FROM %Q.sqlite_master WHERE name=%Q AND type='index'\x00too many FROM clause terms, max: %d\x00a JOIN clause is required before %s\x00ON\x00USING\x00BEGIN\x00ROLLBACK\x00COMMIT\x00RELEASE\x00unable to open a temporary database file for storing temporary tables\x00index '%q'\x00, \x00%s.rowid\x00unable to identify the object to be reindexed\x00duplicate WITH table name: %s\x00no such collation sequence: %s\x00table %s may not be modified\x00cannot modify %s because it is a view\x00rows deleted\x00text\x00blob\x00integer overflow\x00%.*f\x00LIKE or GLOB pattern too complex\x00ESCAPE expression must be a single character\x00%!.20e\x00?000\x00MATCH\x00like\x00implies_nonnull_row\x00expr_compare\x00expr_implies_expr\x00soundex\x00load_extension\x00sqlite_compileoption_used\x00sqlite_compileoption_get\x00unlikely\x00likelihood\x00likely\x00sqlite_offset\x00ltrim\x00rtrim\x00trim\x00min\x00max\x00typeof\x00length\x00instr\x00printf\x00unicode\x00char\x00abs\x00round\x00upper\x00lower\x00hex\x00ifnull\x00random\x00randomblob\x00nullif\x00sqlite_version\x00sqlite_source_id\x00sqlite_log\x00quote\x00last_insert_rowid\x00changes\x00total_changes\x00replace\x00zeroblob\x00substr\x00substring\x00sum\x00total\x00avg\x00count\x00group_concat\x00glob\x00coalesce\x00sign\x00iif\x00foreign key mismatch - \"%w\" referencing \"%w\"\x00cannot INSERT into generated column \"%s\"\x00table %S has no column named %s\x00table %S has %d columns but %d values were supplied\x00%d values for %d columns\x00UPSERT not implemented for virtual table \"%s\"\x00cannot UPSERT a view\x00rows inserted\x00sqlite3_extension_init\x00sqlite3_\x00lib\x00_init\x00no entry point [%s] in shared library [%s]\x00error during initialization: %s\x00unable to open shared library [%.*s]\x00so\x00automatic extension loading failed: %s\x00seq\x00from\x00to\x00on_update\x00on_delete\x00match\x00cid\x00name\x00type\x00notnull\x00dflt_value\x00pk\x00hidden\x00seqno\x00desc\x00coll\x00key\x00builtin\x00enc\x00narg\x00flags\x00wdth\x00hght\x00flgs\x00unique\x00origin\x00partial\x00rowid\x00fkid\x00file\x00busy\x00log\x00checkpointed\x00database\x00status\x00cache_size\x00timeout\x00analysis_limit\x00application_id\x00auto_vacuum\x00automatic_index\x00busy_timeout\x00cache_spill\x00case_sensitive_like\x00cell_size_check\x00checkpoint_fullfsync\x00collation_list\x00compile_options\x00count_changes\x00data_version\x00database_list\x00default_cache_size\x00defer_foreign_keys\x00empty_result_callbacks\x00encoding\x00foreign_key_check\x00foreign_key_list\x00foreign_keys\x00freelist_count\x00full_column_names\x00fullfsync\x00function_list\x00hard_heap_limit\x00ignore_check_constraints\x00incremental_vacuum\x00index_info\x00index_list\x00index_xinfo\x00integrity_check\x00journal_mode\x00journal_size_limit\x00legacy_alter_table\x00locking_mode\x00max_page_count\x00mmap_size\x00module_list\x00optimize\x00page_count\x00page_size\x00pragma_list\x00query_only\x00quick_check\x00read_uncommitted\x00recursive_triggers\x00reverse_unordered_selects\x00schema_version\x00secure_delete\x00short_column_names\x00shrink_memory\x00soft_heap_limit\x00synchronous\x00table_info\x00table_xinfo\x00temp_store\x00temp_store_directory\x00threads\x00trusted_schema\x00user_version\x00wal_autocheckpoint\x00wal_checkpoint\x00writable_schema\x00onoffalseyestruextrafull\x00exclusive\x00normal\x00none\x00full\x00incremental\x00memory\x00temporary storage cannot be changed from within a transaction\x00SET NULL\x00SET DEFAULT\x00CASCADE\x00RESTRICT\x00NO ACTION\x00delete\x00persist\x00off\x00truncate\x00wal\x00w\x00a\x00s\x00sissii\x00utf8\x00utf16le\x00utf16be\x00-%T\x00fast\x00not a writable directory\x00Safety level may not be changed inside a transaction\x00issisii\x00issisi\x00iisX\x00isiX\x00c\x00u\x00isisi\x00iss\x00is\x00iissssss\x00NONE\x00siX\x00*** in database %s ***\n\x00NULL value in %s.%s\x00CHECK constraint failed in %s\x00row \x00 missing from index \x00non-unique entry in index \x00wrong # of entries in index \x00ok\x00unsupported encoding: %s\x00restart\x00ANALYZE \"%w\".\"%w\"\x00UTF8\x00UTF-8\x00UTF-16le\x00UTF-16be\x00UTF16le\x00UTF16be\x00UTF-16\x00UTF16\x00CREATE TABLE x\x00%c\"%s\"\x00(\"%s\"\x00,arg HIDDEN\x00,schema HIDDEN\x00PRAGMA \x00%Q.\x00=%Q\x00error in %s %s after %s: %s\x00rename\x00drop column\x00malformed database schema (%s)\x00%z - %s\x00orphan index\x00CREATE TABLE x(type text,name text,tbl_name text,rootpage int,sql text)\x00unsupported file format\x00SELECT*FROM\"%w\".%s ORDER BY rowid\x00database schema is locked: %s\x00statement too long\x00unknown or unsupported join type: %T %T%s%T\x00RIGHT and FULL OUTER JOINs are not currently supported\x00naturaleftouterightfullinnercross\x00a NATURAL join may not have an ON or USING clause\x00cannot have both ON and USING clauses in the same join\x00cannot join using column %s - column not present in both tables\x00UNION ALL\x00INTERSECT\x00EXCEPT\x00UNION\x00USE TEMP B-TREE FOR %s\x00column%d\x00%.*z:%u\x00cannot use window functions in recursive queries\x00recursive aggregate queries not supported\x00SETUP\x00RECURSIVE STEP\x00SCAN %d CONSTANT ROW%s\x00S\x00COMPOUND QUERY\x00LEFT-MOST SUBQUERY\x00%s USING TEMP B-TREE\x00all VALUES must have the same number of terms\x00SELECTs to the left and right of %s do not have the same number of result columns\x00MERGE (%s)\x00LEFT\x00RIGHT\x00no such index: %s\x00'%s' is not a function\x00multiple references to recursive table: %s\x00circular reference: %s\x00table %s has %d values for %d columns\x00multiple recursive references: %s\x00recursive reference in a subquery: %s\x00subquery_%u\x00too many references to \"%s\": max 65535\x00access to view \"%s\" prohibited\x00unsafe use of virtual table \"%s\"\x00*\x00%s.%s.%s\x00no such table: %s\x00no tables specified\x00too many columns in result set\x00DISTINCT aggregates must have exactly one argument\x00USE TEMP B-TREE FOR %s(DISTINCT)\x00SCAN %s%s%s\x00 USING COVERING INDEX \x00target object/alias may not appear in FROM clause: %s\x00expected %d columns for '%s' but got %d\x00CO-ROUTINE %!S\x00MATERIALIZE %!S\x00DISTINCT\x00GROUP BY\x00RIGHT PART OF ORDER BY\x00ORDER BY\x00sqlite3_get_table() called with two or more incompatible queries\x00temporary trigger may not have qualified name\x00trigger\x00cannot create triggers on virtual tables\x00trigger %T already exists\x00cannot create trigger on system table\x00cannot create %s trigger on view: %S\x00BEFORE\x00AFTER\x00cannot create INSTEAD OF trigger on table: %S\x00INSERT INTO %Q.sqlite_master VALUES('trigger',%Q,%Q,0,'CREATE TRIGGER %q')\x00type='trigger' AND name='%q'\x00no such trigger: %S\x00DELETE FROM %Q.sqlite_master WHERE name=%Q AND type='trigger'\x00%s RETURNING is not available on virtual tables\x00DELETE\x00UPDATE\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\x00<expr>\x00 AND \x00(\x00 (\x00%s=?\x00ANY(%s)\x00>\x00<\x00%s %S\x00SEARCH\x00SCAN\x00AUTOMATIC PARTIAL COVERING INDEX\x00AUTOMATIC COVERING INDEX\x00COVERING INDEX %s\x00INDEX %s\x00 USING \x00=\x00>? AND rowid<\x00 USING INTEGER PRIMARY KEY (rowid%s?)\x00 VIRTUAL TABLE INDEX %d:%s\x00MULTI-INDEX OR\x00INDEX %d\x00regexp\x00ON clause references tables to its right\x00NOCASE\x00too many arguments on %s() - max %d\x00automatic index on %s(%s)\x00auto-index\x00%s.xBestIndex malfunction\x00abbreviated query algorithm search\x00no query solution\x00at most %d tables in a join\x00SCAN CONSTANT ROW\x00second argument to nth_value must be a positive integer\x00argument of ntile must be a positive integer\x00row_number\x00dense_rank\x00rank\x00percent_rank\x00cume_dist\x00ntile\x00last_value\x00nth_value\x00first_value\x00lead\x00lag\x00no such window: %s\x00RANGE with offset PRECEDING/FOLLOWING requires one ORDER BY expression\x00FILTER clause may only be used with aggregate window functions\x00unsupported frame specification\x00PARTITION clause\x00ORDER BY clause\x00frame specification\x00cannot override %s of window: %s\x00DISTINCT is not supported for window functions\x00frame starting offset must be a non-negative integer\x00frame ending offset must be a non-negative integer\x00frame starting offset must be a non-negative number\x00frame ending offset must be a non-negative number\x00%s clause should come after %s not before\x00LIMIT\x00too many terms in compound SELECT\x00syntax error after column name \"%.*s\"\x00parser stack overflow\x00unknown table option: %.*s\x00set list\x00near \"%T\": syntax error\x00qualified table names are not allowed on INSERT, UPDATE, and DELETE statements within triggers\x00the INDEXED BY clause is not allowed on UPDATE or DELETE statements within triggers\x00the NOT INDEXED clause is not allowed on UPDATE or DELETE statements within triggers\x00incomplete input\x00unrecognized token: \"%.*s\"\x00%s in \"%s\"\x00create\x00temp\x00temporary\x00end\x00explain\x00unable to close due to unfinalized statements or unfinished backups\x00unknown error\x00abort due to ROLLBACK\x00another row available\x00no more rows available\x00not an error\x00SQL logic error\x00access permission denied\x00query aborted\x00database is locked\x00database table is locked\x00attempt to write a readonly database\x00interrupted\x00disk I/O error\x00database disk image is malformed\x00unknown operation\x00database or disk is full\x00unable to open database file\x00locking protocol\x00constraint failed\x00datatype mismatch\x00bad parameter or other API misuse\x00authorization denied\x00column index out of range\x00file is not a database\x00notification message\x00warning message\x00unable to delete/modify user-function due to active statements\x00unable to use function %s in the requested context\x00unknown database: %s\x00unable to delete/modify collation sequence due to active statements\x00file:\x00localhost\x00invalid uri authority: %.*s\x00vfs\x00cache\x00mode\x00no such %s mode: %s\x00%s mode not allowed: %s\x00no such vfs: %s\x00shared\x00private\x00ro\x00rw\x00rwc\x00RTRIM\x00\x00\x00\x00%s at line %d of [%.10s]\x00database corruption\x00misuse\x00cannot open file\x00no such table column: %s.%s\x00SQLITE_\x00database is deadlocked\x00array\x00object\x000123456789abcdef\x00JSON cannot hold BLOB values\x00malformed JSON\x00[0]\x00JSON path error near '%q'\x00json_%s() needs an odd number of arguments\x00json_object() requires an even number of arguments\x00json_object() labels must be TEXT\x00set\x00insert\x00[]\x00{}\x00CREATE TABLE x(key,value,type,atom,id,parent,fullkey,path,json HIDDEN,root HIDDEN)\x00[%d]\x00.%.*s\x00$\x00json\x00json_array\x00json_array_length\x00json_extract\x00json_insert\x00json_object\x00json_patch\x00json_quote\x00json_remove\x00json_replace\x00json_set\x00json_type\x00json_valid\x00json_group_array\x00json_group_object\x00json_each\x00json_tree\x00%s_node\x00data\x00DROP TABLE '%q'.'%q_node';DROP TABLE '%q'.'%q_rowid';DROP TABLE '%q'.'%q_parent';\x00RtreeMatchArg\x00SELECT * FROM %Q.%Q\x00UNIQUE constraint failed: %s.%s\x00rtree constraint failed: %s.(%s<=%s)\x00ALTER TABLE %Q.'%q_node' RENAME TO \"%w_node\";ALTER TABLE %Q.'%q_parent' RENAME TO \"%w_parent\";ALTER TABLE %Q.'%q_rowid' RENAME TO \"%w_rowid\";\x00SELECT stat FROM %Q.sqlite_stat1 WHERE tbl = '%q_rowid'\x00node\x00CREATE TABLE \"%w\".\"%w_rowid\"(rowid INTEGER PRIMARY KEY,nodeno\x00,a%d\x00);CREATE TABLE \"%w\".\"%w_node\"(nodeno INTEGER PRIMARY KEY,data);\x00CREATE TABLE \"%w\".\"%w_parent\"(nodeno INTEGER PRIMARY KEY,parentnode);\x00INSERT INTO \"%w\".\"%w_node\"VALUES(1,zeroblob(%d))\x00INSERT INTO\"%w\".\"%w_rowid\"(rowid,nodeno)VALUES(?1,?2)ON CONFLICT(rowid)DO UPDATE SET nodeno=excluded.nodeno\x00SELECT * FROM \"%w\".\"%w_rowid\" WHERE rowid=?1\x00UPDATE \"%w\".\"%w_rowid\"SET \x00a%d=coalesce(?%d,a%d)\x00a%d=?%d\x00 WHERE rowid=?1\x00INSERT OR REPLACE INTO '%q'.'%q_node' VALUES(?1, ?2)\x00DELETE FROM '%q'.'%q_node' WHERE nodeno = ?1\x00SELECT nodeno FROM '%q'.'%q_rowid' WHERE rowid = ?1\x00INSERT OR REPLACE INTO '%q'.'%q_rowid' VALUES(?1, ?2)\x00DELETE FROM '%q'.'%q_rowid' WHERE rowid = ?1\x00SELECT parentnode FROM '%q'.'%q_parent' WHERE nodeno = ?1\x00INSERT OR REPLACE INTO '%q'.'%q_parent' VALUES(?1, ?2)\x00DELETE FROM '%q'.'%q_parent' WHERE nodeno = ?1\x00PRAGMA %Q.page_size\x00SELECT length(data) FROM '%q'.'%q_node' WHERE nodeno = 1\x00undersize RTree blobs in \"%q_node\"\x00Wrong number of columns for an rtree table\x00Too few columns for an rtree table\x00Too many columns for an rtree table\x00Auxiliary rtree columns must be last\x00CREATE TABLE x(%.*s INT\x00,%.*s\x00);\x00,%.*s REAL\x00,%.*s INT\x00{%lld\x00 %g\x00}\x00Invalid argument to rtreedepth()\x00%z%s%z\x00SELECT data FROM %Q.'%q_node' WHERE nodeno=?\x00Node %lld missing from database\x00SELECT parentnode FROM %Q.'%q_parent' WHERE nodeno=?1\x00SELECT nodeno FROM %Q.'%q_rowid' WHERE rowid=?1\x00Mapping (%lld -> %lld) missing from %s table\x00%_rowid\x00%_parent\x00Found (%lld -> %lld) in %s table, expected (%lld -> %lld)\x00Dimension %d of cell %d on node %lld is corrupt\x00Dimension %d of cell %d on node %lld is corrupt relative to parent\x00Node %lld is too small (%d bytes)\x00Rtree depth out of range (%d)\x00Node %lld is too small for cell count of %d (%d bytes)\x00SELECT count(*) FROM %Q.'%q%s'\x00Wrong number of entries in %%%s table - expected %lld, actual %lld\x00SELECT * FROM %Q.'%q_rowid'\x00Schema corrupt or not an rtree\x00_rowid\x00_parent\x00END\x00wrong number of arguments to function rtreecheck()\x00[\x00[%!g,%!g],\x00[%!g,%!g]]\x00<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\x00geopoly_area\x00geopoly_blob\x00geopoly_json\x00geopoly_svg\x00geopoly_contains_point\x00geopoly_debug\x00geopoly_bbox\x00geopoly_xform\x00geopoly_regular\x00geopoly_ccw\x00geopoly_group_bbox\x00rtreenode\x00rtreedepth\x00rtreecheck\x00rtree_i32\x00corrupt fossil delta\x00DROP TRIGGER IF EXISTS temp.rbu_insert_tr;DROP TRIGGER IF EXISTS temp.rbu_update1_tr;DROP TRIGGER IF EXISTS temp.rbu_update2_tr;DROP TRIGGER IF EXISTS temp.rbu_delete_tr;\x00SELECT rbu_target_name(name, type='view') AS target, name FROM sqlite_schema WHERE type IN ('table', 'view') AND target IS NOT NULL %s ORDER BY name\x00AND rootpage!=0 AND rootpage IS NOT NULL\x00SELECT name, rootpage, sql IS NULL OR substr(8, 6)=='UNIQUE' FROM main.sqlite_schema WHERE type='index' AND tbl_name = ?\x00SELECT (sql LIKE 'create virtual%%'), rootpage FROM sqlite_schema WHERE name=%Q\x00PRAGMA index_list=%Q\x00SELECT rootpage FROM sqlite_schema WHERE name = %Q\x00PRAGMA table_info=%Q\x00PRAGMA main.index_list = %Q\x00PRAGMA main.index_xinfo = %Q\x00SELECT * FROM '%q'\x00rbu_\x00rbu_rowid\x00table %q %s rbu_rowid column\x00may not have\x00requires\x00PRAGMA table_info(%Q)\x00column missing from %q: %s\x00%z%s\"%w\"\x00%z%s%s\"%w\"%s\x00SELECT max(_rowid_) FROM \"%s%w\"\x00 WHERE _rowid_ > %lld \x00 DESC\x00quote(\x00||','||\x00SELECT %s FROM \"%s%w\" ORDER BY %s LIMIT 1\x00 WHERE (%s) > (%s) \x00_rowid_\x00%z%s \"%w\" COLLATE %Q\x00%z%s \"rbu_imp_%d%w\" COLLATE %Q DESC\x00%z%s quote(\"rbu_imp_%d%w\")\x00SELECT %s FROM \"rbu_imp_%w\" ORDER BY %s LIMIT 1\x00%z%s%s\x00(%s) > (%s)\x00%z%s(%.*s) COLLATE %Q\x00%z%s\"%w\" COLLATE %Q\x00%z%s\"rbu_imp_%d%w\"%s\x00%z%s\"rbu_imp_%d%w\" %s COLLATE %Q\x00%z%s\"rbu_imp_%d%w\" IS ?\x00%z%s%s.\"%w\"\x00%z%sNULL\x00%z, %s._rowid_\x00_rowid_ = ?%d\x00%z%sc%d=?%d\x00_rowid_ = (SELECT id FROM rbu_imposter2 WHERE %z)\x00%z%s\"%w\"=?%d\x00invalid rbu_control value\x00%z%s\"%w\"=rbu_delta(\"%w\", ?%d)\x00%z%s\"%w\"=rbu_fossil_delta(\"%w\", ?%d)\x00PRIMARY KEY(\x00%z%s\"%w\"%s\x00%z)\x00SELECT name FROM sqlite_schema WHERE rootpage = ?\x00%z%sc%d %s COLLATE %Q\x00%z%sc%d%s\x00%z, id INTEGER\x00CREATE TABLE rbu_imposter2(%z, PRIMARY KEY(%z)) WITHOUT ROWID\x00PRIMARY KEY \x00%z%s\"%w\" %s %sCOLLATE %Q%s\x00 NOT NULL\x00%z, %z\x00CREATE TABLE \"rbu_imp_%w\"(%z)%s\x00 WITHOUT ROWID\x00INSERT INTO %s.'rbu_tmp_%q'(rbu_control,%s%s) VALUES(%z)\x00SELECT trim(sql) FROM sqlite_schema WHERE type='index' AND name=?\x00 LIMIT -1 OFFSET %d\x00CREATE TABLE \"rbu_imp_%w\"( %s, PRIMARY KEY( %s ) ) WITHOUT ROWID\x00INSERT INTO \"rbu_imp_%w\" VALUES(%s)\x00DELETE FROM \"rbu_imp_%w\" WHERE %s\x00SELECT %s, 0 AS rbu_control FROM '%q' %s %s %s ORDER BY %s%s\x00AND\x00WHERE\x00SELECT %s, rbu_control FROM %s.'rbu_tmp_%q' %s ORDER BY %s%s\x00SELECT %s, rbu_control FROM %s.'rbu_tmp_%q' %s UNION ALL SELECT %s, rbu_control FROM '%q' %s %s typeof(rbu_control)='integer' AND rbu_control!=1 ORDER BY %s%s\x00rbu_imp_\x00INSERT INTO \"%s%w\"(%s%s) VALUES(%s)\x00, _rowid_\x00DELETE FROM \"%s%w\" WHERE %s\x00, rbu_rowid\x00CREATE TABLE IF NOT EXISTS %s.'rbu_tmp_%q' AS SELECT *%s FROM '%q' WHERE 0;\x00, 0 AS rbu_rowid\x00CREATE TEMP TRIGGER rbu_delete_tr BEFORE DELETE ON \"%s%w\" BEGIN SELECT rbu_tmp_insert(3, %s);END;CREATE TEMP TRIGGER rbu_update1_tr BEFORE UPDATE ON \"%s%w\" BEGIN SELECT rbu_tmp_insert(3, %s);END;CREATE TEMP TRIGGER rbu_update2_tr AFTER UPDATE ON \"%s%w\" BEGIN SELECT rbu_tmp_insert(4, %s);END;\x00CREATE TEMP TRIGGER rbu_insert_tr AFTER INSERT ON \"%s%w\" BEGIN SELECT rbu_tmp_insert(0, %s);END;\x00,_rowid_ \x00,rbu_rowid\x00SELECT %s,%s rbu_control%s FROM '%q'%s %s %s %s\x000 AS \x00UPDATE \"%s%w\" SET %s WHERE %s\x00SELECT k, v FROM %s.rbu_state\x00file://%s-vacuum?modeof=%s\x00ATTACH %Q AS stat\x00CREATE TABLE IF NOT EXISTS %s.rbu_state(k INTEGER PRIMARY KEY, v)\x00cannot vacuum wal mode database\x00file:%s-vactmp?rbu_memory=1%s%s\x00&\x00rbu_tmp_insert\x00rbu_fossil_delta\x00rbu_target_name\x00SELECT * FROM sqlite_schema\x00rbu vfs not found\x00PRAGMA main.wal_checkpoint=restart\x00%s-oal\x00%s-wal\x00PRAGMA schema_version\x00PRAGMA schema_version = %d\x00INSERT OR REPLACE INTO %s.rbu_state(k, v) VALUES (%d, %d), (%d, %Q), (%d, %Q), (%d, %d), (%d, %d), (%d, %lld), (%d, %lld), (%d, %lld), (%d, %lld), (%d, %Q) \x00PRAGMA main.%s\x00PRAGMA main.%s = %d\x00PRAGMA writable_schema=1\x00SELECT sql FROM sqlite_schema WHERE sql!='' AND rootpage!=0 AND name!='sqlite_sequence' ORDER BY type DESC\x00SELECT * FROM sqlite_schema WHERE rootpage=0 OR rootpage IS NULL\x00INSERT INTO sqlite_schema VALUES(?,?,?,?,?)\x00PRAGMA writable_schema=0\x00DELETE FROM %s.'rbu_tmp_%q'\x00rbu_state mismatch error\x00rbu_vfs_%d\x00SELECT count(*) FROM sqlite_schema WHERE type='index' AND tbl_name = %Q\x00rbu_index_cnt\x00SELECT 1 FROM sqlite_schema WHERE tbl_name = 'rbu_count'\x00SELECT sum(cnt * (1 + rbu_index_cnt(rbu_target_name(tbl))))FROM rbu_count\x00cannot update wal mode database\x00database modified during rbu %s\x00vacuum\x00update\x00BEGIN IMMEDIATE\x00PRAGMA journal_mode=off\x00-vactmp\x00DELETE FROM stat.rbu_state\x00rbu/zipvfs setup error\x00rbu(%s)/%z\x00rbu_memory\x00SELECT 0, 'tbl', '', 0, '', 1 UNION ALL SELECT 1, 'idx', '', 0, '', 2 UNION ALL SELECT 2, 'stat', '', 0, '', 0\x00PRAGMA '%q'.table_info('%q')\x00%z%s\"%w\".\"%w\".\"%w\"=\"%w\".\"%w\".\"%w\"\x00%z%s\"%w\".\"%w\".\"%w\" IS NOT \"%w\".\"%w\".\"%w\"\x00 OR \x00SELECT * FROM \"%w\".\"%w\" WHERE NOT EXISTS ( SELECT 1 FROM \"%w\".\"%w\" WHERE %s)\x00SELECT * FROM \"%w\".\"%w\", \"%w\".\"%w\" WHERE %s AND (%z)\x00table schemas do not match\x00SELECT tbl, ?2, stat FROM %Q.sqlite_stat1 WHERE tbl IS ?1 AND idx IS (CASE WHEN ?2=X'' THEN NULL ELSE ?2 END)\x00SELECT * FROM \x00 WHERE \x00 IS ?\x00SAVEPOINT changeset\x00RELEASE changeset\x00UPDATE main.\x00 SET \x00 = ?\x00idx IS CASE WHEN length(?4)=0 AND typeof(?4)='blob' THEN NULL ELSE ?4 END \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\x00content_rowid\x00multiple content_rowid=... directives\x00columnsize\x00malformed columnsize=... directive\x00columns\x00malformed detail=... directive\x00unrecognized option: \"%.*s\"\x00reserved fts5 column name: %s\x00unindexed\x00unrecognized column option: %s\x00T.%Q\x00, T.%Q\x00, T.c%d\x00reserved fts5 table name: %s\x00parse error in \"%s\"\x00docsize\x00%Q.'%q_%s'\x00CREATE TABLE x(\x00%z%s%Q\x00%z, %Q HIDDEN, %s HIDDEN)\x00pgsz\x00hashsize\x00automerge\x00usermerge\x00crisismerge\x00SELECT k, v FROM %Q.'%q_config'\x00version\x00invalid fts5 file format (found %d, expected %d) - run 'rebuild'\x00unterminated string\x00fts5: syntax error near \"%.1s\"\x00OR\x00NOT\x00NEAR\x00expected integer, got \"%.*s\"\x00fts5: column queries are not supported (detail=none)\x00fts5: %s queries are not supported (detail!=full)\x00phrase\x00block\x00REPLACE INTO '%q'.'%q_data'(id, block) VALUES(?,?)\x00DELETE FROM '%q'.'%q_data' WHERE id>=? AND id<=?\x00DELETE FROM '%q'.'%q_idx' WHERE segid=?\x00PRAGMA %Q.data_version\x00SELECT pgno FROM '%q'.'%q_idx' WHERE segid=? AND term<=? ORDER BY term DESC LIMIT 1\x00INSERT INTO '%q'.'%q_idx'(segid,term,pgno) VALUES(?,?,?)\x00%s_data\x00id INTEGER PRIMARY KEY, block BLOB\x00segid, term, pgno, PRIMARY KEY(segid, term)\x00SELECT segid, term, (pgno>>1), (pgno&1) FROM %Q.'%q_idx' WHERE segid=%d ORDER BY 1, 2\x00\x00\x00\x00\x00\x00recursively defined fts5 content table\x00SELECT rowid, rank FROM %Q.%Q ORDER BY %s(\"%w\"%s%s) %s\x00DESC\x00ASC\x00reads\x00unknown special query: %.*s\x00SELECT %s\x00no such function: %s\x00parse error in rank function: %s\x00%s: table does not support scanning\x00delete-all\x00'delete-all' may only be used with a contentless or external content fts5 table\x00rebuild\x00'rebuild' may not be used with a contentless fts5 table\x00merge\x00integrity-check\x00cannot %s contentless fts5 table: %s\x00DELETE from\x00no such cursor: %lld\x00no such tokenizer: %s\x00error in tokenizer constructor\x00fts5_api_ptr\x00fts5: 2021-06-18 18:36:39 5c9a6c06871cb9fe42814af9c039eb6da5427a6ec28f187af7ebfb62eafa66e5\x00config\x00fts5\x00fts5_source_id\x00SELECT %s FROM %s T WHERE T.%Q >= ? AND T.%Q <= ? ORDER BY T.%Q ASC\x00SELECT %s FROM %s T WHERE T.%Q <= ? AND T.%Q >= ? ORDER BY T.%Q DESC\x00SELECT %s FROM %s T WHERE T.%Q=?\x00INSERT INTO %Q.'%q_content' VALUES(%s)\x00REPLACE INTO %Q.'%q_content' VALUES(%s)\x00DELETE FROM %Q.'%q_content' WHERE id=?\x00REPLACE INTO %Q.'%q_docsize' VALUES(?,?)\x00DELETE FROM %Q.'%q_docsize' WHERE id=?\x00SELECT sz FROM %Q.'%q_docsize' WHERE id=?\x00REPLACE INTO %Q.'%q_config' VALUES(?,?)\x00SELECT %s FROM %s AS T\x00DROP TABLE IF EXISTS %Q.'%q_data';DROP TABLE IF EXISTS %Q.'%q_idx';DROP TABLE IF EXISTS %Q.'%q_config';\x00DROP TABLE IF EXISTS %Q.'%q_docsize';\x00DROP TABLE IF EXISTS %Q.'%q_content';\x00ALTER TABLE %Q.'%q_%s' RENAME TO '%q_%s';\x00CREATE TABLE %Q.'%q_%q'(%s)%s\x00fts5: error creating shadow table %q_%s: %s\x00id INTEGER PRIMARY KEY\x00, c%d\x00id INTEGER PRIMARY KEY, sz BLOB\x00k PRIMARY KEY, v\x00DELETE FROM %Q.'%q_data';DELETE FROM %Q.'%q_idx';\x00DELETE FROM %Q.'%q_docsize';\x00SELECT count(*) FROM %Q.'%q_%s'\x00tokenchars\x00separators\x00L* N* Co\x00categories\x00remove_diacritics\x00unicode61\x00al\x00ance\x00ence\x00er\x00ic\x00able\x00ible\x00ant\x00ement\x00ment\x00ent\x00ion\x00ou\x00ism\x00ate\x00iti\x00ous\x00ive\x00ize\x00at\x00bl\x00ble\x00iz\x00ational\x00tional\x00tion\x00enci\x00anci\x00izer\x00logi\x00bli\x00alli\x00entli\x00eli\x00e\x00ousli\x00ization\x00ation\x00ator\x00alism\x00iveness\x00fulness\x00ful\x00ousness\x00aliti\x00iviti\x00biliti\x00ical\x00ness\x00icate\x00iciti\x00ative\x00alize\x00eed\x00ee\x00ed\x00ing\x00case_sensitive\x00ascii\x00porter\x00trigram\x00col\x00row\x00instance\x00fts5vocab: unknown table type: %Q\x00CREATE TABlE vocab(term, col, doc, cnt)\x00CREATE TABlE vocab(term, doc, cnt)\x00CREATE TABlE vocab(term, doc, col, offset)\x00wrong number of vtable arguments\x00recursive definition for %s.%s\x00SELECT t.%Q FROM %Q.%Q AS t WHERE t.%Q MATCH '*id'\x00no such fts5 table: %s.%s\x00fts5vocab\x002021-06-18 18:36:39 5c9a6c06871cb9fe42814af9c039eb6da5427a6ec28f187af7ebfb62eafa66e5\x00"
+ }{Xsqlite3_value_dup})) // sqlite3.c:128354:3:
+ *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 820)) = Xsqlite3_value_free // sqlite3.c:128355:3:
+ *(*func(*libc.TLS, uintptr, U64) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 824)) = Xsqlite3_result_zeroblob64 // sqlite3.c:128356:3:
+ *(*func(*libc.TLS, uintptr, int32, Sqlite3_uint64) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 828)) = Xsqlite3_bind_zeroblob64 // sqlite3.c:128357:3:
+ *(*func(*libc.TLS, uintptr) uint32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 832)) = Xsqlite3_value_subtype // sqlite3.c:128359:3:
+ *(*func(*libc.TLS, uintptr, uint32))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 836)) = Xsqlite3_result_subtype // sqlite3.c:128360:3:
+ *(*func(*libc.TLS, int32, uintptr, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 840)) = Xsqlite3_status64 // sqlite3.c:128362:3:
+ *(*func(*libc.TLS, uintptr, uintptr, uint32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 844)) = Xsqlite3_strlike // sqlite3.c:128363:3:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 848)) = Xsqlite3_db_cacheflush // sqlite3.c:128364:3:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 852)) = Xsqlite3_system_errno // sqlite3.c:128366:3:
+ *(*func(*libc.TLS, uintptr, uint32, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 856)) = Xsqlite3_trace_v2 // sqlite3.c:128368:3:
+ *(*func(*libc.TLS, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 860)) = Xsqlite3_expanded_sql // sqlite3.c:128369:3:
+ *(*func(*libc.TLS, uintptr, Sqlite3_int64))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 864)) = Xsqlite3_set_last_insert_rowid // sqlite3.c:128371:3:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, uint32, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 868)) = Xsqlite3_prepare_v3 // sqlite3.c:128373:3:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, uint32, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 872)) = Xsqlite3_prepare16_v3 // sqlite3.c:128374:3:
+ *(*func(*libc.TLS, uintptr, int32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 876)) = Xsqlite3_bind_pointer // sqlite3.c:128375:3:
+ *(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 880)) = Xsqlite3_result_pointer // sqlite3.c:128376:3:
+ *(*func(*libc.TLS, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 884)) = Xsqlite3_value_pointer // sqlite3.c:128377:3:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 888)) = Xsqlite3_vtab_nochange // sqlite3.c:128379:3:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 892)) = Xsqlite3_value_nochange // sqlite3.c:128380:3:
+ *(*func(*libc.TLS, uintptr, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 896)) = Xsqlite3_vtab_collation // sqlite3.c:128381:3:
+ *(*func(*libc.TLS) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 900)) = Xsqlite3_keyword_count // sqlite3.c:128383:3:
+ *(*func(*libc.TLS, int32, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 904)) = Xsqlite3_keyword_name // sqlite3.c:128384:3:
+ *(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 908)) = Xsqlite3_keyword_check // sqlite3.c:128385:3:
+ *(*func(*libc.TLS, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 912)) = Xsqlite3_str_new // sqlite3.c:128386:3:
+ *(*func(*libc.TLS, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 916)) = Xsqlite3_str_finish // sqlite3.c:128387:3:
+ *(*func(*libc.TLS, uintptr, uintptr, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 920)) = Xsqlite3_str_appendf // sqlite3.c:128388:3:
+ *(*func(*libc.TLS, uintptr, uintptr, Va_list))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 924)) = Xsqlite3_str_vappendf // sqlite3.c:128389:3:
+ *(*func(*libc.TLS, uintptr, uintptr, int32))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 928)) = Xsqlite3_str_append // sqlite3.c:128390:3:
+ *(*func(*libc.TLS, uintptr, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 932)) = Xsqlite3_str_appendall // sqlite3.c:128391:3:
+ *(*func(*libc.TLS, uintptr, int32, uint8))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 936)) = Xsqlite3_str_appendchar // sqlite3.c:128392:3:
+ *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 940)) = Xsqlite3_str_reset // sqlite3.c:128393:3:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 944)) = Xsqlite3_str_errcode // sqlite3.c:128394:3:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 948)) = Xsqlite3_str_length // sqlite3.c:128395:3:
+ *(*func(*libc.TLS, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 952)) = Xsqlite3_str_value // sqlite3.c:128396:3:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, int32, uintptr, uintptr, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 956)) = Xsqlite3_create_window_function // sqlite3.c:128398:3:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 964)) = Xsqlite3_stmt_isexplain // sqlite3.c:128406:3:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 968)) = Xsqlite3_value_frombind // sqlite3.c:128407:3:
+ *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 972)) = Xsqlite3_drop_modules // sqlite3.c:128410:3:
+ *(*func(*libc.TLS, Sqlite3_int64) Sqlite3_int64)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 976)) = Xsqlite3_hard_heap_limit64 // sqlite3.c:128415:3:
+ *(*func(*libc.TLS, uintptr, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 980)) = Xsqlite3_uri_key // sqlite3.c:128416:3:
+ *(*func(*libc.TLS, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 984)) = Xsqlite3_filename_database // sqlite3.c:128417:3:
+ *(*func(*libc.TLS, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 988)) = Xsqlite3_filename_journal // sqlite3.c:128418:3:
+ *(*func(*libc.TLS, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 992)) = Xsqlite3_filename_wal // sqlite3.c:128419:3:
+ *(*func(*libc.TLS, uintptr, uintptr, uintptr, int32, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 996)) = Xsqlite3_create_filename // sqlite3.c:128421:3:
+ *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1000)) = Xsqlite3_free_filename // sqlite3.c:128422:3:
+ *(*func(*libc.TLS, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1004)) = Xsqlite3_database_file_object // sqlite3.c:128423:3:
+ *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1008)) = Xsqlite3_txn_state // sqlite3.c:128425:3:
+ *(*func(*libc.TLS, uintptr) Sqlite3_int64)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1012)) = Xsqlite3_changes64 // sqlite3.c:128427:3:
+ *(*func(*libc.TLS, uintptr) Sqlite3_int64)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1016)) = Xsqlite3_total_changes64 // sqlite3.c:128428:3:
+ *(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1020)) = Xsqlite3_autovacuum_pages // sqlite3.c:128430:3:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3BuiltinExtensions)) + 0)) = Xsqlite3Fts5Init // sqlite3.c:166629:3:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3BuiltinExtensions)) + 4)) = Xsqlite3RtreeInit // sqlite3.c:166635:3:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3BuiltinExtensions)) + 8)) = sqlite3TestExtInit // sqlite3.c:166643:3:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3BuiltinExtensions)) + 12)) = Xsqlite3Json1Init // sqlite3.c:166645:3:
+ *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&statGetFuncdef)) + 16)) = statGet // sqlite3.c:111132:3:
+ *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&statInitFuncdef)) + 16)) = statInit // sqlite3.c:110708:3:
+ *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&statPushFuncdef)) + 16)) = statPush // sqlite3.c:110998:3:
+ *(*func(*libc.TLS, uintptr, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&vfs_template)) + 24)) = rbuVfsOpen // sqlite3.c:207006:5:
+ *(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&vfs_template)) + 28)) = rbuVfsDelete // sqlite3.c:207007:5:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&vfs_template)) + 32)) = rbuVfsAccess // sqlite3.c:207008:5:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&vfs_template)) + 36)) = rbuVfsFullPathname // sqlite3.c:207009:5:
+ *(*func(*libc.TLS, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&vfs_template)) + 40)) = rbuVfsDlOpen // sqlite3.c:207012:5:
+ *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&vfs_template)) + 44)) = rbuVfsDlError // sqlite3.c:207013:5:
+ *(*func(*libc.TLS, uintptr, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&vfs_template)) + 48)) = rbuVfsDlSym // sqlite3.c:207014:5:
+ *(*func(*libc.TLS, uintptr, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&vfs_template)) + 52)) = rbuVfsDlClose // sqlite3.c:207015:5:
+ *(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&vfs_template)) + 56)) = rbuVfsRandomness // sqlite3.c:207020:5:
+ *(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&vfs_template)) + 60)) = rbuVfsSleep // sqlite3.c:207021:5:
+ *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&vfs_template)) + 64)) = rbuVfsCurrentTime // sqlite3.c:207022:5:
+ *(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&vfs_template)) + 68)) = rbuVfsGetLastError // sqlite3.c:207023:5:
+}
+
+var ts1 = "3.37.0\x00ATOMIC_INTRINSICS=1\x00COMPILER=gcc-10.2.1 20210110\x00DEFAULT_AUTOVACUUM\x00DEFAULT_CACHE_SIZE=-2000\x00DEFAULT_FILE_FORMAT=4\x00DEFAULT_JOURNAL_SIZE_LIMIT=-1\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\x00ENABLE_COLUMN_METADATA\x00ENABLE_FTS5\x00ENABLE_GEOPOLY\x00ENABLE_JSON1\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=1073741823\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\x00BINARY\x00ANY\x00BLOB\x00INT\x00INTEGER\x00REAL\x00TEXT\x0020b:20e\x0020c:20e\x0020e\x0040f-21a-21d\x00now\x00local time unavailable\x00second\x00minute\x00hour\x00day\x00month\x00year\x00localtime\x00unixepoch\x00utc\x00weekday \x00start of \x00%04d-%02d-%02d %02d:%02d:%02d\x00%02d:%02d:%02d\x00%04d-%02d-%02d\x00%02d\x00%06.3f\x00%03d\x00%.16g\x00%lld\x00%04d\x00julianday\x00date\x00time\x00datetime\x00strftime\x00current_time\x00current_timestamp\x00current_date\x00failed to allocate %u bytes of memory\x00failed memory resize %u to %u bytes\x000123456789ABCDEF0123456789abcdef\x00-x0\x00X0\x00%\x00NaN\x00Inf\x00\x00NULL\x00(NULL)\x00.\x00SUBQUERY %u\x00thstndrd\x00922337203685477580\x00API call with %s database connection pointer\x00unopened\x00invalid\x00Savepoint\x00AutoCommit\x00Transaction\x00SorterNext\x00Prev\x00Next\x00Checkpoint\x00JournalMode\x00Vacuum\x00VFilter\x00VUpdate\x00Goto\x00Gosub\x00InitCoroutine\x00Yield\x00MustBeInt\x00Jump\x00Once\x00If\x00Not\x00IfNot\x00IsNullOrType\x00IfNullRow\x00SeekLT\x00SeekLE\x00SeekGE\x00SeekGT\x00IfNotOpen\x00IfNoHope\x00NoConflict\x00NotFound\x00Found\x00SeekRowid\x00NotExists\x00Last\x00IfSmaller\x00SorterSort\x00Sort\x00Rewind\x00IdxLE\x00IdxGT\x00IdxLT\x00IdxGE\x00Or\x00And\x00RowSetRead\x00RowSetTest\x00Program\x00FkIfZero\x00IfPos\x00IsNull\x00NotNull\x00Ne\x00Eq\x00Gt\x00Le\x00Lt\x00Ge\x00ElseEq\x00IfNotZero\x00DecrJumpZero\x00IncrVacuum\x00VNext\x00Init\x00PureFunc\x00Function\x00Return\x00EndCoroutine\x00HaltIfNull\x00Halt\x00Integer\x00Int64\x00String\x00Null\x00SoftNull\x00Blob\x00Variable\x00Move\x00Copy\x00SCopy\x00IntCopy\x00ChngCntRow\x00ResultRow\x00CollSeq\x00AddImm\x00RealAffinity\x00Cast\x00Permutation\x00Compare\x00IsTrue\x00ZeroOrNull\x00Offset\x00Column\x00TypeCheck\x00Affinity\x00MakeRecord\x00Count\x00ReadCookie\x00SetCookie\x00ReopenIdx\x00OpenRead\x00OpenWrite\x00BitAnd\x00BitOr\x00ShiftLeft\x00ShiftRight\x00Add\x00Subtract\x00Multiply\x00Divide\x00Remainder\x00Concat\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\x00VColumn\x00VRename\x00Pagecount\x00MaxPgcnt\x00Trace\x00CursorHint\x00ReleaseReg\x00Noop\x00Explain\x00Abortable\x00open\x00close\x00access\x00getcwd\x00stat\x00fstat\x00ftruncate\x00fcntl\x00read\x00pread\x00pread64\x00write\x00pwrite\x00pwrite64\x00fchmod\x00fallocate\x00unlink\x00openDirectory\x00mkdir\x00rmdir\x00fchown\x00geteuid\x00mmap\x00munmap\x00mremap\x00getpagesize\x00readlink\x00lstat\x00ioctl\x00attempt to open \"%s\" as file descriptor %d\x00/dev/null\x00os_unix.c:%d: (%d) %s(%s) - %s\x00cannot fstat db file %s\x00file unlinked while open: %s\x00multiple links to file: %s\x00file renamed while open: %s\x00%s\x00full_fsync\x00%s-shm\x00readonly_shm\x00psow\x00unix-excl\x00%s.lock\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\x00ATTACH x AS %Q\x00recovered %d pages from %s\x00-journal\x00-wal\x00nolock\x00immutable\x00recovered %d frames from WAL file %s\x00cannot limit WAL size: %s\x00SQLite format 3\x00:memory:\x00@ \x00\n\x00invalid page number %d\x002nd reference to page %d\x00Failed to read ptrmap key=%d\x00Bad ptr map entry key=%d expected=(%d,%d) got=(%d,%d)\x00failed to get page %d\x00freelist leaf count too big on page %d\x00%s is %d but should be %d\x00size\x00overflow list length\x00Page %u: \x00unable to get the page. error code=%d\x00btreeInitPage() returns error code %d\x00free space corruption\x00On tree page %u cell %d: \x00On page %u at right child: \x00Offset %d out of range %d..%d\x00Extends off end of page\x00Rowid %lld out of order\x00Child page depth differs\x00Multiple uses for byte %u of page %u\x00Fragmentation of %d bytes reported as %d on page %u\x00Main freelist: \x00max rootpage (%d) disagrees with header (%d)\x00incremental_vacuum enabled with a max rootpage of zero\x00Page %d is never used\x00Pointer map page %d is referenced\x00unknown database %s\x00destination database is in use\x00source and destination must be distinct\x00%!.15g\x00-\x00%s%s\x00k(%d\x00B\x00,%s%s%s\x00N.\x00)\x00%.18s-%s\x00%s(%d)\x00%d\x00(blob)\x00vtab:%p\x00%c%u\x00]\x00program\x00?\x008\x0016LE\x0016BE\x00addr\x00opcode\x00p1\x00p2\x00p3\x00p4\x00p5\x00comment\x00id\x00parent\x00notused\x00detail\x00%.4c%s%.16c\x00MJ delete: %s\x00MJ collide: %s\x00-mj%06X9%02X\x00FOREIGN KEY constraint failed\x00a CHECK constraint\x00a generated column\x00an index\x00non-deterministic use of %s() in %s\x00API called with finalized prepared statement\x00API called with NULL prepared statement\x00string or blob too big\x00bind on a busy prepared statement: [%s]\x00-- \x00'%.*q'\x00zeroblob(%d)\x00x'\x00%02x\x00'\x00%s constraint failed\x00%z: %s\x00abort at %d in [%s]: %s\x00cannot 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\x00cannot change %s wal mode from within a transaction\x00into\x00out of\x00database table is locked: %s\x00-- %s\x00statement aborts at %d: [%s] %s\x00out of memory\x00NOT NULL\x00UNIQUE\x00CHECK\x00FOREIGN KEY\x00cannot open value of type %s\x00null\x00real\x00integer\x00no such rowid: %lld\x00cannot open virtual table: %s\x00cannot open table without rowid: %s\x00cannot open view: %s\x00no such column: \"%s\"\x00foreign key\x00indexed\x00cannot open %s column for writing\x00main\x00new\x00old\x00excluded\x00misuse of aliased aggregate %s\x00misuse of aliased window function %s\x00row value misused\x00double-quoted string literal: \"%w\"\x00no such column\x00ambiguous column name\x00%s: %s.%s.%s\x00%s: %s.%s\x00%s: %s\x00partial index WHERE clauses\x00index expressions\x00CHECK constraints\x00generated columns\x00%s prohibited in %s\x00true\x00false\x00the \".\" operator\x00second argument to likelihood() must be a constant between 0.0 and 1.0\x00not authorized to use function: %s\x00non-deterministic functions\x00%.*s() may not be used as a window function\x00window\x00aggregate\x00misuse of %s function %.*s()\x00no such function: %.*s\x00wrong number of arguments to function %.*s()\x00FILTER may not be used with non-aggregate %.*s()\x00subqueries\x00parameters\x00%r %s BY term out of range - should be between 1 and %d\x00too many terms in ORDER BY clause\x00ORDER\x00%r ORDER BY term does not match any column in the result set\x00too many terms in %s BY clause\x00a GROUP BY clause is required before HAVING\x00GROUP\x00aggregate functions are not allowed in the GROUP BY clause\x00Expression tree is too large (maximum depth %d)\x00IN(...) element has %d term%s - expected %d\x00s\x000\x00too many arguments on function %T\x00unsafe use of %s()\x00variable number must be between ?1 and ?%d\x00too many SQL variables\x00%d columns assigned %d values\x00too many columns in %s\x00_ROWID_\x00ROWID\x00OID\x00USING ROWID SEARCH ON TABLE %s FOR IN-OPERATOR\x00USING INDEX %s FOR IN-OPERATOR\x00sub-select returns %d columns - expected %d\x00REUSE LIST SUBQUERY %d\x00%sLIST SUBQUERY %d\x00CORRELATED \x00REUSE SUBQUERY %d\x00%sSCALAR SUBQUERY %d\x001\x000x\x00hex literal too big: %s%s\x00generated column loop on \"%s\"\x00blob\x00text\x00numeric\x00none\x00misuse of aggregate: %s()\x00unknown function: %s()\x00RAISE() may only be used within a trigger-program\x00B\x00C\x00D\x00E\x00sqlite_\x00table %s may not be altered\x00SELECT 1 FROM \"%w\".sqlite_master WHERE name NOT LIKE 'sqliteX_%%' ESCAPE 'X' AND sql NOT LIKE 'create virtual%%' AND sqlite_rename_test(%Q, sql, type, name, %d, %Q, %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') ELSE raise(ABORT,'NOT NULL constraint failed') END FROM pragma_quick_check(\"%w\",\"%w\") WHERE quick_check GLOB 'CHECK*' OR quick_check GLOB 'NULL*'\x00virtual tables may not be altered\x00Cannot add a column to a view\x00sqlite_altertab_%s\x00view\x00virtual table\x00cannot %s %s \"%s\"\x00drop column from\x00rename columns of\x00UPDATE \"%w\".sqlite_master SET sql = sqlite_rename_column(sql, type, name, %Q, %Q, %d, %Q, %d, %d) WHERE name NOT LIKE 'sqliteX_%%' ESCAPE 'X' AND (type != 'index' OR tbl_name = %Q)\x00UPDATE temp.sqlite_master SET sql = sqlite_rename_column(sql, type, name, %Q, %Q, %d, %Q, %d, 1) WHERE type IN ('trigger', 'view')\x00error in %s %s%s%s: %s\x00 \x00\"%w\" \x00%Q%s\x00%.*s%s\x00cannot drop %s column: \"%s\"\x00PRIMARY KEY\x00cannot drop column \"%s\": no other columns exist\x00UPDATE \"%w\".sqlite_master SET sql = sqlite_drop_column(%d, sql, %d) WHERE (type=='table' AND tbl_name=%Q COLLATE nocase)\x00after drop column\x00sqlite_rename_column\x00sqlite_rename_table\x00sqlite_rename_test\x00sqlite_drop_column\x00sqlite_rename_quotefix\x00CREATE TABLE %Q.%s(%s)\x00DELETE FROM %Q.%s WHERE %s=%Q\x00DELETE FROM %Q.%s\x00sqlite_stat1\x00tbl,idx,stat\x00sqlite_stat4\x00tbl,idx,neq,nlt,ndlt,sample\x00sqlite_stat3\x00stat_init\x00stat_push\x00%llu\x00 %llu\x00%llu \x00stat_get\x00sqlite\\_%\x00BBB\x00idx\x00tbl\x00unordered*\x00sz=[0-9]*\x00noskipscan*\x00SELECT idx,count(*) FROM %Q.sqlite_stat4 GROUP BY idx\x00SELECT idx,neq,nlt,ndlt,sample FROM %Q.sqlite_stat4\x00SELECT tbl,idx,stat FROM %Q.sqlite_stat1\x00x\x00\x00too many attached databases - max %d\x00database %s is already in use\x00database is already attached\x00attached databases must use the same text encoding as main database\x00unable to open database: %s\x00no such database: %s\x00cannot detach database %s\x00database %s is locked\x00sqlite_detach\x00sqlite_attach\x00%s cannot use variables\x00%s %T cannot reference objects in database %s\x00authorizer malfunction\x00%s.%s\x00%s.%z\x00access to %z is prohibited\x00not authorized\x00sqlite_temp_schema\x00sqlite_schema\x00sqlite_temp_master\x00pragma_\x00no such view\x00no such table\x00corrupt database\x00unknown database %T\x00object name reserved for internal use: %s\x00temporary table name must be unqualified\x00table %T already exists\x00there is already an index named %s\x00sqlite_returning\x00cannot use RETURNING in a trigger\x00too many columns on %s\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'\x00parameters are not allowed in views\x00view %s is circularly defined\x00corrupt schema\x00UPDATE %Q.sqlite_master SET rootpage=%d WHERE #%d AND rootpage=#%d\x00sqlite_stat%d\x00DELETE FROM %Q.sqlite_sequence WHERE name=%Q\x00DELETE FROM %Q.sqlite_master WHERE tbl_name=%Q and type!='trigger'\x00table %s may not be dropped\x00use DROP TABLE to delete table %s\x00use DROP VIEW to delete view %s\x00foreign key on %s should reference only one column of table %T\x00number of columns in foreign key does not match the number of columns in the referenced table\x00unknown column \"%s\" in foreign key definition\x00unsupported use of NULLS %s\x00FIRST\x00LAST\x00index\x00cannot create a TEMP index on non-TEMP table \"%s\"\x00table %s may not be indexed\x00views may not be indexed\x00virtual tables may not be indexed\x00there is already a table named %s\x00index %s already exists\x00sqlite_autoindex_%s_%d\x00expressions prohibited in PRIMARY KEY and UNIQUE constraints\x00conflicting ON CONFLICT clauses specified\x00invalid rootpage\x00CREATE%s INDEX %.*s\x00 UNIQUE\x00INSERT INTO %Q.sqlite_master VALUES('index',%Q,%Q,#%d,%Q);\x00name='%q' AND type='index'\x00no such index: %S\x00index associated with UNIQUE or PRIMARY KEY constraint cannot be dropped\x00DELETE FROM %Q.sqlite_master WHERE name=%Q AND type='index'\x00too many FROM clause terms, max: %d\x00a JOIN clause is required before %s\x00ON\x00USING\x00BEGIN\x00ROLLBACK\x00COMMIT\x00RELEASE\x00unable to open a temporary database file for storing temporary tables\x00index '%q'\x00, \x00%s.rowid\x00unable to identify the object to be reindexed\x00duplicate WITH table name: %s\x00no such collation sequence: %s\x00table %s may not be modified\x00cannot modify %s because it is a view\x00rows deleted\x00integer overflow\x00%.*f\x00LIKE or GLOB pattern too complex\x00ESCAPE expression must be a single character\x00%!.20e\x00?000\x00MATCH\x00like\x00implies_nonnull_row\x00expr_compare\x00expr_implies_expr\x00affinity\x00soundex\x00load_extension\x00sqlite_compileoption_used\x00sqlite_compileoption_get\x00unlikely\x00likelihood\x00likely\x00sqlite_offset\x00ltrim\x00rtrim\x00trim\x00min\x00max\x00typeof\x00length\x00instr\x00printf\x00unicode\x00char\x00abs\x00round\x00upper\x00lower\x00hex\x00ifnull\x00random\x00randomblob\x00nullif\x00sqlite_version\x00sqlite_source_id\x00sqlite_log\x00quote\x00last_insert_rowid\x00changes\x00total_changes\x00replace\x00zeroblob\x00substr\x00substring\x00sum\x00total\x00avg\x00count\x00group_concat\x00glob\x00coalesce\x00sign\x00iif\x00foreign key mismatch - \"%w\" referencing \"%w\"\x00cannot INSERT into generated column \"%s\"\x00table %S has no column named %s\x00table %S has %d columns but %d values were supplied\x00%d values for %d columns\x00UPSERT not implemented for virtual table \"%s\"\x00cannot UPSERT a view\x00rows inserted\x00sqlite3_extension_init\x00sqlite3_\x00lib\x00_init\x00no entry point [%s] in shared library [%s]\x00error during initialization: %s\x00unable to open shared library [%.*s]\x00so\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\x00log\x00checkpointed\x00database\x00status\x00cache_size\x00timeout\x00analysis_limit\x00application_id\x00auto_vacuum\x00automatic_index\x00busy_timeout\x00cache_spill\x00case_sensitive_like\x00cell_size_check\x00checkpoint_fullfsync\x00collation_list\x00compile_options\x00count_changes\x00data_version\x00database_list\x00default_cache_size\x00defer_foreign_keys\x00empty_result_callbacks\x00encoding\x00foreign_key_check\x00foreign_key_list\x00foreign_keys\x00freelist_count\x00full_column_names\x00fullfsync\x00function_list\x00hard_heap_limit\x00ignore_check_constraints\x00incremental_vacuum\x00index_info\x00index_list\x00index_xinfo\x00integrity_check\x00journal_mode\x00journal_size_limit\x00legacy_alter_table\x00locking_mode\x00max_page_count\x00mmap_size\x00module_list\x00optimize\x00page_count\x00page_size\x00pragma_list\x00query_only\x00quick_check\x00read_uncommitted\x00recursive_triggers\x00reverse_unordered_selects\x00schema_version\x00secure_delete\x00short_column_names\x00shrink_memory\x00soft_heap_limit\x00synchronous\x00table_info\x00table_list\x00table_xinfo\x00temp_store\x00temp_store_directory\x00threads\x00trusted_schema\x00user_version\x00wal_autocheckpoint\x00wal_checkpoint\x00writable_schema\x00onoffalseyestruextrafull\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\x00w\x00a\x00sissii\x00utf8\x00utf16le\x00utf16be\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\x00NULL value in %s.%s\x00non-%s value in %s.%s\x00CHECK constraint failed in %s\x00row \x00 missing from index \x00non-unique entry in index \x00wrong # of entries in index \x00ok\x00unsupported encoding: %s\x00restart\x00ANALYZE \"%w\".\"%w\"\x00UTF8\x00UTF-8\x00UTF-16le\x00UTF-16be\x00UTF16le\x00UTF16be\x00UTF-16\x00UTF16\x00CREATE TABLE x\x00%c\"%s\"\x00(\"%s\"\x00,arg HIDDEN\x00,schema HIDDEN\x00PRAGMA \x00%Q.\x00=%Q\x00error in %s %s after %s: %s\x00malformed database schema (%s)\x00%z - %s\x00rename\x00drop column\x00add column\x00orphan index\x00CREATE TABLE x(type text,name text,tbl_name text,rootpage int,sql text)\x00unsupported file format\x00SELECT*FROM\"%w\".%s ORDER BY rowid\x00database schema is locked: %s\x00statement too long\x00unknown or unsupported join type: %T %T%s%T\x00RIGHT and FULL OUTER JOINs are not currently supported\x00naturaleftouterightfullinnercross\x00a NATURAL join may not have an ON or USING clause\x00cannot have both ON and USING clauses in the same join\x00cannot join using column %s - column not present in both tables\x00UNION ALL\x00INTERSECT\x00EXCEPT\x00UNION\x00USE TEMP B-TREE FOR %s\x00column%d\x00%.*z:%u\x00cannot use window functions in recursive queries\x00recursive aggregate queries not supported\x00SETUP\x00RECURSIVE STEP\x00SCAN %d CONSTANT ROW%s\x00S\x00COMPOUND QUERY\x00LEFT-MOST SUBQUERY\x00%s USING TEMP B-TREE\x00all VALUES must have the same number of terms\x00SELECTs to the left and right of %s do not have the same number of result columns\x00MERGE (%s)\x00LEFT\x00RIGHT\x00no such index: %s\x00'%s' is not a function\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\x00subquery_%u\x00too many references to \"%s\": max 65535\x00access to view \"%s\" prohibited\x00unsafe use of virtual table \"%s\"\x00*\x00%s.%s.%s\x00no such table: %s\x00no tables specified\x00too many columns in result set\x00DISTINCT aggregates must have exactly one argument\x00USE TEMP B-TREE FOR %s(DISTINCT)\x00SCAN %s%s%s\x00 USING COVERING INDEX \x00target object/alias may not appear in FROM clause: %s\x00expected %d columns for '%s' but got %d\x00CO-ROUTINE %!S\x00MATERIALIZE %!S\x00DISTINCT\x00GROUP BY\x00RIGHT PART OF ORDER BY\x00ORDER BY\x00sqlite3_get_table() called with two or more incompatible queries\x00temporary trigger may not have qualified name\x00trigger\x00cannot create triggers on virtual tables\x00trigger %T already exists\x00cannot create trigger on system table\x00cannot create %s trigger on view: %S\x00BEFORE\x00AFTER\x00cannot create INSTEAD OF trigger on table: %S\x00INSERT INTO %Q.sqlite_master VALUES('trigger',%Q,%Q,0,'CREATE TRIGGER %q')\x00type='trigger' AND name='%q'\x00no such trigger: %S\x00DELETE FROM %Q.sqlite_master WHERE name=%Q AND type='trigger'\x00%s RETURNING is not available on virtual tables\x00DELETE\x00UPDATE\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\x00<expr>\x00 AND \x00(\x00 (\x00%s=?\x00ANY(%s)\x00>\x00<\x00%s %S\x00SEARCH\x00SCAN\x00AUTOMATIC PARTIAL COVERING INDEX\x00AUTOMATIC COVERING INDEX\x00COVERING INDEX %s\x00INDEX %s\x00 USING \x00=\x00>? AND rowid<\x00 USING INTEGER PRIMARY KEY (rowid%s?)\x00 VIRTUAL TABLE INDEX %d:%s\x00MULTI-INDEX OR\x00INDEX %d\x00regexp\x00ON clause references tables to its right\x00NOCASE\x00too many arguments on %s() - max %d\x00automatic index on %s(%s)\x00auto-index\x00%s.xBestIndex malfunction\x00abbreviated query algorithm search\x00no query solution\x00at most %d tables in a join\x00SCAN CONSTANT ROW\x00second argument to nth_value must be a positive integer\x00argument of ntile must be a positive integer\x00row_number\x00dense_rank\x00rank\x00percent_rank\x00cume_dist\x00ntile\x00last_value\x00nth_value\x00first_value\x00lead\x00lag\x00no such window: %s\x00RANGE with offset PRECEDING/FOLLOWING requires one ORDER BY expression\x00FILTER clause may only be used with aggregate window functions\x00unsupported frame specification\x00PARTITION clause\x00ORDER BY clause\x00frame specification\x00cannot override %s of window: %s\x00DISTINCT is not supported for window functions\x00frame starting offset must be a non-negative integer\x00frame ending offset must be a non-negative integer\x00frame starting offset must be a non-negative number\x00frame ending offset must be a non-negative number\x00%s clause should come after %s not before\x00LIMIT\x00too many terms in compound SELECT\x00syntax error after column name \"%.*s\"\x00parser stack overflow\x00unknown table option: %.*s\x00set list\x00near \"%T\": syntax error\x00qualified table names are not allowed on INSERT, UPDATE, and DELETE statements within triggers\x00the INDEXED BY clause is not allowed on UPDATE or DELETE statements within triggers\x00the NOT INDEXED clause is not allowed on UPDATE or DELETE statements within triggers\x00incomplete input\x00unrecognized token: \"%.*s\"\x00%s in \"%s\"\x00create\x00temp\x00temporary\x00end\x00explain\x00unable to close due to unfinalized statements or unfinished backups\x00unknown error\x00abort due to ROLLBACK\x00another row available\x00no more rows available\x00not an error\x00SQL logic error\x00access permission denied\x00query aborted\x00database is locked\x00database table is locked\x00attempt to write a readonly database\x00interrupted\x00disk I/O error\x00database disk image is malformed\x00unknown operation\x00database or disk is full\x00unable to open database file\x00locking protocol\x00constraint failed\x00datatype mismatch\x00bad parameter or other API misuse\x00authorization denied\x00column index out of range\x00file is not a database\x00notification message\x00warning message\x00unable to delete/modify user-function due to active statements\x00unable to use function %s in the requested context\x00unknown database: %s\x00unable to delete/modify collation sequence due to active statements\x00file:\x00localhost\x00invalid uri authority: %.*s\x00vfs\x00cache\x00mode\x00no such %s mode: %s\x00%s mode not allowed: %s\x00no such vfs: %s\x00shared\x00private\x00ro\x00rw\x00rwc\x00RTRIM\x00\x00\x00\x00%s at line %d of [%.10s]\x00database corruption\x00misuse\x00cannot open file\x00no such table column: %s.%s\x00SQLITE_\x00database is deadlocked\x00array\x00object\x000123456789abcdef\x00JSON cannot hold BLOB values\x00malformed JSON\x00[0]\x00JSON path error near '%q'\x00json_%s() needs an odd number of arguments\x00json_object() requires an even number of arguments\x00json_object() labels must be TEXT\x00set\x00insert\x00[]\x00{}\x00CREATE TABLE x(key,value,type,atom,id,parent,fullkey,path,json HIDDEN,root HIDDEN)\x00[%d]\x00.%.*s\x00$\x00json\x00json_array\x00json_array_length\x00json_extract\x00json_insert\x00json_object\x00json_patch\x00json_quote\x00json_remove\x00json_replace\x00json_set\x00json_type\x00json_valid\x00json_group_array\x00json_group_object\x00json_each\x00json_tree\x00%s_node\x00data\x00DROP TABLE '%q'.'%q_node';DROP TABLE '%q'.'%q_rowid';DROP TABLE '%q'.'%q_parent';\x00RtreeMatchArg\x00SELECT * FROM %Q.%Q\x00UNIQUE constraint failed: %s.%s\x00rtree constraint failed: %s.(%s<=%s)\x00ALTER TABLE %Q.'%q_node' RENAME TO \"%w_node\";ALTER TABLE %Q.'%q_parent' RENAME TO \"%w_parent\";ALTER TABLE %Q.'%q_rowid' RENAME TO \"%w_rowid\";\x00SELECT stat FROM %Q.sqlite_stat1 WHERE tbl = '%q_rowid'\x00node\x00CREATE TABLE \"%w\".\"%w_rowid\"(rowid INTEGER PRIMARY KEY,nodeno\x00,a%d\x00);CREATE TABLE \"%w\".\"%w_node\"(nodeno INTEGER PRIMARY KEY,data);\x00CREATE TABLE \"%w\".\"%w_parent\"(nodeno INTEGER PRIMARY KEY,parentnode);\x00INSERT INTO \"%w\".\"%w_node\"VALUES(1,zeroblob(%d))\x00INSERT INTO\"%w\".\"%w_rowid\"(rowid,nodeno)VALUES(?1,?2)ON CONFLICT(rowid)DO UPDATE SET nodeno=excluded.nodeno\x00SELECT * FROM \"%w\".\"%w_rowid\" WHERE rowid=?1\x00UPDATE \"%w\".\"%w_rowid\"SET \x00a%d=coalesce(?%d,a%d)\x00a%d=?%d\x00 WHERE rowid=?1\x00INSERT OR REPLACE INTO '%q'.'%q_node' VALUES(?1, ?2)\x00DELETE FROM '%q'.'%q_node' WHERE nodeno = ?1\x00SELECT nodeno FROM '%q'.'%q_rowid' WHERE rowid = ?1\x00INSERT OR REPLACE INTO '%q'.'%q_rowid' VALUES(?1, ?2)\x00DELETE FROM '%q'.'%q_rowid' WHERE rowid = ?1\x00SELECT parentnode FROM '%q'.'%q_parent' WHERE nodeno = ?1\x00INSERT OR REPLACE INTO '%q'.'%q_parent' VALUES(?1, ?2)\x00DELETE FROM '%q'.'%q_parent' WHERE nodeno = ?1\x00PRAGMA %Q.page_size\x00SELECT length(data) FROM '%q'.'%q_node' WHERE nodeno = 1\x00undersize RTree blobs in \"%q_node\"\x00Wrong number of columns for an rtree table\x00Too few columns for an rtree table\x00Too many columns for an rtree table\x00Auxiliary rtree columns must be last\x00CREATE TABLE x(%.*s INT\x00,%.*s\x00);\x00,%.*s REAL\x00,%.*s INT\x00{%lld\x00 %g\x00}\x00Invalid argument to rtreedepth()\x00%z%s%z\x00SELECT data FROM %Q.'%q_node' WHERE nodeno=?\x00Node %lld missing from database\x00SELECT parentnode FROM %Q.'%q_parent' WHERE nodeno=?1\x00SELECT nodeno FROM %Q.'%q_rowid' WHERE rowid=?1\x00Mapping (%lld -> %lld) missing from %s table\x00%_rowid\x00%_parent\x00Found (%lld -> %lld) in %s table, expected (%lld -> %lld)\x00Dimension %d of cell %d on node %lld is corrupt\x00Dimension %d of cell %d on node %lld is corrupt relative to parent\x00Node %lld is too small (%d bytes)\x00Rtree depth out of range (%d)\x00Node %lld is too small for cell count of %d (%d bytes)\x00SELECT count(*) FROM %Q.'%q%s'\x00Wrong number of entries in %%%s table - expected %lld, actual %lld\x00SELECT * FROM %Q.'%q_rowid'\x00Schema corrupt or not an rtree\x00_rowid\x00_parent\x00END\x00wrong number of arguments to function rtreecheck()\x00[\x00[%!g,%!g],\x00[%!g,%!g]]\x00<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\x00geopoly_area\x00geopoly_blob\x00geopoly_json\x00geopoly_svg\x00geopoly_contains_point\x00geopoly_debug\x00geopoly_bbox\x00geopoly_xform\x00geopoly_regular\x00geopoly_ccw\x00geopoly_group_bbox\x00rtreenode\x00rtreedepth\x00rtreecheck\x00rtree_i32\x00corrupt fossil delta\x00DROP TRIGGER IF EXISTS temp.rbu_insert_tr;DROP TRIGGER IF EXISTS temp.rbu_update1_tr;DROP TRIGGER IF EXISTS temp.rbu_update2_tr;DROP TRIGGER IF EXISTS temp.rbu_delete_tr;\x00SELECT rbu_target_name(name, type='view') AS target, name FROM sqlite_schema WHERE type IN ('table', 'view') AND target IS NOT NULL %s ORDER BY name\x00AND rootpage!=0 AND rootpage IS NOT NULL\x00SELECT name, rootpage, sql IS NULL OR substr(8, 6)=='UNIQUE' FROM main.sqlite_schema WHERE type='index' AND tbl_name = ?\x00SELECT (sql 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\x00table %q %s rbu_rowid column\x00may not have\x00requires\x00PRAGMA table_info(%Q)\x00column missing from %q: %s\x00%z%s\"%w\"\x00%z%s%s\"%w\"%s\x00SELECT max(_rowid_) FROM \"%s%w\"\x00 WHERE _rowid_ > %lld \x00 DESC\x00quote(\x00||','||\x00SELECT %s FROM \"%s%w\" ORDER BY %s LIMIT 1\x00 WHERE (%s) > (%s) \x00_rowid_\x00%z%s \"%w\" COLLATE %Q\x00%z%s \"rbu_imp_%d%w\" COLLATE %Q DESC\x00%z%s quote(\"rbu_imp_%d%w\")\x00SELECT %s FROM \"rbu_imp_%w\" ORDER BY %s LIMIT 1\x00%z%s%s\x00(%s) > (%s)\x00%z%s(%.*s) COLLATE %Q\x00%z%s\"%w\" COLLATE %Q\x00%z%s\"rbu_imp_%d%w\"%s\x00%z%s\"rbu_imp_%d%w\" %s COLLATE %Q\x00%z%s\"rbu_imp_%d%w\" IS ?\x00%z%s%s.\"%w\"\x00%z%sNULL\x00%z, %s._rowid_\x00_rowid_ = ?%d\x00%z%sc%d=?%d\x00_rowid_ = (SELECT id FROM rbu_imposter2 WHERE %z)\x00%z%s\"%w\"=?%d\x00invalid rbu_control value\x00%z%s\"%w\"=rbu_delta(\"%w\", ?%d)\x00%z%s\"%w\"=rbu_fossil_delta(\"%w\", ?%d)\x00PRIMARY KEY(\x00%z%s\"%w\"%s\x00%z)\x00SELECT name FROM sqlite_schema WHERE rootpage = ?\x00%z%sc%d %s COLLATE %Q\x00%z%sc%d%s\x00%z, id INTEGER\x00CREATE TABLE rbu_imposter2(%z, PRIMARY KEY(%z)) WITHOUT ROWID\x00PRIMARY KEY \x00%z%s\"%w\" %s %sCOLLATE %Q%s\x00 NOT NULL\x00%z, %z\x00CREATE TABLE \"rbu_imp_%w\"(%z)%s\x00 WITHOUT ROWID\x00INSERT INTO %s.'rbu_tmp_%q'(rbu_control,%s%s) VALUES(%z)\x00SELECT trim(sql) FROM sqlite_schema WHERE type='index' AND name=?\x00 LIMIT -1 OFFSET %d\x00CREATE TABLE \"rbu_imp_%w\"( %s, PRIMARY KEY( %s ) ) WITHOUT ROWID\x00INSERT INTO \"rbu_imp_%w\" VALUES(%s)\x00DELETE FROM \"rbu_imp_%w\" WHERE %s\x00SELECT %s, 0 AS rbu_control FROM '%q' %s %s %s ORDER BY %s%s\x00AND\x00WHERE\x00SELECT %s, rbu_control FROM %s.'rbu_tmp_%q' %s ORDER BY %s%s\x00SELECT %s, rbu_control FROM %s.'rbu_tmp_%q' %s UNION ALL SELECT %s, rbu_control FROM '%q' %s %s typeof(rbu_control)='integer' AND rbu_control!=1 ORDER BY %s%s\x00rbu_imp_\x00INSERT INTO \"%s%w\"(%s%s) VALUES(%s)\x00, _rowid_\x00DELETE FROM \"%s%w\" WHERE %s\x00, rbu_rowid\x00CREATE TABLE IF NOT EXISTS %s.'rbu_tmp_%q' AS SELECT *%s FROM '%q' WHERE 0;\x00, 0 AS rbu_rowid\x00CREATE TEMP TRIGGER rbu_delete_tr BEFORE DELETE ON \"%s%w\" BEGIN SELECT rbu_tmp_insert(3, %s);END;CREATE TEMP TRIGGER rbu_update1_tr BEFORE UPDATE ON \"%s%w\" BEGIN SELECT rbu_tmp_insert(3, %s);END;CREATE TEMP TRIGGER rbu_update2_tr AFTER UPDATE ON \"%s%w\" BEGIN SELECT rbu_tmp_insert(4, %s);END;\x00CREATE TEMP TRIGGER rbu_insert_tr AFTER INSERT ON \"%s%w\" BEGIN SELECT rbu_tmp_insert(0, %s);END;\x00,_rowid_ \x00,rbu_rowid\x00SELECT %s,%s rbu_control%s FROM '%q'%s %s %s %s\x000 AS \x00UPDATE \"%s%w\" SET %s WHERE %s\x00SELECT k, v FROM %s.rbu_state\x00file://%s-vacuum?modeof=%s\x00ATTACH %Q AS stat\x00CREATE TABLE IF NOT EXISTS %s.rbu_state(k INTEGER PRIMARY KEY, v)\x00cannot vacuum wal mode database\x00file:%s-vactmp?rbu_memory=1%s%s\x00&\x00rbu_tmp_insert\x00rbu_fossil_delta\x00rbu_target_name\x00SELECT * FROM sqlite_schema\x00rbu vfs not found\x00PRAGMA main.wal_checkpoint=restart\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\x00database modified during rbu %s\x00vacuum\x00update\x00BEGIN IMMEDIATE\x00PRAGMA journal_mode=off\x00-vactmp\x00DELETE FROM stat.rbu_state\x00rbu/zipvfs setup error\x00rbu(%s)/%z\x00rbu_memory\x00SELECT 0, 'tbl', '', 0, '', 1 UNION ALL SELECT 1, 'idx', '', 0, '', 2 UNION ALL SELECT 2, 'stat', '', 0, '', 0\x00PRAGMA '%q'.table_info('%q')\x00%z%s\"%w\".\"%w\".\"%w\"=\"%w\".\"%w\".\"%w\"\x00%z%s\"%w\".\"%w\".\"%w\" IS NOT \"%w\".\"%w\".\"%w\"\x00 OR \x00SELECT * FROM \"%w\".\"%w\" WHERE NOT EXISTS ( SELECT 1 FROM \"%w\".\"%w\" WHERE %s)\x00SELECT * FROM \"%w\".\"%w\", \"%w\".\"%w\" WHERE %s AND (%z)\x00table schemas do not match\x00SELECT tbl, ?2, stat FROM %Q.sqlite_stat1 WHERE tbl IS ?1 AND idx IS (CASE WHEN ?2=X'' THEN NULL ELSE ?2 END)\x00SELECT * FROM \x00 WHERE \x00 IS ?\x00SAVEPOINT changeset\x00RELEASE changeset\x00UPDATE main.\x00 SET \x00 = ?\x00idx IS CASE WHEN length(?4)=0 AND typeof(?4)='blob' THEN NULL ELSE ?4 END \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\x00content_rowid\x00multiple content_rowid=... directives\x00columnsize\x00malformed columnsize=... directive\x00columns\x00malformed detail=... directive\x00unrecognized option: \"%.*s\"\x00reserved fts5 column name: %s\x00unindexed\x00unrecognized column option: %s\x00T.%Q\x00, T.%Q\x00, T.c%d\x00reserved fts5 table name: %s\x00parse error in \"%s\"\x00docsize\x00%Q.'%q_%s'\x00CREATE TABLE x(\x00%z%s%Q\x00%z, %Q HIDDEN, %s HIDDEN)\x00pgsz\x00hashsize\x00automerge\x00usermerge\x00crisismerge\x00SELECT k, v FROM %Q.'%q_config'\x00version\x00invalid fts5 file format (found %d, expected %d) - run 'rebuild'\x00unterminated string\x00fts5: syntax error near \"%.1s\"\x00OR\x00NOT\x00NEAR\x00expected integer, got \"%.*s\"\x00fts5: column queries are not supported (detail=none)\x00fts5: %s queries are not supported (detail!=full)\x00phrase\x00block\x00REPLACE INTO '%q'.'%q_data'(id, block) VALUES(?,?)\x00DELETE FROM '%q'.'%q_data' WHERE id>=? AND id<=?\x00DELETE FROM '%q'.'%q_idx' WHERE segid=?\x00PRAGMA %Q.data_version\x00SELECT pgno FROM '%q'.'%q_idx' WHERE segid=? AND term<=? ORDER BY term DESC LIMIT 1\x00INSERT INTO '%q'.'%q_idx'(segid,term,pgno) VALUES(?,?,?)\x00%s_data\x00id INTEGER PRIMARY KEY, block BLOB\x00segid, term, pgno, PRIMARY KEY(segid, term)\x00SELECT segid, term, (pgno>>1), (pgno&1) FROM %Q.'%q_idx' WHERE segid=%d ORDER BY 1, 2\x00\x00\x00\x00\x00\x00recursively defined fts5 content table\x00SELECT rowid, rank FROM %Q.%Q ORDER BY %s(\"%w\"%s%s) %s\x00DESC\x00ASC\x00reads\x00unknown special query: %.*s\x00SELECT %s\x00no such function: %s\x00parse error in rank function: %s\x00%s: table does not support scanning\x00delete-all\x00'delete-all' may only be used with a contentless or external content fts5 table\x00rebuild\x00'rebuild' may not be used with a contentless fts5 table\x00merge\x00integrity-check\x00cannot %s contentless fts5 table: %s\x00DELETE from\x00no such cursor: %lld\x00no such tokenizer: %s\x00error in tokenizer constructor\x00fts5_api_ptr\x00fts5: 2021-11-27 14:13:22 bd41822c7424d393a30e92ff6cb254d25c26769889c1499a18a0b9339f5d6c8a\x00config\x00fts5\x00fts5_source_id\x00SELECT %s FROM %s T WHERE T.%Q >= ? AND T.%Q <= ? ORDER BY T.%Q ASC\x00SELECT %s FROM %s T WHERE T.%Q <= ? AND T.%Q >= ? ORDER BY T.%Q DESC\x00SELECT %s FROM %s T WHERE T.%Q=?\x00INSERT INTO %Q.'%q_content' VALUES(%s)\x00REPLACE INTO %Q.'%q_content' VALUES(%s)\x00DELETE FROM %Q.'%q_content' WHERE id=?\x00REPLACE INTO %Q.'%q_docsize' VALUES(?,?)\x00DELETE FROM %Q.'%q_docsize' WHERE id=?\x00SELECT sz FROM %Q.'%q_docsize' WHERE id=?\x00REPLACE INTO %Q.'%q_config' VALUES(?,?)\x00SELECT %s FROM %s AS T\x00DROP TABLE IF EXISTS %Q.'%q_data';DROP TABLE IF EXISTS %Q.'%q_idx';DROP TABLE IF EXISTS %Q.'%q_config';\x00DROP TABLE IF EXISTS %Q.'%q_docsize';\x00DROP TABLE IF EXISTS %Q.'%q_content';\x00ALTER TABLE %Q.'%q_%s' RENAME TO '%q_%s';\x00CREATE TABLE %Q.'%q_%q'(%s)%s\x00fts5: error creating shadow table %q_%s: %s\x00id INTEGER PRIMARY KEY\x00, c%d\x00id INTEGER PRIMARY KEY, sz BLOB\x00k PRIMARY KEY, v\x00DELETE FROM %Q.'%q_data';DELETE FROM %Q.'%q_idx';\x00DELETE FROM %Q.'%q_docsize';\x00SELECT count(*) FROM %Q.'%q_%s'\x00tokenchars\x00separators\x00L* N* Co\x00categories\x00remove_diacritics\x00unicode61\x00al\x00ance\x00ence\x00er\x00ic\x00able\x00ible\x00ant\x00ement\x00ment\x00ent\x00ion\x00ou\x00ism\x00ate\x00iti\x00ous\x00ive\x00ize\x00at\x00bl\x00ble\x00iz\x00ational\x00tional\x00tion\x00enci\x00anci\x00izer\x00logi\x00bli\x00alli\x00entli\x00eli\x00e\x00ousli\x00ization\x00ation\x00ator\x00alism\x00iveness\x00fulness\x00ful\x00ousness\x00aliti\x00iviti\x00biliti\x00ical\x00ness\x00icate\x00iciti\x00ative\x00alize\x00eed\x00ee\x00ed\x00ing\x00case_sensitive\x00ascii\x00porter\x00trigram\x00col\x00row\x00instance\x00fts5vocab: unknown table type: %Q\x00CREATE TABlE vocab(term, col, doc, cnt)\x00CREATE TABlE vocab(term, doc, cnt)\x00CREATE TABlE vocab(term, doc, col, offset)\x00wrong number of vtable arguments\x00recursive definition for %s.%s\x00SELECT t.%Q FROM %Q.%Q AS t WHERE t.%Q MATCH '*id'\x00no such fts5 table: %s.%s\x00fts5vocab\x002021-11-27 14:13:22 bd41822c7424d393a30e92ff6cb254d25c26769889c1499a18a0b9339f5d6c8a\x00"
var ts = (*reflect.StringHeader)(unsafe.Pointer(&ts1)).Data